motif-2.3.8/0000755000175000017500000000000013211513006007633 500000000000000motif-2.3.8/config.sub0000755000175000017500000010622313011021645011543 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-12-03' # 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # 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 1992-2014 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-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) 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 | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -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*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | 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 \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | 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-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | 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-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # 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 ;; aros) basic_machine=i386-pc os=-aros ;; 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 ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 | 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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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*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 ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; 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 ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-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 ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) 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 | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) 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 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; tile*) basic_machine=$basic_machine-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 ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-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[24]aeb | 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. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -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* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -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* | -es* | -tirtos*) # 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 ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) 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 ;; 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 ;; -cnk*|-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: motif-2.3.8/bindings/0000755000175000017500000000000013211513004011426 500000000000000motif-2.3.8/bindings/ncr_at0000644000175000017500000000257012672140200012547 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: ncr_at /main/6 1995/07/14 09:20:41 drk $ ! ! NCR XL Series X-Station ! PC AT keyboard osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 osfActivate : KP_Enter motif-2.3.8/bindings/sony0000644000175000017500000000260412672140200012267 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: sony /main/5 1995/07/14 09:21:08 drk $ ! !"Sony Corporation" ! ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine :Alt Right osfBeginLine :Alt Left osfPageUp :Alt Up osfPageDown :Alt Down osfBackSpace : BackSpace osfDelete : Delete osfInsert : F5 osfAddMode :Shift F18 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 osfSelect : Select osfActivate : KP_Enter motif-2.3.8/bindings/hitachi0000644000175000017500000000252312672140200012710 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: hitachi /main/6 1995/07/14 09:19:58 drk $ ! ! ! Hitachi System 2050 ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine :Alt Right osfBeginLine :Alt Left osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/ibm0000644000175000017500000000256412672140200012053 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: ibm /main/6 1995/07/14 09:20:11 drk $ ! !"International Business Machines" ! for AIX/PS2 and RS/6000 systems ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/dg_AViiON0000644000175000017500000000254212672140200013037 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: dg_AViiON /main/6 1995/07/14 09:19:45 drk $ ! !"Data General Corporation Rev 04" ! AViiON ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/siemens_wx2000000644000175000017500000000267112672140200013706 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: siemens_wx200 /main/6 1995/07/14 09:21:02 drk $ ! !"Siemens Munich by SP-4's Hacker Crew" ! Siemens WX200 system ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : Cancel osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete,F29 osfInsert : Insert osfAddMode :Shift F8 osfHelp : Help,F1 osfActivate : KP_Enter osfMenu : Menu,Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/hp0000644000175000017500000000267512726660441011734 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: hp /main/7 1996/11/21 13:06:42 cde-hp $ ! !"Hewlett-Packard Company" ! ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 osfSelect : Select osfClear : Clear osfUndo : Undo osfPrimaryPaste :Meta Ctrl Insert motif-2.3.8/bindings/acorn0000644000175000017500000000275312672140200012406 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: acorn /main/6 1995/07/14 09:19:28 drk $ ! !"Acorn Computers Ltd" ! Acorn RISC iX versions 1.0->1.2 running on Acorn R140, R225, R260 ! (all national keyboard variants) osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine :Alt Right osfBeginLine :Alt Left osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 osfActivate : KP_Enter osfCopy : Select motif-2.3.8/bindings/sgi0000644000175000017500000000254712672140200012067 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: sgi /main/7 1995/07/14 09:20:51 drk $ ! !"Silicon Graphics Inc." ! ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfActivate : KP_Enter osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/Makefile.in0000644000175000017500000003675113211512765013444 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = bindings ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(binddir)" DATA = $(bind_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(bind_DATA) README binddir = @XMBINDDIR_FALLBACK@ bind_DATA = \ xmbind.alias \ acorn \ apollo \ dec \ dg_AViiON \ doubleclick \ hal \ hitachi \ hp \ ibm \ intergraph \ intergraph17 \ megatek \ motorola \ ncr_at \ ncr_vt \ pc \ sgi \ sni \ sni_97801 \ siemens_9733 \ siemens_wx200 \ sony \ sun \ sun_at \ tek all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bindings/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-bindDATA: $(bind_DATA) @$(NORMAL_INSTALL) @list='$(bind_DATA)'; test -n "$(binddir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(binddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(binddir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(binddir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(binddir)" || exit $$?; \ done uninstall-bindDATA: @$(NORMAL_UNINSTALL) @list='$(bind_DATA)'; test -n "$(binddir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(binddir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(binddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-bindDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-bindDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-bindDATA install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-bindDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/bindings/ncr_vt0000644000175000017500000000267012672140200012575 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: ncr_vt /main/6 1995/07/14 09:20:46 drk $ ! ! NCR XL Series X-Station ! VT 220 keyboard osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine :Alt Right osfBeginLine :Alt Left osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : Help osfMenu :Shift F10 osfMenuBar : F10 osfSelect : Select osfActivate : KP_Enter osfQuickPaste : F17 motif-2.3.8/bindings/siemens_97330000644000175000017500000000260412672140200013427 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: siemens_9733 /main/6 1995/07/14 09:20:56 drk $ ! !"Siemens Munich (SP-4's hacker-clan)" ! Siemens 9733 system ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete_char osfInsert : Insert_char osfAddMode :Shift F8 osfHelp : Help osfMenu : Linefeed osfMenuBar : F10 motif-2.3.8/bindings/sun_at0000644000175000017500000000145212672140200012570 00000000000000! ! ! $Id: sun_at,v 1.2 2002/01/05 15:20:42 jimk Exp $ ! ! "Sun Microsystems, Inc." osfActivate : KP_Enter osfCancel : Escape osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfBeginLine : Home osfEndLine : End osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 motif-2.3.8/bindings/apollo0000644000175000017500000000277712672140200012600 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: apollo /main/6 1995/07/14 09:19:33 drk $ ! !"Apollo Computer Inc." ! ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : apRightBar osfBeginLine : apLeftBar osfPageUp : apUpBox osfPageDown : apDownBox osfPageLeft : apLeftBox osfPageRight : apRightBox osfBackSpace : BackSpace osfDelete : apCharDel osfInsert : Select osfAddMode :Shift F8 osfHelp : Help osfMenu :Shift F10 osfMenuBar : F10 osfCopy : apCopy osfCut : apCut osfPaste : apPaste osfUndo : Undo motif-2.3.8/bindings/motorola0000644000175000017500000000311012672140200013124 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: motorola /main/6 1995/07/14 09:20:35 drk $ ! !"Motorola Inc. (Microcomputer Division) " ! (c) Copyright 1990 Motorola Inc. ! Motorola provides these key bindings as is, ! with no guarantees or warranties implied. ! Motorola is under no obligation to support, ! update, or extend these key bindings for ! future releases. ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/sni0000644000175000017500000000256512672140200012076 00000000000000! $XConsortium: sni /main/4 1995/07/17 10:28:46 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY ! ! ! "Siemens Nixdorf Informationssysteme AG" ! SNI MFII keyboard osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode : Shift F8 osfHelp : F1 osfActivate : KP_Enter osfMenu : Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/xmbind.alias0000644000175000017500000000426612672140200013656 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $TOG: xmbind.alias /main/6 1999/03/26 17:03:23 samborn $ ! ! ! bindings alias file ! ! format: ! "[]" bindings_file ! "Acorn Computers Ltd" acorn "Apollo Computer Inc." apollo "DECWINDOWS DigitalEquipmentCorp." dec "DECWINDOWS DigitalEquipmentCorporation UWS2.2" dec "Data General Corporation Rev 04" dg_AViiON "Double Click Imaging, Inc. KeyX" doubleclick "HaL" hal "Hewlett-Packard Company" hp ! "Hitachi?" hitachi "International Business Machines" ibm "Intergraph Corporation" intergraph ! "Intergraph Corporation ?" intergraph17 "Megatek Corporation" megatek "Motorola Inc. (Microcomputer Division) " motorola ! "NCR?" ncr_at ! "NCR?" ncr_vt ! "?" (Generic PC keyboard bindings) pc "Silicon Graphics Inc." sgi "Silicon Graphics" sgi "Siemens Nixdorf Informationssysteme AG" sni "Siemens Nixdorf Informationssysteme AG (97801)" sni_97801 "Siemens Munich by SP-4's Hacker Crew" siemens_wx200 "Siemens Munich (SP-4's hacker-clan)" siemens_9733 "Sony Corporation" sony "X11/NeWS - Sun Microsystems Inc." sun ! sun: for Displays with Type-4/Type-5 keyboards ! sun_at: for Displays with PC AT style keyboards "Sun Microsystems, Inc." sun ! "Sun Microsystems, Inc." sun_at "Tektronix, Inc." tek motif-2.3.8/bindings/tek0000644000175000017500000000250412672140200012061 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: tek /main/6 1995/07/14 09:21:24 drk $ ! !"Tektronix, Inc." ! ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/megatek0000644000175000017500000000266212672140200012720 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: megatek /main/6 1995/07/14 09:20:29 drk $ ! !"Megatek Corporation" ! Megatek X-Cellerator ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : R13 osfBeginLine : F27 osfPageUp : F29 osfPageDown : F35 osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : Help osfMenu :Shift F10 osfMenuBar : F10 osfCopy : F16 osfCut : F20 osfPaste : F18 osfUndo : F14 motif-2.3.8/bindings/README0000644000175000017500000000175612672140200012243 00000000000000/* $XConsortium: README /main/3 1996/07/15 13:55:02 drk $ */ This directory contains a collection of sample ".motifbind" files: acorn apollo dec dg_AViiON doubleclick hitachi hp ibm intergraph17 intergraph megatek motorola ncr_at ncr_vt sgi siemens_9733 siemens_wx200 sun_mit sun_news tek These files were provided by various vendors, though not necessarily the vendors whose hardware they apply to. Each file contains a set of keyboard bindings that is suggested for use on that particular server/hardware combination. These files should be used as examples of ~/.motifbind files to work from. By copying the appropriate file into the user's home directory and renaming it to ".motifbind", the bindings will be recognized and used when the Motif window manager is (re)started. These bindings will override any other default bindings except those initiated within a client application (using XtOverrideTranslations). These examples are provided, as is, only as a service to the vendors and users. motif-2.3.8/bindings/doubleclick0000644000175000017500000000262712672140200013564 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: doubleclick /main/6 1995/07/14 09:19:51 drk $ ! !"Double Click Imaging, Inc. KeyX" ! for the version of KeyX running on 386 AT bus compatibles. ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : F1 osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/intergraph0000644000175000017500000000255212672140200013444 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: intergraph /main/6 1995/07/14 09:20:18 drk $ ! ! Intergraph ! with Delete & Backspace keys osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine :Alt Right osfBeginLine :Alt Left osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : Help osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/dec0000644000175000017500000000271112672140200012031 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: dec /main/6 1995/07/14 09:19:39 drk $ ! !"DECWINDOWS DigitalEquipmentCorp." ! ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine :Alt Right osfBeginLine :Alt Left osfPageUp : Prior osfPageDown : Next osfBackSpace : Delete osfDelete : DRemove osfInsert : Insert osfAddMode :Shift F8 osfHelp : Help osfMenu :Shift F10 osfMenuBar : F10 osfSelect : Select osfActivate : KP_Enter osfPrimaryPaste : F14 osfQuickPaste : F17 motif-2.3.8/bindings/sni_978010000644000175000017500000000265312672140200012644 00000000000000! $XConsortium: sni_97801 /main/4 1995/07/17 10:29:04 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY ! ! "Siemens Nixdorf Informationssysteme AG (97801)" ! SNI 97801 keyboard osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : Cancel,End osfBeginLine : Home osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete,F29 osfInsert : Insert osfAddMode : Shift F8 osfHelp : Help,F1 osfActivate : KP_Enter osfMenu : Menu,Shift F10 osfMenuBar : F10 motif-2.3.8/bindings/hal0000644000175000017500000000262112672140200012042 00000000000000! $XConsortium: hal /main/4 1995/07/17 10:28:29 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY ! ! ! "HaL" server for a Sun type 4 keyboard ! osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine : F33 osfBeginLine : F27 osfPageUp : F29 osfPageDown : F35 osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfAddMode :Shift F8 osfHelp : Help osfMenu :Shift F10 osfMenuBar : F10 osfCopy : F16 osfCut : F20 osfPaste : F18 osfUndo : F14 motif-2.3.8/bindings/sun0000644000175000017500000000113612672140200012103 00000000000000! ! ! $Id: sun,v 1.2 2002/01/05 15:20:42 jimk Exp $ ! ! "Sun Microsystems, Inc." osfActivate : KP_Enter osfCancel : Escape osfHelp : Help,F1 osfMenu :Shift F10 osfMenuBar : F10 osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfBeginLine : Home osfEndLine : End osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : Delete osfInsert : Insert osfUndo : Undo osfAddMode :Shift F8 osfCopy : SunCopy osfCut : SunCut osfPaste : SunPaste motif-2.3.8/bindings/Makefile.am0000644000175000017500000000060213145162623013415 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(bind_DATA) README binddir = @XMBINDDIR_FALLBACK@ bind_DATA = \ xmbind.alias \ acorn \ apollo \ dec \ dg_AViiON \ doubleclick \ hal \ hitachi \ hp \ ibm \ intergraph \ intergraph17 \ megatek \ motorola \ ncr_at \ ncr_vt \ pc \ sgi \ sni \ sni_97801 \ siemens_9733 \ siemens_wx200 \ sony \ sun \ sun_at \ tek motif-2.3.8/bindings/pc0000644000175000017500000000307212672140200011701 00000000000000! $XConsortium: pc /main/4 1995/07/17 10:28:38 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY ! Generic OSF/Motif Style Guide bindings for PC keyboards osfActivate : KP_Enter osfCancel : Escape osfMenuBar : F10 osfMenu : Shift F10 osfHelp : F1 osfBackSpace : BackSpace osfInsert : Insert osfDelete : Delete osfPageUp : Prior osfPageDown : Next osfPageLeft : Ctrl Prior osfPageRight : Ctrl Next osfEndLine : End osfBeginLine : Home osfLeft : Left osfRight : Right osfUp : Up osfDown : Down osfAddMode : Shift F8 osfCut : Shift Delete osfCopy : Ctrl Insert osfPaste : Shift Insert osfPrimaryPaste :Meta Ctrl Insert motif-2.3.8/bindings/intergraph170000644000175000017500000000260312672140200013611 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: intergraph17 /main/6 1995/07/14 09:20:24 drk $ ! ! Intergraph ! with single Delete/Backspace keys (use F17 for Delete) osfCancel : Escape osfLeft : Left osfUp : Up osfRight : Right osfDown : Down osfEndLine :Alt Right osfBeginLine :Alt Left osfPageUp : Prior osfPageDown : Next osfBackSpace : BackSpace osfDelete : F17 osfInsert : Insert osfAddMode :Shift F8 osfHelp : Help osfMenu :Shift F10 osfMenuBar : F10 motif-2.3.8/localized/0000755000175000017500000000000013211513004011577 500000000000000motif-2.3.8/localized/Makefile.in0000644000175000017500000004641113211512767013611 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = localized ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = SUBDIRS = util all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign localized/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign localized/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/localized/util/0000755000175000017500000000000013211513004012554 500000000000000motif-2.3.8/localized/util/mkcatdefs.c0000644000175000017500000003515213145162623014624 00000000000000/* $TOG: mkcatdefs.c /main/4 1997/03/31 13:43:31 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #ifdef aix #include #endif #ifdef hpux #ifndef _XPG2 #define _XPG2 #endif #endif #include #include #ifndef PATH_MAX #define PATH_MAX 1024 #endif #define MAXLINELEN 8192 #define KEY_START '$' #define MAXIDLEN 64 #ifdef _D_NAME_MAX #define MDIRSIZ _D_NAME_MAX #else #define MDIRSIZ 14 #endif static int errflg = 0; static int setno = 1; static int msgno = 1; static int symbflg = 0; static int inclfile = 1; static FILE *outfp; static FILE *msgfp; static FILE *descfile; static char inname [PATH_MAX]; static char outname [PATH_MAX]; static char catname [PATH_MAX]; static char *mname; static void mkcatdefs(char *); static int chkcontin(char *); static int insert(char *, int); static int nsearch(char *); static int hash(char *); /* * NAME: main * * FUNCTION: Make message catalog defines. * * EXECUTION ENVIRONMENT: * User mode. * * NOTES: Invoked by: * mkcatdefs * * Results are 1) Creates header file .h. * 2) Displays message file to stdout. The message file is * ready to be used as input to gencat. * * mkcatdefs takes a message definition file and produces * a header file containing #defines for the message catalog, * the message sets and the messages themselves. It also * produces a new message file which has the symbolic message set and * message identifiers replaced by their numeric values (in the form * required by gencat). * * DATA STRUCTURES: Effects on global data structures -- none. * * RETURNS: 1 - error condition */ int main (int argc, char *argv[]) { register int i; register char *cp; int count; char *t; setlocale (LC_ALL,""); /* usage: handle multiple files; -h option has to be at the end */ if (argc < 3) { fprintf (stderr, "mkcatdefs: Usage: %s header_file msg_file [msg_file...] [-h]\n", argv [0]); exit (0); } /* check if include file should be created; -h is the last argument */ if (argv[argc-1][0] == '-' && argv[argc-1][1] == 'h') inclfile = 0; /* open header output file */ if (inclfile) { mname = argv [1]; if ((int)strlen((t = strrchr(mname,'/')) ? t + 1 : mname) > MDIRSIZ) { fprintf (stderr, "mkcatdefs: header file name too long\n"); exit (1); } sprintf (outname, "%s", mname); if (strrchr(mname,'/')) mname = strrchr(mname,'/') + 1; if ((outfp = fopen (outname, "w")) == NULL) { fprintf (stderr, "mkcatdefs: Cannot open %s\n", outname); exit (1); } else { /* convert name to upper case */ for (cp=mname; *cp; cp+=i) { i = mblen(cp, MB_CUR_MAX); if (i < 0) { fprintf (stderr, "mkcatdefs: filename contains invalid character\n"); exit (1); } if (i == 1) { if (islower(*cp) != 0) *cp = toupper(*cp); else if (!isupper(*cp) && !isdigit(*cp)) *cp = '_'; } } } } else sprintf (outname, "msg.h"); /* open new msg output file */ msgfp = stdout; /* if message descriptor files were specified then process each one in turn */ if (inclfile == 0 ) count = argc - 1; else count = argc; for (i = 2; i < count; i++) { /* open input file */ sprintf (inname, "%s", argv[i]); if (strcmp(inname,"-") == 0) { strcpy(inname,"stdin"); descfile = stdin; /* input from stdin if no source files */ mkcatdefs(inname); } else { if ((descfile = fopen(inname,"r")) == NULL) { fprintf (stderr, "mkcatdefs: Cannot open %s\n", inname); errflg = 1; } else { mkcatdefs (inname); fclose(descfile); descfile = NULL; } } } if (inclfile) { fflush (outfp); if (ferror (outfp)) { fprintf (stderr, "mkcatdefs: There were write errors on file %s\n", outname); errflg = 1; } fclose (outfp); } if (errflg) { fprintf (stderr, "mkcatdefs: Errors found: no %s created\n", outname); if (inclfile) unlink(outname); } else { if (inclfile) { if (symbflg) fprintf (stderr, "mkcatdefs: %s created\n", outname); else { fprintf (stderr, "mkcatdefs: No symbolic identifiers; no %s created\n", outname); unlink (outname); } } else fprintf(stderr, "mkcatdefs: no %s created\n", outname); } exit (errflg); } /* * NAME: mkcatdefs * * FUNCTION: Make message catalog definitions. * * EXECUTION ENVIRONMENT: * User mode. * * RETURNS: None */ static void mkcatdefs(char *fname) /*---- fname: message descriptor file name ----*/ { char msgname [PATH_MAX]; char line [MAXLINELEN]; register char *cp; register char *cpt; register int m; register int n; int contin = 0; int len; /* # bytes in a character */ /* put out header for include file */ if (inclfile) { fprintf (outfp, "/* $%s$ */\n", "XConsortium"); fprintf (outfp, "\n\n/* The following was generated from %s. */\n\n", fname); } /* process the message file */ while (fgets(line, MAXLINELEN, descfile)) { line[MAXLINELEN-1] = '\0'; /* terminate in case length exceeded */ /* find first nonblank character */ for (cp=line; *cp; cp+=len) { len = mblen(cp, MB_CUR_MAX); if (len < 0) { fprintf (stderr, "mkcatdefs: sourcefile contains invalid character:\n\t%s", line); errflg = 1; return; } if (len == 1 && isspace(*cp) == 0) break; } if (*cp == KEY_START) { cp++; for (cpt = cp; *cp; cp += len) { len = mblen(cp, MB_CUR_MAX); if (len < 0) { fprintf (stderr, "mkcatdefs: sourcefile contains invalid character:\n\t%s", line); errflg = 1; return; } if (len == 1 && isspace(*cp) == 0) break; } if (cp != cpt) { sscanf (cp, "%s", msgname); if ((m = nsearch(msgname)) > 0) { fprintf (msgfp, "$ %d", m); cp += strlen(msgname); fprintf (msgfp, "%s", cp); } else fputs (line, msgfp); continue; /* line is a comment */ } if ((strncmp (cp, "set", 3) == 0) && ((len = mblen(&(cp[3]), MB_CUR_MAX)) == 1) && (isspace(cp[3]) != 0)) { char setname [MAXIDLEN]; sscanf (cp+3+len, "%s", setname); if (inclfile) fprintf (outfp, "\n/* definitions for set %s */\n", setname); if (isdigit(setname[0])) { cpt = setname; do { if (!isdigit(*cpt)) { fprintf(stderr, "mkcatdefs: %s is an invalid identifier\n", setname); errflg = 1; return; } } while (*++cpt); n = atoi (setname); if (n >= setno) setno = n; else { if (n == 0) fprintf(stderr, "mkcatdefs: %s is an invalid identifier\n", setname); else fprintf(stderr, "mkcatdefs: set # %d already assigned or sets not in ascending sequence\n", n); errflg = 1; return; } } else { cpt = setname; do { len = mblen(cpt, MB_CUR_MAX); if (len <= 0) { fprintf (stderr, "mkcatdefs: sourcefile contains invalid character:\n\t%s", line); errflg = 1; return; } if (len == 1 && (isalnum(*cpt) == 0) && (*cpt != '_')) { fprintf(stderr, "mkcatdefs: %s is an invalid identifier\n", setname); errflg = 1; return; } } while (*(cpt += len)); if (inclfile) fprintf (outfp, "#define %s %d\n\n", setname, setno); symbflg = 1; } #ifdef aix fprintf (msgfp,"$delset"); fprintf (msgfp," %d\n", setno); #endif fprintf (msgfp,"%.4s", line); fprintf (msgfp," %d\n", setno++); msgno = 1; continue; } else { /* !!!other command */ } } else if (contin) { if (!chkcontin(line)) contin = 0; } else if (setno > 1) { /* set must have been seen first */ char msgname [MAXIDLEN]; msgname [0] = '\0'; if (sscanf (cp, "%s", msgname) && msgname[0]) { len = mblen(cp, MB_CUR_MAX); if (len < 0) { fprintf (stderr, "mkcatdefs: sourcefile contains invalid character:\n\t%s", line); errflg = 1; return; } if (len == 1 && isalpha(*cp) != 0) { cpt = msgname; do { len = mblen(cpt, MB_CUR_MAX); if (len < 0) { fprintf (stderr, "mkcatdefs: sourcefile contains invalid character:\n\t%s", line); errflg = 1; return; } if (len == 1 && (isalnum(*cpt) == 0) && (*cpt != '_')) { fprintf(stderr, "mkcatdefs: %s is an invalid identifier\n", msgname); errflg = 1; return; } } while (*(cpt += len)); cp += strlen(msgname); fprintf (msgfp,"%d%s", msgno,cp); if (inclfile) fprintf (outfp, "#define %s %d\n", msgname, msgno); symbflg = 1; if (chkcontin(line)) contin = 1; if(insert(msgname,msgno++) < 0) { fprintf(stderr, "mkcatdefs: name %s used more than once\n", msgname); errflg = 1; return; } continue; } else if (isdigit (msgname[0])){ cpt = msgname; do { if (!isdigit(*cpt)) { fprintf(stderr, "mkcatdefs: invalid syntax in %s\n", line); errflg = 1; return; } } while (*++cpt); n = atoi (msgname); if ((n >= msgno) || (n == 0 && msgno == 1)) msgno = n + 1; else { errflg = 1; if (n == 0) fprintf(stderr, "mkcatdefs: %s is an invalid identifier\n", msgname); else if (n == msgno) fprintf(stderr, "mkcatdefs: message id %s already assigned to identifier\n", msgname); else fprintf(stderr, "mkcatdefs: source messages not in ascending sequence\n"); return; } } } if (chkcontin(line)) contin = 1; } fputs (line, msgfp); } /* make sure the operations read/write operations were successful */ if (ferror(descfile)) { fprintf (stderr, "mkcatdefs: There were read errors on file %s\n", inname); errflg = 1; } return; } /* * NAME: chkcontin * * FUNCTION: Check for continuation line. * * EXECUTION ENVIRONMENT: * User mode. * * RETURNS: 0 - not a continuation line. * 1 - continuation line. */ static int chkcontin(char *line) { int len; /* # bytes in character */ wchar_t wc; /* process code of current character in line */ wchar_t wcprev; /* process code of previous character in line */ for (wc=0; *line; line+=len) { wcprev = wc; len = mbtowc(&wc, line, MB_CUR_MAX); if (len < 0) { fprintf (stderr, "mkcatdefs: sourcefile contains invalid character:\n\t%s", line); errflg = 1; return (0); } } if (wcprev == '\\' && wc == '\n') return (1); return (0); } #define HASHSIZE 256 /* must be a power of 2 */ #define HASHMAX HASHSIZE - 1 struct name { char *regname; int regnr; struct name *left; struct name *right; }; static struct name *symtab[HASHSIZE]; /* hashed pointers to binary trees */ /* * NAME: insert * * FUNCTION: Insert symbol * * EXECUTION ENVIRONMENT: * User mode. * * NOTES: These routines manipulate a symbol table for the mkcatdefs program. * The symbol table is organized as a hashed set of binary trees. If the * symbol being passed in is found then a -1 is returned, otherwise the * symbol is placed in the symbol table and a 0 is returned. The purpose * of the symbol table is to keep mkcatdefs from assigning two different * message set / message numbers to the same symbol. * Read the next line from the open message catalog descriptor file. * * RETURNS: 0 - symbol inserted. * -1 - symbol exists. */ static int insert(char *tname, int seqno) /* tname - pointer to symbol seqno - integer value of symbol */ { register struct name *ptr,*optr; int rslt = -1,i,hashval; hashval = hash(tname); ptr = symtab[hashval]; /* search the binary tree for specified symbol */ while (ptr && (rslt = strcmp(tname,ptr->regname))) { optr=ptr; if (rslt<0) ptr = ptr->left; else ptr = ptr->right; } if (rslt == 0) /* found the symbol already defined */ return (-1); else { /* symbol not defined yet so put it into symbol table */ ptr = (struct name *)calloc(sizeof(struct name), 1); ptr->regname = malloc(strlen(tname) + 1); strcpy (ptr->regname, tname); ptr->regnr = seqno; /* not first entry in tree so update branch pointer */ if (symtab[hashval]) { if (rslt < 0) optr->left = ptr; else optr->right = ptr; /* first entry in tree so set the root pointer */ } else symtab[hashval] = ptr; return (0); } } /* * NAME: nsearch * * FUNCTION: Search for symbol * * EXECUTION ENVIRONMENT: * User mode. * * NOTES: Searches for specific identifier. If found, return allocated number. * If not found, return -1. * * RETURNS: Symbol sequence number if symbol is found. * -1 if symbol is not found. */ static int nsearch (char *tname) /* tname - pointer to symbol */ { register struct name *ptr,*optr; int rslt = -1,i,hashval; hashval = hash(tname); ptr = symtab[hashval]; /* search the binary tree for specified symbol */ while (ptr && (rslt = strcmp(tname,ptr->regname))) { optr=ptr; if (rslt<0) ptr = ptr->left; else ptr = ptr->right; } if (rslt == 0) /* found the symbol already defined */ return(ptr->regnr); else return (-1); } /* * NAME: hash * * FUNCTION: Create hash value from symbol name. * * EXECUTION ENVIRONMENT: * User mode. * * NOTES: Hash the symbol name using simple addition algorithm. * Make sure that the hash value is in range when it is returned. * * RETURNS: A hash value. */ static int hash (char *name) /* pointer to symbol */ { register int hashval = 0; while (*name) hashval += *name++; return (hashval & HASHMAX); } motif-2.3.8/localized/util/Makefile.in0000644000175000017500000004456313211512767014574 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @MessageCatalog_TRUE@noinst_PROGRAMS = mkcatdefs$(EXEEXT) subdir = localized/util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) mkcatdefs_SOURCES = mkcatdefs.c mkcatdefs_OBJECTS = mkcatdefs.$(OBJEXT) mkcatdefs_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = mkcatdefs.c DIST_SOURCES = mkcatdefs.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = mkcatdefs.c mkmsgcat.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign localized/util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign localized/util/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list mkcatdefs$(EXEEXT): $(mkcatdefs_OBJECTS) $(mkcatdefs_DEPENDENCIES) $(EXTRA_mkcatdefs_DEPENDENCIES) @rm -f mkcatdefs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mkcatdefs_OBJECTS) $(mkcatdefs_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkcatdefs.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/localized/util/mkmsgcat.c0000644000175000017500000002116712672140200014461 00000000000000/* $XConsortium: mkmsgcat.c /main/1 1996/06/05 18:21:57 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include char buf[1024]; char *OSF_COPYRIGHT = "$\n\ $ Motif\n\ $\n\ $ Copyright (c) 1987-2012, The Open Group. All rights reserved.\n\ $\n\ $ These libraries and programs are free software; you can\n\ $ redistribute them and/or modify them under the terms of the GNU\n\ $ Lesser General Public License as published by the Free Software\n\ $ Foundation; either version 2 of the License, or (at your option)\n\ $ any later version.\n\ $\n\ $ These libraries and programs are distributed in the hope that\n\ $ they will be useful, but WITHOUT ANY WARRANTY; without even the\n\ $ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n\ $ PURPOSE. See the GNU Lesser General Public License for more\n\ $ details.\n\ $\n\ $ You should have received a copy of the GNU Lesser General Public\n\ $ License along with these librararies and programs; if not, write\n\ $ to the Free Software Foundation, Inc., 51 Franklin Street, Fifth\n\ $ Floor, Boston, MA 02110-1301 USA\n\ $"; char *OSF_COPYRIGHT_C = "/*\n\ *\n\ * Motif\n\ *\n\ * Copyright (c) 1987-2012, The Open Group. All rights reserved.\n\ *\n\ * These libraries and programs are free software; you can\n\ * redistribute them and/or modify them under the terms of the GNU\n\ * Lesser General Public License as published by the Free Software\n\ * Foundation; either version 2 of the License, or (at your option)\n\ * any later version.\n\ *\n\ * These libraries and programs are distributed in the hope that\n\ * they will be useful, but WITHOUT ANY WARRANTY; without even the\n\ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n\ * PURPOSE. See the GNU Lesser General Public License for more\n\ * details.\n\ *\n\ * You should have received a copy of the GNU Lesser General Public\n\ * License along with these librararies and programs; if not, write\n\ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth\n\ * Floor, Boston, MA 02110-1301 USA\n\ */\n"; static void parse_args( int argc, char **argv, char **prefix, char **source_file_name); /**************************************************************************** * * This utility should be run with 2 arguments. The first one is used as a * prefix to generate the names of the output files, as well as the contents. * The second name is the full path of the source file to use. * * Running like this: * mkmsgcat -Xm /proj/motif/lib/Xm/Messages.c * * it will open the /proj/motif/lib/Xm/Messages.c file and generate 2 output * files: * - Xm.msg * - XmMsgI.h * * The externaldef message names are expected to be of the following form * in the source file, and not be longer than 10 characters: * _Msg for example (_XmMsgBulletinB_0001, _MrmMsg_0000) * ***************************************************************************/ int main( int argc, char **argv ) { FILE *header = NULL, *catalog = NULL, *source = NULL; int stars, i; char *p, *q, setname[32], messagename[64]; char *prefix = NULL; char *source_file_name = NULL; char header_name[32], catalog_name[32]; /* parse command line and get the prefix and source file name to use. */ parse_args(argc, argv, &prefix, &source_file_name); if (prefix == NULL || source_file_name == NULL) { fprintf(stderr, "Usage: mkmsgcat - \n"); exit(1); } strcpy(header_name, prefix); strcat(header_name, "MsgI.h"); header = fopen(header_name, "w"); strcpy(catalog_name, prefix); strcat(catalog_name, ".msg"); catalog = fopen(catalog_name, "w"); source = fopen(source_file_name, "r"); if (!catalog) { fprintf(stderr, "Cannot write message catalog, exiting!\n"); exit(1); } if (!header) { fprintf(stderr, "Cannot write header file, exiting!\n"); exit(1); } if (!source) { fprintf(stderr, "Cannot read source file, exiting!\n"); exit(1); } fprintf(catalog, "$ $%s$\n", "XConsortium"); fprintf(catalog, "%s\n", OSF_COPYRIGHT); fprintf(catalog, "$ This file is automatically generated. \n"); fprintf(catalog, "$ Do not edit. \n"); fprintf(catalog, "\n"); if (header) { fprintf(header, "/* $%s$ */\n", "XConsortium"); fprintf(header, OSF_COPYRIGHT_C); fprintf(header, "/* This file is automatically generated. */\n"); fprintf(header, "/* Do not edit. */\n\n"); fprintf(header, "#ifndef NO_MESSAGE_CATALOG\n\n"); fprintf(header, "#include \n#include \"%sMsgCatI.h\"\n\n", prefix); fprintf(header, "externalref nl_catd %s_catd;\n\n", prefix); fprintf(header, "\ #define _%sCatgets(catd, set_num, msg_num, def_str) \\\n\ catgets(catd, set_num, msg_num, def_str)\n\n", prefix); fprintf(header, "#else\n\n"); fprintf(header, "#define _%sCatgets(catd, set_num, msg_num, def_str) def_str\n\n", prefix); fprintf(header, "#endif /* NO_MESSAGE_CATALOG */\n\n"); } while (fgets(buf, 1024, source)) { if (!buf[0]) continue; p = buf; while (isspace(*p)) p++; if (*p == '/') { /* * Start of a comment. If there is at least 3 '*' following the '/', * this is information for the message catalog. */ for (stars = 0, p++; *p && *p == '*'; stars++, p++); if (stars < 3) continue; while (isspace(*p)) p++; if (*p == '+') { /* * Extra message catalog text. * (ex. messages obsoleted in the code, but needed * for binary BC, comments) */ p++; for (q = p; *q && *q != '\n' && *q != '*'; q++); *q = '\0'; fprintf(catalog, "%s\n", p); continue; } else { /* * This is the set name */ for (i = 0; isalpha(*p) && i < 31; i++, p++) setname[i] = *p; setname[i] = '\0'; fprintf(catalog, "\n$set MS_%s\n\n", setname); continue; } } if (*p == 'e') { char subs[11]; int len_subs; /* * This is a message. */ if (strncmp(p, "externaldef", 11) != 0) continue; /* Find the substring to look for, based on the prefix. */ strcpy(subs, "_"); strcat(subs, prefix); strcat(subs, "Msg"); len_subs = strlen(subs); p = strstr(p, subs); if (!p) continue; p += len_subs; for (i = 0; !isspace(*p) && i < 63; i++, p++) messagename[i] = *p; messagename[i] = '\0'; p = strchr(p, '"'); if (!p) { do fgets(buf, 1024, source); while (!buf[0]); p = strchr(buf, '"'); } if (!p) continue; fprintf(catalog, "MSG_%s ", messagename); p++; do { q = strchr(p, '"'); while (q && *(--q) == '\\') { q += 2; q = strchr(q, '"'); } if (q) { q++; *q = '\0'; fprintf(catalog, "%s\n", p); } else { fprintf(catalog, "%s", p); fgets(buf, 1024, source); p = buf; } } while (!q); if (header) fprintf(header, "#define _%sMMsg%s%*s _%sCatgets(%s_catd, MS_%s, MSG_%s, _%sMsg%s)\n", prefix, messagename, 20-i, " ", prefix, prefix, setname, messagename, prefix, messagename); } } return 0; } static void parse_args( int argc, char **argv, char **prefix, char **source_file_name) { if (argc < 3) { fprintf(stderr, "Usage: mkmsgcat - \n"); exit(1); } /* Skip the first argument since it is the program name. */ argv++; argc--; /* This argument should be the prefix, preceded with a '-'. */ if (strncmp(*argv, "-", 1)) { fprintf(stderr, "Usage: mkmsgcat - \n"); exit(1); } else { /* Skip the '-' */ (*argv)++; *prefix = *argv; /* Now get the source file name. */ argv++; argc--; *source_file_name = *argv; } } motif-2.3.8/localized/util/Makefile.am0000644000175000017500000000020213145162623014537 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = mkcatdefs.c mkmsgcat.c if MessageCatalog noinst_PROGRAMS = mkcatdefs endif motif-2.3.8/localized/Makefile.am0000644000175000017500000000010113145162623013560 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = SUBDIRS = util motif-2.3.8/TODO0000644000175000017500000000013312672140561010254 00000000000000TODO list for 2.3 release ---------------------------------------------------------------- motif-2.3.8/ChangeLog0000644000175000017500000027753713211512143011353 000000000000002017-11-10 11:49:10 +0200 Oleksiy Chernyavskyy * Fixed bug 1665 (HEAD, origin/master, origin/HEAD, master) 2017-10-30 23:04:15 +0200 Oleksiy Chernyavskyy * Fixed bug 1651 2017-10-30 22:22:31 +0200 Oleksiy Chernyavskyy * Fixed bug 1650 2017-10-30 21:47:21 +0200 Oleksiy Chernyavskyy * Fixed bug 1652 2017-08-31 06:28:27 +0300 Oleksiy Chernyavskyy * Fixed bug 1655 2017-08-28 05:33:53 +0300 Oleksiy Chernyavskyy * Fixed bug 1625 2017-08-26 06:12:14 +0300 Oleksiy Chernyavskyy * Fixed bug 1656 2017-08-23 04:10:55 +0300 Oleksiy Chernyavskyy * Fixed bug 1658 2017-08-22 06:05:00 +0300 Oleksiy Chernyavskyy * Fixed bug 1659 2017-08-22 03:27:36 +0300 Oleksiy Chernyavskyy * Fixed bug 1660 2017-03-28 01:40:33 +0300 Oleksiy Chernyavskyy * updated version and release data 2017-03-28 01:32:30 +0300 Oleksiy Chernyavskyy * removed redundant includes 2017-03-28 01:11:59 +0300 Oleksiy Chernyavskyy * removed bugfix 1565. See details on http://bugs.motifzone.net/show_bug.cgi?id=1565 2016-11-09 07:19:53 +0200 Alex * obsolete malloc.h changed on stdlib.h 2016-06-11 05:03:21 +0300 Oleksiy Chernyavskyy * updated ChangeLog 2016-06-11 05:02:55 +0300 Oleksiy Chernyavskyy * updated release 2.3.6 information 2016-06-11 04:57:54 +0300 Oleksiy Chernyavskyy * fixid parallel building (make -j) error 2016-06-11 04:57:20 +0300 Oleksiy Chernyavskyy * removed automatic configure start from autogen.sh 2016-06-11 04:26:48 +0300 Oleksiy Chernyavskyy * minor fix 2016-06-11 04:21:53 +0300 Oleksiy Chernyavskyy * removed extra dist Imakefile from all Makefile.am files 2016-06-11 04:06:37 +0300 Oleksiy Chernyavskyy * Purified copyright headers (Motif is LGPL covered). Removed many Imakefile's and Imake-related stuff 2016-06-10 23:40:43 +0300 Oleksiy Chernyavskyy * updated release notes and version 2.3.5 -> 2.3.6 2016-06-10 23:27:56 +0300 Oleksiy Chernyavskyy * updated ChangeLog 2016-06-10 23:15:00 +0300 Oleksiy Chernyavskyy * bug 1654 fix 2016-06-10 21:58:16 +0300 Oleksiy Chernyavskyy * old patches. need review 2016-03-29 03:48:59 +0300 Oleksiy Chernyavskyy * removed obsolete files 2016-03-17 04:23:17 +0200 Oleksiy Chernyavskyy * release 2.3.5 (tag: release_2_3_5) 2016-03-16 23:07:12 +0200 Oleksiy Chernyavskyy * updated ChangeLog 2016-03-16 23:06:24 +0200 Oleksiy Chernyavskyy * added mkchangelog script for automated generation of the ChangeLog 2016-03-16 00:46:49 +0200 Oleksiy Chernyavskyy * Reimplemented bugfix 1565 2016-02-26 03:36:51 +0200 Oleksiy Chernyavskyy * Updated RPM creation instructions 2014-08-20 15:45:41 +0300 Oleksiy Chernyavskyy * fixed bug 1636 2013-08-21 11:49:00 +0300 Mykola Vshyvkov * Fixed bug #1612 (Label size computed wrong within a Form). 2013-07-11 18:14:32 +0300 Mykola Vshyvkov * Fixed bug #1618 (Eliminates 29 warnings of some type in modules from "demos" catalog). 2013-07-11 15:20:54 +0300 Mykola Vshyvkov * Fixed bug #1616 (Eliminates 23 warnings "suggest parentheses around assignment used" in modules from "demos" catalog). 2013-07-11 15:01:50 +0300 Mykola Vshyvkov * Fixed bug #1617 (Eliminates 23 warnings "cast to pointer from integer of different size" in modules from "demos" catalog). 2013-07-11 12:35:30 +0300 Mykola Vshyvkov * Fixed bug #1615 (Eliminates 35 warnings "enumeration value XXX not handled" in modules from "demos" catalog). 2013-07-10 06:55:14 +0300 Mykola Vshyvkov * Fixed bug #1614 (Eliminates 36 warnings "variable may be used uninitialized" in modules from "demos" catalog). 2013-07-10 05:05:28 +0300 Mykola Vshyvkov * Fixed bug #1613 (Eliminates 60 warnings "implicit declaration of function" in modules from "demos" catalog). 2013-07-04 14:08:09 +0300 Mykola Vshyvkov * Fixed bug #1611 (Was been replaced depecated code with using XKeycodeToKeysym Xlib function calls in modules of "clients" catalog). 2013-07-03 21:27:32 +0300 Mykola Vshyvkov * Fixed bug #1610 (Eliminates 15 warnings of some types in modules of "clients" catalog). 2013-07-03 18:52:21 +0300 Mykola Vshyvkov * Fixed bug #1609 (Eliminates 18 warnings of "incompatible implicit declaration" in modules of "clients" catalog). 2013-07-03 14:58:22 +0300 Mykola Vshyvkov * Fixed bug #1608 (Eliminates 30 warnings of "array subscript has type 'char'" in modules of "clients" catalog). 2013-07-03 14:35:04 +0300 Mykola Vshyvkov * Fixed bug #1607 (Eliminates 92 warnings of "variable may be used uninitialized" in modules of "clients" catalog). 2013-07-03 12:48:55 +0300 Mykola Vshyvkov * Fixed bug #1606 (Eliminates 130 warnings of "expects argument of type" in modules of "clients" catalog). 2013-07-02 13:40:37 +0300 Mykola Vshyvkov * Fix of Bug #1604 fix. 2013-07-01 20:52:37 +0300 Mykola Vshyvkov * Fix of Bug #1604 fix. 2013-07-01 19:07:32 +0300 Mykola Vshyvkov * Fixed bug #1604 (Was been replaced depecated code with using XKeycodeToKeysym Xlib function calls). 2013-07-01 19:02:25 +0300 Mykola Vshyvkov * Fixed bug #1605 (Eliminates 14 warnings of some types in WML tool). 2013-06-26 23:45:14 +0300 Mykola Vshyvkov * Fixed bug #1603 (Eliminates 18 warnings of some types in some modules). 2013-06-26 19:21:20 +0300 Mykola Vshyvkov * Fixed bug #1602 (Eliminates 6 warnings "implicit declaration of function" in some modules). 2013-06-26 18:36:47 +0300 Mykola Vshyvkov * Fixed bug #1601 (Eliminates 6 warnings: "suggest explicit braces to avoid ambiguous" in some modules). 2013-06-26 17:40:00 +0300 Mykola Vshyvkov * Fixed bug #1600 (Eliminates 26 warnings about using uninitialized variables in some modules). 2013-06-26 15:34:53 +0300 Mykola Vshyvkov * Fixed bug #1599 (Eliminates 14 warnings of incompatible type argument from some modules). 2013-06-25 17:37:02 +0300 Mykola Vshyvkov * Updated ChangeLog. 2013-06-25 13:57:31 +0300 Mykola Vshyvkov * Merge branch 'openmotif_2_3' of ssh://git.code.sf.net/p/motif/code into openmotif_2_3 2013-06-25 12:55:13 +0300 Nikolay Vs * Fixed bug #1595. (Patched Configure.ac). Patch by Ulrich Muller. 2013-06-25 12:55:13 +0300 Nikolay Vs * Added FIX #1595. Thanks to Ulrich Muller 2013-03-29 17:37:29 +0200 Yuriy Syrota * Fixed bug #1593 (Missing fontconfig lib in linking, due to outdated test in ac_find_xft.m4). Patch by Ulrich Müller. 2013-03-28 17:48:58 +0200 Yuriy Syrota * Fixed bug #1594 (configure: typo in warning "No splint is dound"). Thanks to Ulrich Müller. 2012-10-31 15:59:57 +0200 Yuriy Syrota * Fixed bug #1581 (Buffer overrun in FontS.c) 2012-10-22 15:45:31 +0300 Yuriy Syrota * Updated link to documentation (tag: release_2_3_4) 2012-10-16 16:47:45 +0300 Yuriy Syrota * Updated Release Notes 2012-10-04 16:53:22 +0300 Yuriy Syrota * Fixed library dependencies 2012-09-25 17:41:25 +0300 Yuriy Syrota * Updated Release Notes 2012-09-25 17:25:44 +0300 Yuriy Syrota * Fixed bug #1565 (The active window changes to inactive when the drop down list is clicked) 2012-09-25 11:52:05 +0300 Yuriy Syrota * Fixed issues with non-XFT build 2012-09-17 12:05:57 +0300 Yuriy Syrota * Removed extra token at end of #endif directive 2012-09-14 18:21:39 +0300 Yuriy Syrota * Fixed dist build configuration 2012-09-12 15:35:27 +0300 Yuriy Syrota * Updated references to Motif 2.3.4 2012-09-12 14:24:57 +0300 Yuriy Syrota * Updated references to Motif 2.3.4 2012-09-12 09:14:04 +0300 Yuriy Syrota * Removed unnecessary files 2012-09-12 08:55:58 +0300 Yuriy Syrota * Fixed bug #1300 (Keypad arrows don't work) 2012-08-31 17:59:21 +0300 Yuriy Syrota * Fixed bug #1264 (crash in PutDSToStream due to bug in _XmResizeHashTable) 2012-08-31 17:47:17 +0300 Yuriy Syrota * Removed fix for bug #1264 2012-08-31 17:44:57 +0300 Yuriy Syrota * Fixed bug #1196 (Free memory read in XmIm.c/draw_separator(), line 2329) 2012-08-31 17:44:27 +0300 Yuriy Syrota * Removed fix for bug #1196 2012-08-31 17:28:44 +0300 Yuriy Syrota * Fixed bug #1193 (MWM crashes when restarting by a session manager) 2012-08-31 15:46:39 +0300 Yuriy Syrota * Removed fix for bug #1193 2012-08-31 11:22:08 +0300 Yuriy Syrota * Fixed bug #1252 (XmCreateDropDownList doesn't work when XLC_LOCALE has on_demand_loading property) 2012-08-31 10:56:27 +0300 Yuriy Syrota * Removed fix for bug #1252 2012-08-30 18:04:17 +0300 Yuriy Syrota * Fixed bug #1181 (Linux Motif binaries do not work with Solaris/Xsun Xserver) 2012-08-30 16:54:11 +0300 Yuriy Syrota * Removed fix for bug #1181 2012-08-29 19:45:11 +0300 Yuriy Syrota * Fixed bug #1179 (configure.ac (06/18 CVS) duplicate Makefile targets fix for autoconf 2.53+) 2012-08-29 19:44:43 +0300 Yuriy Syrota * Removed fix for bug #1179 2012-08-29 19:34:02 +0300 Yuriy Syrota * Fixed bug #1170 (XmCombinationbox2 does not havent desensitization/sensitization) 2012-08-29 19:27:53 +0300 Yuriy Syrota * Removed fix for bug #1170 2012-08-29 18:41:05 +0300 Yuriy Syrota * Fixed bug #1127 (cannot load Java TextEditor3) 2012-08-29 18:15:55 +0300 Yuriy Syrota * Removed fix for bug #1127 2012-08-27 11:33:50 +0300 Yuriy Syrota * Removed fix for bug #1166 2012-08-27 09:38:18 +0300 Yuriy Syrota * Fixed bug #1152 (64-bit int/long botch in XmRenderT.c) 2012-08-23 17:58:21 +0300 Yuriy Syrota * Removed fix for bug #1152 2012-08-23 15:43:03 +0300 Yuriy Syrota * Fixed bug #1141 (mwm crashes when attempting to delete a menu item) 2012-08-23 12:38:29 +0300 Yuriy Syrota * Removed fix for bug #1141 2012-08-22 19:05:16 +0300 Yuriy Syrota * Fixed bug #1129 (XmIm causes Segmentation Fault after some widgets are disposed) 2012-08-22 18:44:57 +0300 Yuriy Syrota * Added checking for XICProc type defined 2012-08-21 18:14:26 +0300 Yuriy Syrota * Removed fix for bug report #1129 2012-08-21 18:13:32 +0300 Yuriy Syrota * Fixed a typo in TextOutI.h 2012-08-21 17:58:00 +0300 Yuriy Syrota * Fixed bug bug #1147 (XmText doesn't updates scrollbars if parent is not XmScrolledWindow) 2012-08-21 17:31:19 +0300 Yuriy Syrota * Removed fix for bug report #1147 2012-07-06 17:51:55 +0300 Yuriy Syrota * Changelog updated 2012-07-06 17:51:34 +0300 Yuriy Syrota * Updated for release 2.3.4 2012-07-06 17:49:54 +0300 Yuriy Syrota * Refixed bug #1521 (LabelGadget draws the text over border of its parent) 2012-07-06 17:48:03 +0300 Yuriy Syrota * Added missing include 2012-07-06 17:46:52 +0300 Yuriy Syrota * Fixed bug #1496 (Version 2.3.2 won't compile if configured enable-message-catalog) 2012-07-06 17:42:09 +0300 Yuriy Syrota * Dropped fix #1359 (File dialog filter problem with * or [ in directory) 2012-07-06 17:40:10 +0300 Yuriy Syrota * Fixed bug #1530 (SimpleSpinBox doesn't return correct values for child on some platforms) 2012-07-06 17:38:24 +0300 Yuriy Syrota * Fixed bug #1272 (Application goes into infinite loop in TraversalI.c:Sort()) 2012-07-06 17:36:07 +0300 Yuriy Syrota * Fixed bug #1529 (Copy/paste problem with Clipboard) 2012-07-06 17:35:02 +0300 Yuriy Syrota * Fixed bug #1536 (Performance issue: XmListSetPos() is very very slow) 2012-07-06 17:32:26 +0300 Yuriy Syrota * Fixed bug #1501 (XmText widget sensitive/unsensitive is visibly same at startup) 2012-07-06 17:31:13 +0300 Yuriy Syrota * Refixed bug #1381 (Sensitivity invisible with antialiased fonts) 2012-07-06 17:29:50 +0300 Yuriy Syrota * Fixed bug #1510 (Input methods do not work with XFT fonts) 2012-07-06 17:27:40 +0300 Yuriy Syrota * Fixed bug #1500 (XmPushButton with grayscale pixmap is not changed visibly when it's sensitivity is changed) 2012-07-06 17:27:19 +0300 Yuriy Syrota * Fixed bug #1540 (XpmCreateBufferFromPixmap function doesn't work properly) 2012-07-06 17:25:46 +0300 Yuriy Syrota * Fixed bug #1505 (Some problems with new insensitive code for label pixmaps) 2012-07-06 17:24:46 +0300 Yuriy Syrota * Fixed bug #1534 (im_widget double-free issue) 2012-07-06 17:23:06 +0300 Yuriy Syrota * Fixed bug #1535 (Destroying a torn-off menu with a submenu mapped causes a crash) 2012-07-06 17:21:20 +0300 Yuriy Syrota * Fixed bug #1532 (Incorrect handling of clip areas for a string (XmString.c)) 2012-07-06 17:19:06 +0300 Yuriy Syrota * Fixed bug #1531 (Using DataField widget with XFT font causes an X Error) 2012-07-06 17:17:22 +0300 Yuriy Syrota * Fixed bug #1519 (XmSpinBoxValidatePosition does not properly check XmNincrementValue) 2012-07-06 17:15:47 +0300 Yuriy Syrota * Added missing #ifdef USE_XFT directive to the patch #1521 2012-07-06 17:14:09 +0300 Yuriy Syrota * Fixed bug #1488 (XmStringDraw clip not honored) 2012-07-06 17:12:33 +0300 Yuriy Syrota * Fixed bug #1479 (Compiling libUil fails on mac OS X 10.5) 2012-07-06 17:11:22 +0300 Yuriy Syrota * Fixed bug #1528 (Scale widget has some Geometry issues) 2012-07-06 17:09:28 +0300 Yuriy Syrota * Fixed bug #1518 (gcc check in configure script does not use ) 2012-07-06 17:05:37 +0300 Yuriy Syrota * Fixed misspellings in the manpage. 2012-07-06 17:03:02 +0300 Yuriy Syrota * Fixed bug #1504 (Changing sensitivity on a PushButton with Pixmap causes recomputeSize) 2012-07-06 17:01:28 +0300 Yuriy Syrota * Fixed bug #1516 (Can receive X error setting pixmaps to XmUNSPECIFIED_PIXMAP on PushButton) 2012-07-06 16:56:29 +0300 Yuriy Syrota * Fixed typo in ChangeLog 2012-07-06 16:55:25 +0300 Yuriy Syrota * Fixed bug #1503 (XmNtabBackground resource is not working properly in XmTabStack widget) 2012-07-06 16:45:00 +0300 Yuriy Syrota * Fixed bug #1512 (Small configure portability fix) 2012-07-06 16:42:37 +0300 Yuriy Syrota * Fixed bug #1523 (Check a return value of XmCvtXmStringToCT before use in strlen) 2012-07-06 15:57:19 +0300 Yuriy Syrota * Refixed bug #1473 (When we set XmNvisibleItemCount resource available in XmComboBox, the widget displays the wrong number of items) 2012-07-06 15:45:52 +0300 Yuriy Syrota * Refixed bug #1517 (LabelGadget draws over parent window with the background color) 2012-07-06 15:44:16 +0300 Yuriy Syrota * Fixed bug #1521 (LabelGadget draws the text over border of its parent) 2012-07-06 15:41:44 +0300 Yuriy Syrota * Fixed in order to provide compability with libpng14, backwards compatible with libpng12 2012-07-06 15:40:33 +0300 Yuriy Syrota * Fixed dependencies in order to allow build with "make -j" 2012-07-06 15:36:32 +0300 Yuriy Syrota * Fixed bug #1509 2012-07-06 15:23:14 +0300 Yuriy Syrota * Fixed bug #1517 2012-07-06 15:19:20 +0300 Yuriy Syrota * Updated for release 2.3.3 2012-07-06 15:16:15 +0300 Yuriy Syrota * Fixed bug #1507 (LDFLAGS not respected for building libXm and libMrm libraries) 2012-07-06 15:15:10 +0300 Yuriy Syrota * Dropped fix #1511 2012-07-06 14:47:52 +0300 Yuriy Syrota * Fixed bug #1511 (CheckBook program from EditTable samples crashes with OpenMotif since 2.3.0 release.) 2012-07-06 14:35:09 +0300 Yuriy Syrota * Fixed bug #1495 (mwm's icon box has graphics corruption) 2012-07-05 22:14:48 +0300 Yuriy Syrota * Removed junk 2012-07-05 22:13:15 +0300 Yuriy Syrota * Fixed in order to provide PRINTING_SUPPORTED and USE_XFT macro definitions in Xm.h 2012-07-05 22:11:22 +0300 Yuriy Syrota * Fixed in order to allow build without libXp 2012-07-05 22:09:26 +0300 Yuriy Syrota * Refixed bug #1474 (Incrementation of XmNvisibleItemCount value does not work properly in XmComboBox) 2012-07-05 22:07:05 +0300 Yuriy Syrota * Refixed bug #1321 (Pasting into XmTextField is unreliable) 2012-07-05 21:59:41 +0300 Yuriy Syrota * Fixed bug #1502 (crash in ToolTipGetData()) 2012-07-05 21:57:49 +0300 Yuriy Syrota * Removed xmPanedWindowWidgetClass definition 2012-07-05 21:55:21 +0300 Yuriy Syrota * Fixed bug #1474 (Incrementation of XmNvisibleItemCount value does not work properly in XmComboBox) 2012-07-05 16:59:16 +0300 Yuriy Syrota * Added #include (tag: release_2_3_3) 2012-07-05 16:55:00 +0300 Yuriy Syrota * Updated for release 2.3.3 2012-07-05 16:47:58 +0300 Yuriy Syrota * Dropped fix #1476 (PanedWindow orientation error) 2012-07-05 16:36:25 +0300 Yuriy Syrota * Moved FromColorToBlackAndWhite() and ConvertToBW() routines from Label.c, LabelG.c to Color.c 2012-07-05 16:35:25 +0300 Yuriy Syrota * Fixed bug #1195 (Making on FreeBSD with non GNU make) 2012-07-05 16:07:32 +0300 Yuriy Syrota * Refixed bug #1449 (Uninitalised memory access with XFT fonts) 2012-07-05 12:20:13 +0300 Yuriy Syrota * Refixed bug #1388 (SEGV error moving mouse over window related to XmToolTipGetLabel) 2012-07-05 12:07:09 +0300 Yuriy Syrota * Fixed warning: implicit declaration of function '_XmPopupSpringLoaded 2012-07-05 12:04:40 +0300 Yuriy Syrota * Added missing XmStrDefs*.ht files to EXTRA_SRCS 2012-07-05 11:54:02 +0300 Yuriy Syrota * Updated change log for release 2.3.3 2012-07-05 11:38:24 +0300 Yuriy Syrota * Updated release notes 2012-07-05 11:33:13 +0300 Yuriy Syrota * Updated for release 2.3.3 2012-07-05 11:32:54 +0300 Yuriy Syrota * Updates release notes 2012-07-05 11:32:23 +0300 Yuriy Syrota * Updated OpenMotif version 2012-07-05 11:26:24 +0300 Yuriy Syrota * Fixed bug #1489 (Paned.h is not included by XmAll.h) 2012-07-05 11:19:11 +0300 Yuriy Syrota * Fixed bug #1486 (Tooltip in DropDown widget makes X hang up) 2012-07-05 11:17:19 +0300 Yuriy Syrota * Reixed bug #1376 (PanedWindow orientation error) 2012-07-05 10:31:09 +0300 Yuriy Syrota * Fixed bug #1320 (Resizing a scrolled text widget can be very, very slow) 2012-07-05 10:29:56 +0300 Yuriy Syrota * Fixed bug #1449 (Uninitalised memory access with XFT fonts) 2012-07-05 10:26:24 +0300 Yuriy Syrota * Fixed bug #1418 (Add file with instructions how to build from CVS) 2012-07-05 10:15:44 +0300 Yuriy Syrota * Moved define FIX_1381 from XmI.h to XmP.h 2012-07-05 10:07:30 +0300 Yuriy Syrota * Refixed bug #1381 (Sensitivity invisible with antialiased fonts) 2012-07-05 09:47:27 +0300 Yuriy Syrota * Fixed bug #1484 (Warning on XmRlabelType when I put a pixmap and a value top on XmNPixmapPlacement) 2012-07-05 09:30:05 +0300 Yuriy Syrota * Fixed bug #1426 (Make location of system.mwmrc configurable) 2012-07-04 18:37:54 +0300 Yuriy Syrota * Fixed bug #1451 (XmStringDrawImage works incorrectly with XFT) 2012-07-04 18:28:12 +0300 Yuriy Syrota * Fixed bug #1453 (MultiList not displayed properly) 2012-07-04 18:07:11 +0300 Yuriy Syrota * Fixed bug #1412 (An insensitive popup menu parent lead to a display-freezing) 2012-07-04 17:41:07 +0300 Yuriy Syrota * Fixed bug #345 (Openmotif accelerators XmNaccelerator do not work with CapsLock/ScrollLock/NumLock modifiers) 2012-07-04 17:35:33 +0300 Yuriy Syrota * cleanup 2012-07-04 17:32:25 +0300 Yuriy Syrota * Added splint checking and splint target 2012-07-04 17:25:47 +0300 Yuriy Syrota * Refixed bug #1476 (PanedWindow orientation error) 2012-07-04 17:23:16 +0300 Yuriy Syrota * Fixed bug #1299 (XmForm erroneously finds "Circular dependency" if widgets are inter-attachmed in vertical/horizontal directions) 2012-07-04 14:53:06 +0300 Yuriy Syrota * Updated distros list (tag: release_2_3_2) 2012-07-04 14:52:48 +0300 Yuriy Syrota * Updated distros list 2012-07-04 14:50:34 +0300 Yuriy Syrota * Updated for openmotif 2.3.2 2012-07-04 14:50:04 +0300 Yuriy Syrota * Dropped fix for the bug #1299 (XmForm erroneously finds "Circular dependency" if widgets are inter-attachmed in vertical/horizontal directions) 2012-07-04 14:22:38 +0300 Yuriy Syrota * Fixed some typo in RELNOTES 2012-07-04 14:21:37 +0300 Yuriy Syrota * Updated for OpenMotif 2.3.2 2012-07-04 11:11:40 +0300 Yuriy Syrota * Updated OpenMotif version 2012-07-04 10:19:46 +0300 Yuriy Syrota * Added missing 'O' character to UTF8_SUPPORTED macro 2012-07-04 10:06:46 +0300 Yuriy Syrota * Refixed bug #1299 (XmForm erroneously finds "Circular dependency" if widgets are inter-attachmed in vertical/horizontal directions) 2012-07-04 10:03:46 +0300 Yuriy Syrota * Fixed bug #1476 (PanedWindow orientation error) 2012-07-03 18:31:49 +0300 Yuriy Syrota * Fixed bug #1299 (XmForm erroneously finds "Circular dependency" if widgets are inter-attachmed in vertical/horizontal directions) 2012-07-03 18:18:05 +0300 Yuriy Syrota * Fixed bug #1277 (paned widget does not work under Fedora Core 2 with openmotif 2.2.3-4.1) 2012-07-03 18:17:42 +0300 Yuriy Syrota * Added ifdef/endif directives arround fix #1473 2012-07-03 18:08:32 +0300 Yuriy Syrota * Fixed bug #1212 (XmDropSiteRetrieve frees XRectangles before caller can use them) 2012-07-03 18:04:20 +0300 Yuriy Syrota * Fixed bug #1473 (When we set XmNvisibleItemCount resource available in >XmComboBox, the widget displays the wrong number of items) 2012-07-03 17:30:07 +0300 Yuriy Syrota * Fixed in order to allow build out of source tree 2012-07-03 16:58:02 +0300 Yuriy Syrota * Added wml_DEPENDENCIES 2012-07-03 16:57:35 +0300 Yuriy Syrota * Added ACLOCAL_AMFLAGS 2012-07-03 15:40:27 +0300 Yuriy Syrota * Updated for Open Motif 2.3.1 (tag: release_2_3_1) 2012-07-03 15:34:31 +0300 Yuriy Syrota * Fixed in order to put demos binaries in /share/Xm 2012-07-03 15:31:17 +0300 Yuriy Syrota * Fixed bug #1423 (Build failure on FreeBSD: undefined reference to libiconv_open) 2012-07-03 15:26:49 +0300 Yuriy Syrota * Fixed bug #1427 (_xrm '*.iconPixmap:SDtErrors.l' produces bogus error messages) 2012-07-03 15:22:54 +0300 Yuriy Syrota * Refixed bug #1381 (Sensitivity invisible with antialiased fonts) 2012-07-03 15:20:59 +0300 Yuriy Syrota * Fixed bug #1359 (File dialog filter problem with * or [ in directory) 2012-07-03 15:17:51 +0300 Yuriy Syrota * Fixed bug #1446 (Arrow button in DropDown widget issue.) 2012-07-03 15:04:04 +0300 Yuriy Syrota * Fixed bug #1328 (Desktop hang: motif application in XGrabPointer) 2012-07-03 14:47:49 +0300 Yuriy Syrota * Fixed bug #1425 (Resetting entryParent causes crash) 2012-07-03 14:44:17 +0300 Yuriy Syrota * Fixed bug #1439 (warnings during compilation in TabBox.c) 2012-07-03 14:40:43 +0300 Yuriy Syrota * Fixed bug #1419 (Bindings of DataField defined in DataF.c instead of TranslNew.c) 2012-07-03 14:38:07 +0300 Yuriy Syrota * Fixed bug #1419 (Bindings of DataField defined in DataF.c instead of TranslNew.c) 2012-07-03 14:31:41 +0300 Yuriy Syrota * Fixed bug #1431 (openmotif 2.3 and xorg 7.1.0 64bit problems) 2012-07-03 14:30:07 +0300 Yuriy Syrota * Fixed bug #1432 (XmContainer incorrect GC allocation) 2012-07-03 14:28:15 +0300 Yuriy Syrota * Fixed bug #1250 (XmCombo glyph is unexpectedly shifted when setting XmNvisibleItemCount) 2012-07-03 14:22:36 +0300 Yuriy Syrota * Fixed bug #1401 (Specifying state pixmaps in Container causes crash) 2012-07-03 14:19:31 +0300 Yuriy Syrota * Fixed bug #1442 (Crash on Drag'n'Drop) 2012-07-03 14:19:15 +0300 Yuriy Syrota * Fixed bug #1445 (PopupShell is closing on MouseWheel) 2012-07-03 14:19:03 +0300 Yuriy Syrota * Refixed bug #1371 (XmComboBox problem on FC6) 2012-07-03 14:12:36 +0300 Yuriy Syrota * Fixed bug #1438 (Missing XSetErrorHandler call in XmXftDrawCreate) 2012-07-03 14:09:07 +0300 Yuriy Syrota * Fixed bug #1444 (Function _XmXftDrawCreate() does not work correct with the pixmap) 2012-07-03 13:25:57 +0300 Yuriy Syrota * Fixed bug #1434 (single character utf8 sting is not displayed) 2012-07-03 13:23:58 +0300 Yuriy Syrota * Fixed bug #1442 (Crash on Drag'n'Drop) 2012-07-02 19:10:42 +0300 Yuriy Syrota * Fixed bug #1436 (Definition of GetSameRenditions in XmRenderT.c needs USE_XFT conditional) 2012-07-02 19:05:26 +0300 Yuriy Syrota * Fixed bug #1400 (Corrupted per-display font cache) 2012-07-02 19:02:35 +0300 Yuriy Syrota * Fixed bug #1440 (Tags array size in Label widget is not enough) 2012-07-02 18:59:44 +0300 Yuriy Syrota * Fixed bug #1429 (Build failure with libtool-2.2.4) 2012-07-02 18:07:56 +0300 Yuriy Syrota * Updated RELNOTES, RELEASE, openmotif.spec, openmotif-f8.spec for Open Motif 2.3.1 beta 1 (tag: release_2_3_1_beta1) 2012-07-02 18:03:44 +0300 Yuriy Syrota * Fixed RPM spec in order to put libXm.so in correct lib directory 2012-07-02 18:03:21 +0300 Yuriy Syrota * Updated openmotif.spec, TODO for OpenMotif 2.3.1. Updated release date in RELEASE. 2012-07-02 18:02:59 +0300 Yuriy Syrota * Updated release date in RELEASE 2012-07-02 18:02:37 +0300 Yuriy Syrota * Added libXm.so to package spec 2012-07-02 18:02:15 +0300 Yuriy Syrota * Updated libtool version number 2012-07-02 18:01:54 +0300 Yuriy Syrota * Added libXm.so to package spec 2012-07-02 18:01:21 +0300 Yuriy Syrota * openmotif-f8.spec : Specified --mandir in configure call 2012-07-02 17:59:34 +0300 Yuriy Syrota * Added RPM spec file for Fedora 8 ans similar distros 2012-07-02 17:56:16 +0300 Yuriy Syrota * Updated ChangeLog, RELNOTES and RELEASE 2012-07-02 17:46:55 +0300 Yuriy Syrota * Refixed bug #1414 (compiler warnings and invalid memory read) 2012-07-02 17:43:48 +0300 Yuriy Syrota * Fixed bud #1402 (Toggle button circular buttons can not mimic modern look) 2012-07-02 17:42:00 +0300 Yuriy Syrota * Fixed bug #1415 (XFT width calculation problem) 2012-07-02 17:33:12 +0300 Yuriy Syrota * Refix for bug #1395 (Wrong label foreground for etched in menus) 2012-07-02 17:19:37 +0300 Yuriy Syrota * Fixed bug #1410 (setting XmNisHomogeneous to True without setting XmNentryClass causes segfault) 2012-07-02 17:15:26 +0300 Yuriy Syrota * Fixed bug #1362 (Repeated calls to XmListReplaceItemsPos cause Error: Cannot perform malloc when using Extended_Select) 2012-07-02 17:09:29 +0300 Yuriy Syrota * Fixed bug #1365 (Top pixel of German character I with top '^' leaves trails) 2012-07-02 17:05:05 +0300 Yuriy Syrota * Refixed bug #1414 (XFT support slowness) 2012-07-02 17:03:09 +0300 Yuriy Syrota * Fixed bug #1414 (XFT support slowness) 2012-07-02 17:00:09 +0300 Yuriy Syrota * Fixed bug #1351 (Bad dynamic propagation of the sensitive state to popup menus) 2012-07-02 16:54:44 +0300 Yuriy Syrota * Fixed bug #1409 (XmTextField sometimes crashes) 2012-07-02 16:52:08 +0300 Yuriy Syrota * Fixed bug #1398 (newline not supported in UTF-8 mode) 2012-07-02 16:48:39 +0300 Yuriy Syrota * Fixed bug #1406 (Insensitive icon on XmPushButton black instead of grayed out) 2012-07-02 16:45:44 +0300 Yuriy Syrota * Fixed bug #1396 (ScrollBar warning when XmNotebook resized) 2012-07-02 16:40:27 +0300 Yuriy Syrota * Refixed bug #1388 (SEGV error moving mouse over window related to XmToolTipGetLabel). 2012-07-02 16:37:12 +0300 Yuriy Syrota * Fixed bug #1405 (Menus too short if PIXMAP_AND_STRING is used in PushButtons) 2012-07-02 16:35:26 +0300 Yuriy Syrota * Fixed bug #1404 (PIXMAP_AND_STRING causes crash in XmPushButtton in OptionMenu) 2012-07-02 16:29:13 +0300 Yuriy Syrota * Fixed incorrect parenthesis in if statement 2012-07-02 16:27:33 +0300 Yuriy Syrota * Fixed bug #1371 (XmComboBox problem on FC6) 2012-07-02 16:24:15 +0300 Yuriy Syrota * Fixed last comment in changelog 2012-07-02 16:22:38 +0300 Yuriy Syrota * Fixed bug #1296 (Drag-and-drop behaves incorrectly if XtSetLanguageProc() is present) 2012-07-02 16:14:21 +0300 Yuriy Syrota * Added /usr as possible prefix for toolkit installation 2012-07-02 16:13:44 +0300 Yuriy Syrota * Fixed bug #1395 (Wrong label foreground for etched in menus) 2012-07-02 16:05:31 +0300 Yuriy Syrota * Removed unnecessary configure.rh73 2012-07-02 16:04:32 +0300 Yuriy Syrota * Updated OpenMotif version 2012-07-02 16:02:23 +0300 Yuriy Syrota * Fixed bug #1392 (The label widgets can have their core class translations changed) 2012-07-02 15:56:31 +0300 Yuriy Syrota * Fixed Bug #1375 (XmPushButton's ArmAndActivate() has incorrect callback call) 2012-07-02 15:53:38 +0300 Yuriy Syrota * Fixed bug #1384 (Use of freed storage in XmContainer) 2012-07-02 15:45:39 +0300 Yuriy Syrota * Fixed bug #1209 (XmTextPaste crashes using XmTextField) 2012-07-02 15:39:10 +0300 Yuriy Syrota * Fixed bug #1367 (XmText autoShowCursorPosition is not always honoured when selected text is deleted) 2012-07-02 15:37:25 +0300 Yuriy Syrota * Fixed bug #1140 (Functions do not check _XmGetWidgetExtData result) 2012-07-02 15:33:52 +0300 Yuriy Syrota * Fixed bug #1383 (missing semi-colon at end of sentense) 2012-07-02 15:33:07 +0300 Yuriy Syrota * Fixed bug #1390 (out of range in array read in ReplaceItem) 2012-07-02 15:24:19 +0300 Yuriy Syrota * Fixed bug #1388 (SEGV error moving mouse over window related to XmToolTipGetLabel) 2012-07-02 15:23:47 +0300 Yuriy Syrota * Got rid of using strdup() in code 2012-07-02 15:22:56 +0300 Yuriy Syrota * Fixed bug #1387 (Scale Widget draws value text not centered to slider) 2012-07-02 15:20:15 +0300 Yuriy Syrota * Fixed bug #1381 (Sensitivity invisible with antialiased fonts) 2012-07-02 15:17:36 +0300 Yuriy Syrota * Fixed bug #1389 (A middle click on a tab lets nedit segfault) 2012-07-02 14:59:43 +0300 Yuriy Syrota * Fixed bug #1377 (XmText memory leak in InitializeHook) 2012-07-02 14:56:58 +0300 Yuriy Syrota * Fixed bug #1385 (core.self of XmMultiList is NULL , but must be pointer itself.) 2012-07-02 14:56:35 +0300 Yuriy Syrota * Fixed bug #1385 (core.self of XmMultiList is NULL , but must be pointer itself.) 2012-07-02 14:51:15 +0300 Yuriy Syrota * Fixd big #1380 (Can not set title bar in 2.3) 2012-07-02 13:38:50 +0300 Yuriy Syrota * Fixed bug #1373 (Problem with XmScale) 2012-07-02 13:38:24 +0300 Yuriy Syrota * Updated Release version in RELEASE and RELNOTES 2012-07-02 13:36:54 +0300 Yuriy Syrota * Updated Toolkit's Manager and Shell tests runner scripts 2012-07-02 13:36:29 +0300 Yuriy Syrota * Fixed bug #1371 (XmComboBox problem on FC6) 2012-07-02 13:31:36 +0300 Yuriy Syrota * pdated release version in RPM spec 2012-07-02 13:29:35 +0300 Yuriy Syrota * Fixed RPM spec in order to put system.mwmrc in correct lib directory 2012-07-02 12:12:07 +0300 Yuriy Syrota * Fixed bug #1212 (XmDropDown do not work correctly on item selection) 2012-07-02 12:11:12 +0300 Yuriy Syrota * Updated Changelog 2012-07-02 11:58:16 +0300 Yuriy Syrota * Fixed bugs #1369 (Invalid memory managing in XmList) and #1370 (XmList max item height problem). 2012-06-30 23:00:13 +0300 Yuriy Syrota * Added ChangeLog file 2012-06-30 22:58:24 +0300 Yuriy Syrota * Fixed bug #1350 (A window on a different screen than the cursor can not aquire focus from another window closing) 2012-06-30 22:56:23 +0300 Yuriy Syrota * Fixed bug report #1324 2012-06-30 22:55:38 +0300 Yuriy Syrota * Fixed bug #1360 for Label gadgets (Text is not shown on Widgets if setting XmNsensitive to False and using FONT_IS_XFT) 2012-06-30 22:54:45 +0300 Yuriy Syrota * Fixed bug #1360 (Text is not shown on Widgets if setting XmNsensitive to False and using FONT_IS_XFT) 2012-06-30 22:50:50 +0300 Yuriy Syrota * Fixed bug #1334 (Resizing scrolled text widget makes scrolling jerky and unpredictable) 2012-06-30 22:49:39 +0300 Yuriy Syrota * Font problems in demos/programs/periodic 2012-06-30 22:49:14 +0300 Yuriy Syrota * Fixed bug #1337 (Keyboard traversal in XmTabStack is nonfunctional) 2012-06-30 22:48:18 +0300 Yuriy Syrota * Fixed big #1344 (The XmColumn.3 manpage is non-standard) 2012-06-30 22:47:45 +0300 Yuriy Syrota * Restored compilation with GCC < 4.0 2012-06-30 22:45:59 +0300 Yuriy Syrota * Fixed bug #1343 (XmTabStack sometimes doesn't redraw tabs shadows) 2012-06-30 22:43:30 +0300 Yuriy Syrota * Fixed bug #1342 (Several demos/programs/ use 'lightcoral' background) 2012-06-30 22:39:35 +0300 Yuriy Syrota * Fixed bug #1348 (XmTabStack adds extra shadowThickness pixels to its children width or height) 2012-06-30 22:38:58 +0300 Yuriy Syrota * Removed tree-ter optimization since it causes deinitialization of some bit fields (according to valgrind) 2012-06-30 22:03:05 +0300 Yuriy Syrota * Added support of ISO-IR-111 (KOI8-R, KOI8-U, KOI8-RU) charset 2012-06-29 16:26:16 +0300 Yuriy Syrota * Added support of ISO-IR-111 (KOI8-R, KOI8-U, KOI8-RU) charset 2012-06-29 16:25:25 +0300 Yuriy Syrota * Fixed bug #1357 (Bad locking in ClassPartInitialize in VendorShell) 2012-06-29 16:24:21 +0300 Yuriy Syrota * Fixed bug #1358 (wrong preprocessor symbol in lib/Xm/ImageCache.c) 2012-06-29 16:23:32 +0300 Yuriy Syrota * used pkg-config instead of xft-config, so it allows compilation in Fedora Core 5 & 6 2012-06-29 16:23:12 +0300 Yuriy Syrota * Deactivated fix for bug report #1146. Since it causes bug #1361. 2012-06-29 16:22:44 +0300 Yuriy Syrota * Fixed a memory ariphmetic bug in ResEncod.c 2012-06-29 16:22:18 +0300 Yuriy Syrota * Increased size of supported tags array in Label widget in order to prevent buffer overrun 2012-06-29 16:19:59 +0300 Yuriy Syrota * Fixed using of uninitialized variables in TabStack.c 2012-06-29 16:19:38 +0300 Yuriy Syrota * Fixed bug #1346. XmTabStack segfaults with side tabs and XmNtabLabelString=="" 2012-06-29 16:13:06 +0300 Yuriy Syrota * Fixed bug #1347. (The XmTabStack.3 manpage should mention that XmNuniformTabSize is forced to True in STACKED mode) 2012-06-29 16:12:41 +0300 Yuriy Syrota * Fixed version of OpenMotif in the periodic demo 2012-06-29 16:10:55 +0300 Yuriy Syrota * Fixed bug #1341. (XmOutline.3 manual page lacks XmNconnectNodes resource description.) 2012-06-29 16:07:11 +0300 Yuriy Syrota * FIxed bug #1338 (periodic example lacks XmOutline demo) 2012-06-29 16:06:49 +0300 Yuriy Syrota * Removed unnecessary code from DragBS.c 2012-06-29 16:06:31 +0300 Yuriy Syrota * Fixed NULL resolving bug, as well as typo in CutPaste.c 2012-06-29 16:06:03 +0300 Yuriy Syrota * Added some additional NULL checkers 2012-06-29 16:04:04 +0300 Yuriy Syrota * Removed unnecessary code from DragC.c 2012-06-29 16:02:45 +0300 Yuriy Syrota * Fixed Coverity's CIDs 175, 58, 59 and 60 in DragOverS.c. 2012-06-29 16:00:57 +0300 Yuriy Syrota * Fixed Coverity's CID 148. Moved a pointer resolving to after checking this pointer for NULL. 2012-06-29 15:56:06 +0300 Yuriy Syrota * Fixed Coverity's CID 147. Moved a pointer resolving to after checking this pointer for NULL. 2012-06-29 15:55:41 +0300 Yuriy Syrota * Fixed Coverity's CID 134. Added a NULL ckecking in ClipboardFindItem() in CutPaste.c. 2012-06-29 15:55:19 +0300 Yuriy Syrota * Fixed Coverity's CID 132. Removed unnecessary NULL ckecking in an internal function. 2012-06-29 15:51:25 +0300 Yuriy Syrota * Close opened file in WriteFile() in makestrs.c in order to avoid resource leak 2012-06-29 15:51:08 +0300 Yuriy Syrota * fixed CVE-2005-3964: libUil buffer overflows 2012-06-29 15:50:35 +0300 Yuriy Syrota * Rolled back fix for #1318 2012-06-29 15:50:18 +0300 Yuriy Syrota * Fixed bug #1332 (invalid processing of Cascade Button background color). 2012-06-29 15:47:50 +0300 Yuriy Syrota * Fixed bug 1331 (XmList item default height set to 0 instead of 1) 2012-06-29 15:41:12 +0300 Yuriy Syrota * Fixed bug #1318. Explicitly set number of selected items to zero in ClearSelectedPositions() 2012-06-29 15:39:37 +0300 Yuriy Syrota * Removed an unused invernal funcion from MultiList.c 2012-06-29 15:36:38 +0300 Yuriy Syrota * Explicitly removed callbacks from XmNnodeStateBegEndCallback on destroying widget in order to avoid invalid free() caused by using two names for this callback list 2012-06-29 15:35:45 +0300 Yuriy Syrota * Umpated package version in RPM's specification 2012-06-29 15:35:31 +0300 Yuriy Syrota * Upated RELNOTES 2012-06-29 15:35:00 +0300 Yuriy Syrota * Restored RowColumn widget resizing logic 2012-06-29 15:34:38 +0300 Yuriy Syrota * Updated release version 2012-06-29 15:33:22 +0300 Yuriy Syrota * Updated package version 2012-06-29 15:31:26 +0300 Yuriy Syrota * Fixed bug #1294 (XmFileSelectionBox's XmNdirSpec resource misbehaves when pathMode is PATH_MODE_RELATIVE) 2012-06-29 15:29:46 +0300 Yuriy Syrota * Fixed bug 1297 (Insensitive XmPIXMAP XmPushButtons are stippled with wrong color) 2012-06-29 15:29:20 +0300 Yuriy Syrota * Added an #ifdef around a Xft-specific code fragment 2012-06-29 15:28:50 +0300 Yuriy Syrota * dded support for ISO10646 font in Unicode environment 2012-06-29 15:22:58 +0300 Yuriy Syrota * From my investigation, it seems that the way to get rid of the strict-aliasing warnings is to tell the compiler not to use strict aliasing. 2012-06-29 15:21:14 +0300 Yuriy Syrota * Add a cast so the compiler knows we know what we are doing. 2012-06-29 15:20:56 +0300 Yuriy Syrota * Adjust a prototype to avoid a warning. 2012-06-29 15:20:31 +0300 Yuriy Syrota * Fixed bug report #1317 (TextField doesn't display 'ü' char with fontType set to FONT_IS_XFT) 2012-06-29 15:19:44 +0300 Yuriy Syrota * Added lost Xpms_popen.c 2012-06-29 15:19:03 +0300 Yuriy Syrota * Got rid of compiler warnings in XmString.c. 2012-06-29 15:18:32 +0300 Yuriy Syrota * Got rid of compiler warnings in TextF.c. 2012-06-29 15:16:13 +0300 Yuriy Syrota * Got rid of compiler warnings in DataF.c. 2012-06-29 15:15:25 +0300 Yuriy Syrota * Fixed comparison function declaration in I18List.c, in order to get rid of a compiler warning. 2012-06-29 15:14:51 +0300 Yuriy Syrota * Fixed comparison function declaration, in order to get rid of a compiler warning. 2012-06-29 15:11:21 +0300 Yuriy Syrota * Fixed arg 5 of _XmWarningMsg(). It should be Cardinal, not pointer to Cardinal. 2012-06-29 15:10:33 +0300 Yuriy Syrota * Fixed bug #1315 (Division by zero in List widget) 2012-06-29 15:09:14 +0300 Yuriy Syrota * Fixed bug #1314 (Buffer overflow in MrmItop.c on 64-bit systems) 2012-06-29 15:07:49 +0300 Yuriy Syrota * Fixed bug #1313 (Buffer overrun in getsubres demo program) 2012-06-29 15:05:26 +0300 Yuriy Syrota * Fixed bug #1304. Buffer overflow in MrmOpenHierarchy...() 2012-06-29 14:59:34 +0300 Yuriy Syrota * Fixed bug #1311 (CVE-2005-0605 in libXPM) 2012-06-29 14:58:48 +0300 Yuriy Syrota * Got rid of obsolete tmpnam() call in imake 2012-06-29 14:56:24 +0300 Yuriy Syrota * Fixed bug #1310 (Common Vulnerability Exposure CAN-2004-0914 in libXpm) 2012-06-29 14:55:48 +0300 Yuriy Syrota * Let's see if I can still do this .... This fixes a mis-placed #endif that has been there since the beginning of time .... 2012-06-29 14:54:02 +0300 Yuriy Syrota * pdated version of library to 4.0 2012-06-29 14:51:01 +0300 Yuriy Syrota * Fixed XmBulletinBoard(3) man page (#1306) 2012-06-29 14:49:52 +0300 Yuriy Syrota * Demoved pre-made configure from te source tree 2012-06-29 14:49:10 +0300 Yuriy Syrota * Remade deprecated symbol aliases to use __attribute__ instead of #pragma weak in order to make in compatible with gcc 3 2012-06-29 14:48:22 +0300 Yuriy Syrota * Updated package version in openmotif.spec 2012-06-29 14:48:07 +0300 Yuriy Syrota * Fixed a type in XmPaned man page 2012-06-29 14:47:43 +0300 Yuriy Syrota * Changed dependency on byacc package to /bin/yacc binary in the RPM spec file 2012-06-29 14:46:15 +0300 Yuriy Syrota * Added man pages for XmDataFiled methods 2012-06-29 14:45:47 +0300 Yuriy Syrota * Added pre-made 'configure' in the source tree 2012-06-29 14:44:32 +0300 Yuriy Syrota * Added XmDataFieldCopy(3), XmDataFieldCut(3), and XmDataFieldPaste(3) man pages 2012-06-29 14:44:01 +0300 Yuriy Syrota * Added XmDataFieldSetEditable(3) man page 2012-06-29 14:41:41 +0300 Yuriy Syrota * Added XmDataFieldGetString(3) and XmDataFieldSetInsertionPosition(3) man pages 2012-06-29 14:41:03 +0300 Yuriy Syrota * Added XmDropDownGetChild(3) man page 2012-06-29 14:40:24 +0300 Yuriy Syrota * Added XmIconBoxIsCellEmpty(3) man page, and fixed a couple of typos in XmIconBox(3) 2012-06-29 14:39:35 +0300 Yuriy Syrota * Added XmPaned(3) man page 2012-06-29 14:38:41 +0300 Yuriy Syrota * Added XmPanedGetPanes(3) man page 2012-06-29 14:38:09 +0300 Yuriy Syrota * Added pages for functions of TabStack 2012-06-29 14:37:35 +0300 Yuriy Syrota * Added MultiList pages in Makefile.am 2012-06-29 14:37:16 +0300 Yuriy Syrota * Renamed XmMultiListDeselectAllItems.3 XmMultiListUnselectAllItems.3, made appropriate changes in the text. 2012-06-29 14:34:12 +0300 Yuriy Syrota * Renamed XmMultiListDeselectItem.3 XmMultiListUnselectItem.3, made necessary fixes in text. 2012-06-29 14:33:00 +0300 Yuriy Syrota * Included config.h in TabBox.c 2012-06-29 14:25:25 +0300 Yuriy Syrota * Fixed work of TabStack and IconButton with XFT fonts 2012-06-29 14:24:38 +0300 Yuriy Syrota * Fixed work of IconButton with XFT fonts 2012-06-29 14:24:14 +0300 Yuriy Syrota * Fixed compilation on FreeBSD 4, which has libiconv installed in non-standard path /usr/loca/lib 2012-06-29 14:23:54 +0300 Yuriy Syrota * Fixed compilation on FreeBSD 4, which has libiconv installed in non-standard path /usr/loca/lib 2012-06-29 14:23:31 +0300 Yuriy Syrota * Used XmMultiList instead of XmExt18List in demos 2012-06-29 14:23:11 +0300 Yuriy Syrota * Used XmDropDown instead of XmCombinationBox2 in demos 2012-06-29 14:21:55 +0300 Yuriy Syrota * Used XmDropDown instead of XmCombinationBox2 in demos 2012-06-29 14:21:07 +0300 Yuriy Syrota * Used XmMultiList instead of XmExt18List in demos 2012-06-29 14:20:42 +0300 Yuriy Syrota * Used XmDropDown instead of XmCombinationBox2 in demos 2012-06-29 14:20:27 +0300 Yuriy Syrota * Used xmDropDownWidgetClass insted xmCombinationBox2WidgetClass in FontSelector 2012-06-29 14:15:00 +0300 Yuriy Syrota * WML: Renamed XmCombinationBox2 and XmExt18List to XmDropDown and XmMultiList accordingly. 2012-06-29 14:14:35 +0300 Yuriy Syrota * Added looking for iconv lib 2012-06-29 14:13:50 +0300 Yuriy Syrota * Removed Ext18List.c and ComboBox2.c added MultiList.c and DropDown.c 2012-06-29 14:07:05 +0300 Yuriy Syrota * Renamed XmExt18List and XmCombinationBox2 widgets. Created appropriatre aliases for backward compatibility. 2012-06-29 14:05:46 +0300 Yuriy Syrota * Included new header files insted deprecated ones. 2012-06-29 14:05:27 +0300 Yuriy Syrota * Declared new cals for XmMultiList and XmDropDown widhet creation in MRM. 2012-06-29 14:04:21 +0300 Yuriy Syrota * Renamed XmExt18List and XmCombinationBox2 widgets. Created appropriatre aliases for backward compatibility. 2012-06-29 13:56:39 +0300 Yuriy Syrota * Include stdlib.h instead of malloc.h because some systems have moved malloc to stdlib 2012-06-29 13:56:22 +0300 Yuriy Syrota * Added keyword 'Alias' to WML class declaration 2012-06-29 13:55:57 +0300 Yuriy Syrota * Registered XmCombinationBox2 creation function in MRM 2012-06-29 12:41:11 +0300 Yuriy Syrota * Updated revision in XmAppl.uil 2012-06-29 12:40:50 +0300 Yuriy Syrota * Updated RPM spec for OM 2.3 beta1 2012-06-29 12:40:26 +0300 Yuriy Syrota * Added new resources to XmLabel and XmlabelGadget widgets 2012-06-29 12:39:44 +0300 Yuriy Syrota * Slightly improved readibility of Label.c LabelG.c code 2012-06-29 12:38:35 +0300 Yuriy Syrota * Updated libtool version of libXm 2012-06-29 12:38:13 +0300 Yuriy Syrota * Updated type of new render table resources 2012-06-29 12:37:54 +0300 Yuriy Syrota * Got rid of _XmXftSetClipRectanges2() function 2012-06-29 12:30:14 +0300 Yuriy Syrota * Fixed compilation on Solaris w/o Xft 2012-06-29 12:29:58 +0300 Yuriy Syrota * Fixed calculation of extents of default font 2012-06-29 12:28:04 +0300 Yuriy Syrota * Get rid of a compiler warning 2012-06-29 12:25:45 +0300 Yuriy Syrota * Fixed Converter of List for UTF8_STRING atom 2012-06-29 12:25:21 +0300 Yuriy Syrota * Removed declarations of undefined function from Column.h 2012-06-29 12:25:04 +0300 Yuriy Syrota * Fixed issues appeared with building using gcc4 2012-06-29 12:24:46 +0300 Yuriy Syrota * Fixed bug #1298 2012-06-29 12:24:28 +0300 Yuriy Syrota * Updated source tree in order to make it compilable by gcc4 2012-06-29 12:24:00 +0300 Yuriy Syrota * Added 2 DataField's man pages: XmDataFieldSetString(3) and XmDataFieldSetStringWcs(3) 2012-06-29 12:23:21 +0300 Yuriy Syrota * Fixed Incorrectly formatted table in VirtualBindings manpage as proposed by Dmitry Bolkhovityanov 2012-06-29 12:22:51 +0300 Yuriy Syrota * Applied the patch updates cursor position after commiting preedit text 2012-06-29 12:22:32 +0300 Yuriy Syrota * Removed unnecessary dependencies on libSM and libICE 2012-06-29 12:22:10 +0300 Yuriy Syrota * Fixed bug #1199 (Container does a XtDestroyWidget(cw->container.icon_header) on NULL pointer) 2012-06-29 10:06:11 +0300 Yuriy Syrota * Made static libraries build by default 2012-06-29 10:05:47 +0300 Yuriy Syrota * Updated LabelType with XmPIXMAP_AND_STRING 2012-06-29 10:05:31 +0300 Yuriy Syrota * Updated UTF8_SUPPORTED wrappers. 2012-06-29 10:05:04 +0300 Yuriy Syrota * Added utf8 support flag to configuration script 2012-06-29 10:03:39 +0300 Yuriy Syrota * updated UTF8_SUPPORTED wrappers in TextFSel.c 2012-06-29 10:02:01 +0300 Yuriy Syrota * added UTF8_SUPPORTED wareppers into ResEncod.c 2012-06-29 10:01:33 +0300 Yuriy Syrota * Updated Release Notes 2012-06-29 09:58:34 +0300 Yuriy Syrota * Updated version 2012-06-29 09:54:46 +0300 Yuriy Syrota * Fixed bug #1287 2012-06-29 09:53:29 +0300 Yuriy Syrota * Added convinced build script for test libraries 2012-06-27 15:49:46 +0300 Yuriy Syrota * Restored compilation of the QATS tests 2012-06-27 15:49:14 +0300 Yuriy Syrota * Fixed PNG condition in Makefile.am . 2012-06-27 15:48:36 +0300 Yuriy Syrota * Fixed issues with building with old automake 2012-06-27 15:47:58 +0300 Yuriy Syrota * Fixed bug #1118 (XmDialogShell instances' leak). 2012-06-27 15:47:27 +0300 Yuriy Syrota * Updated source code with ability to do not support UTF8 2012-06-27 15:46:43 +0300 Yuriy Syrota * Changed name of openmotif in spec 2012-06-27 15:46:11 +0300 Yuriy Syrota * Changed version of openmotif in spec 2012-06-27 15:45:47 +0300 Yuriy Syrota * Update Makefile.am in order to add Jpeg and Png support headers into distribution 2012-06-27 15:45:25 +0300 Yuriy Syrota * Changed version of openmotif in configure.ac 2012-06-27 15:45:03 +0300 Yuriy Syrota * Updated man pages with information related to newly added support of UTF8_STRING atom. 2012-06-27 15:42:19 +0300 Yuriy Syrota * Updated man pages with information related to JPEG and PNG image support 2012-06-27 15:41:41 +0300 Yuriy Syrota * Renamed macros indicates support of PNG and JPEG. Made the macros public in order to allow application programmers determine weather Xm supported these image formats. 2012-06-27 15:41:13 +0300 Yuriy Syrota * Updated PushButton redrawingin order to draw correct backround under label text 2012-06-27 15:40:46 +0300 Yuriy Syrota * Fixed a bug caused incorect drawing of selected pixmap in ToggleButtonGadget with label type XmPIXMAP_AND_STRING 2012-06-27 15:38:15 +0300 Yuriy Syrota * Fixed a bug caused incorect drawing of selected pixmap in ToggleButton with label type XmPIXMAP_AND_STRING 2012-06-27 15:37:22 +0300 Yuriy Syrota * Fixed a bug caused text overlap in labels using anti-aliased text 2012-06-27 15:36:50 +0300 Yuriy Syrota * Fixed a buf caused label pixmap clearing in with XmPIXMAP_AND_STRING label type 2012-06-27 14:54:31 +0300 Yuriy Syrota * Made PNG, JPEG and XFT support default 2012-06-27 14:53:36 +0300 Yuriy Syrota * Added ac_find_xft.m4 for XFT support 2012-06-27 14:53:01 +0300 Yuriy Syrota * Added Png.c Jpeg.c 2012-06-27 14:48:15 +0300 Yuriy Syrota * Added PngI.h JpegI.h 2012-06-27 14:46:54 +0300 Yuriy Syrota * Updated Makefile.am in order to add Jpeg.c and Png.c to the build process 2012-06-27 14:46:03 +0300 Yuriy Syrota * Updated man pages with description of new XmLabel feature to show label strings and pixmaps simultaneusly 2012-06-27 14:45:40 +0300 Yuriy Syrota * Rollback undesired changes in Container 2012-06-27 14:44:14 +0300 Yuriy Syrota * Fixed bug #1249 2012-06-27 14:43:23 +0300 Yuriy Syrota * Fixed bug #1286 2012-06-27 14:40:53 +0300 Yuriy Syrota * Fixed checking for non-printable strings in DataField widget 2012-06-27 14:39:18 +0300 Yuriy Syrota * Make the code compilable with CFT support 2012-06-27 14:38:46 +0300 Yuriy Syrota * Updated configure.ac in order to add XFT support 2012-06-27 14:38:23 +0300 Yuriy Syrota * Added UTF-8 and XFT support to WML 2012-06-27 14:33:00 +0300 Yuriy Syrota * Added declaration of XmCvtXmStringToUTF8String() 2012-06-27 14:32:43 +0300 Yuriy Syrota * Added support for XFT and UTF-8 2012-06-27 14:31:33 +0300 Yuriy Syrota * Added ac_image_support.m4 2012-06-27 14:30:49 +0300 Yuriy Syrota * Fixed bug #1283 (TabBox translation error) 2012-06-27 14:25:27 +0300 Yuriy Syrota * Added Advanced image support (PNG and JPEG) 2012-06-27 14:09:55 +0300 Yuriy Syrota * Fixed a typo 2012-06-27 12:32:34 +0300 Yuriy Syrota * Fixed bug #1211 (Crash on setting XmNlabelPixmap in a ToggleButtonGadget) (tag: release_2_2_4) 2012-06-27 12:31:01 +0300 Yuriy Syrota * Fixed bug #1264 (crash in PutDSToStream due to bug in _XmResizeHashTable). 2012-06-27 12:23:07 +0300 Yuriy Syrota * Fixed bug #1276 (XmList: changing AddMode selects/deselects items without callback). 2012-06-27 12:22:06 +0300 Yuriy Syrota * Fixed bug #1196 (Free memory read in XmIm.c/draw_separator(), line 2329). 2012-06-27 12:19:38 +0300 Yuriy Syrota * Fixed bug #1193 (MWM crashes when restarting by a session manager) 2012-06-27 12:18:08 +0300 Yuriy Syrota * Fixed bug #1202 2012-06-27 12:11:19 +0300 Yuriy Syrota * Fixed bug #1186 2012-06-27 12:00:34 +0300 Yuriy Syrota * Fixed bug #1214 (Cannot set a string to XmTextField with XtSetValues when XmNmodifyVerifyCallback is set) 2012-06-27 11:52:47 +0300 Yuriy Syrota * Fixed bug #1279 via modification GetSelection() function, now it returns False if selection is empty. 2012-06-27 11:51:20 +0300 Yuriy Syrota * Fixed bug #1278 as it was proposed in the bug report 2012-06-27 10:55:42 +0300 Yuriy Syrota * Adopt configuration scripts for automake 1.9 2012-06-27 10:54:52 +0300 Yuriy Syrota * Fixed working of MWM in multiscreen mode 2012-06-27 10:51:44 +0300 Yuriy Syrota * Some fixes in the tooltips implementations for Solaris 2012-06-27 10:50:39 +0300 Yuriy Syrota * Fixed Bug 1274. Included X11/Xmd.h in XpmI.h 2012-06-27 10:49:35 +0300 Yuriy Syrota * Fixed bug #1275. Removed invalid comments 2012-06-27 10:48:28 +0300 Yuriy Syrota * Added missing files for the possibility to enable/disable compatibility with Motif 2.1. 2012-06-27 10:43:53 +0300 Yuriy Syrota * Added possibility to enable/disable compatibility with Motif 2.1. Remade tooltips with Traits. 2012-06-27 10:34:19 +0300 Yuriy Syrota * Merged security fixes in XPM library from version 2.2.4 2012-06-26 23:27:35 +0300 Yuriy Syrota * Backport fixes from Xpm library 2012-06-26 23:26:10 +0300 Yuriy Syrota * Fixed compilation with bison 1.875 supplied with SuSe 9.1. Fixed redefinision of VERSION. 2012-06-26 23:25:24 +0300 Yuriy Syrota * Removed unnecessary defines 2012-06-26 23:25:03 +0300 Yuriy Syrota * Fixed bug #1269 (popup menus fail on Tarantella/VNC) 2012-06-26 23:14:13 +0300 Yuriy Syrota * Fixed bug #1262 (Entering Esc key before pulldown menu realized crashes) 2012-06-26 23:12:25 +0300 Yuriy Syrota * Fixed bug #1268 (XmCvtXmStringToCT improperly handles empty string) 2012-06-26 22:33:30 +0300 Yuriy Syrota * Added missing and removed superfluous resources in provisional widgets. Added XmdataField widget. 2012-06-26 22:30:32 +0300 Yuriy Syrota * Avoided of using XmPartOffset in DataField. Made the widget correctly based on TextField's structure. 2012-06-26 22:29:35 +0300 Yuriy Syrota * Added Datafield.h and TabBox.h to XmAll.h 2012-06-26 22:28:54 +0300 Yuriy Syrota * Moved XmTabBoxCallbackStruct definition to Xm.h 2012-06-26 22:28:25 +0300 Yuriy Syrota * Moved XmTabStackCallbackStruct definition to XmP.h 2012-06-26 22:27:50 +0300 Yuriy Syrota * Added synthetic resolution independent conversion of width/height resources to ExtendedList 2012-06-26 22:27:27 +0300 Yuriy Syrota * ExtendedList: Created working mirror of I18List resources intend to pass to agregated I18List widget 2012-06-26 22:26:54 +0300 Yuriy Syrota * DropDown: Used XmStringUnparse instead of non-standard handling 2012-06-26 22:26:25 +0300 Yuriy Syrota * ExtendedList: Added wide character string value of search string to ExtendedListCallbackStruct 2012-06-26 22:25:55 +0300 Yuriy Syrota * Made DropDown using XmGrabShell instead of TopLevelShell 2012-06-26 18:15:21 +0300 Yuriy Syrota * Got rid of using XtAppWarningMag where XmeWarning() and _XmWarningMsg() are customary 2012-06-26 18:14:38 +0300 Yuriy Syrota * Moved messages from Ext18List.c to central XmString repository. Got rid of obsolete XmStringCreateRtoL() call in Ext18List.c 2012-06-26 18:14:07 +0300 Yuriy Syrota * Got rid of using XmResolveAllpatrOffsets() in all provosional widgets but DataField. 2012-06-26 18:13:08 +0300 Yuriy Syrota * Removed unnecessary XmOutline.ps 2012-06-26 18:11:47 +0300 Yuriy Syrota * Fixed bug #1260 by Andreas Luik 2012-06-26 18:11:18 +0300 Yuriy Syrota * Fix for POSIX systems: it is impossible to create an array with size NL_TEXTMAX == INT_MAX 2012-06-26 17:36:50 +0300 Yuriy Syrota * Fixes for 64-bit platforms in Resolve.c 2012-06-26 17:36:29 +0300 Yuriy Syrota * Fix invalid cast in FonsS.c 2012-06-26 17:36:05 +0300 Yuriy Syrota * Fixed bug #1258 (RedHat's bug #124961). 2012-06-26 17:35:04 +0300 Yuriy Syrota * Fixed bug #1257 (RedHat's bug #124960). 2012-06-26 16:32:21 +0300 Yuriy Syrota * Fixed a typo in configure.ac 2012-06-26 16:32:03 +0300 Yuriy Syrota * Fixed bug #1256 2012-06-26 16:31:39 +0300 Yuriy Syrota * Added missed man pages for Outline, Hierarchy, Ext18List and CombinationBox2 widgets. Updated many XmVaCreate man pages. 2012-06-26 16:29:24 +0300 Yuriy Syrota * Added FreeBSD support 2012-06-26 16:28:34 +0300 Yuriy Syrota * Fixed incorrect XmRenderTableToProp() behavior appeared in RendToProp test. The function wrote -1 is background or foreground pixel value is XmAS_IS, but XmAS_IS has the same value as blue color pixel (255), besides background or foreground can't equal XmAS_IS in this place. So I just removed this logic. 2012-06-26 16:27:34 +0300 Yuriy Syrota * Fixed a number of compiler warnings 2012-06-26 16:27:04 +0300 Yuriy Syrota * Fixed a bug in XmeString.c caused by incorrect tag expected. Improved the test, now it check for two tags in string. 2012-06-26 16:25:33 +0300 Yuriy Syrota * Added lost files (origin/openmotif-2-3-exp1) 2012-06-26 12:28:55 +0300 Yuriy Syrota * Fixed a bug in XmeGetPixmapData.c. Finction shouldn't assing values for hot_x and hot_y if there is no hot spot in the image. 2012-06-26 12:28:23 +0300 Yuriy Syrota * Fixed CutPaste2 run script 2012-06-26 12:27:47 +0300 Yuriy Syrota * Fixed incorrect XmClipboardCopyByName() behavior appeared in CutPaste2 QATS test. 2012-06-26 12:27:25 +0300 Yuriy Syrota * Commented out threading debugging functions in Xmos.c because it causes uil fail 2012-06-26 12:26:56 +0300 Yuriy Syrota * Made libXm compilable after merging changes from openmotfi_2_2_3 2012-06-26 12:19:37 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to Xpmscan.c 2012-06-26 12:19:12 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to Xpmparse.c 2012-06-26 12:18:48 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to Xpmdata.c 2012-06-26 12:18:30 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to Xpmcreate.c 2012-06-26 12:18:09 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to XpmWrFFrI.c 2012-06-26 12:17:48 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to XpmCrDatFrI.c 2012-06-26 12:17:21 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to XpmCrBufFrI.c 2012-06-26 12:17:01 +0300 Yuriy Syrota * Avoided compilation warnings in XmIm.c 2012-06-26 12:16:38 +0300 Yuriy Syrota * Merged changes from openmotfi_2_2_3 to Xm.h and XmI.h 2012-06-26 12:16:13 +0300 Yuriy Syrota * Merged changes from release_2_2_3 to ToggleBG.c 2012-06-25 15:58:20 +0300 Yuriy Syrota * Merged changes from release_2_2_3 to ToggleB.c 2012-06-25 15:57:51 +0300 Yuriy Syrota * Merged changes from release_2_2_3 to Outline.c 2012-06-25 15:57:22 +0300 Yuriy Syrota * Merged changes from release_2_2_3 to Notebook.c 2012-06-25 15:56:55 +0300 Yuriy Syrota * Merged changes to Makefile.am from openmotif_2_2_3 2012-06-25 15:56:15 +0300 Yuriy Syrota * Returned xiIconButtonClassRec symbol for binary copatibility 2012-06-25 15:55:39 +0300 Yuriy Syrota * Updated ExtP.h with changes from openmotif_2_2_3 branch 2012-06-25 15:54:58 +0300 Yuriy Syrota * Returned xiColumnClassRec and xiColumnConstraintException symbols for binary copatibility 2012-06-25 15:54:31 +0300 Yuriy Syrota * Returned xiColorSelectorClassRec symbol for binary copatibility 2012-06-25 15:50:12 +0300 Yuriy Syrota * Updated LICENSE, README, README and /Makefile.am 2012-06-25 15:48:26 +0300 Yuriy Syrota * Removed unnecessary files 2012-06-25 15:28:10 +0300 Yuriy Syrota * Removed unnecessary files 2012-06-25 15:26:35 +0300 Yuriy Syrota * Initial commit 2012-06-25 15:25:05 +0300 Yuriy Syrota * QATS: Removed code fragment testing return value of XmeGetDefaultPixel() for XmBACKGROUND, since the returned value shouldn't be a generated 2012-06-25 15:24:42 +0300 Yuriy Syrota * QATS: Avoid hand-up of Cutpaste2a test 2012-06-25 15:21:43 +0300 Yuriy Syrota * Updated references to INSTALL.imake form Makefile.am and README 2012-06-25 15:16:50 +0300 Yuriy Syrota * Removed INSTALL.imake file, because imake building is no longer supported 2012-06-25 15:15:56 +0300 Yuriy Syrota * Fixed INSTALL.configure 2012-06-25 15:15:23 +0300 Yuriy Syrota * Fixed bug 1252. (XmCreateDropDownList doesn't work when XLC_LOCALE has on_demand_loading property.) 2012-06-25 15:07:39 +0300 Yuriy Syrota * Get rid of a header that is not needed. It caused problems if Xaw isn't installed. 2012-06-25 15:06:48 +0300 Yuriy Syrota * Changed package version for make dist 2012-06-25 15:06:01 +0300 Yuriy Syrota * Removed a non-existent file from Makefile.am 2012-06-25 15:05:20 +0300 Yuriy Syrota * Removed a non-existent file from Makefile.am 2012-06-25 15:03:49 +0300 Yuriy Syrota * Fixed locking in TabStack 2012-06-25 14:55:12 +0300 Yuriy Syrota * Fixed a memory leak in Ext18List and added LayoutDirectionsupport to I18List 2012-06-25 14:54:10 +0300 Yuriy Syrota * Fixed bug #1231 in IconFile.c 2012-06-25 14:53:14 +0300 Yuriy Syrota * Fixed bug #1230 in ScrolledW.c 2012-06-25 14:51:07 +0300 Yuriy Syrota * Fixed bug #1228 2012-06-25 14:50:00 +0300 Yuriy Syrota * Fixed bug #1239 2012-06-25 14:46:47 +0300 Yuriy Syrota * iFixed bug 1226 2012-06-25 14:46:27 +0300 Yuriy Syrota * iFixed bug 1207 2012-06-25 14:43:01 +0300 Yuriy Syrota * iFixed bug 1207 2012-06-25 14:42:26 +0300 Yuriy Syrota * iFixed bug 1197 2012-06-25 14:41:13 +0300 Yuriy Syrota * Fixed bugs 1154, 1164, 1172, 1173 and 1188 in ToggleB.c and ToggleBG 2012-06-25 14:38:37 +0300 Yuriy Syrota * Fixed bug 1168 in ScrolledW.c 2012-06-25 14:37:50 +0300 Yuriy Syrota * Fixed bug 1139 in Notebook.c 2012-06-25 14:28:30 +0300 Yuriy Syrota * Fixed bug 278 in XmDrawnButton.3 2012-06-25 14:23:46 +0300 Yuriy Syrota * Fixed bug 278 in XmText.3 2012-06-25 14:23:11 +0300 Yuriy Syrota * Added DropDown.h DropDownP.h MultiList.h MultiListP.h 2012-06-25 14:22:12 +0300 Yuriy Syrota * Added man pages for VaCreate functions 2012-06-25 14:21:37 +0300 Yuriy Syrota * Updated Makefile.am to include all new man pages 2012-06-25 14:18:18 +0300 Yuriy Syrota * Added man pages for MultiList widget 2012-06-25 14:17:39 +0300 Yuriy Syrota * Added man pages for VaCreate functions 2012-06-25 14:15:13 +0300 Yuriy Syrota * Added refences to VaCreate functions in XmCombobox.3 Added refences to VaCreate functions in XmContainer.3 Added refences to VaCreate functions in XmDataField.3 Added refences to VaCreate functions in XmDrawingArea.3 Added refences to VaCreate functions in XmDrawnButton.3 Added refences to VaCreate functions in XmFileSelectionBox.3 Added refences to VaCreate functions in XmForm.3 Added refences to VaCreate functions in XmFrame.3 Added refences to VaCreate functions in XmIconGadget.3 Added refences to VaCreate functions in XmText.3 Added refences to VaCreate functions in XmTextField.3 Added refences to VaCreate functions in XmRowColumn.3 Added refences to VaCreate functions in XmScale.3 Added refences to VaCreate functions in XmList.3 Added refences to VaCreate functions in XmMainWindow.3 Added refences to VaCreate functions in XmMessageBox.3 Added refences to VaCreate functions in XmNotebook.3 Added refences to VaCreate functions in XmPanedWindow.3 Added refences to VaCreate functions in XmScrollBar.3 Added refences to VaCreate functions in XmSeparator.3 Added refences to VaCreate functions in XmSeparatorGadget.3 Added refences to VaCreate functions in XmScrolledWindow.3 Added refences to VaCreate functions in XmSelectionBox.3 Added refences to VaCreate functions in XmSpinBox.3 Added refences to VaCreate functions in XmSimpleSpinBox.3 Added refences to VaCreate functions in XmLabel.3 Added new resources descriptions to XmLabel.3 Added refences to VaCreate functions in XmLabelGadget.3 Added new resources descriptions to XmLabelGadget.3 Added refences to VaCreate functions in XmIconBox.3 Added refences to VaCreate functions in XmTabStack.3 Added new resources descriptions to XmPushButton.3 Added refences to VaCreate functions in XmPushButton.3 Added new resources descriptions to XmPushButtonGadget.3 Added refences to VaCreate functions in XmPushButtonGadget.3 Added new resources descriptions to XmToggleButton.3 Added refences to VaCreate functions in XmToggleButton.3 Added new resources descriptions to XmToggleButtonGadget.3 Added refences to VaCreate functions in XmToggleButtonGadget.3 2012-06-25 13:14:26 +0300 Yuriy Syrota * Updated XmCommand.3 with references to its VaCreate functions 2012-06-25 13:13:51 +0300 Yuriy Syrota * Added DropDown man pages 2012-06-25 13:02:03 +0300 Yuriy Syrota * Updated XmColumn.3 with references to its VaCreate functions 2012-06-25 13:01:39 +0300 Yuriy Syrota * Updated XmCascadeButtonGadget.3 with references to its VaCreate functions 2012-06-25 13:01:21 +0300 Yuriy Syrota * Updated XmCascadeButton.3 with references to its VaCreate functions 2012-06-25 13:01:03 +0300 Yuriy Syrota * Updated XmButtonBox width references to its VaCreate functions 2012-06-25 13:00:42 +0300 Yuriy Syrota * Updated XmBulletinBoard.3 width references to its VaCreate functions 2012-06-25 12:53:06 +0300 Yuriy Syrota * Updated XmArrowButtonGadget.3 width references to its VaCreate functions 2012-06-25 12:52:21 +0300 Yuriy Syrota * Updated XmArrowButton.3 width references to its VaCreate functions 2012-06-25 12:50:35 +0300 Yuriy Syrota * Added VaCreate functions to XmBulletinBoard Added VaCreate functions to XmButtonBox Added Layout Direction support to XmButtonBox Added VaCreate functions to XmCascadeButton Added VaCreate functions to XmCascadeButtonGadget Added VaCreate functions to XmColorSelector Replaced XtAppWarningMsg calls with XmeWarning in XmColorSelector Added VaCreate functions to XmColumn Added Layout Direction support to XmColumn Added Render Table support to XmColumn Added VaCreate functions to XmCombinationBox2 Added Layout Direction support to XmCombinationBox2 Added Fast Subclassing support to XmCombinationBox2 Added VaCreate functions to XmComboBox Added VaCreate functions to XmCommand Added VaCreate functions to XmContainer Added VaCreate functions to XmDataField Added Render Table support to XmDataField Removed deprecated calls from XmDataField Added Transfer Trait support to XmDataField Added VaCreate functions to XmDrawingArea Added VaCreate functions to XmDrawnButton Added Render Table support to XmExt18List Removed deprecated calls from XmExt18List Added Layout Direction support to XmExt18List Added Layout Direction support to XmI18List Added Render Table support to XmI18List Added Transfer Trait support to XmI18List Added VaCreate functions to XmFileSelectionBox Added Layout Direction support to XmIconButton Added Activatable Trait support to XmIconButton Added Render Table support to XmIconButton Added VaCreate functions to XmIconButton Added VaCreate functions to XmIconGadget Added VaCreate functions to XmList Added VaCreate functions to XmMainWindow Added VaCreate functions to XmMessageBox Added VaCreate functions to XmNotebook Added Layout Direction support to XmPaned Added VaCreate functions to XmPanedWindow Added VaCreate functions to XmScrollBar Added VaCreate functions to XmScrolledWindow Added VaCreate functions to XmSelectionBox Added VaCreate functions to XmSimpleSpinBox Added Render Table support to XmTabBox Added Layout Direction support to XmTabBox Added VaCreate functions to XmTabBox Added VaCreate functions to XmRowColumn Added possibility to display text and pixmap label simultaneusly to XmToggleButton Added possibility to display text and pixmap label simultaneusly to XmPushButton Added possibility to display text and pixmap label simultaneusly to XmPushButtonGadget Added possibility to display text and pixmap label simultaneusly to XmLabel Added possibility to display text and pixmap label simultaneusly to XmLabelGadget Fixed bug #1184 2012-06-25 12:40:17 +0300 Yuriy Syrota * Fix for bug 1232, problem during destroy 2012-06-25 12:20:13 +0300 Yuriy Syrota * -version-info is not appropriate for the uil program, just the library. 2012-06-25 12:17:14 +0300 Yuriy Syrota * Get rid of some compiler warnings. 2012-06-25 12:15:12 +0300 Yuriy Syrota * Binary compatability issues: 2012-06-24 22:57:08 +0300 Yuriy Syrota * Added a few lines in the begining to make it clearer. -reh Wed Oct 30 01:18:34 EST 2002 2012-06-24 22:56:33 +0300 Yuriy Syrota * added lost files 2012-06-24 22:54:47 +0300 Yuriy Syrota * Note: If you are installing from a CVS pull, you can build the `configure' shell script from the 'autogen.sh' shell script. Please ensure that your autoconf and automake tools are up to date, otherwise you may find that generic "out of the box" installations of some platforms will give messages such as RedHat v7.3 does here: 2012-06-24 22:49:47 +0300 Yuriy Syrota * Get the *I.h files out of the distributed *.h files, again. This gets things building for me again. (origin/rel-2-2-ss-patches, origin/openmotif_2_2_3) 2012-06-24 22:46:35 +0300 Yuriy Syrota * Doing an XQueryTree, and in some cases not XFree'ing the returned children array. 2012-06-24 22:45:49 +0300 Yuriy Syrota * removed XmStrDefsI.h from the distributed header list 2012-06-24 22:42:44 +0300 Yuriy Syrota * hanged versions for 2.3.x (we will call it 2.3.0 for now) this is the main development branch from this point on you can check out the branch release_2_2_x if you wish to fix bugs in the 2.2.x series. that series will maintain binary compatability, however it will be broken in 2.3. Source compatability will not be broken. 2012-06-24 22:15:36 +0300 Yuriy Syrota * code clean up 2012-06-24 22:12:51 +0300 Yuriy Syrota * fixed headerfile protective #ifndef names by adding Xm to the definitions in an attempt to prevent namespace collisions. 2012-06-24 22:11:14 +0300 Yuriy Syrota * 1) updates for OME 2.2.3 2) removed fix in xmstring.list which broke compatability (will be added back in future) 2012-06-24 22:07:42 +0300 Yuriy Syrota * updated the file list 2012-06-24 21:50:26 +0300 Yuriy Syrota * potential bug fix for 1181 2012-06-24 21:49:54 +0300 Yuriy Syrota * added missing file into distro list 2012-06-24 21:48:02 +0300 Yuriy Syrota * removed duplicate line, fixed bug 1179 2012-06-24 21:46:25 +0300 Yuriy Syrota * 1) updates for building OME on platforms which are missing X11/Xos_r.h and X11/Xpoll.h 2) Updated spec files for various rpms. 2012-06-24 21:44:23 +0300 Yuriy Syrota * typo broke the demo when i added XtVaOpenApplication. (all fixed now ;) 2012-06-24 21:37:07 +0300 Yuriy Syrota * 1) removed acconfig.h as it is depricated and not needed 2) re-wored AC_DEFINE's to work as autoconf directs (and not need acconfig.h) 3) test for XmuNCopyISOLatin1Lowered which is not always part of libXmu on all platforms 2012-06-24 21:36:02 +0300 Yuriy Syrota * removed this file from CVS. it is depricated. I think having both the configure.ac and the configure.in available is bad, as someone might add to configure.in. To build this you will need to update your version of autoconf. As autoconf is backwards compatabile this is not a bad thing. 2012-06-24 21:35:34 +0300 Yuriy Syrota * protected the #defines with #ifndefs 2012-06-24 21:35:05 +0300 Yuriy Syrota * added the source files for the wml binary (to the makefile.am) 2012-06-24 21:34:30 +0300 Yuriy Syrota * fix for desensitizing/sensitizing XmCombinationbox2 (bug 1170) 2012-06-24 21:22:28 +0300 Yuriy Syrota * updated example code to use XtVaOpenApplication 2012-06-24 21:21:25 +0300 Yuriy Syrota * Fixed bug #1164 using supplied mod file. 2012-06-24 21:19:24 +0300 Yuriy Syrota * Fix to bug 1132 applied. 2012-06-24 21:09:02 +0300 Yuriy Syrota * Fix to bug 1132 applied. 2012-06-24 21:02:22 +0300 Yuriy Syrota * removed debug printf statement 2012-06-24 20:54:39 +0300 Yuriy Syrota * Bug 1140 - fixing return values from _XmGetWidgetExtData() for NULL to avoid dereferencing it. 2012-06-24 20:54:04 +0300 Yuriy Syrota * Bug 1140 - fixing return values from _XmGetWidgetExtData() for NULL to avoid dereferencing it. 2012-06-24 20:51:53 +0300 Yuriy Syrota * Updates for bug #1166 Special thanks to Gred (greg@lugs.org.sg) for uncovering, analyzing and sending in his patches. 2012-06-24 20:47:50 +0300 Yuriy Syrota * code clean up 2012-06-24 00:37:29 +0300 Yuriy Syrota * added a header to indicate that this file is depricated 2012-06-24 00:36:52 +0300 Yuriy Syrota * migrated configure script to new and improved automake 1.6 autoconf 2.52. This file replaces the configure.in script which is now depricated. 2012-06-24 00:36:03 +0300 Yuriy Syrota * added the conditional config.h include to support autoconf 2012-06-24 00:35:11 +0300 Yuriy Syrota * CR1156: Removed nested includes. 2012-06-24 00:34:49 +0300 Yuriy Syrota * CR1156: Removed duplicate nested include directives. 2012-06-24 00:31:34 +0300 Yuriy Syrota * Mods for CR1152 2012-06-24 00:29:39 +0300 Yuriy Syrota * Added mods for CR1146 2012-06-24 00:25:26 +0300 Yuriy Syrota * Updated the Version release to 2.2.3 for the comming release 2012-06-24 00:18:28 +0300 Yuriy Syrota * Applied fix to bug #1154. 2012-06-24 00:15:30 +0300 Yuriy Syrota * removed depricated functions (there are still more out there) 2012-06-23 23:52:14 +0300 Yuriy Syrota * mad application use XtVaOpenApplication 2012-06-23 23:51:56 +0300 Yuriy Syrota * Updating threads document re: latest changes. 2012-06-23 23:51:33 +0300 Yuriy Syrota * Wrapped accesses to class data inside _XmProcessLock()/_XmProcessUnlock() wrappers. 2012-06-23 23:51:08 +0300 Yuriy Syrota * Wrapped accesses to class data inside _XmProcessLock()/_XmProcessUnlock() wrappers. 2012-06-23 23:51:00 +0300 Yuriy Syrota * Wrapped accesses to class data inside _XmProcessLock()/_XmProcessUnlock() wrappers. 2012-06-23 23:46:28 +0300 Yuriy Syrota * Wrapped accesses to class data inside _XmProcessLock()/_XmProcessUnlock() wrappers. 2012-06-23 23:45:56 +0300 Yuriy Syrota * Wrapped accesses to class data inside _XmProcessLock()/_XmProcessUnlock() wrappers. 2012-06-23 23:45:33 +0300 Yuriy Syrota * Wrapped accesses to class data inside _XmProcessLock()/_XmProcessUnlock() wrappers. 2012-06-23 23:44:48 +0300 Yuriy Syrota * Wrapped accesses to class data inside _XmProcessLock()/_XmProcessUnlock() wrappers. 2012-06-23 23:43:43 +0300 Yuriy Syrota * Thread doc updated. 2012-06-23 23:41:54 +0300 Yuriy Syrota * Multithreading updates. 2012-06-23 23:40:50 +0300 Yuriy Syrota * Working on threads, and debugging them, so we juggled things around a bit. Once we are finished with this, we can put them back. We could have simply enveloped everything in "#ifdef" and "#endif", but that would have gotten really ugly, really quickly. 2012-06-23 23:40:11 +0300 Yuriy Syrota * Tweaked proprietary file name. 2012-06-23 23:39:08 +0300 Yuriy Syrota * Renamed proprietary file name. 2012-06-23 23:38:32 +0300 Yuriy Syrota * Enabled threading flags. 2012-06-23 23:30:17 +0300 Yuriy Syrota * Indicated what had been done so far. 2012-06-23 23:29:57 +0300 Yuriy Syrota * Updated To Do list 2012-06-23 23:29:31 +0300 Yuriy Syrota * Thread safety added. 2012-06-23 23:28:42 +0300 Yuriy Syrota * Added thread safety. 2012-06-23 23:27:52 +0300 Yuriy Syrota * Added included directive for "XmI.h", needed by _XmProcessLock() call 2012-06-23 23:03:05 +0300 Yuriy Syrota * Added thread safety calls. 2012-06-23 23:02:28 +0300 Yuriy Syrota * Added more notes, including what files have had their first run through. 2012-06-23 23:02:08 +0300 Yuriy Syrota * Thread updates. 2012-06-23 23:01:41 +0300 Yuriy Syrota * Added prototypes for XmDataFieldSetStringWcs() 2012-06-23 23:00:46 +0300 Yuriy Syrota * Added list of files to check thread saftey on. 2012-06-23 22:49:23 +0300 Yuriy Syrota * Removed calls to old nag screens. 2012-06-23 22:47:43 +0300 Yuriy Syrota * Some brief notes on handling thread safety inside widgets. 2012-06-23 22:46:15 +0300 Yuriy Syrota * Spell checked the To Do list. 2012-06-23 22:45:33 +0300 Yuriy Syrota * Updated the TO LIST. 2012-06-23 22:44:45 +0300 Yuriy Syrota * fixed broken include line in make files. The line is broken for all platforms, only darwin complained so far... 2012-06-23 15:23:36 +0300 Yuriy Syrota * to many "-I"'s problem in darwin build 2012-06-23 15:22:41 +0300 Yuriy Syrota * Renamed variable for widget class. 2012-06-23 15:22:07 +0300 Yuriy Syrota * same 2012-06-23 15:21:38 +0300 Yuriy Syrota * Tweaked fast sub-classing support for Font Selector 2012-06-23 15:20:55 +0300 Yuriy Syrota * Duplicate entry for XmTABSTACK_BIT removed. 2012-06-23 15:17:38 +0300 Yuriy Syrota * Fast sub classing support 2012-06-23 15:16:50 +0300 Yuriy Syrota * Fast subclassing for Color selector. 2012-06-23 15:16:24 +0300 Yuriy Syrota * Fast subclassing support added. 2012-06-23 15:15:52 +0300 Yuriy Syrota * Fast sub classing added. 2012-06-23 15:15:15 +0300 Yuriy Syrota * Fast subclassing modification. Corrected error indicating it was sub classed as an XmBulletinBoard... 2012-06-23 15:10:31 +0300 Yuriy Syrota * If we change the references to bxutil, we should also change the file name..... 2012-06-23 15:08:55 +0300 Yuriy Syrota * Added extra enums for fast sub classing of new widgets: XmBUTTONBOX_BIT, XmDATAFIELD_BIT, XmI18LIST_BIT, XmEXT18LIST_BIT, 2012-06-23 15:08:21 +0300 Yuriy Syrota * Traits for data transfer. 2012-06-23 15:07:32 +0300 Yuriy Syrota * missing misc.o and misc.c in the Imakefile 2012-06-23 15:06:40 +0300 Yuriy Syrota * Replace by "MrmosI.h" since -I. was removed from INCLUDES in the Imakefile. 2012-06-23 12:37:22 +0300 Yuriy Syrota * Includes Mrm/MrmAppl.h, Mrm/Mrm.h and X11/Xos_r.h in the wrong order. 2012-06-23 12:36:56 +0300 Yuriy Syrota * Progress on ToDo list 2012-06-23 12:36:34 +0300 Yuriy Syrota * Assumes a wrong path for rgb.txt. Make it use the right path. 2012-06-23 12:32:37 +0300 Yuriy Syrota * FreeBSD 4.x and above do have wide character string functions. 2012-06-23 12:31:46 +0300 Yuriy Syrota * fixed the include path for Xm.h 2012-06-23 12:30:30 +0300 Yuriy Syrota * Added default_button variable. 2012-06-23 12:29:42 +0300 Yuriy Syrota * Removing references to BX 2012-06-23 12:29:08 +0300 Yuriy Syrota * changed references from BxRegisterConverters to RegisterConverters. 2012-06-23 12:28:20 +0300 Yuriy Syrota * Modified references to bxutil to a more generic, and less product centric util 2012-06-23 12:25:47 +0300 Yuriy Syrota * Use XmStringUnparse instead of deprecated XmStringGetLtoR utilities to fetch the selected item from the Color namespace List. 2012-06-23 12:22:28 +0300 Yuriy Syrota * 1) Tweek needed to support the Trait XmQTtakesDefault so that default button highlight emphasis is supported in the standard manner. 2012-06-23 12:21:40 +0300 Yuriy Syrota * Minor code changes on the XmString API calls 2012-06-23 12:21:07 +0300 Yuriy Syrota * restoration 2012-06-23 12:19:01 +0300 Yuriy Syrota * restoration 2012-06-23 12:15:12 +0300 Yuriy Syrota * restoration 2012-06-23 12:04:26 +0300 Yuriy Syrota * Add in some MAINTAINERCLEANFILES lines 2012-06-23 12:03:45 +0300 Yuriy Syrota * Dependancy needed with --enable-message-catalog. I thought I fixed this already. Must have been in the other CVS. 2012-06-23 12:03:25 +0300 Yuriy Syrota * Add the VaCreate functions 2012-06-23 12:02:49 +0300 Yuriy Syrota * converted more programGuild examples to an autotools build process 2012-06-23 12:02:09 +0300 Yuriy Syrota * Introduced the ch08 demos into the wonderful world of autoconf 2012-06-23 11:58:50 +0300 Yuriy Syrota * added a "toDo" list in here. i copyed (and commented out) all the functions which need a Va version implimented. (i also took care of PushBG stuff). when we impliment one please move the function to the correct place and change it to reflect the Va part. 2012-06-23 11:58:08 +0300 Yuriy Syrota * added some public symbols for PushB 2012-06-23 11:57:45 +0300 Yuriy Syrota * Use the new XmeVa functions 2012-06-23 11:55:09 +0300 Yuriy Syrota * added stdlib.h to clean up warnings about exit not being defined 2012-06-23 11:54:39 +0300 Yuriy Syrota * cleaned up various compiler warnings 2012-06-23 11:49:43 +0300 Yuriy Syrota * added the ch06 demos into autoconf 2012-06-23 11:48:36 +0300 Yuriy Syrota * included stdlib to define "exit()" 2012-06-23 11:47:51 +0300 Yuriy Syrota * Made Simple Va Convience routines for all to use. Added declarations to XmP.h and added Functions to VaSimple.c. Implimented VaCreation functions in PushB.c. 2012-06-23 11:47:08 +0300 Yuriy Syrota * changed the Button creation functions to use a new XmVaCreateManagedPushButton() and XmVaCreatePushButton() as a test. 2012-06-23 11:44:43 +0300 Yuriy Syrota * added functions: 2012-06-23 11:35:11 +0300 Yuriy Syrota * Added a more specific "To Do" list for the new widgets added in OM v2.2 2012-06-23 11:33:48 +0300 Yuriy Syrota * Since at least one person thought the XmVaCreate* functions were a good idea, and no one said they were a bad idea, I'll throw this in for comment. There appears to be about 87 XmCreate's, so I would rather have just one picked apart and scrutinized before doing all 87 of them :) If this passes the cut, I could use a little help doing the other 86..... 2012-06-23 11:33:09 +0300 Yuriy Syrota * fixed this gcc warning: 2012-06-23 11:32:16 +0300 Yuriy Syrota * Here is a start to the demos/doc stuff. If someone wants to run with this go for it. 2012-06-23 11:30:00 +0300 Yuriy Syrota * Fixed bug# 1155 2012-06-23 11:23:00 +0300 Yuriy Syrota * Having config.status in MAINTAINERCLEANFILES seems to screw up the older versions of some of the auto tools. With this a make maintainer-clean from the toplevel was failing because it would delete config.status then recurse into the subdirs. Since config.status is taken care of by a distclean, take it out of here. 2012-06-23 11:22:35 +0300 Yuriy Syrota * Adding in spec files for both Mandrake and Redhat 2012-06-23 11:21:39 +0300 Yuriy Syrota * From the monster patch, bug #1156..... 2012-06-23 11:19:17 +0300 Yuriy Syrota * Get XmStrDefsI.h out of Ext.h - A whole wack of resources seem to have been added to the wrong section of xmstring.list. This meant that the client resources were getting stuck in an I.h file. 2012-06-23 11:18:03 +0300 Yuriy Syrota * Having _XEditResCheckMessages in libXm seems to cause a problem if libXmu is static, so change the name in libXm. Replacing part of Xmu is necessary because VendorShell lies about the placement of it's child. 2012-06-23 11:07:53 +0300 Yuriy Syrota * The SlideContext seems to be in there for good, so get rid of the conditionals. 2012-06-23 11:07:24 +0300 Yuriy Syrota * fixed 2012-06-23 11:06:03 +0300 Yuriy Syrota * If the tip would end up off the bottom of the screen, display it on top of the widget. If it would end up right of the screen, move it left. Of course width/height of the screen is a little ambiguous in an Xinerama environment :) 2012-06-23 11:05:02 +0300 Yuriy Syrota * Move XmStrDefs.c to the front of the list of sources so that it, and the other built sources, gets made real early on. 2012-06-23 11:03:27 +0300 Yuriy Syrota * Problem uncovered by openDX during widget destroys 2012-06-22 18:22:15 +0300 Yuriy Syrota * CDE_INSTALLATION_TOP and CDE_CONFIGURATION_TOP were not getting subst correctly. 2012-06-22 18:21:26 +0300 Yuriy Syrota * Get X_CFLAGS as the last include 2012-06-22 18:20:46 +0300 Yuriy Syrota * maintainer-clean should rm all files not in CVS. 2012-06-22 18:20:07 +0300 Yuriy Syrota * New auto tools are a little more verbose about questionable practices. This makes them happy. And it is the first commit message that should end up on the mailing list. 2012-06-22 18:19:42 +0300 Yuriy Syrota * built sources should depend on the Makefile, not the other way around. 2012-06-22 18:14:01 +0300 Yuriy Syrota * missing #endif 2012-06-22 18:12:39 +0300 Yuriy Syrota * patch applied in hopes of fixing segmentation fault on PageUp/Down in XmMainWindow submitted by Vadim Godunko. 2012-06-22 17:55:17 +0300 Yuriy Syrota * fixes (tag: release_2_2_2) 2012-06-22 16:52:51 +0300 Yuriy Syrota * adding things that got left out 2012-06-22 16:50:25 +0300 Yuriy Syrota * moved repo 2012-06-22 16:37:04 +0300 Yuriy Syrota * fixed version number 2012-06-22 16:36:42 +0300 Yuriy Syrota * clean up[ 2012-06-22 16:34:48 +0300 Yuriy Syrota * code clean up 2012-06-22 16:30:38 +0300 Yuriy Syrota * updated to a new version of motif 2012-06-22 16:24:20 +0300 Yuriy Syrota * a new version of motif 2012-06-22 16:00:48 +0300 Yuriy Syrota * added a lost patch 2012-06-22 15:58:53 +0300 Yuriy Syrota * i fixed things 2012-06-22 15:58:35 +0300 Yuriy Syrota * another typo 2012-06-22 15:58:07 +0300 Yuriy Syrota * fixed a typo 2012-06-22 15:57:48 +0300 Yuriy Syrota * fixed a dist problem 2012-06-22 15:57:27 +0300 Yuriy Syrota * more code clean up 2012-06-22 15:52:57 +0300 Yuriy Syrota * these are files which shouldnt be in CVS 2012-06-22 15:51:03 +0300 Yuriy Syrota * code clean up 2012-06-22 15:15:33 +0300 Yuriy Syrota * cleanups here and there 2012-06-22 15:15:10 +0300 Yuriy Syrota * clean up 2012-06-22 15:14:31 +0300 Yuriy Syrota * added #include for quieter compilation 2012-06-22 15:07:40 +0300 Yuriy Syrota * added header file for quieter compilation 2012-06-22 15:07:17 +0300 Yuriy Syrota * cleanup 2012-06-22 14:48:19 +0300 Yuriy Syrota * precedence warning cleanup 2012-06-22 14:47:56 +0300 Yuriy Syrota * stdlib.h addition quites warnings 2012-06-22 14:47:34 +0300 Yuriy Syrota * removed warning 2012-06-22 12:09:40 +0300 Yuriy Syrota * cleaned up precedence 2012-06-22 12:09:19 +0300 Yuriy Syrota * cleaner 2012-06-22 12:08:57 +0300 Yuriy Syrota * fixed warnings 2012-06-22 12:08:24 +0300 Yuriy Syrota * fixes for install 2012-06-22 12:08:06 +0300 Yuriy Syrota * add Ext18List pixmaps dir 2012-06-22 11:32:15 +0300 Yuriy Syrota * Need this 2012-06-22 11:29:44 +0300 Yuriy Syrota * Missed a couple Xi to Xm 2012-06-22 11:29:12 +0300 Yuriy Syrota * Tons of clean ups and a dash of "Warning BeGone (TM)" 2012-06-22 11:28:26 +0300 Yuriy Syrota * Update version in mwm 2012-06-22 11:27:51 +0300 Yuriy Syrota * CR04070 2012-06-22 11:21:35 +0300 Yuriy Syrota * moved all Xi Strings into the default motif string defintion file 2012-06-22 11:20:49 +0300 Yuriy Syrota * removed bad code 2012-06-22 11:19:12 +0300 Yuriy Syrota * removed errors 2012-06-22 11:18:45 +0300 Yuriy Syrota * code clean up 2012-06-22 11:17:34 +0300 Yuriy Syrota * fixed some warnings 2012-06-22 11:07:50 +0300 Yuriy Syrota * removed this file. its not needed 2012-06-22 11:07:20 +0300 Yuriy Syrota * removed Epak References, changed soem Xi's to Xm's 2012-06-22 10:55:53 +0300 Yuriy Syrota * fix for mwm crashes when attempting to delete a menu item 2012-06-22 10:45:44 +0300 Yuriy Syrota * More on previous log entry 2012-06-22 10:45:20 +0300 Yuriy Syrota * Problem was: ImSetGeo function causes Segmentation Fault when a widget which has the last XmImXIC 2012-06-21 16:15:27 +0300 Yuriy Syrota * Problem was: XmText doesn't updates scrollbars if parent is not XmScrolledWindow 2012-06-21 16:14:52 +0300 Yuriy Syrota * fixed some Xi Enumeration 2012-06-21 16:14:30 +0300 Yuriy Syrota * fixed up some man pages (added them to the dist list) 2012-06-21 16:14:07 +0300 Yuriy Syrota * darwin patch added 2012-06-21 16:13:43 +0300 Yuriy Syrota * fix 2012-06-21 16:10:47 +0300 Yuriy Syrota * fix 2012-06-21 16:10:35 +0300 Yuriy Syrota * fix 2012-06-21 16:10:18 +0300 Yuriy Syrota * added some resources 2012-06-21 16:09:54 +0300 Yuriy Syrota * Fixed Chris' messed up carage return 2012-06-21 16:09:30 +0300 Yuriy Syrota * Out, out damn spot\! 2012-06-21 16:07:14 +0300 Yuriy Syrota * Whoops 2012-06-21 16:07:05 +0300 Yuriy Syrota * Whoops 2012-06-21 16:06:55 +0300 Yuriy Syrota * whoops 2012-06-21 16:01:30 +0300 Yuriy Syrota * Whoops 2012-06-21 15:59:24 +0300 Yuriy Syrota * Whoops 2012-06-21 09:33:11 +0300 Yuriy Syrota * whoops 2012-06-21 09:32:25 +0300 Yuriy Syrota * fix 2012-06-21 09:30:32 +0300 Yuriy Syrota * Massive add for darwin building 2012-06-21 09:28:09 +0300 Yuriy Syrota * fix for OpenBSD and NetBSD 2012-06-21 09:27:46 +0300 Yuriy Syrota * fix as per kraxel@debian.org's request 2012-06-21 09:23:34 +0300 Yuriy Syrota * fix to be after local includes 2012-06-21 09:22:56 +0300 Yuriy Syrota * fix 2012-06-21 09:22:28 +0300 Yuriy Syrota * Added XmNallowUnusedSpace 2012-06-21 09:22:00 +0300 Yuriy Syrota * Added XmNallowUnusedSpace 2012-06-21 09:20:42 +0300 Yuriy Syrota * Added XmNallowUnusedSpace 2012-06-21 09:08:56 +0300 Yuriy Syrota * fixed version problems. there is no need to check what version ofmotif we have, its always the same (the current one ) 2012-06-21 09:07:05 +0300 Yuriy Syrota * use libtool versioning 2012-06-21 09:06:38 +0300 Yuriy Syrota * fixed the version, and fixed warnings. 2012-06-21 09:06:12 +0300 Yuriy Syrota * removed an Epak Reference. 2012-06-21 09:05:20 +0300 Yuriy Syrota * fixed more warnings 2012-06-20 21:27:57 +0300 Yuriy Syrota * changed to the next .. version 2012-06-20 21:26:24 +0300 Yuriy Syrota * fixed reverse reptype converter 2012-06-20 21:24:34 +0300 Yuriy Syrota * fixed much of editres 2012-06-20 21:23:03 +0300 Yuriy Syrota * removed many warnings 2012-06-20 20:44:14 +0300 Yuriy Syrota * applied a couple of lost patches 2012-06-19 12:08:10 +0300 Yuriy Syrota * fixed some Imake things (yuck) 2012-06-19 12:04:11 +0300 Yuriy Syrota * added some stuff needed by Imake (Blah...) 2012-06-19 12:03:00 +0300 Yuriy Syrota * changed order around to emphasise configure 2012-06-19 11:59:36 +0300 Yuriy Syrota * added Imakefiles to the distro 2012-06-19 11:55:27 +0300 Yuriy Syrota * referenced the rel notes 2012-06-19 11:54:04 +0300 Yuriy Syrota * done need this file in here 2012-06-19 11:51:17 +0300 Yuriy Syrota * minor fixes 2012-06-19 11:50:44 +0300 Yuriy Syrota * added this file 2012-06-19 11:47:01 +0300 Yuriy Syrota * meh 2012-06-19 11:46:33 +0300 Yuriy Syrota * fix 2012-06-19 11:46:08 +0300 Yuriy Syrota * fixed some automake stuff 2012-06-19 11:28:56 +0300 Yuriy Syrota * took out tab 2012-06-19 11:27:06 +0300 Yuriy Syrota * took out bad char 2012-06-19 11:25:39 +0300 Yuriy Syrota * moved the new widget directory 2012-06-19 11:19:54 +0300 Yuriy Syrota * tweak 2012-06-19 11:19:23 +0300 Yuriy Syrota * removed unneeded files 2012-06-19 11:16:54 +0300 Yuriy Syrota * fix 2012-06-19 11:15:47 +0300 Yuriy Syrota * Initial add 2012-06-19 11:14:14 +0300 Yuriy Syrota * add this 2012-06-19 11:10:58 +0300 Yuriy Syrota * Gonna need these 2012-06-19 11:10:18 +0300 Yuriy Syrota * moved widget demos 2012-06-19 10:51:39 +0300 Yuriy Syrota * fixed a extra backslash 2012-06-19 10:49:10 +0300 Yuriy Syrota * moved the newwidget directory 2012-06-19 10:46:59 +0300 Yuriy Syrota * removed the binary 2012-06-19 10:44:20 +0300 Yuriy Syrota * moved newwidgets directory 2012-06-19 10:27:15 +0300 Yuriy Syrota * moved files from new widgets 2012-06-19 10:20:59 +0300 Yuriy Syrota * fixed in an unsupported sort of way 2012-06-19 10:19:20 +0300 Yuriy Syrota * fixed problem with Slid and ToolTip with to many include config.h statements 2012-06-19 10:18:05 +0300 Yuriy Syrota * fixed 2012-06-19 10:16:51 +0300 Yuriy Syrota * added more spaces 2012-06-19 10:15:39 +0300 Yuriy Syrota * moved demo programs installed formerly into bin are now installed into share/Xm/demoname/ 2012-06-19 09:41:26 +0300 Yuriy Syrota * some changes about what we recomend 2012-06-19 09:40:29 +0300 Yuriy Syrota * KEEP the flags which make this work\! 2012-06-19 09:39:14 +0300 Yuriy Syrota * changed the version on the dist tar ball 2012-06-19 09:38:30 +0300 Yuriy Syrota * fixed version 2012-06-18 22:41:00 +0300 Yuriy Syrota * FINALLY GOT THE DAMN VERSION NUM RIGHT only took 1 beer! 2012-06-18 22:39:54 +0300 Yuriy Syrota * enable static builds 2012-06-18 22:39:20 +0300 Yuriy Syrota * Removed wrong comment 2012-06-18 22:38:36 +0300 Yuriy Syrota * libtool 2012-06-18 22:37:56 +0300 Yuriy Syrota * remove 2012-06-18 22:36:38 +0300 Yuriy Syrota * Use this to gen Makefile and configure 2012-06-18 22:35:37 +0300 Yuriy Syrota * tada 2012-06-18 22:34:49 +0300 Yuriy Syrota * getting 2012-06-18 22:34:04 +0300 Yuriy Syrota * is 2012-06-18 22:33:24 +0300 Yuriy Syrota * this 2012-06-18 22:30:49 +0300 Yuriy Syrota * fix 2012-06-18 22:29:07 +0300 Yuriy Syrota * XmColumn widget man page 2012-06-18 22:28:12 +0300 Yuriy Syrota * XmDataField widget man page 2012-06-18 22:27:23 +0300 Yuriy Syrota * added jeffs files into the Makefile.am 2012-06-18 22:25:33 +0300 Yuriy Syrota * some fix 2012-06-18 22:21:42 +0300 Yuriy Syrota * XmButtonBox widget man page 2012-06-18 22:20:45 +0300 Yuriy Syrota * XmColorSelector widget man page 2012-06-18 22:19:48 +0300 Yuriy Syrota * XmExt18List.3 widget man page 2012-06-18 22:18:52 +0300 Yuriy Syrota * XmFontSelector widget man page 2012-06-18 22:17:15 +0300 Yuriy Syrota * XmIconBox widget man page 2012-06-18 22:13:26 +0300 Yuriy Syrota * XmIconButton widget man page 2012-06-18 22:11:43 +0300 Yuriy Syrota * Fixed a couple spurious Xi's that I missed the first time 2012-06-18 22:09:47 +0300 Yuriy Syrota * XmTabStack widget man page 2012-06-18 22:08:15 +0300 Yuriy Syrota * XmTree widget man page 2012-06-18 22:06:21 +0300 Yuriy Syrota * added some Xconfig stuff 2012-06-18 22:05:11 +0300 Yuriy Syrota * added some X11 include stuff 2012-06-18 22:03:19 +0300 Yuriy Syrota * added some X11Header Includes 2012-06-18 21:56:10 +0300 Yuriy Syrota * added default X11 Includes 2012-06-18 21:54:48 +0300 Yuriy Syrota * replaced some Xi's with Xm 2012-06-18 21:50:45 +0300 Yuriy Syrota * changed more Xi's to Xm's 2012-06-18 21:46:33 +0300 Yuriy Syrota * changed some Xi's to Xm's 2012-06-18 21:45:40 +0300 Yuriy Syrota * added a directory 2012-06-18 21:44:55 +0300 Yuriy Syrota * took out tool tips 2012-06-18 21:44:05 +0300 Yuriy Syrota * added default Xflags 2012-06-18 21:43:25 +0300 Yuriy Syrota * added the ht files for auto generation 2012-06-18 21:42:22 +0300 Yuriy Syrota * fixed some Xi's to Xm 2012-06-18 21:41:35 +0300 Yuriy Syrota * added the lines from readme.ics 2012-06-18 21:39:43 +0300 Yuriy Syrota * moved include line around to put X11 config settings first 2012-06-18 21:38:59 +0300 Yuriy Syrota * fixed version string 2012-06-18 21:37:46 +0300 Yuriy Syrota * stuyff 2012-06-18 18:26:55 +0300 Yuriy Syrota * stuff 2012-06-18 18:25:29 +0300 Yuriy Syrota * added X11 stuff 2012-06-18 18:24:57 +0300 Yuriy Syrota * added X11 includes 2012-06-18 18:24:16 +0300 Yuriy Syrota * some change 2012-06-18 18:23:32 +0300 Yuriy Syrota * removed the toolbar demo 2012-06-18 18:22:56 +0300 Yuriy Syrota * changed Xi to Xm 2012-06-18 18:17:03 +0300 Yuriy Syrota * fixed a problem with XmCreate 2012-06-18 18:12:17 +0300 Yuriy Syrota * 1) removed unsupported demos 2012-06-18 18:10:37 +0300 Yuriy Syrota * made some clean ups and talked about getting the master Imakefile 2012-06-18 18:08:03 +0300 Yuriy Syrota * emoved this file on POURPOSE (SP??) read INSTALL.imake 2012-06-18 17:49:37 +0300 Yuriy Syrota * cleaned up the build directions 2012-06-16 22:05:45 +0300 Yuriy Syrota * demo updates to autoconf 2012-06-16 22:04:54 +0300 Yuriy Syrota * moved the tooltips demo to programs 2012-06-16 22:04:13 +0300 Yuriy Syrota * moved the tooltips demo 2012-06-16 22:03:18 +0300 Yuriy Syrota * moved these demos 2012-06-16 22:00:44 +0300 Yuriy Syrota * moved tooltips into supported world 2012-06-16 21:59:17 +0300 Yuriy Syrota * these files are automaticly generated 2012-06-16 21:56:31 +0300 Yuriy Syrota * added a few new files and fixed problems with symbols 2012-06-16 21:55:33 +0300 Yuriy Syrota * typo 2012-06-16 21:41:18 +0300 Yuriy Syrota * Extra files for the v2.2 widget additions 2012-06-16 21:38:02 +0300 Yuriy Syrota * Adding ComboBox2.c ComboBox2.h ComboBox2P.h needed for FontS widget 2012-06-16 21:35:35 +0300 Yuriy Syrota * Initial source drop of new Motif v2.2 widgets. 2012-06-16 21:33:11 +0300 Yuriy Syrota * Tweaked files to get rid of undefined external references from old Xi var names. 2012-06-16 17:54:34 +0300 Yuriy Syrota * Tweaked files to get rid of undefined external references from old Xi var names. 2012-06-16 17:46:18 +0300 Yuriy Syrota * modification for Darwin Port 2012-06-16 17:37:42 +0300 Yuriy Syrota * fixed header info 2012-06-16 17:36:33 +0300 Yuriy Syrota * changed the version and what gets packaged in the make dist 2012-06-16 17:34:33 +0300 Yuriy Syrota * Put tooltip resources into alpha order 2012-06-16 17:32:19 +0300 Yuriy Syrota * addded a directory 2012-06-16 17:24:35 +0300 Yuriy Syrota * added some demo directories 2012-06-16 17:11:51 +0300 Yuriy Syrota * changed the widgetclass to Xm from Xi 2012-06-16 17:05:00 +0300 Yuriy Syrota * Fixed typos, moved tooltip resources into alphabetical order 2012-06-16 17:03:29 +0300 Yuriy Syrota * updated the RELNOTES with correct version 2012-06-16 16:57:34 +0300 Yuriy Syrota * added some bits about autoconf 2012-06-16 16:53:46 +0300 Yuriy Syrota * added the config.h so that the thing with build correctly. 2012-06-16 13:20:30 +0300 Yuriy Syrota * reverted the Imake Makefile, dont ever check in the autoconf Makefile 2012-06-16 13:06:54 +0300 Yuriy Syrota * checking in the AutoConf Stuff. to Make the config File you must run CVSMake 2012-06-16 12:37:58 +0300 Yuriy Syrota * Changed to reflect that we are workin on v2.2 2012-06-04 18:11:27 +0300 Yuriy Syrota * added tool tip resources to the apropreate shells 2012-06-04 17:55:51 +0300 Yuriy Syrota * added tool tips to selected widgets 2012-06-04 17:41:53 +0300 Yuriy Syrota * added sliding menues 2012-06-04 15:22:29 +0300 Yuriy Syrota * tool tips documentation 2012-05-24 14:56:25 +0300 Yuriy Syrota * Added tool tips. there is a demo on how to use them in demos/unsupported/tooltips. This work was done by Rick Scott. 2012-05-23 18:38:18 +0300 Yuriy Syrota * I resolved an unresolved symbole in FontS.c which depended on XmCombinationBoxGetValue, that convience function didnt exist on an XmComboBox. i added the convience function. this needs to be tested more. O also added a comment to test it in the readme.mod file. 2012-05-22 15:21:05 +0300 Yuriy Syrota * Added the file I18List.c to resolve symbols in Ext18list.c 2012-05-22 14:49:04 +0300 Yuriy Syrota * Added XmALIGNMENT_UNSPECIFIED in Xm.h 2012-05-22 14:31:54 +0300 Yuriy Syrota * the new Motif Version 2012-05-21 12:02:34 +0300 Yuriy Syrota * Adding files formerly know as Xi 2012-05-11 17:33:33 +0300 Yuriy Syrota * Pulled in the sources from OpenMotif 2.1.30_5 (tag: release_2_1_30_5) 2012-04-20 18:55:18 +0300 Yuriy Syrota * Initial commit (tag: release_2_1_30) motif-2.3.8/configure.ac0000644000175000017500000002535113211512212012045 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([lib/Xm/Form.c]) AC_PREREQ(2.52) AC_CONFIG_AUX_DIR(.) AC_CHECK_FILE(/usr/X/include/X11/X.h, AC_PREFIX_DEFAULT(/usr/X), AC_PREFIX_DEFAULT(/usr)) AC_CHECK_FILE(/usr/X11R6/include/X11/X.h, AC_PREFIX_DEFAULT(/usr/X11R6), AC_PREFIX_DEFAULT(/usr)) dnl AM_MAINTAINER_MODE AC_CANONICAL_TARGET dnl The version of the Motif libraries CURRENT=4 REVISION=4 AGE=0 AC_SUBST(CURRENT) AC_SUBST(REVISION) AC_SUBST(AGE) dnl This is really dumb but it seems to be bug AM_INIT_AUTOMAKE(motif,2.3.8,no-define) LIBTOOL_VERSION=$CURRENT:$REVISION:$AGE dnl dnl Override a default in libtool. dnl dnl AC_DISABLE_STATIC AC_CONFIG_HEADERS(include/config.h lib/Xm/Xm.h) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AM_PROG_LIBTOOL AC_EXEEXT dnl AC_PROG_YACC dnl Do this the old fashioned way. 'bison -y' doesn't cut it AC_CHECK_PROGS(YACC, byacc, yacc) dnl AC_PROG_SPLINT AC_CHECK_PROGS(SPLINT, splint) AM_PROG_LEX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl Checks for libraries. AC_PATH_X AC_PATH_XTRA LT_LIB_XTHREADS dnl Checks for Xos_r.h AC_CHECK_HEADERS([X11/Xos_r.h]) AC_CHECK_HEADERS([X11/Xpoll.h]) dnl Compile in EditRes support if we can find Xmu save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$X_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" AC_CHECK_HEADERS(X11/Xmu/Editres.h, AC_CHECK_LIB(Xmu, _XEditResCheckMessages, X_XMU=-lXmu AC_DEFINE(HAVE_LIBXMU, 1, This System has libXmu) , X_XMU="", -lXt -lX11) AC_CHECK_LIB(Xmu,XmuNCopyISOLatin1Lowered , AC_DEFINE(HAVE_XMU_N_COPY_ISO,1,Have XmuNCopyISOLatin1Lowered) , , -lXt -lX11) ,,[[#include ]] ) AC_SUBST(X_XMU) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AM_CONDITIONAL(OM_XMU, test x$X_XMU != x) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/malloc.h strings.h sys/file.h sys/time.h unistd.h wchar.h) AC_CHECK_HEADERS(wctype.h, AC_DEFINE(HAS_WIDECHAR_FUNCTIONS,1,System supports wchar)) AC_CHECK_HEADER(langinfo.h,,AC_DEFINE(CSRG_BASED,1,System Has langinfo.h)) AC_CHECK_HEADER(X11/Xos_r.h,,AC_DEFINE(NEED_XOS_R_H,1,System Missing Xos_r.h)) AC_CHECK_HEADER(X11/Xpoll.h,,AC_DEFINE(NEED_XPOLL_H,1,system Missing X11/Xpoll.h)) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T WEAK_ALIAS_SUPPORT dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_MEMCMP AC_FUNC_SETPGRP AC_TYPE_SIGNAL AC_FUNC_STRCOLL AC_FUNC_STRFTIME AC_FUNC_FORK([]) AC_FUNC_VPRINTF AM_FUNC_VOID_SPRINTF AC_CHECK_FUNCS(wcslen wcscpy wcsncpy wcschr wcscat wcsncat getcwd gettimeofday mkdir re_comp regcmp select strcspn strerror strstr strtod strtol uname) AC_CHECK_FUNCS(strdup,,AC_DEFINE(NEED_STRDUP, 1, no strdup)) AC_CHECK_FUNCS(strcasecmp,,AC_DEFINE(NEED_STRCASECMP, 1, no strcasecmp)) AC_CHECK_FUNCS(putenv,,AC_DEFINE(NO_PUTENV, 1, No PUTENV)) AC_CHECK_FUNCS(regcomp,,AC_DEFINE(NO_REGCOMP, 1, no regcmp)) AC_CHECK_FUNCS(memmove,,AC_DEFINE(NO_MEMMOVE, 1, no memmove)) AC_CHECK_TYPE(XICProc,,AC_DEFINE(NO_XICPROC, 1, XICProc isn't defined), [#include ]) AC_ARG_ENABLE(message-catalog, [ --enable-message-catalog Enable building of the message catalog (default=no)]) if test "$enable_message_catalog" != "yes" then AC_DEFINE(NO_MESSAGE_CATALOG, 1, No Defined Message Catalog) fi AM_CONDITIONAL(MessageCatalog, test x$enable_message_catalog = xyes) AC_ARG_ENABLE(themes, [ --enable-themes Enable themes (default=no)]) if test "$enable_themes" = "yes" then if test -f $srcdir/lib/Xm/Theme.h then AC_DEFINE(USE_XMTHEMES, 1, "Use XmThemes") XMTHEME_DIST = "Theme.h ThemeP.h DynLibP.h Theme.c DynLib.c" else AC_MSG_WARN([--enable-themes specified, but I don't have the code. Disabled]) enable_themes="no" fi fi AC_SUBST(XMTHEME_DIST) AM_CONDITIONAL(OM_XMTHEMES, test "$enable_themes" = "yes") AC_ARG_ENABLE(debug-themes, [ --enable-debug-themes Enable themes debugging (default=no)]) if test "$enable_themes" = "yes" then if test "$enable_debug_themes" = "yes" then AC_DEFINE(DEBUGTHEMES, 1, "Debug Themes") fi fi if test x$GCC = xyes then CFLAGS="$CFLAGS -Wall -g -fno-strict-aliasing -Wno-unused -Wno-comment" if test ` $CC -dumpversion | sed -e 's/\(^.\).*/\1/'` = "4" ; then CFLAGS="$CFLAGS -fno-tree-ter" fi fi AC_DEFINE(NO_OL_COMPAT, 1, "No OL Compatability") CDE_INSTALLATION_TOP="\${prefix}/dt" AC_SUBST(CDE_INSTALLATION_TOP) CDE_CONFIGURATION_TOP="\${prefix}/etc/dt" AC_SUBST(CDE_CONFIGURATION_TOP) LIBDIR="${libdir}/X11" AC_SUBST(LIBDIR) MWMRCDIR="${libdir}/X11" AC_SUBST(MWMRCDIR) INCDIR="${includedir}/X11" AC_SUBST(INCDIR) XMBINDDIR_FALLBACK="${libdir}/X11/bindings" AC_SUBST(XMBINDDIR_FALLBACK) RM="rm -f" AC_SUBST(RM) AC_ARG_ENABLE(motif22-compatibility, [ --disable-motif22-compatibility Disable binary compatibility with OpenMotif 2.2]) AC_ARG_ENABLE(utf8, [ --disable-utf8 Disable UTF-8 support]) case "$host_os" in freebsd*) CFLAGS="$CFLAGS -DCSRG_BASED -DXNO_MTSAFE_API -DXNO_MTSAFE_PWDAPI"; LDFLAGS="$LDFLAGS -L/usr/local/lib";; cygwin*) CFLAGS="$CFLAGS -DXNO_MTSAFE_DIRENTDAPI";; solaris* | sunos*) X_LIBS="$X_LIBS -L/usr/X/lib" && if test x$enable_motif22_compatibility = x then enable_motif22_compatibility="no" fi; if test x$enable_utf8 = x then enable_utf8="no" fi; if test x$enable_xft = x then enable_xft="no" fi;; esac if test x$enable_motif22_compatibility = x then enable_motif22_compatibility="yes" fi if test "$enable_motif22_compatibility" = "yes" then AC_DEFINE([OM22_COMPATIBILITY], [1], [Compatibility with OpenMotif 2.2]) OM22_COMPATIBILITY_FALSE=! OM22_COMPATIBILITY_TRUE= else OM22_COMPATIBILITY_FALSE= OM22_COMPATIBILITY_TRUE=! fi AC_SUBST(OM22_COMPATIBILITY_FALSE) AC_SUBST(OM22_COMPATIBILITY_TRUE) if test x$enable_utf8 = x then enable_utf8="yes" fi if test "$enable_utf8" = "yes" then AC_DEFINE([UTF8_SUPPORTED], [1], [UTF8 is supported]) AC_SEARCH_LIBS([iconv_open], [iconv], , AC_SEARCH_LIBS([libiconv_open], [iconv])) fi AC_ARG_ENABLE(printing, [ --disable-printing Disable printing support]) if test x$enable_printing = x then enable_printing="yes" fi if test "$enable_printing" = "yes" then AC_MSG_CHECKING([for libXp]) AC_CHECK_HEADERS(X11/extensions/Print.h, AC_CHECK_LIB(Xp, XpCreateContext, ,enable_printing="no"), enable_printing="no") fi if test "$enable_printing" = "yes" then LIB_XP=-lXp AC_DEFINE([PRINTING_SUPPORTED], [1], [Printing is supported]) PRINTING_SUPPORTED_FALSE=! PRINTING_SUPPORTED_TRUE= else LIB_XP= PRINTING_SUPPORTED_FALSE= PRINTING_SUPPORTED_TRUE=! fi AC_SUBST(PRINTING_SUPPORTED_FALSE) AC_SUBST(PRINTING_SUPPORTED_TRUE) AM_CONDITIONAL(PRINTING, test "$enable_printing" = "yes") AC_SUBST(LIB_XP) AC_FIND_XFT AC_IMAGE_SUPPORT # AM_CONDITIONAL(Motif22Compatibility, test x$enable_motif22_compatibility = xyes) AC_CONFIG_FILES([Makefile \ bindings/Makefile \ bitmaps/Makefile \ clients/Makefile \ clients/mwm/Makefile \ clients/mwm/WmWsmLib/Makefile \ clients/uil/Makefile \ clients/xmbind/Makefile \ config/Makefile \ config/util/Makefile \ include/Makefile \ include/Dt/Makefile \ lib/Makefile \ lib/Xm/Makefile \ lib/Mrm/Makefile \ localized/Makefile \ localized/util/Makefile \ doc/Makefile \ doc/man/Makefile \ doc/man/man1/Makefile \ doc/man/man3/Makefile \ doc/man/man4/Makefile \ doc/man/man5/Makefile \ tools/Makefile \ tools/wml/Makefile \ demos/Makefile \ demos/lib/Makefile \ demos/lib/Xmd/Makefile \ demos/lib/Wsm/Makefile \ demos/lib/Exm/Makefile \ demos/lib/Exm/wml/Makefile \ demos/programs/Makefile \ demos/programs/Exm/Makefile \ demos/programs/Exm/app_in_c/Makefile \ demos/programs/Exm/app_in_uil/Makefile \ demos/programs/Exm/simple_app/Makefile \ demos/programs/airport/Makefile \ demos/programs/animate/Makefile \ demos/programs/drag_and_drop/Makefile \ demos/programs/draw/Makefile \ demos/programs/earth/Makefile \ demos/programs/filemanager/Makefile \ demos/programs/fileview/Makefile \ demos/programs/getsubres/Makefile \ demos/programs/hellomotif/Makefile \ demos/programs/hellomotifi18n/Makefile \ demos/programs/hellomotifi18n/C/Makefile \ demos/programs/hellomotifi18n/C/uid/Makefile \ demos/programs/hellomotifi18n/english/Makefile \ demos/programs/hellomotifi18n/english/uid/Makefile \ demos/programs/hellomotifi18n/french/Makefile \ demos/programs/hellomotifi18n/french/uid/Makefile \ demos/programs/hellomotifi18n/hebrew/Makefile \ demos/programs/hellomotifi18n/hebrew/uid/Makefile \ demos/programs/hellomotifi18n/japan/Makefile \ demos/programs/hellomotifi18n/japan/uid/Makefile \ demos/programs/hellomotifi18n/japanese/Makefile \ demos/programs/hellomotifi18n/japanese/uid/Makefile \ demos/programs/hellomotifi18n/swedish/Makefile \ demos/programs/hellomotifi18n/swedish/uid/Makefile \ demos/programs/i18ninput/Makefile \ demos/programs/panner/Makefile \ demos/programs/periodic/Makefile \ demos/programs/piano/Makefile \ demos/programs/popups/Makefile \ demos/programs/sampler2_0/Makefile \ demos/programs/setdate/Makefile \ demos/programs/todo/Makefile \ demos/programs/workspace/Makefile \ demos/programs/tooltips/Makefile \ demos/programs/FontSel/Makefile \ demos/programs/ButtonBox/Makefile \ demos/programs/ColorSel/Makefile \ demos/programs/Column/Makefile \ demos/programs/Combo2/Makefile \ demos/programs/Ext18List/Makefile \ demos/programs/Ext18List/pixmaps/Makefile \ demos/programs/IconB/Makefile \ demos/programs/Outline/Makefile \ demos/programs/Paned/Makefile \ demos/programs/TabStack/Makefile \ demos/programs/Tree/Makefile \ demos/programs/pixmaps/Makefile \ demos/unsupported/Makefile \ demos/unsupported/Exm/Makefile \ demos/unsupported/aicon/Makefile \ demos/unsupported/dainput/Makefile \ demos/unsupported/dogs/Makefile \ demos/unsupported/hellomotif/Makefile \ demos/unsupported/motifshell/Makefile \ demos/unsupported/uilsymdump/Makefile \ demos/unsupported/xmapdef/Makefile \ demos/unsupported/xmfonts/Makefile \ demos/unsupported/xmforc/Makefile \ demos/unsupported/xmform/Makefile \ demos/doc/Makefile \ demos/doc/programGuide/Makefile \ demos/doc/programGuide/ch05/Makefile \ demos/doc/programGuide/ch05/Scale/Makefile \ demos/doc/programGuide/ch06/Makefile \ demos/doc/programGuide/ch06/spin_box/Makefile \ demos/doc/programGuide/ch06/combo_box/Makefile \ demos/doc/programGuide/ch08/Makefile \ demos/doc/programGuide/ch08/Notebook/Makefile \ demos/doc/programGuide/ch08/Container/Makefile \ demos/doc/programGuide/ch16/Makefile \ demos/doc/programGuide/ch17/Makefile \ demos/doc/programGuide/ch17/simple_drop/Makefile \ demos/doc/programGuide/ch17/simple_drag/Makefile \ lib/Xm/xmstring.list \ ]) AC_OUTPUT motif-2.3.8/config.guess0000755000175000017500000012367213011021645012107 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-11-04' # 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . 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 1992-2014 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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # 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 tuples: *-*-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 -q __ELF__ 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 ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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 -q __LP64__ 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:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) 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 ;; 8664:Windows_NT:*) echo x86_64-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-${LIBC}`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/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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 -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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.[02]*:*) 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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) 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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku 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 eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} 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 ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac 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: motif-2.3.8/INSTALL.configure0000644000175000017500000002016212672140200012567 00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you don't see `configure' shell script in the package directory run `autogen.sh'. It will run in turn libtoolize, aclocal, autoconf, autoheader and automake commands that will produce `configure' shell script. If you don't see `configure' shell script that means one of the listed above commands failed and you need to update/install autotools package on your system. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./autogen.sh' to create configure shell script according to your environment and to run automatically 'configure' of the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./autogen.sh' instead to prevent `csh' from trying to execute `autogen.sh' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. motif-2.3.8/RELEASE0000644000175000017500000000005113211512121010547 00000000000000Motif 2.3.8 Tue Dec 5 14:42:42 EET 2017 motif-2.3.8/Makefile.in0000644000175000017500000006444413211512765011647 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in COPYING ChangeLog README TODO \ compile config.guess config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/doc datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #data_DATA = BUGREPORT COPYRIGHT.MOTIF COPYING \ # README RELEASE RELNOTES EXTRA_DIST = BUGREPORT \ COPYING \ README RELEASE RELNOTES \ INSTALL.configure Makefile.imake-pure MAINTAINERCLEANFILES = Makefile.in \ configure libtool \ config.guess \ config.sub \ config.log \ ltconfig ltmain.sh \ aclocal.m4 \ config.h.in \ install-sh \ missing mkinstalldirs \ compile SUBDIRS = bindings bitmaps \ config \ localized \ lib \ include \ tools \ clients \ doc \ demos AUTOMAKE_OPTIONS = 1.4 ACLOCAL_AMFLAGS = -I . all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/COPYING0000644000175000017500000006364212672140200010623 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 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. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; 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. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! motif-2.3.8/lib/0000755000175000017500000000000013211513005010400 500000000000000motif-2.3.8/lib/Makefile.in0000644000175000017500000004643513211512767012417 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = MAINTAINERRCLEANFILES = Makefile.in SUBDIRS = Xm Mrm all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/lib/Xm/0000755000175000017500000000000013211513005010764 500000000000000motif-2.3.8/lib/Xm/ComboBox.c0000644000175000017500000030214613145162623012602 00000000000000/* $TOG: ComboBox.c /main/16 1999/07/28 10:59:19 vipin $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* ComboBox.c */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* for bzero et al */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "GeoUtilsI.h" #include "MenuShellI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "XmI.h" #include "XmStringI.h" #define FIX_1250 #define FIX_1473 #define NOKIDS _XmMMsgComboBox_0000 #define TYPEWARNING _XmMMsgComboBox_0001 #define MISSINGKID _XmMMsgComboBox_0004 #define UNMANAGEDKID _XmMMsgComboBox_0005 #define MBWARNING _XmMMsgComboBox_0006 #define WRONGPARAMS _XmMMsgComboBox_0007 #define WRONGWIDGET _XmMMsgComboBox_0008 #define SELECTBADITEM _XmMMsgComboBox_0009 #define SETBADITEM _XmMMsgComboBox_0010 #define DELETEBADPOS _XmMMsgComboBox_0011 #define NOTACOMBOBOX _XmMMsgComboBox_0012 #define NOSETKIDS _XmMMsgComboBox_0013 #define MODEWARNING _XmMMsgComboBox_0014 #define default_translations _XmComboBox_defaultTranslations #define LIST_CHILD_NAME "List" #define TEXT_CHILD_NAME "Text" #define SHELL_CHILD_NAME "GrabShell" /* From GrabShell.c */ #define Events (EnterWindowMask | LeaveWindowMask | ButtonPressMask | \ ButtonReleaseMask) /* CB_ShellState() values. */ enum { POPPED_DOWN, POPPING_UP, POPPED_UP, POPPING_DOWN }; /******** Static Function Declarations ********/ /** Widget Class Methods **/ static void Initialize (Widget, Widget, ArgList, Cardinal *); static void ClassInitialize (void); static void ClassPartInitialize (WidgetClass wc); static Boolean SetValues (Widget, Widget, Widget, ArgList, Cardinal *); static XtGeometryResult GeometryManager (Widget, XtWidgetGeometry *, XtWidgetGeometry *); static void InsertChild (Widget child); static void Resize (Widget widget); static void Redisplay (Widget widget, XEvent *event, Region region); static XtGeometryResult QueryGeometry (Widget, XtWidgetGeometry *, XtWidgetGeometry *); static void ChangeManaged (Widget widget); static void Destroy (Widget widget); static void ConstraintDestroy (Widget widget); static Boolean ComboBoxParentProcess (Widget wid, XmParentProcessData event); /** Event Handlers **/ static void PopupEH (Widget, XtPointer, XEvent *, Boolean *); static void SBBtnDownEH (Widget, XtPointer, XEvent *, Boolean *); static void SBBtnUpEH (Widget, XtPointer, XEvent *, Boolean *); /** Callbacks **/ static void TextChangedCB (Widget, XtPointer, XtPointer); static void ListSelectionCB (Widget, XtPointer, XtPointer); static void ShellPopupCB (Widget, XtPointer, XtPointer); static void ShellPopdownCB (Widget, XtPointer, XtPointer); static void FocusMovedCB (Widget, XtPointer, XtPointer); /** Action Routines **/ static void CBArmAndDropDownList (Widget, XEvent *, String *, Cardinal *); static void CBDisarm (Widget, XEvent *, String *, Cardinal *); static void CBDropDownList (Widget, XEvent *, String *, Cardinal *); static void CBFocusIn (Widget, XEvent *, String *, Cardinal *); static void CBFocusOut (Widget, XEvent *, String *, Cardinal *); static void CBCancel (Widget, XEvent *, String *, Cardinal *); static void CBActivate (Widget, XEvent *, String *, Cardinal *); static void CBListAction (Widget, XEvent *, String *, Cardinal *); static void CBTextFocusOut (Widget, XEvent *, String *, Cardinal *); /** Default resource value call procs. **/ static void CheckSetRenderTable (Widget, int, XrmValue *); /** Synthetic Resource access methods **/ static XmImportOperator CBSetSelectedItem (Widget, int, XtArgVal *); static XmImportOperator CBSetSelectedPos (Widget, int, XtArgVal *); static void CBGetSelectedItem (Widget, int, XtArgVal *); static void CBGetSelectedPos (Widget, int, XtArgVal *); static void CBGetColumns (Widget, int, XtArgVal *); static void CBGetItems (Widget, int, XtArgVal *); static void CBGetItemCount (Widget, int, XtArgVal *); static void CBGetVisibleItemCount (Widget, int, XtArgVal *); /** Additional Functions **/ static Boolean PopdownList (Widget cb, XEvent *event); static void CreateChildren (Widget, ArgList, Cardinal *); static Widget CreateEditBox (Widget, String, Widget, ArgList, Cardinal *); static Widget CreateScrolledList (Widget, String, Widget, ArgList, Cardinal *); static Widget CreatePulldown (Widget, String, Widget, ArgList, Cardinal *); static void ComputeSize (Widget, Dimension, Dimension, Dimension*, Dimension*); static void DoLayout (Widget); static void GetThickness (Widget, Dimension *, Dimension *); static void GetArrowGC (Widget); static void DrawArrow (Widget, Boolean); static void DrawShadows (Widget); static Boolean Hit (XButtonEvent*, XRectangle); static void HighlightBorder (Widget w); static void UnhighlightBorder (Widget w); static XmComboBoxWidget FindComboBox (Widget w); static void CallSelectionCallbacks (Widget w, XEvent *event); static void SetHitArea (Widget w); static Boolean ReduceResources (Widget widget, Dimension *width, Dimension *height, Mask flags); static int Reduce (Dimension *size, int max_change, int min_size); static void GetIdealTextSize (Widget cb, int *width, int *height); static Dimension GetDefaultArrowSize (Widget cb); static XmString GetEditBoxValue (Widget cb); static void SetEditBoxValue (Widget cb, XmString value); /******** End Static Function Declarations ********/ #define POPUP_EVENT_MASK \ (EnterWindowMask | ButtonPressMask | ButtonReleaseMask) #define MINIMUM_SHADOWTHICKNESS 1 #define MINIMUM_HIGHLIGHTTHICKNESS 2 #define MINIMUM_ARROWSPACE 1 #define MINTXT 1 #define MINLIST 1 #define DEFAULT_MARGINWIDTH 2 #define DEFAULT_MARGINHEIGHT 2 #define HIGHLIGHT_THICKNESS ((Mask) (1<<0)) #define SHADOW_THICKNESS ((Mask) (1<<1)) #define ARROW_SPACING ((Mask) (1<<2)) #define MARGIN_WIDTH ((Mask) (1<<3)) #define MARGIN_HEIGHT ((Mask) (1<<4)) #define ARROW_SIZE ((Mask) (1<<5)) #define DEFAULT_ARROW_SCALING 0.75 #define SQRT3_OVER_2 0.8660254037844 #define XmUNSPECIFIED_COLUMNS ((short) XmUNSPECIFIED_COUNT) #define XmUNSPECIFIED_ITEMS ((XmStringTable) XmUNSPECIFIED) /* * These instance fields have special non-obvious meanings, and are * used for passing synthetic resource values to and from children. * The value of these fields is NOT maintained -- always query the * child for the current value. */ #define CBS_Columns(w) (((XmComboBoxWidget)(w))->combo_box.columns) #define CBS_ItemCount(w) (((XmComboBoxWidget)(w))->combo_box.item_count) #define CBS_Items(w) (((XmComboBoxWidget)(w))->combo_box.items) #define CBS_SelectedItem(w) (((XmComboBoxWidget)(w))->combo_box.selected_item) #define CBS_SelectedPosition(w) \ (((XmComboBoxWidget)(w))->combo_box.selected_position) #define CBS_VisibleItemCount(w) \ (((XmComboBoxWidget)(w))->combo_box.visible_item_count) #define Offset(field) XtOffsetOf(XmComboBoxRec, field) static XtResource resources[] = { { XmNarrowSize, XmCArrowSize, XmRHorizontalDimension, sizeof(Dimension), Offset(combo_box.arrow_size), XmRImmediate, (XtPointer)XmINVALID_DIMENSION }, { XmNarrowSpacing, XmCArrowSpacing, XmRHorizontalDimension, sizeof(Dimension), Offset(combo_box.arrow_spacing), XmRImmediate, (XtPointer)XmINVALID_DIMENSION }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof(Dimension), Offset(combo_box.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), Offset(combo_box.margin_height), XmRImmediate, (XtPointer)DEFAULT_MARGINHEIGHT }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), Offset(combo_box.margin_width), XmRImmediate, (XtPointer)DEFAULT_MARGINWIDTH }, { XmNmatchBehavior, XmCMatchBehavior, XmRMatchBehavior, sizeof(unsigned char), Offset(combo_box.match_behavior), XmRImmediate, (XtPointer)XmINVALID_MATCH_BEHAVIOR }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof(unsigned char), Offset(manager.navigation_type), XmRImmediate, (XtPointer)XmSTICKY_TAB_GROUP }, { XmNselectionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(combo_box.selection_callback), XmRCallback, NULL }, { XmNselectedItem, XmCSelectedItem, XmRXmString, sizeof(XmString), Offset(combo_box.selected_item), XmRImmediate, (XtPointer)NULL }, { XmNselectedPosition, XmCSelectedPosition, XmRInt, sizeof(int), Offset(combo_box.selected_position), XmRImmediate, (XtPointer)XmINVALID_POSITION }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), Offset(manager.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNcomboBoxType, XmCComboBoxType, XmRComboBoxType, sizeof(unsigned char), Offset(combo_box.type), XtRImmediate, (XtPointer)XmCOMBO_BOX }, /* Borrow the "text_changed" instance field .. ! */ { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), Offset(combo_box.text_changed), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmRenderTable), Offset(combo_box.render_table), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), Offset(combo_box.render_table), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNlist, XmCList, XmRWidget, sizeof(Widget), Offset(combo_box.list), XmRImmediate, (XtPointer)NULL }, { XmNtextField, XmCTextField, XmRWidget, sizeof(Widget), Offset(combo_box.edit_box), XmRImmediate, (XtPointer)NULL }, { XmNitems, XmCItems, XmRXmStringTable, sizeof(XmStringTable), Offset(combo_box.items), XmRImmediate, (XtPointer)XmUNSPECIFIED_ITEMS }, { XmNitemCount, XmCItemCount, XmRInt, sizeof(int), Offset(combo_box.item_count), XmRImmediate, (XtPointer)XmUNSPECIFIED_COUNT }, { XmNvisibleItemCount, XmCVisibleItemCount, XmRInt, sizeof(int), Offset(combo_box.visible_item_count), XmRImmediate, (XtPointer)10 }, { XmNcolumns, XmCColumns, XmRShort, sizeof(short), Offset(combo_box.columns), XmRImmediate, (XtPointer)XmUNSPECIFIED_COLUMNS }, { XmNpositionMode, XmCPositionMode, XmRPositionMode, sizeof(XtEnum), Offset(combo_box.position_mode), XmRImmediate, (XtPointer)XmZERO_BASED } }; /* * Resolution independent resources and resources needing special processing. */ static XmSyntheticResource syn_resources[] = { { XmNselectedItem, sizeof(XmString), Offset(combo_box.selected_item), CBGetSelectedItem, CBSetSelectedItem }, { XmNselectedPosition, sizeof(int), Offset(combo_box.selected_position), CBGetSelectedPos, CBSetSelectedPos }, { XmNmarginWidth, sizeof(Dimension), Offset(combo_box.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), Offset(combo_box.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNhighlightThickness, sizeof(Dimension), Offset(combo_box.highlight_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNshadowThickness, sizeof(Dimension), Offset(manager.shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNarrowSize, sizeof(Dimension), Offset(combo_box.arrow_size), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNarrowSpacing, sizeof(Dimension), Offset(combo_box.arrow_spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNcolumns, sizeof(short), Offset(combo_box.columns), CBGetColumns, NULL }, { XmNitems, sizeof(XmStringTable), Offset(combo_box.items), CBGetItems, NULL }, { XmNitemCount, sizeof(int), Offset(combo_box.item_count), CBGetItemCount, NULL }, { XmNvisibleItemCount, sizeof(int), Offset(combo_box.visible_item_count), CBGetVisibleItemCount, NULL } }; #undef Offset static XtAccelerators parsed_accelerators; static XtAccelerators parsed_list_accelerators; static XtTranslations parsed_list_translations; static XtTranslations parsed_text_focus_translations; static XtActionsRec actionsList[] = { { "CBArmAndDropDownList", CBArmAndDropDownList }, { "CBDisarm", CBDisarm }, { "CBDropDownList", CBDropDownList }, { "CBFocusIn", CBFocusIn }, { "CBFocusOut", CBFocusOut }, { "CBCancel", CBCancel }, { "CBActivate", CBActivate }, { "CBListAction", CBListAction }, { "CBTextFocusOut", CBTextFocusOut } }; /* Class Record Initialization */ externaldef(xmcomboboxclassrec) XmComboBoxClassRec xmComboBoxClassRec = { { /* core_class fields */ (WidgetClass) &xmManagerClassRec, /* superclass */ "XmComboBox", /* class_name */ sizeof(XmComboBoxRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ (XtResourceList)resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ XtExposeCompressMaximal | /* compress_exposure */ XtExposeNoRegion, FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ default_translations, /* tm_table */ QueryGeometry, /* Query Geometry proc */ NULL, /* disp accelerator */ NULL /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ InsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL /* extension */ }, { /* constraint_class fields */ NULL, /* constraint resource */ 0, /* number of constraints */ sizeof(XmManagerConstraintRec), /* size of constraint */ NULL, /* initialization */ ConstraintDestroy, /* destroy proc */ NULL, /* set_values proc */ NULL /* extension */ }, { /* manager_class fields */ XtInheritTranslations, /* translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ ComboBoxParentProcess, /* parent_process */ NULL /* extension */ }, { /* combo_box class fields */ NULL /* extension */ } }; externaldef(xmcomboboxwidgetclass) WidgetClass xmComboBoxWidgetClass = (WidgetClass) &xmComboBoxClassRec; /* ------------- WIDGET CLASS METHODS ---------- */ /* * Initialize() * Called by the Intrinsics when a new ComboBox is created. */ /*ARGSUSED*/ static void Initialize(Widget request, /* unused */ Widget new_w, ArgList args, Cardinal *num_args) { XmComboBoxWidget newcb = (XmComboBoxWidget)new_w; Widget ancestor; int i; #ifdef FIX_1473 Cardinal num_child_args; ArgList child_args; #endif /* Setup internal state. */ CB_ShellState(newcb) = POPPED_DOWN; newcb->combo_box.scrolling = FALSE; newcb->combo_box.vsb = NULL; newcb->combo_box.hsb = NULL; CB_TextChanged(newcb) = FALSE; /* Set defaults */ CB_Highlighted(newcb) = FALSE; CB_ArrowPressed(newcb) = FALSE; CB_ScrolledW(newcb) = CB_ListShell(newcb) = 0; newcb->combo_box.ideal_ebwidth = newcb->combo_box.ideal_ebheight = 0; CB_HitRect(newcb).width = 0; CB_HitRect(newcb).height = 0; CB_HitRect(newcb).x = 0; CB_HitRect(newcb).y = 0; newcb->combo_box.arrow_shadow_width = newcb->manager.shadow_thickness; if (newcb->core.accelerators == NULL) newcb->core.accelerators = parsed_accelerators; /* Validate XmNpositionMode. */ if (!XmRepTypeValidValue(XmRID_POSITION_MODE, CB_PositionMode(newcb), (Widget) newcb)) { CB_PositionMode(newcb) = XmZERO_BASED; } /* The list child cannot be set. */ if (CB_List(newcb)) { CB_List(newcb) = NULL; XmeWarning(new_w, NOSETKIDS); } /* The editbox child cannot be set. */ if (CB_EditBox(newcb)) { CB_EditBox(newcb) = NULL; XmeWarning(new_w, NOSETKIDS); } /* Get arrow GC. */ GetArrowGC((Widget) newcb); if (CB_ArrowSpacing(newcb) == XmINVALID_DIMENSION) { CB_ArrowSpacing(newcb) = CB_MarginWidth(newcb); /* ArrowSize set dynamically in DoLayout() */ } if (CB_MatchBehavior(newcb) == XmINVALID_MATCH_BEHAVIOR) { if (CB_Type(newcb) == XmDROP_DOWN_LIST) CB_MatchBehavior(newcb) = XmQUICK_NAVIGATE; else CB_MatchBehavior(newcb) = XmNONE; } else if ((CB_MatchBehavior(newcb) == XmQUICK_NAVIGATE) && (CB_Type(newcb) != XmDROP_DOWN_LIST)) { CB_MatchBehavior(newcb) = XmNONE; XmeWarning(new_w, MBWARNING); } /* Get a real render table. */ if (CB_RenderTable(newcb) == NULL) CB_RenderTable(newcb) = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); CB_RenderTable(newcb) = XmFontListCopy(CB_RenderTable(newcb)); #ifdef FIX_1473 /* Ignore XmNheight resource value for descedants */ num_child_args = 0; child_args = (ArgList) XtMalloc(sizeof(Arg) * *num_args); for (i = 0; i < *num_args; i++) if (strcmp(args[i].name, "height")) { child_args[num_child_args] = args[i]; num_child_args++; } /* Create the widgets that make up a ComboBox. */ CreateChildren(new_w, child_args, &num_child_args); XtFree((char *) child_args); #else /* Create the widgets that make up a ComboBox. */ CreateChildren(new_w, args, num_args); #endif /* Walk up hierarchy to find vendor shell. */ ancestor = XtParent(new_w); while (ancestor && !XmIsVendorShell(ancestor)) ancestor = XtParent(ancestor); /* Setup focus moved callback so ComboBox can draw highlighting rect. */ if (ancestor) XmeAddFocusChangeCallback(ancestor, FocusMovedCB, (XtPointer) new_w); /* Since we cannot add children to a ComboBox, we can consider it as a Primitive, and set its preferred width/height. */ if (XtWidth(new_w) == 0 || XtHeight(new_w) == 0) ComputeSize((Widget) new_w, 0, 0, &(XtWidth(new_w)), &(XtHeight(new_w))); /* Reset synthetic child resources so SetValues can detect all changes. */ CBS_Columns(newcb) = XmUNSPECIFIED_COLUMNS; CBS_ItemCount(newcb) = XmUNSPECIFIED_COUNT; CBS_Items(newcb) = XmUNSPECIFIED_ITEMS; CBS_VisibleItemCount(newcb) = XmUNSPECIFIED_COUNT; /* Reset fields whose value we ignore after creation. */ CBS_SelectedPosition(newcb) = XmINVALID_POSITION; CBS_SelectedItem(newcb) = NULL; } /* * ClassInitialize() * This routine is invoked only once. */ static void ClassInitialize(void) { /* Parse the default translation and accelerator tables */ parsed_accelerators = XtParseAcceleratorTable(_XmComboBox_defaultAccelerators); parsed_list_accelerators = XtParseAcceleratorTable(_XmComboBox_dropDownComboBoxAccelerators); parsed_list_translations = XtParseTranslationTable(_XmComboBox_dropDownListTranslations); parsed_text_focus_translations = XtParseTranslationTable(_XmComboBox_textFocusTranslations); } /* * ClassPartInitialize() * Set up the fast subclassing. Invoked for every (sub)class of * ComboBox. */ static void ClassPartInitialize(WidgetClass wc) { _XmFastSubclassInit (wc, XmCOMBO_BOX_BIT); } /* * InsertChild() * Called by the intrinsics when a new child is added to a ComboBox. * Generate an error message if an application tries to insert widgets * into the ComboBox. */ static void InsertChild(Widget child) { XmComboBoxWidget cb = (XmComboBoxWidget) XtParent(child); XtWidgetProc insert_child; /* * If the ComboBox has already created its children, the application * is trying to add another child, which is an error. */ if (cb->composite.num_children > 2) XmeWarning((Widget)cb, NOKIDS); else { /* Call manager InsertChild to update child info. */ _XmProcessLock(); insert_child = ((XmManagerWidgetClass) xmManagerWidgetClass) ->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(child); } } /* * SetValues() * Called by Intrinsics when XtSetValues is called on the ComboBox. */ /*ARGSUSED*/ static Boolean SetValues(Widget current, Widget request, /* unused */ Widget new_w, ArgList user_args, /* unused */ Cardinal *num_args) /* unused */ { XmComboBoxWidget curcb = (XmComboBoxWidget)current; XmComboBoxWidget newcb = (XmComboBoxWidget)new_w; Boolean resize = FALSE; Boolean dolayout = FALSE; Boolean redisplay = FALSE; Cardinal nlist = 0; Arg list_args[10]; Cardinal nshell = 0; Arg shell_args[10]; Cardinal neditbox = 0; Arg editbox_args[10]; XmFontList old_render_table = NULL; /* The position_mode cannot be changed after creation. */ if (CB_PositionMode(curcb) != CB_PositionMode(newcb)) { CB_PositionMode(newcb) = CB_PositionMode(curcb); XmeWarning(current, MODEWARNING); } /* The ComboBox type cannot change after creation. */ if (CB_Type(curcb) != CB_Type(newcb)) { CB_Type(newcb) = CB_Type(curcb); XmeWarning(current, TYPEWARNING); } /* The list child cannot be set. */ if (CB_List(curcb) != CB_List(newcb)) { CB_List(newcb) = CB_List(curcb); XmeWarning(current, NOSETKIDS); } /* The editbox child cannot be set. */ if (CB_EditBox(curcb) != CB_EditBox(newcb)) { CB_EditBox(newcb) = CB_EditBox(curcb); XmeWarning(current, NOSETKIDS); } /* Validate XmNmatchBehavior and propagate it to the list. */ if (CB_MatchBehavior(curcb) != CB_MatchBehavior(newcb)) { if (CB_Type(curcb) != XmDROP_DOWN_LIST && CB_MatchBehavior(newcb) == XmQUICK_NAVIGATE) { CB_MatchBehavior(newcb) = CB_MatchBehavior(curcb); XmeWarning(current, MBWARNING); } else if (CB_Type(curcb) == XmDROP_DOWN_LIST) { XtSetArg(list_args[nlist], XmNmatchBehavior, CB_MatchBehavior(newcb)), nlist++; } } /* Propagate XmNcolumns to the edit box. */ if (CBS_Columns(newcb) != XmUNSPECIFIED_COLUMNS) { XtSetArg(editbox_args[neditbox], XmNcolumns, CBS_Columns(newcb)), neditbox++; CBS_Columns(newcb) = XmUNSPECIFIED_COLUMNS; resize = dolayout = redisplay = TRUE; } /* Propagate XmNitems to the list. */ if (CBS_Items(newcb) != XmUNSPECIFIED_ITEMS) { XtSetArg(list_args[nlist], XmNitems, CBS_Items(newcb)), nlist++; CBS_Items(newcb) = XmUNSPECIFIED_ITEMS; } /* Propagate XmNitemCount to the list. */ if (CBS_ItemCount(newcb) != XmUNSPECIFIED_COUNT) { XtSetArg(list_args[nlist], XmNitemCount, CBS_ItemCount(newcb)), nlist++; CBS_ItemCount(newcb) = XmUNSPECIFIED_COUNT; } /* Propagate XmNvisibleItemCount to the list. */ if (CBS_VisibleItemCount(newcb) != XmUNSPECIFIED_COUNT) { XtSetArg(list_args[nlist], XmNvisibleItemCount, CBS_VisibleItemCount(newcb)), nlist++; CBS_VisibleItemCount(newcb) = XmUNSPECIFIED_COUNT; #ifndef FIX_1250 resize = dolayout = redisplay = TRUE; #endif } /* Propagate our XmNborderWidth to the popup list shell. */ if (XtBorderWidth(curcb) != XtBorderWidth(newcb)) { if (CB_Type(curcb) != XmCOMBO_BOX) { XtSetArg(shell_args[nshell], XmNborderWidth, XtBorderWidth(newcb)), nshell++; redisplay = TRUE; } } /* Propagate XmNrenderTable to all children. */ if (CB_RenderTable(curcb) != CB_RenderTable(newcb)) { if (CB_RenderTable(newcb) == NULL) CB_RenderTable(newcb) = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); CB_RenderTable(newcb) = XmFontListCopy(CB_RenderTable(newcb)); XtSetArg(editbox_args[neditbox], XmNrenderTable, CB_RenderTable(newcb)), neditbox++; XtSetArg(list_args[nlist], XmNrenderTable, CB_RenderTable(newcb)), nlist++; /* Free the old render table after we update the children. */ old_render_table = CB_RenderTable(curcb); } /* Process resources that affect layout. */ if ((CB_HighlightThickness(curcb) != CB_HighlightThickness(newcb)) || (CB_MarginWidth(curcb) != CB_MarginWidth(newcb)) || (CB_MarginHeight(curcb) != CB_MarginHeight(newcb)) || (CB_RenderTable(curcb) != CB_RenderTable(newcb))) { resize = dolayout = redisplay = TRUE; } if (MGR_ShadowThickness(curcb) != MGR_ShadowThickness(newcb)) { resize = dolayout = redisplay = TRUE; if (CB_Type(newcb) != XmDROP_DOWN_LIST) { XtSetArg(editbox_args[neditbox], XmNshadowThickness, MGR_ShadowThickness(newcb)), neditbox++; } if (CB_Type(curcb) != XmCOMBO_BOX) { XtSetArg(shell_args[nshell], XmNshadowThickness, MGR_ShadowThickness(newcb)), nshell++; } } if ((CB_ArrowSpacing(curcb) != CB_ArrowSpacing(newcb)) || (CB_ArrowSize(curcb) != CB_ArrowSize(newcb))) { if (CB_Type(curcb) != XmCOMBO_BOX) { resize = dolayout = redisplay = TRUE; } } /* Propagate shadow GC changes to the popup list shell. */ if ((curcb->manager.top_shadow_color != newcb->manager.top_shadow_color) || (curcb->manager.top_shadow_pixmap != newcb->manager.top_shadow_pixmap) || (curcb->manager.bottom_shadow_color != newcb->manager.bottom_shadow_color) || (curcb->manager.bottom_shadow_pixmap != newcb->manager.bottom_shadow_pixmap)) { if (CB_Type(curcb) != XmCOMBO_BOX) { XtSetArg(shell_args[nshell], XmNtopShadowColor, newcb->manager.top_shadow_color), nshell++; XtSetArg(shell_args[nshell], XmNbottomShadowColor, newcb->manager.bottom_shadow_color), nshell++; XtSetArg(shell_args[nshell], XmNtopShadowPixmap, newcb->manager.top_shadow_pixmap), nshell++; XtSetArg(shell_args[nshell], XmNbottomShadowPixmap, newcb->manager.bottom_shadow_pixmap), nshell++; } } if (XtBackground(curcb) != XtBackground(newcb)) { if (CB_Type(newcb) != XmCOMBO_BOX) { XtReleaseGC((Widget) newcb, newcb->combo_box.arrow_GC); GetArrowGC((Widget) newcb); /* Core won't request redisplay if a background pixmap is used. */ redisplay = TRUE; } } if (XtIsSensitive((Widget)curcb) != XtIsSensitive((Widget)newcb)) { redisplay = TRUE; } /* Push all the accrued updates onto the children. */ assert(nshell <= XtNumber(shell_args)); if (nshell && CB_ListShell(newcb)) XtSetValues(CB_ListShell(newcb), shell_args, nshell); assert(nlist <= XtNumber(list_args)); if (nlist && CB_List(newcb)) XtSetValues(CB_List(newcb), list_args, nlist); assert(neditbox <= XtNumber(editbox_args)); if (neditbox && CB_EditBox(newcb)) XtSetValues(CB_EditBox(newcb), editbox_args, neditbox); if (old_render_table) XmFontListFree(old_render_table); /* Recompute our ideal size. */ if ( resize) { if (XtIsRealized((Widget)newcb)) XtWidth(newcb) = XtHeight(newcb) = 0; ComputeSize((Widget)newcb, 0, 0, &(XtWidth(newcb)), &(XtHeight(newcb))); } /* * Recompute our layout, if realized. * We could check and not resize and add a SetValuesAlmost (like the * one in Label) that would call Resize if the parent denies the request. */ if (XtIsRealized((Widget)new_w) && dolayout) DoLayout(new_w); return redisplay; } /* ReduceResources() * Called from ChangeManaged when some resources need to be * diminished in order to satisfy a resource request. */ /*ARGSUSED*/ static Boolean ReduceResources(Widget widget, Dimension *width, Dimension *height, Mask flags) { XmComboBoxWidget newcb = (XmComboBoxWidget)widget; int delta; /* Space is stolen from resources in this order: * MarginHeight, MarginWidth, ArrowSpacing, * ShadowThickness, HighlightThickness */ /* Reduce width. Try resources in order. */ if (*width) { if (!(flags & MARGIN_WIDTH)) *width -= Reduce(&CB_MarginWidth(newcb), *width, 0); } if (*width) { if (!(flags & ARROW_SPACING)) { assert(CB_Type(newcb) != XmCOMBO_BOX); *width -= Reduce(&CB_ArrowSpacing(newcb), *width, MINIMUM_ARROWSPACE); } } if (*width) { if (!(flags & SHADOW_THICKNESS)) { delta = Reduce(&MGR_ShadowThickness(newcb), *width, MINIMUM_SHADOWTHICKNESS); *width -= delta; /* This affects height too. */ if (*height) Reduce(height, delta, 0); /* Keep the shell's shadowThickness in sync. */ if (CB_Type(newcb) != XmCOMBO_BOX) { Arg args[1]; Cardinal n = 0; XtSetArg(args[n], XmNshadowThickness, MGR_ShadowThickness(newcb)), n++; assert(n <= XtNumber(args)); XtSetValues(CB_ListShell(newcb), args, n); } } } if (*width) { if (!(flags & HIGHLIGHT_THICKNESS)) { delta = Reduce(&CB_HighlightThickness(newcb), *width, MINIMUM_HIGHLIGHTTHICKNESS); *width -= delta; /* This affects height too. */ if (*height) Reduce(height, delta, 0); } } /* Reduce height. Try resouces in order. */ if (*height) { if (!(flags & MARGIN_HEIGHT)) *height -= Reduce(&CB_MarginHeight(newcb), *height, 0); } if (*height) { if (!(flags & SHADOW_THICKNESS)) *height -= Reduce(&MGR_ShadowThickness(newcb), *height, MINIMUM_SHADOWTHICKNESS); } if (*height) { if (!(flags & HIGHLIGHT_THICKNESS)) *height -= Reduce(&CB_HighlightThickness(newcb), *height, MINIMUM_HIGHLIGHTTHICKNESS); } return (!*width && !*height); } /* * Reduce() * A helper for ReduceResources, this routine will decrement a * single resource. */ static int Reduce(Dimension *size, int max_change, int min_size) { int change = 0; if (*size > min_size) { change = MIN(*size - min_size, max_change); *size -= change; } return change; } /* * Resize() * Sizes and places the children of the ComboBox depending on its * type: XmCOMBO_BOX, XmDROP_DOWN_COMBO_BOX, or XmDROP_DOWN_LIST. * The instrinsics call Expose() immediately after calling this method. */ static void Resize(Widget widget) { /* CR 6911: Need to erase old margins, arrow spacing, and arrow areas. */ /* CR 7255: Erase old margins too. */ if (XtIsRealized(widget)) XClearWindow (XtDisplay(widget), XtWindow(widget)); DoLayout(widget); } static void CheckMinimalSize( Widget widget, Dimension * pwidth, Dimension * pheight) { XmComboBoxWidget cb = (XmComboBoxWidget) widget; Dimension min_height, min_width; min_height = min_width = 2 * (MINIMUM_SHADOWTHICKNESS + MINIMUM_HIGHLIGHTTHICKNESS) + MINTXT; if (CB_Type(cb) != XmCOMBO_BOX) { if (CB_ArrowSize(cb) == XmINVALID_DIMENSION) CB_ArrowSize(cb) = GetDefaultArrowSize((Widget)cb); min_width += MINIMUM_ARROWSPACE + (int)CB_ArrowSize(cb); } else min_height += MINLIST; *pwidth = MAX(min_width, *pwidth); *pheight = MAX(min_height, *pheight); } /* * ChangeManaged() * Called whenever there is a change in the managed set. */ static void ChangeManaged(Widget widget) { XmComboBoxWidget cb = (XmComboBoxWidget) widget; XtWidgetGeometry desired; Dimension thickW, thickH, width, height; Dimension widthXcess = 0, heightXcess = 0; desired.request_mode = 0; if (!XtIsRealized((Widget)cb)) { /* Only attempt to change non-specified sizes. */ desired.width = XtWidth(cb); /* might be 0 */ desired.height = XtHeight(cb); /* might be 0 */ } else { desired.width = 0; desired.height = 0; } /* Compute our desired size. * If user has set width or height, use it * else use preferred sized of children */ if (desired.width == 0 || desired.height == 0) ComputeSize((Widget)cb, 0, 0, &desired.width, &desired.height); else CheckMinimalSize((Widget)cb, &desired.width, &desired.height); /* Make request to parent*/ desired.request_mode = (CWWidth | CWHeight); _XmMakeGeometryRequest((Widget) cb, &desired); /* Determine if not enough space due to resources requested */ GetThickness((Widget) cb, &thickW, &thickH); width = 2*thickW + MINTXT; height = 2*thickH + MINTXT; if (CB_Type(cb) != XmCOMBO_BOX) width += CB_ArrowSize(cb) + CB_ArrowSpacing(cb); else height += MINLIST; if (width > XtWidth(cb)) widthXcess = width - XtWidth(cb); if (height > XtHeight(cb)) heightXcess = height - XtHeight(cb); if (widthXcess || heightXcess) { /* take it off the resources * this will reduce each to their minimum value if needed */ if (widthXcess || heightXcess) ReduceResources((Widget)cb, &widthXcess, &heightXcess, 0); } /* Layout the widget */ DoLayout(widget); } /* * GeometryManager() * Handle geometry change requests from our children. */ static XtGeometryResult GeometryManager(Widget mychild, XtWidgetGeometry *request, XtWidgetGeometry *reply) { XmComboBoxWidget cb = (XmComboBoxWidget) XtParent(mychild); XtWidgetGeometry my_request; int width, height ; /* make them int so that we deal with negative */ XtGeometryResult res ; Dimension almost_list_width = 0 ; /* * Reject anything requests a change of position. We don't even * consider "almosting" what goes with it, i.e. a size request. */ if (request->request_mode & (CWX | CWY)) return XtGeometryNo ; my_request.request_mode = 0; width = XtWidth(cb) ; height = XtHeight(cb) ; /* * Try to honor a child's request to change size by passing the * decision to our parent. For now we don't compromise or check * the other child's preferred size, only our own minimal size. */ if (request->request_mode & XtCWQueryOnly) my_request.request_mode |= XtCWQueryOnly; if (request->request_mode & CWWidth) { my_request.request_mode |= CWWidth; width += (int)request->width - (int)XtWidth(mychild); if (mychild == CB_EditBox(cb)) cb->combo_box.ideal_ebwidth = request->width; else { /* * Compromise rather than letting the list shrink smaller * than the Text's preferred width. */ Dimension thickW, thickH; GetThickness((Widget)cb, &thickW, &thickH); if (!cb->combo_box.ideal_ebwidth) GetIdealTextSize((Widget)cb, &cb->combo_box.ideal_ebwidth, NULL); if (width < cb->combo_box.ideal_ebwidth + 2 * (thickW + XtBorderWidth(CB_EditBox(cb)))) { width = cb->combo_box.ideal_ebwidth + 2 * (thickW + XtBorderWidth(CB_EditBox(cb))) ; almost_list_width = cb->combo_box.ideal_ebwidth ; my_request.request_mode |= XtCWQueryOnly; } } } if (request->request_mode & CWHeight) { my_request.request_mode |= CWHeight; height += (int)request->height - (int)XtHeight(mychild); if (mychild == CB_EditBox(cb)) cb->combo_box.ideal_ebheight = request->height; } if (request->request_mode & CWBorderWidth) { my_request.request_mode |= (CWWidth | CWHeight); width += 2*((int)request->border_width - (int)XtBorderWidth(mychild)); height += 2*((int)request->border_width - (int)XtBorderWidth(mychild)); } if (width > 0) my_request.width = (Dimension) width ; if (height > 0) my_request.height = (Dimension) height ; CheckMinimalSize((Widget)cb, &my_request.width, &my_request.height); res = XtMakeGeometryRequest((Widget)cb, &my_request, NULL); if (res == XtGeometryYes) { if (!(my_request.request_mode & XtCWQueryOnly)) { XtWidgetProc resize; if (request->request_mode & CWWidth) XtWidth(mychild) = request->width; if (request->request_mode & CWHeight) XtHeight(mychild) = request->height; if (request->request_mode & CWBorderWidth) XtBorderWidth(mychild) = request->border_width; _XmProcessLock(); resize = XtCoreProc(cb, resize); _XmProcessUnlock(); (*resize)((Widget) cb) ; } else if (almost_list_width) { reply->request_mode = request->request_mode ; reply->width = almost_list_width ; reply->height = request->height ; reply->border_width = request->border_width ; return XtGeometryAlmost ; } return XtGeometryYes; } else return XtGeometryNo; } /* * Redisplay() * General redisplay function called on exposure events. */ /*ARGSUSED*/ static void Redisplay(Widget widget, XEvent *event, /* unused */ Region region) /* unused */ { XmComboBoxWidget cb = (XmComboBoxWidget) widget; if (XtIsRealized(widget)) { if (CB_Type(cb) != XmCOMBO_BOX) DrawArrow(widget, CB_ArrowPressed(cb)); DrawShadows(widget); /* CR 6356: Refresh the highlight border too. */ if (CB_Highlighted(cb)) HighlightBorder(widget); else UnhighlightBorder(widget); } } /* * Destroy() * Called by the Intrinsics when a ComboBox widget is destroyed. */ static void Destroy(Widget widget) { XmComboBoxWidget cb = (XmComboBoxWidget) widget; Widget ancestor; if (CB_Type(widget) != XmCOMBO_BOX) XtRemoveEventHandler(widget, POPUP_EVENT_MASK, FALSE, PopupEH, (XtPointer)widget); /* The remove focus moved callback from the vendor shell. */ ancestor = widget; while (ancestor && !XmIsVendorShell(ancestor)) ancestor = XtParent(ancestor); if (ancestor && !ancestor->core.being_destroyed) XmeRemoveFocusChangeCallback(ancestor, FocusMovedCB, (XtPointer) widget); if (cb->combo_box.arrow_GC) XtReleaseGC(widget, cb->combo_box.arrow_GC); XmFontListFree(CB_RenderTable(cb)); } /* * QueryGeometry() */ static XtGeometryResult QueryGeometry(Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired) { /* Deal with user initial size setting. */ if (!XtIsRealized(widget)) { desired->width = XtWidth(widget); /* might be 0 */ desired->height = XtHeight(widget); /* might be 0 */ } else { /* Always computes natural size afterwards. */ desired->width = 0; desired->height = 0; } ComputeSize(widget, 0, 0, &desired->width, &desired->height); /* This function will set CWidth and CHeight. */ return XmeReplyToQueryGeometry(widget, intended, desired); } /* * ConstraintDestroy() */ static void ConstraintDestroy(Widget child) { XmComboBoxWidget cb; if (!XtIsRectObj (child)) return; cb = (XmComboBoxWidget) XtParent(child); if (child == CB_EditBox(cb)) { CB_EditBox(cb) = NULL; } else if (child == CB_ScrolledW(cb)) { CB_ScrolledW(cb) = NULL; CB_List(cb) = NULL; cb->combo_box.vsb = NULL; cb->combo_box.hsb = NULL; } else if (child == CB_ListShell(cb)) { CB_ListShell(cb) = NULL; CB_ScrolledW(cb) = NULL; CB_List(cb) = NULL; cb->combo_box.vsb = NULL; cb->combo_box.hsb = NULL; } } /* * ComboBoxParentProcess() */ static Boolean ComboBoxParentProcess(Widget wid, XmParentProcessData event) { XmComboBoxWidget cb = (XmComboBoxWidget) wid; XmGrabShellWidget gs = NULL; Boolean cont = TRUE; int count = 0; Cardinal n = 0; Arg args[2]; if ((event->any.process_type == XmINPUT_ACTION) && ((event->input_action.action == XmPARENT_ACTIVATE) || (event->input_action.action == XmPARENT_CANCEL))) { if (CB_Type(cb) != XmCOMBO_BOX) { gs = (XmGrabShellWidget)CB_ListShell(cb); if (gs && (CB_ShellState(cb) == POPPED_UP)) { PopdownList((Widget)cb, event->input_action.event); CBDisarm((Widget)cb, event->input_action.event, NULL, NULL); cont = FALSE; } } if (event->input_action.action == XmPARENT_ACTIVATE) { /* * If the event occurred in the text widget and the popup shell * is up, call the defaultAction callbacks on the List. * We can't call the action routine for List that will do this * because it will pass the Activate back to us and we'll end * up looping. Only call them if there are items in the list - * this is what list does in KbdActivate(). */ /* CR 9484: Always compute pos. */ XmString item = GetEditBoxValue((Widget) cb); int pos = XmListItemPos(CB_List(cb), item); n = 0; XtSetArg(args[n], XmNitemCount, &count), n++; assert(n <= XtNumber(args)); XtGetValues(CB_List(cb), args, n); if (((CB_Type(cb) == XmCOMBO_BOX) || !cont) && count) { XmListCallbackStruct call_data; bzero((char*) &call_data, sizeof(XmListCallbackStruct)); if (pos) { call_data.item = XmStringCopy(item); call_data.item_length = XmStringLength(item); call_data.item_position = pos; call_data.selected_item_count = 1; call_data.selected_item_positions = &pos; call_data.selected_items = &item; } call_data.reason = XmCR_DEFAULT_ACTION; call_data.event = event->input_action.event; XtCallCallbacks(CB_List(cb), XmNdefaultActionCallback, (XtPointer)&call_data); XmStringFree(call_data.item); } XmStringFree(item); /* CR 6552: Fixup the list selection. */ if (pos) XmListSelectPos(CB_List(cb), pos, FALSE); else XmListDeselectAllItems(CB_List(cb)); /* Call the selection callbacks. */ CallSelectionCallbacks((Widget)cb, event->input_action.event); } } if (cont) return _XmParentProcess(XtParent(cb), event); else return True; } /* ------------- CALLBACKS ---------- */ /* * TextChangedCB() * Callback function invoked when the edit box value is changed. */ /*ARGSUSED*/ static void TextChangedCB(Widget widget, /* unused */ XtPointer client_data, XtPointer call_data) /* unused */ { XmComboBoxWidget cb = (XmComboBoxWidget)client_data; /* Remember to generate a selection callback when focus moves. */ CB_TextChanged(cb) = TRUE; } /* * ListSelectionCB() * Callback function called when an item is selected from the list. */ /*ARGSUSED*/ static void ListSelectionCB(Widget widget, /* unused */ XtPointer client_data, XtPointer call_data) { XmComboBoxWidget cb = (XmComboBoxWidget)client_data; XmString item; int top, vis_items; Cardinal n; Arg args[3]; XmListCallbackStruct *cb_data = (XmListCallbackStruct *)call_data; if (!CB_EditBox(cb)) { XmeWarning((Widget)cb, MISSINGKID); return; } /* If the EditBox does not contain the selected text, set it. */ item = GetEditBoxValue((Widget) cb); if (! XmStringCompare(item, cb_data->item)) SetEditBoxValue((Widget) cb, cb_data->item); XmStringFree(item); /* If the selected item is not viewable, scroll the list. */ n = 0; XtSetArg(args[n], XmNtopItemPosition, &top), n++; XtSetArg(args[n], XmNvisibleItemCount, &vis_items), n++; assert(n <= XtNumber(args)); XtGetValues(CB_List(cb), args, n); if ((cb_data->item_position < top) || (cb_data->item_position >= (top + vis_items))) XmListSetBottomItem(CB_List(cb), cb_data->item); CallSelectionCallbacks((Widget)cb, cb_data->event); if (cb_data->event && (cb_data->event->type == ButtonPress || cb_data->event->type == ButtonRelease)) { if (CB_Type(cb) != XmCOMBO_BOX) { PopdownList((Widget)cb, cb_data->event); /* CR 6147: If we drag straight from the arrow to a list */ /* item we won't get a normal disarm callback. */ CBDisarm((Widget)cb, cb_data->event, NULL, NULL); } } } /* * ShellPopupCB() * Called when the grab shell is posted. Fixup focus. */ /*ARGSUSED*/ static void ShellPopupCB(Widget widget, /* unused */ XtPointer client_data, XtPointer call_data) /* unused */ { XmComboBoxWidget cb = (XmComboBoxWidget)client_data; CB_ShellState(cb) = POPPED_UP; (void) XmProcessTraversal(CB_List(cb), XmTRAVERSE_CURRENT); } /* * ShellPopdownCB() * Called when the grab shell is unposted. */ /*ARGSUSED*/ static void ShellPopdownCB(Widget widget, /* unused */ XtPointer client_data, XtPointer call_data) /* unused */ { XmComboBoxWidget cb = (XmComboBoxWidget)client_data; XmDisplay disp = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Window old_focus; int old_revert; /* CR 9887: List may not have seen the BtnUp event... */ XtCallActionProc(CB_List(cb), "ListKbdCancel", NULL, NULL, 0); /* Re-enable drag and drop. */ disp->display.userGrabbed = False; CB_ShellState(cb) = POPPED_DOWN; cb->combo_box.scrolling = FALSE; /* In click-to-type mode we can't lose focus, and won't get a */ /* focus-in event when the grabshell pops down. */ XGetInputFocus(XtDisplay(cb), &old_focus, &old_revert); if (old_revert != RevertToParent) { CBFocusOut((Widget)cb, NULL, NULL, NULL); /* CR 7122: Tell the edit box to stop blinking now. */ if (CB_Type(cb) == XmDROP_DOWN_COMBO_BOX) { XEvent focus_event; focus_event.xfocus.type = FocusOut; focus_event.xfocus.send_event = True; XtCallActionProc(CB_EditBox(cb), "focusOut", &focus_event, NULL, 0); } } } /* * FocusMovedCB() * Called from VendorShell every time focus moves. */ /*ARGSUSED*/ static void FocusMovedCB(Widget widget, /* unused */ XtPointer client_data, XtPointer call_data) { XmFocusMovedCallbackStruct *callback = (XmFocusMovedCallbackStruct *) call_data; XmComboBoxWidget cb = (XmComboBoxWidget) client_data; Boolean have_focus, getting_focus; /* Some other focus-moved callback has aborted this shift. */ if (!callback->cont) return; have_focus = CB_Highlighted(cb); getting_focus = (((callback->new_focus == NULL) && (CB_ShellState(cb) != POPPED_DOWN)) || (callback->new_focus == (Widget)cb) || (callback->new_focus == CB_EditBox(cb)) || (callback->new_focus == CB_ScrolledW(cb)) || (callback->new_focus == CB_List(cb)) || ((cb->combo_box.hsb != NULL) && (callback->new_focus == cb->combo_box.hsb)) || ((cb->combo_box.vsb != NULL) && (callback->new_focus == cb->combo_box.vsb))); /* CR 9868: In XmPOINTER mode focus goes to weird places. */ if (!getting_focus && (_XmGetFocusPolicy((Widget) cb) == XmPOINTER)) { Window root, child; int root_x, root_y, win_x, win_y; unsigned int mod_mask; if (CB_ShellState(cb) == POPPED_UP) getting_focus = TRUE; else if ((callback->new_focus == XtParent(cb)) && XQueryPointer(XtDisplay(cb), XtWindow(cb), &root, &child, &root_x, &root_y, &win_x, &win_y, &mod_mask) && (win_x >= 0) && (win_x < XtWidth(cb)) && (win_y >= 0) && (win_y < XtHeight(cb))) getting_focus = TRUE; } if (have_focus && !getting_focus) { CBFocusOut((Widget)cb, callback->event, NULL, NULL); /* Is this necessary? */ if (CB_ShellState(cb) == POPPED_UP) { PopdownList((Widget)cb, callback->event); CBDisarm((Widget)cb, callback->event, NULL, NULL); } } else if (!have_focus && getting_focus) { CBFocusIn((Widget)cb, callback->event, NULL, NULL); } } /* ------------- ACTION ROUTINES ---------- */ /* * CBArmAndDropDownList() * Handle button down action in widget. First determine if hit * is in an arrow, otherwise ignore the event. If it is in an arrow, * then supply visual feedback and perform the appropriate action. */ /*ARGSUSED*/ static void CBArmAndDropDownList(Widget widget, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmComboBoxWidget cb = FindComboBox(widget); XmGrabShellWidget gs = (XmGrabShellWidget)CB_ListShell(cb); /* Return if this is a replay of the unpost event. */ if (gs && (event->xbutton.time == gs->grab_shell.unpost_time)) return; /* Ignore the event if this is a replay */ if (! _XmIsEventUnique(event)) return; if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } /* CR 9833: Attempt to grab focus. */ XmProcessTraversal((Widget)cb, XmTRAVERSE_CURRENT); if ((CB_Type(cb) != XmCOMBO_BOX) && Hit((XButtonEvent *)event, CB_HitRect(cb))) { CB_ArrowPressed(cb) = TRUE; DrawArrow((Widget)cb, CB_ArrowPressed(cb)); CBDropDownList((Widget)cb, event, NULL, NULL); } } /* * CBDisarm() * Handle button up action and undo CBArmAndDropDownList. */ /*ARGSUSED*/ static void CBDisarm(Widget widget, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { XmComboBoxWidget cb = FindComboBox(widget); if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } if (CB_Type(cb) != XmCOMBO_BOX) { if (CB_ArrowPressed(cb)) { CB_ArrowPressed(cb) = FALSE; DrawArrow((Widget)cb, CB_ArrowPressed(cb)); } } } /* * CBDropDownList() * Action to post/unpost the drop down list. */ static void CBDropDownList(Widget widget, XEvent *event, String *params, Cardinal *num_params) { XmComboBoxWidget cb = FindComboBox(widget); if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } if ((CB_Type(cb) != XmCOMBO_BOX)) { XmGrabShellWidget gs = (XmGrabShellWidget)CB_ListShell(cb); if (gs && (CB_ShellState(cb) == POPPED_DOWN)) { XmDisplay disp = (XmDisplay) XmGetDisplay(widget); Arg args[3]; Cardinal n; int tmp; Position root_x, root_y, shell_x, shell_y; Dimension shell_width; XtTranslateCoords((Widget)cb, XtX(cb), XtY(cb), &root_x, &root_y); shell_x = root_x - XtX(cb) + CB_HighlightThickness(cb) - XtBorderWidth(CB_ListShell(cb)); shell_y = root_y + XtHeight(cb) - CB_HighlightThickness(cb) - XtY(cb); /* Try to position the shell on the screen. */ tmp = WidthOfScreen(XtScreen(cb)) - XtWidth(CB_ListShell(cb)); tmp = MIN(tmp, shell_x); shell_x = MAX(0, tmp); tmp = HeightOfScreen(XtScreen(cb)) - XtHeight(CB_ListShell(cb)); tmp = MIN(tmp, shell_y); shell_y = MAX(0, tmp); /* CR 8446: The shell width may have changed unexpectedly. */ shell_width = XtWidth(cb) - 2 * CB_HighlightThickness(cb); n = 0; XtSetArg(args[n], XmNx, shell_x), n++; XtSetArg(args[n], XmNy, shell_y), n++; XtSetArg(args[n], XmNwidth, shell_width), n++; assert(n <= XtNumber(args)); XtSetValues(CB_ListShell(cb), args, n); CB_ShellState(cb) = POPPING_UP; cb->combo_box.scrolling = FALSE; /* Don't let drag and drop confuse things. */ disp->display.userGrabbed = True; /* Record the post time */ gs->grab_shell.post_time = event->xbutton.time; /* Record the event to prevent popdown on replay */ _XmRecordEvent(event); _XmPopupSpringLoaded(CB_ListShell(cb)); } else /* shell is popped up */ { PopdownList((Widget)cb, event); CBDisarm((Widget)cb, event, params, num_params); } } } /* * CBFocusIn() * Action routine to draw focus highlighting. */ /*ARGSUSED*/ static void CBFocusIn(Widget widget, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { XmComboBoxWidget cb = FindComboBox(widget); if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } HighlightBorder((Widget)cb); } /* * CBFocusOut() * Action routine to erase focus highlighting. */ /*ARGSUSED*/ static void CBFocusOut(Widget widget, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmComboBoxWidget cb = FindComboBox(widget); if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } UnhighlightBorder((Widget)cb); if (CB_TextChanged(cb)) CallSelectionCallbacks((Widget)cb, event); } /* * CBTextFocusOut() * Action routine to fake the text field cursor into blinking. */ /*ARGSUSED*/ static void CBTextFocusOut(Widget widget, XEvent *event, String *params, Cardinal *num_params) { XmComboBoxWidget cb = FindComboBox(widget); if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } /* CR 7122: Suppress text focus-out events when the grab shell is */ /* posted, so that the insertion cursor will continue to blink. */ if ((CB_Type(cb) != XmDROP_DOWN_COMBO_BOX) || (CB_ShellState(cb) != POPPED_UP)) { XtCallActionProc(CB_EditBox(cb), "focusOut", event, params, (num_params ? *num_params : 0)); } } /* * CBActivate() * Action routine called when the list is activated. */ static void CBActivate(Widget widget, XEvent *event, String *params, Cardinal *num_params) { XmComboBoxWidget cb = FindComboBox(widget); XmParentInputActionRec p_event; if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_ACTIVATE; p_event.event = event; p_event.params = params; p_event.num_params = num_params; ComboBoxParentProcess((Widget)cb, (XmParentProcessData) &p_event); } /* * CBCancel() * Action invoked from the drop down list. */ static void CBCancel(Widget widget, XEvent *event, String *params, Cardinal *num_params) { XmComboBoxWidget cb = FindComboBox(widget); XmParentInputActionRec p_event; if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_CANCEL; p_event.event = event; p_event.params = params; p_event.num_params = num_params; ComboBoxParentProcess((Widget)cb, (XmParentProcessData) &p_event); } /* * CBListAction() * Generic action to perform operations on the list. */ static void CBListAction(Widget widget, XEvent *event, String *params, Cardinal *num_params) { /* This enum matches the order of the string constants in RepType.c */ enum { UP, DOWN, PREVPAGE, NEXTPAGE, BEGINDATA, ENDDATA }; XmComboBoxWidget cb = FindComboBox(widget); int direction; if (!cb) { XmeWarning((Widget)cb, WRONGWIDGET); return; } if (!num_params || (*num_params != 1) || !params) { XmeWarning((Widget) cb, WRONGPARAMS); return; } if (_XmConvertActionParamToRepTypeId ((Widget) cb, XmRID_COMBO_BOX_LIST_ACTION_ACTION_PARAMS, params[0], False, &direction) == False) { /* Unknown value. A warning should already have been printed. */ return; } switch (direction) { case UP: case DOWN: { int *pos, count, num_items; Cardinal n; Arg args[3]; /* Find the current number of items and selected position. */ n = 0; XtSetArg(args[n], XmNitemCount, &num_items), n++; XtSetArg(args[n], XmNselectedPositions, &pos), n++; XtSetArg(args[n], XmNselectedPositionCount, &count), n++; assert(n <= XtNumber(args)); XtGetValues(CB_List(cb), args, n); if (count) { switch (direction) { case UP: if (*pos >= 1) XmListSelectPos(CB_List(cb), *pos - 1, TRUE); break; case DOWN: if (*pos < num_items) XmListSelectPos(CB_List(cb), *pos + 1, TRUE); else if (*pos == num_items) XmListSelectPos(CB_List(cb), 1, TRUE); break; default: assert(FALSE); } } else if (num_items) { XmListSelectPos(CB_List(cb), 1, TRUE); } } break; case PREVPAGE: if ((CB_Type(cb) == XmCOMBO_BOX) || (CB_ShellState(cb) == POPPED_UP)) XtCallActionProc(CB_List(cb), "ListPrevPage", event, NULL, 0); break; case NEXTPAGE: if ((CB_Type(cb) == XmCOMBO_BOX) || (CB_ShellState(cb) == POPPED_UP)) XtCallActionProc(CB_List(cb), "ListNextPage", event, NULL, 0); break; case BEGINDATA: XtCallActionProc(CB_List(cb), "ListBeginData", event, NULL, 0); break; case ENDDATA: XtCallActionProc(CB_List(cb), "ListEndData", event, NULL, 0); break; default: assert(FALSE); } } /* * PopdownList() * Internal utility to unpost the grabshell. */ static Boolean PopdownList(Widget cb, XEvent *event) { Widget gs = CB_ListShell(cb); /* Popping down while in the process of popping up causes X errors. */ if (gs && XmIsGrabShell(gs) && (CB_ShellState(cb) == POPPED_UP)) { CB_ShellState(cb) = POPPING_DOWN; XtCallActionProc(gs, "GrabShellPopdown", event, NULL, 0); return TRUE; } return FALSE; } /* ------------- EVENT HANDLERS ---------- */ /* * PopupEH() * An XtEventHandler for the popup shell (the drop-down list). */ /*ARGSUSED*/ static void PopupEH(Widget widget, /* unused */ XtPointer client_data, XEvent *event, Boolean *dispatch) { XmComboBoxWidget cb = (XmComboBoxWidget)client_data; switch (event->type) { case ButtonRelease: CBDisarm((Widget)cb, event, NULL, NULL); /* CR 9899: Only discard matched pairs of scrollbar button events. */ /* Should combo_box.scrolling be a counter??? */ if (cb->combo_box.scrolling) *dispatch = cb->combo_box.scrolling = FALSE; break; case ButtonPress: /* Press & release in the scrollbar shouldn't popdown the list. */ if ((cb->combo_box.vsb && XtIsRealized(cb->combo_box.vsb) && (event->xbutton.window == XtWindow(cb->combo_box.vsb))) || (cb->combo_box.hsb && XtIsRealized(cb->combo_box.hsb) && (event->xbutton.window == XtWindow(cb->combo_box.hsb)))) cb->combo_box.scrolling = TRUE; break; case EnterNotify: if (CB_ArrowPressed(cb)) XtCallActionProc(CB_List(cb), "ListBeginSelect", event, NULL, 0); break; default: /* This shouldn't happen. */ break; } } /* * CR 6925: The following two event handlers are used to coordinate * grabs between the scrollbar and the grab shell in dropdown lists. * In this case the existing active grab started by the grab shell * will interfere with the passive grab started by X when the user * presses a button within the scrollbar. * * To deal with the problem, SBBtnDownEH will do an XtGrabPointer * to transfer the grab to the scrollbar and SBBtnUpEH will cause * the grab to return to the grab shell. */ /*ARGSUSED*/ static void SBBtnDownEH(Widget w, XtPointer client_data, XEvent *event, Boolean *cont) /* unused */ { XmGrabShellWidget shell = (XmGrabShellWidget) client_data; XtGrabPointer(w, False, Events | PointerMotionMask | ButtonMotionMask, GrabModeAsync, GrabModeAsync, None, shell->grab_shell.cursor, event->xbutton.time); } /*ARGSUSED*/ static void SBBtnUpEH(Widget w, /* unused */ XtPointer client_data, XEvent *event, Boolean *cont) /* unused */ { XmGrabShellWidget shell = (XmGrabShellWidget) client_data; /* Note that this regrab to the grab shell will need to be changed * if the kind of grab that the grabshell imposes changes. */ XtGrabPointer((Widget) shell, shell->grab_shell.owner_events, Events, shell->grab_shell.grab_style, GrabModeAsync, None, shell->grab_shell.cursor, event->xbutton.time); if (shell->grab_shell.grab_style == GrabModeSync) XAllowEvents(XtDisplay(shell), SyncPointer, event->xbutton.time); } /* * FindComboBox() * An internal utility routine to traverse up the widget * hierarchy until a ComboBox is found. */ static XmComboBoxWidget FindComboBox(Widget widget) { Widget cb = widget; while (cb && !XmIsComboBox(cb)) cb = XtParent(cb); return (XmComboBoxWidget) cb; } /* * CallSelectionCallbacks() * Utility routine to invoke the ComboBox selection callback. */ static void CallSelectionCallbacks(Widget widget, XEvent *event) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; XmComboBoxCallbackStruct call_data; XmString item; int pos; /* The user knows about this change. */ CB_TextChanged(cb) = FALSE; item = GetEditBoxValue((Widget) cb); /* Implement bogus zero-based positions for DtComboBox compatibility. */ pos = XmListItemPos(CB_List(cb), item); if ((CB_PositionMode(cb) == XmZERO_BASED) && (pos > 0)) --pos; /* Call callback list */ call_data.item_or_text = item; call_data.item_position = pos; call_data.reason = XmCR_SELECT; call_data.event = event; XtCallCallbackList((Widget)cb, CB_SelectionCB(cb), (XtPointer)&call_data); XmStringFree(item); } /* ------------- DEFAULT RESOURCE VALUE CALLPROCS ---------- */ /* * XmRCallProc routine for checking font before setting it to NULL * if no value is specified for both XmNrenderTable and XmNfontList. * I'm usurping the text_changed field to act as a flag to indicate that * this function has been called twice on same widget -> implying that * resource needs to be set NULL, otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmComboBoxWidget cb = (XmComboBoxWidget)wid; if (cb->combo_box.text_changed) /* Already been here once, so set resource = NULL */ value->addr = NULL; else { cb->combo_box.text_changed = True; value->addr = (char*) &CB_RenderTable(cb); } } /* ------------- SYNTHETIC RESOURCE ACCESS METHODS ------------- */ /* * CBSetSelectedItem() * A synthetic resource import procedure. This procedure can get * called at create time BEFORE ComboBox's Initialize() has been * called and children have been created. Make sure children have * been created before doing anything. */ /*ARGSUSED*/ static XmImportOperator CBSetSelectedItem(Widget widget, int offset, /* unused */ XtArgVal *value) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; XmString new_value = (XmString) *value; int pos = 0; if (!cb->composite.num_children) return XmSYNTHETIC_NONE; pos = XmListItemPos(CB_List(cb), new_value); if (pos > 0) { XmListSelectPos(CB_List(cb), pos, TRUE); } else { XmString item = GetEditBoxValue((Widget) cb); if (! XmStringCompare(item, new_value)) { XmListDeselectAllItems(CB_List(cb)); SetEditBoxValue((Widget) cb, new_value); } XmStringFree(item); } return XmSYNTHETIC_NONE; } /* * CBGetSelectedItem() * A synthetic resource export procedure. */ /*ARGSUSED*/ static void CBGetSelectedItem(Widget widget, int offset, /* unused */ XtArgVal *value) { *value = (XtArgVal) GetEditBoxValue(widget); } /* * CBSetSelectedPos() * A synthetic resource import procedure. */ /*ARGSUSED*/ static XmImportOperator CBSetSelectedPos(Widget widget, int offset, /* unused */ XtArgVal *value) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; int *selPosns = NULL, curpos = 0; Cardinal n; Arg args[3]; int new_pos; /* * This procedure can get called at create time BEFORE ComboBox's * Initialize() has been called and children have been created. * Make sure children have been created before doing anything. */ if (!cb->composite.num_children) return XmSYNTHETIC_NONE; /* Get current (1-based) list selectedPos */ n = 0; XtSetArg(args[n], XmNselectedPositions, &selPosns), n++; assert(n <= XtNumber(args)); XtGetValues(CB_List(cb), args, n); if (selPosns) curpos = *selPosns; /* Implement bogus zero-based positions for DtComboBox compatibility. */ new_pos = (int)*value; if (CB_PositionMode(cb) == XmZERO_BASED) new_pos++; if (curpos != new_pos) XmListSelectPos(CB_List(cb), new_pos, TRUE); return XmSYNTHETIC_NONE; } /* * CBGetSelectedPos() * A synthetic resource export procedure. */ /*ARGSUSED*/ static void CBGetSelectedPos(Widget widget, int offset, /* unused */ XtArgVal *value) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; Arg args[2]; Cardinal nargs; int *pos, count; int result; /* Using XmListGetSelectedPos would copy the positions array. */ nargs = 0; XtSetArg(args[nargs], XmNselectedPositions, &pos), nargs++; XtSetArg(args[nargs], XmNselectedPositionCount, &count), nargs++; assert(nargs <= XtNumber(args)); XtGetValues(CB_List(cb), args, nargs); /* Implement bogus zero-based positions for DtComboBox compatibility. */ result = (count > 0) ? *pos : 0; if ((CB_PositionMode(cb) == XmZERO_BASED) && (result > 0)) --result; *value = result; } /* * CBGetColumns() * A synthetic resource export procedure. */ /*ARGSUSED*/ static void CBGetColumns(Widget widget, int offset, /* unused */ XtArgVal *value) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; Arg args[1]; Cardinal nargs; short columns = 0; /* Fetch the value from the child widget. */ if (CB_EditBox(cb)) { nargs = 0; XtSetArg(args[nargs], XmNcolumns, &columns), nargs++; assert(nargs <= XtNumber(args)); XtGetValues(CB_EditBox(cb), args, nargs); } *value = (XtArgVal)columns; } /* * CBGetItems() * A synthetic resource export procedure. */ /*ARGSUSED*/ static void CBGetItems(Widget widget, int offset, /* unused */ XtArgVal *value) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; Arg args[1]; Cardinal nargs; XmStringTable items = NULL; /* Fetch the value from the child widget. */ if (CB_List(cb)) { nargs = 0; XtSetArg(args[nargs], XmNitems, &items), nargs++; assert(nargs <= XtNumber(args)); XtGetValues(CB_List(cb), args, nargs); } *value = (XtArgVal)items; } /* * CBGetItemCount() * A synthetic resource export procedure. */ /*ARGSUSED*/ static void CBGetItemCount(Widget widget, int offset, /* unused */ XtArgVal *value) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; Arg args[1]; Cardinal nargs; int count = 0; /* Fetch the value from the child widget. */ if (CB_List(cb)) { nargs = 0; XtSetArg(args[nargs], XmNitemCount, &count), nargs++; assert(nargs <= XtNumber(args)); XtGetValues(CB_List(cb), args, nargs); } *value = (XtArgVal)count; } /* * CBGetVisibleItemCount() * A synthetic resource export procedure. */ /*ARGSUSED*/ static void CBGetVisibleItemCount(Widget widget, int offset, /* unused */ XtArgVal *value) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; Arg args[1]; Cardinal nargs; int viz_count = 0; /* Fetch the value from the child widget. */ if (CB_List(cb)) { nargs = 0; XtSetArg(args[nargs], XmNvisibleItemCount, &viz_count), nargs++; assert(nargs <= XtNumber(args)); XtGetValues(CB_List(cb), args, nargs); } *value = (XtArgVal)viz_count; } /* ------------- ADDITIONAL FUNCTIONS ---------- */ /* * HighlightBorder() */ static void HighlightBorder(Widget w) { XmComboBoxWidget cb = (XmComboBoxWidget)w; CB_Highlighted(cb) = TRUE; if ((XtWidth(cb) == 0) || (XtHeight(cb) == 0) || (CB_HighlightThickness(cb) == 0)) return; XmeDrawHighlight(XtDisplay(cb), XtWindow(cb), cb->manager.highlight_GC, 0, 0, XtWidth(cb), XtHeight(cb), CB_HighlightThickness(cb)); } /* * UnhighlightBorder() */ static void UnhighlightBorder(Widget w) { XmComboBoxWidget cb = (XmComboBoxWidget)w; CB_Highlighted(cb) = FALSE; if ((XtWidth(w) == 0) || (XtHeight(w) == 0) || (CB_HighlightThickness(cb) == 0)) return; XmeDrawHighlight(XtDisplay(cb), XtWindow(cb), cb->manager.background_GC, 0, 0, XtWidth(w), XtHeight(w), CB_HighlightThickness(cb)); } /* * DoLayout() * Computes layout and sizes of children given a size for their * parent. Called from SetValues, Resize and ChangeManaged. */ static void DoLayout(Widget widg) { XmComboBoxWidget cb = (XmComboBoxWidget)widg; Dimension ebW = 0, ebH = 0, thickW = 0, thickH = 0; Dimension listW = 0, listH = 0 ; Dimension diff, htLeft = 0; XtWidgetGeometry geom, replygeom; XtGeometryResult result; /* Make sure all our children are around */ if (!CB_EditBox(cb)) XmeWarning(widg, MISSINGKID); else if (!XtIsManaged(CB_EditBox(cb))) { XmeWarning(widg, UNMANAGEDKID); return; } if (!CB_List(cb)) XmeWarning(widg, MISSINGKID); else if (!XtIsManaged(CB_List(cb))) { XmeWarning(widg, UNMANAGEDKID); return; } GetThickness(widg, &thickW, &thickH); ebW = XtWidth(cb) - 2 * (thickW + XtBorderWidth(CB_EditBox(cb))); if (CB_Type(cb) != XmCOMBO_BOX) { /* These are the drop down types */ Arg args[1]; Cardinal nargs; ebH = XtHeight(cb) - 2 * (thickH + XtBorderWidth(CB_EditBox(cb))); if (CB_ArrowSize(cb) == XmINVALID_DIMENSION) CB_ArrowSize(cb) = GetDefaultArrowSize((Widget)cb); SetHitArea((Widget)cb); ebW -= (CB_ArrowSpacing(cb) + CB_ArrowSize(cb)); /* Realize the shell so these values will be maintained. */ if (!XtIsRealized(CB_ListShell(cb))) XtRealizeWidget(CB_ListShell(cb)); /* CR 7676: These numbers don't make sense, but they work? */ listW = XtWidth(cb) - 2 * CB_HighlightThickness(cb); if(XtWidth(cb) <= 2 * CB_HighlightThickness(cb)) listW=1; nargs = 0; XtSetArg(args[nargs], XmNwidth, listW), nargs++; assert(nargs <= XtNumber(args)); XtSetValues(CB_ListShell(cb), args, nargs); } else { Dimension new_width = XtWidth(CB_ScrolledW(cb)); Dimension new_height = XtHeight(CB_ScrolledW(cb)); htLeft = XtHeight(cb) - 2 * (XtBorderWidth(CB_EditBox(cb)) + XtBorderWidth(CB_ScrolledW(cb)) + CB_HighlightThickness(cb) + MGR_ShadowThickness(cb) + CB_MarginHeight(cb)); if (!cb->combo_box.ideal_ebheight) GetIdealTextSize((Widget)cb, NULL, &cb->combo_box.ideal_ebheight); /* If ideal edit box height fits, use it. */ ebH = MIN(htLeft - MINLIST, cb->combo_box.ideal_ebheight); listW = XtWidth(cb) - 2 * (thickW + XtBorderWidth(CB_ScrolledW(cb))); listH = htLeft - ebH; /* Ask ScrolledW if this size is okay */ geom.request_mode = 0; geom.request_mode |= CWWidth; geom.request_mode |= CWHeight; geom.width = listW; geom.height = listH; switch (XtQueryGeometry(CB_ScrolledW(cb), &geom, &replygeom)) { case XtGeometryAlmost: if (replygeom.request_mode & CWHeight) { /* see if EditBox will shrink. */ listH = replygeom.height; diff = abs(geom.height - replygeom.height); geom.request_mode = 0; geom.request_mode |= CWHeight; geom.height = ebH - diff; result = XtQueryGeometry(CB_EditBox(cb), &geom, NULL); if (result == XtGeometryYes) { ebH = geom.height; /* will be resized below */ new_width = listW; new_height = listH; } } break; case XtGeometryYes: case XtGeometryNo: default: /* No compromises. These are the new dimensions. */ new_width = listW; new_height = listH; } XmeConfigureObject(CB_ScrolledW(cb), thickW, (thickH + ebH + 2 * XtBorderWidth(CB_EditBox(cb)) + XtBorderWidth(CB_ScrolledW(cb))), new_width, new_height, XtBorderWidth(CB_ScrolledW(cb))); } { Position new_x, new_y; if ((CB_Type(cb) != XmCOMBO_BOX) && LayoutIsRtoLM(cb)) { new_x = (thickW + CB_ArrowSize(cb) + CB_ArrowSpacing(cb)); new_y = thickH ; } else { new_x = thickW ; new_y = thickH ; } XmeConfigureObject(CB_EditBox(cb), new_x, new_y, ebW, ebH, XtBorderWidth(CB_EditBox(cb))); } } /* * ComputeSize() * Determines the width and height of a ComboBox. */ static void ComputeSize(Widget w, Dimension editW, Dimension editH, Dimension *width, Dimension *height) { Dimension cbWidth, cbHeight; Dimension thickW, thickH; XmComboBoxWidget cb = (XmComboBoxWidget)w; int textWidth, textHeight; /* Size of ComboBox * width = (text width) + [arrow space & width] + (surrounding space) * height = (text height) + (surrounding space) + [list height] */ GetThickness(w, &thickW, &thickH); /* Compute size of textfield */ if (!editW || !editH) { /* Ask for text child's preferred size */ GetIdealTextSize((Widget)cb, &textWidth, &textHeight); } else { textWidth = editW; textHeight = editH; } cb->combo_box.ideal_ebwidth = textWidth; cb->combo_box.ideal_ebheight = textHeight; cbWidth = textWidth + 2 * (thickW + XtBorderWidth(CB_EditBox(cb))); cbHeight = textHeight + 2 * (thickH + XtBorderWidth(CB_EditBox(cb))); /* Adjust dimensions taking optional children into account. */ if (CB_Type(cb) == XmCOMBO_BOX) { /* For a COMBO_BOX add in the height of the list. */ XtWidgetGeometry pref; (void) XtQueryGeometry(CB_ScrolledW(cb), NULL, &pref); cbHeight += (pref.height + 2 * XtBorderWidth(CB_ScrolledW(cb))); } else { /* For other types consider the arrow dimensions. */ if (CB_ArrowSize(cb) == XmINVALID_DIMENSION) CB_ArrowSize(cb) = (int) ((float) textHeight * DEFAULT_ARROW_SCALING); cbWidth += CB_ArrowSize(cb) + CB_ArrowSpacing(cb); if (CB_ArrowSize(cb) > textHeight) cbHeight += (CB_ArrowSize(cb) - textHeight); } /* Preserve existing sizes. */ if (! *width) *width = MAX(cbWidth, 1); if (! *height) *height = MAX(cbHeight, 1); } /* * GetIdealTextSize() */ static void GetIdealTextSize(Widget w, int *width, int *height) { XmComboBoxWidget cb = (XmComboBoxWidget)w; XtWidgetGeometry text_pref, list_pref; /* Ask for text child's preferred size */ (void) XtQueryGeometry(CB_EditBox(cb), NULL, &text_pref); /* Ask for list child's preferred size */ (void) XtQueryGeometry(CB_ScrolledW(cb), NULL, &list_pref); if (width) *width = MAX(text_pref.width, list_pref.width); if (height) *height = text_pref.height; } /* * GetDefaultArrowSize() */ static Dimension GetDefaultArrowSize(Widget w) { XmComboBoxWidget cb = (XmComboBoxWidget)w; if (!cb->combo_box.ideal_ebheight) GetIdealTextSize((Widget)cb, NULL, &cb->combo_box.ideal_ebheight); return((int) ((float) cb->combo_box.ideal_ebheight * DEFAULT_ARROW_SCALING)); } /* * SetHitArea() * Sets hit area for arrow. */ static void SetHitArea(Widget w) { XmComboBoxWidget cb = (XmComboBoxWidget)w; Dimension thickW = 0, thickH = 0, ebH; assert(CB_Type(cb) != XmCOMBO_BOX); GetThickness(w, &thickW, &thickH); ebH = XtHeight(cb) - 2 * (thickH + XtBorderWidth(CB_EditBox(cb))); if (CB_ArrowSize(cb) == XmINVALID_DIMENSION) CB_ArrowSize(cb) = GetDefaultArrowSize((Widget)cb); CB_HitRect(cb).width = CB_ArrowSize(cb); CB_HitRect(cb).height = ebH; if (LayoutIsRtoLM(cb)) { CB_HitRect(cb).x = thickW; CB_HitRect(cb).y = thickH; } else { CB_HitRect(cb).x = XtWidth(cb) - thickW - CB_ArrowSize(cb); CB_HitRect(cb).y = thickH; } } /* * GetThickness() * Gets "thickness" resources, i.e. shadow thickness, marginW, etc. */ static void GetThickness(Widget widg, Dimension *width, Dimension *height) { XmComboBoxWidget cb = (XmComboBoxWidget)widg; if (width) *width = cb->combo_box.margin_width + cb->combo_box.highlight_thickness + cb->manager.shadow_thickness; if (height) *height = cb->combo_box.margin_height + cb->combo_box.highlight_thickness + cb->manager.shadow_thickness; } /* * GetArrowGC() * Create the GC for drawing sensitive arrows. */ static void GetArrowGC(Widget widget) { XmComboBoxWidget cb = (XmComboBoxWidget) widget; XGCValues values; XtGCMask mask; /* Only plain ComboBoxes have arrows. */ if (CB_Type(cb) != XmCOMBO_BOX) { mask = 0; values.foreground = XtBackground(widget), mask |= GCForeground; values.graphics_exposures = False, mask |= GCGraphicsExposures; cb->combo_box.arrow_GC = XtGetGC(widget, mask, &values); } else { cb->combo_box.arrow_GC = NULL; } } /* * DrawArrow() */ static void DrawArrow(Widget widget, Boolean pressed) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; int newbox, size, max_height, excess; int x, y, w, h; assert(CB_Type(cb) != XmCOMBO_BOX); if (CB_ArrowSize(cb) == XmINVALID_DIMENSION) CB_ArrowSize(cb) = GetDefaultArrowSize((Widget) cb); /* CR 6912: Reduce size to fit the actual space available. */ max_height = XtHeight(cb) - 2 * (CB_MarginHeight(cb) + CB_HighlightThickness(cb) + cb->manager.shadow_thickness + XtBorderWidth(CB_EditBox(cb))); if (CB_ArrowSize(cb) > max_height) { excess = CB_ArrowSize(cb) - max_height; size = max_height; } else { excess = 0; size = CB_ArrowSize(cb); } newbox = (int) (size * SQRT3_OVER_2); /* CR 6890: Center the arrow within the box. */ x = CB_HitRect(cb).x + (size - newbox + excess) / 2; y = CB_HitRect(cb).y + (CB_HitRect(cb).height - size - 1) / 2; w = h = newbox; XmeDrawArrow(XtDisplay(widget), XtWindow(widget), (pressed ? cb->manager.bottom_shadow_GC : cb->manager.top_shadow_GC), (pressed ? cb->manager.top_shadow_GC : cb->manager.bottom_shadow_GC), (XtIsSensitive(widget) ? cb->combo_box.arrow_GC : cb->manager.background_GC), x, y, w, h, cb->combo_box.arrow_shadow_width, XmARROW_DOWN); y += newbox; h = size - newbox; XmeDrawShadows(XtDisplay(widget), XtWindow(widget), cb->manager.top_shadow_GC, cb->manager.bottom_shadow_GC, x, y, w, h, cb->combo_box.arrow_shadow_width, XmSHADOW_OUT); } /* * DrawShadows() */ static void DrawShadows(Widget widget) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; int offset = CB_HighlightThickness(cb); XmeDrawShadows(XtDisplay(widget), XtWindow(widget), cb->manager.top_shadow_GC, cb->manager.bottom_shadow_GC, offset, offset, XtWidth(widget) - 2 * offset, XtHeight(widget) - 2 * offset, MGR_ShadowThickness(cb), XmSHADOW_OUT); } /* * CreateChildren() * Called by the ComboBox Widget's Initialize proc. to create * the children that make up a ComboBox. */ static void CreateChildren(Widget widget, ArgList arglist, Cardinal *num_args) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; Arg loc_args[10]; Cardinal n_args; /* * N.B.: Do not change order of creation! The CB_EditBox() macro * and code in CreateScrolledList() both rely on this order. */ /* Create the editbox. */ CreateEditBox(widget, TEXT_CHILD_NAME, widget, arglist, num_args); XtAddCallback(CB_EditBox(cb), XmNvalueChangedCallback, TextChangedCB, (XtPointer) cb); /* Create the popup shell if appropriate. */ if (CB_Type(cb) != XmCOMBO_BOX) { CB_ListShell(cb) = CreatePulldown(widget, SHELL_CHILD_NAME, widget, arglist, num_args); XtAddCallback(CB_ListShell(cb), XmNpopupCallback, ShellPopupCB, (XtPointer) cb); XtAddCallback(CB_ListShell(cb), XmNpopdownCallback, ShellPopdownCB, (XtPointer) cb); /* Add Event Handler for pointer events in the popup */ XtAddEventHandler(CB_ListShell(cb), POPUP_EVENT_MASK, FALSE, PopupEH, (XtPointer)cb); } /* Create the list. */ CB_List(cb) = CreateScrolledList(CB_ListShell(cb) ? CB_ListShell(cb) : widget, LIST_CHILD_NAME, widget, arglist, num_args); XtAddCallback(CB_List(cb), XmNbrowseSelectionCallback, (XtCallbackProc)ListSelectionCB, (XtPointer)cb); /* CR 9868: Direct events properly in pointer focus mode. */ if (_XmGetFocusPolicy((Widget) cb) == XmPOINTER) { XtSetKeyboardFocus((Widget) cb, CB_EditBox(cb)); if (CB_ListShell(cb)) XtSetKeyboardFocus(CB_ListShell(cb), CB_List(cb)); } /* Setup all the accelerators and translations. */ switch (CB_Type(cb)) { case XmCOMBO_BOX: /* The standard ComboBox accelerators will handle this case. */ break; case XmDROP_DOWN_LIST: XtOverrideTranslations(CB_List(cb), parsed_list_translations); break; case XmDROP_DOWN_COMBO_BOX: n_args = 0; XtSetArg(loc_args[n_args], XmNaccelerators, parsed_list_accelerators), n_args++; assert(n_args <= XtNumber(loc_args)); XtSetValues(CB_EditBox(cb), loc_args, n_args); XtInstallAccelerators(CB_List(cb), CB_EditBox(cb)); XtOverrideTranslations(CB_EditBox(cb), parsed_text_focus_translations); break; default: assert(False); } /* Install the standard ComboBox accelerators everywhere. */ XtInstallAccelerators(CB_List(cb), (Widget) cb); XtInstallAccelerators(CB_EditBox(cb), (Widget) cb); /* Add event handlers to the scrollbar in the scrolled list widget */ if (CB_Type(cb) != XmCOMBO_BOX) { Widget sb; sb = cb->combo_box.vsb; if (sb != (Widget) NULL) { XtInsertEventHandler(sb, ButtonPressMask, False, SBBtnDownEH, (XtPointer) CB_ListShell(cb), XtListHead); XtInsertEventHandler(sb, ButtonReleaseMask, False, SBBtnUpEH, (XtPointer) CB_ListShell(cb), XtListHead); } sb = cb->combo_box.hsb; if (sb != (Widget) NULL) { XtInsertEventHandler(sb, ButtonPressMask, False, SBBtnDownEH, (XtPointer) CB_ListShell(cb), XtListHead); XtInsertEventHandler(sb, ButtonReleaseMask, False, SBBtnUpEH, (XtPointer) CB_ListShell(cb), XtListHead); } } } /* * CreateEditBox() * Creates the EditBox child of the ComboBox. */ static Widget CreateEditBox(Widget parent, String name, Widget w, ArgList arglist, Cardinal *num_args) { XmComboBoxWidget cb = (XmComboBoxWidget)w; Widget text_widget; Arg loc_args[15]; Cardinal nloc; ArgList merged_args; char *item = NULL; /* * The combo-box itself was already created with this argument * list, so there is no need to separate "optional" and "required" * resources. Our instance field values will be identical if we * override any duplicates. */ nloc = 0; if (CBS_Columns(cb) != XmUNSPECIFIED_COLUMNS) { XtSetArg(loc_args[nloc], XmNcolumns, CBS_Columns(cb)), nloc++; } if (CBS_SelectedItem(cb)) { item = _XmStringGetTextConcat(CBS_SelectedItem(cb)); if (item) XtSetArg(loc_args[nloc], XmNvalue, item), nloc++; } XtSetArg(loc_args[nloc], XmNrenderTable, CB_RenderTable(cb)), nloc++; XtSetArg(loc_args[nloc], XmNnavigationType, XmNONE), nloc++; XtSetArg(loc_args[nloc], XmNhighlightThickness, 0), nloc++; XtSetArg(loc_args[nloc], XmNborderWidth, 0), nloc++; if (CB_Type(cb) == XmDROP_DOWN_LIST) { XtSetArg(loc_args[nloc], XmNeditable, FALSE), nloc++; XtSetArg(loc_args[nloc], XmNcursorPositionVisible, FALSE), nloc++; XtSetArg(loc_args[nloc], XmNshadowThickness, 0), nloc++; } else { XtSetArg(loc_args[nloc], XmNeditable, TRUE), nloc++; XtSetArg(loc_args[nloc], XmNeditMode, XmSINGLE_LINE_EDIT), nloc++; XtSetArg(loc_args[nloc], XmNcursorPositionVisible, TRUE), nloc++; } assert(nloc <= XtNumber(loc_args)); /* Create the edit box. */ merged_args = XtMergeArgLists(arglist, *num_args, loc_args, nloc); text_widget = XmCreateTextField(parent, name, merged_args, *num_args + nloc); XtFree((char *)merged_args); if (item) XtFree(item); XtManageChild(text_widget); assert(cb->composite.children[0] == text_widget); CB_EditBox(cb) = text_widget; return text_widget; } /* * CreatePulldown() * Creates the pulldown shell for the list if the ComboBox is * a XmDROP_DOWN_COMBO_BOX or a XmDROP_DOWN_LIST. */ /*ARGSUSED*/ static Widget CreatePulldown(Widget parent, String name, Widget w, /* unused */ ArgList arglist, Cardinal *num_args) { Widget shell; Arg args[4]; ArgList merged_args; Cardinal n; n = 0; XtSetArg(args[n], XmNlayoutDirection, LayoutM(parent)), n++; XtSetArg(args[n], XmNownerEvents, True), n++; XtSetArg(args[n], XmNgrabStyle, GrabModeSync), n++; assert(n <= XtNumber(args)); merged_args = XtMergeArgLists(arglist, *num_args, args, n); shell = XtCreatePopupShell(name, xmGrabShellWidgetClass, parent, merged_args, n + *num_args); XtFree((char*)merged_args); return shell; } /* * CreateScrolledList() * Creates the Scrolled List child of the ComboBox. If the * ComboBox is a XmDROP_DOWN_COMBO_BOX or a XmDROP_DOWN_LIST it * creates the list in a popup shell. */ static Widget CreateScrolledList(Widget parent, String name, Widget w, ArgList arglist, Cardinal *num_args) { Cardinal n; Arg loc_args[16]; Widget list; XmComboBoxWidget cb = (XmComboBoxWidget)w; ArgList merged_args; int pos, nitems = 0; Boolean setpos = FALSE; XmString *items; n = 0; if (CBS_Items(cb) != XmUNSPECIFIED_ITEMS) { XtSetArg(loc_args[n], XmNitems, CBS_Items(cb)), n++; } if (CBS_ItemCount(cb) != XmUNSPECIFIED_COUNT) { XtSetArg(loc_args[n], XmNitemCount, CBS_ItemCount(cb)), n++; } if (CBS_VisibleItemCount(cb) != XmUNSPECIFIED_COUNT) { XtSetArg(loc_args[n], XmNvisibleItemCount, CBS_VisibleItemCount(cb)), n++; } if (CBS_SelectedItem(cb)) { XtSetArg(loc_args[n], XmNselectedItems, &CBS_SelectedItem(cb)), n++; XtSetArg(loc_args[n], XmNselectedItemCount, 1), n++; } else { if (CBS_SelectedPosition(cb) == XmINVALID_POSITION) pos = 1; /* Issue 138 */ else if (CB_PositionMode(cb) == XmZERO_BASED) pos = CBS_SelectedPosition(cb) + 1; else pos = CBS_SelectedPosition(cb); XtSetArg(loc_args[n], XmNselectedPositions, &pos), n++; XtSetArg(loc_args[n], XmNselectedPositionCount, 1), n++; setpos = TRUE; } XtSetArg(loc_args[n], XmNrenderTable, CB_RenderTable(cb)), n++; if (CB_Type(cb) == XmCOMBO_BOX) XtSetArg(loc_args[n], XmNtraversalOn, FALSE), n++; XtSetArg(loc_args[n], XmNhighlightThickness, ((CB_Type(cb) == XmDROP_DOWN_LIST) ? 2 : 0)), n++; XtSetArg(loc_args[n], XmNborderWidth, 0), n++; XtSetArg(loc_args[n], XmNnavigationType, XmNONE), n++; XtSetArg(loc_args[n], XmNselectionPolicy, XmBROWSE_SELECT), n++; XtSetArg(loc_args[n], XmNlistSizePolicy, XmVARIABLE), n++; XtSetArg(loc_args[n], XmNspacing, 0), n++; XtSetArg(loc_args[n], XmNvisualPolicy, XmVARIABLE), n++; assert(n <= XtNumber(loc_args)); merged_args = XtMergeArgLists(arglist, *num_args, loc_args, n); list = XmCreateScrolledList(parent, name, merged_args, n + *num_args); XtManageChild(list); XtFree((char *)merged_args); CB_ScrolledW(cb) = XtParent(list); n = 0; XtSetArg(loc_args[n], XmNhorizontalScrollBar, &cb->combo_box.hsb), n++; XtSetArg(loc_args[n], XmNverticalScrollBar, &cb->combo_box.vsb), n++; assert(n <= XtNumber(loc_args)); XtGetValues(CB_ScrolledW(cb), loc_args, n); n = 0; XtSetArg(loc_args[n], XmNshadowThickness, 0), n++; assert(n <= XtNumber(loc_args)); XtSetValues(list, loc_args, n); if (setpos) { n = 0; XtSetArg(loc_args[n], XmNitems, &items), n++; XtSetArg(loc_args[n], XmNitemCount, &nitems), n++; assert(n <= XtNumber(loc_args)); XtGetValues(list, loc_args, n); /* CR 7064: Don't try to set the edit box value if no items exist. */ if (nitems && (nitems >= pos)) { if (pos > 0) pos--; SetEditBoxValue((Widget) cb, items[pos]); } } return list; } /* * Hit() * Decide whether a button event happened within a particular XRectangle. */ static Boolean Hit(XButtonEvent* event, XRectangle r) { if (event == NULL) return False; else return ((r.x <= event->x) && (event->x <= (r.x + r.width)) && (r.y <= event->y) && (event->y <= (r.y + r.height))); } /* * GetEditBoxValue() * Retrieve the XmString value of the edit box. */ static XmString GetEditBoxValue(Widget cb) { Widget edit_box = CB_EditBox(cb); XmAccessTextualTrait textTrait; textTrait = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(edit_box), XmQTaccessTextual); if (textTrait) return (XmString) textTrait->getValue(edit_box, XmFORMAT_XmSTRING); else return NULL; } /* * SetEditBoxValue() * Set the XmString value of the edit box. */ static void SetEditBoxValue(Widget cb, XmString value) { Widget edit_box = CB_EditBox(cb); XmAccessTextualTrait textTrait; textTrait = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(edit_box), XmQTaccessTextual); textTrait->setValue(edit_box, value, XmFORMAT_XmSTRING); } /* ------------- CONVENIENCE FUNCTIONS ---------- */ Widget XmCreateComboBox(Widget parent, char *name, ArgList args, Cardinal num_args) { return XtCreateWidget(name, xmComboBoxWidgetClass, parent, args, num_args); } Widget XmCreateDropDownComboBox(Widget parent, char *name, ArgList args, Cardinal num_args) { Arg loc_args[5]; Cardinal n; ArgList merged_args; Widget result; n = 0; XtSetArg(loc_args[n], XmNcomboBoxType, XmDROP_DOWN_COMBO_BOX), n++; assert(n <= XtNumber(loc_args)); merged_args = XtMergeArgLists(args, num_args, loc_args, n); result = XtCreateWidget(name, xmComboBoxWidgetClass, parent, merged_args, n + num_args); XtFree((char *)merged_args); return result; } Widget XmCreateDropDownList(Widget parent, char *name, ArgList args, Cardinal num_args) { Arg loc_args[5]; Cardinal n; ArgList merged_args; Widget result; n = 0; XtSetArg(loc_args[n], XmNcomboBoxType, XmDROP_DOWN_LIST), n++; assert(n <= XtNumber(loc_args)); merged_args = XtMergeArgLists(args, num_args, loc_args, n); result = XtCreateWidget(name, xmComboBoxWidgetClass, parent, merged_args, n + num_args); XtFree((char *)merged_args); return result; } Widget XmVaCreateComboBox( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmComboBoxWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedComboBox( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmComboBoxWidgetClass, parent, True, var, count); va_end(var); return w; } /* * XmComboBoxAddItem * Convenience function added for CDE compatibility. Add an item * to the ComboBox list. */ void XmComboBoxAddItem(Widget widget, XmString item, int pos, Boolean unique) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmIsComboBox(widget)) { XmeWarning(widget, NOTACOMBOBOX); _XmAppUnlock(app); return; } else if (!CB_List(cb)) { _XmAppUnlock(app); return; } /* If requested, scan for duplicate items. */ if (unique && item && XmListItemExists(CB_List(cb), item)) { _XmAppUnlock(app); return; } /* Add the item to the list and update our selected_position. */ XmListAddItemUnselected(CB_List(cb), item, pos); XmComboBoxUpdate(widget); _XmAppUnlock(app); } /* * XmComboBoxDeletePos * Convenience function added for CDE compatibility. Delete the * list item at the indicated position. */ void XmComboBoxDeletePos(Widget widget, int pos) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; int selpos; int nitems; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmIsComboBox(widget)) { XmeWarning(widget, NOTACOMBOBOX); _XmAppUnlock(app); return; } else if (!CB_List(cb)) { _XmAppUnlock(app); return; } /* Validate the position. */ { Arg args[10]; Cardinal nargs; int *positions; int count; nargs = 0; XtSetArg(args[nargs], XmNitemCount, &nitems), nargs++; XtSetArg(args[nargs], XmNselectedPositions, &positions), nargs++; XtSetArg(args[nargs], XmNselectedPositionCount, &count), nargs++; assert(nargs <= XtNumber(args)); XtGetValues(CB_List(widget), args, nargs); /* Ensure that we're using a one-based position. */ selpos = (count > 0) ? *positions : 0; } /* DtComboBoxDeletePos rejects pos == 0, but we allow it. */ if ((pos < 0) || (pos > nitems) || (nitems <= 0)) { XmeWarning(widget, DELETEBADPOS); _XmAppUnlock(app); return; } /* Delete this item. */ XmListDeletePos(CB_List(cb), pos); /* If our selected item just got deleted select seomthing else. */ if ((pos ? pos : nitems) == selpos) { if (nitems > 1) { /* Invoke the callbacks now. */ XmListSelectPos(CB_List(cb), selpos, True); } else { /* The list is now empty. */ CB_TextChanged(cb) = FALSE; XmComboBoxUpdate(widget); CB_TextChanged(cb) = FALSE; } } _XmAppUnlock(app); } /* * XmComboBoxSelectItem * Convenience function added for CDE compatibility. Select the * indicated item. Do not invoke the callbacks or scroll the list. */ void XmComboBoxSelectItem(Widget widget, XmString item) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; int pos; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmIsComboBox(widget)) { XmeWarning(widget, NOTACOMBOBOX); _XmAppUnlock(app); return; } else if (!CB_List(cb)) { _XmAppUnlock(app); return; } /* Calculate the position of this item. */ pos = XmListItemPos(CB_List(cb), item); if (pos > 0) { /* Select the indicated item. */ XmListDeselectAllItems(CB_List(cb)); XmListSelectPos(CB_List(cb), pos, FALSE); /* Discard user changes to the edit box and suppress all callbacks. */ CB_TextChanged(cb) = FALSE; XmComboBoxUpdate(widget); CB_TextChanged(cb) = FALSE; } else XmeWarning(widget, SELECTBADITEM); _XmAppUnlock(app); } /* * XmComboBoxSetItem * Convenience function added for CDE compatibility. Select the * indicated item and force it to be visible. Do not invoke the callbacks. */ void XmComboBoxSetItem(Widget widget, XmString item) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; int pos; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmIsComboBox(widget)) { XmeWarning(widget, NOTACOMBOBOX); _XmAppUnlock(app); return; } else if (!CB_List(cb)) { _XmAppUnlock(app); return; } /* Calculate the position of this item. */ pos = XmListItemPos(CB_List(cb), item); if (pos > 0) { /* Scroll the item to the top and select it. */ XmListSetPos(CB_List(cb), pos); XmListSelectPos(CB_List(cb), pos, FALSE); /* Discard user changes to the edit box and suppress all callbacks. */ CB_TextChanged(cb) = FALSE; XmComboBoxUpdate(widget); CB_TextChanged(cb) = FALSE; } else XmeWarning(widget, SETBADITEM); _XmAppUnlock(app); } /* Jim Added this function to appease the Combo Box Symbol God */ XmString XmCombinationBoxGetValue(Widget widget) { return (GetEditBoxValue(widget)); } /* * XmComboBoxUpdate() * Resynchronize internal data structures after an application * updates our children directly. */ void XmComboBoxUpdate(Widget widget) { XmComboBoxWidget cb = (XmComboBoxWidget)widget; Arg args[10]; Cardinal nargs; XmString *items; int icount; int *pos; int pcount; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmIsComboBox(widget)) { XmeWarning(widget, NOTACOMBOBOX); _XmAppUnlock(app); return; } else if (!CB_List(cb)) { _XmAppUnlock(app); return; } /* CR 8445: If no text entry is in progress echo the new list selection. */ if (!CB_TextChanged(cb)) { /* The selected item and position of the list may have changed. */ nargs = 0; XtSetArg(args[nargs], XmNselectedPositions, &pos), nargs++; XtSetArg(args[nargs], XmNselectedPositionCount, &pcount), nargs++; XtSetArg(args[nargs], XmNitems, &items), nargs++; XtSetArg(args[nargs], XmNitemCount, &icount), nargs++; assert(nargs <= XtNumber(args)); XtGetValues(CB_List(cb), args, nargs); if ((pcount > 0) && (icount > 0)) SetEditBoxValue((Widget) cb, items[pos[0] - 1]); } _XmAppUnlock(app); } motif-2.3.8/lib/Xm/XmStringSeg.c0000644000175000017500000002252712672140200013275 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: XmStringSeg.c /main/7 1995/09/19 23:13:59 cde-sun $" #endif #endif #include #include "XmI.h" #include "XmStringI.h" #include "XmRenderTI.h" /* * _XmStringGetSegment: A generalized version of XmStringGetNextSegment. * Returns char_count, and allows explicit control over peeking * and copying of data. Interleaving of calls to _XmStringGetSegment() * and XmeStringGetComponent() is supported. */ Boolean _XmStringGetSegment(_XmStringContext context, Boolean update_context, Boolean copy_data, XtPointer *text, XmStringTag *tag, XmTextType *type, XmStringTag **rendition_tags, unsigned int *tag_count, XmStringDirection *direction, Boolean *separator, unsigned char *tabs, short *char_count, XmDirection *push_before, Boolean *pop_after) { XmStringTag* perm_rends = NULL; _XmStringContextRec local_context_data; _XmStringContext local_context = context; Boolean result = FALSE; Boolean done; Boolean new_renditions; XmStringComponentType ctype; unsigned int len; XtPointer val; /* Initialize the out parameters */ if (text) *text = NULL; if (tag) *tag = NULL; if (type) *type = XmCHARSET_TEXT; if (rendition_tags) *rendition_tags = NULL; if (tag_count) *tag_count = 0; if (direction) *direction = _XmStrContDir(context); /* for BC */ if (separator) *separator = False; if (tabs) *tabs = 0; if (char_count) *char_count = 0; if (push_before) *push_before = 0; if (pop_after) *pop_after = False; /* No NULL pointers allowed. */ if (! (context && text && tag && type && rendition_tags && tag_count && direction && separator && tabs && char_count && push_before && pop_after)) return False; if (_XmStrContError(context)) return False; /* Setup a writable context. */ if (!update_context) { local_context = &local_context_data; _XmStringContextCopy(local_context, context); } /* N.B.: This code relies on the order of components from XmeStringGetComponent()! */ done = new_renditions = FALSE; while (!done) { /* Peek at components before consuming them. */ ctype = XmeStringGetComponent(local_context, FALSE, FALSE, &len, &val); switch (ctype) { case XmSTRING_COMPONENT_LAYOUT_PUSH: if (*tabs || *text) done = TRUE; else *push_before = *((XmDirection *) val); break; case XmSTRING_COMPONENT_RENDITION_BEGIN: if (*text) done = TRUE; else if (*tabs) new_renditions = TRUE; break; case XmSTRING_COMPONENT_CHARSET: case XmSTRING_COMPONENT_LOCALE: if (*text) done = TRUE; else *tag = (XmStringTag) val; break; case XmSTRING_COMPONENT_TAB: if (*text) done = TRUE; else { /* Save the renditions now. */ if ((*tag_count == 0) && _XmStrContRendCount(local_context)) { *tag_count = _XmStrContRendCount(local_context); if (copy_data) { int tmp; *rendition_tags = (XmStringTag *) XtMalloc(sizeof(XmStringTag) * *tag_count); for (tmp = 0; tmp < *tag_count; tmp++) (*rendition_tags)[tmp] = XtNewString(_XmStrContRendTags(local_context)[tmp]); } else { perm_rends = (XmStringTag *) XtMalloc(sizeof(XmStringTag) * *tag_count); memcpy((char*) perm_rends, _XmStrContRendTags(local_context), sizeof(XmStringTag) * *tag_count); *rendition_tags = perm_rends; } } /* Return at the end of this line. */ (*tabs)++; result = TRUE; } break; case XmSTRING_COMPONENT_DIRECTION: if (*text) done = TRUE; else *direction = *((XmStringDirection *) val); break; case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: if (*text) done = TRUE; else if (*tabs && new_renditions) { /* Tabs had a different set of renditions than the text, */ /* so we can't return both tabs and text at once. */ done = TRUE; } else { *char_count = len; *text = val; if (ctype == XmSTRING_COMPONENT_TEXT) *type = XmCHARSET_TEXT; else if (ctype == XmSTRING_COMPONENT_LOCALE_TEXT) *type = XmMULTIBYTE_TEXT; else if (ctype == XmSTRING_COMPONENT_WIDECHAR_TEXT) *type = XmWIDECHAR_TEXT; else { assert(FALSE); } /* Force a tag for backward compatibility with Motif 1.2 */ if (! *tag) *tag = _XmStrContTag(local_context); result = TRUE; /* Save the renditions now. */ if ((*tag_count == 0) && _XmStrContRendCount(local_context)) { *tag_count = _XmStrContRendCount(local_context); if (copy_data) { int tmp; *rendition_tags = (XmStringTag*) XtMalloc(sizeof(XmStringTag) * *tag_count); for (tmp = 0; tmp < *tag_count; tmp++) (*rendition_tags)[tmp] = XtNewString(_XmStrContRendTags(local_context)[tmp]); } else { perm_rends = (XmStringTag *) XtMalloc(sizeof(XmStringTag) * *tag_count); memcpy((char*) perm_rends, _XmStrContRendTags(local_context), sizeof(XmStringTag) * *tag_count); *rendition_tags = perm_rends; } } } break; case XmSTRING_COMPONENT_RENDITION_END: break; case XmSTRING_COMPONENT_LAYOUT_POP: if (*tabs || *text) { /* We're almost done, so record this pop. */ *pop_after = TRUE; } else { /* We're ignoring this pop, so discard any recorded push. */ *push_before = 0; } break; case XmSTRING_COMPONENT_SEPARATOR: if (*tabs || *text) { *separator = TRUE; done = TRUE; } break; case XmSTRING_COMPONENT_END: default: done = TRUE; break; } /* Consume the component if we aren't done. */ if (!done) (void) XmeStringGetComponent(local_context, TRUE, FALSE, &len, &val); } if (copy_data && result) { /* Copy the tag. */ if (*tag) *tag = XtNewString(*tag); /* Copy the text. */ if (*text) { char *tmp = XtMalloc(*char_count + sizeof(wchar_t)); memcpy(tmp, *text, *char_count); bzero(tmp + *char_count, sizeof(wchar_t)); *text = (XtPointer) tmp; } } /* Free the local context. */ if (local_context == &local_context_data) _XmStringContextFree(local_context); return result; } Boolean _XmStringGetNextSegment( _XmStringContext context, XmStringTag *tag, XmStringDirection *direction, char **text, short *char_count, Boolean *separator ) { Boolean result; XmTextType type; XmStringTag * rendition_tags; unsigned int tag_count; unsigned char tabs; XmDirection push_before; Boolean pop_after; /* Get all the fields and discard the ones we don't want. */ result = _XmStringGetSegment(context, True, True, (XtPointer*) text, tag, &type, &rendition_tags, &tag_count, direction, separator, &tabs, char_count, &push_before, &pop_after); if (result) { if (rendition_tags) { while (tag_count-- > 0) XtFree((char*) rendition_tags[tag_count]); XtFree((char*) rendition_tags); } if (type == XmWIDECHAR_TEXT && *text) { /* must convert (this should be done in segment's locale instead) */ int len; wchar_t *wtext = (wchar_t *)(*text); /* should be enough */ len = ((*char_count)*MB_CUR_MAX)/sizeof(wchar_t); *text = (char *)XtMalloc(len+1); *char_count = wcstombs(*text, wtext, len); if ((*char_count) == (size_t)-1) { result = False; XtFree(*text); *text = NULL; XtFree((char *)*tag); *tag = NULL; } else (*text)[*char_count] = '\0'; XtFree((char *)wtext); } } return result; } /* * fetch the next 'segment' of the external TCS */ Boolean XmStringGetNextSegment(XmStringContext context, char **text, XmStringTag *tag, XmStringDirection *direction, Boolean *separator ) { short char_count; Boolean ret_val; _XmProcessLock(); ret_val = _XmStringGetNextSegment((_XmStringContext)context, tag, direction, text, &char_count, separator); _XmProcessUnlock(); return ret_val; } motif-2.3.8/lib/Xm/DropSMgrP.h0000644000175000017500000002064213145162623012712 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDropSMgrP_h #define _XmDropSMgrP_h #include #include #ifdef __cplusplus extern "C" { #endif typedef void (*XmDSMCreateInfoProc) (XmDropSiteManagerObject, Widget, ArgList, Cardinal); typedef void (*XmDSMDestroyInfoProc) (XmDropSiteManagerObject, Widget); typedef void (*XmDSMStartUpdateProc) (XmDropSiteManagerObject, Widget); typedef void (*XmDSMRetrieveInfoProc) (XmDropSiteManagerObject, Widget, ArgList, Cardinal); typedef void (*XmDSMUpdateInfoProc) (XmDropSiteManagerObject, Widget, ArgList, Cardinal); typedef void (*XmDSMEndUpdateProc) (XmDropSiteManagerObject, Widget); typedef void (*XmDSMUpdateProc) (XmDropSiteManagerObject, XtPointer, XtPointer); typedef void (*XmDSMProcessMotionProc) (XmDropSiteManagerObject, XtPointer, XtPointer); typedef void (*XmDSMProcessDropProc) (XmDropSiteManagerObject, XtPointer, XtPointer); typedef void (*XmDSMOperationChangedProc) (XmDropSiteManagerObject, XtPointer, XtPointer); typedef void (*XmDSMChangeRootProc) (XmDropSiteManagerObject, XtPointer, XtPointer); typedef void (*XmDSMInsertInfoProc) (XmDropSiteManagerObject, XtPointer, XtPointer); typedef void (*XmDSMRemoveInfoProc) (XmDropSiteManagerObject, XtPointer); typedef void (*XmDSMSyncTreeProc) (XmDropSiteManagerObject, Widget); typedef int (*XmDSMGetTreeFromDSMProc) (XmDropSiteManagerObject, Widget, XtPointer); typedef void (*XmDSMCreateDSInfoTable) (XmDropSiteManagerObject); typedef void (*XmDSMDestroyDSInfoTable) (XmDropSiteManagerObject); typedef void (*XmDSMRegisterInfoProc) (XmDropSiteManagerObject, Widget, XtPointer); typedef XtPointer (*XmDSMWidgetToInfoProc) (XmDropSiteManagerObject, Widget); typedef void (*XmDSMUnregisterInfoProc) (XmDropSiteManagerObject, XtPointer); typedef struct { XmDSMCreateInfoProc createInfo; XmDSMDestroyInfoProc destroyInfo; XmDSMStartUpdateProc startUpdate; XmDSMRetrieveInfoProc retrieveInfo; XmDSMUpdateInfoProc updateInfo; XmDSMEndUpdateProc endUpdate; /* Used by DragController Object */ XmDSMUpdateProc updateDSM; /* Used by update proc */ XmDSMProcessMotionProc processMotion; XmDSMProcessDropProc processDrop; XmDSMOperationChangedProc operationChanged; XmDSMChangeRootProc changeRoot; /* Used to manage DropSites */ XmDSMInsertInfoProc insertInfo; /* Need a get and a put function for update? */ XmDSMRemoveInfoProc removeInfo; /* Used to manage the pre-register information */ XmDSMSyncTreeProc syncTree; XmDSMGetTreeFromDSMProc getTreeFromDSM; /* Used to hash between widgets and info */ XmDSMCreateDSInfoTable createTable; XmDSMDestroyDSInfoTable destroyTable; XmDSMRegisterInfoProc registerInfo; XmDSMWidgetToInfoProc widgetToInfo; XmDSMUnregisterInfoProc unregisterInfo; XtPointer extension; } XmDropSiteManagerClassPart; /* Full class record declaration for dropSite class */ typedef struct _XmDropSiteManagerClassRec{ ObjectClassPart object_class; XmDropSiteManagerClassPart dropManager_class; } XmDropSiteManagerClassRec; externalref XmDropSiteManagerClassRec xmDropSiteManagerClassRec; /* Macros for calling methods */ #define DSMCreateInfo(dsm, widget, args, numArgs) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.createInfo) \ ((dsm), (widget), (args), (numArgs)) #define DSMDestroyInfo(dsm, widget) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.destroyInfo) \ ((dsm), (widget)) #define DSMStartUpdate(dsm, widget) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.startUpdate) \ ((dsm), (widget)) #define DSMRetrieveInfo(dsm, widget, args, numArgs) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.retrieveInfo) \ ((dsm), (widget), (args), (numArgs)) #define DSMUpdateInfo(dsm, widget, args, numArgs) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.updateInfo) \ ((dsm), (widget), (args), (numArgs)) #define DSMEndUpdate(dsm, widget) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.endUpdate) \ ((dsm), (widget)) #define DSMUpdate(dsm, clientData, callData) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.updateDSM) \ ((dsm), (clientData), (callData)) #define DSMProcessMotion(dsm, clientData, callData) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.processMotion) \ ((dsm), (clientData), (callData)) #define DSMProcessDrop(dsm, clientData, callData) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.processDrop) \ ((dsm),(clientData), (callData)) #define DSMOperationChanged(dsm, clientData, callData) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.operationChanged) \ ((dsm),(clientData), (callData)) #define DSMChangeRoot(dsm, clientData, callData) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.changeRoot) \ ((dsm), (clientData), (callData)) #define DSMInsertInfo(dsm, info, call_data) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.insertInfo) \ ((dsm), (info), (call_data)) #define DSMRemoveInfo(dsm, info) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.removeInfo) \ ((dsm), (info)) #define DSMSyncTree(dsm, shell) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.syncTree) \ ((dsm), (shell)) #define DSMGetTreeFromDSM(dsm, shell, dataPtr) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.getTreeFromDSM) \ ((dsm), (shell), (dataPtr)) #define DSMCreateTable(dsm) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.createTable) \ ((dsm)) #define DSMDestroyTable(dsm) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.destroyTable) \ ((dsm)) #define DSMRegisterInfo(dsm, widget, info) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.registerInfo) \ ((dsm), (widget), (info)) #define DSMWidgetToInfo(dsm, widget) \ (XtPointer) ((((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.widgetToInfo) \ ((dsm), (widget))) #define DSMUnregisterInfo(dsm, info) \ (((XmDropSiteManagerObjectClass) XtClass(dsm))-> \ dropManager_class.unregisterInfo) \ ((dsm), (info)) /* Internal update struct */ typedef struct __XmDropSiteUpdateInfoRec { XmDropSiteManagerObject dsm; Widget refWidget; struct __XmDropSiteUpdateInfoRec *next; } _XmDropSiteUpdateInfoRec, *_XmDropSiteUpdateInfo; /* DropSiteManager instance record */ typedef struct _XmDropSiteManagerPart{ XtCallbackProc notifyProc; XtCallbackProc treeUpdateProc; XtPointer client_data; XtPointer dragUnderData; XtPointer curInfo; Time curTime; Position curX, curY, oldX, oldY; unsigned char curDropSiteStatus; Widget curDragContext; Boolean curAnimate; unsigned char curOperations; unsigned char curOperation; XmRegion curAncestorClipRegion; XmRegion newAncestorClipRegion; XtPointer dsTable; XtPointer dsRoot; Position rootX, rootY; Dimension rootW, rootH; XtPointer clipperList; _XmDropSiteUpdateInfo updateInfo; XtIntervalId updateTimeOutId; } XmDropSiteManagerPart, *XmDropSiteManagerPartPtr; /* Full instance record declaration */ typedef struct _XmDropSiteManagerRec{ ObjectPart object; XmDropSiteManagerPart dropManager; } XmDropSiteManagerRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDropSMgrP_h */ motif-2.3.8/lib/Xm/TearOffBP.h0000644000175000017500000000612713145162623012647 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * TearOffBP.h - Private definitions for TearOffButton widget * (Used by RowColumn Tear Off Menupanes) * */ #ifndef _XmTearOffBP_h #define _XmTearOffBP_h #include #ifdef __cplusplus extern "C" { #endif /***************************************************************************** * * TearOffButton Widget Private Data * *****************************************************************************/ /* New fields for the TearOffButton widget class record */ typedef struct _XmTearOffButtonClassPart { String translations; } XmTearOffButtonClassPart; /* Full Class record declaration */ typedef struct _XmTearOffButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmLabelClassPart label_class; XmPushButtonClassPart pushbutton_class; XmTearOffButtonClassPart tearoffbutton_class; } XmTearOffButtonClassRec; typedef struct _XmTearOffButtonClassRec *XmTearOffButtonWidgetClass; externalref XmTearOffButtonClassRec xmTearOffButtonClassRec; /* New fields for the TearOffButton widget record */ typedef struct { Dimension margin; unsigned char orientation; unsigned char separator_type; GC separator_GC; Boolean set_recompute_size; } XmTearOffButtonPart; /***************************************************************************** * * Full instance record declaration * ****************************************************************************/ typedef struct _XmTearOffButtonRec { CorePart core; XmPrimitivePart primitive; XmLabelPart label; XmPushButtonPart pushbutton; XmTearOffButtonPart tear_off_button; } XmTearOffButtonRec; typedef struct _XmTearOffButtonRec *XmTearOffButtonWidget; /* Class Record Constant */ externalref WidgetClass xmTearOffButtonWidgetClass; #ifndef XmIsTearOffButton #define XmIsTearOffButton(w) XtIsSubclass(w, xmTearOffButtonWidgetClass) #endif /* XmIsTearOffButton */ /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTearOffButtonP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/xmstring.list.in0000644000175000017500000006522013145162623014102 00000000000000! $TOG: xmstring.list /main/5 1997/06/20 08:37:02 samborn $ #prefix Xm #const _Xm #feature XMSTRINGDEFINES #externref externalref #externdef externaldef(_xmstrings) #ctmpl XmStrDefs.ct #file XmStrDefs.h #table _XmStrings #htmpl XmStrDefs.ht S CAccelerator CAcceleratorText CAdjustLast CAdjustMargin CAlignment CAllowOverlap @OM22_COMPATIBILITY_TRUE@CAllowUnusedSpace CAnimationMask CAnimationPixmap CAnimationPixmapDepth CAnimationStyle CApplyLabelString CArmCallback CArmColor CArmPixmap CArrowDirection CAttachment CAudibleWarning CAutoShowCursorPosition CAutoUnmanage CAutomaticSelection CAvailability CBackgroundPixmap CBlendModel CBlinkRate CBottomShadowColor CBottomShadowPixmap CButtonAcceleratorText CButtonAccelerators CButtonCount CButtonFontList CButtonMnemonicCharSets CButtonMnemonics CButtonSet CButtonType CButtons CCancelLabelString CChildHorizontalAlignment CChildHorizontalSpacing CChildPlacement CChildType CChildVerticalAlignment CChildren CClientData CClipWindow CColumns CCommandWindow CCommandWindowLocation CConvertProc CCursorBackground CCursorForeground CCursorPosition CCursorPositionVisible CDarkThreshold CDecimalPoints CDefaultButtonShadowThickness CDefaultButtonType CDefaultCopyCursorIcon CDefaultFontList CDefaultInvalidCursorIcon CDefaultLinkCursorIcon CDefaultMoveCursorIcon CDefaultNoneCursorIcon CDefaultPosition CDefaultSourceCursorIcon CDefaultValidCursorIcon CDeleteResponse CDesktopParent CDialogStyle CDialogTitle CDialogType CDirListItemCount CDirListItems CDirListLabelString CDirMask CDirSearchProc CDirSpec CDirectory CDirectoryValid CDisarmCallback CDoubleClickInterval CDragContextClass CDragDropFinishCallback CDragIconClass CDragInitiatorProtocolStyle CDragMotionCallback CDragOperations CDragOverMode CDragProc CDragReceiverProtocolStyle CDropProc CDropRectangles CDropSiteActivity CDropSiteEnterCallback CDropSiteLeaveCallback CDropSiteManagerClass CDropSiteOperations CDropSiteType CDropStartCallback CDropTransferClass CDropTransfers CEditable CEntryBorder CEntryClass CExportTargets CExposeCallback CExtensionType CFileListItemCount CFileListItems CFileListLabelString CFileSearchProc CFileTypeMask CFillOnArm CFillOnSelect CFilterLabelString CFontList CForegroundThreshold CHelpLabelString CHighlightColor CHighlightOnEnter CHighlightPixmap CHighlightThickness CHorizontalFontUnit CHorizontalScrollBar CHot CICCHandle CImportTargets CIncrement CIncremental CIndicatorOn CIndicatorSize CIndicatorType CInitialDelay CInitialFocus CInputCreate CInputMethod CInvalidCursorForeground CIsAligned CIsHomogeneous CItemCount CItems CKeyboardFocusPolicy CLabelFontList CLabelInsensitivePixmap CLabelPixmap CLabelString CLabelType CLightThreshold CListLabelString CListMarginHeight CListMarginWidth CListSizePolicy CListSpacing CListUpdated CLogicalParent CMainWindowMarginHeight CMainWindowMarginWidth CMappingDelay CMarginBottom CMarginHeight CMarginLeft CMarginRight CMarginTop CMarginWidth CMask CMaxItems CMaxLength CMaxValue CMaximum CMenuBar CMenuPost CMenuWidget CMessageProc CMessageWindow CMinimizeButtons CMinimum CMnemonic CMnemonicCharSet CMoveOpaque CMultiClick CMustMatch CMwmDecorations CMwmFunctions CMwmInputMode CMwmMenu CMwmMessages CNavigationType CNeedsMotion CNoMatchString CNoResize CNoneCursorForeground CNotifyProc CNumChildren CNumColumns CNumDropRectangles CNumDropTransfers CNumExportTargets CNumImportTargets COffset COkLabelString COperationChangedCallback COperationCursorIcon COptionLabel COptionMnemonic COutputCreate CPacking CPageIncrement CPaneMaximum CPaneMinimum CPattern CPendingDelete CPopupEnabled CPositionIndex CPostFromButton CPostFromCount CPostFromList CPreeditType CProcessingDirection CPromptString CProtocolCallback CPushButtonEnabled CQualifySearchDataProc CRadioAlwaysOne CRadioBehavior CRecomputeSize CRectangles CRepeatDelay CResizeCallback CResizeHeight CResizePolicy CResizeWidth CRowColumnType CRows CRubberPositioning CSashHeight CSashIndent CSashWidth CScaleHeight CScaleMultiple CScaleWidth CScroll CScrollBarDisplayPolicy CScrollBarPlacement CScrollSide CScrolledWindowMarginHeight CScrolledWindowMarginWidth CScrollingPolicy CSelectColor CSelectInsensitivePixmap CSelectPixmap CSelectThreshold CSelectedItemCount CSelectedItems CSelectionArrayCount CSelectionLabelString CSelectionPolicy CSeparatorOn CSeparatorType CSet CShadowThickness CShadowType CShellUnitType CShowArrows CShowAsDefault CShowSeparator CShowValue CSimpleCheckBox CSimpleMenuBar CSimpleOptionMenu CSimplePopupMenu CSimplePulldownMenu CSimpleRadioBox CSizePolicy CSliderSize CSource CSourceCursorIcon CSourceIsExternal CSourcePixmapIcon CSourceWidget CSourceWindow CSpacing CStartTime CStateCursorIcon CStringDirection CTearOffModel CTextFontList CTextString CTextValue CTitleString CTopCharacter CTopItemPosition CTopLevelEnterCallback CTopLevelLeaveCallback CTopShadowColor CTopShadowPixmap CTransferProc CTransferStatus CTraversalOn CTraversalType CTreeUpdateProc CTroughColor CUnitType CUnpostBehavior CUnselectPixmap CUpdateSliderSize CUseAsyncGeometry CUserData CValidCursorForeground CValueChangedCallback CValueWcs CVerifyBell CVerticalAlignment CVerticalFontUnit CVerticalScrollBar CVisibleItemCount CVisibleWhenOff CVisualPolicy CWhichButton CWordWrap CWorkWindow CXmString Naccelerator NacceleratorText NactivateCallback NadjustLast NadjustMargin Nalignment NallowOverlap NallowResize @OM22_COMPATIBILITY_TRUE@NallowUnusedSpace NanimationMask NanimationPixmap NanimationPixmapDepth NanimationStyle NapplyCallback NapplyLabelString NarmCallback NarmColor NarmPixmap NarrowDirection Nattachment NaudibleWarning NautoShowCursorPosition NautoUnmanage NautomaticSelection Navailability NblendModel NblinkRate NbottomAttachment NbottomOffset NbottomPosition NbottomShadowColor NbottomShadowPixmap NbottomWidget NbrowseSelectionCallback NbuttonAcceleratorText NbuttonAccelerators NbuttonCount NbuttonFontList NbuttonMnemonicCharSets NbuttonMnemonics NbuttonSet NbuttonType Nbuttons NcancelButton NcancelCallback NcancelLabelString NcascadePixmap NcascadingCallback NchildHorizontalAlignment NchildHorizontalSpacing NchildPlacement NchildPosition NchildType NchildVerticalAlignment NclientData NclipWindow Ncolumns Ncommand NcommandChangedCallback NcommandEnteredCallback NcommandWindow NcommandWindowLocation NconvertProc NcursorBackground NcursorForeground NcursorPosition NcursorPositionVisible NdarkThreshold NdecimalPoints NdecrementCallback NdefaultActionCallback NdefaultButton NdefaultButtonShadowThickness NdefaultButtonType NdefaultCopyCursorIcon NdefaultFontList NdefaultInvalidCursorIcon NdefaultLinkCursorIcon NdefaultMoveCursorIcon NdefaultNoneCursorIcon NdefaultPosition NdefaultSourceCursorIcon NdefaultValidCursorIcon NdeleteResponse NdesktopParent NdialogStyle NdialogTitle NdialogType NdirListItemCount NdirListItems NdirListLabelString NdirMask NdirSearchProc NdirSpec Ndirectory NdirectoryValid NdisarmCallback NdoubleClickInterval NdragCallback NdragContextClass NdragDropFinishCallback NdragIconClass NdragInitiatorProtocolStyle NdragMotionCallback NdragOperations NdragOverMode NdragProc NdragReceiverProtocolStyle NdropFinishCallback NdropProc NdropRectangles NdropSiteActivity NdropSiteEnterCallback NdropSiteLeaveCallback NdropSiteManagerClass NdropSiteOperations NdropSiteType NdropStartCallback NdropTransferClass NdropTransfers NeditMode Neditable NentryAlignment NentryBorder NentryCallback NentryClass NentryVerticalAlignment NexportTargets NexposeCallback NextendedSelectionCallback NextensionType NfileListItemCount NfileListItems NfileListLabelString NfileSearchProc NfileTypeMask NfillOnArm NfillOnSelect NfilterLabelString NfocusCallback NfocusMovedCallback NfocusPolicyChanged NfontList NforegroundThreshold NfractionBase NgainPrimaryCallback NhelpCallback NhelpLabelString NhighlightColor NhighlightOnEnter NhighlightPixmap NhighlightThickness NhistoryItemCount NhistoryItems NhistoryMaxItems NhistoryVisibleItemCount NhorizontalFontUnit NhorizontalScrollBar NhorizontalSpacing NhotX NhotY NiccHandle NimportTargets Nincrement NincrementCallback Nincremental NindicatorOn NindicatorSize NindicatorType NinitialDelay NinitialFocus NinputCallback NinputCreate NinputMethod NinvalidCursorForeground NisAligned NisHomogeneous NitemCount Nitems NkeyboardFocusPolicy NlabelFontList NlabelInsensitivePixmap NlabelPixmap NlabelString NlabelType NleftAttachment NleftOffset NleftPosition NleftWidget NlightThreshold NlineSpace NlistItemCount NlistItems NlistLabelString NlistMarginHeight NlistMarginWidth NlistSizePolicy NlistSpacing NlistUpdated NlistVisibleItemCount NlogicalParent NlosePrimaryCallback NlosingFocusCallback NmainWindowMarginHeight NmainWindowMarginWidth NmapCallback NmappingDelay Nmargin NmarginBottom NmarginHeight NmarginLeft NmarginRight NmarginTop NmarginWidth Nmask NmaxLength Nmaximum NmenuAccelerator NmenuBar NmenuCursor NmenuHelpWidget NmenuHistory NmenuPost NmessageAlignment NmessageProc NmessageString NmessageWindow NminimizeButtons Nminimum Nmnemonic NmnemonicCharSet NmodifyVerifyCallback NmodifyVerifyCallbackWcs NmotionVerifyCallback NmoveOpaque NmultiClick NmultipleSelectionCallback NmustMatch NmwmDecorations NmwmFunctions NmwmInputMode NmwmMenu NmwmMessages NnavigationType NneedsMotion NnoMatchCallback NnoMatchString NnoResize NnoneCursorForeground NnotifyProc NnumColumns NnumDropRectangles NnumDropTransfers NnumExportTargets NnumImportTargets NnumRectangles NoffsetX NoffsetY NokCallback NokLabelString NoperationChangedCallback NoperationCursorIcon NoptionLabel NoptionMnemonic NoutputCreate Npacking NpageDecrementCallback NpageIncrement NpageIncrementCallback NpaneMaximum NpaneMinimum Npattern NpendingDelete NpopupEnabled NpositionIndex NpostFromButton NpostFromCount NpostFromList NpreeditType NprocessingDirection NpromptString NprotocolCallback NpushButtonEnabled NqualifySearchDataProc NradioAlwaysOne NradioBehavior NrealizeCallback NrecomputeSize Nrectangles NrefigureMode NrepeatDelay Nresizable NresizeCallback NresizeHeight NresizePolicy NresizeWidth NrightAttachment NrightOffset NrightPosition NrightWidget NrowColumnType Nrows NrubberPositioning NsashHeight NsashIndent NsashShadowThickness NsashWidth NscaleHeight NscaleMultiple NscaleWidth NscrollBarDisplayPolicy NscrollBarPlacement NscrollHorizontal NscrollLeftSide NscrollTopSide NscrollVertical NscrolledWindowMarginHeight NscrolledWindowMarginWidth NscrollingPolicy NselectColor NselectInsensitivePixmap NselectPixmap NselectThreshold NselectedItemCount NselectedItems NselectionArrayCount NselectionLabelString NselectionPolicy NseparatorOn NseparatorType Nset Nshadow NshadowThickness NshadowType NshellUnitType NshowArrows NshowAsDefault NshowSeparator NshowValue NsimpleCallback NsingleSelectionCallback NsizePolicy NskipAdjust NsliderSize Nsource NsourceCursorIcon NsourceIsExternal NsourcePixmapIcon NsourceWidget NsourceWindow Nspacing NspotLocation NstartTime NstateCursorIcon NstringDirection NsubMenuId NsymbolPixmap NtearOffMenuActivateCallback NtearOffMenuDeactivateCallback NtearOffModel NtextAccelerators NtextColumns NtextFontList NtextString NtextTranslations NtextValue NtitleString NtoBottomCallback NtoPositionCallback NtoTopCallback NtopAttachment NtopCharacter NtopItemPosition NtopLevelEnterCallback NtopLevelLeaveCallback NtopOffset NtopPosition NtopShadowColor NtopShadowPixmap NtopWidget NtransferProc NtransferStatus NtraversalCallback NtraversalOn NtraversalType NtraverseObscuredCallback NtreeUpdateProc NtroughColor NunitType NunmapCallback NunpostBehavior NunselectPixmap NupdateSliderSize NuseAsyncGeometry NuserData NvalidCursorForeground NvalueChangedCallback NvalueWcs NverifyBell NverticalFontUnit NverticalScrollBar NverticalSpacing NvisibleItemCount NvisibleWhenOff NvisualPolicy NwhichButton NwordWrap NworkWindow RAlignment RAnimationMask RAnimationPixmap RAnimationStyle RArrowDirection RAtomList RAttachment RAudibleWarning RAvailability RBackgroundPixmap RBlendModel RBooleanDimension RBottomShadowPixmap RButtonType RCallbackProc RChar RCharSetTable RChildHorizontalAlignment RChildPlacement RChildType RChildVerticalAlignment RCommandWindowLocation RCompoundText RDefaultButtonType RDeleteResponse RDialogStyle RDialogType RDoubleClickInterval RDragInitiatorProtocolStyle RDragReceiverProtocolStyle RDropSiteActivity RDropSiteOperations RDropSiteType RDropTransfers RExtensionType RFileTypeMask RFontList RGadgetPixmap RHighlightPixmap RHorizontalDimension RHorizontalInt RHorizontalPosition RIconAttachment RImportTargets RIndicatorType RItemCount RItems RKeySym RKeySymTable RKeyboardFocusPolicy RLabelType RListMarginHeight RListMarginWidth RListSizePolicy RListSpacing RManBottomShadowPixmap RManForegroundPixmap RManHighlightPixmap RManTopShadowPixmap RMenuWidget RMnemonic RMultiClick RNavigationType RPacking RPrimForegroundPixmap RProc RProcessingDirection RRectangleList RResizePolicy RRowColumnType RScrollBarDisplayPolicy RScrollBarPlacement RScrollingPolicy RSelectedItemCount RSelectedItems RSelectionPolicy RSelectionType RSeparatorType RShadowType RShellHorizDim RShellHorizPos RShellUnitType RShellVertDim RShellVertPos RSizePolicy RStringDirection RTearOffModel RTopShadowPixmap RTransferStatus RTraversalType RUnitType RUnpostBehavior RValueWcs RVerticalAlignment RVerticalDimension RVerticalInt RVerticalPosition RVirtualBinding RVisibleItemCount RVisualPolicy RWhichButton RXmBackgroundPixmap RXmString RXmStringCharSet RXmStringTable VosfActivate VosfAddMode VosfBackSpace VosfBeginLine VosfCancel VosfClear VosfCopy VosfCut VosfDelete VosfDown VosfEndLine VosfHelp VosfInsert VosfLeft VosfMenu VosfMenuBar VosfPageDown VosfPageLeft VosfPageRight VosfPageUp VosfPaste VosfPrimaryPaste VosfQuickPaste VosfRight VosfSelect VosfUndo VosfUp SFONTLIST_DEFAULT_TAG_STRING SXmFONTLIST_DEFAULT_TAG_STRING RTopItemPosition #table _XmStrings20 NtearOffTitle CTearOffTitle NpopupHandlerCallback NconvertCallback NdestinationCallback NselectedItem CSelectedItem NselectionCallback NmatchBehavior CMatchBehavior NnoFontCallback NtextPath NeditingPath CEditingPath NbidirectionalCursor CBidirectionalCursor NcollapsedStatePixmap NdetailColumnHeading NdetailCount NdetailTabList NexpandedStatePixmap NlargeCellHeight NlargeCellWidth NlayoutType NoutlineIndentation NoutlineLineStyle NprimaryOwnership NselectionTechnique NsmallCellHeight NsmallCellWidth NspatialStyle NentryParent NlargeIconX NlargeIconY NsmallIconX NsmallIconY CCollapsedStatePixmap CDetailColumnHeading CDetailCount CDetailMask CEntryViewType CLineStyle CDetailTabList CExpandedStatePixmap CIncludeModel CCellHeight CCellWidth CLayoutType COutlineIndentation CPlaceModel CPrimaryOwnership CSelectionTechnique CSpatialStyle CEntryDetail CExpandState NlargeIcon NlargeIconMask NlargeIconPixmap NsmallIcon NsmallIconMask NsmallIconPixmap CIcon CViewType CVisualEmphasis NcurrentPageNumber NfirstPageNumber NlastPageNumber NbackPagePlacement NbackPageNumber NbackPageSize NbackPageForeground NbackPageBackground NframeBackground NbindingType NbindingPixmap NbindingWidth NmajorTabSpacing NminorTabSpacing NinnerMarginWidth NinnerMarginHeight NframeShadowThickness NpageNumber CCurrentPageNumber CFirstPageNumber CLastPageNumber CBackPagePlacement CBackPageNumber CBackPageSize CBackPageForeground CBackPageBackground CFrameBackground CBindingType CBindingPixmap CBindingWidth CMajorTabSpacing CMinorTabSpacing CInnerMarginWidth CInnerMarginHeight CPageChangeCallback CPageNumber RArrowLayout RArrowSensitivity RSpinBoxChildType NarrowLayout CArrowLayout NarrowSensitivity CArrowSensitivity NdefaultArrowSensitivity CDefaultArrowSensitivity NarrowSize CArrowSize NspinBoxChildType CSpinBoxChildType Nposition NnumValues CNumValues Nvalues CValues NminimumValue CMinimumValue NmaximumValue CMaximumValue NincrementValue CIncrementValue RAutomaticSelection RLineStyle REntryViewType RDirection RLayoutType RPrimaryOwnership RSelectionTechnique RSpatialStyle RTabList RViewType RVisualEmphasis RBindingType RNBChildType NentryViewType NinsensitiveStippleBitmap NlayoutDirection NviewType NvisualEmphasis CLayoutDirection NsnapBackMultiple NslidingMode NsliderVisual NautoDragModel NcolorCalculationProc NbitmapConversionModel NcolorAllocationProc NselectionMode NselectedPositions NselectedPositionCount CSnapBackMultiple CSliderVisual CSlidingMode CAutoDragModel CColorCalculationProc CBitmapConversionModel CColorAllocationProc CInsensitiveStippleBitmap CSelectionMode CSelectedPositions CSelectedPositionCount RSlidingMode RShowArrows RSliderVisual RShowValue RAutoDragModel RSWChildType RBitmapConversionModel RSelectionMode NinputPolicy CInputPolicy RInputPolicy NtoggleMode CToggleMode RToggleMode RIndicatorOn RSet NindeterminatePixmap CIndeterminatePixmap NunselectColor CUnselectColor NselectedPosition NarrowSpacing CArrowSpacing RMatchBehavior RComboBoxType CSelectedPosition NenableWarp CEnableWarp REnableWarp NmotifVersion CMotifVersion NdefaultGlyphPixmap CDefaultGlyphPixmap CRendition Ntag CTag NfontName CFontName NfontType CFontType RFontType NloadModel CLoadModel RLoadModel NtabList CTabList RRenditionPixel NunderlineType CUnderlineType NstrikethruType CStrikethruType RLineType NrenderTable CRenderTable RRenderTable NbuttonRenderTable CButtonRenderTable RButtonRenderTable NlabelRenderTable CLabelRenderTable RLabelRenderTable NtextRenderTable CTextRenderTable RTextRenderTable NdragStartCallback NnoRenditionCallback SXmAS_IS MIsWhiteSpaceMethod MIsScanBreakMethod MCharDirection MInitialCharsDirection NpatternType Nsubstitute NinvokeParseProc NincludeStatus VosfBackTab VosfBeginData VosfDeselectAll VosfEndData VosfEscape VosfExtend VosfLeftLine VosfNext VosfNextField VosfNextMenu VosfNextMinor VosfPrevField VosfPrevMenu VosfPrior VosfPriorMinor VosfReselect VosfRestore VosfRightLine VosfSelectAll VosfSwitchDirection NnotebookChildType CNotebookChildType RNotebookChildType NscrolledWindowChildType CScrolledWindowChildType RScrolledWindowChildType NselectedObjects CSelectedObjects NselectedObjectCount CSelectedObjectCount NcomboBoxType CComboBoxType NtabValue NoffsetModel Ndecimal Ndetail CDetail NdetailCount CDetailCount NcontainerID CContainerID SCLIENT_WINDOW SCLIP_TEMPORARY SCLIPBOARD SCOMPOUND_TEXT SDELETE SFILE SFILE_NAME SINCR SINSERT_PROPERTY SINSERT_SELECTION SLENGTH SLINK_SELECTION S_MOTIF_ATOM_0 S_MOTIF_BINDINGS S_MOTIF_DEFAULT_BINDINGS S_MOTIF_CANCEL_DROP_EFFECT S_MOTIF_CLIP_HEADER S_MOTIF_CLIP_DATA_REQUEST S_MOTIF_CLIP_DATA_DELETE S_MOTIF_CLIP_ITEM S_MOTIF_CLIP_LOCK S_MOTIF_CLIP_LOCK_ACCESS_VALID S_MOTIF_CLIP_MESSAGE S_MOTIF_CLIP_NEXT_ID S_MOTIF_CLIP_TIME S_MOTIF_CLIPBOARD_TARGETS S_MOTIF_COMPOUND_STRING S_MOTIF_DEFERRED_CLIPBOARD_TARGETS S_MOTIF_DESTINATION S_MOTIF_DRAG_OFFSET S_MOTIF_DROP S_MOTIF_ENCODING_REGISTRY S_MOTIF_EXPORT_TARGETS S_MOTIF_LOSE_SELECTION S_MOTIF_RENDER_TABLE S_MOTIF_WM_QUERY S_MOTIF_WM_ALL_CLIENTS SMULTIPLE SNULL STARGETS STEXT STIMESTAMP SWM_STATE STRANSFER_SUCCESS XmTRANSFER_SUCCESS STRANSFER_FAILURE XmTRANSFER_FAILURE NpathMode RPathMode CPathMode NfileFilterStyle RFileFilterStyle CFileFilterStyle NdirTextLabelString CDirTextLabelString NenableBtn1Transfer CEnableBtn1Transfer NenableButtonTab CEnableButtonTab NenableEtchedInMenu CEnableEtchedInMenu NdefaultButtonEmphasis CDefaultButtonEmphasis RDefaultButtonEmphasis NenableToggleColor CEnableToggleColor NenableToggleVisual CEnableToggleVisual NenableDragIcon CEnableDragIcon NenableUnselectableDrag CEnableUnselectableDrag NdragOverActiveMode CDragOverActiveMode NinstallColormap CInstallColormap COwnerEvents NownerEvents CGrabStyle NgrabStyle NforegroundState NbackgroundState CGroundState RGroundState RSelectColor RLargeIconPixmap RSmallIconPixmap NoutlineState COutlineState ROutlineState NspatialIncludeModel CSpatialIncludeModel RSpatialIncludeModel NspatialResizeModel CSpatialResizeModel RSpatialResizeModel NspatialSnapModel CSpatialSnapModel RSpatialSnapModel NdetailColumnHeadingCount CDetailColumnHeadingCount NdetailOrder CDetailOrder RCardinalList NdetailOrderCount CDetailOrderCount NoutlineColumnWidth COutlineColumnWidth NoutlineChangedCallback COutlineChangedCallback NoutlineButtonPolicy COutlineButtonPolicy ROutlineButtonPolicy CDefaultVirtualBindings NdefaultVirtualBindings CResizable RDynamicPixmap NpageChangedCallback Narea NdetailShadowThickness NsliderMark CSliderMark RSliderMark REnableBtn1Transfer NrenditionBackground NrenditionForeground CRenditionBackground CRenditionForeground NindeterminateInsensitivePixmap CIndeterminateInsensitivePixmap NframeChildType CFrameChildType #table _XmStrings21 NtextField CTextField NenableThinThickness CEnableThinThickness NprimaryColorSetId CPrimaryColorSetId NsecondaryColorSetId CSecondaryColorSetId NtextColorSetId CTextColorSetId NactiveColorSetId CActiveColorSetId NinactiveColorSetId CInactiveColorSetId NuseColorObj CUseColorObj NuseTextColor CUseTextColor NuseTextColorForList CUseTextColorForList NuseMask CUseMask NuseMultiColorIcons CUseMultiColorIcons NuseIconFileCache CUseIconFileCache SPIXEL_SET Pixel Sets SCUSTOMIZE_DATA Customize Data: SCOLOR_SRV_NAME ColorServer Nlist CList NarrowOrientation CArrowOrientation RArrowOrientation NpositionType CPositionType RPositionType Nwrap CWrap NpositionMode CPositionMode RPositionMode NprintOrientation CPrintOrientation NprintOrientations CPrintOrientations NprintResolution CPrintResolution NprintResolutions CPrintResolutions NdefaultPixmapResolution CDefaultPixmapResolution NstartJobCallback NendJobCallback NpageSetupCallback NpdmNotificationCallback NminX NminY NmaxX NmaxY CMinX CMinY CMaxX CMaxY NpreeditStartCallback NpreeditDoneCallback NpreeditDrawCallback NpreeditCaretCallback NverifyPreedit CVerifyPreedit NenableMultiKeyBindings CEnableMultiKeyBindings RButtonFontList RLabelFontList RTextFontList SPIXEL_SET_PROP SDT Pixel Set S50_foreground Sunspecified_pixmap #file XmStrDefs22.h #table _XmStrings22 #htmpl XmStrDefs22.ht @OM22_COMPATIBILITY_FALSE@CAllowUnusedSpace @OM22_COMPATIBILITY_FALSE@NallowUnusedSpace NitemFoundCallback NitemNotFoundCallback RXmTabSide RTabSide RXmPixmapPlacement RXmPixmap RXmPixel RXmIconPlacement RXmHierarchyNodeState RXmFillOption RXmConnectStyle RXmColorMode RXmAlignment RTabStyle RTabOrientation RTabMode RTabList RTabEdge RTabArrowPlacement NxlfdString NverticalNodeSpace NverticalMargin NverifyTextFailedCallback NverifyTextCallback Nverify Nvalues NuseTextField NuseScaling NuseImageCache NupdateTextCallback NupdateShellCallback NunselectCallback NuniformTabSize NtraversalIndex NtitleString NtextString NtextRows NtearOffLabelString NtabTearOffEnabled NtabStyle NtabStringDirection NtabSide NtabSelectedCallback NtabSelectPixmap NtabSelectColor NtabPixmapPlacement NtabOrientation NtabOffset NtabMode NtabMarginWidth NtabMarginHeight NtabList NtabLabelString NtabLabelSpacing NtabLabelPixmap NtabForeground NtabEdge NtabCornerPercent NtabBoxWidget NtabBackgroundPixmap NtabBackground NtabAutoSelect NtabArrowPlacement NtabAlignment NstackedEffect NsortFunctions NsliderTogLabel NsizeString NshowValue NshowSash NshowNameString NshowLabel NshowFontName NshowFind NselectedIndex NselectedColumn NselectCallback NscalingString NsashTranslations NsampleText NrgbFile NresizeToPreferred NresizeCallback NredSliderLabel NpropSpaceString NpreferredPaneSize Nposition NpopupShellWidget NpopupOffset NpopupCursor NpixmapWidth NpixmapHeight NparentNode NotherString NoptionString NopenFolderPixmap NopenClosePadding NnumValues NnumStacks NnumRows NnodeStateChangedCallback NnodeStateCallback NnodeStateBegEndCallback NnodeState NnoCellError NmonoSpaceString NminimumVerticalCells NminimumHorizontalCells NminimumCellWidth NminimumCellHeight Nmargin Nlist NlineWidth NlineColor Nlabel NitalicString NinsertBefore NindentSpace NiconTextPadding NiconPlacement NhorizontalNodeSpace NhorizontalMargin NgreenSliderLabel NfreeTabPixmap NfirstRow NfirstColumnPixmaps NfirstColumn NfindLabel NfillOption NfileReadError NfamilyString NequalSize NentryLabelString NentryData NencodingString NencodingList NdoubleClickCallback NdefaultEncodingString NdFieldPrefWidth NdFieldPrefHeight NdFieldMinWidth NdFieldMinHeight NdFieldMaxWidth NdFieldMaxHeight NcustomizedCombinationBox Ncursor NcurrentFont NconnectStyle NcomboTranslations NcolumnTitles NcolorName NcolorMode NcolorListTogLabel NcellY NcellX NbothString NboldString NblueSliderLabel CDistribution CFillStyle CItemSpacing CLabelSpacing CShowLabel CStretchable NdefaultEntryLabelAlignment NdefaultEntryLabelFontList NdefaultFillStyle Ndistribution NentryLabelAlignment NentryLabelFontList NentryLabelPixmap NentryLabelType NfillStyle NitemSpacing NlabelSpacing NshowEntryLabel Nstretchable RDistribution RFillStyle CEqualSize CFillOption CColorMode CFileReadError CNoCellError CSliderLabel CTogLabel CAutoFill CPicture NautoFill Npicture NpictureErrorCallback NvalidateCallback CFindLabel CShowFind NentryBackground CColumnTitles CEntryData CFirstColumnPixmaps CFirstLocation CNewVisualStyle CNumRows CScrollBar CSelectedColumn NnewVisualStyle CPreferredPaneSize CShowSash C100DPIString C75DPIString CAnyLowerString CAnyString CBoldString CBothString CDefaultEncodingString CEncodingList CEncodingString CFamilyString CItalicString CMonoSpaceString COptionString COtherString CPropSpaceString CSampleText CScalingString CShowNameString CSizeString CTextRows CXlfdSpaceString N100DPIstring N75DPIstring NanyLowerString NanyString CCellX CCellY CDefaultCells CMinimumCellSize CIconPlacement NpixmapDepth CAutoClose CInsertBefore CNodeState CNodeStateCallback CNodeStateChangedCallback CParentNode NautoClose NcloseFolderPixmap NnodeCloseFolderPixmap NnodeOpenFolderPixmap NnodeStateBeginEndCallback CConstrainWidth CIndentSpace NconnectNodes NconstrainWidth CNumStacks CSelectedIndex CStackedEffect CTabAutoSelect CTabCornerPercent CTabEdge CTabLabelSpacing CTabMode CTabOffset CTabOrientation CTabSelectColor CTabSelectPixmap CTabStyle CTraversalIndex CUniformTabSize CUseImageCache CFreeTabPixmap CICSEnhancementPakResourceError CTabLabelPixmap CTabLabelString CTabPixmapPlacement CTabSide NillegalResourceValue CCompressStyle CConnectStyle CHorizontalDelta CLineWidth COpenClosePadding CVerticalDelta NcompressStyle NhorizontalDelta NlineBackgroundColor NlineStyle NverticalDelta RXmCompressStyle RXmLineStyle CPopupOffset CUseTextField CVerify #file XmStrDefs23.h #table _XmStrings23 #htmpl XmStrDefs23.ht NdefaultEntryLabelRenderTable NentryLabelRenderTable NpixmapPlacement CPixmapPlacement RPixmapPlacement NpixmapTextPadding #table _XmStrings230 NfontStyle CFontStyle NfontSize CFontSize NfontFoundry CFontFoundry NfontEncoding CFontEncoding NxftFont CXftFont SUTF8_STRING #file XmStrDefsI.h #table _XmStringsI #htmpl XmStrDefsI.ht IATOM_PAIR IAVERAGE_WIDTH IBACKGROUND ICHARACTER_POSITION ICLASS ICOLUMN_NUMBER IDONE IFOREGROUND IHOST_NAME ILINE_NUMBER ILIST_LENGTH IMODULE INAME INone IODIF IOWNER_OS IPDM_EXIT_CANCEL IPDM_EXIT_ERROR IPDM_EXIT_OK IPDM_REPLY IPDM_START IPDM_START_ERROR IPDM_START_OK IPDM_START_PXAUTH IPDM_START_VXAUTH IPIXEL IPIXEL_SIZE IPROCEDURE IPROCESS IRESOLUTION_Y ISPAN ITASK IUSER IWM_DELETE_WINDOW I_MOTIF_CURRENT_TIME I_MOTIF_DRAG_ATOMS I_MOTIF_DRAG_INITIATOR_INFO I_MOTIF_DRAG_PROXY_WINDOW I_MOTIF_DRAG_RECEIVER_INFO I_MOTIF_DRAG_TARGETS I_MOTIF_DRAG_WINDOW I_MOTIF_INITIATOR I_MOTIF_RECEIVER I_MOTIF_SELECTION_TEXT motif-2.3.8/lib/Xm/ArrowB.h0000644000175000017500000000362213145162623012270 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmArrowButton_h #define _XmArrowButton_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsArrowButton #define XmIsArrowButton(w) XtIsSubclass(w, xmArrowButtonWidgetClass) #endif /* XmIsArrowButton */ externalref WidgetClass xmArrowButtonWidgetClass; typedef struct _XmArrowButtonClassRec * XmArrowButtonWidgetClass; typedef struct _XmArrowButtonRec * XmArrowButtonWidget; /******** Public Function Declarations ********/ extern Widget XmCreateArrowButton( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern Widget XmVaCreateManagedArrowButton( Widget parent, char *name, ...); extern Widget XmVaCreateArrowButton( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmArrowButton_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Transltns.c0000644000175000017500000013506413145162623013065 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Transltns.c /main/24 1999/08/09 18:34:51 mgreess $" #endif #endif /* Define _XmConst before including TransltnsP.h or XmP.h, so that the * declarations will be in agreement with the definitions. */ #ifndef _XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define _XmConst const #else #define _XmConst #endif /* __STDC__ */ #endif /* _XmConst */ #include #include #define FIX_1300 /* This is the new-style translation table, which is used with * versions of libXt that have the :-production translation fix * (fix-trackers seq 2797, or MIT public patch 24). * * Translations have been cleaned up and reorganized as follows: * - Sort translations based roughly on the event type. Canonical * order is: Map/Unmap, Enter/Leave, Focus, Btn, Key. * - Within the translations group by key, putting osfMumble * keys first. * - Prefix osf key translations with ':', and reorder as necessary * to remove ~mod. */ /*** ArrowB.c ***/ externaldef(translations) _XmConst char _XmArrowB_defaultTranslations[] = "\ : Enter()\n\ : Leave()\n\ c: ButtonTakeFocus()\n\ ~c: Arm()\n\ ~c,~c: Activate() Disarm()\n\ ~c(2+): MultiArm()\n\ ~c(2+): MultiActivate()\n\ ~c: Activate() Disarm()\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: PrimitiveParentCancel()\n\ :osfSelect: ArmAndActivate()\n\ :osfHelp: Help()\n\ ~s ~m ~a Return: PrimitiveParentActivate()\n\ ~s ~m ~a space: ArmAndActivate()"; /*** BulletinB.c ***/ externaldef(translations) _XmConst char _XmBulletinB_defaultTranslations[] = "\ : ManagerGadgetButtonMotion()\n\ c: ManagerGadgetTraverseCurrent()\n\ ~c: ManagerGadgetArm()\n\ ~c,~c: ManagerGadgetActivate()\n\ ~c: ManagerGadgetActivate()\n\ ~c(2+): ManagerGadgetMultiArm()\n\ ~c(2+): ManagerGadgetMultiActivate()\n\ : ManagerGadgetDrag()\n\ :osfHelp: ManagerGadgetHelp()\n\ :osfActivate: ManagerParentActivate()\n\ :osfCancel: ManagerParentCancel()\n\ :osfSelect: ManagerGadgetSelect()\n\ space: ManagerGadgetSelect()\n\ Return: ManagerParentActivate()\n\ : ManagerGadgetKeyInput()"; /*** CascadeB.c ***/ externaldef(translations) _XmConst char _XmCascadeB_menubar_events[] = "\ Normal: MenuBarEnter()\n\ Normal: MenuBarLeave()\n\ : ProcessDrag()\n\ c: DoSelect()\n\ c: MenuButtonTakeFocusUp()\n\ c: MenuButtonTakeFocusUp()\n\ ~c: MenuBarSelect()\n\ ~c: DoSelect()\n\ :osfSelect: KeySelect()\n\ :osfActivate: KeySelect()\n\ :osfHelp: Help()\n\ :osfCancel: CleanupMenuBar()\n\ ~sReturn: KeySelect()\n\ ~sspace: KeySelect()"; externaldef(translations) _XmConst char _XmCascadeB_p_events[] = "\ : DelayedArm()\n\ : CheckDisarm()\n\ : ProcessDrag()\n\ c: DoSelect()\n\ c: MenuButtonTakeFocus()\n\ c: MenuButtonTakeFocusUp()\n\ ~c: StartDrag()\n\ ~c: DoSelect()\n\ :osfSelect: KeySelect()\n\ :osfActivate: KeySelect()\n\ :osfHelp: Help()\n\ :osfCancel: CleanupMenuBar()\n\ ~sReturn: KeySelect()\n\ ~sspace: KeySelect()"; /*** Display.c ***/ /* * Although adding Ctrls as a binding for osfCancel would * simplify this table, it would break applications with translations * for that event. Instead we duplicate the CDE1.0 bindings, with * additions for the new widgets. */ externaldef(translations) _XmConst char _XmDisplay_baseTranslations[] = "\ *XmArrowButton.baseTranslations:\ \043override\ cs: PrimitiveParentCancel()\n\ *XmBulletinBoard.baseTranslations:\ \043override\ cs: ManagerParentCancel()\n\ *XmCascadeButton.baseTranslations:\ \043override\ cs: CleanupMenuBar()\n\ *XmComboBox*baseTranslations:\ \043override\ cs: CBCancel()\n\ *XmContainer.baseTranslations:\ \043override\ cs: ContainerCancel()\n\ *XmDragContext.baseTranslations:\ \043override\ cs: CancelDrag()\n\ *XmDrawingArea.baseTranslations:\ \043override\ cs: DrawingAreaInput() ManagerParentCancel()\n\ *XmDrawnButton.baseTranslations:\ \043override\ cs: PrimitiveParentCancel()\n\ *XmFrame.baseTranslations:\ \043override\ cs: ManagerParentCancel()\n\ *XmLabel.baseTranslations:\ \043override\ cs: PrimitiveParentCancel()\n\ *XmList.baseTranslations:\ \043override\ cs: ListKbdCancel()\n\ *XmManager.baseTranslations:\ \043override\ cs: ManagerParentCancel()\n\ *XmMenuShell.baseTranslations:\ \043override\ cs: MenuEscape()\n\ *XmPrimitive.baseTranslations:\ \043override\ cs: PrimitiveParentCancel()\n\ *XmPushButton.baseTranslations:\ \043override\ cs: PrimitiveParentCancel()\n\ *XmRowColumn.baseTranslations:\ \043override\ cs: ManagerParentCancel()\n\ *XmSash.baseTranslations:\ \043override\ cs: PrimitiveParentCancel()\n\ *XmScrollBar.baseTranslations:\ \043override\ cs: CancelDrag()\n\ *XmScrolledWindow.baseTranslations:\ \043override\ cs: ManagerParentCancel()\n\ *XmTextField.baseTranslations:\ \043override\ cs: process-cancel()\\n\ cx: cut-clipboard()\\n\ cc: copy-clipboard()\\n\ cv: paste-clipboard()\n\ *XmText.baseTranslations:\ \043override\ cs: process-cancel()\\n\ cx: cut-clipboard()\\n\ cc: copy-clipboard()\\n\ cv: paste-clipboard()\n\ *XmToggleButton.baseTranslations:\ \043override\ cs: PrimitiveParentCancel()\n\ "; /*** DragC.c ***/ externaldef(translations) _XmConst char _XmDragC_defaultTranslations[] = "\ Button1: DragMotion()\n\ Button1: DragMotion()\n\ Button1: DragMotion()\n\ Button2: DragMotion()\n\ Button2: DragMotion()\n\ Button2: DragMotion()\n\ : FinishDrag()\n\ : FinishDrag()\n\ : IgnoreButtons()\n\ : IgnoreButtons()\n\ Return: FinishDrag()\n\ :osfActivate: FinishDrag()\n\ :osfCancel: CancelDrag()\n\ :osfHelp: HelpDrag()\n\ :osfUp: DragKey(Up)\n\ :osfDown: DragKey(Down)\n\ :osfLeft: DragKey(Left)\n\ :osfRight: DragKey(Right)\n\ :: DragKey(Update)\n\ :: DragKey(Update)"; /*** DrawingA.c ***/ externaldef(translations) _XmConst char _XmDrawingA_defaultTranslations[] = "\ : ManagerGadgetButtonMotion()\n\ c: ManagerGadgetTraverseCurrent()\n\ ~c: DrawingAreaInput() ManagerGadgetArm()\n\ ~c,~c:DrawingAreaInput() ManagerGadgetActivate()\n\ ~c: DrawingAreaInput() ManagerGadgetActivate()\n\ ~c(2+): DrawingAreaInput() ManagerGadgetMultiArm()\n\ ~c(2+): DrawingAreaInput() ManagerGadgetMultiActivate()\n\ : DrawingAreaInput() ManagerGadgetDrag()\n\ : DrawingAreaInput()\n\ : DrawingAreaInput()\n\ :osfActivate: DrawingAreaInput() ManagerParentActivate()\n\ :osfCancel: DrawingAreaInput() ManagerParentCancel()\n\ :osfHelp: DrawingAreaInput() ManagerGadgetHelp()\n\ :osfSelect: DrawingAreaInput() ManagerGadgetSelect()\n\ ~s ~m ~a Return: DrawingAreaInput() ManagerParentActivate()\n\ Return: DrawingAreaInput() ManagerGadgetSelect()\n\ space: DrawingAreaInput() ManagerGadgetSelect()\n\ : DrawingAreaInput() ManagerGadgetKeyInput()\n\ : DrawingAreaInput()"; externaldef(translations) _XmConst char _XmDrawingA_traversalTranslations[] = "\ : ManagerEnter()\n\ : ManagerLeave()\n\ : ManagerFocusOut()\n\ : ManagerFocusIn()\n\ :osfUp: DrawingAreaInput() ManagerGadgetTraverseUp()\n\ :osfDown: DrawingAreaInput() ManagerGadgetTraverseDown()\n\ :osfLeft: DrawingAreaInput() ManagerGadgetTraverseLeft()\n\ :osfRight: DrawingAreaInput() ManagerGadgetTraverseRight()\n\ :osfBeginLine: DrawingAreaInput() ManagerGadgetTraverseHome()\n\ sTab: DrawingAreaInput() ManagerGadgetPrevTabGroup()\n\ ~sTab: DrawingAreaInput() ManagerGadgetNextTabGroup()"; /*** DrawnB.c ***/ externaldef(translations) _XmConst char _XmDrawnB_defaultTranslations[] = "\ : Enter()\n\ : Leave()\n\ c: ButtonTakeFocus()\n\ ~c: Arm()\n\ ~c,~c:Activate() Disarm()\n\ ~c(2+): MultiArm()\n\ ~c(2+): MultiActivate()\n\ ~c: Activate() Disarm()\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: PrimitiveParentCancel()\n\ :osfSelect: ArmAndActivate()\n\ :osfHelp: Help()\n\ ~s ~m ~a Return: PrimitiveParentActivate()\n\ ~s ~m ~a space: ArmAndActivate()"; externaldef(translations) _XmConst char _XmDrawnB_menuTranslations[] = "\ : Enter()\n\ : Leave()\n\ c: MenuButtonTakeFocus()\n\ c: MenuButtonTakeFocusUp()\n\ ~c: BtnDown()\n\ ~c: BtnUp()\n\ :osfSelect: ArmAndActivate()\n\ :osfActivate: ArmAndActivate()\n\ :osfCancel: MenuEscape()\n\ :osfHelp: Help()\n\ ~s ~m ~a Return: ArmAndActivate()\n\ ~s ~m ~a space: ArmAndActivate()"; /*** Frame.c ***/ /* * XmFrame has inherited XmManager's translations since OSF/Motif 1.1. * Since binary compatibility is *not* transitive (it is only * promised for one major release) we can reclaim this storage now. */ externaldef(translations) _XmConst char _XmFrame_defaultTranslations[] = ""; /*** Label.c ***/ externaldef(translations) _XmConst char _XmLabel_defaultTranslations[] = "\ : Enter()\n\ : Leave()\n\ : ProcessDrag()\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: PrimitiveParentCancel()\n\ :osfHelp: Help()\n\ ~s ~m ~a Return: PrimitiveParentActivate()"; externaldef(translations) _XmConst char _XmLabel_menuTranslations[] = "\ : Enter()\n\ : Leave()\n\ : ProcessDrag()\n\ :osfHelp: Help()"; externaldef(translations) _XmConst char _XmLabel_menu_traversal_events[] = "\ : Unmap()\n\ : FocusOut()\n\ : FocusIn()\n\ :osfCancel: MenuEscape()\n\ :osfLeft: MenuTraverseLeft()\n\ :osfRight: MenuTraverseRight()\n\ :osfUp: MenuTraverseUp()\n\ :osfDown: MenuTraverseDown()"; /*** List.c ***/ externaldef(translations) _XmConst char _XmList_ListXlations1[] = "\ : PrimitiveUnmap()\n\ : ListEnter()\n\ : ListLeave()\n\ : ListFocusIn()\n\ : ListFocusOut()\n\ : ListProcessBtn1(ListButtonMotion)\n\ s ~m ~a : ListProcessBtn1(ListBeginExtend)\n\ s ~m ~a : ListProcessBtn1(ListEndExtend)\n\ ~c ~s ~m ~a : ListProcessBtn1(ListBeginSelect)\n\ ~c ~s ~m ~a : ListProcessBtn1(ListEndSelect)\n\ c ~s ~m ~a : ListProcessBtn1(ListBeginToggle)\n\ c ~s ~m ~a : ListProcessBtn1(ListEndToggle)\n\ c ~s ~m a : ListProcessDrag()\n\ ~c s ~m a : ListProcessDrag()\n\ : ListProcessBtn2(ListBeginExtend)\n\ : ListProcessBtn2(ListButtonMotion)\n\ : ListProcessBtn2(ListEndExtend)\n\ :s c osfBeginLine: ListBeginDataExtend()\n\ :c osfBeginLine: ListBeginData()\n\ :osfBeginLine: ListBeginLine()\n\ :s c osfEndLine: ListEndDataExtend()\n\ :c osfEndLine: ListEndData()\n\ :osfEndLine: ListEndLine()\n\ :osfPageLeft: ListLeftPage()\n\ :c osfPageUp: ListLeftPage()\n\ :osfPageUp: ListPrevPage()\n\ :osfPageRight: ListRightPage()\n\ :c osfPageDown: ListRightPage()\n\ :osfPageDown: ListNextPage()\n"; externaldef(translations) _XmConst char _XmList_ListXlations2[] = "\ :s osfSelect: ListKbdBeginExtend()\n\ :osfSelect: ListKbdBeginSelect()\n\ :s osfSelect: ListKbdEndExtend()\n\ :osfSelect: ListKbdEndSelect()\n\ :osfSelectAll: ListKbdSelectAll()\n\ :osfDeselectAll: ListKbdDeSelectAll()\n\ :osfActivate: ListKbdActivate()\n\ :osfAddMode: ListAddMode()\n\ :osfHelp: PrimitiveHelp()\n\ :osfCancel: ListKbdCancel()\n\ :c osfLeft: ListLeftPage()\n\ :osfLeft: ListLeftChar()\n\ :c osfRight: ListRightPage()\n\ :osfRight: ListRightChar()\n\ :s osfUp: ListExtendPrevItem()\n\ :osfUp: ListPrevItem()\n\ :s osfDown: ListExtendNextItem()\n\ :osfDown: ListNextItem()\n\ :c osfInsert: ListCopyToClipboard()\n\ :osfCopy: ListCopyToClipboard()\n\ ~s c ~m ~a slash: ListKbdSelectAll()\n\ ~s c ~m ~a backslash: ListKbdDeSelectAll()\n\ s ~m ~a Tab: PrimitivePrevTabGroup()\n\ ~m ~a Tab: PrimitiveNextTabGroup()\n\ ~s ~m ~a Return: ListKbdActivate()\n\ ~s ~m ~a space: ListKbdBeginSelect()\n\ ~s ~m ~a space: ListKbdEndSelect()\n\ s ~m ~a space: ListKbdBeginExtend()\n\ s ~m ~a space: ListKbdEndExtend()\n\ : ListQuickNavigate()\n\ ~s ~c ~m ~a ,:ListScrollUp() ListScrollUp() ListScrollUp()\n\ ~s ~c ~m ~a ,:ListScrollDown() ListScrollDown() ListScrollDown()\n\ ,: ListScrollUp() ListScrollUp() ListScrollUp() ListScrollUp() ListScrollUp() ListScrollUp()\n\ ,: ListScrollDown() ListScrollDown() ListScrollDown() ListScrollDown() ListScrollDown() ListScrollDown()"; /*** Manager.c ***/ externaldef(translations) _XmConst char _XmManager_managerTraversalTranslations[] = "\ : ManagerEnter()\n\ : ManagerLeave()\n\ : ManagerFocusOut()\n\ : ManagerFocusIn()\n\ :osfBeginLine: ManagerGadgetTraverseHome()\n\ :osfUp: ManagerGadgetTraverseUp()\n\ :osfDown: ManagerGadgetTraverseDown()\n\ :osfLeft: ManagerGadgetTraverseLeft()\n\ :osfRight: ManagerGadgetTraverseRight()\n\ s ~m ~a Tab: ManagerGadgetPrevTabGroup()\n\ ~m ~a Tab: ManagerGadgetNextTabGroup()"; externaldef(translations) _XmConst char _XmManager_defaultTranslations[] = "\ : ManagerGadgetButtonMotion()\n\ c: ManagerGadgetTraverseCurrent()\n\ ~c: ManagerGadgetArm()\n\ ~c,~c: ManagerGadgetActivate()\n\ ~c: ManagerGadgetActivate()\n\ ~c(2+): ManagerGadgetMultiArm()\n\ ~c(2+): ManagerGadgetMultiActivate()\n\ : ManagerGadgetDrag()\n\ :osfActivate: ManagerParentActivate()\n\ :osfCancel: ManagerParentCancel()\n\ :osfSelect: ManagerGadgetSelect()\n\ :osfHelp: ManagerGadgetHelp()\n\ ~s ~m ~a Return: ManagerParentActivate()\n\ ~s ~m ~a space: ManagerGadgetSelect()\n\ : ManagerGadgetKeyInput()"; /*** MenuShell.c ***/ externaldef(translations) _XmConst char _XmMenuShell_translations [] = "\ osfCancel: MenuEscape()\n\ : ClearTraversal()\n\ : MenuShellPopdownDone()"; /*** Primitive.c ***/ externaldef(translations) _XmConst char _XmPrimitive_defaultTranslations[] = "\ : PrimitiveUnmap()\n\ : PrimitiveFocusIn()\n\ : PrimitiveFocusOut()\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: PrimitiveParentCancel()\n\ :osfBeginLine: PrimitiveTraverseHome()\n\ :osfUp: PrimitiveTraverseUp()\n\ :osfDown: PrimitiveTraverseDown()\n\ :osfLeft: PrimitiveTraverseLeft()\n\ :osfRight: PrimitiveTraverseRight()\n\ ~s ~m ~a Return: PrimitiveParentActivate()\n\ s ~m ~a Tab: PrimitivePrevTabGroup()\n\ ~m ~a Tab: PrimitiveNextTabGroup()"; /*** PushB.c ***/ externaldef(translations) _XmConst char _XmPushB_defaultTranslations[] = "\ : Enter()\n\ : Leave()\n\ c: ButtonTakeFocus()\n\ ~c: Arm()\n\ ~c,~c: Activate() Disarm()\n\ ~c(2+): MultiArm()\n\ ~c(2+): MultiActivate()\n\ ~c: Activate() Disarm()\n\ ~c: ProcessDrag()\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: PrimitiveParentCancel()\n\ :osfSelect: ArmAndActivate()\n\ :osfHelp: Help()\n\ ~s ~m ~a Return: PrimitiveParentActivate()\n\ ~s ~m ~a space: ArmAndActivate()"; externaldef(translations) _XmConst char _XmPushB_menuTranslations[] = "\ : Enter()\n\ : Leave()\n\ : ProcessDrag()\n\ c: MenuButtonTakeFocus()\n\ c: MenuButtonTakeFocusUp()\n\ ~c: BtnDown()\n\ ~c: BtnUp()\n\ :osfSelect: ArmAndActivate()\n\ :osfActivate: ArmAndActivate()\n\ :osfCancel: MenuEscape()\n\ :osfHelp: Help()\n\ ~s ~m ~a Return: ArmAndActivate()\n\ ~s ~m ~a space: ArmAndActivate()"; /*** RowColumn.c ***/ externaldef(translations) _XmConst char _XmRowColumn_menu_traversal_table[] = "\ : MenuUnmap()\n\ Normal: MenuEnter()\n\ : MenuFocusIn()\n\ : MenuFocusOut()\n\ :osfHelp: MenuHelp()\n\ :osfLeft: MenuGadgetTraverseLeft()\n\ :osfRight: MenuGadgetTraverseRight()\n\ :osfUp: MenuGadgetTraverseUp()\n\ :osfDown: MenuGadgetTraverseDown()"; externaldef(translations) _XmConst char _XmRowColumn_option_table[]= "\ : MenuGadgetDrag()\n\ c: MenuBtnUp()\n\ c: MenuGadgetTraverseCurrent()\n\ c: MenuGadgetTraverseCurrentUp()\n\ ~c: MenuBtnDown()\n\ ~c: MenuBtnUp()\n\ :osfActivate: ManagerParentActivate()\n\ :osfCancel: ManagerParentCancel()\n\ :osfSelect: ManagerGadgetSelect()\n\ :osfHelp: MenuHelp()\n\ ~s ~m ~a Return: ManagerParentActivate()\n\ ~s ~m ~a space: ManagerGadgetSelect()"; externaldef(translations) _XmConst char _XmRowColumn_bar_table[]= "\ : MenuGadgetDrag()\n\ c: MenuBtnUp()\n\ c: MenuGadgetTraverseCurrent()\n\ c: MenuGadgetTraverseCurrentUp()\n\ ~c: MenuBtnDown()\n\ ~c: MenuBtnUp()\n\ :osfSelect: MenuBarGadgetSelect()\n\ :osfActivate: MenuBarGadgetSelect()\n\ :osfHelp: MenuHelp()\n\ :osfCancel: MenuGadgetEscape()\n\ ~s ~m ~a Return: MenuBarGadgetSelect()\n\ ~s ~m ~a space: MenuBarGadgetSelect()"; externaldef(translations) _XmConst char _XmRowColumn_menu_table[]= "\ c: MenuBtnUp()\n\ c: MenuGadgetTraverseCurrent()\n\ c: MenuGadgetTraverseCurrentUp()\n\ ~c: MenuBtnDown()\n\ ~c: MenuBtnUp()\n\ :osfSelect: ManagerGadgetSelect()\n\ :osfActivate: ManagerGadgetSelect()\n\ :osfHelp: MenuHelp()\n\ :osfCancel: MenuGadgetEscape()\n\ ~s ~m ~a Return: ManagerGadgetSelect()\n\ ~s ~m ~a space: ManagerGadgetSelect()"; /*** Sash.c ***/ externaldef(translations) _XmConst char _XmSash_defTranslations[] = "\ : PrimitiveUnmap()\n\ : enter()\n\ : leave()\n\ : SashFocusIn()\n\ : SashFocusOut()\n\ ~c ~s ~m ~a : SashAction(Start)\n\ ~c ~s ~m ~a : SashAction(Move)\n\ ~c ~s ~m ~a : SashAction(Commit)\n\ ~c ~s ~m ~a : SashAction(Start)\n\ ~c ~s ~m ~a : SashAction(Move)\n\ ~c ~s ~m ~a : SashAction(Commit)\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: PrimitiveParentCancel()\n\ :osfHelp: Help()\n\ :c osfUp: SashAction(Key,LargeIncr,Up)\n\ :osfUp: SashAction(Key,DefaultIncr,Up)\n\ :c osfRight: SashAction(Key,LargeIncr,Right)\n\ :osfRight: SashAction(Key,DefaultIncr,Right)\n\ :c osfDown: SashAction(Key,LargeIncr,Down)\n\ :osfDown: SashAction(Key,DefaultIncr,Down)\n\ :c osfLeft: SashAction(Key,LargeIncr,Left)\n\ :osfLeft: SashAction(Key,DefaultIncr,Left)\n\ ~s ~m ~a Return: PrimitiveParentActivate()\n\ s ~m ~a Tab: PrevTabGroup()\n\ ~m ~a Tab: NextTabGroup()"; /*** ScrollBar.c ***/ externaldef(translations) _XmConst char _XmScrollBar_defaultTranslations[] = "\ : PrimitiveUnmap()\n\ : PrimitiveEnter()\n\ : PrimitiveLeave()\n\ : PrimitiveFocusIn()\n\ : PrimitiveFocusOut()\n\ ~s ~c ~m ~a : Select()\n\ : Release()\n\ ~s ~c ~m ~a Button1: Moved()\n\ ~s ~c ~m ~a : Select()\n\ : Release()\n\ ~s ~c ~m ~a Button2: Moved()\n\ ~s c ~m ~a : TopOrBottom()\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: CancelDrag()\n\ :osfBeginLine: TopOrBottom()\n\ :osfEndLine: TopOrBottom()\n\ :osfPageLeft: PageUpOrLeft(1)\n\ :c osfPageUp: PageUpOrLeft(1)\n\ :osfPageUp: PageUpOrLeft(0)\n\ :osfPageRight: PageDownOrRight(1)\n\ :c osfPageDown: PageDownOrRight(1)\n\ :osfPageDown: PageDownOrRight(0)\n\ :osfHelp: PrimitiveHelp()\n\ :c osfUp: PageUpOrLeft(0)\n\ :osfUp: IncrementUpOrLeft(0)\n\ :c osfDown: PageDownOrRight(0)\n\ :osfDown: IncrementDownOrRight(0)\n\ :c osfLeft: PageUpOrLeft(1)\n\ :osfLeft: IncrementUpOrLeft(1)\n\ :c osfRight: PageDownOrRight(1)\n\ :osfRight: IncrementDownOrRight(1)\n\ ~s ~m ~a Return: PrimitiveParentActivate()\n\ s ~m ~a Tab: PrimitivePrevTabGroup()\n\ ~m ~a Tab: PrimitiveNextTabGroup()\n\ ~s ~c ~m ~a ,:IncrementUpOrLeft(0) IncrementUpOrLeft(0) IncrementUpOrLeft(0) IncrementUpOrLeft(1) IncrementUpOrLeft(1) IncrementUpOrLeft(1)\n\ ~s ~c ~m ~a ,:IncrementDownOrRight(0) IncrementDownOrRight(0) IncrementDownOrRight(0) IncrementDownOrRight(1) IncrementDownOrRight(1) IncrementDownOrRight(1)\n\ ,: IncrementUpOrLeft(0) IncrementUpOrLeft(0) IncrementUpOrLeft(0) IncrementUpOrLeft(0) IncrementUpOrLeft(0) IncrementUpOrLeft(0) IncrementUpOrLeft(1) IncrementUpOrLeft(1) IncrementUpOrLeft(1) IncrementUpOrLeft(1) IncrementUpOrLeft(1) IncrementUpOrLeft(1)\n\ ,: IncrementDownOrRight(0) IncrementDownOrRight(0) IncrementDownOrRight(0) IncrementDownOrRight(0) IncrementDownOrRight(0) IncrementDownOrRight(0) IncrementDownOrRight(1) IncrementDownOrRight(1) IncrementDownOrRight(1) IncrementDownOrRight(1) IncrementDownOrRight(1)IncrementDownOrRight(1)"; /*** ScrolledW.c ***/ externaldef(translations) _XmConst char _XmScrolledW_ScrolledWindowXlations[] = "\ : ManagerEnter()\n\ : ManagerFocusOut()\n\ : ManagerFocusIn()\n\ : ManagerGadgetDrag()\n\ :osfActivate: ManagerParentActivate()\n\ :osfCancel: ManagerParentCancel()\n\ :c osfBeginLine: SWTopLine()\n\ :osfBeginLine: SWBeginLine()\n\ :c osfEndLine: SWBottomLine()\n\ :osfEndLine: SWEndLine()\n\ :osfPageLeft: SWLeftPage()\n\ :c osfPageUp: SWLeftPage()\n\ :osfPageUp: SWUpPage()\n\ :osfPageRight: SWRightPage()\n\ :c osfPageDown: SWRightPage()\n\ :osfPageDown: SWDownPage()\n\ :osfHelp: ManagerGadgetHelp()\n\ :osfUp: ManagerGadgetTraverseUp()\n\ :osfDown: ManagerGadgetTraverseDown()\n\ :osfLeft: ManagerGadgetTraverseLeft()\n\ :osfRight: ManagerGadgetTraverseRight()\n\ ~s ~m ~a Return: ManagerParentActivate()\n\ s ~m ~a Tab: ManagerGadgetPrevTabGroup()\n\ ~m ~a Tab: ManagerGadgetNextTabGroup()"; /* N.B.: This string is hard-coded in ClipWindow.c:ClipWindowKeys! */ externaldef(translations) _XmConst char _XmClipWindowTranslationTable[] = "\ :c osfBeginLine: ActionGrab(SWTopLine)\n\ :osfBeginLine: ActionGrab(SWBeginLine)\n\ :c osfEndLine: ActionGrab(SWBottomLine)\n\ :osfEndLine: ActionGrab(SWEndLine)\n\ :osfPageLeft: ActionGrab(SWLeftPage)\n\ :c osfPageUp: ActionGrab(SWLeftPage)\n\ :osfPageUp: ActionGrab(SWUpPage)\n\ :osfPageRight: ActionGrab(SWRightPage)\n\ :c osfPageDown: ActionGrab(SWRightPage)\n\ :osfPageDown: ActionGrab(SWDownPage)"; /*** SelectioB.c ***/ externaldef(translations) _XmConst char _XmSelectioB_defaultTextAccelerators[] = "\ \043override\n\ :osfUp: SelectionBoxUpOrDown(0)\n\ :osfDown: SelectionBoxUpOrDown(1)\n\ :osfBeginLine: SelectionBoxUpOrDown(2)\n\ :osfEndLine: SelectionBoxUpOrDown(3)\n\ :osfRestore: SelectionBoxRestore()\n\ s c ~m ~a space: SelectionBoxRestore()"; /*** TearOffB.c ***/ externaldef(translations) _XmConst char _XmTearOffB_overrideTranslations[] = "\ : BDrag()\n\ : BActivate()\n\ :osfSelect: KActivate()\n\ :osfActivate: KActivate()\n\ ~s ~m ~a Return: KActivate()\n\ ~s ~m ~a space: KActivate()"; /*** TextF.c ***/ externaldef(translations) _XmConst char _XmTextF_EventBindings1[] = "\ : unmap()\n\ : enter()\n\ : leave()\n\ : focusIn()\n\ : focusOut()\n\ ~c ~s ~m ~a : process-bselect(grab-focus)\n\ c ~s ~m ~a : process-bselect(move-destination)\n\ ~c s ~m ~a : process-bselect(extend-start)\n\ ~c ~m ~a : process-bselect(extend-adjust)\n\ ~c ~m ~a : process-bselect(extend-end)\n\ c ~s ~m a : process-bselect-event(process-bdrag, process-bselect)\n\ c ~s ~m a : process-bselect-event(secondary-adjust, process-bselect)\n\ c ~s ~m a : process-bselect-event(copy-to, process-bselect)\n\ ~c s ~m a : process-bselect-event(process-bdrag, process-bselect)\n\ ~c s ~m a : process-bselect-event(secondary-adjust, process-bselect)\n\ ~c s ~m a : process-bselect-event(move-to, process-bselect)\n\ ~m ~a : process-bselect()\n\ m ~a : process-bselect()\n\ ~m a : process-bselect()\n\ : process-bdrag-event(extend-start, process-bdrag)\n\ m ~a : process-bdrag-event(extend-adjust,secondary-adjust)\n\ ~m a : process-bdrag-event(extend-adjust,secondary-adjust)\n\ : process-bdrag-event(extend-adjust)\n\ s c : process-bdrag-event(extend-end, link-to)\n\ ~s : process-bdrag-event(extend-end, copy-to)\n\ ~c : process-bdrag-event(extend-end, move-to)\n\ :m osfPrimaryPaste:cut-primary()\n\ :a osfPrimaryPaste:cut-primary()\n\ :osfPrimaryPaste: copy-primary()\n\ :m osfCut: cut-primary()\n\ :a osfCut: cut-primary()\n\ :osfCut: cut-clipboard()\n\ :osfPaste: paste-clipboard()\n\ :m osfCopy: copy-primary()\n\ :a osfCopy: copy-primary()\n\ :osfCopy: copy-clipboard()\n\ :s osfBeginLine: beginning-of-line(extend)\n\ :osfBeginLine: beginning-of-line()\n\ :s osfEndLine: end-of-line(extend)\n\ :osfEndLine: end-of-line()\n\ :s osfPageLeft: page-left(extend)\n\ :osfPageLeft: page-left()\n\ :s cosfPageUp: page-left(extend)\n\ :c osfPageUp: page-left()\n\ :s osfPageRight: page-right(extend)\n\ :osfPageRight: page-right()\n"; externaldef(translations) _XmConst char _XmTextF_EventBindings2[] = "\ :s c osfPageDown: page-right(extend)\n\ :c osfPageDown: page-right()\n\ :osfClear: clear-selection()\n\ :osfBackSpace: delete-previous-character()\n\ :s m osfDelete: cut-primary()\n\ :s a osfDelete: cut-primary()\n\ :s osfDelete: cut-clipboard()\n\ :c osfDelete: delete-to-end-of-line()\n\ :osfDelete: delete-next-character()\n\ :c m osfInsert: copy-primary()\n\ :c a osfInsert: copy-primary()\n\ :s osfInsert: paste-clipboard()\n\ :c osfInsert: copy-clipboard()\n\ :osfInsert: toggle-overstrike()\n\ :s osfSelect: key-select()\n\ :osfSelect: set-anchor()\n\ :osfSelectAll: select-all()\n\ :osfDeselectAll: deselect-all()\n\ :osfActivate: activate()\n\ :osfAddMode: toggle-add-mode()\n\ :osfHelp: Help()\n\ :osfCancel: process-cancel()\n\ :s c osfLeft: backward-word(extend)\n\ :c osfLeft: backward-word()\n\ :s osfLeft: key-select(left)\n\ :osfLeft: backward-character()\n\ :s c osfRight: forward-word(extend)\n\ :c osfRight: forward-word()\n\ :s osfRight: key-select(right)\n\ :osfRight: forward-character()\n\ :osfUp: traverse-prev()\n\ :osfDown: traverse-next()\n"; externaldef(translations) _XmConst char _XmTextF_EventBindings3[] = "\ c ~m ~a slash: select-all()\n\ c ~m ~a backslash: deselect-all()\n\ s ~m ~a Tab: prev-tab-group()\n\ ~m ~a Tab: next-tab-group()\n\ ~s ~m ~a Return: activate()\n\ c ~s ~m ~a space: set-anchor()\n\ c s ~m ~a space: key-select()\n\ s ~c ~m ~a space: self-insert()\n\ : self-insert()"; /*** TextIn.c ***/ externaldef(translations) _XmConst char _XmTextIn_XmTextEventBindings1[] = "\ : unmap()\n\ : enter()\n\ : leave()\n\ : focusIn()\n\ : focusOut()\n\ ~c ~s ~m ~a : process-bselect(grab-focus)\n\ c ~s ~m ~a : process-bselect(move-destination)\n\ ~c s ~m ~a : process-bselect(extend-start)\n\ ~c ~m ~a : process-bselect(extend-adjust)\n\ ~c ~m ~a : process-bselect(extend-end)\n\ c ~s ~m a : process-bselect-event(process-bdrag, process-bselect)\n\ c ~s ~m a : process-bselect-event(secondary-adjust, process-bselect)\n\ c ~s ~m a : process-bselect-event(copy-to, process-bselect)\n\ ~c s ~m a : process-bselect-event(process-bdrag, process-bselect)\n\ ~c s ~m a : process-bselect-event(secondary-adjust, process-bselect)\n\ ~c s ~m a : process-bselect-event(move-to, process-bselect)\n\ ~m ~a : process-bselect()\n\ m ~a : process-bselect()\n\ ~m a : process-bselect()\n\ : process-bdrag-event(extend-start, process-bdrag)\n\ m ~a : process-bdrag-event(extend-adjust, secondary-adjust)\n\ ~m a : process-bdrag-event(extend-adjust, secondary-adjust)\n\ : process-bdrag-event(extend-adjust)\n\ s c : process-bdrag-event(extend-end, link-to)\n\ ~s : process-bdrag-event(extend-end, copy-to)\n\ ~c : process-bdrag-event(extend-end, move-to)\n\ :m osfPrimaryPaste:cut-primary()\n\ :a osfPrimaryPaste:cut-primary()\n\ :osfPrimaryPaste: copy-primary()\n\ :m osfCut: cut-primary()\n\ :a osfCut: cut-primary()\n\ :osfCut: cut-clipboard()\n\ :osfPaste: paste-clipboard()\n\ :m osfCopy: copy-primary()\n\ :a osfCopy: copy-primary()\n\ :osfCopy: copy-clipboard()\n\ :s c osfBeginLine: beginning-of-file(extend)\n\ :c osfBeginLine: beginning-of-file()\n\ :s osfBeginLine: beginning-of-line(extend)\n\ :osfBeginLine: beginning-of-line()\n\ :s c osfEndLine: end-of-file(extend)\n\ :c osfEndLine: end-of-file()\n\ :s osfEndLine: end-of-line(extend)\n\ :osfEndLine: end-of-line()\n\ :s osfPageLeft: page-left(extend)\n\ :osfPageLeft: page-left()\n\ :s c osfPageUp: page-left(extend)\n\ :c osfPageUp: page-left()\n\ :s osfPageUp: previous-page(extend)\n\ :osfPageUp: previous-page()\n\ :s osfPageRight: page-right(extend)\n\ :osfPageRight: page-right()\n"; externaldef(translations) _XmConst char _XmTextIn_XmTextEventBindings2[] = "\ :s c osfPageDown: page-right(extend)\n\ :c osfPageDown: page-right()\n\ :s osfPageDown: next-page(extend)\n\ :osfPageDown: next-page()\n\ :osfClear: clear-selection()\n\ :osfBackSpace: delete-previous-character()\n\ :s m osfDelete: cut-primary()\n\ :s a osfDelete: cut-primary()\n\ :s osfDelete: cut-clipboard()\n\ :c osfDelete: delete-to-end-of-line()\n\ :osfDelete: delete-next-character()\n\ :c m osfInsert: copy-primary()\n\ :c a osfInsert: copy-primary()\n\ :s osfInsert: paste-clipboard()\n\ :c osfInsert: copy-clipboard()\n\ :osfInsert: toggle-overstrike()\n\ :s osfSelect: key-select()\n\ :osfSelect: set-anchor()\n\ :osfSelectAll: select-all()\n\ :osfDeselectAll: deselect-all()\n\ :osfActivate: activate()\n\ :osfAddMode: toggle-add-mode()\n\ :osfHelp: Help()\n\ :osfCancel: process-cancel()\n\ :s c osfLeft: backward-word(extend)\n\ :c osfLeft: backward-word()\n\ :s osfLeft: key-select(left)\n\ :osfLeft: backward-character()\n\ :s c osfRight: forward-word(extend)\n\ :c osfRight: forward-word()\n\ :s osfRight: key-select(right)\n\ :osfRight: forward-character()\n\ :s c osfUp: backward-paragraph(extend)\n\ :c osfUp: backward-paragraph()\n\ :s osfUp: process-shift-up()\n\ :osfUp: process-up()\n\ :s c osfDown: forward-paragraph(extend)\n\ :c osfDown: forward-paragraph()\n\ :s osfDown: process-shift-down()\n\ :osfDown: process-down()\n"; externaldef(translations) _XmConst char _XmTextIn_XmTextEventBindings3[] = "\ c ~m ~a slash: select-all()\n\ c ~m ~a backslash: deselect-all()\n\ s c ~m ~a Tab: prev-tab-group()\n\ ~s c ~m ~a Tab: next-tab-group()\n\ s ~c ~m ~a Tab: process-tab(Prev)\n\ ~s ~c ~m ~a Tab: process-tab(Next)\n\ ~s c ~m ~a Return: activate()\n\ ~s ~c ~m ~a Return: process-return()\n\ ~s c ~m ~a space: set-anchor()\n\ s c ~m ~a space: key-select()\n\ s ~c ~m ~a space: self-insert()\n\ : self-insert()\n\ ~s ~c ~m ~a ,:scroll-one-line-down() scroll-one-line-down() scroll-one-line-down()\n\ ~s ~c ~m ~a ,:scroll-one-line-up() scroll-one-line-up() scroll-one-line-up()\n\ ,: scroll-one-line-down() scroll-one-line-down() scroll-one-line-down() scroll-one-line-down() scroll-one-line-down() scroll-one-line-down() scroll-one-line-down()\n\ ,: scroll-one-line-up() scroll-one-line-up() scroll-one-line-up() scroll-one-line-up() scroll-one-line-up() scroll-one-line-up() scroll-one-line-up()"; externaldef(translations) _XmConst char _XmTextIn_XmTextVEventBindings[] = "\ :s c osfLeft:forward-paragraph(extend)\n\ :c osfLeft:forward-paragraph()\n\ :s osfLeft:process-shift-left()\n\ :osfLeft:process-left()\n\ :s c osfRight:backward-paragraph(extend)\n\ :c osfRight:backward-paragraph()\n\ :s osfRight:process-shift-right(right)\n\ :osfRight:process-right()\n\ :s c osfUp:backward-word(extend)\n\ :c osfUp:backward-word()\n\ :s osfUp:key-select(up)\n\ :osfUp:backward-character()\n\ :s c osfDown:forward-word(extend)\n\ :c osfDown:forward-word()\n\ :s osfDown:key-select(down)\n\ :osfDown:forward-character()\n\ :s osfPageLeft:next-page(extend)\n\ :osfPageLeft:next-page()\n\ :s osfPageUp:page-up(extend)\n\ :osfPageUp:page-up()\n\ :s osfPageRight:previous-page(extend)\n\ :osfPageRight:previous-page()\n\ :s osfPageDown:page-down(extend)\n\ :osfPageDown:page-down()"; /*** ToggleB.c ***/ externaldef(translations) _XmConst char _XmToggleB_defaultTranslations[] = "\ : Enter()\n\ : Leave()\n\ c: ButtonTakeFocus()\n\ ~c: Arm()\n\ ~c: Select() Disarm()\n\ : ProcessDrag()\n\ :osfActivate: PrimitiveParentActivate()\n\ :osfCancel: PrimitiveParentCancel()\n\ :osfSelect: ArmAndActivate()\n\ :osfHelp: Help()\n\ ~s ~m ~a Return: PrimitiveParentActivate()\n\ ~s ~m ~a space: ArmAndActivate()"; externaldef(translations) _XmConst char _XmToggleB_menuTranslations[] = "\ : Enter()\n\ : Leave()\n\ : ProcessDrag()\n\ c: MenuButtonTakeFocus()\n\ c: MenuButtonTakeFocusUp()\n\ ~c: BtnDown()\n\ ~c: BtnUp()\n\ :osfSelect: ArmAndActivate()\n\ :osfActivate: ArmAndActivate()\n\ :osfHelp: Help()\n\ :osfCancel: MenuEscape()\n\ ~s ~m ~a Return: ArmAndActivate()\n\ ~s ~m ~a space: ArmAndActivate()"; /*** VirtKeys.c ***/ /* Do not abbreviate meta, ctrl, shift, lock, alt, etc. */ #ifdef FIX_1300 externaldef(translations) _XmConst char _XmVirtKeys_fallbackBindingString[] = "\ osfCancel:Escape,Cancel\n\ osfLeft:Left,KP_Left\n\ osfUp:Up,KP_Up\n\ osfRight:Right,KP_Right\n\ osfDown:Down,KP_Down\n\ osfEndLine:End,KP_End\n\ osfBeginLine:Home,Begin,KP_Home\n\ osfPageUp:Prior,KP_Prior\n\ osfPageDown:Next,KP_Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete,KP_Delete\n\ osfInsert:Insert,KP_Insert\n\ osfAddMode:ShiftF8\n\ osfHelp:F1,Help\n\ osfMenu:ShiftF10,Menu\n\ osfMenuBar:F10,ShiftMenu\n\ osfSelect:Select\n\ osfActivate:KP_Enter,Execute\n\ osfClear:Clear\n\ osfUndo:Undo\n\ osfSwitchDirection:AltReturn,AltKP_Enter"; #else externaldef(translations) _XmConst char _XmVirtKeys_fallbackBindingString[] = "\ osfCancel:Escape,Cancel\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home,Begin\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:ShiftF8\n\ osfHelp:F1,Help\n\ osfMenu:ShiftF10,Menu\n\ osfMenuBar:F10,ShiftMenu\n\ osfSelect:Select\n\ osfActivate:KP_Enter,Execute\n\ osfClear:Clear\n\ osfUndo:Undo\n\ osfSwitchDirection:AltReturn,AltKP_Enter"; #endif /*"Acorn Computers Ltd" * Acorn RISC iX versions 1.0->1.2 running on Acorn R140, R225, R260 * (all national keyboard variants)*/ externaldef(translations) _XmConst char _XmVirtKeys_acornFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:Alt Right\n\ osfBeginLine:Alt Left\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10\n\ osfActivate:KP_Enter\n\ osfCopy:Select"; /*"Apollo Computer Inc."*/ externaldef(translations) _XmConst char _XmVirtKeys_apolloFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:apRightBar\n\ osfBeginLine:apLeftBar\n\ osfPageLeft:apLeftBox\n\ osfPageRight:apRightBox\n\ osfPageUp:apUpBox\n\ osfPageDown:apDownBox\n\ osfBackSpace:BackSpace\n\ osfDelete:apCharDel\n\ osfInsert:Select\n\ osfAddMode:ShiftF8\n\ osfHelp:Help\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10\n\ osfCopy:apCopy\n\ osfCut:apCut\n\ osfPaste:apPaste\n\ osfUndo:Undo"; /*"Data General Corporation Rev 04" * AViiON */ externaldef(translations) _XmConst char _XmVirtKeys_dgFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10"; /*"DECWINDOWS DigitalEquipmentCorp."*/ externaldef(translations) _XmConst char _XmVirtKeys_decFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:AltRight\n\ osfBeginLine:AltLeft\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:Delete\n\ osfDelete:DRemove\n\ osfInsert:Insert\n\ osfAddMode:ShiftF8\n\ osfHelp:Help\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10\n\ osfSelect:Select\n\ osfActivate:KP_Enter\n\ osfPrimaryPaste:F14"; /*"Double Click Imaging, Inc. KeyX" * for the version of KeyX running on 386 AT bus compatibles. */ externaldef(translations) _XmConst char _XmVirtKeys_dblclkFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10"; /*"Hewlett-Packard Company" */ externaldef(translations) _XmConst char _XmVirtKeys_hpFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:ShiftF8\n\ osfHelp:F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10\n\ osfSelect:Select\n\ osfClear:Clear\n\ osfUndo:Undo\n\ osfPrimaryPaste:Alt CtrlInsert"; /*"International Business Machines" * for AIX/PS2 and RS/6000 systems */ externaldef(translations) _XmConst char _XmVirtKeys_ibmFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10"; /* Intergraph keyboard support */ /* Intergraph */ externaldef(translations) _XmConst char _XmVirtKeys_ingrFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:AltRight\n\ osfBeginLine:AltLeft\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:ShiftF8\n\ osfHelp:Help\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10"; /*"Megatek Corporation" * Megatek X-Cellerator */ externaldef(translations) _XmConst char _XmVirtKeys_megatekFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:R13\n\ osfBeginLine:F27\n\ osfPageUp:F29\n\ osfPageDown:F35\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:Help\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10\n\ osfCopy:F16\n\ osfCut:F20\n\ osfPaste:F18\n\ osfUndo:F14"; /*"Motorola Inc. (Microcomputer Division)" */ /* (c) Copyright 1990 Motorola Inc. */ /* Motorola provides these key bindings as is, with no guarantees or warranties implied. Motorola is under no obligation to support, update, or extend these key bindings for future releases. */ externaldef(translations) _XmConst char _XmVirtKeys_motorolaFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10"; /*"Silicon Graphics Inc." */ externaldef(translations) _XmConst char _XmVirtKeys_sgiFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:F1\n\ osfActivate:KP_Enter\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10"; /*"Siemens Munich by SP-4's Hacker Crew" * Siemens WX200 system */ externaldef(translations) _XmConst char _XmVirtKeys_siemensWx200FallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:Cancel\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete,F29\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:Help,F1\n\ osfActivate:KP_Enter\n\ osfMenu:Menu,Shift F10\n\ osfMenuBar:F10"; /*"Siemens Munich (SP-4's hacker-clan)" * Siemens 9733 system */ externaldef(translations) _XmConst char _XmVirtKeys_siemens9733FallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete_char\n\ osfInsert:Insert_char\n\ osfAddMode:Shift F8\n\ osfHelp:Help\n\ osfMenu:Linefeed\n\ osfMenuBar:F10"; /* "Sun Microsystems, Inc." */ externaldef(translations) _XmConst char _XmVirtKeys_sunFallbackBindingString[] = "\ osfActivate:KP_Enter\n\ osfCancel:Escape\n\ osfHelp:Help,F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfBeginLine:Home\n\ osfEndLine:End\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfUndo:Undo\n\ osfAddMode:ShiftF8\n\ osfCopy:SunCopy\n\ osfCut:SunCut\n\ osfPaste:SunPaste"; /*"Tektronix, Inc." */ externaldef(translations) _XmConst char _XmVirtKeys_tekFallbackBindingString[] = "\ osfCancel:Escape\n\ osfLeft:Left\n\ osfUp:Up\n\ osfRight:Right\n\ osfDown:Down\n\ osfEndLine:End\n\ osfBeginLine:Home\n\ osfPageUp:Prior\n\ osfPageDown:Next\n\ osfBackSpace:BackSpace\n\ osfDelete:Delete\n\ osfInsert:Insert\n\ osfAddMode:Shift F8\n\ osfHelp:F1\n\ osfMenu:ShiftF10\n\ osfMenuBar:F10"; motif-2.3.8/lib/Xm/UniqueEvnI.h0000644000175000017500000000272512672140200013116 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: UniqueEvnI.h /main/5 1995/07/13 18:17:21 drk $ */ #ifndef _XmUniqueEventI_h #define _XmUniqueEventI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for UniqueEvnt.c ********/ extern Boolean _XmIsEventUnique(XEvent *event) ; extern void _XmRecordEvent(XEvent *event) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmUniqueEventI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ChColor.c0000644000175000017500000000730112672140200012405 00000000000000/* $XConsortium: ChColor.c /main/6 1995/10/25 19:55:45 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "XmI.h" /********************************************************************* * * XmChangeColor - change set of colors for existing widget, given * background color * *********************************************************************/ void XmChangeColor( Widget w, Pixel background ) { Widget windowed_ancestor = w; Pixel foreground_ret; Pixel topshadow_ret; Pixel bottomshadow_ret; Pixel select_ret; Pixel use_background = background; Pixel gadget_background; Arg args[5]; /* * If the gadget is in BC mode (for colors), it must follow its parent's * color scheme. We therefore ignore the background pixel that was * passed in. */ _XmWidgetToAppContext(w); _XmAppLock(app); if (XmIsGadget(w)) { Widget parent = XtParent(w); windowed_ancestor = parent; XtSetArg(args[0], XmNbackground, &gadget_background); XtGetValues(w,args,1); if (gadget_background == parent->core.background_pixel) use_background = parent->core.background_pixel; } XmGetColors(windowed_ancestor->core.screen, windowed_ancestor->core.colormap, use_background, &foreground_ret, &topshadow_ret, &bottomshadow_ret, NULL ); if ( (XmIsManager(w)) || (XmIsPrimitive(w)) || (XmIsGadget(w)) ) { XtSetArg (args[0], XmNbackground, (XtArgVal) use_background); XtSetArg (args[1], XmNforeground, (XtArgVal) foreground_ret); XtSetArg (args[2], XmNtopShadowColor, (XtArgVal) topshadow_ret); XtSetArg (args[3], XmNbottomShadowColor, (XtArgVal) bottomshadow_ret); XtSetArg (args[4], XmNhighlightColor, (XtArgVal) foreground_ret); XtSetValues (w, args, 5); if (XmIsPrimitive(w) || XmIsGadget(w)) { if ( (XmIsScrollBar(w)) || (XmIsPushButton(w)) || (XmIsPushButtonGadget(w)) || (XmIsToggleButton(w)) || (XmIsToggleButtonGadget(w)) ) { XmGetColors( windowed_ancestor->core.screen, windowed_ancestor->core.colormap, background, NULL, NULL, NULL, &select_ret); if (XmIsToggleButton(w) || XmIsToggleButtonGadget(w)) { XtSetArg (args[0], XmNselectColor, (XtArgVal) select_ret); XtSetArg (args[1], XmNunselectColor, (XtArgVal) use_background); XtSetValues (w, args, 2); } else { if (XmIsScrollBar(w)) XtSetArg (args[0], XmNtroughColor, (XtArgVal) select_ret); else if (XmIsPushButton(w) || XmIsPushButtonGadget(w)) XtSetArg (args[0], XmNarmColor, (XtArgVal) select_ret); XtSetValues (w, args, 1); } } } } _XmAppUnlock(app); } motif-2.3.8/lib/Xm/Xpmmisc.c0000644000175000017500000000713612672140200012502 00000000000000/* $XConsortium: Xpmmisc.c /main/6 1996/09/20 08:15:37 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * misc.c: * * * * XPM library * * Miscellaneous utilities * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif /* we don't want the XpmFree macro since we define the XpmFree function here */ #define NO_XPMFREE_MACRO #include "XpmI.h" #ifdef NEED_STRDUP /* * in case strdup is not provided by the system here is one * which does the trick */ char * xpmstrdup(s1) char *s1; { char *s2; size_t l = strlen(s1) + 1; if (s2 = (char *) XpmMalloc(l)) strcpy(s2, s1); return s2; } #endif unsigned int xpmatoui(p, l, ui_return) register char *p; unsigned int l; unsigned int *ui_return; { register unsigned int n, i; n = 0; for (i = 0; i < l; i++) if (*p >= '0' && *p <= '9') n = n * 10 + *p++ - '0'; else break; if (i != 0 && i == l) { *ui_return = n; return 1; } else return 0; } /* * Function returning a character string related to an error code. */ char * XpmGetErrorString(errcode) int errcode; { switch (errcode) { case XpmColorError: return ("XpmColorError"); case XpmSuccess: return ("XpmSuccess"); case XpmOpenFailed: return ("XpmOpenFailed"); case XpmFileInvalid: return ("XpmFileInvalid"); case XpmNoMemory: return ("XpmNoMemory"); case XpmColorFailed: return ("XpmColorFailed"); default: return ("Invalid XpmError"); } } /* * The following function provides a way to figure out if the linked library is * newer or older than the one with which a program has been first compiled. */ int XpmLibraryVersion() { return XpmIncludeVersion; } /* The following should help people wanting to use their own functions */ void XpmFree(ptr) void *ptr; { free(ptr); } motif-2.3.8/lib/Xm/DropDown.h0000644000175000017500000000607312672140200012622 00000000000000#ifndef _XmDropDown_h #define _XmDropDown_h #include #if defined(VMS) || defined(__VMS) #include #endif #if defined(__cplusplus) extern "C" { #endif externalref WidgetClass xmDropDownWidgetClass; typedef struct _XmDropDownClassRec *XmDropDownWidgetClass; typedef struct _XmDropDownRec *XmDropDownWidget; /* XmIsDropDown may already be defined for Fast Subclassing */ #ifndef XmIsDropDown #define XmIsDropDown(w) XtIsSubclass(w, xmDropDownWidgetClass) #endif /* XmIsDropDown */ /***** Public Function Declarations *****/ /* Function Name: XmCreateDropDown * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ extern Widget XmCreateDropDown(Widget parent, char *name, ArgList args, Cardinal argCount); /* Function Name: XmDropDownGetValue * Description: Retreives the value from the combo box. * Arguments: w - the combination box. * Returns: The value in the text widget. */ extern String XmDropDownGetValue(Widget w); /* * Variable argument list functions */ extern Widget XmVaCreateDropDown( Widget parent, char *name, ...); extern Widget XmVaCreateManagedDropDown( Widget parent, char *name, ...); /* Function Name: XmDropDownGetLabel * Description: Returns the "label" child of the XmDropDown * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmDropDown */ extern Widget XmDropDownGetLabel(Widget w); /* Function Name: XmDropDownGetArrow * Description: Returns the "arrow" child of the XmDropDown * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmDropDown */ extern Widget XmDropDownGetArrow(Widget w); /* Function Name: XmDropDownGetText * Description: Returns the "text" child of the XmDropDown * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmDropDown */ extern Widget XmDropDownGetText(Widget w); /* Function Name: XmDropDownGetList * Description: Returns the "list" child of the XmDropDown * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmDropDown */ extern Widget XmDropDownGetList(Widget w); /* Function Name: XmDropDownGetChild * Description: Returns the child widget id of the XmDropDown * Arguments: w - The XmDropDown widget child - Teh component within the DropDown * Returns: The specified child of the XmDropDown */ extern Widget XmDropDownGetChild(Widget w, int child); #if defined(__cplusplus) } #endif #endif /* _XmDropDown_h_ */ motif-2.3.8/lib/Xm/TransferI.h0000644000175000017500000001035112672140200012755 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: TransferI.h /main/6 1996/10/16 16:57:37 drk $ */ #ifndef _XmTransferI_H #define _XmTransferI_H #include #ifdef __cplusplus extern "C" { #endif /****************************************************************/ /* Structure which is stored for each transfer request. This */ /* is where XmTransferValue will keep the data for the internal */ /* wrapper. */ /****************************************************************/ #define TB_NONE 0 #define TB_IGNORE 1 #define TB_INTERNAL 2 typedef struct { XtPointer next; XtPointer client_data; XtPointer location_data; int flags; Atom target; XtCallbackProc selection_proc; } TransferBlockRec, *TransferBlock; /****************************************************************/ /* This structure forms the context block for each transfer_id. */ /* These structures are chained to allow for multiple */ /* concurrent outstanding data transfers. */ /****************************************************************/ typedef struct { XtPointer next; XtPointer prev; Widget widget; Atom selection; Atom real_selection; XtEnum op; int count; int outstanding; int flags; int status; Widget drag_context; Widget drop_context; XmSelectionFinishedProc *doneProcs; int numDoneProcs; XtCallbackProc auto_proc; XtPointer client_data; XmDestinationCallbackStruct *callback_struct; TransferBlock last; TransferBlock requests; } TransferContextRec, *TransferContext; enum{ TC_NONE = 0, TC_FLUSHED = 1, TC_CALLED_WIDGET = 2, TC_CALLED_CALLBACKS = 4, TC_EXITED_DH = 8, TC_DID_DELETE = 16, TC_IN_MULTIPLE = 32 }; /****************************************************************/ /* The convertProc has a small context block which is */ /* setup by the source calls and deleted in the loseProc */ /****************************************************************/ typedef struct { long op; /* Make it big so it can hold a variety of data */ int flags; long itemid; XtPointer location_data; XtPointer client_data; Widget drag_context; } ConvertContextRec, *ConvertContext; enum{ CC_NONE = 0}; /****************************************************************/ /* Need to keep a count of outstanding SNAPSHOT requests. */ /****************************************************************/ typedef struct { long outstanding; Atom distinguisher; } SnapshotRequestRec, *SnapshotRequest; /* Internal functions */ extern char * _XmTextToLocaleText(Widget, XtPointer, Atom, int, unsigned long, Boolean *); extern void _XmConvertHandlerSetLocal(void); extern Boolean _XmConvertHandler(Widget wid, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *size, int *fmt); extern Boolean _XmDestinationHandler(Widget wid, Atom selection, XtEnum op, XmSelectionFinishedProc done_proc, XtPointer location_data, Time time, XSelectionRequestEvent *event); extern void _XmConvertComplete(Widget wid, XtPointer value, unsigned long size, int format, Atom type, XmConvertCallbackStruct *cs); extern XmDestinationCallbackStruct *_XmTransferGetDestinationCBStruct(XtPointer); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTransferI_H */ motif-2.3.8/lib/Xm/FocusAct.c0000644000175000017500000000420012672140200012556 00000000000000/* $XConsortium: FocusAct.c /main/5 1995/07/15 20:50:59 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "PrimitiveI.h" #include "UniqueEvnI.h" /********************************************************************** * * _XmMenuButtonTakeFocus * *********************************************************************/ /*ARGSUSED*/ void _XmMenuButtonTakeFocus( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { /* Support menu replay, free server input queue until next button event */ XAllowEvents(XtDisplay(wid), SyncPointer, CurrentTime); XmProcessTraversal(wid, XmTRAVERSE_CURRENT); _XmRecordEvent (event); } /********************************************************************** * * _XmMenuButtonTakeFocusUp * *********************************************************************/ /*ARGSUSED*/ void _XmMenuButtonTakeFocusUp( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { /* Support menu replay, free server input queue until next button event */ XAllowEvents(XtDisplay(wid), SyncPointer, CurrentTime); _XmRecordEvent (event); } motif-2.3.8/lib/Xm/DialogSavvyT.h0000644000175000017500000000454212672140200013441 00000000000000/* $XConsortium: DialogSavvyT.h /main/5 1995/07/15 20:50:29 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmDialogSavvyT_H #define _XmDialogSavvyT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTdialogShellSavvy; /* This trait also requires a resource named "defaultPosition". If the child has the trait, the resource will be get and set by the DialogShell ChangeManaged */ /* Trait structures and typedefs, place typedefs first */ typedef void (*XmDialogSavvyMapUnmapProc)(Widget wid, Boolean map_unmap); /* Version 0: initial release. */ typedef struct _XmDialogSavvyTraitRec { int version; /* 0 */ XmDialogSavvyMapUnmapProc callMapUnmapCB; } XmDialogSavvyTraitRec,*XmDialogSavvyTrait; /* This macro is part of the trait and is used for the following situation DialogShells always mimic the child position on themselves. If the SetValues on a bb child position was 0, which is always the _current_ position of the bb in a DialogShell, Xt does not see a change and therefore not trigerred a geometry request. So BB (or any dialogShellSavvy child) has to catch this case and change the position request to use a special value in its SetValues method, XmDIALOG_SAVVY_FORCE_ORIGIN, to notify the Dialog that it really wants to move in 0 */ #define XmDIALOG_SAVVY_FORCE_ORIGIN ((Position)~0L) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDialogSavvyT_H */ motif-2.3.8/lib/Xm/FileSB.h0000644000175000017500000000542613145162623012204 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmFSelect_h #define _XmFSelect_h #include #ifdef __cplusplus extern "C" { #endif /* Type definitions for FileSB resources: */ typedef void (*XmQualifyProc)( Widget, XtPointer, XtPointer) ; typedef void (*XmSearchProc)( Widget, XtPointer) ; /* Class record constants */ externalref WidgetClass xmFileSelectionBoxWidgetClass; typedef struct _XmFileSelectionBoxClassRec * XmFileSelectionBoxWidgetClass; typedef struct _XmFileSelectionBoxRec * XmFileSelectionBoxWidget; #ifndef XmIsFileSelectionBox #define XmIsFileSelectionBox(w) (XtIsSubclass((w),xmFileSelectionBoxWidgetClass)) #endif /******** Public Function Declarations ********/ extern Widget XmFileSelectionBoxGetChild( Widget fs, #if NeedWidePrototypes unsigned int which) ; #else unsigned char which) ; #endif /* NeedWidePrototypes */ extern void XmFileSelectionDoSearch( Widget fs, XmString dirmask) ; extern Widget XmCreateFileSelectionBox( Widget p, String name, ArgList args, Cardinal n) ; extern Widget XmCreateFileSelectionDialog( Widget ds_p, String name, ArgList fsb_args, Cardinal fsb_n) ; extern Widget XmVaCreateFileSelectionBox( Widget parent, char *name, ...); extern Widget XmVaCreateManagedFileSelectionBox( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmFSelect_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmCrDatFrI.c0000644000175000017500000002573212672140200013147 00000000000000/* $XConsortium: XpmCrDatFrI.c /main/2 1996/09/20 08:01:45 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrDataFI.c: * * * * XPM library * * Scan an image and possibly its mask and create an XPM array * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" LFUNC(CreateColors, int, (char **dataptr, unsigned int *data_size, XpmColor *colors, unsigned int ncolors, unsigned int cpp)); LFUNC(CreatePixels, void, (char **dataptr, unsigned int data_size, unsigned int width, unsigned int height, unsigned int cpp, unsigned int *pixels, XpmColor *colors)); LFUNC(CountExtensions, void, (XpmExtension *ext, unsigned int num, unsigned int *ext_size, unsigned int *ext_nlines)); LFUNC(CreateExtensions, void, (char **dataptr, unsigned int data_size, unsigned int offset, XpmExtension *ext, unsigned int num, unsigned int ext_nlines)); int XpmCreateDataFromImage(display, data_return, image, shapeimage, attributes) Display *display; char ***data_return; XImage *image; XImage *shapeimage; XpmAttributes *attributes; { XpmImage xpmimage; XpmInfo info; int ErrorStatus; /* initialize return value */ if (data_return) *data_return = NULL; /* create an XpmImage from the image */ ErrorStatus = XpmCreateXpmImageFromImage(display, image, shapeimage, &xpmimage, attributes); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* create the data from the XpmImage */ if (attributes) { xpmSetInfo(&info, attributes); ErrorStatus = XpmCreateDataFromXpmImage(data_return, &xpmimage, &info); } else ErrorStatus = XpmCreateDataFromXpmImage(data_return, &xpmimage, NULL); /* free the XpmImage */ XpmFreeXpmImage(&xpmimage); return (ErrorStatus); } #undef RETURN #define RETURN(status) \ do { \ if (header) { \ for (l = 0; l < header_nlines; l++) \ if (header[l]) \ XpmFree(header[l]); \ XpmFree(header); \ } \ return(status); \ } while(0) int XpmCreateDataFromXpmImage(data_return, image, info) char ***data_return; XpmImage *image; XpmInfo *info; { /* calculation variables */ int ErrorStatus; char buf[BUFSIZ]; char **header = NULL, **data, **sptr, **sptr2, *s; unsigned int header_size, header_nlines; unsigned int data_size, data_nlines; unsigned int extensions = 0, ext_size = 0, ext_nlines = 0; unsigned int offset, l, n; *data_return = NULL; extensions = info && (info->valuemask & XpmExtensions) && info->nextensions; /* compute the number of extensions lines and size */ if (extensions) CountExtensions(info->extensions, info->nextensions, &ext_size, &ext_nlines); /* * alloc a temporary array of char pointer for the header section which * is the hints line + the color table lines */ header_nlines = 1 + image->ncolors; if(header_nlines <= image->ncolors || header_nlines >= UINT_MAX / sizeof(char *)) return(XpmNoMemory); header_size = sizeof(char *) * header_nlines; if (header_size >= UINT_MAX / sizeof(char *)) return (XpmNoMemory); header = (char **) XpmCalloc(header_size, sizeof(char *)); if (!header) return (XpmNoMemory); /* print the hints line */ s = buf; #ifndef VOID_SPRINTF s += #endif sprintf(s, "%d %d %d %d", image->width, image->height, image->ncolors, image->cpp); #ifdef VOID_SPRINTF s += strlen(s); #endif if (info && (info->valuemask & XpmHotspot)) { #ifndef VOID_SPRINTF s += #endif sprintf(s, " %d %d", info->x_hotspot, info->y_hotspot); #ifdef VOID_SPRINTF s += strlen(s); #endif } if (extensions) { strcpy(s, " XPMEXT"); s += 7; } l = s - buf + 1; *header = (char *) XpmMalloc(l); if (!*header) RETURN(XpmNoMemory); header_size += l; strcpy(*header, buf); /* print colors */ ErrorStatus = CreateColors(header + 1, &header_size, image->colorTable, image->ncolors, image->cpp); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); /* now we know the size needed, alloc the data and copy the header lines */ offset = image->width * image->cpp + 1; if(offset <= image->width || offset <= image->cpp) RETURN(XpmNoMemory); if( (image->height + ext_nlines) >= UINT_MAX / sizeof(char *)) RETURN(XpmNoMemory); data_size = (image->height + ext_nlines) * sizeof(char *); if (image->height > UINT_MAX / offset || image->height * offset > UINT_MAX - data_size) RETURN(XpmNoMemory); data_size += image->height * offset; if( (header_size + ext_size) >= (UINT_MAX - data_size) ) RETURN(XpmNoMemory); data_size += header_size + ext_size; data = (char **) XpmMalloc(data_size); if (!data) RETURN(XpmNoMemory); data_nlines = header_nlines + image->height + ext_nlines; *data = (char *) (data + data_nlines); /* can header have less elements then n suggests? */ n = image->ncolors; for (l = 0, sptr = data, sptr2 = header; l <= n && sptr && sptr2; l++, sptr++, sptr2++) { strcpy(*sptr, *sptr2); *(sptr + 1) = *sptr + strlen(*sptr2) + 1; } /* print pixels */ data[header_nlines] = (char *) data + header_size + (image->height + ext_nlines) * sizeof(char *); CreatePixels(data + header_nlines, data_size-header_nlines, image->width, image->height, image->cpp, image->data, image->colorTable); /* print extensions */ if (extensions) CreateExtensions(data + header_nlines + image->height - 1, data_size - header_nlines - image->height + 1, offset, info->extensions, info->nextensions, ext_nlines); *data_return = data; RETURN(XpmSuccess); } static int CreateColors(dataptr, data_size, colors, ncolors, cpp) char **dataptr; unsigned int *data_size; XpmColor *colors; unsigned int ncolors; unsigned int cpp; { char buf[BUFSIZ]; unsigned int a, key, l; char *s, *s2; char **defaults; /* can ncolors be trusted here? */ for (a = 0; a < ncolors; a++, colors++, dataptr++) { defaults = (char **) colors; if(sizeof(buf) <= cpp) return(XpmNoMemory); strncpy(buf, *defaults++, cpp); s = buf + cpp; if(sizeof(buf) <= (s-buf)) return XpmNoMemory; for (key = 1; key <= NKEYS; key++, defaults++) { if ((s2 = *defaults)) { #ifndef VOID_SPRINTF s += #endif /* assume C99 compliance */ snprintf(s, sizeof(buf)-(s-buf), "\t%s %s", xpmColorKeys[key - 1], s2); #ifdef VOID_SPRINTF s += strlen(s); #endif } } /* what about using strdup()? */ l = s - buf + 1; s = (char *) XpmMalloc(l); if (!s) return (XpmNoMemory); *data_size += l; *dataptr = strcpy(s, buf); } return (XpmSuccess); } static void CreatePixels(dataptr, data_size, width, height, cpp, pixels, colors) char **dataptr; unsigned int data_size; unsigned int width; unsigned int height; unsigned int cpp; unsigned int *pixels; XpmColor *colors; { char *s; unsigned int x, y, h, offset; if(height <= 1) return; h = height - 1; offset = width * cpp + 1; if(offset <= width || offset <= cpp) return; /* why trust h? */ for (y = 0; y < h; y++, dataptr++) { s = *dataptr; /* why trust width? */ for (x = 0; x < width; x++, pixels++) { if(cpp > (data_size - (s - *dataptr))) return; strncpy(s, colors[*pixels].string, cpp); /* why trust pixel? */ s += cpp; } *s = '\0'; if(offset > data_size) return; *(dataptr + 1) = *dataptr + offset; } /* duplicate some code to avoid a test in the loop */ s = *dataptr; /* why trust width? */ for (x = 0; x < width; x++, pixels++) { if(cpp > data_size - (s - *dataptr)) return; strncpy(s, colors[*pixels].string, cpp); /* why should we trust *pixel? */ s += cpp; } *s = '\0'; } static void CountExtensions(ext, num, ext_size, ext_nlines) XpmExtension *ext; unsigned int num; unsigned int *ext_size; unsigned int *ext_nlines; { unsigned int x, y, a, size, nlines; char **line; size = 0; nlines = 0; for (x = 0; x < num; x++, ext++) { /* 1 for the name */ nlines += ext->nlines + 1; /* 8 = 7 (for "XPMEXT ") + 1 (for 0) */ size += strlen(ext->name) + 8; a = ext->nlines; for (y = 0, line = ext->lines; y < a; y++, line++) size += strlen(*line) + 1; } /* 10 and 1 are for the ending "XPMENDEXT" */ *ext_size = size + 10; *ext_nlines = nlines + 1; } static void CreateExtensions(dataptr, data_size, offset, ext, num, ext_nlines) char **dataptr; unsigned int data_size; unsigned int offset; XpmExtension *ext; unsigned int num; unsigned int ext_nlines; { unsigned int x, y, a, b; char **line; *(dataptr + 1) = *dataptr + offset; dataptr++; a = 0; for (x = 0; x < num; x++, ext++) { snprintf(*dataptr, data_size, "XPMEXT %s", ext->name); a++; if (a < ext_nlines) *(dataptr + 1) = *dataptr + strlen(ext->name) + 8; dataptr++; b = ext->nlines; /* can we trust these values? */ for (y = 0, line = ext->lines; y < b; y++, line++) { strcpy(*dataptr, *line); a++; if (a < ext_nlines) *(dataptr + 1) = *dataptr + strlen(*line) + 1; dataptr++; } } strcpy(*dataptr, "XPMENDEXT"); } motif-2.3.8/lib/Xm/xmlist.c0000644000175000017500000003207212672140200012377 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #include "xmlist.h" /************************************************************ * * Stack code. * ************************************************************/ #define STACK_INC 25 /************************************************************ * * Stack Manipulation code. * ************************************************************/ /* Function Name: _XmStackInit * Description: Initializes the stack. * Arguments: none * Returns: the stack */ XmStack _XmStackInit() { return((XmStack) XtCalloc(sizeof(XmStackRec), (Cardinal) 1)); } /* Function Name: _XmStackFree * Description: Frees all data associated with the stack. * Arguments: stack - the stack * Returns: none */ void _XmStackFree(XmStack stack) { XtFree((XtPointer) stack->elems); XtFree((XtPointer) stack); } /* Function Name: _XmStackPush * Description: Pushes an element onto the stack * Arguments: stack - the stack * elem - element to push onto it. * Returns: none */ void _XmStackPush(XmStack stack, XtPointer elem) { if ((++stack->top) >= stack->alloc) { stack->alloc += STACK_INC; stack->elems = (XtPointer *) XtRealloc((XtPointer) stack->elems, sizeof(XtPointer) * stack->alloc); } stack->elems[stack->top] = elem; #ifdef STACK_DEBUG printf("Pushing %d as elem %d\n", (int) elem, stack->top); #endif } /* Function Name: _XmStackPop * Description: Pops an element off of the stack. * Arguments: stack - stack to pop off of. * Returns: elem - the element that has been popped. */ XtPointer _XmStackPop(XmStack stack) { if (stack->top <= 0) return(NULL); /* no elements on the stack. */ #ifdef STACK_DEBUG printf("Popping %d from elem %d\n", (int) stack->elems[stack->top], stack->top); #endif return(stack->elems[(stack->top)--]); } /************************************************************ * * Queue code. * ************************************************************/ #ifdef QUEUE_DEBUG #define QUEUE_INC 5 #else #define QUEUE_INC 25 #endif /************************************************************ * * Queue Manipulation code. * ************************************************************/ /* Function Name: _XmQueueInit * Description: Initializes the queue. * Arguments: none * Returns: the queue */ XmQueue _XmQueueInit() { return((XmQueue) XtCalloc(sizeof(XmQueueRec), (Cardinal) 1)); } /* Function Name: _XmQueueFree * Description: Frees all data associated with the queue. * Arguments: queue - the queue * Returns: none */ void _XmQueueFree(XmQueue queue) { int count; _XmQElem *elem = queue->first; XmStack stack = _XmStackInit(); for (count = 0; count < 2; count++) { while (elem != NULL) { if (elem->alloced) _XmStackPush(stack, (XtPointer) elem); elem = elem->next; } elem = queue->free_elems; } while ((elem = (_XmQElem *) _XmStackPop(stack)) != NULL) XtFree((XtPointer) elem); _XmStackFree(stack); XtFree((XtPointer) queue); } /* Function Name: QueuePush * Description: Pushes an element onto the queue * Arguments: queue - the queue * data_in - the data to push onto the queue. * Returns: none */ /* * This is being removed because its name was not changed when compiled * -DBX. This means that there is already a QueuePush() defined in the * BX 3.1 bx.o, so integrating the EPak into BX causes multiply defined * symbols. Luckily, this function is not currently used in EPak. We * can remove this only when we don't support EPak integration into * BX 3.0 or BX 3.1. */ #ifdef notdef void QueuePush(XmQueue queue, XtPointer data_in) { _XmQElem *elem = _Xm_GetNewElement(queue); _Xm_AddQueue(queue, queue->last, elem); if (queue->first == NULL) queue->first = elem; queue->last = elem; elem->data = data_in; #ifdef QUEUE_DEBUG printf("Pushing %d\n", (int) data_in); #endif } #endif /* Function Name: _XmQueuePop * Description: Pops an element off of the queue. * Arguments: queue - queue to pop off of. * Returns: elem - the element that has been popped. */ XtPointer _XmQueuePop(XmQueue queue) { _XmQElem *first = _Xm_RemQueue(&queue->first); if (queue->first == NULL) queue->last = NULL; if (first == NULL) return(NULL); _Xm_AddQueue(NULL, queue->free_elems, first); #ifdef QUEUE_DEBUG printf("Popping %d\n", (int) first->data); #endif return(first->data); } /* Function Name: _XmQueueCount * Description: Returns the number of items in the queue * Arguments: queue - queue to check. * Returns: number of items in queue. */ int _XmQueueCount(XmQueue queue) { register int i; register _XmQElem *elem = queue->first; for (i = 0; elem != NULL; i++) elem = elem->next; return(i); } /* Function Name: _XmQueuePrint * Description: Prints out the real and free nodes of the queue. * Arguments: queue - queue to print. * Returns: none. */ #ifdef QUEUE_DEBUG void _XmQueuePrint(XmQueue queue) { _XmQElem *elem; printf("Elements:\n"); for (elem = queue->first; elem != NULL; elem = elem->next) printf("Element - %d\n", elem->data); printf("Reverse Elements:\n"); for (elem = queue->last; elem != NULL; elem = elem->prev) printf("Element - %d\n", elem->data); printf("Free Elements:\n"); for (elem = queue->free_elems; elem != NULL; elem = elem->next) printf("Free Element - %d\n", elem->data); } #endif /************************************************************ * * Internal Used (Utils Lib) functions. * ************************************************************/ /* Function Name: _Xm_AddQueue * Description: Adds an element to the queue, after the element specified. * Arguments: queue - Queue to add to, if NULL then we may be adding * to the free items list. * after - the element is added after this one. * elem - element to add. * Returns: none. */ void _Xm_AddQueue(XmQueue queue, _XmQElem *after, _XmQElem *elem) { if (elem != NULL) { elem->prev = after; if (after == NULL) /* * If queue is NULL then this is being added to the * free elements queue, and we make certain assumptions, like * we are always adding to then end of the list, so that * we never will try to add before the first element. */ if (queue != NULL) { elem->next = queue->first; if (elem->next != NULL) elem->next->prev = elem; } else elem->next = NULL; else elem->next = after->next; } if (after != NULL) { if (after->next != NULL) after->next->prev = elem; after->next = elem; } } /* Function Name: _Xm_RemQueue * Description: Removes the specified element form a queue, and sets * the queue to point to the next element. * Arguments: queue - the queue to remove it from. * Returns: the element removed. */ _XmQElem * _Xm_RemQueue(_XmQElem ** queue) { _XmQElem * elem = *queue; if (elem != NULL) { *queue = elem->next; if (elem->next != NULL) elem->next->prev = elem->prev; if (elem->prev != NULL) elem->prev->next = elem->next; } return(elem); } /* Function Name: GetNewElement * Description: Gets an element off the free_elems list, allocates * more elems if necessary. * Arguments: queue - the queue to get the element from. * Returns: an element. */ _XmQElem * _Xm_GetNewElement(XmQueue queue) { _XmQElem *elem; if ((elem = _Xm_RemQueue(&queue->free_elems)) == NULL) { register int i; /* * We are out of free elements, alloc some more. */ queue->free_elems = (_XmQElem *) XtCalloc(sizeof(_XmQElem), QUEUE_INC); queue->free_elems->alloced = True; queue->free_elems->next = elem = queue->free_elems + 1; for (i = 1; i < (QUEUE_INC - 1); i++, elem++) { elem->prev = elem - 1; elem->next = elem + 1; } elem->prev = elem - 1; /* * Pop an element off the free elements queue. */ elem = _Xm_RemQueue(&queue->free_elems); } return(elem); } /************************************************************ * * List code. * ************************************************************/ /* * This code is very dependant on the queue manipulation code, they * are sharing much functionality, several of these functions are just * wrappers around the queue maipulation code. */ /* Function Name: _XmListInit * Description: Initializes the list. * Arguments: none * Returns: the queue */ XmList _XmListInit() { return((XmList) _XmQueueInit()); } /* Function Name: _XmListFree * Description: Frees all data associated with the list. * Arguments: list - the list * Returns: none */ void _XmListFree(XmList list) { _XmQueueFree((XmQueue) list); } /* Function Name: _XmListAddAfter * Description: Adds an element after the specified element. * Arguments: list - the list * elem - The element to add this one after. * If NULL then add this element to the beginning of * the list * data_in - the data to push onto the queue. * Returns: The new added element. */ XmListElem * _XmListAddAfter(XmList list, XmListElem *elem_in, XtPointer data_in) { XmListElem *elem = (XmListElem *) _Xm_GetNewElement((XmQueue) list); _Xm_AddQueue((XmQueue) list, elem_in, elem); if (elem_in == NULL) list->first = elem; if (elem_in == list->last) list->last = elem; elem->data = data_in; return(elem); } /* Function Name: _XmListAddBefore * Description: Adds an element before the specified element. * Arguments: list - the list * elem - The element to add this one before. * If NULL then add this element to the end of * the list. * data_in - the data to push onto the queue. * Returns: The new added element. */ XmListElem * _XmListAddBefore(XmList list, XmListElem *elem_in, XtPointer data_in) { XmListElem *after; if (elem_in == NULL) after = list->last; else after = elem_in->prev; return(_XmListAddAfter(list, after, data_in)); } /* Function Name: _XmListRemove * Description: Removes an element from the list. * Arguments: list - the list to remove the element from. * Returns: none. */ void _XmListRemove(XmList list, XmListElem *elem) { XmListElem *dead = (XmListElem *) _Xm_RemQueue((_XmQElem **) &elem); /* * if NULL is passed, then no action is taken. */ if (dead == NULL) return; if (list->first == dead) if ((list->first = dead->next) == NULL) list->last = NULL; if (list->last == dead) if ((list->last = dead->prev) == NULL) list->first = NULL; _Xm_AddQueue(NULL, list->free_elems, (_XmQElem *) dead); } /* Function Name: _XmListCount * Description: Returns the number of items in the list. * Arguments: list - list to check. * Returns: number of items in list. */ int _XmListCount(XmList list) { return(_XmQueueCount((XmQueue) list)); } /* Function Name: _XmListExec * Description: Executes a function on all nodes in the list. * Arguments: list - the list to use. * start - the element to start with. * end - the element to end with. * exec_func - the function to execute. * data - data to pass to the function. * Returns: NULL is returned if all items from start to end * have been operated on. Otherwise the node in which * the operation stopped is returned. * * NOTES: If start is NULL the start is the first element in the list. * If end is NULL then all elements after start will be searched. * The list is always executed if forward order from start -> * start->next, start->next->next... * */ XmListElem * _XmListExec(XmList list, XmListElem *start, XmListElem *end, XmListFunc func, XtPointer data) { if (start == NULL) start = list->first; for ( ; (start != end) && (start != NULL); start = start->next) { if (!(*func)(start, data)) return(start); } return(NULL); } /* Function Name: _XmListPrint * Description: Prints out the real and free nodes of the list. * Arguments: list - list to print. * Returns: none. */ #ifdef QUEUE_DEBUG void _XmListPrint(XmList list) { _XmQueuePrint((XmQueue) list); } #endif motif-2.3.8/lib/Xm/DataF.c0000644000175000017500000136075013175704571012066 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "TextFI.h" #include "TextFSelI.h" #include "XmStringI.h" #include "ImageCachI.h" #ifdef USE_XFT #include #include "XmRenderTI.h" #endif #include "MessagesI.h" #define FIX_1531 /* * Stuff from various internal motif headers that we need to declare */ #ifndef MAX #define MAX(x,y) ((x) > (y) ? (x) : (y)) #endif #define TEXT_MAX_INSERT_SIZE 64 /* Size of buffer for XLookupString. */ /* * Various DataField messages macro */ #define MSG1 _XmMMsgDataF_0000 #define MSG2 _XmMMsgDataF_0001 #define MSG3 _XmMMsgDataF_0002 #define MSG4 _XmMMsgDataF_0003 #define MSG5 _XmMMsgDataF_0004 #define MSG6 _XmMMsgDataF_0005 #define MSG7 _XmMMsgDataF_0006 #define WC_MSG1 _XmMMsgDataFWcs_0000 #define WC_MSG2 _XmMMsgDataFWcs_0001 #define GRABKBDERROR _XmMMsgRowColText_0024 #ifdef _XmConst #undef _XmConst #define _XmConst #else #define _XmConst #endif #ifdef _NO_PROTO extern Boolean _XmParentProcess(); extern Boolean _XmMgrTraversal(); extern unsigned char _XmGetFocusPolicy(); extern void _XmPrimitiveFocusIn(); extern void _XmPrimitiveEnter(); extern void _XmPrimitiveLeave(); extern Boolean _XmGetImage(); extern Boolean _XmGetIconControlInfo(); extern unsigned char _XmGetAudibleWarning(); extern void _XmSetDestination(); #else extern Boolean _XmParentProcess(Widget, XmParentProcessData); extern Boolean _XmMgrTraversal(Widget, XmTraversalDirection); extern unsigned char _XmGetFocusPolicy(Widget); extern void _XmPrimitiveFocusIn(Widget, XEvent *, String *, Cardinal *); extern void _XmPrimitiveEnter(Widget, XEvent *, String *, Cardinal *); extern void _XmPrimitiveLeave(Widget, XEvent *, String *, Cardinal *); extern Boolean _XmGetImage(Screen *, char *, XImage **); extern Boolean _XmGetIconControlInfo( Screen *screen, Boolean *useMaskRtn, Boolean *useMultiColorIconsRtn, Boolean *useIconFileCacheRtn) ; extern unsigned char _XmGetAudibleWarning(Widget); extern void _XmSetDestination(Display *, Widget); #endif /* * Back to the original XmTextField code */ #define TEXT_INCREMENT 32 #define PRIM_SCROLL_INTERVAL 100 #define SEC_SCROLL_INTERVAL 200 #define XmDYNAMIC_BOOL 255 #define EventBindings1 _XmDataF_EventBindings1 #define EventBindings2 _XmDataF_EventBindings2 #define EventBindings3 _XmDataF_EventBindings3 #define EventBindings4 _XmDataF_EventBindings4 typedef struct { Boolean has_destination; XmTextPosition position; int replace_length; Boolean quick_key; } TextFDestDataRec, *TextFDestData; typedef struct { XmDataFieldWidget tf; } TextFGCDataRec, *TextFGCData; /******** Static Function Declarations ********/ #ifdef _NO_PROTO static void df_ValidateAndMove() ; static int _XmDataFieldCountCharacters() ; static void df_MakeCopy() ; static void df_WcsMakeCopy() ; static void df_FreeContextData() ; static TextFDestData df_GetTextFDestData() ; static void df_SetDropContext() ; static void df_DeleteDropContext() ; static TextFGCData df_GetTextFGCData() ; static _XmHighlightRec * df_FindHighlight() ; static void df_InsertHighlight() ; static void DataFieldSetHighlight() ; static Boolean df_GetXYFromPos() ; static Boolean df_CurrentCursorState() ; static void df_PaintCursor() ; static int _XmGetImage(); static void df_BlinkInsertionPoint() ; static void df_HandleTimer() ; static void df_ChangeBlinkBehavior() ; static void df_GetRect() ; static void df_CheckHasRect() ; static void df_XmSetFullGC() ; static void df_XmSetMarginGC() ; static void df_XmResetSaveGC() ; static void df_XmSetNormGC() ; #ifdef FIX_1381 static void df_XmSetShadowGC() ; #endif static void df_XmSetInvGC() ; static void df_DrawText() ; static int df_FindPixelLength() ; static void df_DrawTextSegment() ; static void df_RedisplayText() ; static void df_ComputeSize() ; static XtGeometryResult df_TryResize() ; static Boolean df_AdjustText() ; static void df_AdjustSize() ; static Boolean df_ModifyVerify() ; static void df_ResetClipOrigin() ; static void df_InvertImageGC() ; static void df_ResetImageGC() ; static void df_SetCursorPosition() ; static void df_VerifyBounds() ; static XmTextPosition df_GetPosFromX() ; static XmTextPosition RightAlignedGetPosFromX() ; static Boolean df_SetDestination() ; static Boolean df_VerifyLeave() ; static Boolean _XmDataFieldIsWordBoundary() ; static int _XmGetImage(Screen *, char *, XImage **); static Boolean _XmDataFieldIsWSpace() ; static void df_FindWord() ; static void df_FindPrevWord() ; static void df_FindNextWord() ; static void df_CheckDisjointSelection() ; static Boolean df_NeedsPendingDelete() ; static Boolean df_NeedsPendingDeleteDisjoint() ; static Time df_GetServerTime() ; static void df_InsertChar() ; static void df_InsertString() ; static void df_DeletePrevChar() ; static void df_DeleteNextChar() ; static void df_DeletePrevWord() ; static void df_DeleteNextWord() ; static void df_DeleteToEndOfLine() ; static void df_DeleteToStartOfLine() ; static void df_ProcessCancel() ; static void df_Activate() ; static void df_SetAnchorBalancing() ; static void df_SetNavigationAnchor() ; static void df_CompleteNavigation() ; static void df_SimpleMovement() ; static void df_BackwardChar() ; static void df_ForwardChar() ; static void df_BackwardWord() ; static void df_ForwardWord() ; static void df_EndOfLine() ; static void df_BeginningOfLine() ; static void df_SetSelection() ; static void df_ProcessHorizontalParams() ; static void df_ProcessSelectParams() ; static void df_KeySelection() ; static void df_TextFocusIn() ; static void df_TextFocusOut() ; static void df_SetScanIndex() ; static void df_ExtendScanSelection() ; static void df_SetScanSelection() ; static void df_StartPrimary() ; static void df_MoveDestination() ; static void df_ExtendPrimary() ; static void df_ExtendEnd() ; static void df_DoExtendedSelection() ; static void df_DoSecondaryExtend() ; static void df_BrowseScroll() ; static Boolean df_CheckTimerScrolling() ; static void df_RestorePrimaryHighlight() ; static void df_StartDrag() ; static void df_StartSecondary() ; static void df_ProcessBDrag() ; static void df_ExtendSecondary() ; static void df_DoStuff() ; static void df_Stuff() ; static void df_HandleSelectionReplies() ; static void df_SecondaryNotify() ; static void df_HandleTargets() ; static void df_ProcessBDragRelease() ; static void df_ProcessCopy() ; static void df_ProcessMove() ; static void df_DeleteSelection() ; static void df_ClearSelection() ; static void df_PageRight() ; static void df_PageLeft() ; static void df_CopyPrimary() ; static void df_CutPrimary() ; static void df_SetAnchor() ; static void df_ToggleOverstrike() ; static void df_ToggleAddMode() ; static void df_SelectAll() ; static void df_DeselectAll() ; static void df_VoidAction() ; static void df_CutClipboard() ; static void df_CopyClipboard() ; static void df_PasteClipboard() ; static void df_TraverseDown() ; static void df_TraverseUp() ; static void df_TraverseHome() ; static void df_TraverseNextTabGroup() ; static void df_TraversePrevTabGroup() ; static void df_TextEnter() ; static void df_TextLeave() ; static void df_ClassPartInitialize() ; static void df_Validates() ; static Boolean df_LoadFontMetrics() ; static void df_ValidateString() ; static void df_InitializeTextStruct() ; static Pixmap df_GetClipMask() ; static void df_LoadGCs() ; static void df_MakeIBeamOffArea() ; static void df_MakeIBeamStencil() ; static void df_MakeAddModeCursor() ; static void df_MakeCursors() ; static void df_DropDestroyCB() ; static void df_DropTransferCallback() ; static void df_HandleDrop() ; static void df_DragProcCallback() ; static void df_DropProcCallback() ; static void df_RegisterDropSite() ; static void df_Initialize() ; static void df_Realize() ; static void df_Destroy() ; static void df_Resize() ; static XtGeometryResult df_QueryGeometry() ; static void DataFieldExpose() ; static Boolean df_SetValues() ; static Boolean DataFieldGetBaselines() ; static Boolean DataFieldGetDisplayRect() ; static void DataFieldMarginsProc() ; static Boolean DataFieldRemove(); static void PictureVerifyCallback(); static void ClassInit(); static void XmDataFieldSetStringWcs(); #else static void df_ValidateAndMove( Widget w, XEvent *ev, String *args, Cardinal *nargs) ; static int _XmDataFieldCountCharacters( XmDataFieldWidget tf, char *ptr, int n_bytes) ; static void df_MakeCopy( Widget w, int n, XtArgVal *value) ; static void df_WcsMakeCopy( Widget w, int n, XtArgVal *value) ; static void df_FreeContextData( Widget w, XtPointer clientData, XtPointer callData) ; static TextFDestData df_GetTextFDestData( Widget w) ; static void df_SetDropContext( Widget w) ; static void df_DeleteDropContext( Widget w) ; static TextFGCData df_GetTextFGCData( Widget w) ; static _XmHighlightRec * df_FindHighlight( XmDataFieldWidget w, XmTextPosition position) ; static void df_InsertHighlight( XmDataFieldWidget w, XmTextPosition position, XmHighlightMode mode) ; static void DataFieldSetHighlight( XmDataFieldWidget tf, XmTextPosition left, XmTextPosition right, XmHighlightMode mode) ; static Boolean df_GetXYFromPos( XmDataFieldWidget tf, XmTextPosition position, Position *x, Position *y) ; static Boolean df_CurrentCursorState( XmDataFieldWidget tf) ; static void df_PaintCursor( XmDataFieldWidget tf) ; static void df_BlinkInsertionPoint( XmDataFieldWidget tf) ; static void df_HandleTimer( XtPointer closure, XtIntervalId *id) ; static void df_ChangeBlinkBehavior( XmDataFieldWidget tf, #if NeedWidePrototypes int turn_on) ; #else Boolean turn_on) ; #endif /* NeedWidePrototypes */ static void df_GetRect( XmDataFieldWidget tf, XRectangle *rect) ; static void df_CheckHasRect( XmDataFieldWidget tf) ; static void df_XmSetFullGC( XmDataFieldWidget tf, GC gc) ; static void df_XmSetMarginGC( XmDataFieldWidget tf, GC gc) ; static void df_XmResetSaveGC( XmDataFieldWidget tf, GC gc) ; static void df_XmSetNormGC( XmDataFieldWidget tf, GC gc, #if NeedWidePrototypes int change_stipple, int stipple) ; #else Boolean change_stipple, Boolean stipple) ; #endif /* NeedWidePrototypes */ #ifdef FIX_1381 static void df_XmSetShadowGC( XmDataFieldWidget tf, GC gc); #endif static void df_XmSetInvGC( XmDataFieldWidget tf, GC gc) ; static void df_DrawText( XmDataFieldWidget tf, GC gc, int x, int y, char *string, int length) ; static int df_FindPixelLength( XmDataFieldWidget tf, char *string, int length) ; static void df_DrawTextSegment( XmDataFieldWidget tf, XmHighlightMode mode, XmTextPosition prev_seg_start, XmTextPosition seg_start, XmTextPosition seg_end, XmTextPosition next_seg, #if NeedWidePrototypes int stipple, #else Boolean stipple, #endif /* NeedWidePrototypes */ int y, int *x) ; static void df_RedisplayText( XmDataFieldWidget tf, XmTextPosition start, XmTextPosition end) ; static void df_ComputeSize( XmDataFieldWidget tf, Dimension *width, Dimension *height) ; static XtGeometryResult df_TryResize( XmDataFieldWidget tf, #if NeedWidePrototypes int width, int height) ; #else Dimension width, Dimension height) ; #endif /* NeedWidePrototypes */ static Boolean df_AdjustText( XmDataFieldWidget tf, XmTextPosition position, #if NeedWidePrototypes int flag) ; #else Boolean flag) ; #endif /* NeedWidePrototypes */ static void df_AdjustSize( XmDataFieldWidget tf) ; static Boolean df_ModifyVerify( XmDataFieldWidget tf, XEvent *event, XmTextPosition *replace_prev, XmTextPosition *replace_next, char **insert, int *insert_length, XmTextPosition *newInsert, int *free_insert) ; static void df_ResetClipOrigin( XmDataFieldWidget tf, #if NeedWidePrototypes int clip_mask_reset) ; #else Boolean clip_mask_reset) ; #endif /* NeedWidePrototypes */ static void df_InvertImageGC( XmDataFieldWidget tf) ; static void df_ResetImageGC( XmDataFieldWidget tf) ; static void df_SetCursorPosition( XmDataFieldWidget tf, XEvent *event, XmTextPosition position, #if NeedWidePrototypes int adjust_flag, int call_cb, int set_dest) ; #else Boolean adjust_flag, Boolean call_cb, Boolean set_dest) ; #endif /* NeedWidePrototypes */ static void df_VerifyBounds( XmDataFieldWidget tf, XmTextPosition *from, XmTextPosition *to) ; static XmTextPosition df_GetPosFromX( XmDataFieldWidget tf, #if NeedWidePrototypes int x) ; #else Position x) ; #endif /* NeedWidePrototypes */ static XmTextPosition RightAlignedGetPosFromX( XmDataFieldWidget tf, #if NeedWidePrototypes int x) ; #else Position x) ; #endif /* NeedWidePrototypes */ static Boolean df_SetDestination( Widget w, XmTextPosition position, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time set_time) ; static Boolean df_VerifyLeave( XmDataFieldWidget tf, XEvent *event) ; static Boolean _XmDataFieldIsWordBoundary( XmDataFieldWidget tf, XmTextPosition pos1, XmTextPosition pos2) ; static Boolean _XmDataFieldIsWSpace( wchar_t wide_char, wchar_t *white_space, int num_entries) ; static void df_FindWord( XmDataFieldWidget tf, XmTextPosition begin, XmTextPosition *left, XmTextPosition *right) ; static void df_FindPrevWord( XmDataFieldWidget tf, XmTextPosition *left, XmTextPosition *right) ; static void df_FindNextWord( XmDataFieldWidget tf, XmTextPosition *left, XmTextPosition *right) ; static void df_CheckDisjointSelection( Widget w, XmTextPosition position, Time sel_time) ; static Boolean df_NeedsPendingDelete( XmDataFieldWidget tf) ; static Boolean df_NeedsPendingDeleteDisjoint( XmDataFieldWidget tf) ; static Time df_GetServerTime( Widget w) ; static void df_InsertChar( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_InsertString( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeletePrevChar( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeleteNextChar( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeletePrevWord( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeleteNextWord( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeleteToEndOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeleteToStartOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ProcessCancel( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_Activate( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_SetAnchorBalancing( XmDataFieldWidget tf, XmTextPosition position) ; static void df_SetNavigationAnchor( XmDataFieldWidget tf, XmTextPosition position, #if NeedWidePrototypes int extend) ; #else Boolean extend) ; #endif /* NeedWidePrototypes */ static void df_CompleteNavigation( XmDataFieldWidget tf, XEvent *event, XmTextPosition position, Time time, #if NeedWidePrototypes int extend) ; #else Boolean extend) ; #endif /* NeedWidePrototypes */ static void df_SimpleMovement( Widget w, XEvent *event, String *params, Cardinal *num_params, XmTextPosition cursorPos, XmTextPosition position) ; static void df_BackwardChar( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ForwardChar( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_BackwardWord( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ForwardWord( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_EndOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_BeginningOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_SetSelection( XmDataFieldWidget tf, XmTextPosition left, XmTextPosition right, #if NeedWidePrototypes int redisplay) ; #else Boolean redisplay) ; #endif /* NeedWidePrototypes */ static void df_ProcessHorizontalParams( Widget w, XEvent *event, char **params, Cardinal *num_params, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position) ; static void df_ProcessSelectParams( Widget w, XEvent *event, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position) ; static void df_KeySelection( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TextFocusIn( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TextFocusOut( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_SetScanIndex( XmDataFieldWidget tf, XEvent *event) ; static void df_ExtendScanSelection( XmDataFieldWidget tf, XEvent *event) ; static void df_SetScanSelection( XmDataFieldWidget tf, XEvent *event) ; static void df_StartPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_MoveDestination( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ExtendPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ExtendEnd( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DoExtendedSelection( Widget w, Time time) ; static void df_DoSecondaryExtend( Widget w, Time ev_time) ; static void df_BrowseScroll( XtPointer closure, XtIntervalId *id) ; static Boolean df_CheckTimerScrolling( Widget w, XEvent *event) ; static void df_RestorePrimaryHighlight( XmDataFieldWidget tf, XmTextPosition prim_left, XmTextPosition prim_right) ; static void df_StartDrag( Widget w, XEvent *event, String *params, Cardinal *num_params) ; static void df_StartSecondary( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ProcessBDrag( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ExtendSecondary( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DoStuff( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format) ; static void df_Stuff( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_HandleSelectionReplies( Widget w, XtPointer closure, XEvent *event, Boolean *cont) ; static void df_SecondaryNotify( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_HandleTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format) ; static void df_ProcessBDragRelease( Widget w, XEvent *event, String *params, Cardinal *num_params) ; static void df_ProcessCopy( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ProcessMove( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeleteSelection( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ClearSelection( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_PageRight( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_PageLeft( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_CopyPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_CutPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_SetAnchor( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ToggleOverstrike( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_ToggleAddMode( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_SelectAll( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_DeselectAll( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_VoidAction( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_CutClipboard( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_CopyClipboard( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_PasteClipboard( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TraverseDown( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TraverseUp( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TraverseHome( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TraverseNextTabGroup( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TraversePrevTabGroup( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void df_TextEnter( Widget w, XEvent *event, String *params, Cardinal *num_params) ; static void df_TextLeave( Widget w, XEvent *event, String *params, Cardinal *num_params) ; static void df_ClassPartInitialize( WidgetClass w_class) ; static void df_Validates( XmDataFieldWidget tf) ; static Boolean df_LoadFontMetrics( XmDataFieldWidget tf) ; static void df_ValidateString( XmDataFieldWidget tf, char *value, #if NeedWidePrototypes int is_wchar) ; #else Boolean is_wchar) ; #endif /* NeedWidePrototypes */ static void df_InitializeTextStruct( XmDataFieldWidget tf) ; static Pixmap df_GetClipMask( XmDataFieldWidget tf, char *pixmap_name) ; static void df_LoadGCs( XmDataFieldWidget tf, Pixel background, Pixel foreground) ; static void df_MakeIBeamOffArea( XmDataFieldWidget tf, #if NeedWidePrototypes int width, int height) ; #else Dimension width, Dimension height) ; #endif /* NeedWidePrototypes */ static void df_MakeIBeamStencil( XmDataFieldWidget tf, int line_width) ; static void df_MakeAddModeCursor( XmDataFieldWidget tf, int line_width) ; static void df_MakeCursors( XmDataFieldWidget tf) ; static void df_DropDestroyCB( Widget w, XtPointer clientData, XtPointer callData) ; static void df_DropTransferCallback( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format) ; static void df_HandleDrop( Widget w, XmDropProcCallbackStruct *cb) ; static void df_DragProcCallback( Widget w, XtPointer client, XtPointer call) ; static void df_DropProcCallback( Widget w, XtPointer client, XtPointer call) ; static void df_RegisterDropSite( Widget w) ; static void df_Initialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void df_Realize( Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes) ; static void df_Destroy( Widget wid) ; static void df_Resize( Widget w) ; static XtGeometryResult df_QueryGeometry( Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *reply) ; static void DataFieldExpose( Widget w, XEvent *event, Region region) ; static Boolean df_SetValues( Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean DataFieldGetBaselines( Widget w, Dimension **baselines, int *line_count) ; static Boolean DataFieldGetDisplayRect( Widget w, XRectangle *display_rect) ; static void DataFieldMarginsProc( Widget w, XmBaselineMargins *margins_rec) ; static XtPointer DataFieldGetValue(Widget w, int format); static void DataFieldSetValue(Widget w, XtPointer s, int format); static int DataFieldPreferredValue(Widget w); static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value); static Boolean DataFieldRemove(Widget w, XEvent *event); static void PictureVerifyCallback(Widget w, XtPointer call_d, XtPointer client_d); static void ClassInit(void); static void XmDataFieldSetStringWcs(Widget w, wchar_t *wc_value); #endif /* _NO_PROTO */ /***************** End Static Function Declarations ************/ static XmTextScanType df_sarray[] = { XmSELECT_POSITION, XmSELECT_WORD, XmSELECT_LINE }; static int df_sarraysize = XtNumber(df_sarray); static XContext _XmDataFDestContext = 0; static XContext _XmDataFGCContext = 0; static XContext _XmDataFDNDContext = 0; /* default translations and action recs */ static XtActionsRec data_actions[] = { /* ICS DataField actions */ {"ValidateAndMove", df_ValidateAndMove}, /* Text Replacing Bindings */ {"self-insert", df_InsertChar}, {"insert-string", df_InsertString}, {"delete-previous-character", df_DeletePrevChar}, {"delete-next-character", df_DeleteNextChar}, {"delete-previous-word", df_DeletePrevWord}, {"delete-next-word", df_DeleteNextWord}, {"delete-to-end-of-line", df_DeleteToEndOfLine}, {"delete-to-start-of-line", df_DeleteToStartOfLine}, /* Miscellaneous Bindings */ {"activate", df_Activate}, {"process-cancel", df_ProcessCancel}, {"process-bdrag", df_ProcessBDrag}, /* Motion Bindings */ {"backward-character", df_BackwardChar}, {"forward-character", df_ForwardChar}, {"backward-word", df_BackwardWord}, {"forward-word", df_ForwardWord}, {"end-of-line", df_EndOfLine}, {"beginning-of-line", df_BeginningOfLine}, {"page-left", df_PageLeft}, {"page-right", df_PageRight}, /* Selection Bindings */ {"key-select", df_KeySelection}, {"grab-focus", df_StartPrimary}, {"move-destination", df_MoveDestination}, {"extend-start", df_ExtendPrimary}, {"extend-adjust", df_ExtendPrimary}, {"extend-end", df_ExtendEnd}, {"delete-selection", df_DeleteSelection}, {"clear-selection", df_ClearSelection}, {"cut-primary", df_CutPrimary}, {"copy-primary", df_CopyPrimary}, {"set-anchor", df_SetAnchor}, {"toggle-overstrike", df_ToggleOverstrike}, {"toggle-add-mode", df_ToggleAddMode}, {"select-all", df_SelectAll}, {"deselect-all", df_DeselectAll}, /* Quick Cut and Paste Bindings */ {"secondary-start", df_StartSecondary}, {"secondary-adjust", df_ExtendSecondary}, {"copy-to", df_ProcessCopy}, {"move-to", df_ProcessMove}, {"quick-cut-set", df_VoidAction}, {"quick-copy-set", df_VoidAction}, {"do-quick-action", df_VoidAction}, /* Clipboard Bindings */ {"cut-clipboard", df_CutClipboard}, {"copy-clipboard", df_CopyClipboard}, {"paste-clipboard", df_PasteClipboard}, /* Traversal */ {"traverse-next", df_TraverseDown}, {"traverse-prev", df_TraverseUp}, {"traverse-home", df_TraverseHome}, {"next-tab-group", df_TraverseNextTabGroup}, {"prev-tab-group", df_TraversePrevTabGroup}, /* Focus */ {"focusIn", df_TextFocusIn}, {"focusOut", df_TextFocusOut}, {"enter", df_TextEnter}, {"leave", df_TextLeave}, }; static XtResource resources[] = { { XmNpicture, XmCPicture, XmRString, sizeof(String), XtOffsetOf(XmDataFieldRec, data.picture_source), XmRImmediate, (XtPointer) NULL }, { XmNautoFill, XmCAutoFill, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDataFieldRec, data.auto_fill), XmRImmediate, (XtPointer) True }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf(XmDataFieldRec, data.alignment), XmRImmediate, (XtPointer) XmALIGNMENT_BEGINNING }, { XmNpictureErrorCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, data.picture_error_cb), XmRCallback, (XtPointer) NULL }, { XmNvalidateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, data.validate_cb), XmRCallback, (XtPointer) NULL }, /* the following are undocumented overrides of XmTextField resources */ { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.activate_callback), XmRCallback, NULL }, { XmNlosingFocusCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.losing_focus_callback), XmRCallback, NULL }, { XmNfocusCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.focus_callback), XmRCallback, NULL }, { XmNmodifyVerifyCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.modify_verify_callback), XmRCallback, NULL }, { XmNmodifyVerifyCallbackWcs, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.wcs_modify_verify_callback), XmRCallback, NULL }, { XmNmotionVerifyCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.motion_verify_callback), XmRCallback, NULL }, { XmNgainPrimaryCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.gain_primary_callback), XmRCallback, NULL }, { XmNlosePrimaryCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.lose_primary_callback), XmRCallback, NULL }, { XmNvalueChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDataFieldRec, text.value_changed_callback), XmRCallback, NULL }, { XmNvalue, XmCValue, XmRString, sizeof(String), XtOffsetOf(XmDataFieldRec, text.value), XmRString, "" }, { XmNvalueWcs, XmCValueWcs, XmRValueWcs, sizeof(wchar_t*), XtOffsetOf(XmDataFieldRec, text.wc_value), XmRString, NULL }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmDataFieldRec, text.margin_height), XmRImmediate, (XtPointer) 5 }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmDataFieldRec, text.margin_width), XmRImmediate, (XtPointer) 5 }, { XmNcursorPosition, XmCCursorPosition, XmRTextPosition, sizeof (XmTextPosition), XtOffsetOf(XmDataFieldRec, text.cursor_position), XmRImmediate, (XtPointer) 0 }, { XmNcolumns, XmCColumns, XmRShort, sizeof(short), XtOffsetOf(XmDataFieldRec, text.columns), XmRImmediate, (XtPointer) 20 }, { XmNmaxLength, XmCMaxLength, XmRInt, sizeof(int), XtOffsetOf(XmDataFieldRec, text.max_length), XmRImmediate, (XtPointer) INT_MAX }, { XmNblinkRate, XmCBlinkRate, XmRInt, sizeof(int), XtOffsetOf(XmDataFieldRec, text.blink_rate), XmRImmediate, (XtPointer) 500 }, { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDataFieldRec, text.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmDataFieldRec, text.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmDataFieldRec, text.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNselectionArray, XmCSelectionArray, XmRPointer, sizeof(XtPointer), XtOffsetOf(XmDataFieldRec, text.selection_array), XmRImmediate, (XtPointer) df_sarray }, { XmNselectionArrayCount, XmCSelectionArrayCount, XmRInt, sizeof(int), XtOffsetOf(XmDataFieldRec, text.selection_array_count), XmRInt, (XtPointer) &df_sarraysize }, { XmNresizeWidth, XmCResizeWidth, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDataFieldRec, text.resize_width), XmRImmediate, (XtPointer) False }, { XmNpendingDelete, XmCPendingDelete, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDataFieldRec, text.pending_delete), XmRImmediate, (XtPointer) True }, { XmNeditable, XmCEditable, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDataFieldRec, text.editable), XmRImmediate, (XtPointer) True }, { XmNcursorPositionVisible, XmCCursorPositionVisible, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDataFieldRec, text.cursor_position_visible), XmRImmediate, (XtPointer) True }, { XmNverifyBell, XmCVerifyBell, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDataFieldRec, text.verify_bell), XmRImmediate, (XtPointer) XmDYNAMIC_BOOL }, { XmNselectThreshold, XmCSelectThreshold, XmRInt, sizeof(int), XtOffsetOf(XmDataFieldRec, text.threshold), XmRImmediate, (XtPointer) 5 }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf(XmDataFieldRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmTAB_GROUP }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(XmDataFieldRec, text.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmDataFieldRec, text.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNvalue, sizeof(char *), XtOffsetOf(XmDataFieldRec, text.value), df_MakeCopy, NULL }, { XmNvalueWcs, sizeof(wchar_t *), XtOffsetOf(XmDataFieldRec, text.wc_value), df_WcsMakeCopy, NULL }, }; XmPrimitiveClassExtRec _XmDataFPrimClassExtRec = { NULL, NULLQUARK, XmPrimitiveClassExtVersion, sizeof(XmPrimitiveClassExtRec), DataFieldGetBaselines, /* widget_baseline */ DataFieldGetDisplayRect, /* widget_display_rect */ DataFieldMarginsProc, /* get/set widget margins */ }; externaldef(xmdatafieldclassrec) XmDataFieldClassRec xmDataFieldClassRec = { { (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "XmDataField", /* class_name */ sizeof(XmDataFieldRec), /* widget_size */ ClassInit, /* class_initialize */ df_ClassPartInitialize, /* class_part_initiali*/ FALSE, /* class_inited */ df_Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ df_Realize, /* realize */ data_actions, /* actions */ XtNumber(data_actions), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave*/ FALSE, /* visible_interest */ df_Destroy, /* destroy */ df_Resize, /* resize */ DataFieldExpose, /* expose */ df_SetValues, /* set_values */ #ifdef sco /* ICS -pwc 7/28/93 */ NULL, /* set_values_hook */ #else (XtArgsFunc)NULL, /* set_values_hook */ #endif /* sco */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ #ifdef sco /* ICS - pwc 7/28/93 */ NULL, /* accept_focus */ #else (XtAcceptFocusProc)NULL, /* accept_focus */ #endif /* sco */ XtVersion, /* version */ NULL, /* callback_private */ NULL, /* tm_table */ df_QueryGeometry, /* query_geometry */ (XtStringProc)NULL, /* display accel */ NULL, /* extension */ }, { /* Xmprimitive */ XmInheritBorderHighlight, /* border_highlight */ XmInheritBorderUnhighlight, /* border_unhighlight */ NULL, /* translations */ (XtActionProc)NULL, /* arm_and_activate */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num syn_resources */ (XtPointer) &_XmDataFPrimClassExtRec, /* extension */ }, { /* text classs */ NULL, /* extension */ } }; externaldef(xmdatafieldwidgetclass) WidgetClass xmDataFieldWidgetClass = (WidgetClass) &xmDataFieldClassRec; /* AccessXmString Trait record for DataField */ static XmConst XmAccessTextualTraitRec dataFieldCS = { 0, /* version */ DataFieldGetValue, DataFieldSetValue, DataFieldPreferredValue, }; static void #ifdef _NO_PROTO ClassInit() #else ClassInit(void) #endif { XmDataFieldClassRec* wc = &xmDataFieldClassRec; XmTransferTrait tt; /* set TextField's transfer trait */ tt = XmeTraitGet((XtPointer)xmTextFieldWidgetClass, XmQTtransfer); XmeTraitSet((XtPointer)xmDataFieldWidgetClass, XmQTtransfer, (XtPointer) &tt); XmeTraitSet((XtPointer)xmDataFieldWidgetClass, XmQTaccessTextual, (XtPointer) &dataFieldCS); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ValidateAndMove(w, ev, args, nargs) Widget w; XEvent *ev; String *args; Cardinal *nargs; #else df_ValidateAndMove( Widget w, XEvent *ev, String *args, Cardinal *nargs) #endif { XmDataFieldCallbackStruct cbs; /* * We are guaranteed that the picture will have accepted the string, so * just call the verify callbacks. */ cbs.w = w; cbs.text = XmDataFieldGetString(w); cbs.accept = True; XtCallCallbackList(w, XmDataField_validate_cb(w), (XtPointer)&cbs); XtFree(cbs.text); /* * Make sure we accepted it */ if(cbs.accept == False) { XBell(XtDisplay(w), 0); return; } /* * Otherwise just give up the focus and process the traversal as * normal */ if(*nargs > 0 && strncasecmp(args[0], "prev", 4) == 0) { (void) XmProcessTraversal(w, XmTRAVERSE_PREV_TAB_GROUP); } else { (void) XmProcessTraversal(w, XmTRAVERSE_NEXT_TAB_GROUP); } } /* ARGSUSED */ static void #ifdef _NO_PROTO PictureVerifyCallback(w, client_d, call_d) Widget w; XtPointer client_d; XtPointer call_d; #else PictureVerifyCallback( Widget w, XtPointer client_d, XtPointer call_d ) #endif /* _NO_PROTO */ { XmTextVerifyCallbackStruct *cbs = (XmTextVerifyCallbackStruct*) call_d; char *curr, *newptr, *changed = NULL; int src, dst, i; XmPictureState ps; Boolean done = False; /* * If we're just backspacing, allow the change irregarless */ if(cbs->startPos < cbs->currInsert || cbs->text->length == 0) return; /* * Get the current string, and splice in the intended changes */ curr = XmDataFieldGetString(w); newptr = XtMalloc((cbs->text->length + strlen(curr) + 2) * sizeof(char *)); dst = 0; /* Copy in the stuff before the modification */ for(src=0; srcstartPos; src++, dst++) newptr[dst] = curr[src]; /* Then the modification text */ if(cbs->text->ptr) { for(src=0; srctext->length; src++, dst++) newptr[dst] = cbs->text->ptr[src]; } /* Then the last bit */ if(cbs->endPos > cbs->startPos) { for(dst = cbs->endPos + cbs->text->length; srcendPos; src++, dst++) newptr[dst] = curr[src]; } /* And stick a null in for good measure and sanity in debugging */ newptr[dst] = '\0'; /* * Run it through the picture, and bail if it isn't accepted */ ps = XmGetNewPictureState(XmDataField_picture(w)); for(i=0; idoit = False; XtCallCallbackList(w, XmDataField_picture_error_cb(w), NULL); return; } /* * And now try autofilling */ if(XmDataField_auto_fill(w)) { changed = XmPictureDoAutoFill(ps); } else { changed = XmPictureGetCurrentString(ps); } /* * Now the hard part: we may have been auto-filled, so we have to * massage the callback struct to reflect what's happened */ cbs->startPos = 0; /* CR03686 cbs->endPos = strlen(newptr); */ cbs->text->ptr = XtNewString(changed); cbs->text->length = strlen(changed); XtFree(newptr); XmPictureDeleteState(ps); } /* USE ITERATIONS OF mblen TO COUNT THE NUMBER OF CHARACTERS REPRESENTED * BY n_bytes BYTES POINTED TO BY ptr, a pointer to char*. * n_bytes does not include NULL terminator (if any), nor does return. */ /* ARGSUSED */ static int #ifdef _NO_PROTO _XmDataFieldCountCharacters( tf, ptr, n_bytes ) XmDataFieldWidget tf ; char *ptr ; int n_bytes ; #else _XmDataFieldCountCharacters( XmDataFieldWidget tf, char *ptr, int n_bytes ) #endif /* _NO_PROTO */ { char * bptr; int count = 0; int char_size = 0; if (n_bytes <= 0 || ptr == NULL || *ptr == '\0') return 0; if (XmTextF_max_char_size(tf) == 1) return n_bytes; bptr = ptr; for (bptr = ptr; n_bytes > 0; count++, bptr+= char_size){ char_size = mblen(bptr, XmTextF_max_char_size(tf)); if (char_size < 0) break; /* error */ n_bytes -= char_size; } return count; } /* USE ITERATIONS OF wctomb TO COUNT THE NUMBER OF BYTES REQUIRED FOR THE * MULTI-BYTE REPRESENTION OF num_chars WIDE CHARACTERS IN wc_value. * COUNT TERMINATED IF NULL ENCOUNTERED IN THE STRING. * NUMBER OF BYTES IS RETURNED. */ /* ARGSUSED */ int #ifdef _NO_PROTO _XmDataFieldCountBytes( tf, wc_value, num_chars ) XmDataFieldWidget tf; wchar_t * wc_value; int num_chars; #else /* _NO_PROTO */ _XmDataFieldCountBytes( XmDataFieldWidget tf, wchar_t * wc_value, int num_chars) #endif /* _NO_PROTO */ { wchar_t * wc_ptr; char tmp[MB_LEN_MAX]; /* defined in limits.h: max in any locale */ int n_bytes = 0; if (num_chars <= 0 || wc_value == NULL || *wc_value == (wchar_t)0L) return 0; if (XmTextF_max_char_size(tf) == 1) return num_chars; wc_ptr = wc_value; while ((num_chars > 0) && (*wc_ptr != (wchar_t)0L)){ n_bytes += wctomb(tmp, *wc_ptr); num_chars--; wc_ptr++; } return n_bytes; } /*ARGSUSED*/ static void #ifdef _NO_PROTO df_MakeCopy( w, n, value ) Widget w ; int n; XtArgVal *value ; #else df_MakeCopy( Widget w, int n, XtArgVal *value ) #endif /* _NO_PROTO */ { (*value) = (XtArgVal) XmDataFieldGetString (w); } /*ARGSUSED*/ static void #ifdef _NO_PROTO df_WcsMakeCopy( w, n, value ) Widget w ; int n; XtArgVal *value ; #else df_WcsMakeCopy( Widget w, int n, XtArgVal *value ) #endif /* _NO_PROTO */ { (*value) = (XtArgVal) XmDataFieldGetStringWcs (w); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_FreeContextData(w, clientData, callData) Widget w; XtPointer clientData; XtPointer callData; #else df_FreeContextData( Widget w, XtPointer clientData, XtPointer callData ) #endif /* _NO_PROTO */ { XmTextContextData ctx_data = (XmTextContextData) clientData; Display *display = DisplayOfScreen(ctx_data->screen); XtPointer data_ptr; if (XFindContext(display, (Window) ctx_data->screen, ctx_data->context, (char **) &data_ptr)) { if (ctx_data->type == _XM_IS_PIXMAP_CTX) { XFreePixmap(display, (Pixmap) data_ptr); } else if (ctx_data->type != '\0') { if (data_ptr) XtFree((char *) data_ptr); } XDeleteContext (display, (Window) ctx_data->screen, ctx_data->context); } XtFree ((char *) ctx_data); } static TextFDestData #ifdef _NO_PROTO df_GetTextFDestData( w ) Widget w ; #else df_GetTextFDestData( Widget w ) #endif /* _NO_PROTO */ { static TextFDestData dest_data; Display *display = XtDisplay(w); Screen *screen = XtScreen(w); if (_XmDataFDestContext == 0) _XmDataFDestContext = XUniqueContext(); if (XFindContext(display, (Window) screen, _XmDataFDestContext, (char **) &dest_data)) { XmTextContextData ctx_data; Widget xm_display = (Widget) XmGetXmDisplay(display); ctx_data = (XmTextContextData) XtMalloc(sizeof(XmTextContextDataRec)); ctx_data->screen = screen; ctx_data->context = _XmDataFDestContext; ctx_data->type = _XM_IS_DEST_CTX; dest_data = (TextFDestData) XtCalloc(1, sizeof(TextFDestDataRec)); XtAddCallback(xm_display, XmNdestroyCallback, (XtCallbackProc) df_FreeContextData, (XtPointer) ctx_data); XSaveContext(XtDisplay(w), (Window) screen, _XmDataFDestContext, (XPointer)dest_data); } return dest_data; } static void #ifdef _NO_PROTO df_SetDropContext( w ) Widget w ; #else df_SetDropContext( Widget w ) #endif /* _NO_PROTO */ { Display *display = XtDisplay(w); Screen *screen = XtScreen(w); if (_XmDataFDNDContext == 0) _XmDataFDNDContext = XUniqueContext(); XSaveContext(display, (Window)screen, _XmDataFDNDContext, (XPointer)w); } static void #ifdef _NO_PROTO df_DeleteDropContext( w ) Widget w ; #else df_DeleteDropContext( Widget w ) #endif /* _NO_PROTO */ { Display *display = XtDisplay(w); Screen *screen = XtScreen(w); XDeleteContext(display, (Window)screen, _XmDataFDNDContext); } Widget #ifdef _NO_PROTO _XmDataFieldGetDropReciever( w ) Widget w ; #else _XmDataFieldGetDropReciever( Widget w ) #endif /* _NO_PROTO */ { Widget widget; if (_XmDataFDNDContext == 0) return NULL; if (!XFindContext(XtDisplay(w), (Window) XtScreen(w), _XmDataFDNDContext, (char **) &widget)) { return widget; } return NULL; } static TextFGCData #ifdef _NO_PROTO df_GetTextFGCData( w ) Widget w ; #else df_GetTextFGCData( Widget w ) #endif /* _NO_PROTO */ { static TextFGCData gc_data; Display *display = XtDisplay(w); Screen *screen = XtScreen(w); if (_XmDataFGCContext == 0) _XmDataFGCContext = XUniqueContext(); if (XFindContext(display, (Window)screen, _XmDataFGCContext, (char **)&gc_data)) { XmTextContextData ctx_data; Widget xm_display = (Widget) XmGetXmDisplay(display); ctx_data = (XmTextContextData) XtMalloc(sizeof(XmTextContextDataRec)); ctx_data->screen = screen; ctx_data->context = _XmDataFGCContext; ctx_data->type = _XM_IS_GC_DATA_CTX; gc_data = (TextFGCData) XtCalloc(1, sizeof(TextFGCDataRec)); XtAddCallback(xm_display, XmNdestroyCallback, (XtCallbackProc) df_FreeContextData, (XtPointer) ctx_data); XSaveContext(display, (Window)screen, _XmDataFGCContext, (XPointer)gc_data); gc_data->tf = (XmDataFieldWidget) w; } if (gc_data->tf == NULL) gc_data->tf = (XmDataFieldWidget) w; return gc_data; } void #ifdef _NO_PROTO _XmDataFToggleCursorGC( widget ) Widget widget; #else _XmDataFToggleCursorGC( Widget widget ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) widget; XGCValues values; unsigned long valuemask = GCFillStyle|GCFunction|GCForeground|GCBackground; if (!XtIsRealized(widget)) return; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); #ifdef FIX_1501 if (!XtIsSensitive(widget)) { valuemask = GCForeground|GCBackground|GCFillStyle|GCStipple|GCFunction; values.foreground = _XmAssignInsensitiveColor((Widget)tf); values.background = tf->core.background_pixel; values.fill_style = FillStippled; if (XmTextF_overstrike(tf)) { if (XmTextF_stipple_tile(tf) == XmUNSPECIFIED_PIXMAP) return; values.stipple = XmTextF_stipple_tile(tf); values.function = GXxor; } else { if (XmTextF_cursor(tf) == XmUNSPECIFIED_PIXMAP) return; values.stipple = XmTextF_cursor(tf); values.function = GXcopy; } } else { #endif if (XmTextF_overstrike(tf)) { if (!XmTextF_add_mode(tf) && XtIsSensitive(widget) && (XmTextF_has_focus(tf) || XmTextF_has_destination(tf))) { values.fill_style = FillSolid; } else { values.fill_style = FillTiled; } values.foreground = values.background = tf->primitive.foreground ^ tf->core.background_pixel; values.function = GXxor; } else { if (XtIsSensitive(widget) && !XmTextF_add_mode(tf) && (XmTextF_has_focus(tf) || XmTextF_has_destination(tf))) { if (XmTextF_cursor(tf) == XmUNSPECIFIED_PIXMAP) return; values.stipple = XmTextF_cursor(tf); } else { if (XmTextF_add_mode_cursor(tf) == XmUNSPECIFIED_PIXMAP) return; values.stipple = XmTextF_add_mode_cursor(tf); } values.fill_style = FillStippled; values.function = GXcopy; if (XmTextF_have_inverted_image_gc(tf)){ values.background = tf->primitive.foreground; values.foreground = tf->core.background_pixel; } else { values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; } valuemask |= GCStipple; } #ifdef FIX_1501 } #endif XChangeGC(XtDisplay(widget), XmTextF_image_gc(tf), valuemask, &values); } /* * Find the highlight record corresponding to the given position. Returns a * pointer to the record. The third argument indicates whether we are probing * the left or right edge of a highlighting range. */ static _XmHighlightRec * #ifdef _NO_PROTO df_FindHighlight( w, position ) XmDataFieldWidget w ; XmTextPosition position ; #else df_FindHighlight( XmDataFieldWidget w, XmTextPosition position ) #endif /* _NO_PROTO */ { _XmHighlightRec *l = XmTextF_highlight(w).list; int i; for (i=XmTextF_highlight(w).number - 1 ; i>=0 ; i--) if (position >= l[i].position) { l = l + i; break; } return(l); } static void #ifdef _NO_PROTO df_InsertHighlight( w, position, mode ) XmDataFieldWidget w ; XmTextPosition position ; XmHighlightMode mode ; #else df_InsertHighlight( XmDataFieldWidget w, XmTextPosition position, XmHighlightMode mode ) #endif /* _NO_PROTO */ { _XmHighlightRec *l1; _XmHighlightRec *l = XmTextF_highlight(w).list; int i, j; l1 = df_FindHighlight(w, position); if (l1->position == position) l1->mode = mode; else { i = (l1 - l) + 1; XmTextF_highlight(w).number++; if (XmTextF_highlight(w).number > XmTextF_highlight(w).maximum) { XmTextF_highlight(w).maximum = XmTextF_highlight(w).number; l = XmTextF_highlight(w).list = (_XmHighlightRec *)XtRealloc((char *) l, (unsigned)(XmTextF_highlight(w).maximum * sizeof(_XmHighlightRec))); } for (j=XmTextF_highlight(w).number-1 ; j>i ; j--) l[j] = l[j-1]; l[i].position = position; l[i].mode = mode; } } static void #ifdef _NO_PROTO DataFieldSetHighlight( tf, left, right, mode ) XmDataFieldWidget tf ; XmTextPosition left ; XmTextPosition right ; XmHighlightMode mode ; #else DataFieldSetHighlight( XmDataFieldWidget tf, XmTextPosition left, XmTextPosition right, XmHighlightMode mode ) #endif /* _NO_PROTO */ { _XmHighlightRec *l; XmHighlightMode endmode; int i, j; if (left >= right || right <= 0) return; _XmDataFieldDrawInsertionPoint(tf, False); endmode = df_FindHighlight(tf, right)->mode; df_InsertHighlight(tf, left, mode); df_InsertHighlight(tf, right, endmode); l = XmTextF_highlight(tf).list; i = 1; while (i < XmTextF_highlight(tf).number) { if (l[i].position >= left && l[i].position < right) l[i].mode = mode; if (l[i].mode == l[i-1].mode) { XmTextF_highlight(tf).number--; for (j=i ; j left && XmTextF_cursor_position(tf) < right){ if (mode == XmHIGHLIGHT_SELECTED){ df_InvertImageGC(tf); } else if (mode != XmHIGHLIGHT_SELECTED){ df_ResetImageGC(tf); } } XmTextF_refresh_ibeam_off(tf) = True; _XmDataFieldDrawInsertionPoint(tf, True); } /* * Get x and y based on position. */ static Boolean #ifdef _NO_PROTO df_GetXYFromPos( tf, position, x, y ) XmDataFieldWidget tf ; XmTextPosition position ; Position *x ; Position *y ; #else df_GetXYFromPos( XmDataFieldWidget tf, XmTextPosition position, Position *x, Position *y ) #endif /* _NO_PROTO */ { int x1, x2; /* initialize the x and y positions to zero */ if (XmDataField_alignment(tf) == XmALIGNMENT_BEGINNING) { *x = 0; *y = 0; if (position > XmTextF_string_length(tf)) return False; if (XmTextF_max_char_size(tf) != 1) { x1 = df_FindPixelLength(tf, (char*)XmTextF_wc_value(tf), (int)position); } else { x1 = df_FindPixelLength(tf, XmTextF_value(tf), (int)position); } } else { int length; *x = tf->core.width - (XmTextF_margin_width(tf) + tf->primitive.highlight_thickness + tf->primitive.shadow_thickness); *y = 0; length = XmTextF_string_length(tf) - position; if (length < 0) return False; if (XmTextF_max_char_size(tf) != 1) { x1 = df_FindPixelLength(tf, (char*)(XmTextF_wc_value(tf) + position), length); } else { x1 = df_FindPixelLength(tf, XmTextF_value(tf) + position, length); } } *y += tf->primitive.highlight_thickness + tf->primitive.shadow_thickness + XmTextF_margin_top(tf) + XmTextF_font_ascent(tf); x2 = (Position) XmTextF_h_offset(tf); if (XmDataField_alignment(tf) == XmALIGNMENT_BEGINNING) { *x += x1 + x2; } else { *x -= (x1 - x2); } return True; } static Boolean #ifdef _NO_PROTO df_CurrentCursorState( tf ) XmDataFieldWidget tf ; #else df_CurrentCursorState( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { if (XmTextF_cursor_on(tf) < 0) return False; if (XmTextF_blink_on(tf) || !XtIsSensitive((Widget)tf)) return True; return False; } /* * Paint insert cursor */ static void #ifdef _NO_PROTO df_PaintCursor( tf ) XmDataFieldWidget tf ; #else df_PaintCursor( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { Position x, y; XmTextPosition position; if (!XmTextF_cursor_position_visible(tf)) return; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); position = XmTextF_cursor_position(tf); (void) df_GetXYFromPos(tf, position, &x, &y); if (!XmTextF_overstrike(tf)) x -=(XmTextF_cursor_width(tf) >> 1) + 1; /* "+1" for 1 pixel left of char */ else { int pxlen; if (XmTextF_max_char_size(tf) != 1) pxlen = df_FindPixelLength(tf, (char*)&(XmTextF_wc_value(tf)[position]), 1); else pxlen = df_FindPixelLength(tf, &(XmTextF_value(tf)[position]), 1); if (pxlen > XmTextF_cursor_width(tf)) x += (pxlen - XmTextF_cursor_width(tf)) >> 1; } y = (y + (Position) XmTextF_font_descent(tf)) - (Position) XmTextF_cursor_height(tf); /* If time to paint the I Beam... first capture the IBeamOffArea, then draw * the IBeam */ if (XmTextF_refresh_ibeam_off(tf) == True){ /* get area under IBeam first */ /* Fill is needed to realign clip rectangle with gc */ XFillRectangle(XtDisplay((Widget)tf), XtWindow((Widget)tf), XmTextF_save_gc(tf), 0, 0, 0, 0); XCopyArea(XtDisplay(tf), XtWindow(tf), XmTextF_ibeam_off(tf), XmTextF_save_gc(tf), x, y, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf), 0, 0); XmTextF_refresh_ibeam_off(tf) = False; } if ((XmTextF_cursor_on(tf) >= 0) && XmTextF_blink_on(tf)) { #ifdef FIX_1501 if (!XtIsSensitive((Widget) tf)) { df_XmSetShadowGC(tf, XmTextF_image_gc(tf)); XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_image_gc(tf), x + 1, y + 1, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf)); } _XmDataFToggleCursorGC((Widget) tf); #endif XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_image_gc(tf), x, y, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf)); } else { XCopyArea(XtDisplay(tf), XmTextF_ibeam_off(tf), XtWindow(tf), XmTextF_save_gc(tf), 0, 0, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf), x, y); } } void #ifdef _NO_PROTO _XmDataFieldDrawInsertionPoint( tf, turn_on ) XmDataFieldWidget tf ; Boolean turn_on ; #else _XmDataFieldDrawInsertionPoint( XmDataFieldWidget tf, Boolean turn_on ) #endif /* _NO_PROTO */ { if (turn_on == True) { XmTextF_cursor_on(tf) += 1; if (XmTextF_blink_rate(tf) == 0 || !XmTextF_has_focus(tf)) XmTextF_blink_on(tf) = True; } else { if (XmTextF_blink_on(tf) && (XmTextF_cursor_on(tf) == 0)) if (XmTextF_blink_on(tf) == df_CurrentCursorState(tf) && XtIsRealized((Widget)tf)){ XmTextF_blink_on(tf) = !XmTextF_blink_on(tf); df_PaintCursor(tf); } XmTextF_cursor_on(tf) -= 1; } if (XmTextF_cursor_on(tf) < 0 || !XtIsRealized((Widget) tf)) return; df_PaintCursor(tf); } static void #ifdef _NO_PROTO df_BlinkInsertionPoint( tf ) XmDataFieldWidget tf ; #else df_BlinkInsertionPoint( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { if ((XmTextF_cursor_on(tf) >= 0) && XmTextF_blink_on(tf) == df_CurrentCursorState(tf) && XtIsRealized((Widget)tf)) { XmTextF_blink_on(tf) = !XmTextF_blink_on(tf); df_PaintCursor(tf); } } /* * Handle blink on and off */ /* ARGSUSED */ static void #ifdef _NO_PROTO df_HandleTimer( closure, id ) XtPointer closure ; XtIntervalId *id ; #else df_HandleTimer( XtPointer closure, XtIntervalId *id ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) closure; if (XmTextF_blink_rate(tf) != 0) XmTextF_timer_id(tf) = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)tf), (unsigned long)XmTextF_blink_rate(tf), df_HandleTimer, (XtPointer) closure); if (XmTextF_has_focus(tf) && XtIsSensitive((Widget)tf)) df_BlinkInsertionPoint(tf); } /* * Change state of blinking insert cursor on and off */ static void #ifdef _NO_PROTO df_ChangeBlinkBehavior( tf, turn_on ) XmDataFieldWidget tf ; Boolean turn_on ; #else df_ChangeBlinkBehavior( XmDataFieldWidget tf, #if NeedWidePrototypes int turn_on ) #else Boolean turn_on ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { if (turn_on) { if (XmTextF_blink_rate(tf) != 0 && XmTextF_timer_id(tf) == (XtIntervalId)0) XmTextF_timer_id(tf) = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)tf), (unsigned long)XmTextF_blink_rate(tf), df_HandleTimer, (XtPointer) tf); XmTextF_blink_on(tf) = True; } else { if (XmTextF_timer_id(tf)) XtRemoveTimeOut(XmTextF_timer_id(tf)); XmTextF_timer_id(tf) = (XtIntervalId)0; } } static void #ifdef _NO_PROTO df_GetRect( tf, rect ) XmDataFieldWidget tf ; XRectangle *rect ; #else df_GetRect( XmDataFieldWidget tf, XRectangle *rect ) #endif /* _NO_PROTO */ { Dimension margin_width = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_top = XmTextF_margin_top(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_bottom = XmTextF_margin_bottom(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; if (margin_width < tf->core.width) rect->x = margin_width; else rect->x = tf->core.width; if (margin_top < tf->core.height) rect->y = margin_top; else rect->y = tf->core.height; if ((int)(2 * margin_width) < (int)tf->core.width) rect->width = (int) tf->core.width - (2 * margin_width); else rect->width = 0; if ((int)(margin_top + margin_bottom) < (int)tf->core.height) rect->height = (int) tf->core.height - (margin_top + margin_bottom); else rect->height = 0; } static void #ifdef _NO_PROTO df_CheckHasRect( tf ) XmDataFieldWidget tf ; #else df_CheckHasRect( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { /* * Make sure the cached GC has the clipping rectangle * set to the current widget. */ if (!XmTextF_has_rect(tf)) { TextFGCData gc_data = df_GetTextFGCData((Widget)tf); XmTextF_has_rect(gc_data->tf) = False; gc_data->tf = tf; XmTextF_has_rect(tf) = True; } } static void #ifdef _NO_PROTO df_XmSetFullGC( tf, gc ) XmDataFieldWidget tf ; GC gc ; #else df_XmSetFullGC( XmDataFieldWidget tf, GC gc ) #endif /* _NO_PROTO */ { XRectangle ClipRect; /* adjust clip rectangle to allow the cursor to paint into the margins */ ClipRect.x = tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; ClipRect.y = tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; ClipRect.width = tf->core.width - (2 * (tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)); ClipRect.height = tf->core.height - (2 * (tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)); XSetClipRectangles(XtDisplay(tf), gc, 0, 0, &ClipRect, 1, Unsorted); } static void #ifdef _NO_PROTO df_XmSetMarginGC( tf, gc ) XmDataFieldWidget tf ; GC gc ; #else df_XmSetMarginGC( XmDataFieldWidget tf, GC gc ) #endif /* _NO_PROTO */ { XRectangle ClipRect; df_GetRect(tf, &ClipRect); #ifdef USE_XFT if (XmTextF_use_xft(tf)) _XmXftSetClipRectangles(XtDisplay(tf), XtWindow(tf), 0, 0, &ClipRect, 1); #endif XSetClipRectangles(XtDisplay(tf), gc, 0, 0, &ClipRect, 1, Unsorted); } static void #ifdef _NO_PROTO df_XmResetSaveGC( tf, gc ) XmDataFieldWidget tf ; GC gc ; #else df_XmResetSaveGC( XmDataFieldWidget tf, GC gc ) #endif /* _NO_PROTO */ { XSetClipMask(XtDisplay(tf), gc, None); } /* * Set new clipping rectangle for text field. This is * done on each focus in event since the text field widgets * share the same GC. */ void #ifdef _NO_PROTO _XmDataFieldSetClipRect( tf ) XmDataFieldWidget tf ; #else _XmDataFieldSetClipRect( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { XGCValues values; unsigned long valuemask = (unsigned long) 0; /* * Make sure the cached GC has the clipping rectangle * set to the current widget. */ df_CheckHasRect(tf); df_XmSetMarginGC(tf, XmTextF_gc(tf)); df_XmSetFullGC(tf, XmTextF_image_gc(tf)); df_ResetClipOrigin(tf, False); /* Restore cached save gc to state correct for this instantiation */ if (XmTextF_save_gc(tf)){ valuemask = (GCFunction | GCBackground | GCForeground); values.function = GXcopy; values.foreground = tf->primitive.foreground ; values.background = tf->core.background_pixel; XChangeGC(XtDisplay(tf), XmTextF_save_gc(tf), valuemask, &values); } /* Restore cached text gc to state correct for this instantiation */ if (XmTextF_gc(tf)){ #if USE_XFT if (!XmTextF_have_fontset(tf) && !XmTextF_use_xft(tf) && (XmTextF_font(tf) != NULL)) { #else if (!XmTextF_have_fontset(tf) && (XmTextF_font(tf) != NULL)){ #endif valuemask |= GCFont; values.font = XmTextF_font(tf)->fid; } valuemask |= GCGraphicsExposures; values.graphics_exposures = (Bool) True; values.foreground = tf->primitive.foreground ^ tf->core.background_pixel; values.background = 0; XChangeGC(XtDisplay(tf), XmTextF_gc(tf), valuemask, &values); } /* Restore cached image gc to state correct for this instantiation */ if (XmTextF_image_gc(tf)){ valuemask = (GCForeground | GCBackground); if (XmTextF_overstrike(tf)) { values.background = values.foreground = tf->core.background_pixel ^ tf->primitive.foreground; } else if (XmTextF_have_inverted_image_gc(tf)){ values.background = tf->primitive.foreground; values.foreground = tf->core.background_pixel; } else { values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; } XChangeGC(XtDisplay(tf), XmTextF_image_gc(tf), valuemask, &values); } _XmDataFToggleCursorGC((Widget)tf); } static void #ifdef _NO_PROTO df_XmSetNormGC( tf, gc, change_stipple, stipple ) XmDataFieldWidget tf ; GC gc ; Boolean change_stipple; Boolean stipple; #else df_XmSetNormGC( XmDataFieldWidget tf, GC gc, #if NeedWidePrototypes int change_stipple, int stipple) #else Boolean change_stipple, Boolean stipple) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; if (change_stipple) { #ifdef FIX_1381 valueMask |= GCFillStyle; if (stipple) { /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor((Widget)tf); values.fill_style = FillSolid; } else values.fill_style = FillSolid; #else valueMask |= GCTile | GCFillStyle; values.tile = XmTextF_stipple_tile(tf); if (stipple) values.fill_style = FillTiled; else values.fill_style = FillSolid; #endif } XChangeGC(XtDisplay(tf), gc, valueMask, &values); } #ifdef FIX_1381 static void #ifdef _NO_PROTO df_XmSetShadowGC( tf, gc ) XmDataFieldWidget tf ; GC gc ; #else df_XmSetShadowGC( XmDataFieldWidget tf, GC gc ) #endif /* _NO_PROTO */ { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; values.foreground = tf->primitive.top_shadow_color; values.background = tf->core.background_pixel; XChangeGC(XtDisplay(tf), gc, valueMask, &values); } #endif static void #ifdef _NO_PROTO df_XmSetInvGC( tf, gc ) XmDataFieldWidget tf ; GC gc ; #else df_XmSetInvGC( XmDataFieldWidget tf, GC gc ) #endif /* _NO_PROTO */ { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); values.foreground = tf->core.background_pixel; values.background = tf->primitive.foreground; XChangeGC(XtDisplay(tf), gc, valueMask, &values); } static void #ifdef _NO_PROTO df_DrawText( tf, gc, x, y, string, length ) XmDataFieldWidget tf ; GC gc ; int x ; int y ; char * string ; int length ; #else df_DrawText( XmDataFieldWidget tf, GC gc, int x, int y, char * string, int length ) #endif /* _NO_PROTO */ { if (XmTextF_have_fontset(tf)){ if (XmTextF_max_char_size(tf) != 1) XwcDrawString (XtDisplay(tf), XtWindow(tf), (XFontSet)XmTextF_font(tf), gc, x, y, (wchar_t*) string, length); else /* one byte chars */ XmbDrawString (XtDisplay(tf), XtWindow(tf), (XFontSet)XmTextF_font(tf), gc, x, y, string, length); #ifdef USE_XFT } else if (XmTextF_use_xft(tf)) { if (XmTextF_max_char_size(tf) != 1) { /* was passed a wchar_t* */ char stack_cache[400], *tmp; wchar_t tmp_wc; wchar_t *wc_string = (wchar_t*)string; int num_bytes = 0; /* ptr = tmp = XtMalloc((int)(length + 1)*sizeof(wchar_t)); */ tmp = (char *)XmStackAlloc((Cardinal) ((length + 1)*sizeof(wchar_t)), stack_cache); tmp_wc = wc_string[length]; wc_string[length] = 0L; num_bytes = wcstombs(tmp, wc_string, (int)((length + 1) * sizeof(wchar_t))); wc_string[length] = tmp_wc; if (num_bytes >= 0) _XmXftDrawString2(XtDisplay(tf), XtWindow(tf), gc, XmTextF_xft_font(tf), 1, x, y, tmp, num_bytes); XmStackFree(tmp, stack_cache); } else /* one byte chars */ _XmXftDrawString2(XtDisplay(tf), XtWindow(tf), gc, XmTextF_xft_font(tf), 1, x, y, string, length); #endif } else { /* have a font struct, not a font set */ if (XmTextF_max_char_size(tf) != 1) { /* was passed a wchar_t* */ char stack_cache[400], *tmp; wchar_t tmp_wc; wchar_t *wc_string = (wchar_t*)string; int num_bytes = 0; /* ptr = tmp = XtMalloc((int)(length + 1)*sizeof(wchar_t)); */ tmp = (char *)XmStackAlloc((Cardinal) ((length + 1)*sizeof(wchar_t)), stack_cache); tmp_wc = wc_string[length]; wc_string[length] = 0L; num_bytes = wcstombs(tmp, wc_string, (int)((length + 1) * sizeof(wchar_t))); wc_string[length] = tmp_wc; if (num_bytes >= 0) { if (_XmIsISO10646(XtDisplay(tf), XmTextF_font(tf))) { size_t str_len = 0; XChar2b *str = _XmUtf8ToUcs2(tmp, num_bytes, &str_len); XDrawString16(XtDisplay(tf), XtWindow(tf), gc, x, y, str, str_len); XFree(str); } else XDrawString(XtDisplay(tf), XtWindow(tf), gc, x, y, tmp, num_bytes); } XmStackFree((char *)tmp, stack_cache); } else /* one byte chars */ XDrawString (XtDisplay(tf), XtWindow(tf), gc, x, y, string, length); } } static int #ifdef _NO_PROTO df_FindPixelLength( tf, string, length) XmDataFieldWidget tf ; char * string ; int length ; #else df_FindPixelLength( XmDataFieldWidget tf, char * string, int length ) #endif /* _NO_PROTO */ { if (XmTextF_have_fontset(tf)) { if (XmTextF_max_char_size(tf) != 1) return (XwcTextEscapement((XFontSet)XmTextF_font(tf), (wchar_t *) string, length)); else /* one byte chars */ return (XmbTextEscapement((XFontSet)XmTextF_font(tf), string, length)); #ifdef USE_XFT } else if (XmTextF_use_xft(tf)) { XGlyphInfo ext; if (XmTextF_max_char_size(tf) != 1) { /* was passed a wchar_t* */ wchar_t *wc_string = (wchar_t*)string; wchar_t wc_tmp = wc_string[length]; char stack_cache[400], *tmp; int num_bytes; wc_string[length] = 0L; tmp = (char*)XmStackAlloc((Cardinal)((length + 1) * sizeof(wchar_t)), stack_cache); num_bytes = wcstombs(tmp, wc_string, (int)((length + 1)*sizeof(wchar_t))); wc_string[length] = wc_tmp; XftTextExtentsUtf8(XtDisplay(tf), XmTextF_xft_font(tf), (FcChar8*)tmp, num_bytes, &ext); XmStackFree(tmp, stack_cache); } else /* one byte chars */ XftTextExtentsUtf8(XtDisplay(tf), XmTextF_xft_font(tf), (FcChar8*)string, length, &ext); return ext.xOff; #endif } else { /* have font struct, not a font set */ if (XmTextF_max_char_size(tf) != 1) { /* was passed a wchar_t* */ wchar_t *wc_string = (wchar_t*)string; wchar_t wc_tmp = wc_string[length]; char stack_cache[400], *tmp; int num_bytes, ret_len = 0; wc_string[length] = 0L; tmp = (char*)XmStackAlloc((Cardinal)((length + 1) * sizeof(wchar_t)), stack_cache); num_bytes = wcstombs(tmp, wc_string, (int)((length + 1)*sizeof(wchar_t))); wc_string[length] = wc_tmp; if (num_bytes >= 0) { if (_XmIsISO10646(XtDisplay(tf), XmTextF_font(tf))) { size_t str_len = 0; XChar2b *str = _XmUtf8ToUcs2(tmp, num_bytes, &str_len); ret_len = XTextWidth16(XmTextF_font(tf), str, str_len); XFree(str); } else ret_len = XTextWidth(XmTextF_font(tf), tmp, num_bytes); } XmStackFree((char *)tmp, stack_cache); return (ret_len); } else /* one byte chars */ return (XTextWidth(XmTextF_font(tf), string, length)); } } static void #ifdef _NO_PROTO df_DrawTextSegment( tf, mode, prev_seg_start, seg_start, seg_end, next_seg, stipple, y, x) XmDataFieldWidget tf ; XmHighlightMode mode; XmTextPosition prev_seg_start; XmTextPosition seg_start; XmTextPosition seg_end; XmTextPosition next_seg; Boolean stipple; int y ; int *x ; #else df_DrawTextSegment( XmDataFieldWidget tf, XmHighlightMode mode, XmTextPosition prev_seg_start, XmTextPosition seg_start, XmTextPosition seg_end, XmTextPosition next_seg, #if NeedWidePrototypes int stipple, #else Boolean stipple, #endif /* NeedWidePrototypes */ int y, int *x) #endif /* _NO_PROTO */ { int x_seg_len; #if PWC_DEBUG { char seg[256]; memset((char *)seg, 256, 0); strncpy(seg, (char *)(XmTextF_value(tf) + seg_start), seg_end - seg_start); seg[seg_end] = '\0'; printf("df_DrawText(\"%s\" - %s) :: [start(%d), end(%d), x(%d), offset(%d)]\n", seg, (mode == XmHIGHLIGHT_NORMAL ? "NORMAL" : "HIGHLIGHT"), seg_start, seg_end, *x, XmTextF_h_offset(tf)); } #endif /* update x position up to start position */ if (XmTextF_max_char_size(tf) != 1) { *x += df_FindPixelLength(tf, (char*)(XmTextF_wc_value(tf) + prev_seg_start), (int)(seg_start - prev_seg_start)); x_seg_len = df_FindPixelLength(tf, (char*)(XmTextF_wc_value(tf) + seg_start), (int)seg_end - (int)seg_start); } else { *x += df_FindPixelLength(tf, XmTextF_value(tf) + prev_seg_start, (int)(seg_start - prev_seg_start)); x_seg_len = df_FindPixelLength(tf, XmTextF_value(tf) + seg_start, (int)seg_end - (int)seg_start); } if (mode == XmHIGHLIGHT_SELECTED) { /* Draw the selected text using an inverse gc */ df_XmSetNormGC(tf, XmTextF_gc(tf), False, False); XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), *x, y - XmTextF_font_ascent(tf), x_seg_len, XmTextF_font_ascent(tf) + XmTextF_font_descent(tf)); df_XmSetInvGC(tf, XmTextF_gc(tf)); } else { df_XmSetInvGC(tf, XmTextF_gc(tf)); XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), *x, y - XmTextF_font_ascent(tf), x_seg_len, XmTextF_font_ascent(tf) + XmTextF_font_descent(tf)); df_XmSetNormGC(tf, XmTextF_gc(tf), True, stipple); } #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ df_XmSetShadowGC(tf, XmTextF_gc(tf)); if (tf->text.max_char_size != 1) { df_DrawText(tf, XmTextF_gc(tf), *x + 1, y + 1, (char*) (XmTextF_wc_value(tf) + seg_start), (int)seg_end - (int)seg_start); } else { df_DrawText(tf, XmTextF_gc(tf), *x + 1, y + 1, XmTextF_value(tf) + seg_start, (int)seg_end - (int)seg_start); } df_XmSetNormGC(tf, XmTextF_gc(tf), True, stipple); } #endif if (XmTextF_max_char_size(tf) != 1) { df_DrawText(tf, XmTextF_gc(tf), *x, y, (char*) (XmTextF_wc_value(tf) + seg_start), (int)seg_end - (int)seg_start); } else { df_DrawText(tf, XmTextF_gc(tf), *x, y, XmTextF_value(tf) + seg_start, (int)seg_end - (int)seg_start); } if (stipple) df_XmSetNormGC(tf, XmTextF_gc(tf), True, !stipple); if (mode == XmHIGHLIGHT_SECONDARY_SELECTED) XDrawLine(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), *x, y, *x + x_seg_len - 1, y); /* update x position up to the next highlight position */ if (XmTextF_max_char_size(tf) != 1) *x += df_FindPixelLength(tf, (char*) (XmTextF_wc_value(tf) + seg_start), (int)(next_seg - (int)seg_start)); else *x += df_FindPixelLength(tf, XmTextF_value(tf) + seg_start, (int)(next_seg - (int)seg_start)); } /* * Redisplay the new adjustments that have been made the the text * field widget. */ static void #ifdef _NO_PROTO df_RedisplayText( tf, start, end ) XmDataFieldWidget tf ; XmTextPosition start ; XmTextPosition end ; #else df_RedisplayText( XmDataFieldWidget tf, XmTextPosition start, XmTextPosition end ) #endif /* _NO_PROTO */ { _XmHighlightRec *l = XmTextF_highlight(tf).list; XRectangle rect; int x, y, i, startx = 0; Dimension margin_width = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_top = XmTextF_margin_top(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_bottom = XmTextF_margin_bottom(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Boolean stipple = False; if (!XtIsRealized((Widget)tf)) return; if (XmTextF_in_setvalues(tf)) { XmTextF_redisplay(tf) = True; return; } if ((int)tf->core.width - (int)(2 * margin_width) <= 0) return; if ((int)tf->core.height - (int)(margin_top + margin_bottom) <= 0) return; /* * Make sure the cached GC has the clipping rectangle * set to the current widget. */ if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); _XmDataFieldDrawInsertionPoint(tf, False); /* Get the current rectangle. */ df_GetRect(tf, &rect); y = margin_top + XmTextF_font_ascent(tf); if (XmDataField_alignment(tf) == XmALIGNMENT_END) { x = tf->core.width - margin_width + XmTextF_h_offset(tf); if (XmTextF_max_char_size(tf) != 1) x -= df_FindPixelLength(tf, (char*)(XmTextF_wc_value(tf) + l[0].position), XmTextF_string_length(tf) - l[0].position); else x -= df_FindPixelLength(tf, XmTextF_value(tf) + l[0].position, XmTextF_string_length(tf) - l[0].position); /* PWC - alignment requires we draw all characters to the left of end */ start = 0; startx = x; } else x = (int) XmTextF_h_offset(tf); if (!XtIsSensitive((Widget)tf)) stipple = True; /* search through the highlight array and draw the text */ for (i = 0; i + 1 < XmTextF_highlight(tf).number; i++) { #if PWC_DEBUG printf("XmTextF_value(\"%s\")::Highlight #%d = pos(%d), start(%d), end(%d)\n", (char *)XmTextF_value(tf), i, l[i].position, start, end); #endif /* make sure start is within current highlight */ if (l[i].position <= start && start < l[i+1].position && l[i].position < end) { if (end > l[i+1].position) { df_DrawTextSegment(tf, l[i].mode, l[i].position, start, l[i+1].position, l[i+1].position, stipple, y, &x); /* update start position to the next highlight position */ start = l[i+1].position; } else { df_DrawTextSegment(tf, l[i].mode, l[i].position, start, end, l[i+1].position, stipple, y, &x); start = end; } } else { /* start not within current record */ if (XmTextF_max_char_size(tf) != 1) { x += df_FindPixelLength(tf, (char *) (XmTextF_wc_value(tf) + l[i].position), (int)(l[i+1].position - l[i].position)); } else { x += df_FindPixelLength(tf, XmTextF_value(tf) + l[i].position, (int)(l[i+1].position - l[i].position)); } } } /* end for loop */ if (l[i].position < end) { /* complete the drawing of the text to the end of the line */ df_DrawTextSegment(tf, l[i].mode, l[i].position, start, end, XmTextF_string_length(tf), stipple, y, &x); } else { if (XmTextF_max_char_size(tf) != 1) x += df_FindPixelLength(tf, (char*) (XmTextF_wc_value(tf) + l[i].position), XmTextF_string_length(tf) - (int)l[i].position); else x += df_FindPixelLength(tf, XmTextF_value(tf) + l[i].position, XmTextF_string_length(tf) - (int)l[i].position); } if (x < (int)(rect.x + rect.width) && XmDataField_alignment(tf) == XmALIGNMENT_BEGINNING) { df_XmSetInvGC(tf, XmTextF_gc(tf)); XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), x, rect.y, rect.x + rect.width - x, rect.height); } else if (XmTextF_h_offset(tf) < startx && XmDataField_alignment(tf) == XmALIGNMENT_END) { df_XmSetInvGC(tf, XmTextF_gc(tf)); XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), XmTextF_h_offset(tf), rect.y, startx - XmTextF_h_offset(tf), rect.height); } XmTextF_refresh_ibeam_off(tf) = True; _XmDataFieldDrawInsertionPoint(tf, True); } /* * Use the font along with the resources that have been set * to determine the height and width of the text field widget. */ static void #ifdef _NO_PROTO df_ComputeSize( tf, width, height ) XmDataFieldWidget tf ; Dimension *width ; Dimension *height ; #else df_ComputeSize( XmDataFieldWidget tf, Dimension *width, Dimension *height ) #endif /* _NO_PROTO */ { Dimension tmp = 0; if (XmTextF_resize_width(tf) && XmTextF_columns(tf) < XmTextF_string_length(tf)){ if (XmTextF_max_char_size(tf) != 1) tmp = df_FindPixelLength(tf, (char *)XmTextF_wc_value(tf), XmTextF_string_length(tf)); else tmp = df_FindPixelLength(tf, XmTextF_value(tf), XmTextF_string_length(tf)); *width = tmp + (2 * (XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)); } else { *width = XmTextF_columns(tf) * XmTextF_average_char_width(tf) + 2 * (XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); } if (height != NULL) *height = XmTextF_font_descent(tf) + XmTextF_font_ascent(tf) + 2 * (XmTextF_margin_height(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); } /* * df_TryResize - Attempts to resize the width of the text field widget. * If the attempt fails or is ineffective, return GeometryNo. */ static XtGeometryResult #ifdef _NO_PROTO df_TryResize( tf, width, height ) XmDataFieldWidget tf ; Dimension width ; Dimension height ; #else df_TryResize( XmDataFieldWidget tf, #if NeedWidePrototypes int width, int height ) #else Dimension width, Dimension height ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { Dimension reswidth, resheight; Dimension origwidth = tf->core.width; XtGeometryResult result; result = XtMakeResizeRequest((Widget)tf, width, height, &reswidth, &resheight); if (result == XtGeometryAlmost) { result = XtMakeResizeRequest((Widget)tf, reswidth, resheight, &reswidth, &resheight); if (reswidth == origwidth) result = XtGeometryNo; return result; } /* * Caution: Some geometry managers return XtGeometryYes * and don't change the widget's size. */ if (tf->core.width != width && tf->core.height != height) result = XtGeometryNo; return result; } /* * Function df_AdjustText * * df_AdjustText ensures that the character at the given position is entirely * visible in the Text Field widget. If the character is not already entirely * visible, df_AdjustText changes the Widget's h_offsetring appropriately. If * the text must be redrawn, df_AdjustText calls df_RedisplayText. * */ static Boolean #ifdef _NO_PROTO df_AdjustText( tf, position, flag ) XmDataFieldWidget tf ; XmTextPosition position ; Boolean flag ; #else df_AdjustText( XmDataFieldWidget tf, XmTextPosition position, #if NeedWidePrototypes int flag ) #else Boolean flag ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { int left_edge = 0; int diff; Dimension margin_width = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension thickness = 2 * (tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); Dimension temp; if (XmDataField_alignment(tf) == XmALIGNMENT_END) { if (XmTextF_max_char_size(tf) != 1) { left_edge = tf->core.width - margin_width + XmTextF_h_offset(tf) - df_FindPixelLength(tf, (char *)(XmTextF_wc_value(tf) + position), XmTextF_string_length(tf) - (int) position); } else { left_edge = tf->core.width - margin_width + XmTextF_h_offset(tf) - df_FindPixelLength(tf, XmTextF_value(tf) + position, XmTextF_string_length(tf) - (int) position); } } else { if (XmTextF_max_char_size(tf) != 1) { left_edge = df_FindPixelLength(tf, (char *) XmTextF_wc_value(tf), (int)position) + (int) XmTextF_h_offset(tf); } else { left_edge = df_FindPixelLength(tf, XmTextF_value(tf), (int)position) + (int) XmTextF_h_offset(tf); } } /* * Make sure the cached GC has the clipping rectangle * set to the current widget. */ if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); if ((diff = left_edge - margin_width) < 0) { /* We need to scroll the string to the right. */ if (!XtIsRealized((Widget)tf)) { XmTextF_h_offset(tf) -= diff; return True; } _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_h_offset(tf) -= diff; df_XmSetInvGC(tf, XmTextF_gc(tf)); df_XmSetFullGC(tf, XmTextF_gc(tf)); if (tf->core.height <= thickness) temp = 0; else temp = tf->core.height - thickness; XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), tf->primitive.shadow_thickness + tf->primitive.highlight_thickness, tf->primitive.shadow_thickness + tf->primitive.highlight_thickness, XmTextF_margin_width(tf), temp); df_XmSetMarginGC(tf, XmTextF_gc(tf)); df_RedisplayText(tf, 0, XmTextF_string_length(tf)); _XmDataFieldDrawInsertionPoint(tf, True); return True; } else if ((diff = ( left_edge - (int)(tf->core.width - margin_width))) > 0) { /* We need to scroll the string to the left. */ if (!XtIsRealized((Widget)tf)) { XmTextF_h_offset(tf) -= diff; return True; } _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_h_offset(tf) -= diff; df_XmSetInvGC(tf, XmTextF_gc(tf)); df_XmSetFullGC(tf, XmTextF_gc(tf)); if (tf->core.width <= thickness) temp = 0; else temp = tf->core.width - thickness; XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), tf->core.width - margin_width, tf->primitive.shadow_thickness + tf->primitive.highlight_thickness, XmTextF_margin_width(tf), temp); df_XmSetMarginGC(tf, XmTextF_gc(tf)); df_RedisplayText(tf, 0, XmTextF_string_length(tf)); _XmDataFieldDrawInsertionPoint(tf, True); return True; } if (flag) df_RedisplayText(tf, position, XmTextF_string_length(tf)); return False; } /* * df_AdjustSize * * Adjust size will resize the text to ensure that all the text is visible. * It will also adjust text that is shrunk. Shrinkage is limited to the * size determined by the XmNcolumns resource. */ static void #ifdef _NO_PROTO df_AdjustSize( tf ) XmDataFieldWidget tf ; #else df_AdjustSize( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { XtGeometryResult result = XtGeometryYes; int left_edge = 0; int diff; Boolean redisplay = False; Dimension margin_width = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; if (XmTextF_max_char_size(tf) != 1) { left_edge = df_FindPixelLength(tf, (char *) XmTextF_wc_value(tf), XmTextF_string_length(tf)) + margin_width; } else { left_edge = df_FindPixelLength(tf, XmTextF_value(tf), XmTextF_string_length(tf)) + margin_width; } if ((diff = (left_edge - (tf->core.width - (margin_width)))) > 0) { if (XmTextF_in_setvalues(tf)) { tf->core.width += diff; if (XmDataField_alignment(tf) == XmALIGNMENT_END) XmTextF_new_h_offset(tf) = diff; else XmTextF_new_h_offset(tf) = margin_width - diff; return; } /* Attempt to resize. If it doesn't succeed, do scrolling. */ result = df_TryResize(tf, tf->core.width + diff, tf->core.height); if (result == XtGeometryYes) { XtWidgetProc resize; _XmProcessLock(); resize = tf->core.widget_class->core_class.resize; _XmProcessUnlock(); (*resize)((Widget)tf); return; } else /* We need to scroll the string to the left. */ if (XmDataField_alignment(tf) == XmALIGNMENT_END) XmTextF_h_offset(tf) = diff; else XmTextF_h_offset(tf) = margin_width - diff; } else { Dimension width; /* If the new size is smaller than core size, we need * to shrink. Note: new size will never be less than the * width determined by the columns resource. */ df_ComputeSize(tf, &width, NULL); if (width < tf->core.width) { if (XmTextF_in_setvalues(tf)) { tf->core.width = width; return; } result = df_TryResize(tf, width, tf->core.height); if (result == XtGeometryYes) { XtWidgetProc resize; _XmProcessLock(); resize = tf->core.widget_class->core_class.resize; _XmProcessUnlock(); (*resize)((Widget)tf); return; } } } redisplay = df_AdjustText(tf, XmTextF_cursor_position(tf), False); if (!redisplay) df_RedisplayText(tf, 0, XmTextF_string_length(tf)); } /* If MB_CUR_MAX == 1, insert is a char* pointer; else, it is a wchar_t * * pointer and must be appropriately cast. In all cases, insert_length * is the number of characters, not the number of bytes pointed to by * insert */ static Boolean #ifdef _NO_PROTO df_ModifyVerify( tf, event, replace_prev, replace_next, insert, insert_length, newInsert, free_insert ) XmDataFieldWidget tf ; XEvent *event ; XmTextPosition *replace_prev ; XmTextPosition *replace_next ; char **insert ; int *insert_length ; XmTextPosition *newInsert ; int *free_insert ; #else df_ModifyVerify( XmDataFieldWidget tf, XEvent *event, XmTextPosition *replace_prev, XmTextPosition *replace_next, char **insert, int *insert_length, XmTextPosition *newInsert, int *free_insert ) #endif /* _NO_PROTO */ { XmTextVerifyCallbackStruct vcb; XmTextVerifyCallbackStructWcs wcs_vcb; XmTextBlockRec newblock; XmTextBlockRecWcs wcs_newblock; Boolean do_free = False; Boolean wcs_do_free = False; int count; wchar_t *wptr; *newInsert = XmTextF_cursor_position(tf); *free_insert = (int)False; /* if there are no callbacks, don't waste any time... just return True */ if (!XmTextF_modify_verify_callback(tf) && !XmTextF_wcs_modify_verify_callback(tf)) return(True); newblock.format = XmFMT_8_BIT; newblock.length = *insert_length * XmTextF_max_char_size(tf); if (*insert_length) { if (XmTextF_modify_verify_callback(tf)){ newblock.ptr = (char *) XtMalloc((unsigned) newblock.length + XmTextF_max_char_size(tf)); if (XmTextF_max_char_size(tf) == 1) { (void)memcpy((void*)newblock.ptr, (void*)*insert, newblock.length); newblock.ptr[newblock.length]='\0'; } else { count = (int) wcstombs(newblock.ptr, (wchar_t*)*insert, newblock.length); if (count < 0) { /* bad wchar; don't pass anything */ newblock.ptr[0] = '\0'; newblock.length = 0; } else if (count == newblock.length) { newblock.ptr[newblock.length] = '\0'; } else { newblock.ptr[count] = '\0'; newblock.length = count; } } do_free = True; } else newblock.ptr = NULL; } else newblock.ptr = NULL; /* Fill in the appropriate structs */ vcb.reason = XmCR_MODIFYING_TEXT_VALUE; vcb.event = (XEvent *) event; vcb.doit = True; vcb.currInsert = XmTextF_cursor_position(tf); vcb.newInsert = XmTextF_cursor_position(tf); vcb.text = &newblock; vcb.startPos = *replace_prev; vcb.endPos = *replace_next; /* Call the modify verify callbacks. */ if (XmTextF_modify_verify_callback(tf)) XtCallCallbackList((Widget) tf, XmTextF_modify_verify_callback(tf), (XtPointer) &vcb); if (XmTextF_wcs_modify_verify_callback(tf) && vcb.doit){ if (do_free){ /* there is a char* modify verify callback; the data we * want is in vcb struct */ wcs_newblock.wcsptr = (wchar_t *) XtMalloc((unsigned) (vcb.text->length + 1) * sizeof(wchar_t)); wcs_newblock.length = mbstowcs(wcs_newblock.wcsptr, vcb.text->ptr, vcb.text->length); if (wcs_newblock.length < 0) { /* bad value; don't pass anything */ wcs_newblock.wcsptr[0] = 0L; wcs_newblock.length = 0; } else wcs_newblock.wcsptr[wcs_newblock.length] = 0L; } else { /* there was no char* modify verify callback; use data * passed in from caller instead of that in vcb struct. */ wcs_newblock.wcsptr = (wchar_t *) XtMalloc((unsigned) (*insert_length + 1) * sizeof(wchar_t)); if (XmTextF_max_char_size(tf) == 1) wcs_newblock.length = mbstowcs(wcs_newblock.wcsptr, *insert, *insert_length); else { wcs_newblock.length = *insert_length; (void)memcpy((void*)wcs_newblock.wcsptr, (void*)*insert, *insert_length * sizeof(wchar_t)); } if (wcs_newblock.length < 0) { /* bad value; don't pass anything */ wcs_newblock.wcsptr[0] = 0L; wcs_newblock.length = 0; } else wcs_newblock.wcsptr[wcs_newblock.length] = 0L; } wcs_do_free = True; wcs_vcb.reason = XmCR_MODIFYING_TEXT_VALUE; wcs_vcb.event = (XEvent *) event; wcs_vcb.doit = True; wcs_vcb.currInsert = vcb.currInsert; wcs_vcb.newInsert = vcb.newInsert; wcs_vcb.text = &wcs_newblock; wcs_vcb.startPos = vcb.startPos; wcs_vcb.endPos = vcb.endPos; XtCallCallbackList((Widget) tf, XmTextF_wcs_modify_verify_callback(tf), (XtPointer) &wcs_vcb); } /* * copy the newblock.ptr, length, start, and * end to the pointers passed */ if (XmTextF_wcs_modify_verify_callback(tf)) { /* use wcs_vcb data */ *insert_length = wcs_vcb.text->length; /* length is char count*/ if (wcs_vcb.doit) { if (XmTextF_max_char_size(tf) == 1) { /* caller expects char */ wcs_vcb.text->wcsptr[wcs_vcb.text->length] = 0L; if (*insert_length > 0) { *insert = XtMalloc((unsigned) (*insert_length + 1) \ * sizeof(wchar_t)); *free_insert = (int)True; count = wcstombs(*insert, wcs_vcb.text->wcsptr, *insert_length + 1); if (count < 0) { (*insert)[0] = 0; *insert_length = 0; } } } else { /* callback struct has wchar*; caller expects wchar* */ if (*insert_length > 0) { *insert = XtMalloc((unsigned)(*insert_length + 1) \ * sizeof(wchar_t)); *free_insert = (int)True; (void)memcpy((void*)*insert, (void*)wcs_vcb.text->wcsptr, *insert_length * sizeof(wchar_t)); wptr = (wchar_t*) *insert; wptr[*insert_length] = 0L; } } *replace_prev = wcs_vcb.startPos; *replace_next = wcs_vcb.endPos; *newInsert = wcs_vcb.newInsert; } } else { /* use vcb data */ if (vcb.doit) { if (XmTextF_max_char_size(tf) == 1) { /* caller expects char* */ *insert_length = vcb.text->length; if (*insert_length > 0) { *insert = XtMalloc((unsigned) *insert_length + 1); *free_insert = (int)True; (void)memcpy((void*)*insert, (void*)vcb.text->ptr, *insert_length); (*insert)[*insert_length] = 0; } } else { /* caller expects wchar_t* back */ *insert_length = _XmDataFieldCountCharacters(tf, vcb.text->ptr, vcb.text->length); if (*insert_length > 0) { *insert = XtMalloc((unsigned)(*insert_length + 1) * sizeof(wchar_t)); *free_insert = (int)True; count = mbstowcs((wchar_t*)*insert, vcb.text->ptr, *insert_length); wptr = (wchar_t*) *insert; if (count < 0) { wptr[0] = 0L; *insert_length = 0; } else { wptr[count] = 0L; } } } *replace_prev = vcb.startPos; *replace_next = vcb.endPos; *newInsert = vcb.newInsert; } } if (do_free) { XtFree(newblock.ptr); } if (wcs_do_free) { XtFree((char*)wcs_newblock.wcsptr); } /* If doit becomes False, then don't allow the change. */ if (XmTextF_wcs_modify_verify_callback(tf)) return wcs_vcb.doit; else return vcb.doit; } static void #ifdef _NO_PROTO df_ResetClipOrigin(tf, clip_mask_reset) XmDataFieldWidget tf; Boolean clip_mask_reset; #else /* _NO_PROTO */ df_ResetClipOrigin( XmDataFieldWidget tf, #if NeedWidePrototypes int clip_mask_reset) #else Boolean clip_mask_reset) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { unsigned long valuemask = (GCTileStipXOrigin | GCTileStipYOrigin | GCClipXOrigin | GCClipYOrigin); XGCValues values; int x, y, clip_mask_x, clip_mask_y; Position x_pos, y_pos; (void) df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &x_pos, &y_pos); if (!XtIsRealized((Widget)tf)) return; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); x = (int) x_pos; y = (int) y_pos; x -=(XmTextF_cursor_width(tf) >> 1) + 1; clip_mask_y = y = (y + XmTextF_font_descent(tf)) - XmTextF_cursor_height(tf); if (x < (int)(tf->primitive.highlight_thickness + tf->primitive.shadow_thickness + XmTextF_margin_width(tf))){ clip_mask_x = tf->primitive.highlight_thickness + tf->primitive.shadow_thickness + (int)(XmTextF_margin_width(tf)); } else clip_mask_x = x; if (clip_mask_reset) { values.ts_x_origin = x; values.ts_y_origin = y; values.clip_x_origin = clip_mask_x; values.clip_y_origin = clip_mask_y; XChangeGC(XtDisplay(tf), XmTextF_image_gc(tf), valuemask, &values); } else XSetTSOrigin(XtDisplay(tf), XmTextF_image_gc(tf), x, y); } static void #ifdef _NO_PROTO df_InvertImageGC (tf) XmDataFieldWidget tf ; #else df_InvertImageGC ( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { unsigned long valuemask = (GCForeground | GCBackground); XGCValues values; Display *dpy = XtDisplay(tf); if (XmTextF_have_inverted_image_gc(tf)) return; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); if (!XmTextF_overstrike(tf)) { values.background = tf->primitive.foreground; values.foreground = tf->core.background_pixel; XChangeGC(dpy, XmTextF_image_gc(tf), valuemask, &values); } XmTextF_have_inverted_image_gc(tf) = True; } static void #ifdef _NO_PROTO df_ResetImageGC (tf) XmDataFieldWidget tf ; #else df_ResetImageGC ( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { unsigned long valuemask = (GCForeground | GCBackground); XGCValues values; Display *dpy = XtDisplay(tf); if (!XmTextF_have_inverted_image_gc(tf)) return; if (!XmTextF_has_rect(tf)) { _XmDataFieldSetClipRect(tf); } if (!XmTextF_overstrike(tf)) { values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; XChangeGC(dpy, XmTextF_image_gc(tf), valuemask, &values); } XmTextF_have_inverted_image_gc(tf) = False; } /* * Calls the motion verify callback. If the doit flag is true, * then reset the cursor_position and call df_AdjustText() to * move the text if need be. */ void #ifdef _NO_PROTO _XmDataFielddf_SetCursorPosition( tf, event, position, adjust_flag, call_cb) XmDataFieldWidget tf ; XEvent *event ; XmTextPosition position ; Boolean adjust_flag ; Boolean call_cb ; #else _XmDataFielddf_SetCursorPosition( XmDataFieldWidget tf, XEvent *event, XmTextPosition position, #if NeedWidePrototypes int adjust_flag, int call_cb) #else Boolean adjust_flag, Boolean call_cb) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { df_SetCursorPosition(tf, event, position, adjust_flag, call_cb, True); } static void #ifdef _NO_PROTO df_SetCursorPosition( tf, event, position, adjust_flag, call_cb, set_dest) XmDataFieldWidget tf ; XEvent *event ; XmTextPosition position ; Boolean adjust_flag ; Boolean call_cb ; Boolean set_dest; #else df_SetCursorPosition( XmDataFieldWidget tf, XEvent *event, XmTextPosition position, #if NeedWidePrototypes int adjust_flag, int call_cb, int set_dest) #else Boolean adjust_flag, Boolean call_cb, Boolean set_dest) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { XmTextVerifyCallbackStruct cb; Boolean flag = False; XPoint xmim_point; _XmHighlightRec *hl_list = XmTextF_highlight(tf).list; int i; if (position < 0) position = 0; if (position > XmTextF_string_length(tf)) position = XmTextF_string_length(tf); if (XmTextF_cursor_position(tf) != position && call_cb) { /* Call Motion Verify Callback before Cursor Changes Positon */ cb.reason = XmCR_MOVING_INSERT_CURSOR; cb.event = event; cb.currInsert = XmTextF_cursor_position(tf); cb.newInsert = position; cb.doit = True; XtCallCallbackList((Widget) tf, XmTextF_motion_verify_callback(tf), (XtPointer) &cb); if (!cb.doit) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay((Widget)tf), 0); return; } } _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_cursor_position(tf) = position; if (!XmTextF_add_mode(tf) && XmTextF_pending_off(tf) && XmTextF_has_primary(tf)) { df_SetSelection(tf, position, position, True); flag = True; } /* Deterimine if we need an inverted image GC or not. Get the highlight * record for the cursor position. If position is on a boundary of * a highlight, then we always display cursor in normal mode (i.e. set * normal image GC). If position is within a selected highlight rec, * then make sure the image GC is inverted. If we've moved out of a * selected highlight region, restore the normal image GC. */ for (i = XmTextF_highlight(tf).number - 1; i >= 0; i--){ if (position >= hl_list[i].position || i == 0) break; } if (position == hl_list[i].position) df_ResetImageGC(tf); else if (hl_list[i].mode != XmHIGHLIGHT_SELECTED) df_ResetImageGC(tf); else df_InvertImageGC(tf); if (adjust_flag) (void) df_AdjustText(tf, position, flag); df_ResetClipOrigin(tf, False); XmTextF_refresh_ibeam_off(tf) = True; _XmDataFieldDrawInsertionPoint(tf, True); (void) df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, &xmim_point.y); XmImVaSetValues((Widget)tf, XmNspotLocation, &xmim_point, NULL); if (set_dest) (void) df_SetDestination((Widget) tf, XmTextF_cursor_position(tf), False, XtLastTimestampProcessed(XtDisplay((Widget)tf))); } /* * This routine is used to verify that the positions are within the bounds * of the current DataField widgets value. Also, it ensures that left is * less than right. */ static void #ifdef _NO_PROTO df_VerifyBounds( tf, from, to ) XmDataFieldWidget tf ; XmTextPosition *from ; XmTextPosition *to ; #else df_VerifyBounds( XmDataFieldWidget tf, XmTextPosition *from, XmTextPosition *to ) #endif /* _NO_PROTO */ { XmTextPosition tmp; if (*from < 0) *from = 0; else if (*from > XmTextF_string_length(tf)) { *from = XmTextF_string_length(tf); } if (*to < 0 ) *to = 0; else if (*to > XmTextF_string_length(tf)) { *to = XmTextF_string_length(tf); } if (*from > *to) { tmp = *to; *to = *from; *from = tmp; } } /* * Function _XmDataFieldReplaceText * * _XmDataFieldReplaceText is a utility function for the text-modifying * action procedures below (df_InsertChar, df_DeletePrevChar, and so on). * _XmDataFieldReplaceText does the real work of editing the string, * including: * * (1) invoking the modify verify callbacks, * (2) allocating more memory for the string if necessary, * (3) doing the string manipulation, * (4) moving the selection (the insertion point), and * (5) redrawing the text. * * Though the procedure claims to take a char* argument, MB_CUR_MAX determines * what the different routines will actually pass to it. If MB_CUR_MAX is * greater than 1, then "insert" points to wchar_t data and we must set up * the appropriate cast. In all cases, insert_length is the number of * characters (not bytes) to be inserted. */ Boolean #ifdef _NO_PROTO _XmDataFieldReplaceText( tf, event, replace_prev, replace_next, insert, insert_length, move_cursor ) XmDataFieldWidget tf ; XEvent *event ; XmTextPosition replace_prev ; XmTextPosition replace_next ; char *insert ; int insert_length ; Boolean move_cursor ; #else _XmDataFieldReplaceText( XmDataFieldWidget tf, XEvent *event, XmTextPosition replace_prev, XmTextPosition replace_next, char *insert, int insert_length, Boolean move_cursor ) #endif /* _NO_PROTO */ { int replace_length, i; char *src, *dst; wchar_t *wc_src, *wc_dst; int delta = 0; XmTextPosition cursorPos, newInsert; XmTextPosition old_pos = replace_prev; int free_insert = (int)False; Position x1, y1, x2, y2; df_VerifyBounds(tf, &replace_prev, &replace_next); if (!XmTextF_editable(tf)) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay((Widget)tf), 0); return False; } replace_length = (int) (replace_next - replace_prev); delta = insert_length - replace_length; /* Disallow insertions that go beyond max length boundries. */ if ((delta >= 0) && ((XmTextF_string_length(tf) + delta) - (XmTextF_max_length(tf)) > 0)) { if (XmTextF_verify_bell(tf)) { XBell(XtDisplay(tf), 0); } return False; } if (XmDataField_alignment(tf) == XmALIGNMENT_END) { df_GetXYFromPos(tf, 0, &x1, &y1); } /* If there are modify verify callbacks, verify that we want to continue * the action. */ newInsert = XmTextF_cursor_position(tf); if (XmTextF_modify_verify_callback(tf) || XmTextF_wcs_modify_verify_callback(tf)) { /* If the function df_ModifyVerify() returns false then don't * continue with the action. */ if (!df_ModifyVerify(tf, event, &replace_prev, &replace_next, &insert, &insert_length, &newInsert, &free_insert)) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay(tf), 0); if (free_insert) XtFree(insert); return False; } else { df_VerifyBounds(tf, &replace_prev, &replace_next); replace_length = (int) (replace_next - replace_prev); delta = insert_length - replace_length; /* Disallow insertions that go beyond max length boundries. */ if ((delta >= 0) && ((XmTextF_string_length(tf) + delta) - (XmTextF_max_length(tf)) > 0)) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay(tf), 0); if (free_insert) XtFree(insert); return False; } } } /* make sure selections are turned off prior to changeing text */ if (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) XmDataFieldSetHighlight((Widget)tf, XmTextF_prim_pos_left(tf), XmTextF_prim_pos_right(tf), XmHIGHLIGHT_NORMAL); _XmDataFieldDrawInsertionPoint(tf, False); /* Allocate more space if we need it. */ if (XmTextF_max_char_size(tf) == 1){ if (XmTextF_string_length(tf) + insert_length - replace_length >= XmTextF_size_allocd(tf)) { XmTextF_size_allocd(tf) += MAX(insert_length + TEXT_INCREMENT, (XmTextF_size_allocd(tf) * 2)); XmTextF_value(tf) = (char *) XtRealloc((char*)XmTextF_value(tf), (unsigned) (XmTextF_size_allocd(tf) * sizeof(char))); } } else { if ((XmTextF_string_length(tf) + insert_length - replace_length) * sizeof(wchar_t) >= XmTextF_size_allocd(tf)) { XmTextF_size_allocd(tf) += MAX((insert_length + TEXT_INCREMENT)*sizeof(wchar_t), (XmTextF_size_allocd(tf) * 2)); XmTextF_wc_value(tf) = (wchar_t *) XtRealloc((char*)XmTextF_wc_value(tf), (unsigned) XmTextF_size_allocd(tf)); } } if (XmTextF_has_primary(tf) && replace_prev < XmTextF_prim_pos_right(tf) && replace_next > XmTextF_prim_pos_left(tf)) { if (replace_prev <= XmTextF_prim_pos_left(tf)) { if (replace_next < XmTextF_prim_pos_right(tf)) { /* delete encompasses left half of the selection * so move left endpoint */ XmTextF_prim_pos_left(tf) = replace_next; } else { /* delete encompasses the selection so set selection to NULL */ XmTextF_prim_pos_left(tf) = XmTextF_prim_pos_right(tf); } } else { if (replace_next > XmTextF_prim_pos_right(tf)) { /* delete encompasses the right half of the selection * so move right endpoint */ XmTextF_prim_pos_right(tf) = replace_next; } else { /* delete is completely within the selection * so set selection to NULL */ XmTextF_prim_pos_right(tf) = XmTextF_prim_pos_left(tf); } } } if (XmTextF_max_char_size(tf) == 1) { if (replace_length > insert_length) /* We need to shift the text at and after replace_next to the left. */ for (src = XmTextF_value(tf) + replace_next, dst = src + (insert_length - replace_length), i = (int) ((XmTextF_string_length(tf) + 1) - replace_next); i > 0; ++src, ++dst, --i) *dst = *src; else if (replace_length < insert_length) /* We need to shift the text at and after replace_next to the right. */ /* Need to add 1 to string_length to handle the NULL terminator on */ /* the string. */ for (src = XmTextF_value(tf) + XmTextF_string_length(tf), dst = src + (insert_length - replace_length), i = (int) ((XmTextF_string_length(tf) + 1) - replace_next); i > 0; --src, --dst, --i) *dst = *src; /* Update the string. */ if (insert_length != 0) { for (src = insert, dst = XmTextF_value(tf) + replace_prev, i = insert_length; i > 0; ++src, ++dst, --i) *dst = *src; } } else { /* have wchar_t* data */ if (replace_length > insert_length) /* We need to shift the text at and after replace_next to the left. */ for (wc_src = XmTextF_wc_value(tf) + replace_next, wc_dst = wc_src + (insert_length - replace_length), i = (int) ((XmTextF_string_length(tf) + 1) - replace_next); i > 0; ++wc_src, ++wc_dst, --i) *wc_dst = *wc_src; else if (replace_length < insert_length) /* We need to shift the text at and after replace_next to the right. */ /* Need to add 1 to string_length to handle the NULL terminator on */ /* the string. */ for (wc_src = XmTextF_wc_value(tf) + XmTextF_string_length(tf), wc_dst = wc_src + (insert_length - replace_length), i = (int) ((XmTextF_string_length(tf) + 1) - replace_next); i > 0; --wc_src, --wc_dst, --i) *wc_dst = *wc_src; /* Update the string. */ if (insert_length != 0) { for (wc_src = (wchar_t *)insert, wc_dst = XmTextF_wc_value(tf) + replace_prev, i = insert_length; i > 0; ++wc_src, ++wc_dst, --i) *wc_dst = *wc_src; } } if (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) { if (replace_prev <= XmTextF_prim_pos_left(tf)) { XmTextF_prim_pos_left(tf) += delta; XmTextF_prim_pos_right(tf) += delta; } if (XmTextF_prim_pos_left(tf) > XmTextF_prim_pos_right(tf)) XmTextF_prim_pos_right(tf) = XmTextF_prim_pos_left(tf); } /* make sure the selection are redisplay, since * they were turned off earlier */ if (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) { XmDataFieldSetHighlight((Widget)tf, XmTextF_prim_pos_left(tf), XmTextF_prim_pos_right(tf), XmHIGHLIGHT_SELECTED); } XmTextF_string_length(tf) += insert_length - replace_length; if (move_cursor) { if (XmTextF_cursor_position(tf) != newInsert) { if (newInsert > XmTextF_string_length(tf)) { cursorPos = XmTextF_string_length(tf); } else if (newInsert < 0) { cursorPos = 0; } else { cursorPos = newInsert; } } else cursorPos = replace_next + (insert_length - replace_length); if (event != NULL) { (void)df_SetDestination((Widget)tf, cursorPos, False, event->xkey.time); } else { (void) df_SetDestination((Widget)tf, cursorPos, False, XtLastTimestampProcessed(XtDisplay((Widget)tf))); } _XmDataFielddf_SetCursorPosition(tf, event, cursorPos, False, True); } if (XmDataField_alignment(tf) == XmALIGNMENT_END) { df_GetXYFromPos(tf, 0, &x2, &y2); y2 -= XmTextF_font_ascent(tf); if ((x2 > 0) && (x1 < x2) && (y2 < y1)) { if (x1 < 0) x1 = 0; /* PWC - Erase leading space (delta of old & new first position) */ df_XmSetInvGC(tf, XmTextF_gc(tf)); XFillRectangle(XtDisplay(tf), XtWindow(tf), XmTextF_gc(tf), x1, y2, x2, y1); #if PWC_DEBUG printf("Fill Rectangle :: x1(%d), y1(%d) - x2(%d), y2(%d)\n", x1, y2, x2, y1); #endif } } if (XmTextF_resize_width(tf) && XmTextF_do_resize(tf)) { df_AdjustSize(tf); } else { df_AdjustText(tf, XmTextF_cursor_position(tf), False); df_RedisplayText(tf, old_pos, XmTextF_string_length(tf)); } _XmDataFieldDrawInsertionPoint(tf, True); if (free_insert) { XtFree(insert); } return True; } /* * Reset selection flag and selection positions and then display * the new settings. */ void #ifdef _NO_PROTO _XmDataFieldDeselectSelection( w, disown, sel_time ) Widget w ; Boolean disown ; Time sel_time ; #else _XmDataFieldDeselectSelection( Widget w, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time sel_time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; if (disown) { /* * Disown the primary selection (This function is a no-op if * this widget doesn't own the primary selection) */ XtDisownSelection(w, XA_PRIMARY, sel_time); } if (tf != NULL) { _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_has_primary(tf) = False; DataFieldSetHighlight(tf, XmTextF_prim_pos_left(tf), XmTextF_prim_pos_right(tf), XmHIGHLIGHT_NORMAL); XmTextF_prim_pos_left(tf) = XmTextF_prim_pos_right(tf) = XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); if (!XmTextF_has_focus(tf)) { XmDataFieldSetAddMode(w, False); } df_RedisplayText(tf, 0, XmTextF_string_length(tf)); _XmDataFieldDrawInsertionPoint(tf, True); } } /* * Finds the cursor position from the given X value. */ static XmTextPosition #ifdef _NO_PROTO df_GetPosFromX( tf, x ) XmDataFieldWidget tf ; Position x ; #else df_GetPosFromX( XmDataFieldWidget tf, #if NeedWidePrototypes int x ) #else Position x ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { XmTextPosition position; int temp_x = 0; int next_char_width = 0; if (XmDataField_alignment(tf) == XmALIGNMENT_END) return RightAlignedGetPosFromX(tf, x); /* Decompose the x to equal the length of the text string */ temp_x += (int) XmTextF_h_offset(tf); /* Next width is an offset allowing button presses on the left side * of a character to select that character, while button presses * on the rigth side of the character select the NEXT character. */ if (XmTextF_string_length(tf) > 0) { if (XmTextF_max_char_size(tf) != 1) { next_char_width = df_FindPixelLength(tf, (char*)XmTextF_wc_value(tf), 1); } else { next_char_width = df_FindPixelLength(tf, XmTextF_value(tf), 1); } } for (position = 0; temp_x + next_char_width/2 < (int) x && position < XmTextF_string_length(tf); position++){ temp_x+=next_char_width; /* * We still haven't reached the x pos. * Add the width and find the next chars * width. */ /* * If there is a next position, find its width. Otherwise, use the * current "next" width. */ if (XmTextF_string_length(tf) > position + 1) { if (XmTextF_max_char_size(tf) != 1) { next_char_width = df_FindPixelLength(tf, (char*)(XmTextF_wc_value(tf) + position + 1), 1); } else { next_char_width = df_FindPixelLength(tf, XmTextF_value(tf) + position + 1, 1); } } } /* for */ return position; } /* * Finds the cursor position from the given X value. */ static XmTextPosition #ifdef _NO_PROTO RightAlignedGetPosFromX( tf, x ) XmDataFieldWidget tf ; Position x ; #else RightAlignedGetPosFromX( XmDataFieldWidget tf, #if NeedWidePrototypes int x ) #else Position x ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { XmTextPosition position; int margin_width = XmTextF_margin_width(tf) + tf->primitive.highlight_thickness + tf->primitive.shadow_thickness; int temp_x; int next_char_width = 0; position = XmTextF_string_length(tf); temp_x = tf->core.width - margin_width + XmTextF_h_offset(tf); if (XmTextF_string_length(tf) > 0) { if (XmTextF_max_char_size(tf) != 1) { next_char_width = df_FindPixelLength(tf, (char*)XmTextF_wc_value(tf) + position - 1, 1); } else { next_char_width = df_FindPixelLength(tf, XmTextF_value(tf) + position - 1, 1); } } for (; x < (temp_x - next_char_width / 2) && (position > 0); position--) { temp_x -= next_char_width; /* * We still haven't reached the x pos. * Add the width and find the next chars * width. */ /* * If there is a next position, find its width. Otherwise, use the * current "next" width. */ if (position > 1) { if (XmTextF_max_char_size(tf) != 1) { next_char_width = df_FindPixelLength(tf, (char*)(XmTextF_wc_value(tf) + position - 2), 1); } else { next_char_width = df_FindPixelLength(tf, XmTextF_value(tf) + position - 2 , 1); } } } /* for */ #if PWC_DEBUG printf("CursorPos(%d), x(%d)\n", position, x); #endif return position; } /* ARGSUSED */ static Boolean #ifdef _NO_PROTO df_SetDestination( w, position, disown, set_time ) Widget w ; XmTextPosition position ; Boolean disown ; Time set_time ; #else df_SetDestination( Widget w, XmTextPosition position, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time set_time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Boolean result = TRUE; Atom MOTIF_DESTINATION = XmInternAtom(XtDisplay(w), "MOTIF_DESTINATION", False); if (!XtIsRealized(w)) return False; _XmDataFieldDrawInsertionPoint(tf, False); if (!disown) { if (!XmTextF_has_destination(tf)) { if (!set_time) set_time = df_GetServerTime(w); result = XtOwnSelection(w, MOTIF_DESTINATION, set_time, _XmDataFieldConvert, _XmDataFieldLoseSelection, (XtSelectionDoneProc) NULL); XmTextF_dest_time(tf) = set_time; XmTextF_has_destination(tf) = result; if (result) _XmSetDestination(XtDisplay(w), w); _XmDataFToggleCursorGC(w); } } else { if (XmTextF_has_destination(tf)) if (!set_time) set_time = df_GetServerTime(w); XtDisownSelection(w, MOTIF_DESTINATION, set_time); /* Call XmGetDestination(dpy) to get widget that last had destination cursor. */ if (w == XmGetDestination(XtDisplay(w))) _XmSetDestination(XtDisplay(w), (Widget)NULL); XmTextF_has_destination(tf) = False; _XmDataFToggleCursorGC(w); } _XmDataFieldDrawInsertionPoint(tf, True); return result; } Boolean #ifdef _NO_PROTO _XmDataFielddf_SetDestination( w, position, set_time ) Widget w ; XmTextPosition position ; Time set_time ; #else _XmDataFielddf_SetDestination( Widget w, XmTextPosition position, Time set_time ) #endif /* _NO_PROTO */ { Boolean result; result = df_SetDestination(w, position, False, set_time); return result; } /* * Calls the losing focus verify callback to verify that the application * want to traverse out of the text field widget. Returns the result. */ static Boolean #ifdef _NO_PROTO df_VerifyLeave( tf, event ) XmDataFieldWidget tf ; XEvent *event ; #else df_VerifyLeave( XmDataFieldWidget tf, XEvent *event ) #endif /* _NO_PROTO */ { XmTextVerifyCallbackStruct cbdata; cbdata.reason = XmCR_LOSING_FOCUS; cbdata.event = event; cbdata.doit = True; cbdata.currInsert = XmTextF_cursor_position(tf); cbdata.newInsert = XmTextF_cursor_position(tf); cbdata.startPos = XmTextF_cursor_position(tf); cbdata.endPos = XmTextF_cursor_position(tf); cbdata.text = NULL; XtCallCallbackList((Widget) tf, XmTextF_losing_focus_callback(tf), (XtPointer) &cbdata); return(cbdata.doit); } /* This routine is used to determine if two adjacent wchar_t characters * constitute a word boundary */ /* ARGSUSED */ static Boolean #ifdef _NO_PROTO _XmDataFieldIsWordBoundary( tf, pos1, pos2 ) XmDataFieldWidget tf ; XmTextPosition pos1 ; XmTextPosition pos2 ; #else _XmDataFieldIsWordBoundary( XmDataFieldWidget tf, XmTextPosition pos1 , XmTextPosition pos2 ) #endif /* _NO_PROTO */ { int size_pos1 = 0; int size_pos2 = 0; char s1[MB_LEN_MAX]; char s2[MB_LEN_MAX]; /* if positions aren't adjacent, return False */ if(pos1 < pos2 && ((pos2 - pos1) != 1)) return False; else if(pos2 < pos1 && ((pos1 - pos2) != 1)) return False; if (XmTextF_max_char_size(tf) == 1) { /* data is char* and one-byte per char */ if (isspace((int)(unsigned char)XmTextF_value(tf)[pos1]) || isspace((int)(unsigned char)XmTextF_value(tf)[pos2])) return True; } else { size_pos1 = wctomb(s1, XmTextF_wc_value(tf)[pos1]); size_pos2 = wctomb(s2, XmTextF_wc_value(tf)[pos2]); if (size_pos1 == 1 && (size_pos2 != 1 || isspace((int)(unsigned char)*s1))) return True; if (size_pos2 == 1 && (size_pos1 != 1 || isspace((int)(unsigned char)*s2))) return True; } return False; } /* This routine accepts an array of wchar_t's containing wchar encodings * of whitespace characters (and the number of array elements), comparing * the wide character passed to each element of the array. If a match * is found, we got a white space. This routine exists only because * iswspace(3c) is not yet standard. If a system has isw* available, * calls to this routine should be changed to iswspace(3c) (and callers * should delete initialization of the array), and this routine should * be deleted. Its a stop gap measure to avoid allocating an instance * variable for the white_space array and/or declaring a widget wide * global for the data and using a macro. Its ugly, but it works and * in the long run will be replaced by standard functionality. */ /* ARGSUSED */ static Boolean #ifdef _NO_PROTO _XmDataFieldIsWSpace( wide_char, white_space, num_entries ) wchar_t wide_char ; wchar_t * white_space ; int num_entries ; #else _XmDataFieldIsWSpace( wchar_t wide_char, wchar_t * white_space , int num_entries ) #endif /* _NO_PROTO */ { int i; for (i=num_entries; i > 0; i--){ if (wide_char == white_space[i]) return True; } return False; } static void #ifdef _NO_PROTO df_FindWord( tf, begin, left, right ) XmDataFieldWidget tf ; XmTextPosition begin ; XmTextPosition *left ; XmTextPosition *right ; #else df_FindWord( XmDataFieldWidget tf, XmTextPosition begin, XmTextPosition *left, XmTextPosition *right ) #endif /* _NO_PROTO */ { XmTextPosition start, end; wchar_t white_space[3]; if (XmTextF_max_char_size(tf) == 1) { for (start = begin; start > 0; start--) { if (isspace((int)(unsigned char)XmTextF_value(tf)[start - 1])) { break; } } *left = start; for (end = begin; end <= XmTextF_string_length(tf); end++) { if (isspace((int)(unsigned char)XmTextF_value(tf)[end])) { end++; break; } } *right = end - 1; } else { /* check for iswspace and iswordboundary in each direction */ (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); for (start = begin; start > 0; start --) { if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start-1],white_space, 3) || _XmDataFieldIsWordBoundary(tf, (XmTextPosition) start - 1, start)) { break; } } *left = start; for (end = begin; end <= XmTextF_string_length(tf); end++) { if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)){ end++; break; } else if (end < XmTextF_string_length(tf)) { if (_XmDataFieldIsWordBoundary(tf, end, (XmTextPosition)end + 1)){ end += 2; /* want to return position of next word; end + 1 */ break; /* is that position && *right = end - 1... */ } } } *right = end - 1; } } static void #ifdef _NO_PROTO df_FindPrevWord( tf, left, right ) XmDataFieldWidget tf ; XmTextPosition *left ; XmTextPosition *right ; #else df_FindPrevWord( XmDataFieldWidget tf, XmTextPosition *left, XmTextPosition *right ) #endif /* _NO_PROTO */ { XmTextPosition start = XmTextF_cursor_position(tf); wchar_t white_space[3]; if (XmTextF_max_char_size(tf) != 1) { (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); } if (XmTextF_max_char_size(tf) == 1) { if ((start > 0) && (isspace((int)(unsigned char)XmTextF_value(tf)[start - 1]))) { for (; start > 0; start--) { if (!isspace((int)(unsigned char)XmTextF_value(tf)[start - 1])) { start--; break; } } } df_FindWord(tf, start, left, right); } else { if ((start > 0) && (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start - 1], white_space, 3))) { for (; start > 0; start--) { if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start -1], white_space, 3)){ start--; break; } } } else if ((start > 0) && _XmDataFieldIsWordBoundary(tf, (XmTextPosition) start - 1, start)){ start--; } df_FindWord(tf, start, left, right); } } static void #ifdef _NO_PROTO df_FindNextWord( tf, left, right ) XmDataFieldWidget tf ; XmTextPosition *left ; XmTextPosition *right ; #else df_FindNextWord( XmDataFieldWidget tf, XmTextPosition *left, XmTextPosition *right ) #endif /* _NO_PROTO */ { XmTextPosition end = XmTextF_cursor_position(tf); wchar_t white_space[3]; if (XmTextF_max_char_size(tf) != 1) { (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); } if(XmTextF_max_char_size(tf) == 1) { if (isspace((int)(unsigned char)XmTextF_value(tf)[end])) { for (end = XmTextF_cursor_position(tf); end < XmTextF_string_length(tf); end++) { if (!isspace((int)(unsigned char)XmTextF_value(tf)[end])) { break; } } } df_FindWord(tf, end, left, right); /* * Set right to the last whitespace following the end of the * current word. */ while (*right < XmTextF_string_length(tf) && isspace((int)(unsigned char)XmTextF_value(tf)[(int)*right])) *right = *right + 1; if (*right < XmTextF_string_length(tf)) *right = *right - 1; } else { if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) { for ( ; end < XmTextF_string_length(tf); end ++) { if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) { break; } } } else { /* if for other reasons at word boundry, advance to next word */ if ((end < XmTextF_string_length(tf)) && _XmDataFieldIsWordBoundary(tf, end, (XmTextPosition) end + 1)) end++; } df_FindWord(tf, end, left, right); /* * If word boundary caused by whitespace, set right to the last * whitespace following the end of the current word. */ if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], white_space, 3)) { while (*right < XmTextF_string_length(tf) && _XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], white_space, 3)) { *right = *right + 1; } if (*right < XmTextF_string_length(tf)) *right = *right - 1; } } } static void #ifdef _NO_PROTO df_CheckDisjointSelection( w, position, sel_time ) Widget w ; XmTextPosition position ; Time sel_time ; #else df_CheckDisjointSelection( Widget w, XmTextPosition position, Time sel_time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left = 0, right = 0; if (XmTextF_add_mode(tf) || (XmDataFieldGetSelectionPosition(w, &left, &right) && left != right && position >= left && position <= right)) XmTextF_pending_off(tf) = FALSE; else XmTextF_pending_off(tf) = TRUE; if (left == right) { (void) df_SetDestination(w, position, False, sel_time); XmTextF_prim_anchor(tf) = position; } else { (void) df_SetDestination(w, position, False, sel_time); if (!XmTextF_add_mode(tf)) XmTextF_prim_anchor(tf) = position; } } static Boolean #ifdef _NO_PROTO df_NeedsPendingDelete( tf ) XmDataFieldWidget tf ; #else df_NeedsPendingDelete( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { return (XmTextF_add_mode(tf) ? (XmTextF_pending_delete(tf) && XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf) && XmTextF_prim_pos_left(tf) <= XmTextF_cursor_position(tf) && XmTextF_prim_pos_right(tf) >= XmTextF_cursor_position(tf)) : (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf))); } static Boolean #ifdef _NO_PROTO df_NeedsPendingDeleteDisjoint( tf ) XmDataFieldWidget tf ; #else df_NeedsPendingDeleteDisjoint( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { return (XmTextF_pending_delete(tf) && XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf) && XmTextF_prim_pos_left(tf) <= XmTextF_cursor_position(tf) && XmTextF_prim_pos_right(tf) >= XmTextF_cursor_position(tf)); } static Time #ifdef _NO_PROTO df_GetServerTime( w ) Widget w ; #else df_GetServerTime( Widget w ) #endif /* _NO_PROTO */ { XEvent event; EventMask shellMask; while(!XtIsShell(w)) w = XtParent(w); shellMask = XtBuildEventMask(w); if (!(shellMask & PropertyChangeMask)) XSelectInput(XtDisplay(w), XtWindow(w), (long)(shellMask | PropertyChangeMask)); XChangeProperty(XtDisplay(w), XtWindow(w), XA_WM_HINTS, XA_WM_HINTS, 32, PropModeAppend, (unsigned char *)NULL, 0); XWindowEvent(XtDisplay(w), XtWindow(w), PropertyChangeMask, &event); if (!(shellMask & PropertyChangeMask)) XSelectInput(XtDisplay(w), XtWindow(w), (long)shellMask); return (event.xproperty.time); } static Boolean PrintableString(XmDataFieldWidget tf, char* str, int n, Boolean use_wchar) /* sometimes unused */ { #ifdef SUPPORT_ZERO_WIDTH /* some locales (such as Thai) have characters that are * printable but non-spacing. These should be inserted, * even if they have zero width. */ if (tf->text.max_char_size == 1) { int i; if (!use_wchar) { for (i = 0; i < n; i++) { if (!isprint((unsigned char)str[i])) { return False; } } } else { char scratch[8]; wchar_t *ws = (wchar_t *) str; for (i = 0; i < n; i++) { if (wctomb(scratch, ws[i]) <= 0) return False; if (!isprint((unsigned char)scratch[0])) { return False; } } } return True; } else { /* tf->text.max_char_size > 1 */ #ifdef HAS_WIDECHAR_FUNCTIONS if (use_wchar) { int i; wchar_t *ws = (wchar_t *) str; for (i = 0; i < n; i++) { if (!iswprint(ws[i])) { return False; } } return True; } else { int i, csize; wchar_t wc; #ifndef NO_MULTIBYTE for (i = 0, csize = mblen(str, tf->text.max_char_size); i < n; i += csize, csize=mblen(&(str[i]), tf->text.max_char_size)) #else for (i = 0, csize = *str ? 1 : 0; i < n; i += csize, csize = str[i] ? 1 : 0) #endif { if (csize < 0) return False; if (mbtowc(&wc, &(str[i]), tf->text.max_char_size) <= 0) return False; if (!iswprint(wc)) { return False; } } } #else /* HAS_WIDECHAR_FUNCTIONS */ /* * This will only check if any single-byte characters are non- * printable. Better than nothing... */ int i, csize; if (!use_wchar) { #ifndef NO_MULTIBYTE for (i = 0, csize = mblen(str, tf->text.max_char_size); i < n; i += csize, csize=mblen(&(str[i]), tf->text.max_char_size)) #else for (i = 0, csize = *str ? 1 : 0; i < n; i += csize, csize = str[i] ? 1 : 0) #endif { if (csize < 0) return False; if (csize == 1 && !isprint((unsigned char)str[i])) { return False; } } } else { char scratch[8]; wchar_t *ws = (wchar_t *) str; for (i = 0; i < n; i++) { if ((csize = wctomb(scratch, ws[i])) <= 0) return False; if (csize == 1 && !isprint((unsigned char)scratch[0])) { return False; } } } #endif /* HAS_WIDECHAR_FUNCTIONS */ return True; } #else /* SUPPORT_ZERO_WIDTH */ if (TextF_UseFontSet(tf)) { if(use_wchar) return (XwcTextEscapement((XFontSet)TextF_Font(tf), (wchar_t *)str, n) != 0); else return (XmbTextEscapement((XFontSet)TextF_Font(tf), str, n) != 0); #ifdef USE_XFT } else if (TextF_UseXft(tf)) { XGlyphInfo ext; XftTextExtentsUtf8(XtDisplay(tf), TextF_XftFont(tf), (FcChar8*)str, n, &ext); return ext.xOff != 0; #endif } else { if (use_wchar) { char cache[100]; char *tmp, *cache_ptr; wchar_t *tmp_str; int ret_val, buf_size, count; Boolean is_printable; buf_size = (n * MB_CUR_MAX) + 1; cache_ptr = tmp = XmStackAlloc(buf_size, cache); tmp_str = (wchar_t *)str; // Fixed MZ BZ#1257: by Brad Despres count = 0; do { ret_val = wctomb(tmp, *tmp_str); count += 1; tmp += ret_val; buf_size -= ret_val; tmp_str++; } while ( (ret_val > 0)&& (buf_size >= MB_CUR_MAX) && (count < n) ) ; if (ret_val == -1) /* bad character */ return (False); is_printable = XTextWidth(TextF_Font(tf), cache_ptr, tmp - cache_ptr); XmStackFree(cache_ptr, cache); return (is_printable); } else { return (XTextWidth(TextF_Font(tf), str, n) != 0); } } #endif /* SUPPORT_ZERO_WIDTH */ } /**************************************************************** * * Input functions defined in the action table. * ****************************************************************/ /* ARGSUSED */ static void #ifdef _NO_PROTO df_InsertChar( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_InsertChar( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; char insert_string[TEXT_MAX_INSERT_SIZE]; XmTextPosition cursorPos, nextPos; wchar_t * wc_insert_string; int insert_length, i; int num_chars; Boolean replace_res; Boolean pending_delete = False; Status status_return; XmAnyCallbackStruct cb; /* Determine what was pressed. */ insert_length = XmImMbLookupString(w, (XKeyEvent *) event, insert_string, TEXT_MAX_INSERT_SIZE, (KeySym *) NULL, &status_return); if (insert_length > 0 && !XmTextF_editable(tf)) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay((Widget)tf), 0); return; } /* If there is more data than we can handle, bail out */ if (status_return == XBufferOverflow || insert_length > TEXT_MAX_INSERT_SIZE) { return; } /* *LookupString in some cases can return the NULL as a character, such * as when the user types or <@>. Text widget * can't handle the NULL as a character, so we dump it here. */ for (i=0; i < insert_length; i++) if (insert_string[i] == 0) insert_length = 0; /* toss out input string */ if (insert_length > 0) { /* do not insert non-printing characters */ if (!PrintableString(tf, insert_string, insert_length, False)) return; _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDeleteDisjoint(tf)){ if (!XmDataFieldGetSelectionPosition(w, &cursorPos, &nextPos) || cursorPos == nextPos) { XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); } pending_delete = True; XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); } else { cursorPos = nextPos = XmTextF_cursor_position(tf); } if (XmTextF_max_char_size(tf) == 1) { if (XmTextF_overstrike(tf)) nextPos += insert_length; if (nextPos > XmTextF_string_length(tf)) nextPos = XmTextF_string_length(tf); replace_res = _XmDataFieldReplaceText(tf, (XEvent *) event, cursorPos, nextPos, insert_string, insert_length, True); } else { char stack_cache[100]; insert_string[insert_length] = '\0'; /* NULL terminate for mbstowcs */ wc_insert_string = (wchar_t*)XmStackAlloc((Cardinal)(insert_length+1) * sizeof(wchar_t), stack_cache); num_chars = mbstowcs( wc_insert_string, insert_string, insert_length+1); if (XmTextF_overstrike(tf)) nextPos += num_chars; if (nextPos > XmTextF_string_length(tf)) nextPos = XmTextF_string_length(tf); replace_res = _XmDataFieldReplaceText(tf, (XEvent *) event, cursorPos, nextPos, (char*) wc_insert_string, num_chars, True); XmStackFree((char *)wc_insert_string, stack_cache); } if (replace_res) { if (pending_delete) { XmDataFieldSetSelection(w, XmTextF_cursor_position(tf), XmTextF_cursor_position(tf), event->xkey.time); } df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } _XmDataFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_InsertString( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_InsertString( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; char insert_string[TEXT_MAX_INSERT_SIZE]; XmTextPosition cursorPos, nextPos; wchar_t * wc_insert_string; int insert_length; int num_chars; Boolean replace_res; Boolean pending_delete = False; register int i; if (!XmTextF_editable(tf)) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay((Widget)tf), 0); } for (i = 0; i < *num_params; i++) { strcpy(insert_string, params[i]); insert_length = strlen(insert_string); if (insert_length > 0) { /* do not insert non-printing characters */ if (XmTextF_have_fontset(tf)){ if (!XmbTextEscapement((XFontSet)XmTextF_font(tf), insert_string, insert_length)) return; } else { if (!XTextWidth(XmTextF_font(tf), insert_string, insert_length)) return; } _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDeleteDisjoint(tf)){ if (!XmDataFieldGetSelectionPosition(w, &cursorPos, &nextPos) || cursorPos == nextPos) { XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); } pending_delete = True; XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); } else { cursorPos = nextPos = XmTextF_cursor_position(tf); } if (XmTextF_overstrike(tf)) { if (nextPos != XmTextF_string_length(tf)) nextPos++; } if (XmTextF_max_char_size(tf) == 1) { replace_res = _XmDataFieldReplaceText(tf, (XEvent *) event, cursorPos, nextPos, insert_string,insert_length, True); } else { insert_string[insert_length] = '\0'; /* NULL terminate for mbstowcs */ wc_insert_string = (wchar_t*)XtMalloc((unsigned)(insert_length+1) * sizeof(wchar_t)); num_chars = mbstowcs( wc_insert_string, insert_string, insert_length+1); replace_res = _XmDataFieldReplaceText(tf, (XEvent *) event, cursorPos, nextPos, (char*) wc_insert_string, num_chars, True); XtFree((char *)wc_insert_string); } if (replace_res) { if (pending_delete) { XmDataFieldSetSelection(w, XmTextF_cursor_position(tf), XmTextF_cursor_position(tf), event->xkey.time); } df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); } _XmDataFieldDrawInsertionPoint(tf, True); } } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeletePrevChar( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeletePrevChar( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDelete(tf)) (void) DataFieldRemove(w, event); else { if (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) { if (XmTextF_cursor_position(tf) - 1 >= 0) if (_XmDataFieldReplaceText(tf, event, XmTextF_cursor_position(tf) - 1, XmTextF_cursor_position(tf), NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } else if (XmTextF_cursor_position(tf) - 1 >= 0) { if (_XmDataFieldReplaceText(tf, event, XmTextF_cursor_position(tf) - 1, XmTextF_cursor_position(tf), NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeleteNextChar( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeleteNextChar( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDelete(tf)) (void) DataFieldRemove(w, event); else { if (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) { if (XmTextF_cursor_position(tf) < XmTextF_string_length(tf)) if (_XmDataFieldReplaceText(tf, event, XmTextF_cursor_position(tf), XmTextF_cursor_position(tf) + 1, NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } else if (XmTextF_cursor_position(tf) < XmTextF_string_length(tf)) if (_XmDataFieldReplaceText(tf, event, XmTextF_cursor_position(tf), XmTextF_cursor_position(tf) + 1, NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeletePrevWord( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeletePrevWord( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left, right; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDelete(tf)) (void) DataFieldRemove(w, event); else { df_FindPrevWord(tf, &left, &right); if (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) { if (_XmDataFieldReplaceText(tf, event, left, XmTextF_cursor_position(tf), NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } else if (XmTextF_cursor_position(tf) - 1 >= 0) if (_XmDataFieldReplaceText(tf, event, left, XmTextF_cursor_position(tf), NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeleteNextWord( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeleteNextWord( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left, right; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDelete(tf)) (void) DataFieldRemove(w, event); else { df_FindNextWord(tf, &left, &right); if (XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) { if (_XmDataFieldReplaceText(tf, event, XmTextF_cursor_position(tf), right, NULL, 0, True)){ df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } else if (XmTextF_cursor_position(tf) < XmTextF_string_length(tf)) if (_XmDataFieldReplaceText(tf, event, XmTextF_cursor_position(tf), right, NULL, 0, True)){ df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeleteToEndOfLine( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeleteToEndOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDelete(tf)) (void) DataFieldRemove(w, event); else if (XmTextF_cursor_position(tf) < XmTextF_string_length(tf)) { if (_XmDataFieldReplaceText(tf, event, XmTextF_cursor_position(tf), XmTextF_string_length(tf), NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeleteToStartOfLine( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeleteToStartOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmDataFieldDrawInsertionPoint(tf, False); if (df_NeedsPendingDelete(tf)) (void) DataFieldRemove(w, event); else if (XmTextF_cursor_position(tf) - 1 >= 0) { if (_XmDataFieldReplaceText(tf, event, 0, XmTextF_cursor_position(tf), NULL, 0, True)) { df_CheckDisjointSelection(w, XmTextF_cursor_position(tf), event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ProcessCancel( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ProcessCancel( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmParentInputActionRec p_event ; p_event.process_type = XmINPUT_ACTION ; p_event.action = XmPARENT_CANCEL ; p_event.event = event ;/* Pointer to XEvent. */ p_event.params = params ; /* Or use what you have if */ p_event.num_params = num_params ;/* input is from translation.*/ _XmDataFieldDrawInsertionPoint(tf, False); if (XmTextF_has_secondary(tf)) { XmTextF_cancel(tf) = True; _XmDataFieldSetSel2(w, 0, 0, False, event->xkey.time); XmTextF_has_secondary(tf) = False; XtUngrabKeyboard(w, CurrentTime); } if (XmTextF_has_primary(tf) && XmTextF_extending(tf)) { XmTextF_cancel(tf) = True; /* reset orig_left and orig_right */ XmDataFieldSetSelection(w, XmTextF_orig_left(tf), XmTextF_orig_right(tf), event->xkey.time); } if (!XmTextF_cancel(tf)) (void) _XmParentProcess(XtParent(tf), (XmParentProcessData) &p_event); if (XmTextF_select_id(tf)) { XtRemoveTimeOut(XmTextF_select_id(tf)); XmTextF_select_id(tf) = 0; } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_Activate( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_Activate( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmAnyCallbackStruct cb; XmDataFieldWidget tf = (XmDataFieldWidget) w; XmParentInputActionRec p_event ; p_event.process_type = XmINPUT_ACTION ; p_event.action = XmPARENT_ACTIVATE ; p_event.event = event ;/* Pointer to XEvent. */ p_event.params = params ; /* Or use what you have if */ p_event.num_params = num_params ;/* input is from translation.*/ cb.reason = XmCR_ACTIVATE; cb.event = event; XtCallCallbackList(w, XmTextF_activate_callback(tf), (XtPointer) &cb); (void) _XmParentProcess(XtParent(w), (XmParentProcessData) &p_event); } static void #ifdef _NO_PROTO df_SetAnchorBalancing(tf, position) XmDataFieldWidget tf; XmTextPosition position; #else df_SetAnchorBalancing( XmDataFieldWidget tf, XmTextPosition position) #endif /* _NO_PROTO */ { XmTextPosition left, right; float bal_point; if (!XmDataFieldGetSelectionPosition((Widget)tf, &left, &right) || left == right) { XmTextF_prim_anchor(tf) = position; } else { bal_point = (float)(((float)(right - left) / 2.0) + (float)left); /* shift anchor and direction to opposite end of the selection */ if ((float)position < bal_point) { XmTextF_prim_anchor(tf) = XmTextF_orig_right(tf); } else if ((float)position > bal_point) { XmTextF_prim_anchor(tf) = XmTextF_orig_left(tf); } } } static void #ifdef _NO_PROTO df_SetNavigationAnchor(tf, position, extend) XmDataFieldWidget tf; XmTextPosition position; Boolean extend; #else df_SetNavigationAnchor( XmDataFieldWidget tf, XmTextPosition position, #if NeedWidePrototypes int extend ) #else Boolean extend ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { XmTextPosition left, right; if (!XmTextF_add_mode(tf)) { if (extend) { df_SetAnchorBalancing(tf, position); } else { if (XmDataFieldGetSelectionPosition((Widget)tf, &left, &right) && left != right) { df_SetSelection(tf, position, position, True); XmTextF_prim_anchor(tf) = position; } } } else if (extend) { df_SetAnchorBalancing(tf, position); } } static void #ifdef _NO_PROTO df_CompleteNavigation(tf, event, position, time, extend) XmDataFieldWidget tf; XEvent *event; XmTextPosition position; Time time; Boolean extend; #else df_CompleteNavigation( XmDataFieldWidget tf, XEvent *event, XmTextPosition position, Time time, #if NeedWidePrototypes int extend ) #else Boolean extend ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { XmTextPosition left, right; Boolean backward = False; if ((XmTextF_add_mode(tf) && XmDataFieldGetSelectionPosition((Widget)tf, &left, &right) && position >= left && position <= right) || extend) XmTextF_pending_off(tf) = FALSE; else XmTextF_pending_off(tf) = TRUE; _XmDataFielddf_SetCursorPosition(tf, event, position, True, True); if (extend) { if (XmTextF_prim_anchor(tf) > position) { left = position; right = XmTextF_prim_anchor(tf); backward = True; } else { left = XmTextF_prim_anchor(tf); right = position; } XmDataFieldSetSelection((Widget)tf, left, right, time); /* Begin fix for CR 5994 */ if ( backward ) _XmDataFielddf_SetCursorPosition(tf, event, position, False, False); /* End fix for CR 5994 */ XmTextF_orig_left(tf) = left; XmTextF_orig_right(tf) = right; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_SimpleMovement( w, event, params, num_params, cursorPos, position ) Widget w ; XEvent *event ; String *params ; Cardinal *num_params ; XmTextPosition cursorPos ; XmTextPosition position ; #else df_SimpleMovement( Widget w, XEvent *event, String *params, Cardinal *num_params, XmTextPosition cursorPos, XmTextPosition position ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Boolean extend = False; if (*num_params > 0 && !strcmp(*params, "extend")) extend = True; _XmDataFieldDrawInsertionPoint(tf, False); df_SetNavigationAnchor(tf, cursorPos, extend); df_CompleteNavigation(tf, event, position, event->xkey.time, extend); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_BackwardChar( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_BackwardChar( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = XmTextF_cursor_position(tf); if (cursorPos > 0) { _XmDataFieldDrawInsertionPoint(tf, False); position = cursorPos - 1; df_SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmDataFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ForwardChar( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ForwardChar( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = XmTextF_cursor_position(tf); if (cursorPos < XmTextF_string_length(tf)) { _XmDataFieldDrawInsertionPoint(tf, False); position = cursorPos + 1; df_SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmDataFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_BackwardWord( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_BackwardWord( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition cursorPos, position, dummy; cursorPos = XmTextF_cursor_position(tf); if (cursorPos > 0) { _XmDataFieldDrawInsertionPoint(tf, False); df_FindPrevWord(tf, &position, &dummy); df_SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmDataFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ForwardWord( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ForwardWord( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition cursorPos, position, dummy; wchar_t white_space[3]; if (XmTextF_max_char_size(tf) != 1) { (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); } cursorPos = XmTextF_cursor_position(tf); _XmDataFieldDrawInsertionPoint(tf, False); if (cursorPos < XmTextF_string_length(tf)) { if (XmTextF_max_char_size(tf) == 1) { if (isspace((int)(unsigned char)XmTextF_value(tf)[cursorPos])) df_FindWord(tf, cursorPos, &dummy, &position); else df_FindNextWord(tf, &dummy, &position); if(isspace((int)(unsigned char)XmTextF_value(tf)[position])){ for (;position < XmTextF_string_length(tf); position++){ if (!isspace((int)(unsigned char)XmTextF_value(tf)[position])) break; } } } else { if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[cursorPos], white_space, 3)) df_FindWord(tf, cursorPos, &dummy, &position); else df_FindNextWord(tf, &dummy, &position); if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position], white_space, 3)){ for (; position < XmTextF_string_length(tf); position++) { if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position], white_space, 3)) break; } } } df_SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_EndOfLine( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_EndOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = XmTextF_cursor_position(tf); if (cursorPos < XmTextF_string_length(tf)) { _XmDataFieldDrawInsertionPoint(tf, False); position = XmTextF_string_length(tf); df_SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmDataFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_BeginningOfLine( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_BeginningOfLine( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = XmTextF_cursor_position(tf); if (cursorPos > 0) { position = 0; _XmDataFieldDrawInsertionPoint(tf, False); df_SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmDataFieldDrawInsertionPoint(tf, True); } } static void #ifdef _NO_PROTO df_SetSelection( tf, left, right, redisplay ) XmDataFieldWidget tf ; XmTextPosition left ; XmTextPosition right ; Boolean redisplay ; #else df_SetSelection( XmDataFieldWidget tf, XmTextPosition left, XmTextPosition right, #if NeedWidePrototypes int redisplay ) #else Boolean redisplay ) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { XmTextPosition display_left, display_right; XmTextPosition old_prim_left, old_prim_right; if (left < 0) left = 0; if (right < 0) right = 0; if (left > XmTextF_string_length(tf)) left = XmTextF_string_length(tf); if (right > XmTextF_string_length(tf)) right = XmTextF_string_length(tf); if (left == right && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf)) XmDataFieldSetAddMode((Widget)tf, False); if (left == XmTextF_prim_pos_left(tf) && right == XmTextF_prim_pos_right(tf)) return; DataFieldSetHighlight(tf, XmTextF_prim_pos_left(tf), XmTextF_prim_pos_right(tf), XmHIGHLIGHT_NORMAL); old_prim_left = XmTextF_prim_pos_left(tf); old_prim_right = XmTextF_prim_pos_right(tf); if (left > right) { XmTextF_prim_pos_left(tf) = right; XmTextF_prim_pos_right(tf) = left; } else { XmTextF_prim_pos_left(tf) = left; XmTextF_prim_pos_right(tf) = right; } DataFieldSetHighlight(tf, XmTextF_prim_pos_left(tf), XmTextF_prim_pos_right(tf), XmHIGHLIGHT_SELECTED); if (redisplay) { if (old_prim_left > XmTextF_prim_pos_left(tf)) { display_left = XmTextF_prim_pos_left(tf); } else if (old_prim_left < XmTextF_prim_pos_left(tf)) { display_left = old_prim_left; } else display_left = (old_prim_right > XmTextF_prim_pos_right(tf)) ? XmTextF_prim_pos_right(tf) : old_prim_right; if (old_prim_right < XmTextF_prim_pos_right(tf)) { display_right = XmTextF_prim_pos_right(tf); } else if (old_prim_right > XmTextF_prim_pos_right(tf)) { display_right = old_prim_right; } else display_right = (old_prim_left < XmTextF_prim_pos_left(tf)) ? XmTextF_prim_pos_left(tf) : old_prim_left; df_RedisplayText(tf, display_left, display_right); } XmTextF_refresh_ibeam_off(tf) = True; } /* * Begin the selection by gaining ownership of the selection * and setting the selection parameters. */ void #ifdef _NO_PROTO _XmDataFieldStartSelection( tf, left, right, sel_time ) XmDataFieldWidget tf ; XmTextPosition left ; XmTextPosition right ; Time sel_time ; #else _XmDataFieldStartSelection( XmDataFieldWidget tf, XmTextPosition left, XmTextPosition right, Time sel_time ) #endif /* _NO_PROTO */ { if (!XtIsRealized((Widget)tf)) return; /* if we don't already own the selection */ if (!XmTextF_has_primary(tf)) { /* * Try to gain ownership. This function identifies the * XtConvertSelectionProc and the XtLoseSelectionProc. */ if (XtOwnSelection((Widget)tf, XA_PRIMARY, sel_time, _XmDataFieldConvert, _XmDataFieldLoseSelection, (XtSelectionDoneProc) NULL)) { XmAnyCallbackStruct cb; XmTextF_prim_time(tf) = sel_time; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_has_primary(tf) = True; XmTextF_prim_pos_left(tf) = XmTextF_prim_pos_right(tf) = XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); /* * Set the selection boundries for highlighting the text, * and marking the selection. */ df_SetSelection(tf, left, right, True); _XmDataFieldDrawInsertionPoint(tf, True); /* Call the gain selection callback */ cb.reason = XmCR_GAIN_PRIMARY; cb.event = NULL; XtCallCallbackList((Widget) tf, XmTextF_gain_primary_callback(tf), (XtPointer) &cb); } else /* * Failed to gain ownership of the selection so make sure * the text does not think it owns the selection. * (this might be overkill) */ _XmDataFieldDeselectSelection((Widget)tf, True, sel_time); } else { _XmDataFieldDrawInsertionPoint(tf, False); XmDataFieldSetHighlight((Widget)tf, XmTextF_prim_pos_left(tf), XmTextF_prim_pos_right(tf), XmHIGHLIGHT_NORMAL); XmTextF_prim_pos_left(tf) = XmTextF_prim_pos_right(tf) = XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); /* * Set the new selection boundries for highlighting the text, * and marking the selection. */ df_SetSelection(tf, left, right, True); _XmDataFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ProcessHorizontalParams( w, event, params, num_params, left, right, position ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params; XmTextPosition *left ; XmTextPosition *right ; XmTextPosition *position ; #else df_ProcessHorizontalParams( Widget w, XEvent *event, char **params, Cardinal *num_params, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition old_cursorPos = XmTextF_cursor_position(tf); *position = XmTextF_cursor_position(tf); if (!XmDataFieldGetSelectionPosition(w, left, right) || *left == *right) { XmTextF_orig_left(tf) = XmTextF_orig_right(tf) = XmTextF_prim_anchor(tf); *left = *right = old_cursorPos; } if (*num_params > 0 && !strcmp(*params, "right")) { if (*position >= XmTextF_string_length(tf)) return; (*position)++; } else if (*num_params > 0 && !strcmp(*params, "left")) { if (*position <= 0) return; (*position)--; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ProcessSelectParams( w, event, left, right, position ) Widget w ; XEvent *event ; XmTextPosition *left ; XmTextPosition *right ; XmTextPosition *position ; #else df_ProcessSelectParams( Widget w, XEvent *event, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; *position = XmTextF_cursor_position(tf); if (!XmDataFieldGetSelectionPosition(w, left, right) || *left == *right) { if (*position > XmTextF_prim_anchor(tf)) { *left = XmTextF_prim_anchor(tf); *right = *position; } else { *left = *position; *right = XmTextF_prim_anchor(tf); } } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_KeySelection( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_KeySelection( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmTextPosition position = 0, left, right; XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition cursorPos; _XmDataFieldDrawInsertionPoint(tf,False); /* Turn off I beam blink during selection */ XmTextF_orig_left(tf) = XmTextF_prim_pos_left(tf); XmTextF_orig_right(tf) = XmTextF_prim_pos_right(tf); cursorPos = XmTextF_cursor_position(tf); if (*num_params > 0 && (!strcmp(*params,"right") || !strcmp(*params, "left"))) df_SetAnchorBalancing(tf, cursorPos); XmTextF_extending(tf) = True; if (*num_params == 0) { position = cursorPos; df_ProcessSelectParams(w, event, &left, &right, &position); } else if (*num_params > 0 && (!strcmp(*params, "right") || !strcmp(*params, "left"))) { df_ProcessHorizontalParams(w, event, params, num_params, &left, &right, &position); } cursorPos = position; if (position < 0 || position > XmTextF_string_length(tf)) { _XmDataFieldDrawInsertionPoint(tf,True); /* Turn on I beam now that we are done */ return; } /* shift anchor and direction to opposite end of the selection */ if (position > XmTextF_prim_anchor(tf)) { right = cursorPos = position; left = XmTextF_prim_anchor(tf); } else { left = cursorPos = position; right = XmTextF_prim_anchor(tf); } if (left > right) { XmTextPosition tempIndex = left; left = right; right = tempIndex; } if (XmTextF_has_primary(tf)) df_SetSelection(tf, left, right, True); else _XmDataFieldStartSelection(tf, left, right, event->xbutton.time); XmTextF_pending_off(tf) = False; _XmDataFielddf_SetCursorPosition(tf, event, cursorPos, True, True); (void) df_SetDestination(w, cursorPos, False, event->xkey.time); XmTextF_orig_left(tf) = XmTextF_prim_pos_left(tf); XmTextF_orig_right(tf) = XmTextF_prim_pos_right(tf); _XmDataFieldDrawInsertionPoint(tf,True); /* Turn on I beam now that we are done */ } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TextFocusIn( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_TextFocusIn( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmAnyCallbackStruct cb; XPoint xmim_point; XtWidgetProc bhl; if (event->xfocus.send_event && !(XmTextF_has_focus(tf))) { if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); XmTextF_has_focus(tf) = True; if (XtIsSensitive(w)) _XmDataFToggleCursorGC(w); _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_blink_on(tf) = False; XmTextF_refresh_ibeam_off(tf) = True; if (_XmGetFocusPolicy(w) == XmEXPLICIT) { _XmProcessLock(); bhl = ((XmDataFieldWidgetClass)XtClass(w))->primitive_class.border_highlight; _XmProcessUnlock(); if (bhl) { (*bhl)(w); } if (!XmTextF_has_destination(tf)) { (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, XtLastTimestampProcessed(XtDisplay(w))); } } if (tf->core.sensitive) df_ChangeBlinkBehavior(tf, True); _XmDataFieldDrawInsertionPoint(tf, True); (void) df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, &xmim_point.y); XmImVaSetFocusValues(w, XmNspotLocation, &xmim_point, NULL); cb.reason = XmCR_FOCUS; cb.event = event; XtCallCallbackList (w, XmTextF_focus_callback(tf), (XtPointer) &cb); } _XmPrimitiveFocusIn(w, event, params, num_params); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TextFocusOut( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_TextFocusOut( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XtWidgetProc buhl; if (event->xfocus.send_event && XmTextF_has_focus(tf)) { XmTextF_has_focus(tf) = False; df_ChangeBlinkBehavior(tf, False); _XmDataFieldDrawInsertionPoint(tf, False); _XmDataFToggleCursorGC(w); XmTextF_blink_on(tf) = True; _XmDataFieldDrawInsertionPoint(tf, True); _XmProcessLock(); buhl = ((XmDataFieldWidgetClass) XtClass(tf))->primitive_class.border_unhighlight; _XmProcessUnlock(); if(buhl) { (*buhl)( (Widget) tf) ; } XmImUnsetFocus(w); } /* If traversal is on, then the leave verification callback is called in the traversal event handler */ if (event->xfocus.send_event && !XmTextF_traversed(tf) && _XmGetFocusPolicy(w) == XmEXPLICIT) { if (!df_VerifyLeave(tf, event)) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay(w), 0); return; } } else if (XmTextF_traversed(tf)) { XmTextF_traversed(tf) = False; } } static void #ifdef _NO_PROTO df_SetScanIndex( tf, event ) XmDataFieldWidget tf ; XEvent *event ; #else df_SetScanIndex( XmDataFieldWidget tf, XEvent *event ) #endif /* _NO_PROTO */ { Time sel_time; if (event->type == ButtonPress) sel_time = event->xbutton.time; else sel_time = event->xkey.time; if (sel_time > XmTextF_last_time(tf) && sel_time - XmTextF_last_time(tf) < XtGetMultiClickTime(XtDisplay(tf))) { /* * Fix for HaL DTS 9841 - Increment the sarray_index first, then check to * see if it is greater that the count. Otherwise, * an error will occur. */ XmTextF_sarray_index(tf)++; if (XmTextF_sarray_index(tf) >= XmTextF_selection_array_count(tf)) { XmTextF_sarray_index(tf) = 0; } /* * End fix for HaL DTS 9841 */ } else XmTextF_sarray_index(tf) = 0; XmTextF_last_time(tf) = sel_time; } static void #ifdef _NO_PROTO df_ExtendScanSelection( tf, event ) XmDataFieldWidget tf ; XEvent *event ; #else df_ExtendScanSelection( XmDataFieldWidget tf, XEvent *event ) #endif /* _NO_PROTO */ { XmTextPosition pivot_left, pivot_right; XmTextPosition left, right; XmTextPosition new_position = df_GetPosFromX(tf, (Position) event->xbutton.x); XmTextPosition cursorPos = XmTextF_cursor_position(tf); Boolean pivot_modify = False; float bal_point; if (!XmDataFieldGetSelectionPosition((Widget)tf, &left, &right) || left == right) { XmTextF_orig_left(tf) = XmTextF_orig_right(tf) = XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); bal_point = (float)XmTextF_orig_left(tf); } else bal_point = (float)(((float)(right - left) / 2.0) + (float)left); if (!XmTextF_extending(tf)) { if ((float)new_position < bal_point) { XmTextF_prim_anchor(tf) = XmTextF_orig_right(tf); } else if ((float)new_position > bal_point) { XmTextF_prim_anchor(tf) = XmTextF_orig_left(tf); } } XmTextF_extending(tf) = True; switch (XmTextF_selection_array(tf)[XmTextF_sarray_index(tf)]) { case XmSELECT_POSITION: if (XmTextF_has_primary(tf)) df_SetSelection(tf, XmTextF_prim_anchor(tf), new_position, True); else if (new_position != XmTextF_prim_anchor(tf)) _XmDataFieldStartSelection(tf, XmTextF_prim_anchor(tf), new_position, event->xbutton.time); XmTextF_pending_off(tf) = False; cursorPos = new_position; break; case XmSELECT_WHITESPACE: case XmSELECT_WORD: df_FindWord(tf, new_position, &left, &right); df_FindWord(tf, XmTextF_prim_anchor(tf), &pivot_left, &pivot_right); XmTextF_pending_off(tf) = False; if (left != pivot_left || right != pivot_right) { if (left > pivot_left) left = pivot_left; if (right < pivot_right) right = pivot_right; pivot_modify = True; } if (XmTextF_has_primary(tf)) df_SetSelection(tf, left, right, True); else _XmDataFieldStartSelection(tf, left, right, event->xbutton.time); if (pivot_modify) { if ((((right - left) / 2) + left) <= new_position) { cursorPos = right; } else cursorPos = left; } else { if (left >= XmTextF_cursor_position(tf)) cursorPos = left; else cursorPos = right; } break; default: break; } if (cursorPos != XmTextF_cursor_position(tf)) { (void) df_SetDestination((Widget)tf, cursorPos, False, event->xkey.time); _XmDataFielddf_SetCursorPosition(tf, event, cursorPos, True, True); } } static void #ifdef _NO_PROTO df_SetScanSelection( tf, event ) XmDataFieldWidget tf ; XEvent *event ; #else df_SetScanSelection( XmDataFieldWidget tf, XEvent *event ) #endif /* _NO_PROTO */ { XmTextPosition left, right; XmTextPosition new_position = 0; XmTextPosition cursorPos = XmTextF_cursor_position(tf); Position dummy = 0; Boolean update_position = False; df_SetScanIndex(tf, event); if (event->type == ButtonPress) new_position = df_GetPosFromX(tf, (Position) event->xbutton.x); else new_position = XmTextF_cursor_position(tf); _XmDataFieldDrawInsertionPoint(tf,False); /* Turn off I beam blink during selection */ switch (XmTextF_selection_array(tf)[XmTextF_sarray_index(tf)]) { case XmSELECT_POSITION: XmTextF_prim_anchor(tf) = new_position; if (XmTextF_has_primary(tf)) { df_SetSelection(tf, new_position, new_position, True); XmTextF_pending_off(tf) = False; } cursorPos = new_position; update_position = True; break; case XmSELECT_WHITESPACE: case XmSELECT_WORD: df_FindWord(tf, XmTextF_cursor_position(tf), &left, &right); if (XmTextF_has_primary(tf)) df_SetSelection(tf, left, right, True); else _XmDataFieldStartSelection(tf, left, right, event->xbutton.time); XmTextF_pending_off(tf) = False; if ((((right - left) / 2) + left) <= new_position) cursorPos = right; else cursorPos = left; break; case XmSELECT_LINE: case XmSELECT_OUT_LINE: case XmSELECT_PARAGRAPH: case XmSELECT_ALL: if (XmTextF_has_primary(tf)) df_SetSelection(tf, 0, XmTextF_string_length(tf), True); else _XmDataFieldStartSelection(tf, 0, XmTextF_string_length(tf), event->xbutton.time); XmTextF_pending_off(tf) = False; if (event->type == ButtonPress) { if ((XmTextF_string_length(tf)) / 2 <= new_position) cursorPos = XmTextF_string_length(tf); else cursorPos = 0; } break; } (void) df_SetDestination((Widget)tf, cursorPos, False, event->xkey.time); if (cursorPos != XmTextF_cursor_position(tf) || update_position) { _XmDataFielddf_SetCursorPosition(tf, event, cursorPos, True, True); } df_GetXYFromPos(tf, cursorPos, &(XmTextF_select_pos_x(tf)), &dummy); _XmDataFieldDrawInsertionPoint(tf,True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_StartPrimary( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_StartPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; if (!XmTextF_has_focus(tf) && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); _XmDataFieldDrawInsertionPoint(tf,False); df_SetScanSelection(tf, event); /* use scan type to set the selection */ _XmDataFieldDrawInsertionPoint(tf,True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_MoveDestination( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_MoveDestination( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left, right; XmTextPosition new_position; Boolean old_has_focus = XmTextF_has_focus(tf); Boolean reset_cursor = False; new_position = df_GetPosFromX(tf, (Position) event->xbutton.x); _XmDataFieldDrawInsertionPoint(tf, False); if (XmDataFieldGetSelectionPosition(w, &left, &right) && (right != left)) (void) df_SetDestination(w, new_position, False, event->xbutton.time); XmTextF_pending_off(tf) = False; if (!XmTextF_has_focus(tf) && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); /* Doing the the df_MoveDestination caused a traversal into my, causing * me to gain focus... Cursor is now on when it shouldn't be. */ if ((reset_cursor = !old_has_focus && XmTextF_has_focus(tf)) != False) _XmDataFieldDrawInsertionPoint(tf, False); _XmDataFielddf_SetCursorPosition(tf, event, new_position, True, True); if (new_position < left && new_position > right) XmTextF_pending_off(tf) = True; /* * if cursor was turned off as a result of the focus state changing * then we need to undo the decrement to the cursor_on variable * by redrawing the insertion point. */ if (reset_cursor) _XmDataFieldDrawInsertionPoint(tf, True); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ExtendPrimary( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ExtendPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; if (XmTextF_cancel(tf)) return; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_do_drop(tf) = False; if (!df_CheckTimerScrolling(w, event)){ if (event->type == ButtonPress) df_DoExtendedSelection(w, event->xbutton.time); else df_DoExtendedSelection(w, event->xkey.time); } else df_ExtendScanSelection(tf, event); /* use scan type to set the selection */ _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ExtendEnd( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ExtendEnd( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; if (XmTextF_prim_pos_left(tf) == 0 && XmTextF_prim_pos_right(tf) == 0) XmTextF_orig_left(tf) = XmTextF_orig_right(tf) = XmTextF_cursor_position(tf); else { XmTextF_orig_left(tf) = XmTextF_prim_pos_left(tf); XmTextF_orig_right(tf) = XmTextF_prim_pos_right(tf); XmTextF_cancel(tf) = False; } if (XmTextF_select_id(tf)) { XtRemoveTimeOut(XmTextF_select_id(tf)); XmTextF_select_id(tf) = 0; } XmTextF_select_pos_x(tf) = 0; XmTextF_extending(tf) = False; } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DoExtendedSelection(w, time) Widget w; Time time; #else df_DoExtendedSelection( Widget w, Time time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition position, left, right, cursorPos; XmTextPosition pivot_left, pivot_right; Boolean pivot_modify = False; float bal_point; if (XmTextF_cancel(tf)) { if (XmTextF_select_id(tf)) XtRemoveTimeOut(XmTextF_select_id(tf)); XmTextF_select_id(tf) = 0; return; } cursorPos = XmTextF_cursor_position(tf); _XmDataFieldDrawInsertionPoint(tf, False); if (!(XmDataFieldGetSelectionPosition(w, &left, &right)) || left == right) { XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); left = right = XmTextF_cursor_position(tf); XmTextF_orig_left(tf) = XmTextF_orig_right(tf) = XmTextF_prim_anchor(tf); bal_point = (float)XmTextF_prim_anchor(tf); } else bal_point = (float)(((float)(XmTextF_orig_right(tf) - XmTextF_orig_left(tf)) / 2.0) + (float)XmTextF_orig_left(tf)); position = XmDataFieldXYToPos(w, XmTextF_select_pos_x(tf), 0); if (!XmTextF_extending(tf)) { if ((float)position < bal_point) { XmTextF_prim_anchor(tf) = XmTextF_orig_right(tf); } else if ((float)position > bal_point) { XmTextF_prim_anchor(tf) = XmTextF_orig_left(tf); } } XmTextF_extending(tf) = True; /* Extend selection in same way as ExtendScan would do */ switch (XmTextF_selection_array(tf)[XmTextF_sarray_index(tf)]) { case XmSELECT_POSITION: if (XmTextF_has_primary(tf)) df_SetSelection(tf, XmTextF_prim_anchor(tf), position, True); else if (position != XmTextF_prim_anchor(tf)) _XmDataFieldStartSelection(tf, XmTextF_prim_anchor(tf), position, time); XmTextF_pending_off(tf) = False; cursorPos = position; break; case XmSELECT_WHITESPACE: case XmSELECT_WORD: df_FindWord(tf, position, &left, &right); df_FindWord(tf, XmTextF_prim_anchor(tf), &pivot_left, &pivot_right); XmTextF_pending_off(tf) = False; if (left != pivot_left || right != pivot_right) { if (left > pivot_left) left = pivot_left; if (right < pivot_right) right = pivot_right; pivot_modify = True; } if (XmTextF_has_primary(tf)) df_SetSelection(tf, left, right, True); else _XmDataFieldStartSelection(tf, left, right, time); if (pivot_modify) { if ((((right - left) / 2) + left) <= position) { cursorPos = right; } else cursorPos = left; } else { if (left >= XmTextF_cursor_position(tf)) cursorPos = left; else cursorPos = right; } break; default: break; } if (cursorPos != XmTextF_cursor_position(tf)) { (void) df_SetDestination((Widget)tf, cursorPos, False, time); _XmDataFielddf_SetCursorPosition(tf, NULL, cursorPos, True, True); } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DoSecondaryExtend(w, ev_time) Widget w; Time ev_time; #else df_DoSecondaryExtend( Widget w, Time ev_time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition position = XmDataFieldXYToPos(w, XmTextF_select_pos_x(tf), 0); if (XmTextF_cancel(tf)) return; if (position < XmTextF_sec_anchor(tf)) { if (XmTextF_sec_pos_left(tf) > 0) _XmDataFieldSetSel2(w, position, XmTextF_sec_anchor(tf), False, ev_time); XmDataFieldShowPosition(w, XmTextF_sec_pos_left(tf)); } else if (position > XmTextF_sec_anchor(tf)) { if (XmTextF_sec_pos_right(tf) < XmTextF_string_length(tf)) _XmDataFieldSetSel2(w, XmTextF_sec_anchor(tf), position, False, ev_time); XmDataFieldShowPosition(w, XmTextF_sec_pos_right(tf)); } else { _XmDataFieldSetSel2(w, position, position, False, ev_time); XmDataFieldShowPosition(w, position); } df_ResetClipOrigin(tf, False); XmTextF_sec_extending(tf) = True; } /************************************************************************ * * * df_BrowseScroll - timer proc that scrolls the list if the user has left * * the window with the button down. If the button has been * * released, call the standard click stuff. * * * ************************************************************************/ /* ARGSUSED */ static void #ifdef _NO_PROTO df_BrowseScroll( closure, id ) XtPointer closure ; XtIntervalId *id ; #else df_BrowseScroll( XtPointer closure, XtIntervalId *id ) #endif /* _NO_PROTO */ { Widget w = (Widget) closure ; XmDataFieldWidget tf = (XmDataFieldWidget) w; if (XmTextF_cancel(tf)) { XmTextF_select_id(tf) = 0; return; } if (!XmTextF_select_id(tf)) return; _XmDataFieldDrawInsertionPoint(tf, False); if (XmTextF_sec_extending(tf)) df_DoSecondaryExtend(w, XtLastTimestampProcessed(XtDisplay(w))); else if (XmTextF_extending(tf)) df_DoExtendedSelection(w, XtLastTimestampProcessed(XtDisplay(w))); XSync (XtDisplay(w), False); _XmDataFieldDrawInsertionPoint(tf, True); XmTextF_select_id(tf) = XtAppAddTimeOut(XtWidgetToApplicationContext(w), (unsigned long) PRIM_SCROLL_INTERVAL, df_BrowseScroll, (XtPointer) w); } /* ARGSUSED */ static Boolean #ifdef _NO_PROTO df_CheckTimerScrolling( w, event ) Widget w ; XEvent *event ; #else df_CheckTimerScrolling( Widget w, XEvent *event ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Dimension margin_size = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension top_margin = XmTextF_margin_height(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; XmTextF_select_pos_x(tf) = event->xmotion.x; if ((event->xmotion.x > (int) margin_size) && (event->xmotion.x < (int) (tf->core.width - margin_size)) && (event->xmotion.y > (int) top_margin) && (event->xmotion.y < (int) (top_margin + XmTextF_font_ascent(tf) + XmTextF_font_descent(tf)))) { if (XmTextF_select_id(tf)) { XtRemoveTimeOut(XmTextF_select_id(tf)); XmTextF_select_id(tf) = 0; } } else { /* to the left of the text */ if (event->xmotion.x <= (int) margin_size) XmTextF_select_pos_x(tf) = (Position) (margin_size - (XmTextF_average_char_width(tf) + 1)); /* to the right of the text */ else if (event->xmotion.x >= (int) (tf->core.width - margin_size)) XmTextF_select_pos_x(tf) = (Position) ((tf->core.width - margin_size) + XmTextF_average_char_width(tf) + 1); if (!XmTextF_select_id(tf)) XmTextF_select_id(tf) = XtAppAddTimeOut(XtWidgetToApplicationContext(w), (unsigned long) SEC_SCROLL_INTERVAL, df_BrowseScroll, (XtPointer) w); return True; } return False; } static void #ifdef _NO_PROTO df_RestorePrimaryHighlight( tf, prim_left, prim_right ) XmDataFieldWidget tf ; XmTextPosition prim_left ; XmTextPosition prim_right ; #else df_RestorePrimaryHighlight( XmDataFieldWidget tf, XmTextPosition prim_left, XmTextPosition prim_right ) #endif /* _NO_PROTO */ { if (XmTextF_sec_pos_right(tf) >= prim_left && XmTextF_sec_pos_right(tf) <= prim_right) { /* secondary selection is totally inside primary selection */ if (XmTextF_sec_pos_left(tf) >= prim_left) { DataFieldSetHighlight(tf, prim_left, XmTextF_sec_pos_left(tf), XmHIGHLIGHT_SELECTED); DataFieldSetHighlight(tf, XmTextF_sec_pos_left(tf), XmTextF_sec_pos_right(tf), XmHIGHLIGHT_NORMAL); DataFieldSetHighlight(tf, XmTextF_sec_pos_right(tf), prim_right, XmHIGHLIGHT_SELECTED); /* right side of secondary selection is inside primary selection */ } else { DataFieldSetHighlight(tf, XmTextF_sec_pos_left(tf), prim_left, XmHIGHLIGHT_NORMAL); DataFieldSetHighlight(tf, prim_left, XmTextF_sec_pos_right(tf), XmHIGHLIGHT_SELECTED); } } else { /* left side of secondary selection is inside primary selection */ if (XmTextF_sec_pos_left(tf) <= prim_right && XmTextF_sec_pos_left(tf) >= prim_left) { DataFieldSetHighlight(tf, XmTextF_sec_pos_left(tf), prim_right, XmHIGHLIGHT_SELECTED); DataFieldSetHighlight(tf, prim_right, XmTextF_sec_pos_right(tf), XmHIGHLIGHT_NORMAL); } else { /* secondary selection encompasses the primary selection */ if (XmTextF_sec_pos_left(tf) <= prim_left && XmTextF_sec_pos_right(tf) >= prim_right){ DataFieldSetHighlight(tf, XmTextF_sec_pos_left(tf), prim_left, XmHIGHLIGHT_NORMAL); DataFieldSetHighlight(tf, prim_left, prim_right, XmHIGHLIGHT_SELECTED); DataFieldSetHighlight(tf, prim_right, XmTextF_sec_pos_right(tf), XmHIGHLIGHT_NORMAL); /* secondary selection is outside primary selection */ } else { DataFieldSetHighlight(tf, prim_left, prim_right, XmHIGHLIGHT_SELECTED); DataFieldSetHighlight(tf, XmTextF_sec_pos_left(tf), XmTextF_sec_pos_right(tf), XmHIGHLIGHT_NORMAL); } } } } void #ifdef _NO_PROTO _XmDataFieldSetSel2( w, left, right, disown, sel_time ) Widget w ; XmTextPosition left ; XmTextPosition right ; Boolean disown ; Time sel_time ; #else _XmDataFieldSetSel2( Widget w, XmTextPosition left, XmTextPosition right, Boolean disown, Time sel_time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Boolean result; if (XmTextF_has_secondary(tf)) { XmTextPosition prim_left, prim_right; if (left == XmTextF_sec_pos_left(tf) && right == XmTextF_sec_pos_right(tf)) return; /* If the widget has the primary selection, make sure the selection * highlight is restored appropriately. */ if (XmDataFieldGetSelectionPosition(w, &prim_left, &prim_right)) df_RestorePrimaryHighlight(tf, prim_left, prim_right); else DataFieldSetHighlight(tf, XmTextF_sec_pos_left(tf), XmTextF_sec_pos_right(tf), XmHIGHLIGHT_NORMAL); } if (left < right) { if (!XmTextF_has_secondary(tf)) { result = XtOwnSelection(w, XA_SECONDARY, sel_time, _XmDataFieldConvert, _XmDataFieldLoseSelection, (XtSelectionDoneProc) NULL); XmTextF_sec_time(tf) = sel_time; XmTextF_has_secondary(tf) = result; if (result) { XmTextF_sec_pos_left(tf) = left; XmTextF_sec_pos_right(tf) = right; } } else { XmTextF_sec_pos_left(tf) = left; XmTextF_sec_pos_right(tf) = right; } XmTextF_sec_drag(tf) = True; } else { XmTextF_sec_pos_left(tf) = XmTextF_sec_pos_right(tf) = left; if (disown) { XtDisownSelection(w, XA_SECONDARY, sel_time); XmTextF_has_secondary(tf) = False; } } DataFieldSetHighlight((XmDataFieldWidget) w, XmTextF_sec_pos_left(tf), XmTextF_sec_pos_right(tf), XmHIGHLIGHT_SECONDARY_SELECTED); /* This can be optimized for performance enhancement */ df_RedisplayText(tf, 0, XmTextF_string_length(tf)); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_StartDrag( w, event, params, num_params ) Widget w ; XEvent *event ; String *params ; Cardinal *num_params ; #else df_StartDrag( Widget w, XEvent *event, String *params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Atom targets[5]; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ XTextProperty tmp_prop; int status = 0; Cardinal num_targets = 0; Widget drag_icon; Arg args[10]; int n; tmp_prop.value = NULL; status = XmbTextListToTextProperty(XtDisplay(w), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (status == Success) targets[num_targets++] = tmp_prop.encoding; else targets[num_targets++] = 99999; /* XmbTextList... should never fail * for XPCS characters. But just in * case someones Xlib is broken, * this prevents a core dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); #ifdef UTF8_SUPPORTED targets[num_targets++] = XmInternAtom(XtDisplay(w), "UTF8_STRING", False); #endif targets[num_targets++] = XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); targets[num_targets++] = XA_STRING; targets[num_targets++] = XmInternAtom(XtDisplay(w), "TEXT", False); drag_icon = XmeGetTextualDragIcon(w); n = 0; XtSetArg(args[n], XmNcursorBackground, tf->core.background_pixel); n++; XtSetArg(args[n], XmNcursorForeground, tf->primitive.foreground); n++; XtSetArg(args[n], XmNsourceCursorIcon, drag_icon); n++; XtSetArg(args[n], XmNexportTargets, targets); n++; XtSetArg(args[n], XmNnumExportTargets, num_targets); n++; XtSetArg(args[n], XmNconvertProc, _XmDataFieldConvert); n++; XtSetArg(args[n], XmNclientData, w); n++; if (XmTextF_editable(tf)) { XtSetArg(args[n], XmNdragOperations, (XmDROP_MOVE | XmDROP_COPY)); n++; } else { XtSetArg(args[n], XmNdragOperations, XmDROP_COPY); n++; } (void) XmDragStart(w, event, args, n); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_StartSecondary( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_StartSecondary( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition position = df_GetPosFromX(tf, (Position) event->xbutton.x); int status; XmTextF_sec_anchor(tf) = position; XmTextF_selection_move(tf) = FALSE; status = XtGrabKeyboard(w, False, GrabModeAsync, GrabModeAsync, event->xbutton.time); if (status != GrabSuccess) XmeWarning(w, GRABKBDERROR); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ProcessBDrag( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ProcessBDrag( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition position, left, right; Position left_x, right_x, dummy; position = df_GetPosFromX(tf, (Position) event->xbutton.x); XmTextF_sec_pos_left(tf) = position; _XmDataFieldDrawInsertionPoint(tf, False); if (XmDataFieldGetSelectionPosition(w, &left, &right) && left != right) { if ((position > left && position < right) || /* Take care of border conditions */ (position == left && df_GetXYFromPos(tf, left, &left_x, &dummy) && event->xbutton.x > left_x) || (position == right && df_GetXYFromPos(tf, right, &right_x, &dummy) && event->xbutton.x < right_x)) { XmTextF_sel_start(tf) = False; df_StartDrag(w, event, params, num_params); } else { XmTextF_sel_start(tf) = True; XAllowEvents(XtDisplay(w), AsyncBoth, event->xbutton.time); df_StartSecondary(w, event, params, num_params); } } else { XmTextF_sel_start(tf) = True; XAllowEvents(XtDisplay(w), AsyncBoth, event->xbutton.time); df_StartSecondary(w, event, params, num_params); } _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ExtendSecondary( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ExtendSecondary( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition position = df_GetPosFromX(tf, (Position) event->xbutton.x); if (XmTextF_cancel(tf)) return; _XmDataFieldDrawInsertionPoint(tf, False); if (position < XmTextF_sec_anchor(tf)) { _XmDataFieldSetSel2(w, position, XmTextF_sec_anchor(tf), False, event->xbutton.time); } else if (position > XmTextF_sec_anchor(tf)) { _XmDataFieldSetSel2(w, XmTextF_sec_anchor(tf), position, False, event->xbutton.time); } else { _XmDataFieldSetSel2(w, position, position, False, event->xbutton.time); } XmTextF_sec_extending(tf) = True; if (!df_CheckTimerScrolling(w, event)) df_DoSecondaryExtend(w, event->xmotion.time); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DoStuff( w, closure, seltype, type, value, length, format ) Widget w ; XtPointer closure ; Atom *seltype ; Atom *type ; XtPointer value ; unsigned long *length ; int *format ; #else df_DoStuff( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmTextPrimSelect *prim_select = (_XmTextPrimSelect *) closure; Atom NULL_ATOM = XmInternAtom(XtDisplay(w), "NULL", False); XmTextPosition right, left; int prim_char_length = 0; Boolean replace_res = False; XTextProperty tmp_prop; int i, status; int malloc_size; int num_vals; char **tmp_value; XmAnyCallbackStruct cb; if (!XmTextF_has_focus(tf) && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); if (!(*length) && *type != NULL_ATOM ) { /* Backwards compatibility for 1.0 Selections */ if (prim_select->target == XmInternAtom(XtDisplay(w), "TEXT", False)) { prim_select->target = XA_STRING; XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, df_DoStuff, (XtPointer)prim_select, prim_select->time); } XtFree((char *)value); value = NULL; return; } /* if length == 0 and *type is the NULL atom we are assuming * that a DELETE target is requested. */ if (*type == NULL_ATOM ) { if (prim_select->num_chars > 0 && XmTextF_selection_move(tf)) { prim_char_length = prim_select->num_chars; XmDataFieldSetSelection(w, prim_select->position, prim_select->position + prim_char_length, prim_select->time); XmTextF_prim_anchor(tf) = prim_select->position; (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, prim_select->time); } } else { int max_length = 0; Boolean local = XmTextF_has_primary(tf); if (XmTextF_selection_move(tf) && local) { max_length = XmTextF_max_length(tf); XmTextF_max_length(tf) = INT_MAX; } if (*type == XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False) || #ifdef UTF8_SUPPORTED *type == XmInternAtom(XtDisplay(w), "UTF8_STRING", False) || #endif *type == XA_STRING) { tmp_prop.value = (unsigned char *) value; tmp_prop.encoding = *type; tmp_prop.format = *format; tmp_prop.nitems = *length; num_vals = 0; status = XmbTextPropertyToTextList(XtDisplay(w), &tmp_prop, &tmp_value, &num_vals); /* if no conversion, num_vals is not changed */ /* status will be >0 if some characters could not be converted */ if (num_vals && (status == Success || status > 0)) { if (XmTextF_max_char_size(tf) == 1){ char * total_tmp_value; for (i = 0, malloc_size = 1; i < num_vals ; i++) malloc_size += strlen(tmp_value[i]); prim_select->num_chars = malloc_size - 1; total_tmp_value = XtMalloc ((unsigned) malloc_size); total_tmp_value[0] = '\0'; for (i = 0; i < num_vals ; i++) strcat(total_tmp_value, tmp_value[i]); replace_res = _XmDataFieldReplaceText(tf, NULL, prim_select->position, prim_select->position, total_tmp_value, strlen(total_tmp_value), False); XFreeStringList(tmp_value); XtFree(total_tmp_value); } else { wchar_t * wc_value; prim_select->num_chars = 0; for (i = 0, malloc_size = sizeof(wchar_t); i < num_vals ; i++) malloc_size += strlen(tmp_value[i]) * sizeof(wchar_t); wc_value = (wchar_t*)XtMalloc ((unsigned) malloc_size); for (i = 0; i < num_vals ; i++) prim_select->num_chars += mbstowcs(wc_value + prim_select->num_chars, tmp_value[i], (size_t)malloc_size - prim_select->num_chars); replace_res = _XmDataFieldReplaceText(tf, NULL, prim_select->position, prim_select->position, (char*)wc_value, prim_select->num_chars, False); XtFree((char*)wc_value); } } else { /* initialize prim_select values for possible delete oper */ prim_select->num_chars = 0; } } else { if (XmTextF_max_char_size(tf) == 1){ /* Note: *length may be truncated during cast to int */ prim_select->num_chars = (int) *length; replace_res = _XmDataFieldReplaceText(tf, NULL, prim_select->position, prim_select->position, (char *) value, prim_select->num_chars, False); } else { wchar_t * wc_value; wc_value = (wchar_t*)XtMalloc ((unsigned) (*length * sizeof(wchar_t))); prim_select->num_chars = mbstowcs(wc_value, (char *) value, (size_t) *length); replace_res = _XmDataFieldReplaceText(tf, NULL, prim_select->position, prim_select->position, (char*)wc_value, prim_select->num_chars, False); XtFree((char*)wc_value); } } if (replace_res) { XmTextPosition cursorPos; XmTextF_pending_off(tf) = FALSE; cursorPos = prim_select->position + prim_select->num_chars; if (prim_select->num_chars > 0 && !XmTextF_selection_move(tf)){ (void) df_SetDestination(w, cursorPos, False, prim_select->time); _XmDataFielddf_SetCursorPosition(tf, NULL, cursorPos, True, True); } if (XmDataFieldGetSelectionPosition(w, &left, &right)) { if (XmTextF_selection_move(tf) && left < prim_select->position) prim_select->position -= prim_select->num_chars; if (left <= cursorPos && right >= cursorPos) XmTextF_pending_off(tf) = TRUE; } else { if (!XmTextF_selection_move(tf) && !XmTextF_add_mode(tf) && prim_select->num_chars != 0) XmTextF_prim_anchor(tf) = prim_select->position; } if (XmTextF_selection_move(tf)) { prim_select->ref_count++; XtGetSelectionValue(w, XA_PRIMARY, XmInternAtom(XtDisplay(w), "DELETE", False), df_DoStuff, (XtPointer)prim_select, prim_select->time); } cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *)NULL; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } if (XmTextF_selection_move(tf) && local) { XmTextF_max_length(tf) = max_length; } } XtFree((char *)value); value = NULL; if (--prim_select->ref_count == 0) XtFree((char*)prim_select); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_Stuff( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_Stuff( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { _XmTextActionRec *tmp = (_XmTextActionRec*)XtMalloc(sizeof(_XmTextActionRec)); /* Request targets from the selection owner so you can decide what to * request. The decision process and request for the selection is * taken care of in df_HandleTargets(). */ tmp->event = (XEvent *) XtMalloc(sizeof(XEvent)); memcpy((void *)tmp->event, (void *)event, sizeof(XEvent)); tmp->params = params; tmp->num_params = num_params; XtGetSelectionValue(w, XA_PRIMARY, XmInternAtom(XtDisplay(w), "TARGETS", False), df_HandleTargets, (XtPointer)tmp, event->xbutton.time); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_HandleSelectionReplies( w, closure, event, cont ) Widget w ; XtPointer closure ; XEvent *event ; Boolean *cont ; #else df_HandleSelectionReplies( Widget w, XtPointer closure, XEvent *event, Boolean *cont ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Atom property = (Atom) closure; TextFDestData dest_data; XmTextPosition left, right; int adjustment = 0; XmAnyCallbackStruct cb; if (event->type != SelectionNotify) return; XtRemoveEventHandler(w, (EventMask) NULL, TRUE, df_HandleSelectionReplies, (XtPointer) XmInternAtom(XtDisplay(w), "_XM_TEXT_I_S_PROP", False)); dest_data = df_GetTextFDestData(w); if (event->xselection.property == None) { (void) _XmDataFieldSetSel2(w, 0, 0, False, event->xselection.time); XmTextF_selection_move(tf) = False; } else { if (dest_data->has_destination) { adjustment = (int) (XmTextF_sec_pos_right(tf) - XmTextF_sec_pos_left(tf)); XmDataFieldSetHighlight(w, XmTextF_sec_pos_left(tf), XmTextF_sec_pos_right(tf), XmHIGHLIGHT_NORMAL); if (dest_data->position <= XmTextF_sec_pos_left(tf)) { XmTextF_sec_pos_left(tf) += adjustment - dest_data->replace_length; XmTextF_sec_pos_right(tf) += adjustment - dest_data->replace_length; } else if (dest_data->position > XmTextF_sec_pos_left(tf) && dest_data->position < XmTextF_sec_pos_right(tf)) { XmTextF_sec_pos_left(tf) -= dest_data->replace_length; XmTextF_sec_pos_right(tf) += adjustment - dest_data->replace_length; } } left = XmTextF_sec_pos_left(tf); right = XmTextF_sec_pos_right(tf); (void) _XmDataFieldSetSel2(w, 0, 0, False, event->xselection.time); XmTextF_has_secondary(tf) = False; if (XmTextF_selection_move(tf)) { if (_XmDataFieldReplaceText(tf, event, left, right, NULL, 0, False)) { if (dest_data->has_destination && XmTextF_cursor_position(tf) > right){ XmTextPosition cursorPos; cursorPos = XmTextF_cursor_position(tf) - (right - left); if (!dest_data->quick_key) _XmDataFielddf_SetCursorPosition(tf, event, cursorPos, True, True); (void) df_SetDestination((Widget) tf, cursorPos, False, event->xselection.time); } if (!dest_data->has_destination) { XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); XmDataFieldSetAddMode(w, False); } cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } XmTextF_selection_move(tf) = False; } } XDeleteProperty(XtDisplay(w), event->xselection.requestor, property); } /* * Notify the primary selection that the secondary selection * wants to insert it's selection data into the primary selection. */ /* REQUEST TARGETS FROM SELECTION RECEIVER; THEN CALL HANDLETARGETS * WHICH LOOKS AT THE TARGET LIST AND DETERMINE WHAT TARGET TO PLACE * IN THE PAIR. IT WILL THEN DO ANY NECESSARY CONVERSIONS BEFORE * TELLING THE RECEIVER WHAT TO REQUEST AS THE SELECTION VALUE. * THIS WILL GUARANTEE THE BEST CHANCE AT A SUCCESSFUL EXCHANGE. */ /* ARGSUSED */ static void #ifdef _NO_PROTO df_SecondaryNotify( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_SecondaryNotify( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Atom XM_TEXT_PROP = XmInternAtom(XtDisplay(w), "_XM_TEXT_I_S_PROP", False); Atom CS_OF_LOCALE; /* to be initialized by XmbTextListToTextProperty */ char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ TextFDestData dest_data; XTextProperty tmp_prop; _XmTextInsertPair tmp_pair[1]; _XmTextInsertPair *pair = tmp_pair; XmTextPosition left, right; int status = 0; if (XmTextF_selection_move(tf) == TRUE && XmTextF_has_destination(tf) && XmTextF_cursor_position(tf) >= XmTextF_sec_pos_left(tf) && XmTextF_cursor_position(tf) <= XmTextF_sec_pos_right(tf)) { (void) _XmDataFieldSetSel2(w, 0, 0, False, event->xbutton.time); return; } status = XmbTextListToTextProperty(XtDisplay(w), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (status == Success) CS_OF_LOCALE = tmp_prop.encoding; else CS_OF_LOCALE = 99999; /* XmbTextList... should never fail for XPCS * characters. But just in case someones * Xlib is broken, this prevents a core dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); /* * Determine what the reciever supports so you can tell 'em what to * request. */ /* fill in atom pair */ pair->selection = XA_SECONDARY; pair->target = CS_OF_LOCALE; /* add the insert selection property on the text field widget's window */ XChangeProperty(XtDisplay(w), XtWindow(w), XM_TEXT_PROP, XmInternAtom(XtDisplay(w), "ATOM_PAIR", False), 32, PropModeReplace, (unsigned char *)pair, 2); dest_data = df_GetTextFDestData(w); dest_data->has_destination = XmTextF_has_destination(tf); dest_data->position = XmTextF_cursor_position(tf); dest_data->replace_length = 0; if (*(num_params) == 1) dest_data->quick_key = True; else dest_data->quick_key = False; if (XmDataFieldGetSelectionPosition(w, &left, &right) && left != right) { if (dest_data->position >= left && dest_data->position <= right) dest_data->replace_length = (int) (right - left); } /* add an event handler to handle selection notify events */ XtAddEventHandler(w, (EventMask) NULL, TRUE, df_HandleSelectionReplies, (XtPointer)XM_TEXT_PROP); /* * Make a request for the primary selection to convert to * type INSERT_SELECTION as per ICCCM. */ XConvertSelection(XtDisplay(w), XmInternAtom(XtDisplay(w), "MOTIF_DESTINATION", False), XmInternAtom(XtDisplay(w), "INSERT_SELECTION", False), XM_TEXT_PROP, XtWindow(w), event->xbutton.time); } /* * LOOKS AT THE TARGET LIST AND DETERMINE WHAT TARGET TO PLACE * IN THE PAIR. IT WILL THEN DO ANY NECESSARY CONVERSIONS BEFORE * TELLING THE RECEIVER WHAT TO REQUEST AS THE SELECTION VALUE. * THIS WILL GUARANTEE THE BEST CHANCE AT A SUCCESSFUL EXCHANGE. */ /* ARGSUSED */ static void #ifdef _NO_PROTO df_HandleTargets( w, closure, seltype, type, value, length, format ) Widget w ; XtPointer closure ; Atom *seltype ; Atom *type ; XtPointer value ; unsigned long *length ; int *format ; #else df_HandleTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Atom CS_OF_LOCALE; /* to be initialized by XmbTextListToTextProperty */ Atom COMPOUND_TEXT = XmInternAtom(XtDisplay(w),"COMPOUND_TEXT", False); #ifdef UTF8_SUPPORTED Atom UTF8_STRING = XmInternAtom(XtDisplay(w), XmSUTF8_STRING, False); #endif XmTextPosition left, right; Boolean supports_locale_data = False; Boolean supports_CT = False; Boolean supports_utf8_string = False; Atom *atom_ptr; _XmTextActionRec *tmp_action = (_XmTextActionRec *) closure; _XmTextPrimSelect *prim_select; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ XTextProperty tmp_prop; int status = 0; Atom targets[2]; XmTextPosition select_pos; int i; if (!length) { XtFree((char *)value); value = NULL; XtFree((char *)tmp_action->event); XtFree((char *)tmp_action); return; /* Supports no targets, so don't bother sending anything */ } atom_ptr = (Atom *)value; status = XmbTextListToTextProperty(XtDisplay(w), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (status == Success) CS_OF_LOCALE = tmp_prop.encoding; else CS_OF_LOCALE = 99999; /* XmbTextList... should never fail for XPCS * characters. But just in case someones * Xlib is broken, this prevents a core dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); for (i = 0; i < *length; i++, atom_ptr++) { if (*atom_ptr == CS_OF_LOCALE) { supports_locale_data = True; break; } if (*atom_ptr == COMPOUND_TEXT) supports_CT = True; #ifdef UTF8_SUPPORTED if (*atom_ptr == UTF8_STRING) supports_utf8_string = True; #endif } /* * Set stuff position to the x and y position of * the button pressed event for primary pastes. */ if (tmp_action->event->type == ButtonRelease) { select_pos = df_GetPosFromX(tf, (Position)tmp_action->event->xbutton.x); } else { select_pos = XmTextF_cursor_position(tf); } if (XmDataFieldGetSelectionPosition(w, &left, &right) && left != right && select_pos > left && select_pos < right) { XtFree((char *)value); value = NULL; XtFree((char *)tmp_action->event); XtFree((char *)tmp_action); return; } prim_select = (_XmTextPrimSelect *) XtMalloc((unsigned) sizeof(_XmTextPrimSelect)); prim_select->position = select_pos; if (tmp_action->event->type == ButtonRelease) { prim_select->time = tmp_action->event->xbutton.time; } else { prim_select->time = tmp_action->event->xkey.time; } prim_select->num_chars = 0; if (supports_locale_data) prim_select->target = targets[0] = XmInternAtom(XtDisplay(w), "TEXT", False); #ifdef UTF8_SUPPORTED else if (supports_utf8_string) prim_select->target = targets[0] = UTF8_STRING; #endif else if (supports_CT) prim_select->target = targets[0] = COMPOUND_TEXT; else prim_select->target = targets[0] = XA_STRING; prim_select->ref_count = 1; /* Make request to call df_DoStuff() with the primary selection. */ XtGetSelectionValue(w, XA_PRIMARY, targets[0], df_DoStuff, (XtPointer)prim_select, tmp_action->event->xbutton.time); XtFree((char *)value); value = NULL; XtFree((char *)tmp_action->event); XtFree((char *)tmp_action); } static void #ifdef _NO_PROTO df_ProcessBDragRelease( w, event, params, num_params ) Widget w ; XEvent *event ; String *params ; Cardinal *num_params ; #else df_ProcessBDragRelease( Widget w, XEvent *event, String *params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XButtonEvent *ev = (XButtonEvent *) event; XmTextPosition position; /* Work around for intrinsic bug. Remove once bug is fixed. */ XtUngrabPointer(w, ev->time); _XmDataFieldDrawInsertionPoint(tf, False); if (!XmTextF_cancel(tf)) XtUngrabKeyboard(w, CurrentTime); position = df_GetPosFromX(tf, (Position) event->xbutton.x); if (XmTextF_sel_start(tf)) { if (XmTextF_has_secondary(tf) && XmTextF_sec_pos_left(tf) != XmTextF_sec_pos_right(tf)) { if (ev->x > (int)tf->core.width || ev->x < 0 || ev->y > (int)tf->core.height || ev->y < 0) { _XmDataFieldSetSel2(w, 0, 0, False, event->xkey.time); XmTextF_has_secondary(tf) = False; } else { df_SecondaryNotify(w, event, params, num_params); } } else if (!XmTextF_sec_drag(tf) && !XmTextF_cancel(tf) && XmTextF_sec_pos_left(tf) == position) { XmTextF_stuff_pos(tf) = df_GetPosFromX(tf, (Position) event->xbutton.x); /* * Copy contents of primary selection to the stuff position found above. */ df_Stuff(w, event, params, num_params); } } if (XmTextF_select_id(tf)) { XtRemoveTimeOut(XmTextF_select_id(tf)); XmTextF_select_id(tf) = 0; } XmTextF_sec_extending(tf) = False; XmTextF_sec_drag(tf) = False; XmTextF_sel_start(tf) = False; XmTextF_cancel(tf) = False; _XmDataFieldDrawInsertionPoint(tf, True); } static void #ifdef _NO_PROTO df_ProcessCopy( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ProcessCopy( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_selection_move(tf) = FALSE; df_ProcessBDragRelease(w, event, params, num_params); _XmDataFieldDrawInsertionPoint(tf, True); } static void #ifdef _NO_PROTO df_ProcessMove( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ProcessMove( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_selection_move(tf) = TRUE; df_ProcessBDragRelease(w, event, params, num_params); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeleteSelection( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeleteSelection( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { (void) DataFieldRemove(w, event); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ClearSelection( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ClearSelection( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left = XmTextF_prim_pos_left(tf); XmTextPosition right = XmTextF_prim_pos_right(tf); int num_spaces = 0; XmAnyCallbackStruct cb; Boolean rep_result = False; if (left < right) num_spaces = (int)(right - left); else num_spaces = (int)(left - right); if (num_spaces) { _XmDataFieldDrawInsertionPoint(tf, False); if (XmTextF_max_char_size(tf) == 1){ char spaces_cache[100]; Cardinal spaces_size; char *spaces; int i; spaces_size = num_spaces + 1; spaces = (char *)XmStackAlloc(spaces_size, spaces_cache); for (i = 0; i < num_spaces; i++) spaces[i] = ' '; spaces[num_spaces] = 0; rep_result = _XmDataFieldReplaceText(tf, (XEvent *)event, left, right, spaces, num_spaces, False); if (XmTextF_cursor_position(tf) > left) df_ResetClipOrigin(tf, False); XmStackFree((char *)spaces, spaces_cache); } else { wchar_t *wc_spaces; int i; wc_spaces = (wchar_t *)XtMalloc((unsigned) (num_spaces + 1) * sizeof(wchar_t)); for (i = 0; i < num_spaces; i++){ (void)mbtowc(&wc_spaces[i], " ", 1); } rep_result = _XmDataFieldReplaceText(tf, (XEvent *)event, left, right, (char*)wc_spaces, num_spaces, False); if (XmTextF_cursor_position(tf) > left) df_ResetClipOrigin(tf, False); XtFree((char*)wc_spaces); } if (rep_result) { cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } _XmDataFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_PageRight( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_PageRight( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { Position x, y; int length = 0; XmDataFieldWidget tf = (XmDataFieldWidget) w; Dimension margin_width = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; if (XmTextF_max_char_size(tf) != 1){ length = df_FindPixelLength(tf, (char*)XmTextF_wc_value(tf), XmTextF_string_length(tf)); } else { length = df_FindPixelLength(tf, XmTextF_value(tf), XmTextF_string_length(tf)); } _XmDataFieldDrawInsertionPoint(tf, False); if (*num_params > 0 && !strcmp(*params, "extend")) df_SetAnchorBalancing(tf, XmTextF_cursor_position(tf)); df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &x, &y); if (length - ((int)(tf->core.width - (2 * margin_width)) - XmTextF_h_offset(tf)) > (int)(tf->core.width - (2 * margin_width))) XmTextF_h_offset(tf) -= tf->core.width - (2 * margin_width); else XmTextF_h_offset(tf) = -(length - (tf->core.width - (2 * margin_width))); df_RedisplayText(tf, 0, XmTextF_string_length(tf)); _XmDataFielddf_SetCursorPosition(tf, event, df_GetPosFromX(tf, x), True, True); if (*num_params > 0 && !strcmp(*params, "extend")) df_KeySelection(w, event, params, num_params); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_PageLeft( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_PageLeft( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { Position x, y; XmDataFieldWidget tf = (XmDataFieldWidget) w; int margin_width = (int)XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; _XmDataFieldDrawInsertionPoint(tf, False); if (*num_params > 0 && !strcmp(*params, "extend")) df_SetAnchorBalancing(tf, XmTextF_cursor_position(tf)); df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &x, &y); if (margin_width <= XmTextF_h_offset(tf) + ((int)tf->core.width - (2 * margin_width))) XmTextF_h_offset(tf) = margin_width; else XmTextF_h_offset(tf) += tf->core.width - (2 * margin_width); df_RedisplayText(tf, 0, XmTextF_string_length(tf)); _XmDataFielddf_SetCursorPosition(tf, event, df_GetPosFromX(tf, x), True, True); if (*num_params > 0 && !strcmp(*params, "extend")) df_KeySelection(w, event, params, num_params); _XmDataFieldDrawInsertionPoint(tf, True); } static void #ifdef _NO_PROTO df_CopyPrimary( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_CopyPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_selection_move(tf) = False; /* perform the primary paste action */ df_Stuff(w, event, params, num_params); _XmDataFieldDrawInsertionPoint(tf, True); } static void #ifdef _NO_PROTO df_CutPrimary( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_CutPrimary( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_selection_move(tf) = True; df_Stuff(w, event, params, num_params); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_SetAnchor( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_SetAnchor( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left, right; XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); (void) df_SetDestination(w, XmTextF_prim_anchor(tf), False, event->xkey.time); if (XmDataFieldGetSelectionPosition(w, &left, &right)) { _XmDataFieldStartSelection(tf, XmTextF_prim_anchor(tf), XmTextF_prim_anchor(tf), event->xkey.time); XmDataFieldSetAddMode(w, False); } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ToggleOverstrike( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ToggleOverstrike( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_overstrike(tf) = !XmTextF_overstrike(tf); XmTextF_refresh_ibeam_off(tf) = True; if (XmTextF_overstrike(tf)) XmTextF_cursor_width(tf) = XmTextF_cursor_height(tf) >> 1; else { XmTextF_cursor_width(tf) = 5; if (XmTextF_cursor_height(tf) > 19) XmTextF_cursor_width(tf)++; df_ResetClipOrigin(tf, False); } _XmDataFToggleCursorGC(w); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_ToggleAddMode( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_ToggleAddMode( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left, right; _XmDataFieldDrawInsertionPoint(tf, False); XmDataFieldSetAddMode(w, !XmTextF_add_mode(tf)); if (XmTextF_add_mode(tf) && (!(XmDataFieldGetSelectionPosition(w, &left, &right)) || left == right)) XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_SelectAll( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_SelectAll( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); if (XmTextF_has_primary(tf)) df_SetSelection(tf, 0, XmTextF_string_length(tf), True); else _XmDataFieldStartSelection(tf, 0, XmTextF_string_length(tf), event->xbutton.time); /* Call _XmDataFielddf_SetCursorPosition to force image gc to be updated * in case the i-beam is contained within the selection */ XmTextF_pending_off(tf) = False; _XmDataFielddf_SetCursorPosition(tf, NULL, XmTextF_cursor_position(tf), False, False); XmTextF_prim_anchor(tf) = 0; (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, event->xkey.time); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DeselectAll( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_DeselectAll( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); df_SetSelection(tf, XmTextF_cursor_position(tf), XmTextF_cursor_position(tf), True); XmTextF_pending_off(tf) = True; _XmDataFielddf_SetCursorPosition(tf, event, XmTextF_cursor_position(tf), True, True); XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, event->xkey.time); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_VoidAction( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_VoidAction( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { /* Do Nothing */ } /* ARGSUSED */ static void #ifdef _NO_PROTO df_CutClipboard( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_CutClipboard( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { _XmDataFieldDrawInsertionPoint((XmDataFieldWidget)w, False); (void) XmDataFieldCut(w, event->xkey.time); _XmDataFieldDrawInsertionPoint((XmDataFieldWidget)w, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_CopyClipboard( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_CopyClipboard( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmDataFieldDrawInsertionPoint(tf, False); (void) XmDataFieldCopy(w, event->xkey.time); (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, event->xkey.time); _XmDataFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_PasteClipboard( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_PasteClipboard( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { _XmDataFieldDrawInsertionPoint((XmDataFieldWidget)w, False); (void) XmDataFieldPaste(w); _XmDataFieldDrawInsertionPoint((XmDataFieldWidget)w, True); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TraverseDown( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_TraverseDown( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; if (tf->primitive.navigation_type == XmNONE && df_VerifyLeave(tf, event)) { XmTextF_traversed(tf) = True; if (!_XmMgrTraversal(w, XmTRAVERSE_DOWN)) XmTextF_traversed(tf) = False; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TraverseUp( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_TraverseUp( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; if (tf->primitive.navigation_type == XmNONE && df_VerifyLeave(tf, event)) { XmTextF_traversed(tf) = True; if (!_XmMgrTraversal(w, XmTRAVERSE_UP)) XmTextF_traversed(tf) = False; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TraverseHome( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_TraverseHome( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; /* Allow the verification routine to control the traversal */ if (tf->primitive.navigation_type == XmNONE && df_VerifyLeave(tf, event)) { XmTextF_traversed(tf) = True; if (!_XmMgrTraversal(w, XmTRAVERSE_HOME)) XmTextF_traversed(tf) = False; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TraverseNextTabGroup( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_TraverseNextTabGroup( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; /* Allow the verification routine to control the traversal */ if (df_VerifyLeave(tf, event)) { XmTextF_traversed(tf) = True; if (!_XmMgrTraversal(w, XmTRAVERSE_NEXT_TAB_GROUP)) XmTextF_traversed(tf) = False; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TraversePrevTabGroup( w, event, params, num_params ) Widget w ; XEvent *event ; char **params ; Cardinal *num_params ; #else df_TraversePrevTabGroup( Widget w, XEvent *event, char **params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; /* Allow the verification routine to control the traversal */ if (df_VerifyLeave(tf, event)) { XmTextF_traversed(tf) = True; if (!_XmMgrTraversal(w, XmTRAVERSE_PREV_TAB_GROUP)) XmTextF_traversed(tf) = False; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TextEnter( w, event, params, num_params ) Widget w ; XEvent *event ; String *params ; Cardinal *num_params ; #else df_TextEnter( Widget w, XEvent *event, String *params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmAnyCallbackStruct cb; XPoint xmim_point; /* Use != NotifyInferior along with event->xcrossing.focus to avoid * sending input method info if reason for the event is pointer moving * from TextF widget to over-the-spot window (case when over-the-spot * is child of TextF widget). */ if (_XmGetFocusPolicy(w) != XmEXPLICIT && !(XmTextF_has_focus(tf)) && event->xcrossing.focus && (event->xcrossing.detail != NotifyInferior)) { if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_blink_on(tf) = False; XmTextF_has_focus(tf) = True; _XmDataFToggleCursorGC(w); if (XtIsSensitive(w)) df_ChangeBlinkBehavior(tf, True); _XmDataFieldDrawInsertionPoint(tf, True); df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, &xmim_point.y); XmImVaSetFocusValues(w, XmNspotLocation, &xmim_point, NULL); cb.reason = XmCR_FOCUS; cb.event = event; XtCallCallbackList (w, XmTextF_focus_callback(tf), (XtPointer) &cb); } _XmPrimitiveEnter(w, event, params, num_params); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_TextLeave( w, event, params, num_params ) Widget w ; XEvent *event ; String *params ; Cardinal *num_params ; #else df_TextLeave( Widget w, XEvent *event, String *params, Cardinal *num_params ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; /* use detail!= NotifyInferior to handle focus change due to pointer * wandering into over-the-spot input window - we don't want to change * IM's focus state in this case. */ if (_XmGetFocusPolicy(w) != XmEXPLICIT && XmTextF_has_focus(tf) && event->xcrossing.focus && (event->xcrossing.detail != NotifyInferior)) { if (tf->core.sensitive) df_ChangeBlinkBehavior(tf, False); _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_has_focus(tf) = False; _XmDataFToggleCursorGC(w); XmTextF_blink_on(tf) = True; _XmDataFieldDrawInsertionPoint(tf, True); (void) df_VerifyLeave(tf, event); XmImUnsetFocus(w); } _XmPrimitiveLeave(w, event, params, num_params); } /**************************************************************** * * Private definitions. * ****************************************************************/ /* * df_ClassPartInitialize sets up the fast subclassing for the widget.i * It also merges translation tables. */ static void #ifdef _NO_PROTO df_ClassPartInitialize( w_class ) WidgetClass w_class ; #else df_ClassPartInitialize( WidgetClass w_class ) #endif /* _NO_PROTO */ { char *event_bindings; _XmFastSubclassInit (w_class, XmDATAFIELD_BIT); /* Install traits */ XmeTraitSet((XtPointer) w_class, XmQTaccessTextual, (XtPointer) &dataFieldCS); event_bindings = (char *)XtMalloc((unsigned) (strlen(EventBindings1) + strlen(EventBindings2) + strlen(EventBindings3) + strlen("\n") + strlen(EventBindings4) + 1)); strcpy(event_bindings, EventBindings4); strcat(event_bindings, "\n"); strcat(event_bindings, EventBindings1); strcat(event_bindings, EventBindings2); strcat(event_bindings, EventBindings3); _XmProcessLock(); w_class->core_class.tm_table = (String) XtParseTranslationTable(event_bindings); _XmProcessUnlock(); XtFree(event_bindings); } /**************************************************************** * * Private functions used in df_Initialize. * ****************************************************************/ /* * Verify that the resource settings are valid. Print a warning * message and reset the s if the are invalid. */ static void #ifdef _NO_PROTO df_Validates( tf ) XmDataFieldWidget tf ; #else df_Validates( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { XtPointer temp_ptr; if (XmTextF_cursor_position(tf) < 0) { XmeWarning ((Widget)tf, MSG1); XmTextF_cursor_position(tf) = 0; } if (XmTextF_columns(tf) <= 0) { XmeWarning ((Widget)tf, MSG2); XmTextF_columns(tf) = 20; } if (XmTextF_selection_array(tf) == NULL) XmTextF_selection_array(tf) = (XmTextScanType *) df_sarray; if (XmTextF_selection_array_count(tf) <= 0) XmTextF_selection_array_count(tf) = XtNumber(df_sarray); /* * Fix for HaL DTS 9841 - copy the selectionArray into dedicated memory. */ temp_ptr = (XtPointer)XmTextF_selection_array(tf); XmTextF_selection_array(tf) = NULL; XmTextF_selection_array(tf) = (XmTextScanType *)XtMalloc ( XmTextF_selection_array_count(tf) * sizeof(XmTextScanType)); memcpy((void *)XmTextF_selection_array(tf), (void *)temp_ptr, (XmTextF_selection_array_count(tf) * sizeof(XmTextScanType))); /* * End fix for HaL DTS 9841 */ } static Boolean #ifdef _NO_PROTO df_LoadFontMetrics( tf ) XmDataFieldWidget tf ; #else df_LoadFontMetrics( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { XmFontContext context; XmFontListEntry next_entry; XmFontType type_return = XmFONT_IS_FONT; XtPointer tmp_font; Boolean have_font_struct = False; Boolean have_font_set = False; #ifdef USE_XFT Boolean have_xft_font = False; #endif XFontSetExtents *fs_extents; XFontStruct *font; unsigned long charwidth = 0; char* font_tag = NULL; Boolean return_val = 1; /* non-zero == success */ if (!XmFontListInitFontContext(&context, XmTextF_font_list(tf))) XmeWarning ((Widget)tf, MSG3); do { next_entry = XmFontListNextEntry(context); if (next_entry) { tmp_font = XmFontListEntryGetFont(next_entry, &type_return); if (type_return == XmFONT_IS_FONTSET) { font_tag = XmFontListEntryGetTag(next_entry); if (!have_font_set){ /* this saves the first fontset found, just in * case we don't find a default tag set. */ XmTextF_have_fontset(tf) = True; #ifdef USE_XFT XmTextF_use_xft(tf) = False; #endif tf->text.font = (XFontStruct *)tmp_font; have_font_struct = True; /* we have a font set, so no need to * consider future font structs */ have_font_set = True; /* we have a font set. */ if (!strcmp(XmFONTLIST_DEFAULT_TAG, font_tag)) break; /* Break out! We've found the one we want. */ } else if (!strcmp(XmFONTLIST_DEFAULT_TAG, font_tag)){ tf->text.font = (XFontStruct *)tmp_font; have_font_set = True; /* we have a font set. */ break; /* Break out! We've found the one we want. */ } } else if (type_return == XmFONT_IS_FONT && !have_font_struct) { /* return_type must be XmFONT_IS_FONT */ XmTextF_have_fontset(tf) = False; #ifdef USE_XFT XmTextF_use_xft(tf) = False; #endif tf->text.font=(XFontStruct*)tmp_font; /* save the first font * struct in case no font * set is found */ have_font_struct = True; #ifdef USE_XFT } else if (type_return == XmFONT_IS_XFT && !have_xft_font) { XmTextF_have_fontset(tf) = False; XmTextF_use_xft(tf) = True; have_xft_font = True; tf->text.font = tmp_font; #endif } } } while(next_entry != NULL); #if USE_XFT if (!have_font_struct && !have_font_set && !have_xft_font) { #else if (!have_font_struct && !have_font_set) { #endif XmeWarning ((Widget)tf, MSG4); } if (XmTextF_max_char_size(tf) > 1 && !have_font_set){ /*XmeWarning((Widget)tf, MSGnnn); */ /* printf ("You've got the wrong font baby, Uh-Huh!\n"); */ /* Must have a font set, as text will be rendered only with new R5 calls * If df_LoadFontMetrics is called from df_SetValues and set * values will retain use of old fontlist (which is presumed correct * for the current locale). */ return_val = 0; /* tell caller that this font won't work for MB_CUR_MAX*/ } XmFontListFreeFontContext(context); if(XmTextF_have_fontset(tf)){ fs_extents = XExtentsOfFontSet((XFontSet)XmTextF_font(tf)); charwidth = (unsigned long)fs_extents->max_ink_extent.width; /* max_ink_extent.y is number of pixels from origin to top of * rectangle (i.e. y is negative) */ XmTextF_font_ascent(tf) = -fs_extents->max_ink_extent.y; XmTextF_font_descent(tf) = fs_extents->max_ink_extent.height + fs_extents->max_ink_extent.y; #ifdef USE_XFT } else if (XmTextF_use_xft(tf)) { #ifdef FIX_1415 _XmXftFontAverageWidth((Widget) tf, TextF_XftFont(tf), (int *)&charwidth); #else charwidth = XmTextF_xft_font(tf)->max_advance_width; #endif #ifdef FIX_1531 XmTextF_font_ascent(tf) = TextF_XftFont(tf)->ascent; XmTextF_font_descent(tf) = TextF_XftFont(tf)->descent; #endif /* FIX_1531 */ #endif } else { font = XmTextF_font(tf); if ((!XGetFontProperty(font, XA_QUAD_WIDTH, &charwidth)) || charwidth == 0) { if (font->per_char && font->min_char_or_byte2 <= '0' && font->max_char_or_byte2 >= '0') charwidth = font->per_char['0' - font->min_char_or_byte2].width; else charwidth = font->max_bounds.width; } XmTextF_font_ascent(tf) = font->max_bounds.ascent; XmTextF_font_descent(tf) = font->max_bounds.descent; } XmTextF_average_char_width(tf) = (Dimension) charwidth; return (return_val); } /* df_ValidateString makes the following assumption: if MB_CUR_MAX == 1, value * is a char*, otherwise value is a wchar_t*. The Boolean "is_wchar" indicates * if value points to char* or wchar_t* data. * * It is df_ValidateString's task to verify that "value" contains only printing * characters; all others are discarded. df_ValidateString then mallocs data * to store the value and assignes it to XmTextF_value(tf) (if MB_CUR_MAX == 1) * or to XmTextF_wc_value(tf) (if MB_CUR_MAX != 1), setting the opposite * pointer to NULL. It is the callers responsibility to free data before * calling df_ValidateString. */ static void #ifdef _NO_PROTO df_ValidateString( tf, value, is_wchar ) XmDataFieldWidget tf ; char *value ; Boolean is_wchar; #else df_ValidateString( XmDataFieldWidget tf, char *value, #if NeedWidePrototypes int is_wchar) #else Boolean is_wchar) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { /* if value is wchar_t *, must count the characters; else use strlen */ int str_len = 0; int i, j; char stack_cache[400]; if (!is_wchar) { char *temp_str, *curr_str, *start_temp; str_len = strlen(value); temp_str = (char*)XmStackAlloc((Cardinal)str_len + 1, stack_cache); start_temp = temp_str; curr_str = value; for (i = 0; i < str_len;) { if (XmTextF_max_char_size(tf) == 1){ if (df_FindPixelLength(tf, curr_str, 1)) { *temp_str = *curr_str; temp_str++; } else { char warn_str[52]; sprintf(warn_str, MSG5, *curr_str); XmeWarning ((Widget)tf, warn_str); } curr_str++; i++; } else { wchar_t tmp[XmTextF_max_char_size(tf)+1]; int num_conv; num_conv = mbtowc(tmp, curr_str, XmTextF_max_char_size(tf)); if (num_conv >= 0 && df_FindPixelLength(tf, (char*) &tmp, 1)) { for (j = 0; j < num_conv; j++) { *temp_str = *curr_str; temp_str++; curr_str++; i++; } } else { char warn_str[52]; sprintf(warn_str, MSG5, *curr_str); XmeWarning ((Widget)tf, warn_str); curr_str++; i++; } } } *temp_str = '\0'; /* value contains validated string; now stuff it into the proper * instance pointer. */ if (XmTextF_max_char_size(tf) == 1) { XmTextF_string_length(tf) = strlen(start_temp); /* malloc the space for the text value */ XmTextF_value(tf) = (char *) memcpy( XtMalloc((unsigned)(XmTextF_string_length(tf) + 30)), (void *)start_temp, XmTextF_string_length(tf) + 1); XmTextF_size_allocd(tf) = XmTextF_string_length(tf) + 30; XmTextF_wc_value(tf) = NULL; } else { /* Need wchar_t* data to set as the widget's value */ /* count number of wchar's */ str_len = strlen(start_temp); XmTextF_string_length(tf) = str_len; XmTextF_size_allocd(tf) = (XmTextF_string_length(tf) + 30)*sizeof(wchar_t); XmTextF_wc_value(tf) = (wchar_t*)XtMalloc((unsigned)XmTextF_size_allocd(tf)); XmTextF_string_length(tf) = mbstowcs(XmTextF_wc_value(tf), start_temp, XmTextF_string_length(tf) + 30); XmTextF_value(tf) = NULL; } XmStackFree((char *)start_temp, stack_cache); } else { /* pointer passed points to wchar_t* data */ wchar_t *wc_value, *wcs_temp_str, *wcs_start_temp, *wcs_curr_str; char scratch[8]; int new_len = 0; int csize = 1; wc_value = (wchar_t *) value; for (str_len = 0, i = 0; *wc_value != (wchar_t)0L; str_len++) wc_value++; /* count number of wchars */ wcs_temp_str=(wchar_t *)XmStackAlloc((Cardinal) ((str_len+1) * sizeof(wchar_t)), stack_cache); wcs_start_temp = wcs_temp_str; wcs_curr_str = (wchar_t *) value; for (i = 0; i < str_len; i++, wcs_curr_str++) { if (XmTextF_max_char_size(tf) == 1){ csize = wctomb(scratch, *wcs_curr_str); if (csize >= 0 && df_FindPixelLength(tf, scratch, csize)) { *wcs_temp_str = *wcs_curr_str; wcs_temp_str++; new_len++; } else { char warn_str[52]; scratch[csize]= '\0'; sprintf(warn_str, WC_MSG1, scratch); XmeWarning ((Widget)tf, warn_str); } } else { if (df_FindPixelLength(tf, (char*)wcs_curr_str, 1)) { *wcs_temp_str = *wcs_curr_str; wcs_temp_str++; new_len++; } else { char warn_str[52]; csize = wctomb(scratch, *wcs_curr_str); if (csize >= 0) scratch[csize]= '\0'; else scratch[0] = '\0'; sprintf(warn_str, WC_MSG1, scratch); XmeWarning ((Widget)tf, warn_str); } } } str_len = new_len; *wcs_temp_str = (wchar_t)0L; /* terminate with a wchar_t NULL */ XmTextF_string_length(tf) = str_len; /* This is *wrong* if MB_CUR_MAX > 2 * with no font set... but what can * ya do? Spec says let it dump core. */ XmTextF_size_allocd(tf) = (str_len + 30) * sizeof(wchar_t); if (XmTextF_max_char_size(tf) == 1) { /* Need to store data as char* */ XmTextF_value(tf) = XtMalloc((unsigned)XmTextF_size_allocd(tf)); (void)wcstombs(XmTextF_value(tf), wcs_start_temp, XmTextF_size_allocd(tf)); XmTextF_wc_value(tf) = NULL; } else { /* Need to store data as wchar_t* */ XmTextF_wc_value(tf) = (wchar_t*)memcpy(XtMalloc((unsigned) XmTextF_size_allocd(tf)), (void*)wcs_start_temp, (1 + str_len) * sizeof(wchar_t)); XmTextF_value(tf) = NULL; } XmStackFree((char *)wcs_start_temp, stack_cache); } } /* The following is a hack to overcome the buggy Motif from SGI on IM */ #if defined(__sgi) static void /* CR03685 */ #ifdef _NO_PROTO SGI_hack_XmImRegister(w) Widget w; #else SGI_hack_XmImRegister( Widget w ) #endif /* _NO_PROTO */ { _XmProcessLock(); w->core.widget_class = xmTextFieldWidgetClass; _XmProcessUnlock(); XmImRegister(w, NULL); _XmProcessLock(); w->core.widget_class = xmDataFieldWidgetClass; _XmProcessUnlock(); } #endif /* * df_Initialize the s in the text fields instance record. */ static void #ifdef _NO_PROTO df_InitializeTextStruct( tf ) XmDataFieldWidget tf ; #else df_InitializeTextStruct( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { /* Flag used in losing focus verification to indicate that a traversal * key was pressed. Must be initialized to False. */ Arg args[6]; /* To set initial values to input method */ Cardinal n = 0; XPoint xmim_point; XmTextF_traversed(tf) = False; XmTextF_add_mode(tf) = False; XmTextF_has_focus(tf) = False; XmTextF_blink_on(tf) = True; XmTextF_cursor_on(tf) = 0; XmTextF_has_rect(tf) = False; XmTextF_has_primary(tf) = False; XmTextF_has_secondary(tf) = False; XmTextF_has_destination(tf) = False; XmTextF_overstrike(tf) = False; XmTextF_selection_move(tf) = False; XmTextF_sel_start(tf) = False; XmTextF_pending_off(tf) = True; XmTextF_fontlist_created(tf) = False; XmTextF_cancel(tf) = False; XmTextF_extending(tf) = False; XmTextF_prim_time(tf) = 0; XmTextF_dest_time(tf) = 0; XmTextF_select_id(tf) = 0; XmTextF_select_pos_x(tf) = 0; XmTextF_sec_extending(tf) = False; XmTextF_sec_drag(tf) = False; XmTextF_changed_visible(tf) = False; XmTextF_refresh_ibeam_off(tf) = True; XmTextF_in_setvalues(tf) = False; XmTextF_do_resize(tf) = True; XmTextF_have_inverted_image_gc(tf) = False; XmTextF_margin_top(tf) = XmTextF_margin_height(tf); XmTextF_margin_bottom(tf) = XmTextF_margin_height(tf); /* copy over the font list */ if (XmTextF_font_list(tf) == NULL) { XmTextF_font_list(tf) = XmeGetDefaultRenderTable((Widget)tf, (unsigned char) XmTEXT_FONTLIST); XmTextF_fontlist_created(tf) = True; } XmTextF_font_list(tf) = (XmFontList)XmFontListCopy(XmTextF_font_list(tf)); XmTextF_max_char_size(tf) = MB_CUR_MAX; (void)df_LoadFontMetrics(tf); XmTextF_gc(tf) = NULL; XmTextF_image_gc(tf) = NULL; XmTextF_save_gc(tf) = NULL; if (XmDataField_alignment(tf) == XmALIGNMENT_END) XmTextF_new_h_offset(tf) = XmTextF_h_offset(tf) = 0; else XmTextF_new_h_offset(tf) = XmTextF_h_offset(tf) = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; /* df_ValidateString will verify value contents, convert to appropriate * storage form (i.e. char* or wchar_t*), place in the appropriate * location (text.value or text.wc_value), and null out opposite * pointer. */ if (XmTextF_wc_value(tf) != NULL) { /* XmNvalueWcs was set - it rules */ XmTextF_value(tf) = NULL; df_ValidateString(tf, (char*)XmTextF_wc_value(tf), True); } else if (XmTextF_value(tf) != NULL) df_ValidateString(tf, XmTextF_value(tf), False); else /* XmTextF_value(tf) is null pointer */ df_ValidateString(tf, "", False); if (XmTextF_cursor_position(tf) > XmTextF_string_length(tf)) XmTextF_cursor_position(tf) = XmTextF_string_length(tf); XmTextF_orig_left(tf) = XmTextF_orig_right(tf) = XmTextF_prim_pos_left(tf) = XmTextF_prim_pos_right(tf) = XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); XmTextF_sec_pos_left(tf) = XmTextF_sec_pos_right(tf) = XmTextF_sec_anchor(tf) = XmTextF_cursor_position(tf); XmTextF_stuff_pos(tf) = XmTextF_cursor_position(tf); XmTextF_cursor_height(tf) = XmTextF_cursor_width(tf) = 0; XmTextF_stipple_tile(tf) = None; XmTextF_add_mode_cursor(tf) = XmUNSPECIFIED_PIXMAP; XmTextF_cursor(tf) = XmUNSPECIFIED_PIXMAP; XmTextF_ibeam_off(tf) = XmUNSPECIFIED_PIXMAP; XmTextF_image_clip(tf) = XmUNSPECIFIED_PIXMAP; XmTextF_last_time(tf) = 0; XmTextF_sarray_index(tf) = 0; /* df_Initialize highlight elements */ XmTextF_highlight(tf).number = XmTextF_highlight(tf).maximum = 1; XmTextF_highlight(tf).list = (_XmHighlightRec *)XtMalloc((unsigned) sizeof(_XmHighlightRec)); XmTextF_highlight(tf).list[0].position = 0; XmTextF_highlight(tf).list[0].mode = XmHIGHLIGHT_NORMAL; XmTextF_timer_id(tf) = (XtIntervalId)0; if(XmDataField_picture_source(tf)) { XmDataField_picture_source(tf) = XtNewString(XmDataField_picture_source(tf)); XmDataField_picture(tf) = XmParsePicture(XmDataField_picture_source(tf)); XtAddCallback((Widget)tf, XmNmodifyVerifyCallback, PictureVerifyCallback, NULL); } else { /* No picture specified */ XmDataField_picture(tf) = NULL; } XmDataFieldSetEditable((Widget)tf, XmTextF_editable(tf)); if (XmTextF_editable(tf)){ #if defined(__sgi) /* CR03685 */ SGI_hack_XmImRegister((Widget)tf); #else XmImRegister((Widget)tf, (unsigned int) NULL); #endif df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, &xmim_point.y); n = 0; XtSetArg(args[n], XmNfontList, XmTextF_font_list(tf)); n++; XtSetArg(args[n], XmNbackground, tf->core.background_pixel); n++; XtSetArg(args[n], XmNforeground, tf->primitive.foreground); n++; XtSetArg(args[n], XmNbackgroundPixmap,tf->core.background_pixmap);n++; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNlineSpace, XmTextF_font_ascent(tf)+ XmTextF_font_descent(tf)); n++; XmImSetValues((Widget)tf, args, n); } } static Pixmap #ifdef _NO_PROTO df_GetClipMask( tf, pixmap_name) XmDataFieldWidget tf ; char *pixmap_name ; #else df_GetClipMask( XmDataFieldWidget tf, char *pixmap_name) #endif /* _NO_PROTO */ { Display *dpy = XtDisplay(tf); Screen *screen = XtScreen(tf); XGCValues values; GC fillGC; Pixmap clip_mask; clip_mask = XCreatePixmap(dpy, RootWindowOfScreen(screen), XmTextF_cursor_width(tf), XmTextF_cursor_height(tf), 1); values.foreground = 1; values.background = 0; fillGC = XCreateGC(dpy, clip_mask, GCForeground | GCBackground, &values); XFillRectangle(dpy, clip_mask, fillGC, 0, 0, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf)); /* Install the clipmask for pixmap caching */ (void) _XmCachePixmap(clip_mask, screen, pixmap_name, 1, 0, 0, 0, 0); XFreeGC(XtDisplay(tf), fillGC); return(clip_mask); } /* * Get the graphics context for filling the background, and for drawing * and inverting text. Used a unique pixmap so all text field widgets * share common GCs. */ static void #ifdef _NO_PROTO df_LoadGCs( tf, background, foreground ) XmDataFieldWidget tf ; Pixel background ; Pixel foreground ; #else df_LoadGCs( XmDataFieldWidget tf, Pixel background, Pixel foreground ) #endif /* _NO_PROTO */ { Display *display = XtDisplay((Widget)tf); Screen *screen = XtScreen((Widget)tf); XGCValues values; static XContext context = 0; static Pixmap tf_cache_pixmap; unsigned long value_mask = (GCFunction | GCForeground | GCBackground | GCClipMask | GCArcMode); unsigned long dynamic_mask; if (XmTextF_stipple_tile(tf) != None) XmDestroyPixmap(XtScreen(tf), XmTextF_stipple_tile(tf)); XmTextF_stipple_tile(tf) = (Pixmap) XmGetPixmapByDepth(XtScreen(tf),"50_foreground", tf->primitive.foreground, tf->core.background_pixel, tf->core.depth); if (context == 0) context = XUniqueContext(); if (XFindContext(display, (Window)screen, context, (char **) &tf_cache_pixmap)){ XmTextContextData ctx_data; Widget xm_display = (Widget) XmGetXmDisplay(display); ctx_data = (XmTextContextData) XtMalloc(sizeof(XmTextContextDataRec)); ctx_data->screen = screen; ctx_data->context = context; ctx_data->type = _XM_IS_PIXMAP_CTX; /* Get the Pixmap identifier that the X Toolkit uses to cache our */ /* GC's. We never actually use this Pixmap; just so long as it's */ /* a unique identifier. */ tf_cache_pixmap = XCreatePixmap(display, (Drawable) RootWindowOfScreen(screen), (unsigned int) 1, (unsigned int) 1, (unsigned int) 1); XtAddCallback(xm_display, XmNdestroyCallback, (XtCallbackProc) df_FreeContextData, (XtPointer) ctx_data); XSaveContext(display, (Window)screen, context, (XPointer) tf_cache_pixmap); } /* Used to be: values.clip_mask = tf_cache_pixmap; */ values.clip_mask = 0; /* use in caching Text Field gc's */ values.arc_mode = ArcPieSlice; /* Used in differentiating from Text widget GC caching */ if (XmTextF_has_rect(tf)) { TextFGCData gc_data = df_GetTextFGCData((Widget)tf); XmTextF_has_rect(gc_data->tf) = False; gc_data->tf = NULL; } /* * Get GC for saving area under the cursor. */ values.function = GXcopy; values.foreground = tf->primitive.foreground ; values.background = tf->core.background_pixel; if (XmTextF_save_gc(tf) != NULL) XtReleaseGC((Widget)tf, XmTextF_save_gc(tf)); dynamic_mask = (GCClipMask); XmTextF_save_gc(tf) = XtAllocateGC((Widget) tf, tf->core.depth, value_mask, &values, dynamic_mask, 0); df_XmResetSaveGC(tf, XmTextF_save_gc(tf)); /* * Get GC for drawing text. */ #if USE_XFT if (!XmTextF_have_fontset(tf) && !XmTextF_use_xft(tf)) { #else if (!XmTextF_have_fontset(tf)) { #endif value_mask |= GCFont | GCGraphicsExposures; values.font = XmTextF_font(tf)->fid; } else { value_mask |= GCGraphicsExposures; } values.graphics_exposures = (Bool) TRUE; values.foreground = foreground ^ background; values.background = 0; if (XmTextF_gc(tf) != NULL) XtReleaseGC((Widget)tf, XmTextF_gc(tf)); dynamic_mask |= GCForeground | GCBackground | GCFillStyle | GCTile; XmTextF_gc(tf) = XtAllocateGC((Widget) tf, tf->core.depth, value_mask, &values, dynamic_mask, 0); /* Create a temporary GC - change it later in make IBEAM */ value_mask |= GCTile; values.tile = XmTextF_stipple_tile(tf); if (XmTextF_image_gc(tf) != NULL) XtReleaseGC((Widget)tf, XmTextF_image_gc(tf)); dynamic_mask = (GCForeground | GCBackground | GCStipple | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin | GCFunction | GCClipMask | GCClipXOrigin | GCClipYOrigin); XmTextF_image_gc(tf) = XtAllocateGC((Widget) tf, tf->core.depth, value_mask, &values, dynamic_mask, 0); } static void #ifdef _NO_PROTO df_MakeIBeamOffArea( tf, width, height ) XmDataFieldWidget tf ; Dimension width ; Dimension height ; #else df_MakeIBeamOffArea( XmDataFieldWidget tf, #if NeedWidePrototypes int width, int height) #else Dimension width, Dimension height) #endif /* NeedWidePrototypes */ #endif /* _NO_PROTO */ { Display *dpy = XtDisplay(tf); Screen *screen = XtScreen(tf); GC fillGC; /* Create a pixmap for storing the screen data where the I-Beam will * be painted */ XmTextF_ibeam_off(tf) = XCreatePixmap(dpy, RootWindowOfScreen(screen), width, height, tf->core.depth); /* Create a GC for drawing 0's into the pixmap */ fillGC = XCreateGC(dpy, XmTextF_ibeam_off(tf), 0, (XGCValues *) NULL); /* df_Initialize the pixmap to 0's */ XFillRectangle(dpy, XmTextF_ibeam_off(tf), fillGC, 0, 0, width, height); /* Free the GC */ XFreeGC(XtDisplay(tf), fillGC); } static void #ifdef _NO_PROTO df_MakeIBeamStencil( tf, line_width ) XmDataFieldWidget tf ; int line_width ; #else df_MakeIBeamStencil( XmDataFieldWidget tf, int line_width ) #endif /* _NO_PROTO */ { Screen *screen = XtScreen(tf); char pixmap_name[17]; XGCValues values; unsigned long valuemask; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); sprintf(pixmap_name, "_XmDataF_%d_%d", XmTextF_cursor_height(tf), line_width); XmTextF_cursor(tf) = (Pixmap) XmGetPixmapByDepth(screen, pixmap_name, 1, 0, 1); if (XmTextF_cursor(tf) == XmUNSPECIFIED_PIXMAP) { Display *dpy = XtDisplay(tf); GC fillGC; XSegment segments[3]; XRectangle ClipRect; /* Create a pixmap for the I-Beam stencil */ XmTextF_cursor(tf) = XCreatePixmap(dpy, XtWindow(tf), XmTextF_cursor_width(tf), XmTextF_cursor_height(tf), 1); /* Create a GC for "cutting out" the I-Beam shape from the pixmap in * order to create the stencil. */ fillGC = XCreateGC(dpy, XmTextF_cursor(tf), 0, (XGCValues *)NULL); /* Fill in the stencil with a solid in preparation * to "cut out" the I-Beam */ XFillRectangle(dpy, XmTextF_cursor(tf), fillGC, 0, 0, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf)); /* Change the GC for use in "cutting out" the I-Beam shape */ values.foreground = 1; values.line_width = line_width; XChangeGC(dpy, fillGC, GCForeground | GCLineWidth, &values); /* Draw the segments of the I-Beam */ /* 1st segment is the top horizontal line of the 'I' */ segments[0].x1 = 0; segments[0].y1 = line_width - 1; segments[0].x2 = XmTextF_cursor_width(tf); segments[0].y2 = line_width - 1; /* 2nd segment is the bottom horizontal line of the 'I' */ segments[1].x1 = 0; segments[1].y1 = XmTextF_cursor_height(tf) - 1; segments[1].x2 = XmTextF_cursor_width(tf); segments[1].y2 = XmTextF_cursor_height(tf) - 1; /* 3rd segment is the vertical line of the 'I' */ segments[2].x1 = XmTextF_cursor_width(tf) >> 1; segments[2].y1 = line_width; segments[2].x2 = XmTextF_cursor_width(tf) >> 1; segments[2].y2 = XmTextF_cursor_height(tf) - 1; /* Set the clipping rectangle of the image GC from drawing */ ClipRect.width = XmTextF_cursor_width(tf); ClipRect.height = XmTextF_cursor_height(tf); ClipRect.x = 0; ClipRect.y = 0; XSetClipRectangles(XtDisplay(tf), fillGC, 0, 0, &ClipRect, 1, Unsorted); /* Draw the segments onto the cursor */ XDrawSegments(dpy, XmTextF_cursor(tf), fillGC, segments, 3); /* Install the cursor for pixmap caching */ (void) _XmCachePixmap(XmTextF_cursor(tf), XtScreen(tf), pixmap_name, 1, 0, 0, 0, 0); /* Free the fill GC */ XFreeGC(XtDisplay(tf), fillGC); } /* Get/create the image_gc used to paint the I-Beam */ sprintf(pixmap_name, "_XmText_CM_%d", XmTextF_cursor_height(tf)); XmTextF_image_clip(tf) = XmGetPixmapByDepth(XtScreen(tf), pixmap_name, 1, 0, 1); if (XmTextF_image_clip(tf) == XmUNSPECIFIED_PIXMAP) XmTextF_image_clip(tf) = df_GetClipMask(tf, pixmap_name); valuemask = (GCClipMask | GCStipple | GCForeground | GCBackground | GCFillStyle); if (!XmTextF_overstrike(tf)) { values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; } else values.background = values.foreground = tf->core.background_pixel ^ tf->primitive.foreground; values.clip_mask = XmTextF_image_clip(tf); values.stipple = XmTextF_cursor(tf); values.fill_style = FillStippled; XChangeGC(XtDisplay(tf), XmTextF_image_gc(tf), valuemask, &values); } /* The IBeam Stencil must have already been created before this routine * is called. */ static void #ifdef _NO_PROTO df_MakeAddModeCursor( tf, line_width ) XmDataFieldWidget tf ; int line_width ; #else df_MakeAddModeCursor( XmDataFieldWidget tf, int line_width ) #endif /* _NO_PROTO */ { Screen *screen = XtScreen(tf); char pixmap_name[25]; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); sprintf(pixmap_name, "_XmDataF_AddMode_%d_%d", XmTextF_cursor_height(tf), line_width); XmTextF_add_mode_cursor(tf) = (Pixmap) XmGetPixmapByDepth(screen, pixmap_name, 1, 0, 1); if (XmTextF_add_mode_cursor(tf) == XmUNSPECIFIED_PIXMAP) { GC fillGC; XtGCMask valueMask; XGCValues values; unsigned int pix_width, pix_height, unused; Display *dpy = XtDisplay(tf); Pixmap stipple; XImage *image; Pixmap pixmap; int unused_origin; Window root; pixmap = XmGetPixmapByDepth(screen, "50_foreground", 1, 0, 1); if (pixmap != XmUNSPECIFIED_PIXMAP) { XGetGeometry(XtDisplay(tf), pixmap, &root, &unused_origin, &unused_origin, &pix_width, &pix_height, &unused, &unused); image = XGetImage(XtDisplay(tf), (Drawable)pixmap, 0, 0, pix_width, pix_height, AllPlanes, XYPixmap); stipple = XCreatePixmap(dpy, XtWindow(tf), image->width, image->height,1); XmTextF_add_mode_cursor(tf) = XCreatePixmap(dpy, XtWindow(tf), XmTextF_cursor_width(tf), XmTextF_cursor_height(tf), 1); fillGC = XCreateGC(dpy, XmTextF_add_mode_cursor(tf), 0, (XGCValues *)NULL); XPutImage(dpy, stipple, fillGC, image, 0, 0, 0, 0, image->width, image->height); XCopyArea(dpy, XmTextF_cursor(tf), XmTextF_add_mode_cursor(tf), fillGC, 0, 0, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf), 0, 0); valueMask = (GCTile | GCFillStyle | GCForeground | GCBackground | GCFunction); values.function = GXand; values.tile = stipple; values.fill_style = FillTiled; values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; XChangeGC(XtDisplay(tf), fillGC, valueMask, &values); XFillRectangle(dpy, XmTextF_add_mode_cursor(tf), fillGC, 0, 0, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf)); /* Install the pixmap for pixmap caching */ _XmCachePixmap(XmTextF_add_mode_cursor(tf), XtScreen(tf), pixmap_name, 1, 0, 0, 0, 0); XFreePixmap(dpy, stipple); XFreeGC(dpy, fillGC); XDestroyImage(image); } } } static void #ifdef _NO_PROTO df_MakeCursors( tf ) XmDataFieldWidget tf ; #else df_MakeCursors( XmDataFieldWidget tf ) #endif /* _NO_PROTO */ { Screen *screen = XtScreen(tf); int line_width = 1; if (!XtIsRealized((Widget) tf)) return; XmTextF_cursor_width(tf) = 5; XmTextF_cursor_height(tf) = XmTextF_font_ascent(tf) + XmTextF_font_descent(tf); /* setup parameters to make a thicker I-Beam */ if (XmTextF_cursor_height(tf) > 19) { XmTextF_cursor_width(tf)++; line_width = 2; } /* Remove old ibeam off area */ if (XmTextF_ibeam_off(tf) != XmUNSPECIFIED_PIXMAP) XFreePixmap(XtDisplay((Widget)tf), XmTextF_ibeam_off(tf)); /* Remove old insert cursor */ if (XmTextF_cursor(tf) != XmUNSPECIFIED_PIXMAP) { (void) XmDestroyPixmap(screen, XmTextF_cursor(tf)); XmTextF_cursor(tf) = XmUNSPECIFIED_PIXMAP; } /* Remove old add mode cursor */ if (XmTextF_add_mode_cursor(tf) != XmUNSPECIFIED_PIXMAP) { (void) XmDestroyPixmap(screen, XmTextF_add_mode_cursor(tf)); XmTextF_add_mode_cursor(tf) = XmUNSPECIFIED_PIXMAP; } /* Remove old image_clip pixmap */ if (XmTextF_image_clip(tf) != XmUNSPECIFIED_PIXMAP) { (void) XmDestroyPixmap(screen, XmTextF_image_clip(tf)); XmTextF_image_clip(tf) = XmUNSPECIFIED_PIXMAP; } /* Create area in which to save text located underneath I beam */ df_MakeIBeamOffArea(tf, MAX(XmTextF_cursor_height(tf)>>1, XmTextF_cursor_height(tf)), XmTextF_cursor_height(tf)); /* Create a new i-beam cursor */ df_MakeIBeamStencil(tf, line_width); /* Create a new add_mode cursor */ df_MakeAddModeCursor(tf, line_width); df_ResetClipOrigin(tf, False); if (XmTextF_overstrike(tf)) XmTextF_cursor_width(tf) = XmTextF_cursor_height(tf) >> 1; } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DropDestroyCB(w, clientData, callData) Widget w; XtPointer clientData; XtPointer callData; #else df_DropDestroyCB( Widget w, XtPointer clientData, XtPointer callData ) #endif /* NO_PROTO */ { df_DeleteDropContext(w); XtFree((char *)clientData); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DropTransferCallback( w, closure, seltype, type, value, length, format ) Widget w ; XtPointer closure ; Atom *seltype ; Atom *type ; XtPointer value ; unsigned long *length ; int *format ; #else df_DropTransferCallback( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format ) #endif /* _NO_PROTO */ { _XmTextDropTransferRec *transfer_rec = (_XmTextDropTransferRec *) closure; XmDataFieldWidget tf = (XmDataFieldWidget) transfer_rec->widget; Atom COMPOUND_TEXT = XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); #ifdef UTF8_SUPPORTED Atom UTF8_STRING = XmInternAtom(XtDisplay(w), XmSUTF8_STRING, False); #endif Atom CS_OF_LOCALE; XmTextPosition insertPosLeft, insertPosRight, left, right, cursorPos; int max_length = 0; Boolean local = XmTextF_has_primary(tf); char * total_tmp_value; wchar_t * wc_total_tmp_value; char ** tmp_value; int malloc_size = 0; int num_vals, status; Arg args[8]; Cardinal n, i; unsigned long total_length = 0; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ XTextProperty tmp_prop; Boolean replace = False; XmAnyCallbackStruct cb; /* When type = NULL, we are assuming a DELETE request has been requested */ if (*type == XmInternAtom(XtDisplay(transfer_rec->widget), "NULL", False)) { if (transfer_rec->num_chars > 0 && transfer_rec->move) { XmTextF_prim_anchor(tf) = transfer_rec->insert_pos; cursorPos = transfer_rec->insert_pos + transfer_rec->num_chars; _XmDataFielddf_SetCursorPosition(tf, NULL, cursorPos, False, True); (void) df_SetDestination((Widget)tf, XmTextF_cursor_position(tf), False, transfer_rec->timestamp); XmDataFieldSetSelection((Widget)tf, XmTextF_prim_anchor(tf), XmTextF_cursor_position(tf), transfer_rec->timestamp); } if (value) { XtFree((char *)value); value = NULL; } return; } status = XmbTextListToTextProperty(XtDisplay(transfer_rec->widget), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (status == Success) CS_OF_LOCALE = tmp_prop.encoding; else CS_OF_LOCALE = 99999; /* XmbTextList... should never fail for XPCS * characters. But just in case someones * Xlib is broken, this prevents a core dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); if (!value || (*type != CS_OF_LOCALE && *type != COMPOUND_TEXT #ifdef UTF8_SUPPORTED && *type != XA_STRING && *type != UTF8_STRING #endif )) { n = 0; XtSetArg(args[n], XmNtransferStatus, XmTRANSFER_FAILURE); n++; XtSetArg(args[n], XmNnumDropTransfers, 0); n++; XtSetValues(w, args, n); if (value) { XtFree((char *)value); value = NULL; } return; } insertPosLeft = insertPosRight = transfer_rec->insert_pos; if (*type == XA_STRING || *type == COMPOUND_TEXT #ifdef UTF8_SUPPORTED || *type == UTF8_STRING #endif ) { /* value NEEDS TO BE FREED */ tmp_prop.value = (unsigned char *) value; tmp_prop.encoding = *type; tmp_prop.format = 8; tmp_prop.nitems = *length; status = 0; status = XmbTextPropertyToTextList(XtDisplay(transfer_rec->widget), &tmp_prop, &tmp_value, &num_vals); /* if no conversion, num_vals is not changed */ if (num_vals && (status == Success || status > 0)) { for (i = 0; i < num_vals ; i++) malloc_size += strlen(tmp_value[i]); total_tmp_value = XtMalloc ((unsigned) malloc_size + 1); total_tmp_value[0] = '\0'; for (i = 0; i < num_vals ; i++) strcat(total_tmp_value, tmp_value[i]); total_length = strlen(total_tmp_value); XFreeStringList(tmp_value); } else { if (value) { XtFree((char *)value); value = NULL; } return; } } else { total_tmp_value = (char *)value; total_length = *length; } if (XmTextF_pending_delete(tf) && XmTextF_has_primary(tf) && XmTextF_prim_pos_left(tf) != XmTextF_prim_pos_right(tf) && insertPosLeft > XmTextF_prim_pos_left(tf) && insertPosRight < XmTextF_prim_pos_right(tf)) { insertPosLeft = XmTextF_prim_pos_left(tf); insertPosRight = XmTextF_prim_pos_right(tf); } transfer_rec->num_chars = _XmDataFieldCountCharacters(tf, total_tmp_value, (int)total_length); _XmDataFieldDrawInsertionPoint(tf, False); if (transfer_rec->move && local) { max_length = XmTextF_max_length(tf); XmTextF_max_length(tf) = INT_MAX; } if (XmTextF_max_char_size(tf) == 1) { if (_XmDataFieldReplaceText(tf, NULL, insertPosLeft, insertPosRight, (char *) total_tmp_value, (int)total_length, False)) replace = True; } else { wc_total_tmp_value = (wchar_t*)XtMalloc((unsigned) total_length * sizeof(wchar_t)); /* Note: casting total_length to an int may result in a truncation. */ total_length = mbstowcs(wc_total_tmp_value, total_tmp_value, (int)total_length); if (_XmDataFieldReplaceText(tf, NULL, insertPosLeft, insertPosRight, (char *) wc_total_tmp_value, (int)total_length, False)) replace = True; XtFree((char*)wc_total_tmp_value); } if (replace) { XmTextF_pending_off(tf) = FALSE; if (transfer_rec->num_chars > 0 && !transfer_rec->move) { cursorPos = transfer_rec->insert_pos + transfer_rec->num_chars; _XmDataFielddf_SetCursorPosition(tf, NULL, cursorPos, False, True); df_SetDestination((Widget)tf, XmTextF_cursor_position(tf), False, transfer_rec->timestamp); } if (XmDataFieldGetSelectionPosition((Widget)tf, &left, &right)) { if (transfer_rec->move && left < transfer_rec->insert_pos) transfer_rec->insert_pos -= transfer_rec->num_chars; if (XmTextF_cursor_position(tf) < left || XmTextF_cursor_position(tf) > right) XmTextF_pending_off(tf) = TRUE; } else { if (!transfer_rec->move && !XmTextF_add_mode(tf) && transfer_rec->num_chars != 0) XmTextF_prim_anchor(tf) = insertPosLeft; } if (transfer_rec->move) { XmDropTransferEntryRec transferEntries[1]; transferEntries[0].client_data = (XtPointer) transfer_rec; transferEntries[0].target = XmInternAtom(XtDisplay(w),"DELETE",False); XmDropTransferAdd(w, transferEntries, 1); } cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *)NULL; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } if (transfer_rec->move && local) { XmTextF_max_length(tf) = max_length; } XtFree(total_tmp_value); _XmDataFieldDrawInsertionPoint(tf, True); } static void #ifdef _NO_PROTO df_HandleDrop(w, cb) Widget w; XmDropProcCallbackStruct *cb; #else df_HandleDrop( Widget w, XmDropProcCallbackStruct *cb ) #endif /* _NO_PROTO */ { static XtCallbackRec dropdf_DestroyCB[] = { {df_DropDestroyCB, NULL}, {(XtCallbackProc)NULL, NULL} }; Widget drag_cont, initiator; Cardinal numExportTargets, n; Atom *exportTargets; Arg args[10]; XmTextPosition insert_pos, left, right; Display *display = XtDisplay(w); drag_cont = cb->dragContext; n = 0; XtSetArg(args[n], XmNsourceWidget, &initiator); n++; XtSetArg(args[n], XmNexportTargets, &exportTargets); n++; XtSetArg(args[n], XmNnumExportTargets, &numExportTargets); n++; XtGetValues((Widget) drag_cont, args, n); insert_pos = df_GetPosFromX((XmDataFieldWidget) w, cb->x); if (cb->operation & XmDROP_MOVE && w == initiator && XmDataFieldGetSelectionPosition(w, &left, &right) && left != right && insert_pos >= left && insert_pos <= right) { XtSetArg(args[n], XmNtransferStatus, XmTRANSFER_FAILURE); n++; XtSetArg(args[n], XmNnumDropTransfers, 0); n++; } else { XmDropTransferEntryRec transferEntries[2]; XmDropTransferEntryRec *transferList = NULL; Atom TEXT = XmInternAtom(display, "TEXT", False); Atom COMPOUND_TEXT = XmInternAtom(display, "COMPOUND_TEXT", False); #ifdef UTF8_SUPPORTED Atom UTF8_STRING = XmInternAtom(display, "UTF8_STRING", False); #endif Atom CS_OF_LOCALE; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ XTextProperty tmp_prop; _XmTextDropTransferRec *transfer_rec; Cardinal numTransfers = 0; Boolean locale_found = False; Boolean c_text_found = False; Boolean utf8_string_found = False; Boolean string_found = False; Boolean text_found = False; int status; status = XmbTextListToTextProperty(display, &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (status == Success) CS_OF_LOCALE = tmp_prop.encoding; else CS_OF_LOCALE = 99999; /* XmbTextList... should never fail for XPCS * characters. But just in case someones * Xlib is broken, this prevents a core dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); /* intialize data to send to drop transfer callback */ transfer_rec = (_XmTextDropTransferRec *) XtMalloc(sizeof(_XmTextDropTransferRec)); transfer_rec->widget = w; transfer_rec->insert_pos = insert_pos; transfer_rec->num_chars = 0; transfer_rec->timestamp = cb->timeStamp; transfer_rec->move = False; if (cb->operation & XmDROP_MOVE) { transfer_rec->move = True; } else { transfer_rec->move = False; } transferEntries[0].client_data = (XtPointer) transfer_rec; transferList = transferEntries; numTransfers = 1; for (n = 0; n < numExportTargets; n++) { if (exportTargets[n] == CS_OF_LOCALE) { transferEntries[0].target = CS_OF_LOCALE; locale_found = True; break; } if (exportTargets[n] == COMPOUND_TEXT) c_text_found = True; #ifdef UTF8_SUPPORTED if (exportTargets[n] == UTF8_STRING) utf8_string_found = True; #endif if (exportTargets[n] == XA_STRING) string_found = True; if (exportTargets[n] == TEXT) text_found = True; } n = 0; if (locale_found || c_text_found || string_found || text_found) { if (!locale_found) { #ifdef UTF8_SUPPORTED if (utf8_string_found) transferEntries[0].target = UTF8_STRING; else #endif if (c_text_found) transferEntries[0].target = COMPOUND_TEXT; else if (string_found) transferEntries[0].target = XA_STRING; else transferEntries[0].target = TEXT; } if (cb->operation & XmDROP_MOVE || cb->operation & XmDROP_COPY) { XtSetArg(args[n], XmNdropTransfers, transferList); n++; XtSetArg(args[n], XmNnumDropTransfers, numTransfers); n++; } else { XtSetArg(args[n], XmNtransferStatus, XmTRANSFER_FAILURE); n++; XtSetArg(args[n], XmNnumDropTransfers, 0); n++; } } else { XtSetArg(args[n], XmNtransferStatus, XmTRANSFER_FAILURE); n++; XtSetArg(args[n], XmNnumDropTransfers, 0); n++; } dropdf_DestroyCB[0].closure = (XtPointer) transfer_rec; XtSetArg(args[n], XmNdestroyCallback, dropdf_DestroyCB); n++; XtSetArg(args[n], XmNtransferProc, df_DropTransferCallback); n++; } df_SetDropContext(w); XmDropTransferStart(drag_cont, args, n); } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DragProcCallback(w, client, call) Widget w; XtPointer client; XtPointer call; #else df_DragProcCallback( Widget w, XtPointer client, XtPointer call ) #endif /* _NO_PROTO */ { XmDragProcCallbackStruct *cb = (XmDragProcCallbackStruct *)call; Widget drag_cont; Atom targets[5]; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ XTextProperty tmp_prop; Arg args[10]; Atom *exp_targets; Cardinal num_exp_targets, n; int status = 0; status = XmbTextListToTextProperty(XtDisplay(w), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (status == Success) targets[0] = tmp_prop.encoding; else targets[0] = 99999; /* XmbTextList... should never fail for XPCS * characters. But just in case someones * Xlib is broken, this prevents a core dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); targets[1] = XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); targets[2] = XA_STRING; targets[3] = XmInternAtom(XtDisplay(w), "TEXT", False); #ifdef UTF8_SUPPORTED targets[4] = XmInternAtom(XtDisplay(w), XmSUTF8_STRING, False); #endif drag_cont = cb->dragContext; n = 0; XtSetArg(args[n], XmNexportTargets, &exp_targets); n++; XtSetArg(args[n], XmNnumExportTargets, &num_exp_targets); n++; XtGetValues(drag_cont, args, n); switch(cb->reason) { case XmCR_DROP_SITE_ENTER_MESSAGE: if (XmTargetsAreCompatible(XtDisplay(drag_cont), exp_targets, #ifdef UTF8_SUPPORTED num_exp_targets, targets, 4)) #else num_exp_targets, targets, 3)) #endif cb->dropSiteStatus = XmVALID_DROP_SITE; else cb->dropSiteStatus = XmINVALID_DROP_SITE; break; case XmCR_DROP_SITE_LEAVE_MESSAGE: case XmCR_DROP_SITE_MOTION_MESSAGE: case XmCR_OPERATION_CHANGED: /* we currently don't care about these messages */ break; default: /* other messages we consider invalid */ cb->dropSiteStatus = XmINVALID_DROP_SITE; break; } } /* ARGSUSED */ static void #ifdef _NO_PROTO df_DropProcCallback(w, client, call) Widget w; XtPointer client; XtPointer call; #else df_DropProcCallback( Widget w, XtPointer client, XtPointer call ) #endif /* _NO_PROTO */ { XmDropProcCallbackStruct *cb = (XmDropProcCallbackStruct *) call; if (cb->dropAction != XmDROP_HELP) { df_HandleDrop(w, cb); } else { Arg args[2]; XtSetArg(args[0], XmNtransferStatus, XmTRANSFER_FAILURE); XtSetArg(args[1], XmNnumDropTransfers, 0); XmDropTransferStart(cb->dragContext, args, 2); } } static void #ifdef _NO_PROTO df_RegisterDropSite(w) Widget w ; #else df_RegisterDropSite( Widget w ) #endif /* _NO_PROTO */ { Atom targets[5]; Arg args[10]; int n; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ XTextProperty tmp_prop; int status = 0; status = XmbTextListToTextProperty(XtDisplay(w), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (status == Success) targets[0] = tmp_prop.encoding; else targets[0] = 99999; /* XmbTextList... should never fail for XPCS * characters. But just in case someones * Xlib is broken, this prevents a core dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); targets[1] = XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); targets[2] = XA_STRING; targets[3] = XmInternAtom(XtDisplay(w), "TEXT", False); #ifdef UTF8_SUPPORTED targets[4] = XmInternAtom(XtDisplay(w), XmSUTF8_STRING, False); #endif n = 0; XtSetArg(args[n], XmNimportTargets, targets); n++; #ifdef UTF8_SUPPORTED XtSetArg(args[n], XmNnumImportTargets, 4); n++; #else XtSetArg(args[n], XmNnumImportTargets, 3); n++; #endif XtSetArg(args[n], XmNdropProc, df_DragProcCallback); n++; XtSetArg(args[n], XmNdropProc, df_DropProcCallback); n++; XmDropSiteRegister(w, args, n); } /* * df_Initialize * Intializes the text data and ensures that the data in new * is valid. */ /* ARGSUSED */ static void #ifdef _NO_PROTO df_Initialize( request, new_w, args, num_args ) Widget request ; Widget new_w ; ArgList args ; Cardinal *num_args ; #else df_Initialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args ) #endif /* _NO_PROTO */ { XmDataFieldWidget req_tf = (XmDataFieldWidget) request; XmDataFieldWidget new_tf = (XmDataFieldWidget) new_w; Dimension width, height; df_Validates(new_tf); df_InitializeTextStruct(new_tf); df_LoadGCs(new_tf, new_tf->core.background_pixel, new_tf->primitive.foreground ); df_ComputeSize(new_tf, &width, &height); if (req_tf->core.width == 0) new_tf->core.width = width; if (req_tf->core.height == 0) new_tf->core.height = height; df_RegisterDropSite(new_w); if (XmTextF_verify_bell(new_tf) == (Boolean) XmDYNAMIC_BOOL) { if (_XmGetAudibleWarning(new_w) == XmBELL) XmTextF_verify_bell(new_tf) = True; else XmTextF_verify_bell(new_tf) = False; } } static void #ifdef _NO_PROTO df_Realize( w, valueMask, attributes ) Widget w ; XtValueMask *valueMask ; XSetWindowAttributes *attributes ; #else df_Realize( Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XtCreateWindow(w, (unsigned int) InputOutput, (Visual *) CopyFromParent, *valueMask, attributes); df_MakeCursors(tf); _XmDataFieldSetClipRect(tf); } static void #ifdef _NO_PROTO df_Destroy( wid ) Widget wid ; #else df_Destroy( Widget wid ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) wid ; Widget dest = XmGetDestination(XtDisplay(wid)); if (dest == wid) _XmSetDestination(XtDisplay(wid), NULL); if (XmTextF_timer_id(tf)) XtRemoveTimeOut(XmTextF_timer_id(tf)); if (XmTextF_has_rect(tf)) { TextFGCData gc_data = df_GetTextFGCData(wid); gc_data->tf = NULL; } if (XmTextF_max_char_size(tf) == 1) XtFree(XmTextF_value(tf)); else XtFree((char *)XmTextF_wc_value(tf)); XmDestroyPixmap(XtScreen(tf), XmTextF_stipple_tile(tf)); XtReleaseGC(wid, XmTextF_gc(tf)); XtReleaseGC(wid, XmTextF_image_gc(tf)); XtReleaseGC(wid, XmTextF_save_gc(tf)); XtFree((char *)XmTextF_highlight(tf).list); if (XmTextF_fontlist_created(tf)) XmFontListFree((XmFontList)XmTextF_font_list(tf)); if (XmTextF_add_mode_cursor(tf) != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(XtScreen(tf), XmTextF_add_mode_cursor(tf)); if (XmTextF_cursor(tf) != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(XtScreen(tf), XmTextF_cursor(tf)); if (XmTextF_ibeam_off(tf) != XmUNSPECIFIED_PIXMAP) XFreePixmap(XtDisplay((Widget)tf), XmTextF_ibeam_off(tf)); if (XmTextF_image_clip(tf) != XmUNSPECIFIED_PIXMAP) XmDestroyPixmap(XtScreen(tf), XmTextF_image_clip(tf)); /* * Fix for HaL DTS 9841 - release the data for the selectionArray. */ XtFree((char *)XmTextF_selection_array(tf)); XtRemoveAllCallbacks(wid, XmNactivateCallback); XtRemoveAllCallbacks(wid, XmNlosingFocusCallback); XtRemoveAllCallbacks(wid, XmNfocusCallback); XtRemoveAllCallbacks(wid, XmNmodifyVerifyCallback); XtRemoveAllCallbacks(wid, XmNmotionVerifyCallback); XtRemoveAllCallbacks(wid, XmNvalueChangedCallback); XtRemoveAllCallbacks(wid, XmNgainPrimaryCallback); XtRemoveAllCallbacks(wid, XmNlosePrimaryCallback); XmImUnregister(wid); XtFree((char*)XmDataField_picture_source(tf)); if(XmDataField_picture(tf)) XmPictureDelete(XmDataField_picture(tf)); } static void #ifdef _NO_PROTO df_Resize( w ) Widget w ; #else df_Resize( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextF_do_resize(tf) = False; _XmDataFieldSetClipRect(tf); if (XmDataField_alignment(tf) == XmALIGNMENT_END) XmTextF_h_offset(tf) = 0; else XmTextF_h_offset(tf) = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; XmTextF_refresh_ibeam_off(tf) = True; (void) df_AdjustText(tf, XmTextF_cursor_position(tf), True); XmTextF_do_resize(tf) = True; } /************************************************************************ * * df_QueryGeometry * ************************************************************************/ static XtGeometryResult #ifdef _NO_PROTO df_QueryGeometry( widget, intended, desired ) Widget widget ; XtWidgetGeometry *intended ; XtWidgetGeometry *desired ; #else df_QueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) #endif /* _NO_PROTO */ { /* this function deals with resizeWidth False */ df_ComputeSize((XmDataFieldWidget) widget, &desired->width, &desired->height); return XmeReplyToQueryGeometry(widget, intended, desired) ; } /* * Redisplay will redraw shadows, borders, and text. */ /* ARGSUSED */ static void #ifdef _NO_PROTO DataFieldExpose( w, event, region ) Widget w ; XEvent *event ; Region region ; #else DataFieldExpose( Widget w, XEvent *event, Region region ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XGCValues values; if (event->xany.type != Expose) return; XmTextF_do_resize(tf) = False; if (!XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); /* I can get here even though the widget isn't visible (i.e. my parent is * sized so that I have nothing visible. In this case, capturing the putback * area yields garbage... And if this area is not in an area where text * will be drawn (i.e. forcing something new/valid to be there next time I * go to capture it) the garbage persists. To prevent this, initialize the * putback area and then update it to a solid background color. */ XmTextF_refresh_ibeam_off(tf) = False; values.foreground = tf->core.background_pixel; XChangeGC(XtDisplay(w), XmTextF_save_gc(tf), GCForeground, &values); XFillRectangle(XtDisplay(w), XmTextF_ibeam_off(tf), XmTextF_save_gc(tf), 0, 0, XmTextF_cursor_width(tf), XmTextF_cursor_height(tf)); values.foreground = tf->primitive.foreground; XChangeGC(XtDisplay(w), XmTextF_save_gc(tf), GCForeground, &values); _XmDataFieldDrawInsertionPoint(tf, False); if (XtIsRealized((Widget)tf)) { if (tf->primitive.shadow_thickness > 0) XmeDrawShadows(XtDisplay(tf), XtWindow(tf), tf->primitive.bottom_shadow_GC, tf->primitive.top_shadow_GC, (int) tf->primitive.highlight_thickness, (int) tf->primitive.highlight_thickness, (int) (tf->core.width - (2 * tf->primitive.highlight_thickness)), (int) (tf->core.height - (2 * tf->primitive.highlight_thickness)), (int) tf->primitive.shadow_thickness, XmSHADOW_OUT); if (tf->primitive.highlighted) { XtWidgetProc bhl; _XmProcessLock(); bhl = ((XmDataFieldWidgetClass) XtClass(tf))->primitive_class.border_highlight; _XmProcessUnlock(); if(bhl) { (*bhl)( (Widget) tf) ; } } else { XtWidgetProc buhl; _XmProcessLock(); buhl = ((XmDataFieldWidgetClass) XtClass(tf))->primitive_class.border_unhighlight; _XmProcessUnlock(); if(buhl) { (*buhl)( (Widget) tf) ; } } df_RedisplayText(tf, 0, XmTextF_string_length(tf)); } XmTextF_refresh_ibeam_off(tf) = True; _XmDataFieldDrawInsertionPoint(tf, True); XmTextF_do_resize(tf) = True; } /* * * df_SetValues * * Checks the new text data and ensures that the data is valid. * Invalid values will be rejected and changed back to the old * values. * */ /* ARGSUSED */ static Boolean #ifdef _NO_PROTO df_SetValues( old, request, new_w, args, num_args ) Widget old ; Widget request ; Widget new_w ; ArgList args ; Cardinal *num_args ; #else df_SetValues( Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args ) #endif /* _NO_PROTO */ { XmDataFieldWidget new_tf = (XmDataFieldWidget) new_w; XmDataFieldWidget old_tf = (XmDataFieldWidget) old; Boolean cursor_pos_set = False; Boolean new_size = False; Boolean redisplay = False; Boolean redisplay_text = False; Boolean new_font = False; Boolean mod_ver_ret = False; Boolean diff_values = False; Dimension new_width = new_tf->core.width; Dimension new_height = new_tf->core.height; Arg im_args[6]; XPoint xmim_point; XmTextPosition new_position = 0; XmTextPosition newInsert; int n = 0; if (new_w->core.being_destroyed) return False; XmTextF_in_setvalues(new_tf) = True; XmTextF_redisplay(new_tf) = False; /************************************ * ICS DataField specific stuff here * ************************************/ /* * This is a patch-around to a bug we seem to have exposed. * The special redisplay handling has been broken somehow with the * end result that the DataField doesn't redisplay itself * correctly when its XmNvalue is set. This just hacks around the * problem. */ if(XmTextF_value(old_tf) != XmTextF_value(new_tf)) { redisplay = True; } if (XmDataField_picture_source(old_tf) != XmDataField_picture_source(new_tf)) { /* * Delete what's there */ XtFree((char*)XmDataField_picture_source(old_tf)); XmDataField_picture_source(new_tf) = XtNewString(XmDataField_picture_source(new_tf)); if(XmDataField_picture(new_tf)) { XmPictureDelete(XmDataField_picture(new_tf)); XmDataField_picture(new_tf) = NULL; } /* * And make a new one if we have to */ if(XmDataField_picture_source(new_tf)) { XmDataField_picture(new_tf) = XmParsePicture(XmDataField_picture_source(new_tf)); } /* * Finally register (or remove) the callback */ if(XmDataField_picture(new_tf)) { XtAddCallback((Widget)new_tf, XmNmodifyVerifyCallback, PictureVerifyCallback, NULL); } else { XtRemoveCallback((Widget)new_tf, XmNmodifyVerifyCallback, PictureVerifyCallback, NULL); } } if (XmDataField_alignment(old_tf) != XmDataField_alignment(new_tf)) { if (XmDataField_alignment(new_tf) == XmALIGNMENT_END) XmTextF_h_offset(new_tf) = XmTextF_new_h_offset(new_tf) = 0; else XmTextF_h_offset(new_tf) = XmTextF_new_h_offset(new_tf) = XmTextF_margin_width(new_tf) + new_tf->primitive.shadow_thickness + new_tf->primitive.highlight_thickness; redisplay = True; } /* If new cursor position, copy the old cursor pos to the new widget * so that when we turn off the i-beam, the current location (old * widget) is used, but the new i-beam parameters (on/off, state, ...) * are utilized. Then move the cursor. Otherwise, just turn off * the i-beam. */ if (XmTextF_cursor_position(new_tf) != XmTextF_cursor_position(old_tf)) { new_position = XmTextF_cursor_position(new_tf) ; XmTextF_cursor_position(new_tf) = XmTextF_cursor_position(old_tf); _XmDataFieldDrawInsertionPoint(old_tf, False); XmTextF_blink_on(new_tf) = XmTextF_blink_on(old_tf); XmTextF_cursor_on(new_tf) = XmTextF_cursor_on(old_tf); _XmDataFielddf_SetCursorPosition(new_tf, NULL, new_position, True, True); (void) df_SetDestination(new_w, XmTextF_cursor_position(new_tf), False, XtLastTimestampProcessed(XtDisplay(new_w))); cursor_pos_set = True; } else { int ix; for (ix = 0; ix < *num_args; ix++) if (strcmp(args[ix].name, XmNcursorPosition) == 0) { cursor_pos_set = True; new_position = XmTextF_cursor_position(new_tf); break; } _XmDataFieldDrawInsertionPoint(old_tf, False); XmTextF_blink_on(new_tf) = XmTextF_blink_on(old_tf); XmTextF_cursor_on(new_tf) = XmTextF_cursor_on(old_tf); } if (new_w->core.sensitive == False && XmTextF_has_destination(new_tf)) { (void) df_SetDestination(new_w, XmTextF_cursor_position(new_tf), True, XtLastTimestampProcessed(XtDisplay(new_w))); } if (XmTextF_selection_array(new_tf) == NULL) XmTextF_selection_array(new_tf) = XmTextF_selection_array(old_tf); if (XmTextF_selection_array_count(new_tf) <= 0) XmTextF_selection_array_count(new_tf) = XmTextF_selection_array_count(old_tf); /* * Fix for HaL DTS 9841 - If the new and old selectionArrays do not match, * free the old array and then copy the new array. */ if (XmTextF_selection_array(new_tf) != XmTextF_selection_array(old_tf)) { XtPointer temp_ptr; XtFree((char *)XmTextF_selection_array(old_tf)); temp_ptr = (XtPointer)XmTextF_selection_array(new_tf); XmTextF_selection_array(new_tf) = (XmTextScanType *)XtMalloc ( XmTextF_selection_array_count(new_tf) * sizeof(XmTextScanType)); memcpy((void *)XmTextF_selection_array(new_tf), (void *)temp_ptr, (XmTextF_selection_array_count(new_tf) * sizeof(XmTextScanType))); } /* * End fix for HaL DTS 9841 */ /* Make sure the new_tf cursor position is a valid value. */ if (XmTextF_cursor_position(new_tf) < 0) { XmeWarning (new_w, MSG1); XmTextF_cursor_position(new_tf) = XmTextF_cursor_position(old_tf); cursor_pos_set = False; } if (XmTextF_font_list(new_tf)!= XmTextF_font_list(old_tf)) { new_font = True; if (XmTextF_font_list(new_tf) == NULL) XmTextF_font_list(new_tf) = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); XmTextF_font_list(new_tf) = (XmFontList)XmFontListCopy(XmTextF_font_list(new_tf)); if (!df_LoadFontMetrics(new_tf)){ /* Fails if font set required but not * available. */ XmFontListFree((XmFontList)XmTextF_font_list(new_tf)); XmTextF_font_list(new_tf) = XmTextF_font_list(old_tf); (void)df_LoadFontMetrics(new_tf); /* it *was* correct, so re-use it */ new_font = False; } else { XtSetArg(im_args[n], XmNfontList, XmTextF_font_list(new_tf)); n++; redisplay = True; } } /* Four cases to handle for value: * 1. user set both XmNvalue and XmNwcValue. * 2. user set the opposite resource (i.e. value is a char* * and user set XmNwcValue, or vice versa). * 3. user set the corresponding resource (i.e. value is a char* * and user set XmNValue, or vice versa). * 4. user set neither XmNValue nor XmNwcValue */ /* OSF says: if XmNvalueWcs set, it overrides all else */ if (XmTextF_max_char_size(new_tf) == 1) { /* wc_value on new will be NULL unless XmNvalueWcs was set. */ if (XmTextF_wc_value(new_tf) != NULL){ /* must be new if MB_CUR... == 1 */ df_ValidateString(new_tf, (char*) XmTextF_wc_value(new_tf), True); diff_values = True; } else if (XmTextF_value(new_tf) != XmTextF_value(old_tf)) { diff_values = True; if (XmTextF_value(new_tf) == NULL) { df_ValidateString(new_tf, "", False); } else df_ValidateString(new_tf, XmTextF_value(new_tf), False); } /* else, no change so don't do anything */ } else { if (XmTextF_wc_value(new_tf) != XmTextF_wc_value(old_tf)) { diff_values = True; if (XmTextF_wc_value(new_tf) == NULL) { XmTextF_wc_value(new_tf) = (wchar_t*) XtMalloc(sizeof(wchar_t)); *XmTextF_wc_value(new_tf) = (wchar_t)NULL; } df_ValidateString(new_tf, (char*)XmTextF_wc_value(new_tf), True); } else if (XmTextF_value(new_tf) != XmTextF_value(old_tf)) { /* Someone set XmNvalue */ diff_values = True; if (XmTextF_value(new_tf) == NULL) df_ValidateString(new_tf, "", True); else df_ValidateString(new_tf, XmTextF_value(new_tf), False); } /* else, no change so don't do anything */ } if (diff_values) { /* old value != new value */ Boolean do_it = True; /* If there are modify verify callbacks, verify that we want to continue * the action. */ if (XmTextF_modify_verify_callback(new_tf) || XmTextF_wcs_modify_verify_callback(new_tf)) { /* If the function df_ModifyVerify() returns false then don't * continue with the action. */ char *temp, *old; int free_insert; XmTextPosition fromPos = 0, toPos; toPos = XmTextF_string_length(old_tf); if (XmTextF_max_char_size(new_tf) == 1) { temp = XmTextF_value(new_tf); mod_ver_ret = df_ModifyVerify(new_tf, NULL, &fromPos, &toPos, &temp, &XmTextF_string_length(new_tf), &newInsert, &free_insert); } else { old = temp = XtMalloc((unsigned)((XmTextF_string_length(new_tf) + 1) * XmTextF_max_char_size(new_tf))); (void)wcstombs(temp, XmTextF_wc_value(new_tf), (XmTextF_string_length(new_tf) + 1) * XmTextF_max_char_size(new_tf)); mod_ver_ret = df_ModifyVerify(new_tf, NULL, &fromPos, &toPos, &temp, &XmTextF_string_length(new_tf), &newInsert, &free_insert); if (old != temp) XtFree (old); } if (free_insert) XtFree(temp); if (!mod_ver_ret) { if (XmTextF_verify_bell(new_tf)) XBell(XtDisplay(new_w), 0); if (XmTextF_max_char_size(new_tf) == 1) { XmTextF_value(new_tf) = (char *) memcpy( XtRealloc(XmTextF_value(new_tf), (unsigned)XmTextF_size_allocd(old_tf)), (void*)XmTextF_value(old_tf), XmTextF_string_length(old_tf) + 1); XmTextF_string_length(new_tf) = XmTextF_string_length(old_tf); XmTextF_size_allocd(new_tf) = XmTextF_size_allocd(old_tf); XtFree(XmTextF_value(old_tf)); } else { /* realloc to old size, cast to wchar_t*, and copy the data */ XmTextF_wc_value(new_tf) = (wchar_t*)memcpy( XtRealloc((char *)XmTextF_wc_value(new_tf), (unsigned)XmTextF_size_allocd(old_tf)), (void*)XmTextF_wc_value(old_tf), (unsigned) XmTextF_size_allocd(old_tf)); XmTextF_string_length(new_tf) = XmTextF_string_length(old_tf); XmTextF_size_allocd(new_tf) = XmTextF_size_allocd(old_tf); XtFree((char *)XmTextF_wc_value(old_tf)); } do_it = False; } } if (do_it) { XmAnyCallbackStruct cb; if (XmTextF_max_char_size(new_tf) == 1) XtFree(XmTextF_value(old_tf)); else XtFree((char *)XmTextF_wc_value(old_tf)); XmDataFieldSetHighlight(new_w, XmTextF_prim_pos_left(new_tf), XmTextF_prim_pos_right(new_tf), XmHIGHLIGHT_NORMAL); XmTextF_pending_off(new_tf) = True; /* if new_position was > XmTextF_string_length(old_tf), last time * the df_SetCursorPosition didn't take. */ if (!cursor_pos_set || new_position > XmTextF_string_length(old_tf)){ _XmDataFielddf_SetCursorPosition(new_tf, NULL, new_position, True, False); if (XmTextF_has_destination(new_tf)) (void) df_SetDestination(new_w, XmTextF_cursor_position(new_tf), False, XtLastTimestampProcessed(XtDisplay(new_w))); } if (XmTextF_resize_width(new_tf) && XmTextF_do_resize(new_tf)) df_AdjustSize(new_tf); else { if (XmDataField_alignment(new_tf) == XmALIGNMENT_END) XmTextF_h_offset(new_tf) = 0; else XmTextF_h_offset(new_tf) = XmTextF_margin_width(new_tf) + new_tf->primitive.shadow_thickness + new_tf->primitive.highlight_thickness; if (!df_AdjustText(new_tf, XmTextF_cursor_position(new_tf), False)) redisplay_text = True; } cb.reason = XmCR_VALUE_CHANGED; cb.event = NULL; XtCallCallbackList(new_w, XmTextF_value_changed_callback(new_tf), (XtPointer) &cb); } } if (new_tf->primitive.foreground != old_tf->primitive.foreground || XmTextF_font_list(new_tf)!= XmTextF_font_list(old_tf) || new_tf->core.background_pixel != old_tf->core.background_pixel) { df_LoadGCs(new_tf, new_tf->primitive.foreground, new_tf->core.background_pixel); df_MakeCursors(new_tf); _XmDataFieldSetClipRect(new_tf); if (XmTextF_have_inverted_image_gc(new_tf)){ XmTextF_have_inverted_image_gc(new_tf) = False; df_InvertImageGC(new_tf); } redisplay = True; XtSetArg(im_args[n], XmNbackground, new_tf->core.background_pixel); n++; XtSetArg(im_args[n], XmNforeground, new_tf->primitive.foreground); n++; } if (XmTextF_has_focus(new_tf) && XtIsSensitive((Widget)new_tf) && XmTextF_blink_rate(new_tf) != XmTextF_blink_rate(old_tf)) { if (XmTextF_blink_rate(new_tf) == 0) { XmTextF_blink_on(new_tf) = True; if (XmTextF_timer_id(new_tf)) { XtRemoveTimeOut(XmTextF_timer_id(new_tf)); XmTextF_timer_id(new_tf) = (XtIntervalId)0; } } else if (XmTextF_timer_id(new_tf) == (XtIntervalId)0) { XmTextF_timer_id(new_tf) = XtAppAddTimeOut(XtWidgetToApplicationContext(new_w), (unsigned long)XmTextF_blink_rate(new_tf), df_HandleTimer, (XtPointer) new_tf); } df_BlinkInsertionPoint(new_tf); } if (XmTextF_margin_height(new_tf) != XmTextF_margin_height(old_tf)) { XmTextF_margin_top(new_tf) = XmTextF_margin_height(new_tf); XmTextF_margin_bottom(new_tf) = XmTextF_margin_height(new_tf); } new_size = XmTextF_margin_width(new_tf) != XmTextF_margin_width(old_tf) || XmTextF_margin_height(new_tf) != XmTextF_margin_height(old_tf) || XmTextF_font_list(new_tf) != XmTextF_font_list(old_tf) || new_tf->primitive.highlight_thickness != old_tf->primitive.highlight_thickness || new_tf->primitive.shadow_thickness != old_tf->primitive.shadow_thickness; if (XmTextF_columns(new_tf) < 0) { XmeWarning (new_w, MSG7); XmTextF_columns(new_tf) = XmTextF_columns(old_tf); } if (!(new_width != old_tf->core.width && new_height != old_tf->core.height)) { if (XmTextF_columns(new_tf) != XmTextF_columns(old_tf) || new_size) { Dimension width, height; df_ComputeSize(new_tf, &width, &height); df_AdjustText(new_tf, 0, False); if (new_width == old_tf->core.width) new_w->core.width = width; if (new_height == old_tf->core.height) new_w->core.height = height; if (XmDataField_alignment(new_tf) == XmALIGNMENT_END) XmTextF_h_offset(new_tf) = 0; else XmTextF_h_offset(new_tf) = XmTextF_margin_width(new_tf) + new_tf->primitive.shadow_thickness + new_tf->primitive.highlight_thickness; redisplay = True; } } else { if (new_width != new_tf->core.width) new_tf->core.width = new_width; if (new_height != new_tf->core.height) new_tf->core.height = new_height; } XmTextF_refresh_ibeam_off(new_tf) = 1; /* force update of putback area */ _XmDataFieldDrawInsertionPoint(new_tf, True); if (XtIsSensitive((Widget)new_tf) != XtIsSensitive((Widget)old_tf)) { if (XtIsSensitive(new_w)) { _XmDataFieldDrawInsertionPoint(new_tf, False); XmTextF_blink_on(new_tf) = False; _XmDataFToggleCursorGC(new_w); _XmDataFieldDrawInsertionPoint(new_tf, True); } else { if (XmTextF_has_focus(new_tf)) { XmTextF_has_focus(new_tf) = False; df_ChangeBlinkBehavior(new_tf, False); _XmDataFieldDrawInsertionPoint(new_tf, False); _XmDataFToggleCursorGC(new_w); XmTextF_blink_on(new_tf) = True; _XmDataFieldDrawInsertionPoint(new_tf, True); } } if (XmTextF_string_length(new_tf) > 0) redisplay = True; } df_GetXYFromPos(new_tf, XmTextF_cursor_position(new_tf), &xmim_point.x, &xmim_point.y); if (XmTextF_editable(old_tf) != XmTextF_editable(new_tf)) { Boolean editable = XmTextF_editable(new_tf); XmTextF_editable(new_tf) = XmTextF_editable(old_tf); XmDataFieldSetEditable(new_w, editable); } XtSetArg(im_args[n], XmNbackgroundPixmap, new_tf->core.background_pixmap); n++; XtSetArg(im_args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(im_args[n], XmNlineSpace, XmTextF_font_ascent(new_tf) + XmTextF_font_descent(new_tf)); n++; XmImSetValues((Widget)new_tf, im_args, n); if (new_font) XmFontListFree((XmFontList)XmTextF_font_list(old_tf)); if (!redisplay) redisplay = XmTextF_redisplay(new_tf); /* If I'm forced to redisplay, then actual widget won't be updated * until the expose proc. Force the ibeam putback to be refreshed * at expose time so that it reflects true visual state of the * widget. */ if (redisplay) XmTextF_refresh_ibeam_off(new_tf) = True; XmTextF_in_setvalues(new_tf) = False; /* * Force new clip rectangles to be computed during redisplay, * *after* XtSetValues decides on final geometry. */ if (redisplay) XmTextF_has_rect(new_tf) = False; if ((!XmTextF_editable(new_tf) || !XtIsSensitive(new_w)) && XmTextF_has_destination(new_tf)) (void) df_SetDestination(new_w, 0, False, (Time)0); /* don't shrink to nothing */ if (new_tf->core.width == 0) new_tf->core.width = old_tf->core.width; if (new_tf->core.height == 0) new_tf->core.height = old_tf->core.height; if (!redisplay && redisplay_text) df_RedisplayText(new_tf, 0, XmTextF_string_length(new_tf)); return redisplay; } static Boolean #ifdef _NO_PROTO DataFieldRemove( w, event) Widget w ; XEvent *event ; #else DataFieldRemove( Widget w, XEvent *event) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left, right; XmAnyCallbackStruct cb; if (XmTextF_editable(tf) == False) return False; if (!XmDataFieldGetSelectionPosition(w, &left, &right) || left == right) { XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); return False; } if (_XmDataFieldReplaceText(tf, event, left, right, NULL, 0, True)){ XmDataFieldSetSelection(w, XmTextF_cursor_position(tf), XmTextF_cursor_position(tf), XtLastTimestampProcessed(XtDisplay(w))); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } XmTextF_prim_anchor(tf) = XmTextF_cursor_position(tf); return True; } /******************************************** * AccessTextual trait method implementation ********************************************/ static XtPointer DataFieldGetValue(Widget w, int format) { char *str; XmString tmp; switch(format) { case XmFORMAT_XmSTRING: str = XmDataFieldGetString(w); tmp = XmStringCreateLocalized(str); if (str != NULL) XtFree(str); return((XtPointer) tmp); case XmFORMAT_MBYTE: return((XtPointer) XmDataFieldGetString(w)); case XmFORMAT_WCS: return((XtPointer) XmDataFieldGetStringWcs(w)); } return(NULL); } static void DataFieldSetValue(Widget w, XtPointer s, int format) { char *str; switch(format) { case XmFORMAT_XmSTRING: str = _XmStringGetTextConcat((XmString) s); XmDataFieldSetString(w, str); if (str != NULL) XtFree(str); break; case XmFORMAT_MBYTE: XmDataFieldSetString(w, (char*) s); break; case XmFORMAT_WCS: XmDataFieldSetStringWcs(w, (wchar_t *) s); } } /*ARGSUSED*/ static int DataFieldPreferredValue(Widget w) /* unused */ { return(XmFORMAT_MBYTE); } /* * XmRCallProc routine for checking data.font_list before setting it to NULL * if no value is specified for both XmNrenderTable and XmNfontList. * If "check_set_render_table" == True, then function has been called twice * on same widget, thus resource needs to be set NULL, otherwise leave it * alone. */ /* ARGSUSED */ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmDataFieldWidget df = (XmDataFieldWidget)wid; if (XmTextF_check_set_render_table(df)) value->addr = NULL; else { XmTextF_check_set_render_table(df) = True; value->addr = (char*)&(XmTextF_font_list(df)); } } /***********************************<->*************************************** * Public Functions * ***********************************<->***************************************/ char * #ifdef _NO_PROTO XmDataFieldGetString( w ) Widget w ; #else XmDataFieldGetString( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; char *temp_str; int ret_val = 0; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmTextF_string_length(tf) > 0) { if (XmTextF_max_char_size(tf) == 1) { temp_str = XtNewString(XmTextF_value(tf)); _XmAppUnlock(app); return(temp_str); } else { temp_str = (char *) XtMalloc((unsigned) XmTextF_max_char_size(tf) * (XmTextF_string_length(tf) + 1)); ret_val = wcstombs(temp_str, XmTextF_wc_value(tf), (XmTextF_string_length(tf) + 1) * XmTextF_max_char_size(tf)); if (ret_val < 0) { temp_str[0] = '\0'; } _XmAppUnlock(app); return temp_str; } } else { _XmAppUnlock(app); return(XtNewString("")); } } int #ifdef _NO_PROTO XmDataFieldGetSubstring( widget, start, num_chars, buf_size, buffer ) Widget widget; XmTextPosition start; int num_chars; int buf_size; char *buffer; #else XmDataFieldGetSubstring( Widget widget, XmTextPosition start, int num_chars, int buf_size, char *buffer ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) widget; int ret_value = XmCOPY_SUCCEEDED; int n_bytes = 0; int wcs_ret = 0; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmTextF_max_char_size(tf) != 1) { n_bytes = _XmDataFieldCountBytes(tf, XmTextF_wc_value(tf)+start, num_chars); } else { n_bytes = num_chars; } if (buf_size < n_bytes + 1 ) { _XmAppUnlock(app); return XmCOPY_FAILED; } if (start + num_chars > XmTextF_string_length(tf)) { num_chars = (int) (XmTextF_string_length(tf) - start); if (XmTextF_max_char_size(tf) != 1) { n_bytes = _XmDataFieldCountBytes(tf, XmTextF_wc_value(tf)+start, num_chars); } else { n_bytes = num_chars; } ret_value = XmCOPY_TRUNCATED; } if (num_chars > 0) { if (XmTextF_max_char_size(tf) == 1) { (void)memcpy((void*)buffer, (void*)&XmTextF_value(tf)[start], num_chars); } else { wcs_ret = wcstombs(buffer, &XmTextF_wc_value(tf)[start], n_bytes); if (wcs_ret < 0) n_bytes = 0; } buffer[n_bytes] = '\0'; } else { ret_value = XmCOPY_FAILED; } _XmAppUnlock(app); return (ret_value); } wchar_t * #ifdef _NO_PROTO XmDataFieldGetStringWcs( w ) Widget w ; #else XmDataFieldGetStringWcs( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; wchar_t *temp_wcs; int num_wcs = 0; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmTextF_string_length(tf) > 0) { temp_wcs = (wchar_t*) XtMalloc((unsigned) sizeof(wchar_t) * (XmTextF_string_length(tf) + 1)); if (XmTextF_max_char_size(tf) != 1) { (void)memcpy((void*)temp_wcs, (void*)XmTextF_wc_value(tf), sizeof(wchar_t) * (XmTextF_string_length(tf) + 1)); } else { num_wcs = mbstowcs(temp_wcs, XmTextF_value(tf), XmTextF_string_length(tf) + 1); } _XmAppUnlock(app); return temp_wcs; } else { temp_wcs = (wchar_t*) XtMalloc((unsigned) sizeof(wchar_t)); temp_wcs[0] = (wchar_t)0L; /* put a wchar_t NULL in position 0 */ _XmAppUnlock(app); return temp_wcs; } } int #ifdef _NO_PROTO XmDataFieldGetSubstringWcs( widget, start, num_chars, buf_size, buffer ) Widget widget; XmTextPosition start; int num_chars; int buf_size; wchar_t *buffer; #else XmDataFieldGetSubstringWcs( Widget widget, XmTextPosition start, int num_chars, int buf_size, wchar_t *buffer ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) widget; int ret_value = XmCOPY_SUCCEEDED; int num_wcs = 0; _XmWidgetToAppContext(widget); _XmAppLock(app); if (start + num_chars > XmTextF_string_length(tf)) { num_chars = (int) (XmTextF_string_length(tf) - start); ret_value = XmCOPY_TRUNCATED; } if (buf_size < num_chars + 1 ) { _XmAppUnlock(app); return XmCOPY_FAILED; } if (num_chars > 0) { if (XmTextF_max_char_size(tf) == 1) { num_wcs = mbstowcs(buffer, &XmTextF_value(tf)[start], num_chars); if (num_wcs < 0) num_chars = 0; } else { (void)memcpy((void*)buffer, (void*)&XmTextF_wc_value(tf)[start], (size_t) num_chars * sizeof(wchar_t)); } buffer[num_chars] = '\0'; } else if (num_chars == 0) { buffer[num_chars] = '\0'; } else { ret_value = XmCOPY_FAILED; } _XmAppUnlock(app); return (ret_value); } XmTextPosition #ifdef _NO_PROTO XmDataFieldGetLastPosition( w ) Widget w ; #else XmDataFieldGetLastPosition( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = XmTextF_string_length(tf); _XmAppUnlock(app); return(ret_val); } void #ifdef _NO_PROTO XmDataFieldSetString( w, value ) Widget w ; char *value ; #else XmDataFieldSetString( Widget w, char *value ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmAnyCallbackStruct cb; XmTextPosition fromPos, toPos, newInsert; int length; int free_insert = False; int ret_val = 0; char * tmp_ptr; char * mod_value = NULL; _XmWidgetToAppContext(w); _XmAppLock(app); fromPos = 0; if (value == NULL) value = ""; toPos = XmTextF_string_length(tf); if (XmTextF_max_char_size(tf) == 1) { length = strlen(value); } else { length = mbstowcs(NULL, value, 0); } if (tf->core.sensitive && XmTextF_has_focus(tf)) { df_ChangeBlinkBehavior(tf, False); } _XmDataFieldDrawInsertionPoint(tf, False); if (XmTextF_modify_verify_callback(tf) || XmTextF_wcs_modify_verify_callback(tf)) { /* * If the function df_ModifyVerify() returns * false then don't continue with the action. */ if (!df_ModifyVerify(tf, NULL, &fromPos, &toPos, &value, &length, &newInsert, &free_insert)) { if (XmTextF_verify_bell(tf)) XBell(XtDisplay(w), 0); if (free_insert) XtFree(value); _XmAppUnlock(app); return; } } XmDataFieldSetHighlight(w, 0, XmTextF_string_length(tf), XmHIGHLIGHT_NORMAL); if (XmTextF_max_char_size(tf) == 1) { XtFree(XmTextF_value(tf)); } else /* convert to wchar_t before calling df_ValidateString */ { XtFree((char *)XmTextF_wc_value(tf)); } df_ValidateString(tf, value, False); XmTextF_pending_off(tf) = True; df_SetCursorPosition(tf, NULL, 0, True, True, False); if (XmTextF_resize_width(tf) && XmTextF_do_resize(tf)) { df_AdjustSize(tf); } else { if (XmDataField_alignment(tf) == XmALIGNMENT_END) { XmTextF_h_offset(tf) = 0; } else { XmTextF_h_offset(tf) = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; } if (!df_AdjustText(tf, XmTextF_cursor_position(tf), False)) { df_RedisplayText(tf, 0, XmTextF_string_length(tf)); } } cb.reason = XmCR_VALUE_CHANGED; cb.event = NULL; XtCallCallbackList(w, XmTextF_value_changed_callback(tf), (XtPointer) &cb); XmTextF_refresh_ibeam_off(tf) = True; if (tf->core.sensitive && XmTextF_has_focus(tf)) { df_ChangeBlinkBehavior(tf, True); } _XmDataFieldDrawInsertionPoint(tf, True); if (free_insert) XtFree(value); _XmAppUnlock(app); } static void #ifdef _NO_PROTO XmDataFieldSetStringWcs( w, wc_value ) Widget w; wchar_t *wc_value; #else XmDataFieldSetStringWcs( Widget w, wchar_t *wc_value ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; char * tmp; wchar_t *tmp_wc; int num_chars = 0; int result; _XmWidgetToAppContext(w); _XmAppLock(app); for (num_chars = 0, tmp_wc = wc_value; *tmp_wc != (wchar_t)0L; num_chars++) tmp_wc++; /* count number of wchar_t's */ tmp = XtMalloc((unsigned) (num_chars + 1) * XmTextF_max_char_size(tf)); result = wcstombs(tmp, wc_value, (num_chars + 1) * XmTextF_max_char_size(tf)); if (result == (size_t) -1) /* if wcstombs fails, it returns (size_t) -1 */ tmp = ""; /* if invalid data, pass in the empty string */ XmDataFieldSetString(w, tmp); XtFree(tmp); _XmAppUnlock(app); } void #ifdef _NO_PROTO XmDataFieldReplace( w, from_pos, to_pos, value ) Widget w ; XmTextPosition from_pos ; XmTextPosition to_pos ; char *value ; #else XmDataFieldReplace( Widget w, XmTextPosition from_pos, XmTextPosition to_pos, char *value ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; int save_maxlength = XmTextF_max_length(tf); Boolean save_editable = XmTextF_editable(tf); Boolean deselected = False; Boolean rep_result = False; wchar_t *wc_value; int length = 0; XmAnyCallbackStruct cb; _XmWidgetToAppContext(w); _XmAppLock(app); if (value == NULL) value = ""; df_VerifyBounds(tf, &from_pos, &to_pos); if (XmTextF_has_primary(tf)) { if ((XmTextF_prim_pos_left(tf) > from_pos && XmTextF_prim_pos_left(tf) < to_pos) || (XmTextF_prim_pos_right(tf) >from_pos && XmTextF_prim_pos_right(tf) < to_pos) || (XmTextF_prim_pos_left(tf) <= from_pos && XmTextF_prim_pos_right(tf) >= to_pos)) { _XmDataFieldDeselectSelection(w, False, XtLastTimestampProcessed(XtDisplay(w))); deselected = True; } } XmTextF_editable(tf) = True; XmTextF_max_length(tf) = INT_MAX; if (XmTextF_max_char_size(tf) == 1) { length = strlen(value); rep_result = _XmDataFieldReplaceText(tf, NULL, from_pos, to_pos, value, length, False); } else { /* need to convert to wchar_t* before calling Replace */ wc_value = (wchar_t *) XtMalloc((unsigned) sizeof(wchar_t) * (1 + strlen(value))); length = mbstowcs(wc_value, value, (unsigned) (strlen(value) + 1)); rep_result = _XmDataFieldReplaceText(tf, NULL, from_pos, to_pos, (char*)wc_value, length, False); XtFree((char *)wc_value); } if (from_pos <= XmTextF_cursor_position(tf)) { XmTextPosition cursorPos; /* Replace will not move us, we still want this to happen */ if (XmTextF_cursor_position(tf) < to_pos) { if (XmTextF_cursor_position(tf) - from_pos <= length) cursorPos = XmTextF_cursor_position(tf); else cursorPos = from_pos + length; } else { cursorPos = XmTextF_cursor_position(tf) - (to_pos - from_pos) + length; } XmDataFieldSetInsertionPosition((Widget)tf, cursorPos); } XmTextF_editable(tf) = save_editable; XmTextF_max_length(tf) = save_maxlength; /* * Replace Text utilizes an optimization in deciding which text to redraw; * in the case that the selection has been changed (as above), this can * cause part/all of the replaced text to NOT be redrawn. The following * df_AdjustText call ensures that it IS drawn in this case. */ if (deselected) df_AdjustText(tf, from_pos, True); (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, XtLastTimestampProcessed(XtDisplay(w))); if (rep_result) { cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *)NULL; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } _XmAppUnlock(app); } /* TOM - XmDataFieldReplaceWcs not converted */ void #ifdef _NO_PROTO XmDataFieldReplaceWcs( w, from_pos, to_pos, wc_value ) Widget w ; XmTextPosition from_pos ; XmTextPosition to_pos ; wchar_t *wc_value ; #else XmDataFieldReplaceWcs( Widget w, XmTextPosition from_pos, XmTextPosition to_pos, wchar_t *wc_value ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; int save_maxlength = XmTextF_max_length(tf); Boolean save_editable = XmTextF_editable(tf); Boolean deselected = False; Boolean rep_result = False; wchar_t *tmp_wc; char *tmp; int wc_length = 0; XmAnyCallbackStruct cb; _XmWidgetToAppContext(w); _XmAppLock(app); if (wc_value == NULL) wc_value = (wchar_t*)""; df_VerifyBounds(tf, &from_pos, &to_pos); if (XmTextF_has_primary(tf)) { if ((XmTextF_prim_pos_left(tf) > from_pos && XmTextF_prim_pos_left(tf) < to_pos) || (XmTextF_prim_pos_right(tf) >from_pos && XmTextF_prim_pos_right(tf) < to_pos) || (XmTextF_prim_pos_left(tf) <= from_pos && XmTextF_prim_pos_right(tf) >= to_pos)) { _XmDataFieldDeselectSelection(w, False, XtLastTimestampProcessed(XtDisplay(w))); deselected = True; } } /* Count the number of wide chars in the array */ for (wc_length = 0, tmp_wc = wc_value; *tmp_wc != (wchar_t)0L; wc_length++) tmp_wc++; /* count number of wchar_t's */ XmTextF_editable(tf) = True; XmTextF_max_length(tf) = INT_MAX; if (XmTextF_max_char_size(tf) != 1) { rep_result = _XmDataFieldReplaceText(tf, NULL, from_pos, to_pos, (char*)wc_value, wc_length, False); } else { /* need to convert to char* before calling Replace */ tmp = XtMalloc((unsigned) (wc_length + 1) * XmTextF_max_char_size(tf)); wc_length = wcstombs(tmp, wc_value, (wc_length + 1) * XmTextF_max_char_size(tf)); if (wc_length == (size_t) -1){ /* if wcstombs fails, it returns -1 */ tmp = ""; /* if invalid data, pass in the empty * string */ wc_length = 0; } rep_result = _XmDataFieldReplaceText(tf, NULL, from_pos, to_pos, (char*)tmp, wc_length, False); XtFree(tmp); } if (from_pos <= XmTextF_cursor_position(tf)) { XmTextPosition cursorPos; /* Replace will not move us, we still want this to happen */ if (XmTextF_cursor_position(tf) < to_pos) { if (XmTextF_cursor_position(tf) - from_pos <= wc_length) cursorPos = XmTextF_cursor_position(tf); else cursorPos = from_pos + wc_length; } else { cursorPos = XmTextF_cursor_position(tf) - (to_pos - from_pos) + wc_length; } XmDataFieldSetInsertionPosition((Widget)tf, cursorPos); } XmTextF_editable(tf) = save_editable; XmTextF_max_length(tf) = save_maxlength; /* * Replace Text utilizes an optimization in deciding which text to redraw; * in the case that the selection has been changed (as above), this can * cause part/all of the replaced text to NOT be redrawn. The following * df_AdjustText call ensures that it IS drawn in this case. */ if (deselected) df_AdjustText(tf, from_pos, True); (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, XtLastTimestampProcessed(XtDisplay(w))); if (rep_result) { cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *)NULL; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } _XmAppUnlock(app); } void #ifdef _NO_PROTO XmDataFieldInsert( w, position, value ) Widget w ; XmTextPosition position ; char *value ; #else XmDataFieldInsert( Widget w, XmTextPosition position, char *value ) #endif /* _NO_PROTO */ { _XmWidgetToAppContext(w); _XmAppLock(app); /* XmDataFieldReplace takes care of converting to wchar_t* if needed */ XmDataFieldReplace(w, position, position, value); _XmAppUnlock(app); } void #ifdef _NO_PROTO XmDataFieldInsertWcs( w, position, wcstring ) Widget w ; XmTextPosition position ; wchar_t *wcstring ; #else XmDataFieldInsertWcs( Widget w, XmTextPosition position, wchar_t *wcstring ) #endif /* _NO_PROTO */ { _XmWidgetToAppContext(w); _XmAppLock(app); /* XmDataFieldReplaceWcs takes care of converting to wchar_t* if needed */ XmDataFieldReplaceWcs(w, position, position, wcstring); _XmAppUnlock(app); } void #ifdef _NO_PROTO XmDataFieldSetAddMode( w, state ) Widget w ; Boolean state ; #else XmDataFieldSetAddMode( Widget w, Boolean state ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmTextF_add_mode(tf) == state) { _XmAppUnlock(app); return; } _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_add_mode(tf) = state; _XmDataFToggleCursorGC(w); _XmDataFieldDrawInsertionPoint(tf, True); _XmAppUnlock(app); } Boolean #ifdef _NO_PROTO XmDataFieldGetAddMode( w ) Widget w ; #else XmDataFieldGetAddMode( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = XmTextF_add_mode(tf); _XmAppUnlock(app); return (ret_val); } Boolean #ifdef _NO_PROTO XmDataFieldGetEditable( w ) Widget w ; #else XmDataFieldGetEditable( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = XmTextF_editable(tf); _XmAppUnlock(app); return ret_val; } void #ifdef _NO_PROTO XmDataFieldSetEditable( w, editable ) Widget w ; Boolean editable ; #else XmDataFieldSetEditable( Widget w, Boolean editable ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XPoint xmim_point; Arg args[6]; /* To set initial values to input method */ Cardinal n = 0; _XmWidgetToAppContext(w); _XmAppLock(app); /* if widget previously wasn't editable, no input method has yet been */ /* registered. So, if we're making it editable now, register the IM */ /* give the IM the relevent values. */ if (!XmTextF_editable(tf) && editable) { #if defined(__sgi) /* CR03685 */ SGI_hack_XmImRegister((Widget)tf); #else XmImRegister((Widget)tf, (unsigned int) NULL); #endif df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, &xmim_point.y); n = 0; XtSetArg(args[n], XmNfontList, XmTextF_font_list(tf)); n++; XtSetArg(args[n], XmNbackground, tf->core.background_pixel); n++; XtSetArg(args[n], XmNforeground, tf->primitive.foreground); n++; XtSetArg(args[n], XmNbackgroundPixmap,tf->core.background_pixmap);n++; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNlineSpace, XmTextF_font_ascent(tf)+ XmTextF_font_descent(tf)); n++; XmImSetValues((Widget)tf, args, n); } else if (XmTextF_editable(tf) && !editable){ XmImUnregister(w); } XmTextF_editable(tf) = editable; n = 0; if (editable) { XtSetArg(args[n], XmNdropSiteActivity, XmDROP_SITE_ACTIVE); n++; } else { XtSetArg(args[n], XmNdropSiteActivity, XmDROP_SITE_INACTIVE); n++; } XmDropSiteUpdate((Widget)tf, args, n); _XmAppUnlock(app); } int #ifdef _NO_PROTO XmDataFieldGetMaxLength( w ) Widget w ; #else XmDataFieldGetMaxLength( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; int ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = XmTextF_max_length(tf); _XmAppUnlock(app); return ret_val; } void #ifdef _NO_PROTO XmDataFieldSetMaxLength( w, max_length ) Widget w ; int max_length ; #else XmDataFieldSetMaxLength( Widget w, int max_length ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmTextF_max_length(tf) = max_length; _XmAppUnlock(app); } XmTextPosition #ifdef _NO_PROTO XmDataFieldGetCursorPosition( w ) Widget w ; #else XmDataFieldGetCursorPosition( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = XmTextF_cursor_position(tf); _XmAppUnlock(app); return ret_val; } XmTextPosition #ifdef _NO_PROTO XmDataFieldGetInsertionPosition( w ) Widget w ; #else XmDataFieldGetInsertionPosition( Widget w ) #endif /* _NO_PROTO */ { XmTextPosition ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = XmDataFieldGetCursorPosition(w); _XmAppUnlock(app); return ret_val; } /* Obsolete - shouldn't be here ! */ void #ifdef _NO_PROTO XmDataFielddf_SetCursorPosition( w, position ) Widget w ; XmTextPosition position ; #else XmDataFielddf_SetCursorPosition( Widget w, XmTextPosition position ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); df_SetCursorPosition(tf, NULL, position, True, False, False); _XmAppUnlock(app); } void #ifdef _NO_PROTO XmDataFieldSetInsertionPosition( w, position ) Widget w ; XmTextPosition position ; #else XmDataFieldSetInsertionPosition( Widget w, XmTextPosition position ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); df_SetCursorPosition(tf, NULL, position, True, True, False); _XmAppUnlock(app); } Boolean #ifdef _NO_PROTO XmDataFieldGetSelectionPosition( w, left, right ) Widget w ; XmTextPosition *left ; XmTextPosition *right ; #else XmDataFieldGetSelectionPosition( Widget w, XmTextPosition *left, XmTextPosition *right ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (!XmTextF_has_primary(tf)) { _XmAppUnlock(app); return False; } *left = XmTextF_prim_pos_left(tf); *right = XmTextF_prim_pos_right(tf); _XmAppUnlock(app); return True; } char * #ifdef _NO_PROTO XmDataFieldGetSelection( w ) Widget w ; #else XmDataFieldGetSelection( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; size_t length, num_chars; char *value; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmTextF_prim_pos_left(tf) == XmTextF_prim_pos_right(tf)) { _XmAppUnlock(app); return NULL; } num_chars = (size_t) (XmTextF_prim_pos_right(tf) \ - XmTextF_prim_pos_left(tf)); length = num_chars; if (XmTextF_max_char_size(tf) == 1) { value = XtMalloc((unsigned) num_chars + 1); (void) memcpy((void*)value, (void*)(XmTextF_value(tf) + XmTextF_prim_pos_left(tf)), num_chars); } else { value = XtMalloc((unsigned) ((num_chars + 1) * XmTextF_max_char_size(tf))); length = wcstombs(value, XmTextF_wc_value(tf) + XmTextF_prim_pos_left(tf), (num_chars + 1) * XmTextF_max_char_size(tf)); if (length == (size_t) -1) { length = 0; } else { for (length = 0;num_chars > 0; num_chars--) { length += mblen(&value[length], XmTextF_max_char_size(tf)); } } } value[length] = (char)'\0'; _XmAppUnlock(app); return value; } wchar_t * #ifdef _NO_PROTO XmDataFieldGetSelectionWcs( w ) Widget w ; #else XmDataFieldGetSelectionWcs( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; size_t length; wchar_t *wc_value; int return_val; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmTextF_prim_pos_left(tf) == XmTextF_prim_pos_right(tf)) { _XmAppUnlock(app); return NULL; } length = (size_t)(XmTextF_prim_pos_right(tf) - XmTextF_prim_pos_left(tf)); wc_value = (wchar_t*)XtMalloc((unsigned) (length + 1) * sizeof(wchar_t)); if (XmTextF_max_char_size(tf) == 1) { return_val = mbstowcs(wc_value, XmTextF_value(tf) + XmTextF_prim_pos_left(tf), length); if (return_val < 0) length = 0; } else { (void)memcpy((void*)wc_value, (void*)(XmTextF_wc_value(tf) + XmTextF_prim_pos_left(tf)), length * sizeof(wchar_t)); } wc_value[length] = (wchar_t)0L; _XmAppUnlock(app); return (wc_value); } Boolean #ifdef _NO_PROTO XmDataFieldRemove( w ) Widget w ; #else XmDataFieldRemove( Widget w ) #endif /* _NO_PROTO */ { Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = DataFieldRemove(w, NULL); _XmAppUnlock(app); return ret_val; } Boolean #ifdef _NO_PROTO XmDataFieldCopy( w, clip_time ) Widget w ; Time clip_time ; #else XmDataFieldCopy( Widget w, Time clip_time ) #endif /* _NO_PROTO */ { /* XmDataFieldGetSelection gets char* rep of data, so no special handling * needed */ char * selected_string = XmDataFieldGetSelection(w); /* text selection */ long item_id = 0L; /* clipboard item id */ long data_id = 0; /* clipboard data id */ int status = 0; /* clipboard status */ XmString clip_label; XTextProperty tmp_prop; Display *display = XtDisplay(w); Window window = XtWindow(w); char *atom_name; _XmWidgetToAppContext(w); _XmAppLock(app); /* using the clipboard facilities, copy the selected text to the clipboard */ if (selected_string != NULL) { clip_label = XmStringCreateLtoR ("XM_TEXT_FIELD", XmFONTLIST_DEFAULT_TAG); /* start copy to clipboard */ status = XmClipboardStartCopy(display, window, clip_label, clip_time, w, (XmCutPasteProc)NULL, &item_id); if (status != ClipboardSuccess) { XtFree(selected_string); XmStringFree(clip_label); _XmAppUnlock(app); return False; } status = XmbTextListToTextProperty(display, &selected_string, 1, (XICCEncodingStyle)XStdICCTextStyle, &tmp_prop); if (status != Success && status <= 0) { XmClipboardCancelCopy(display, window, item_id); XtFree(selected_string); XmStringFree(clip_label); _XmAppUnlock(app); return False; } atom_name = XGetAtomName(display, tmp_prop.encoding); /* move the data to the clipboard */ status = XmClipboardCopy(display, window, item_id, atom_name, (XtPointer)tmp_prop.value, tmp_prop.nitems, 0, &data_id); XtFree(atom_name); if (status != ClipboardSuccess) { XmClipboardCancelCopy(XtDisplay(w), XtWindow(w), item_id); XtFree(selected_string); XmStringFree(clip_label); _XmAppUnlock(app); return False; } /* end the copy to the clipboard */ status = XmClipboardEndCopy(display, window, item_id); XtFree((char*)tmp_prop.value); XmStringFree(clip_label); if (status != ClipboardSuccess) { XtFree (selected_string); _XmAppUnlock(app); return False; } } else { _XmAppUnlock(app); return False; } if (selected_string != NULL) { XtFree (selected_string); } _XmAppUnlock(app); return True; } Boolean #ifdef _NO_PROTO XmDataFieldCut( w, clip_time ) Widget w ; Time clip_time ; #else XmDataFieldCut( Widget w, Time clip_time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Boolean success = False; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmTextF_editable(tf) == False) { _XmAppUnlock(app); return False; } if (XmDataFieldCopy(w, clip_time)) { if (XmDataFieldRemove(w)) { success = True; } } _XmAppUnlock(app); return success; } /* * Retrieves the current data from the clipboard * and paste it at the current cursor position */ Boolean #ifdef _NO_PROTO XmDataFieldPaste( w ) Widget w ; #else XmDataFieldPaste( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition sel_left = 0; XmTextPosition sel_right = 0; XmTextPosition paste_pos_left, paste_pos_right; int status = 0; /* clipboard status */ char* buffer; /* temporary text buffer */ unsigned long length; /* length of buffer */ unsigned long outlength = 0L; /* length of bytes copied */ long private_id = 0; /* id of item on clipboard */ Boolean dest_disjoint = True; Boolean rep_status = False; /* did Replace succeed? */ Display *display = XtDisplay(w); Window window = XtWindow(w); Boolean get_ct = False; Boolean get_us = False; XTextProperty tmp_prop; int malloc_size = 0; int num_vals; char **tmp_value; int i; XmAnyCallbackStruct cb; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmTextF_editable(tf) == False) { _XmAppUnlock(app); return False; } paste_pos_left = paste_pos_right = XmTextF_cursor_position(tf); status = XmClipboardInquireLength(display, window, "STRING", &length); if (status == ClipboardNoData || length == 0) { status = XmClipboardInquireLength(display, window, "COMPOUND_TEXT", &length); if (status == ClipboardNoData || length == 0) { #ifdef UTF8_SUPPORTED status = XmClipboardInquireLength(display, window, XmSUTF8_STRING, &length); #endif if (status == ClipboardNoData || length == 0) { _XmAppUnlock(app); return False; } get_us = True; } else { get_ct = True; } } /* malloc length of clipboard data */ buffer = XtMalloc((unsigned) length); if (!get_ct && !get_us) { status = XmClipboardRetrieve(display, window, "STRING", buffer, length, &outlength, &private_id); } #ifdef UTF8_SUPPORTED else if (!get_ct && get_us) { status = XmClipboardRetrieve(display, window, XmSUTF8_STRING, buffer, length, &outlength, &private_id); } #endif else { status = XmClipboardRetrieve(display, window, "COMPOUND_TEXT", buffer, length, &outlength, &private_id); } if (status != ClipboardSuccess) { XmClipboardEndRetrieve(display, window); XtFree(buffer); _XmAppUnlock(app); return False; } if (XmDataFieldGetSelectionPosition(w, &sel_left, &sel_right)) { if (XmTextF_pending_delete(tf) && paste_pos_left >= sel_left && paste_pos_right <= sel_right) { paste_pos_left = sel_left; paste_pos_right = sel_right; dest_disjoint = False; } } tmp_prop.value = (unsigned char *) buffer; if (!get_ct) { tmp_prop.encoding = XA_STRING; } else { tmp_prop.encoding = XmInternAtom(display, "COMPOUND_TEXT", False); } tmp_prop.format = 8; tmp_prop.nitems = outlength; num_vals = 0; status = XmbTextPropertyToTextList(display, &tmp_prop, &tmp_value, &num_vals); /* add new text */ if (num_vals && (status == Success || status > 0)) { if (XmTextF_max_char_size(tf) == 1) { char * total_tmp_value; for (i = 0, malloc_size = 1; i < num_vals ; i++) { malloc_size += strlen(tmp_value[i]); } total_tmp_value = XtMalloc ((unsigned) malloc_size); total_tmp_value[0] = '\0'; for (i = 0; i < num_vals ; i++) { strcat(total_tmp_value, tmp_value[i]); } rep_status = _XmDataFieldReplaceText(tf, NULL, paste_pos_left, paste_pos_right, total_tmp_value, strlen(total_tmp_value), True); XFreeStringList(tmp_value); if (malloc_size) XtFree(total_tmp_value); } else { wchar_t * wc_value; int num_chars = 0; for (i = 0, malloc_size = sizeof(wchar_t); i < num_vals ; i++) { malloc_size += strlen(tmp_value[i]); } wc_value = (wchar_t*)XtMalloc((unsigned)malloc_size * sizeof(wchar_t)); /* change malloc_size to the number of wchars available in wc_value */ for (i = 0; i < num_vals ; i++) num_chars += mbstowcs(wc_value + num_chars, tmp_value[i], (size_t)malloc_size - num_chars); rep_status = _XmDataFieldReplaceText(tf, NULL, paste_pos_left, paste_pos_right, (char*)wc_value, num_chars, True); if (malloc_size) XtFree((char*)wc_value); } } if (rep_status) { XmTextF_prim_anchor(tf) = sel_left; (void) df_SetDestination(w, XmTextF_cursor_position(tf), False, XtLastTimestampProcessed(display)); if (sel_left != sel_right) { if (!dest_disjoint || !XmTextF_add_mode(tf)) { XmDataFieldSetSelection(w, XmTextF_cursor_position(tf), XmTextF_cursor_position(tf), XtLastTimestampProcessed(display)); } } cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *)NULL; XtCallCallbackList((Widget) tf, XmTextF_value_changed_callback(tf), (XtPointer) &cb); } XtFree(buffer); _XmAppUnlock(app); return True; } void #ifdef _NO_PROTO XmDataFielddf_ClearSelection( w, sel_time ) Widget w ; Time sel_time ; #else XmDataFielddf_ClearSelection( Widget w, Time sel_time ) #endif /* _NO_PROTO */ { _XmWidgetToAppContext(w); _XmAppLock(app); _XmDataFieldDeselectSelection(w, False, sel_time); _XmAppUnlock(app); } void #ifdef _NO_PROTO XmDataFieldSetSelection( w, first, last, sel_time ) Widget w ; XmTextPosition first ; XmTextPosition last ; Time sel_time ; #else XmDataFieldSetSelection( Widget w, XmTextPosition first, XmTextPosition last, Time sel_time ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); _XmDataFieldStartSelection(tf, first, last, sel_time); XmTextF_pending_off(tf) = False; df_SetCursorPosition(tf, NULL, last, True, True, False); _XmAppUnlock(app); } /* ARGSUSED */ XmTextPosition #ifdef _NO_PROTO XmDataFieldXYToPos( w, x, y ) Widget w ; Position x ; Position y ; #else XmDataFieldXYToPos( Widget w, Position x, Position y ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = df_GetPosFromX(tf, x); _XmAppUnlock(app); return(ret_val); } Boolean #ifdef _NO_PROTO XmDataFieldPosToXY( w, position, x, y ) Widget w ; XmTextPosition position ; Position *x ; Position *y ; #else XmDataFieldPosToXY( Widget w, XmTextPosition position, Position *x, Position *y ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = df_GetXYFromPos(tf, position, x, y); _XmAppUnlock(app); return(ret_val); } /* * Force the given position to be displayed. If position < 0, then don't force * any position to be displayed. */ void #ifdef _NO_PROTO XmDataFieldShowPosition( w, position ) Widget w ; XmTextPosition position ; #else XmDataFieldShowPosition( Widget w, XmTextPosition position ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (position < 0) { _XmAppUnlock(app); return; } df_AdjustText(tf, position, True); _XmAppUnlock(app); } /* ARGSUSED */ void #ifdef _NO_PROTO XmDataFieldSetHighlight( w, left, right, mode ) Widget w ; XmTextPosition left ; XmTextPosition right ; XmHighlightMode mode ; #else XmDataFieldSetHighlight( Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (left >= right || right <= 0) { _XmAppUnlock(app); return; } if (left < 0) left = 0; if (right > XmTextF_string_length(tf)) { right = XmTextF_string_length(tf); } DataFieldSetHighlight(tf, left, right, mode); df_RedisplayText(tf, left, right); _XmAppUnlock(app); } /* ARGSUSED */ static Boolean #ifdef _NO_PROTO DataFieldGetBaselines( w, baselines, line_count ) Widget w ; Dimension ** baselines; int *line_count; #else DataFieldGetBaselines( Widget w, Dimension ** baselines, int *line_count ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Dimension *base_array; _XmWidgetToAppContext(w); _XmAppLock(app); *line_count = 1; base_array = (Dimension *) XtMalloc(sizeof(Dimension)); base_array[0] = XmTextF_margin_top(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness + XmTextF_font_ascent(tf); *baselines = base_array; _XmAppUnlock(app); return (TRUE); } int #ifdef _NO_PROTO XmDataFieldGetBaseline( w ) Widget w ; #else XmDataFieldGetBaseline( Widget w ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Dimension margin_top; int ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); margin_top = XmTextF_margin_top(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; ret_val = (int) margin_top + (int) XmTextF_font_ascent(tf); _XmAppUnlock(app); return(ret_val); } static Boolean #ifdef _NO_PROTO DataFieldGetDisplayRect( w, display_rect ) Widget w; XRectangle * display_rect; #else DataFieldGetDisplayRect( Widget w, XRectangle * display_rect ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Position margin_width = XmTextF_margin_width(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Position margin_top = XmTextF_margin_top(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Position margin_bottom = XmTextF_margin_bottom(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; (*display_rect).x = margin_width; (*display_rect).y = margin_top; (*display_rect).width = tf->core.width - (2 * margin_width); (*display_rect).height = tf->core.height - (margin_top + margin_bottom); return(TRUE); } /* ARGSUSED */ static void #ifdef _NO_PROTO DataFieldMarginsProc( w, margins_rec ) Widget w ; XmBaselineMargins *margins_rec; #else DataFieldMarginsProc( Widget w, XmBaselineMargins *margins_rec ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; if (margins_rec->get_or_set == XmBASELINE_SET) { XmTextF_margin_top(tf) = margins_rec->margin_top; XmTextF_margin_bottom(tf) = margins_rec->margin_bottom; } else { margins_rec->margin_top = XmTextF_margin_top(tf); margins_rec->margin_bottom = XmTextF_margin_bottom(tf); margins_rec->text_height = XmTextF_font_ascent(tf) + XmTextF_font_descent(tf); margins_rec->shadow = tf->primitive.shadow_thickness; margins_rec->highlight = tf->primitive.highlight_thickness; } } /* * Text Field w creation convienence routine. */ Widget #ifdef _NO_PROTO XmCreateDataField( parent, name, arglist, argcount ) Widget parent ; char *name ; ArgList arglist ; Cardinal argcount ; #else XmCreateDataField( Widget parent, char *name, ArgList arglist, Cardinal argcount ) #endif /* _NO_PROTO */ { return (XtCreateWidget(name, xmDataFieldWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateDataField( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDataFieldWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedDataField( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDataFieldWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/XmIm.h0000644000175000017500000000555312672140200011742 00000000000000/* $XConsortium: XmIm.h /main/7 1996/05/21 12:13:36 pascale $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmIm_h #define _XmIm_h #include #ifdef __cplusplus extern "C" { #endif /******** Public Function Declarations ********/ extern void XmImRegister( Widget w, unsigned int reserved) ; extern void XmImUnregister( Widget w) ; extern void XmImSetFocusValues( Widget w, ArgList args, Cardinal num_args) ; extern void XmImSetValues( Widget w, ArgList args, Cardinal num_args) ; extern void XmImUnsetFocus( Widget w) ; extern XIM XmImGetXIM( Widget w) ; extern void XmImCloseXIM( Widget w) ; extern int XmImMbLookupString( Widget w, XKeyPressedEvent *event, char *buf, int nbytes, KeySym *keysym, int *status) ; extern void XmImVaSetFocusValues( Widget w, ...) ; extern void XmImVaSetValues( Widget w, ...) ; extern XIC XmImGetXIC( Widget w, #if NeedWidePrototypes unsigned int input_policy, #else XmInputPolicy input_policy, #endif /*NeedWidePrototypes*/ ArgList args, Cardinal num_args) ; extern XIC XmImSetXIC( Widget w, XIC input_context) ; extern void XmImFreeXIC( Widget w, XIC input_context) ; extern void XmImMbResetIC( Widget w, char **mb); extern XIMResetState XmImGetXICResetState( Widget w); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIm_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PushBG.h0000644000175000017500000000427513145162623012231 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /*********************************************************************** * * PushButton Widget * ***********************************************************************/ #ifndef _XmPButtonG_h #define _XmPButtonG_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsPushButtonGadget #define XmIsPushButtonGadget(w) XtIsSubclass(w, xmPushButtonGadgetClass) #endif /* XmIsPushButtonGadget */ externalref WidgetClass xmPushButtonGadgetClass; typedef struct _XmPushButtonGadgetClassRec *XmPushButtonGadgetClass; typedef struct _XmPushButtonGadgetRec *XmPushButtonGadget; typedef struct _XmPushButtonGCacheObjRec *XmPushButtonGCacheObject; /******** Public Function Declarations ********/ extern Widget XmCreatePushButtonGadget( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern Widget XmVaCreatePushButtonGadget( Widget parent, char *name, ...); extern Widget XmVaCreateManagedPushButtonGadget( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPButtonG_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TearOffI.h0000644000175000017500000000533112672140200012521 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: TearOffI.h /main/5 1995/07/13 18:02:12 drk $ */ #ifndef _XmTearOffI_h #define _XmTearOffI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmTearOffBtnDownEventHandler( Widget reportingWidget, XtPointer data, XEvent *event, Boolean *cont) ; extern void _XmTearOffBtnUpEventHandler( Widget reportingWidget, XtPointer data, XEvent *event, Boolean *cont) ; extern void _XmDestroyTearOffShell( Widget wid) ; extern void _XmDismissTearOff( Widget shell, XtPointer closure, XtPointer call_data) ; extern void _XmTearOffInitiate( Widget wid, XEvent *event) ; extern void _XmAddTearOffEventHandlers( Widget wid) ; extern Boolean _XmIsTearOffShellDescendant( Widget wid) ; extern void _XmLowerTearOffObscuringPoppingDownPanes( Widget ancestor, Widget tearOff ) ; extern void _XmRestoreExcludedTearOffToToplevelShell( Widget wid, XEvent *event) ; extern void _XmRestoreTearOffToToplevelShell( Widget wid, XEvent *event) ; extern void _XmRestoreTearOffToMenuShell( Widget wid, XEvent *event) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTearOffI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/GMUtilsI.h0000644000175000017500000000732313145162623012533 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmGMUtilsI_h #define _XmGMUtilsI_h /* Include files: */ #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmGMCalcSize( XmManagerWidget manager, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ Dimension *replyWidth, Dimension *replyHeight) ; extern Boolean _XmGMDoLayout( XmManagerWidget manager, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ int resize_policy, #if NeedWidePrototypes int queryonly) ; #else Boolean queryonly) ; #endif /* NeedWidePrototypes */ extern void _XmGMEnforceMargin( XmManagerWidget manager, #if NeedWidePrototypes int margin_width, int margin_height, int setvalue) ; #else Dimension margin_width, Dimension margin_height, Boolean setvalue) ; #endif /* NeedWidePrototypes */ extern XtGeometryResult _XmGMHandleQueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ int resize_policy) ; extern Boolean _XmGMOverlap( XmManagerWidget manager, Widget w) ; extern XtGeometryResult _XmGMHandleGeometryManager( Widget parent, Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ int resize_policy, int allow_overlap) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGMUtilsI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DataF.h0000644000175000017500000000744012672140200012044 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmDataF_h #define _XmDataF_h #include #include #include #if defined(__cplusplus) extern "C" { #endif typedef struct _XmDataFieldClassRec *XmDataFieldWidgetClass; typedef struct _XmDataFieldRec *XmDataFieldWidget; /* Function Name: XmCreateDataField * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateDataField( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); /* * Variable argument list functions */ extern Widget XmVaCreateDataField( Widget parent, char *name, ...); extern Widget XmVaCreateManagedDataField( Widget parent, char *name, ...); Boolean _XmDataFieldReplaceText( #ifndef _NO_PROTO XmDataFieldWidget, XEvent*, XmTextPosition, XmTextPosition, char*, int, Boolean #endif ); void XmDataFieldSetString( #ifndef _NO_PROTO Widget, char* #endif ); extern char * XmDataFieldGetString( #ifndef _NO_PROTO Widget #endif ); extern wchar_t * XmDataFieldGetStringWcs( #ifndef _NO_PROTO Widget #endif ); void _XmDataFieldSetClipRect( #ifndef _NO_PROTO XmDataFieldWidget #endif ); void _XmDataFieldDrawInsertionPoint( #ifndef _NO_PROTO XmDataFieldWidget, Boolean #endif ); void XmDataFieldSetHighlight( #ifndef _NO_PROTO Widget, XmTextPosition, XmTextPosition, XmHighlightMode #endif ); void XmDataFieldSetAddMode( #ifndef _NO_PROTO Widget, Boolean #endif ); char * XmDataFieldGetSelection( #ifndef _NO_PROTO Widget #endif ); void XmDataFieldSetSelection( #ifndef _NO_PROTO Widget, XmTextPosition, XmTextPosition, Time #endif ); void _XmDataFieldSetSel2( #ifndef _NO_PROTO Widget, XmTextPosition, XmTextPosition, Boolean, Time #endif ); Boolean XmDataFieldGetSelectionPosition( #ifndef _NO_PROTO Widget, XmTextPosition *, XmTextPosition * #endif ); XmTextPosition XmDataFieldXYToPos( #ifndef _NO_PROTO Widget, Position, Position #endif ); void XmDataFieldShowPosition( #ifndef _NO_PROTO Widget, XmTextPosition #endif ); Boolean XmDataFieldCut( #ifndef _NO_PROTO Widget, Time #endif ); Boolean XmDataFieldCopy( #ifndef _NO_PROTO Widget, Time #endif ); Boolean XmDataFieldPaste( #ifndef _NO_PROTO Widget #endif ); void XmDataFieldSetEditable( #ifndef _NO_PROTO Widget, Boolean #endif ); void XmDataFieldSetInsertionPosition( #ifndef _NO_PROTO Widget, XmTextPosition #endif ); extern WidgetClass xmDataFieldWidgetClass; typedef struct _XmDataFieldCallbackStruct { Widget w; /* The XmDataField */ String text; /* Proposed string */ Boolean accept; /* Accept return value, for validation */ } XmDataFieldCallbackStruct; #if defined(__cplusplus) } /* extern "C" */ #endif #endif /* _XmDataF_h */ motif-2.3.8/lib/Xm/EditresComI.h0000644000175000017500000000046512672140200013234 00000000000000 #ifndef _XmEditresComI_h #define _XmEditresComI_h #include #ifdef __cplusplus extern "C" { #endif void _XmEditResCheckMessages(Widget w, XtPointer data, XEvent event, Boolean cont); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif motif-2.3.8/lib/Xm/SelectioB.h0000644000175000017500000000530513145162623012745 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmSelectionBox_h #define _XmSelectionBox_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmSelectionBoxWidgetClass; typedef struct _XmSelectionBoxClassRec * XmSelectionBoxWidgetClass; typedef struct _XmSelectionBoxRec * XmSelectionBoxWidget; #ifndef XmIsSelectionBox #define XmIsSelectionBox(w) (XtIsSubclass (w, xmSelectionBoxWidgetClass)) #endif /******** Public Function Declarations ********/ extern Widget XmSelectionBoxGetChild( Widget sb, #if NeedWidePrototypes unsigned int which) ; #else unsigned char which) ; #endif /* NeedWidePrototypes */ extern Widget XmCreateSelectionBox( Widget p, String name, ArgList args, Cardinal n) ; extern Widget XmCreateSelectionDialog( Widget ds_p, String name, ArgList sb_args, Cardinal sb_n) ; extern Widget XmCreatePromptDialog( Widget ds_p, String name, ArgList sb_args, Cardinal sb_n) ; /* * Variable argument list functions */ extern Widget XmVaCreateSelectionBox( Widget parent, char *name, ...); extern Widget XmVaCreateManagedSelectionBox( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSelectionBox_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DisplayP.h0000644000175000017500000001065713145162623012627 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDisplayP_h #define _XmDisplayP_h #include #include #include #include #include /* A little incest */ #include #include #include #ifdef __cplusplus extern "C" { #endif typedef Widget (*XmDisplayGetDisplayProc)(Display *); typedef struct { XmDisplayGetDisplayProc GetDisplay; XtPointer extension; } XmDisplayClassPart; /* * we make it a appShell subclass so it can have it's own instance * hierarchy */ typedef struct _XmDisplayClassRec{ CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; WMShellClassPart wm_shell_class; VendorShellClassPart vendor_shell_class; TopLevelShellClassPart top_level_shell_class; ApplicationShellClassPart application_shell_class; XmDisplayClassPart display_class; } XmDisplayClassRec; typedef struct _XmModalDataRec{ Widget wid; XmVendorShellExtObject ve; XmVendorShellExtObject grabber; Boolean exclusive; Boolean springLoaded; } XmModalDataRec, *XmModalData; typedef struct { unsigned char dragInitiatorProtocolStyle; unsigned char dragReceiverProtocolStyle; unsigned char userGrabbed; /* flag for menu vs dnd */ WidgetClass dragContextClass; WidgetClass dropTransferClass; WidgetClass dropSiteManagerClass; XmDragContext activeDC; XmDropSiteManagerObject dsm; Time lastDragTime; Window proxyWindow; XmModalData modals; Cardinal numModals; Cardinal maxModals; XtPointer xmim_info; String bindingsString; XmVKeyBindingRec *bindings; XKeyEvent *lastKeyEvent; /* unused */ unsigned char keycode_tag[XmKEYCODE_TAG_SIZE]; /* unused */ int shellCount; XtPointer displayInfo; /* extension */ XtPointer user_data; int motif_version ; XtEnum enable_warp ; Cardinal num_bindings; XtCallbackList dragStartCallback; XtCallbackList noFontCallback; XtCallbackList noRenditionCallback; Boolean displayHasShapeExtension; XtEnum enable_btn1_transfer ; Boolean enable_button_tab ; Boolean enable_etched_in_menu; Boolean default_button_emphasis; Boolean enable_toggle_color; Boolean enable_toggle_visual; Boolean enable_drag_icon; Boolean enable_unselectable_drag; Boolean enable_thin_thickness; Boolean enable_multi_key_bindings; } XmDisplayPart, *XmDisplayPartPtr; typedef struct _XmDisplayInfo { /* so much for information hiding */ Cursor SashCursor; /* Sash.c */ Widget destinationWidget; /* Dest.c */ Cursor TearOffCursor; /* TearOff.c */ XtPointer UniqueStamp; /* UniqueEvnt.c */ XmExcludedParentPaneRec excParentPane;/* TearOff.c */ unsigned short resetFocusFlag; /* TravAct.c */ Boolean traversal_in_progress; /* Traversal.c */ } XmDisplayInfo; typedef struct _XmDisplayRec{ CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; VendorShellPart vendor; TopLevelShellPart topLevel; ApplicationShellPart application; XmDisplayPart display; } XmDisplayRec; externalref XmDisplayClassRec xmDisplayClassRec; externalref String _Xm_MOTIF_DRAG_AND_DROP_MESSAGE ; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDisplayP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/ArrowB.c0000644000175000017500000006274613145162623012277 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: ArrowB.c /main/16 1995/10/25 19:50:57 cde-sun $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "PrimitiveI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "TravActI.h" #include "TraversalI.h" #include "XmI.h" #define DELAY_DEFAULT 100 /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc); static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void GetArrowGC( XmArrowButtonWidget aw); static void Redisplay( Widget wid, XEvent *event, Region region); static void Destroy( Widget w); static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void Arm( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void MultiArm( Widget aw, XEvent *event, String *params, Cardinal *num_params); static void Activate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params); static void MultiActivate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params); static void ActivateCommon( Widget wid, XEvent *buttonEvent); static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ArmTimeout( XtPointer closure, XtIntervalId *id); static void Disarm( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void Enter( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void Leave( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ChangeCB(Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset); static void DrawArrow(XmArrowButtonWidget aw, GC top_gc, GC bottom_gc, GC center_gc); /******** End Static Function Declarations ********/ /* Default translation table and action list */ #define defaultTranslations _XmArrowB_defaultTranslations static XtActionsRec actionsList[] = { { "Activate", Activate }, { "MultiActivate", MultiActivate }, { "Arm", Arm }, { "MultiArm", MultiArm }, { "Disarm", Disarm }, { "ArmAndActivate", ArmAndActivate }, { "Enter", Enter }, { "Leave", Leave }, { "ButtonTakeFocus", _XmButtonTakeFocus } }; /* Resource list for ArrowButton */ static XtResource resources[] = { { XmNmultiClick, XmCMultiClick, XmRMultiClick, sizeof(unsigned char), XtOffsetOf( struct _XmArrowButtonRec, arrowbutton.multiClick), XmRImmediate, (XtPointer) XmMULTICLICK_KEEP }, { XmNarrowDirection, XmCArrowDirection, XmRArrowDirection, sizeof(unsigned char), XtOffsetOf( struct _XmArrowButtonRec, arrowbutton.direction), XmRImmediate, (XtPointer) XmARROW_UP }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmArrowButtonRec, arrowbutton.activate_callback), XmRPointer, (XtPointer) NULL }, { XmNarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmArrowButtonRec, arrowbutton.arm_callback), XmRPointer, (XtPointer) NULL }, { XmNdisarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmArrowButtonRec, arrowbutton.disarm_callback), XmRPointer, (XtPointer) NULL }, { XmNdetailShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmArrowButtonRec, arrowbutton.detail_shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness } }; static XmSyntheticResource syn_resources[] = { { XmNdetailShadowThickness, sizeof(Dimension), XtOffsetOf(XmArrowButtonRec, arrowbutton.detail_shadow_thickness), XmeFromHorizontalPixels,XmeToHorizontalPixels } }; /* The ArrowButton class record definition */ externaldef (xmarrowbuttonclassrec) XmArrowButtonClassRec xmArrowButtonClassRec= { { /* Core fields */ (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "XmArrowButton", /* class_name */ sizeof(XmArrowButtonRec), /* widget_size */ (XtProc)NULL, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ (XtWidgetProc)NULL, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* version */ (XtPointer)NULL, /* callback private */ defaultTranslations, /* tm_table */ (XtGeometryHandler)NULL, /* query_geometry */ (XtStringProc)NULL, /* display_accelerator */ (XtPointer)NULL /* extension */ }, { /* XmPrimitive fields */ XmInheritBorderHighlight, /* Primitive border_highlight */ XmInheritBorderUnhighlight, /* Primitive border_unhighlight */ XtInheritTranslations, /* translations */ ArmAndActivate, /* arm_and_activate */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ (XtPointer) NULL /* extension */ }, { /* XmArrowButtonWidget fields */ (XtPointer) NULL /* extension */ } }; externaldef(xmarrowbuttonwidgetclass) WidgetClass xmArrowButtonWidgetClass = (WidgetClass) &xmArrowButtonClassRec; /* Trait record for arrowButton */ static XmConst XmActivatableTraitRec arrowButtonAT = { 0, /* version */ ChangeCB /* changeCB */ }; /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmARROW_BUTTON_BIT); /* Install the activatable trait for all subclasses */ XmeTraitSet((XtPointer)wc, XmQTactivatable, (XtPointer) &arrowButtonAT); } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmArrowButtonWidget request = (XmArrowButtonWidget) rw; XmArrowButtonWidget new_w = (XmArrowButtonWidget) nw; /* * Check the data put into the new widget from .Xdefaults * or through the arg list. */ if (!XmRepTypeValidValue(XmRID_ARROW_DIRECTION, new_w->arrowbutton.direction, (Widget) new_w)) { new_w->arrowbutton.direction = XmARROW_UP; } /* Set up a geometry for the widget if it is currently 0. */ if (request->core.width == 0) new_w->core.width += 15; if (request->core.height == 0) new_w->core.height += 15; /* Set the internal arrow variables */ new_w->arrowbutton.timer = 0; new_w->arrowbutton.selected = False; /* Get the drawing graphics contexts. */ GetArrowGC (new_w); } /************************************************************************ * * GetArrowGC * Get the graphics context used for drawing the arrowbutton. * ************************************************************************/ static void GetArrowGC( XmArrowButtonWidget aw ) { XGCValues values; XtGCMask valueMask, unusedMask; valueMask = GCForeground | GCBackground | GCGraphicsExposures; unusedMask = GCClipXOrigin | GCClipYOrigin | GCFont; values.foreground = aw->primitive.foreground; values.background = aw->core.background_pixel; values.graphics_exposures = False; aw->arrowbutton.arrow_GC = XtAllocateGC((Widget) aw, 0, valueMask, &values, GCClipMask, unusedMask); valueMask |= GCFillStyle | GCStipple; values.fill_style = FillOpaqueStippled; values.stipple = _XmGetInsensitiveStippleBitmap((Widget) aw); aw->arrowbutton.insensitive_GC = XtAllocateGC((Widget) aw, 0, valueMask, &values, GCClipMask, unusedMask); } /************************************************************************ * * Redisplay * General redisplay function called on exposure events. * ************************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; int iwidth, iheight; XtExposeProc expose; iwidth = (int) aw->core.width - 2 * aw->primitive.highlight_thickness; iheight = (int) aw->core.height - 2 * aw->primitive.highlight_thickness; /* Draw the arrow */ if ((iwidth > 0) && (iheight > 0)) { if (aw->primitive.shadow_thickness > 0) XmeDrawShadows(XtDisplay (aw), XtWindow (aw), aw->primitive.top_shadow_GC, aw->primitive.bottom_shadow_GC, aw->primitive.highlight_thickness, aw->primitive.highlight_thickness, aw->core.width - 2 * aw->primitive.highlight_thickness, aw->core.height - 2 * aw->primitive.highlight_thickness, aw->primitive.shadow_thickness, XmSHADOW_OUT); if (aw->arrowbutton.selected && XtIsSensitive(wid)) DrawArrow(aw, aw->primitive.bottom_shadow_GC, aw->primitive.top_shadow_GC, aw->arrowbutton.arrow_GC); else DrawArrow(aw, aw->primitive.top_shadow_GC, aw->primitive.bottom_shadow_GC, (XtIsSensitive(wid) ? aw->arrowbutton.arrow_GC : aw->arrowbutton.insensitive_GC)); } /* Envelop our superclass expose method */ _XmProcessLock(); expose = xmPrimitiveClassRec.core_class.expose; _XmProcessUnlock(); (*(expose)) ((Widget) aw, event, region); } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget w ) { XmArrowButtonWidget aw = (XmArrowButtonWidget) w; if (aw->arrowbutton.timer) XtRemoveTimeOut(aw->arrowbutton.timer); XtReleaseGC(w, aw->arrowbutton.arrow_GC); XtReleaseGC(w, aw->arrowbutton.insensitive_GC); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmArrowButtonWidget current = (XmArrowButtonWidget) cw; XmArrowButtonWidget new_w = (XmArrowButtonWidget) nw; Boolean returnFlag = FALSE; /* Check the data put into the new widget. */ if (!XmRepTypeValidValue(XmRID_ARROW_DIRECTION, new_w->arrowbutton.direction, (Widget) new_w)) { new_w->arrowbutton.direction = current->arrowbutton.direction; } /* See if the GC's need to be regenerated and widget redrawn. */ if (new_w->core.background_pixel != current->core.background_pixel || new_w->primitive.foreground != current->primitive.foreground) { returnFlag = TRUE; XtReleaseGC ((Widget) new_w, new_w->arrowbutton.arrow_GC); XtReleaseGC ((Widget) new_w, new_w->arrowbutton.insensitive_GC); GetArrowGC (new_w); } if (new_w->arrowbutton.direction != current->arrowbutton.direction || XtIsSensitive(nw) != XtIsSensitive(cw) || new_w->primitive.highlight_thickness != current->primitive.highlight_thickness || new_w->primitive.shadow_thickness != current->primitive.shadow_thickness) { returnFlag = TRUE; } return (returnFlag); } /************************************************************************ * * Arm * This function processes button 1 down occuring on the arrowButton. * ************************************************************************/ /*ARGSUSED*/ static void Arm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; XmArrowButtonCallbackStruct call_value; (void) XmProcessTraversal((Widget) aw, XmTRAVERSE_CURRENT); aw->arrowbutton.selected = True; aw->arrowbutton.armTimeStamp = event->xbutton.time; /* see MultiActivate */ DrawArrow(aw, aw->primitive.bottom_shadow_GC, aw->primitive.top_shadow_GC, NULL); if (aw->arrowbutton.arm_callback) { XFlush(XtDisplay(aw)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget) aw, aw->arrowbutton.arm_callback, &call_value); } } static void MultiArm( Widget aw, XEvent *event, String *params, Cardinal *num_params) { if (((XmArrowButtonWidget) aw)->arrowbutton.multiClick == XmMULTICLICK_KEEP) Arm(aw, event, params, num_params); } /************************************************************************ * * Activate * This function processes button 1 up occuring on the arrowButton. * If the button 1 up occurred inside the button the activate * callbacks are called. * ************************************************************************/ /*ARGSUSED*/ static void Activate( Widget wid, XEvent *buttonEvent, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; if (aw->arrowbutton.selected == False) return; aw->arrowbutton.click_count = 1; ActivateCommon((Widget) aw, buttonEvent); } static void MultiActivate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params) { /* When a multi click sequence occurs and the user Button Presses and * holds for a length of time, the final release should look like a * new/separate activate. */ XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; if (aw->arrowbutton.multiClick == XmMULTICLICK_KEEP) { if ((buttonEvent->xbutton.time - aw->arrowbutton.armTimeStamp) > XtGetMultiClickTime(XtDisplay(aw))) aw->arrowbutton.click_count = 1; else aw->arrowbutton.click_count++; ActivateCommon((Widget) aw, buttonEvent); Disarm ((Widget) aw, buttonEvent, params, num_params); } } static void ActivateCommon( Widget wid, XEvent *buttonEvent) { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; XmArrowButtonCallbackStruct call_value; aw->arrowbutton.selected = False; DrawArrow(aw, aw->primitive.top_shadow_GC, aw->primitive.bottom_shadow_GC, NULL); /* CR 9181: Consider clipping when testing visibility. */ if (((buttonEvent->xany.type == ButtonPress) || (buttonEvent->xany.type == ButtonRelease)) && _XmGetPointVisibility(wid, buttonEvent->xbutton.x_root, buttonEvent->xbutton.y_root) && (aw->arrowbutton.activate_callback)) { XFlush(XtDisplay(aw)); call_value.reason = XmCR_ACTIVATE; call_value.event = buttonEvent; call_value.click_count = aw->arrowbutton.click_count; if ((aw->arrowbutton.multiClick == XmMULTICLICK_DISCARD) && (call_value.click_count > 1)) return; XtCallCallbackList((Widget) aw, aw->arrowbutton.activate_callback, &call_value); } } /************************************************************************ * * ArmAndActivate * ************************************************************************/ /*ARGSUSED*/ static void ArmAndActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmArrowButtonWidget ab = (XmArrowButtonWidget) wid; XmArrowButtonCallbackStruct call_value; XtExposeProc expose; ab->arrowbutton.selected = TRUE; _XmProcessLock(); expose = ab->core.widget_class->core_class.expose; _XmProcessUnlock(); (*(expose)) ((Widget) ab, event, FALSE); XFlush (XtDisplay (ab)); if (ab->arrowbutton.arm_callback) { call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget)ab, ab->arrowbutton.arm_callback, &call_value); } call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = 1; /* always 1 in kselect */ if (ab->arrowbutton.activate_callback) { XFlush (XtDisplay (ab)); XtCallCallbackList((Widget)ab,ab->arrowbutton.activate_callback, &call_value); } ab->arrowbutton.selected = FALSE; if (ab->arrowbutton.disarm_callback) { XFlush (XtDisplay (ab)); call_value.reason = XmCR_DISARM; XtCallCallbackList((Widget) ab, ab->arrowbutton.disarm_callback, &call_value); } /* If the button is still around, show it released after a short delay */ if (ab->core.being_destroyed == False) { ab->arrowbutton.timer = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)ab), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)ab); } } /* ARGSUSED */ static void ArmTimeout( XtPointer closure, XtIntervalId *id ) { XmArrowButtonWidget ab = (XmArrowButtonWidget) closure; ab->arrowbutton.timer = 0; if (XtIsRealized((Widget)ab) && XtIsManaged((Widget)ab)) { XtExposeProc expose; _XmProcessLock(); expose = ab->core.widget_class->core_class.expose; _XmProcessUnlock(); (*(expose)) ((Widget) ab, NULL, FALSE); XFlush (XtDisplay (ab)); } } /************************************************************************ * * Disarm * This function processes button 1 up occuring on the arrowButton. * ************************************************************************/ /*ARGSUSED*/ static void Disarm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; XmArrowButtonCallbackStruct call_value; aw->arrowbutton.selected = False; DrawArrow(aw, aw->primitive.top_shadow_GC, aw->primitive.bottom_shadow_GC, NULL); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList((Widget) aw, aw->arrowbutton.disarm_callback, &call_value); } /************************************************************************ * * Enter * ************************************************************************/ static void Enter( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; _XmPrimitiveEnter (wid, event, params, num_params); if (aw->arrowbutton.selected && XtIsSensitive(wid)) DrawArrow(aw, aw->primitive.bottom_shadow_GC, aw->primitive.top_shadow_GC, NULL); } /************************************************************************ * * Leave * ************************************************************************/ static void Leave( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmArrowButtonWidget aw = (XmArrowButtonWidget) wid; _XmPrimitiveLeave (wid, event, params, num_params); if (aw->arrowbutton.selected && XtIsSensitive(wid)) DrawArrow(aw, aw->primitive.top_shadow_GC, aw->primitive.bottom_shadow_GC, NULL); } /************************************************************************ * * ChangeCB * add or remove the activate callback list. * ************************************************************************/ static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) { if (setunset) XtAddCallback (w, XmNactivateCallback, activCB, closure); else XtRemoveCallback (w, XmNactivateCallback, activCB, closure); } /************************************************************************ * * XmCreateArrowButton * Create an instance of an arrowbutton and return the widget id. * ************************************************************************/ Widget XmCreateArrowButton( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return XtCreateWidget(name, xmArrowButtonWidgetClass, parent, arglist, argcount); } Widget XmVaCreateArrowButton( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmArrowButtonWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedArrowButton( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmArrowButtonWidgetClass, parent, True, var, count); va_end(var); return w; } /* Wrapper around XmeDrawArrow to calculate sizes. */ static void DrawArrow(XmArrowButtonWidget aw, GC top_gc, GC bottom_gc, GC center_gc) { Position x, y; Dimension width, height; Dimension margin = (aw->primitive.highlight_thickness + aw->primitive.shadow_thickness); /* Don't let large margins cause confusion. */ if (margin <= (aw->core.width / 2)) { x = margin; width = aw->core.width - (margin * 2); } else { x = aw->core.width / 2; width = 0; } if (margin <= (aw->core.height / 2)) { y = margin; height = aw->core.height - (margin * 2); } else { y = aw->core.height / 2; height = 0; } /* The way we currently handle 1 shadowThickness in XmeDrawArrow is by drawing the center a little bit bigger, so the center_gc has to be present. Kinda hacky... */ if (!center_gc && aw->arrowbutton.detail_shadow_thickness == 1) center_gc = aw->arrowbutton.arrow_GC ; if (center_gc) XSetClipMask(XtDisplay((Widget)aw), center_gc, None); XmeDrawArrow (XtDisplay ((Widget) aw), XtWindow ((Widget) aw), top_gc, bottom_gc, center_gc, x, y, width, height, aw->arrowbutton.detail_shadow_thickness, aw->arrowbutton.direction); } motif-2.3.8/lib/Xm/Screen.c0000644000175000017500000012207213145162623012307 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Screen.c /main/16 1997/06/18 17:41:50 samborn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* To make cpp on Sun happy. CR 5943 */ #include #include #include "DragIconI.h" #include "HashI.h" #include "ImageCachI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "PixConvI.h" #define DEFAULT_QUAD_WIDTH 10 #define RESOURCE_DEFAULT (-1) #define MESSAGE1 _XmMMsgScreen_0000 #define MESSAGE2 _XmMMsgScreen_0001 /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc) ; static void ClassInitialize( void ) ; static void GetUnitFromFont( Display *display, XFontStruct *fst, int *ph_unit, int *pv_unit) ; static void Initialize( Widget requested_widget, Widget new_widget, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget current, Widget requested, Widget new_w, ArgList args, Cardinal *num_args) ; static void Destroy( Widget widget) ; static void InsertChild( Widget wid) ; static void DeleteChild( Widget wid) ; static Boolean MatchPixmap(XmHashKey, XmHashKey) ; static XmHashValue HashPixmap(XmHashKey) ; static Boolean FreePixmap(XmHashKey k, XtPointer p, XtPointer client_data) ; /******** End Static Function Declarations ********/ #define Offset(x) (XtOffsetOf(XmScreenRec, x)) static XtResource resources[] = { { XmNdarkThreshold, XmCDarkThreshold, XmRInt, sizeof(int), Offset(screen.darkThreshold), XmRImmediate, (XtPointer)NULL, }, { XmNlightThreshold, XmCLightThreshold, XmRInt, sizeof(int), Offset(screen.lightThreshold), XmRImmediate, (XtPointer)NULL, }, { XmNforegroundThreshold, XmCForegroundThreshold, XmRInt, sizeof(int), Offset(screen.foregroundThreshold), XmRImmediate, (XtPointer)NULL, }, { XmNdefaultNoneCursorIcon, XmCDefaultNoneCursorIcon, XmRWidget, sizeof(Widget), Offset(screen.defaultNoneCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNdefaultValidCursorIcon, XmCDefaultValidCursorIcon, XmRWidget, sizeof(Widget), Offset(screen.defaultValidCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNdefaultInvalidCursorIcon, XmCDefaultInvalidCursorIcon, XmRWidget, sizeof(Widget), Offset(screen.defaultInvalidCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNdefaultMoveCursorIcon, XmCDefaultMoveCursorIcon, XmRWidget, sizeof(Widget), Offset(screen.defaultMoveCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNdefaultLinkCursorIcon, XmCDefaultLinkCursorIcon, XmRWidget, sizeof(Widget), Offset(screen.defaultLinkCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNdefaultCopyCursorIcon, XmCDefaultCopyCursorIcon, XmRWidget, sizeof(Widget), Offset(screen.defaultCopyCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNdefaultSourceCursorIcon, XmCDefaultSourceCursorIcon, XmRWidget, sizeof(Widget), Offset(screen.defaultSourceCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNmenuCursor, XmCCursor, XmRCursor, sizeof(Cursor), Offset(screen.menuCursor), XmRString, "arrow", }, { XmNunpostBehavior, XmCUnpostBehavior, XmRUnpostBehavior, sizeof(unsigned char), Offset(screen.unpostBehavior), XmRImmediate, (XtPointer)XmUNPOST_AND_REPLAY, }, { XmNfont, XmCFont, XmRFontStruct, sizeof(XFontStruct *), Offset(screen.font_struct), XmRString, XmDEFAULT_FONT, }, { XmNhorizontalFontUnit, XmCHorizontalFontUnit, XmRInt, sizeof(int), Offset(screen.h_unit), XmRImmediate, (XtPointer) RESOURCE_DEFAULT, }, { XmNverticalFontUnit, XmCVerticalFontUnit, XmRInt, sizeof(int), Offset(screen.v_unit), XmRImmediate, (XtPointer) RESOURCE_DEFAULT, }, { XmNmoveOpaque, XmCMoveOpaque, XmRBoolean, sizeof(unsigned char), Offset(screen.moveOpaque), XmRImmediate, (XtPointer) False, }, { XmNcolorCalculationProc, XmCColorCalculationProc, XmRProc, sizeof(XtProc), Offset(screen.color_calc_proc), XmRImmediate, (XtPointer) NULL, }, { XmNcolorAllocationProc, XmCColorAllocationProc, XmRProc, sizeof(XtProc), Offset(screen.color_alloc_proc), XmRImmediate, (XtPointer) NULL, }, { XmNbitmapConversionModel, XmCBitmapConversionModel, XmRBitmapConversionModel, sizeof(XtEnum), Offset(screen.bitmap_conversion_model), XmRImmediate, (XtPointer) XmMATCH_DEPTH, }, { XmNuserData, XmCUserData, XmRPointer, sizeof(XtPointer), Offset(screen.user_data), XmRPointer, (XtPointer) NULL }, { XmNinsensitiveStippleBitmap, XmCInsensitiveStippleBitmap, XmRNoScalingBitmap, sizeof(Pixmap), Offset(screen.insensitive_stipple_bitmap), XmRString, XmS50_foreground }, #ifdef DEFAULT_GLYPH_PIXMAP { XmNdefaultGlyphPixmap, XmCDefaultGlyphPixmap, /* if you move this one as a real pixmap, change the code in the buttons as well, move the copyplane into a copyarea */ XmRBitmap, sizeof (Pixmap), Offset(screen.default_glyph_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, #endif }; #undef Offset /*************************************************************************** * * Class Record * ***************************************************************************/ /*************************************************************************** * * Class Record * ***************************************************************************/ static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* getValuesPrehook */ NULL, /* getValuesPosthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ NULL, /* widgetNavigable */ NULL /* focusChange */ }; externaldef(xmscreenclassrec) XmScreenClassRec xmScreenClassRec = { { (WidgetClass) &coreClassRec, /* superclass */ "XmScreen", /* class_name */ sizeof(XmScreenRec), /* size */ ClassInitialize, /* Class Initializer */ ClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ Initialize, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* screen_accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { /* desktop */ NULL, /* child_class */ InsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL, /* extension */ }, { NULL, }, }; externaldef(xmscreenclass) WidgetClass xmScreenClass = (WidgetClass) (&xmScreenClassRec); externaldef(xmscreenquark) XrmQuark _XmInvalidCursorIconQuark = NULLQUARK; externaldef(xmscreenquark) XrmQuark _XmValidCursorIconQuark = NULLQUARK; externaldef(xmscreenquark) XrmQuark _XmNoneCursorIconQuark = NULLQUARK; externaldef(xmscreenquark) XrmQuark _XmDefaultDragIconQuark = NULLQUARK; externaldef(xmscreenquark) XrmQuark _XmMoveCursorIconQuark = NULLQUARK; externaldef(xmscreenquark) XrmQuark _XmCopyCursorIconQuark = NULLQUARK; externaldef(xmscreenquark) XrmQuark _XmLinkCursorIconQuark = NULLQUARK; static void ClassInitialize( void ) { baseClassExtRec.record_type = XmQmotif; _XmInvalidCursorIconQuark = XrmPermStringToQuark("defaultInvalidCursorIcon"); _XmValidCursorIconQuark = XrmPermStringToQuark("defaultValidCursorIcon"); _XmNoneCursorIconQuark = XrmPermStringToQuark("defaultNoneCursorIcon"); _XmDefaultDragIconQuark = XrmPermStringToQuark("defaultSourceCursorIcon"); _XmMoveCursorIconQuark = XrmPermStringToQuark("defaultMoveCursorIcon"); _XmCopyCursorIconQuark = XrmPermStringToQuark("defaultCopyCursorIcon"); _XmLinkCursorIconQuark = XrmPermStringToQuark("defaultLinkCursorIcon"); } static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit(wc, XmSCREEN_BIT); } /************************************************************************ * * GetUnitFromFont * ************************************************************************/ static void GetUnitFromFont( Display * display, XFontStruct * fst, int * ph_unit, int * pv_unit) { enum { XmAAVERAGE_WIDTH, XmAPIXEL_SIZE, XmARESOLUTION_Y, NUM_ATOMS }; static char *atom_names[] = { XmIAVERAGE_WIDTH, XmIPIXEL_SIZE, XmIRESOLUTION_Y }; Atom atoms[XtNumber(atom_names)]; unsigned long pixel_s, avg_w, point_s, resolution_y; unsigned long font_unit_return; if (fst) { assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(display, atom_names, XtNumber(atom_names), TRUE, atoms); /* Horizontal units */ if (ph_unit) { if (atoms[XmAAVERAGE_WIDTH] && XGetFontProperty(fst, atoms[XmAAVERAGE_WIDTH], &avg_w)) { *ph_unit = (int) ((float) (avg_w / 10) + 0.5) ; } else if (XGetFontProperty (fst, XA_QUAD_WIDTH, &font_unit_return)){ *ph_unit = font_unit_return ; } else { *ph_unit = (int) ((fst->min_bounds.width + fst-> max_bounds.width) / 2.3) + 0.5; } } /* Vertical units */ if (pv_unit) { if (XGetFontProperty(fst, atoms[XmAPIXEL_SIZE], &pixel_s)) { *pv_unit = (int) (((float) pixel_s) / 1.8) + 0.5; } else if ((XGetFontProperty(fst, XA_POINT_SIZE, &point_s)) && (XGetFontProperty(fst, atoms[XmARESOLUTION_Y], &resolution_y))) { float ps, ry, tmp; ps = point_s; ry = resolution_y; tmp = (ps * ry) / 1400.0; *pv_unit = (int) (tmp + 0.5) ; } else { *pv_unit = (int) ((float) (fst->max_bounds.ascent + fst->max_bounds.descent) / 2.2) + 0.5; } } } else { /* no X fontstruct */ if (ph_unit) *ph_unit = DEFAULT_QUAD_WIDTH ; if (pv_unit) *pv_unit = DEFAULT_QUAD_WIDTH ; } } /************************************************************************ * * ScreenInitialize * ************************************************************************/ /* ARGSUSED */ static void Initialize( Widget requested_widget, Widget new_widget, ArgList args, Cardinal *num_args ) { XmScreen xmScreen = (XmScreen)new_widget; Display *display = XtDisplay(new_widget); xmScreen->screen.screenInfo = NULL; XQueryBestCursor(display, RootWindowOfScreen(XtScreen(xmScreen)), 1024, 1024, &xmScreen->screen.maxCursorWidth, &xmScreen->screen.maxCursorHeight); xmScreen->screen.nullCursor = None; xmScreen->screen.cursorCache = NULL; xmScreen->screen.scratchPixmaps = (XtPointer) _XmAllocHashTable(20, MatchPixmap, HashPixmap); xmScreen->screen.inUsePixmaps = (XtPointer) _XmAllocHashTable(20, NULL, NULL); xmScreen->screen.xmStateCursorIcon = NULL; xmScreen->screen.xmMoveCursorIcon = NULL; xmScreen->screen.xmCopyCursorIcon = NULL; xmScreen->screen.xmLinkCursorIcon = NULL; xmScreen->screen.xmSourceCursorIcon = NULL; xmScreen->screen.mwmPresent = XmIsMotifWMRunning( new_widget) ; xmScreen->screen.numReparented = 0; xmScreen->desktop.num_children = 0; xmScreen->desktop.children = NULL; xmScreen->desktop.num_slots = 0; if(!XmRepTypeValidValue(XmRID_UNPOST_BEHAVIOR, xmScreen->screen.unpostBehavior, new_widget)) { xmScreen->screen.unpostBehavior = XmUNPOST_AND_REPLAY; } /* font unit stuff, priority to actual unit values, if they haven't been set yet, compute from the font, otherwise, stay unchanged */ if (xmScreen->screen.h_unit == RESOURCE_DEFAULT) GetUnitFromFont(display, xmScreen->screen.font_struct, &xmScreen->screen.h_unit, NULL); if (xmScreen->screen.v_unit == RESOURCE_DEFAULT) GetUnitFromFont(display, xmScreen->screen.font_struct, NULL, &xmScreen->screen.v_unit); xmScreen->screen.screenInfo = (XtPointer) XtNew(XmScreenInfo); ((XmScreenInfo *)(xmScreen->screen.screenInfo))->menu_state = (XtPointer)NULL; ((XmScreenInfo *)(xmScreen->screen.screenInfo))->destroyCallbackAdded = False; #ifdef DEFAULT_GLYPH_PIXMAP if (xmScreen->screen.default_glyph_pixmap != XmUNSPECIFIED_PIXMAP) { (void) XmeGetPixmapData(XtScreen(new_widget), xmScreen->screen.default_glyph_pixmap, NULL, NULL, NULL, NULL, NULL, NULL, &(xmScreen->screen.default_glyph_pixmap_width), &(xmScreen->screen.default_glyph_pixmap_height)); } #endif } /************************************************************************ * * SetValues * ************************************************************************/ /* ARGSUSED */ static Boolean SetValues( Widget current, Widget requested, Widget new_w, ArgList args, Cardinal *num_args ) { XmScreen newScr = (XmScreen)new_w; XmScreen oldScr = (XmScreen)current; Display * display = XtDisplay( new_w); if(!XmRepTypeValidValue(XmRID_UNPOST_BEHAVIOR, newScr->screen.unpostBehavior, new_w)) { newScr->screen.unpostBehavior = XmUNPOST_AND_REPLAY; } /* * If we are setting a default cursor icon, verify that * it has the same screen as the new XmScreen. */ /* defaultNoneCursorIcon */ if (newScr->screen.defaultNoneCursorIcon != oldScr->screen.defaultNoneCursorIcon && newScr->screen.defaultNoneCursorIcon != NULL && XtScreenOfObject (XtParent (newScr->screen.defaultNoneCursorIcon)) != XtScreen (newScr)) { XmeWarning( (Widget) new_w, MESSAGE1); newScr->screen.defaultNoneCursorIcon = oldScr->screen.defaultNoneCursorIcon; } /* defaultValidCursorIcon */ if (newScr->screen.defaultValidCursorIcon != oldScr->screen.defaultValidCursorIcon && newScr->screen.defaultValidCursorIcon != NULL && XtScreenOfObject (XtParent (newScr->screen.defaultValidCursorIcon)) != XtScreen (newScr)) { XmeWarning( (Widget) new_w, MESSAGE1); newScr->screen.defaultValidCursorIcon = oldScr->screen.defaultValidCursorIcon; } /* defaultInvalidCursorIcon */ if (newScr->screen.defaultInvalidCursorIcon != oldScr->screen.defaultInvalidCursorIcon && newScr->screen.defaultInvalidCursorIcon != NULL && XtScreenOfObject (XtParent (newScr->screen.defaultInvalidCursorIcon)) != XtScreen (newScr)) { XmeWarning( (Widget) new_w, MESSAGE1); newScr->screen.defaultInvalidCursorIcon = oldScr->screen.defaultInvalidCursorIcon; } /* defaultMoveCursorIcon */ if (newScr->screen.defaultMoveCursorIcon != oldScr->screen.defaultMoveCursorIcon && newScr->screen.defaultMoveCursorIcon != NULL && XtScreenOfObject (XtParent (newScr->screen.defaultMoveCursorIcon)) != XtScreen (newScr)) { XmeWarning( (Widget) new_w, MESSAGE1); newScr->screen.defaultMoveCursorIcon = oldScr->screen.defaultMoveCursorIcon; } /* defaultCopyCursorIcon */ if (newScr->screen.defaultCopyCursorIcon != oldScr->screen.defaultCopyCursorIcon && newScr->screen.defaultCopyCursorIcon != NULL && XtScreenOfObject (XtParent (newScr->screen.defaultCopyCursorIcon)) != XtScreen (newScr)) { XmeWarning( (Widget) new_w, MESSAGE1); newScr->screen.defaultCopyCursorIcon = oldScr->screen.defaultCopyCursorIcon; } /* defaultLinkCursorIcon */ if (newScr->screen.defaultLinkCursorIcon != oldScr->screen.defaultLinkCursorIcon && newScr->screen.defaultLinkCursorIcon != NULL && XtScreenOfObject (XtParent (newScr->screen.defaultLinkCursorIcon)) != XtScreen (newScr)) { XmeWarning( (Widget) new_w, MESSAGE1); newScr->screen.defaultLinkCursorIcon = oldScr->screen.defaultLinkCursorIcon; } /* defaultSourceCursorIcon */ if (newScr->screen.defaultSourceCursorIcon != oldScr->screen.defaultSourceCursorIcon && newScr->screen.defaultSourceCursorIcon != NULL && XtScreenOfObject (XtParent (newScr->screen.defaultSourceCursorIcon)) != XtScreen (newScr)) { XmeWarning( (Widget) new_w, MESSAGE1); newScr->screen.defaultSourceCursorIcon = oldScr->screen.defaultSourceCursorIcon; } /* font unit stuff, priority to actual unit values, if the font has changed but not the unit values, report the change, otherwise, use the unit value - i.e do nothing */ if (newScr->screen.font_struct->fid != oldScr->screen.font_struct->fid) { if (newScr->screen.h_unit == oldScr->screen.h_unit) { GetUnitFromFont(display, newScr->screen.font_struct, &newScr->screen.h_unit, NULL); } if (newScr->screen.v_unit == oldScr->screen.v_unit) { GetUnitFromFont(display, newScr->screen.font_struct, NULL, &newScr->screen.v_unit); } } return FALSE ; } /************************************************************************ * * Destroy * ************************************************************************/ /* ARGSUSED */ static void Destroy( Widget widget ) { XmScreen xmScreen = (XmScreen)widget; XmDragCursorCache prevCache, cache; XmHashTable tab; /* destroy any default icons created by Xm */ if (xmScreen->screen.xmStateCursorIcon != NULL) { _XmDestroyDefaultDragIcon (xmScreen->screen.xmStateCursorIcon); } if (xmScreen->screen.xmMoveCursorIcon != NULL) { _XmDestroyDefaultDragIcon (xmScreen->screen.xmMoveCursorIcon); } if (xmScreen->screen.xmCopyCursorIcon != NULL) { _XmDestroyDefaultDragIcon (xmScreen->screen.xmCopyCursorIcon); } if (xmScreen->screen.xmLinkCursorIcon != NULL) { _XmDestroyDefaultDragIcon (xmScreen->screen.xmLinkCursorIcon); } if (xmScreen->screen.xmSourceCursorIcon != NULL) { _XmDestroyDefaultDragIcon (xmScreen->screen.xmSourceCursorIcon); } XtFree((char *) xmScreen->desktop.children); /* free the cursorCache and the pixmapCache */ cache = xmScreen->screen.cursorCache; while(cache) { prevCache = cache; if (cache->cursor) XFreeCursor(XtDisplay(xmScreen), cache->cursor); cache = cache->next; XtFree((char *)prevCache); } _XmProcessLock(); tab = (XmHashTable) xmScreen->screen.scratchPixmaps; _XmMapHashTable(tab, FreePixmap, xmScreen); _XmFreeHashTable(tab); _XmFreeHashTable((XmHashTable) xmScreen->screen.inUsePixmaps); _XmProcessUnlock(); XtFree((char *) xmScreen->screen.screenInfo); /* need to remove pixmap and GC related to this screen */ _XmCleanPixmapCache (XtScreen(widget), NULL); } static void InsertChild( Widget wid ) { XmDesktopObject w = (XmDesktopObject) wid ; register Cardinal position; register Cardinal i; register XmScreen cw; register WidgetList children; cw = (XmScreen) w->desktop.parent; children = cw->desktop.children; position = cw->desktop.num_children; if (cw->desktop.num_children == cw->desktop.num_slots) { /* Allocate more space */ cw->desktop.num_slots += (cw->desktop.num_slots / 2) + 2; cw->desktop.children = children = (WidgetList) XtRealloc((char *) children, (unsigned) (cw->desktop.num_slots) * sizeof(Widget)); } /* Ripple children up one space from "position" */ for (i = cw->desktop.num_children; i > position; i--) { children[i] = children[i-1]; } children[position] = (Widget)w; cw->desktop.num_children++; } static void DeleteChild( Widget wid ) { XmDesktopObject w = (XmDesktopObject) wid ; register Cardinal position; register Cardinal i; register XmScreen cw; cw = (XmScreen) w->desktop.parent; for (position = 0; position < cw->desktop.num_children; position++) { if (cw->desktop.children[position] == (Widget)w) { break; } } if (position == cw->desktop.num_children) return; /* Ripple children down one space from "position" */ cw->desktop.num_children--; for (i = position; i < cw->desktop.num_children; i++) { cw->desktop.children[i] = cw->desktop.children[i+1]; } } /************************************************************************ * * _XmScreenRemoveFromCursorCache * * Mark any cursor cache reference to the specified icon as deallocated. ************************************************************************/ void _XmScreenRemoveFromCursorCache( XmDragIconObject icon ) { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(icon)); XmDragCursorCache ptr = xmScreen->screen.cursorCache; XmDragCursorCache previous = xmScreen->screen.cursorCache; XmDragCursorCache next; while (ptr) { next = ptr->next; if ((ptr->sourceIcon == icon) || (ptr->stateIcon == icon) || (ptr->opIcon == icon)) { if (ptr->cursor) XFreeCursor (XtDisplay(icon), ptr->cursor); if ( xmScreen->screen.cursorCache == ptr ) xmScreen->screen.cursorCache = ptr->next; else previous->next = ptr->next; XtFree ((char*)ptr); } else previous = ptr; ptr = next; } } static Boolean FreePixmap(XmHashKey k, XtPointer p, XtPointer client_data) { XmScreen xmScreen = (XmScreen) client_data; XtFree((char*) k); XFreePixmap(XtDisplay(xmScreen), (Pixmap) p); return False; } /************************************************************************ * * _XmScreenGetOperationIcon () * * Returns one of the three XmScreen operation cursor types. These aren't * created ahead of time in order to let the client specify its own. * If they haven't by now (a drag is in process) then we create our * own. The name of the OperatonIcon can cause the built-in cursor data * to get loaded in (if not specified in the resource file). ************************************************************************/ XmDragIconObject _XmScreenGetOperationIcon( Widget w, #if NeedWidePrototypes unsigned int operation ) #else unsigned char operation ) #endif /* NeedWidePrototypes */ { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreenOfObject(w)); XrmQuark nameQuark = NULLQUARK; XmDragIconObject *ptr = NULL; XmDragIconObject *pt2 = NULL; switch ((int) operation) { case XmDROP_MOVE: ptr = &xmScreen->screen.defaultMoveCursorIcon; pt2 = &xmScreen->screen.xmMoveCursorIcon; nameQuark = _XmMoveCursorIconQuark; break; case XmDROP_COPY: ptr = &xmScreen->screen.defaultCopyCursorIcon; pt2 = &xmScreen->screen.xmCopyCursorIcon; nameQuark = _XmCopyCursorIconQuark; break; case XmDROP_LINK: ptr = &xmScreen->screen.defaultLinkCursorIcon; pt2 = &xmScreen->screen.xmLinkCursorIcon; nameQuark = _XmLinkCursorIconQuark; break; default: return (NULL); } if (*ptr == NULL) { if (*pt2 == NULL) { *pt2 = (XmDragIconObject) XmCreateDragIcon ((Widget) xmScreen, XrmQuarkToString(nameQuark), NULL, 0); } *ptr = *pt2; } return *ptr; } /************************************************************************ * * _XmScreenGetStateIcon () * * Returns one of the three XmScreen state cursor types. These aren't * created ahead of time in order to let the client specify its own. * If they haven't by now (a drag is in process) then we create our * own. The name of the StateIcon can cause the built-in cursor data * to get loaded in (if not specified in the resource file). * The default state cursors are the same XmDragIcon object. ************************************************************************/ XmDragIconObject _XmScreenGetStateIcon( Widget w, #if NeedWidePrototypes unsigned int state ) #else unsigned char state ) #endif /* NeedWidePrototypes */ { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreenOfObject(w)); XrmQuark nameQuark = NULLQUARK; XmDragIconObject icon = NULL; switch(state) { default: case XmNO_DROP_SITE: icon = xmScreen->screen.defaultNoneCursorIcon; nameQuark = _XmNoneCursorIconQuark; break; case XmVALID_DROP_SITE: icon = xmScreen->screen.defaultValidCursorIcon; nameQuark = _XmValidCursorIconQuark; break; case XmINVALID_DROP_SITE: icon = xmScreen->screen.defaultInvalidCursorIcon; nameQuark = _XmInvalidCursorIconQuark; break; } if (icon == NULL) { /* * We need to create the default state icons. * Set all uncreated state icons to the same XmDragIcon object. */ if (xmScreen->screen.xmStateCursorIcon == NULL) { xmScreen->screen.xmStateCursorIcon = (XmDragIconObject) XmCreateDragIcon ((Widget) xmScreen, XrmQuarkToString(nameQuark), NULL, 0); } icon = xmScreen->screen.xmStateCursorIcon; if (xmScreen->screen.defaultNoneCursorIcon == NULL) { xmScreen->screen.defaultNoneCursorIcon = icon; } if (xmScreen->screen.defaultValidCursorIcon == NULL) { xmScreen->screen.defaultValidCursorIcon = icon; } if (xmScreen->screen.defaultInvalidCursorIcon == NULL) { xmScreen->screen.defaultInvalidCursorIcon = icon; } } return (icon); } /************************************************************************ * * _XmScreenGetSourceIcon () * * Returns the XmScreen source cursor types. This isn't created ahead of * time in order to let the client specify its own. If it hasn't by now * (a drag is in process) then we create our own. ************************************************************************/ XmDragIconObject _XmScreenGetSourceIcon( Widget w ) { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreenOfObject(w)); if (xmScreen->screen.defaultSourceCursorIcon == NULL) { if (xmScreen->screen.xmSourceCursorIcon == NULL) { xmScreen->screen.xmSourceCursorIcon = (XmDragIconObject) XmCreateDragIcon ((Widget) xmScreen, XrmQuarkToString(_XmDefaultDragIconQuark), NULL, 0); } xmScreen->screen.defaultSourceCursorIcon = xmScreen->screen.xmSourceCursorIcon; } return xmScreen->screen.defaultSourceCursorIcon; } /************************************************************************ * * _XmAllocScratchPixmap * ************************************************************************/ static Boolean MatchPixmap(XmHashKey k1, XmHashKey k2) { XmScratchPixmapKey key1 = (XmScratchPixmapKey) k1; XmScratchPixmapKey key2 = (XmScratchPixmapKey) k2; return(key1 -> height == key2 -> height && key1 -> width == key2 -> width && key1 -> depth == key2 -> depth); } static XmHashValue HashPixmap(XmHashKey k) { XmScratchPixmapKey key = (XmScratchPixmapKey) k; return(key -> height + key -> width + key -> depth); } Pixmap _XmAllocScratchPixmap( XmScreen xmScreen, #if NeedWidePrototypes unsigned int depth, int width, int height ) #else Cardinal depth, Dimension width, Dimension height ) #endif /* NeedWidePrototypes */ { XmHashTable scratchTable = (XmHashTable) xmScreen->screen.scratchPixmaps; XmHashTable inUseTable = (XmHashTable) xmScreen->screen.inUsePixmaps; Pixmap scratchPixmap = None; XmScratchPixmapKeyRec key; XmScratchPixmapKey returned_key; key.height = height; key.width = width; key.depth = depth; _XmProcessLock(); scratchPixmap = (Pixmap) _XmGetHashEntry(scratchTable, &key); if (scratchPixmap != None) { /* remove from free table */ returned_key = (XmScratchPixmapKey) _XmRemoveHashEntry(scratchTable, &key); } else { returned_key = XtNew(XmScratchPixmapKeyRec); returned_key->width = width; returned_key->height = height; returned_key->depth = depth; scratchPixmap = XCreatePixmap (XtDisplay(xmScreen), RootWindowOfScreen(XtScreen(xmScreen)), width, height, depth); } /* Place key in inUse table */ _XmAddHashEntry(inUseTable, (XmHashKey) scratchPixmap, returned_key); _XmProcessUnlock(); return(scratchPixmap); } /************************************************************************ * * _XmFreeScratchPixmap * ************************************************************************/ void _XmFreeScratchPixmap( XmScreen xmScreen, Pixmap pixmap ) { XmHashTable scratchTable = (XmHashTable) xmScreen->screen.scratchPixmaps; XmHashTable inUseTable = (XmHashTable) xmScreen->screen.inUsePixmaps; XmScratchPixmapKey returned_key; _XmProcessLock(); returned_key = (XmScratchPixmapKey) _XmGetHashEntry(inUseTable, (XmHashKey) pixmap); if (returned_key == NULL) { /* Bad, this pixmap wasn't in the cache, return */ _XmProcessUnlock(); return; } _XmRemoveHashEntry(inUseTable, (XmHashKey) pixmap); _XmAddHashEntry(scratchTable, returned_key, (XtPointer) pixmap); _XmProcessUnlock(); } /************************************************************************ * * _XmGetDragCursorCachePtr () * ************************************************************************/ XmDragCursorCache * _XmGetDragCursorCachePtr( XmScreen xmScreen ) { return &xmScreen->screen.cursorCache; } /************************************************************************ * * XmeQueryBestCursorSize() * ************************************************************************/ void XmeQueryBestCursorSize( Widget w, Dimension *width, Dimension *height ) { XmScreen xmScreen; _XmWidgetToAppContext(w); _XmAppLock(app); xmScreen = (XmScreen) XmGetXmScreen(XtScreenOfObject(w)); *width = (Dimension)xmScreen->screen.maxCursorWidth; *height = (Dimension)xmScreen->screen.maxCursorHeight; _XmAppUnlock(app); return; } static XmConst char nullBits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /************************************************************************ * * XmeGetNullCursor () * ************************************************************************/ Cursor XmeGetNullCursor( Widget w ) { XmScreen xmScreen; Pixmap pixmap; Cursor cursor; XColor foreground; XColor background; _XmWidgetToAppContext(w); _XmAppLock(app); xmScreen = (XmScreen) XmGetXmScreen(XtScreenOfObject(w)); if (xmScreen->screen.nullCursor == None) { foreground.pixel = background.pixel = 0; pixmap = XCreatePixmapFromBitmapData(XtDisplayOfObject(w), RootWindowOfScreen(XtScreenOfObject(w)), (char*)nullBits, 4, 4, 0, 0, 1); cursor = XCreatePixmapCursor(XtDisplayOfObject(w), pixmap, pixmap, &foreground, &background, 0, 0); XFreePixmap(XtDisplayOfObject(w), pixmap); xmScreen->screen.nullCursor = cursor; } cursor = xmScreen->screen.nullCursor; _XmAppUnlock(app); return cursor; } /* * The following set of functions support the menu cursor functionality. * They have moved from MenuUtil to here. */ /* Obsolete global per-display menu cursor manipulation functions */ /* Programs have to use XtSet/GetValues on the XmScreen object instead */ void XmSetMenuCursor( Display *display, Cursor cursorId ) { XmScreen xmScreen; Screen *scr; int i ; _XmDisplayToAppContext(display); /* This function has no screen parameter, so we have to set the menucursor for _all_ the xmscreen available on this display. why? because when RowColumn will be getting a menucursor for a particular screen, it will have to get what the application has set using this function, not the default for that particular screen (which is what will happen if we were only setting the default display here) */ _XmAppLock(app); for (i=0, scr = ScreenOfDisplay(display, i); i < ScreenCount(display); i++, scr = ScreenOfDisplay(display, i)) { xmScreen = (XmScreen) XmGetXmScreen(scr); xmScreen->screen.menuCursor = cursorId ; } _XmAppUnlock(app); } Cursor XmGetMenuCursor( Display *display ) { XmScreen xmScreen; Cursor cursor; _XmDisplayToAppContext(display); /* get the default screen menuCursor since there is no other information available to this function */ _XmAppLock(app); xmScreen = (XmScreen) XmGetXmScreen(DefaultScreenOfDisplay(display)); cursor = xmScreen->screen.menuCursor; _XmAppUnlock(app); return cursor; } /* a convenience for RowColumn */ Cursor _XmGetMenuCursorByScreen( Screen * screen ) { XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(screen); return(xmScreen->screen.menuCursor); } Boolean _XmGetMoveOpaqueByScreen( Screen * screen ) { XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(screen); return(xmScreen->screen.moveOpaque); } /* a convenience for RowColumn */ unsigned char _XmGetUnpostBehavior( Widget wid ) { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreenOfObject(wid)); return(xmScreen->screen.unpostBehavior); } /********************************************************************** ********************************************************************** Font unit handling functions ********************************************************************** **********************************************************************/ /********************************************************************** * * XmSetFontUnits * Set the font_unit value for all screens. These values can * then be used later to process the font unit conversions. * **********************************************************************/ void XmSetFontUnits( Display *display, int h_value, int v_value ) { XmScreen xmScreen; Screen *scr; int i ; _XmDisplayToAppContext(display); /* This function has no screen parameter, so we have to set the fontunit for _all_ the xmscreen available on this display. why? because when someone will be getting fontunits for a particular screen, it will have to get what the application has set using this function, not the default for that particular screen (which is what will happen if we were only setting the default display here) */ _XmAppLock(app); for (i=0, scr = ScreenOfDisplay(display, i); i < ScreenCount(display); i++, scr = ScreenOfDisplay(display, i)) { xmScreen = (XmScreen) XmGetXmScreen(scr); xmScreen->screen.h_unit = h_value ; xmScreen->screen.v_unit = v_value ; } _XmAppUnlock(app); } /* DEPRECATED */ void XmSetFontUnit( Display *display, int value ) { XmSetFontUnits(display, value, value); } /********************************************************************** * * _XmGetFontUnit * **********************************************************************/ int _XmGetFontUnit( Screen *screen, int dimension ) { XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(screen); if (dimension == XmHORIZONTAL) return(xmScreen->screen.h_unit); else return(xmScreen->screen.v_unit); } /********************************************************************** * * _XmGetColorCalculationProc * Here there is no point of supporting the old function as * place holder for the new color proc since the signature are * different. The old color proc will still be managed by Visual.c * in its own way. **********************************************************************/ XmScreenColorProc _XmGetColorCalculationProc( Screen *screen) { XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(screen); return(xmScreen->screen.color_calc_proc); } /********************************************************************** * * _XmGetColorAllocationProc * **********************************************************************/ XmAllocColorProc _XmGetColorAllocationProc( Screen *screen) { XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(screen); return(xmScreen->screen.color_alloc_proc); } /********************************************************************** * * _XmGetBitmapConversionModel * **********************************************************************/ XtEnum _XmGetBitmapConversionModel( Screen *screen) { XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(screen); return(xmScreen->screen.bitmap_conversion_model); } /************************************************************************ * * _XmGetInsensitiveStippleBitmap * * Returns the insensitive_stipple_bitmap field of the XmScreenPart ************************************************************************/ Pixmap _XmGetInsensitiveStippleBitmap (Widget w) { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(w)); return(xmScreen->screen.insensitive_stipple_bitmap); } #ifdef DEFAULT_GLYPH_PIXMAP /********************************************************************** * * _XmGetDefaultGlyphPixmap * **********************************************************************/ Pixmap _XmGetDefaultGlyphPixmap( Screen *screen, unsigned int * width, unsigned int *height) { XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(screen); if (width) *width = xmScreen->screen.default_glyph_pixmap_width ; if (height) *height = xmScreen->screen.default_glyph_pixmap_height ; return(xmScreen->screen.default_glyph_pixmap); } #endif /********************************************************************* * * XmGetXmScreen * *********************************************************************/ /* ARGSUSED */ Widget XmGetXmScreen( Screen *screen ) { XmDisplay xmDisplay; WidgetList children; Widget widget; int num_children; Arg args[5]; int i; Screen *scr; char name[25]; _XmDisplayToAppContext(DisplayOfScreen(screen)); _XmAppLock(app); if ((xmDisplay = (XmDisplay) XmGetXmDisplay(DisplayOfScreen(screen))) == NULL) { XmeWarning(NULL, MESSAGE2); _XmAppUnlock(app); return(NULL); } children = xmDisplay->composite.children; num_children = xmDisplay->composite.num_children; for (i=0; i < num_children; i++) { Widget child = children[i]; if ((XmIsScreen(child)) && (screen == XtScreen(child))) { _XmAppUnlock(app); return(child); } } /* Not found; have to do an implied creation */ for (scr = ScreenOfDisplay(XtDisplay(xmDisplay), i); i < ScreenCount(XtDisplay(xmDisplay)); i++, scr = ScreenOfDisplay(XtDisplay(xmDisplay), i)) { if (scr == screen) break; } sprintf(name, "screen%d", i); i = 0; XtSetArg(args[i], XmNscreen, screen); i++; widget = XtCreateWidget(name, xmScreenClass, (Widget)xmDisplay, args, i); _XmAppUnlock(app); return widget; } motif-2.3.8/lib/Xm/FontSP.h0000644000175000017500000002665212672140200012244 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmFontSelectorP_h #define _XmFontSelectorP_h #if defined(VMS) || defined(__VMS) #include #endif /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include #ifdef __cplusplus extern "C" { #endif #define XmFontSelectorIndex (XmPanedIndex + 1) #define XmFontS_current_font(w) (((XmFontSelectorWidget)(w))->fs.current_font) #define XmFontS_show_font_name(w) (((XmFontSelectorWidget)(w))->fs.show_font_name) #define XmFontS_iso_fonts_only(w) (((XmFontSelectorWidget)(w))->fs.iso_fonts_only) #define XmFontS_use_scaling(w) (((XmFontSelectorWidget)(w))->fs.use_scaling) #define XmFontS_text_rows(w) (((XmFontSelectorWidget)(w))->fs.text_rows) #define XmFontS_font_changed_callback(w) (((XmFontSelectorWidget)(w))->fs.font_changed_callback) #define XmFontS_strings(w) (((XmFontSelectorWidget)(w))->fs.strings) #define XmFontS_xlfd_mode(w) (((XmFontSelectorWidget)(w))->fs.xlfd_mode) #define XmFontS_font_info(w) (((XmFontSelectorWidget)(w))->fs.font_info) #define XmFontS_text(w) (((XmFontSelectorWidget)(w))->fs.text) #define XmFontS_name_label(w) (((XmFontSelectorWidget)(w))->fs.name_label) #define XmFontS_middle_pane(w) (((XmFontSelectorWidget)(w))->fs.middle_pane) #define XmFontS_family_box(w) (((XmFontSelectorWidget)(w))->fs.family_box) #define XmFontS_size_box(w) (((XmFontSelectorWidget)(w))->fs.size_box) #define XmFontS_bold_toggle(w) (((XmFontSelectorWidget)(w))->fs.bold_toggle) #define XmFontS_italic_toggle(w) (((XmFontSelectorWidget)(w))->fs.italic_toggle) #define XmFontS_xlfd_toggle(w) (((XmFontSelectorWidget)(w))->fs.xlfd_toggle) #define XmFontS_other_toggle(w) (((XmFontSelectorWidget)(w))->fs.other_toggle) #define XmFontS_show_font_toggle(w) (((XmFontSelectorWidget)(w))->fs.show_font_toggle) #define XmFontS_use_scaling_toggle(w) (((XmFontSelectorWidget)(w))->fs.use_scaling_toggle) #define XmFontS_option_menu(w) (((XmFontSelectorWidget)(w))->fs.option_menu) #define XmFontS_encoding_menu_shell(w) (((XmFontSelectorWidget)(w))->fs.encoding_menu_shell) #define XmFontS_xlfd_only(w) (((XmFontSelectorWidget)(w))->fs.xlfd_only) #define XmFontS_xlfd_sensitive(w) (((XmFontSelectorWidget)(w))->fs.xlfd_sensitive) #define XmFontS_num_xlfd_only(w) (((XmFontSelectorWidget)(w))->fs.num_xlfd_only) #define XmFontS_num_xlfd_sensitive(w) (((XmFontSelectorWidget)(w))->fs.num_xlfd_sensitive) #define XmFontS_alloc_xlfd_only(w) (((XmFontSelectorWidget)(w))->fs.alloc_xlfd_only) #define XmFontS_alloc_xlfd_sensitive(w) (((XmFontSelectorWidget)(w))->fs.alloc_xlfd_sensitive) #define XmFontS_user_state(w) (((XmFontSelectorWidget)(w))->fs.user_state) #define XmFontS_current_text(w) (((XmFontSelectorWidget)(w))->fs.current_text) #define XmFontS_get_font(w) (((XmFontSelectorWidget)(w))->fs.get_font) #define XmFontS_encoding(w) (((XmFontSelectorWidget)(w))->fs.encoding) #define XmFontS_old_fontlist(w) (((XmFontSelectorWidget)(w))->fs.old_fontlist) #define XmFontS_old_fontdata(w) (((XmFontSelectorWidget)(w))->fs.old_fontdata) #define XmFontS_dpi75(w) (((XmFontSelectorWidget)(w))->fs.dpi75) #define XmFontS_dpi100(w) (((XmFontSelectorWidget)(w))->fs.dpi100) #define XmFontS_dpiAny(w) (((XmFontSelectorWidget)(w))->fs.dpiAny) #define XmFontS_proportional(w) (((XmFontSelectorWidget)(w))->fs.proportional) #define XmFontS_monospace(w) (((XmFontSelectorWidget)(w))->fs.monospace) #define XmFontS_any_spacing(w) (((XmFontSelectorWidget)(w))->fs.any_spacing) #define SAMPLE_TEXT(fsw) (XmFontS_strings((fsw)).sample_text) #define ANY_STRING(fsw) (XmFontS_strings((fsw)).any) #define LOWER_ANY_STRING(fsw) (XmFontS_strings((fsw)).lower_any) #define FAMILY_STRING(fsw) (XmFontS_strings((fsw)).family) #define SIZE_STRING(fsw) (XmFontS_strings((fsw)).size) #define BOLD_STRING(fsw) (XmFontS_strings((fsw)).bold) #define ITALIC_STRING(fsw) (XmFontS_strings((fsw)).italic) #define OPTION_STRING(fsw) (XmFontS_strings((fsw)).option) #define BOTH_STRING(fsw) (XmFontS_strings((fsw)).both) #define MONO_SPACE_STRING(fsw) (XmFontS_strings((fsw)).mono_space) #define PROPORTIONAL_STRING(fsw)(XmFontS_strings((fsw)).prop_space) #define XLFD_STRING(fsw) (XmFontS_strings((fsw)).xlfd) #define OTHER_FONT_STRING(fsw) (XmFontS_strings((fsw)).other_font) #define DPI75_STRING(fsw) (XmFontS_strings((fsw)).dpi_75) #define DPI100_STRING(fsw) (XmFontS_strings((fsw)).dpi_100) #define SCALING_STRING(fsw) (XmFontS_strings((fsw)).scaling) #define SHOW_NAME_STRING(fsw) (XmFontS_strings((fsw)).show_name) #define ENCODING_ONLY_STRING(fsw) (XmFontS_strings((fsw)).encoding_only) #define ENCODING_LIST(fsw) (XmFontS_strings((fsw)).encoding_list) #define ENCODING_STRING(fsw) XmFontS_encoding((fsw)) /* this structure provides the table for font selection */ #define WEIGHT_LEN 15 #define SLANT_LEN 3 #define SPACING_LEN 3 typedef unsigned char Flag; typedef unsigned int LongFlag; #define FIXED ((Flag) 1 << 0) #define BOLD ((Flag) 1 << 1) #define ITALIC ((Flag) 1 << 2) #define PROPORTIONAL ((Flag) 1 << 3) #define SCALED_75 ((Flag) 1 << 4) #define SCALED_100 ((Flag) 1 << 5) #define DPI_75 ((Flag) 1 << 6) #define DPI_100 ((Flag) 1 << 7) /* * This allows me to reuse flag bits in the user_state since * ISO is never set in the user state. */ #define USER_PROPORTIONAL PROPORTIONAL #define USER_FIXED FIXED typedef struct _FontData { XrmQuark familyq; /* quarkified family name. */ XrmQuark weightq; /* quarkified weight name. */ char slant[SLANT_LEN + 1]; char spacing[SPACING_LEN + 1]; short resolution_x, resolution_y; short point_size; XrmQuark encoding; Flag state; } FontData; typedef struct FamilyInfo { XrmQuark nameq; /* quarkified family name. */ XrmQuark bold_nameq, medium_nameq; XrmQuark italic_nameq, upright_nameq; char fixed_spacing[SPACING_LEN + 1]; LongFlag sizes_75, sizes_100; Flag state; XrmQuark *encodings; int encoding_alloc; } FamilyInfo; typedef struct FontInfo { FontData *current_font; String *others; FamilyInfo *family_info; short num_others; short num_families; short resolution; } FontInfo; typedef struct _XmFontSelStringInfo { XmString sample_text; XmString any, lower_any; XmString family, size; XmString bold, italic, option, both; XmString mono_space, prop_space; XmString xlfd, other_font; XmString dpi_75, dpi_100; XmString scaling, encoding_only, show_name; String *encoding_list; } XmFontSelStringInfo; /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ typedef struct _FontSelectorClassPart { XtPointer extension; /* For later use. */ } FontSelectorClassPart; typedef struct _XmFontSelectorClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmPanedClassPart paned_class; FontSelectorClassPart font_selector_class; } XmFontSelectorClassRec; typedef struct _XmFontSelectorPart { /* Resources */ String current_font; /* The currently shown font. */ Boolean show_font_name; /* show the font name window? */ Boolean iso_fonts_only; /* show only iso fonts? */ Boolean use_scaling; /* use font scaling? */ Dimension text_rows; /* The number of text rows to display*/ XtCallbackList font_changed_callback; /* when font changes. */ XmFontSelStringInfo strings; /* The font selectors external strings. */ /* Private Data */ Boolean xlfd_mode; /* True if we are int xlfd mode. */ FontInfo *font_info; /* The font information. */ Widget text, name_label; /* Text and label widget below top area. */ Widget middle_pane; /* The option info middle pane. */ Widget family_box; /* The family choices combo box. */ Widget size_box; /* The family choices combo box. */ Widget bold_toggle, italic_toggle; /* The bold and italic toggle buttons */ Widget xlfd_toggle, other_toggle; /* The xlfd and other font toggles. */ Widget show_font_toggle, use_scaling_toggle; Widget option_menu; /* The option menu. */ Widget encoding_menu_shell; /* The menu shell associated with the */ /* encoding menu. */ WidgetList xlfd_only; /* Only visable when in xlfd mode. */ WidgetList xlfd_sensitive; /* Only sensitive when in xlfd mode. */ char num_xlfd_only, num_xlfd_sensitive; char alloc_xlfd_only, alloc_xlfd_sensitive; Flag user_state; /* The current user selections. */ String current_text; /* The current text in the text widget. */ String get_font; /* Where to store returned get values on current_font. */ String encoding; /* The encoding, may change. */ /* * The previously set font_data, free when font changed, or widget * destroyed. */ XmFontList old_fontlist; XFontStruct * old_fontdata; /* * These values were added 2/1/94 */ Widget dpi75, dpi100, dpiAny; /* DPI toggle buttons. */ Widget proportional, monospace, any_spacing; /* Spacing toggle buttons */ } XmFontSelectorPart; typedef struct _XmFontSelectorRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmPanedPart paned; XmFontSelectorPart fs; } XmFontSelectorRec; typedef struct _XmFontSelectorConstraintsPart { XtPointer dummy; } XmFontSelectorConstraintsPart; typedef struct _XmFontSelectorConstraintsRec { XmManagerConstraintPart manager; XmPanedConstraintsPart paned; XmFontSelectorConstraintsPart fs; } XmFontSelectorConstraintsRec, *XmFontSelectorConstraints; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /************************************************************ * EXTERNAL DECLARATIONS ************************************************************/ /************************************************************ * STATIC DECLARATIONS ************************************************************/ extern XmFontSelectorClassRec xmFontSelectorClassRec; #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmFontSelectorP_h - DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/TabStackP.h0000644000175000017500000002227012672140200012677 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmTabStackP_h_ #define _XmTabStackP_h_ #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmTabStackClassPart { String drag_translations; XtPointer extension; } XmTabStackClassPart; typedef struct _XmTabStackClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmTabStackClassPart tab_stack_class; } XmTabStackClassRec; externalref XmTabStackClassRec xmTabStackClassRec; typedef struct _XmTabStackPart { /* Resources for the Tab Stack */ XtCallbackList tab_select_callback; /* Resource to pass down to Tab Box */ XmFontList font_list; XmTabStyle tab_style; XmTabMode tab_mode; XmTabSide tab_side; XmTabOrientation tab_orientation; XmString tear_off_label; Boolean allow_tear_offs; Boolean uniform_tab_size; Boolean use_image_cache; Boolean stacked_effect; Boolean tab_auto_select; Dimension tab_margin_width; Dimension tab_margin_height; Dimension tab_label_spacing; Dimension tab_offset; Dimension highlight_thickness; Pixel select_color; Pixel select_pixmap; int tab_corner_percent; Widget tab_box; /* Private Values */ XmTabbedStackList _tab_list; XRectangle _size; Widget _active_child; GC _gc; Boolean _inited; Boolean _set_tab_list; Widget _menu; Widget _tear_off_button; /* Drag And Drop Stuff */ Pixmap _source_pixmap; Pixmap _source_mask; Pixmap _invalid_pixmap; Pixmap _invalid_mask; Widget _source_icon; Widget _invalid_icon; Widget _selected_tab; /* used within realize method */ Boolean _selected_notify; /* used within realize method */ Boolean do_notify; /* for notify XmNtabSelectedCallback */ Boolean check_set_render_table; } XmTabStackPart; #define XmTabStack_tab_select_callback(w) (((XmTabStackWidget)(w))->tab_stack.tab_select_callback) #define XmTabStack_font_list(w) (((XmTabStackWidget)(w))->tab_stack.font_list) #define XmTabStack_tab_style(w) (((XmTabStackWidget)(w))->tab_stack.tab_style) #define XmTabStack_tab_mode(w) (((XmTabStackWidget)(w))->tab_stack.tab_mode) #define XmTabStack_tab_side(w) (((XmTabStackWidget)(w))->tab_stack.tab_side) #define XmTabStack_tab_orientation(w) (((XmTabStackWidget)(w))->tab_stack.tab_orientation) #define XmTabStack_tear_off_label(w) (((XmTabStackWidget)(w))->tab_stack.tear_off_label) #define XmTabStack_allow_tear_offs(w) (((XmTabStackWidget)(w))->tab_stack.allow_tear_offs) #define XmTabStack_uniform_tab_size(w) (((XmTabStackWidget)(w))->tab_stack.uniform_tab_size) #define XmTabStack_use_image_cache(w) (((XmTabStackWidget)(w))->tab_stack.use_image_cache) #define XmTabStack_stacked_effect(w) (((XmTabStackWidget)(w))->tab_stack.stacked_effect) #define XmTabStack_tab_auto_select(w) (((XmTabStackWidget)(w))->tab_stack.tab_auto_select) #define XmTabStack_tab_margin_width(w) (((XmTabStackWidget)(w))->tab_stack.tab_margin_width) #define XmTabStack_tab_margin_height(w) (((XmTabStackWidget)(w))->tab_stack.tab_margin_height) #define XmTabStack_tab_label_spacing(w) (((XmTabStackWidget)(w))->tab_stack.tab_label_spacing) #define XmTabStack_tab_offset(w) (((XmTabStackWidget)(w))->tab_stack.tab_offset) #define XmTabStack_highlight_thickness(w) (((XmTabStackWidget)(w))->tab_stack.highlight_thickness) #define XmTabStack_select_color(w) (((XmTabStackWidget)(w))->tab_stack.select_color) #define XmTabStack_select_pixmap(w) (((XmTabStackWidget)(w))->tab_stack.select_pixmap) #define XmTabStack_tab_corner_percent(w) (((XmTabStackWidget)(w))->tab_stack.tab_corner_percent) #define XmTabStack_tab_box(w) (((XmTabStackWidget)(w))->tab_stack.tab_box) #define XmTabStack__tab_list(w) (((XmTabStackWidget)(w))->tab_stack._tab_list) #define XmTabStack__size(w) (((XmTabStackWidget)(w))->tab_stack._size) #define XmTabStack__active_child(w) (((XmTabStackWidget)(w))->tab_stack._active_child) #define XmTabStack__gc(w) (((XmTabStackWidget)(w))->tab_stack._gc) #define XmTabStack__inited(w) (((XmTabStackWidget)(w))->tab_stack._inited) #define XmTabStack__set_tab_list(w) (((XmTabStackWidget)(w))->tab_stack._set_tab_list) #define XmTabStack__menu(w) (((XmTabStackWidget)(w))->tab_stack._menu) #define XmTabStack__tear_off_button(w) (((XmTabStackWidget)(w))->tab_stack._tear_off_button) #define XmTabStack__source_pixmap(w) (((XmTabStackWidget)(w))->tab_stack._source_pixmap) #define XmTabStack__source_mask(w) (((XmTabStackWidget)(w))->tab_stack._source_mask) #define XmTabStack__invalid_pixmap(w) (((XmTabStackWidget)(w))->tab_stack._invalid_pixmap) #define XmTabStack__invalid_mask(w) (((XmTabStackWidget)(w))->tab_stack._invalid_mask) #define XmTabStack__source_icon(w) (((XmTabStackWidget)(w))->tab_stack._source_icon) #define XmTabStack__invalid_icon(w) (((XmTabStackWidget)(w))->tab_stack._invalid_icon) #define XmTabStack__selected_tab(w) (((XmTabStackWidget)(w))->tab_stack._selected_tab) #define XmTabStack__selected_notify(w) (((XmTabStackWidget)(w))->tab_stack._selected_notify) #define XmTabStack_do_notify(w) (((XmTabStackWidget)(w))->tab_stack.do_notify) typedef struct _XmTabStackRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmTabStackPart tab_stack; } XmTabStackRec; typedef struct _XmTabStackConstraintPart { XmString tab_label_string; XmStringDirection tab_string_direction; unsigned char tab_alignment; Pixmap tab_label_pixmap; XmPixmapPlacement tab_pixmap_placement; Pixel tab_foreground; Pixel tab_background; Pixmap tab_background_pixmap; Boolean free_tab_pixmap; Boolean tear_off_enabled; /* Private Memebers */ int index; Dimension width; Dimension height; } XmTabStackConstraintPart; #define XmTabStackC_tab_label_string(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_label_string) #define XmTabStackC_tab_string_direction(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_string_direction) #define XmTabStackC_tab_alignment(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_alignment) #define XmTabStackC_tab_label_pixmap(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_label_pixmap) #define XmTabStackC_tab_pixmap_placement(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_pixmap_placement) #define XmTabStackC_tab_foreground(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_foreground) #define XmTabStackC_tab_background(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_background) #define XmTabStackC_tab_background_pixmap(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tab_background_pixmap) #define XmTabStackC_free_tab_pixmap(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.free_tab_pixmap) #define XmTabStackC_tear_off_enabled(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.tear_off_enabled) #define XmTabStackC_index(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.index) #define XmTabStackC_width(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.width) #define XmTabStackC_height(w) \ (((XmTabStackConstraintPtr)((w)->core.constraints))->tab_stack.height) typedef struct _XmTabStackConstraintRec { XmManagerConstraintPart manager; XmTabStackConstraintPart tab_stack; } XmTabStackConstraintRec, * XmTabStackConstraintPtr; #define XmNillegalUniformTabSizeMsg \ "XmNuniformTabSize must be true if XmNtabMode is XmTABS_STACKED or\n\ XmTABS_STACKED_STATIC." #define XmTabStackIndex (XmBulletinBoardIndex + 1) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _TabStackP_h_ */ motif-2.3.8/lib/Xm/Xpms_popen.c0000644000175000017500000001045113066310437013215 00000000000000/* * Copyright (C) 2004 The X.Org fundation * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is fur- * nished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the X.Org fundation * shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written * authorization from the X.Org fundation. */ /* ** This is a secure but NOT 100% compatible replacement for popen() ** Note: - don't use pclose() use fclose() for closing the returned ** filedesc.!!! ** ** Known Bugs: - unable to use i/o-redirection like > or < ** Author: - Thomas Biege ** Credits: - Andreas Pfaller for fixing a SEGV when ** calling strtok() */ #include #include #include #include #include #include #define __SEC_POPEN_TOKEN " " FILE *Xpms_popen(char *cmd, const char *type) { pid_t pid; int pfd[2]; int rpipe = 0, wpipe = 0, i; char **argv; char *ptr; char *cmdcpy; if((cmd == NULL) || (strlen(cmd)==0)) return(NULL); if(type[0] != 'r' && type[0] != 'w') return(NULL); if ((cmdcpy = strdup(cmd)) == NULL) return(NULL); argv = NULL; if( (ptr = strtok(cmdcpy, __SEC_POPEN_TOKEN)) == NULL) { free(cmdcpy); return(NULL); } for(i = 0;; i++) { if( ( argv = (char **) realloc(argv, (i+1) * sizeof(char *)) ) == NULL) { free(cmdcpy); return(NULL); } if( (*(argv+i) = (char *) malloc((strlen(ptr)+1) * sizeof(char))) == NULL) { free(cmdcpy); return(NULL); } strcpy(argv[i], ptr); if( (ptr = strtok(NULL, __SEC_POPEN_TOKEN)) == NULL) { if( ( argv = (char **) realloc(argv, (i+2) * sizeof(char *))) == NULL) { free(cmdcpy); return(NULL); } argv[i+1] = NULL; break; } } if(type[0] == 'r') rpipe = 1; else wpipe = 1; if (pipe(pfd) < 0) { free(cmdcpy); return(NULL); } if((pid = fork()) < 0) { close(pfd[0]); close(pfd[1]); free(cmdcpy); return(NULL); } if(pid == 0) /* child */ { if((pid = fork()) < 0) { close(pfd[0]); close(pfd[1]); free(cmdcpy); return(NULL); } if(pid > 0) { exit(0); /* child nr. 1 exits */ } /* child nr. 2 */ if(rpipe) { close(pfd[0]); /* close reading end, we don't need it */ dup2(STDOUT_FILENO, STDERR_FILENO); if (pfd[1] != STDOUT_FILENO) dup2(pfd[1], STDOUT_FILENO); /* redirect stdout to writing end of pipe */ } else { close(pfd[1]); /* close writing end, we don't need it */ if (pfd[0] != STDIN_FILENO) dup2(pfd[0], STDIN_FILENO); /* redirect stdin to reading end of pipe */ } if(strchr(argv[0], '/') == NULL) execvp(argv[0], argv); /* search in $PATH */ else execv(argv[0], argv); close(pfd[0]); close(pfd[1]); free(cmdcpy); return(NULL); /* exec failed.. ooops! */ } else /* parent */ { waitpid(pid, NULL, 0); /* wait for child nr. 1 */ if(rpipe) { close(pfd[1]); free(cmdcpy); return(fdopen(pfd[0], "r")); } else { close(pfd[0]); free(cmdcpy); return(fdopen(pfd[1], "w")); } } } motif-2.3.8/lib/Xm/ProtocolsP.h0000644000175000017500000000455413145162623013205 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmProtocolsP_h #define _XmProtocolsP_h #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmProtocolClassPart { XtPointer extension; } XmProtocolClassPart; typedef struct _XmProtocolClassRec { ObjectClassPart object_class; XmExtClassPart ext_class; XmProtocolClassPart protocol_class; } XmProtocolClassRec, *XmProtocolObjectClass; typedef struct _XmProtocolPart { XtCallbackRec pre_hook, post_hook; XtCallbackList callbacks; Atom atom; Boolean active; } XmProtocolPart, *XmProtocolPartPtr; typedef struct _XmProtocolRec { ObjectPart object; XmExtPart ext; XmProtocolPart protocol; } XmProtocolRec, *XmProtocol, **XmProtocolList; #ifndef XmIsProtocol #define XmIsProtocol(w) XtIsSubclass(w, xmProtocolObjectClass) #endif /* XmIsProtocol */ /* Class record constants */ externalref XmProtocolClassRec xmProtocolClassRec; externalref WidgetClass xmProtocolObjectClass; typedef struct _XmProtocolMgrRec{ Atom property; XmProtocolList protocols; Cardinal num_protocols; Cardinal max_protocols; }XmProtocolMgrRec, *XmProtocolMgr, **XmProtocolMgrList; typedef struct _XmAllProtocolsMgrRec{ XmProtocolMgrList protocol_mgrs; Cardinal num_protocol_mgrs; Cardinal max_protocol_mgrs; Widget shell; }XmAllProtocolsMgrRec, *XmAllProtocolsMgr; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmProtocolsP_h */ motif-2.3.8/lib/Xm/PrimitiveI.h0000644000175000017500000001033312672140200013141 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: PrimitiveI.h /main/5 1995/07/13 17:41:15 drk $ */ #ifndef _XmPrimitiveI_h #define _XmPrimitiveI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmTraverseLeft( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraverseRight( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraverseUp( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraverseDown( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraverseNext( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraversePrev( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraverseHome( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraverseNextTabGroup( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmTraversePrevTabGroup( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveHelp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveParentActivate( Widget pw, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveParentCancel( Widget pw, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmButtonTakeFocus( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmMenuButtonTakeFocus( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmMenuButtonTakeFocusUp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPrimitiveI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/SSpinBP.h0000644000175000017500000000721413145162623012353 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /****************************************************************************** * * File: SSpinBP.h * Date: June 1, 1995 * Author: Mitchell Greess * * Contents: * Private header file for the XmSimpleSpinBox widget. * Implements the XmSimpleSpinBox. * ******************************************************************************/ #ifndef _XmSSpinBP_h #define _XmSSpinBP_h #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmSimpleSpinBoxConstraint { int unused; } XmSimpleSpinBoxConstraintPart, *XmSimpleSpinBoxConstraint; typedef struct _XmSimpleSpinBoxConstraintRec { XmManagerConstraintPart manager; XmSpinBoxConstraintPart spinBox; XmSimpleSpinBoxConstraintPart simpleSpinBox; } XmSimpleSpinBoxConstraintRec, *XmSimpleSpinBoxConstraintPtr; /* Simple Spin Box class structure */ typedef struct _XmSimpleSpinBoxClassPart { XtPointer extension; /* not used */ } XmSimpleSpinBoxClassPart; /* Full class record declaration for Simple Spin Box class */ typedef struct _XmSimpleSpinBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmSpinBoxClassPart spinBox_class; XmSimpleSpinBoxClassPart simpleSpinBox_class; } XmSimpleSpinBoxClassRec; externalref XmSimpleSpinBoxClassRec xmSimpleSpinBoxClassRec; /* The Simple Spin Box instance record */ typedef struct _XmSimpleSpinBoxPart { /* * (Public) resources */ unsigned char arrow_sensitivity; Boolean wrap; /* Resources for autonumeric mode */ short decimal_points; int increment_value; int maximum_value; int minimum_value; /* Resources for string values mode */ int num_values; /* number of XmString in the array */ int position; /* 1-based pos'n of current selection */ unsigned char position_type; /* governs interpretation of .position: XmPOSITION_{ARRAY,VALUE} */ XmStringTable values; /* array of XmString */ /* Resources for the text field child of the XmSimpleSpinBox */ short columns; /* number of columns */ Boolean editable; /* whether the text field is editable */ unsigned char sb_child_type; /* XmSTRING or XmNUMERIC */ Widget text_field; /* (Private) state */ } XmSimpleSpinBoxPart; /* Full instance record declaration */ typedef struct _XmSimpleSpinBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmSpinBoxPart spinBox; XmSimpleSpinBoxPart simpleSpinBox; } XmSimpleSpinBoxRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _SSpinBP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ColorS.h0000644000175000017500000000415512672140200012266 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmColorSelector_h #define _XmColorSelector_h #if defined(VMS) || defined(__VMS) #include #endif #include #if defined(__cplusplus) extern "C" { #endif typedef struct _XmColorSelectorClassRec *XmColorSelectorWidgetClass; typedef struct _XmColorSelectorRec *XmColorSelectorWidget; /* Function Name: XmCreateColorSelector * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateColorSelector( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); /* * Variable argument list functions */ extern Widget XmVaCreateColorSelector( Widget parent, char *name, ...); extern Widget XmVaCreateManagedColorSelector( Widget parent, char *name, ...); extern WidgetClass xmColorSelectorWidgetClass; #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmColorSelect_h DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Obso1_2.c0000644000175000017500000016735312672140200012276 00000000000000/* $XConsortium: Obso1_2.c /main/7 1996/06/14 23:10:17 pascale $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BulletinBI.h" #include "MessagesI.h" #include "SelectioBI.h" #include "SyntheticI.h" #include "TraversalI.h" #include "XmStringI.h" /* for _XmStringGetTextConcat() */ typedef struct { int segment_size; char* start; char* current; int bytes_remaining; } XmHeapRec, *XmHeap; /******** Static Function Declarations ********/ /******** End Static Function Declarations ********/ externaldef(desktopobjectclass) WidgetClass xmDesktopObjectClass = (WidgetClass) &xmDesktopClassRec; externaldef(displayobjectclass) WidgetClass xmDisplayObjectClass = (WidgetClass) (&xmDisplayClassRec); externaldef(screenobjectclass) WidgetClass xmScreenObjectClass = (WidgetClass) (&xmScreenClassRec); externaldef(worldobjectclass) WidgetClass xmWorldObjectClass = (WidgetClass) NULL; /* WorldP.h was defuncted for 2.0 , no more ref to (&xmWorldClassRec) */ int XmTextFieldGetBaseLine( Widget w ) { return XmTextFieldGetBaseline( w) ; } int XmTextGetBaseLine( Widget w ) { return XmTextGetBaseline( w) ; } /*ARGSUSED*/ Boolean _XmTestTraversability( Widget widget, XRectangle *visRect ) /* unused */ { return XmIsTraversable( widget) ; } /*ARGSUSED*/ void _XmClearTabGroup( Widget w ) /* unused */ { return ; } Widget _XmFindTabGroup( Widget widget ) { return XmGetTabGroup( widget) ; } /*ARGSUSED*/ void _XmClearKbdFocus( Widget tabGroup ) /* unused */ { return ; } Widget _XmGetTabGroup( Widget w ) { return XmGetTabGroup( w) ; } /*ARGSUSED*/ Boolean _XmWidgetIsTraversable( Widget widget, #if NeedWidePrototypes int navType, /* unused */ #else XmNavigationType navType, /* unused */ #endif /* NeedWidePrototypes */ XRectangle *visRect ) /* unused */ { return XmIsTraversable( widget) ; } Boolean _XmGetManagedInfo( Widget w ) { /* Depending upon the widget coming in, extract its mapped_when_managed flag * and its managed flag. */ if (XmIsPrimitive (w)) return (w->core.managed && w->core.mapped_when_managed); else if (XmIsGadget (w)) return (w->core.managed); else { /* Treat menupanes specially */ if (XmIsRowColumn(w) && XmIsMenuShell(XtParent(w))) { return (True); } else return (w->core.managed && w->core.mapped_when_managed); } } Boolean _XmChangeNavigationType( Widget current, #if NeedWidePrototypes int newNavType ) #else XmNavigationType newNavType ) #endif /* NeedWidePrototypes */ { /* This is a convenience routine for widgets wanting to change * their navigation type without using XtSetValues(). */ XmFocusData focusData ; Widget new_wid = current->core.self ; XmNavigationType curNavType = _XmGetNavigationType( current) ; XmTravGraph tgraph ; if( (curNavType != newNavType) && (focusData = _XmGetFocusData( new_wid)) && (tgraph = &(focusData->trav_graph))->num_entries ) { _XmTravGraphUpdate( tgraph, new_wid) ; if( (focusData->focus_policy == XmEXPLICIT) && (focusData->focus_item == new_wid) && !XmIsTraversable( new_wid) ) { Widget new_focus = _XmTraverseAway( tgraph, new_wid, (focusData->active_tab_group != new_wid)) ; if( !new_focus ) { new_focus = new_wid ; } _XmMgrTraversal( new_focus, XmTRAVERSE_CURRENT) ; } } return TRUE ; } /********************************************************************/ /* Following is the old code needed for subclasses already using it */ /* They can either define the macro and change nothing (but suffer the addition of code and the drawing performance) or adapt to the new interface (better) */ /************************************************************************ * * Primitive:_XmDrawShadow, become XmDrawShadow * * Draw an n segment wide bordering shadow on the drawable * d, using the provided GC's and rectangle. * ************************************************************************/ void _XmDrawShadow (Display *display, Drawable d, GC top_GC, GC bottom_GC, int size, int x, int y, int width, int height) { static XRectangle * rects = NULL; static int rect_count = 0; register int i; register int size2; register int size3; if (size <= 0) return; if (size > width / 2) size = width / 2; if (size > height / 2) size = height / 2; if (size <= 0) return; if (rect_count == 0) { rects = (XRectangle *) XtMalloc (sizeof (XRectangle) * size * 4); rect_count = size; } if (rect_count < size) { rects = (XRectangle *) XtRealloc((char *)rects, sizeof (XRectangle) * size * 4); rect_count = size; } size2 = size + size; size3 = size2 + size; for (i = 0; i < size; i++) { /* Top segments */ rects[i].x = x; rects[i].y = y + i; rects[i].width = width - i; rects[i].height = 1; /* Left segments */ rects[i + size].x = x + i; rects[i + size].y = y; rects[i + size].width = 1; rects[i + size].height = height - i; /* Bottom segments */ rects[i + size2].x = x + i + 1; rects[i + size2].y = y + height - i - 1; rects[i + size2].width = width - i - 1; rects[i + size2].height = 1; /* Right segments */ rects[i + size3].x = x + width - i - 1; rects[i + size3].y = y + i + 1; rects[i + size3].width = 1; rects[i + size3].height = height - i - 1; } XFillRectangles (display, d, top_GC, &rects[0], size2); XFillRectangles (display, d, bottom_GC, &rects[size2], size2); } /************************************************************************ * * Primitive:_XmEraseShadow become XmClearShadow * * Erase an n segment wide bordering shadow on the drawable * d, using the provided rectangle. * ************************************************************************/ void _XmEraseShadow (Display *display, Drawable d, int size, int x, int y, int width, int height) { if (width > 0 && size > 0) { XClearArea (display, d, x, y, width, size, FALSE); XClearArea (display, d, x, y + height - size, width, size, FALSE); } if (size > 0 && height - (2 * size) > 0) { XClearArea (display, d, x, y + size, size, height - (2 * size), FALSE); XClearArea (display, d, x + width - size, y + size, size, height - (2 * size), FALSE); } } /************************************************************************ * ArrowBI:_XmGetArrowDrawRects, become XmDrawArrow * * Calculate the drawing rectangles. * ************************************************************************/ void _XmGetArrowDrawRects (int highlight_thickness, int shadow_thickness, unsigned int direction, int core_width, int core_height, short *top_count, short *cent_count, short *bot_count, XRectangle **top, XRectangle **cent, XRectangle **bot) { /* Arrow rectangle generation function */ int size, width, start; register int y; XRectangle *tmp; register int temp; short t = 0; short b = 0; short c = 0; int xOffset = 0; int yOffset = 0; /* Free the old lists */ if (*top != NULL) { XtFree ((char *) *top); *top = NULL; XtFree ((char *) *cent); *cent = NULL; XtFree ((char *) *bot); *bot = NULL; *top_count = 0; *cent_count = 0; *bot_count = 0; } /* Get the size and allocate the rectangle lists */ if (core_width > core_height) { size = core_height - 2 - 2 * (highlight_thickness + shadow_thickness); xOffset = (core_width - core_height) / 2; } else { size = core_width - 2 - 2 * (highlight_thickness + shadow_thickness); yOffset = (core_height - core_width) / 2; } if (size < 1) return; if (direction == XmARROW_RIGHT || direction == XmARROW_LEFT) { temp = xOffset; xOffset = yOffset; yOffset = temp; } *top = (XRectangle *) XtMalloc (sizeof (XRectangle) * (size / 2 + 6)); *cent = (XRectangle *) XtMalloc (sizeof (XRectangle) * (size / 2 + 6)); *bot = (XRectangle *) XtMalloc (sizeof (XRectangle) * (size / 2 + 6)); /* Set up a loop to generate the segments. */ width = size; y = size + highlight_thickness + shadow_thickness - 1 + yOffset; start = highlight_thickness + shadow_thickness + 1 + xOffset; while (width > 0) { if (width == 1) { (*top)[t].x = start; (*top)[t].y = y + 1; (*top)[t].width = 1; (*top)[t].height = 1; t++; } else if (width == 2) { if (size == 2 || (direction == XmARROW_UP || direction == XmARROW_LEFT)) { (*top)[t].x = start; (*top)[t].y = y; (*top)[t].width = 2; (*top)[t].height = 1; t++; (*top)[t].x = start; (*top)[t].y = y + 1; (*top)[t].width = 1; (*top)[t].height = 1; t++; (*bot)[b].x = start + 1; (*bot)[b].y = y + 1; (*bot)[b].width = 1; (*bot)[b].height = 1; b++; } else if (direction == XmARROW_UP || direction == XmARROW_LEFT) { (*top)[t].x = start; (*top)[t].y = y; (*top)[t].width = 2; (*top)[t].height = 1; t++; (*bot)[b].x = start; (*bot)[b].y = y + 1; (*bot)[b].width = 2; (*bot)[b].height = 1; b++; } } else { if (start == highlight_thickness + shadow_thickness + 1 + xOffset) { if (direction == XmARROW_UP || direction == XmARROW_LEFT) { (*top)[t].x = start; (*top)[t].y = y; (*top)[t].width = 2; (*top)[t].height = 1; t++; (*top)[t].x = start; (*top)[t].y = y + 1; (*top)[t].width = 1; (*top)[t].height = 1; t++; (*bot)[b].x = start + 1; (*bot)[b].y = y + 1; (*bot)[b].width = 1; (*bot)[b].height = 1; b++; (*bot)[b].x = start + 2; (*bot)[b].y = y; (*bot)[b].width = width - 2; (*bot)[b].height = 2; b++; } else { (*top)[t].x = start; (*top)[t].y = y; (*top)[t].width = 2; (*top)[t].height = 1; t++; (*bot)[b].x = start; (*bot)[b].y = y + 1; (*bot)[b].width = 2; (*bot)[b].height = 1; b++; (*bot)[b].x = start + 2; (*bot)[b].y = y; (*bot)[b].width = width - 2; (*bot)[b].height = 2; b++; } } else { (*top)[t].x = start; (*top)[t].y = y; (*top)[t].width = 2; (*top)[t].height = 2; t++; (*bot)[b].x = start + width - 2; (*bot)[b].y = y; (*bot)[b].width = 2; (*bot)[b].height = 2; if (width == 3) { (*bot)[b].width = 1; (*bot)[b].x += 1; } b++; if (width > 4) { (*cent)[c].x = start + 2; (*cent)[c].y = y; (*cent)[c].width = width - 4; (*cent)[c].height = 2; c++; } } } start++; width -= 2; y -= 2; } if (direction == XmARROW_UP || direction == XmARROW_LEFT) { *top_count = t; *cent_count = c; *bot_count = b; } else { tmp = *top; *top = *bot; *bot = tmp; *top_count = b; *cent_count = c; *bot_count = t; } /* Transform the "up" pointing arrow to the correct direction */ switch (direction) { case XmARROW_LEFT: { register int i; i = -1; do { i++; if (i < *top_count) { temp = (*top)[i].y; (*top)[i].y = (*top)[i].x; (*top)[i].x = temp; temp = (*top)[i].width; (*top)[i].width = (*top)[i].height; (*top)[i].height = temp; } if (i < *bot_count) { temp = (*bot)[i].y; (*bot)[i].y = (*bot)[i].x; (*bot)[i].x = temp; temp = (*bot)[i].width; (*bot)[i].width = (*bot)[i].height; (*bot)[i].height = temp; } if (i < *cent_count) { temp = (*cent)[i].y; (*cent)[i].y = (*cent)[i].x; (*cent)[i].x = temp; temp = (*cent)[i].width; (*cent)[i].width = (*cent)[i].height; (*cent)[i].height = temp; } } while (i < *top_count || i < *bot_count || i < *cent_count); } break; case XmARROW_RIGHT: { register int h_right = core_height - 2; register int w_right = core_width - 2; register int i; i = -1; do { i++; if (i < *top_count) { temp = (*top)[i].y; (*top)[i].y = (*top)[i].x; (*top)[i].x = temp; temp = (*top)[i].width; (*top)[i].width = (*top)[i].height; (*top)[i].height = temp; (*top)[i].x = w_right - (*top)[i].x - (*top)[i].width + 2; (*top)[i].y = h_right - (*top)[i].y - (*top)[i].height + 2; } if (i < *bot_count) { temp = (*bot)[i].y; (*bot)[i].y = (*bot)[i].x; (*bot)[i].x = temp; temp = (*bot)[i].width; (*bot)[i].width = (*bot)[i].height; (*bot)[i].height = temp; (*bot)[i].x = w_right - (*bot)[i].x - (*bot)[i].width + 2; (*bot)[i].y = h_right - (*bot)[i].y - (*bot)[i].height + 2; } if (i < *cent_count) { temp = (*cent)[i].y; (*cent)[i].y = (*cent)[i].x; (*cent)[i].x = temp; temp = (*cent)[i].width; (*cent)[i].width = (*cent)[i].height; (*cent)[i].height = temp; (*cent)[i].x = w_right - (*cent)[i].x - (*cent)[i].width + 2; (*cent)[i].y = h_right - (*cent)[i].y - (*cent)[i].height + 2; } } while (i < *top_count || i < *bot_count || i < *cent_count); } break; case XmARROW_UP: { } break; case XmARROW_DOWN: { register int w_down = core_width - 2; register int h_down = core_height - 2; register int i; i = -1; do { i++; if (i < *top_count) { (*top)[i].x = w_down - (*top)[i].x - (*top)[i].width + 2; (*top)[i].y = h_down - (*top)[i].y - (*top)[i].height + 2; } if (i < *bot_count) { (*bot)[i].x = w_down - (*bot)[i].x - (*bot)[i].width + 2; (*bot)[i].y = h_down - (*bot)[i].y - (*bot)[i].height + 2; } if (i < *cent_count) { (*cent)[i].x = w_down - (*cent)[i].x - (*cent)[i].width + 2; (*cent)[i].y = h_down - (*cent)[i].y - (*cent)[i].height + 2; } } while (i < *top_count || i < *bot_count || i < *cent_count); } break; } } /************************************************************************ * * ArrowBI:_XmOffsetArrow, become XmDrawArrow * * Offset the arrow drawing rectangles, if needed, by the difference * of the current x, y and the saved x, y); * ************************************************************************/ void _XmOffsetArrow (int diff_x, int diff_y, XRectangle *top, XRectangle *cent, XRectangle *bot, int top_count, int cent_count, int bot_count) { register int i; if (diff_x != 0 || diff_y != 0) { for (i = 0; i < top_count; i++) { (top + i)->x += diff_x; (top + i)->y += diff_y; } for (i = 0; i < cent_count; i++) { (cent + i)->x += diff_x; (cent + i)->y += diff_y; } for (i = 0; i < bot_count; i++) { (bot + i)->x += diff_x; (bot + i)->y += diff_y; } } } /*************************************<->************************************* * * ToggleBI:_DrawSquareButton, become code * * *************************************<->***********************************/ void _XmDrawSquareButton (Widget w, int x, int y, int size, GC topGC, GC bottomGC, GC centerGC, #if NeedWidePrototypes int fill) #else Boolean fill) #endif /* NeedWidePrototypes */ { _XmDrawShadow (XtDisplay (w), XtWindow (w), topGC, bottomGC, 2, x, y, size, size); if (fill) if (size > 6) XFillRectangle (XtDisplay ((Widget) w), XtWindow ((Widget) w), centerGC, ((fill) ? x+2 : x+3), ((fill) ? y+2 : y+3), ((fill) ? size-4 : size-6), ((fill) ? size-4 : size-6)); } /************************************************************************ * * ToggleBI:DrawDiamondButton, become XmDrawDiamond * * The diamond drawing routine. Used in place of widgets or gadgets * draw routine when toggleButton's indicatorType is one_of_many. * ************************************************************************/ void _XmDrawDiamondButton (Widget tw, int x, int y, int size, GC topGC, GC bottomGC, GC centerGC, #if NeedWidePrototypes int fill ) #else Boolean fill) #endif /* NeedWidePrototypes */ { XSegment seg[12]; XPoint pt[5]; int midX, midY; if (size % 2 == 0) size--; midX = x + (size + 1) / 2; midY = y + (size + 1) / 2; /* COUNTER REVERSE DRAWING EFFECT ON TINY ToggleButtonS */ if (size <= 3) { /* The top shadow segments */ seg[0].x1 = x + size - 1; /* 1 */ seg[0].y1 = midY - 1; seg[0].x2 = midX - 1; /* 2 */ seg[0].y2 = y + size - 1; seg[1].x1 = x + size - 2; /* 3 */ seg[1].y1 = midY - 1; seg[1].x2 = midX - 1; /* 4 */ seg[1].y2 = y + size - 2; seg[2].x1 = x + size - 3; /* 3 */ seg[2].y1 = midY - 1; seg[2].x2 = midX - 1; /* 4 */ seg[2].y2 = y + size - 3; /*--*/ seg[3].x1 = midX - 1; /* 5 */ seg[3].y1 = y + size - 1; seg[3].x2 = x; /* 6 */ seg[3].y2 = midY - 1; seg[4].x1 = midX - 1; /* 7 */ seg[4].y1 = y + size - 2; seg[4].x2 = x + 1; /* 8 */ seg[4].y2 = midY - 1; seg[5].x1 = midX - 1; /* 7 */ seg[5].y1 = y + size - 3; seg[5].x2 = x + 2; /* 8 */ seg[5].y2 = midY - 1; /* The bottom shadow segments */ seg[6].x1 = x + size - 1; /* 9 */ seg[6].y1 = midY - 1; seg[6].x2 = midX - 1; /* 10 */ seg[6].y2 = y; seg[7].x1 = x + size - 2; /* 11 */ seg[7].y1 = midY - 1; seg[7].x2 = midX - 1; /* 12 */ seg[7].y2 = y + 1; seg[8].x1 = x + size - 3; /* 11 */ seg[8].y1 = midY - 1; seg[8].x2 = midX - 1; /* 12 */ seg[8].y2 = y + 2; /*--*/ seg[9].x1 = midX - 1; /* 13 */ seg[9].y1 = y; seg[9].x2 = x; /* 14 */ seg[9].y2 = midY - 1; seg[10].x1 = midX - 1; /* 15 */ seg[10].y1 = y + 1; seg[10].x2 = x + 1; /* 16 */ seg[10].y2 = midY - 1; seg[11].x1 = midX - 1; /* 15 */ seg[11].y1 = y + 2; seg[11].x2 = x + 2; /* 16 */ seg[11].y2 = midY - 1; } else /* NORMAL SIZED ToggleButtonS */ { /* The top shadow segments */ seg[0].x1 = x; /* 1 */ seg[0].y1 = midY - 1; seg[0].x2 = midX - 1; /* 2 */ seg[0].y2 = y; seg[1].x1 = x + 1; /* 3 */ seg[1].y1 = midY - 1; seg[1].x2 = midX - 1; /* 4 */ seg[1].y2 = y + 1; seg[2].x1 = x + 2; /* 3 */ seg[2].y1 = midY - 1; seg[2].x2 = midX - 1; /* 4 */ seg[2].y2 = y + 2; /*--*/ seg[3].x1 = midX - 1; /* 5 */ seg[3].y1 = y; seg[3].x2 = x + size - 1; /* 6 */ seg[3].y2 = midY - 1; seg[4].x1 = midX - 1; /* 7 */ seg[4].y1 = y + 1; seg[4].x2 = x + size - 2; /* 8 */ seg[4].y2 = midY - 1; seg[5].x1 = midX - 1; /* 7 */ seg[5].y1 = y + 2; seg[5].x2 = x + size - 3; /* 8 */ seg[5].y2 = midY - 1; /* The bottom shadow segments */ seg[6].x1 = x; /* 9 */ seg[6].y1 = midY - 1; seg[6].x2 = midX - 1; /* 10 */ seg[6].y2 = y + size - 1; seg[7].x1 = x + 1; /* 11 */ seg[7].y1 = midY - 1; seg[7].x2 = midX - 1; /* 12 */ seg[7].y2 = y + size - 2; seg[8].x1 = x + 2; /* 11 */ seg[8].y1 = midY - 1; seg[8].x2 = midX - 1; /* 12 */ seg[8].y2 = y + size - 3; /*--*/ seg[9].x1 = midX - 1; /* 13 */ seg[9].y1 = y + size - 1; seg[9].x2 = x + size - 1; /* 14 */ seg[9].y2 = midY - 1; seg[10].x1 = midX - 1; /* 15 */ seg[10].y1 = y + size - 2; seg[10].x2 = x + size - 2; /* 16 */ seg[10].y2 = midY - 1; seg[11].x1 = midX - 1; /* 15 */ seg[11].y1 = y + size - 3; seg[11].x2 = x + size - 3; /* 16 */ seg[11].y2 = midY - 1; } XDrawSegments (XtDisplay ((Widget) tw), XtWindow ((Widget) tw), topGC, &seg[3], 3); XDrawSegments (XtDisplay ((Widget) tw), XtWindow ((Widget) tw), bottomGC, &seg[6], 6); XDrawSegments (XtDisplay ((Widget) tw), XtWindow ((Widget) tw), topGC, &seg[0], 3); /* For Fill */ if (fill) { pt[0].x = x + 3; pt[0].y = midY - 1; pt[1].x = midX - 1 ; pt[1].y = y + 2; pt[2].x = x + size - 3; pt[2].y = midY - 1; pt[3].x = midX - 1 ; pt[3].y = y + size - 3; } else { pt[0].x = x + 4; pt[0].y = midY - 1; pt[1].x = midX - 1; pt[1].y = y + 3; pt[2].x = x + size - 4; pt[2].y = midY - 1; pt[3].x = midX - 1; pt[3].y = y + size - 4; } /* NOTE: code which handled the next two ifs by setting pt[1-3] to match pt[0] values was replaced with return statements because passing 4 identical coordinates to XFillPolygon caused the PMAX to give a bus error. Dana@HP reports that the call is legitimate and that the error is in the PMAX server. The return statements will stay until the situation with the PMAX is resolved. (mitch) */ /* COUNTER REVERSE DRAWING EFFECT ON TINY ToggleButtonS */ if (pt[0].x > pt[1].x) { return; } if (pt[0].y < pt[1].y) { return; } XFillPolygon (XtDisplay ((Widget) tw), XtWindow ((Widget) tw), centerGC, pt, 4, Convex, CoordModeOrigin); } /************************************************************************ * * Manager:XmDrawEtchedShadow, become XmDrawShadow * * Draw an n segment wide etched shadow on the drawable * d, using the provided GC's and rectangle. * ************************************************************************/ static XRectangle *rects = NULL; static int rect_count = 0; static void get_rects( int max_i, register int offset, register int x, register int y, register int width, register int height, register int pos_top, register int pos_left, register int pos_bottom, register int pos_right) { register int i; register int offsetX2; for (i = 0; i < max_i; i++, offset++) { offsetX2 = offset + offset; /* Top segments */ rects[pos_top + i].x = x + offset; rects[pos_top + i].y = y + offset; rects[pos_top + i].width = width - offsetX2 -1; rects[pos_top + i].height = 1; /* Left segments */ rects[pos_left + i].x = x + offset; rects[pos_left + i].y = y + offset; rects[pos_left + i].width = 1; rects[pos_left + i].height = height - offsetX2 - 1; /* Bottom segments */ rects[pos_bottom + i].x = x + offset; rects[pos_bottom + i].y = y + height - offset - 1; rects[pos_bottom + i].width = width - offsetX2; rects[pos_bottom + i].height = 1; /* Right segments */ rects[pos_right + i].x = x + width - offset - 1; rects[pos_right + i].y = y + offset; rects[pos_right + i].width = 1; rects[pos_right + i].height = height - offsetX2; } } static void XmDrawEtchedShadow ( Display * display, Drawable d, GC top_GC, GC bottom_GC, register int size, register int x, register int y, register int width, register int height) { int half_size; int size2; int size3; int pos_top, pos_left, pos_bottom, pos_right; if (size <= 0) return; if (size == 1) { _XmDrawShadow (display, d, top_GC, bottom_GC, size, x, y, width, height); return; } if (size > width / 2) size = width / 2; if (size > height / 2) size = height / 2; if (size <= 0) return; size = (size % 2) ? (size-1) : (size); half_size = size / 2; size2 = size + size; size3 = size2 + size; if (rect_count == 0) { rects = (XRectangle *) XtMalloc (sizeof (XRectangle) * size * 4); rect_count = size; } if (rect_count < size) { rects = (XRectangle *) XtRealloc((char *)rects, sizeof (XRectangle) * size * 4); rect_count = size; } pos_top = 0; pos_left = half_size; pos_bottom = size2; pos_right = size2 + half_size; get_rects(half_size, 0, x, y, width, height, pos_top, pos_left, pos_bottom, pos_right); pos_top = size3; pos_left = size3 + half_size; pos_bottom = size; pos_right = size + half_size; get_rects(half_size, half_size, x, y, width, height, pos_top, pos_left, pos_bottom, pos_right); XFillRectangles (display, d, bottom_GC, &rects[size2], size2); XFillRectangles (display, d, top_GC, &rects[0], size2); } /***************************************************************** * Manager:_XmDrawShadowType, become XmDrawShadow *****************************************************************/ void _XmDrawShadowType (Widget w, unsigned int shadow_type, #if NeedWidePrototypes int core_width, int core_height, int shadow_thickness, int highlight_thickness, #else Dimension core_width, Dimension core_height, Dimension shadow_thickness, Dimension highlight_thickness, #endif GC top_shadow_GC, GC bottom_shadow_GC) { if (!XtIsRealized(w)) return; switch (shadow_type) { case XmSHADOW_IN: case XmSHADOW_OUT: if (shadow_thickness > 0) _XmDrawShadow (XtDisplay (w), XtWindow (w), (shadow_type == XmSHADOW_IN) ? bottom_shadow_GC : top_shadow_GC, (shadow_type == XmSHADOW_IN) ? top_shadow_GC : bottom_shadow_GC, shadow_thickness, highlight_thickness, highlight_thickness, core_width - 2 * highlight_thickness, core_height - 2 * highlight_thickness); break; case XmSHADOW_ETCHED_IN: case XmSHADOW_ETCHED_OUT: XmDrawEtchedShadow (XtDisplay(w), XtWindow(w), (shadow_type == XmSHADOW_ETCHED_IN) ? bottom_shadow_GC : top_shadow_GC, (shadow_type == XmSHADOW_ETCHED_IN) ? top_shadow_GC : bottom_shadow_GC, shadow_thickness, highlight_thickness, highlight_thickness, core_width - 2 * highlight_thickness, core_height - 2 * highlight_thickness); break; } } /************************************************************************ * Primitive:_XmDrawBorder, become XmDrawHighlight ************************************************************************/ void _XmDrawBorder ( Widget w, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int highlight_width) #else Position x, Position y, Dimension width, Dimension height, Dimension highlight_width) #endif /* NeedWidePrototypes */ { XRectangle rect[4]; rect[0].x = x; rect[0].y = y; rect[0].width = width; rect[0].height = highlight_width; rect[1].x = x; rect[1].y = y; rect[1].width = highlight_width; rect[1].height = height; rect[2].x = x + width - highlight_width; rect[2].y = y; rect[2].width = highlight_width; rect[2].height = height; rect[3].x = x; rect[3].y = y + height - highlight_width; rect[3].width = width; rect[3].height = highlight_width; XFillRectangles (XtDisplay (w), XtWindow (w), gc, &rect[0], 4); } /*************************************************************** All these functions were private but global in 1.1, so instead of just moving them static, we also provide the compatibility stuff. They are just wrapping around the new static names ****************************************************************/ void _XmFileSelectionBoxCreateFilterLabel( XmFileSelectionBoxWidget fsb ) { FS_FilterLabel( fsb) = _XmBB_CreateLabelG( (Widget) fsb, FS_FilterLabelString( fsb), "FilterLabel", XmFilterStringLoc) ; } void _XmFileSelectionBoxCreateDirListLabel( XmFileSelectionBoxWidget fsb ) { FS_DirListLabel( fsb) = _XmBB_CreateLabelG( (Widget) fsb, FS_DirListLabelString( fsb), "Dir", XmDirListStringLoc) ; } /*****************************************************************/ void _XmFileSelectionBoxCreateDirList( XmFileSelectionBoxWidget fsb ) { Arg al[20]; register int ac = 0; XtCallbackProc callbackProc ; /****************/ FS_DirListSelectedItemPosition( fsb) = 0 ; XtSetArg( al[ac], XmNvisibleItemCount, SB_ListVisibleItemCount( fsb)) ; ac++ ; XtSetArg( al[ac], XmNstringDirection, SB_StringDirection( fsb)); ac++; XtSetArg( al[ac], XmNselectionPolicy, XmBROWSE_SELECT); ac++; XtSetArg( al[ac], XmNlistSizePolicy, XmCONSTANT); ac++; XtSetArg( al[ac], XmNscrollBarDisplayPolicy, XmSTATIC); ac++; XtSetArg( al[ac], XmNnavigationType, XmSTICKY_TAB_GROUP) ; ++ac ; FS_DirList( fsb) = XmCreateScrolledList( (Widget) fsb, "DirList", al, ac); callbackProc = ((XmSelectionBoxWidgetClass) fsb->core.widget_class) ->selection_box_class.list_callback ; if( callbackProc ) { XtAddCallback( FS_DirList( fsb), XmNsingleSelectionCallback, callbackProc, (XtPointer) fsb) ; XtAddCallback( FS_DirList( fsb), XmNbrowseSelectionCallback, callbackProc, (XtPointer) fsb) ; XtAddCallback( FS_DirList( fsb), XmNdefaultActionCallback, callbackProc, (XtPointer) fsb) ; } XtManageChild( FS_DirList( fsb)) ; return ; } /*****************************************************************/ void _XmFileSelectionBoxCreateFilterText( XmFileSelectionBoxWidget fs ) { Arg arglist[10] ; int argCount ; char * stext_value ; XtAccelerators temp_accelerators ; /****************/ /* Get text portion from Compound String, and set * fs_stext_charset and fs_stext_direction bits... */ /* Should do this stuff entirely with XmStrings when the text * widget supports it. */ if( !(stext_value = _XmStringGetTextConcat( FS_Pattern( fs))) ) { stext_value = (char *) XtMalloc( 1) ; stext_value[0] = '\0' ; } argCount = 0 ; XtSetArg( arglist[argCount], XmNcolumns, SB_TextColumns( fs)) ; argCount++ ; XtSetArg( arglist[argCount], XmNresizeWidth, FALSE) ; argCount++ ; XtSetArg( arglist[argCount], XmNvalue, stext_value) ; argCount++ ; XtSetArg( arglist[argCount], XmNnavigationType, XmSTICKY_TAB_GROUP) ; argCount++ ; FS_FilterText( fs) = XmCreateTextField( (Widget) fs, "FilterText", arglist, argCount) ; /* Install text accelerators. */ temp_accelerators = fs->core.accelerators ; fs->core.accelerators = SB_TextAccelerators( fs) ; XtInstallAccelerators( FS_FilterText( fs), (Widget) fs) ; fs->core.accelerators = temp_accelerators ; XtFree( stext_value) ; return ; } /****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetDirectory( Widget fs, int resource, /* unused */ XtArgVal *value) { XmString data ; data = XmStringCopy(FS_Directory(fs)); *value = (XtArgVal) data ; } /****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetNoMatchString( Widget fs, int resource, /* unused */ XtArgVal *value) { XmString data ; data = XmStringCopy(FS_NoMatchString(fs)); *value = (XtArgVal) data ; } /****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetPattern( Widget fs, int resource, /* unused */ XtArgVal *value) { XmString data ; data = XmStringCopy(FS_Pattern(fs)); *value = (XtArgVal) data ; } /*****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetFilterLabelString( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( FS_FilterLabel( fs), al, 1) ; *value = (XtArgVal) data ; } /*****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetDirListLabelString( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( FS_DirListLabel( fs), al, 1) ; *value = (XtArgVal) data ; } /*****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetDirListItems( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; XtSetArg( al[0], XmNitems, &data) ; XtGetValues( FS_DirList( fs), al, 1) ; *value = (XtArgVal) data ; } /*****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetDirListItemCount( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; XtSetArg( al[0], XmNitemCount, &data) ; XtGetValues( FS_DirList( fs), al, 1) ; *value = (XtArgVal) data ; } /*****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetListItems( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; if( FS_StateFlags( fs) & XmFS_NO_MATCH ) { *value = (XtArgVal) NULL ; } else { XtSetArg( al[0], XmNitems, &data) ; XtGetValues( SB_List( fs), al, 1) ; *value = (XtArgVal) data ; } } /*****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetListItemCount( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; /****************/ if( FS_StateFlags( fs) & XmFS_NO_MATCH ) { *value = (XtArgVal) 0 ; } else { XtSetArg( al[0], XmNitemCount, &data) ; XtGetValues( SB_List( fs), al, 1) ; *value = (XtArgVal) data ; } } /*****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxGetDirMask( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { String filterText ; XmString data ; filterText = XmTextFieldGetString( FS_FilterText(fs)) ; data = XmStringGenerate(filterText, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; *value = (XtArgVal) data ; XtFree( filterText) ; return ; } /****************************************************************/ static Widget GetActiveText( XmFileSelectionBoxWidget fsb, XEvent *event ) { Widget activeChild = NULL ; /****************/ if( _XmGetFocusPolicy( (Widget) fsb) == XmEXPLICIT ) { if( (fsb->manager.active_child == SB_Text( fsb)) || (fsb->manager.active_child == FS_FilterText( fsb)) ) { activeChild = fsb->manager.active_child ; } } else { if( SB_Text( fsb) && (XtWindow( SB_Text( fsb)) == ((XKeyPressedEvent *) event)->window) ) { activeChild = SB_Text( fsb) ; } else { if( FS_FilterText( fsb) && (XtWindow( FS_FilterText( fsb)) == ((XKeyPressedEvent *) event)->window) ) { activeChild = FS_FilterText( fsb) ; } } } return( activeChild) ; } /****************************************************************/ /*ARGSUSED*/ void _XmFileSelectionBoxUpOrDown( Widget wid, XEvent *event, String *argv, Cardinal *argc ) /* unused */ { XmFileSelectionBoxWidget fsb = (XmFileSelectionBoxWidget) wid ; int visible ; int top ; int key_pressed ; Widget list ; int * position ; int count ; Widget activeChild ; Arg av[5] ; Cardinal ac ; /****************/ if( !(activeChild = GetActiveText( fsb, event)) ) { return ; } if( activeChild == SB_Text( fsb) ) { if( FS_StateFlags( fsb) & XmFS_NO_MATCH ) { return ; } list = SB_List( fsb) ; position = &SB_ListSelectedItemPosition( fsb) ; } else /* activeChild == FS_FilterText( fsb) */ { list = fsb->file_selection_box.dir_list ; position = &FS_DirListSelectedItemPosition( fsb) ; } if( !list ) { return ; } ac = 0 ; XtSetArg( av[ac], XmNitemCount, &count) ; ++ac ; XtSetArg( av[ac], XmNtopItemPosition, &top) ; ++ac ; XtSetArg( av[ac], XmNvisibleItemCount, &visible) ; ++ac ; XtGetValues( (Widget) list, av, ac) ; if( !count ) { return ; } key_pressed = atoi( *argv) ; if( *position == 0 ) { /* No selection, so select first item. */ XmListSelectPos( list, ++*position, True) ; } else { if( !key_pressed && (*position > 1) ) { /* up */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, --*position, True) ; } else { if( (key_pressed == 1) && (*position < count) ) { /* down */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, ++*position, True) ; } else { if( key_pressed == 2 ) { /* home */ XmListDeselectPos( list, *position) ; *position = 1 ; XmListSelectPos( list, *position, True) ; } else { if( key_pressed == 3 ) { /* end */ XmListDeselectPos( list, *position) ; *position = count ; XmListSelectPos( list, *position, True) ; } } } } } if( top > *position ) { XmListSetPos( list, *position) ; } else { if( (top + visible) <= *position ) { XmListSetBottomPos( list, *position) ; } } return ; } /****************************************************************/ void _XmFileSelectionBoxRestore( Widget wid, XEvent *event, String *argv, Cardinal *argc ) { XmFileSelectionBoxWidget fsb = (XmFileSelectionBoxWidget) wid ; String itemString ; String dir ; String mask ; int dirLen ; int maskLen ; Widget activeChild ; /****************/ if( !(activeChild = GetActiveText( fsb, event)) ) { return ; } if( activeChild == SB_Text( fsb) ) { _XmSelectionBoxRestore( (Widget) fsb, event, argv, argc) ; } else /* activeChild == FS_FilterText( fsb) */ { /* Should do this stuff entirely with XmStrings when the text * widget supports it. */ if( (dir = _XmStringGetTextConcat( FS_Directory( fsb))) != NULL ) { dirLen = strlen( dir) ; if( (mask = _XmStringGetTextConcat( FS_Pattern( fsb))) != NULL ) { maskLen = strlen( mask) ; itemString = XtMalloc( dirLen + maskLen + 1) ; strcpy( itemString, dir) ; strcpy( &itemString[dirLen], mask) ; XmTextFieldSetString( FS_FilterText( fsb), itemString) ; XmTextFieldSetCursorPosition( FS_FilterText( fsb), XmTextFieldGetLastPosition( FS_FilterText( fsb))) ; XtFree( itemString) ; XtFree( mask) ; } XtFree( dir) ; } } return ; } /*****************************************************************/ XmGeoMatrix _XmFileSBGeoMatrixCreate( Widget wid, Widget instigator, XtWidgetGeometry *desired ) { return (*(xmFileSelectionBoxClassRec.bulletin_board_class .geo_matrix_create))( wid, instigator, desired) ; } /****************************************************************/ Boolean _XmFileSelectionBoxNoGeoRequest( XmGeoMatrix geoSpec ) { if( BB_InSetValues( geoSpec->composite) && (XtClass( geoSpec->composite) == xmFileSelectionBoxWidgetClass) ) { return( TRUE) ; } return( FALSE) ; } /****************************************************************/ void _XmFileSelectionBoxFocusMoved( Widget wid, XtPointer client_data, XtPointer data ) { (*(xmFileSelectionBoxClassRec.bulletin_board_class.focus_moved_proc))( wid, client_data, data ); } XmHeap _XmHeapCreate( int segment_size ) { XmHeap heap; heap = XtNew(XmHeapRec); heap->start = NULL; heap->segment_size = segment_size; heap->bytes_remaining = 0; return heap; } char * _XmHeapAlloc( XmHeap heap, Cardinal bytes ) { register char* heap_loc; if (heap == NULL) return XtMalloc(bytes); if (heap->bytes_remaining < bytes) { if ((bytes + sizeof(char*)) >= (heap->segment_size>>1)) { /* preserve current segment; insert this one in front */ heap_loc = XtMalloc(bytes + sizeof(char*)); if (heap->start) { *(char**)heap_loc = *(char**)heap->start; *(char**)heap->start = heap_loc; } else { *(char**)heap_loc = NULL; heap->start = heap_loc; } return heap_loc; } /* else discard remainder of this segment */ heap_loc = XtMalloc((unsigned)heap->segment_size); *(char**)heap_loc = heap->start; heap->start = heap_loc; heap->current = heap_loc + sizeof(char*); heap->bytes_remaining = heap->segment_size - sizeof(char*); } #ifdef WORD64 /* round to nearest 8-byte boundary */ bytes = (bytes + 7) & (~7); #else /* round to nearest 4-byte boundary */ bytes = (bytes + 3) & (~3); #endif /* WORD64 */ heap_loc = heap->current; heap->current += bytes; heap->bytes_remaining -= bytes; /* can be negative, if rounded */ return heap_loc; } void _XmHeapFree( XmHeap heap ) { char* segment = heap->start; while (segment != NULL) { char* next_segment = *(char**)segment; XtFree(segment); segment = next_segment; } heap->start = NULL; heap->bytes_remaining = 0; } typedef struct { Boolean *traversal_on; Boolean *have_traversal; Boolean *sensitive; Boolean *ancestor_sensitive; Boolean *mapped_when_managed; Boolean *highlighted; Boolean *managed; unsigned char *navigation_type; }*WidgetNavigPtrs; void _XmGetWidgetNavigPtrs( Widget widget, WidgetNavigPtrs np ) { np->sensitive = &(widget->core.sensitive); np->ancestor_sensitive = &(widget->core.ancestor_sensitive); np->managed = &(widget->core.managed); if (XmIsManager(widget)) { XmManagerWidget w = (XmManagerWidget) widget; np->traversal_on = &(w->manager.traversal_on); np->mapped_when_managed = &(w->core.mapped_when_managed); np->navigation_type = &(w->manager.navigation_type); np->highlighted = NULL; np->have_traversal = NULL; } else if (XmIsPrimitive(widget)) { XmPrimitiveWidget w = (XmPrimitiveWidget) widget; np->traversal_on = &(w->primitive.traversal_on); np->mapped_when_managed = &(w->core.mapped_when_managed); np->navigation_type = &(w->primitive.navigation_type); np->highlighted = &(w->primitive.highlighted); np->have_traversal = &(w->primitive.have_traversal); } else if (XmIsGadget(widget)) { XmGadget w = (XmGadget) widget; np->traversal_on = &(w->gadget.traversal_on); np->mapped_when_managed = NULL; np->navigation_type = &(w->gadget.navigation_type); np->highlighted = &(w->gadget.highlighted); np->have_traversal = &(w->gadget.have_traversal); } else /* it must be an object or foriegn widget */ { np->traversal_on = NULL; np->mapped_when_managed = NULL; np->navigation_type = NULL; np->highlighted = NULL; np->have_traversal = NULL; } } void GetWidgetNavigPtrs( Widget widget, WidgetNavigPtrs np ) { _XmGetWidgetNavigPtrs( widget, np) ; } Boolean _XmFindTraversablePrim( CompositeWidget tabGroup ) { Widget first = _XmNavigate( (Widget) tabGroup, XmTRAVERSE_CURRENT) ; return first ? (XmCONTROL_NAVIGABLE == _XmGetNavigability( first)) : FALSE ; } typedef enum { HereOnly, AboveOnly, BelowOnly, AboveAndBelow } XmNavigTestType; /*ARGSUSED*/ Boolean _XmPathIsTraversable( Widget widget, #if NeedWidePrototypes int navType, #else XmNavigationType navType, #endif /* NeedWidePrototypes */ XmNavigTestType testType, /* unused */ XRectangle *visRect ) /* unused */ { return _XmFindTraversablePrim( (CompositeWidget) widget) ; } /*ARGSUSED*/ void SetMwmStuff( XmVendorShellExtObject ove, /* unused */ XmVendorShellExtObject nve ) /* unused */ { /* Sorry Charlie, this doesn't work any more. */ return ; } /*ARGSUSED*/ void _XmBB_GetDialogTitle( Widget bb, int resource, /* unused */ XtArgVal *value) { XmString data = XmStringCopy((XmString) ((XmBulletinBoardWidget) bb) ->bulletin_board.dialog_title); *value = (XtArgVal) data ; } static Boolean _isISO( String charset ) { register int i; if (strlen(charset) == 5) { for (i = 0; i < 5; i++) { if (!isdigit((unsigned char)charset[i])) return (False); } return (True); } else return (False); } char * _XmCharsetCanonicalize( String charset ) { String new_s; int len; /* ASCII -> ISO8859-1 */ if (!strcmp(charset, "ASCII")) { len = strlen(XmSTRING_ISO8859_1); new_s = XtMalloc(len + 1); strncpy(new_s, XmSTRING_ISO8859_1, len); new_s[len] = '\0'; } else if (_isISO(charset)) { /* "ISO####-#" */ new_s = XtMalloc(3 + 4 + 1 + 1 + 1); sprintf(new_s, "ISO%s", charset); new_s[7] = '-'; new_s[8] = charset[4]; new_s[9] = '\0'; } else /* Anything else is copied but not modified. */ { len = strlen(charset); new_s = XtMalloc(len + 1); strncpy(new_s, charset, len); new_s[len] = '\0'; } return (new_s); } /*ARGSUSED*/ Widget _XmGetDisplayObject(Widget shell, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { return XmGetXmDisplay( XtDisplay( shell)) ; } /*ARGSUSED*/ Widget _XmGetScreenObject(Widget shell, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { return XmGetXmScreen( XtScreen( shell)) ; } /*ARGSUSED*/ XmWrapperData _XmGetWrapperData (WidgetClass w_class) /* unused */ { /* If somebody actually used this, they are probably in for a surprise. */ return (XmWrapperData) XtCalloc( 1, sizeof( XmWrapperDataRec)) ; } void _XmLowerCase( register char *source, register char *dest ) { register char ch; int i; for (i = 0; (ch = *source) != 0 && i < 999; source++, dest++, i++) { if ('A' <= ch && ch <= 'Z') *dest = ch - 'A' + 'a'; else *dest = ch; } *dest = 0; } void dump_external(){} void dump_fontlist_cache(){} void dump_fontlist(){} void dump_internal(){} void _XmButtonPopdownChildren (XmRowColumnWidget rowcol) { if (RC_PopupPosted(rowcol)) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))(RC_PopupPosted(rowcol), NULL,NULL,NULL); } } void _XmInitializeMenuCursor (void) { /* It's unlucky to hit this one... */ } /*ARGSUSED*/ void _XmCreateMenuCursor (Widget m) /* unused */ { /* ... or this one. */ } XContext _XmMenuCursorContext = 0; /* This won't help much either. */ static Boolean simplistic_transient_flag ; /*ARGSUSED*/ Boolean _XmGetTransientFlag (Widget w) /* unused */ { return simplistic_transient_flag ; } /*ARGSUSED*/ void _XmSetTransientFlag (Widget w, /* unused */ Boolean value) { /* In a very simple case, this might work. To implement more of this * for BC would probably not help an application which was invasive * enough to use this flag in the first place. */ simplistic_transient_flag = value ; } /*ARGSUSED*/ Boolean _XmQueryPixmapCache (Screen *screen, /* unused */ char *image_name, /* unused */ Pixel foreground, /* unused */ Pixel background) /* unused */ { /* Simple case: return FALSE (creating new pixmap will find it in cache). */ return FALSE ; } /*ARGSUSED*/ void _XmRC_GetLabelString( XmRowColumnWidget rc, XrmQuark resource, /* unused */ XtArgVal * value) { *value = (XtArgVal) XmStringCopy(RC_OptionLabel(rc)); } /*ARGSUSED*/ void _XmRC_GetMenuAccelerator( XmRowColumnWidget rc, XrmQuark resource, /* unused */ XtArgVal * value) { String data ; if (rc->row_column.menu_accelerator != NULL) { data = (String)XtMalloc(strlen(RC_MenuAccelerator(rc)) + 1); strcpy(data, RC_MenuAccelerator(rc)); *value = (XtArgVal) data ; } else *value = (XtArgVal) NULL; } /*ARGSUSED*/ void _XmRC_GetMnemonicCharSet( XmRowColumnWidget rc, XrmQuark resource, /* unused */ XtArgVal * value) { Widget label = XmOptionLabelGadget((Widget)rc); if (label) { int n = 0; Arg al[1] ; String data ; XtSetArg(al[n], XmNmnemonicCharSet, &data); n++; XtGetValues(label, al, n); *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL; } } /*ARGSUSED*/ void _XmScaleGetTitleString( Widget wid, int resource, /* unused */ XtArgVal *value) { XmScaleWidget scale = (XmScaleWidget) wid ; if (scale->scale.title == NULL) { *value = (XtArgVal) NULL ; } else { Arg al[1] ; XtSetArg (al[0], XmNlabelString, value); XtGetValues (scale->composite.children[0], al, 1); } } /*ARGSUSED*/ void _XmTextFieldDestinationVisible( Widget w, /* unused */ #if NeedWidePrototypes int turn_on ) /* unused */ #else Boolean turn_on ) /* unused */ #endif /* NeedWidePrototypes */ { return ; } int _XmTextGetBaseLine( Widget widget ) { return XmTextGetBaseline( widget) ; } /*ARGSUSED*/ void _XmTextOutLoadGCsAndRecolorCursors(XmTextWidget old_tw, /* unused */ XmTextWidget new_tw) /* unused */ { return ; } _XmConst char *_XmTextEventBindings1 = _XmTextIn_XmTextEventBindings1 ; _XmConst char *_XmTextEventBindings2 = _XmTextIn_XmTextEventBindings2 ; _XmConst char *_XmTextEventBindings3 = _XmTextIn_XmTextEventBindings3 ; /************************************************************************ * * The following are the gadget traversal action routines * DD; was in Manager.c but not used anywhere. ************************************************************************/ /*ARGSUSED*/ void _XmDoGadgetTraversal( XmManagerWidget mw, XEvent *event, /* unused */ int direction ) { Widget ref_wid = mw->manager.active_child ; if( ref_wid == NULL ) { ref_wid = (Widget) mw ; } _XmMgrTraversal( ref_wid, (XmTraversalDirection) direction) ; } /********************************************************************** * * _XmBuildManagerResources * Build up the manager's synthetic and constraint synthetic * resource processing list by combining the super classes with * this class. * DD: This one should is now static in Manager.c * **********************************************************************/ void _XmBuildManagerResources( WidgetClass c ) { XmManagerWidgetClass wc = (XmManagerWidgetClass) c ; XmManagerWidgetClass sc; sc = (XmManagerWidgetClass) wc->core_class.superclass; _XmInitializeSyntheticResources(wc->manager_class.syn_resources, wc->manager_class.num_syn_resources); _XmInitializeSyntheticResources( wc->manager_class.syn_constraint_resources, wc->manager_class.num_syn_constraint_resources); if (sc == (XmManagerWidgetClass) constraintWidgetClass) return; _XmBuildResources (&(wc->manager_class.syn_resources), &(wc->manager_class.num_syn_resources), sc->manager_class.syn_resources, sc->manager_class.num_syn_resources); _XmBuildResources (&(wc->manager_class.syn_constraint_resources), &(wc->manager_class.num_syn_constraint_resources), sc->manager_class.syn_constraint_resources, sc->manager_class.num_syn_constraint_resources); } /** Gadget synthetic hook from Manager.c. Are not static in Gadget.c **/ /*ARGSUSED*/ void _XmGetHighlightColor( Widget w, int offset, /* unused */ XtArgVal *value ) { XmManagerWidget mw = (XmManagerWidget) XtParent(w); *value = (XtArgVal) mw->manager.highlight_color; } /*ARGSUSED*/ void _XmGetTopShadowColor( Widget w, int offset, /* unused */ XtArgVal *value ) { XmManagerWidget mw = (XmManagerWidget) XtParent(w); *value = (XtArgVal) mw->manager.top_shadow_color; } /*ARGSUSED*/ void _XmGetBottomShadowColor( Widget w, int offset, /* unused */ XtArgVal *value ) { XmManagerWidget mw = (XmManagerWidget) XtParent(w); *value = (XtArgVal) mw->manager.bottom_shadow_color; } /************************************************************************ * * The border highlighting and unhighlighting routines. * * These routines were originally in Primitive.c but not used anywhere. * ************************************************************************/ void _XmHighlightBorder( Widget w ) { if( XmIsPrimitive( w) ) { (*(xmPrimitiveClassRec.primitive_class.border_highlight))( w) ; } else { if( XmIsGadget( w) ) { (*(xmGadgetClassRec.gadget_class.border_highlight))( w) ; } } return ; } void _XmUnhighlightBorder( Widget w ) { if( XmIsPrimitive( w) ) { (*(xmPrimitiveClassRec.primitive_class.border_unhighlight))( w) ; } else { if( XmIsGadget( w) ) { (*(xmGadgetClassRec.gadget_class.border_unhighlight))( w) ; } } return ; } /************************************************************************ * * This routine was global in Primitive.c. It is now static. * ************************************************************************/ void _XmBuildPrimitiveResources( WidgetClass c ) { XmPrimitiveWidgetClass wc = (XmPrimitiveWidgetClass) c ; XmPrimitiveWidgetClass sc; sc = (XmPrimitiveWidgetClass) wc->core_class.superclass; _XmInitializeSyntheticResources(wc->primitive_class.syn_resources, wc->primitive_class.num_syn_resources); if (sc == (XmPrimitiveWidgetClass) widgetClass) return; _XmBuildResources (&(wc->primitive_class.syn_resources), &(wc->primitive_class.num_syn_resources), sc->primitive_class.syn_resources, sc->primitive_class.num_syn_resources); } motif-2.3.8/lib/Xm/XmStrDefs.ct0000644000175000017500000000041412672140200013115 00000000000000/* $TOG: XmStrDefs.ct /main/2 1997/06/18 17:49:37 samborn $ */ #ifndef _XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define _XmConst const #else #define _XmConst #endif /* __STDC__ */ #endif /* _XmConst */ #include <<>> motif-2.3.8/lib/Xm/XpmImage.c0000644000175000017500000000477212672140200012574 00000000000000/* $XConsortium: XpmImage.c /main/2 1996/09/20 08:12:28 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * Image.c: * * * * XPM library * * Functions to init and free the XpmImage structure. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" /* * Init returned data to free safely later on */ void xpmInitXpmImage(image) XpmImage *image; { image->ncolors = 0; image->colorTable = NULL; image->data = NULL; } /* * Free the XpmImage data which have been allocated */ void XpmFreeXpmImage(image) XpmImage *image; { if (image->colorTable) xpmFreeColorTable(image->colorTable, image->ncolors); if (image->data) XpmFree(image->data); image->data = NULL; } motif-2.3.8/lib/Xm/TextStrSoP.h0000644000175000017500000001007713145162623013135 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextStrSoP_h #define _XmTextStrSoP_h #include #include #ifdef __cplusplus extern "C" { #endif /**************************************************************** * * Definitions for use by sources and source users. * ****************************************************************/ typedef struct _XmSourceDataRec { XmTextSource source; /* Backpointer to source record. */ XmTextWidget *widgets; /* Array of widgets displaying this source. */ XmTextPosition left, right; /* Left and right extents of selection. */ char * ptr; /* Actual string data. */ char * value; /* Value of the string data. */ char * gap_start; /* Gapped buffer start pointer */ char * gap_end; /* Gapped buffer end pointer */ char * PSWC_NWLN; /* Holder for char*, short*, int* rep of NWLN */ int length; /* Number of chars of data. */ int maxlength; /* Space allocated. */ int old_length; /* Space allocated for value pointer. */ int numwidgets; /* Number of entries in above. */ int maxallowed; /* The user is not allowed to grow source */ /* to a size greater than this. */ Time prim_time; /* time of primary selection */ Boolean hasselection; /* Whether we own the selection. */ Boolean editable; /* Whether we allow any edits. */ Boolean take_selection; /* Whether we should take the selection. */ } XmSourceDataRec, *XmSourceData; typedef void (*AddWidgetProc)(XmTextSource, XmTextWidget); typedef int (*CountLinesProc)(XmTextSource, XmTextPosition, unsigned long); typedef void (*RemoveWidgetProc)(XmTextSource, XmTextWidget); typedef XmTextPosition (*ReadProc)(XmTextSource, XmTextPosition, /* starting position */ XmTextPosition, /* The last position we're interested in. Don't return info about any later positions. */ XmTextBlock); /* RETURN: text read */ typedef XmTextStatus (*ReplaceProc)(XmTextWidget, XEvent *, XmTextPosition *, XmTextPosition *, XmTextBlock, #if NeedWidePrototypes int); #else Boolean); #endif /* NeedsWidePrototypes */ typedef XmTextPosition (*ScanProc)(XmTextSource, XmTextPosition, XmTextScanType, XmTextScanDirection, /*XmsdLeft/XmsdRight*/ int, #if NeedWidePrototypes int); #else Boolean); #endif /* NeedsWidePrototypes */ typedef Boolean (*GetSelectionProc)(XmTextSource, XmTextPosition *, XmTextPosition *); typedef void (*SetSelectionProc)(XmTextSource, XmTextPosition, XmTextPosition, Time); typedef struct _XmTextSourceRec { struct _XmSourceDataRec *data; /* Source-defined data (opaque type). */ AddWidgetProc AddWidget; CountLinesProc CountLines; RemoveWidgetProc RemoveWidget; ReadProc ReadSource; ReplaceProc Replace; ScanProc Scan; GetSelectionProc GetSelection; SetSelectionProc SetSelection; } XmTextSourceRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextStrSoP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragCP.h0000644000175000017500000001155213145162623012175 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragCP_h #define _XmDragCP_h #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /*********************************************************************** * * DragContext (RootWrapper) Widget Private Data * ***********************************************************************/ typedef void (*XmDragStartProc)( XmDragContext, Widget, XEvent *); typedef void (*XmDragCancelProc)( XmDragContext) ; typedef struct { XmDragStartProc start; XmDragCancelProc cancel; XtPointer extension; } XmDragContextClassPart; typedef struct _XmDragContextClassRec { CoreClassPart core_class; XmDragContextClassPart drag_class; } XmDragContextClassRec; externalref XmDragContextClassRec xmDragContextClassRec; #define XtDragByPoll 0 #define XtDragByEvent 1 typedef struct { Window frame; Window window; Widget shell; unsigned char flags; unsigned char dragProtocolStyle; int xOrigin, yOrigin; unsigned int width, height; unsigned int depth; XtPointer iccInfo; } XmDragReceiverInfoStruct, *XmDragReceiverInfo; typedef union _XmConvertSelectionRec { XtConvertSelectionIncrProc sel_incr ; XtConvertSelectionProc sel ; } XmConvertSelectionRec ; typedef struct _XmDragContextPart{ /**** resources ****/ Atom *exportTargets; Cardinal numExportTargets; XmConvertSelectionRec convertProc; XtPointer clientData; XmDragIconObject sourceCursorIcon; XmDragIconObject stateCursorIcon; XmDragIconObject operationCursorIcon; XmDragIconObject sourcePixmapIcon; Pixel cursorBackground; Pixel cursorForeground; Pixel validCursorForeground; Pixel invalidCursorForeground; Pixel noneCursorForeground; XtCallbackList dragMotionCallback; XtCallbackList operationChangedCallback; XtCallbackList siteEnterCallback; XtCallbackList siteLeaveCallback; XtCallbackList topLevelEnterCallback; XtCallbackList topLevelLeaveCallback; XtCallbackList dropStartCallback; XtCallbackList dropFinishCallback; XtCallbackList dragDropFinishCallback; unsigned char dragOperations; Boolean incremental; unsigned char blendModel; /* private resources */ Window srcWindow; Time dragStartTime; Atom iccHandle; Widget sourceWidget; Boolean sourceIsExternal; /**** instance data ****/ Boolean topWindowsFetched; unsigned char commType; unsigned char animationType; unsigned char operation; unsigned char operations; unsigned int lastEventState; unsigned char dragCompletionStatus; unsigned char dragDropCompletionStatus; Boolean forceIPC; Boolean serverGrabbed; Boolean useLocal; Boolean inDropSite; XtIntervalId dragTimerId; Time roundOffTime; Time lastChangeTime; Time crossingTime; Time dragFinishTime; Time dropFinishTime; Atom dropSelection; Widget srcShell; Position startX, startY; XmID siteID; Screen *currScreen; Window currWmRoot; XmDragOverShellWidget curDragOver; XmDragOverShellWidget origDragOver; XmDragReceiverInfoStruct *currReceiverInfo; XmDragReceiverInfoStruct *rootReceiverInfo; XmDragReceiverInfoStruct *receiverInfos; Cardinal numReceiverInfos; Cardinal maxReceiverInfos; unsigned char trackingMode; unsigned char activeProtocolStyle; unsigned char activeBlendModel; Boolean dragDropCancelEffect; long SaveEventMask; /* Save the current root eventMask so that D&D works for MWM */ } XmDragContextPart; typedef struct _XmDragContextRec{ CorePart core; XmDragContextPart drag; } XmDragContextRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragCP_h */ motif-2.3.8/lib/Xm/ScrollFrameT.h0000644000175000017500000000525512672140200013424 00000000000000/* $TOG: ScrollFrameT.h /main/6 1997/07/25 16:49:23 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmScrollFrameT_H #define _XmScrollFrameT_H #include #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTscrollFrame; /* Trait structures and typedefs, place typedefs first */ typedef void (*XmScrollFrameInitProc)(Widget sf, XtCallbackProc moveCB, Widget scrollable); typedef Boolean (*XmScrollFrameGetInfoProc)(Widget sf, Cardinal * dimension, Widget ** nav_list, Cardinal * num_nav_list); typedef void (*XmScrollFrameAddNavigatorProc)(Widget sf, Widget nav, Mask dimMask); typedef void (*XmScrollFrameRemoveNavigatorProc)(Widget sf, Widget nav); typedef void (*XmScrollFrameUpdateOrigGeomProc)(Widget sf, Widget child, XtWidgetGeometry *geom); /* Version 1: added updateOrigGeom */ typedef struct _XmScrollFrameTraitRec { int version; /* 1 */ XmScrollFrameInitProc init; XmScrollFrameGetInfoProc getInfo; XmScrollFrameAddNavigatorProc addNavigator; XmScrollFrameRemoveNavigatorProc removeNavigator; XmScrollFrameUpdateOrigGeomProc updateOrigGeom; } XmScrollFrameTraitRec, *XmScrollFrameTrait; /* This one gets allocated per instance by the scrollFrame class. It is just a convenient structure reusable by other scrollFrame and it needs not to be part of the public trait API */ typedef struct _XmScrollFrameDataRec { XtCallbackProc move_cb ; Widget scrollable ; Widget * nav_list; Cardinal num_nav_list ; Cardinal num_nav_slots; } XmScrollFrameDataRec, *XmScrollFrameData; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScrollFrameT_H */ motif-2.3.8/lib/Xm/Gadget.h0000644000175000017500000000306512672140200012257 00000000000000/* $XConsortium: Gadget.h /main/5 1995/07/15 20:51:03 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmGadget_h #define _XmGadget_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsGadget #define XmIsGadget(w) XtIsSubclass(w, xmGadgetClass) #endif /* XmIsGadget */ externalref WidgetClass xmGadgetClass; typedef struct _XmGadgetClassRec * XmGadgetClass; typedef struct _XmGadgetRec * XmGadget; /******** Public Function Declarations ********/ /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGadget_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ResInd.c0000644000175000017500000005305313145162623012256 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: ResInd.c /main/17 1996/06/07 11:40:05 daniel $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include /* for isascii, isspace */ #include #include #include #include #include "RepTypeI.h" #include "ResIndI.h" #include "ScreenI.h" #include "XmI.h" #ifdef PRINTING_SUPPORTED #include "PrintSI.h" #endif /*********** Macros and Internal Types ************/ #define MAKEINT(float_value) ((int) (((float_value) > 0.0) ? \ ((float_value) + 0.5) : \ ((float_value) - 0.5))) #define FLOATABS(float_value) ((float_value) > 0.0 ? \ (float_value) : \ ((float_value) * -1.0)) #define OVERFLOW(float_value) \ (FLOATABS(float_value) > (float) INT_MAX) ? 1 : 0 /******** Static Function Declarations ********/ static void FromPixels( Widget widget, int offset, XtArgVal *value, unsigned char orientation); static XmImportOperator ToPixels( Widget widget, int offset, XtArgVal *value, unsigned char orientation); static XmParseResult ParseUnitString( String spec, float *float_value, /* RETURN */ int *unit_type); /* RETURN */ /******** End Static Function Declarations ********/ /********************************************************************** * * XmConvertStringToUnits * Public interface to convert string specifications * Note: The default unitType if it is not specified in the * string is XmPIXELS. * parse_error currently returns True for both "real" parsing * errors and overflows. Its type has been declared as an * XtEnum to allow returning more descriptive values in the * future, if desired. * **********************************************************************/ int XmConvertStringToUnits( Screen *screen, String spec, int orientation, int to_type, XtEnum *parse_error) /* RETURN */ { int value; _XmDisplayToAppContext(DisplayOfScreen(screen)); _XmAppLock(app); value = _XmConvertStringToUnits(screen, spec, XmPIXELS, orientation, to_type, parse_error); _XmAppUnlock(app); return value; } /********************************************************************** * * _XmConvertFloatUnitsToIntUnits * Given a floating point value and a units type, converts the value * to an integer value and unit type that minimizes information loss. * * Returns True if the conversion was a success. Returns False on * overflow. * **********************************************************************/ int _XmConvertFloatUnitsToIntUnits(int unitType, float unitValue, int *intUnitType, float *intUnitValue, int default_from_type) { float multiplier; switch (unitType) { case XmINCHES: multiplier = 1000.0; *intUnitType = Xm1000TH_INCHES; break; case XmCENTIMETERS: multiplier = 1000.0; *intUnitType = Xm100TH_MILLIMETERS; break; case XmMILLIMETERS: multiplier = 100.0; *intUnitType = Xm100TH_MILLIMETERS; break; case XmPOINTS: multiplier = 100.0; *intUnitType = Xm100TH_POINTS; break; case XmFONT_UNITS: multiplier = 100.0; *intUnitType = Xm100TH_FONT_UNITS; break; case XmPIXELS: multiplier = 1.0; *intUnitType = XmPIXELS; break; default: multiplier = 1.0; *intUnitType = default_from_type; break; }; /* Normalize to units _XmConvertUnits will understand. */ *intUnitValue = multiplier * unitValue; if (OVERFLOW(*intUnitValue)) { return(False); } return(True); } /********************************************************************** * * _XmConvertStringToUnits * Does the real work of converting string unit specifications * **********************************************************************/ int _XmConvertStringToUnits( Screen *screen, String spec, int default_from_type, int orientation, int to_type, XtEnum *parse_error) /* RETURN */ { float floatValue, convertValue; int unitType, fromType; /* the type that we will pass to XmConvertUnits */ if (parse_error) *parse_error = False; switch (ParseUnitString (spec, &floatValue, &unitType)) { default: case XmPARSE_ERROR: if (parse_error) *parse_error = True; return 0; case XmPARSE_NO_UNITS: fromType = default_from_type; convertValue = floatValue; if (OVERFLOW(convertValue)) { return 0; } break; case XmPARSE_UNITS_OK: if (unitType == to_type) /* No conversion required */ return (MAKEINT(floatValue)); if (_XmConvertFloatUnitsToIntUnits(unitType, floatValue, &fromType, &convertValue, default_from_type) == False) return 0; } return _XmConvertUnits(screen, orientation, fromType, MAKEINT(convertValue), to_type); } /********************************************************************** * * XmeParseUnits * **********************************************************************/ XmParseResult XmeParseUnits(String spec, int *unitType) { /* * Figure out which unit type was specified using same * method used in ResConvert.c. The performance of this * could be improved, but the readability of the code * would suffer. Test cases on a Sparc II indicate in * the worst case, the tests below take up about 30% * of the total conversion time. */ /* an empty string here means unit_type wasn't specified */ if (*spec == '\0') return XmPARSE_NO_UNITS; else if (XmeNamesAreEqual (spec, "pix") || XmeNamesAreEqual (spec, "pixel") || XmeNamesAreEqual (spec, "pixels")) *unitType = XmPIXELS; else if ( XmeNamesAreEqual (spec, "in") || XmeNamesAreEqual (spec, "inch") || XmeNamesAreEqual (spec, "inches")) *unitType = XmINCHES; else if ( XmeNamesAreEqual (spec, "cm") || XmeNamesAreEqual (spec, "centimeter") || XmeNamesAreEqual (spec, "centimeters")) *unitType = XmCENTIMETERS; else if ( XmeNamesAreEqual (spec, "mm") || XmeNamesAreEqual (spec, "millimeter") || XmeNamesAreEqual (spec, "millimeters")) *unitType = XmMILLIMETERS; else if ( XmeNamesAreEqual (spec, "pt") || XmeNamesAreEqual (spec, "point") || XmeNamesAreEqual (spec, "points")) *unitType = XmPOINTS; else if ( XmeNamesAreEqual (spec, "fu") || XmeNamesAreEqual (spec, "font_unit") || XmeNamesAreEqual (spec, "font_units")) *unitType = XmFONT_UNITS; else return XmPARSE_ERROR; return XmPARSE_UNITS_OK; } /********************************************************************** * * ParseUnitString * Internal routine for parsing specifications * **********************************************************************/ static XmParseResult ParseUnitString( String spec, float *float_value, /* RETURN */ int *unit_type) /* RETURN */ { char * string = spec; double power; int sign; char c; /* Skip leading whitespace */ while ((isascii(c=*string)) && (isspace(c))) string++; /* Check for sign */ sign = (*string == '-')? -1 : 1; if ((*string == '+') || (*string == '-')) string++; /* * Do floating point arithmetic here whether we have a decimal * point or not to avoid parsing an extra time. */ /* Parse digits left of decimal point */ *float_value = 0; while ((*string >= '0') && (*string <= '9')) { *float_value = 10.0 * *float_value + (*string - '0'); string++; } /* Handle decimal point */ if (*string == '.') string++; /* Parse digits right of decimal point */ power = 1.0; while ((*string >= '0') && (*string <= '9')) { *float_value = 10.0 * *float_value + (*string - '0'); power *= 10; string++; } *float_value = sign * *float_value / power; /* Skip whitespace between float and unit */ while ((isascii(c=*string)) && (isspace(c))) string++; return(XmeParseUnits(string, unit_type)); } /********************************************************************** * * _XmConvertUnits * Does the real work of conversion. * **********************************************************************/ int _XmConvertUnits( Screen *screen, int dimension, register int from_type, register int from_val, register int to_type ) { /* * from_val_in_mm is actually from_val_in_1000thmillimeters for accuracy * likewise for mm_per_pixel */ register int from_val_in_mm = 0; register int mm_per_pixel = 0 ; /* time 100000 */ int font_unit; /* Do error checking */ if (!XmRepTypeValidValue(XmRID_ORIENTATION, (unsigned char) dimension, (Widget) NULL)) return (0); if (!XmRepTypeValidValue( XmRID_UNIT_TYPE, from_type, (Widget)NULL)) return (0); if (!XmRepTypeValidValue( XmRID_UNIT_TYPE, to_type, (Widget)NULL)) return (0); if (screen == NULL) return (0); /* Check for type to same type conversions */ if (from_type == to_type) return (from_val); /* Get the screen dimensional data */ #ifdef PRINTING_SUPPORTED /* specialize for printing */ _XmProcessLock(); /* if there is at least one print shell around, look if this screen is from it and get the proper resolution */ if (_XmPrintShellCounter) { XmPrintShellWidget pshell = NULL ; XFindContext(DisplayOfScreen(screen), (XID)screen, _XmPrintScreenToShellContext, (XPointer *) &pshell); if (pshell) mm_per_pixel = 25400/ pshell->print.print_resolution ; } _XmProcessUnlock(); #endif /* PRINTING_SUPPORTED */ if (!mm_per_pixel) { if (dimension == XmHORIZONTAL) mm_per_pixel = (WidthMMOfScreen(screen) * 1000) / WidthOfScreen(screen); else mm_per_pixel = (HeightMMOfScreen(screen) * 1000) / HeightOfScreen(screen); } if (from_type == XmPIXELS) from_val_in_mm = from_val * mm_per_pixel ; else if (from_type == Xm100TH_POINTS) from_val_in_mm = (from_val * 353) / 100; else if (from_type == XmPOINTS) from_val_in_mm = (from_val * 353) ; else if (from_type == Xm1000TH_INCHES) from_val_in_mm = (from_val * 254) / 10; else if (from_type == XmINCHES) from_val_in_mm = (from_val * 254) * 100; else if (from_type == Xm100TH_MILLIMETERS) from_val_in_mm = from_val * 10; else if (from_type == XmMILLIMETERS) from_val_in_mm = from_val * 1000; else if (from_type == XmCENTIMETERS) from_val_in_mm = from_val * 10000; else if (from_type == Xm100TH_FONT_UNITS) { font_unit = _XmGetFontUnit (screen, dimension); from_val_in_mm = from_val * font_unit * mm_per_pixel / 100; } else if (from_type == XmFONT_UNITS) { font_unit = _XmGetFontUnit (screen, dimension); from_val_in_mm = from_val * font_unit * mm_per_pixel ; } if (to_type == XmPIXELS) return (from_val_in_mm / mm_per_pixel); else if (to_type == Xm100TH_POINTS) return ((from_val_in_mm * 100) / 353); else if (to_type == XmPOINTS) return ((from_val_in_mm ) / 353); else if (to_type == Xm1000TH_INCHES) return ((from_val_in_mm * 10) / 254); else if (to_type == XmINCHES) return ((from_val_in_mm / 100) / 254); else if (to_type == Xm100TH_MILLIMETERS) return (from_val_in_mm / 10); else if (to_type == XmMILLIMETERS) return (from_val_in_mm / 1000); else if (to_type == XmCENTIMETERS) return (from_val_in_mm / 10000); else if (to_type == Xm100TH_FONT_UNITS) { font_unit = _XmGetFontUnit (screen, dimension); return ((from_val_in_mm * 100) / (mm_per_pixel * font_unit)); } else /* to_type == XmFONT_UNITS */ { font_unit = _XmGetFontUnit (screen, dimension); return ((from_val_in_mm ) / (mm_per_pixel * font_unit)); } } /********************************************************************** * * XmConvertUnits * Convert a value in from_type representation to a value in * to_type representation using the screen to look up the screen * resolution and the dimension to denote whether to use the * horizontal or vertical resolution data. * **********************************************************************/ int XmConvertUnits( Widget widget, int dimension, register int from_type, register int from_val, register int to_type ) { int value; Screen *screen; _XmWidgetToAppContext(widget); _XmAppLock(app); screen = XtScreen(widget); value = _XmConvertUnits(screen, dimension, from_type, from_val, to_type); _XmAppUnlock(app); return value; } /********************************************************************* * * XmCvtToVerticalPixels * Convert from a specified unit type to pixel type using * the vertical resolution of the screen. * *********************************************************************/ int XmCvtToHorizontalPixels( Screen *screen, register int from_val, register int from_type ) { int value; _XmDisplayToAppContext(DisplayOfScreen(screen)); _XmAppLock(app); value = _XmConvertUnits(screen, XmHORIZONTAL, from_type, from_val, XmPIXELS); _XmAppUnlock(app); return value; } /********************************************************************** * * ToPixels * Convert from a non-pixel unit type to pixels using the * horizontal orientation/resolution of the screen. * **********************************************************************/ /*ARGSUSED*/ static XmImportOperator ToPixels( Widget widget, int offset, /* unused */ XtArgVal *value, unsigned char orientation ) { Screen * screen = XtScreen (widget); register unsigned char unit_type; /* Get the unit type of the widget */ unit_type = _XmGetUnitType(widget) ; /* Check for type to same type conversions */ if (unit_type == XmPIXELS) return XmSYNTHETIC_LOAD; /* otherwise, let _XmConvertUnits do the work */ *value = (XtArgVal) _XmConvertUnits (screen, (int) orientation, unit_type, (int) (*value), XmPIXELS); return XmSYNTHETIC_LOAD; } /********************************************************************** * * XmeToHorizontalPixels * Convert from a non-pixel unit type to pixels using the * horizontal resolution of the screen. This function is * accessed from a widget. * **********************************************************************/ XmImportOperator XmeToHorizontalPixels( Widget widget, int offset, XtArgVal *value ) { XmImportOperator ret_value; _XmWidgetToAppContext(widget); _XmAppLock(app); ret_value = ToPixels(widget, offset, value, XmHORIZONTAL) ; _XmAppUnlock(app); return ret_value; } /********************************************************************* * * XmCvtToVerticalPixels * Convert from a specified unit type to pixel type using * the vertical resolution of the screen. * *********************************************************************/ int XmCvtToVerticalPixels( Screen *screen, register int from_val, register int from_type ) { int value; _XmDisplayToAppContext(DisplayOfScreen(screen)); _XmAppLock(app); value = _XmConvertUnits(screen, XmVERTICAL, from_type, from_val, XmPIXELS); _XmAppUnlock(app); return value; } /******************************************************************** * * XmeToVerticalPixels * Convert from non-pixel unit type to pixels using the * vertical resolution of the screen. This function is * accessed from a widget. * **********************************************************************/ XmImportOperator XmeToVerticalPixels( Widget widget, int offset, XtArgVal *value ) { XmImportOperator ret_value; _XmWidgetToAppContext(widget); _XmAppLock(app); ret_value = ToPixels(widget, offset, value, XmVERTICAL) ; _XmAppUnlock(app); return ret_value; } /********************************************************************* * * * XmCvtFromHorizontalPixels * Convert from a pixel unit type to specified type using * the horizontal resolution of the screen. * **********************************************************************/ int XmCvtFromHorizontalPixels( Screen *screen, register int from_val, register int to_type ) { int value; _XmDisplayToAppContext(DisplayOfScreen(screen)); _XmAppLock(app); value = _XmConvertUnits(screen, XmHORIZONTAL, XmPIXELS, from_val, to_type); _XmAppUnlock(app); return value; } /********************************************************************** * * FromPixels * Convert from a pixel unit type to a non-pixels using the * given orientation/resolution of the screen. * **********************************************************************/ /*ARGSUSED*/ static void FromPixels( Widget widget, int offset, /* unused */ XtArgVal *value, unsigned char orientation) { Screen * screen = XtScreen (widget); unsigned char unit_type; /* Get the unit type of the widget */ unit_type = _XmGetUnitType(widget); /* Check for type to same type conversions */ if (unit_type == XmPIXELS) return; /* otherwise, let _XmConvertUnits do the work */ *value = (XtArgVal) _XmConvertUnits (screen, (int) orientation, XmPIXELS, (int) (*value), unit_type); } /********************************************************************** * * XmeFromHorizontalPixels * Convert from a pixel unit type to a non-pixels using the * horizontal resolution of the screen. This function is * accessed from a getvalues hook table. * **********************************************************************/ void XmeFromHorizontalPixels( Widget widget, int offset, XtArgVal *value ) { _XmWidgetToAppContext(widget); _XmAppLock(app); FromPixels(widget, offset, value, XmHORIZONTAL); _XmAppUnlock(app); } /********************************************************************* * * * XmCvtFromVerticalPixels * Convert from a pixel unit type to specified type using * the horizontal resolution of the screen. * **********************************************************************/ int XmCvtFromVerticalPixels( Screen *screen, register int from_val, register int to_type ) { int value; _XmDisplayToAppContext(DisplayOfScreen(screen)); _XmAppLock(app); value = _XmConvertUnits(screen, XmVERTICAL, XmPIXELS, from_val, to_type); _XmAppUnlock(app); return value; } /********************************************************************** * * XmeFromVerticalPixels * Convert from pixel unit type to non-pixels using the * vertical resolution of the screen. This function is * accessed from a getvalues hook table. * **********************************************************************/ void XmeFromVerticalPixels( Widget widget, int offset, XtArgVal *value ) { _XmWidgetToAppContext(widget); _XmAppLock(app); FromPixels(widget, offset, value, XmVERTICAL); _XmAppUnlock(app); } /********************************************************************** * * _XmUnitTypeDefault * This procedure is called as the resource default XtRCallProc * to default the unit type resource. This procedure supports * the propagation of unit type from parent to child. * **********************************************************************/ /*ARGSUSED*/ void _XmUnitTypeDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { static unsigned char unit_type; value->size = sizeof(unit_type); value->addr = (XPointer) &unit_type; if (XmIsManager(widget->core.parent)) unit_type = ((XmManagerWidget)(widget->core.parent))->manager.unit_type; else unit_type = XmPIXELS; } /********************************************************************** * * _XmGetUnitType * This function takes care of the class of the widget being passed * and look in the appropriate field. * **********************************************************************/ unsigned char _XmGetUnitType( Widget widget) { XmSpecUnitTypeTrait trait; if ((trait = (XmSpecUnitTypeTrait) XmeTraitGet((XtPointer) XtClass(widget), XmQTspecifyUnitType)) != NULL) { return trait->getUnitType(widget) ; } else if (XmIsExtObject(widget)) { /* CR 8952: Look on the real widget class too. */ XmExtObject extObj = (XmExtObject)widget; Widget parent = extObj->ext.logicalParent; if ((trait = (XmSpecUnitTypeTrait) XmeTraitGet((XtPointer) XtClass(parent), XmQTspecifyUnitType)) != NULL) return trait->getUnitType(parent); } return XmPIXELS ; } motif-2.3.8/lib/Xm/Picture.c0000644000175000017500000005020612672140561012503 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #include static XmPictureNode* _XiGetNewNode(XmPictureRec*); static void _XmPictureParseNode(XmPictureRec*, char**, XmPictureNode**, XmPictureNode**, Boolean); static XmPictureTransition* _XiGetNewTransition(XmTransType, XmPictureNode*, XmPictureNode*); static void _XmPictureSetState(unsigned char*, int); static char _XmPictureGetState(unsigned char*, int); static void _XmPictureFollowTransitions(XmPictureStateRec*, char, XmPictureNode*); static XmPictureNode *_XmPictureCopySubGraph(XmPictureRec*, int, XmPictureNode*, XmPictureNode*); static void _XmPictureTagNodes(XmPictureRec*, XmPictureNode**, int); static void _XmPictureFillTraverse(XmPictureRec*, int, XmAutoFill*); /* * Parses the given string into an XmPicture object. Returns NULL on a * mal-formed picture */ XmPicture XmParsePicture(char *input) { XmPictureRec *picture; XmPictureNode *root_node; XmPictureNode *end_node; picture = XtNew(XmPictureRec); picture->source = XtNewString(input); picture->num_nodes = 0; picture->nodes_alloced = NODE_START_COUNT; picture->nodes = (XmPictureNode**) XtMalloc(NODE_START_COUNT * sizeof(XmPictureNode*)); _XmPictureParseNode(picture, &input, &root_node, &end_node, False); picture->start_node = root_node->index; picture->final_node = end_node->index; return picture; } /* * Creates a new XmPictureState. The memory allocated must be freed by the * user with XtFree() */ XmPictureState XmGetNewPictureState(XmPicture picture) { int i; XmPictureStateRec *state; state = XtNew(XmPictureStateRec); state->statesize = 1 + (picture->num_nodes * sizeof(char) / 8); state->picture = picture; state->state = (unsigned char*) XtMalloc(state->statesize); state->newstate = (unsigned char*) XtMalloc(state->statesize); for(i=0; istatesize; i++) { state->state[i] = 0; state->newstate[i] = 0; } _XmPictureSetState(state->state, picture->start_node); /* * BAD BAD BAD HACK * This just allocates a static 1024 character array. While this will * be fine for the DataField, because only one state per widget will * be allocated and because the strings will never get that long, * this makes this library useless for generalized database stuff. * DON'T attempt to make lots of these or use them for very long * regexps until I get this fixed -- Andy * Sigh, additionally, this is a security problem. Feeding this * thing very long RE's and strings will therefore make the * program crash, which is not something our customers want */ state->current_string = XtMalloc(1024 * sizeof(char)); state->current_string[0] = '\0'; state->append = state->current_string; return state; } /* * Processes a single character. Returns a pointer to the current * value of the string (which may have been auto-filled, if * do_auto_fill is specified). If the current state vector contains * the final state, it places True in is_finished, otherwise False. */ char* XmPictureProcessCharacter(XmPictureState state, char in, Boolean *is_finished) { int i; char status; unsigned char *temp; char *save_start; /* * Reset the current-processing info */ state->current = '\0'; state->upcase = False; for(i=0; istatesize; i++) state->newstate[i] = 0; /* * For each node in the state set, try to follow all transitions * (recursing on NullTransitions of course) */ for(i=0; ipicture->num_nodes; i++) { if(_XmPictureGetState(state->state, i)) { _XmPictureFollowTransitions(state, in, state->picture->nodes[i]); } } /* * Swap the states */ temp = state->state; state->state = state->newstate; state->newstate = temp; /* * Append whatever we accepted (which might have been upcased) */ save_start = state->append; if(state->current) { *state->append = state->current; state->append++; *state->append = '\0'; } /* * If we didn't find _any_ transitions, return NULL */ for(i=0; istatesize; i++) if(state->state[i] != 0) break; if(i == state->statesize) { *is_finished = True; return NULL; } /* * If our set contains the final state, set is_finished to true */ status = _XmPictureGetState(state->state, state->picture->final_node); if(status) *is_finished = True; else *is_finished = False; return save_start; } void XmPictureDelete(XmPicture p) { int i; XmPictureTransition *trans, *delete_me; /* * First walk all the nodes, deleting the transitions then the * nodes themselves */ for(i=0; inum_nodes; i++) { trans = p->nodes[i]->transitions; while(trans) { delete_me = trans; trans = trans->next; XtFree((char*)delete_me); } XtFree((char*)p->nodes[i]); } /* * Now the node table and finally the picture itself */ XtFree((char*)p->nodes); XtFree(p->source); XtFree((char*)p); } void XmPictureDeleteState(XmPictureState s) { XtFree(s->current_string); XtFree((char*)s->state); XtFree((char*)s->newstate); XtFree((char*)s); } char* XmPictureGetCurrentString(XmPictureState s) { return s->current_string; } char* XmPictureDoAutoFill(XmPictureState state) { XmAutoFill fill; int i; Boolean finished = False; while(1) { fill.reject = False; fill.c = '\0'; fill.digit = False; fill.upcase = False; fill.letter = False; fill.hexdigit = False; fill.octaldigit = False; for(i=0; ipicture->num_nodes; i++) if(_XmPictureGetState(state->state, i)) _XmPictureFillTraverse(state->picture, i, &fill); if(fill.c == '\0') fill.reject = True; if(fill.digit && (isdigit(fill.c) == 0)) fill.reject = True; if(fill.hexdigit && (isxdigit(fill.c) == 0)) fill.reject = True; if(fill.octaldigit && (fill.c < '0' || fill.c > '7')) fill.reject = True; if(fill.letter && (isalpha(fill.c) == 0)) fill.reject = True; if(fill.upcase && islower(fill.c)) fill.reject = True; if(fill.reject) return state->current_string; XmPictureProcessCharacter(state, fill.c, &finished); if(finished) return state->current_string; } } /* * Parses a single "node" of the regular expression. If returnNOW is true, * this means only the very first complete RE encountered (a hack, to allow * for the weird closure precedence: *ab should parse like {*a}b and not * *{ab}), otherwise it reads until the end of the RE, be it a close brace * or EOS. */ static void _XmPictureParseNode(XmPictureRec *picture, char **in_string, XmPictureNode **start_return, XmPictureNode **end_return, Boolean returnNOW) { XmPictureNode *start_node; XmPictureNode *current_node; XmPictureNode *start_node_2; XmPictureNode *current_node_2; XmPictureNode *newnode; int node_idx; XmPictureTransition *newtrans; char inc; int count; char *endcount; start_node = _XiGetNewNode(picture); node_idx = start_node->index; current_node = start_node; while((inc = *((*in_string)++))) { switch(inc) { /* * These are the "normal" single-character tokens that * behave (more or less) like literals in the state * machine. */ case NUMDIGIT: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(NumericDigit, current_node, newnode); current_node = newnode; break; case HEXDIGIT: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(HexDigit, current_node, newnode); current_node = newnode; break; case OCTALDIGIT: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(OctalDigit, current_node, newnode); current_node = newnode; break; case NONCASELETTER: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(AnyLetter, current_node, newnode); current_node = newnode; break; case UPCASELETTER: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(UpCaseLetter, current_node, newnode); current_node = newnode; break; case NONCASECHAR: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(AnyCharacter, current_node, newnode); current_node = newnode; break; case UPCASECHAR: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(UpCaseCharacter, current_node, newnode); current_node = newnode; break; /* * The weird stuff. */ /* * Read a numeric specifier, if it exists, then read the * next _single_ R.E. (i.e., not a string of concatenated * ones!); Add a transition from the current end state to the * end (!) state of the new closure states, and a transition * from that end to it's beginning. */ case CLOSURE: /* CR03602 picture should formatted to *nx; n is no. of time repeat; x is the specified character going to be display */ count = strtol(*in_string, &endcount, 0); if(count) *in_string = endcount; _XmPictureParseNode(picture, in_string, &start_node_2, ¤t_node_2, True); if(count) { newtrans = _XiGetNewTransition(NullTransition, current_node, start_node_2); current_node = _XmPictureCopySubGraph(picture, count-1, start_node_2, current_node_2); } else { newtrans = _XiGetNewTransition(NullTransition, current_node_2, start_node_2); newtrans = _XiGetNewTransition(NullTransition, current_node, current_node_2); current_node = current_node_2; } break; /* * Read the next (NOT singleton, this time) R.E.; create a _new_ * initial state which has null-transitions to both the * current and new R.E.'s, and a new final state to which * both trails lead. */ case ALTERNATIVE: /* CR03656 CR03359 a major overhaul */ _XmPictureParseNode(picture, in_string, &start_node_2, ¤t_node_2, True); newtrans = _XiGetNewTransition(NullTransition, current_node, current_node_2); if (current_node->index) picture->nodes[current_node->index - 1]->transitions->next = start_node_2->transitions; current_node = current_node_2; break; /* * This actually is a special case of ALTERNATIVE. The * stuff inside the brackets becomes one chain, and a * null-transition becomes the second. Just read the * (NON-singleton) RE until the close-bracket. */ case LBRACKET: _XmPictureParseNode(picture, in_string, &start_node_2, ¤t_node_2, False); newtrans = _XiGetNewTransition(NullTransition, current_node, current_node_2); newtrans = _XiGetNewTransition(NullTransition, current_node, start_node_2); current_node = current_node_2; break; /* * The easiest special case to handle. Just read a * non-singleton R.E. until the close-brace and stick it * in as a "literal". */ case LBRACE: _XmPictureParseNode(picture, in_string, &start_node_2, ¤t_node_2, False); newtrans = _XiGetNewTransition(NullTransition, current_node, start_node_2); current_node = current_node_2; break; /* * Deal with both end-of-subexpression tokens in the same * way. This will accept stuff like {...] and [...}, but that's * probably OK, since it will only parse stuff incorrectly * for things like: [...{...]...} which aren't legal * anyway. I.E., we accept a superset of legal pictures, * but parse all legal pictures correctly. */ case RBRACE: case RBRACKET: returnNOW = True; break; /* * Special case handling for the ';' escape character. * Make sure dumb users haven't escaped the end of the string * then advance the pointer and fall through to the (default) * handling for a literal. */ case ESCAPE: inc = **in_string; if(inc == '\0') break; else (*in_string)++; /* * It's not a special character, so it must be a literal */ default: newnode = _XiGetNewNode(picture); newtrans = _XiGetNewTransition(LiteralCharacter, current_node, newnode); newtrans->c = inc; current_node = newnode; break; } /* * Break out if we have to */ if(returnNOW == True) break; } *start_return = start_node; *end_return = current_node; } static XmPictureTransition* _XiGetNewTransition(XmTransType type, XmPictureNode *src, XmPictureNode *dest) { XmPictureTransition *t = XtNew(XmPictureTransition); t->destination = dest->index; t->type = type; t->next = src->transitions; src->transitions = t; return t; } /* * Allocates a new state machine node */ static XmPictureNode* _XiGetNewNode(XmPictureRec *picture) { XmPictureNode *new_node; new_node = XtNew(XmPictureNode); new_node->transitions = NULL; new_node->index = picture->num_nodes++; /* * Handle growing the picture past it's boundary */ if(picture->num_nodes > picture->nodes_alloced) { int newsize = picture->nodes_alloced * 2; picture->nodes = (XmPictureNode**) XtRealloc((char*)picture->nodes, newsize * sizeof(XmPictureNode*)); picture->nodes_alloced = newsize; } picture->nodes[new_node->index] = new_node; return new_node; } static void _XmPictureSetState(unsigned char *v, int i) { int base = i / 8; int offset = i % 8; v[base] |= 1 << offset; } /* * Do I need this at all? * static void _XmPictureClearState(char *v, int i) { int base = i / 8; int offset = i % 8; v[base] &= ~(1 << offset); } */ static char _XmPictureGetState(unsigned char *v, int i) { int base = i / 8; int offset = i % 8; int result = v[base] & (1 << offset); if(result) return 1; else return 0; } /* * The inc parameter gets set to '\0' if we are following a null * transition after already having read the character. */ static void _XmPictureFollowTransitions(XmPictureStateRec *state, char inc, XmPictureNode *node) { XmPictureTransition *curr = node->transitions; char follow_c, changed_c; Boolean found = False; Boolean accepted = True; while(curr) { follow_c = '\0'; changed_c = '\0'; switch(curr->type) { case NullTransition: follow_c = inc; found = True; if(inc != '\0') accepted = False; break; case NumericDigit: if(isdigit(inc)) { found = True; } break; case HexDigit: if(isdigit(inc) || (inc >= 'a' && inc <= 'f') || (inc >= 'A' && inc <= 'F')) { found = True; } break; case OctalDigit: if((inc >= '0') && (inc <= '7')) { found = True; } break; case AnyLetter: if(isalpha(inc)) { found = True; } break; case UpCaseLetter: if(isalpha(inc)) { changed_c = toupper(inc); found = True; } break; case AnyCharacter: if(isalnum(inc)) { found = True; } break; case UpCaseCharacter: if(isalnum(inc)) { changed_c = toupper(inc); found = True; } break; case LiteralCharacter: if(inc == curr->c) { found = True; } break; } if(found) { if(changed_c) { state->current = changed_c; } else if(inc) { state->current = inc; } if(accepted) _XmPictureSetState(state->newstate, curr->destination); _XmPictureFollowTransitions(state, follow_c, state->picture ->nodes[curr->destination]); } found = False; curr = curr->next; } } /* * Recursively traverses a subgraph, tagging all indices in table with * a non-null value. */ static void _XmPictureTagNodes(XmPictureRec *picture, XmPictureNode **table, int start) { XmPictureTransition *trans = picture->nodes[start]->transitions; table[start] = (XmPictureNode*)0x1; while(trans) { _XmPictureTagNodes(picture, table, trans->destination); trans = trans->next; } } /* * Makes a string of n copies of the subgraph indicated, chaining them * end-to-end. It returns the new end node for the multiplied * subgraph (the start node is the unchanged, of course) */ static XmPictureNode* _XmPictureCopySubGraph(XmPictureRec *picture, int n, XmPictureNode *start, XmPictureNode *end) { XmPictureNode **table; XmPictureTransition *trans, *newtrans; int i, j, tablesize, end_index; /* * Bail if the user did a repeat count of 1 */ if(n < 1) return end; /* * First allocate a pointer array of the same size as the current * picture. This will hold NULL for nodes not in the subgraph and * the XmPictureNode for the newest copy. */ tablesize = picture->num_nodes; table = (XmPictureNode**) XtMalloc(tablesize * sizeof(XmPictureNode*)); for(i=0; inum_nodes; i++) table[i] = NULL; /* * Now recursively tag the ones in our subgraph with non-NULL * values */ _XmPictureTagNodes(picture, table, start->index); /* * Now loop: for each non-NULL, allocate a new node in its * place; then go through each transition from the _original_ * nodes, and put equivalent ones in the new table's nodes. * Finally chain it to the end of the previous node. */ end_index = end->index; for(i=0; inodes[j]->transitions; while(trans) { /* * Hack to make sure we don't follow transitions * into the newly created nodes */ if(trans->destination >= tablesize) { trans = trans->next; continue; } newtrans = _XiGetNewTransition(trans->type, table[j], table[trans->destination]); newtrans->c = trans->c; trans = trans->next; } } } _XiGetNewTransition(NullTransition, end, table[start->index]); end = table[end_index]; } XtFree((void*)table); return end; } static void _XmPictureFillTraverse(XmPictureRec *picture, int start, XmAutoFill *fill) { XmPictureTransition *trans = picture->nodes[start]->transitions; while(trans) { switch(trans->type) { case NullTransition: _XmPictureFillTraverse(picture, trans->destination, fill); break; case NumericDigit: fill->digit = True; break; case HexDigit: fill->hexdigit = True; break; case OctalDigit: fill->octaldigit = True; break; case AnyLetter: fill->letter = True; break; case UpCaseLetter: fill->letter = True; fill->upcase = True; break; case UpCaseCharacter: fill->upcase = True; break; case LiteralCharacter: if(fill->c == '\0') fill->c = trans->c; else if(fill->c != trans->c) fill->reject = True; break; /* gr... AnyCharacter isn't handled, and gcc issues a warning. */ default: break; } trans = trans->next; } } #ifdef DEBUG static void _XiPrintStateVector(XmPictureStateRec *state) { int i; char c; for(i=0; ipicture->num_nodes; i++) { if(_XmPictureGetState(state->state, i)) c = '1'; else c = '0'; printf("%c", c); } printf("\n"); } #endif motif-2.3.8/lib/Xm/MenuShellP.h0000644000175000017500000000574113145162623013114 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMenuShellP_h #define _XmMenuShellP_h #include #include #include #ifdef __cplusplus extern "C" { #endif /* The MenuShell instance record */ typedef struct { unsigned char focus_policy; XmFocusData focus_data; Boolean private_shell; XmFontList default_font_list; XmFontList button_font_list; XmFontList label_font_list; XmDirection layout_direction; Boolean animate; } XmMenuShellPart; /* Full instance record declaration */ typedef struct _XmMenuShellRec { CorePart core; CompositePart composite; ShellPart shell; OverrideShellPart override; XmMenuShellPart menu_shell; } XmMenuShellRec; typedef struct _XmMenuShellWidgetRec /* OBSOLETE (for compatibility only).*/ { CorePart core; CompositePart composite; ShellPart shell; OverrideShellPart override; XmMenuShellPart menu_shell; } XmMenuShellWidgetRec; /* MenuShell class structure */ typedef struct { XtActionProc popdownOne; /* unpost portion or all of menu */ XtActionProc popdownEveryone; /* unpost portion of menu */ XtActionProc popdownDone; /* unpost all menus */ XmMenuPopupProc popupSharedMenupane; /* post shared menus */ /* (should be popupSharedMenuShell) */ XtPointer extension; /* Pointer to extension record */ } XmMenuShellClassPart; /* Full class record declaration */ typedef struct _XmMenuShellClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; OverrideShellClassPart override_shell_class; XmMenuShellClassPart menu_shell_class; } XmMenuShellClassRec; externalref XmMenuShellClassRec xmMenuShellClassRec; #define MS_FocusPolicy(m) \ (((XmMenuShellWidget)m)->menu_shell.focus_policy) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuShellP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Xpmrgb.c0000644000175000017500000001702212672140200012314 00000000000000/* $XConsortium: Xpmrgb.c /main/6 1996/09/20 08:16:01 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * rgb.c: * * * * XPM library * * Rgb file utilities * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* * The code related to FOR_MSW has been added by * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ /* * Part of this code has been taken from the ppmtoxpm.c file written by Mark * W. Snitily but has been modified for my special need */ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" #include #ifndef FOR_MSW /* normal part first, MSW part at * the end, (huge ifdef!) */ /* * Read a rgb text file. It stores the rgb values (0->65535) * and the rgb mnemonics (malloc'ed) into the "rgbn" array. Returns the * number of entries stored. */ int xpmReadRgbNames(rgb_fname, rgbn) char *rgb_fname; xpmRgbName rgbn[]; { FILE *rgbf; int n, items, red, green, blue; char line[512], name[512], *rgbname, *s1, *s2; xpmRgbName *rgb; /* Open the rgb text file. Abort if error. */ if ((rgbf = fopen(rgb_fname, "r")) == NULL) return 0; /* Loop reading each line in the file. */ n = 0; rgb = rgbn; /* Quit if rgb text file has too many entries. */ while (fgets(line, sizeof(line), rgbf) && n < MAX_RGBNAMES) { /* Skip silently if line is bad. */ items = sscanf(line, "%d %d %d %[^\n]\n", &red, &green, &blue, name); if (items != 4) continue; /* * Make sure rgb values are within 0->255 range. Skip silently if * bad. */ if (red < 0 || red > 0xFF || green < 0 || green > 0xFF || blue < 0 || blue > 0xFF) continue; /* Allocate memory for ascii name. If error give up here. */ if (!(rgbname = (char *) XpmMalloc(strlen(name) + 1))) break; /* Copy string to ascii name and lowercase it. */ for (s1 = name, s2 = rgbname; *s1; s1++) *s2++ = tolower(*s1); *s2 = '\0'; /* Save the rgb values and ascii name in the array. */ rgb->r = red * 257; /* 65535/255 = 257 */ rgb->g = green * 257; rgb->b = blue * 257; rgb->name = rgbname; rgb++; n++; } fclose(rgbf); /* Return the number of read rgb names. */ return n < 0 ? 0 : n; } /* * Return the color name corresponding to the given rgb values */ char * xpmGetRgbName(rgbn, rgbn_max, red, green, blue) xpmRgbName rgbn[]; /* rgb mnemonics from rgb text file */ int rgbn_max; /* number of rgb mnemonics in table */ int red, green, blue; /* rgb values */ { int i; xpmRgbName *rgb; /* * Just perform a dumb linear search over the rgb values of the color * mnemonics. One could speed things up by sorting the rgb values and * using a binary search, or building a hash table, etc... */ for (i = 0, rgb = rgbn; i < rgbn_max; i++, rgb++) if (red == rgb->r && green == rgb->g && blue == rgb->b) return rgb->name; /* if not found return NULL */ return NULL; } /* * Free the strings which have been malloc'ed in xpmReadRgbNames */ void xpmFreeRgbNames(rgbn, rgbn_max) xpmRgbName rgbn[]; int rgbn_max; { int i; xpmRgbName *rgb; for (i = 0, rgb = rgbn; i < rgbn_max; i++, rgb++) XpmFree(rgb->name); } #else /* here comes the MSW part, the * second part of the huge ifdef */ #include "rgbtab.h" /* hard coded rgb.txt table */ int xpmReadRgbNames(rgb_fname, rgbn) char *rgb_fname; xpmRgbName rgbn[]; { /* * check for consistency??? * table has to be sorted for calls on strcasecmp */ return (numTheRGBRecords); } /* * MSW rgb values are made from 3 BYTEs, this is different from X XColor.red, * which has something like #0303 for one color */ char * xpmGetRgbName(rgbn, rgbn_max, red, green, blue) xpmRgbName rgbn[]; /* rgb mnemonics from rgb text file * not used */ int rgbn_max; /* not used */ int red, green, blue; /* rgb values */ { int i; unsigned long rgbVal; i = 0; while (i < numTheRGBRecords) { rgbVal = theRGBRecords[i].rgb; if (GetRValue(rgbVal) == red && GetGValue(rgbVal) == green && GetBValue(rgbVal) == blue) return (theRGBRecords[i].name); i++; } return (NULL); } /* used in XParseColor in simx.c */ int xpmGetRGBfromName(inname, r, g, b) char *inname; int *r, *g, *b; { int left, right, middle; int cmp; unsigned long rgbVal; char *name; char *grey, *p; name = xpmstrdup(inname); /* * the table in rgbtab.c has no names with spaces, and no grey, but a * lot of gray */ /* so first extract ' ' */ while (p = strchr(name, ' ')) { while (*(p)) { /* till eof of string */ *p = *(p + 1); /* copy to the left */ p++; } } /* fold to lower case */ p = name; while (*p) { *p = tolower(*p); p++; } /* * substitute Grey with Gray, else rgbtab.h would have more than 100 * 'duplicate' entries */ if (grey = strstr(name, "grey")) grey[2] = 'a'; /* binary search */ left = 0; right = numTheRGBRecords - 1; do { middle = (left + right) / 2; cmp = xpmstrcasecmp(name, theRGBRecords[middle].name); if (cmp == 0) { rgbVal = theRGBRecords[middle].rgb; *r = GetRValue(rgbVal); *g = GetGValue(rgbVal); *b = GetBValue(rgbVal); free(name); return (1); } else if (cmp < 0) { right = middle - 1; } else { /* > 0 */ left = middle + 1; } } while (left <= right); /* * I don't like to run in a ColorInvalid error and to see no pixmap at * all, so simply return a red pixel. Should be wrapped in an #ifdef * HeDu */ *r = 255; *g = 0; *b = 0; /* red error pixel */ free(name); return (1); } void xpmFreeRgbNames(rgbn, rgbn_max) xpmRgbName rgbn[]; int rgbn_max; { /* nothing to do */ } #endif /* MSW part */ motif-2.3.8/lib/Xm/Scale.c0000644000175000017500000030317713145162623012126 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Scale.c /main/31 1999/10/13 16:18:07 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #ifndef CSRG_BASED /* * Modification by Integrated Computer Solutions, Inc. May 2000 * * Original: * * # ifdef linux * # define RADIXCHAR MON_DECIMAL_POINT * # endif * # include * * glibc >= 2.0 defines RADIXCHAR in langinfo.h, simply make sure * that it is not redefined here. */ # include # if defined(linux) && !defined(RADIXCHAR) # define RADIXCHAR DECIMAL_POINT # endif # ifdef X_LOCALE # ifdef linux /* avoid conflicting with defines */ # undef LC_ALL # undef LC_COLLATE # undef LC_CTYPE # undef LC_MONETARY # undef LC_NUMERIC # undef LC_TIME # endif # endif #else # define nl_langinfo(radixchar) "." #endif #ifdef __cplusplus extern "C" { /* some 'locale.h' do not have prototypes (sun) */ #endif #include #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif /* __cplusplus */ #include #include #include #include #include #include #include /* for slider geometrical data */ #include #include #include #include #include "GeoUtilsI.h" #include "GMUtilsI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "TransferI.h" #include "TraversalI.h" #include "XmI.h" #define FIX_1528 #define state_flags last_value #define MESSAGE1 _XmMMsgScale_0000 #define MESSAGE2 _XmMMsgScale_0001 #define MESSAGE3 _XmMMsgScale_0002 #define MESSAGE5 _XmMMsgScaleScrBar_0004 #define MESSAGE7 _XmMMsgScale_0006 #define MESSAGE8 _XmMMsgScale_0007 #define MESSAGE9 _XmMMsgScale_0008 static Region null_region = NULL; /* Convenience macros and definitions */ #define TotalWidth(w) (w->core.width + (w->core.border_width * 2)) #define TotalHeight(w) (w->core.height + (w->core.border_width * 2)) #define SCROLLBAR_MAX 1000000000 #define SCALE_VALUE_MARGIN 3 #define SCALE_DEFAULT_MAJOR_SIZE \ (100 + (2 * sw->scale.highlight_thickness)) #define SCALE_DEFAULT_MINOR_SIZE \ (15 + (2 * sw->scale.highlight_thickness)) #define SLIDER_SIZE(sca) ((sca->scale.sliding_mode == XmTHERMOMETER)?\ 0:sca->scale.slider_size) /* this one is context dependent, args and n are used */ #define SET(name, val) {XtSetArg (args[n], (name), (val)); n++;} #define LeadXTic(sb, sca) (sb->scrollBar.slider_area_x \ + (Dimension) (((float) SLIDER_SIZE(sca) / 2.0) + 0.5)) #define LeadYTic(sb, sca) (sb->scrollBar.slider_area_y \ + (Dimension) (((float) SLIDER_SIZE(sca) / 2.0) + 0.5)) #define TrailXTic(sb, sca) (sb->core.width - (sb->scrollBar.slider_area_x \ + sb->scrollBar.slider_area_width\ - (Dimension) (((float) SLIDER_SIZE(sca) / 2.0) + 0.5))) #define TrailYTic(sb, sca) (sb->core.height - (sb->scrollBar.slider_area_y \ + sb->scrollBar.slider_area_height\ - (Dimension) (((float) SLIDER_SIZE(sca) / 2.0) + 0.5))) /******** Static Function Declarations ********/ static void ScaleGetTitleString( Widget wid, int resource, XtArgVal *value) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void ProcessingDirectionDefault( XmScaleWidget widget, int offset, XrmValue *value) ; static void SliderVisualDefault( XmScaleWidget widget, int offset, XrmValue *value) ; static void SliderMarkDefault( XmScaleWidget widget, int offset, XrmValue *value) ; static void EditableDefault( XmScaleWidget widget, int offset, XrmValue *value) ; static void ValidateInitialState( XmScaleWidget req, XmScaleWidget new_w) ; static Widget CreateScaleTitle( XmScaleWidget new_w) ; static Widget CreateScaleScrollBar( XmScaleWidget new_w) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetForegroundGC( XmScaleWidget sw) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void CalcScrollBarData( XmScaleWidget sw, int *value, int *slider_size, int *increment, int *page) ; static void Resize( Widget wid) ; static void ValidateInputs( XmScaleWidget cur, XmScaleWidget new_w) ; static void HandleTitle( XmScaleWidget cur, XmScaleWidget req, XmScaleWidget new_w) ; static void HandleScrollBar( XmScaleWidget cur, XmScaleWidget req, XmScaleWidget new_w) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args_in, Cardinal *num_args_in) ; static void Realize( register Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) ; static void Destroy( Widget wid) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static Dimension MaxLabelWidth( XmScaleWidget sw) ; static Dimension MaxLabelHeight( XmScaleWidget sw) ; static Dimension ValueTroughWidth( XmScaleWidget sw) ; static Dimension ValueTroughHeight( XmScaleWidget sw) ; static Dimension ValueTroughAscent( XmScaleWidget sw) ; static Dimension ValueTroughDescent( XmScaleWidget sw) ; static Dimension TitleWidth( XmScaleWidget sw) ; static Dimension TitleHeight( XmScaleWidget sw) ; static Cardinal NumManaged( XmScaleWidget sw, Widget * first_man, Widget * last_man); static Dimension MajorLeadPad( XmScaleWidget sw) ; static Dimension MajorTrailPad( XmScaleWidget sw) ; static Dimension ScrollWidth( XmScaleWidget sw) ; static Dimension ScrollHeight( XmScaleWidget sw) ; static void GetScaleSize( XmScaleWidget sw, Dimension *w, Dimension *h) ; static void LayoutHorizontalLabels( XmScaleWidget sw, XRectangle *scrollBox, XRectangle *labelBox, Widget instigator) ; static void LayoutHorizontalScale( XmScaleWidget sw, XtWidgetGeometry * desired, Widget instigator) ; static void LayoutVerticalLabels( XmScaleWidget sw, XRectangle *scrollBox, XRectangle *labelBox, Widget instigator) ; static void LayoutVerticalScale( XmScaleWidget sw, XtWidgetGeometry * desired, Widget instigator) ; static void ChangeManaged( Widget wid) ; static void GetValueString( XmScaleWidget sw, int value, String buffer); static void ShowValue( XmScaleWidget sw) ; static void SetScrollBarData( XmScaleWidget sw) ; static void ValueChanged( Widget wid, XtPointer closure, XtPointer call_data) ; static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired) ; static XmNavigability WidgetNavigable( Widget wid) ; static void StartDrag (Widget w, XtPointer data, XEvent *event, Boolean *cont) ; static void DragConvertCallback (Widget w, XtPointer client_data, XmConvertCallbackStruct *cs); static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value); /******** End Static Function Declarations ********/ /* Resource definitions for Scale class */ static XtResource resources[] = { { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmManagerRec, manager.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNvalue, XmCValue, XmRInt, sizeof(int), XtOffsetOf(XmScaleRec,scale.value), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNmaximum, XmCMaximum, XmRInt, sizeof(int), XtOffsetOf(XmScaleRec,scale.maximum), XmRImmediate, (XtPointer)100 }, { XmNminimum, XmCMinimum, XmRInt, sizeof(int), XtOffsetOf(XmScaleRec,scale.minimum), XmRImmediate, (XtPointer)0 }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf(XmScaleRec,scale.orientation), XmRImmediate, (XtPointer) XmVERTICAL }, { XmNprocessingDirection, XmCProcessingDirection, XmRProcessingDirection, sizeof(unsigned char), XtOffsetOf(XmScaleRec,scale.processing_direction), XmRCallProc, (XtPointer) ProcessingDirectionDefault }, { XmNtitleString, XmCTitleString, XmRXmString, sizeof(XmString), XtOffsetOf(XmScaleRec,scale.title), XmRImmediate, (XtPointer) NULL }, { "pri.vate","Pri.vate",XmRInt, sizeof(int), XtOffsetOf(XmScaleRec,scale.last_value), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmScaleRec, scale.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmScaleRec, scale.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNshowValue, XmCShowValue, XmRShowValue, sizeof(XtEnum), XtOffsetOf(XmScaleRec,scale.show_value), XmRImmediate, (XtPointer) XmNONE }, { XmNdecimalPoints, XmCDecimalPoints, XmRShort, sizeof(short), XtOffsetOf(XmScaleRec,scale.decimal_points), XmRImmediate, (XtPointer) 0 }, { XmNscaleWidth, XmCScaleWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmScaleRec, scale.scale_width), XmRImmediate, (XtPointer) 0 }, { XmNscaleHeight, XmCScaleHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf(XmScaleRec, scale.scale_height), XmRImmediate, (XtPointer) 0 }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmScaleRec, scale.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof (Boolean), XtOffsetOf(XmScaleRec, scale.highlight_on_enter), XmRImmediate, (XtPointer) False }, { XmNvalueChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScaleRec,scale.value_changed_callback), XmRCallback, (XtPointer) NULL }, { XmNconvertCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScaleRec, scale.convert_callback), XmRCallback, (XtPointer) NULL }, { XmNdragCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScaleRec,scale.drag_callback), XmRCallback, (XtPointer) NULL }, { XmNscaleMultiple, XmCScaleMultiple, XmRInt, sizeof(int), XtOffsetOf(XmScaleRec,scale.scale_multiple), XmRImmediate, (XtPointer) 0 }, { XmNslidingMode, XmCSlidingMode, XmRSlidingMode, sizeof(XtEnum), XtOffsetOf(XmScaleRec,scale.sliding_mode), XmRImmediate, (XtPointer) XmSLIDER }, { XmNeditable, XmCEditable, XmRBoolean, sizeof(XtEnum), XtOffsetOf(XmScaleRec,scale.editable), XmRCallProc, (XtPointer) EditableDefault }, { XmNsliderVisual, XmCSliderVisual, XmRSliderVisual, sizeof (XtEnum), XtOffsetOf(XmScaleRec, scale.slider_visual), XmRCallProc, (XtPointer) SliderVisualDefault }, { XmNsliderMark, XmCSliderMark, XmRSliderMark, sizeof (XtEnum), XtOffsetOf(XmScaleRec, scale.slider_mark), XmRCallProc, (XtPointer) SliderMarkDefault }, { /* undocumented - need synthetic hook to be complete */ XmNsliderSize, XmCSliderSize, XmRHorizontalInt, sizeof (int), XtOffsetOf(XmScaleRec, scale.slider_size), XmRImmediate, (XtPointer) 30 }, { XmNshowArrows, XmCShowArrows, XmRShowArrows, sizeof (XtEnum), XtOffsetOf(XmScaleRec, scale.show_arrows), XmRImmediate, (XtPointer) XmNONE }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNtitleString, sizeof (XmString), XtOffsetOf(XmScaleRec, scale.title), ScaleGetTitleString, (XmImportProc)NULL }, { XmNscaleWidth, sizeof (Dimension), XtOffsetOf(XmScaleRec, scale.scale_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNscaleHeight, sizeof (Dimension), XtOffsetOf(XmScaleRec, scale.scale_height), XmeFromVerticalPixels, XmeToVerticalPixels } }; /* Scale class record definition */ static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), (XtInitProc)NULL, /* InitializePrehook */ (XtSetValuesFunc)NULL, /* SetValuesPrehook */ (XtInitProc)NULL, /* InitializePosthook */ (XtSetValuesFunc)NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ (XtInitProc)NULL, /* secondaryCreate */ (XmGetSecResDataFunc)NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ (XtArgsProc)NULL, /* getValuesPrehook */ (XtArgsProc)NULL, /* getValuesPosthook */ (XtWidgetClassProc)NULL, /* classPartInitPrehook */ (XtWidgetClassProc)NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ (XmFocusChangeProc)NULL, /* focusChange */ (XmWrapperData)NULL /* wrapperData */ }; externaldef(xmscaleclassrec) XmScaleClassRec xmScaleClassRec = { { /* core_class fields */ (WidgetClass) &xmManagerClassRec, /* superclass */ "XmScale", /* class_name */ sizeof(XmScaleRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_init */ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ Realize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterlv */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ XtInheritTranslations, /* tm_table */ (XtGeometryHandler) QueryGeometry, /* query_geometry */ (XtStringProc)NULL, /* display_accelerator*/ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ NULL, /* resource list */ 0, /* num resources */ sizeof(XmManagerConstraintRec), /* constraint size */ (XtInitProc)NULL, /* init proc */ (XtWidgetProc)NULL, /* destroy proc */ (XtSetValuesFunc)NULL, /* set values proc */ NULL, /* extension */ }, { /* manager_class fields */ XtInheritTranslations, /* translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* scale class - none */ (XtPointer) NULL /* extension */ } }; externaldef(xmscalewidgetclass) WidgetClass xmScaleWidgetClass = (WidgetClass)&xmScaleClassRec; /* Transfer trait record */ static XmConst XmTransferTraitRec ScaleTransfer = { 0, /* version */ (XmConvertCallbackProc) DragConvertCallback, /* convertProc */ NULL, /* destinationProc */ NULL, /* destinationPreHookProc */ }; /****************************************************************/ /************** Synthetic hook & default routines ***************/ /****************************************************************/ /*ARGSUSED*/ static void ScaleGetTitleString( Widget wid, int resource, /* unused */ XtArgVal *value) /**************** ARGSUSED ****************/ { XmScaleWidget scale = (XmScaleWidget) wid ; Arg al[1] ; if (scale->scale.title == NULL) { /* mean that the title has never been set, so we should return NULL, not the label value which is the label name, not NULL, in this case */ *value = (XtArgVal) NULL ; } else { /* title = -1, our magic value used to tell: look in the label child. */ XtSetArg (al[0], XmNlabelString, value); /* make a copy */ XtGetValues (scale->composite.children[0], al, 1); } } /********************************************************************* * * ProcessingDirectionDefault * This procedure provides the dynamic default behavior for * the processing direction resource dependent on the orientation. * *********************************************************************/ /*ARGSUSED*/ static void ProcessingDirectionDefault( XmScaleWidget widget, int offset, /* unused */ XrmValue *value ) { static unsigned char direction; value->addr = (XPointer) &direction; if (widget->scale.orientation == XmHORIZONTAL) { if (LayoutIsRtoLM(widget)) direction = XmMAX_ON_LEFT; else direction = XmMAX_ON_RIGHT; } else /* XmVERTICAL -- range checking done during widget initialization */ direction = XmMAX_ON_TOP; } /********************************************************************* * * SliderVisualDefault * * *********************************************************************/ /*ARGSUSED*/ static void SliderVisualDefault( XmScaleWidget widget, int offset, /* unused */ XrmValue *value ) { static XtEnum slider_visual ; value->addr = (XPointer) &slider_visual; if (widget->scale.sliding_mode == XmTHERMOMETER) { slider_visual = XmTROUGH_COLOR ; } else { slider_visual = XmSHADOWED_BACKGROUND ; } } /********************************************************************* * * SliderMarkDefault * * *********************************************************************/ /*ARGSUSED*/ static void SliderMarkDefault( XmScaleWidget widget, int offset, /* unused */ XrmValue *value ) { static XtEnum slider_mark ; value->addr = (XPointer) &slider_mark; if (!widget->scale.editable) slider_mark = XmNONE ; else { if (widget->scale.sliding_mode == XmTHERMOMETER) slider_mark = XmROUND_MARK ; else slider_mark = XmETCHED_LINE ; } } /********************************************************************* * * EditableDefault * * *********************************************************************/ /*ARGSUSED*/ static void EditableDefault( XmScaleWidget widget, int offset, /* unused */ XrmValue *value ) { static XtEnum editable ; value->addr = (XPointer) &editable; if (widget->scale.sliding_mode == XmTHERMOMETER) { editable = False ; } else { editable = True ; } } /* * XmRCallProc routine for checking list.font before setting it to NULL * if no value is specified for both XmNrenderTable and XmNfontList. * If "last_value" is True, then function has been called twice on same * widget, thus resource needs to be set NULL, otherwise leave it alone. */ /* ARGSUSED */ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value ) { XmScaleWidget sw = (XmScaleWidget)wid; /* Check if been here before */ if (sw->scale.last_value) value->addr = NULL; else { sw->scale.last_value = True; value->addr = (char*)&(sw->scale.font_list); } } /************************************************************************ * * ClassInitialize * ************************************************************************/ static void ClassInitialize( void ) { baseClassExtRec.record_type = XmQmotif ; if (null_region == NULL) null_region = XCreateRegion(); } /************************************************************************ * * ClassPartInitialize * Initialize the fast subclassing. * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmSCALE_BIT); /* Install transfer trait */ XmeTraitSet((XtPointer)wc, XmQTtransfer, (XtPointer) &ScaleTransfer); } /********************************************************************* * Initialize * Validate all of the argument data for the widget, create the * title label and scrollbar. * *********************************************************************/ /*ARGSUSED*/ static void ValidateInitialState( XmScaleWidget req, /* unused */ XmScaleWidget new_w ) { Boolean default_value = FALSE; float value_range; if (new_w->scale.minimum >= new_w->scale.maximum) { new_w->scale.minimum = 0; new_w->scale.maximum = 100; XmeWarning( (Widget) new_w, MESSAGE1); } value_range = (float)((float)new_w->scale.maximum - (float)new_w->scale.minimum); if (value_range > (float)((float)INT_MAX / (float) 2.0)) { new_w->scale.minimum = 0; if (new_w->scale.maximum > (INT_MAX / 2)) new_w->scale.maximum = INT_MAX / 2; XmeWarning( (Widget) new_w, MESSAGE9); } if (new_w->scale.value == XmINVALID_DIMENSION) { new_w->scale.value = 0; default_value = True; } if (new_w->scale.value < new_w->scale.minimum) { new_w->scale.value = new_w->scale.minimum; if (!default_value) XmeWarning( (Widget) new_w, MESSAGE2); } if (new_w->scale.value > new_w->scale.maximum) { new_w->scale.value = new_w->scale.minimum; if (!default_value) XmeWarning( (Widget) new_w, MESSAGE3); } if(!XmRepTypeValidValue( XmRID_ORIENTATION, new_w->scale.orientation, (Widget) new_w) ) { new_w->scale.orientation = XmVERTICAL; } if (!XmRepTypeValidValue( XmRID_SHOW_VALUE, new_w->scale.show_value, (Widget) new_w) ) { new_w->scale.show_value = XmNONE; } if (new_w->scale.orientation == XmHORIZONTAL) { if ((new_w->scale.processing_direction != XmMAX_ON_RIGHT) && (new_w->scale.processing_direction != XmMAX_ON_LEFT)) { new_w->scale.processing_direction = XmMAX_ON_RIGHT; XmeWarning( (Widget) new_w, MESSAGE5); } } else { if ((new_w->scale.processing_direction != XmMAX_ON_TOP) && (new_w->scale.processing_direction != XmMAX_ON_BOTTOM)) { new_w->scale.processing_direction = XmMAX_ON_TOP; XmeWarning( (Widget) new_w, MESSAGE5); } } if (new_w->scale.scale_multiple > (new_w->scale.maximum - new_w->scale.minimum)) { XmeWarning( (Widget) new_w, MESSAGE7); new_w->scale.scale_multiple = (new_w->scale.maximum - new_w->scale.minimum) / 10; } else if (new_w->scale.scale_multiple < 0) { XmeWarning( (Widget) new_w, MESSAGE8); new_w->scale.scale_multiple = (new_w->scale.maximum - new_w->scale.minimum) / 10; } else if (new_w->scale.scale_multiple == 0) new_w->scale.scale_multiple = (new_w->scale.maximum - new_w->scale.minimum) / 10; /* Assure a minimum value of 1 */ if (new_w->scale.scale_multiple < 1) new_w->scale.scale_multiple = 1; } static Widget CreateScaleTitle( XmScaleWidget new_w ) { XmLabelGadget title; Arg args[5]; int n; /* Create the title label gadget */ /* title can be NULL or a valid XmString, if null, the label will use its own name as XmString */ n = 0; XtSetArg (args[n], XmNlabelString, new_w->scale.title); n++; XtSetArg (args[n], XmNfontList, new_w->scale.font_list); n++; title = (XmLabelGadget) XmCreateLabelGadget( (Widget) new_w, "Title", args, n); if (new_w->scale.title) { XtManageChild ((Widget) title); new_w->scale.title = (XmString) -1 ; } /* scale.title need to be set to some special not NULL value in order to see any change at SetValues time and also to return NULL at Getvalue time in the hook. This is pirs 3197: when you setvalues a new xmstring as title, the value of the title field, a pointer, might be the same. */ return((Widget) title); } static Widget CreateScaleScrollBar( XmScaleWidget new_w ) { Widget scrollbar; Arg args[25]; int n = 0; /* Build up an arg list for and create the scrollbar */ n = 0; SET(XmNmaximum, SCROLLBAR_MAX); SET(XmNminimum, 0); SET(XmNshowArrows, new_w->scale.show_arrows); SET(XmNunitType, XmPIXELS); SET(XmNorientation, new_w->scale.orientation); SET(XmNprocessingDirection, new_w->scale.processing_direction); SET(XmNslidingMode, new_w->scale.sliding_mode); SET(XmNsliderVisual, new_w->scale.slider_visual); SET(XmNsliderMark, new_w->scale.slider_mark); SET(XmNeditable, new_w->scale.editable); if (new_w->scale.scale_width != 0) SET(XmNwidth, new_w->scale.scale_width); if (new_w->scale.scale_height != 0) SET(XmNheight, new_w->scale.scale_height); /* then get everything else from the scale parent */ /* another more incestuous but also more powerful - because it allows customization - way of doing that would be to provide resource default proc in ScrollBar that look for a Scale parent and inherit those visual resources */ SET(XmNhighlightColor, new_w->manager.highlight_color); SET(XmNhighlightPixmap, new_w->manager.highlight_pixmap); SET(XmNhighlightThickness, new_w->scale.highlight_thickness); SET(XmNhighlightOnEnter, new_w->scale.highlight_on_enter); SET(XmNtraversalOn, new_w->manager.traversal_on); SET(XmNshadowThickness, new_w->manager.shadow_thickness); SET(XmNbackground, new_w->core.background_pixel); SET(XmNtopShadowColor, new_w->manager.top_shadow_color); SET(XmNbottomShadowColor, new_w->manager.bottom_shadow_color); SET(XmNtopShadowPixmap, new_w->manager.top_shadow_pixmap); SET(XmNbottomShadowPixmap, new_w->manager.bottom_shadow_pixmap); scrollbar = XmCreateScrollBar( (Widget) new_w, "Scrollbar", args, n); XtManageChild(scrollbar); XtAddCallback(scrollbar, XmNvalueChangedCallback, ValueChanged, NULL); XtAddCallback(scrollbar, XmNdragCallback, ValueChanged, NULL); return(scrollbar); } /************************************************************************ * * GetForegroundGC * Get the graphics context used for drawing the slider value. * ************************************************************************/ static void GetForegroundGC( XmScaleWidget sw ) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = sw->manager.foreground; values.background = sw->core.background_pixel; values.graphics_exposures = False; if (sw->scale.font_struct) values.font = sw->scale.font_struct->fid, valueMask |= GCFont; /* if ((sw->core.background_pixmap != None) && (sw->core.background_pixmap != XmUNSPECIFIED_PIXMAP)) { valueMask |= GCFillStyle | GCTile ; values.fill_style = FillTiled; values.tile = sw->core.background_pixmap; }*/ /* Added dynamic clip mask & don't care about origion to merge with Label[Gadget] and List GC:s */ sw->scale.foreground_GC = XtAllocateGC ((Widget) sw, 0, valueMask, &values, GCClipMask, GCClipXOrigin | GCClipYOrigin); } /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmScaleWidget req = (XmScaleWidget) rw ; XmScaleWidget new_w = (XmScaleWidget) nw ; new_w->scale.value_region = XCreateRegion(); /* Validate the incoming data */ ValidateInitialState(req, new_w); if (new_w->scale.font_list == NULL) new_w->scale.font_list = XmeGetDefaultRenderTable( (Widget) new_w, XmLABEL_FONTLIST); /* Set the scale font struct used for interactive value display */ /* to the 0th font in the title font list. If not font list is */ /* provides, open up fixed and use that. */ new_w->scale.font_list = XmFontListCopy(new_w->scale.font_list); if (new_w->scale.font_list) { if (!XmeRenderTableGetDefaultFont(new_w->scale.font_list, &new_w->scale.font_struct)) new_w->scale.font_struct = NULL; #ifndef USE_XFT } else { new_w->scale.font_struct = XLoadQueryFont (XtDisplay (new_w), XmDEFAULT_FONT); if (new_w->scale.font_struct == NULL) new_w->scale.font_struct = XLoadQueryFont (XtDisplay (new_w), "*"); #endif } (void) CreateScaleTitle(new_w); (void) CreateScaleScrollBar(new_w); /* Get the foreground GC and initialize internal variables */ GetForegroundGC (new_w); new_w->scale.show_value_x = 0; new_w->scale.show_value_y = 0; new_w->scale.show_value_width = 0; new_w->scale.show_value_height = 0; new_w->scale.state_flags = 0 ; /* add the handler that drags the value shown in the scale window */ XtAddEventHandler(nw, ButtonPressMask, False, StartDrag, NULL); } /************************************************************************ * * Redisplay * General redisplay function called on exposure events. * Only redisplays the gadgets (title included) and the value, * the scrollbar will take care of itself. * ************************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmScaleWidget sw = (XmScaleWidget) wid ; XmeRedisplayGadgets( (Widget) sw, event, region); ShowValue (sw); } /************************************************************************ * * Resize * Re-layout children. * ************************************************************************/ static void Resize( Widget wid ) { XmScaleWidget sw = (XmScaleWidget) wid ; XtWidgetGeometry desired ; /* Find out what the best possible answer would be, the layout routines use this optimum for placing the children */ desired.width = 0; desired.height = 0; GetScaleSize(sw, &desired.width, &desired.height); if (sw->scale.orientation == XmHORIZONTAL) LayoutHorizontalScale(sw, &desired, NULL); else LayoutVerticalScale(sw, &desired, NULL); /* Scale has a gravity None, so resize will always generate redisplay */ } /************************************************************************ * * SetValues stuff * ************************************************************************/ static void ValidateInputs( XmScaleWidget cur, XmScaleWidget new_w ) { float value_range; /* Validate the incoming data */ if (new_w->scale.minimum >= new_w->scale.maximum) { new_w->scale.minimum = cur->scale.minimum; new_w->scale.maximum = cur->scale.maximum; XmeWarning( (Widget) new_w, MESSAGE1); } value_range = (float)((float)new_w->scale.maximum - (float)new_w->scale.minimum); if (value_range > (float)((float)INT_MAX / (float) 2.0)) { new_w->scale.minimum = 0; if (new_w->scale.maximum > (INT_MAX / 2)) new_w->scale.maximum = INT_MAX / 2; XmeWarning( (Widget) new_w, MESSAGE9); } if (new_w->scale.value < new_w->scale.minimum) { new_w->scale.value = new_w->scale.minimum; XmeWarning( (Widget) new_w, MESSAGE2); } if (new_w->scale.value > new_w->scale.maximum) { new_w->scale.value = new_w->scale.maximum; XmeWarning( (Widget) new_w, MESSAGE3); } if(!XmRepTypeValidValue( XmRID_SLIDING_MODE, new_w->scale.sliding_mode, (Widget) new_w) ) { new_w->scale.sliding_mode = cur->scale.sliding_mode; } if(!XmRepTypeValidValue( XmRID_ORIENTATION, new_w->scale.orientation, (Widget) new_w) ) { new_w->scale.orientation = cur->scale.orientation; } if(!XmRepTypeValidValue( XmRID_SHOW_VALUE, new_w->scale.show_value, (Widget) new_w) ) { new_w->scale.show_value = cur->scale.show_value; } if (new_w->scale.orientation == XmHORIZONTAL) { if (new_w->scale.processing_direction != XmMAX_ON_LEFT && new_w->scale.processing_direction != XmMAX_ON_RIGHT) { new_w->scale.processing_direction = cur->scale.processing_direction; XmeWarning( (Widget) new_w, MESSAGE5); } } else { if (new_w->scale.processing_direction != XmMAX_ON_TOP && new_w->scale.processing_direction != XmMAX_ON_BOTTOM) { new_w->scale.processing_direction = cur->scale.processing_direction; XmeWarning( (Widget) new_w, MESSAGE5); } } if (new_w->scale.scale_multiple != cur->scale.scale_multiple) { if (new_w->scale.scale_multiple > (new_w->scale.maximum - new_w->scale.minimum)) { XmeWarning( (Widget) new_w, MESSAGE7); new_w->scale.scale_multiple = (new_w->scale.maximum - new_w->scale.minimum) / 10; } else if (new_w->scale.scale_multiple < 0) { XmeWarning( (Widget) new_w, MESSAGE8); new_w->scale.scale_multiple = (new_w->scale.maximum - new_w->scale.minimum) / 10; } else if (new_w->scale.scale_multiple == 0) new_w->scale.scale_multiple = (new_w->scale.maximum - new_w->scale.minimum) / 10; /* Assure a minimum value of 1 */ if (new_w->scale.scale_multiple < 1) new_w->scale.scale_multiple = 1; } } /*ARGSUSED*/ static void HandleTitle( XmScaleWidget cur, XmScaleWidget req, /* unused */ XmScaleWidget new_w ) { Arg args[5]; int n = 0; /* cur title is either NULL or (-1), as set in CreateScaleTitle, so diff are always pertinent */ /* new title can be NULL or a valid xmstring */ if (new_w->scale.title != cur->scale.title) { XtSetArg (args[n], XmNlabelString, new_w->scale.title); n++; } if (new_w->scale.font_list != cur->scale.font_list) { XtSetArg (args[n], XmNfontList, new_w->scale.font_list); n++; } if (n) XtSetValues (new_w->composite.children[0], args, n); if (new_w->scale.title != cur->scale.title) { if (new_w->scale.title != NULL) { /* new title differs from old one and is no null, so it's a valid xmstring that we change to -1 */ XtManageChild(new_w->composite.children[0]); new_w->scale.title = (XmString) -1 ; } else /* new title differs from old one and is null, so we let it be null, so that get scale title returns null instead of the label string */ XtUnmanageChild (new_w->composite.children[0]); } } /*ARGSUSED*/ static void HandleScrollBar( XmScaleWidget cur, XmScaleWidget req, /* unused */ XmScaleWidget new_w ) { Arg args[30]; int n = 0; Widget scrollbar = new_w->composite.children[1]; int slider_size, increment, page, value ; /* reset any attributes of the scrollbar */ SET(XmNshowArrows, new_w->scale.show_arrows); SET(XmNorientation, new_w->scale.orientation); SET(XmNprocessingDirection, new_w->scale.processing_direction); if (new_w->scale.scale_width != cur->scale.scale_width) SET(XmNwidth, new_w->scale.scale_width); if (new_w->scale.scale_height != cur->scale.scale_height) SET(XmNheight, new_w->scale.scale_height); SET(XmNslidingMode, new_w->scale.sliding_mode); SET(XmNsliderMark, new_w->scale.slider_mark); SET(XmNsliderVisual, new_w->scale.slider_visual); SET(XmNeditable, new_w->scale.editable); /* there is an issue of propagation here, whether or not we want to force it. There is a behavior compatibility issue if we decide to change the current situation */ SET(XmNsensitive, new_w->core.sensitive); SET(XmNhighlightColor, new_w->manager.highlight_color); SET(XmNhighlightPixmap, new_w->manager.highlight_pixmap); SET(XmNhighlightThickness, new_w->scale.highlight_thickness); SET(XmNshadowThickness, new_w->manager.shadow_thickness); SET(XmNhighlightOnEnter, new_w->scale.highlight_on_enter); SET(XmNtraversalOn, new_w->manager.traversal_on); SET(XmNbackground, new_w->core.background_pixel); SET(XmNtopShadowColor, new_w->manager.top_shadow_color); SET(XmNtopShadowPixmap, new_w->manager.top_shadow_pixmap); SET(XmNbottomShadowColor, new_w->manager.bottom_shadow_color); SET(XmNbottomShadowPixmap, new_w->manager.bottom_shadow_pixmap); CalcScrollBarData(new_w, &value, &slider_size, &increment, &page); SET(XmNvalue, value); SET(XmNsliderSize, slider_size); SET(XmNincrement, increment); SET(XmNpageIncrement, page); XtSetValues (scrollbar, args, n); SetScrollBarData(new_w); } /************************************************************************ * * SetValues class method * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args_in, /* unused */ Cardinal *num_args_in ) /* unused */ { XmScaleWidget cur = (XmScaleWidget) cw ; XmScaleWidget req = (XmScaleWidget) rw ; XmScaleWidget new_w = (XmScaleWidget) nw ; Boolean redisplay = False ; #define DIFF(x) ((new_w->x) != (cur->x)) /* this flag is checked in the GM */ new_w->scale.state_flags |= FROM_SET_VALUE ; if (DIFF(scale.orientation)) { /* Make sure that processing direction tracks orientation */ if (!DIFF(scale.processing_direction)) { if ((new_w->scale.orientation == XmHORIZONTAL) && (cur->scale.processing_direction == XmMAX_ON_TOP)) new_w->scale.processing_direction = XmMAX_ON_RIGHT; else if ((new_w->scale.orientation == XmHORIZONTAL) && (cur->scale.processing_direction == XmMAX_ON_BOTTOM)) new_w->scale.processing_direction = XmMAX_ON_LEFT; else if ((new_w->scale.orientation == XmVERTICAL) && (cur->scale.processing_direction == XmMAX_ON_LEFT)) new_w->scale.processing_direction = XmMAX_ON_BOTTOM; else if ((new_w->scale.orientation == XmVERTICAL) && (cur->scale.processing_direction == XmMAX_ON_RIGHT)) new_w->scale.processing_direction = XmMAX_ON_TOP; } /* Make scale_width and scale_height track orientation too */ if ((new_w->scale.scale_width == cur->scale.scale_width) && (new_w->scale.scale_height == cur->scale.scale_height)) { new_w->scale.scale_width = cur->scale.scale_height; new_w->scale.scale_height = cur->scale.scale_width; } } ValidateInputs(cur, new_w); HandleTitle(cur, req, new_w); HandleScrollBar(cur, req, new_w); /* Set the font struct for the value displayed */ if (DIFF(scale.font_list)) { #ifndef USE_XFT if ((cur->scale.font_list == NULL) && (cur->scale.font_struct != NULL)) XFreeFont(XtDisplay (cur), cur->scale.font_struct); #endif if (cur->scale.font_list) XmFontListFree(cur->scale.font_list); if (new_w->scale.font_list == NULL) new_w->scale.font_list = XmeGetDefaultRenderTable( (Widget) new_w, XmLABEL_FONTLIST); new_w->scale.font_list = XmFontListCopy(new_w->scale.font_list); if (new_w->scale.font_list != NULL) { if (!XmeRenderTableGetDefaultFont(new_w->scale.font_list, &new_w->scale.font_struct)) new_w->scale.font_struct = NULL; #ifdef USE_XFT /* TODO: should it be ifndef? */ } else { new_w->scale.font_struct = XLoadQueryFont(XtDisplay(new_w), XmDEFAULT_FONT); if (new_w->scale.font_struct == NULL) new_w->scale.font_struct = XLoadQueryFont(XtDisplay(new_w), "*"); #endif } XtReleaseGC ((Widget) new_w, new_w->scale.foreground_GC); GetForegroundGC (new_w); redisplay = True; } if (XtIsRealized((Widget)new_w) && ( DIFF(scale.font_list) || DIFF(scale.highlight_thickness) || DIFF(scale.scale_height) || DIFF(scale.scale_width) || DIFF(scale.orientation) || DIFF(manager.unit_type) || DIFF(manager.shadow_thickness) || /* need to check on req for title since HandleTitle made the new_w field equal to cur */ (req->scale.title != cur->scale.title) || /* major show value change only */ (DIFF(scale.show_value) && ((new_w->scale.show_value == XmNONE) || (cur->scale.show_value == XmNONE))))) { Dimension width=0, height=0 ; /* * Re-calculate the size of the Scale if a new size was not * specified, and only if realized. */ GetScaleSize (new_w, &width, &height); if (new_w->core.width == cur->core.width) new_w->core.width = width ; if (new_w->core.height == cur->core.height) new_w->core.height = height ; } if (XtIsRealized((Widget)new_w) && (DIFF(scale.sliding_mode) || /* minor show value change only */ (DIFF(scale.show_value) && (new_w->scale.show_value != XmNONE) && (cur->scale.show_value != XmNONE)) || DIFF(scale.show_arrows))) { XtWidgetProc resize; /* generate a relayout and ask for redisplay, only if realized */ _XmProcessLock(); resize = xmScaleClassRec.core_class.resize; _XmProcessUnlock(); (* resize) (nw); redisplay = True; } if (XtIsRealized((Widget)new_w) && (DIFF(scale.decimal_points) || DIFF(scale.value) || DIFF(scale.minimum) || DIFF(scale.maximum) || DIFF(scale.processing_direction) || DIFF(scale.show_value))) { ShowValue(new_w); } /* See if the GC needs to be regenerated */ if (DIFF(manager.foreground) || DIFF(core.background_pixel)|| DIFF(core.background_pixmap)) { XtReleaseGC ((Widget) new_w, new_w->scale.foreground_GC); GetForegroundGC (new_w); redisplay = True; } /* unset the GM flag */ new_w->scale.state_flags &= ~FROM_SET_VALUE ; return (redisplay); #undef DIFF } /************************************************************************ * * Realize * Can't use the standard Manager class realize procedure, * because it creates a window with NW gravity, and the * scale wants a gravity of None. * ************************************************************************/ static void Realize( register Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { Mask valueMask = *p_valueMask; /* Make sure height and width are not zero. */ if (!XtWidth(w)) XtWidth(w) = 1 ; if (!XtHeight(w)) XtHeight(w) = 1 ; valueMask |= CWBitGravity | CWDontPropagate; attributes->bit_gravity = ForgetGravity; attributes->do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | PointerMotionMask; XtCreateWindow (w, InputOutput, CopyFromParent, valueMask, attributes); } /************************************************************************ * * Destroy * Free the callback lists attached to the scale. * ************************************************************************/ static void Destroy( Widget wid ) { XmScaleWidget sw = (XmScaleWidget) wid ; XtReleaseGC ((Widget) sw, sw->scale.foreground_GC); #ifdef USE_XFT if (sw->scale.font_list == NULL && sw->scale.font_struct != NULL) XFreeFont (XtDisplay (sw), sw->scale.font_struct); #endif if (sw->scale.font_list) XmFontListFree(sw->scale.font_list); if (sw->scale.value_region) XDestroyRegion(sw->scale.value_region); } /************************************************************************ * * QueryGeometry * ************************************************************************/ static XtGeometryResult QueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) { /* deal with user initial size setting */ if (!XtIsRealized(widget)) { desired->width = XtWidth(widget) ; /* might be 0 */ desired->height = XtHeight(widget) ; /* might be 0 */ } else { /* always computes natural size afterwards */ desired->width = 0 ; desired->height = 0 ; } GetScaleSize ((XmScaleWidget) widget, &desired->width, &desired->height); /* this function will set CWidth and CHeight */ return XmeReplyToQueryGeometry(widget, intended, desired) ; } /************************************************************************ * * GeometryManager * Accept everything except change in position. * ************************************************************************/ /*ARGSUSED*/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) /* unused */ { XtWidgetGeometry desired ; XmScaleWidget sw = (XmScaleWidget) XtParent(w) ; if (IsQueryOnly(request)) return XtGeometryYes; if (IsWidth(request)) w->core.width = request->width; if (IsHeight(request)) w->core.height = request->height; if (IsBorder(request)) w->core.border_width = request->border_width; /* no need to do any layout if it is our change, Xt will generate one at the end */ if (sw->scale.state_flags & FROM_SET_VALUE) return XtGeometryYes; /* Find out what the best possible answer would be */ desired.width = 0; desired.height = 0; GetScaleSize(sw, &desired.width, &desired.height); /* ask that to our parent */ desired.request_mode = (CWWidth | CWHeight); _XmMakeGeometryRequest((Widget) sw, &desired); /* layout using the new size (accepted or not) */ if (sw->scale.orientation == XmHORIZONTAL) LayoutHorizontalScale(sw, &desired, w); else /* sw->scale.orientation == XmVERTICAL */ LayoutVerticalScale(sw, &desired, w); return XtGeometryYes; } /********************************************************************* * ChangeManaged * Layout children. * *********************************************************************/ static void ChangeManaged( Widget wid ) { XmScaleWidget sw = (XmScaleWidget) wid ; XtWidgetGeometry desired ; Dimension tmp_width = 0, tmp_height = 0 ; GetScaleSize(sw, &tmp_width, &tmp_height); desired.width = tmp_width ; desired.height = tmp_height ; if (!XtIsRealized((Widget)sw)) { /* the first time, only attemps to change non specified sizes */ if (XtWidth(sw)) desired.width = XtWidth(sw) ; if (XtHeight(sw)) desired.height = XtHeight(sw) ; } desired.request_mode = (CWWidth | CWHeight); _XmMakeGeometryRequest((Widget) sw, &desired); /* layout with no instigator, but with our real preferred size */ desired.width = tmp_width ; desired.height = tmp_height ; if (sw->scale.orientation == XmHORIZONTAL) LayoutHorizontalScale(sw, &desired, NULL); else LayoutVerticalScale(sw, &desired, NULL); XmeNavigChangeManaged( (Widget) sw); } static void GetScaleSize( XmScaleWidget sw, Dimension *w, Dimension *h ) { Dimension sav_w, sav_h; sav_w = XtWidth(sw); sav_h = XtHeight(sw); /* Mark the scale as anything goes */ XtWidth(sw) = *w; XtHeight(sw) = *h; /* only override the pointed dimensions if they are null */ if (sw->scale.orientation == XmHORIZONTAL) { if (!*w) { *w = MAX(TitleWidth(sw), MajorLeadPad(sw) + ScrollWidth(sw) + MajorTrailPad(sw)); } if (!*h) { *h = MaxLabelHeight(sw) + ValueTroughHeight(sw) + ScrollHeight(sw) + TitleHeight(sw); if (sw->scale.show_value) *h += SCALE_VALUE_MARGIN; } } else /* sw->scale.orientation == XmVERTICAL */ { if (!*w) { *w = MaxLabelWidth(sw) + ValueTroughWidth(sw) + ScrollWidth(sw) + TitleWidth(sw); if (sw->scale.show_value) *w += SCALE_VALUE_MARGIN; } if (!*h) { *h = MAX(TitleHeight(sw), MajorLeadPad(sw) + ScrollHeight(sw) + MajorTrailPad(sw)); } } /* Don't ever desire 0 dimensions */ if (!*w) *w = 1; if (!*h) *h = 1; /* Restore the current values */ XtWidth(sw) = sav_w; XtHeight(sw) = sav_h; } static Dimension MaxLabelWidth( XmScaleWidget sw ) { register int i; register Widget c; Dimension max = 0; /* start at 2 to skip the title and the scrollbar */ for ( i = 2; i < sw->composite.num_children; i++) { c = sw->composite.children[i]; if (XtIsManaged(c) && !((Object)c)->object.being_destroyed) ASSIGN_MAX(max, TotalWidth(c)); } return (max); } static Dimension MaxLabelHeight( XmScaleWidget sw ) { register int i; register Widget c; Dimension max = 0; /* start at 2 to skip the title and the scrollbar */ for ( i = 2; i < sw->composite.num_children; i++) { c = sw->composite.children[i]; if (XtIsManaged(c) && !((Object)c)->object.being_destroyed) ASSIGN_MAX(max, TotalHeight(c)); } return (max); } static Dimension ValueTroughHeight( XmScaleWidget sw) { #if USE_XFT int ret_val = 0; if (sw->scale.show_value) { XmRenderTableGetDefaultFontExtents(sw->scale.font_list, &ret_val, NULL, NULL); } return (Dimension)ret_val; #else char buff[15]; register Dimension tmp_max, tmp_min, result; int direction, ascent, descent; XCharStruct overall_return; #define GET_MAX(tmp, max_or_min_value) {\ if (sw->scale.decimal_points)\ sprintf(buff, "%d%c", max_or_min_value,\ nl_langinfo(RADIXCHAR)[0]);\ else\ sprintf(buff, "%d", max_or_min_value);\ \ XTextExtents(sw->scale.font_struct, buff, strlen(buff),\ &direction, &ascent, &descent, &overall_return);\ \ tmp = ascent + descent;\ } if (sw->scale.show_value) { GET_MAX(tmp_max, sw->scale.maximum) ; GET_MAX(tmp_min, sw->scale.minimum) ; result = MAX(tmp_min, tmp_max); return (result); } else return (0); #undef GET_MAX #endif } static Dimension ValueTroughAscent( XmScaleWidget sw) { #if USE_XFT int ret_val = 0; if (sw->scale.show_value) { XmRenderTableGetDefaultFontExtents(sw->scale.font_list, NULL, &ret_val, NULL); } return (Dimension)ret_val; #else char buff[15]; register Dimension tmp_max, tmp_min, result; int direction, ascent, descent; XCharStruct overall_return; #define GET_MAX(tmp, max_or_min_value) {\ if (sw->scale.decimal_points)\ sprintf(buff, "%d%c", max_or_min_value,\ nl_langinfo(RADIXCHAR)[0]);\ else\ sprintf(buff, "%d", max_or_min_value);\ \ XTextExtents(sw->scale.font_struct, buff, strlen(buff),\ &direction, &ascent, &descent, &overall_return);\ \ tmp = ascent;\ } if (sw->scale.show_value) { GET_MAX(tmp_max, sw->scale.maximum) ; GET_MAX(tmp_min, sw->scale.minimum) ; result = MAX(tmp_min, tmp_max); return (result); } else return (0); #undef GET_MAX #endif } static Dimension ValueTroughDescent( XmScaleWidget sw) { #if USE_XFT int ret_val = 0; if (sw->scale.show_value) { XmRenderTableGetDefaultFontExtents(sw->scale.font_list, NULL, NULL, &ret_val); } return (Dimension)ret_val; #else char buff[15]; register Dimension tmp_max, tmp_min, result; int direction, ascent, descent; XCharStruct overall_return; #define GET_MAX(tmp, max_or_min_value) {\ if (sw->scale.decimal_points)\ sprintf(buff, "%d%c", max_or_min_value,\ nl_langinfo(RADIXCHAR)[0]);\ else\ sprintf(buff, "%d", max_or_min_value);\ \ XTextExtents(sw->scale.font_struct, buff, strlen(buff),\ &direction, &ascent, &descent, &overall_return);\ \ tmp = descent;\ } if (sw->scale.show_value) { GET_MAX(tmp_max, sw->scale.maximum) ; GET_MAX(tmp_min, sw->scale.minimum) ; result = MAX(tmp_min, tmp_max); return (result); } else return (0); #undef GET_MAX #endif } static Dimension ValueTroughWidth( XmScaleWidget sw) { char buff[15]; register Dimension tmp_max, tmp_min, result; int direction, ascent, descent; XCharStruct overall_return; #if USE_XFT #define GET_MAX(tmp, max_or_min_value) {\ XmString tmp_str;\ if (sw->scale.decimal_points)\ sprintf(buff, "%d%c", max_or_min_value,\ nl_langinfo(RADIXCHAR)[0]);\ else\ sprintf(buff, "%d", max_or_min_value);\ \ tmp = XmStringWidth(sw->scale.font_list, tmp_str = XmStringCreateSimple(buff));\ XmStringFree(tmp_str);\ } #else #define GET_MAX(tmp, max_or_min_value) {\ if (sw->scale.decimal_points)\ sprintf(buff, "%d%c", max_or_min_value,\ nl_langinfo(RADIXCHAR)[0]);\ else\ sprintf(buff, "%d", max_or_min_value);\ \ XTextExtents(sw->scale.font_struct, buff, strlen(buff),\ &direction, &ascent, &descent, &overall_return);\ \ tmp = overall_return.rbearing - overall_return.lbearing;\ } #endif if (sw->scale.show_value) { GET_MAX(tmp_max, sw->scale.maximum) ; GET_MAX(tmp_min, sw->scale.minimum) ; result = MAX(tmp_min, tmp_max); return (result); } else return (0); #undef GET_MAX } static Dimension TitleWidth( XmScaleWidget sw ) { register Dimension tmp = 0; register Widget title_widget = sw->composite.children[0]; if (XtIsManaged(title_widget)) { tmp = TotalWidth(title_widget) ; if (sw->scale.orientation == XmVERTICAL) tmp += (TotalHeight(title_widget)) >> 2; } return(tmp); } static Dimension TitleHeight( XmScaleWidget sw ) { register Dimension tmp = 0; register Widget title_widget = sw->composite.children[0]; if (XtIsManaged(title_widget)) { tmp = TotalHeight(title_widget); if (sw->scale.orientation == XmHORIZONTAL) tmp += (TotalHeight(title_widget)) >> 2; } return(tmp); } static Cardinal NumManaged( XmScaleWidget sw, Widget * first_man, Widget * last_man) { Cardinal i, num_managed = 0 ; Widget first_tic = NULL, last_tic = NULL, c ; for (i = 2; i < sw->composite.num_children; i++) { c = sw->composite.children[i]; if (XtIsManaged(c) && !((Object)c)->object.being_destroyed) { num_managed ++ ; if (!first_tic) first_tic = c ; last_tic = c ; } } if (first_man) *first_man = first_tic ; if (last_man) *last_man = last_tic ; return num_managed + 2 ; } static Dimension MajorLeadPad( XmScaleWidget sw ) { XmScrollBarWidget sb = (XmScrollBarWidget)(sw->composite.children[1]); int tmp1 = 0, tmp2; Cardinal num_managed ; Widget first_tic ; num_managed = NumManaged(sw, &first_tic, NULL); if (num_managed > 3) { if (sw->scale.orientation == XmHORIZONTAL) tmp1 = (TotalWidth(first_tic) / 2) - LeadXTic(sb, sw); else tmp1 = (TotalHeight(first_tic) / 2) - LeadYTic(sb, sw); } else if (num_managed == 3) { /* * This is a potential non-terminal recursion. * * Currently MajorScrollSize has knowledge of this potential * problem and has guards around the call to this procedure. * Modify with care. */ if (sw->scale.orientation == XmHORIZONTAL) tmp1 = ((int)TotalWidth(first_tic) - (int)ScrollWidth(sw))/2; else tmp1 = ((int)TotalHeight(first_tic) - (int)ScrollHeight(sw))/2; } tmp1 -= (sb->primitive.highlight_thickness + sb->primitive.shadow_thickness); if (sw->scale.orientation == XmHORIZONTAL) tmp2 = ((int)ValueTroughWidth(sw) / 2) - (int)LeadXTic(sb, sw); else { if (sw->scale.sliding_mode == XmTHERMOMETER) tmp2 = ((int)ValueTroughAscent(sw)) - (int)LeadYTic(sb, sw); else tmp2 = ((int)ValueTroughHeight(sw) / 2) - (int)LeadYTic(sb, sw); } tmp2 -= (sb->primitive.highlight_thickness + sb->primitive.shadow_thickness); ASSIGN_MAX(tmp1, 0); ASSIGN_MAX(tmp2, 0); return(MAX(tmp1, tmp2)); } static Dimension MajorTrailPad( XmScaleWidget sw ) { XmScrollBarWidget sb = (XmScrollBarWidget) (sw->composite.children[1]); int tmp1 = 0, tmp2; Cardinal num_managed ; Widget first_tic, last_tic ; num_managed = NumManaged(sw, &first_tic, &last_tic); if (num_managed > 3) { if (sw->scale.orientation == XmHORIZONTAL) tmp1 = ((int)TotalWidth(last_tic) / 2) - (int)TrailXTic(sb, sw); else tmp1 = ((int)TotalHeight(last_tic) / 2) - (int)TrailYTic(sb, sw); } else if (num_managed == 3) { /* * This is a potential non-terminal recursion. * * Currently MajorScrollSize has knowledge of this potential * problem and has guards around the call to this procedure. * Modify with care. */ if (sw->scale.orientation == XmHORIZONTAL) tmp1 = ((int)TotalWidth(first_tic) - (int)ScrollWidth(sw))/2; else tmp1 = ((int)TotalHeight(first_tic) - (int)ScrollHeight(sw))/2; } tmp1 -= (sb->primitive.highlight_thickness + sb->primitive.shadow_thickness); if (sw->scale.orientation == XmHORIZONTAL) tmp2 = ((int)ValueTroughWidth(sw) / 2) - (int)TrailXTic(sb, sw); else { if (sw->scale.sliding_mode == XmTHERMOMETER) tmp2 = ((int)ValueTroughDescent(sw)) - (int)TrailYTic(sb, sw); else tmp2 = ((int)ValueTroughHeight(sw) / 2) - (int)TrailYTic(sb, sw); } #ifdef FIX_1528 tmp2 += (sb->primitive.highlight_thickness + sb->primitive.shadow_thickness); #else tmp2 -= (sb->primitive.highlight_thickness + sb->primitive.shadow_thickness); #endif ASSIGN_MAX(tmp1, 0); ASSIGN_MAX(tmp2, 0); return(MAX(tmp1, tmp2)); } static Dimension ScrollWidth( XmScaleWidget sw ) { int tmp = 0; if (sw->scale.orientation == XmVERTICAL) { if (!(tmp = sw->scale.scale_width)) tmp = SCALE_DEFAULT_MINOR_SIZE; else tmp = sw->scale.scale_width; } else { if (!(tmp = sw->scale.scale_width)) { if (sw->core.width != 0) { Cardinal num_managed ; num_managed = NumManaged(sw, NULL, NULL); /* Have to catch an indirect recursion here */ if (num_managed > 3) tmp = (int)sw->core.width - (MajorLeadPad(sw) + MajorTrailPad(sw)); else { /* Magic to handle excessively wide values */ int tmp1, tmp2; XmScrollBarWidget sb = (XmScrollBarWidget) sw->composite.children[1]; tmp1 = ((int)ValueTroughWidth(sw) / 2) - (int)LeadXTic(sb, sw); tmp2 = ((int)ValueTroughWidth(sw) / 2) - (int)TrailXTic(sb, sw); ASSIGN_MAX(tmp1, 0); ASSIGN_MAX(tmp2, 0); tmp = (int)sw->core.width - tmp1 - tmp2; } } } if (tmp <= 0) { Cardinal num_managed ; num_managed = NumManaged(sw, NULL, NULL); if (num_managed > 2) { /* Have to catch an indirect recursion here */ if (num_managed > 3) { Dimension tic, diff; XmScrollBarWidget sb = (XmScrollBarWidget) sw->composite.children[1]; #ifdef FIX_1528 tmp = MAX((num_managed - 2)* MaxLabelWidth(sw), SCALE_DEFAULT_MAJOR_SIZE); #else tmp = (num_managed - 2)* MaxLabelWidth(sw); #endif tic = sb->primitive.highlight_thickness + sb->primitive.shadow_thickness + (Dimension) (((float) SLIDER_SIZE( sw) / 2.0) + 0.5); diff = tic - ((int)MaxLabelWidth(sw) / 2); if (diff > 0) tmp+= (2 * diff); } else #ifdef FIX_1528 tmp = MAX(MaxLabelWidth(sw), SCALE_DEFAULT_MAJOR_SIZE); #else tmp = MaxLabelWidth(sw); #endif } } if (tmp <= 0) tmp = SCALE_DEFAULT_MAJOR_SIZE; } return((Dimension) tmp); } static Dimension ScrollHeight( XmScaleWidget sw ) { int tmp; if (sw->scale.orientation == XmHORIZONTAL) { if (!(tmp = sw->scale.scale_height)) tmp = SCALE_DEFAULT_MINOR_SIZE; else tmp = sw->scale.scale_height; } else { if (!(tmp = sw->scale.scale_height)){ if (sw->core.height != 0) { Cardinal num_managed ; num_managed = NumManaged(sw, NULL, NULL); /* Have to catch an indirect recursion here */ if (num_managed > 3) tmp = (int)sw->core.height - (MajorLeadPad(sw) + MajorTrailPad(sw)); else #ifdef FIX_1528 { int tmp1, tmp2; XmScrollBarWidget sb = (XmScrollBarWidget) sw->composite.children[1]; tmp1 = ((int)ValueTroughHeight(sw) / 2) - (int)LeadYTic(sb, sw); tmp2 = ((int)ValueTroughHeight(sw) / 2) - (int)TrailYTic(sb, sw); ASSIGN_MAX(tmp1, 0); ASSIGN_MAX(tmp2, 0); tmp = (int)sw->core.height - tmp1 - tmp2; } #else tmp = sw->core.height; #endif } } if (tmp <= 0){ Cardinal num_managed ; num_managed = NumManaged(sw, NULL, NULL); if (num_managed > 2){ /* Have to catch an indirect recursion here */ if (num_managed > 3) { Dimension tic, diff; XmScrollBarWidget sb = (XmScrollBarWidget) sw->composite.children[1]; #ifdef FIX_1528 tmp = MAX((num_managed - 2)* MaxLabelHeight(sw), SCALE_DEFAULT_MAJOR_SIZE); #else tmp = (num_managed - 2)* MaxLabelHeight(sw); #endif tic = sb->primitive.highlight_thickness + sb->primitive.shadow_thickness + (Dimension) (((float) SLIDER_SIZE(sw) / 2.0) + 0.5); diff = tic - (MaxLabelHeight(sw) / 2); if (diff > 0) tmp+= (2 * diff); } else #ifdef FIX_1528 tmp = MAX(MaxLabelHeight(sw), SCALE_DEFAULT_MAJOR_SIZE); #else tmp = MaxLabelHeight(sw); #endif } } if (tmp <= 0) tmp = SCALE_DEFAULT_MAJOR_SIZE; } return((Dimension)tmp); } static void LayoutHorizontalLabels( XmScaleWidget sw, XRectangle *scrollBox, XRectangle *labelBox, Widget instigator ) { Dimension first_tic_dim, last_tic_dim; float tic_interval, tmp ; XmScrollBarWidget sb = (XmScrollBarWidget) (sw->composite.children[1]); Widget w, first_tic; int i; Position x, y, y1; Cardinal num_managed ; y1 = labelBox->y + labelBox->height; num_managed = NumManaged(sw, &first_tic, NULL); if (num_managed > 3) { first_tic_dim = scrollBox->x + LeadXTic(sb, sw); last_tic_dim = (scrollBox->x + sb->core.width) - TrailXTic(sb, sw); tic_interval = (float)(last_tic_dim - first_tic_dim) / (num_managed - 3); for (i = 2, tmp = first_tic_dim; i < sw->composite.num_children; i++) { if (LayoutIsRtoLM(sw) && sw->scale.processing_direction == XmMAX_ON_LEFT) w = sw->composite.children[sw->composite.num_children - i + 1]; else w = sw->composite.children[i]; if (!XtIsManaged(w) || ((Object)w)->object.being_destroyed) continue ; x = (int) tmp - (TotalWidth(w) / 2); y = y1 - TotalHeight(w); if (instigator != w) XmeConfigureObject(w, x, y, w->core.width, w->core.height, w->core.border_width); else { w->core.x = x ; w->core.y = y ; } tmp += tic_interval ; } } else if (num_managed == 3) { w = first_tic; y = y1 - TotalHeight(w); if (XtIsManaged(w) && !((Object)w)->object.being_destroyed) { tmp = (sb->scrollBar.slider_area_width - TotalWidth(w)) / 2; x = scrollBox->x + sb->scrollBar.slider_area_x + (int) tmp ; if (instigator != w) XmeConfigureObject(w, x, y, w->core.width, w->core.height, w->core.border_width); else { w->core.x = x ; w->core.y = y ; } } } } static void LayoutHorizontalScale( XmScaleWidget sw, XtWidgetGeometry * desired, Widget instigator) { int diff_w, diff_h, tdiff; XRectangle labelBox, valueBox, scrollBox, titleBox; diff_w = XtWidth(sw) - desired->width; diff_h = XtHeight(sw) - desired->height; titleBox.height = TitleHeight(sw); scrollBox.height = ScrollHeight(sw); valueBox.height = ValueTroughHeight(sw); labelBox.height = MaxLabelHeight(sw); /* Figure out all of the y locations */ if (diff_h >= 0) { /* * We place the title, scrollbar, and value from the right */ titleBox.y = XtHeight(sw) - titleBox.height; scrollBox.y = titleBox.y - scrollBox.height; if (sw->scale.show_value == XmNEAR_BORDER) { valueBox.y = 0; labelBox.y = scrollBox.y - labelBox.height; } else { /* NEAR_SLIDER or NONE */ labelBox.y = 0; valueBox.y = scrollBox.y - valueBox.height; } } else if ((tdiff = diff_h + TitleHeight(sw)) >= 0) { /* Place from the left and let the title get clipped */ if (sw->scale.show_value == XmNEAR_BORDER) { valueBox.y = 0; labelBox.y = valueBox.y + valueBox.height; } else { /* NEAR_SLIDER or NONE */ labelBox.y = 0; valueBox.y = labelBox.y + labelBox.height; } scrollBox.y = valueBox.y + valueBox.height; titleBox.y = scrollBox.y + scrollBox.height; } else if ((tdiff += ValueTroughHeight(sw)) >= 0) { /* * The title is outside the window, and the labels are * allowed overwrite (occlude) the value display region */ titleBox.y = XtHeight(sw); scrollBox.y = titleBox.y - scrollBox.height; if (sw->scale.show_value == XmNEAR_BORDER) { valueBox.y = 0; labelBox.y = scrollBox.y - labelBox.height; } else { /* NEAR_SLIDER or NONE */ valueBox.y = scrollBox.y - valueBox.height; labelBox.y = 0; } } else if ((tdiff += MaxLabelHeight(sw)) >= 0) { /* * The title is outside the window, the value trough is * completely coincident with the label region, and the * labels are clipped from the left */ titleBox.y = XtHeight(sw); scrollBox.y = titleBox.y - scrollBox.height; labelBox.y = scrollBox.y - labelBox.height; valueBox.y = scrollBox.y - valueBox.height; } else { /* * Just center the scrollbar in the available space. */ titleBox.y = XtHeight(sw); valueBox.y = titleBox.y; labelBox.y = valueBox.y; scrollBox.y = (XtHeight(sw) - ScrollHeight(sw)) / 2; } if (diff_w >= 0) { scrollBox.x = MajorLeadPad(sw); scrollBox.width = ScrollWidth(sw); } else { Dimension sb_min, avail, lp, tp; XmScrollBarWidget sb = (XmScrollBarWidget) (sw->composite.children[1]); sb_min = (2 * sb->primitive.highlight_thickness) + (4 * sb->primitive.shadow_thickness) + SLIDER_SIZE( sw); lp = MajorLeadPad(sw); tp = MajorTrailPad(sw); avail = XtWidth(sw) - lp - tp; if (avail < sb_min) { scrollBox.width = sb_min; scrollBox.x = (XtWidth(sw) - sb_min) / 2; } else { scrollBox.width = avail; scrollBox.x = lp; } } if (LayoutIsRtoLM(sw)) { titleBox.x = ScrollWidth(sw) - TitleWidth(sw); XmeConfigureObject(sw->composite.children[0], titleBox.x, titleBox.y, (sw->composite.children[0])->core.width, (sw->composite.children[0])->core.height, (sw->composite.children[0])->core.border_width); } else if (instigator != sw->composite.children[0]) XmeConfigureObject(sw->composite.children[0], 0, titleBox.y, (sw->composite.children[0])->core.width, (sw->composite.children[0])->core.height, (sw->composite.children[0])->core.border_width); else { sw->composite.children[0]->core.x = 0 ; sw->composite.children[0]->core.y = titleBox.y ; } if (instigator != sw->composite.children[1]) XmeConfigureObject(sw->composite.children[1], scrollBox.x, scrollBox.y, scrollBox.width, scrollBox.height, 0); else { sw->composite.children[1]->core.x = scrollBox.x ; sw->composite.children[1]->core.y = scrollBox.y ; sw->composite.children[1]->core.width = scrollBox.width ; sw->composite.children[1]->core.height = scrollBox.height ; sw->composite.children[1]->core.border_width = 0 ; } SetScrollBarData(sw); LayoutHorizontalLabels(sw, &scrollBox, &labelBox, instigator); } static void LayoutVerticalLabels( XmScaleWidget sw, XRectangle *scrollBox, XRectangle *labelBox, Widget instigator ) { Dimension first_tic_dim, last_tic_dim; XmScrollBarWidget sb = (XmScrollBarWidget) (sw->composite.children[1]); Widget w, first_tic; int i; float tmp, tic_interval; Position x, x1, y; Cardinal num_managed ; num_managed = NumManaged(sw, &first_tic, NULL); x1 = labelBox->x + labelBox->width; if (num_managed > 3) { first_tic_dim = scrollBox->y + LeadYTic(sb, sw); last_tic_dim = (scrollBox->y + sb->core.height) - TrailYTic(sb, sw); tic_interval = (float)(last_tic_dim - first_tic_dim) / (num_managed - 3); for (i = 2, tmp = first_tic_dim; i < sw->composite.num_children; i++) { w = sw->composite.children[i]; if (!XtIsManaged(w) || ((Object)w)->object.being_destroyed) continue ; y = (int) tmp - (TotalHeight(w) / 2); if (LayoutIsRtoLM(sw)) x = labelBox->x; else x = x1 - TotalWidth(w); if (instigator != w) XmeConfigureObject(w, x, y, w->core.width, w->core.height, w->core.border_width); else { w->core.x = x ; w->core.y = y ; } tmp += tic_interval ; } } else if (num_managed == 3) { w = first_tic; if (XtIsManaged(w) && !((Object)w)->object.being_destroyed) { x = x1 - TotalWidth(w); tmp = (sb->scrollBar.slider_area_height - TotalHeight(w)) / 2; y = scrollBox->y + sb->scrollBar.slider_area_y + (int) tmp; if (instigator != w) XmeConfigureObject(w, x, y, w->core.width, w->core.height, w->core.border_width); else { w->core.x = x ; w->core.y = y ; } } } } static void LayoutVerticalScale( XmScaleWidget sw, XtWidgetGeometry * desired, Widget instigator) { int diff_w, diff_h, tdiff; XRectangle labelBox, valueBox, scrollBox, titleBox; diff_w = XtWidth(sw) - desired->width; diff_h = XtHeight(sw) - desired->height; titleBox.width = TitleWidth(sw); scrollBox.width = ScrollWidth(sw); valueBox.width = ValueTroughWidth(sw); labelBox.width = MaxLabelWidth(sw); /* Figure out all of the x locations */ if (diff_w >= 0) { if (LayoutIsRtoLM(sw)) { /* * Place the title, scrollbar, and value from the left */ titleBox.x = 0; scrollBox.x = titleBox.x + titleBox.width; if (sw->scale.show_value == XmNEAR_BORDER) { valueBox.x = XtWidth(sw) - valueBox.width; labelBox.x = scrollBox.x + scrollBox.width; } else { /* NEAR_SLIDER or NONE */ valueBox.x = scrollBox.x + scrollBox.width; labelBox.x = XtWidth(sw) - labelBox.width; } } else { /* * We place the title, scrollbar, and value from the right */ titleBox.x = XtWidth(sw) - titleBox.width; scrollBox.x = titleBox.x - scrollBox.width; if (sw->scale.show_value == XmNEAR_BORDER) { valueBox.x = 0; labelBox.x = scrollBox.x - labelBox.width; } else { /* NEAR_SLIDER or NONE */ valueBox.x = scrollBox.x - valueBox.width; labelBox.x = 0; } } } else if ((tdiff = diff_w + TitleWidth(sw)) >= 0) { if (LayoutIsRtoLM(sw)) { /* Place from the right and let the title get clipped */ if (sw->scale.show_value == XmNEAR_BORDER) { valueBox.x = XtWidth(sw) - labelBox.width; labelBox.x = valueBox.x - valueBox.width; scrollBox.x = labelBox.x - scrollBox.width; } else { /* NEAR_SLIDER or NONE */ labelBox.x = XtWidth(sw) - labelBox.width; valueBox.x = labelBox.x - valueBox.width; scrollBox.x = valueBox.x - scrollBox.width; } titleBox.x = scrollBox.x - titleBox.width; } else { /* Place from the left and let the title get clipped */ if (sw->scale.show_value == XmNEAR_BORDER) { valueBox.x = 0; labelBox.x = valueBox.x + valueBox.width; scrollBox.x = labelBox.x + labelBox.width; } else { /* NEAR_SLIDER or NONE */ labelBox.x = 0; valueBox.x = labelBox.x + labelBox.width; scrollBox.x = valueBox.x + valueBox.width; } titleBox.x = scrollBox.x + scrollBox.width; } } else if ((tdiff += ValueTroughWidth(sw)) >= 0) { /* * The title is outside the window, and the labels are * allowed overwrite (occlude) the value display region */ if (LayoutIsRtoLM(sw)) { titleBox.x = -titleBox.width; scrollBox.x = 0; if (sw->scale.show_value == XmNEAR_BORDER) { labelBox.x = scrollBox.x + scrollBox.width; valueBox.x = XtWidth(sw) - valueBox.width; } else { /* NEAR_SLIDER or NONE */ valueBox.x = scrollBox.x + scrollBox.width; labelBox.x = XtWidth(sw) - labelBox.width; } } else { titleBox.x = XtWidth(sw); scrollBox.x = titleBox.x - scrollBox.width; if (sw->scale.show_value == XmNEAR_BORDER) { labelBox.x = scrollBox.x - labelBox.width; valueBox.x = 0; } else { /* NEAR_SLIDER or NONE */ valueBox.x = scrollBox.x - valueBox.width; labelBox.x = 0; } } } else if ((tdiff += MaxLabelWidth(sw)) >= 0) { /* * The title is outside the window, the value trough is * completely coincident with the label region, and the * labels are clipped from the left */ titleBox.x = XtWidth(sw); scrollBox.x = titleBox.x - scrollBox.width; valueBox.x = scrollBox.x - valueBox.width; labelBox.x = scrollBox.x - labelBox.width; if (LayoutIsRtoLM(sw)) { titleBox.x = -titleBox.width; scrollBox.x = 0; valueBox.x = scrollBox.x + scrollBox.width; labelBox.x = scrollBox.x + scrollBox.width; } } else { /* * Just center the scrollbar in the available space. */ titleBox.x = XtWidth(sw); valueBox.x = titleBox.x; labelBox.x = valueBox.x; scrollBox.x = (XtWidth(sw) - ScrollWidth(sw)) / 2; } if (diff_h >= 0) { scrollBox.y = MajorLeadPad(sw); scrollBox.height = ScrollHeight(sw); } else { Dimension sb_min, avail, lp, tp; XmScrollBarWidget sb = (XmScrollBarWidget) (sw->composite.children[1]); sb_min = (2 * sb->primitive.highlight_thickness) + (4 * sb->primitive.shadow_thickness) + SLIDER_SIZE( sw); lp = MajorLeadPad(sw); tp = MajorTrailPad(sw); avail = XtHeight(sw) - lp - tp; if (avail < sb_min) { scrollBox.height = sb_min; scrollBox.y = (XtHeight(sw) - sb_min) / 2; } else { scrollBox.height = avail; scrollBox.y = lp; } } if (instigator != sw->composite.children[0]) XmeConfigureObject(sw->composite.children[0], titleBox.x, 0, (sw->composite.children[0])->core.width, (sw->composite.children[0])->core.height, (sw->composite.children[0])->core.border_width); else { sw->composite.children[0]->core.x = titleBox.x ; sw->composite.children[0]->core.y = 0 ; } if (instigator != sw->composite.children[1]) XmeConfigureObject(sw->composite.children[1], scrollBox.x, scrollBox.y, scrollBox.width, scrollBox.height, 0); else { sw->composite.children[1]->core.x = scrollBox.x ; sw->composite.children[1]->core.y = scrollBox.y ; sw->composite.children[1]->core.width = scrollBox.width ; sw->composite.children[1]->core.height = scrollBox.height ; sw->composite.children[1]->core.border_width = 0 ; } SetScrollBarData(sw); LayoutVerticalLabels(sw, &scrollBox, &labelBox, instigator); } /************************************************************************/ static void GetValueString( XmScaleWidget sw, int value, String buffer) { register int i; int diff, dec_point_size; struct lconv *loc_values; if (sw->scale.decimal_points > 0) { /* Add one to decimal points to get leading zero, since only US sometimes skips this zero, not other countries */ sprintf (buffer,"%.*d", sw->scale.decimal_points+1, value); diff = strlen(buffer) - sw->scale.decimal_points; loc_values = localeconv(); dec_point_size = strlen(loc_values->decimal_point); for (i = strlen(buffer); i >= diff; i--) buffer[i+dec_point_size] = buffer[i]; for (i=0; idecimal_point[i]; } else sprintf (buffer,"%d", value); } /************************************************************************ * * ShowValue * Display or erase the slider value. * ************************************************************************/ static void ShowValue( XmScaleWidget sw) { #if USE_XFT Dimension x, y, width, height; #else int x, y, width, height; #endif XCharStruct width_return; char buffer[256]; int direction, descent; XmScrollBarWidget scrollbar; Region value_region = sw->scale.value_region; XRectangle value_rect; XmString tmp_str; if (!XtIsRealized((Widget)sw)) return; x = sw->scale.show_value_x; y = sw->scale.show_value_y; width = sw->scale.show_value_width; height = sw->scale.show_value_height; if (!sw->scale.show_value) { /* turn off the value display */ if (width) { /* We were displaying, so we must clear it */ XClearArea (XtDisplay (sw), XtWindow (sw), x, y, width, height, FALSE); value_rect.x = x; value_rect.y = y; value_rect.width = width; value_rect.height = height; XIntersectRegion(null_region, value_region, value_region); XUnionRectWithRegion(&value_rect, value_region, value_region); XmeRedisplayGadgets( (Widget) sw, NULL, value_region); } sw->scale.show_value_width = 0; return; } /* * Time for the real work. */ if (width) { /* Clear the old one */ value_rect.x = x; value_rect.y = y; value_rect.width = width; value_rect.height = height; XIntersectRegion(null_region, value_region, value_region); XClearArea(XtDisplay(sw), XtWindow(sw), x, y, width, height, FALSE); XUnionRectWithRegion(&value_rect, value_region, value_region); XmeRedisplayGadgets( (Widget) sw, NULL, value_region); } /* Get a string representation of the new value */ GetValueString(sw, sw->scale.value, buffer); /* Calculate the x, y, width, and height of the string to display */ #if USE_XFT XmStringExtent(sw->scale.font_list, tmp_str = XmStringCreateSimple(buffer), &width, &height); XmStringFree(tmp_str); sw->scale.show_value_width = width; sw->scale.show_value_height = height; #else XTextExtents (sw->scale.font_struct, buffer, strlen(buffer), &direction, &height, &descent, &width_return); width = width_return.rbearing - width_return.lbearing; sw->scale.show_value_width = width; sw->scale.show_value_height = height + descent; #endif scrollbar = (XmScrollBarWidget) sw->composite.children[1]; if (sw->scale.orientation == XmHORIZONTAL) { #if USE_XFT #ifdef FIX_1528 x = scrollbar->core.x + scrollbar->scrollBar.slider_x + ((sw->scale.sliding_mode)? scrollbar->scrollBar.slider_width: 0) - (width - SLIDER_SIZE( sw)) / 2; #else x = scrollbar->core.x + scrollbar->scrollBar.slider_x + scrollbar->scrollBar.slider_width / 2 - width / 2; #endif if (sw->scale.show_value == XmNEAR_BORDER) /*tmp: should store the max */ y = scrollbar->core.y - MaxLabelHeight(sw) - height - 3; else /* NEAR_SLIDER or NONE */ y = scrollbar->core.y - height - 3; #else x = scrollbar->core.x + scrollbar->scrollBar.slider_x + ((sw->scale.sliding_mode)? scrollbar->scrollBar.slider_width: 0) - (width_return.rbearing - SLIDER_SIZE( sw)) / 2; if (sw->scale.show_value == XmNEAR_BORDER) /*tmp: should store the max */ y = scrollbar->core.y - MaxLabelHeight(sw) - 3; else /* NEAR_SLIDER or NONE */ y = scrollbar->core.y - 3; #endif } else { if (sw->scale.show_value == XmNEAR_BORDER) { if (LayoutIsRtoLM(sw)) x = scrollbar->core.x + scrollbar->core.width + MaxLabelWidth(sw); else #if USE_XFT x = scrollbar->core.x - MaxLabelWidth(sw) - sw->scale.show_value_width - SCALE_VALUE_MARGIN; #else x = scrollbar->core.x - MaxLabelWidth(sw) - width_return.rbearing - SCALE_VALUE_MARGIN; #endif } else { /* NEAR_SLIDER or NONE */ if (LayoutIsRtoLM(sw)) x = scrollbar->core.x + scrollbar->core.width; else #ifdef FIX_1528 #if USE_XFT x = scrollbar->core.x - sw->scale.show_value_width - SCALE_VALUE_MARGIN; #else x = scrollbar->core.x - width_return.rbearing - SCALE_VALUE_MARGIN; #endif #else #if USE_XFT x = scrollbar->core.x - sw->scale.show_value_width; #else x = scrollbar->core.x - width_return.rbearing; #endif #endif } #if USE_XFT y = scrollbar->core.y + scrollbar->scrollBar.slider_y + SLIDER_SIZE(sw)/2 - height/2; #else y = scrollbar->core.y + scrollbar->scrollBar.slider_y + SLIDER_SIZE(sw) + ((height - SLIDER_SIZE( sw)) / 2) - 3; #endif } #if USE_XFT sw->scale.show_value_x = x; sw->scale.show_value_y = y + 1; #else sw->scale.show_value_x = x + width_return.lbearing; sw->scale.show_value_y = y - height + 1; #endif /* Display the string */ XSetClipMask(XtDisplay(sw), sw->scale.foreground_GC, None); #if USE_XFT XmStringDraw(XtDisplay(sw), XtWindow(sw), sw->scale.font_list, tmp_str = XmStringCreateSimple(buffer), sw->scale.foreground_GC, x, y, width, XmALIGNMENT_CENTER, sw->manager.string_direction, NULL); XmStringFree(tmp_str); #else XDrawImageString (XtDisplay(sw), XtWindow(sw), sw->scale.foreground_GC, x, y, buffer, strlen(buffer)); #endif } /********************************************************************* * * CalcScrollBarData * Figure out the scale derived attributes of the scrollbar child. * *********************************************************************/ static void CalcScrollBarData( XmScaleWidget sw, int *pvalue, int *pslider_size, int *pincrement, int *ppage ) { int slider_size, increment, page, value ; Dimension scrollbar_size; float sb_value, tmp; XmScrollBarWidget scrollbar = (XmScrollBarWidget) sw->composite.children[1]; register int ht = scrollbar->primitive.highlight_thickness; register int st = scrollbar->primitive.shadow_thickness; int size; /* Adjust the slider size to take SLIDER_SIZE area. */ /* Adjust value to be in the bounds of the scrollbar. */ if (scrollbar->scrollBar.orientation == XmHORIZONTAL) scrollbar_size = scrollbar->scrollBar.slider_area_width + 2 *(ht +st); else scrollbar_size = scrollbar->scrollBar.slider_area_height + 2 *(ht +st); size = scrollbar_size - 2 * (sw->scale.highlight_thickness + sw->manager.shadow_thickness) ; /* prevent divide by zero error and integer rollover */ if (size <= 0) scrollbar_size = 1; else /* this looks suspicious to me, but it is bc to let it in */ scrollbar_size -= 2 * (sw->scale.highlight_thickness + sw->manager.shadow_thickness); slider_size = (SCROLLBAR_MAX / scrollbar_size) * SLIDER_SIZE( sw); /* * Now error check our arithmetic */ if (slider_size < 0) slider_size = SCROLLBAR_MAX; else if (slider_size < 1) slider_size = 1; else if (slider_size > SCROLLBAR_MAX) slider_size = SCROLLBAR_MAX; sb_value = (float) (sw->scale.value - sw->scale.minimum) / (float) (sw->scale.maximum - sw->scale.minimum); sb_value = sb_value * (float) (SCROLLBAR_MAX - slider_size); value = (int) sb_value; ASSIGN_MIN(value, SCROLLBAR_MAX - slider_size); ASSIGN_MAX(value, 0); /* Set up the increment processing correctly */ tmp = (float) SCROLLBAR_MAX - (float) slider_size; increment = (int) ((tmp / (float) (sw->scale.maximum - sw->scale.minimum)) + 0.5); ASSIGN_MAX(increment, 1); page = sw->scale.scale_multiple * (increment); ASSIGN_MAX(page, 1); *pvalue = value ; *pslider_size = slider_size ; *pincrement = increment ; *ppage = page ; } /********************************************************************* * * SetScrollBarData * Call CalcScrollBarData and do a setvalues on the SB. * *********************************************************************/ static void SetScrollBarData( XmScaleWidget sw) { int slider_size, increment, page, value ; Arg args[5] ; Cardinal n = 0 ; XmScrollBarWidget scrollbar = (XmScrollBarWidget) sw->composite.children[1]; CalcScrollBarData(sw, &value, &slider_size, &increment, &page); SET(XmNvalue, value); SET(XmNsliderSize, slider_size); SET(XmNincrement, increment); SET(XmNpageIncrement, page); XtSetValues ((Widget)scrollbar, args, n); } /********************************************************************* * * ValueChanged * Callback procedure invoked from the scrollbars value being changed. * *********************************************************************/ /*ARGSUSED*/ static void ValueChanged( Widget wid, XtPointer closure, /* unused */ XtPointer call_data ) { XmScaleWidget sw = (XmScaleWidget) XtParent (wid); XmScrollBarCallbackStruct * scroll_callback = (XmScrollBarCallbackStruct *) call_data; XmScaleCallbackStruct scale_callback; float sb_value; XmScrollBarWidget sb = (XmScrollBarWidget)(sw->composite.children[1]); sb_value = (float) scroll_callback->value / (float) (SCROLLBAR_MAX - sb->scrollBar.slider_size); sb_value = (sb_value * (float) (sw->scale.maximum - sw->scale.minimum)) + (float) sw->scale.minimum; /* Set up the round off correctly */ if (sb_value < 0.0) sb_value -= 0.5; else if (sb_value > 0.0) sb_value += 0.5; sw->scale.value = (int) sb_value; ShowValue (sw); scale_callback.event = scroll_callback->event; scale_callback.reason = scroll_callback->reason; scale_callback.value = sw->scale.value; if (scale_callback.reason == XmCR_DRAG) XtCallCallbackList((Widget) sw, sw->scale.drag_callback, &scale_callback); else /* value changed and to_top and to_bottom */ { scale_callback.reason = XmCR_VALUE_CHANGED; XtCallCallbackList((Widget) sw, sw->scale.value_changed_callback, &scale_callback); } } /************************************************************************ * * StartDrag: * This routine is performed by the initiator when a drag starts * (in this case, when mouse button 2 was pressed). It starts * the drag processing, and establishes a drag context * ************************************************************************/ /*ARGSUSED*/ static void StartDrag (Widget w, XtPointer data, /* unused */ XEvent *event, Boolean *cont) /* unused */ { Widget drag_icon; Arg args[10]; Cardinal n; XmScaleWidget sw = (XmScaleWidget) w ; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); /* CDE - allow user to not drag labels and label subclasses also, disable drag if enable_btn1_transfer is set to BUTTON2_ADJUST and the trigger was button2 */ if (! dpy -> display.enable_unselectable_drag || (dpy -> display.enable_btn1_transfer == XmBUTTON2_ADJUST && event && event -> xany.type == ButtonPress && event -> xbutton.button == 2)) return; /* first check that the click is OK: button 2 and in the value label */ if ((!sw->scale.show_value) || (event->xbutton.button != Button2) || ((event->xbutton.x < sw->scale.show_value_x) || (event->xbutton.y < sw->scale.show_value_y) || (event->xbutton.x > sw->scale.show_value_x + sw->scale.show_value_width) || (event->xbutton.y > sw->scale.show_value_y + sw->scale.show_value_height))) return ; drag_icon = XmeGetTextualDragIcon(w); n = 0; XtSetArg(args[n], XmNcursorBackground, sw->core.background_pixel); n++; XtSetArg(args[n], XmNcursorForeground, sw->manager.foreground); n++; XtSetArg(args[n], XmNsourceCursorIcon, drag_icon); n++; XtSetArg(args[n], XmNdragOperations, XmDROP_COPY); n++ ; (void) XmeDragSource(w, NULL, event, args, n); } /************************************************************************ * * DragConvertProc: * This routine returns the value of the scale, * converted into compound text. * ************************************************************************/ /*ARGSUSED*/ static void DragConvertCallback (Widget w, XtPointer client_data, /* unused */ XmConvertCallbackStruct *cs) { enum { XmACOMPOUND_TEXT, XmATARGETS, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSTARGETS, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSUTF8_STRING }; char tmpstring[100]; char *strlist; char *passtext; XmScaleWidget sw = (XmScaleWidget) w; Atom atoms[XtNumber(atom_names)]; XTextProperty tp; Atom type = None ; XtPointer value = NULL ; unsigned long size = 0 ; int format = 8 ; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* Begin fixing the bug OSF 4846 */ /* get the value of the scale and convert it to compound text */ GetValueString(sw, sw->scale.value, tmpstring); if (cs -> target == atoms[XmATARGETS] || cs -> target == atoms[XmA_MOTIF_EXPORT_TARGETS] || cs -> target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS]) { int count = 0; Atom *targs; if (cs -> target == atoms[XmATARGETS]) targs = XmeStandardTargets(w, 3, &count); else targs = (Atom *) XtMalloc(sizeof(Atom) * 3); value = (XtPointer) targs; targs[count] = XA_STRING; count++; targs[count] = atoms[XmACOMPOUND_TEXT]; count++; targs[count] = atoms[XmAUTF8_STRING]; count++; size = count; type = XA_ATOM; format = 32; } if (cs -> target == XA_STRING || cs -> target == atoms[XmAUTF8_STRING]) { /* handle plain STRING and UTF8_STRING first */ type = cs -> target; value = (XtPointer) XtNewString(tmpstring); size = strlen((char*) value); format = 8; } /* this routine processes only compound text now */ if (cs -> target == atoms[XmACOMPOUND_TEXT]) { strlist = tmpstring; tp.value = NULL; XmbTextListToTextProperty(XtDisplay(w), &strlist, 1, XCompoundTextStyle, &tp); passtext = XtNewString((char*)tp.value); XtFree((char*)tp.value); /* End fixing the bug OSF 4846 */ /* format the value for transfer. convert the value from * compound string to compound text for the transfer */ type = atoms[XmACOMPOUND_TEXT]; value = (XtPointer) passtext; size = strlen(passtext); format = 8; } _XmConvertComplete(w, value, size, format, type, cs); } /************************************************************************ * * WidgetNavigable class method * ************************************************************************/ static XmNavigability WidgetNavigable( Widget wid) { if( XtIsSensitive(wid) && ((XmManagerWidget) wid)->manager.traversal_on ) { XmNavigationType nav_type = ((XmManagerWidget) wid)->manager.navigation_type ; if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmDESCENDANTS_TAB_NAVIGABLE ; } } return XmNOT_NAVIGABLE ; } /************************************************************************ * * External API functions. * ************************************************************************/ /************************************************************************ * * XmScaleSetValue * ************************************************************************/ void XmScaleSetValue( Widget w, int value ) { XmScaleWidget sw = (XmScaleWidget) w; XtAppContext app = XtWidgetToApplicationContext(w); _XmAppLock(app); if (value < sw->scale.minimum) { XmeWarning( (Widget) sw, MESSAGE2); _XmAppUnlock(app); return ; } if (value > sw->scale.maximum) { XmeWarning( (Widget) sw, MESSAGE3); _XmAppUnlock(app); return ; } sw->scale.value = value ; SetScrollBarData(sw); ShowValue(sw); _XmAppUnlock(app); } /************************************************************************ * * XmScaleGetValue * ************************************************************************/ void XmScaleGetValue( Widget w, int *value ) { XmScaleWidget sw = (XmScaleWidget) w; XtAppContext app = XtWidgetToApplicationContext(w); _XmAppLock(app); *value = sw->scale.value; _XmAppUnlock(app); } /************************************************************************ * * XmCreateScale * ************************************************************************/ Widget XmCreateScale( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget(name, xmScaleWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateScale( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmScaleWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedScale( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmScaleWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/MenuStateP.h0000644000175000017500000000240312672140200013104 00000000000000/* $XConsortium: MenuStateP.h /main/4 1995/07/15 20:52:59 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmMenuStateP_h #define _XmMenuStateP_h #include #include #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuStateP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Desktop.c0000644000175000017500000002136013145162623012477 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Desktop.c /main/12 1995/07/14 10:17:30 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass widgetClass) ; static void ResParentDestroyed( Widget resParent, XtPointer closure, XtPointer callData) ; static void Destroy( Widget wid) ; static void InsertChild( Widget wid) ; static void DeleteChild( Widget wid) ; static void Initialize( Widget requested_widget, Widget new_widget, ArgList args, Cardinal *num_args) ; /******** End Static Function Declarations ********/ static XtResource resources[] = { { XmNdesktopParent, XmCDesktopParent, XmRWidget, sizeof (Widget), XtOffsetOf( struct _XmDesktopRec, desktop.parent), XmRImmediate, (XtPointer)NULL, }, { XmNextensionType, XmCExtensionType, XmRExtensionType, sizeof (unsigned char), XtOffsetOf( struct _XmDesktopRec, ext.extensionType), XmRImmediate, (XtPointer)XmDESKTOP_EXTENSION, }, }; externaldef(xmdesktopclassrec) XmDesktopClassRec xmDesktopClassRec = { { (WidgetClass) &xmExtClassRec, /* superclass */ "Desktop", /* class_name */ sizeof(XmDesktopRec), /* size */ NULL, /* Class Initializer */ ClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ Initialize, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, { /* ext */ NULL, /* synthetic resources */ 0, /* num syn resources */ NULL, /* extension */ }, { /* desktop */ NULL, /* child_class */ InsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL, /* extension */ }, }; externaldef(xmdesktopclass) WidgetClass xmDesktopClass = (WidgetClass) &xmDesktopClassRec; static void ClassPartInitialize( WidgetClass widgetClass ) { register XmDesktopClassPartPtr wcPtr; register XmDesktopClassPartPtr superPtr; wcPtr = (XmDesktopClassPartPtr) &(((XmDesktopObjectClass)widgetClass)->desktop_class); if (widgetClass != xmDesktopClass) /* don't compute possible bogus pointer */ superPtr = (XmDesktopClassPartPtr)&(((XmDesktopObjectClass)widgetClass ->core_class.superclass)->desktop_class); else superPtr = NULL; /* We don't need to check for null super since we'll get to xmDesktop eventually, and it had better define them! */ if (wcPtr->child_class == XmInheritClass) { wcPtr->child_class = superPtr->child_class; } if (wcPtr->insert_child == XtInheritInsertChild) { wcPtr->insert_child = superPtr->insert_child; } if (wcPtr->delete_child == XtInheritDeleteChild) { wcPtr->delete_child = superPtr->delete_child; } } /*ARGSUSED*/ static void ResParentDestroyed( Widget resParent, XtPointer closure, XtPointer callData ) { XmExtObject me = (XmExtObject) closure ; if (!me->object.being_destroyed) { XtDestroyWidget((Widget) me); } } static void Destroy( Widget wid ) { XmDesktopObject w = (XmDesktopObject) wid ; XmDesktopObject deskObj = (XmDesktopObject)w; Widget deskParent; Widget resParent = w->ext.logicalParent; if ((deskParent = deskObj->desktop.parent) != NULL) { if (XmIsScreen(deskParent)) { XmScreenClass deskParentClass = (XmScreenClass) XtClass(deskParent); (*(deskParentClass->desktop_class.delete_child)) ((Widget) deskObj); } else { XmDesktopObjectClass deskParentClass = (XmDesktopObjectClass) XtClass(deskParent); (*(deskParentClass->desktop_class.delete_child)) ((Widget) deskObj); } } /* * if we were created as a sibling of our primary then we have a * destroy callback on them. */ if (resParent && !resParent->core.being_destroyed) XtRemoveCallback((Widget) resParent, XmNdestroyCallback, ResParentDestroyed, (XtPointer)w); XtFree((char *) w->desktop.children); } static void InsertChild( Widget wid ) { XmDesktopObject w = (XmDesktopObject) wid ; register Cardinal position; register Cardinal i; register XmDesktopObject cw; register WidgetList children; cw = (XmDesktopObject) w->desktop.parent; children = cw->desktop.children; position = cw->desktop.num_children; if (cw->desktop.num_children == cw->desktop.num_slots) { /* Allocate more space */ cw->desktop.num_slots += (cw->desktop.num_slots / 2) + 2; cw->desktop.children = children = (WidgetList) XtRealloc((char *) children, (unsigned) (cw->desktop.num_slots) * sizeof(Widget)); } /* Ripple children up one space from "position" */ for (i = cw->desktop.num_children; i > position; i--) { children[i] = children[i-1]; } children[position] = (Widget)w; cw->desktop.num_children++; } static void DeleteChild( Widget wid ) { XmDesktopObject w = (XmDesktopObject) wid ; register Cardinal position; register Cardinal i; register XmDesktopObject cw; cw = (XmDesktopObject) w->desktop.parent; for (position = 0; position < cw->desktop.num_children; position++) { if (cw->desktop.children[position] == (Widget)w) { break; } } if (position == cw->desktop.num_children) return; /* Ripple children down one space from "position" */ cw->desktop.num_children--; for (i = position; i < cw->desktop.num_children; i++) { cw->desktop.children[i] = cw->desktop.children[i+1]; } } /************************************************************************ * * DesktopInitialize * ************************************************************************/ /* ARGSUSED */ static void Initialize( Widget requested_widget, Widget new_widget, ArgList args, Cardinal *num_args ) { XmDesktopObject deskObj = (XmDesktopObject)new_widget; Widget deskParent; deskObj->desktop.num_children = 0; deskObj->desktop.children = NULL; deskObj->desktop.num_slots = 0; if ((deskParent = deskObj->desktop.parent) != NULL) { if (XmIsScreen(deskParent)) { XmScreenClass deskParentClass = (XmScreenClass) XtClass(deskParent); (*(deskParentClass->desktop_class.insert_child)) ((Widget) deskObj); } else { XmDesktopObjectClass deskParentClass = (XmDesktopObjectClass) XtClass(deskParent); (*(deskParentClass->desktop_class.insert_child)) ((Widget) deskObj); } } } motif-2.3.8/lib/Xm/TextSel.c0000644000175000017500000013443213145162623012463 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TextSel.c /main/24 1998/12/07 11:12:08 mgreess $" #endif #endif #include #include #include #include #include /* for XmeTraitSet() */ #include #include #include "TextI.h" #include "TextInI.h" #include "TextSelI.h" #include "TextStrSoI.h" #include "TransferI.h" /* for _XmConvertComplete() */ #include "TraversalI.h" #include "XmI.h" /******** Static Function Declarations ********/ static void InsertSelection( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid) ; static void HandleInsertTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid) ; static void HandleDrop(Widget w, XmDropProcCallbackStruct *cb, XmDestinationCallbackStruct *ds); static void HandleTargets(Widget w, XtPointer ignore, XmSelectionCallbackStruct *ds); static void DoStuff(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds); static void DropDestroyCB(Widget w, XtPointer clientData, XtPointer callData); static void DropTransferProc(Widget w, XtPointer ignore, XmSelectionCallbackStruct *ds); static void SetDropContext(Widget w); static void DeleteDropContext(Widget w); static void TextSecondaryWrapper(Widget, XtPointer, XmSelectionCallbackStruct *); static void TextConvertCallback(Widget, XtPointer, XmConvertCallbackStruct*); static void TextDestinationCallback(Widget, XtPointer, XmDestinationCallbackStruct*); /******** End Static Function Declarations ********/ /* Transfer Trait record for Text */ static XmConst XmTransferTraitRec TextTransfer = { 0, /* version */ (XmConvertCallbackProc) TextConvertCallback, (XmDestinationCallbackProc) TextDestinationCallback, (XmDestinationCallbackProc) NULL, }; static XContext _XmTextDNDContext = 0; static _XmTextPrimSelect *prim_select; static _XmInsertSelect insert_select; /*ARGSUSED*/ static void SetPrimarySelection(Widget w, XtEnum op, /* unused */ XmTransferDoneCallbackStruct *ts) /* unused */ { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition cursorPos = tw->text.cursor_position; _XmProcessLock(); if (!prim_select) { _XmProcessUnlock(); return; } if (prim_select->num_chars > 0) { data->anchor = prim_select->position; cursorPos = prim_select->position + prim_select->num_chars; _XmTextSetCursorPosition(w, cursorPos); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, prim_select->time); (*tw->text.source->SetSelection)(tw->text.source, data->anchor, tw->text.cursor_position, prim_select->time); } if (--prim_select->ref_count == 0) { XtFree((char *)prim_select); prim_select = NULL; } _XmProcessUnlock(); } /*ARGSUSED*/ static void CleanPrimarySelection(Widget w, XtEnum op, /* unused */ XmTransferDoneCallbackStruct *ts) /* unused */ { _XmProcessLock(); if (!prim_select) { _XmProcessUnlock(); return; } if (--prim_select->ref_count == 0) { XtFree((char *)prim_select); prim_select = NULL; } _XmProcessUnlock(); } static void TextSecondaryWrapper(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds) { Atom XA_TARGETS = XInternAtom(XtDisplay(w), XmSTARGETS, False); if (ds -> target == XA_TARGETS) HandleInsertTargets(w, closure, &(ds -> selection), &(ds -> type), ds -> value, &(ds -> length), &(ds -> format), ds -> transfer_id); else InsertSelection(w, closure, &(ds -> selection), &(ds -> type), ds -> value, &(ds -> length), &(ds -> format), ds -> transfer_id); } /* ARGSUSED */ static void InsertSelection( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid) { _XmInsertSelect *insert_select = (_XmInsertSelect *)closure; XmTextWidget tw = (XmTextWidget) w; XmTextPosition left = 0; XmTextPosition right = 0; Boolean dest_disjoint = False; Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), XmSCOMPOUND_TEXT, False); #ifdef UTF8_SUPPORTED Atom UTF8_STRING = XInternAtom(XtDisplay(w), XmSUTF8_STRING, False); #endif char * total_value = NULL; XmTextBlockRec block, newblock; XmTextPosition cursorPos; Boolean freeBlock; if (!value) { insert_select->done_status = True; return; } /* Don't do replace if there is no text to add */ if (*(char *)value == '\0' || *length == 0){ XtFree((char*)value); value = NULL; insert_select->done_status = True; return; } if (insert_select->select_type == XmPRIM_SELECT) { if (!(*tw->text.source->GetSelection)(tw->text.source, &left, &right) || left == right) { XBell(XtDisplay(w), 0); XtFree((char*)value); value = NULL; insert_select->done_status = True; insert_select->success_status = False; return; } } else if (insert_select->select_type == XmDEST_SELECT) { if ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && left != right) { if (tw->text.cursor_position < left || tw->text.cursor_position > right || !tw->text.input->data->pendingdelete) { left = right = tw->text.cursor_position; dest_disjoint = True; } } else left = right = tw->text.cursor_position; } (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); block.format = XmFMT_8_BIT; if (*type == COMPOUND_TEXT || *type == XA_STRING #ifdef UTF8_SUPPORTED || *type == UTF8_STRING #endif ) { if ((total_value = _XmTextToLocaleText(w, value, *type, *format, *length, NULL)) != NULL) { block.ptr = total_value; block.length = strlen(block.ptr); } else { insert_select->done_status = True; insert_select->success_status = False; (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); return; } } else { /* it must be either CS_OF_ENCODING or TEXT */ block.ptr = (char*)value; /* NOTE: casting *length could result in a truncated long. */ block.length = (unsigned) *length; block.format = XmFMT_8_BIT; } if (_XmTextModifyVerify(tw, (XEvent *)insert_select->event, &left, &right, &cursorPos, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, (XEvent *)insert_select->event, &left, &right, &newblock, False) != EditDone) { if (tw->text.verify_bell) XBell(XtDisplay(w), 0); insert_select->success_status = False; } else { insert_select->success_status = True; if (!tw->text.add_mode) tw->text.input->data->anchor = left; if (tw->text.add_mode && cursorPos >= left && cursorPos <= right) tw->text.pendingoff = FALSE; else tw->text.pendingoff = TRUE; _XmTextSetCursorPosition(w, cursorPos); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, insert_select->event->time); if (insert_select->select_type == XmDEST_SELECT) { if (left != right) { if (!dest_disjoint || !tw->text.add_mode) { (*tw->text.source->SetSelection)(tw->text.source, tw->text.cursor_position, tw->text.cursor_position, insert_select->event->time); } } } _XmTextValueChanged(tw, (XEvent *)insert_select->event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); if (total_value) XtFree(total_value); XtFree((char*)value); value = NULL; insert_select->done_status = True; } /* ARGSUSED */ static void HandleInsertTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid ) { enum { XmATEXT, XmACOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSTEXT, XmSCOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; _XmInsertSelect *insert_select = (_XmInsertSelect *) closure; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); Atom target; Atom *atom_ptr; Boolean supports_encoding_data = False; Boolean supports_CT = False; Boolean supports_text = False; Boolean supports_utf8_string = False; int i; if (0 == *length) { XtFree((char *)value); insert_select->done_status = True; return; /* Supports no targets, so don't bother sending anything */ } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); atom_ptr = (Atom *)value; for (i = 0; i < *length; i++, atom_ptr++) { if (*atom_ptr == atoms[XmATEXT]) supports_text = True; if (*atom_ptr == CS_OF_ENCODING) supports_encoding_data = True; if (*atom_ptr == atoms[XmACOMPOUND_TEXT]) supports_CT = True; #ifdef UTF8_SUPPORTED if (*atom_ptr == atoms[XmAUTF8_STRING]) supports_utf8_string = True; #endif } if (supports_text && supports_encoding_data) target = atoms[XmATEXT]; #ifdef UTF8_SUPPORTED else if (supports_utf8_string) target = atoms[XmAUTF8_STRING]; #endif else if (supports_CT) target = atoms[XmACOMPOUND_TEXT]; else if (supports_encoding_data) target = CS_OF_ENCODING; else target = XA_STRING; XmTransferValue(tid, target, (XtCallbackProc) TextSecondaryWrapper, closure, insert_select -> event -> time); } /* ARGSUSED */ Boolean _XmTextConvert( Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format, Widget drag_context, XEvent *event ) { enum { XmA_MOTIF_DESTINATION, XmAINSERT_SELECTION, XmADELETE, XmATARGETS, XmATEXT, XmACOMPOUND_TEXT, XmATIMESTAMP, XmA_MOTIF_DROP, XmACLIPBOARD, XmANULL, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DESTINATION, XmSINSERT_SELECTION, XmSDELETE, XmSTARGETS, XmSTEXT, XmSCOMPOUND_TEXT, XmSTIMESTAMP, XmS_MOTIF_DROP, XmSCLIPBOARD, XmSNULL, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; XmTextWidget tw = (XmTextWidget) w; XmTextSource source; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING; XSelectionRequestEvent * req_event = (XSelectionRequestEvent *) event; Boolean has_selection = False; XmTextPosition left = 0; XmTextPosition right = 0; Boolean is_primary; Boolean is_secondary; Boolean is_destination; Boolean is_drop; int target_count = 0; XTextProperty tmp_prop; int status = 0; char * tmp_value; Time _time; if (w == NULL) return False; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); CS_OF_ENCODING = XmeGetEncodingAtom(w); if (req_event == NULL) _time = XtLastTimestampProcessed(XtDisplay(w)); else _time = req_event -> time; source = tw->text.source; if (*selection == XA_PRIMARY || *selection == atoms[XmACLIPBOARD]) { has_selection = (*tw->text.source->GetSelection)(source, &left, &right); is_primary = True; is_secondary = is_destination = is_drop = False; } else if (*selection == atoms[XmA_MOTIF_DESTINATION]) { has_selection = tw->text.input->data->has_destination; is_destination = True; is_secondary = is_primary = is_drop = False; } else if (*selection == XA_SECONDARY) { has_selection = _XmTextGetSel2(tw, &left, &right); is_secondary = True; is_destination = is_primary = is_drop = False; } else if (*selection == atoms[XmA_MOTIF_DROP]) { has_selection = (*tw->text.source->GetSelection)(source, &left, &right); is_drop = True; is_destination = is_primary = is_secondary = False; } else return False; /* * TARGETS identifies what targets the text widget can * provide data for. */ if (*target == atoms[XmATARGETS]) { Atom *targs = XmeStandardTargets(w, 10, &target_count); *value = (XtPointer) targs; if (XA_STRING != CS_OF_ENCODING) { targs[target_count] = CS_OF_ENCODING; target_count++; } if (is_primary || is_destination) { targs[target_count] = atoms[XmAINSERT_SELECTION]; target_count++; } if (is_primary || is_secondary || is_drop) { targs[target_count] = atoms[XmACOMPOUND_TEXT]; target_count++; targs[target_count] = atoms[XmATEXT]; target_count++; targs[target_count] = XA_STRING; target_count++; #ifdef UTF8_SUPPORTED targs[target_count] = atoms[XmAUTF8_STRING]; target_count++; #endif } if (is_primary || is_drop) { targs[target_count] = atoms[XmADELETE]; target_count++; } *type = XA_ATOM; *length = target_count; *format = 32; } else if (*target == atoms[XmATIMESTAMP]) { Time *timestamp; timestamp = (Time *) XtMalloc(sizeof(Time)); if (is_primary) *timestamp = source->data->prim_time; else if (is_destination) *timestamp = tw->text.input->data->dest_time; else if (is_secondary) *timestamp = tw->text.input->data->sec_time; else if (is_drop) *timestamp = tw->text.input->data->sec_time; *value = (XtPointer) timestamp; *type = XA_INTEGER; *length = sizeof(Time) / 4; *format = 32; } else if (*target == XA_STRING) { /* Provide data for XA_STRING requests */ *type = (Atom) XA_STRING; *format = 8; if (is_destination || !has_selection) return False; tmp_prop.value = NULL; tmp_value = _XmStringSourceGetString(tw, left, right, False); status = XmbTextListToTextProperty(XtDisplay(tw), &tmp_value, 1, (XICCEncodingStyle)XStringStyle, &tmp_prop); XtFree(tmp_value); if (status == Success || status > 0){ /* NOTE: casting tmp_prop.nitems could result in a truncated long. */ if (0 >= tmp_prop.nitems) *value = (XtPointer) XtMalloc(1); else *value = (XtPointer) XtMalloc((unsigned)tmp_prop.nitems); memcpy((void*)*value, (void*)tmp_prop.value,(size_t)tmp_prop.nitems); if (tmp_prop.value != NULL) XFree((char*)tmp_prop.value); *length = tmp_prop.nitems; } else { *value = NULL; *length = 0; return False; } } else if (*target == atoms[XmATEXT] || *target == CS_OF_ENCODING) { *type = CS_OF_ENCODING; *format = 8; if (is_destination || !has_selection) return False; *value = (XtPointer)_XmStringSourceGetString(tw, left, right, False); *length = strlen((char*) *value); } else if (*target == atoms[XmACOMPOUND_TEXT]) { *type = atoms[XmACOMPOUND_TEXT]; *format = 8; if (is_destination || !has_selection) return False; tmp_prop.value = NULL; tmp_value =_XmStringSourceGetString(tw, left, right, False); status = XmbTextListToTextProperty(XtDisplay(tw), &tmp_value, 1, (XICCEncodingStyle)XCompoundTextStyle, &tmp_prop); XtFree(tmp_value); if (status == Success || status > 0) { /* NOTE: casting tmp_prop.nitems could result in a truncated long. */ *value = (XtPointer) XtMalloc((unsigned) tmp_prop.nitems); memcpy((void*)*value, (void*)tmp_prop.value,(size_t)tmp_prop.nitems); if (tmp_prop.value != NULL) XFree((char*)tmp_prop.value); *length = tmp_prop.nitems; } else { *value = NULL; *length = 0; return False; } #ifdef UTF8_SUPPORTED } else if (*target == atoms[XmAUTF8_STRING]) { *type = atoms[XmAUTF8_STRING]; *format = 8; if (is_destination || !has_selection) return False; tmp_prop.value = NULL; tmp_value =_XmStringSourceGetString(tw, left, right, False); status = XmbTextListToTextProperty(XtDisplay(tw), &tmp_value, 1, (XICCEncodingStyle)XUTF8StringStyle, &tmp_prop); XtFree(tmp_value); if (status == Success || status > 0) { /* NOTE: casting tmp_prop.nitems could result in a truncated long. */ *value = (XtPointer) XtMalloc((unsigned) tmp_prop.nitems); memcpy((void*)*value, (void*)tmp_prop.value,(size_t)tmp_prop.nitems); if (tmp_prop.value != NULL) XFree((char*)tmp_prop.value); *length = tmp_prop.nitems; } else { *value = NULL; *length = 0; return False; } #endif } else if (*target == atoms[XmAINSERT_SELECTION]) { if (is_secondary) return False; else return True; /* Delete the selection */ } else if (*target == atoms[XmADELETE]) { XmTextBlockRec block, newblock; XmTextPosition cursorPos; Boolean freeBlock; if (!(is_primary || is_drop)) return False; /* The on_or_off flag is set to prevent unecessary cursor shifting during the Replace operation */ tw->text.on_or_off = off; block.ptr = ""; block.length = 0; block.format = XmFMT_8_BIT; if (_XmTextModifyVerify(tw, event, &left, &right, &cursorPos, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, event, &left, &right, &newblock, False) != EditDone) { if (freeBlock && newblock.ptr) XtFree(newblock.ptr); return False; } else { if (is_drop) { if (_XmTextGetDropReciever((Widget)tw) != (Widget) tw) _XmTextSetCursorPosition((Widget)tw, cursorPos); } else { if ((*selection == atoms[XmACLIPBOARD]) || (req_event != NULL && req_event->requestor != XtWindow((Widget) tw))) _XmTextSetCursorPosition(w, cursorPos); } _XmTextValueChanged(tw, (XEvent *) req_event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } if (!tw->text.input->data->has_destination) tw->text.input->data->anchor = tw->text.cursor_position; (*tw->text.source->SetSelection)(tw->text.source, tw->text.cursor_position, tw->text.cursor_position, _time); *type = atoms[XmANULL]; *value = NULL; *length = 0; *format = 8; tw->text.on_or_off = on; /* unknown selection type */ } else return FALSE; return TRUE; } /* ARGSUSED */ void _XmTextLoseSelection( Widget w, Atom *selection ) { XmTextWidget tw = (XmTextWidget) w; XmTextSource source = tw->text.source; Atom MOTIF_DESTINATION = XInternAtom(XtDisplay(w), XmS_MOTIF_DESTINATION, False); /* Losing Primary Selection */ if (*selection == XA_PRIMARY && _XmStringSourceHasSelection(source)) { XmAnyCallbackStruct cb; (*source->SetSelection)(source, 1, -999, XtLastTimestampProcessed(XtDisplay(w))); cb.reason = XmCR_LOSE_PRIMARY; cb.event = NULL; XtCallCallbackList(w, tw->text.lose_primary_callback, (XtPointer) &cb); /* Losing Destination Selection */ } else if (*selection == MOTIF_DESTINATION) { tw->text.input->data->has_destination = False; (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); tw->text.output->data->blinkstate = on; (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); /* Losing Secondary Selection */ } else if (*selection == XA_SECONDARY && tw->text.input->data->hasSel2){ _XmTextSetSel2(tw, 1, -999, XtLastTimestampProcessed(XtDisplay(w))); } } static void HandleDrop(Widget w, XmDropProcCallbackStruct *cb, XmDestinationCallbackStruct *ds) { Widget drag_cont, initiator; XmTextWidget tw = (XmTextWidget) w; Cardinal numExportTargets, n; Atom *exportTargets; Atom desiredTarget = None; Arg args[10]; XmTextPosition insert_pos, left, right; Boolean doTransfer = False; XtPointer tid = ds->transfer_id; _XmTextDropTransferRec *transfer_rec = NULL; drag_cont = cb->dragContext; n = 0; XtSetArg(args[n], XmNsourceWidget, &initiator); n++; XtSetArg(args[n], XmNexportTargets, &exportTargets); n++; XtSetArg(args[n], XmNnumExportTargets, &numExportTargets); n++; XtGetValues((Widget) drag_cont, args, n); insert_pos = (*tw->text.output->XYToPos)(tw, cb->x, cb->y); if (cb->operation & XmDROP_MOVE && w == initiator && ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && left != right && insert_pos >= left && insert_pos <= right)) { XmTransferDone(tid, XmTRANSFER_DONE_FAIL); } else { enum { XmATEXT, XmACOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSTEXT, XmSCOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); Boolean encoding_found = False; Boolean c_text_found = False; Boolean string_found = False; Boolean text_found = False; Boolean utf8_string_found = False; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* intialize data to send to drop transfer callback */ transfer_rec = (_XmTextDropTransferRec *) XtMalloc(sizeof(_XmTextDropTransferRec)); transfer_rec->widget = w; transfer_rec->insert_pos = insert_pos; transfer_rec->num_chars = 0; transfer_rec->timestamp = cb->timeStamp; if (cb->operation & XmDROP_MOVE) { transfer_rec->move = True; } else { transfer_rec->move = False; } for (n = 0; n < numExportTargets; n++) { if (exportTargets[n] == CS_OF_ENCODING) { desiredTarget = CS_OF_ENCODING; encoding_found = True; break; } #ifdef UTF8_SUPPORTED if (exportTargets[n] == atoms[XmAUTF8_STRING]) utf8_string_found = True; #endif if (exportTargets[n] == atoms[XmACOMPOUND_TEXT]) c_text_found = True; if (exportTargets[n] == XA_STRING) string_found = True; if (exportTargets[n] == atoms[XmATEXT]) text_found = True; } n = 0; if (encoding_found || c_text_found || string_found || text_found || utf8_string_found) { if (!encoding_found) { if (c_text_found) desiredTarget = atoms[XmACOMPOUND_TEXT]; #ifdef UTF8_SUPPORTED else if (utf8_string_found) desiredTarget = atoms[XmAUTF8_STRING]; #endif else if (string_found) desiredTarget = XA_STRING; else desiredTarget = atoms[XmATEXT]; } if (cb->operation & XmDROP_MOVE || cb->operation & XmDROP_COPY) { doTransfer = True; } else { XmTransferDone(tid, XmTRANSFER_DONE_FAIL); } } else { XmTransferDone(tid, XmTRANSFER_DONE_FAIL); } } SetDropContext(w); if (doTransfer) { XmeTransferAddDoneProc(tid, (XmSelectionFinishedProc) DropDestroyCB); XmTransferValue(tid, desiredTarget, (XtCallbackProc) DropTransferProc, (XtPointer) transfer_rec, 0); } } /* Request targets from selection receiver; move the rest of this * to a new routine (the name of which is passed during the request * for targets). The new routine will look at the target list and * determine what target to place in the pair. It will then do * any necessary conversions before "thrusting" the selection value * onto the receiver. This will guarantee the best chance at a * successful exchange. */ static void HandleTargets(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds) { enum { XmACOMPOUND_TEXT, XmACLIPBOARD, XmATEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSCLIPBOARD, XmSTEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; XmTextWidget tw = (XmTextWidget) w; Atom CS_OF_ENCODING; Atom atoms[XtNumber(atom_names)]; Boolean supports_encoding_data = False; Boolean supports_CT = False; Boolean supports_text = False; Boolean supports_utf8_string = False; Atom *atom_ptr; XPoint *point = (XPoint *)closure; Atom targets[2]; XmTextPosition select_pos; XmTextPosition left, right; int i; if (!ds->length) { XtFree((char *)ds->value); ds->value = NULL; return; } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); CS_OF_ENCODING = XmeGetEncodingAtom(w); atom_ptr = (Atom *)ds->value; for (i = 0; i < ds->length; i++, atom_ptr++) { if (*atom_ptr == atoms[XmATEXT]) supports_text = True; if (*atom_ptr == CS_OF_ENCODING) supports_encoding_data = True; if (*atom_ptr == atoms[XmACOMPOUND_TEXT]) supports_CT = True; #ifdef UTF8_SUPPORTED if (*atom_ptr == atoms[XmAUTF8_STRING]) supports_utf8_string = True; #endif } /* * Set stuff position to the x and y position of * the button pressed event for primary pastes. */ if (ds->selection != atoms[XmACLIPBOARD] && point) { select_pos = (*tw->text.output->XYToPos)(tw, (Position)point->x, (Position)point->y); } else { select_pos = tw->text.cursor_position; } if (ds->selection != atoms[XmACLIPBOARD]) { if ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && left != right && select_pos > left && select_pos < right) { XtFree((char *)ds->value); ds->value = NULL; return; } } _XmProcessLock(); if (prim_select) { prim_select->ref_count++; } else { prim_select = (_XmTextPrimSelect *) XtMalloc((unsigned) sizeof(_XmTextPrimSelect)); } prim_select->position = select_pos; prim_select->time = XtLastTimestampProcessed(XtDisplay(w)); prim_select->num_chars = 0; /* If owner supports TEXT and the current locale, ask for TEXT. * If not, and if the owner supports compound text, ask for * compound text. If not, and owner and I have the same encoding, * ask for that encoding. If not, fall back position is to ask for * STRING and try to convert it locally. */ if (supports_text && supports_encoding_data) prim_select->target = targets[0] = atoms[XmATEXT]; #ifdef UTF8_SUPPORTED else if (supports_utf8_string) prim_select->target = targets[0] = atoms[XmAUTF8_STRING]; #endif else if (supports_CT) prim_select->target = targets[0] = atoms[XmACOMPOUND_TEXT]; else if (supports_encoding_data) prim_select->target = targets[0] = CS_OF_ENCODING; else prim_select->target = targets[0] = XA_STRING; prim_select->ref_count = 1; /* Make request to call DoStuff() with the primary selection. */ XmTransferValue(ds->transfer_id, targets[0], (XtCallbackProc) DoStuff, (XtPointer) prim_select, prim_select->time); _XmProcessUnlock(); XtFree((char *)ds->value); ds->value = NULL; } /* Pastes the primary selection to the stuff position. */ static void DoStuff(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds) { enum { XmANULL, XmACLIPBOARD, XmATEXT, XmACOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSNULL, XmSCLIPBOARD, XmSTEXT, XmSCOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; OutputData o_data = tw->text.output->data; Atom atoms[XtNumber(atom_names)]; XmTextBlockRec block, newblock; XmTextPosition cursorPos = tw->text.cursor_position; XmTextPosition right, left, replace_from, replace_to; _XmTextPrimSelect *prim_select = (_XmTextPrimSelect *) closure; char * total_value = NULL; Boolean freeBlock; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); if (!o_data->hasfocus && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); if (ds->selection != atoms[XmACLIPBOARD] && !(ds->length) && ds->type != atoms[XmANULL]) { /* Backwards compatibility for 1.0 Selections */ _XmProcessLock(); if (prim_select->target == atoms[XmATEXT]) { prim_select->target = XA_STRING; XmTransferValue(ds->transfer_id, XA_STRING, (XtCallbackProc) DoStuff, (XtPointer) prim_select, prim_select->time); } _XmProcessUnlock(); XtFree((char *)ds->value); ds->value = NULL; return; } /* if length == 0 and ds->type is the NULL atom we are assuming * that a DELETE target is requested. */ if (ds->type == atoms[XmANULL]) { _XmProcessLock(); if (prim_select->num_chars > 0 && data->selectionMove) { data->anchor = prim_select->position; cursorPos = prim_select->position + prim_select->num_chars; _XmTextSetCursorPosition(w, cursorPos); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, prim_select->time); (*tw->text.source->SetSelection)(tw->text.source, data->anchor, tw->text.cursor_position, prim_select->time); } _XmProcessUnlock(); } else { XmTextSource source = GetSrc(w); int max_length = 0; Boolean local = _XmStringSourceHasSelection(source); Boolean *pendingoff = NULL; Boolean dest_disjoint = True; block.format = XmFMT_8_BIT; if (ds->type == atoms[XmACOMPOUND_TEXT] || #ifdef UTF8_SUPPORTED ds->type == atoms[XmAUTF8_STRING] || #endif ds->type == XA_STRING) { if ((total_value = _XmTextToLocaleText(w, ds->value, ds->type, ds->format, ds->length, NULL)) != NULL) { block.ptr = total_value; block.length = strlen(block.ptr); } else { block.ptr = total_value = XtMalloc((unsigned)1); *(block.ptr) = '\0'; block.length = 0; } } else { block.ptr = (char*)ds->value; block.length = (int) ds->length; /* NOTE: this causes a truncation on some architectures */ } if (data->selectionMove && local) { max_length = _XmStringSourceGetMaxLength(source); _XmStringSourceSetMaxLength(source, INT_MAX); } replace_from = replace_to = prim_select->position; pendingoff = _XmStringSourceGetPending(tw); if (ds->selection == atoms[XmACLIPBOARD]) { if ((*tw->text.source->GetSelection)(tw->text.source, &left, &right)) { if (tw->text.input->data->pendingdelete && replace_from >= left && replace_to <= right){ replace_from = left; replace_to = right; dest_disjoint = False; } } } else { /* The on_or_off flag is set to prevent unnecessary cursor shifting during the Replace operation */ tw->text.on_or_off = off; _XmStringSourceSetPending(tw, (Boolean *)FALSE); } if (_XmTextModifyVerify(tw, ds->event, &replace_from, &replace_to, &cursorPos, &block, &newblock, &freeBlock)) { _XmProcessLock(); prim_select->num_chars = _XmTextCountCharacters(newblock.ptr, newblock.length); _XmProcessUnlock(); if ((*tw->text.source->Replace)(tw, ds->event, &replace_from, &replace_to, &newblock, False) != EditDone) { XtCallActionProc(w, "beep", NULL, (String *) NULL, (Cardinal) 0); _XmProcessLock(); prim_select->num_chars = 0; /* Stop SetPrimarySelection from doing anything */ _XmProcessUnlock(); _XmStringSourceSetPending(tw, pendingoff); } else { if ((newblock.length > 0 && !data->selectionMove) || ds->selection == atoms[XmACLIPBOARD]) { _XmTextSetCursorPosition(w, cursorPos); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, prim_select->time); } if ((*tw->text.source->GetSelection)(tw->text.source, &left, &right)) { if (ds->selection == atoms[XmACLIPBOARD]) { data->anchor = replace_from; if (left != right && (!dest_disjoint || !tw->text.add_mode)) (*source->SetSelection)(source, tw->text.cursor_position, tw->text.cursor_position, prim_select->time); } else { if (data->selectionMove) { _XmProcessLock(); if (left < replace_from) { prim_select->position = replace_from - prim_select->num_chars; } else { prim_select->position = replace_from; } _XmProcessUnlock(); } if (cursorPos < left || cursorPos > right) _XmStringSourceSetPending(tw, (Boolean *)TRUE); else _XmStringSourceSetPending(tw, pendingoff); } } else { _XmProcessLock(); if (ds->selection == atoms[XmACLIPBOARD]) data->anchor = replace_from; else if (!data->selectionMove && !tw->text.add_mode && prim_select->num_chars != 0) data->anchor = prim_select->position; _XmProcessUnlock(); } _XmTextValueChanged(tw, ds->event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { XtCallActionProc(w, "beep", NULL, (String *) NULL, (Cardinal) 0); _XmProcessLock(); prim_select->num_chars = 0; /* Stop SetPrimarySelection from doing anything */ _XmProcessUnlock(); _XmStringSourceSetPending(tw, pendingoff); } if (data->selectionMove && local) { _XmStringSourceSetMaxLength(source, max_length); } if (ds->selection != atoms[XmACLIPBOARD]) tw->text.on_or_off = on; if (pendingoff) XtFree((char *)pendingoff); } if (total_value) XtFree(total_value); XtFree((char *)ds->value); ds->value = NULL; } /* ARGSUSED */ static void DropDestroyCB(Widget w, XtPointer clientData, XtPointer callData) { XmTransferDoneCallbackStruct *ts = (XmTransferDoneCallbackStruct *)callData; DeleteDropContext(w); if (ts->client_data != NULL) XtFree((char*) ts->client_data); } /* ARGSUSED */ static void DropTransferProc(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds) { enum { XmACOMPOUND_TEXT, XmANULL, XmADELETE, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSNULL, XmSDELETE, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; _XmTextDropTransferRec *transfer_rec = (_XmTextDropTransferRec *) closure; XmTextWidget tw = (XmTextWidget) transfer_rec->widget; InputData data = tw->text.input->data; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); XmTextPosition insertPosLeft, insertPosRight, left, right, cursorPos; XmTextBlockRec block, newblock; XmTextSource source = GetSrc((Widget)tw); int max_length = 0; Boolean local = _XmStringSourceHasSelection(source); char * total_value = NULL; Boolean pendingoff; Boolean freeBlock; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* When type = NULL, we are assuming a DELETE request has been requested */ if (ds->type == atoms[XmANULL]) { if (transfer_rec->num_chars > 0 && transfer_rec->move) { data->anchor = transfer_rec->insert_pos; cursorPos = transfer_rec->insert_pos + transfer_rec->num_chars; _XmTextSetCursorPosition((Widget)tw, cursorPos); _XmTextSetDestinationSelection((Widget)tw, tw->text.cursor_position, False, XtLastTimestampProcessed(XtDisplay(w))); (*tw->text.source->SetSelection)(tw->text.source, data->anchor, tw->text.cursor_position, XtLastTimestampProcessed(XtDisplay(w))); if (ds->value) { XtFree((char *) ds->value); ds->value = NULL; } return; } } if (!ds->value || (ds->type != atoms[XmACOMPOUND_TEXT] && #ifdef UTF8_SUPPORTED ds->type != atoms[XmAUTF8_STRING] && #endif ds->type != CS_OF_ENCODING && ds->type != XA_STRING)) { XmTransferDone(ds->transfer_id, XmTRANSFER_DONE_FAIL); if (ds->value) { XtFree((char*) ds->value); ds->value = NULL; } return; } insertPosLeft = insertPosRight = transfer_rec->insert_pos; if (ds->type == XA_STRING || ds->type == atoms[XmACOMPOUND_TEXT] #ifdef UTF8_SUPPORTED || ds->type == atoms[XmAUTF8_STRING] #endif ) { if ((total_value = _XmTextToLocaleText(w, ds->value, ds->type, 8, ds->length, NULL)) != NULL) { block.ptr = total_value; block.length = strlen(block.ptr); } else { if (ds->value) { XtFree((char*) ds->value); ds->value = NULL; } return; } } else { block.ptr = (char *) ds->value; block.length = (int) ds->length; /* NOTE: this causes a truncation on some architectures */ } block.format = XmFMT_8_BIT; if (data->pendingdelete && (*tw->text.source->GetSelection)(tw->text.source, &left, &right) && (left != right)){ if(insertPosLeft > left && insertPosLeft < right) insertPosLeft = left; if(insertPosRight < right && insertPosRight > left) insertPosRight = right; } if (transfer_rec->move && local) { max_length = _XmStringSourceGetMaxLength(source); _XmStringSourceSetMaxLength(source, INT_MAX); } /* The on_or_off flag is set to prevent unecessary cursor shifting during the Replace operation */ tw->text.on_or_off = off; pendingoff = tw->text.pendingoff; tw->text.pendingoff = FALSE; if (_XmTextModifyVerify(tw, ds->event, &insertPosLeft, &insertPosRight, &cursorPos, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, ds->event, &insertPosLeft, &insertPosRight, &newblock, False) != EditDone) { if (tw->text.verify_bell) XBell(XtDisplay(tw), 0); tw->text.pendingoff = pendingoff; } else { transfer_rec->num_chars = _XmTextCountCharacters(newblock.ptr, newblock.length); if (transfer_rec->num_chars > 0 && !transfer_rec->move) { _XmTextSetCursorPosition((Widget)tw, cursorPos); _XmTextSetDestinationSelection((Widget)tw, tw->text.cursor_position,False, transfer_rec->timestamp); } if ((*tw->text.source->GetSelection)(tw->text.source, &left, &right)) { if (transfer_rec->move && left < insertPosLeft) transfer_rec->insert_pos = insertPosLeft - transfer_rec->num_chars; if (cursorPos < left || cursorPos > right) tw->text.pendingoff = TRUE; } else { if (!transfer_rec->move && !tw->text.add_mode && transfer_rec->num_chars != 0) data->anchor = insertPosLeft; } if (transfer_rec->move) { XmTransferValue(ds->transfer_id, atoms[XmADELETE], (XtCallbackProc) DropTransferProc, (XtPointer) transfer_rec, 0); } if (transfer_rec->move && local) { _XmStringSourceSetMaxLength(source, max_length); } _XmTextValueChanged(tw, (XEvent *) ds->event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { if (tw->text.verify_bell) XBell(XtDisplay(tw), 0); tw->text.pendingoff = pendingoff; } tw->text.on_or_off = on; if (total_value) XtFree(total_value); if (ds->value != NULL) XtFree((char*) ds->value); ds->value = NULL; } static void SetDropContext(Widget w) { Display *display = XtDisplay(w); Screen *screen = XtScreen(w); XContext loc_context; _XmProcessLock(); if (_XmTextDNDContext == 0) _XmTextDNDContext = XUniqueContext(); loc_context = _XmTextDNDContext; _XmProcessUnlock(); XSaveContext(display, (Window)screen, loc_context, (XPointer)w); } static void DeleteDropContext(Widget w) { Display *display = XtDisplay(w); Screen *screen = XtScreen(w); _XmProcessLock(); XDeleteContext(display, (Window)screen, _XmTextDNDContext); _XmProcessUnlock(); } Widget _XmTextGetDropReciever(Widget w) { Display *display = XtDisplay(w); Screen *screen = XtScreen(w); Widget widget; XContext loc_context; _XmProcessLock(); loc_context = _XmTextDNDContext; _XmProcessUnlock(); if (loc_context == 0) return NULL; if (!XFindContext(display, (Window)screen, loc_context, (char **) &widget)) { return widget; } return NULL; } /******************************************** * Transfer trait method implementation ********************************************/ /*ARGSUSED*/ static void TextConvertCallback(Widget w, XtPointer ignore, /* unused */ XmConvertCallbackStruct *cs) { enum { XmADELETE, XmA_MOTIF_LOSE_SELECTION, XmA_MOTIF_EXPORT_TARGETS, XmATEXT, XmACOMPOUND_TEXT, XmATARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmACLIPBOARD, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSDELETE, XmS_MOTIF_LOSE_SELECTION, XmS_MOTIF_EXPORT_TARGETS, XmSTEXT, XmSCOMPOUND_TEXT, XmSTARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSCLIPBOARD, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; Atom XA_CS_OF_ENCODING = XmeGetEncodingAtom(w); XtPointer value; Atom type; unsigned long size; int format; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); value = NULL; if (cs->target == atoms[XmA_MOTIF_LOSE_SELECTION]) { _XmTextLoseSelection(w, &(cs->selection)); cs->status = XmCONVERT_DONE; return; } if (cs->target == atoms[XmADELETE] && cs->selection == XA_SECONDARY) { _XmTextHandleSecondaryFinished(w, cs->event); cs->status = XmCONVERT_DONE; return; } /* When this is called as a result of a clipboard copy link, we don't have any available targets. Make sure to return immediately without modification */ if (cs->selection == atoms[XmACLIPBOARD] && cs->parm == (XtPointer) XmLINK && (cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS] || cs->target == atoms[XmATARGETS])) return; if (!_XmTextConvert(w, &cs->selection, &cs->target, &type, &value, &size, &format, (Widget) cs->source_data, cs->event)) { value = NULL; type = XA_INTEGER; size = 0; format = 8; } if (cs->target == atoms[XmADELETE]) { cs->status = XmCONVERT_DONE; cs->type = type; cs->value = value; cs->length = size; cs->format = format; return; } if (cs->target == atoms[XmA_MOTIF_EXPORT_TARGETS] || cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS]) { Atom *targs = (Atom *) XtMalloc(sizeof(Atom) * 5); int n = 0; value = (XtPointer) targs; #ifdef UTF8_SUPPORTED targs[n] = atoms[XmAUTF8_STRING]; n++; #endif targs[n] = atoms[XmACOMPOUND_TEXT]; n++; targs[n] = atoms[XmATEXT]; n++; targs[n] = XA_STRING; n++; if (XA_CS_OF_ENCODING != XA_STRING) { targs[n] = XA_CS_OF_ENCODING; n++; } format = 32; size = n; type = XA_ATOM; } _XmConvertComplete(w, value, size, format, type, cs); } /************************************************ * Free data allocated for destination callback ************************************************/ /*ARGSUSED*/ static void FreeLocationData(Widget w, /* unused */ XtEnum op, /* unused */ XmTransferDoneCallbackStruct *ts) { XmDestinationCallbackStruct *ds; ds = _XmTransferGetDestinationCBStruct(ts->transfer_id); XtFree((char*) ds->location_data); ds->location_data = NULL; } /*ARGSUSED*/ static void TextDestinationCallback(Widget w, XtPointer closure, /* unused */ XmDestinationCallbackStruct *ds) { enum { XmATARGETS, XmA_MOTIF_DROP, NUM_ATOMS }; static char *atom_names[] = { XmSTARGETS, XmS_MOTIF_DROP }; Atom atoms[XtNumber(atom_names)]; XPoint DropPoint; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* ** In case of a primary transfer operation where a location_data ** has been allocated, register a done proc to be called when ** the data transfer is complete to free the location_data */ if (ds->selection == XA_PRIMARY && ds->location_data) XmeTransferAddDoneProc(ds->transfer_id, FreeLocationData); /* If we aren't sensitive, don't allow transfer */ if (! w -> core.sensitive || ! w -> core.ancestor_sensitive) XmTransferDone(ds -> transfer_id, XmTRANSFER_DONE_FAIL); /* We don't handle LINKs internally */ if (ds->operation == XmLINK) return; if (ds->selection == XA_PRIMARY && ds->operation == XmMOVE) XmeTransferAddDoneProc(ds->transfer_id, SetPrimarySelection); else XmeTransferAddDoneProc(ds->transfer_id, CleanPrimarySelection); if (ds->selection == atoms[XmA_MOTIF_DROP]) { XmDropProcCallbackStruct *cb = (XmDropProcCallbackStruct *) ds->destination_data; DropPoint.x = cb->x; DropPoint.y = cb->y; ds->location_data = (XtPointer) &DropPoint; if (cb->dropAction != XmDROP_HELP) { HandleDrop(w, cb, ds); } } else if (ds->selection == XA_SECONDARY) { Atom CS_OF_ENCODING; CS_OF_ENCODING = XmeGetEncodingAtom(w); _XmProcessLock(); insert_select.done_status = False; insert_select.success_status = False; insert_select.event = (XSelectionRequestEvent *) ds->event; insert_select.select_type = XmDEST_SELECT; if (((Atom) ds->location_data) != CS_OF_ENCODING) { /* * Make selection request to find out which targets * the selection can provide. */ XmTransferValue(ds->transfer_id, atoms[XmATARGETS], (XtCallbackProc) TextSecondaryWrapper, (XtPointer) &insert_select, ds->time); } else { /* * Make selection request to replace the selection * with the insert selection. */ XmTransferValue(ds->transfer_id, ((Atom) ds->location_data), (XtCallbackProc) TextSecondaryWrapper, (XtPointer) &insert_select, ds->time); } _XmProcessUnlock(); } else /* CLIPBOARD or PRIMARY */ XmTransferValue(ds->transfer_id, atoms[XmATARGETS], (XtCallbackProc) HandleTargets, ds->location_data, ds->time); } void _XmTextInstallTransferTrait(void) { XmeTraitSet((XtPointer)xmTextWidgetClass, XmQTtransfer, (XtPointer) &TextTransfer); } motif-2.3.8/lib/Xm/PanedW.c0000644000175000017500000025021313145162623012245 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: PanedW.c /main/24 1999/07/13 07:46:01 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" #include #include #include #include #include "MessagesI.h" #include "RepTypeI.h" typedef enum {FirstPane='U', LastPane='L'} Direction; #define MESSAGE4 _XmMMsgPanedW_0000 #define MESSAGE5 _XmMMsgPanedW_0001 #define MESSAGE6 _XmMMsgPanedW_0002 #define MESSAGE8 _XmMMsgPanedW_0004 #define MESSAGE9 _XmMMsgPanedW_0005 #define PaneInfo(w) ((XmPanedWindowConstraintPtr)(w)->core.constraints) #define IsPane(w) (PaneInfo(w)->panedw.isPane) #define PaneIndex(w) (PaneInfo(w)->panedw.position) #define PanePosIndex(w) (PaneInfo(w)->panedw.position_index) /*****************************************************************/ /* Code used for carrying the orientation code is a clean way. Do not manipulate width, height, or x and y anymore, but a major and minor dimension and an independant position */ #define Horizontal(pw) ((pw)->paned_window.orientation == XmHORIZONTAL) /* since we cannot change the instance record field name, for binary compatibility, we have to macro those as well */ #define PaneDMajor(w) (PaneInfo(w)->panedw.dheight) #define PaneDPos(w) (PaneInfo(w)->panedw.dy) #define PaneOldDPos(w) (PaneInfo(w)->panedw.olddy) #define PaneStartPos(w) (w->paned_window.starty) #define PaneFirst(w) (w->paned_window.top_pane) #define PaneLast(w) (w->paned_window.bottom_pane) #define PaneFirstDMajor(w) (w->paned_window.top_pane->panedw.dheight) #define PaneLastDMajor(w) (w->paned_window.bottom_pane->panedw.dheight) /* then come all the new paradigm of major/minor dimension */ #define Major(pw, w, h) ((Horizontal(pw))?w:h) #define Minor(pw, w, h) (Major(pw,h,w)) #define MajorMargin(pw) (Major(pw, (pw)->paned_window.margin_width,\ (pw)->paned_window.margin_height)) #define MinorMargin(pw) (Major(pw, (pw)->paned_window.margin_height,\ (pw)->paned_window.margin_width)) #define MajorSize(pw) (Major(pw, (pw)->core.width, (pw)->core.height)) #define MinorSize(pw) (Major(pw, (pw)->core.height, (pw)->core.width)) #define MajorChildSize(pw, child) (Major(pw, \ (child)->core.width, (child)->core.height)) #define MinorChildSize(pw, child) (Major(pw, \ (child)->core.height, (child)->core.width)) #define MajorChildPos(pw, child) (Major(pw, (child)->core.x, (child)->core.y)) #define MajorReq(pw, request) (Major(pw, (request)->width, (request)->height)) #define MinorReq(pw, request) (Major(pw, (request)->height, (request)->width)) #define MajorAssign(pw,x,v) if (Horizontal(pw)) (x).width = v; else (x).height = v #define MinorAssign(pw,x,v) if (Horizontal(pw)) (x).height = v; else (x).width = v /*****************************************************************/ #define XmBLOCK 10 /* used for the list of managed children */ #define DEFAULT_SASH_INDENT_LTOR -10 #define DEFAULT_SASH_INDENT_RTOL 10 /* Enumerated values used for HandleSash action, whose parameters are processing using reptype. */ enum { _START, _MOVE, _COMMIT, _KEY }; enum { _DEFAULT_INCR, _LARGE_INCR }; enum { _UP, _DOWN, _RIGHT, _LEFT, _FIRST, _LAST }; /******** Static Function Declarations ********/ static void ReManageChildren( XmPanedWindowWidget pw) ; static int NeedsAdjusting( register XmPanedWindowWidget pw) ; static XtGeometryResult AdjustPanedWindowMajor( XmPanedWindowWidget pw, #if NeedWidePrototypes int newdim, #else Dimension newdim, #endif /* NeedWidePrototypes */ Dimension *reply_dim) ; static void ResetDMajors( XmPanedWindowWidget pw) ; static void RefigureLocations( register XmPanedWindowWidget pw, int c_index, Direction dir, #if NeedWidePrototypes int rflag, int sflag) ; #else Boolean rflag, Boolean sflag) ; #endif /* NeedWidePrototypes */ static void CommitNewLocations( XmPanedWindowWidget pw, Widget instigator) ; static void RefigureLocationsAndCommit( XmPanedWindowWidget pw, int c_index, Direction dir, #if NeedWidePrototypes int rflag) ; #else Boolean rflag) ; #endif /* NeedWidePrototypes */ static void DrawTrackLines( XmPanedWindowWidget pw) ; static void EraseTrackLines( XmPanedWindowWidget pw) ; static void ProcessKeyEvent( XtPointer client_data, XtIntervalId *id) ; static void HandleSash( Widget w, XtPointer closure, XtPointer callData) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void SashIndentDefault(Widget widget, int offset, XrmValue *value ); static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void ConstraintInit( Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) ; static void Destroy( Widget w) ; static Cardinal InsertOrder( Widget w) ; static void InsertChild( register Widget w) ; static void ChangeManaged( Widget w) ; static void Resize( Widget wid) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean PaneSetValues( Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void ConstraintDestroy( Widget w) ; static void AdjustGC( XmPanedWindowWidget pw) ; static void GetFlipGC( XmPanedWindowWidget pw) ; /******** End Static Function Declarations ********/ /**************************************************************** * * Paned Window Resources * ****************************************************************/ #define Offset(field) XtOffsetOf( struct _XmPanedWindowRec, paned_window.field) static XtResource resources[] = { {XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), Offset(margin_width), XmRImmediate, (XtPointer) 3}, {XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), Offset(margin_height), XmRImmediate, (XtPointer) 3}, /* need to change the XmR to something dynamic: XmRPanedWMajorDimension, that checks eh orientation first */ {XmNspacing, XmCSpacing, XmRVerticalDimension, sizeof(Dimension), Offset(spacing), XmRImmediate, (XtPointer) 8}, {XmNrefigureMode, XmCBoolean, XmRBoolean, sizeof(Boolean), Offset(refiguremode), XmRImmediate, (XtPointer) TRUE}, {XmNseparatorOn, XmCSeparatorOn, XmRBoolean, sizeof(Boolean), Offset(separator_on), XmRImmediate, (XtPointer) TRUE}, /* need to change the XmR to something dynamic XmRPanedWMinorDimension */ {XmNsashIndent, XmCSashIndent, XmRHorizontalPosition, sizeof(Position), Offset(sash_indent), XmRCallProc, (XtPointer) SashIndentDefault}, {XmNsashWidth, XmCSashWidth, XmRHorizontalDimension, sizeof(Dimension), Offset(sash_width), XmRImmediate, (XtPointer) 10}, {XmNsashHeight, XmCSashHeight, XmRVerticalDimension, sizeof(Dimension), Offset(sash_height), XmRImmediate, (XtPointer) 10}, {XmNsashShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), Offset(sash_shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness}, {XtNinsertPosition, XtCInsertPosition, XtRFunction, sizeof(XtOrderProc), XtOffsetOf(XmPanedWindowRec, composite.insert_position), XtRImmediate, (XtPointer) InsertOrder}, {XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), Offset(orientation), XmRImmediate, (XtPointer) XmVERTICAL }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource get_resources[] = { { XmNmarginWidth, sizeof(Dimension), Offset(margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), Offset(margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNspacing, sizeof(Dimension), Offset(spacing), /* need to change to something dynamic FromPanedWMajorPixels, and ToPanedWMajorPixels, that check orientation first */ XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNsashIndent, sizeof(Position), Offset(sash_indent), /* need to change to FromPanedWMinorPixels, and ToPanedWMinorPixels */ XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNsashWidth, sizeof(Dimension), Offset(sash_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNsashHeight, sizeof(Dimension), Offset(sash_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNsashShadowThickness, sizeof(Dimension), Offset(sash_shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, }; #undef Offset /**************************************************************** * * Paned Window Constraint Resources For Its Constraint Record * ****************************************************************/ #define Offset(field) XtOffsetOf( struct _XmPanedWindowConstraintRec, panedw.field) static XtResource constraint_resources[] = { {XmNallowResize, XmCBoolean, XmRBoolean, sizeof(Boolean), Offset(allow_resize), XmRImmediate, (XtPointer) FALSE}, /* need to change the XmR to XmRPanedWMajorDimension */ {XmNpaneMinimum, XmCPaneMinimum, XmRVerticalDimension, sizeof(Dimension), Offset(min), XmRImmediate, (XtPointer) 1}, {XmNpaneMaximum, XmCPaneMaximum, XmRVerticalDimension, sizeof(Dimension), Offset(max), XmRImmediate, (XtPointer) 1000}, {XmNskipAdjust, XmCBoolean, XmRBoolean, sizeof(Boolean), Offset(skip_adjust), XmRImmediate, (XtPointer) FALSE}, {XmNpositionIndex, XmCPositionIndex, XmRShort, sizeof(short), Offset(position_index), XmRImmediate, (XtPointer) XmLAST_POSITION}, }; /* Definition for constraint resources that need special */ /* processing in get values */ static XmSyntheticResource get_constraint_resources[] = { { XmNpaneMinimum, sizeof(Dimension), Offset(min), /* need to change to FromPanedWMajorPixels and ToPanedWMajorPixels */ XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNpaneMaximum, sizeof(Dimension), Offset(max), /* need to change to FromPanedWMajorPixels and ToPanedWMajorPixels */ XmeFromVerticalPixels, XmeToVerticalPixels }, }; #undef Offset /*************************************<->************************************* * * * Description: PanedWindow full class record * ----------- *************************************<->***********************************/ externaldef(xmpanedwindowclassrec) XmPanedWindowClassRec xmPanedWindowClassRec = { { /* core class fields */ (WidgetClass) &xmManagerClassRec, /* superclass */ "XmPanedWindow", /* class name */ sizeof(XmPanedWindowRec), /* size */ NULL, /* class initialize */ ClassPartInitialize, /* class_part_inite */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ Realize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resourses */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enter/lv */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ XmeRedisplayGadgets, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ XtInheritTranslations, /* tm_table */ NULL, /* Query Geometry proc */ NULL, /* display accelerator */ NULL, /* extension */ }, { /* composite class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ InsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint class fields */ constraint_resources, /* subresourses */ XtNumber(constraint_resources), /* subresource_count */ sizeof(XmPanedWindowConstraintRec), /* constraint_size */ ConstraintInit, /* initialize */ ConstraintDestroy, /* destroy */ PaneSetValues, /* set_values */ NULL, /* extension */ }, { /* manager_class fields */ XtInheritTranslations, /* translations */ get_resources, /* get resources */ XtNumber(get_resources), /* num get_resources */ get_constraint_resources, /* get_cont_resources */ XtNumber(get_constraint_resources), /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* paned_window_class fields */ NULL, /* extension */ } }; externaldef(xmpanedwindowwidgetclass) WidgetClass xmPanedWindowWidgetClass = (WidgetClass) &xmPanedWindowClassRec; /************************************************************************ * * SashIndentDefault * Set up the default sash indentation * ************************************************************************/ /*ARGSUSED*/ static void SashIndentDefault(Widget widget, int offset, /* unused */ XrmValue *value ) { static Position indent; value->addr = (XPointer) &indent; if (LayoutIsRtoLM(widget)) indent = (Position) DEFAULT_SASH_INDENT_RTOL; else indent = (Position) DEFAULT_SASH_INDENT_LTOR; } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget. * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmPANED_WINDOW_BIT); } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ /* ARGSUSED */ static void Initialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args ) { XmPanedWindowWidget pw = (XmPanedWindowWidget) new_w; /* Protect against empty widgets */ pw->paned_window.pane_count = 0; pw->paned_window.managed_children = (WidgetList) XtMalloc(XmBLOCK*sizeof(Widget)); pw->paned_window.num_slots = XmBLOCK; pw->paned_window.num_managed_children = 0; PaneStartPos(pw) = 0; PaneFirst(pw) = NULL; PaneLast(pw) = NULL; pw->paned_window.flipgc = NULL; pw->paned_window.increment_count = 0; pw->paned_window.resize_at_realize = True; pw->paned_window.timer = 0 ; /************************************************************* * NOTE: that sash_indent is made to conform to a correct size * during changed managed time/layout time. Since the size of * the window may change we won't require that * abs(sash_indent) <= width of a pane. ************************************************************/ pw -> paned_window.recursively_called = FALSE; /* DON'T ALLOW HEIGHT/WIDTH TO BE 0, OR X DOESN'T HANDLE THIS WELL */ if (pw->core.width == 0) pw->core.width = 10; if (pw->core.height == 0) pw->core.height = 10; /* Check orientation value */ if(!XmRepTypeValidValue(XmRID_ORIENTATION, pw->paned_window.orientation, (Widget) pw)) { pw->paned_window.orientation = XmVERTICAL; } } /*************************************<->************************************* * * Realize * * Description: * ----------- * Create our window, set NW gravity (Realize), set up * * *************************************<->***********************************/ static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { register XmPanedWindowWidget pw = (XmPanedWindowWidget)w; WidgetList children = pw->paned_window.managed_children; int num_children = pw->paned_window.num_managed_children; Widget *childP; Mask valueMask = *p_valueMask; valueMask |= CWBitGravity | CWDontPropagate; attributes->bit_gravity = NorthWestGravity; attributes->do_not_propagate_mask = ButtonPressMask| ButtonReleaseMask|KeyPressMask|KeyReleaseMask|PointerMotionMask; XtCreateWindow (w, InputOutput, CopyFromParent, valueMask, attributes); GetFlipGC(pw); /* one last time, in case we grew to try to return an * XtGeometryAlmost for a child, but the child decided not to grow * or in case some child grew itself and we didn't hear about it. */ if (pw->paned_window.resize_at_realize) { XtWidgetProc resize; _XmProcessLock(); resize = pw->core.widget_class->core_class.resize; _XmProcessUnlock(); (*resize)( (Widget) pw ); } ReManageChildren(pw); children = pw->paned_window.managed_children; num_children = pw->paned_window.num_managed_children; /* now we have to make sure all the sashs are on above their * panes, which means that we have to realize all our children * here and now. If we realize from the beginning of the list, * then the sashs (which are at the end) will be Above by default. */ for (childP = children; childP - children < num_children; childP++) XtRealizeWidget( *childP ); } /* Realize */ /*************************************<->************************************* * * Destroy * *************************************<->***********************************/ static void Destroy( Widget w ) { XmPanedWindowWidget pw = (XmPanedWindowWidget)w; if (pw->paned_window.timer) XtRemoveTimeOut(pw->paned_window.timer); if (pw->paned_window.flipgc != NULL) { XtReleaseGC(w, pw->paned_window.flipgc); pw->paned_window.flipgc = NULL; } XtFree( (char *) pw->paned_window.managed_children); } /* Destroy */ /*************************************<->************************************* * * Resize * *************************************<->***********************************/ static void Resize( Widget wid ) { XmPanedWindowWidget pw = (XmPanedWindowWidget) wid ; RefigureLocationsAndCommit( pw, pw->paned_window.pane_count - 1, LastPane, True); } /* Resize */ /*************************************<->************************************* * * ConstraintDestroy * * Description: * ----------- * Destroy the sash of any pane which is being destroyed. * * *************************************<->***********************************/ static void ConstraintDestroy( Widget w ) { if (!XtIsRectObj(w)) return; /* * If this is an ordinary pane, delete its sash (if it has one) * and separator (if it has one) and then invoke the standard * inherited delete child routines. */ if (XtIsRectObj(w) && IsPane(w)) { if (PaneInfo(w)->panedw.sash != NULL) XtDestroyWidget(PaneInfo(w)->panedw.sash); if (PaneInfo(w)->panedw.separator != NULL) XtDestroyWidget(PaneInfo(w)->panedw.separator); /* the destroyed child has already been removed from the list of ** children, so update the other panes so that their positions match ** their positionIndex values (no need to be clever and update only ** those that change) */ { XmPanedWindowWidget pw = (XmPanedWindowWidget)w->core.parent; if (!(pw->core.being_destroyed)) { int i; for (i = 0; (i < pw->composite.num_children) && IsPane(pw->composite.children[i]); i++) PanePosIndex(pw->composite.children[i]) = i; } } } } /*************************************<->************************************* * * void AdjustGC(pw) * XmPanedWindowWidget pw; * * Description: * ----------- * Set up the clip regions so the track lines do not draw on * top of the sashes. * *************************************<->***********************************/ static void AdjustGC( XmPanedWindowWidget pw ) { XRectangle clip_rect; register int i; Region sash_region, clip_region; if (pw->composite.num_children > 0) { sash_region = XCreateRegion(); clip_region = XCreateRegion(); /* find all the managed sashes and add their area to the sash region */ for (i = 0; i < pw->composite.num_children; i++) { if (XmIsSash(pw->composite.children[i]) && XtIsManaged(pw->composite.children[i])) { clip_rect.width = pw->composite.children[i]->core.width; clip_rect.height = pw->composite.children[i]->core.height; clip_rect.x = pw->composite.children[i]->core.x; clip_rect.y = pw->composite.children[i]->core.y; XUnionRectWithRegion(&clip_rect, sash_region, sash_region); } } /* set up the initial clip region */ clip_rect.width = pw->core.width; clip_rect.height = pw->core.height; clip_rect.x = 0; clip_rect.y = 0; XUnionRectWithRegion(&clip_rect, clip_region, clip_region); /* remove the sash regions from the clip region */ XSubtractRegion(clip_region, sash_region, clip_region); /* set the clip region, so the track lines won't be draw on the sashes */ XSetRegion(XtDisplay(pw), pw->paned_window.flipgc, clip_region); /* remove the clip regions */ XDestroyRegion(sash_region); XDestroyRegion(clip_region); } } /*************************************<->************************************* * * void GetFlipGC(pw) * XmPanedWindowWidget pw; * * Description: * ----------- * Create a GC which can be used to draw/erase track lines when the * the size of the panes is being changed. * *************************************<->***********************************/ static void GetFlipGC( XmPanedWindowWidget pw ) { unsigned long valuemask = GCForeground | GCSubwindowMode | GCFunction; unsigned long dynamicMask = GCClipMask; XGCValues values; values.foreground = pw->core.background_pixel ^ pw->manager.foreground; values.subwindow_mode = IncludeInferiors; values.function = GXxor; pw->paned_window.flipgc = XtAllocateGC((Widget)pw, 0, valuemask, &values, dynamicMask, 0); } /********************************************************************** * * ReManageChildren * This procedure will be called by the ChangeManged procedure * It will reassemble the currently managed children into the * "paned_window.managed_children" list. * One day I think I'm gonna remove this stuff... dd ********************************************************************/ static void ReManageChildren( XmPanedWindowWidget pw ) { int i; pw->paned_window.num_managed_children = 0; for (i = 0; i < pw->composite.num_children; i++) { if (XtIsManaged(pw->composite.children[i])) { if ((pw->paned_window.num_managed_children+1) > pw->paned_window.num_slots) { pw->paned_window.num_slots += XmBLOCK; pw->paned_window.managed_children = (WidgetList) XtRealloc ((char *) pw->paned_window.managed_children, (pw->paned_window.num_slots * sizeof(Widget))); } pw->paned_window.managed_children [pw->paned_window.num_managed_children++] = pw->composite.children[i]; } } } /*************************************<->************************************* * * NeedsAdjusting (pw) * * Description: * ----------- * Calculate the major size needed to fully display this paned window. * *************************************<->***********************************/ static int NeedsAdjusting( register XmPanedWindowWidget pw ) { int needed, i; needed = 0; for (i = 0; i < pw->paned_window.pane_count; i++) { needed += PaneDMajor(pw->paned_window.managed_children[i]) + 2 * pw->paned_window.managed_children[i]->core.border_width + pw->paned_window.spacing; } /* * Get rid of extra spacing from previous 'for' loop and add in * major margin at the top and bottom of the panedw window */ if (pw->paned_window.pane_count > 0) needed += 2 * MajorMargin(pw) - pw->paned_window.spacing; return (needed != MajorSize(pw)) ? needed : 0 ; } /*************************************<->************************************* * * AdjustPanedWindowMajor * * Description: * ----------- * Request a new size for the paned window from its parent. * If the requested new dim is less than 1, then ask for size of 1. * *************************************<->***********************************/ static XtGeometryResult AdjustPanedWindowMajor( XmPanedWindowWidget pw, #if NeedWidePrototypes int newdim, #else Dimension newdim, #endif /* NeedWidePrototypes */ Dimension *reply_dim ) { Dimension replyWidth, replyHeight; XtGeometryResult result = XtGeometryNo; if (newdim < 1) newdim = 1; switch (XtMakeResizeRequest((Widget)pw, Major(pw, newdim, pw->core.width), Major(pw, pw->core.height, newdim), &replyWidth, &replyHeight)) { case XtGeometryYes: *reply_dim = newdim; result = XtGeometryYes; break; case XtGeometryAlmost: XtMakeResizeRequest((Widget)pw, replyWidth, replyHeight, NULL, NULL); *reply_dim = Major(pw, replyWidth, replyHeight); result = XtGeometryAlmost; break; case XtGeometryNo: default: *reply_dim = MajorSize(pw); result = XtGeometryNo; break; } return(result); } /*************************************<->************************************* * * ResetDMajors * * Description: * ----------- * Set the desired size field in the constraint record for each * pane. * *************************************<->***********************************/ static void ResetDMajors( XmPanedWindowWidget pw ) { Widget *childP; int i; for (i=0, childP = pw->paned_window.managed_children; i < pw->paned_window.pane_count; childP++, i++) PaneDMajor(*childP) = MajorChildSize(pw, *childP); } /*************************************<->************************************* * * RefigureLocations * * Description: * ----------- * This is the workhorse routine which actually computes where the children * are going to be placed. It honors any Min/Max constraints placed on a * pane as well as honoring the direction to do the refiguring. * *************************************<->***********************************/ static void RefigureLocations( register XmPanedWindowWidget pw, int c_index, Direction dir, #if NeedWidePrototypes int rflag, int sflag ) #else Boolean rflag, Boolean sflag ) #endif /* NeedWidePrototypes */ { WidgetList children = pw->paned_window.managed_children; int num_panes = pw->paned_window.pane_count; int _dir = (dir == FirstPane) ? 1 : -1; int spacing; XmPanedWindowConstraintPart * pane; register Widget *childP; Position pos; int sizeused; int cdir, i; int pass; if (num_panes == 0 || !pw->paned_window.refiguremode) return; spacing = pw->paned_window.spacing; /* * ENFORCE THE MIN/MAX CONSTRAINTS; ALSO KEEP TRACK OF THE * TOTAL SIZE NEEDED TO DISPLAY VPANED WINDOW BASED ON * DESIRED SIZES OF PANES. */ sizeused = 0; for (childP = children, i = 0; i < num_panes; childP++, i++) { pane = &(PaneInfo(*childP)->panedw); if (PaneDMajor(*childP) < pane->min) PaneDMajor(*childP) = pane->min; else if (PaneDMajor(*childP) > pane->max) PaneDMajor(*childP) = pane->max; sizeused += PaneDMajor(*childP) + spacing + 2 * (*childP)->core.border_width; } /* * Get rid of extra spacing from previous 'for' loop and add in * margin height at the top and bottom of the paned window */ sizeused += 2*MajorMargin(pw) - spacing; childP = children + c_index; if (dir == FirstPane && c_index != num_panes - 1) childP++; cdir = _dir; /* allow at most 3 passes through the panes to adjust the heights */ for (pass = 0; sizeused != MajorSize(pw) && pass < (9 * num_panes); pass++) { pane = &(PaneInfo(*childP)->panedw); if ((!pane->skip_adjust || sflag) || cdir != _dir) { int old = PaneDMajor(*childP); if (sizeused < MajorSize(pw)) PaneDMajor(*childP)+= MajorSize(pw) - sizeused; else if (sizeused - MajorSize(pw) < PaneDMajor(*childP) && PaneDMajor(*childP) - (sizeused - MajorSize(pw)) > 1) PaneDMajor(*childP) -= sizeused - MajorSize(pw); else PaneDMajor(*childP) = 1; if (PaneDMajor(*childP) < pane->min) PaneDMajor(*childP) = pane->min; if (PaneDMajor(*childP) > pane->max) PaneDMajor(*childP) = pane->max; sizeused += (PaneDMajor(*childP) - old); } childP+= cdir; /* * WE GET INTO THE NEXT WHILE LOOP WHEN WE HAVE EXHAUSTED OUR * LIST OF CHILDREN AND WE STILL NEED TO REDISTRIBUTE A CHANGE IN * SIZE, NOW WE WILL TRY TO CHANGE DIRECTION AND SEE IF THERE * IS A PANE BACK WHERE WE STARTED FROM THAT CAN ABSORB THE * SHORTAGE/OVERAGE */ while ((childP < children) || ((childP - children) >= num_panes)) { cdir = -cdir; if (cdir == _dir) { pos = MajorMargin(pw); for (childP = children, i = 0; i < num_panes; childP++, i++) { PaneDPos(*childP) = pos; pos += PaneDMajor(*childP) + spacing + 2 * (*childP)->core.border_width; } pos += MajorMargin(pw) - spacing; /* if not resizing, make sure the sum of the pane heights are not greater than the vpane height */ if (!rflag){ if (pos > MajorSize(pw)) { childP = children + c_index; pane = &(PaneInfo(*childP)->panedw); if (PaneDMajor(*childP) > (pos - MajorSize(pw))) PaneDMajor(*childP) = (PaneDMajor(*childP) - (pos - MajorSize(pw))); else PaneDMajor(*childP) = 1; } else { return; } } else return; } childP = children + c_index + cdir; /* HANDLE SPECIAL CASE */ if ((c_index == 0) && (cdir < 0)) childP++; } } pos = MajorMargin(pw); for (childP = children, i = 0; i < num_panes; childP++, i++) { PaneDPos(*childP) = pos; pos += PaneDMajor(*childP) + spacing + 2 * (*childP)->core.border_width; } } /*************************************<->************************************* * * CommitNewLocations * * Description: * ----------- * Use the core width/height, It also raises the sash for the * pane, and prevents the sash from disappearing from the screen. * *************************************<->***********************************/ static void CommitNewLocations( XmPanedWindowWidget pw, Widget instigator) { WidgetList children = pw->paned_window.managed_children; int num_panes = pw->paned_window.pane_count; register Widget *childP; XWindowChanges changes; int i, offset, sepPos; int minor_dim, major_dim ; changes.stack_mode = Above; offset = MinorMargin(pw); for (childP = children, i = 0; i < num_panes; childP++, i++) { register XmPanedWindowConstraintPart * pane = &(PaneInfo(*childP)->panedw); register Widget sash = pane->sash; register Widget separator = pane->separator; if (sash) /* IF THIS IS NOT NULL */ { int tmp = MinorSize(pw) - 2 * ((*childP)->core.border_width + MinorMargin(pw)) ; if (tmp <= 0) tmp = 1; if (*childP != instigator) { XmeConfigureObject(*childP, Major(pw, PaneDPos(*childP), offset), Major(pw, offset, PaneDPos(*childP)), Major(pw, PaneDMajor(*childP), tmp), Major(pw, tmp, PaneDMajor(*childP)), (*childP)->core.border_width); } if (separator) { sepPos = MajorChildPos(pw, *childP) + MajorChildSize(pw, *childP) + 2 * (*childP)->core.border_width + pw->paned_window.spacing/2 - MajorChildSize(pw, separator)/2 - separator->core.border_width; XmeConfigureObject(separator, Major(pw, sepPos, separator->core.x), Major(pw, separator->core.y, sepPos), Major(pw, separator->core.width, pw->core.width), Major(pw, pw->core.height, separator->core.height), separator->core.border_width); } /* Move and Display the Sash */ if (pw->paned_window.sash_indent < 0) minor_dim = MinorSize(pw) + pw->paned_window.sash_indent - MinorChildSize(pw, sash) - sash->core.border_width*2; else minor_dim = pw->paned_window.sash_indent; /* PREVENT SASH FROM DISAPPEARING FROM SCREEN */ if ((minor_dim > (MinorSize(pw) - MinorChildSize(pw, sash))) || (minor_dim < 0)) minor_dim = 0; major_dim = MajorChildPos(pw, *childP) + MajorChildSize(pw, *childP) + 2 * (*childP)->core.border_width + pw->paned_window.spacing/2 - MajorChildSize(pw, sash)/2 - sash->core.border_width; /* This should match XmeConfigureObject, except that we're * also insuring the sash is Raised in the same request */ sash->core.x = changes.x = Major(pw, major_dim, minor_dim); sash->core.y = changes.y = Major(pw, minor_dim, major_dim); if (XtIsRealized(pane->sash)) XConfigureWindow( XtDisplay(pane->sash), XtWindow(pane->sash), CWX | CWY | CWStackMode, &changes ); } else { if (*childP != instigator) { int tmp = MinorSize(pw) - 2*(pw->core.border_width + MinorMargin(pw)) ; if (tmp <= 0) tmp = 1; XmeConfigureObject( *childP, Major(pw, PaneDPos(*childP), offset), Major(pw, offset, PaneDPos(*childP)), Major(pw, PaneDMajor(*childP), tmp), Major(pw, tmp, PaneDMajor(*childP)), (*childP)->core.border_width); } } } } /*************************************<->************************************* * * RefigureLocationsAndCommit * * Description: * ----------- * A utility call that does the call to calculate the pane layout * and then move the panes to their new locations. * *************************************<->***********************************/ static void RefigureLocationsAndCommit( XmPanedWindowWidget pw, int c_index, Direction dir, #if NeedWidePrototypes int rflag ) #else Boolean rflag ) #endif /* NeedWidePrototypes */ { if (pw->paned_window.refiguremode) { RefigureLocations(pw, c_index, dir, rflag, False); CommitNewLocations(pw, NULL); } } /*************************************<->************************************* * * DrawTrackLines * * Description: * ----------- * Erase any old track lines (point are kept in the pane's constraint * record--olddPos field) and then draw new track lines across the top * of all panes (except the first). These lines will be interactively * moved (by other routines) to respond to the user's request to resize * panes within the VPane Manager. * *************************************<->***********************************/ static void DrawTrackLines( XmPanedWindowWidget pw ) { Widget *childP; XmPanedWindowConstraintPart * pane; Widget *children = pw->paned_window.managed_children; int num_panes = pw->paned_window.pane_count; Dimension sep_size; int offset; for (childP = children + 1; childP - children < num_panes; childP++) { pane = &(PaneInfo(*childP)->panedw); sep_size = pane->separator ? MajorChildSize(pw, pane->separator): 2; if (PaneOldDPos(*childP) != PaneDPos(*childP)) { offset = PaneOldDPos(*childP) - (pw->paned_window.spacing + sep_size) / 2; XDrawLine(XtDisplay(pw), XtWindow(pw), pw->paned_window.flipgc, Major(pw, offset, 0), Major(pw, 0, offset), Major(pw, offset, pw->core.width), Major(pw, pw->core.height, offset)); offset = PaneDPos(*childP) - (pw->paned_window.spacing + sep_size) / 2; XDrawLine(XtDisplay(pw), XtWindow(pw), pw->paned_window.flipgc, Major(pw, offset, 0), Major(pw, 0, offset), Major(pw, offset, pw->core.width), Major(pw, pw->core.height, offset)); PaneOldDPos(*childP) = PaneDPos(*childP); } } } /*************************************<->************************************* * * EraseTrackLines * * Description: * ----------- * After the user has stopped adjusting the pane sizes, erase the last * set of track lines (remember that DrawTrackLines erases old track * lines before drawing new ones). * *************************************<->***********************************/ static void EraseTrackLines( XmPanedWindowWidget pw ) { Widget *childP; XmPanedWindowConstraintPart * pane; Widget *children = pw->paned_window.managed_children; int num_panes = pw->paned_window.pane_count; Dimension sep_size; int offset; for (childP = children + 1; childP - children < num_panes; childP++) { pane = &(PaneInfo(*childP)->panedw); sep_size = pane->separator ? MajorChildSize(pw, pane->separator): 2; offset = PaneOldDPos(*childP) - (pw->paned_window.spacing + sep_size) / 2; XDrawLine(XtDisplay(pw), XtWindow(pw), pw->paned_window.flipgc, Major(pw, offset, 0), Major(pw, 0, offset), Major(pw, offset, pw->core.width), Major(pw, pw->core.height, offset)); } } /*************************************<->************************************* * * ProcessKeyEvent * * Description: * ----------- * This function processes a batch of key pressed events * so that a sash movement action via the keyboard doesn't * get too far behind the key event actions. * *************************************<->***********************************/ /* ARGSUSED */ static void ProcessKeyEvent( XtPointer client_data, XtIntervalId *id ) { Widget w = (Widget) client_data; register XmPanedWindowWidget pw = (XmPanedWindowWidget)w->core.parent; register WidgetList children = pw->paned_window.managed_children; int num_panes = pw->paned_window.pane_count; Widget *childP; XmPanedWindowConstraintPart * pane; short c_index; int diff; /* first mark the timeout as removed */ pw->paned_window.timer = 0 ; PaneFirst(pw) = PaneLast(pw) = NULL; if (pw->paned_window.increment_count < 0) { /* NOTE THAT w IS A SASH, TO GET POSITION WE HAVE TO GET INDEX OF PANE ASSOCIATED WITH THIS SASH */ c_index = PaneIndex(PaneInfo(w)->panedw.sash); if (c_index < (num_panes-1)) c_index++; pane = &(PaneInfo(children[c_index])->panedw); while (pane->max == pane->min && c_index < num_panes - 1) pane = &(PaneInfo(children[++c_index])->panedw); PaneLast(pw) = PaneInfo(children[c_index]); } else { /* NOTE THAT w IS A SASH, TO GET POSITION WE HAVE TO GET INDEX OF PANE ASSOCIATED WITH THIS SASH */ c_index = PaneIndex(PaneInfo(w)->panedw.sash); pane = &(PaneInfo(children[c_index])->panedw); while (pane->max == pane->min && c_index > 0) pane = &(PaneInfo(children[--c_index])->panedw); PaneFirst(pw) = PaneInfo(children[c_index]); } for (childP = children; childP - children < num_panes; childP++) PaneOldDPos(*childP) = -99; ResetDMajors( pw ); diff = pw->paned_window.increment_count; if (PaneFirst(pw)) { /* make sure size don't go negative */ if ((-diff) >= (int)PaneFirstDMajor(pw)) { /* can't add as much to other pane */ /******************************************************************* diff = -PaneFirstDMajor(pw) + 1; *******************************************************************/ PaneFirstDMajor(pw) = 1; } else PaneFirstDMajor(pw) += diff; RefigureLocationsAndCommit(pw, PaneIndex(PaneInfo(w)->panedw.sash), FirstPane, False); } else if (PaneLast(pw)) { if (diff >= (int)PaneLastDMajor(pw)) { PaneLastDMajor(pw) = 1; } else PaneLastDMajor(pw) -= diff; RefigureLocationsAndCommit(pw, PaneIndex(PaneInfo(w)->panedw.sash), LastPane, False); } pw->paned_window.increment_count = 0; } /*************************************<->************************************* * * HandleSash * * Description: * ----------- * Selection Events on the sashes invoke this routine through * callbacks. An adjustment of the size of the panes always involves * 2 panes (one to shrink and one to grow) if the type of sash grab is * "This Window Only" then both a top and bottom pane are selected (these * are the panes which will be adjusted); if the grab type is "Upper Pane" * then only a "top" pane is chosen and the correct "bottom" * pane will be determined by the "RefigureLocations" routine. If * the grab type is "Lower" then only a "bottom" pane is chosen and the * the correct "top" pane is found by the "RefigureLocations" routine. * *************************************<->***********************************/ /* ARGSUSED */ static void HandleSash( Widget w, XtPointer closure, XtPointer callData ) { SashCallData call_data = (SashCallData)callData; register XmPanedWindowWidget pw = (XmPanedWindowWidget)w->core.parent; register WidgetList children = pw->paned_window.managed_children; int num_panes = pw->paned_window.pane_count; short increment = 1; short c_index; int diff, pos, action_param, increment_param, direction_param; Widget *childP; XmPanedWindowConstraintPart * pane; if (call_data->num_params == 0) { XmeWarning( (Widget) pw, MESSAGE8); return; } _XmConvertActionParamToRepTypeId((Widget) pw, XmRID_PANED_WINDOW_SASH_ACTION_PARAMS, call_data->params[0], False, &action_param); switch (call_data->event->xany.type) { case ButtonPress: case ButtonRelease: pos = Major(pw, call_data->event->xbutton.x_root, call_data->event->xbutton.y_root); break; case KeyRelease: return; case KeyPress: if (call_data->num_params < 3) { XmeWarning( (Widget) pw, MESSAGE8); return; } /* Verify that we have a KEY action */ if (action_param == _KEY) { /* Validate the other two parameters */ if ((_XmConvertActionParamToRepTypeId((Widget) pw, XmRID_PANED_WINDOW_SASH_INCREMENT_ACTION_PARAMS, call_data->params[1], False, &increment_param) == False) || (_XmConvertActionParamToRepTypeId((Widget) pw, XmRID_PANED_WINDOW_SASH_DIRECTION_ACTION_PARAMS, call_data->params[2], False, &direction_param) == False)) return; /* Have to track Up or Left */ if (direction_param == _UP || direction_param == _LEFT) { if (increment_param == _LARGE_INCR) increment = -10; else increment = -1; } /* Have to track Down or Right */ else if (direction_param == _DOWN || direction_param == _RIGHT) { if (increment_param == _LARGE_INCR) increment = 10; else increment = 1; } if (!pw->paned_window.increment_count) { pw->paned_window.increment_count = increment; pw->paned_window.timer = XtAppAddTimeOut(XtWidgetToApplicationContext( (Widget) pw), XtGetMultiClickTime(XtDisplay(pw)), ProcessKeyEvent, (XtPointer) w); } else pw->paned_window.increment_count += increment; } return; case MotionNotify: pos = Major(pw, call_data->event->xmotion.x_root, call_data->event->xmotion.y_root); break; default: pos = PaneStartPos(pw); } switch (action_param) { case _START: /* Start adjustment */ PaneFirst(pw) = PaneLast(pw) = NULL; /* NOTE THAT w IS A SASH, TO GET POSITION WE HAVE TO GET INDEX OF PANE ASSOCIATED WITH THIS SASH */ c_index = PaneIndex(PaneInfo(w)->panedw.sash); if (c_index < (num_panes-1)) c_index++; pane = &(PaneInfo(children[c_index])->panedw); while (pane->max == pane->min && c_index < num_panes - 1) pane = &(PaneInfo(children[++c_index])->panedw); PaneLast(pw) = PaneInfo(children[c_index]); /* NOTE THAT w IS A SASH, TO GET POSITION WE HAVE TO GET INDEX OF PANE ASSOCIATED WITH THIS SASH */ c_index = PaneIndex(PaneInfo(w)->panedw.sash); pane = &(PaneInfo(children[c_index])->panedw); while (pane->max == pane->min && c_index > 0) pane = &(PaneInfo(children[--c_index])->panedw); PaneFirst(pw) = PaneInfo(children[c_index]); PaneStartPos(pw) = pos; for (childP = children; childP - children < num_panes; childP++) PaneOldDPos(*childP) = -99; if (pw->paned_window.flipgc) AdjustGC(pw); break; case _MOVE: ResetDMajors( pw ); diff = pos - PaneStartPos(pw); if (diff > 0 && PaneFirst(pw)) { /* make sure size don't go negative */ if ((-diff) >= (int)PaneFirstDMajor(pw)) { /* can't add as much to other pane */ /****************************************************** diff = -PaneFirstDMajor(pw) + 1; *****************************************************/ PaneFirstDMajor(pw) = 1; } else { PaneFirstDMajor(pw) += diff; } RefigureLocations(pw, PaneIndex(PaneInfo(w)->panedw.sash), FirstPane, False, True); } else if (PaneLast(pw)) { if (diff >= (int)PaneLastDMajor(pw)) { PaneLastDMajor(pw) = 1; } else { PaneLastDMajor(pw) -= diff; } RefigureLocations(pw, PaneIndex(PaneInfo(w)->panedw.sash), LastPane, False, True); } DrawTrackLines(pw); break; case _COMMIT: EraseTrackLines(pw); CommitNewLocations(pw, NULL); break; default: XmeWarning( (Widget) pw, MESSAGE9); } } /*************************************<->************************************* * * GeometryManager * * Description: * ----------- * The Geometry Manager only allows changes after Realize if * allow_resize is True in the constraints record. It * only allows height changes, but offers the requested height * as a compromise if both width and height changes were requested. * As all good Geometry Managers should, we will return No if the * request will have no effect; i.e. when the requestor is already * of the desired geometry. * *************************************<->***********************************/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XmPanedWindowWidget pw = (XmPanedWindowWidget) w->core.parent; XtGeometryMask mask = request->request_mode; XtWidgetGeometry allowed, geo_desired, geo_reply; XmPanedWindowConstraintPart * pane = &(PaneInfo(w)->panedw); Boolean is_almost = FALSE ; register Widget *children; int i; Dimension childMinor, childBorderWidth, new_major, old_dmajor, tmp; int num_panes =0; register Widget *childP; /* First treat the special case resulting from a change in positionIndex */ if (PanePosIndex(w) == XmLAST_POSITION) { /* as set in ConstraintSetValues */ int i ; /* first reset the value of positionIndex to its real value */ for (i = 0 ; i < pw->composite.num_children; i++) if (pw->composite.children[i] == w) { PanePosIndex(w) = i ; break ; } /* then accept the desired change */ if (IsX(request) && request->x >= 0) w->core.x = request->x; if (IsY(request) && request->y >= 0) w->core.y = request->y; if (IsHeight(request) && request->height > 0) w->core.height = request->height; if (IsWidth(request) && request->width > 0) w->core.width = request->width; return XtGeometryYes; } /* yes for an internal kid */ if (XmIsSash(w)) { if ((mask & CWX) && request->x >= 0) w->core.x = request->x; if ((mask & CWY) && request->y >= 0) w->core.y = request->y; if ((mask & CWHeight) && request->height > 0) w->core.height = request->height; if ((mask & CWWidth) && request->width > 0) w->core.width = request->width; return XtGeometryYes; } old_dmajor = PaneDMajor(w); /* disallow resizes if flag for this pane says no */ /* why this realized test ? */ if (XtIsRealized((Widget)pw) && !pane->allow_resize) return XtGeometryNo; /* reject attempts that do not want to adjust height or width */ /* issue : and borderwidth? */ if (!(mask & (CWWidth | CWHeight))) return XtGeometryNo; /* mark with almost request that attemps to change position *and* size (since we've already pass the previous test) */ if (mask & (CWX | CWY)) is_almost = TRUE ; /* check for queryonly */ if ((mask & XtCWQueryOnly) || is_almost) geo_desired.request_mode = XtCWQueryOnly; else geo_desired.request_mode = 0 ; if ((mask & Minor(pw, CWWidth, CWHeight))) { /* * NOW RECOMPUTE THE LIST OF MANAGED CHILDREN. */ ReManageChildren(pw); children = pw->paned_window.managed_children; /* * COUNT THE NUMBER OF PANES THAT ARE MANAGED. */ childP = children; while ( (num_panes < pw->paned_window.num_managed_children) && XtIsRectObj(*childP) && IsPane(*childP)) { childP++; num_panes++; } pw->paned_window.pane_count = num_panes; /* * SET WIDTH OF PANED WINDOW EQUAL TO THAT OF WIDEST CHILD * seems useless... */ childMinor = 0; childBorderWidth = 0; for (childP = children, i = 0; i < num_panes; childP++, i++) { if ((MinorChildSize(pw, *childP) + (*childP)->core.border_width) > childMinor + childBorderWidth) { childMinor = MinorChildSize(pw, *childP) ; childBorderWidth = (*childP)->core.border_width; } } if (childMinor < 1) childMinor = 1; /* only allowed to grow */ if (MinorReq(pw, request) >= childMinor) { MinorAssign(pw, geo_desired, MinorReq(pw, request) + 2 * (childBorderWidth + MinorMargin(pw))) ; geo_desired.request_mode |= Minor(pw, CWWidth, CWHeight); switch (XtMakeGeometryRequest((Widget) pw, &geo_desired, &geo_reply)) { case XtGeometryYes: MinorAssign(pw, allowed, MinorReq(pw, request)) ; break; case XtGeometryAlmost: if (MinorReq(pw, &geo_reply) > 2*(childBorderWidth + MinorMargin(pw))) tmp = MinorReq(pw, &geo_reply) - 2*(childBorderWidth + MinorMargin(pw)); else tmp = 1; MinorAssign(pw, allowed, tmp); if (MinorReq(pw, &allowed) < childMinor) { MinorAssign(pw, allowed, childMinor) ; } is_almost = TRUE ; break; case XtGeometryNo: default: MinorAssign(pw, allowed, MinorSize(pw) - 2*(childBorderWidth + MinorMargin(pw))); break; } } else { /* give the max possible and almost */ MinorAssign(pw, allowed, childMinor) ; is_almost = TRUE ; } } else { /* kid not interested by Width, take its current size */ MinorAssign(pw, allowed, MinorChildSize(pw, w)); } /* the whole stuff of individual requests, first Width and then Height doesn't look correct in my opinion (what if parent has a constrainted ratio?), but I think we can live with it for now */ /* just forget about the CWWidth setting and go for Height */ if ((geo_desired.request_mode & XtCWQueryOnly) || is_almost) geo_desired.request_mode = XtCWQueryOnly; if (mask & Major(pw, CWWidth, CWHeight)) { /* try to almost the sucker */ if (MajorReq(pw, request) < pane->min) { MajorAssign(pw, allowed, pane->min); MajorAssign(pw, *request, pane->min); is_almost = TRUE ; geo_desired.request_mode = XtCWQueryOnly; } if (MajorReq(pw, request) > pane->max) { MajorAssign(pw, allowed, pane->max); MajorAssign(pw, *request, pane->max); is_almost = TRUE ; geo_desired.request_mode = XtCWQueryOnly; } /* try out the new size */ ResetDMajors( pw ); old_dmajor = PaneDMajor(w); PaneDMajor(w) = MajorReq(pw, request); if ((new_major = NeedsAdjusting(pw)) != 0) { MajorAssign(pw, geo_desired, new_major); geo_desired.request_mode |= Major(pw, CWWidth, CWHeight); switch(XtMakeGeometryRequest((Widget) pw, &geo_desired, &geo_reply)) { case XtGeometryYes: MajorAssign(pw, allowed, MajorReq(pw, request)); break; case XtGeometryAlmost: if ((new_major > MajorReq(pw, &geo_reply)) && MajorReq(pw, request) > (new_major - MajorReq(pw, &geo_reply))) tmp = MajorReq(pw, request) - (new_major - MajorReq(pw, &geo_reply)); else tmp = 1 ; MajorAssign(pw, allowed, tmp); if (MajorReq(pw, &allowed) < pane->min) { MajorAssign(pw, allowed, pane->min); } if (MajorReq(pw, &allowed) > pane->max) { MajorAssign(pw, allowed, pane->max); } is_almost = TRUE ; break; case XtGeometryNo: default: MajorAssign(pw, allowed, MajorChildSize(pw, w)); break; } } else /* ok */{ MajorAssign(pw, allowed, MajorReq(pw, request)); } } else { /* kid not interested by Height, take its current size */ MajorAssign(pw, allowed, MajorChildSize(pw, w)); } /* now the conclusion: If it's not almosted yet (due to a position request) and if I got what I've asked for or if I didn't ask anything in this dimension, then it's a Yes. If queryonly was specified, don't forget to just undo the change made. */ if ((!is_almost) && (((mask & CWWidth) && (allowed.width == request->width)) || (!(mask & CWWidth))) && (((mask & CWHeight) && (allowed.height == request->height)) || (!(mask & CWHeight)))) { if (!(mask & XtCWQueryOnly)) { w->core.width = allowed.width; w->core.height = allowed.height; RefigureLocations(pw, PaneIndex(w), FirstPane, False, False); if (Horizontal(pw)) { w->core.x = PaneDPos(w) ; w->core.y = pw->paned_window.margin_height ; } else { w->core.y = PaneDPos(w) ; w->core.x = pw->paned_window.margin_width ; } /* relayout all kids except instigator */ CommitNewLocations(pw, w ); } else { PaneDMajor(w) = old_dmajor; } return XtGeometryYes ; } /* else we decide to reply Almost, so undo the change made and reply allowed */ PaneDMajor(w) = old_dmajor; allowed.request_mode = CWWidth|CWHeight ; *reply = allowed; return XtGeometryAlmost; } /************************************************************************ * * Constraint Initialize * * This routine is called to initialize the constraint record for * every child inserted into the paned_window window. * ************************************************************************/ /* ARGSUSED */ static void ConstraintInit( Widget request, Widget new_w, ArgList args, Cardinal *num_args ) { XmPanedWindowWidget pw = (XmPanedWindowWidget) XtParent(new_w); XmPanedWindowConstraintPart * pane = &(PaneInfo(new_w)->panedw); int size; if (!XtIsRectObj(new_w)) return; /* don't let sashes or separators get a non default position - which could easily happen with resource like XmPanedWindow*kid*positionIndex: 0 */ if (pw->paned_window.recursively_called) pane->position_index = XmLAST_POSITION ; size = MajorChildSize(pw, new_w); if (pane->min == 0) { XmeWarning( (Widget) pw, MESSAGE4); pane->min = 1; } if (pane->max == 0) { XmeWarning( (Widget) pw, MESSAGE5); pane->max = pane->min + 1; } if (pane->min > pane->max) { XmeWarning( (Widget) pw, MESSAGE6); pane->max = pane->min + 1; } /* ENFORCE MIN/MAX if child already managed */ if (size < pane->min) size = pane->min; if (size > pane->max) size = pane->max; if (XtIsManaged(new_w)) XmeConfigureObject(new_w, new_w->core.x, new_w->core.y, Major(pw, size, new_w->core.width), Major(pw, new_w->core.height, size), new_w->core.border_width); } /*************************************************************************** * * static Cardinal * InsertOrder (cw, args, p_num_args) * * This function searches through the composite widget's list of children * to find the correct insertion position for the new child. If the * new child is an ordinary child (not a subclass of XmSashWidget) * the position returned will cause it to be inserted after the other * ordinary children but before any Sashs; if the new child is a * sash the position returned will cause it to be inserted after * the regular panes. * * This procedure also handles the positionIndex constraint resource. * ************************************************************************/ static Cardinal InsertOrder( Widget w ) { CompositeWidget pw = (CompositeWidget) XtParent(w); Cardinal i=0 ; /* find the number of regular children */ while ((i < pw->composite.num_children) && IsPane(pw->composite.children[i])) i++; /* i is the maximum positionIndex allowed, 0 is the min */ /* if a paned position has been specified - should not happen for sash and separator, since we tracked that in constraint init - and if it's a correct value, use it */ if (PanePosIndex(w) != XmLAST_POSITION) { if ((PanePosIndex(w) >= 0) && (PanePosIndex(w) < i)) { return PanePosIndex(w) ; } } /* all PanePosIndex will be res-et in InsertChild proc */ return (i); } /*************************************<->************************************* * * InsertChild() * *************************************<->***********************************/ static void InsertChild( register Widget w ) { XmPanedWindowWidget pw = (XmPanedWindowWidget)w->core.parent; XmPanedWindowConstraintPart * pane = &(PaneInfo(w)->panedw); Arg args[10]; int n,i; Widget *p ; XmNavigationType navType; XtWidgetProc insert_child; if (!XtIsRectObj(w)) return; /* * Insert the child widget in the composite children list with an * insertion procedure exported from Manager.c, it, in turn, will * make use of the special insert procedure, InsertOrder, defined * above. Essentially, ordinary panes are grouped together at the * beginning of the list of composite children, sashs are always * put at the end of the list. */ _XmProcessLock(); insert_child = ((XmManagerWidgetClass)xmManagerWidgetClass)-> composite_class.insert_child; _XmProcessUnlock(); (*insert_child) (w); /* * If we are creating a sash for an ordinary pane, then just * return here. However, before we do, set its "isPane" flag * to false, meaning that this is NOT a pane; if it is a * pane then set its "isPane" flag to TRUE. */ if (pw->paned_window.recursively_called) { pane->isPane = FALSE; pane->separator = NULL; pane->sash = NULL; return; } pane->isPane = TRUE; n = 0; XtSetArg(args[n], Minor(pw, XmNwidth, XmNheight), MinorSize(pw)); n++; XtSetArg(args[n], XmNborderWidth, 0); n++; XtSetArg(args[n], XmNhighlightThickness, 0); n++; XtSetArg(args[n], XmNseparatorType, XmSHADOW_ETCHED_IN); n++; XtSetArg(args[n], XmNmargin, 0); n++; XtSetArg(args[n], XmNorientation, Minor(pw, XmHORIZONTAL, XmVERTICAL)); n++; XtSetArg(args[n], XmNnavigationType, (XtArgVal) XmNONE); n++; pw->paned_window.recursively_called = True; pane->separator = XtCreateWidget("Separator", xmSeparatorGadgetClass, (Widget)pw, args, n); pw->paned_window.recursively_called = False; PaneInfo(pane->separator)->panedw.separator = w; /* If we create a sash then have the pane's constraint rec point * to the sash, ignore the constraint rec of the sash (Yes, it * gets one). If we don't create a sash for the pane, just set * that field to NULL. */ n = 0; XtSetArg(args[n], XmNwidth, pw->paned_window.sash_width); n++; XtSetArg(args[n], XmNheight, pw->paned_window.sash_height); n++; XtSetArg(args[n], XmNshadowThickness, pw->paned_window.sash_shadow_thickness); n++; XtSetArg(args[n], XmNunitType, (XtArgVal) XmPIXELS); n++; pw->paned_window.recursively_called = True; pane->sash = XtCreateWidget("Sash", xmSashWidgetClass, (Widget)pw, args, n); XtAddCallback(pane->sash, XmNcallback, HandleSash, (XtPointer)w); pw->paned_window.recursively_called = False; XtSetArg(args[0], XmNnavigationType, &navType); XtGetValues(w, args, 1); if(navType == XmNONE){ XtSetArg(args[0], XmNnavigationType, (XtArgVal) XmTAB_GROUP); XtSetValues(w, args, 1); }; PaneInfo(pane->sash)->panedw.sash = w; /* re-set the correct positionIndex values for everybody if * the new kid has been inserted in the list instead of put at the end */ if (PanePosIndex(w) != pw->composite.num_children) for (i = 0, p = pw->composite.children; i < pw->composite.num_children; i++, p++) { PanePosIndex(*p) = i ; } } /* InsertChild */ /*************************************<->************************************* * * ChangeManaged * *************************************<->***********************************/ static void ChangeManaged( Widget w ) { register XmPanedWindowWidget pw = (XmPanedWindowWidget)w; register Widget *childP; register int i; Widget *children; int num_children = pw->composite.num_children; Widget sash, separator; Dimension minor_dim = 0, major_dim = 0; Dimension childMinor, childBorderWidth, newMinor; Dimension needed; int num_panes = 0; XmPanedWindowConstraintPart * pane; XtGeometryResult result; /* * THIS PREVENTS US FROM RE-ENTERING THIS CODE AS WE MANAGE/UNMANAGE * THE SASHES */ if (pw->paned_window.recursively_called++) return; /* * NOW RECOMPUTE THE LIST OF MANAGED CHILDREN. */ ReManageChildren(pw); children = pw->paned_window.managed_children; /* * COUNT THE NUMBER OF PANES THAT ARE MANAGED. */ childP = children; while ((num_panes < pw->paned_window.num_managed_children) && XtIsRectObj(*childP) && IsPane(*childP)) { childP++; num_panes++; } pw->paned_window.pane_count = num_panes; /* * SET WIDTH OF PANED WINDOW EQUAL TO THAT OF WIDEST CHILD */ childMinor = 0; childBorderWidth = 0; major_dim = 0; for (childP = children, i = 0; i < num_panes; childP++, i++) { pane = &(PaneInfo(*childP)->panedw); if (MinorChildSize(pw, *childP) + (*childP)->core.border_width > childMinor + childBorderWidth) { childMinor = MinorChildSize(pw, *childP); childBorderWidth = (*childP)->core.border_width; } if (MajorChildSize(pw, *childP) < pane->min) XmeConfigureObject(*childP, (*childP)->core.x, (*childP)->core.y, Major(pw, pane->min, (*childP)->core.width), Major(pw, (*childP)->core.height, pane->min), (*childP)->core.border_width); if (MajorChildSize(pw, *childP) > pane->max) XmeConfigureObject(*childP, (*childP)->core.x, (*childP)->core.y, Major(pw, pane->max, (*childP)->core.width), Major(pw, (*childP)->core.height, pane->max), (*childP)->core.border_width); major_dim += MajorChildSize(pw, *childP) + 2*(*childP)->core.border_width; } if (childMinor < 1) childMinor = 1; /* * NOW SCAN THE COMPOSITE LIST OF CHILDREN, AND MAKE SURE * THAT THEIR MANAGEMENT SETTING REFLECTS THAT OF THEIR PANE. */ for (childP = pw->composite.children, i = 0; i < num_children; childP++, i++) { if (! IsPane(*childP)) break; /* jump out of loop */ sash = PaneInfo(*childP)->panedw.sash; separator = PaneInfo(*childP)->panedw.separator; /* Realize child now so it won't get realized and put on the top of the stack, above the sash, when it is realized later */ if (XtIsRealized((Widget)pw) && XtIsManaged(*childP)) XtRealizeWidget(*childP); /* KEEP SOME RECORD OF DESIRED HEIGHT */ PaneDMajor(*childP) = MajorChildSize(pw, *childP); newMinor = childMinor + 2*(childBorderWidth - (*childP)->core.border_width); if (XtIsManaged(*childP)) XmeConfigureObject( *childP, (*childP)->core.x, (*childP)->core.y, Major(pw, (*childP)->core.width, newMinor), Major(pw, newMinor, (*childP)->core.height), (*childP)->core.border_width); if ((XtIsManaged(*childP)) && (*childP != children[num_panes-1])) { if (separator && pw->paned_window.separator_on) { if (!XtIsManaged(separator)) XtManageChild(separator); if (XtIsRealized(separator)) XRaiseWindow(XtDisplay(separator), XtWindow(separator)); } if (sash) { if (PaneInfo(*childP)->panedw.min != PaneInfo(*childP)->panedw.max) { if (!XtIsManaged(sash)) XtManageChild(sash); if (XtIsRealized(sash)) XRaiseWindow( XtDisplay(sash), XtWindow(sash) ); } else if (XtIsManaged(sash)) XtUnmanageChild(sash); } } else { if (sash) if (XtIsManaged(sash)) XtUnmanageChild(sash); if (separator && pw->paned_window.separator_on) if (XtIsManaged(separator)) XtUnmanageChild(separator); } } /* NOW CHANGEMANAGED CAN BE ENTERED NORMALLY */ pw->paned_window.recursively_called = False; /* * TRAVERSE MANAGED PANES AND SET THE POSITION FIELD IN THE CONSTRAINT * RECORD TO 0, 1, 2, 3, 4 ETC. */ childP = pw->paned_window.managed_children; for (i = 0; i < pw->paned_window.pane_count; childP++) (PaneInfo(*childP))->panedw.position = i++; minor_dim = childMinor; if (major_dim < 1) major_dim = 1; minor_dim += 2*(MinorMargin(pw) + childBorderWidth); major_dim += pw->paned_window.spacing*((num_panes)?num_panes-1:0) + 2*MajorMargin(pw); while ((result = XtMakeResizeRequest(w, Major(pw, major_dim, minor_dim), Major(pw, minor_dim, major_dim), Major(pw, &major_dim, &minor_dim), Major(pw, &minor_dim, &major_dim))) == XtGeometryAlmost) /*EMPTY*/; if (result == XtGeometryYes || result == XtGeometryAlmost || MajorChildSize(pw, w) == major_dim) { /* see if the major size of the Paned Window needs to be adjusted to fit all the panes */ if ((needed = NeedsAdjusting(pw)) != 0) AdjustPanedWindowMajor(pw, needed, &major_dim); } else { pw->paned_window.resize_at_realize = False; } ResetDMajors( pw ); if (XtIsRealized((Widget)pw)) RefigureLocationsAndCommit(pw, 0, FirstPane, False); XmeNavigChangeManaged((Widget)pw); } /* ChangeManaged */ /*************************************<->************************************* * * SetValues * ----------------- * *************************************<->***********************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmPanedWindowWidget oldpw = (XmPanedWindowWidget) cw ; XmPanedWindowWidget requestpw = (XmPanedWindowWidget) rw ; XmPanedWindowWidget newpw = (XmPanedWindowWidget) nw ; Boolean returnFlag = False; WidgetList children = newpw->composite.children; register Widget *childP; int num_children = newpw->composite.num_children; Arg sashargs[3]; int i, minor_dim, major_dim; int n = 0; if (oldpw->core.background_pixel != newpw->core.background_pixel) { if (newpw->paned_window.flipgc != NULL) { XtReleaseGC(nw, newpw->paned_window.flipgc); } GetFlipGC(newpw); returnFlag = True; } if (newpw->paned_window.sash_width == 0) newpw->paned_window.sash_width = oldpw->paned_window.sash_width; if (oldpw->paned_window.sash_width != newpw->paned_window.sash_width) { XtSetArg(sashargs[n], XmNwidth, newpw->paned_window.sash_width); n++; } if (newpw->paned_window.sash_height == 0) newpw->paned_window.sash_height = oldpw->paned_window.sash_height; if (oldpw->paned_window.sash_height != newpw->paned_window.sash_height) { XtSetArg(sashargs[n], XmNheight, newpw->paned_window.sash_height); n++; } if (oldpw->paned_window.sash_shadow_thickness != newpw->paned_window.sash_shadow_thickness) { XtSetArg(sashargs[n], XmNshadowThickness, newpw->paned_window.sash_shadow_thickness); n++; } if (oldpw->paned_window.separator_on != newpw->paned_window.separator_on && num_children > 2) { WidgetList sep_children; Cardinal num_separators = 0; /* This should be more than enough space */ sep_children = (WidgetList) XtMalloc((num_children/3) * sizeof(Widget)); for (childP = children, i = 0; i < num_children; childP++, i++) { if (IsPane(*childP)) { Widget separator = PaneInfo(*childP)->panedw.separator; if (separator) { sep_children[num_separators] = separator; num_separators++; } } } if (num_separators != 0) { if (newpw->paned_window.separator_on) XtManageChildren((WidgetList) sep_children, num_separators); else XtUnmanageChildren((WidgetList) sep_children, num_separators); } XtFree((char *)sep_children); } if(!XmRepTypeValidValue( XmRID_ORIENTATION, newpw->paned_window.orientation, (Widget) newpw)){ newpw->paned_window.orientation = oldpw->paned_window.orientation; } if (newpw->paned_window.orientation != oldpw->paned_window.orientation) { ChangeManaged( (Widget) newpw); returnFlag = True; } if (oldpw->paned_window.sash_indent != newpw->paned_window.sash_indent || oldpw->paned_window.margin_width != newpw->paned_window.margin_width || oldpw->paned_window.margin_height != newpw->paned_window.margin_height || oldpw->paned_window.sash_width != newpw->paned_window.sash_width || oldpw->paned_window.sash_height != newpw->paned_window.sash_height || oldpw->paned_window.sash_shadow_thickness != newpw->paned_window.sash_shadow_thickness || oldpw->paned_window.spacing != newpw->paned_window.spacing) { for (childP = children, i = 0; i < num_children; childP++, i++) { if (IsPane(*childP)) { register XmPanedWindowConstraintPart * pane = &(PaneInfo(*childP)->panedw); register Widget sash = pane->sash; if (sash) /* IF THIS IS NOT NULL */ { /* Send Down Changes to Sash */ assert(n <= XtNumber(sashargs)); if (n != 0) /* something is in the arglist */ XtSetValues((Widget)sash, sashargs, n); /* Move and Display the Sash */ if (newpw->paned_window.sash_indent < 0) minor_dim = MinorSize(newpw) + newpw->paned_window.sash_indent - MinorChildSize(newpw, sash) - sash->core.border_width*2; else minor_dim = newpw->paned_window.sash_indent; /* PREVENT SASH FROM DISAPPEARING FROM SCREEN */ if ((minor_dim > (MinorSize(newpw) - MinorChildSize(newpw, sash))) || (minor_dim < 0)) minor_dim= 0; major_dim = MajorChildPos(newpw, *childP) + MajorChildSize(newpw, *childP) + 2 * (*childP)->core.border_width + newpw->paned_window.spacing/2 - MajorChildSize(newpw, sash)/2 - sash->core.border_width; XmeConfigureObject(sash, Minor(newpw, minor_dim,major_dim), Major(newpw, minor_dim,major_dim), sash->core.width, sash->core.height, sash->core.border_width); } } } /* make the windows match the new locations */ CommitNewLocations(newpw,NULL); } if (oldpw->paned_window.margin_width != newpw->paned_window.margin_width) { newpw->core.width = newpw->core.width + ((2 * newpw->paned_window.margin_width) - (2 * oldpw->paned_window.margin_width)); returnFlag = True; } if ((oldpw->paned_window.spacing != newpw->paned_window.spacing || oldpw->paned_window.margin_height != newpw->paned_window.margin_height || (requestpw->paned_window.refiguremode && !(oldpw->paned_window.refiguremode))) && XtIsRealized((Widget)newpw)) { Dimension needed; if ((needed = NeedsAdjusting(newpw)) != 0) { newpw->core.height = needed; returnFlag = True; } } return(returnFlag); } /* SetValues */ /*************************************<->************************************* * * PaneSetValues * * *************************************<->***********************************/ /* ARGSUSED */ static Boolean PaneSetValues( Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args ) { XmPanedWindowWidget pw = (XmPanedWindowWidget)new_w->core.parent; Arg sashargs[4]; int i, count ; XmPanedWindowConstraintPart * old_pane = &(PaneInfo(old)->panedw); XmPanedWindowConstraintPart * new_pane = &(PaneInfo(new_w)->panedw); register Widget tmp; XtWidgetGeometry current ; if (!XtIsRectObj(new_w)) return(FALSE); if (PanePosIndex(old) != PanePosIndex(new_w)) { /* first check for a valid value */ /* count the number of pane children : not sash and separator */ i = 0 ; while ((i < pw->composite.num_children) && IsPane(pw->composite.children[i])) i++; /* special public value */ if (PanePosIndex(new_w) == XmLAST_POSITION) PanePosIndex(new_w) = i - 1 ; if ((PanePosIndex(new_w) < 0) || (PanePosIndex(new_w) >= i)) { PanePosIndex(new_w) = PanePosIndex(old) ; /* warning ? */ } else { int inc ; /* change the configuration of the children list: put the requesting child at the new position and shift the others as needed (2 cases here) */ tmp = pw->composite.children[PanePosIndex(old)] ; if (PanePosIndex(new_w) < PanePosIndex(old)) inc = -1 ; else inc = 1 ; for (i = PanePosIndex(old) ; i != PanePosIndex(new_w) ; i+=inc) { pw->composite.children[i] = pw->composite.children[i+inc]; PanePosIndex(pw->composite.children[i]) = i ; } pw->composite.children[PanePosIndex(new_w)] = tmp ; /* save the current geometry of the child */ current.x = XtX(new_w) ; current.y = XtY(new_w) ; current.width = XtWidth(new_w) ; current.height = XtHeight(new_w) ; current.border_width = XtBorderWidth(new_w) ; /* re-layout, move the child and possibly change the pw size */ if (XtIsRealized((Widget)pw)) ChangeManaged((Widget) pw) ; /* if we have changed the position/size of this child, next step after this setvalues chain is the geometry manager request. We need to tell the geometry manager that this request is to be always honored. As the positionIndex field itself is self-computable, we can use it to track this case. We set it to a magic value here, and in the geometry manager, we'll have to reset it to its correct value by re-computing it - adding a field in the instance is another way for doing that, clever but more expensive */ if ((current.x != XtX(new_w)) || (current.y != XtY(new_w)) || (current.width != XtWidth(new_w)) || (current.height != XtHeight(new_w)) || (current.border_width != XtBorderWidth(new_w))) PanePosIndex(new_w) = XmLAST_POSITION ; } } if (old_pane->min != new_pane->min || old_pane->max != new_pane->max) { if (new_pane->min < 1) { XmeWarning( (Widget) pw, MESSAGE4); new_pane->min = old_pane->min; } if (new_pane->max < 1) { XmeWarning( (Widget) pw, MESSAGE5); new_pane->max = old_pane->max; } if (new_pane->min > new_pane->max) { XmeWarning( (Widget) pw, MESSAGE6); new_pane->min = old_pane->min; new_pane->max = old_pane->max; } if ((new_pane->min == new_pane->max) && (new_pane->sash != NULL)) { XtUnmanageChild(new_pane->sash); } else { count =pw->paned_window.pane_count -1; if (new_pane->position != count) { if (new_pane->separator == NULL) { pw->paned_window.recursively_called = True; new_pane->separator = XtCreateWidget("separator", xmSeparatorGadgetClass, (Widget)pw, NULL, 0); pw->paned_window.recursively_called = False; if (XtIsRealized(new_w)) XtRealizeWidget(new_pane->separator); } if (pw->paned_window.separator_on) XtManageChild(new_pane->separator); if (new_pane->min != new_pane->max) { if (new_pane->sash == NULL) { Cardinal nargs = 0; XtSetArg(sashargs[nargs], XmNwidth, pw->paned_window.sash_width), nargs++; XtSetArg(sashargs[nargs], XmNheight, pw->paned_window.sash_height), nargs++; XtSetArg(sashargs[nargs], XmNshadowThickness, pw->paned_window.sash_shadow_thickness), nargs++; XtSetArg(sashargs[nargs], XmNunitType, (XtArgVal) XmPIXELS), nargs++; assert(nargs <= XtNumber(sashargs)); pw->paned_window.recursively_called = True; new_pane->sash = XtCreateManagedWidget("sash", xmSashWidgetClass, (Widget)pw, sashargs, nargs); XtAddCallback(new_pane->sash, XmNcallback, HandleSash, (XtPointer)new_w); pw->paned_window.recursively_called = False; if (XtIsRealized(new_w)) XtRealizeWidget(new_pane->sash); } } } } if (XtIsManaged(new_w) && XtIsRealized((Widget)pw)) { if (new_pane->min > MajorChildSize(pw, new_w)) { MajorAssign(pw, new_w->core, new_pane->min); } if (new_pane->max < MajorChildSize(pw, new_w)) { MajorAssign(pw, new_w->core, new_pane->max); } old_pane->min = new_pane->min; old_pane->max = new_pane->max; } /* save the current geometry of the child (CR 7671) */ current.x = XtX(new_w) ; current.y = XtY(new_w) ; current.width = XtWidth(new_w) ; current.height = XtHeight(new_w) ; current.border_width = XtBorderWidth(new_w) ; /* re-layout, move the child and possibly change the pw size */ if (XtIsRealized((Widget)pw)) ChangeManaged((Widget) pw) ; if ((current.x != XtX(new_w)) || (current.y != XtY(new_w)) || (current.width != XtWidth(new_w)) || (current.height != XtHeight(new_w)) || (current.border_width != XtBorderWidth(new_w))) /* see above comment on LAST_POSITION */ PanePosIndex(new_w) = XmLAST_POSITION ; return(True); } return False; } /*************************************<->************************************* * * Widget XmCreatePanedWindow(parent, name, args, argCount) * Widget parent; * char *name; * ArgList args; * int argCount; * * Description: * ----------- * A convenience routine to be used in creating a new PanedWindow * manager widget. * *************************************<->***********************************/ Widget XmCreatePanedWindow( Widget parent, char *name, ArgList args, Cardinal argCount ) { return (XtCreateWidget(name, xmPanedWindowWidgetClass, parent, args, argCount)); } Widget XmVaCreatePanedWindow( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmPanedWindowWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedPanedWindow( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmPanedWindowWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/SelectioBI.h0000644000175000017500000001130612672140200013043 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: SelectioBI.h /main/5 1995/07/13 17:57:50 drk $ */ #ifndef _XmSelectioBI_h #define _XmSelectioBI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmSelectionBoxCreateListLabel( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateSelectionLabel( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateList( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateText( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateSeparator( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateOkButton( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateApplyButton( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateCancelButton( XmSelectionBoxWidget sel) ; extern void _XmSelectionBoxCreateHelpButton( XmSelectionBoxWidget sel) ; extern XmGeoMatrix _XmSelectionBoxGeoMatrixCreate( Widget wid, Widget instigator, XtWidgetGeometry *desired) ; extern Boolean _XmSelectionBoxNoGeoRequest( XmGeoMatrix geoSpec) ; extern void _XmSelectionBoxGetSelectionLabelString( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetListLabelString( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetTextColumns( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetTextString( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetListItems( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetListItemCount( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetListVisibleItemCount( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetOkLabelString( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetApplyLabelString( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetCancelLabelString( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxGetHelpLabelString( Widget wid, int resource_offset, XtArgVal *value) ; extern void _XmSelectionBoxUpOrDown( Widget wid, XEvent *event, String *argv, Cardinal *argc) ; extern void _XmSelectionBoxRestore( Widget wid, XEvent *event, String *argv, Cardinal *argc) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSelectioBI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CascadeBP.h0000644000175000017500000001316213145162623012641 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCascadeBP_h #define _XmCascadeBP_h #include #include #ifdef __cplusplus extern "C" { #endif /* The CascadeButton instance record */ typedef struct { /* resources */ XtCallbackList activate_callback; /* widget fired callback */ XtCallbackList cascade_callback; /* called when the menu is */ /* about to be pulled down */ Widget submenu; /* the menu to pull down */ Pixmap cascade_pixmap; /* pixmap for the cascade */ int map_delay; /* time delay for posting */ /* internal fields */ GC arm_GC; /* armed GC */ GC background_GC; /* normal GC */ Boolean armed; /* armed flag */ XRectangle cascade_rect; /* location of cascade*/ XtIntervalId timer; /* timeout id */ Pixmap armed_pixmap; /* arm arrow cascade */ } XmCascadeButtonPart; /* Full instance record declaration */ typedef struct _XmCascadeButtonRec { CorePart core; XmPrimitivePart primitive; XmLabelPart label; XmCascadeButtonPart cascade_button; } XmCascadeButtonRec; typedef struct _XmCascadeButtonWidgetRec/* OBSOLETE (for compatibility only).*/ { CorePart core; XmPrimitivePart primitive; XmLabelPart label; XmCascadeButtonPart cascade_button; } XmCascadeButtonWidgetRec; /* CascadeButton class structure */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmCascadeButtonClassPart; /* Full class record declaration for CascadeButton class */ typedef struct _XmCascadeButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmLabelClassPart label_class; XmCascadeButtonClassPart cascade_button_class; } XmCascadeButtonClassRec; externalref XmCascadeButtonClassRec xmCascadeButtonClassRec; /* Access macro definitions */ #define CB_Submenu(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.submenu) #define CB_ActivateCall(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.activate_callback) #define CB_CascadeCall(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.cascade_callback) #define CB_CascadePixmap(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.cascade_pixmap) #define CB_ArmedPixmap(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.armed_pixmap) #define CB_ArmGC(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.arm_GC) #define CB_BackgroundGC(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.background_GC) #define CB_Cascade_x(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.cascade_rect.x) #define CB_Cascade_y(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.cascade_rect.y) #define CB_Cascade_width(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.cascade_rect.width) #define CB_Cascade_height(cb) (((XmCascadeButtonWidget) \ cb)->cascade_button.cascade_rect.height) #define CB_HasCascade(cb) (((Lab_MenuType(cb) == XmMENU_PULLDOWN) || \ (Lab_MenuType(cb) == XmMENU_POPUP)) && \ (CB_Submenu(cb))) #define XmCB_ARMED_BIT (1 << 0) #define XmCB_TRAVERSE_BIT (1 << 1) #define XmCB_WAS_POSTED_BIT (1 << 2) #define CB_IsArmed(cb) (((XmCascadeButtonWidget)(cb))->cascade_button.armed \ & XmCB_ARMED_BIT) #define CB_Traversing(cb) (((XmCascadeButtonWidget) \ (cb))->cascade_button.armed & XmCB_TRAVERSE_BIT) #define CB_WasPosted(cb) (((XmCascadeButtonWidget) \ (cb))->cascade_button.armed & XmCB_WAS_POSTED_BIT) #define CB_SetBit(byte,bit,v) byte = (byte & (~bit)) | (v ? bit : 0) #define CB_SetArmed(cb,v) CB_SetBit (((XmCascadeButtonWidget) \ (cb))->cascade_button.armed, \ XmCB_ARMED_BIT, v) #define CB_SetTraverse(cb,v) CB_SetBit (((XmCascadeButtonWidget) \ (cb))->cascade_button.armed, \ XmCB_TRAVERSE_BIT, v) #define CB_SetWasPosted(cb,v) CB_SetBit (((XmCascadeButtonWidget) \ (cb))->cascade_button.armed, \ XmCB_WAS_POSTED_BIT, v) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCascadeBP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Resolve.c0000644000175000017500000001455412672140200012503 00000000000000/* $TOG: Resolve.c /main/7 1997/07/14 14:35:00 csn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include #include /* for _XmIsSubclassOf */ #define _ALIGN(size) (((size) + (sizeof(long)-1)) & ~(sizeof(long)-1)) /******** Static Function Declarations ********/ static void ResolveSyntheticOffsets( WidgetClass wc, XmOffsetPtr * ipot, XmOffsetPtr * cpot) ; /******** End Static Function Declarations ********/ /************************************************************************ * * XmeResolvePartOffsets * ************************************************************************/ #define IsConstraintClass(wc) _XmIsSubclassOf(wc, constraintWidgetClass) /* * end FIX for 5178. */ static void ResolveSyntheticOffsets( WidgetClass wc, XmOffsetPtr * ipot, XmOffsetPtr * cpot) { XmSyntheticResource* sr = NULL; Cardinal nsr = 0; /* normal resources */ XmSyntheticResource* scr = NULL; Cardinal nscr = 0; /* constraint resources */ Cardinal i; /* Get synthetic resource and synthetic constraint resource lists */ if (_XmIsSubclassOf(wc, xmPrimitiveWidgetClass)) { XmPrimitiveWidgetClass pwc = (XmPrimitiveWidgetClass)wc; sr = pwc->primitive_class.syn_resources; nsr = pwc->primitive_class.num_syn_resources; } else if (_XmIsSubclassOf(wc, xmManagerWidgetClass)) { XmManagerWidgetClass mwc = (XmManagerWidgetClass)wc; sr = mwc->manager_class.syn_resources; nsr = mwc->manager_class.num_syn_resources; scr = mwc->manager_class.syn_constraint_resources; nscr = mwc->manager_class.num_syn_constraint_resources; } else if (_XmIsSubclassOf(wc, xmGadgetClass)) { XmGadgetClass gwc = (XmGadgetClass)wc; sr = gwc->gadget_class.syn_resources; nsr = gwc->gadget_class.num_syn_resources; } else { return; } /* Patch resource offsets using part offset tables */ if (sr && nsr > 0 && ipot) { for (i = 0; i < nsr; i++) sr[i].resource_offset = XmGetPartOffset(&(sr[i]),ipot); } if (scr && nscr > 0 && cpot) { for (i = 0; i < nscr; i++) scr[i].resource_offset = XmGetPartOffset(&(scr[i]),cpot); } } void XmeResolvePartOffsets( WidgetClass w_class, XmOffsetPtr *offset, XmOffsetPtr *constraint_offset ) { WidgetClass c, super; ConstraintWidgetClass cc = NULL, scc = NULL; int i, classcount = 0; XmPartResource *pr; _XmProcessLock(); super = w_class->core_class.superclass; /* * Set up constraint class pointers */ if (IsConstraintClass(super)) { cc = (ConstraintWidgetClass)w_class; scc = (ConstraintWidgetClass)super; } /* * Update the part size value (initially, it is the size of this part) */ w_class->core_class.widget_size = _ALIGN(w_class->core_class.widget_size) + _ALIGN(super->core_class.widget_size); if (cc && scc) cc->constraint_class.constraint_size = _ALIGN(cc->constraint_class.constraint_size) + _ALIGN(scc->constraint_class.constraint_size); /* * Count the number of superclasses and allocate the offset record(s) */ for (c = w_class; c != NULL; c = c->core_class.superclass) classcount++; *offset = (XmOffsetPtr) XtMalloc(classcount * sizeof(XmOffset)); if (cc) { if(constraint_offset != NULL) *constraint_offset = (XmOffsetPtr) XtMalloc(classcount * sizeof(XmOffset)); } else { if(constraint_offset != NULL) *constraint_offset = NULL; } /* * Fill in the offset table(s) with the offset of all parts */ for (i = classcount-1, c = super; i > 0; c = c->core_class.superclass, i--) (*offset)[i] = c->core_class.widget_size; (*offset)[0] = 0; if (constraint_offset != NULL && *constraint_offset != NULL) { for (i = classcount-1, scc = (ConstraintWidgetClass) super; i > 0; scc = (ConstraintWidgetClass)(scc->core_class.superclass), i--) if (IsConstraintClass((WidgetClass)scc)) (*constraint_offset)[i] = _ALIGN(scc->constraint_class.constraint_size); else (*constraint_offset)[i] = 0; (*constraint_offset)[0] = 0; } /* * Update the resource list(s) offsets in place */ for (i = 0; i < w_class->core_class.num_resources; i++) { pr = (XmPartResource *) &w_class->core_class.resources[i]; /* The next line updates this in place--be careful */ w_class->core_class.resources[i].resource_offset = XmGetPartOffset(pr, offset); } if (cc && constraint_offset) for (i = 0; i < cc->constraint_class.num_resources; i++) { pr = (XmPartResource *) &cc->constraint_class.resources[i]; /* The next line updates this in place--be careful */ cc->constraint_class.resources[i].resource_offset = XmGetPartOffset(pr, constraint_offset); } /* * deal with the synthetic resources. CR 9021 */ ResolveSyntheticOffsets(w_class, offset, constraint_offset); _XmProcessUnlock(); } void XmResolveAllPartOffsets( WidgetClass w_class, XmOffsetPtr *offset, XmOffsetPtr *constraint_offset ) { XmeResolvePartOffsets( w_class, offset, constraint_offset ) ; } void XmResolvePartOffsets( WidgetClass w_class, XmOffsetPtr *offset) { XmeResolvePartOffsets( w_class, offset, NULL) ; } motif-2.3.8/lib/Xm/PictureP.h0000644000175000017500000000644212672140200012621 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #include #define NUMDIGIT '#' #define HEXDIGIT 'x' #define OCTALDIGIT 'o' #define NONCASELETTER '?' #define UPCASELETTER '&' #define NONCASECHAR '@' #define UPCASECHAR '!' #define ESCAPE ';' #define CLOSURE '*' #define LBRACKET '[' #define RBRACKET ']' #define LBRACE '{' #define RBRACE '}' #define ALTERNATIVE ',' #define NODE_START_COUNT 40 typedef enum { NullTransition, /* Transition on no input */ NumericDigit, /* eqivalent to [0-9] */ HexDigit, /* eqivalent to [0-9a-fA-F] */ OctalDigit, /* eqivalent to [0-7] */ AnyLetter, /* [a-zA-Z] */ UpCaseLetter, /* ditto, but translates [a-zA-Z] -> [A-Z] */ AnyCharacter, /* Any printing character */ UpCaseCharacter, /* ditto, case transition as above */ LiteralCharacter /* Single character */ } XmTransType; typedef struct _XmPictureTransition { int destination; /* Node to transition to */ XmTransType type; /* literal, null, upcasechar, etc... */ char c; /* key -- used for literals */ /* OR: count for closures */ struct _XmPictureTransition *next; /* Next transition from our node */ } XmPictureTransition; typedef struct _XmPictureNode { int index; XmPictureTransition *transitions; } XmPictureNode; typedef struct _XmPictureRec { char * source; /* string it was parsed from */ int num_nodes; int nodes_alloced; int start_node; int final_node; XmPictureNode **nodes; /* array of nodes */ } XmPictureRec; typedef struct _XmPictureStateRec { XmPictureRec *picture; char *current_string; char *append; int statesize; unsigned char *state; /* bitvector of states */ unsigned char *newstate; /* scratch space for use in transitions */ char current; /* currently added character */ Boolean upcase; } XmPictureStateRec; typedef struct _XmAutoFill { char c; /* char to fill */ Boolean reject; /* literal's didn't match: it's "right out" */ Boolean digit; /* isdigit(c) must be true */ Boolean upcase; /* isupper(c) must be true */ Boolean letter; /* isalpha(c) must be true */ Boolean hexdigit; /* isxdigit(c) must be true */ Boolean octaldigit; /* must be 0-7 */ } XmAutoFill; motif-2.3.8/lib/Xm/ObsoXme.c0000644000175000017500000002722612672140200012440 00000000000000/* $XConsortium: ObsoXme.c /main/5 1995/07/15 20:54:09 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* ** This file contains the _Xm routines replaced by Xme functions ** in 2.0. We do not want to mix them with other _Xm in Obso2_0.c ** since there is a higher probability that these have been used ** by programs (that's why they are Xme now) */ #ifdef HAVE_CONFIG_H #include #endif #define NO_XM_1_2_BC #include #include #include #include "RegionI.h" #include /****************************_XmDrawShadows****************************/ void _XmDrawShadows(Display *display, Drawable d, GC top_gc, GC bottom_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shad_thick, #else Position x, Position y, Dimension width, Dimension height, Dimension shad_thick, #endif unsigned int shad_type) { XmeDrawShadows(display, d, top_gc, bottom_gc, x, y, width, height, shad_thick, shad_type); } /*****************************_XmClearBorder*********************************/ void _XmClearBorder (Display *display, Window w, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick) #endif /* NeedWidePrototypes */ { XmeClearBorder (display, w, x, y, width, height, shadow_thick); } /******************************_XmDrawSeparator**********************/ void _XmDrawSeparator(Display *display, Drawable d, GC top_gc, GC bottom_gc, GC separator_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, int margin, unsigned int orientation, unsigned int separator_type) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension margin, unsigned char orientation, unsigned char separator_type) #endif /* NeedWidePrototypes */ { XmeDrawSeparator(display, d, top_gc, bottom_gc, separator_gc, x, y, width, height, shadow_thick, margin, orientation, separator_type); } /***********************_XmDrawDiamond**********************************/ void _XmDrawDiamond(Display *display, Drawable d, GC top_gc, GC bottom_gc, GC center_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, int fill) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension fill) #endif /* NeedWidePrototypes */ { XmeDrawDiamond (display, d, top_gc, bottom_gc, center_gc, x, y, width, height, shadow_thick, fill); } /****************************_XmDrawSimpleHighlight************************/ void _XmDrawSimpleHighlight(Display *display, Drawable d, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int highlight_thickness) #else Position x, Position y, Dimension width, Dimension height, Dimension highlight_thickness) #endif /* NeedWidePrototypes */ { XmeDrawHighlight(display, d, gc, x, y, width, height, highlight_thickness); } /****************************_XmDrawArrow**********************************/ void _XmDrawArrow(Display *display, Drawable d, GC top_gc, GC bot_gc, GC cent_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, unsigned int direction) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, unsigned char direction) #endif /* NeedWidePrototypes */ { XmeDrawArrow(display, d, top_gc, bot_gc, cent_gc, x, y, width, height, shadow_thick, direction); } /**********************************************************************/ void _XmFromHorizontalPixels( Widget widget, int offset, XtArgVal *value ) { XmeFromHorizontalPixels(widget, offset, value); } /**********************************************************************/ void _XmFromVerticalPixels( Widget widget, int offset, XtArgVal *value ) { XmeFromVerticalPixels(widget, offset, value); } /**********************************************************************/ XmImportOperator _XmToHorizontalPixels( Widget widget, int offset, XtArgVal *value ) { return XmeToHorizontalPixels( widget, offset, value ); } /********************************************************************/ XmImportOperator _XmToVerticalPixels( Widget widget, int offset, XtArgVal *value ) { return XmeToVerticalPixels( widget, offset, value ); } /********************************************************************/ void _XmNavigChangeManaged( Widget wid ) { XmeNavigChangeManaged(wid); } /********************************************************************/ void _XmRedisplayGadgets( Widget w, register XEvent *event, Region region ) { XmeRedisplayGadgets( w, event, region ); } /********************************************************************/ Widget _XmGetTextualDragIcon( Widget w ) { return XmeGetTextualDragIcon(w); } /********************************************************************/ void _XmVirtualToActualKeysym( Display *dpy, KeySym virtKeysym, KeySym *actualKeysymRtn, Modifiers *modifiersRtn ) { int num_keys; XmKeyBinding keys; /* Initialize the return parameters. */ *actualKeysymRtn = NoSymbol; *modifiersRtn = 0; /* Arbitrarily return the first keysym in the list. */ num_keys = XmeVirtualToActualKeysyms(dpy, virtKeysym, &keys); if (num_keys > 0) { *actualKeysymRtn = keys[0].keysym; *modifiersRtn = keys[0].modifiers; } XtFree((char*) keys); } /********************************************************************/ Cursor _XmGetNullCursor( Widget w ) { return XmeGetNullCursor(w); } /********************************************************************/ void _XmWarning( Widget w, char *message ) { XmeWarning( w, message ); } /********************************************************************/ XmFontList _XmGetDefaultFontList( Widget w, #if NeedWidePrototypes unsigned int fontListType ) #else unsigned char fontListType ) #endif /* NeedWidePrototypes */ { return XmeGetDefaultRenderTable( w, fontListType ); } /********************************************************************/ Boolean _XmFontListGetDefaultFont( XmFontList fontlist, XFontStruct **font_struct ) { return XmeRenderTableGetDefaultFont(fontlist, font_struct); } /********************************************************************/ XtGeometryResult _XmGMReplyToQueryGeometry(Widget widget, XtWidgetGeometry * intended, XtWidgetGeometry * desired) { return XmeReplyToQueryGeometry(widget, intended, desired); } /********************************************************************/ Boolean _XmStringsAreEqual( register char *in_str, register char *test_str ) { return XmeNamesAreEqual( in_str, test_str ); } /********************************************************************/ void _XmGetMaxCursorSize( Widget w, Dimension *width, Dimension *height ) { XmeQueryBestCursorSize(w, width, height); } /********************************************************************/ Boolean _XmStringIsXmString( XmString string ) { return XmeStringIsValid(string); } /********************************************************************/ XmGadget _XmInputInGadget( Widget wid, register int x, register int y ) { return (XmGadget) XmObjectAtPoint( wid, x, y ); } /********************************************************************/ XmString _XmOSGetLocalizedString( char *reserved, Widget widget, char *resource, String string) { return XmeGetLocalizedString( reserved, widget, resource, string); } /********************************************************************/ int _XmMicroSleep( long usecs) { return XmeMicroSleep( usecs ); } /********************************************************************/ String _XmOSGetHomeDirName() { return XmeGetHomeDirName(); } /********************************************************************/ void _XmStringUpdateWMShellTitle( XmString xmstr, Widget shell) { XmeSetWMShellTitle(xmstr, shell); } /************************************************************************ * * _XmResizeObject * Change the width or height of a widget or gadget. * ************************************************************************/ void _XmResizeObject( Widget wid, #if NeedWidePrototypes int width, int height, int border_width ) #else Dimension width, Dimension height, Dimension border_width ) #endif /* NeedWidePrototypes */ { RectObj g = (RectObj) wid ; XmDropSiteStartUpdate(wid); if (XtIsWidget (g)) XtResizeWidget ((Widget) g, width, height, border_width); else XmeConfigureObject((Widget) g, g->rectangle.x, g->rectangle.y, width, height, 0); XmDropSiteEndUpdate(wid); } /************************************************************************ * * _XmMoveObject * Change the origin of a widget or gadget. * ************************************************************************/ void _XmMoveObject( Widget wid, #if NeedWidePrototypes int x, int y ) #else Position x, Position y ) #endif /* NeedWidePrototypes */ { RectObj g = (RectObj) wid ; XmDropSiteStartUpdate(wid); if (XtIsWidget (g)) XtMoveWidget ((Widget) g, x, y); else XmeConfigureObject((Widget) g, x, y, g->rectangle.width, g->rectangle.height, 0); XmDropSiteEndUpdate(wid); } /************************************************************************ * * _XmConfigureObject * Change the dimensional aspects of a widget or gadget. * ************************************************************************/ void _XmConfigureObject( Widget wid, #if NeedWidePrototypes int x, int y, int width, int height, int border_width ) #else Position x, Position y, Dimension width, Dimension height, Dimension border_width ) #endif /* NeedWidePrototypes */ { XmeConfigureObject( wid, x, y, width, height, border_width ); } motif-2.3.8/lib/Xm/ColorP.h0000644000175000017500000000721012672140200012256 00000000000000/* $XConsortium: ColorP.h /main/4 1995/07/15 20:49:10 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmColorP_h #define _XmColorP_h #include #ifdef __cplusplus extern "C" { #endif /* Default Color Allocation proc */ #define DEFAULT_ALLOCCOLOR_PROC (XAllocColor) /* Defines and functions for processing dynamic defaults */ #define XmMAX_SHORT 65535 #define XmCOLOR_PERCENTILE (XmMAX_SHORT / 100) #define BoundColor(value)\ ((value < 0) ? 0 : (((value > XmMAX_SHORT) ? XmMAX_SHORT : value))) /* Contributions of each primary to overall luminosity, sum to 1.0 */ #define XmRED_LUMINOSITY 0.30 #define XmGREEN_LUMINOSITY 0.59 #define XmBLUE_LUMINOSITY 0.11 /* Percent effect of intensity, light, and luminosity & on brightness, sum to 100 */ #define XmINTENSITY_FACTOR 75 #define XmLIGHT_FACTOR 0 #define XmLUMINOSITY_FACTOR 25 /* LITE color model percent to interpolate RGB towards black for SEL, BS, TS */ #define XmCOLOR_LITE_SEL_FACTOR 15 #define XmCOLOR_LITE_BS_FACTOR 40 #define XmCOLOR_LITE_TS_FACTOR 20 /* DARK color model percent to interpolate RGB towards white for SEL, BS, TS */ #define XmCOLOR_DARK_SEL_FACTOR 15 #define XmCOLOR_DARK_BS_FACTOR 30 #define XmCOLOR_DARK_TS_FACTOR 50 /* STD color model percent to interpolate RGB towards black for SEL, BS percent to interpolate RGB towards white for TS HI values used for high brightness (within STD) LO values used for low brightness (within STD) Interpolate factors between HI & LO values based on brightness */ #define XmCOLOR_HI_SEL_FACTOR 15 #define XmCOLOR_HI_BS_FACTOR 40 #define XmCOLOR_HI_TS_FACTOR 60 #define XmCOLOR_LO_SEL_FACTOR 15 #define XmCOLOR_LO_BS_FACTOR 60 #define XmCOLOR_LO_TS_FACTOR 50 /* For the default color calculation and caching */ #define XmLOOK_AT_SCREEN (1<<0) #define XmLOOK_AT_CMAP (1<<1) #define XmLOOK_AT_BACKGROUND (1<<2) #define XmLOOK_AT_FOREGROUND (1<<3) #define XmLOOK_AT_TOP_SHADOW (1<<4) #define XmLOOK_AT_BOTTOM_SHADOW (1<<5) #define XmLOOK_AT_SELECT (1<<6) #define XmBACKGROUND ((unsigned char) (1<<0)) #define XmFOREGROUND ((unsigned char) (1<<1)) #define XmTOP_SHADOW ((unsigned char) (1<<2)) #define XmBOTTOM_SHADOW ((unsigned char) (1<<3)) #define XmSELECT ((unsigned char) (1<<4)) #define XmHIGHLIGHT ((unsigned char) (1<<5)) /* Structure used to hold color schemes */ typedef struct _XmColorData { Screen * screen; Colormap color_map; unsigned char allocated; XColor background; XColor foreground; XColor top_shadow; XColor bottom_shadow; XColor select; } XmColorData; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _ColorP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Command.h0000644000175000017500000000535013145162623012452 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCommand_h #define _XmCommand_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmCommandWidgetClass; typedef struct _XmCommandClassRec * XmCommandWidgetClass; typedef struct _XmCommandRec * XmCommandWidget; #ifndef XmIsCommand #define XmIsCommand(w) (XtIsSubclass (w, xmCommandWidgetClass)) #endif /******** Public Function Declarations ********/ extern Widget XmCreateCommand( Widget parent, String name, ArgList al, Cardinal ac) ; extern Widget XmVaCreateCommand( Widget parent, char *name, ...); extern Widget XmVaCreateManagedCommand( Widget parent, char *name, ...); extern Widget XmCommandGetChild( Widget widget, #if NeedWidePrototypes unsigned int child) ; #else unsigned char child) ; #endif /* NeedWidePrototypes */ extern void XmCommandSetValue( Widget widget, XmString value) ; extern void XmCommandAppendValue( Widget widget, XmString value) ; extern void XmCommandError( Widget widget, XmString error) ; extern Widget XmCreateCommandDialog( Widget ds_p, String name, ArgList fsb_args, Cardinal fsb_n) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCommand_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MultiList.h0000644000175000017500000001437612672140200013021 00000000000000#ifndef _XmMultiList_h_ #define _XmMultiList_h_ #include #if defined(__cplusplus) extern "C" { #endif #define XmANY_COLUMN -1 externalref WidgetClass xmMultiListWidgetClass; typedef struct _XmMultiListClassRec *XmMultiListWidgetClass; typedef struct _XmMultiListRec *XmMultiListWidget; typedef struct _XmMultiListRowInfo { /* * Used by the XmIList widget. */ XmString * values; /* The array of column strings */ Pixmap pixmap; /* the mini-icon pixmaps. */ Boolean selected; /* Is this row selected. */ /* * Provided for the convience of the application programmer. */ short *sort_id; XtPointer data; /* * Private to the XmIList widget (do not modify these). */ short pix_width; /* width of the pixmap. */ short pix_height; /* height of the pixmap. */ short height; /* height of the row */ Boolean old_sel_state; /* previous select state. */ short pix_depth; /* height of the pixmap. */ } XmMultiListRowInfo; typedef struct _XmMultiListCallbackStruct { int reason; /* Why was callback called? */ XEvent *event; /* The X Event associated with find button press... */ String string; /* The search string used to do find */ int column; /* The column index into row values */ XmMultiListRowInfo *row; /* The row info structure of the matching row */ wchar_t *wc_string; /* The search wcs string used to do find */ } XmMultiListCallbackStruct; typedef int (*Xm18SortFunction) \ (short, const XmMultiListRowInfo *, const XmMultiListRowInfo *); /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /* * Function Name: XmMultiListGetSelectedRows * Description: Takes an Extended List and returns a NULL terminated array * of pointers to selected rows from the internal list * Arguments: w - the extended list widget * Returns: XmMultiListRowInfo ** */ XmMultiListRowInfo ** XmMultiListGetSelectedRows(Widget w); /* Function Name: XmCreateExtended18List * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ extern Widget XmCreateMultiList(Widget w, char *name, ArgList args, Cardinal num_args); extern Widget XmCreateMultiList(Widget w, char *name, ArgList args, Cardinal num_args); extern Widget XmVaCreateMultiList( Widget parent, char *name, ...); extern Widget XmVaCreateManagedMultiList( Widget parent, char *name, ...); /* Function Name: XmMultiListUnselectAllItems * Description: Unselects all rows * Arguments: w - the ilist widget. * Returns: none */ extern void XmMultiListUnselectAllItems(Widget w); /* Function Name: XmMultiListUnselectItem * Description: Unselects the row passed in * Arguments: w - the ilist widget. * row_info - ptr to the row passed in * Returns: none */ extern void XmMultiListUnselectItem(Widget w, XmMultiListRowInfo *row_info); /* Function Name: XmMultiListToggleRow * Description: Toggles the selection state of a specified row * Arguments: w - the extended list widget * Returns: none */ extern void XmMultiListToggleRow(Widget w, short row); /* Function Name: XmMultiListSelectItems * Description: Set selection state by matching column entries to XmString * Arguments: w - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * notify - if True, call XmNsingleSelectionCallback * Returns: none */ extern void XmMultiListSelectItems(Widget w, XmString item, int column, Boolean notify); /* Function Name: XmMultiListDeselectItems * Description: Set selection state by matching column entries to XmString * Arguments: w - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * Returns: none */ extern void XmMultiListDeselectItems(Widget w, XmString item, int column); /* Function Name: XmMultiListSelectAllItems * Description: Set selection state on all rows * Arguments: w - the extended list widget * notify - if True, call XmNsingleSelectionCallback for each * Returns: none */ extern void XmMultiListSelectAllItems(Widget w, Boolean notify); /* Function Name: XmMultiListSelectRow * Description: Set selection state on all rows * Arguments: w - the extended list widget * row - the row to select * notify - if True, call XmNsingleSelectionCallback * Returns: none */ extern void XmMultiListSelectRow(Widget w, int row, Boolean notify); /* Function Name: XmMultiListDeselectRow * Description: Set selection state on all rows * Arguments: w - the extended list widget * row - the row to select * Returns: none */ extern void XmMultiListDeselectRow(Widget w, int row); /* * Function Name: XmMultiListGetSelectedRowArray * Description: Takes an Extended List and returns a NULL terminated array * of pointers to selected rows from the internal list * Arguments: w - the extended list widget * num_rows - pointer to the number of rows * Returns: array of integer (selected) row numbers */ extern int *XmMultiListGetSelectedRowArray(Widget w, int *num_rows); /* Function Name: XmMultiListMakeRowVisible * Description: Shifts the visible extended list rows as desired * Arguments: w - the extended list widget * row - the row number wished to be made visible * Returns: none */ extern void XmMultiListMakeRowVisible(Widget w, int row); #if defined(__cplusplus) } #endif #endif /* _XmMultiList_h_ */ motif-2.3.8/lib/Xm/IconHP.h0000644000175000017500000000401312672140200012176 00000000000000/* $XConsortium: IconHP.h /main/4 1995/07/15 20:52:25 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmIconHP_h #define _XmIconHP_h #include #include #include #ifdef __cplusplus extern "C" { #endif /* IconHeader class record */ typedef struct _XmIconHeaderClassPart { XtPointer extension ; } XmIconHeaderClassPart; /* Full class record declaration */ typedef struct _XmIconHeaderClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmIconGadgetClassPart icong_class; XmIconHeaderClassPart iconh_class; } XmIconHeaderClassRec; extern XmIconHeaderClassRec xmIconHeaderClassRec; /* IconHeader instance record */ typedef struct _XmIconHeaderPart { Widget container_ID; /* XmNcontainerID */ } XmIconHeaderPart; /* Full instance record declaration */ typedef struct _XmIconHeaderRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmIconGadgetPart icong; XmIconHeaderPart iconh; } XmIconHeaderRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIconHP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/RCPopup.c0000644000175000017500000011464212672140200012413 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char *rcsid = "$XConsortium: RCPopup.c /main/7 1996/03/28 15:15:24 daniel $"; #endif #endif #define FIX_1412 #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "GadgetUtiI.h" #include "HashI.h" #include "MapEventsI.h" #include "MenuStateI.h" #include "MessagesI.h" #include "RCMenuI.h" #include "RowColumnI.h" #include "ScreenI.h" #include "TearOffI.h" #include "UniqueEvnI.h" static void ButtonEventHandler( Widget w, XtPointer data, XEvent *event, Boolean *cont) ; static void PopupMenuEventHandler(Widget wid, XtPointer ignored, XEvent *e, Boolean *cont) ; static void AddHandlersToPostFromWidget( Widget popup, Widget widget) ; static Widget FindBestMatchWidget(Widget, XEvent*); static Widget FindPopupMenu(Widget toplevel, Widget target, XEvent* event, int level); static void EventNoop( Widget reportingWidget, XtPointer data, XEvent *event, Boolean *cont) ; static Boolean ProcessKey( XmRowColumnWidget rowcol, XEvent *event) ; static Boolean CheckKey( XmRowColumnWidget rowcol, XEvent *event) ; static int MatchInKeyboardList( XmRowColumnWidget rowcol, XKeyEvent *event, int startIndex) ; static Boolean AllWidgetsAccessible(Widget w) ; static int OnPostFromList(XmRowColumnWidget menu, Widget widget ) ; static void RemoveTable(Widget, XtPointer, XtPointer) ; static Widget MenuMatches(Widget possible, int level, XEvent*); /* Used to store popup information in hash table for non-popup-list menus added by XmAddToPopupFromList */ typedef struct _PopupListRec { WidgetList popups; Cardinal num_popups; } PopupListRec, *PopupList; static XmHashTable popup_table = (XmHashTable) NULL; /**************************************************************************/ /* From the Specification: * * The API view changes with the addition of new values for existing * resources and the addition of a specialized callback for the classes * Primitive and Manager. The combination of these provides the * necessary means to inform Motif of automatic popup menu behavior and * allows user to customize of the automatic behavior. The current delay * for unhandled menu events (a three second hang) will be removed. * * The behavior of the popup menu system will only change with * automatic menus. When the user provides a triggering button event, * the menu system will choose the correct menu to present. **************************************************************************/ /* * The design: * * When a user creates a new popup menu then we will install a particular * event handler on the menu's widget parent. Along with this we install * a grab on the button specified in XmNmenuPost or XmNwhichButton. The * nature of grabs is such that all events will go to the topmost grab * window, therefore the event handler must do all the child list * processing itself (versus the Intrinsics performing the search). * * For keyboard events, the menu system has done half the job in the * past. Here we use the new event handler for just the posting * of the popup menu. We continue to use the old handler for keyboard * input interest for accelerators and mnemonics. * * The posting algorithm is as follows: * * 1. On receipt of a posting event, the handler will search the child * list for a candidate widget or gadget, and track the most specific * popup menu available (these can be found in the popup list). The * criteria for a match includes matching the XmNmenuPost information. * * 2. Matching criteria include: * * * The menu must have XmNpopupEnabled set to either * XmPOPUP_AUTOMATIC or XmPOPUP_AUTOMATIC_RECURSIVE. * * * The popup menu is chosen according to creation order. If there is * more than one, the first correct match is chosen. * * * If the popup menu is found in a parent of the target widget, and * the popup menu must also have XmNpopupEnabled set to * XmPOPUP_AUTOMATIC_RECURSIVE to match. * * 3. Once a selection is made, if the menu's parent widget has a * popupHandlerCallback, it is invoked. The callback allows the user to * determine if a more specific menu is necessary, such as would be the * case in a graphical manipulation environment, and includes all the * necessary information. * * If the user has posted the menu (by clicking the appropriate button) * rather then just a button down, select, button up, then we need to * deal with the unpost and replay semantics of the menu. * * For keyboard events we use the current focus widget instead of the * pointer position and we always post the menu. **************************************************************************/ /*****************************************************************/ /* */ /* New Button Press handler for the Popup menu system and the */ /* associated routines. This code is installed as the event */ /* handler when the type of the Popup menu is */ /* XmPOPUP_AUTOMATIC or XmPOPUP_AUTOMATIC_RECURSIVE. */ /* */ /*****************************************************************/ static Widget lasttarget = (Widget) 0; static void PopupMenuEventHandler(Widget wid, XtPointer poster, XEvent *e, Boolean *cont) { Boolean seen; Widget postWidget; Widget popup; XmPopupHandlerCallbackStruct cb; XmMenuState mst = _XmGetMenuState((Widget) wid); XmRowColumnWidget popupW = (XmRowColumnWidget) poster ; Time _time = _XmGetDefaultTime(wid, e); /* Now look at the event type. It better be a button or key event. Otherwise abort */ if (e -> type != ButtonPress && e -> type != ButtonRelease && e -> type != KeyPress && e -> type != KeyRelease) return; /* First determine if this might have been a replay. This variable gets passed to the callback as the repost field */ seen = (mst->RC_ReplayInfo.time == _time); /* Decide whether this event is a posting event. If it is then we turn cont off to prevent multiple PopupMenuEventHandlers from being invoked on a single event. */ mst->RC_ButtonEventStatus.time = _time; if (e -> type == KeyPress || e -> type == KeyRelease) { mst->RC_ButtonEventStatus.verified = True; } else { mst->RC_ButtonEventStatus.verified = _XmMatchBtnEvent( e, RC_PostEventType(popupW), RC_PostButton(popupW), RC_PostModifiers(popupW)); } /* Add the handler to remove the grab if an error occurs */ if (mst -> RC_ButtonEventStatus.verified) { if (!popupW->core.being_destroyed && !popupW->row_column.popup_workproc) popupW->row_column.popup_workproc = XtAppAddWorkProc(XtWidgetToApplicationContext((Widget) popupW), _XmRC_PostTimeOut, (XtPointer) popupW); mst->RC_ButtonEventStatus.waiting_to_be_managed = TRUE; mst->RC_ButtonEventStatus.event = e -> xbutton; *cont = False; } else /* If this is not a verified event then return */ return; if (e -> type == ButtonPress || e -> type == ButtonRelease) { /* OK. We have a button event on some widget in our hierarchy. Go find the most specific widget */ postWidget = FindBestMatchWidget(wid, e); } else { /* If this is a key event then use the focus data for the most specific widget */ postWidget = XmGetFocusWidget(wid); if (postWidget == (Widget) NULL) postWidget = wid; } /* Now find the right popup */ popup = FindPopupMenu(wid, postWidget, e, 0); /* Construct the callback structure */ _XmProcessLock(); if (seen && (postWidget == lasttarget)) { cb.reason = XmCR_REPOST; cb.postIt = False; } else { cb.reason = XmCR_POST; cb.postIt = True; } lasttarget = postWidget; _XmProcessUnlock(); cb.event = e; cb.menuToPost = popup; cb.target = postWidget; /* Call the callback(s) * * Gadgets have no callback list, hence the callbacks of the manager * widget are called. */ switch (XtHasCallbacks(postWidget, XmNpopupHandlerCallback)) { case XtCallbackNoList: if (XtHasCallbacks(wid, XmNpopupHandlerCallback)) XtCallCallbacks(wid, XmNpopupHandlerCallback, (XtPointer) &cb); break; case XtCallbackHasNone: break; case XtCallbackHasSome: XtCallCallbacks(postWidget, XmNpopupHandlerCallback, (XtPointer) &cb); break; } popup = cb.menuToPost; if (popup != 0 && cb.postIt) { if (RC_TornOff(popup) && !XmIsMenuShell(XtParent(popup))) _XmRestoreTearOffToMenuShell((Widget)popup, e); /* * popups keep active widget in postFromList in cascadeBtn field - * moved here from PositionMenu so XmGetPostedFromWidget set up * BEFORE application's event handler. */ RC_CascadeBtn(popup) = XtParent(XtParent(popup)); if (e -> type == KeyPress || e -> type == KeyRelease) { XmRowColumnClassRec * rc; rc = (XmRowColumnClassRec *)XtClass(popup); (*(rc->row_column_class.armAndActivate)) (popup, e, NULL, NULL); } else { XmMenuPosition(popup, (XButtonPressedEvent *) e); XtManageChild(popup); } } else { /* If we've gotten to here, we decided not to post the menu, so continue to process the event */ *cont = True; } } /*************************************************************** * FindBestMatchWidget walks down to the most specific widget * that matches the event. For each apparent range match, we * check if this matching widget is a composite. Each composite * then pushes a level and determines if a subwidget of the * composite might match the event ***************************************************************/ static Widget FindBestMatchWidget(Widget wid, XEvent* event) { Widget target; Widget possible; CompositeRec *ctarget; int i; int appx, appy; int delx, dely; int done; int found; target = wid; done = 0; /* appx,appy always contain the relative event (x,y) in the current widget being examined */ appx = event -> xbutton.x; appy = event -> xbutton.y; while(done == 0) { if (XtIsComposite(target)) { ctarget = (CompositeRec *) target; found = 0; for(i = 0; i < ctarget -> composite.num_children; i++) { possible = ctarget -> composite.children[i]; if (XtIsManaged(possible)) { delx = appx - XtX(possible); dely = appy - XtY(possible); if (delx >= 0 && delx <= XtWidth(possible) && dely >= 0 && dely <= XtHeight(possible)) { target = possible; appx = delx; appy = dely; found = 1; break; } } } /* Composite with no children or event outside children */ if (found == 0) done = 1; } else done = 1; } return(target); } /*********************************************************** * FindPopupMenu starts at the target widget (at level == 0) * and starts to walk up the widget hierarchy up to the * toplevel widget. * * At each level, the popup list is searched for a popup * menu with the correct menuPost flags and the correct * value of popupEnabled. **********************************************************/ static Widget FindPopupMenu(Widget toplevel, Widget target, XEvent *event, int level) { int i; WidgetRec *thiswid = (WidgetRec *) target; Widget possible = NULL; if (target == NULL) return(NULL); if (! XmIsGadget(target)) { for(i = 0; i < thiswid -> core.num_popups; i++) { possible = thiswid -> core.popup_list[i]; if ((possible = MenuMatches(possible, level, event)) != NULL) break; } if (! possible) { PopupList list = NULL; _XmProcessLock(); if (popup_table) { /* How we could get here without the table being inited is beyond me. But just in case, avoid crashing */ list = (PopupList) _XmGetHashEntry(popup_table, (XmHashKey) target); } _XmProcessUnlock(); if (list) { for(i = 0; i < list -> num_popups; i++) { possible = list -> popups[i]; if ((possible = MenuMatches(possible, level, event)) != NULL) break; } } } } if (possible) return(possible); else if (toplevel != target) return(FindPopupMenu(toplevel, XtParent(target), event, level + 1)); else return((Widget) NULL); } static Widget MenuMatches(Widget menu, int level, XEvent *event) { Boolean found = False; if (XtIsShell(menu) && ((CompositeRec *) menu) -> composite.num_children == 1) { menu = ((CompositeRec *) menu) -> composite.children[0]; if (XmIsRowColumn(menu) && IsPopup(menu) && (((level == 0) && (RC_PopupEnabled(menu) == XmPOPUP_AUTOMATIC)) || (RC_PopupEnabled(menu) == XmPOPUP_AUTOMATIC_RECURSIVE))) /* We have a candidate. It is a popup menu with an appropriate popup enabled value */ { if (event -> type == KeyPress || event -> type == KeyRelease) { found = MatchInKeyboardList((XmRowColumnWidget) menu, (XKeyEvent *) event, 0) != -1; } else { found = _XmMatchBtnEvent(event, RC_PostEventType(menu), RC_PostButton(menu), RC_PostModifiers(menu)); } } } if (found) return(menu); else return((Widget) NULL); } /*Argsused*/ Boolean _XmRC_PostTimeOut( XtPointer wid ) { XmRowColumnWidget popup = (XmRowColumnWidget) wid; XmMenuState mst = _XmGetMenuState((Widget) wid); Time _time = XtLastTimestampProcessed(XtDisplay((Widget) wid)); popup->row_column.popup_workproc = 0; if (mst->RC_ButtonEventStatus.waiting_to_be_managed) { XtUngrabPointer((Widget) popup, _time); mst->RC_ButtonEventStatus.waiting_to_be_managed = FALSE; mst->RC_ButtonEventStatus.verified = FALSE; } return TRUE; } /* * ButtonEventHandler is inserted at the head of the event handlers. We must * pre-verify the events that popup a menupane. When the application manages * the popup menupane, MenuShell's managed_set_changed(), checks the * verification. */ /* ARGSUSED */ static void ButtonEventHandler( Widget w, XtPointer data, XEvent *event, Boolean *cont ) { XmRowColumnWidget popup = (XmRowColumnWidget) data ; XButtonEvent *xbutton_event = (XButtonEvent *)event; XmMenuState mst = _XmGetMenuState((Widget) w); /* * if this event has been seen before, and some other popup has * already marked it as verified, then we don't need to bother with it. */ if ((mst->RC_ButtonEventStatus.time == xbutton_event->time) && (mst->RC_ButtonEventStatus.verified == True)) /* * If this is a torn-off menu, then we should really make sure * that THIS menu, not the tear-off was verified. Otherwise, * there is no way for the menu's client (ie. mwm) to map the * window since it may be currently reparented. */ if ( !RC_TornOff(popup) || !_XmMatchBtnEvent(event, RC_PostEventType(popup), RC_PostButton(popup), RC_PostModifiers(popup)) ) return; mst->RC_ButtonEventStatus.time = xbutton_event->time; mst->RC_ButtonEventStatus.verified = _XmMatchBtnEvent( event, RC_PostEventType(popup), RC_PostButton(popup), RC_PostModifiers(popup)); if (mst->RC_ButtonEventStatus.verified) { XtUngrabPointer((Widget) popup,CurrentTime); mst->RC_ButtonEventStatus.waiting_to_be_managed = TRUE; if (!popup->core.being_destroyed && !popup->row_column.popup_workproc) popup->row_column.popup_workproc = XtAppAddWorkProc(XtWidgetToApplicationContext((Widget) popup), _XmRC_PostTimeOut, (XtPointer) popup); mst->RC_ButtonEventStatus.event = *xbutton_event; if (RC_TornOff(popup) && !XmIsMenuShell(XtParent(popup))) _XmRestoreTearOffToMenuShell((Widget)popup, event); /* * popups keep active widget in postFromList in cascadeBtn field - * moved here from PositionMenu so XmGetPostedFromWidget set up * BEFORE application's event handler. */ RC_CascadeBtn(popup) = XtWindowToWidget(XtDisplay(popup), xbutton_event->window); } } static void AddHandlersToPostFromWidget( Widget popup, Widget widget ) { Cursor cursor; cursor = _XmGetMenuCursorByScreen(XtScreen(popup)); if (RC_PopupEnabled(popup) == XmPOPUP_AUTOMATIC || RC_PopupEnabled(popup) == XmPOPUP_AUTOMATIC_RECURSIVE) XtInsertEventHandler(widget, ButtonPressMask|ButtonReleaseMask, False, PopupMenuEventHandler, (XtPointer) popup, XtListHead); else XtInsertEventHandler(widget, ButtonPressMask|ButtonReleaseMask, False, ButtonEventHandler, (XtPointer) popup, XtListHead); if ((RC_PopupEnabled(popup) == XmPOPUP_AUTOMATIC || RC_PopupEnabled(popup) == XmPOPUP_AUTOMATIC_RECURSIVE)) XtAddEventHandler(widget, KeyPressMask|KeyReleaseMask, False, PopupMenuEventHandler, (XtPointer) popup); else XtAddEventHandler(widget, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) popup); /* * Add an event handler on the associated widget for ButtonRelease * events. This is so that a quick press/release pair does not get * lost if the release is processed before our pointer grab is made. * This will guarantee that the associated widget gets the button * release event; it would be discarded if the widget was not selecting * for button release events. */ XtAddEventHandler(widget, ButtonReleaseMask, False, EventNoop, NULL); /* * Must add a passive grab, so that owner_events is set to True * when the button grab is activated; this is so that enter/leave * events get dispatched by the server to the client. */ XtGrabButton (widget, RC_PostButton(popup), RC_PostModifiers(popup), #ifdef FIX_1412 TRUE, (unsigned int)ButtonReleaseMask, GrabModeAsync, #else TRUE, (unsigned int)ButtonReleaseMask, GrabModeSync, #endif GrabModeSync, None, cursor); } void _XmRC_RemoveHandlersFromPostFromWidget( Widget popup, Widget widget ) { if (RC_PopupEnabled(popup) == XmPOPUP_AUTOMATIC || RC_PopupEnabled(popup) == XmPOPUP_AUTOMATIC_RECURSIVE) XtRemoveEventHandler(widget, ButtonPressMask|ButtonReleaseMask, False, PopupMenuEventHandler, (XtPointer) popup); else XtRemoveEventHandler(widget, ButtonPressMask|ButtonReleaseMask, False, ButtonEventHandler, (XtPointer) popup); XtRemoveEventHandler(widget, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) popup); XtRemoveEventHandler(widget, ButtonReleaseMask, False, EventNoop, NULL); /* Remove our passive grab */ if (!widget->core.being_destroyed) XtUngrabButton (widget, RC_PostButton(popup), AnyModifier); } /* * Add the Popup Menu Event Handlers needed for posting and accelerators */ void _XmRC_AddPopupEventHandlers( XmRowColumnWidget pane ) { int i; /* to myself for gadgets */ XtAddEventHandler( (Widget) pane, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) pane); /* Add to Our shell parent */ XtAddEventHandler(XtParent(pane), KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, pane); /* add to all of the widgets in the postFromList*/ for (i=0; i < pane->row_column.postFromCount; i++) { AddHandlersToPostFromWidget ((Widget) pane, pane->row_column.postFromList[i]); } } /* * Remove the Popup Menu Event Handlers needed for posting and accelerators */ void _XmRC_RemovePopupEventHandlers( XmRowColumnWidget pane ) { int i; /* Remove it from us */ XtRemoveEventHandler((Widget) pane, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) pane); /* Remove it from our shell parent */ XtRemoveEventHandler(XtParent(pane), KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) pane); /* Remove it from the postFrom widgets */ for (i=0; i < pane->row_column.postFromCount; i++) { _XmRC_RemoveHandlersFromPostFromWidget((Widget) pane, pane->row_column.postFromList[i]); } } /* ************************************************************************* * * Semi-public Routines * ************************************************************************* */ /* * _XmPostPopupMenu is intended for use by applications that do their own * event processing/dispatching. This convenience routine makes sure that * the menu system has a crack at verifying the event before MenuShell's * managed_set_changed() routine tries to post the popup. */ void _XmPostPopupMenu( Widget wid, XEvent *event ) { Window saveWindow; XmMenuState mst = _XmGetMenuState((Widget)wid); if (!(wid && XmIsRowColumn(wid) && IsPopup(wid))) return; /* We'll still verify the incoming button event. But for all other cases * we'll just take for granted that the application knows what it's doing * and force the menu to post. */ if (event->type == ButtonPress || event->type == ButtonRelease) { ButtonEventHandler( wid, (XtPointer) wid, event, NULL); /* drand #4973 */ } else { mst->RC_ButtonEventStatus.verified = True; /* This could be trouble if the event type passed in does not have * a time stamp! */ mst->RC_ButtonEventStatus.time = event->xkey.time; mst->RC_ButtonEventStatus.waiting_to_be_managed = True; mst->RC_ButtonEventStatus.event = *((XButtonEvent *)event); } if (mst->RC_ButtonEventStatus.verified) /* sync up Xt timestamp */ { saveWindow = event->xany.window; event->xany.window = 0; XtDispatchEvent(event); event->xany.window = saveWindow; } XtManageChild(wid); } /* When an application uses shared menupanes, enabling accelerators are a * tricky situation. Before now, the application was required to set all * menu-items sensitive when the menu hierarchy unposted. Then when the * activate event arrived, if the event was via an accelerator, internal * verification was done. NOW, with tear offs, this may not be possible. * The application may need to leave menu-items insensitive so that the * tear off acts and looks as desired. In this case, the application * calls this function to pass the events to accelerated insensitive menu * items for its own internal validation. */ void _XmAllowAcceleratedInsensitiveUnmanagedMenuItems( Widget wid, #if NeedWidePrototypes int allowed ) #else Boolean allowed ) #endif /* NeedWidePrototypes */ { _XmGetMenuState((Widget)wid)-> RC_allowAcceleratedInsensitiveUnmanagedMenuItems = (Boolean)allowed; } /*ARGSUSED*/ static void EventNoop( Widget reportingWidget, /* unused */ XtPointer data, /* unused */ XEvent *event, /* unused */ Boolean *cont ) /* unused */ { /* * Do nothing; the purpose is to override the actions taken by the * Primitive translations. */ } /* * This is the event handler which catches, verifies and dispatches all * accelerators and mnemonics defined for a given menu hierarchy. It * is attached to the menu's associated widget, along with an assortment * of other widgets. */ /*ARGSUSED*/ void _XmRC_KeyboardInputHandler( Widget reportingWidget, XtPointer data, XEvent *event, Boolean *cont ) /* unused */ { XmRowColumnWidget topLevel = (XmRowColumnWidget) data; ShellWidget topLevelShell = (ShellWidget)XtParent(topLevel); XmMenuState mst = _XmGetMenuState((Widget)topLevel); /* Process the event only if not already processed */ if (!_XmIsEventUnique(event)) return; if (IsBar(topLevel) || IsOption(topLevel)) if (! AllWidgetsAccessible((Widget) topLevel)) return; /* * XmGetPostFromWidget() requires help to identify the topLevel widget * when a menupane is posted via accelerators. */ if (IsBar(topLevel) || IsOption(topLevel)) mst->RC_LastSelectToplevel = (Widget) topLevel; else if ((IsPopup(topLevel) || IsPulldown(topLevel)) && !XmIsMenuShell(topLevelShell) && XmeFocusIsInShell((Widget)topLevel)) mst->RC_LastSelectToplevel = topLevel->row_column.tear_off_lastSelectToplevel; else if (IsPopup(topLevel)) { /* If the popup is already posted, lastSelectToplevel already set! */ if (!(XmIsMenuShell(topLevelShell) && topLevelShell->shell.popped_up)) mst->RC_LastSelectToplevel = reportingWidget; /* popup */ } else mst->RC_LastSelectToplevel = NULL; ProcessKey (topLevel, event); /* reset toplevel "accelerator" state to NULL */ mst->RC_LastSelectToplevel = NULL; } /* * try to find a match in the menu for the key event. Cascade down the * submenus if necessary */ static Boolean ProcessKey( XmRowColumnWidget rowcol, XEvent *event ) { Boolean found = FALSE; int i; Widget child; Widget SaveCascadeButton; /* Try to use it on the current rowcol */ if (! CheckKey (rowcol, event)) { /* not used, try moving down the cascade */ for (i=0; (i < rowcol->composite.num_children) && (! found); i++) { child = rowcol->composite.children[i]; /* only check sensitive and managed cascade buttons */ if (XtIsSensitive(child) && XtIsManaged(child)) { if (XmIsCascadeButtonGadget(child)) { if (CBG_Submenu(child)) { SaveCascadeButton = RC_CascadeBtn(CBG_Submenu(child)); /* Build the menu cascade for menuHistory */ RC_CascadeBtn(CBG_Submenu(child)) = child; found = ProcessKey((XmRowColumnWidget) ((XmCascadeButtonGadget)child)->cascade_button.submenu, event); /* Restore the cascade button / submenu link in case of * shared menupanes. */ if (!found) RC_CascadeBtn(CBG_Submenu(child)) = SaveCascadeButton; } } else if (XmIsCascadeButton(child)) { if (CB_Submenu(child)) { SaveCascadeButton = RC_CascadeBtn(CB_Submenu(child)); RC_CascadeBtn(CB_Submenu(child)) = child; found = ProcessKey((XmRowColumnWidget) ((XmCascadeButtonWidget)child)->cascade_button.submenu, event); if (!found) RC_CascadeBtn(CB_Submenu(child)) = SaveCascadeButton; } } } } return (found); } else return (True); } /* * Check if the key event is used in the rowcol */ static Boolean CheckKey( XmRowColumnWidget rowcol, XEvent *event ) { int menu_index = 0; XmKeyboardData * entry; ShellWidget shell; /* Process all matching key events */ while ((menu_index = MatchInKeyboardList(rowcol, (XKeyEvent *) event, menu_index)) != -1) { entry = MGR_KeyboardList(rowcol) + menu_index; /* Ignore this entry if it is not accessible to the user */ if (XmIsRowColumn(entry->component)) { /* * Rowcols are not accessible if they are insensitive or * if menubars or optionmenus are unmanaged. */ if (! XtIsSensitive(entry->component) || ((RC_Type(entry->component) != XmMENU_POPUP) && (RC_Type(entry->component) != XmMENU_PULLDOWN) && (! XtIsManaged(entry->component)))) { menu_index++; continue; } } else if (((XmIsMenuShell(XtParent(rowcol)) && ((XmMenuShellWidget)XtParent(rowcol))->shell.popped_up) || !_XmGetMenuState((Widget)rowcol)-> RC_allowAcceleratedInsensitiveUnmanagedMenuItems) && (!XtIsSensitive(entry->component) || !XtIsManaged(entry->component))) { /* In general, insensitive or unmanaged buttons are not accessible. * However, to support shared menupanes, we will allow applications to * pass all accelerated items through, regardless of senstivity/managed. * EXCEPT when the pane is posted, and then sensitivity is presumed * valid. * (The individual menu items also checks if the tear off has the focus.) */ menu_index++; continue; } /* * For a mnemonic, the associated component must be visible, and * it must be in the last menupane posted. * This only needs to be checked for a popup or pulldown menu pane. */ if (entry->isMnemonic) { if (XmeTraitGet((XtPointer) XtClass(entry->component), XmQTmenuSavvy) != NULL) { if (IsBar(XtParent(entry->component)) && ! RC_PopupPosted(XtParent(entry->component)) && ((XmManagerWidget) XtParent(entry->component))-> manager.active_child == NULL) { menu_index++; continue; } else if (IsPopup(XtParent(entry->component)) || IsPulldown(XtParent(entry->component))) { /* See if the associated shell is visible */ shell = (ShellWidget)XtParent(XtParent(entry->component)); /* * Verify the pane is popped up, and the active pane is our * parent (this is necessary because of shared menupanes. */ if ((!shell->shell.popped_up) || (shell->composite.children[0] != XtParent(entry->component))) { menu_index++; continue; } /* Verify we are the last pane */ if (RC_PopupPosted(shell->composite.children[0])) { menu_index++; continue; } } } else if (XmIsRowColumn(entry->component)) { /* * Ignore the posting mnemonic for an option menu, if its * menupane is already posted. */ if (RC_PopupPosted(entry->component)) { menu_index++; continue; } } } /* Key event - make sure we're not in drag mode */ _XmSetInDragMode(entry->component, False); /* Fix 7766, Ungrab the keyboard. This seems to be necessary to avoid focus problems in some cases where the activate callback does "fancy" things like tracking locate. Strictly speaking the ungrab shouldn't be necessary */ if (XmIsGadget(entry->component)) XtUngrabKeyboard(XtParent(entry->component), CurrentTime); else XtUngrabKeyboard(entry->component, CurrentTime); /* Perform the action associated with the keyboard event */ if (XmIsPrimitive(entry->component)) { XmPrimitiveClassRec * prim; prim = (XmPrimitiveClassRec *)XtClass(entry->component); (*(prim->primitive_class.arm_and_activate)) (entry->component, event, NULL, NULL); } else if (XmIsGadget(entry->component)) { XmGadgetClassRec * gadget; gadget = (XmGadgetClassRec *)XtClass(entry->component); (*(gadget->gadget_class.arm_and_activate)) (entry->component, event, NULL, NULL); } else if (XmIsRowColumn(entry->component)) { XmRowColumnClassRec * rc; rc = (XmRowColumnClassRec *)XtClass(entry->component); (*(rc->row_column_class.armAndActivate)) (entry->component, event, NULL, NULL); } /* used the key */ _XmRecordEvent(event); return (True); } /* did not use the key */ return (False); } /* * This function searches the list of keyboard events associated with the * specified row column widget to see if any of them match the * passed in X event. This function can be called multiple times, to get * all entries which match. */ static int MatchInKeyboardList( XmRowColumnWidget rowcol, XKeyEvent *event, int startIndex ) { XmKeyboardData * klist = MGR_KeyboardList(rowcol); int count = MGR_NumKeyboardEntries(rowcol); int i; if (klist == NULL) return(-1); for (i = startIndex; i < count; i++) { /* * We want to ignore shift and shift-lock for mnemonics. So, OR the * event's two bits with the (previously two bits initialized to zero) * klist.modifier * * If the .key field is 1, then we have delayed calling XKeysymToKeycode * until now. */ if (klist[i].key == 1) klist[i].key = XKeysymToKeycode(XtDisplay(rowcol), klist[i].keysym); if (klist[i].key != NoSymbol) { if (_XmMatchKeyEvent((XEvent *) event, klist[i].eventType, klist[i].key, klist[i].isMnemonic ? klist[i].modifiers | (event->state & (ShiftMask | LockMask)) : klist[i].modifiers)) { return(i); } } } /* No match */ return (-1); } /* * This function determines if the widget to which a menu is * attached is accessible to the user. The widget is considered * accessible if it, and its ancestors, are both sensitive and * managed. This is useful for MenuBars and Option Menus only. */ static Boolean AllWidgetsAccessible( Widget w ) { while (w && XtParent(w) && !XtIsShell(w)) { if (!XtIsSensitive(w) || !XtIsManaged(w) || !w->core.mapped_when_managed) return (False); w = XtParent(w); } return (True); } /* * search the postFromList and return the index of the found widget. If it * is not found, return -1 * * This function is duplicated from RCMenu.c. */ static int OnPostFromList( XmRowColumnWidget menu, Widget widget ) { int i; for (i = 0; i < menu->row_column.postFromCount; i++) { if (menu->row_column.postFromList[i] == widget) return (i); } return (-1); } /************************************************************************ * * XmAddToPostFromList and XmRemoveFromPostFromList * ************************************************************************/ void XmAddToPostFromList( Widget m, Widget widget ) { XmRowColumnWidget menu = (XmRowColumnWidget) m ; Arg args[1]; _XmWidgetToAppContext(m); _XmAppLock(app); /* only continue if its a valid widget and a popup or pulldown menu */ if (! XmIsRowColumn(menu) || ! (IsPopup(menu) || IsPulldown(menu)) || ! widget) { _XmAppUnlock(app); return; } if (OnPostFromList(menu, widget) == -1) { /* The first section of this code, new in 2.0, places the popup information in a secondary list so we can find it when doing automatic popup behavior */ PopupList list; /* Add to associated popup data for widget */ _XmProcessLock(); if (! popup_table) { popup_table = _XmAllocHashTable(100, NULL, NULL); } /* See if we have an associated table. If not, create one. */ if ((list = (PopupList) _XmGetHashEntry(popup_table, (XmHashKey) widget)) == NULL) { /* Resize if the table has many more entries than slots */ if (_XmHashTableCount(popup_table) > (2 * _XmHashTableSize(popup_table))) _XmResizeHashTable(popup_table, 2 * _XmHashTableSize(popup_table)); list = (PopupList) XtMalloc(sizeof(PopupListRec)); list -> popups = (WidgetList) NULL; list -> num_popups = 0; _XmAddHashEntry(popup_table, (XmHashKey) widget, (XtPointer) list); XtAddCallback(widget, XtNdestroyCallback, RemoveTable, NULL); } _XmProcessUnlock(); /* Add to list, we add the menu's shell parent */ list -> popups = (WidgetList) XtRealloc((char*) list -> popups, sizeof(Widget) * (list -> num_popups + 1)); list -> popups[list -> num_popups] = XtParent(m); list -> num_popups++; if (IsPulldown(menu)) { XtSetArg (args[0], XmNsubMenuId, menu); XtSetValues (widget, args, 1); } else { _XmRC_AddToPostFromList (menu, widget); AddHandlersToPostFromWidget ((Widget) menu, widget); _XmRC_DoProcessMenuTree ((Widget)menu, XmADD); } } _XmAppUnlock(app); } void XmRemoveFromPostFromList( Widget m, Widget widget ) { XmRowColumnWidget menu = (XmRowColumnWidget) m ; Arg args[1]; _XmWidgetToAppContext(m); _XmAppLock(app); /* only continue if its a valid widget and a popup or pulldown menu */ if (! XmIsRowColumn(menu) || ! (IsPopup(menu) || IsPulldown(menu)) || ! widget) { _XmAppUnlock(app); return; } if ((OnPostFromList(menu, widget)) != -1) { PopupList list; _XmProcessLock(); if (popup_table) { int i, j; /* How we could get here without the table being inited is beyond me. But just in case, avoid crashing */ list = (PopupList) _XmGetHashEntry(popup_table, (XmHashKey) widget); /* Remove from associated list */ for(i = 0; i < list -> num_popups;) { if (list -> popups[i] == XtParent(m)) { /* First shift all the remaining elements */ for(j = i; j < list -> num_popups - 1; j++) { list -> popups[j] = list -> popups[j + 1]; } list -> num_popups--; } else { i++; } } } _XmProcessUnlock(); if (IsPulldown(menu)) { XtSetArg (args[0], XmNsubMenuId, NULL); XtSetValues (widget, args, 1); } else { _XmRC_RemoveFromPostFromList (menu, widget); _XmRC_RemoveHandlersFromPostFromWidget ((Widget) menu, widget); _XmRC_DoProcessMenuTree ((Widget)menu, XmDELETE); } } _XmAppUnlock(app); } /*ARGSUSED*/ static void RemoveTable(Widget w, XtPointer ig1, /* unused */ XtPointer ig2) /* unused */ { PopupList list; _XmProcessLock(); list = (PopupList) _XmGetHashEntry(popup_table, (XmHashKey) w); _XmRemoveHashEntry(popup_table, (XmHashKey) w); XtFree((char*) list -> popups); XtFree((char*) list); _XmProcessUnlock(); } motif-2.3.8/lib/Xm/ArrowBGP.h0000644000175000017500000001120013145162623012506 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmArrowGadgetP_h #define _XmArrowGadgetP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Arrow class structure */ typedef struct _XmArrowButtonGadgetClassPart { XtPointer extension; } XmArrowButtonGadgetClassPart; /* Full class record declaration for Arrow class */ typedef struct _XmArrowButtonGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmArrowButtonGadgetClassPart arrow_button_class; } XmArrowButtonGadgetClassRec; externalref XmArrowButtonGadgetClassRec xmArrowButtonGadgetClassRec; /* The Arrow instance record */ typedef struct _XmArrowButtonGadgetPart { XtCallbackList activate_callback; XtCallbackList arm_callback; XtCallbackList disarm_callback; unsigned char direction; /* The direction the arrow is pointing. */ Boolean selected; short top_count; short cent_count; short bot_count; XRectangle *top; XRectangle *cent; XRectangle *bot; Position old_x; Position old_y; GC arrow_GC; XtIntervalId timer; unsigned char multiClick; /* KEEP/DISCARD resource */ int click_count; GC insensitive_GC; GC background_GC; GC top_shadow_GC; GC bottom_shadow_GC; GC highlight_GC; Pixel foreground; Pixel background; Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; Pixel highlight_color; Pixmap highlight_pixmap; Boolean fill_bg_box; Dimension detail_shadow_thickness ; } XmArrowButtonGadgetPart; /* Full instance record declaration */ typedef struct _XmArrowButtonGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmArrowButtonGadgetPart arrowbutton; } XmArrowButtonGadgetRec; #define ArrowBG_BackgroundGC(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. background_GC) #define ArrowBG_TopShadowGC(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. top_shadow_GC) #define ArrowBG_BottomShadowGC(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. bottom_shadow_GC) #define ArrowBG_HighlightGC(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. highlight_GC) #define ArrowBG_Foreground(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. foreground) #define ArrowBG_Background(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. background) #define ArrowBG_TopShadowColor(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. top_shadow_color) #define ArrowBG_TopShadowPixmap(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. top_shadow_pixmap) #define ArrowBG_BottomShadowColor(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. bottom_shadow_color) #define ArrowBG_BottomShadowPixmap(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. bottom_shadow_pixmap) #define ArrowBG_HighlightColor(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. highlight_color) #define ArrowBG_HighlightPixmap(w) (((XmArrowButtonGadget)(w)) -> \ arrowbutton. highlight_pixmap) /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmArrowGadgetP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TravActI.h0000644000175000017500000001143113145162623012546 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTravActI_h #define _XmTravActI_h #include #ifdef __cplusplus extern "C" { #endif #define XmFOCUS_RESET 1<<0 #define XmFOCUS_IGNORE 1<<1 /******** Private Function Declarations ********/ extern unsigned short _XmGetFocusFlag( Widget w, unsigned int mask) ; extern void _XmSetFocusFlag( Widget w, unsigned int mask, #if NeedWidePrototypes int value ) ; #else Boolean value ) ; #endif /* NeedWidePrototypes */ extern void _XmTrackShellFocus( Widget widget, XtPointer client_data, XEvent *event, Boolean *dontSwallow) ; extern void _XmPrimitiveEnter( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveLeave( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveUnmap( Widget pw, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveFocusInInternal( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveFocusOut( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmPrimitiveFocusIn( Widget pw, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmEnterGadget( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmLeaveGadget( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmFocusInGadget( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmFocusOutGadget( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmManagerEnter( Widget wid, XEvent *event_in, String *params, Cardinal *num_params) ; extern void _XmManagerLeave( Widget wid, XEvent *event_in, String *params, Cardinal *num_params) ; extern void _XmManagerFocusInInternal( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmManagerFocusIn( Widget mw, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmManagerFocusOut( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmManagerUnmap( Widget mw, XEvent *event, String *params, Cardinal *num_params) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTravActI_h */ motif-2.3.8/lib/Xm/TextOut.c0000644000175000017500000056370713145162623012522 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TextOut.c /main/41 1999/08/12 11:37:30 vipin $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "ImageCachI.h" #include "MessagesI.h" #include "ScreenI.h" #include "ScrollFramTI.h" #include "TextI.h" #include "TextInI.h" #include "TextOutI.h" #include "TraversalI.h" #include "XmI.h" #ifdef PRINTING_SUPPORTED #include /* for XmIsPrintShell */ #endif #ifdef USE_XFT #include "XmRenderTI.h" #endif #include #define MSG1 _XmMMsgTextOut_0000 #define MSG2 _XmMMsgTextF_0001 #define MSG3 _XmMMsgTextF_0002 #define MSG4 _XmMMsgTextF_0003 #define XmDYNAMIC_BOOL ((Boolean) (255)) /******** Static Function Declarations ********/ static void SliderMove(Widget w, XtPointer closure, XtPointer call_data); static void _XmTextDrawShadow(XmTextWidget tw); static void SetFullGC(XmTextWidget tw, GC gc); static void GetRect(XmTextWidget tw, XRectangle *rect); static void SetMarginGC(XmTextWidget tw, GC gc); static void SetNormGC(XmTextWidget tw, GC gc, #if NeedWidePrototypes int change_stipple, int stipple); #else Boolean change_stipple, Boolean stipple); #endif /* NeedWidePrototypes */ #ifdef FIX_1381 static void SetShadowGC(XmTextWidget tw, GC gc); #endif static void InvertImageGC(XmTextWidget tw); static void SetInvGC(XmTextWidget tw, GC gc); static int _FontStructFindWidth(XmTextWidget tw, int x, XmTextBlock block, int from, int to); static int FindWidth(XmTextWidget tw, int x, XmTextBlock block, int from, int to); static XmTextPosition XYToPos(XmTextWidget tw, #if NeedWidePrototypes int x, int y); #else Position x, Position y); #endif /* NeedWidePrototypes */ static Boolean PosToXY(XmTextWidget tw, XmTextPosition position, Position *x, Position *y); static XtGeometryResult TryResize(XmTextWidget tw, #if NeedWidePrototypes int width, int height); #else Dimension width, Dimension height); #endif /* NeedWidePrototypes */ static int CountLines(XmTextWidget tw, XmTextPosition start, XmTextPosition end); static void TextFindNewWidth(XmTextWidget tw, Dimension *widthRtn); static void TextFindNewHeight(XmTextWidget tw, XmTextPosition position, Dimension *heightRtn); static void CheckForNewSize(XmTextWidget tw, XmTextPosition position); static XtPointer OutputBaseProc(Widget tw, XtPointer client_data); static Boolean MeasureLine(XmTextWidget tw, LineNum line, XmTextPosition position, XmTextPosition *nextpos, LineTableExtra *extra); static void Draw(XmTextWidget tw, LineNum line, XmTextPosition start, XmTextPosition end, XmHighlightMode highlight); static OnOrOff CurrentCursorState(XmTextWidget tw); static void PaintCursor(XmTextWidget tw); static void ChangeHOffset(XmTextWidget tw, int newhoffset, #if NeedWidePrototypes int redisplay_hbar); #else Boolean redisplay_hbar); #endif /* NeedWidePrototypes */ static void ChangeVOffset(XmTextWidget tw, int newvoffset, #if NeedWidePrototypes int redisplay_vbar); #else Boolean redisplay_vbar); #endif /* NeedWidePrototypes */ static void DrawInsertionPoint(XmTextWidget tw, XmTextPosition position, OnOrOff onoroff); static void MakePositionVisible(XmTextWidget tw, XmTextPosition position); static void BlinkInsertionPoint(XmTextWidget tw); static Boolean MoveLines(XmTextWidget tw, LineNum fromline, LineNum toline, LineNum destline); static void OutputInvalidate(XmTextWidget tw, XmTextPosition position, XmTextPosition topos, long delta); static void RefigureDependentInfo(XmTextWidget tw); static void SizeFromRowsCols(XmTextWidget tw, Dimension *width, Dimension *height); static Boolean LoadFontMetrics(XmTextWidget tw); static void LoadGCs(XmTextWidget tw, Pixel background, Pixel foreground); static void MakeIBeamOffArea(XmTextWidget tw, #if NeedWidePrototypes int width, int height); #else Dimension width, Dimension height); #endif /* NeedWidePrototypes */ static Pixmap FindPixmap(Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth); static void MakeIBeamStencil(XmTextWidget tw, int line_width); static void MakeAddModeCursor(XmTextWidget tw, int line_width); static void MakeCursors(XmTextWidget tw); static void OutputGetValues(Widget wid, ArgList args, Cardinal num_args); static Boolean CKCols(ArgList args, Cardinal num_args); static Boolean CKRows(ArgList args, Cardinal num_args); static Boolean OutputSetValues(Widget oldw, Widget reqw, Widget new_w, ArgList args, Cardinal *num_args); static void NotifyResized(Widget w, #if NeedWidePrototypes int o_create); #else Boolean o_create); #endif /* NeedWidePrototypes */ static void HandleTimer(XtPointer closure, XtIntervalId *id); static void HandleFocusEvents(Widget w, XtPointer closure, XEvent *event, Boolean *cont); static void HandleGraphicsExposure(Widget w, XtPointer closure, XEvent *event, Boolean *cont); static void OutputRealize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes); static void OutputDestroy(Widget w); static void RedrawRegion(XmTextWidget tw, int x, int y, int width, int height); static void OutputExpose(Widget w, XEvent *event, Region region); static void GetPreferredSize(Widget widget, Dimension *width, Dimension *height); static void HandleVBarButtonRelease(Widget w, XtPointer closure, XEvent *event, Boolean *cont); static void HandleHBarButtonRelease(Widget w, XtPointer closure, XEvent *event, Boolean *cont); static int _FontStructFindHeight(XmTextWidget tw, int x, XmTextBlock block, int from, int to); static int FindHeight(XmTextWidget tw, int x, XmTextBlock block, int from, int to); static Boolean _FontStructPerCharExtents(XmTextWidget tw, char *str, int length, XCharStruct *overall); static Boolean SetXOCOrientation(XmTextWidget tw, XOC om, XOrientation orientation); static void CursorPosVisDefault( Widget widget, int offset, XrmValue *value) ; /******** End Static Function Declarations ********/ #define EraseInsertionPoint(tw)\ (*tw->text.output->DrawInsertionPoint)(tw,\ tw->text.cursor_position, off) #define TextDrawInsertionPoint(tw)\ (*tw->text.output->DrawInsertionPoint)(tw,\ tw->text.cursor_position, on) static XmTextWidget posToXYCachedWidget = NULL; static XmTextPosition posToXYCachedPosition; static Position posToXYCachedX; static Position posToXYCachedY; static XtResource output_resources[] = { { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(OutputDataRec, fontlist), XmRImmediate, (XtPointer)NULL }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(OutputDataRec, rendertable), XmRImmediate, (XtPointer)NULL }, { XmNwordWrap, XmCWordWrap, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, wordwrap), XmRImmediate, (XtPointer) False }, { XmNblinkRate, XmCBlinkRate, XmRInt, sizeof(int), XtOffsetOf(struct _OutputDataRec, blinkrate), XmRImmediate, (XtPointer) 500 }, { XmNcolumns, XmCColumns, XmRShort, sizeof(short), XtOffsetOf(struct _OutputDataRec, columns), XmRImmediate, (XtPointer) 0 }, { XmNrows, XmCRows, XmRShort, sizeof(short), XtOffsetOf(struct _OutputDataRec, rows), XmRImmediate, (XtPointer) 0 }, { XmNresizeWidth, XmCResizeWidth, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, resizewidth), XmRImmediate, (XtPointer) False }, { XmNresizeHeight, XmCResizeHeight, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, resizeheight), XmRImmediate, (XtPointer) False }, { XmNscrollVertical, XmCScroll, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, scrollvertical), XmRImmediate,(XtPointer) True }, { XmNscrollHorizontal, XmCScroll, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, scrollhorizontal), XmRImmediate, (XtPointer) True }, { XmNscrollLeftSide, XmCScrollSide, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, scrollleftside), XmRImmediate,(XtPointer) XmDYNAMIC_BOOL }, { XmNscrollTopSide, XmCScrollSide, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, scrolltopside), XmRImmediate, (XtPointer) False }, { XmNcursorPositionVisible, XmCCursorPositionVisible, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _OutputDataRec, cursor_position_visible), XmRCallProc, (XtPointer) CursorPosVisDefault }, }; /********************************************************************* * * CursorPosVisDefault * * *********************************************************************/ /*ARGSUSED*/ static void CursorPosVisDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { static Boolean cursor_pos_vis ; Widget print_shell ; value->addr = (XPointer) &cursor_pos_vis; print_shell = widget ; while(print_shell && !XmIsPrintShell(print_shell)) print_shell = XtParent(print_shell); if (print_shell) cursor_pos_vis = False ; else cursor_pos_vis = True ; } /*ARGSUSED*/ void _XmTextFreeContextData(Widget w, /* unused */ XtPointer clientData, XtPointer callData) /* unused */ { XmTextContextData ctx_data = (XmTextContextData) clientData; Display *display = DisplayOfScreen(ctx_data->screen); XtPointer data_ptr; if (XFindContext(display, (Window) ctx_data->screen, ctx_data->context, (char **) &data_ptr)) { if (ctx_data->type != '\0') { if (data_ptr) XtFree((char *) data_ptr); } XDeleteContext (display, (Window) ctx_data->screen, ctx_data->context); } XtFree ((char *) ctx_data); } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ static void _XmTextDrawShadow(XmTextWidget tw) { if (XtIsRealized((Widget)tw)) { if (tw->primitive.shadow_thickness > 0) XmeDrawShadows (XtDisplay (tw), XtWindow (tw), tw->primitive.bottom_shadow_GC, tw->primitive.top_shadow_GC, tw->primitive.highlight_thickness, tw->primitive.highlight_thickness, tw->core.width - 2 * tw->primitive.highlight_thickness, tw->core.height - 2 * tw->primitive.highlight_thickness, tw->primitive.shadow_thickness, XmSHADOW_OUT); if (tw->primitive.highlighted) { (*(((XmPrimitiveWidgetClass) XtClass((Widget)tw)) ->primitive_class.border_highlight))((Widget)tw); } else { (*(((XmPrimitiveWidgetClass) XtClass((Widget)tw)) ->primitive_class.border_unhighlight))((Widget)tw); } } } /* ARGSUSED */ void _XmTextResetClipOrigin(XmTextWidget tw, XmTextPosition position, #if NeedWidePrototypes int clip_mask_reset) #else Boolean clip_mask_reset) #endif /* NeedWidePrototypes */ { OutputData data = tw->text.output->data; int x, y; Position x_pos, y_pos; if (!XtIsRealized((Widget)tw)) return; if (!PosToXY(tw, tw->text.cursor_position, &x_pos, &y_pos)) return; x = (int) x_pos; y = (int) y_pos; x -=(data->cursorwidth >> 1) + 1; y = (y + data->font_descent) - data->cursorheight; XSetTSOrigin(XtDisplay((Widget)tw), data->imagegc, x, y); } static void SetFullGC(XmTextWidget tw, GC gc) { XRectangle ClipRect; ClipRect.x = tw->primitive.highlight_thickness + tw->primitive.shadow_thickness; ClipRect.y = tw->primitive.highlight_thickness + tw->primitive.shadow_thickness; ClipRect.width = tw->core.width - (2 *(tw->primitive.highlight_thickness + tw->primitive.shadow_thickness)); ClipRect.height = tw->core.height - (2 *(tw->primitive.highlight_thickness + tw->primitive.shadow_thickness)); XSetClipRectangles(XtDisplay(tw), gc, 0, 0, &ClipRect, 1, Unsorted); } static void GetRect(XmTextWidget tw, XRectangle *rect) { Dimension margin_width = tw->text.margin_width + tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; Dimension margin_height = tw->text.margin_height + tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; if (margin_width < tw->core.width) rect->x = margin_width; else rect->x = tw->core.width; if (margin_height < tw->core.height) rect->y = margin_height; else rect->y = tw->core.height; if ((int) (2 * margin_width) < (int) tw->core.width) rect->width = (int) tw->core.width - (2 * margin_width); else rect->width = 0; if ((int) (2 * margin_height) < (int) tw->core.height) rect->height = (int) tw->core.height - (2 * margin_height); else rect->height = 0; } static void SetMarginGC(XmTextWidget tw, GC gc) { XRectangle ClipRect; GetRect(tw, &ClipRect); #ifdef USE_XFT if (tw->text.output->data->use_xft) _XmXftSetClipRectangles(XtDisplay(tw), XtWindow(tw), 0, 0, &ClipRect, 1); #endif XSetClipRectangles(XtDisplay(tw), gc, 0, 0, &ClipRect, 1, Unsorted); } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ /* * Set new clipping rectangle for text widget. This is * done on each focus in event since the text widgets * share the same GC. */ void _XmTextAdjustGC(XmTextWidget tw) { OutputData data = tw->text.output->data; unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; if (!XtIsRealized((Widget)tw)) return; SetMarginGC(tw, data->gc); /* Restore cached text gc to state correct for this instantiation */ if (data->gc) { values.foreground = tw->primitive.foreground ^ tw->core.background_pixel; values.background = 0; XChangeGC(XtDisplay(tw), data->gc, valueMask, &values); } } static void SetNormGC(XmTextWidget tw, GC gc, #if NeedWidePrototypes int change_stipple, int stipple) #else Boolean change_stipple, Boolean stipple) #endif /* NeedWidePrototypes */ { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; OutputData data = tw->text.output->data; values.foreground = tw->primitive.foreground; values.background = tw->core.background_pixel; if (change_stipple) { valueMask |= GCFillStyle; if (stipple) { #ifdef FIX_1381 /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor((Widget)tw); values.fill_style = FillSolid; #else values.fill_style = FillStippled; valueMask |= GCStipple; values.stipple = data->stipple_tile; #endif } else values.fill_style = FillSolid; } XChangeGC(XtDisplay(tw), gc, valueMask, &values); } #ifdef FIX_1381 static void SetShadowGC(XmTextWidget tf, GC gc) { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; /*generally light gray insensitive foreground (instead stipple)*/ values.foreground = tf->primitive.top_shadow_color; values.background = tf->core.background_pixel; values.fill_style = FillSolid; XChangeGC(XtDisplay(tf), gc, valueMask, &values); } #endif static void InvertImageGC(XmTextWidget tw) { OutputData data = tw->text.output->data; data->have_inverted_image_gc = !data->have_inverted_image_gc; } static void SetInvGC(XmTextWidget tw, GC gc) { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; values.foreground = tw->core.background_pixel; values.background = tw->primitive.foreground; XChangeGC(XtDisplay(tw), gc, valueMask, &values); } static int _FontStructFindWidth(XmTextWidget tw, int x, /* Starting position (needed for tabs) */ XmTextBlock block, int from, /* How many bytes in to start measuring */ int to) /* How many bytes in to stop measuring */ { OutputData data = tw->text.output->data; XFontStruct *font = data->font; char *ptr; unsigned char c; int i, csize; int result = 0; if (tw->text.char_size != 1) { int dummy; XCharStruct overall; for (i = from, ptr = block->ptr + from; i < to; i +=csize, ptr += csize) { #ifndef NO_MULTIBYTE csize = mblen(ptr, tw->text.char_size); #else csize = *ptr ? 1 : 0; #endif if (csize <= 0) break; c = (unsigned char) *ptr; if (csize == 1) { if (c == '\t') { result += (data->tabwidth - ((x + result - data->leftmargin) % data->tabwidth)); } else { if (font->per_char && (c >= font->min_char_or_byte2 && c <= font->max_char_or_byte2)) result += font->per_char[c - font->min_char_or_byte2].width; else result += font->min_bounds.width; } } else { if (_XmIsISO10646(XtDisplay(tw), data->font)) { size_t ucsstr_len = 0; XChar2b *ucsstr = _XmUtf8ToUcs2(ptr, csize, &ucsstr_len); XTextExtents16(data->font, ucsstr, ucsstr_len, &dummy, &dummy, &dummy, &overall); XFree(ucsstr); } else XTextExtents(data->font, ptr, csize, &dummy, &dummy, &dummy, &overall); result += overall.width; } } } else { for (i=from, ptr = block->ptr + from; itabwidth - ((x + result - data->leftmargin) % data->tabwidth)); /* %%% Do something for non-printing? */ else { if (font->per_char) { if (c >= font->min_char_or_byte2 && c <= font->max_char_or_byte2) result += font->per_char[c - font->min_char_or_byte2].width; else if (font->default_char >= font->min_char_or_byte2 && font->default_char <= font->max_char_or_byte2) result += font->per_char[font->default_char - font->min_char_or_byte2].width; else result += font->min_bounds.width; } else result += font->min_bounds.width; } } } return result; } static int FindWidth(XmTextWidget tw, int x, /* Starting position (needed for tabs) */ XmTextBlock block, int from, /* How many bytes in to start measuring */ int to) /* How many bytes in to stop measuring */ { OutputData data = tw->text.output->data; char *ptr; unsigned char c; int result = 0; int tmp; int csize = 1; int i; #if USE_XFT if (!data->use_fontset && !data->use_xft) #else if (!data->use_fontset) #endif return _FontStructFindWidth(tw, x, block, from, to); if (to > block->length) to = block->length; if (from > to) { tmp = to; to = from; from = tmp; } if (to == from || to == 0) return 0; if (tw->text.char_size != 1) { for (i = from, ptr = block->ptr + from; i < to; i +=csize, ptr += csize) { #ifndef NO_MULTIBYTE csize = mblen(ptr, tw->text.char_size); #else csize = *ptr ? 1 : 0; #endif if (csize <= 0) break; c = (unsigned char) *ptr; if (csize == 1 && c == '\t') result += (data->tabwidth - ((x + result - data->leftmargin) % data->tabwidth)); else #ifdef USE_XFT if (data->use_xft) { XGlyphInfo ext; XftTextExtentsUtf8(XtDisplay(tw), ((XftFont*)data->font), (FcChar8*)ptr, csize, &ext); result += ext.xOff; } else #endif result += XmbTextEscapement((XFontSet)data->font, ptr, csize); } } else { /* no need to pay for mblen if we know all chars are 1 byte */ for (i = from, ptr = block->ptr + from; i < to; i++, ptr++) { c = (unsigned char) *ptr; if (c == '\t') result += (data->tabwidth - ((x + result - data->leftmargin) % data->tabwidth)); else #ifdef USE_XFT if (data->use_xft) { XGlyphInfo ext; XftTextExtentsUtf8(XtDisplay(tw), ((XftFont*)data->font), (FcChar8*)ptr, 1, &ext); result += ext.xOff; } else #endif result += XmbTextEscapement((XFontSet)data->font, ptr, 1); } } return result; } static int _FontStructFindHeight(XmTextWidget tw, int y, /* Starting position (needed for tabs) */ XmTextBlock block, int from, /* How many bytes in to start measuring */ int to) /* How many bytes in to stop measuring */ { OutputData data = tw->text.output->data; XFontStruct *font = data->font; char *ptr = NULL; unsigned char c; int i = 0, csize = 0; int result = 0; XCharStruct overall; if (tw->text.char_size != 1) { for (i = from, ptr = block->ptr + from; i < to; i +=csize, ptr += csize) { csize = mblen(ptr, tw->text.char_size); if (csize <= 0) break; if (csize == 1 && (unsigned char)*ptr == '\t') { result += (data->tabheight - ((y + result - data->topmargin) % data->tabheight)); } else { _FontStructPerCharExtents(tw, ptr, csize, &overall); result += overall.ascent + overall.descent; } } } else { for (i=from, ptr = block->ptr + from; itabheight - ((y + result - data->topmargin) % data->tabheight)); } else { _FontStructPerCharExtents(tw, ptr, 1, &overall); result += overall.ascent + overall.descent; } } } return result; } #ifdef USE_XFT static int _XftFindHeight(XmTextWidget tw, int y, /* Starting position (needed for tabs) */ XmTextBlock block, int from, /* How many bytes in to start measuring */ int to) /* How many bytes in to stop measuring */ { OutputData data = tw->text.output->data; XftFont *font = (XftFont*)data->font; char *ptr = NULL; unsigned char c; int i = 0, csize = 0; int result = 0; XGlyphInfo ext; if (tw->text.char_size != 1) { for (i = from, ptr = block->ptr + from; i < to; i +=csize, ptr += csize) { csize = mblen(ptr, tw->text.char_size); if (csize <= 0) break; if (csize == 1 && (unsigned char)*ptr == '\t') { result += (data->tabheight - ((y + result - data->topmargin) % data->tabheight)); } else { XftTextExtentsUtf8(XtDisplay(tw), font, (FcChar8*)ptr, csize, &ext); result += ext.yOff; } } } else { for (i=from, ptr = block->ptr + from; itabheight - ((y + result - data->topmargin) % data->tabheight)); } else { XftTextExtentsUtf8(XtDisplay(tw), font, (FcChar8*)ptr, 1, &ext); result += ext.yOff; } } } return result; } #endif static int FindHeight(XmTextWidget tw, int y, /* Starting position (needed for tabs) */ XmTextBlock block, int from, /* How many bytes in to start measuring */ int to) /* How many bytes in to stop measuring */ { OutputData data = tw->text.output->data; char *ptr = NULL; unsigned char c; int result = 0; int tmp = 0; int csize = 1; int i = 0; XOrientation orient; #ifdef USE_XFT if (data->use_xft) return _XftFindHeight(tw, y, block, from, to); #endif if (!data->use_fontset) return _FontStructFindHeight(tw, y, block, from, to); if (to > block->length) to = block->length; if (from > to) { tmp = to; to = from; from = tmp; } if (to == from || to == 0) return 0; if(data->use_fontset == True) { XGetOCValues((XOC)data->font, XNOrientation, &orient, NULL); SetXOCOrientation(tw, (XOC)data->font, XOMOrientation_TTB_RTL); } if (tw->text.char_size != 1) { for (i = from, ptr = block->ptr + from; i < to; i +=csize, ptr += csize) { csize = mblen(ptr, tw->text.char_size); if (csize <= 0) break; c = (unsigned char) *ptr; if (csize == 1 && c == '\t') result += (data->tabheight - ((y + result - data->topmargin) % data->tabheight)); else result += XmbTextEscapement((XFontSet)data->font, ptr, csize); } } else { /* no need to pay for mblen if we know all chars are 1 byte */ for (i = from, ptr = block->ptr + from; i < to; i++, ptr++) { c = (unsigned char) *ptr; if (c == '\t') result += (data->tabheight - ((y + result - data->topmargin) % data->tabheight)); else result += XmbTextEscapement((XFontSet)data->font, ptr, 1); } } if(data->use_fontset == True) { SetXOCOrientation(tw, (XOC)data->font, orient); } return result; } /* Semi-public routines. */ static XmTextPosition XYToPos(XmTextWidget tw, #if NeedWidePrototypes int x, int y) #else Position x, Position y) #endif /* NeedWidePrototypes */ { OutputData data = tw->text.output->data; LineTableExtra extra = (LineTableExtra)NULL; int i = 0, width = 0, lastwidth = 0, length = 0; int height = 0, lastheight = 0; int num_chars = 0; int num_bytes = 0; LineNum line = 0; XmTextPosition start, end, laststart; XmTextBlockRec block; int delta = 0; start = end = laststart = 0; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { y += data->voffset; /* take care of negative x case */ if (data->linewidth) { int rightedge = tw->text.inner_widget->core.width - data->rightmargin; if (x > rightedge) { delta = ((int)(rightedge - x - 1)/ (int) data->linewidth) + 1; x = rightedge; } line = (rightedge - x) / (int)(data->linewidth); } if (line > _XmTextNumLines(tw)) line = _XmTextNumLines(tw); _XmTextLineInfo(tw, line, &start, &extra); if (start == PASTENDPOS) return (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdRight, 1, False); _XmTextLineInfo(tw, line+1, &end, &extra); end = (*tw->text.source->Scan)(tw->text.source, end, XmSELECT_POSITION, XmsdLeft, 1, True); height = lastheight = data->topmargin; if (start >= end && !delta) return start; /* if original y was negative, we need to find new laststart */ if (delta && start > 0) { end = (*tw->text.source->Scan)(tw->text.source, start, XmSELECT_POSITION, XmsdLeft, 1, True); start = _XmTextFindScroll(tw, start, delta); } do { laststart = start; start = (*tw->text.source->ReadSource)(tw->text.source, start, end, &block); length = block.length; if ((int)tw->text.char_size > 1) { for (i = num_chars = 0, num_bytes = mblen(block.ptr, (int)tw->text.char_size); i < length && height < y && num_bytes >= 0; i += num_bytes, num_chars++, num_bytes = mblen(&block.ptr[i], (int)tw->text.char_size)) { lastheight = height; height += FindHeight(tw, height, &block, i, i + num_bytes); } i = num_chars; } else { for (i=0; ihoffset; y -= data->topmargin; /* take care of negative y case */ if (data->lineheight) { if (y < 0) { delta = ((int)(y + 1)/ (int) data->lineheight) - 1; y = 0; } line = y / (int) data->lineheight; } if (line > _XmTextNumLines(tw)) line = _XmTextNumLines(tw); _XmTextLineInfo(tw, line, &start, &extra); if (start == PASTENDPOS) return (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdRight, 1, False); _XmTextLineInfo(tw, line+1, &end, &extra); end = (*tw->text.source->Scan)(tw->text.source, end, XmSELECT_POSITION, XmsdLeft, 1, True); width = lastwidth = data->leftmargin; if (start >= end && !delta) return start; /* if original y was negative, we need to find new laststart */ if (delta && start > 0) { end = (*tw->text.source->Scan)(tw->text.source, start, XmSELECT_POSITION, XmsdLeft, 1, True); start = _XmTextFindScroll(tw, start, delta); } do { laststart = start; start = (*tw->text.source->ReadSource)(tw->text.source, start, end, &block); length = block.length; if ((int)tw->text.char_size > 1) { for (i = num_chars = 0, #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); #else num_bytes = *block.ptr ? 1 : 0; #endif i < length && width < x && num_bytes >= 0; i += num_bytes, num_chars++, #ifndef NO_MULTIBYTE num_bytes = mblen(&block.ptr[i], (int)tw->text.char_size)) { #else num_bytes = block.ptr[i] ? 1 : 0) { #endif lastwidth = width; width += FindWidth(tw, width, &block, i, i + num_bytes); } i = num_chars; } else { for (i=0; itext.source->Scan)(tw->text.source, laststart, XmSELECT_POSITION, (i < 0) ? XmsdLeft : XmsdRight, abs(i), True); } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ Boolean _XmTextShouldWordWrap(XmTextWidget tw) { OutputData data = tw->text.output->data; return (ShouldWordWrap(data, tw)); } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ Boolean _XmTextScrollable(XmTextWidget tw) { OutputData data = tw->text.output->data; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) return (data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw))); else return (data->scrollvertical && XmIsScrolledWindow(XtParent(tw))); } static Boolean PosToXY(XmTextWidget tw, XmTextPosition position, Position *x, Position *y) { OutputData data = tw->text.output->data; LineNum line; XmTextPosition linestart; LineTableExtra extra; XmTextBlockRec block; Position local_x, local_y; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { _XmProcessLock(); if (tw == posToXYCachedWidget && position == posToXYCachedPosition) { *x = posToXYCachedX; *y = posToXYCachedY; _XmProcessUnlock(); return True; } _XmProcessUnlock(); line = _XmTextPosToLine(tw, position); if (line == NOLINE || line >= data->number_lines) return False; local_y = data->topmargin; local_x = tw->text.inner_widget->core.width - (data->rightmargin + line * data->linewidth + data->linewidth * 0.5); _XmTextLineInfo(tw, line, &linestart, &extra); while (linestart < position) { linestart = (*tw->text.source->ReadSource)(tw->text.source, linestart, position, &block); local_y += FindHeight(tw, local_y, &block, 0, block.length); } local_y -= data->voffset; } else { _XmProcessLock(); if (tw == posToXYCachedWidget && position == posToXYCachedPosition) { *x = posToXYCachedX; *y = posToXYCachedY; _XmProcessUnlock(); return True; } _XmProcessUnlock(); line = _XmTextPosToLine(tw, position); if (line == NOLINE || line >= data->number_lines) return False; local_y = data->topmargin + line * data->lineheight + data->font_ascent; local_x = data->leftmargin; _XmTextLineInfo(tw, line, &linestart, &extra); while (linestart < position) { linestart = (*tw->text.source->ReadSource)(tw->text.source, linestart, position, &block); local_x += FindWidth(tw, local_x, &block, 0, block.length); } local_x -= data->hoffset; } _XmProcessLock(); posToXYCachedWidget = tw; posToXYCachedPosition = position; posToXYCachedX = local_x; posToXYCachedY = local_y; *x = local_x; *y = local_y; _XmProcessUnlock(); return True; } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ XmTextPosition _XmTextFindLineEnd(XmTextWidget tw, XmTextPosition position, LineTableExtra *extra) { OutputData data = tw->text.output->data; XmTextPosition lastChar, lineEnd, nextLeft, nextBreak, lastBreak, oldpos; XmTextPosition startpos = 0; XmTextBlockRec block; int x, lastX, goalwidth, length, i; int y, lastY, goalheight; int num_bytes = 0; lastChar = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_LINE, XmsdRight, 1, False); lastBreak = startpos = position; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { y = lastY = data->topmargin; goalheight = tw->text.inner_widget->core.height - data->bottommargin; while (position < lastChar) { nextLeft = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_WHITESPACE, XmsdRight, 1, False); nextBreak = (*tw->text.source->Scan)(tw->text.source, nextLeft, XmSELECT_WHITESPACE, XmsdRight, 1, True); while (position < nextLeft) { position = (*tw->text.source->ReadSource)(tw->text.source, position, nextLeft, &block); length = block.length; y += FindHeight(tw, y, &block, 0, block.length); if (y > goalheight) { if (lastBreak > startpos) { if (lastY <= goalheight) /* word wrap is being performed */ { return lastBreak; } y = lastY; oldpos = position = lastBreak; while (y > goalheight && position > startpos) { oldpos = position; position = (*tw->text.source->Scan) (tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, True); (void) (*tw->text.source->ReadSource) (tw->text.source, position, oldpos, &block); num_bytes = mblen(block.ptr, (int)tw->text.char_size); /* Pitiful error handling, but what else can you do? */ if (num_bytes < 0) num_bytes = 1; y -= FindHeight(tw, y, &block, 0, num_bytes); } if (extra) { *extra = (LineTableExtra) XtMalloc((unsigned) sizeof(LineTableExtraRec)); (*extra)->wrappedbychar = True; (*extra)->width = 0; } return oldpos; /* Allows one whitespace char to appear */ /* partially off the edge. */ } if (extra) { *extra = (LineTableExtra) XtMalloc((unsigned) sizeof(LineTableExtraRec)); (*extra)->wrappedbychar = True; (*extra)->width = 0; } if ((int)tw->text.char_size == 1) { for (i=length - 1; i>=0 && y > goalheight; i--) { y -= FindHeight(tw, y, &block, i, i + 1); position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, True); } return position; } else { char tmp_cache[200]; wchar_t * tmp_wc; Cardinal tmp_wc_size; char tmp_char[MB_LEN_MAX]; int num_chars = 0; XmTextBlockRec mini_block; /* If 16-bit data, convert the char* to wchar_t*... this * allows us to scan backwards through the text one * character at a time. Without wchar_t, we would have * to continually scan from the start of the string to * find the byte offset of character n-1. */ mini_block.ptr = tmp_char; num_chars = _XmTextCountCharacters(block.ptr, block.length); tmp_wc_size = (num_chars + 1) * sizeof(wchar_t); tmp_wc = (wchar_t *) XmStackAlloc(tmp_wc_size, tmp_cache); num_chars = mbstowcs(tmp_wc, block.ptr, num_chars); if (num_chars > 0) { for (i = num_chars - 1; i >= 0 && y > goalheight; i--) { mini_block.length = wctomb(mini_block.ptr, tmp_wc[i]); if (mini_block.length < 0) mini_block.length = 0; y -= FindHeight(tw, y, &mini_block, 0, mini_block.length); position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, True); } } XmStackFree((char*)tmp_wc, tmp_cache); } /* end multi-byte handling */ return position; } } while (position < nextBreak) { position = (*tw->text.source->ReadSource)(tw->text.source, position, nextBreak, &block); length = block.length; y += FindHeight(tw, y, &block, 0, block.length); } lastBreak = nextBreak; lastY = y; } } else { x = lastX = data->leftmargin; goalwidth = tw->text.inner_widget->core.width - data->rightmargin; while (position < lastChar) { nextLeft = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_WHITESPACE, XmsdRight, 1, False); nextBreak = (*tw->text.source->Scan)(tw->text.source, nextLeft, XmSELECT_WHITESPACE, XmsdRight, 1, True); while ((position < nextLeft) || (nextBreak == lastChar && position < nextBreak)) { if (position < nextLeft) position = (*tw->text.source->ReadSource)(tw->text.source, position, nextLeft, &block); else position = (*tw->text.source->ReadSource)(tw->text.source, position, nextBreak, &block); length = block.length; x += FindWidth(tw, x, &block, 0, block.length); if (x > goalwidth) { if (lastBreak > startpos) { if (lastX <= goalwidth) /* word wrap is being performed */ { return lastBreak; } x = lastX; oldpos = position = lastBreak; while (x > goalwidth && position > startpos) { oldpos = position; position = (*tw->text.source->Scan) (tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, True); (void) (*tw->text.source->ReadSource) (tw->text.source, position, oldpos, &block); #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); #else num_bytes = *block.ptr ? 1 : 0; #endif /* Pitiful error handling, but what else can you do? */ if (num_bytes < 0) num_bytes = 1; x -= FindWidth(tw, x, &block, 0, num_bytes); } if (extra) { *extra = (LineTableExtra) XtMalloc((unsigned) sizeof(LineTableExtraRec)); (*extra)->wrappedbychar = True; (*extra)->width = 0; } return oldpos; /* Allows one whitespace char to appear */ /* partially off the edge. */ } if (extra) { *extra = (LineTableExtra) XtMalloc((unsigned) sizeof(LineTableExtraRec)); (*extra)->wrappedbychar = True; (*extra)->width = 0; } if ((int)tw->text.char_size == 1) { for (i=length - 1; i>=0 && x > goalwidth; i--) { x -= FindWidth(tw, x, &block, i, i + 1); position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, True); } return position; } else { char tmp_cache[200]; wchar_t * tmp_wc; Cardinal tmp_wc_size; char tmp_char[MB_LEN_MAX]; int num_chars = 0; XmTextBlockRec mini_block; /* If 16-bit data, convert the char* to wchar_t*... this * allows us to scan backwards through the text one * character at a time. Without wchar_t, we would have * to continually scan from the start of the string to * find the byte offset of character n-1. */ mini_block.ptr = tmp_char; num_chars = _XmTextCountCharacters(block.ptr, block.length); tmp_wc_size = (num_chars + 1) * sizeof(wchar_t); tmp_wc = (wchar_t *) XmStackAlloc(tmp_wc_size, tmp_cache); num_chars = mbstowcs(tmp_wc, block.ptr, num_chars); if (num_chars > 0) { for (i = num_chars - 1; i >= 0 && x > goalwidth; i--) { mini_block.length = wctomb(mini_block.ptr, tmp_wc[i]); if (mini_block.length < 0) mini_block.length = 0; x -= FindWidth(tw, x, &mini_block, 0, mini_block.length); position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, True); } } XmStackFree((char*)tmp_wc, tmp_cache); } /* end multi-byte handling */ return position; } } while (position < nextBreak) { position = (*tw->text.source->ReadSource)(tw->text.source, position, nextBreak, &block); length = block.length; x += FindWidth(tw, x, &block, 0, block.length); } lastBreak = nextBreak; lastX = x; } } lineEnd = (*tw->text.source->Scan)(tw->text.source, lastChar, XmSELECT_LINE, XmsdRight, 1, True); if (lineEnd != lastChar) return lineEnd; else return PASTENDPOS; } static XtGeometryResult TryResize(XmTextWidget tw, #if NeedWidePrototypes int width, int height) #else Dimension width, Dimension height) #endif /* NeedWidePrototypes */ { XtGeometryResult result; Dimension origwidth = tw->text.inner_widget->core.width; Dimension origheight = tw->text.inner_widget->core.height; XtWidgetGeometry request, reply; if (origwidth != width) { request.request_mode = CWWidth; request.width = width; } else request.request_mode = (XtGeometryMask)0; if (origheight != height) { request.request_mode |= CWHeight; request.height = height; } /* requesting current size */ if (request.request_mode == (XtGeometryMask)0) return XtGeometryNo; result = XtMakeGeometryRequest(tw->text.inner_widget, &request, &reply); if (result == XtGeometryAlmost) { if (request.request_mode & CWWidth) request.width = reply.width; if (request.request_mode & CWHeight) request.height = reply.height; result = XtMakeGeometryRequest(tw->text.inner_widget, &request, &reply); if (result == XtGeometryYes) { result = XtGeometryNo; if (((request.request_mode & CWWidth) && reply.width != origwidth) || ((request.request_mode & CWHeight) && reply.height != origheight)) result = XtGeometryYes; } return result; } if (result == XtGeometryYes) { /* Some brain damaged geometry managers return XtGeometryYes and don't change the widget's size. */ if (((request.request_mode & CWWidth) && tw->text.inner_widget->core.width != width) || ((request.request_mode & CWHeight) && tw->text.inner_widget->core.height != height) || ((request.request_mode == (CWWidth & CWHeight)) && (tw->text.inner_widget->core.width == origwidth && tw->text.inner_widget->core.height == origheight))) result = XtGeometryNo; } return result; } void _XmRedisplayHBar(XmTextWidget tw) { OutputData data = tw->text.output->data; int value, sliderSize, maximum, new_sliderSize; XmNavigatorDataRec nav_data; XmNavigatorTrait nav_trait; if (!(data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw))) || data->suspend_hoffset || tw->text.disable_depth != 0 || tw->core.being_destroyed || data->hbar == NULL) return; ChangeHOffset(tw, data->hoffset, False); /* Makes sure that hoffset is still reasonable. */ new_sliderSize = tw->text.inner_widget->core.width - (data->leftmargin + data->rightmargin); if (new_sliderSize < 1) new_sliderSize = 1; if (new_sliderSize > data->scrollwidth) new_sliderSize = data->scrollwidth; nav_data.valueMask = NavValue|NavSliderSize|NavMaximum; nav_trait = (XmNavigatorTrait) XmeTraitGet((XtPointer)XtClass(data->hbar), XmQTnavigator); if (nav_trait) { nav_trait->getValue(data->hbar, &nav_data); maximum = nav_data.maximum.x; sliderSize = nav_data.slider_size.x; value = nav_data.value.x; } else return; if ((maximum != data->scrollwidth || value != data->hoffset || sliderSize != new_sliderSize) && !(sliderSize == maximum && new_sliderSize == data->scrollwidth)) { data->ignorehbar = True; nav_data.value.x = data->hoffset; nav_data.minimum.x = 0; nav_data.maximum.x = data->scrollwidth; nav_data.slider_size.x = new_sliderSize; nav_data.increment.x = 0; /* increments stay at current values */ nav_data.page_increment.x = new_sliderSize; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorehbar = False; } } void _XmRedisplayVBar(XmTextWidget tw) { OutputData data = tw->text.output->data; int value = 0, sliderSize = 0, maximum = 0, new_sliderSize = 0; XmNavigatorDataRec nav_data; XmNavigatorTrait nav_trait; if (!(data->scrollvertical && XmIsScrolledWindow(XtParent(tw))) || data->suspend_voffset || tw->text.disable_depth != 0 || tw->core.being_destroyed || data->vbar == NULL) return; ChangeVOffset(tw, data->voffset, False); /* Makes sure that voffset is still reasonable. */ new_sliderSize = tw->text.inner_widget->core.height - (data->topmargin + data->bottommargin); if (new_sliderSize < 1) new_sliderSize = 1; if (new_sliderSize > data->scrollheight) new_sliderSize = data->scrollheight; nav_data.valueMask = NavValue|NavSliderSize|NavMaximum; nav_trait = (XmNavigatorTrait) XmeTraitGet((XtPointer)XtClass(data->vbar), XmQTnavigator); if (nav_trait) { nav_trait->getValue(data->vbar, &nav_data); maximum = nav_data.maximum.y; sliderSize = nav_data.slider_size.y; value = nav_data.value.y; } else return; if ((maximum != data->scrollheight || value != data->voffset || sliderSize != new_sliderSize) && !(sliderSize == maximum && new_sliderSize == data->scrollheight)) { data->ignorehbar = True; nav_data.value.y = data->voffset; nav_data.minimum.y = 0; nav_data.maximum.y = data->scrollheight; nav_data.slider_size.y = new_sliderSize; nav_data.increment.y = 0; /* increments stay at current values */ nav_data.page_increment.y = new_sliderSize; nav_data.dimMask = NavigDimensionY; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorehbar = False; } } static int CountLines(XmTextWidget tw, XmTextPosition start, XmTextPosition end) { register XmTextLineTable line_table; register unsigned int t_index; register unsigned int max_index = 0; int numlines = 0; line_table = tw->text.line_table; t_index = tw->text.table_index; max_index = tw->text.total_lines - 1; /* look forward to find the current record */ if (line_table[t_index].start_pos < (unsigned int) start) { while (t_index <= max_index && line_table[t_index].start_pos < (unsigned int) start) t_index++; } else { /* look backward to find the current record */ while (t_index && line_table[t_index].start_pos > (unsigned int) start) t_index--; } while(line_table[t_index].start_pos < (unsigned int) end) { t_index++; numlines++; } return (numlines); } void _XmChangeVSB(XmTextWidget tw) { OutputData data = tw->text.output->data; int local_total; int new_size; XmNavigatorDataRec nav_data; if (tw->text.disable_depth != 0) return; if (tw->core.being_destroyed) return; if (!tw->text.top_character) tw->text.top_line = 0; else tw->text.top_line = _XmTextGetTableIndex(tw, tw->text.top_character); if (tw->text.top_line > tw->text.total_lines) tw->text.top_line = tw->text.total_lines; if (tw->text.top_line + tw->text.number_lines > tw->text.total_lines) local_total = tw->text.top_line + tw->text.number_lines; else local_total = tw->text.total_lines; if (data->vbar) { if (local_total >= tw->text.number_lines) new_size = tw->text.number_lines; else new_size = local_total; if (new_size + tw->text.top_line > local_total) new_size = local_total - tw->text.top_line; data->ignorevbar = True; nav_data.value.y = tw->text.top_line; nav_data.minimum.y = 0; nav_data.maximum.y = local_total; nav_data.slider_size.y = new_size; nav_data.increment.y = 0; /* increments stay at current values */ nav_data.page_increment.y = (data->number_lines > 1)? (data->number_lines - 1): 1; nav_data.dimMask = NavigDimensionY; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorevbar = False; } } void _XmChangeHSB(XmTextWidget tw) { OutputData data = tw->text.output->data; int local_total = 0; int new_size = 0; XmNavigatorDataRec nav_data; int offset = 0; if (tw->text.disable_depth != 0) return; if (tw->core.being_destroyed) return; if (!tw->text.top_character) tw->text.top_line = 0; else tw->text.top_line = _XmTextGetTableIndex(tw, tw->text.top_character); if (tw->text.top_line > tw->text.total_lines) tw->text.top_line = tw->text.total_lines; if (tw->text.top_line + tw->text.number_lines > tw->text.total_lines) local_total = tw->text.top_line + tw->text.number_lines; else local_total = tw->text.total_lines; if (data->hbar) { if (local_total >= tw->text.number_lines) new_size = tw->text.number_lines; else new_size = local_total; if (new_size + tw->text.top_line > local_total) new_size = local_total - tw->text.top_line; data->ignorehbar = True; offset = local_total - (tw->text.number_lines + tw->text.top_line); nav_data.value.x = tw->text.top_line; nav_data.minimum.x = 0; nav_data.maximum.x = local_total; nav_data.slider_size.x = new_size; nav_data.increment.x = 0; /* increments stay at current values */ nav_data.page_increment.x = (data->number_lines > 1)? (data->number_lines - 1): 1; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorehbar = False; } } static void TextFindNewWidth(XmTextWidget tw, Dimension *widthRtn) { OutputData data = tw->text.output->data; XmTextPosition start; Dimension newwidth; newwidth = 0; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { XmTextPosition first_position = 0; LineTableExtra extra; newwidth = (int)(tw->text.total_lines * data->linewidth) + data->leftmargin + data->rightmargin; _XmTextLineInfo(tw, (LineNum) 0, &start, &extra); if (start > 0) { first_position = (*tw->text.source->Scan) (tw->text.source, start, XmSELECT_ALL, XmsdLeft, 1, True); if (start > first_position) { _XmTextSetTopCharacter((Widget)tw, start); return; } } } else { if (data->resizeheight && tw->text.total_lines > data->number_lines) { int i; XmTextPosition linestart, position; Dimension text_width; XmTextBlockRec block; i = _XmTextGetTableIndex(tw, tw->text.top_character); for (linestart = tw->text.top_character; i + 1 < tw->text.total_lines; i++) { text_width = data->leftmargin; position = tw->text.line_table[i + 1].start_pos - 1; while (linestart < position) { linestart = (*tw->text.source->ReadSource) (tw->text.source, linestart, position, &block); text_width += FindWidth(tw, text_width, &block, 0, block.length); } text_width += data->rightmargin; if (text_width > newwidth) newwidth = text_width; } text_width = data->leftmargin; position = tw->text.last_position; while (linestart < position) { linestart = (*tw->text.source->ReadSource) (tw->text.source, linestart, position, &block); text_width += FindWidth(tw, text_width, &block, 0, block.length); } text_width += data->rightmargin; if (text_width > newwidth) newwidth = text_width; } else { LineNum l; LineTableExtra extra; for (l = 0; l < data->number_lines; l++) { _XmTextLineInfo(tw, l, &start, &extra); if (extra && newwidth < extra->width) newwidth = extra->width; } } } *widthRtn = newwidth; } /*ARGSUSED*/ static void TextFindNewHeight(XmTextWidget tw, XmTextPosition position, /* unused */ Dimension *heightRtn) { OutputData data = tw->text.output->data; XmTextPosition first_position, start; LineTableExtra extra; Dimension newheight = 0; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (data->resizeheight && tw->text.total_lines > data->number_lines) { int i; XmTextPosition linestart, pos; Dimension text_height; XmTextBlockRec block; i = _XmTextGetTableIndex(tw, tw->text.top_character); for (linestart = tw->text.top_character; i + 1 < tw->text.total_lines; i++) { text_height = data->topmargin; pos = tw->text.line_table[i + 1].start_pos - 1; while (linestart < pos) { linestart = (*tw->text.source->ReadSource) (tw->text.source, linestart, pos, &block); text_height += FindHeight(tw, text_height, &block, 0, block.length); } text_height += data->bottommargin; if (text_height > newheight) newheight = text_height; } text_height = data->topmargin; pos = tw->text.last_position; while (linestart < pos) { linestart = (*tw->text.source->ReadSource) (tw->text.source, linestart, pos, &block); text_height += FindHeight(tw, text_height, &block, 0, block.length); } text_height += data->bottommargin; if (text_height > newheight) newheight = text_height; } else { LineNum l; LineTableExtra extra; for (l = 0; l < data->number_lines; l++) { _XmTextLineInfo(tw, l, &start, &extra); if (extra && newheight < extra->width) newheight = extra->width; } } *heightRtn = newheight; } else { *heightRtn = tw->text.total_lines * data->lineheight + data->topmargin + data->bottommargin; _XmTextLineInfo(tw, (LineNum) 0, &start, &extra); if (start > 0) { first_position = (*tw->text.source->Scan) (tw->text.source, start, XmSELECT_ALL, XmsdLeft, 1, True); if (start > first_position) { _XmTextSetTopCharacter((Widget)tw, start); return; } } } } static void CheckForNewSize(XmTextWidget tw, XmTextPosition position) { OutputData data = tw->text.output->data; Dimension newwidth, newheight; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw)) && !tw->text.hsbar_scrolling) _XmChangeHSB(tw); } else { if (data->scrollvertical && XmIsScrolledWindow(XtParent(tw)) && !tw->text.vsbar_scrolling) _XmChangeVSB(tw); } if (tw->text.in_resize || tw->text.in_expose) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (data->scrollvertical && XmIsScrolledWindow(XtParent(tw))) { TextFindNewHeight(tw, position, &newheight); newheight -= (data->bottommargin + data->topmargin); if (newheight != data->scrollheight && !data->suspend_voffset) { if (newheight) data->scrollheight = newheight; else data->scrollheight = 1; _XmRedisplayVBar(tw); } } } else { if (data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw))) { TextFindNewWidth(tw, &newwidth); newwidth -= (data->rightmargin + data->leftmargin); if (newwidth != data->scrollwidth && !data->suspend_hoffset) { if (newwidth) data->scrollwidth = newwidth; else data->scrollwidth = 1; _XmRedisplayHBar(tw); } } } } else { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (data->resizeheight || (data->scrollvertical && XmIsScrolledWindow(XtParent(tw)))) { TextFindNewHeight(tw, position, &newheight); if (data->scrollvertical && XmIsScrolledWindow(XtParent(tw))) { newheight -= (data->bottommargin + data->topmargin); if (newheight != data->scrollheight && !data->suspend_voffset) { if (newheight) data->scrollheight = newheight; else data->scrollheight = 1; _XmRedisplayVBar(tw); } newheight = tw->text.inner_widget->core.height; } else if (newheight < data->minheight) newheight = data->minheight; } else newheight = tw->text.inner_widget->core.height; newwidth = tw->text.inner_widget->core.width; if (data->resizewidth) { TextFindNewWidth(tw, &newwidth); if (newwidth < data->minwidth) newwidth = data->minwidth; } } else { if (data->resizewidth || (data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw)))) { TextFindNewWidth(tw, &newwidth); if (data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw))) { newwidth -= (data->rightmargin + data->leftmargin); if (newwidth != data->scrollwidth && !data->suspend_hoffset) { if (newwidth) data->scrollwidth = newwidth; else data->scrollwidth = 1; _XmRedisplayHBar(tw); } newwidth = tw->text.inner_widget->core.width; } else if (newwidth < data->minwidth) newwidth = data->minwidth; } else newwidth = tw->text.inner_widget->core.width; newheight = tw->text.inner_widget->core.height; if (data->resizeheight && !(data->scrollvertical && XmIsScrolledWindow(XtParent((Widget)tw))) ) { TextFindNewHeight(tw, position, &newheight); if (newheight < data->minheight) newheight = data->minheight; } } if ((newwidth != tw->text.inner_widget->core.width || newheight != tw->text.inner_widget->core.height)) { if (tw->text.in_setvalues) { tw->core.width = newwidth; tw->core.height = newheight; } else { if (TryResize(tw, newwidth, newheight) == XtGeometryYes) NotifyResized((Widget) tw, False); else tw->text.needs_refigure_lines = False; } } } } /* ARGSUSED */ static XtPointer OutputBaseProc(Widget widget, XtPointer client_data) { XmTextWidget tw = (XmTextWidget) widget; XtPointer ret_val; _XmProcessLock(); ret_val = (XtPointer) tw->text.output; _XmProcessUnlock(); return ret_val; } /* ARGSUSED */ void _XmTextOutputGetSecResData(XmSecondaryResourceData *secResDataRtn) { XmSecondaryResourceData secResData = XtNew(XmSecondaryResourceDataRec); _XmTransformSubResources(output_resources, XtNumber(output_resources), &(secResData->resources), &(secResData->num_resources)); secResData->name = NULL; secResData->res_class = NULL; secResData->client_data = NULL; secResData->base_proc = OutputBaseProc; *secResDataRtn = secResData; } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ int _XmTextGetNumberLines(XmTextWidget tw) { OutputData data = tw->text.output->data; return (data->number_lines); } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ /* This routine is used to control foreground vs. background when moving * cursor position. It ensures that when cursor position is changed * between "inside the selection" and "outside the selection", that the * correct foreground and background are used when "painting" the cursor * through the IBeam stencil. */ void _XmTextMovingCursorPosition(XmTextWidget tw, XmTextPosition position) { OutputData data = tw->text.output->data; _XmHighlightRec *hl_list = tw->text.highlight.list; int i; for (i = tw->text.highlight.number - 1; i >= 0; i--) if (position >= hl_list[i].position) break; if (position == hl_list[i].position) { if (data->have_inverted_image_gc) InvertImageGC(tw); } else if (hl_list[i].mode != XmHIGHLIGHT_SELECTED) { if (data->have_inverted_image_gc) InvertImageGC(tw); } else if (!data->have_inverted_image_gc) { InvertImageGC(tw); } } static Boolean MeasureLine(XmTextWidget tw, LineNum line, XmTextPosition position, XmTextPosition *nextpos, LineTableExtra *extra) { OutputData data = tw->text.output->data; XmTextPosition temp, last_position; XmTextBlockRec block; Dimension width = 0; Dimension height = 0; _XmProcessLock(); posToXYCachedWidget = NULL; _XmProcessUnlock(); if (extra) *extra = NULL; if (line >= data->number_lines) { if (data->resizewidth || data->resizeheight || ((data->scrollvertical || data->scrollhorizontal) && XmIsScrolledWindow(XtParent(tw)))) { CheckForNewSize(tw, position); } return(False); } if (nextpos) { if (position == PASTENDPOS) { *nextpos = last_position = PASTENDPOS; } else { if (ShouldWordWrap(data, tw)) { *nextpos = _XmTextFindLineEnd(tw, position, extra); } else { last_position = (*tw->text.source->Scan) (tw->text.source, position, XmSELECT_LINE, XmsdRight, 1, False); *nextpos = (*tw->text.source->Scan)(tw->text.source, last_position, XmSELECT_LINE, XmsdRight, 1, True); if (*nextpos == last_position) *nextpos = PASTENDPOS; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (extra && (data->resizeheight || (data->scrollvertical && XmIsScrolledWindow(XtParent(tw))))) { (*extra) = (LineTableExtra) XtMalloc((unsigned) sizeof(LineTableExtraRec)); (*extra)->wrappedbychar = False; height = data->topmargin; temp = position; while (temp < last_position) { temp = (*tw->text.source->ReadSource) (tw->text.source, temp, last_position, &block); height += FindHeight(tw, (Position) width, &block, 0, block.length); } (*extra)->width = height + data->bottommargin; } } else { if (extra && (data->resizewidth || (data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw))))) { (*extra) = (LineTableExtra) XtMalloc((unsigned) sizeof(LineTableExtraRec)); (*extra)->wrappedbychar = False; width = data->leftmargin; temp = position; while (temp < last_position) { temp = (*tw->text.source->ReadSource) (tw->text.source, temp, last_position, &block); width += FindWidth(tw, (Position) width, &block, 0, block.length); } (*extra)->width = width + data->rightmargin; } } } if (*nextpos == position) *nextpos = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdRight, 1, True); } } return (True); } static Boolean _FontStructPerCharExtents(XmTextWidget tw, char *str, int length, XCharStruct *overall) { OutputData data = tw->text.output->data; XFontStruct *font = data->font; unsigned char c; int dummy; memset((char *)overall, 0x00, sizeof(XCharStruct)); if(data->use_fontset) return False; if(length <= 0 || str == (char *) NULL) return True; if(tw->text.char_size != 1) { if(length == 1) { c = (unsigned char) *str; if(c == '\t') { return True; } else { if(font->per_char && (c >= font->min_char_or_byte2 && c <= font->max_char_or_byte2)) { overall->lbearing = font->per_char[c - font->min_char_or_byte2].lbearing; overall->rbearing = font->per_char[c - font->min_char_or_byte2].rbearing; overall->width = font->per_char[c - font->min_char_or_byte2].width; } else { overall->lbearing = font->min_bounds.lbearing; overall->rbearing = font->min_bounds.rbearing; overall->width = font->min_bounds.width; } overall->ascent = font->max_bounds.ascent; overall->descent = font->max_bounds.descent; } } else { if (_XmIsISO10646(XtDisplay(tw), data->font)) { size_t ucsstr_len = 0; XChar2b *ucsstr = _XmUtf8ToUcs2(str, length, &ucsstr_len); XTextExtents16(data->font, ucsstr, ucsstr_len, &dummy, &dummy, &dummy, overall); XFree(ucsstr); } else XTextExtents(data->font, str, length, &dummy, &dummy, &dummy, overall); } } else { c = (unsigned char) *str; if(c == '\t') { return True; } else { if(font->per_char) { if(c >= font->min_char_or_byte2 && c <= font->max_char_or_byte2) { overall->lbearing = font->per_char[c - font->min_char_or_byte2].lbearing; overall->rbearing = font->per_char[c - font->min_char_or_byte2].rbearing; overall->width = font->per_char[c - font->min_char_or_byte2].width; } else if (font->default_char >= font->min_char_or_byte2 && font->default_char <= font->max_char_or_byte2) { overall->lbearing = font->per_char[font->default_char - font->min_char_or_byte2].lbearing; overall->rbearing = font->per_char[font->default_char - font->min_char_or_byte2].rbearing; overall->width = font->per_char[font->default_char - font->min_char_or_byte2].width; } else { overall->lbearing = font->min_bounds.lbearing; overall->rbearing = font->min_bounds.rbearing; overall->width = font->min_bounds.width; } } else { overall->lbearing = font->min_bounds.lbearing; overall->rbearing = font->min_bounds.rbearing; overall->width = font->min_bounds.width; } overall->ascent = font->max_bounds.ascent; overall->descent = font->max_bounds.descent; } } return True;; } static void Draw(XmTextWidget tw, LineNum line, XmTextPosition start, XmTextPosition end, XmHighlightMode highlight) { OutputData data = tw->text.output->data; XmTextPosition linestart, nextlinestart; LineTableExtra extra; XmTextBlockRec block; int x, y, length, newx, i; int num_bytes = 0; int text_border; int rightedge = (((int)tw->text.inner_widget->core.width) - data->rightmargin) + data->hoffset; Boolean stipple = False; int width, height; int rec_width = 0; int rec_height = 0; Boolean cleartoend, cleartobottom; XmHighlightMode endhighlight = highlight; int bottomedge = (((int)tw->text.inner_widget->core.height) - data->bottommargin) + data->voffset; int win_width = 0; int newy = 0; int charheight = data->font_ascent + data->font_descent; if (!XtIsRealized((Widget) tw)) return; _XmTextLineInfo(tw, line+1, &nextlinestart, &extra); _XmTextLineInfo(tw, line, &linestart, &extra); _XmTextAdjustGC(tw); if (!XtIsSensitive((Widget)tw)) stipple = True; if (linestart == PASTENDPOS) { start = end = nextlinestart = PASTENDPOS; cleartoend = cleartobottom = True; } else if (nextlinestart == PASTENDPOS) { nextlinestart = (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdRight, 1, False); cleartoend = cleartobottom = (end >= nextlinestart); if (start >= nextlinestart) endhighlight = highlight = XmHIGHLIGHT_NORMAL; else if (cleartoend) endhighlight = XmHIGHLIGHT_NORMAL; } else { cleartobottom = False; cleartoend = (end >= nextlinestart); if (cleartoend && (!extra || !extra->wrappedbychar)) end = (*tw->text.source->Scan)(tw->text.source, nextlinestart, XmSELECT_POSITION, XmsdLeft, 1, True); } if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { y = data->topmargin; x = tw->text.inner_widget->core.width - (data->rightmargin + line * data->linewidth + (int)(data->linewidth * 0.5)); while (linestart < start && x <= rightedge) { linestart = (*tw->text.source->ReadSource)(tw->text.source, linestart, start, &block); y += FindHeight(tw, y, &block, 0, block.length); } } else { y = data->topmargin + line * data->lineheight + data->font_ascent; x = data->leftmargin; while (linestart < start && x <= rightedge) { linestart = (*tw->text.source->ReadSource)(tw->text.source, linestart, start, &block); x += FindWidth(tw, x, &block, 0, block.length); } } if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { XOrientation orient = 0; newy = y; if(data->use_fontset == True) { XGetOCValues((XOC)data->font, XNOrientation, &orient, NULL); SetXOCOrientation(tw, (XOC)data->font, XOMOrientation_TTB_RTL); } while (start < end && y <= bottomedge) { start = (*tw->text.source->ReadSource)(tw->text.source, start, end, &block); if ((int)tw->text.char_size == 1) num_bytes = 1; else { num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 1) num_bytes = 1; } while (block.length > 0) { while (num_bytes == 1 && block.ptr[0] == '\t') { newy = y; while (block.length > 0 && num_bytes == 1 && newy - data->voffset < data->topmargin) { height = FindHeight(tw, newy, &block, 0, 1); newy += height; if (newy - data->voffset < data->topmargin) { block.length--; block.ptr++; y = newy; if ((int)tw->text.char_size != 1) { /* check if we've got mbyte char */ num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 1) num_bytes = 1; } } } if (block.length <= 0 || num_bytes != 1 || block.ptr[0] != '\t') break; height = FindHeight(tw, y, &block, 0, 1); if (highlight == XmHIGHLIGHT_SELECTED) SetNormGC(tw, data->gc, False, False); else SetInvGC(tw, data->gc); SetFullGC(tw, data->gc); if (((y - data->voffset) + height) > (int)(tw->text.inner_widget->core.height - data->bottommargin)) rec_height = (tw->text.inner_widget->core.height - data->bottommargin) - (y - data->voffset); else rec_height = height; if (x - (int)(data->linewidth * 0.5) < data->leftmargin) rec_width = (tw->text.inner_widget->core.width - data->rightmargin) - x; else rec_width = data->linewidth; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - (data->linewidth * 0.5), y - data->voffset, rec_width, rec_height); SetMarginGC(tw, data->gc); if (highlight == XmHIGHLIGHT_SECONDARY_SELECTED) { if (highlight == XmHIGHLIGHT_SELECTED) SetInvGC(tw, data->gc); else SetNormGC(tw, data->gc, False, False); XDrawLine(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x + (int)(data->linewidth * 0.5) - 1, y - data->voffset, (int)(x + data->linewidth * 0.5) - 1, ((y - data->voffset) + height) - 1); } y += height; block.length--; block.ptr++; if ((int)tw->text.char_size != 1) { num_bytes = mblen(block.ptr, (int)tw->text.char_size); /* crummy error handling, but ... */ if (num_bytes < 0) num_bytes = 1; } if (block.length <= 0) break; } if ((int)tw->text.char_size == 1) { for (length = 0; length < block.length; length++) { if (block.ptr[length] == '\t') break; } } else { for (length = 0, num_bytes = mblen(block.ptr, (int)tw->text.char_size); length < block.length; num_bytes = mblen(&block.ptr[length], (int)tw->text.char_size)) { if ((num_bytes == 1) && block.ptr[length] == '\t') break; if (num_bytes == 0) break; if (num_bytes < 0) num_bytes = 1; length += num_bytes; } } if (length <= 0) break; newy = y; while (length > 0 && newy + charheight < data->topmargin) { newy += FindHeight(tw, newy, &block, 0, 1); if ((int)tw->text.char_size == 1) { if (newy + charheight < data->topmargin) { length--; block.length--; block.ptr++; y = newy; } } else { if (newy + charheight < data->topmargin) { num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 0) num_bytes = 1; length -= num_bytes; block.length -= num_bytes; block.ptr += num_bytes; y = newy; } } } if (length == 0) continue; newy = y + FindHeight(tw, y, &block, 0, length); if (newy > bottomedge) { newy = y; if ((int)tw->text.char_size == 1) { for (i=0; i < length && (newy - data->voffset) <= bottomedge; i++) { newy += FindHeight(tw, newy, &block, i, i+1); } } else { for (i=0, num_bytes = mblen(block.ptr, (int)tw->text.char_size); i < length && (newy - data->voffset) <= bottomedge && num_bytes > 0; i += num_bytes, num_bytes = mblen(&block.ptr[i], (int)tw->text.char_size)) newy += FindHeight(tw, newy, &block, i, i + num_bytes); } length = i; start = end; /* Force a break out of the outer loop. */ block.length = length; /* ... and out of the inner loop. */ } if (highlight == XmHIGHLIGHT_SELECTED) { /* Draw the inverse background, then draw the text over it */ SetNormGC(tw, data->gc, False, False); SetFullGC(tw, data->gc); if (((y - data->voffset) + (newy - y)) > (int) tw->text.inner_widget->core.height - data->bottommargin) rec_height = tw->text.inner_widget->core.height - (y - data->voffset) - data->bottommargin; else rec_height = newy - y; if (x + (int)(data->linewidth * 0.5) < data->leftmargin) rec_width = x + (tw->text.inner_widget->core.width - data->rightmargin); else rec_width = data->linewidth; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - (int)(data->linewidth * 0.5), y - data->voffset, rec_width, rec_height); SetInvGC(tw, data->gc); SetMarginGC(tw, data->gc); if (data->use_fontset) { XmbDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), (XFontSet) data->font, data->gc, x, y - data->voffset, block.ptr, length); #ifdef USE_XFT } else if (data->use_xft) { _XmXftDrawString2(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, (XftFont*) data->font, 1, x, y - data->voffset, block.ptr, length); #endif } else { int len = 0, csize = 0, wx = 0, orig_x = 0, orig_y = 0; char *p = NULL; XCharStruct overall; wx = x - data->hoffset; orig_y = y - data->voffset; for(len = length, p = block.ptr ; len > 0 && p ; len-= csize, p += csize) { csize = mblen(p, (int)tw->text.char_size); _FontStructPerCharExtents(tw, p, csize, &overall); orig_x = wx - (int)((overall.rbearing - overall.lbearing) >> 1) - overall.lbearing; orig_y += overall.ascent; if (_XmIsISO10646(XtDisplay(tw), data->font)) { size_t ucsstr_len = 0; XChar2b *ucsstr = _XmUtf8ToUcs2(p, csize, &ucsstr_len); XDrawString16(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, orig_x, orig_y, ucsstr, ucsstr_len); XFree(ucsstr); } else XDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, orig_x, orig_y, p, csize); orig_y += overall.descent; } } } else { SetInvGC(tw, data->gc); if (newy > y) { if (x + (int)(data->linewidth * 0.5) < data->leftmargin) rec_width = x + (tw->text.inner_widget->core.width - data->rightmargin); else rec_width = data->linewidth; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - (int)(data->linewidth * 0.5), y - data->voffset, rec_width, newy - y); } SetNormGC(tw, data->gc, True, stipple); if (data->use_fontset) { int wx, wy; wx = x - data->hoffset; #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); XmbDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), (XFontSet) data->font, data->gc, wx+1, y - data->voffset+1, block.ptr, length); SetNormGC(tw, data->gc, True, stipple); } #endif XmbDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), (XFontSet) data->font, data->gc, wx, y - data->voffset, block.ptr, length); #ifdef USE_XFT } else if (data->use_xft) { #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); _XmXftDrawString2(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, (XftFont*) data->font, 1, x - data->hoffset+1, y - data->voffset+1, block.ptr, length); SetNormGC(tw, data->gc, True, stipple); } #endif _XmXftDrawString2(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, (XftFont*) data->font, 1, x - data->hoffset, y - data->voffset, block.ptr, length); #endif } else { int len = 0, csize = 0, wx = 0, orig_x = 0, orig_y = 0; char *p = NULL; XCharStruct overall; wx = x - data->hoffset; orig_y = y - data->voffset; for(len = length, p = block.ptr ; len > 0 && p ; len-= csize, p += csize) { csize = mblen(p, (int)tw->text.char_size); _FontStructPerCharExtents(tw, p, csize, &overall); orig_x = wx - (int)((overall.rbearing - overall.lbearing) >> 1) - overall.lbearing; orig_y += overall.ascent; if (_XmIsISO10646(XtDisplay(tw), data->font)) { size_t ucsstr_len = 0; XChar2b *ucsstr = _XmUtf8ToUcs2(p, csize, &ucsstr_len); #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); XDrawString16(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, orig_x+1, orig_y+1, ucsstr, ucsstr_len); SetNormGC(tw, data->gc, True, stipple); } #endif XDrawString16(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, orig_x, orig_y, ucsstr, ucsstr_len); XFree(ucsstr); } else { #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); XDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, orig_x+1, orig_y+1, p, csize); SetNormGC(tw, data->gc, True, stipple); } #endif XDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, orig_x, orig_y, p, csize); } orig_y += overall.descent; } } if (stipple) SetNormGC(tw, data->gc, True, !stipple); } if (highlight == XmHIGHLIGHT_SECONDARY_SELECTED) XDrawLine(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x + (int)(data->linewidth * 0.5) - 1, y - data->voffset, x + (int)(data->linewidth * 0.5) - 1, (newy - data->voffset) - 1); y = newy; block.length -= length; block.ptr += length; if ((int)tw->text.char_size != 1) { num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 1) num_bytes = 1; } } } if(data->use_fontset == True) { SetXOCOrientation(tw, (XOC)data->font, orient); } } else { newx = x; while (start < end && x <= rightedge) { start = (*tw->text.source->ReadSource)(tw->text.source, start, end, &block); if ((int)tw->text.char_size == 1) num_bytes = 1; else { #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 1) num_bytes = 1; #else num_bytes = 1; #endif } while (block.length > 0) { while (num_bytes == 1 && block.ptr[0] == '\t') { newx = x; while (block.length > 0 && num_bytes == 1 && newx - data->hoffset < data->leftmargin) { width = FindWidth(tw, newx, &block, 0, 1); newx += width; if (newx - data->hoffset < data->leftmargin) { block.length--; block.ptr++; x = newx; if ((int)tw->text.char_size != 1) { /* check if we've got mbyte char */ #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 1) num_bytes = 1; #else num_bytes = 1; #endif } } } if (block.length <= 0 || num_bytes != 1 || block.ptr[0] != '\t') break; width = FindWidth(tw, x, &block, 0, 1); if (highlight == XmHIGHLIGHT_SELECTED) SetNormGC(tw, data->gc, False, False); else SetInvGC(tw, data->gc); SetFullGC(tw, data->gc); if ((int) ((x - data->hoffset) + width) > (int) (tw->text.inner_widget->core.width - data->rightmargin)) rec_width = (tw->text.inner_widget->core.width - data->rightmargin) - (x - data->hoffset); else rec_width = width; if ((int) (y + data->font_descent) > (int) (tw->text.inner_widget->core.height - data->bottommargin)) rec_height = (tw->text.inner_widget->core.height - data->bottommargin) - y; else rec_height = data->font_ascent + data->font_descent; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y - data->font_ascent, rec_width, rec_height); SetMarginGC(tw, data->gc); if (highlight == XmHIGHLIGHT_SECONDARY_SELECTED) { if (highlight == XmHIGHLIGHT_SELECTED) SetInvGC(tw, data->gc); else SetNormGC(tw, data->gc, False, False); XDrawLine(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y, ((x - data->hoffset) + width) - 1, y); } x += width; block.length--; block.ptr++; if ((int)tw->text.char_size != 1) { #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); /* crummy error handling, but ... */ if (num_bytes < 0) num_bytes = 1; #else num_bytes = *block.ptr ? 1 : 0; #endif } if (block.length <= 0) break; } if ((int)tw->text.char_size == 1) { for (length = 0; length < block.length; length++) { if (block.ptr[length] == '\t') break; } } else { for (length = 0, #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); #else num_bytes = *block.ptr ? 1 : 0; #endif length < block.length; #ifndef NO_MULTIBYTE num_bytes = mblen(&block.ptr[length], (int)tw->text.char_size)) { #else num_bytes = block.ptr[length] ? 1 : 0) { #endif if ((num_bytes == 1) && block.ptr[length] == '\t') break; if (num_bytes == 0) break; if (num_bytes < 0) num_bytes = 1; length += num_bytes; } } if (length <= 0) break; newx = x; while (length > 0 && newx - data->hoffset < data->leftmargin) { newx += FindWidth(tw, newx, &block, 0, 1); if ((int)tw->text.char_size == 1) { if (newx - data->hoffset < data->leftmargin) { length--; block.length--; block.ptr++; x = newx; } } else { if (newx - data->hoffset < data->leftmargin) { #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 0) num_bytes = 1; #else num_bytes = *block.ptr ? 1 : 0; #endif length -= num_bytes; block.length -= num_bytes; block.ptr += num_bytes; x = newx; } } } if (length == 0) continue; newx = x + FindWidth(tw, x, &block, 0, length); if (newx > rightedge) { newx = x; if ((int)tw->text.char_size == 1) { for (i=0; i < length && newx <= rightedge; i++) { newx += FindWidth(tw, newx, &block, i, i+1); } } else { for (i=0, #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); #else num_bytes = *block.ptr ? 1 : 0; #endif i < length && newx <= rightedge && num_bytes > 0; i += num_bytes, #ifndef NO_MULTIBYTE num_bytes = mblen(&block.ptr[i], (int)tw->text.char_size)) #else num_bytes = block.ptr[i] ? 1 : 0) #endif newx += FindWidth(tw, newx, &block, i, i + num_bytes); } length = i; start = end; /* Force a break out of the outer loop. */ block.length = length; /* ... and out of the inner loop. */ } if (highlight == XmHIGHLIGHT_SELECTED) { /* Draw the inverse background, then draw the text over it */ SetNormGC(tw, data->gc, False, False); SetFullGC(tw, data->gc); if ((int) ((x - data->hoffset) + (newx - x)) > (int) (tw->text.inner_widget->core.width - data->rightmargin)) rec_width = tw->text.inner_widget->core.width - (x - data->hoffset) - data->rightmargin; else rec_width = newx - x; if ((int) (y + data->font_descent) > (int) (tw->text.inner_widget->core.height - data->bottommargin)) rec_height = (tw->text.inner_widget->core.height - data->bottommargin) - (y - data->font_ascent); else rec_height = data->font_ascent + data->font_descent; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y - data->font_ascent, rec_width, rec_height); SetInvGC(tw, data->gc); SetMarginGC(tw, data->gc); if (data->use_fontset) { XmbDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), (XFontSet) data->font, data->gc, x - data->hoffset, y, block.ptr, length); #ifdef USE_XFT } else if (data->use_xft) { _XmXftDrawString2(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, (XftFont*) data->font, 1, x - data->hoffset, y, block.ptr, length); #endif } else { if (_XmIsISO10646(XtDisplay(tw), data->font)) { size_t ucsstr_len = 0; XChar2b *ucsstr = _XmUtf8ToUcs2(block.ptr, length, &ucsstr_len); XDrawString16(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y, ucsstr, ucsstr_len); XFree(ucsstr); } else XDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y, block.ptr, length); } } else { SetInvGC(tw, data->gc); if (newx > x) { if ((int) (y + data->font_descent) > (int) (tw->text.inner_widget->core.height - data->bottommargin)) rec_height = (tw->text.inner_widget->core.height - data->bottommargin) - (y - data->font_ascent); else rec_height = data->font_ascent + data->font_descent; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y - data->font_ascent, newx - x, rec_height); } SetNormGC(tw, data->gc, True, stipple); if (data->use_fontset) { #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); XmbDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), (XFontSet) data->font, data->gc, x - data->hoffset+1, y+1, block.ptr, length); SetNormGC(tw, data->gc, True, stipple); } #endif XmbDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), (XFontSet) data->font, data->gc, x - data->hoffset, y, block.ptr, length); #ifdef USE_XFT } else if (data->use_xft) { #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); _XmXftDrawString2(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, (XftFont*) data->font, 1, x - data->hoffset+1, y+1, block.ptr, length); SetNormGC(tw, data->gc, True, stipple); } #endif _XmXftDrawString2(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, (XftFont*) data->font, 1, x - data->hoffset, y, block.ptr, length); #endif } else { if (_XmIsISO10646(XtDisplay(tw), data->font)) { size_t ucsstr_len = 0; XChar2b *ucsstr = _XmUtf8ToUcs2(block.ptr, length, &ucsstr_len); #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); XDrawString16(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset+1, y+1, ucsstr, ucsstr_len); SetNormGC(tw, data->gc, True, stipple); } #endif XDrawString16(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y, ucsstr, ucsstr_len); XFree(ucsstr); } else { #ifdef FIX_1381 if (stipple) { /*Draw shadow for insensitive text*/ SetShadowGC(tw, data->gc); XDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset+1, y+1, block.ptr, length); SetNormGC(tw, data->gc, True, stipple); } #endif XDrawString(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y, block.ptr, length); } } if (stipple) SetNormGC(tw, data->gc, True, !stipple); } if (highlight == XmHIGHLIGHT_SECONDARY_SELECTED) XDrawLine(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - data->hoffset, y, (newx - data->hoffset) - 1, y); x = newx; block.length -= length; block.ptr += length; if ((int)tw->text.char_size != 1) { #ifndef NO_MULTIBYTE num_bytes = mblen(block.ptr, (int)tw->text.char_size); if (num_bytes < 1) num_bytes = 1; #else num_bytes = 1; #endif } } } } if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { /* clear top margin */ text_border = tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; if (data->topmargin - text_border > 0 && x < rightedge + text_border) XClearArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), x - (int) (data->linewidth * 0.5)-1, text_border, rightedge - x + (int) (data->linewidth * 0.5), data->topmargin - text_border, FALSE); if (cleartoend) { y -= data->voffset; if (y > ((int)tw->text.inner_widget->core.height)- data->bottommargin) y = ((int)tw->text.inner_widget->core.height)- data->bottommargin; if (y < data->topmargin) y = data->topmargin; height = ((int)tw->text.inner_widget->core.height) - y - data->bottommargin; if (height > 0 && data->linewidth > 0) { if (endhighlight == XmHIGHLIGHT_SELECTED) SetNormGC(tw, data->gc, False, False); else SetInvGC(tw, data->gc); SetFullGC(tw, data->gc); if ((int) (x - (data->linewidth * 0.5)) < data->leftmargin) rec_width = x + (data->linewidth * 0.5) - data->leftmargin; else rec_width = data->linewidth; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x - (int)(data->linewidth * 0.5), y, rec_width, height); SetMarginGC(tw, data->gc); } } if (cleartobottom) { y = data->topmargin; width = x - (data->linewidth * 0.5) - data->leftmargin; height = tw->text.inner_widget->core.height - (data->topmargin + data->bottommargin); if (width > 0 && height > 0) XClearArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->leftmargin, y, width, height, False); } } else { /* clear left margin */ text_border = tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; if (data->leftmargin - text_border > 0 && (int) (y + data->font_descent) > 0) XClearArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), text_border, text_border, data->leftmargin - text_border, y + data->font_descent - text_border, False); if (cleartoend) { x -= data->hoffset; if (x > ((int)tw->text.inner_widget->core.width)- data->rightmargin) x = ((int)tw->text.inner_widget->core.width)- data->rightmargin; if (x < data->leftmargin) x = data->leftmargin; width = ((int)tw->text.inner_widget->core.width) - x - data->rightmargin; if (width > 0 && data->lineheight > 0) { if (endhighlight == XmHIGHLIGHT_SELECTED) SetNormGC(tw, data->gc, False, False); else SetInvGC(tw, data->gc); SetFullGC(tw, data->gc); if ((int) (y + data->font_descent) > (int) (tw->text.inner_widget->core.height - data->bottommargin)) rec_height = (tw->text.inner_widget->core.height - data->bottommargin) - (y - data->font_ascent); else rec_height = data->font_ascent + data->font_descent; XFillRectangle(XtDisplay(tw), XtWindow(tw->text.inner_widget), data->gc, x, y - data->font_ascent, width, rec_height); SetMarginGC(tw, data->gc); } } if (cleartobottom) { x = data->leftmargin; width = tw->text.inner_widget->core.width - (data->rightmargin + data->leftmargin); height = tw->text.inner_widget->core.height - ((y + data->font_descent) + data->bottommargin); if (width > 0 && height > 0) XClearArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), x, y + data->font_descent, width, height, False); } } /* Before exiting, force PaintCursor to refresh its save area */ data->refresh_ibeam_off = True; } static OnOrOff CurrentCursorState(XmTextWidget tw) { OutputData data = tw->text.output->data; if (data->cursor_on < 0) return off; if (data->blinkstate == on || !XtIsSensitive((Widget)tw)) return on; return off; } /* * All the info about the cursor has been figured; draw or erase it. */ static void PaintCursor(XmTextWidget tw) { OutputData data = tw->text.output->data; Position x, y; if (!data->cursor_position_visible) return; _XmTextToggleCursorGC((Widget)tw); if (!tw->text.input->data->overstrike) x = data->insertx - (data->cursorwidth >> 1) - 1; else { int pxlen; XmTextBlockRec block; XmTextPosition cursor_pos = tw->text.cursor_position; x = data->insertx; (void) (*tw->text.source->ReadSource) (tw->text.source, cursor_pos, cursor_pos+1, &block); pxlen = FindWidth(tw, x, &block, 0, block.length); if (pxlen > (int) data->cursorwidth) x += (short) (pxlen - data->cursorwidth) >> 1; } y = data->inserty + data->font_descent - data->cursorheight; /* If time to paint the I Beam... first capture the IBeamOffArea, then draw * the I Beam. */ if ((tw->text.top_character <= tw->text.cursor_position) && (tw->text.cursor_position <= tw->text.bottom_position)) { int cursor_width = data->cursorwidth; int cursor_height = data->cursorheight; if (data->refresh_ibeam_off == True) { /* get area under IBeam first */ /* Fill is needed to realign clip rectangle with gc */ XFillRectangle(XtDisplay((Widget)tw), XtWindow((Widget)tw), data->save_gc, 0, 0, 0, 0); XCopyArea(XtDisplay((Widget)tw), XtWindow((Widget)tw), data->ibeam_off, data->save_gc, x, y, data->cursorwidth, data->cursorheight, 0, 0); data->refresh_ibeam_off = False; } /* redraw cursor, being very sure to keep it within the bounds of the ** text area, not spilling into the highlight area */ if ((data->cursor_on >= 0) && (data->blinkstate == on)) { if (x + data->cursorwidth > tw->text.inner_widget->core.width - tw->primitive.shadow_thickness - tw->primitive.highlight_thickness) cursor_width = (tw->text.inner_widget->core.width - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness)) - x; #ifdef FIX_1501 if ( cursor_width > 0 && cursor_height > 0 ) { if (!XtIsSensitive((Widget)tw)) { SetShadowGC(tw, data->imagegc); XFillRectangle(XtDisplay((Widget)tw), XtWindow((Widget)tw), data->imagegc, x + 1, y + 1, (unsigned int )cursor_width, (unsigned int )cursor_height); } _XmTextToggleCursorGC((Widget)tw); #else if ( cursor_width > 0 && cursor_height > 0 ) #endif XFillRectangle(XtDisplay((Widget)tw), XtWindow((Widget)tw), data->imagegc, x, y, (unsigned int )cursor_width, (unsigned int )cursor_height); #ifdef FIX_1501 } #endif } else { Position src_x = 0; if (x + data->cursorwidth > tw->text.inner_widget->core.width - tw->primitive.shadow_thickness - tw->primitive.highlight_thickness) { cursor_width = (tw->text.inner_widget->core.width - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness)) - x; } else if (x < tw->primitive.highlight_thickness + tw->primitive.shadow_thickness) { cursor_width = data->cursorwidth - (tw->primitive.highlight_thickness + tw->primitive.shadow_thickness - x); src_x = data->cursorwidth - cursor_width; x = tw->primitive.highlight_thickness + tw->primitive.shadow_thickness; } if (y + data->cursorheight > tw->text.inner_widget->core.height - (tw->primitive.highlight_thickness + tw->primitive.shadow_thickness)) { cursor_height = data->cursorheight - ((y + data->cursorheight) - (tw->text.inner_widget->core.height - (tw->primitive.highlight_thickness + tw->primitive.shadow_thickness))); } if (cursor_width > 0 && cursor_height > 0) { XCopyArea(XtDisplay((Widget)tw), data->ibeam_off, XtWindow((Widget)tw), data->save_gc, src_x, 0, (unsigned int)cursor_width, (unsigned int)cursor_height, x, y); } } } } static void ChangeHOffset(XmTextWidget tw, int newhoffset, #if NeedWidePrototypes int redisplay_hbar) #else Boolean redisplay_hbar) #endif /* NeedWidePrototypes */ { OutputData data = tw->text.output->data; int delta; int width = tw->text.inner_widget->core.width; int height = tw->text.inner_widget->core.height; int innerwidth = width - (data->leftmargin + data->rightmargin); int innerheight = height - (data->topmargin + data->bottommargin); if (ShouldWordWrap(data, tw) || data->suspend_hoffset) return; if ((data->scrollhorizontal && XmIsScrolledWindow(XtParent(tw))) && data->scrollwidth - innerwidth < newhoffset) newhoffset = data->scrollwidth - innerwidth; if (newhoffset < 0) newhoffset = 0; if (newhoffset == data->hoffset) return; delta = newhoffset - data->hoffset; data->hoffset = newhoffset; _XmProcessLock(); posToXYCachedWidget = NULL; _XmProcessUnlock(); if (XtIsRealized((Widget)tw)) { _XmTextAdjustGC(tw); SetNormGC(tw, data->gc, False, False); if (delta < 0) { if (width > 0 && innerheight > 0) { XCopyArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), XtWindow(tw->text.inner_widget), data->gc, data->leftmargin, data->topmargin, width, innerheight, data->leftmargin - delta, data->topmargin); /* clear left margin + delta change */ if ((int) (data->leftmargin - delta - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness)) < innerwidth) XClearArea(XtDisplay(tw), XtWindow(tw), tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, data->topmargin, data->leftmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness) - delta, innerheight, False); /* clear right margin */ if ((int) (data->rightmargin- (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness)) > 0) XClearArea(XtDisplay(tw), XtWindow(tw), data->leftmargin + innerwidth, data->topmargin, data->rightmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), innerheight, False); data->exposehscroll++; } RedrawRegion(tw, data->leftmargin, 0, -delta, height); } else { if (innerwidth - delta > 0 && innerheight > 0) { XCopyArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), XtWindow(tw->text.inner_widget), data->gc, data->leftmargin + delta, data->topmargin, innerwidth - delta, innerheight, data->leftmargin, data->topmargin); /* clear right margin + delta change */ XClearArea(XtDisplay(tw), XtWindow(tw), data->leftmargin + innerwidth - delta, data->topmargin, delta + data->rightmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), innerheight, False); /* clear left margin */ if (data->leftmargin - (int)(tw->primitive.shadow_thickness + tw->primitive.highlight_thickness) > 0) XClearArea(XtDisplay(tw), XtWindow(tw), tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, data->topmargin, data->leftmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), innerheight, False); data->exposehscroll++; } else { /* clear all text */ XClearArea(XtDisplay(tw), XtWindow(tw), tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, data->topmargin, width - 2 *(tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), innerheight, False); data->exposehscroll++; } RedrawRegion(tw, width - data->rightmargin - delta, 0, delta, height); } } if (redisplay_hbar) _XmRedisplayHBar(tw); } static void ChangeVOffset(XmTextWidget tw, int newvoffset, #if NeedWidePrototypes int redisplay_vbar) #else Boolean redisplay_vbar) #endif /* NeedWidePrototypes */ { OutputData data = tw->text.output->data; int delta = 0; int width = tw->text.inner_widget->core.width; int height = tw->text.inner_widget->core.height; int innerwidth = width - (data->leftmargin + data->rightmargin); int innerheight = height - (data->topmargin + data->bottommargin); if (ShouldWordWrap(data, tw) || data->suspend_voffset) return; if ((data->scrollvertical && XmIsScrolledWindow(XtParent(tw))) && data->scrollheight - innerheight < newvoffset) newvoffset = data->scrollheight - innerheight; if (newvoffset < 0) newvoffset = 0; if (newvoffset == data->voffset) return; delta = newvoffset - data->voffset; data->voffset = newvoffset; _XmProcessLock(); posToXYCachedWidget = NULL; _XmProcessUnlock(); if (XtIsRealized((Widget)tw)) { _XmTextAdjustGC(tw); SetNormGC(tw, data->gc, False, False); if (delta < 0) { if (height > 0 && innerwidth > 0) { XCopyArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), XtWindow(tw->text.inner_widget), data->gc, data->leftmargin, data->topmargin, innerwidth, height, data->leftmargin, data->topmargin - delta); /* clear top margin + delta change */ if ((int) (data->topmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness) - delta) < innerheight) XClearArea(XtDisplay(tw), XtWindow(tw), data->leftmargin, tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, innerwidth, data->topmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness) - delta, False); /* clear right margin */ if ((int) data->topmargin - (int) (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness) > 0) XClearArea(XtDisplay(tw), XtWindow(tw), data->leftmargin, data->topmargin + innerheight, innerwidth, data->bottommargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), False); data->exposevscroll++; } RedrawRegion(tw, 0, data->topmargin, width, -delta); } else { if (innerheight - delta > 0 && innerwidth > 0) { XCopyArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), XtWindow(tw->text.inner_widget), data->gc, data->leftmargin, data->topmargin + delta, innerwidth, innerheight - delta, data->leftmargin, data->topmargin); /* clear bottom margin + delta change */ XClearArea(XtDisplay(tw), XtWindow(tw), data->leftmargin, data->topmargin + innerheight - delta, innerwidth, delta + data->bottommargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), False); /* clear top margin */ if (data->topmargin - (int)(tw->primitive.shadow_thickness + tw->primitive.highlight_thickness) > 0) XClearArea(XtDisplay(tw), XtWindow(tw), data->leftmargin, tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, innerwidth, data->topmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), False); data->exposevscroll++; } else { /* clear all text */ XClearArea(XtDisplay(tw), XtWindow(tw), data->leftmargin, tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, innerwidth, height - 2 *(tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), False); data->exposevscroll++; } RedrawRegion(tw, 0, height - data->bottommargin - delta, width, delta); } } if (redisplay_vbar) _XmRedisplayVBar(tw); } static void DrawInsertionPoint(XmTextWidget tw, XmTextPosition position, OnOrOff onoroff) { OutputData data = tw->text.output->data; if (onoroff == on) { data->cursor_on +=1; if (data->blinkrate == 0 || !data->hasfocus) data->blinkstate = on; } else { if ((data->blinkstate == on) && data->cursor_on == 0) if (data->blinkstate == CurrentCursorState(tw) && XtIsRealized((Widget)tw)) { data->blinkstate = off; /* Toggle blinkstate to off */ data->cursor_on -= 1; /* must be done before PaintCursor */ PaintCursor(tw); } else data->cursor_on -= 1; else data->cursor_on -= 1; } if (data->cursor_on < 0 || !XtIsRealized((Widget)tw)) return; if (PosToXY(tw, position, &data->insertx, &data->inserty)) PaintCursor(tw); } static void MakePositionVisible(XmTextWidget tw, XmTextPosition position) { OutputData data = tw->text.output->data; Position x, y; LineNum line_num; if (!ShouldWordWrap(data, tw) && PosToXY(tw, position, &x, &y)) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (y <= data->topmargin) { if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { if (position == tw->text.bottom_position) position = MAX(position - data->rows/2, 0); } else { line_num = _XmTextGetTableIndex(tw, position); if (position == tw->text.bottom_position || (line_num < tw->text.total_lines && position == tw->text.line_table[line_num+1].start_pos - 1)) position = MAX(position - (int) data->rows/2, line_num ? (int) (tw->text.line_table[line_num].start_pos) : 0); } (void)PosToXY(tw, position, &x, &y); } y += data->voffset; if (y - data->voffset < data->topmargin) { ChangeVOffset(tw, y - data->topmargin, True); } else if (y - data->voffset > ((Position) (tw->text.inner_widget->core.height - data->bottommargin))) { ChangeVOffset(tw, (int) (y) - (int) (tw->text.inner_widget->core.height) + (int) (data->bottommargin), True); } } else { if (x <= data->leftmargin) { if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { if (position == tw->text.bottom_position) position = MAX(position - data->columns/2, 0); } else { line_num = _XmTextGetTableIndex(tw, position); if (position == tw->text.bottom_position || (line_num < tw->text.total_lines && position == tw->text.line_table[line_num+1].start_pos - 1)) position = MAX(position - data->columns/2, line_num ? (int) (tw->text.line_table[line_num].start_pos) : 0); } (void)PosToXY(tw, position, &x, &y); } x += data->hoffset; if (x - data->hoffset < data->leftmargin) { ChangeHOffset(tw, x - data->leftmargin, True); } else if (x - data->hoffset > ((Position) (tw->text.inner_widget->core.width - data->rightmargin))) { ChangeHOffset(tw, (int) (x) - (int) (tw->text.inner_widget->core.width) + (int) (data->rightmargin), True); } } } } static void BlinkInsertionPoint(XmTextWidget tw) { OutputData data = tw->text.output->data; if ((data->cursor_on >=0) && data->blinkstate == CurrentCursorState(tw) && XtIsRealized((Widget)tw)) { /* Toggle blink state */ if (data->blinkstate == on) data->blinkstate = off; else data->blinkstate = on; PaintCursor(tw); } } static Boolean MoveLines(XmTextWidget tw, LineNum fromline, LineNum toline, LineNum destline) { OutputData data = tw->text.output->data; if (!XtIsRealized((Widget) tw)) return False; _XmTextAdjustGC(tw); SetNormGC(tw, data->gc, False, False); SetFullGC(tw, data->gc); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { XCopyArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), XtWindow(tw->text.inner_widget), data->gc, tw->text.inner_widget->core.width - data->rightmargin - (Position)data->linewidth * (toline + 1), tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, (Position)data->linewidth * (toline - fromline + 1), tw->text.inner_widget->core.height - 2 * (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), tw->text.inner_widget->core.width - data->rightmargin - (Position)data->linewidth * (destline + toline - fromline + 1), tw->primitive.shadow_thickness + tw->primitive.highlight_thickness); } else { XCopyArea(XtDisplay(tw), XtWindow(tw->text.inner_widget), XtWindow(tw->text.inner_widget), data->gc, tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, (Position) data->lineheight * fromline + data->topmargin, tw->text.inner_widget->core.width - 2 * (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness), data->lineheight * (toline - fromline + 1), tw->primitive.shadow_thickness + tw->primitive.highlight_thickness, (Position) data->lineheight * destline + data->topmargin); } SetMarginGC(tw, data->gc); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) data->exposehscroll++; else data->exposevscroll++; return True; } /* ARGSUSED */ static void OutputInvalidate(XmTextWidget tw, XmTextPosition position, XmTextPosition topos, long delta) { _XmProcessLock(); posToXYCachedWidget = NULL; _XmProcessUnlock(); } static void RefigureDependentInfo(XmTextWidget tw) { OutputData data = tw->text.output->data; data->columns = data->number_lines; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { data->rows = (short)(((int) tw->core.height - (data->topmargin + data->bottommargin)) / (int) (data->font_ascent + data->font_descent)); if (data->rows <= 0) data->rows = 1; } else { data->rows = data->number_lines; data->columns = (short)(((int) tw->core.width - (data->leftmargin + data->rightmargin)) / (data->averagecharwidth)); if (data->columns <= 0) data->columns = 1; } } static void SizeFromRowsCols(XmTextWidget tw, Dimension *width, Dimension *height) { OutputData data = tw->text.output->data; short lines = 0; if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) lines = 1; else { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) lines = data->columns_set; else lines = data->rows_set; } if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { *width = (Dimension) ((lines * data->linewidth) + data->leftmargin + data->rightmargin); *height = (Dimension) ((data->rows_set * (data->font_ascent + data->font_descent)) + data->topmargin + data->bottommargin); if (tw->text.source->data->length > 0 && data->resizeheight) { XmTextPosition nextpos; LineTableExtra extra = NULL; Boolean past_end = False; int i; for (i = 0; i < tw->text.number_lines && !past_end; i++) { past_end = !MeasureLine(tw, i, tw->text.line[i].start, &nextpos, &extra); if (extra) { if (extra->width > *height) *height = extra->width; XtFree((char *)extra); } } } } else { *width = (Dimension) ((data->columns_set * data->averagecharwidth) + data->leftmargin + data->rightmargin); if (tw->text.source->data->length > 0 && data->resizewidth) { XmTextPosition nextpos; LineTableExtra extra = NULL; Boolean past_end = False; int i; for (i = 0; i < tw->text.number_lines && !past_end; i++) { past_end = !MeasureLine(tw, i, tw->text.line[i].start, &nextpos, &extra); if (extra) { if (extra->width > *width) *width = extra->width; XtFree((char *)extra); } } } *height = (Dimension) ((lines * data->lineheight) + data->topmargin + data->bottommargin); } } static Boolean LoadFontMetrics(XmTextWidget tw) { OutputData data = tw->text.output->data; XmFontContext context; XmFontListEntry next_entry; XmFontType type_return = XmFONT_IS_FONT; XtPointer tmp_font; Boolean have_font_struct = False; Boolean have_font_set = False; #ifdef USE_XFT Boolean have_xft_font = False; #endif XFontSetExtents *fs_extents; XFontStruct *font = NULL; unsigned long width = 0; char* font_tag = NULL; if (!XmFontListInitFontContext(&context, data->fontlist)) XmeWarning((Widget) tw, MSG3); do { next_entry = XmFontListNextEntry(context); if (next_entry && (tmp_font = XmFontListEntryGetFont(next_entry, &type_return))) { if (type_return == XmFONT_IS_FONTSET) { font_tag = XmFontListEntryGetTag(next_entry); if (!have_font_set) { /* this saves the first fontset found, just in * case we don't find a default tag set. */ data->use_fontset = True; #ifdef USE_XFT data->use_xft = False; #endif data->font = (XFontStruct *)tmp_font; have_font_struct = True; /* we have a font set, so no need to * consider future font structs */ have_font_set = True; /* we have a font set. */ if (!strcmp(XmFONTLIST_DEFAULT_TAG, font_tag)) { if (font_tag) XtFree(font_tag); break; /* Break out! We've found the one we want. */ } } else if (!strcmp(XmFONTLIST_DEFAULT_TAG, font_tag)) { data->font = (XFontStruct *)tmp_font; have_font_set = True; /* we have a font set. */ if (font_tag) XtFree(font_tag); break; /* Break out! We've found the one we want. */ } if (font_tag) XtFree(font_tag); } else if (type_return == XmFONT_IS_FONT && !have_font_struct) { data->use_fontset = False; #ifdef USE_XFT data->use_xft = False; #endif /* save the first one in case no font set is found */ data->font = (XFontStruct*)tmp_font; data->use_fontset = False; have_font_struct = True; #ifdef USE_XFT } else if (type_return == XmFONT_IS_XFT && !have_xft_font) { data->use_fontset = False; data->use_xft = True; have_xft_font = True; data->font = (XFontStruct*)tmp_font; #endif } } } while(next_entry != NULL); #if USE_XFT if (!have_font_struct && !have_font_set && !have_xft_font) { #else if (!have_font_struct && !have_font_set) { #endif XmeWarning ((Widget)tw, MSG4); /* fontlist without font null entry cause core dump */ return False; } XmFontListFreeFontContext(context); if(data->use_fontset) { fs_extents = XExtentsOfFontSet((XFontSet)data->font); if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { width = (unsigned long)fs_extents->max_ink_extent.width; } else { width = (unsigned long)fs_extents->max_logical_extent.width; } /* max_logical_extent.y is number of pixels from origin to top of * rectangle (i.e. y is negative) */ data->font_ascent = -fs_extents->max_logical_extent.y; data->font_descent = fs_extents->max_logical_extent.height + fs_extents->max_logical_extent.y; #ifdef USE_XFT } else if (data->use_xft) { width = ((XftFont*)data->font)->max_advance_width; data->font_ascent = ((XftFont*)data->font)->ascent; data->font_descent = ((XftFont*)data->font)->descent; #endif } else { font = data->font; data->font_ascent = font->max_bounds.ascent; data->font_descent = font->max_bounds.descent; if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { width = font->max_bounds.rbearing - font->max_bounds.lbearing; } else { if ((!XGetFontProperty(font, XA_QUAD_WIDTH, &width)) || width == 0) { if (font->per_char && font->min_char_or_byte2 <= '0' && font->max_char_or_byte2 >= '0') width = font->per_char['0' - font->min_char_or_byte2].width; else width = font->max_bounds.width; } } } if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (width <= 0) width = 1; data->linewidth = width; data->averagecharwidth = (int) width; data->tabheight = (int)(8 * (data->font_ascent + data->font_descent)); } else { data->lineheight = data->font_descent + data->font_ascent; if (width <= 0) width = 1; data->averagecharwidth = (int) width; /* This assumes there will be no truncation */ if (data->use_fontset) { data->tabwidth = 8 * XmbTextEscapement((XFontSet)data->font, "0", 1); /* Check if tabwidth was not calculated correctly */ if (data->tabwidth == 0) data->tabwidth = (int)(8 * width); } else { data->tabwidth = (int)(8 * width); /* This assumes there will be no truncation */ } } return True; } static Boolean SetXOCOrientation(XmTextWidget tw, XOC oc, XOrientation orientation) { XOM om; XOMOrientation orients; int i = 0; if(!oc) return False; om = XOMOfOC(oc); if(om) { if(!XGetOMValues(om, XNQueryOrientation, &orients, NULL)) { for (i = 0 ; i < orients.num_orientation ; i++) { if(orients.orientation[i] == orientation) { if(XSetOCValues(oc, XNOrientation, orientation, NULL)!=NULL) return False; } } } else return False; } else return False; return True; } static void LoadGCs(XmTextWidget tw, Pixel background, Pixel foreground) { OutputData data = tw->text.output->data; XGCValues values; unsigned long valueMask = (GCFunction | GCForeground | GCBackground | GCGraphicsExposures); unsigned long dynamicMask = GCClipMask; unsigned long unusedMask = GCClipXOrigin | GCClipYOrigin | GCFont; /* *Get GC for saving area under cursor. */ values.function = GXcopy; values.foreground = tw->primitive.foreground; values.background = tw->core.background_pixel; values.graphics_exposures = (Bool) False; if (data->save_gc != NULL) XtReleaseGC((Widget) tw, data->save_gc); data->save_gc = XtAllocateGC((Widget) tw, tw->core.depth, valueMask, &values, dynamicMask, unusedMask); /* * Get GC for drawing text. */ #if USE_XFT if (!data->use_fontset && !data->use_xft) { #else if (!data->use_fontset) { #endif valueMask |= GCFont; values.font = data->font->fid; } values.graphics_exposures = (Bool) True; values.foreground = foreground ^ background; values.background = 0; if (data->gc != NULL) XtReleaseGC((Widget) tw, data->gc); dynamicMask |= GCForeground | GCBackground | GCFillStyle | GCStipple; data->gc = XtAllocateGC((Widget) tw, tw->core.depth, valueMask, &values, dynamicMask, 0); /* Create a temporary GC - change it later in MakeIBeamStencil */ valueMask |= GCStipple | GCFillStyle; values.graphics_exposures = (Bool) False; values.stipple = data->stipple_tile; values.fill_style = FillStippled; if (data->imagegc != NULL) XtReleaseGC((Widget) tw, data->imagegc); dynamicMask |= (GCTileStipXOrigin | GCTileStipYOrigin | GCFunction); data->imagegc = XtAllocateGC((Widget) tw, tw->core.depth, valueMask, &values, dynamicMask, 0); } static void MakeIBeamOffArea(XmTextWidget tw, #if NeedWidePrototypes int width, int height) #else Dimension width, Dimension height) #endif /* NeedWidePrototypes */ { OutputData data = tw->text.output->data; Display *dpy = XtDisplay(tw); Screen *screen = XtScreen((Widget)tw); /* Create a pixmap for storing the screen data where the I-Beam will * be painted */ data->ibeam_off = XCreatePixmap(dpy, RootWindowOfScreen(screen), width, height, tw->core.depth); data->refresh_ibeam_off = True; } static Pixmap FindPixmap( Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth ) { XmAccessColorDataRec acc_color_rec; acc_color_rec.foreground = foreground; acc_color_rec.background = background; acc_color_rec.top_shadow_color = XmUNSPECIFIED_PIXEL; acc_color_rec.bottom_shadow_color = XmUNSPECIFIED_PIXEL; acc_color_rec.select_color = XmUNSPECIFIED_PIXEL; acc_color_rec.highlight_color = XmUNSPECIFIED_PIXEL; return _XmGetColoredPixmap(screen, image_name, &acc_color_rec, depth, True); } static void MakeIBeamStencil(XmTextWidget tw, int line_width) { Screen *screen = XtScreen((Widget)tw); char pixmap_name[64]; XGCValues values; unsigned long valueMask; OutputData data = tw->text.output->data; sprintf(pixmap_name, "_XmText_%d_%d", data->cursorheight, line_width); data->cursor = FindPixmap(screen, pixmap_name, 1, 0, 1); if (data->cursor == XmUNSPECIFIED_PIXMAP) { Display *dpy = XtDisplay(tw); XSegment segments[3]; /* Create a pixmap for the I-Beam stencil */ data->cursor = XCreatePixmap(dpy, XtWindow(tw), data->cursorwidth, data->cursorheight, 1); values.foreground = 0; values.line_width = 0; values.fill_style = FillSolid; values.function = GXcopy; valueMask = GCForeground | GCLineWidth | GCFillStyle | GCFunction; XChangeGC(dpy, data->cursor_gc, valueMask, &values); XFillRectangle(dpy, data->cursor, data->cursor_gc, 0, 0, data->cursorwidth, data->cursorheight); /* Change the GC for use in "cutting out" the I-Beam shape */ values.foreground = 1; values.line_width = line_width; XChangeGC(dpy, data->cursor_gc, GCForeground | GCLineWidth, &values); /* Draw the segments of the I-Beam */ if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { /* 1st segment is the left vertical line of the cursor */ segments[0].x1 = 1; segments[0].y1 = line_width - 1; segments[0].x2 = 1; segments[0].y2 = data->cursorheight - 1; /* 2nd segment is the right vertical line of the cursor */ segments[1].x1 = data->cursorwidth - 1; segments[1].y1 = line_width - 1; segments[1].x2 = data->cursorwidth - 1; segments[1].y2 = data->cursorheight - 1; /* 3rd segment is the horizontal line of the cursor */ segments[2].x1 = 0; segments[2].y1 = data->cursorheight >> 1; segments[2].x2 = data->cursorwidth; segments[2].y2 = data->cursorheight >> 1; } else { /* 1st segment is the top horizontal line of the 'I' */ segments[0].x1 = 0; segments[0].y1 = line_width - 1; segments[0].x2 = data->cursorwidth; segments[0].y2 = line_width - 1; /* 2nd segment is the bottom horizontal line of the 'I' */ segments[1].x1 = 0; segments[1].y1 = data->cursorheight - 1; segments[1].x2 = data->cursorwidth; segments[1].y2 = data->cursorheight - 1; /* 3rd segment is the vertical line of the 'I' */ segments[2].x1 = data->cursorwidth >> 1; segments[2].y1 = line_width; segments[2].x2 = data->cursorwidth >> 1; segments[2].y2 = data->cursorheight - 1; } /* Draw the segments onto the cursor */ XDrawSegments(dpy, data->cursor, data->cursor_gc, segments, 3); /* Install the cursor for pixmap caching */ (void) _XmCachePixmap(data->cursor, screen, pixmap_name, 1, 0, 1, data->cursorwidth, data->cursorheight); } valueMask = (GCForeground | GCBackground | GCStipple | GCFillStyle); if (tw->text.input->data->overstrike) { values.background = values.foreground = tw->core.background_pixel ^ tw->primitive.foreground; } else { values.foreground = tw->primitive.foreground; values.background = tw->core.background_pixel; } values.stipple = data->cursor; values.fill_style = FillStippled; XChangeGC(XtDisplay(tw), data->imagegc, valueMask, &values); } /* The IBeam Stencil must have already been created before this routine * is called. */ /* ARGSUSED */ static void MakeAddModeCursor(XmTextWidget tw, int line_width) { Screen *screen = XtScreen((Widget)tw); char pixmap_name[64]; OutputData data = tw->text.output->data; sprintf(pixmap_name, "_XmText_AddMode_%d_%d", data->cursorheight,line_width); data->add_mode_cursor = FindPixmap(screen, pixmap_name, 1, 0, 1); if (data->add_mode_cursor == XmUNSPECIFIED_PIXMAP) { XtGCMask valueMask; XGCValues values; Display *dpy = XtDisplay((Widget)tw); data->add_mode_cursor = XCreatePixmap(dpy, XtWindow((Widget)tw), data->cursorwidth, data->cursorheight, 1); values.function = GXcopy; valueMask = GCFunction; XChangeGC(dpy, data->cursor_gc, valueMask, &values); XCopyArea(dpy, data->cursor, data->add_mode_cursor, data->cursor_gc, 0, 0, data->cursorwidth, data->cursorheight, 0, 0); valueMask = (GCTile | GCFillStyle | GCForeground | GCBackground | GCFunction | GCTileStipXOrigin); values.function = GXand; values.tile = data->stipple_tile; values.fill_style = FillTiled; values.ts_x_origin = -1; values.foreground = tw->primitive.foreground; values.background = tw->core.background_pixel; XChangeGC(XtDisplay((Widget)tw), data->cursor_gc, valueMask, &values); XFillRectangle(dpy, data->add_mode_cursor, data->cursor_gc, 0, 0, data->cursorwidth, data->cursorheight); /* Install the pixmap for pixmap caching */ _XmCachePixmap(data->add_mode_cursor, screen, pixmap_name, 1, 0, 1, data->cursorwidth, data->cursorheight); } } static void MakeCursors(XmTextWidget tw) { OutputData data = tw->text.output->data; Screen *screen = XtScreen(tw); int line_width = 1; int oldwidth = data->cursorwidth; int oldheight = data->cursorheight; if (!XtIsRealized((Widget) tw)) return; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { data->cursorwidth = data->averagecharwidth; data->cursorheight = 5; /* setup parameters to make a thicker I-Beam */ if (data->cursorwidth > 19) { data->cursorheight++; line_width = 2; } } else { data->cursorwidth = 5; data->cursorheight = data->font_ascent + data->font_descent; /* setup parameters to make a thicker I-Beam */ if (data->cursorheight > 19) { data->cursorwidth++; line_width = 2; } } if (data->cursor == XmUNSPECIFIED_PIXMAP || data->add_mode_cursor == XmUNSPECIFIED_PIXMAP || data->ibeam_off == XmUNSPECIFIED_PIXMAP || oldheight != data->cursorheight || oldwidth != data->cursorwidth) { if (data->cursor_gc == NULL) { unsigned long valueMask = 0; XGCValues values; unsigned long dynamicMask = GCForeground | GCLineWidth | GCTile | GCFillStyle | GCBackground | GCFunction | GCTileStipXOrigin; data->cursor_gc = XtAllocateGC((Widget)tw, 1, valueMask, &values, dynamicMask, 0); } /* Remove old ibeam_off pixmap */ if (data->ibeam_off != XmUNSPECIFIED_PIXMAP) XFreePixmap(XtDisplay((Widget)tw), data->ibeam_off); /* Remove old insert stencil */ if (data->cursor != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(screen, data->cursor); /* Remove old add mode cursor */ if (data->add_mode_cursor != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(screen, data->add_mode_cursor); /* Create area in which to save text located underneath I beam */ MakeIBeamOffArea(tw, MAX((int) data->cursorwidth, (int) data->cursorheight >> 1), data->cursorheight); /* Create a new i-beam stencil */ MakeIBeamStencil(tw, line_width); /* Create a new add_mode cursor */ MakeAddModeCursor(tw, line_width); } if (tw->text.input->data->overstrike) data->cursorwidth = data->cursorheight >> 1; } static void OutputGetValues(Widget w, ArgList args, Cardinal num_args) { XmTextWidget tw = (XmTextWidget) w; RefigureDependentInfo(tw); XtGetSubvalues((XtPointer) tw->text.output->data, output_resources, XtNumber(output_resources), args, num_args); } static Boolean CKCols(ArgList args, Cardinal num_args) { register ArgList arg; for (arg = args; num_args != 0; num_args--, arg++) { if (strcmp(arg->name, XmNcolumns) == 0) return(True); } return(False); } static Boolean CKRows(ArgList args, Cardinal num_args) { register ArgList arg; for (arg = args; num_args != 0; num_args--, arg++) { if (strcmp(arg->name, XmNrows) == 0) return(True); } return(False); } /* ARGSUSED */ static Boolean OutputSetValues(Widget oldw, Widget reqw, Widget new_w, ArgList args, Cardinal *num_args) { #define CK(fld) (newdata->fld != data->fld) #define CP(fld) (data->fld = newdata->fld) XmTextWidget oldtw = (XmTextWidget) oldw; XmTextWidget newtw = (XmTextWidget) new_w; OutputData data = newtw->text.output->data; OutputDataRec newdatarec; OutputData newdata = &newdatarec; Boolean needgcs = False; Boolean newsize = False; Boolean o_redisplay = False; Dimension new_width = newtw->core.width;/* save in case something changes */ Dimension new_height = newtw->core.height;/* these values during SetValues*/ XPoint xmim_point; XRectangle xmim_area; Arg im_args[17]; Cardinal n = 0; *newdata = *data; XtSetSubvalues((XtPointer) newdata, output_resources, XtNumber(output_resources), args, *num_args); if (newtw->core.background_pixel != oldtw->core.background_pixel) { needgcs = True; } if (newtw->primitive.foreground != oldtw->primitive.foreground) { needgcs = True; } if (CK(fontlist) || CK(rendertable)) { XmRenderTableFree(data->fontlist); if (CK(rendertable)) { if (newdata->rendertable == NULL) newdata->fontlist = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); else newdata->fontlist = XmRenderTableCopy(newdata->rendertable, NULL, 0); } else if (CK(fontlist)) { if (newdata->fontlist == NULL) newdata->fontlist = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); else newdata->fontlist = XmRenderTableCopy(newdata->fontlist, NULL, 0); } newdata->rendertable = newdata->fontlist; CP(fontlist); CP(rendertable); if(! LoadFontMetrics(newtw)) { XmRenderTableFree(newdata->fontlist); newdata->fontlist = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); newdata->rendertable = newdata->fontlist; CP(fontlist); CP(rendertable); (void)LoadFontMetrics(newtw); } /* We want to be able to connect to an IM if XmNfontList has changed. */ if (newtw->text.editable) { newtw->text.editable = False; XmTextSetEditable(new_w, True); } if(XmDirectionMatch(XmPrim_layout_direction(newtw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (data->vbar) { XmNavigatorDataRec nav_data; int new_sliderSize = 0; data->ignorevbar = True; new_sliderSize = newtw->text.inner_widget->core.height - (data->topmargin + data->bottommargin); if (new_sliderSize < 1) new_sliderSize = 1; if (new_sliderSize > data->scrollheight) new_sliderSize = data->scrollheight; nav_data.value.y = data->voffset; nav_data.minimum.y = 0; nav_data.maximum.y = data->scrollheight; nav_data.slider_size.y = new_sliderSize; nav_data.increment.y = data->font_ascent + data->font_descent; nav_data.page_increment.y = 0; nav_data.dimMask = NavigDimensionY; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement; _XmSFUpdateNavigatorsValue(XtParent(new_w), &nav_data, True); data->ignorevbar = False; } } else { if (data->hbar) { XmNavigatorDataRec nav_data; int new_sliderSize; data->ignorehbar = True; new_sliderSize = newtw->text.inner_widget->core.width - (data->leftmargin + data->rightmargin); if (new_sliderSize < 1) new_sliderSize = 1; if (new_sliderSize > data->scrollwidth) new_sliderSize = data->scrollwidth; nav_data.value.x = data->hoffset; nav_data.minimum.x = 0; nav_data.maximum.x = data->scrollwidth; nav_data.slider_size.x = new_sliderSize; nav_data.increment.x = data->averagecharwidth; nav_data.page_increment.x = 0; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement; _XmSFUpdateNavigatorsValue(XtParent(new_w), &nav_data, True); data->ignorehbar = False; } } o_redisplay = True; needgcs = True; newsize = True; } if (data->fontlist != oldtw->text.output->data->fontlist || newtw->core.background_pixel != oldtw->core.background_pixel || newtw->primitive.foreground != oldtw->primitive.foreground) { XtSetArg(im_args[n], XmNbackground, newtw->core.background_pixel); n++; XtSetArg(im_args[n], XmNforeground, newtw->primitive.foreground); n++; XtSetArg(im_args[n], XmNfontList, data->fontlist); n++; } /* Don't word wrap, have multiple row or have vertical scrollbars if editMode is single_line */ if (newtw->text.edit_mode != oldtw->text.edit_mode) { if (newtw->text.edit_mode == XmSINGLE_LINE_EDIT) newdata->rows = 1; if(XmDirectionMatch(XmPrim_layout_direction(newtw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (newtw->text.edit_mode == XmSINGLE_LINE_EDIT) { if (data->hbar) XtUnmanageChild(data->hbar); } else { if (data->hbar) XtManageChild(data->hbar); } if (newtw->text.edit_mode == XmSINGLE_LINE_EDIT) { if (data->vbar) XtUnmanageChild(data->vbar); } else { if (data->vbar) XtManageChild(data->vbar); } } else { if (data->hbar) XtManageChild(data->hbar); if (newtw->text.edit_mode != XmSINGLE_LINE_EDIT) { if (data->vbar) XtManageChild(data->vbar); } else { if (data->vbar) XtUnmanageChild(data->vbar); } } o_redisplay = True; } /* what is called margin, in this code, is composed of margin, shadow, and highlight. Previously, only margin was accomodated. This addition may not be very clever, but it blends in with the rest of the way this code works. */ if (newtw->text.margin_width != oldtw->text.margin_width || newtw->text.margin_height != oldtw->text.margin_height || newtw->primitive.shadow_thickness != oldtw->primitive.shadow_thickness || newtw->primitive.highlight_thickness != oldtw->primitive.highlight_thickness) { data->leftmargin = data->rightmargin = newtw->text.margin_width + newtw->primitive.shadow_thickness + newtw->primitive.highlight_thickness; data->topmargin = data->bottommargin = newtw->text.margin_height + newtw->primitive.shadow_thickness + newtw->primitive.highlight_thickness; o_redisplay = True; newsize = True; } if (CK(wordwrap)) { if(XmDirectionMatch(XmPrim_layout_direction(newtw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { /* If we are turning on wrapping, we don't want any horiz. offset */ if (!data->wordwrap) ChangeVOffset(newtw, 0, True); if (data->vbar) { if (newdata->wordwrap) { XmNavigatorDataRec nav_data; data->ignorevbar = True; nav_data.value.y = 0; nav_data.minimum.y = 0; nav_data.maximum.y = 1; nav_data.slider_size.y = 1; nav_data.increment.y = 0; nav_data.page_increment.y = 0; nav_data.dimMask = NavigDimensionY; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize; _XmSFUpdateNavigatorsValue(XtParent(new_w), &nav_data, True); data->ignorevbar = False; data->voffset = 0; } else { _XmRedisplayVBar(newtw); } } } else { /* If we are turning on wrapping, we don't want any horiz. offset */ if (!data->wordwrap) ChangeHOffset(newtw, 0, True); if (data->hbar) { if (newdata->wordwrap) { XmNavigatorDataRec nav_data; data->ignorehbar = True; nav_data.value.x = 0; nav_data.minimum.x = 0; nav_data.maximum.x = 1; nav_data.slider_size.x = 1; nav_data.increment.x = 0; nav_data.page_increment.x = 0; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize; _XmSFUpdateNavigatorsValue(XtParent(new_w), &nav_data, True); data->ignorehbar = False; data->hoffset = 0; } else { _XmRedisplayHBar(newtw); } } } CP(wordwrap); _XmTextRealignLineTable(newtw, NULL, 0, 0, 0, PASTENDPOS); /* If we've just turned off wrapping, get new top_character by scanning */ /* left from the current top character until we find a new line. */ if (!oldtw->text.output->data->wordwrap) { if (data->resizeheight) newtw->text.top_character = newtw->text.new_top = 0; else { newtw->text.top_character = (*newtw->text.source->Scan) (newtw->text.source, newtw->text.top_character, XmSELECT_LINE, XmsdLeft, 1, False); newtw->text.new_top = newtw->text.top_character; } } if (newtw->text.top_character) newtw->text.top_line = CountLines(newtw, 0, newtw->text.top_character); o_redisplay = True; } if (data->hasfocus && XtIsSensitive((Widget)newtw) && CK(blinkrate)) { if (newdata->blinkrate == 0) { data->blinkstate = on; if (data->timerid) { XtRemoveTimeOut(data->timerid); data->timerid = (XtIntervalId)0; } } else if (data->timerid == (XtIntervalId)0) { data->timerid = XtAppAddTimeOut(XtWidgetToApplicationContext(new_w), (unsigned long) newdata->blinkrate, HandleTimer, (XtPointer) newtw); } } CP(blinkrate); CP(resizewidth); CP(resizeheight); CP(cursor_position_visible); if (needgcs) { EraseInsertionPoint(newtw); LoadGCs(newtw, newtw->core.background_pixel, newtw->primitive.foreground); if (XtIsRealized(new_w)) { MakeCursors(newtw); } TextDrawInsertionPoint(newtw); o_redisplay = True; } if (newdata->rows <= 0) { XmeWarning(new_w, MSG1); newdata->rows = data->rows; } if (newdata->columns <= 0) { XmeWarning(new_w, MSG2); newdata->columns = data->columns; } /* Process arglist to verify the a value is being set */ if (CKCols(args, *num_args)) data->columns_set = newdata->columns_set = newdata->columns; /* Process arglist to verify the a value is being set */ if (CKRows(args, *num_args)) data->rows_set = newdata->rows_set = newdata->rows; if (!(new_width != oldtw->core.width && new_height != oldtw->core.height)) { if (CK(columns) || CK(rows) || newsize) { Dimension width, height; SizeFromRowsCols(newtw, &width, &height); if(XmDirectionMatch(XmPrim_layout_direction(newtw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (new_width == oldtw->core.width) newtw->core.width = width; data->minwidth = newtw->core.width; if (new_height == oldtw->core.height) { newtw->core.height = height; data->minheight = (Dimension)((data->rows_set * (data->font_ascent + data->font_descent)) + data->topmargin + data->bottommargin); } else { data->minheight = new_height; } } else { if (new_width == oldtw->core.width) { newtw->core.width = width; data->minwidth = (Dimension)((data->columns_set * data->averagecharwidth) + data->leftmargin + data->rightmargin); } else { data->minwidth = new_width; } if (new_height == oldtw->core.height) newtw->core.height = height; data->minheight = newtw->core.height; } CP(columns); CP(rows); o_redisplay = True; } } else { newtw->core.width = new_width; data->minwidth = new_width; newtw->core.height = new_height; data->minheight = new_height; } PosToXY(newtw, newtw->text.cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)newtw, &xmim_area); XtSetArg(im_args[n], XmNbackgroundPixmap, newtw->core.background_pixmap);n++; XtSetArg(im_args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(im_args[n], XmNarea, &xmim_area); n++; XtSetArg(im_args[n], XmNlineSpace, newdata->lineheight); n++; XmImSetValues(new_w, im_args, n); return (o_redisplay); #undef CK #undef CP } static void NotifyResized(Widget w, #if NeedWidePrototypes int o_create) #else Boolean o_create) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; Boolean resizewidth = data->resizewidth; Boolean resizeheight = data->resizeheight; XmTextPosition linestart = 0; XmTextPosition position; XPoint xmim_point; XRectangle xmim_area; int n; XmTextBlockRec block; Arg args[10]; data->resizewidth = data->resizeheight = False; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { data->number_lines = tw->text.inner_widget->core.width - data->leftmargin - data->rightmargin; if (data->number_lines < (int) data->linewidth || !data->linewidth) data->number_lines = 1; else data->number_lines /= (int) data->linewidth; if (tw->text.top_character) { tw->text.top_line = CountLines(tw, 0, tw->text.top_character); if (tw->text.total_lines >= data->number_lines && (tw->text.total_lines - tw->text.top_line) < data->number_lines) tw->text.top_line = tw->text.total_lines - data->number_lines; tw->text.new_top = tw->text.line_table[tw->text.top_line].start_pos; } } else { data->number_lines = tw->text.inner_widget->core.height - data->topmargin - data->bottommargin; if (data->number_lines < (int) data->lineheight || !data->lineheight) data->number_lines = 1; else data->number_lines /= (int) data->lineheight; if (tw->text.top_character) { tw->text.top_line = CountLines(tw, 0, tw->text.top_character); if (tw->text.total_lines >= data->number_lines && (tw->text.total_lines - tw->text.top_line) < data->number_lines) tw->text.top_line = tw->text.total_lines - data->number_lines; tw->text.new_top = tw->text.line_table[tw->text.top_line].start_pos; } } if (data->vbar) { int local_total, new_size; XmNavigatorDataRec nav_data; #ifdef FIX_1396 int new_voffset = 0; #endif if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { new_size = tw->text.inner_widget->core.height - (data->topmargin + data->bottommargin); if (new_size < 1) new_size = 1; if (new_size > data->scrollheight) new_size = data->scrollheight; #ifdef FIX_1396 new_voffset = data->voffset; if (new_voffset > data->scrollheight - new_size) new_voffset = data->scrollheight - new_size; #endif data->ignorevbar = True; #ifdef FIX_1396 nav_data.value.y = new_voffset; #else nav_data.value.y = data->voffset; #endif nav_data.minimum.y = 0; nav_data.maximum.y = data->scrollheight; nav_data.slider_size.y = new_size; nav_data.page_increment.y = new_size; } else { data->ignorevbar = True; if (tw->text.top_line + tw->text.number_lines > tw->text.total_lines) local_total = tw->text.top_line + tw->text.number_lines; else local_total = tw->text.total_lines; if (local_total >= tw->text.number_lines) new_size = tw->text.number_lines; else new_size = local_total; if (new_size + tw->text.top_line > local_total) new_size = local_total - tw->text.top_line; nav_data.value.y = tw->text.top_line; nav_data.minimum.y = 0; nav_data.maximum.y = local_total; nav_data.slider_size.y = new_size; nav_data.page_increment.y = (data->number_lines > 1)? (data->number_lines - 1): 1; } nav_data.dimMask = NavigDimensionY; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorevbar = False; } if (data->hbar) { XmNavigatorDataRec nav_data; int new_size = 0; int local_total = 0; #ifdef FIX_1396 int new_hoffset = 0; #endif if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { data->ignorehbar = True; if (tw->text.top_line + tw->text.number_lines > tw->text.total_lines) local_total = tw->text.top_line + tw->text.number_lines; else local_total = tw->text.total_lines; if (local_total >= tw->text.number_lines) new_size = tw->text.number_lines; else new_size = local_total; if (new_size + tw->text.top_line > local_total) new_size = local_total - tw->text.top_line; nav_data.value.x = tw->text.top_line; nav_data.minimum.x = 0; nav_data.maximum.x = local_total; nav_data.slider_size.x = new_size; nav_data.page_increment.x = (data->number_lines > 1)? (data->number_lines - 1): 1; } else { new_size = tw->text.inner_widget->core.width - (data->leftmargin + data->rightmargin); if (new_size < 1) new_size = 1; if (new_size > data->scrollwidth) new_size = data->scrollwidth; #ifdef FIX_1396 new_hoffset = data->hoffset; if (new_hoffset > data->scrollwidth - new_size) new_hoffset = data->scrollwidth - new_size; #endif data->ignorehbar = True; #ifdef FIX_1396 nav_data.value.x = new_hoffset; #else nav_data.value.x = data->hoffset; #endif nav_data.minimum.x = 0; nav_data.maximum.x = data->scrollwidth; nav_data.slider_size.x = new_size; nav_data.page_increment.x = new_size; } nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorehbar = False; } RefigureDependentInfo(tw); if (resizewidth) data->columns_set = data->columns; if (resizeheight) data->rows_set = data->rows; if (XtIsRealized(w)) { XClearWindow(XtDisplay(tw), XtWindow(tw->text.inner_widget)); data->refresh_ibeam_off = True; } if (!o_create) /* False only if called from OutputCreate */ _XmTextInvalidate(tw, (XmTextPosition) 0, (XmTextPosition) 0, NODELTA); /* the new size grew enough to include new text */ if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { /* this assumes only one line of text! (linestart = 0) */ #ifdef AS_TEXTFIELD ChangeVOffset(tw, 0, True); #else int text_height = data->topmargin; /* to make tab calculation correct */ int new_height = tw->core.height - (data->topmargin + data->bottommargin); position = (*tw->text.source->Scan)(tw->text.source, linestart, XmSELECT_LINE, XmsdRight, 1, False); while (linestart < position) { linestart = (*tw->text.source->ReadSource) (tw->text.source, linestart, position, &block); text_height += FindHeight(tw, text_height, &block, 0, block.length); } text_height -= data->topmargin; if (text_height - new_height < data->voffset) { /* space top over */ if (text_height - new_height >= 0) ChangeVOffset(tw, text_height - new_height, True); else ChangeVOffset(tw, 0, True); } #endif if (tw->text.auto_show_cursor_position) { MakePositionVisible(tw, tw->text.cursor_position); } } else _XmRedisplayVBar(tw); } else { if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { /* this assumes only one line of text! (linestart = 0) */ #ifdef AS_TEXTFIELD ChangeHOffset(tw, 0, True); #else int text_width = data->leftmargin; /* to make tab calculation correct */ int new_width = tw->core.width - (data->leftmargin + data->rightmargin); position = (*tw->text.source->Scan)(tw->text.source, linestart, XmSELECT_LINE, XmsdRight, 1, False); while (linestart < position) { linestart = (*tw->text.source->ReadSource) (tw->text.source, linestart, position, &block); text_width += FindWidth(tw, text_width, &block, 0, block.length); } text_width -= data->leftmargin; if (text_width - new_width < data->hoffset) { /* space left over */ if (text_width - new_width >= 0) ChangeHOffset(tw, text_width - new_width, True); else ChangeHOffset(tw, 0, True); } #endif if (tw->text.auto_show_cursor_position) { MakePositionVisible(tw, tw->text.cursor_position); } } else _XmRedisplayHBar(tw); } data->resizewidth = resizewidth; data->resizeheight = resizeheight; if (XtIsRealized(w)) _XmTextDrawShadow(tw); /* Text is now rediplayed at the correct location, so force the tw to * refresh the putback area. */ data->refresh_ibeam_off = True; /* Somehow we need to let the input method know that the window has * changed size (for case of over-the-spot). Try telling it that * the cursor position has changed and hopefully it will re-evaluate * the position/visibility/... of the pre-edit window. */ PosToXY(tw, tw->text.cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); n = 0; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XmImSetValues(w, args, n); } /* ARGSUSED */ static void HandleTimer(XtPointer closure, XtIntervalId *id) { XmTextWidget tw = (XmTextWidget) closure; OutputData data = tw->text.output->data; if (data->blinkrate != 0) data->timerid = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget) tw), (unsigned long)data->blinkrate, HandleTimer, (XtPointer) closure); if (data->hasfocus && XtIsSensitive((Widget)tw)) BlinkInsertionPoint(tw); } /***************************************************************************** * To make TextOut a True "Object" this function should be a class function. * *****************************************************************************/ void _XmTextChangeBlinkBehavior(XmTextWidget tw, #if NeedWidePrototypes int newvalue) #else Boolean newvalue) #endif /* NeedWidePrototypes */ { OutputData data = tw->text.output->data; if (newvalue) { if (data->blinkrate != 0 && data->timerid == (XtIntervalId)0) data->timerid = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget) tw), (unsigned long)data->blinkrate, HandleTimer, (XtPointer) tw); data->blinkstate = on; } else { if (data->timerid) XtRemoveTimeOut(data->timerid); data->timerid = (XtIntervalId)0; } } /* ARGSUSED */ static void HandleFocusEvents(Widget w, XtPointer closure, XEvent *event, Boolean *cont) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; Boolean newhasfocus = data->hasfocus; XmAnyCallbackStruct cb; XPoint xmim_point; XRectangle xmim_area; Arg args[10]; int n = 0; PosToXY(tw, tw->text.cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); switch (event->type) { case FocusIn: if (event->xfocus.send_event && !(newhasfocus)) { cb.reason = XmCR_FOCUS; cb.event = event; XtCallCallbackList (w, tw->text.focus_callback, (Opaque) &cb); newhasfocus = True; n = 0; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XmImSetFocusValues(w, args, n); } break; case FocusOut: if (event->xfocus.send_event && newhasfocus) { newhasfocus = False; XmImUnsetFocus(w); } break; case EnterNotify: if ((_XmGetFocusPolicy(w) != XmEXPLICIT) && !(newhasfocus) && event->xcrossing.focus && (event->xcrossing.detail != NotifyInferior)) { cb.reason = XmCR_FOCUS; cb.event = event; XtCallCallbackList (w, tw->text.focus_callback, (Opaque) &cb); newhasfocus = True; n = 0; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XmImSetFocusValues(w, args, n); } break; case LeaveNotify: if ((_XmGetFocusPolicy(w) != XmEXPLICIT) && newhasfocus && event->xcrossing.focus && (event->xcrossing.detail != NotifyInferior)) { newhasfocus = False; XmImUnsetFocus(w); } break; } if (newhasfocus != data->hasfocus) { if (newhasfocus && XtIsSensitive((Widget)tw)) { EraseInsertionPoint(tw); data->hasfocus = newhasfocus; data->blinkstate = off; _XmTextChangeBlinkBehavior(tw, True); TextDrawInsertionPoint(tw); } else { _XmTextChangeBlinkBehavior(tw, False); EraseInsertionPoint(tw); data->hasfocus = newhasfocus; data->blinkstate = on; TextDrawInsertionPoint(tw); } } } /* ARGSUSED */ static void HandleGraphicsExposure(Widget w, XtPointer closure, XEvent *event, Boolean *cont) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; if (event->xany.type == GraphicsExpose) { XGraphicsExposeEvent *xe = (XGraphicsExposeEvent *) event; if (data->exposehscroll != 0) { xe->x = 0; xe->width = tw->core.width; } if (data->exposevscroll != 0) { xe->y = 0; xe->height = tw->core.height; } RedrawRegion(tw, xe->x, xe->y, xe->width, xe->height); if (xe->count == 0) { if (data->exposehscroll) data->exposehscroll--; if (data->exposevscroll) data->exposevscroll--; } } if (event->xany.type == NoExpose) { if (data->exposehscroll) data->exposehscroll--; if (data->exposevscroll) data->exposevscroll--; } } static void OutputRealize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes) { XmTextWidget tw = (XmTextWidget) w; XtCreateWindow(w, (unsigned int) InputOutput, (Visual *) CopyFromParent, *valueMask, attributes); MakeCursors(tw); } static void OutputDestroy(Widget w) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; if (data->timerid) XtRemoveTimeOut(data->timerid); XtRemoveEventHandler((Widget) tw->text.inner_widget, FocusChangeMask|EnterWindowMask|LeaveWindowMask, False, HandleFocusEvents, NULL); XtRemoveEventHandler((Widget) tw->text.inner_widget, (EventMask) 0, True, HandleGraphicsExposure, NULL); XtReleaseGC(w, data->imagegc); XtReleaseGC(w, data->gc); XtReleaseGC(w, data->save_gc); XtReleaseGC(w, data->cursor_gc); XmFontListFree(data->fontlist); if (data->add_mode_cursor != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(XtScreen(tw), data->add_mode_cursor); if (data->cursor != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(XtScreen(tw), data->cursor); if (data->ibeam_off != XmUNSPECIFIED_PIXMAP) XFreePixmap(XtDisplay((Widget)tw), data->ibeam_off); XtFree((char *)data); XtFree((char *)tw->text.output); _XmProcessLock(); posToXYCachedWidget = NULL; _XmProcessUnlock(); } static void RedrawRegion(XmTextWidget tw, int x, int y, int width, int height) { OutputData data = tw->text.output->data; int i; XmTextPosition first, last; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { for (i = x; i < (int) (x + width + data->linewidth); i += data->linewidth) { first = XYToPos(tw, i, y); last = XYToPos(tw, i, y + height); first = (*tw->text.source->Scan)(tw->text.source, first, XmSELECT_POSITION, XmsdLeft, 1, True); last = (*tw->text.source->Scan)(tw->text.source, last, XmSELECT_POSITION, XmsdRight, 1, True); _XmTextMarkRedraw(tw, first, last); } } else { for (i = y; i < (int) (y + height + data->lineheight); i += data->lineheight) { first = XYToPos(tw, x, i); last = XYToPos(tw, x + width, i); first = (*tw->text.source->Scan)(tw->text.source, first, XmSELECT_POSITION, XmsdLeft, 1, True); last = (*tw->text.source->Scan)(tw->text.source, last, XmSELECT_POSITION, XmsdRight, 1, True); _XmTextMarkRedraw(tw, first, last); } } } /* ARGSUSED */ static void OutputExpose(Widget w, XEvent *event, Region region) { XmTextWidget tw = (XmTextWidget) w; XExposeEvent *xe = (XExposeEvent *) event; OutputData data = tw->text.output->data; Boolean erased_cursor = False; int old_number_lines = data->number_lines; Arg im_args[10]; XRectangle xmim_area; XPoint xmim_point; int n = 0; Boolean font_may_have_changed = False; int offset = 0; if (tw->text.in_setvalues) { /* Get here via SetValues. Force x,y of IM and clip origin for * I-beam in case font changed. */ tw->text.in_setvalues = False; font_may_have_changed = True; } if (event->xany.type != Expose) return; if (XtIsSensitive(w) && data->hasfocus) _XmTextChangeBlinkBehavior(tw, False); EraseInsertionPoint(tw); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { data->number_lines = tw->text.inner_widget->core.width - data->leftmargin - data->rightmargin; if (data->number_lines < (int) data->linewidth || !data->linewidth) data->number_lines = 1; else data->number_lines /= (int) data->linewidth; if (data->hbar && old_number_lines != data->number_lines) { int local_total, new_size; XmNavigatorDataRec nav_data; data->ignorehbar = True; if (tw->text.top_line + tw->text.number_lines > tw->text.total_lines) local_total = tw->text.top_line + tw->text.number_lines; else local_total = tw->text.total_lines; if (local_total >= tw->text.number_lines) new_size = tw->text.number_lines; else new_size = local_total; if (new_size + tw->text.top_line > local_total) new_size = local_total - tw->text.top_line; offset = local_total - (tw->text.number_lines + tw->text.top_line); nav_data.value.x = offset; nav_data.minimum.x = 0; nav_data.maximum.x = local_total; nav_data.slider_size.x = new_size; nav_data.page_increment.x = (data->number_lines > 1)? (data->number_lines - 1): 1; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorehbar = False; } } else { data->number_lines = tw->text.inner_widget->core.height - data->topmargin - data->bottommargin; if (data->number_lines < (int) data->lineheight || !data->lineheight) data->number_lines = 1; else data->number_lines /= (int) data->lineheight; if (data->vbar && old_number_lines != data->number_lines) { int local_total, new_size; XmNavigatorDataRec nav_data; data->ignorevbar = True; if (tw->text.top_line + tw->text.number_lines > tw->text.total_lines) local_total = tw->text.top_line + tw->text.number_lines; else local_total = tw->text.total_lines; if (local_total >= tw->text.number_lines) new_size = tw->text.number_lines; else new_size = local_total; if (new_size + tw->text.top_line > local_total) new_size = local_total - tw->text.top_line; nav_data.value.y = tw->text.top_line; nav_data.minimum.y = 0; nav_data.maximum.y = local_total; nav_data.slider_size.y = new_size; nav_data.page_increment.y = (data->number_lines > 1)? (data->number_lines - 1): 1; nav_data.dimMask = NavigDimensionY; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, True); data->ignorevbar = False; } } if (!data->handlingexposures) { _XmTextDisableRedisplay(tw, False); data->handlingexposures = True; } if (data->exposehscroll != 0) { xe->x = 0; xe->width = tw->core.width; } if (data->exposevscroll != 0) { xe->y = 0; xe->height = tw->core.height; } if (xe->x == 0 && xe->y == 0 && xe->width == tw->core.width && xe->height == tw->core.height) _XmTextMarkRedraw(tw, (XmTextPosition)0, 9999999); else { if (!erased_cursor) RedrawRegion(tw, xe->x, xe->y, xe->width, xe->height); } _XmTextInvalidate(tw, (XmTextPosition) tw->text.top_character, (XmTextPosition) tw->text.top_character, NODELTA); _XmTextEnableRedisplay(tw); data->handlingexposures = False; _XmTextDrawShadow(tw); /* If the expose happened because of SetValues, the font may have changed. * At this point, RefigureLines has run and the tw is relayed out. * So it is safe to calculate the x,y position of the cursor to pass * to the IM. And we can reset the clip origin so that the I-Beam will * be drawn correctly. */ if (font_may_have_changed) { EraseInsertionPoint(tw); TextDrawInsertionPoint(tw); PosToXY(tw, tw->text.cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); XtSetArg(im_args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(im_args[n], XmNarea, &xmim_area); n++; XmImSetValues(w, im_args, n); } if ((data->cursor_on < 0) || (data->blinkstate == off)) data->refresh_ibeam_off = True; if (XtIsSensitive((Widget)tw) && data->hasfocus) _XmTextChangeBlinkBehavior(tw, True); TextDrawInsertionPoint(tw); } static void GetPreferredSize(Widget w, Dimension *width, Dimension *height) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; SizeFromRowsCols(tw, width, height); if (data->resizewidth) { TextFindNewWidth(tw, width); if (*width < data->minwidth) *width = data->minwidth; } if (data->resizeheight) { TextFindNewHeight(tw, PASTENDPOS, height); if (*height < data->minheight) *height = data->minheight; } if (*width == 0) *width = 1; if (*height == 0) *height = 1; } /* ARGSUSED */ static void HandleVBarButtonRelease(Widget w, XtPointer closure, XEvent *event, Boolean *cont) { XmTextWidget tw = (XmTextWidget) closure; OutputData data = tw->text.output->data; data->suspend_hoffset = False; EraseInsertionPoint(tw); XmTextScroll((Widget) tw, 0); TextDrawInsertionPoint(tw); } /* ARGSUSED */ static void HandleHBarButtonRelease(Widget w, XtPointer closure, XEvent *event, Boolean *cont) { XmTextWidget tw = (XmTextWidget) closure; OutputData data = tw->text.output->data; data->suspend_voffset = False; EraseInsertionPoint(tw); XmTextScroll((Widget) tw, 0); TextDrawInsertionPoint(tw); } /************************************************************************ * * SliderMove * Callback for the value changes of navigators. * ************************************************************************/ /* ARGSUSED */ static void SliderMove(Widget w, XtPointer closure, XtPointer cd) { /* w is a navigator tw */ XmTextWidget tw = (XmTextWidget) closure; XmNavigatorDataRec nav_data; int offset, n; XPoint xmim_point; XRectangle xmim_area; Arg args[10]; OutputData data = tw->text.output->data; int local_total = 0; int new_top = 0; /* get the navigator information using the trait getValue since I cannot use a callback struct */ nav_data.valueMask = NavValue; ((XmNavigatorTrait)XmeTraitGet((XtPointer) XtClass(w), XmQTnavigator)) ->getValue(w, &nav_data); /* look at the kind of navigator and make the appropriate update */ if (!data->ignorehbar && (nav_data.dimMask & NavigDimensionX)) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { data->suspend_voffset = True; tw->text.hsbar_scrolling = True; if (tw->text.top_line + tw->text.number_lines > tw->text.total_lines) local_total = tw->text.top_line + tw->text.number_lines; else local_total = tw->text.total_lines; new_top = local_total - nav_data.value.x - tw->text.number_lines; offset = nav_data.value.x - tw->text.top_line; tw->text.top_line = nav_data.value.x; EraseInsertionPoint(tw); XmTextScroll((Widget)tw, offset); TextDrawInsertionPoint(tw); tw->text.hsbar_scrolling = False; } else { offset = nav_data.value.x; EraseInsertionPoint(tw); ChangeHOffset(tw, offset, False); TextDrawInsertionPoint(tw); } PosToXY(tw, tw->text.cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); n = 0; XtSetArg(args[n], XmNarea, &xmim_area); n++; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XmImSetValues(w, args, n); data->suspend_voffset = False; } if (!data->ignorevbar && (nav_data.dimMask & NavigDimensionY)) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { offset = nav_data.value.y; EraseInsertionPoint(tw); ChangeVOffset(tw, offset, False); TextDrawInsertionPoint(tw); } else { data->suspend_hoffset = True; tw->text.vsbar_scrolling = True; offset = nav_data.value.y - tw->text.top_line; tw->text.top_line = nav_data.value.y; EraseInsertionPoint(tw); XmTextScroll((Widget)tw, offset); TextDrawInsertionPoint(tw); tw->text.vsbar_scrolling = False; } PosToXY(tw, tw->text.cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); n = 0; XtSetArg(args[n], XmNarea, &xmim_area); n++; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XmImSetValues(w, args, n); data->suspend_hoffset = False; } /* now update the other navigator value */ _XmSFUpdateNavigatorsValue(XtParent((Widget)tw), &nav_data, False); } /* Public routines. */ /***************************************************************************** * To make TextOut a True "Object" this function should be a class function. * *****************************************************************************/ void _XmTextOutputCreate(Widget wid, ArgList args, Cardinal num_args) { XmTextWidget tw = (XmTextWidget) wid; Output output; OutputData data; Dimension width, height; XmScrollFrameTrait scrollFrameTrait; tw->text.output = output = (Output) XtMalloc((unsigned) sizeof(OutputRec)); output->data = data = (OutputData) XtMalloc((unsigned) sizeof(OutputDataRec)); XtGetSubresources(wid, (XtPointer)data, NULL, NULL, output_resources, XtNumber(output_resources), args, num_args); if (output->data->scrollleftside == XmDYNAMIC_BOOL) { if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) output->data->scrollleftside = True; else output->data->scrollleftside = False; } output->XYToPos = XYToPos; output->PosToXY = PosToXY; output->MeasureLine = MeasureLine; output->Draw = Draw; output->DrawInsertionPoint = DrawInsertionPoint; output->MakePositionVisible = MakePositionVisible; output->MoveLines = MoveLines; output->Invalidate = OutputInvalidate; output->GetPreferredSize = GetPreferredSize; output->GetValues = OutputGetValues; output->SetValues = OutputSetValues; output->realize = OutputRealize; output->destroy = OutputDestroy; output->resize = NotifyResized; output->expose = OutputExpose; data->insertx = data->inserty = -99; data->suspend_hoffset = False; data->hoffset = 0; data->scrollwidth = 1; data->exposehscroll = data->exposevscroll = False; data->stipple_tile = _XmGetInsensitiveStippleBitmap((Widget) tw); data->add_mode_cursor = XmUNSPECIFIED_PIXMAP; data->ibeam_off = XmUNSPECIFIED_PIXMAP; data->cursor = XmUNSPECIFIED_PIXMAP; data->timerid = (XtIntervalId)0; data->font = NULL; data->scrollheight = 1; data->voffset = 0; data->suspend_voffset = False; /* copy over the fontlist/rendertable */ /* Final result stored in fontlist since that's what the rest of the * code is expecting, but rendertable takes precedence since that's the * model for 2.0. */ if ((data->fontlist == NULL) && (data->rendertable == NULL)) { data->fontlist = XmRenderTableCopy(XmeGetDefaultRenderTable(wid, XmTEXT_FONTLIST), NULL, 0); } else if (data->rendertable != NULL) data->fontlist = XmRenderTableCopy(data->rendertable, NULL, 0); else data->fontlist = XmRenderTableCopy(data->fontlist, NULL, 0); if(!LoadFontMetrics(tw)) { XmFontListFree(data->fontlist); data->fontlist = XmRenderTableCopy( XmeGetDefaultRenderTable(wid, XmTEXT_FONTLIST), NULL, 0); (void)!LoadFontMetrics(tw); } data->rendertable = data->fontlist; data->cursorwidth = 5; data->cursorheight = data->font_ascent + data->font_descent; tw->text.inner_widget = wid; data->leftmargin = data->rightmargin = tw->text.margin_width + tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; data->topmargin = data->bottommargin = tw->text.margin_height + tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; /* Don't word wrap, have multiple row or have vertical scrollbars if editMode is single_line */ if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) data->columns = 1; else data->rows = 1; } /* Don't grow in width if word wrap is on */ if (tw->text.edit_mode != XmSINGLE_LINE_EDIT && data->wordwrap) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) data->resizeheight = False; else data->resizewidth = False; } if (data->rows <= 0) { if (data->rows < 0) XmeWarning(wid, MSG1); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) data->rows = 20; else data->rows = 1; } if (data->columns <= 0) { if (data->columns < 0) XmeWarning(wid, MSG2); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) data->columns = 1; else data->columns = 20; } /* Initialize columns_set and rows_set for Query Geometry. Also * used in SizeFromRowsCols(). */ data->columns_set = data->columns; data->rows_set = data->rows; SizeFromRowsCols(tw, &width, &height); if (tw->core.width == 0) tw->core.width = width; if (tw->core.height == 0) tw->core.height = height; /* initialize number_lines before RefigureDependentInfo() */ if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { data->number_lines = tw->text.inner_widget->core.width - data->leftmargin - data->rightmargin; if (data->number_lines < (int) data->linewidth || !data->linewidth) data->number_lines = 1; else data->number_lines /= (int) data->linewidth; } else { data->number_lines = tw->text.inner_widget->core.height - data->topmargin - data->bottommargin; if (data->number_lines < (int) data->lineheight || !data->lineheight) data->number_lines = 1; else data->number_lines /= (int) data->lineheight; } if (tw->core.height != height || tw->core.width != width) RefigureDependentInfo(tw); /* reset columns_set and rows_set after RefigureDependentInfo() */ data->columns_set = data->columns; data->rows_set = data->rows; data->prevW = tw->core.width; data->prevH = tw->core.height; data->minwidth = tw->core.width; data->minheight = tw->core.height; data->imagegc = NULL; data->gc = NULL; data->save_gc = NULL; data->cursor_gc = NULL; data->has_rect = False; LoadGCs(tw, tw->core.background_pixel, tw->primitive.foreground); /**************** * * Now look at our parent and see if it's a non inited ScrollFrame. * If it is, create the navigators * and set up all the scrolling stuff using the trait. * */ scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass(wid->core.parent), XmQTscrollFrame); if (scrollFrameTrait != NULL && !(scrollFrameTrait -> getInfo (wid->core.parent, NULL, NULL, NULL))) { int n; Arg arglist[30]; Arg swarglist[1]; /*********************** set up the default move callback, so that our navigator gets associated nicely by the scrollFrame */ scrollFrameTrait -> init (wid->core.parent, SliderMove, wid); if (data->scrollhorizontal) { data->resizewidth = False; data->ignorehbar = False; n = 0; /* Force to use pixels for shadowThickness */ XtSetArg(arglist[n], XmNunitType, XmPIXELS); n++; XtSetArg(arglist[n], XmNshadowThickness, tw->primitive.shadow_thickness); n++; XtSetArg(arglist[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg(arglist[n], XmNtraversalOn, False); n++; XtSetArg(arglist[n], XmNhighlightThickness, 0); n++; data->hbar = XmCreateScrollBar(XtParent(tw), "HorScrollBar", arglist, n); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (tw->text.edit_mode != XmSINGLE_LINE_EDIT) XtManageChild(data->hbar); XtAddEventHandler(data->hbar, (EventMask)ButtonReleaseMask, False, HandleHBarButtonRelease, (Opaque)tw); } else XtManageChild(data->hbar); } else data->hbar = NULL; if (data->scrollvertical) { data->resizeheight = False; data->ignorevbar = False; n = 0; /* Force to use pixels for shadowThickness */ XtSetArg(arglist[n], XmNunitType, XmPIXELS); n++; XtSetArg(arglist[n], XmNshadowThickness, tw->primitive.shadow_thickness); n++; XtSetArg(arglist[n], XmNorientation, XmVERTICAL); n++; XtSetArg(arglist[n], XmNtraversalOn, False); n++; XtSetArg(arglist[n], XmNhighlightThickness, 0); n++; data->vbar = XmCreateScrollBar(XtParent(tw), "VertScrollBar", arglist, n); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { XtManageChild(data->vbar); } else { if (tw->text.edit_mode != XmSINGLE_LINE_EDIT) XtManageChild(data->vbar); XtAddEventHandler(data->vbar, (EventMask)ButtonReleaseMask, False, HandleVBarButtonRelease, (Opaque)tw); } } else data->vbar = NULL; /* Tell scrolled window parent where to put the scrollbars */ if (data->scrollleftside) { if (data->scrolltopside) XtSetArg(swarglist[0], XmNscrollBarPlacement, XmTOP_LEFT); else XtSetArg(swarglist[0], XmNscrollBarPlacement, XmBOTTOM_LEFT); } else { if (data->scrolltopside) XtSetArg(swarglist[0], XmNscrollBarPlacement, XmTOP_RIGHT); else XtSetArg(swarglist[0], XmNscrollBarPlacement, XmBOTTOM_RIGHT); } XtSetValues(tw->core.parent, swarglist, 1); } else { data->vbar = NULL; data->hbar = NULL; if (XmIsScrolledWindow(XtParent(tw)) && (((XmScrolledWindowWidget)tw->core.parent)->swindow.VisualPolicy == XmCONSTANT)) { data->scrollhorizontal = False; data->scrollvertical = False; data->resizewidth = True; data->resizeheight = True; } } data->hasfocus = False; data->blinkstate = on; data->cursor_on = 0; data->refresh_ibeam_off = True; data->have_inverted_image_gc = False; data->handlingexposures = False; XtAddEventHandler((Widget) tw->text.inner_widget, (EventMask) FocusChangeMask|EnterWindowMask| LeaveWindowMask, False, HandleFocusEvents, (Opaque)NULL); XtAddEventHandler((Widget) tw->text.inner_widget, (EventMask) 0, True, HandleGraphicsExposure, (Opaque)NULL); } /***************************************************************************** * To make TextOut a True "Object" this function should be a class function. * *****************************************************************************/ Boolean _XmTextGetBaselines(Widget w, Dimension ** baselines, int *line_count) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; Dimension *base_array; int i; *line_count = data->number_lines; base_array = (Dimension *)XtMalloc((sizeof(Dimension) * (*line_count))); for (i = 0; i < *line_count; i++) { base_array[i] = data->topmargin + i * data->lineheight + data->font_ascent; } *baselines = base_array; return (True); } /***************************************************************************** * To make TextOut a True "Object" this function should be a class function. * *****************************************************************************/ Boolean _XmTextGetDisplayRect(Widget w, XRectangle * display_rect) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; (*display_rect).x = data->leftmargin; (*display_rect).y = data->topmargin; (*display_rect).width = tw->core.width - (data->leftmargin + data->rightmargin); (*display_rect).height = data->number_lines * data->lineheight; return(True); } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ /* ARGSUSED */ void _XmTextMarginsProc(Widget w, XmBaselineMargins *margins_rec) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; if (margins_rec->get_or_set == XmBASELINE_SET) { data->topmargin = margins_rec->margin_top + tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; _XmProcessLock(); posToXYCachedWidget = NULL; _XmProcessUnlock(); } else { margins_rec->margin_top = data->topmargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness); margins_rec->margin_bottom = data->bottommargin - (tw->primitive.shadow_thickness + tw->primitive.highlight_thickness); margins_rec->text_height = data->font_ascent + data->font_descent; margins_rec->shadow = tw->primitive.shadow_thickness; margins_rec->highlight = tw->primitive.highlight_thickness; margins_rec->margin_height = 0; } } /***************************************************************************** * To make TextOut a True "Object" this function should be a class function. * *****************************************************************************/ void _XmTextChangeHOffset(XmTextWidget tw, int length) { OutputData data = tw->text.output->data; Dimension margin_width = tw->text.margin_width + tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; int new_offset = data->hoffset; XmTextPosition nextpos; XmTextPosition last_position; XmTextPosition temp; int inner_width, width, i; int text_width = 0; int new_text_width; XmTextBlockRec block; /* subtract margins from the offset: Fixes CR 3187 */ length += (length < 0 ? (2 * margin_width) : - (2 * margin_width)); new_offset += length; for (i = 0; i < tw->text.number_lines; i++) { last_position = (*tw->text.source->Scan) (tw->text.source, tw->text.line[i].start, XmSELECT_LINE, XmsdRight, 1, False); nextpos = (*tw->text.source->Scan)(tw->text.source, last_position, XmSELECT_LINE, XmsdRight, 1, True); if (nextpos == last_position) nextpos = PASTENDPOS; width = data->leftmargin; temp = tw->text.line[i].start; while (temp < last_position) { temp = (*tw->text.source->ReadSource) (tw->text.source, temp, last_position, &block); width += FindWidth(tw, (Position) width, &block, 0, block.length); } new_text_width = width - data->leftmargin; if (new_text_width > text_width) text_width = new_text_width; } inner_width = tw->core.width - (2 * margin_width); if (new_offset >= text_width - inner_width) new_offset = text_width - inner_width; ChangeHOffset(tw, new_offset, True); } /***************************************************************************** * To make TextOut a True "Object" this function should be a class function. * *****************************************************************************/ void _XmTextChangeVOffset(XmTextWidget tw, int length) { OutputData data = tw->text.output->data; Dimension margin_height = tw->text.margin_height + tw->primitive.shadow_thickness + tw->primitive.highlight_thickness; int new_offset = data->voffset; XmTextPosition nextpos = 0; XmTextPosition last_position = 0; XmTextPosition temp = 0; int inner_height = 0, height = 0, i = 0; int text_height = 0; int new_text_height = 0; XmTextBlockRec block; /* subtract margins from the offset: Fixes CR 3187 */ length += (length < 0 ? (2 * margin_height) : - (2 * margin_height)); new_offset += length; for (i = 0; i < tw->text.number_lines; i++) { last_position = (*tw->text.source->Scan) (tw->text.source, tw->text.line[i].start, XmSELECT_LINE, XmsdRight, 1, False); nextpos = (*tw->text.source->Scan)(tw->text.source, last_position, XmSELECT_LINE, XmsdRight, 1, True); if (nextpos == last_position) nextpos = PASTENDPOS; height = data->topmargin; temp = tw->text.line[i].start; while (temp < last_position) { temp = (*tw->text.source->ReadSource) (tw->text.source, temp, last_position, &block); height += FindHeight(tw, (Position) height, &block, 0, block.length); } new_text_height = height - data->topmargin; if (new_text_height > text_height) text_height = new_text_height; } inner_height = tw->core.height - (2 * margin_height); if (new_offset >= text_height - inner_height) new_offset = text_height - inner_height; ChangeVOffset(tw, new_offset, True); } /***************************************************************************** * To make TextOut a true "Object" this function should be a class function. * *****************************************************************************/ void _XmTextToggleCursorGC(Widget w) { XmTextWidget tw = (XmTextWidget) w; OutputData data = tw->text.output->data; InputData i_data = tw->text.input->data; XGCValues values; unsigned long valueMask; Pixmap stipple = XmUNSPECIFIED_PIXMAP; if (!XtIsRealized((Widget)tw)) return; SetFullGC(tw, data->imagegc); _XmTextResetClipOrigin(tw, tw->text.cursor_position, False); #ifdef FIX_1501 if (!XtIsSensitive((Widget)tw)) { valueMask = GCForeground|GCBackground|GCFillStyle|GCStipple|GCFunction; values.foreground = _XmAssignInsensitiveColor((Widget)tw); values.background = tw->core.background_pixel; values.fill_style = FillStippled; if (i_data->overstrike) { if (data->stipple_tile == XmUNSPECIFIED_PIXMAP) return; values.stipple = data->stipple_tile; values.function = GXxor; } else { if (data->cursor == XmUNSPECIFIED_PIXMAP) return; values.stipple = data->cursor; values.function = GXcopy; } } else { #endif if (i_data->overstrike) { valueMask = GCFillStyle|GCFunction|GCForeground|GCBackground; if (XtIsSensitive(w) && !tw->text.add_mode && (data->hasfocus || _XmTextHasDestination(w))) values.fill_style = FillSolid; else { valueMask |= GCStipple; values.fill_style = FillStippled; values.stipple = data->stipple_tile; } values.foreground = values.background = tw->primitive.foreground ^ tw->core.background_pixel; values.function = GXxor; } else { valueMask = GCStipple; if (XGetGCValues(XtDisplay(tw), data->imagegc, valueMask, &values)) stipple = values.stipple; valueMask = GCFillStyle|GCFunction|GCForeground|GCBackground; if (XtIsSensitive(w) && !tw->text.add_mode && (data->hasfocus || _XmTextHasDestination(w))) { if (stipple != data->cursor) { values.stipple = data->cursor; valueMask |= GCStipple; } } else if (stipple != data->add_mode_cursor) { values.stipple = data->add_mode_cursor; valueMask |= GCStipple; } if (tw->text.input->data->overstrike) { values.background = values.foreground = tw->core.background_pixel ^ tw->primitive.foreground; } else if (data->have_inverted_image_gc) { values.background = tw->primitive.foreground; values.foreground = tw->core.background_pixel; } else { values.foreground = tw->primitive.foreground; values.background = tw->core.background_pixel; } values.fill_style = FillStippled; values.function = GXcopy; } #ifdef FIX_1501 } #endif XSetClipMask(XtDisplay(tw), data->save_gc, None); XChangeGC(XtDisplay(tw), data->imagegc, valueMask, &values); } motif-2.3.8/lib/Xm/SpecRenderT.h0000644000175000017500000000307612672140200013244 00000000000000/* $XConsortium: SpecRenderT.h /main/5 1995/07/15 20:55:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmSpecRenderT_H #define _XmSpecRenderT_H #ifdef __cplusplus extern "C" { #endif #include externalref XrmQuark XmQTspecifyRenderTable; /* Trait structures and typedefs, place typedefs first */ typedef XmFontList (*XmSpecRenderGetTableProc)(Widget wid, XtEnum type); /* Version 0: initial release. */ typedef struct _XmSpecRenderTraitRec { int version; /* 0 */ XmSpecRenderGetTableProc getRenderTable; } XmSpecRenderTraitRec, *XmSpecRenderTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSpecRenderT_H */ motif-2.3.8/lib/Xm/MenuProcI.h0000644000175000017500000000310512672140200012720 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: MenuProcI.h /main/5 1995/07/13 17:35:47 drk $ */ #ifndef _XmMenuProcI_h #define _XmMenuProcI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmSaveMenuProcContext(XtPointer address) ; extern XtPointer _XmGetMenuProcContext( void ) ; extern void _XmSaveCoreClassTranslations(Widget widget) ; extern void _XmRestoreCoreClassTranslations(Widget widget) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuProcI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PixConvI.h0000644000175000017500000000374012672140200012563 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: PixConvI.h /main/6 1996/01/29 10:08:12 daniel $ */ #ifndef _XmPixConvI_h #define _XmPixConvI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for PixConv.c ********/ extern void _XmRegisterPixmapConverters( void ) ; extern void _XmTopShadowPixmapDefault( Widget widget, int offset, XrmValue *value) ; extern void _XmHighlightPixmapDefault( Widget widget, int offset, XrmValue *value) ; extern GC _XmGetPixmapBasedGC( Widget w, Pixel foreground, Pixel background, Pixmap pixmap); /******** End Private Function Declarations ********/ /* tmp - go to XmStrDef */ #define XmRNoScalingBitmap "NoScalingBitmap" #define XmRNoScalingDynamicPixmap "NoScalingDynamicPixmap" #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPixConvI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/SyntheticI.h0000644000175000017500000000646412672140200013155 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: SyntheticI.h /main/6 1996/04/18 12:01:21 daniel $ */ #ifndef _XmSyntheticI_h #define _XmSyntheticI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for Synthetic.c ********/ extern void _XmBuildResources( XmSyntheticResource **wc_resources_ptr, int *wc_num_resources_ptr, XmSyntheticResource *sc_resources, int sc_num_resources) ; extern void _XmInitializeSyntheticResources( XmSyntheticResource *resources, int num_resources) ; extern void _XmPrimitiveGetValuesHook( Widget w, ArgList args, Cardinal *num_args) ; extern void _XmGadgetGetValuesHook( Widget w, ArgList args, Cardinal *num_args) ; extern void _XmManagerGetValuesHook( Widget w, ArgList args, Cardinal *num_args) ; #ifdef PRINTING_SUPPORTED extern void _XmPrintShellGetValuesHook( Widget w, ArgList args, Cardinal *num_args) ; #endif extern void _XmExtGetValuesHook( Widget w, ArgList args, Cardinal *num_args) ; extern void _XmExtImportArgs( Widget w, ArgList args, Cardinal *num_args) ; extern void _XmPrimitiveImportArgs( Widget w, ArgList args, Cardinal *num_args) ; extern void _XmGadgetImportArgs( Widget w, ArgList args, Cardinal *num_args) ; extern void _XmGadgetImportSecondaryArgs( Widget w, ArgList args, Cardinal *num_args) ; extern void _XmManagerImportArgs( Widget w, ArgList args, Cardinal *num_args) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSyntheticI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextSelP.h0000644000175000017500000000221213145162623012576 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextSelP_h #define _XmTextSelP_h #include #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextSelP_h */ /* DON't ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragC.h0000644000175000017500000001531313145162623012054 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragController_h #define _XmDragController_h #include #include #ifdef __cplusplus extern "C" { #endif /* defines for the dragFinish completionStatus field */ #define XmHELP 2 /* * Some global stuff that will go into Xm.h */ typedef unsigned int XmID; /*********************************************************************** * * DragContext * ***********************************************************************/ #ifndef XmIsDragContext #define XmIsDragContext(w) XtIsSubclass(w,xmDragContextClass) #endif /* XmIsDragContext */ #ifndef _XA_MOTIF_DROP #define _XA_MOTIF_DROP "_MOTIF_DROP" #define _XA_DRAG_FAILURE "_MOTIF_DRAG_FAILURE" #define _XA_DRAG_SUCCESS "_MOTIF_DRAG_SUCCESS" #endif /* _XA_MOTIF_DROP */ /* enums used for the message_type in client messages */ enum{ XmTOP_LEVEL_ENTER, XmTOP_LEVEL_LEAVE, XmDRAG_MOTION, XmDROP_SITE_ENTER, XmDROP_SITE_LEAVE, XmDROP_START, XmDROP_FINISH, XmDRAG_DROP_FINISH, XmOPERATION_CHANGED } ; /* enums for completionStatus */ enum{ XmDROP, XmDROP_HELP, XmDROP_CANCEL, XmDROP_INTERRUPT } ; /* values for operation */ #define XmDROP_NOOP 0L #define XmDROP_MOVE (1L << 0) #define XmDROP_COPY (1L << 1) #define XmDROP_LINK (1L << 2) enum{ XmMOVE = XmDROP_MOVE, XmCOPY = XmDROP_COPY, XmLINK = XmDROP_LINK, XmOTHER } ; enum{ XmBLEND_ALL, XmBLEND_STATE_SOURCE, XmBLEND_JUST_SOURCE, XmBLEND_NONE } ; enum{ XmDROP_FAILURE, XmDROP_SUCCESS } ; /* enums used for the public callback reason */ enum{ XmCR_TOP_LEVEL_ENTER, XmCR_TOP_LEVEL_LEAVE, XmCR_DRAG_MOTION, XmCR_DROP_SITE_ENTER, XmCR_DROP_SITE_LEAVE, XmCR_DROP_START, XmCR_DROP_FINISH, XmCR_DRAG_DROP_FINISH, XmCR_OPERATION_CHANGED, _XmNUMBER_DND_CB_REASONS } ; /* Class record constants */ typedef struct _XmDragContextClassRec *XmDragContextClass; typedef struct _XmDragContextRec *XmDragContext; externalref WidgetClass xmDragContextClass; typedef struct _XmAnyICCCallbackStruct{ int reason; XEvent *event; Time timeStamp; }XmAnyICCCallbackStruct, *XmAnyICCCallback; typedef struct _XmTopLevelEnterCallbackStruct{ int reason; XEvent *event; Time timeStamp; Screen *screen; /* * the window field is different if this is an outbound or inbound * callback. Outbound == reciever, Inbound == initiator. */ Window window; Position x, y; unsigned char dragProtocolStyle; Atom iccHandle; }XmTopLevelEnterCallbackStruct, *XmTopLevelEnterCallback; typedef struct _XmTopLevelLeaveCallbackStruct{ int reason; XEvent *event; Time timeStamp; Screen *screen; Window window; }XmTopLevelLeaveCallbackStruct, *XmTopLevelLeaveCallback; /* * this message is sent from the receiver to the initiator to * indicate that the motion message with the associated timestamp has * caused a drop-site to be entered */ typedef struct _XmDropSiteEnterCallbackStruct{ int reason; XEvent *event; Time timeStamp; unsigned char operation; unsigned char operations; unsigned char dropSiteStatus; Position x, y; }XmDropSiteEnterCallbackStruct, *XmDropSiteEnterCallback; /* * this message is sent from the receiver to the initiator to * indicate that the motion message with the associated timestamp has * caused a drop-site to be left */ typedef struct _XmDropSiteLeaveCallbackStruct{ int reason; XEvent *event; Time timeStamp; }XmDropSiteLeaveCallbackStruct, *XmDropSiteLeaveCallback; typedef struct _XmDragMotionCallbackStruct{ int reason; XEvent *event; Time timeStamp; unsigned char operation; unsigned char operations; unsigned char dropSiteStatus; Position x, y; }XmDragMotionCallbackStruct, *XmDragMotionCallback; typedef struct _XmOperationChangedCallbackStruct{ int reason; XEvent *event; Time timeStamp; unsigned char operation; unsigned char operations; unsigned char dropSiteStatus; }XmOperationChangedCallbackStruct, *XmOperationChangedCallback; typedef struct _XmDropStartCallbackStruct{ int reason; XEvent *event; Time timeStamp; unsigned char operation; unsigned char operations; unsigned char dropSiteStatus; unsigned char dropAction; Position x, y; Window window; Atom iccHandle; }XmDropStartCallbackStruct, *XmDropStartCallback; typedef struct _XmDropFinishCallbackStruct{ int reason; XEvent *event; Time timeStamp; unsigned char operation; unsigned char operations; unsigned char dropSiteStatus; unsigned char dropAction; unsigned char completionStatus; }XmDropFinishCallbackStruct, *XmDropFinishCallback; typedef struct _XmDragDropFinishCallbackStruct{ int reason; XEvent *event; Time timeStamp; }XmDragDropFinishCallbackStruct, *XmDragDropFinishCallback; /******** Public Function Declarations ********/ extern Widget XmDragStart( Widget w, XEvent *event, ArgList args, Cardinal numArgs) ; extern void XmDragCancel( Widget dragContext) ; extern Boolean XmTargetsAreCompatible( Display *dpy, Atom *exportTargets, Cardinal numExportTargets, Atom *importTargets, Cardinal numImportTargets) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _DragController_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/RCMenuP.h0000644000175000017500000000230412672140200012330 00000000000000/* $XConsortium: RCMenuP.h /main/4 1995/07/15 20:54:39 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmRCMenuP_h #define _XmRCMenuP_h #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRCMenuP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/GeoUtils.c0000644000175000017500000027165213145162623012634 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: GeoUtils.c /main/13 1996/08/15 17:11:25 pascale $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #ifndef X_NOT_STDC_ENV #include #endif #include "XmI.h" #include "GeoUtilsI.h" #include "GMUtilsI.h" /******** Static Function Declarations ********/ static XtGeometryResult QueryAnyPolicy( XmGeoMatrix geoSpec, XtWidgetGeometry *parentRequestRtn) ; static XtGeometryResult QueryGrowPolicy( XmGeoMatrix geoSpec, XtWidgetGeometry *parentRequestRtn) ; static XtGeometryResult QueryNonePolicy( XmGeoMatrix geoSpec, XtWidgetGeometry *parentRequestRtn) ; static Dimension _XmGeoStretchVertical( XmGeoMatrix geoSpec, #if NeedWidePrototypes int actualH, int desiredH) ; #else Dimension actualH, Dimension desiredH) ; #endif /* NeedWidePrototypes */ static Dimension _XmGeoFillVertical( XmGeoMatrix geoSpec, #if NeedWidePrototypes int actualH, int desiredH) ; #else Dimension actualH, Dimension desiredH) ; #endif /* NeedWidePrototypes */ static void _XmGeoCalcFill( #if NeedWidePrototypes int fillSpace, int margin, #else Dimension fillSpace, Dimension margin, #endif /* NeedWidePrototypes */ unsigned int numBoxes, #if NeedWidePrototypes int endSpec, int betweenSpec, #else Dimension endSpec, Dimension betweenSpec, #endif /* NeedWidePrototypes */ Dimension *pEndSpace, Dimension *pBetweenSpace) ; static int boxWidthCompare( XmConst void *boxPtr1, XmConst void *boxPtr2) ; static void FitBoxesAveraging( XmKidGeometry rowPtr, unsigned int numBoxes, #if NeedWidePrototypes int boxWidth, #else Dimension boxWidth, #endif /* NeedWidePrototypes */ int amtOffset) ; static void FitBoxesProportional( XmKidGeometry rowPtr, unsigned int numBoxes, #if NeedWidePrototypes int boxWidth, #else Dimension boxWidth, #endif /* NeedWidePrototypes */ int amtOffset) ; static void SegmentFill( XmKidGeometry rowBoxes, unsigned int numBoxes, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int width, int marginW, int endX, int maxX, int endSpace, int betweenSpace) ; #else Position x, Dimension width, Dimension marginW, Position endX, Position maxX, Dimension endSpace, Dimension betweenSpace) ; #endif /* NeedWidePrototypes */ static Position _XmGeoLayoutWrap( XmKidGeometry rowPtr, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int y, int endSpace, int betweenSpace, int maxX, int width, int marginW) ; #else Position x, Position y, Dimension endSpace, Dimension betweenSpace, Position maxX, Dimension width, Dimension marginW) ; #endif /* NeedWidePrototypes */ static Position _XmGeoLayoutSimple( XmKidGeometry rowPtr, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int y, int maxX, int endSpace, int betweenSpace) ; #else Position x, Position y, Position maxX, Dimension endSpace, Dimension betweenSpace) ; #endif /* NeedWidePrototypes */ static Position _XmGeoArrangeList( XmKidGeometry rowBoxes, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int y, int width, int marginW, int marginH) ; #else Position x, Position y, Dimension width, Dimension marginW, Dimension marginH) ; #endif /* NeedWidePrototypes */ /******** End Static Function Declarations ********/ /****************************************************************/ #ifdef DEBUG_GEOUTILS void PrintBox( char * hdr, XmKidGeometry box) ; void PrintList( char * hdr, XmKidGeometry listPtr) ; void PrintMatrix( char * hdr, XmGeoMatrix spec) ; #endif /* DEBUG_GEOUTILS */ /****************************************************************/ XtGeometryResult _XmHandleQueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired, #if NeedWidePrototypes unsigned int resize_policy, #else unsigned char resize_policy, #endif /* NeedWidePrototypes */ XmGeoCreateProc createMatrix) { Dimension width = 0 ; Dimension height = 0 ; XmGeoMatrix geoSpec ; /* first determine what is the desired size, using the resize_policy. */ if (resize_policy == XmRESIZE_NONE) { desired->width = XtWidth(widget) ; desired->height = XtHeight(widget) ; } else { if (GMode( intended) & CWWidth) width = intended->width; if (GMode( intended) & CWHeight) height = intended->height; geoSpec = (*createMatrix)( widget, NULL, NULL) ; _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &width, &height) ; _XmGeoMatrixFree( geoSpec) ; if ((resize_policy == XmRESIZE_GROW) && ((width < XtWidth(widget)) || (height < XtHeight(widget)))) { desired->width = XtWidth(widget) ; desired->height = XtHeight(widget) ; } else { desired->width = width ; desired->height = height ; } } /* deal with user initial size setting */ if (!XtIsRealized(widget)) { if (XtWidth(widget) != 0) desired->width = XtWidth(widget) ; if (XtHeight(widget) != 0) desired->height = XtHeight(widget) ; } return XmeReplyToQueryGeometry(widget, intended, desired) ; } /****************************************************************/ XtGeometryResult _XmHandleGeometryManager( Widget wid, Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *allowed, #if NeedWidePrototypes unsigned int policy, #else unsigned char policy, #endif /* NeedWidePrototypes */ XmGeoMatrix *cachePtr, XmGeoCreateProc createMatrix) { XmGeoMatrix geoSpec ; XtWidgetGeometry parentRequest ; XtGeometryResult queryResult ; XtGeometryResult result ; /****************/ if( !cachePtr ) { /* Almost replies are not entertained unless caching is supported. */ allowed = NULL ; } else { geoSpec = *cachePtr ; if( geoSpec ) { if( (geoSpec->composite == wid) && (geoSpec->instigator == instigator) && _XmGeometryEqual( instigator, geoSpec->in_layout, desired) ) { /* This is a successive geometry request which matches the * cached geometry record. */ if( GMode( desired) & XtCWQueryOnly ) { return( XtGeometryYes) ; } else { /* If we get here, we should have already verified that * the current layout is acceptable to the parent, so * we will ignore the result of the request. */ if( geoSpec->parent_request.request_mode ) { geoSpec->parent_request.request_mode &= ~XtCWQueryOnly ; XtMakeGeometryRequest( wid, &geoSpec->parent_request, NULL) ; } _XmGeoMatrixSet( geoSpec) ; _XmGeoMatrixFree( geoSpec) ; *cachePtr = NULL ; return( XtGeometryYes) ; } } else { /* Cached geometry is different than current request, so clear * existing cache record and allow request to be processed. */ _XmGeoMatrixFree( geoSpec) ; *cachePtr = NULL ; } } } /* Get box list and arrange boxes according to policy. */ geoSpec = (*createMatrix)( wid, instigator, desired) ; if( geoSpec->no_geo_request && (*geoSpec->no_geo_request)( geoSpec) ) { _XmGeoMatrixFree( geoSpec) ; return( XtGeometryNo) ; } /* The following Query routines only respond with XtGeometryYes or * XtGeometryNo. All requests made to the parent are strictly * queries. * A return value (from these routines!) of XtGeometryNo means that * the composite widget would need to change size in order to * entertain the child's request, and that the parent said "no" * to the request. A XtGeometryNo leaves no alternatives to the * child's geometry request. * A return value of XtGeometryYes means that either the composite * widget does not need to change size to entertain the child's * request, or that negotiation with the parent yielded a viable * geometry layout. If the composite widget does not need to * change size, then request_mode field of the returned geometry * structure will contain zero. Otherwise, the returned geometry * structure will contain a request which is guaranteed to be * accepted by a subsequent request to the parent. * A return value of XtGeometryYes always loads the return geometry * structure with valid data. */ switch( policy ) { case XmRESIZE_GROW: { queryResult = QueryGrowPolicy( geoSpec, &parentRequest) ; break; } case XmRESIZE_NONE: { queryResult = QueryNonePolicy( geoSpec, &parentRequest) ; break ; } case XmRESIZE_ANY: default: { queryResult = QueryAnyPolicy( geoSpec, &parentRequest) ; break ; } } result = XtGeometryNo ; /* Setup default response. */ /* If parent replies XtGeometryYes, then build appropriate reply for * instigator. Otherwise, it is not reasonable to try to find a child * size which would result in an acceptable overall size, so just say no. */ if( queryResult == XtGeometryYes ) { if( _XmGeoReplyYes( instigator, desired, geoSpec->in_layout) ) { /* Reply Yes since desired geometry is same as the * instigator geometry in this layout. */ if( GMode( desired) & XtCWQueryOnly ) { geoSpec->parent_request = parentRequest ; result = XtGeometryYes ; } else { /* Don't need almost reply and this is not a query, so do it! */ if( parentRequest.request_mode ) { /* The geometry request in parentRequest has already * been tested by a query to the parent, so should * always be honored. */ parentRequest.request_mode &= ~XtCWQueryOnly ; XtMakeGeometryRequest( wid, &parentRequest, NULL) ; } _XmGeoMatrixSet( geoSpec) ; result = XtGeometryYes ; } } else { /* If allowed and not an exception then reply Almost, since * desired geometry is different than geometry in this layout. */ if( allowed && ( !geoSpec->almost_except || !(*(geoSpec->almost_except))(geoSpec)) ) { geoSpec->parent_request = parentRequest ; result = XtGeometryAlmost ; } } } switch( result ) { case XtGeometryAlmost: { /* Cache "almost" replies. Variables cachePtr and allowed are * guaranteed to be non-null since almost replies are prevented * if either is null. */ if(geoSpec->in_layout) { *cachePtr = geoSpec ; *allowed = *(geoSpec->in_layout) ; } else /* For fixing OSF CR 5956 */ { allowed = NULL ; *cachePtr = NULL ; result = XtGeometryNo ; } break ; } case XtGeometryYes: { /* This must be a query-only request, or the response would * be XtGeometryYes. Cache this reply if caching is * supported. Otherwise, drop through and free geoSpec. */ if( cachePtr ) { *cachePtr = geoSpec ; break ; } } default: { _XmGeoMatrixFree( geoSpec) ; break ; } } return( result) ; } /**************************************************************** * Handle geometry request for XmRESIZE_ANY resize policy. * Accept request allowed by parent. * Reject request to change both width and height if both * are disallowed by parent, but return almost if one is * allowed. ****************/ static XtGeometryResult QueryAnyPolicy( XmGeoMatrix geoSpec, XtWidgetGeometry *parentRequestRtn ) { Widget wid ; Dimension layoutW ; Dimension layoutH ; XtWidgetGeometry parentResponse ; XtGeometryResult queryResult ; Dimension almostW ; Dimension almostH ; /****************/ wid = geoSpec->composite ; _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; layoutW = 0 ; layoutH = 0 ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &layoutW, &layoutH) ; /* Load request. */ parentRequestRtn->request_mode = CWWidth | CWHeight ; parentRequestRtn->width = layoutW ; parentRequestRtn->height = layoutH ; /* Query parent only if necessary. */ if( (layoutW == XtWidth( wid)) && (layoutH == XtHeight( wid)) ) { parentRequestRtn->request_mode = 0 ; queryResult = XtGeometryYes ; } else { parentRequestRtn->request_mode |= XtCWQueryOnly ; queryResult = XtMakeGeometryRequest( wid, parentRequestRtn, &parentResponse) ; if( queryResult == XtGeometryAlmost ) { if( (parentResponse.request_mode & (CWWidth | CWHeight)) != (CWWidth | CWHeight) ) { queryResult = XtGeometryNo ; } else { /* The protocol guarantees an XtGeometryYes reply for * for an immediately subsequent request which is * identical to the XtGeometryAlmost reply. */ *parentRequestRtn = parentResponse ; queryResult = XtGeometryYes ; almostW = parentResponse.width ; almostH = parentResponse.height ; if( (almostW != layoutW) || (almostH != layoutH) ) { /* Response to geometry request was different than * requested geometry in fields that we care about. * So, try a new arrangement with the area being * offered by the parent. */ _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; layoutW = almostW ; layoutH = almostH ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &layoutW, &layoutH) ; if( (almostW != layoutW) || (almostH != layoutH) ) { /* The children cannot be laid-out in the area offered * by the parent, so parent result is No. */ queryResult = XtGeometryNo ; } } } } } return( queryResult) ; } /**************************************************************** * Handle geometry request for XmRESIZE_GROW resize policy. * Accept request which would increase or maintain current size. * Reject request which would decrease both preferred width * and preferred height, but return almost if only one * would decrease. ****************/ static XtGeometryResult QueryGrowPolicy( XmGeoMatrix geoSpec, XtWidgetGeometry *parentRequestRtn ) { Widget wid ; Dimension layoutW ; Dimension layoutH ; XtWidgetGeometry parentResponse ; XtGeometryResult queryResult ; Dimension almostW ; Dimension almostH ; /****************/ wid = geoSpec->composite ; _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; if( geoSpec->instig_request.request_mode & CWWidth ) { layoutW = 0 ; /* Let the layout routine choose a width.*/ } else { layoutW = XtWidth( wid) ; /* All changes will be reflected in */ } /* vertical dimension. */ layoutH = XtHeight( wid) ; /* Layout routine will grow vert., if needed.*/ _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &layoutW, &layoutH) ; if( layoutW < XtWidth( wid) ) { /* Try again, this time passing the width to _XmGeoArrangeBoxes. */ _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; layoutW = XtWidth( wid) ; layoutH = XtHeight( wid) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &layoutW, &layoutH) ; } /* Load request. */ parentRequestRtn->request_mode = CWWidth | CWHeight ; parentRequestRtn->width = layoutW ; parentRequestRtn->height = layoutH ; /* Query parent only if necessary. */ if( (layoutW == XtWidth( wid)) && (layoutH == XtHeight( wid)) ) { parentRequestRtn->request_mode = 0 ; queryResult = XtGeometryYes ; } else { parentRequestRtn->request_mode |= XtCWQueryOnly ; queryResult = XtMakeGeometryRequest( wid, parentRequestRtn, &parentResponse) ; if( queryResult == XtGeometryAlmost ) { if( (parentResponse.request_mode & (CWWidth | CWHeight)) != (CWWidth | CWHeight) ) { queryResult = XtGeometryNo ; } else { /* The protocol guarantees an XtGeometryYes reply for * for an immediately subsequent request which is * identical to the XtGeometryAlmost reply. */ *parentRequestRtn = parentResponse ; queryResult = XtGeometryYes ; almostW = parentResponse.width ; almostH = parentResponse.height ; if( (almostW < XtWidth( wid)) || (almostH < XtHeight( wid)) ) { queryResult = XtGeometryNo ; } else { if( (almostW != layoutW) || (almostH != layoutH) ) { /* Response to geometry request was different than * requested geometry in fields that we care about. * So, try a new arrangement with the area being * offered by the parent. */ _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; layoutW = almostW ; layoutH = almostH ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &layoutW, &layoutH) ; if( (almostW != layoutW) || (almostH != layoutH) ) { /* The children cannot be laid-out in the area * offered by the parent, so parent result is No. */ queryResult = XtGeometryNo ; } } } } } } return( queryResult) ; } /**************************************************************** * Handle geometry request for XmRESIZE_NONE resize policy. * Accept request which would not change preferred size and * allowed by parent. * Reject request which would change both preferred width * and preferred height, but return almost if only one * would change and parent allows the other. ****************/ static XtGeometryResult QueryNonePolicy( XmGeoMatrix geoSpec, XtWidgetGeometry *parentRequestRtn ) { Widget wid ; Dimension layoutW ; Dimension layoutH ; /****************/ wid = geoSpec->composite ; _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; layoutW = XtWidth( wid) ; layoutH = XtHeight( wid) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &layoutW, &layoutH) ; parentRequestRtn->request_mode = 0 ; if( (layoutW != XtWidth( wid)) || (layoutH != XtHeight( wid)) ) { return( XtGeometryNo) ; } return( XtGeometryYes) ; } /****************************************************************/ void _XmHandleSizeUpdate( Widget wid, #if NeedWidePrototypes unsigned int policy, #else unsigned char policy, #endif /* NeedWidePrototypes */ XmGeoCreateProc createMatrix) { XmGeoMatrix geoSpec ; Dimension w ; Dimension h ; Dimension r_w ; Dimension r_h ; XtGeometryResult parentResult = XtGeometryNo ; /****************/ geoSpec = (*createMatrix)( wid, NULL, NULL) ; _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; switch( policy ) { case XmRESIZE_NONE: { w = XtWidth( wid) ; h = XtHeight( wid) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &w, &h) ; break ; } case XmRESIZE_GROW: { w = 0 ; h = XtHeight( wid) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &w, &h) ; if( w < XtWidth( wid) ) { w = XtWidth( wid) ; h = XtHeight( wid) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &w, &h) ; } break ; } case XmRESIZE_ANY: default: { w = 0 ; h = 0 ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &w, &h) ; break ; } } if( ((w == XtWidth( wid)) && (h == XtHeight( wid))) ) { parentResult = XtGeometryYes ; } else { if( policy != XmRESIZE_NONE ) { parentResult = XtMakeResizeRequest( wid, w, h, &r_w, &r_h) ; if( parentResult == XtGeometryAlmost ) { if( (policy == XmRESIZE_GROW) && ( (r_w < XtWidth( wid)) || (r_h < XtHeight( wid))) ) { parentResult = XtGeometryNo ; } else { w = r_w ; h = r_h ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &w, &h) ; if( (w == r_w) && (h == r_h) ) { XtMakeResizeRequest( wid, w, h, NULL, NULL) ; } else { parentResult = XtGeometryNo ; } } } } } if( parentResult != XtGeometryNo ) { _XmGeoMatrixSet( geoSpec) ; } _XmGeoMatrixFree( geoSpec) ; return ; } /**************************************************************** * This routine allocates and initializes the data structure used * to describe a matrix of geometry boxes. Supplemental initialization * may be required for some of the fields of the data structure, if * the user uses these fields in its supplied co-routines. * Rows of the GeoMatrix are lists of kid boxes which are terminated with * a NULL in the kid widget field of the box structure. This routine * automatically allocates extra boxes to use to mark the end of each * row list. * This routine initializes all fields to NULL. * The pointer returned by this routine should be freed by the user * using the _XmGeoMatrixFree() routine. ****************/ XmGeoMatrix _XmGeoMatrixAlloc( unsigned int numRows, /* Number of rows of widgets to layout.*/ unsigned int numBoxes, /* Total number of widgets of matrix.*/ unsigned int extSize ) /* Extension record size (bytes).*/ { XmGeoMatrix geoSpecPtr ; unsigned int matrixRecSize ; unsigned int layoutRecSize ; unsigned int kidGeoRecSize ; unsigned int layoutSize ; unsigned int boxesSize ; unsigned int totalSize ; /****************/ /* Get sizes of the various components of the GeoMatrix. Round up to * prevent alignment problems. */ matrixRecSize = sizeof( XmGeoMatrixRec) ; if( matrixRecSize & 0x03 ) { matrixRecSize = (matrixRecSize + 4) & ~((unsigned int) 0x03) ; } layoutRecSize = sizeof( XmGeoRowLayoutRec) ; if( layoutRecSize & 0x03 ) { layoutRecSize = (layoutRecSize + 4) & ~((unsigned int) 0x03) ; } kidGeoRecSize = sizeof( XmKidGeometryRec) ; if( kidGeoRecSize & 0x03 ) { kidGeoRecSize = (kidGeoRecSize + 4) & ~((unsigned int) 0x03) ; } layoutSize = (numRows + 1) * layoutRecSize ; /* Extra boxes are used to mark the end of each row. */ boxesSize = (numBoxes + numRows) * kidGeoRecSize ; totalSize = matrixRecSize + layoutSize + boxesSize + extSize ; geoSpecPtr = (XmGeoMatrix) XtCalloc( 1, totalSize) ; /* Must be zeroed.*/ /* Set locations of arrays of row layout, box, and extension records. */ geoSpecPtr->layouts = (XmGeoMajorLayout) (((char *) geoSpecPtr) + matrixRecSize) ; geoSpecPtr->boxes = (XmKidGeometry) (((char *) geoSpecPtr) + matrixRecSize + layoutSize) ; if( extSize ) { geoSpecPtr->extension = (XtPointer) (((char *) geoSpecPtr) + matrixRecSize + layoutSize + boxesSize) ; } return( geoSpecPtr) ; } void _XmGeoMatrixFree( XmGeoMatrix geo_spec) { if( geo_spec->ext_destructor ) { (*(geo_spec->ext_destructor))( geo_spec->extension) ; } XtFree( (char *) geo_spec) ; } /**************************************************************** * If the widget specified by the "kidWid" parameter is non-NULL and is managed, * its value is copied into the appropriate field of the kid geometry * structure provided by the "geo" parameter and TRUE is returned. * Otherwise, nothing is done and FALSE is returned. ****************/ Boolean _XmGeoSetupKid( XmKidGeometry geo, /* Must be non-NULL.*/ Widget kidWid ) { /****************/ if( !kidWid || !XtIsManaged( kidWid) ) { return( FALSE) ; } /* The widget ID will be used for subsequent "get" operation. */ geo->kid = (Widget) kidWid; /* Return TRUE so the user knows that the box record was filled with * a widget ID and can then increment the box pointer for the next * managed widget to be setup. */ return( TRUE) ; } /**************************************************************** * This routine goes through the widget matrix and retrieves the appropriate * values for the KidGeometry boxes. Field values of the boxes may be * altered according to requirements specified in each row structure of * the geoSpec. * If the widget id within the matrix matches the instigator field of the * geoSpec, then the value for the box is taken from the request field of * the geoSpec or the widget itself as appropriate. ****************/ void _XmGeoMatrixGet( XmGeoMatrix geoSpec, int geoType ) /* XmGET_PREFERRED_SIZE or */ { register XmKidGeometry boxPtr ; XmKidGeometry rowPtr ; XmGeoRowLayout layoutPtr ; XtWidgetGeometry * request ; Widget instigator ; /****************/ request = &geoSpec->instig_request ; instigator = geoSpec->instigator ; rowPtr = geoSpec->boxes ; layoutPtr = &(geoSpec->layouts->row) ; while( !(layoutPtr->end) ) { boxPtr = rowPtr ; while( boxPtr->kid ) { _XmGeoLoadValues( boxPtr->kid, geoType, instigator, request, &(boxPtr->box)) ; if( boxPtr->kid == instigator ) { geoSpec->in_layout = &(boxPtr->box) ; } ++boxPtr ; } if( layoutPtr->fix_up ) { (*(layoutPtr->fix_up))( geoSpec, geoType, (XmGeoMajorLayout) layoutPtr, rowPtr) ; } rowPtr = boxPtr + 1 ; /* Skip over NULL box marking the end of row.*/ ++layoutPtr ; /* Go to next row layout record.*/ } #ifdef DEBUG_GEOUTILS PrintMatrix( "(get) ", geoSpec) ; #endif return ; } /**************************************************************** * The XtConfigureWidget routine is called on all widgets of the geoSpec * matrix as needed (when the geometry values of the box have changed). * If a widget ID matches that of the instigator field of the geoSpec, * then that widget is not configured. * Any layout "fixup" routines which are specified in the row structure * of the geoSpec are called before and after the call * to XmeConfigureObject, with appropriate parameter values. ****************/ void _XmGeoMatrixSet( XmGeoMatrix geoSpec ) { register XmKidGeometry rowPtr ; register XmGeoRowLayout layoutPtr ; Boolean fixUps = FALSE ; /****************/ #ifdef DEBUG_GEOUTILS PrintMatrix( "(set) ", geoSpec) ; #endif /* Give the user a chance to avoid setting the widgets to box values. */ if( !geoSpec->set_except || !(*geoSpec->set_except)( geoSpec) ) { /* Give the user a chance to modify box sizes before setting * the widget to the values defined in the box record. */ layoutPtr = &(geoSpec->layouts->row) ; rowPtr = geoSpec->boxes ; while( !(layoutPtr->end) ) { if( layoutPtr->fix_up ) { /* Call the user's routine which may modify boxes of this row. */ (*(layoutPtr->fix_up))( geoSpec, XmGEO_PRE_SET, (XmGeoMajorLayout) layoutPtr, rowPtr) ; fixUps = TRUE ; } rowPtr += layoutPtr->box_count + 1 ; /* Skip to next row.*/ ++layoutPtr ; } /* Now set the widgets to the values in the boxes. */ layoutPtr = &(geoSpec->layouts->row) ; rowPtr = geoSpec->boxes ; while( !(layoutPtr->end) ) { _XmSetKidGeo( rowPtr, geoSpec->instigator) ; rowPtr += layoutPtr->box_count + 1 ; /* Skip to next row.*/ ++layoutPtr ; } if( fixUps ) { /* Now call the fix_up routines again, to give the user a chance to * undo the chances to the boxes in order to keep consistency for * subsequent layout operations. */ layoutPtr = &(geoSpec->layouts->row) ; rowPtr = geoSpec->boxes ; while( !(layoutPtr->end) ) { if( layoutPtr->fix_up ) { (*(layoutPtr->fix_up))( geoSpec, XmGEO_POST_SET, (XmGeoMajorLayout) layoutPtr, rowPtr) ; } rowPtr += layoutPtr->box_count + 1 ; /* Skip to next row.*/ ++layoutPtr ; } } } return ; } /**************************************************************** * This routine adjusts boxes according to policies regarding border size * and even-sized boxes. Box dimensions are altered appropriately if * even_width or even_height parameters are set. Borders are set if * uniform_border is TRUE. ****************/ void _XmGeoAdjustBoxes( XmGeoMatrix geoSpec ) { register XmKidGeometry rowPtr ; register XmKidGeometry boxPtr ; XmGeoRowLayout layoutPtr ; Dimension globalSetBorder ; Dimension globalBorder ; Dimension borderValue ; /****************/ globalSetBorder = geoSpec->uniform_border ; globalBorder = geoSpec->border ; rowPtr = geoSpec->boxes ; layoutPtr = &(geoSpec->layouts->row) ; while( !(layoutPtr->end) ) { if( layoutPtr->even_width ) { _XmGeoBoxesSameWidth( rowPtr, layoutPtr->even_width) ; } if( layoutPtr->even_height ) { _XmGeoBoxesSameHeight( rowPtr, layoutPtr->even_height) ; } if( globalSetBorder || layoutPtr->uniform_border ) { if( globalSetBorder ) { borderValue = globalBorder ; } else { borderValue = layoutPtr->border ; } boxPtr = rowPtr ; while( boxPtr->kid ) { boxPtr->box.border_width = borderValue ; ++boxPtr ; } } while( (rowPtr++)->kid ) /* Go to next row of boxes. */ { /*EMPTY*/ } ++layoutPtr ; /* Go to next row layout record.*/ } return ; } /**************************************************************** * This routine traverses the matrix and collects data regarding the * sizes of boxes, the minimum fill area expected, and various other * parameters which are used during the layout process. ****************/ void _XmGeoGetDimensions( XmGeoMatrix geoSpec ) { register XmKidGeometry rowPtr ; register XmKidGeometry boxPtr ; XmGeoRowLayout layoutPtr ; Dimension boxH ; Dimension rowH ; Dimension rowW ; Dimension matrixFillH ; Dimension matrixBoxesH ; Dimension matrixW ; Dimension endSpaceW ; unsigned int numBoxes ; Dimension marginW ; Dimension marginH ; /****************/ marginH = geoSpec->margin_h ; marginW = geoSpec->margin_w ; rowPtr = geoSpec->boxes ; layoutPtr = &(geoSpec->layouts->row) ; matrixW = 0 ; matrixBoxesH = 0 ; matrixFillH = layoutPtr->space_above ; if( matrixFillH < marginH ) { matrixFillH = 0 ; } else { matrixFillH -= marginH ; /* This dimension does not include margins.*/ } geoSpec->stretch_boxes = FALSE ; while( !(layoutPtr->end) ) { /* Gather information about the height, width, and number of boxes * in the row. */ rowW = 0 ; rowH = 0 ; numBoxes = 0 ; boxPtr = rowPtr ; while( boxPtr->kid ) { rowW += boxPtr->box.width + (boxPtr->box.border_width << 1) ; boxH = boxPtr->box.height + (boxPtr->box.border_width << 1) ; ASSIGN_MAX( rowH, boxH) ; /* The tallest box is the row height.*/ ++numBoxes ; ++boxPtr ; } /* Fill row layout record with info about row. */ layoutPtr->max_box_height = rowH ;/* Tallest box in row, with border.*/ layoutPtr->boxes_width = rowW ; /* Sum of box widths and borders.*/ layoutPtr->box_count = numBoxes ; /* Check for vertical stetch row. */ if( layoutPtr->stretch_height ) { if( layoutPtr->fit_mode != XmGEO_WRAP ) { geoSpec->stretch_boxes = TRUE ; } else { layoutPtr->stretch_height = FALSE ; } } /* Compute row width to generate matrix width. Exclude margins. */ if( layoutPtr->space_end > marginW ) { endSpaceW = layoutPtr->space_end - marginW ; } else { endSpaceW = 0 ; } /* Fill width is the minimum spacing between (borders of) boxes plus * any extra space required at ends. Margins are not included. */ layoutPtr->fill_width = (endSpaceW << 1) + ((numBoxes - 1) * layoutPtr->space_between) ; /* Maximum row width is the overall matrix width, less margins. Add * box width to fill width for total width this row. */ rowW += layoutPtr->fill_width ; ASSIGN_MAX( matrixW, rowW) ; rowPtr = boxPtr + 1 ; /* Skip over NULL box marking the end of row.*/ ++layoutPtr ; /* Go to next row layout record.*/ /* Accumulate heights of each row. */ matrixFillH += layoutPtr->space_above ; matrixBoxesH += rowH ; } /* The matrixFillH variable already has fill space included from the final * row layout record. This must be reduced by the amount of the margin, * or a smaller amount if the amount specified was less than the margin. */ if( layoutPtr->space_above < marginH ) { matrixFillH -= layoutPtr->space_above ; } else { matrixFillH -= marginH ; } geoSpec->max_major = matrixW ; /* Widest row, excluding margins. */ geoSpec->boxes_minor = matrixBoxesH ; /* Sum of tallest box in each row.*/ geoSpec->fill_minor = matrixFillH ; /* Sum of vertical fill spacing. */ } /**************************************************************** * After the boxes have been layed-out according to the minimum vertical fill * requirements of the matrix, this routine stretches the layout to fill * any extra space required by the managing widget. * Returns new height after extra spacing is inserted. ****************/ static Dimension _XmGeoStretchVertical( XmGeoMatrix geoSpec, #if NeedWidePrototypes int actualH, int desiredH ) #else Dimension actualH, Dimension desiredH ) #endif /* NeedWidePrototypes */ { register XmGeoRowLayout layoutPtr ; register XmKidGeometry rowPtr ; int fillOffset ; int stretchableSpace ; int deltaY ; int deltaH ; /****************/ layoutPtr = &(geoSpec->layouts->row) ; stretchableSpace = 0 ; fillOffset = ((int) desiredH) - ((int) actualH) ; if( fillOffset < 0 ) { /* Must shrink stretchable boxes. */ while( !layoutPtr->end ) { if( layoutPtr->stretch_height && (layoutPtr->max_box_height > layoutPtr->min_height) ) { stretchableSpace += layoutPtr->max_box_height - layoutPtr->min_height ; } ++layoutPtr ; } if( -fillOffset > stretchableSpace ) { fillOffset = -stretchableSpace ; } } else { /* Must grow stretchable boxes. */ while( !layoutPtr->end ) { if( layoutPtr->stretch_height ) { stretchableSpace += layoutPtr->max_box_height ; } ++layoutPtr ; } } if( !stretchableSpace ) { /* No stretchable boxes, so return with current height. */ return( actualH) ; } deltaY = 0 ; rowPtr = geoSpec->boxes ; layoutPtr = &(geoSpec->layouts->row) ; while( !layoutPtr->end ) { if( layoutPtr->stretch_height ) { if( fillOffset < 0 ) { if( layoutPtr->max_box_height > layoutPtr->min_height ) { deltaH = (((int) (layoutPtr->max_box_height - layoutPtr->min_height)) * fillOffset) / stretchableSpace ; } else { deltaH = 0 ; } /* deltaH is now <= 0. */ while( rowPtr->kid ) { int boxCorrection = layoutPtr->max_box_height - rowPtr->box.height ; if( boxCorrection > -deltaH ) { boxCorrection = -deltaH ; } rowPtr->box.height += deltaH + boxCorrection ; rowPtr->box.y += deltaY - (boxCorrection >> 1) ; ++rowPtr ; } } else /* fillOffset >= 0 */ { deltaH = (layoutPtr->max_box_height * fillOffset) / stretchableSpace ; while( rowPtr->kid ) { rowPtr->box.height += deltaH ; rowPtr->box.y += deltaY ; ++rowPtr ; } } deltaY += deltaH ; } else { while( rowPtr->kid ) { rowPtr->box.y += deltaY ; ++rowPtr ; } } ++rowPtr ; ++layoutPtr ; } return( actualH + deltaY) ; /* Return new height.*/ } /**************************************************************** * After the boxes have been layed-out according to the minimum vertical fill * requirements of the matrix, this routine stretches the layout to fill * any extra space required by the managing widget. * Returns new height after extra spacing is inserted. ****************/ static Dimension _XmGeoFillVertical( XmGeoMatrix geoSpec, #if NeedWidePrototypes int actualH, int desiredH ) #else Dimension actualH, Dimension desiredH ) #endif /* NeedWidePrototypes */ { register XmGeoRowLayout layoutPtr ; register XmKidGeometry rowPtr ; unsigned long fillAmount ; unsigned long totalSpecSpace ; Dimension marginH ; Dimension firstSpecSpace ; Dimension lastSpecSpace ; Dimension currentFirstSpace ; Dimension currentLastSpace ; Dimension newFirstSpace ; Dimension newLastSpace ; int deltaY ; /****************/ /* Need to accumulate specified spacing factors, saving first and last * ends separately. */ layoutPtr = &(geoSpec->layouts->row) ; totalSpecSpace = 0 ; firstSpecSpace = layoutPtr->space_above ; while( !(++layoutPtr)->end ) { totalSpecSpace += layoutPtr->space_above ; } lastSpecSpace = layoutPtr->space_above ; totalSpecSpace += firstSpecSpace + lastSpecSpace ; if( !totalSpecSpace ) { /* Zero spacing specified, so just return as is. */ return( actualH) ; } /* Must reconstruct the actual spacing, which is the specified minimum. * Save current end spacing separately, since everything done here is * relative to the actual coordinates of the matrix and it will be * needed later. */ marginH = geoSpec->margin_h ; currentFirstSpace = (firstSpecSpace < marginH) ? marginH : firstSpecSpace ; currentLastSpace = (lastSpecSpace < marginH) ? marginH : lastSpecSpace ; /* Fill amount includes the current fill plus margins and extra * spacing. */ fillAmount = (desiredH - actualH) + geoSpec->fill_minor + currentFirstSpace + currentLastSpace ; newFirstSpace = (Dimension) ((fillAmount * (unsigned long) firstSpecSpace) / totalSpecSpace) ; newLastSpace = (Dimension) ((fillAmount * (unsigned long) lastSpecSpace) / totalSpecSpace) ; if( newFirstSpace < marginH ) { fillAmount -= marginH ; totalSpecSpace -= firstSpecSpace ; newFirstSpace = marginH ; } if( newLastSpace < marginH ) { fillAmount -= marginH ; totalSpecSpace -= lastSpecSpace ; newLastSpace = marginH ; } /* Now traverse the matrix, offsetting all y-ccordinates according to * additional spacing. Wrapped lines receive no extra spacing between * them. */ deltaY = newFirstSpace - currentFirstSpace ; rowPtr = geoSpec->boxes ; layoutPtr = &(geoSpec->layouts->row) ; for(;;) { while( rowPtr->kid ) { rowPtr->box.y += deltaY ; ++rowPtr ; } ++rowPtr ; ++layoutPtr ; if( layoutPtr->end ) { break ; } deltaY += (int) (((((unsigned long) layoutPtr->space_above) * fillAmount) / totalSpecSpace) - layoutPtr->space_above) ; } deltaY += newLastSpace - currentLastSpace ; return( actualH + deltaY) ; /* Return new height.*/ } /**************************************************************** * Calculates and returns appropriate fill factor from given layout * parameters. Also returns appropriate spacing for ends. * The fill factor returned is for use with all spacing between boxes, but * not the ends (use provided spacing). ****************/ static void _XmGeoCalcFill( #if NeedWidePrototypes int fillSpace, int margin, #else Dimension fillSpace, /* Fill space, including margins.*/ Dimension margin, /* Margin (included in fillSpace).*/ #endif /* NeedWidePrototypes */ unsigned int numBoxes, #if NeedWidePrototypes int endSpec, int betweenSpec, #else Dimension endSpec, Dimension betweenSpec, #endif /* NeedWidePrototypes */ Dimension *pEndSpace, /* Receives end spacing.*/ Dimension *pBetweenSpace ) /* Receives between spacing.*/ { Dimension totalSpecSpace ;/* Sum of specified spacing.*/ /****************/ if( !endSpec ) { if( numBoxes == 1 ) { endSpec = 1 ; } else { if( !betweenSpec ) { betweenSpec = (Dimension) (numBoxes - 1) ; } } } totalSpecSpace = (betweenSpec * (numBoxes - 1)) + (endSpec << 1) ; *pEndSpace = (endSpec * fillSpace) / totalSpecSpace ; if( *pEndSpace < margin ) { if( (endSpec << 1) < totalSpecSpace ) { totalSpecSpace -= endSpec << 1 ; } else { totalSpecSpace = 1 ; } if( (margin << 1) < fillSpace ) { fillSpace -= margin << 1 ; } else { fillSpace = 0 ; } *pEndSpace = margin ; } *pBetweenSpace = (betweenSpec * fillSpace) / totalSpecSpace ; return ; } /**************************************************************** * The x, y, width, and height fields of the boxes in the geoSpec matrix * are modified with values appropriate for the layout parameters specified * by x, y, pW, and pH. * The overall width and height dimensions at the specified locations * of pW and pH must be initially set to their desired values, or zero * for the default layout. * The actual values of the width and height (after layout) are returned at * the locations pW and pH. ****************/ void _XmGeoArrangeBoxes( XmGeoMatrix geoSpec, /* Array of box lists (rows).*/ #if NeedWidePrototypes int x, int y, #else Position x, /* X coordinate of composite.*/ Position y, /* Y coordinate of composite.*/ #endif /* NeedWidePrototypes */ Dimension *pW, /* Initial value is minimum width.*/ Dimension *pH ) /* Initial value is minimum height.*/ { Dimension marginW ; /* Margin between sides and boxes.*/ Dimension marginH ; /* Margin between top/bot and boxes.*/ XmKidGeometry rowPtr ; XmGeoRowLayout layoutPtr ; Dimension actualW ; Dimension actualH ; Dimension initY ; /****************/ if( geoSpec->arrange_boxes && (geoSpec->arrange_boxes != _XmGeoArrangeBoxes) ) { (*(geoSpec->arrange_boxes))( geoSpec, x, y, pW, pH) ; return ; } /* Fix box dimensions according to even_height/width and uniform_border * specifications. */ _XmGeoAdjustBoxes( geoSpec) ; /* Compute layout dimensions. */ _XmGeoGetDimensions( geoSpec) ; /* Initialize global layout dimensions. */ marginW = geoSpec->margin_w ; marginH = geoSpec->margin_h ; actualW = geoSpec->max_major + (marginW << 1) ; /****** the value of this assignment is never used ********** actualH = geoSpec->boxes_minor + geoSpec->fill_minor + (marginH << 1) ; *************************************************************/ /* Adjust layout dimensions to requested dimensions. */ if( *pW ) { actualW = *pW ; } /******* the value assigned to actualH is never used ************* if( *pH ) { actualH = *pH ; } ******************************************************************/ /* Save initial Y coordinate for later computation of height. */ initY = y ; /* Layout horizontal position of each box in row, one row at a time. */ layoutPtr = &(geoSpec->layouts->row) ; rowPtr = geoSpec->boxes ; /* Add first end spacing. */ if( layoutPtr->space_above > marginH ) { y += layoutPtr->space_above ; } else { y += marginH ; } while( !(layoutPtr->end) ) { /* Arrange one row of boxes at a time. */ y = _XmGeoArrangeList( rowPtr, layoutPtr, x, y, actualW, marginW, marginH) ; rowPtr += layoutPtr->box_count + 1 ; /* Skip to next row.*/ ++layoutPtr ; /* Add between-row spacing. */ y += layoutPtr->space_above ; } if( layoutPtr->space_above < marginH ) { /* Fill out to the minimum margin if previous spacing is less * than margin. */ y += marginH - layoutPtr->space_above ; } actualH = y - initY ; if( *pH && (actualH != *pH) ) { if( geoSpec->stretch_boxes ) { /* Has stretchable boxes, so grow or shrink using stretch. */ actualH = _XmGeoStretchVertical( geoSpec, actualH, *pH) ; } else { if( actualH < *pH ) { /* Layout is smaller than specified height, so fill vertically. */ actualH = _XmGeoFillVertical( geoSpec, actualH, *pH) ; } } } /* Set return values of actual width and height of matrix. */ geoSpec->width = actualW ; if( *pW < actualW ) { *pW = actualW ; } geoSpec->height = actualH ; if( *pH < actualH ) { *pH = actualH ; } return ; } /****************************************************************/ static int boxWidthCompare( XmConst void * boxPtr1, XmConst void * boxPtr2 ) { /****************/ return( (*((XmKidGeometry *) boxPtr1))->box.width > (*((XmKidGeometry *) boxPtr2))->box.width) ; } /**************************************************************** * This routine alters box sizes such that the composite width is reduced * by the offset amount specified. The boxWidth parameter is assumed to * contain the sum of the all box widths, including borders. * The algorithm used by this routine tends to average the width of all boxes. * In other words, to achieve the desired width reduction, the largest boxes * are reduced first, possibly until all boxes are the same width * (thereafter reducing all boxes evenly). ****************/ static void FitBoxesAveraging( XmKidGeometry rowPtr, unsigned int numBoxes, #if NeedWidePrototypes int boxWidth, #else Dimension boxWidth, #endif /* NeedWidePrototypes */ int amtOffset ) { unsigned int Index ; XmKidGeometry * sortedBoxes ; /****************/ /* Get memory to use for sorting the list of boxes. */ sortedBoxes = (XmKidGeometry *) XtMalloc( numBoxes * sizeof( XmKidGeometry)) ; /* Enter the boxes into the array and sort. */ Index = 0 ; while( Index < numBoxes ) { sortedBoxes[Index] = &rowPtr[Index] ; /* Need to remove the border_width component from boxWidth. */ boxWidth -= (rowPtr[Index].box.border_width << 1) ; ++Index ; } qsort( (void *) sortedBoxes, (size_t) numBoxes, sizeof( XmKidGeometry), boxWidthCompare) ; /* Now sorted with smallest box first. */ Index = 0 ; while( Index < numBoxes ) { /* The right-hand side of the comparison represents the amount of * area that would be truncated if all boxes were the same width * as sortedBoxes[Index]. The loop will break when the Index * points to the smallest box in the list to be truncated. */ if( amtOffset >= ((int) (boxWidth - ((sortedBoxes[Index]->box.width) * (numBoxes - Index)))) ) { break ; } /* This keeps the above comparison simple. */ boxWidth -= sortedBoxes[Index]->box.width ; ++Index ; } if( Index < numBoxes ) { if( (int) boxWidth > amtOffset ) { boxWidth = (boxWidth - amtOffset) / (numBoxes - Index) ; if( !boxWidth ) { boxWidth = 1 ; } } else { boxWidth = 1 ; } /* boxWidth is now the truncated width of the remaining boxes * in the sorted list. Set these boxes appropriately. */ while( Index < numBoxes ) { sortedBoxes[Index]->box.width = boxWidth ; ++Index ; } } XtFree( (char *) sortedBoxes) ; return ; } /**************************************************************** * This routine alters the width of boxes in proportion to the width of each * box such that the total change is equal to amtOffset. If amtOffset is * greater than zero, the total width is reduced (a "fit"). Otherwise, * the total width is increased (a "fill"). ****************/ static void FitBoxesProportional( XmKidGeometry rowPtr, unsigned int numBoxes, #if NeedWidePrototypes int boxWidth, #else Dimension boxWidth, #endif /* NeedWidePrototypes */ int amtOffset ) { int deltaX ; int deltaW ; /****************/ if( boxWidth >= numBoxes ) { deltaX = 0 ; while( rowPtr->kid ) { deltaW = (amtOffset * (int)(rowPtr->box.width + (rowPtr->box.border_width << 1))) / ((int) boxWidth) ; if( deltaW < ((int) rowPtr->box.width) ) { rowPtr->box.width -= deltaW ; } else { rowPtr->box.width = 1 ; } rowPtr->box.x += deltaX ; deltaX -= deltaW ; ++rowPtr ; } } else /* boxWidth < numBoxes */ { if( (-amtOffset) > numBoxes ) { boxWidth = (-amtOffset) / numBoxes ; } else { boxWidth = 1 ; } deltaX = 0 ; while( rowPtr->kid ) { rowPtr->box.width = boxWidth ; rowPtr->box.x += deltaX ; deltaX += boxWidth ; ++rowPtr ; } } return ; } /****************************************************************/ static void SegmentFill( XmKidGeometry rowBoxes, unsigned int numBoxes, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int width, int marginW, int endX, int maxX, int endSpace, int betweenSpace ) #else Position x, Dimension width, Dimension marginW, Position endX, Position maxX, Dimension endSpace, Dimension betweenSpace ) #endif /* NeedWidePrototypes */ { Widget holdEnd ; Dimension spacedWidth ; Dimension boxWidth ; Dimension sumW ; int amtOffset ; Dimension totalFill ; Position rowX ; XmKidGeometry rowPtr ; /****************/ holdEnd = rowBoxes[numBoxes].kid ; rowBoxes[numBoxes].kid = NULL ; spacedWidth = (betweenSpace * (numBoxes - 1)) + (endSpace << 1) ; amtOffset = ((int) spacedWidth + (maxX - endX)) ; if( (amtOffset > 0) && (amtOffset < width) ) { boxWidth = width - amtOffset ; } else { boxWidth = 1 ; } sumW = boxWidth + spacedWidth ; amtOffset = ((int) sumW) - ((int) width) ; /* Setup the default spacing. */ betweenSpace = layoutPtr->space_between ; endSpace = (layoutPtr->space_end < marginW) ? marginW : layoutPtr->space_end ; switch( layoutPtr->fill_mode ) { case XmGEO_CENTER: { /* Compute new spacing values to result in a centered * layout when passed to the simple layout routine. */ if( width > sumW ) { totalFill = (spacedWidth + width) - sumW ; } else { totalFill = marginW << 1 ; } { /* This little exercise is needed for when NeedWidePrototypes * has value 1 which causes endSpace and betweenSpace to * become "int"s, and a pointer to an int cannot be passed * as an argument where a pointer to a dimension is required. */ Dimension eSpace ; Dimension bSpace ; _XmGeoCalcFill( totalFill, marginW, numBoxes, layoutPtr->space_end, layoutPtr->space_between, &eSpace, &bSpace) ; endSpace = eSpace ; betweenSpace = bSpace ; } break ; } case XmGEO_PACK: { /* For a packed layout, just layout with extra space * at the end of the row. */ break ; } case XmGEO_EXPAND: default: { /* FitBoxesProportional will fill if amtOffset < 0, * as it is here. */ FitBoxesProportional( rowBoxes, numBoxes, boxWidth, amtOffset) ; break ; } } rowX = x + endSpace ; rowPtr = rowBoxes ; while( rowPtr->kid ) { rowPtr->box.x = rowX ; rowX += rowPtr->box.width + (rowPtr->box.border_width << 1) + betweenSpace ; ++rowPtr ; } rowBoxes[numBoxes].kid = holdEnd ; return ; } /**************************************************************** * This routine lays out the row of boxes with the spacing specified in * the endSpace and betweenSpace parameters. If the width of a row * which contains more than one box causes the right edge of the * row to be greater than maxX, then the boxes will wrap to the next * line. * The Y coordinate of the space following the layout is returned. ****************/ static Position _XmGeoLayoutWrap( XmKidGeometry rowPtr, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int y, int endSpace, int betweenSpace, int maxX, int width, int marginW ) #else Position x, Position y, Dimension endSpace, Dimension betweenSpace, Position maxX, Dimension width, Dimension marginW ) #endif /* NeedWidePrototypes */ { Position rowX ; Dimension rowH ; Position boxMaxX ; unsigned int numBoxes ; Dimension boxH ; int deltaW ; XmKidGeometry rowBegin ; register XmKidGeometry boxPtr ; Position endX ; /****************/ rowX = x + endSpace ; rowH = layoutPtr->max_box_height ; numBoxes = 0 ; rowBegin = rowPtr ; boxPtr = rowPtr ; while( boxPtr->kid ) { boxMaxX = rowX + boxPtr->box.width + (boxPtr->box.border_width << 1) ; if( (boxMaxX > maxX) && numBoxes ) { /* Wrap the line. Also adjust preceding segment according to * fill policy. */ endX = rowX - betweenSpace ; SegmentFill( rowBegin, numBoxes, layoutPtr, x, width, marginW, endX, maxX, endSpace, betweenSpace) ; numBoxes = 0 ; rowX = x + endSpace ; y += rowH ; rowBegin = boxPtr ; boxMaxX = rowX + boxPtr->box.width + (boxPtr->box.border_width << 1) ; } if( boxMaxX > maxX ) { /* Since it wasn't wrapped, there must be only one box in this * segment. It is too wide, so simply truncate it. */ deltaW = ((int) (endSpace + boxMaxX)) - ((int) (maxX + marginW)) ; if( (deltaW < ((int) boxPtr->box.width)) && (deltaW > 0) ) { boxPtr->box.width -= deltaW ; } else { boxPtr->box.width = 1 ; } boxMaxX = rowX + boxPtr->box.width + (boxPtr->box.border_width << 1) ; } boxPtr->box.x = rowX ; boxPtr->box.y = y ; boxH = boxPtr->box.height + (boxPtr->box.border_width << 1) ; if( boxH != rowH ) { /* If box height is not the same as the maximum box height * of the row, then adjust y to center the box in the row. */ boxPtr->box.y += (((int) rowH - (int) boxH) >> 1) ; } rowX = boxMaxX + betweenSpace ; ++numBoxes ; ++boxPtr ; } endX = rowX - betweenSpace ; SegmentFill( rowBegin, numBoxes, layoutPtr, x, width, marginW, endX, maxX, endSpace, betweenSpace) ; if( layoutPtr->sticky_end ) { boxPtr = &rowPtr[layoutPtr->box_count - 1] ; endX = maxX - (boxPtr->box.width + (boxPtr->box.border_width << 1)) ; if( endX > boxPtr->box.x ) { boxPtr->box.x = endX ; } } return( y + rowH) ; } /**************************************************************** * This routine does a simple layout of the boxes in the row. It assumes * that all boxes have been conditioned to fit appropriately with the * spacing specified by the endSpace and betweenSpace parameters. * The Y coordinate of the space following the layout is returned. ****************/ static Position _XmGeoLayoutSimple( XmKidGeometry rowPtr, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int y, int maxX, int endSpace, int betweenSpace ) #else Position x, Position y, Position maxX, Dimension endSpace, Dimension betweenSpace ) #endif /* NeedWidePrototypes */ { Position rowX ; Position newX ; Dimension rowH ; Dimension boxH ; /****************/ rowH = layoutPtr->max_box_height ; rowX = x + endSpace ; while( rowPtr->kid ) { rowPtr->box.x = rowX ; rowPtr->box.y = y ; boxH = rowPtr->box.height + (rowPtr->box.border_width << 1) ; if( boxH != rowH ) { /* If box height is not the same as the maximum box height * of the row, then adjust y to center the box in the row. */ rowPtr->box.y += ((rowH - boxH) >> 1) ; } rowX += rowPtr->box.width + (rowPtr->box.border_width << 1) + betweenSpace ; ++rowPtr ; } if( layoutPtr->sticky_end ) { --rowPtr ; newX = maxX - (rowPtr->box.width + (rowPtr->box.border_width << 1)) ; if( newX > rowPtr->box.x ) { rowPtr->box.x = newX ; } } return( y + rowH) ; } /**************************************************************** * This routines lays out the boxes in this row according to the specified * paramaters and the policies specified in the layout record at layoutPtr. ****************/ /*ARGSUSED*/ static Position _XmGeoArrangeList( XmKidGeometry rowBoxes, XmGeoRowLayout layoutPtr, #if NeedWidePrototypes int x, int y, int width, int marginW, int marginH ) /* unused */ #else Position x, Position y, Dimension width, Dimension marginW, Dimension marginH ) /* unused */ #endif /* NeedWidePrototypes */ { Dimension sumW ; unsigned int numBoxes ; Dimension betweenBoxes ; Dimension endsOfBoxes ; int amtOffset ; Dimension boxWidth ; Position maxX ; Dimension totalFill ; /****************/ numBoxes = layoutPtr->box_count ; boxWidth = layoutPtr->boxes_width ; sumW = boxWidth + layoutPtr->fill_width + (marginW << 1) ; amtOffset = ((int) sumW) - ((int) width) ; /* Setup the default spacing. */ betweenBoxes = layoutPtr->space_between ; endsOfBoxes = (layoutPtr->space_end < marginW) ? marginW : layoutPtr->space_end ; maxX = x + width - marginW ; if( (sumW > width) && (layoutPtr->fit_mode == XmGEO_WRAP) ) { /* Wrapping is required, so fill routines and other policy decisions * are not needed. Do the layout using the wrap routine and we're * done. */ y = _XmGeoLayoutWrap( rowBoxes, layoutPtr, x, y, endsOfBoxes, betweenBoxes, maxX, width, marginW) ; } else { if( sumW > width ) { switch( layoutPtr->fit_mode ) { case XmGEO_AVERAGING: { FitBoxesAveraging( rowBoxes, numBoxes, boxWidth, amtOffset) ; break ; } case XmGEO_PROPORTIONAL: default: { FitBoxesProportional( rowBoxes, numBoxes, boxWidth, amtOffset) ; } } } else { if( sumW < width ) { switch( layoutPtr->fill_mode ) { case XmGEO_CENTER: { /* Compute new spacing values to result in a centered * layout when passed to the simple layout routine. */ totalFill = (marginW << 1) + layoutPtr->fill_width + width - sumW ; _XmGeoCalcFill( totalFill, marginW, numBoxes, layoutPtr->space_end, layoutPtr->space_between, &endsOfBoxes, &betweenBoxes) ; break ; } case XmGEO_PACK: { /* For a packed layout, just layout with extra space * at the end of the row. */ break ; } case XmGEO_EXPAND: default: { /* FitBoxesProportional will fill if amtOffset < 0, * as it is here. */ FitBoxesProportional( rowBoxes, numBoxes, boxWidth, amtOffset) ; break ; } } } } y = _XmGeoLayoutSimple( rowBoxes, layoutPtr, x, y, maxX, endsOfBoxes, betweenBoxes) ; } return( y) ; } /**************************************************************** * Changes boxes in the kid geometry list to have desired width. * If width > 1, then use the specified width. * If width == 1, then use the width of the widest box. * If width == 0, then do not change the boxes but return the width of * the widest box. * Returns the value of the width actually used. ****************/ Dimension _XmGeoBoxesSameWidth( XmKidGeometry rowPtr, #if NeedWidePrototypes int width ) #else Dimension width ) #endif /* NeedWidePrototypes */ { register XmKidGeometry boxPtr ; register Dimension useW ; /****************/ useW = width ; /* Setup default width of each box in row, as specified.*/ if( width <= 1 ) { /* If user specified width parameter of zero or one, then find the * width of the widest box. */ boxPtr = rowPtr ; while( boxPtr->kid ) { ASSIGN_MAX( useW, boxPtr->box.width) ; ++boxPtr ; } } if( width ) { /* If width parameter is non-zero, then set the boxes appropriately. */ boxPtr = rowPtr ; while( boxPtr->kid ) { boxPtr->box.width = useW ; ++boxPtr ; } } return( useW) ; } /**************************************************************** * Changes boxes in the kid geometry list to have desired height. * If height > 1, then use the specified height. * If height == 1, then use the height of the tallest box. * If height == 0, then do not change the boxes but return the height of * the tallest box. * Returns the value of the height actually used. ****************/ Dimension _XmGeoBoxesSameHeight( XmKidGeometry rowPtr, #if NeedWidePrototypes int height ) #else Dimension height ) #endif /* NeedWidePrototypes */ { register XmKidGeometry boxPtr ; register Dimension useH ; /****************/ useH = height ; /* Setup default height of each box in row, as specified.*/ if( height <= 1 ) { /* If user specified height parameter of zero or one, then find the * height of the tallest box. */ boxPtr = rowPtr ; while( boxPtr->kid ) { ASSIGN_MAX( useH, boxPtr->box.height) ; ++boxPtr ; } } if( height ) { /* If height parameter is non-zero, then set the boxes appropriately. */ boxPtr = rowPtr ; while( boxPtr->kid ) { boxPtr->box.height = useH ; ++boxPtr ; } } return( useH) ; } /**************************************************************** ARGSUSED * This routine is a fixup routine which can be used for rows which consist * of a single separator widget. The effect of this routine is to have * the separator ignore the margin width. ****************/ /*ARGSUSED*/ void _XmSeparatorFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, /* unused */ XmKidGeometry rowPtr ) { register Dimension marginW ; register Dimension twoMarginW ; /****************/ marginW = geoSpec->margin_w ; twoMarginW = (marginW << 1) ; switch( action ) { case XmGEO_PRE_SET: { rowPtr->box.x -= marginW ; rowPtr->box.width += twoMarginW ; break ; } default: { if( rowPtr->box.width > twoMarginW ) { /* Avoid subtracting a margin from box width which would * result in underflow. */ rowPtr->box.x += marginW ; rowPtr->box.width -= twoMarginW ; } if( action == XmGET_PREFERRED_SIZE ) { /* Set width to some small value so it does not * effect total width of matrix. */ rowPtr->box.width = 1 ; } break ; } } return ; } /**************************************************************** ARGSUSED * This routine is a fixup routine which can be used for rows which consist * of a single MenuBar RowColumn. The effect of this routine is to have * the RowColumn ignore the margin width and height. ****************/ /*ARGSUSED*/ void _XmMenuBarFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, /* unused */ XmKidGeometry rowPtr ) { register Dimension marginW ; register Dimension marginH ; register Dimension twoMarginW ; /****************/ marginW = geoSpec->margin_w ; twoMarginW = (marginW << 1) ; marginH = geoSpec->margin_h ; switch( action ) { case XmGEO_PRE_SET: { rowPtr->box.x -= marginW ; rowPtr->box.width += twoMarginW ; rowPtr->box.y -= marginH ; break ; } default: { if( rowPtr->box.width > twoMarginW ) { /* Avoid subtracting a margin from box width which would * result in underflow. */ rowPtr->box.x += marginW ; rowPtr->box.width -= twoMarginW ; } if( action == XmGET_PREFERRED_SIZE ) { /* Set width to some small value so it does not * effect total width of matrix. */ rowPtr->box.width = 1 ; } break ; } } return ; } /****************************************************************/ void _XmGeoLoadValues( Widget wid, int geoType, Widget instigator, XtWidgetGeometry *request, XtWidgetGeometry *geoResult ) { XtWidgetGeometry reply ; XtWidgetGeometry * geoSource ; /****************/ if( wid == instigator ) { /* If this widget is making the request, then use the request info. */ geoSource = request ; } else { geoSource = &reply ; switch( geoType ) { case XmGET_PREFERRED_SIZE: { XtQueryGeometry( wid, NULL, &reply) ; break ; } case XmGET_ACTUAL_SIZE: default: { reply.request_mode = 0 ; /* Will cause geoSpec to be loaded.*/ break ; } } } geoResult->x = IsX( geoSource) ? geoSource->x : XtX( wid) ; geoResult->y = IsY( geoSource) ? geoSource->y : XtY( wid) ; geoResult->width = IsWidth( geoSource) ? geoSource->width : XtWidth( wid) ; geoResult->height = IsHeight( geoSource) ? geoSource->height : XtHeight( wid) ; geoResult->border_width = IsBorder( geoSource) ? geoSource->border_width : XtBorderWidth( wid) ; geoResult->request_mode = CWX | CWY | CWWidth | CWHeight | CWBorderWidth ; return ; } /**************************************************************** * Get a count of the managed kids of a parent, it is assumed that all * gadgets are always managed ****************/ int _XmGeoCount_kids( register CompositeWidget c ) { register int i, n = 0 ; /****************/ for( i = 0 ; i < c->composite.num_children ; i++ ) { if( c->composite.children[i]->core.managed ) { n++ ; } } return( n) ; } /**************************************************************** ARGSUSED * Assemble a kid box for each child widget and gadget, fill in data about * each widget and optionally set up uniform border widths. * Returns a list of records, last one has a 'kid' field of NULL. This memory * for this list should eventually be freed with a call to XtFree(). ****************/ /*ARGSUSED*/ XmKidGeometry _XmGetKidGeo( Widget wid, /* Widget w/ children. */ Widget instigator, /* May point to a child who */ XtWidgetGeometry *request, /* is asking to change. */ int uniform_border, /* T/F, enforce it. */ #if NeedWidePrototypes int border, #else Dimension border, /* Value to use if enforcing.*/ #endif /* NeedWidePrototypes */ int uniform_width_margins, /* unused. T/F, enforce it. */ int uniform_height_margins, /* unused. T/F, enforce it. */ Widget help, /* May point to a help kid. */ int geo_type ) /* Actual or preferred. */ { CompositeWidget c = (CompositeWidget) wid ; XmKidGeometry geo ; Widget kidWid ; int i ; int j = 0 ; Boolean helpFound = FALSE ; /****************/ geo = (XmKidGeometry) XtMalloc( (_XmGeoCount_kids (c) + 1) * sizeof (XmKidGeometryRec)) ; /* load all managed kids */ for( i = 0 ; i < c->composite.num_children ; i++ ) { kidWid = c->composite.children[i] ; if( XtIsManaged( kidWid) ) { if( kidWid == help ) { /* Save to put help widget at the end of the widget list.*/ helpFound = TRUE ; } else { geo[j].kid = kidWid ; _XmGeoLoadValues( kidWid, geo_type, instigator, request, &(geo[j].box)) ; if( uniform_border ) /* if asked override border */ { geo[j].box.border_width = border ; } j++ ; } } } if( helpFound ) /* put help guy into list */ { geo[j].kid = help ; _XmGeoLoadValues( help, geo_type, instigator, request, &(geo[j].box)) ; if( uniform_border ) /* if asked override border */ { geo[j].box.border_width = border ; } j++ ; } geo[j].kid = NULL ; /* signal end of list */ return( geo) ; } /****************************************************************/ void _XmGeoClearRectObjAreas( RectObj r, XWindowChanges *old ) { Widget parent = XtParent( r) ; int bw2 ; /****************/ bw2 = old->border_width << 1; XClearArea( XtDisplay( parent), XtWindow( parent), old->x, old->y, old->width + bw2, old->height + bw2, TRUE) ; bw2 = r->rectangle.border_width << 1; XClearArea( XtDisplay( parent), XtWindow( parent), (int) r->rectangle.x, (int) r->rectangle.y, (unsigned int) (r->rectangle.width + bw2), (unsigned int) (r->rectangle.height + bw2), TRUE) ; return ; } /**************************************************************** ARGSUSED * Take the kid geometry array and change each kid to match them. * remember not to do the resize of the instigator. * The kid geometry "kg" is assumed to be fully specified. ****************/ void _XmSetKidGeo( XmKidGeometry kg, Widget instigator ) { Widget w ; XtWidgetGeometry * b ; int i ; /****************/ for( i=0 ; kg[i].kid != NULL ; i++ ) { w = (Widget) kg[i].kid ; b = &(kg[i].box) ; if( w != instigator ) { XmeConfigureObject( w, b->x, b->y, b->width, b->height, b->border_width) ; } else { XtX( w) = b->x ; XtY( w) = b->y ; XtWidth( w) = b->width ; XtHeight( w) = b->height ; XtBorderWidth( w) = b->border_width ; } } return ; } /**************************************************************** * Returns TRUE if all specified geometries of geoA are equal to either the * specified geometries of geoB or to the geometry of the widget, and * vice versa. The XtCWQueryOnly bit is ignored. ****************/ Boolean _XmGeometryEqual( Widget wid, XtWidgetGeometry *geoA, XtWidgetGeometry *geoB ) { /****************/ if(!geoA){ /* For fixing OSF CR 5956 */ return(False); } if( IsWidth( geoA) || IsWidth( geoB) ) { if( IsWidth( geoA) && IsWidth( geoB) ) { if( geoA->width != geoB->width ) { return( FALSE) ; } } else { if( IsWidth( geoA) ) { if( geoA->width != XtWidth( wid) ) { return( FALSE) ; } } else { if( IsWidth( geoB) ) { if( geoB->width != XtWidth( wid) ) { return( FALSE) ; } } } } } if( IsHeight( geoA) || IsHeight( geoB) ) { if( IsHeight( geoA) && IsHeight( geoB) ) { if( geoA->height != geoB->height ) { return( FALSE) ; } } else { if( IsHeight( geoA) ) { if( geoA->height != XtHeight( wid) ) { return( FALSE) ; } } else { if( IsHeight( geoB) ) { if( geoB->height != XtHeight( wid) ) { return( FALSE) ; } } } } } if( IsBorder( geoA) || IsBorder( geoB) ) { if( IsBorder( geoA) && IsBorder( geoB) ) { if( geoA->border_width != geoB->border_width ) { return( FALSE) ; } } else { if( IsBorder( geoA) ) { if( geoA->border_width != XtBorderWidth( wid) ) { return( FALSE) ; } } else { if( IsBorder( geoB) ) { if( geoB->border_width != XtBorderWidth( wid) ) { return( FALSE) ; } } } } } if( IsX( geoA) || IsX( geoB) ) { if( IsX( geoA) && IsX( geoB) ) { if( geoA->x != geoB->x ) { return( FALSE) ; } } else { if( IsX( geoA) ) { if( geoA->x != XtX( wid) ) { return( FALSE) ; } } else { if( IsX( geoB) ) { if( geoB->x != XtX( wid) ) { return( FALSE) ; } } } } } if( IsY( geoA) || IsY( geoB) ) { if( IsY( geoA) && IsY( geoB) ) { if( geoA->y != geoB->y ) { return( FALSE) ; } } else { if( IsY( geoA) ) { if( geoA->y != XtY( wid) ) { return( FALSE) ; } } else { if( IsY( geoB) ) { if( geoB->y != XtY( wid) ) { return( FALSE) ; } } } } } return( TRUE) ; } /**************************************************************** * Returns TRUE if all specified geometries of "desired" correspond to * specified geometries of "response" and are equal to them. * The XtCWQueryOnly bit is ignored. ****************/ /*ARGSUSED*/ Boolean _XmGeoReplyYes( Widget wid, /* unused */ XtWidgetGeometry *desired, XtWidgetGeometry *response ) { /****************/ if(!response){ /* For fixing OSF CR 5956 */ return(False); } if( IsWidth( desired) ) { if( !IsWidth( response) || (desired->width != response->width) ) { return( FALSE) ; } } if( IsHeight( desired) ) { if( !IsHeight( response) || (desired->height != response->height) ) { return( FALSE) ; } } if( IsBorder( desired) ) { if( !IsBorder( response) || (desired->border_width != response->border_width) ) { return( FALSE) ; } } if( IsX( desired) ) { if( !IsX( response) || (desired->x != response->x) ) { return( FALSE) ; } } if( IsY( desired) ) { if( !IsY( response) || (desired->y != response->y) ) { return( FALSE) ; } } return( TRUE) ; } /**************************************************************** * This routine calls the geometry manager and accept the almost ****************/ XtGeometryResult _XmMakeGeometryRequest( Widget w, XtWidgetGeometry *geom ) { XtWidgetGeometry allowed ; XtGeometryResult answer ; /****************/ answer = XtMakeGeometryRequest( w, geom, &allowed) ; /* On an almost, accept the returned value and make * a second request to get an XtGeometryYes returned. */ if( answer == XtGeometryAlmost ) { /* The Intrinsics protocol guarantees a Yes response * to a request with identical geometry to that which * was returned by a previous request returning almost. */ *geom = allowed ; answer = XtMakeGeometryRequest( w, geom, &allowed) ; } return answer ; } /****************************************************************/ #ifdef DEBUG_GEOUTILS /****************************************************************/ void PrintBox( char * hdr, XmKidGeometry box) /**************** * ****************/ { /****************/ printf( "%sw: %X, m: 0x%X, x: %d, y: %d, w: %d, h: %d, b: %d\n", hdr, box->kid, box->box.request_mode, box->box.x, box->box.y, box->box.width, box->box.height, box->box.border_width) ; return ; } /****************************************************************/ void PrintList( char * hdr, XmKidGeometry listPtr) /**************** * ****************/ { int num ; char subhdr[256] ; /****************/ num = 0 ; while( listPtr->kid ) { sprintf( subhdr, "%si: %d ", hdr, num) ; PrintBox( subhdr, listPtr) ; ++num ; ++listPtr ; } return ; } /****************************************************************/ void PrintMatrix( char * hdr, XmGeoMatrix spec) /**************** * ****************/ { int row ; int col ; XmKidGeometry boxPtr ; XmGeoRowLayout layoutPtr ; char subhdr[256] ; /****************/ row = 1 ; boxPtr = spec->boxes ; layoutPtr = spec->layouts.row ; while( !(layoutPtr->end) ) { col = 1 ; while( boxPtr->kid ) { sprintf( subhdr, "%srow: %d, col: %d, ", hdr, row, col) ; PrintBox( subhdr, boxPtr) ; ++col ; ++boxPtr ; } ++row ; ++boxPtr ; ++layoutPtr ; } return ; } /****************************************************************/ #endif /* DEBUG_GEOUTILS */ /****************************************************************/ motif-2.3.8/lib/Xm/SpinB.h0000644000175000017500000000337013145162623012107 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmSpinB_h #define _XmSpinB_h #include #ifdef __cplusplus extern "C" { #endif /* * SpinB Widget */ externalref WidgetClass xmSpinBoxWidgetClass; typedef struct _XmSpinBoxClassRec *XmSpinBoxWidgetClass; typedef struct _XmSpinBoxRec *XmSpinBoxWidget; /* * Spin externs for application accessible functions */ Widget XmCreateSpinBox(Widget parent, char *name, ArgList arglist, Cardinal argcount); Widget XmVaCreateSpinBox( Widget parent, char *name, ...); Widget XmVaCreateManagedSpinBox( Widget parent, char *name, ...); int XmSpinBoxValidatePosition( Widget text_field, int *position_value); #ifdef __cplusplus } #endif #endif /* _SpinB_h */ motif-2.3.8/lib/Xm/CacheI.h0000644000175000017500000000334112672140200012175 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: CacheI.h /main/6 1995/07/14 10:12:39 drk $ */ #ifndef _XmCacheI_h #define _XmCacheI_h #include #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmCacheDelete( XtPointer data) ; extern void _XmCacheCopy( XtPointer src, XtPointer dest, size_t size) ; extern XtPointer _XmCachePart( XmCacheClassPartPtr cp, XtPointer cpart, size_t size) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCacheI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DestI.h0000644000175000017500000000262012672140200012070 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: DestI.h /main/6 1995/07/14 10:18:13 drk $ */ #ifndef _XmDestI_h #define _XmDestI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for Dest.c ********/ extern void _XmSetDestination(Display *dpy, Widget w) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDestI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DrawnBP.h0000644000175000017500000000523113145162623012367 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDButtonP_h #define _XmDButtonP_h #include #include #ifdef __cplusplus extern "C" { #endif /* DrawnButton class structure */ typedef struct _XmDrawnButtonClassPart { XtPointer extension; /* Pointer to extension record */ } XmDrawnButtonClassPart; /* Full class record declaration for DrawnButton class */ typedef struct _XmDrawnButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmLabelClassPart label_class; XmDrawnButtonClassPart drawnbutton_class; } XmDrawnButtonClassRec; externalref XmDrawnButtonClassRec xmDrawnButtonClassRec; /* DrawnButton instance record */ typedef struct _XmDrawnButtonPart { Boolean pushbutton_enabled; unsigned char shadow_type; XtCallbackList activate_callback; XtCallbackList arm_callback; XtCallbackList disarm_callback; XtCallbackList expose_callback; XtCallbackList resize_callback; Boolean armed; Dimension old_width; Dimension old_height; Dimension old_shadow_thickness; Dimension old_highlight_thickness; XtIntervalId timer; unsigned char multiClick; /* KEEP/DISCARD resource */ int click_count; Time armTimeStamp; } XmDrawnButtonPart; /* Full instance record declaration */ typedef struct _XmDrawnButtonRec { CorePart core; XmPrimitivePart primitive; XmLabelPart label; XmDrawnButtonPart drawnbutton; } XmDrawnButtonRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDButtonP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStringI.h0000644000175000017500000013433312672140200012753 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $TOG: XmStringI.h /main/7 1999/09/01 17:15:15 mgreess $ */ #ifndef _XmStringI_h #define _XmStringI_h #include #ifdef __cplusplus extern "C" { #endif /* * These are the fontlist structures */ typedef struct _XmFontListContextRec { Boolean error; /* something bad */ unsigned short index; /* next rendition */ XmRenderTable table; /* associated table */ } XmFontListContextRec; /* useful macros */ #define two_byte_font(f) (( (f)->min_byte1 != 0 || (f)->max_byte1 != 0)) #define FontListType(r) ((_XmRendition)(*(r)))->fontType #define FontListFont(r) ((_XmRendition)(*(r)))->font #define FontListTag(r) ((_XmRendition)(*(r)))->tag /* Convenience macros */ #define _XmStringCvtNonOpt(str) (_XmStrOptimized(str) ? \ _XmStringOptToNonOpt(str) : (str)) /* * Macros for string internal context block data structure access */ #define _XmStrContString(cont) \ ((_XmStringContextRec *)(cont))->string #define _XmStrContCurrLine(cont) \ ((_XmStringContextRec *)(cont))->current_line #define _XmStrContCurrSeg(cont) \ ((_XmStringContextRec *)(cont))->current_seg #define _XmStrContOpt(cont) \ ((_XmStringContextRec *)(cont))->optimized #define _XmStrContError(cont) ((_XmStringContextRec *)(cont))->error #define _XmStrContTabCount(cont) ((_XmStringContextRec *)(cont))->tab_count #define _XmStrContDir(cont) ((_XmStringContextRec *)(cont))->dir #define _XmStrContTag(cont) ((_XmStringContextRec *)(cont))->tag #define _XmStrContTagType(cont) ((_XmStringContextRec *)(cont))->tag_type #define _XmStrContState(cont) ((_XmStringContextRec *)(cont))->state #define _XmStrContRendTags(cont) ((_XmStringContextRec *)(cont))->rend_tags #define _XmStrContRendCount(cont) ((_XmStringContextRec *)(cont))->rend_count #define _XmStrContRendIndex(cont) ((_XmStringContextRec *)(cont))->rend_index #define _XmStrContTmpStrDir(cont) ((_XmStringContextRec *)(cont))->tmp_str_dir #define _XmStrContTmpDir(cont) ((_XmStringContextRec *)(cont))->tmp_dir /* * internal context data block, for read-out */ enum { PUSH_STATE, BEGIN_REND_STATE, TAG_STATE, TAB_STATE, DIR_STATE, TEXT_STATE, END_REND_STATE, POP_STATE, SEP_STATE }; typedef struct __XmStringContextRec { _XmString string; /* pointer to internal string */ short current_line; /* index of current line */ unsigned short current_seg; /* index of current segment */ Boolean optimized; /* is string optimized */ Boolean error; /* something wrong */ short tab_count; /* tabs processed */ XmStringDirection dir; /* last direction */ XmStringTag tag; /* last tag seen */ XmTextType tag_type; /* type of last tag seen */ char state; /* current state of output */ XmStringTag *rend_tags; /* active renditions. */ short rend_count; /* number of rend_tags. */ short rend_index; /* renditions processed */ XmDirection tmp_dir; /* temporary storage */ XmStringDirection tmp_str_dir; /* temporary storage */ } _XmStringContextRec; /* * Internal representation of an XmParseMapping. */ typedef struct __XmParseMappingRec { XtPointer pattern; XmTextType pattern_type; XmString substitute; XmParseProc parse_proc; XtPointer client_data; XmIncludeStatus include_status; unsigned char internal_flags; /* reserved for unparse data */ } _XmParseMappingRec, *_XmParseMapping; /**************************************************************** * Symbolic values ****************************************************************/ #define XmSTRING_OPTIMIZED 0x0 #define XmSTRING_OTHER 0x1 #define XmSTRING_MULTIPLE_ENTRY 0x2 #define TAG_INDEX_BITS 3 #define REND_INDEX_BITS 4 #define BYTE_COUNT_BITS 8 #define TEXT_BYTES_IN_STRUCT 1 #define TAG_INDEX_UNSET ((1 << TAG_INDEX_BITS) - 1) #define TAG_INDEX_MAX TAG_INDEX_UNSET #define REND_INDEX_UNSET ((1 << REND_INDEX_BITS) - 1) #define REND_INDEX_MAX REND_INDEX_UNSET /**************************************************************** XmStringOpt is an optimized string containing text of less than 256 bytes with an associated string direction and up to three implicit tabs. The text is stored immediately after the header within the string. ****************************************************************/ typedef struct __XmStringOptHeader { unsigned int type : 2; /* XmSTRING_OPTIMIZED */ unsigned int text_type : 2; /* MB, WC, locale or charset text.*/ unsigned int tag_index : TAG_INDEX_BITS; /* index into charset cache */ unsigned int rend_begin : 1; /* flag for RENDITION_BEGIN */ unsigned char byte_count; /* size of text in this seg.*/ unsigned int rend_end : 1; /* flag for RENDITION_END */ unsigned int rend_index : REND_INDEX_BITS; /* index in tag cache */ unsigned int str_dir : 2; /* string direction set by app */ unsigned int flipped : 1; /* whether the text has been flipped */ unsigned int tabs : 2; /* number of tabs preceding the text */ unsigned int refcount : 6; /* reference count */ } _XmStringOptHeader; typedef struct __XmStringOpt { _XmStringOptHeader header; char text[TEXT_BYTES_IN_STRUCT]; } _XmStringOptRec, *_XmStringOpt; /**************************************************************** XmStringMulti specifies a string consisting of multiple entries. Each entry is a segment, either an optimized single segment, an unoptimized segment, or an array of segments. If implicit_line is 1, each entry is treated as a single line for display and other purposes. If implicit_line is 0, the string is a sequence of entries, treated as being on one line. ****************************************************************/ /* Forward definitions */ typedef union __XmStringEntryRec *_XmStringEntry; typedef union __XmStringNREntryRec *_XmStringNREntry; typedef struct __XmStringMultiHeader { unsigned int type : 2; /* XmSTRING_MULTIPLE_ENTRY */ unsigned int implicit_line : 1; /* 1 => linefeed at end */ unsigned int entry_count : 21; unsigned char refcount; } _XmStringMultiHeader; typedef struct __XmStringMulti{ _XmStringMultiHeader header; _XmStringEntry * entry; /* pointer to array of pointers to entries */ } _XmStringMultiRec, *_XmStringMulti; typedef struct __XmStringEmptyHeader { unsigned int type : 2; } _XmStringEmptyHeader; typedef union __XmStringRec { _XmStringEmptyHeader empty; _XmStringOptHeader opt_str; /* XmSTRING_OPTIMIZED */ XtPointer component; /* unused */ _XmStringMultiHeader multi_str; /* XmSTRING_MULTIPLE_ENTRY */ } _XmStringRec; /**************************************************************** Cache data structures ****************************************************************/ #define _XmSCANNING_CACHE 0 #define _XmRENDERING_CACHE 1 /* #define _XmHIGHLIGHT_CACHE 2 */ /* #define _XmCSTEXT_CACHE 3 */ /* * Header */ typedef struct __XmStringCacheRec { struct __XmStringCacheRec * next; unsigned char cache_type;/* only 255 cache types supported */ Boolean dirty; /* 1 => recompute this cache */ } _XmStringCacheHeader, *_XmStringCache; /* * Scanning cache */ typedef struct __XmStringScanning { _XmStringCacheHeader header; /* cache_type == _XmSCANNING_CACHE */ /* Matching fields */ XmDirection prim_dir; /* primary layout direction */ /* Cached data */ _XmStringEntry left; /* leftward segment in string */ _XmStringEntry right; /* rightward segment in string */ XmDirection layout_direction; /* current segment layout direction */ unsigned short depth; /* depth of layout push */ } _XmStringScanningRec, *_XmStringScanningCache; /* * Rendering cache */ typedef struct __XmStringRendering { _XmStringCacheHeader header; /* cache_type == _XmRENDERING_CACHE */ /* Matching fields */ XmRenderTable rt; /* Cached data */ int x; /* x pos of segment */ int y; /* y pos of segment */ int width; /* width of segment */ int height; /* height of segment */ int ascent; /* ascent of segment */ int descent; /* descent of segment */ int baseline; /* baseline of segment */ XmRendition rendition; /* Rendition used for this segment */ char prev_tabs; /* accumulates tabs on line */ } _XmStringRenderingRec, *_XmStringRenderingCache; /**************************************************************** Optimized segment definition. ****************************************************************/ typedef struct __XmStringOptSegHdrRec { unsigned int type : 2; /* XmSTRING_ENTRY_OPTIMIZED */ unsigned int text_type : 2; /* MB, WC, locale or charset */ unsigned int tag_index : TAG_INDEX_BITS; /* index into charset cache */ unsigned int rend_begin : 1; /* flag for RENDITION_BEGIN */ unsigned char byte_count; unsigned int rend_end : 1; /* flag for RENDITION_END */ unsigned int rend_index : REND_INDEX_BITS; /* index in rendition tag cache */ unsigned int str_dir : 2; /* Direction of text in segment */ unsigned int flipped : 1; /* 1 => data is character-flipped */ unsigned int tabs_before : 3; /* number of preceding tabs */ unsigned int permanent : 1; /* 0 => Pointer data can be freed */ unsigned int soft_line_break : 1; /* linebreak before is soft */ unsigned int immediate : 1; /* 0 => data is immediate */ unsigned int pad : 2; } _XmStringOptSegHdrRec; typedef struct __XmStringOptSegRec { _XmStringOptSegHdrRec header; union { wchar_t wchars[1]; unsigned char chars[1]; XtPointer text; } data; } _XmStringOptSegRec, *_XmStringOptSeg; /**************************************************************** Array 'segment' definition. ****************************************************************/ typedef struct __XmStringArraySegHdrRec { unsigned int type : 2; /* XmSTRING_ENTRY_ARRAY */ unsigned int soft_line_break : 1; /* linebreak before is soft */ unsigned int pad : 5; unsigned int segment_count : 8; /* 256 segments per line */ unsigned char pad2byte[2]; } _XmStringArraySegHdrRec; typedef struct __XmStringArraySegRec { _XmStringArraySegHdrRec header; _XmStringNREntry * seg; /* array of pointers to segments */ } _XmStringArraySegRec, *_XmStringArraySeg; /**************************************************************** Unoptimized segment definition. ****************************************************************/ typedef struct __XmStringUnoptSegHdrRec { unsigned int type : 2; /* XmSTRING_ENTRY_UNOPTIMIZED */ unsigned int soft_line_break : 1; /* linebreak before is soft */ unsigned int permanent : 1; /* 0 => Pointer data can be freed */ unsigned int pop_after : 1; /* whether a pop follows the text */ unsigned int str_dir : 2; /* Direction of text in segment */ unsigned int flipped : 1; /* 1 => data is character-flipped */ XmDirection push_before; /* if NULL => no push */ unsigned char tabs_before; /* Number of tabs preceding segment */ XmTextType text_type; /* determines type of text and tag */ } _XmStringUnoptSegHdrRec; typedef struct __XmStringUnoptSegRec { _XmStringUnoptSegHdrRec header; union { wchar_t * wchars; unsigned char * chars; XtPointer text; /* pointer to text. */ } data; /* To conform to opt. segment */ unsigned char begin_count; /* count of rendition tag begins */ unsigned char end_count; /* count of rendition tag ends */ XmStringTag * rend_begin_tags; /* list of rendition tag begins */ XmStringTag * rend_end_tags; /* list of rendition tag ends */ XmStringTag tag; /* locale or charset tag */ unsigned int byte_count; /* byte count for this segment */ unsigned int char_count; /* character count */ _XmStringCache cache; } _XmStringUnoptSegRec, *_XmStringUnoptSeg; /**************************************************************** XmStringEntry specifies the different 'segments' that can be part of a multiple-entry XmString. These entries can be an optimized segment, an segment with cache, also optimized, an unoptimized segment or an array of segments. The array entry type can contain any of the three other entry types, but not an array entry. This is because we do not want to handle recursive XmStrings. ****************************************************************/ #define XmSTRING_ENTRY_OPTIMIZED 0x0 #define XmSTRING_ENTRY_UNOPTIMIZED 0x1 /* #define XmSTRING_ENTRY_OPTIMIZED_CACHE 0x2 */ #define XmSTRING_ENTRY_ARRAY 0x3 typedef union __XmStringEntryRec { _XmStringEmptyHeader empty; _XmStringOptSegHdrRec single; /* XmSTRING_ENTRY_OPTIMIZED */ _XmStringUnoptSegHdrRec unopt_single; /* XmSTRING_ENTRY_UNOPTIMIZED */ _XmStringArraySegHdrRec multiple; /* XmSTRING_ENTRY_ARRAY */ } _XmStringEntryRec; /*************************************************************** _XmStringNREntry: Used in the XmStringArraySeg, to prevent recursive definitions of XmStrings. ****************************************************************/ typedef union __XmStringNREntryRec { _XmStringEmptyHeader empty; _XmStringOptSegHdrRec single; /* XmSTRING_ENTRY_OPTIMIZED */ _XmStringUnoptSegHdrRec unopt_single; /* XmSTRING_ENTRY_UNOPTIMIZED */ } _XmStringNREntryRec; /**************************************************************** * * Typedefs for old structures * ****************************************************************/ typedef struct __XmStringUnoptSegRec _XmStringSegmentRec; typedef struct __XmStringUnoptSegRec *_XmStringSegment; typedef struct __XmStringArraySegRec _XmStringLineRec; typedef struct __XmStringArraySegRec *_XmStringLine; /**************************************************************** * * Macros * ****************************************************************/ /* General */ #define _XmStrType(str) ((str)->empty.type) #define _XmStrOptimized(str) ((str)->empty.type == XmSTRING_OPTIMIZED) #define _XmStrMultiple(str) ((str)->empty.type == XmSTRING_MULTIPLE_ENTRY) #define _XmStrRefCountGet(str) (_XmStrMultiple(str) ? \ (str)->multi_str.refcount : \ (_XmStrOptimized(str) ? \ (str)->opt_str.refcount : \ 1)) #define _XmStrRefCountSet(str, val) \ (_XmStrMultiple(str) ? \ ((str)->multi_str.refcount = (val)) : \ (_XmStrOptimized(str) ? \ ((str)->opt_str.refcount = (val)) : 0)) #define _XmStrRefCountInc(str) \ (_XmStrMultiple(str) ? \ ++((str)->multi_str.refcount) : \ (_XmStrOptimized(str) ? \ ++((str)->opt_str.refcount) : 0)) #define _XmStrRefCountDec(str) \ (_XmStrMultiple(str) ? \ --((str)->multi_str.refcount) : \ (_XmStrOptimized(str) ? \ --((str)->opt_str.refcount) : 0)) /* Optimized, one-segment XmStrings */ #define _XmStrTextType(str) ((str)->opt_str.text_type) #define _XmStrTagIndex(str) ((str)->opt_str.tag_index) #define _XmStrTagGet(str) (_XmStrTagIndex(str) == TAG_INDEX_UNSET ? \ NULL : \ _XmStringIndexGetTag(_XmStrTagIndex(str))) #define _XmStrByteCount(str) ((str)->opt_str.byte_count) #define _XmStrCharCount(str) _XmStringCharacterCount((str)->opt_str.text, \ _XmStrTextType(str), \ _XmStrByteCount(str),\ NULL) #define _XmStrRendBegin(str) ((str)->opt_str.rend_begin) #define _XmStrRendIndex(str) ((str)->opt_str.rend_index) #define _XmStrRendTagGet(str) (_XmStrRendIndex(str) == REND_INDEX_UNSET ? \ NULL : \ _XmStringIndexGetTag(_XmStrRendIndex(str))) #define _XmStrRendEnd(str) ((str)->opt_str.rend_end) #define _XmStrDirection(str) ((str)->opt_str.str_dir) #define _XmStrFlipped(str) ((str)->opt_str.flipped) #define _XmStrTabs(str) ((str)->opt_str.tabs) #define _XmStrText(str) (((_XmStringOpt)(str))->text) /* Multi-segment XmStrings */ #define _XmStrImplicitLine(str) (str)->multi_str.implicit_line #define _XmStrAddNewline(str) (_XmStrMultiple(str) ? \ _XmStrImplicitLine(str) : False) #define _XmStrEntryCount(str) (str)->multi_str.entry_count #define _XmStrEntryCountGet(str) (_XmStrMultiple(str) ? \ _XmStrEntryCount(str) : 1) #define _XmStrLineCountGet(str) (_XmStrMultiple(str)&&_XmStrAddNewline(str) ? \ _XmStrEntryCount(str) : \ 1) #define _XmStrEntry(str) ((_XmStringMulti)(str))->entry #define _XmStrEntryGet(str) (_XmStrMultiple(str) ? \ _XmStrEntry(str) : \ (_XmStringEntry*)NULL) #define _XmStrInit(str, type) \ { \ switch (type) { \ case XmSTRING_OPTIMIZED : \ bzero((char*)str, sizeof(_XmStringOptRec)); \ _XmStrType(str) = type; \ _XmStrTextType(str) = XmNO_TEXT; \ _XmStrDirection(str) = XmSTRING_DIRECTION_UNSET; \ _XmStrTagIndex(str) = TAG_INDEX_UNSET; \ _XmStrRendIndex(str) = REND_INDEX_UNSET; \ _XmStrRefCountSet(str, 1); \ break; \ case XmSTRING_MULTIPLE_ENTRY : \ bzero((char*)str, sizeof(_XmStringMultiRec)); \ _XmStrType(str) = type; \ _XmStrRefCountSet(str, 1); \ break; \ } \ } #ifdef _XmDEBUG_XMSTRING_MEM #define STR_OFFSET sizeof(double) #define _XmStrMalloc(size) (XtMalloc((size) + STR_OFFSET) + STR_OFFSET) #define _XmStrFree(ptr) (XtFree(((char*)(ptr)) - STR_OFFSET)) #else #define _XmStrMalloc(size) (XtMalloc(size)) #define _XmStrFree(ptr) (XtFree((char*)(ptr))) #endif /* _XmDEBUG_XMSTRING_MEM */ #define _XmStrCreate(str, type, text_len) \ { \ switch (type) { \ case XmSTRING_OPTIMIZED : \ (str) = (_XmString) \ _XmStrMalloc(sizeof(_XmStringOptRec) + \ (text_len ? (text_len - TEXT_BYTES_IN_STRUCT) : 0)); \ bzero((char*)str, sizeof(_XmStringOptRec)); \ _XmStrType(str) = type; \ _XmStrTextType(str) = XmNO_TEXT; \ _XmStrDirection(str) = XmSTRING_DIRECTION_UNSET; \ _XmStrTagIndex(str) = TAG_INDEX_UNSET; \ _XmStrRendIndex(str) = REND_INDEX_UNSET; \ _XmStrRefCountSet(str, 1); \ _XmStrByteCount(str) = text_len; \ break; \ case XmSTRING_MULTIPLE_ENTRY : \ (str) = (_XmString)_XmStrMalloc(sizeof(_XmStringMultiRec)); \ bzero((char*)str, sizeof(_XmStringMultiRec)); \ _XmStrType(str) = type; \ _XmStrRefCountSet(str, 1); \ break; \ } \ } /* General XmString Entry macros */ #define _XmEntryType(entry) (((_XmStringEntry)(entry))->empty.type) #define _XmEntryOptimized(entry) \ (_XmEntryType(entry) == XmSTRING_ENTRY_OPTIMIZED) #define _XmEntryMultiple(entry) \ (_XmEntryType(entry) == XmSTRING_ENTRY_ARRAY) #define _XmEntryUnoptimized(entry) \ (_XmEntryType(entry) == XmSTRING_ENTRY_UNOPTIMIZED) /* Non-array entry macros */ #define _XmEntryTextTypeSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.text_type = (val)) : \ (((_XmStringEntry)(entry))->unopt_single.text_type = (val))) #define _XmEntryTagIndex(entry) \ (((_XmStringEntry)(entry))->single.tag_index) #define _XmUnoptSegTag(entry) \ ((_XmStringUnoptSeg)(entry))->tag #define _XmUnoptSegByteCount(entry) \ ((_XmStringUnoptSeg)(entry))->byte_count #define _XmEntryByteCountSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.byte_count = (val)) : \ (_XmUnoptSegByteCount(entry) = (val))) #define _XmEntryCharCountSet(entry, val) \ (_XmEntryUnoptimized(entry) ? \ (((_XmStringUnoptSeg)(entry))->char_count = (val)) : \ 0) #define _XmEntryRendIndex(entry) \ (((_XmStringEntry)(entry))->single.rend_index) #define _XmUnoptSegRendBeginCount(entry) \ ((_XmStringUnoptSeg)(entry))->begin_count #define _XmEntryRendBeginCountSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.rend_begin = (val)) : \ (_XmUnoptSegRendBeginCount(entry) = (val))) #define _XmUnoptSegRendBegins(entry) \ ((_XmStringUnoptSeg)(entry))->rend_begin_tags #define _XmUnoptSegRendEndCount(entry) \ ((_XmStringUnoptSeg)(entry))->end_count #define _XmEntryRendEndCountSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.rend_end = (val)) : \ (_XmUnoptSegRendEndCount(entry) = (val))) #define _XmUnoptSegRendEnds(entry) \ ((_XmStringUnoptSeg)(entry))->rend_end_tags #define _XmEntryTabsSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.tabs_before = (val)) : \ (((_XmStringEntry)(entry))->unopt_single.tabs_before = (val))) #define _XmEntryFlippedGet(entry) \ (_XmEntryOptimized(entry) ? \ ((_XmStringEntry)(entry))->single.flipped : \ ((_XmStringEntry)(entry))->unopt_single.flipped) #define _XmEntryFlippedSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.flipped = (val)) : \ (((_XmStringEntry)(entry))->unopt_single.flipped = (val))) #define _XmEntryPermGet(entry) \ (_XmEntryOptimized(entry) ? \ ((_XmStringEntry)(entry))->single.permanent : \ ((_XmStringEntry)(entry))->unopt_single.permanent) #define _XmEntryPermSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.permanent = (val)) : \ (((_XmStringEntry)(entry))->unopt_single.permanent = (val))) #define _XmEntrySoftNewlineGet(entry) \ (_XmEntryOptimized(entry) ? \ ((_XmStringEntry)(entry))->single.soft_line_break : \ (_XmEntryUnoptimized(entry) ? \ ((_XmStringEntry)(entry))->unopt_single.soft_line_break : \ ((_XmStringEntry)(entry))->multiple.soft_line_break)) #define _XmEntrySoftNewlineSet(entry, val) \ (_XmEntryOptimized(entry) ? \ (((_XmStringEntry)(entry))->single.soft_line_break = (val)) : \ (_XmEntryUnoptimized(entry) ? \ (((_XmStringEntry)(entry))->unopt_single.soft_line_break = (val)):\ (((_XmStringEntry)(entry))->multiple.soft_line_break = (val)))) #define _XmEntryImm(entry) \ (((_XmStringEntry)(entry))->single.immediate) #define _XmEntryPushSet(entry, val) \ (_XmEntryUnoptimized(entry) ? \ (((_XmStringEntry)(entry))->unopt_single.push_before = (val)) : \ 0) #define _XmEntryPopSet(entry, val) \ (_XmEntryUnoptimized(entry) ? \ (((_XmStringEntry)(entry))->unopt_single.pop_after = (val)) : \ 0) #define _XmEntryMBText(entry) \ (((_XmStringOptSeg)(entry))->data.chars) #define _XmEntryWCText(entry) \ (((_XmStringOptSeg)(entry))->data.wchars) #define _XmEntryCacheSet(entry, val) \ (_XmEntryUnoptimized(entry) ? \ (((_XmStringUnoptSeg)(entry))->cache = (val)) : \ NULL) /* Array entry specific macros */ #define _XmEntrySegmentCount(entry) \ (((_XmStringEntry)(entry))->multiple.segment_count) #define _XmEntrySegmentCountGet(entry) \ (_XmEntryMultiple(entry) ? \ _XmEntrySegmentCount(entry) : \ 1) #define _XmEntrySegment(entry) \ (((_XmStringArraySeg)(entry))->seg) #define _XmEntrySegmentGet(entry) \ (_XmEntryMultiple(entry) ? \ _XmEntrySegment(entry) : \ (_XmStringNREntry *)&(entry)) /* Creation macros */ #define _XmEntryInit(entry, type) \ { \ switch (type) { \ case XmSTRING_ENTRY_OPTIMIZED : \ bzero((char*)entry, sizeof(_XmStringOptSegRec)); \ _XmEntryTagIndex(entry) = TAG_INDEX_UNSET; \ _XmEntryRendIndex(entry) = REND_INDEX_UNSET; \ break; \ case XmSTRING_ENTRY_ARRAY : \ bzero((char*)entry, sizeof(_XmStringArraySegRec)); \ break; \ case XmSTRING_ENTRY_UNOPTIMIZED : \ bzero((char*)entry, sizeof(_XmStringUnoptSegRec)); \ break; \ } \ _XmEntryType(entry) = type; \ _XmEntryTextTypeSet(entry, XmNO_TEXT); \ if (type != XmSTRING_ENTRY_ARRAY) \ _XmEntryDirectionSet(entry, XmSTRING_DIRECTION_UNSET); \ } #define _XmEntryCreate(entry, type) \ { \ switch (type) { \ case XmSTRING_ENTRY_OPTIMIZED : \ (entry) = (_XmStringEntry)XtMalloc(sizeof(_XmStringOptSegRec)); \ bzero((char*)entry, sizeof(_XmStringOptSegRec)); \ _XmEntryTagIndex(entry) = TAG_INDEX_UNSET; \ _XmEntryRendIndex(entry) = REND_INDEX_UNSET; \ break; \ case XmSTRING_ENTRY_ARRAY : \ (entry) = (_XmStringEntry)XtMalloc(sizeof(_XmStringArraySegRec)); \ bzero((char*)entry, sizeof(_XmStringArraySegRec)); \ break; \ case XmSTRING_ENTRY_UNOPTIMIZED : \ (entry) = (_XmStringEntry)XtMalloc(sizeof(_XmStringUnoptSegRec)); \ bzero((char*)entry, sizeof(_XmStringUnoptSegRec)); \ break; \ } \ if (entry) { \ _XmEntryType(entry) = type; \ _XmEntryTextTypeSet(entry, XmNO_TEXT); \ if (type != XmSTRING_ENTRY_ARRAY) \ _XmEntryDirectionSet(entry, XmSTRING_DIRECTION_UNSET); \ } \ } #define _XmCACHE_DIRTY 0 #define _XmCacheDirty(cache) (((_XmStringCache)(cache))->dirty) #define _XmCacheNext(cache) (((_XmStringCache)(cache))->next) #define _XmEntryDirtyGet(entry, type, data) \ (((type) == _XmSCANNING_CACHE) ? \ (Boolean)(long)_XmScanningCacheGet((_XmStringNREntry)entry, \ (XmDirection)(long)data, \ _XmCACHE_DIRTY) : \ (((type) == _XmRENDERING_CACHE) ? \ (Boolean)(long)_XmRenderCacheGet((_XmStringEntry)entry, \ (XmRenderTable)(long)data, \ _XmCACHE_DIRTY) : \ True)) #define _XmEntryDirtySet(entry, type, data, val) \ (((type) == _XmSCANNING_CACHE) ? \ _XmScanningCacheSet((_XmStringNREntry)entry, \ (XmDirection)(long)data, \ _XmCACHE_DIRTY, (XtPointer)(long)val) : \ (((type) == _XmRENDERING_CACHE) ? \ _XmRenderCacheSet((_XmStringEntry)entry, \ (XmRenderTable)(long)data, \ _XmCACHE_DIRTY, (XtPointer)(long)val) : \ (void)NULL)) /* Scanning cache */ #define _XmCACHE_SCAN_LEFT 1 #define _XmCACHE_SCAN_RIGHT 2 #define _XmCACHE_SCAN_LAYOUT 3 #define _XmCACHE_SCAN_DEPTH 4 #define _XmEntryLeftGet(entry, d) \ (_XmStringEntry)_XmScanningCacheGet(entry, d, _XmCACHE_SCAN_LEFT) #define _XmEntryRightGet(entry, d) \ (_XmStringEntry)_XmScanningCacheGet(entry, d, _XmCACHE_SCAN_RIGHT) #define _XmEntryLayoutGet(entry, d) \ (XmDirection)(long)_XmScanningCacheGet(entry, d, _XmCACHE_SCAN_LAYOUT) #define _XmEntryLayoutDepthGet(entry, d) \ (unsigned short)(long)_XmScanningCacheGet(entry, d, _XmCACHE_SCAN_DEPTH) #define _XmEntryLeftSet(entry, d, val) \ _XmScanningCacheSet(entry, d, _XmCACHE_SCAN_LEFT, (XtPointer)(long)val) #define _XmEntryRightSet(entry, d, val) \ _XmScanningCacheSet(entry, d, _XmCACHE_SCAN_RIGHT, (XtPointer)(long)val) #define _XmEntryLayoutSet(entry, d, val) \ _XmScanningCacheSet(entry, d, _XmCACHE_SCAN_LAYOUT, (XtPointer)(long)val) #define _XmEntryLayoutDepthSet(entry, d, val) \ _XmScanningCacheSet(entry, d, _XmCACHE_SCAN_DEPTH, (XtPointer)(long)val) /* Rendering cache */ #define _XmCACHE_RENDER_WIDTH 1 #define _XmCACHE_RENDER_HEIGHT 2 #define _XmCACHE_RENDER_RENDITION 3 #define _XmCACHE_RENDER_X 4 #define _XmCACHE_RENDER_Y 5 #define _XmCACHE_RENDER_BASELINE 6 #define _XmCACHE_RENDER_ASCENT 7 #define _XmCACHE_RENDER_DESCENT 8 #define _XmCACHE_RENDER_PREV_TABS 9 #define _XmEntryXGet(entry, rt) \ (long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_X) #define _XmEntryYGet(entry, rt) \ (long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_Y) #define _XmEntryWidthGet(entry, rt) \ (long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_WIDTH) #define _XmEntryHeightGet(entry, rt) \ (long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_HEIGHT) #define _XmEntryBaselineGet(entry, rt) \ (long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_BASELINE) #define _XmEntryAscentGet(entry, rt) \ (long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_ASCENT) #define _XmEntryDescentGet(entry, rt) \ (long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_DESCENT) #define _XmEntryRenditionGet(entry, rt) \ (XmRendition)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_RENDITION) #define _XmEntryPrevTabsGet(entry, rt) \ (char)(long)_XmRenderCacheGet(entry, rt, _XmCACHE_RENDER_PREV_TABS) #define _XmEntryXSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_X, (XtPointer)(long)val) #define _XmEntryYSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_Y, (XtPointer)(long)val) #define _XmEntryWidthSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_WIDTH, (XtPointer)(long)val) #define _XmEntryHeightSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_HEIGHT, (XtPointer)(long)val) #define _XmEntryBaselineSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_BASELINE, (XtPointer)(long)val) #define _XmEntryAscentSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_ASCENT, (XtPointer)(long)val) #define _XmEntryDescentSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_DESCENT, (XtPointer)(long)val) #define _XmEntryRenditionSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_RENDITION, (XtPointer)(long)val) #define _XmEntryPrevTabsSet(entry, rt, val) \ _XmRenderCacheSet(entry, rt, _XmCACHE_RENDER_PREV_TABS, (XtPointer)(long)val) /* * Macros for old non-optimized segment data structure access */ #define _XmSegTag(seg) _XmUnoptSegTag(seg) #define _XmSegCharCount(seg) _XmUnoptSegByteCount(seg) #define _XmSegText(seg) ((_XmStringUnoptSeg)(seg))->data.text #define _XmSegDirection(seg) _XmEntryDirectionGet(seg) #define _XmSegLayoutDirection(seg) _XmEntryPushGet(seg) #define _XmSegLayout(seg) _XmEntryPopGet(seg) #define _XmSegType(seg) _XmEntryTextTypeGet(seg) #define _XmSegTextGet(seg) (unsigned char *)_XmSegText(seg) #define _XmSegTextSet(seg,val) _XmEntryTextSet(seg, (XtPointer)(val)) #define _XmSegMBTextGet(seg) _XmEntryMBText(seg) #define _XmSegWCTextGet(seg) _XmEntryWCText(seg) #define _XmSegTab(seg) _XmEntryTabsGet(seg) #define _XmSegLeft(seg) ((_XmStringUnoptSeg)seg)->cache #define _XmSegRight(seg) ((_XmStringUnoptSeg)seg)->cache #define _XmSegRendBegins(seg) _XmUnoptSegRendBegins(seg) #define _XmSegRendBeginGet(seg,n) _XmEntryRendBeginGet(seg,n) #define _XmSegRendBeginCount(seg) _XmUnoptSegRendBeginCount(seg) #define _XmSegRendEnds(seg) _XmUnoptSegRendEnds(seg) #define _XmSegRendEndGet(seg,n) _XmEntryRendEndGet(seg,n) #define _XmSegRendEndCount(seg) _XmUnoptSegRendEndCount(seg) /* * Macros for line data structure access */ #define _XmStrLineSegCount(line) _XmEntrySegmentCount(line) #define _XmStrLineSegment(line) \ ((_XmStringSegment *)_XmEntrySegment(line)) #define _XmStrLineSegmentSet(line, val) _XmEntrySegment(line) = \ (_XmStringNREntry *)(val) /* * Macros for internal string data structure access */ #define _XmStrLineCnt(str) _XmStrEntryCount(str) #define _XmStrLineLine(str) ((_XmStringLine *)_XmStrEntry(str)) #define _XmStrLineLineSet(str, val) _XmStrEntry(str) = \ (_XmStringEntry *)(val) /**************************************************************** * * Function headers * ****************************************************************/ /**** Private Defines, Typedefs, and Function Declarations for XmString.c ****/ extern XFontStruct * _XmGetFirstFont( XmFontListEntry entry) ; extern Boolean _XmFontListSearch( XmFontList fontlist, XmStringCharSet charset, short *indx, XFontStruct **font_struct) ; extern int _XmStringIndexCacheTag( XmStringTag tag, int length) ; extern XmStringTag _XmStringCacheTag( XmStringTag tag, int length) ; extern Boolean _XmStringInitContext( _XmStringContext *context, _XmString string) ; extern Boolean _XmStringGetNextSegment( _XmStringContext context, XmStringCharSet *charset, XmStringDirection *direction, char **text, short *char_count, Boolean *separator) ; extern void _XmStringFreeContext( _XmStringContext context) ; extern Dimension _XmStringWidth( XmFontList fontlist, _XmString string) ; extern Dimension _XmStringHeight( XmFontList fontlist, _XmString string) ; extern void _XmStringExtent( XmFontList fontlist, _XmString string, Dimension *width, Dimension *height) ; extern Boolean _XmStringEmpty( _XmString string) ; extern void _XmStringDraw( Display *d, Window w, XmFontList fontlist, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip) ; extern void _XmStringDrawImage( Display *d, Window w, XmFontList fontlist, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip) ; extern void _XmStringDrawUnderline( Display *d, Window w, XmFontList f, _XmString s, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, _XmString u) ; extern void _XmStringDrawMnemonic( Display *d, Window w, XmFontList fontlist, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, String mnemonic, XmStringCharSet charset) ; extern void _XmStringRender(Display *d, Drawable w, XmRenderTable rendertable, XmRendition rend, _XmString string, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir #endif /* NeedWidePrototypes */ ) ; extern _XmString _XmStringCreate( XmString cs) ; extern void _XmStringFree( _XmString string) ; extern char * _XmStringGetCurrentCharset( void ) ; extern char * _XmCharsetCanonicalize( String charset) ; extern _XmString _XmStringCopy( _XmString string) ; extern Boolean _XmStringByteCompare( _XmString a, _XmString b) ; extern Boolean _XmStringHasSubstring( _XmString string, _XmString substring) ; extern XmString _XmStringCreateExternal( XmFontList fontlist, _XmString cs) ; extern Dimension _XmStringBaseline( XmFontList fontlist, _XmString string) ; extern void _XmStringGetBaselines(XmRenderTable rendertable, _XmString string, Dimension **baselines, Cardinal *line_count); extern int _XmStringLineCount( _XmString string) ; extern char * _XmStringGetTextConcat( XmString string) ; extern Boolean _XmStringIsCurrentCharset( XmStringCharSet c) ; extern Boolean _XmStringSingleSegment( XmString str, char **pTextOut, XmStringCharSet *pCharsetOut ) ; extern NextTabResult _XmStringGetNextTabWidth(XmStringContext ctx, Widget widget, unsigned char units, XmRenderTable rt, float *width, XmRendition *rend); extern XtPointer _XmStringUngenerate (XmString string, XmStringTag tag, XmTextType tag_type, XmTextType output_type); extern void _XmStringDrawSegment(Display *d, Drawable w, #if NeedWidePrototypes int x, int y, int width, int height, #else Position x, Position y, Dimension width, Dimension height, #endif /* NeedWidePrototypes */ _XmStringNREntry seg, XmRendition rend, XmRenderTable rendertable, #if NeedWidePrototypes int image, #else Boolean image, #endif /* NeedWidePrototypes */ XmString *underline, #if NeedWidePrototypes unsigned int descender #else Dimension descender #endif /* NeedWidePrototypes */ ); extern void _XmStringDrawLining(Display *d, Drawable w, Position x, Position y, Dimension width, Dimension height, Dimension descender, XmRendition rend, Pixel select_color, XmHighlightMode mode, Boolean colors_set); extern Boolean _XmStringSegmentExtents(_XmStringEntry entry, XmRenderTable rendertable, XmRendition *rend_in_out, XmRendition base, Dimension *width, Dimension *height, Dimension *ascent, Dimension *descent); extern void _XmStringLayout(_XmString string, #if NeedWidePrototypes int direction #else XmDirection direction #endif /* NeedWidePrototypes */ ); extern _XmString _XmStringOptToNonOpt(_XmStringOpt string); extern XmString _XmStringCvtOptToMulti(XmString str); extern XmString _XmStringOptimize(XmString str); extern XmString _XmStringMakeXmString(_XmStringEntry **entries, int count); extern void _XmStringEntryFree(_XmStringEntry entry); extern _XmStringEntry _XmStringEntryCopy(_XmStringEntry entry); extern unsigned char _XmStringCharacterCount(XtPointer text, XmTextType text_type, int byte_count, XFontStruct *font); extern unsigned char _XmEntryCharCountGet(_XmStringEntry entry, XmRenderTable rt); extern _XmStringCache _XmStringCacheGet(_XmStringCache caches, int type); extern void _XmStringCacheFree(_XmStringCache caches); extern XtPointer _XmScanningCacheGet(_XmStringNREntry entry, #if NeedWidePrototypes int d, #else XmDirection d, #endif /* NeedWidePrototypes */ int field); extern void _XmScanningCacheSet(_XmStringNREntry entry, #if NeedWidePrototypes int d, #else XmDirection d, #endif /* NeedWidePrototypes */ int field, XtPointer value); /* Rendering cache */ extern XtPointer _XmRenderCacheGet(_XmStringEntry entry, XmRenderTable rt, int field); extern void _XmRenderCacheSet(_XmStringEntry entry, XmRenderTable rt, int field, XtPointer value); extern XmStringTag _XmStringIndexGetTag(int index); extern Boolean _XmStringGetSegment(_XmStringContext context, Boolean update_context, Boolean copy_data, XtPointer *text, XmStringTag *tag, XmTextType *type, XmStringTag **rendition_tags, unsigned int *tag_count, XmStringDirection *direction, Boolean *separator, unsigned char *tabs, short *char_count, XmDirection *push_before, Boolean *pop_after); /* Declarations for macro to function switchover. */ extern _XmStringCache _XmEntryCacheGet(_XmStringEntry entry); extern XmStringTag _XmEntryTag(_XmStringEntry entry); extern void _XmEntryTagSet(_XmStringEntry entry, XmStringTag tag); extern XtPointer _XmEntryTextGet(_XmStringEntry entry); extern XmDirection _XmEntryPushGet(_XmStringEntry entry); extern Boolean _XmEntryPopGet(_XmStringEntry entry); extern unsigned int _XmEntryByteCountGet(_XmStringEntry entry); extern unsigned int _XmEntryDirectionGet(_XmStringEntry entry); extern void _XmEntryDirectionSet(_XmStringEntry entry, XmDirection val); extern unsigned char _XmEntryRendEndCountGet(_XmStringEntry entry); extern unsigned char _XmEntryRendBeginCountGet(_XmStringEntry entry); extern XmStringTag _XmEntryRendEndGet(_XmStringEntry entry, int n); extern XmStringTag _XmEntryRendBeginGet(_XmStringEntry entry, int n); extern void _XmEntryRendEndSet(_XmStringEntry entry, XmStringTag tag, int n); extern void _XmEntryRendBeginSet(_XmStringEntry entry, XmStringTag tag, int n); extern unsigned char _XmEntryTabsGet(_XmStringEntry entry); extern unsigned int _XmEntryTextTypeGet(_XmStringEntry entry); extern void _XmEntryTextSet(_XmStringEntry entry, XtPointer val); extern unsigned char *_XmStringTruncateASN1(unsigned char *str, int n); extern void _XmStringContextCopy(_XmStringContext target, _XmStringContext source); extern void _XmStringContextFree(_XmStringContext target); extern XmString _XmStringNCreate(char *text, XmStringTag tag, int len); extern void _XmStringSegmentNew(_XmString string, int line_index, _XmStringEntry value, int copy) ; extern void _XmStringContextReInit(_XmStringContext context, _XmString string); extern int _XmConvertFactor(unsigned char units, float *factor); #ifdef _XmDEBUG_XMSTRING extern void _Xm_dump_fontlist(XmFontList f) ; extern void _Xm_dump_fontlist_cache( void ) ; extern void _Xm_dump_stream( unsigned char *cs) ; extern void _Xm_dump_internal(_XmString string) ; #endif /* _XmDEBUG_XMSTRING */ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmStringI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MenuShellI.h0000644000175000017500000000364212672140200013072 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: MenuShellI.h /main/5 1995/07/13 17:36:29 drk $ */ #ifndef _XmMenuShellI_h #define _XmMenuShellI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmEnterRowColumn( Widget widget, XtPointer closure, XEvent *event, Boolean *cont) ; extern void _XmClearTraversal( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmSetLastManagedMenuTime( Widget wid, Time newTime ) ; extern void _XmPopupSpringLoaded( Widget shell ) ; extern void _XmPopdown( Widget shell ) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuShellI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DropSMgr.h0000644000175000017500000001153513145162623012573 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDropSMgr_h #define _XmDropSMgr_h #include #include #ifdef __cplusplus extern "C" { #endif #define XmCR_DROP_SITE_LEAVE_MESSAGE 1 #define XmCR_DROP_SITE_ENTER_MESSAGE 2 #define XmCR_DROP_SITE_MOTION_MESSAGE 3 #define XmCR_DROP_MESSAGE 4 #define XmNO_DROP_SITE 1 #define XmINVALID_DROP_SITE 2 #define XmVALID_DROP_SITE 3 /* begin fix for CR 5754 */ /* documented values are XmDROP_SITE_VALID and XmDROP_SITE_INVALID. However, we can't just throw out the incorrect Xm[IN]VALID_DROP_SITE now since people have probably started using them. Instead, we just define the correct values using the incorrect ones. */ #define XmDROP_SITE_INVALID XmINVALID_DROP_SITE #define XmDROP_SITE_VALID XmVALID_DROP_SITE /* end fix for CR 5754 */ enum { XmDRAG_UNDER_NONE, XmDRAG_UNDER_PIXMAP, XmDRAG_UNDER_SHADOW_IN, XmDRAG_UNDER_SHADOW_OUT, XmDRAG_UNDER_HIGHLIGHT }; enum { XmDROP_SITE_SIMPLE, XmDROP_SITE_COMPOSITE, XmDROP_SITE_SIMPLE_CLIP_ONLY = 128, XmDROP_SITE_COMPOSITE_CLIP_ONLY }; enum { XmABOVE, XmBELOW }; enum { XmDROP_SITE_ACTIVE, XmDROP_SITE_INACTIVE, XmDROP_SITE_IGNORE }; typedef struct _XmDragProcCallbackStruct { int reason; XEvent * event; Time timeStamp; Widget dragContext; Position x, y; unsigned char dropSiteStatus; unsigned char operation; unsigned char operations; Boolean animate; } XmDragProcCallbackStruct, * XmDragProcCallback; typedef struct _XmDropProcCallbackStruct { int reason; XEvent * event; Time timeStamp; Widget dragContext; Position x, y; unsigned char dropSiteStatus; unsigned char operation; unsigned char operations; unsigned char dropAction; } XmDropProcCallbackStruct, * XmDropProcCallback; typedef struct _XmDropSiteVisualsRec { Pixel background; Pixel foreground; Pixel topShadowColor; Pixmap topShadowPixmap; Pixel bottomShadowColor; Pixmap bottomShadowPixmap; Dimension shadowThickness; Pixel highlightColor; Pixmap highlightPixmap; Dimension highlightThickness; Dimension borderWidth; } XmDropSiteVisualsRec, * XmDropSiteVisuals; /* DropSite Widget */ externalref WidgetClass xmDropSiteManagerObjectClass; typedef struct _XmDropSiteManagerClassRec *XmDropSiteManagerObjectClass; typedef struct _XmDropSiteManagerRec *XmDropSiteManagerObject; #ifndef XmIsDropSiteManager #define XmIsDropSiteManager(w) XtIsSubclass((w), xmDropSiteManagerObjectClass) #endif /* XmIsDropSite */ /******** Public Function Declarations ********/ extern void XmDropSiteRegister( Widget widget, ArgList args, Cardinal argCount) ; extern void XmDropSiteUnregister( Widget widget) ; extern Boolean XmDropSiteRegistered( Widget widget) ; extern void XmDropSiteStartUpdate( Widget refWidget) ; extern void XmDropSiteUpdate( Widget enclosingWidget, ArgList args, Cardinal argCount) ; extern void XmDropSiteEndUpdate( Widget refWidget) ; extern void XmDropSiteRetrieve( Widget enclosingWidget, ArgList args, Cardinal argCount) ; extern int XmDropSiteQueryStackingOrder( Widget widget, Widget *parent_rtn, Widget **children_rtn, Cardinal *num_children_rtn) ; extern void XmDropSiteConfigureStackingOrder( Widget widget, Widget sibling, Cardinal stack_mode) ; extern XmDropSiteVisuals XmDropSiteGetActiveVisuals( Widget widget) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDropSMgr_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Primitive.c0000644000175000017500000012665413145162623013052 00000000000000 /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Primitive.c /main/25 1999/01/27 16:08:04 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "ColorI.h" #include "MessagesI.h" #include "PixConvI.h" #include "PrimitiveI.h" #include "RepTypeI.h" #include "ResConverI.h" #include "ResIndI.h" #include "SyntheticI.h" #include "ToolTipI.h" #include "TraitI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "XmI.h" #define MESSAGE1 _XmMMsgPrimitive_0000 /******** Static Function Declarations ********/ static void GetXFromShell( Widget wid, int resource_offset, XtArgVal *value) ; static void GetYFromShell( Widget wid, int resource_offset, XtArgVal *value) ; static void ClassInitialize( void ) ; static void BuildPrimitiveResources( WidgetClass c ) ; static void ClassPartInitialize( WidgetClass w) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Realize( register Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) ; static void Destroy( Widget w) ; static void Redisplay ( Widget w, XEvent *event, Region region); static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void HighlightBorder( Widget w) ; static void UnhighlightBorder( Widget w) ; static XmNavigability WidgetNavigable( Widget wid) ; static void FocusChange( Widget wid, XmFocusChange change) ; static Boolean Redraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static XmDirection GetDirection(Widget); static void GetColors(Widget widget, XmAccessColorData color_data); static unsigned char GetUnitType(Widget); static void GetToolTipString( Widget wid, int resource, /* unused */ XtArgVal * value); static XmImportOperator SetToolTipString( Widget wid, int resource, /* unused */ XtArgVal * value); /******** End Static Function Declarations ********/ /************************************************************************ * * Default translation table * These translations will be compiled at class initialize. When * a subclass of primitive is created then these translations will * be used to augment the translations of the subclass IFF * traversal is on. The SetValues routine will also augment * a subclass's translations table IFF traversal goes from off to on. * Since we are augmenting it should not be a problem when * traversal goes from off to on to off and on again. * ************************************************************************/ #define defaultTranslations _XmPrimitive_defaultTranslations /************************************************************************ * * Action list. * *************************************<->***********************************/ static XtActionsRec actions[] = { {"PrimitiveFocusIn", _XmPrimitiveFocusIn}, {"PrimitiveFocusOut", _XmPrimitiveFocusOut}, {"PrimitiveUnmap", _XmPrimitiveUnmap}, {"PrimitiveHelp", _XmPrimitiveHelp}, {"PrimitiveEnter", _XmPrimitiveEnter}, {"PrimitiveLeave", _XmPrimitiveLeave}, {"PrimitiveTraverseLeft", _XmTraverseLeft}, {"PrimitiveTraverseRight", _XmTraverseRight}, {"PrimitiveTraverseUp", _XmTraverseUp }, {"PrimitiveTraverseDown", _XmTraverseDown }, {"PrimitiveTraverseNext", _XmTraverseNext }, {"PrimitiveTraversePrev", _XmTraversePrev }, {"PrimitiveTraverseHome", _XmTraverseHome }, {"PrimitiveNextTabGroup", _XmTraverseNextTabGroup }, {"PrimitivePrevTabGroup", _XmTraversePrevTabGroup }, {"PrimitiveParentActivate", _XmPrimitiveParentActivate }, {"PrimitiveParentCancel", _XmPrimitiveParentCancel }, {"unmap", _XmPrimitiveUnmap}, /* Motif 1.0 BC. */ {"Help", _XmPrimitiveHelp}, /* Motif 1.0 BC. */ {"enter", _XmPrimitiveEnter}, /* Motif 1.0 BC. */ {"leave", _XmPrimitiveLeave}, /* Motif 1.0 BC. */ {"PrevTabGroup", _XmTraversePrevTabGroup},/* Motif 1.0 BC. */ {"NextTabGroup", _XmTraverseNextTabGroup},/* Motif 1.0 BC. */ }; /*****************************************/ /* Resource definitions for XmPrimitive */ static XtResource resources[] = { { XmNunitType, XmCUnitType, XmRUnitType, sizeof (unsigned char), XtOffsetOf(XmPrimitiveRec, primitive.unit_type), XmRCallProc, (XtPointer) _XmUnitTypeDefault }, { XmNx, XmCPosition, XmRHorizontalPosition, sizeof(Position), XtOffsetOf(WidgetRec, core.x), XmRImmediate, (XtPointer) 0 }, { XmNy, XmCPosition, XmRVerticalPosition, sizeof(Position), XtOffsetOf(WidgetRec, core.y), XmRImmediate, (XtPointer) 0 }, { XmNwidth, XmCDimension, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.width), XmRImmediate, (XtPointer) 0 }, { XmNheight, XmCDimension, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.height), XmRImmediate, (XtPointer) 0 }, { XmNborderWidth, XmCBorderWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.border_width), XmRImmediate, (XtPointer) 0 }, { XmNforeground, XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf(XmPrimitiveRec, primitive.foreground), XmRCallProc, (XtPointer) _XmForegroundColorDefault }, { XmNbackground, XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf(WidgetRec, core.background_pixel), XmRCallProc, (XtPointer) _XmBackgroundColorDefault }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf(XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPrimitiveRec, primitive.highlight_on_enter), XmRImmediate, (XtPointer) False }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf(XmPrimitiveRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmNONE }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmPrimitiveRec, primitive.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNhighlightColor, XmCHighlightColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmPrimitiveRec, primitive.highlight_color), XmRCallProc, (XtPointer) _XmHighlightColorDefault }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmPrimitiveRec, primitive.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNtopShadowColor, XmCTopShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmPrimitiveRec, primitive.top_shadow_color), XmRCallProc, (XtPointer) _XmTopShadowColorDefault }, { XmNbottomShadowColor, XmCBottomShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmPrimitiveRec, primitive.bottom_shadow_color), XmRCallProc, (XtPointer) _XmBottomShadowColorDefault }, { XmNbackgroundPixmap, XmCPixmap, XmRPixmap, sizeof (Pixmap), XtOffsetOf(WidgetRec, core.background_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNhighlightPixmap, XmCHighlightPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(XmPrimitiveRec, primitive.highlight_pixmap), XmRCallProc, (XtPointer) _XmHighlightPixmapDefault }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(XmPrimitiveRec, primitive.top_shadow_pixmap), XmRCallProc, (XtPointer) _XmTopShadowPixmapDefault }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(XmPrimitiveRec, primitive.bottom_shadow_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNhelpCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmPrimitiveRec, primitive.help_callback), XmRPointer, (XtPointer) NULL }, { XmNuserData, XmCUserData, XmRPointer, sizeof(XtPointer), XtOffsetOf(XmPrimitiveRec, primitive.user_data), XmRImmediate, (XtPointer) NULL }, #ifndef XM_PART_BC { XmNpopupHandlerCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmPrimitiveRec, primitive.popup_handler_callback), XmRPointer, (XtPointer) NULL }, { XmNconvertCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmPrimitiveRec, primitive.convert_callback), XmRCallback, NULL }, { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), XtOffsetOf(XmPrimitiveRec, primitive.layout_direction), XmRCallProc, (XtPointer) _XmDirectionDefault }, #endif }; #ifdef XM_PART_BC XmDirection XmPrimLayoutDir = XmDEFAULT_DIRECTION ; #endif /***************************************/ /* Definition for synthetic resources */ static XmSyntheticResource syn_resources[] = { { XmNx, sizeof (Position), XtOffsetOf(WidgetRec, core.x), GetXFromShell, XmeToHorizontalPixels }, { XmNy, sizeof (Position), XtOffsetOf(WidgetRec, core.y), GetYFromShell, XmeToVerticalPixels }, { XmNwidth, sizeof (Dimension), XtOffsetOf(WidgetRec, core.width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNheight, sizeof (Dimension), XtOffsetOf(WidgetRec, core.height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNborderWidth, sizeof (Dimension), XtOffsetOf(WidgetRec, core.border_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNhighlightThickness, sizeof (Dimension), XtOffsetOf(XmPrimitiveRec, primitive.highlight_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNshadowThickness, sizeof (Dimension), XtOffsetOf(XmPrimitiveRec, primitive.shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNtoolTipString, 0, 0, GetToolTipString, SetToolTipString } }; /*******************************************/ /* Declaration of class extension records */ static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* get_values_prehook */ NULL, /* get_values_posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ FocusChange, /* focusChange */ }; static XmPrimitiveClassExtRec primClassExtRec = { NULL, NULLQUARK, XmPrimitiveClassExtVersion, sizeof(XmPrimitiveClassExtRec), NULL, /* widget_baseline */ NULL, /* widget_display_rect */ NULL /* widget_margins */ }; /*******************************************/ /* The Primitive class record definition */ externaldef(xmprimitiveclassrec) XmPrimitiveClassRec xmPrimitiveClassRec = { { (WidgetClass) &widgetClassRec, /* superclass */ "XmPrimitive", /* class_name */ sizeof(XmPrimitiveRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ Realize, /* realize */ actions, /* actions */ XtNumber(actions), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ XtExposeCompressMaximal | /* compress_exposure */ XtExposeNoRegion, True, /* compress_enterleave */ False, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ _XmPrimitiveGetValuesHook, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { HighlightBorder, /* border_highlight */ UnhighlightBorder, /* border_unhighlight */ defaultTranslations, /* translations */ NULL, /* arm_and_activate */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num_syn_resources */ (XtPointer)&primClassExtRec, /* extension */ } }; externaldef(xmprimitivewidgetclass) WidgetClass xmPrimitiveWidgetClass = (WidgetClass) &xmPrimitiveClassRec; static XmConst XmSpecifyLayoutDirectionTraitRec primLDT = { 0, /* version */ GetDirection }; /* Care visual Trait record for Primitive */ static XmConst XmCareVisualTraitRec primCVT = { 0, /* version */ Redraw, }; /* Access Colors Trait record for Primitive */ static XmConst XmAccessColorsTraitRec primACT = { 0, /* version */ GetColors }; /* Unit Type Trait record for Primitive */ static XmConst XmSpecUnitTypeTraitRec primUTT = { 0, /* version */ GetUnitType }; /************************************************************************** ** ** Synthetic resource hooks function section ** **************************************************************************/ static void GetXFromShell( Widget wid, int resource_offset, XtArgVal *value ) { /* return the x in the child's unit type; for children of shell, return ** the parent's x relative to the origin, in pixels */ Position rootx, rooty; Widget parent = XtParent(wid); if (XtIsShell(parent)) { XtTranslateCoords( (Widget) wid, (Position) 0, (Position) 0, &rootx, &rooty) ; *value = (XtArgVal) rootx; } else { *value = (XtArgVal) wid->core.x ; XmeFromHorizontalPixels(wid, resource_offset, value); } } static void GetYFromShell( Widget wid, int resource_offset, XtArgVal *value ) { /* return the y in the child's unit type; for children of shell, return ** the parent's y relative to the origin, in pixels */ Position rootx, rooty; Widget parent = XtParent(wid); if (XtIsShell(parent)) { XtTranslateCoords( (Widget) wid, (Position) 0, (Position) 0, &rootx, &rooty) ; *value = (XtArgVal) rooty; } else { *value = (XtArgVal) wid->core.y ; XmeFromVerticalPixels(wid, resource_offset, value); } } /************************************************************************ * * ClassInitialize * ************************************************************************/ static void ClassInitialize( void ) { /* These routines are called for each base classes, they just returned if it has been done already */ _XmRegisterConverters(); _XmRegisterPixmapConverters(); _XmInitializeExtensions(); _XmInitializeTraits(); baseClassExtRec.record_type = XmQmotif; } /********************************************************************** * * BuildPrimitiveResources * Build up the primitive's synthetic resource processing * list by combining the super classes with this class. * **********************************************************************/ static void BuildPrimitiveResources( WidgetClass c ) { XmPrimitiveWidgetClass wc = (XmPrimitiveWidgetClass) c ; XmPrimitiveWidgetClass sc = (XmPrimitiveWidgetClass) wc->core_class.superclass; _XmInitializeSyntheticResources(wc->primitive_class.syn_resources, wc->primitive_class.num_syn_resources); if (sc == (XmPrimitiveWidgetClass) widgetClass) return; _XmBuildResources (&(wc->primitive_class.syn_resources), &(wc->primitive_class.num_syn_resources), sc->primitive_class.syn_resources, sc->primitive_class.num_syn_resources); } /************************************************************************ * * ClassPartInitialize * Set up the inheritance mechanism for the routines exported by * primitives class part. * ************************************************************************/ static void ClassPartInitialize( WidgetClass w ) { static Boolean first_time = TRUE; XmPrimitiveWidgetClass wc = (XmPrimitiveWidgetClass) w; XmPrimitiveWidgetClass super = (XmPrimitiveWidgetClass) wc->core_class.superclass; XmPrimitiveClassExt *wcePtr, *scePtr; _XmFastSubclassInit (w, XmPRIMITIVE_BIT); /*** first deal with inheritance of regular class method */ if (wc->primitive_class.border_highlight == XmInheritWidgetProc) wc->primitive_class.border_highlight = super->primitive_class.border_highlight; if (wc->primitive_class.border_unhighlight == XmInheritWidgetProc) wc->primitive_class.border_unhighlight = super->primitive_class.border_unhighlight; if (wc->primitive_class.translations == XtInheritTranslations) wc->primitive_class.translations = super->primitive_class.translations; else if (wc->primitive_class.translations) wc->primitive_class.translations = (String) XtParseTranslationTable(wc->primitive_class.translations); if (wc->primitive_class.arm_and_activate == XmInheritArmAndActivate) wc->primitive_class.arm_and_activate = super->primitive_class.arm_and_activate; /* synthetic resource management */ BuildPrimitiveResources((WidgetClass) wc); /*** then look at the extension. if it's NULL, create a new one with inherit everywhere, then do the inheritance. */ wcePtr = _XmGetPrimitiveClassExtPtr(wc, NULLQUARK); if (*wcePtr == NULL) { *wcePtr = (XmPrimitiveClassExt) XtCalloc(1, sizeof(XmPrimitiveClassExtRec)) ; (*wcePtr)->next_extension = NULL; (*wcePtr)->record_type = NULLQUARK; (*wcePtr)->version = XmPrimitiveClassExtVersion ; (*wcePtr)->record_size = sizeof(XmPrimitiveClassExtRec); (*wcePtr)->widget_baseline = XmInheritBaselineProc; (*wcePtr)->widget_display_rect = XmInheritDisplayRectProc ; (*wcePtr)->widget_margins = XmInheritMarginsProc ; } if ((WidgetClass)wc != xmPrimitiveWidgetClass) { scePtr = _XmGetPrimitiveClassExtPtr(super, NULLQUARK); if ((*wcePtr)->widget_baseline == XmInheritBaselineProc) (*wcePtr)->widget_baseline = (*scePtr)->widget_baseline; if ((*wcePtr)->widget_display_rect == XmInheritDisplayRectProc) (*wcePtr)->widget_display_rect = (*scePtr)->widget_display_rect; if ((*wcePtr)->widget_margins == XmInheritMarginsProc) (*wcePtr)->widget_margins = (*scePtr)->widget_margins; } /*** Carry this ugly non portable code that deal with Xt internals. Maintain first_time because we want to do that only once Object ClassPartInit has been called */ if (first_time) { _XmReOrderResourceList(xmPrimitiveWidgetClass, XmNunitType, NULL); _XmReOrderResourceList(xmPrimitiveWidgetClass, XmNforeground, XmNbackground); first_time = FALSE; } /*** setting up traits for all subclasses as well.*/ XmeTraitSet((XtPointer)wc, XmQTspecifyLayoutDirection,(XtPointer)&primLDT); XmeTraitSet((XtPointer)wc, XmQTcareParentVisual, (XtPointer)&primCVT); XmeTraitSet((XtPointer)wc, XmQTaccessColors, (XtPointer)&primACT); XmeTraitSet((XtPointer)wc, XmQTspecifyUnitType, (XtPointer)&primUTT); } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmPrimitiveWidget request = (XmPrimitiveWidget) rw ; XmPrimitiveWidget pw = (XmPrimitiveWidget) nw ; XtTranslations translations ; XmString tool_tip_string; static XtResource subresources[] = { { XmNtoolTipString, XmCToolTipString, XmRXmString, sizeof(XmString), 0, XmRImmediate, (XtPointer) NULL }, }; _XmProcessLock(); translations = (XtTranslations) ((XmPrimitiveClassRec *) XtClass( pw)) ->primitive_class.translations ; _XmProcessUnlock(); XtGetSubresources(nw, &tool_tip_string, NULL, NULL, subresources, XtNumber(subresources), args, *num_args); XmSetToolTipString(nw, (XmString) tool_tip_string); if( pw->primitive.traversal_on && translations && pw->core.tm.translations && !XmIsLabel( pw) ) { /* If this widget is requesting traversal then augment its * translation table with some additional events. * We will only augment translations for a widget which * already has some translations defined; this allows widgets * which want to set different translations (i.e. menus) to * it at a later point in time. * We do not override RowColumn and Label subclasses, these * are handled by those classes. */ XtOverrideTranslations( (Widget) pw, translations) ; } pw->primitive.have_traversal = FALSE ; pw->primitive.highlighted = FALSE ; pw->primitive.highlight_drawn = FALSE ; if((pw->primitive.navigation_type != XmDYNAMIC_DEFAULT_TAB_GROUP) && !XmRepTypeValidValue(XmRID_NAVIGATION_TYPE, pw->primitive.navigation_type, (Widget) pw)) { pw->primitive.navigation_type = XmNONE ; } _XmNavigInitialize( (Widget) request, (Widget) pw, args, num_args); if( !XmRepTypeValidValue( XmRID_UNIT_TYPE, pw->primitive.unit_type, (Widget) pw) ) { pw->primitive.unit_type = XmPIXELS; } /* Convert the fields from unit values to pixel values */ _XmPrimitiveImportArgs( (Widget) pw, args, num_args); /* Check the geometry information for the widget */ if (request->core.width == 0) pw->core.width += pw->primitive.highlight_thickness * 2 + pw->primitive.shadow_thickness * 2; if (request->core.height == 0) pw->core.height += pw->primitive.highlight_thickness * 2 + pw->primitive.shadow_thickness * 2; /* Get the graphics contexts for the border drawing */ pw->primitive.highlight_GC = _XmGetPixmapBasedGC (nw, pw->primitive.highlight_color, pw->core.background_pixel, pw->primitive.highlight_pixmap); pw->primitive.top_shadow_GC = _XmGetPixmapBasedGC (nw, pw->primitive.top_shadow_color, pw->core.background_pixel, pw->primitive.top_shadow_pixmap); pw->primitive.bottom_shadow_GC = _XmGetPixmapBasedGC (nw, pw->primitive.bottom_shadow_color, pw->core.background_pixel, pw->primitive.bottom_shadow_pixmap); } /************************************************************************ * * Realize * General realize procedure for primitive widgets. Lets the bit * gravity default to Forget. * ************************************************************************/ static void Realize( register Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { Mask valueMask = *p_valueMask; valueMask |= CWDontPropagate; attributes->do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | PointerMotionMask; XtCreateWindow (w, InputOutput, CopyFromParent, valueMask, attributes); } /************************************************************************ * * Redisplay * General redisplay function called on exposure events. * ************************************************************************/ /* ARGSUSED */ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmPrimitiveWidget pw = (XmPrimitiveWidget) wid ; if (pw->primitive.highlighted) { (*(((XmPrimitiveWidgetClass) XtClass(wid)) ->primitive_class.border_highlight))(wid) ; } else { (*(((XmPrimitiveWidgetClass) XtClass(wid)) ->primitive_class.border_unhighlight))(wid) ; } } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget w ) { XmPrimitiveWidget pw = (XmPrimitiveWidget) w ; _XmNavigDestroy(w); #ifdef FIX_1388 _XmToolTipRemove(w); #else _XmToolTipLeave(w, NULL, NULL, NULL); #endif XtReleaseGC( w, pw->primitive.top_shadow_GC); XtReleaseGC( w, pw->primitive.bottom_shadow_GC); XtReleaseGC( w, pw->primitive.highlight_GC); } /************************************************************************ * * SetValues * Perform and updating necessary for a set values call. * ************************************************************************/ static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args ) { XmPrimitiveWidget curpw = (XmPrimitiveWidget) current; XmPrimitiveWidget newpw = (XmPrimitiveWidget) new_w; Boolean returnFlag = False; if (XtIsSensitive(current) != XtIsSensitive(new_w)) { if (!XtIsSensitive(new_w)) { _XmToolTipLeave(new_w, NULL, NULL, NULL); } } if (XmGetToolTipString(new_w) != XmGetToolTipString(current)) { XmSetToolTipString(current, XmGetToolTipString (new_w)); } /* CR 7124: XmNlayoutDirection is a CG resource. */ if (XmPrim_layout_direction(curpw) != XmPrim_layout_direction(newpw)) { XmeWarning(new_w, MESSAGE1); XmPrim_layout_direction(newpw) = XmPrim_layout_direction(curpw); } if( newpw->primitive.traversal_on && (newpw->primitive.traversal_on != curpw->primitive.traversal_on) && newpw->core.tm.translations && ((XmPrimitiveClassRec *) XtClass( newpw)) ->primitive_class.translations && !XmIsLabel(newpw) ) { _XmProcessLock(); XtOverrideTranslations( (Widget) newpw, (XtTranslations) ((XmPrimitiveClassRec *) XtClass( newpw)) ->primitive_class.translations) ; _XmProcessUnlock(); } if( curpw->primitive.navigation_type != newpw->primitive.navigation_type ) { if( !XmRepTypeValidValue( XmRID_NAVIGATION_TYPE, newpw->primitive.navigation_type, (Widget) newpw) ) { newpw->primitive.navigation_type = curpw->primitive.navigation_type ; } } returnFlag = _XmNavigSetValues( current, request, new_w, args, num_args); /* Validate changed data. */ if( !XmRepTypeValidValue( XmRID_UNIT_TYPE, newpw->primitive.unit_type, (Widget) newpw) ) { newpw->primitive.unit_type = curpw->primitive.unit_type; } /* Convert the necessary fields from unit values to pixel values */ _XmPrimitiveImportArgs( (Widget) newpw, args, num_args); /* Check for resize conditions */ if (curpw->primitive.shadow_thickness != newpw->primitive.shadow_thickness || curpw->primitive.highlight_thickness != newpw->primitive.highlight_thickness) returnFlag = True; if (curpw->primitive.highlight_color != newpw->primitive.highlight_color || curpw->primitive.highlight_pixmap != newpw->primitive.highlight_pixmap) { XtReleaseGC ((Widget) newpw, newpw->primitive.highlight_GC); newpw->primitive.highlight_GC = _XmGetPixmapBasedGC (new_w, newpw->primitive.highlight_color, newpw->core.background_pixel, newpw->primitive.highlight_pixmap); returnFlag = True; } if (curpw->primitive.top_shadow_color != newpw->primitive.top_shadow_color || curpw->primitive.top_shadow_pixmap != newpw->primitive.top_shadow_pixmap) { XtReleaseGC ((Widget) newpw, newpw->primitive.top_shadow_GC); newpw->primitive.top_shadow_GC = _XmGetPixmapBasedGC (new_w, newpw->primitive.top_shadow_color, newpw->core.background_pixel, newpw->primitive.top_shadow_pixmap); returnFlag = True; } if (curpw->primitive.bottom_shadow_color != newpw->primitive.bottom_shadow_color || curpw->primitive.bottom_shadow_pixmap != newpw->primitive.bottom_shadow_pixmap) { XtReleaseGC( (Widget) newpw, newpw->primitive.bottom_shadow_GC); newpw->primitive.bottom_shadow_GC = _XmGetPixmapBasedGC (new_w, newpw->primitive.bottom_shadow_color, newpw->core.background_pixel, newpw->primitive.bottom_shadow_pixmap); returnFlag = True; } if( newpw->primitive.highlight_drawn && ( !XtIsSensitive( (Widget) newpw) || ( (curpw->primitive.highlight_on_enter) && !(newpw->primitive.highlight_on_enter) && (_XmGetFocusPolicy( (Widget) newpw) == XmPOINTER))) ) { if( ((XmPrimitiveWidgetClass) XtClass( newpw)) ->primitive_class.border_unhighlight ) { (*(((XmPrimitiveWidgetClass) XtClass( newpw)) ->primitive_class.border_unhighlight))( (Widget) newpw) ; } } /* Return a flag which may indicate that a redraw needs to occur. */ return (returnFlag); } /************************************************************************ * * HighlightBorder * ************************************************************************/ static void HighlightBorder( Widget w ) { XmPrimitiveWidget pw = (XmPrimitiveWidget) w ; pw->primitive.highlighted = True ; pw->primitive.highlight_drawn = True ; if(XtWidth( pw) == 0 || XtHeight( pw) == 0 || pw->primitive.highlight_thickness == 0) return ; XmeDrawHighlight( XtDisplay( pw), XtWindow( pw), pw->primitive.highlight_GC, 0, 0, XtWidth( pw), XtHeight( pw), pw->primitive.highlight_thickness) ; } /************************************************************************ * * UnhighlightBorder * ************************************************************************/ static void UnhighlightBorder( Widget w ) { XmPrimitiveWidget pw = (XmPrimitiveWidget) w ; XmSpecifyUnhighlightTrait UnhighlightT; GC manager_background_GC; pw->primitive.highlighted = False ; pw->primitive.highlight_drawn = False ; if ( XtWidth( w) == 0 || XtHeight( w) == 0 || pw->primitive.highlight_thickness == 0) { return ; } if(XmIsManager( pw->core.parent)) { /* If unhighlight trait in parent use specified GC */ if (((UnhighlightT=(XmSpecifyUnhighlightTrait)XmeTraitGet((XtPointer) XtClass(pw->core.parent), XmQTspecifyUnhighlight)) != NULL) && (UnhighlightT->getUnhighlightGC != NULL)) { manager_background_GC = UnhighlightT->getUnhighlightGC( pw->core.parent, w); } /* otherwise, use parent's background GC */ else { manager_background_GC = ((XmManagerWidget)(pw->core.parent)) ->manager.background_GC; } XmeDrawHighlight( XtDisplay( pw), XtWindow( pw), manager_background_GC, 0, 0, XtWidth( w), XtHeight( w), pw->primitive.highlight_thickness) ; } else XmeClearBorder( XtDisplay (pw), XtWindow (pw), 0, 0, XtWidth( w), XtHeight( w) , pw->primitive.highlight_thickness) ; } /************************************************************************ * * WidgetNavigable * ************************************************************************/ static XmNavigability WidgetNavigable( Widget wid) { if( XtIsSensitive(wid) && ((XmPrimitiveWidget) wid)->primitive.traversal_on ) { XmNavigationType nav_type = ((XmPrimitiveWidget) wid) ->primitive.navigation_type ; if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmTAB_NAVIGABLE ; } return XmCONTROL_NAVIGABLE ; } return XmNOT_NAVIGABLE ; } /************************************************************************ * * FocusChange * ************************************************************************/ static void FocusChange( Widget wid, XmFocusChange change) { /* Enter/Leave is called only in pointer mode, * Focus in/out only called in explicit mode. */ switch( change ) { case XmENTER: if(!(((XmPrimitiveWidget) wid)->primitive.highlight_on_enter)) { break ; } /* Drop through. */ case XmFOCUS_IN: if(change == XmFOCUS_IN ) /* Because of drop-though. */ { ((XmPrimitiveWidget) wid)->primitive.have_traversal = TRUE ; } if( ((XmPrimitiveWidgetClass) XtClass( wid)) ->primitive_class.border_highlight ) { (*(((XmPrimitiveWidgetClass) XtClass( wid)) ->primitive_class.border_highlight))( wid) ; } break ; case XmLEAVE: if(!(((XmPrimitiveWidget) wid)->primitive.highlight_on_enter)) { break ; } /* Drop through. */ case XmFOCUS_OUT: if(change == XmFOCUS_OUT ) /* Because of drop-though. */{ ((XmPrimitiveWidget) wid)->primitive.have_traversal = FALSE ; } if( ((XmPrimitiveWidgetClass) XtClass( wid)) ->primitive_class.border_unhighlight ) { (*(((XmPrimitiveWidgetClass) XtClass( wid)) ->primitive_class.border_unhighlight))( wid) ; } break ; } return ; } /****************************************/ /******------ trait methods -------******/ /****************************************/ static XmDirection GetDirection(Widget w) { return XmPrim_layout_direction(((XmPrimitiveWidget)(w))); } /*ARGSUSED*/ static Boolean Redraw ( Widget kid, Widget cur_parent, /* unused */ Widget new_parent, /* unused */ Mask visual_flag) { XmPrimitiveWidget pw = (XmPrimitiveWidget) kid ; /* primitive only cares about background info */ /* Menu buttons "redefine" unhighlight on a per instance basis, so they'll get this trait method anyway and do nothing in their unhighlight method on a per instance basis */ /* Separators, Lists, have a null unhighlight, so they'll be caught here, they could redefine the trait, kindof uninstall it... */ if (visual_flag & (VisualBackgroundPixel|VisualBackgroundPixmap)) { /* do the unhighlight if necessary, using class method */ /* parent manager background gc already set up */ if (!pw->primitive.highlighted) { XmPrimitiveClassRec* kid_class = (XmPrimitiveClassRec*) XtClass(kid); if (! XtIsRealized(kid)) return True; if (kid_class->primitive_class.border_unhighlight) kid_class-> primitive_class.border_unhighlight(kid); } } return False ; } static void GetColors(Widget w, XmAccessColorData color_data) { XmPrimitiveWidget pw = (XmPrimitiveWidget) w ; color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor; color_data->background = pw->core.background_pixel; color_data->foreground = pw->primitive.foreground; color_data->highlight_color = pw->primitive.highlight_color; color_data->top_shadow_color = pw->primitive.top_shadow_color; color_data->bottom_shadow_color = pw->primitive.bottom_shadow_color; } static unsigned char GetUnitType(Widget w) { return ((XmPrimitiveWidget) w)->primitive.unit_type ; } /**************************************************************** **************************************************************** ** ** External functions, both _Xm and Xm. ** First come the action procs and then the other external entry points. ** **************************************************************** ****************************************************************/ /************************************************************************ * * The traversal event processing routines. * The following set of routines are the entry points invoked from * each primitive widget when one of the traversal event conditions * occur. These routines are externed in XmP.h. * ************************************************************************/ /*ARGSUSED*/ void _XmTraverseLeft( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { _XmMgrTraversal(w, XmTRAVERSE_LEFT); } /*ARGSUSED*/ void _XmTraverseRight( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { _XmMgrTraversal (w, XmTRAVERSE_RIGHT); } /*ARGSUSED*/ void _XmTraverseUp( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { _XmMgrTraversal (w, XmTRAVERSE_UP); } /*ARGSUSED*/ void _XmTraverseDown( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { _XmMgrTraversal (w, XmTRAVERSE_DOWN); } /*ARGSUSED*/ void _XmTraverseNext( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { _XmMgrTraversal (w, XmTRAVERSE_NEXT); } /*ARGSUSED*/ void _XmTraversePrev( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { _XmMgrTraversal (w, XmTRAVERSE_PREV); } /*ARGSUSED*/ void _XmTraverseHome( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { _XmMgrTraversal (w, XmTRAVERSE_HOME); } /*ARGSUSED*/ void _XmTraverseNextTabGroup( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean button_tab = xm_dpy->display.enable_button_tab; if (button_tab) _XmMgrTraversal(w, XmTRAVERSE_GLOBALLY_FORWARD); else _XmMgrTraversal(w, XmTRAVERSE_NEXT_TAB_GROUP); } /*ARGSUSED*/ void _XmTraversePrevTabGroup( Widget w, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean button_tab = xm_dpy->display.enable_button_tab; if (button_tab) _XmMgrTraversal(w, XmTRAVERSE_GLOBALLY_BACKWARD); else _XmMgrTraversal(w, XmTRAVERSE_PREV_TAB_GROUP); } /*ARGSUSED*/ void _XmPrimitiveHelp( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { if (!_XmIsEventUnique(event)) return; _XmSocorro( wid, event, NULL, NULL); _XmRecordEvent(event); } void _XmPrimitiveParentActivate( Widget pw, XEvent *event, String *params, Cardinal *num_params ) { XmParentInputActionRec pp_data ; pp_data.process_type = XmINPUT_ACTION ; pp_data.action = XmPARENT_ACTIVATE ; pp_data.event = event ; pp_data.params = params ; pp_data.num_params = num_params ; _XmParentProcess( XtParent( pw), (XmParentProcessData) &pp_data) ; } void _XmPrimitiveParentCancel( Widget pw, XEvent *event, String *params, Cardinal *num_params ) { XmParentInputActionRec pp_data ; pp_data.process_type = XmINPUT_ACTION ; pp_data.action = XmPARENT_CANCEL ; pp_data.event = event ; pp_data.params = params ; pp_data.num_params = num_params ; _XmParentProcess( XtParent( pw), (XmParentProcessData) &pp_data) ; } /********************************************************************** * * _XmButtonTakeFocus * *********************************************************************/ /*ARGSUSED*/ void _XmButtonTakeFocus( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmProcessTraversal(wid, XmTRAVERSE_CURRENT); } static void GetToolTipString(Widget wid, int resource, /* unused */ XtArgVal * value) { XmString string = XmGetToolTipString (wid); *value = (XtArgVal) string; } XmImportOperator SetToolTipString(Widget wid, int resource, /* unused */ XtArgVal * value) { XmSetToolTipString (wid, (XmString)*value); return XmSYNTHETIC_NONE; } motif-2.3.8/lib/Xm/PngI.h0000644000175000017500000000033512672140200011716 00000000000000#ifndef _XmPngI_h #define _XmPngI_h #include #include #include int _XmPngGetImage(Screen * screen, FILE * infile, Pixel background, XImage ** ximage); #endif motif-2.3.8/lib/Xm/GetRes.c0000644000175000017500000000363112672140200012247 00000000000000/* $XConsortium: GetRes.c /main/5 1995/07/15 20:51:12 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" /******** Static Function Declarations ********/ static Cardinal GetSecResData(WidgetClass w_class, XmSecondaryResourceData **secResDataRtn); /******** End Static Function Declarations ********/ Cardinal XmGetSecondaryResourceData( WidgetClass w_class, XmSecondaryResourceData **secondaryDataRtn ) { int num = GetSecResData(w_class, secondaryDataRtn); return num; } /* * GetSecResData() * - Called from : XmGetSecondaryResourceData (). */ static Cardinal GetSecResData( WidgetClass w_class, XmSecondaryResourceData **secResDataRtn ) { XmBaseClassExt *bcePtr; /* bcePtr is really **XmBaseClassExtRec */ Cardinal count = 0; bcePtr = _XmGetBaseClassExtPtr( w_class, XmQmotif); if ((bcePtr) && (*bcePtr) && ((*bcePtr)->getSecResData)) count = ( (*bcePtr)->getSecResData)( w_class, secResDataRtn); return count; } motif-2.3.8/lib/Xm/DragDrop.h0000644000175000017500000000212313145162623012571 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragDrop_h #define _XmDragDrop_h #include #include #include #include #include #include #endif /* _XmDragDrop_h */ motif-2.3.8/lib/Xm/Paned.c0000644000175000017500000024330413146716501012122 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include "XmI.h" #include #include #include #include typedef enum {UpLeftPane = 'U', /* Adjust panes above or to the left.*/ LowRightPane = 'L',/* Adjust panes below or the the right. */ AnyPane = 'A' } Direction; #define NO_DELTA -99 #define NO_INDEX -100 #define BLOCK 10 #define LARGE_INC ("LargeIncr") #define XmNisAPane "isAPane" /************************************************************ * GLOBAL DECLARATIONS ************************************************************/ /***************************************************************************** * * Full instance record declaration * ****************************************************************************/ /* * These characters all get compiled into each application as/is, so * the default translations table is not very readable, but is nice and small. */ static char defSashTranslations[] = "osfHelp: Help()\n\ !cosfUp: SashAction(K,10,Up)\n\ NoneosfUp: SashAction(K,1,Up)\n\ !cosfDown: SashAction(K,10,Down)\n\ NoneosfDown: SashAction(K,1,Down)\n\ !cosfLeft: SashAction(K,10,Left)\n\ NoneosfLeft: SashAction(K,1,Left)\n\ !cosfRight: SashAction(K,10,Right)\n\ NoneosfRight: SashAction(K,1,Right)\n\ s~m~aTab: PrevTabGroup()\n\ ~m~aTab: NextTabGroup()\n\ ~c ~s ~m ~a : SashAction(S)\n\ ~c ~s ~m ~a : SashAction(M)\n\ ~c ~s ~m ~a : SashAction(C)\n\ : SashFocusIn()\n\ : SashFocusOut()\n\ : PrimitiveUnmap()\n\ : enter()\n\ : leave()"; /* Internal (yet useful) Motif routine. */ extern void _XmBackgroundColorDefault(); /************************************************************ * Private functions. ************************************************************/ static void ClassInitialize(); static XmImportOperator ToPanedOppositePixels(Widget, int, XtArgVal *); static XmImportOperator ToPanedChildPixels(Widget, int, XtArgVal *); static Dimension PaneSize(Widget, Boolean); static Dimension GetRequestInfo(XtWidgetGeometry *, Boolean); static Pane ChoosePaneToResize(XmPanedWidget, int, Direction, Boolean); static int GetEventLocation(XmPanedWidget, XEvent *); static Boolean PopPaneStack(XmPanedWidget), IsPane(Widget); static Boolean SatisfiesRule3(Pane, Boolean); static Boolean SatisfiesRule2(Pane), SatisfiesRule1(Pane, Boolean, Direction); static Boolean RefigureLocations(XmPanedWidget, int, Direction); static XtGeometryResult AdjustPanedSize(XmPanedWidget, Dimension, Boolean, Boolean, Dimension *, Dimension *); static void ResetSize(XmPanedWidget, Boolean); static void GetPrefSizes(XmPanedWidget, Dimension *, Dimension *); static void FromPanedChildPixels(Widget, int, XtArgVal *); static void FromPanedOppositePixels(Widget, int, XtArgVal *); static void LoopAndRefigureChildren(XmPanedWidget, int, int, Dimension *); static void CommitNewLocations(XmPanedWidget, Widget); static void RefigureLocationsAndCommit(Widget), CreateSeparator(Widget); static void _DrawRect(XmPanedWidget, GC, int, int, unsigned int, unsigned int); static void _DrawTrackLines(XmPanedWidget, Boolean), ResetSash(Widget); static void StartSashAdjustment(XmPanedWidget, Widget); static void MoveSashAdjustment(XmPanedWidget, Widget, int); static void CommitSashAdjustment(XmPanedWidget, Widget), ReleaseGCs(Widget); static void ProcessKeyEvent(XtPointer, XtIntervalId *); static void HandleSash(Widget, XtPointer, XtPointer); static void ManageAndUnmanageSashs(XmPanedWidget), CreateSash(Widget); static void SetChildrenPrefSizes(XmPanedWidget, Dimension, Boolean, Boolean); static void PushPaneStack(XmPanedWidget, Pane), ClearPaneStack(XmPanedWidget); static void GetPaneStack(XmPanedWidget, Boolean, Pane *, int *); /************************************************************ * Semi-Public functions ************************************************************/ static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static Boolean PaneSetValues(Widget, Widget, Widget, ArgList, Cardinal *); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static void Destroy(Widget); static void Initialize(Widget, Widget, ArgList, Cardinal*); static void InsertChild(register Widget); static void Realize(Widget, Mask *, XSetWindowAttributes *); static void ConstraintDestroy(Widget), ReManageChildren(XmPanedWidget); static void ChangeManaged(Widget), Resize(Widget); /* Resource definitions for Subclasses of Primitive */ static Position def_pos = -10; /* negative numbers cannot be set with immed.*/ static XtResource resources[] = { { XmNspacing, XmCSpacing, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.internal_bw), XmRImmediate, (XtPointer) 10 }, { XmNmarginWidth, XmCMargin, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.margin_width), XmRImmediate, (XtPointer) 3 }, { XmNmarginHeight, XmCMargin, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.margin_height), XmRImmediate, (XtPointer) 3 }, { XmNrefigureMode, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedRec, paned.refiguremode), XmRImmediate, (XtPointer) TRUE }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf(XmPanedRec, paned.orientation), XmRImmediate, (XtPointer) XmVERTICAL }, { XmNseparatorOn, XmCSeparatorOn, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedRec, paned.separator_on), XmRImmediate, (XtPointer) TRUE }, /* Cursors - these are used in both horiz and vertical mode. */ { XmNcursor, XmCCursor, XmRCursor, sizeof(Cursor), XtOffsetOf(XmPanedRec, paned.cursor), XmRImmediate, None }, /* Sash control resources */ { XmNsashIndent, XmCSashIndent, XmRHorizontalPosition, sizeof(Position), XtOffsetOf(XmPanedRec, paned.sash_indent), XmRHorizontalPosition, (XtPointer) &def_pos }, { XmNsashTranslations, XmCTranslations, XmRTranslationTable, sizeof(XtTranslations), XtOffsetOf(XmPanedRec, paned.sash_translations), XmRString, (XtPointer)defSashTranslations }, { XmNsashWidth, XmCSashWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.sash_width), XmRImmediate, (XtPointer) 10 }, { XmNsashHeight, XmCSashHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.sash_height), XmRImmediate, (XtPointer) 10 }, { XmNsashShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.sash_shadow_thickness), XmRImmediate, (XtPointer) 2 }, { XmNallowUnusedSpace, XmCAllowUnusedSpace, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedRec, paned.allow_unused_space), XmRImmediate, (XtPointer) TRUE } }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource get_resources[] = { { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.margin_width), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.margin_height), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNspacing, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.internal_bw), _XmFromPanedPixels, (XmImportProc) _XmToPanedPixels }, { XmNsashIndent, sizeof(Position), XtOffsetOf(XmPanedRec, paned.sash_indent), FromPanedOppositePixels, (XmImportProc) ToPanedOppositePixels }, { XmNsashWidth, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.sash_width), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNsashHeight, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.sash_height), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNsashShadowThickness, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.sash_shadow_thickness), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels } }; static XtResource subresources[] = { { XmNallowResize, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedConstraintsRec, paned.allow_resize), XmRImmediate, (XtPointer) FALSE }, { XmNpaneMinimum, XmCPaneMinimum, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmPanedConstraintsRec, paned.min), XmRImmediate, (XtPointer) 1 }, { XmNpaneMaximum, XmCPaneMaximum, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmPanedConstraintsRec, paned.max), XmRImmediate, (XtPointer) 1000 }, #ifdef POSITION_IMPLEMENTED { XmNposition, XmCPosition, XmRInt, sizeof(int), XtOffsetOf(XmPanedConstraintsRec, paned.position), XmRImmediate, (XtPointer) 0 }, #endif { XmNpreferredPaneSize, XmCPreferredPaneSize, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmPanedConstraintsRec, paned.preferred_size), XmRImmediate, (XtPointer) XmPanedAskChild }, /* * Overrides user's grip placement and go back to preferred size when * paned window is resized or a management change happens. */ { XmNresizeToPreferred, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedConstraintsRec, paned.resize_to_pref), XmRImmediate, (XtPointer) FALSE }, { XmNskipAdjust, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedConstraintsRec, paned.skip_adjust), XmRImmediate, (XtPointer) FALSE }, { XmNshowSash, XmCShowSash, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedConstraintsRec, paned.show_sash), XmRImmediate, (XtPointer) TRUE }, /* * This is an internal constraint resources set on sashes and separators * at start up to False, it should be True for all real panes. */ { XmNisAPane, XmNisAPane, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedConstraintsRec, paned.is_a_pane), XmRImmediate, (XtPointer) TRUE } }; /* Definition for constraint resources that need special */ /* processing in get values */ static XmSyntheticResource get_constraint_resources[] = { { XmNpaneMinimum, sizeof(Dimension), XtOffsetOf(XmPanedConstraintsRec, paned.min), FromPanedChildPixels, (XmImportProc) ToPanedChildPixels }, { XmNpaneMaximum, sizeof(Dimension), XtOffsetOf(XmPanedConstraintsRec, paned.max), FromPanedChildPixels, (XmImportProc) ToPanedChildPixels }, { XmNpreferredPaneSize, sizeof(Dimension), XtOffsetOf(XmPanedConstraintsRec, paned.preferred_size), FromPanedChildPixels, (XmImportProc) ToPanedChildPixels } }; #define SuperClass ((ConstraintWidgetClass)&xmManagerClassRec) XmPanedClassRec xmPanedClassRec = { { /* core class fields */ /* superclass */ (WidgetClass) SuperClass, /* class name */ "XmPaned", /* size */ sizeof(XmPanedRec), /* class_initialize */ ClassInitialize, /* class_part init */ NULL, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResource*)resources, /* resource_count */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave*/ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ NULL, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator*/ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite class fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ InsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL }, { /* constraint class fields */ /* subresources */ (XtResource*)subresources, /* subresource_count */ XtNumber(subresources), /* constraint_size */ sizeof(XmPanedConstraintsRec), /* initialize */ NULL, /* destroy */ ConstraintDestroy, /* set_values */ PaneSetValues, /* extension */ NULL }, { /* manager_class fields */ XtInheritTranslations, /* translations */ get_resources, /* get resources */ XtNumber(get_resources), /* num get_resources */ get_constraint_resources, /* get_cont_resources */ XtNumber(get_constraint_resources), /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* paned_window_class fields */ NULL, /* extension */ } }; WidgetClass xmPanedWidgetClass = (WidgetClass) &xmPanedClassRec; /*********************************************************** * * Private Functions. * ************************************************************/ /* * Function Name: ClassInitialize * Description: Initialized XmPaned widget class * Arguments: none * Returns: nothing */ static void ClassInitialize() { /* do nothing */ } /* Function Name: AdjustPanedSize * Description: Adjusts the size of the pane. * Arguments: pw - the paned widget to adjust. * off_size - the new off_size to use. * always_compute_on_size - a self explanatory Boolean. * query_only - perform a query_only? * result_ret - result of query ** RETURNED ** * on_size_ret - the new on_size ** RETURNED ** * off_size_ret - the new off_size ** RETURNED ** * Returns: the amount of change in size. */ static XtGeometryResult AdjustPanedSize(XmPanedWidget pw, Dimension off_size, Boolean always_compute_on_size, Boolean query_only, Dimension *on_size_ret, Dimension *off_size_ret) { Dimension old_size = PaneSize( (Widget) pw, IsVert(pw)); Dimension newsize = 0; XtWidgetGeometry request, reply; XtGeometryResult result; if ((PaneSize((Widget) pw, IsVert(pw)) <= 1) || always_compute_on_size) { GetPrefSizes(pw, &newsize, NULL); if (newsize < 1) newsize = 1; } else { if (IsVert(pw)) newsize = pw->core.height; else newsize = pw->core.width; } if ( IsVert(pw) ) { request.width = off_size + 2 * XmPaned_margin_width(pw); request.height = newsize; } else { request.width = newsize; request.height = off_size + 2 * XmPaned_margin_height(pw); } request.request_mode = CWWidth | CWHeight; if (query_only) request.request_mode |= XtCWQueryOnly; result = XtMakeGeometryRequest( (Widget) pw, &request, &reply ); if (result == XtGeometryAlmost) { if (query_only) request = reply; else result = XtMakeGeometryRequest((Widget) pw, &reply, &request); } reply = request; /* simplifies things later... */ if ( result == XtGeometryNo ) { if (on_size_ret != NULL) *on_size_ret = old_size; if (off_size_ret != NULL) *off_size_ret = PaneSize((Widget) pw, !IsVert(pw)); } else { /* result == XtGeometryYes */ if (on_size_ret != NULL) *on_size_ret = GetRequestInfo( &reply, IsVert(pw) ); if (off_size_ret != NULL) *off_size_ret = GetRequestInfo( &reply, !IsVert(pw) ); } if ( IsVert(pw) ) { if (on_size_ret != NULL) *on_size_ret -= 2 * XmPaned_margin_height(pw); if (off_size_ret != NULL) *off_size_ret -= 2 * XmPaned_margin_width(pw); } else { if (on_size_ret != NULL) *on_size_ret -= 2 * XmPaned_margin_width(pw); if (off_size_ret != NULL) *off_size_ret -= 2 * XmPaned_margin_height(pw); } return(result); } /************************************************************ * * Resolution Independance stuff for dealing in the face * of orientation changes. * ************************************************************/ /* Function Name: FromPanedPixels * Description: Converts from pixels to current unit type * does either horiz or vert depending on orientation. * Arguments: widget - the paned widget. * offset, value - passed to correct function based * on orientation. * Returns: none */ void _XmFromPanedPixels(Widget widget, int offset, XtArgVal *value) { XmPanedWidget pw = (XmPanedWidget) widget; if (IsVert(pw)) XmeFromVerticalPixels(widget, offset, value); else XmeFromHorizontalPixels(widget, offset, value); } /* Function Name: FromPanedChildPixels * Description: Converts from pixels to current unit type * does either horiz or vert depending on * of the parent of this widget orientation. * Arguments: widget - the paned widget. * offset, value - passed to correct function based * on orientation. * Returns: none */ static void FromPanedChildPixels(Widget widget, int offset, XtArgVal *value) { XmPanedWidget pw = (XmPanedWidget) XtParent(widget); if (IsVert(pw)) XmeFromVerticalPixels(widget, offset, value); else XmeFromHorizontalPixels(widget, offset, value); } /* Function Name: ToPanedPixels * Description: Converts to pixels from current unit type * does either horiz or vert depending on orientation. * Arguments: widget - the paned widget. * offset, value - passed to correct function based * on orientation. * Returns: none */ XmImportOperator _XmToPanedPixels(Widget widget, int offset, XtArgVal *value) { XmPanedWidget pw = (XmPanedWidget) widget; if (IsVert(pw)) return(XmeToVerticalPixels(widget, offset, value)); else return(XmeToHorizontalPixels(widget, offset, value)); } /* Function Name: ToPanedChildPixels * Description: Converts to pixels from current unit type * does either horiz or vert depending on parent's * orientation. * Arguments: widget - the paned widget. * offset, value - passed to correct function based * on orientation. * Returns: none */ static XmImportOperator ToPanedChildPixels(Widget widget, int offset, XtArgVal *value) { XmPanedWidget pw = (XmPanedWidget) XtParent(widget); if (IsVert(pw)) return(XmeToVerticalPixels(widget, offset, value)); else return(XmeToHorizontalPixels(widget, offset, value)); } /* Function Name: FromPanedOppositePixels * Description: Converts from pixels to current unit type * does either horiz or vert depending on orientation. * Arguments: widget - the paned widget. * offset, value - passed to correct function based * on orientation. * Returns: none */ static void FromPanedOppositePixels(Widget widget, int offset, XtArgVal *value) { XmPanedWidget pw = (XmPanedWidget) widget; if (IsVert(pw)) XmeFromHorizontalPixels(widget, offset, value); else XmeFromVerticalPixels(widget, offset, value); } /* Function Name: ToPanedOppositePixels * Description: Converts to pixels from current unit type * does either horiz or vert depending on orientation. * Arguments: widget - the paned widget. * offset, value - passed to correct function based * on orientation. * Returns: none */ static XmImportOperator ToPanedOppositePixels(Widget widget, int offset, XtArgVal *value) { XmPanedWidget pw = (XmPanedWidget) widget; if (IsVert(pw)) return(XmeToHorizontalPixels(widget, offset, value)); else return(XmeToVerticalPixels(widget, offset, value)); } /* Function Name: PaneSize * Description: returns the width or height of the pane depending * upon the orientation we are using. * Arguments: w - and widget. * vertical - TRUE if this is vertically oriented pane. * Returns: the size requested * * vertical - return height * !vertical - return width */ static Dimension PaneSize(Widget w, Boolean vertical) { if (vertical) return (w->core.height); return (w->core.width); } /* Function Name: GetRequestInfo * Description: returns request information. * Arguments: geo_struct - a geometry struct to get information out of. * vert - TRUE if this is a vertical paned widget. * Returns: the request information. */ static Dimension GetRequestInfo(XtWidgetGeometry *geo_struct, Boolean vert) { if (vert) return ((Dimension) geo_struct->height); return ((Dimension) geo_struct->width); } /* Function Name: ChoosePaneToResize. * Description: This function chooses a pane to resize. * They are chosen using the following rules: * * 1) size < max && size > min * if pane is growing or has a sash. * (keeps non sash panes from shrinking). * 3) skip adjust == FALSE * 4) widget not its prefered height && * this change will bring it closer && * The user has not resized this pane. * * If no widgets are found that fits all the rules then * rule #3 is broken. * If there are still no widgets found than * rule #2 is broken. * Rule #1 is never broken. * If no widgets are found then NULL is returned. * * Arguments: pw - the paned widget. * paneindex - the index of the current pane. * dir - direction to search first. * shrink - TRUE if we need to shrink a pane, FALSE otherwise. * Returns: pane to resize or NULL. */ static Pane ChoosePaneToResize(XmPanedWidget pw, int paneindex, Direction dir, Boolean shrink) { Widget *childP; int rules = 3; Direction _dir = dir; int _index = paneindex; int curIndex; if ( (paneindex == NO_INDEX) || (dir == AnyPane) ) { /* Use defaults. */ _dir = LowRightPane; /* Go up. - really. */ _index = XmPaned_num_panes(pw) - 1; /* Start the last pane, and work backwards. */ } childP = NthPane(pw, _index); while(TRUE) { register Pane pane = PaneInfo(*childP); if ((rules < 3 || SatisfiesRule3(pane, shrink)) && (rules < 2 || SatisfiesRule2(pane)) && (SatisfiesRule1(pane, shrink, dir)) && ((paneindex != PaneIndex(*childP)) || (dir == AnyPane)) ) { return(pane); } /* * This is counter-intuitive, but if we are resizing the pane * above the sash we want to choose a pane below the sash to lose, * and visa-versa. */ if (shrink || (dir == AnyPane)) { if (_dir == LowRightPane) --childP; else ++childP; } else { if (_dir == LowRightPane) ++childP; else --childP; } /* * If we have come to and edge then reduce the rule set, and try again. * If we are reduced the rules to none, then return NULL. */ curIndex = childP - NthPane(pw, 0); if ((curIndex < 0) || (curIndex >= XmPaned_num_panes(pw))) { if (--rules < 1) /* less strict rules. */ return(NULL); childP = NthPane(pw, _index); } } } /* Function Name: IsPane * Description: Returns true if this is a pane. * Arguments: w - a child of the paned widget. * Returns: none. */ static Boolean IsPane(Widget w) { Pane pane = PaneInfo(w); return ((pane != NULL) && pane->is_a_pane); } /* Function Name: StatisfiesRule1 * Description: check for to see if this pane satisfies rule 1. * Arguments: pane - the pane to check. * shrink -TRUE if we want to shrink this pane, FALSE otherwise * rEturns: TRUE if the rule is satisfied. */ static Boolean SatisfiesRule1(Pane pane, Boolean shrink, Direction dir) { /* * If this pane is at its preferred size and is asked to shrink * while having no sash then do not allow it. * * NOTE: If Dir == AnyPane then this is not due to a grip resize * and this rule does not take effect. */ if ((dir != AnyPane) && shrink && (pane->sash == NULL) && (pane->size == pane->wp_size)) { return(False); } return((shrink && (pane->size != pane->min)) || (!shrink && (pane->size != pane->max)) ); } /* Function Name: StatisfiesRule2 * Description: check for to see if this pane satisfies rule 2. * Arguments: pane - the pane to check. * Returns: TRUE if the rule is satisfied. */ static Boolean SatisfiesRule2(Pane pane) { return(!pane->skip_adjust); } /* Function Name: StatisfiesRule3 * Description: check for to see if this pane satisfies rule 3. * Arguments: pane - the pane to check. * shrink -TRUE if we want to shrink this pane, FALSE otherwise * Returns: TRUE if the rule is satisfied. */ static Boolean SatisfiesRule3(Pane pane, Boolean shrink) { return ((pane->size != pane->wp_size) && ((shrink && ((int)pane->wp_size <= pane->size)) || (!shrink && ((int)pane->wp_size >= pane->size))) ); } /* Function Name: LoopAndRefigureChildren. * Description: if we are resizing either the UpleftPane or LowRight Pane * loop through all the children to see if any will allow us * to resize them. * Arguments: pw - the paned widget. * paneindex - the number of the pane border we are moving. * dir - the pane to move (either UpLeftPane or LowRightPane). * sizeused - current amount of space used. * THIS VALUE IS USED AND RETURNED. * Returns: none. */ static void LoopAndRefigureChildren(XmPanedWidget pw, int paneindex, int dir, Dimension *sizeused) { int pane_size = (int) PaneSize( (Widget) pw, IsVert(pw)); Boolean shrink = ((int)(*sizeused) > (int)pane_size); while (*sizeused != pane_size) { /* While all panes do not fit properly. */ /* * Choose a pane to resize. * First look on the Pane Stack, and then go hunting for another one. * If we fail to find a pane to resize then give up. */ Pane pane; int start_size; Dimension old; Boolean rule3_ok = FALSE, from_stack = TRUE; GetPaneStack(pw, shrink, &pane, &start_size); if (pane == NULL) { pane = ChoosePaneToResize(pw, paneindex, (Direction)dir, shrink); if (pane == NULL) return; /* no one to resize, give up. */ rule3_ok = SatisfiesRule3(pane, shrink); from_stack = FALSE; PushPaneStack(pw, pane); } /* * Try to resize this pane so that all panes will fit, take min and max * into account. */ old = pane->size; pane->size += pane_size - *sizeused; if (from_stack) { if (shrink) { ASSIGN_MAX(pane->size, start_size); } /* don't remove these braces. */ else ASSIGN_MIN(pane->size, start_size); if (pane->size == start_size) (void) PopPaneStack(pw); } else if (rule3_ok) { if (shrink) { ASSIGN_MAX(pane->size, (int) pane->wp_size); } /* don't remove these braces. */ else ASSIGN_MIN(pane->size, (int) pane->wp_size); } ASSIGN_MAX(pane->size, (int) pane->min); ASSIGN_MIN(pane->size, (int) pane->max); *sizeused += (pane->size - old); } } /* Function Name: GetPrefSizes * Description: Gets the preferred On Size. * Arguments: w - the paned widget. * RETURNED on_size, off_size; * Returns: none. */ static void GetPrefSizes(XmPanedWidget pw, Dimension *on_size, Dimension *off_size) { Widget *childP; register Dimension sash_size, sizeused; Boolean vert = IsVert(pw); if (on_size != NULL) { sizeused = 0; /* * Get an initial estimate of the size we will use. */ if (vert) sash_size = XmPaned_sash_height(pw); else sash_size = XmPaned_sash_width(pw); for ( childP = XmPaned_managed_children(pw); childP < (XmPaned_managed_children(pw) + XmPaned_num_panes(pw)); childP++) { register Pane pane = PaneInfo(*childP); ASSIGN_MAX(pane->size, (int) pane->min); ASSIGN_MIN(pane->size, (int) pane->max); sizeused += (int) pane->size + 2 * (*childP)->core.border_width; if (!IsLastPane(pw, childP)) { if (HasSash(*childP)) sizeused += MAX(XmPaned_internal_bw(pw), sash_size); else sizeused += XmPaned_internal_bw(pw); } } /* * Get rid of extra spacing from previous 'for' loop and add in * margin height at the top and bottom of the paned window */ if( vert) sizeused += 2*XmPaned_margin_height(pw); else sizeused += 2*XmPaned_margin_width(pw); *on_size = sizeused; } if (off_size != NULL) { Widget *childP; sizeused = 1; for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { Pane pane = PaneInfo(*childP); if (XtIsManaged(*childP) && (pane->wp_off_size > sizeused)) sizeused = pane->wp_off_size; } *off_size = sizeused; } } /* Function Name: RefigureLocations * Description: refigures all locations of children. * Arguments: pw - the paned widget. * paneindex - child to start refiguring at. * dir - direction to move from child. * Returns: True if anything actually moved. * * There are special arguments to paneindex and dir, they are: * paneindex - NO_INDEX. * dir - AnyPane. * * If either of these is true then all panes may be resized and * the choosing of panes procedes in reverse order starting with the * last child. */ static Boolean RefigureLocations(XmPanedWidget pw, int paneindex, Direction dir) { register Widget *childP; int pane_size = (int) PaneSize( (Widget) pw, IsVert(pw) ); Dimension sizeused; Position loc = 0; int sash_size, moved = True; if (XmPaned_num_panes(pw) == 0) return False; GetPrefSizes(pw, &sizeused, NULL); if (sizeused == pane_size) moved = False; else LoopAndRefigureChildren(pw, paneindex, dir, &sizeused); /* * If we still are not the right size, then tell the pane that * wanted to resize that it can't. */ if ( (paneindex != NO_INDEX) && (dir != AnyPane) ) { Pane pane = PaneInfo(*NthPane(pw, paneindex)); Dimension old = pane->size; if(pane_size != sizeused) { moved = False; } pane->size += pane_size - sizeused; ASSIGN_MAX(pane->size, (int) pane->min); ASSIGN_MIN(pane->size, (int) pane->max); sizeused += pane->size - old; } if (!XmPaned_allow_unused_space(pw)) { if (pane_size > sizeused) { PaneInfo(*NthPane(pw, paneindex-1))->size += (pane_size - sizeused); } } /* * It is possible that the panes will not fit inside the vpaned widget, but * we have tried out best. * * Assign each pane a location. */ if(IsVert(pw)) { loc = XmPaned_margin_height(pw); } else { loc = XmPaned_margin_width(pw); } /* * This is where we actually tell the widget where to draw the track * lines. */ if (IsVert(pw)) sash_size = XmPaned_sash_height(pw); else sash_size = XmPaned_sash_width(pw); for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { if (LayoutIsRtoLM(pw) && !(IsVert(pw))) { loc += PaneInfo(*childP)->size + 2 * (*childP)->core.border_width; PaneInfo(*childP)->delta = pw->core.width - loc; } else { PaneInfo(*childP)->delta = loc; loc += PaneInfo(*childP)->size + 2 * (*childP)->core.border_width; } if (HasSash(*childP)) loc += MAX(XmPaned_internal_bw(pw), sash_size); else loc += XmPaned_internal_bw(pw); } return moved; } /* Function Name: CommitNewLocations * Description: Commits all of the previously figured locations. * Arguments: pw - the paned widget. * no_resize_child - child not to resize * Returns: none. * * no_resize_child is only used by the geometry manager to implement an * XtGeometryYes policy as Motif1.2 dictates. */ static void CommitNewLocations(XmPanedWidget pw, Widget no_resize_child) { register Widget *childP; XWindowChanges changes; XWindowChanges sep; int offset, sash_size; if (!XmPaned_refiguremode(pw)) return; if (IsVert(pw)) { offset = XmPaned_margin_width(pw); sash_size = XmPaned_sash_height(pw); } else { offset = XmPaned_margin_height(pw); sash_size = XmPaned_sash_width(pw); } for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { register Pane pane = PaneInfo(*childP); register Widget sash = pane->sash; /* may be NULL. */ register Widget separator = pane->separator; /* may be NULL. */ int internal_space; if (HasSash(*childP)) internal_space = MAX(XmPaned_internal_bw(pw), sash_size); else internal_space = XmPaned_internal_bw(pw); if (IsVert(pw)) { if (*childP == no_resize_child) { (*childP)->core.x = offset; (*childP)->core.y = pane->delta; (*childP)->core.width = (pw->core.width - 2 * (offset + (*childP)->core.border_width)); (*childP)->core.height = pane->size; } else { _XmConfigureWidget(*childP, (Position) offset, pane->delta, pw->core.width - 2*(offset + (*childP)->core.border_width), (Dimension) pane->size, (Dimension) (*childP)->core.border_width); } if (sash != NULL) { /* Move and Display the Sash */ /* * Motif style does - indent from right edge, pos from left */ if(XmPaned_sash_indent(pw) < 0) { changes.x = (pw->core.width + XmPaned_sash_indent(pw) - sash->core.width - sash->core.border_width * 2); } else { changes.x = XmPaned_sash_indent(pw); } changes.y = ((*childP)->core.y + (*childP)->core.height + 2 * (*childP)->core.border_width + internal_space/2 - sash->core.height/2 - sash->core.border_width); } if (separator != NULL) { sep.width = pw->core.width; sep.height = XmPaned_sash_shadow_thickness(pw); sep.x = 0; sep.y = ((*childP)->core.y + (*childP)->core.height - sep.height / 2 - separator->core.border_width + internal_space / 2 + 2 * (*childP)->core.border_width); } } else { if (*childP == no_resize_child) { (*childP)->core.x = pane->delta; (*childP)->core.y = offset; (*childP)->core.width = pane->size; (*childP)->core.height = (pw->core.height - 2 * (offset + (*childP)->core.border_width)); } else { _XmConfigureWidget(*childP, pane->delta, (Position) offset, (Dimension) pane->size, pw->core.height - 2*(offset + (*childP)->core.border_width), (Dimension) (*childP)->core.border_width); } if (sash != NULL) { /* Move and Display the Sash */ if (LayoutIsRtoLM(pw)) changes.x = ((*childP)->core.x - internal_space / 2 - sash->core.width/2 - sash->core.border_width); else changes.x = ((*childP)->core.x + (*childP)->core.width + 2 * (*childP)->core.border_width + internal_space / 2 - sash->core.width/2 - sash->core.border_width); /* Motif style does - indent from right edge, pos from left */ if(XmPaned_sash_indent(pw) < 0) { changes.y = pw->core.height + XmPaned_sash_indent(pw) - sash->core.height - sash->core.border_width*2; } else { changes.y = XmPaned_sash_indent(pw); } } if (separator != NULL) { sep.width = XmPaned_sash_shadow_thickness(pw); sep.height = pw->core.height; sep.y = 0; if (LayoutIsRtoLM(pw)) sep.x = ((*childP)->core.x - sep.width / 2 - separator->core.border_width - internal_space / 2); else sep.x = ((*childP)->core.x + (*childP)->core.width - sep.width / 2 - separator->core.border_width + internal_space / 2 + 2 * (*childP)->core.border_width); } } /* * This should match XtMoveWidget, except that we're also insuring the * sash is Raised in the same request. */ if(separator != NULL) { _XmConfigureWidget(separator, sep.x, sep.y, sep.width, sep.height, separator->core.border_width); } if (sash != NULL) { sash->core.x = changes.x; sash->core.y = changes.y; changes.stack_mode = Above; /* assures sash is always above sep. */ if (XtIsRealized(sash)) { XmDropSiteStartUpdate((Widget) pw); XConfigureWindow(XtDisplay(sash), XtWindow(sash), CWX | CWY | CWStackMode, &changes ); XmDropSiteEndUpdate((Widget) pw); } } } ClearPaneStack(pw); } /* Function Name: RefigureLocationsAndCommit * Description: Refigures all locations in a paned widget and * commits them immediately. * Arguments: pw - the paned widget. * Returns: none * * This function does nothing if any of the following are true. * o refiguremode is false. * o The widget is unrealized. * o There are no panes is the paned widget. * * NOTE: This is the resize Procedure for the Paned widget. */ static void RefigureLocationsAndCommit(Widget w) { XmPanedWidget pw = (XmPanedWidget) w; if (XmPaned_refiguremode(pw) && XtIsRealized( (Widget) pw) && XmPaned_num_panes(pw) > 0 ) { RefigureLocations(pw, NO_INDEX, AnyPane); CommitNewLocations(pw, NULL); } } /* Function Name: _DrawRect * Description: Draws a rectangle in the proper orientation. * Arguments: pw - the paned widget. * gc - gc to used for the draw. * on_olc, off_loc - location of upper left corner of rect. * on_size, off_size - size of rectangle. * Returns: none */ static void _DrawRect(XmPanedWidget pw, GC gc, int on_loc, int off_loc, unsigned int on_size, unsigned int off_size) { if (IsVert(pw)) XFillRectangle(XtDisplay(pw), XtWindow(pw), gc, off_loc, on_loc, off_size, on_size); else XFillRectangle(XtDisplay(pw), XtWindow(pw), gc, on_loc, off_loc, on_size, off_size); } /* Function Name: _DrawTrackLines * Description: Draws the lines that animate the pane borders when the * sashs are moved. * Arguments: pw - the Paned widget. * erase - if True then just erase track lines, else * draw them in. * Returns: none. */ static void _DrawTrackLines(XmPanedWidget pw, Boolean erase) { Widget *childP; Pane pane; int on_loc, off_loc; unsigned int on_size, off_size; int sash_size, internal_space; /* Always full width of the widget accross the other dimension */ off_loc = 0; off_size = PaneSize((Widget) pw, !IsVert(pw)); if(IsVert(pw)) sash_size = XmPaned_sash_height(pw); else sash_size = XmPaned_sash_width(pw); for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { pane = PaneInfo(*childP); /* * First child never has a track line. */ if ((((IsVert(pw) || !(LayoutIsRtoLM(pw))) && (XmPaned_managed_children(pw) != childP)) || (!(IsVert(pw)) && LayoutIsRtoLM(pw) && !(IsLastPane(pw, childP)))) && (erase || (pane->olddelta != pane->delta))) { if(IsVert(pw)) { on_size = pane->separator ? pane->separator->core.height : (Dimension) 2; } else { on_size = pane->separator ? pane->separator->core.width: (Dimension) 2; } if (HasSash(*(childP - 1))) internal_space = MAX(XmPaned_internal_bw(pw), sash_size); else internal_space = XmPaned_internal_bw(pw); if (!erase && (pane->olddelta != NO_DELTA)) { /* This formula might have to correct for border width of * the sep in the future, but the Paned widget creates them * with a zero width border just to make sure, so it is never * an issue. I did not feel the need to allow users to * specify borders around the separators because it simply * would look stupid. -- aja */ on_loc = (pane->olddelta - ((int) on_size + internal_space) / 2); _DrawRect(pw, XmPaned_flipgc(pw), on_loc, off_loc, on_size, off_size); } on_loc = (pane->delta - ((int) on_size + internal_space) / 2); _DrawRect(pw, XmPaned_flipgc(pw), on_loc, off_loc, on_size, off_size); } pane->olddelta = pane->delta; } } /* * This allows good reuse of code, as well as descriptive function names. */ #define DrawTrackLines(pw) _DrawTrackLines((pw), FALSE); #define EraseTrackLines(pw) _DrawTrackLines((pw), TRUE); /* Function Name: GetEventLocation * Description: Converts and event to an x and y location. * Arguments: pw - the paned widget. * event - a pointer to an event. * Returns: if this is a vertical pane then (y) else (x). */ static int GetEventLocation(XmPanedWidget pw, XEvent *event) { switch (event->xany.type) { case ButtonPress: case ButtonRelease: return((IsVert(pw)) ? event->xbutton.y_root : event->xbutton.x_root); case KeyPress: case KeyRelease: return((IsVert(pw)) ? event->xkey.y_root : event->xkey.x_root); case MotionNotify: return((IsVert(pw)) ? event->xmotion.y_root : event->xmotion.x_root); default: return XmPaned_start_loc(pw); } } /* Function Name: StartSashAdjustment * Description: Starts the sash adjustment procedure. * Arguments: pw - the paned widget. * sash - the sash widget selected. * Returns: none. */ /* ARGSUSED */ static void StartSashAdjustment(XmPanedWidget pw, Widget sash) { Widget *childP; XmPaned_repane_status(pw) = BEGAN_ADJUST; for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { PaneInfo(*childP)->olddelta = NO_DELTA; } } /* Function Name: MoveSashAdjustment * Description: This routine moves all panes around when a sash is moved. * Arguments: pw - the paned widget. * sash - the sash that we are moving. * loc - location of pointer in proper direction. * Returns: none. */ static void MoveSashAdjustment(XmPanedWidget pw, Widget sash, int loc) { int index, diff = loc - XmPaned_start_loc(pw); Boolean vert = IsVert(pw); Widget w; w = *NthPane(pw, PaneIndex(sash)); /* CR03589 CR03163 should check the sash loc is over the maximum */ if ((PaneSize(w, vert) + diff) > PaneInfo(w)->max) diff = PaneInfo(w)->max - PaneSize(w, vert); if (LayoutIsRtoLM(pw) && !(IsVert(pw))) PaneInfo(w)->size = PaneSize(w, vert) - diff; else PaneInfo(w)->size = PaneSize(w, vert) + diff; w = *NthPane(pw, PaneIndex(sash) + 1); if (LayoutIsRtoLM(pw) && !(IsVert(pw))) PaneInfo(w)->size = PaneSize(w, vert) + diff; else PaneInfo(w)->size = PaneSize(w, vert) - diff; index = PaneIndex(sash); if (diff < 0) index += 1; (void) RefigureLocations(pw, index, (diff < 0) ? LowRightPane : UpLeftPane); } /* Function Name: CommitSashAdjustment * Description: Commits the sash adjustment. * Arguments: pw - the paned widget. * Returns: none */ static void CommitSashAdjustment(XmPanedWidget pw, Widget sash) { int i; /* * We only do it if we were in a sash adjustment, this prevents odd * effects if the user binds a button up to commit, with no * corresponding start on button down. */ if(XmPaned_repane_status(pw) != NO_ADJUST) { EraseTrackLines(pw); CommitNewLocations(pw, NULL); XmPaned_repane_status(pw) = NO_ADJUST; } /* * Set the new user preferred size of the pane above and below the sash. */ for (i = 0; i < 2; i++) { Pane pane = PaneInfo(*NthPane(pw, PaneIndex(sash) + i)); pane->wp_size = pane->size; } } /*************************************<->************************************* * * ProcessKeyEvent * * Description: * ----------- * This function processes a batch of key pressed events * so that a sash movement action via the keyboard doesn't * get too far behind the key event actions. * *************************************<->***********************************/ /* ARGSUSED */ static void ProcessKeyEvent(XtPointer client_data, XtIntervalId *id) { Widget sash = (Widget) client_data; register XmPanedWidget pw = (XmPanedWidget) XtParent(sash); Widget *childP; int i; /* * NOTE: w is a sash, to get position we have * to get index of pane associated with this sash. */ childP = XmPaned_managed_children(pw) + PaneIndex(sash); for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { PaneInfo(*childP)->olddelta = NO_DELTA; } XmPaned_start_loc(pw) = 0; MoveSashAdjustment(pw, sash, XmPaned_increment_count(pw)); CommitNewLocations(pw, NULL); /* * Set the new user preferred size of the pane above and below the sash. */ for (i = 0; i < 2; i++) { Pane pane = PaneInfo(*NthPane(pw, PaneIndex(sash) + i)); pane->wp_size = pane->size; } XmPaned_increment_count(pw) = 0; } /* Function Name: HandleSash * Description: Handles the sash manipulations. * Arguments: sash - the sash widget that has been moved. * junk - ** NOT USED ** * call_data - data passed to us from the sash widget. * Returns: none. */ /* ARGSUSED */ static void HandleSash(Widget sash, XtPointer junk, XtPointer callData) { SashCallData call_data = (SashCallData)callData; XmPanedWidget pw = (XmPanedWidget) XtParent(sash); int loc; char action_type; short increment; static String params[] = { "HandleSash" }; Cardinal num = 1; XEvent *event = (XEvent *) call_data->event; action_type = *call_data->params[0]; if (call_data->num_params == 0 || (action_type == 'C' && call_data->num_params != 1) || (action_type == 'K' && call_data->num_params != 3) || (action_type == 'M' && call_data->num_params != 1) || (action_type == 'S' && call_data->num_params != 1)) { _XmWarningMsg((Widget) pw, XmNbadActionParameters, XmNbadActionParametersMsg, params, num); return; } if (isascii(action_type) && islower(action_type)) action_type = toupper(action_type); loc = GetEventLocation(pw, event); if (event->xany.type == KeyPress) { char restptr[BUFSIZ]; /* points to the rest of the string. */ /* Get movement size */ if ((increment = atoi(call_data->params[1])) == 0) { if (streq(call_data->params[1], LARGE_INC)) increment = 10; else increment = 1; } switch(call_data->params[2][0]) { default: return; case 'U': /* Up */ XmCopyISOLatin1Lowered(restptr, call_data->params[2] + 2); if (!IsVert(pw)) increment = 0; else increment = -increment; break; case 'L': /* Left */ XmCopyISOLatin1Lowered(restptr, call_data->params[2] + 4); if (IsVert(pw)) increment = 0; else increment = -increment; break; case 'D': /* Down */ XmCopyISOLatin1Lowered(restptr, call_data->params[2] + 4); if (!IsVert(pw)) increment = 0; break; case 'R': /* Right */ XmCopyISOLatin1Lowered(restptr, call_data->params[2] + 5); if (IsVert(pw)) increment = 0; break; } /* * Check to see if there is a string after the up/left/down/right * and if there is then change the keyboard traversal mode. */ if (XmPaned_increment_count(pw) == 0) { XmPaned_increment_count(pw) = increment; XtAppAddTimeOut(XtWidgetToApplicationContext((Widget) pw), XtGetMultiClickTime(XtDisplay((Widget) pw)), ProcessKeyEvent, (XtPointer) sash); } else XmPaned_increment_count(pw) += increment; return; } if ((event->xany.type == ButtonPress) || (event->xany.type == ButtonRelease)) { if (event->xbutton.button != 1) return; } switch (action_type) { case 'S': /* Start adjustment */ XmPaned_resize_children_to_pref(pw) = FALSE; StartSashAdjustment(pw, sash); DrawTrackLines(pw); XmPaned_start_loc(pw) = loc; break; case 'M': MoveSashAdjustment(pw, sash, loc); DrawTrackLines(pw); break; case 'C': CommitSashAdjustment(pw, sash); break; default: { _XmWarningMsg((Widget) pw, XmNbadActionParameters, XmNbadActionParametersMsg, params, num); return; } } } /* Function Name: ManageAndUnmanageSashs * Description: This function manages and unmanages the sashs so that * the managed state of each sash matches that of its pane. * Arguments: pw - the paned widget. * Returns: none. */ static void ManageAndUnmanageSashs(XmPanedWidget pw) { WidgetList managed_sashs, unmanaged_sashs; Widget *managedP, *unmanagedP; WidgetList managed_seps, unmanaged_seps; Widget *managedS, *unmanagedS; Widget *childP; Cardinal alloc_size; Boolean last_child_has_sash = False; alloc_size = (Cardinal) sizeof(Widget) * pw->composite.num_children / 2; managedP = managed_sashs = (WidgetList) XtMalloc(alloc_size); unmanagedP = unmanaged_sashs = (WidgetList) XtMalloc(alloc_size); managedS = managed_seps = (WidgetList) XtMalloc(alloc_size); unmanagedS = unmanaged_seps = (WidgetList) XtMalloc(alloc_size); ForAllChildren(pw, childP) { if (!IsPane(*childP)) continue; if (HasSash(*childP)) { last_child_has_sash = True; if (XtIsManaged(*childP)) *managedP++ = PaneInfo(*childP)->sash; else *unmanagedP++ = PaneInfo(*childP)->sash; } else last_child_has_sash = False; if (HasSep(*childP)) { if (XtIsManaged(*childP)) *managedS++ = PaneInfo(*childP)->separator; else *unmanagedS++ = PaneInfo(*childP)->separator; } } if (managedP != managed_sashs) { if (last_child_has_sash) { *unmanagedP = *--managedP; /* Last sash is never managed */ unmanagedP++; } XtManageChildren( managed_sashs, (Cardinal)(managedP - managed_sashs) ); } if (unmanagedP != unmanaged_sashs) XtUnmanageChildren(unmanaged_sashs, (Cardinal)(unmanagedP - unmanaged_sashs) ); XtFree((char *)managed_sashs); XtFree((char *)unmanaged_sashs); if (managedS != managed_seps) { if (last_child_has_sash) { *unmanagedS = *--managedS; /* Last sash is never managed */ unmanagedS++; } XtManageChildren( managed_seps, (Cardinal)(managedS - managed_seps) ); } if (unmanagedS != unmanaged_seps) XtUnmanageChildren( unmanaged_seps, (Cardinal)(unmanagedS - unmanaged_seps) ); XtFree((char *)managed_seps); XtFree((char *)unmanaged_seps); } /* Function Name: CreateSeparator * Description: Creates a separator widget. * Arguments: child - the child that wants a sep. to be created for it. * Returns: none. */ static void CreateSeparator(Widget child) { XmPanedWidget pw = (XmPanedWidget) XtParent(child); Arg args[10]; Cardinal num_args = 0; if (PaneInfo(child)->separator != NULL) return; XtSetArg(args[num_args], XmNborderWidth, 0); num_args++; XtSetArg(args[num_args], XmNhighlightThickness, 0); num_args++; XtSetArg(args[num_args], XmNseparatorType, XmSHADOW_ETCHED_IN); num_args++; XtSetArg(args[num_args], XmNmargin, 0); num_args++; XtSetArg(args[num_args], XmNnavigationType, XmNONE); num_args++; XtSetArg(args[num_args], XmNisAPane, False); num_args++; if (IsVert(pw)) { XtSetArg(args[num_args], XmNorientation, XmHORIZONTAL); num_args++; XtSetArg(args[num_args], XmNwidth, pw->core.width); num_args++; } else { XtSetArg(args[num_args], XmNorientation, XmVERTICAL); num_args++; XtSetArg(args[num_args], XmNheight, pw->core.height); num_args++; } PaneInfo(child)->separator = XtCreateWidget("separator", xmSeparatorWidgetClass, (Widget)pw, args, num_args); } /* Function Name: CreateSash * Description: Creates a sash widget. * Arguments: child - the child that wants a sash to be created for it. * Returns: none. */ static void CreateSash(Widget child) { XmPanedWidget pw = (XmPanedWidget) XtParent(child); Arg arglist[20]; Cardinal num_args = 0; XtSetArg(arglist[num_args], XmNtranslations, XmPaned_sash_translations(pw)); num_args++; XtSetArg(arglist[num_args], XmNwidth, XmPaned_sash_width(pw)); num_args++; XtSetArg(arglist[num_args], XmNheight, XmPaned_sash_height(pw)); num_args++; XtSetArg(arglist[num_args], XmNshadowThickness, XmPaned_sash_shadow_thickness(pw)); num_args++; XtSetArg(arglist[num_args], XmNtraversalOn, True); num_args++; XtSetArg(arglist[num_args], XmNnavigationType, XmTAB_GROUP); num_args++; XtSetArg(arglist[num_args], XmNunitType, XmPIXELS); num_args++; XtSetArg(arglist[num_args], XmNisAPane, False); num_args++; PaneInfo(child)->sash = XtCreateWidget("sash", xmSashWidgetClass, (Widget)pw, arglist, num_args); XtAddCallback(PaneInfo(child)->sash, XmNcallback, HandleSash, (XtPointer) child); } /* Function Name: GetGCs * Description: Gets new GC's. * Arguments: w - the paned widget. * Returns: none. */ static void GetGCs(Widget w) { XmPanedWidget pw = (XmPanedWidget) w; XtGCMask valuemask; XGCValues values; /* * Draw Track lines (animate pane borders) in foreground color ^ bg color. */ values.function = GXinvert; values.plane_mask = pw->manager.foreground ^ pw->core.background_pixel; values.subwindow_mode = IncludeInferiors; valuemask = GCPlaneMask | GCFunction | GCSubwindowMode; XmPaned_flipgc(pw) = XtGetGC(w, valuemask, &values); } /* Function Name: ReleaseGCs * Description: Releases all GC's associated with this widget. * Arguments: w - the widget. * Returns: none. */ static void ReleaseGCs(Widget w) { XmPanedWidget pw = (XmPanedWidget)w; XtReleaseGC( w, XmPaned_flipgc(pw) ); } /* Function Name: SetChildrenPrefSizes. * Description: Sets the preferred sizes of the children. * Arguments: pw - the paned widget. * off_size - query children based on this off size. * use_off_size - If False then ignore the off size. * only set the pref size if this is a new child. * Returns: none. */ static void SetChildrenPrefSizes(XmPanedWidget pw, Dimension off_size, Boolean use_off_size, Boolean only_if_new) { Widget * childP; Boolean vert = IsVert(pw); XtWidgetGeometry request, reply; for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { Pane pane = PaneInfo(*childP); if (only_if_new && pane->prefs_inited) break; pane->prefs_inited = True; if (XmPaned_resize_children_to_pref(pw) || (pane->size == 0) || (pane->resize_to_pref)) { if (pane->preferred_size != XmPanedAskChild) { pane->wp_size = pane->preferred_size; if (!use_off_size) { (void) XtQueryGeometry(*childP, NULL, &reply); pane->wp_off_size = GetRequestInfo(&reply, !vert); } } else { request.request_mode = 0; if (use_off_size) { if( vert ) { request.request_mode |= CWWidth; request.width = off_size; } else { request.request_mode |= CWHeight; request.height = off_size; } } (void) XtQueryGeometry(*childP, &request, &reply); pane->wp_size = GetRequestInfo(&reply, vert); if (!use_off_size) pane->wp_off_size = GetRequestInfo(&reply, !vert); } pane->size = pane->wp_size; } else if (!use_off_size) { (void) XtQueryGeometry(*childP, NULL, &reply); pane->wp_off_size = GetRequestInfo(&reply, !vert); } } } /* Function Name: ResetSash * Description: Turn on or off the sash depending on the state of * the paned widget. * Arguments: set - the widget this sash is associated with. * Returns: none. */ static void ResetSash(Widget set) { Pane pane = PaneInfo(set); XmPanedWidget pw = (XmPanedWidget) XtParent(set); if (HasSash(set) && (!pane->show_sash || ForceSashOff(pane))) { XtDestroyWidget(pane->sash); pane->sash = NULL; } else if (!HasSash(set) && pane->show_sash && !ForceSashOff(pane)) { CreateSash(set); if (XtIsRealized((Widget) pw)) { /* * If paned is unrealized this will happen automatically * at realize time. */ if (XtIsManaged(set)) { /* * Since the paned is realized this will * manage and realize the sash. */ XtManageChild(PaneInfo(set)->sash); } } } RefigureLocationsAndCommit((Widget) pw); } /************************************************************ * * Stack Manipulation routines (Private). * ************************************************************/ /* Function Name: PushPaneStack * Description: Pushes a value onto the pane stack. * Arguments: pw - the paned widget. * pane - the pane that we are pushing. * Returns: none. */ static void PushPaneStack(XmPanedWidget pw, Pane pane) { PaneStack * stack = (PaneStack *) XtMalloc(sizeof(PaneStack)); stack->next = XmPaned_stack(pw); stack->pane = pane; stack->start_size = pane->size; XmPaned_stack(pw) = stack; } /* Function Name: GetPaneStack * Description: Gets the top value from the pane stack. * Arguments: pw - the paned widget. * shrink - TRUE if we want to shrink this pane, * FALSE otherwise. * ** RETURNED ** pane - the pane that we are popping. * ** RETURNED ** start_size - the size that this pane started at. * Returns: none. */ static void GetPaneStack(XmPanedWidget pw, Boolean shrink, Pane *pane, int *start_size) { if (XmPaned_stack(pw) == NULL) *pane = NULL; else { *pane = XmPaned_stack(pw)->pane; *start_size = XmPaned_stack(pw)->start_size; if (shrink != ((*pane)->size > *start_size)) *pane = NULL; } } /* Function Name: PopPaneStack * Description: Pops the top item off the pane stack. * Arguments: pw - the paned widget. * Returns: TRUE if this is not the last element on the stack. */ static Boolean PopPaneStack(XmPanedWidget pw) { PaneStack * stack = XmPaned_stack(pw); if (stack == NULL) return(FALSE); XmPaned_stack(pw) = stack->next; XtFree((char*)stack); return(XmPaned_stack(pw) != NULL); } /* Function Name: ClearPaneStack * Description: removes all entries from the pane stack. * Arguments: pw - the paned widget. * Returns: none */ static void ClearPaneStack(XmPanedWidget pw) { while(PopPaneStack(pw)) {} /* SUPPRESS 530 */ } /************************************************************ * * Semi-public routines. * ************************************************************/ /* The Geometry Manager only allows changes after Realize if * allow_resize is True in the constraints record. * * For vertically paned widgets: * * It only allows height changes, but offers the requested height * as a compromise if both width and height changes were requested. * * For horizontal widgets the converse is true. * As all good Geometry Managers should, we will return No if the * request will have no effect; i.e. when the requestor is already * of the desired geometry. */ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) { XmPanedWidget pw = (XmPanedWidget) XtParent(w); XtGeometryMask mask = request->request_mode; Dimension old_size, old_wpsize, old_wp_off_size, old_paned_size; Pane pane = PaneInfo(w); register Boolean vert = IsVert(pw); Dimension on_size, off_size; XtGeometryResult result; Boolean almost = FALSE; /* * If any of the following is true, disallow the geometry change. * * o The paned widget is realized and allow_resize is false for the pane. * o The requested size is the same as the current size. */ if (!pane->is_a_pane) { if (request->request_mode & CWWidth) w->core.width = request->width; if (request->request_mode & CWHeight) w->core.height = request->height; if (request->request_mode & CWX) w->core.x = request->x; if (request->request_mode & CWY) w->core.y = request->y; return(XtGeometryYes); /* allow any change to sashes or seps. */ } if (!(request->request_mode & CWWidth)) request->width = w->core.width; if (!(request->request_mode & CWHeight)) request->height = w->core.height; if ((XtIsRealized((Widget)pw) && !pane->allow_resize) || ((GetRequestInfo(request, vert) == PaneSize(w, vert)) && (GetRequestInfo(request, !vert) == PaneSize(w, !vert)))) { return XtGeometryNo; } old_paned_size = PaneSize((Widget) pw, vert); old_wpsize = pane->wp_size; old_size = pane->size; old_wp_off_size = pane->wp_off_size; if (vert) { if (mask & CWHeight) pane->wp_size = pane->size = GetRequestInfo(request, vert); if (mask & CWWidth) pane->wp_off_size = GetRequestInfo(request, !vert); } else { if (mask & CWWidth) pane->wp_size = pane->size = GetRequestInfo(request, vert); if (mask & CWHeight) pane->wp_off_size = GetRequestInfo(request, !vert); } GetPrefSizes(pw, NULL, &off_size); /* * Ask our parent what would happen if we wanted to asked to be * the a new size that will satisify the request of our child? */ result = AdjustPanedSize(pw, off_size, True, True, &on_size, &off_size); /* * Fool the Refigure Locations proc to thinking that we are * a different on_size; */ if (result != XtGeometryNo) { if (vert) { pw->core.height = on_size + 2 * XmPaned_margin_height(pw); } else { pw->core.width = on_size + 2 * XmPaned_margin_width(pw); } } RefigureLocations(pw, PaneIndex(w), AnyPane); /* * Set up reply struct and reset core on_size. */ if (vert) { pw->core.height = old_paned_size; reply->width = off_size; reply->height = pane->size; } else { pw->core.width = old_paned_size; reply->width = pane->size; reply->height = off_size; } /* * IF either of the following is true. * * o There was a "off_size" request and the new "off_size" is different * from that requested. * o There was no "off_size" request and the new "off_size" is different * * o The "on_size" we will allow is different from that requested. * * THEN: set almost */ if ( !((vert ? CWWidth : CWHeight) & mask)) { if (vert) { request->width = w->core.width; } else { request->height = w->core.height; } } almost = (mask & ~(CWWidth | CWHeight | XtCWQueryOnly)); almost |= GetRequestInfo(request, !vert) != GetRequestInfo(reply, !vert); almost |= GetRequestInfo(request, vert) != GetRequestInfo(reply, vert); if ( (mask & XtCWQueryOnly) || almost ) { pane->wp_size = old_wpsize; pane->wp_off_size = old_wp_off_size; pane->size = old_size; RefigureLocations(pw, PaneIndex(w), AnyPane); reply->request_mode = CWWidth | CWHeight; if (almost) return XtGeometryAlmost; } else { (void) AdjustPanedSize(pw, GetRequestInfo(reply, !vert), True, False, NULL, NULL); CommitNewLocations(pw, w); /* layout already refigured. */ } return XtGeometryYes; } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /* ARGSUSED */ static void Initialize(Widget request, Widget set, ArgList args, Cardinal * num_args) { XmPanedWidget pw = (XmPanedWidget)set; GetGCs( (Widget) pw); XmPaned_recursively_called(pw) = False; XmPaned_stack(pw) = NULL; XmPaned_resize_children_to_pref(pw) = TRUE; XmPaned_num_panes(pw) = 0; XmPaned_increment_count(pw) = 0; XmPaned_repane_status(pw) = NO_ADJUST; XmPaned_num_slots(pw) = 0; XmPaned_managed_children(pw) = NULL; /* * Undo the size change that XmManager did to us!!! */ pw->core.width = request->core.width; pw->core.height = request->core.height; } /* Function Name: Realize * Description: Called to realize this widget. * Arguments: w - Widget to realize. * valueMask, attributes - attributes to use when creating * this widget's window. * Returns: none. * * This overrides the Manager's frobbing with various values. */ static void Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes) { XmPanedWidget pw = (XmPanedWidget) w; Widget * childP; if (w->core.height == 0) w->core.height = 1; if (w->core.width == 0) w->core.width = 1; /* * Set the cursor on the paned window. */ if ((attributes->cursor = XmPaned_cursor(pw)) != None) *valueMask |= CWCursor; XtCreateWindow (w, InputOutput, CopyFromParent, *valueMask, attributes); /* * Before we commit the new locations we need to realize all the panes and * their sashs. */ for ( childP = XmPaned_managed_children(pw) ; childP < XmPaned_managed_children(pw) + XmPaned_num_panes(pw); childP++ ) { XtRealizeWidget( *childP ); if (HasSash (*childP)) { XtRealizeWidget( PaneInfo(*childP)->sash ); } if (HasSep(*childP)) { XtRealizeWidget( PaneInfo(*childP)->separator ); } } RefigureLocationsAndCommit(w); XmPaned_resize_children_to_pref(pw) = FALSE; } /* Realize */ /* Function Name: Destroy * Description: Called when the widget is destroyed, cleans up. * Arguments: w - the widget. * Returns: none. */ static void Destroy(Widget w) { XmPanedWidget pw = (XmPanedWidget)w; ReleaseGCs(w); ClearPaneStack(pw); XtFree((XtPointer) XmPaned_managed_children(pw)); } /* Function Name: InsertChild * Description: called when a new child has been added to the paned window * Arguments: w - the new child. * Returns: none. */ static void InsertChild(register Widget w) { XmPanedWidget pw = (XmPanedWidget) XtParent(w); Pane pane = PaneInfo(w); Arg arglist[10]; int num_args; if (_XmGadgetWarning(w)) return; /* * Insert the child widget in the composite children list with the * superclass insert_child routine. */ { XtWidgetProc insert_child; _XmProcessLock(); insert_child = SuperClass->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(w); } /* These should be in Constraint init... */ pane->sash = NULL; pane->separator = NULL; pane->prefs_inited = False; if (!IsPane(w)) return; if(pane->min == pane->max) /* Motif behavior */ pane->show_sash = False; /* A basic Sanity Check */ if (pane->min > pane->max) { /* * This error will cause a crash later on * lets make this error know to the programmer * right off the bat, this will (should) never * be "discovered" later after the thing has been used several * times. */ fprintf(stderr, "XiError: XmPaned Widget resource conflict\n"); fprintf(stderr, "XmNpaneMax is less than XmNpaneMin.\n"); fprintf(stderr, "XmNpaneMax = %d XmNpaneMin = %d\n\n", pane->max, pane->min); exit(EXIT_FAILURE); } /* Panes will be added in the order they are created, for now... */ if (pane->show_sash) CreateSash(w); if (XmPaned_separator_on(pw)) CreateSeparator(w); pane->size = 0; /* Motif navigation stuff */ num_args = 0; XtSetArg(arglist[num_args], XmNnavigationType, XmTAB_GROUP); num_args++; XtSetValues(w, arglist, num_args); } /* InsertChild */ /* Function Name: ConstraintDestroy * Description: Called to clean up after child with constraints is * destroyed. * Arguments: w - the child that has been destroyed. * Returns: none. */ static void ConstraintDestroy(Widget w) { /* Remove the subwidget info and destroy the sash */ if (IsPane(w)) { if(HasSash(w)) XtDestroyWidget(PaneInfo(w)->sash); if(HasSep(w)) XtDestroyWidget(PaneInfo(w)->separator); } } /* DeleteChild */ /********************************************************************** * * ReManageChildren * This procedure will be called by the ChangeManged procedure * It will reassemble the currently managed children into the * "paned_window.managed_children" list. * ********************************************************************/ static void ReManageChildren(XmPanedWidget pw) { int i; XmPaned_num_panes(pw) = 0; for (i = 0; i < pw->composite.num_children; i++) { if(XtIsManaged(pw->composite.children[i]) && IsPane(pw->composite.children[i]) ) { Pane pane = PaneInfo(pw->composite.children[i]); /* expand our storage area if needed */ if ((XmPaned_num_panes(pw) + 1) > XmPaned_num_slots(pw)) { XmPaned_num_slots(pw) += BLOCK; XmPaned_managed_children(pw) = (WidgetList) XtRealloc ((XtPointer) XmPaned_managed_children(pw), (XmPaned_num_slots(pw) * sizeof(Widget))); } #ifndef POSITION_IMPLEMENTED /* * This is a hack to get around position change not * being implemented yet. */ if (HasSash(pw->composite.children[i])) PaneInfo(pane->sash)->position = XmPaned_num_panes(pw); pane->position = XmPaned_num_panes(pw); #endif XmPaned_managed_children(pw)[XmPaned_num_panes(pw)++] = pw->composite.children[i]; } } } /* Function Name: ChangeManaged * Description: Called when one of the children changes management state. * Arguments: w - the paned widget. * Returns: none. */ static void ChangeManaged(Widget w) { XmPanedWidget pw = (XmPanedWidget)w; if (XmPaned_recursively_called(pw)++) return; ManageAndUnmanageSashs(pw); XmPaned_recursively_called(pw) = False; ReManageChildren(pw); /* * ForAllPanes can now be used. */ ResetSize(pw, PaneSize(w, IsVert(pw)) <= 1); /* for Motif navigation */ XmeNavigChangeManaged((Widget)pw); } /* ChangeManaged */ /* Function Name: ResetSize * Description: Resets the size of the paned widget to its preferred. * Checks are made on all children to attempt to size * then to the preferred. * Arguments: pw - the paned widget. * recalc_off_size - If this is true the do not * use the current off size, recalc for * a new value. * Returns: none. */ static void ResetSize(XmPanedWidget pw, Boolean recalc_off_size) { Boolean test, vert = IsVert(pw); Dimension off_size; /* * Must be called once before GetPrefSizes. */ test = !XtIsRealized((Widget) pw) || recalc_off_size; SetChildrenPrefSizes(pw, 0, False, test); if (recalc_off_size || XtIsRealized((Widget) pw)) { GetPrefSizes(pw, NULL, &off_size); } else { off_size = PaneSize( (Widget) pw, !vert ); if (vert) off_size -= 2 * XmPaned_margin_width(pw); else off_size -= 2 * XmPaned_margin_height(pw); } /* * This gets the real off size our parent will allow, may be * quite different than what we want. */ if (XtIsRealized((Widget) pw)) { (void) AdjustPanedSize(pw, off_size, True, True, NULL, &off_size); } /* * Given the new off size, ask our children what size they would like * to be, and reconfigure ourself to the new size. */ SetChildrenPrefSizes(pw, off_size, True, False); (void) AdjustPanedSize(pw, off_size, XtIsRealized((Widget) pw), False, NULL, NULL); RefigureLocationsAndCommit((Widget) pw); } /* Function Name: Resize * Description: The paned widget's resize proc. * Arguments: w - the paned widget. * Returns: none. */ static void Resize(Widget w) { XmPanedWidget pw = (XmPanedWidget)w; int size; size = PaneSize(w, !IsVert(pw)); if (IsVert(pw)) size -= 2 * XmPaned_margin_width(pw); else size -= 2 * XmPaned_margin_height(pw); SetChildrenPrefSizes((XmPanedWidget) w, size, True, False); if (!XtIsRealized(w)) return; RefigureLocationsAndCommit(w); } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: old - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - The arguments passed to the set * values call. * Returns: none */ /* ARGSUSED */ static Boolean SetValues(Widget old, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmPanedWidget old_pw = (XmPanedWidget) old; XmPanedWidget set_pw = (XmPanedWidget) set; int num_panes = XmPaned_num_panes(set_pw); register Widget *childP; Boolean refigure = False, commit = False; Arg sargs[3]; int num_sargs = 0; /* * Manager is getting in the way, fix it. */ if (request->core.height == 0) set->core.height = request->core.height; if (request->core.width == 0) set->core.width = request->core.width; if (request->core.border_width == 0) set->core.border_width = request->core.border_width; if ((XmPaned_cursor(old_pw) != XmPaned_cursor(set_pw)) && XtIsRealized(set)) XDefineCursor(XtDisplay(set), XtWindow(set), XmPaned_cursor(set_pw)); if ((old_pw->manager.foreground != set_pw->manager.foreground) || (old_pw->core.background_pixel != set_pw->core.background_pixel)) { ReleaseGCs(old); GetGCs(set); } /* If we change sep status we must do for all seps */ if (XmPaned_separator_on(old_pw) != XmPaned_separator_on(set_pw)) { if (XmPaned_separator_on(set_pw)) { WidgetList sep_children; Cardinal num_separators = 0; /* This should be more than enough space */ sep_children = (WidgetList) XtMalloc(num_panes * sizeof(Widget)); for ( childP = XmPaned_managed_children(set_pw) ; childP < XmPaned_managed_children(set_pw) + XmPaned_num_panes(set_pw); childP++ ) { CreateSeparator(*childP); sep_children[num_separators] = PaneInfo(*childP)->separator; num_separators++; } XtManageChildren((WidgetList) sep_children, num_separators); XtFree((char *)sep_children); commit = True; } else { for ( childP = XmPaned_managed_children(set_pw) ; childP < XmPaned_managed_children(set_pw) + XmPaned_num_panes(set_pw); childP++ ) { Pane pane = PaneInfo(*childP); if (pane->separator != NULL) { XtDestroyWidget(pane->separator); pane->separator = NULL; } } } } if (IsVert(old_pw) != IsVert(set_pw)) { Cardinal num_sep_args; Arg sep_args[10]; num_sep_args = 0; if (IsVert(set_pw)) XtSetArg(sep_args[num_sep_args], XmNorientation, XmHORIZONTAL); else XtSetArg(sep_args[num_sep_args], XmNorientation, XmVERTICAL); num_sep_args++; ForAllChildren(set_pw, childP) { Pane pane = PaneInfo(*childP); if (pane->separator != NULL) { XtSetValues(pane->separator, sep_args, num_sep_args); } } XmPaned_resize_children_to_pref(set_pw) = TRUE; ResetSize(set_pw, TRUE); XmPaned_resize_children_to_pref(set_pw) = FALSE; return(TRUE); } /* Build an arg list for global changes to the sashs */ if (XmPaned_sash_width(old_pw) != XmPaned_sash_width(set_pw)) { XtSetArg(sargs[num_sargs], XmNwidth, XmPaned_sash_width(set_pw)); num_sargs++; refigure = True; } if (XmPaned_sash_height(old_pw) != XmPaned_sash_height(set_pw)) { XtSetArg(sargs[num_sargs], XmNheight, XmPaned_sash_height(set_pw)); num_sargs++; refigure = True; } if (XmPaned_sash_shadow_thickness(old_pw) != XmPaned_sash_shadow_thickness(set_pw)) { XtSetArg(sargs[num_sargs], XmNshadowThickness, XmPaned_sash_shadow_thickness(set_pw)); num_sargs++; } if (XmPaned_sash_translations(old_pw) != XmPaned_sash_translations(set_pw)) { XmeWarning(set, XmNstaticTranslationsMsg); XmPaned_sash_translations(set_pw) = XmPaned_sash_translations(old_pw); } if (num_sargs != 0) { for ( childP = XmPaned_managed_children(set_pw) ; childP < XmPaned_managed_children(set_pw) + XmPaned_num_panes(set_pw); childP++ ) if (HasSash(*childP)) XtSetValues(PaneInfo(*childP)->sash, sargs, num_sargs); refigure = True; } if ((XmPaned_internal_bw(old_pw) != XmPaned_internal_bw(set_pw)) || (XmPaned_margin_width(old_pw) != XmPaned_margin_width(set_pw)) || (XmPaned_margin_height(old_pw)!= XmPaned_margin_height(set_pw))) { refigure = True; } if ( (XmPaned_sash_indent(old_pw) != XmPaned_sash_indent(set_pw)) && (XtIsRealized(set)) ) { commit = True; } if (refigure) { Dimension off_size = PaneSize((Widget) old_pw, !IsVert(old_pw)); if (IsVert(old_pw)) off_size -= 2 * XmPaned_margin_width(old_pw); else off_size -= 2 * XmPaned_margin_height(old_pw); (void) AdjustPanedSize(set_pw, off_size, True, False, NULL, NULL); RefigureLocations(set_pw, NO_INDEX, AnyPane); commit = True; } if (commit) CommitNewLocations(set_pw, NULL); return (False); } /* SetValues */ /* Function Name: QueryGeometry * Description: Called when my parent wants to know my preferred size. * Arguments: w - the widget to check. * intended - parent imposed geometry. * preferred - what I would like. * Returns: status. */ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, XtWidgetGeometry *preferred) { XmPanedWidget pw = (XmPanedWidget) w; Dimension on_size, off_size; GetPrefSizes(pw, &on_size, &off_size); if (IsVert(pw)) { preferred->width = off_size + 2 * XmPaned_margin_width(pw); preferred->height = on_size + 2 * XmPaned_margin_height(pw); } else { preferred->width = on_size + 2 * XmPaned_margin_width(pw); preferred->height = off_size + 2 * XmPaned_margin_height(pw); } return(_XmHWQuery(w, request, preferred)); } /* Function Name: PaneSetValues * Description: Called when some constraint data needs to be modified * on-the-fly. * Arguments: old - the current (old) widget values. * request - before superclassed have changed things. * new - what will acutally be the new values. * args, num_args - The arguments passed to * the child's setvalues call. * Returns: none */ /* ARGSUSED */ static Boolean PaneSetValues(Widget old, Widget request, Widget new, ArgList args, Cardinal * num_args) { Pane old_pane = PaneInfo(old); Pane new_pane = PaneInfo(new); Boolean sash_reset = False; /* Check for new min and max. */ if ((old_pane->min != new_pane->min) || (old_pane->max != new_pane->max)) { if (ForceSashOff(old_pane) != ForceSashOff(new_pane)) sash_reset = True; } if (old_pane->show_sash != new_pane->show_sash) sash_reset = True; if (sash_reset) ResetSash(new); return(False); } /************************************************************ * * Public routines. * ************************************************************/ /* Function Name: XmPanedGetPanes * Description: Returns the number of panes in the paned widget. * Arguments: w - the paned widget. * panes - the list of all panes contained in this widget. * num - the number of panes. * Returns: the number of panes in the paned widget. */ int XmPanedGetPanes(Widget w, WidgetList *panes, int *num) { XmPanedWidget pw = (XmPanedWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); *num = XmPaned_num_panes(pw); *panes = XmPaned_managed_children(pw); _XmAppUnlock(app); return(*num); } /* Function Name: XmCreatePaned * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreatePaned(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmPanedWidgetClass, parent, args, num_args)); } motif-2.3.8/lib/Xm/TextInI.h0000644000175000017500000000463712672140200012416 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: TextInI.h /main/5 1995/07/13 18:07:40 drk $ */ #ifndef _XmTextInI_h #define _XmTextInI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern Boolean _XmTextHasDestination( Widget w) ; extern Boolean _XmTextSetDestinationSelection( Widget w, XmTextPosition position, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time set_time) ; extern Boolean _XmTextSetSel2( XmTextWidget tw, XmTextPosition left, XmTextPosition right, Time set_time) ; extern Boolean _XmTextGetSel2( XmTextWidget tw, XmTextPosition *left, XmTextPosition *right) ; extern void _XmTextInputGetSecResData( XmSecondaryResourceData *secResDataRtn) ; extern void _XmTextInputCreate( Widget wid, ArgList args, Cardinal num_args) ; extern void _XmTextHandleSecondaryFinished(Widget w, XEvent *event); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextInI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmCrIFrDat.c0000644000175000017500000000774312672140200013151 00000000000000/* $XConsortium: XpmCrIFrDat.c /main/2 1996/09/20 08:03:34 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrIFrData.c: * * * * XPM library * * Parse an Xpm array and create the image and possibly its mask * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" LFUNC(OpenArray, void, (char **data, xpmData *mdata)); int XpmCreateImageFromData(display, data, image_return, shapeimage_return, attributes) Display *display; char **data; XImage **image_return; XImage **shapeimage_return; XpmAttributes *attributes; { XpmImage image; XpmInfo info; int ErrorStatus; xpmData mdata; xpmInitXpmImage(&image); xpmInitXpmInfo(&info); /* open data */ OpenArray(data, &mdata); /* create an XpmImage from the file */ if (attributes) { xpmInitAttributes(attributes); xpmSetInfoMask(&info, attributes); ErrorStatus = xpmParseDataAndCreate(display, &mdata, image_return, shapeimage_return, &image, &info, attributes); } else ErrorStatus = xpmParseDataAndCreate(display, &mdata, image_return, shapeimage_return, &image, NULL, attributes); if (attributes) { if (ErrorStatus >= 0) /* no fatal error */ xpmSetAttributes(attributes, &image, &info); XpmFreeXpmInfo(&info); } /* free the XpmImage */ XpmFreeXpmImage(&image); return (ErrorStatus); } int XpmCreateXpmImageFromData(data, image, info) char **data; XpmImage *image; XpmInfo *info; { xpmData mdata; int ErrorStatus; /* init returned values */ xpmInitXpmImage(image); xpmInitXpmInfo(info); /* open data */ OpenArray(data, &mdata); /* create the XpmImage from the XpmData */ ErrorStatus = xpmParseData(&mdata, image, info); return (ErrorStatus); } /* * open the given array to be read or written as an xpmData which is returned */ static void OpenArray(data, mdata) char **data; xpmData *mdata; { mdata->type = XPMARRAY; mdata->stream.data = data; mdata->cptr = *data; mdata->line = 0; mdata->CommentLength = 0; mdata->Bcmt = mdata->Ecmt = NULL; mdata->Bos = mdata->Eos = '\0'; mdata->format = 0; /* this can only be Xpm 2 or 3 */ } motif-2.3.8/lib/Xm/SlideCP.h0000644000175000017500000000465712672140200012357 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _SLIDECP_H #define _SLIDECP_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif #ifndef XmUNSPECIFIED_POSITION #define XmUNSPECIFIED_POSITION (-1) #endif typedef struct { XtPointer extension; } XmSlideContextClassPart; typedef struct _XmSlideContextClassRec { ObjectClassPart object_class; XmSlideContextClassPart slide_class; } XmSlideContextClassRec; extern XmSlideContextClassRec xmSlideContextClassRec; typedef struct _XmSlideContextPart { XtIntervalId id; XtCallbackList slideFinishCallback; XtCallbackList slideMotionCallback; Widget slide_widget; unsigned long interval; Dimension dest_width; Dimension dest_height; Position dest_x; Position dest_y; } XmSlideContextPart; typedef struct _XmSlideContextRec { ObjectPart object; XmSlideContextPart slide; } XmSlideContextRec; #define Slide_Id(w) (((XmSlideContextWidget)w)->slide.id) #define Slide_Widget(w) (((XmSlideContextWidget)w)->slide.slide_widget) #define Slide_Interval(w) (((XmSlideContextWidget)w)->slide.interval) #define Slide_DestWidth(w) (((XmSlideContextWidget)w)->slide.dest_width) #define Slide_DestHeight(w) (((XmSlideContextWidget)w)->slide.dest_height) #define Slide_DestX(w) (((XmSlideContextWidget)w)->slide.dest_x) #define Slide_DestY(w) (((XmSlideContextWidget)w)->slide.dest_y) #define Slide_FinishCallback(w) (((XmSlideContextWidget)w)->slide.slideFinishCallback) #define Slide_MotionCallback(w) (((XmSlideContextWidget)w)->slide.slideMotionCallback) #ifdef __cplusplus } #endif #endif motif-2.3.8/lib/Xm/CallbackI.h0000644000175000017500000000440413145162623012700 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCallbackI_h #define _XmCallbackI_h #include "XmI.h" #ifdef __cplusplus extern "C" { #endif #define _XtCBCalling 1 #define _XtCBFreeAfterCalling 2 /* The internal callback list is a little header followed by an array of * XtCallbackRec structs. Declaring the first element of the array with * the header allows the compiler to take care of any alignment required. */ typedef struct internalCallbackRec { unsigned short count; char is_padded; /* contains NULL padding for external form */ char call_state; /* combination of _XtCB{FreeAfter}Calling */ XtCallbackRec callbacks; /* first XtCallback record declared here */ } InternalCallbackRec, *InternalCallbackList; /******** Private Function Declarations ********/ extern void _XmAddCallback(InternalCallbackList *callbacks, XtCallbackProc callback, XtPointer closure); extern void _XmRemoveCallback(InternalCallbackList *callbacks, XtCallbackProc callback, XtPointer closure); extern void _XmCallCallbackList(Widget widget, XtCallbackList callbacks, XtPointer call_data); extern void _XmRemoveAllCallbacks(InternalCallbackList *callbacks); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCallbackI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextI.h0000644000175000017500000001056412672140200012123 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: TextI.h /main/6 1996/05/29 13:45:16 pascale $ */ #ifndef _XmTextI_h #define _XmTextI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern XmTextPosition _XmTextFindScroll(XmTextWidget widget, XmTextPosition start, int delta); extern int _XmTextGetTotalLines(Widget widget); extern XmTextLineTable _XmTextGetLineTable(Widget widget, int *total_lines); extern void _XmTextRealignLineTable(XmTextWidget widget, XmTextLineTable *temp_table, int *temp_table_size, register unsigned int cur_index, register XmTextPosition cur_start, register XmTextPosition cur_end); extern unsigned int _XmTextGetTableIndex(XmTextWidget widget, XmTextPosition pos); extern void _XmTextUpdateLineTable(Widget widget, XmTextPosition start, XmTextPosition end, XmTextBlock block, #if NeedWidePrototypes int update #else Boolean update #endif /* NeedWidePrototypes */ ); extern void _XmTextMarkRedraw(XmTextWidget widget, XmTextPosition left, XmTextPosition right); extern LineNum _XmTextNumLines(XmTextWidget widget); extern void _XmTextLineInfo(XmTextWidget widget, LineNum line, XmTextPosition *startpos, LineTableExtra *extra); extern LineNum _XmTextPosToLine(XmTextWidget widget, XmTextPosition position); extern void _XmTextInvalidate(XmTextWidget widget, XmTextPosition position, XmTextPosition topos, long delta); extern void _XmTextSetTopCharacter(Widget widget, XmTextPosition top_character); extern int _XmTextCountCharacters(char *str, int num_count_bytes); extern void _XmTextSetCursorPosition(Widget widget, XmTextPosition position); extern void _XmTextDisableRedisplay(XmTextWidget widget, #if NeedWidePrototypes int losesbackingstore); #else Boolean losesbackingstore); #endif /* NeedWidePrototypes */ extern void _XmTextEnableRedisplay(XmTextWidget widget); extern void _XmTextSetHighlight(Widget, XmTextPosition, XmTextPosition, XmHighlightMode); extern void _XmTextShowPosition(Widget, XmTextPosition); extern void _XmTextSetEditable(Widget widget, #if NeedWidePrototypes int editable); #else Boolean editable); #endif /* NeedWidePrototypes */ extern void _XmTextResetIC(Widget widget); extern Boolean _XmTextNeedsPendingDeleteDis(XmTextWidget tw, XmTextPosition *left, XmTextPosition *right, int check_add_mode); extern void _XmTextReplace(Widget widget, XmTextPosition frompos, XmTextPosition topos, char *value, #if NeedWidePrototypes int is_wchar); #else Boolean is_wchar); #endif /* NeedWidePrototypes */ extern void _XmTextValidate(XmTextPosition *start, XmTextPosition *end, int maxsize); extern XmTextPosition _XmTextSetPreeditPosition(Widget w, XmTextPosition cursor_position); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Tree.h0000644000175000017500000000437312672140200011766 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmTree_h #define _XmTree_h #if defined(VMS) || defined(__VMS) #include #endif #include #include /************************************************************ * INCLUDE FILES *************************************************************/ /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #if defined(__cplusplus) extern "C" { #endif typedef struct _XmTreeClassRec *XmTreeWidgetClass; typedef struct _XmTreeRec *XmTreeWidget; /* Function Name: XmCreateTree * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateTree( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); extern WidgetClass xmTreeWidgetClass; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL FUNCTION DECLARATIONS *************************************************************/ #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _Tree_h */ motif-2.3.8/lib/Xm/Direction.c0000644000175000017500000001113512672140200012774 00000000000000/* $XConsortium: Direction.c /main/6 1996/03/28 15:14:33 daniel $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include #include #include /********************************************************************* * * _XmDirectionDefault * This procedure provides the dynamic resource default for * the layout direction resource dependent on the parent's value. * *********************************************************************/ /*ARGSUSED*/ void _XmDirectionDefault(Widget widget, int offset, /* unused */ XrmValue *value ) { static XmDirection direction; value->addr = (XPointer) &direction; /* This is an ugly hack, but what to do when user sets stringDirection in resource file. Dependent on that stringDirection comes before layoutDirection in resource list. Part of the reason is that this is the same field. Yuck! */ if (XmIsManager(widget) && (((XmManagerWidget)widget)->manager.string_direction != XmSTRING_DIRECTION_DEFAULT)) direction = XmStringDirectionToDirection(((XmManagerWidget)widget)->manager. string_direction); else direction = _XmGetLayoutDirection(XtParent(widget)); } /*ARGSUSED*/ void _XmFromLayoutDirection( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { if (XmIsManager(wid)) *value = (XtArgVal)XmDirectionToStringDirection((XmDirection)*value); else if (XmIsLabel(wid) || XmIsLabelGadget(wid) || XmIsList(wid)) *value = (XtArgVal)XmDirectionToStringDirection(_XmGetLayoutDirection(wid)); } /*ARGSUSED*/ XmImportOperator _XmToLayoutDirection( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { if (XmIsManager(wid)) { *value = (XtArgVal)XmStringDirectionToDirection((XmStringDirection)*value); return XmSYNTHETIC_LOAD; } else if (XmIsLabel(wid) || XmIsList(wid)) { XmPrim_layout_direction(((XmPrimitiveWidget)wid)) = XmStringDirectionToDirection((XmStringDirection)*value); return XmSYNTHETIC_NONE; } else if (XmIsLabelGadget(wid)) { ((XmGadget)wid)->gadget.layout_direction = XmStringDirectionToDirection((XmStringDirection)*value); return XmSYNTHETIC_NONE; } return XmSYNTHETIC_LOAD; } XmStringDirection XmDirectionToStringDirection(XmDirection dir) { if (XmDirectionMatch(dir, XmLEFT_TO_RIGHT)) return XmSTRING_DIRECTION_L_TO_R; else if (XmDirectionMatch(dir, XmRIGHT_TO_LEFT)) return XmSTRING_DIRECTION_R_TO_L; return XmSTRING_DIRECTION_DEFAULT; } XmDirection XmStringDirectionToDirection(XmStringDirection dir) { switch (dir) { case XmSTRING_DIRECTION_L_TO_R: return XmLEFT_TO_RIGHT; case XmSTRING_DIRECTION_R_TO_L: return XmRIGHT_TO_LEFT; default: return XmDEFAULT_DIRECTION; } } XmDirection _XmGetLayoutDirection( Widget w ) { XmSpecifyLayoutDirectionTrait layoutT = NULL; while (w && !(layoutT = (XmSpecifyLayoutDirectionTrait) XmeTraitGet((XtPointer) XtClass(w), XmQTspecifyLayoutDirection))) w = XtParent(w); if (w && layoutT && layoutT->get_direction) return layoutT->get_direction(w); else return XmLEFT_TO_RIGHT; } /* Handle compatibility with XmStringDirection */ #define Fixdir(d) (((d) <= 1) ? (~((d)+1)) : ((d) | XmDIRECTION_IGNORED)) Boolean XmDirectionMatch(XmDirection d1, XmDirection d2) { d1 = Fixdir(d1); d2 = Fixdir(d2); return (((XmDirection)(d1 & d2) == (XmDirection)d1) || ((XmDirection)(d1 & d2) == (XmDirection)d2)); } Boolean XmDirectionMatchPartial(XmDirection d1, XmDirection d2, XmDirection dmask) { return XmDirectionMatch(d1 & dmask, d2 & dmask); } motif-2.3.8/lib/Xm/Sash.c0000644000175000017500000003244613145162623011773 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Sash.c /main/12 1995/07/13 17:51:55 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include "XmI.h" #include #include #include #include #include "MenuStateI.h" #include "TraversalI.h" #define defTranslations _XmSash_defTranslations #define SASHSIZE 10 /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc) ; static void ClassInitialize( void ) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void HighlightSash( Widget sash) ; static void UnhighlightSash( Widget sash) ; static XmNavigability WidgetNavigable( Widget wid) ; static void SashFocusIn( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void SashFocusOut( Widget w, XEvent *event, char **params, Cardinal *num_params) ; static void SashAction( Widget widget, XEvent *event, String *params, Cardinal *num_params) ; static void Realize( register Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) ; static void Redisplay( Widget w, XEvent *event, Region region) ; static void SashDisplayDestroyCallback ( Widget w, XtPointer client_data, XtPointer call_data ); /******** End Static Function Declarations ********/ static XtResource resources[] = { {XmNborderWidth, XmCBorderWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _XmSashRec, core.border_width), XmRImmediate, (XtPointer) 0}, {XmNcallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmSashRec, sash.sash_action), XmRPointer, NULL}, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf( struct _XmPrimitiveRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmSTICKY_TAB_GROUP}, }; static XtActionsRec actionsList[] = { {"SashAction", SashAction}, {"SashFocusIn", SashFocusIn}, {"SashFocusOut", SashFocusOut}, }; static XmBaseClassExtRec SashBaseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* get_values_prehook */ NULL, /* get_values_posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; externaldef(xmsashclassrec) XmSashClassRec xmSashClassRec = { { /* core class fields */ /* superclass */ (WidgetClass) &xmPrimitiveClassRec, /* class name */ "XmSash", /* size */ sizeof(XmSashRec), /* class initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resourses */ resources, /* resource_count */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enter/lv */ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ NULL, /* expose */ Redisplay, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defTranslations, /* query_geometry */ NULL, NULL, /* display_accelerator */ (XtPointer)&SashBaseClassExtRec, /* extension */ }, { XmInheritWidgetProc, /* Primitive border_highlight */ XmInheritWidgetProc, /* Primitive border_unhighlight */ NULL, /* translations */ NULL, /* arm_and_activate */ NULL, /* get resources */ 0, /* num get_resources */ NULL, /* extension */ }, { (XtPointer) NULL, /* extension */ } }; externaldef(xmsashwidgetclass) WidgetClass xmSashWidgetClass = (WidgetClass) &xmSashClassRec; /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget. * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit(wc, XmSASH_BIT); } /************************************************************************ * * ClassInitialize * Initialize the primitive part of class structure with * routines to do special highlight & unhighlight for Sash. * ************************************************************************/ static void ClassInitialize( void ) { xmSashClassRec.primitive_class.border_highlight = HighlightSash; xmSashClassRec.primitive_class.border_unhighlight = UnhighlightSash; SashBaseClassExtRec.record_type = XmQmotif; } /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmSashWidget request = (XmSashWidget) rw ; XmSashWidget new_w = (XmSashWidget) nw ; if (request->core.width == 0) new_w->core.width += SASHSIZE; if (request->core.height == 0) new_w->core.height += SASHSIZE; new_w->sash.has_focus = False; } static void HighlightSash( Widget sash ) { int x, y; x = y = ((XmSashWidget) sash)->primitive.shadow_thickness; XFillRectangle( XtDisplay( sash), XtWindow( sash), ((XmSashWidget) sash)->primitive.highlight_GC, x,y, sash->core.width-(2*x), sash->core.height-(2*y)); } static void UnhighlightSash( Widget sash ) { int x, y; x = y = ((XmSashWidget) sash)->primitive.shadow_thickness; XClearArea( XtDisplay( sash), XtWindow( sash), x,y, sash->core.width-(2*x), sash->core.height-(2*y), FALSE); } static XmNavigability WidgetNavigable( Widget wid) { if( _XmShellIsExclusive( wid) ) { /* Preserve 1.0 behavior. (Why? Don't ask me!) */ return XmNOT_NAVIGABLE ; } if( XtIsSensitive(wid) && ((XmPrimitiveWidget) wid)->primitive.traversal_on ) { XmNavigationType nav_type = ((XmPrimitiveWidget) wid) ->primitive.navigation_type ; if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmTAB_NAVIGABLE ; } } return XmNOT_NAVIGABLE ; } /* ARGSUSED */ static void SashFocusIn( Widget w, XEvent *event, char **params, Cardinal *num_params ) { register XmSashWidget sash = (XmSashWidget) w; if (event->xany.type != FocusIn || !event->xfocus.send_event) return; if (_XmGetFocusPolicy( (Widget) sash) == XmEXPLICIT) HighlightSash(w); XmeDrawShadows (XtDisplay (w), XtWindow (w), sash->primitive.top_shadow_GC, sash->primitive.bottom_shadow_GC, 0,0,w->core.width, w->core.height, sash->primitive.shadow_thickness, XmSHADOW_OUT); sash->sash.has_focus = True; } /* ARGSUSED */ static void SashFocusOut( Widget w, XEvent *event, char **params, Cardinal *num_params ) { register XmSashWidget sash = (XmSashWidget) w; if (event->xany.type != FocusOut || !event->xfocus.send_event) return; if (_XmGetFocusPolicy( (Widget) sash) == XmEXPLICIT) UnhighlightSash(w); XmeDrawShadows (XtDisplay (w), XtWindow (w), sash->primitive.top_shadow_GC, sash->primitive.bottom_shadow_GC, 0,0,w->core.width, w->core.height, sash->primitive.shadow_thickness, XmSHADOW_OUT); sash->sash.has_focus = False; } static void SashAction( Widget widget, XEvent *event, String *params, Cardinal *num_params ) { register XmSashWidget sash = (XmSashWidget) widget; SashCallDataRec call_data; call_data.event = event; call_data.params = params; call_data.num_params = *num_params; XtCallCallbackList(widget, sash->sash.sash_action, (XtPointer)&call_data); } static void Realize( register Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Cursor SashCursor = ((XmDisplayInfo *)(dd->display.displayInfo))->SashCursor; if (0L == SashCursor) { /* create some data shared among all instances on this ** display; the first one along can create it, and ** any one can remove it; note no reference count */ SashCursor = ((XmDisplayInfo *)(dd->display.displayInfo))->SashCursor = XCreateFontCursor(XtDisplay(w), XC_crosshair); XtAddCallback((Widget)dd, XtNdestroyCallback, SashDisplayDestroyCallback, (XtPointer) NULL); } attributes->cursor = SashCursor; XtCreateWindow (w, InputOutput, CopyFromParent, *p_valueMask | CWCursor, attributes); } /*ARGSUSED*/ static void SashDisplayDestroyCallback ( Widget w, XtPointer client_data, /* unused */ XtPointer call_data ) /* unused */ { XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Cursor SashCursor; if ((XmDisplay)NULL != dd) { SashCursor = ((XmDisplayInfo *)(dd->display.displayInfo))->SashCursor; if (0L != SashCursor) { XFreeCursor(XtDisplay(w), SashCursor); /* ((XmDisplayInfo *)(dd->display.displayInfo))->SashCursor= 0L; */ } } } /*************************************<->************************************* * * Redisplay (w, event) * * Description: * ----------- * Cause the widget, identified by w, to be redisplayed. * * * Inputs: * ------ * w = widget to be redisplayed; * event = event structure identifying need for redisplay on this * widget. * * Outputs: * ------- * * Procedures Called * ----------------- * DrawToggle() * XDrawString() *************************************<->***********************************/ /* ARGSUSED */ static void Redisplay( Widget w, XEvent *event, Region region ) { register XmSashWidget sash = (XmSashWidget) w; XmeDrawShadows (XtDisplay (w), XtWindow (w), sash->primitive.top_shadow_GC, sash->primitive.bottom_shadow_GC, 0,0,w->core.width, w->core.height, sash->primitive.shadow_thickness, XmSHADOW_OUT); if (sash->sash.has_focus) HighlightSash(w); } motif-2.3.8/lib/Xm/EditresCom.c0000644000175000017500000015757712672334535013157 00000000000000/* $XConsortium: EditresCom.c /main/34 1995/12/11 00:19:42 gildea $ */ /* Copyright (c) 1989 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. */ /* $XFree86: xc/lib/Xmu/EditresCom.c,v 1.3.2.4 1999/07/23 13:22:15 hohndel Exp $ */ /* * Author: Chris D. Peterson, Dave Sternlicht, MIT X Consortium */ /* Replacement EditresCom.c for the one in Xmu to add the GetValues feature, and to modify the PositionInChild function for Motif. This modification is needed because Motif's VendorShell lies about the real position of it's child. */ #ifdef HAVE_CONFIG_H #include #endif #include /* To get into the composite and core widget structures. */ #include /* For XtIs macros. */ #include /* for XtRString. */ #define XK_LATIN1 #include #include /* for Application Shell Widget class. */ #include #include /* for strcpy declaration */ #include #include #include #include #define _XEditResPutBool _XEditResPut8 #define _XEditResPutResourceType _XEditResPut8 /************************************************************ * * Local structure definitions. * ************************************************************/ typedef enum { BlockNone, BlockSetValues, BlockAll } EditresBlock; typedef struct _SetValuesEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; unsigned short num_entries; /* number of set values requests. */ char * name; char * res_type; XtPointer value; unsigned short value_len; } SetValuesEvent; typedef struct _SVErrorInfo { SetValuesEvent * event; ProtocolStream * stream; unsigned short * count; WidgetInfo * entry; } SVErrorInfo; typedef struct _GetValuesEvent { EditresCommand type; /* first field must be type */ WidgetInfo * widgets; unsigned short num_entries; /* number of get values requests */ char * name; } GetValuesEvent; typedef struct _FindChildEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; short x, y; } FindChildEvent; typedef struct _GenericGetEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; unsigned short num_entries; /* number of set values requests. */ } GenericGetEvent, GetResEvent, GetGeomEvent; /* * Things that are common to all events. */ typedef struct _AnyEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; } AnyEvent; /* * The event union. */ typedef union _EditresEvent { AnyEvent any_event; SetValuesEvent set_values_event; GetResEvent get_resources_event; GetGeomEvent get_geometry_event; FindChildEvent find_child_event; } EditresEvent; typedef struct _Globals { EditresBlock block; SVErrorInfo error_info; ProtocolStream stream; ProtocolStream * command_stream; /* command stream. */ #if defined(LONG64) || defined(WORD64) unsigned long base_address; #endif } Globals; #define CURRENT_PROTOCOL_VERSION 5L #define streq(a,b) (strcmp( (a), (b) ) == 0) static Atom res_editor_command, res_editor_protocol, client_value; static Globals globals; static void SendFailure(), SendCommand(), InsertWidget(), ExecuteCommand(); static void FreeEvent(), ExecuteSetValues(), ExecuteGetGeometry(); static void ExecuteGetResources(); static void GetCommand(); static void LoadResources(); static Boolean IsChild(); static void DumpChildren(); static char *DumpWidgets(), *DoSetValues(), *DoFindChild(); static char *DoGetGeometry(), *DoGetResources(), *DumpValues(); #ifndef HAVE_XMU_N_COPY_ISO void _XmNCopyISOLatin1Lowered(char *dst, char *src, int size) { register unsigned char *dest, *source; int bytes; if (size <= 0) return; for (dest = (unsigned char *)dst, source = (unsigned char *)src, bytes = 0; *source && bytes < size - 1; source++, dest++, bytes++) { if ((*source >= XK_A) && (*source <= XK_Z)) *dest = *source + (XK_a - XK_A); else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis)) *dest = *source + (XK_agrave - XK_Agrave); else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn)) *dest = *source + (XK_oslash - XK_Ooblique); else *dest = *source; } *dest = '\0'; } #endif /************************************************************ * * Resource Editor Communication Code * ************************************************************/ /* Function Name: _XEditResCheckMessages * Description: This callback routine is set on all shell widgets, * and checks to see if a client message event * has come from the resource editor. * Arguments: w - the shell widget. * data - *** UNUSED *** * event - The X Event that triggered this handler. * cont - *** UNUSED ***. * Returns: none. */ /* ARGSUSED */ void _XmEditResCheckMessages(w, data, event, cont) Widget w; XtPointer data; XEvent *event; Boolean *cont; { Time time; ResIdent ident; static Boolean first_time = FALSE; static Atom res_editor, res_comm; Display * dpy; if (event->type == ClientMessage) { XClientMessageEvent * c_event = (XClientMessageEvent *) event; dpy = XtDisplay(w); if (!first_time) { Atom atoms[4]; static char* names[] = { EDITRES_NAME, EDITRES_COMMAND_ATOM, EDITRES_PROTOCOL_ATOM, EDITRES_CLIENT_VALUE }; first_time = TRUE; XInternAtoms(dpy, names, 4, FALSE, atoms); res_editor = atoms[0]; res_editor_command = atoms[1]; res_editor_protocol = atoms[2]; /* Used in later procedures. */ client_value = atoms[3]; LoadResources(w); } if ((c_event->message_type != res_editor) || (c_event->format != EDITRES_SEND_EVENT_FORMAT)) return; time = c_event->data.l[0]; res_comm = c_event->data.l[1]; ident = (ResIdent) c_event->data.l[2]; if (c_event->data.l[3] != CURRENT_PROTOCOL_VERSION) { _XEditResResetStream(&globals.stream); _XEditResPut8(&globals.stream, (unsigned int) CURRENT_PROTOCOL_VERSION); SendCommand(w, res_comm, ident, ProtocolMismatch, &globals.stream); return; } XtGetSelectionValue(w, res_comm, res_editor_command, GetCommand, (XtPointer)(long) ident, time); } } /* Function Name: BuildEvent * Description: Takes the info out the protocol stream an constructs * the proper event structure. * Arguments: w - widget to own selection, in case of error. * sel - selection to send error message beck in. * data - the data for the request. * ident - the id number we are looking for. * length - length of request. * Returns: the event, or NULL. */ #if defined(Lynx) && defined(ERROR_MESSAGE) #undef ERROR_MESSAGE #endif #define ERROR_MESSAGE ("Client: Improperly formatted protocol request") static EditresEvent * BuildEvent(w, sel, data, ident, length) Widget w; Atom sel; XtPointer data; ResIdent ident; unsigned long length; { EditresEvent * event; ProtocolStream alloc_stream, *stream; unsigned char temp; register unsigned int i; stream = &alloc_stream; /* easier to think of it this way... */ stream->current = stream->top = (unsigned char *) data; stream->size = HEADER_SIZE; /* size of header. */ /* * Retrieve the Header. */ if (length < HEADER_SIZE) { SendFailure(w, sel, ident, ERROR_MESSAGE); return(NULL); } (void) _XEditResGet8(stream, &temp); if (temp != ident) /* Id's don't match, ignore request. */ return(NULL); event = (EditresEvent *) XtCalloc(sizeof(EditresEvent), 1); (void) _XEditResGet8(stream, &temp); event->any_event.type = (EditresCommand) temp; (void) _XEditResGet32(stream, &(stream->size)); stream->top = stream->current; /* reset stream to top of value.*/ /* * Now retrieve the data segment. */ switch(event->any_event.type) { case SendWidgetTree: break; /* no additional info */ case SetValues: { SetValuesEvent * sv_event = (SetValuesEvent *) event; if ( !(_XEditResGetString8(stream, &(sv_event->name)) && _XEditResGetString8(stream, &(sv_event->res_type)))) { goto done; } /* * Since we need the value length, we have to pull the * value out by hand. */ if (!_XEditResGet16(stream, &(sv_event->value_len))) goto done; sv_event->value = XtMalloc(sizeof(char) * (sv_event->value_len + 1)); for (i = 0; i < sv_event->value_len; i++) { if (!_XEditResGet8(stream, (unsigned char *) sv_event->value + i)) { goto done; } } ((char*)sv_event->value)[i] = '\0'; /* NULL terminate that sucker. */ if (!_XEditResGet16(stream, &(sv_event->num_entries))) goto done; sv_event->widgets = (WidgetInfo *) XtCalloc(sizeof(WidgetInfo), sv_event->num_entries); for (i = 0; i < sv_event->num_entries; i++) { if (!_XEditResGetWidgetInfo(stream, sv_event->widgets + i)) goto done; } } break; case FindChild: { FindChildEvent * find_event = (FindChildEvent *) event; find_event->widgets = (WidgetInfo *) XtCalloc(sizeof(WidgetInfo), 1); if (!(_XEditResGetWidgetInfo(stream, find_event->widgets) && _XEditResGetSigned16(stream, &(find_event->x)) && _XEditResGetSigned16(stream, &(find_event->y)))) { goto done; } } break; case GetGeometry: case GetResources: { GenericGetEvent * get_event = (GenericGetEvent *) event; if (!_XEditResGet16(stream, &(get_event->num_entries))) goto done; get_event->widgets = (WidgetInfo *) XtCalloc(sizeof(WidgetInfo), get_event->num_entries); for (i = 0; i < get_event->num_entries; i++) { if (!_XEditResGetWidgetInfo(stream, get_event->widgets + i)) goto done; } } break; case GetValues: { GetValuesEvent * gv_event = (GetValuesEvent *) event; _XEditResGetString8(stream, &(gv_event->name)); _XEditResGet16(stream, &(gv_event->num_entries)); gv_event->widgets = (WidgetInfo *) XtCalloc(sizeof(WidgetInfo), gv_event->num_entries); _XEditResGetWidgetInfo(stream, gv_event->widgets); } break; default: { char buf[BUFSIZ]; sprintf(buf, "Unknown Protocol request %d.",event->any_event.type); SendFailure(w, sel, ident, buf); return(NULL); } } return(event); done: SendFailure(w, sel, ident, ERROR_MESSAGE); FreeEvent(event); return(NULL); } /* Function Name: FreeEvent * Description: Frees the event structure and any other pieces * in it that need freeing. * Arguments: event - the event to free. * Returns: none. */ static void FreeEvent(event) EditresEvent * event; { if (event->any_event.widgets != NULL) { XtFree((char *)event->any_event.widgets->ids); XtFree((char *)event->any_event.widgets); } if (event->any_event.type == SetValues) { XtFree(event->set_values_event.name); /* XtFree does not free if */ XtFree(event->set_values_event.res_type); /* value is NULL. */ } XtFree((char *)event); } /* Function Name: GetCommand * Description: Gets the Command out of the selection asserted by the * resource manager. * Arguments: (See Xt XtConvertSelectionProc) * data - contains the ident number for the command. * Returns: none. */ /* ARGSUSED */ static void GetCommand(w, data, selection, type, value, length, format) Widget w; XtPointer data, value; Atom *selection, *type; unsigned long *length; int * format; { ResIdent ident = (ResIdent)(long) data; EditresEvent * event; if ( (*type != res_editor_protocol) || (*format != EDITRES_FORMAT) ) return; if ((event = BuildEvent(w, *selection, value, ident, *length)) != NULL) { ExecuteCommand(w, *selection, ident, event); FreeEvent(event); } } /* Function Name: ExecuteCommand * Description: Executes a command string received from the * resource editor. * Arguments: w - a widget. * command - the command to execute. * value - the associated with the command. * Returns: none. * * NOTES: munges str */ /* ARGSUSED */ static void ExecuteCommand(w, sel, ident, event) Widget w; Atom sel; ResIdent ident; EditresEvent * event; { char * (*func)(); char * str; if (globals.block == BlockAll) { SendFailure(w, sel, ident, "This client has blocked all Editres commands."); return; } else if ((globals.block == BlockSetValues) && (event->any_event.type == SetValues)) { SendFailure(w, sel, ident, "This client has blocked all SetValues requests."); return; } switch(event->any_event.type) { case SendWidgetTree: #if defined(LONG64) || defined(WORD64) globals.base_address = (unsigned long)w & 0xFFFFFFFF00000000; #endif func = DumpWidgets; break; case SetValues: func = DoSetValues; break; case FindChild: func = DoFindChild; break; case GetGeometry: func = DoGetGeometry; break; case GetResources: func = DoGetResources; break; case GetValues: func = DumpValues; break; default: { char buf[BUFSIZ]; sprintf(buf,"Unknown Protocol request %d.",event->any_event.type); SendFailure(w, sel, ident, buf); return; } } _XEditResResetStream(&globals.stream); if ((str = (*func)(w, event, &globals.stream)) == NULL) SendCommand(w, sel, ident, PartialSuccess, &globals.stream); else { SendFailure(w, sel, ident, str); XtFree(str); } } /* Function Name: ConvertReturnCommand * Description: Converts a selection. * Arguments: w - the widget that owns the selection. * selection - selection to convert. * target - target type for this selection. * type_ret - type of the selection. * value_ret - selection value; * length_ret - lenght of this selection. * format_ret - the format the selection is in. * Returns: True if conversion was sucessful. */ /* ARGSUSED */ static Boolean ConvertReturnCommand(w, selection, target, type_ret, value_ret, length_ret, format_ret) Widget w; Atom * selection, * target, * type_ret; XtPointer *value_ret; unsigned long * length_ret; int * format_ret; { /* * I assume the intrinsics give me the correct selection back. */ if ((*target != client_value)) return(FALSE); *type_ret = res_editor_protocol; *value_ret = (XtPointer) globals.command_stream->real_top; *length_ret = globals.command_stream->size + HEADER_SIZE; *format_ret = EDITRES_FORMAT; return(TRUE); } /* Function Name: CommandDone * Description: done with the selection. * Arguments: *** UNUSED *** * Returns: none. */ /* ARGSUSED */ static void CommandDone(widget, selection, target) Widget widget; Atom *selection; Atom *target; { /* Keep the toolkit from automaticaly freeing the selection value */ } /* Function Name: SendFailure * Description: Sends a failure message. * Arguments: w - the widget to own the selection. * sel - the selection to assert. * ident - the identifier. * str - the error message. * Returns: none. */ static void SendFailure(w, sel, ident, str) Widget w; Atom sel; ResIdent ident; char * str; { _XEditResResetStream(&globals.stream); _XEditResPutString8(&globals.stream, str); SendCommand(w, sel, ident, Failure, &globals.stream); } /* Function Name: BuildReturnPacket * Description: Builds a return packet, given the data to send. * Arguments: ident - the identifier. * command - the command code. * stream - the protocol stream. * Returns: packet - the packet to send. */ static XtPointer BuildReturnPacket(ident, command, stream) ResIdent ident; EditresCommand command; ProtocolStream * stream; { long old_alloc, old_size; unsigned char * old_current; /* * We have cleverly keep enough space at the top of the header * for the return protocol stream, so all we have to do is * fill in the space. */ /* * Fool the insert routines into putting the header in the right * place while being damn sure not to realloc (that would be very bad. */ old_current = stream->current; old_alloc = stream->alloc; old_size = stream->size; stream->current = stream->real_top; stream->alloc = stream->size + (2 * HEADER_SIZE); _XEditResPut8(stream, ident); _XEditResPut8(stream, (unsigned char) command); _XEditResPut32(stream, old_size); stream->alloc = old_alloc; stream->current = old_current; stream->size = old_size; return((XtPointer) stream->real_top); } /* Function Name: SendCommand * Description: Builds a return command line. * Arguments: w - the widget to own the selection. * sel - the selection to assert. * ident - the identifier. * command - the command code. * stream - the protocol stream. * Returns: none. */ static void SendCommand(w, sel, ident, command, stream) Widget w; Atom sel; ResIdent ident; EditresCommand command; ProtocolStream * stream; { BuildReturnPacket(ident, command, stream); globals.command_stream = stream; /* * I REALLY want to own the selection. Since this was not triggered * by a user action, and I am the only one using this atom it is safe to * use CurrentTime. */ XtOwnSelection(w, sel, CurrentTime, ConvertReturnCommand, NULL, CommandDone); } /************************************************************ * * Generic Utility Functions. * ************************************************************/ /* Function Name: FindChildren * Description: Retuns all children (popup, normal and otherwise) * of this widget * Arguments: parent - the parent widget. * children - the list of children. * normal - return normal children. * popup - return popup children. * Returns: the number of children. */ static int FindChildren(parent, children, normal, popup) Widget parent, **children; Boolean normal, popup; { CompositeWidget cw = (CompositeWidget) parent; int i, num_children, current = 0; num_children = 0; if (XtIsWidget(parent) && popup) num_children += parent->core.num_popups; if (XtIsComposite(parent) && normal) num_children += cw->composite.num_children; if (num_children == 0) { *children = NULL; return(0); } *children =(Widget*) XtMalloc((Cardinal) sizeof(Widget) * num_children); if (XtIsComposite(parent) && normal) for (i = 0; i < cw->composite.num_children; i++,current++) (*children)[current] = cw->composite.children[i]; if (XtIsWidget(parent) && popup) for ( i = 0; i < parent->core.num_popups; i++, current++) (*children)[current] = parent->core.popup_list[i]; return(num_children); } /* Function Name: IsChild * Description: check to see of child is a child of parent. * Arguments: top - the top of the tree. * parent - the parent widget. * child - the child. * Returns: none. */ static Boolean IsChild(top, parent, child) Widget top, parent, child; { int i, num_children; Widget * children; if (parent == NULL) return(top == child); num_children = FindChildren(parent, &children, TRUE, TRUE); for (i = 0; i < num_children; i++) { if (children[i] == child) { XtFree((char *)children); return(TRUE); } } XtFree((char *)children); return(FALSE); } /* Function Name: VerifyWidget * Description: Makes sure all the widgets still exist. * Arguments: w - any widget in the tree. * info - the info about the widget to verify. * Returns: an error message or NULL. */ static char * VerifyWidget(w, info) Widget w; WidgetInfo *info; { Widget top; register int count; register Widget parent; register unsigned long * child; for (top = w; XtParent(top) != NULL; top = XtParent(top)) {} parent = NULL; child = info->ids; count = 0; while (TRUE) { if (!IsChild(top, parent, (Widget) *child)) return(XtNewString("This widget no longer exists in the client.")); if (++count == info->num_widgets) break; parent = (Widget) *child++; } info->real_widget = (Widget) *child; return(NULL); } /************************************************************ * * Code to Perform SetValues operations. * ************************************************************/ /* Function Name: DoSetValues * Description: performs the setvalues requested. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL. */ static char * DoSetValues(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { char * str; register unsigned i; unsigned short count = 0; SetValuesEvent * sv_event = (SetValuesEvent *) event; _XEditResPut16(stream, count); /* insert 0, will be overwritten later. */ for (i = 0 ; i < sv_event->num_entries; i++) { if ((str = VerifyWidget(w, &(sv_event->widgets[i]))) != NULL) { _XEditResPutWidgetInfo(stream, &(sv_event->widgets[i])); _XEditResPutString8(stream, str); XtFree(str); count++; } else ExecuteSetValues(sv_event->widgets[i].real_widget, sv_event, sv_event->widgets + i, stream, &count); } /* * Overwrite the first 2 bytes with the real count. */ *(stream->top) = count >> XER_NBBY; *(stream->top + 1) = count; return(NULL); } /* Function Name: HandleToolkitErrors * Description: Handles X Toolkit Errors. * Arguments: name - name of the error. * type - type of the error. * class - class of the error. * msg - the default message. * params, num_params - the extra parameters for this message. * Returns: none. */ /* ARGSUSED */ static void HandleToolkitErrors(name, type, class, msg, params, num_params) String name, type, class, msg, *params; Cardinal * num_params; { SVErrorInfo * info = &globals.error_info; char buf[BUFSIZ]; char *pbuf; int len; if ( streq(name, "unknownType") ) { char *msg1 = "The `"; char *msg2 = "' resource is not used by this widget."; len = strlen(msg1) + strlen(msg2) + strlen(info->event->name) + 1; if (len > sizeof(buf)) pbuf = XtMalloc(len); else pbuf = buf; if (pbuf == NULL) { pbuf = buf; sprintf(pbuf, "A%s", msg2); } else { sprintf(pbuf, "%s%s%s", msg1, info->event->name, msg2); } } else if ( streq(name, "noColormap") ) { len = strlen(msg) + 1; if (params[0]) len += strlen(params[0]); if (len > sizeof(buf)) pbuf = XtMalloc(len); else pbuf = buf; if (pbuf == NULL) { pbuf = buf; sprintf(pbuf, "Message too long"); } else { sprintf(pbuf, msg, params[0]); } } else if (streq(name, "conversionFailed") || streq(name, "conversionError")) { char *msg1, *msg2, *msg3; if (streq(info->event->value, XtRString)) { msg1 = "Could not convert the string '"; msg2 = "' for the `"; msg3 = "' resource."; len = strlen(msg1) + strlen(msg2) + strlen(msg3) + 1 + strlen(info->event->value) + strlen(info->event->name); } else { msg1 = "Could not convert the `"; msg2 = "' resource."; msg3 = ""; len = strlen(msg1) + strlen(msg2) + strlen(info->event->name) + 1; } if (len > sizeof(buf)) pbuf = XtMalloc(len); else pbuf = buf; if (streq(info->event->value, XtRString)) { if (pbuf == NULL) { pbuf = buf; sprintf(pbuf, "Could not convert a string"); } else { sprintf(pbuf, "%s%s%s%s%s", msg1, (char *)info->event->value, msg2, info->event->name, msg3); } } else { if (pbuf == NULL) { pbuf = buf; sprintf(pbuf, "Could not convert a resource"); } else { sprintf(pbuf, "%s%s%s", msg1, info->event->name, msg2); } } } else { char *msg1 = "Name: ", *msg2 = ", Type: ", *msg3 = ", Class: "; char *msg4 = ", Msg: "; len = strlen(msg1) + strlen(msg2) + strlen(msg3) + strlen(msg4) + strlen(name) + strlen(type) + strlen(class) + strlen(msg) + 1; if (len > sizeof(buf)) pbuf = XtMalloc(len); else pbuf = buf; if (pbuf == NULL) { pbuf = buf; sprintf(pbuf, "Message too long to show"); } else { sprintf(pbuf, "%s%s%s%s%s%s%s%s", msg1, name, msg2, type, msg3, class, msg4, msg); } } /* * Insert this info into the protocol stream, and update the count. */ (*(info->count))++; _XEditResPutWidgetInfo(info->stream, info->entry); _XEditResPutString8(info->stream, pbuf); if (pbuf != buf) XtFree(pbuf); } /* Function Name: ExecuteSetValues * Description: Performs a setvalues for a given command. * Arguments: w - the widget to perform the set_values on. * sv_event - the set values event. * sv_info - the set_value info. * Returns: none. */ static void ExecuteSetValues(w, sv_event, entry, stream, count) Widget w; SetValuesEvent * sv_event; WidgetInfo * entry; ProtocolStream * stream; unsigned short * count; { XtErrorMsgHandler old; SVErrorInfo * info = &globals.error_info; info->event = sv_event; /* No data can be passed to */ info->stream = stream; /* an error handler, so we */ info->count = count; /* have to use a global, YUCK... */ info->entry = entry; old = XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), HandleToolkitErrors); XtVaSetValues(w, XtVaTypedArg, sv_event->name, sv_event->res_type, sv_event->value, sv_event->value_len, NULL); (void)XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), old); } /************************************************************ * * Code for Creating and dumping widget tree. * ************************************************************/ /* Function Name: DumpWidgets * Description: Given a widget it builds a protocol packet * containing the entire widget heirarchy. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL */ #define TOOLKIT_TYPE ("Xt") /* ARGSUSED */ static char * DumpWidgets(w, event, stream) Widget w; EditresEvent * event; /* UNUSED */ ProtocolStream * stream; { unsigned short count = 0; /* Find Tree's root. */ for ( ; XtParent(w) != NULL; w = XtParent(w)) {} /* * hold space for count, overwritten later. */ _XEditResPut16(stream, (unsigned int) 0); DumpChildren(w, stream, &count); /* * write out toolkit type (Xt, of course...). */ _XEditResPutString8(stream, TOOLKIT_TYPE); /* * Overwrite the first 2 bytes with the real count. */ *(stream->top) = count >> XER_NBBY; *(stream->top + 1) = count; return(NULL); } /* Function Name: DumpChildren * Description: Adds a child's name to the list. * Arguments: w - the widget to dump. * stream - the stream to dump to. * count - number of dumps we have performed. * Returns: none. */ /* This is a trick/kludge. To make shared libraries happier (linking * against Xmu but not linking against Xt, and apparently even work * as we desire on SVR4, we need to avoid an explicit data reference * to applicationShellWidgetClass. XtIsTopLevelShell is known * (implementation dependent assumption!) to use a bit flag. So we * go that far. Then, we test whether it is an applicationShellWidget * class by looking for an explicit class name. Seems pretty safe. */ static Bool isApplicationShell(w) Widget w; { register WidgetClass c; if (!XtIsTopLevelShell(w)) return False; for (c = XtClass(w); c; c = c->core_class.superclass) { if (!strcmp(c->core_class.class_name, "ApplicationShell")) return True; } return False; } static void DumpChildren(w, stream, count) Widget w; ProtocolStream * stream; unsigned short *count; { int i, num_children; Widget *children; unsigned long window; char * class; (*count)++; InsertWidget(stream, w); /* Insert the widget into the stream. */ _XEditResPutString8(stream, XtName(w)); /* Insert name */ if (isApplicationShell(w)) class = ((ApplicationShellWidget) w)->application.class; else class = XtClass(w)->core_class.class_name; _XEditResPutString8(stream, class); /* Insert class */ if (XtIsWidget(w)) if (XtIsRealized(w)) window = XtWindow(w); else window = EDITRES_IS_UNREALIZED; else window = EDITRES_IS_OBJECT; _XEditResPut32(stream, window); /* Insert window id. */ /* * Find children and recurse. */ num_children = FindChildren(w, &children, TRUE, TRUE); for (i = 0; i < num_children; i++) DumpChildren(children[i], stream, count); XtFree((char *)children); } /************************************************************ * * Code for getting the geometry of widgets. * ************************************************************/ /* Function Name: DoGetGeometry * Description: retrieves the Geometry of each specified widget. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL */ static char * DoGetGeometry(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { unsigned i; char * str; GetGeomEvent * geom_event = (GetGeomEvent *) event; _XEditResPut16(stream, geom_event->num_entries); for (i = 0 ; i < geom_event->num_entries; i++) { /* * Send out the widget id. */ _XEditResPutWidgetInfo(stream, &(geom_event->widgets[i])); if ((str = VerifyWidget(w, &(geom_event->widgets[i]))) != NULL) { _XEditResPutBool(stream, True); /* an error occured. */ _XEditResPutString8(stream, str); /* set message. */ XtFree(str); } else ExecuteGetGeometry(geom_event->widgets[i].real_widget, stream); } return(NULL); } /* Function Name: ExecuteGetGeometry * Description: Gets the geometry for each widget specified. * Arguments: w - the widget to get geom on. * stream - stream to append to. * Returns: True if no error occured. */ static void ExecuteGetGeometry(w, stream) Widget w; ProtocolStream * stream; { int i; Boolean mapped_when_man; Dimension width, height, border_width; Arg args[8]; Cardinal num_args = 0; Position x, y; if ( !XtIsRectObj(w) || (XtIsWidget(w) && !XtIsRealized(w)) ) { _XEditResPutBool(stream, False); /* no error. */ _XEditResPutBool(stream, False); /* not visable. */ for (i = 0; i < 5; i++) /* fill in extra space with 0's. */ _XEditResPut16(stream, 0); return; } XtSetArg(args[num_args], XtNwidth, &width); num_args++; XtSetArg(args[num_args], XtNheight, &height); num_args++; XtSetArg(args[num_args], XtNborderWidth, &border_width); num_args++; XtSetArg(args[num_args], XtNmappedWhenManaged, &mapped_when_man); num_args++; XtGetValues(w, args, num_args); if (!(XtIsManaged(w) && mapped_when_man) && XtIsWidget(w)) { XWindowAttributes attrs; /* * The toolkit does not maintain mapping state, we have * to go to the server. */ if (XGetWindowAttributes(XtDisplay(w), XtWindow(w), &attrs) != 0) { if (attrs.map_state != IsViewable) { _XEditResPutBool(stream, False); /* no error. */ _XEditResPutBool(stream, False); /* not visable. */ for (i = 0; i < 5; i++) /* fill in extra space with 0's. */ _XEditResPut16(stream, 0); return; } } else { _XEditResPut8(stream, True); /* Error occured. */ _XEditResPutString8(stream, "XGetWindowAttributes failed."); return; } } XtTranslateCoords(w, -((int) border_width), -((int) border_width), &x, &y); _XEditResPutBool(stream, False); /* no error. */ _XEditResPutBool(stream, True); /* Visable. */ _XEditResPut16(stream, x); _XEditResPut16(stream, y); _XEditResPut16(stream, width); _XEditResPut16(stream, height); _XEditResPut16(stream, border_width); } /************************************************************ * * Code for executing FindChild. * ************************************************************/ /* Function Name: PositionInChild * Description: returns true if this location is in the child. * Arguments: child - the child widget to check. * x, y - location of point to check in the parent's * coord space. * Returns: TRUE if the position is in this child. */ static Boolean PositionInChild(child, x, y) Widget child; int x, y; { Arg args[6]; Cardinal num; Dimension width, height, border_width; Position child_x, child_y; Boolean mapped_when_managed; if (!XtIsRectObj(child)) /* we must at least be a rect obj. */ return(FALSE); num = 0; XtSetArg(args[num], XtNmappedWhenManaged, &mapped_when_managed); num++; XtSetArg(args[num], XtNwidth, &width); num++; XtSetArg(args[num], XtNheight, &height); num++; XtSetArg(args[num], XtNx, &child_x); num++; XtSetArg(args[num], XtNy, &child_y); num++; XtSetArg(args[num], XtNborderWidth, &border_width); num++; XtGetValues(child, args, num); if (XtIsVendorShell(XtParent(child))) { child_x = -border_width; child_y = -border_width; } /* * The only way we will know of the widget is mapped is to see if * mapped when managed is True and this is a managed child. Otherwise * we will have to ask the server if this window is mapped. */ if (XtIsWidget(child) && !(mapped_when_managed && XtIsManaged(child)) ) { XWindowAttributes attrs; if (XtIsRealized(child)) { if (XGetWindowAttributes(XtDisplay(child), XtWindow(child), &attrs) != 0) { /* oops */ } else if (attrs.map_state != IsViewable) return(FALSE); } } return (x >= child_x) && (x <= (child_x + (Position)width + 2 * (Position)border_width)) && (y >= child_y) && (y <= (child_y + (Position)height + 2 * (Position)border_width)); } /* Function Name: _FindChild * Description: Finds the child that actually contatians the point shown. * Arguments: parent - a widget that is known to contain the point * specified. * x, y - The point in coordinates relative to the * widget specified. * Returns: none. */ static Widget _FindChild(parent, x, y) Widget parent; int x, y; { Widget * children; int i = FindChildren(parent, &children, TRUE, FALSE); while (i > 0) { i--; if (PositionInChild(children[i], x, y)) { Widget child = children[i]; XtFree((char *)children); return(_FindChild(child, x - child->core.x, y - child->core.y)); } } XtFree((char *)children); return(parent); } /* Function Name: DoFindChild * Description: finds the child that contains the location specified. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: an allocated error message if something went horribly * wrong and no set values were performed, else NULL. */ static char * DoFindChild(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { char * str; Widget parent, child; Position parent_x, parent_y; FindChildEvent * find_event = (FindChildEvent *) event; if ((str = VerifyWidget(w, find_event->widgets)) != NULL) return(str); parent = find_event->widgets->real_widget; XtTranslateCoords(parent, (Position) 0, (Position) 0, &parent_x, &parent_y); child = _FindChild(parent, find_event->x - (int) parent_x, find_event->y - (int) parent_y); InsertWidget(stream, child); return(NULL); } /************************************************************ * * Procedures for performing GetResources. * ************************************************************/ /* Function Name: DoGetResources * Description: Gets the Resources associated with the widgets passed. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL */ static char * DoGetResources(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { unsigned int i; char * str; GetResEvent * res_event = (GetResEvent *) event; _XEditResPut16(stream, res_event->num_entries); /* number of replys */ for (i = 0 ; i < res_event->num_entries; i++) { /* * Send out the widget id. */ _XEditResPutWidgetInfo(stream, &(res_event->widgets[i])); if ((str = VerifyWidget(w, &(res_event->widgets[i]))) != NULL) { _XEditResPutBool(stream, True); /* an error occured. */ _XEditResPutString8(stream, str); /* set message. */ XtFree(str); } else { _XEditResPutBool(stream, False); /* no error occured. */ ExecuteGetResources(res_event->widgets[i].real_widget, stream); } } return(NULL); } /* Function Name: ExecuteGetResources. * Description: Gets the resources for any individual widget. * Arguments: w - the widget to get resources on. * stream - the protocol stream. * Returns: none. */ static void ExecuteGetResources(w, stream) Widget w; ProtocolStream * stream; { XtResourceList norm_list, cons_list; Cardinal num_norm, num_cons; register int i; /* * Get Normal Resources. */ XtGetResourceList(XtClass(w), &norm_list, &num_norm); if (XtParent(w) != NULL) XtGetConstraintResourceList(XtClass(XtParent(w)),&cons_list,&num_cons); else num_cons = 0; _XEditResPut16(stream, num_norm + num_cons); /* how many resources. */ /* * Insert all the normal resources. */ for ( i = 0; i < (int) num_norm; i++) { _XEditResPutResourceType(stream, NormalResource); _XEditResPutString8(stream, norm_list[i].resource_name); _XEditResPutString8(stream, norm_list[i].resource_class); _XEditResPutString8(stream, norm_list[i].resource_type); } XtFree((char *) norm_list); /* * Insert all the constraint resources. */ if (num_cons > 0) { for ( i = 0; i < (int) num_cons; i++) { _XEditResPutResourceType(stream, ConstraintResource); _XEditResPutString8(stream, cons_list[i].resource_name); _XEditResPutString8(stream, cons_list[i].resource_class); _XEditResPutString8(stream, cons_list[i].resource_type); } XtFree((char *) cons_list); } } static void EditResCvtWarningHandler(String name, String type, String class, String def, String *params, Cardinal *num_params) { /* just ignore the warning */ return; } static void _XtGetStringValues(Widget w, Arg *warg, int numargs) { XtResourceList res_list; Cardinal num_res; XtResource *res = NULL; long value; int size, i; char *string = ""; char *buffer; Arg args[1]; XrmValue to, from, to_color; /* * Look for the resource. */ XtGetResourceList(XtClass(w), &res_list, &num_res); for (i = 0; i < (int)num_res && res == NULL; i++) { if (0 == strcmp(res_list[i].resource_name, warg->name)) res = &res_list[i]; } if (res == NULL && XtParent(w) != NULL) { XtFree((char *)res_list); XtGetConstraintResourceList(XtClass(XtParent(w)), &res_list, &num_res); } for (i = 0; i < (int)num_res && res == NULL; i++) { if (0 == strcmp(res_list[i].resource_name, warg->name)) res = &res_list[i]; } if (res == NULL) { /* Couldn't find resource */ XtFree((char *)res_list); *(XtPointer *)(warg->value) = NULL; return; } size = res->resource_size; buffer = *(char **)(warg->value); /* try to get the value in the proper size */ switch (res->resource_size) { #if (LONG_BIT == 64) long v8; #endif int v4; short v2; char v1; case 1: XtSetArg(args[0], res->resource_name, &v1); XtGetValues(w, args, 1); value = (int)v1; break; case 2: XtSetArg(args[0], res->resource_name, &v2); XtGetValues(w, args, 1); value = (int)v2; break; case 4: XtSetArg(args[0], res->resource_name, &v4); XtGetValues(w, args, 1); value = (int)v4; break; #if (LONG_BIT == 64) case 8: XtSetArg(args[0], res->resource_name, &v8); XtGetValues(w, args, 1); value = (long)v8; break; #endif default: fprintf(stderr, "_XtGetStringValues: bad size %d\n", res->resource_size); string = "bad size"; goto done; } /* * If the resource is already String, no conversion needed. */ if (strcmp(XtRString, res->resource_type) == 0) { if (value == 0) string = "(null)"; else string = (char *)value; } else { XtErrorMsgHandler old_handler; /* * Ignore conversion warnings. */ old_handler = XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), EditResCvtWarningHandler); from.size = res->resource_size; from.addr = (caddr_t)&value; to.addr = NULL; to.size = 0; to_color.addr = NULL; to_color.size = 0; /* * Special case for type Pixel. */ if (0 == strcmp(res->resource_type, XtRPixel) && XtConvertAndStore(w, XtRPixel, &from, XtRColor, &to) && XtConvertAndStore(w, XtRColor, &to, XtRString, &to_color)) { string = to_color.addr; } else if (XtConvertAndStore(w, res->resource_type, &from, XtRString, &to)) { string = to.addr; } else { /* * Conversion failed, fall back to representing it as integer. */ switch (res->resource_size) { case sizeof(char): sprintf(buffer, "%d", (unsigned char)value); string = buffer; break; case sizeof(short): sprintf(buffer, "%d", (short)value); string = buffer; break; case sizeof(int): sprintf(buffer, "%d", (int)value); string = buffer; break; #if (LONG_BIT == 64) case sizeof(long): sprintf(buffer, "%ld", value); string = buffer; break; #endif default: break; } /* strcat(buffer, " (integer fallback conversion)"); */ sprintf(&buffer[strlen(buffer)], " (%s)", res->resource_type); } /* * Restore original warning handler. */ XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), old_handler); } if (string == NULL) { /* can't happen */ #ifdef DEBUG fprintf(stderr, "_LesstifEditResPutValueString8: couldn't convert to string\n"); fprintf(stderr, "Class = %s Type = %s Name = %s\n", res->resource_type, res->resource_name, res->resource_class); #endif string = ""; } done: *((char **)(warg->value)) = string; #ifdef DEBUG fprintf(stderr, "put %s at %#x\n", string, stream->current); #endif XtFree((char *)res_list); } /* * Function Name: DumpValues * Description: Returns resource values to the resource editor. * Arguments: event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL */ static char* DumpValues(w, event, stream) /* ARGSUSED */ Widget w; EditresEvent* event; ProtocolStream* stream; { Arg warg[1]; String res_value = NULL; GetValuesEvent * gv_event = (GetValuesEvent *)event; char buffer[64], *str; res_value = buffer; /* put the count in the stream. */ _XEditResPut16(stream, (unsigned int) 1); /* get the resource of the widget asked for by the */ /* resource editor and insert it into the stream */ XtSetArg(warg[0], gv_event->name, &res_value); if ((str = VerifyWidget(w, &(gv_event->widgets[0]))) != NULL) { _XEditResPutString8(stream, str); XtFree(str); } else { _XtGetStringValues(gv_event->widgets[0].real_widget, warg, 1); if (!res_value) res_value = "NoValue"; _XEditResPutString8(stream, res_value); } return(NULL); } /************************************************************ * * Code for inserting values into the protocol stream. * ************************************************************/ /* Function Name: InsertWidget * Description: Inserts the full parent heirarchy of this * widget into the protocol stream as a widget list. * Arguments: stream - the protocol stream. * w - the widget to insert. * Returns: none */ static void InsertWidget(stream, w) ProtocolStream * stream; Widget w; { Widget temp; unsigned long * widget_list; register int i, num_widgets; for (temp = w, i = 0; temp != 0; temp = XtParent(temp), i++) {} num_widgets = i; widget_list = (unsigned long *) XtMalloc(sizeof(unsigned long) * num_widgets); /* * Put the widgets into the list. * make sure that they are inserted in the list from parent -> child. */ for (i--, temp = w; temp != NULL; temp = XtParent(temp), i--) widget_list[i] = (unsigned long) temp; _XEditResPut16(stream, num_widgets); /* insert number of widgets. */ for (i = 0; i < num_widgets; i++) /* insert Widgets themselves. */ _XEditResPut32(stream, widget_list[i]); XtFree((char *)widget_list); } #if 0 /************************************************************ * * All of the following routines are public. * ************************************************************/ /* Function Name: _XEditResPutString8 * Description: Inserts a string into the protocol stream. * Arguments: stream - stream to insert string into. * str - string to insert. * Returns: none. */ void _XEditResPutString8(stream, str) ProtocolStream * stream; char * str; { int i, len = strlen(str); _XEditResPut16(stream, len); for (i = 0 ; i < len ; i++, str++) _XEditResPut8(stream, *str); } /* Function Name: _XEditResPut8 * Description: Inserts an 8 bit integer into the protocol stream. * Arguments: stream - stream to insert string into. * value - value to insert. * Returns: none */ void _XEditResPut8(stream, value) ProtocolStream * stream; unsigned int value; { unsigned char temp; if (stream->size >= stream->alloc) { stream->alloc += 100; stream->real_top = (unsigned char *) XtRealloc( (char *)stream->real_top, stream->alloc + HEADER_SIZE); stream->top = stream->real_top + HEADER_SIZE; stream->current = stream->top + stream->size; } temp = (unsigned char) (value & BYTE_MASK); *((stream->current)++) = temp; (stream->size)++; } /* Function Name: _XEditResPut16 * Description: Inserts a 16 bit integer into the protocol stream. * Arguments: stream - stream to insert string into. * value - value to insert. * Returns: void */ void _XEditResPut16(stream, value) ProtocolStream * stream; unsigned int value; { _XEditResPut8(stream, (value >> XER_NBBY) & BYTE_MASK); _XEditResPut8(stream, value & BYTE_MASK); } /* Function Name: _XEditResPut32 * Description: Inserts a 32 bit integer into the protocol stream. * Arguments: stream - stream to insert string into. * value - value to insert. * Returns: void */ void _XEditResPut32(stream, value) ProtocolStream * stream; unsigned long value; { int i; for (i = 3; i >= 0; i--) _XEditResPut8(stream, (value >> (XER_NBBY*i)) & BYTE_MASK); } /* Function Name: _XEditResPutWidgetInfo * Description: Inserts the widget info into the protocol stream. * Arguments: stream - stream to insert widget info into. * info - info to insert. * Returns: none */ void _XEditResPutWidgetInfo(stream, info) ProtocolStream * stream; WidgetInfo * info; { unsigned int i; _XEditResPut16(stream, info->num_widgets); for (i = 0; i < info->num_widgets; i++) _XEditResPut32(stream, info->ids[i]); } /************************************************************ * * Code for retrieving values from the protocol stream. * ************************************************************/ /* Function Name: _XEditResResetStream * Description: resets the protocol stream * Arguments: stream - the stream to reset. * Returns: none. */ void _XEditResResetStream(stream) ProtocolStream * stream; { stream->current = stream->top; stream->size = 0; if (stream->real_top == NULL) { stream->real_top = (unsigned char *) XtRealloc( (char *)stream->real_top, stream->alloc + HEADER_SIZE); stream->top = stream->real_top + HEADER_SIZE; stream->current = stream->top + stream->size; } } /* * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE * * The only modified field if the "current" field. * * The only fields that must be set correctly are the "current", "top" * and "size" fields. */ /* Function Name: _XEditResGetg8 * Description: Retrieves an unsigned 8 bit value * from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ Boolean _XEditResGet8(stream, val) ProtocolStream * stream; unsigned char * val; { if (stream->size < (stream->current - stream->top)) return(FALSE); *val = *((stream->current)++); return(TRUE); } /* Function Name: _XEditResGet16 * Description: Retrieves an unsigned 16 bit value * from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ Boolean _XEditResGet16(stream, val) ProtocolStream * stream; unsigned short * val; { unsigned char temp1, temp2; if ( !(_XEditResGet8(stream, &temp1) && _XEditResGet8(stream, &temp2)) ) return(FALSE); *val = (((unsigned short) temp1 << XER_NBBY) + ((unsigned short) temp2)); return(TRUE); } /* Function Name: _XEditResGetSigned16 * Description: Retrieves an signed 16 bit value from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ Boolean _XEditResGetSigned16(stream, val) ProtocolStream * stream; short * val; { unsigned char temp1, temp2; if ( !(_XEditResGet8(stream, &temp1) && _XEditResGet8(stream, &temp2)) ) return(FALSE); if (temp1 & (1 << (XER_NBBY - 1))) { /* If the sign bit is active. */ *val = -1; /* store all 1's */ *val &= (temp1 << XER_NBBY); /* Now and in the MSB */ *val &= temp2; /* and LSB */ } else *val = (((unsigned short) temp1 << XER_NBBY) + ((unsigned short) temp2)); return(TRUE); } /* Function Name: _XEditResGet32 * Description: Retrieves an unsigned 32 bit value * from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ Boolean _XEditResGet32(stream, val) ProtocolStream * stream; unsigned long * val; { unsigned short temp1, temp2; if ( !(_XEditResGet16(stream, &temp1) && _XEditResGet16(stream, &temp2)) ) return(FALSE); *val = (((unsigned short) temp1 << (XER_NBBY * 2)) + ((unsigned short) temp2)); return(TRUE); } /* Function Name: _XEditResGetString8 * Description: Retrieves an 8 bit string value from the protocol stream. * Arguments: stream - the protocol stream * str - the string to retrieve. * Returns: True if retrieval was successful. */ Boolean _XEditResGetString8(stream, str) ProtocolStream * stream; char ** str; { unsigned short len; register unsigned i; if (!_XEditResGet16(stream, &len)) { return(FALSE); } *str = XtMalloc(sizeof(char) * (len + 1)); for (i = 0; i < len; i++) { if (!_XEditResGet8(stream, (unsigned char *) *str + i)) { XtFree(*str); *str = NULL; return(FALSE); } } (*str)[i] = '\0'; /* NULL terminate that sucker. */ return(TRUE); } /* Function Name: _XEditResGetWidgetInfo * Description: Retrieves the list of widgets that follow and stores * them in the widget info structure provided. * Arguments: stream - the protocol stream * info - the widget info struct to store into. * Returns: True if retrieval was successful. */ Boolean _XEditResGetWidgetInfo(stream, info) ProtocolStream * stream; WidgetInfo * info; { unsigned int i; if (!_XEditResGet16(stream, &(info->num_widgets))) return(FALSE); info->ids = (unsigned long *) XtMalloc(sizeof(long) * (info->num_widgets)); for (i = 0; i < info->num_widgets; i++) { if (!_XEditResGet32(stream, info->ids + i)) { XtFree((char *)info->ids); info->ids = NULL; return(FALSE); } #if defined(LONG64) || defined(WORD64) info->ids[i] |= globals.base_address; #endif } return(TRUE); } #endif /************************************************************ * * Code for Loading the EditresBlock resource. * ************************************************************/ /* Function Name: CvStringToBlock * Description: Converts a string to an editres block value. * Arguments: dpy - the display. * args, num_args - **UNUSED ** * from_val, to_val - value to convert, and where to put result * converter_data - ** UNUSED ** * Returns: TRUE if conversion was sucessful. */ /* ARGSUSED */ static Boolean CvtStringToBlock(dpy, args, num_args, from_val, to_val, converter_data) Display * dpy; XrmValue * args; Cardinal * num_args; XrmValue * from_val, * to_val; XtPointer * converter_data; { char ptr[BUFSIZ]; static EditresBlock block; #ifndef HAVE_XMU_N_COPY_ISO _XmNCopyISOLatin1Lowered(ptr, from_val->addr, sizeof(ptr)); #else XmuNCopyISOLatin1Lowered(ptr, from_val->addr, sizeof(ptr)); #endif if (streq(ptr, "none")) block = BlockNone; else if (streq(ptr, "setvalues")) block = BlockSetValues; else if (streq(ptr, "all")) block = BlockAll; else { Cardinal num_params = 1; String params[1]; params[0] = from_val->addr; XtAppWarningMsg(XtDisplayToApplicationContext(dpy), "CvtStringToBlock", "unknownValue", "EditresError", "Could not convert string \"%s\" to EditresBlock.", params, &num_params); return(FALSE); } if (to_val->addr != NULL) { if (to_val->size < sizeof(EditresBlock)) { to_val->size = sizeof(EditresBlock); return(FALSE); } *(EditresBlock *)(to_val->addr) = block; } else to_val->addr = (XtPointer) block; to_val->size = sizeof(EditresBlock); return(TRUE); } #define XtREditresBlock ("EditresBlock") /* Function Name: LoadResources * Description: Loads a global resource the determines of this * application should allow Editres requests. * Arguments: w - any widget in the tree. * Returns: none. */ static void LoadResources(w) Widget w; { static XtResource resources[] = { {"editresBlock", "EditresBlock", XtREditresBlock, sizeof(EditresBlock), XtOffsetOf(Globals, block), XtRImmediate, (XtPointer) BlockNone} }; for (; XtParent(w) != NULL; w = XtParent(w)) {} XtAppSetTypeConverter(XtWidgetToApplicationContext(w), XtRString, XtREditresBlock, CvtStringToBlock, NULL, (Cardinal) 0, XtCacheAll, NULL); XtGetApplicationResources( w, (XtPointer) &globals, resources, XtNumber(resources), NULL, (Cardinal) 0); } motif-2.3.8/lib/Xm/Frame.h0000644000175000017500000000374513145162623012134 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmFrame_h #define _XmFrame_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsFrame #define XmIsFrame(w) XtIsSubclass(w, xmFrameWidgetClass) #endif /* XmIsFrame */ /* Class record constants */ externalref WidgetClass xmFrameWidgetClass; typedef struct _XmFrameClassRec * XmFrameWidgetClass; typedef struct _XmFrameRec * XmFrameWidget; /******** Public Function Declarations ********/ extern Widget XmCreateFrame( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern Widget XmVaCreateFrame( Widget parent, char *name, ...); extern Widget XmVaCreateManagedFrame( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmFrame_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/VaSimpleI.h0000644000175000017500000000344112672140200012713 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: VaSimpleI.h /main/5 1995/07/13 18:18:01 drk $ */ #ifndef _XmVaSimpleI_h #define _XmVaSimpleI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmCountVaList( va_list var, int *button_count, int *args_count, int *typed_count, int *total_count) ; extern void _XmVaToTypedArgList( va_list var, int max_count, XtTypedArgList *args_return, Cardinal *num_args_return) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVaSimpleI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TranslNew.c0000644000175000017500000003313412672334075013013 00000000000000/* $TOG: TranslNew.c /main/8 1998/10/05 16:26:39 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif /* Define _XmConst before including TransltnsP.h or XmP.h, so that the * declarations will be in agreement with the definitions. */ #ifndef _XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define _XmConst const #else #define _XmConst #endif /* __STDC__ */ #endif /* _XmConst */ #include #include #include "XmI.h" /* This is the new-style translation table, which is used with * versions of libXt that have the :-production translation fix * (fix-trackers seq 2797, or MIT public patch 24). * * Translations have been cleaned up and reorganized as follows: * - Sort translations based roughly on the event type. Canonical * order is: Map/Unmap, Enter/Leave, Focus, Btn, Key. * - Within the translations group by key, putting osfMumble * keys first. * - Prefix osf key translations with ':', and reorder as necessary * to remove ~mod. */ /*** ComboBox.c ***/ externaldef(translations) _XmConst char _XmComboBox_defaultTranslations[] = "\ : CBArmAndDropDownList()\n\ : CBDisarm()"; externaldef(translations) _XmConst char _XmComboBox_defaultAccelerators[] = "\ \043override\n\ :c osfUp: CBDropDownList()\n\ :osfUp: CBListAction(Up)\n\ :c osfDown: CBDropDownList()\n\ :osfDown: CBListAction(Down)\n\ :c osfBeginLine: CBListAction(ListBeginData)\n\ :c osfEndLine: CBListAction(ListEndData)\n\ :osfPageUp: CBListAction(ListPrevPage)\n\ :osfPageDown: CBListAction(ListNextPage)\n"; /* TextF translations except for misc, Btn, osf*Data, osf*Up, and osf*Down. */ externaldef(translations) _XmConst char _XmComboBox_dropDownComboBoxAccelerators[] = "\ \043override\n\ :m osfPrimaryPaste:cut-primary()\n\ :a osfPrimaryPaste:cut-primary()\n\ :osfPrimaryPaste: copy-primary()\n\ :m osfCut: cut-primary()\n\ :a osfCut: cut-primary()\n\ :osfCut: cut-clipboard()\n\ :osfPaste: paste-clipboard()\n\ :m osfCopy: copy-primary()\n\ :a osfCopy: copy-primary()\n\ :osfCopy: copy-clipboard()\n\ :s osfBeginLine: beginning-of-line(extend)\n\ :osfBeginLine: beginning-of-line()\n\ :s osfEndLine: end-of-line(extend)\n\ :osfEndLine: end-of-line()\n\ :s osfPageLeft: page-left(extend)\n\ :osfPageLeft: page-left()\n\ :s osfPageRight: page-right(extend)\n\ :osfPageRight: page-right()\n\ :osfClear: clear-selection()\n\ :osfBackSpace: delete-previous-character()\n\ :s m osfDelete: cut-primary()\n\ :s a osfDelete: cut-primary()\n\ :s osfDelete: cut-clipboard()\n\ :c osfDelete: delete-to-end-of-line()\n\ :osfDelete: delete-next-character()\n\ :c m osfInsert: copy-primary()\n\ :c a osfInsert: copy-primary()\n\ :s osfInsert: paste-clipboard()\n\ :c osfInsert: copy-clipboard()\n\ :s osfSelect: key-select()\n\ :osfSelect: set-anchor()\n\ :osfSelectAll: select-all()\n\ :osfDeselectAll: deselect-all()\n\ :osfActivate: activate()\n\ :osfAddMode: toggle-add-mode()\n\ :osfHelp: Help()\n\ :osfCancel: process-cancel()\n\ :s c osfLeft: backward-word(extend)\n\ :c osfLeft: backward-word()\n\ :s osfLeft: key-select(left)\n\ :osfLeft: backward-character()\n\ :s c osfRight: forward-word(extend)\n\ :c osfRight: forward-word()\n\ :s osfRight: key-select(right)\n\ :osfRight: forward-character()\n\ c ~m ~a slash: select-all()\n\ c ~m ~a backslash: deselect-all()\n\ s ~m ~a Tab: prev-tab-group()\n\ ~m ~a Tab: next-tab-group()\n\ ~s ~m ~a Return: activate()\n\ c ~s ~m ~a space: set-anchor()\n\ c s ~m ~a space: key-select()\n\ s ~c ~m ~a space: self-insert()\n\ : self-insert()"; externaldef(translations) _XmConst char _XmComboBox_dropDownListTranslations[] = "\ \043override\n\ :c osfDown: CBDropDownList()\n\ :c osfUp: CBDropDownList()\n\ :osfCancel: CBCancel()\n\ :osfActivate: CBActivate()\n\ ~s ~m ~aReturn: CBActivate()"; externaldef(translations) _XmConst char _XmComboBox_textFocusTranslations[] = "\ \043override\n\ : CBTextFocusOut()"; /*** Container.c ***/ externaldef(translations) _XmConst char _XmContainer_defaultTranslations[] = "\ ~c ~s ~m ~a : ContainerHandleBtn1Down(ContainerBeginSelect,Copy)\n\ c ~s ~m ~a : ContainerHandleBtn1Down(ContainerBeginToggle,Copy)\n\ c s ~m ~a : ContainerHandleBtn1Down(ContainerNoop,Link)\n\ ~c s ~m ~a : ContainerHandleBtn1Down(ContainerBeginExtend,Move)\n\ : ContainerHandleBtn1Motion(ContainerButtonMotion)\n\ ~c ~s ~m ~a : ContainerHandleBtn1Up(ContainerEndSelect)\n\ c ~s ~m ~a : ContainerHandleBtn1Up(ContainerEndToggle)\n\ ~c s ~m ~a : ContainerHandleBtn1Up(ContainerEndExtend)\n\ c s ~m ~a : ContainerHandleBtn1Down(ContainerBeginExtend)\n\ c s ~m ~a : ContainerHandleBtn1Up(ContainerEndExtend)\n\ ~c ~s ~m ~a : ContainerHandleBtn2Down(ContainerStartTransfer,Copy)\n\ c s ~m ~a : ContainerHandleBtn2Down(ContainerStartTransfer,Link)\n\ ~c s ~m ~a : ContainerHandleBtn2Down(ContainerStartTransfer,Move)\n\ : ContainerHandleBtn2Motion(ContainerButtonMotion)\n\ ~m ~a : ContainerHandleBtn2Up(ContainerEndTransfer)\n\ :c s a osfInsert: ContainerPrimaryLink()\n\ :c s m osfInsert: ContainerPrimaryLink()\n\ :a osfInsert: ContainerPrimaryCopy()\n\ :m osfInsert: ContainerPrimaryCopy()\n\ :s a osfDelete: ContainerPrimaryMove()\n\ :s m osfDelete: ContainerPrimaryMove()\n\ :osfCancel: ContainerCancel()\n\ :s osfSelect: ContainerExtend()\n\ :osfSelect: ContainerSelect()\n\ :osfSelectAll: ContainerSelectAll()\n\ :osfDeselectAll: ContainerDeselectAll()\n\ :osfAddMode: ContainerToggleMode()\n\ :osfActivate: ContainerActivate()\n\ s ~c ~m ~a space: ContainerExtend()\n\ ~s ~c ~m ~a space: ContainerSelect()\n\ ~s ~c ~m ~a Return: ContainerActivate()\n\ ~s c ~m ~a slash: ContainerSelectAll()\n\ ~s c ~m ~a backslash: ContainerDeselectAll()"; externaldef(translations) _XmConst char _XmContainer_traversalTranslations[] = "\ : ManagerFocusOut()\n\ : ManagerFocusIn()\n\ :c s osfBeginLine: ContainerExtendCursor(First)\n\ :c s osfEndLine: ContainerExtendCursor(Last)\n\ :c osfBeginLine: ContainerMoveCursor(First)\n\ :c osfEndLine: ContainerMoveCursor(Last)\n\ :c osfLeft: ContainerExpandOrCollapse(Left)\n\ :c osfRight: ContainerExpandOrCollapse(Right)\n\ :s osfUp: ContainerExtendCursor(Up)\n\ :s osfDown: ContainerExtendCursor(Down)\n\ :s osfLeft: ContainerExtendCursor(Left)\n\ :s osfRight: ContainerExtendCursor(Right)\n\ :osfUp: ContainerMoveCursor(Up)\n\ :osfDown: ContainerMoveCursor(Down)\n\ :osfLeft: ContainerMoveCursor(Left)\n\ :osfRight: ContainerMoveCursor(Right)\n\ s ~m ~a Tab: ManagerGadgetPrevTabGroup()\n\ ~s ~m ~a Tab: ManagerGadgetNextTabGroup()"; /*** GrabShell.c ***/ #ifdef FIX_1445 externaldef(translations) _XmConst char _XmGrabShell_translations [] = "\ : GrabShellMouseWheel()\n\ : GrabShellMouseWheel()\n\ : GrabShellMouseWheel()\n\ : GrabShellMouseWheel()\n\ : GrabShellBtnUp()\n\ : GrabShellBtnDown()"; #else externaldef(translations) _XmConst char _XmGrabShell_translations [] = "\ : GrabShellBtnUp()\n\ : GrabShellBtnDown()"; #endif /*** Notebook.c ***/ externaldef(translations) _XmConst char _XmNotebook_TabAccelerators[] = "\ \043override\n\ :c osfBeginLine: TraverseTab(Home)\n\ :osfBeginLine: TraverseTab(Home)\n\ :c osfEndLine: TraverseTab(End)\n\ :osfEndLine: TraverseTab(End)\n\ :osfUp: TraverseTab(Previous)\n\ :osfDown: TraverseTab(Next)\n\ :osfLeft: TraverseTab(Previous)\n\ :osfRight: TraverseTab(Next)\n\ "; externaldef(translations) _XmConst char _XmNotebook_manager_translations[] = "\ :c osfBeginLine: TraverseTab(Home)\n\ :osfBeginLine: TraverseTab(Home)\n\ :c osfEndLine: TraverseTab(End)\n\ :osfEndLine: TraverseTab(End)\n\ :osfUp: TraverseTab(Previous)\n\ :osfDown: TraverseTab(Next)\n\ :osfLeft: TraverseTab(Previous)\n\ :osfRight: TraverseTab(Next)\n\ :s Tab: ManagerGadgetPrevTabGroup()\n\ :Tab: ManagerGadgetNextTabGroup()\n\ : ManagerEnter()\n\ : ManagerLeave()\n\ : ManagerFocusOut()\n\ : ManagerFocusIn()\n\ "; /*** SpinB.c ***/ _XmConst char _XmSpinB_defaultTranslations[] = "\ : SpinBArm()\n\ : SpinBDisarm()\n\ : SpinBEnter()\n\ : SpinBLeave()\n\ :osfUp: SpinBNext()\n\ :osfDown: SpinBPrior()\n\ :osfLeft: SpinBLeft()\n\ :osfRight: SpinBRight()\n\ :osfUp: SpinBDisarm()\n\ :osfDown: SpinBDisarm()\n\ :osfLeft: SpinBDisarm()\n\ :osfRight: SpinBDisarm()\n\ :osfBeginLine: SpinBFirst()\n\ :osfEndLine: SpinBLast()\n\ ,: SpinBNext()SpinBDisarm()\n\ ,: SpinBPrior()SpinBDisarm()"; _XmConst char _XmSpinB_defaultAccelerators[] = "\043override\n\ osfUp: SpinBNext()\n\ osfDown: SpinBPrior()\n\ osfUp: SpinBDisarm()\n\ osfDown: SpinBDisarm()\n\ osfLeft: SpinBLeft()\n\ osfRight: SpinBRight()\n\ osfLeft: SpinBDisarm()\n\ osfRight: SpinBDisarm()\n\ osfBeginLine: SpinBFirst()\n\ osfEndLine: SpinBLast()"; /*** DataF.c **/ _XmConst char _XmDataF_EventBindings1[] = "\ :m osfPrimaryPaste:cut-primary()\n\ :a osfPrimaryPaste:cut-primary()\n\ :osfPrimaryPaste:copy-primary()\n\ :m osfCut:cut-primary()\n\ :a osfCut:cut-primary()\n\ :osfCut:cut-clipboard()\n\ :osfPaste:paste-clipboard()\n\ :m osfCopy:copy-primary()\n\ :a osfCopy:copy-primary()\n\ :osfCopy:copy-clipboard()\n\ :s osfBeginLine:beginning-of-line(extend)\n\ :osfBeginLine:beginning-of-line()\n\ :s osfEndLine:end-of-line(extend)\n\ :osfEndLine:end-of-line()\n\ :s osfPageLeft:page-left(extend)\n\ :osfPageLeft:page-left()\n\ :s cosfPageUp:page-left(extend)\n\ :c osfPageUp:page-left()\n\ :s osfPageRight:page-right(extend)\n\ :osfPageRight:page-right()\n\ :s c osfPageDown:page-right(extend)\n\ :c osfPageDown:page-right()\n\ :osfClear:clear-selection()\n\ :osfBackSpace:delete-previous-character()\n\ :s m osfDelete:cut-primary()\n\ :s a osfDelete:cut-primary()\n\ :s osfDelete:cut-clipboard()\n\ :c osfDelete:delete-to-end-of-line()\n\ :osfDelete:delete-next-character()\n"; _XmConst char _XmDataF_EventBindings2[] = "\ :c m osfInsert:copy-primary()\n\ :c a osfInsert:copy-primary()\n\ :s osfInsert:paste-clipboard()\n\ :c osfInsert:copy-clipboard()\n\ :s osfSelect:key-select()\n\ :osfSelect:set-anchor()\n\ :osfActivate:activate()\n\ :osfAddMode:toggle-add-mode()\n\ :osfHelp:Help()\n\ :osfCancel:process-cancel()\n\ :s c osfLeft:backward-word(extend)\n\ :c osfLeft:backward-word()\n\ :s osfLeft:key-select(left)\n\ :osfLeft:backward-character()\n\ :s c osfRight:forward-word(extend)\n\ :c osfRight:forward-word()\n\ :s osfRight:key-select(right)\n\ :osfRight:forward-character()\n\ :osfUp:traverse-prev()\n\ :osfDown:traverse-next()\n\ c ~m ~a slash:select-all()\n\ c ~m ~a backslash:deselect-all()\n\ s ~m ~a Tab:prev-tab-group()\n\ ~m ~a Tab:next-tab-group()\n\ ~s ~m ~a Return:activate()\n\ c ~s ~m ~a space:set-anchor()\n\ c s ~m ~a space:key-select()\n\ s ~c ~m ~a space:self-insert()\n\ :self-insert()\n"; _XmConst char _XmDataF_EventBindings3[] = "\ :unmap()\n\ :enter()\n\ :leave()\n\ :focusIn()\n\ :focusOut()\n\ ~c s ~m ~a :extend-start()\n\ c ~s ~m ~a :move-destination()\n\ ~c ~s ~m ~a :grab-focus()\n\ ~c ~m ~a :extend-adjust()\n\ ~c ~m ~a :extend-end()\n\ :process-bdrag()\n\ m ~a :secondary-adjust()\n\ ~m a :secondary-adjust()\n\ ~s :copy-to()\n\ ~c :move-to()"; _XmConst char _XmDataF_EventBindings4[] = "s ~m ~a Tab:ValidateAndMove(prev)\n\ ~m ~aTab:ValidateAndMove(next)"; motif-2.3.8/lib/Xm/ArrowBG.h0000644000175000017500000000372413145162623012402 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmArrowButtonGadget_h #define _XmArrowButtonGadget_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsArrowButtonGadget #define XmIsArrowButtonGadget(w) XtIsSubclass(w, xmArrowButtonGadgetClass) #endif /* XmIsArrowButtonGadget */ externalref WidgetClass xmArrowButtonGadgetClass; typedef struct _XmArrowButtonGadgetClassRec * XmArrowButtonGadgetClass; typedef struct _XmArrowButtonGadgetRec * XmArrowButtonGadget; /******** Public Function Declarations ********/ extern Widget XmCreateArrowButtonGadget( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern Widget XmVaCreateManagedArrowButtonGadget( Widget parent, char *name, ...); extern Widget XmVaCreateArrowButtonGadget( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmArrowButtonGadget_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Obso2_0.c0000644000175000017500000016244013066310437012276 00000000000000/* $TOG: Obso2_0.c /main/10 1998/08/18 18:59:44 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #ifndef X_NOT_STDC_ENV #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "BulletinBI.h" #include "ColorI.h" #include "ExtObjectI.h" #include "ImageCachI.h" #include "MapEventsI.h" #include "MenuStateI.h" #include "MessagesI.h" #include "PixConvI.h" #include "ReadImageI.h" #include "ResConverI.h" #include "TextOutI.h" #include "TravActI.h" #include "TraversalI.h" #include "XmI.h" /******** Static Function Declarations ********/ /******** End Static Function Declarations ********/ /* Exported variables that are now static. */ XmPrimitiveClassExtRec _XmLabelPrimClassExtRec = { NULL, NULLQUARK, 1L, sizeof(XmPrimitiveClassExtRec), NULL, NULL, NULL }; XmPrimitiveClassExtRec _XmTextPrimClassExtRec = { NULL, NULLQUARK, 1L, sizeof(XmPrimitiveClassExtRec), _XmTextGetBaselines, _XmTextGetDisplayRect, _XmTextMarginsProc }; XmPrimitiveClassExtRec _XmTextFPrimClassExtRec = { NULL, NULLQUARK, 1L, sizeof(XmPrimitiveClassExtRec), NULL, NULL, NULL }; XmGadgetClassExtRec _XmGadClassExtRec = { NULL, NULLQUARK, 1L, sizeof(XmGadgetClassExtRec), NULL, NULL }; XmGadgetClassExtRec _XmLabelGadClassExtRec = { NULL, NULLQUARK, 1L, sizeof(XmGadgetClassExtRec), NULL, NULL }; XmGadgetClassExtRec _XmPushBGadClassExtRec = { NULL, NULLQUARK, 1L, sizeof(XmGadgetClassExtRec), XmInheritBaselineProc, XmInheritDisplayRectProc }; XmGadgetClassExtRec _XmToggleBGadClassExtRec = { NULL, NULLQUARK, 1L, sizeof(XmGadgetClassExtRec), XmInheritBaselineProc, XmInheritDisplayRectProc }; /* XmWorld is defunct. */ typedef struct _XmWorldClassPart { XtPointer extension; } XmWorldClassPart; typedef struct _XmWorldClassRec { ObjectClassPart object_class; XmExtClassPart ext_class; XmDesktopClassPart desktop_class; XmWorldClassPart world_class; } XmWorldClassRec; typedef struct { int foo; } XmWorldPart; typedef struct _XmWorldRec { ObjectPart object; XmExtPart ext; XmDesktopPart desktop; XmWorldPart world; } XmWorldRec; externaldef(worldobjectclass) XmWorldClassRec xmWorldClassRec = { { (WidgetClass) &xmDesktopClassRec, /* superclass */ "World", /* class_name */ sizeof(XmWorldRec), /* size */ NULL, /* Class Initializer */ NULL, /* class_part_init */ FALSE, /* Class init'ed ? */ NULL, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ NULL, /* resources */ 0, /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ NULL, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* world_accelerator */ NULL, /* extension */ }, { /* ext */ NULL, /* synthetic resources */ 0, /* num syn resources */ NULL, /* extension */ }, { /* desktop */ (WidgetClass) &xmDisplayClassRec, /* child_class */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ } }; externaldef(worldobjectclass) WidgetClass xmWorldClass = (WidgetClass) &xmWorldClassRec; /************************************************************************ * * * _XmGetRealXlations - was global in ScrolledW.c, is now static. * * * ************************************************************************/ char * _XmGetRealXlations( Display *dpy, _XmBuildVirtualKeyStruct *keys, int num_keys ) { char *result, buf[1000]; char *tmp = buf; char *keystring; register int i; int num_vkeys; XmKeyBinding vkeys; KeySym keysym; Modifiers mods; *tmp = '\0'; for (i = 0; i < num_keys; i++) { keysym = XStringToKeysym(keys[i].key); if (keysym == NoSymbol) break; /* A virtual keysym may map to multiple real keysyms. */ num_vkeys = XmeVirtualToActualKeysyms(dpy, keysym, &vkeys); while (--num_vkeys >= 0) { keystring = XKeysymToString(vkeys[num_vkeys].keysym); if (!keystring) break; mods = vkeys[num_vkeys].modifiers | keys[i].mod; if (mods & ControlMask) strcat(tmp, "Ctrl "); if (mods & ShiftMask) strcat(tmp, "Shift "); if (mods & Mod1Mask) strcat(tmp, "Mod1 "); /* "Alt" may not be right on some systems */ strcat(tmp,""); strcat(tmp, keystring); strcat(tmp,": "); strcat(tmp,keys[i].action); tmp += strlen(tmp); assert((tmp - buf) < 1000); } XtFree((char*) vkeys); } if (buf[0] != '\0') result = XtNewString(buf); else result = NULL; return(result); } /************************************************************************ * * _XmSetEtchedSlider * Set the scrollbar variable which causes the slider pixmap * to be etched. Was in ScrollBar.c ************************************************************************/ void _XmSetEtchedSlider( XmScrollBarWidget sbw ) { XtVaSetValues((Widget) sbw, XmNsliderVisual, XmETCHED_LINE, NULL); } /********************************************************************** * * _XmSortResourceList: superceded by XmReorderResourceList * **********************************************************************/ void _XmSortResourceList( XrmResource *list[], Cardinal len ) { static Boolean first_time = TRUE; static XrmQuark unitQ; int n,i; XrmResource *p = NULL; if (first_time) { unitQ = XrmPermStringToQuark(XmNunitType); first_time = FALSE; } for (n=0; n < len; n++) if (list[n]->xrm_name == unitQ) { p = list[n]; break; } if (n == len) return; /* No unit type resource found in this list. */ else { for (i=n; i > 0; i--) list[i] = list[i-1]; list[0] = p; } } /************************************************************************ ************************************************************************ Stuff that was in Visual.c, now obsolete by the XtReOrderResourceList API. ************************************************************************/ /************************************************************************ * * _XmGetBGPixmapName * Return the background pixmap name set by the string to background * resource converter. This is used by primitive and manager. * ************************************************************************/ char * _XmGetBGPixmapName( void ) { return NULL; } /************************************************************************ * * _XmClearBGPixmapName * Clear the background pixmap name set by the string to background * resource converter. This is used by primitive and manager. * ************************************************************************/ void _XmClearBGPixmapName( void ) { /*EMPTY*/ } /**---------------------------------------------------------*/ /**---------------------------------------------------------*/ /* This code was in Visual.c, global while only localy used */ #define MESSAGE0 _XmMsgVisual_0000 #define MESSAGE1 _XmMsgVisual_0001 #define MESSAGE2 _XmMsgVisual_0002 extern Pixel _XmBlackPixel( Screen *screen, Colormap colormap, XColor blackcolor ) { Pixel p; blackcolor.red = 0; blackcolor.green = 0; blackcolor.blue = 0; if (colormap == DefaultColormapOfScreen(screen)) p = blackcolor.pixel = BlackPixelOfScreen(screen); else if (XAllocColor(screen->display, colormap, &blackcolor)) p = blackcolor.pixel; else p = blackcolor.pixel = BlackPixelOfScreen(screen); /* fallback pixel */ return (p); } extern Pixel _XmWhitePixel( Screen *screen, Colormap colormap, XColor whitecolor ) { Pixel p; whitecolor.red = XmMAX_SHORT; whitecolor.green = XmMAX_SHORT; whitecolor.blue = XmMAX_SHORT; if (colormap == DefaultColormapOfScreen(screen)) p = whitecolor.pixel = WhitePixelOfScreen(screen); else if (XAllocColor(screen->display, colormap, &whitecolor)) p = whitecolor.pixel; else p = whitecolor.pixel = WhitePixelOfScreen(screen); /* fallback pixel */ return (p); } String _XmGetDefaultBackgroundColorSpec( Screen *screen ) { XrmName names[2]; XrmClass classes[2]; XrmRepresentation rep; XrmValue db_value; String default_background_color_spec = NULL ; names[0] = XrmPermStringToQuark(XmNbackground); names[1] = NULLQUARK; classes[0] = XrmPermStringToQuark(XmCBackground); classes[1] = NULLQUARK; if (XrmQGetResource(XtScreenDatabase(screen), names, classes, &rep, &db_value)) { if (rep == XrmPermStringToQuark(XmRString)) default_background_color_spec = db_value.addr; } else default_background_color_spec = XmDEFAULT_BACKGROUND; return(default_background_color_spec); } /*ARGSUSED*/ void _XmSetDefaultBackgroundColorSpec( Screen *screen, /* unused */ String new_color_spec ) { static Boolean app_defined = FALSE; String default_background_color_spec = NULL ; if (app_defined) { XtFree(default_background_color_spec); } default_background_color_spec = (String) XtMalloc(strlen(new_color_spec) + 1); /* this needs to be set per screen */ strcpy(default_background_color_spec, new_color_spec); app_defined = TRUE; } /* * GLOBAL VARIABLES * * These variables define the color cache. */ /* Thresholds for brightness above LITE threshold, LITE color model is used below DARK threshold, DARK color model is be used use STD color model in between */ static int XmCOLOR_LITE_THRESHOLD; static int XmCOLOR_DARK_THRESHOLD; static int XmFOREGROUND_THRESHOLD; static Boolean XmTHRESHOLDS_INITD = FALSE; void _XmGetDefaultThresholdsForScreen( Screen *screen ) { XrmName names[2]; XrmClass classes[2]; XrmRepresentation rep; XrmValue db_value, to_value; int int_value; int default_light_threshold_spec; int default_dark_threshold_spec; int default_foreground_threshold_spec; WidgetRec widget; XmTHRESHOLDS_INITD = True; /* * We need a widget to pass into the XtConvertAndStore() function * to convert the string to an int. Since a widget can't be * passed into this procedure because the public interfaces * that call this routine don't have a widget, we need this hack * to create a dummy widget. */ bzero((void*) &widget, sizeof(widget) ); widget.core.self = &widget; widget.core.widget_class = coreWidgetClass; widget.core.screen = screen; XtInitializeWidgetClass(coreWidgetClass); names[0] = XrmPermStringToQuark(XmNlightThreshold); names[1] = NULLQUARK; classes[0] = XrmPermStringToQuark(XmCLightThreshold); classes[1] = NULLQUARK; if (XrmQGetResource(XtScreenDatabase(screen), names, classes, &rep, &db_value)) { /* convert the string to an int value */ to_value.size = sizeof(int); to_value.addr = (XPointer) &int_value; if (XtConvertAndStore(&widget, XmRString, &db_value, XmRInt, &to_value)) { default_light_threshold_spec = int_value; if ( (default_light_threshold_spec < 0) || (default_light_threshold_spec > 100) ) default_light_threshold_spec = XmDEFAULT_LIGHT_THRESHOLD; } else default_light_threshold_spec = XmDEFAULT_LIGHT_THRESHOLD; } else default_light_threshold_spec = XmDEFAULT_LIGHT_THRESHOLD; names[0] = XrmPermStringToQuark(XmNdarkThreshold); names[1] = NULLQUARK; classes[0] = XrmPermStringToQuark(XmCDarkThreshold); classes[1] = NULLQUARK; if (XrmQGetResource(XtScreenDatabase(screen), names, classes, &rep, &db_value)) { /* convert the string to an int value */ to_value.size = sizeof(int); to_value.addr = (XPointer) &int_value; if (XtConvertAndStore(&widget, XmRString, &db_value, XmRInt, &to_value)) { XtConvertAndStore(&widget, XmRString, &db_value, XmRInt, &to_value); default_dark_threshold_spec = int_value; if ( (default_dark_threshold_spec < 0) || (default_dark_threshold_spec > 100) ) default_dark_threshold_spec = XmDEFAULT_DARK_THRESHOLD; } else default_dark_threshold_spec = XmDEFAULT_DARK_THRESHOLD; } else default_dark_threshold_spec = XmDEFAULT_DARK_THRESHOLD; names[0] = XrmPermStringToQuark(XmNforegroundThreshold); names[1] = NULLQUARK; classes[0] = XrmPermStringToQuark(XmCForegroundThreshold); classes[1] = NULLQUARK; if (XrmQGetResource(XtScreenDatabase(screen), names, classes, &rep, &db_value)) { /* convert the string to an int value */ to_value.size = sizeof(int); to_value.addr = (XPointer) &int_value; if (XtConvertAndStore(&widget, XmRString, &db_value, XmRInt, &to_value)) { default_foreground_threshold_spec = int_value; if ( (default_foreground_threshold_spec < 0) || (default_foreground_threshold_spec > 100) ) default_foreground_threshold_spec = XmDEFAULT_FOREGROUND_THRESHOLD; } else default_foreground_threshold_spec = XmDEFAULT_FOREGROUND_THRESHOLD; } else default_foreground_threshold_spec = XmDEFAULT_FOREGROUND_THRESHOLD; XmCOLOR_LITE_THRESHOLD = default_light_threshold_spec * XmCOLOR_PERCENTILE; XmCOLOR_DARK_THRESHOLD = default_dark_threshold_spec * XmCOLOR_PERCENTILE; XmFOREGROUND_THRESHOLD = default_foreground_threshold_spec * XmCOLOR_PERCENTILE; } /********-------------------------------------- IconPixmap VendorShell stuff previously in VendorSE.c. Obsolete because XmRBitmap is now used to convert ********-------------------------------------*/ /************************************************************************ * * _XmGetIconPixmapName * Return the icon pixmap name set by the string to icon resource * converter. This is used by the vendor shell. * ************************************************************************/ char* _XmGetIconPixmapName( void ) { return NULL; } /************************************************************************ * * _XmClearIconPixmapName * Clear the icon pixmap name set by the string to icon resource * converter. This is used by the vendor shell. * ************************************************************************/ void _XmClearIconPixmapName( void ) { /*EMPTY*/ } /************************************************************************ * * * _XmInitializeScrollBars - initialize the scrollbars for auto mode. * * WAS in ScrolledW.c * ************************************************************************/ #define ScrollBarVisible( wid) (wid && XtIsManaged( wid)) void _XmInitializeScrollBars( Widget w ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) w; int i, inc; Dimension bw; Arg vSBArgs[6]; Arg hSBArgs[6]; if (sw->swindow.VisualPolicy == XmVARIABLE) return; bw = 0; if (sw->swindow.WorkWindow) bw = sw->swindow.WorkWindow->core.border_width; sw->swindow.vmin = 0; sw->swindow.vOrigin = 0; sw->swindow.hmin = 0; sw->swindow.hOrigin = 0; if (ScrollBarVisible(sw->swindow.WorkWindow)) { sw->swindow.vOrigin = abs(sw->swindow.WorkWindow->core.y); sw->swindow.vmax = sw->swindow.WorkWindow->core.height + (2 * bw); if (sw->swindow.vmax <1) sw->swindow.vmax = 1; sw->swindow.vExtent = sw->swindow.AreaHeight; if (sw->swindow.vOrigin < sw->swindow.vmin) sw->swindow.vOrigin = sw->swindow.vmin; if ((sw->swindow.vExtent + sw->swindow.vOrigin) > sw->swindow.vmax) sw->swindow.vExtent = sw->swindow.vmax - sw->swindow.vOrigin; if (sw->swindow.vExtent < 0) { sw->swindow.vExtent = sw->swindow.vmax; sw->swindow.vOrigin = sw->swindow.vmin; } sw->swindow.hmax = sw->swindow.WorkWindow->core.width + (2 * bw); if (sw->swindow.hmax <1) sw->swindow.hmax = 1; sw->swindow.hOrigin = abs(sw->swindow.WorkWindow->core.x); sw->swindow.hExtent = sw->swindow.AreaWidth; if (sw->swindow.hOrigin < sw->swindow.hmin) sw->swindow.hOrigin = sw->swindow.hmin; if ((sw->swindow.hExtent + sw->swindow.hOrigin) > sw->swindow.hmax) sw->swindow.hExtent = sw->swindow.hmax - sw->swindow.hOrigin; if (sw->swindow.hExtent < 0) { sw->swindow.hExtent = sw->swindow.hmax; sw->swindow.hOrigin = sw->swindow.hmin; } } else { sw->swindow.vExtent = (sw->swindow.ClipWindow->core.height > 0) ? sw->swindow.ClipWindow->core.height : 1; sw->swindow.hExtent = (sw->swindow.ClipWindow->core.width > 0) ? sw->swindow.ClipWindow->core.width : 1; sw->swindow.vmax = sw->swindow.vExtent; sw->swindow.hmax = sw->swindow.hExtent; } if(sw->swindow.vScrollBar) { i = 0; if (sw->swindow.WorkWindow) { if ((inc = ((sw->swindow.WorkWindow->core.height) / 10)) < 1) inc = 1; XtSetArg (vSBArgs[i], XmNincrement, (XtArgVal) inc); i++; } if ((inc = (sw->swindow.AreaHeight - (sw->swindow.AreaHeight / 10))) < 1) inc = sw->swindow.AreaHeight; XtSetArg (vSBArgs[i], XmNpageIncrement, (XtArgVal) inc); i++; XtSetArg (vSBArgs[i], XmNminimum, (XtArgVal) (sw->swindow.vmin)); i++; XtSetArg (vSBArgs[i], XmNmaximum, (XtArgVal) (sw->swindow.vmax)); i++; XtSetArg (vSBArgs[i], XmNvalue, (XtArgVal) sw->swindow.vOrigin); i++; XtSetArg (vSBArgs[i], XmNsliderSize, (XtArgVal) (sw->swindow.vExtent)); i++; assert(i <= XtNumber(vSBArgs)); XtSetValues((Widget) sw->swindow.vScrollBar,vSBArgs,i); } if(sw->swindow.hScrollBar) { i = 0; if (sw->swindow.WorkWindow) { if ((inc = ((sw->swindow.WorkWindow->core.width) / 10)) < 1) inc = 1; XtSetArg (hSBArgs[i], XmNincrement, (XtArgVal) inc); i++; } if ((inc = (sw->swindow.AreaWidth - (sw->swindow.AreaWidth / 10))) < 1) inc = sw->swindow.AreaWidth; XtSetArg (hSBArgs[i], XmNpageIncrement, (XtArgVal) inc); i++; XtSetArg (hSBArgs[i], XmNminimum, (XtArgVal) (sw->swindow.hmin)); i++; XtSetArg (hSBArgs[i], XmNmaximum, (XtArgVal) (sw->swindow.hmax)); i++; XtSetArg (hSBArgs[i], XmNvalue, (XtArgVal) sw->swindow.hOrigin); i++; XtSetArg (hSBArgs[i], XmNsliderSize, (XtArgVal) (sw->swindow.hExtent)); i++; assert(i <= XtNumber(hSBArgs)); XtSetValues((Widget) sw->swindow.hScrollBar,hSBArgs,i); } } void InitializeScrollBars( Widget w ) { _XmInitializeScrollBars( w) ; } void _XmClearBCompatibility( Widget pb ) { ((XmPushButtonWidget) pb)->pushbutton.compatible = False; } void _XmClearBGCompatibility( Widget pbg ) { PBG_Compatible (pbg) = False; } /****************************************************************/ void _XmBulletinBoardSetDefaultShadow( Widget button ) { Arg argv[2] ; Cardinal argc ; Dimension dbShadowTh = 0; Dimension shadowTh ; /****************/ if( XmIsPushButtonGadget( button) ) { _XmClearBGCompatibility( button) ; } else { if( XmIsPushButton( button) ) { _XmClearBCompatibility( button) ; } } argc = 0 ; XtSetArg( argv[argc], XmNshadowThickness, &shadowTh) ; ++argc ; XtSetArg( argv[argc], XmNdefaultButtonShadowThickness, &dbShadowTh) ; ++argc ; XtGetValues( button, argv, argc) ; if( !dbShadowTh ) { if( shadowTh > 1 ) { dbShadowTh = shadowTh >> 1 ; } else { dbShadowTh = shadowTh ; } argc = 0 ; XtSetArg( argv[argc], XmNdefaultButtonShadowThickness, dbShadowTh) ; ++argc ; XtSetValues( button, argv, argc) ; } return ; } static Widget GetBBWithDB( Widget wid) { Widget focus ; if( (_XmGetFocusPolicy( wid) == XmEXPLICIT) && ( (focus = XmGetFocusWidget( wid)) || (focus = _XmGetFirstFocus( wid))) ) { while( focus && !XtIsShell( focus) ) { if( XmIsBulletinBoard( focus) && BB_DefaultButton( focus) ) { return focus ; } focus = XtParent( focus) ; } } return NULL ; } void _XmBBUpdateDynDefaultButton( Widget bb) { Widget bbwdb = GetBBWithDB( bb) ; if( bbwdb == NULL ) { if( ((XmBulletinBoardWidget) bb) ->bulletin_board.dynamic_default_button ) { _XmBulletinBoardSetDynDefaultButton( bb, NULL) ; } } else { if( bbwdb == bb ) { _XmBulletinBoardSetDynDefaultButton( bb, BB_DefaultButton( bb)) ; } } } /********************************************************************/ Boolean _XmDifferentBackground( Widget w, Widget parent ) { if (XmIsPrimitive (w) && XmIsManager (parent)) { if (w->core.background_pixel != parent->core.background_pixel || w->core.background_pixmap != parent->core.background_pixmap) return (True); } return (False); } /******************************************************************* More Visual.c stuff not used */ static void SetMonochromeColors( XmColorData *colors ) { Screen *screen = colors->screen; Pixel background = colors->background.pixel; if (background == BlackPixelOfScreen(screen)) { colors->foreground.pixel = WhitePixelOfScreen (screen); colors->foreground.red = colors->foreground.green = colors->foreground.blue = XmMAX_SHORT; colors->bottom_shadow.pixel = WhitePixelOfScreen(screen); colors->bottom_shadow.red = colors->bottom_shadow.green = colors->bottom_shadow.blue = XmMAX_SHORT; colors->select.pixel = WhitePixelOfScreen(screen); colors->select.red = colors->select.green = colors->select.blue = XmMAX_SHORT; colors->top_shadow.pixel = BlackPixelOfScreen(screen); colors->top_shadow.red = colors->top_shadow.green = colors->top_shadow.blue = 0; } else if (background == WhitePixelOfScreen(screen)) { colors->foreground.pixel = BlackPixelOfScreen(screen); colors->foreground.red = colors->foreground.green = colors->foreground.blue = 0; colors->top_shadow.pixel = WhitePixelOfScreen(screen); colors->top_shadow.red = colors->top_shadow.green = colors->top_shadow.blue = XmMAX_SHORT; colors->bottom_shadow.pixel = BlackPixelOfScreen(screen); colors->bottom_shadow.red = colors->bottom_shadow.green = colors->bottom_shadow.blue = 0; colors->select.pixel = BlackPixelOfScreen(screen); colors->select.red = colors->select.green = colors->select.blue = 0; } colors->allocated |= (XmFOREGROUND | XmTOP_SHADOW | XmBOTTOM_SHADOW | XmSELECT); } /* This one still used by mwm: fix mwm */ /********************************************************************* * * _XmGetColors * *********************************************************************/ XmColorData * _XmGetColors( Screen *screen, Colormap color_map, Pixel background ) { Display * display = DisplayOfScreen (screen); XmColorData *old_colors; XmColorData new_colors; XmColorProc ColorRGBCalcProc ; new_colors.screen = screen; new_colors.color_map = color_map; new_colors.background.pixel = background; if (_XmSearchColorCache( (XmLOOK_AT_SCREEN | XmLOOK_AT_CMAP | XmLOOK_AT_BACKGROUND), &new_colors, &old_colors)) { /* * initialize the thresholds if the current color scheme * already matched what is in the cache and the thresholds * haven't already been initialized. */ if (!XmTHRESHOLDS_INITD) _XmGetDefaultThresholdsForScreen(screen); return(old_colors); } XQueryColor (display, color_map, &(new_colors.background)); new_colors.allocated = XmBACKGROUND; /* * Just in case somebody looks at these before they're ready, * initialize them to a value that is always valid (for most * implementations of X). */ new_colors.foreground.pixel = 0; new_colors.top_shadow.pixel = 0; new_colors.top_shadow.pixel = 0; new_colors.select.pixel = 0; /* Generate the foreground, top_shadow, and bottom_shadow based */ /* on the background */ if (DefaultDepthOfScreen(screen) == 1) SetMonochromeColors(&new_colors); else { _XmGetDefaultThresholdsForScreen(screen); ColorRGBCalcProc = XmGetColorCalculation() ; (*ColorRGBCalcProc)(&(new_colors.background), &(new_colors.foreground), &(new_colors.select), &(new_colors.top_shadow), &(new_colors.bottom_shadow)); } return (_XmAddToColorCache(&new_colors)); } XmColorData * _XmGetDefaultColors( Screen *screen, Colormap color_map ) { static XmColorData ** default_set = NULL; static int default_set_count = 0; static int default_set_size = 0; register int i; XColor color_def; static Pixel background; XrmValue fromVal; XrmValue toVal; XrmValue args[2]; Cardinal num_args; String default_string = XtDefaultBackground; /* Look through a set of screen / background pairs to see */ /* if the default is already in the table. */ for (i = 0; i < default_set_count; i++) { if ((default_set[i]->screen == screen) && (default_set[i]->color_map == color_map)) return (default_set[i]); } /* See if more space is needed in the array */ if (default_set == NULL) { default_set_size = 10; default_set = (XmColorData **) XtRealloc((char *) default_set, (sizeof(XmColorData *) * default_set_size)); } else if (default_set_count == default_set_size) { default_set_size += 10; default_set = (XmColorData **) XtRealloc((char *) default_set, sizeof(XmColorData *) * default_set_size); } /* Find the background based on the depth of the screen */ if (DefaultDepthOfScreen(screen) == 1) { /* * Fix for 4603 - Convert the string XtDefaultBackground into a Pixel * value using the XToolkit converter. This converter * will set this value to WhitePixelOfScreen if reverse * video is not on, and to BlackPixelOfScreen if reverse * video is on. */ args[0].addr = (XPointer) &screen; args[0].size = sizeof(Screen*); args[1].addr = (XPointer) &color_map; args[1].size = sizeof(Colormap); num_args = 2; fromVal.addr = default_string; fromVal.size = strlen(default_string); toVal.addr = (XPointer) &background; toVal.size = sizeof(Pixel); if(!XtCallConverter(DisplayOfScreen(screen),XtCvtStringToPixel, args, num_args, &fromVal, &toVal, NULL)) background = WhitePixelOfScreen(screen); } else { /* Parse out a color for the default background */ if (XParseColor(DisplayOfScreen(screen), color_map, _XmGetDefaultBackgroundColorSpec(screen), &color_def)) { if (XAllocColor(DisplayOfScreen(screen), color_map, &color_def)) { background = color_def.pixel; } else { XtWarning(MESSAGE1); background = WhitePixelOfScreen(screen); } } else { XtWarning(MESSAGE2); background = WhitePixelOfScreen(screen); } } /* * Get the color data generated and save it in the next open * slot in the default set array. default_set points to a subset * of the data pointed to by color_set (defined in _XmGetColors). */ default_set[default_set_count] = _XmGetColors(screen, color_map, background); default_set_count++; return (default_set[default_set_count - 1]); } static int _XmBrightness( XColor *color ) { int brightness; int intensity; int light; int luminosity, maxprimary, minprimary; int red = color->red; int green = color->green; int blue = color->blue; intensity = (red + green + blue) / 3; /* * The casting nonsense below is to try to control the point at * the truncation occurs. */ luminosity = (int) ((XmRED_LUMINOSITY * (float) red) + (XmGREEN_LUMINOSITY * (float) green) + (XmBLUE_LUMINOSITY * (float) blue)); maxprimary = ( (red > green) ? ( (red > blue) ? red : blue ) : ( (green > blue) ? green : blue ) ); minprimary = ( (red < green) ? ( (red < blue) ? red : blue ) : ( (green < blue) ? green : blue ) ); light = (minprimary + maxprimary) / 2; brightness = ( (intensity * XmINTENSITY_FACTOR) + (light * XmLIGHT_FACTOR) + (luminosity * XmLUMINOSITY_FACTOR) ) / 100; return(brightness); } /* This one still used by mwm: fix mwm */ Pixel _XmAccessColorData( XmColorData *cd, #if NeedWidePrototypes unsigned int which ) #else unsigned char which ) #endif /* NeedWidePrototypes */ { Pixel p; switch(which) { case XmBACKGROUND: if (!(cd->allocated & which) && (XAllocColor(cd->screen->display, cd->color_map, &(cd->background)) == 0)) { if (_XmBrightness(&(cd->background)) < XmFOREGROUND_THRESHOLD ) cd->background.pixel = _XmBlackPixel(cd->screen, cd->color_map, cd->background); else cd->background.pixel = _XmWhitePixel(cd->screen, cd->color_map, cd->background); XQueryColor(cd->screen->display, cd->color_map, &(cd->background)); } p = cd->background.pixel; cd->allocated |= which; break; case XmFOREGROUND: if (!(cd->allocated & which) && (XAllocColor(cd->screen->display, cd->color_map, &(cd->foreground)) == 0 )) { if (_XmBrightness(&(cd->background)) < XmFOREGROUND_THRESHOLD ) cd->foreground.pixel = _XmWhitePixel(cd->screen, cd->color_map, cd->foreground); else cd->foreground.pixel = _XmBlackPixel(cd->screen, cd->color_map, cd->foreground); XQueryColor(cd->screen->display, cd->color_map, &(cd->foreground)); } p = cd->foreground.pixel; cd->allocated |= which; break; case XmTOP_SHADOW: if (!(cd->allocated & which) && (XAllocColor(cd->screen->display, cd->color_map, &(cd->top_shadow)) == 0)) { if (_XmBrightness(&(cd->background)) > XmCOLOR_LITE_THRESHOLD) cd->top_shadow.pixel = _XmBlackPixel(cd->screen, cd->color_map, cd->top_shadow); else cd->top_shadow.pixel = _XmWhitePixel(cd->screen, cd->color_map, cd->top_shadow); XQueryColor(cd->screen->display, cd->color_map, &(cd->top_shadow)); } p = cd->top_shadow.pixel; cd->allocated |= which; break; case XmBOTTOM_SHADOW: if (!(cd->allocated & which) && (XAllocColor(cd->screen->display, cd->color_map, &(cd->bottom_shadow)) == 0)) { if (_XmBrightness(&(cd->background)) < XmCOLOR_DARK_THRESHOLD) cd->bottom_shadow.pixel = _XmWhitePixel(cd->screen, cd->color_map, cd->bottom_shadow); else cd->bottom_shadow.pixel = _XmBlackPixel(cd->screen, cd->color_map, cd->bottom_shadow); XQueryColor(cd->screen->display, cd->color_map, &(cd->bottom_shadow)); } p = cd->bottom_shadow.pixel; cd->allocated |= which; break; case XmSELECT: if (!(cd->allocated & which) && (XAllocColor(cd->screen->display, cd->color_map, &(cd->select)) == 0)) { if (_XmBrightness(&(cd->background)) < XmFOREGROUND_THRESHOLD) cd->select.pixel = _XmWhitePixel(cd->screen, cd->color_map, cd->select); else cd->select.pixel = _XmBlackPixel(cd->screen, cd->color_map, cd->select); XQueryColor(cd->screen->display, cd->color_map, &(cd->select)); } p = cd->select.pixel; cd->allocated |= which; break; default: XtWarning(MESSAGE0); p = _XmBlackPixel(cd->screen, cd->color_map, cd->background); break; } return(p); } /* OBSOLETE: Replaced by _XmMapKeyEvents. */ Boolean _XmMapKeyEvent( register String str, int *eventType, unsigned int *keysym, unsigned int *modifiers ) { int count; int *all_types; KeySym *all_keys; unsigned int *all_mods; /* Initialize the return parameters. */ *eventType = 0; *keysym = 0; *modifiers = 0; /* Convert the string to a list of keysyms. */ count = _XmMapKeyEvents(str, &all_types, &all_keys, &all_mods); /* The old implementation ignored trailing garbage. */ if (count > 0) { *eventType = *all_types; *keysym = *all_keys; *modifiers = *all_mods; } XtFree((char*) all_types); XtFree((char*) all_keys); XtFree((char*) all_mods); return (count > 0); } void XmRegisterConverters() { _XmRegisterConverters() ; } /************************************************************************ * * _XmGetImageAndHotSpotFromFile * Given a filename, extract and create an image from the file data. * ************************************************************************/ XImage * _XmGetImageAndHotSpotFromFile( char *filename, int *hot_x, int *hot_y) { return _XmReadImageAndHotSpotFromFile(_XmGetDefaultDisplay(), filename, hot_x, hot_y) ; } /************************************************************************ * * _XmGetImageFromFile * Given a filename, extract and create an image from the file data. * ************************************************************************/ XImage * _XmGetImageFromFile( char *filename ) { int hot_x, hot_y; return _XmReadImageAndHotSpotFromFile(_XmGetDefaultDisplay(), filename, &hot_x, &hot_y) ; } Boolean _XmFocusIsInShell( Widget wid) { /* CR 7568: Actually return the value. */ return XmeFocusIsInShell(wid); } void _XmSleep( unsigned int secs) { sleep( secs) ; } int _XmOSPutenv( char *string) { #ifndef NO_PUTENV return (putenv(string)); #else char *value; if ((value = strchr(string, '=')) != NULL) { char *name = XtNewString(string); int result; name[value-string] = '\0'; result = setenv(name, value+1, 1); XtFree(name); return result; } else return -1; #endif } /* after rework of inheritance of class extension method */ externaldef(xmprimbaseclassextrec) XmBaseClassExtRec _XmPrimbaseClassExtRec = { 0 }; externaldef(xmprimclassextrec) XmPrimitiveClassExtRec _XmPrimClassExtRec = { 0 }; externaldef(xmdrawnbprimclassextrec) XmPrimitiveClassExtRec _XmDrawnBPrimClassExtRec = { 0 }; externaldef(xmtogglebprimclassextrec) XmPrimitiveClassExtRec _XmToggleBPrimClassExtRec = { 0 }; externaldef(xmpushbprimclassextrec) XmPrimitiveClassExtRec _XmPushBPrimClassExtRec = { 0 }; externaldef(xmcascadebprimclassextrec) XmPrimitiveClassExtRec _XmCascadeBPrimClassExtRec = { 0 }; externaldef(xmtearoffbprimclassextrec) XmPrimitiveClassExtRec _XmTearOffBPrimClassExtRec = { 0 }; /* From old Visual.c */ void _XmPrimitiveTopShadowPixmapDefault( Widget widget, int offset, XrmValue *value ) { _XmTopShadowPixmapDefault(widget, offset, value ); } void _XmManagerTopShadowPixmapDefault( Widget widget, int offset, XrmValue *value ) { _XmTopShadowPixmapDefault(widget, offset, value ); } void _XmPrimitiveHighlightPixmapDefault( Widget widget, int offset, XrmValue *value ) { _XmHighlightPixmapDefault(widget, offset, value ); } void _XmManagerHighlightPixmapDefault( Widget widget, int offset, XrmValue *value ) { _XmHighlightPixmapDefault(widget, offset, value ); } /************************************************************************ * * _XmFilterResources * ************************************************************************/ Cardinal _XmFilterResources( XtResource *resources, Cardinal numResources, WidgetClass filterClass, XtResource **filteredResourcesRtn ) { XtResource *filteredResources; Cardinal copyIndexes[256]; Cardinal filterOffset; Cardinal i, j; filterOffset = filterClass->core_class.widget_size; for (i = 0, j = 0; i < numResources; i++) { if (resources[i].resource_offset >= filterOffset) { copyIndexes[j++] = i; } } filteredResources = (XtResource *) XtMalloc(j * sizeof(XtResource)); for (i = 0; i < j; i++) { filteredResources[i] = resources[copyIndexes[i]]; } *filteredResourcesRtn = filteredResources; return j; } /************************************************************************ * * _XmRootGeometryManager * ************************************************************************/ /*ARGSUSED*/ XtGeometryResult _XmRootGeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XmWidgetExtData extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION); XmShellExtObject se = (XmShellExtObject)extData->widget; XtGeometryHandler wmGeoHandler; ShellWidgetClass swc = (ShellWidgetClass)wmShellWidgetClass; ShellClassExtensionRec **scExtPtr; XtGeometryResult returnVal = XtGeometryNo; WMShellWidget wmShell = (WMShellWidget)w; if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return XtGeometryNo; } if (se) { se->shell.lastConfigureRequest = NextRequest(XtDisplay(w)); } #ifdef DEBUG else XtError("no extension object"); #endif /* DEBUG */ scExtPtr = (ShellClassExtensionRec **) _XmGetClassExtensionPtr( (XmGenericClassExt *) &(swc->shell_class.extension), NULLQUARK); if (request->request_mode & XtCWQueryOnly) { if (!(wmShell->shell.allow_shell_resize) && (request->request_mode & (CWWidth | CWHeight | CWBorderWidth))) return XtGeometryNo; /* * we should switch on useAsyncGeometry but we won't ||| */ else return XtGeometryYes; } if (se->shell.useAsyncGeometry) { /* make wait_for_wm = FALSE to force desired behaviour */ wmShell->wm.wait_for_wm = FALSE; /* FIX for 1684: remove the timeout = 0 line, not needed and introduced a bug if not saved/restore together with useAsync change - wait_for_wm will be later reset by Shell in Xt */ } if ((wmGeoHandler = (*scExtPtr)->root_geometry_manager) != NULL) { returnVal = (*wmGeoHandler)(w, request, reply); if (se->shell.useAsyncGeometry) { /* X configure was sent to the server, while this is happening, let's everybody think it's a success (which is true most of the time): set the shell size to what it wants to be and return Yes */ if (request->request_mode & CWWidth) w->core.width = request->width; if (request->request_mode & CWHeight) w->core.height = request->height ; if (request->request_mode & CWBorderWidth) w->core.border_width = request->border_width ; if (request->request_mode & CWX) w->core.x = request->x; if (request->request_mode & CWY) w->core.y = request->y; returnVal = XtGeometryYes; } } return returnVal; } /*ARGSUSED*/ void _XmVendorExtRealize( Widget w, XtPointer closure, /* unused */ XtPointer call_data ) /* unused */ { XtWarning("Don't use _XmVendorExtRealize! It does nothing."); } /********************** Stuff from Desktop.c **********************/ static XContext actualClassContext = (XContext) NULL; /*ARGSUSED*/ static void DisplayDestroyCallback ( Widget w, XtPointer client_data, XtPointer call_data ) /* unused */ { XDeleteContext(XtDisplay(w), (XID) client_data, actualClassContext); } /************************************************************************ * * _XmGetActualClass * ************************************************************************/ /* ARGSUSED */ WidgetClass _XmGetActualClass( Display *display, WidgetClass w_class ) { WidgetClass actualClass; if (actualClassContext == (XContext) NULL) actualClassContext = XUniqueContext(); /* * see if a non-default class has been specified for the * class */ if (XFindContext(display, (Window) w_class, actualClassContext, (char **) &actualClass)) { return w_class; } else return actualClass; } /************************************************************************ * * _XmSetActualClass * ************************************************************************/ /* ARGSUSED */ void _XmSetActualClass( Display *display, WidgetClass w_class, WidgetClass actualClass ) { XmDisplay dd = (XmDisplay) XmGetXmDisplay(display); WidgetClass previous; WidgetClass oldActualClass; if (actualClassContext == (XContext) NULL) actualClassContext = XUniqueContext(); /* * see if a non-default class has been specified for the * class */ previous = _XmGetActualClass(display, w_class); XtRemoveCallback((Widget)dd, XtNdestroyCallback, DisplayDestroyCallback, (XtPointer) previous); /* * Save class data. * Delete old context if one exists. */ if (XFindContext (display, (Window) w_class, actualClassContext, (char **)&oldActualClass)) { XSaveContext(display, (Window) w_class, actualClassContext, (char *) actualClass); } else if (oldActualClass != actualClass) { XDeleteContext (display, (Window) w_class, actualClassContext); XSaveContext(display, (Window) w_class, actualClassContext, (char *) actualClass); } XtAddCallback((Widget)dd, XtNdestroyCallback, DisplayDestroyCallback, (XtPointer) w_class); } /************************************************************************ * * _XmGetWorldObject * ************************************************************************/ /* ARGSUSED */ XmDesktopObject _XmGetWorldObject( Widget shell, ArgList args, Cardinal *num_args ) { XmDesktopObject worldObject; static XContext worldObjectContext = (XContext) NULL; XmWidgetExtData ext; Display *display; /* ** Note: in an ideal World we would be sure to delete this context when ** the display is closed, so that we don't get bad data if a second ** display with the same id is opened. */ if (worldObjectContext == (XContext) NULL) worldObjectContext = XUniqueContext(); display = XtDisplayOfObject(shell); if (XFindContext(display, (Window) NULL, worldObjectContext, (char **) &worldObject)) { WidgetClass worldClass; Widget appShell = shell; worldClass = _XmGetActualClass(display, xmDesktopClass); while (XtParent(appShell)) appShell = XtParent(appShell); worldObject = (XmDesktopObject) XtCreateWidget("world", worldClass, appShell, args, num_args ? *num_args: 0); ext = _XmGetWidgetExtData(worldObject->ext.logicalParent, worldObject->ext.extensionType); if(ext != NULL) { _XmExtObjFree((XtPointer) ext->reqWidget); ext->reqWidget = NULL; } #ifdef DEBUG else { XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); } #endif XSaveContext(display, (Window) NULL, worldObjectContext, (char *) worldObject); } return worldObject; } /************************************************************************ * * _XmVirtKeysHandler * ************************************************************************/ /*ARGSUSED*/ void _XmVirtKeysHandler(Widget widget, XtPointer client_data, XEvent *event, Boolean *dontSwallow ) { if (widget->core.being_destroyed) { *dontSwallow = False; return; } } /**************************************************************** * * TextOut.c functions * ****************************************************************/ /* ARGSUSED */ void _XmTextDrawDestination(XmTextWidget tw) { /* DEPRECATED */ } /* ARGSUSED */ void _XmTextClearDestination(XmTextWidget tw, #if NeedWidePrototypes int ignore_sens) #else Boolean ignore_sens) #endif /* NeedWidePrototypes */ { /* DEPRECATED */ } /* ARGSUSED */ void _XmTextDestinationVisible(Widget w, #if NeedWidePrototypes int turn_on) #else Boolean turn_on) #endif /* NeedWidePrototypes */ { /* DEPRECATED */ } /**************************************************************** * * TextStrSo.c functions * ****************************************************************/ Boolean _XmStringSourceFindString(Widget w, XmTextPosition start, char* string, XmTextPosition *position) { return(XmTextFindString(w, start, string, XmTEXT_FORWARD, position)); } /**************************************************************** * * TextIn.c functions * ****************************************************************/ XmTextPosition _XmTextGetAnchor(XmTextWidget tw) { InputData data = tw->text.input->data; return(data->anchor); } /**************************************************************** * * Traversal.c functions * ****************************************************************/ /*ARGSUSED*/ Boolean _XmGrabTheFocus( Widget w, XEvent *event ) /* unused */ { /* Function used by TextEdit widgets to grab the focus. */ return _XmMgrTraversal( w, XmTRAVERSE_CURRENT) ; } /*ARGSUSED*/ void _XmProcessTraversal( Widget w, XmTraversalDirection dir, #if NeedWidePrototypes int check ) /* unused */ #else Boolean check ) /* unused */ #endif /* NeedWidePrototypes */ { _XmMgrTraversal( w, dir ) ; } Widget _XmFindNextTabGroup( Widget wid ) { return _XmNavigate( wid, XmTRAVERSE_NEXT_TAB_GROUP) ; } Widget _XmFindPrevTabGroup( Widget wid ) { return _XmNavigate( wid, XmTRAVERSE_PREV_TAB_GROUP) ; } Boolean _XmCreateVisibilityRect(Widget w, XRectangle *rectPtr) { return _XmComputeVisibilityRect(w, rectPtr, FALSE, TRUE); } /**************************************************************** * * MenuShell.c functions * ****************************************************************/ void _XmSetLastManagedMenuTime ( Widget wid, Time newTime ) { _XmGetMenuState((Widget)wid)->MS_LastManagedMenuTime = newTime; } /**************************************************************** * * XmString.c functions * ****************************************************************/ /* * count the number of lines in an _XmString. */ int _XmStringLineCount( _XmString string ) { return(XmStringLineCount(string)); } /* Used to create internal XmString, now just copies. */ _XmString _XmStringCreate( XmString cs ) { return((_XmString)XmStringCopy(cs)); } /* Used to create external XmString from internal, now just copies. */ /*ARGSUSED*/ XmString _XmStringCreateExternal( XmRenderTable rendertable, /* unused */ _XmString cs ) { return(XmStringCopy((XmString)cs)); } Boolean _XmStringEmpty( _XmString string ) { return(XmStringEmpty(string)); } void _XmStringFree( _XmString string ) { XmStringFree(string); } /* * find total height of XmString */ Dimension _XmStringHeight( XmRenderTable rendertable, _XmString string ) { if (!string || !rendertable) return (0); return(XmStringHeight(rendertable, string)); } /* * find the rectangle which will enclose the text */ void _XmStringExtent( XmRenderTable rendertable, _XmString string, Dimension *width, Dimension *height ) { if (!string || !rendertable) { *width = 0; *height = 0; return; } XmStringExtent(rendertable, string, width, height); } /* * find width of widest line in XmString */ Dimension _XmStringWidth( XmRenderTable rendertable, _XmString string ) { if (!string || !rendertable) return (0); return(XmStringWidth(rendertable, string)); } void _XmStringDraw( Display *d, Window w, XmRenderTable rendertable, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip ) { XmStringDraw(d, w, rendertable, string, gc, x, y, width, align, lay_dir, clip); } void _XmStringDrawImage( Display *d, Window w, XmRenderTable rendertable, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip ) { XmStringDrawImage(d, w, rendertable, string, gc, x, y, width, align, lay_dir, clip); } void _XmStringDrawUnderline( Display *d, Window w, XmRenderTable f, _XmString s, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, _XmString u ) { XmStringDrawUnderline(d, w, f, s, gc, x, y, width, align, lay_dir, clip, u); } void _XmStringDrawMnemonic( Display *d, Window w, XmRenderTable rendertable, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, String mnemonic, XmStringTag tag ) { XmString underline; underline = XmStringCreate(mnemonic, tag); XmStringDrawUnderline(d, w, rendertable, string, gc, x, y, width, align, lay_dir, clip, underline); XmStringFree(underline); } /* * internal structure access routines */ Boolean _XmStringInitContext( _XmStringContext *context, _XmString string ) { return(XmStringInitContext(context, string)); } void _XmStringFreeContext( _XmStringContext context ) { XmStringFreeContext(context); } _XmString _XmStringCopy( _XmString string ) { if (string == (_XmString) NULL) return ((_XmString) NULL); else return((_XmString)XmStringCopy(string)); } /* * check these two internals */ Boolean _XmStringByteCompare( _XmString a, _XmString b ) { if (!a && !b) return(TRUE); if (!a || !b) return(FALSE); return(XmStringByteCompare(a, b)); } Dimension _XmStringBaseline( XmRenderTable rendertable, _XmString string ) { if (!string || !rendertable) return (0); return(XmStringBaseline(rendertable, string)); } Boolean _XmStringHasSubstring( _XmString string, _XmString substring ) { if ((string == NULL) || (substring == NULL) || (XmStringEmpty(substring))) return (FALSE); return(XmStringHasSubstring(string, substring)); } /* Replaced by XmTextGetInsertionPosition */ XmTextPosition XmTextGetCursorPosition(Widget widget) { if (XmIsTextField(widget)) return(XmTextFieldGetCursorPosition(widget)); else { return(XmTextGetInsertionPosition(widget)); } } /* Replaced by XmTextSetInsertionPosition */ void XmTextSetCursorPosition(Widget widget, XmTextPosition position) { if (XmIsTextField(widget)) XmTextFieldSetCursorPosition(widget, position); else { XmTextSetInsertionPosition(widget, position); } } /* Replaced by XmTextFieldSetInsertionPosition */ void XmTextFieldSetCursorPosition(Widget w, XmTextPosition position) { XmTextFieldSetInsertionPosition(w, position); } /* Replaced by XmTextFieldGetInsertionPosition */ XmTextPosition XmTextFieldGetCursorPosition(Widget w) { return XmTextFieldGetInsertionPosition(w); } /**************************************************************** * * TravAct.c functions * ****************************************************************/ /* * Get the state of the 'ResettingFocus' flag, based upon the * display to which the widget is tied. */ Boolean _XmGetFocusResetFlag( Widget w ) { return( (Boolean) _XmGetFocusFlag(w, XmFOCUS_RESET) ); } /* * Set the state of the 'ResettingFocus' flag. */ void _XmSetFocusResetFlag( Widget w, #if NeedWidePrototypes int value ) #else Boolean value ) #endif /* NeedWidePrototypes */ { _XmSetFocusFlag(w, XmFOCUS_RESET, value); } /********************************************************************/ /*ARGSUSED*/ void _XmStringUpdate(XmFontList fontlist, /* unused */ _XmString string ) /* unused */ { /*EMPTY*/ } /* From BaseClass.c */ /*ARGSUSED*/ void _XmFreeWidgetExtData( Widget widget ) /* unused */ { /*EMPTY*/ } /*ARGSUSED*/ void _XmBaseClassPartInitialize( WidgetClass wc ) /* unused */ { /*EMPTY*/ } Boolean _XmIsSlowSubclass( WidgetClass wc, unsigned int bit ) { XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if (!wcePtr || !(*wcePtr)) return False; if ((_XmGetFlagsBit((*wcePtr)->flags, bit)) != 0) return True; else return False; } Boolean _XmIsStandardMotifWidgetClass( WidgetClass wc) { /* This routine depends on ALL standard Motif classes use fast subclassing. */ XmBaseClassExt * fastPtr; XmBaseClassExt * superFastPtr; WidgetClass super_wc = wc->core_class.superclass; if ((fastPtr = _XmGetBaseClassExtPtr( wc, XmQmotif)) && *fastPtr) { if (!(superFastPtr = _XmGetBaseClassExtPtr( super_wc, XmQmotif))) { /* This catches all Motif classes which are direct subclasses * of an Xt Intrinsics widget class. */ return TRUE; } if (*superFastPtr) { unsigned char * flags = (*fastPtr)->flags; unsigned char * superFlags = (*superFastPtr)->flags; unsigned numBytes = (XmLAST_FAST_SUBCLASS_BIT >> 3) + 1; unsigned Index; Index = numBytes; while (Index--) { if (flags[Index] != superFlags[Index]) { /* Since all Motif classes use fast subclassing, the fast * subclassing bits of any standard Motif class will be * different than those of its superclass (the superclass * will have one less bit set). Any non-standard Motif * subclass will have the same fast subclass bits as its * superclass. */ return TRUE; } } } } return FALSE; } /** Obsolete from ImageCache.c */ Pixmap _XmGetPixmap( Screen *screen, char *image_name, int depth, Pixel foreground, Pixel background) { return(XmGetPixmapByDepth(screen, image_name, foreground, background, depth)); } Boolean _XmInstallPixmap( Pixmap pixmap, Screen *screen, char *image_name, Pixel foreground, Pixel background ) { return _XmCachePixmap(pixmap, screen, image_name, foreground, background, 0, 0, 0); } motif-2.3.8/lib/Xm/ToggleBGP.h0000644000175000017500000001752513145162623012655 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /******************************************** * * No new fields need to be defined * for the Toggle widget class record * ********************************************/ #ifndef _XmToggleButtonGP_h #define _XmToggleButtonGP_h #include #include #ifdef __cplusplus extern "C" { #endif /*************************************************************/ /* The ToggleButton Gadget Cache Object's class and instance records*/ /*************************************************************/ typedef struct _XmToggleButtonGCacheObjClassPart { int foo; } XmToggleButtonGCacheObjClassPart; typedef struct _XmToggleButtonGCacheObjClassRec { ObjectClassPart object_class; XmExtClassPart ext_class; XmLabelGCacheObjClassPart label_class_cache; XmToggleButtonGCacheObjClassPart toggle_class_cache; } XmToggleButtonGCacheObjClassRec; externalref XmToggleButtonGCacheObjClassRec xmToggleButtonGCacheObjClassRec; typedef struct _XmToggleButtonGCacheObjPart { unsigned char ind_type; Boolean visible; Dimension spacing; Dimension indicator_dim; Pixmap on_pixmap; Pixmap insen_pixmap; unsigned char ind_on; Boolean fill_on_select; Pixel select_color; GC select_GC; GC background_gc; GC arm_GC; /* used in menus when enableEtchedInMenu is set. */ unsigned char toggle_mode; Boolean reversed_select; Pixmap indeterminate_pixmap; Pixmap indeterminate_insensitive_pixmap; Pixel unselect_color; GC unselect_GC; GC indeterminate_GC; GC indeterminate_box_GC; Dimension ind_left_delta; Dimension ind_right_delta; Dimension ind_top_delta; Dimension ind_bottom_delta; } XmToggleButtonGCacheObjPart; typedef struct _XmToggleButtonGCacheObjRec { ObjectPart object; XmExtPart ext; XmLabelGCacheObjPart label_cache; XmToggleButtonGCacheObjPart toggle_cache; } XmToggleButtonGCacheObjRec; /**************************************************** * * Full class record declaration for Toggle class * ****************************************************/ typedef struct _XmToggleButtonGadgetClassPart { XtPointer extension; } XmToggleButtonGadgetClassPart; typedef struct _XmToggleButtonGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmLabelGadgetClassPart label_class; XmToggleButtonGadgetClassPart toggle_class; } XmToggleButtonGadgetClassRec; externalref XmToggleButtonGadgetClassRec xmToggleButtonGadgetClassRec; typedef struct _XmToggleButtonGadgetPart { Boolean indicator_set; unsigned char set; unsigned char visual_set; /* used for visuals and does not reflect the true state of the button */ Boolean Armed; XtCallbackList value_changed_CB, arm_CB, disarm_CB; XmToggleButtonGCacheObjPart *cache; /* Replace cache instance fields */ /* with a pointer */ Dimension detail_shadow_thickness ; } XmToggleButtonGadgetPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmToggleButtonGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmLabelGadgetPart label; XmToggleButtonGadgetPart toggle; } XmToggleButtonGadgetRec; /**********/ /* MACROS */ /**********/ /* Macros for cached instance fields */ #define TBG_IndType(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->ind_type) #define TBG_Visible(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->visible) #define TBG_Spacing(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->spacing) #define TBG_IndicatorDim(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->indicator_dim) #define TBG_OnPixmap(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->on_pixmap) #define TBG_InsenPixmap(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->insen_pixmap) #define TBG_IndOn(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->ind_on) #define TBG_FillOnSelect(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->fill_on_select) #define TBG_ReversedSelect(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->reversed_select) #define TBG_SelectColor(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->select_color) #define TBG_SelectGC(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->select_GC) #define TBG_BackgroundGC(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->background_gc) #define TBG_ArmGC(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->arm_GC) #define TBG_ToggleMode(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->toggle_mode) #define TBG_IndeterminatePixmap(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->indeterminate_pixmap) #define TBG_IndeterminateInsensitivePixmap(w) \ (((XmToggleButtonGadget) (w)) -> \ toggle.cache->indeterminate_insensitive_pixmap) #define TBG_IndeterminateGC(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->indeterminate_GC) #define TBG_IndeterminateBoxGC(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->indeterminate_box_GC) #define TBG_UnselectColor(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->unselect_color) #define TBG_UnselectGC(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->unselect_GC) #define TBG_IndLeftDelta(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->ind_left_delta) #define TBG_IndRightDelta(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->ind_right_delta) #define TBG_IndTopDelta(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->ind_top_delta) #define TBG_IndBottomDelta(w) \ (((XmToggleButtonGadget) (w)) -> toggle.cache->ind_bottom_delta) /***************************************/ /* Macros for uncached instance fields */ #define TBG_IndicatorSet(w) \ (((XmToggleButtonGadget) (w)) -> toggle.indicator_set) #define TBG_Set(w) \ (((XmToggleButtonGadget) (w)) -> toggle.set) #define TBG_VisualSet(w) \ (((XmToggleButtonGadget) (w)) -> toggle.visual_set) #define TBG_ValueChangedCB(w) \ (((XmToggleButtonGadget) (w)) -> toggle.value_changed_CB) #define TBG_ArmCB(w) \ (((XmToggleButtonGadget) (w)) -> toggle.arm_CB) #define TBG_DisarmCB(w) \ (((XmToggleButtonGadget) (w)) -> toggle.disarm_CB) #define TBG_Armed(w) \ (((XmToggleButtonGadget) (w)) -> toggle.Armed) /******************************/ /* Convenience Macros */ /******************************/ #define TBG_Cache(w) (((XmToggleButtonGadget)(w))->toggle.cache) #define TBG_ClassCachePart(w) \ (((XmToggleButtonGadgetClass)xmToggleButtonGadgetClass)->gadget_class.cache_part) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmToggleButtonGP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TabBox.h0000644000175000017500000000330612672140200012241 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmTabBox_h_ #define _XmTabBox_h_ #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmTabBoxRec *XmTabBoxWidget; typedef struct _XmTabBoxClassRec *XmTabBoxWidgetClass; extern WidgetClass xmTabBoxWidgetClass; #ifndef XmIsTabBox #define XmIsTabBox(w) XtIsSubclass(w, xmTabBoxWidgetClass) #endif /* XmIsTabBox */ Widget XmCreateTabBox(Widget, String, ArgList, Cardinal); int XmTabBoxGetIndex(Widget, int, int); int XmTabBoxGetNumRows(Widget); int XmTabBoxGetNumColumns(Widget); int XmTabBoxGetNumTabs(Widget); int XmTabBoxGetTabRow(Widget, int); int XmTabBoxXYToIndex(Widget, int, int); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* __TabBox_h__ */ motif-2.3.8/lib/Xm/VendorSE.c0000644000175000017500000006550013145162623012557 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: VendorSE.c /main/21 1997/10/13 14:58:18 cshi $" #endif #endif /* Make sure all wm properties can make it out of the resource manager */ #ifndef X_NOT_STDC_ENV #include #endif #include #include /* To make cpp on Sun happy. CR 5943 */ #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CallbackI.h" #include "MessagesI.h" #include "ResIndI.h" #include "SyntheticI.h" #include "TraversalI.h" #include "VendorSEI.h" #include "XmI.h" #define NOTVENDORSHELL _XmMMsgProtocols_0000 #define DONT_CARE -1L #define BIGSIZE ((Dimension)32767) /******** Static Function Declarations ********/ static Boolean CvtStringToHorizontalInt( Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from_val, XrmValue *toVal, XtPointer *data) ; static Boolean CvtStringToVerticalInt( Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from_val, XrmValue *toVal, XtPointer *data) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass w) ; static void DeleteWindowHandler( Widget wid, XtPointer closure, XtPointer call_data) ; static void OffsetHandler( Widget shell, XtPointer clientData, XtPointer cd) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void Destroy( Widget wid) ; static void GetMWMFunctionsFromProperty( Widget wid, int resource_offset, XtArgVal *value) ; static void CheckSetRenderTables(Widget wid, int offset, XrmValue *value); /******** End Static Function Declarations ********/ static XtConvertArgRec selfConvertArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof(int) } }; /*************************************************************************** * * Vendor shell class record * ***************************************************************************/ #define Offset(field) XtOffsetOf( struct _XmVendorShellExtRec, vendor.field) static XtResource extResources[] = { { XmNextensionType, XmCExtensionType, XmRExtensionType, sizeof (unsigned char), XtOffsetOf( struct _XmExtRec, ext.extensionType), XmRImmediate, (XtPointer)XmSHELL_EXTENSION, }, { XmNdefaultFontList, XmCDefaultFontList, XmRFontList, sizeof (XmFontList), Offset (default_font_list), XmRImmediate, (XtPointer) NULL, }, { "pri.vate", "Pri.vate", XmRUnsignedChar, sizeof (unsigned char), Offset (mapStyle), XmRImmediate, 0 }, { XmNbuttonFontList, XmCButtonFontList, XmRButtonFontList, sizeof (XmFontList), Offset (button_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables, }, { XmNlabelFontList, XmCLabelFontList, XmRLabelFontList, sizeof (XmFontList), Offset (label_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables, }, { XmNtextFontList, XmCTextFontList, XmRTextFontList, sizeof (XmFontList), Offset (text_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables, }, { XmNbuttonRenderTable, XmCButtonRenderTable, XmRButtonRenderTable, sizeof (XmRenderTable), Offset (button_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables, }, { XmNlabelRenderTable, XmCLabelRenderTable, XmRLabelRenderTable, sizeof (XmRenderTable), Offset (label_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables, }, { XmNtextRenderTable, XmCTextRenderTable, XmRTextRenderTable, sizeof (XmRenderTable), Offset (text_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables, }, { XmNaudibleWarning, XmCAudibleWarning, XmRAudibleWarning, sizeof (Boolean), Offset (audible_warning), XmRImmediate, (XtPointer) XmBELL, }, { XmNshellUnitType, XmCShellUnitType, XmRUnitType, sizeof (unsigned char), Offset (unit_type), XmRImmediate, (XtPointer) XmPIXELS, }, { XmNdeleteResponse, XmCDeleteResponse, XmRDeleteResponse, sizeof(unsigned char), Offset(delete_response), XmRImmediate, (XtPointer) XmDESTROY, }, { XmNinputPolicy, XmCInputPolicy, XmRInputPolicy, sizeof(XmInputPolicy), Offset(input_policy), XmRImmediate, (XtPointer) XmPER_SHELL, }, { XmNkeyboardFocusPolicy, XmCKeyboardFocusPolicy, XmRKeyboardFocusPolicy, sizeof(unsigned char), Offset(focus_policy), XmRImmediate, (XtPointer)XmEXPLICIT, }, { XmNmwmDecorations, XmCMwmDecorations, XmRInt, sizeof(int), Offset(mwm_hints.decorations), XmRImmediate, (XtPointer) DONT_CARE, }, { XmNmwmFunctions, XmCMwmFunctions, XmRInt, sizeof(int), Offset(mwm_hints.functions), XmRImmediate, (XtPointer) DONT_CARE, }, { XmNmwmInputMode, XmCMwmInputMode, XmRInt, sizeof(int), Offset(mwm_hints.input_mode), XmRImmediate, (XtPointer) DONT_CARE, }, { XmNmwmMenu, XmCMwmMenu, XmRString, sizeof(String), Offset(mwm_menu), XmRImmediate, (XtPointer) NULL, }, { XmNfocusMovedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(focus_moved_callback), XmRImmediate, NULL, }, { XmNrealizeCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(realize_callback), XmRImmediate, NULL, }, { XmNinputMethod, XmCInputMethod, XmRString, sizeof(String), Offset(input_method_string), XmRImmediate, NULL, }, { XmNpreeditType, XmCPreeditType, XmRString, sizeof(String), Offset(preedit_type_string), XmRImmediate, "OverTheSpot,OffTheSpot,Root,OnTheSpot", }, { XmNlightThreshold, XmCLightThreshold, XmRInt, sizeof(unsigned int), Offset(light_threshold), XmRImmediate, NULL, }, { XmNdarkThreshold, XmCDarkThreshold, XmRInt, sizeof(unsigned int), Offset(dark_threshold), XmRImmediate, NULL, }, { XmNforegroundThreshold, XmCForegroundThreshold, XmRInt, sizeof(unsigned int), Offset(foreground_threshold), XmRImmediate, NULL, }, { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), Offset(layout_direction), XmRImmediate, (XtPointer) XmLEFT_TO_RIGHT, }, /* add a synonym to ShellUnitType */ { XmNunitType, XmCUnitType, XmRUnitType, sizeof (unsigned char), Offset (unit_type), XmRImmediate, (XtPointer) XmPIXELS, }, { XmNverifyPreedit, XmCVerifyPreedit, XmRBoolean, sizeof (Boolean), Offset (verify_preedit), XmRImmediate, (XtPointer) False, }, }; #undef Offset /* Definition for resources that need special processing in get values */ #define ParentOffset(x) \ (XtOffsetOf(VendorShellRec, x) | XmLOGICAL_PARENT_RESOURCE) #define ExtOffset(x) XtOffsetOf(XmVendorShellExtRec, x) static XmSyntheticResource synResources[] = { { XmNx, sizeof (Position), ParentOffset (core.x), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNy, sizeof (Position), ParentOffset (core.y), XmeFromVerticalPixels, XmeToVerticalPixels, }, { XmNwidth, sizeof (Dimension), ParentOffset (core.width), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNheight, sizeof (Dimension), ParentOffset (core.height), XmeFromVerticalPixels, XmeToVerticalPixels, }, { XmNborderWidth, sizeof (Dimension), ParentOffset (core.border_width), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, /* size_hints minus things stored in core */ { XmNminWidth, sizeof(int), ParentOffset(wm.size_hints.min_width), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNminHeight, sizeof(int), ParentOffset(wm.size_hints.min_height), XmeFromVerticalPixels, XmeToVerticalPixels, }, { XmNmaxWidth, sizeof(int), ParentOffset(wm.size_hints.max_width), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNmaxHeight,sizeof(int), ParentOffset(wm.size_hints.max_height), XmeFromVerticalPixels, XmeToVerticalPixels, }, /* wm_hints */ { XmNiconX, sizeof(int), ParentOffset(wm.wm_hints.icon_x), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNiconY, sizeof(int), ParentOffset(wm.wm_hints.icon_y), XmeFromVerticalPixels, XmeToVerticalPixels, }, { XmNmwmFunctions, sizeof(int), ExtOffset(vendor.mwm_hints.functions), GetMWMFunctionsFromProperty, (XmImportProc)NULL, }, }; #undef ParentOffset #undef ExtOffset static XmBaseClassExtRec myBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ XmInheritSetValuesPrehook, /* set_values prehook */ (XtInitProc)NULL, /* initialize posthook */ (XtSetValuesFunc)NULL, /* set_values posthook */ NULL, /* secondary class */ (XtInitProc)NULL, /* creation proc */ (XmGetSecResDataFunc)NULL, /* getSecRes data */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ (XtArgsProc)NULL, /* get_values posthook */ XmInheritClassPartInitPrehook, /* class_part_prehook */ XmInheritClassPartInitPosthook, /* class_part_posthook */ NULL, /* compiled_ext_resources */ NULL, /* ext_resources */ 0, /* resource_count */ TRUE, /* use_sub_resources */ }; externaldef(xmvendorshellextclassrec) XmVendorShellExtClassRec xmVendorShellExtClassRec = { { (WidgetClass) &xmShellExtClassRec,/* superclass */ "VendorShell", /* class_name */ sizeof(XmVendorShellExtRec), /* size */ ClassInitialize, /* Class Initializer */ ClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ (XtInitProc)NULL, /* initialize */ (XtArgsProc)NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ extResources, /* resources */ XtNumber(extResources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ (XtSetValuesFunc)NULL, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ NULL, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&myBaseClassExtRec, /* extension */ }, { /* ext */ synResources, /* synthetic resources */ XtNumber(synResources), /* num syn resources */ NULL, /* extension */ }, { /* desktop */ NULL, /* child_class */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* shell ext */ XmInheritEventHandler, /* structureNotify */ NULL, /* extension */ }, { /* vendor ext */ DeleteWindowHandler, /* delete window handler*/ OffsetHandler, /* offset handler */ NULL, /* extension */ }, }; externaldef(xmVendorShellExtobjectclass) WidgetClass xmVendorShellExtObjectClass = (WidgetClass) (&xmVendorShellExtClassRec); /* ARGSUSED */ static Boolean CvtStringToHorizontalInt( Display *display, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) { Widget widget = *(Widget*) args[0].addr ; Screen * screen = XtScreen(widget) ; unsigned char defaultFromType = _XmGetUnitType(widget) ; int tmpPix; Boolean parseError; tmpPix = (int) _XmConvertStringToUnits (screen, from->addr, (int) defaultFromType, XmHORIZONTAL, XmPIXELS, (XtEnum*) &parseError); if (parseError) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRHorizontalDimension); return False; } else _XM_CONVERTER_DONE( to, int, tmpPix, ; ) } /* ARGSUSED */ static Boolean CvtStringToVerticalInt( Display *display, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) { Widget widget = *(Widget*) args[0].addr ; Screen * screen = XtScreen(widget) ; unsigned char defaultFromType = _XmGetUnitType(widget) ; int tmpPix; Boolean parseError; tmpPix = (int) _XmConvertStringToUnits(screen, from->addr, (int) defaultFromType, XmVERTICAL, XmPIXELS, (XtEnum*) &parseError); if (parseError) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRVerticalPosition); return False; } else _XM_CONVERTER_DONE( to, int, tmpPix, ; ) } /************************************************************************ * * ClassInitialize * Set up the converters for VendorShell int pixels * ************************************************************************/ static void ClassInitialize( void ) { XtSetTypeConverter(XmRString, XmRHorizontalInt, CvtStringToHorizontalInt, selfConvertArgs, XtNumber(selfConvertArgs), XtCacheNone, (XtDestructor)NULL); XtSetTypeConverter(XmRString, XmRVerticalInt, CvtStringToVerticalInt, selfConvertArgs, XtNumber(selfConvertArgs), XtCacheNone, (XtDestructor)NULL); myBaseClassExtRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInitialize * Set up the inheritance mechanism for the routines exported by * vendorShells class part. * ************************************************************************/ static void ClassPartInitialize( WidgetClass w ) { XmVendorShellExtObjectClass wc = (XmVendorShellExtObjectClass) w; XmVendorShellExtObjectClass sc = (XmVendorShellExtObjectClass) wc->object_class.superclass; if (wc == (XmVendorShellExtObjectClass)xmVendorShellExtObjectClass) return; if (wc->vendor_class.delete_window_handler == XmInheritProtocolHandler) wc->vendor_class.delete_window_handler = sc->vendor_class.delete_window_handler; if (wc->vendor_class.offset_handler == XmInheritProtocolHandler) wc->vendor_class.offset_handler = sc->vendor_class.offset_handler; } /************************************************************************ * DeleteWindowHandler * ************************************************************************/ /*ARGSUSED*/ static void DeleteWindowHandler( Widget wid, XtPointer closure, XtPointer call_data ) /* unused */ { VendorShellWidget w = (VendorShellWidget) wid ; XmVendorShellExtObject ve = (XmVendorShellExtObject) closure; switch(ve->vendor.delete_response) { case XmUNMAP: if (w->shell.popped_up) XtPopdown((Widget) w); else XtUnmapWidget((Widget) w); break; case XmDESTROY: if (XtIsApplicationShell((Widget) w)) { XtDestroyApplicationContext (XtWidgetToApplicationContext((Widget) w)); exit(0); } else XtDestroyWidget((Widget) w); break; case XmDO_NOTHING: default: break; } } /************************************************************************ * * OffsetHandler * ************************************************************************/ /*ARGSUSED*/ static void OffsetHandler( Widget shell, /* unused */ XtPointer clientData, XtPointer cd ) { XmAnyCallbackStruct *callData = (XmAnyCallbackStruct *) cd ; XClientMessageEvent *offsetEvent; XmVendorShellExtObject ve = (XmVendorShellExtObject)clientData; offsetEvent = (XClientMessageEvent *) callData->event; ve->vendor.lastOffsetSerial = offsetEvent->serial; ve->vendor.xOffset = (Position) offsetEvent->data.l[1]; ve->vendor.yOffset = (Position) offsetEvent->data.l[2]; } /************************************************************************ * * InitializePrehook * ************************************************************************/ static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmExtObjectClass ec = (XmExtObjectClass) XtClass(new_w); XmBaseClassExt *wcePtr; XmExtObject ne = (XmExtObject) new_w; Widget parent = ne->ext.logicalParent; XmExtObjectClass pec = (XmExtObjectClass) XtClass(parent); XmBaseClassExt *pcePtr; XmWidgetExtData extData; wcePtr = _XmGetBaseClassExtPtr(ec, XmQmotif); pcePtr = _XmGetBaseClassExtPtr(pec, XmQmotif); if ((*wcePtr)->use_sub_resources) { _XmProcessLock(); /* * get a uncompiled resource list to use with * XtGetSubresources. We can't do this in * ClassPartInitPosthook because Xt doesn't set class_inited at * the right place and thereby mishandles the * XtGetResourceList call */ if ((*wcePtr)->ext_resources == NULL) { ec->object_class.resources = (*wcePtr)->compiled_ext_resources; ec->object_class.num_resources = (*wcePtr)->num_ext_resources; XtGetResourceList((WidgetClass) ec, &((*wcePtr)->ext_resources), &((*wcePtr)->num_ext_resources)); } if ((*pcePtr)->ext_resources == NULL) { XtGetResourceList((WidgetClass) pec, &((*pcePtr)->ext_resources), &((*pcePtr)->num_ext_resources)); } XtGetSubresources(parent, (XtPointer)new_w, NULL, NULL, (*wcePtr)->ext_resources, (*wcePtr)->num_ext_resources, args, *num_args); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); _XmPushWidgetExtData(parent, extData, ne->ext.extensionType); extData->widget = new_w; extData->reqWidget = (Widget) XtMalloc(XtClass(new_w)->core_class.widget_size); memcpy( extData->reqWidget, req, XtClass(new_w)->core_class.widget_size); /* Convert the fields from unit values to pixel values */ XtGetSubresources(parent, (XtPointer)parent, NULL, NULL, (*pcePtr)->ext_resources, (*pcePtr)->num_ext_resources, args, *num_args); _XmExtImportArgs(new_w, args, num_args); _XmProcessUnlock(); } } /************************************************************************ * * Destroy * * This needs to be in the ext object because the extension gets * blown away before the primary does since it's a child. Otherwise * we'd have it in the primary. * ************************************************************************/ static void Destroy( Widget wid ) { XmVendorShellExtObject ve = (XmVendorShellExtObject) wid ; if (ve->vendor.mwm_menu) XtFree(ve->vendor.mwm_menu); if (ve->vendor.input_method_string) XtFree(ve->vendor.input_method_string); if (ve->vendor.preedit_type_string) XtFree(ve->vendor.preedit_type_string); if (ve->vendor.label) XtDestroyWidget(ve->vendor.label); if (ve->vendor.slider) XtDestroyWidget(ve->vendor.slider); if (ve->vendor.timer) XtRemoveTimeOut(ve->vendor.timer); if (ve->vendor.duration_timer) XtRemoveTimeOut(ve->vendor.duration_timer); _XmDestroyFocusData(ve->vendor.focus_data); } /* * XmRCallProc routine for checking VendorShell render table resources * before setting them to NULL if no value is specified * for both XmNrenderTable and XmNfontList. * If the appropriate bit in "mapStyle" has been set, then the * function has been called twice on same widget and resource offset, thus * resource needs to be set NULL, otherwise leave it alone. */ /* ARGSUSED */ static void CheckSetRenderTables(Widget wid, int offset, XrmValue *value ) { XmVendorShellExtObject ve; XmWidgetExtData extData; #define SET_BFL(state) (state |= 0x01) #define IS_SET_BFL(state) (state & 0x01) #define SET_LFL(state) (state |= 0x02) #define IS_SET_LFL(state) (state & 0x02) #define SET_TFL(state) (state |= 0x04) #define IS_SET_TFL(state) (state & 0x04) extData = _XmGetWidgetExtData(wid, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return; } ve = (XmVendorShellExtObject)(extData->widget); if (((char *)ve + offset) == (char *) &(ve->vendor.button_font_list)) { if (IS_SET_BFL(ve->vendor.mapStyle)) value->addr = NULL; else { SET_BFL(ve->vendor.mapStyle); value->addr = ((char *)ve + offset); } } else if (((char *)ve + offset) == (char *) &(ve->vendor.label_font_list)) { if (IS_SET_LFL(ve->vendor.mapStyle)) value->addr = NULL; else { SET_LFL(ve->vendor.mapStyle); value->addr = ((char *)ve + offset); } } else if (((char *)ve + offset) == (char *) &(ve->vendor.text_font_list)) { if (IS_SET_TFL(ve->vendor.mapStyle)) value->addr = NULL; else { SET_TFL(ve->vendor.mapStyle); value->addr = ((char *)ve + offset); } } } /************************************************************************ * * _XmGetAudibleWarning * This function is called by a widget to get the audibleWarning * value. This is done by checking to see if any of the widgets, * in the widget's parent hierarchy is a subclass of VendorShell widget * class, and if it is, returning the VendorShell resource value. * If no VendorShell is found, returns XmBELL, since it is the default * value for this resource. *************************************************************************/ unsigned char _XmGetAudibleWarning(Widget w) { XmWidgetExtData extData ; XmVendorShellExtObject vendorExt; while (w) { if (XmIsVendorShell (w)) { extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return XmBELL; } vendorExt = (XmVendorShellExtObject) extData->widget; return vendorExt->vendor.audible_warning; } else w = XtParent(w); } return (XmBELL); } /****************************************************************/ /*ARGSUSED*/ static void GetMWMFunctionsFromProperty( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { Atom actual_type; int actual_format; unsigned long num_items, bytes_after; PropMwmHints *prop = NULL ; XmVendorShellExtObject ve = (XmVendorShellExtObject) wid ; Widget shell = ve->ext.logicalParent ; Atom mwm_hints_atom ; if( !XtIsRealized( shell) ) { *value = (XtArgVal) ve->vendor.mwm_hints.functions ; return ; } mwm_hints_atom = XInternAtom( XtDisplay( shell), _XA_MWM_HINTS, FALSE); XGetWindowProperty( XtDisplay( shell), XtWindow( shell), mwm_hints_atom, 0, (long) PROP_MWM_HINTS_ELEMENTS, FALSE, mwm_hints_atom, &actual_type, &actual_format, &num_items, &bytes_after, (unsigned char **) &prop); if( (actual_type != mwm_hints_atom) || (actual_format != 32) || (num_items < PROP_MWM_HINTS_ELEMENTS) || (prop == NULL) ) { if( prop != NULL ) { XFree( (char *)prop) ; } *value = (XtArgVal) ve->vendor.mwm_hints.functions ; return ; } *value = (XtArgVal) prop->functions ; XFree( (char *) prop) ; } /******* XmeFunctions ********/ void XmeAddFocusChangeCallback(Widget w, XtCallbackProc proc, XtPointer data) { XmWidgetExtData extData ; XmVendorShellExtObject vendorExt; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmIsVendorShell(w) == False) { XmeWarning(w, NOTVENDORSHELL); _XmAppUnlock(app); return; } extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif _XmAppUnlock(app); return; } vendorExt = (XmVendorShellExtObject) extData->widget; _XmAddCallback((InternalCallbackList *) &(vendorExt->vendor.focus_moved_callback), proc, data); _XmAppUnlock(app); } void XmeRemoveFocusChangeCallback(Widget w, XtCallbackProc proc, XtPointer data) { XmWidgetExtData extData ; XmVendorShellExtObject vendorExt; _XmWidgetToAppContext(w); _XmAppLock(app); if (XmIsVendorShell(w) == False) { XmeWarning(w, NOTVENDORSHELL); _XmAppUnlock(app); return; } extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif _XmAppUnlock(app); return; } vendorExt = (XmVendorShellExtObject) extData->widget; _XmRemoveCallback((InternalCallbackList *) &(vendorExt->vendor.focus_moved_callback), proc, data); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/DrTog.c0000644000175000017500000002664212672140200012104 00000000000000/* $XConsortium: DrTog.c /main/6 1995/10/25 20:00:29 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include /**************************** DrTog module *************************** * * Draw API used by Toggle Button only. * ***************************************************************************/ /******** Static Function Declarations ********/ static void DrawCheckMark(Display *display, Drawable d, GC gc, Position x, Position y, Dimension width, Dimension height, Dimension margin); static void DrawCross(Display *display, Drawable d, GC gc, Position x, Position y, Dimension width, Dimension height, Dimension margin); /******** End Static Function Declarations ********/ #define CHECK_TEMPLATE_WIDTH 32 #define CHECK_TEMPLATE_HEIGHT 32 static XmConst XPoint check_template[] = { { 0, 15 }, { 6, 9 }, { 14, 17 }, { 31, 0 }, { 31, 3 }, { 21, 17 }, { 16, 31 }, { 0, 15 } }; static void DrawCheckMark(Display *display, Drawable d, GC gc, Position x, Position y, Dimension width, Dimension height, Dimension margin) { XGCValues old_values, new_values; XtGCMask mask; XPoint check[XtNumber(check_template)]; float scale_x = (width - 2 * margin - 1) / (float)CHECK_TEMPLATE_WIDTH; float scale_y = (height - 2 * margin - 1) / (float)CHECK_TEMPLATE_HEIGHT; int npoints = XtNumber(check_template); int i; /* Scale and translate the glyph to the desired area. */ for (i = 0; i < npoints; i++) { check[i].x = (Position)(check_template[i].x*scale_x + 0.5) + x + margin; check[i].y = (Position)(check_template[i].y*scale_y + 0.5) + y + margin; } /* CR 9656: Force line_width so test results are not platform-dependent. */ mask = 0; new_values.line_width = 1, mask |= GCLineWidth; XGetGCValues(display, gc, mask, &old_values); XChangeGC(display, gc, mask, &new_values); /* Draw the check mark. */ XFillPolygon(display, d, gc, check, npoints - 1, Nonconvex, CoordModeOrigin); XDrawLines(display, d, gc, check, npoints, CoordModeOrigin); XChangeGC(display, gc, mask, &old_values); } static void DrawCross(Display *display, Drawable d, GC gc, Position x, Position y, Dimension width, Dimension height, Dimension margin) { Position left = x + margin; Position right = x + width - margin - 1; Position top = y + margin; Position bottom = y + height - margin - 1; XSegment segs[6]; Cardinal nsegs = 0; segs[nsegs].x1 = left; segs[nsegs].y1 = top + 1; segs[nsegs].x2 = right - 1; segs[nsegs].y2 = bottom; nsegs++; segs[nsegs].x1 = left; segs[nsegs].y1 = top; segs[nsegs].x2 = right; segs[nsegs].y2 = bottom; nsegs++; segs[nsegs].x1 = left + 1; segs[nsegs].y1 = top; segs[nsegs].x2 = right; segs[nsegs].y2 = bottom - 1; nsegs++; segs[nsegs].x1 = left; segs[nsegs].y1 = bottom - 1; segs[nsegs].x2 = right - 1; segs[nsegs].y2 = top; nsegs++; segs[nsegs].x1 = left; segs[nsegs].y1 = bottom; segs[nsegs].x2 = right; segs[nsegs].y2 = top; nsegs++; segs[nsegs].x1 = left + 1; segs[nsegs].y1 = bottom; segs[nsegs].x2 = right; segs[nsegs].y2 = top + 1; nsegs++; assert(nsegs <= XtNumber(segs)); XDrawSegments(display, d, gc, segs, nsegs); } /***********************XmeDrawDiamond**********************************/ /*ARGSUSED*/ void XmeDrawDiamond(Display *display, Drawable d, GC top_gc, GC bottom_gc, GC center_gc, #if NeedWidePrototypes int x, int y, int width, int height, /* unused */ int shadow_thick, int margin) #else Position x, Position y, Dimension width, Dimension height, /* unused */ Dimension shadow_thick, Dimension margin) #endif /* NeedWidePrototypes */ { XSegment seg[12]; XPoint pt[4]; int midX, midY; int delta; _XmDisplayToAppContext(display); if (!d || !width) return ; _XmAppLock(app); if (width % 2 == 0) width--; if (width == 1) { XDrawPoint(display, d, top_gc, x,y); _XmAppUnlock(app); return ; } else if (width == 3) { seg[0].x1 = x; seg[0].y1 = seg[0].y2 = y + 1; seg[0].x2 = x + 2; seg[1].x1 = seg[1].x2 = x + 1; seg[1].y1 = y ; seg[1].y2 = y + 2; XDrawSegments (display, d, top_gc, seg, 2); _XmAppUnlock(app); return ; } else { /* NORMAL SIZED ToggleButtonS : initial width >= 5 */ midX = x + (width + 1) / 2; midY = y + (width + 1) / 2; /* The top shadow segments */ seg[0].x1 = x; /* 1 */ seg[0].y1 = midY - 1; seg[0].x2 = midX - 1; /* 2 */ seg[0].y2 = y; seg[1].x1 = x + 1; /* 3 */ seg[1].y1 = midY - 1; seg[1].x2 = midX - 1; /* 4 */ seg[1].y2 = y + 1; seg[2].x1 = x + 2; /* 3 */ seg[2].y1 = midY - 1; seg[2].x2 = midX - 1; /* 4 */ seg[2].y2 = y + 2; seg[3].x1 = midX - 1; /* 5 */ seg[3].y1 = y; seg[3].x2 = x + width - 1; /* 6 */ seg[3].y2 = midY - 1; seg[4].x1 = midX - 1; /* 7 */ seg[4].y1 = y + 1; seg[4].x2 = x + width - 2; /* 8 */ seg[4].y2 = midY - 1; seg[5].x1 = midX - 1; /* 7 */ seg[5].y1 = y + 2; seg[5].x2 = x + width - 3; /* 8 */ seg[5].y2 = midY - 1; /* The bottom shadow segments */ seg[6].x1 = x; /* 9 */ seg[6].y1 = midY - 1; seg[6].x2 = midX - 1; /* 10 */ seg[6].y2 = y + width - 1; seg[7].x1 = x + 1; /* 11 */ seg[7].y1 = midY - 1; seg[7].x2 = midX - 1; /* 12 */ seg[7].y2 = y + width - 2; seg[8].x1 = x + 2; /* 11 */ seg[8].y1 = midY - 1; seg[8].x2 = midX - 1; /* 12 */ seg[8].y2 = y + width - 3; seg[9].x1 = midX - 1; /* 13 */ seg[9].y1 = y + width - 1; seg[9].x2 = x + width - 1; /* 14 */ seg[9].y2 = midY - 1; seg[10].x1 = midX - 1; /* 15 */ seg[10].y1 = y + width - 2; seg[10].x2 = x + width - 2; /* 16 */ seg[10].y2 = midY - 1; seg[11].x1 = midX - 1; /* 15 */ seg[11].y1 = y + width - 3; seg[11].x2 = x + width - 3; /* 16 */ seg[11].y2 = midY - 1; } XDrawSegments (display, d, top_gc, &seg[3], 3); XDrawSegments (display, d, bottom_gc, &seg[6], 6); XDrawSegments (display, d, top_gc, &seg[0], 3); if (width == 5 || !center_gc) { _XmAppUnlock(app); return ; } /* <= 5 in fact */ if (shadow_thick == 0) delta = -3 ; else if (shadow_thick == 1) delta = -1 ; else delta = margin; pt[0].x = x + 3 + delta; pt[0].y = pt[2].y = midY - 1; pt[1].x = pt[3].x = midX - 1 ; pt[1].y = y + 2 + delta; pt[2].x = x + width - 3 - delta; pt[3].y = y + width - 3 - delta; XFillPolygon (display, d, center_gc, pt, 4, Convex, CoordModeOrigin); _XmAppUnlock(app); } /******************************XmeDrawIndicator**********************/ void XmeDrawIndicator(Display *display, Drawable d, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int margin, int type) #else Position x, Position y, Dimension width, Dimension height, Dimension margin, XtEnum type) #endif /* NeedWidePrototypes */ { _XmDisplayToAppContext(display); _XmAppLock(app); switch(type & 0xf0) { case XmINDICATOR_CHECK: DrawCheckMark(display, d, gc, x, y, width, height, margin); break; case XmINDICATOR_CROSS: DrawCross(display, d, gc, x, y, width, height, margin); break; } _XmAppUnlock(app); } void XmeDrawCircle(Display *display, Drawable d, GC top_gc, GC bottom_gc, GC center_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, int margin) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension margin) #endif /* NeedWidePrototypes */ { int line_width = MIN(shadow_thick, MIN(width, height) / 2); _XmDisplayToAppContext(display); if ((width <= 0) || (height <= 0)) return; _XmAppLock(app); if (shadow_thick > 0) { /* Force the GCs to use our values. */ XGCValues top_values, bottom_values, new_values; XtGCMask mask; mask = 0; new_values.line_width = line_width, mask |= GCLineWidth; XGetGCValues(display, top_gc, mask, &top_values); XGetGCValues(display, bottom_gc, mask, &bottom_values); XChangeGC(display, top_gc, mask, &new_values); XChangeGC(display, bottom_gc, mask, &new_values); #ifdef FIX_1402 if (center_gc != NULL) { int delta = MIN(line_width + margin, MIN(width, height) / 2) -1; XFillArc(display, d, center_gc, x + delta, y + delta, MAX(width - 2 * delta, 1), MAX(height - 2 * delta, 1), 0, 360 * 64); } #endif XDrawArc(display, d, top_gc, x + line_width/2, y + line_width/2, MAX(width - line_width, 1), MAX(height - line_width, 1), 45 * 64, 180 * 64); XDrawArc(display, d, bottom_gc, x + line_width/2, y + line_width/2, MAX(width - line_width, 1), MAX(height - line_width, 1), 45 * 64, -180 * 64); XChangeGC(display, top_gc, mask, &top_values); XChangeGC(display, bottom_gc, mask, &bottom_values); } #ifdef FIX_1402 else { if (center_gc != NULL) { int delta = MIN(line_width + margin, MIN(width, height) / 2); XFillArc(display, d, center_gc, x + delta, y + delta, MAX(width - 2 * delta, 1), MAX(height - 2 * delta, 1), 0, 360 * 64); } } #else if (center_gc != NULL) { /* Fill the center of the circle. */ int delta = MIN(line_width + margin, MIN(width, height) / 2); XFillArc(display, d, center_gc, x + delta, y + delta, MAX(width - 2 * delta, 1), MAX(height - 2 * delta, 1), 0, 360 * 64); } #endif _XmAppUnlock(app); } motif-2.3.8/lib/Xm/TextDIconI.h0000644000175000017500000001342113145162623013044 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextDIconP_h #define _XmTextDIconP_h #include #ifdef __cplusplus extern "C" { #endif /*******************/ /* 16x16 drag icon */ /*******************/ #define XmTEXTUAL_DRAG_ICON_WIDTH_16 16 #define XmTEXTUAL_DRAG_ICON_HEIGHT_16 16 #define XmTEXTUAL_DRAG_ICON_X_HOT_16 7 #define XmTEXTUAL_DRAG_ICON_Y_HOT_16 0 static XmConst unsigned char XmTEXTUAL_DRAG_ICON_BITS_16[] = { 0x00, 0x00, 0xfe, 0x0f, 0x02, 0x08, 0x02, 0x08, 0xfa, 0x0b, 0x02, 0x08, 0xfa, 0x0b, 0x02, 0x08, 0x02, 0x08, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char XmTEXTUAL_DRAG_ICON_MASK_BITS_16[] = { 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; /*******************/ /* 32x32 drag icon */ /*******************/ #define XmTEXTUAL_DRAG_ICON_WIDTH_32 26 #define XmTEXTUAL_DRAG_ICON_HEIGHT_32 20 #define XmTEXTUAL_DRAG_ICON_X_HOT_32 26 #define XmTEXTUAL_DRAG_ICON_Y_HOT_32 4 static XmConst unsigned char XmTEXTUAL_DRAG_ICON_BITS_32[] = { 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x82, 0xff, 0x0f, 0x01, 0xc2, 0xff, 0x0f, 0x01, 0xc2, 0xff, 0x07, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x82, 0xff, 0x0f, 0x01, 0xc2, 0xff, 0x0f, 0x01, 0xc2, 0xff, 0x07, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char XmTEXTUAL_DRAG_ICON_MASK_BITS_32[] = { 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03}; #define XmTEXTUAL_DRAG_ICON_WIDTH_Alt_32 32 #define XmTEXTUAL_DRAG_ICON_HEIGHT_Alt_32 32 #define XmTEXTUAL_DRAG_ICON_X_HOT_Alt_32 1 #define XmTEXTUAL_DRAG_ICON_Y_HOT_Alt_32 1 static XmConst unsigned char XmTEXTUAL_DRAG_ICON_BITS_Alt_32[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xcd, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x7f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfd, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x76, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbb, 0xff, 0x06, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xde, 0x7b, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x78, 0x77, 0xb7, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xbd, 0xdd, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char XmTEXTUAL_DRAG_ICON_MASK_BITS_Alt_32[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0xff, 0xff, 0x3f, 0x80, 0xff, 0xff, 0x3f, 0xc0, 0xff, 0xff, 0x3f, 0xe0, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #define XmTEXTUAL_DRAG_ICON_WIDTH_Alt_16 16 #define XmTEXTUAL_DRAG_ICON_HEIGHT_Alt_16 16 #define XmTEXTUAL_DRAG_ICON_X_HOT_Alt_16 1 #define XmTEXTUAL_DRAG_ICON_Y_HOT_Alt_16 1 static XmConst unsigned char XmTEXTUAL_DRAG_ICON_BITS_Alt_16[] = { 0x00, 0x00, 0x60, 0xdd, 0x00, 0x00, 0xb8, 0x7e, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xff, 0x71, 0x00, 0x00, 0xb7, 0x7f, 0x00, 0x00, 0xdb, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char XmTEXTUAL_DRAG_ICON_MASK_BITS_Alt_16[] = { 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextDIconP_h */ motif-2.3.8/lib/Xm/XpmRdFToP.c0000644000175000017500000000612212672140200012637 00000000000000/* $XConsortium: XpmRdFToP.c /main/2 1996/09/20 08:13:56 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * RdFToP.c: * * * * XPM library * * Parse an XPM file and create the pixmap and possibly its mask * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmReadFileToPixmap(display, d, filename, pixmap_return, shapemask_return, attributes) Display *display; Drawable d; char *filename; Pixmap *pixmap_return; Pixmap *shapemask_return; XpmAttributes *attributes; { XImage *ximage, *shapeimage; int ErrorStatus; /* initialize return values */ if (pixmap_return) *pixmap_return = 0; if (shapemask_return) *shapemask_return = 0; /* create the images */ ErrorStatus = XpmReadFileToImage(display, filename, (pixmap_return ? &ximage : NULL), (shapemask_return ? &shapeimage : NULL), attributes); if (ErrorStatus < 0) /* fatal error */ return (ErrorStatus); /* create the pixmaps and destroy images */ if (pixmap_return && ximage) { xpmCreatePixmapFromImage(display, d, ximage, pixmap_return); XDestroyImage(ximage); } if (shapemask_return && shapeimage) { xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return); XDestroyImage(shapeimage); } return (ErrorStatus); } motif-2.3.8/lib/Xm/MenuUtil.c0000644000175000017500000006577413145162623012651 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: MenuUtil.c /main/16 1999/05/13 15:57:21 mgreess $" #endif #endif #include #include #include #include #include #include #include #include #include #include #include "GadgetUtiI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "MessagesI.h" #include "RCMenuI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "XmI.h" #define GRABPTRERROR _XmMMsgCascadeB_0003 #define GRABKBDERROR _XmMMsgRowColText_0024 #define EVENTS ((unsigned int) (ButtonPressMask | \ ButtonReleaseMask | EnterWindowMask | \ LeaveWindowMask)) /******** Static Function Declarations ********/ static void MenuTraverse( Widget w, XEvent *event, XmTraversalDirection direction) ; static void GadgetCleanup( XmRowColumnWidget rc, XmGadget oldActiveChild) ; static Boolean WrapRight( XmRowColumnWidget rc) ; static Boolean WrapLeft( XmRowColumnWidget rc) ; static void LocateChild( XmRowColumnWidget rc, Widget wid, XmTraversalDirection direction) ; static void MoveDownInMenuBar( XmRowColumnWidget rc, Widget pw) ; static void MoveLeftInMenuBar( XmRowColumnWidget rc, Widget pw) ; static void MoveRightInMenuBar( XmRowColumnWidget rc, Widget pw) ; static void FindNextMenuBarItem( XmRowColumnWidget menubar) ; static void FindPrevMenuBarItem( XmRowColumnWidget menubar) ; static Boolean ValidateMenuBarItem( Widget oldActiveChild, Widget newActiveChild) ; static Boolean FindNextMenuBarCascade( XmRowColumnWidget menubar) ; static Boolean FindPrevMenuBarCascade( XmRowColumnWidget menubar) ; static Boolean ValidateMenuBarCascade( Widget oldActiveChild, Widget newMenuChild) ; /******** End Static Function Declarations ********/ Boolean _XmIsActiveTearOff ( Widget widget) { XmRowColumnWidget menu = (XmRowColumnWidget) widget; if (RC_TearOffActive(menu)) return (True); else return (False); } /* * Call XtGrabPointer with retry */ int _XmGrabPointer( Widget widget, Bool owner_events, unsigned int event_mask, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor, Time time ) { register int status = 0, retry; for (retry=0; retry < 5; retry++) { if ((status = XtGrabPointer(widget, owner_events, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, time)) == GrabSuccess) break; XmeMicroSleep(1000); } if (status != GrabSuccess) XmeWarning((Widget) widget, GRABPTRERROR); return(status); } /* * Call XtGrabKeyboard with retry */ int _XmGrabKeyboard( Widget widget, Bool owner_events, int pointer_mode, int keyboard_mode, Time time ) { register int status = 0, retry; for (retry=0; retry < 5; retry++) { if ((status = XtGrabKeyboard(widget, owner_events, pointer_mode, keyboard_mode, time)) == GrabSuccess) break; XmeMicroSleep(1000); } if (status != GrabSuccess) XmeWarning(widget, GRABKBDERROR); return(status); } void _XmMenuSetInPMMode ( Widget wid, #if NeedWidePrototypes int flag ) #else Boolean flag ) #endif /* NeedWidePrototypes */ { _XmGetMenuState((Widget)wid)->MU_InPMMode = flag; } /* * This menuprocs procedure allows an external object to turn on and off menu * traversal. */ void _XmSetMenuTraversal( Widget wid, #if NeedWidePrototypes int traversalOn ) #else Boolean traversalOn ) #endif /* NeedWidePrototypes */ { if (traversalOn) { _XmSetInDragMode(wid, False); if (!XmProcessTraversal(wid , XmTRAVERSE_CURRENT)) XtSetKeyboardFocus(XtParent(wid), wid); } else { _XmSetInDragMode(wid, True); if( XmIsMenuShell( XtParent( wid)) ) { /* Must be careful not to trash the traversal environment * for RowColumns which are not using menu-specific traversal. */ _XmLeafPaneFocusOut(wid); } } } void _XmLeafPaneFocusOut( Widget wid ) { XEvent fo_event; Widget widget; XmRowColumnWidget rc = (XmRowColumnWidget)wid; /* find the leaf pane */ while (RC_PopupPosted(rc)) rc = (XmRowColumnWidget) ((XmMenuShellWidget)RC_PopupPosted(rc))->composite.children[0]; fo_event.type = FocusOut; fo_event.xfocus.send_event = True; if ((widget = rc->manager.active_child) && XmIsCascadeButtonGadget(widget)) { /* clear the internal focus path; also active_child = NULL which happens * to make cascadebutton focus out work correctly. */ _XmClearFocusPath((Widget)rc); _XmDispatchGadgetInput(widget, NULL, XmFOCUS_OUT_EVENT); ((XmGadget)widget)->gadget.have_traversal = False; } else { if (widget && XmIsPrimitive(widget) && (((XmPrimitiveWidgetClass)(widget->core.widget_class))-> primitive_class.border_unhighlight != (XtWidgetProc)NULL)) (*(((XmPrimitiveWidgetClass)(widget->core.widget_class))-> primitive_class.border_unhighlight))((Widget) widget); else _XmManagerFocusOut( (Widget) rc, &fo_event, NULL, NULL); /* clears the focus_item so that next TraverseToChild() will work */ _XmClearFocusPath((Widget)rc); } } /*ARGSUSED*/ void _XmMenuHelp( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmRowColumnWidget rc = (XmRowColumnWidget) wid; XmGadget gadget; if (!_XmIsEventUnique(event) || (!RC_IsArmed(rc) && !((RC_Type(rc) == XmMENU_OPTION) || (RC_Type(rc) == XmMENU_PULLDOWN)))) return; if (!_XmGetInDragMode ((Widget)rc)) { if ((gadget = (XmGadget) rc->manager.active_child) != NULL) _XmDispatchGadgetInput( (Widget) gadget, event, XmHELP_EVENT); else { _XmSocorro( (Widget) rc, event, NULL, NULL); _XmMenuPopDown((Widget)rc, event, NULL); } } else { if ((gadget = (XmGadget) XmObjectAtPoint((Widget) rc, event->xkey.x, event->xkey.y)) != NULL) _XmDispatchGadgetInput( (Widget) gadget, event, XmHELP_EVENT); else { _XmSocorro( (Widget) rc, event, NULL, NULL); _XmMenuPopDown((Widget)rc, event, NULL); } } _XmRecordEvent(event); } static void MenuTraverse( Widget w, XEvent *event, XmTraversalDirection direction ) { Widget parent; /* * The case may occur where the reporting widget is in fact the * RowColumn widget, and not a child. This will occur if the * RowColumn has not traversable children. */ if (XmIsRowColumn(w)) parent = w; else if (XmIsRowColumn(XtParent(w))) parent = XtParent(w); else return; if ((RC_Type(parent) == XmMENU_POPUP) || (RC_Type(parent) == XmMENU_PULLDOWN) || (RC_Type(parent) == XmMENU_BAR)) { _XmRecordEvent(event); (*(((XmRowColumnWidgetClass)XtClass(parent))->row_column_class. traversalHandler))( (Widget) parent, (Widget) w, direction); } } /* ARGSUSED */ void _XmMenuTraverseLeft( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { if (_XmIsEventUnique(event)) { MenuTraverse(wid, event, XmTRAVERSE_LEFT); } } /* ARGSUSED */ void _XmMenuTraverseRight( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { if (_XmIsEventUnique(event)) { MenuTraverse(wid, event, XmTRAVERSE_RIGHT); } } /* ARGSUSED */ void _XmMenuTraverseUp( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { if (_XmIsEventUnique(event)) { MenuTraverse(wid, event, XmTRAVERSE_UP); } } /* ARGSUSED */ void _XmMenuTraverseDown( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { if (_XmIsEventUnique(event)) { MenuTraverse(wid, event, XmTRAVERSE_DOWN); } } /* ARGSUSED */ void _XmMenuEscape( Widget w, XEvent *event, String *params, Cardinal *num_params ) { Widget parent = XtParent(w); /* Process the event only if not already processed */ if (!_XmIsEventUnique(event)) return; /* * Catch case where its a menubar w/ no submenus up - can't call * menushell's popdown, call rowcolumn's instead. */ if ((XmIsCascadeButton(w) || XmIsCascadeButtonGadget(w)) && XmIsRowColumn(parent) && (RC_Type(parent) == XmMENU_BAR) && !RC_PopupPosted(parent)) { (*(((XmRowColumnClassRec *)XtClass(parent))->row_column_class. menuProcedures)) (XmMENU_POPDOWN, parent, NULL, event, NULL); } else /* Let the menushell widget clean things up */ (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownOne))(w, event, NULL, NULL); } void _XmRC_GadgetTraverseDown( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; XmGadget gadget = (XmGadget)rc->manager.active_child; if (gadget && XmIsGadget(gadget)) _XmMenuTraverseDown((Widget) gadget, event, param, num_param); } void _XmRC_GadgetTraverseUp( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; XmGadget gadget = (XmGadget)rc->manager.active_child; if (gadget && XmIsGadget(gadget)) _XmMenuTraverseUp((Widget) gadget, event, param, num_param); } void _XmRC_GadgetTraverseLeft( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; XmGadget gadget = (XmGadget)rc->manager.active_child; /* * If there is not active child, then this RowColumn has * no traversable children, so it's fielding traversal * requests itself. */ if (gadget) _XmMenuTraverseLeft((Widget) gadget, event, param, num_param); else _XmMenuTraverseLeft((Widget) rc, event, param, num_param); } void _XmRC_GadgetTraverseRight( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; XmGadget gadget = (XmGadget)rc->manager.active_child; /* * If there is not active child, then this RowColumn has * no traversable children, so it's fielding traversal * requests itself. */ if (gadget) _XmMenuTraverseRight((Widget) gadget, event, param, num_param); else _XmMenuTraverseRight((Widget) rc, event, param, num_param); } /* * In case we've moved into our out of a gadget, we need to take care * of the highlighting ourselves, since the gadget will not get a focus * event. */ static void GadgetCleanup( XmRowColumnWidget rc, XmGadget oldActiveChild ) { XmGadget newActiveChild = (XmGadget)rc->manager.active_child; if (oldActiveChild != newActiveChild) { if (oldActiveChild && XmIsGadget(oldActiveChild)) { _XmDispatchGadgetInput( (Widget) oldActiveChild, NULL, XmFOCUS_OUT_EVENT); oldActiveChild->gadget.have_traversal = False; } } } /* * At the edge of the menu, decide what to do in this case */ static Boolean WrapRight ( XmRowColumnWidget rc ) { Widget topLevel; Widget oldActiveChild = rc->manager.active_child; Boolean done = False; _XmGetActiveTopLevelMenu ((Widget) rc, (Widget *) &topLevel); /* if in a menubar system, try to move to next menubar item cascade */ if (XmIsMenuShell(XtParent(rc)) && (RC_Type(topLevel) == XmMENU_BAR) && (FindNextMenuBarCascade((XmRowColumnWidget) topLevel))) { GadgetCleanup(rc, (XmGadget) oldActiveChild); done = True; } return (done); } /* * At the edge of the menu, decide what to do in this case */ static Boolean WrapLeft ( XmRowColumnWidget rc ) { Widget oldActiveChild = rc->manager.active_child; Boolean done = False; /* * If we're the topmost pulldown menupane from a menubar, then unpost * and move to the next available item in the menubar, and post its * submenu. */ if (XmIsMenuShell(XtParent(rc)) && (RC_Type (rc) != XmMENU_POPUP) && RC_CascadeBtn(rc) && (RC_Type (XtParent(RC_CascadeBtn(rc))) == XmMENU_BAR) && (FindPrevMenuBarCascade((XmRowColumnWidget) XtParent(RC_CascadeBtn(rc))))) { GadgetCleanup(rc, (XmGadget) oldActiveChild); done = True; } /* * if we are in a pulldown from another posted menupane, unpost this one */ else if ((RC_Type(rc) == XmMENU_PULLDOWN) && RC_CascadeBtn(rc) && (RC_Type(XtParent(RC_CascadeBtn(rc))) != XmMENU_OPTION) && XmIsMenuShell(XtParent(rc))) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownOne)) (XtParent(rc), NULL, NULL, NULL); done = True; } return (done); } /* * Search for the next menu item according to the direction */ static void LocateChild ( XmRowColumnWidget rc, Widget wid, XmTraversalDirection direction ) { Boolean done = False; Widget nextWidget; /* special case a popped up submenu with no traversable items */ if (XmIsRowColumn(wid) && ((XmManagerWidget) wid)->manager.active_child == 0) { if (direction == XmTRAVERSE_LEFT) WrapLeft (rc); else if (direction == XmTRAVERSE_RIGHT) WrapRight (rc); } else { nextWidget = _XmNavigate(wid, direction); if (direction == XmTRAVERSE_LEFT) { /* watch for left wrap */ if ((wid->core.x <= nextWidget->core.x) || (nextWidget->core.y + nextWidget->core.height <= wid->core.y) || (nextWidget->core.y >= wid->core.y + wid->core.height)) done = WrapLeft(rc); } else if (direction == XmTRAVERSE_RIGHT) { /* watch for right wrap */ if ((wid->core.x >= nextWidget->core.x) || (wid->core.y + wid->core.height <= nextWidget->core.y) || (wid->core.y >= nextWidget->core.y + nextWidget->core.height)) done = WrapRight(rc); } if (!done) _XmMgrTraversal (nextWidget, XmTRAVERSE_CURRENT); } } void _XmMenuTraversalHandler( Widget w, Widget pw, XmTraversalDirection direction ) { XmRowColumnWidget rc = (XmRowColumnWidget) w; if (_XmGetInDragMode((Widget) rc)) return; if ( LayoutIsRtoLM(rc) ) { if (direction == XmTRAVERSE_RIGHT) direction = XmTRAVERSE_LEFT; else if (direction == XmTRAVERSE_LEFT) direction = XmTRAVERSE_RIGHT; } if (RC_Type(rc) != XmMENU_BAR) { /* check for cascading into a submenu */ if (direction == XmTRAVERSE_RIGHT && XmIsCascadeButtonGadget(pw) && CBG_Submenu(pw)) { (*(((XmGadgetClassRec *)XtClass(pw))->gadget_class. arm_and_activate))( (Widget) pw, NULL, NULL, NULL); } else if (direction == XmTRAVERSE_RIGHT && XmIsCascadeButton(pw) && CB_Submenu(pw)) { (*(((XmPrimitiveClassRec *)XtClass(pw))->primitive_class. arm_and_activate)) ((Widget) pw, NULL, NULL, NULL); } else LocateChild (rc, pw, direction); } else { switch (direction) { case XmTRAVERSE_DOWN: { MoveDownInMenuBar (rc, pw); break; } case XmTRAVERSE_LEFT: { MoveLeftInMenuBar(rc, pw); break; } case XmTRAVERSE_RIGHT: { MoveRightInMenuBar(rc, pw); break; } case XmTRAVERSE_UP: default: break; } } } /* * When the PM menubar mode is active, down arrow will * cause us to post the menupane associated with the active cascade button * in the menubar. */ static void MoveDownInMenuBar( XmRowColumnWidget rc, Widget pw ) { if (rc->manager.active_child == NULL) return; if (XmIsPrimitive(pw)) { XmPrimitiveClassRec * prim; CB_SetTraverse (pw, TRUE); prim = (XmPrimitiveClassRec *)XtClass(pw); (*(prim->primitive_class.arm_and_activate)) ((Widget) pw, NULL, NULL, NULL); CB_SetTraverse (pw, FALSE); } else if (XmIsGadget(pw)) { XmGadgetClassRec * gad; CBG_SetTraverse (pw, TRUE); gad = (XmGadgetClassRec *)XtClass(pw); (*(gad->gadget_class.arm_and_activate)) ((Widget) pw, NULL, NULL, NULL); CBG_SetTraverse (pw, FALSE); } } /* ARGSUSED */ static void MoveLeftInMenuBar( XmRowColumnWidget rc, Widget pw ) { XmMenuState mst = _XmGetMenuState((Widget)rc); if ((mst->MU_CurrentMenuChild != NULL) && (RC_PopupPosted(rc) != NULL) && ((XmIsCascadeButtonGadget(pw) && !CBG_Submenu(pw)) || (XmIsCascadeButton(pw) && !CB_Submenu(pw)))) { /* Move to the previous item in the menubar */ FindPrevMenuBarItem(rc); } else { /* Move to the previous item in the menubar */ mst->MU_CurrentMenuChild = NULL; FindPrevMenuBarItem(rc); } } static void MoveRightInMenuBar( XmRowColumnWidget rc, Widget pw ) { XmMenuState mst = _XmGetMenuState((Widget)rc); if ((rc->manager.active_child == NULL) && ((XmIsCascadeButtonGadget(pw) && !CBG_Submenu(pw)) || (XmIsCascadeButton(pw) && !CB_Submenu(pw)))) { FindNextMenuBarCascade(rc); } else { /* Move to the next item in the menubar */ mst->MU_CurrentMenuChild = NULL; FindNextMenuBarItem(rc); } } /* * Find the next cascade button in the menubar which can be traversed to. */ static void FindNextMenuBarItem( XmRowColumnWidget menubar ) { register int i, j; int upper_limit; Widget active_child; /* * We're not in the PM menubar mode if we don't have an active child. */ if (menubar->manager.active_child == NULL) return; upper_limit = menubar->composite.num_children; active_child = menubar->manager.active_child; /* Find the index of the currently active item */ for (i = 0; i < upper_limit; i++) { if (menubar->composite.children[i] == active_child) break; } /* Start looking at the next child */ for (j = 0, i++; j < upper_limit - 1; j++, i++) { /* Wrap, if necessary */ if (i >= upper_limit) i = 0; if (ValidateMenuBarItem(active_child, menubar->composite.children[i])) return; } } /* * Find the previous cascade button in the menubar which can be traversed to. */ static void FindPrevMenuBarItem( XmRowColumnWidget menubar ) { register int i, j; int upper_limit; Widget active_child; /* We're not in the PM menubar mode if we don't have an active child */ if (menubar->manager.active_child == NULL) return; upper_limit = menubar->composite.num_children; active_child = menubar->manager.active_child; /* Find the index of the currently active item */ for (i = 0; i < upper_limit; i++) { if (menubar->composite.children[i] == active_child) break; } /* Start looking at the previous child */ for (j = 0, --i; j < upper_limit - 1; j++, --i) { /* Wrap, if necessary */ if (i < 0) i = upper_limit - 1; if (ValidateMenuBarItem(active_child, menubar->composite.children[i])) return; } } static Boolean ValidateMenuBarItem ( Widget oldActiveChild, Widget newActiveChild) { XmMenuState mst = _XmGetMenuState((Widget)oldActiveChild); if (XmIsTraversable(newActiveChild)) { (void) XmProcessTraversal (newActiveChild, XmTRAVERSE_CURRENT); if (XmIsPrimitive(newActiveChild)) { XmPrimitiveClassRec * prim; prim = (XmPrimitiveClassRec *)XtClass(newActiveChild); if (!mst->MU_InPMMode && CB_Submenu(newActiveChild)) (*(prim->primitive_class.arm_and_activate)) (newActiveChild, NULL, NULL, NULL); } else if (XmIsGadget(newActiveChild)) { XmGadgetClassRec * gadget; gadget = (XmGadgetClassRec *)XtClass(newActiveChild); if (!mst->MU_InPMMode && CBG_Submenu(newActiveChild)) (*(gadget->gadget_class.arm_and_activate)) (newActiveChild, NULL, NULL, NULL); } return True; } else return False; } /* * Find the next hierarchy in the menubar which can be traversed to. */ static Boolean FindNextMenuBarCascade( XmRowColumnWidget menubar ) { Widget active_child = NULL; register int i, j; int upper_limit; ShellWidget shell; XmMenuState mst = _XmGetMenuState((Widget)menubar); upper_limit = menubar->composite.num_children; /* * Determine which child is popped up. */ shell = (ShellWidget) RC_PopupPosted(menubar); if (shell != NULL) active_child = mst->MU_CurrentMenuChild = RC_CascadeBtn(shell->composite.children[0]); /* Find the index of the currently active item */ for (i = 0; i < upper_limit; i++) { if (menubar->composite.children[i] == mst->MU_CurrentMenuChild) break; } /* Start looking at the next child */ for (j = 0, i++; j < upper_limit - 1; j++, i++) { /* Wrap, if necessary */ if (i >= upper_limit) i = 0; mst->MU_CurrentMenuChild = menubar->composite.children[i]; if (ValidateMenuBarCascade(active_child, mst->MU_CurrentMenuChild)) return True; } return False; } /* * Find the previous hierarchy in the menubar which can be traversed to. */ static Boolean FindPrevMenuBarCascade( XmRowColumnWidget menubar ) { Widget active_child = NULL; register int i, j; int upper_limit; ShellWidget shell; XmMenuState mst = _XmGetMenuState((Widget)menubar); upper_limit = menubar->composite.num_children; /* Determine which child is popped up */ shell = (ShellWidget) RC_PopupPosted(menubar); if (shell != NULL) active_child = mst->MU_CurrentMenuChild = RC_CascadeBtn(shell->composite.children[0]); /* Find the index of the currently active item */ for (i = 0; i < upper_limit; i++) { if (menubar->composite.children[i] == mst->MU_CurrentMenuChild) break; } /* Start looking at the previous child */ for (j = 0, --i; j < upper_limit - 1; j++, --i) { /* Wrap, if necessary */ if (i < 0) i = upper_limit - 1; mst->MU_CurrentMenuChild = menubar->composite.children[i]; if (ValidateMenuBarCascade(active_child, mst->MU_CurrentMenuChild)) return True; } return False; } /*ARGSUSED*/ static Boolean ValidateMenuBarCascade (Widget oldActiveChild, /* unused */ Widget newMenuChild) { XmRowColumnWidget menubar = (XmRowColumnWidget)XtParent(newMenuChild); Time _time = XtLastTimestampProcessed(XtDisplay(menubar)); if (XmIsTraversable(newMenuChild)) { if (XmIsCascadeButtonGadget(newMenuChild)) { XmGadgetClassRec * gadget; gadget = (XmGadgetClassRec *)XtClass(newMenuChild); if (RC_PopupPosted(menubar) && !CBG_Submenu(newMenuChild)) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone)) (RC_PopupPosted(menubar),NULL, NULL, NULL); /* Return the X focus to the Menubar hierarchy from the menushell. * Set the Xt focus to the cascade */ _XmMenuFocus((Widget) menubar, XmMENU_MIDDLE, _time); (void)XmProcessTraversal(newMenuChild, XmTRAVERSE_CURRENT); } else { (*(gadget->gadget_class.arm_and_activate)) (newMenuChild, NULL, NULL, NULL); } return True; } else if (XmIsCascadeButton (newMenuChild)) { XmPrimitiveClassRec * prim; prim = (XmPrimitiveClassRec *)XtClass(newMenuChild); /* No submenu means PM mode */ if (RC_PopupPosted(menubar) && !CB_Submenu(newMenuChild)) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone)) (RC_PopupPosted(menubar),NULL, NULL, NULL); /* Update X and Xt focus */ _XmMenuFocus((Widget) menubar, XmMENU_MIDDLE, _time); (void)XmProcessTraversal(newMenuChild, XmTRAVERSE_CURRENT); } else { (*(prim->primitive_class.arm_and_activate)) (newMenuChild, NULL, NULL, NULL); } return True; } } return False; } /* (New) Grab strategy for menus requires grab before posting. If not possible * don't post the menu! This will ensure grabs active during a posted menu. * This will help consistency by preventing simultaneously posted menus. */ int _XmMenuGrabKeyboardAndPointer( Widget widget, Time time ) { register int status = (_XmGrabKeyboard(widget, True, GrabModeSync, GrabModeAsync, time) != GrabSuccess); if (status) return(status); status = _XmGrabPointer(widget, True, EVENTS, GrabModeSync, GrabModeAsync, None, XmGetMenuCursor(XtDisplay(widget)), time) != GrabSuccess; if (status) XtUngrabKeyboard(widget, CurrentTime); return(status); } motif-2.3.8/lib/Xm/Protocols.c0000644000175000017500000007105013145162623013053 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Protocols.c /main/15 1996/10/17 12:00:24 cde-osf $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include /* for bzero et al */ #include #include "BaseClassI.h" #include "CallbackI.h" #include "ExtObjectI.h" #include "MessagesI.h" #include "ProtocolsI.h" #include "XmI.h" #define MSG1 _XmMMsgProtocols_0000 #define MSG2 _XmMMsgProtocols_0001 #define MSG3 _XmMMsgProtocols_0002 #define MAX_PROTOCOLS 32 #define PROTOCOL_BLOCK_SIZE 4 /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass w) ; static void Initialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static void RemoveAllPMgrHandler( Widget w, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch) ; static void RemoveAllPMgr( Widget w, XtPointer closure, XtPointer call_data) ; static XmAllProtocolsMgr GetAllProtocolsMgr( Widget shell) ; static void UpdateProtocolMgrProperty( Widget shell, XmProtocolMgr p_mgr) ; static void InstallProtocols( Widget w, XmAllProtocolsMgr ap_mgr) ; static void RealizeHandler( Widget w, XtPointer closure, XEvent *event, Boolean *cont) ; static void ProtocolHandler( Widget w, XtPointer closure, XEvent *event, Boolean *cont) ; static XmProtocol GetProtocol( XmProtocolMgr p_mgr, Atom p_atom) ; static XmProtocolMgr AddProtocolMgr( XmAllProtocolsMgr ap_mgr, Atom property) ; static XmProtocolMgr GetProtocolMgr( XmAllProtocolsMgr ap_mgr, Atom property) ; static void RemoveProtocolMgr( XmAllProtocolsMgr ap_mgr, XmProtocolMgr p_mgr) ; static void AddProtocols( Widget shell, XmProtocolMgr p_mgr, Atom *protocols, Cardinal num_protocols) ; static void RemoveProtocols( Widget shell, XmProtocolMgr p_mgr, Atom *protocols, Cardinal num_protocols) ; /******** End Static Function Declarations ********/ /*************************************************************************** * * ProtocolObject Resources * ***************************************************************************/ static XContext allProtocolsMgrContext = (XContext) NULL; #define Offset(field) XtOffsetOf( struct _XmProtocolRec, protocol.field) static XtResource protocolResources[] = { { XmNextensionType, XmCExtensionType, XmRExtensionType, sizeof (unsigned char), XtOffsetOf( struct _XmExtRec, ext.extensionType), XmRImmediate, (XtPointer)XmPROTOCOL_EXTENSION, }, { XmNprotocolCallback, XmCProtocolCallback, XmRCallback, sizeof (XtCallbackList), Offset (callbacks), XmRImmediate, (XtPointer)NULL, }, }; #undef Offset externaldef(xmprotocolclassrec) XmProtocolClassRec xmProtocolClassRec = { { (WidgetClass) &xmExtClassRec,/* superclass */ "protocol", /* class_name */ sizeof(XmProtocolRec), /* size */ ClassInitialize, /* Class Initializer */ ClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ Initialize, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ protocolResources, /* resources */ XtNumber(protocolResources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, { NULL, /* synthetic resources */ 0, /* num syn resources */ }, { NULL, /* extension */ }, }; externaldef(xmprotocolobjectclass) WidgetClass xmProtocolObjectClass = (WidgetClass) (&xmProtocolClassRec); /************************************************************************ * * ClassInitialize * Initialize the vendorShell class structure. This is called only * the first time a vendorShell widget is created. It registers the * resource type converters unique to this class. * ************************************************************************/ static void ClassInitialize( void ) { } /************************************************************************ * * ClassPartInitialize * Set up the inheritance mechanism for the routines exported by * vendorShells class part. * ************************************************************************/ static void ClassPartInitialize( WidgetClass w ) { XmProtocolObjectClass wc = (XmProtocolObjectClass) w; if (wc == (XmProtocolObjectClass)xmProtocolObjectClass) return; } /*ARGSUSED*/ static void Initialize( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmProtocol ne = (XmProtocol) new_w; XmWidgetExtData extData; /* * we should free this in ExtObject's destroy proc, but since all * gadgets would need to change to not free it in thier code we'll * do it here. ||| */ extData = _XmGetWidgetExtData(ne->ext.logicalParent, ne->ext.extensionType); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return; } _XmProcessLock(); _XmExtObjFree((XtPointer) extData->reqWidget); _XmProcessUnlock(); extData->reqWidget = NULL; } /************************************************************************ * * Destroy * ************************************************************************/ /*ARGSUSED*/ static void Destroy( Widget w ) /* unused */ { /*EMPTY*/ } /*ARGSUSED*/ static void RemoveAllPMgrHandler( Widget w, XtPointer closure, XEvent *event, /* unused */ Boolean *continue_to_dispatch) { XmAllProtocolsMgr ap_mgr = (XmAllProtocolsMgr) closure ; Cardinal i; for (i = 0; i < ap_mgr->num_protocol_mgrs; i++) { RemoveProtocolMgr(ap_mgr, ap_mgr->protocol_mgrs[i]); } /* free the context manager entry ||| */ XDeleteContext(XtDisplay(w), (Window)w, allProtocolsMgrContext); XtFree((char *)ap_mgr->protocol_mgrs); XtFree((char *)ap_mgr); *continue_to_dispatch = False; return ; } /************************************<+>************************************* * * RemoveAllPMgr * *************************************<+>************************************/ /*ARGSUSED*/ static void RemoveAllPMgr( Widget w, XtPointer closure, XtPointer call_data ) /* unused */ { XEvent ev ; Boolean save_sensitive = w->core.sensitive ; Boolean save_ancestor_sensitive = w->core.ancestor_sensitive ; XtInsertEventHandler( w, KeyPressMask, TRUE, RemoveAllPMgrHandler, closure, XtListHead) ; bzero((void *) &ev, sizeof(XEvent)); ev.xkey.type = KeyPress ; ev.xkey.display = XtDisplay( w) ; ev.xkey.time = XtLastTimestampProcessed( XtDisplay( w)) ; ev.xkey.send_event = True ; ev.xkey.serial = LastKnownRequestProcessed( XtDisplay( w)) ; ev.xkey.window = XtWindow( w) ; ev.xkey.keycode = 0; ev.xkey.state = 0; /* make sure we get it even if we're unrealized, or if widget * is insensitive. */ XtAddGrab( w, True, True) ; w->core.sensitive = TRUE ; w->core.ancestor_sensitive = TRUE ; XtDispatchEvent(&ev) ; w->core.sensitive = save_sensitive ; w->core.ancestor_sensitive = save_ancestor_sensitive ; XtRemoveGrab( w) ; XtRemoveEventHandler(w, (EventMask)NULL, TRUE, RemoveAllPMgrHandler, closure) ; } /************************************<+>************************************* * * GetAllProtocolsMgr * *************************************<+>************************************/ static XmAllProtocolsMgr GetAllProtocolsMgr( Widget shell ) { XmAllProtocolsMgr ap_mgr; Display *display; if (!XmIsVendorShell(shell)) { XmeWarning(NULL, MSG1); return ((XmAllProtocolsMgr)0); } else { display = XtDisplay(shell); _XmProcessLock(); if (allProtocolsMgrContext == (XContext) NULL) allProtocolsMgrContext = XUniqueContext(); _XmProcessUnlock(); if (XFindContext(display, (Window) shell, allProtocolsMgrContext, (char **)&ap_mgr)) { ap_mgr = XtNew(XmAllProtocolsMgrRec); ap_mgr->shell = shell; ap_mgr->num_protocol_mgrs = ap_mgr->max_protocol_mgrs = 0; ap_mgr->protocol_mgrs = NULL; (void) XSaveContext(display, (Window) shell, allProtocolsMgrContext, (XPointer) ap_mgr); /* !!! should this be in some init code for vendor shell ? */ /* if shell isn't realized, add an event handler for everybody */ if (!XtIsRealized(shell)) { XtAddEventHandler((Widget) shell, StructureNotifyMask, FALSE, RealizeHandler, (XtPointer) ap_mgr); } XtAddCallback((Widget) shell, XmNdestroyCallback, RemoveAllPMgr, (XtPointer)ap_mgr); } return ap_mgr; } } /************************************<+>************************************* * * SetProtocolProperty * *************************************<+>************************************/ #define SetProtocolProperty(shell, property, prop_type, atoms, num_atoms) \ XChangeProperty((shell)->core.screen->display, XtWindow(shell), \ property, prop_type, 32, PropModeReplace, \ atoms, num_atoms) /************************************<+>************************************* * * UpdateProtocolMgrProperty * *************************************<+>************************************/ static void UpdateProtocolMgrProperty( Widget shell, XmProtocolMgr p_mgr ) { Cardinal i, num_active = 0; Atom active_protocols[MAX_PROTOCOLS]; XmProtocolList protocols = p_mgr->protocols; for (i = 0; i < p_mgr->num_protocols; i++) { if (protocols[i]->protocol.active) active_protocols[num_active++] = protocols[i]->protocol.atom; } SetProtocolProperty(shell, p_mgr->property, XA_ATOM, (unsigned char *)active_protocols, num_active); } /************************************<+>************************************* * * InstallProtocols * *************************************<+>************************************/ static void InstallProtocols( Widget w, XmAllProtocolsMgr ap_mgr ) { Cardinal i; XtAddRawEventHandler(w, (EventMask)0, TRUE, ProtocolHandler, (XtPointer) ap_mgr); XtRemoveEventHandler(w,StructureNotifyMask , FALSE, RealizeHandler, ap_mgr); for (i=0; i < ap_mgr->num_protocol_mgrs; i++) UpdateProtocolMgrProperty(w, ap_mgr->protocol_mgrs[i]); } /************************************<+>************************************* * * RealizeHandler * *************************************<+>************************************/ /*ARGSUSED*/ static void RealizeHandler( Widget w, XtPointer closure, XEvent *event, Boolean *cont ) /* unused */ { XmAllProtocolsMgr ap_mgr = (XmAllProtocolsMgr)closure; switch (event->type) { case MapNotify: InstallProtocols(w, ap_mgr); default: break; } } /************************************<+>************************************* * * ProtocolHandler * *************************************<+>************************************/ /*ARGSUSED*/ static void ProtocolHandler( Widget w, XtPointer closure, XEvent *event, Boolean *cont ) /* unused */ { XmAllProtocolsMgr ap_mgr = (XmAllProtocolsMgr)closure; XmProtocolMgr p_mgr; XmProtocol protocol; XmAnyCallbackStruct call_data_rec; XtCallbackProc func; call_data_rec.reason = XmCR_PROTOCOLS; call_data_rec.event = event; switch (event->type) { case ClientMessage: { XClientMessageEvent *p_event = (XClientMessageEvent *) event; Atom p_atom = (Atom) p_event->data.l[0]; if (((p_mgr = GetProtocolMgr(ap_mgr, (Atom)p_event->message_type)) == (XmProtocolMgr)0) || ((protocol = GetProtocol(p_mgr, p_atom)) == (XmProtocol)0)) return; else { if ((func = protocol->protocol.pre_hook.callback) != (XtCallbackProc)0) (*func) (w, protocol->protocol.pre_hook.closure, (XtPointer) &call_data_rec); if (protocol->protocol.callbacks) _XmCallCallbackList(w, protocol->protocol.callbacks, (XtPointer) &call_data_rec); if ((func = protocol->protocol.post_hook.callback) != (XtCallbackProc)0) (*func) (w, protocol->protocol.post_hook.closure, (XtPointer) &call_data_rec); } break; } default: { break; } } } /************************************<+>************************************* * * GetProtocol * *************************************<+>************************************/ static XmProtocol GetProtocol( XmProtocolMgr p_mgr, Atom p_atom ) { Cardinal i; XmProtocol protocol; i = 0; while ((i < p_mgr->num_protocols) && (p_mgr->protocols[i]->protocol.atom != p_atom)) i++; if (i < p_mgr->num_protocols) { protocol = p_mgr->protocols[i]; } else { protocol = (XmProtocol)0; } return(protocol); } /************************************<+>************************************* * * AddProtocolMgr * *************************************<+>************************************/ static XmProtocolMgr AddProtocolMgr( XmAllProtocolsMgr ap_mgr, Atom property ) { XmProtocolMgr p_mgr; Cardinal i; i = 0; while ((i < ap_mgr->num_protocol_mgrs) && (ap_mgr->protocol_mgrs[i]->property != property)) i++; if (i < ap_mgr->num_protocol_mgrs) { XmeWarning(NULL, MSG2); } if (ap_mgr->num_protocol_mgrs + 2 >= ap_mgr->max_protocol_mgrs) { ap_mgr->max_protocol_mgrs += 2; ap_mgr->protocol_mgrs = (XmProtocolMgrList) XtRealloc((char *) ap_mgr->protocol_mgrs , ((unsigned) (ap_mgr->max_protocol_mgrs) * sizeof(XmProtocolMgr))); } ap_mgr->protocol_mgrs[ap_mgr->num_protocol_mgrs++] = p_mgr = XtNew(XmProtocolMgrRec); p_mgr->property = property; p_mgr->num_protocols = p_mgr->max_protocols = 0; p_mgr->protocols = NULL; return(p_mgr); } /************************************<+>************************************* * * GetProtcolMgr * *************************************<+>************************************/ static XmProtocolMgr GetProtocolMgr( XmAllProtocolsMgr ap_mgr, Atom property ) { XmProtocolMgr p_mgr = (XmProtocolMgr)0; Cardinal i; if (!ap_mgr) return p_mgr; i = 0; while ((i < ap_mgr->num_protocol_mgrs) && (ap_mgr->protocol_mgrs[i]->property != property)) i++; if (i < ap_mgr->num_protocol_mgrs) { p_mgr = ap_mgr->protocol_mgrs[i]; } else p_mgr = (XmProtocolMgr)0; return p_mgr; } /************************************<+>************************************* * * RemoveProtocolMgr * *************************************<+>************************************/ static void RemoveProtocolMgr( XmAllProtocolsMgr ap_mgr, XmProtocolMgr p_mgr ) { Widget shell = ap_mgr->shell; Cardinal i; for (i = 0; i < p_mgr->num_protocols; i++) { _XmRemoveAllCallbacks( (InternalCallbackList *)&(p_mgr->protocols[i]->protocol.callbacks) ); XtFree((char *) p_mgr->protocols[i]); } if (XtIsRealized(shell)) XDeleteProperty(XtDisplay(shell), XtWindow(shell), p_mgr->property); for (i = 0; i < ap_mgr->num_protocol_mgrs; i++) if (ap_mgr->protocol_mgrs[i] == p_mgr) break; XtFree((char *) p_mgr->protocols); XtFree((char *) p_mgr); /* ripple mgrs down */ for ( ; i < ap_mgr->num_protocol_mgrs-1; i++) ap_mgr->protocol_mgrs[i] = ap_mgr->protocol_mgrs[i+1]; } /************************************<+>************************************* * * AddProtocols * *************************************<+>************************************/ static void AddProtocols( Widget shell, XmProtocolMgr p_mgr, Atom *protocols, Cardinal num_protocols ) { Cardinal new_num_protocols, i, j; XtPointer newSec; WidgetClass wc; Cardinal size; wc = XtClass(shell); size = wc->core_class.widget_size; new_num_protocols = p_mgr->num_protocols + num_protocols; if (new_num_protocols >= p_mgr->max_protocols) { /* Allocate more space */ Cardinal add_size; if (num_protocols >= PROTOCOL_BLOCK_SIZE) add_size = num_protocols + PROTOCOL_BLOCK_SIZE; else add_size = PROTOCOL_BLOCK_SIZE; p_mgr->max_protocols += add_size; p_mgr->protocols = (XmProtocolList) XtRealloc((char *) p_mgr->protocols , (unsigned) (p_mgr->max_protocols) * sizeof(XmProtocol)); } for (i = p_mgr->num_protocols, j = 0; i < new_num_protocols; i++,j++) { newSec = XtMalloc(size); ((XmProtocol) newSec)->protocol.atom = protocols[j]; ((XmProtocol)newSec)->protocol.active = TRUE; /*default */ ((XmProtocol)newSec)->protocol.callbacks = (XtCallbackList)0; ((XmProtocol)newSec)->protocol.pre_hook.callback = ((XmProtocol)newSec)->protocol.post_hook.callback = (XtCallbackProc)0; ((XmProtocol)newSec)->protocol.pre_hook.closure = ((XmProtocol)newSec)->protocol.post_hook.closure = (XtPointer)0; p_mgr->protocols[i] = (XmProtocol)newSec; } p_mgr->num_protocols = new_num_protocols; } /************************************<+>************************************* * * RemoveProtocols * *************************************<+>************************************/ /*ARGSUSED*/ static void RemoveProtocols( Widget shell, /* unused */ XmProtocolMgr p_mgr, Atom *protocols, Cardinal num_protocols ) { Boolean match_list[MAX_PROTOCOLS]; Cardinal i, j; if (!p_mgr || !p_mgr->num_protocols || !num_protocols) return; if (p_mgr->num_protocols > MAX_PROTOCOLS) XmeWarning(NULL, MSG3); for (i = 0; i <= p_mgr->num_protocols; i++) match_list[i] = FALSE; /* setup the match list */ for (i = 0; i < num_protocols; i++) { j = 0; while ((j < p_mgr->num_protocols) && (p_mgr->protocols[j]->protocol.atom != protocols[i])) j++; if (j < p_mgr->num_protocols) match_list[j] = TRUE; } /* * keep only the protocols that arent in the match list. */ for (j = 0, i = 0; i < p_mgr->num_protocols; i++) { if ( ! match_list[i] ) { p_mgr->protocols[j] = p_mgr->protocols[i]; j++; } else { _XmRemoveAllCallbacks((InternalCallbackList *) &(p_mgr->protocols[i]->protocol.callbacks)); XtFree((char *) p_mgr->protocols[i]); } } p_mgr->num_protocols = j; } /* * * PUBLIC INTERFACES * */ /************************************<+>************************************* * * _XmInstallProtocols * *************************************<+>************************************/ void _XmInstallProtocols( Widget w ) { XmAllProtocolsMgr ap_mgr; if ((ap_mgr = GetAllProtocolsMgr(w)) != NULL) InstallProtocols(w, ap_mgr); } /************************************<+>************************************* * * XmAddProtocols * *************************************<+>************************************/ void XmAddProtocols( Widget shell, Atom property, Atom *protocols, Cardinal num_protocols ) { XmAllProtocolsMgr ap_mgr; XmProtocolMgr p_mgr ; _XmWidgetToAppContext(shell); _XmAppLock(app); if (shell->core.being_destroyed) { _XmAppUnlock(app); return; } if (((ap_mgr = GetAllProtocolsMgr(shell)) == 0) || !num_protocols) { _XmAppUnlock(app); return; } if ((p_mgr = GetProtocolMgr(ap_mgr, property)) == 0) p_mgr = AddProtocolMgr(ap_mgr, property); /* get rid of duplicates and then append to end */ RemoveProtocols(shell, p_mgr, protocols, num_protocols); AddProtocols(shell, p_mgr, protocols, num_protocols); if (XtIsRealized(shell)) UpdateProtocolMgrProperty(shell, p_mgr); _XmAppUnlock(app); } /************************************<+>************************************* * * XmRemoveProtocols * *************************************<+>************************************/ void XmRemoveProtocols( Widget shell, Atom property, Atom *protocols, Cardinal num_protocols ) { XmAllProtocolsMgr ap_mgr; XmProtocolMgr p_mgr ; _XmWidgetToAppContext(shell); _XmAppLock(app); if (shell->core.being_destroyed) { _XmAppUnlock(app); return; } if (((ap_mgr = GetAllProtocolsMgr(shell)) == 0) || ((p_mgr = GetProtocolMgr(ap_mgr, property)) == 0) || !num_protocols) { _XmAppUnlock(app); return; } RemoveProtocols(shell, p_mgr, protocols, num_protocols); if (XtIsRealized(shell)) UpdateProtocolMgrProperty(shell, p_mgr); _XmAppUnlock(app); } /************************************<+>************************************* * * XmAddProtocolCallback * *************************************<+>************************************/ void XmAddProtocolCallback( Widget shell, Atom property, Atom proto_atom, XtCallbackProc callback, XtPointer closure ) { XmAllProtocolsMgr ap_mgr; XmProtocolMgr p_mgr ; XmProtocol protocol; _XmWidgetToAppContext(shell); _XmAppLock(app); if (shell->core.being_destroyed) { _XmAppUnlock(app); return; } if ((ap_mgr = GetAllProtocolsMgr(shell)) == (XmAllProtocolsMgr)0) { _XmAppUnlock(app); return; } if ((p_mgr = GetProtocolMgr(ap_mgr, property)) == (XmProtocolMgr)0) p_mgr = AddProtocolMgr(ap_mgr, property); if ((protocol = GetProtocol(p_mgr, proto_atom)) == (XmProtocol)0) { XmAddProtocols(shell, property, &proto_atom, 1); protocol = GetProtocol(p_mgr, proto_atom); } _XmAddCallback((InternalCallbackList *) &(protocol->protocol.callbacks), callback, closure) ; _XmAppUnlock(app); } /************************************<+>************************************* * * XmRemoveProtocolCallback * *************************************<+>************************************/ void XmRemoveProtocolCallback( Widget shell, Atom property, Atom proto_atom, XtCallbackProc callback, XtPointer closure ) { XmAllProtocolsMgr ap_mgr; XmProtocolMgr p_mgr ; XmProtocol protocol; _XmWidgetToAppContext(shell); _XmAppLock(app); if (shell->core.being_destroyed) { _XmAppUnlock(app); return; } if (((ap_mgr = GetAllProtocolsMgr(shell)) == 0) || ((p_mgr = GetProtocolMgr(ap_mgr, property)) == 0) || ((protocol = GetProtocol(p_mgr, proto_atom)) == 0)) { _XmAppUnlock(app); return; } _XmRemoveCallback((InternalCallbackList *) &(protocol->protocol.callbacks), callback, closure) ; _XmAppUnlock(app); } /************************************<+>************************************* * * XmActivateProtocol * *************************************<+>************************************/ void XmActivateProtocol( Widget shell, Atom property, Atom proto_atom ) { XmAllProtocolsMgr ap_mgr; XmProtocolMgr p_mgr ; XmProtocol protocol; _XmWidgetToAppContext(shell); _XmAppLock(app); if (shell->core.being_destroyed) { _XmAppUnlock(app); return; } if (((ap_mgr = GetAllProtocolsMgr(shell)) == 0) || ((p_mgr = GetProtocolMgr(ap_mgr, property)) == 0) || ((protocol = GetProtocol(p_mgr, proto_atom)) == 0) || protocol->protocol.active) { _XmAppUnlock(app); return; } else { protocol->protocol.active = TRUE; if (XtIsRealized(shell)) UpdateProtocolMgrProperty(shell, p_mgr); } _XmAppUnlock(app); } /************************************<+>************************************* * * XmDeactivateProtocol * *************************************<+>************************************/ void XmDeactivateProtocol( Widget shell, Atom property, Atom proto_atom ) { XmAllProtocolsMgr ap_mgr; XmProtocolMgr p_mgr ; XmProtocol protocol; _XmWidgetToAppContext(shell); _XmAppLock(app); if (shell->core.being_destroyed) { _XmAppUnlock(app); return; } if (((ap_mgr = GetAllProtocolsMgr(shell)) == 0) || ((p_mgr = GetProtocolMgr(ap_mgr, property)) == 0) || ((protocol = GetProtocol(p_mgr, proto_atom)) == 0) || !protocol->protocol.active) { _XmAppUnlock(app); return; } else { protocol->protocol.active = FALSE; if (XtIsRealized(shell)) UpdateProtocolMgrProperty(shell, p_mgr); } _XmAppUnlock(app); } /************************************<+>************************************* * * XmSetProtocolHooks * *************************************<+>************************************/ void XmSetProtocolHooks( Widget shell, Atom property, Atom proto_atom, XtCallbackProc pre_hook, XtPointer pre_closure, XtCallbackProc post_hook, XtPointer post_closure ) { XmAllProtocolsMgr ap_mgr; XmProtocolMgr p_mgr ; XmProtocol protocol; _XmWidgetToAppContext(shell); _XmAppLock(app); if (shell->core.being_destroyed) { _XmAppUnlock(app); return; } if (((ap_mgr = GetAllProtocolsMgr(shell)) == 0) || ((p_mgr = GetProtocolMgr(ap_mgr, property)) == 0) || ((protocol = GetProtocol(p_mgr, proto_atom)) == 0)) { _XmAppUnlock(app); return; } protocol->protocol.pre_hook.callback = pre_hook; protocol->protocol.pre_hook.closure = pre_closure; protocol->protocol.post_hook.callback = post_hook; protocol->protocol.post_hook.closure = post_closure; _XmAppUnlock(app); } motif-2.3.8/lib/Xm/Xpmhashtab.c0000644000175000017500000001515212672140200013156 00000000000000/* $XConsortium: Xpmhashtab.c /main/2 1996/09/20 08:15:27 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * hashtab.c: * * * * XPM library * * * * Developed by Arnaud Le Hors * * this originaly comes from Colas Nahaboo as a part of Wool * * * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" LFUNC(AtomMake, xpmHashAtom, (char *name, void *data)); LFUNC(HashTableGrows, int, (xpmHashTable * table)); static xpmHashAtom AtomMake(name, data) /* makes an atom */ char *name; /* WARNING: is just pointed to */ void *data; { xpmHashAtom object = (xpmHashAtom) XpmMalloc(sizeof(struct _xpmHashAtom)); if (object) { object->name = name; object->data = data; } return object; } /************************\ * * * hash table routines * * * \************************/ /* * Hash function definition: * HASH_FUNCTION: hash function, hash = hashcode, hp = pointer on char, * hash2 = temporary for hashcode. * INITIAL_TABLE_SIZE in slots * HASH_TABLE_GROWS how hash table grows. */ /* Mock lisp function */ #define HASH_FUNCTION hash = (hash << 5) - hash + *hp++; /* #define INITIAL_HASH_SIZE 2017 */ #define INITIAL_HASH_SIZE 256 /* should be enough for colors */ #define HASH_TABLE_GROWS size = size * 2; /* aho-sethi-ullman's HPJ (sizes should be primes)*/ #ifdef notdef #define HASH_FUNCTION hash <<= 4; hash += *hp++; \ if(hash2 = hash & 0xf0000000) hash ^= (hash2 >> 24) ^ hash2; #define INITIAL_HASH_SIZE 4095 /* should be 2^n - 1 */ #define HASH_TABLE_GROWS size = size << 1 + 1; #endif /* GNU emacs function */ /* #define HASH_FUNCTION hash = (hash << 3) + (hash >> 28) + *hp++; #define INITIAL_HASH_SIZE 2017 #define HASH_TABLE_GROWS size = size * 2; */ /* end of hash functions */ /* * The hash table is used to store atoms via their NAME: * * NAME --hash--> ATOM |--name--> "foo" * |--data--> any value which has to be stored * */ /* * xpmHashSlot gives the slot (pointer to xpmHashAtom) of a name * (slot points to NULL if it is not defined) * */ xpmHashAtom * xpmHashSlot(table, s) xpmHashTable *table; char *s; { xpmHashAtom *atomTable = table->atomTable; unsigned int hash; xpmHashAtom *p; char *hp = s; char *ns; hash = 0; while (*hp) { /* computes hash function */ HASH_FUNCTION } p = atomTable + hash % table->size; while (*p) { ns = (*p)->name; if (ns[0] == s[0] && strcmp(ns, s) == 0) break; p--; if (p < atomTable) p = atomTable + table->size - 1; } return p; } static int HashTableGrows(table) xpmHashTable *table; { xpmHashAtom *atomTable = table->atomTable; unsigned int size = table->size; xpmHashAtom *t, *p; int i; unsigned int oldSize = size; t = atomTable; HASH_TABLE_GROWS table->size = size; table->limit = size / 3; if (size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(size * sizeof(*atomTable)); if (!atomTable) return (XpmNoMemory); table->atomTable = atomTable; for (p = atomTable + size; p > atomTable;) *--p = NULL; for (i = 0, p = t; i < oldSize; i++, p++) if (*p) { xpmHashAtom *ps = xpmHashSlot(table, (*p)->name); *ps = *p; } XpmFree(t); return (XpmSuccess); } /* * xpmHashIntern(table, name, data) * an xpmHashAtom is created if name doesn't exist, with the given data. */ int xpmHashIntern(table, tag, data) xpmHashTable *table; char *tag; void *data; { xpmHashAtom *slot; if (!*(slot = xpmHashSlot(table, tag))) { /* undefined, make a new atom with the given data */ if (!(*slot = AtomMake(tag, data))) return (XpmNoMemory); if (table->used >= table->limit) { int ErrorStatus; if ((ErrorStatus = HashTableGrows(table)) != XpmSuccess) return (ErrorStatus); table->used++; return (XpmSuccess); } table->used++; } return (XpmSuccess); } /* * must be called before allocating any atom */ int xpmHashTableInit(table) xpmHashTable *table; { xpmHashAtom *p; xpmHashAtom *atomTable; table->size = INITIAL_HASH_SIZE; table->limit = table->size / 3; table->used = 0; if (table->size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(table->size * sizeof(*atomTable)); if (!atomTable) return (XpmNoMemory); for (p = atomTable + table->size; p > atomTable;) *--p = NULL; table->atomTable = atomTable; return (XpmSuccess); } /* * frees a hashtable and all the stored atoms */ void xpmHashTableFree(table) xpmHashTable *table; { xpmHashAtom *p; xpmHashAtom *atomTable = table->atomTable; if (!atomTable) return; for (p = atomTable + table->size; p > atomTable;) if (*--p) XpmFree(*p); XpmFree(atomTable); table->atomTable = NULL; } motif-2.3.8/lib/Xm/HashI.h0000644000175000017500000000426512672140200012063 00000000000000/* $TOG: HashI.h /main/6 1997/06/18 17:39:16 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmHashI_h #define _XmHashI_h #include #ifdef __cplusplus extern "C" { #endif typedef int XmHashValue; typedef XtPointer XmHashKey; typedef struct _XmHashTableRec *XmHashTable; typedef Boolean (*XmHashCompareProc)(XmHashKey, XmHashKey); typedef XmHashValue (*XmHashFunction)(XmHashKey); typedef Boolean (*XmHashMapProc)(XmHashKey, XtPointer value, XtPointer data); XmHashTable _XmAllocHashTable(Cardinal, XmHashCompareProc, XmHashFunction); void _XmResizeHashTable(XmHashTable, Cardinal); void _XmFreeHashTable(XmHashTable); XtPointer _XmGetHashEntryIterate(XmHashTable, XmHashKey, XtPointer*); void _XmAddHashEntry(XmHashTable, XmHashKey, XtPointer); XtPointer _XmRemoveHashEntry(XmHashTable, XmHashKey); XtPointer _XmRemoveHashIterator(XmHashTable, XtPointer*); Cardinal _XmHashTableCount(XmHashTable); Cardinal _XmHashTableSize(XmHashTable); void _XmMapHashTable(XmHashTable, XmHashMapProc, XtPointer); #ifdef DEBUG void _XmPrintHashTable(XmHashTable); #endif #define _XmGetHashEntry(table, key) _XmGetHashEntryIterate(table, key, NULL) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmHashI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ToolTip.c0000644000175000017500000002132212672140200012445 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "BaseClassI.h" #include "ToolTipI.h" #include "XmI.h" #ifdef FIX_1388 static void ToolTipLabelDestroyCallback(Widget w, XtPointer client_data, XtPointer call_data) { XmToolTipConfigTrait ttcp; ttcp = (XmToolTipConfigTrait) XmeTraitGet(w, XmQTtoolTipConfig); if (ttcp != NULL) if (ttcp->label != NULL) { Widget shell = XtParent(ttcp->label); XtDestroyWidget(ttcp->label); ttcp->label = NULL; XtDestroyWidget(shell); } } #endif /* FIX_1388 */ static XmToolTipConfigTrait ToolTipGetData (Widget w) { Widget top = w; XmToolTipConfigTrait ttp; while (XtParent (top)) { top = XtParent (top); } ttp = (XmToolTipConfigTrait) XmeTraitGet (top, XmQTtoolTipConfig); if (ttp != NULL && ttp->label == NULL && !top->core.being_destroyed) { Widget shell; shell = XtVaCreateWidget ("TipShell", transientShellWidgetClass, top, XmNoverrideRedirect, True, NULL); ttp->label = XmCreateLabel (shell, "TipLabel", NULL, 0); XtManageChild (ttp->label); #ifdef FIX_1388 XtAddCallback(top, XmNdestroyCallback, (XtCallbackProc) ToolTipLabelDestroyCallback, (XtPointer) NULL); #endif } return ttp; } static void ToolTipUnpost (XtPointer client_data, XtIntervalId * id) { XmToolTipConfigTrait ttp; ttp = (XmToolTipConfigTrait) client_data; if (ttp->duration_timer) { if (!id || (id && (*id != ttp->duration_timer))) { XtRemoveTimeOut (ttp->duration_timer); } ttp->duration_timer = (XtIntervalId) NULL; } if (ttp->slider) { XtDestroyWidget (ttp->slider); ttp->slider = NULL; } if (ttp->label != NULL && !XtParent (ttp->label)->core.being_destroyed) { XtPopdown (XtParent (ttp->label)); } } static void ToolTipPostFinish (Widget slide, XtPointer client_data, XtPointer call_data) { XmToolTipConfigTrait ttp; ttp = (XmToolTipConfigTrait) client_data; if (ttp == NULL) { XtWarning ("ToolTipPostFinish() - ttp==NULL"); return; } ttp->slider = NULL; if (ttp->post_duration > 0) { ttp->duration_timer = XtAppAddTimeOut (XtWidgetToApplicationContext (ttp->label), (unsigned long) ttp->post_duration, (XtTimerCallbackProc) ToolTipUnpost, client_data); } } static void ToolTipPost (XtPointer client_data, XtIntervalId * id) { Widget w = (Widget) client_data; int rx, ry, x, y; unsigned int key; Window root, child; XtWidgetGeometry geo; Position destX, destY; XmToolTipConfigTrait ttp; /* ToolTip pointer */ ttp = ToolTipGetData (w); if (ttp == NULL) { XtWarning ("ToolTipGetData() returned NULL in ToolTipPost()"); return; } ttp->timer = (XtIntervalId) NULL; XQueryPointer (XtDisplay (w), XtWindow (w), &root, &child, &rx, &ry, &x, &y, &key); if (ttp->duration_timer != (XtIntervalId) NULL) { XtRemoveTimeOut (ttp->duration_timer); ttp->duration_timer = (XtIntervalId) NULL; } if (XmIsPrimitive(w) || XmIsGadget(w)) { XtVaSetValues (ttp->label, XmNlabelString, XmGetToolTipString(w), NULL); } else { XmString string; string = XmStringCreateLocalized (XtName (w)); XtVaSetValues (ttp->label, XmNlabelString, string, NULL); XmStringFree (string); } XtQueryGeometry (ttp->label, NULL, &geo); /* rws 25 Feb 2001 Fix for Bug #1153 Don't let the tip be off the right/bottom of the screen */ destX = rx + (XmIsGadget (w) ? XtX (w) : 0) - x + XtWidth (w) / 2; if (destX + geo.width > WidthOfScreen (XtScreen (w))) { destX = WidthOfScreen (XtScreen (w)) - geo.width; } destY = ry + (XmIsGadget (w) ? XtY (w) : 0) - y + XtHeight (w); if (destY + geo.height > HeightOfScreen (XtScreen (w))) { destY = ry + (XmIsGadget (w) ? XtY (w) : 0) - y - geo.height; } XtVaSetValues (XtParent (ttp->label), XmNx, rx + 1, XmNy, ry + 1, XmNwidth, 1, XmNheight, 1, NULL); ttp->slider = XtVaCreateWidget ("ToolTipSlider", xmSlideContextWidgetClass, XmGetXmDisplay (XtDisplay (w)), XmNslideWidget, XtParent (ttp->label), XmNslideDestX, destX, XmNslideDestY, destY, XmNslideDestWidth, geo.width, XmNslideDestHeight, geo.height, NULL); XtAddCallback (ttp->slider, XmNslideFinishCallback, (XtCallbackProc) ToolTipPostFinish, ttp); XtPopup (XtParent (ttp->label), XtGrabNone); } /* ===================================== Publically available functions follow ===================================== */ void _XmToolTipEnter (Widget wid, XEvent * event, String * params, Cardinal * num_params) { XmToolTipConfigTrait ttp; /* ToolTip pointer */ ttp = ToolTipGetData (wid); if (ttp == NULL) { XtWarning ("ToolTipGetData() returned NULL in _XmToolTipEnter()"); return; } if ((XmIsPrimitive (wid) || XmIsGadget(wid)) && XmGetToolTipString(wid)) { if (ttp->enable && !ttp->timer) { unsigned long delay; if (event && (event->xcrossing.time - ttp->leave_time < ttp->post_delay)) { delay = 0; } else { delay = (unsigned long) ttp->post_delay; } if (ttp->duration_timer) { XtRemoveTimeOut (ttp->duration_timer); ttp->duration_timer = (XtIntervalId) NULL; } ttp->timer = XtAppAddTimeOut (XtWidgetToApplicationContext (wid), delay, (XtTimerCallbackProc) ToolTipPost, wid); } } } void _XmToolTipLeave (Widget w, XEvent * event, String * params, Cardinal * num_params) { XmToolTipConfigTrait ttp = ToolTipGetData (w); if (!ttp) { XtWarning ("_XmToolTipLeave() - ttp == NULL."); return; } if (ttp->timer) { XtRemoveTimeOut (ttp->timer); ttp->timer = (XtIntervalId) NULL; } else { if (event && (ttp->duration_timer || ttp->post_duration == 0)) { ttp->leave_time = event->xcrossing.time; } ToolTipUnpost (ttp, NULL); } } #ifdef FIX_1388 void _XmToolTipRemove(Widget w) { XmToolTipTrait ttp; _XmToolTipLeave(w, NULL, NULL, NULL); ttp = (XmToolTipTrait) XmeTraitGet(w, XmQTtoolTip); if (ttp != NULL) { XmStringFree(ttp->tool_tip_string); XmeTraitSet(w, XmQTtoolTip, (XtPointer) NULL); XtFree((char*)ttp); } } #endif /* FIX_1388 */ Widget XmToolTipGetLabel(Widget wid) { XmToolTipConfigTrait TipData = ToolTipGetData(wid); #ifdef BUG1232 /* rws 25 Sep 2003 protect against NULL TipData */ #endif return(TipData ? TipData->label : NULL); } XmString XmGetToolTipString (Widget w) { XmToolTipTrait ttp; ttp = (XmToolTipTrait)XmeTraitGet(w, XmQTtoolTip); return ttp ? ttp->tool_tip_string : NULL; } void XmSetToolTipString (Widget w, XmString s) { XmToolTipTrait ttp; ttp = (XmToolTipTrait)XmeTraitGet(w, XmQTtoolTip); if (!ttp) { ttp = (XmToolTipTrait)XtCalloc(1, sizeof(XmToolTipTraitRec)); XmeTraitSet(w, XmQTtoolTip, ttp); } if (ttp->tool_tip_string) XmStringFree(ttp->tool_tip_string); ttp->tool_tip_string = XmStringCopy(s); } motif-2.3.8/lib/Xm/Hash.c0000644000175000017500000002236512672140200011746 00000000000000/* $XConsortium: Hash.c /main/6 1995/10/25 20:06:11 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "HashI.h" #define FIX_1264 /* Private data structures */ typedef struct _XmHashBucketRec { XmHashValue hashed_key; XmHashKey hash_key; XtPointer value; struct _XmHashBucketRec *next; } XmHashBucketRec, *XmHashBucket; typedef struct _XmHashTableRec { Cardinal size; Cardinal count; XmHashCompareProc compare; XmHashFunction hasher; XmHashBucket *buckets; } XmHashTableRec; /* Static functions */ static XmHashBucket NewBucket(void); static void FreeBucket(XmHashBucket); /* Static data */ static XmHashBucket FreeBucketList = NULL; /* Dumb default hash functions */ static Boolean Compare(XmHashKey x, XmHashKey y) { return(x == y); } static XmHashValue Hash(XmHashKey x) { return((XmHashValue) (long) x); } /* Available table sizes, should be prime numbers */ static XmConst int size_table[] = { 17, 31, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 0 }; XmHashTable _XmAllocHashTable(Cardinal size_hint, XmHashCompareProc cproc, XmHashFunction hproc) { XmHashTable table; int i; table = (XmHashTable) XtMalloc(sizeof(XmHashTableRec)); if (hproc) table -> hasher = hproc; else table -> hasher = Hash; if (cproc) table -> compare = cproc; else table -> compare = Compare; i = 0; /* Search size_table for size which is bigger than size_hint */ while(size_table[i] != 0 && size_table[i] < size_hint) i++; if (size_table[i] == 0) i--; table -> size = size_table[i]; table -> count = 0; /* Create the array of pointers */ table->buckets = (XmHashBucket*) XtCalloc(table->size, sizeof(XmHashBucket)); return(table); } void _XmFreeHashTable(XmHashTable table) { int i; XmHashBucket bucket, next; for(i = 0; i < table -> size; i++) { bucket = table -> buckets[i]; while(bucket) { next = bucket -> next; FreeBucket(bucket); bucket = next; } } XtFree((char*) table -> buckets); XtFree((char*) table); } void _XmResizeHashTable(XmHashTable table, Cardinal new_size) { int i, index; int oldsize; XmHashBucket current, last, next, new_h; i = 0; /* Search size_table for size which is bigger than size_hint */ while(size_table[i] != 0 && size_table[i] < new_size) i++; if (size_table[i] == 0) i--; /* New size should be larger, otherwise return */ if (size_table[i] <= table -> size) return; /* Realloc table */ oldsize = table -> size; table -> size = size_table[i]; table -> buckets = (XmHashBucket*) XtRealloc((char*) table -> buckets, table -> size * sizeof(XmHashBucket)); /* NULL new array entries */ for(i = oldsize; i < table -> size; i++) table -> buckets[i] = NULL; /* Rearrange buckets, this is a slow method, but always correct. We will end up rescanning any moved buckets */ for(i = 0; i < table -> size; i++) { last = NULL; current = table -> buckets[i]; while(current) { /* If this bucket goes somewhere else, remove from this chain and reinstall */ next = current -> next; index = current -> hashed_key % table -> size; if (index != i) { if (last != NULL) last -> next = current -> next; else table -> buckets[i] = current -> next; /* Now put at end of new bucket chain, we must do this to maintain ordering */ current -> next = NULL; new_h = table -> buckets[index]; if (new_h != NULL) { while(new_h -> next != NULL) new_h = new_h -> next; new_h -> next = current; } else { table -> buckets[index] = current; } } #ifdef FIX_1264 else last = current; #endif current = next; } } } XtPointer _XmGetHashEntryIterate(XmHashTable table, XmHashKey key, XtPointer *iterator) { XmHashValue index; XmHashBucket entry; if (iterator && *iterator != NULL) { /* If iterating over a number of matching entries */ entry = (XmHashBucket) *iterator; entry = entry -> next; } else { /* Normal case */ index = (table -> hasher(key)) % table -> size; entry = table -> buckets[index]; } while(entry) { if (table -> compare(entry -> hash_key, key)) { if (iterator) *iterator = (XtPointer) entry; return(entry -> value); } entry = entry -> next; } if (iterator) *iterator = NULL; return(NULL); } void _XmAddHashEntry(XmHashTable table, XmHashKey key, XtPointer value) { int hash; XmHashValue index; XmHashBucket entry; hash = table -> hasher(key); index = hash % table -> size; entry = NewBucket(); entry -> hashed_key = hash; entry -> hash_key = key; entry -> value = value; entry -> next = table -> buckets[index]; table -> buckets[index] = entry; table -> count++; } XtPointer _XmRemoveHashEntry(XmHashTable table, XmHashKey key) { XmHashValue index; XmHashBucket entry, last = NULL; index = (table -> hasher(key)) % table -> size; entry = table -> buckets[index]; while(entry) { if (table -> compare(entry -> hash_key, key)) { if (last == NULL) { /* First entry is handled differently */ table -> buckets[index] = entry -> next; } else { last -> next = entry -> next; } table -> count--; FreeBucket(entry); return(entry -> hash_key); } last = entry; entry = entry -> next; } return(NULL); } XtPointer _XmRemoveHashIterator(XmHashTable table, XtPointer *iterator) { XmHashValue index; XmHashBucket entry, current, last = NULL; if (! iterator) return(NULL); entry = (XmHashBucket) *iterator; index = (table -> hasher(entry -> hash_key)) % table -> size; current = table -> buckets[index]; while(current) { if (current == entry) { if (last == NULL) { /* First entry is handled differently */ table -> buckets[index] = current -> next; } else { last -> next = current -> next; } table -> count--; FreeBucket(current); return(current -> hash_key); } last = current; current = current -> next; } return(NULL); } Cardinal _XmHashTableCount(XmHashTable table) { return(table -> count); } Cardinal _XmHashTableSize(XmHashTable table) { return(table -> size); } /****************************************************************/ /* _XmMapHashTable(table, proc, client_data) */ /* Iterate over entire hash table. Mostly useful for debugging */ /* code using hash tables. */ /****************************************************************/ void _XmMapHashTable(XmHashTable table, XmHashMapProc proc, XtPointer client_data) { int i; XmHashBucket entry, next; for(i = 0; i < table -> size; i++) { entry = table -> buckets[i]; while(entry) { /* Can free key and value in this proc */ next = entry -> next; /* Terminate processing if the XmHashMapProc return True. */ if (proc (entry -> hash_key, entry -> value, client_data)) return; entry = next; } } } /* Bucket management */ #define NUMBUCKETS 256 static XmHashBucket NewBucket(void) { XmHashBucket rbucket; XmHashBucket buckets; int i; if (FreeBucketList == NULL) { /* Allocate alot of buckets at once to cut down on fragmentation */ buckets = (XmHashBucket) XtMalloc(NUMBUCKETS * sizeof(XmHashBucketRec)); /* Chain them together */ for(i = 0; i < NUMBUCKETS; i++) buckets[i].next = &buckets[i+1]; /* The last points to nothing */ buckets[NUMBUCKETS - 1].next = (XmHashBucket) NULL; FreeBucketList = buckets; } rbucket = FreeBucketList; FreeBucketList = FreeBucketList -> next; return(rbucket); } static void FreeBucket(XmHashBucket b) { b -> next = FreeBucketList; FreeBucketList = b; } #ifdef DEBUG void _XmPrintHashTable(XmHashTable table) { int i, max, total_in_use; int count; XmHashBucket entry; max = 0; total_in_use = 0; printf("size %d hash function %lx compare function %lx\n", table->size, (unsigned long) table->hasher, (unsigned long) table->compare); for (i = 0; i < table -> size; i++) { entry = table -> buckets[i]; count = 0; while(entry) { count++; entry = entry -> next; } if (count > 0) total_in_use++; if (count > max) max = count; } printf("total entries %d\n", table -> count); printf("total bucket chains in use %d or %d percent\n", total_in_use, (total_in_use * 100)/table -> size); printf("bucket chain length %d average / %d max\n", table -> count / total_in_use, max); } #endif motif-2.3.8/lib/Xm/VaSimple.c0000644000175000017500000007456013145162623012620 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: VaSimple.c /main/11 1995/10/25 20:26:43 cde-sun $" #endif #endif #include #include #include #include "MessagesI.h" #include "VaSimpleI.h" #include "XmI.h" #ifndef va_dcl #define va_dcl int va_alist; #endif #define XMBUTTONS_ARGS_PER_LIST 5 #define XMCASCADE_ARGS_PER_LIST 3 #define XMTITLE_ARGS_PER_LIST 1 #define XMSEPARATOR_ARGS_PER_LIST 0 #define _XmINVALID_BUTTON_TYPE 0xff #define MESSAGE1 _XmMMsgVaSimple_0000 #define MESSAGE2 _XmMMsgVaSimple_0001 #define MESSAGE3 _XmMMsgVaSimple_0002 /******** Static Function Declarations ********/ static XmButtonType _XmVaBType_to_XmBType( String symbol) ; static void _XmCountNestedList( XtTypedArgList avlist, int *total_count, int *typed_count) ; static int _XmTypedArgToArg( Widget widget, XtTypedArgList typed_arg, ArgList arg_return, XtResourceList resources, Cardinal num_resources) ; static int _XmNestedArgtoArg( Widget widget, XtTypedArgList avlist, ArgList args, XtResourceList resources, Cardinal num_resources) ; static int _XmNestedArgtoTypedArg( XtTypedArgList args, XtTypedArgList avlist) ; static void _XmVaProcessEverything( Widget widget, va_list var, XmButtonTypeTable *buttonTypes, XmStringTable *buttonStrings, XmKeySymTable *buttonMnemonics, String **buttonAccelerators, XmStringTable *buttonAcceleratorText, int button_count, ArgList *args, int num_args) ; /******** End Static Function Declarations ********/ static XmButtonType _XmVaBType_to_XmBType( String symbol ) { if (strcmp(symbol, XmVaPUSHBUTTON) == 0) return (XmPUSHBUTTON); else if (strcmp(symbol, XmVaTOGGLEBUTTON) == 0) return (XmTOGGLEBUTTON); else if (strcmp(symbol, XmVaCHECKBUTTON) == 0) return (XmCHECKBUTTON); else if (strcmp(symbol, XmVaRADIOBUTTON) == 0) return (XmRADIOBUTTON); else if (strcmp(symbol, XmVaCASCADEBUTTON) == 0) return (XmCASCADEBUTTON); else if (strcmp(symbol, XmVaSEPARATOR) == 0) return (XmSEPARATOR); else if (strcmp(symbol, XmVaDOUBLE_SEPARATOR) == 0) return (XmDOUBLE_SEPARATOR); else if (strcmp(symbol, XmVaTITLE) == 0) return (XmTITLE); else return (_XmINVALID_BUTTON_TYPE); } /* * Given a nested list, _XmCountNestedList() returns counts of the * total number of attribute-value pairs and the count of those * attributes that are typed. The list is counted recursively. */ static void _XmCountNestedList( XtTypedArgList avlist, int *total_count, int *typed_count ) { for (; avlist->name != NULL; avlist++) { if (strcmp(avlist->name, XtVaNestedList) == 0) { _XmCountNestedList((XtTypedArgList)avlist->value, total_count, typed_count); } else { if (avlist->type != NULL) { ++(*typed_count); } ++(*total_count); } } } /* * Function: XmeCountVaList * * Description: Takes a variable list and returns the number of total * items in it. This is a much simplified version of * _XmCountVaList. It is intended to be used in convience * creation routines for widgets both inside and outside the * toolkit. * * Input: al - a variable lenth list, at the beginning of the list. * * Output: the number of items in it before the last NULL * */ int XmeCountVaListSimple(va_list al) { int d1, d2, d3, count; _XmCountVaList(al, &d1, &d2, &d3, &count); return count; } /* * Given a variable length attribute-value list, _XmCountVaList() * returns counts of the total number of attribute-value pairs, * and the count of the number of those attributes that are typed. * The list is counted recursively. */ void _XmCountVaList( va_list var, int *button_count, int *args_count, int *typed_count, int *total_count ) { String attr; int i; *button_count = 0; *args_count = 0; *typed_count = 0; *total_count = 0; for(attr = va_arg(var, String) ; attr != NULL; attr = va_arg(var, String)) { /* Count typed Args */ if (strcmp(attr, XtVaTypedArg) == 0) { (void)va_arg(var, String); (void)va_arg(var, String); (void)va_arg(var, XtArgVal); (void)va_arg(var, int); ++(*total_count); ++(*typed_count); } else if (strcmp(attr, XtVaNestedList) == 0) { _XmCountNestedList(va_arg(var, XtTypedArgList), total_count, typed_count); } else { /* Count valid VaBUTTONS (done here because of the variable arg length) */ if (strcmp(attr, XmVaCASCADEBUTTON) == 0) { for (i = 1; i < XMCASCADE_ARGS_PER_LIST; i++) (void)va_arg(var, XtArgVal); ++(*total_count); ++(*button_count); } else if ((strcmp(attr, XmVaSEPARATOR) == 0) || (strcmp(attr, XmVaDOUBLE_SEPARATOR) == 0)) { ++(*total_count); ++(*button_count); } else if (strcmp(attr, XmVaTITLE) == 0){ (void)va_arg(var, XtArgVal); ++(*total_count); ++(*button_count); /* Check matches other known VaBUTTONS */ } else if (_XmVaBType_to_XmBType(attr) != _XmINVALID_BUTTON_TYPE) { for (i = 1; i < XMBUTTONS_ARGS_PER_LIST; i++) (void)va_arg(var, XtArgVal); ++(*total_count); ++(*button_count); /* Else it's a simple Arg */ } else { (void)va_arg(var, XtArgVal); ++(*args_count); ++(*total_count); } } } } /* * _XmTypedArgToArg() invokes a resource converter to convert the * passed typed arg into a name/value pair and stores the name/value * pair in the passed Arg structure. It returns 1 if the conversion * succeeded and 0 if the conversion failed. */ static int _XmTypedArgToArg( Widget widget, XtTypedArgList typed_arg, ArgList arg_return, XtResourceList resources, Cardinal num_resources ) { String to_type = NULL; XrmValue from_val, to_val; register int i; if (widget == NULL) { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "nullWidget", "xtConvertVarTArgList", "XtToolkitError", MESSAGE1, (String *)NULL, (Cardinal *)NULL); return(0); } /* again we assume that the XtResourceList is un-compiled */ for (i = 0; i < num_resources; i++) { if (StringToName(typed_arg->name) == StringToName(resources[i].resource_name)) { to_type = resources[i].resource_type; break; } } if (to_type == NULL) { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "unknownType", "xtConvertVarTArgList", "XtToolkitError", MESSAGE2, (String *)NULL, (Cardinal *)NULL); return(0); } to_val.addr = NULL; from_val.size = typed_arg->size; if ((strcmp(typed_arg->type, XtRString) == 0) || (typed_arg->size > sizeof(XtArgVal))) { from_val.addr = (XPointer)typed_arg->value; } else { from_val.addr = (XPointer)&typed_arg->value; } _XmProcessLock(); XtConvert(widget, typed_arg->type, &from_val, to_type, &to_val); if (to_val.addr == NULL) { _XmProcessUnlock(); XtAppWarningMsg(XtWidgetToApplicationContext(widget), "conversionFailed", "xtConvertVarToArgList", "XtToolkitError", MESSAGE3, (String *)NULL, (Cardinal *)NULL); return(0); } arg_return->name = typed_arg->name; if (strcmp(to_type, XtRString) == 0) { arg_return->value = (XtArgVal) to_val.addr; } else { if (to_val.size == sizeof(long)) arg_return->value = (XtArgVal) *(long *)to_val.addr; else if (to_val.size == sizeof(int)) arg_return->value = (XtArgVal) *(int *)to_val.addr; else if (to_val.size == sizeof(short)) arg_return->value = (XtArgVal) *(short *)to_val.addr; else if (to_val.size == sizeof(char)) arg_return->value = (XtArgVal) *(char *)to_val.addr; else arg_return->value = *(XtArgVal *)to_val.addr; } _XmProcessUnlock(); return(1); } /* * _XmNestedArgtoArg() converts the passed nested list into * an ArgList/count. */ static int _XmNestedArgtoArg( Widget widget, XtTypedArgList avlist, ArgList args, XtResourceList resources, Cardinal num_resources ) { int count = 0; for (; avlist->name != NULL; avlist++) { if (avlist->type != NULL) { /* If widget is NULL, the typed arg is ignored */ if (widget != NULL) { /* this is a typed arg */ count += _XmTypedArgToArg(widget, avlist, (args+count), resources, num_resources); } } else if (strcmp(avlist->name, XtVaNestedList) == 0) { count += _XmNestedArgtoArg(widget, (XtTypedArgList)avlist->value, (args+count), resources, num_resources); } else { (args+count)->name = avlist->name; (args+count)->value = avlist->value; ++count; } } return(count); } static int _XmNestedArgtoTypedArg( XtTypedArgList args, XtTypedArgList avlist ) { int count = 0; for (; avlist->name != NULL; avlist++) { if (avlist->type != NULL) { (args+count)->name = avlist->name; (args+count)->type = avlist->type; (args+count)->size = avlist->size; (args+count)->value = avlist->value; ++count; } else if(strcmp(avlist->name, XtVaNestedList) == 0) { count += _XmNestedArgtoTypedArg((args+count), (XtTypedArgList)avlist->value); } else { (args+count)->name = avlist->name; (args+count)->type = NULL; (args+count)->value = avlist->value; ++count; } } return(count); } /* * Given a variable argument list, _XmVaToTypedArgList() returns * the equivalent TypedArgList. _XmVaToTypedArgList() handles nested * lists. * Note: _XmVaToTypedArgList() does not do type conversions. */ void _XmVaToTypedArgList( va_list var, int max_count, XtTypedArgList *args_return, Cardinal *num_args_return ) { XtTypedArgList args = NULL; String attr; int count; args = (XtTypedArgList) XtMalloc((unsigned)(max_count * sizeof(XtTypedArg))); for(attr = va_arg(var, String), count = 0 ; attr != NULL; attr = va_arg(var, String)) { if (strcmp(attr, XtVaTypedArg) == 0) { args[count].name = va_arg(var, String); args[count].type = va_arg(var, String); args[count].value = va_arg(var, XtArgVal); args[count].size = va_arg(var, int); ++count; } else if (strcmp(attr, XtVaNestedList) == 0) { count += _XmNestedArgtoTypedArg(&args[count], va_arg(var, XtTypedArgList)); } else { args[count].name = attr; args[count].type = NULL; args[count].value = va_arg(var, XtArgVal); ++count; } } *args_return = args; *num_args_return = count; } static void _XmVaProcessEverything( Widget widget, va_list var, XmButtonTypeTable *buttonTypes, XmStringTable *buttonStrings, XmKeySymTable *buttonMnemonics, String **buttonAccelerators, XmStringTable *buttonAcceleratorText, int button_count, ArgList *args, int num_args ) { XtTypedArg typed_args; String attr; int count, bcount; *args = (ArgList) XtMalloc(num_args * sizeof(Arg)); /* Process the routine specific args */ *buttonTypes = (XmButtonTypeTable) XtMalloc((unsigned)(button_count * sizeof(XmButtonType *))); *buttonStrings = (XmStringTable) XtMalloc((unsigned)(button_count * sizeof(XmString *))); *buttonMnemonics = (XmKeySymTable) XtMalloc((unsigned)(button_count * sizeof(KeySym *))); *buttonAccelerators = (String *) XtMalloc((unsigned)(button_count * sizeof(String *))); *buttonAcceleratorText = (XmStringTable) XtMalloc((unsigned)(button_count * sizeof(XmString *))); bcount = 0; for(attr = va_arg(var, String), count = 0 ; attr != NULL; attr = va_arg(var, String)) { if (strcmp(attr, XtVaTypedArg) == 0) { typed_args.name = va_arg(var, String); typed_args.type = va_arg(var, String); typed_args.value = va_arg(var, XtArgVal); typed_args.size = va_arg(var, int); count += _XmTypedArgToArg(widget, &typed_args, &(*args)[count], NULL, 0); } else if (strcmp(attr, XtVaNestedList) == 0) { count += _XmNestedArgtoArg(widget, va_arg(var, XtTypedArgList), &(*args)[count], NULL, 0); } else if ((strcmp(attr, XmVaSEPARATOR) == 0) || (strcmp(attr, XmVaDOUBLE_SEPARATOR) == 0)) { (*buttonTypes)[bcount] = _XmVaBType_to_XmBType(attr); (*buttonStrings)[bcount] = (XmString) NULL; (*buttonMnemonics)[bcount] = (KeySym) NULL; (*buttonAccelerators)[bcount] = (String) NULL; (*buttonAcceleratorText)[bcount] = (XmString) NULL; ++bcount; } else if (strcmp(attr, XmVaTITLE) == 0){ (*buttonTypes)[bcount] = _XmVaBType_to_XmBType(attr); (*buttonStrings)[bcount] = va_arg(var, XmString); (*buttonMnemonics)[bcount] = (KeySym) NULL; (*buttonAccelerators)[bcount] = (String) NULL; (*buttonAcceleratorText)[bcount] = (XmString) NULL; ++bcount; } else if (strcmp(attr, XmVaCASCADEBUTTON) == 0) { (*buttonTypes)[bcount] = _XmVaBType_to_XmBType(attr); (*buttonStrings)[bcount] = va_arg(var, XmString); (*buttonMnemonics)[bcount] = va_arg(var, KeySym); (*buttonAccelerators)[bcount] = (String) NULL; (*buttonAcceleratorText)[bcount] = (XmString) NULL; ++bcount; } else if (_XmVaBType_to_XmBType(attr) != _XmINVALID_BUTTON_TYPE) { (*buttonTypes)[bcount] = _XmVaBType_to_XmBType(attr); (*buttonStrings)[bcount] = va_arg(var, XmString); (*buttonMnemonics)[bcount] = va_arg(var, KeySym); (*buttonAccelerators)[bcount] = va_arg(var, String); (*buttonAcceleratorText)[bcount] = va_arg(var, XmString); ++bcount; } else { (*args)[count].name = attr; (*args)[count].value = va_arg(var, XtArgVal); ++count; } } } Widget XmVaCreateSimpleMenuBar(Widget parent, String name, ...) { #define MB_EXTRA_ARGS 1 va_list var; register Widget widget; ArgList args; int button_count, args_count, typed_count, total_count; int n, num_args; XmButtonTypeTable menuBarButtonTypes; XmStringTable menuBarStrings; XmKeySymTable menuBarMnemonics; String * menuBarAccelerators; XmStringTable menuBarAcceleratorText; _XmWidgetToAppContext(parent); _XmAppLock(app); /* Count number of arg (arg in this case means number of arg groups) */ Va_start(var,name); _XmCountVaList(var, &button_count, &args_count, &typed_count, &total_count); va_end(var); /* Convert into a normal ArgList */ Va_start(var,name); num_args = args_count + (XMCASCADE_ARGS_PER_LIST + MB_EXTRA_ARGS); _XmVaProcessEverything(parent, var, &menuBarButtonTypes, &menuBarStrings, &menuBarMnemonics, &menuBarAccelerators, &menuBarAcceleratorText, button_count, &args, num_args); n = args_count; XtSetArg (args[n], XmNbuttonCount, button_count); n++; XtSetArg (args[n], XmNbuttonType, menuBarButtonTypes); n++; XtSetArg (args[n], XmNbuttons, menuBarStrings); n++; XtSetArg (args[n], XmNbuttonMnemonics, menuBarMnemonics); n++; widget = XmCreateSimpleMenuBar(parent, name, args, n); if (args != NULL) { XtFree((char *)args); } if (menuBarButtonTypes != NULL) { XtFree((char *)menuBarButtonTypes); } if (menuBarStrings != NULL) { XtFree((char *)menuBarStrings); } if (menuBarMnemonics != NULL) { XtFree((char *)menuBarMnemonics); } if (menuBarAccelerators != NULL) { XtFree((char *)menuBarAccelerators); } if (menuBarAcceleratorText != NULL) { XtFree((char *)menuBarAcceleratorText); } va_end(var); _XmAppUnlock(app); return (widget); } Widget XmVaCreateSimplePulldownMenu(Widget parent, String name, int post_from_button, XtCallbackProc callback, ...) { #define PD_EXTRA_ARGS 3 va_list var; register Widget widget; Arg *args; int button_count, args_count, typed_count, total_count; int n, num_args; XmButtonTypeTable pulldownMenuButtonTypes; XmStringTable pulldownMenuStrings; XmKeySymTable pulldownMenuMnemonics; String * pulldownMenuAccelerators; XmStringTable pulldownMenuAcceleratorText; _XmWidgetToAppContext(parent); _XmAppLock(app); /* Count number of arg (arg in this case means number of arg groups) */ Va_start(var,callback); _XmCountVaList(var, &button_count, &args_count, &typed_count, &total_count); va_end(var); /* Convert into a normal ArgList */ Va_start(var,callback); num_args = args_count + (XMBUTTONS_ARGS_PER_LIST + PD_EXTRA_ARGS); _XmVaProcessEverything(parent, var, &pulldownMenuButtonTypes, &pulldownMenuStrings, &pulldownMenuMnemonics, &pulldownMenuAccelerators, &pulldownMenuAcceleratorText, button_count, &args, num_args); n = args_count; XtSetArg (args[n], XmNsimpleCallback, callback); n++; XtSetArg (args[n], XmNpostFromButton, post_from_button); n++; XtSetArg (args[n], XmNbuttonCount, button_count); n++; XtSetArg (args[n], XmNbuttonType, pulldownMenuButtonTypes); n++; XtSetArg (args[n], XmNbuttons, pulldownMenuStrings); n++; XtSetArg (args[n], XmNbuttonMnemonics, pulldownMenuMnemonics); n++; XtSetArg (args[n], XmNbuttonAccelerators, pulldownMenuAccelerators); n++; XtSetArg (args[n], XmNbuttonAcceleratorText, pulldownMenuAcceleratorText); n++; widget = XmCreateSimplePulldownMenu(parent, name, args, n); if (args != NULL) { XtFree((char *)args); } if (pulldownMenuButtonTypes != NULL) { XtFree((char *)pulldownMenuButtonTypes); } if (pulldownMenuStrings != NULL) { XtFree((char *)pulldownMenuStrings); } if (pulldownMenuMnemonics != NULL) { XtFree((char *)pulldownMenuMnemonics); } if (pulldownMenuAccelerators != NULL) { XtFree((char *)pulldownMenuAccelerators); } if (pulldownMenuAcceleratorText != NULL) { XtFree((char *)pulldownMenuAcceleratorText); } va_end(var); _XmAppUnlock(app); return (widget); } Widget XmVaCreateSimplePopupMenu(Widget parent, String name, XtCallbackProc callback, ...) { #define PU_EXTRA_ARGS 2 va_list var; register Widget widget; Arg *args; int button_count, args_count, typed_count, total_count; int n, num_args; XmButtonTypeTable popupMenuButtonTypes; XmStringTable popupMenuStrings; XmKeySymTable popupMenuMnemonics; String * popupMenuAccelerators; XmStringTable popupMenuAcceleratorText; _XmWidgetToAppContext(parent); _XmAppLock(app); /* Count number of arg (arg in this case means number of arg groups) */ Va_start(var,callback); _XmCountVaList(var, &button_count, &args_count, &typed_count, &total_count); va_end(var); /* Convert into a normal ArgList */ Va_start(var,callback); num_args = args_count + (XMBUTTONS_ARGS_PER_LIST + PU_EXTRA_ARGS); _XmVaProcessEverything(parent, var, &popupMenuButtonTypes, &popupMenuStrings, &popupMenuMnemonics, &popupMenuAccelerators, &popupMenuAcceleratorText, button_count, &args, num_args); n = args_count; XtSetArg (args[n], XmNsimpleCallback, callback); n++; XtSetArg (args[n], XmNbuttonCount, button_count); n++; XtSetArg (args[n], XmNbuttonType, popupMenuButtonTypes); n++; XtSetArg (args[n], XmNbuttons, popupMenuStrings); n++; XtSetArg (args[n], XmNbuttonMnemonics, popupMenuMnemonics); n++; XtSetArg (args[n], XmNbuttonAccelerators, popupMenuAccelerators); n++; XtSetArg (args[n], XmNbuttonAcceleratorText, popupMenuAcceleratorText); n++; widget = XmCreateSimplePopupMenu(parent, name, args, n); if (args != NULL) { XtFree((char *)args); } if (popupMenuButtonTypes != NULL) { XtFree((char *)popupMenuButtonTypes); } if (popupMenuStrings != NULL) { XtFree((char *)popupMenuStrings); } if (popupMenuMnemonics != NULL) { XtFree((char *)popupMenuMnemonics); } if (popupMenuAccelerators != NULL) { XtFree((char *)popupMenuAccelerators); } if (popupMenuAcceleratorText != NULL) { XtFree((char *)popupMenuAcceleratorText); } va_end(var); _XmAppUnlock(app); return (widget); } Widget XmVaCreateSimpleOptionMenu(Widget parent, String name, XmString option_label, KeySym option_mnemonic, int button_set, XtCallbackProc callback, ...) { #define OM_EXTRA_ARGS 5 va_list var; register Widget widget; Arg *args; int button_count, args_count, typed_count, total_count; int n, num_args; XmButtonTypeTable optionMenuButtonTypes; XmStringTable optionMenuStrings; XmKeySymTable optionMenuMnemonics; String * optionMenuAccelerators; XmStringTable optionMenuAcceleratorText; _XmWidgetToAppContext(parent); _XmAppLock(app); /* Count number of arg (arg in this case means number of arg groups) */ Va_start(var,callback); _XmCountVaList(var, &button_count, &args_count, &typed_count, &total_count); va_end(var); /* Convert into a normal ArgList */ Va_start(var,callback); num_args = args_count + (XMBUTTONS_ARGS_PER_LIST + OM_EXTRA_ARGS); _XmVaProcessEverything(parent, var, &optionMenuButtonTypes, &optionMenuStrings, &optionMenuMnemonics, &optionMenuAccelerators, &optionMenuAcceleratorText, button_count, &args, num_args); n = args_count; XtSetArg (args[n], XmNsimpleCallback, callback); n++; XtSetArg (args[n], XmNoptionLabel, option_label); n++; XtSetArg (args[n], XmNoptionMnemonic, option_mnemonic); n++; XtSetArg (args[n], XmNbuttonSet, button_set); n++; XtSetArg (args[n], XmNbuttonCount, button_count); n++; XtSetArg (args[n], XmNbuttonType, optionMenuButtonTypes); n++; XtSetArg (args[n], XmNbuttons, optionMenuStrings); n++; XtSetArg (args[n], XmNbuttonMnemonics, optionMenuMnemonics); n++; XtSetArg (args[n], XmNbuttonAccelerators, optionMenuAccelerators); n++; XtSetArg (args[n], XmNbuttonAcceleratorText, optionMenuAcceleratorText); n++; widget = XmCreateSimpleOptionMenu(parent, name, args, n); if (args != NULL) { XtFree((char *)args); } if (optionMenuButtonTypes != NULL) { XtFree((char *)optionMenuButtonTypes); } if (optionMenuStrings != NULL) { XtFree((char *)optionMenuStrings); } if (optionMenuMnemonics != NULL) { XtFree((char *)optionMenuMnemonics); } if (optionMenuAccelerators != NULL) { XtFree((char *)optionMenuAccelerators); } if (optionMenuAcceleratorText != NULL) { XtFree((char *)optionMenuAcceleratorText); } va_end(var); _XmAppUnlock(app); return (widget); } Widget XmVaCreateSimpleRadioBox(Widget parent, String name, int button_set, XtCallbackProc callback, ...) { #define RB_EXTRA_ARGS 3 va_list var; register Widget widget; Arg *args; int button_count, args_count, typed_count, total_count; int n, num_args; XmButtonTypeTable radioBoxButtonTypes; XmStringTable radioBoxStrings; XmKeySymTable radioBoxMnemonics; String * radioBoxAccelerators; XmStringTable radioBoxAcceleratorText; _XmWidgetToAppContext(parent); _XmAppLock(app); /* Count number of arg (arg in this case means number of arg groups) */ Va_start(var,callback); _XmCountVaList(var, &button_count, &args_count, &typed_count, &total_count); va_end(var); /* Convert into a normal ArgList */ Va_start(var,callback); num_args = args_count + (XMBUTTONS_ARGS_PER_LIST + RB_EXTRA_ARGS); _XmVaProcessEverything(parent, var, &radioBoxButtonTypes, &radioBoxStrings, &radioBoxMnemonics, &radioBoxAccelerators, &radioBoxAcceleratorText, button_count, &args, num_args); n = args_count; XtSetArg (args[n], XmNsimpleCallback, callback); n++; XtSetArg (args[n], XmNbuttonSet, button_set); n++; XtSetArg (args[n], XmNbuttonCount, button_count); n++; XtSetArg (args[n], XmNbuttonType, radioBoxButtonTypes); n++; XtSetArg (args[n], XmNbuttons, radioBoxStrings); n++; XtSetArg (args[n], XmNbuttonMnemonics, radioBoxMnemonics); n++; XtSetArg (args[n], XmNbuttonAccelerators, radioBoxAccelerators); n++; XtSetArg (args[n], XmNbuttonAcceleratorText, radioBoxAcceleratorText); n++; widget = XmCreateSimpleRadioBox(parent, name, args, n); if (args != NULL) { XtFree((char *)args); } if (radioBoxButtonTypes != NULL) { XtFree((char *)radioBoxButtonTypes); } if (radioBoxStrings != NULL) { XtFree((char *)radioBoxStrings); } if (radioBoxMnemonics != NULL) { XtFree((char *)radioBoxMnemonics); } if (radioBoxAccelerators != NULL) { XtFree((char *)radioBoxAccelerators); } if (radioBoxAcceleratorText != NULL) { XtFree((char *)radioBoxAcceleratorText); } va_end(var); _XmAppUnlock(app); return (widget); } Widget XmVaCreateSimpleCheckBox(Widget parent, String name, XtCallbackProc callback, ...) { #define CB_EXTRA_ARGS 2 va_list var; register Widget widget; Arg *args; int button_count, args_count, typed_count, total_count; int n, num_args; XmButtonTypeTable checkBoxButtonTypes; XmStringTable checkBoxStrings; XmKeySymTable checkBoxMnemonics; String * checkBoxAccelerators; XmStringTable checkBoxAcceleratorText; _XmWidgetToAppContext(parent); _XmAppLock(app); /* Count number of arg (arg in this case means number of arg groups) */ Va_start(var,callback); _XmCountVaList(var, &button_count, &args_count, &typed_count, &total_count); va_end(var); /* Convert into a normal ArgList */ Va_start(var,callback); num_args = args_count + (XMBUTTONS_ARGS_PER_LIST + CB_EXTRA_ARGS); _XmVaProcessEverything(parent, var, &checkBoxButtonTypes, &checkBoxStrings, &checkBoxMnemonics, &checkBoxAccelerators, &checkBoxAcceleratorText, button_count, &args, num_args); n = args_count; XtSetArg (args[n], XmNsimpleCallback, callback); n++; XtSetArg (args[n], XmNbuttonCount, button_count); n++; XtSetArg (args[n], XmNbuttonType, checkBoxButtonTypes); n++; XtSetArg (args[n], XmNbuttons, checkBoxStrings); n++; XtSetArg (args[n], XmNbuttonMnemonics, checkBoxMnemonics); n++; XtSetArg (args[n], XmNbuttonAccelerators, checkBoxAccelerators); n++; XtSetArg (args[n], XmNbuttonAcceleratorText, checkBoxAcceleratorText); n++; widget = XmCreateSimpleCheckBox(parent, name, args, n); if (args != NULL) { XtFree((char *)args); } if (checkBoxButtonTypes != NULL) { XtFree((char *)checkBoxButtonTypes); } if (checkBoxStrings != NULL) { XtFree((char *)checkBoxStrings); } if (checkBoxMnemonics != NULL) { XtFree((char *)checkBoxMnemonics); } if (checkBoxAccelerators != NULL) { XtFree((char *)checkBoxAccelerators); } if (checkBoxAcceleratorText != NULL) { XtFree((char *)checkBoxAcceleratorText); } va_end(var); _XmAppUnlock(app); return (widget); } /* * Function: XmeVLCreateWidget * * Description: Creates a widget of WidgetClass wc using a va_list of * arguments. Intended for generic use in Widget convience * functions. Intended for use by future widget writers * subclassing widgets. * * Input: name - The widget name * WidgetClass - The class of the widget * parent - a widget that is a parent * managed - if True the widget will be managed, if false it will not * al - a variable argument list of type va_list from stdarg.h * count - an integer value indicating the number of things in al * Output: * a returned widget if one can be created, NULL on error. */ Widget XmeVLCreateWidget( char *name, WidgetClass wc, Widget parent, Boolean managed, va_list al, int count) { Widget w; ArgList args; int n; String attr; _XmWidgetToAppContext(parent); _XmAppLock(app); /* The size as specified from count */ args = (ArgList)XtMalloc(count * sizeof(Arg)); /* * go through each element and copy the name and the value * (remember the value might be a pointer) to the value field */ for (attr = va_arg(al, String), n = 0; attr != NULL; attr = va_arg(al, String), n++) { args[n].name = attr; args[n].value = va_arg(al, XtArgVal); } va_end(al); /* Create the widget managed or not */ if (managed)w = XtCreateManagedWidget(name, wc, parent, args, n); else w = XtCreateWidget(name, wc, parent, args, n); /* * Just free the arg list, not the values in it, that is taken care * of elseware */ XtFree((char *)args); _XmAppUnlock(app); return(w); } motif-2.3.8/lib/Xm/IconGI.h0000644000175000017500000000243412672140200012173 00000000000000/* $XConsortium: IconGI.h /main/5 1995/07/15 20:52:08 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmIconGI_h #define _XmIconGI_h #include #ifdef __cplusplus extern "C" { #endif void _XmIconGadgetIconPos(Widget wid, int *x, int *y); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIconGI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/xmlist.h0000644000175000017500000001200212672140200012373 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _LIST_H #define _LIST_H #if defined(VMS) || defined (__VMS) #include #endif #include #include #ifdef __cplusplus extern "C" { #endif /************************************************************ * * Stack Data structure. * ************************************************************/ typedef struct _XmStackRec { int top, alloc; /* The top node of the stack, and the number of allocated nodes. */ XtPointer * elems; /* The stack elements. */ } XmStackRec, *XmStack; /************************************************************ * * Global function defs. * ************************************************************/ XmStack _XmStackInit(void); void _XmStackFree(XmStack), _XmStackPush(XmStack, XtPointer); XtPointer _XmStackPop(XmStack); /************************************************************ * * Queue Data structure. * ************************************************************/ typedef struct __XmQElem { struct __XmQElem *next, *prev; /* doubly linked list. */ XtPointer data; /* The data associated with this element. */ Boolean alloced; } _XmQElem; typedef struct _XmQueueRec { _XmQElem *first, *last; /* the first and last elements. */ _XmQElem *free_elems; /* Unused elements. */ } XmQueueRec, *XmQueue; /************************************************************ * * Global function defs. * ************************************************************/ XmQueue _XmQueueInit(void); void _XmQueueFree(XmQueue), _XmQueuePush(XmQueue, XtPointer); XtPointer _XmQueuePop(XmQueue); int _XmQueueCount(XmQueue); /* * Internal functions used only by other parts of the utils library. */ void _Xm_AddQueue(XmQueue, _XmQElem *, _XmQElem *); _XmQElem * _Xm_RemQueue(_XmQElem **); _XmQElem * _Xm_GetNewElement(XmQueue); /************************************************************ * * New types. * ************************************************************/ typedef _XmQElem XmListElem; typedef XmQueueRec *XmList; typedef Boolean (*XmListFunc)(XmListElem *, XtPointer); /************************************************************ * * Macros. * ************************************************************/ #define XmListElemNext(elem) (elem)->next #define XmListElemPrev(elem) (elem)->prev #define XmListElemData(elem) (elem)->data #define XmListFirst(list) (list)->first #define XmListLast(list) (list)->last /************************************************************ * * Global function defs. * ************************************************************/ void _XmListFree(XmList), _XmListRemove(XmList, XmListElem *); XmListElem * _XmListAddAfter(XmList, XmListElem *, XtPointer); XmListElem * _XmListAddBefore(XmList, XmListElem *, XtPointer); XmList _XmListInit(void); int _XmListCount(XmList); XmListElem *_XmListExec(XmList, XmListElem *, XmListElem *, XmListFunc, XtPointer); #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined (__VMS) #include #endif /* #ifdef XmRENAME_WIDGETS */ /* #define USE_OLD_NAMES */ /* #endif */ #ifdef USE_OLD_NAMES #define ListAddAfter _XmListAddAfter #define ListAddBefore _XmListAddBefore #define ListCount _XmListCount #define ListExec _XmListExec #define ListFree _XmListFree #define ListInit _XmListInit #define ListRemove _XmListRemove #define QueueCount _XmQueueCount #define QueueFree _XmQueueFree #define QueueInit _XmQueueInit #define QueuePop _XmQueuePop #define QueuePush _XmQueuePush #define StackFree _XmStackFree #define StackInit _XmStackInit #define StackPop _XmStackPop #define StackPush _XmStackPush #define _AddQueue _Xm_AddQueue #define _GetNewElement _Xm_GetNewElement #define _RemQueue _Xm_RemQueue #define Stack XmStack #define StackRec XmStackRec #define QElem _XmQElem #define QueueRec XmQueueRec #define Queue XmQueue #define ListElem XmListElem #define List XmList #define ListFunc XmListFunc #define ListElemNext XmListElemNext #define ListElemPrev XmListElemPrev #define ListElemData XmListElemData #define ListFirst XmListFirst #define ListLast XmListLast #endif /* USE_OLD_NAMES */ #endif /* _LIST_H */ motif-2.3.8/lib/Xm/Notebook.h0000644000175000017500000000532512672140200012645 00000000000000/* $XConsortium: Notebook.h /main/5 1995/07/15 20:53:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmNotebook_h #define _XmNotebook_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmNotebookWidgetClass; typedef struct _XmNotebookClassRec *XmNotebookWidgetClass; typedef struct _XmNotebookRec *XmNotebookWidget; /************************************************************************ * Notebook Defines ************************************************************************/ /* XmNotebookPageStatus */ typedef enum { XmPAGE_FOUND, /* page widget found */ XmPAGE_INVALID, /* page number out of the range */ XmPAGE_EMPTY, /* no page widget found */ XmPAGE_DUPLICATED /* there are more than one page widgets */ } XmNotebookPageStatus; /* Notebook page information structure */ typedef struct { int page_number; Widget page_widget; Widget status_area_widget; Widget major_tab_widget; Widget minor_tab_widget; } XmNotebookPageInfo; /************************************************************************ * Public Functions ************************************************************************/ #ifndef XmIsNotebook #define XmIsNotebook(w) XtIsSubclass((w), xmNotebookWidgetClass) #endif extern Widget XmCreateNotebook( Widget parent, String name, ArgList arglist, Cardinal argcount); extern XmNotebookPageStatus XmNotebookGetPageInfo( Widget notebook, int page_number, XmNotebookPageInfo *page_info) ; extern Widget XmVaCreateNotebook( Widget parent, char *name, ...); extern Widget XmVaCreateManagedNotebook( Widget parent, char *name, ...); #ifdef __cplusplus } #endif #endif /* _XmNotebook_h */ motif-2.3.8/lib/Xm/XmExtUtil.c0000644000175000017500000007104213145162623012773 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include #include "XmI.h" #include #include #include #include /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ typedef struct _PixmapCache { Screen *screen; Pixmap pixmap; Pixel foreground, background; unsigned int depth; int ref_count; struct _PixmapCache *next; } CacheEntry; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ String xm_std_filter[] = { XmNx, XmNy, XmNwidth, XmNheight, XmNdestroyCallback, XmNsensitive, XmNuserData, XmNnavigationType, NULL }; String xm_std_constraint_filter[] = { XmNx, XmNy, XmNwidth, XmNheight, XmNdestroyCallback, XmNsensitive, XmNuserData, XmNnavigationType, XmNbottomAttachment, XmNbottomOffset, XmNbottomPosition, XmNbottomWidget, XmNbottomAttachment, XmNtopAttachment, XmNleftOffset, XmNleftPosition, XmNleftWidget, XmNtopOffset, XmNtopPosition, XmNtopWidget, XmNrightOffset, XmNrightPosition, XmNrightWidget, XmNrightAttachment, XmNleftAttachment, XmNallowResize, XmNpaneMinimum, XmNshowSash, XmNpaneMaximum, XmNpreferredPaneSize, XmNresizeToPreferred, XmNskipAdjust, XmNdFieldPrefHeight, XmNdFieldMaxHeight, XmNdFieldPrefWidth, XmNdFieldMaxWidth, XmNdFieldMinHeight, XmNdFieldMinWidth, /* CR03683 */ XmNpixmapWidth, XmNpixmapHeight, NULL }; /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ /************************************************************ * STATIC DECLARATIONS *************************************************************/ static CacheEntry *pixmapCache = NULL; /************************************************************ * GLOBAL CODE *************************************************************/ /* Function Name: _XmRequestNewSize * Description: Asks our parent for a new size. * Arguments: w - the data request tree widget. * query_only - only ask what would happen, don't * change anything. * width, height - size to request. * r_width, r_height - allowed size. * Returns: none. */ XtGeometryResult _XmRequestNewSize(Widget w, Boolean query_only, Dimension width, Dimension height, Dimension * r_width, Dimension * r_height) { XtGeometryResult ret_val; XtWidgetGeometry request, result; request.width = width; request.height = height; request.request_mode = CWWidth | CWHeight; if (query_only) request.request_mode |= XtCWQueryOnly; ret_val = XtMakeGeometryRequest(w, &request, &result); if (ret_val == XtGeometryAlmost) { if (!query_only) ret_val = XtMakeGeometryRequest(w, &result, NULL); *r_width = result.width; *r_height = result.height; } else if (ret_val == XtGeometryYes) { *r_width = request.width; *r_height = request.height; } else { *r_width = w->core.width; *r_height = w->core.height; } return(ret_val); } /* Function Name: _XmHWQuery * Description: Handles much of the generic height and width query * geometry processing. * Arguments: w - the widget to process. * intended, preferred - The values from the real query * procedure. It is assumed * that preferred is already * filled with the correct desired * size. * Returns: an XtGeometryResult. */ XtGeometryResult _XmHWQuery(Widget w, XtWidgetGeometry * intended, XtWidgetGeometry * preferred) { if (intended == NULL) { if ((preferred->width == w->core.width) && (preferred->height == w->core.height)) { return(XtGeometryNo); } } else { if ((intended->request_mode & CWWidth) && (intended->request_mode & CWHeight)) { if ((intended->width == preferred->width) && (intended->height == preferred->height)) { return(XtGeometryYes); } else { return(XtGeometryNo); } } } preferred->request_mode = CWWidth | CWHeight; return(XtGeometryAlmost); } /* Function Name: _XmGadgetWarning * Description: Checks to see if this is a gadget. If it is then * print out a warning, and return True. * Arguments: w - the widget to check. * Returns: True if this object is a gadget. */ Boolean _XmGadgetWarning(Widget w) { if (!XtIsRectObj(w) || XtIsWidget(w)) return(False); XmeWarning(XtParent(w), XmNnoGadgetSupportMsg); return(True); } /* Function Name: _XmGetFocus * Description: Gets the XmFocus. * Arguments: w - the icon button widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /* ARGSUSED */ void _XmGetFocus(Widget w, XEvent * event, String * params, Cardinal * num_params) { #ifdef VMS if (XtIsRealized(w)) #endif (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); } /* Function Name: _XmFilterArgs * Description: Filters certain resources out of an argument list. * Arguments: args, num_args - the input argument list. * filter - the list of resources (by name) to remove. * RETURNED filtered_args, num_filtered_args - new filtered list. * Returns: none. * * NOTE The caller of this function is responsible for freeing "filtered_args" * with XtFree() when it is no longer in use. */ void _XmFilterArgs(ArgList args, Cardinal num_args, String *filter, ArgList *filtered_args, Cardinal *num_filtered_args) { ArgList fargs = (ArgList) XtMalloc(sizeof(Arg) * num_args); register int i; String *ptr; *filtered_args = fargs; *num_filtered_args = 0; for (i = 0; i < num_args; i++) { Boolean match = False; for (ptr = filter; *ptr != NULL; ptr++) { if (streq(*ptr, args[i].name)) { match = True; break; } } if (!match) { *fargs++ = args[i]; (*num_filtered_args)++; } } } /* Function Name: _XmSetValuesOnChildren * Description: Calls setvalues on all children of this widget, * and then recurses. * Arguments: w - the widget to set. * args, num_args - arguments to set. * Returns: none. */ void _XmSetValuesOnChildren(Widget w, ArgList args, Cardinal num_args) { Widget *childP; if (!XtIsSubclass(w, compositeWidgetClass)) return; ForAllChildren((CompositeWidget) w, childP) { XtSetValues(*childP, args, num_args); _XmSetValuesOnChildren(*childP, args, num_args); } } /* Function Name: _XmUtilIsSubclassByNameQ * Description: Determines whether this is a subclass of the named * class. * Arguments: w - the widget to check. * nameq - a quarkified name for the class to check. * Returns: True if this is a subclass. */ Boolean _XmUtilIsSubclassByNameQ(Widget w, XrmQuark nameq) { WidgetClass class; Boolean returnValue = False; _XmProcessLock(); for (class = XtClass(w) ; class != NULL ; class = class->core_class.superclass) { if (nameq == XrmStringToQuark(class->core_class.class_name)) { returnValue = True; break; } } _XmProcessUnlock(); return(returnValue); } /* Function Name: _XmGetMBStringFromXmString * Description: Given an Xm String, returns an MB string * Arguments: xmstr - an Xm String. * Returns: A multi byte string. */ String _XmGetMBStringFromXmString(XmString xmstr) { String text; XmStringContext context; /* context for conversion */ char *newText; /* new text string */ XmStringCharSet charset; /* dummy */ XmStringDirection direction; /* dummy */ XmStringComponentType u_tag; /* is newline */ int length; /* length of string */ unsigned short u_length; /* bogus length */ unsigned char *u_value; /* bogus value */ XmStringComponentType type; /* type */ Boolean done, separator; /* done with it */ if ( !XmStringInitContext(&context, xmstr) ) { XmStringFree(xmstr); return(NULL); } /* * First path to get length. */ length = 0; if ( XmStringPeekNextComponent(context) == XmSTRING_COMPONENT_UNKNOWN ) { XmStringFree(xmstr); XmStringFreeContext(context); return(NULL); } done = False; while( !done ) { newText = NULL; /* By source code inspection I have */ charset = NULL; /* Determined that this will make sure */ u_value = NULL; /* that no memory is leaked (I hope). */ type = XmStringGetNextComponent( context, &newText, &charset, &direction, &u_tag, &u_length, &u_value ); switch( type ) { case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: length += strlen( newText ); break; case XmSTRING_COMPONENT_SEPARATOR: length += 1; break; case XmSTRING_COMPONENT_USER_BEGIN: case XmSTRING_COMPONENT_USER_END: case XmSTRING_COMPONENT_CHARSET: case XmSTRING_COMPONENT_DIRECTION: break; case XmSTRING_COMPONENT_END: default: done = True; } XtFree((XtPointer) newText); XtFree((XtPointer) charset); XtFree((XtPointer) u_value); } /* * If XmStringGetNextComponent() fails on the current xmstring, * try by using XmStringGetNextSegment(). AIX 4.3.2 currently * fails to obtain the compound string from * XmStringGetNextComponent. (Change Reguest: CR03841) */ if(length == 0) { while ( XmStringGetNextSegment(context, &newText, &charset, &direction, &separator) ) { length = strlen(newText); if (separator == True) { length += 1; ; } text = XtMalloc( length + 1 ); text[0] = '\0'; strcat(text, newText); if (separator == True) { strcat(text, "\n"); } XtFree(newText); XmStringFreeContext(context); return (text); } } /* * Failed to obtain any compound string, return with NULL pointer. */ if(length == 0) return(NULL); XmStringFreeContext( context ); text = XtMalloc( length + 1 ); text[0] = '\0'; /* * Fill in the string. */ XmStringInitContext(&context, xmstr); done = False; while( !done ) { newText = NULL; /* By source code inspection I have */ charset = NULL; /* Determined that this will make sure */ u_value = NULL; /* that no memory is leaked (I hope). */ type = XmStringGetNextComponent( context, &newText, &charset, &direction, &u_tag, &u_length, &u_value ); switch( type ) { case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: strcat(text, newText); break; case XmSTRING_COMPONENT_SEPARATOR: strcat(text, "\n"); break; case XmSTRING_COMPONENT_USER_BEGIN: case XmSTRING_COMPONENT_USER_END: case XmSTRING_COMPONENT_CHARSET: case XmSTRING_COMPONENT_DIRECTION: break; case XmSTRING_COMPONENT_END: default: done = True; } XtFree((XtPointer) newText); XtFree((XtPointer) charset); XtFree((XtPointer) u_value); } XmStringFreeContext(context); return(text); } /* Function Name: _XiWoveWidget * Description: Wrapper for XtMoveWidget to deal with Motif1.2 * drag N drop. * Arguments: w - The widget to change * x, y - The new location for this widget. * Returns: none. */ void _XmMoveWidget(Widget w, Position x, Position y) { XmDropSiteStartUpdate(w); XtMoveWidget(w, x, y); XmDropSiteEndUpdate(w); } /* Function Name: _XmResizeWidget * Description: Wrapper for XtResizeWidget to deal with Motif1.2 * drag N drop. * Arguments: w - The widget to change * width, height, bw - The new size for the widget. * Returns: none. */ void _XmResizeWidget(Widget w, Dimension width, Dimension height, Dimension bw) { XmDropSiteStartUpdate(w); XtResizeWidget(w, width, height, bw); XmDropSiteEndUpdate(w); } /* Function Name: _XmConfigureWidget * Description: Wrapper for XtConfigureWidget to deal with Motif1.2 * drag N drop. * Arguments: w - The widget to change * x, y - The new location for this widget. * width, height, bw - The new size for the widget. * Returns: none. */ void _XmConfigureWidget(Widget w, Position x, Position y, Dimension width, Dimension height, Dimension bw) { /* 0x0 will sometimes result in a BadValue Error for X_ConfigureWindow */ if (height < 1) height = 1; if (width < 1) width = 1; XmDropSiteStartUpdate(w); XtConfigureWidget(w, x, y, width, height, bw); XmDropSiteEndUpdate(w); } /************************************************************ * * This code is taken from the MIT X Consortium's Xmu * Utility Library. * ************************************************************/ #define XK_LATIN1 #include /* * ISO Latin-1 case conversion routine */ /* * Function: * XmCompareISOLatin1(first, second) * Description: * Compares two ISO Latin 1 strings to determine if they are equivalent. * Case is not considered for the comparison. * Input: * first : char * - the first ISO Latin 1 String * second : char * - the second ISO Latin 1 String * Output: * int - (-1) -> first < second * ( 0) -> first == second * ( 1) -> first > second */ int #ifndef _NO_PROTO XmCompareISOLatin1(char *first, char *second) #else XmCompareISOLatin1(first, second) char *first, *second; #endif { register unsigned char *ap, *bp; for (ap = (unsigned char *) first, bp = (unsigned char *) second; *ap && *bp; ap++, bp++) { register unsigned char a, b; if ((a = *ap) != (b = *bp)) { /* try lowercasing and try again */ if ((a >= XK_A) && (a <= XK_Z)) a += (XK_a - XK_A); else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis)) a += (XK_agrave - XK_Agrave); else if ((a >= XK_Ooblique) && (a <= XK_Thorn)) a += (XK_oslash - XK_Ooblique); if ((b >= XK_A) && (b <= XK_Z)) b += (XK_a - XK_A); else if ((b >= XK_Agrave) && (b <= XK_Odiaeresis)) b += (XK_agrave - XK_Agrave); else if ((b >= XK_Ooblique) && (b <= XK_Thorn)) b += (XK_oslash - XK_Ooblique); if (a != b) break; } } return (((int) *bp) - ((int) *ap)); } void XmCopyISOLatin1Lowered(dst, src) char *dst, *src; { register unsigned char *dest, *source; for (dest = (unsigned char *)dst, source = (unsigned char *)src; *source; source++, dest++) { if ((*source >= XK_A) && (*source <= XK_Z)) *dest = *source + (XK_a - XK_A); else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis)) *dest = *source + (XK_agrave - XK_Agrave); else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn)) *dest = *source + (XK_oslash - XK_Ooblique); else *dest = *source; } *dest = '\0'; } /* * Creates a stippled pixmap of specified depth * caches these so that multiple requests share the pixmap */ #define pixmap_width 2 #define pixmap_height 2 Pixmap XiCreateStippledPixmap(Screen *screen, Pixel fore, Pixel back, unsigned int depth) { register Display *display = DisplayOfScreen(screen); CacheEntry *cachePtr; Pixmap stippled_pixmap; static unsigned char pixmap_bits[] = { 0x02, 0x01, }; /* see if we already have a pixmap suitable for this screen */ for (cachePtr = pixmapCache; cachePtr; cachePtr = cachePtr->next) { if (cachePtr->screen == screen && cachePtr->foreground == fore && cachePtr->background == back && cachePtr->depth == depth) return( cachePtr->ref_count++, cachePtr->pixmap ); } stippled_pixmap = XCreatePixmapFromBitmapData (display, RootWindowOfScreen(screen), (char *)pixmap_bits, pixmap_width, pixmap_height, fore, back, depth); /* and insert it at the head of the cache */ cachePtr = XtNew(CacheEntry); cachePtr->screen = screen; cachePtr->foreground = fore; cachePtr->background = back; cachePtr->depth = depth; cachePtr->pixmap = stippled_pixmap; cachePtr->ref_count = 1; _XmProcessLock(); cachePtr->next = pixmapCache; pixmapCache = cachePtr; _XmProcessUnlock(); return( stippled_pixmap ); } void XiReleaseStippledPixmap(Screen *screen, Pixmap pixmap) { register Display *display = DisplayOfScreen(screen); CacheEntry *cachePtr, **prevP; _XmProcessLock(); for (prevP = &pixmapCache, cachePtr = pixmapCache; cachePtr;) { if (cachePtr->screen == screen && cachePtr->pixmap == pixmap) { if (--cachePtr->ref_count == 0) { XFreePixmap( display, pixmap ); *prevP = cachePtr->next; XtFree( (char*)cachePtr ); break; } } prevP = &cachePtr->next; cachePtr = *prevP; } _XmProcessUnlock(); } /* * Function: * XmCompareXtWidgetGeometryToWidget(geom, widget) * Description: * This function compares an XtWidgetGeometry structure to the * actual values contained in a widget. * Input: * geom : XtWidgetGeometry* - the geometry to test against the widget * widget : Widget - the widget to use in the comparison * Output: * Boolean - True if the geometry fits the specified widget, else False */ Boolean XmCompareXtWidgetGeometryToWidget(XtWidgetGeometry *geom, Widget widget) { Boolean returnValue = True; _XmProcessLock(); if( (geom->request_mode & CWX && geom->x != widget->core.x) || (geom->request_mode & CWY && geom->y != widget->core.y) || (geom->request_mode & CWWidth && geom->width != XtHeight(widget)) || (geom->request_mode & CWHeight && geom->height != XtHeight(widget)) || (geom->request_mode & CWBorderWidth && geom->border_width != widget->core.border_width) ) { returnValue = False; } _XmProcessUnlock(); return( returnValue ); } /* * Function: * XmCompareXtWidgetGeometry(geom1, geom2) * Description: * Compares to XtWidgetGeometry structures to check for equality. * Input: * geom1 : XtWidgetGeometry* - geometry to compare * geom2 : XtWidgetGeometry* - geometry to compare * Output: * Boolean - True if both the request_mode and values match, else False */ Boolean XmCompareXtWidgetGeometry(XtWidgetGeometry *geom1, XtWidgetGeometry *geom2) { if( geom1->request_mode != geom2->request_mode ) return( False ); if( (geom1->request_mode & CWX && (geom1->x != geom2->x)) || (geom1->request_mode & CWY && (geom1->y != geom2->y)) || (geom1->request_mode & CWWidth && (geom1->width != geom2->width)) || (geom1->request_mode & CWHeight && (geom1->height != geom2->height)) || (geom1->request_mode & CWBorderWidth && (geom1->border_width != geom2->border_width)) || (geom1->request_mode & CWSibling && (geom1->sibling != geom2->sibling)) || (geom1->request_mode & CWStackMode && (geom1->stack_mode != geom2->stack_mode)) ) return( False ); return( True ); } /************************************************************ * * Static functions * ************************************************************/ #include /*************************************************************************/ /* The following code is snipped directly from OSF Motif 1.2.4 */ /* DEC did not compile this correctly (ALIGN_SUBCLASS_PARTS was not def- */ /* ined) on all versions of Motif for Digital Unix. We include it here */ /* to get correct behavior. */ /*************************************************************************/ /* and now there's a fix added; refer to OSF contact number 24617 for ** details */ /* And rewritten to support manual alignment. HP/UX aligns doubles to ** 8 bytes, but everthing else to 4. There is NO WAY to discover at ** runtime whether or not a structure contains doubles. It cannot be ** done, period; thus, the OSF mechanism won't work for PA-RISC ** processors. We get around that by specifying an extra flag (see ** XiResolvePartOffsets64) saying "align my subpart (only) to 8 ** bytes". This is needed in EPak only for the XiPanner widget. ** Note, this mechanism does NOT work for subclasses of 8-byte-aligned ** subparts. We'd need to provide a "copy my parents offset array" ** flag for that. Since EPak doesn't need it, we don't. Beware... */ #define ALIGN_SUBCLASS_PARTS #ifdef ALIGN_SUBCLASS_PARTS #define _ALIGN(size) (((size) + (sizeof(double)-1)) & ~(sizeof(double)-1)) #else #define _ALIGN(size) (size) #endif /* * FIX for 5178: remove dependency on Xt private data */ static Boolean IsSubclassOf( WidgetClass wc, WidgetClass sc) { WidgetClass p = wc; _XmProcessLock(); for(; (p) && (p != sc); p = p->core_class.superclass); _XmProcessUnlock(); return (p == sc); } #define XtIsConstraintClass(wc) IsSubclassOf(wc, constraintWidgetClass) /* * end FIX for 5178. */ void _XiResolveAllPartOffsets( WidgetClass w_class, XmOffsetPtr *offset, XmOffsetPtr *constraint_offset, Boolean align64) { WidgetClass c, super = w_class->core_class.superclass; ConstraintWidgetClass cc = NULL, scc = NULL; int i, classcount = 0; XmPartResource *pr; Boolean do_align = False; _XmProcessLock(); if (sizeof(int) != sizeof(void*)) do_align = True; /* * Set up constraint class pointers */ if (XtIsConstraintClass(super)) { cc = (ConstraintWidgetClass)w_class; scc = (ConstraintWidgetClass)super; } /* * Update the part size value (initially, it is the size of this part) */ if (do_align) { w_class->core_class.widget_size = w_class->core_class.widget_size + _ALIGN(super->core_class.widget_size); w_class->core_class.widget_size = _ALIGN(w_class->core_class.widget_size); } else { w_class->core_class.widget_size = w_class->core_class.widget_size + super->core_class.widget_size; } /* * Another nasty hack. Just plain old DON'T allow the size to be * a multiple of anything smaller than 4. This causes bus errors on * most platforms when the constraint record is appended (by Xt) * to the widget struct. Just round up. * The do_align flag above does the same thing, but only on 8 byte * boundaries on 64 bit systems. All of this code desperately * needs to be re-written. */ if(w_class->core_class.widget_size & 3) { int size = w_class->core_class.widget_size; w_class->core_class.widget_size = 4 * ((size / 4) + 1); } if (cc && scc) { if (do_align) { cc->constraint_class.constraint_size = cc->constraint_class.constraint_size + _ALIGN(scc->constraint_class.constraint_size); cc->constraint_class.constraint_size = _ALIGN(cc->constraint_class.constraint_size); } else cc->constraint_class.constraint_size = cc->constraint_class.constraint_size + scc->constraint_class.constraint_size; } /* * Count the number of superclasses and allocate the offset record(s) */ for (c = w_class; c != NULL; c = c->core_class.superclass) classcount++; *offset = (XmOffsetPtr) XtMalloc(classcount * sizeof(XmOffset)); if (cc) *constraint_offset = (XmOffsetPtr) XtMalloc(classcount * sizeof(XmOffset)); else if(constraint_offset != NULL) *constraint_offset = NULL; /* * Fill in the offset table(s) with the offset of all parts */ for (i = classcount-1, c = super; i > 0; c = c->core_class.superclass, i--) { /* * The do_align flag is true iff _all_ subparts must be 8-byte * aligned (e.g. on an Alpha). * * align64 is true only if the _current_ widget part must be * 8-byte aligned (e.g. subparts containing doubles on HP/UX) */ if (do_align || (c == super && align64)) (*offset)[i] = (long)_ALIGN((c->core_class.widget_size)); else (*offset)[i] = (long)(c->core_class.widget_size); } (*offset)[0] = 0; if (constraint_offset != NULL && *constraint_offset != NULL) { for (i = classcount-1, scc = (ConstraintWidgetClass) super; i > 0; scc = (ConstraintWidgetClass)(scc->core_class.superclass), i--) if (XtIsConstraintClass((WidgetClass)scc)) { if (do_align) (*constraint_offset)[i] = (long)_ALIGN((scc->constraint_class.constraint_size)); else (*constraint_offset)[i] = (long)(scc->constraint_class.constraint_size); } else (*constraint_offset)[i] = 0; (*constraint_offset)[0] = 0; } /* * Update the resource list(s) offsets in place */ for (i = 0; i < w_class->core_class.num_resources; i++) { pr = (XmPartResource *) &w_class->core_class.resources[i]; /* The next line updates this in place--be careful */ w_class->core_class.resources[i].resource_offset = XmGetPartOffset(pr, offset); } if (cc) for (i = 0; i < cc->constraint_class.num_resources; i++) { pr = (XmPartResource *) &cc->constraint_class.resources[i]; /* The next line updates this in place--be careful */ cc->constraint_class.resources[i].resource_offset = XmGetPartOffset(pr, constraint_offset); } _XmProcessUnlock(); } void XiResolveAllPartOffsets( WidgetClass w_class, XmOffsetPtr *offset, XmOffsetPtr *constraint_offset ) { _XiResolveAllPartOffsets( w_class, offset, constraint_offset, False ); } void XmResolveAllPartOffsets64( WidgetClass w_class, XmOffsetPtr *offset, XmOffsetPtr *constraint_offset ) { #ifdef XM_ALIGN_64 _XiResolveAllPartOffsets( w_class, offset, constraint_offset, True ); #else _XiResolveAllPartOffsets( w_class, offset, constraint_offset, False ); #endif } /* -------------------------------------------------------------------------- */ /************************************************************************ * * The border highlighting and unhighlighting routines. * * These routines were originally in Primitive.c but not used anywhere. * ************************************************************************/ void _XmExtHighlightBorder(Widget w ) { XtWidgetProc border_highlight; if(XmIsPrimitive(w)) { _XmProcessLock(); border_highlight = xmPrimitiveClassRec.primitive_class.border_highlight; _XmProcessUnlock(); (*border_highlight) (w); } else { if(XmIsGadget(w)) { _XmProcessLock(); border_highlight = xmGadgetClassRec.gadget_class.border_highlight; _XmProcessUnlock(); (*border_highlight) (w); } } return ; } void _XmExtUnhighlightBorder(Widget w) { XtWidgetProc border_unhighlight; if( XmIsPrimitive(w)) { _XmProcessLock(); border_unhighlight = xmPrimitiveClassRec.primitive_class.border_unhighlight; _XmProcessUnlock(); (*border_unhighlight)(w) ; } else { if(XmIsGadget(w)) { _XmProcessLock(); border_unhighlight = xmGadgetClassRec.gadget_class.border_unhighlight; _XmProcessUnlock(); (*border_unhighlight)(w); } } return ; } motif-2.3.8/lib/Xm/ShellEP.h0000644000175000017500000000450113145162623012365 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmShellEP_h #define _XmShellEP_h #include #ifdef __cplusplus extern "C" { #endif #define XmInheritEventHandler ((XtEventHandler)_XtInherit) #define _XmRAW_MAP 0 #define _XmPOPUP_MAP 1 #define _XmMANAGE_MAP 2 #ifndef XmIsShellExt #define XmIsShellExt(w) XtIsSubclass(w, xmShellExtObjectClass) #endif /* XmIsShellExt */ typedef struct _XmShellExtRec *XmShellExtObject; typedef struct _XmShellExtClassRec *XmShellExtObjectClass; externalref WidgetClass xmShellExtObjectClass; typedef struct _XmShellExtClassPart{ XtEventHandler structureNotifyHandler; XtPointer extension; }XmShellExtClassPart, *XmShellExtClassPartPtr; typedef struct _XmShellExtClassRec{ ObjectClassPart object_class; XmExtClassPart ext_class; XmDesktopClassPart desktop_class; XmShellExtClassPart shell_class; }XmShellExtClassRec; typedef struct { unsigned long lastConfigureRequest; Boolean useAsyncGeometry; } XmShellExtPart, *XmShellExtPartPtr; externalref XmShellExtClassRec xmShellExtClassRec; typedef struct _XmShellExtRec{ ObjectPart object; XmExtPart ext; XmDesktopPart desktop; XmShellExtPart shell; }XmShellExtRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmShellEP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DialogS.c0000644000175000017500000005774713145162623012432 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: DialogS.c /main/17 1996/03/25 17:50:11 barstow $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include #include #include #include "BaseClassI.h" #include "MessagesI.h" #include "XmImI.h" #define MSG1 _XmMMsgDialogS_0000 #define HALFDIFF(a, b) ((((Position)a) - ((Position)b))/2) #define TotalWidth(w) (XtWidth (w) + (2 * (XtBorderWidth (w)))) #define TotalHeight(w) (XtHeight (w) + (2 *(XtBorderWidth (w)))) /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInit( WidgetClass wc) ; static Widget GetRectObjKid( CompositeWidget p) ; static void Initialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void InsertChild( Widget w) ; static void GetDefaultPosition( Widget child, Widget parent, Position *xRtn, Position *yRtn) ; static void ChangeManaged( Widget wid) ; static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; /******** End Static Function Declarations ********/ static XmBaseClassExtRec myBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ XmInheritInitializePrehook, /* initialize prehook */ XmInheritSetValuesPrehook, /* set_values prehook */ XmInheritInitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ (WidgetClass)&xmDialogShellExtClassRec,/* secondary class */ XmInheritSecObjectCreate, /* secondary create */ NULL, /* getSecRes data */ {0} /* fast subclass */ }; externaldef(xmdialogshellclassrec) XmDialogShellClassRec xmDialogShellClassRec = { { /* core class record */ (WidgetClass) & transientShellClassRec, /* superclass */ "XmDialogShell", /* class_name */ sizeof(XmDialogShellWidgetRec), /* widget_size */ ClassInitialize, /* class_initialize proc */ ClassPartInit, /* class_part_initialize proc */ FALSE, /* class_inited flag */ Initialize, /* instance initialize proc */ NULL, /* init_hook proc */ XtInheritRealize, /* realize widget proc */ NULL, /* action table for class */ 0, /* num_actions */ NULL, /* resource list of class */ 0, /* num_resources in list */ NULLQUARK, /* xrm_class ? */ FALSE, /* don't compress_motion */ XtExposeCompressSeries, /* compressed exposure */ FALSE, /* do compress enter-leave */ FALSE, /* do have visible_interest */ NULL, /* destroy widget proc */ XtInheritResize, /* resize widget proc */ NULL, /* expose proc */ SetValues, /* set_values proc */ NULL, /* set_values_hook proc */ XtInheritSetValuesAlmost, /* set_values_almost proc */ NULL, /* get_values_hook */ NULL, /* accept_focus proc */ XtVersion, /* current version */ NULL, /* callback offset */ XtInheritTranslations, /* default translation table */ XtInheritQueryGeometry, /* query geometry widget proc */ NULL, /* display accelerator */ (XtPointer)&myBaseClassExtRec, /* extension record */ }, { /* composite class record */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ InsertChild, /* insert_child */ XtInheritDeleteChild, /* from the shell */ NULL, /* extension record */ }, { /* shell class record */ NULL, /* extension record */ }, { /* wm shell class record */ NULL, /* extension record */ }, { /* vendor shell class record */ NULL, /* extension record */ }, { /* transient class record */ NULL, /* extension record */ }, { /* our class record */ NULL, /* extension record */ }, }; /* * now make a public symbol that points to this class record */ externaldef(xmdialogshellwidgetclass) WidgetClass xmDialogShellWidgetClass = (WidgetClass)&xmDialogShellClassRec; static void ClassInitialize( void ) { Cardinal wc_num_res, sc_num_res, wc_unique_res; XtResource *merged_list; int i, j, k; XtResourceList uncompiled, res_list; Cardinal num; /************************************************************************** VendorExt and DialogExt resource lists are being merged into one and assigned to xmDialogShellExtClassRec. This is for performance reasons, since, instead of two calls to XtGetSubResources() XtGetSubvaluse() and XtSetSubvalues() for both the superclass and the widget class, now we have just one call with a merged resource list. ****************************************************************************/ wc_num_res = xmDialogShellExtClassRec.object_class.num_resources ; wc_unique_res = wc_num_res - 1; /* XmNdeleteResponse has been defined */ /* in VendorSE */ sc_num_res = xmVendorShellExtClassRec.object_class.num_resources; merged_list = (XtResource *)XtMalloc((sizeof(XtResource) * (wc_unique_res + sc_num_res))); _XmTransformSubResources(xmVendorShellExtClassRec.object_class.resources, sc_num_res, &uncompiled, &num); for (i = 0; i < num; i++) { merged_list[i] = uncompiled[i]; } XtFree((char *)uncompiled); res_list = xmDialogShellExtClassRec.object_class.resources; for (i = 0, j = num; i < wc_num_res; i++) { k = 0; while ((k < sc_num_res) && (strcmp(merged_list[k].resource_name,res_list[i].resource_name) != 0)) k++; if ((k < sc_num_res) && (strcmp(merged_list[k].resource_name, res_list[i].resource_name) == 0)) merged_list[k] = res_list[i]; else { merged_list[j] = xmDialogShellExtClassRec.object_class.resources[i]; j++; } } xmDialogShellExtClassRec.object_class.resources = merged_list; xmDialogShellExtClassRec.object_class.num_resources = wc_unique_res + sc_num_res ; xmDialogShellExtObjectClass->core_class.class_initialize(); myBaseClassExtRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInit * Set up the fast subclassing for the widget. * ************************************************************************/ static void ClassPartInit( WidgetClass wc ) { _XmFastSubclassInit(wc, XmDIALOG_SHELL_BIT); } static Widget GetRectObjKid( CompositeWidget p ) { Cardinal i; Widget *currKid; for (i = 0, currKid = p->composite.children; i < p->composite.num_children; i++, currKid++) { if ((XtIsRectObj( *currKid) /* The Input Method child is a CoreClass object; ignore it. */ && ((*currKid)->core.widget_class != coreWidgetClass)) || XmeTraitGet((XtPointer) XtClass(*currKid), XmQTdialogShellSavvy)) { return (*currKid); } } return NULL; } /************************************************************************ * * Initialize * ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget request, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { if (XtWidth (new_w) <= 0) XtWidth (new_w) = 5; if (XtHeight (new_w) <= 0) XtHeight (new_w) = 5; } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget current, Widget request, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { Widget child ; XmDialogSavvyTrait trait ; if(!current->core.mapped_when_managed && new_w->core.mapped_when_managed) { if((child = GetRectObjKid ((CompositeWidget) new_w)) && !child->core.being_destroyed ) { if ((trait = (XmDialogSavvyTrait) XmeTraitGet((XtPointer) XtClass(child), XmQTdialogShellSavvy)) != NULL) { trait->callMapUnmapCB(child, True); /* call Map callback */ } XtPopup(new_w, XtGrabNone) ; } } return (FALSE); } static void InsertChild( Widget w ) { CompositeWidget p = (CompositeWidget) XtParent (w); XtWidgetProc insert_child; /* * Make sure we only have a rectObj, a VendorObject, and * maybe an Input Method (CoreClass) object as children. */ if (!XtIsRectObj(w)) return; else { if( (w->core.widget_class != coreWidgetClass) /* The Input Method child is a CoreClass object. */ && GetRectObjKid( p) ) { /* we need _XmError() too! */ XtError(MSG1); } else { /* * make sure we're realized so people won't core dump when * doing incorrect managing prior to realize */ XtRealizeWidget((Widget) p); } } _XmProcessLock(); insert_child = ((CompositeWidgetClass) compositeWidgetClass) ->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(w); return ; } static void GetDefaultPosition( Widget child, Widget parent, Position *xRtn, Position *yRtn ) { Display *disp; int max_w, max_h; Position x, y; x = HALFDIFF(XtWidth(parent), XtWidth(child)); y = HALFDIFF(XtHeight(parent), XtHeight(child)); /* * find root co-ords of the parent's center */ if (XtIsRealized (parent)) XtTranslateCoords(parent, x, y, &x, &y); /* * try to keep the popup from dribbling off the display */ disp = XtDisplay (child); max_w = DisplayWidth (disp, DefaultScreen (disp)); max_h = DisplayHeight (disp, DefaultScreen (disp)); if ((x + (int)TotalWidth (child)) > max_w) x = max_w - TotalWidth (child); if ((y + (int)TotalHeight (child)) > max_h) y = max_h - TotalHeight (child); if (x < 0) x = 0; if (y < 0) y = 0; *xRtn = x; *yRtn = y; } /* * border width and size and location are ty... * * 1. We allow the border width of a XmDialogShell child to change * size arbitrarily. * * 2. The border width of the shell widget tracks the child's * at all times, exactly. * * 3. The width of the shell is kept exactly the same as the * width of the child at all times. * * 4. The child is always positioned at the location * (- child_border, - child_border). * * the net result is the child has a border width which is always * what the user asked for; but none of it is ever seen, it's all * clipped by the shell (parent). The user sees the border * of the shell which is the size he set the child's border to. * * In the DEC window manager world the window manager does * exactly the same thing with the window it puts around the shell. * Hence the shell and child have a border width just as the user * set but the window manager overrides that and only a single * pixel border is displayed. In a non-wm environment the child * appears to have a border width, in reality this is the shell * widget border. You wanted to know... */ static void ChangeManaged( Widget wid ) { XmDialogShellWidget shell = (XmDialogShellWidget) wid ; /* * If the child went to unmanaged, call XtPopdown. * If the child went to managed, call XtPopup. */ Widget child; XmWidgetExtData extData = _XmGetWidgetExtData((Widget) shell, XmSHELL_EXTENSION); XmVendorShellExtObject ve; XmDialogSavvyTrait trait ; if(extData==NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return; } ve = (XmVendorShellExtObject)extData->widget; if (((child = GetRectObjKid((CompositeWidget) shell)) == NULL) || (child->core.being_destroyed)) return; trait = (XmDialogSavvyTrait) XmeTraitGet((XtPointer) XtClass(child), XmQTdialogShellSavvy) ; /* MANAGED Case first ********/ if (child->core.managed) { XtWidgetGeometry request; Position kidX, kidY; Dimension kidBW; Boolean defaultPosition = True; /* * temporary workaround for setkeyboard focus ||| */ if (child != ve->vendor.old_managed) { XtSetKeyboardFocus((Widget)shell, (Widget)child); ve->vendor.old_managed = (Widget)child; } /* * if the child isn't realized, then we need to realize it * so we have a valid size. It will get created as a result * so we zero out it's position info so it'll * be okay and then restore it. */ if (!XtIsRealized(child)) { kidX = XtX(child); kidY = XtY(child); kidBW = XtBorderWidth(child); XtX(child) = 0; XtY(child) = 0; XtBorderWidth(child) = 0; XtRealizeWidget(child); XtX(child) = kidX; XtY(child) = kidY; XtBorderWidth(child) = kidBW; } else if (trait) { /* * Move the window to 0,0 * but don't tell the widget. It thinks it's where * the shell is... */ if ((XtX(child) != 0) || (XtY(child) != 0)) XMoveWindow (XtDisplay(child), XtWindow(child), 0, 0); } /* * map callback should occur BEFORE child default positioning * otherwise, widgets such as fileselection using map callback for * correct sizing have default positioning done before the widget * grows to its correct dimensions */ if(shell->core.mapped_when_managed && trait ) { trait->callMapUnmapCB(child, True); /* call Map callback */ } /* * Make sure that the shell has the same common parameters as * its child. Then move the child so that the shell will * correctly surround it. */ request.request_mode = 0; if (trait) { XtVaGetValues(child, XmNdefaultPosition, &defaultPosition, NULL); if (defaultPosition && (ve->vendor.externalReposition)) { defaultPosition = False; XtVaSetValues(child, XmNdefaultPosition, False, NULL); } } if (XtX(child) && trait) { kidX = XtX(child); XtX(child) = 0; } else kidX = XtX(shell); if (XtY(child) && trait) { kidY = XtY(child); XtY(child) = 0; } else kidY = XtY(shell); if (XtBorderWidth(child) && trait) { kidBW = XtBorderWidth(child); XtBorderWidth(child) = 0; } else kidBW = XtBorderWidth(shell); if (XtWidth (child) != XtWidth (shell)) { request.request_mode |= CWWidth; request.width = XtWidth(child); } if (XtHeight (child) + ve->vendor.im_height != XtHeight (shell)) { request.request_mode |= CWHeight; request.height = XtHeight(child) + ve->vendor.im_height; } if (trait) { if (defaultPosition) { GetDefaultPosition(child, XtParent(shell), &request.x, &request.y); if (request.x != kidX) request.request_mode |= CWX; if (request.y != kidY) request.request_mode |= CWY; } else { if (kidX != XtX(shell)) { request.request_mode |= CWX; if (kidX == XmDIALOG_SAVVY_FORCE_ORIGIN) request.x = 0; else request.x = kidX; } if (kidY != XtY(shell)) { request.request_mode |= CWY; if (kidY == XmDIALOG_SAVVY_FORCE_ORIGIN) request.y = 0; else request.y = kidY; } } } else { if (kidX != XtX(shell)) { request.request_mode |= CWX; request.x = kidX; } if (kidY != XtY(shell)) { request.request_mode |= CWY; request.y = kidY; } if (kidBW != XtBorderWidth(shell)) { request.request_mode |= CWBorderWidth; request.border_width = kidBW; } } if (request.request_mode) { unsigned int old_height = ve->vendor.im_height; XtMakeGeometryRequest((Widget) shell, &request, &request); _XmImResize((Widget)shell); if (ve->vendor.im_height != old_height) { request.request_mode = CWHeight; request.height = XtHeight(child) + ve->vendor.im_height; XtMakeGeometryRequest((Widget) shell, &request, &request); _XmImResize((Widget)shell); } } /* * the grab_kind is handled in the popup_callback */ if(shell->core.mapped_when_managed ) { XtPopup ((Widget) shell, XtGrabNone); } } /* * CHILD BEING UNMANAGED */ else { int i, j; /* * Fix for CR5043, CR5758 and CR8825 - * For nested Dialog Shells, it is necessary to unmanage * dialog shell popups of the child of this dialog shell. */ for (i = 0; i < child->core.num_popups; i++) { if (XmIsDialogShell(child->core.popup_list[i])) { XmDialogShellWidget next_shell = (XmDialogShellWidget)(child->core.popup_list[i]); for (j = 0; j < next_shell->composite.num_children; j++) { XtUnmanageChild(next_shell->composite.children[j]); } } } /* End Fix CR5043, CR5758 and CR8825 */ /* * take it down and then tell user */ XtPopdown((Widget) shell); if(trait ) { trait->callMapUnmapCB(child, False); /* call UnMap callback */ } } XmeNavigChangeManaged((Widget) shell); } /************************************************************************ * * GeometryManager * ************************************************************************/ /*ARGSUSED*/ static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply ) /* unused */ { ShellWidget shell = (ShellWidget)(wid->core.parent); XtWidgetGeometry my_request; XmVendorShellExtObject ve; XmWidgetExtData extData; extData = _XmGetWidgetExtData((Widget)shell, XmSHELL_EXTENSION); if(extData==NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returning NULL pointer."); #endif return XtGeometryNo; } ve = (XmVendorShellExtObject) extData->widget; if(!(shell->shell.allow_shell_resize) && XtIsRealized(wid) && (request->request_mode & (CWWidth | CWHeight | CWBorderWidth))) return(XtGeometryNo); /* * Because of our klutzy API we mimic position requests on the * dialog to ourselves. * We cannot check for the trait here since it isn't done only for * BB. DialogShell GM behavior is to always follow position requests * even if the child is not dialogShellSavvy. */ my_request.request_mode = 0; /* %%% worry about XtCWQueryOnly */ if (request->request_mode & XtCWQueryOnly) my_request.request_mode |= XtCWQueryOnly; /* Here we have a tricky bit of code. If the SetValues on the bb child position was 0, which is always the current position of the bb, Xt will not see a change and therefore not trigerred a geometry request. So BB (or any dialogShellSavvy child) has to catch this case and change the position request to use a special value, XmDIALOG_SAVVY_FORCE_ORIGIN, to notify the Dialog that it wants to move in 0 */ if (request->request_mode & CWX) { if (request->x == XmDIALOG_SAVVY_FORCE_ORIGIN) my_request.x = 0; else my_request.x = request->x; my_request.request_mode |= CWX; } if (request->request_mode & CWY) { if (request->y == XmDIALOG_SAVVY_FORCE_ORIGIN) my_request.y = 0; else my_request.y = request->y; my_request.request_mode |= CWY; } if (request->request_mode & CWWidth) { my_request.width = request->width; my_request.request_mode |= CWWidth; } if (request->request_mode & CWHeight) { if (!ve->vendor.im_height) _XmImResize((Widget)shell); /* updates im_height */ my_request.height = request->height + ve->vendor.im_height; my_request.request_mode |= CWHeight; } if (request->request_mode & CWBorderWidth) { my_request.border_width = request->border_width; my_request.request_mode |= CWBorderWidth; } if (XtMakeGeometryRequest((Widget)shell, &my_request, NULL) == XtGeometryYes) { if (!(request->request_mode & XtCWQueryOnly)) { /* just report the size changes to the kid, not the dialog position itself, but reply yes anyway */ if (my_request.request_mode & CWWidth) wid->core.width = my_request.width ; _XmImResize((Widget)shell); if (my_request.request_mode & CWHeight) wid->core.height = my_request.height - ve->vendor.im_height; } return XtGeometryYes; } else return XtGeometryNo; } /* ************************************************************************* * * Public creation entry points * ************************************************************************* */ /* * low level create entry points */ Widget XmCreateDialogShell( Widget p, char *name, ArgList al, Cardinal ac ) { return (XtCreatePopupShell(name, xmDialogShellWidgetClass, p, al, ac)); } /**************************************************************************** * this suffix is added to dialog shells created by Xm convenience routines * * so that, for example, a call to create a form dialog named f generates a * * dialog shell named f_popup in addition to a form named f * ****************************************************************************/ #define XmDIALOG_SUFFIX "_popup" #define XmDIALOG_SUFFIX_SIZE 6 /**************************************************************** * This convenience function creates a DialogShell and a given class * child of the shell; returns the child widget. ****************/ Widget XmeCreateClassDialog( WidgetClass w_class, Widget ds_p, String name, ArgList bb_args, Cardinal bb_n ) { Widget bb ; /* child */ Widget ds ; /* DialogShell */ ArgList ds_args ; /* arglist for shell */ char * ds_name ; if (!name) name = ""; /* Create DialogShell parent. */ ds_name = XtMalloc( (strlen(name)+XmDIALOG_SUFFIX_SIZE+1) * sizeof(char) ) ; strcpy( ds_name, name) ; strcat( ds_name, XmDIALOG_SUFFIX) ; ds_args = (ArgList) XtMalloc( sizeof( Arg) * (bb_n + 1)) ; memcpy( ds_args, bb_args, (sizeof( Arg) * bb_n)) ; XtSetArg( ds_args[bb_n], XmNallowShellResize, True) ; ds = XmCreateDialogShell( ds_p, ds_name, ds_args, bb_n + 1) ; XtFree( (char *) ds_args); XtFree( ds_name) ; /* Create the widget. */ bb = XtCreateWidget(name, w_class, ds, bb_args, bb_n) ; /* Add callback to destroy DialogShell parent. */ XtAddCallback(bb, XmNdestroyCallback, _XmDestroyParentCallback, (XtPointer) NULL) ; /* Return child. */ return( bb) ; } motif-2.3.8/lib/Xm/SeparatoGI.h0000644000175000017500000000265312672140200013064 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: SeparatoGI.h /main/5 1995/07/13 17:58:58 drk $ */ #ifndef _XmSeparatoGI_h #define _XmSeparatoGI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern int _XmSeparatorCacheCompare(XtPointer A, XtPointer B) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSeparatoGI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Label.c0000644000175000017500000026350213145162623012113 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Label.c /main/26 1997/06/18 17:40:00 samborn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "GadgetUtiI.h" #include "GMUtilsI.h" #include "LabelGI.h" #include "LabelI.h" #include "MessagesI.h" #include "MenuProcI.h" #include "PrimitiveI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "TransferI.h" #include "TravActI.h" #include "XmI.h" #include "XmosI.h" #include "XmStringI.h" #include #include #include #ifdef FIX_1381 #include #endif #ifdef FIX_1521 #ifdef USE_XFT #include "XmRenderTI.h" #include #endif #endif #define FIX_1442 #define FIX_1484 #define FIX_1504 #define Pix(w) ((w)->label.pixmap) #define Pix_insen(w) ((w)->label.pixmap_insen) /* Warning Messages */ #define CS_STRING_MESSAGE _XmMMsgLabel_0003 #define ACC_MESSAGE _XmMMsgLabel_0004 /******** Static Function Declarations ********/ static void ClassInitialize(void); static void ClassPartInitialize(WidgetClass c); static void InitializePrehook(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializePosthook(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void SetNormalGC(XmLabelWidget lw); static void Resize(Widget wid); static void Initialize(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static XtGeometryResult QueryGeometry(Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *reply); static void Destroy(Widget w); static void Redisplay(Widget wid, XEvent *event, Region region); static void Enter(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void Leave(Widget wid, XEvent *event, String *params, Cardinal *num_params); static Boolean SetValues(Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void SetOverrideCallback(Widget wid); static void Help(Widget w, XEvent *event, String *params, Cardinal *num_params); static void GetLabelString(Widget wid, int resource, XtArgVal *value); static void GetAccelerator(Widget wid, int resource, XtArgVal *value); static void GetAcceleratorText(Widget wid, int resource, XtArgVal *value); static XmStringCharSet _XmStringCharSetCreate(XmStringCharSet stringcharset); static void GetMnemonicCharSet(Widget wid, int resource, XtArgVal *value); static void SetValuesAlmost(Widget cw, Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply); static Boolean XmLabelGetDisplayRect(Widget w, XRectangle *displayrect); static Boolean XmLabelGetBaselines(Widget wid, Dimension **baselines, int *line_count); static void XmLabelMarginsProc(Widget w, XmBaselineMargins *margins_rec); static Widget GetPixmapDragIcon(Widget w); static void ProcessDrag(Widget w, XEvent *event, String *params, Cardinal *num_params); static void SetActivateCallbackState(Widget w, XmActivateState state); static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value); static void FromPaddingPixels(Widget, int, XtArgVal *); static XmImportOperator ToPaddingPixels(Widget, int, XtArgVal*); static XtPointer LabelGetValue(Widget, int); static void LabelSetValue(Widget, XtPointer, int); static int LabelPreferredValue(Widget); static char* GetLabelAccelerator(Widget); static KeySym GetLabelMnemonic(Widget); static XtPointer ConvertToEncoding(Widget, char*, Atom, unsigned long *, Boolean *); /******** End Static Function Declarations ********/ void _XmLabelConvert(Widget w, XtPointer ignore, XmConvertCallbackStruct*); /* Transfer trait record */ static XmConst XmTransferTraitRec LabelTransfer = { 0, /* version */ (XmConvertCallbackProc) _XmLabelConvert, /* convertProc */ NULL, /* destinationProc */ NULL /* destinationPreHookProc */ }; /* Menu Savvy trait record */ static XmConst XmMenuSavvyTraitRec MenuSavvyRecord = { 0, /* version */ (XmMenuSavvyDisableProc) SetActivateCallbackState, /* disableCallback */ GetLabelAccelerator, /* getAccelerator */ GetLabelMnemonic, /* getMnemonic */ (XmMenuSavvyGetActivateCBNameProc) NULL, /* getActivateCBName */ }; /* Access Textual trait record */ XmAccessTextualTraitRec _XmLabel_AccessTextualRecord = { 0, /* version */ LabelGetValue, /* getValueMethod */ LabelSetValue, /* setValuesMethod */ LabelPreferredValue, /* preferredFormat */ }; /* Default translations and action recs */ static XtTranslations default_parsed; #define defaultTranslations _XmLabel_defaultTranslations static XtTranslations menu_parsed; #define menuTranslations _XmLabel_menuTranslations static XtActionsRec ActionsList[] = { { "Enter", Enter }, { "Leave", Leave }, { "Help", Help }, { "ProcessDrag", ProcessDrag } }; /* Here are the translations used by the subclasses for menu traversal */ /* The matching actions are defined in RowColumn.c */ #define menu_traversal_events _XmLabel_menu_traversal_events static XtResource resources[] = { { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, primitive.shadow_thickness), XmRImmediate, (XtPointer) 0 }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf(XmLabelRec, label.alignment), XmRImmediate, (XtPointer) XmALIGNMENT_CENTER }, { XmNlabelType, XmCLabelType, XmRLabelType, sizeof(unsigned char), XtOffsetOf(XmLabelRec, label.label_type), XmRImmediate, (XtPointer) XmSTRING }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_width), XmRImmediate, (XtPointer) 2 }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_height), XmRImmediate, (XtPointer) 2 }, { XmNmarginLeft, XmCMarginLeft, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_left), XmRImmediate, (XtPointer) 0 }, { XmNmarginRight, XmCMarginRight, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_right), XmRImmediate, (XtPointer) 0 }, { XmNmarginTop, XmCMarginTop, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_top), XmRImmediate, (XtPointer) 0 }, { XmNmarginBottom, XmCMarginBottom, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_bottom), XmRImmediate, (XtPointer) 0 }, { "pri.vate","Pri.vate",XmRBoolean, sizeof(Boolean), XtOffsetOf(XmLabelRec, label.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmLabelRec, label.font), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmLabelRec, label.font), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNlabelPixmap, XmCLabelPixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelRec, label.pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNlabelInsensitivePixmap, XmCLabelInsensitivePixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelRec, label.pixmap_insen), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNlabelString, XmCXmString, XmRXmString, sizeof(XmString), XtOffsetOf(XmLabelRec, label._label), XmRImmediate, (XtPointer) NULL }, { XmNmnemonic, XmCMnemonic, XmRKeySym, sizeof(KeySym), XtOffsetOf(XmLabelRec, label.mnemonic), XmRImmediate, (XtPointer) XK_VoidSymbol }, { XmNmnemonicCharSet, XmCMnemonicCharSet, XmRString, sizeof(XmStringCharSet), XtOffsetOf(XmLabelRec, label.mnemonicCharset), XmRImmediate, (XtPointer) XmFONTLIST_DEFAULT_TAG }, { XmNaccelerator, XmCAccelerator, XmRString, sizeof(char *), XtOffsetOf(XmLabelRec, label.accelerator), XmRImmediate, (XtPointer) NULL }, { XmNacceleratorText, XmCAcceleratorText, XmRXmString, sizeof(XmString), XtOffsetOf(XmLabelRec, label._acc_text), XmRImmediate, (XtPointer) NULL }, { XmNrecomputeSize, XmCRecomputeSize, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmLabelRec, label.recompute_size), XmRImmediate, (XtPointer) True }, { XmNstringDirection, XmCStringDirection, XmRStringDirection, sizeof(unsigned char), XtOffsetOf(XmLabelRec, label.string_direction), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) False }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmPrimitiveRec, primitive.highlight_thickness), XmRImmediate, (XtPointer) 0 }, #ifndef XM_PART_BC { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), XtOffsetOf(XmPrimitiveRec, primitive.layout_direction), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, #endif { XmNpixmapPlacement, XmCPixmapPlacement, XmRPixmapPlacement, sizeof(XmPixmapPlacement), XtOffsetOf(XmLabelRec, label.pixmap_placement), XmRImmediate, (XtPointer) XmPIXMAP_LEFT }, { XmNpixmapTextPadding, XmCSpace, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.pixmap_text_padding), XmRImmediate, (XtPointer) 2 } }; /* Definition for resources that need special processing in get values. */ static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNmarginLeft, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_left), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginRight, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_right), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginTop, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_top), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNmarginBottom, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.margin_bottom), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNlabelString, sizeof(XmString), XtOffsetOf(XmLabelRec, label._label), GetLabelString, NULL }, { XmNmnemonicCharSet, sizeof(XmStringCharSet), XtOffsetOf(XmLabelRec, label.mnemonicCharset), GetMnemonicCharSet, NULL }, { XmNaccelerator, sizeof(String), XtOffsetOf(XmLabelRec, label.accelerator), GetAccelerator, NULL }, { XmNacceleratorText, sizeof(XmString), XtOffsetOf(XmLabelRec, label._acc_text), GetAcceleratorText, NULL }, { XmNpixmapTextPadding, sizeof(Dimension), XtOffsetOf(XmLabelRec, label.pixmap_text_padding), FromPaddingPixels, (XmImportProc) ToPaddingPixels } }; static XmBaseClassExtRec labelBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ XmInheritSetValuesPrehook, /* set_values prehook */ InitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ XmInheritGetSecResData, /* getSecResData */ { 0 }, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook */ NULL, /* ext_resources */ NULL, /* compiled_ext_resources */ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange /* focusChange */ }; static XmPrimitiveClassExtRec _XmLabelPrimClassExtRec = { NULL, /* next_extension */ NULLQUARK, /* record_type */ XmPrimitiveClassExtVersion, /* version */ sizeof(XmPrimitiveClassExtRec), /* record_size */ XmLabelGetBaselines, /* widget_baseline */ XmLabelGetDisplayRect, /* widget_display_rect */ XmLabelMarginsProc, /* widget_margins */ }; externaldef (xmlabelclassrec) XmLabelClassRec xmLabelClassRec = { { (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "XmLabel", /* class_name */ sizeof(XmLabelRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* chained class init */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize hook */ XtInheritRealize, /* realize */ ActionsList, /* actions */ XtNumber(ActionsList), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress enter/exit */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set values hook */ SetValuesAlmost, /* set values almost */ NULL, /* get values hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback offsetlst */ NULL, /* default trans */ QueryGeometry, /* query geo proc */ NULL, /* display accelerator */ (XtPointer)&labelBaseClassExtRec /* extension record */ }, { /* XmPrimitiveClassPart */ XmInheritBorderHighlight, /* border_highlight */ XmInheritBorderUnhighlight, /* border_unhighlight */ XtInheritTranslations, /* translations */ NULL, /* arm_and_activate */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num syn_resources */ (XtPointer)&_XmLabelPrimClassExtRec, /* extension */ }, { /* XmLabelClassPart */ SetOverrideCallback, /* override_callback */ NULL, /* menu procedure interface */ NULL, /* translations */ NULL /* extension record */ } }; externaldef(xmlabelwidgetclass) WidgetClass xmLabelWidgetClass = (WidgetClass) &xmLabelClassRec; /********************************************************************* * * ClassInitialize * This is the class initialization routine. It is called only * the first time a widget of this class is initialized. * ********************************************************************/ /*ARGSUSED*/ static void ClassInitialize(void) { /* Parse the various translation tables */ menu_parsed = XtParseTranslationTable(menuTranslations); default_parsed = XtParseTranslationTable(defaultTranslations); /* Set up base class extension quark */ labelBaseClassExtRec.record_type = XmQmotif; xmLabelClassRec.label_class.translations = (String) (XtParseTranslationTable(menu_traversal_events)); /* Install menu savvy on just this class */ XmeTraitSet((XtPointer) &xmLabelClassRec, XmQTmenuSavvy, (XtPointer) &MenuSavvyRecord); } void _XmLabelCloneMenuSavvy(WidgetClass wc, XmMenuSavvyTrait mst) { /* Modify and reinstall menu savvy trait */ if (mst->version == -1) { mst->version = MenuSavvyRecord.version; mst->disableCallback = MenuSavvyRecord.disableCallback; mst->getAccelerator = MenuSavvyRecord.getAccelerator; mst->getMnemonic = MenuSavvyRecord.getMnemonic; } /* Install the new record */ XmeTraitSet((XtPointer) wc, XmQTmenuSavvy, (XtPointer) mst); } char* _XmCBNameActivate() { return XmNactivateCallback; } char* _XmCBNameValueChanged() { return XmNvalueChangedCallback; } /************************************************************ * * InitializePosthook * Restore core class translations. * ************************************************************/ /*ARGSUSED*/ static void InitializePosthook(Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { _XmRestoreCoreClassTranslations (new_w); } /********************************************************************* * * ClassPartInitialize * Processes the class fields which need to be inherited. * ************************************************************************/ static void ClassPartInitialize(WidgetClass c) { register XmLabelWidgetClass wc = (XmLabelWidgetClass) c; XmLabelWidgetClass super = (XmLabelWidgetClass)wc->core_class.superclass; if (wc->label_class.setOverrideCallback == XmInheritSetOverrideCallback) wc->label_class.setOverrideCallback = super->label_class.setOverrideCallback; if (wc->label_class.translations == XtInheritTranslations) wc->label_class.translations = super->label_class.translations; _XmFastSubclassInit (c, XmLABEL_BIT); /* Install traits */ XmeTraitSet((XtPointer) c, XmQTtransfer, (XtPointer) &LabelTransfer); XmeTraitSet((XtPointer) c, XmQTaccessTextual, (XtPointer) &_XmLabel_AccessTextualRecord); } /************************************************************ * * InitializePrehook * Put the proper translations in core_class tm_table so * that the data is massaged correctly. * ************************************************************/ /*ARGSUSED*/ static void InitializePrehook(Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { unsigned char type; XmMenuSystemTrait menuSTrait; _XmProcessLock(); if (new_w->core.widget_class->core_class.tm_table != NULL) { _XmProcessUnlock(); return; } _XmSaveCoreClassTranslations (new_w); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) XtParent(new_w)), XmQTmenuSystem); if (menuSTrait != (XmMenuSystemTrait) NULL) type = menuSTrait->type(XtParent(new_w)); else type = XmWORK_AREA; if (type == XmWORK_AREA) new_w->core.widget_class->core_class.tm_table = (String) default_parsed; else new_w->core.widget_class->core_class.tm_table = (String) menu_parsed; _XmProcessUnlock(); } /************************************************************************ * * SetNormalGC * Create the normal and insensitive GC's for the gadget. * ************************************************************************/ static void SetNormalGC(XmLabelWidget lw) { XGCValues values; XtGCMask valueMask, dynamicMask; XFontStruct *fs = (XFontStruct *) NULL; valueMask = GCForeground | GCBackground | GCGraphicsExposures; dynamicMask = GCClipMask | GCClipXOrigin | GCClipYOrigin; values.foreground = lw->primitive.foreground; values.background = lw->core.background_pixel; values.graphics_exposures = False; if (XmeRenderTableGetDefaultFont(lw->label.font, &fs)) values.font = fs->fid, valueMask |= GCFont; lw->label.normal_GC = XtAllocateGC((Widget) lw, 0, valueMask, &values, dynamicMask, 0); #ifdef FIX_1381 /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor((Widget)lw); values.background = lw->core.background_pixel; #else valueMask |= GCFillStyle | GCStipple; values.foreground = lw->core.background_pixel; values.background = lw->primitive.foreground; values.fill_style = FillOpaqueStippled; values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw); #endif lw->label.insensitive_GC = XtAllocateGC((Widget) lw, 0, valueMask, &values, dynamicMask, 0); #ifdef FIX_1381 /*light shadow for insensitive text (instead stipple)*/ values.foreground = lw->primitive.top_shadow_color; lw->label.shadow_GC = XtAllocateGC((Widget) lw, 0, valueMask, &values, dynamicMask, 0); #endif } /************************************************************************ * * _XmCalcLabelDimensions() * Calculates the dimensions of the label text and pixmap, and updates * the TextRect fields appropriately. Called at Initialize and SetValues. * Also called by subclasses to recalculate label dimensions. * ************************************************************************/ void _XmCalcLabelDimensions(Widget wid) { XmLabelWidget newlw = (XmLabelWidget) wid; XmLabelPart *lp = &(newlw->label); unsigned int w = 0, h = 0; /* Initialize TextRect width and height to 0, change later if needed */ lp->acc_TextRect.width = 0; lp->acc_TextRect.height = 0; lp->StringRect.x = 0; lp->StringRect.y = 0; lp->StringRect.width = 0; lp->StringRect.height = 0; lp->PixmapRect.x = 0; lp->PixmapRect.y = 0; lp->PixmapRect.width = 0; lp->PixmapRect.height = 0; if (Lab_IsPixmap(newlw) || Lab_IsPixmapAndText(newlw)) { /* change NULL pixmap to refer to XmUNSPECIFIED_PIXMAP */ if (Pix(newlw) == (Pixmap)None) Pix(newlw) = XmUNSPECIFIED_PIXMAP; if (Pix_insen(newlw) == (Pixmap)None) Pix_insen(newlw) = XmUNSPECIFIED_PIXMAP; /* Is a pixmap so find out how big it is. */ if (XtIsSensitive(wid)) { if (Pix(newlw) != XmUNSPECIFIED_PIXMAP) { XmeGetPixmapData(XtScreen(newlw), Pix(newlw), NULL, NULL, NULL, NULL, NULL, NULL, &w, &h); lp->PixmapRect.width = (unsigned short) w; lp->PixmapRect.height = (unsigned short) h; } } else { Pixmap pix_use = Pix_insen (newlw) ; if (pix_use == XmUNSPECIFIED_PIXMAP) pix_use = Pix(newlw); if (pix_use != XmUNSPECIFIED_PIXMAP) { XmeGetPixmapData(XtScreen(newlw), pix_use, NULL, NULL, NULL, NULL, NULL, NULL, &w, &h); lp->PixmapRect.width = (unsigned short) w; lp->PixmapRect.height = (unsigned short) h; } } } if (Lab_IsText(newlw) || Lab_IsPixmapAndText(newlw)) { Dimension w, h; if (!XmStringEmpty (lp->_label)) { /* If we have a string then size it. */ XmStringExtent(lp->font, lp->_label, &w, &h); lp->StringRect.width = (unsigned short)w; lp->StringRect.height = (unsigned short)h; } } _XmLabelCalcTextRect(wid); if (lp->_acc_text != NULL) { Dimension w, h; /* If we have a string then size it. */ if (!XmStringEmpty (lp->_acc_text)) { XmStringExtent(lp->font, lp->_acc_text, &w, &h); lp->acc_TextRect.width = (unsigned short)w; lp->acc_TextRect.height = (unsigned short)h; } } } void _XmLabelCalcTextRect(Widget wid) { XmLabelWidget newlw = (XmLabelWidget) wid; XmLabelPart *lp = &(newlw->label); lp->TextRect.width = 0; lp->TextRect.height = 0; if (Lab_IsPixmap(newlw)) { lp->TextRect.width = lp->PixmapRect.width; lp->TextRect.height = lp->PixmapRect.height; } else if (Lab_IsText(newlw)) { lp->TextRect.width = lp->StringRect.width; lp->TextRect.height = lp->StringRect.height; } else if (Lab_IsPixmapAndText(newlw)) { if (lp->pixmap_placement == XmPIXMAP_TOP || lp->pixmap_placement == XmPIXMAP_BOTTOM) { lp->TextRect.height = lp->PixmapRect.height + lp->StringRect.height + lp->pixmap_text_padding; lp->TextRect.width = MAX(lp->StringRect.width, lp->PixmapRect.width); } else if (lp->pixmap_placement == XmPIXMAP_LEFT || lp->pixmap_placement == XmPIXMAP_RIGHT) { lp->TextRect.width = lp->PixmapRect.width + lp->StringRect.width + lp->pixmap_text_padding; lp->TextRect.height = MAX(lp->StringRect.height, lp->PixmapRect.height); } if (lp->pixmap_placement == XmPIXMAP_TOP) { lp->PixmapRect.y = 0; lp->StringRect.y = lp->PixmapRect.height + lp->pixmap_text_padding; } else if (lp->pixmap_placement == XmPIXMAP_BOTTOM) { lp->StringRect.y = 0; lp->PixmapRect.y = lp->StringRect.height + lp->pixmap_text_padding; } else if ((lp->pixmap_placement == XmPIXMAP_RIGHT && LayoutIsRtoLP(wid)) || (lp->pixmap_placement == XmPIXMAP_LEFT && !LayoutIsRtoLP(wid))) { lp->PixmapRect.x = 0; lp->StringRect.x = lp->PixmapRect.width + lp->pixmap_text_padding; } else if ((lp->pixmap_placement == XmPIXMAP_LEFT && LayoutIsRtoLP(wid)) || (lp->pixmap_placement == XmPIXMAP_RIGHT && !LayoutIsRtoLP(wid))) { lp->StringRect.x = 0; lp->PixmapRect.x = lp->StringRect.width + lp->pixmap_text_padding; } if (lp->pixmap_placement == XmPIXMAP_RIGHT || lp->pixmap_placement == XmPIXMAP_LEFT) { lp->PixmapRect.y = (lp->TextRect.height - lp->PixmapRect.height) / 2; lp->StringRect.y = (lp->TextRect.height - lp->StringRect.height) / 2; } else { if (lp->alignment == XmALIGNMENT_CENTER) { lp->PixmapRect.x = (lp->TextRect.width - lp->PixmapRect.width) / 2; lp->StringRect.x = (lp->TextRect.width - lp->StringRect.width) / 2; } else if ((lp->alignment == XmALIGNMENT_END && !LayoutIsRtoLP(wid)) || (lp->alignment == XmALIGNMENT_BEGINNING && LayoutIsRtoLP(wid))) { lp->PixmapRect.x = lp->TextRect.width - lp->PixmapRect.width; lp->StringRect.x = lp->TextRect.width - lp->StringRect.width; } } } } /************************************************************************ * * Resize * Sets new width, new height, and new label.TextRect * appropriately. This routine is called by Initialize and * SetValues. * ************************************************************************/ static void Resize(Widget wid) { XmLabelWidget newlw = (XmLabelWidget) wid; XmLabelPart *lp = &(newlw->label); int leftx, rightx; /* Increase margin width if necessary to accomodate accelerator text. */ if (lp->_acc_text != NULL) { if (LayoutIsRtoLP(newlw)) { if (lp->margin_left < (Dimension) (lp->acc_TextRect.width + LABEL_ACC_PAD) ) { int delta = lp->acc_TextRect.width + LABEL_ACC_PAD - lp->margin_left; lp->acc_left_delta += delta; lp->margin_left += delta; } } else { if (lp->margin_right < (Dimension) (lp->acc_TextRect.width + LABEL_ACC_PAD) ) { int delta = lp->acc_TextRect.width + LABEL_ACC_PAD - lp->margin_right; lp->acc_right_delta += delta; lp->margin_right += delta; } } } /* Has a width been specified? */ if (newlw->core.width == 0) newlw->core.width = (Dimension) lp->TextRect.width + lp->margin_left + lp->margin_right + (2 * (lp->margin_width + newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness)); leftx = (newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness + lp->margin_width + lp->margin_left); rightx = (newlw->core.width - (newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness + lp->margin_width + lp->margin_right)); switch (lp->alignment) { case XmALIGNMENT_BEGINNING: if (LayoutIsRtoLP(newlw)) lp->TextRect.x = rightx - lp->TextRect.width; else lp->TextRect.x = leftx; break; case XmALIGNMENT_END: if (LayoutIsRtoLP(newlw)) lp->TextRect.x = leftx; else lp->TextRect.x = rightx - lp->TextRect.width; break; default: /* CR 9737: Be careful about casting here, since rounding during */ /* division on Suns depends on the sign. */ lp->TextRect.x = leftx + (rightx - leftx - (int)lp->TextRect.width) / 2; break; } /* Has a height been specified? */ if (newlw->core.height == 0) newlw->core.height = (Dimension) MAX(lp->TextRect.height, lp->acc_TextRect.height) + lp->margin_top + lp->margin_bottom + (2 * (lp->margin_height + newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness)); lp->TextRect.y = (short) (newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness + lp->margin_height + lp->margin_top + ((int) (newlw->core.height - lp->margin_top - lp->margin_bottom - (2 * (lp->margin_height + newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness)) - lp->TextRect.height) / 2)); if (lp->_acc_text != NULL) { Dimension base_label, base_accText, diff; if (LayoutIsRtoLP(newlw)) lp->acc_TextRect.x = newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness + newlw->label.margin_width; else lp->acc_TextRect.x = (short) newlw->core.width - newlw->primitive.highlight_thickness - newlw->primitive.shadow_thickness - newlw->label.margin_width - newlw->label.margin_right + LABEL_ACC_PAD; lp->acc_TextRect.y = (short) (newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness + lp->margin_height + lp->margin_top + ((int) (newlw->core.height - lp->margin_top - lp->margin_bottom - (2 * (lp->margin_height + newlw->primitive.highlight_thickness + newlw->primitive.shadow_thickness)) - lp->acc_TextRect.height) / 2)); /* make sure the label and accelerator text line up */ /* when the fonts are different */ if (Lab_IsText(newlw) || Lab_IsPixmapAndText(newlw)) { base_label = XmStringBaseline (lp->font, lp->_label); base_accText = XmStringBaseline (lp->font, lp->_acc_text); if (base_label > base_accText) { diff = base_label - base_accText; lp->acc_TextRect.y = (short) lp->TextRect.y + diff - 1; } else if (base_label < base_accText) { diff = base_accText - base_label; lp->TextRect.y = (short) lp->acc_TextRect.y + diff - 1; } } } if (newlw->core.width == 0) /* set core width and height to a */ newlw->core.width = 1; /* default value so that it doesn't */ if (newlw->core.height == 0) /* generate a Toolkit Error */ newlw->core.height = 1; } /************************************************************ * * Initialize * This is the widget's instance initialize routine. It is * called once for each widget * ************************************************************/ /*ARGSUSED*/ static void Initialize( Widget req, Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmLabelWidget lw = (XmLabelWidget) new_w; XmMenuSystemTrait menuSTrait; XtTranslations trans; lw->label.baselines = NULL; lw->label.computing_size = FALSE; /* if menuProcs is not set up yet, try again */ if (xmLabelClassRec.label_class.menuProcs == NULL) xmLabelClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); /* Check for Invalid enumerated types */ if (!XmRepTypeValidValue(XmRID_LABEL_TYPE, lw->label.label_type, (Widget) lw)) { lw->label.label_type = XmSTRING; } if (!XmRepTypeValidValue(XmRID_ALIGNMENT, lw->label.alignment, (Widget) lw)) { lw->label.alignment = XmALIGNMENT_CENTER; } if (!XmRepTypeValidValue(XmRID_PIXMAP_PLACEMENT, lw->label.pixmap_placement, (Widget) lw)) { lw->label.pixmap_placement = XmPIXMAP_LEFT; } #ifndef NO_XM_1_2_BC /* * Some pre-Motif 2.0 XmManager subclasses may be bypassing the * synthetic resouce GetValues hook and passing us the manager's raw * string_direction field (which is now a layout_direction). Fixup * the common/simple cases. */ switch (lw->label.string_direction) { case XmLEFT_TO_RIGHT: case XmRIGHT_TO_LEFT: /* These string directions are erroneous uses of layout directions. */ lw->label.string_direction = XmDirectionToStringDirection(lw->label.string_direction); break; default: /* Other unknown layout directions will still get a warning. */ break; } #endif /* If layout_direction is set, it overrides string_direction. * If string_direction is set, but not layout_direction, use * string_direction value. * If neither is set, get from parent */ if (XmPrim_layout_direction(lw) != XmDEFAULT_DIRECTION) { if (lw->label.string_direction == XmDEFAULT_DIRECTION) lw->label.string_direction = XmDirectionToStringDirection(XmPrim_layout_direction(lw)); } else if (lw->label.string_direction != XmDEFAULT_DIRECTION) { XmPrim_layout_direction(lw) = XmStringDirectionToDirection(lw->label.string_direction); } else { XmPrim_layout_direction(lw) = _XmGetLayoutDirection(XtParent(new_w)); lw->label.string_direction = XmDirectionToStringDirection(XmPrim_layout_direction(lw)); } if (!XmRepTypeValidValue(XmRID_STRING_DIRECTION, lw->label.string_direction, (Widget) lw)) { lw->label.string_direction = XmSTRING_DIRECTION_L_TO_R; } /* Make a local copy of the font list */ if (lw->label.font == NULL) { /* CR 2990: Let subclasses choose their own default font. */ lw->label.font = XmeGetDefaultRenderTable (new_w, XmLABEL_FONTLIST); } lw->label.font = XmFontListCopy(lw->label.font); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(new_w)), XmQTmenuSystem); /* get menu type and which button */ if (menuSTrait != (XmMenuSystemTrait) NULL) lw->label.menu_type = menuSTrait->type(XtParent(new_w)); else lw->label.menu_type = XmWORK_AREA; /* Handle the label string : * If label is the constant XmUNSPECIFIED, creates a empty XmString. * (this is used by DrawnB instead of a default conversion that leads * to a leak when someone provides a real label) * If no label string is given accept widget's name as default. * convert the widgets name to an XmString before storing; * else * save a copy of the given string. * If the given string is not an XmString issue an warning. */ if (lw->label._label == (XmString) XmUNSPECIFIED) { lw->label._label = XmeGetLocalizedString ((char *) NULL, /* reserved */ (Widget) lw, XmNlabelString, ""); } else if (lw->label._label == NULL) { lw->label._label = XmeGetLocalizedString ((char *) NULL, /* reserved */ (Widget) lw, XmNlabelString, lw->core.name); } else if (XmeStringIsValid(lw->label._label)) { lw->label._label= XmStringCopy(lw->label._label); } else { XmeWarning((Widget) lw, CS_STRING_MESSAGE); lw->label._label = XmStringCreateLocalized(lw->core.name); } /* * Convert the given mnemonicCharset to the internal Xm-form. */ if (lw->label.mnemonicCharset != NULL) lw->label.mnemonicCharset = _XmStringCharSetCreate (lw->label.mnemonicCharset); else lw->label.mnemonicCharset = _XmStringCharSetCreate (XmFONTLIST_DEFAULT_TAG); /* Accelerators are currently only supported in menus */ if ((lw->label._acc_text != NULL) && Lab_IsMenupane(lw)) { if (XmeStringIsValid((XmString) lw->label._acc_text)) { /* * Copy the input string into local space, if * not a Cascade Button */ if (XmIsCascadeButton(lw)) lw->label._acc_text = NULL; else lw->label._acc_text = XmStringCopy((XmString) lw->label._acc_text); } else { XmeWarning((Widget) lw, ACC_MESSAGE); lw->label._acc_text = NULL; } } else lw->label._acc_text = NULL; if ((lw->label.accelerator != NULL) && Lab_IsMenupane(lw)) { /* Copy the accelerator into local space */ lw->label.accelerator = XtNewString(lw->label.accelerator); } else lw->label.accelerator = NULL; lw->label.skipCallback = FALSE; lw->label.acc_right_delta = 0; lw->label.acc_left_delta = 0; /* If zero width and height was requested by the application, */ /* reset new_w's width and height to zero to allow Resize() */ /* to operate properly. */ if (req->core.width == 0) lw->core.width = 0; if (req->core.height == 0) lw->core.height = 0; /* CR 6267: Suppress highlight thickness before sizing also. */ if ((lw->label.menu_type == XmMENU_POPUP) || (lw->label.menu_type == XmMENU_PULLDOWN) || (lw->label.menu_type == XmMENU_BAR)) lw->primitive.highlight_thickness = 0; _XmCalcLabelDimensions(new_w); /* CR 7283: We can't use the resize method pointer, because */ /* subclasses haven't been initialized yet. */ Resize((Widget) lw); SetNormalGC(lw); /* Force the label traversal flag when in a menu. */ if ((XtClass(lw) == xmLabelWidgetClass) && ((lw->label.menu_type == XmMENU_POPUP) || (lw->label.menu_type == XmMENU_PULLDOWN) || (lw->label.menu_type == XmMENU_OPTION))) { lw->primitive.traversal_on = FALSE; lw->primitive.highlight_on_enter = FALSE; } /* if in menu, override with menu traversal translations */ if ((lw->label.menu_type == XmMENU_POPUP) || (lw->label.menu_type == XmMENU_PULLDOWN) || (lw->label.menu_type == XmMENU_BAR) || (lw->label.menu_type == XmMENU_OPTION)) { _XmProcessLock(); trans = (XtTranslations) ((XmLabelClassRec *)XtClass(lw))->label_class.translations; _XmProcessUnlock(); XtOverrideTranslations((Widget) lw, trans); } else { _XmProcessLock(); trans = (XtTranslations) ((XmPrimitiveClassRec *) XtClass(lw))->primitive_class.translations; _XmProcessUnlock(); /* Otherwise override with primitive traversal translations */ XtOverrideTranslations((Widget) lw, trans); } } /************************************************************************ * * QueryGeometry * ************************************************************************/ static XtGeometryResult QueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired) { XmLabelWidget lw = (XmLabelWidget) widget; if (lw->label.recompute_size == FALSE) { desired->width = XtWidth(widget); desired->height = XtHeight(widget); } else { desired->width = (Dimension) lw->label.TextRect.width + (2 * (lw->label.margin_width + lw->primitive.highlight_thickness + lw->primitive.shadow_thickness)) + lw->label.margin_left + lw->label.margin_right; if (desired->width == 0) desired->width = 1; desired->height = (Dimension) MAX(lw->label.TextRect.height, lw->label.acc_TextRect.height) + (2 * (lw->label.margin_height + lw->primitive.highlight_thickness + lw->primitive.shadow_thickness)) + lw->label.margin_top + lw->label.margin_bottom; if (desired->height == 0) desired->height = 1; } return XmeReplyToQueryGeometry(widget, intended, desired); } /************************************************************************ * * Destroy * Free up the label gadget allocated space. This includes * the label, and GC's. * ************************************************************************/ static void Destroy( Widget w) { XmLabelWidget lw = (XmLabelWidget) w; if (lw->label._label != NULL) XmStringFree (lw->label._label); if (lw->label._acc_text != NULL) XmStringFree (lw->label._acc_text); if (lw->label.accelerator != NULL) XtFree (lw->label.accelerator); if (lw->label.font != NULL) XmFontListFree (lw->label.font); if (lw->label.mnemonicCharset != NULL) XtFree (lw->label.mnemonicCharset); if (lw->label.baselines != NULL) XtFree ((char*) lw->label.baselines); XtReleaseGC ((Widget) lw, lw->label.normal_GC); XtReleaseGC ((Widget) lw, lw->label.insensitive_GC); #ifdef FIX_1381 XtReleaseGC ((Widget) lw, lw->label.shadow_GC); #endif } /************************************************************************ * * Redisplay * ***********************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region) { XmLabelWidget lw = (XmLabelWidget) wid; GC gc; GC clipgc = NULL; XRectangle clip_rect; XmLabelPart *lp; Dimension availW, availH, marginal_width, marginal_height, max_text_height; int depth; lp = &(lw->label); /* * Set a clipping area if the label will overwrite critical margins. * A critical margin is defined to be "margin_{left,right, * top,bottom} margin" because it used for other things * such as default_button_shadows and accelerators. Note that * overwriting the "margin_{width,height}" margins is allowed. */ availH = lw->core.height; availW = lw->core.width; /* Adjust definitions of temporary variables */ marginal_width = lp->margin_left + lp->margin_right + (2 * (lw->primitive.highlight_thickness + lw->primitive.shadow_thickness)); marginal_height = lp->margin_top + lp->margin_bottom + (2 * (lw->primitive.highlight_thickness + lw->primitive.shadow_thickness)); max_text_height = MAX(lp->TextRect.height, lp->acc_TextRect.height); if (XtIsSensitive(wid)) clipgc = lp->normal_GC; else clipgc = lp->insensitive_GC; if ((availH < (Dimension)(marginal_height + max_text_height)) || (availW < (Dimension)(marginal_width + lp->TextRect.width))) { clip_rect.x = lw->primitive.highlight_thickness + lw->primitive.shadow_thickness + lp->margin_left; clip_rect.y = lw->primitive.highlight_thickness + lw->primitive.shadow_thickness + lp->margin_top; /* Don't allow negative dimensions. */ if (availW > marginal_width) clip_rect.width = availW - marginal_width; else clip_rect.width = 0; if (availH > marginal_height) clip_rect.height = availH - marginal_height; else clip_rect.height = 0; XSetClipRectangles(XtDisplay(lw), clipgc, 0,0, &clip_rect, 1, Unsorted); #ifdef FIX_1521 #ifdef USE_XFT _XmXftSetClipRectangles(XtDisplay(lw), XtWindow(lw), 0, 0, &clip_rect, 1); #endif #endif } else { XSetClipMask (XtDisplay (lw), clipgc, None); #ifdef FIX_1521 #ifdef USE_XFT XftDraw* draw = _XmXftDrawCreate(XtDisplay(lw), XtWindow(lw)); XftDrawSetClip(draw, NULL); #endif #endif } #ifdef USE_XFT /* it is needed to clear anti-aliased text before draw it again */ if ((Lab_IsText (lw) || Lab_IsPixmapAndText(lw)) && (lp->_label != NULL) && lp->TextRect.width > 0 && lp->TextRect.height > 0) { XClearArea(XtDisplay(lw), XtWindow(lw), lp->TextRect.x, lp->TextRect.y, lp->TextRect.width, lp->TextRect.height, False); } #endif if (Lab_IsPixmap(lw) || Lab_IsPixmapAndText(lw)) { if (XtIsSensitive(wid)) { if (Pix (lw) != XmUNSPECIFIED_PIXMAP) { gc = lp->normal_GC; XmeGetPixmapData(XtScreen(lw), Pix(lw), NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == lw->core.depth) XCopyArea (XtDisplay(lw), Pix(lw), XtWindow(lw), gc, 0, 0, lp->PixmapRect.width, lp->PixmapRect.height, lp->TextRect.x + lp->PixmapRect.x, lp->TextRect.y + lp->PixmapRect.y); else if (depth == 1) XCopyPlane (XtDisplay(lw), Pix(lw), XtWindow(lw), gc, 0, 0, lp->PixmapRect.width, lp->PixmapRect.height, lp->TextRect.x + lp->PixmapRect.x, lp->TextRect.y + lp->PixmapRect.y, 1); } } else { Pixmap pix_use = Pix_insen (lw) ; if (pix_use == XmUNSPECIFIED_PIXMAP) #ifdef FIX_1381 Pix_insen(lw) = pix_use = _XmConvertToBW(wid, Pix(lw)); #else pix_use = Pix(lw); #endif if (pix_use != XmUNSPECIFIED_PIXMAP) { gc = lp->insensitive_GC; XmeGetPixmapData(XtScreen(lw), pix_use, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == lw->core.depth) XCopyArea (XtDisplay(lw), pix_use, XtWindow(lw), gc, 0, 0, lp->PixmapRect.width, lp->PixmapRect.height, lp->TextRect.x + lp->PixmapRect.x, lp->TextRect.y + lp->PixmapRect.y); else if (depth == 1) XCopyPlane (XtDisplay(lw), pix_use, XtWindow(lw), gc, 0, 0, lp->PixmapRect.width, lp->PixmapRect.height, lp->TextRect.x + lp->PixmapRect.x, lp->TextRect.y + lp->PixmapRect.y, 1); #ifndef FIX_1381 /* if no insensitive pixmap but a regular one, we need to do the stipple manually, since copyarea doesn't */ if (pix_use == Pix(lw)) { /* need fill stipple, not opaque */ XSetFillStyle(XtDisplay(lw), gc, FillStippled); XFillRectangle(XtDisplay(lw), XtWindow(lw), gc, lp->TextRect.x + lp->PixmapRect.x, lp->TextRect.y + lp->PixmapRect.y, lp->PixmapRect.width, lp->PixmapRect.height); XSetFillStyle(XtDisplay(lw), gc, FillOpaqueStippled); } #endif #ifdef FIX_1505 if (pix_use == Pix(lw)) { XSetFillStyle(XtDisplay(lw), gc, FillStippled); XSetStipple(XtDisplay(lw), gc, _XmGetInsensitiveStippleBitmap((Widget)lw)); XFillRectangle(XtDisplay(lw), XtWindow(lw), gc, lp->TextRect.x + lp->PixmapRect.x, lp->TextRect.y + lp->PixmapRect.y, lp->PixmapRect.width, lp->PixmapRect.height); XSetFillStyle(XtDisplay(lw), gc, FillSolid); } #endif } } } if ((Lab_IsText (lw) || Lab_IsPixmapAndText(lw)) && (lp->_label != NULL)) { if (lp->mnemonic != XK_VoidSymbol) { /* CR 5181: Convert the mnemonic keysym to a character string. */ char tmp[MB_LEN_MAX * 2]; XmString underline; tmp[_XmOSKeySymToCharacter(lp->mnemonic, NULL, tmp)] = '\0'; underline = XmStringCreate(tmp, lp->mnemonicCharset); #ifdef FIX_1381 if (XtIsSensitive(wid) ) { /*Draw normal text*/ XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, lp->normal_GC, lp->TextRect.x + lp->StringRect.x, lp->TextRect.y + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL, underline); } else { /*Draw shadow for insensitive text*/ XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, lp->shadow_GC, lp->TextRect.x+1 + lp->StringRect.x, lp->TextRect.y+1 + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL, underline); /*Draw insensitive text*/ XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, lp->insensitive_GC, lp->TextRect.x + lp->StringRect.x, lp->TextRect.y + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL, underline); } #else XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, (XtIsSensitive(wid) ? lp->normal_GC : lp->insensitive_GC), lp->TextRect.x + lp->StringRect.x, lp->TextRect.y + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL, underline); #endif XmStringFree(underline); } else #ifdef FIX_1381 { if (XtIsSensitive(wid) ) { /*Draw normal text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, lp->normal_GC, lp->TextRect.x + lp->StringRect.x, lp->TextRect.y + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL); } else { /*Draw shadow for insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, lp->shadow_GC, lp->TextRect.x+1 + lp->StringRect.x, lp->TextRect.y+1 + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL); /*Draw insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, lp->insensitive_GC, lp->TextRect.x + lp->StringRect.x, lp->TextRect.y + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL); } } #else XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_label, (XtIsSensitive(wid) ? lp->normal_GC : lp->insensitive_GC), lp->TextRect.x + lp->StringRect.x, lp->TextRect.y + lp->StringRect.y, lp->StringRect.width, lp->alignment, XmPrim_layout_direction(lw), NULL); #endif #ifndef FIX_1381 #ifdef USE_XFT if (!XtIsSensitive(wid)) { XSetFillStyle(XtDisplay(lw), lp->insensitive_GC, FillStippled); XFillRectangle(XtDisplay(lw), XtWindow(lw), lp->insensitive_GC, lp->TextRect.x + lp->StringRect.x, lp->TextRect.y + lp->StringRect.y, lp->StringRect.width, lp->StringRect.height); XSetFillStyle(XtDisplay(lw), lp->insensitive_GC, FillOpaqueStippled); } #endif #endif } if (lp->_acc_text != NULL) { /* Since accelerator text is drawn by moving in from the right, * it is possible to overwrite label text when there is clipping, * Therefore draw accelerator text only if there is enough * room for everything */ if (lw->core.width >= (Dimension) (2 * (lw->primitive.highlight_thickness + lw->primitive.shadow_thickness + lp->margin_width) + lp->margin_left + lp->TextRect.width + lp->margin_right)) { #ifdef FIX_1381 if (XtIsSensitive(wid) ) { /*Draw normal text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_acc_text, lp->normal_GC, lp->acc_TextRect.x, lp->acc_TextRect.y, lp->acc_TextRect.width, XmALIGNMENT_END, XmPrim_layout_direction(lw), NULL); } else { /*Draw shadow for insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_acc_text, lp->shadow_GC, lp->acc_TextRect.x+1, lp->acc_TextRect.y+1, lp->acc_TextRect.width, XmALIGNMENT_END, XmPrim_layout_direction(lw), NULL); /*Draw insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_acc_text, lp->insensitive_GC, lp->acc_TextRect.x, lp->acc_TextRect.y, lp->acc_TextRect.width, XmALIGNMENT_END, XmPrim_layout_direction(lw), NULL); } #else XmStringDraw (XtDisplay(lw), XtWindow(lw), lp->font, lp->_acc_text, (XtIsSensitive(wid) ? lp->normal_GC : lp->insensitive_GC), lp->acc_TextRect.x, lp->acc_TextRect.y, lp->acc_TextRect.width, XmALIGNMENT_END, XmPrim_layout_direction(lw), NULL); #endif } } /* Redraw the proper highlight */ if (! Lab_IsMenupane(lw) && Lab_MenuType(lw) != XmMENU_BAR) { XtExposeProc expose; _XmProcessLock(); expose = (xmPrimitiveClassRec.core_class.expose); _XmProcessUnlock(); /* Envelop our superclass expose method */ (*(expose))((Widget) lw, event, region); } } /********************************************************************** * * Enter * *********************************************************************/ static void Enter(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmLabelWidget w = (XmLabelWidget) wid; if (w->primitive.highlight_on_enter) _XmPrimitiveEnter (wid, event, params, num_params); } /********************************************************************** * * Leave * *********************************************************************/ static void Leave(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmLabelWidget w = (XmLabelWidget) wid; if (w->primitive.highlight_on_enter) _XmPrimitiveLeave ((Widget) w, event, params, num_params); } /************************************************************************ * * SetValues * This routine will take care of any changes that have been made. * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues(Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmLabelWidget current = (XmLabelWidget) cw; XmLabelWidget req = (XmLabelWidget) rw; XmLabelWidget new_w = (XmLabelWidget) nw; Boolean flag = FALSE; Boolean newstring = FALSE; XmLabelPart *newlp, *curlp, *reqlp; Boolean ProcessFlag = FALSE; Boolean CleanupFontFlag = FALSE; Boolean Call_Resize = False; XmMenuSystemTrait menuSTrait; /* Get pointers to the label parts */ newlp = &(new_w->label); curlp = &(current->label); reqlp = &(req->label); /* Discard the baseline cache if it is no longer valid. */ if ((newlp->_label != curlp->_label) || (newlp->font != curlp->font)) { if (newlp->baselines) { XtFree ((char*) newlp->baselines); newlp->baselines = NULL; } } /* If the label has changed, make a copy of the new label */ /* and free the old label. */ if (newlp->_label != curlp->_label) { newstring = TRUE; if (newlp->_label == NULL) { newlp->_label = XmStringCreateLocalized(new_w->core.name); } else { if (XmeStringIsValid((XmString) newlp->_label)) newlp->_label = XmStringCopy((XmString) newlp->_label); else { XmeWarning((Widget) new_w, CS_STRING_MESSAGE); newlp->_label = XmStringCreateLocalized(new_w->core.name); } } XmStringFree(curlp->_label); curlp->_label= NULL; reqlp->_label= NULL; } if (newlp->margin_right != curlp->margin_right) newlp->acc_right_delta = 0; if (newlp->margin_left != curlp->margin_left) newlp->acc_left_delta = 0; if ((newlp->_acc_text != curlp->_acc_text) && Lab_IsMenupane(new_w)) { /* BEGIN OSF Fix pir 1098 */ newstring = TRUE; /* END OSF Fix pir 1098 */ if (newlp->_acc_text != NULL) { if (XmeStringIsValid((XmString) newlp->_acc_text)) { if ((XmIsCascadeButton (new_w)) && (newlp->_acc_text != NULL)) newlp->_acc_text = NULL; else newlp->_acc_text = XmStringCopy((XmString) newlp->_acc_text); XmStringFree(curlp->_acc_text); curlp->_acc_text= NULL; reqlp->_acc_text= NULL; } else { XmeWarning((Widget) new_w, ACC_MESSAGE); newlp->_acc_text = NULL; curlp->_acc_text= NULL; reqlp->_acc_text= NULL; } } /* BEGIN OSF Fix pir 1098 */ else if (curlp->_acc_text) { /* CR 3481: Don't blindly force the margin back to 0; */ /* try to preserve the user specified value. */ if (LayoutIsRtoLP(new_w)) { newlp->margin_left -= newlp->acc_left_delta; newlp->acc_left_delta = 0; } else { newlp->margin_right -= newlp->acc_right_delta; newlp->acc_right_delta = 0; } } /* END OSF Fix pir 1098 */ } else newlp->_acc_text = curlp->_acc_text; if (newlp->font != curlp->font) { CleanupFontFlag = True; if (newlp->font == NULL) { /* CR 2990: Let subclasses determine default fonts. */ newlp->font = XmeGetDefaultRenderTable((Widget) new_w, XmLABEL_FONTLIST); } newlp->font = XmFontListCopy (newlp->font); } if ((new_w->label.menu_type == XmMENU_POPUP) || (new_w->label.menu_type == XmMENU_PULLDOWN) || (new_w->label.menu_type == XmMENU_BAR)) new_w->primitive.highlight_thickness = 0; if (!XmRepTypeValidValue(XmRID_LABEL_TYPE, new_w->label.label_type, (Widget) new_w)) { new_w->label.label_type = current->label.label_type; } #ifdef FIX_1484 if (!XmRepTypeValidValue(XmRID_PIXMAP_PLACEMENT, new_w->label.pixmap_placement, #else if (!XmRepTypeValidValue(XmRID_LABEL_TYPE, new_w->label.pixmap_placement, #endif (Widget) new_w)) { new_w->label.pixmap_placement = current->label.pixmap_placement; } if (LayoutP(new_w) != LayoutP(current)) { /* if no new margins specified swap them */ if ((LayoutIsRtoLP(current) != LayoutIsRtoLP(new_w)) && (Lab_MarginLeft(current) == Lab_MarginLeft(new_w)) && (Lab_MarginRight(current) == Lab_MarginRight(new_w))) { Lab_MarginLeft(new_w) = Lab_MarginRight(current); Lab_MarginRight(new_w) = Lab_MarginLeft(current); } flag = TRUE; } /* ValidateInputs(new_w); */ #ifdef FIX_1504 _XmCalcLabelDimensions((Widget) new_w); Boolean pixmap_size_changed = ((newlp->PixmapRect.width != curlp->PixmapRect.width) || (newlp->PixmapRect.height != curlp->PixmapRect.height)); #endif if (((Lab_IsText(new_w) || Lab_IsPixmapAndText(new_w)) && ((newstring) || (newlp->font != curlp->font))) || ((Lab_IsPixmap(new_w) || Lab_IsPixmapAndText(new_w)) && ((newlp->pixmap != curlp->pixmap) || (newlp->pixmap_insen != curlp->pixmap_insen) || /* When you have different sized pixmaps for sensitive and */ /* insensitive states and sensitivity changes, */ /* the right size is chosen. (osfP2560) */ #ifdef FIX_1504 (XtIsSensitive(nw) != XtIsSensitive(cw))) && pixmap_size_changed) || #else (XtIsSensitive(nw) != XtIsSensitive(cw)))) || #endif (Lab_IsPixmapAndText(new_w) && (newlp->pixmap_placement != curlp->pixmap_placement)) || (newlp->label_type != curlp->label_type)) { /* CR 9179: Redo CR 5419 changes. */ if (newlp->recompute_size) { if (req->core.width == current->core.width) new_w->core.width = 0; if (req->core.height == current->core.height) new_w->core.height = 0; } #ifndef FIX_1504 _XmCalcLabelDimensions((Widget) new_w); #endif Call_Resize = True; flag = True; } if ((newlp->alignment != curlp->alignment) || (XmPrim_layout_direction(new_w) != XmPrim_layout_direction(current))) { if (!XmRepTypeValidValue(XmRID_ALIGNMENT, new_w->label.alignment, (Widget) new_w)) { new_w->label.alignment = current->label.alignment; } Call_Resize = True; flag = True; } if ((newlp->margin_height != curlp->margin_height) || (newlp->margin_width != curlp->margin_width) || (newlp->margin_left != curlp->margin_left) || (newlp->margin_right != curlp->margin_right) || (newlp->margin_top != curlp->margin_top) || (newlp->margin_bottom != curlp->margin_bottom) || (new_w->primitive.shadow_thickness != current->primitive.shadow_thickness) || (new_w->primitive.highlight_thickness != current->primitive.highlight_thickness) || ((new_w->core.width <= 0) || (new_w->core.height <= 0)) || (newlp->pixmap_text_padding != curlp->pixmap_text_padding)) { if (!XmRepTypeValidValue(XmRID_ALIGNMENT, new_w->label.alignment, (Widget) new_w)) { new_w->label.alignment = current->label.alignment; } if (!XmRepTypeValidValue(XmRID_STRING_DIRECTION, new_w->label.string_direction, (Widget) new_w)) { new_w->label.string_direction = current->label.string_direction; } if (newlp->recompute_size) { if (req->core.width == current->core.width) new_w->core.width = 0; if (req->core.height == current->core.height) new_w->core.height = 0; } Call_Resize = True; flag = True; } /* Resize is called only if we need to calculate the dimensions or */ /* coordinates for the string. */ if (Call_Resize) { XtWidgetProc resize; /* CR 5419: Suppress redundant calls to DrawnB's resize callbacks. */ Boolean was_computing = newlp->computing_size; newlp->computing_size = TRUE; _XmProcessLock(); resize = new_w->core.widget_class->core_class.resize; _XmProcessUnlock(); (* (resize)) ((Widget) new_w); newlp->computing_size = was_computing; } /* * If sensitivity of the label has changed then we must redisplay * the label. */ if (XtIsSensitive(nw) != XtIsSensitive(cw)) { flag = TRUE; } if ((new_w->primitive.foreground != current->primitive.foreground) || (new_w->core.background_pixel != current->core.background_pixel) || (newlp->font != curlp->font)) { XtReleaseGC((Widget) current, current->label.normal_GC); XtReleaseGC((Widget) current, current->label.insensitive_GC); SetNormalGC(new_w); flag = TRUE; } /* Force the traversal flag when in a menu. */ if ((XtClass(new_w) == xmLabelWidgetClass) && ((new_w->label.menu_type == XmMENU_POPUP) || (new_w->label.menu_type == XmMENU_PULLDOWN) || (new_w->label.menu_type == XmMENU_OPTION))) { new_w->primitive.traversal_on = FALSE; new_w->primitive.highlight_on_enter = FALSE; } if (new_w->primitive.traversal_on && (new_w->primitive.traversal_on != current->primitive.traversal_on) && new_w->core.tm.translations) { XtTranslations trans; if ((new_w->label.menu_type == XmMENU_POPUP) || (new_w->label.menu_type == XmMENU_PULLDOWN) || (new_w->label.menu_type == XmMENU_BAR) || (new_w->label.menu_type == XmMENU_OPTION)) { _XmProcessLock(); trans = (XtTranslations) ((XmLabelClassRec *)XtClass(new_w))->label_class.translations; _XmProcessUnlock(); if (trans) XtOverrideTranslations((Widget)new_w, trans); } else { _XmProcessLock(); trans = (XtTranslations) ((XmLabelClassRec*) XtClass(new_w))->primitive_class.translations; _XmProcessUnlock(); if (trans) XtOverrideTranslations ((Widget)new_w, trans); } } if ((new_w->label.menu_type != XmWORK_AREA) && (new_w->label.mnemonic != current->label.mnemonic)) { /* New grabs only required if mnemonic changes */ ProcessFlag = TRUE; if (new_w->label.label_type == XmSTRING || new_w->label.label_type == XmPIXMAP_AND_STRING) flag = TRUE; } if (new_w->label.mnemonicCharset != current->label.mnemonicCharset) { if (new_w->label.mnemonicCharset) new_w->label.mnemonicCharset = _XmStringCharSetCreate(new_w->label.mnemonicCharset); else new_w->label.mnemonicCharset = _XmStringCharSetCreate(XmFONTLIST_DEFAULT_TAG); if (current->label.mnemonicCharset != NULL) XtFree (current->label.mnemonicCharset); if (new_w->label.label_type == XmSTRING || new_w->label.label_type == XmPIXMAP_AND_STRING) flag = TRUE; } if (Lab_IsMenupane(new_w) && (new_w->label.accelerator != current->label.accelerator)) { if (newlp->accelerator != NULL) { /* Copy the accelerator into local space */ newlp->accelerator = XtNewString(newlp->accelerator); } XtFree(curlp->accelerator); curlp->accelerator = NULL; reqlp->accelerator = NULL; ProcessFlag = TRUE; } else newlp->accelerator = curlp->accelerator; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(current)), XmQTmenuSystem); if (ProcessFlag && menuSTrait != NULL) menuSTrait->updateBindings((Widget)new_w, XmREPLACE); if (flag && (new_w->label.menu_type == XmMENU_PULLDOWN) && menuSTrait != NULL) menuSTrait->updateHistory(XtParent(new_w), (Widget) new_w, True); if (CleanupFontFlag) if (curlp->font) XmFontListFree(curlp->font); return flag; } /************************************************************************ * * SetActivateCallbackState * * This function is used as the method of the menuSavvy trait. It is * used by menu savvy parents to set whether or not the child will * invoke its own activate callback or whether it will defer to the * entryCallback of the parent. * ************************************************************************/ static void SetActivateCallbackState(Widget wid, XmActivateState state) { XmLabelWidget w = (XmLabelWidget) wid; switch (state) { case XmDISABLE_ACTIVATE: w->label.skipCallback = True; break; case XmENABLE_ACTIVATE: w->label.skipCallback = False; break; } } /************************************************************************ * * SetOverrideCallback * Used by subclasses. If this is set true, then there is a RowColumn * parent with the entryCallback resource set. The subclasses do not * do their activate callbacks, instead the RowColumn callbacks are called * by RowColumn. ************************************************************************/ static void SetOverrideCallback(Widget wid) { XmLabelWidget w = (XmLabelWidget) wid; w->label.skipCallback = True; } /************************************************************************ * * Help * This routine is called if the user made a help selection * on the widget. * ************************************************************************/ static void Help(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmLabelWidget lw = (XmLabelWidget) w; Widget parent = XtParent(lw); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(lw)), XmQTmenuSystem); if (Lab_IsMenupane(lw) && menuSTrait != NULL) menuSTrait->popdown((Widget) parent, event); _XmPrimitiveHelp((Widget) w, event, params, num_params); } /************************************************************************ * * GetLabelString * This is a get values hook function that returns the external * form of the label string from the internal form. * ***********************************************************************/ /*ARGSUSED*/ static void GetLabelString(Widget wid, int resource, /* unused */ XtArgVal *value) { XmLabelWidget lw = (XmLabelWidget) wid; XmString string; string = XmStringCopy(lw->label._label); *value = (XtArgVal) string; } /************************************************************************ * * GetAccelerator * This is a get values hook function that returns a copy * of the accelerator string. * ***********************************************************************/ /*ARGSUSED*/ static void GetAccelerator(Widget wid, int resource, /* unused */ XtArgVal *value) { XmLabelWidget lw = (XmLabelWidget) wid; String string; string = XtNewString(Lab_Accelerator(lw)); *value = (XtArgVal) string; } /************************************************************************ * * GetAcceleratorText * This is a get values hook function that returns the external * form of the accelerator text from the internal form. * ***********************************************************************/ /*ARGSUSED*/ static void GetAcceleratorText(Widget wid, int resource, /* unused */ XtArgVal *value) { XmLabelWidget lw = (XmLabelWidget) wid; XmString string; string = XmStringCopy(lw->label._acc_text); *value = (XtArgVal) string; } /************************************************************************ * * XmCreateLabel() * XmVaCreateLabel() * XmVaCreateManagedLabel() * Externally accessable function for creating a label gadget. * ************************************************************************/ Widget XmCreateLabel(Widget parent, char *name, Arg *arglist, Cardinal argCount) { return XtCreateWidget(name,xmLabelWidgetClass,parent,arglist,argCount); } Widget XmVaCreateLabel( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmLabelWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedLabel( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmLabelWidgetClass, parent, True, var, count); va_end(var); return w; } static XmStringCharSet _XmStringCharSetCreate(XmStringCharSet stringcharset) { return (XmStringCharSet) XtNewString((char*) stringcharset); } /************************************************************************ * * GetMnemonicCharSet * This is a get values hook function that returns the external * form of the mnemonicCharSet from the internal form. Returns a * string containg the mnemonicCharSet. Caller must free the string. ***********************************************************************/ /*ARGSUSED*/ static void GetMnemonicCharSet(Widget wid, int resource, /* unused */ XtArgVal *value) { XmLabelWidget lw = (XmLabelWidget) wid; char *cset; int size; cset = NULL; if (lw->label.mnemonicCharset) { size = strlen (lw->label.mnemonicCharset); if (size > 0) cset = (char *) (_XmStringCharSetCreate(lw->label.mnemonicCharset)); } *value = (XtArgVal) cset; } /*ARGSUSED*/ static void SetValuesAlmost(Widget cw, /* unused */ Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply) { XmLabelWidget new_w = (XmLabelWidget) nw; XtWidgetProc resize; _XmProcessLock(); resize = new_w->core.widget_class->core_class.resize; _XmProcessUnlock(); (* (resize)) ((Widget) new_w); *request = *reply; } /************************************************************************ * * XmLabelGetDisplayRect * A Class function which returns True if the widget being passed in * has a display rectangle associated with it. It also determines the * x,y coordinates of the character cell or pixmap relative to the origin, * and the width and height in pixels of the smallest rectangle that encloses * the text or pixmap. This is assigned to the variable being passed in * ***********************************************************************/ static Boolean XmLabelGetDisplayRect(Widget w, XRectangle *displayrect) { XmLabelWidget wid = (XmLabelWidget) w; (*displayrect).x = wid->label.TextRect.x; (*displayrect).y = wid->label.TextRect.y; (*displayrect).width = wid->label.TextRect.width; (*displayrect).height = wid->label.TextRect.height; return TRUE; } /************************************************************************ * * XmLabelGetBaselines * A Class function which when called returns True, if the widget * has a baseline and also determines the number of pixels from the y * origin to the first line of text and assigns it to the variable * being passed in. * ************************************************************************/ static Boolean XmLabelGetBaselines(Widget wid, Dimension **baselines, int *line_count) { XmLabelWidget lw = (XmLabelWidget)wid; Cardinal count; int delta; if (Lab_IsPixmap(wid)) return False; /* Compute raw baselines if unavailable. */ if (lw->label.baselines == NULL) { _XmStringGetBaselines(lw->label.font, lw->label._label, &(lw->label.baselines), &count); assert(lw->label.baselines != NULL); /* Store the current offset in an extra location. */ lw->label.baselines = (Dimension*) XtRealloc((char*) lw->label.baselines, (count+1) * sizeof(Dimension)); lw->label.baselines[count] = 0; } else { count = XmStringLineCount(lw->label._label); } /* Readjust offsets if necessary. */ delta = Lab_TextRect_y(lw) - lw->label.baselines[count]; if (delta) { int tmp; for (tmp = 0; tmp <= count; tmp++) lw->label.baselines[tmp] += delta; } /* Copy the cached data. */ *line_count = count; *baselines = (Dimension*) XtMalloc(*line_count * sizeof(Dimension)); memcpy((char*) *baselines, (char*) lw->label.baselines, *line_count * sizeof(Dimension)); return True; } /************************************************************************ * * XmLabelMarginsProc * ***********************************************************************/ /* ARGSUSED */ static void XmLabelMarginsProc(Widget w, XmBaselineMargins *margins_rec) { if (margins_rec->get_or_set == XmBASELINE_SET) { Lab_MarginTop(w) = margins_rec->margin_top; Lab_MarginBottom(w) = margins_rec->margin_bottom; } else { margins_rec->margin_top = Lab_MarginTop(w); margins_rec->margin_bottom = Lab_MarginBottom(w); margins_rec->shadow = Lab_Shadow(w); margins_rec->highlight = Lab_Highlight(w); margins_rec->text_height = Lab_TextRect_height(w); margins_rec->margin_height = Lab_MarginHeight(w); } } static Widget GetPixmapDragIcon(Widget w) { XmLabelWidget lw = (XmLabelWidget) w; Arg args[10]; int n; Widget drag_icon; Widget screen_object = XmGetXmScreen(XtScreen(w)); unsigned int width, height; int depth; /* It's a labelPixmap, use directly the pixmap */ XmeGetPixmapData(XtScreen(lw), Pix(lw), NULL, &depth, NULL, NULL, NULL, NULL, &width, &height); n = 0; XtSetArg(args[n], XmNhotX, 0), n++; XtSetArg(args[n], XmNhotY, 0), n++; XtSetArg(args[n], XmNwidth, width), n++; XtSetArg(args[n], XmNheight, height), n++; XtSetArg(args[n], XmNmaxWidth, width), n++; XtSetArg(args[n], XmNmaxHeight, height), n++; XtSetArg(args[n], XmNdepth, depth), n++; XtSetArg(args[n], XmNpixmap, Pix(lw)), n++; XtSetArg(args[n], XmNforeground, lw->core.background_pixel), n++; XtSetArg(args[n], XmNbackground, lw->primitive.foreground), n++; assert(n <= XtNumber(args)); drag_icon = XtCreateWidget("drag_icon", xmDragIconObjectClass, screen_object, args, n); return drag_icon; } /*ARGSUSED*/ static void ProcessDrag(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmLabelWidget lw = (XmLabelWidget) w; Widget drag_icon; Arg args[10]; int n; Time _time = _XmGetDefaultTime(w, event); XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); if (Lab_IsMenupane(w)) XAllowEvents(XtDisplay(w), SyncPointer, _time); /* Disallow drag if this is a cascade button and armed - Hack alert */ if (XmIsCascadeButton(w) && CB_IsArmed(w)) return; /* CDE - allow user to not drag labels and label subclasses also, disable drag if enable_btn1_transfer is set to BUTTON2_ADJUST and the trigger was button2 */ if (! dpy -> display.enable_unselectable_drag || (dpy -> display.enable_btn1_transfer == XmBUTTON2_ADJUST && event && event -> xany.type == ButtonPress && event -> xbutton.button == 2)) return; /* CR 5141: Don't allow multi-button drags; they just cause confusion. */ if (event && ! (event->xbutton.state & ~((Button1Mask >> 1) << event->xbutton.button) & (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask))) { n = 0; XtSetArg(args[n], XmNcursorBackground, lw->core.background_pixel), n++; XtSetArg(args[n], XmNcursorForeground, lw->primitive.foreground), n++; /* If it's a labelPixmap, only specify the pixmap icon */ if (Lab_IsPixmap(lw) && (Pix(lw) != XmUNSPECIFIED_PIXMAP)) { drag_icon = GetPixmapDragIcon(w); XtSetArg(args[n], XmNsourcePixmapIcon, drag_icon), n++; } else { drag_icon = XmeGetTextualDragIcon(w); XtSetArg(args[n], XmNsourceCursorIcon, drag_icon), n++; } XtSetArg(args[n], XmNdragOperations, XmDROP_COPY), n++; (void) XmeDragSource(w, NULL, event, args, n); } } /*ARGSUSED*/ void _XmLabelConvert(Widget w, XtPointer ignore, XmConvertCallbackStruct *cs) { enum { XmA_MOTIF_COMPOUND_STRING, XmACOMPOUND_TEXT, XmATEXT, XmATARGETS, XmA_MOTIF_DROP, XmABACKGROUND, XmAFOREGROUND, XmAPIXEL, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_COMPOUND_STRING, XmSCOMPOUND_TEXT, XmSTEXT, XmSTARGETS, XmS_MOTIF_DROP, XmIBACKGROUND, XmIFOREGROUND, XmIPIXEL, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; Atom atoms[XtNumber(atom_names)]; Atom C_ENCODING; int target_count = 0; Atom type = None; XtPointer value = NULL; unsigned long size = 0; int format = 8; XmString label_string; Pixmap label_pixmap; Boolean is_pixmap, is_text; if (w == (Widget) NULL) { cs->status = XmCONVERT_REFUSE; return; } C_ENCODING = XmeGetEncodingAtom(w); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplayOfObject(w), atom_names, XtNumber(atom_names), False, atoms); if (cs->selection != atoms[XmA_MOTIF_DROP]) { cs->status = XmCONVERT_REFUSE; return; } if (XtIsWidget(w)) { label_string = ((XmLabelWidget) w)->label._label; label_pixmap = ((XmLabelWidget) w)->label.pixmap; is_pixmap = Lab_IsPixmap(w) || Lab_IsPixmapAndText(w); is_text = Lab_IsText(w) || Lab_IsPixmapAndText(w); } else { label_string = ((XmLabelGadget) w)->label._label; label_pixmap = ((XmLabelGadget) w)->label.pixmap; is_pixmap = LabG_IsPixmap(w) || LabG_IsPixmapAndText(w);; is_text = LabG_IsText(w) || LabG_IsPixmapAndText(w); } if (cs->target == atoms[XmATARGETS] || cs->target == atoms[XmA_MOTIF_EXPORT_TARGETS] || cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS]) { Atom *targs; if (cs->target == atoms[XmATARGETS]) { targs = XmeStandardTargets(w, 7, &target_count); } else { target_count = 0; targs = (Atom *) XtMalloc(sizeof(Atom) * 7); } value = (XtPointer) targs; if (is_pixmap) { targs[target_count] = XA_PIXMAP; target_count++; } if (is_text) { XtPointer temp; unsigned long length; char* ctext; Boolean success; ctext = XmCvtXmStringToCT(label_string); targs[target_count] = atoms[XmA_MOTIF_COMPOUND_STRING]; target_count++; targs[target_count] = atoms[XmACOMPOUND_TEXT]; target_count++; targs[target_count] = atoms[XmATEXT]; target_count++; #ifdef UTF8_SUPPORTED if (C_ENCODING != XA_STRING && C_ENCODING != atoms[XmAUTF8_STRING]) { temp = ConvertToEncoding(w, ctext, C_ENCODING, &length, &success); if (success) { targs[target_count] = C_ENCODING; target_count++; } XtFree((char*) temp); } #endif temp = ConvertToEncoding(w, ctext, XA_STRING, &length, &success); if (success) { targs[target_count] = XA_STRING; target_count++; } XtFree((char*) temp); XtFree((char*) ctext); #ifdef UTF8_SUPPORTED ctext = XmCvtXmStringToUTF8String(label_string); if (ctext) { targs[target_count] = atoms[XmAUTF8_STRING]; target_count++; } XtFree((char*) ctext); #endif } type = XA_ATOM; size = target_count; format = 32; } if (cs->target == atoms[XmA_MOTIF_COMPOUND_STRING]) { type = atoms[XmA_MOTIF_COMPOUND_STRING]; format = 8; size = XmCvtXmStringToByteStream(label_string, (unsigned char **) &value); } else if (cs->target == atoms[XmACOMPOUND_TEXT] || cs->target == atoms[XmATEXT] || cs->target == XA_STRING || cs->target == C_ENCODING) { type = atoms[XmACOMPOUND_TEXT]; format = 8; value = XmCvtXmStringToCT(label_string); if (value != NULL) size = strlen((char*) value); else size = 0; if (cs->target == XA_STRING) { Boolean success; value = ConvertToEncoding(w, (char*) value, XA_STRING, &size, &success); if (value != NULL && success == False) cs->flags |= XmCONVERTING_PARTIAL; type = XA_STRING; } else if ((cs->target == atoms[XmATEXT] || cs->target == C_ENCODING) && value != NULL) { char *cvt; Boolean success; cvt = (char*) ConvertToEncoding(w, (char*) value, C_ENCODING, &size, &success); if (cvt != NULL && success == False) cs->flags |= XmCONVERTING_PARTIAL; if (cvt != NULL && success) { /* 100% ok */ XtFree((char*) value); value = cvt; type = C_ENCODING; } else { /* If the request was C_ENCODING, then return only C_ENCODING, * not atoms[XmACOMPOUND_TEXT] */ if (cs->target == C_ENCODING) { XtFree((char*) value); value = cvt; type = C_ENCODING; } else if (cvt != NULL) XtFree(cvt); type = atoms[XmACOMPOUND_TEXT]; } } #ifdef UTF8_SUPPORTED } else if (cs->target == atoms[XmAUTF8_STRING]) { type = atoms[XmAUTF8_STRING]; format = 8; value = XmCvtXmStringToUTF8String(label_string); if (value != NULL) size = strlen((char*) value); else size = 0; #endif } if (cs->target == XA_PIXMAP) { /* Get widget's pixmap */ Pixmap *pix; pix = (Pixmap *) XtMalloc(sizeof(Pixmap)); *pix = label_pixmap; /* value, type, size, and format must be set */ value = (XtPointer) pix; type = XA_DRAWABLE; size = 1; format = 32; } if (cs->target == atoms[XmABACKGROUND]) { /* Get widget's background */ Pixel *background; background = (Pixel *) XtMalloc(sizeof(Pixel)); if (XtIsWidget(w)) *background = ((XmLabelWidget) w)->core.background_pixel; else *background = LabG_Background(w); /* value, type, size, and format must be set */ value = (XtPointer) background; type = atoms[XmAPIXEL]; size = 1; format = 32; } if (cs->target == atoms[XmAFOREGROUND]) { /* Get widget's foreground */ Pixel *foreground; foreground = (Pixel *) XtMalloc(sizeof(Pixel)); if (XtIsWidget(w)) *foreground = ((XmLabelWidget) w)->primitive.foreground; else *foreground = LabG_Foreground(w); /* value, type, size, and format must be set */ value = (XtPointer) foreground; type = atoms[XmAPIXEL]; size = 1; format = 32; } if (cs->target == XA_COLORMAP) { /* Get widget's colormap */ Colormap *colormap; colormap = (Colormap *) XtMalloc(sizeof(Colormap)); if (XtIsWidget(w)) *colormap = w->core.colormap; else *colormap = XtParent(w)->core.colormap; /* value, type, size, and format must be set */ value = (XtPointer) colormap; type = XA_COLORMAP; size = 1; format = 32; } _XmConvertComplete(w, value, size, format, type, cs); } /************************************************************************** * ConvertToEncoding * * This contains conversion code which is needed more than once in * _XmLabelConvert. The first calls are to check for 100% conversion * in _MOTIF_EXPORT_TARGETS and _MOTIF_CLIPBOARD_TARGETS. * The second are for the real conversion **************************************************************************/ static XtPointer ConvertToEncoding(Widget w, char* str, Atom encoding, unsigned long *length, Boolean *flag) { XtPointer rval = NULL; XTextProperty tmp_prop; Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), XmSCOMPOUND_TEXT, False); #ifdef UTF8_SUPPORTED Atom UTF8_STRING = XInternAtom(XtDisplay(w), XmSUTF8_STRING, False); #endif int ret_status; if (encoding == XA_STRING) { /* convert value to 8859.1 */ ret_status = XmbTextListToTextProperty(XtDisplay(w), (char**) &str, 1, (XICCEncodingStyle)XStringStyle, &tmp_prop); if (ret_status == Success || ret_status > 0) { rval = (XtPointer) tmp_prop.value; *length = tmp_prop.nitems; } else { rval = NULL; *length = 0; } *flag = (ret_status == Success); #ifdef UTF8_SUPPORTED } else if (encoding == UTF8_STRING) { /* convert value to UTF8 */ ret_status = Xutf8TextListToTextProperty(XtDisplay(w), (char**) &str, 1, (XICCEncodingStyle)XUTF8StringStyle, &tmp_prop); if (ret_status == Success || ret_status > 0) { rval = (XtPointer) tmp_prop.value; *length = tmp_prop.nitems; } else { rval = NULL; *length = 0; } *flag = (ret_status >= Success); #endif } else { /* Locale encoding */ /* Fix for Bug 1117 - if str is null then a SEGVIOLATION occures * in strlen. */ #ifdef FIX_1442 *length = str ? strlen(str) : 0; #else *length = str ? strlen(rval) : 0; #endif rval = _XmTextToLocaleText(w, (XtPointer) str, COMPOUND_TEXT, 8, *length, flag); } return(rval); } /************************************************************************** * FromPaddingPixels * * Converts from pixels to current unit type does either horiz or vert * depending on icon placement. * widget - the icon button widget. * offset, value - passed to correct function based on orientation. **************************************************************************/ static void FromPaddingPixels(Widget widget, int offset, XtArgVal *value) { XmLabelWidget iw = (XmLabelWidget) widget; switch(iw->label.pixmap_placement) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: XmeFromVerticalPixels(widget, offset, value); break; default: /* everything else is horiz. */ XmeFromHorizontalPixels(widget, offset, value); break; } } /************************************************************************** * ToPaddingPixels * * Converts from pixels to current unit type does either horiz or vert * depending on icon placement. * widget - the icon button widget. * offset, value - passed to correct function based on orientation. * Returns the import order from _XmTo{Horizontal, Vertical}Pixels. **************************************************************************/ static XmImportOperator ToPaddingPixels(Widget widget, int offset, XtArgVal *value) { XmLabelWidget iw = (XmLabelWidget) widget; switch(iw->label.pixmap_placement) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: return(XmeToVerticalPixels(widget, offset, value)); default: return(XmeToHorizontalPixels(widget, offset, value)); } } /* * XmRCallProc routine for checking label.font before setting it to NULL * If "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmLabelWidget lw = (XmLabelWidget)wid; /* Check if been here before */ if (lw->label.check_set_render_table) value->addr = NULL; else { lw->label.check_set_render_table = True; value->addr = (char*)&(lw->label.font); } } static XtPointer LabelGetValue(Widget w, int type) { XmString value; XtVaGetValues(w, XmNlabelString, &value, NULL); if (type == XmFORMAT_XmSTRING) { return (XtPointer) value; } else if (type == XmFORMAT_MBYTE || type == XmFORMAT_WCS) { XtPointer temp; temp = (type == XmFORMAT_MBYTE) ? _XmStringUngenerate(value, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT) : _XmStringUngenerate(value, NULL, XmWIDECHAR_TEXT, XmWIDECHAR_TEXT); XmStringFree(value); return temp; } else return NULL; } static void LabelSetValue(Widget w, XtPointer value, int type) { Arg args[1]; Cardinal nargs; XmString temp; Boolean freetemp = True; if (type == XmFORMAT_XmSTRING) { temp = (XmString) value; freetemp = False; } else { if (type == XmFORMAT_WCS) { int length; char *str; wchar_t *str2; str2 = (wchar_t *) value; /* Get length of wchar string */ length = 0; while (str2[length] != 0) length++; str = (char*) XtMalloc(MB_CUR_MAX * length); wcstombs(str, str2, length * MB_CUR_MAX); XtFree((char*) value); value = str; } temp = XmStringCreateLocalized((char*) value); } nargs = 0; XtSetArg(args[nargs], XmNlabelString, temp), nargs++; assert(nargs <= XtNumber(args)); XtSetValues(w, args, nargs); if (freetemp) XmStringFree(temp); } /*ARGSUSED*/ static int LabelPreferredValue(Widget w) /* unused */ { return XmFORMAT_XmSTRING; } static char* GetLabelAccelerator(Widget w) { if (XtClass(w) == xmLabelWidgetClass) return NULL; else return Lab_Accelerator(w); } static KeySym GetLabelMnemonic(Widget w) { if (XtClass(w) == xmLabelWidgetClass) return XK_VoidSymbol; else return Lab_Mnemonic(w); } motif-2.3.8/lib/Xm/RCHookI.h0000644000175000017500000000267012672140200012323 00000000000000/* $XConsortium: RCHookI.h /main/5 1995/07/15 20:54:31 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmRCHookI_h #define _XmRCHookI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ void _XmRCColorHook( Widget w, ArgList alIn, Cardinal *acPtrIn) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRCHookI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextP.h0000644000175000017500000002160413145162623012140 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextP_h #define _XmTextP_h #include #include #include #include typedef struct _InputRec *Input; typedef struct _OutputRec *Output; #ifdef __cplusplus extern "C" { #endif #define NODELTA LONG_MAX #define TEXTWIDGETCLASS "Text" /* Resource class for the text widget. */ #define GetSrc(widget) (((XmTextWidget) (widget))->text.source) typedef struct { XtPointer extension; /* Pointer to extension record */ } XmTextClassPart; typedef struct _XmTextClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmTextClassPart text_class; } XmTextClassRec; externalref XmTextClassRec xmTextClassRec; typedef struct { XmTextPosition start; /* First position in this line. */ Boolean changed; /* TRUE if something in this line changed. */ XmTextPosition changed_position; /* First position within the line that has changed, if any. */ Boolean past_end; /* TRUE if this line is past the end of any */ /* line actually on the screen. */ LineTableExtra extra; /* Extra info the output module keeps. */ } LineRec, *Line; typedef struct _XmTextLineTableRec{ unsigned int start_pos:31; unsigned int virt_line:1; } XmTextLineTableRec, *XmTextLineTable; typedef struct { XmTextPosition from, to; /* Information on one range to repaint. */ } RangeRec; typedef struct { Cardinal number; /* Number of ranges defined. */ Cardinal maximum; /* Number of ranges we have space for. */ RangeRec *range; /* Pointer to array of ranges. */ } Ranges; /* * The data for on-the-spot support. */ typedef struct _OnTheSpotDataTW { XmTextPosition start; XmTextPosition end; XmTextPosition cursor; XmTextPosition over_len; XmTextPosition over_maxlen; char *over_str; int under_preedit; Boolean under_verify_preedit; Boolean verify_commit; int pad; } OnTheSpotDataRecTW, *OnTheSpotDataTW; #define PreStartTW(tw) ((tw)->text.onthespot->start) #define PreEndTW(tw) ((tw)->text.onthespot->end) #define PreCursorTW(tw) ((tw)->text.onthespot->cursor) #define PreOverLen(tw) ((tw)->text.onthespot->over_len) #define PreOverMaxLen(tw) ((tw)->text.onthespot->over_maxlen) #define PreOverStr(tw) ((tw)->text.onthespot->over_str) #define PreUnder(tw) ((tw)->text.onthespot->under_preedit) #define UnderVerifyPreedit(tw) ((tw)->text.onthespot->under_verify_preedit) #define VerifyCommitNeeded(tw) ((tw)->text.onthespot->verify_commit) /* * Structure for main text info. */ typedef struct _XmTextPart { XmTextSource source; /* The source for this widget. */ XtCallbackList activate_callback; /* command activate callback. */ XtCallbackList focus_callback; /* Focus callback. */ XtCallbackList losing_focus_callback; /* Losing focus callback. */ XtCallbackList value_changed_callback; /* Value changed callback. */ XtCallbackList modify_verify_callback; /* Verify value to change callback.*/ XtCallbackList wcs_modify_verify_callback; /* Verify value to change * callback.*/ XtCallbackList motion_verify_callback; /* Insert cursor position change callback. */ XtCallbackList gain_primary_callback; /* Gained ownership of Primary Selection */ XtCallbackList lose_primary_callback; /* Lost ownership of Primary Selection */ char *value; /* The sring value in the widget */ wchar_t *wc_value; /* Pointer for wchar_t value set by app */ Dimension margin_height; /* height between text borders and text */ Dimension margin_width; /* width between text borders and text */ Position cursor_position_x; /* x pixel location of cursor */ OutputCreateProc output_create; /* Routine to create the output portion. */ InputCreateProc input_create; /* Routine to create the input portion. */ /* The naming incongruity amongst the next three items was introduced */ /* due to a collision with top_position as used as a Form constraint; */ /* It has no other implications. */ XmTextPosition top_character; /* First position to display. */ XmTextPosition bottom_position; /* Last position to display. */ XmTextPosition cursor_position; /* Location of the insertion point. */ int max_length; /* Sets the max. length of string */ int edit_mode; /* Sets the line editing mode (i.e. sinlge_line, multi_line, ...) */ Boolean auto_show_cursor_position; /* If true, automatically try to show the cursor position whenever it changes. */ Boolean editable; /* Determines if text is editable */ Boolean verify_bell; /* Determines if bell is sounded when verify * callback returns doit - False */ Boolean add_mode; /* Determines the state of add moder */ Boolean traversed; /* Flag used with losing focus verification to indicate a traversal key pressed event */ Boolean in_redisplay; /* Whether currently in the redisplay proc. */ Boolean needs_redisplay; /* Whether we need to repaint or refigure. */ Boolean in_refigure_lines; /* Whether currently in refigurelines proc. */ Boolean needs_refigure_lines; /* Whether we need to refigure. */ Boolean in_setvalues; /* Use to reduce unnecessary redisplays and geometry requsets */ Boolean in_resize; /* Make sure there are no geometry requests while we are in resize procedure. */ Boolean in_expose; /* Make sure there are no geometry requests while we are in expose procedure. */ Boolean highlight_changed; /* Whether highlighting recently changed. */ Boolean pendingoff; /* TRUE if we shouldn't do pending delete on the current selection. */ char char_size; /* number of bytes for storing a character */ OnOrOff on_or_off; /* used to halt unecessary motion verify callback calls during primary moves.*/ Output output; /* The output portion. */ Input input; /* The input portion. */ XmTextPosition first_position; /* First legal position in the source. */ XmTextPosition last_position; /* Last legal position in the source. */ XmTextPosition forget_past; /* Forget all about positions past this. */ XmTextPosition force_display; /* Force this position to be displayed. */ XmTextPosition new_top; /* Desired new top position. */ XmTextPosition last_top_char; /* unused - available. */ XmTextPosition dest_position; /* Location of the destination point. */ int disable_depth; /* How many levels of disable we've done. */ int pending_scroll; /* Number of lines we want to scroll. */ int total_lines; /* Total number of lines in the text widget */ int top_line; /* Line number of the top visible line */ int vsbar_scrolling; /* scrolling using the vertical scrollbar */ Cardinal number_lines; /* Number of line table entries. */ Cardinal maximum_lines; /* Maximum number of line table entries. */ Line line; /* Pointer to array of line table entries. */ Ranges repaint; /* Info on the repaint ranges. */ _XmHighlightData highlight; /* Info on the highlighting regions. */ _XmHighlightData old_highlight;/* Old value of above. */ Widget inner_widget; /* Pointer to widget which actually contains text (may be same or different from this record). */ XmTextLineTable line_table; unsigned int table_size; unsigned int table_index; XtCallbackList destination_callback; /* Selection destination cb */ int hsbar_scrolling;/* scroring using the horizontal scrollbar */ OnTheSpotDataTW onthespot; /* On the spot preedit style support. */ XtTranslations tm_table; } XmTextPart; typedef struct _XmTextRec { CorePart core; XmPrimitivePart primitive; XmTextPart text; } XmTextRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextP_h */ /* DON't ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragOverS.h0000644000175000017500000000310413145162623012723 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragOverS_h #define _XmDragOverS_h #include #include #include #ifdef __cplusplus extern "C" { #endif /*********************************************************************** * * DragOverShell Widget * ***********************************************************************/ /* Class record constants */ typedef struct _XmDragOverShellRec *XmDragOverShellWidget; typedef struct _XmDragOverShellClassRec *XmDragOverShellWidgetClass; externalref WidgetClass xmDragOverShellWidgetClass; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragOverS_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconBoxP.h0000644000175000017500000001163412672140200012546 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmIconBoxP_h #define _XmIconBoxP_h #if defined(VMS) || defined(__VMS) #include #endif /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #ifdef __cplusplus extern "C" { #endif /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ /* * Hack to get around naming conventions. The XmConstraintPartOffset macro * requires our contraint part structure to have this name */ #define XmIconBoxConstraintPart IconInfo /* * Access macros for widget instance fields */ #define XmIconBox_min_v_cells(w) (((XmIconBoxWidget)(w))->box.min_v_cells) #define XmIconBox_min_h_cells(w) (((XmIconBoxWidget)(w))->box.min_h_cells) #define XmIconBox_v_margin(w) (((XmIconBoxWidget)(w))->box.v_margin) #define XmIconBox_h_margin(w) (((XmIconBoxWidget)(w))->box.h_margin) #define XmIconBox_min_cell_width(w) (((XmIconBoxWidget)(w))->box.min_cell_width) #define XmIconBox_min_cell_height(w) (((XmIconBoxWidget)(w))->box.min_cell_height) #define XmIconBox_cell_width(w) (((XmIconBoxWidget)(w))->box.cell_width) #define XmIconBox_cell_height(w) (((XmIconBoxWidget)(w))->box.cell_height) #define XmIconBoxC_cell_x(w) (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.cell_x) #define XmIconBoxC_cell_y(w) (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.cell_y) #define XmIconBoxC_pref_width(w) (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.pref_width) #define XmIconBoxC_pref_height(w) (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.pref_height) /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ typedef struct { XtPointer extension; /* Just in case we need it later. */ } XmIconBoxClassPart; typedef struct _XmIconBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmIconBoxClassPart box_class; } XmIconBoxClassRec; typedef struct { /* resources */ Dimension min_v_cells; /* Default number of cells in the vert dir. */ Dimension min_h_cells; /* Default number of cells in the horiz dir. */ Dimension v_margin; /* Amount of space to leave between cells */ Dimension h_margin; /* and window edges. */ Dimension min_cell_width; /* Minimum width of the cells. */ Dimension min_cell_height; /* Minimum height of the cells. */ /* private state */ Dimension cell_width; /* Width and height of all cells. */ Dimension cell_height; } XmIconBoxPart; typedef struct _XmIconBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmIconBoxPart box; } XmIconBoxRec; typedef struct _IconInfo { /* * Resources. */ short cell_x; /* X location of this icon in cell space. */ short cell_y; /* Y location of this icon in cell space. */ /* * Private state. */ Dimension pref_width, pref_height; /* The preferred size of this widget. */ } IconInfo; typedef struct _XmIconBoxConstraintsRec { XmManagerConstraintPart manager; IconInfo icon; } XmIconBoxConstraintsRec, *XmIconBoxConstraints; /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ extern XmIconBoxClassRec xmIconBoxClassRec; /************************************************************ * STATIC DECLARATIONS *************************************************************/ #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmIconBoxP_h */ motif-2.3.8/lib/Xm/DragC.c0000644000175000017500000027275413145162623012065 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DragC.c /main/29 1997/10/07 12:19:52 cshi $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #ifndef DEFAULT_WM_TIMEOUT #define DEFAULT_WM_TIMEOUT 5000 #endif #include #include #include #include #include #include #include #include #include #include #include "XmI.h" #include "DisplayI.h" #include "DragBSI.h" #include "DragCI.h" #include "DragICCI.h" #include "DragOverSI.h" #include "MessagesI.h" #include "TraversalI.h" #include "VendorSI.h" #include #ifndef X_NOT_STDC_ENV #include #endif /* force the multi screen support on */ #define MULTI_SCREEN_DONE #ifdef DEBUG #define Warning(str) XmeWarning(NULL, str) #else #define Warning(str) /*EMPTY*/ #endif #define BIGSIZE ((Dimension)32767) #define MESSAGE1 _XmMMsgDragC_0001 #define MESSAGE2 _XmMMsgDragC_0002 #define MESSAGE3 _XmMMsgDragC_0003 #define MESSAGE4 _XmMMsgDragC_0004 #define MESSAGE5 _XmMMsgDragC_0005 #define MESSAGE6 _XmMMsgDragC_0006 typedef struct _MotionEntryRec{ int type; Time time; Window window; Window subwindow; Position x, y; unsigned int state; } MotionEntryRec, *MotionEntry; #define STACKMOTIONBUFFERSIZE 120 typedef struct _MotionBufferRec{ XmDragReceiverInfo currReceiverInfo; Cardinal count; MotionEntryRec entries[STACKMOTIONBUFFERSIZE]; } MotionBufferRec, *MotionBuffer; #define MOTIONFILTER 16 /******** Static Function Declarations ********/ static void GetRefForeground( Widget widget, int offset, XrmValue *value) ; static void CopyRefForeground( Widget widget, int offset, XrmValue *value) ; static void GetRefBackground( Widget widget, int offset, XrmValue *value) ; static void DragContextInitialize( Widget req, Widget new_w, ArgList args, Cardinal *numArgs) ; static Boolean DragContextSetValues( Widget old, Widget ref, Widget new_w, Arg *args, Cardinal *numArgs) ; static void DragContextDestroy( Widget w) ; static void DragContextClassInitialize( void ) ; static void DragContextClassPartInitialize( WidgetClass ) ; static Window GetClientWindow( Display *dpy, Window win, Atom atom) ; static void ValidateDragOver( XmDragContext dc, unsigned char oldStyle, unsigned char newStyle) ; static XmDragReceiverInfo FindReceiverInfo( XmDragContext dc, Window win) ; static void GetDestinationInfo( XmDragContext dc, Window root, Window win) ; static void GetScreenInfo( XmDragContext dc) ; static void SendDragMessage( XmDragContext dc, Window destination, unsigned char messageType) ; static void GenerateClientCallback( XmDragContext dc, unsigned char reason) ; static void DropLoseIncrSelection( Widget w, Atom *selection, XtPointer clientData) ; static void DropLoseSelection( Widget w, Atom *selection) ; static void DragDropFinish( XmDragContext dc) ; static Boolean DropConvertIncrCallback( Widget w, Atom *selection, Atom *target, Atom *typeRtn, XtPointer *valueRtn, unsigned long *lengthRtn, int *formatRtn, unsigned long *maxLengthRtn, XtPointer clientData, XtRequestId *requestID) ; static Boolean DropConvertCallback( Widget w, Atom *selection, Atom *target, Atom *typeRtn, XtPointer *valueRtn, unsigned long *lengthRtn, int *formatRtn) ; static void DragStartProto( XmDragContext dc) ; static void NewScreen( XmDragContext dc, Window newRoot) ; static void LocalNotifyHandler( Widget w, XtPointer client, XtPointer call) ; static void ExternalNotifyHandler( Widget w, XtPointer client, XtPointer call) ; static void InitiatorMsgHandler( Widget w, XtPointer clientData, XEvent *event, Boolean *dontSwallow) ; static void SiteEnteredWithLocalSource( Widget w, XtPointer client, XtPointer call) ; static void SiteLeftWithLocalSource( Widget w, XtPointer client, XtPointer call) ; static void OperationChanged( Widget w, XtPointer client, XtPointer call) ; static void SiteMotionWithLocalSource( Widget w, XtPointer client, XtPointer call) ; static void DropStartConfirmed( Widget w, XtPointer client, XtPointer call) ; static Widget GetShell( Widget w) ; static void InitDropSiteManager( XmDragContext dc) ; static void TopWindowsReceived( Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format) ; static void DragStart( XmDragContext dc, Widget src, XEvent *event) ; static void DragStartWithTracking( XmDragContext dc) ; static void UpdateMotionBuffer( XmDragContext dc, MotionBuffer mb, XEvent *event) ; static void DragMotionProto( XmDragContext dc, Window root, Window subWindow) ; static void ProcessMotionBuffer( XmDragContext dc, MotionBuffer mb) ; static void DragMotion( Widget w, XEvent *event, String *params, Cardinal *numParams) ; static void DragKey( Widget w, XEvent *event, String *params, Cardinal *numParams) ; static void DropStartTimeout( XtPointer clientData, XtIntervalId *id) ; static void DropFinishTimeout( XtPointer clientData, XtIntervalId *id) ; static void FinishAction( XmDragContext dc, XEvent *ev) ; static void CheckModifiers( XmDragContext dc, unsigned int state) ; static void IgnoreButtons( Widget w, XEvent *event, String *params, Cardinal *numParams) ; static void CancelDrag( Widget w, XEvent *event, String *params, Cardinal *numParams) ; static void HelpDrag( Widget w, XEvent *event, String *params, Cardinal *numParams) ; static void FinishDrag( Widget w, XEvent *event, String *params, Cardinal *numParams) ; static void InitiatorMainLoop( XtPointer clientData, XtIntervalId *id) ; static void DragCancel( XmDragContext dc) ; static void CalculateDragOperation( XmDragContext dc) ; static void cancelDrag( Widget w, XtPointer client, XtPointer call) ; static void noMoreShell ( Widget w, XtPointer client, XtPointer call) ; /******** End Static Function Declarations ********/ static XtActionsRec dragContextActions[] = { {"FinishDrag" , FinishDrag }, {"CancelDrag" , CancelDrag }, {"HelpDrag" , HelpDrag }, {"DragMotion" , DragMotion }, {"DragKey" , DragKey }, {"IgnoreButtons" , IgnoreButtons }, }; static XmConst unsigned char protocolMatrix[7][6] = { /* * * Rows are initiator styles, Columns are receiver styles. * * Receiver NO DO PP P PD D * Initiator ------------------------------- * NO | NO | NO | NO | NO | NO | NO | * DO | NO | DO | DO | DO | DO | DO | * PP | NO | DO | P | P | P | D | * P | NO | DO | P | P | P | DO | * PD | NO | DO | D | P | D | D | * D | NO | DO | D | DO | D | D | * PR | NO | DO | P | P | D | D | */ { /* Initiator == XmDRAG_NONE == 0 */ XmDRAG_NONE, XmDRAG_NONE, XmDRAG_NONE, XmDRAG_NONE, XmDRAG_NONE, XmDRAG_NONE, }, { /* Initiator == DROP_ONLY == 1 */ XmDRAG_NONE, XmDRAG_DROP_ONLY, XmDRAG_DROP_ONLY, XmDRAG_DROP_ONLY, XmDRAG_DROP_ONLY, XmDRAG_DROP_ONLY, }, { /* Initiator == PREFER_PREREG == 2 */ XmDRAG_NONE, XmDRAG_DROP_ONLY, XmDRAG_PREREGISTER, XmDRAG_PREREGISTER, XmDRAG_PREREGISTER, XmDRAG_DYNAMIC, }, { /* Initiator == PREREG == 3 */ XmDRAG_NONE, XmDRAG_DROP_ONLY, XmDRAG_PREREGISTER, XmDRAG_PREREGISTER, XmDRAG_PREREGISTER, XmDRAG_DROP_ONLY, }, { /* Initiator == PREFER_DYNAMIC == 4 */ XmDRAG_NONE, XmDRAG_DROP_ONLY, XmDRAG_DYNAMIC, XmDRAG_PREREGISTER, XmDRAG_DYNAMIC, XmDRAG_DYNAMIC, }, { /* Initiator == XmDRAG_DYNAMIC == 5 */ XmDRAG_NONE, XmDRAG_DROP_ONLY, XmDRAG_DYNAMIC, XmDRAG_DROP_ONLY, XmDRAG_DYNAMIC, XmDRAG_DYNAMIC, }, { /* Initiator == DRAG_RECEIVER == 6 */ XmDRAG_NONE, XmDRAG_DROP_ONLY, XmDRAG_PREREGISTER, XmDRAG_PREREGISTER, XmDRAG_DYNAMIC, XmDRAG_DYNAMIC, }, }; /*************************************************************************** * * Default values for resource lists * ***************************************************************************/ #define Offset(x) (XtOffsetOf(XmDragContextRec, x)) static XtResource dragContextResources[] = { { XmNsourceWidget, XmCSourceWidget, XmRWidget, sizeof(Widget), Offset(drag.sourceWidget), XmRImmediate, (XtPointer)NULL, }, { XmNexportTargets, XmCExportTargets, XmRAtomList, sizeof(Atom *), Offset(drag.exportTargets), XmRImmediate, (XtPointer)NULL, }, { XmNnumExportTargets, XmCNumExportTargets, XmRInt, sizeof(Cardinal), Offset(drag.numExportTargets), XmRImmediate, (XtPointer)0, }, { XmNconvertProc, XmCConvertProc, XmRFunction, sizeof(XmConvertSelectionRec), Offset(drag.convertProc), XmRImmediate, (XtPointer)NULL, }, { XmNclientData, XmCClientData, XmRPointer, sizeof(XtPointer), Offset(drag.clientData), XmRImmediate, (XtPointer)NULL, }, { XmNincremental, XmCIncremental, XmRBoolean, sizeof(Boolean), Offset(drag.incremental), XmRImmediate, (XtPointer)NULL, }, { XmNdragOperations, XmCDragOperations, XmRUnsignedChar, sizeof(unsigned char), Offset(drag.dragOperations), XmRImmediate, (XtPointer)(XmDROP_COPY | XmDROP_MOVE), }, { XmNsourceCursorIcon, XmCSourceCursorIcon, XmRWidget, sizeof(Widget), Offset(drag.sourceCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNsourcePixmapIcon, XmCSourcePixmapIcon, XmRWidget, sizeof(Widget), Offset(drag.sourcePixmapIcon), XmRImmediate, (XtPointer)NULL, }, { XmNstateCursorIcon, XmCStateCursorIcon, XmRWidget, sizeof(Widget), Offset(drag.stateCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNoperationCursorIcon, XmCOperationCursorIcon, XmRWidget, sizeof(Widget), Offset(drag.operationCursorIcon), XmRImmediate, (XtPointer)NULL, }, { XmNcursorBackground, XmCCursorBackground, XmRPixel, sizeof(Pixel), Offset(drag.cursorBackground), XmRCallProc, (XtPointer)GetRefBackground, }, { XmNcursorForeground, XmCCursorForeground, XmRPixel, sizeof(Pixel), Offset(drag.cursorForeground), XmRCallProc, (XtPointer)GetRefForeground, }, { XmNvalidCursorForeground, XmCValidCursorForeground, XmRPixel, sizeof(Pixel), Offset(drag.validCursorForeground), XmRCallProc, (XtPointer)CopyRefForeground, }, { XmNinvalidCursorForeground, XmCInvalidCursorForeground, XmRPixel, sizeof(Pixel), Offset(drag.invalidCursorForeground), XmRCallProc, (XtPointer)CopyRefForeground, }, { XmNnoneCursorForeground, XmCNoneCursorForeground, XmRPixel, sizeof(Pixel), Offset(drag.noneCursorForeground), XmRCallProc, (XtPointer)CopyRefForeground, }, { XmNdropSiteEnterCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.siteEnterCallback), XmRImmediate, (XtPointer)NULL, }, { XmNdropSiteLeaveCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.siteLeaveCallback), XmRImmediate, (XtPointer)NULL, }, { XmNtopLevelEnterCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.topLevelEnterCallback), XmRImmediate, (XtPointer)NULL, }, { XmNdragMotionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.dragMotionCallback), XmRImmediate, (XtPointer)NULL, }, { XmNtopLevelLeaveCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.topLevelLeaveCallback), XmRImmediate, (XtPointer)NULL, }, { XmNdropStartCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.dropStartCallback), XmRImmediate, (XtPointer)NULL, }, { XmNdragDropFinishCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.dragDropFinishCallback), XmRImmediate, (XtPointer)NULL, }, { XmNdropFinishCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.dropFinishCallback), XmRImmediate, (XtPointer)NULL, }, { XmNoperationChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(drag.operationChangedCallback), XmRImmediate, (XtPointer)NULL, }, { XmNblendModel, XmCBlendModel, XmRBlendModel, sizeof(unsigned char), Offset(drag.blendModel), XmRImmediate, (XtPointer)XmBLEND_ALL, }, { XmNsourceIsExternal, XmCSourceIsExternal, XmRBoolean, sizeof(Boolean), Offset(drag.sourceIsExternal), XmRImmediate, (XtPointer)False, }, { XmNsourceWindow, XmCSourceWindow, XmRWindow, sizeof(Window), Offset(drag.srcWindow), XmRImmediate, (XtPointer)None, }, { XmNstartTime, XmCStartTime, XmRInt, sizeof(Time), Offset(drag.dragStartTime), XmRImmediate, (XtPointer)0, }, { XmNiccHandle, XmCICCHandle, XmRAtom, sizeof(Atom), Offset(drag.iccHandle), XmRImmediate, (XtPointer)None, }, }; externaldef(xmdragcontextclassrec) XmDragContextClassRec xmDragContextClassRec = { { (WidgetClass) &coreClassRec, /* superclass */ "XmDragContext", /* class_name */ sizeof(XmDragContextRec), /* size */ DragContextClassInitialize, /* Class Initializer */ DragContextClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ DragContextInitialize, /* initialize */ NULL, /* initialize_notify */ XtInheritRealize, /* realize */ dragContextActions, /* actions */ XtNumber(dragContextActions), /* num_actions */ dragContextResources, /* resources */ XtNumber(dragContextResources),/* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ XtExposeNoCompress, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ DragContextDestroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ DragContextSetValues, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ _XmDragC_defaultTranslations, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, { /* dragContext */ DragStart, /* start */ DragCancel, /* cancel */ NULL, /* extension record */ }, }; externaldef(dragContextclass) WidgetClass xmDragContextClass = (WidgetClass) &xmDragContextClassRec; /*ARGSUSED*/ static void GetRefForeground( Widget widget, int offset, XrmValue *value ) { static Pixel pixel; XmDragContext dc = (XmDragContext)widget; Widget sw = dc->drag.sourceWidget; pixel = BlackPixelOfScreen(XtScreen(widget)); value->addr = (XPointer)(&pixel); value->size = sizeof(Pixel); if (sw) { if (XmIsGadget(sw)) pixel = ((XmManagerWidget)(XtParent(sw)))->manager.foreground; else if (XmIsPrimitive(sw)) pixel = ((XmPrimitiveWidget)sw)->primitive.foreground; else if (XmIsManager(sw)) pixel = ((XmManagerWidget)sw)->manager.foreground; } } /* GetRefForeground */ /*ARGSUSED*/ static void CopyRefForeground( Widget widget, int offset, XrmValue *value ) { XmDragContext dc = (XmDragContext)widget; value->addr = (XPointer)(&dc->drag.cursorForeground); value->size = sizeof(Pixel); } /* CopyRefForeground */ /*ARGSUSED*/ static void GetRefBackground( Widget widget, int offset, XrmValue *value ) { static Pixel pixel; XmDragContext dc = (XmDragContext)widget; Widget sw = dc->drag.sourceWidget; pixel = WhitePixelOfScreen(XtScreen(dc)); value->addr = (XPointer)(&pixel); value->size = sizeof(Pixel); if (sw) { if (XmIsGadget(sw)) pixel = ((XmManagerWidget)(XtParent(sw)))->core.background_pixel; else pixel = sw->core.background_pixel; } } /* GetRefBackground */ /*ARGSUSED*/ static void DragContextInitialize( Widget req, Widget new_w, ArgList args, Cardinal *numArgs ) { XmDragContext dc = (XmDragContext)new_w; dc->drag.roundOffTime = 50; dc->drag.dragFinishTime = dc->drag.dropFinishTime = 0; dc->drag.inDropSite = False; dc->drag.dragTimerId = (XtIntervalId) NULL; dc->drag.activeBlendModel = dc->drag.blendModel; dc->drag.trackingMode = XmDRAG_TRACK_MOTION ; dc->drag.curDragOver = dc->drag.origDragOver = NULL; dc->drag.startX = dc->drag.startY = 0; dc->drag.SaveEventMask = 0L; InitDropSiteManager(dc); if (dc->drag.exportTargets) { unsigned int size; size = sizeof(Atom) * dc->drag.numExportTargets; dc->drag.exportTargets = (Atom *) _XmAllocAndCopy(dc->drag.exportTargets, size); } dc->core.x = dc->core.y = 0; dc->core.width = dc->core.height = 16; /* pixel values in drag context refer to the source widget's colormap */ if (dc->drag.sourceWidget) { Widget sw = dc->drag.sourceWidget; dc->core.colormap = XmIsGadget(sw) ? XtParent(sw)->core.colormap : sw->core.colormap; } XtRealizeWidget((Widget)dc); dc->drag.currReceiverInfo = dc->drag.receiverInfos = NULL; dc->drag.numReceiverInfos = dc->drag.maxReceiverInfos = 0; dc->drag.dragDropCancelEffect = False; } /*ARGSUSED*/ static Boolean DragContextSetValues( Widget old, Widget ref, Widget new_w, Arg *args, Cardinal *numArgs ) { XmDragContext oldDC = (XmDragContext)old; XmDragContext newDC = (XmDragContext)new_w; XmDragOverShellWidget dos = newDC->drag.curDragOver; if (oldDC->drag.exportTargets != newDC->drag.exportTargets) { if (oldDC->drag.exportTargets) /* should have been freed */ XtFree( (char *)oldDC->drag.exportTargets); if (newDC->drag.exportTargets) { unsigned int size; size = sizeof(Atom) * newDC->drag.numExportTargets; newDC->drag.exportTargets = (Atom *) _XmAllocAndCopy(newDC->drag.exportTargets, size); } } if ( oldDC->drag.operationCursorIcon != newDC->drag.operationCursorIcon || oldDC->drag.sourceCursorIcon != newDC->drag.sourceCursorIcon || oldDC->drag.sourcePixmapIcon != newDC->drag.sourcePixmapIcon || oldDC->drag.stateCursorIcon != newDC->drag.stateCursorIcon || oldDC->drag.cursorBackground != newDC->drag.cursorBackground || oldDC->drag.cursorForeground != newDC->drag.cursorForeground || oldDC->drag.noneCursorForeground != newDC->drag.noneCursorForeground || oldDC->drag.invalidCursorForeground != newDC->drag.invalidCursorForeground || oldDC->drag.validCursorForeground != newDC->drag.validCursorForeground) { _XmDragOverChange((Widget)dos, dos->drag.cursorState); } return False; } static void DragContextDestroy( Widget w ) { XmDragContext dc = (XmDragContext)w; Cardinal i; /* Fix CR 5556: Restore root event mask saved at DragStart time */ if (0 != dc->drag.SaveEventMask) XSelectInput(XtDisplay(dc), dc->drag.currWmRoot, dc->drag.SaveEventMask); if (dc->drag.exportTargets) XtFree((char *)dc->drag.exportTargets); dc->drag.exportTargets = NULL; if (dc->drag.dragTimerId) { XtRemoveTimeOut(dc->drag.dragTimerId); dc->drag.dragTimerId = (XtIntervalId) NULL; } if (dc->drag.receiverInfos) { #ifdef MULTI_SCREEN_DONE if (dc->drag.trackingMode != XmDRAG_TRACK_MOTION) { EventMask mask; XmDragReceiverInfo info; for (i = 1; i < dc->drag.numReceiverInfos; i++) { info = &(dc->drag.receiverInfos[i]); if (info->shell) mask = XtBuildEventMask(info->shell); else mask = 0; XSelectInput(XtDisplay(w), info->window, mask); } } #endif /* MULTI_SCREEN_DONE */ XtFree((char *)dc->drag.receiverInfos); } } static void DragContextClassInitialize( void ) { /* The applications should call XtRegisterGrabAction. */ } static void DragContextClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmDRAG_CONTEXT_BIT); } static Window GetClientWindow( Display *dpy, Window win, Atom atom ) { Window root, parent; Window *children; unsigned int nchildren; int i; Atom type = None; int format; unsigned long nitems, after; unsigned char *data = NULL; Window inf = 0; XGetWindowProperty(dpy, win, atom, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &after, &data); if (data) XFree(data); if (type) return win; else { if (!XQueryTree(dpy, win, &root, &parent, &children, &nchildren) || (nchildren == 0)) return 0; for (i = nchildren - 1; i >= 0; i--) { if ((inf = GetClientWindow(dpy, children[i], atom)) != 0) { XFree(children); return inf; } } XFree(children); } return 0; } static void ValidateDragOver( XmDragContext dc, unsigned char oldStyle, unsigned char newStyle ) { Arg args[1]; XmDisplay xmDisplay = (XmDisplay)XtParent(dc); unsigned char initiator = XmDRAG_NONE; initiator = xmDisplay->display.dragInitiatorProtocolStyle; if (newStyle != oldStyle) { /* * If we're not still waiting to hear from the window manager, * and we're not running dynamic, then we can grab. */ if ((dc->drag.trackingMode != XmDRAG_TRACK_WM_QUERY_PENDING) && (newStyle != XmDRAG_DYNAMIC) && (initiator != XmDRAG_DYNAMIC) && (initiator != XmDRAG_PREFER_DYNAMIC)) { if (!dc->drag.serverGrabbed) { XGrabServer(XtDisplay(dc)); dc->drag.serverGrabbed = True; XtSetArg(args[0], XmNdragOverMode, XmPIXMAP); XtSetValues( (Widget)dc->drag.curDragOver, args, 1); } } else { if (dc->drag.serverGrabbed) { XUngrabServer(XtDisplay(dc)); dc->drag.serverGrabbed = False; if (xmDisplay -> display.displayHasShapeExtension) XtSetArg(args[0], XmNdragOverMode, XmDRAG_WINDOW); else XtSetArg(args[0], XmNdragOverMode, XmCURSOR); XtSetValues( (Widget)dc->drag.curDragOver, args, 1); } } } } static XmDragReceiverInfo FindReceiverInfo( XmDragContext dc, Window win ) { Cardinal i; XmDragReceiverInfo info = NULL; for (i = 0; i < dc->drag.numReceiverInfos; i++) { info = &dc->drag.receiverInfos[i]; if ((info->frame == win) || (info->window == win)) break; } if (i < dc->drag.numReceiverInfos) return info; else return NULL; } XmDragReceiverInfo _XmAllocReceiverInfo( XmDragContext dc ) { Cardinal offset = 0; if (dc->drag.currReceiverInfo) { offset = (Cardinal) (dc->drag.currReceiverInfo - dc->drag.receiverInfos); } if (dc->drag.numReceiverInfos == dc->drag.maxReceiverInfos) { dc->drag.maxReceiverInfos = dc->drag.maxReceiverInfos*2 + 2; dc->drag.receiverInfos = (XmDragReceiverInfoStruct *) XtRealloc((char*)dc->drag.receiverInfos, dc->drag.maxReceiverInfos * sizeof(XmDragReceiverInfoStruct)); } if (offset) dc->drag.currReceiverInfo = &(dc->drag.receiverInfos[offset]); dc->drag.rootReceiverInfo = dc->drag.receiverInfos; return &(dc->drag.receiverInfos[dc->drag.numReceiverInfos++]); } /* Find a window with WM_STATE, else return win itself, as per ICCCM */ /*ARGSUSED*/ static void GetDestinationInfo( XmDragContext dc, Window root, Window win ) { Window clientWin = win; Display *dpy = XtDisplayOfObject((Widget) dc); Atom WM_STATE = XInternAtom(dpy, XmSWM_STATE, True); unsigned char oldStyle = dc->drag.activeProtocolStyle; XmDragReceiverInfo currReceiverInfo; dc->drag.crossingTime = dc->drag.lastChangeTime; currReceiverInfo = dc->drag.currReceiverInfo = FindReceiverInfo(dc, win); /* * check for bootstrap case */ if ((dc->drag.trackingMode == XmDRAG_TRACK_MOTION) && (XtWindow(dc->drag.srcShell) == win) && (!currReceiverInfo || (currReceiverInfo->frame == currReceiverInfo->window))) { Window currRoot = dc->drag.currWmRoot; int root_x, root_y; Position rel_x, rel_y; /* * set frame (win) to something reasonable */ rel_x = dc->drag.startX - dc->drag.srcShell->core.x; rel_y = dc->drag.startY - dc->drag.srcShell->core.y; if (rel_x < 0) rel_x = 0; if (rel_y < 0) rel_y = 0; (void) XTranslateCoordinates(XtDisplayOfObject((Widget) dc), win, currRoot, rel_x, rel_y, &root_x, &root_y, &win); if (currReceiverInfo) currReceiverInfo->frame = win; } if (currReceiverInfo == NULL) { if (clientWin == win) { if ((clientWin = GetClientWindow(dpy, win, WM_STATE)) == 0) clientWin = win; } currReceiverInfo = dc->drag.currReceiverInfo = _XmAllocReceiverInfo(dc); currReceiverInfo->frame = win; currReceiverInfo->window = clientWin; currReceiverInfo->shell = XtWindowToWidget(dpy, clientWin); } /* * we fetch the root info in NewScreen */ if (currReceiverInfo != dc->drag.rootReceiverInfo /* is it the root ? */) { if (!currReceiverInfo->shell) { if (_XmGetDragReceiverInfo(dpy, currReceiverInfo->window, currReceiverInfo)) { switch (currReceiverInfo->dragProtocolStyle) { case XmDRAG_PREREGISTER: case XmDRAG_PREFER_PREREGISTER: case XmDRAG_PREFER_DYNAMIC: break; case XmDRAG_DYNAMIC: case XmDRAG_DROP_ONLY: case XmDRAG_NONE: /* free the data returned by the icc layer */ _XmFreeDragReceiverInfo(currReceiverInfo->iccInfo); break; } } } else { XmDisplay xmDisplay = (XmDisplay)XtParent(dc); /* * We only have a protocol style if we have drop sites. */ if (_XmDropSiteShell(dc->drag.currReceiverInfo->shell)) currReceiverInfo->dragProtocolStyle = xmDisplay->display.dragReceiverProtocolStyle; else currReceiverInfo->dragProtocolStyle = XmDRAG_NONE; currReceiverInfo->xOrigin = dc->drag.currReceiverInfo->shell->core.x; currReceiverInfo->yOrigin = dc->drag.currReceiverInfo->shell->core.y; currReceiverInfo->width = dc->drag.currReceiverInfo->shell->core.width; currReceiverInfo->height = dc->drag.currReceiverInfo->shell->core.height; currReceiverInfo->depth = dc->drag.currReceiverInfo->shell->core.depth; currReceiverInfo->iccInfo = NULL; } } /* * If we're still waiting on the window manager, then don't mess * with the active protocol style. */ if (dc->drag.trackingMode != XmDRAG_TRACK_WM_QUERY_PENDING) { dc->drag.activeProtocolStyle = _XmGetActiveProtocolStyle((Widget)dc); ValidateDragOver(dc, oldStyle, dc->drag.activeProtocolStyle); } } static void GetScreenInfo( XmDragContext dc ) { Display *dpy = XtDisplay(dc); Window root = RootWindowOfScreen(XtScreen(dc->drag.curDragOver)); XmDragReceiverInfo rootInfo; /* * the rootInfo is the first entry in the receiverInfo * array */ if (dc->drag.numReceiverInfos == 0) { dc->drag.rootReceiverInfo = rootInfo = _XmAllocReceiverInfo(dc); } else { dc->drag.rootReceiverInfo = rootInfo = dc->drag.receiverInfos; } rootInfo->frame = None; rootInfo->window = root; rootInfo->shell = XtWindowToWidget(dpy, root); rootInfo->xOrigin = rootInfo->yOrigin = 0; rootInfo->width = XWidthOfScreen(dc->drag.currScreen); rootInfo->height = XHeightOfScreen(dc->drag.currScreen); rootInfo->depth = DefaultDepthOfScreen(dc->drag.currScreen); rootInfo->iccInfo = NULL; if (_XmGetDragReceiverInfo(dpy, root, rootInfo)) { switch (rootInfo->dragProtocolStyle) { case XmDRAG_PREREGISTER: case XmDRAG_PREFER_PREREGISTER: case XmDRAG_PREFER_DYNAMIC: break; case XmDRAG_DYNAMIC: case XmDRAG_DROP_ONLY: case XmDRAG_NONE: /* free the data returned by the icc layer */ _XmFreeDragReceiverInfo(rootInfo->iccInfo); break; } } } static void SendDragMessage( XmDragContext dc, Window destination, unsigned char messageType ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay)(XtParent(dc))); XmICCCallbackStruct callbackRec; int reason = _XmMessageTypeToReason(messageType); callbackRec.any.event = NULL; if ((dc->drag.activeProtocolStyle == XmDRAG_NONE) || ((dc->drag.activeProtocolStyle == XmDRAG_DROP_ONLY) && (reason != XmCR_DROP_START))) return; switch(callbackRec.any.reason = reason) { case XmCR_TOP_LEVEL_ENTER: { XmTopLevelEnterCallback callback = (XmTopLevelEnterCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->window = dc->drag.srcWindow; callback->dragProtocolStyle = dc->drag.activeProtocolStyle; callback->screen = dc->drag.currScreen; callback->x = dc->drag.currReceiverInfo->xOrigin; callback->y = dc->drag.currReceiverInfo->yOrigin; callback->iccHandle = dc->drag.iccHandle; } break; case XmCR_TOP_LEVEL_LEAVE: { XmTopLevelLeaveCallback callback = (XmTopLevelLeaveCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->window = dc->drag.srcWindow; } break; case XmCR_DRAG_MOTION: { XmDragMotionCallback callback = (XmDragMotionCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->x = dc->core.x; callback->y = dc->core.y; callback->operation = dc->drag.operation; callback->operations = dc->drag.operations; /* Outgoing motion; be conservative */ callback->dropSiteStatus = XmNO_DROP_SITE; } break; case XmCR_OPERATION_CHANGED: { XmOperationChangedCallback callback = (XmOperationChangedCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->operation = dc->drag.operation; callback->operations = dc->drag.operations; } break; case XmCR_DROP_START: { XmDropStartCallback callback = (XmDropStartCallback)&callbackRec; callback->timeStamp = dc->drag.dragFinishTime; callback->operation = dc->drag.operation; callback->operations = dc->drag.operations; callback->dropAction = dc->drag.dragCompletionStatus; callback->dropSiteStatus = dsm->dropManager.curDropSiteStatus; callback->x = dc->core.x; callback->y = dc->core.y; callback->iccHandle = dc->drag.iccHandle; callback->window = XtWindow(dc->drag.srcShell); } break; default: break; } /* * if we're the initiator and the destination isn't us and either * its the drop message or the dynamic protocol send it to the wire */ if ((!dc->drag.currReceiverInfo->shell) && (!dc->drag.sourceIsExternal /* sanity check */) && ((dc->drag.activeProtocolStyle == XmDRAG_DYNAMIC) || (reason == XmCR_DROP_START))) { _XmSendICCCallback(XtDisplayOfObject((Widget) dc), destination, &callbackRec, XmICC_INITIATOR_EVENT); } else { XtPointer data; XmDragTopLevelClientDataStruct topLevelData; XmDragMotionClientDataStruct motionData; if ((reason == XmCR_TOP_LEVEL_ENTER) || (reason == XmCR_TOP_LEVEL_LEAVE) || (reason == XmCR_DROP_START)){ topLevelData.destShell = dc->drag.currReceiverInfo->shell; topLevelData.sourceIsExternal = dc->drag.sourceIsExternal; topLevelData.iccInfo = dc->drag.currReceiverInfo->iccInfo; topLevelData.xOrigin = (Position)(dc->drag.currReceiverInfo->xOrigin); topLevelData.yOrigin = (Position) (dc->drag.currReceiverInfo->yOrigin); topLevelData.width = (Dimension) (dc->drag.currReceiverInfo->width); topLevelData.height = (Dimension) (dc->drag.currReceiverInfo->height); topLevelData.window = dc->drag.currReceiverInfo->window; topLevelData.dragOver = (Widget)dc->drag.curDragOver; data = (XtPointer)&topLevelData; } else if ((reason == XmCR_DRAG_MOTION) || (reason == XmCR_OPERATION_CHANGED)) { motionData.window = dc->drag.currReceiverInfo->window; motionData.dragOver = (Widget)dc->drag.curDragOver; data = (XtPointer)&motionData; } else { data = NULL; } _XmDSMUpdate(dsm, (XtPointer)data, (XtPointer)&callbackRec); } } static void GenerateClientCallback( XmDragContext dc, unsigned char reason ) { XmICCCallbackStruct callbackRec; XtCallbackList callbackList = NULL; callbackRec.any.event = NULL; switch(callbackRec.any.reason = reason) { case XmCR_TOP_LEVEL_ENTER: if ((callbackList = dc->drag.topLevelEnterCallback) != NULL) { XmTopLevelEnterCallback callback = (XmTopLevelEnterCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->window = dc->drag.currReceiverInfo->window; callback->dragProtocolStyle = dc->drag.activeProtocolStyle; callback->screen = dc->drag.currScreen; callback->iccHandle = dc->drag.iccHandle; callback->x = dc->drag.currReceiverInfo->xOrigin; callback->y = dc->drag.currReceiverInfo->yOrigin; } break; case XmCR_TOP_LEVEL_LEAVE: if ((callbackList = dc->drag.topLevelLeaveCallback) != NULL) { XmTopLevelLeaveCallback callback = (XmTopLevelLeaveCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->screen = dc->drag.currScreen; callback->window = dc->drag.currReceiverInfo->window; } break; case XmCR_DRAG_MOTION: if ((callbackList = dc->drag.dragMotionCallback) != NULL) { XmDragMotionCallback callback = (XmDragMotionCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->x = dc->core.x; callback->y = dc->core.y; callback->operation = dc->drag.operation; callback->operations = dc->drag.operations; /* * If we're over DropOnly client, be optimistic. */ if (dc->drag.activeProtocolStyle == XmDRAG_DROP_ONLY) { callback->dropSiteStatus = XmVALID_DROP_SITE; } else { /* * Otherwise, we're over the root (see * DragMotionProto), and there's no drop site * under us. */ callback->dropSiteStatus = XmNO_DROP_SITE; } } break; case XmCR_OPERATION_CHANGED: if ((callbackList = dc->drag.operationChangedCallback) != NULL) { XmOperationChangedCallback callback = (XmOperationChangedCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; callback->operation = dc->drag.operation; callback->operations = dc->drag.operations; /* * If we're over DropOnly client, be optimistic. */ if (dc->drag.activeProtocolStyle == XmDRAG_DROP_ONLY) { callback->dropSiteStatus = XmVALID_DROP_SITE; } else { /* * Otherwise, we're over the root (see * DragMotionProto), and there's no drop site * under us. */ callback->dropSiteStatus = XmNO_DROP_SITE; } } break; case XmCR_DROP_SITE_ENTER: { XmeWarning((Widget)dc, MESSAGE1); } break; case XmCR_DROP_SITE_LEAVE: { XmDropSiteLeaveCallback callback = (XmDropSiteLeaveCallback)&callbackRec; callback->timeStamp = dc->drag.lastChangeTime; } break; default: break; } if (callbackList) { XtCallCallbackList( (Widget)dc, callbackList, &callbackRec); if (callbackList == dc->drag.dragMotionCallback) { XmDragOverShellWidget dos = dc->drag.curDragOver; XmDragMotionCallback callback = (XmDragMotionCallback)&callbackRec; dc->drag.operation = callback->operation; dc->drag.operations = callback->operations; if (dos->drag.cursorState != callback->dropSiteStatus) { dos->drag.cursorState = callback->dropSiteStatus; _XmDragOverChange((Widget)dos, dos->drag.cursorState); } } } } /*ARGSUSED*/ static void DropLoseIncrSelection( Widget w, Atom *selection, XtPointer clientData ) { DropLoseSelection( w, selection) ; } static void DropLoseSelection( Widget w, Atom *selection) { XmDragContext dc ; if (!(dc = (XmDragContext) _XmGetDragContextFromHandle( w, *selection))) { XmeWarning(w, MESSAGE2) ; } if (dc && dc->drag.dropFinishTime == 0) { XmeWarning(w, MESSAGE3) ; } } static void DragDropFinish( XmDragContext dc ) { Widget w = NULL; XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay)(XtParent(dc))); /* Handle completion */ if (dc->drag.dropFinishCallback) { XmDropFinishCallbackStruct cb; cb.reason = XmCR_DROP_FINISH; cb.event = NULL; cb.timeStamp = dc->drag.dropFinishTime; cb.operation = dc->drag.operation; cb.operations = dc->drag.operations; cb.dropSiteStatus = dsm->dropManager.curDropSiteStatus; cb.dropAction = dc->drag.dragCompletionStatus; cb.completionStatus = dc->drag.dragDropCompletionStatus; XtCallCallbackList((Widget) dc, dc->drag.dropFinishCallback, &cb); dc->drag.dragDropCompletionStatus = cb.completionStatus; } if (dc->drag.blendModel != XmBLEND_NONE && dc->drag.dragDropCancelEffect == False) { _XmDragOverFinish((Widget)dc->drag.curDragOver, dc->drag.dragDropCompletionStatus); } if (dc->drag.dragDropFinishCallback) { XmDragDropFinishCallbackStruct cb; cb.reason = XmCR_DRAG_DROP_FINISH; cb.event = NULL; cb.timeStamp = dc->drag.dropFinishTime; XtCallCallbackList((Widget) dc, dc->drag.dragDropFinishCallback, &cb); } /* * we send this now so that the non-local receiver can clean up * its dc after everything is done */ XtDisownSelection(dc->drag.srcShell, dc->drag.iccHandle, dc->drag.dragFinishTime); _XmFreeMotifAtom((Widget)dc, dc->drag.iccHandle); XtRemoveEventHandler(dc->drag.srcShell, FocusChangeMask, True, InitiatorMsgHandler, (XtPointer)dc); XtVaGetValues((Widget)dc, XmNsourceWidget, &w, NULL); if (w) XtRemoveCallback(w, XmNdestroyCallback, cancelDrag, (XtPointer)dc); XtDestroyWidget((Widget) dc); } /* * This callback is called when a drag operation needs to be terminated. * This can occur when the widget whose id is contained in the drag data * structure is destroyed. */ static void cancelDrag( Widget w, XtPointer client, XtPointer call) { Widget dragContext = (Widget)client; XmDragCancel(dragContext); } /* * This routine is passed as the frontend to the convertProc. */ /*VARARGS*/ static Boolean DropConvertIncrCallback( Widget w, Atom *selection, Atom *target, Atom *typeRtn, XtPointer *valueRtn, unsigned long *lengthRtn, int *formatRtn, unsigned long *maxLengthRtn, XtPointer clientData, XtRequestId *requestID ) { enum { XmATRANSFER_SUCCESS, XmATRANSFER_FAILURE, XmA_MOTIF_CANCEL_DROP_EFFECT, XmA_MOTIF_DROP, XmATARGETS, NUM_ATOMS }; static char *atom_names[] = { XmSTRANSFER_SUCCESS, XmSTRANSFER_FAILURE, XmS_MOTIF_CANCEL_DROP_EFFECT, XmS_MOTIF_DROP, XmSTARGETS }; XmDragContext dc; Time dropTime; Boolean returnVal = True; Boolean success; Atom atoms[XtNumber(atom_names)]; dropTime = XtGetSelectionRequest(w, *selection, requestID)->time; if (!(dc = (XmDragContext) _XmGetDragContextFromHandle(w, *selection))) { XmeWarning(w, MESSAGE2); return False; } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplayOfObject((Widget) dc), atom_names, XtNumber(atom_names), False, atoms); if ((success = (*target == atoms[XmATRANSFER_SUCCESS])) || (*target == atoms[XmATRANSFER_FAILURE])) { if (success) dc->drag.dragDropCompletionStatus = XmDROP_SUCCESS; else dc->drag.dragDropCompletionStatus = XmDROP_FAILURE; *typeRtn = *target; *lengthRtn = 0; *formatRtn = 32; *valueRtn = NULL; *maxLengthRtn = 0; /* * the time is really of the start of the transfer but ... */ dc->drag.dropFinishTime = dropTime; DragDropFinish(dc); } else if (*target == atoms[XmA_MOTIF_CANCEL_DROP_EFFECT]) { dc->drag.dragDropCancelEffect = True; } else /* normal transfer */ { Atom motifDrop = atoms[XmA_MOTIF_DROP]; returnVal = (Boolean)((*(dc->drag.convertProc.sel_incr)) ((Widget)dc, &motifDrop, target, typeRtn, valueRtn, lengthRtn, formatRtn, maxLengthRtn, clientData, requestID)); } /* add code to handle TARGET target automatically if not there yet */ if ((! returnVal) && (*target == atoms[XmATARGETS])) { int len = sizeof(Atom) * dc->drag.numExportTargets; if (dc->drag.incremental & 0x2) { dc->drag.incremental = 1; *valueRtn = NULL; *lengthRtn = 0; } else { *valueRtn = XtMalloc(len); memmove(*valueRtn, dc->drag.exportTargets, len); *lengthRtn = dc->drag.numExportTargets; dc->drag.incremental = 3; } *formatRtn = 32; *typeRtn = XA_ATOM; returnVal = True; } return returnVal; } /* * This routine is passed as the frontend to the convertProc. */ /*VARARGS*/ static Boolean DropConvertCallback( Widget w, Atom *selection, Atom *target, Atom *typeRtn, XtPointer *valueRtn, unsigned long *lengthRtn, int *formatRtn ) { enum { XmATRANSFER_SUCCESS, XmATRANSFER_FAILURE, XmA_MOTIF_CANCEL_DROP_EFFECT, XmA_MOTIF_DROP, XmATARGETS, NUM_ATOMS }; static char *atom_names[] = { XmSTRANSFER_SUCCESS, XmSTRANSFER_FAILURE, XmS_MOTIF_CANCEL_DROP_EFFECT, XmS_MOTIF_DROP, XmSTARGETS }; XmDragContext dc; Time dropTime; Boolean returnVal = True; Boolean success; Atom atoms[XtNumber(atom_names)]; dropTime = XtGetSelectionRequest(w, *selection, NULL)->time; if (!(dc = (XmDragContext) _XmGetDragContextFromHandle(w, *selection))) { XmeWarning(w, MESSAGE2); return False; } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplayOfObject((Widget) dc), atom_names, XtNumber(atom_names), False, atoms); if ((success = (*target == atoms[XmATRANSFER_SUCCESS])) || (*target == atoms[XmATRANSFER_FAILURE])) { if (success) dc->drag.dragDropCompletionStatus = XmDROP_SUCCESS; else dc->drag.dragDropCompletionStatus = XmDROP_FAILURE; *typeRtn = *target; *lengthRtn = 0; *formatRtn = 32; *valueRtn = NULL; /* * the time is really of the start of the transfer but ... */ dc->drag.dropFinishTime = dropTime; DragDropFinish(dc); } else if (*target == atoms[XmA_MOTIF_CANCEL_DROP_EFFECT]) { dc->drag.dragDropCancelEffect = True; } else /* normal transfer */ { Atom motifDrop = atoms[XmA_MOTIF_DROP]; returnVal = (Boolean) ((*(dc->drag.convertProc.sel)) ((Widget)dc, &motifDrop, target, typeRtn, valueRtn, lengthRtn, formatRtn)); } /* add code to handle TARGET target automatically if not there yet */ if ((! returnVal) && (*target == atoms[XmATARGETS])) { int len = sizeof(Atom) * dc->drag.numExportTargets; *valueRtn = XtMalloc(len); memmove(*valueRtn, dc->drag.exportTargets, len); *lengthRtn = dc->drag.numExportTargets; *formatRtn = 32; *typeRtn = XA_ATOM; returnVal = True; } return returnVal; } /*ARGSUSED*/ static void DragStartProto( XmDragContext dc) { /* * bootstrap the top_level_window code */ _XmWriteInitiatorInfo((Widget)dc); GetDestinationInfo(dc, RootWindowOfScreen(XtScreen(dc)), XtWindow(dc->drag.srcShell)); GenerateClientCallback(dc, XmCR_TOP_LEVEL_ENTER); SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmTOP_LEVEL_ENTER); SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmDRAG_MOTION); } static void NewScreen( XmDragContext dc, Window newRoot) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(dc)); Cardinal i; Arg args[8]; Widget old = (Widget) (dc->drag.curDragOver); /* Find the new screen number */ for (i = 0; i < XScreenCount(XtDisplayOfObject((Widget) dc)); i++) if (RootWindow(XtDisplayOfObject((Widget) dc), i) == newRoot) break; dc->drag.currScreen = ScreenOfDisplay(XtDisplayOfObject((Widget) dc), i); dc->drag.currWmRoot = RootWindowOfScreen(dc->drag.currScreen); /* Build a new one */ i = 0; /* * If this is the first call, tracking mode will be querypending * and we have to come up in cursor mode. Otherwise, we come up * in cursor for dynamic and pixmap for preregister. */ if ((dc->drag.trackingMode == XmDRAG_TRACK_WM_QUERY_PENDING) || (dc->drag.activeProtocolStyle == XmDRAG_DYNAMIC)) { if (dpy -> display.displayHasShapeExtension) XtSetArg(args[i], XmNdragOverMode, XmDRAG_WINDOW); else XtSetArg(args[i], XmNdragOverMode, XmCURSOR); i++; } else { XtSetArg(args[i], XmNdragOverMode, XmPIXMAP); i++; } XtSetArg(args[i], XmNhotX, dc->core.x); i++; XtSetArg(args[i], XmNhotY, dc->core.y); i++; XtSetArg(args[i], XmNbackgroundPixmap, None); i++; XtSetArg(args[i], XmNscreen, dc->drag.currScreen);i++; XtSetArg(args[i], XmNdepth, DefaultDepthOfScreen(dc->drag.currScreen));i++; XtSetArg(args[i], XmNcolormap, DefaultColormapOfScreen(dc->drag.currScreen));i++; XtSetArg(args[i], XmNvisual, DefaultVisualOfScreen(dc->drag.currScreen));i++; /* * As popup child(ren) of the dc, the drag over(s) will * automatically destroyed by Xt when the dc is destroyed. * Isn't that handy? */ dc->drag.curDragOver = (XmDragOverShellWidget) XtCreatePopupShell("dragOver", xmDragOverShellWidgetClass, (Widget) dc, args, i); if (dc->drag.currScreen == XtScreen(dc->drag.srcShell)) _XmDragOverSetInitialPosition((Widget)dc->drag.curDragOver, dc->drag.startX, dc->drag.startY); if (old != NULL) { if (old != (Widget) (dc->drag.origDragOver)) XtDestroyWidget(old); else _XmDragOverHide((Widget)dc->drag.origDragOver, 0, 0, NULL); } GetScreenInfo(dc); if (dc->drag.origDragOver == NULL) { dc->drag.origDragOver = dc->drag.curDragOver; } if (dc->drag.trackingMode == XmDRAG_TRACK_MOTION) { EventMask mask = _XmDRAG_EVENT_MASK(dc); if (XGrabPointer(XtDisplayOfObject((Widget) dc->drag.curDragOver), RootWindowOfScreen(XtScreen(dc->drag.curDragOver)), False, mask, GrabModeSync, GrabModeAsync, None, _XmDragOverGetActiveCursor((Widget)dc->drag.curDragOver), dc->drag.lastChangeTime) != GrabSuccess) Warning(MESSAGE4); XAllowEvents(XtDisplayOfObject((Widget) dc->drag.srcShell), SyncPointer, dc->drag.lastChangeTime); } } /*ARGSUSED*/ static void LocalNotifyHandler( Widget w, XtPointer client, XtPointer call ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject)w; XmDragContext dc = (XmDragContext)client; switch(((XmAnyICCCallback)call)->reason) { case XmCR_DROP_SITE_ENTER: SiteEnteredWithLocalSource((Widget)dsm, (XtPointer)dc, (XtPointer)call); break; case XmCR_DROP_SITE_LEAVE: /* SiteLeftWithLocalSource expect to find an * XmDropSiteEnterPendingCallbackStruct, so upgrade the * XmDropSiteLeaveCallbackStruct. */ { XmDropSiteLeaveCallbackStruct *cb = (XmDropSiteLeaveCallbackStruct *) call; XmDropSiteEnterPendingCallbackStruct new_call; new_call.reason = cb->reason; new_call.event = cb->event; new_call.timeStamp = cb->timeStamp; new_call.enter_pending = False; SiteLeftWithLocalSource((Widget) dsm, (XtPointer)dc, (XtPointer) &new_call); break; } case XmCR_DRAG_MOTION: SiteMotionWithLocalSource((Widget)dsm, (XtPointer)dc, (XtPointer)call); break; case XmCR_OPERATION_CHANGED: OperationChanged((Widget)dsm, (XtPointer)dc, (XtPointer)call); break; case XmCR_DROP_START: DropStartConfirmed((Widget)dsm, (XtPointer)dc, (XtPointer)call); default: break; } } /* * sends replies to drag messages */ /*ARGSUSED*/ static void ExternalNotifyHandler( Widget w, XtPointer client, XtPointer call ) { XmDragContext dc = (XmDragContext)client; XmAnyICCCallback cb = (XmAnyICCCallback)call; switch(cb->reason) { case XmCR_DROP_SITE_ENTER: case XmCR_DROP_SITE_LEAVE: case XmCR_DRAG_MOTION: case XmCR_OPERATION_CHANGED: case XmCR_DROP_START: /* * send a message to the external source */ _XmSendICCCallback(XtDisplayOfObject((Widget) dc), dc->drag.srcWindow, (XmICCCallback)cb, XmICC_RECEIVER_EVENT); break; default: XmeWarning((Widget)dc, MESSAGE5); break; } } /* * catches replies on drag messages */ /*ARGSUSED*/ static void InitiatorMsgHandler( Widget w, XtPointer clientData, XEvent *event, Boolean *dontSwallow ) { XmDragContext dc =(XmDragContext)clientData; XmICCCallbackStruct callbackRec; if ((dc && (event->type != ClientMessage)) || (!_XmICCEventToICCCallback((XClientMessageEvent *)event, &callbackRec, XmICC_RECEIVER_EVENT)) || (dc->drag.dragStartTime > callbackRec.any.timeStamp) || (dc->drag.crossingTime > callbackRec.any.timeStamp)) return; LocalNotifyHandler(w, (XtPointer)dc, (XtPointer)&callbackRec); } /*ARGSUSED*/ static void SiteEnteredWithLocalSource( Widget w, XtPointer client, XtPointer call ) { XmDragContext dc = (XmDragContext)client; XmDropSiteEnterCallbackStruct *cb = (XmDropSiteEnterCallbackStruct *)call; CalculateDragOperation(dc); /* check against the current location of the pointer */ if (dc->drag.siteEnterCallback) { XtCallCallbackList((Widget) dc, dc->drag.siteEnterCallback, cb); } dc->drag.operation = cb->operation; dc->drag.operations = cb->operations; dc->drag.inDropSite = True; _XmDragOverChange((Widget)dc->drag.curDragOver, cb->dropSiteStatus); } /*ARGSUSED*/ static void SiteLeftWithLocalSource( Widget w, XtPointer client, XtPointer call ) { XmDragContext dc = (XmDragContext)client; XmDropSiteEnterPendingCallbackStruct *cb = (XmDropSiteEnterPendingCallbackStruct *)call; dc->drag.inDropSite = False; if (dc->drag.siteLeaveCallback) { XtCallCallbackList((Widget) dc, dc->drag.siteLeaveCallback, (XmDropSiteLeaveCallbackStruct *)cb); } CalculateDragOperation(dc); /* * Don't forward laggard echo leaves to dragUnder */ if (dc->drag.dragFinishTime == 0 && !cb->enter_pending) _XmDragOverChange((Widget)dc->drag.curDragOver, XmNO_DROP_SITE); } /*ARGSUSED*/ static void OperationChanged( Widget w, XtPointer client, XtPointer call ) { XmDragContext dc = (XmDragContext)client; XmOperationChangedCallbackStruct *cb = (XmOperationChangedCallbackStruct *)call; if (dc->drag.operationChangedCallback) { XtCallCallbackList((Widget) dc, dc->drag.operationChangedCallback, cb); } dc->drag.operation = cb->operation; dc->drag.operations = cb->operations; _XmDragOverChange((Widget)dc->drag.curDragOver, cb->dropSiteStatus); } /*ARGSUSED*/ static void SiteMotionWithLocalSource( Widget w, XtPointer client, XtPointer call ) { XmDragContext dc = (XmDragContext)client; XmDragMotionCallbackStruct *cb = (XmDragMotionCallbackStruct *)call; if (dc->drag.dragMotionCallback) { XtCallCallbackList((Widget) dc, dc->drag.dragMotionCallback, cb); } /* Application should not be able to change callback data so * don't call _XmDragOverChange(), this will result in better * drag performance. */ } /*ARGSUSED*/ static void DropStartConfirmed( Widget w, XtPointer client, XtPointer call ) { XmDragContext dc = (XmDragContext)client; XmDropStartCallbackStruct *cb = (XmDropStartCallbackStruct *)call; XtAppContext appContext = XtWidgetToApplicationContext((Widget)dc); if (dc->drag.dragTimerId) { XtRemoveTimeOut(dc->drag.dragTimerId); dc->drag.dragTimerId = (XtIntervalId) NULL; } /* Add a long timeout in case the drop site dies. */ dc->drag.dragTimerId = XtAppAddTimeOut(appContext, XtAppGetSelectionTimeout(appContext) * 10, DropFinishTimeout, (XtPointer)dc); if (dc->drag.dropStartCallback) { XtCallCallbackList( (Widget)dc, dc->drag.dropStartCallback, cb); } dc->drag.dragCompletionStatus = cb->dropAction; switch(dc->drag.dragCompletionStatus) { case XmDROP: case XmDROP_INTERRUPT: case XmDROP_HELP: break; case XmDROP_CANCEL: break; } } static Widget GetShell( Widget w ) { while (w && !XtIsShell(w)) w = XtParent(w); return w; } static void InitDropSiteManager( XmDragContext dc ) { XmDropSiteManagerObject dsm; Arg args[4]; Cardinal i = 0; dsm = _XmGetDropSiteManagerObject((XmDisplay)(XtParent(dc))); XtSetArg(args[i], XmNclientData, dc); i++; if (dc->drag.sourceIsExternal) { XtSetArg(args[i], XmNnotifyProc, ExternalNotifyHandler); i++; } else { XtSetArg(args[i], XmNnotifyProc, LocalNotifyHandler); i++; } XtSetValues((Widget)dsm, args, i); } /*ARGSUSED*/ static void TopWindowsReceived( Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format ) { XmDragContext dc = (XmDragContext)client_data; XmDisplay dd = (XmDisplay) w; Cardinal i; XmDragReceiverInfo currInfo, startInfo; Window *clientWindows; unsigned char oldStyle; if (dd->display.activeDC != dc) { /* Too late... */ return; } /* CR 6337. Must call DragOverChange if the blendModel changes. This doesn't happen often, only in certain cases involving PREREGISTER */ if (dc -> drag.blendModel != dc -> drag.activeBlendModel) { dc->drag.blendModel = dc->drag.activeBlendModel; _XmDragOverChange((Widget)dc->drag.curDragOver, XmNO_DROP_SITE); } #ifdef MULTI_SCREEN_DONE if ((*length != 0) && (*format == 32) && (*type == XA_WINDOW)) { /* * we make a receiverInfo array one larger than the number of * client windows since we keep the root info in array[0]. */ if (dc->drag.numReceiverInfos >= 1) startInfo = dc->drag.receiverInfos; else startInfo = NULL; dc->drag.numReceiverInfos = dc->drag.maxReceiverInfos = *length + 1; dc->drag.receiverInfos = (XmDragReceiverInfo) XtCalloc(dc->drag.maxReceiverInfos, sizeof(XmDragReceiverInfoStruct)); clientWindows = (Window *)value; if (startInfo) { memcpy((char *)dc->drag.receiverInfos, (char *)startInfo, sizeof(XmDragReceiverInfoStruct)); dc->drag.rootReceiverInfo = dc->drag.receiverInfos; XtFree((char *)startInfo); } #ifdef DEBUG else Warning("we don't have startInfo when we should\n"); #endif /* DEBUG */ for (i = 1; i < dc->drag.numReceiverInfos; i++) { currInfo = &dc->drag.receiverInfos[i]; currInfo->window = clientWindows[i-1]; currInfo->shell = XtWindowToWidget(XtDisplay(dc), currInfo->window); if (currInfo->shell == NULL) { XSelectInput(XtDisplay(dc), currInfo->window, EnterWindowMask | LeaveWindowMask); } } /* * set the currReceiver to the srcShell since that's where * we're confined to */ dc->drag.currReceiverInfo = FindReceiverInfo(dc, XtWindow(dc->drag.srcShell)); dc->drag.trackingMode = XmDRAG_TRACK_WM_QUERY; oldStyle = dc->drag.activeProtocolStyle; dc->drag.activeProtocolStyle = _XmGetActiveProtocolStyle((Widget)dc); ValidateDragOver(dc, oldStyle, dc->drag.activeProtocolStyle); } else #endif /* MULTI_SCREEN_DONE */ { EventMask mask; Window confineWindow; Cursor cursor; dc->drag.trackingMode = XmDRAG_TRACK_MOTION; GetDestinationInfo(dc, dc->drag.currWmRoot, dc->drag.currReceiverInfo->window); #ifndef MULTI_SCREEN_DONE confineWindow = RootWindowOfScreen(XtScreen(dc)); #else confineWindow = None; #endif /* MULTI_SCREEN_DONE */ /* * we need to regrab so that the confine window can be changed * from the source window. If there was another value for * trackingMode like XmDRAG_TRACK_WM_QUERY_FAILED we could do * this in DragStartWithTracking */ mask = _XmDRAG_EVENT_MASK(dc); cursor = _XmDragOverGetActiveCursor((Widget)dc->drag.curDragOver); if (XGrabPointer(XtDisplayOfObject((Widget) dc), RootWindowOfScreen(XtScreen(dc)), False, mask, GrabModeSync, GrabModeAsync, confineWindow, cursor, dc->drag.lastChangeTime) != GrabSuccess) Warning(MESSAGE4); } #ifdef MULTI_SCREEN_DONE if (value) XtFree((char *)value); #endif /* MULTI_SCREEN_DONE */ DragStartWithTracking(dc); } /* ARGSUSED */ static void DragStart( XmDragContext dc, Widget src, XEvent *event ) { XmDisplay dd; unsigned char activeProtocolStyle; unsigned int state = event->xbutton.state; EventMask mask; Window saveWindow; Window confineWindow; Cursor cursor = None; dd = (XmDisplay)XtParent(dc); dd->display.activeDC = dc; dd->display.userGrabbed = True; dc->drag.crossingTime = dc->drag.dragStartTime = dc->drag.lastChangeTime = event->xbutton.time; dc->drag.startX = dc->core.x = event->xbutton.x_root; dc->drag.startY = dc->core.y = event->xbutton.y_root; dc->drag.curDragOver = NULL; dc->drag.origDragOver = NULL; dc->drag.srcShell = GetShell(src); dc->drag.srcWindow = XtWindow(dc->drag.srcShell); dc->drag.iccHandle = _XmAllocMotifAtom((Widget)dc, dc->drag.dragStartTime); if (dc->drag.incremental) XtOwnSelectionIncremental(dc->drag.srcShell, dc->drag.iccHandle, dc->drag.dragStartTime, DropConvertIncrCallback, DropLoseIncrSelection, NULL, NULL, dc->drag.clientData); else XtOwnSelection(dc->drag.srcShell, dc->drag.iccHandle, dc->drag.dragStartTime, DropConvertCallback, DropLoseSelection, NULL); dc->drag.serverGrabbed = False; dc->drag.sourceIsExternal = False; dc->drag.activeProtocolStyle = activeProtocolStyle = _XmGetActiveProtocolStyle((Widget)dc); switch (dc->drag.activeProtocolStyle) { case XmDRAG_PREREGISTER: dc->drag.activeProtocolStyle = XmDRAG_DYNAMIC; case XmDRAG_DYNAMIC: break; case XmDRAG_DROP_ONLY: dc->drag.activeProtocolStyle = XmDRAG_NONE; case XmDRAG_NONE: break; } /* must be either DYNAMIC or NONE at this point */ /* * start out with the default operations in effective operations */ dc->drag.lastEventState = state; CalculateDragOperation(dc); dc->drag.sourceIsExternal = False; /* * if we're in query_pending mode then initialize the * currReceiverInfo to us */ if (dc->drag.trackingMode == XmDRAG_TRACK_MOTION) { dc->drag.activeProtocolStyle = activeProtocolStyle; #ifndef MULTI_SCREEN_DONE confineWindow = RootWindowOfScreen(XtScreen(dc)); #else confineWindow = None; } else { /* XmDRAG_TRACK_WM_QUERY */ dc->drag.trackingMode = XmDRAG_TRACK_WM_QUERY_PENDING; confineWindow = XtWindow(dc->drag.srcShell); } #endif /* MULTI_SCREEN_DONE */ if (dc->drag.trackingMode == XmDRAG_TRACK_WM_QUERY_PENDING && activeProtocolStyle == XmDRAG_PREREGISTER) { dc->drag.blendModel = XmBLEND_NONE; } NewScreen(dc, RootWindowOfScreen(XtScreen(dc))); XtInsertEventHandler(dc->drag.srcShell, FocusChangeMask, True, InitiatorMsgHandler, (XtPointer)dc, XtListHead); mask = _XmDRAG_EVENT_MASK(dc); /* * we grab on the Xt pointer so that Xt doesn't interfere with us. * Also once we have the WM_QUERY capability this will work. * Otherwise we need to grab on the root so we can track the * changes in sub_window and infer the top_level crossings */ /* * some more sleaze to get around the ungrab. Since we can't rely * on the caller to have done an owner_events true (for Xt), we need to * guarantee that the release event goes to us. The grab window * must be viewable so we can't use the dc window */ saveWindow = dc->core.window; cursor = _XmDragOverGetActiveCursor((Widget)dc->drag.curDragOver); dc->core.window = RootWindowOfScreen(XtScreen(dc)); if ((XtGrabPointer((Widget)dc, False, (unsigned int) mask, GrabModeSync, GrabModeAsync, confineWindow, cursor, dc->drag.dragStartTime) != GrabSuccess) || (XGrabPointer(XtDisplayOfObject((Widget) dc), RootWindowOfScreen(XtScreen(dc)), False, mask, GrabModeSync, GrabModeAsync, confineWindow, cursor, dc->drag.dragStartTime) != GrabSuccess) || (XGrabKeyboard(XtDisplayOfObject((Widget) dc), RootWindowOfScreen(XtScreen(dc)), False, GrabModeSync, GrabModeAsync, dc->drag.dragStartTime) != GrabSuccess)) Warning(MESSAGE4); _XmAddGrab((Widget)dc, True, False); dc->core.window = saveWindow; /* Begin fixing OSF CR 5556 */ /* * Add ButtonMotionMask to the already set-up event mask for root window. * This gets reinstalled in DragContextDestroy() */ { XWindowAttributes xwa; XGetWindowAttributes(XtDisplay(dc), dc->drag.currWmRoot, &xwa); dc->drag.SaveEventMask = xwa.your_event_mask; XSelectInput(XtDisplay(dc), dc->drag.currWmRoot, xwa.your_event_mask | ButtonMotionMask); } /* End fixing OSF CR 5556 */ if (dc->drag.trackingMode == XmDRAG_TRACK_WM_QUERY_PENDING) { enum { XmA_MOTIF_WM_QUERY, XmA_MOTIF_WM_ALL_CLIENTS, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_WM_QUERY, XmS_MOTIF_WM_ALL_CLIENTS }; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(dc), atom_names, XtNumber(atom_names), False, atoms); XtGetSelectionValue((Widget)dd, atoms[XmA_MOTIF_WM_QUERY], atoms[XmA_MOTIF_WM_ALL_CLIENTS], TopWindowsReceived, (XtPointer)dc, dc->drag.dragStartTime); XAllowEvents(XtDisplayOfObject((Widget) dc->drag.srcShell), SyncPointer, dc->drag.dragStartTime); } else DragStartWithTracking(dc); XSync(XtDisplay(dc), False); XtAppAddTimeOut( XtWidgetToApplicationContext( (Widget)dc), 0, InitiatorMainLoop, (XtPointer)(&dd->display.activeDC)); } /* ARGSUSED */ static void DragStartWithTracking( XmDragContext dc) { if (dc->drag.dragFinishTime) return; if (dc->drag.trackingMode == XmDRAG_TRACK_WM_QUERY) { EventMask mask = _XmDRAG_EVENT_MASK(dc); Window confineWindow; Cursor cursor; #ifndef MULTI_SCREEN_DONE confineWindow = RootWindowOfScreen(XtScreen(dc)); #else confineWindow = None; #endif cursor = _XmDragOverGetActiveCursor((Widget)dc->drag.curDragOver); /* * set owner events to true so that the crossings and motion * are reported relative to the destination windows. Don't * tell Xt about it so we can continue to get everything * reported to the dragContext via the spring-loaded/XtGrab * interaction. Blegh */ if (XGrabPointer(XtDisplayOfObject((Widget) dc), RootWindowOfScreen(XtScreen(dc)), True, mask, GrabModeSync, GrabModeAsync, confineWindow, cursor, dc->drag.lastChangeTime) != GrabSuccess) Warning(MESSAGE4); } XAllowEvents(XtDisplayOfObject((Widget) dc->drag.srcShell), SyncPointer, dc->drag.lastChangeTime); } static void UpdateMotionBuffer( XmDragContext dc, MotionBuffer mb, XEvent *event) { Time time ; unsigned int state; Window window, subwindow; Position x ; Position y ; if (dc->drag.currReceiverInfo == NULL) return; dc->drag.lastChangeTime = event->xmotion.time; /* * we munged the window and subwindow fields before calling * XtDispatchEvent so we could get the event thru to the * DragContext. The subwindow field will hold the interesting * info. The window field is always set (by us) to the DC window. */ switch(event->type) { case MotionNotify: if (mb->count && ((mb->count % (STACKMOTIONBUFFERSIZE)) == 0)) { if (mb->count == (STACKMOTIONBUFFERSIZE)){ MotionBuffer oldMb = mb; Cardinal size; size = sizeof(MotionBufferRec) + (STACKMOTIONBUFFERSIZE * sizeof(MotionEntryRec)); mb = (MotionBuffer) XtMalloc(size); memcpy((char *)mb, (char *)oldMb, sizeof(MotionBufferRec)); } else { mb = (MotionBuffer) XtRealloc((char *)mb, (sizeof(MotionBufferRec) + (mb->count + STACKMOTIONBUFFERSIZE) *sizeof(MotionEntryRec))); } } /* * for right now use the root although this wont work for * pseudo-roots */ time = event->xmotion.time; state = event->xmotion.state; x = event->xmotion.x_root; y = event->xmotion.y_root; window = event->xmotion.root; if (dc->drag.trackingMode != XmDRAG_TRACK_MOTION) { subwindow = mb->currReceiverInfo->window; } else { subwindow = event->xmotion.subwindow; } mb->entries[mb->count].time = time; mb->entries[mb->count].window = window; mb->entries[mb->count].subwindow = subwindow; mb->entries[mb->count].state = state; mb->entries[mb->count].x = x; mb->entries[mb->count++].y = y; break; case EnterNotify: if ((event->xcrossing.mode == NotifyNormal) && (dc->drag.trackingMode != XmDRAG_TRACK_MOTION)) { XmDragReceiverInfo rInfo; if ((rInfo = FindReceiverInfo(dc, event->xcrossing.subwindow)) != NULL) mb->currReceiverInfo = rInfo; } break; case LeaveNotify: if ((event->xcrossing.mode == NotifyNormal) && (dc->drag.trackingMode != XmDRAG_TRACK_MOTION)) { XmDragReceiverInfo rInfo; if ((rInfo = FindReceiverInfo(dc, event->xcrossing.subwindow)) != NULL) { if (rInfo == mb->currReceiverInfo) mb->currReceiverInfo = dc->drag.rootReceiverInfo; } } break; default: break; } } static void DragMotionProto( XmDragContext dc, Window root, Window subWindow ) { Boolean incrementTimestamp = False; /* * We've selected for motion on the root window. This allows us to * use the subwindow field to know whenever we have left or * entered a potential top-level window. */ if ((root != dc->drag.currWmRoot) || ((((dc->drag.trackingMode == XmDRAG_TRACK_MOTION) && (dc->drag.currReceiverInfo->frame != subWindow))) || ((dc->drag.trackingMode == XmDRAG_TRACK_WM_QUERY) && (dc->drag.currReceiverInfo->window != subWindow)))) { if (dc->drag.currReceiverInfo->window) { if ((dc->drag.activeProtocolStyle != XmDRAG_NONE) && (dc->drag.activeProtocolStyle != XmDRAG_DROP_ONLY)) { /* * Assumes the root window doesn't contain drop-sites !!! * Send motion to old window. * * ** Old stuff for bootstrap * ** if (dc->drag.currReceiverInfo->frame) * ** only send to non-initial windows */ /* * if the receiver is dynamic and we've been * informed that we're in a drop-site then * generate a dropsite leave to the initiator. If * we haven't yet been informed of a drop-site * enter (due to latency) but one is in the pipes, * it will be ignored once it gets in based on the * timestamp being stale. * * We'll make sure it's stale by incrementing the * timestamp by one millisecond. This is a no-no but * it makes it easy to identify the echo events from * the receiver. Its also relatively safe until we * get micro-second response times :-) */ if ((dc->drag.activeProtocolStyle == XmDRAG_DYNAMIC) && (!dc->drag.currReceiverInfo->shell) && (dc->drag.inDropSite)) { GenerateClientCallback(dc, XmCR_DROP_SITE_LEAVE); dc->drag.inDropSite = False; incrementTimestamp = True; } SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmDRAG_MOTION); SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmTOP_LEVEL_LEAVE); } GenerateClientCallback(dc, XmCR_TOP_LEVEL_LEAVE); } if (root != dc->drag.currWmRoot) NewScreen(dc, root); GetDestinationInfo(dc, root, subWindow); /* we should special-case the root window */ if (dc->drag.currReceiverInfo->window) { if ((dc->drag.activeProtocolStyle != XmDRAG_NONE) && (dc->drag.activeProtocolStyle != XmDRAG_DROP_ONLY)) { SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmTOP_LEVEL_ENTER); } /* clear iccInfo for dsm's sanity */ dc->drag.currReceiverInfo->iccInfo = NULL; GenerateClientCallback(dc, XmCR_TOP_LEVEL_ENTER); } } if (dc->drag.currReceiverInfo->window) { if ((dc->drag.activeProtocolStyle != XmDRAG_NONE) && (dc->drag.activeProtocolStyle != XmDRAG_DROP_ONLY)) SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmDRAG_MOTION); else GenerateClientCallback(dc, XmCR_DRAG_MOTION); } else GenerateClientCallback(dc, XmCR_DRAG_MOTION); if (incrementTimestamp) dc->drag.lastChangeTime++; } static void ProcessMotionBuffer( XmDragContext dc, MotionBuffer mb ) { Cardinal incr, i, j, max; Window protoWindow = None; incr = (mb->count / MOTIONFILTER); if (incr == 0) incr = 1; max = mb->count / incr; j = (mb->count + incr - 1) % incr; for (i = 0; i < max; i++, j += incr) { dc->core.x = mb->entries[j].x; dc->core.y = mb->entries[j].y; if (mb->entries[j].state != dc->drag.lastEventState) CheckModifiers(dc, mb->entries[j].state); if (dc->drag.currWmRoot != mb->entries[j].window) { /* * cause the callbacks to get called so the client can * change the dragOver visuals */ DragMotionProto(dc, mb->entries[j].window, None); protoWindow = None; } else protoWindow = mb->entries[j].subwindow; } _XmDragOverMove((Widget)dc->drag.curDragOver, dc->core.x, dc->core.y); /* if the protoWindow gotten above is the drag window, * we can use XTranslateCoordinates to look through the * one pixel hole (which has just been moved to be under where * the pointer was), and determine what real window we are over */ if (protoWindow == XtWindow(dc->drag.curDragOver)) { Window currRoot = dc->drag.currWmRoot; int dummyx, dummyy; (void) XTranslateCoordinates(XtDisplay(dc), currRoot, currRoot, dc->core.x, dc->core.y, &dummyx, &dummyy, &protoWindow); } /* * actually inform the receiver/initiator that movement has * occurred */ DragMotionProto(dc, dc->drag.currWmRoot, protoWindow); if (mb->count > STACKMOTIONBUFFERSIZE) XtFree( (char *)mb); } #define IsGrabEvent(ev) \ ((ev->type == ButtonPress) ||\ (ev->type == ButtonRelease) ||\ (ev->type == KeyPress) ||\ (ev->type == KeyRelease)) /* ARGSUSED */ static void DragMotion( Widget w, XEvent *event, String *params, Cardinal *numParams ) { XmDragContext dc = (XmDragContext)w; MotionBufferRec stackBuffer; MotionBuffer motionBuffer = &stackBuffer; Boolean grabEvent = False; stackBuffer.count = 0; stackBuffer.currReceiverInfo = dc->drag.currReceiverInfo; UpdateMotionBuffer(dc, motionBuffer,event); /* * We need to process all outstanding events of interest * inline and flush out any stale motion events. Need to * check for state change events like modifier or button press. */ /* * get any that came in after */ while (!grabEvent && XCheckMaskEvent(XtDisplayOfObject((Widget) w), _XmDRAG_EVENT_MASK(dc), event)) { grabEvent = IsGrabEvent(event); if (!grabEvent) { if (dc->drag.trackingMode != XmDRAG_TRACK_MOTION) event->xmotion.subwindow = event->xmotion.window; UpdateMotionBuffer(dc, motionBuffer, event); } else XPutBackEvent(XtDisplay(dc), event); } ProcessMotionBuffer(dc, motionBuffer); XFlush(XtDisplayOfObject((Widget) dc)); } /* ARGSUSED */ static void DragKey( Widget w, XEvent *event, String *params, Cardinal *numParams ) { char *direction; int dx, dy; XKeyEvent *keyevent = (XKeyEvent *) event; XEvent motionEvent; XmDisplay dd; unsigned int state = 0; dd = (XmDisplay) XtParent(w); direction = params[0]; if (event == NULL) return; if (strcmp(direction, "Up") == 0) { dx = 0; dy = -1; } else if (strcmp(direction, "Down") == 0) { dx = 0; dy = 1; } else if (strcmp(direction, "Left") == 0) { dx = -1; dy = 0; } else if (strcmp(direction, "Right") == 0) { dx = 1; dy = 0; } else { /* Update on modifier key changes */ dx = 0; dy = 0; if (event -> type == KeyPress) state = keyevent -> state; } if (keyevent -> state & ControlMask) { dx *= 16; dy *= 16; } if (dd -> display.enable_warp == False) { dx = 0; dy = 0; } else { XWarpPointer(XtDisplay(w), None, None, 0, 0, 0, 0, dx, dy); } /* Send a button2 motion event so that the drag feedback will happen within DragMotion */ motionEvent.xmotion.type = MotionNotify; motionEvent.xmotion.window = keyevent -> window; motionEvent.xmotion.subwindow = keyevent -> subwindow; motionEvent.xmotion.time = keyevent -> time; motionEvent.xmotion.root = keyevent -> root; motionEvent.xmotion.x = XtX(w) + dx; motionEvent.xmotion.y = XtY(w) + dy; motionEvent.xmotion.x_root = keyevent -> x_root; motionEvent.xmotion.y_root = keyevent -> y_root; motionEvent.xmotion.same_screen = keyevent -> same_screen; /* Or in the modifier bits if this is an update */ motionEvent.xmotion.state = Button2Mask | state; motionEvent.xmotion.is_hint = 0; DragMotion(w, (XEvent *) &motionEvent, NULL, 0); } /*ARGSUSED*/ static void DropStartTimeout( XtPointer clientData, XtIntervalId *id ) { XmDragContext dc = (XmDragContext)clientData; XmDropStartCallbackStruct callbackRec, *callback = &callbackRec; XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay)(XtParent(dc))); if (dc->drag.dropStartCallback) { callback->reason = XmCR_DROP_START; callback->event = NULL; callback->timeStamp = dc->drag.dragFinishTime; callback->operation = dc->drag.operation; callback->operations = dc->drag.operations; callback->dropAction = XmDROP_CANCEL; callback->dropSiteStatus = dsm->dropManager.curDropSiteStatus; callback->x = dc->core.x; callback->y = dc->core.y; callback->iccHandle = dc->drag.iccHandle; callback->window = XtWindow(dc->drag.srcShell); XtCallCallbackList((Widget)dc, dc->drag.dropStartCallback, callback); dc->drag.dragCompletionStatus = callback->dropAction; dsm->dropManager.curDropSiteStatus = callback->dropSiteStatus; } dc->drag.dragDropCompletionStatus = XmDROP_FAILURE; dc->drag.dropFinishTime = dc->drag.dragFinishTime; DragDropFinish(dc); } /*ARGSUSED*/ static void DropFinishTimeout( XtPointer clientData, XtIntervalId *id ) { XmDragContext dc = (XmDragContext)clientData; dc->drag.dragDropCompletionStatus = XmDROP_FAILURE; dc->drag.dropFinishTime = dc->drag.dragFinishTime; DragDropFinish(dc); } /*ARGSUSED*/ static void FinishAction( XmDragContext dc, XEvent *ev ) { unsigned int state = 0; Arg args[4]; Cardinal i = 0; XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(dc)); dd->display.activeDC = NULL; dd->display.userGrabbed = False; if (ev) { switch(ev->type) { case ButtonRelease: state = ev->xbutton.state; dc->drag.lastChangeTime = ev->xbutton.time; dc->core.x = ev->xbutton.x_root; dc->core.y = ev->xbutton.y_root; break; case KeyPress: state = ev->xkey.state; dc->drag.lastChangeTime = ev->xkey.time; dc->core.x = ev->xkey.x_root; dc->core.y = ev->xkey.y_root; break; } /* * start out with the default operations in effective operations */ dc->drag.lastEventState = state; CalculateDragOperation(dc); } /* * change the dragOver to a window in so it can persist after the * ungrab */ if (dc->drag.curDragOver) { unsigned char currentMode; unsigned char currentActiveMode; XtSetArg(args[0], XmNdragOverMode, ¤tMode); XtSetArg(args[1], XmNdragOverActiveMode, ¤tActiveMode); XtGetValues((Widget) dc->drag.curDragOver, args, 2); i = 0; XtSetArg(args[i], XmNhotX, dc->core.x); i++; XtSetArg(args[i], XmNhotY, dc->core.y); i++; if (currentActiveMode == XmCURSOR || (currentMode != XmDRAG_WINDOW && currentMode != XmWINDOW) ) { XtSetArg(args[i], XmNdragOverMode, XmWINDOW); i++; } XtSetValues((Widget) dc->drag.curDragOver, args, i); XUngrabPointer(XtDisplayOfObject((Widget) dc), dc->drag.lastChangeTime); XtUngrabPointer((Widget) dc, dc->drag.dragFinishTime); XUngrabKeyboard(XtDisplayOfObject((Widget) dc), dc->drag.lastChangeTime); _XmRemoveGrab((Widget)dc); } if (dc->drag.serverGrabbed) XUngrabServer(XtDisplay((Widget) dc)); /* * if we're in pre-register with a non-local raeceiver then we need * to flush a top-level leave to the local dsm. */ dc->drag.dragFinishTime = dc->drag.lastChangeTime; if (dc->drag.inDropSite) { GenerateClientCallback(dc, XmCR_DROP_SITE_LEAVE); dc->drag.inDropSite = False; } if (dc->drag.currReceiverInfo) { if (dc->drag.currReceiverInfo->window) { SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmTOP_LEVEL_LEAVE); GenerateClientCallback(dc, XmCR_TOP_LEVEL_LEAVE); if ((dc->drag.activeProtocolStyle != XmDRAG_NONE) && ((dc->drag.dragCompletionStatus == XmDROP) || (dc->drag.dragCompletionStatus == XmDROP_HELP))) { XtAppContext appContext= XtWidgetToApplicationContext((Widget)dc); /* * we send the leave message in the dragDropFinish so * that a non-local receiver can cleanup its dc */ dc->drag.dragTimerId = XtAppAddTimeOut(appContext, XtAppGetSelectionTimeout(appContext), DropStartTimeout, (XtPointer)dc); SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmDROP_START); } else { dc->drag.dragDropCompletionStatus = XmDROP_FAILURE; dc->drag.dropFinishTime = dc->drag.dragFinishTime; DropStartTimeout((XtPointer)dc, NULL); } } dc->drag.currReceiverInfo->frame = 0; } else { /* Cleanup anyway */ DropStartTimeout((XtPointer)dc, NULL); } } /* ARGSUSED */ static void CheckModifiers( XmDragContext dc, unsigned int state) { unsigned char oldOperation = dc->drag.operation; unsigned char oldOperations = dc->drag.operations; dc->drag.lastEventState = state; CalculateDragOperation(dc); if ((oldOperations != dc->drag.operations) || (oldOperation != dc->drag.operation)) { if ((dc->drag.currReceiverInfo->window) && (dc->drag.activeProtocolStyle != XmDRAG_NONE) && (dc->drag.activeProtocolStyle != XmDRAG_DROP_ONLY)) { SendDragMessage(dc, dc->drag.currReceiverInfo->window, XmOPERATION_CHANGED); } else { GenerateClientCallback(dc, XmCR_OPERATION_CHANGED); } } } /* ARGSUSED */ static void IgnoreButtons( Widget w, XEvent *event, String *params, Cardinal *numParams ) { XmDragContext dc = (XmDragContext)w; /* * the user has pressed some other buttons and caused the server * to synch up. Swallow and continue */ XAllowEvents(XtDisplayOfObject((Widget) dc->drag.srcShell), SyncPointer, dc->drag.lastChangeTime); } /* ARGSUSED */ static void CancelDrag( Widget w, XEvent *event, String *params, Cardinal *numParams ) { XmDragContext dc = (XmDragContext)w; /* * only cancel if drag has not yet completed */ if (dc->drag.dragFinishTime == 0) { dc->drag.dragCompletionStatus = XmDROP_CANCEL; FinishAction(dc, event); } } /* ARGSUSED */ static void HelpDrag( Widget w, XEvent *event, String *params, Cardinal *numParams ) { XmDragContext dc = (XmDragContext)w; dc->drag.dragCompletionStatus = XmDROP_HELP; FinishAction(dc, event); } /* ARGSUSED */ static void FinishDrag( Widget w, XEvent *event, String *params, Cardinal *numParams ) { XmDragContext dc = (XmDragContext)w; dc->drag.dragCompletionStatus = XmDROP; FinishAction(dc, event); } static void noMoreShell( Widget w, XtPointer client, XtPointer call) { Boolean *contAction = (Boolean *)client; *contAction = False; } /*ARGSUSED*/ static void InitiatorMainLoop( XtPointer clientData, XtIntervalId *id ) { XmDragContext *activeDC = (XmDragContext *)clientData; XtAppContext appContext; XEvent event; Widget focusWidget, shell; Boolean contAction = True; if (*activeDC) { appContext = XtWidgetToApplicationContext((Widget) *activeDC); shell = (*activeDC)->drag.srcShell; focusWidget = XmGetFocusWidget((Widget)((*activeDC)->drag.srcShell)); if (_XmGetFocusPolicy(shell) == XmEXPLICIT) { XtSetKeyboardFocus(shell, None); } else { XmFocusData focusData = _XmGetFocusData(shell); if(focusData) focusData->needToFlush = False; /* CR 6384, check for null focusWidget */ if (focusWidget != (Widget) NULL) { if (XmIsPrimitive(focusWidget)) { if (((XmPrimitiveWidgetClass) XtClass(focusWidget)) ->primitive_class.border_unhighlight) (*(((XmPrimitiveWidgetClass) XtClass(focusWidget)) ->primitive_class.border_unhighlight))(focusWidget); } else if (XmIsGadget(focusWidget)) { if (((XmGadgetClass) XtClass(focusWidget)) ->gadget_class.border_unhighlight) (*(((XmGadgetClass) XtClass(focusWidget)) ->gadget_class.border_unhighlight))(focusWidget); } } } DragStartProto(*activeDC); } else return; XtAddCallback (shell, XmNdestroyCallback, noMoreShell, (XtPointer)&contAction); while ( (*activeDC) && (XtAppGetExitFlag(appContext) == False) ) { XmDragContext dc = *activeDC; #ifdef XTHREADS XtInputMask mask; while(!(mask = XtAppPending(appContext))) ; /* busy wait */ if (mask & XtIMXEvent) { #endif XtAppNextEvent(appContext, &event); /* * make sure evil Focus outs don't confuse Xt and cause the * unhighlighting of the source hierarchy. */ switch(event.type) { case FocusIn: case FocusOut: break; case KeyPress: case KeyRelease: case ButtonPress: case ButtonRelease: case EnterNotify: case LeaveNotify: case MotionNotify: { /* dispatch it onto the dc */ switch(dc->drag.trackingMode) { case XmDRAG_TRACK_MOTION: break; #ifdef MULTI_SCREEN_DONE case XmDRAG_TRACK_WM_QUERY: event.xmotion.subwindow = event.xmotion.window; break; #endif /* MULTI_SCREEN_DONE */ case XmDRAG_TRACK_WM_QUERY_PENDING: event.xmotion.subwindow = event.xmotion.window; break; } } event.xmotion.window = XtWindow(dc); break; } if ((event.type == MotionNotify || event.type == LeaveNotify || event.type == EnterNotify) && event.xmotion.state == dc->drag.lastEventState) DragMotion((Widget)dc, &event, NULL, 0); else XtDispatchEvent(&event); #ifdef XTHREADS } else XtAppProcessEvent(appContext, mask); #endif } /* guard against the possibility that shell was destroyed in the last event * loop while the drag operation was going on (e.g. by a timer) */ if (contAction) { XtRemoveCallback (shell, XmNdestroyCallback, noMoreShell, (XtPointer)&contAction); if (_XmGetFocusPolicy(shell) == XmEXPLICIT) { XtSetKeyboardFocus(shell, focusWidget); } } } Widget XmDragStart( Widget w, XEvent *event, ArgList args, Cardinal numArgs ) { XmDragContext dc; XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Arg lclArgs[1]; Arg *mergedArgs; XmDragStartCallbackStruct cb; _XmWidgetToAppContext(w); _XmAppLock(app); if (dd->display.dragInitiatorProtocolStyle == XmDRAG_NONE) { _XmAppUnlock(app); return(NULL); } if (event->type != ButtonPress && event->type != ButtonRelease && event->type != KeyRelease && event->type != KeyPress && event->type != MotionNotify ) { XmeWarning(w, MESSAGE6); _XmAppUnlock(app); return NULL; } cb.reason = XmCR_DRAG_START; cb.event = event; cb.widget = w; cb.doit = True; XtCallCallbackList((Widget)dd, dd->display.dragStartCallback, (XtPointer) &cb); if (!cb.doit) { _XmAppUnlock(app); return NULL; } /* * check if the menu system is already active */ if (dd->display.userGrabbed) { #ifdef DEBUG Warning("can't drag; menu system active\n"); #endif _XmAppUnlock(app); return NULL; } XtSetArg(lclArgs[0], XmNsourceWidget, w); if (numArgs) { mergedArgs = XtMergeArgLists(args, numArgs, lclArgs, 1); } else { mergedArgs = lclArgs; } dc = (XmDragContext) XtCreateWidget("dragContext", xmDragContextClass, (Widget) dd, mergedArgs, numArgs + 1); XtAddCallback(w, XmNdestroyCallback, cancelDrag, (XtPointer)dc); _XmDragStart(dc, w, event); if (numArgs) XtFree( (char *)mergedArgs); _XmAppUnlock(app); return (Widget)dc; } static void DragCancel( XmDragContext dc ) { dc->drag.dragCompletionStatus = XmDROP_CANCEL; FinishAction(dc, NULL); } void XmDragCancel( Widget dragContext ) { _XmWidgetToAppContext(dragContext); _XmAppLock(app); DragCancel((XmDragContext)dragContext); _XmAppUnlock(app); } /*ARGSUSED*/ Boolean XmTargetsAreCompatible( Display *dpy, Atom *exportTargets, Cardinal numExportTargets, Atom *importTargets, Cardinal numImportTargets ) { Cardinal j, k; _XmDisplayToAppContext(dpy); _XmAppLock(app); for (j = 0; j < numExportTargets; j++) for (k = 0; k < numImportTargets; k++) if (exportTargets[j] == importTargets[k]) { _XmAppUnlock(app); return True; } _XmAppUnlock(app); return False; } unsigned char _XmGetActiveProtocolStyle( Widget w ) { unsigned char initiator = XmDRAG_NONE, receiver = XmDRAG_NONE, active = XmDRAG_NONE; XmDragContext dc = (XmDragContext)w; XmDisplay xmDisplay = (XmDisplay)XtParent(dc); initiator = xmDisplay->display.dragInitiatorProtocolStyle; receiver = xmDisplay->display.dragReceiverProtocolStyle; if (!dc->drag.sourceIsExternal) { /* We are the initiator. Find the receiver. */ if (dc->drag.currReceiverInfo) { receiver = dc->drag.currReceiverInfo->dragProtocolStyle; } else { /* * This function is sometimes called before we have * set up the receiver info struct on the dc. In these * cases, we are still in the initiating client, and so * we will use the initiating client's receiver protocol * style. In order to do this we have to emulate the * protocol style decision made in GetDestinationInfo. * But we can't, since we don't really know the shell * widget--the particular shell widget may not have a dnd * property attached to it. * * There are a number of different guesses that we could * make. None of them is substantially better than * not guessing at all. Not guessing only messes up if the * shell really doesn't have any drop sites--we should be * returning NONE, but we might return something else. */ /*EMPTY*/ } active = protocolMatrix[initiator][receiver]; } else { /* We are the receiver, so we can't be preregister. (Since * the receiver doesn't hear about the drag during the drag, * and so get ACTIVE protocol makes no sense.) */ switch(receiver) { case XmDRAG_NONE: active = XmDRAG_NONE; break; case XmDRAG_DROP_ONLY: /* this must be post drop emulation of drag */ case XmDRAG_PREREGISTER: case XmDRAG_DYNAMIC: case XmDRAG_PREFER_DYNAMIC: case XmDRAG_PREFER_PREREGISTER: case XmDRAG_PREFER_RECEIVER: active = XmDRAG_DYNAMIC; break; } } return active; } static void CalculateDragOperation(XmDragContext dc) { /* * Re-set to the initial settings of operation and operations */ dc->drag.operations = dc->drag.dragOperations; if ((dc->drag.lastEventState & ShiftMask) && (dc->drag.lastEventState & ControlMask)) { dc->drag.operations = dc->drag.operation = (unsigned char) (XmDROP_LINK & dc->drag.dragOperations); } else if (dc->drag.lastEventState & ShiftMask) { dc->drag.operations = dc->drag.operation = (unsigned char) (XmDROP_MOVE & dc->drag.dragOperations); } else if (dc->drag.lastEventState & ControlMask) { dc->drag.operations = dc->drag.operation = (unsigned char) (XmDROP_COPY & dc->drag.dragOperations); } else if (XmDROP_MOVE &dc->drag.dragOperations) dc->drag.operation = (unsigned char)XmDROP_MOVE; else if (XmDROP_COPY &dc->drag.dragOperations) dc->drag.operation = (unsigned char)XmDROP_COPY; else if (XmDROP_LINK &dc->drag.dragOperations) dc->drag.operation = (unsigned char)XmDROP_LINK; else { dc->drag.operations = dc->drag.operation = 0; } } motif-2.3.8/lib/Xm/TextF.h0000644000175000017500000001444313145162623012131 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextF_h #define _XmTextF_h #include #ifdef __cplusplus extern "C" { #endif /****************** * type defines * ******************/ typedef struct _XmTextFieldClassRec *XmTextFieldWidgetClass; typedef struct _XmTextFieldRec *XmTextFieldWidget; /****************** * extern class * ******************/ externalref WidgetClass xmTextFieldWidgetClass; /************************ * fast subclass define * ************************/ #ifndef XmIsTextField #define XmIsTextField(w) XtIsSubclass(w, xmTextFieldWidgetClass) #endif /* XmIsTextField */ /******************** * public functions * ********************/ /******** Public Function Declarations ********/ char * XmTextFieldGetString( Widget w); int XmTextFieldGetSubstring( Widget widget, XmTextPosition start, int num_chars, int buf_size, char *buffer); wchar_t * XmTextFieldGetStringWcs( Widget w); int XmTextFieldGetSubstringWcs( Widget widget, XmTextPosition start, int num_chars, int buf_size, wchar_t *buffer); XmTextPosition XmTextFieldGetLastPosition( Widget w); void XmTextFieldSetString( Widget w, char *value); void XmTextFieldSetStringWcs( Widget w, wchar_t *wc_value); void XmTextFieldReplace( Widget w, XmTextPosition from_pos, XmTextPosition to_pos, char *value); void XmTextFieldReplaceWcs( Widget w, XmTextPosition from_pos, XmTextPosition to_pos, wchar_t *wc_value); void XmTextFieldInsert( Widget w, XmTextPosition position, char *value); void XmTextFieldInsertWcs( Widget w, XmTextPosition position, wchar_t *wcstring); void XmTextFieldSetAddMode( Widget w, #if NeedWidePrototypes int state); #else Boolean state); #endif /* NeedWidePrototypes */ Boolean XmTextFieldGetAddMode( Widget w); Boolean XmTextFieldGetEditable( Widget w); void XmTextFieldSetEditable( Widget w, #if NeedWidePrototypes int editable); #else Boolean editable); #endif /* NeedWidePrototypes */ int XmTextFieldGetMaxLength( Widget w); void XmTextFieldSetMaxLength( Widget w, int max_length); XmTextPosition XmTextFieldGetCursorPosition( Widget w); XmTextPosition XmTextFieldGetInsertionPosition( Widget w); void XmTextFieldSetCursorPosition( Widget w, XmTextPosition position); void XmTextFieldSetInsertionPosition( Widget w, XmTextPosition position); Boolean XmTextFieldGetSelectionPosition( Widget w, XmTextPosition *left, XmTextPosition *right); char * XmTextFieldGetSelection( Widget w); wchar_t * XmTextFieldGetSelectionWcs( Widget w); Boolean XmTextFieldRemove( Widget w); Boolean XmTextFieldCopy( Widget w, Time clip_time); Boolean XmTextFieldCopyLink( Widget w, Time clip_time); Boolean XmTextFieldCut( Widget w, Time clip_time); Boolean XmTextFieldPaste( Widget w); Boolean XmTextFieldPasteLink( Widget w); void XmTextFieldClearSelection( Widget w, Time sel_time); void XmTextFieldSetSelection( Widget w, XmTextPosition first, XmTextPosition last, Time sel_time); XmTextPosition XmTextFieldXYToPos( Widget w, #if NeedWidePrototypes int x, int y); #else Position x, Position y); #endif /* NeedWidePrototypes */ Boolean XmTextFieldPosToXY( Widget w, XmTextPosition position, Position *x, Position *y); void XmTextFieldShowPosition( Widget w, XmTextPosition position); void XmTextFieldSetHighlight( Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode); int XmTextFieldGetBaseline( Widget w); Widget XmCreateTextField( Widget parent, char *name, ArgList arglist, Cardinal argcount); Widget XmVaCreateTextField( Widget parent, char *name, ...); Widget XmVaCreateManagedTextField( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextF_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DialogS.h0000644000175000017500000000337013145162623012416 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDialogShell_h #define _XmDialogShell_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsDialogShell #define XmIsDialogShell(w) XtIsSubclass(w, xmDialogShellWidgetClass) #endif /* XmIsDialogShell */ externalref WidgetClass xmDialogShellWidgetClass; typedef struct _XmDialogShellClassRec * XmDialogShellWidgetClass; typedef struct _XmDialogShellRec * XmDialogShellWidget; /******** Public Function Declarations ********/ extern Widget XmCreateDialogShell( Widget p, char *name, ArgList al, Cardinal ac) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDialogShell_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Primitive.h0000644000175000017500000000316412672140200013034 00000000000000/* $XConsortium: Primitive.h /main/5 1995/07/15 20:54:22 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmPrimitive_h #define _XmPrimitive_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsPrimitive #define XmIsPrimitive(w) XtIsSubclass(w, xmPrimitiveWidgetClass) #endif /* XmIsPrimitive */ externalref WidgetClass xmPrimitiveWidgetClass; typedef struct _XmPrimitiveClassRec * XmPrimitiveWidgetClass; typedef struct _XmPrimitiveRec * XmPrimitiveWidget; /******** Public Function Declarations ********/ /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPrimitive_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmImI.h0000644000175000017500000000305412672140200012045 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: XmImI.h /main/5 1995/07/13 18:23:12 drk $ */ #ifndef _XmImI_h #define _XmImI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for XmIm.c ********/ extern void _XmImFreeShellData(Widget w, XtPointer* data); extern void _XmImChangeManaged(Widget vw) ; extern void _XmImRealize(Widget vw) ; extern void _XmImResize(Widget vw) ; extern void _XmImRedisplay(Widget vw) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmImI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconButtonP.h0000644000175000017500000002003412672140200013263 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmIconButtonP_h #define _XmIconButtonP_h /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include #ifdef __cplusplus extern "C" { #endif /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define XmIconButtonIndex (XmPrimitiveIndex + 1) /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ typedef struct { XtPointer extension; /* Just in case we need it later. */ } XmIconButtonClassPart; typedef struct _XmIconButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmIconButtonClassPart icon_class; } XmIconButtonClassRec; typedef struct { /* resources */ String label; /* The label to display. */ Pixmap pixmap; /* The pixmap to display. */ Pixel arm_color; /* The color to arm this widget with. */ XmFontList font_list; /* The font in MOTIF(tm) format. */ XmIconPlacement icon_placement; /* Where to place the icon label. */ Boolean recompute; /* Whether to recompute size every time. */ Boolean set; /* State of the button. */ Boolean armed; /* Armed value for button. */ Dimension v_space; /* The amount of space between the edges */ Dimension h_space; /* of the widget and the picture/text. */ Dimension icon_text_padding; /* padding between the icon and the text. */ XtCallbackList activate_callback; /* Called when I am selected */ XtCallbackList double_click_callback; /* Called when I am 2 clicked. */ /* * Added in 1.2 for I18N. */ XmString label_string; /* The label stored as an XmString. */ unsigned char string_direction; unsigned char alignment; /* private state */ Position pix_x, pix_y; /* Location of the pixmap. */ /* public state */ Dimension pix_width, pix_height; /* size of the pixmap. */ Dimension pix_depth; /* Depth of the pixmap. */ /* private state */ Position text_x, text_y; /* Location to begin drawing text. */ Dimension max_text_width; /* maximum space the text can take up. */ Dimension max_text_height; /* maximum vertical space for the text */ XtIntervalId unset_timer; /* The arm and activate timer. */ GC gc; /* The graphics context. */ GC fill_gc; /* The gc for filling on the arm. */ GC pixmap_fill_gc; /* The gc for drawing the pixmap when the button is filled. */ GC stippled_text_gc; /* GC to use stippling text. */ GC stippled_set_text_gc; /* GC to use for stip. text in a set button. */ GC stippled_set_gc; /* GC to use for images when toggle is set. */ GC stippled_unset_gc; /* GC to use for images when toggle is unset.*/ Time time; /* The server time of the last button click. */ Boolean label_from_name; Boolean check_set_render_table; #ifdef FIX_1381 GC shadow_gc; /* GC to use shadow for text. */ #endif } XmIconButtonPart; #define XmIconButton_label(w) (((XmIconButtonWidget)(w))->icon.label) #define XmIconButton_pixmap(w) (((XmIconButtonWidget)(w))->icon.pixmap) #define XmIconButton_arm_color(w) (((XmIconButtonWidget)(w))->icon.arm_color) #define XmIconButton_font_list(w) (((XmIconButtonWidget)(w))->icon.font_list) #define XmIconButton_icon_placement(w) (((XmIconButtonWidget)(w))->icon.icon_placement) #define XmIconButton_recompute(w) (((XmIconButtonWidget)(w))->icon.recompute) #define XmIconButton_set(w) (((XmIconButtonWidget)(w))->icon.set) #define XmIconButton_armed(w) (((XmIconButtonWidget)(w))->icon.armed) #define XmIconButton_v_space(w) (((XmIconButtonWidget)(w))->icon.v_space) #define XmIconButton_h_space(w) (((XmIconButtonWidget)(w))->icon.h_space) #define XmIconButton_icon_text_padding(w) (((XmIconButtonWidget)(w))->icon.icon_text_padding) #define XmIconButton_activate_callback(w) (((XmIconButtonWidget)(w))->icon.activate_callback) #define XmIconButton_double_click_callback(w) (((XmIconButtonWidget)(w))->icon.double_click_callback) #define XmIconButton_label_string(w) (((XmIconButtonWidget)(w))->icon.label_string) #define XmIconButton_string_direction(w) (((XmIconButtonWidget)(w))->icon.string_direction) #define XmIconButton_alignment(w) (((XmIconButtonWidget)(w))->icon.alignment) #define XmIconButton_pix_x(w) (((XmIconButtonWidget)(w))->icon.pix_x) #define XmIconButton_pix_y(w) (((XmIconButtonWidget)(w))->icon.pix_y) #define XmIconButton_pix_width(w) (((XmIconButtonWidget)(w))->icon.pix_width) #define XmIconButton_pix_height(w) (((XmIconButtonWidget)(w))->icon.pix_height) #define XmIconButton_pix_depth(w) (((XmIconButtonWidget)(w))->icon.pix_depth) #define XmIconButton_text_x(w) (((XmIconButtonWidget)(w))->icon.text_x) #define XmIconButton_text_y(w) (((XmIconButtonWidget)(w))->icon.text_y) #define XmIconButton_max_text_width(w) (((XmIconButtonWidget)(w))->icon.max_text_width) #define XmIconButton_max_text_height(w) (((XmIconButtonWidget)(w))->icon.max_text_height) #define XmIconButton_unset_timer(w) (((XmIconButtonWidget)(w))->icon.unset_timer) #define XmIconButton_gc(w) (((XmIconButtonWidget)(w))->icon.gc) #define XmIconButton_fill_gc(w) (((XmIconButtonWidget)(w))->icon.fill_gc) #define XmIconButton_pixmap_fill_gc(w) (((XmIconButtonWidget)(w))->icon.pixmap_fill_gc) #define XmIconButton_stippled_text_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_text_gc) #ifdef FIX_1381 #define XmIconButton_insensitive_text_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_text_gc) #endif #define XmIconButton_stippled_set_text_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_set_text_gc) #define XmIconButton_stippled_set_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_set_gc) #define XmIconButton_stippled_unset_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_unset_gc) #define XmIconButton_time(w) (((XmIconButtonWidget)(w))->icon.time) #define XmIconButton_label_from_name(w) (((XmIconButtonWidget)(w))->icon.label_from_name) #ifdef FIX_1381 #define XmIconButton_shadow_gc(w) (((XmIconButtonWidget)(w))->icon.shadow_gc) #endif typedef struct _XmIconButtonRec { CorePart core; XmPrimitivePart primitive; XmIconButtonPart icon; } XmIconButtonRec; /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ extern XmIconButtonClassRec xmIconButtonClassRec; /************************************************************ * STATIC DECLARATIONS *************************************************************/ #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif void _XmPrimitiveEnter( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; void _XmPrimitiveLeave( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; #endif /* _XmIconButtonP_h */ motif-2.3.8/lib/Xm/ButtonBox.h0000644000175000017500000000664012672140200013012 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * Resources: * * --------------------------------------------------------------------------- * Name Class Type InitialValue * --------------------------------------------------------------------------- * * equalSize EqualSize Boolean False * fillOption FillOption XmFillOption XmFillNone * marginHeight Margin Dimension 0 * marginWidth Margin Dimension 0 * orientation Orientation unsigned char XmHORIZONTAL * * --------------------------------------------------------------------------- * */ #ifndef _XmButtonBox_h #define _XmButtonBox_h #if defined(VMS) || defined(__VMS) #include #endif #include /************************************************************ * INCLUDE FILES ************************************************************/ /************************************************************ * TYPEDEFS AND DEFINES ************************************************************/ #if defined(__cplusplus) extern "C" { #endif typedef struct _XmButtonBoxClassRec *XmButtonBoxWidgetClass; typedef struct _XmButtonBoxRec *XmButtonBoxWidget; /************************************************************ * MACROS ************************************************************/ /************************************************************ * GLOBAL DECLARATIONS ************************************************************/ /************************************************************ * EXTERNAL DECLARATIONS ************************************************************/ /* Function Name: XmCreateButtonBox * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateButtonBox( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); /* * Variable argument list functions */ extern Widget XmVaCreateButtonBox( Widget parent, char *name, ...); extern Widget XmVaCreateManagedButtonBox( Widget parent, char *name, ...); extern WidgetClass xmButtonBoxWidgetClass; #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmButtonBox_h */ motif-2.3.8/lib/Xm/RCLayoutI.h0000644000175000017500000000566712672140200012711 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: RCLayoutI.h /main/5 1995/07/13 17:44:58 drk $ */ #ifndef _XmRCLayoutI_h #define _XmRCLayoutI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmRCDoMarginAdjustment( XmRowColumnWidget m) ; extern void _XmRCThinkAboutSize( register XmRowColumnWidget m, Dimension *w, Dimension *h, Widget instigator, XtWidgetGeometry *request) ; extern void _XmRCPreferredSize( XmRowColumnWidget m, Dimension *w, Dimension *h) ; extern void _XmRCAdaptToSize( XmRowColumnWidget m, Widget instigator, XtWidgetGeometry *request) ; extern XmRCKidGeometry _XmRCGetKidGeo( Widget wid, Widget instigator, XtWidgetGeometry *request, int uniform_border, #if NeedWidePrototypes int border, #else Dimension border, #endif /* NeedWidePrototypes */ int uniform_width_margins, int uniform_height_margins, Widget help, Widget toc, int geo_type) ; extern void _XmRCSetKidGeo( XmRCKidGeometry kg, Widget instigator) ; extern void _XmRC_SetOrGetTextMargins( Widget wid, #if NeedWidePrototypes unsigned int op, #else unsigned char op, #endif /* NeedWidePrototypes */ XmBaselineMargins *textMargins) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRCLayoutI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextSelI.h0000644000175000017500000000363512672140200012570 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: TextSelI.h /main/5 1995/07/13 18:10:00 drk $ */ #ifndef _XmTextSelI_h #define _XmTextSelI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern Boolean _XmTextConvert( Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format, Widget dc, XEvent *event) ; extern void _XmTextLoseSelection( Widget w, Atom *selection) ; extern Widget _XmTextGetDropReciever( Widget w) ; extern void _XmTextInstallTransferTrait(void); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextSelI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStrDefsI.ht0000644000175000017500000000046712672140200013243 00000000000000/* $TOG: XmStrDefsI.ht /main/1 1997/06/18 17:50:36 samborn $ */ #ifndef _XmStrDefsI_h_ #define _XmStrDefsI_h_ #include #ifdef __cplusplus extern "C" { #endif <<>> #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs_h_ */ motif-2.3.8/lib/Xm/SelectioB.c0000644000175000017500000017727213145162623012755 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: SelectioB.c /main/19 1997/06/18 17:42:11 samborn $" #endif #endif /*------------------------------------------------------------------------- ** ** include files ** **------------------------------------------------------------------------- */ #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BulletinBI.h" #include "GeoUtilsI.h" #include "GMUtilsI.h" #include "ManagerI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "SelectioBI.h" #include "TransferI.h" #include "XmI.h" #include "XmStringI.h" #define WARN_DIALOG_TYPE_CHANGE _XmMMsgSelectioB_0001 #define WARN_CHILD_TYPE _XmMMsgSelectioB_0002 #define MESSAGE0 _XmMMsgMotif_0001 #define defaultTextAccelerators _XmSelectioB_defaultTextAccelerators #define IsButton(w) \ (((XtPointer) XmeTraitGet((XtPointer) XtClass((w)), XmQTactivatable) != NULL)) #define IsAutoButton(sb, w) ( \ w == SB_OkButton(sb) || \ w == SB_ApplyButton(sb) || \ w == SB_CancelButton(sb) || \ w == SB_HelpButton(sb)) #define SetupWorkArea(sb) \ if (_XmGeoSetupKid (boxPtr, SB_WorkArea(sb))) \ { \ layoutPtr->space_above = vspace; \ vspace = BB_MarginHeight(sb); \ boxPtr += 2 ; \ ++layoutPtr ; \ } /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass w_class) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void InsertChild( Widget child) ; static void DeleteChild( Widget child) ; static void _XmDialogTypeDefault( Widget widget, int offset, XrmValue *value) ; static XmImportOperator _XmSetSyntheticResForChild( Widget widget, int offset, XtArgVal *value) ; static void SelectionBoxCallback( Widget w, XtPointer client_data, XtPointer call_data) ; static void ListCallback( Widget w, XtPointer client_data, XtPointer call_data) ; static void UpdateString( Widget w, XmString string, #if NeedWidePrototypes int direction) ; #else XmStringDirection direction) ; #endif /* NeedWidePrototypes */ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; /******** End Static Function Declarations ********/ static XtAccelerators defaultTextAcceleratorsParsed; /* Action list */ static XtActionsRec actionsList[] = { { "UpOrDown", _XmSelectionBoxUpOrDown }, /* Motif 1.0 */ { "SelectionBoxUpOrDown", _XmSelectionBoxUpOrDown }, { "SelectionBoxRestore", _XmSelectionBoxRestore }, }; /* Resource definitions for SelectionBox */ static XmSyntheticResource syn_resources[] = { { XmNselectionLabelString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.selection_label_string), _XmSelectionBoxGetSelectionLabelString, _XmSetSyntheticResForChild }, { XmNlistLabelString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_label_string), _XmSelectionBoxGetListLabelString, _XmSetSyntheticResForChild }, { XmNtextColumns, sizeof(short), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.text_columns), _XmSelectionBoxGetTextColumns, NULL }, { XmNtextString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.text_string), _XmSelectionBoxGetTextString, _XmSetSyntheticResForChild }, { XmNlistItems, sizeof (XmStringTable), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_items), _XmSelectionBoxGetListItems, _XmSetSyntheticResForChild }, { XmNlistItemCount, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_item_count), _XmSelectionBoxGetListItemCount, _XmSetSyntheticResForChild }, { XmNlistVisibleItemCount, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_visible_item_count), _XmSelectionBoxGetListVisibleItemCount, _XmSetSyntheticResForChild }, { XmNokLabelString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.ok_label_string), _XmSelectionBoxGetOkLabelString, NULL }, { XmNapplyLabelString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.apply_label_string), _XmSelectionBoxGetApplyLabelString, NULL }, { XmNcancelLabelString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.cancel_label_string), _XmSelectionBoxGetCancelLabelString, NULL }, { XmNhelpLabelString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.help_label_string), _XmSelectionBoxGetHelpLabelString, NULL }, }; static XtResource resources[] = { { XmNtextAccelerators, XmCAccelerators, XmRAcceleratorTable, sizeof (XtAccelerators), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.text_accelerators), XmRImmediate, NULL }, { XmNselectionLabelString, XmCSelectionLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.selection_label_string), XmRString, NULL }, { XmNlistLabelString, XmCListLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_label_string), XmRString, NULL }, { XmNtextColumns, XmCColumns, XmRShort, sizeof(short), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.text_columns), XmRImmediate, (XtPointer) 20 }, { XmNtextString, XmCTextString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.text_string), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNlistItems, XmCItems, XmRXmStringTable, sizeof (XmStringTable), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_items), XmRImmediate, NULL }, { XmNlistItemCount, XmCItemCount, XmRInt, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_item_count), XmRImmediate, (XtPointer) XmUNSPECIFIED_COUNT }, { XmNlistVisibleItemCount, XmCVisibleItemCount, XmRInt, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_visible_item_count), XmRImmediate, (XtPointer) 8 }, { XmNokLabelString, XmCOkLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.ok_label_string), XmRString, NULL }, { XmNapplyLabelString, XmCApplyLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.apply_label_string), XmRString, NULL }, { XmNcancelLabelString, XmCCancelLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.cancel_label_string), XmRString, NULL }, { XmNhelpLabelString, XmCHelpLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.help_label_string), XmRString, NULL }, { XmNnoMatchCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.no_match_callback), XmRImmediate, (XtPointer) NULL }, { XmNmustMatch, XmCMustMatch, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.must_match), XmRImmediate, (XtPointer) False }, { XmNminimizeButtons, XmCMinimizeButtons, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.minimize_buttons), XmRImmediate, (XtPointer) False }, { XmNokCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.ok_callback), XmRImmediate, (XtPointer) NULL }, { XmNapplyCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.apply_callback), XmRImmediate, (XtPointer) NULL }, { XmNcancelCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.cancel_callback), XmRImmediate, (XtPointer) NULL }, { XmNdialogType, XmCDialogType, XmRSelectionType, sizeof (unsigned char), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.dialog_type), XmRCallProc, (XtPointer) _XmDialogTypeDefault }, { XmNchildPlacement, XmCChildPlacement, XmRChildPlacement, sizeof (unsigned char), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.child_placement), XmRImmediate, (XtPointer) XmPLACE_ABOVE_SELECTION }, }; externaldef( xmselectionboxclassrec) XmSelectionBoxClassRec xmSelectionBoxClassRec = { { /* superclass */ (WidgetClass) &xmBulletinBoardClassRec, /* class_name */ "XmSelectionBox", /* widget_size */ sizeof(XmSelectionBoxRec), /* class_initialize */ ClassInitialize, /* chained class init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress enter/exit*/ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ XtInheritResize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_offsets */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ XtInheritGeometryManager, /* display_accelerator*/ NULL, /* extension */ NULL, }, { /* composite class record */ /* childrens geo mgr proc */ XtInheritGeometryManager, /* set changed proc */ XtInheritChangeManaged, /* insert_child */ InsertChild, /* delete_child */ DeleteChild, /* extension */ NULL, }, { /* constraint class record */ /* no additional resources */ NULL, /* num additional resources */ 0, /* size of constraint rec */ 0, /* constraint_initialize */ NULL, /* constraint_destroy */ NULL, /* constraint_setvalue */ NULL, /* extension */ NULL, }, { /* manager class record */ XmInheritTranslations, /* default translations */ syn_resources, /* syn_resources */ XtNumber (syn_resources), /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* bulletin board class record */ TRUE, /*always_install_accelerators*/ _XmSelectionBoxGeoMatrixCreate, /* geo_matrix_create */ XmInheritFocusMovedProc, /* focus_moved_proc */ NULL, /* extension */ }, { /* selection box class record */ ListCallback, /* list_callback */ NULL, /* extension */ }, }; externaldef( xmselectionboxwidgetclass) WidgetClass xmSelectionBoxWidgetClass = (WidgetClass) &xmSelectionBoxClassRec ; /****************************************************************/ static void ClassInitialize( void ) { /****************/ /* parse the default translation and accelerator tables */ defaultTextAcceleratorsParsed = XtParseAcceleratorTable( defaultTextAccelerators) ; return ; } /****************************************************************/ static void ClassPartInitialize( WidgetClass w_class ) { /****************/ XmSelectionBoxWidgetClass wc = (XmSelectionBoxWidgetClass) w_class; XmSelectionBoxWidgetClass super = (XmSelectionBoxWidgetClass) wc->core_class.superclass; if (wc->selection_box_class.list_callback == XmInheritCallbackProc) wc->selection_box_class.list_callback = super->selection_box_class.list_callback; _XmFastSubclassInit(w_class, XmSELECTION_BOX_BIT) ; return ; } /**************************************************************** * Create a SelectionBox instance. ****************/ /*ARGSUSED*/ static void Initialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmSelectionBoxWidget new_w = (XmSelectionBoxWidget) nw ; /****************/ new_w->selection_box.work_area = NULL; if ( new_w->selection_box.text_accelerators == NULL ) { new_w->selection_box.text_accelerators = defaultTextAcceleratorsParsed; } /* Validate dialog type. */ if( !XmRepTypeValidValue( XmRID_SELECTION_TYPE, new_w->selection_box.dialog_type, (Widget) new_w) ) { new_w->selection_box.dialog_type = XmIsDialogShell( XtParent( new_w)) ? XmDIALOG_SELECTION : XmDIALOG_WORK_AREA ; } /* Validate child placement. */ if( !XmRepTypeValidValue( XmRID_CHILD_PLACEMENT, new_w->selection_box.child_placement, (Widget) new_w) ) { new_w->selection_box.child_placement = XmPLACE_ABOVE_SELECTION; } /* Create child widgets. Here we have now to take care of XmUNSPECIFIED (CR 4856). */ new_w->selection_box.adding_sel_widgets = True; if ( (new_w->selection_box.dialog_type != XmDIALOG_PROMPT) && (new_w->selection_box.dialog_type != XmDIALOG_COMMAND) ) { if (new_w->selection_box.list_label_string == (XmString) XmUNSPECIFIED) { new_w->selection_box.list_label_string = NULL ; _XmSelectionBoxCreateListLabel( new_w) ; new_w->selection_box.list_label_string = (XmString) XmUNSPECIFIED ; } else _XmSelectionBoxCreateListLabel( new_w) ; } else { SB_ListLabel (new_w) = NULL; } if (new_w->selection_box.list_label_string != (XmString) XmUNSPECIFIED) new_w->selection_box.list_label_string = NULL ; if (new_w->selection_box.dialog_type != XmDIALOG_PROMPT) { _XmSelectionBoxCreateList( new_w) ; } else { SB_List (new_w) = NULL; } new_w->selection_box.list_items = NULL ; new_w->selection_box.list_item_count = XmUNSPECIFIED_COUNT ; if (new_w->selection_box.selection_label_string == (XmString) XmUNSPECIFIED) { new_w->selection_box.selection_label_string = NULL ; _XmSelectionBoxCreateSelectionLabel(new_w); new_w->selection_box.selection_label_string = (XmString) XmUNSPECIFIED ; } else { _XmSelectionBoxCreateSelectionLabel(new_w); new_w->selection_box.selection_label_string = NULL ; } _XmSelectionBoxCreateText(new_w); /* Do not reset text_string to XmUNSPECIFIED until after calls * to CreateList and CreateText. */ new_w->selection_box.text_string = (XmString) XmUNSPECIFIED ; if( new_w->manager.initial_focus == NULL ) { new_w->manager.initial_focus = SB_Text( new_w) ; } if (new_w->selection_box.dialog_type != XmDIALOG_COMMAND) { _XmSelectionBoxCreateSeparator (new_w); _XmSelectionBoxCreateOkButton (new_w); if (new_w->selection_box.apply_label_string == (XmString) XmUNSPECIFIED) { new_w->selection_box.apply_label_string = NULL ; _XmSelectionBoxCreateApplyButton (new_w); new_w->selection_box.apply_label_string = (XmString) XmUNSPECIFIED ; } else _XmSelectionBoxCreateApplyButton (new_w); _XmSelectionBoxCreateCancelButton (new_w); _XmSelectionBoxCreateHelpButton (new_w); BB_DefaultButton( new_w) = SB_OkButton( new_w) ; _XmBulletinBoardSetDynDefaultButton( (Widget) new_w, BB_DefaultButton( new_w)) ; } else { SB_Separator (new_w) = NULL; SB_OkButton (new_w) = NULL; SB_ApplyButton (new_w) = NULL; SB_CancelButton (new_w) = NULL; SB_HelpButton (new_w) = NULL; } new_w->selection_box.ok_label_string = NULL ; if (new_w->selection_box.apply_label_string != (XmString) XmUNSPECIFIED) new_w->selection_box.apply_label_string = NULL ; new_w->selection_box.cancel_label_string = NULL ; new_w->selection_box.help_label_string = NULL ; new_w->selection_box.adding_sel_widgets = False; XtManageChildren (new_w->composite.children, new_w->composite.num_children) ; if (new_w->selection_box.dialog_type == XmDIALOG_PROMPT || new_w->selection_box.dialog_type == XmDIALOG_WORK_AREA) { XtUnmanageChild (SB_ApplyButton (new_w)); } } /**************************************************************** * Selection widget supports ONE child. This routine * handles adding a child to selection widget ****************/ static void InsertChild( Widget child ) { XmSelectionBoxWidget sb ; /****************/ XtWidgetProc insert_child; /* Use the dialog class insert proc to do all the dirty work */ _XmProcessLock(); insert_child = ((XmBulletinBoardWidgetClass) xmBulletinBoardWidgetClass) ->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(child) ; if( !XtIsRectObj( child) ) { return ; } sb = (XmSelectionBoxWidget) XtParent( child) ; /* check if this child is to be the selection widget's work area widget */ if( !sb->selection_box.adding_sel_widgets && !XtIsShell( child) ) { if( !sb->selection_box.work_area ) { sb->selection_box.work_area = child ; } } return ; } /**************************************************************** * Remove child from selection widget ****************/ static void DeleteChild( Widget child ) { XmSelectionBoxWidget sel ; XtWidgetProc delete_child; /****************/ if( XtIsRectObj( child) ) { sel = (XmSelectionBoxWidget) XtParent( child) ; /* Clear widget fields (BulletinBoard does default and cancel). */ if( child == SB_ListLabel (sel) ) { SB_ListLabel( sel) = NULL ; } else { if( SB_List( sel) && (child == XtParent( SB_List (sel))) ) { SB_List( sel) = NULL ; } else { if( child == SB_SelectionLabel (sel) ) { SB_SelectionLabel( sel) = NULL ; } else { if( child == SB_Text (sel) ) { SB_Text( sel) = NULL ; } else { if( child == SB_WorkArea (sel) ) { SB_WorkArea( sel) = NULL ; } else { if( child == SB_Separator (sel) ) { SB_Separator( sel) = NULL ; } else { if( child == SB_OkButton (sel) ) { SB_OkButton( sel) = NULL ; } else { if( child == SB_ApplyButton (sel) ) { SB_ApplyButton( sel) = NULL ; } else { if( child == SB_HelpButton (sel) ) { SB_HelpButton( sel) = NULL ; } } } } } } } } } } _XmProcessLock(); delete_child = ((XmBulletinBoardWidgetClass) xmBulletinBoardWidgetClass) ->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)( child) ; return ; } /**************************************************************** * Set the default type (selection or workarea) based on parent. ****************/ /*ARGSUSED*/ static void _XmDialogTypeDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { static unsigned char type; /****************/ /* * Set the default type. To do this, we check the dialog * box's parent. If it is a DialogShell widget, then this * is a "pop-up" dialog box, and the default type is selection. * Else the default type is workarea. */ type = XmDIALOG_WORK_AREA; if (XmIsDialogShell (XtParent (widget))) type = XmDIALOG_SELECTION; value->addr = (XPointer)(&type); return ; } /*ARGSUSED*/ static XmImportOperator _XmSetSyntheticResForChild( Widget widget, /* unused */ int offset, /* unused */ XtArgVal *value) /* unused */ { return XmSYNTHETIC_LOAD; } /**************************************************************** * Create the Label displayed above the List widget. ****************/ void _XmSelectionBoxCreateListLabel( XmSelectionBoxWidget sel ) { /****************/ SB_ListLabel( sel) = _XmBB_CreateLabelG( (Widget) sel, sel->selection_box.list_label_string, "Items", XmItemsStringLoc) ; return ; } /**************************************************************** * Create the Label displayed above the Text widget. ****************/ void _XmSelectionBoxCreateSelectionLabel( XmSelectionBoxWidget sel ) { /****************/ if (sel->selection_box.dialog_type == XmDIALOG_COMMAND) SB_SelectionLabel(sel) = _XmBB_CreateLabelG((Widget)sel, sel->selection_box.selection_label_string, "Selection", XmPromptStringLoc); else SB_SelectionLabel( sel) = _XmBB_CreateLabelG( (Widget) sel, sel->selection_box.selection_label_string, "Selection", XmSelectionStringLoc) ; } /**************************************************************** * Create the List widget. ****************/ void _XmSelectionBoxCreateList( XmSelectionBoxWidget sel ) { Arg al[20] ; register int ac = 0 ; int * position ; int pos_count ; XtCallbackProc callbackProc ; /****************/ if( sel->selection_box.list_items ) { XtSetArg( al[ac], XmNitems, sel->selection_box.list_items) ; ac++ ; } if( sel->selection_box.list_item_count != XmUNSPECIFIED ) { XtSetArg( al[ac], XmNitemCount, sel->selection_box.list_item_count) ; ac++ ; } XtSetArg( al[ac], XmNvisibleItemCount, sel->selection_box.list_visible_item_count) ; ac++ ; sel->selection_box.list_selected_item_position = 0 ; XtSetArg( al[ac], XmNstringDirection, SB_StringDirection (sel)) ; ac++ ; XtSetArg( al[ac], XmNselectionPolicy, XmBROWSE_SELECT) ; ac++ ; XtSetArg( al[ac], XmNlistSizePolicy, XmCONSTANT) ; ac++ ; XtSetArg( al[ac], XmNnavigationType, XmSTICKY_TAB_GROUP) ; ++ac ; SB_List( sel) = XmCreateScrolledList( (Widget) sel, "ItemsList", al, ac) ; if( sel->selection_box.text_string != (XmString) XmUNSPECIFIED ) { if( sel->selection_box.text_string && XmListGetMatchPos( SB_List( sel), sel->selection_box.text_string, &position, &pos_count) ) { if( pos_count ) { sel->selection_box.list_selected_item_position = position[0] ; XmListSelectPos( SB_List( sel), position[0], FALSE) ; } XtFree( (char *) position) ; } } callbackProc = ((XmSelectionBoxWidgetClass) sel->core.widget_class) ->selection_box_class.list_callback ; if( callbackProc ) { XtAddCallback( SB_List( sel), XmNsingleSelectionCallback, callbackProc, (XtPointer) sel) ; XtAddCallback( SB_List( sel), XmNbrowseSelectionCallback, callbackProc, (XtPointer) sel) ; XtAddCallback( SB_List( sel), XmNdefaultActionCallback, callbackProc, (XtPointer) sel) ; } XtManageChild( SB_List( sel)) ; return ; } /**************************************************************** * Create the Text widget. ****************/ void _XmSelectionBoxCreateText( XmSelectionBoxWidget sel ) { Arg al[10]; register int ac = 0; String text_value ; XtAccelerators temp_accelerators ; /****************/ XtSetArg (al[ac], XmNcolumns, sel->selection_box.text_columns); ac++; XtSetArg (al[ac], XmNresizeWidth, False); ac++; XtSetArg (al[ac], XmNeditMode, XmSINGLE_LINE_EDIT); ac++; XtSetArg( al[ac], XmNnavigationType, XmSTICKY_TAB_GROUP) ; ++ac ; SB_Text( sel) = XmCreateTextField( (Widget) sel, "Text", al, ac); if( (sel->selection_box.text_string != (XmString) XmUNSPECIFIED) ) { text_value = _XmStringGetTextConcat( sel->selection_box.text_string) ; XmTextFieldSetString( SB_Text (sel), text_value) ; if( text_value ) { XmTextFieldSetInsertionPosition( SB_Text( sel), XmTextFieldGetLastPosition( SB_Text( sel))) ; } XtFree( (char *) text_value) ; } /* Install text accelerators. */ temp_accelerators = sel->core.accelerators; sel->core.accelerators = sel->selection_box.text_accelerators; XtInstallAccelerators( SB_Text( sel), (Widget) sel) ; sel->core.accelerators = temp_accelerators; return ; } /**************************************************************** * Create the Separator displayed above the buttons. ****************/ void _XmSelectionBoxCreateSeparator( XmSelectionBoxWidget sel ) { Arg al[10]; register int ac = 0; /****************/ XtSetArg (al[ac], XmNhighlightThickness, 0); ac++; SB_Separator (sel) = XmCreateSeparatorGadget( (Widget) sel, "Separator", al, ac); return ; } /**************************************************************** * Create the "OK" PushButton. ****************/ void _XmSelectionBoxCreateOkButton( XmSelectionBoxWidget sel ) { /****************/ SB_OkButton( sel) = _XmBB_CreateButtonG( (Widget) sel, sel->selection_box.ok_label_string, "OK", XmOkStringLoc) ; XtAddCallback (SB_OkButton (sel), XmNactivateCallback, SelectionBoxCallback, (XtPointer) XmDIALOG_OK_BUTTON) ; return ; } /**************************************************************** * Create the "Apply" PushButton. ****************/ void _XmSelectionBoxCreateApplyButton( XmSelectionBoxWidget sel ) { /****************/ SB_ApplyButton( sel) = _XmBB_CreateButtonG( (Widget) sel, sel->selection_box.apply_label_string, "Apply", XmApplyStringLoc) ; /* Remove BulletinBoard Unmanage callback from apply and help buttons. */ XtRemoveAllCallbacks( SB_ApplyButton( sel), XmNactivateCallback) ; XtAddCallback (SB_ApplyButton (sel), XmNactivateCallback, SelectionBoxCallback, (XtPointer) XmDIALOG_APPLY_BUTTON) ; return ; } /**************************************************************** * Create the "Cancel" PushButton. ****************/ void _XmSelectionBoxCreateCancelButton( XmSelectionBoxWidget sel ) { /****************/ SB_CancelButton( sel) = _XmBB_CreateButtonG( (Widget) sel, sel->selection_box.cancel_label_string, "Cancel", XmCancelStringLoc) ; XtAddCallback( SB_CancelButton( sel), XmNactivateCallback, SelectionBoxCallback, (XtPointer) XmDIALOG_CANCEL_BUTTON) ; return ; } /**************************************************************** * Create the "Help" PushButton. ****************/ void _XmSelectionBoxCreateHelpButton( XmSelectionBoxWidget sel ) { /****************/ SB_HelpButton( sel) = _XmBB_CreateButtonG( (Widget) sel, sel->selection_box.help_label_string, "Help", XmHelpStringLoc) ; /* Remove BulletinBoard Unmanage callback from apply and help buttons. */ XtRemoveAllCallbacks( SB_HelpButton( sel), XmNactivateCallback) ; XtAddCallback (SB_HelpButton (sel), XmNactivateCallback, SelectionBoxCallback, (XtPointer) XmDIALOG_HELP_BUTTON) ; return ; } /****************************************************************/ XmGeoMatrix _XmSelectionBoxGeoMatrixCreate( Widget wid, Widget instigator, XtWidgetGeometry *desired ) { XmSelectionBoxWidget sb = (XmSelectionBoxWidget) wid ; XmGeoMatrix geoSpec ; register XmGeoRowLayout layoutPtr ; register XmKidGeometry boxPtr ; XmKidGeometry firstButtonBox ; XmListWidget list ; Boolean listLabelBox ; Boolean selLabelBox ; Dimension vspace = BB_MarginHeight(sb); int i; /* * Layout SelectionBox XmGeoMatrix. * Each row is terminated by leaving an empty XmKidGeometry and * moving to the next XmGeoRowLayout. */ geoSpec = _XmGeoMatrixAlloc( XmSB_MAX_WIDGETS_VERT, sb->composite.num_children, 0) ; geoSpec->composite = (Widget) sb ; geoSpec->instigator = (Widget) instigator ; if( desired ) { geoSpec->instig_request = *desired ; } geoSpec->margin_w = BB_MarginWidth( sb) + sb->manager.shadow_thickness ; geoSpec->margin_h = BB_MarginHeight( sb) + sb->manager.shadow_thickness ; geoSpec->no_geo_request = _XmSelectionBoxNoGeoRequest ; layoutPtr = &(geoSpec->layouts->row) ; boxPtr = geoSpec->boxes ; /* menu bar */ for (i = 0; i < sb->composite.num_children; i++) { Widget w = sb->composite.children[i]; if( XmIsRowColumn(w) && ((XmRowColumnWidget)w)->row_column.type == XmMENU_BAR && w != SB_WorkArea(sb) && _XmGeoSetupKid( boxPtr, w) ) { layoutPtr->fix_up = _XmMenuBarFix ; boxPtr += 2; ++layoutPtr; vspace = 0; /* fixup space_above of next row. */ break; } } /* work area, XmPLACE_TOP */ if (sb->selection_box.child_placement == XmPLACE_TOP) SetupWorkArea(sb); /* list box label */ listLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, SB_ListLabel( sb)) ) { listLabelBox = TRUE ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(sb); boxPtr += 2 ; ++layoutPtr ; } /* list box */ list = (XmListWidget) SB_List( sb) ; if( list && XtIsManaged((Widget)list) && _XmGeoSetupKid( boxPtr, XtParent( list)) ) { if( !listLabelBox ) { layoutPtr->space_above = vspace; vspace = BB_MarginHeight(sb); } layoutPtr->stretch_height = TRUE ; layoutPtr->min_height = 70 ; boxPtr += 2 ; ++layoutPtr ; } /* work area, XmPLACE_ABOVE_SELECTION */ if (sb->selection_box.child_placement == XmPLACE_ABOVE_SELECTION) SetupWorkArea(sb) /* selection label */ selLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, SB_SelectionLabel( sb)) ) { selLabelBox = TRUE ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(sb); boxPtr += 2 ; ++layoutPtr ; } /* selection text */ if( _XmGeoSetupKid( boxPtr, SB_Text( sb)) ) { if( !selLabelBox ) { layoutPtr->space_above = vspace; vspace = BB_MarginHeight(sb); } boxPtr += 2 ; ++layoutPtr ; } /* work area, XmPLACE_BELOW_SELECTION */ if (sb->selection_box.child_placement == XmPLACE_BELOW_SELECTION) SetupWorkArea(sb) /* separator */ if( _XmGeoSetupKid( boxPtr, SB_Separator( sb)) ) { layoutPtr->fix_up = _XmSeparatorFix ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(sb); boxPtr += 2 ; ++layoutPtr ; } /* button row */ firstButtonBox = boxPtr ; if (LayoutIsRtoLM(sb)) { if( _XmGeoSetupKid( boxPtr, SB_HelpButton( sb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_CancelButton( sb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_ApplyButton( sb)) ) { ++boxPtr ; } for (i = 0; i < sb->composite.num_children; i++) { Widget w = sb->composite.children[sb->composite.num_children-i-1]; if (IsButton(w) && !IsAutoButton(sb,w) && w != SB_WorkArea(sb)) { if (_XmGeoSetupKid( boxPtr, w)) { ++boxPtr ; } } } if( _XmGeoSetupKid( boxPtr, SB_OkButton( sb)) ) { ++boxPtr ; } } else { if( _XmGeoSetupKid( boxPtr, SB_OkButton( sb)) ) { ++boxPtr ; } for (i = 0; i < sb->composite.num_children; i++) { Widget w = sb->composite.children[i]; if (IsButton(w) && !IsAutoButton(sb,w) && w != SB_WorkArea(sb)) { if (_XmGeoSetupKid( boxPtr, w)) { ++boxPtr ; } } } if( _XmGeoSetupKid( boxPtr, SB_ApplyButton( sb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_CancelButton( sb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_HelpButton( sb)) ) { ++boxPtr ; } } if( boxPtr != firstButtonBox ) { layoutPtr->fill_mode = XmGEO_CENTER ; layoutPtr->fit_mode = XmGEO_WRAP ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(sb); if( !(sb->selection_box.minimize_buttons) ) { layoutPtr->even_width = 1 ; } layoutPtr->even_height = 1 ; ++layoutPtr ; } /* the end. */ layoutPtr->space_above = vspace; layoutPtr->end = TRUE ; return( geoSpec) ; } /****************************************************************/ Boolean _XmSelectionBoxNoGeoRequest( XmGeoMatrix geoSpec ) { /****************/ if( BB_InSetValues( geoSpec->composite) && (XtClass( geoSpec->composite) == xmSelectionBoxWidgetClass) ) { return( TRUE) ; } return( FALSE) ; } /**************************************************************** * Call the callbacks for a SelectionBox button. ****************/ static void SelectionBoxCallback( Widget w, XtPointer client_data, XtPointer call_data ) { unsigned char which_button = (unsigned char)(long) client_data; XmSelectionBoxWidget sel = (XmSelectionBoxWidget) XtParent (w); XmAnyCallbackStruct *callback = (XmAnyCallbackStruct *) call_data; XmSelectionBoxCallbackStruct temp; Boolean match = True; String text_value; /****************/ text_value = XmTextFieldGetString (SB_Text (sel)); temp.event = callback->event; temp.value = XmStringGenerate(text_value, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); temp.length = XmStringLength (temp.value); XtFree (text_value); switch (which_button) { case XmDIALOG_OK_BUTTON: if (sel->selection_box.list != NULL) if (sel->selection_box.must_match) { match = XmListItemExists (SB_List (sel), temp.value); } if (!match) { temp.reason = XmCR_NO_MATCH; XtCallCallbackList ((Widget) sel, sel-> selection_box.no_match_callback, &temp); } else { temp.reason = XmCR_OK; XtCallCallbackList ((Widget) sel, sel-> selection_box.ok_callback, &temp); } break; case XmDIALOG_APPLY_BUTTON: temp.reason = XmCR_APPLY; XtCallCallbackList ((Widget) sel, sel->selection_box.apply_callback, &temp); break; case XmDIALOG_CANCEL_BUTTON: temp.reason = XmCR_CANCEL; XtCallCallbackList ((Widget) sel, sel->selection_box.cancel_callback, &temp); break; case XmDIALOG_HELP_BUTTON: /* Invoke the help system. */ _XmManagerHelp((Widget)sel, callback->event, NULL, NULL) ; break; } XmStringFree( temp.value) ; return ; } /**************************************************************** * Process callback from the List in a SelectionBox. ****************/ static void ListCallback( Widget w, XtPointer client_data, XtPointer call_data ) { enum { XmA_MOTIF_SELECTION_TEXT, XmA_MOTIF_COMPOUND_STRING, XmACOMPOUND_TEXT, NUM_ATOMS }; static char *atom_names[] = { XmI_MOTIF_SELECTION_TEXT, XmS_MOTIF_COMPOUND_STRING, XmSCOMPOUND_TEXT }; XmListCallbackStruct *callback = (XmListCallbackStruct *) call_data; XmSelectionBoxWidget sel = (XmSelectionBoxWidget) client_data ; XmGadgetClass gadget_class; XmGadget dbutton = (XmGadget) BB_DynamicDefaultButton( sel) ; XmAccessTextualTrait textTrait; Atom atoms[XtNumber(atom_names)]; Atom PRIMARY = XA_PRIMARY; XtPointer value; Atom type; unsigned long size; int format; Boolean success; textTrait = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(SB_Text(sel)), XmQTaccessTextual); if (textTrait == NULL) return; /* Abort if text child is broken */ assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* Update the text widget to relect the latest list selection. * If list default action (double click), activate default button. */ sel->selection_box.list_selected_item_position = callback->item_position; success = False; /* * Obtain item. * * We do this via the selection mechanism by calling * _XmConvertHandler directly. First we call with * the target _MOTIF_SELECTION_TEXT, then we fallback * to using _MOTIF_COMPOUND_STRING if no reply is obtained */ _XmConvertHandlerSetLocal(); success = _XmConvertHandler(w, &PRIMARY, &atoms[XmA_MOTIF_SELECTION_TEXT], &type, &value, &size, &format); if (! success) { _XmConvertHandlerSetLocal(); success = _XmConvertHandler(w, &PRIMARY, &atoms[XmA_MOTIF_COMPOUND_STRING], &type, &value, &size, &format); } if (success) { if (type == atoms[XmA_MOTIF_COMPOUND_STRING]) { XmString temp; temp = XmCvtByteStreamToXmString((unsigned char *) value); textTrait -> setValue(SB_Text(sel), temp, XmFORMAT_XmSTRING); XmStringFree(temp); } else if (type == atoms[XmACOMPOUND_TEXT]) { XmString temp; temp = XmCvtCTToXmString((char*) value); textTrait -> setValue(SB_Text(sel), value, XmFORMAT_XmSTRING); XmStringFree(temp); } else if (type == XA_STRING) { textTrait -> setValue(SB_Text(sel), value, XmFORMAT_MBYTE); } } if(success) { XmTextFieldSetInsertionPosition(SB_Text (sel), XmTextFieldGetLastPosition( SB_Text( sel))) ; XtFree((char*) value); } /* Catch only double-click default action here. * Key press events are handled through the ParentProcess routine. */ if( (callback->reason == XmCR_DEFAULT_ACTION) && (callback->event->type != KeyPress) && dbutton && XtIsManaged((Widget)dbutton) && XtIsSensitive((Widget)dbutton) && XmIsGadget( dbutton) ) { gadget_class = (XmGadgetClass) dbutton->object.widget_class ; if (gadget_class->gadget_class.arm_and_activate) { /* pass the event so that the button can pass it on to its ** callbacks, even though the event isn't within the button */ (*(gadget_class->gadget_class.arm_and_activate)) ((Widget) dbutton, callback->event, NULL, NULL) ; } } return ; } /**************************************************************** * Set the label string of a label or button ****************/ static void UpdateString( Widget w, XmString string, #if NeedWidePrototypes int direction ) #else XmStringDirection direction ) #endif /* NeedWidePrototypes */ { Arg al[3]; register int ac = 0; /****************/ if (w) { XtSetArg (al[ac], XmNstringDirection, direction); ac++; XtSetArg (al[ac], XmNlabelString, string); ac++; XtSetValues (w, al, ac); } return ; } /**************************************************************** * Update widget when values change. ****************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmSelectionBoxWidget current = (XmSelectionBoxWidget) cw ; XmSelectionBoxWidget request = (XmSelectionBoxWidget) rw ; XmSelectionBoxWidget new_w = (XmSelectionBoxWidget) nw ; Arg al[10]; register int ac; String text_value ; /****************/ BB_InSetValues (new_w) = True; /* Validate child placement. */ if( (new_w->selection_box.child_placement != current->selection_box.child_placement) && !XmRepTypeValidValue( XmRID_CHILD_PLACEMENT, new_w->selection_box.child_placement, (Widget) new_w) ) { new_w->selection_box.child_placement = current->selection_box.child_placement; } /* Update label strings. */ if( new_w->selection_box.selection_label_string != current->selection_box.selection_label_string ) { UpdateString( SB_SelectionLabel (new_w), new_w->selection_box.selection_label_string, SB_StringDirection (new_w)) ; new_w->selection_box.selection_label_string = NULL ; } if( new_w->selection_box.list_label_string != current->selection_box.list_label_string ) { UpdateString( SB_ListLabel (new_w), new_w->selection_box.list_label_string, SB_StringDirection (new_w)) ; new_w->selection_box.list_label_string = NULL ; } if( new_w->selection_box.ok_label_string != current->selection_box.ok_label_string ) { UpdateString( SB_OkButton (new_w), new_w->selection_box.ok_label_string, SB_StringDirection (new_w)) ; new_w->selection_box.ok_label_string = NULL ; } if( new_w->selection_box.apply_label_string != current->selection_box.apply_label_string ) { UpdateString( SB_ApplyButton (new_w), new_w->selection_box.apply_label_string, SB_StringDirection (new_w)) ; new_w->selection_box.apply_label_string = NULL ; } if( new_w->selection_box.cancel_label_string != current->selection_box.cancel_label_string ) { UpdateString( SB_CancelButton (new_w), new_w->selection_box.cancel_label_string, SB_StringDirection (new_w)) ; new_w->selection_box.cancel_label_string = NULL ; } if( new_w->selection_box.help_label_string != current->selection_box.help_label_string ) { UpdateString( SB_HelpButton (new_w), new_w->selection_box.help_label_string, SB_StringDirection (new_w)) ; new_w->selection_box.help_label_string = NULL ; } /* Update List widget. */ ac = 0; if( new_w->selection_box.list_items ) { XtSetArg( al[ac], XmNitems, new_w->selection_box.list_items) ; ac++ ; } if( new_w->selection_box.list_item_count != XmUNSPECIFIED_COUNT ) { XtSetArg( al[ac], XmNitemCount, new_w->selection_box.list_item_count) ; ac++ ; new_w->selection_box.list_item_count = XmUNSPECIFIED_COUNT ; } if (new_w->selection_box.list_visible_item_count != current->selection_box.list_visible_item_count) { XtSetArg (al[ac], XmNvisibleItemCount, new_w->selection_box.list_visible_item_count); ac++; } if (ac) { if (SB_List (new_w)) XtSetValues (SB_List (new_w), al, ac); new_w->selection_box.list_items = NULL ; } /* Update Text widget. */ text_value = NULL ; ac = 0; if( new_w->selection_box.text_string != current->selection_box.text_string ) { text_value = _XmStringGetTextConcat( new_w->selection_box.text_string) ; XtSetArg( al[ac], XmNvalue, text_value) ; ac++ ; new_w->selection_box.text_string = (XmString) XmUNSPECIFIED ; } if (new_w->selection_box.text_columns != current->selection_box.text_columns) { XtSetArg (al[ac], XmNcolumns, new_w->selection_box.text_columns); ac++; } if (ac) { if (SB_Text (new_w)) XtSetValues (SB_Text (new_w), al, ac); } if (text_value) { if (SB_Text (new_w)) XmTextFieldSetInsertionPosition (SB_Text (new_w), XmTextFieldGetLastPosition( SB_Text( new_w))) ; XtFree (text_value); } /* Validate dialog type. */ if (request->selection_box.dialog_type != current->selection_box.dialog_type) { XmeWarning( (Widget) new_w, WARN_DIALOG_TYPE_CHANGE); new_w->selection_box.dialog_type = current->selection_box.dialog_type; } BB_InSetValues (new_w) = False; /* If this is the instantiated class then do layout. */ if( XtClass( new_w) == xmSelectionBoxWidgetClass ) { _XmBulletinBoardSizeUpdate( (Widget) new_w) ; } return (Boolean) (FALSE); } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetSelectionLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; XmString data ; Arg al[1] ; /****************/ if( SB_SelectionLabel (sel) ) { XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( SB_SelectionLabel( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetListLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; XmString data ; Arg al[1] ; /****************/ if( SB_ListLabel( sel) ) { XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( SB_ListLabel( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetTextColumns( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; short data ; Arg al[1] ; /****************/ if( SB_Text( sel) ) { XtSetArg( al[0], XmNcolumns, &data) ; XtGetValues( SB_Text( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) 0 ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetTextString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; String data = NULL ; XmString text_string ; Arg al[1] ; /****************/ if( SB_Text( sel) ) { XtSetArg( al[0], XmNvalue, &data) ; XtGetValues( SB_Text( sel), al, 1) ; text_string = XmStringGenerate(data, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; *value = (XtArgVal) text_string ; XtFree((char *)data); } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetListItems( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; Arg al[1] ; XmString data ; /****************/ if( SB_List( sel) ) { XtSetArg( al[0], XmNitems, &data) ; XtGetValues( SB_List( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetListItemCount( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; int data ; Arg al[1] ; /****************/ if( SB_List( sel) ) { XtSetArg( al[0], XmNitemCount, &data) ; XtGetValues( SB_List( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) 0 ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetListVisibleItemCount( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; int data ; Arg al[1] ; /****************/ if( SB_List( sel) ) { XtSetArg( al[0], XmNvisibleItemCount, &data) ; XtGetValues( SB_List( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) 0 ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetOkLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; XmString data ; Arg al[1] ; /****************/ if( SB_OkButton( sel) ) { XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( SB_OkButton( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetApplyLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; XmString data ; Arg al[1] ; /****************/ if( SB_ApplyButton( sel) ) { XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( SB_ApplyButton( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetCancelLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; XmString data ; Arg al[1] ; /****************/ if( SB_CancelButton( sel) ) { XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( SB_CancelButton( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxGetHelpLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; XmString data ; Arg al[1] ; /****************/ if( SB_HelpButton( sel) ) { XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( SB_HelpButton( sel), al, 1) ; *value = (XtArgVal) data ; } else { *value = (XtArgVal) NULL ; } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxUpOrDown( Widget wid, XEvent *event, /* unused */ String *argv, Cardinal *argc ) { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; int visible ; int top ; int key_pressed ; Widget list ; int * position ; int count ; Arg av[5] ; Cardinal ac ; /****************/ if (!argc || (*argc != 1) || !argv) { XmeWarning(wid, MESSAGE0); return; } if( !(list = sel->selection_box.list) ) { return ; } ac = 0 ; XtSetArg( av[ac], XmNitemCount, &count) ; ++ac ; XtSetArg( av[ac], XmNtopItemPosition, &top) ; ++ac ; XtSetArg( av[ac], XmNvisibleItemCount, &visible) ; ++ac ; XtGetValues( list, av, ac) ; if( !count ) { return ; } if (_XmConvertActionParamToRepTypeId((Widget) sel, XmRID_SELECTION_BOX_UP_OR_DOWN_ACTION_PARAMS, argv[0], True, &key_pressed) == False) { /* We couldn't convert the value. Just assume a value of 0. */ key_pressed = 0; } position = &(sel->selection_box.list_selected_item_position) ; if( *position == 0 ) { /* No selection, so select first item or last if key_pressed == end. */ if( key_pressed == 3 ) { *position = count ; XmListSelectPos( list, *position, True) ; } else { XmListSelectPos( list, ++*position, True) ; } } else { if( !key_pressed && (*position > 1) ) { /* up */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, --*position, True) ; } else { if( (key_pressed == 1) && (*position < count) ) { /* down */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, ++*position, True) ; } else { if( key_pressed == 2 ) { /* home */ XmListDeselectPos( list, *position) ; *position = 1 ; XmListSelectPos( list, *position, True) ; } else { if( key_pressed == 3 ) { /* end */ XmListDeselectPos( list, *position) ; *position = count ; XmListSelectPos( list, *position, True) ; } } } } } if( top > *position ) { XmListSetPos( list, *position) ; } else { if( (top + visible) <= *position ) { XmListSetBottomPos( list, *position) ; } } return ; } /****************************************************************/ /*ARGSUSED*/ void _XmSelectionBoxRestore( Widget wid, XEvent *event, /* unused */ String *argv, /* unused */ Cardinal *argc ) /* unused */ { XmSelectionBoxWidget sel = (XmSelectionBoxWidget) wid ; Widget list ; int count ; XmString * items ; Arg al[5] ; int ac ; String textItem ; /****************/ list = SB_List( sel) ; if( list && SB_Text( sel) ) { ac = 0 ; XtSetArg( al[ac], XmNselectedItems, &items) ; ++ac ; XtSetArg( al[ac], XmNselectedItemCount, &count) ; ++ac ; XtGetValues( list, al, ac) ; if( count ) { textItem = _XmStringGetTextConcat( *items) ; XmTextFieldSetString( SB_Text( sel), textItem) ; XmTextFieldSetInsertionPosition( SB_Text( sel), XmTextFieldGetLastPosition( SB_Text( sel))) ; XtFree( textItem) ; } else { XmTextFieldSetString( SB_Text( sel), NULL) ; } } return ; } /**************************************************************** * This function returns the widget id of a SelectionBox child widget. ****************/ Widget XmSelectionBoxGetChild( Widget sb, #if NeedWidePrototypes unsigned int which ) #else unsigned char which ) #endif /* NeedWidePrototypes */ { /****************/ Widget child = NULL; _XmWidgetToAppContext(sb); _XmAppLock(app); switch (which) { case XmDIALOG_LIST: child = SB_List (sb); break; case XmDIALOG_LIST_LABEL: child = SB_ListLabel (sb); break; case XmDIALOG_SELECTION_LABEL: child = SB_SelectionLabel (sb); break; case XmDIALOG_WORK_AREA: child = SB_WorkArea (sb); break; case XmDIALOG_TEXT: child = SB_Text (sb); break; case XmDIALOG_SEPARATOR: child = SB_Separator (sb); break; case XmDIALOG_OK_BUTTON: child = SB_OkButton (sb); break; case XmDIALOG_APPLY_BUTTON: child = SB_ApplyButton (sb); break; case XmDIALOG_CANCEL_BUTTON: child = SB_CancelButton (sb); break; case XmDIALOG_HELP_BUTTON: child = SB_HelpButton (sb); break; case XmDIALOG_DEFAULT_BUTTON: child = SB_DefaultButton (sb); break; default: XmeWarning( (Widget) sb, WARN_CHILD_TYPE); break; } _XmAppUnlock(app); return (child); } /**************************************************************** * This function creates and returns a SelectionBox widget. ****************/ Widget XmCreateSelectionBox( Widget p, String name, ArgList args, Cardinal n ) { return (XtCreateWidget (name, xmSelectionBoxWidgetClass, p, args, n)); } Widget XmVaCreateSelectionBox( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSelectionBoxWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedSelectionBox( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSelectionBoxWidgetClass, parent, True, var, count); va_end(var); return w; } /**************************************************************** * This convenience function creates a DialogShell and a SelectionBox * child of the shell; returns the SelectionBox widget. ****************/ Widget XmCreateSelectionDialog( Widget ds_p, String name, ArgList sb_args, Cardinal sb_n ) { ArgList _sb_args; /* arglist for sb */ Widget w; /* allocate arglist, copy args, add dialog type arg */ _sb_args = (ArgList) XtMalloc (sizeof (Arg) * (sb_n + 1)); memcpy(_sb_args, sb_args, sizeof (Arg) * sb_n); XtSetArg (_sb_args[sb_n], XmNdialogType, XmDIALOG_SELECTION); sb_n++; /* create SelectionBoxDialog, free args, return */ w = XmeCreateClassDialog (xmSelectionBoxWidgetClass, ds_p, name, _sb_args, sb_n) ; XtFree((char *)_sb_args); return w ; } /**************************************************************** * This convenience function creates a DialogShell and a SelectionBox * child of the shell; returns the SelectionBox widget. ****************/ Widget XmCreatePromptDialog( Widget ds_p, String name, ArgList sb_args, Cardinal sb_n ) { ArgList _sb_args; /* arglist for sb */ Widget w; /* allocate arglist, copy args, add dialog type arg */ _sb_args = (ArgList) XtMalloc (sizeof (Arg) * (sb_n + 1)); memcpy(_sb_args, sb_args, sizeof (Arg) * sb_n); XtSetArg (_sb_args[sb_n], XmNdialogType, XmDIALOG_PROMPT); sb_n++; /* create SelectionBoxDialog, free args, return */ w = XmeCreateClassDialog (xmSelectionBoxWidgetClass, ds_p, name, _sb_args, sb_n) ; XtFree((char*)_sb_args); return w ; } motif-2.3.8/lib/Xm/TextFSel.c0000644000175000017500000014424313145162623012572 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TextFSel.c /main/22 1997/10/14 15:38:30 cshi $" #endif #endif #include #include #include #include /* for XmeTraitSet() */ #include #include #include #include "TextFI.h" #include "TextFSelI.h" #include "TransferI.h" /* for _XmConvertComplete() */ #include "TraversalI.h" /* for _XmGetFocusPolicy() */ #include "XmI.h" /******** Static Function Declarations ********/ static void InsertSelection( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid) ; static void HandleInsertTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid); static void HandleDrop(Widget w, XmDropProcCallbackStruct *cb, XmDestinationCallbackStruct *ds); static void TextFieldConvertCallback(Widget, XtPointer, XmConvertCallbackStruct*); static void TextFieldDestinationCallback(Widget, XtPointer, XmDestinationCallbackStruct*); static void SetDropContext(Widget w); static void DeleteDropContext(Widget w); static void HandleTargets(Widget w, XtPointer ignore, XmSelectionCallbackStruct *ds); static void HandleDrop(Widget w, XmDropProcCallbackStruct *cb, XmDestinationCallbackStruct *ds); static void DropDestroyCB(Widget w, XtPointer clientData, XtPointer callData); static void DropTransferProc(Widget w, XtPointer ignore, XmSelectionCallbackStruct *ds); static void DoStuff(Widget w, XtPointer ignore, XmSelectionCallbackStruct *ds); /******** End Static Function Declarations ********/ /* Transfer Trait record for TextField */ static XmConst XmTransferTraitRec textFieldTT = { 0, /* version */ (XmConvertCallbackProc) TextFieldConvertCallback, (XmDestinationCallbackProc) TextFieldDestinationCallback, (XmDestinationCallbackProc) NULL, }; static XContext _XmTextFDNDContext = 0; static _XmInsertSelect insert_select; static _XmTextPrimSelect *prim_select; /*ARGSUSED*/ static void SetPrimarySelection(Widget w, XtEnum op, /* unused */ XmTransferDoneCallbackStruct *ts) /* unused */ { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos = tf->text.cursor_position; _XmProcessLock(); if (!prim_select) { _XmProcessUnlock(); return; } if (prim_select->num_chars > 0) { tf->text.prim_anchor = prim_select->position; cursorPos = prim_select->position + prim_select->num_chars; _XmTextFieldStartSelection(tf, tf->text.prim_anchor, cursorPos, prim_select->time); tf->text.pending_off = False; _XmTextFieldSetCursorPosition(tf, NULL, cursorPos, True, True); } if (--prim_select->ref_count == 0) { XtFree((char *)prim_select); prim_select = NULL; } _XmProcessUnlock(); } /*ARGSUSED*/ static void CleanPrimarySelection(Widget w, XtEnum op, /* unused */ XmTransferDoneCallbackStruct *ts) /* unused */ { _XmProcessLock(); if (!prim_select) { _XmProcessUnlock(); return; } if (--prim_select->ref_count == 0) { XtFree((char *)prim_select); prim_select = NULL; } _XmProcessUnlock(); } static void TextFieldSecondaryWrapper(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds) { Atom XA_TARGETS = XInternAtom(XtDisplay(w), XmSTARGETS, False); if (ds -> target == XA_TARGETS) HandleInsertTargets(w, closure, &(ds -> selection), &(ds -> type), ds -> value, &(ds -> length), &(ds -> format), ds -> transfer_id); else InsertSelection(w, closure, &(ds -> selection), &(ds -> type), ds -> value, &(ds -> length), &(ds -> format), ds -> transfer_id); } /* ARGSUSED */ static void InsertSelection( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid) { _XmInsertSelect *insert_select = (_XmInsertSelect *) closure; XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition left = 0; XmTextPosition right = 0; Boolean replace_res = False; Boolean dest_disjoint = False; wchar_t * wc_value; char * temp; int num_chars = 0; Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), XmSCOMPOUND_TEXT, False); Atom UTF8_STRING = XInternAtom(XtDisplay(w), XmSUTF8_STRING, False); char * total_value = NULL; XmAnyCallbackStruct cb; if (!value) { insert_select->done_status = True; return; } /* Don't do replace if there is not text to add */ if (*(char *) value == (char)'\0' || *length == 0){ XtFree((char *)value); insert_select->done_status = True; return; } if (insert_select->select_type == XmPRIM_SELECT) { if (!tf->text.has_primary || tf->text.prim_pos_left == tf->text.prim_pos_right) { XBell(XtDisplay(w), 0); XtFree((char *)value); insert_select->done_status = True; insert_select->success_status = False; return; } } else if (insert_select->select_type == XmDEST_SELECT) { if (tf->text.has_primary && (left = tf->text.prim_pos_left) != (right = tf->text.prim_pos_right)) { if ( TextF_CursorPosition(tf) < left || TextF_CursorPosition(tf) > right || !tf->text.pending_delete) { left = right = TextF_CursorPosition(tf); dest_disjoint = True; } } else left = right = TextF_CursorPosition(tf); } if (*type == COMPOUND_TEXT || *type == XA_STRING || *type == UTF8_STRING) { total_value = _XmTextToLocaleText(w, value, *type, *format, *length, NULL); if (total_value) { if (tf->text.max_char_size == 1) { num_chars = strlen(total_value); replace_res = _XmTextFieldReplaceText(tf, (XEvent *)insert_select->event, left, right, total_value, num_chars, True); } else { /* must convert to wchar_t before passing to Replace */ int len = strlen(total_value) + 1; wc_value = (wchar_t *)XtMalloc((unsigned) len * sizeof(wchar_t)); num_chars = mbstowcs(wc_value, total_value, len); if (num_chars < 0) num_chars = 0; else replace_res = _XmTextFieldReplaceText(tf, (XEvent *)insert_select->event, left, right, (char*) wc_value, num_chars, True); XtFree((char *)wc_value); } XtFree(total_value); } } else { /* it must be either TEXT or codeset of the locale */ if (tf->text.max_char_size == 1) { /* NOTE: casting *length could result in a truncated long. */ num_chars = *length; replace_res = _XmTextFieldReplaceText(tf, (XEvent *)insert_select->event, left, right, (char *)value, (unsigned)*length, True); } else { temp = XtMalloc((unsigned) *length + 1); /* NOTE: casting *length could result in a truncated long. */ (void)memcpy((void*)temp, (void*)value, (size_t)*length); temp[*length] = '\0'; wc_value = (wchar_t*)XtMalloc((unsigned) (*length + 1) * sizeof(wchar_t)); /* NOTE: casting *length could result in a truncated long. */ num_chars = mbstowcs(wc_value, temp, (unsigned)*length + 1); if (num_chars < 0) num_chars = 0; else replace_res = _XmTextFieldReplaceText(tf, (XEvent *)insert_select->event, left, right, (char*) wc_value, num_chars, True); XtFree(temp); XtFree((char *)wc_value); } } if (!replace_res) { insert_select->success_status = False; } else { insert_select->success_status = True; if (!tf->text.add_mode) tf->text.prim_anchor = left; tf->text.pending_off = True; _XmTextFieldSetCursorPosition(tf, NULL, left + num_chars, False, True); (void) _XmTextFieldSetDestination(w, TextF_CursorPosition(tf), insert_select->event->time); if (insert_select->select_type == XmDEST_SELECT) { if (left != right) { if (!dest_disjoint || !tf->text.add_mode) { _XmTextFieldStartSelection(tf, TextF_CursorPosition(tf), TextF_CursorPosition(tf), insert_select->event->time); } } } cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *)insert_select->event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } XtFree((char *)value); value = NULL; insert_select->done_status = True; } /* ARGSUSED */ static void HandleInsertTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format, XtPointer tid ) { enum { XmATEXT, XmACOMPOUND_TEXT, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmSTEXT, XmSCOMPOUND_TEXT, XmSUTF8_STRING }; _XmInsertSelect *insert_select = (_XmInsertSelect *) closure; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); Atom target; Atom *atom_ptr; Boolean supports_encoding_data = False; Boolean supports_CT = False; Boolean supports_text = False; Boolean supports_utf8_string = False; int i; if (0 == *length) { XtFree((char *)value); insert_select->done_status = True; return; /* Supports no targets, so don't bother sending anything */ } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); atom_ptr = (Atom *)value; for (i = 0; i < *length; i++, atom_ptr++) { if (*atom_ptr == atoms[XmATEXT]) supports_text = True; if (*atom_ptr == CS_OF_ENCODING) supports_encoding_data = True; if (*atom_ptr == atoms[XmACOMPOUND_TEXT]) supports_CT = True; #ifdef UTF8_SUPPORTED if (*atom_ptr == atoms[XmAUTF8_STRING]) supports_utf8_string = True; #endif } if (supports_text && supports_encoding_data) target = atoms[XmATEXT]; else if (supports_CT) target = atoms[XmACOMPOUND_TEXT]; #ifdef UTF8_SUPPORTED else if (supports_utf8_string) target = atoms[XmAUTF8_STRING]; #endif else if (supports_encoding_data) target = CS_OF_ENCODING; else target = XA_STRING; XmTransferValue(tid, target, (XtCallbackProc) TextFieldSecondaryWrapper, closure, insert_select -> event -> time); } /* ARGSUSED */ Boolean _XmTextFieldConvert( Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format, Widget drag_context, XEvent *event) { enum { XmA_MOTIF_DESTINATION, XmAINSERT_SELECTION, XmADELETE, XmATARGETS, XmATEXT, XmACOMPOUND_TEXT, XmATIMESTAMP, XmA_MOTIF_DROP, XmACLIPBOARD, XmANULL, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DESTINATION, XmSINSERT_SELECTION, XmSDELETE, XmSTARGETS, XmSTEXT, XmSCOMPOUND_TEXT, XmSTIMESTAMP, XmS_MOTIF_DROP, XmSCLIPBOARD, XmSNULL, XmSUTF8_STRING }; XmTextFieldWidget tf; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); XSelectionRequestEvent * req_event = (XSelectionRequestEvent *) event; Boolean has_selection = False; XmTextPosition left = 0; XmTextPosition right = 0; Boolean is_primary; Boolean is_secondary; Boolean is_destination; Boolean is_drop; int target_count = 0; XTextProperty tmp_prop; char *tmp_value; int ret_status = 0; Time _time; XmAnyCallbackStruct cb; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); if (req_event == NULL) _time = XtLastTimestampProcessed(XtDisplay(w)); else _time = req_event -> time; tf = (XmTextFieldWidget) w; if (tf == NULL) return False; if (*selection == XA_PRIMARY || *selection == atoms[XmACLIPBOARD]) { has_selection = tf->text.has_primary; left = tf->text.prim_pos_left; right = tf->text.prim_pos_right; is_primary = True; is_secondary = is_destination = is_drop = False; } else if (*selection == atoms[XmA_MOTIF_DESTINATION]) { has_selection = tf->text.has_destination; is_destination = True; is_secondary = is_primary = is_drop = False; } else if (*selection == XA_SECONDARY) { has_selection = tf->text.has_secondary; left = tf->text.sec_pos_left; right = tf->text.sec_pos_right; is_secondary = True; is_destination = is_primary = is_drop = False; } else if (*selection == atoms[XmA_MOTIF_DROP]) { has_selection = tf->text.has_primary; left = tf->text.prim_pos_left; right = tf->text.prim_pos_right; is_drop = True; is_destination = is_primary = is_secondary = False; } else { return False; } /* * TARGETS identifies what targets the textfield widget can * provide data for. */ if (*target == atoms[XmATARGETS]) { Atom *targs = XmeStandardTargets(w, 10, &target_count); *value = (XtPointer) targs; if (XA_STRING != CS_OF_ENCODING) { targs[target_count] = CS_OF_ENCODING; target_count++; } if (is_primary || is_destination) { targs[target_count] = atoms[XmAINSERT_SELECTION]; target_count++; } if (is_primary || is_secondary || is_drop) { targs[target_count] = atoms[XmACOMPOUND_TEXT]; target_count++; targs[target_count] = atoms[XmATEXT]; target_count++; targs[target_count] = XA_STRING; target_count++; targs[target_count] = atoms[XmAUTF8_STRING]; target_count++; } if (is_primary || is_drop) { targs[target_count] = atoms[XmADELETE]; target_count++; } *type = XA_ATOM; *length = target_count; *format = 32; } else if (*target == atoms[XmATIMESTAMP]) { Time *timestamp; timestamp = (Time *) XtMalloc(sizeof(Time)); if (is_primary) *timestamp = tf->text.prim_time; else if (is_destination) *timestamp = tf->text.dest_time; else if (is_secondary) *timestamp = tf->text.sec_time; else if (is_drop) *timestamp = tf->text.prim_time; *value = (XtPointer) timestamp; *type = XA_INTEGER; *length = sizeof(Time) / 4; *format = 32; } else if (*target == XA_STRING) { *type = (Atom) XA_STRING; *format = 8; if (is_destination || !has_selection) return False; /* put a char* value into tmp_value, then convert to 8859.1 */ if (tf->text.max_char_size != 1) { int stat ; /* NOTE: casting (right - left) could result in a truncated long. */ *length = _XmTextFieldCountBytes(tf, TextF_WcValue(tf) + left, (int)(right - left)); tmp_value = XtMalloc((unsigned) *length + 1); stat = wcstombs(tmp_value, TextF_WcValue(tf) + left, (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ if (stat < 0) /* wcstombs will return neg value on conv failure */ *length = 0; else *length = (unsigned long) stat ; } else { *length = right - left; tmp_value = XtMalloc((unsigned) *length + 1); /* get the selection value */ (void)memcpy((void*)tmp_value, (void*)(TextF_Value(tf) + left), (size_t)*length); /* NOTE: casting *length could result in a truncated long. */ } tmp_value[*length] = '\0'; tmp_prop.value = NULL; /* convert tmp_value to 8859.1 */ ret_status = XmbTextListToTextProperty(XtDisplay(w), &tmp_value, 1, (XICCEncodingStyle)XStringStyle, &tmp_prop); XtFree(tmp_value); if (ret_status == Success || ret_status > 0){ *value = (XtPointer) tmp_prop.value; *length = tmp_prop.nitems; } else { *value = NULL; *length = 0; return False; } } else if (*target == atoms[XmATEXT] || *target == CS_OF_ENCODING) { *type = CS_OF_ENCODING; *format = 8; if (is_destination || !has_selection) return False; if (tf->text.max_char_size != 1) { int stat ; /* NOTE: casting (right - left) could result in a truncated long. */ *length = _XmTextFieldCountBytes(tf, TextF_WcValue(tf) + left, (int)(right - left)); *value = XtMalloc((unsigned) *length + 1); stat = wcstombs((char *)*value, TextF_WcValue(tf) + left, (unsigned)*length); /* NOTE: casting *length could result in a truncated long */ if (stat < 0) /* wcstombs return neg value on conv failure */ *length = 0; else *length = (unsigned long) stat ; } else { *length = right - left; *value = XtMalloc((unsigned) *length + 1); /* get the selection value */ (void)memcpy((void*)*value, (void*)(TextF_Value(tf) + left), (size_t)*length); /* NOTE: casting *length could result in a truncated long. */ } (*(char **)value)[*length]='\0'; } else if (*target == atoms[XmACOMPOUND_TEXT]) { *type = atoms[XmACOMPOUND_TEXT]; *format = 8; if (is_destination || !has_selection) return False; if (tf->text.max_char_size != 1) { int stat ; /* convert to char* before converting to CT. NOTE: casting * (right - left) could result in a truncated long. */ *length = _XmTextFieldCountBytes(tf, TextF_WcValue(tf) + left, (int)(right - left)); tmp_value = XtMalloc((unsigned) *length + 1); stat = wcstombs(tmp_value, TextF_WcValue(tf) + left, (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ if (stat < 0) /* wcstombs will return neg value on conv failure */ *length = 0; else *length = (unsigned long) stat ; } else { /* malloc the space and copy the data to be converted */ *length = right - left; tmp_value = XtMalloc((unsigned) *length + 1); /* get the selection value */ (void)memcpy((void*)tmp_value, (void*)(TextF_Value(tf) + left), (size_t)*length); /* NOTE: casting *length could result in a truncated long. */ } tmp_value[*length] = '\0'; tmp_prop.value = NULL; /* Convert to compound text */ ret_status = XmbTextListToTextProperty(XtDisplay(w), &tmp_value, 1, (XICCEncodingStyle)XCompoundTextStyle, &tmp_prop); XtFree(tmp_value); if (ret_status == Success || ret_status > 0){ *length = tmp_prop.nitems; *value = (XtPointer)tmp_prop.value; } else { *value = NULL; *length = 0; return False; } #ifdef UTF8_SUPPORTED } else if (*target == atoms[XmAUTF8_STRING]) { *type = atoms[XmAUTF8_STRING]; *format = 8; if (is_destination || !has_selection) return False; if (tf->text.max_char_size != 1) { int stat ; /* convert to char* before converting to CT. NOTE: casting * (right - left) could result in a truncated long. */ *length = _XmTextFieldCountBytes(tf, TextF_WcValue(tf) + left, (int)(right - left)); tmp_value = XtMalloc((unsigned) *length + 1); stat = wcstombs(tmp_value, TextF_WcValue(tf) + left, (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ if (stat < 0) /* wcstombs will return neg value on conv failure */ *length = 0; else *length = (unsigned long) stat ; } else { /* malloc the space and copy the data to be converted */ *length = right - left; tmp_value = XtMalloc((unsigned) *length + 1); /* get the selection value */ (void)memcpy((void*)tmp_value, (void*)(TextF_Value(tf) + left), (size_t)*length); /* NOTE: casting *length could result in a truncated long. */ } tmp_value[*length] = '\0'; tmp_prop.value = NULL; /* Convert to compound text */ ret_status = XmbTextListToTextProperty(XtDisplay(w), &tmp_value, 1, (XICCEncodingStyle)XUTF8StringStyle, &tmp_prop); XtFree(tmp_value); if (ret_status == Success || ret_status > 0){ *length = tmp_prop.nitems; *value = (XtPointer)tmp_prop.value; } else { *value = NULL; *length = 0; return False; } #endif } else if (*target == atoms[XmAINSERT_SELECTION]) { if (is_secondary) return False; else return True; /* Delete the selection */ } else if (*target == atoms[XmADELETE]) { XmTextPosition left, right; Boolean move_cursor = True; if (!(is_primary || is_drop)) return False; left = tf->text.prim_pos_left; right = tf->text.prim_pos_right; if (is_drop) { if (_XmTextFieldGetDropReciever((Widget)tf) == (Widget) tf) move_cursor = False; } else { if (req_event != NULL && req_event->requestor == XtWindow((Widget)tf)) move_cursor = False; } if (!_XmTextFieldReplaceText(tf, (XEvent *) req_event, left, right, NULL, 0, move_cursor)) { tf->text.has_primary = True; return False; } _XmTextFieldStartSelection(tf, tf->text.prim_anchor, tf->text.prim_anchor, _time); cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *) req_event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); tf->text.has_primary = True; if (tf->text.has_destination) tf->text.prim_anchor = TextF_CursorPosition(tf); *type = atoms[XmANULL]; *value = NULL; *length = 0; *format = 8; } else /* unknown selection type */ return FALSE; return TRUE; } /* ARGSUSED */ void _XmTextFieldLoseSelection( Widget w, Atom *selection ) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Atom MOTIF_DESTINATION = XInternAtom(XtDisplay(w), XmS_MOTIF_DESTINATION, False); /* Losing Primary Selection */ if (*selection == XA_PRIMARY && tf->text.has_primary) { XmAnyCallbackStruct cb; _XmTextFieldDeselectSelection(w, False, 0); cb.reason = XmCR_LOSE_PRIMARY; cb.event = NULL; XtCallCallbackList(w, tf->text.lose_primary_callback, (XtPointer) &cb); /* Losing Destination Selection */ } else if (*selection == MOTIF_DESTINATION) { Boolean orig_ibeam_off = tf->text.refresh_ibeam_off; tf->text.has_destination = False; /* if we have focus, we have a valid putback area. If we don't have * focus, don't want to update the putback with the destination cursor * image. */ tf->text.refresh_ibeam_off = False; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.blink_on = True; _XmTextFieldDrawInsertionPoint(tf, True); /* Restore the state of the refresh_ibeam_off flag. */ tf->text.refresh_ibeam_off = orig_ibeam_off; /* Losing Secondary Selection */ } else if (*selection == XA_SECONDARY && tf->text.has_secondary){ _XmTextFieldSetSel2(w, 0, 0, True, XtLastTimestampProcessed(XtDisplay(w))); } } static void SetDropContext(Widget w) { Display *display = XtDisplay(w); Screen *screen = XtScreen(w); XContext loc_context; _XmProcessLock(); if (_XmTextFDNDContext == 0) _XmTextFDNDContext = XUniqueContext(); loc_context = _XmTextFDNDContext; _XmProcessUnlock(); XSaveContext(display, (Window)screen, loc_context, (XPointer)w); } static void DeleteDropContext(Widget w) { Display *display = XtDisplay(w); Screen *screen = XtScreen(w); XContext loc_context; _XmProcessLock(); loc_context = _XmTextFDNDContext; _XmProcessUnlock(); XDeleteContext(display, (Window)screen, loc_context); } Widget _XmTextFieldGetDropReciever(Widget w) { Widget widget; XContext loc_context; _XmProcessLock(); loc_context = _XmTextFDNDContext; _XmProcessUnlock(); if (loc_context == 0) return NULL; if (!XFindContext(XtDisplay(w), (Window) XtScreen(w), loc_context, (char **) &widget)) { return widget; } return NULL; } /* ARGSUSED */ static void DropDestroyCB(Widget w, XtPointer clientData, XtPointer callData) { XmTransferDoneCallbackStruct *ts = (XmTransferDoneCallbackStruct *) callData; DeleteDropContext(w); if (ts->client_data != NULL) XtFree((char*) ts->client_data); } static void DropTransferProc(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds) { enum { XmACOMPOUND_TEXT, XmANULL, XmADELETE, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSNULL, XmSDELETE, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; _XmTextDropTransferRec *transfer_rec = (_XmTextDropTransferRec *) closure; XmTextFieldWidget tf = (XmTextFieldWidget) w; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); XmTextPosition insertPosLeft, insertPosRight, left, right, cursorPos; int max_length = 0; Boolean local = tf->text.has_primary; char * total_value = NULL; wchar_t * wc_total_value; unsigned long total_length = 0; int wc_total_length; Boolean replace = False; XmAnyCallbackStruct cb; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* When type = NULL, we are assuming a DELETE request has been requested */ if (ds->type == atoms[XmANULL]) { if (transfer_rec->num_chars > 0 && transfer_rec->move) { tf->text.prim_anchor = transfer_rec->insert_pos; cursorPos = transfer_rec->insert_pos + transfer_rec->num_chars; _XmTextFieldSetCursorPosition(tf, NULL, cursorPos, False, True); _XmTextFieldStartSelection(tf, tf->text.prim_anchor, TextF_CursorPosition(tf), XtLastTimestampProcessed(XtDisplay(w))); tf->text.pending_off = False; _XmTextFieldSetCursorPosition(tf, NULL, TextF_CursorPosition(tf), True, True); } if (ds->value) { XtFree((char*) ds->value); ds->value = NULL; } return; } if (!(ds->value) || (ds->type != CS_OF_ENCODING && ds->type != atoms[XmACOMPOUND_TEXT] && #ifdef UTF8_SUPPORTED ds->type != atoms[XmAUTF8_STRING] && #endif ds->type != XA_STRING)) { XmTransferDone(ds->transfer_id, XmTRANSFER_DONE_FAIL); if (ds->value) { XtFree((char*) ds->value); ds->value = NULL; } return; } insertPosLeft = insertPosRight = transfer_rec->insert_pos; if (ds->type == XA_STRING #ifdef UTF8_SUPPORTED || ds->type == atoms[XmAUTF8_STRING] #endif || ds->type == atoms[XmACOMPOUND_TEXT]) { if ((total_value = _XmTextToLocaleText(w, ds->value, ds->type, 8, ds->length, NULL)) != NULL) total_length = strlen(total_value); else if (ds->value) { XtFree((char*) ds->value); ds->value = NULL; } } else { total_value = (char*) ds->value; total_length = ds->length; } if (total_value == NULL) return; if (TextF_PendingDelete(tf) && tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) { if(insertPosLeft > tf->text.prim_pos_left && insertPosLeft < tf->text.prim_pos_right) insertPosLeft = tf->text.prim_pos_left; if(insertPosRight < tf->text.prim_pos_right && insertPosRight > tf->text.prim_pos_left) insertPosRight = tf->text.prim_pos_right; } transfer_rec->num_chars = _XmTextFieldCountCharacters(tf, total_value, total_length); _XmTextFieldDrawInsertionPoint(tf, False); if (transfer_rec->move && local) { max_length = TextF_MaxLength(tf); TextF_MaxLength(tf) = INT_MAX; } if (tf->text.max_char_size == 1) { replace = _XmTextFieldReplaceText(tf, ds->event, insertPosLeft, insertPosRight, (char *) total_value, (int)total_length, False); } else { wc_total_length = _XmTextFieldCountCharacters(tf, total_value, total_length); wc_total_value = (wchar_t*)XtMalloc((unsigned) (wc_total_length+1) * sizeof(wchar_t)); wc_total_length = mbstowcs(wc_total_value, total_value, wc_total_length+1); if (wc_total_length > 0) replace = _XmTextFieldReplaceText(tf, ds->event, insertPosLeft, insertPosRight, (char *)wc_total_value, wc_total_length, False); XtFree((char*)wc_total_value); } if (replace) { tf->text.pending_off = FALSE; if (transfer_rec->num_chars > 0 && !transfer_rec->move) { cursorPos = transfer_rec->insert_pos + transfer_rec->num_chars; _XmTextFieldSetCursorPosition(tf, NULL, cursorPos, True, True); _XmTextFieldSetDestination((Widget)tf, TextF_CursorPosition(tf), transfer_rec->timestamp); } left = tf->text.prim_pos_left; right = tf->text.prim_pos_right; if (tf->text.has_primary) { if (transfer_rec->move && left < transfer_rec->insert_pos) transfer_rec->insert_pos -= transfer_rec->num_chars; if (TextF_CursorPosition(tf) < left || TextF_CursorPosition(tf) > right) tf->text.pending_off = TRUE; } else { if (!transfer_rec->move && !tf->text.add_mode && transfer_rec->num_chars != 0) tf->text.prim_anchor = insertPosLeft; } if (transfer_rec->move) { XmTransferValue(ds->transfer_id, atoms[XmADELETE], (XtCallbackProc) DropTransferProc, (XtPointer) transfer_rec, 0); } cb.reason = XmCR_VALUE_CHANGED; cb.event = ds->event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } if (transfer_rec->move && local) { TextF_MaxLength(tf) = max_length; } if (total_value && (total_value != (char*)ds->value)) XtFree(total_value); if (ds->value) { XtFree((char*) ds->value); ds->value = NULL; } _XmTextFieldDrawInsertionPoint(tf, True); } #define CR1228 /*ARGSUSED*/ static void DoStuff(Widget w, #ifdef CR1228 XtPointer closure, #else XtPointer closure, /* unused */ #endif XmSelectionCallbackStruct *ds) { enum { XmANULL, XmACLIPBOARD, XmATEXT, XmACOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSNULL, XmSCLIPBOARD, XmSTEXT, XmSCOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition right=0, left=0, replace_from, replace_to; int prim_char_length = 0; Boolean replace_res = False; XmAnyCallbackStruct cb; Atom atoms[XtNumber(atom_names)]; #ifdef CR1228 _XmTextPrimSelect *prim_select = (_XmTextPrimSelect *) closure; #endif assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); if (!tf->text.has_focus && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); if (ds->selection != atoms[XmACLIPBOARD] && ds->length == 0 && ds->type != atoms[XmANULL]) { /* Backwards compatibility for 1.0 Selections */ _XmProcessLock(); if (prim_select->target == atoms[XmATEXT]) { prim_select->target = XA_STRING; XmTransferValue(ds->transfer_id, XA_STRING, (XtCallbackProc) DoStuff, (XtPointer) prim_select, prim_select->time); } _XmProcessUnlock(); XtFree((char *)ds->value); ds->value = NULL; return; } /* if ds->length == 0 and ds->type is the NULL atom we are assuming * that a DELETE target is requested. */ if (ds->type == atoms[XmANULL]) { _XmProcessLock(); if (prim_select->num_chars > 0 && tf->text.selection_move) { prim_char_length = prim_select->num_chars; _XmTextFieldStartSelection(tf, prim_select->position, prim_select->position + prim_char_length, prim_select->time); tf->text.pending_off = False; _XmTextFieldSetCursorPosition(tf, NULL, prim_select->position + prim_char_length, True, True); tf->text.prim_anchor = prim_select->position; } _XmProcessUnlock(); /* for prim_select */ } else { int max_length = 0; Boolean local = tf->text.has_primary; Boolean dest_disjoint = True; if (tf->text.selection_move && local) { max_length = TextF_MaxLength(tf); TextF_MaxLength(tf) = INT_MAX; } _XmProcessLock(); replace_from = replace_to = prim_select->position; _XmProcessUnlock(); if (ds->selection == atoms[XmACLIPBOARD]) { if (tf->text.has_primary) { left = tf->text.prim_pos_left; right = tf->text.prim_pos_right; if (tf->text.pending_delete && replace_from >= left && replace_to <= right) { replace_from = left; replace_to = right; dest_disjoint = False; } } } if (ds->type == atoms[XmACOMPOUND_TEXT] || #ifdef UTF8_SUPPORTED ds->type == atoms[XmAUTF8_STRING] || #endif ds->type == XA_STRING) { char *total_value; if ((total_value = _XmTextToLocaleText(w, ds->value, ds->type, ds->format, ds->length, NULL)) != NULL) { if (tf->text.max_char_size == 1) { _XmProcessLock(); prim_select->num_chars = strlen(total_value); replace_res = _XmTextFieldReplaceText (tf, ds->event, replace_from, replace_to, total_value, prim_select->num_chars, ds->selection == atoms[XmACLIPBOARD]); _XmProcessUnlock(); XtFree(total_value); } else { wchar_t * wc_value; int tmp_len = strlen(total_value) + 1; _XmProcessLock(); prim_select->num_chars = 0; wc_value = (wchar_t*)XtMalloc ((unsigned) tmp_len * sizeof(wchar_t)); prim_select->num_chars = mbstowcs(wc_value, total_value, tmp_len); if (prim_select->num_chars < 0) prim_select->num_chars = 0; else replace_res = _XmTextFieldReplaceText(tf, ds->event, replace_from, replace_to, (char*)wc_value, prim_select->num_chars, ds->selection == atoms[XmACLIPBOARD]); _XmProcessUnlock(); XtFree((char*)wc_value); XtFree(total_value); } } else { /* initialize prim_select values for possible delete oper */ _XmProcessLock(); prim_select->num_chars = 0; _XmProcessUnlock(); } } else { if (tf->text.max_char_size == 1) { /* Note: length may be truncated during cast to int */ _XmProcessLock(); prim_select->num_chars = (int) ds->length; replace_res = _XmTextFieldReplaceText(tf, ds->event, replace_from, replace_to, (char *) ds->value, prim_select->num_chars, ds->selection == atoms[XmACLIPBOARD]); _XmProcessUnlock(); } else { wchar_t * wc_value; char *temp; temp = XtMalloc((unsigned) ds->length + 1); (void)memcpy((void*)temp, (void*)ds->value, (size_t)ds->length); temp[(size_t)ds->length] = '\0'; wc_value = (wchar_t*)XtMalloc ((unsigned) ((ds->length + 1) * sizeof(wchar_t))); _XmProcessLock(); prim_select->num_chars = mbstowcs(wc_value, (char *) temp, (size_t) ds->length+1); if (prim_select->num_chars < 0) prim_select->num_chars = 0; else { wc_value[prim_select->num_chars] = 0; replace_res = _XmTextFieldReplaceText(tf, ds->event, replace_from, replace_to, (char*)wc_value, prim_select->num_chars, ds->selection == atoms[XmACLIPBOARD]); } _XmProcessUnlock(); XtFree(temp); XtFree((char*)wc_value); } } if (replace_res) { XmTextPosition cursorPos = 0; if (ds->selection != atoms[XmACLIPBOARD]) { tf->text.pending_off = FALSE; _XmProcessLock(); cursorPos = replace_from + prim_select->num_chars; if (prim_select->num_chars > 0 && !tf->text.selection_move) { _XmTextFieldSetCursorPosition(tf, NULL, cursorPos, True, True); (void) _XmTextFieldSetDestination(w, cursorPos, prim_select->time); _XmProcessUnlock(); } } else { _XmProcessLock(); (void) _XmTextFieldSetDestination(w, TextF_CursorPosition(tf), prim_select->time); _XmProcessUnlock(); } left = tf->text.prim_pos_left; right = tf->text.prim_pos_right; if (tf->text.has_primary) { if (ds->selection == atoms[XmACLIPBOARD]) { if (left != right && (!dest_disjoint || !tf->text.add_mode)) _XmProcessLock(); _XmTextFieldStartSelection(tf, TextF_CursorPosition(tf), TextF_CursorPosition(tf), prim_select->time); _XmProcessUnlock(); } else { _XmProcessLock(); if (tf->text.selection_move && left < prim_select->position) prim_select->position -= prim_select->num_chars; if (left <= cursorPos && right >= cursorPos) tf->text.pending_off = TRUE; _XmProcessUnlock(); } } else { _XmProcessLock(); if (ds->selection == atoms[XmACLIPBOARD]) tf->text.prim_anchor = replace_from; else if (!tf->text.selection_move && !tf->text.add_mode && prim_select->num_chars != 0) tf->text.prim_anchor = prim_select->position; _XmProcessUnlock(); } cb.reason = XmCR_VALUE_CHANGED; cb.event = ds->event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } else { _XmProcessLock(); prim_select->num_chars = 0; /* Stop SetPrimarySelection from doing anything */ _XmProcessUnlock(); } if (tf->text.selection_move && local) { TextF_MaxLength(tf) = max_length; } } XtFree((char *)ds->value); ds->value = NULL; } static void HandleTargets(Widget w, XtPointer closure, XmSelectionCallbackStruct *ds) { enum { XmACOMPOUND_TEXT, XmACLIPBOARD, XmATEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSCLIPBOARD, XmSTEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; XmTextFieldWidget tf = (XmTextFieldWidget) w; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); XmTextPosition left, right; Boolean supports_encoding_data = False; Boolean supports_CT = False; Boolean supports_utf8_string = False; Boolean supports_text = False; XPoint *point = (XPoint *)closure; Atom *atom_ptr; Atom targets[2]; XmTextPosition select_pos; int i; if (!ds->length) { XtFree((char *)ds->value); ds->value = NULL; return; /* Supports no targets, so don't bother sending anything */ } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); atom_ptr = (Atom *)ds->value; for (i = 0; i < ds->length; i++, atom_ptr++) { if (*atom_ptr == atoms[XmATEXT]) supports_text = True; if (*atom_ptr == CS_OF_ENCODING) supports_encoding_data = True; if (*atom_ptr == atoms[XmACOMPOUND_TEXT]) supports_CT = True; #ifdef UTF8_SUPPORTED if (*atom_ptr == atoms[XmAUTF8_STRING]) supports_utf8_string = True; #endif } /* * Set stuff position to the x and y position of * the button pressed event for primary pastes. */ if (ds->selection != atoms[XmACLIPBOARD] && point) { select_pos = XmTextFieldXYToPos((Widget)tf, (Position)point->x, 0); } else { select_pos = TextF_CursorPosition(tf); } if (ds->selection != atoms[XmACLIPBOARD]) { left = tf->text.prim_pos_left; right = tf->text.prim_pos_right; if (tf->text.has_primary && left != right && select_pos > left && select_pos < right) { XtFree((char *)ds->value); ds->value = NULL; return; } } _XmProcessLock(); if (prim_select) { prim_select->ref_count++; } else { prim_select = (_XmTextPrimSelect *) XtMalloc((unsigned) sizeof(_XmTextPrimSelect)); } prim_select->position = select_pos; prim_select->time = XtLastTimestampProcessed(XtDisplay(w)); prim_select->num_chars = 0; if (supports_text && supports_encoding_data) prim_select->target = targets[0] = atoms[XmATEXT]; #ifdef UTF8_SUPPORTED else if (supports_utf8_string) prim_select->target = targets[0] = atoms[XmAUTF8_STRING]; #endif else if (supports_CT) prim_select->target = targets[0] = atoms[XmACOMPOUND_TEXT]; else if (supports_encoding_data) prim_select->target = targets[0] = CS_OF_ENCODING; else prim_select->target = targets[0] = XA_STRING; prim_select->ref_count = 1; /* Make request to call DoStuff() with the primary selection. */ XmTransferValue(ds->transfer_id, targets[0], (XtCallbackProc) DoStuff, (XtPointer) prim_select, prim_select->time); _XmProcessUnlock(); XtFree((char *)ds->value); ds->value = NULL; } static void HandleDrop(Widget w, XmDropProcCallbackStruct *cb, XmDestinationCallbackStruct *ds) { Widget drag_cont, initiator; Cardinal numExportTargets, n; Atom *exportTargets; Atom desiredTarget = None; Arg args[10]; XmTextPosition insert_pos, left, right; Display *display = XtDisplay(w); Boolean doTransfer = False; _XmTextDropTransferRec *transfer_rec; XtPointer tid = ds->transfer_id; drag_cont = cb->dragContext; transfer_rec = (_XmTextDropTransferRec *) NULL; n = 0; XtSetArg(args[n], XmNsourceWidget, &initiator); n++; XtSetArg(args[n], XmNexportTargets, &exportTargets); n++; XtSetArg(args[n], XmNnumExportTargets, &numExportTargets); n++; XtGetValues((Widget) drag_cont, args, n); insert_pos = XmTextFieldXYToPos(w, cb->x, 0); left = ((XmTextFieldWidget)w)->text.prim_pos_left; right = ((XmTextFieldWidget)w)->text.prim_pos_right; if (cb->operation & XmDROP_MOVE && w == initiator && ((XmTextFieldWidget)w)->text.has_primary && left != right && insert_pos >= left && insert_pos <= right) { /*EMPTY*/ } else { enum { XmATEXT, XmACOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSTEXT, XmSCOMPOUND_TEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; Atom atoms[XtNumber(atom_names)]; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); Boolean encoding_found = False; Boolean utf8_string_found = False; Boolean c_text_found = False; Boolean string_found = False; Boolean text_found = False; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms); /* intialize data to send to drop transfer callback */ transfer_rec = (_XmTextDropTransferRec *) XtMalloc(sizeof(_XmTextDropTransferRec)); transfer_rec->widget = w; transfer_rec->insert_pos = insert_pos; transfer_rec->num_chars = 0; transfer_rec->timestamp = cb->timeStamp; transfer_rec->move = False; if (cb->operation & XmDROP_MOVE) { transfer_rec->move = True; } else { transfer_rec->move = False; } for (n = 0; n < numExportTargets; n++) { if (exportTargets[n] == CS_OF_ENCODING) { desiredTarget = CS_OF_ENCODING; encoding_found = True; break; } #ifdef UTF8_SUPPORTED if (exportTargets[n] == atoms[XmAUTF8_STRING]) utf8_string_found = True; #endif if (exportTargets[n] == atoms[XmACOMPOUND_TEXT]) c_text_found = True; if (exportTargets[n] == XA_STRING) string_found = True; if (exportTargets[n] == atoms[XmATEXT]) text_found = True; } n = 0; if (encoding_found || c_text_found || string_found || text_found) { if (!encoding_found) { #ifdef UTF8_SUPPORTED if (utf8_string_found) desiredTarget = atoms[XmAUTF8_STRING]; else #endif if (c_text_found) desiredTarget = atoms[XmACOMPOUND_TEXT]; else if (string_found) desiredTarget = XA_STRING; else desiredTarget = atoms[XmATEXT]; } if (cb->operation & XmDROP_MOVE || cb->operation & XmDROP_COPY) { doTransfer = True; } else { XmTransferDone(tid, XmTRANSFER_DONE_FAIL); } } else { XmTransferDone(tid, XmTRANSFER_DONE_FAIL); } } SetDropContext(w); if (doTransfer) { XmeTransferAddDoneProc(tid, (XmSelectionFinishedProc) DropDestroyCB); XmTransferValue(tid, desiredTarget, (XtCallbackProc) DropTransferProc, (XtPointer) transfer_rec, 0); } } /*ARGSUSED*/ static void TextFieldConvertCallback(Widget w, XtPointer ignore, /* unused */ XmConvertCallbackStruct *cs) { enum { XmADELETE, XmA_MOTIF_LOSE_SELECTION, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmACOMPOUND_TEXT, XmATEXT, XmATARGETS, XmACLIPBOARD, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSDELETE, XmS_MOTIF_LOSE_SELECTION, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSCOMPOUND_TEXT, XmSTEXT, XmSTARGETS, XmSCLIPBOARD, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; Atom XA_CS_OF_ENCODING = XmeGetEncodingAtom(w); XtPointer value; Atom type; unsigned long size; int format; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); value = NULL; if (cs->target == atoms[XmA_MOTIF_LOSE_SELECTION]) { _XmTextFieldLoseSelection(w, &(cs->selection)); cs->status = XmCONVERT_DONE; return; } if (cs->target == atoms[XmADELETE] && cs->selection == XA_SECONDARY) { _XmTextFieldHandleSecondaryFinished(w, cs->event); cs->status = XmCONVERT_DONE; return; } /* When this is called as a result of a clipboard copy link, we don't have any available targets. Make sure to return immediately without modification */ if (cs->selection == atoms[XmACLIPBOARD] && cs->parm == (XtPointer) XmLINK && (cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS] || cs->target == atoms[XmATARGETS])) return; if (!_XmTextFieldConvert(w, &cs->selection, &cs->target, &type, &value, &size, &format, (Widget) cs->source_data, cs->event)) { value = NULL; type = XA_INTEGER; size = 0; format = 8; } if (cs->target == atoms[XmADELETE]) { cs->status = XmCONVERT_DONE; cs->type = type; cs->value = value; cs->length = size; cs->format = format; return; } if (cs->target == atoms[XmA_MOTIF_EXPORT_TARGETS] || cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS]) { Atom *targs = (Atom *) XtMalloc(sizeof(Atom) * 5); int n = 0; value = (XtPointer) targs; #ifdef UTF8_SUPPORTED targs[n] = atoms[XmAUTF8_STRING]; n++; #endif targs[n] = atoms[XmACOMPOUND_TEXT]; n++; targs[n] = atoms[XmATEXT]; n++; targs[n] = XA_STRING; n++; if (XA_CS_OF_ENCODING != XA_STRING) { targs[n] = XA_CS_OF_ENCODING; n++; } format = 32; size = n; type = XA_ATOM; } _XmConvertComplete(w, value, size, format, type, cs); } /************************************************ * Free data allocated for destination callback ************************************************/ /*ARGSUSED*/ static void FreeLocationData(Widget w, /* unused */ XtEnum op, /* unused */ XmTransferDoneCallbackStruct *ts) { XmDestinationCallbackStruct *ds; ds = _XmTransferGetDestinationCBStruct(ts->transfer_id); XtFree((char*) ds->location_data); ds->location_data = NULL; } /*ARGSUSED*/ static void TextFieldDestinationCallback(Widget w, XtPointer closure, /* unused */ XmDestinationCallbackStruct *ds) { enum { XmATARGETS, XmA_MOTIF_DROP, NUM_ATOMS }; static char *atom_names[] = { XmSTARGETS, XmS_MOTIF_DROP }; Atom atoms[XtNumber(atom_names)]; XPoint DropPoint; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* ** In case of a primary transfer operation where a location_data ** has been allocated, register a done proc to be called when ** the data transfer is complete to free the location_data */ if (ds->selection == XA_PRIMARY && ds->location_data) XmeTransferAddDoneProc(ds->transfer_id, FreeLocationData); /* If we aren't sensitive, don't allow transfer */ if (! w -> core.sensitive || ! w -> core.ancestor_sensitive) XmTransferDone(ds -> transfer_id, XmTRANSFER_DONE_FAIL); /* We don't handle LINKs internally */ if (ds->operation == XmLINK) return; if (ds->selection == XA_PRIMARY && ds->operation == XmMOVE) XmeTransferAddDoneProc(ds->transfer_id, SetPrimarySelection); else XmeTransferAddDoneProc(ds->transfer_id, CleanPrimarySelection); if (ds->selection == atoms[XmA_MOTIF_DROP]) { XmDropProcCallbackStruct *cb = (XmDropProcCallbackStruct *) ds->destination_data; DropPoint.x = cb->x; DropPoint.y = cb->y; ds->location_data = (XtPointer) &DropPoint; if (cb->dropAction != XmDROP_HELP) { HandleDrop(w, cb, ds); } } else if (ds->selection == XA_SECONDARY) { Atom CS_OF_ENCODING; CS_OF_ENCODING = XmeGetEncodingAtom(w); _XmProcessLock(); insert_select.done_status = False; insert_select.success_status = False; insert_select.event = (XSelectionRequestEvent *) ds->event; insert_select.select_type = XmDEST_SELECT; if (((Atom) ds->location_data) != CS_OF_ENCODING) { /* * Make selection request to find out which targets * the selection can provide. */ XmTransferValue(ds->transfer_id, atoms[XmATARGETS], (XtCallbackProc) TextFieldSecondaryWrapper, (XtPointer) &insert_select, ds->time); } else { /* * Make selection request to replace the selection * with the insert selection. */ XmTransferValue(ds->transfer_id, ((Atom) ds->location_data), (XtCallbackProc) TextFieldSecondaryWrapper, (XtPointer) &insert_select, ds->time); } _XmProcessUnlock(); } else /* CLIPBOARD or PRIMARY */ XmTransferValue(ds->transfer_id, atoms[XmATARGETS], (XtCallbackProc) HandleTargets, ds->location_data, ds->time); } void _XmTextFieldInstallTransferTrait(void) { XmeTraitSet((XtPointer)xmTextFieldWidgetClass, XmQTtransfer, (XtPointer) &textFieldTT); } motif-2.3.8/lib/Xm/SlideC.h0000644000175000017500000000520012672140200012220 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _SLIDEC_H #define _SLIDEC_H #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsSlideContext #define XmIsSlideContext(w) XtIsSubclass(w,xmSlideContextClass) #endif #ifndef XmNslideFinishCallback #define XmNslideFinishCallback "slideFinishCallback" #endif #ifndef XmCSlideFinishCallback #define XmCSlideFinishCallback "SlideFinishCallback" #endif #ifndef XmNslideMotionCallback #define XmNslideMotionCallback "slideMotionCallback" #endif #ifndef XmCSlideMotionCallback #define XmCSlideMotionCallback "SlideMotionCallback" #endif #ifndef XmNslideWidget #define XmNslideWidget "slideWidget" #endif #ifndef XmCSlideWidget #define XmCSlideWidget "SlideWidget" #endif #ifndef XmNslideInterval #define XmNslideInterval "slideInterval" #endif #ifndef XmCSlideInterval #define XmCSlideInterval "SlideInterval" #endif #ifndef XmNslideDestWidth #define XmNslideDestWidth "slideDestWidth" #endif #ifndef XmCSlideDestWidth #define XmCSlideDestWidth "SlideDestWidth" #endif #ifndef XmNslideDestHeight #define XmNslideDestHeight "slideDestHeight" #endif #ifndef XmCSlideDestHeight #define XmCSlideDestHeight "SlideDestHeight" #endif #ifndef XmNslideDestX #define XmNslideDestX "slideDestX" #endif #ifndef XmCSlideDestX #define XmCSlideDestX "SlideDestX" #endif #ifndef XmNslideDestY #define XmNslideDestY "slideDestY" #endif #ifndef XmCSlideDestY #define XmCSlideDestY "SlideDestY" #endif extern WidgetClass xmSlideContextWidgetClass; typedef struct _XmSlideContextRec *XmSlideContextWidget; typedef struct _XmSlideContextClassRec *XmSlideContextWidgetClass; typedef struct _XmSlideStruct { Widget w; XtWidgetGeometry dest; unsigned long interval; XtIntervalId id; } XmSlideStruct, *XmSlidePtr; void XmSlide(XmSlidePtr slide_info); #ifdef __cplusplus } #endif #endif motif-2.3.8/lib/Xm/PanedWP.h0000644000175000017500000001252113145162623012370 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /********************************************************************* * * XmPanedWindowWidget Private Data * *********************************************************************/ #ifndef _XmPanedWP_h #define _XmPanedWP_h #include #include #ifdef __cplusplus extern "C" { #endif /* New fields for the PanedWindow widget class record */ typedef struct _XmPanedWindowClassPart { XtPointer extension; } XmPanedWindowClassPart; /* Full Class record declaration */ typedef struct _XmPanedWindowClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmPanedWindowClassPart paned_window_class; } XmPanedWindowClassRec; externalref XmPanedWindowClassRec xmPanedWindowClassRec; /* PanedWindow constraint record */ typedef struct _XmPanedWindowConstraintPart { int position; /* position location in PanedWindow */ int dheight; /* Desired size */ Position dy; /* Desired Location */ Position olddy; /* The last value of dy. */ Dimension min; /* Minimum height */ Dimension max; /* Maximum height */ Boolean isPane; /* true if constraint of pane, false if constraint of sash */ Boolean allow_resize; /* TRUE iff child resize requests are ok */ Boolean skip_adjust; /* TRUE iff child's height should not be */ /* changed without explicit user action. */ Widget sash; /* The sash for this child */ Widget separator; /* The separator for this child */ short position_index; /* new 1.2 positionIndex resource */ } XmPanedWindowConstraintPart; typedef struct _XmPanedWindowConstraintRec { XmManagerConstraintPart manager; XmPanedWindowConstraintPart panedw; } XmPanedWindowConstraintRec, * XmPanedWindowConstraintPtr; /* New Fields for the PanedWindow widget record */ typedef struct { /* resources */ Boolean refiguremode; /* Whether to refigure changes right now */ Boolean separator_on; /* make separator visible */ Dimension margin_width; /* space between right and left edges of PanedWindow window and it's children */ Dimension margin_height; /* space between top and bottom edges of PanedWindow window and it's children */ Dimension spacing; /* whitespace between panes around window, else leave none */ /* sash modifying resources */ Dimension sash_width; /* Modify sash width */ Dimension sash_height; /* Modify sash height */ Dimension sash_shadow_thickness; /* Modify sash shadow_thickness */ Position sash_indent; /* Location of sashs (offset from right margin) */ /* private */ int starty; /* mouse origin when adjusting */ short increment_count; /* Sash increment count */ short pane_count; /* number of managed panes */ short num_slots; /* number of avail. slots for children*/ short num_managed_children; /* holds number of managed children */ Boolean recursively_called; /* For change_managed AND creation of * private sash and separator * children */ Boolean resize_at_realize; /* For realize if GeometryNo condition */ XmPanedWindowConstraintPtr top_pane; /* pane closest to 0 index */ XmPanedWindowConstraintPtr bottom_pane; /* pane farthest away from 0 index*/ GC flipgc; /* GC to use when animating borders */ WidgetList managed_children; /* keep track of managed children */ unsigned char orientation ; /* horizontal or vertical panedw */ XtIntervalId timer ; /* handle key event on sash */ } XmPanedWindowPart; /************************************************************************** * * Full instance record declaration * **************************************************************************/ typedef struct _XmPanedWindowRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmPanedWindowPart paned_window; } XmPanedWindowRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPanedWP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Xmos_r.h0000644000175000017500000010602312672140200012331 00000000000000/* $Xorg: Xos_r.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */ /* Copyright 1996, 1998 The Open Group All Rights Reserved. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/include/Xos_r.h,v 1.9 2001/03/02 23:01:28 dawes Exp $ */ /* * Various and sundry Thread-Safe functions used by X11, Motif, and CDE. * * Use this file in MT-safe code where you would have included * for readdir() * for getgrgid() or getgrnam() * for gethostbyname(), gethostbyaddr(), or getservbyname() * for getpwnam() or getpwuid() * for strtok() * for asctime(), ctime(), localtime(), or gmtime() * for getlogin() or ttyname() * or their thread-safe analogs. * * If you are on a platform that defines XTHREADS but does not have * MT-safe system API (e.g. UnixWare) you must define _Xos_processLock * and _Xos_processUnlock macros before including this header. If * you are on OSF/1 V3.2 and plan to use readdir(), you must also define * _Xos_isThreadsInitialized. For convenience XOS_USE_XLIB_LOCKING or * XOS_USE_XT_LOCKING may be defined to obtain either Xlib-only or * Xt-based versions of these macros. These macros won't result in * truly thread-safe calls, but they are better than nothing. If you * do not want locking in this situation define XOS_USE_NO_LOCKING. * * NOTE: On systems lacking approriate _r functions Gethostbyname(), * Gethostbyaddr(), and Getservbyname() do NOT copy the host or * protocol lists! * * NOTE: On systems lacking appropriate _r functions Getgrgid() and * Getgrnam() do NOT copy the list of group members! * * This header is nominally intended to simplify porting X11, Motif, and * CDE; it may be useful to other people too. The structure below is * complicated, mostly because P1003.1c (the IEEE POSIX Threads spec) * went through lots of drafts, and some vendors shipped systems based * on draft API that were changed later. Unfortunately POSIX did not * provide a feature-test macro for distinguishing each of the drafts. */ /* * This header has several parts. Search for "Effective prototypes" * to locate the beginning of a section. */ /* This header can be included multiple times with different defines! */ #ifndef _XOS_R_H_ # define _XOS_R_H_ # include # include # ifndef X_NOT_POSIX # ifdef _POSIX_SOURCE # include # else # define _POSIX_SOURCE # include # undef _POSIX_SOURCE # endif # ifndef LINE_MAX # define X_LINE_MAX 2048 # else # define X_LINE_MAX LINE_MAX # endif # endif #endif /* _XOS_R_H */ #ifndef WIN32 #ifdef __cplusplus extern "C" { #endif # if defined(XOS_USE_XLIB_LOCKING) # ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */ typedef struct _LockInfoRec *LockInfoPtr; extern LockInfoPtr _Xglobal_lock; # endif # ifndef _Xos_isThreadInitialized # define _Xos_isThreadInitialized (_Xglobal_lock) # endif # if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) # ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */ # include /* for NeedFunctionPrototypes */ extern void (*_XLockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */, char * /* file */, int /* line */ # endif ); extern void (*_XUnlockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */, char * /* file */, int /* line */ # endif ); # endif # ifndef _Xos_processLock # define _Xos_processLock \ (_XLockMutex_fn ? (*_XLockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0) # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock \ (_XUnlockMutex_fn ? (*_XUnlockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0) # endif # else # ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */ # include /* for NeedFunctionPrototypes */ extern void (*_XLockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */ # endif ); extern void (*_XUnlockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */ # endif ); # endif # ifndef _Xos_processLock # define _Xos_processLock \ (_XLockMutex_fn ? ((*_XLockMutex_fn)(_Xglobal_lock), 0) : 0) # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock \ (_XUnlockMutex_fn ? ((*_XUnlockMutex_fn)(_Xglobal_lock), 0) : 0) # endif # endif # elif defined(XOS_USE_XT_LOCKING) extern void (*_XtProcessLock)(void); # ifndef _XtintrinsicP_h # include /* for NeedFunctionPrototypes */ extern void XtProcessLock( # if NeedFunctionPrototypes void # endif ); extern void XtProcessUnlock( # if NeedFunctionPrototypes void # endif ); # endif # ifndef _Xos_isThreadInitialized # define _Xos_isThreadInitialized _XtProcessLock # endif # ifndef _Xos_processLock # define _Xos_processLock XtProcessLock() # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock XtProcessUnlock() # endif # elif defined(XOS_USE_NO_LOCKING) # ifndef _Xos_isThreadInitialized # define _Xos_isThreadInitialized 0 # endif # ifndef _Xos_processLock # define _Xos_processLock 0 # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock 0 # endif # endif #endif /* !defined WIN32 */ /* * Solaris 2.5 has SVR4 thread-safe API, but defines the POSIX * thread-safe feature test macro. Fix the feature test macro. */ #if defined(sun) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) # undef _POSIX_THREAD_SAFE_FUNCTIONS #endif /* * LynxOS 3.1 defines _POSIX_THREAD_SAFE_FUNCTIONS but * getpwuid_r has different semantics than defined by POSIX */ #if defined(Lynx) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) # undef _POSIX_THREAD_SAFE_FUNCTIONS #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_PWD_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgetpwparams; * * struct passwd* _XGetpwnam(const char *name, _Xgetpwparams); * struct passwd* _XGetpwuid(uid_t uid, _Xgetpwparams); */ #if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_PWDAPI) # define XOS_USE_MTSAFE_PWDAPI 1 # endif #endif #if !defined(X_INCLUDE_PWD_H) || defined(_XOS_INCLUDED_PWD_H) /* Do nothing */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ # if defined(X_NOT_POSIX) && !defined(i386) && !defined(SYSV) extern struct passwd *getpwuid(), *getpwnam(); # endif typedef int _Xgetpwparams; /* dummy */ # define _XGetpwuid(u,p) getpwuid((u)) # define _XGetpwnam(u,p) getpwnam((u)) #elif !defined(XOS_USE_MTSAFE_PWDAPI) || defined(XNO_MTSAFE_PWDAPI) /* UnixWare 2.0, or other systems with thread support but no _r API. */ typedef struct { struct passwd pws; char pwbuf[1024]; struct passwd* pwp; size_t len; } _Xgetpwparams; /* * NetBSD and FreeBSD, at least, are missing several of the unixware passwd * fields. */ #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) { memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)); (p).pws.pw_name = (p).pwbuf; (p).len = strlen((p).pwp->pw_name); strcpy((p).pws.pw_name, (p).pwp->pw_name); (p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1; (p).len = strlen((p).pwp->pw_passwd); strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd); (p).pws.pw_class = (p).pws.pw_passwd + (p).len + 1; (p).len = strlen((p).pwp->pw_class); strcpy((p).pws.pw_class, (p).pwp->pw_class); (p).pws.pw_gecos = (p).pws.pw_class + (p).len + 1; (p).len = strlen((p).pwp->pw_gecos); strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos); (p).pws.pw_dir = (p).pws.pw_gecos + (p).len + 1; (p).len = strlen((p).pwp->pw_dir); strcpy((p).pws.pw_dir, (p).pwp->pw_dir); (p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1; (p).len = strlen((p).pwp->pw_shell); strcpy((p).pws.pw_shell, (p).pwp->pw_shell); (p).pwp = &(p).pws; } #else # define _Xpw_copyPasswd(p) \ (memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)), \ ((p).pws.pw_name = (p).pwbuf), \ ((p).len = strlen((p).pwp->pw_name)), \ strcpy((p).pws.pw_name, (p).pwp->pw_name), \ ((p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_passwd)), \ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd), \ ((p).pws.pw_age = (p).pws.pw_passwd + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_age)), \ strcpy((p).pws.pw_age, (p).pwp->pw_age), \ ((p).pws.pw_comment = (p).pws.pw_age + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_comment)), \ strcpy((p).pws.pw_comment, (p).pwp->pw_comment), \ ((p).pws.pw_gecos = (p).pws.pw_comment + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_gecos)), \ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos), \ ((p).pws.pw_dir = (p).pws.pw_comment + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_dir)), \ strcpy((p).pws.pw_dir, (p).pwp->pw_dir), \ ((p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_shell)), \ strcpy((p).pws.pw_shell, (p).pwp->pw_shell), \ ((p).pwp = &(p).pws), \ 0 ) #endif # define _XGetpwuid(u,p) \ ( (_Xos_processLock), \ (((p).pwp = getpwuid((u))) ? _Xpw_copyPasswd(p) : 0), \ (_Xos_processUnlock), \ (p).pwp ) # define _XGetpwnam(u,p) \ ( (_Xos_processLock), \ (((p).pwp = getpwnam((u))) ? _Xpw_copyPasswd(p) : 0), \ (_Xos_processUnlock), \ (p).pwp ) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) /* SVR4 threads, AIX 4.2.0 and earlier and OSF/1 3.2 and earlier pthreads */ typedef struct { struct passwd pws; char pwbuf[X_LINE_MAX]; } _Xgetpwparams; # if defined(_POSIX_REENTRANT_FUNCTIONS) || !defined(SVR4) || defined(Lynx) # ifndef Lynx # define _XGetpwuid(u,p) \ ((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) # define _XGetpwnam(u,p) \ ((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) # else /* Lynx */ # define _XGetpwuid(u,p) \ ((getpwuid_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) # define _XGetpwnam(u,p) \ ((getpwnam_r(&(p).pws,(u),(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) # endif # else /* SVR4 */ # define _XGetpwuid(u,p) \ ((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws) # define _XGetpwnam(u,p) \ ((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws) # endif /* SVR4 */ #else /* _POSIX_THREAD_SAFE_FUNCTIONS */ /* Digital UNIX 4.0, but not (beta) T4.0-1 */ # if defined(__osf__) /* OSF/1 V4.0 doesn't declare the _P routines, breaking under C++. */ extern int _Pgetpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); extern int _Pgetpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **); # endif typedef struct { struct passwd pws; char pwbuf[X_LINE_MAX]; struct passwd* pwp; } _Xgetpwparams; typedef int _Xgetpwret; # define _XGetpwuid(u,p) \ ((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == -1) ? \ NULL : (p).pwp) # define _XGetpwnam(u,p) \ ((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == -1) ? \ NULL : (p).pwp) #endif /* X_INCLUDE_PWD_H */ #if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H) # define _XOS_INCLUDED_PWD_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * NOTE: On systems lacking the appropriate _r functions Gethostbyname(), * Gethostbyaddr(), and Getservbyname() do NOT copy the host or * protocol lists! * * #define X_INCLUDE_NETDB_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgethostbynameparams; * typedef ... _Xgetservbynameparams; * * struct hostent* _XGethostbyname(const char* name,_Xgethostbynameparams); * struct hostent* _XGethostbyaddr(const char* addr, int len, int type, * _Xgethostbynameparams); * struct servent* _XGetservbyname(const char* name, const char* proto, * _Xgetservbynameparams); */ #if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H) \ && !defined(WIN32) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_NETDBAPI) # define XOS_USE_MTSAFE_NETDBAPI 1 # endif #endif #if !defined(X_INCLUDE_NETDB_H) || defined(_XOS_INCLUDED_NETDB_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xgethostbynameparams; /* dummy */ typedef int _Xgetservbynameparams; /* dummy */ # define _XGethostbyname(h,hp) gethostbyname((h)) # define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t)) # define _XGetservbyname(s,p,sp) getservbyname((s),(p)) #elif !defined(XOS_USE_MTSAFE_NETDBAPI) || defined(XNO_MTSAFE_NETDBAPI) /* UnixWare 2.0, or other systems with thread support but no _r API. */ /* WARNING: The h_addr_list and s_aliases values are *not* copied! */ #if defined(__NetBSD__) || defined(__FreeBSD__) #include #endif typedef struct { struct hostent hent; char h_name[MAXHOSTNAMELEN]; struct hostent *hptr; } _Xgethostbynameparams; typedef struct { struct servent sent; char s_name[255]; char s_proto[255]; struct servent *sptr; } _Xgetservbynameparams; # define _Xg_copyHostent(hp) \ (memcpy(&(hp).hent, (hp).hptr, sizeof(struct hostent)), \ strcpy((hp).h_name, (hp).hptr->h_name), \ ((hp).hent.h_name = (hp).h_name), \ ((hp).hptr = &(hp).hent), \ 0 ) # define _Xg_copyServent(sp) \ (memcpy(&(sp).sent, (sp).sptr, sizeof(struct servent)), \ strcpy((sp).s_name, (sp).sptr->s_name), \ ((sp).sent.s_name = (sp).s_name), \ strcpy((sp).s_proto, (sp).sptr->s_proto), \ ((sp).sent.s_proto = (sp).s_proto), \ ((sp).sptr = &(sp).sent), \ 0 ) # define _XGethostbyname(h,hp) \ ((_Xos_processLock), \ (((hp).hptr = gethostbyname((h))) ? _Xg_copyHostent(hp) : 0), \ (_Xos_processUnlock), \ (hp).hptr ) # define _XGethostbyaddr(a,al,t,hp) \ ((_Xos_processLock), \ (((hp).hptr = gethostbyaddr((a),(al),(t))) ? _Xg_copyHostent(hp) : 0), \ (_Xos_processUnlock), \ (hp).hptr ) # define _XGetservbyname(s,p,sp) \ ((_Xos_processLock), \ (((sp).sptr = getservbyname((s),(p))) ? _Xg_copyServent(sp) : 0), \ (_Xos_processUnlock), \ (sp).sptr ) #elif defined(XUSE_NETDB_R_API) /* * POSIX does not specify _r equivalents for API, but some * vendors provide them anyway. Use them only when explicitly asked. */ # ifdef _POSIX_REENTRANT_FUNCTIONS # ifndef _POSIX_THREAD_SAFE_FUNCTIONS # if defined(AIXV3) || defined(AIXV4) || defined(__osf__) # define X_POSIX_THREAD_SAFE_FUNCTIONS 1 # endif # endif # endif # ifdef _POSIX_THREAD_SAFE_FUNCTIONS # define X_POSIX_THREAD_SAFE_FUNCTIONS 1 # endif # ifndef X_POSIX_THREAD_SAFE_FUNCTIONS typedef struct { struct hostent hent; char hbuf[X_LINE_MAX]; int herr; } _Xgethostbynameparams; typedef struct { struct servent sent; char sbuf[X_LINE_MAX]; } _Xgetservbynameparams; # define _XGethostbyname(h,hp) \ gethostbyname_r((h),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr) # define _XGethostbyaddr(a,al,t,hp) \ gethostbyaddr_r((a),(al),(t),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr) # define _XGetservbyname(s,p,sp) \ getservbyname_r((s),(p),&(sp).sent,(sp).sbuf,sizeof((sp).sbuf)) # else typedef struct { struct hostent hent; struct hostent_data hdata; } _Xgethostbynameparams; typedef struct { struct servent sent; struct servent_data sdata; } _Xgetservbynameparams; # define _XGethostbyname(h,hp) \ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \ ((gethostbyname_r((h),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent)) # define _XGethostbyaddr(a,al,t,hp) \ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \ ((gethostbyaddr_r((a),(al),(t),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent)) # define _XGetservbyname(s,p,sp) \ (bzero((char*)&(sp).sdata,sizeof((sp).sdata)), \ ((getservbyname_r((s),(p),&(sp).sent,&(sp).sdata) == -1) ? NULL : &(sp).sent) ) # endif # ifdef X_POSIX_THREAD_SAFE_FUNCTIONS # undef X_POSIX_THREAD_SAFE_FUNCTIONS # endif #else /* The regular API is assumed to be MT-safe under POSIX. */ typedef int _Xgethostbynameparams; /* dummy */ typedef int _Xgetservbynameparams; /* dummy */ # define _XGethostbyname(h,hp) gethostbyname((h)) # define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t)) # define _XGetservbyname(s,p,sp) getservbyname((s),(p)) #endif /* X_INCLUDE_NETDB_H */ #if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H) # define _XOS_INCLUDED_NETDB_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_DIRENT_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xreaddirparams; * * struct dirent *_XReaddir(DIR *dir_pointer, _Xreaddirparams); */ #if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H) # include # if !defined(X_NOT_POSIX) || defined(SYSV) || defined(USG) # include # else # include # ifndef dirent # define dirent direct # endif # endif # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_DIRENTAPI) # define XOS_USE_MTSAFE_DIRENTAPI 1 # endif #endif #if !defined(X_INCLUDE_DIRENT_H) || defined(_XOS_INCLUDED_DIRENT_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xreaddirparams; /* dummy */ # define _XReaddir(d,p) readdir(d) #elif !defined(XOS_USE_MTSAFE_DIRENTAPI) || defined(XNO_MTSAFE_DIRENTAPI) /* Systems with thread support but no _r API. */ typedef struct { struct dirent *result; struct dirent dir_entry; # ifdef _POSIX_PATH_MAX char buf[_POSIX_PATH_MAX]; # elif defined(NAME_MAX) char buf[NAME_MAX]; # else char buf[255]; # endif } _Xreaddirparams; # define _XReaddir(d,p) \ ( (_Xos_processLock), \ (((p).result = readdir((d))) ? \ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \ ((p).result = &(p).dir_entry), 0) : \ 0), \ (_Xos_processUnlock), \ (p).result ) #else typedef struct { struct dirent *result; struct dirent dir_entry; # ifdef _POSIX_PATH_MAX char buf[_POSIX_PATH_MAX]; # elif defined(NAME_MAX) char buf[NAME_MAX]; # else char buf[255]; # endif } _Xreaddirparams; # if defined(AIXV3) || defined(AIXV4) || defined(_POSIX_THREAD_SAFE_FUNCTIONS) /* AIX defines the draft POSIX symbol, but uses the final API. */ /* POSIX final API, returns (int)0 on success. */ # if defined(__osf__) /* OSF/1 V4.0 doesn't declare _Preaddir_r, breaking under C++. */ extern int _Preaddir_r(DIR *, struct dirent *, struct dirent **); # endif # define _XReaddir(d,p) \ (readdir_r((d), &((p).dir_entry), &((p).result)) ? NULL : (p).result) # elif defined(_POSIX_REENTRANT_FUNCTIONS) && defined(__osf__) /* * OSF/1 V3.2 readdir_r() will SEGV if the main program is not * explicitly linked with -lc_r. The library REQUIREDLIBS don't help. * Assume that if threads have been initialized we're linked properly. */ # define _XReaddir(d,p) \ ( (_Xos_isThreadInitialized) ? \ (readdir_r((d), &((p).dir_entry)) ? NULL : &((p).dir_entry)) : \ ((_Xos_processLock), \ (((p).result = readdir((d))) ? \ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \ ((p).result = &(p).dir_entry), 0) : \ 0), \ (_Xos_processUnlock), \ (p).result) ) # elif defined(_POSIX_REENTRANT_FUNCTIONS) /* POSIX draft API, returns (int)0 on success. */ # define _XReaddir(d,p) \ (readdir_r((d),&((p).dir_entry)) ? NULL : &((p).dir_entry)) # elif defined(SVR4) /* Pre-POSIX API, returns non-NULL on success. */ # define _XReaddir(d,p) (readdir_r((d), &(p).dir_entry)) # else /* We have no idea what is going on. Fake it all using process locks. */ # define _XReaddir(d,p) \ ( (_Xos_processLock), \ (((p).result = readdir((d))) ? \ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \ ((p).result = &(p).dir_entry), 0) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # endif #endif /* X_INCLUDE_DIRENT_H */ #if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H) # define _XOS_INCLUDED_DIRENT_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_UNISTD_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgetloginparams; * typedef ... _Xttynameparams; * * char *_XGetlogin(_Xgetloginparams); * char *_XTtyname(int, _Xttynameparams); */ #if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H) /* already included by */ # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_UNISTDAPI) # define XOS_USE_MTSAFE_UNISTDAPI 1 # endif #endif #if !defined(X_INCLUDE_UNISTD_H) || defined(_XOS_INCLUDED_UNISTD_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xgetloginparams; /* dummy */ typedef int _Xttynameparams; /* dummy */ # define _XGetlogin(p) getlogin() # define _XTtyname(f) ttyname((f)) #elif !defined(XOS_USE_MTSAFE_UNISTDAPI) || defined(XNO_MTSAFE_UNISTDAPI) /* Systems with thread support but no _r API. */ typedef struct { char *result; # if defined(MAXLOGNAME) char buf[MAXLOGNAME]; # elif defined(LOGIN_NAME_MAX) char buf[LOGIN_NAME_MAX]; # else char buf[64]; # endif } _Xgetloginparams; typedef struct { char *result; # ifdef TTY_NAME_MAX char buf[TTY_NAME_MAX]; # elif defined(_POSIX_TTY_NAME_MAX) char buf[_POSIX_TTY_NAME_MAX]; # elif defined(_POSIX_PATH_MAX) char buf[_POSIX_PATH_MAX]; # else char buf[256]; # endif } _Xttynameparams; # define _XGetlogin(p) \ ( (_Xos_processLock), \ (((p).result = getlogin()) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), \ ((p).buf[sizeof((p).buf)-1] = '\0'), \ ((p).result = (p).buf), 0) : 0), \ (_Xos_processUnlock), \ (p).result ) #define _XTtyname(f,p) \ ( (_Xos_processLock), \ (((p).result = ttyname(f)) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), \ ((p).buf[sizeof((p).buf)-1] = '\0'), \ ((p).result = (p).buf), 0) : 0), \ (_Xos_processUnlock), \ (p).result ) #elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_POSIX_REENTRANT_FUNCTIONS) /* POSIX API. * * extern int getlogin_r(char *, size_t); * extern int ttyname_r(int, char *, size_t); */ typedef struct { # if defined(MAXLOGNAME) char buf[MAXLOGNAME]; # elif defined(LOGIN_NAME_MAX) char buf[LOGIN_NAME_MAX]; # else char buf[64]; # endif } _Xgetloginparams; typedef struct { # ifdef TTY_NAME_MAX char buf[TTY_NAME_MAX]; # elif defined(_POSIX_TTY_NAME_MAX) char buf[_POSIX_TTY_NAME_MAX]; # elif defined(_POSIX_PATH_MAX) char buf[_POSIX_PATH_MAX]; # else char buf[256]; # endif } _Xttynameparams; # define _XGetlogin(p) (getlogin_r((p).buf, sizeof((p).buf)) ? NULL : (p).buf) # define _XTtyname(f,p) \ (ttyname_r((f), (p).buf, sizeof((p).buf)) ? NULL : (p).buf) #else /* Pre-POSIX API. * * extern char *getlogin_r(char *, size_t); * extern char *ttyname_r(int, char *, size_t); */ typedef struct { # if defined(MAXLOGNAME) char buf[MAXLOGNAME]; # elif defined(LOGIN_NAME_MAX) char buf[LOGIN_NAME_MAX]; # else char buf[64]; # endif } _Xgetloginparams; typedef struct { # ifdef TTY_NAME_MAX char buf[TTY_NAME_MAX]; # elif defined(_POSIX_TTY_NAME_MAX) char buf[_POSIX_TTY_NAME_MAX]; # elif defined(_POSIX_PATH_MAX) char buf[_POSIX_PATH_MAX]; # else char buf[256]; # endif } _Xttynameparams; # define _XGetlogin(p) getlogin_r((p).buf, sizeof((p).buf)) # define _XTtyname(f,p) ttyname_r((f), (p).buf, sizeof((p).buf)) #endif /* X_INCLUDE_UNISTD_H */ #if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H) # define _XOS_INCLUDED_UNISTD_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_STRING_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xstrtokparams; * * char *_XStrtok(char *, const char*, _Xstrtokparams); */ #if defined(X_INCLUDE_STRING_H) && !defined(_XOS_INCLUDED_STRING_H) /* has already been included by */ # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_STRINGAPI) # define XOS_USE_MTSAFE_STRINGAPI 1 # endif #endif #if !defined(X_INCLUDE_STRING_H) || defined(_XOS_INCLUDED_STRING_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xstrtokparams; /* dummy */ # define _XStrtok(s1,s2,p) strtok((s1),(s2)) #elif !defined(XOS_USE_MTSAFE_STRINGAPI) || defined(XNO_MTSAFE_STRINGAPI) /* Systems with thread support but no _r API. */ typedef char *_Xstrtokparams; # define _XStrtok(s1,s2,p) \ ( (_Xos_processLock), \ ((p) = strtok((s1),(s2))), \ (_Xos_processUnlock), \ (p) ) #else /* POSIX or pre-POSIX API. */ typedef char * _Xstrtokparams; # define _XStrtok(s1,s2,p) strtok_r((s1),(s2),&(p)) #endif /* X_INCLUDE_STRING_H */ /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_TIME_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xatimeparams; * typedef ... _Xctimeparams; * typedef ... _Xgtimeparams; * typedef ... _Xltimeparams; * * char *_XAsctime(const struct tm *, _Xatimeparams); * char *_XCtime(const time_t *, _Xctimeparams); * struct tm *_XGmtime(const time_t *, _Xgtimeparams); * struct tm *_XLocaltime(const time_t *, _Xltimeparams); */ #if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_TIMEAPI) # define XOS_USE_MTSAFE_TIMEAPI 1 # endif #endif #if !defined(X_INCLUDE_TIME_H) || defined(_XOS_INCLUDED_TIME_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xatimeparams; /* dummy */ # define _XAsctime(t,p) asctime((t)) typedef int _Xctimeparams; /* dummy */ # define _XCtime(t,p) ctime((t)) typedef int _Xgtimeparams; /* dummy */ # define _XGmtime(t,p) gmtime((t)) typedef int _Xltimeparams; /* dummy */ # define _XLocaltime(t,p) localtime((t)) #elif !defined(XOS_USE_MTSAFE_TIMEAPI) || defined(XNO_MTSAFE_TIMEAPI) /* Systems with thread support but no _r API. */ typedef struct { # ifdef TIMELEN char buf[TIMELEN]; # else char buf[26]; # endif char *result; } _Xctimeparams, _Xatimeparams; typedef struct { struct tm buf; struct tm *result; } _Xgtimeparams, _Xltimeparams; # define _XAsctime(t,p) \ ( (_Xos_processLock), \ (((p).result = asctime((t))) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # define _XCtime(t,p) \ ( (_Xos_processLock), \ (((p).result = ctime((t))) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # define _XGmtime(t,p) \ ( (_Xos_processLock), \ (((p).result = gmtime(t)) ? \ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # define _XLocaltime(t,p) \ ( (_Xos_processLock), \ (((p).result = localtime(t)) ? \ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (defined(__osf__) || defined(hpV4)) /* Returns (int)0 on success. OSF/1 v3.2, HP/UX 10 * * extern int asctime_r(const struct tm *timeptr, char *buffer, int buflen); * extern int ctime_r(const time_t *timer, char *buffer, int buflen); * extern int gmtime_r(const time_t *timer, struct tm *result); * extern int localtime_r(const time_t *timer, struct tm *result); */ # ifdef TIMELEN typedef char _Xatimeparams[TIMELEN]; typedef char _Xctimeparams[TIMELEN]; # else typedef char _Xatimeparams[26]; typedef char _Xctimeparams[26]; # endif typedef struct tm _Xgtimeparams; typedef struct tm _Xltimeparams; # define _XAsctime(t,p) (asctime_r((t),(p),sizeof((p))) ? NULL : (p)) # define _XCtime(t,p) (ctime_r((t),(p),sizeof((p))) ? NULL : (p)) # define _XGmtime(t,p) (gmtime_r((t),&(p)) ? NULL : &(p)) # define _XLocaltime(t,p) (localtime_r((t),&(p)) ? NULL : &(p)) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(sun) /* Returns NULL on failure. Solaris 2.5 * * extern char *asctime_r(const struct tm *tm,char *buf, int buflen); * extern char *ctime_r(const time_t *clock, char *buf, int buflen); * extern struct tm *gmtime_r(const time_t *clock, struct tm *res); * extern struct tm *localtime_r(const time_t *clock, struct tm *res); */ # ifdef TIMELEN typedef char _Xatimeparams[TIMELEN]; typedef char _Xctimeparams[TIMELEN]; # else typedef char _Xatimeparams[26]; typedef char _Xctimeparams[26]; # endif typedef struct tm _Xgtimeparams; typedef struct tm _Xltimeparams; # define _XAsctime(t,p) asctime_r((t),(p),sizeof((p))) # define _XCtime(t,p) ctime_r((t),(p),sizeof((p))) # define _XGmtime(t,p) gmtime_r((t),&(p)) # define _XLocaltime(t,p) localtime_r((t),&(p)) #else /* defined(_POSIX_THREAD_SAFE_FUNCTIONS) */ /* POSIX final API. OSF/1 v4.0, AIX, etc. * * extern char *asctime_r(const struct tm *timeptr, char *buffer); * extern char *ctime_r(const time_t *timer, char *buffer); * extern struct tm *gmtime_r(const time_t *timer, struct tm *result); * extern struct tm *localtime_r(const time_t *timer, struct tm *result); */ # if defined(__osf__) /* OSF/1 V4.0 doesn't declare the _P routines, breaking under C++. */ extern char *_Pasctime_r(const struct tm *, char *); extern char *_Pctime_r(const time_t *, char *); extern struct tm *_Plocaltime_r(const time_t *, struct tm *); # endif # ifdef TIMELEN typedef char _Xatimeparams[TIMELEN]; typedef char _Xctimeparams[TIMELEN]; # else typedef char _Xatimeparams[26]; typedef char _Xctimeparams[26]; # endif typedef struct tm _Xgtimeparams; typedef struct tm _Xltimeparams; # define _XAsctime(t,p) asctime_r((t),(p)) # define _XCtime(t,p) ctime_r((t),(p)) # define _XGmtime(t,p) gmtime_r((t),&(p)) # define _XLocaltime(t,p) localtime_r((t),&(p)) #endif /* X_INCLUDE_TIME_H */ #if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H) # define _XOS_INCLUDED_TIME_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * NOTE: On systems lacking appropriate _r functions Getgrgid() and * Getgrnam() do NOT copy the list of group members! * * Remember that fgetgrent(), setgrent(), getgrent(), and endgrent() * are not included in POSIX. * * #define X_INCLUDE_GRP_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgetgrparams; * * struct group *_XGetgrgid(gid_t, _Xgetgrparams); * struct group *_XGetgrnam(const char *, _Xgetgrparams); */ #if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_GRPAPI) # define XOS_USE_MTSAFE_GRPAPI 1 # endif #endif #if !defined(X_INCLUDE_GRP_H) || defined(_XOS_INCLUDED_GRP_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xgetgrparams; /* dummy */ #define _XGetgrgid(g,p) getgrgid((g)) #define _XGetgrnam(n,p) getgrnam((n)) #elif !defined(XOS_USE_MTSAFE_GRPAPI) || defined(XNO_MTSAFE_GRPAPI) /* Systems with thread support but no _r API. UnixWare 2.0. */ typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ struct group *pgrp; size_t len; } _Xgetgrparams; #ifdef SVR4 /* Copy the gr_passwd field too. */ # define _Xgrp_copyGroup(p) \ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \ ((p).grp.gr_name = (p).buf), \ ((p).len = strlen((p).pgrp->gr_name)), \ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \ ((p).grp.gr_passwd = (p).grp.gr_name + (p).len + 1), \ ((p).pgrp = &(p).grp), \ 0 ) #else # define _Xgrp_copyGroup(p) \ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \ ((p).grp.gr_name = (p).buf), \ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \ ((p).pgrp = &(p).grp), \ 0 ) #endif #define _XGetgrgid(g,p) \ ( (_Xos_processLock), \ (((p).pgrp = getgrgid((g))) ? _Xgrp_copyGroup(p) : 0), \ (_Xos_processUnlock), \ (p).pgrp ) #define _XGetgrnam(n,p) \ ( (_Xos_processLock), \ (((p).pgrp = getgrnam((n))) ? _Xgrp_copyGroup(p) : 0), \ (_Xos_processUnlock), \ (p).pgrp ) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (defined(sun) || defined(__osf__)) /* Non-POSIX API. Solaris, DEC v3.2. * * extern struct group *getgrgid_r(gid_t, struct group *, char *, int); * extern struct group *getgrnam_r(const char *, struct group *, char *, int); */ typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ } _Xgetgrparams; #define _XGetgrgid(g,p) getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf)) #define _XGetgrnam(n,p) getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf)) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) /* Non-POSIX API. HP/UX 10, AIX 4. * * extern int getgrgid_r(gid_t, struct group *, char *, int); * extern int getgrnam_r(const char *, struct group *, char *, int); */ typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ } _Xgetgrparams; #define _XGetgrgid(g,p) \ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp)) #define _XGetgrnam(n,p) \ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp)) #else /* POSIX final API. DEC v4.0, IRIX 6.2. * * int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); * int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); */ # if defined(__osf__) /* OSF/1 V4.0 doesn't declare the _P routines, breaking under C++. */ extern int _Pgetgrgid_r(gid_t, struct group *, char *, size_t, struct group **); extern int _Pgetgrnam_r(const char *, struct group *, char *, size_t, struct group **); # endif typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ struct group *result; } _Xgetgrparams; #define _XGetgrgid(g,p) \ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \ NULL : (p).result)) #define _XGetgrnam(n,p) \ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \ NULL : (p).result)) #endif #if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H) # define _XOS_INCLUDED_GRP_H #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif motif-2.3.8/lib/Xm/Makefile.in0000644000175000017500000015757113211512767013007 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/Xm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__noinst_HEADERS_DIST) \ $(xm_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h Xm.h CONFIG_CLEAN_FILES = xmstring.list CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(xmdir)" \ "$(DESTDIR)$(xmdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libXm_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__libXm_la_SOURCES_DIST = XmStrDefs.c ArrowB.c ArrowBG.c BulletinB.c \ CallbackI.c CascadeB.c CascadeBG.c Command.c CutPaste.c Dest.c \ DialogS.c DialogSE.c DragBS.c DragC.c DragOverS.c DragICC.c \ DragIcon.c DragUnder.c DrawingA.c DrawnB.c DropSMgr.c \ DropSMgrI.c DropTrans.c ExtObject.c FileSB.c Form.c Frame.c \ Gadget.c GadgetUtil.c GeoUtils.c ImageCache.c Label.c LabelG.c \ List.c MainW.c MapEvents.c MenuShell.c MenuUtil.c MessageB.c \ PanedW.c PushB.c PushBG.c ReadImage.c Region.c ResConvert.c \ ResInd.c RowColumn.c Sash.c Scale.c ScrollBar.c ScrolledW.c \ SelectioB.c SeparatoG.c Separator.c Simple.c Text.c TextIn.c \ TextOut.c TextStrSo.c TextSel.c ToggleB.c ToggleBG.c \ TrackLoc.c UniqueEvnt.c VaSimple.c VirtKeys.c XmString.c \ ResEncod.c TextF.c TextFSel.c AtomMgr.c Cache.c Protocols.c \ Primitive.c Manager.c Traversal.c TravAct.c TraversalI.c \ BaseClass.c Desktop.c Messages.c Transltns.c RepType.c Xmos.c \ Draw.c TearOff.c TearOffB.c XmIm.c GMUtils.c Display.c \ Screen.c ShellE.c VendorS.c VendorSE.c RCMenu.c RCLayout.c \ GetPixData.c RCPopup.c Trait.c Synthetic.c XmFontList.c \ ClipWindow.c Transfer.c Hash.c ScrollFrameT.c XmTabList.c \ Resolve.c XmStringFunc.c XmRenderT.c PixConv.c Color.c Xm.c \ CareVisualT.c Direction.c XmStringObso.c XmStringGet.c \ IsMwmRun.c MenuProc.c MenuState.c TextFind.c TextFunc.c \ ColorObj.c IconFile.c RCHook.c GetRes.c BBUtil.c ChColor.c \ ColObjFunc.c DrTog.c DrArrow.c DrPoly.c DrHiDash.c ValTime.c \ FocusAct.c CvtUnit.c ScalTics.c ScroVis.c WidGet.c PrintS.c \ Obso1_2.c ObsoStr.c ObsoXme.c Obso2_0.c XpmAttrib.c \ XpmCrIFrDat.c XpmInfo.c XpmWrFFrDat.c Xpmmisc.c XpmCrBufFrI.c \ XpmCrIFrP.c XpmRdFToBuf.c XpmWrFFrI.c Xpmparse.c XpmCrBufFrP.c \ XpmCrPFrBuf.c XpmRdFToDat.c XpmWrFFrP.c Xpmrgb.c XpmCrDatFrI.c \ XpmCrPFrDat.c XpmRdFToI.c Xpmcreate.c Xpmscan.c Xpms_popen.c \ XpmCrDatFrP.c XpmCrPFrI.c XpmRdFToP.c Xpmdata.c XpmCrIFrBuf.c \ XpmImage.c XpmWrFFrBuf.c Xpmhashtab.c IconH.c Container.c \ IconG.c Notebook.c ComboBox.c GrabShell.c SpinB.c SSpinB.c \ TxtPropCv.c XmStringSeg.c TranslNew.c SlideC.c ToolTip.c \ EditresCom.c XmExtUtil.c Column.c ButtonBox.c ColorS.c \ Picture.c DataFSel.c DataF.c MultiList.c I18List.c Paned.c \ FontS.c IconBox.c IconButton.c xmlist.c Hierarchy.c Outline.c \ TabBox.c TabList.c TabStack.c DrawUtils.c Tree.c DropDown.c \ XmStrDefs.ht XmStrDefs22.ht XmStrDefs23.ht XmStrDefsI.ht \ Jpeg.c Png.c am__objects_1 = XmStrDefs.lo ArrowB.lo ArrowBG.lo BulletinB.lo \ CallbackI.lo CascadeB.lo CascadeBG.lo Command.lo CutPaste.lo \ Dest.lo DialogS.lo DialogSE.lo DragBS.lo DragC.lo DragOverS.lo \ DragICC.lo DragIcon.lo DragUnder.lo DrawingA.lo DrawnB.lo \ DropSMgr.lo DropSMgrI.lo DropTrans.lo ExtObject.lo FileSB.lo \ Form.lo Frame.lo Gadget.lo GadgetUtil.lo GeoUtils.lo \ ImageCache.lo Label.lo LabelG.lo List.lo MainW.lo MapEvents.lo \ MenuShell.lo MenuUtil.lo MessageB.lo PanedW.lo PushB.lo \ PushBG.lo ReadImage.lo Region.lo ResConvert.lo ResInd.lo \ RowColumn.lo Sash.lo Scale.lo ScrollBar.lo ScrolledW.lo \ SelectioB.lo SeparatoG.lo Separator.lo Simple.lo Text.lo \ TextIn.lo TextOut.lo TextStrSo.lo TextSel.lo ToggleB.lo \ ToggleBG.lo TrackLoc.lo UniqueEvnt.lo VaSimple.lo VirtKeys.lo \ XmString.lo ResEncod.lo TextF.lo TextFSel.lo AtomMgr.lo \ Cache.lo Protocols.lo Primitive.lo Manager.lo Traversal.lo \ TravAct.lo TraversalI.lo BaseClass.lo @PRINTING_TRUE@am__objects_2 = PrintS.lo am__objects_3 = Desktop.lo Messages.lo Transltns.lo RepType.lo Xmos.lo \ Draw.lo TearOff.lo TearOffB.lo XmIm.lo GMUtils.lo Display.lo \ Screen.lo ShellE.lo VendorS.lo VendorSE.lo RCMenu.lo \ RCLayout.lo GetPixData.lo RCPopup.lo Trait.lo Synthetic.lo \ XmFontList.lo ClipWindow.lo Transfer.lo Hash.lo \ ScrollFrameT.lo XmTabList.lo Resolve.lo XmStringFunc.lo \ XmRenderT.lo PixConv.lo Color.lo Xm.lo CareVisualT.lo \ Direction.lo XmStringObso.lo XmStringGet.lo IsMwmRun.lo \ MenuProc.lo MenuState.lo TextFind.lo TextFunc.lo ColorObj.lo \ IconFile.lo RCHook.lo GetRes.lo BBUtil.lo ChColor.lo \ ColObjFunc.lo DrTog.lo DrArrow.lo DrPoly.lo DrHiDash.lo \ ValTime.lo FocusAct.lo CvtUnit.lo ScalTics.lo ScroVis.lo \ WidGet.lo $(am__objects_2) am__objects_4 = Obso1_2.lo ObsoStr.lo ObsoXme.lo Obso2_0.lo am__objects_5 = XpmAttrib.lo XpmCrIFrDat.lo XpmInfo.lo XpmWrFFrDat.lo \ Xpmmisc.lo XpmCrBufFrI.lo XpmCrIFrP.lo XpmRdFToBuf.lo \ XpmWrFFrI.lo Xpmparse.lo XpmCrBufFrP.lo XpmCrPFrBuf.lo \ XpmRdFToDat.lo XpmWrFFrP.lo Xpmrgb.lo XpmCrDatFrI.lo \ XpmCrPFrDat.lo XpmRdFToI.lo Xpmcreate.lo Xpmscan.lo \ Xpms_popen.lo XpmCrDatFrP.lo XpmCrPFrI.lo XpmRdFToP.lo \ Xpmdata.lo XpmCrIFrBuf.lo XpmImage.lo XpmWrFFrBuf.lo \ Xpmhashtab.lo am__objects_6 = IconH.lo Container.lo IconG.lo Notebook.lo ComboBox.lo \ GrabShell.lo SpinB.lo SSpinB.lo TxtPropCv.lo XmStringSeg.lo \ TranslNew.lo am__objects_7 = SlideC.lo am__objects_8 = ToolTip.lo @OM_XMU_TRUE@am__objects_9 = EditresCom.lo am__objects_10 = XmExtUtil.lo Column.lo ButtonBox.lo ColorS.lo \ Picture.lo DataFSel.lo DataF.lo MultiList.lo I18List.lo \ Paned.lo FontS.lo IconBox.lo IconButton.lo xmlist.lo \ Hierarchy.lo Outline.lo TabBox.lo TabList.lo TabStack.lo \ DrawUtils.lo Tree.lo DropDown.lo @OM_LIBJPEG_TRUE@am__objects_11 = Jpeg.lo @OM_LIBPNG_TRUE@am__objects_12 = Png.lo am_libXm_la_OBJECTS = $(am__objects_1) $(am__objects_3) \ $(am__objects_4) $(am__objects_5) $(am__objects_6) \ $(am__objects_7) $(am__objects_8) $(am__objects_9) \ $(am__objects_10) $(am__objects_11) $(am__objects_12) libXm_la_OBJECTS = $(am_libXm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libXm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libXm_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libXm_la_SOURCES) $(EXTRA_libXm_la_SOURCES) DIST_SOURCES = $(am__libXm_la_SOURCES_DIST) $(EXTRA_libXm_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__noinst_HEADERS_DIST = BaseClassI.h BitmapsI.h BulletinBI.h \ CacheI.h CallbackI.h CareVisualTI.h CascadeBGI.h CascadeBI.h \ ClipWindTI.h CntrbmI.h ColorI.h ColorObjI.h CommandI.h \ CutPasteI.h DestI.h DisplayI.h DragBSI.h DragCI.h DragICCI.h \ DragIconI.h DragOverSI.h DragUnderI.h DrawI.h DrawingAI.h \ DropSMgrI.h ExtObjectI.h GMUtilsI.h GadgetI.h GadgetUtiI.h \ GeoUtilsI.h HashI.h IconGI.h ImageCachI.h LabelGI.h LabelI.h \ ManagerI.h MapEventsI.h MenuProcI.h MenuShellI.h MenuStateI.h \ MenuUtilI.h MessageBI.h MessagesI.h PixConvI.h PrimitiveI.h \ PrintSI.h ProtocolsI.h RCHookI.h RCLayoutI.h RCMenuI.h \ ReadImageI.h RegionI.h RepTypeI.h ResConverI.h ResEncodI.h \ ResIndI.h RowColumnI.h ScreenI.h ScrollFramTI.h ScrolledWI.h \ SelectioBI.h SeparatoGI.h SyntheticI.h TearOffI.h TextDIconI.h \ TextFI.h TextFSelI.h TextI.h TextInI.h TextOutI.h TextSelI.h \ TextStrSoI.h ToggleBGI.h TraitI.h TransferI.h TravActI.h \ TraversalI.h UniqueEvnI.h VaSimpleI.h VendorSEI.h VendorSI.h \ VirtKeysI.h XmI.h XmImI.h XmMsgI.h XmRenderTI.h XmStrDefsI.h \ XmStringI.h XmTabListI.h XmosI.h XpmI.h EditresComI.h JpegI.h \ PngI.h ToolTipI.h HEADERS = $(nodist_xm_HEADERS) $(noinst_HEADERS) $(xm_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)Xm.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Xm.h.in \ $(srcdir)/xmstring.list.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ XMSTRING_LIST = xmstring.list MAINTAINERCLEANFILES = Makefile.in CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = xmstring.list Xm.msg \ XmStrDefs.ct INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \ -DINCDIR=\"@INCDIR@\" \ -DLIBDIR=\"@LIBDIR@\" \ ${X_CFLAGS} xmdir = $(includedir)/Xm libXm_la_LDFLAGS = -version-info @CURRENT@:@REVISION@:@AGE@ lib_LTLIBRARIES = libXm.la TIP_SRCS = ToolTip.c TIP_HDRS = ToolTipI.h EXTRA_HDRS = Ext.h ExtP.h \ Column.h ColumnP.h \ ButtonBox.h ButtonBoxP.h \ ColorS.h ColorSP.h \ Picture.h PictureP.h DataF.h DataFP.h DataFSelP.h \ Ext18List.h Ext18ListP.h MultiList.h MultiListP.h \ Paned.h PanedP.h FontS.h FontSP.h \ IconBox.h IconBoxP.h IconButton.h IconButtonP.h xmlist.h \ Hierarchy.h HierarchyP.h Outline.h OutlineP.h \ TabBox.h TabBoxP.h TabStack.h TabStackP.h \ TabList.h DrawUtils.h Tree.h TreeP.h \ ComboBox2.h ComboBox2P.h DropDown.h DropDownP.h \ ToolTipT.h ToolTipCT.h EXTRA_SRCS = XmExtUtil.c \ Column.c ButtonBox.c ColorS.c Picture.c DataFSel.c DataF.c \ MultiList.c I18List.c Paned.c FontS.c IconBox.c IconButton.c xmlist.c \ Hierarchy.c Outline.c TabBox.c TabList.c TabStack.c \ DrawUtils.c Tree.c DropDown.c \ XmStrDefs.ht XmStrDefs22.ht XmStrDefs23.ht XmStrDefsI.ht SLIDE_HDRS = SlideC.h SlideCP.h SLIDE_SRCS = SlideC.c @OM_XMU_FALSE@EDITRES_SRCS = @OM_XMU_TRUE@EDITRES_SRCS = EditresCom.c @OM_LIBJPEG_FALSE@JPEG_SRCS = @OM_LIBJPEG_TRUE@JPEG_SRCS = Jpeg.c @OM_LIBJPEG_FALSE@JPEG_HDRS = @OM_LIBJPEG_TRUE@JPEG_HDRS = JpegI.h @OM_LIBPNG_FALSE@PNG_SRCS = @OM_LIBPNG_TRUE@PNG_SRCS = Png.c @OM_LIBPNG_FALSE@PNG_HDRS = @OM_LIBPNG_TRUE@PNG_HDRS = PngI.h @PRINTING_FALSE@PRINTS_SRC = @PRINTING_TRUE@PRINTS_SRC = PrintS.c libXm_la_LIBADD = ${X_LIBS} ${X_XMU} -lXt -lXext ${LIB_XP} -lX11 ${X_EXTRA_LIBS} noinst_HEADERS = BaseClassI.h \ BitmapsI.h \ BulletinBI.h \ CacheI.h \ CallbackI.h \ CareVisualTI.h \ CascadeBGI.h \ CascadeBI.h \ ClipWindTI.h \ CntrbmI.h \ ColorI.h \ ColorObjI.h \ CommandI.h \ CutPasteI.h \ DestI.h \ DisplayI.h \ DragBSI.h \ DragCI.h \ DragICCI.h \ DragIconI.h \ DragOverSI.h \ DragUnderI.h \ DrawI.h \ DrawingAI.h \ DropSMgrI.h \ ExtObjectI.h \ GMUtilsI.h \ GadgetI.h \ GadgetUtiI.h \ GeoUtilsI.h \ HashI.h \ IconGI.h \ ImageCachI.h \ LabelGI.h \ LabelI.h \ ManagerI.h \ MapEventsI.h \ MenuProcI.h \ MenuShellI.h \ MenuStateI.h \ MenuUtilI.h \ MessageBI.h \ MessagesI.h \ PixConvI.h \ PrimitiveI.h \ PrintSI.h \ ProtocolsI.h \ RCHookI.h \ RCLayoutI.h \ RCMenuI.h \ ReadImageI.h \ RegionI.h \ RepTypeI.h \ ResConverI.h \ ResEncodI.h \ ResIndI.h \ RowColumnI.h \ ScreenI.h \ ScrollFramTI.h \ ScrolledWI.h \ SelectioBI.h \ SeparatoGI.h \ SyntheticI.h \ TearOffI.h \ TextDIconI.h \ TextFI.h \ TextFSelI.h \ TextI.h \ TextInI.h \ TextOutI.h \ TextSelI.h \ TextStrSoI.h \ ToggleBGI.h \ TraitI.h \ TransferI.h \ TravActI.h \ TraversalI.h \ UniqueEvnI.h \ VaSimpleI.h \ VendorSEI.h \ VendorSI.h \ VirtKeysI.h \ XmI.h \ XmImI.h \ XmMsgI.h \ XmRenderTI.h \ XmStrDefsI.h \ XmStringI.h \ XmTabListI.h \ XmosI.h \ XpmI.h \ EditresComI.h \ $(JPEG_HDRS) \ $(PNG_HDRS) \ $(TIP_HDRS) xm_HEADERS = ArrowB.h ArrowBG.h ArrowBGP.h ArrowBP.h \ BulletinB.h BulletinBP.h CacheP.h CascadeB.h \ CascadeBG.h CascadeBGP.h CascadeBP.h Command.h \ CommandP.h CutPaste.h DialogS.h \ DialogSP.h DialogSEP.h DragC.h DragCP.h \ DragDrop.h DragIcon.h DragIconP.h DragOverS.h \ DragOverSP.h DropTransP.h DropSMgr.h DropSMgrP.h \ DropTrans.h DrawingA.h DrawingAP.h DrawnB.h \ DrawnBP.h FileSB.h FileSBP.h Form.h \ FormP.h Frame.h FrameP.h Label.h \ LabelG.h LabelGP.h LabelP.h List.h \ ListP.h MainW.h MainWP.h MenuShell.h \ MenuShellP.h MessageB.h MessageBP.h PanedW.h \ PanedWP.h PushB.h PushBG.h PushBGP.h \ PushBP.h RCLayoutP.h RowColumn.h RowColumnP.h \ SashP.h Scale.h ScaleP.h ScrollBar.h \ ScrollBarP.h ScrolledW.h ScrolledWP.h SelectioB.h \ SelectioBP.h SeparatoG.h SeparatoGP.h Separator.h \ SeparatorP.h TextF.h TextFP.h TextFSelP.h \ TextSelP.h Text.h TextInP.h TextOutP.h \ TextP.h TextStrSoP.h ToggleB.h ToggleBG.h \ ToggleBGP.h ToggleBP.h XmP.h \ BaseClassP.h ManagerP.h PrimitiveP.h GadgetP.h \ XmStrDefs.h XmStrDefs22.h XmStrDefs23.h \ VaSimpleP.h VirtKeys.h VirtKeysP.h \ ExtObjectP.h Display.h DisplayP.h Screen.h \ ScreenP.h ShellEP.h VendorS.h VendorSP.h \ VendorSEP.h DesktopP.h AtomMgr.h \ Protocols.h ProtocolsP.h MwmUtil.h TransltnsP.h \ RepType.h XmosP.h Xmos_r.h DrawP.h \ Xmpoll.h TearOffP.h \ TearOffBP.h MenuUtilP.h MenuT.h XmAll.h \ TraitP.h SpinB.h SpinBP.h SSpinB.h \ SSpinBP.h \ Container.h ContainerP.h IconG.h IconGP.h \ Notebook.h NotebookP.h ContItemT.h ContainerT.h \ RCMenuP.h ClipWindowP.h TransferT.h \ Transfer.h AccTextT.h NavigatorT.h IconFileP.h\ ScrollFrameT.h GrabShell.h GrabShellP.h ComboBox.h \ ComboBoxP.h XmIm.h IconFile.h AccColorT.h\ ActivatableT.h JoinSideT.h SpecRenderT.h \ CareVisualT.h DialogSavvyT.h TransferP.h TakesDefT.h \ ColorP.h Primitive.h Manager.h \ Gadget.h LayoutT.h IconH.h IconHP.h \ UnitTypeT.h TxtPropCv.h MenuProcP.h MenuStateP.h\ ColorObjP.h TravConT.h UnhighlightT.h PointInT.h \ Print.h PrintSP.h XpmP.h Xmfuncs.h \ ${SLIDE_HDRS} ${EXTRA_HDRS} nodist_xm_HEADERS = Xm.h SRCS1 = XmStrDefs.c ArrowB.c ArrowBG.c BulletinB.c CallbackI.c \ CascadeB.c CascadeBG.c Command.c CutPaste.c \ Dest.c DialogS.c DialogSE.c DragBS.c \ DragC.c DragOverS.c DragICC.c DragIcon.c \ DragUnder.c DrawingA.c DrawnB.c DropSMgr.c \ DropSMgrI.c DropTrans.c ExtObject.c FileSB.c \ Form.c Frame.c Gadget.c GadgetUtil.c \ GeoUtils.c ImageCache.c Label.c LabelG.c \ List.c MainW.c MapEvents.c MenuShell.c \ MenuUtil.c MessageB.c PanedW.c PushB.c \ PushBG.c ReadImage.c Region.c ResConvert.c \ ResInd.c RowColumn.c Sash.c \ Scale.c ScrollBar.c ScrolledW.c SelectioB.c \ SeparatoG.c Separator.c Simple.c Text.c \ TextIn.c TextOut.c TextStrSo.c TextSel.c \ ToggleB.c ToggleBG.c TrackLoc.c UniqueEvnt.c \ VaSimple.c VirtKeys.c XmString.c ResEncod.c\ TextF.c TextFSel.c AtomMgr.c \ Cache.c Protocols.c Primitive.c Manager.c \ Traversal.c TravAct.c TraversalI.c BaseClass.c SRCS2 = Desktop.c Messages.c Transltns.c RepType.c \ Xmos.c Draw.c TearOff.c TearOffB.c \ XmIm.c GMUtils.c Display.c Screen.c \ ShellE.c VendorS.c VendorSE.c RCMenu.c \ RCLayout.c GetPixData.c RCPopup.c Trait.c \ Synthetic.c XmFontList.c ClipWindow.c Transfer.c \ Hash.c ScrollFrameT.c \ XmTabList.c Resolve.c XmStringFunc.c \ XmRenderT.c PixConv.c Color.c Xm.c \ CareVisualT.c Direction.c XmStringObso.c XmStringGet.c \ IsMwmRun.c MenuProc.c MenuState.c TextFind.c \ TextFunc.c ColorObj.c IconFile.c RCHook.c \ GetRes.c BBUtil.c ChColor.c ColObjFunc.c \ DrTog.c DrArrow.c DrPoly.c DrHiDash.c \ ValTime.c FocusAct.c CvtUnit.c ScalTics.c \ ScroVis.c WidGet.c $(PRINTS_SRC) OBSO_SRCS = Obso1_2.c ObsoStr.c ObsoXme.c Obso2_0.c XPM_SRCS = \ XpmAttrib.c XpmCrIFrDat.c XpmInfo.c XpmWrFFrDat.c Xpmmisc.c \ XpmCrBufFrI.c XpmCrIFrP.c XpmRdFToBuf.c XpmWrFFrI.c Xpmparse.c\ XpmCrBufFrP.c XpmCrPFrBuf.c XpmRdFToDat.c XpmWrFFrP.c Xpmrgb.c \ XpmCrDatFrI.c XpmCrPFrDat.c XpmRdFToI.c Xpmcreate.c Xpmscan.c \ Xpms_popen.c XpmCrDatFrP.c XpmCrPFrI.c XpmRdFToP.c Xpmdata.c \ XpmCrIFrBuf.c XpmImage.c XpmWrFFrBuf.c Xpmhashtab.c NEW_WID_SRCS = IconH.c Container.c IconG.c \ Notebook.c ComboBox.c GrabShell.c SpinB.c \ SSpinB.c TxtPropCv.c XmStringSeg.c TranslNew.c libXm_la_SOURCES = $(SRCS1) $(SRCS2) $(OBSO_SRCS) $(XPM_SRCS) $(NEW_WID_SRCS) $(SLIDE_SRCS) \ $(TIP_SRCS) $(EDITRES_SRCS) $(EXTRA_SRCS) $(JPEG_SRCS) $(PNG_SRCS) EXTRA_libXm_la_SOURCES = $(SLIDE_SRCS) $(TIP_SRCS) STRING_FILES = XmStrDefs.h XmStrDefs22.h XmStrDefs23.h XmStrDefsI.h XmStrDefs.c BUILT_SOURCES = $(STRING_FILES) $(CAT_FILES) @MessageCatalog_TRUE@CAT_FILES = Xm.cat XmMsgCatI.h @MessageCatalog_FALSE@SPLINT_EXTRAFLAGS = -I/usr/include -I. -DNO_MESSAGE_CATALOG +posixlib -nestcomment @MessageCatalog_TRUE@SPLINT_EXTRAFLAGS = -I/usr/include -I. +posixlib -nestcomment all: $(BUILT_SOURCES) Xm.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Xm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Xm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): Xm.h: stamp-h2 @test -f $@ || rm -f stamp-h2 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2 stamp-h2: $(srcdir)/Xm.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status lib/Xm/Xm.h distclean-hdr: -rm -f Xm.h stamp-h2 xmstring.list: $(top_builddir)/config.status $(srcdir)/xmstring.list.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libXm.la: $(libXm_la_OBJECTS) $(libXm_la_DEPENDENCIES) $(EXTRA_libXm_la_DEPENDENCIES) $(AM_V_CCLD)$(libXm_la_LINK) -rpath $(libdir) $(libXm_la_OBJECTS) $(libXm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArrowB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArrowBG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AtomMgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BBUtil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BaseClass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BulletinB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ButtonBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CallbackI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CareVisualT.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CascadeB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CascadeBG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChColor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClipWindow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ColObjFunc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ColorObj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ColorS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Column.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ComboBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Command.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Container.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CutPaste.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CvtUnit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DataF.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DataFSel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Desktop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DialogS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DialogSE.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Direction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DrArrow.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DrHiDash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DrPoly.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DrTog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DragBS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DragC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DragICC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DragIcon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DragOverS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DragUnder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Draw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DrawUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DrawingA.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DrawnB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DropDown.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DropSMgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DropSMgrI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DropTrans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EditresCom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExtObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileSB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FocusAct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FontS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Form.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Frame.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GMUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gadget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GadgetUtil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GeoUtils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GetPixData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GetRes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrabShell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Hierarchy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/I18List.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IconBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IconButton.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IconFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IconG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IconH.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ImageCache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IsMwmRun.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Jpeg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Label.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LabelG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/List.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MainW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MapEvents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MenuProc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MenuShell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MenuState.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MenuUtil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MessageB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Messages.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MultiList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Notebook.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Obso1_2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Obso2_0.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ObsoStr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ObsoXme.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Outline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Paned.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PanedW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Picture.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PixConv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Png.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Primitive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PrintS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Protocols.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PushB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PushBG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RCHook.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RCLayout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RCMenu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RCPopup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ReadImage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Region.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RepType.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResConvert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResEncod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResInd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Resolve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RowColumn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SSpinB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Sash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScalTics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Scale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Screen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScroVis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScrollBar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScrollFrameT.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScrolledW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SelectioB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SeparatoG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Separator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShellE.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Simple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SlideC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SpinB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Synthetic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TabBox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TabList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TabStack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TearOff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TearOffB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextF.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextFSel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextFind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextFunc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextIn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextOut.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextSel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TextStrSo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ToggleB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ToggleBG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ToolTip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TrackLoc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Trait.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Transfer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TranslNew.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Transltns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TravAct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Traversal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraversalI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TxtPropCv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UniqueEvnt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VaSimple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ValTime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VendorS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VendorSE.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VirtKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WidGet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmExtUtil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmFontList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmIm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmRenderT.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmStrDefs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmStringFunc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmStringGet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmStringObso.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmStringSeg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XmTabList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xmos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmAttrib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrBufFrI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrBufFrP.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrDatFrI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrDatFrP.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrIFrBuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrIFrDat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrIFrP.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrPFrBuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrPFrDat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmCrPFrI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmImage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmRdFToBuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmRdFToDat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmRdFToI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmRdFToP.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmWrFFrBuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmWrFFrDat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmWrFFrI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XpmWrFFrP.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpmcreate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpmdata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpmhashtab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpmmisc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpmparse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpmrgb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpms_popen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xpmscan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlist.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_xmHEADERS: $(nodist_xm_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_xm_HEADERS)'; test -n "$(xmdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xmdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xmdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xmdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(xmdir)" || exit $$?; \ done uninstall-nodist_xmHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_xm_HEADERS)'; test -n "$(xmdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xmdir)'; $(am__uninstall_files_from_dir) install-xmHEADERS: $(xm_HEADERS) @$(NORMAL_INSTALL) @list='$(xm_HEADERS)'; test -n "$(xmdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xmdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xmdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xmdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(xmdir)" || exit $$?; \ done uninstall-xmHEADERS: @$(NORMAL_UNINSTALL) @list='$(xm_HEADERS)'; test -n "$(xmdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xmdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) Xm.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(xmdir)" "$(DESTDIR)$(xmdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_xmHEADERS install-xmHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-nodist_xmHEADERS \ uninstall-xmHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-man install-nodist_xmHEADERS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-xmHEADERS installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-libLTLIBRARIES uninstall-nodist_xmHEADERS \ uninstall-xmHEADERS .PRECIOUS: Makefile $(top_builddir)/config/util/makestrs: ( cd $(top_builddir)/config/util && $(MAKE) $(AM_MAKEFLAGS) makestrs ) $(STRING_FILES): Makefile $(XMSTRING_LIST) XmStrDefs.ht XmStrDefsI.ht XmStrDefs.ct $(top_builddir)/config/util/makestrs test -f $(XMSTRING_LIST) || $(LN_S) $(srcdir)/$(XMSTRING_LIST) $(XMSTRING_LIST) test -f XmStrDefs.ht || $(LN_S) $(srcdir)/XmStrDefs.ht XmStrDefs.ht test -f XmStrDefs22.ht || $(LN_S) $(srcdir)/XmStrDefs22.ht XmStrDefs22.ht test -f XmStrDefs23.ht || $(LN_S) $(srcdir)/XmStrDefs23.ht XmStrDefs23.ht test -f XmStrDefsI.ht || $(LN_S) $(srcdir)/XmStrDefsI.ht XmStrDefsI.ht test -f XmStrDefs.ct || $(LN_S) $(srcdir)/XmStrDefs.ct XmStrDefs.ct $(top_builddir)/config/util/makestrs -f $(XMSTRING_LIST) >XmStrDefs.c @MessageCatalog_TRUE@$(CAT_FILES): Xm.msg @MessageCatalog_TRUE@ $(mkinstalldirs) $(top_builddir)/localized/C/msg @MessageCatalog_TRUE@ $(top_builddir)/localized/util/mkcatdefs XmMsgCatI.h $(srcdir)/Xm.msg >$(top_builddir)/localized/C/msg/Xm.msg @MessageCatalog_TRUE@ gencat Xm.cat $(top_builddir)/localized/C/msg/Xm.msg splint: $(STRING_FILES) $(SPLINT) $(INCLUDES) $(SPLINT_EXTRAFLAGS) $(top_srcdir)/lib/Xm/*.c #include $(srcdir)/check_headers.am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/lib/Xm/OutlineP.h0000644000175000017500000001435112672140200012623 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmOutlineP_h #define _XmOutlineP_h #if defined(VMS) || defined(__VMS) #include #endif /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include #ifdef __cplusplus extern "C" { #endif /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ /************************************************************ * MACROS *************************************************************/ #define XmOutline_top_node_of_display(w) (((XmOutlineWidget)(w))->outline.top_node_of_display) #define XmOutline_max_width(w) (((XmOutlineWidget)(w))->outline.max_width) #define XmOutline_max_widget_width(w) (((XmOutlineWidget)(w))->outline.max_widget_width) #define XmOutline_child_op_list(w) (((XmOutlineWidget)(w))->outline.child_op_list) #define XmOutline_ul_point(w) (((XmOutlineWidget)(w))->outline.ul_point) #define XmOutline_lr_point(w) (((XmOutlineWidget)(w))->outline.lr_point) #define XmOutline_draw_gc(w) (((XmOutlineWidget)(w))->outline.draw_gc) #define XmOutline_indent_space(w) (((XmOutlineWidget)(w))->outline.indent_space) #define XmOutline_constrain_width(w) (((XmOutlineWidget)(w))->outline.constrain_width) #define XmOutline_connect_nodes(w) (((XmOutlineWidget)(w))->outline.connect_nodes) #define XmOutlineC_top_node_of_display(c) (((XmOutlineConstraintPtr)(c))->outline.top_node_of_display) #define XmOutlineC_widget_x(c) (((XmOutlineConstraintPtr)(c))->outline.widget_x) #define XmOutlineC_open_close_x(c) (((XmOutlineConstraintPtr)(c))->outline.open_close_x) #define XmOutlineC_height(c) (((XmOutlineConstraintPtr)(c))->outline.height) #define XmOutlineC_new_x(c) (((XmOutlineConstraintPtr)(c))->outline.new_x) #define XmOutlineC_new_y(c) (((XmOutlineConstraintPtr)(c))->outline.new_y) #define XmOutlineC_oc_new_x(c) (((XmOutlineConstraintPtr)(c))->outline.oc_new_x) #define XmOutlineC_oc_new_y(c) (((XmOutlineConstraintPtr)(c))->outline.oc_new_y) #define XmOutlineC_map(c) (((XmOutlineConstraintPtr)(c))->outline.map) #define XmOutlineC_unmap(c) (((XmOutlineConstraintPtr)(c))->outline.unmap) #define XmOutlineC_move(c) (((XmOutlineConstraintPtr)(c))->outline.move) /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ typedef void (*XmOutlineCalcLocationProc)(Widget, Boolean); typedef int (*XmOutlineMaxWidthProc)(Widget); typedef struct { /*Calculates the maximum width of the outline.*/ XmOutlineMaxWidthProc calc_max_width; /* Calculates the locations of the objects. */ XmOutlineCalcLocationProc calc_locations; /* Just in case we need it later. */ XtPointer extension; } OutlineClassPart; typedef struct _XmOutlineClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; HierarchyClassPart hierarchy_class; OutlineClassPart outline_class; } XmOutlineClassRec; externalref XmOutlineClassRec xmOutlineClassRec; typedef struct _OutlineNodeInfo { /* * Public (Resource) data. */ /* * Private data. */ HierarchyConstraintRec * top_node_of_display; Position widget_x, open_close_x; /*location of node and open/close button*/ Dimension height; /* height of this row (max of node and open button). */ Position new_x, new_y, oc_new_x, oc_new_y; Boolean map, unmap, move; } OutlineNodeInfo; typedef OutlineNodeInfo XmOutlineConstraintPart; typedef struct _OutlineConstraintRec { XmManagerConstraintPart manager; HierNodeInfo hierarchy; OutlineNodeInfo outline; } XmOutlineConstraintRec, OutlineConstraintRec, *OutlineConstraints, *XmOutlineConstraintPtr; typedef struct _OutlinePart { /* Resources */ Dimension indent_space; /* The number of pixels to indent each level */ /* Private State */ OutlineConstraints top_node_of_display; Dimension max_width; /* Width of the widest row. */ Dimension max_widget_width; /* Width of the widgets in the widest row. */ XmList child_op_list; /* List of child operations */ XPoint ul_point, lr_point; /* Bounding box for exposure compression */ /* more resources */ Boolean constrain_width; Boolean connect_nodes; /* more private */ GC draw_gc; } OutlinePart; typedef OutlinePart XmOutlinePart; typedef struct _XmOutlineRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; HierarchyPart hierarchy; OutlinePart outline; } XmOutlineRec; #define XtInheritCalcMaxWidth ((XmOutlineMaxWidthProc)_XtInherit) #define XtInheritCalcLocations ((XmOutlineCalcLocationProc)_XtInherit) /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ extern XmOutlineClassRec xiOutlineClassRec; /************************************************************ * STATIC DECLARATIONS *************************************************************/ #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _OutlineP_h */ motif-2.3.8/lib/Xm/ComboBoxP.h0000644000175000017500000001137312672140200012715 00000000000000/* $XConsortium: ComboBoxP.h /main/8 1995/09/19 23:00:21 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* ComboBoxP.h */ #ifndef _XmComboBoxP_H #define _XmComboBoxP_H #include #include #ifdef __cplusplus extern "C" { #endif /* New fields for the ComboBox widget class record. */ typedef struct _XmComboBoxClassPart { XtPointer extension; /* Pointer to extension record. */ } XmComboBoxClassPart; /* Full class record declaration. */ typedef struct _XmComboBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmComboBoxClassPart combo_box_class; } XmComboBoxClassRec; externalref XmComboBoxClassRec xmComboBoxClassRec; /* * New fields for the ComboBox widget record. */ typedef struct _XmComboBoxPart { /* Resources */ unsigned char type; unsigned char match_behavior; Dimension highlight_thickness; Dimension arrow_size; Dimension arrow_spacing; Dimension margin_width; Dimension margin_height; XtCallbackList selection_callback; XmString selected_item; /* synthetic, not updated */ int selected_position; XmFontList render_table; /* Internal data */ Widget list_shell; Widget list; /* Now accessible as a resource */ Widget scrolled_w; Widget vsb; Widget hsb; int ideal_ebheight; int ideal_ebwidth; GC arrow_GC; XRectangle hit_rect; Dimension arrow_shadow_width; Boolean arrow_pressed; Boolean highlighted; Boolean scrolling; XtEnum shell_state; /* NOTE that text_changed is also used for MT_safe resolution of * the XmNRenderTable, XmNFontList resource settings */ Boolean text_changed; /* New resources/data for CDE compatibility. */ Widget edit_box; XmStringTable items; int item_count; int visible_item_count; short columns; XtEnum position_mode; } XmComboBoxPart; /* Full instance record declaration. */ typedef struct _XmComboBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmComboBoxPart combo_box; } XmComboBoxRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ /* Access macros */ #define CB_ArrowPressed(w) (((XmComboBoxWidget)(w))->combo_box.arrow_pressed) #define CB_ArrowSize(w) (((XmComboBoxWidget)(w))->combo_box.arrow_size) #define CB_ArrowSpacing(w) (((XmComboBoxWidget)(w))->combo_box.arrow_spacing) #define CB_EditBox(w) (((XmComboBoxWidget)(w))->combo_box.edit_box) #define CB_HighlightThickness(w) \ (((XmComboBoxWidget)(w))->combo_box.highlight_thickness) #define CB_Highlighted(w) (((XmComboBoxWidget)(w))->combo_box.highlighted) #define CB_HitRect(w) (((XmComboBoxWidget)(w))->combo_box.hit_rect) #define CB_List(w) (((XmComboBoxWidget)(w))->combo_box.list) #define CB_ListShell(w) (((XmComboBoxWidget)(w))->combo_box.list_shell) #define CB_MarginHeight(w) (((XmComboBoxWidget)(w))->combo_box.margin_height) #define CB_MarginWidth(w) (((XmComboBoxWidget)(w))->combo_box.margin_width) #define CB_MatchBehavior(w) \ (((XmComboBoxWidget)(w))->combo_box.match_behavior) #define CB_PositionMode(w) (((XmComboBoxWidget)(w))->combo_box.position_mode) #define CB_RenderTable(w) (((XmComboBoxWidget)(w))->combo_box.render_table) #define CB_ScrolledW(w) (((XmComboBoxWidget)(w))->combo_box.scrolled_w) #define CB_SelectionCB(w) \ (((XmComboBoxWidget)(w))->combo_box.selection_callback) #define CB_ShellState(w) (((XmComboBoxWidget)(w))->combo_box.shell_state) #define CB_TextChanged(w) (((XmComboBoxWidget)(w))->combo_box.text_changed) #define CB_Type(w) (((XmComboBoxWidget)(w))->combo_box.type) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmComboBoxP_H */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmCrPFrI.c0000644000175000017500000000524112672140200012627 00000000000000/* $XConsortium: XpmCrPFrI.c /main/2 1996/09/20 08:12:09 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrPFrI.c: * * * * XPM library * * Create the Pixmap related to the given XImage. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" void xpmCreatePixmapFromImage(display, d, ximage, pixmap_return) Display *display; Drawable d; XImage *ximage; Pixmap *pixmap_return; { GC gc; XGCValues values; *pixmap_return = XCreatePixmap(display, d, ximage->width, ximage->height, ximage->depth); /* set fg and bg in case we have an XYBitmap */ values.foreground = 1; values.background = 0; gc = XCreateGC(display, *pixmap_return, GCForeground | GCBackground, &values); XPutImage(display, *pixmap_return, gc, ximage, 0, 0, 0, 0, ximage->width, ximage->height); XFreeGC(display, gc); } motif-2.3.8/lib/Xm/Tree.c0000644000175000017500000022115513066310437011771 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES *************************************************************/ #include #include "XmI.h" #include "xmlist.h" #include #include /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define SUPERCLASS (&xmHierarchyClassRec) #define INDENT_SPACE 30 typedef struct { int x; int y; } LadderPoint; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /************************************************************ * STATIC FUNCTION DECLARATIONS *************************************************************/ static void Resize(Widget), ClassInit(void); static void Realize(Widget, Mask *, XSetWindowAttributes *); static void Redisplay(Widget, XEvent *, Region); static void ClassPartInitialize(WidgetClass w_class); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void ConstraintInitialize(Widget, Widget, ArgList, Cardinal *); static void ConstraintDestroy(Widget); static void TreeDestroy(Widget); static void ToggleNodeState(Widget, XtPointer, XtPointer); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static Boolean ConstraintSetValues(Widget, Widget, Widget, ArgList, Cardinal*); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal*); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *, XtWidgetGeometry *); /************************ * Actions and callbacks. ************************/ /********************* * Internal Routines. *********************/ static Boolean CvtStringToConnectStyle(Display *, XrmValuePtr, Cardinal *, XrmValuePtr, XrmValuePtr); static Boolean CvtStringToCompressStyle(Display *, XrmValuePtr, Cardinal *, XrmValuePtr, XrmValuePtr); static Boolean CvtStringToLineStyle(Display *, XrmValuePtr, Cardinal *, XrmValuePtr, XrmValuePtr); static void ReleaseNodeGCs(Widget), GetNodeGCs(Widget); static TreeConstraints GetNodeInfo(Widget); static int GetExtraVertSpace(Widget); static int GetExtraHorizSpace(Widget); static void LineColorDefault(Widget, int, XrmValue *); static void LineBackgroundColorDefault(Widget, int, XrmValue *); static void HorizontalNodeSpaceDefault(Widget, int, XrmValue *); static void VerticalNodeSpaceDefault(Widget, int, XrmValue *); static void ChangeManaged(Widget), CalcMaxSize(Widget); static void CalcLocations(Widget, Boolean); static void LayoutChildren(Widget, Widget); static Boolean GetNodeHeightAndWidth(Widget, TreeConstraints, Cardinal *, Cardinal); static void GetDesiredSize(Widget, Dimension *, Dimension *, Boolean); static void _DrawLine(Widget, XRectangle *, TreeConstraints, TreeConstraints, LadderPoint, LadderPoint *); static void _PlaceNode(Widget, TreeConstraints); static void _ResetPlacedFlag(TreeConstraints); static void FindNodeLocations(Widget); static void DrawTreeLine(Widget, XRectangle *, TreeConstraints); static void RedrawTreeLines(Widget, XRectangle *); static Boolean RequestNewSize(Widget); static Bool CheckExpose(Display *, XEvent *, char *); static Boolean LocInRect(XRectangle *, Widget, Position, Position); static Boolean WidgetInRect(XRectangle *, Widget); static Boolean CheckWidget(XRectangle *, TreeConstraints); static void ProcessChildQueue(XmTreeWidget, XRectangle *); static void MoveNode(XmTreeWidget, TreeConstraints, Position, Position, Position, Position, Boolean); static void ProcessNode(TreeConstraints); static Boolean MoveNodesTimer(XtPointer); static void UnmapNode(XmTreeWidget tw, TreeConstraints node); static void UnmapAllExtraNodes(Widget w, HierarchyConstraints node); static void LineStyle_confirm (Widget w, int value); /************************************************************ * STATIC DECLARATIONS *************************************************************/ static XtResource resources[] = { { XmNconnectStyle, XmCConnectStyle, XmRXmConnectStyle, sizeof(XmTreeConnectStyle), XtOffsetOf(XmTreeRec, tree.connect_style), XmRImmediate, (XtPointer) XmTreeDirect }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf(XmTreeRec, tree.orientation), XmRImmediate, (XtPointer) XmHORIZONTAL }, { XmNcompressStyle, XmCCompressStyle, XmRXmCompressStyle, sizeof(XmTreeCompressStyle), XtOffsetOf(XmTreeRec, tree.compress_style), XmRImmediate, (XtPointer) XmTreeCompressLeaves }, { XmNverticalDelta, XmCVerticalDelta, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.vertical_delta), XmRImmediate, (XtPointer) 30 }, { XmNhorizontalDelta, XmCHorizontalDelta, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.horizontal_delta), XmRImmediate, (XtPointer) 25 }, { XmNhorizontalNodeSpace, XmCDimension, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.h_node_space), XmRCallProc, (XtPointer) HorizontalNodeSpaceDefault }, { XmNverticalNodeSpace, XmCDimension, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.v_node_space), XmRCallProc, (XtPointer) VerticalNodeSpaceDefault } }; static XmSyntheticResource get_resources[] = { { XmNhorizontalNodeSpace, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.h_node_space), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNverticalNodeSpace, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.v_node_space), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNverticalDelta, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.vertical_delta), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNhorizontalDelta, sizeof(Dimension), XtOffsetOf(XmTreeRec, tree.horizontal_delta), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels } }; static XtResource constraints[] = { { XmNopenClosePadding, XmCOpenClosePadding, XmRInt, sizeof(int), XtOffsetOf(XmTreeConstraintRec, tree.open_close_padding), XmRImmediate, (XtPointer) 0 }, { XmNlineColor, XmCForeground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmTreeConstraintRec, tree.color), XmRCallProc, (XtPointer) LineColorDefault }, { XmNlineBackgroundColor, XmCBackground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmTreeConstraintRec, tree.background_color), XmRCallProc, (XtPointer) LineBackgroundColorDefault }, { XmNlineWidth, XmCLineWidth, XmRInt, sizeof(int), XtOffsetOf(XmTreeConstraintRec, tree.line_width), XmRImmediate, (XtPointer) 0 }, { XmNlineStyle, XmCLineStyle, XmRXmLineStyle, sizeof(int), XtOffsetOf(XmTreeConstraintRec, tree.line_style), XmRImmediate, (XtPointer) LineSolid } }; static XmSyntheticResource get_cons_resources[] = { { XmNopenClosePadding, sizeof(int), XtOffsetOf(XmTreeConstraintRec, tree.open_close_padding), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels } }; #undef offset XmTreeClassRec xmTreeClassRec = { { /* core fields */ /* superclass */ ((WidgetClass) SUPERCLASS), /* class_name */ "XmTree", /* widget_size */ sizeof(XmTreeRec), /* class_initialize */ ClassInit, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMultiple, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ TreeDestroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite_class fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ (XtResource*)constraints, /* num resources */ XtNumber(constraints), /* constraint size */ sizeof(XmTreeConstraintRec), /* init proc */ ConstraintInitialize, /* destroy proc */ ConstraintDestroy, /* set values proc */ ConstraintSetValues, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ get_cons_resources, /* num_syn_cont_resources */ XtNumber(get_cons_resources), /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* Hierarchy fields */ XtInheritChangeNodeState, /* The function for changing the node state. */ XtInheritMapNode, /* Maps a given node. */ XtInheritUnmapNode, /* Unmaps a given node. */ UnmapAllExtraNodes, /* Unmaps all extra nodes. */ XtInheritBuildNodeTable, /* Builds up the node table. */ XtInheritResetOpenCloseButton, /* Resets the the o/c button. */ ToggleNodeState, /* Called to toggle the state of node. */ NULL, /* extension */ }, { /* Tree fields */ NULL /* extension */ } }; WidgetClass xmTreeWidgetClass = (WidgetClass) &xmTreeClassRec; /************************************************************ * STATIC CODE *************************************************************/ /* Function Name: ClassInit * Description: Called to initialize information specific * to this widget class. * Arguments: none. * Returns: none. */ /*ARGSUSED*/ static void ClassInit(void) { XmTreeClassRec* wc = &xmTreeClassRec; XtSetTypeConverter(XmRString, XmRXmConnectStyle, (XtTypeConverter) CvtStringToConnectStyle, NULL, (Cardinal) 0, XtCacheAll, (XtDestructor) NULL); XtSetTypeConverter(XmRString, XmRXmCompressStyle, (XtTypeConverter) CvtStringToCompressStyle, NULL, (Cardinal) 0, XtCacheAll, (XtDestructor) NULL); XtSetTypeConverter(XmRString, XmRXmLineStyle, (XtTypeConverter) CvtStringToLineStyle, NULL, (Cardinal) 0, XtCacheNone, (XtDestructor) NULL); } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmTREE_BIT); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /* ARGSUSED */ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmTreeWidget tw = (XmTreeWidget) set; TreeConstraints top_node; top_node = ((TreeConstraints) XtRealloc((XtPointer) XmHierarchy_top_node(tw), sizeof(TreeConstraintRec))); XmHierarchy_top_node(tw) = (HierarchyConstraints) top_node; XmTree_ul_point(tw).x = XmTree_ul_point(tw).y = 0; XmTree_lr_point(tw).x = XmTree_lr_point(tw).y = 0; XmTreeC_box_x(top_node) = XmTreeC_box_y(top_node) = 0; XmTreeC_bb_width(top_node) = XmTreeC_bb_height(top_node) = 0; XmTreeC_placed(top_node) = False; XmTree_child_op_list(tw) = _XmListInit(); /* * Set the initial values for XmTreeC_max_width(tw) and XmTreeC_max_height(tw). */ CalcMaxSize(set); } /* Function Name: Realize * Description: Called to realize this widget. * Arguments: w - Widget to realize. * valueMask, attributes - attributes to use when creating * this widget's window. * Returns: none. * * This overrides the Manager's frobbing with various values. */ static void Realize(Widget w, Mask *valueMask, XSetWindowAttributes * attributes) { XtCreateWindow (w, InputOutput, CopyFromParent, *valueMask, attributes); } /* Function Name: Redisplay * Description: This function redraws the tree lines. * Arguments: w - the Tree widget. * event - event that caused the exposure. * region - the region containing all the exposures. * Returns: none */ typedef struct _RedispInfo { Window window; Boolean found; } RedispInfo; /* ARGSUSED */ static void Redisplay(Widget w, XEvent * event, Region region) { XmTreeWidget tw = (XmTreeWidget) w; XEvent junk; RedispInfo info; int lrx, lry; /* local variables fro lower left corner. */ XmDropSiteStartUpdate(w); /* * Make sure that there are not more expose events pending in the queue * since only one is required to paint the tree lines. */ info.window = XtWindow(w); info.found = False; XCheckIfEvent(XtDisplay(w), &junk, CheckExpose, (char *) &info); /* * Compute the maximum bounding rectangle for all expose events * that have yet to be processed. */ if (event->xexpose.x < XmTree_ul_point(tw).x) XmTree_ul_point(tw).x = event->xexpose.x; if (event->xexpose.y < XmTree_ul_point(tw).y) XmTree_ul_point(tw).y = event->xexpose.y; lrx = event->xexpose.x + event->xexpose.width; lry = event->xexpose.y + event->xexpose.height; if (lrx > XmTree_lr_point(tw).x) XmTree_lr_point(tw).x = lrx; if (lry > XmTree_lr_point(tw).y) XmTree_lr_point(tw).y = lry; if (!info.found) { /* No more expose events waiting - process these. */ XRectangle rect; rect.x = XmTree_ul_point(tw).x; rect.y = XmTree_ul_point(tw).y; rect.width = XmTree_lr_point(tw).x - XmTree_ul_point(tw).x; rect.height = XmTree_lr_point(tw).y - XmTree_ul_point(tw).y; ProcessChildQueue((XmTreeWidget) w, &rect); RedrawTreeLines(w, &rect); /* * Reset upper right and lower left points. */ XmTree_ul_point(tw).x = w->core.width; XmTree_ul_point(tw).y = w->core.height; XmTree_lr_point(tw).x = XmTree_lr_point(tw).y = 0; } XmDropSiteEndUpdate(w); } /* Function Name: CheckExpose * Description: Checks to see if there is an expose event on the queue. * Arguments: disp - the X Display. * event - the event to check for. * info_ptr - a pointer to the redispInfo. * Returns: Always False. */ /* ARGSUSED */ static Bool CheckExpose(Display *disp, XEvent *event, char *info_ptr) { RedispInfo *info = (RedispInfo *) info_ptr; if (info->found || event->xany.type != Expose) return(False); if (event->xexpose.window == info->window) info->found = True; return(False); } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - Extended List Widget to resize. * Returns: none. */ static void Resize(Widget w) { XmTreeWidget tw = (XmTreeWidget) w; if (XmHierarchy_refigure_mode(tw)) { LayoutChildren(w, NULL); if (XtIsRealized((Widget)tw)) { XClearArea(XtDisplay(tw), XtWindow(tw), 0, 0, tw->core.width, tw->core.height, True); } } } /* Function Name: QueryGeometry * Description: Called when my parent wants to know what size * I would like to be. * Arguments: w - the drt widget. * indended - constriants imposed by the parent. * preferred - what I would like. * Returns: See Xt Manual. */ static XtGeometryResult QueryGeometry(Widget w,XtWidgetGeometry *intended, XtWidgetGeometry *preferred) { GetDesiredSize(w, &(preferred->width), &(preferred->height), True); return(_XmHWQuery(w, intended, preferred)); } /* Function Name: SetValues * Description: Called a resources is changed. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /* ARGSUSED */ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmTreeWidget c_tree = (XmTreeWidget) current; XmTreeWidget tree = (XmTreeWidget) set; Boolean redisplay = False; Boolean layout = False; if ((XmHierarchy_v_margin(c_tree) != XmHierarchy_v_margin(tree)) || (XmHierarchy_h_margin(c_tree) != XmHierarchy_h_margin(tree)) || (XmTree_orientation(c_tree) != XmTree_orientation(tree)) || ((XmTree_compress_style(c_tree) != XmTree_compress_style(tree)) && (XmTree_orientation(tree) == XmVERTICAL)) || (XmTree_horizontal_delta(c_tree) != XmTree_horizontal_delta(tree)) || (XmTree_vertical_delta(c_tree) != XmTree_vertical_delta(tree)) || (XmTree_v_node_space(c_tree) != XmTree_v_node_space(tree)) || (XmTree_h_node_space(c_tree) != XmTree_h_node_space(tree))) { layout = redisplay = True; } if (XmTree_connect_style(c_tree) != XmTree_connect_style(tree)) redisplay = True; if (XmHierarchy_refigure_mode(c_tree) != XmHierarchy_refigure_mode(tree)) layout = redisplay = XmHierarchy_refigure_mode(tree); if (layout && XmHierarchy_refigure_mode(tree)) { CalcLocations(set, False); LayoutChildren(set, NULL); GetDesiredSize(set, &(set->core.width), &(set->core.height), False); redisplay = True; } return(redisplay); } /* Function Name: Destroy * Description: Destroys all data allocated by the widget * Arguments: w - the widget. * Returns: none. */ static void TreeDestroy (Widget widget) { XmTreeWidget tree = (XmTreeWidget) widget; _XmListFree(XmTree_child_op_list(tree)); } /************************************************************ * * Composite Widget class procedures. * ************************************************************/ /* Function Name: ChangeManaged * Description: When a management change has occured... * Arguments: w - the icon box widget. * Returns: none. */ static void ChangeManaged(Widget w) { XmTreeWidget tw = (XmTreeWidget) w; if (XmHierarchy_refigure_mode(tw)) { CalcLocations(w, True); LayoutChildren(w, NULL); if (XtIsRealized((Widget)tw)) { XClearArea(XtDisplay(tw), XtWindow(tw), 0, 0, tw->core.width, tw->core.height, True); } } XmeNavigChangeManaged(w); /* for Motif navigation */ } /* Function Name: GeometryManager * Description: handles requests from children for a size change. * Arguments: child - the child to change. * request - the geometry that the child wants. * return - what we will allow if this is an almost. * Returns: status. */ /* ARGSUSED */ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry * request, XtWidgetGeometry * result) { Widget tw = XtParent(w); if (!(request->request_mode & (CWWidth | CWHeight | CWBorderWidth))) return(XtGeometryNo); if (!(request->request_mode & CWWidth)) { request->width = w->core.width; request->request_mode |= CWWidth; } if (!(request->request_mode & CWBorderWidth)) { request->border_width = w->core.border_width; request->request_mode |= CWBorderWidth; } if (!(request->request_mode & CWHeight)) { request->height = w->core.height; request->request_mode |= CWHeight; } if (request->request_mode & (CWX | CWY | CWStackMode | CWSibling)) { *result = *request; result->request_mode &= ~(CWX | CWY | CWStackMode | CWSibling); return(XtGeometryAlmost); } /* * Any width or height request is allowed, but others will be disallowed * or result in an almost that states only the width and height can * change. */ if (request->request_mode & XtCWQueryOnly) return(XtGeometryYes); /* * A real allowed request, make the change. */ _XmResizeWidget(w, request->width, request->height, request->border_width); if (XmHierarchy_refigure_mode((XmTreeWidget) tw)) { CalcLocations(tw, True); LayoutChildren(tw, w); if (XtIsRealized(tw)) { XClearArea(XtDisplay(tw), XtWindow(tw), 0, 0, tw->core.width, tw->core.height, True); } } return(XtGeometryYes); } /************************************************************ * * Constraint widget class procedures. * ************************************************************/ /* Function Name: ConstraintInitialize * Description: Called when a childs constriaints need initializing. * Arguments: req - the widget being requested. * set - what this will become. * args, num_args - the argument list. * Returns: none. */ /* ARGSUSED */ static void ConstraintInitialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { TreeConstraints node = GetNodeInfo(set); XmTreeC_box_x(node) = XmTreeC_box_y(node) = 0; XmTreeC_bb_width(node) = XmTreeC_bb_height(node) = 0; XmTreeC_placed(node) = False; XmTreeC_is_compressed(node) = False; LineStyle_confirm(set, LineSolid); if (XmHierarchyC_state(node) != XmNotInHierarchy) GetNodeGCs(set); else XmTreeC_gc(node) = None; } /* Function Name: ConstraintDestroy * Description: Destroys all data allocated by the constraint * record. * Arguments: w - the widget. * Returns: none. * * Removes the destroyed children from the list of children that still * need to be moved. */ static void ConstraintDestroy(Widget w) { TreeConstraints node = GetNodeInfo(w); XmListElem *elem, *next; XmTreeWidget tw; if (XmHierarchyC_state(node) == XmNotInHierarchy) { return; } tw = (XmTreeWidget) XtParent(w); elem = XmListFirst(XmTree_child_op_list(tw)); while(elem != NULL) { TreeConstraints info = (TreeConstraints) XmListElemData(elem); next = XmListElemNext(elem); if (XmHierarchyC_widget(info) == w) { /* * Each widget will only be in the list once. */ _XmListRemove(XmTree_child_op_list(tw), elem); break; } elem = next; } ReleaseNodeGCs(w); } /* Function Name: GetNodeGCs(node) * Description: Gets the gc's associated with a tree node. * Arguments: w - the child who's gc we are getting. * Returns: none */ static void GetNodeGCs(Widget w) { XtGCMask mask; XGCValues values; TreeConstraints node = GetNodeInfo(w); mask = GCForeground | GCLineWidth | GCLineStyle | GCBackground; values.foreground = XmTreeC_color(node); values.background = XmTreeC_background_color(node); values.line_width = XmTreeC_line_width(node); values.line_style = XmTreeC_line_style(node); XmTreeC_gc(node) = XtGetGC(w, mask, &values); } /* Function Name: ReleaseNodeGCs(node) * Description: Releases the gc's associated with a tree node. * Arguments: w - the child who's gc we are releasing * Returns: none */ static void ReleaseNodeGCs(Widget w) { TreeConstraints node = GetNodeInfo(w); if (XmTreeC_gc(node) != None) XtReleaseGC(w, XmTreeC_gc(node)); } /* Function Name: ConstraintSetValues * Description: Called a constraint is changed on my children. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /* ARGSUSED */ static Boolean ConstraintSetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { Widget tw = XtParent(set); TreeConstraints set_node = GetNodeInfo(set); TreeConstraints old_node = GetNodeInfo(current); Boolean redisplay = False; Boolean insert_change = False; int i; for (i = 0; i < *num_args; i++) if (streq(args[i].name, XmNinsertBefore)) { insert_change = True; break; } if ((XmTreeC_color(set_node) != XmTreeC_color(old_node)) || (XmTreeC_background_color(set_node) != XmTreeC_background_color(old_node)) || (XmTreeC_line_width(set_node) != XmTreeC_line_width(old_node)) || (XmTreeC_line_style(set_node) != XmTreeC_line_style(old_node))) { LineStyle_confirm(set, XmTreeC_line_style(old_node)); ReleaseNodeGCs(current); GetNodeGCs(set); redisplay = True; } /* * Nothing below here needs to be done before we are realized. */ if (!XtIsRealized(set)) return(False); if ((XmHierarchyC_parent(set_node) != XmHierarchyC_parent(old_node)) || (XmHierarchyC_state(set_node) != XmHierarchyC_state(old_node)) || (insert_change) || (XmTreeC_open_close_padding(set_node) != XmTreeC_open_close_padding(old_node))) { /* * Other operations have already been performed by my superclass. */ if (XmHierarchy_refigure_mode((XmTreeWidget)tw)) { CalcLocations(tw, True); LayoutChildren(tw, NULL); redisplay = True; } /* * Since Layout children has (possibily) moved this widget * to a new location. The current state of the widget * must be updated so that neither the intrinsics nor * any sub-classes of this widget attempt to move it * to the new location, since it is already there. */ current->core.x = set->core.x; current->core.y = set->core.y; /* * Since redisplay redraws the child, not the Tree widget we * need to do the equilivent of a redisplay here. */ redisplay = True; } if (XtIsRealized(tw) && redisplay && (XmHierarchy_refigure_mode((XmTreeWidget)tw))) { XClearArea(XtDisplay(tw), XtWindow(tw), 0, 0, tw->core.width, tw->core.height, True); } return(False); } /************************************************************ * * Hierarchy widget class proceedures. * ************************************************************/ /* Function Name: ToggleNodeState * Description: Toggles the open/close state of a toggle button. * Arguments: w - the command button that activated this. * node_ptr - a pointer to the node info. * call_data - UNUSED. * Returns: none. */ /* ARGSUSED */ static void ToggleNodeState(Widget w, XtPointer node_ptr, XtPointer call_data) { Widget tw = XtParent(w); XtCallbackProc toggle_node_state; _XmProcessLock(); toggle_node_state = (SUPERCLASS->hierarchy_class.toggle_node_state); _XmProcessUnlock(); (*toggle_node_state)(w, node_ptr, call_data); CalcLocations(tw, True); LayoutChildren(tw, NULL); /* * Could check for a size change and abort if we really wanted * to be clever. */ if (XtIsRealized(tw)) { XClearArea(XtDisplay(tw), XtWindow(tw), 0, 0, tw->core.width, tw->core.height, True); } } /************************************************************ * * Type Converters. * ************************************************************/ /* Function Name: CvtStringToConnectStyle * Description: Converts a string to a connect style * Arguments: dpy - the X Display. * args, num_args - *** NOT USED *** * fromVal - contains the string to convert. * toVal - contains the converted node state. * Returns: True if the SetValues succeeds. */ /*ARGSUSED*/ static Boolean CvtStringToConnectStyle(Display * dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal) { static XmTreeConnectStyle connect; static XrmQuark XtQELadder; static XrmQuark XtQEDirect; static Boolean haveQuarks = FALSE; XrmQuark q; char lowerName[BUFSIZ]; if (!haveQuarks) { XtQELadder = XrmStringToQuark("ladder"); XtQEDirect = XrmStringToQuark("direct"); haveQuarks = TRUE; } XmCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr); q = XrmStringToQuark(lowerName); if ( (q == XtQELadder) || streq(lowerName,"treeladder") ) connect = XmTreeLadder; else if ( (q == XtQEDirect) || streq(lowerName,"treedirect") ) connect = XmTreeDirect; else { XtDisplayStringConversionWarning(dpy,fromVal->addr, XmRXmConnectStyle); return(FALSE); /* Conversion failed. */ } if (toVal->addr == NULL) { toVal->size = sizeof(XmTreeConnectStyle); toVal->addr = (XtPointer) &connect; return(TRUE); } if (toVal->size >= sizeof(XmTreeConnectStyle)) { XmTreeConnectStyle *loc = (XmTreeConnectStyle *)toVal->addr; *loc = connect; return(TRUE); } toVal->size = sizeof(XmTreeConnectStyle); return(FALSE); } /* Function Name: CvtStringToCompressStyle * Description: Converts a string to a compress style * Arguments: dpy - the X Display. * args, num_args - *** NOT USED *** * fromVal - contains the string to convert. * toVal - contains the converted value * Returns: True if the SetValues succeeds. */ /*ARGSUSED*/ static Boolean CvtStringToCompressStyle(Display * dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal) { static XmTreeCompressStyle compress; static XrmQuark XtQECompressNone; static XrmQuark XtQECompressLeaves; static XrmQuark XtQECompressAll; static Boolean haveQuarks = FALSE; XrmQuark q; char lowerName[BUFSIZ]; if (!haveQuarks) { XtQECompressNone = XrmStringToQuark("compressnone"); XtQECompressLeaves = XrmStringToQuark("compressleaves"); XtQECompressAll = XrmStringToQuark("compressall"); haveQuarks = TRUE; } XmCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr); q = XrmStringToQuark(lowerName); if ((q == XtQECompressNone) || streq(lowerName,"none") || streq(lowerName,"treecompressnone") ) compress = XmTreeCompressNone; else if ((q == XtQECompressLeaves) || streq(lowerName,"leaves") || streq(lowerName,"treecompressleaves") ) compress = XmTreeCompressLeaves; else if ((q == XtQECompressAll) || streq(lowerName,"all") || streq(lowerName,"treecompressall") ) compress = XmTreeCompressAll; else { XtDisplayStringConversionWarning(dpy,fromVal->addr, XmRXmCompressStyle); return(FALSE); /* Conversion failed. */ } if (toVal->addr == NULL) { toVal->size = sizeof(XmTreeCompressStyle); toVal->addr = (XtPointer) &compress; return(TRUE); } if (toVal->size >= sizeof(XmTreeCompressStyle)) { XmTreeCompressStyle *loc = (XmTreeCompressStyle *)toVal->addr; *loc = compress; return(TRUE); } toVal->size = sizeof(XmTreeCompressStyle); return(FALSE); } /* ARGSUSED */ static Boolean CvtStringToLineStyle(Display * dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal) { static int lineStyle = LineSolid; char lowerName[BUFSIZ]; XmCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr); if ( streq(lowerName, "linesolid") || streq(lowerName,"solid") ) lineStyle = LineSolid; else if ( streq(lowerName, "lineonoffdash") || streq(lowerName,"onoffdash") ) lineStyle = LineOnOffDash; else if ( streq(lowerName, "linedoubledash") || streq(lowerName,"doubledash") ) lineStyle = LineDoubleDash; else { XtDisplayStringConversionWarning(dpy,fromVal->addr, XmRXmLineStyle); return(FALSE); /* Conversion failed. */ } if (toVal->addr == NULL) { toVal->size = sizeof(int); toVal->addr = (XtPointer) &lineStyle; return(TRUE); } if (toVal->size >= sizeof(int)) { int *loc = (int*)toVal->addr; *loc = lineStyle; return(TRUE); } toVal->size = sizeof(int); return(FALSE); } /************************************************************ * * Actions and Callbacks. * ************************************************************/ /************************************************************ * * Internal routines. * ************************************************************/ /* Function Name: HorizontalNodeSpaceDefault * Description: determines the default value for the * XmNhorizontalNodeSpace resource based on * the orientation. * Arguments: w - the tree widget * offset - offset of the field in the widget record. * value - resource descriptor to return. * Returns: none. */ /* ARGSUSED */ static void HorizontalNodeSpaceDefault(Widget widget, int offset, XrmValue *value) { XmTreeWidget tw = (XmTreeWidget) widget; static Dimension default_val; if (XmTree_orientation(tw) == XmVERTICAL) default_val = 2; else default_val = 20; value->addr = (XtPointer) &default_val; } /* Function Name: VerticalNodeSpaceDefault * Description: determines the default value for the * XmNverticalNodeSpace resource based on * the orientation. * Arguments: w - the tree widget * offset - offset of the field in the widget record. * value - resource descriptor to return. * Returns: none. */ /* ARGSUSED */ static void VerticalNodeSpaceDefault(Widget widget, int offset, XrmValue *value) { XmTreeWidget tw = (XmTreeWidget) widget; static Dimension default_val; if (XmTree_orientation(tw) == XmVERTICAL) default_val = 20; else default_val = 2; value->addr = (XtPointer) &default_val; } /* Function Name: LineColorDefault * Description: Sets the default line color to the parent's * foreground color. * Arguments: w - the widget to set the line color on. * offset - offset of the field in the widget record. * value - resource descriptor to return. * Returns: none. */ /* ARGSUSED */ static void LineColorDefault(Widget widget, int offset, XrmValue *value) { XmTreeWidget tw = (XmTreeWidget) XtParent(widget); value->addr = (XtPointer) &(tw->manager.foreground); } /* ARGSUSED */ static void LineBackgroundColorDefault(Widget widget, int offset, XrmValue *value) { XmTreeWidget tw = (XmTreeWidget) XtParent(widget); value->addr = (XtPointer) &(tw->core.background_pixel); } /* Function Name: DrawExtraLadderLines * Description: Draws the extra horizontal and vertical ladder lines * that connect elements of the tree. * Arguments: w - the tree widget. * gc - gc of the parent node * first_kid - start points for vertical line * last_kid - end points for vertical line * parent_point - supplies y end points for horizontal line * Returns: none */ /* ARGSUSED */ static void DrawExtraLadderLines( Widget w, GC gc, LadderPoint first_kid, LadderPoint last_kid, LadderPoint parent_point ) { XmTreeWidget tw = (XmTreeWidget)w; if (XmTree_connect_style(tw) == XmTreeLadder) { /* First draw the line that starts at parent midpoint and goes * to the ladder line connecting the children. Then draw the * line connecting the children. */ if (XmTree_orientation(tw) == XmHORIZONTAL) { XDrawLine(XtDisplay(w), XtWindow(w), gc, parent_point.x, parent_point.y, first_kid.x, parent_point.y ); XDrawLine(XtDisplay(w), XtWindow(w), gc, first_kid.x, first_kid.y, first_kid.x, last_kid.y ); } else /* orientation == XmVERTICAL */ { XDrawLine(XtDisplay(w), XtWindow(w), gc, parent_point.x, parent_point.y, parent_point.x, first_kid.y ); XDrawLine(XtDisplay(w), XtWindow(w), gc, first_kid.x, first_kid.y, last_kid.x, first_kid.y ); } } } /* Function Name: RedrawTreeLines; * Description: Redraws the lines that connect elements of the tree. * Arguments: w - the tree widget. * rect - the rectangle to clip to. * Returns: none */ static void RedrawTreeLines(Widget w, XRectangle * rect) { XmTreeWidget tw = (XmTreeWidget) w; if (XtIsRealized(w)) DrawTreeLine(w, rect, (TreeConstraints) XmHierarchy_top_node(tw)); } /* Function Name: _CalcNodeMidPoint * Description: Calculates the x and y origin of the * part of the ladder line that comes out of the * parent node * Arguments: * node - The node to calculate points for * w - the tree widget * ret_point - return values for calculated points * Returns: none */ static void _CalcNodeMidPoint( TreeConstraints node, Widget w, LadderPoint *ret_point ) { register int extra_space; XmTreeWidget tw = (XmTreeWidget)w; if (!XmHierarchyC_widget(node)) return; if (XmTree_orientation(tw) == XmHORIZONTAL) { ret_point->x = (XmTreeC_box_x(node) + XmTreeC_widget_offset(node) + (XmHierarchyC_widget(node))->core.width + XmHierarchy_h_margin(tw)); extra_space = GetExtraVertSpace(w); ret_point->y = XmTreeC_box_y(node)+(int)(XmTreeC_bb_height(node)+extra_space)/2; } else /* orientation == XmVERTICAL */ { ret_point->y = (XmTreeC_box_y(node) + XmTreeC_widget_offset(node) + (XmHierarchyC_widget(node))->core.height + XmHierarchy_v_margin(tw)); extra_space = GetExtraHorizSpace(w); ret_point->x = XmTreeC_box_x(node)+(int)(XmTreeC_bb_width(node)+extra_space)/2; } } /* Function Name: DrawTreeLine * Description: Draws a line between two elements in the tree. * Arguments: w - the tree. * rect - the rectangle to clip to. * node - The node to draw lines on. (it also recurses to all * descendants. * Returns: none */ static void DrawTreeLine(Widget w, XRectangle *rect, TreeConstraints node) { TreeConstraints * kids; register int i, num_kids; TreeConstraints from_node = node; LadderPoint from_node_point = {0, 0}, kid_point = {0, 0}, first_kid_point = {0, 0}; LadderPoint last_kid_point = {0, 0}; Boolean first_time=True; XmTreeWidget tw = (XmTreeWidget)w; if (XmHierarchyC_widget(node) != NULL && !XtIsManaged(XmHierarchyC_widget(node))) return; /* * Hunt up the tree until we find a non-hidden parent to be the from * node. */ while ((XmHierarchyC_parent(from_node) != NULL) && (XmHierarchyC_state(from_node) == XmHidden)) { from_node = GetNodeInfo(XmHierarchyC_parent(from_node)); } num_kids = XmHierarchyC_num_children(node); kids = (TreeConstraints *) XmHierarchyC_children(node); /* * This only executes if the root is hidden. */ if (XmHierarchyC_state(from_node) == XmHidden) { for (i = 0; i < num_kids; i++, kids++) DrawTreeLine(w, rect, *kids); /* recurse to descendants. */ return; } if (XmHierarchyC_state(from_node) == XmClosed) return; _CalcNodeMidPoint( from_node, w, &from_node_point ); for (i = 0; i < num_kids; i++, kids++) { if (XtIsManaged(XmHierarchyC_widget((*kids)))) { if (XmHierarchyC_state((*kids)) != XmHidden) { _DrawLine(w, rect, from_node, *kids, from_node_point, &kid_point); /* set up the points to draw ladder lines */ if (XmTree_connect_style(tw) == XmTreeLadder) { last_kid_point.x = kid_point.x; last_kid_point.y = kid_point.y; if (first_time ){ first_kid_point.x = last_kid_point.x; first_kid_point.y = last_kid_point.y; first_time = False; } } } DrawTreeLine(w, rect, *kids); /* recurse to descendants. */ } } /* Draw extra ladder lines if necessary. * If first time False, then we know we've gone through the line * drawing loop at least twice */ if ((num_kids > 1) && (!first_time) && (XmTree_connect_style(tw) == XmTreeLadder)) { DrawExtraLadderLines( w, XmTreeC_gc(node), first_kid_point, last_kid_point, from_node_point ); } } /* Function Name: _DrawLine * Description: Draw a tree line between two nodes in the tree. If * child is an only child in XmTreeLadder, then draw a line * directly to it. * Arguments: w - the tree. * rect - the rectangle to clip to. * parent - The parent. * child - The child to draw the line to. * from_ladder_point - The midpoint of parent where all * lines start from (whether ladder or direct) * to_ladder_point - RETURNs the midpoint of the kid - where * all lines end at (whether ladder or direct) * Returns: none */ static void _DrawLine(Widget w, XRectangle *rect, TreeConstraints parent, TreeConstraints child, LadderPoint from_ladder_point, LadderPoint *to_ladder_point ) { GC gc; XmTreeWidget tw = (XmTreeWidget) w; register int x2=0, y2=0, extra_space; register int rx2, ry2, cx1, cx2, cy1, cy2; /* * (from_ladder_point.x, from_ladder_point.y) are the coordinates * of the parent's midpoint * (x2, y2) are the coordinates of the child midpoint * * We will end up drawing either a partial ladder line from * (cx1, cy1) to (cx2, cy2) or a full line from * (from_ladder_point.x, from_ladder_point.y) to (x2, y2) * * (rx2, ry2) are the coordinates of the lower right of clip rectangle */ /* * Must always do the first node since it is what draws the root * of the ladder. */ if (child != (TreeConstraints) XmHierarchyC_children(parent)[0] && (!(XmHierarchyC_status(child) & IS_MAPPED) || (XmHierarchyC_status(child) & IS_COMPRESSED))) { return; } gc = XmTreeC_gc(child); if (XmTree_orientation(tw) == XmHORIZONTAL) { extra_space = GetExtraVertSpace(w); x2 = (XmTreeC_box_x(child) + XmHierarchy_h_margin(tw)); y2 = XmTreeC_box_y(child) + (int)(XmTreeC_bb_height(child) + extra_space)/2; } else /* orientation == XmVERTICAL */ { extra_space = GetExtraHorizSpace(w); y2 = (XmTreeC_box_y(child) + XmHierarchy_v_margin(tw)); x2 = XmTreeC_box_x(child) + (int)(XmTreeC_bb_width(child) + extra_space)/2; } cx1 = MIN(from_ladder_point.x, x2); cx2 = MAX(from_ladder_point.x, x2); cy1 = MIN(from_ladder_point.y, y2); cy2 = MAX(from_ladder_point.y, y2); /* If XmTreeLadder and more than one child, do funky ladder line calc's */ if ((XmTree_connect_style(tw) == XmTreeLadder)&&(XmHierarchyC_num_children(parent) > 1)) { if (XmTree_orientation(tw) == XmHORIZONTAL) { cx1 += (cx2 - cx1)/2; cy1 = cy2 = y2; } else /* orientation == XmVERTICAL */ { if (XmTreeC_is_compressed(child)) cy1 += (int)(cy2 - XmTree_vertical_delta(tw) - cy1)/(int)2; else cy1 += (cy2 - cy1)/2; cx1 = cx2 = x2; } } else /* XmTree_connect_style== XmTreeDirect or only has one child in XmTreeLadder */ { /* If there is a small pixel difference, make the line straight * or it will look wierd. */ if ((cy2-cy1) == 1) y2 = from_ladder_point.y; if ((cx2-cx1) == 1) x2 = from_ladder_point.x; } rx2 = rect->x + rect->width; ry2 = rect->y + rect->height; /* * Not very pretty, only checks to see if the rect containing the * line is partially within the exposed rectangle. */ if (!((cx1 > rx2) || (cy1 > ry2) || (cx2 < rect->x) || (cy2 < rect->y))) { if ((XmTree_connect_style(tw) == XmTreeLadder) &&(XmHierarchyC_num_children(parent) > 1)) XDrawLine(XtDisplay(w), XtWindow(w), gc, cx1, cy1, cx2, cy2); else XDrawLine(XtDisplay(w), XtWindow(w), gc, from_ladder_point.x, from_ladder_point.y, x2, y2); } /* This is sent back because the ladder lines get connected later */ to_ladder_point->x = cx1; to_ladder_point->y = cy1; } /* Function Name: CalcLocations * Description: Calculates the location of each widget in the tree. * Arguments: w - the tree widget. * Boolean - attempt resize? * Returns: none. */ static void CalcLocations(Widget w, Boolean resize_it) { Cardinal current_index; XmTreeWidget tw = (XmTreeWidget) w; TreeConstraints node; XmTreeWidgetClass tc = (XmTreeWidgetClass) XtClass(w); register int i; /* * Reset each node to be hidden; */ for( i = 0; i < tw->composite.num_children; ++i ) { node = GetNodeInfo(tw->composite.children[i]); XmHierarchyC_status(node) |= IS_COMPRESSED; } XmHierarchy_num_nodes(tw) = 0; (void)GetNodeHeightAndWidth(w, (TreeConstraints) XmHierarchy_top_node(tw), &(XmHierarchy_num_nodes(tw)), 0); current_index = 0; { XmHierarchyBuildTableProc build_node_table; _XmProcessLock(); build_node_table = tc->hierarchy_class.build_node_table; _XmProcessUnlock(); (*build_node_table) (w, XmHierarchy_top_node(tw), ¤t_index); } CalcMaxSize(w); FindNodeLocations(w); /* Finds the location for each node. */ if (resize_it) RequestNewSize(w); } /* Function Name: RequestNewSize * Description: Asks our parent for a new size. * Arguments: w - the data request tree widget. * Returns: True if resize happened. */ static Boolean RequestNewSize(Widget w) { Dimension width, height, rwidth, rheight; XtGeometryResult ret_val; GetDesiredSize(w, &width, &height, False); ret_val = XtMakeResizeRequest(w, width, height, &rwidth, &rheight); if (ret_val == XtGeometryAlmost) ret_val = XtMakeResizeRequest(w, rwidth, rheight, NULL, NULL); return(ret_val == XtGeometryYes); } /* Function Name: GetDesiredSize * Description: Returns the desired size of the tree widget. * Arguments: w - the tree widget. * width - the desired width. * height - the desired height. * recalc - recalculate the new size if row height unset? * Returns: none. */ static void GetDesiredSize(Widget w, Dimension *width, Dimension *height, Boolean recalc) { XmTreeWidget tw = (XmTreeWidget) w; if (recalc) CalcLocations(w, False); *width = XmTree_max_width(tw); *height = XmTree_max_height(tw); } /* Function Name: LayoutChildren * Description: all the fun stuff for positioning the children is here. * Arguments: w - the tree widget. * assign_child - A child to assign values to, rather * than just moving it. * Returns: none. */ static void LayoutChildren(Widget w, Widget assign_child) { XmTreeWidget tw = (XmTreeWidget) w; XmTreeWidgetClass tc = (XmTreeWidgetClass) XtClass(w); register HierarchyConstraints * node_table = XmHierarchy_node_table(tw); register Cardinal num_nodes = XmHierarchy_num_nodes(tw); register int i, extra_space; Boolean register_workproc = True; XmDropSiteStartUpdate(w); /* * Remove the old list, replace it with the new one. */ if (XmListFirst(XmTree_child_op_list(tw)) != NULL) { if( XmHierarchy_work_proc_id(tw) != (XtWorkProcId) NULL ) { XtRemoveWorkProc(XmHierarchy_work_proc_id(tw)); XmHierarchy_work_proc_id(tw) = (XtWorkProcId) NULL; } _XmListFree(XmTree_child_op_list(tw)); XmTree_child_op_list(tw) = _XmListInit(); register_workproc = False; } /* * Unmap all nodes that no longer are visible. */ { XmHierarchyExtraNodeProc unmap_all_extra_nodes; _XmProcessLock(); unmap_all_extra_nodes = tc->hierarchy_class.unmap_all_extra_nodes; _XmProcessUnlock(); (*unmap_all_extra_nodes) (w, XmHierarchy_top_node(tw)); } /* * Go through all nodes that can possibly be displayed, putting those * that will be visible on the screen and unmapping all others. */ for (i = 0; i < num_nodes; i++, node_table++) { TreeConstraints t_node = (TreeConstraints) *node_table; Widget child = XmHierarchyC_widget(t_node); Widget open_close = XmHierarchyC_open_close_button(t_node); register Dimension c_height, c_width; register Position y_loc, x_loc, oc_y_loc = 0, oc_x_loc = 0; c_width = child->core.width + 2 * child->core.border_width; c_height = child->core.height + 2 * child->core.border_width; if (XmTree_orientation(tw) == XmHORIZONTAL) /* DMS */ { /* * Nodes and open close buttons are centered vertically * in the box that contains them. */ extra_space = GetExtraVertSpace(w); y_loc = (XmTreeC_box_y(t_node) + (int)(XmTreeC_bb_height(t_node) + extra_space - c_height) / 2); if (open_close != NULL) { Dimension oc_height = (open_close->core.height + 2 * open_close->core.border_width); oc_y_loc = y_loc + (int)(c_height - oc_height)/2; } oc_x_loc = XmTreeC_box_x(t_node) + XmHierarchy_h_margin(tw); x_loc = oc_x_loc + XmTreeC_widget_offset(t_node); } else /* orientation == XmVERTICAL */ { /* * Nodes and open close buttons are centered horizontally * in the box that contains them. */ extra_space = GetExtraHorizSpace(w); x_loc = (XmTreeC_box_x(t_node) + (int)(XmTreeC_bb_width(t_node) + extra_space - c_width) / 2); if (open_close != NULL) { Dimension oc_width = (open_close->core.width + 2 * open_close->core.border_width); oc_x_loc = x_loc + (int)(c_width - oc_width)/2; } oc_y_loc = XmTreeC_box_y(t_node) + XmHierarchy_v_margin(tw); y_loc = oc_y_loc + XmTreeC_widget_offset(t_node); } if (child == assign_child) { child->core.x = x_loc; child->core.y = y_loc; } MoveNode(tw, t_node, x_loc, y_loc, oc_x_loc, oc_y_loc, True); } if (register_workproc) { XmHierarchy_work_proc_id(tw) = XtAppAddWorkProc(XtWidgetToApplicationContext(w), MoveNodesTimer, (XtPointer) w); } XmDropSiteEndUpdate(w); } /* Function Name: GetExtraVertSpace * Description: Returns the amount of unused vertical space in the * tree, given the current geometry information. * Arguments: w - the tree widget. * Returns: see description. */ static int GetExtraVertSpace(Widget w) { XmTreeWidget tw = (XmTreeWidget) w; register int space, vmargin; TreeConstraints node = (TreeConstraints) XmHierarchy_top_node(tw); space = w->core.height - XmTreeC_bb_height(node); vmargin = 2 * XmHierarchy_v_margin(tw); return((space > vmargin) ? space : vmargin); } /* Function Name: GetExtraHorizSpace * Description: Returns the amount of unused horizontal space in the * tree, given the current geometry information. * Arguments: w - the tree widget. * Returns: see description. */ static int GetExtraHorizSpace(Widget w) { XmTreeWidget tw = (XmTreeWidget) w; register int space, hmargin; TreeConstraints node = (TreeConstraints) XmHierarchy_top_node(tw); space = w->core.width - XmTreeC_bb_width(node); hmargin = 2 * XmHierarchy_h_margin(tw); return((space > hmargin) ? space : hmargin); } /* Function Name: FindNodeLocations * Description: Finds the location each node in the node table * should be placed at. * Arguments: w - the tree widget. * Returns: none. */ static void FindNodeLocations(Widget w) { XmTreeWidget tw = (XmTreeWidget) w; TreeConstraints * node; register int i, num_nodes; Widget *childP; _ResetPlacedFlag((TreeConstraints) XmHierarchy_top_node(tw)); ForAllChildren(tw, childP) _ResetPlacedFlag(GetNodeInfo(*childP)); num_nodes = XmHierarchy_num_nodes(tw); node = (TreeConstraints *) XmHierarchy_node_table(tw); for (i = 0; i < num_nodes; i++, node++) _PlaceNode(w, *node); } /* Function Name: _ResetPlacedFlag * Description: Resets the placed flag on all notes. * Arguments: node - the node to place. * Returns: none. */ static void _ResetPlacedFlag(TreeConstraints node) { register TreeConstraints *child; register int i, num; if (node == NULL) return; XmTreeC_placed(node) = False; child = (TreeConstraints *) XmHierarchyC_children(node); for (num = XmHierarchyC_num_children(node), i = 0; i < num; i++, child++) _ResetPlacedFlag(*child); } /* Function Name: _PlaceNode * Description: Actuall Places a node (this is a recursive call). * Arguments: w - the tree widget. * node - the node to place. * Returns: none. */ static void _PlaceNode(Widget w, TreeConstraints node) { XmTreeWidget tw = (XmTreeWidget) w; register TreeConstraints *child, prev_child, parent; register Widget pw = XmHierarchyC_parent(node); register int i, num, x_loc, y_loc, box_amount, boxy, boxx; if ((node == NULL) || XmTreeC_placed(node)) /* Already placed. */ return; if (pw == NULL) { if (node == (TreeConstraints) XmHierarchy_top_node(tw)) { XmTreeC_placed(node) = TRUE; XmTreeC_box_x(node) = 0; XmTreeC_box_y(node) = 0; return; } else parent = (TreeConstraints) XmHierarchy_top_node(tw); } else parent = GetNodeInfo(pw); if (!XmTreeC_placed(parent)) _PlaceNode(w, parent); /* * Place all the children of this node. */ num = XmHierarchyC_num_children(parent); /* * Calculate how much room the children take up in the box */ child = (TreeConstraints * )XmHierarchyC_children(parent); prev_child = NULL; box_amount = 0; if (XmTree_orientation(tw) == XmHORIZONTAL) { for (i = 0; i < num; child++, i++ ) { if ((child != NULL) && (XtIsManaged(XmHierarchyC_widget(*child)))){ box_amount += XmTreeC_bb_height(*child); if (prev_child != NULL) box_amount += XmTree_v_node_space(tw); prev_child = *child; } } /* center in parent's bounding box */ boxy = XmTreeC_box_y(parent)+((int)(XmTreeC_bb_height(parent)-box_amount)/2); /* * Calculate the positions of all the child bounding boxes */ child = (TreeConstraints *) XmHierarchyC_children(parent); prev_child = NULL; x_loc = XmTreeC_box_x(parent); if (XmHierarchyC_state(parent) != XmHidden) x_loc += (pw->core.width + XmTreeC_widget_offset(parent) + 2 * pw->core.border_width + XmTree_h_node_space(tw)); for (i = 0; i < num; i++, child++) { XmTreeC_placed(*child) = TRUE; XmTreeC_box_x(*child) = x_loc; /* Only calculate for children that have node widgets that are managed */ if ((XmHierarchyC_widget(*child))&& (XtIsManaged(XmHierarchyC_widget(*child)))) { if (prev_child == NULL) XmTreeC_box_y(*child) = boxy; else XmTreeC_box_y(*child) = (XmTreeC_box_y(prev_child) + XmTreeC_bb_height(prev_child) + XmTree_v_node_space(tw)); prev_child = *child; } } } else /* orientation == XmVERTICAL */ { for (i = 0; i < num; child++, i++ ) { if ((child != NULL) && (XtIsManaged(XmHierarchyC_widget(*child)))){ box_amount += XmTreeC_bb_width(*child); if ((XmTreeC_is_compressed(*child)) || (prev_child && XmTreeC_is_compressed(prev_child))) box_amount -= XmTree_horizontal_delta(tw); if (prev_child != NULL) box_amount += XmTree_h_node_space(tw); prev_child = *child; } } /* center in parent's bounding box */ boxx = XmTreeC_box_x(parent)+((int)(XmTreeC_bb_width(parent)-box_amount)/2); /* * Calculate the positions of all the child bounding boxes */ child = (TreeConstraints *) XmHierarchyC_children(parent); prev_child = NULL; y_loc = XmTreeC_box_y(parent); if (XmHierarchyC_state(parent) != XmHidden) y_loc += (pw->core.height + XmTreeC_widget_offset(parent) + 2 * pw->core.border_width + XmTree_v_node_space(tw)); for (i = 0; i < num; i++, child++) { XmTreeC_placed(*child) = TRUE; XmTreeC_box_y(*child) = y_loc; /* Only calculate for children that have node widgets that are managed */ if ((XmHierarchyC_widget(*child))&& (XtIsManaged(XmHierarchyC_widget(*child)))) { if (prev_child == NULL) XmTreeC_box_x(*child) = boxx; else XmTreeC_box_x(*child) = (XmTreeC_box_x(prev_child) + XmTreeC_bb_width(prev_child) + XmTree_h_node_space(tw)); /* * If we are doing tree compression, we may have to move this * widget down. If the compress_style is CompressAll * then we should compress every other node no matter what. * If the compress_style == CompressLeaves then we only compress * alternating nodes if they have no children. */ if (XmTreeC_is_compressed(*child)) { XmTreeC_box_y(*child) += XmTree_vertical_delta(tw); XmTreeC_box_x(*child) -= XmTree_horizontal_delta(tw); } else if (prev_child && XmTreeC_is_compressed(prev_child)) XmTreeC_box_x(*child) -= XmTree_horizontal_delta(tw); prev_child = *child; } } } } /* Function Name: GetNodeHeightAndWidth * Description: Gets the size of each node. * Arguments: w - the drt widget. * node - the node to get the height and width of. * tree_depth - depth of the tree at this node. * IN/OUT num - number of nodes. * sib_index - index of this node with relation * to siblings. Used for vertical compression. * Returns: none */ static Boolean GetNodeHeightAndWidth(Widget w, TreeConstraints node, Cardinal * num, Cardinal sib_index) { XmTreeWidget tw = (XmTreeWidget) w; register int i, num_kids, l_width, l_height; if (node == NULL) return(False); l_width = l_height = 0; XmTreeC_bb_width(node) = XmTreeC_bb_height(node) = 0; if ((node == NULL) || ((XmHierarchyC_widget(node) != NULL) && !XtIsManaged(XmHierarchyC_widget(node)))) { return(False); } if (XmHierarchyC_state(node) != XmHidden) { Widget child = XmHierarchyC_widget(node); Dimension bw = 2 * child->core.border_width; XmTreeC_bb_width(node) = child->core.width + bw; XmTreeC_bb_height(node) = child->core.height + bw; /* * Leave space to place the open close button if it exists. */ if (XmHierarchyC_open_close_button(node) != NULL) { Dimension width, height, border_width; width = XmHierarchyC_open_close_button(node)->core.width; height = XmHierarchyC_open_close_button(node)->core.height; border_width = 2*XmHierarchyC_open_close_button(node)->core.border_width; width += border_width; height += border_width; if (XmTree_orientation(tw) == XmHORIZONTAL) { width += XmTreeC_open_close_padding(node); XmTreeC_bb_width(node) += width; XmTreeC_widget_offset(node) = width; if (height > XmTreeC_bb_height(node)) XmTreeC_bb_height(node) = height; } else /* orientation == XmVERTICAL */ { height += XmTreeC_open_close_padding(node); XmTreeC_bb_height(node) += height; XmTreeC_widget_offset(node) = height; if (width > XmTreeC_bb_width(node)) XmTreeC_bb_width(node) = width; } } else XmTreeC_widget_offset(node) = 0; (*num)++; } if (XmTree_orientation(tw) == XmHORIZONTAL) { num_kids = XmHierarchyC_num_children(node); if ((XmHierarchyC_state(node) != XmClosed) && (num_kids > 0)) { register TreeConstraints * child; register int num_managed=0; child = (TreeConstraints *) XmHierarchyC_children(node); for(i = 0; i < num_kids; i++, child++) { /* If node values were calculated for this child, * and there is more than one child managed, add node * space to bounding box size * * l_height = MAX(sum of N child bounding box heights + * (N-1)*v_node_space, our height); * l_width = MAX(child bounding box widths) + 1*h_node_space + * our width; */ if (GetNodeHeightAndWidth(w, *child, num, i)) { num_managed++; if (num_managed > 1) l_height += XmTree_v_node_space(tw); } if ((int)l_width < (int)XmTreeC_bb_width(*child)) l_width = XmTreeC_bb_width(*child); l_height += XmTreeC_bb_height(*child); } if (XmHierarchyC_state(node) != XmHidden) l_width += XmTree_h_node_space(tw); } XmTreeC_bb_width(node) += l_width; if ((int)XmTreeC_bb_height(node) < (int)l_height) XmTreeC_bb_height(node) = l_height; } else /* orientation == XmVERTICAL */ { num_kids = XmHierarchyC_num_children(node); if ((XmHierarchyC_state(node) != XmClosed) && (num_kids > 0)) { register TreeConstraints * child; register TreeConstraints prev_child = NULL; register int num_managed=0; child = (TreeConstraints *) XmHierarchyC_children(node); for(i = 0; i < num_kids; i++) { /* If node values were calculated for this child, * and there is more than one child managed, add node * space to bounding box size */ if (GetNodeHeightAndWidth(w, *child, num, i)) { num_managed++; if (num_managed > 1) l_width += XmTree_h_node_space(tw); } /* * If this child is compressed, add the verticalDelta to * it's height for purposes of calculating our own height * and subtract the horizontal delta from its width for * our own width. * If this child is not compressed, use just its height but * we still need to subtract the horizontal delta from our * width if the previous child is compressed. */ if (XmTreeC_is_compressed(*child)) { if ((int)l_height < (int)XmTreeC_bb_height(*child) + (int)XmTree_vertical_delta(tw)) l_height = XmTreeC_bb_height(*child) + XmTree_vertical_delta(tw); l_width += XmTreeC_bb_width(*child) - XmTree_horizontal_delta(tw); } else { if ((int)l_height < (int)XmTreeC_bb_height(*child)) l_height = XmTreeC_bb_height(*child); if (prev_child && XmTreeC_is_compressed(prev_child)) l_width += XmTreeC_bb_width(*child) - XmTree_horizontal_delta(tw); else l_width += XmTreeC_bb_width(*child); } prev_child = *child; child++; } if (XmHierarchyC_state(node) != XmHidden) l_height += XmTree_v_node_space(tw); } XmTreeC_bb_height(node) += l_height; if ((int)XmTreeC_bb_width(node) < (int)l_width) XmTreeC_bb_width(node) = l_width; if ( (((XmTree_compress_style(tw) == XmTreeCompressAll) && ((sib_index % 2) == 1)) && (XmHierarchyC_parent(node) != NULL)) || (((XmTree_compress_style(tw) == XmTreeCompressLeaves) && (num_kids == 0) && (XmHierarchyC_parent(node) != NULL) && ((sib_index % 2) == 1))) ) { XmTreeC_is_compressed(node) = True; } else XmTreeC_is_compressed(node) = False; } return( True ); } /* Function Name: GetNodeInfo * Description: Gets the node info associated with this widget. * Arguments: w - the widget. * Returns: the node info about this widget. */ static TreeConstraints GetNodeInfo(Widget w) { return((TreeConstraints) w->core.constraints); } /* Function Name: CalcMaxSize * Description: Calculates the maximum width of the tree. * Arguments: w - the tree. * Returns: The max width the tree would like to be. * * NOTE: This is calculating both the max width and the max_height */ static void CalcMaxSize(Widget w) { XmTreeWidget tw = (XmTreeWidget) w; register TreeConstraints node = (TreeConstraints) XmHierarchy_top_node(tw); XmTree_max_width(tw) = XmTreeC_bb_width(node) + 2 * XmHierarchy_h_margin(tw); XmTree_max_height(tw) = XmTreeC_bb_height(node) + 2 * XmHierarchy_v_margin(tw); } /************************************************************ * * Code for handling the node queue. * ************************************************************/ /* Function Name: UnmapAllExtraNodes * Description: Correctly unmaps each node in the hierarchy that is * currently compresed out. * Arguments: w - the ow. * node - node to work one. * Returns: none */ static void UnmapAllExtraNodes(Widget w, HierarchyConstraints node) { register int i, num; register HierarchyConstraints * ptr; if ((XmHierarchyC_status(node) & IS_COMPRESSED) && (XmHierarchyC_status(node) & IS_MAPPED)) { UnmapNode((XmTreeWidget) w, (TreeConstraints) node); } ptr = XmHierarchyC_children(node); for (num = XmHierarchyC_num_children(node), i = 0; i < num; i++, ptr++) UnmapAllExtraNodes(w, *ptr); } /* Function Name: MoveNode * Description: This function adds a widget to the movment queue * but does not move it until it becomes visible. * Arguments: tw - the tree widget. * node - the node to move. * x, y - the X and Y location. * oc_x, oc_y - the X and Y location of the open close button. * map - map this child? * Returns: none. */ static void MoveNode(XmTreeWidget tw, TreeConstraints node, Position x, Position y, Position oc_x, Position oc_y, Boolean map) { XmTreeC_new_x(node) = x; XmTreeC_new_y(node) = y; XmTreeC_oc_new_x(node) = oc_x; XmTreeC_oc_new_y(node) = oc_y; XmTreeC_map(node) = map; XmTreeC_move(node) = True; XmTreeC_unmap(node) = False; _XmListAddBefore(XmTree_child_op_list(tw), NULL, (XtPointer) node); } /* Function Name: UnmapNode * Description: This function adds a widget to the movment queue * telling it to be unmapped. * Arguments: tw - the tree widget. * node - the node to move. * Returns: none. */ static void UnmapNode(XmTreeWidget tw, TreeConstraints node) { XmTreeC_map(node) = False; XmTreeC_move(node) = False; XmTreeC_unmap(node) = True; _XmListAddBefore(XmTree_child_op_list(tw), NULL, (XtPointer) node); } /* Function Name: ProcessChildQueue * Description: Processes the child queue. * Arguments: tw - the tree widget. * vis - the visible rect. * Returns: none. */ static void ProcessChildQueue(XmTreeWidget tw, XRectangle *vis) { XmListElem *elem, *next; elem = XmListFirst(XmTree_child_op_list(tw)); while(elem != NULL) { TreeConstraints info = (TreeConstraints) XmListElemData(elem); next = XmListElemNext(elem); if (CheckWidget(vis, info)) _XmListRemove(XmTree_child_op_list(tw), elem); elem = next; } } /* Function Name: CheckWidget * Description: This function checks a widget to see if it * needs to be operated on. * Arguments: visible - visible rect. * info - the child op info. * Returns: True if operation complete. * * NOTES: A widget will need to be operated on if it is mapped an will show * on the screen, or if the new location is on the screen * OR if the node's parent is on the screen */ static Boolean CheckWidget(XRectangle * visible, TreeConstraints node) { if (( ((XmHierarchyC_status(node) & IS_MAPPED) || XmTreeC_map(node)) && (WidgetInRect(visible, XmHierarchyC_open_close_button(node)) || WidgetInRect(visible, XmHierarchyC_widget(node)) || WidgetInRect(visible, XmHierarchyC_parent(node)))) || LocInRect(visible, XmHierarchyC_open_close_button(node), XmTreeC_oc_new_x(node), XmTreeC_oc_new_y(node)) || LocInRect(visible, XmHierarchyC_widget(node), XmTreeC_new_x(node), XmTreeC_new_y(node))) { ProcessNode(node); return(True); } return(False); } /* Function Name: ProcessNode * Description: Processes the request made of this tree node. * Arguments: node - the Tree node to process. * Returns: none. */ static void ProcessNode(TreeConstraints node) { XmTreeWidgetClass tc; Widget w = XmHierarchyC_widget(node); if (w == NULL) return; tc = (XmTreeWidgetClass) XtClass(XtParent(w)); if (XmTreeC_move(node)) { _XmMoveWidget(XmHierarchyC_widget(node), XmTreeC_new_x(node), XmTreeC_new_y(node)); if (XmHierarchyC_open_close_button(node) != NULL) _XmMoveWidget(XmHierarchyC_open_close_button(node), XmTreeC_oc_new_x(node), XmTreeC_oc_new_y(node)); XmTreeC_move(node) = False; } if (XmTreeC_map(node)) { XmHierarchyNodeProc map_node; _XmProcessLock(); map_node = tc->hierarchy_class.map_node; _XmProcessUnlock(); (*map_node)((HierarchyConstraints) node); XmTreeC_map(node) = False; } if (XmTreeC_unmap(node)) { XmHierarchyNodeProc unmap_node; _XmProcessLock(); unmap_node = tc->hierarchy_class.unmap_node; _XmProcessUnlock(); (*unmap_node)((HierarchyConstraints) node); XmTreeC_unmap(node) = False; } } /* Function Name: WidgetInRect * Description: Checks to see if widget is in the rect specified. * Arguments: rect - the rect to check. * w - the widget to check. * Returns: True if the widget is in the regien specified. */ static Boolean WidgetInRect(XRectangle *rect, Widget w) { if (w == NULL) return(False); return(LocInRect(rect, w, w->core.x, w->core.y)); } /* Function Name: LocInRect * Description: Checks to see if widget is in the rect specified. * given new X and Y locations. * Arguments: rect - the rectangle to check. * w - the widget to check. * x, y - the new x and y locations. * Returns: True if the widget is in the regien specified. */ static Boolean LocInRect(XRectangle *rect, Widget w, Position x, Position y) { register int x1, x2; register int y1, y2; if (w == NULL) return(False); x1 = x + w->core.width; y1 = y + w->core.height; x2 = rect->x + rect->width; y2 = rect->y + rect->height; return (!((x > x2) || (y > y2) || (x1 < rect->x) || (y1 < rect->y))); } /* Function Name: MoveNodesTimer * Description: processes one node from the movemont queue. * Arguments: data - A Pointer to the tree widget. * id - th ext interval id. * Returns: none */ /* ARGSUSED */ static Boolean MoveNodesTimer(XtPointer data) { XmTreeWidget tw = (XmTreeWidget) data; XmListElem *elem = XmListFirst(XmTree_child_op_list(tw)); if (elem != NULL) { TreeConstraints node = (TreeConstraints) XmListElemData(elem); ProcessNode(node); _XmListRemove(XmTree_child_op_list(tw), elem); return( False ); } XmHierarchy_work_proc_id(tw) = (XtWorkProcId) NULL; return( True ); } static void LineStyle_confirm (Widget w, int value) { TreeConstraints node = GetNodeInfo(w); switch (XmTreeC_line_style(node)) { case LineSolid: case LineOnOffDash: case LineDoubleDash: break; default: /* error */ XmTreeC_line_style(node) = value; break; } } /************************************************************ * * Public functions. * ************************************************************/ /* Function Name: XmCreateTree * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateTree(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmTreeWidgetClass, parent, args, num_args)); } motif-2.3.8/lib/Xm/MenuShell.c0000644000175000017500000021025113145162623012761 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: MenuShell.c /main/24 1999/07/08 16:49:59 vipin $" #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "GadgetUtiI.h" #include "MapEventsI.h" #include "MenuShellI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "MessagesI.h" #include "RCMenuI.h" #include "RowColumnI.h" #include "TearOffI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "VendorSI.h" #include "ResIndI.h" #include "XmI.h" #include #define Events ((unsigned int) (ButtonPressMask | ButtonReleaseMask | \ EnterWindowMask | LeaveWindowMask)) /* Warning messages */ #define ChildMsg _XmMMsgMenuShell_0000 #define ManageMsg _XmMMsgMenuShell_0001 #define MESSAGE2 _XmMMsgMenuShell_0002 #define MESSAGE3 _XmMMsgMenuShell_0003 #define MESSAGE4 _XmMMsgMenuShell_0004 #define MESSAGE5 _XmMMsgMenuShell_0005 #define MESSAGE6 _XmMMsgMenuShell_0006 #define MESSAGE7 _XmMMsgMenuShell_0007 #define MESSAGE8 _XmMMsgMenuShell_0008 #define MESSAGE9 _XmMMsgMenuShell_0009 #define default_translations _XmMenuShell_translations /******** Static Function Declarations ********/ static void _XmFastExpose( register XmManagerWidget rowcol) ; static void _XmFastPopdown( XmMenuShellWidget shell) ; static void PostMenuShell( XmMenuShellWidget menuShell, XtGrabKind grab_kind, #if NeedWidePrototypes int spring_loaded) ; #else Boolean spring_loaded) ; #endif /* NeedWidePrototypes */ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void StructureNotifyHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Resize( Widget wid) ; static void DeleteChild( Widget widget) ; static void InsertChild( Widget widget) ; static void ForceMenuPaneOnScreen( register XmRowColumnWidget rowcol, register Position *x, register Position *y) ; static void PopupSharedMenuShell( Widget cbwid, Widget smwid, XEvent *event) ; static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget w) ; static void Popdown( XmMenuShellWidget menushell, XEvent *event) ; static void PopdownKids( XmMenuShellWidget menushell, XEvent *event) ; static int SkipPopdown( XmCascadeButtonWidget cascade) ; static void PopdownOne( Widget widget, XEvent *event, String *params, Cardinal *num_params) ; static void PopdownEveryone( Widget widget, XEvent *event, String *params, Cardinal *num_params) ; static void PopdownDone( Widget widget, XEvent *event, String *params, Cardinal *num_params) ; static void ClearTraversalInternal( XmMenuShellWidget menushell, XEvent *event) ; static void Destroy( Widget wid) ; static Widget _XmFindPopup( Widget widget, String name) ; static void _XmMenuPopupAction( Widget widget, XEvent *event, String *params, Cardinal *num_params) ; static void _XmMenuPopdownAction( Widget widget, XEvent *event, String *params, Cardinal *num_params) ; static XmFontList GetTable(Widget wid, XtEnum type); static void CheckSetRenderTables(Widget wid, int offset, XrmValue *value); static XmDirection GetDirection(Widget); /******** End Static Function Declarations ********/ static XmConst char tk_error[] = "XtToolkitError" ; static XtActionsRec actionsList[] = { {"MenuShellPopdownOne", PopdownOne}, {"MenuShellPopdownDone", PopdownDone}, {"XtMenuPopup", _XmMenuPopupAction}, {"XtMenuPopdown", _XmMenuPopdownAction}, {"MenuEscape", _XmMenuEscape}, {"ClearTraversal", _XmClearTraversal} }; static XtResource resources[] = { { XmNdefaultFontList, XmCDefaultFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf( struct _XmMenuShellRec, menu_shell.default_font_list), XmRString, (XtPointer) NULL }, { XmNlabelFontList, XmCLabelFontList, XmRLabelRenderTable, sizeof(XmFontList), XtOffsetOf( struct _XmMenuShellRec, menu_shell.label_font_list), XmRCallProc, (XtPointer) CheckSetRenderTables }, { XmNbuttonFontList, XmCButtonFontList, XmRButtonRenderTable, sizeof(XmFontList), XtOffsetOf( struct _XmMenuShellRec, menu_shell.button_font_list), XmRCallProc, (XtPointer) CheckSetRenderTables }, { XmNlabelRenderTable, XmCLabelRenderTable, XmRLabelRenderTable, sizeof(XmRenderTable), XtOffsetOf( struct _XmMenuShellRec, menu_shell.label_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables }, { XmNbuttonRenderTable, XmCButtonRenderTable, XmRButtonRenderTable, sizeof(XmRenderTable), XtOffsetOf( struct _XmMenuShellRec, menu_shell.button_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables }, { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), XtOffsetOf( struct _XmMenuShellRec, menu_shell.layout_direction), XmRCallProc, (XtPointer) _XmDirectionDefault }, { /* default visual dynamically, see _XmDefaultVisualResources */ XtNvisual, XtCVisual, XtRVisual, sizeof(Visual*), XtOffsetOf(ShellRec, shell.visual), XtRImmediate, (XtPointer)INVALID_VISUAL }, { XmNanimate, XmCAnimate, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmMenuShellRec, menu_shell.animate), XmRImmediate, (XtPointer) False }, }; static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), (XtInitProc)NULL, /* InitializePrehook */ (XtSetValuesFunc)NULL, /* SetValuesPrehook */ (XtInitProc)NULL, /* InitializePosthook */ (XtSetValuesFunc)NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ (XtInitProc)NULL, /* secondaryCreate */ (XmGetSecResDataFunc)NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ (XtArgsProc)NULL, /* get_values_prehook */ (XtArgsProc)NULL, /* get_values_posthook */ /* ... */ }; externaldef(xmmenushellclassrec) XmMenuShellClassRec xmMenuShellClassRec = { { (WidgetClass) & overrideShellClassRec, /* superclass */ "XmMenuShell", /* class_name */ sizeof (XmMenuShellWidgetRec), /* widget size */ ClassInitialize, /* Class Initializer */ ClassPartInitialize, /* chained class init */ FALSE, Initialize, /* instance init proc */ (XtArgsProc)NULL, /* init_hook proc */ XtInheritRealize, /* instance realize proc */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resource list */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ True, /* do compress_motion */ XtExposeCompressMaximal, /* do compress_exposure */ TRUE, /* do compress enter-leave */ FALSE, /* do have visible_interest */ Destroy, /* instance widget destroyb */ Resize, /* resize */ XtInheritExpose, /* expose */ SetValues, /* set values proc */ (XtArgsFunc)NULL, /* set values hook proc */ XtInheritSetValuesAlmost, /* set_values_almost proc */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus proc */ XtVersion, /* current version */ NULL, /* callback offset */ default_translations, /* translation table */ (XtGeometryHandler)NULL, /* query geo proc */ (XtStringProc)NULL, /* disp accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite class record */ /* BEGIN OSF fix pir 2131 */ GeometryManager, /* geo mgr */ /* END OSF fix pir 2131 */ ChangeManaged, /* have our own */ InsertChild, /* and this too */ DeleteChild, NULL, /* Extension */ }, { /* shell class record */ NULL, /* extension */ }, { /* override shell class record */ NULL, /* extension */ }, { /* menushell class record */ PopdownOne, PopdownEveryone, PopdownDone, PopupSharedMenuShell, NULL, /* extension */ }, }; externaldef(xmmenushellwidgetclass) WidgetClass xmMenuShellWidgetClass = (WidgetClass) &xmMenuShellClassRec; /* Trait record for MenuShell specify render table */ static XmConst XmSpecRenderTraitRec menushellSRT = { 0, /* version */ GetTable, }; static XmConst XmSpecifyLayoutDirectionTraitRec LayoutDirection = { 0, /* version */ GetDirection }; /* Save pointers for renderTable XmRCallProc */ static XmMenuShellWidget check_set_save = NULL; static int check_set_offset1 = 0; static int check_set_offset2 = 0; /* * When using an override redirect window, it is safe to draw to the * window as soon as you have mapped it; you need not wait for exposure * events to arrive. So ... to force menupanes to post quickly, we will * redraw all of the items now, and ignore the exposure events we receive * later. */ static void _XmFastExpose( register XmManagerWidget rowcol ) { register int i; register Widget child; /* Process the menupane */ RC_SetExpose(rowcol, True); (*(XtClass(rowcol)->core_class.expose))((Widget) rowcol, NULL, NULL); /* Process each windowed child */ for (i = 0; i < rowcol->composite.num_children; i++) { child = rowcol->composite.children[i]; if (XtIsWidget(child) && XtIsManaged(child)) { (*(XtClass(child)->core_class.expose))(child, NULL, NULL); } } XFlush(XtDisplay(rowcol)); /* Set one-shot, so menupane will ignore next expose */ RC_SetExpose(rowcol, False); } /* * When unposting a group of cascading menupanes, we will first unmap all * of the MenuShell widgets, and then take care of the other work needed * to get the job done. We do it this way, so that we can give the user * the fastest possible feedback. */ static void _XmFastPopdown( XmMenuShellWidget shell ) { if (RC_PopupPosted(shell->composite.children[0])) _XmFastPopdown((XmMenuShellWidget) RC_PopupPosted(shell->composite.children[0])); XtUnmapWidget(shell); } static void slideCancel(Widget w, Widget slide) { XtRemoveCallback(w, XmNunmapCallback, (XtCallbackProc)slideCancel, slide); XtDestroyWidget(slide); } static void slideFinish(Widget slide, Widget w) { XtRemoveCallback(w, XmNunmapCallback, (XtCallbackProc)slideCancel, slide); } static void _XmPopupI( Widget widget, XtGrabKind grab_kind, Boolean spring_loaded ) { register ShellWidget shell_widget = (ShellWidget) widget; if (! XtIsShell(widget)) { XtAppErrorMsg(XtWidgetToApplicationContext(widget), "invalidClass", "xmPopup", tk_error, MESSAGE2, (String *)NULL, (Cardinal *)NULL); } if (! shell_widget->shell.popped_up) { XtGrabKind call_data = grab_kind; XtCallCallbacks(widget, XtNpopupCallback, (XtPointer)&call_data); shell_widget->shell.popped_up = TRUE; shell_widget->shell.grab_kind = grab_kind; shell_widget->shell.spring_loaded = spring_loaded; if (shell_widget->shell.create_popup_child_proc != NULL) { (*(shell_widget->shell.create_popup_child_proc))(widget); } if (grab_kind == XtGrabExclusive) { _XmAddGrab(widget, TRUE, spring_loaded); } else if (grab_kind == XtGrabNonexclusive) { _XmAddGrab(widget, FALSE, spring_loaded); } XtRealizeWidget(widget); if (XmIsMenuShell(shell_widget) && ((XmMenuShellWidget)shell_widget)->menu_shell.animate) { if (XmIsRowColumn(shell_widget->composite.children[0])) { Dimension width, height; XtWidgetGeometry geo; Widget slider; XtQueryGeometry(widget, NULL, &geo); width = geo.width; height = geo.height; switch (RC_Type(shell_widget->composite.children[0])) { case XmMENU_POPUP: XtResizeWidget(widget, 1, 1, XtBorderWidth(widget)); break; case XmMENU_PULLDOWN: XtResizeWidget(widget, width, 1, XtBorderWidth(widget)); break; default: break; } slider = XtVaCreateWidget("MenuSlider", xmSlideContextWidgetClass, XmGetXmDisplay(XtDisplay(widget)), XmNslideWidget, widget, XmNslideDestWidth, width, XmNslideDestHeight, height, NULL); XtAddCallback(slider, XmNslideFinishCallback, (XtCallbackProc)slideFinish, shell_widget->composite.children[0]); XtAddCallback(shell_widget->composite.children[0], XmNunmapCallback, (XtCallbackProc)slideCancel, slider); } } XMapRaised(XtDisplay(widget), XtWindow(widget)); } else XRaiseWindow(XtDisplay(widget), XtWindow(widget)); } /* _XmPopupI */ void _XmPopupSpringLoaded( Widget shell) { _XmPopupI( shell, XtGrabExclusive, True) ; } void _XmPopup( Widget shell, XtGrabKind grab_kind) { _XmPopupI( shell, grab_kind, FALSE) ; } /* * Post the requested menu shell widget, */ static void PostMenuShell( XmMenuShellWidget menuShell, XtGrabKind grab_kind, #if NeedWidePrototypes int spring_loaded ) #else Boolean spring_loaded ) #endif /* NeedWidePrototypes */ { XEvent event; XEvent *lastEvent; /* Remember the next event from the queue so we don't popdown on the replay */ event.xbutton.type = ButtonPress; if ((lastEvent = XtLastEventProcessed(XtDisplay((Widget) menuShell))) == (XEvent *)NULL) { event.xbutton.serial = XLastKnownRequestProcessed(XtDisplay((Widget) menuShell)); } else { event.xbutton.serial = lastEvent->xany.serial; } event.xbutton.send_event = 0; event.xbutton.time = XtLastTimestampProcessed(XtDisplay((Widget) menuShell)); event.xbutton.display = XtDisplay((Widget)menuShell); _XmRecordEvent((XEvent *) &event); if (spring_loaded) { /* XmPopupSpringLoaded ((Widget) menuShell); */ /* Since the modality implementation requires the use of * _XmAddGrab() instead of XtAddGrab(), XtPopupSpringLoaded() * must be replaced with _XmPopupSpringLoaded(), which uses * the appropriate AddGrab routine. */ _XmPopupSpringLoaded( (Widget) menuShell) ; } else _XmPopup ((Widget) menuShell, grab_kind); /* mark the row column as NOT popping down */ RC_SetPoppingDown(menuShell->composite.children[0], False); } /* * Class Initialize. Set up fast subclassing. */ static void ClassInitialize( void ) { _XmInitializeExtensions(); baseClassExtRec.record_type = XmQmotif; } static XmDirection GetDirection(Widget w) { return ((XmMenuShellWidget)w)->menu_shell.layout_direction; } static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmMENU_SHELL_BIT); /* Install the specifyrendertable trait for all subclasses */ XmeTraitSet((XtPointer)wc, XmQTspecifyRenderTable, (XtPointer) &menushellSRT); XmeTraitSet(wc, XmQTspecifyLayoutDirection, (XtPointer) &LayoutDirection); } /* * Initialize routine */ /* ARGSUSED */ static void Initialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmFontList defaultFont; XmMenuShellWidget ms = (XmMenuShellWidget) new_w; new_w->core.background_pixmap = None; XtBorderWidth (new_w) = 0; /* Style Guide says so */ ms->menu_shell.focus_data = (XmFocusData)_XmCreateFocusData(); ms->menu_shell.focus_policy = XmEXPLICIT; ms->shell.allow_shell_resize = TRUE; /* get reasonable defaults for visual, depth and colormap */ _XmDefaultVisualResources(new_w); /* Fix 7961 - realization ordering causing badmatch */ XtRealizeWidget (new_w); /* Assume, for now, that the application created this shell */ ms->menu_shell.private_shell = False; defaultFont = ms->menu_shell.button_font_list; if ( !defaultFont ) { /* backward compatibility */ defaultFont = ms->menu_shell.default_font_list; if ( !defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) ms, XmBUTTON_FONTLIST); } ms->menu_shell.button_font_list = XmFontListCopy (defaultFont); defaultFont = ms->menu_shell.label_font_list; if ( !defaultFont ) { /* backward compatibility */ defaultFont = ms->menu_shell.default_font_list; if ( !defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) ms, XmLABEL_FONTLIST); } ms->menu_shell.label_font_list = XmFontListCopy (defaultFont); if(ms->menu_shell.default_font_list != NULL) ms->menu_shell.default_font_list = XmFontListCopy(ms->menu_shell.default_font_list); _XmSetSwallowEventHandler((Widget) ms, True); /* * Take over EventHandler in Shell, to dump the configure notify * events since it is not smart enough to ignore stale events. */ XtInsertEventHandler((Widget) ms, (EventMask) StructureNotifyMask, True, StructureNotifyHandler, (XtPointer) NULL, XtListHead); } /* ARGSUSED */ static void StructureNotifyHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch ) { /* * This event handler is inserted at the head of the list so that * the configure notify events will be ignored. This is because the * configures are done directly when needed, not when the event handler * is called. */ if (event->type == ConfigureNotify) { /* all the configure notify events should be ignored */ *continue_to_dispatch = False; } } /* * set values * * Don't allow the allowShellResize flag to be set false */ /* ARGSUSED */ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmMenuShellWidget new_w = (XmMenuShellWidget) nw ; XmMenuShellWidget old_w = (XmMenuShellWidget) cw ; XmFontList defaultFont; /* CR 7124: XmNlayoutDirection is a CG resource. */ if (old_w->menu_shell.layout_direction != new_w->menu_shell.layout_direction) { XmeWarning(nw, MESSAGE9); new_w->menu_shell.layout_direction = old_w->menu_shell.layout_direction; } if (new_w->menu_shell.button_font_list != old_w->menu_shell.button_font_list) { XmFontListFree(old_w->menu_shell.button_font_list); defaultFont = new_w->menu_shell.button_font_list; if (!defaultFont) { defaultFont = new_w->menu_shell.default_font_list; if (!defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) new_w, XmBUTTON_FONTLIST); } new_w->menu_shell.button_font_list = XmFontListCopy (defaultFont); } if (new_w->menu_shell.label_font_list != old_w->menu_shell.label_font_list) { XmFontListFree(old_w->menu_shell.label_font_list); defaultFont = new_w->menu_shell.label_font_list; if (!defaultFont) { defaultFont = new_w->menu_shell.default_font_list; if (!defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) new_w, XmLABEL_FONTLIST); } new_w->menu_shell.label_font_list = XmFontListCopy (defaultFont); } new_w->shell.allow_shell_resize = TRUE; return (TRUE); } /* * Resize our first child * * The statement pertaining to shared menupanes is commented out because * if the user is rapidly moving thru the menubar, an old configure notify * event may come in, cause the shell to resize the wrong child. */ static void Resize( Widget wid ) { XmMenuShellWidget ms = (XmMenuShellWidget) wid ; if (((ms->composite.num_children == 1) && (XtIsManaged(ms->composite.children[0])))) /* || ((ms->composite.num_children > 1) && (ms->shell.popped_up))) */ { Widget child = ms->composite.children[0]; XmeConfigureObject(child, -ms->core.border_width, -ms->core.border_width, ms->core.width, ms->core.height, ms->core.border_width); } } /* * DeleteChild routine */ static void DeleteChild( Widget widget ) { XmMenuShellWidget parent = (XmMenuShellWidget)XtParent(widget); /* Remove the child as our tab group */ XmRemoveTabGroup(widget); /* Let composite class finish the work */ (*(((CompositeWidgetClass)compositeWidgetClass)->composite_class. delete_child))(widget); /* * If we had multiple children, but we've now dropped down to 1 child, * then we need to unmanage the child. */ if (parent->composite.num_children == 1) { Widget baseChild = parent->composite.children[0]; if (!parent->shell.popped_up && !(XmIsRowColumn(baseChild) && RC_TearOffActive(baseChild))) baseChild->core.managed = False; XMapWindow(XtDisplay(parent), XtWindow(baseChild)); } else if ((parent->composite.num_children == 0) && (parent->menu_shell.private_shell) && (!parent->core.being_destroyed)) { /* Destroy private shells, when they have no more children */ XtDestroyWidget((Widget) parent); } } /* * InsertChild routine */ static void InsertChild( Widget widget ) { CompositeWidget parent = (CompositeWidget) widget->core.parent; int num_real_children, i; if (XmIsRowColumn (widget)) { if ((RC_Type(widget) == XmMENU_PULLDOWN) || (RC_Type(widget) == XmMENU_POPUP)) { XtAddEventHandler (widget, EnterWindowMask, FALSE, _XmEnterRowColumn, FALSE); } /* * add to composite list */ (*((CompositeWidgetClass)compositeWidgetClass)->composite_class. insert_child) (widget); XtRealizeWidget(widget); /* Find the number of children excluding those being destroyed. * This fixes a problem with menus being dynamically destroyed * and added. Before this fix the new menu was never mapped * because the menu being destroyed was still counted as a child. */ for (i = 0, num_real_children = 0; i < parent->composite.num_children; i++) if (!parent->composite.children[i]->core.being_destroyed) num_real_children++; /* * If only one child, then we will manage and unmanage it when we * want it to post or unpost. If there are more than one child, then * we will have them always managed, and we will use a different * technique for posting and unposting. */ if (num_real_children == 1) { XtSetKeyboardFocus(( Widget) parent, widget); } else if (num_real_children == 2) { /* if one is torn off, they don't have the same parent, so manage ** separately. */ if (parent->composite.children[0] != parent->composite.children[1]) { XtManageChild(parent->composite.children[0]); XtManageChild(parent->composite.children[1]); } else { XtManageChildren(parent->composite.children, 2); } } else { XtManageChild(widget); } if (num_real_children == 1) { XMapWindow(XtDisplay(widget), XtWindow(widget)); } } else XmeWarning(widget, ChildMsg); } static void ForceMenuPaneOnScreen( register XmRowColumnWidget rowcol, register Position *x, register Position *y ) { Position rightEdgeOfMenu, bottomEdgeOfMenu; Dimension dispWidth, dispHeight; Widget pulldown_button = RC_CascadeBtn(rowcol); Dimension RowColBorderWidth = rowcol->core.border_width << 1; Dimension CascadeBorderWidth = 0; if (pulldown_button) CascadeBorderWidth = pulldown_button->core.border_width << 1; /* Force the rowcol to be completely visible */ rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width; bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height; dispWidth = WidthOfScreen (XtScreen(rowcol)); dispHeight = HeightOfScreen (XtScreen(rowcol)); /* * For OPTION menus, if the submenu is [partially] offscreen, offset it * off the button. */ if (pulldown_button && XtParent(pulldown_button) && XmIsRowColumn(XtParent(pulldown_button)) && (RC_Type(XtParent(pulldown_button)) == XmMENU_OPTION)) { Position old_x = *x; if (bottomEdgeOfMenu >= (Position)dispHeight) { *y = dispHeight - rowcol->core.height - RowColBorderWidth - 1; if (LayoutIsRtoLM(rowcol)) *x = old_x - rowcol->core.width - (rowcol->core.border_width <<1); else *x = old_x + pulldown_button->core.width + CascadeBorderWidth; rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width; bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height; } if (*y < 0) { *y = 0; /* Consider CascadeBtn as well as RowCol width to allow multi * column RowColumn */ if (LayoutIsRtoLM(rowcol)) *x = old_x - rowcol->core.width - (rowcol->core.border_width <<1); else *x = old_x + pulldown_button->core.width + CascadeBorderWidth; rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width; bottomEdgeOfMenu = *y + RowColBorderWidth + rowcol->core.height; } if (rightEdgeOfMenu >= (Position)dispWidth) { *x = old_x - rowcol->core.width + RowColBorderWidth; rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width; } if (*x < 0) { if (LayoutIsRtoLM(rowcol)) *x = old_x + pulldown_button->core.width + CascadeBorderWidth; else *x = old_x + pulldown_button->core.width + CascadeBorderWidth; rightEdgeOfMenu = *x + RowColBorderWidth + rowcol->core.width; } } /* * If the submenu is offscreen force it completely on. */ if (rightEdgeOfMenu >= (Position)dispWidth) *x -= (rightEdgeOfMenu - dispWidth + 1); if (bottomEdgeOfMenu >= (Position)dispHeight) { if (pulldown_button && XtParent(pulldown_button) && (RC_Type(XtParent(pulldown_button)) == XmMENU_BAR)) { Position y_temp = *y; /* this menu pane is being pulled down from a bar */ /* it doesn't fit, so we have to place it above */ /* the bar -- if it will fit */ y_temp -= (CascadeBorderWidth + pulldown_button->core.height + RowColBorderWidth + rowcol->core.height + 1); if (y_temp > 0) *y = y_temp; } else *y -= (bottomEdgeOfMenu - dispHeight + 1); } /* Make sure that the top left corner os on screen! */ if (*x < 0) *x = 0; if (*y < 0) *y = 0; } /* * Method for posting a multi-paned menushell */ static void PopupSharedMenuShell( Widget cbwid, Widget smwid, XEvent *event ) { XmCascadeButtonWidget cascadebtn = (XmCascadeButtonWidget) cbwid ; XmRowColumnWidget submenu = (XmRowColumnWidget) smwid ; register XmMenuShellWidget popup = (XmMenuShellWidget) XtParent(submenu); XmRowColumnWidget parent_menu; Position x, y; Dimension height, width; int _index = 0; register int i; Boolean popped_up = popup->shell.popped_up; XmRowColumnWidget old_rowcol = NULL; XmCascadeButtonWidget old_cascadebtn = NULL; XmMenuState mst = _XmGetMenuState((Widget)submenu); Time _time = _XmGetDefaultTime(cbwid, event); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) submenu), XmQTmenuSystem); /* Find out which child is trying to get posted */ for (i = 0; i < popup->composite.num_children; i++) { if (popup->composite.children[i] == (Widget)submenu) { _index = i; break; } } /* Swap only if the submenu is not already child[0] */ if (_index != 0) { /* Swap places in the children list */ old_rowcol = (XmRowColumnWidget) popup->composite.children[0]; old_cascadebtn = (XmCascadeButtonWidget)RC_CascadeBtn(old_rowcol); RC_SetPoppingDown(old_rowcol, True); menuSTrait -> disarm((Widget) old_rowcol); /* RC_SetArmed (old_rowcol, False); */ popup->composite.children[_index] = (Widget)old_rowcol; popup->composite.children[0] = (Widget)submenu; RC_SetPoppingDown(submenu, False); if (RC_TornOff(old_rowcol)) _XmRestoreTearOffToToplevelShell((Widget)old_rowcol, event); else XUnmapWindow(XtDisplay(old_rowcol), XtWindow(old_rowcol)); } else if (cascadebtn != (XmCascadeButtonWidget) RC_CascadeBtn(popup->composite.children[0])) { /* If the 2 different cascade buttons popped up this submenu, * unmap it in preparation for the 'move'. Also save the old * cascade so it can be unhighlighted. */ old_cascadebtn = (XmCascadeButtonWidget)RC_CascadeBtn(submenu); XUnmapWindow(XtDisplay(submenu), XtWindow(submenu)); } if (popped_up || (old_cascadebtn && RC_TornOff(XtParent(old_cascadebtn)) && !XmIsMenuShell(XtParent(XtParent(old_cascadebtn))))) { XmCascadeButtonHighlight( (Widget) old_cascadebtn, False); } if (submenu->core.being_destroyed) return; /* It seems that menupanes that share their menushell are always managed. * When reposting a tear off, the restoration code unmanages the pane. * So set it here! */ submenu->core.managed = TRUE; if (menuSTrait) menuSTrait -> cascade((Widget) submenu, (Widget) cascadebtn, event); /* * Set us as the active tab group for our parent */ _XmSetActiveTabGroup(popup->menu_shell.focus_data, (Widget)submenu); /* * get the shell widget in sync with the menu widget * We keep the menu at 0,0 and shell at the menu's position. * the menu's position is just used as a place to keep shell's loc * * NOTE: the menu may be moved down slightly to take into account the * tear off control. */ /* Always adjust to the size of the menupane */ width = XtWidth(submenu); height = XtHeight(submenu); if (RC_WidgetHasMoved (submenu)) /* but make sure it didn't */ { /* just move to where it */ /* is now. Happens with */ /* pulldowns a lot */ x = XtX(submenu); y = XtY(submenu); ForceMenuPaneOnScreen(submenu,&x,&y); XtX (submenu) = XtY (submenu) = (-1 * XtBorderWidth(submenu)); if (RC_WindowHasMoved(submenu)) { XMoveWindow (XtDisplay(submenu), XtWindow(submenu), XtX(submenu), XtY(submenu)); RC_SetWindowMoved (submenu, FALSE); } RC_SetWidgetMoved (submenu, FALSE); } else { x = XtX(popup); y = XtY(popup); } XmeConfigureObject((Widget) popup, x, y, width, height, popup->core.border_width); XMapWindow(XtDisplay(submenu), XtWindow(submenu)); if (popped_up && !((old_rowcol == submenu) && (cascadebtn == old_cascadebtn))) _XmCallRowColumnUnmapCallback((Widget)old_rowcol, event); _XmCallRowColumnMapCallback((Widget)submenu, event); /* * if there is a tear off control, set the initial focus to the first * real child. If none of the children is traversible, let the * traversal code set it to the toc. */ if (RC_TearOffControl(submenu) && XtIsManaged(RC_TearOffControl(submenu))) { for (i=0; i < submenu->composite.num_children; i++) { if (XmIsTraversable(submenu->composite.children[i])) { _XmSetInitialOfTabGroup( (Widget) submenu, submenu->composite.children[i]); break; } } } if (menuSTrait) menuSTrait -> arm((Widget) submenu); if (popped_up) _XmFastExpose((XmManagerWidget) submenu); else { /* * we are the root of the chain and better do the exclusive grab */ parent_menu = (XmRowColumnWidget) XtParent (cascadebtn); if (RC_Type(parent_menu) == XmMENU_OPTION) { /* Don't post the menu if the menu cannot control grabs! Note: * grabs done twice. You cannot grab on a non viewable window. */ if (_XmMenuGrabKeyboardAndPointer((Widget)parent_menu, _time) != GrabSuccess) { return; } /* Remember the time in case this is just a BSelect Click */ if ((event->type == ButtonPress) || (event->type == ButtonRelease)) mst->MS_LastManagedMenuTime = event->xbutton.time; PostMenuShell(popup, XtGrabExclusive, True); _XmFastExpose((XmManagerWidget) submenu); _XmMenuFocus(XtParent(submenu), XmMENU_BEGIN, _time); /** the real grab ***/ _XmMenuGrabKeyboardAndPointer((Widget)submenu, _time); } else { if ((RC_Type(parent_menu) == XmMENU_BAR) && (RC_BeingArmed(parent_menu))) { /* Don't post the menu if the menu cannot control grabs! */ if (_XmMenuGrabKeyboardAndPointer((Widget)parent_menu, _time) != GrabSuccess) { return; } RC_SetBeingArmed(parent_menu, False); } PostMenuShell(popup, XtGrabNonexclusive, False); _XmFastExpose((XmManagerWidget) submenu); /* We always must move the focuse for the leaf menu pane */ _XmMenuFocus(XtParent(submenu), XmMENU_MIDDLE, _time); } } /* * now highlight the pulldown entry widget that * pulled down the menu */ XmCascadeButtonHighlight ((Widget) cascadebtn, TRUE); if (popped_up) { XmGadget activeChild; activeChild = (XmGadget)old_rowcol->manager.active_child; /* * If the active child was a gadget, then we need to * handle the sending of the focus out ourselves. */ if (activeChild && XmIsGadget(activeChild)) { _XmDispatchGadgetInput((Widget) activeChild, NULL, XmFOCUS_OUT_EVENT); } } } /* BEGIN OSF fix pir 2131 */ /* This is ripped off from Xt/Shell.c and modified to also deal with X and Y * requests. */ /* * This is gross, I can't wait to see if the change happened so I will ask * the window manager to change my size and do the appropriate X work. * I will then tell the requester that he can. Care must be taken because * it is possible that some time in the future the request will be * asynchronusly denied and the window reverted to it's old size/shape. */ static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { ShellWidget shell = (ShellWidget)(wid->core.parent); XtWidgetGeometry my_request; if(shell->shell.allow_shell_resize == FALSE && XtIsRealized(wid)) return(XtGeometryNo); if(!XtIsRealized((Widget)shell)){ if (request->request_mode & (CWX | CWY)) { return(XtGeometryNo); } *reply = *request; if(request->request_mode & CWWidth) wid->core.width = shell->core.width = request->width; if(request->request_mode & CWHeight) wid->core.height = shell->core.height = request->height; if(request->request_mode & CWBorderWidth) wid->core.border_width = shell->core.border_width = request->border_width; return(XtGeometryYes); } /* %%% worry about XtCWQueryOnly */ my_request.request_mode = 0; if (request->request_mode & CWX) { my_request.x = request->x; my_request.request_mode |= CWX; } if (request->request_mode & CWY) { my_request.y = request->y; my_request.request_mode |= CWY; } if (request->request_mode & CWWidth) { my_request.width = request->width; my_request.request_mode |= CWWidth; } if (request->request_mode & CWHeight) { my_request.height = request->height; my_request.request_mode |= CWHeight; } if (request->request_mode & CWBorderWidth) { my_request.border_width = request->border_width; my_request.request_mode |= CWBorderWidth; } /* * Don't make geometry request if the shared menupane has a * visible pulldown, which isn't the current pulldown widget. This prevents * another pulldown menu to resize the menu shell's width and height, thus * dynamically resizing the visible pulldown. */ if ((wid != shell->composite.children[0]) || ((wid == shell->composite.children[0]) && (XtMakeGeometryRequest((Widget)shell, &my_request, NULL) == XtGeometryYes))) { if (request->request_mode & CWX) { wid->core.x = 0; } if (request->request_mode & CWY) { wid->core.y = 0; } if (request->request_mode & CWWidth) { wid->core.width = request->width; } if (request->request_mode & CWHeight) { wid->core.height = request->height; } if (request->request_mode & CWBorderWidth) { wid->core.border_width = request->border_width; wid->core.x = wid->core.y = -request->border_width; } return XtGeometryYes; } else return XtGeometryNo; } /* END OSF fix pir 2131 */ /* * ChangeManaged */ static void ChangeManaged( Widget w ) { register XmMenuShellWidget popup = (XmMenuShellWidget) w; XmRowColumnWidget parent_menu; Position x, y; Dimension height, width; XmCascadeButtonWidget cascadebtn; register Widget child; register XmRowColumnWidget rowcol = (XmRowColumnWidget)popup->composite.children[0]; int i; XmMenuState mst = _XmGetMenuState((Widget)w); XmMenuSystemTrait menuSTrait; Time _time = XtLastTimestampProcessed(XtDisplay(w)); mst->RC_ButtonEventStatus.waiting_to_be_managed = FALSE; /* Don't handle multi-paned shells here */ if (popup->composite.num_children > 1) return; if (rowcol->core.being_destroyed) return; if (XtIsManaged ((Widget)rowcol)) { if ((RC_Type(rowcol) == XmMENU_PULLDOWN) && (! RC_CascadeBtn(rowcol))) { /* * this pulldown does not have a complete path to * a toplevel pane, so it can not be managed */ XmeWarning(w, ManageMsg); XtUnmanageChild ((Widget) rowcol); return; } else if (RC_Type(rowcol) == XmMENU_POPUP) { /* Verify MenuPost/WhichButton */ if ((mst->RC_ButtonEventStatus.time == XtLastTimestampProcessed(XtDisplay(rowcol))) && !mst->RC_ButtonEventStatus.verified) { mst->RC_ButtonEventStatus.verified = False; XtUnmanageChild ((Widget) rowcol); return; } /* Remember the time in case this is just a BMenu Click */ mst->MS_LastManagedMenuTime = mst->RC_ButtonEventStatus.time; } /* Set us as the active tab group for our parent */ _XmSetActiveTabGroup(popup->menu_shell.focus_data, (Widget)rowcol); /* make the callback now to give the application a crack at * repositioning the pane. */ _XmCallRowColumnMapCallback((Widget)rowcol, (XEvent *)&mst->RC_ButtonEventStatus.event); /* * get the shell widget in sync with the menu widget * We keep the menu at 0,0 and shell at the menu's position. * the menu's position is just used as a place to keep shell's loc * * If a tear off control is relevant, move the pane down to allow for * its height. */ width = XtWidth(rowcol); height = XtHeight(rowcol); if (RC_WidgetHasMoved (rowcol)) { x = XtX(rowcol); y = XtY(rowcol); ForceMenuPaneOnScreen(rowcol,&x,&y); XtX (rowcol) = XtY (rowcol) = (-1 * XtBorderWidth(rowcol)); if (RC_WindowHasMoved(rowcol)) { XMoveWindow (XtDisplay(rowcol), XtWindow(rowcol), XtX(rowcol), XtY(rowcol)); RC_SetWindowMoved (rowcol, FALSE); } RC_SetWidgetMoved (rowcol, FALSE); } else { x = XtX(popup); y = XtY(popup); } XmeConfigureObject((Widget) popup, x, y, width, height, popup->core.border_width); /* * if there is a tear off control, set the initial focus to the first * real child. If none of the children is traversible, let the * traversal code set it to the toc. */ if (RC_TearOffControl(rowcol) && XtIsManaged(RC_TearOffControl(rowcol))) { for (i=0; i < rowcol->composite.num_children; i++) { if (XmIsTraversable(rowcol->composite.children[i])) { _XmSetInitialOfTabGroup( (Widget) rowcol, rowcol->composite.children[i]); break; } } } menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) rowcol), XmQTmenuSystem); menuSTrait -> arm((Widget) rowcol); /* * now figure out exactly how to pop it up */ switch (RC_Type(rowcol)) { case XmMENU_POPUP: /* Don't post the menu if the menu cannot control grabs! Note: * grabs done twice. You cannot grab on a non viewable window. */ if (RC_CascadeBtn(rowcol)) /* Doggone loophole! */ { if (_XmMenuGrabKeyboardAndPointer(RC_CascadeBtn(rowcol), _time) != GrabSuccess) { /** this is the fix for cmvc 6688 (CDExc15902) ***/ XtUnmanageChild((Widget) rowcol); /** end of fix for 6688 ****/ return; } } PostMenuShell((XmMenuShellWidget) w, XtGrabExclusive, True); _XmFastExpose((XmManagerWidget) rowcol); /** the real grab ***/ _XmMenuGrabKeyboardAndPointer((Widget)rowcol, _time); _XmMenuFocus(XtParent(rowcol), XmMENU_BEGIN, _time); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(rowcol), SyncPointer, CurrentTime); menuSTrait -> controlTraversal((Widget) rowcol, FALSE); break; case XmMENU_PULLDOWN: cascadebtn = (XmCascadeButtonWidget) RC_CascadeBtn(rowcol); parent_menu = (XmRowColumnWidget) XtParent (cascadebtn); /* Make sure the correct item gets the focus */ if (!_XmGetInDragMode((Widget) rowcol)) { if (RC_MemWidget(rowcol) && (RC_Type(parent_menu) == XmMENU_OPTION)) { if (XtParent(RC_MemWidget(rowcol)) == (Widget)rowcol) _XmSetInitialOfTabGroup( (Widget) rowcol, RC_MemWidget(rowcol)); else { /* Find our link to the memory widget */ child = (Widget)RC_MemWidget(rowcol); while (child) { if (XtParent(child) == (Widget)rowcol) break; child = (Widget)RC_CascadeBtn(XtParent(child)); } rowcol->manager.active_child = child; } } else rowcol->manager.active_child = NULL; if ((parent_menu->manager.active_child != (Widget)cascadebtn) && ((RC_Type(parent_menu) == XmMENU_POPUP) || (RC_Type(parent_menu) == XmMENU_PULLDOWN))) { /* Move the focus to the child */ _XmMgrTraversal((Widget) cascadebtn, XmTRAVERSE_CURRENT); } } if (RC_Type(parent_menu) == XmMENU_OPTION) { /* Don't post the menu if the menu cannot control grabs! Note: * grabs done twice. You cannot grab on a non viewable window. */ if (_XmMenuGrabKeyboardAndPointer((Widget)parent_menu, _time) != GrabSuccess) { XtUnmanageChild((Widget) rowcol); return; } /* Remember the time in case this is just a BSelect Click */ mst->MS_LastManagedMenuTime = mst->RC_ButtonEventStatus.time; PostMenuShell((XmMenuShellWidget) w, XtGrabExclusive, True); _XmFastExpose((XmManagerWidget) rowcol); /* Removed fixing bug #1260 (Yuriy Syrota, 2004-07-29) _XmMenuFocus(XtParent(rowcol), XmMENU_BEGIN, _time); */ /**the real grab *****/ _XmMenuGrabKeyboardAndPointer((Widget)rowcol, _time); _XmMenuFocus(XtParent(rowcol), XmMENU_BEGIN, _time); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(rowcol), SyncPointer, CurrentTime); } else { /* For a menubar, put the pointer grab on the menubar. */ if ((RC_Type(parent_menu) == XmMENU_BAR) && (RC_BeingArmed(parent_menu))) { if (_XmMenuGrabKeyboardAndPointer((Widget)parent_menu, _time) !=GrabSuccess) { XtUnmanageChild((Widget) rowcol); return; } RC_SetBeingArmed(parent_menu, False); } PostMenuShell((XmMenuShellWidget) w, XtGrabNonexclusive, False); _XmFastExpose((XmManagerWidget) rowcol); /* We always must grab the keyboard for the leaf menu pane */ _XmMenuFocus(XtParent(rowcol), XmMENU_MIDDLE, _time); XtSetKeyboardFocus(XtParent(rowcol), (Widget) rowcol); /* * now highlight the pulldown entry widget that * pulled down the menu */ XmCascadeButtonHighlight ((Widget) cascadebtn, TRUE); break; } } } else { /* popdown anything that is still up */ _XmMenuFocus(w, XmMENU_END, _time); (* (((XmMenuShellClassRec *)(popup-> core.widget_class))->menu_shell_class.popdownEveryone)) ((Widget) popup, NULL, NULL, NULL); if (RC_Type(rowcol) == XmMENU_POPUP) { XtUngrabPointer(w, _time); } } mst->RC_ButtonEventStatus.verified = False; } void _XmPopdown( Widget widget) { register ShellWidget shell_widget = (ShellWidget) widget; if (! XtIsShell(widget)) { XtAppErrorMsg(XtWidgetToApplicationContext(widget), "invalidClass", "xmPopdown", tk_error, MESSAGE3, (String *)NULL, (Cardinal *)NULL); } if (shell_widget->shell.popped_up) { XtGrabKind grab_kind = shell_widget->shell.grab_kind ; XWithdrawWindow( XtDisplay( shell_widget), XtWindow( shell_widget), XScreenNumberOfScreen( XtScreen( shell_widget))) ; if( grab_kind != XtGrabNone ) { _XmRemoveGrab((Widget) shell_widget) ; } shell_widget->shell.popped_up = FALSE ; XtCallCallbacks((Widget) shell_widget, XtNpopdownCallback, (XtPointer) &grab_kind) ; } } /* * actually popdown a menuShell widget, also flag as unmanaged * its menu child and unhighlight the cascadebutton that popped up this * widget */ static void Popdown( XmMenuShellWidget menushell, XEvent *event ) { XmRowColumnWidget rowcol = (XmRowColumnWidget) menushell->composite.children[0]; XmMenuSystemTrait menuSTrait; if (menushell->shell.popped_up) { /* mark the row column as popping down */ RC_SetPoppingDown (rowcol, True); /* XmPopdown ((Widget) menushell); */ /* Since the MenuShell may be popped up spring-loaded, * and since XmPopdown will remove the grab using XtRemoveGrab * if the shell is spring loaded, and since we must use * _XmRemoveGrab because of the modality implementation, we * must use our own version of _XmPopdown to pop down the * MenuShell. */ _XmPopdown( (Widget) menushell) ; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) rowcol), XmQTmenuSystem); menuSTrait -> disarm((Widget) rowcol); ClearTraversalInternal(menushell, event); /* Don't unmanage if we're sharing the menu shell */ if (menushell->composite.num_children == 1) rowcol->core.managed = FALSE; _XmCallRowColumnUnmapCallback((Widget)rowcol, event); /* Restore tear offs - except for Popups 'cause the ungrabs are * yet to occur */ if ((RC_Type(rowcol) != XmMENU_POPUP) || RC_TornOff(rowcol)) _XmRestoreTearOffToToplevelShell((Widget)rowcol, event); } } /* * Popdown all the popup kids of this widget, do bottom to top popdown. */ static void PopdownKids( XmMenuShellWidget menushell, XEvent *event ) { ShellWidget subShell; if ((subShell = (ShellWidget) RC_PopupPosted(menushell->composite.children[0])) != NULL) { Widget rowcol = subShell->composite.children[0]; /* mark this row colum as popping down */ RC_SetPoppingDown (rowcol, True); PopdownKids ((XmMenuShellWidget) subShell, event); Popdown ((XmMenuShellWidget) subShell, event); } } /* * This routine determines if there is an enter event pending which will * just pop back up the row column that is about to be popped down. */ static int SkipPopdown( XmCascadeButtonWidget cascade ) { XEvent event; /* * check if an enter event is pending. */ if (XPending (XtDisplay (cascade))) { XPeekEvent (XtDisplay (cascade), &event); if (event.type == EnterNotify) { XEnterWindowEvent * enterevent = (XEnterWindowEvent *) &event; if (XtWindow (cascade) == enterevent->window) return (TRUE); } } return (FALSE); } /* * event handler for entering on a row column widget. The widget must * be either a pulldown or popup menu. */ /* ARGSUSED */ void _XmEnterRowColumn( Widget widget, XtPointer closure, XEvent *event, Boolean *cont ) { XmRowColumnWidget cascade; Widget cascadebtn; Time _time = _XmGetDefaultTime(widget, event); XmRowColumnWidget rowcol = (XmRowColumnWidget) widget; XmMenuShellWidget menushell = (XmMenuShellWidget) XtParent(rowcol); XEnterWindowEvent *enterevent = (XEnterWindowEvent *) event; /* * Ignore popdown requests if traversal is on, or we're no longer * visible, or we don't have any submenus up. */ if (!_XmGetInDragMode(widget) || (!menushell->shell.popped_up) || (! RC_PopupPosted(rowcol))) return; cascade = (XmRowColumnWidget) ((CompositeWidget) RC_PopupPosted(rowcol))->composite.children[0]; cascadebtn = RC_CascadeBtn (cascade); /* * Make sure that popdown should not be skipped. It should be skipped * if the mouse has moved into the cascadebutton (widget or gadget) * that will just pop it back up again. */ if (XmIsCascadeButtonGadget(cascadebtn) && (cascadebtn == XmObjectAtPoint( (Widget) rowcol, enterevent->x, enterevent->y))) { return; } else if (XmIsCascadeButton(cascadebtn)) { if (SkipPopdown ((XmCascadeButtonWidget) cascadebtn)) return; else { Position x, y; XtTranslateCoords(cascadebtn, 0, 0, &x, &y); if ( (enterevent->x_root >= x) && (enterevent->x_root < (x + XtWidth(cascadebtn))) && (enterevent->y_root >= y) && (enterevent->y_root < (y + XtHeight(cascadebtn)))) { return; } } } _XmMenuFocus(XtParent(rowcol), XmMENU_MIDDLE, _time); PopdownKids (menushell, event); } static void PopdownOne( Widget widget, XEvent *event, String *params, Cardinal *num_params ) { XmMenuShellWidget ms = (XmMenuShellWidget)widget; XmMenuShellWidget tms; XmRowColumnWidget rowcol; /* Find a menu shell, this may be a menushell, rowcol or button */ /* OR (!) a top level shell! */ while (ms && !XtIsShell(ms)) ms = (XmMenuShellWidget)XtParent(ms); if (ms && !XmIsMenuShell(ms)) { /* prevent coredumps when pulldown menu isn't realized yet */ if (ms->core.managed) _XmDismissTearOff((Widget) ms, (XtPointer) event, (XtPointer) NULL); return; } if (ms == NULL) return; /* Find the toplevel MenuShell */ _XmGetActiveTopLevelMenu (ms->composite.children[0], (Widget *) &rowcol); tms = ms; if (RC_Type(rowcol) == XmMENU_BAR) tms = (XmMenuShellWidget) RC_PopupPosted(rowcol); else if ((RC_Type(rowcol) == XmMENU_POPUP) || ((RC_Type(rowcol) == XmMENU_PULLDOWN) && !XmIsMenuShell(XtParent( rowcol)))) { tms = (XmMenuShellWidget) XtParent(rowcol); if (!XmIsMenuShell(tms)) /* torn! */ { /* if the next pane up is the torn popup, bring down entire menu */ if (rowcol == (XmRowColumnWidget)XtParent( RC_CascadeBtn(ms->composite.children[0]))) ms = tms = (XmMenuShellWidget)RC_ParentShell(rowcol); } } if (ms == tms) (* (((XmMenuShellClassRec *)(ms->core.widget_class))-> menu_shell_class.popdownDone)) (widget, event, params, num_params); else { (* (((XmMenuShellClassRec *)(ms->core.widget_class))-> menu_shell_class.popdownEveryone)) ((Widget) ms, event, params, num_params); } if (event) _XmRecordEvent(event); } /* * Class function used to unpost all menupanes */ /* * popdown this all the popup children, and then me, ie. bottom to top * * called from ChangeManaged and PopdownDone */ /*ARGSUSED*/ static void PopdownEveryone( Widget widget, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget rowcol; XmMenuShellWidget shell = (XmMenuShellWidget) widget; /* Ignore this event, if already processed */ if ( event && !_XmIsEventUnique(event)) return; /* * If only a portion of the hierarchy is being popped down, then * make sure the keyboard grab gets reset to the right window. */ rowcol = shell->composite.children[0]; /* Only reset the focus if the this is not a tear off or the cascaded * submenu's parent is not a tear off. */ if ((RC_Type(rowcol) == XmMENU_PULLDOWN) && XmIsMenuShell(XtParent(rowcol)) && RC_CascadeBtn(rowcol) && XmIsMenuShell(XtParent(XtParent(RC_CascadeBtn(rowcol)))) ) { _XmMenuFocus(XtParent(XtParent(RC_CascadeBtn(rowcol))), XmMENU_MIDDLE, _XmGetDefaultTime(widget, event)); } /* mark this row colum as popping down */ RC_SetPoppingDown (rowcol, True); if (shell->shell.popped_up) { if (XmIsMenuShell(shell)) { _XmFastPopdown((XmMenuShellWidget) widget); XFlush(XtDisplay(widget)); PopdownKids ((XmMenuShellWidget) widget, event); /* do our kids */ Popdown ((XmMenuShellWidget) widget ,event); /* do us */ } else /* torn - don't popdown the popup! */ { PopdownKids ((XmMenuShellWidget) widget, event); /* do our kids */ } } } /* * Class function used to unpost all menupanes. * Note that to catch BSelect in a gadget and popdown correctly, widget param * must be the LEAF node menushell, rowcol, or button. */ static void PopdownDone( Widget widget, XEvent *event, String *params, Cardinal *num_params ) { XmMenuShellWidget ms = (XmMenuShellWidget)widget; XmRowColumnWidget rowcol; XmMenuState mst = _XmGetMenuState((Widget)widget); Time _time = _XmGetDefaultTime(widget, event); XmMenuSystemTrait menuSTrait; /* Ignore this event, if already processed */ if (event && !_XmIsEventUnique(event)) return; /* Find a menu shell, this may be a menushell, rowcol or button */ while (ms && !XmIsMenuShell(ms)) ms = (XmMenuShellWidget)XtParent(ms); if (ms == NULL) return; _XmGetActiveTopLevelMenu (ms->composite.children[0], (Widget *) &rowcol); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) rowcol), XmQTmenuSystem); /* We used to check the event, but not anymore (CUA) */ /* if (event && ((event->xbutton.type==ButtonPress) || */ /* (event->xbutton.type==ButtonRelease))) */ /* { */ /* if ( !(_XmMatchBtnEvent( event, XmIGNORE_EVENTTYPE, */ /* RC_PostButton(rowcol), RC_PostModifiers(rowcol)) || */ /* _XmMatchBSelectEvent(ms->composite.children[0], event )) ) */ /* { */ /* To support menu replay, keep the pointer in sync mode */ /* XAllowEvents(XtDisplay(rowcol), SyncPointer, _time); */ /* return; */ /* } */ /* } */ /* Take menus out of drag mode in either case of click into traversal or * unpost, unless the menu is a torn-off pane. */ if ((RC_Type(rowcol) == XmMENU_BAR) || (RC_Type(rowcol) == XmMENU_OPTION) || XmIsMenuShell(XtParent(rowcol))) { _XmSetInDragMode((Widget) rowcol, False); } /* This is to enable Option and Popup Menus to post on BMenu/BSelect Click. * By this time we know that the button is valid. We need to check * if the post event occured within a short time span. Next we force * the menu into traversal mode. And, of course, we return immediately * without popping down the pane. */ if (RC_popupMenuClick(rowcol) && event && ((event->type == ButtonPress) || (event->type == ButtonRelease)) && ((event->xbutton.time - mst->MS_LastManagedMenuTime) < XtGetMultiClickTime(XtDisplay(ms)))) /* or 150 ms? */ { if (RC_Type(rowcol) == XmMENU_OPTION) { if (!XmProcessTraversal(RC_MemWidget(rowcol), XmTRAVERSE_CURRENT)) XmProcessTraversal(RC_OptionSubMenu(rowcol), XmTRAVERSE_CURRENT); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(rowcol), SyncPointer, CurrentTime); return; } else if (!rowcol->manager.highlighted_widget) { XmProcessTraversal((Widget) rowcol, XmTRAVERSE_CURRENT); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(rowcol), SyncPointer, CurrentTime); return; } } /* * If in a menubar or popup, get the toplevel menushell * CHECK OPTION MENU esp w/ cascading submenus, JAY! */ if (RC_Type(rowcol) == XmMENU_BAR) { /* It's possible that we got here via an accelerator and the menu * isn't popped up - so ms could be NULL! */ if ( (ms = (XmMenuShellWidget) RC_PopupPosted(rowcol)) == NULL ) return; } else if ((RC_Type(rowcol) == XmMENU_POPUP) || RC_TornOff(rowcol)) ms = (XmMenuShellWidget) XtParent(rowcol); _XmMenuFocus( (Widget) ms, XmMENU_END, _time); if (XmIsMenuShell(ms)) { (* (((XmMenuShellClassRec *)(ms-> core.widget_class))->menu_shell_class.popdownEveryone)) ((Widget) ms, event, params, num_params); } else { (* (((XmMenuShellClassRec *)(RC_ParentShell(rowcol)-> core.widget_class))->menu_shell_class.popdownEveryone)) ((Widget) ms, event, params, num_params); } /* if its a menubar, clean it up and disarm it */ if (RC_Type(rowcol) == XmMENU_BAR) { menuSTrait -> menuBarCleanup((Widget) rowcol); } else if ((RC_Type(rowcol) == XmMENU_POPUP) && RC_TornOff(rowcol)) _XmRestoreTearOffToToplevelShell((Widget)rowcol, event); menuSTrait -> disarm((Widget) rowcol); /* Cleanup grabs */ XtUngrabPointer((Widget) ms, _time); } /*ARGSUSED*/ static void ClearTraversalInternal( XmMenuShellWidget menushell, XEvent *event) /* unused */ { Widget activeChild; XmRowColumnWidget rowcol; rowcol = (XmRowColumnWidget)menushell->composite.children[0]; /* Clean up traversal */ activeChild = rowcol->manager.active_child; if (activeChild) { if (XmIsGadget(activeChild)) { (*((XmLabelGadgetClass)XtClass(activeChild))-> gadget_class.border_unhighlight) (activeChild); } else { (*((XmLabelWidgetClass)XtClass(activeChild))-> primitive_class.border_unhighlight) (activeChild); } } /* * (Internal state update) Clear focus from unposting submenu. */ _XmClearFocusPath((Widget) rowcol); if ((RC_Type(rowcol) != XmMENU_POPUP) && RC_CascadeBtn(rowcol)) { /* We can't discern whether this is in traversal mode (or in traversal mode going into drag mode) so don't do the unhighlighting here. Push it up a level to PushB and ToggleB and ??? */ /* This unhighlight is a dragmode only requirement. */ if (_XmGetInDragMode((Widget)rowcol)) XmCascadeButtonHighlight (RC_CascadeBtn(rowcol), FALSE); RC_PopupPosted (XtParent(RC_CascadeBtn(rowcol))) = FALSE; } } /* * XmRCallProc routine for checking MenuShell render table resources * before setting them to NULL if no value is specified * for both XmNrenderTable and XmNfontList. * If save == msw and offset matches a previously set offset, then the * function has been called twice on same widget and resource offset, thus * resource needs to be set NULL, otherwise leave it alone. */ /* ARGSUSED */ static void CheckSetRenderTables(Widget wid, int offset, XrmValue *value ) { XmMenuShellWidget msw = (XmMenuShellWidget)wid; if (check_set_save == msw) { if ((offset == check_set_offset1) || (offset == check_set_offset2)) { value->addr = NULL; } else if (check_set_offset2 == 0) { check_set_offset2 = offset; value->addr = ((char *)msw + offset); } } else { check_set_offset1 = offset; value->addr = ((char *)msw + offset); check_set_offset2 = 0; } check_set_save = msw; } /**************************************************************** * * Trait method for specify render table * **************************************************************/ static XmFontList GetTable( Widget wid, XtEnum type) { XmMenuShellWidget menu = (XmMenuShellWidget) wid ; switch(type) { case XmLABEL_RENDER_TABLE : return menu->menu_shell.label_font_list ; case XmBUTTON_RENDER_TABLE : return menu->menu_shell.button_font_list ; case XmTEXT_RENDER_TABLE : return menu->menu_shell.default_font_list ; } return NULL ; } /* * Clear traversal in the associated menu hierarchy */ /*ARGSUSED*/ void _XmClearTraversal( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmMenuShellWidget ms = (XmMenuShellWidget) wid ; XmRowColumnWidget rowcol; XmMenuState mst = _XmGetMenuState((Widget)wid); if (!_XmIsEventUnique(event)) return; /* if a valid event */ if ((ms->composite.num_children != 0) && (rowcol = (XmRowColumnWidget)ms->composite.children[0]) && (_XmMatchBtnEvent( event, RC_PostEventType(rowcol), RC_PostButton(rowcol), RC_PostModifiers(rowcol)) || (_XmMatchBSelectEvent((Widget)rowcol, event )))) { XButtonPressedEvent *xbutton = (XButtonPressedEvent *) event; /* * if this is the Popup's posting event, ignore it. It is just * being sent to the spring loaded widget by Xt's dispatch * after the post. This may not have been recorded. * * This is also reached through an Mwm edge case. Be sure to * thaw the queue or pointer deadlock occurs. */ if ((RC_Type(rowcol) == XmMENU_POPUP) && (mst->MS_LastManagedMenuTime == xbutton->time)) { XAllowEvents(XtDisplay(ms), SyncPointer, _XmGetDefaultTime(wid, event)); return; } _XmHandleMenuButtonPress (ms->composite.children[0], event); } else XAllowEvents(XtDisplay(ms), SyncPointer, CurrentTime); } /* * Public Routine */ Widget XmCreateMenuShell( Widget parent, char *name, ArgList al, Cardinal ac ) { return (XtCreatePopupShell (name, xmMenuShellWidgetClass, parent, al, ac)); } static void Destroy( Widget wid ) { XmMenuShellWidget ms = (XmMenuShellWidget) wid ; _XmDestroyFocusData(ms->menu_shell.focus_data); if (ms->menu_shell.default_font_list != NULL) XmFontListFree (ms->menu_shell.default_font_list); if (ms->menu_shell.button_font_list != NULL) XmFontListFree (ms->menu_shell.button_font_list); if (ms->menu_shell.label_font_list != NULL) XmFontListFree (ms->menu_shell.label_font_list); /* Clear pointers for renderTable XmRCallProc */ check_set_save = NULL; check_set_offset1 = 0; check_set_offset2 = 0; } static Widget _XmFindPopup( Widget widget, String name) { register Cardinal i; register XrmQuark q; register Widget w; q = XrmStringToQuark(name); for (w=widget; w != NULL; w=w->core.parent) for (i=0; icore.num_popups; i++) if (w->core.popup_list[i]->core.xrm_name == q) return w->core.popup_list[i]; return NULL; } static void _XmMenuPopupAction( Widget widget, XEvent *event, String *params, Cardinal *num_params) { Boolean spring_loaded; register Widget popup_shell; if (*num_params != 1) { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidParameters", "xtMenuPopupAction", tk_error, MESSAGE4, (String *)NULL, (Cardinal *)NULL); return; } if (event->type == ButtonPress) spring_loaded = True; else if (event->type == KeyPress || event->type == EnterNotify) spring_loaded = False; else { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidPopup","unsupportedOperation",tk_error, MESSAGE5, (String *)NULL, (Cardinal *)NULL); spring_loaded = False; } popup_shell = _XmFindPopup(widget, params[0]); if (popup_shell == NULL) { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidPopup","xtMenuPopup",tk_error, MESSAGE6, params, num_params); return; } if (spring_loaded) _XmPopupI(popup_shell, XtGrabExclusive, TRUE); else _XmPopupI(popup_shell, XtGrabNonexclusive, FALSE); } /*ARGSUSED*/ static void _XmMenuPopdownAction( Widget widget, XEvent *event, /* unused */ String *params, Cardinal *num_params) { Widget popup_shell; if (*num_params == 0) { _XmPopdown(widget); } else if (*num_params == 1) { popup_shell = _XmFindPopup(widget, params[0]); if (popup_shell == NULL) { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidPopup","xtMenuPopdown",tk_error, MESSAGE7, params, num_params); return; } _XmPopdown(popup_shell); } else { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidParameters","xtMenuPopdown", tk_error, MESSAGE8, (String *)NULL, (Cardinal *)NULL); } } motif-2.3.8/lib/Xm/ResConvert.c0000644000175000017500000023006213145162623013161 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: ResConvert.c /main/29 1999/05/18 19:19:39 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #define X_INCLUDE_STRING_H #define XOS_USE_XT_LOCKING #ifndef NEED_XOS_R_H #include #else #include #endif #include #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include #include "MessagesI.h" #include "RepTypeI.h" #include "ResConverI.h" #include "ResIndI.h" #include "XmI.h" #include "XmRenderTI.h" #define MSG2 _XmMMsgResConvert_0001 #define MSG3 _XmMMsgResConvert_0002 #define MSG4 _XmMMsgResConvert_0003 #define MSG6 _XmMMsgResConvert_0005 #define MSG7 _XmMMsgResConvert_0006 #define MSG12 _XmMMsgResConvert_0011 /******** Static Function Declarations ********/ static Boolean StringToEntity( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToWidget( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToWindow( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToChar( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToKeySym( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static void CvtStringToXmStringDestroy( XtAppContext app, XrmValue *to, XtPointer converter_data, XrmValue *args, Cardinal *num_args) ; static Boolean CvtStringToXmString( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static void CvtStringToXmFontListDestroy( XtAppContext app, XrmValue *to, XtPointer converter_data, XrmValue *args, Cardinal *num_args) ; static Boolean CvtStringToXmFontList( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToButtonFontList( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToLabelFontList( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToTextFontList( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean GetNextFontListEntry( char **s, char **fontNameRes, char **fontTagRes, XmFontType *fontTypeRes, char *delim) ; static Boolean GetFontName( char **s, char **name, char *delim) ; static Boolean GetFontTag( char **s, char **tag, char *delim) ; static Boolean GetNextXmString( char **s, char **cs) ; static Boolean CvtStringToXmStringTable( Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *data) ; static void XmStringCvtDestroy( XtAppContext app, XrmValue *to, XtPointer data, XrmValue *args, Cardinal *num_args) ; static Boolean CvtStringToStringTable( Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *data) ; static void StringCvtDestroy( XtAppContext app, XrmValue *to, XtPointer data, XrmValue *args, Cardinal *num_args) ; static Boolean CvtStringToCardinalList( Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *data) ; static void CardinalListCvtDestroy( XtAppContext app, XrmValue *to, XtPointer data, XrmValue *args, Cardinal *num_args) ; static Boolean CvtStringToHorizontalPosition( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToHorizontalDimension( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToVerticalPosition( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToVerticalDimension( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static void ConvertStringToButtonTypeDestroy( XtAppContext app, XrmValue *to, XtPointer converter_data, XrmValue *args, Cardinal *num_args) ; static Boolean ConvertStringToButtonType( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static void CvtStringToKeySymTableDestroy( XtAppContext app, XrmValue *to, XtPointer converter_data, XrmValue *args, Cardinal *num_args) ; static Boolean CvtStringToKeySymTable( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static void CvtStringToCharSetTableDestroy( XtAppContext app, XrmValue *to, XtPointer converter_data, XrmValue *args, Cardinal *num_args) ; static Boolean CvtStringToCharSetTable( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToBooleanDimension( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToAtomList( Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static void SimpleDestructor( XtAppContext app, XrmValue *to, XtPointer data, XrmValue *args, Cardinal *num_args) ; static Boolean OneOf( #if NeedWidePrototypes int c, #else char c, #endif /* NeedWidePrototypes */ char *set) ; static char * GetNextToken( char *src, char *delim, char **context) ; static Boolean CvtStringToCardinal( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToTextPosition( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean CvtStringToTopItemPosition( Display *display, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean isInteger( String string, int *value) ; static Boolean CvtStringToRenditionPixel(Display *disp, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data); static Boolean CvtPixelToRenditionPixel(Display *disp, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data); static Boolean CvtStringToSelectColor(Display *disp, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data); static void CvtStringToXmTabListDestroy(XtAppContext app, XrmValue *to, XtPointer converter_data, XrmValue *args, Cardinal *num_args); static Boolean GetNextTab(char **s, float *value, char *unitType, XmOffsetModel *offsetModel); static Boolean CvtStringToXmTabList(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data); static void CvtStringToXmRenderTableDestroy(XtAppContext app, XrmValue *to, XtPointer converter_data, XrmValue *args, Cardinal *num_args); static Boolean CvtStringToRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data); static Boolean CvtStringToButtonRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data); static Boolean CvtStringToLabelRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data); static Boolean CvtStringToTextRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data); static void _XmGetDisplayArg(Widget widget, Cardinal *size, XrmValue *value); /******** End Static Function Declarations ********/ static XtConvertArgRec selfConvertArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof(int) } }; static XtConvertArgRec displayConvertArg[] = { {XtProcedureArg, (XtPointer)_XmGetDisplayArg, 0}, }; /* Motif widget set version number. Accessable by applications via Xm.h. */ externaldef(xmuseversion) int xmUseVersion = XmVersion; /************************************************************************ * * _XmGetDisplayArg * * Function used to allow Fonts to be per display * ************************************************************************/ static void _XmGetDisplayArg(widget, size, value) Widget widget; Cardinal *size; XrmValue* value; { if (widget == NULL) XtErrorMsg("missingWidget", "_XmGetDisplayArg", "XtToolkitError", "_XmGetDisplayArg called without a widget to reference", (String*)NULL, (Cardinal*)NULL ); /* can't return any useful Display and caller will de-ref NULL, so aborting is the only useful option */ value->size = sizeof(Display*); value->addr = (XPointer)&DisplayOfScreen(XtScreenOfObject(widget)); } /************************************************************************ * * _XmRegisterConverters * Register all of the Xm resource type converters. Retain a * flag indicating whether the converters have already been * registered. * ************************************************************************/ void _XmRegisterConverters( void ) { static Boolean registered = False ; _XmProcessLock(); if( !registered ) { _XmRepTypeInstallConverters() ; XtSetTypeConverter( XmRString, XmRWidget, CvtStringToWidget, selfConvertArgs, XtNumber(selfConvertArgs), XtCacheNone, (XtDestructor) NULL) ; XtSetTypeConverter( XmRString, XmRWindow, CvtStringToWindow, selfConvertArgs, XtNumber(selfConvertArgs), XtCacheNone, (XtDestructor) NULL) ; XtSetTypeConverter( XmRString, XmRChar, CvtStringToChar, NULL, 0, XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRFontList, CvtStringToXmFontList, displayConvertArg, XtNumber(displayConvertArg), XtCacheByDisplay, CvtStringToXmFontListDestroy); XtSetTypeConverter( XmRString, XmRXmString, CvtStringToXmString, NULL, 0, (XtCacheNone | XtCacheRefCount), CvtStringToXmStringDestroy ) ; XtSetTypeConverter( XmRString, XmRKeySym, CvtStringToKeySym, NULL, 0, XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRHorizontalPosition, CvtStringToHorizontalPosition, selfConvertArgs, XtNumber( selfConvertArgs), XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRHorizontalDimension, CvtStringToHorizontalDimension, selfConvertArgs, XtNumber( selfConvertArgs), XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRVerticalPosition, CvtStringToVerticalPosition, selfConvertArgs, XtNumber( selfConvertArgs), XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRVerticalDimension, CvtStringToVerticalDimension, selfConvertArgs, XtNumber( selfConvertArgs), XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRBooleanDimension, CvtStringToBooleanDimension, selfConvertArgs, XtNumber( selfConvertArgs), XtCacheNone, NULL) ; XtSetTypeConverter( XmRCompoundText, XmRXmString, XmCvtTextToXmString, NULL, 0, XtCacheNone, NULL) ; XtSetTypeConverter( XmRXmString, XmRCompoundText, XmCvtXmStringToText, NULL, 0, XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRCharSetTable, CvtStringToCharSetTable, NULL, 0, XtCacheNone, CvtStringToCharSetTableDestroy) ; XtSetTypeConverter( XmRString, XmRKeySymTable, CvtStringToKeySymTable, NULL, 0, XtCacheNone, CvtStringToKeySymTableDestroy) ; XtSetTypeConverter( XmRString, XmRButtonType, ConvertStringToButtonType, NULL, 0, XtCacheNone, ConvertStringToButtonTypeDestroy) ; XtSetTypeConverter( XmRString, XmRXmStringTable, CvtStringToXmStringTable, NULL, 0, (XtCacheNone | XtCacheRefCount), XmStringCvtDestroy) ; XtSetTypeConverter (XmRString, XmRStringTable, CvtStringToStringTable, NULL, 0, (XtCacheNone | XtCacheRefCount), StringCvtDestroy) ; XtSetTypeConverter( XmRString, XmRCardinalList, CvtStringToCardinalList, NULL, 0, XtCacheNone, CardinalListCvtDestroy) ; XtSetTypeConverter( XmRString, XmRAtomList, CvtStringToAtomList, NULL, 0, (XtCacheNone | XtCacheRefCount), SimpleDestructor) ; XtSetTypeConverter( XmRString, XmRCardinal, CvtStringToCardinal, NULL, 0, XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRTextPosition, CvtStringToTextPosition, NULL, 0, XtCacheNone, NULL) ; XtSetTypeConverter( XmRString, XmRTopItemPosition, CvtStringToTopItemPosition, NULL, 0, XtCacheNone, NULL) ; XtSetTypeConverter(XmRString, XmRRenditionPixel, CvtStringToRenditionPixel, (XmConst XtConvertArgList)colorConvertArgs, 2, XtCacheByDisplay, NULL); /* also set a converter from Pixel to RenditionPixel so that the ColorObject setting as Pixel directly in the resource Database be taken for rendition background and foreground */ XtSetTypeConverter(XmRPixel, XmRRenditionPixel, CvtPixelToRenditionPixel, NULL, 0, XtCacheByDisplay, NULL); XtSetTypeConverter(XmRString, XmRSelectColor, CvtStringToSelectColor, (XmConst XtConvertArgList)colorConvertArgs, 2, XtCacheByDisplay, NULL); XtSetTypeConverter(XmRString, XmRTabList, CvtStringToXmTabList, NULL, 0, (XtCacheAll | XtCacheRefCount), CvtStringToXmTabListDestroy); XtSetTypeConverter(XmRString, XmRRenderTable, CvtStringToRenderTable, selfConvertArgs, XtNumber(selfConvertArgs), (XtCacheNone | XtCacheRefCount), CvtStringToXmRenderTableDestroy); XtSetTypeConverter(XmRString, XmRButtonRenderTable, CvtStringToButtonRenderTable, selfConvertArgs, XtNumber(selfConvertArgs), (XtCacheNone | XtCacheRefCount), CvtStringToXmRenderTableDestroy); XtSetTypeConverter(XmRString, XmRLabelRenderTable, CvtStringToLabelRenderTable, selfConvertArgs, XtNumber(selfConvertArgs), (XtCacheNone | XtCacheRefCount), CvtStringToXmRenderTableDestroy); XtSetTypeConverter(XmRString, XmRTextRenderTable, CvtStringToTextRenderTable, selfConvertArgs, XtNumber(selfConvertArgs), (XtCacheNone | XtCacheRefCount), CvtStringToXmRenderTableDestroy); XtSetTypeConverter(XmRString, XmRButtonFontList, CvtStringToButtonFontList, selfConvertArgs, XtNumber(selfConvertArgs), (XtCacheNone | XtCacheRefCount), CvtStringToXmFontListDestroy); XtSetTypeConverter(XmRString, XmRLabelFontList, CvtStringToLabelFontList, selfConvertArgs, XtNumber(selfConvertArgs), (XtCacheNone | XtCacheRefCount), CvtStringToXmFontListDestroy); XtSetTypeConverter(XmRString, XmRTextFontList, CvtStringToTextFontList, selfConvertArgs, XtNumber(selfConvertArgs), (XtCacheNone | XtCacheRefCount), CvtStringToXmFontListDestroy); registered = True; } _XmProcessUnlock(); return ; } /************************************************************************ * * XmeNamesAreEqual * Compare two strings and return true if equal. * The comparison is on lower cased strings. It is the callers * responsibility to ensure that test_str is already lower cased. * ************************************************************************/ Boolean XmeNamesAreEqual( register char *in_str, register char *test_str ) { register char i ; if( ((in_str[0] == 'X') || (in_str[0] == 'x')) && ((in_str[1] == 'M') || (in_str[1] == 'm')) ) { in_str +=2; } do { /* * Fix for 5330 - For OS compatibility with old operating systems, always * check a character with isupper before using tolower on it. */ if (isupper((unsigned char)*in_str)) i = (char) tolower((unsigned char) *in_str) ; else i = *in_str; in_str++; if( i != *test_str++ ) { return( False) ; } }while( i ) ; return( True) ; } /************************************************************************ * * StringToEntity * Allow widget or window to be specified by name * ************************************************************************/ /*ARGSUSED*/ static Boolean StringToEntity( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget child; Widget widget = *(Widget*) args[0].addr ; static Widget itsChild; Boolean success; if (*n_args != 1) XtAppWarningMsg ( XtDisplayToApplicationContext(disp), "wrongParameters", "cvtStringToWidget", "XtToolkitError", MSG12, (String*)NULL, (Cardinal*)NULL ); /* handle the XmSELF case */ if (XmeNamesAreEqual ((String) from->addr, "self")) child = widget ; else { child = XtNameToWidget(XtParent(widget), (String)from->addr); } success = !( child == NULL ); if ( success ) { if (to->addr == NULL) { itsChild = child; to->addr = (XPointer) &itsChild; } else if (to->size < sizeof(Widget)) success = FALSE; else *(Widget*) to->addr = child; to->size = sizeof(Widget); } else XtDisplayStringConversionWarning(disp, from->addr, "Widget"); return ( success ); } /************************************************************************ * * CvtStringToWidget * Allow widget to be specified by name * ************************************************************************/ static Boolean CvtStringToWidget( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) { return (StringToEntity( disp, args, n_args, from, to, converter_data ) ); } /************************************************************************ * * CvtStringToWindow * Allow widget(Window) to be specified by name * ************************************************************************/ static Boolean CvtStringToWindow( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) { return (StringToEntity( disp, args, n_args, from, to, converter_data ) ); } /************************************************************************ * * CvtStringToChar * Convert string to a single character (a mnemonic) * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToChar( Display *disp, /* unused */ XrmValue *args, /* unused */ Cardinal *n_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { unsigned char in_char = *((unsigned char *) (from->addr)) ; _XM_CONVERTER_DONE( to, unsigned char, in_char, ; ) } /************************************************************************ * * CvtStringToKeySym * Convert a string to a KeySym * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToKeySym( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { KeySym tmpKS = XStringToKeysym( (char *) (from->addr)) ; if( tmpKS != NoSymbol ) { _XM_CONVERTER_DONE( to, KeySym, tmpKS, ; ) } XtDisplayStringConversionWarning(display, (char *) from->addr, XmRKeySym) ; return( FALSE) ; } /*ARGSUSED*/ static void CvtStringToXmStringDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer converter_data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XmStringFree( *((XmString *) to->addr)) ; return ; } /************************************************************************ * * CvtStringToXmString * Convert an ASCII string to a XmString. * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToXmString( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { XmString tmpStr ; if( from->addr ) { tmpStr = XmStringGenerate((char *)from->addr, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); if( tmpStr ) { _XM_CONVERTER_DONE( to, XmString, tmpStr, XmStringFree( tmpStr) ; ) } } XtDisplayStringConversionWarning(display, ((char *) from->addr), XmRXmString) ; return( FALSE) ; } /*ARGSUSED*/ static void CvtStringToXmFontListDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer converter_data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XmFontListFree( *((XmFontList *) to->addr)) ; return ; } /************************************************************************ * * CvtStringToXmFontList * Convert a string to a fontlist. This is in the form : * * ::= { ',' } * * ::= | * * ::= { ';' } ':' [ ] * * ::= [ '=' ] * * ::= * * ::= * * * Additional syntax is allowed for compatibility with Xm1.1: * * 1. The fontlistentries may be separated by whitespace, rather than ','. * 2. Empty fontlistentries are ignored. * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToXmFontList( Display *dpy, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Boolean got_it = FALSE; char *s; char *newString; char *sPtr; char *fontName; char *fontTag; XmFontType fontType; char delim; XmFontListEntry fontListEntry; XmFontList fontList = NULL; if (from->addr) { /* Copy the input string. */ s = (char *) from->addr; sPtr = newString = XtNewString(s); /* Get the first fontlist entries. */ if (!GetNextFontListEntry(&sPtr, &fontName, &fontTag, &fontType, &delim)) { XtFree(newString); s = (char *) XmDEFAULT_FONT; sPtr = newString = XtNewString(s); if (!GetNextFontListEntry(&sPtr, &fontName, &fontTag, &fontType, &delim)) { XtFree(newString); XmeWarning(NULL, MSG2); exit(1); } } /* Parse additional font list entries. */ do { if (*fontName) { fontListEntry = XmFontListEntryLoad(dpy, fontName, fontType, fontTag); if (fontListEntry != NULL) { got_it = TRUE; fontList = XmFontListAppendEntry(fontList, fontListEntry); XmFontListEntryFree(&fontListEntry); } else XtDisplayStringConversionWarning(dpy, fontName, XmRFontList); } } while ((delim == ',') && *++sPtr && GetNextFontListEntry(&sPtr, &fontName, &fontTag, &fontType, &delim)); XtFree(newString); } if (got_it) { _XM_CONVERTER_DONE(to, XmFontList, fontList, XmFontListFree(fontList);) } XtDisplayStringConversionWarning(dpy, (char *) from->addr, XmRFontList); return FALSE; } /*ARGSUSED*/ static Boolean CvtStringToButtonFontList(Display *dpy, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { return(CvtStringToXmFontList(dpy, args, num_args, from, to, converter_data)); } /*ARGSUSED*/ static Boolean CvtStringToLabelFontList(Display *dpy, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { return(CvtStringToXmFontList(dpy, args, num_args, from, to, converter_data)); } /*ARGSUSED*/ static Boolean CvtStringToTextFontList(Display *dpy, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { return(CvtStringToXmFontList(dpy, args, num_args, from, to, converter_data)); } /************************************************************************ * * GetNextFontListEntry * ************************************************************************/ static Boolean GetNextFontListEntry ( char **s , char **fontNameRes , char **fontTagRes , XmFontType *fontTypeRes , char *delim ) { char *fontName; char *fontTag; char *fontPtr; String params[2]; Cardinal num_params; *fontTypeRes = XmFONT_IS_FONT; /* * Parse the fontname or baselist. */ if (!GetFontName(s, &fontName, delim)) { return (FALSE); } while (*delim == ';') { *fontTypeRes = XmFONT_IS_FONTSET; **s = ','; (*s)++; if (!GetFontName(s, &fontPtr, delim)) { return (FALSE); } } /* * Parse the fontsettag or fonttag. */ if (*delim == ':') { *fontTypeRes = XmFONT_IS_FONTSET; (*s)++; if (!GetFontTag(s, &fontTag, delim)) { fontTag = XmFONTLIST_DEFAULT_TAG; } } else { if (*fontTypeRes == XmFONT_IS_FONTSET) { /* CR4721 */ params[0] = fontName; num_params = 1; XtWarningMsg("conversionWarning", "string", "XtToolkitError", MSG3, params, &num_params); return (FALSE); } if (*delim == '=') { (*s)++; if (!GetFontTag(s, &fontTag, delim)) { return (FALSE); } } else if ((*delim == ',') || *delim == '\0') { fontTag = XmFONTLIST_DEFAULT_TAG; } else { /* CR4721 */ params[0] = fontTag; num_params = 1; XtWarningMsg("conversionWarning", "string", "XtToolkitError", MSG4, params, &num_params); return (FALSE); } } *fontNameRes = fontName; *fontTagRes = fontTag; return (TRUE); } /************************************************************************ * * GetFontName * * * May return null string as fontname (Xm1.1 compatibility). ************************************************************************/ static Boolean GetFontName ( char **s, char **name, char *delim ) { String params[2]; Cardinal num_params; /* * Skip any leading whitespace. */ while (**s != '\0' && isspace((unsigned char)**s)) { (*s)++; } if (**s == '\0') { return (FALSE); } /* * Have nonspace. Find the end of the name. */ *name = *s; if (**s == '"') { (*name)++; (*s)++; while (**s != '\0' && (**s != '"')) { (*s)++; } if (**s == '\0') { /* CR4721 */ params[0] = --(*name); num_params = 1; XtWarningMsg("conversionWarning", "string", "XtToolkitError", MSG6, params, &num_params); return (FALSE); } **s = '\0'; (*s)++; *delim = **s; } else { while ((**s != '\0') && (**s != ',') && (**s != ':') && (**s != ';') && (**s != '=')) { (*s)++; } *delim = **s; **s = '\0'; } return (TRUE); } /************************************************************************ * * GetFontTag * ************************************************************************/ static Boolean GetFontTag ( char **s, char **tag, char *delim ) { String params[2]; Cardinal num_params; Boolean needs_tag = (*delim == '='); /* * Skip any leading whitespace. */ while (**s != '\0' && isspace((unsigned char)**s)) { (*s)++; } if (**s == '\0') { return (FALSE); } /* * Have nonspace. Find the end of the tag. */ *tag = *s; if (**s == '"') { (*tag)++; (*s)++; while (**s != '\0' && (**s != '"')) { (*s)++; } if (**s == '\0') { /* CR4721 */ params[0] = --(*tag); num_params = 1; XtWarningMsg("conversionWarning", "string", "XtToolkitError", MSG6, params, &num_params); return (FALSE); } **s = '\0'; (*s)++; *delim = **s; } else { while (!isspace((unsigned char)**s) && (**s != ',') && (**s != '\0')) { (*s)++; } /* Xm1.1 compatibility */ *delim = isspace ((unsigned char)**s) ? ',' : **s; **s = '\0'; } /* Null tags are not accepted. */ if (*s == *tag) { if (needs_tag) { /* CR4721 */ params[0] = XmRFontList; num_params = 1; XtWarningMsg("conversionWarning", "string", "XtToolkitError", MSG7, params, &num_params); } return (FALSE); } return (TRUE); } /************************************************************************ * * * GetNextXmString - return a pointer to a null-terminated string. * * The pointer is passed in cs. Up to the caller to * * free that puppy. Returns FALSE if end of string. * * * ************************************************************************/ static Boolean GetNextXmString( char **s, char **cs ) { char *tmp; int csize; if (**s == '\0') return(FALSE); /* Skip any leading whitespace. */ while(isspace((unsigned char)**s) && **s != '\0') (*s)++; if (**s == '\0') return(FALSE); /* Found something. Allocate some space (ugh!) and start copying */ /* the next string */ *cs = XtMalloc(strlen(*s) + 1); tmp = *cs; while((**s) != '\0') { if ((**s) == '\\' && *((*s)+1) == ',') /* Quoted comma */ { (*s)+=2; *tmp = ','; tmp++; } else { if((**s) == ',') /* End of a string */ { *tmp = '\0'; (*s)++; return(TRUE); } else { if (MB_CUR_MAX > 1) { #ifndef NO_MULTIBYTE if ((csize = mblen(*s, MB_CUR_MAX)) < 0) break; #else csize = **s ? 1 : 0; #endif strncpy(tmp, *s, csize); tmp += csize; (*s) += csize; } else { *tmp = **s; tmp++; (*s)++; } } } } *tmp = '\0'; return(TRUE); } /************************************************************************ * * CvtStringToXmStringTable * * Convert a string table to an array of XmStrings.This is in the form : * * String [, String2]* * * The comma delimeter can be quoted by a \ * ************************************************************************/ /* ARGSUSED */ static Boolean CvtStringToXmStringTable( Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *data ) { char *s, *cs; XmString *table; static XmString *tblptr; int str_no, table_size; if (from_val->addr == NULL) return FALSE; s = (char *) from_val->addr; table_size = 100; table = (XmString *) XtMalloc(sizeof(XmString) * table_size); for (str_no = 0; GetNextXmString(&s, &cs); str_no++) { if (str_no >= table_size) { table_size *= 2; table = (XmString *)XtRealloc((char *)table, sizeof(XmString) * table_size); } table[str_no] = XmStringGenerate(cs, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); XtFree(cs); } /* NULL terminate the array... */ table_size = str_no + 1; table = (XmString *)XtRealloc((char *) table, sizeof(XmString) * table_size); table[str_no] = (XmString) NULL; if (to_val->addr != NULL) { if (to_val->size < sizeof(XtPointer)) { to_val->size = sizeof(XtPointer); return False; } *(XmString **)(to_val->addr) = table; } else { tblptr = table; to_val->addr = (XPointer)&tblptr; } to_val->size = sizeof(XtPointer); return TRUE; } /**************** * * XmStringCvtDestroy - free up the space allocated by the converter * ****************/ /*ARGSUSED*/ static void XmStringCvtDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args ) /* unused */ { int i; XmString *table = *(XmString **)(to->addr); for (i = 0; table[i] != NULL; i++) XmStringFree(table[i]); XtFree((char*)table); } /*ARGSUSED*/ static Boolean CvtStringToStringTable( Display *dpy, /* unused */ XrmValuePtr args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from_val, XrmValue *to_val, XtPointer *data) /* unused */ { register char *p ; char *top ; String *table ; static String *tblptr ; int size = 50 ; int i, len ; int csize; if( (p = from_val->addr) == NULL ) { return( False) ; } table = (String *) XtMalloc( sizeof( String) * size) ; for( i = 0 ; *p ; i++ ) { while( isspace((unsigned char) *p) && *p != '\0' ) { p++ ; } if( *p == '\0' ) { if( i == size ) { size++ ; table = (String *)XtRealloc( (char *) table, sizeof( String) * size) ; } table[i] = XtMalloc( sizeof( char)) ; *(table[i]) = '\0' ; break ; } for( top = p ; *p != ',' && *p != '\0' ; p+=csize ) { if( *p == '\\' && *(p + 1) == ',' ) { p++ ; } #ifndef NO_MULTIBYTE if((csize = mblen(p, MB_CUR_MAX)) < 0) break; #else csize = *p ? 1 : 0; #endif } if( i == size ) { size *= 2 ; table = (String *)XtRealloc( (char *) table, sizeof( String) * size) ; } len = p - top ; table[i] = XtMalloc( len + 1) ; strncpy( table[i], top, len) ; (table[i])[len] = '\0' ; if (*p != '\0') p++ ; } table = (String *)XtRealloc( (char *) table, sizeof( String) * (i + 1)) ; table[i] = NULL ; if( to_val->addr != NULL ) { if( to_val->size < sizeof( XPointer) ) { to_val->size = sizeof( XPointer) ; return( False) ; } *(String **)(to_val->addr) = table ; } else { tblptr = table ; to_val->addr = (XPointer)&tblptr ; } to_val->size = sizeof( XPointer) ; return( True) ; } /*ARGSUSED*/ static void StringCvtDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { int i ; String *table = * (String **) (to->addr) ; for( i = 0 ; table[i] != NULL ; i++ ) { XtFree( (char *) table[i]) ; } XtFree( (char *) table) ; return ; } /*ARGSUSED*/ static Boolean CvtStringToCardinalList( Display *dpy, /* unused */ XrmValuePtr args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from_val, XrmValue *to_val, XtPointer *data) /* unused */ { register char * p; Cardinal * crd_array; int crd_array_size = 50; int crd_array_count = 0; int new_element; if ((p = from_val->addr) == NULL) return(False); crd_array = (Cardinal *)XtCalloc (crd_array_size,sizeof(Cardinal)); while (*p != '\0') { while ((isspace(*p) || ispunct(*p)) && *p != '\0') /* Skip blanks */ p++; if (*p == '\0') /* end-of data */ break; if (isdigit(*p)) { new_element = atoi(p); /* Grab number */ while (isdigit(*p)) /* advance pointer past number */ p++; if (crd_array_size == crd_array_count) { crd_array_size *= 2; /* Double array size */ crd_array = (Cardinal *)XtRealloc((char *)crd_array, sizeof(Cardinal) * crd_array_size); } crd_array[crd_array_count] = new_element; crd_array_count++; } else p++; } _XM_CONVERTER_DONE(to_val,Cardinal *,crd_array,;) } /*ARGSUSED*/ static void CardinalListCvtDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XtFree((XPointer)to->addr); } /*ARGSUSED*/ static Boolean CvtStringToHorizontalPosition( Display *display, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget widget = *(Widget*) args[0].addr ; Screen * screen = XtScreen(widget) ; unsigned char defaultFromType = _XmGetUnitType(widget) ; Position tmpPix; Boolean parseError; tmpPix = (Position) _XmConvertStringToUnits (screen, from->addr, (int) defaultFromType, XmHORIZONTAL, XmPIXELS, (XtEnum*) &parseError); if (parseError) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRHorizontalPosition); return False; } else _XM_CONVERTER_DONE( to, Position, tmpPix, ; ) } /*ARGSUSED*/ static Boolean CvtStringToHorizontalDimension( Display *display, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget widget = *(Widget*) args[0].addr ; Screen * screen = XtScreen(widget) ; unsigned char defaultFromType = _XmGetUnitType(widget) ; Dimension tmpPix; Boolean parseError; tmpPix = (Dimension) _XmConvertStringToUnits (screen, from->addr, (int) defaultFromType, XmHORIZONTAL, XmPIXELS, (XtEnum*) &parseError); if (parseError) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRHorizontalDimension); return False; } else _XM_CONVERTER_DONE( to, Dimension, tmpPix, ; ) } /*ARGSUSED*/ static Boolean CvtStringToVerticalPosition( Display *display, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget widget = *(Widget*) args[0].addr ; Screen * screen = XtScreen(widget) ; unsigned char defaultFromType = _XmGetUnitType(widget) ; Position tmpPix; Boolean parseError; tmpPix = (Position) _XmConvertStringToUnits(screen, from->addr, (int) defaultFromType, XmVERTICAL, XmPIXELS, (XtEnum*) &parseError); if (parseError) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRVerticalPosition); return False; } else _XM_CONVERTER_DONE( to, Position, tmpPix, ; ) } /*ARGSUSED*/ static Boolean CvtStringToVerticalDimension( Display *display, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget widget = *(Widget*) args[0].addr ; Screen * screen = XtScreen(widget) ; unsigned char defaultFromType = _XmGetUnitType(widget) ; Dimension tmpPix; Boolean parseError; tmpPix = (Dimension) _XmConvertStringToUnits(screen, from->addr, (int) defaultFromType, XmVERTICAL, XmPIXELS, (XtEnum*) &parseError); if (parseError) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRVerticalDimension); return False; } else _XM_CONVERTER_DONE( to, Dimension, tmpPix, ; ) } /************************************************************************ * * XmeGetDefaultRenderTable * This function is called by a widget to initialize it's rendertable * resource with a default, when it is NULL. This is done by checking to * see if any of the widgets, in the widget's parent hierarchy has the * specifyRenderTable trait. * *************************************************************************/ typedef struct _system_font_list { Display *display; XmFontList fontlist; } SystemFontList; static XmFontList DefaultSystemFontList(Display *display, XmFontList fontlist) { static SystemFontList *sFontLists = NULL; static int nsFontLists = 0; static int maxnsFontLists = 0; if (fontlist) { if (nsFontLists >= maxnsFontLists) { Cardinal nbytes; maxnsFontLists += 8; nbytes = (Cardinal) sizeof(SystemFontList)*maxnsFontLists; if (NULL == sFontLists) { sFontLists = (SystemFontList*) XtMalloc(nbytes); memset((void*) sFontLists, 0, nbytes); } else { sFontLists = (SystemFontList*) XtRealloc((char*) sFontLists, nbytes); memset((void*) &sFontLists[nsFontLists], 0, nbytes); } sFontLists[nsFontLists].display = display; sFontLists[nsFontLists].fontlist = fontlist; nsFontLists++; } } else { int i; if (NULL == sFontLists) return NULL; for (i=0; igetRenderTable(w, fontListType) ; break ; } } _XmAppUnlock(app); } if (fontlist) { return (fontlist); } #if 0 else if (sFontList) { printf("Reusing sFontList\n"); return(sFontList); } #endif _XmProcessLock(); fontlist = DefaultSystemFontList(XtDisplay(origw), (XmFontList) NULL); if (!fontlist) { /* Begin fixing OSF 4735 */ s = (char *) XmDEFAULT_FONT; sPtr = newString = XtNewString (s); if (!GetNextFontListEntry (&sPtr, &fontName, &fontTag, &fontType, &delim)) { _XmProcessUnlock(); XtFree (newString); XmeWarning(NULL, MSG2); exit( 1) ; } do { if (*fontName) { fontListEntry = XmFontListEntryLoad (XtDisplay(origw), fontName, fontType, fontTag); if (fontListEntry != NULL) { fontlist = XmFontListAppendEntry (fontlist, fontListEntry); XmFontListEntryFree (&fontListEntry); } else XtDisplayStringConversionWarning(XtDisplay(origw), fontName, XmRFontList); } } while ((delim == ',') && *++sPtr && !fontlist && GetNextFontListEntry (&sPtr, &fontName, &fontTag, &fontType, &delim)); XtFree (newString); DefaultSystemFontList(XtDisplay(origw), fontlist); /* End fixing OSF 4735 */ } _XmProcessUnlock(); return (fontlist); } /*ARGSUSED*/ static void ConvertStringToButtonTypeDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer converter_data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XtFree( *((char **) to->addr)) ; return ; } /*ARGSUSED*/ static Boolean ConvertStringToButtonType( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { String in_str = (String) from->addr ; unsigned int in_str_size = 0 ; XmButtonTypeTable buttonTable ; int i, comma_count ; String work_str, btype_str ; _Xstrtokparams strtok_buf; comma_count = 0 ; while( in_str[in_str_size] ) { if( in_str[in_str_size++] == ',' ) { ++comma_count ; } } ++in_str_size ; buttonTable = (XmButtonTypeTable) XtMalloc( sizeof( XmButtonType) * (comma_count + 2)) ; buttonTable[comma_count+1] = (XmButtonType)0; work_str = (String) XtMalloc( in_str_size) ; strcpy( work_str, in_str) ; for( i = 0, btype_str = _XStrtok(work_str, ",", strtok_buf) ; btype_str ; btype_str = _XStrtok(NULL, ",", strtok_buf), ++i) { while (*btype_str && isspace((unsigned char)*btype_str)) btype_str++; if (*btype_str == '\0') break; if (XmeNamesAreEqual(btype_str, "pushbutton")) buttonTable[i] = XmPUSHBUTTON; else if (XmeNamesAreEqual(btype_str, "togglebutton")) buttonTable[i] = XmTOGGLEBUTTON; else if (XmeNamesAreEqual(btype_str, "cascadebutton")) buttonTable[i] = XmCASCADEBUTTON; else if (XmeNamesAreEqual(btype_str, "separator")) buttonTable[i] = XmSEPARATOR; else if (XmeNamesAreEqual(btype_str, "double_separator")) buttonTable[i] = XmDOUBLE_SEPARATOR; else if (XmeNamesAreEqual(btype_str, "title")) buttonTable[i] = XmTITLE; else { XtDisplayStringConversionWarning(display, (char *) btype_str, XmRButtonType) ; XtFree( (char *) buttonTable) ; XtFree( (char *) work_str) ; return( FALSE) ; } } XtFree( work_str) ; _XM_CONVERTER_DONE( to, XmButtonTypeTable, buttonTable, XtFree( (char *) buttonTable) ; ) } /*ARGSUSED*/ static void CvtStringToKeySymTableDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer converter_data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XtFree( *((char **) to->addr)) ; return ; } /*ARGSUSED*/ static Boolean CvtStringToKeySymTable( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { String in_str = (String) from->addr; unsigned int in_str_size = 0; XmKeySymTable keySymTable; int i, comma_count; String work_str, ks_str; KeySym ks; _Xstrtokparams strtok_buf; comma_count = 0; while (in_str[in_str_size]) { if (in_str[in_str_size++] == ',') ++comma_count; } ++in_str_size; keySymTable = (XmKeySymTable) XtMalloc(sizeof(KeySym) * (comma_count + 2)); keySymTable[comma_count + 1] = (KeySym)NULL; work_str = XtNewString(in_str); for (ks_str = _XStrtok(work_str, ",", strtok_buf), i = 0; ks_str; ks_str = _XStrtok(NULL, ",", strtok_buf), i++) { if (!*ks_str) keySymTable[i] = NoSymbol; else { if ((ks = XStringToKeysym(ks_str)) == NoSymbol) { XtDisplayStringConversionWarning(display, ks_str, XmRKeySym); XtFree((char *) work_str); XtFree((char *) keySymTable); return FALSE; } keySymTable[i] = ks; } } XtFree((char *) work_str); _XM_CONVERTER_DONE(to, XmKeySymTable, keySymTable, XtFree((char*)keySymTable);) } /*ARGSUSED*/ static void CvtStringToCharSetTableDestroy( XtAppContext app, /* unused */ XrmValue *to, XtPointer converter_data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XtFree( *((char **) to->addr)) ; return ; } /*ARGSUSED*/ static Boolean CvtStringToCharSetTable( Display *display, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { String in_str = (String) from->addr; XmStringCharSetTable charsetTable; unsigned int numCharsets = 0; unsigned int strDataSize = 0; char * dataPtr; int i; String work_str, cs_str; _Xstrtokparams strtok_buf; work_str = XtNewString(in_str); for (cs_str = _XStrtok(work_str, ",", strtok_buf); cs_str; cs_str = _XStrtok(NULL, ",", strtok_buf)) { if (*cs_str) strDataSize += strlen(cs_str) + 1; ++numCharsets; } charsetTable = (XmStringCharSetTable) XtMalloc(strDataSize + sizeof(XmStringCharSet) * (numCharsets+1)); charsetTable[numCharsets] = (XmStringCharSet)NULL; dataPtr = (char *) &charsetTable[numCharsets+1]; strcpy(work_str, in_str); for (i = 0, cs_str = _XStrtok(work_str, ",", strtok_buf); cs_str; cs_str = _XStrtok(NULL, ",", strtok_buf), ++i) { if (*cs_str) { charsetTable[i] = dataPtr; strcpy(dataPtr, cs_str); dataPtr += strlen(cs_str) + 1; } else { charsetTable[i] = NULL; } } XtFree((char *) work_str); _XM_CONVERTER_DONE(to, XmStringCharSetTable, charsetTable, XtFree((char *) charsetTable);) } /************************************************************************ * * CvtStringToBooleanDimension * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToBooleanDimension( Display *display, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { char *in_str = (char *) from->addr ; Dimension outVal ; int intermediate; if (isInteger(from->addr, &intermediate)) { /* Is numeric argument, so convert to horizontal dimension. This is * to preserve 1.0 compatibility (the resource actually behaves like * a boolean in version 1.1). */ Widget widget = *(Widget*) args[0].addr ; Screen * screen = XtScreen(widget) ; unsigned char unitType = _XmGetUnitType(widget) ; if( intermediate < 0 ) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRBooleanDimension) ; return( FALSE) ; } outVal = (Dimension) _XmConvertUnits( screen, XmHORIZONTAL, (int) unitType, intermediate, XmPIXELS) ; } else { /* Presume Boolean (version 1.1). */ if( XmeNamesAreEqual( in_str, XtEtrue) ) { outVal = (Dimension) 1 ; } else { if( XmeNamesAreEqual( in_str, XtEfalse) ) { outVal = (Dimension) 0 ; } else { XtDisplayStringConversionWarning(display, in_str, XmRBooleanDimension) ; return( FALSE) ; } } } _XM_CONVERTER_DONE( to, Dimension, outVal, ; ) } /************************************************************************ * * XmCvtStringToAtomList * Convert a string to an array of atoms. Atoms within the string * are delimited by commas. If the comma is preceded by a backslash, * it is considered to be part of the atom. * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToAtomList( Display *dpy, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data ) /* unused */ { char *atom_name; char *stack_names[128]; char **name_list = stack_names; int max_atoms = XtNumber(stack_names); int atom_count; Atom *atom_list; char *context_string; if (from->addr == NULL) return(False); atom_count = 0; for (atom_name = GetNextToken((char*) from->addr, ",", &context_string); atom_name != NULL; atom_name = GetNextToken(NULL, ",", &context_string)) { if (atom_count == max_atoms) { max_atoms *= 2; if (name_list == stack_names) { char **new_names = (char **) XtMalloc(sizeof(char *) * max_atoms); memcpy((char *)new_names, (char *)name_list, (sizeof(char *) * atom_count)); name_list = new_names; } else { name_list = (char **) XtRealloc((char *)name_list, sizeof(char *) * max_atoms); } } name_list[atom_count++] = atom_name; } atom_list = (Atom *) XtMalloc(sizeof(Atom) * atom_count); XInternAtoms(dpy, name_list, atom_count, False, atom_list); while(--atom_count >= 0) XtFree(name_list[atom_count]); { static Atom *buf; if(to->addr) { if(to->size < sizeof(Atom *)) { XtFree((char *) atom_list); to->size = sizeof(Atom *); return(False); } else *((Atom **) (to->addr)) = atom_list; } else { buf = atom_list; to->addr = (XPointer) &buf; } to->size = sizeof(Atom *); return(True); } } /*ARGSUSED*/ static void SimpleDestructor( XtAppContext app, /* unused */ XrmValue *to, XtPointer data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args ) /* unused */ { char *simple_struct = *(char **)(to->addr); XtFree(simple_struct); } /* * * GetNextToken * * This should really be in some sort of utility library. * This function is supposed to behave a bit like strtok in that it * saves a context which is used if src is NULL. We'd like to use * strok, but strok can't handle backslashes. * * A token is the contiguous substring of src which begins with either * a backslashed space character or a non-space character and * terminates with occurance of a non-backslashed delimiter character * or the character before the last non-backshashed space character. * * Caller is responsible to free the returned string. * * Example A: * The delimiter string is "," The src is * " \ token token\ , next token" * The token is * " token token " * * Example B: * * The delimiter string is * ".:" * The src is * " \: the \t token \. \ : next token " * The token returned is * ": the \t token . " * */ static Boolean OneOf( #if NeedWidePrototypes int c, #else char c, #endif /* NeedWidePrototypes */ char *set ) { char *p; for (p = set; *p != 0; p++) if (*p == c) return(True); return(False); } static char * GetNextToken( char *src, char *delim, char **context) { Boolean terminated = False; char *s, *e, *p; char *next_context; char *buf = NULL; int len; if (src != NULL) *context = src; if (*context == NULL) return(NULL); s = *context; /* find the end of the token */ for (e = s; (!terminated) && (*s != '\0'); e = s++) { if ((*s == '\\') && (*(s+1) != '\0')) s++; else if (OneOf(*s, delim)) terminated = True; } /* assert (OneOf(*e,delim) || (*e == '\0')) */ if (terminated) { next_context = (e + 1); e--; } else next_context = NULL; /* Strip out non-backslashed leading and trailing whitespace */ s = *context; while ((s != e) && isspace((unsigned char)*s)) s++; while ((e != s) && isspace((unsigned char)*e) && ((*e-1) != '\\')) e--; if (e == s) { /* * Only white-space between the delimiters, * if we're at the end of the string anyway, indicate * that we're done, otherwise return an empty string. */ if (terminated) { buf = (char *) XtMalloc(1); *buf = '\0'; return(buf); } else return(NULL); } /* * Copy into buffer. Swallow any backslashes which precede * delimiter characters or spaces. It would be great if we had * time to implement full C style backslash processing... */ len = (e - s) + 1; p = buf = XtMalloc(len + 1); while (s != e) { if ((*s == '\\') && (OneOf(*(s+1), delim) || isspace((unsigned char)*(s+1)))) s++; *(p++) = *(s++); } *(p++) = *(s++); *p = '\0'; *context = next_context; return(buf); } /*ARGSUSED*/ static Boolean CvtStringToCardinal( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Cardinal value; int intermediate; if (!isInteger(from->addr,&intermediate) || intermediate < 0) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRCardinal); return False; } value = (Cardinal) intermediate; _XM_CONVERTER_DONE( to, Cardinal, value, ; ) } /*ARGSUSED*/ static Boolean CvtStringToTextPosition( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { XmTextPosition value; int intermediate; if (!isInteger(from->addr,&intermediate) || intermediate < 0) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRTextPosition); return False; } value = (XmTextPosition) intermediate; _XM_CONVERTER_DONE( to, XmTextPosition, value, ; ) } /*ARGSUSED*/ static Boolean CvtStringToTopItemPosition( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { int value; int intermediate; if (!isInteger(from->addr,&intermediate) || intermediate < 0) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRTopItemPosition); return False; } value = intermediate - 1; _XM_CONVERTER_DONE( to, int, value, ; ) } static Boolean isInteger( String string, int *value) /* RETURN */ { Boolean foundDigit = False; Boolean isNegative = False; Boolean isPositive = False; int val = 0; char ch; /* skip leading whitespace */ while ((ch = *string) == ' ' || ch == '\t') string++; while ((ch = *string++) != '\0') { if (ch >= '0' && ch <= '9') { val *= 10; val += ch - '0'; foundDigit = True; continue; } if (ch == ' ' || ch == '\t') { if (!foundDigit) return False; /* make sure only trailing whitespace */ while ((ch = *string++) != '\0') { if (ch != ' ' && ch != '\t') return False; } break; } if (ch == '-' && !foundDigit && !isNegative && !isPositive) { isNegative = True; continue; } if (ch == '+' && !foundDigit && !isNegative && !isPositive) { isPositive = True; continue; } return False; } if (ch == '\0') { if (isNegative) *value = -val; else *value = val; return True; } return False; } /************************************************************************ * * CvtStringToRenditionPixel * Convert a string to Pixel, checking for the special value * "unspecified_pixel" which returns XmUNSPECIFIED_PIXEL * ************************************************************************/ static Boolean CvtStringToRenditionPixel(Display *disp, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data ) { String str = (String)from_val->addr; Boolean result = False; if (XmeNamesAreEqual(str, "unspecified_pixel")) { _XM_CONVERTER_DONE(to_val, Pixel, XmUNSPECIFIED_PIXEL, ;) } result = XtCallConverter(disp, XtCvtStringToPixel, args, *num_args, from_val, to_val, NULL); if (result == False) { *converter_data = False; return False; } else { *converter_data = (char *)True; return True; } } /************************************************************************ * * CvtPixelToRenditionPixel * Convert a Pixel to a RenditionPixel, which really means * doing nothing. * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtPixelToRenditionPixel(Display *disp, XrmValuePtr args, /* unused */ Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data ) /* unused */ { if (*num_args != 0) XtAppWarningMsg(XtDisplayToApplicationContext(disp), "wrongParameters","CvtPixelToRenditionPixel", "ToolkitError", "Pixel to RenditionPixel conversion needs no extra arguments", (String *) NULL, (Cardinal *)NULL); _XM_CONVERTER_DONE(to_val, Pixel, *(int*)from_val->addr, ;) } /************************************************************************ * * CvtStringToSelectColor * Convert a string to Pixel, checking for the special values * "default_select_color" which returns the XmDEFAULT_SELECT_COLOR, * "highlight_color" which returns the XmHIGHLIGHT_COLOR. * "reversed_ground_colors" which returns XmREVERSED_GROUND_COLORS. * ************************************************************************/ static Boolean CvtStringToSelectColor(Display *disp, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data ) { String str = (String)from_val->addr; Boolean result = False; /* in those 3 cases, just return the constant and the widget will have to do teh onversion itself. It's ok, since the widget has to handle the constant case anyway for direct use by a program at creation and setvalues time */ if (XmeNamesAreEqual(str, "default_select_color")) { _XM_CONVERTER_DONE(to_val, Pixel, XmDEFAULT_SELECT_COLOR, ;) } else if (XmeNamesAreEqual(str, "reversed_ground_colors")) { _XM_CONVERTER_DONE(to_val, Pixel, XmREVERSED_GROUND_COLORS, ;) } else if (XmeNamesAreEqual(str, "highlight_color")) { _XM_CONVERTER_DONE(to_val, Pixel, XmHIGHLIGHT_COLOR, ;) } /* else call the Xt converter, passing it the colorConvertArg */ result = XtCallConverter(disp, XtCvtStringToPixel, args, *num_args, from_val, to_val, NULL); if (result == False) { *converter_data = False; return False; } else { *converter_data = (char *)True; return True; } } /************************************************************************ * * GetNextTab * ************************************************************************/ static Boolean GetNextTab(char **s, float *value, char *unitType, XmOffsetModel *offsetModel) { int ret_val; char sign[2]; char *tmp; bzero(sign, sizeof(sign)); unitType[0] = '\0'; if (sscanf(*s, " %2[+]", sign) == 1) ret_val = sscanf(*s, " %2[+] %f %12[^ \t\r\n\v\f,] ", sign, value, unitType); else ret_val = sscanf(*s, " %f %12[^ \t\r\n\v\f,] ", value, unitType); if (ret_val == EOF) return(FALSE); if (sign[1] != '\0') { /* Error message */ return(FALSE); } switch (sign[0]) { case '\0': *offsetModel = XmABSOLUTE; break; case '+': *offsetModel = XmRELATIVE; break; } tmp = strpbrk(*s, ","); if (tmp == NULL) *s += strlen(*s); else *s = (tmp + 1); return(TRUE); } /*ARGSUSED*/ static void CvtStringToXmTabListDestroy(XtAppContext app, /* unused */ XrmValue *to, XtPointer converter_data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XmTabListFree(*((XmTabList *)to->addr)); return; } /************************************************************************ * * CvtStringToXmTabList * Convert a string to a tab list. This is in the form : * * ::= { ',' }* * * ::= * * ::= { } { {DIGIT}*.}DIGIT+ * * ::= + | - * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToXmTabList(Display *dpy, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Boolean got_one = FALSE; char *s; float value; char unitType[12]; /* longest unit name is "millimeters" */ XmOffsetModel offsetModel = XmABSOLUTE; int units; XmParseResult result; XmTab tab; XmTabList tl = NULL; if (from->addr) { s = (char *)from->addr; /* Parse the tabs */ while (GetNextTab(&s, &value, unitType, &offsetModel)) { got_one = TRUE; result = XmeParseUnits(unitType, &units); if (result == XmPARSE_ERROR) { got_one = FALSE; break; } else if (result == XmPARSE_NO_UNITS) { units = XmPIXELS; } tab = XmTabCreate(value, (unsigned char)units, offsetModel, XmALIGNMENT_BEGINNING, XmS); tl = XmTabListInsertTabs(tl, &tab, 1, -1); XmTabFree(tab); } } if (got_one) _XM_CONVERTER_DONE(to, XmTabList, tl, XmTabListFree(tl);) XtDisplayStringConversionWarning(dpy, (char *)from->addr, XmRTabList); return(FALSE); } /*ARGSUSED*/ static Boolean cvtStringToXmRenderTable(Display *dpy, Widget widget, String resname, String resclass, XrmValue *from, XrmValue *to) { char *s; XmRendition rend[1]; XmRenderTable rt; char *tag; Boolean has_default = FALSE, in_db = FALSE; _Xstrtokparams strtok_buf; if (from->addr) { s = XtNewString((char *)from->addr); rt = NULL; has_default = FALSE; /* Try for default rendition */ rend[0] = _XmRenditionCreate(NULL, widget, resname, resclass, NULL, NULL, 0, NULL); if (rend[0] != NULL) { rt = XmRenderTableAddRenditions(NULL, rend, 1, XmMERGE_REPLACE); has_default = TRUE; } /* Try to get first tag. */ if ((tag = _XStrtok(s, " \t\r\n\v\f,", strtok_buf)) != NULL) { XmRenditionFree(rend[0]); rend[0] = _XmRenditionCreate(NULL, widget, resname, resclass, tag, NULL, 0, &in_db); if (!has_default && !in_db) { /* Call the fontlist converter */ XmRenditionFree(rend[0]); XtFree(s); return CvtStringToXmFontList(dpy, NULL, 0, from, to, NULL); } rt = XmRenderTableAddRenditions(rt, rend, 1, XmMERGE_REPLACE); } else if (rend[0] == NULL) { /* warning */ XtFree(s); return FALSE; } else { /* only a default rendition */ XtFree(s); XmRenditionFree(rend[0]); _XM_CONVERTER_DONE(to, XmRenderTable, rt, XmRenderTableFree(rt);) } while ((tag = _XStrtok(NULL, " \t\r\n\v\f,", strtok_buf)) != NULL) { XmRenditionFree(rend[0]); rend[0] = _XmRenditionCreate(NULL, widget, resname, resclass, tag, NULL, 0, NULL); rt = XmRenderTableAddRenditions(rt, rend, 1, XmMERGE_REPLACE); } XtFree(s); XmRenditionFree(rend[0]); _XM_CONVERTER_DONE(to, XmRenderTable, rt, XmRenderTableFree(rt);) } return FALSE; } /*ARGSUSED*/ static Boolean CvtStringToRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget wid; wid = *(Widget *)args[0].addr; return(cvtStringToXmRenderTable(dpy, wid, XmNrenderTable, XmCRenderTable, from, to)); } /*ARGSUSED*/ static Boolean CvtStringToButtonRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget wid; wid = *(Widget *)args[0].addr; return(cvtStringToXmRenderTable(dpy, wid, XmNbuttonRenderTable, XmCButtonRenderTable, from, to)); } /*ARGSUSED*/ static Boolean CvtStringToLabelRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget wid; wid = *(Widget *)args[0].addr; return(cvtStringToXmRenderTable(dpy, wid, XmNlabelRenderTable, XmCLabelRenderTable, from, to)); } /*ARGSUSED*/ static Boolean CvtStringToTextRenderTable(Display *dpy, XrmValue *args, Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { Widget wid; wid = *(Widget *)args[0].addr; return(cvtStringToXmRenderTable(dpy, wid, XmNtextRenderTable, XmCTextRenderTable, from, to)); } /*ARGSUSED*/ static void CvtStringToXmRenderTableDestroy(XtAppContext app, /* unused */ XrmValue *to, XtPointer converter_data, /* unused */ XrmValue *args, /* unused */ Cardinal *num_args) /* unused */ { XmRenderTableFree(*((XmRenderTable *)to->addr)); } motif-2.3.8/lib/Xm/IconBox.h0000644000175000017500000000566612672140200012436 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmIconBox_h #define _XmIconBox_h #if defined(VMS) || defined(__VMS) #include #endif #include /************************************************************ * INCLUDE FILES *************************************************************/ /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #if defined(__cplusplus) extern "C" { #endif #define XmIconBoxAnyCell (-5) typedef struct _XmIconBoxClassRec *XmIconBoxWidgetClass; typedef struct _XmIconBoxRec *XmIconBoxWidget; typedef struct _XmIconBoxDropData { Position cell_x, cell_y; /* drop location in cell coordinates. */ } XmIconBoxDropData; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /* Function Name: XmIconBoxIsCellEmpty * Description: Returns true if this cell is unused. * Arguments: w - the icon box. * x, y - cell to check. * ignore - ignore this widget when checking. * Returns: Returns true if this cell is unused. */ Boolean XmIconBoxIsCellEmpty( #ifndef _NO_PROTO Widget, Position, Position, Widget #endif ); /* Function Name: XmCreateIconBox * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateIconBox( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ extern WidgetClass xmIconBoxWidgetClass; #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmIconBox_h */ motif-2.3.8/lib/Xm/MapEventsI.h0000644000175000017500000000424612672140200013101 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: MapEventsI.h /main/5 1995/07/13 17:35:36 drk $ */ #ifndef _XmMapEventsI_h #define _XmMapEventsI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for MapEvents.c ********/ extern Boolean _XmMapBtnEvent( register String str, int *eventType, unsigned int *button, Modifiers *modifiers) ; extern int _XmMapKeyEvents( register String str, int **eventType, KeySym **keysym, Modifiers **modifiers) ; extern Boolean _XmMatchBtnEvent( XEvent *event, int eventType, unsigned int button, Modifiers modifiers) ; extern Boolean _XmMatchKeyEvent( XEvent *event, int eventType, unsigned int key, Modifiers modifiers) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMapEventsI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DropTrans.c0000644000175000017500000004441013145162623013003 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: DropTrans.c /main/15 1996/05/02 13:50:19 pascale $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" #include "DragCI.h" #include "DragICCI.h" #include #include /* Deactivated the fix, since it causes crash. For details see http://bugs.motifzone.net/long_list.cgi?buglist=1361 #define CR1146 */ #ifdef CR1146 static int isValidStartDropTimerId = 0; #endif /******** Static Function Declarations ********/ static void ClassPartInit( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static void SourceNotifiedCB( Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format) ; static void TerminateTransfer( XmDropTransferObject dt, Atom *selection) ; static void ProcessTransferEntry( XmDropTransferObject dt, Cardinal which) ; static void DropTransferSelectionCB( Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format) ; static Widget StartDropTransfer( Widget refWidget, ArgList args, Cardinal argCount) ; static void AddDropTransfer( Widget widget, XmDropTransferEntry transfers, Cardinal num_transfers) ; static void DragContextDestroyCB( Widget widget, XtPointer client, XtPointer call) ; /******** End Static Function Declarations ********/ static XtResource resources[] = { { XmNdropTransfers, XmCDropTransfers, XmRDropTransfers, sizeof(XmDropTransferEntry), XtOffsetOf( struct _XmDropTransferRec, dropTransfer.drop_transfers), XmRImmediate, (XtPointer) NULL }, { XmNnumDropTransfers, XmCNumDropTransfers, XmRCardinal, sizeof(Cardinal), XtOffsetOf( struct _XmDropTransferRec, dropTransfer.num_drop_transfers), XmRImmediate, (XtPointer) 0 }, { XmNincremental, XmCIncremental, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmDropTransferRec, dropTransfer.incremental), XmRImmediate, (XtPointer) FALSE }, { XmNtransferProc, XmCTransferProc, XmRCallbackProc, sizeof(XtSelectionCallbackProc), XtOffsetOf( struct _XmDropTransferRec, dropTransfer.transfer_callback), XmRImmediate, (XtPointer) 0 }, { XmNtransferStatus, XmCTransferStatus, XmRTransferStatus, sizeof(unsigned char), XtOffsetOf( struct _XmDropTransferRec, dropTransfer.transfer_status), XmRImmediate, (XtPointer) XmTRANSFER_SUCCESS }, }; /* class record definition */ externaldef(xmgadgetclassrec) XmDropTransferClassRec xmDropTransferClassRec = { { (WidgetClass) &objectClassRec, /* superclass */ "XmDropTransfer", /* class_name */ sizeof(XmDropTransferRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInit, /* class part initialize */ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ NULL, /* obj1 */ NULL, /* obj2 */ 0, /* obj3 */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* obj4 */ XtExposeCompressSeries, /* obj5 */ True, /* obj6 */ False, /* obj7 */ Destroy, /* destroy */ NULL, /* obj8 */ NULL, /* obj9 */ SetValues, /* set_values */ NULL, /* set_values_hook */ NULL, /* obj10 */ NULL, /* get_values_hook */ NULL, /* obj11 */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* obj12 */ NULL, /* obj13 */ NULL, /* obj14 */ NULL, /* extension */ }, { StartDropTransfer, /* start_drop_transfer */ AddDropTransfer, /* add_drop_transfer */ NULL, /* extension */ }, }; externaldef(xmdroptransferobjectclass) WidgetClass xmDropTransferObjectClass = (WidgetClass) &xmDropTransferClassRec; /*ARGSUSED*/ static void ClassPartInit( WidgetClass wc ) { } /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmDropTransferObject new_w = (XmDropTransferObject) nw; XmDropTransferPart *dtp = (XmDropTransferPart *) &(new_w->dropTransfer); if (dtp->num_drop_transfers != 0) { dtp->num_drop_transfer_lists = 1; dtp->drop_transfer_lists = (XmDropTransferList) XtMalloc(sizeof(XmDropTransferListRec) * dtp->num_drop_transfer_lists); dtp->drop_transfer_lists[0].transfer_list = (XmDropTransferEntry)_XmAllocAndCopy( dtp->drop_transfers, sizeof(XmDropTransferEntryRec) * dtp->num_drop_transfers); dtp->drop_transfer_lists[0].num_transfers = dtp->num_drop_transfers; /* strictly for hygene... */ dtp->drop_transfers = dtp->drop_transfer_lists[0].transfer_list; } else { dtp->drop_transfer_lists = NULL; dtp->num_drop_transfer_lists = 0; } dtp->motif_drop_atom = XInternAtom( XtDisplayOfObject(nw), XmS_MOTIF_DROP, False); dtp->cur_drop_transfer_list = (Cardinal) -1; dtp->cur_xfer = (Cardinal) -1; dtp->cur_targets = (Atom *) NULL; dtp->cur_client_data = (XtPointer *) NULL; } /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { /* Stub */ /* !!! Should disallow any changes !!! */ return True; } static void Destroy( Widget w ) { XmDropTransferObject new_w = (XmDropTransferObject) w; Cardinal i; XmDragContext dc; /* * clean up the hanging dragContext */ dc = (XmDragContext)XmGetDragContext((Widget)new_w, new_w->dropTransfer.timestamp); if (dc && dc->drag.sourceIsExternal) XtDestroyWidget((Widget)dc); for (i = 0; i < new_w->dropTransfer.num_drop_transfer_lists; i++) { XmDropTransferList currEntry = &(new_w->dropTransfer.drop_transfer_lists[i]); XtFree((char *)currEntry->transfer_list); } XtFree((char *)new_w->dropTransfer.drop_transfer_lists); } /*ARGSUSED*/ static void SourceNotifiedCB( Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format ) { XmDropTransferObject dt = (XmDropTransferObject)client_data; if (value != NULL) XtFree((char *) value); /* self-immolution aaaaaaiii */ XtDestroyWidget((Widget)dt); } static void TerminateTransfer( XmDropTransferObject dt, Atom *selection ) { Atom status; XmDropTransferPart *dtp = (XmDropTransferPart *) &(dt->dropTransfer); XmDragContext dc = (XmDragContext) dtp->dragContext; if (dtp->transfer_status == XmTRANSFER_SUCCESS) status = XInternAtom(XtDisplayOfObject((Widget)dt), XmSTRANSFER_SUCCESS, False); else /* XmTRANSFER_FAILURE */ status = XInternAtom(XtDisplayOfObject((Widget)dt), XmSTRANSFER_FAILURE, False); /* * we need to pass in the shell since that is the only widget * visible to the initiator. */ XtGetSelectionValue(dc->drag.currReceiverInfo->shell, *selection, status, SourceNotifiedCB, (XtPointer)dt, dtp->timestamp); } static void ProcessTransferEntry( XmDropTransferObject dt, Cardinal which ) { XmDropTransferPart *dtp = (XmDropTransferPart *) &(dt->dropTransfer); XmDropTransferList tl = &(dtp->drop_transfer_lists[which]); XmDragContext dc = (XmDragContext)dtp->dragContext; Cardinal i; Arg args[1]; Atom real_selection_atom; dtp->cur_drop_transfer_list = which; dtp->cur_targets = (Atom *) XtMalloc((tl->num_transfers * sizeof(Atom))); dtp->cur_client_data = (XtPointer *) XtMalloc((tl->num_transfers * sizeof(XtPointer))); i = 0; XtSetArg(args[i], XmNiccHandle, &real_selection_atom); i++; XtGetValues(dtp->dragContext, args, i); for (i=0; i < tl->num_transfers; i++) { dtp->cur_targets[i] = tl->transfer_list[i].target; /* * all of the client data have to point to us so that we can * bootstrap */ dtp->cur_client_data[i] = (XtPointer)dt; } dtp->cur_xfer = 0; /* * we need to pass in the destShell since that is the only widget * visible to the initiator. */ /* * As both an optimization and workaround for an Xt bug, * if the number of transfers is just one then call the * singular version of XtGetSelectionValue{,Incremental}. * If there is only one item there is no need to call * the plural version; XtGetSelectionValues * Also there is a bug in some Xt's which fail to handle * both MULTIPLE and INCR together correctly and can hang * the drop transfer forever. By adding this special case * we allow knowledgeable clients to request any target that * might be large enough to trigger an INCR as a single item * that would avoid the MULTIPLE case. */ if (dtp->incremental) { if (tl->num_transfers == 1) { XtGetSelectionValueIncremental( dc->drag.currReceiverInfo->shell, real_selection_atom, dtp->cur_targets[0], DropTransferSelectionCB, (XtPointer)dtp->cur_client_data[0], dtp->timestamp); } else { XtGetSelectionValuesIncremental( dc->drag.currReceiverInfo->shell, real_selection_atom, dtp->cur_targets, tl->num_transfers, DropTransferSelectionCB, (XtPointer *)dtp->cur_client_data, dtp->timestamp); } } else { if (tl->num_transfers == 1) { XtGetSelectionValue(dc->drag.currReceiverInfo->shell, real_selection_atom, dtp->cur_targets[0], DropTransferSelectionCB, (XtPointer)dtp->cur_client_data[0], dtp->timestamp); } else { XtGetSelectionValues(dc->drag.currReceiverInfo->shell, real_selection_atom, dtp->cur_targets, tl->num_transfers, DropTransferSelectionCB, (XtPointer *)dtp->cur_client_data, dtp->timestamp); } } } /* * This routine is called with the shell as the widget and us as the * client data. We can't pass ourselves since we're not windowed */ /*ARGSUSED*/ static void DropTransferSelectionCB( Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format ) { XmDropTransferObject dt = (XmDropTransferObject) client_data; XmDropTransferPart *dtp = (XmDropTransferPart *) &(dt->dropTransfer); XmDropTransferList tl = &(dtp->drop_transfer_lists[dtp->cur_drop_transfer_list]); (*(dtp->transfer_callback)) ((Widget)dt, tl->transfer_list[dtp->cur_xfer].client_data, selection, type, value, length, format); /* The transfer list needs to be reassigned at this point in case * an XmDropTransferAdd() was called in the callback. */ tl = &(dtp->drop_transfer_lists[dtp->cur_drop_transfer_list]); if ( !(dtp->incremental) || ((dtp->incremental) && (value != NULL) && (*length == 0))) { dtp->cur_xfer++; if (dtp->cur_xfer == tl->num_transfers) { XtFree((char *)dtp->cur_targets); XtFree((char *)dtp->cur_client_data); if (++(dtp->cur_drop_transfer_list) < dtp->num_drop_transfer_lists) { /* Get the next transfer entry in the list and process it */ ProcessTransferEntry(dt, dtp->cur_drop_transfer_list); } else /* notify the source that we're done */ TerminateTransfer(dt, selection); } } } /*ARGSUSED*/ static void StartDropTimer( XtPointer clientData, XtIntervalId *id ) { XmDropTransferObject dt = (XmDropTransferObject)clientData; XmDropTransferPart *dtp; Arg my_args[1]; int i; Atom selection; #ifdef CR1146 isValidStartDropTimerId = 0; #endif dtp = (XmDropTransferPart *) &(dt->dropTransfer); if (dtp->num_drop_transfer_lists) { /* Get the first transfer entry in the list and process it */ ProcessTransferEntry(dt, 0); } else /* notify the source that we've changed our mind */ { i = 0; XtSetArg(my_args[i], XmNiccHandle, &selection); i++; XtGetValues(dtp->dragContext, my_args, i); TerminateTransfer(dt, &selection); } } static void DragContextDestroyCB( Widget widget, XtPointer client, XtPointer call) { XtIntervalId timer = (XtIntervalId) client; #ifdef CR1146 if (!isValidStartDropTimerId) return; #endif XtRemoveTimeOut(timer); } static Widget StartDropTransfer( Widget refWidget, ArgList args, Cardinal argCount ) { static int which = 0; XmDropTransferObject dt; char buf[30]; XtIntervalId timer; _XmProcessLock(); sprintf(buf, "Transfer%d", which++); _XmProcessUnlock(); dt = (XmDropTransferObject) XtCreateWidget(buf, xmDropTransferObjectClass, (Widget) XmGetXmDisplay(XtDisplayOfObject(refWidget)), args, argCount); dt->dropTransfer.dragContext = refWidget; dt->dropTransfer.timestamp = ((XmDragContext)refWidget)->drag.dragFinishTime; /* * The processing of the dropTransfer should happen after the * dropStart message is echoed to the initiator. Since we're * being called out of the dropProc of the receiver we can't * just proceed or else the entire transfer could happen * inline. We therefore add ourselves as a zero length timer * which will allow us to get called after the dropProc has * returned. * To prevent against this code's being called twice by disparate * parts of the drag/drop code (especially on failure) self-guard by * watching for destruction of the widget and avoid the rest of the * operations. */ timer = XtAppAddTimeOut(XtWidgetToApplicationContext( (Widget)dt), 0, StartDropTimer, (XtPointer)dt); #ifdef CR1146 if (isValidStartDropTimerId) { printf("Motif Error in file %s at line %d: A DropTimer is already active,\n", __FILE__, __LINE__); } isValidStartDropTimerId = 1; #endif XtAddCallback(refWidget, XmNdestroyCallback, DragContextDestroyCB, (XtPointer)timer); return((Widget) dt); } Widget XmDropTransferStart( Widget refWidget, ArgList args, Cardinal argCount ) { Widget ddo = (Widget) XmGetXmDisplay(XtDisplayOfObject(refWidget)); XmDropTransferObjectClass wc; Arg lclArgs[1]; int n; Widget ret_val; _XmWidgetToAppContext(refWidget); _XmAppLock(app); n = 0; XtSetArg(lclArgs[n], XmNdropTransferClass, &wc); n++; XtGetValues(ddo, lclArgs, n); ret_val = (*(wc->dropTransfer_class.start_drop_transfer)) (refWidget, args, argCount); _XmAppUnlock(app); return ret_val; } static void AddDropTransfer( Widget widget, XmDropTransferEntry transfers, Cardinal num_transfers ) { XmDropTransferObject dto = (XmDropTransferObject) widget; XmDropTransferPart *dtp = (XmDropTransferPart *) &(dto->dropTransfer); Cardinal index = dtp->num_drop_transfer_lists++; dtp->drop_transfer_lists = (XmDropTransferList) XtRealloc((char *)dtp->drop_transfer_lists, sizeof(XmDropTransferListRec) * dtp->num_drop_transfer_lists); dtp->drop_transfer_lists[index].transfer_list = (XmDropTransferEntry)_XmAllocAndCopy( transfers, sizeof(XmDropTransferEntryRec) * num_transfers); dtp->drop_transfer_lists[index].num_transfers = num_transfers; } void XmDropTransferAdd( Widget widget, XmDropTransferEntry transfers, Cardinal num_transfers ) { XmDropTransferObject dt = (XmDropTransferObject) widget; XmDropTransferObjectClass wc; _XmWidgetToAppContext(widget); _XmAppLock(app); wc = (XmDropTransferObjectClass) XtClass(dt); ((*(wc->dropTransfer_class.add_drop_transfer)) (widget, transfers, num_transfers)); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/CascadeBGP.h0000644000175000017500000002002513145162623012744 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCascadeBGP_h #define _XmCascadeBGP_h #include #include #ifdef __cplusplus extern "C" { #endif /********************************************************************* * The Arrow Cache record for the menu cascade button *********************************************************************/ typedef struct _XmArrowPixmap { Dimension height, width; unsigned int depth; unsigned char direction; Pixel top_shadow_color; Pixel bottom_shadow_color; Pixel foreground_color; Display *display; Screen *screen; Pixmap pixmap; } XmArrowPixmap; /*********************************************************************/ /* The CascadeButton Gadget Cache Object's class and instance records*/ /*********************************************************************/ typedef struct _XmCascadeButtonGCacheObjClassPart { int foo; } XmCascadeButtonGCacheObjClassPart; typedef struct _XmCascadeButtonGCacheObjClassRec { ObjectClassPart object_class; XmExtClassPart ext_class; XmLabelGCacheObjClassPart label_class_cache; XmCascadeButtonGCacheObjClassPart cascade_button_class_cache; } XmCascadeButtonGCacheObjClassRec; externalref XmCascadeButtonGCacheObjClassRec xmCascadeButtonGCacheObjClassRec; typedef struct _XmCascadeButtonGCacheObjPart { Pixmap cascade_pixmap; /* pixmap for the cascade */ int map_delay; /* time delay for posting */ Pixmap armed_pixmap; GC arm_gc; GC background_gc; } XmCascadeButtonGCacheObjPart; typedef struct _XmCascadeButtonGCacheObjRec { ObjectPart object; XmExtPart ext; XmLabelGCacheObjPart label_cache; XmCascadeButtonGCacheObjPart cascade_button_cache; } XmCascadeButtonGCacheObjRec; /* The CascadeButtonGadget instance record */ typedef struct _XmCascadeButtonGadgetPart { /* resources */ Widget submenu; /* the menu to pull down */ XtCallbackList activate_callback; /* widget fired callback */ XtCallbackList cascade_callback; /* optional callback, called */ /* when the menu is about */ /* to be pulled down */ /* internal fields */ Boolean armed; /* armed flag */ XRectangle cascade_rect; /* location of cascade*/ XtIntervalId timer; /* timeout id */ XmCascadeButtonGCacheObjPart *cache; } XmCascadeButtonGadgetPart; /* Full instance record declaration */ typedef struct _XmCascadeButtonGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmLabelGadgetPart label; XmCascadeButtonGadgetPart cascade_button; } XmCascadeButtonGadgetRec; /* CascadeButton class structure */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmCascadeButtonGadgetClassPart; /* Full class record declaration for CascadeButton class */ typedef struct _XmCascadeButtonGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmLabelGadgetClassPart label_class; XmCascadeButtonGadgetClassPart cascade_button_class; } XmCascadeButtonGadgetClassRec; externalref XmCascadeButtonGadgetClassRec xmCascadeButtonGadgetClassRec; /* Access macro definitions for UNcached fields*/ #define CBG_Submenu(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.submenu) #define CBG_ActivateCall(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.activate_callback) #define CBG_CascadeCall(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cascade_callback) #define CBG_Armed(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.armed) #define CBG_CascadeRect(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cascade_rect) #define CBG_Timer(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.timer) #define CBG_Cascade_x(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cascade_rect.x) #define CBG_Cascade_y(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cascade_rect.y) #define CBG_Cascade_width(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cascade_rect.width) #define CBG_Cascade_height(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cascade_rect.height) #define CBG_HasCascade(cb) (((LabG_MenuType(cb) == XmMENU_PULLDOWN) || \ (LabG_MenuType(cb) == XmMENU_POPUP) || \ (LabG_MenuType(cb) == XmMENU_OPTION)) && \ (CBG_Submenu(cb))) #define XmCBG_ARMED_BIT (1 << 0) #define XmCBG_TRAVERSE_BIT (1 << 1) #define XmCBG_WAS_POSTED_BIT (1 << 2) #define CBG_IsArmed(cb) (((XmCascadeButtonGadget)(cb))->cascade_button.armed \ & XmCBG_ARMED_BIT) #define CBG_Traversing(cb) (((XmCascadeButtonGadget) \ (cb))->cascade_button.armed & XmCBG_TRAVERSE_BIT) #define CBG_WasPosted(cb) (((XmCascadeButtonGadget) \ (cb))->cascade_button.armed & XmCBG_WAS_POSTED_BIT) #define CBG_SetBit(byte,bit,v) byte = (byte & (~bit)) | (v ? bit : 0) #define CBG_SetArmed(cb,v) CBG_SetBit (((XmCascadeButtonGadget) \ (cb))->cascade_button.armed, \ XmCBG_ARMED_BIT, v) #define CBG_SetTraverse(cb,v) CBG_SetBit (((XmCascadeButtonGadget) \ (cb))->cascade_button.armed, \ XmCBG_TRAVERSE_BIT, v) #define CBG_SetWasPosted(cb,v) CBG_SetBit (((XmCascadeButtonGadget) \ (cb))->cascade_button.armed, \ XmCBG_WAS_POSTED_BIT, v) /* Access macro definitions for Cached fields*/ #define CBG_CascadePixmap(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cache->cascade_pixmap) #define CBG_MapDelay(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cache->map_delay) #define CBG_ArmedPixmap(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cache->armed_pixmap) #define CBG_ArmGC(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cache->arm_gc) #define CBG_BackgroundGC(cb) (((XmCascadeButtonGadget) \ cb)->cascade_button.cache->background_gc) /******************************/ /* Convenience Macros */ /******************************/ #define CBG_Cache(w) (((XmCascadeButtonGadget)(w))->\ cascade_button.cache) #define CBG_ClassCachePart(w) \ (((XmCascadeButtonGadgetClass)xmCascadeButtonGadgetClass)->gadget_class.cache_part) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCascadeBGP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/TabBox.c0000644000175000017500000075650513150163046012261 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * COPYRIGHT NOTICE * Copyright (c) 1995 Integrated Computer Solutions */ /* * SYMBOLS * ======= * * DEMO - Controls if this is a demo version or not * SCROLLED_LAYOUT - Controls if the scrolled layout features are supported * OVERLAYED_LAYOUT - Controls if the overlayed layout is supported * */ #ifdef HAVE_CONFIG_H #include #endif #include #include "XmI.h" #include #ifdef SCROLLED_LAYOUT #include #endif #include #include #include #include #define FIX_1503 #ifdef USE_XFT #include #endif #define _XiBoolean Boolean typedef enum {XiQUAD_1, XiQUAD_2, XiQUAD_3, XiQUAD_4} XiQuadrant; #ifdef FIX_1381 typedef enum {normal, insensitive, shadow} GC_type; #endif typedef struct _XmTabRect { int x, y; int width, height; int row, column; } XiTabRect; typedef struct _XmCache { XImage *pixmap; XImage *label; Boolean sensitive; } XiCache; #ifdef _ARGS #undef _ARGS #endif #ifndef _NO_PROTO #define _ARGS(a) a #else #define _ARGS(a) () #endif extern XmTabAttributes _XmTabbedStackListGet _ARGS((XmTabbedStackList, int)); extern XmTabAttributes _XmTabbedStackListArray _ARGS((XmTabbedStackList)); extern int _XmTabbedStackListCount _ARGS((XmTabbedStackList)); #ifndef _NO_PROTO static void ClassInitialize (void); static void ClassPartInitialize(WidgetClass w_class); static void TabCanvasClassInitialize (void); #else static void ClassPartInitialize(); static void ClassInitialize (); static void TabCanvasClassInitialize (); #endif static void Initialize _ARGS((Widget, Widget, ArgList, Cardinal*)); static void Destroy _ARGS((Widget)); static void Resize _ARGS((Widget)); static Boolean SetValues _ARGS((Widget, Widget, Widget, ArgList, Cardinal*)); static XtGeometryResult QueryGeometry _ARGS((Widget, XtWidgetGeometry*, XtWidgetGeometry*)); static void Realize _ARGS((Widget, XtValueMask*, XSetWindowAttributes*)); static void BorderHighlight _ARGS((Widget)); static void BorderUnhighlight _ARGS((Widget)); static void XmTabBoxArmAndActivate _ARGS((Widget, XEvent*, String*,Cardinal*)); static void _XmTabBoxTraverseRight _ARGS((Widget, XEvent*, String*,Cardinal*)); static void _XmTabBoxTraverseLeft _ARGS((Widget, XEvent*, String*, Cardinal*)); static void _XmTabBoxTraverseUp _ARGS((Widget, XEvent*, String*, Cardinal*)); static void _XmTabBoxTraverseDown _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxArmTab _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxSelectTab _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxTraverseRight _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxTraverseLeft _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxTraverseUp _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxTraverseDown _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxTraversePrevious _ARGS((Widget, XEvent*, String*, Cardinal*)); static void XmTabBoxTraverseNext _ARGS((Widget, XEvent*, String*, Cardinal*)); static void CalcTabSize _ARGS((XmTabBoxWidget, XmTabAttributes, XmTabOrientation, XmFontList, int, int, int, int, int, int, Dimension*, Dimension*)); static void CalcStackedGeometry _ARGS((XmTabBoxWidget, XRectangle*)); static void HorizontalStackedLayout _ARGS((XmTabBoxWidget, _XiBoolean)); static void HorizontalStackedRedisplay _ARGS((XmTabBoxWidget)); static void VerticalStackedRedisplay _ARGS((XmTabBoxWidget)); static void VerticalStackedLayout _ARGS((XmTabBoxWidget, _XiBoolean)); static void CalcUnlimitedGeometry _ARGS((XmTabBoxWidget, XRectangle*)); static void CalcGeometry _ARGS((XmTabBoxWidget, XRectangle*)); static void HorizontalBasicLayout _ARGS((XmTabBoxWidget)); static void VerticalBasicLayout _ARGS((XmTabBoxWidget)); static void Layout _ARGS((XmTabBoxWidget)); static void Redisplay _ARGS((Widget, XEvent*, Region)); static void RedisplayTabs _ARGS((XmTabBoxWidget, Region)); static void DrawTab _ARGS((XmTabBoxWidget, XmTabAttributes, XiTabRect*, _XiBoolean, _XiBoolean)); static Boolean CvtStringToTabOrientation _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static Boolean CvtStringToTabSide _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static Boolean CvtStringToTabStyle _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static Boolean CvtStringToTabMode _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static Boolean CvtStringToTabEdge _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); #ifdef SCROLLED_LAYOUT static Boolean CvtStringToArrowPlacement _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); #endif static Boolean CvtStringToTabList _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static void CvtDestroyTabList _ARGS((XtAppContext, XrmValue*, XtPointer, XrmValue*, Cardinal*)); static void XiDrawCorner _ARGS((Display*, Drawable, GC, GC, int, int, unsigned int, unsigned int, unsigned int, XiQuadrant)); static void HorizontalBasicRedisplay _ARGS((XmTabBoxWidget)); static void VerticalBasicRedisplay _ARGS((XmTabBoxWidget)); static XImage *XiRotateImage _ARGS((XmTabBoxWidget, XImage*, int)); static void CalcCornerSize _ARGS((XmTabBoxWidget)); static int XiXYtoTab _ARGS((XmTabBoxWidget, int, int)); static void CalcTabGeometry _ARGS((XmTabBoxWidget)); static int CalcGeometryMinor _ARGS((XmTabBoxWidget, int)); static int CalcGeometryMajor _ARGS((XmTabBoxWidget, int)); static void CallCallbacks _ARGS((XmTabBoxWidget, XEvent*, int, int)); #ifdef FIX_1381 static void SetRightGC(XmTabBoxWidget tab, GC gc, GC_type); #endif static void DrawVerticalTab _ARGS((XmTabBoxWidget, XmTabAttributes, GC, _XiBoolean, int, int, int, _XiBoolean, int, int, XRectangle*, _XiBoolean, _XiBoolean)); static void DrawLeftToRightTab _ARGS((XmTabBoxWidget, XmTabAttributes, GC, _XiBoolean, int, int, int, _XiBoolean, int, int, XRectangle*)); static void DrawRightToLeftTab _ARGS((XmTabBoxWidget, XmTabAttributes, GC, _XiBoolean, int, int, int, _XiBoolean, int, int, XRectangle*, _XiBoolean)); static void DrawTopToBottomTab _ARGS((XmTabBoxWidget, XmTabAttributes, GC, _XiBoolean, int, int, int, _XiBoolean, int, int, XRectangle*, _XiBoolean)); static void DrawBottomToTopTab _ARGS((XmTabBoxWidget, XmTabAttributes, GC, _XiBoolean, int, int, int, _XiBoolean, int, int, XRectangle*, _XiBoolean)); static void FillRoundedTab _ARGS((XmTabBoxWidget, GC, XiTabRect*, XmTabEdge)); static void FillBeveledTab _ARGS((XmTabBoxWidget, GC, XiTabRect*, XmTabEdge)); static XmTabAttributes GetTabInfo _ARGS((XmTabBoxWidget, int, int)); static int GetTabIndex _ARGS((XmTabBoxWidget, int, int)); static void SelectTab _ARGS((XmTabBoxWidget, XEvent*, int, int)); static Boolean IsTabSensitive _ARGS((XmTabBoxWidget, int)); static Widget XiGCParent _ARGS((XmTabBoxWidget)); static void ResetImageCache _ARGS((XmTabBoxWidget)); static void FreeImageCache _ARGS((XmTabBoxWidget)); static int InfoToIndex _ARGS((XmTabBoxWidget, XmTabAttributes)); static Visual* GetShellVisual _ARGS((Widget)); static void CheckSetRenderTable(Widget wid, int offs, XrmValue *value); #define CachePixmap(t,i) XmTabBox__cache((t))[InfoToIndex(t,i)].pixmap #define CacheLabel(t,i) XmTabBox__cache((t))[InfoToIndex(t,i)].label #define CacheSensitive(t,i) XmTabBox__cache((t))[InfoToIndex(t,i)].sensitive #ifndef AssignMax #define AssignMax(x,y) if((y)>(x)) (x)=(y); else #endif #ifndef AssignMin #define AssignMin(x,y) if((y)<(x)) (x)=(y); else #endif #ifndef Max #define Max(x,y) (((x)>(y))?(x):(y)) #endif #define XiRectInRegion(r,x,y,w,h) ((r) == False ? RectangleIn : \ XRectInRegion(r,x,y,w,h)) #define XiCanvas(x) (XtWindow(XmTabBox__canvas((x)))) #define XiTabParent(x) ((XmTabBoxWidget) XtParent(x)) #define XImageWidth(i) (i)->width #define XImageHeight(i) (i)->height #define XImageDepth(i) (i)->depth; #define XiTabDegree(x) ((x) == XmTABS_RIGHT_TO_LEFT ? 180 \ : ((x) == XmTABS_TOP_TO_BOTTOM ? 90 \ : ((x) == XmTABS_BOTTOM_TO_TOP ? 270 : 0))) #define ValidPixmap(p) ((p) != (Pixmap)NULL && \ (p) != (Pixmap)XmUNSPECIFIED_PIXMAP && \ (p) != XmPIXMAP_DYNAMIC ) #define XiCalcTabSize(t,i,w,h) \ CalcTabSize((t),(i), XmTabBox_tab_orientation((t)), \ XmTabBox_font_list((t)), (t)->manager.shadow_thickness, \ XmTabBox_highlight_thickness((t)), \ XmTabBox_tab_margin_width((t)), \ XmTabBox_tab_margin_height((t)), \ XmTabBox_tab_label_spacing((t)), \ XmTabBox__corner_size((t)), (w), (h)) #define SetSolidGC(d,g,p) \ { \ XGCValues _macro_gc_values; \ _macro_gc_values.foreground = (p); \ _macro_gc_values.fill_style = FillSolid; \ XChangeGC((d),(g), GCForeground | GCFillStyle, &_macro_gc_values); \ } #define SetTiledGC(d,g,p) \ { \ XGCValues _macro_gc_values; \ _macro_gc_values.tile = (p); \ _macro_gc_values.fill_style = FillTiled; \ XChangeGC((d),(g), GCTile | GCFillStyle, &_macro_gc_values); \ } #define SetTiledXYGC(d,g,p,x,y) \ { \ XGCValues _macro_gc_values; \ _macro_gc_values.tile = (p); \ _macro_gc_values.fill_style = FillTiled; \ _macro_gc_values.ts_x_origin = (x); \ _macro_gc_values.ts_y_origin = (y); \ XChangeGC((d),(g), GCTile | GCFillStyle | GCTileStipXOrigin | \ GCTileStipYOrigin, &_macro_gc_values); \ } #define SetStippledGC(d,g,p) \ { \ XGCValues _macro_gc_values; \ _macro_gc_values.stipple = (p); \ _macro_gc_values.fill_style = FillStippled; \ _macro_gc_values.ts_x_origin = (x); \ _macro_gc_values.ts_y_origin = (y); \ XChangeGC((d),(g), GCStipple | GCFillStyle | GCTileStipXOrigin | \ GCTileStipYOrigin, &_macro_gc_values); \ } #define SetStippledXYGC(d,g,p,x,y) \ { \ XGCValues _macro_gc_values; \ _macro_gc_values.stipple = (p); \ _macro_gc_values.fill_style = FillStippled; \ _macro_gc_values.ts_x_origin = (x); \ _macro_gc_values.ts_y_origin = (y); \ XChangeGC((d),(g), GCStipple | GCFillStyle | GCTileStipXOrigin | \ GCTileStipYOrigin, &_macro_gc_values); \ } #define XiBackgroundSpecified(i) \ ((i)->background != XmCOLOR_DYNAMIC || \ ValidPixmap((i)->background_pixmap)) #define SetBackgroundGC(t,i,g) \ { \ if( ValidPixmap((i)->background_pixmap) ) \ { \ SetTiledGC(XtDisplay(t), (g), (i)->background_pixmap); \ } \ else \ { \ SetSolidGC(XtDisplay(t), (g), (i)->background); \ }\ } #define XiSelectSpecified(t) \ (XmTabBox_select_color((t)) != XmCOLOR_DYNAMIC || \ ValidPixmap(XmTabBox_select_pixmap((t)))) #define SetSelectGC(t,g) \ { \ if( ValidPixmap(XmTabBox_select_pixmap((t))) ) \ { \ SetTiledGC(XtDisplay(t), (g), XmTabBox_select_pixmap((t))); \ } \ else \ { \ SetSolidGC(XtDisplay(t), (g), XmTabBox_select_color((t))); \ }\ } #define XiChildSpecified(c) \ (XmTabStackC_tab_background(c) != XmCOLOR_DYNAMIC || \ ValidPixmap(XmTabStackC_tab_background_pixmap(c))) #define RemoveStipple(d,g) XSetFillStyle((d),(g), FillSolid) static XtActionsRec actions[] = { { "XmTabBoxArmAndActivate", (XtActionProc) XmTabBoxArmAndActivate }, { "XmTabBoxArmTab", (XtActionProc) XmTabBoxArmTab }, { "XmTabBoxSelectTab", (XtActionProc) XmTabBoxSelectTab }, { "XmTabBoxTraverseRight", (XtActionProc) XmTabBoxTraverseRight }, { "XmTabBoxTraverseLeft", (XtActionProc) XmTabBoxTraverseLeft }, { "XmTabBoxTraverseUp", (XtActionProc) XmTabBoxTraverseUp }, { "XmTabBoxTraverseDown", (XtActionProc) XmTabBoxTraverseDown }, { "XmTabBoxTraversePrevious", (XtActionProc) XmTabBoxTraversePrevious }, { "XmTabBoxTraverseNext", (XtActionProc) XmTabBoxTraverseNext }, }; static char traversal_translations[] = "osfRight: XmTabBoxTraverseRight()\n\ osfLeft: XmTabBoxTraverseLeft()\n\ osfUp: XmTabBoxTraverseUp()\n\ osfDown: XmTabBoxTraverseDown()\n\ ~c s Tab: PrimitivePrevTabGroup()\n\ ~c ~s Tab: PrimitiveNextTabGroup()\n\ c s Tab: PrimitivePrevTabGroup()\n\ c ~s Tab: PrimitiveNextTabGroup()\n\ osfHelp: PrimitiveHelp()\n\ : PrimitiveFocusIn()\n\ : PrimitiveFocusOut()\n\ : PrimitiveEnter()\n\ : PrimitiveLeave()\n\ : PrimitiveUnmap()"; static char canvas_translations[] = ": XmTabBoxArmTab()\n\ : XmTabBoxSelectTab()\n\ osfActivate: XmTabBoxArmAndActivate()\n\ space: XmTabBoxArmAndActivate()"; /* because this is a private widget for the TabStack, the resources are ** assumed already to be in pixels */ static XtResource resources[] = { /* Inherit (but changed default) resources */ { XmNshadowThickness, XmCShadowThickness, XmRDimension, sizeof(Dimension), XtOffsetOf(XmManagerRec, manager.shadow_thickness), XmRImmediate, (XtPointer) 2 }, /* TabBox Resources */ { XmNtabStyle, XmCTabStyle, XmRTabStyle, sizeof(XmTabStyle), XtOffsetOf(XmTabBoxRec, tab_box.tab_style), XmRImmediate, (XtPointer) XmTABS_BEVELED }, { XmNtabMode, XmCTabMode, XmRTabMode, sizeof(XmTabMode), XtOffsetOf(XmTabBoxRec, tab_box.tab_mode), XmRImmediate, (XtPointer) XmTABS_BASIC }, { XmNtabList, XmCTabList, XmRTabList, sizeof(XmTabbedStackList), XtOffsetOf(XmTabBoxRec, tab_box.tab_list), XmRImmediate, (XtPointer) NULL }, { XmNtabOrientation, XmCTabOrientation, XmRTabOrientation, sizeof(XmTabOrientation), XtOffsetOf(XmTabBoxRec, tab_box.tab_orientation), XmRImmediate, (XtPointer) XmTABS_LEFT_TO_RIGHT }, { XmNtabAutoSelect, XmCTabAutoSelect, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabBoxRec, tab_box.tab_auto_select), XmRImmediate, (XtPointer) True }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf(XmTabBoxRec, tab_box.orientation), XmRImmediate, (XtPointer) XmHORIZONTAL }, { XmNuniformTabSize, XmCUniformTabSize, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabBoxRec, tab_box.uniform_tab_size), XmRImmediate, (XtPointer) True }, { XmNtabSelectColor, XmCTabSelectColor, XmRXmPixel, sizeof(Pixel), XtOffsetOf(XmTabBoxRec, tab_box.select_color), XmRImmediate, (XtPointer) XmCOLOR_DYNAMIC }, { XmNtabSelectPixmap, XmCTabSelectPixmap, XmRXmPixmap, sizeof(Pixel), XtOffsetOf(XmTabBoxRec, tab_box.select_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNtabMarginWidth, XmCMarginWidth, XmRDimension, sizeof(Dimension), XtOffsetOf(XmTabBoxRec, tab_box.tab_margin_width), XmRImmediate, (XtPointer) 2 }, { XmNtabMarginHeight, XmCMarginHeight, XmRDimension, sizeof(Dimension), XtOffsetOf(XmTabBoxRec, tab_box.tab_margin_height), XmRImmediate, (XtPointer) 2 }, { XmNtabLabelSpacing, XmCTabLabelSpacing, XmRDimension, sizeof(Dimension), XtOffsetOf(XmTabBoxRec, tab_box.tab_label_spacing), XmRImmediate, (XtPointer) 2 }, { XmNtabCornerPercent, XmCTabCornerPercent, XmRInt, sizeof(int), XtOffsetOf(XmTabBoxRec, tab_box.tab_corner_percent), XmRImmediate, (XtPointer) 40 }, { XmNnumStacks, XmCNumStacks, XmRInt, sizeof(int), XtOffsetOf(XmTabBoxRec, tab_box.num_stacks), XmRImmediate, (XtPointer) 5 }, #ifdef SCROLLED_LAYOUT { XmNtabArrowPlacement, XmCTabArrowPlacement, XmRTabArrowPlacement, sizeof(int), XtOffsetOf(XmTabBoxRec, tab_box.arrow_placement), XmRImmediate, (XtPointer) XmTAB_ARROWS_ON_LEFT }, #endif { XmNtabEdge, XmCTabEdge, XmRTabEdge, sizeof(XmTabEdge), XtOffsetOf(XmTabBoxRec, tab_box.tab_edge), XmRImmediate, (XtPointer) XmTAB_EDGE_BOTTOM_RIGHT }, { XmNtabOffset, XmCTabOffset, XmRDimension, sizeof(Dimension), XtOffsetOf(XmTabBoxRec, tab_box.tab_offset), XmRImmediate, (XtPointer) 10 }, { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabBoxRec, tab_box.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmTabBoxRec, tab_box.font_list), XmRCallProc, (XtPointer) CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmTabBoxRec, tab_box.font_list), XmRCallProc, (XtPointer) CheckSetRenderTable }, { XmNhighlightThickness, XmCHighlightThickness, XmRDimension, sizeof(Dimension), XtOffsetOf(XmTabBoxRec, tab_box.highlight_thickness), XmRImmediate, (XtPointer) 2 }, { XmNstackedEffect, XmCStackedEffect, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabBoxRec, tab_box.stacked_effect), XmRImmediate, (XtPointer) True }, { XmNuseImageCache, XmCUseImageCache, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabBoxRec, tab_box.use_image_cache), XmRImmediate, (XtPointer) True }, { XmNselectedIndex, XmCSelectedIndex, XmRInt, sizeof(int), XtOffsetOf(XmTabBoxRec, tab_box.selected_index), XmRImmediate, (XtPointer) -1 }, { XmNtraversalIndex, XmCTraversalIndex, XmRInt, sizeof(int), XtOffsetOf(XmTabBoxRec, tab_box.traversal_index), XmRImmediate, (XtPointer) -1 }, { XmNselectCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmTabBoxRec, tab_box.select_callback), XmRImmediate, (XtPointer) NULL }, { XmNunselectCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmTabBoxRec, tab_box.unselect_callback), XmRImmediate, (XtPointer) NULL } }; typedef struct _XiTabCanvasClassPart { XtPointer extension; } XiTabCanvasClassPart; typedef struct _XiTabCanvasClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XiTabCanvasClassPart canvas_class; } XiTabCanvasClassRec; typedef struct _XiTabCanvasPart { XtPointer extension; } XiTabCanvasPart; typedef struct _XiTabCanvasRec { CorePart core; XmPrimitivePart primitive; XiTabCanvasPart canvas; } XiTabCanvasRec; XiTabCanvasClassRec xmTabCanvasClassRec = { { /* Core Fields */ /* superclass */ (WidgetClass) &xmPrimitiveClassRec, /* class_name */ "XiTabCanvas", /* widget_size */ sizeof(XiTabCanvasRec), /* class_initialize */ TabCanvasClassInitialize, /* chained class init */ ClassPartInitialize, /* class_inited */ False, /* initialize */ NULL, /* initialize hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ NULL, /* num_resources */ 0, /* xrm_class */ NULLQUARK, /* compress_motion */ True, /* compress_exposure */ XtExposeCompressMultiple, /* compress enter/exit*/ True, /* visible_interest */ False, /* destroy */ NULL, /* resize */ NULL, /* expose */ Redisplay, /* set_values */ NULL, /* set values hook */ NULL, /* set values almost */ XtInheritSetValuesAlmost, /* get values hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ canvas_translations, /* query geo proc */ QueryGeometry, /* display accelerator*/ NULL, /* extension record */ (XtPointer) NULL }, { /* OSF/Motif Primitive Fields */ /* border_highlight */ BorderHighlight, /* border_unhighlight */ BorderUnhighlight, /* translations */ traversal_translations, /* arm_and_activate */ NULL, /* syn resources */ NULL, /* num syn_resources */ 0, /* extension */ NULL }, { /* EPak Tab Canvas Fields */ /* extension */ NULL } }; XmTabBoxClassRec xmTabBoxClassRec = { { /* Core Fields */ /* superclass */ (WidgetClass) &xmManagerClassRec, /* class_name */ "XmTabBox", /* widget_size */ sizeof(XmTabBoxRec), /* class_initialize */ ClassInitialize, /* class_part_initial */ NULL, /* class_inited */ False, /* initialize */ Initialize, /* initialize hook */ NULL, /* realize */ Realize, /* actions */ actions, /* num_actions */ XtNumber(actions), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ True, /* compress_exposure */ XtExposeCompressMultiple, /* compress enter/exit*/ True, /* visible_interest */ False, /* destroy */ Destroy, /* resize */ Resize, /* expose */ NULL, /* set_values */ SetValues, /* set values hook */ NULL, /* set values almost */ XtInheritSetValuesAlmost, /* get values hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ XtInheritTranslations, /* query geo proc */ QueryGeometry, /* display accelerator*/ NULL, /* extension record */ (XtPointer) NULL }, { /* Composite Fields */ /* geometry_manager */ XtInheritGeometryManager, /* change_managed */ XtInheritChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ (XtPointer) NULL }, { /* Constraint Fields */ /* resources */ NULL, /* num_resources */ 0, /* constraint_size */ sizeof (XmManagerConstraintRec), /* initialize */ NULL, /* destroy */ NULL, /* set_values */ NULL, /* extension */ (XtPointer) NULL }, { /* OSF/Motif Manager Fields */ /* translations */ XtInheritTranslations, /* syn_resources */ NULL, /* num_syn_resources */ 0, /* syn_resources */ NULL, /* num_syn_resources */ 0, /* parent_process */ XmInheritParentProcess, /* extension */ (XtPointer) NULL }, { /* EPak Tab Box Fields */ /* extension */ (XtPointer) NULL } }; WidgetClass xmTabCanvasWidgetClass = (WidgetClass) &xmTabCanvasClassRec; WidgetClass xmTabBoxWidgetClass = (WidgetClass) &xmTabBoxClassRec; static void #ifndef _NO_PROTO TabCanvasClassInitialize(void) #else TabCanvasClassInitialize() #endif { /* do nothing */ } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmTABBOX_BIT); } static void #ifndef _NO_PROTO ClassInitialize(void) #else ClassInitialize() #endif { XtSetTypeConverter(XmRString, XmRTabOrientation, CvtStringToTabOrientation, NULL, 0, XtCacheNone, NULL); XtSetTypeConverter(XmRString, XmRTabStyle, CvtStringToTabStyle, NULL, 0, XtCacheNone, NULL); XtSetTypeConverter(XmRString, XmRTabMode, CvtStringToTabMode, NULL, 0, XtCacheNone, NULL); XtSetTypeConverter(XmRString, XmRTabEdge, CvtStringToTabEdge, NULL, 0, XtCacheNone, NULL); XtSetTypeConverter(XmRString, XmRTabSide, CvtStringToTabSide, NULL, 0, XtCacheNone, NULL); #ifdef SCROLLED_LAYOUT XtSetTypeConverter(XmRString, XmRTabArrowPlacement, CvtStringToArrowPlacement, NULL, 0, XtCacheNone, NULL); #endif XtSetTypeConverter(XmRString, XmRTabList, CvtStringToTabList, NULL, 0, XtCacheNone, CvtDestroyTabList); } static void #ifndef _NO_PROTO Initialize(Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) #else Initialize(request, set, arg_list, arg_cnt) Widget request, set; ArgList arg_list; Cardinal *arg_cnt; #endif { XmTabBoxWidget st = (XmTabBoxWidget) set; XRectangle want; ArgList filtered_args; Cardinal num_filtered_args; XmTabBox__inited(st) = False; /* * Lets start by first making a copy of our TabList. We do this so * that we are not sharing memory with the user. */ XmTabBox_tab_list(st) = XmTabbedStackListCopy(XmTabBox_tab_list(st)); /* * Now lets see if the creator set our font list and if not lets * grab the default. */ if( XmTabBox_font_list(st) == NULL ) { XmTabBox_font_list(st) = XmeGetDefaultRenderTable((Widget) st, XmLABEL_FONTLIST); } XmTabBox_font_list(st) = XmFontListCopy(XmTabBox_font_list(st)); _XmFilterArgs(arg_list, *arg_cnt, xm_std_filter, &filtered_args, &num_filtered_args); XmTabBox__canvas(st) = XtCreateManagedWidget("canvas", xmTabCanvasWidgetClass, set, filtered_args, num_filtered_args); #ifdef SCROLLED_LAYOUT XmTabBox__left_arrow(st) = XtCreateWidget("leftArrow", xmArrowButtonWidgetClass, set, filtered_args, num_filtered_args); XmTabBox__right_arrow(st) = XtCreateWidget("rightArrow", xmArrowButtonWidgetClass, set, filtered_args, num_filtered_args); #endif XtFree((XtPointer)filtered_args); XmTabBox__bitmap(st) = XmUNSPECIFIED_PIXMAP; XmTabBox__bitmap_width(st) = XmTabBox__bitmap_height(st) = 0; XmTabBox__zero_GC(st) = NULL; XmTabBox__one_GC(st) = NULL; XmTabBox__tab_GC(st) = NULL; XmTabBox__text_GC(st) = NULL; XmTabBox__wanted(st) = (XRectangle*) NULL; XmTabBox__num_wanted(st) = 0; XmTabBox__actual(st) = (XiTabRect*) NULL; XmTabBox__num_actual(st) = 0; XmTabBox__scroll_x(st) = 0; XmTabBox__selected(st) = -1; XmTabBox__keyboard(st) = -1; XmTabBox__armed_tab(st) = -1; XmTabBox__num_columns(st) = 0; XmTabBox__num_rows(st) = 0; XmTabBox__gray_stipple(st) = XmGetPixmapByDepth(XtScreen(st), "50_foreground", 1, 0, 1); XmTabBox__cache(st) = NULL; XmTabBox__cache_size(st) = 0; CalcCornerSize(st); CalcGeometry(st, &want); if( XtWidth(request) == 0 ) { set->core.width = want.width; } if( XtHeight(request) == 0 ) { set->core.height = want.height; } Resize((Widget) st); XmTabBox__inited(st) = True; } static void Realize(Widget widget, XtValueMask *value_mask, XSetWindowAttributes *attributes) { XmTabBoxWidget tb = (XmTabBoxWidget) widget; XGCValues gcValues; XFontStruct *font = NULL; XtGCMask gcMask; XtRealizeProc realize; _XmProcessLock(); realize = xmTabBoxWidgetClass->core_class.superclass->core_class.realize; _XmProcessUnlock(); (*realize) (widget, value_mask, attributes); /* * Now lets create a GC that we will use for drawing. We create * this GC as opposed to share it because we will be changing * attributes of it a, what seems like, random. */ XmeRenderTableGetDefaultFont(XmTabBox_font_list(tb), &font); gcValues.background = tb->core.background_pixel; gcMask = GCBackground; if (font) { gcValues.font = font->fid; gcMask |= GCFont; } /* CR03128 */ XmTabBox__tab_GC(tb) = XmTabBox__text_GC(tb) = XtGetGC(widget, gcMask, &gcValues); } static void #ifndef _NO_PROTO Destroy(Widget widget) #else Destroy(widget) Widget widget; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; XmTabbedStackListFree(XmTabBox_tab_list(tab)); XmFontListFree(XmTabBox_font_list(tab)); if( ValidPixmap(XmTabBox__bitmap(tab)) ) { XFreePixmap(XtDisplay(tab), XmTabBox__bitmap(tab)); } if( XmTabBox__zero_GC(tab) != NULL ) { XFreeGC(XtDisplay(tab), XmTabBox__zero_GC(tab)); } if( XmTabBox__one_GC(tab) != NULL ) { XFreeGC(XtDisplay(tab), XmTabBox__one_GC(tab)); } if( ValidPixmap(XmTabBox__gray_stipple(tab)) ) { XmDestroyPixmap(XtScreen(tab), XmTabBox__gray_stipple(tab)); } if( XmTabBox__cache(tab) != NULL ) { FreeImageCache(tab); } /* CR03218 */ if(XmTabBox__tab_GC(tab)) XtReleaseGC((Widget)tab, XmTabBox__tab_GC(tab)); XtFree((XtPointer) XmTabBox__actual(tab)); XtFree((XtPointer) XmTabBox__wanted(tab)); } static void #ifndef _NO_PROTO Resize(Widget widget) #else Resize(widget) Widget widget; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; Layout(tab); XtConfigureWidget(XmTabBox__canvas(tab), 0, 0, XtWidth(tab), XtHeight(tab), 0); if( XtIsRealized(XmTabBox__canvas(tab)) ) { XClearWindow(XtDisplay(widget), XiCanvas(tab)); Redisplay(XmTabBox__canvas(tab), NULL, False); } } static void #ifndef _NO_PROTO Redisplay(Widget widget, XEvent *event, Region region) #else Redisplay(widget, event, region) Widget widget; XEvent *event; Region region; #endif { Widget parent; XmTabBoxWidget tab = (XmTabBoxWidget) XtParent(widget); XmTabbedStackList list = XmTabBox_tab_list(tab); int count = _XmTabbedStackListCount(list), shadow = tab->manager.shadow_thickness; GC gc = XmTabBox__tab_GC(tab); Pixel pixel= 0 ; Pixmap pixmap= 0 ; XGCValues gcValues; /* CR03218 begin */ Boolean getNewGC = False; if(gc) { XGetGCValues(XtDisplay(widget), gc, GCBackground, &gcValues); if (tab->core.background_pixel != gcValues.background) { XtReleaseGC(widget, gc); getNewGC = True; } } else getNewGC = True; if (getNewGC) { XFontStruct *font = NULL; XtGCMask gcMask; XmeRenderTableGetDefaultFont(XmTabBox_font_list(tab), &font); gcValues.background = tab->core.background_pixel; gcMask = GCBackground; if (font) { gcValues.font = font->fid; gcMask |= GCFont; } XmTabBox__tab_GC(tab) = XmTabBox__text_GC(tab) = XtGetGC((Widget)tab, gcMask, &gcValues); } /* CR03218 end */ if( XmTabBox__inited(tab) == False ) return; /* * The first thing we want to do is fill in our background with the * same color/pixmap our parent has. This will give us a "see-through" * appearance. */ parent = XtParent(tab); /* * If our parent happens to be a tab stack then we know that we * actually want to look at the background of its parent. */ if( XmIsTabStack(parent) ) { parent = XtParent(parent); pixmap = parent->core.background_pixmap; pixel = parent->core.background_pixel; /* * If we are the grand child of a tab stack then we want to use * the background color of the active child. */ if( XmIsTabStack(parent) ) { XmTabStackWidget ts = (XmTabStackWidget) parent; Widget child; if( (child = ts->tab_stack._active_child) != NULL && XiChildSpecified(child) ) { pixel = XmTabStackC_tab_background(child); if( ValidPixmap(XmTabStackC_tab_background_pixmap(child)) ) { pixmap = XmTabStackC_tab_background_pixmap(child); } else { pixmap = XmUNSPECIFIED_PIXMAP; } } } } if( ValidPixmap(pixmap) ) { Widget kid; int x = 0, y = 0; /* * What we need to do here is find out the offset for the * tile. To do this we need to walk up our hierarchy until * we come accross our parent. */ for( kid = widget; kid != parent; kid = XtParent(kid) ) { x += kid->core.x; y += kid->core.y; } SetTiledXYGC(XtDisplay(tab), gc, pixmap, -x, -y); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } /* * Well if we have a region then lets set our clipping region so we * confine our drawing to that area. */ if( region != False ) { XSetRegion(XtDisplay(tab), XmTabBox__tab_GC(tab), region); XSetRegion(XtDisplay(tab), tab->manager.bottom_shadow_GC, region); XSetRegion(XtDisplay(tab), tab->manager.top_shadow_GC, region); XSetRegion(XtDisplay(tab), tab->manager.background_GC, region); } else { XSetClipMask(XtDisplay(tab), gc, None); XSetClipMask(XtDisplay(tab), tab->manager.bottom_shadow_GC, None); XSetClipMask(XtDisplay(tab), tab->manager.top_shadow_GC, None); XSetClipMask(XtDisplay(tab), tab->manager.background_GC, None); } if( XmTabBox_tab_mode(tab) != XmTABS_STACKED && XmTabBox_tab_mode(tab) != XmTABS_STACKED_STATIC ) { if( event == NULL || event->xany.type != Expose ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, 0, 0, XtWidth(widget), XtHeight(widget)); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, event->xexpose.x, event->xexpose.y, event->xexpose.width, event->xexpose.height); } } /* * Lets check something real quick first. If we do not have any * tabs then what we want to do is just draw a shadow line as an * edge. */ if( count == 0 ) { /* * It seems that we have no tabs so lets draw just the shadow * line with the correct GC in the correct place. */ switch( XmTabBox_tab_edge(tab) ) { case XmTAB_EDGE_BOTTOM_RIGHT: default: /* * Well if appears that we need to draw the shadow line either * on the bottom or the right so lets check our orientation * to decide which one. */ if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { /* * Here we need to draw a shadow along the bottom * edge of our window and a beveled corner on the * right side. */ XFillRectangle(XtDisplay(widget), XtWindow(widget), tab->manager.top_shadow_GC, 0, (int)XtHeight(widget) - shadow, XtWidth(widget), shadow); XmDrawBevel(XtDisplay(widget), XtWindow(widget), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, (int)XtWidth(widget) - shadow, (int)XtHeight(widget) - shadow, shadow, XmBEVEL_BOTH); } else { /* * Here we need to draw a shadow along the right side and * a beveled corner on the bottom. */ XFillRectangle(XtDisplay(widget), XtWindow(widget), tab->manager.top_shadow_GC, (int)XtWidth(widget) - shadow, 0, shadow, XtHeight(widget)); XmDrawBevel(XtDisplay(widget), XtWindow(widget), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, (int)XtWidth(widget) - shadow, (int)XtHeight(widget) - shadow, shadow, XmBEVEL_BOTH); } break; case XmTAB_EDGE_TOP_LEFT: /* * Well if appears that we need to draw the shadow line either * on the top or the left side so lets check our orientation * to decide which one. */ if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { /* * Here we need to draw a line across the top of our * window and a corner in the left. */ XFillRectangle(XtDisplay(widget), XtWindow(widget), tab->manager.bottom_shadow_GC, 0, 0, XtWidth(widget), shadow); XmDrawBevel(XtDisplay(widget), XtWindow(widget), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, 0, 0, shadow, XmBEVEL_BOTH); } else { /* * Here we need a shadow along our windows left edge and * a coner towards the top. */ XFillRectangle(XtDisplay(widget), XtWindow(widget), tab->manager.bottom_shadow_GC, 0, 0, shadow, XtHeight(widget)); XmDrawBevel(XtDisplay(widget), XtWindow(widget), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, 0, 0, shadow, XmBEVEL_BOTH); } break; } if( region != False ) { XSetClipMask(XtDisplay(tab), XmTabBox__tab_GC(tab), None); XSetClipMask(XtDisplay(tab), tab->manager.bottom_shadow_GC, None); XSetClipMask(XtDisplay(tab), tab->manager.top_shadow_GC, None); XSetClipMask(XtDisplay(tab), tab->manager.background_GC, None); } return; } /* * Well if we have a region then lets set our clipping region so we * confine our drawing to that area. */ if( region != False ) { XSetRegion(XtDisplay(tab), XmTabBox__tab_GC(tab), region); XSetRegion(XtDisplay(tab), tab->manager.bottom_shadow_GC, region); XSetRegion(XtDisplay(tab), tab->manager.top_shadow_GC, region); XSetRegion(XtDisplay(tab), tab->manager.background_GC, region); } /* * Call this handy dandy tab redisplay routine. This is kindof the * equivalent to XmRedisplayGadgets. */ RedisplayTabs(tab, region); /* * Now lets do the orientation/mode dependant redisplay part. */ if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: HorizontalBasicRedisplay(tab); break; case XmTABS_STACKED: case XmTABS_STACKED_STATIC: HorizontalStackedRedisplay(tab); break; case XmTABS_OVERLAYED: break; case XmTABS_SCROLLED: break; } } else { switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: VerticalBasicRedisplay(tab); break; case XmTABS_STACKED: case XmTABS_STACKED_STATIC: VerticalStackedRedisplay(tab); break; case XmTABS_OVERLAYED: break; case XmTABS_SCROLLED: break; } } /* * If we set a clipping are, be sure to unset it since we are probably * using shared GCs. */ if( region != False ) { XSetClipMask(XtDisplay(tab), XmTabBox__tab_GC(tab), None); XSetClipMask(XtDisplay(tab), tab->manager.bottom_shadow_GC, None); XSetClipMask(XtDisplay(tab), tab->manager.top_shadow_GC, None); XSetClipMask(XtDisplay(tab), tab->manager.background_GC, None); } } #define cfield(f) XmTabBox_##f(c_tab) #define rfield(f) XmTabBox_##f(r_tab) #define sfield(f) XmTabBox_##f(s_tab) static Boolean #ifndef _NO_PROTO SetValues(Widget current, Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) #else SetValues(current, request, set, arg_list, arg_cnt) Widget current, request, set; ArgList arg_list; Cardinal *arg_cnt; #endif { XmTabBoxWidget c_tab = (XmTabBoxWidget) current, s_tab = (XmTabBoxWidget) set; Boolean need_layout = False, need_resize = False, clear_cache = False; ArgList filtered_args = NULL; Cardinal num_filtered_args = 0; /* * First lets start by passing down our resources to our children. */ if( XmTabBox__inited(s_tab) && XmTabBox__canvas(s_tab) != NULL ) { _XmFilterArgs(arg_list, *arg_cnt, xm_std_filter, &filtered_args, &num_filtered_args); XtSetValues(XmTabBox__canvas(s_tab), filtered_args, num_filtered_args); #ifdef SCROLLED_LAYOUT XtSetValues(XmTabBox__left_arrow(s_tab), filtered_args, num_filtered_args); XtSetValues(XmTabBox__right_arrow(s_tab), filtered_args, num_filtered_args); #endif XtFree((XtPointer)filtered_args); } if( XmTabBox_tab_list(c_tab) != XmTabBox_tab_list(s_tab) ) { if( XmTabbedStackListCompare(XmTabBox_tab_list(s_tab), XmTabBox_tab_list(c_tab)) == XmTAB_CMP_SIZE ) { clear_cache = True; need_resize = True; } XmTabbedStackListFree(XmTabBox_tab_list(c_tab)); XmTabBox_tab_list(c_tab) = (XmTabbedStackList) NULL; XmTabBox_tab_list(s_tab) = XmTabbedStackListCopy(XmTabBox_tab_list(s_tab)); CalcTabGeometry(s_tab); need_layout = True; } if( sfield(_selected) > _XmTabbedStackListCount(sfield(tab_list)) ) { sfield(_selected) = -1; if( _XmTabbedStackListCount(sfield(tab_list)) > 0 ) { sfield(_selected) = 0; } need_layout = True; } if( sfield(_keyboard) > _XmTabbedStackListCount(sfield(tab_list)) ) { sfield(_keyboard) = -1; if( _XmTabbedStackListCount(sfield(tab_list)) > 0 ) { sfield(_keyboard) = 0; } need_layout = True; } if( sfield(selected_index) != -1 || sfield(traversal_index) != -1 ) { sfield(_selected) = sfield(selected_index); sfield(_keyboard) = sfield(traversal_index); sfield(selected_index) = -1; sfield(traversal_index) = -1; need_layout = True; } if( cfield(font_list) != sfield(font_list) ) { XmFontListFree(cfield(font_list)); cfield(font_list) = (XmFontList) NULL; if( sfield(font_list) == NULL ) { sfield(font_list) = XmeGetDefaultRenderTable(set, XmLABEL_FONTLIST); } sfield(font_list) == XmFontListCopy(sfield(font_list)); need_layout = True; need_resize = True; } if( c_tab->manager.shadow_thickness != s_tab->manager.shadow_thickness || cfield(tab_style) != sfield(tab_style) || cfield(tab_mode) != sfield(tab_mode) || cfield(tab_orientation) != sfield(tab_orientation) || cfield(orientation) != sfield(orientation) || cfield(uniform_tab_size) != sfield(uniform_tab_size) || cfield(tab_margin_width) != sfield(tab_margin_width) || cfield(tab_margin_height) != sfield(tab_margin_height) || cfield(tab_label_spacing) != sfield(tab_label_spacing) || cfield(tab_corner_percent) != sfield(tab_corner_percent) || #ifdef SCROLLED_LAYOUT cfield(arrow_placement) != sfield(arrow_placement) || #endif cfield(tab_edge) != sfield(tab_edge) || cfield(tab_offset) != sfield(tab_offset) || cfield(highlight_thickness) != sfield(highlight_thickness) ) { need_layout = True; need_resize = True; } if( cfield(tab_orientation) != sfield(tab_orientation) ) { clear_cache = True; } if( cfield(use_image_cache) != sfield(use_image_cache) ) { if( sfield(use_image_cache) ) { clear_cache = True; } else { FreeImageCache(s_tab); clear_cache = False; } } if( clear_cache ) ResetImageCache(s_tab); if( need_layout ) { Resize(set); } /* * Now lets check to see if we are supposed to pick a new size, and * if we are lets find out that size. */ if( need_resize ) { XRectangle geom; CalcGeometry(s_tab, &geom); /* * Now that we know the size that we want to be lets set the * width and height for ourselves so the geometry can be * passed up to our parent. If that size is accepted we * should get a resize callback. */ if( XtWidth(request) == XtWidth(current) ) { s_tab->core.width = geom.width; } if( XtHeight(request) == XtHeight(current) ) { s_tab->core.height = geom.height; } } return( need_layout || need_resize ); } #undef cfield #undef rfield #undef sfield static XtGeometryResult #ifndef _NO_PROTO QueryGeometry(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *allowed) #else QueryGeometry(widget, request, allowed) Widget widget; XtWidgetGeometry *request, *allowed; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; XRectangle rect; /* * Lets start with the easy case. If they gave us nothing then * lets return to them the geometry that we really want. */ if( request == NULL || request->request_mode == 0 ) { CalcGeometry(tab, &rect); allowed->request_mode = CWWidth | CWHeight; allowed->width = rect.width; allowed->height = rect.height; return( XtGeometryAlmost ); } /* * If we got here that means that they are asking us something so * lets see what they want. We will first check if they are * inquering about something other then width and height, because * we only care about width and height. If they give us something * else we will gladly accept it. */ if( !(request->request_mode & (CWWidth | CWHeight)) ) { /* * Ok it appears that they only care about attributes that we * do not care about so lets just return them a big YES. */ return( XtGeometryYes ); } /* * Now comes the big work. It appears that they gave us a partial * or suggested geometry and they want to know how we will react to * that geometry. Since we have an orientation we will take our * major dimension and give that priority. */ *allowed = *request; allowed->request_mode |= (CWWidth | CWHeight); if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { if( request->request_mode & CWWidth ) { /* * They gave us a width so lets take that width and figure * out our minor dimension using that width. */ allowed->height = CalcGeometryMinor(tab, (int)request->width); } else if( request->request_mode & CWHeight ) { /* * Well it looks like they gave us the minor geometry they * want us to fit into so lets calculate the major. */ allowed->width = CalcGeometryMinor(tab, (int)request->height); } } else { if( request->request_mode & CWHeight ) { /* * They gave us a height so lets take that height and figure * out our minor dimension using that height. */ allowed->width = CalcGeometryMinor(tab, (int)request->height); } else if( request->request_mode & CWWidth ) { /* * Well it looks like they gave us the minor geometry they * want us to fit into so lets calculate the major. */ allowed->height = CalcGeometryMajor(tab, request->width); } } if( XmCompareXtWidgetGeometryToWidget(allowed, widget) ) { return( XtGeometryNo ); } if( XmCompareXtWidgetGeometry(request, allowed) ) return( XtGeometryYes ); return( XtGeometryAlmost ); } #define XmTAB_HIGHLIGHT_RECT 0 #define XmTAB_TEXT_RECT 1 static XRectangle* #ifndef _NO_PROTO GetTabRectangle(XmTabBoxWidget tab, int type, XiTabRect *draw) #else GetTabRectangle(tab, type, draw) XmTabBoxWidget tab; int type; XiTabRect *draw; #endif { static XRectangle rect; int highlight = XmTabBox_highlight_thickness(tab), shadow = tab->manager.shadow_thickness, margin_height = XmTabBox_tab_margin_height(tab), margin_width = XmTabBox_tab_margin_width(tab), spacing = XmTabBox_tab_label_spacing(tab), size, horiz, vert; if( draw == NULL ) { if( XmTabBox__keyboard(tab) >= 0 ) { draw = &(XmTabBox__actual(tab)[XmTabBox__keyboard(tab)]); } else { rect.x = rect.y = 0; rect.width = rect.height = 0; } } size = XmTabBox__corner_size(tab); if( draw->width < draw->height ) { AssignMin(size,(int)(draw->width/2)); } else { AssignMin(size,(int)draw->height/2); } margin_width += shadow; margin_height += shadow; if( type == XmTAB_HIGHLIGHT_RECT ) { horiz = Max(size, margin_width); vert = Max(size, margin_height); } else { horiz = Max(size, margin_width) + highlight + spacing; vert = Max(size, margin_height) + highlight + spacing; } switch( XmTabBox_tab_orientation(tab) ) { case XmTABS_LEFT_TO_RIGHT: case XmTABS_RIGHT_TO_LEFT: default: break; case XmTABS_TOP_TO_BOTTOM: case XmTABS_BOTTOM_TO_TOP: { int tmp = horiz; horiz = vert; vert = tmp; } break; } rect.x = draw->x + horiz; rect.y = draw->y + vert; rect.width = draw->width - (2 * horiz); rect.height = draw->height - (2 * vert); return( &rect ); } static void #ifndef _NO_PROTO DrawBorder(XmTabBoxWidget tab, GC gc, int idx) #else DrawBorder(tab, gc, idx) XmTabBoxWidget tab; GC gc; int idx; #endif { int highlight = XmTabBox_highlight_thickness(tab); XiTabRect *geometry; XRectangle *draw, rect[4]; XmTabAttributes info; if( idx < 0 ) { if( XmTabBox__keyboard(tab) < 0 ) return; geometry = &(XmTabBox__actual(tab)[XmTabBox__keyboard(tab)]); idx = XmTabBox__keyboard(tab); } else { geometry = &(XmTabBox__actual(tab)[idx]); } if( gc == tab->manager.background_GC && (((info = _XmTabbedStackListGet(XmTabBox_tab_list(tab), idx)) != NULL && XiBackgroundSpecified(info)) || (idx == XmTabBox__selected(tab) && XiSelectSpecified(tab))) ) { gc = XmTabBox__tab_GC(tab); if( idx == XmTabBox__selected(tab) && XiSelectSpecified(tab) ) { SetSelectGC(tab, gc); } else { SetBackgroundGC(tab, info, gc); } } draw = GetTabRectangle(tab, XmTAB_HIGHLIGHT_RECT, geometry); rect[0].x = draw->x; rect[0].y = draw->y; rect[0].width = Max((int)draw->width, 1); rect[0].height = highlight; rect[1].x = rect[0].x; rect[1].y = rect[0].y; rect[1].width = highlight; rect[1].height = Max((int)draw->height, 1); rect[2].x = rect[0].x + (int)draw->width - highlight; rect[2].y = rect[0].y; rect[2].width = highlight; rect[2].height = Max((int)draw->height, 1); rect[3].x = rect[0].x; rect[3].y = rect[0].y + (int)draw->height - highlight; rect[3].width = Max((int)draw->width, 1); rect[3].height = highlight; XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, 4); } static void #ifndef _NO_PROTO BorderHighlight(Widget widget) #else BorderHighlight(widget) Widget widget; #endif { XmTabBoxWidget tab = XiTabParent(widget); DrawBorder(tab, tab->manager.highlight_GC, -1); } static void #ifndef _NO_PROTO BorderUnhighlight(Widget widget) #else BorderUnhighlight(widget) Widget widget; #endif { XmTabBoxWidget tab = XiTabParent(widget); DrawBorder(tab, tab->manager.background_GC, -1); } /* * Function: * XmTabBoxArmAndActivate(widget, event, params, num_params) * Description: * This action is activate when keyboard traversal is used to * select a tab. This action selects the tabs and calls the * unselect and select callbacks. * Input: * widget : Widget - the XiTabCanvas * event : XEvent* - unused * params : String* - unused * num_params : Cardinal* - unused * Output: * None. */ /* ARGSUSED */ static void #ifndef _NO_PROTO XmTabBoxArmAndActivate(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxArmAndActivate(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int old = XmTabBox__selected(tab), idx = XmTabBox__keyboard(tab); SelectTab(tab, event, old, idx); } /* ARGSUSED */ static void #ifndef _NO_PROTO XmTabBoxArmTab(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxArmTab(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int old, idx; XmProcessTraversal(widget, XmTRAVERSE_CURRENT); if( event == NULL || event->xany.type != ButtonPress ) return; idx = XmTabBox__armed_tab(tab) = XiXYtoTab(tab, event->xbutton.x, event->xbutton.y); if( !IsTabSensitive(tab, idx) ) return; XmTabBox__armed_tab(tab) = idx; old = XmTabBox__keyboard(tab); if( idx != -1 && idx != old ) { DrawBorder(tab, tab->manager.background_GC, old); DrawBorder(tab, tab->manager.highlight_GC, idx); XmTabBox__keyboard(tab) = idx; } } /* * Function: * XmTabBoxSelected(widget, event, params, num_params) * Description: * This action selects a tab and calls the select and unselect * callbacks. * Input: * widget : Widget - the XiTabCanvas * event : XEvent* - the event that triggered the action * params : String* - unused * num_params : Cardinal* - unused * Output: * None. */ /* ARGSUSED */ static void #ifndef _NO_PROTO XmTabBoxSelectTab(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxSelectTab(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int idx; /* * First lets do a quick check to make sure that we have an event we * can deal with and that we have an armed tab. */ if( event == NULL || event->xany.type != ButtonRelease || XmTabBox__armed_tab(tab) == -1 ) return; /* * Lets find out which tab was activated by converting the event * x, y to a tab index. */ idx = XiXYtoTab(tab, event->xbutton.x, event->xbutton.y); /* * First lets make sure that we are trying to select the right tab * we do this my making sure it is not already selected and by * making sure it is the currently armed tab. */ if( idx == XmTabBox__selected(tab) || idx != XmTabBox__armed_tab(tab) || !IsTabSensitive(tab, idx) ) { XmTabBox__armed_tab(tab) = -1; return; } XmTabBox__armed_tab(tab) = -1; SelectTab(tab, event, XmTabBox__selected(tab), idx); } static void #ifndef _NO_PROTO _XmTabBoxTraverseRight(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else _XmTabBoxTraverseRight(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int old, old_selected, set, col; switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_SCROLLED: case XmTABS_OVERLAYED: default: XmTabBoxTraverseNext(widget, event, params, num_params); return; break; case XmTABS_STACKED: case XmTABS_STACKED_STATIC: old = XmTabBox__keyboard(tab); col = XmTabBox__actual(tab)[old].column; do { set = GetTabIndex(tab, XmTabBox__actual(tab)[old].row, ++col); if( set < 0 ) return; } while( !IsTabSensitive(tab, set) ); if( set < 0 || set == old ) return; old_selected = XmTabBox__selected(tab); XmTabBox__keyboard(tab) = set; DrawBorder(tab, tab->manager.background_GC, old); if( XmTabBox_tab_auto_select(tab) ) { SelectTab(tab, event, old_selected, set); } else { DrawBorder(tab, tab->manager.highlight_GC, set); } break; } } /* argsused */ static void #ifndef _NO_PROTO XmTabBoxTraverseRight(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxTraverseRight(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); if( XmTabBox_orientation(tab) == XmVERTICAL ) { _XmTabBoxTraverseDown(widget, event, params, num_params); } else { _XmTabBoxTraverseRight(widget, event, params, num_params); } } static void #ifndef _NO_PROTO _XmTabBoxTraverseLeft(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else _XmTabBoxTraverseLeft(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int old, old_selected, set, col; switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_SCROLLED: case XmTABS_OVERLAYED: default: XmTabBoxTraversePrevious(widget, event, params, num_params); return; break; case XmTABS_STACKED: case XmTABS_STACKED_STATIC: old = XmTabBox__keyboard(tab); col = XmTabBox__actual(tab)[old].column; do { set = GetTabIndex(tab, XmTabBox__actual(tab)[old].row, --col); if( set < 0 ) return; } while( !IsTabSensitive(tab, set) ); if( set < 0 || set == old ) return; old_selected = XmTabBox__selected(tab); XmTabBox__keyboard(tab) = set; DrawBorder(tab, tab->manager.background_GC, old); if( XmTabBox_tab_auto_select(tab) ) { SelectTab(tab, event, old_selected, set); } else { DrawBorder(tab, tab->manager.highlight_GC, set); } break; } } static void #ifndef _NO_PROTO XmTabBoxTraverseLeft(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxTraverseLeft(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); if( XmTabBox_orientation(tab) == XmVERTICAL ) { _XmTabBoxTraverseUp(widget, event, params, num_params); } else { _XmTabBoxTraverseLeft(widget, event, params, num_params); } } static void #ifndef _NO_PROTO _XmTabBoxTraverseUp(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else _XmTabBoxTraverseUp(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int old, old_selected, set, old_row, new_row; switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_SCROLLED: case XmTABS_OVERLAYED: default: XmTabBoxTraversePrevious(widget, event, params, num_params); return; break; case XmTABS_STACKED: case XmTABS_STACKED_STATIC: old = XmTabBox__keyboard(tab); new_row = old_row = XmTabBox__actual(tab)[old].row; do { if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { do { new_row++; if( XmTabBox_tab_mode(tab) == XmTABS_STACKED && XmTabBox_tab_auto_select(tab) ) { if( new_row >= XmTabBox__num_rows(tab) ) { new_row = 0; } } set = GetTabIndex(tab, new_row, XmTabBox__actual(tab)[old].column); } while( set >= 0 && !IsTabSensitive(tab, set) && new_row != old_row ); } else { do { new_row--; if( XmTabBox_tab_mode(tab) == XmTABS_STACKED && XmTabBox_tab_auto_select(tab) ) { if( new_row < 0 ) { new_row = XmTabBox__num_rows(tab) - 1; } } set = GetTabIndex(tab, new_row, XmTabBox__actual(tab)[old].column); } while( set >= 0 && !IsTabSensitive(tab, set) && new_row != old_row ); } set = GetTabIndex(tab, new_row, XmTabBox__actual(tab)[old].column); } while( new_row >= 0 && new_row < XmTabBox__num_rows(tab) && set < 0 ); if( set < 0 || set == old || new_row == old_row ) return; old_selected = XmTabBox__selected(tab); XmTabBox__keyboard(tab) = set; DrawBorder(tab, tab->manager.background_GC, old); if( XmTabBox_tab_auto_select(tab) ) { SelectTab(tab, event, old_selected, set); } else { DrawBorder(tab, tab->manager.highlight_GC, set); } break; } } static void #ifndef _NO_PROTO XmTabBoxTraverseUp(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxTraverseUp(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); if( XmTabBox_orientation(tab) == XmVERTICAL ) { _XmTabBoxTraverseLeft(widget, event, params, num_params); } else { _XmTabBoxTraverseUp(widget, event, params, num_params); } } static void #ifndef _NO_PROTO _XmTabBoxTraverseDown(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else _XmTabBoxTraverseDown(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int old, old_selected, set, new_row, old_row; switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_SCROLLED: case XmTABS_OVERLAYED: default: XmTabBoxTraverseNext(widget, event, params, num_params); return; break; case XmTABS_STACKED: case XmTABS_STACKED_STATIC: old = XmTabBox__keyboard(tab); new_row = old_row = XmTabBox__actual(tab)[old].row ; do { if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { do { new_row--; if( XmTabBox_tab_mode(tab) == XmTABS_STACKED && XmTabBox_tab_auto_select(tab) ) { if( new_row < 0 ) { new_row = XmTabBox__num_rows(tab) - 1; } } set = GetTabIndex(tab, new_row, XmTabBox__actual(tab)[old].column); } while( set >= 0 && !IsTabSensitive(tab, set) && new_row != old_row ); } else { do { new_row++; if( XmTabBox_tab_mode(tab) == XmTABS_STACKED && XmTabBox_tab_auto_select(tab) ) { if( new_row >= XmTabBox__num_rows(tab) ) { new_row = 0; } } set = GetTabIndex(tab, new_row, XmTabBox__actual(tab)[old].column); } while( set >= 0 && !IsTabSensitive(tab, set) && new_row != old_row ); } set = GetTabIndex(tab, new_row, XmTabBox__actual(tab)[old].column); } while( new_row >= 0 && new_row < XmTabBox__num_rows(tab) && set < 0 ); if( set < 0 || set == old || new_row == old_row ) return; old_selected = XmTabBox__selected(tab); XmTabBox__keyboard(tab) = set; DrawBorder(tab, tab->manager.background_GC, old); if( XmTabBox_tab_auto_select(tab) ) { SelectTab(tab, event, old_selected, set); } else { DrawBorder(tab, tab->manager.highlight_GC, set); } break; } } static void #ifndef _NO_PROTO XmTabBoxTraverseDown(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxTraverseDown(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); if( XmTabBox_orientation(tab) == XmVERTICAL ) { _XmTabBoxTraverseRight(widget, event, params, num_params); } else { _XmTabBoxTraverseDown(widget, event, params, num_params); } } /* ARGSUSED */ static void #ifndef _NO_PROTO XmTabBoxTraversePrevious(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxTraversePrevious(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)), idx, old, tmp, old_selected; if( cnt == 0 ) return; old = XmTabBox__keyboard(tab); old_selected = XmTabBox__selected(tab); idx = old; if( XmTabBox_tab_mode(tab) == XmTABS_STACKED || XmTabBox_tab_mode(tab) == XmTABS_STACKED_STATIC ) { do { tmp = idx; idx = tmp - 1; if( idx < 0 ) idx = cnt - 1; if( idx == tmp ) return; if( XmTabBox_tab_mode(tab) == XmTABS_STACKED || XmTabBox_tab_mode(tab) == XmTABS_STACKED_STATIC ) { if( XmTabBox__actual(tab)[idx].row != XmTabBox__actual(tab)[tmp].row && XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { int row = XmTabBox__actual(tab)[tmp].row + 1, col; if ( row >= XmTabBox__num_rows(tab) ) row = 0; for( col = XmTabBox__num_columns(tab) - 1; col > 0 && (idx = GetTabIndex(tab, row, col)) < 0; --col ); } } } while( !IsTabSensitive(tab, idx) && idx != old ); } else { do { idx = idx - 1; if( idx < 0 ) idx = cnt - 1; } while( !IsTabSensitive(tab, idx) && idx != old ); } if( idx < 0 || idx == old ) return; DrawBorder(tab, tab->manager.background_GC, old); XmTabBox__keyboard(tab) = idx; if( XmTabBox_tab_auto_select(tab) ) { SelectTab(tab, event, old_selected, idx); } else { DrawBorder(tab, tab->manager.highlight_GC, idx); } } /* ARGSUSED */ static void #ifndef _NO_PROTO XmTabBoxTraverseNext(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxTraverseNext(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { XmTabBoxWidget tab = XiTabParent(widget); int cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)), idx, old, tmp, old_selected; if( cnt == 0 ) return; old = XmTabBox__keyboard(tab); old_selected = XmTabBox__selected(tab); idx = old; if( XmTabBox_tab_mode(tab) == XmTABS_STACKED || XmTabBox_tab_mode(tab) == XmTABS_STACKED_STATIC ) { do { tmp = idx; idx = (idx + 1) % cnt; if( XmTabBox__actual(tab)[idx].row != XmTabBox__actual(tab)[tmp].row && XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { int row = XmTabBox__actual(tab)[tmp].row - 1; if( row < 0 ) row = XmTabBox__num_rows(tab) - 1; idx = GetTabIndex(tab, row, 0); } } while( !IsTabSensitive(tab, idx) && idx != old ); } else { do { idx = (idx + 1) % cnt; } while( !IsTabSensitive(tab, idx) && idx != old ); } if( idx < 0 || idx == old ) return; DrawBorder(tab, tab->manager.background_GC, old); XmTabBox__keyboard(tab) = idx; if( XmTabBox_tab_auto_select(tab) ) { SelectTab(tab, event, old_selected, idx); } else { DrawBorder(tab, tab->manager.highlight_GC, idx); } } static void #ifndef _NO_PROTO CalcTabSize(XmTabBoxWidget tab, XmTabAttributes info, XmTabOrientation orientation, XmFontList font_list, int shadow_thickness, int highlight_thickness, int margin_width, int margin_height, int spacing, int corner_size, Dimension *width, Dimension *height) #else CalcTabSize(tab, info, orientation, font_list, shadow_thickness, highlight_thickness, margin_width, margin_height, spacing, corner_size, width, height) XmTabBoxWidget tab; XmTabAttributes info; XmTabOrientation orientation; XmFontList font_list; int shadow_thickness, highlight_thickness, margin_width, margin_height, spacing, corner_size; Dimension *width, *height; #endif { Boolean have_label = False, have_pixmap = False; Dimension _width = 0, _height = 0; /* * First lets take the quick out if we were not given a valid * tab. */ if( info == NULL ) { *width = *height = 0; return; } /* * The size of a tab is determined by the combined geometry of ... * * - Label (if visible) * - Pixmap (if visible) * - highlight border (width/height) * - margins (width/height) * - shadows (width/height) * - corner size * */ /* * Lets first see if we have a visible label string and if so lets * add it to the size of the tab. */ if( info->label_string != NULL && info->pixmap_placement != XmPIXMAP_ONLY ) { Dimension string_width = 0, string_height = 0; /* * We have a label String so lets find out its dimensions and * add them to the size of the tab. */ XmStringExtent(font_list, info->label_string, &string_width, &string_height); _width += string_width; AssignMax(_height, string_height); have_label = True; } /* * Now lets check to see if we have to deal with a pixmap, and if * so lets do that. */ if( ValidPixmap(info->label_pixmap) && info->pixmap_placement != XmPIXMAP_NONE ) { Window window_unused; int int_unused; unsigned int uint_unused, width_return, height_return; /* * We have a pixmap, so lets see what the size of this pixmap * is. */ XGetGeometry(XtDisplay(tab), info->label_pixmap, &window_unused, &int_unused, &int_unused, &width_return, &height_return, &uint_unused, &uint_unused); /* * We will add the geometry for the pixmap to the overall geometry * based on the placement of the pixmap in relation to the * label string. */ switch( info->pixmap_placement ) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: _height += height_return; AssignMax(_width, width_return); break; case XmPIXMAP_RIGHT: case XmPIXMAP_LEFT: case XmPIXMAP_ONLY: _width += width_return; AssignMax(_height, height_return); break; case XmPIXMAP_NONE: default: /* notreached */ break; } have_pixmap = True; } /* * If we have both a label and a pixmap we need to accomidate some * spacing between them so lets check if we have them and add the * space to the appropriate place. */ if( have_label && have_pixmap ) { switch( info->pixmap_placement ) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: _height += spacing; break; case XmPIXMAP_LEFT: case XmPIXMAP_RIGHT: _width += spacing; break; case XmPIXMAP_NONE: case XmPIXMAP_ONLY: default: /* notreached */ break; } } /* * Lets add shadow thickness to our margin, because we are going to * consider both of them to see if we should use them or the * corner size. */ margin_width += shadow_thickness; margin_height += shadow_thickness; /* * Now lets add room for the traversal highlight and margins * around the label/pixmap. */ AssignMax(margin_width, corner_size); AssignMax(margin_height, corner_size); _height += 2 * (highlight_thickness + margin_height + spacing); _width += 2 * (highlight_thickness + margin_width + spacing); /* * Now lets set the result depending on the orientation of the * tab. */ switch( orientation ) { case XmTABS_TOP_TO_BOTTOM: case XmTABS_BOTTOM_TO_TOP: *width = _height; *height = _width; break; default: *width = _width; *height = _height; break; } } static void #ifndef _NO_PROTO CalcUnlimitedGeometry(XmTabBoxWidget tab, XRectangle *geometry) #else CalcUnlimitedGeometry(tab, geometry) XmTabBoxWidget tab; XRectangle *geometry; #endif { XmTabbedStackList list = XmTabBox_tab_list(tab); XmTabAttributes info; int i, count = _XmTabbedStackListCount(list), width, height, max_width, max_height, tab_width, tab_height; Boolean uniform_size; /* * Start by initializing the geometry variables. Although we are * calling these things width and height the may be revered depending * on the orientation of this thing. */ width = height = max_width = max_height = 0; /* * Now lets cashe some values so we don't have to look them up * or calculate them. */ uniform_size = XmTabBox_uniform_tab_size(tab); for( i = 0; i < count; ++i ) { Dimension d_width = 0, d_height = 0; /* * First the easy part, lets grabs tab and calculate its size. */ info = _XmTabbedStackListGet(list, i); XiCalcTabSize(tab, info, &d_width, &d_height); tab_width = (int) d_width; tab_height = (int) d_height; /* * Now that we know the size of this tab, we need to check what * that means. Because if we are going to a uniform look part * of that geometry may be droped. */ if( uniform_size ) { /* * If we are calculating for unform sized tabs then lets * just capture the max width and height of all the tabs * to use in calculations later. */ AssignMax(max_width, tab_width); AssignMax(max_height, tab_height); } else { /* * If we are not doing uniform tabs that means that the * major dimension of the tabs can vary. */ XmTabBox__wanted(tab)[i].width = tab_width; XmTabBox__wanted(tab)[i].height = tab_height; if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { width += tab_width; AssignMax(height, tab_height); } else { height += tab_height; AssignMax(width, tab_width); } } } /* * Now the big check. If we are dealing with uniform size tabs * then we want to calculate the width/height that we need based * on the max_width/max_height of all the tabs. */ if( uniform_size ) { if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { width = count * max_width; height = max_height; } else { height = count * max_height; width = max_width; } for( i = 0; i < count; ++i ) { XmTabBox__wanted(tab)[i].width = max_width; XmTabBox__wanted(tab)[i].height = max_height; } } geometry->width = width; geometry->height = height; } /* * Function: * CalcGeometry(tab, geometry) * Description: * Calculates the desired geometry given no size constraints. * Input: * tab : XmTabBoxWidget - the tab box to work with * geometry : XRectangle* - returns the desired geometry * Output: * None. */ static void #ifndef _NO_PROTO CalcGeometry(XmTabBoxWidget tab, XRectangle *geometry) #else CalcGeometry(tab, geometry) XmTabBoxWidget tab; XRectangle *geometry; #endif { int count = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); /* * Lets start with the easy case. This is the case where we do not * have any tabs. In this case our desired size is simple the * room we need to draw single line shadow. */ if( count == 0 ) { /* * We have no tabs so the size we want is twice our shadow thinkness * in our major dimension and our shadow thickness in our minor * dimension. */ geometry->x = geometry->y = 0; if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { geometry->width = 2 * tab->manager.shadow_thickness; geometry->height = tab->manager.shadow_thickness; } else { geometry->width = tab->manager.shadow_thickness; geometry->height = 2 * tab->manager.shadow_thickness; } /* * One thing before we leave. If we have no tabs lets make * sure to "zero" out the index to the tab with keyboard * traversal and selected. */ XmTabBox__keyboard(tab) = -1; XmTabBox__selected(tab) = -1; /* * Since this is the easy case we are done, so lets just hop * out of this routine. */ return; } /* * The first thing we will do is calculate the size of each of the * tabs. We do this via this handy dandy Tab Calculation routine. */ CalcTabGeometry(tab); /* * Now lets make sure that we have a tab marked for both keyboard * traversal and selected. */ if( XmTabBox__keyboard(tab) < 0 ) XmTabBox__keyboard(tab) = 0; if( XmTabBox__selected(tab) < 0 ) XmTabBox__selected(tab) = 0; switch( XmTabBox_tab_mode(tab) ) { case XmTABS_STACKED: case XmTABS_STACKED_STATIC: CalcStackedGeometry(tab, geometry); break; case XmTABS_BASIC: case XmTABS_SCROLLED: case XmTABS_OVERLAYED: default: CalcUnlimitedGeometry(tab, geometry); break; } if( geometry->width == 0 ) geometry->width = 20; if( geometry->height == 0 ) geometry->height = 20; } static void #ifndef _NO_PROTO DrawSegments(XmTabBoxWidget tab, XmTabAttributes info, XiTabRect *geometry, XmTabEdge edge, int corner_size, int shadow, int selected) #else DrawSegments(tab, info, geometry, edge, corner_size, shadow, selected) XmTabBoxWidget tab; XmTabAttributes info; XiTabRect *geometry; XmTabEdge edge; int corner_size, shadow, selected; #endif { int size, cnt = 2; XRectangle rect[3]; Boolean stacked; GC gc = (GC)NULL; stacked = (XmTabBox_tab_mode(tab) == XmTABS_STACKED || XmTabBox_tab_mode(tab) == XmTABS_STACKED_STATIC); /* * Lets set up the GC used to draw the shadow that may or may not be * visible depending on the selected state. */ if( selected ) { if( XiSelectSpecified(tab) ) { gc = XmTabBox__tab_GC(tab); SetSelectGC(tab, gc); } else { if( XiBackgroundSpecified(info) ) { gc = XmTabBox__tab_GC(tab); SetBackgroundGC(tab, info, gc); } else { gc = tab->manager.background_GC; } } } size = corner_size; switch( edge ) { case XmTAB_EDGE_TOP_LEFT: default: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, geometry->x, geometry->y, shadow, (int) geometry->height - size); rect[0].x = geometry->x + geometry->width - shadow; rect[0].y = geometry->y; rect[0].width = shadow; rect[0].height = (int) geometry->height - size; rect[1].x = geometry->x + size; rect[1].y = geometry->y + (int)geometry->height - shadow; rect[1].width = (int)geometry->width - (2 * size); rect[1].height = shadow; if( !selected && geometry->row == 0 ) { if( (geometry->column == 0 && !LayoutIsRtoLP(tab)) || ((geometry->column == XmTabBox__num_columns(tab)-1) && LayoutIsRtoLP(tab)) ) { rect[2].x = geometry->x + shadow; rect[2].width = (int)geometry->width - shadow; } else { rect[2].x = geometry->x; rect[2].width = geometry->width; } rect[2].y = geometry->y; rect[2].height = shadow; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, rect, cnt); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + shadow, geometry->y, (int)geometry->width - 2*shadow, shadow); if( geometry->row == 0 && ((geometry->column > 0 && !LayoutIsRtoLP(tab)) || ((geometry->column < XmTabBox__num_columns(tab)-1) && LayoutIsRtoLP(tab))) ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTH); } } else if(geometry->row == 0 && ((geometry->column == 0 && !LayoutIsRtoLP(tab)) || ((geometry->column == XmTabBox__num_columns(tab)-1) && LayoutIsRtoLP(tab))) ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTH); } } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, geometry->x, geometry->y, (int)geometry->width - size, shadow); rect[0].x = geometry->x; rect[0].y = geometry->y + (int)geometry->height - shadow; rect[0].width = (int)geometry->width - size; rect[0].height = shadow; rect[1].x = geometry->x + (int)geometry->width - shadow; rect[1].y = geometry->y + size; rect[1].width = shadow; rect[1].height = (int)geometry->height - (2 * size); if( !selected && geometry->row == 0 ) { if( geometry->column == 0 ) { rect[2].y = geometry->y + shadow; rect[2].height = (int)geometry->height - shadow; } else { rect[2].y = geometry->y; rect[2].height = geometry->height; } rect[2].x = geometry->x; rect[2].width = shadow; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, rect, cnt); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x, geometry->y + shadow, shadow, (int)geometry->height - 2*shadow); if( geometry->column != 0 ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTH); } } else if( geometry->row == 0 && geometry->column == 0 ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTTOM); } } break; case XmTAB_EDGE_BOTTOM_RIGHT: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + size, shadow, (int)geometry->height - size); rect[0].x = geometry->x; rect[0].y = geometry->y + size; rect[0].width = shadow; rect[0].height = (int) geometry->height - size; rect[1].x = geometry->x + size; rect[1].y = geometry->y; rect[1].width = (int)geometry->width - (2 * size); rect[1].height = shadow; if( !selected && geometry->row == 0 ) { rect[2].x = geometry->x; rect[2].y = geometry->y + (int)geometry->height - shadow; rect[2].width = geometry->width; rect[2].height = shadow; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, rect, cnt); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + shadow, geometry->y + (int)geometry->height - shadow, (int)geometry->width - 2*shadow, shadow); if( (!stacked && (((geometry->column != XmTabBox__num_columns(tab) - 1) && !LayoutIsRtoLP(tab)) || (geometry->column != 0 && LayoutIsRtoLP(tab)))) || (stacked && geometry->row == 0 && (((geometry->column != XmTabBox__num_columns(tab) - 1) && !LayoutIsRtoLP(tab)) || XmTabBox__num_rows(tab) == 1 || !XmTabBox_stacked_effect(tab))) ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTTOM); } } else if( (stacked && XmTabBox_stacked_effect(tab) && XmTabBox__num_rows(tab) > 1 && geometry->row == 0 && ((geometry->column == XmTabBox__num_columns(tab) - 1 && !LayoutIsRtoLP(tab)) || (geometry->column == 0 && LayoutIsRtoLP(tab)))) || (!stacked && ((geometry->column == XmTabBox__num_columns(tab) - 1 && !LayoutIsRtoLP(tab)) || (geometry->column == 0 && LayoutIsRtoLP(tab))))) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTTOM); } } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, geometry->x + size, geometry->y + (int)geometry->height - shadow, (int)geometry->width - size, shadow); rect[0].x = geometry->x + size; rect[0].y = geometry->y; rect[0].width = (int)geometry->width - size; rect[0].height = shadow; rect[1].x = geometry->x; rect[1].y = geometry->y + size; rect[1].width = shadow; rect[1].height = (int)geometry->height - (2 * size); if( !selected && geometry->row == 0 ) { rect[2].x = geometry->x + (int)geometry->width - shadow; rect[2].y = geometry->y; rect[2].width = shadow; rect[2].height = geometry->height; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, rect, cnt); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + (int)geometry->width - shadow, geometry->y + shadow, shadow, (int)geometry->height - 2*shadow); if( !stacked || (stacked && geometry->row == 0 && (geometry->column != XmTabBox__num_columns(tab) - 1 || XmTabBox__num_rows(tab) == 1 || !XmTabBox_stacked_effect(tab))) ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTTOM); } } else if( stacked && XmTabBox_stacked_effect(tab) && XmTabBox__num_rows(tab) > 1 && geometry->row == 0 && geometry->column == XmTabBox__num_columns(tab) - 1 ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTTOM); } } break; } } static void #ifndef _NO_PROTO DrawSquareShadows(XmTabBoxWidget tab, XmTabAttributes info, XiTabRect *geometry, Boolean selected, XmTabEdge edge, Dimension shadow) #else DrawSquareShadows(tab, info, geometry, selected, edge, shadow) XmTabBoxWidget tab; XmTabAttributes info; XiTabRect *geometry; Boolean selected; XmTabEdge edge; Dimension shadow; #endif { XRectangle rt[3]; GC gc = (GC)NULL; Boolean stacked; int cnt = 2; stacked = (XmTabBox_tab_mode(tab) == XmTABS_STACKED || XmTabBox_tab_mode(tab) == XmTABS_STACKED_STATIC); /* * Lets set up the GC used to draw the shadow that may or may not be * visible depending on the selected state. */ if( selected ) { if( XiSelectSpecified(tab) ) { gc = XmTabBox__tab_GC(tab); SetSelectGC(tab, gc); } else { if( XiBackgroundSpecified(info) ) { gc = XmTabBox__tab_GC(tab); SetBackgroundGC(tab, info, gc); } else { gc = tab->manager.background_GC; } } } switch( edge ) { case XmTAB_EDGE_TOP_LEFT: default: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, geometry->x, geometry->y, shadow, (int)geometry->height - shadow); rt[0].x = geometry->x + (int)geometry->width - shadow; rt[0].y = geometry->y; rt[0].width = shadow; rt[0].height = geometry->height; rt[1].x = geometry->x + shadow; rt[1].y = geometry->y + (int) geometry->height - shadow; rt[1].width = (int)geometry->width - shadow; rt[1].height = shadow; if( !selected && geometry->row == 0 ) { if( (geometry->column == 0 && !LayoutIsRtoL(tab)) || ((geometry->column == XmTabBox__num_columns(tab)-1) && LayoutIsRtoLP(tab))) { rt[2].x = geometry->x + shadow; rt[2].width = (int)geometry->width - shadow; } else { rt[2].x = geometry->x; rt[2].width = geometry->width; } rt[2].y = geometry->y; rt[2].height = shadow; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, rt, cnt); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTH); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + shadow, geometry->y, (int)geometry->width - 2*shadow, shadow); if( geometry->column == 0 && geometry->column > 0 ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTH); } } else if( geometry->row == 0 ) { if (geometry->column == 0 && !LayoutIsRtoLP(tab)) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTTOM); } else if (geometry->column == XmTabBox__num_columns(tab)-1 && LayoutIsRtoLP(tab)) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTTOM); return; } } } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, geometry->x, geometry->y, (int)geometry->width - shadow, shadow); rt[0].x = geometry->x + (int)geometry->width - shadow; rt[0].y = geometry->y + shadow; rt[0].width = shadow; rt[0].height = geometry->height - shadow; rt[1].x = geometry->x; rt[1].y = geometry->y + (int) geometry->height - shadow; rt[1].width = (int)geometry->width - shadow; rt[1].height = shadow; if( !selected && geometry->row == 0 ) { if( geometry->column == 0 ) { rt[2].y = geometry->y + shadow; rt[2].height = (int)geometry->height - shadow; } else { rt[2].y = geometry->y; rt[2].height = geometry->height; } rt[2].x = geometry->x; rt[2].width = shadow; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, rt, cnt); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y, shadow, XmBEVEL_BOTH); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x, geometry->y + shadow, shadow, (int)geometry->height - 2*shadow); if( geometry->column != 0 ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTH); } } else if( geometry->row == 0 && geometry->column == 0 ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y, shadow, XmBEVEL_BOTTOM); } } break; case XmTAB_EDGE_BOTTOM_RIGHT: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y, shadow, (int)geometry->height); rt[0].x = geometry->x; rt[0].y = geometry->y; rt[0].width = shadow; rt[0].height = geometry->height; rt[1].x = geometry->x; rt[1].y = geometry->y; rt[1].width = (int)geometry->width - shadow; rt[1].height = shadow; if( !selected && geometry->row == 0 ) { rt[2].x = geometry->x; rt[2].y = geometry->y + (int)geometry->height - shadow; rt[2].width = geometry->width; rt[2].height = shadow; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, rt, cnt); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y, shadow, XmBEVEL_TOP); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + shadow, geometry->y + (int)geometry->height - shadow, (int)geometry->width - 2*shadow, shadow); if (LayoutIsRtoLP(tab)) { if (geometry->column != 0 && geometry->row == 0) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTH); } } else { if( (!stacked && ((((geometry->column != XmTabBox__num_columns(tab) - 1) && !LayoutIsRtoLP(tab))) || (geometry->column != 0 && LayoutIsRtoLP(tab)))) || (stacked && geometry->row == 0 && (geometry->column != XmTabBox__num_columns(tab) - 1 || (XmTabBox__num_rows(tab) == 1) || !XmTabBox_stacked_effect(tab))) ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTH); } } } else if( (stacked && XmTabBox_stacked_effect(tab) && XmTabBox__num_rows(tab) > 1 && geometry->row == 0 && ((geometry->column == XmTabBox__num_columns(tab) - 1 && !LayoutIsRtoLP(tab)) || (geometry->column == 0 && LayoutIsRtoLP(tab)))) || (!stacked && ((geometry->column == XmTabBox__num_columns(tab) - 1 && !LayoutIsRtoLP(tab)) || (geometry->column == 0 && LayoutIsRtoLP(tab))))) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTTOM); } } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, geometry->x + shadow, geometry->y + (int)geometry->height - shadow, (int)geometry->width - shadow, shadow); rt[0].x = geometry->x; rt[0].y = geometry->y; rt[0].width = shadow; rt[0].height = (int)geometry->height - shadow; rt[1].x = geometry->x; rt[1].y = geometry->y; rt[1].width = geometry->width; rt[1].height = shadow; if( !selected && geometry->row == 0 ) { rt[2].x = geometry->x + (int)geometry->width - shadow; rt[2].y = geometry->y; rt[2].width = shadow; rt[2].height = geometry->height; cnt = 3; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, rt, cnt); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTH); if( selected ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + (int)geometry->width - shadow, geometry->y + shadow, shadow, (int)geometry->height - 2*shadow); if( !stacked || (stacked && geometry->row == 0 && (geometry->column != XmTabBox__num_columns(tab) - 1 || XmTabBox__num_rows(tab) == 1 || !XmTabBox_stacked_effect(tab))) ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTH); } } else if( stacked && XmTabBox_stacked_effect(tab) && XmTabBox__num_rows(tab) > 1 && geometry->row == 0 && geometry->column == XmTabBox__num_columns(tab) - 1 ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - shadow, geometry->y + (int)geometry->height - shadow, shadow, XmBEVEL_BOTTOM); } } break; } } static void #ifndef _NO_PROTO DrawRoundedShadows(XmTabBoxWidget tab, XmTabAttributes info, XiTabRect *geometry, Boolean selected, XmTabEdge edge, int shadow) #else DrawRoundedShadows(tab, info, geometry, selected, edge, shadow) XmTabBoxWidget tab; XmTabAttributes info; XiTabRect *geometry; Boolean selected; XmTabEdge edge; int shadow; #endif { int size; size = XmTabBox__corner_size(tab); if( geometry->width < geometry->height ) { if( size > (int)geometry->width/2 ) size = (int)geometry->width/2; } else { if( size > (int)geometry->height/2 ) size = (int)geometry->height/2; } DrawSegments(tab, info, geometry, edge, size, shadow, selected); switch( edge ) { case XmTAB_EDGE_TOP_LEFT: default: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y + (int)geometry->height - size, size, size, tab->manager.shadow_thickness, XiQUAD_3); XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - size, geometry->y + (int)geometry->height - size, size, size, tab->manager.shadow_thickness, XiQUAD_4); } else { XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - size, geometry->y, size, size, tab->manager.shadow_thickness, XiQUAD_1); XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - size, geometry->y + (int)geometry->height - size, size, size, tab->manager.shadow_thickness, XiQUAD_4); } break; case XmTAB_EDGE_BOTTOM_RIGHT: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x + (int)geometry->width - size, geometry->y, size, size, tab->manager.shadow_thickness, XiQUAD_1); XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y, size, size, tab->manager.shadow_thickness, XiQUAD_2); } else { XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y, size, size, tab->manager.shadow_thickness, XiQUAD_2); XiDrawCorner(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, geometry->x, geometry->y + (int)geometry->height - size, size, size, tab->manager.shadow_thickness, XiQUAD_3); } break; } } static void #ifndef _NO_PROTO DrawBeveledShadows(XmTabBoxWidget tab, XmTabAttributes info, XiTabRect *geometry, Boolean selected, XmTabEdge edge, int shadow) #else DrawBeveledShadows(tab, info, geometry, selected, edge, shadow) XmTabBoxWidget tab; XmTabAttributes info; XiTabRect *geometry; Boolean selected; XmTabEdge edge; int shadow; #endif { int size; XPoint pt[4]; size = XmTabBox__corner_size(tab); if( geometry->width < geometry->height ) { if( size > (int)geometry->width/2 ) size = (int)geometry->width/2; } else { if( size > (int)geometry->height/2 ) size = (int)geometry->height/2; } DrawSegments(tab, info, geometry, edge, size, shadow, selected); switch( edge ) { case XmTAB_EDGE_TOP_LEFT: default: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { pt[0].x = geometry->x; pt[0].y = geometry->y + (int)geometry->height - size; pt[1].x = geometry->x + size; pt[1].y = geometry->y + (int)geometry->height; pt[2].x = geometry->x + size; pt[2].y = geometry->y + (int)geometry->height - shadow; pt[3].x = geometry->x + shadow; pt[3].y = geometry->y + (int)geometry->height - size; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, pt, 4, Convex, CoordModeOrigin); pt[0].x = geometry->x + (int)geometry->width; pt[0].y = geometry->y + (int)geometry->height - size; pt[1].x = geometry->x + (int)geometry->width - size; pt[1].y = geometry->y + (int)geometry->height; pt[2].x = geometry->x + (int)geometry->width - size; pt[2].y = geometry->y + (int)geometry->height - shadow; pt[3].x = geometry->x + (int)geometry->width - shadow; pt[3].y = geometry->y + (int)geometry->height - size; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, pt, 4, Convex, CoordModeOrigin); } else { pt[0].x = geometry->x + (int)geometry->width - size; pt[0].y = geometry->y; pt[1].x = geometry->x + (int)geometry->width; pt[1].y = geometry->y + size; pt[2].x = pt[1].x - shadow; pt[2].y = pt[1].y; pt[3].x = pt[0].x; pt[3].y = pt[0].y + shadow; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, pt, 4, Convex, CoordModeOrigin); pt[0].x = geometry->x + (int)geometry->width - size; pt[0].y = geometry->y + (int)geometry->height; pt[1].x = geometry->x + (int)geometry->width; pt[1].y = geometry->y + (int)geometry->height - size; pt[2].x = pt[1].x - shadow; pt[2].y = pt[1].y; pt[3].x = pt[0].x; pt[3].y = pt[0].y - shadow; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, pt, 4, Convex, CoordModeOrigin); } break; case XmTAB_EDGE_BOTTOM_RIGHT: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { pt[0].x = geometry->x; pt[0].y = geometry->y + size; pt[1].x = geometry->x + size; pt[1].y = geometry->y; pt[2].x = geometry->x + size; pt[2].y = geometry->y + shadow; pt[3].x = geometry->x + shadow; pt[3].y = geometry->y + size; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, pt, 4, Convex, CoordModeOrigin); pt[0].x = geometry->x + (int)geometry->width; pt[0].y = geometry->y + size; pt[1].x = geometry->x + (int)geometry->width - size; pt[1].y = geometry->y; pt[2].x = geometry->x + (int)geometry->width - size; pt[2].y = geometry->y + shadow; pt[3].x = geometry->x + (int)geometry->width - shadow; pt[3].y = geometry->y + size; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, pt, 4, Convex, CoordModeOrigin); } else { pt[0].x = geometry->x + size; pt[0].y = geometry->y; pt[1].x = geometry->x; pt[1].y = geometry->y + size; pt[2].x = pt[1].x + shadow; pt[2].y = pt[1].y; pt[3].x = pt[0].x; pt[3].y = pt[0].y + shadow; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, pt, 4, Convex, CoordModeOrigin); pt[0].x = geometry->x + size; pt[0].y = geometry->y + (int)geometry->height; pt[1].x = geometry->x; pt[1].y = geometry->y + (int)geometry->height - size; pt[2].x = pt[1].x + shadow; pt[2].y = pt[1].y; pt[3].x = pt[0].x; pt[3].y = pt[0].y - shadow; XFillPolygon(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, pt, 4, Convex, CoordModeOrigin); } break; } } static void #ifndef _NO_PROTO DrawTab(XmTabBoxWidget tab, XmTabAttributes info, XiTabRect *geometry, Boolean selected, Boolean keyboard) #else DrawTab(tab, info, geometry, selected, keyboard) XmTabBoxWidget tab; XmTabAttributes info; XiTabRect *geometry; Boolean selected, keyboard; #endif { XmTabEdge edge = XmTabBox_tab_edge(tab); Widget canvas = XmTabBox__canvas(tab); XmFontList font_list = XmTabBox_font_list(tab); Dimension shadow_thickness = tab->manager.shadow_thickness, margin_width = XmTabBox_tab_margin_width(tab), margin_height = XmTabBox_tab_margin_width(tab), size = XmTabBox__corner_size(tab); XRectangle *clip; int pix_width = 0, pix_height = 0, pix_depth = 0, label_width = 0, label_height = 0, row; Boolean have_pixmap = False, have_label = False; GC gc = XmTabBox__tab_GC(tab); XmTabAttributes above; /* * Lets do the quick check here. If we are not realized then there is * really nothing to draw so lets just leave. */ if( !XtIsRealized(canvas) || info == NULL ) return; if( (XmTabBox_tab_mode(tab) == XmTABS_STACKED || XmTabBox_tab_mode(tab) == XmTABS_STACKED_STATIC) && XmTabBox_tab_style(tab) != XmTABS_SQUARED ) { row = geometry->row; do { if( LayoutIsRtoLP(tab) ) above = GetTabInfo(tab, ++row, geometry->column-1); else above = GetTabInfo(tab, ++row, geometry->column); } while( above == NULL && row < XmTabBox__num_rows(tab) ); if( above != NULL ) { /* * Ok, what is happening here is that we are in a stacked layout * and we have a tab that is above us. This means that we * need to fill in our upper corner with this tabs color. */ if( XiBackgroundSpecified(above) ) { SetBackgroundGC(tab, above, gc); } else { if( ValidPixmap(tab->core.background_pixmap) ) { SetTiledXYGC(XtDisplay(tab), gc, tab->core.background_pixmap, -(tab->core.x), -(tab->core.y)); } else { SetSolidGC(XtDisplay(tab), gc, tab->core.background_pixel); } } } else { Widget gcParent = XiGCParent(tab); Pixel pixel; Pixmap pixmap; XtVaGetValues(gcParent, XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledXYGC(XtDisplay(tab), gc, pixmap, -(tab->core.x), -(tab->core.y)); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + geometry->width - size, geometry->y, size, size); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x, geometry->y + geometry->height - size, size, size); } } else { if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + geometry->width - size, geometry->y + geometry->height - size, size, size); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + geometry->width - size, geometry->y + geometry->height - size, size, size); } } row = geometry->row; do { if( LayoutIsRtoLP(tab) ) above = GetTabInfo(tab, ++row, geometry->column); else above = GetTabInfo(tab, ++row, geometry->column - 1); } while( above == NULL && row < XmTabBox__num_rows(tab) ); if( above != NULL ) { /* * Ok, what is happening here is that we are in a stacked layout * and we have a tab that is above us. This means that we * need to fill in our upper corner with this tabs color. */ if( XiBackgroundSpecified(above) ) { SetBackgroundGC(tab, above, gc); } else { if( ValidPixmap(tab->core.background_pixmap) ) { SetTiledXYGC(XtDisplay(tab), gc, tab->core.background_pixmap, -(tab->core.x), -(tab->core.y)); } else { SetSolidGC(XtDisplay(tab), gc, tab->core.background_pixel); } } } else { Widget gcParent = XiGCParent(tab); Pixel pixel; Pixmap pixmap; XtVaGetValues(gcParent, XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledXYGC(XtDisplay(tab), gc, pixmap, -(tab->core.x), -(tab->core.y)); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x, geometry->y, size, size); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x, geometry->y, size, size); } } else { if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x, geometry->y + geometry->height - size, size, size); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, geometry->x + geometry->width - size, geometry->y, size, size); } } } if( selected && XiSelectSpecified(tab) ) { #ifdef FIX_1503 SetSelectGC(tab, XmTabBox__tab_GC(tab)); #else SetSelectGC(tab, tab->manager.background_GC); #endif } else { /* * Lets see if we need to fill in the background color of this tab, or * if it wants the same color as its parent. */ if( XiBackgroundSpecified(info) ) { /* * It appears that this tab wants its background filled in * to a specific color so lets do that. */ #ifdef FIX_1503 SetBackgroundGC(tab, info, XmTabBox__tab_GC(tab)); #else SetBackgroundGC(tab, info, tab->manager.background_GC); #endif } else { if( ValidPixmap(tab->core.background_pixmap) ) { SetTiledXYGC(XtDisplay(tab), gc, tab->core.background_pixmap, -(tab->core.x), -(tab->core.y)); } else { SetSolidGC(XtDisplay(tab), gc, tab->core.background_pixel); } } } switch( XmTabBox_tab_style(tab) ) { case XmTABS_SQUARED: #ifdef FIX_1503 XFillRectangle(XtDisplay(tab), XiCanvas(tab), XmTabBox__tab_GC(tab), geometry->x, geometry->y, geometry->width, geometry->height); #else XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.background_GC, geometry->x, geometry->y, geometry->width, geometry->height); #endif break; case XmTABS_ROUNDED: #ifdef FIX_1503 FillRoundedTab(tab, XmTabBox__tab_GC(tab), geometry, edge); #else FillRoundedTab(tab, tab->manager.background_GC, geometry, edge); #endif break; case XmTABS_BEVELED: #ifdef FIX_1503 FillBeveledTab(tab, XmTabBox__tab_GC(tab), geometry, edge); #else FillBeveledTab(tab, tab->manager.background_GC, geometry, edge); #endif break; } /* * The first thing that we will draw is the shadows around the tab. * We have a lot of nifty routines to do this. Maybe will add more * someday. */ switch( XmTabBox_tab_style(tab) ) { case XmTABS_SQUARED: DrawSquareShadows(tab, info, geometry, selected, edge, shadow_thickness); break; case XmTABS_ROUNDED: DrawRoundedShadows(tab, info, geometry, selected, edge, shadow_thickness); break; case XmTABS_BEVELED: DrawBeveledShadows(tab, info, geometry, selected, edge, shadow_thickness); break; default: break; } gc = XmTabBox__text_GC(tab); /* * Now comes the hard part we need to draw the label. The label * consists of an XmString and a pixmap, both of which are optional. * * First lets calculate the size of both the label and the pixmap * so that we can calculate the amount of space we will need to * display the entire tab label. */ if( ValidPixmap(info->label_pixmap) && info->pixmap_placement != XmPIXMAP_NONE ) { Window window_unused; int int_unused; unsigned int uint_unused, width_return, height_return, depth_return; have_pixmap = True; XGetGeometry(XtDisplay(tab), info->label_pixmap, &window_unused, &int_unused, &int_unused, &width_return, &height_return, &uint_unused, &depth_return); pix_depth = depth_return; pix_width = width_return; pix_height = height_return; } else { pix_depth = 0; pix_width = 0; pix_height = 0; } if( info->label_string != NULL && info->pixmap_placement != XmPIXMAP_ONLY ) { Dimension string_width, string_height; have_label = True; XmStringExtent(font_list, info->label_string, &string_width, &string_height); label_width = string_width; label_height = string_height; } else { label_width = 0; label_height = 0; } SetSolidGC(XtDisplay(tab), gc, (info->foreground == XmCOLOR_DYNAMIC ? tab->manager.foreground : info->foreground)); margin_width += shadow_thickness; margin_height += shadow_thickness; AssignMax(margin_width, size); AssignMax(margin_height, size); /* * Now lets calculate the cliping rectangle for the area in which * text and images can be drawn. And since all we have left * to draw is text and images lets assign this rectangle as the * cliping area for our drawing GC. */ clip = GetTabRectangle(tab, XmTAB_TEXT_RECT, geometry); XSetClipRectangles(XtDisplay(tab), gc, 0, 0, clip, 1, YXBanded); switch( XmTabBox_tab_orientation(tab) ) { case XmTABS_LEFT_TO_RIGHT: default: DrawLeftToRightTab(tab, info, gc, have_pixmap, pix_width, pix_height, pix_depth, have_label, label_width, label_height, clip); break; case XmTABS_RIGHT_TO_LEFT: DrawRightToLeftTab(tab, info, gc, have_pixmap, pix_width, pix_height, pix_depth, have_label, label_width, label_height, clip, selected); break; case XmTABS_TOP_TO_BOTTOM: DrawTopToBottomTab(tab, info, gc, have_pixmap, pix_width, pix_height, pix_depth, have_label, label_width, label_height, clip, selected); break; case XmTABS_BOTTOM_TO_TOP: DrawBottomToTopTab(tab, info, gc, have_pixmap, pix_width, pix_height, pix_depth, have_label, label_width, label_height, clip, selected); break; } /* * The final bit of draw we have to do is to add the highlight * border to the tab if it currently has keyboard traversal. */ if( keyboard && Prim_HaveTraversal(XmTabBox__canvas(tab)) ) { BorderHighlight(XmTabBox__canvas(tab)); } /* * Now that our drawing is done lets be sure to zero out the * clipping area for our GC. */ XSetClipMask(XtDisplay(tab), gc, None); } #define XiCvtDone(type, value) \ { \ if( to->addr != NULL ) \ { \ if( to->size < sizeof(type) ) \ { \ to->size = sizeof(type); \ return( False ); \ } \ *(type*)(to->addr) = (value); \ } \ else \ { \ static type static_val; \ static_val = (value); \ to->addr = (XtPointer) &static_val; \ } \ to->size = sizeof(type); \ return( True ); \ } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToTabOrientation(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToTabOrientation(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static int result = XmTABS_TOP_TO_BOTTOM; String str = (String) (from->addr); if( XmCompareISOLatin1(str, "ORIENTATION_DYNAMIC") == 0 || XmCompareISOLatin1(str, "XiTABS_ORIENTATION_DYNAMIC") == 0 ) { result = XmTAB_ORIENTATION_DYNAMIC; } else if( XmCompareISOLatin1(str, "TOP_TO_BOTTOM") == 0 || XmCompareISOLatin1(str, "XmTABS_TOP_TO_BOTTOM") == 0 ) { result = XmTABS_TOP_TO_BOTTOM; } else if( XmCompareISOLatin1(str, "BOTTOM_TO_TOP") == 0 || XmCompareISOLatin1(str, "XmTABS_BOTTOM_TO_TOP") == 0 ) { result = XmTABS_BOTTOM_TO_TOP; } else if( XmCompareISOLatin1(str, "LEFT_TO_RIGHT") == 0 || XmCompareISOLatin1(str, "XmTABS_LEFT_TO_RIGHT") == 0 ) { result = XmTABS_LEFT_TO_RIGHT; } else if( XmCompareISOLatin1(str, "RIGHT_TO_LEFT") == 0 || XmCompareISOLatin1(str, "XmTABS_RIGHT_TO_LEFT") == 0 ) { result = XmTABS_RIGHT_TO_LEFT; } else { XtDisplayStringConversionWarning(dpy, str, XmRTabOrientation); return( False ); } XiCvtDone(int, result); } static Boolean #ifndef _NO_PROTO CvtStringToTabSide(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToTabSide(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static int result = XmTABS_ON_TOP; String str = (String) (from->addr); if( XmCompareISOLatin1(str, "ON_TOP") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_TOP") == 0 ) { result = XmTABS_ON_TOP; } else if( XmCompareISOLatin1(str, "ON_BOTTOM") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_BOTTOM") == 0 ) { result = XmTABS_ON_BOTTOM; } else if( XmCompareISOLatin1(str, "ON_LEFT") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_LEFT") == 0 ) { result = XmTABS_ON_LEFT; } else if( XmCompareISOLatin1(str, "ON_RIGHT") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_RIGHT") == 0 ) { result = XmTABS_ON_RIGHT; } else { XtDisplayStringConversionWarning(dpy, str, XmRTabSide); return( False ); } XiCvtDone(int, result); } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToTabStyle(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToTabStyle(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static int result = XmTABS_BEVELED; String str = (String) (from->addr); if( XmCompareISOLatin1(str, "SQUARED") == 0 || XmCompareISOLatin1(str, "XmTABS_SQUARED") == 0 ) { result = XmTABS_SQUARED; } else if( XmCompareISOLatin1(str, "ROUNDED") == 0 || XmCompareISOLatin1(str, "XmTABS_ROUNDED") == 0 ) { result = XmTABS_ROUNDED; } else if( XmCompareISOLatin1(str, "BEVELED") == 0 || XmCompareISOLatin1(str, "XmTABS_BEVELED") == 0 ) { result = XmTABS_BEVELED; } else { XtDisplayStringConversionWarning(dpy, str, XmRTabStyle); return( False ); } XiCvtDone(int, result); } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToTabMode(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToTabMode(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static int result = XmTABS_BASIC; String str = (String) from->addr; if( XmCompareISOLatin1(str, "BASIC") == 0 || XmCompareISOLatin1(str, "XmTABS_BASIC") == 0 ) { } else if( XmCompareISOLatin1(str, "STACKED") == 0 || XmCompareISOLatin1(str, "XmTABS_STACKED") == 0 ) { result = XmTABS_STACKED; } else if( XmCompareISOLatin1(str, "STACKED_STATIC") == 0 || XmCompareISOLatin1(str, "XmTABS_STACKED_STATIC") == 0 ) { result = XmTABS_STACKED_STATIC; } #ifdef SCROLLED_LAYOUT else if( XmCompareISOLatin1(str, "SCROLLED") == 0 || XmCompareISOLatin1(str, "XmTABS_SCROLLED") == 0 ) { result = XmTABS_SCROLLED; } #endif #ifdef OVERLAYED_LAYOUT else if( XmCompareISOLatin1(str, "OVERLAYED") == 0 || XmCompareISOLatin1(str, "XmTABS_OVERLAYED") == 0 ) { result = XmTABS_OVERLAYED; } #endif else { XtDisplayStringConversionWarning(dpy, str, XmRTabMode); return( False ); } XiCvtDone(int, result); } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToTabEdge(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToTabEdge(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static int result = XmTAB_EDGE_BOTTOM_RIGHT; String str = (String) (from->addr); if( XmCompareISOLatin1(str, "EDGE_TOP_LEFT") == 0 || XmCompareISOLatin1(str, "XmTAB_EDGE_TOP_LEFT") == 0 ) { result = XmTAB_EDGE_TOP_LEFT; } else if( XmCompareISOLatin1(str, "EDGE_BOTTOM_RIGHT") == 0 || XmCompareISOLatin1(str, "XiTABS_EDGE_BOTTOM_RIGHT") == 0 ) { result = XmTAB_EDGE_BOTTOM_RIGHT; } else if( XmCompareISOLatin1(str, "bottom") == 0 ) { result = XmTAB_EDGE_TOP_LEFT; } else if( XmCompareISOLatin1(str, "right") == 0 ) { result = XmTAB_EDGE_BOTTOM_RIGHT; } else { XtDisplayStringConversionWarning(dpy, str, XmRTabEdge); return( False ); } XiCvtDone(int, result); } #ifdef SCROLLED_LAYOUT static Boolean #ifndef _NO_PROTO CvtStringToArrowPlacement(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToArrowPlacement(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static int result = XmTAB_ARROWS_ON_LEFT; String str = (String) (from->addr); if( XmCompareISOLatin1(str, "left") == 0 || XmCompareISOLatin1(str, "tab_arrows_on_left") == 0 ) { result = XmTAB_ARROWS_ON_LEFT; } else if( XmCompareISOLatin1(str, "right") == 0 || XmCompareISOLatin1(str, "tab_arrows_on_right") == 0 ) { result = XmTAB_ARROWS_ON_RIGHT; } else if( XmCompareISOLatin1(str, "split") == 0 || XmCompareISOLatin1(str, "tab_arrows_split") == 0 ) { result = XmTAB_ARROWS_SPLIT; } else { XtDisplayStringConversionWarning(dpy, str, XmRTabArrowPlacement); return( False ); } XiCvtDone(int, result); } #endif /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToTabList(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToTabList(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { return( False ); } /* ARGSUSED */ static void #ifndef _NO_PROTO CvtDestroyTabList(XtAppContext app_context, XrmValue *to, XtPointer data, XrmValue *args, Cardinal *num_args) #else CvtDestroyTabList(app_context, to, data, args, num_args) XtAppContext app_context; XrmValue *to; XtPointer data; XrmValue *args; Cardinal *num_args; #endif { } static short XiCosSinData[][2] = { { 1000, 0 }, { 998, 52 }, { 994, 104 }, { 987, 156 }, { 978, 207 }, { 965, 258 }, { 951, 309 }, { 933, 358 }, { 913, 406 }, { 891, 453 }, { 866, 499 }, { 838, 544 }, { 809, 587 }, { 777, 629 }, { 743, 669 }, { 707, 707 }, { 669, 743 }, { 629, 777 }, { 587, 809 }, { 544, 838 }, { 500, 866 }, { 453, 891 }, { 406, 913 }, { 358, 933 }, { 309, 951 }, { 258, 965 }, { 207, 978 }, { 156, 987 }, { 104, 994 }, { 52, 998 }, { 0, 1000 }}; #define NUM_PTS 31 #define NUM_PTSx2 62 #define HALF_PTS 16 #define HALF_PTSx2 32 #define NUM_PTSp1 32 static void #ifndef _NO_PROTO XiDrawCorner(Display *dpy, Drawable d, GC top_gc, GC bottom_gc, int x, int y, unsigned int width, unsigned int height, unsigned int size, XiQuadrant quadrant) #else XiDrawCorner(dpy, d, top_gc, bottom_gc, x, y, width, height, size, quadrant) Display *dpy; Drawable d; GC top_gc, bottom_gc; int x, y; unsigned int width, height, size; XiQuadrant quadrant; #endif { XPoint pt[NUM_PTSx2]; int i, xrad1, xrad2, yrad1, yrad2, tmp; xrad1 = width; xrad2 = width - size; yrad1 = height; yrad2 = height - size; switch( quadrant ) { case XiQUAD_1: y += height; for( i = 0; i < HALF_PTS; ++i ) { pt[i].x = x + XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y - XiCosSinData[i][1] * yrad1 / 1000; pt[HALF_PTSx2-1-i].x = x + XiCosSinData[i][0] * xrad2 / 1000; pt[HALF_PTSx2-1-i].y = y - XiCosSinData[i][1] * yrad2 / 1000; } XFillPolygon(dpy, d, bottom_gc, pt, HALF_PTSx2, Nonconvex, CoordModeOrigin); for( tmp = 0, i = HALF_PTS-1; i < NUM_PTS; ++i, ++tmp ) { pt[tmp].x = x + XiCosSinData[i][0] * xrad1 / 1000; pt[tmp].y = y - XiCosSinData[i][1] * yrad1 / 1000; pt[HALF_PTSx2-1-tmp].x = x + XiCosSinData[i][0] * xrad2 / 1000; pt[HALF_PTSx2-1-tmp].y = y - XiCosSinData[i][1] * yrad2 / 1000; } XFillPolygon(dpy, d, top_gc, pt, HALF_PTSx2, Nonconvex, CoordModeOrigin); break; case XiQUAD_2: x += width; y += height; for( i = 0; i < NUM_PTS; ++i ) { pt[i].x = x - XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y - XiCosSinData[i][1] * yrad1 / 1000; pt[NUM_PTSx2-1-i].x = x - (int)XiCosSinData[i][0] * xrad2 / 1000; pt[NUM_PTSx2-1-i].y = y - (int)XiCosSinData[i][1] * yrad2 / 1000; } XFillPolygon(dpy, d, top_gc, pt, NUM_PTSx2, Nonconvex, CoordModeOrigin); break; case XiQUAD_3: x += width; for( i = 0; i < HALF_PTS; ++i ) { pt[i].x = x - XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y + XiCosSinData[i][1] * yrad1 / 1000; pt[HALF_PTSx2-1-i].x = x - XiCosSinData[i][0] * xrad2 / 1000; pt[HALF_PTSx2-1-i].y = y + XiCosSinData[i][1] * yrad2 / 1000; } XFillPolygon(dpy, d, top_gc, pt, HALF_PTSx2, Nonconvex, CoordModeOrigin); for( tmp = 0, i = HALF_PTS-1; i < NUM_PTS; ++i, ++tmp ) { pt[tmp].x = x - XiCosSinData[i][0] * xrad1 / 1000; pt[tmp].y = y + XiCosSinData[i][1] * yrad1 / 1000; pt[HALF_PTSx2-1-tmp].x = x - XiCosSinData[i][0] * xrad2 / 1000; pt[HALF_PTSx2-1-tmp].y = y + XiCosSinData[i][1] * yrad2 / 1000; } XFillPolygon(dpy, d, bottom_gc, pt, HALF_PTSx2, Nonconvex, CoordModeOrigin); break; case XiQUAD_4: for( i = 0; i < NUM_PTS; ++i ) { pt[i].x = x + XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y + XiCosSinData[i][1] * yrad1 / 1000; pt[NUM_PTSx2-1-i].x = x + XiCosSinData[i][0] * xrad2 / 1000; pt[NUM_PTSx2-1-i].y = y + XiCosSinData[i][1] * yrad2 / 1000; } XFillPolygon(dpy, d, bottom_gc, pt, NUM_PTSx2, Nonconvex, CoordModeOrigin); break; default: break; } } static void #ifndef _NO_PROTO XiFillCorner(Display *dpy, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height, XiQuadrant quadrant) #else XiFillCorner(dpy, d, gc, x, y, width, height, quadrant) Display *dpy; Drawable d; GC gc; int x, y; unsigned int width, height; XiQuadrant quadrant; #endif { XPoint pt[NUM_PTSp1]; int i, xrad1, yrad1; xrad1 = width; yrad1 = height; switch( quadrant ) { case XiQUAD_1: y += height; for( i = 0; i < NUM_PTS; ++i ) { pt[i].x = x + XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y - XiCosSinData[i][1] * yrad1 / 1000; } pt[i].x = x; pt[i++].y = y + height; XFillPolygon(dpy, d, gc, pt, i, Nonconvex, CoordModeOrigin); break; case XiQUAD_2: x += width; y += height; for( i = 0; i < NUM_PTS; ++i ) { pt[i].x = x - XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y - XiCosSinData[i][1] * yrad1 / 1000; } pt[i].x = x + width; pt[i++].y = y + height; XFillPolygon(dpy, d, gc, pt, i, Nonconvex, CoordModeOrigin); break; case XiQUAD_3: x += width; for( i = 0; i < NUM_PTS; ++i ) { pt[i].x = x - XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y + XiCosSinData[i][1] * yrad1 / 1000; } pt[i].x = x + width; pt[i++].y = y; XFillPolygon(dpy, d, gc, pt, i, Nonconvex, CoordModeOrigin); break; case XiQUAD_4: for( i = 0; i < NUM_PTS; ++i ) { pt[i].x = x + XiCosSinData[i][0] * xrad1 / 1000; pt[i].y = y + XiCosSinData[i][1] * yrad1 / 1000; } pt[i].x = x; pt[i++].y = y; XFillPolygon(dpy, d, gc, pt, i, Nonconvex, CoordModeOrigin); break; default: break; } } static void #ifndef _NO_PROTO HorizontalBasicLayout(XmTabBoxWidget tab) #else HorizontalBasicLayout(tab) XmTabBoxWidget tab; #endif { int i, x, height, cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); XiTabRect *actual = XmTabBox__actual(tab); XRectangle *wanted = XmTabBox__wanted(tab); x = LayoutIsRtoLP(tab) ? (tab->core.width - wanted[0].width) : 0; height = XtHeight(tab); for( i = 0; i < cnt; ++i ) { actual[i].x = x; actual[i].y = 0; actual[i].width = wanted[i].width; actual[i].height = height; actual[i].row = 0; actual[i].column = i; if (i < cnt-1) x += LayoutIsRtoLP(tab) ? -actual[i+1].width : actual[i].width; } XmTabBox__num_rows(tab) = 1; XmTabBox__num_columns(tab) = i; } static void #ifndef _NO_PROTO VerticalBasicLayout(XmTabBoxWidget tab) #else VerticalBasicLayout(tab) XmTabBoxWidget tab; #endif { int i, y, width, cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); XiTabRect *actual = XmTabBox__actual(tab); XRectangle *wanted = XmTabBox__wanted(tab); y = 0; width = XtWidth(tab); for( i = 0; i < cnt; ++i ) { actual[i].x = 0; actual[i].y = y; actual[i].width = width; actual[i].height = wanted[i].height; actual[i].row = 0; actual[i].column = i; y += actual[i].height; } XmTabBox__num_rows(tab) = 1; XmTabBox__num_columns(tab) = i; } static void #ifndef _NO_PROTO Layout(XmTabBoxWidget tab) #else Layout(tab) XmTabBoxWidget tab; #endif { XmTabbedStackList list = XmTabBox_tab_list(tab); int count = _XmTabbedStackListCount(list); XRectangle geometry; if( count == 0 ) { XmTabBox__num_columns(tab) = 0; XmTabBox__num_rows(tab) = 0; return; } if( count > XmTabBox__num_actual(tab) ) { XmTabBox__num_actual(tab) = count; XmTabBox__actual(tab) = (XiTabRect*) XtRealloc((XtPointer) XmTabBox__actual(tab), sizeof(XiTabRect) * count); } switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: CalcGeometry(tab, &geometry); if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { HorizontalBasicLayout(tab); } else { VerticalBasicLayout(tab); } break; case XmTABS_STACKED: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { HorizontalStackedLayout(tab, False); } else { VerticalStackedLayout(tab, False); } break; case XmTABS_STACKED_STATIC: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { HorizontalStackedLayout(tab, True); } else { VerticalStackedLayout(tab, True); } break; case XmTABS_SCROLLED: break; case XmTABS_OVERLAYED: break; } } /* * Function: * HorizontalBasicRedisplay(tab) * Description: * This function performs the basic tab redisplay in the horizontal * direction. * Input: * tab : XtTabBoxWidget - the tab box to redisplay * Output: * None. */ static void #ifndef _NO_PROTO HorizontalBasicRedisplay(XmTabBoxWidget tab) #else HorizontalBasicRedisplay(tab) XmTabBoxWidget tab; #endif { XiTabRect *geom; int count = _XmTabbedStackListCount(XmTabBox_tab_list(tab)), x, shadow = tab->manager.shadow_thickness; geom = XmTabBox__actual(tab); x = geom[count-1].x + geom[count-1].width; /* * Now that we are done with the tabs we need to complete the line * from the last tab to the edge of the widget. */ if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { if (LayoutIsRtoLP(tab)) XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, 0, (int)XtHeight(tab) - shadow, geom[count-1].x, shadow); else XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, x, (int)XtHeight(tab) - shadow, (int)XtWidth(tab) - x, shadow); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, (int)XtWidth(tab) - shadow, (int)XtHeight(tab) - shadow, shadow, XmBEVEL_BOTTOM); } else { if (LayoutIsRtoLP(tab)) XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, 0, 0, geom[count-1].x, shadow); else XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, x, 0, (int)XtWidth(tab) - x, shadow); } } /* * Function: * VerticalBasicRedisplay(tab) * Description: * This function performs the basic tab redisplay in the Vertical * direction. * Input: * tab : XtTabBoxWidget - the tab box to redisplay * Output: * None. */ static void #ifndef _NO_PROTO VerticalBasicRedisplay(XmTabBoxWidget tab) #else VerticalBasicRedisplay(tab) XmTabBoxWidget tab; #endif { XiTabRect *geom; int count = _XmTabbedStackListCount(XmTabBox_tab_list(tab)), y, shadow = tab->manager.shadow_thickness; geom = XmTabBox__actual(tab); y = geom[count-1].y + geom[count-1].height; /* * Now that we are done with the tabs we need to complete the line * from the last tab to the edge of the widget. */ if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, (int)XtWidth(tab) - shadow, y, shadow, (int)XtHeight(tab) - y); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, (int)XtWidth(tab) - shadow, (int)XtHeight(tab) - shadow, shadow, XmBEVEL_BOTTOM); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, 0, y, shadow, (int)XtHeight(tab) - y); } } /* * Function: * XiRotateImage(tab, src, degree) * Description: * Returns a new XImage which is the given image rotate by either * 0 (a strait copy), 90, 180, or 270 degrees. * Input: * tab : XmTabBoxWidget - used for reference * src : XImage* - the image to rotate * degree : int - how many degrees to rotate "floored" * to the nearest 90 * Output: * XImage* - and new allocated, rotated copy of the image */ static XImage* #ifndef _NO_PROTO XiRotateImage(XmTabBoxWidget tab, XImage *src, int degree) #else XiRotateImage(tab, src, degree) XmTabBoxWidget tab; XImage *src; int degree; #endif { XImage *dst; char *data; int x, y, width, height, depth, tmp; if( src == NULL ) return( NULL ); width = XImageWidth(src); height = XImageHeight(src); depth = XImageDepth(src); if( depth < 8 ) { int cnt = 8/depth; if( degree == 0 || degree == 180 ) { tmp = (width/cnt) + ((width % cnt != 0) ? 1 : 0); tmp = tmp * height; } else { tmp = (height/cnt) + ((height % cnt != 0) ? 1 : 0); tmp = tmp * width; } } else { tmp = width * height * depth; } data = (char*) XtMalloc(tmp); if( degree == 0 || degree == 180 ) { dst = XCreateImage(XtDisplay(tab), GetShellVisual((Widget)tab), depth, (depth == 1 ? XYBitmap : XYPixmap), 0, data, width, height, 8, 0); if( degree == 180 ) { for( y = 0; y < height; ++y ) { for( x = 0; x < width; ++x ) { XPutPixel(dst, (width-1-x), (height-1-y), XGetPixel(src, x, y)); } } } else { for( y = 0; y < height; ++y ) { for( x = 0; x < width; ++x ) { XPutPixel(dst, x, y, XGetPixel(src, x, y)); } } } } else { dst = XCreateImage(XtDisplay(tab), GetShellVisual((Widget)tab), depth, (depth == 1 ? XYBitmap : XYPixmap), 0, data, height, width, 8, 0); if( degree == 90 ) { for( y = 0; y < height; ++y ) { for( x = 0; x < width; ++x ) { XPutPixel(dst, (height-1-y), x, XGetPixel(src, x, y)); } } } else { for( y = 0; y < height; ++y ) { for( x = 0; x < width; ++x ) { XPutPixel(dst, y, (width-1-x), XGetPixel(src, x, y)); } } } } return( dst ); } static void #ifndef _NO_PROTO CalcCornerSize(XmTabBoxWidget tab) #else CalcCornerSize(tab) XmTabBoxWidget tab; #endif { XmFontContext fc; XmFontListEntry entry; XmFontType font_type; XtPointer value; int tmp, size = 0; XmFontListInitFontContext(&fc, XmTabBox_font_list(tab)); while( (entry = XmFontListNextEntry(fc)) != NULL ) { value = (XtPointer) XmFontListEntryGetFont(entry, &font_type); if( font_type == XmFONT_IS_FONT ) { XFontStruct *font; font = (XFontStruct*) value; tmp = font->ascent + font->descent; AssignMax(size, tmp); } #ifdef USE_XFT else if (1/*font_type == XmFONT_IS_XFT*/) { tmp = ((XftFont*)value)->ascent + ((XftFont*)value)->descent; AssignMax(size, tmp); } #endif else { XFontSetExtents *extents; extents = XExtentsOfFontSet((XFontSet) value); tmp = extents->max_logical_extent.height; AssignMax(size, tmp); } } XmFontListFreeFontContext(fc); XmTabBox__corner_size(tab) = size * XmTabBox_tab_corner_percent(tab)/ 100; } static int #ifndef _NO_PROTO XiXYtoTab(XmTabBoxWidget tab, int x, int y) #else XiXYtoTab(tab, x, y) XmTabBoxWidget tab; int x, y; #endif { int i, cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)), row = -1, idx; XiTabRect *area = XmTabBox__actual(tab); for( i = 0; i < cnt; ++i ) { if( x < area[i].x || x > (area[i].x + (int)area[i].width) || y < area[i].y || y > (area[i].y + (int)area[i].height) ) { continue; } return( i ); } /* * If we are in a stacked mode then we will do some more checking, * however if we are not in a stacked mode then we are done. */ if( XmTabBox_tab_mode(tab) != XmTABS_STACKED && XmTabBox_tab_mode(tab) != XmTABS_STACKED_STATIC ) { return( -1 ); } if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { /* * Since we are in a stacked mode it is possible that we clicked in * a partial row. So lets start by finding out which partial row * we clicked in. This is done by just looking at the height * component of the tabs. */ for( i = 0; i < cnt; ++i ) { if( y >= area[i].y && y <= (area[i].y + (int)area[i].height) ) { /* * We found the row we care about. */ row = area[i].row; break; } } /* * If we did not click in a row, or if that row is the last row we are * done. */ if( row == -1 || row == (XmTabBox__num_rows(tab) - 1) ) return( -1 ); /* * Now we want to walk through all the columns of the previous row and * see if the x position is in those columns. And if we find a match * we found a winner. */ for( i = 0, ++row, idx = 0; idx >= 0 && i < XmTabBox__num_columns(tab); ++i ) { idx = GetTabIndex(tab, row, i); if( idx < 0 || x < area[i].x || x > (area[i].x + area[i].width) ) { continue; } return( idx ); } } else { /* * Since we are in a stacked mode it is possible that we clicked in * a partial row. So lets start by finding out which partial row * we clicked in. This is done by just looking at the height * component of the tabs. */ for( i = 0; i < cnt; ++i ) { if( x >= area[i].x && x <= (area[i].x + (int)area[i].width) ) { /* * We found the row we care about. */ row = area[i].row; break; } } /* * If we did not click in a row, or if that row is the last row we are * done. */ if( row == -1 || row == (XmTabBox__num_rows(tab) - 1) ) return( -1 ); /* * Now we want to walk through all the columns of the previous row and * see if the x position is in those columns. And if we find a match * we found a winner. */ for( i = 0, ++row, idx = 0; idx >= 0 && i < XmTabBox__num_columns(tab); ++i ) { idx = GetTabIndex(tab, row, i); if( idx < 0 || y < area[i].y || y > (area[i].y + area[i].height) ) { continue; } return( idx ); } } /* * If we get here we really did not find a match. */ return( -1 ); } /* * Function: * CalcTabGeometry(XmTabBoxWidget tab) * Description: * This function calculates and caches the geometry for all the tabs, * taking into account the XmNuniformTabSize resource. * Input: * tab : XmTabBoxWidget - the tab box who needs the geometries * calculated. * Output: * None. */ static void #ifndef _NO_PROTO CalcTabGeometry(XmTabBoxWidget tab) #else CalcTabGeometry(tab) XmTabBoxWidget tab; #endif { XmTabbedStackList list = XmTabBox_tab_list(tab); XmTabAttributes info; Dimension width, height, max_width = 0, max_height = 0; int count = _XmTabbedStackListCount(XmTabBox_tab_list(tab)), i; XRectangle *geom; /* * First lets see if we have enough room to cache all the geometries * and if not lets increase our cache so there is room. */ if( count > XmTabBox__num_wanted(tab) ) { XmTabBox__num_wanted(tab) = count; XmTabBox__wanted(tab) = (XRectangle*) XtRealloc((XtPointer)XmTabBox__wanted(tab), sizeof(XRectangle) * count); } geom = XmTabBox__wanted(tab); /* * Now that we have enough space to cache all the Tab sizes we * need to walk through and calculate the size of all the tabs. */ for( i = 0; i < count; ++i ) { /* * Now lets get the info for a tab and send it off to this handy * dandy tab size calculator. */ info = _XmTabbedStackListGet(list, i); XiCalcTabSize(tab, info, &width, &height); /* * Now lets do a quick check here to see if we are going to be * making the tabs uniform and if so lets capture the maximum * width and height of the tabs. */ if( XmTabBox_uniform_tab_size(tab) ) { AssignMax(max_width, width); AssignMax(max_height, height); } else { /* * Since we are not doing uniform sized tabs here we can * assign the values from our size calculation to the * geometry cache. */ geom[i].width = width; geom[i].height = height; } } /* * Well if we are doing uniform tab sizes then we need to make * one more pass over the tab geometry cache assigning the * same width and height to each tab. */ if( XmTabBox_uniform_tab_size(tab) ) { for( i = 0; i < count; ++i ) { geom[i].width = max_width; geom[i].height = max_height; } } } /* * Function: * CalcGeometryMinor(tab, major_d) * Description: * Given the major Dimension calculates the needed minor dimension to * display correctly. * Input: * tab : XmTabBoxWidget - the tab box to work with * major_d : int - the major dimension * Output: * int - the desired minor dimension given the major dimension */ static int #ifndef _NO_PROTO CalcGeometryMinor(XmTabBoxWidget tab, int major_d) #else CalcGeometryMinor(tab, major_d) XmTabBoxWidget tab; int major_d; #endif { XmTabbedStackList list = XmTabBox_tab_list(tab); int count = _XmTabbedStackListCount(list), i, max; XRectangle *geom; /* * First lets check if we have any tabs, because if we do not, then * our minor dimension becomes real easy ... all it is is our * shadow thickness. */ if( count == 0 ) { /* * We do not have any tabs so we want to be the hieght of the * shadow. */ return( tab->manager.shadow_thickness ); } if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { /* * Ok, what is happening here is that we have a width and given this * width we want to see what height we will be. We will start with * the easy check, i.e do we have any tabs. */ /* * We have kids, so what we need to do is fake a given layout with * the specified width but allowing our height to grow. */ switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_OVERLAYED: case XmTABS_SCROLLED: default: /* * This is the simple layout case where all the tabs are in * one row. So for these layouts all we have to do is find * the maximum height of all the tabs. */ for( i = 0, max = 0, geom = XmTabBox__wanted(tab); i < count; ++i ) { AssignMax(max, (int)geom[i].height); } return( max ); case XmTABS_STACKED: case XmTABS_STACKED_STATIC: { int per_line, num_rows, tmp, tab_width, tab_height, offset = XmTabBox_tab_offset(tab); tab_height = XmTabBox__wanted(tab)[0].height; tab_width = XmTabBox__wanted(tab)[0].width; per_line = count; num_rows = (int)(count/per_line) + (count % per_line > 0 ? 1 : 0); tmp = (per_line * tab_width) + (num_rows * offset); while( per_line > 1 && tmp > major_d ) { per_line--; num_rows = (int)(count/per_line) + (count % per_line > 0 ? 1 : 0); tmp = (per_line * tab_width) + (num_rows * offset); } return( num_rows * tab_height ); } } } /* orientation == XmVERTICAL */ switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_OVERLAYED: case XmTABS_SCROLLED: default: for( i = 0, max = 0, geom = XmTabBox__wanted(tab); i < count; ++i ) { AssignMax(max, (int)geom[i].width); } return( max ); case XmTABS_STACKED: case XmTABS_STACKED_STATIC: { int per_line, num_rows, tmp, tab_width, tab_height, offset = XmTabBox_tab_offset(tab); tab_height = XmTabBox__wanted(tab)[0].height; tab_width = XmTabBox__wanted(tab)[0].width; per_line = count; num_rows = (int)(count/per_line) + (count % per_line > 0 ? 1 : 0); tmp = (per_line * tab_height) + (num_rows * offset); while( per_line > 1 && tmp > major_d ) { per_line--; num_rows = (int)(count/per_line) + (count % per_line > 0 ? 1 : 0); tmp = (per_line * tab_height) + (num_rows * offset); } return( num_rows * tab_width ); } } } static int CalcGeometryMajor(XmTabBoxWidget tab, int minor_d) { XmTabbedStackList list = XmTabBox_tab_list(tab); int count = _XmTabbedStackListCount(list), i, max, total, num_rows; int tmp=0, offset = XmTabBox_tab_offset(tab), num_cols; XRectangle *geom; if( count == 0 ) { /* * We don't have any children so our major dimension is simply * our shadow. */ return( tab->manager.shadow_thickness ); } geom = XmTabBox__wanted(tab); /* * Here the taks is to calculate the major dimension given the * minor one. */ if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_OVERLAYED: case XmTABS_SCROLLED: default: /* * For this case the major dimension is simply the length * of all the tabs in one row, reguardless of what the minor * dimension is so lets figure this out. */ for( i = 0, max = 0, total = 0; i < count; ++i ) { total += geom[i].width; AssignMax(max, (int)geom[i].width); } if( XmTabBox_uniform_tab_size(tab) ) { return( max * count ); } return( total ); case XmTABS_STACKED: case XmTABS_STACKED_STATIC: /* * This case is a little harder here. What we want to do is * say given this height how wide do we want to be. So the * first thing we need to do is find the height of our rows * so we know how many we can fit. */ for( i = 0, max = 1; i < count; ++i ) { AssignMax(max, (int)geom[i].height); AssignMax(tmp, (int)geom[i].width); } num_rows = minor_d/ max; AssignMax(num_rows, 1); /* * Now that we know how many rows we are allowed all we * have to do is partition the tabs between the rows and * add on room for the stagger (if needed). */ num_cols = (int)(count/num_rows) + (count % num_rows > 0 ? 1 : 0); total = num_cols * tmp + (num_rows - 1) * offset; return( total ); } } /* Vertical Orientation */ switch( XmTabBox_tab_mode(tab) ) { case XmTABS_BASIC: case XmTABS_OVERLAYED: case XmTABS_SCROLLED: default: /* * For this case the major dimension is simply the length * of all the tabs in one row, reguardless of what the minor * dimension is so lets figure this out. */ for( i = 0, max = 0, total = 0; i < count; ++i ) { total += geom[i].height; AssignMax(max, (int)geom[i].height); } if( XmTabBox_uniform_tab_size(tab) ) { return( max * count ); } return( total ); case XmTABS_STACKED: case XmTABS_STACKED_STATIC: /* * This case is a little harder here. What we want to do is * say given this height how wide do we want to be. So the * first thing we need to do is find the height of our rows * so we know how many we can fit. */ for( i = 0, max = 1; i < count; ++i ) { AssignMax(max, (int)geom[i].width); AssignMax(tmp, (int)geom[i].height); } num_rows = minor_d/ max; AssignMax(num_rows, 1); /* * Now that we know how many rows we are allowed all we * have to do is partition the tabs between the rows and * add on room for the stagger (if needed). */ num_cols = (int)(count/num_rows) + (count % num_rows > 0 ? 1 : 0); total = num_cols * tmp + (num_rows - 1) * offset; return( total ); } } /* * Function: * CallCallbacks(tab, event, from, to) * Description: * Calls the unselect and select callbacks for the XmTabBox * Input: * tab : XmTabBoxWidget - the tab box widget * event : XEvent* - passed through * from : int - the old selected tab * to : int - the new selected tab * Output: * None. */ static void CallCallbacks(XmTabBoxWidget tab, XEvent *event, int from, int to) { XmTabBoxCallbackStruct cbdata; cbdata.reason = XmCR_TAB_UNSELECTED; cbdata.event = event; cbdata.tab_index = from; cbdata.old_index = from; XtCallCallbackList((Widget)tab, XmTabBox_unselect_callback(tab), (XtPointer)&cbdata); cbdata.reason = XmCR_TAB_SELECTED; cbdata.event = event; cbdata.tab_index = to; cbdata.old_index = from; XtCallCallbackList((Widget)tab, XmTabBox_select_callback(tab), (XtPointer)&cbdata); } #ifdef FIX_1381 static void SetRightGC(XmTabBoxWidget tab, GC gc, GC_type gc_type) { XGCValues values; XtGCMask valueMask; static Pixel p = 0; static GC_type last = normal; valueMask = GCForeground; values.foreground = 0; switch( gc_type ) { case normal: if (last !=normal) { values.foreground = p; XChangeGC(XtDisplay(tab),gc, valueMask, &values); } last = normal; break; case insensitive: if (last == normal) p=values.foreground; values.foreground = tab->manager.bottom_shadow_color; XChangeGC(XtDisplay(tab),gc, valueMask, &values); last = insensitive; break; case shadow: if (last == normal) p=values.foreground; values.foreground = tab->manager.top_shadow_color; XChangeGC(XtDisplay(tab),gc, valueMask, &values); last = shadow; break; default: break; } } #endif /* ARGSUSED */ static void DrawLeftToRightTab(XmTabBoxWidget tab, XmTabAttributes info, GC gc, Boolean have_pixmap, int pix_width, int pix_height, int pix_depth, Boolean have_label, int label_width, int label_height, XRectangle *clip) { XRectangle draw; XmFontList font_list = XmTabBox_font_list(tab); int x, y, tmp, spacing = XmTabBox_tab_label_spacing(tab); Boolean sensitive; x = draw.x = clip->x; y = draw.y = clip->y; draw.width = clip->width; draw.height = clip->height; sensitive = XtIsSensitive((Widget)tab) && info->sensitive; /* * If we are drawing both a pixmap and a label then we want to * give priority to the pixmap and align the text in the * rest of the mess. */ if( have_pixmap ) { /* * We have a pixmap, so lets figure out where we want the * pixmap to be placed. */ switch( info->pixmap_placement ) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: case XmPIXMAP_ONLY: default: /* * In these cases we want to look at the alignment of the * tab to determine where we want to place the pixmap. */ switch( info->label_alignment ) { case XmALIGNMENT_BEGINNING: /* * For this alignment we want to slam the pixmap * to the left of the cliping area. */ x = clip->x; break; case XmALIGNMENT_CENTER: default: /* * For this alignment we want to center the pixmap * in the cliping area. */ x = clip->x + ((int)clip->width - pix_width)/ 2; break; case XmALIGNMENT_END: /* * for this alignment we want to slam the pixmap * to the right of the cliping area. */ x = clip->x + (int)clip->width - pix_width; break; } /* * Since the pixmap will affect the amount of vertical * space that I have to place my text lets calculate * what space I have left over (if any) for my text. */ if( (tmp = (int)draw.height - (pix_height + spacing)) < 0 ) { draw.height = 0; } else { draw.height = tmp; } /* * OK now that we know how we want this pixmap positioned * horizontally lets see what we want to do with it * vertically. If we have no label then just center it. */ if( info->label_string == NULL ) { y = clip->y + ((int)clip->height - pix_height)/2; } else { switch( info->pixmap_placement ) { case XmPIXMAP_TOP: default: y = clip->y; draw.y = y + pix_height + spacing; break; case XmPIXMAP_BOTTOM: y = clip->y + (int)clip->height - pix_height; break; case XmPIXMAP_ONLY: y = clip->y + ((int)clip->height - pix_height)/2; break; } } break; case XmPIXMAP_LEFT: case XmPIXMAP_RIGHT: /* * For this case we want to slam the pixmap to the * left of the clipping area and center it in the * vertical space. */ if( info->label_string == NULL ) { x = clip->x + ((int)clip->width - pix_width)/2; } else { switch( info->pixmap_placement ) { case XmPIXMAP_LEFT: x = clip->x; draw.x = x + pix_width + spacing; break; case XmPIXMAP_RIGHT: x = clip->x + (int)clip->width - pix_width; break; default: break; } } y = clip->y + ((int)clip->height - pix_height)/2; /* * Since the pixmap will affect the amount of vertical * space that I have to place my text lets calculate * what space I have left over (if any) for my text. */ if( (tmp = (int)draw.width - (pix_width + spacing)) < 0 ) { draw.width = 0; } else { draw.width = tmp; } break; case XmPIXMAP_NONE: /* notreached */ break; } } /* * Now that we know where we are going to draw the pixmap, lets * go ahead and draw the bloody thing. We do a quick check here * to see if we are dealing with a bitmap or a pixmap to * see if we should be copying a plane or and area. Also be sure * to to an XCopyArea if the depth of the pixmap matches the * depth of the canvas. */ if( ValidPixmap(info->label_pixmap) && info->pixmap_placement != XmPIXMAP_NONE ) { if( pix_depth == 1 ) { XCopyPlane(XtDisplay(tab), info->label_pixmap, XiCanvas(tab), gc, 0, 0, pix_width, pix_height, x, y, 1); } else if( pix_depth == XmTabBox__canvas(tab)->core.depth ) { XCopyArea(XtDisplay(tab), info->label_pixmap, XiCanvas(tab), gc, 0, 0, pix_width, pix_height, x, y); } } if( !sensitive ) { /* * Since we are working with a non-sensitve tab, then we need to * stipple the the pixmap, and the only way to do that is * to copy a chess board pattern (the gray stipple) over the pixmap * we just drew. */ SetStippledGC(XtDisplay(tab), tab->manager.background_GC, XmTabBox__gray_stipple(tab)); XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.background_GC, x, y, pix_width, pix_height); RemoveStipple(XtDisplay(tab), tab->manager.background_GC); } /* * Now that we are done drawing the pixmap (if we have one) we * need to draw the textual label (if we have one). */ if( have_label ) { /* * First if we have a pixmap we need to reset our clipping * area to account for the space the pixmap took up. */ if( have_pixmap ) { XSetClipRectangles(XtDisplay(tab), gc, 0, 0, &draw, 1, YXBanded); } /* * Now that we know the rectangle that we are going to * draw the text in lets calculate that x and y position * at which we are going to draw the text. For text it is * real easy we are always going to center the text in the * vertical space and align it according to the alignment * specfified. */ y = draw.y + ((int)draw.height - label_height)/2; /* * Now that we know where the text is going to go, lets * go ahead and draw it. */ if( !sensitive ) { #ifndef FIX_1381 SetStippledGC(XtDisplay(tab), gc, XmTabBox__gray_stipple(tab)); #else /*Draw shadow for insensitive text*/ SetRightGC(tab, gc, shadow); XmStringDraw(XtDisplay(tab), XiCanvas(tab), font_list, info->label_string, gc, draw.x+1, (Position)y+1, draw.width, info->label_alignment, info->string_direction, NULL); SetRightGC(tab, gc, insensitive); #endif } else { #ifndef FIX_1381 RemoveStipple(XtDisplay(tab), gc); #else SetRightGC(tab, gc, normal); #endif } XmStringDraw(XtDisplay(tab), XiCanvas(tab), font_list, info->label_string, gc, draw.x, (Position)y, draw.width, info->label_alignment, info->string_direction, NULL); } } /* * Function: * DrawRightToLeftTab(tab, info, gc, have_pixmap, pix_width, pix_height, * pix_depth, have_label, label_width, label_height, * clip); * Description: * Draw the pixmap and text for a tab withing the clipping rectangle * passed in as "clip". * Input: * tab : XmTabBoxWidget - the tab box that drawing * gc : GC - the GC to draw with * have_pixmap : Boolean - do we need to draw a pixmap ? * pix_width, * pix_height, * pix_depth : int - pixmap information * have_label : Boolean - do we need to draw a label string ? * label_width, * label_height : int - label string information * clip : XRectangle* - the clip rectangle to draw into * Output: * None. */ /* ARGSUSED */ static void DrawRightToLeftTab(XmTabBoxWidget tab, XmTabAttributes info, GC gc, Boolean have_pixmap, int pix_width, int pix_height, int pix_depth, Boolean have_label, int label_width, int label_height, XRectangle *clip, Boolean selected) { XRectangle draw; XmFontList font_list = XmTabBox_font_list(tab); int x, y, tmp, spacing = XmTabBox_tab_label_spacing(tab); XImage *src_ximage, *dst_ximage; Pixmap bitmap; Boolean sensitive; x = draw.x = clip->x; y = draw.y = clip->y; draw.width = clip->width; draw.height = clip->height; sensitive = XtIsSensitive((Widget)tab) && info->sensitive; /* * First lets check if we have a pixmap to draw and if we do * lets rotate and draw it. */ if( have_pixmap ) { /* * We do have a pixmap so we will start by rotating the pixmap * to the correct orientation. */ src_ximage = NULL; if( !XmTabBox_use_image_cache(tab) || (dst_ximage = CachePixmap(tab,info)) == NULL ) { src_ximage = XGetImage(XtDisplay(tab), info->label_pixmap, 0, 0, pix_width, pix_height, AllPlanes, XYPixmap); dst_ximage = XiRotateImage(tab, src_ximage, XiTabDegree(XmTabBox_tab_orientation(tab))); if( XmTabBox_use_image_cache(tab) ) { CachePixmap(tab,info) = dst_ximage; } } /* * Now that we have the rotated image lets snarf the width and height * back into local cache. */ pix_width = XImageWidth(dst_ximage); pix_height = XImageHeight(dst_ximage); /* * Now lets look at the pixmap placement to determine where we want * to place the pixmap. */ switch( info->pixmap_placement ) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: case XmPIXMAP_ONLY: default: /* * Now that we have rotate the ximage lets cache the width * and hieght of that image away for use. */ pix_width = XImageWidth(dst_ximage); pix_height = XImageHeight(dst_ximage); /* * In these cases we want to look at the alignment of the * tab to determine where we want to place the pixmap * vertically. */ switch( info->label_alignment ) { case XmALIGNMENT_BEGINNING: /* * For this alignement we want to slam the pixmap * to the top of the clipping area. */ x = clip->x + (int)clip->width - pix_width; break; case XmALIGNMENT_CENTER: default: /* * For this case we want to center the pixmap in * the vertical space. */ x = clip->x + ((int)clip->width - pix_width)/2; break; case XmALIGNMENT_END: /* * For this alignment we want to slam the pixmap * to the bottom of the clipping area. */ x = clip->x; break; } /* * Since the pixmap will affect the amount of vertical * space to place the text lets calculate what space is * left for the text. */ if( (tmp = (int)draw.height - (pix_height + spacing)) < 0 ) { draw.height = 0; } else { draw.height = tmp; } /* * Ok now that we have positioned the pixmap horizontally * lets see what we want to do with it vertically. If * we have not label then center it. */ if( info->label_string == NULL ) { y = clip->y + ((int)clip->height - pix_height)/2; } else { switch( info->pixmap_placement ) { case XmPIXMAP_TOP: default: y = clip->y + (int)clip->height - pix_height; break; case XmPIXMAP_BOTTOM: y = clip->y; draw.y = y+ pix_height + spacing; break; case XmPIXMAP_ONLY: y = clip->y + ((int)clip->height - pix_height)/2; break; } } break; case XmPIXMAP_LEFT: case XmPIXMAP_RIGHT: /* * For this case we want to slam the pixmap to either the * top or bottom of the clipping area and center it in * the horizontal space. */ if( info->label_string == NULL ) { x = clip->x + ((int)clip->width - pix_width)/2; } else { switch( info->pixmap_placement ) { case XmPIXMAP_LEFT: x = clip->x + (int)clip->width - pix_width; break; case XmPIXMAP_RIGHT: x = clip->x; draw.x = x + pix_width + spacing; break; default: break; } } y = clip->y + ((int)clip->height - pix_width)/2; /* * Since the pixmap will affect the amount of * vertical space that the text will have lets * calculate what space is left. */ if( (tmp = (int)draw.width - (pix_width + spacing)) < 0 ) { draw.width = 0; } else { draw.width = tmp; } break; case XmPIXMAP_NONE: /* notreached */ break; } /* * Now that we know where the image is supposed to go, lets * draw the thing. */ XPutImage(XtDisplay(tab), XiCanvas(tab), gc, dst_ximage, 0, 0, x, y, pix_width, pix_height); if( !sensitive ) { /* * Since we are working with a non-sensitive tab, then we need to * stipple the the pixmap, and the only way to do that is * to copy a chess board pattern (the gray stipple) over the pixmap * we just drew. */ SetStippledGC(XtDisplay(tab), tab->manager.background_GC, XmTabBox__gray_stipple(tab)); XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.background_GC, x, y, pix_width, pix_height); RemoveStipple(XtDisplay(tab), tab->manager.background_GC); } /* * We are done with the XImages now so lets destroy the * ximages we used to rotate the pixmap. */ if( src_ximage != NULL ) XDestroyImage(src_ximage); if( !XmTabBox_use_image_cache(tab) && dst_ximage != NULL ) { XDestroyImage(dst_ximage); } } /* * Now that we have drawn the pixmap it is time to deal with the * label string. */ if( !have_label || info->label_string == NULL ) return; /* * If we have a pixmap then the clipping area was modified so * we need to set the clip rectangle to that for the text. */ if( have_pixmap ) { XSetClipRectangles(XtDisplay(tab), gc, 0, 0, &draw, 1, YXBanded); } /* * Now we have to render and rotate the label string. To do this * we need to first set up a few things like the pixmap to render * into and GC used to draw into a bitmap. We will start by * making sure that we have a pixmap large enough to * accomidate the string we are about to render. */ src_ximage = NULL; if( !XmTabBox_use_image_cache(tab) || (sensitive != CacheSensitive(tab,info)) || (dst_ximage = CacheLabel(tab, info)) == NULL ) { if( ValidPixmap(XmTabBox__bitmap(tab)) && (XmTabBox__bitmap_width(tab) < label_width || XmTabBox__bitmap_height(tab) < label_height) ) { /* * As it turns out our pixmap is not large enough to * hold the rendered text. So we will destroy the * current pixmap so that we will allocate a pixmap * of the correct size below. */ XFreePixmap(XtDisplay(tab), XmTabBox__bitmap(tab)); XmTabBox__bitmap(tab) = XmUNSPECIFIED_PIXMAP; } /* * If we do not have a bitmap to render the text into * lets create one now. */ if( !ValidPixmap(XmTabBox__bitmap(tab)) ) { XmTabBox__bitmap(tab) = XCreatePixmap(XtDisplay(tab), XiCanvas(tab), label_width, label_height, 1); XmTabBox__bitmap_width(tab) = label_width; XmTabBox__bitmap_height(tab) = label_height; } bitmap = XmTabBox__bitmap(tab); /* * Now that we have a bitmap to render the text into lets make sure * that we have GC that we can use to render the text. We need two * GC, one to clear the pixmap the other to draw into it. */ if( XmTabBox__zero_GC(tab) == NULL ) { /* * We do not yet have either of the GC created so lets go * ahead and create them now. */ XFontStruct *font = NULL; XGCValues gcValues; unsigned long gcMask; #ifndef FIX_1381 gcValues.foreground = 0; gcValues.background = 0; #else gcValues.background = tab->core.background_pixel; gcValues.foreground = tab->core.background_pixel; #endif XmTabBox__zero_GC(tab) = XCreateGC(XtDisplay(tab), bitmap, GCForeground | GCBackground, &gcValues); XmeRenderTableGetDefaultFont(font_list, &font); gcValues.foreground = 1; gcValues.background = 0; gcMask = GCForeground | GCBackground; if (font) { gcValues.font = font->fid; gcMask |= GCFont; } XmTabBox__one_GC(tab) = XCreateGC(XtDisplay(tab), bitmap, gcMask, &gcValues); } /* * Now we have all that we need to render the label string, so now * lets do it. What we need to do if first zero the pixmap and * then render the text. */ XFillRectangle(XtDisplay(tab), bitmap, XmTabBox__zero_GC(tab), 0, 0, label_width, label_height); if( !sensitive ) { #ifndef FIX_1381 SetStippledGC(XtDisplay(tab), XmTabBox__one_GC(tab), XmTabBox__gray_stipple(tab)); #else /*Draw shadow for insensitive text*/ SetRightGC(tab, XmTabBox__one_GC(tab), shadow); XmStringDraw(XtDisplay(tab), bitmap, font_list, info->label_string, XmTabBox__one_GC(tab), -1, -1, (Dimension)label_width, info->label_alignment, info->string_direction, NULL); SetRightGC(tab, XmTabBox__one_GC(tab), insensitive); #endif } else { #ifndef FIX_1381 RemoveStipple(XtDisplay(tab), XmTabBox__one_GC(tab)); #else SetRightGC(tab, XmTabBox__one_GC(tab), normal); #endif } XmStringDraw(XtDisplay(tab), bitmap, font_list, info->label_string, XmTabBox__one_GC(tab), 0, 0, (Dimension)label_width, info->label_alignment, info->string_direction, NULL); /* * Now that the label string is rendered we need to grab it back * into an XImage so that we can rotate it. */ src_ximage = XGetImage(XtDisplay(tab), bitmap, 0, 0, label_width, label_height, 1, XYPixmap); dst_ximage = XiRotateImage(tab, src_ximage, XiTabDegree(XmTabBox_tab_orientation(tab))); if( XmTabBox_use_image_cache(tab) ) { CacheLabel(tab, info) = dst_ximage; CacheSensitive(tab,info) = sensitive; } } /* * Now that the text is rotated lets snarf the label width and height * back from the image. */ label_width = XImageWidth(dst_ximage); label_height = XImageHeight(dst_ximage); /* * Now we need to find out where we want to but the text. We know that * we want to center the text in the horizontal space that we have left, * then we want to use the alignment value to determine what to * do with the vertical space. */ y = draw.y + ((int)draw.height - label_height)/2; switch( info->label_alignment ) { case XmALIGNMENT_BEGINNING: /* * Here we want to slam the text to the top of the clipping * area. */ x = draw.x + (int)draw.width - label_width; break; case XmALIGNMENT_CENTER: default: /* * Here we want to center the text in the clipping area. */ x = draw.x + ((int)draw.width - label_width)/2; break; case XmALIGNMENT_END: /* * Here we want to slam the text to the bottom of the * clipping area. */ x = draw.x; break; } /* * Now that we know where we want the text lets push that * XImage over the wire. But first we need to check if we should * mask out the text so that the background pixmap show through. */ if( ValidPixmap(tab->core.background_pixmap) || XiBackgroundSpecified(info) || (selected && XiSelectSpecified(tab)) ) { /* * It appears that we have a background pixmap so what we * want to do is set the clip mask such that we only draw the * text and not the rectangle around it. * * What we are going to do is create a bitmap and draw the text * into this pixmap to create a GC clipping mask. */ Pixmap pix = XCreatePixmap(XtDisplay(tab), (XtIsRealized((Widget)tab) ? XtWindow(tab) : RootWindowOfScreen(XtScreen(tab))), label_width, label_height, 1); /* * Left first clear out the clipping mask and then draw the text * into it. */ XFillRectangle(XtDisplay(tab), pix, XmTabBox__zero_GC(tab), 0, 0, label_width, label_height); XPutImage(XtDisplay(tab), pix, XmTabBox__one_GC(tab), dst_ximage, 0, 0, 0, 0, label_width, label_height); /* * Now that we have the clipping mask lets set the mask to the GC * and then put the image that is the text to the display using this * clipping mask. */ XSetClipMask(XtDisplay(tab), gc, pix); XSetClipOrigin(XtDisplay(tab), gc, x, y); XPutImage(XtDisplay(tab), XiCanvas(tab), gc, dst_ximage, 0, 0, x, y, label_width, label_height); /* * We are done with this cliping mask so lets destroy the pixmap. */ XFreePixmap(XtDisplay(tab), pix); } else { XPutImage(XtDisplay(tab), XiCanvas(tab), gc, dst_ximage, 0, 0, x, y, label_width, label_height); } /* * Now that we are done with the XImages used for rotating the * text lets delete them. */ if( src_ximage != NULL ) XDestroyImage(src_ximage); if( !XmTabBox_use_image_cache(tab) && dst_ximage != NULL ) { XDestroyImage(dst_ximage); } } /* * Function: * DrawBottomToTopTab(tab, info, gc, have_pixmap, pix_width, pix_height, * pix_depth, have_label, label_width, label_height, * clip); * Description: * Draw the pixmap and text for a tab withing the clipping rectangle * passed in as "clip". * Input: * tab : XmTabBoxWidget - the tab box that drawing * gc : GC - the GC to draw with * have_pixmap : Boolean - do we need to draw a pixmap ? * pix_width, * pix_height, * pix_depth : int - pixmap information * have_label : Boolean - do we need to draw a label string ? * label_width, * label_height : int - label string information * clip : XRectangle* - the clip rectangle to draw into * Output: * None. */ static void DrawBottomToTopTab(XmTabBoxWidget tab, XmTabAttributes info, GC gc, Boolean have_pixmap, int pix_width, int pix_height, int pix_depth, Boolean have_label, int label_width, int label_height, XRectangle *clip, Boolean selected) { DrawVerticalTab(tab, info, gc, have_pixmap, pix_width, pix_height, pix_depth, have_label, label_width, label_height, clip, False, selected); } /* * Function: * DrawTopToBottomTab(tab, info, gc, have_pixmap, pix_width, pix_height, * pix_depth, have_label, label_width, label_height, * clip); * Description: * Draw the pixmap and text for a tab withing the clipping rectangle * passed in as "clip". * Input: * tab : XmTabBoxWidget - the tab box that drawing * gc : GC - the GC to draw with * have_pixmap : Boolean - do we need to draw a pixmap ? * pix_width, * pix_height, * pix_depth : int - pixmap information * have_label : Boolean - do we need to draw a label string ? * label_width, * label_height : int - label string information * clip : XRectangle* - the clip rectangle to draw into * Output: * None. */ static void DrawTopToBottomTab(XmTabBoxWidget tab, XmTabAttributes info, GC gc, Boolean have_pixmap, int pix_width, int pix_height, int pix_depth, Boolean have_label, int label_width, int label_height, XRectangle *clip, Boolean selected) { DrawVerticalTab(tab, info, gc, have_pixmap, pix_width, pix_height, pix_depth, have_label, label_width, label_height, clip, True, selected); } /* * Function: * DrawVerticalTab(tab, info, gc, have_pixmap, pix_width, pix_height, * pix_depth, have_label, label_width, label_height, * clip, top_to_bottom); * Description: * Draw the pixmap and text for a tab withing the clipping rectangle * passed in as "clip". * Input: * tab : XmTabBoxWidget - the tab box that drawing * gc : GC - the GC to draw with * have_pixmap : Boolean - do we need to draw a pixmap ? * pix_width, * pix_height, * pix_depth : int - pixmap information * have_label : Boolean - do we need to draw a label string ? * label_width, * label_height : int - label string information * clip : XRectangle* - the clip rectangle to draw into * top_to_bottom : Boolean - drawing top to bottom(True) or * bottom to top(False) * Output: * None. */ /* ARGSUSED */ static void DrawVerticalTab(XmTabBoxWidget tab, XmTabAttributes info, GC gc, Boolean have_pixmap, int pix_width, int pix_height, int pix_depth, Boolean have_label, int label_width, int label_height, XRectangle *clip, Boolean top_to_bottom, Boolean selected) { XRectangle draw; XmFontList font_list = XmTabBox_font_list(tab); int x, y, tmp, spacing = XmTabBox_tab_label_spacing(tab); XImage *src_ximage, *dst_ximage; Pixmap bitmap; Boolean sensitive; x = draw.x = clip->x; y = draw.y = clip->y; draw.width = clip->width; draw.height = clip->height; sensitive = XtIsSensitive((Widget)tab) && info->sensitive; /* * First lets check if we have a pixmap to draw and if we do * lets rotate and draw it. */ if( have_pixmap ) { /* * We do have a pixmap so we will start by rotating the pixmap * to the correct orientation. */ src_ximage = NULL; if( !XmTabBox_use_image_cache(tab) || (dst_ximage = CachePixmap(tab,info)) == NULL ) { src_ximage = XGetImage(XtDisplay(tab), info->label_pixmap, 0, 0, pix_width, pix_height, AllPlanes, XYPixmap); dst_ximage = XiRotateImage(tab, src_ximage, XiTabDegree(XmTabBox_tab_orientation(tab))); if( XmTabBox_use_image_cache(tab) ) { CachePixmap(tab,info) = dst_ximage; } } /* * Now that we have the rotated image lets snarf the width and height * back into local cache. */ pix_width = XImageWidth(dst_ximage); pix_height = XImageHeight(dst_ximage); /* * Now lets look at the pixmap placement to determine where we want * to place the pixmap. */ switch( info->pixmap_placement ) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: case XmPIXMAP_ONLY: default: /* * Now that we have rotate the ximage lets cache the width * and hieght of that image away for use. */ pix_width = XImageWidth(dst_ximage); pix_height = XImageHeight(dst_ximage); /* * In these cases we want to look at the alignment of the * tab to determine where we want to place the pixmap * vertically. */ switch( info->label_alignment ) { case XmALIGNMENT_BEGINNING: /* * For this alignement we want to slam the pixmap * to the top of the clipping area. */ if( top_to_bottom ) { y = clip->y; } else { y = clip->y + (int)clip->height - pix_height; } break; case XmALIGNMENT_CENTER: default: /* * For this case we want to center the pixmap in * the vertical space. */ y = clip->y + ((int)clip->height - pix_height)/2; break; case XmALIGNMENT_END: /* * For this alignment we want to slam the pixmap * to the bottom of the clipping area. */ if( top_to_bottom ) { y = clip->y + (int)clip->height - pix_height; } else { y = clip->y; } break; } /* * Since the pixmap will affect the amount of horizontal * space to place the text lets calculate what space is * left for the text. */ if( (tmp = (int)draw.width - (pix_width + spacing)) < 0 ) { draw.width = 0; } else { draw.width = tmp; } /* * Ok now that we have positioned the pixmap vertically * lets see what we want to do with it horizontally. If * we have not label then center it. */ if( info->label_string == NULL ) { x = clip->x + ((int)clip->width - pix_width)/2; } else { switch( info->pixmap_placement ) { case XmPIXMAP_TOP: default: if( top_to_bottom ) { x = clip->x + (int)clip->width - pix_width; } else { x = clip->x; draw.x = x + pix_width + spacing; } break; case XmPIXMAP_BOTTOM: if( top_to_bottom ) { x = clip->x; draw.x = x + pix_width + spacing; } else { x = clip->x + (int)clip->width - pix_width; } break; case XmPIXMAP_ONLY: x = clip->x + ((int)clip->width - pix_width)/2; break; } } break; case XmPIXMAP_LEFT: case XmPIXMAP_RIGHT: /* * For this case we want to slam the pixmap to either the * top or bottom of the clipping area and center it in * the horizontal space. */ if( info->label_string == NULL ) { y = clip->y + ((int)clip->height - pix_height)/2; } else { switch( info->pixmap_placement ) { case XmPIXMAP_LEFT: if( top_to_bottom ) { y = clip->y; draw.y = y + pix_height + spacing; } else { y = clip->y + (int)clip->height - pix_height; } break; case XmPIXMAP_RIGHT: if( top_to_bottom ) { y = clip->y + (int)clip->height - pix_height; } else { y = clip->y; draw.y = y + pix_height + spacing; } break; default: break; } } x = clip->x + ((int)clip->width - pix_width)/2; /* * Since the pixmap will affect the amount of * vertical space that the text will have lets * calculate what space is left. */ if( (tmp = (int)draw.height - (pix_height + spacing)) < 0 ) { draw.height = 0; } else { draw.height = tmp; } break; case XmPIXMAP_NONE: /* notreached */ break; } /* * Now that we know where the image is supposed to go, lets * draw the thing. */ XPutImage(XtDisplay(tab), XiCanvas(tab), gc, dst_ximage, 0, 0, x, y, pix_width, pix_height); if( !sensitive ) { /* * Since we are working with a non-sensitive tab, then we need to * stipple the the pixmap, and the only way to do that is * to copy a chess board pattern (the gray stipple) over the pixmap * we just drew. */ SetStippledGC(XtDisplay(tab), tab->manager.background_GC, XmTabBox__gray_stipple(tab)); XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.background_GC, x, y, pix_width, pix_height); RemoveStipple(XtDisplay(tab), tab->manager.background_GC); } /* * We are done with the XImages now so lets destroy the * ximages we used to rotate the pixmap. */ if( src_ximage != NULL ) XDestroyImage(src_ximage); if( !XmTabBox_use_image_cache(tab) && dst_ximage != NULL ) { XDestroyImage(dst_ximage); } } /* * Now that we have drawn the pixmap it is time to deal with the * label string. */ if( !have_label || info->label_string == NULL ) return; /* * If we have a pixmap then the clipping area was modified so * we need to set the clip rectangle to that for the text. */ if( have_pixmap ) { XSetClipRectangles(XtDisplay(tab), gc, 0, 0, &draw, 1, YXBanded); } src_ximage = NULL; if( !XmTabBox_use_image_cache(tab) || (sensitive != CacheSensitive(tab,info)) || (dst_ximage = CacheLabel(tab, info)) == NULL ) { /* * Now we have to render and rotate the label string. To do this * we need to first set up a few things like the pixmap to render * into and GC used to draw into a bitmap. We will start by * making sure that we have a pixmap large enough to * accomidate the string we are about to render. */ if( ValidPixmap(XmTabBox__bitmap(tab)) && (XmTabBox__bitmap_width(tab) < label_width || XmTabBox__bitmap_height(tab) < label_height) ) { /* * As it turns out our pixmap is not large enough to * hold the rendered text. So we will destroy the * current pixmap so that we will allocate a pixmap * of the correct size below. */ XFreePixmap(XtDisplay(tab), XmTabBox__bitmap(tab)); XmTabBox__bitmap(tab) = XmUNSPECIFIED_PIXMAP; } /* * If we do not have a bitmap to render the text into * lets create one now. */ if( !ValidPixmap(XmTabBox__bitmap(tab)) ) { XmTabBox__bitmap(tab) = XCreatePixmap(XtDisplay(tab), XiCanvas(tab), label_width, label_height, 1); XmTabBox__bitmap_width(tab) = label_width; XmTabBox__bitmap_height(tab) = label_height; } bitmap = XmTabBox__bitmap(tab); /* * Now that we have a bitmap to render the text into lets make sure * that we have GC that we can use to render the text. We need two * GC, one to clear the pixmap the other to draw into it. */ if( XmTabBox__zero_GC(tab) == NULL ) { /* * We do not yet have either of the GC created so lets go * ahead and create them now. */ XFontStruct *font = NULL; XGCValues gcValues; unsigned long gcMask; #ifndef FIX_1381 gcValues.foreground = 0; gcValues.background = 0; #else gcValues.background = tab->core.background_pixel; gcValues.foreground = tab->core.background_pixel; #endif XmTabBox__zero_GC(tab) = XCreateGC(XtDisplay(tab), bitmap, GCForeground | GCBackground, &gcValues); XmeRenderTableGetDefaultFont(font_list, &font); gcValues.foreground = 1; gcValues.background = 0; gcMask = GCForeground | GCBackground; if (font) { gcValues.font = font->fid; gcMask |= GCFont; } XmTabBox__one_GC(tab) = XCreateGC(XtDisplay(tab), bitmap, gcMask, &gcValues); } /* * Now we have all that we need to render the label string, so now * lets do it. What we need to do if first zero the pixmap and * then render the text. */ XFillRectangle(XtDisplay(tab), bitmap, XmTabBox__zero_GC(tab), 0, 0, label_width, label_height); if( !sensitive ) { #ifndef FIX_1381 SetStippledGC(XtDisplay(tab), XmTabBox__one_GC(tab), XmTabBox__gray_stipple(tab)); #else /*Draw shadow for insensitive text*/ /*text will be rotated below but shadow should be always under the text*/ int x,y; if (XmTabBox_tab_orientation(tab)==XmTABS_TOP_TO_BOTTOM){ x=1; y=-1; } else { x=-1; y=1; } SetRightGC(tab, XmTabBox__one_GC(tab), shadow); XmStringDraw(XtDisplay(tab), bitmap, font_list, info->label_string, XmTabBox__one_GC(tab), x, y, (Dimension)label_width, info->label_alignment, info->string_direction, NULL); SetRightGC(tab, XmTabBox__one_GC(tab), insensitive); #endif } else { #ifndef FIX_1381 RemoveStipple(XtDisplay(tab), XmTabBox__one_GC(tab)); #else SetRightGC(tab, XmTabBox__one_GC(tab), normal); #endif } XmStringDraw(XtDisplay(tab), bitmap, font_list, info->label_string, XmTabBox__one_GC(tab), 0, 0, (Dimension)label_width, info->label_alignment, info->string_direction, NULL); /* * Now that the label string is rendered we need to grab it back * into an XImage so that we can rotate it. */ src_ximage = XGetImage(XtDisplay(tab), bitmap, 0, 0, label_width, label_height, 1, XYPixmap); dst_ximage = XiRotateImage(tab, src_ximage, XiTabDegree(XmTabBox_tab_orientation(tab))); if( XmTabBox_use_image_cache(tab) ) { CacheLabel(tab, info) = dst_ximage; CacheSensitive(tab,info) = sensitive; } } /* * Now that the text is rotated lets snarf the label width and height * back from the image. */ if (dst_ximage) { label_width = XImageWidth(dst_ximage); label_height = XImageHeight(dst_ximage); } else { label_width = 0; label_height = 0; } /* * Now we need to find out where we want to but the text. We know that * we want to center the text in the horizontal space that we have left, * then we want to use the alignment value to determine what to * do with the vertical space. */ x = draw.x + ((int)draw.width - label_width)/2; switch( info->label_alignment ) { case XmALIGNMENT_BEGINNING: /* * Here we want to slam the text to the top of the clipping * area. */ if( top_to_bottom ) { y = draw.y; } else { y = draw.y + (int)draw.height - label_height; } break; case XmALIGNMENT_CENTER: default: /* * Here we want to center the text in the clipping area. */ y = draw.y + ((int)draw.height - label_height)/2; break; case XmALIGNMENT_END: /* * Here we want to slam the text to the bottom of the * clipping area. */ if( top_to_bottom ) { y = draw.y + (int)draw.height - label_height; } else { y = draw.y; } break; } /* * Now that we know where we want the text lets push that * XImage over the wire. But first we need to check if we should * mask out the text so that the background pixmap show through. */ if( ValidPixmap(tab->core.background_pixmap) || XiBackgroundSpecified(info) || (selected && XiSelectSpecified(tab)) ) { /* * It appears that we have a background pixmap so what we * want to do is set the clip mask such that we only draw the * text and not the rectangle around it. * * What we are going to do is create a bitmap and draw the text * into this pixmap to create a GC clipping mask. */ Pixmap pix = XCreatePixmap(XtDisplay(tab), (XtIsRealized((Widget)tab) ? XtWindow(tab) : RootWindowOfScreen(XtScreen(tab))), label_width, label_height, 1); /* * Left first clear out the clipping mask and then draw the text * into it. */ XFillRectangle(XtDisplay(tab), pix, XmTabBox__zero_GC(tab), 0, 0, label_width, label_height); XPutImage(XtDisplay(tab), pix, XmTabBox__one_GC(tab), dst_ximage, 0, 0, 0, 0, label_width, label_height); /* * Now that we have the clipping mask lets set the mask to the GC * and then put the image that is the text to the display using this * clipping mask. */ XSetClipMask(XtDisplay(tab), gc, pix); XSetClipOrigin(XtDisplay(tab), gc, x, y); XPutImage(XtDisplay(tab), XiCanvas(tab), gc, dst_ximage, 0, 0, x, y, label_width, label_height); /* * We are done with this cliping mask so lets destroy the pixmap. */ XFreePixmap(XtDisplay(tab), pix); } else { if (dst_ximage) XPutImage(XtDisplay(tab), XiCanvas(tab), gc, dst_ximage, 0, 0, x, y, label_width, label_height); } /* * Now that we are done with the XImages used for rotating the * text lets delete them. */ if( src_ximage != NULL ) XDestroyImage(src_ximage); if( !XmTabBox_use_image_cache(tab) && dst_ximage != NULL ) { XDestroyImage(dst_ximage); } } static void FillRoundedTab(XmTabBoxWidget tab, GC gc, XiTabRect *geometry, XmTabEdge edge) { XRectangle rect[2]; int x = geometry->x, y = geometry->y, width = geometry->width, height = geometry->height, side; side = XmTabBox__corner_size(tab); if( width < height ) { AssignMin(side, (width/2)); } else { AssignMin(side, (height/2)); } switch( edge ) { case XmTAB_EDGE_TOP_LEFT: default: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { rect[0].x = x; rect[0].y = y; rect[0].width = width; rect[0].height = height - side; rect[1].x = x + side; rect[1].y = y + height - side; rect[1].width = width - (2 * side); rect[1].height = side; XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x, y + height - side, side, side, XiQUAD_3); XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x + width - side, y + height - side, side, side, XiQUAD_4); } else { rect[0].x = x; rect[0].y = y; rect[0].width = width - side; rect[0].height = height; rect[1].x = x + width - side; rect[1].y = y + side; rect[1].width = side; rect[1].height = height - (2 * side); XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x + width - side, y, side, side, XiQUAD_1); XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x + width - side, y + height - side, side, side, XiQUAD_4); } break; case XmTAB_EDGE_BOTTOM_RIGHT: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { rect[0].x = x; rect[0].y = y + side; rect[0].width = width; rect[0].height = height - side; rect[1].x = x + side; rect[1].y = y; rect[1].width = width - (2 * side); rect[1].height = side; XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x + width - side, y, side, side, XiQUAD_1); XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x, y, side, side, XiQUAD_2); } else { rect[0].x = x + side; rect[0].y = y; rect[0].width = width - side; rect[0].height = height; rect[1].x = x; rect[1].y = y + side; rect[1].width = side; rect[1].height = height - (2 * side); XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x, y, side, side, XiQUAD_2); XiFillCorner(XtDisplay(tab), XiCanvas(tab), gc, x, y + height - side, side, side, XiQUAD_3); } break; } XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, 2); } static void FillBeveledTab(XmTabBoxWidget tab, GC gc, XiTabRect *geometry, XmTabEdge edge) { XPoint pt[6]; int x = geometry->x, y = geometry->y, width = geometry->width, height = geometry->height, side; side = XmTabBox__corner_size(tab); if( width < height ) { AssignMin(side, (width/2)); } else { AssignMin(side, (height/2)); } switch( edge ) { case XmTAB_EDGE_TOP_LEFT: default: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { pt[0].x = x; pt[0].y = y; pt[1].x = x; pt[1].y = y + height - side; pt[2].x = x + side; pt[2].y = y + height; pt[3].x = x + width - side; pt[3].y = y + height; pt[4].x = x + width; pt[4].y = y + height - side; pt[5].x = x + width; pt[5].y = y; } else { pt[0].x = x; pt[0].y = y; pt[1].x = x + width - side; pt[1].y = y; pt[2].x = x + width; pt[2].y = y + side; pt[3].x = x + width; pt[3].y = y + height - side; pt[4].x = x + width - side; pt[4].y = y + height; pt[5].x = x; pt[5].y = y + height; } break; case XmTAB_EDGE_BOTTOM_RIGHT: if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { pt[0].x = x; pt[0].y = y + height; pt[1].x = x; pt[1].y = y + side; pt[2].x = x + side; pt[2].y = y; pt[3].x = x + width - side; pt[3].y = y; pt[4].x = x + width; pt[4].y = y + side; pt[5].x = x + width; pt[5].y = y + height; } else { pt[0].x = x + width; pt[0].y = y + height; pt[1].x = x + side; pt[1].y = y + height; pt[2].x = x; pt[2].y = y + height - side; pt[3].x = x; pt[3].y = y + side; pt[4].x = x + side; pt[4].y = y; pt[5].x = x + width; pt[5].y = y; } break; } XFillPolygon(XtDisplay(tab), XiCanvas(tab), gc, pt, 6, Nonconvex, CoordModeOrigin); } int XmTabBoxGetIndex(Widget widget, int x, int y) { return( XiXYtoTab((XmTabBoxWidget)widget, x, y) ); } static void CalcStackedGeometry(XmTabBoxWidget tab, XRectangle *rect) { XmTabbedStackList list = XmTabBox_tab_list(tab); XmTabAttributes info; int i, count = _XmTabbedStackListCount(list), max_width, max_height, tab_width, tab_height, num_stacks = XmTabBox_num_stacks(tab); Dimension d_width, d_height; /* * Calculating the geometry we want for the stack layout turns * out to be straight forward. What we do is find calculate the * size of the largest tab and then use that to calculate the * geometry we want. */ max_width = max_height = 0; for( i = 0; i < count; ++i ) { info = _XmTabbedStackListGet(list, i); XiCalcTabSize(tab, info, &d_width, &d_height); AssignMax(max_width, (int)d_width); AssignMax(max_height, (int)d_height); XmTabBox__wanted(tab)[i].width = d_width; XmTabBox__wanted(tab)[i].height = d_height; } /* * Since we are in stacked modes, all tabs must be the same size. */ for( i = 0; i < count; ++i ) { XmTabBox__wanted(tab)[i].width = max_width; XmTabBox__wanted(tab)[i].height = max_height; } /* * Now that we know what the max tab's size is so lets use that and * the XmNnumStacks resource to figure out the size that we want to * be. */ if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { tab_width = num_stacks * max_width; tab_height = ((int)(count/num_stacks) + (count%num_stacks ? 1 : 0)) * max_height; } else { tab_height = num_stacks * max_height; tab_width = ((int)(count/num_stacks) + (count%num_stacks ? 1 : 0)) * max_width; } rect->width = tab_width; rect->height = tab_height; } static void HorizontalStackedLayout(XmTabBoxWidget tab, Boolean is_static) { int i, x, y, width, per_line, num_rows, tab_width, tab_height, tmp, on_line, start_x, offset, row, idx, cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); XiTabRect *actual = XmTabBox__actual(tab); XRectangle *wanted = XmTabBox__wanted(tab); if( cnt == 0 ) return; offset = XmTabBox_tab_offset(tab); width = XtWidth(tab); tab_width = 0; for( i = 0; i < cnt; ++i ) { AssignMax(tab_width, (int)wanted[i].width); } /* * Since we are doing a stacked layout we know that uniform tab * size are a must, so lets find out how many tabs we can fit on * a line. */ per_line = cnt; num_rows = (int)(cnt/per_line) + (cnt % per_line > 0 ? 1 : 0); tmp = (per_line * tab_width) + (num_rows * offset); while( per_line > 1 && tmp > width ) { per_line--; num_rows = (int)(cnt/per_line) + (cnt % per_line > 0 ? 1 : 0); tmp = (per_line * tab_width) + (num_rows * offset); } AssignMax(num_rows, 1); AssignMax(per_line, 1); tab_height = ((int)XtHeight(tab))/ num_rows; if( num_rows > 1 ) { tab_width = (((int)XtWidth(tab)) - ((num_rows-1) * offset))/per_line; } AssignMax(tab_height, 1); AssignMax(tab_width, 1); /* * Now that we know what size each tab is going to be, we need to * the location for each tab. This is done differently depending * if we are doing a static or dynamic stacked layout. For the * static layout the tabs are always in the same location so we * can choose a row/column as we place them. For the dynamic we * will first choose a row column and then a pixel location. */ if( is_static ) { start_x = x = (LayoutIsRtoLP(tab) ? (per_line-1) * tab_width + offset * (num_rows-1) : 0); on_line = 0; row = 0; if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { y = (int) XtHeight(tab) - tab_height; for( i = 0; i < cnt; ++i ) { actual[i].x = x; actual[i].y = y; actual[i].width = tab_width; actual[i].height = tab_height; actual[i].row = row; actual[i].column = on_line; if( ++on_line >= per_line ) { on_line = 0; start_x += (LayoutIsRtoLP(tab) ? -offset : offset); x = start_x; y -= tab_height; row++; } else { x += (LayoutIsRtoLP(tab) ? -tab_width : tab_width); } } } else { y = 0; for( i = 0; i < cnt; ++i ) { actual[i].x = x; actual[i].y = y; actual[i].width = tab_width; actual[i].height = tab_height; actual[i].row = row; actual[i].column = on_line; if( ++on_line >= per_line ) { on_line = 0; start_x += (LayoutIsRtoLP(tab) ? -offset : offset); x = start_x; y += tab_height; row++; } else { x += (LayoutIsRtoLP(tab) ? -tab_width : tab_width); } } } XmTabBox__num_rows(tab) = num_rows; XmTabBox__num_columns(tab) = per_line; } else { /* * The challenge here is to make sure that the selected tab is * always on row 0. So the first thing we need to do is break up * the tabs into rows. */ start_x = x = (LayoutIsRtoLP(tab) ? (per_line-1)*tab_width + offset*(num_rows-1) : 0); on_line = 0; row = 0; if( XmTabBox__selected(tab) < 0 ) { idx = 0; } else { idx = (int)(XmTabBox__selected(tab)/ per_line) * per_line; } if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { y = (int) XtHeight(tab) - tab_height; for( i = 0; i < cnt; ++i ) { actual[idx].x = x; actual[idx].y = y; actual[idx].width = tab_width; actual[idx].height = tab_height; actual[idx].row = row; actual[idx++].column = on_line; if( ++on_line >= per_line || idx >= cnt ) { on_line = 0; start_x += LayoutIsRtoLP(tab) ? -offset : offset; x = start_x; y -= tab_height; row++; } else { x += LayoutIsRtoLP(tab) ? -tab_width : tab_width; } if( idx >= cnt ) idx = 0; } } else { y = 0; for( i = 0; i < cnt; ++i ) { actual[idx].x = x; actual[idx].y = y; actual[idx].width = tab_width; actual[idx].height = tab_height; actual[idx].row = row; actual[idx++].column = on_line; if( ++on_line >= per_line || idx >= cnt ) { on_line = 0; start_x += LayoutIsRtoLP(tab) ? -offset : offset; x = start_x; y += tab_height; row++; } else { x += LayoutIsRtoLP(tab) ? -tab_width : tab_width; } if( idx >= cnt ) idx = 0; } } XmTabBox__num_rows(tab) = num_rows; XmTabBox__num_columns(tab) = per_line; } } static void VerticalStackedLayout(XmTabBoxWidget tab, Boolean is_static) { int i, x, y, height, per_line, num_rows, tab_width, tab_height, tmp, on_line, start_y, offset, row, idx, cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); XiTabRect *actual = XmTabBox__actual(tab); XRectangle *wanted = XmTabBox__wanted(tab); if( cnt == 0 ) return; offset = XmTabBox_tab_offset(tab); height = XtHeight(tab); tab_height = 0; for( i = 0; i < cnt; ++i ) { AssignMax(tab_height, (int)wanted[i].height); } per_line = cnt; num_rows = (int)(cnt/per_line) + (cnt % per_line > 0 ? 1 : 0); tmp = (per_line * tab_height) + (num_rows * offset); while( per_line > 1 && tmp > height ) { per_line--; num_rows = (int)(cnt/per_line) + (cnt % per_line > 0 ? 1 : 0); tmp = (per_line * tab_height) + (num_rows * offset); } AssignMax(num_rows, 1); AssignMax(per_line, 1); if( num_rows > 1 ) { tab_height = (((int)XtHeight(tab)) - ((num_rows-1) * offset))/per_line; } tab_width = ((int)XtWidth(tab))/num_rows; AssignMax(tab_height, 1); AssignMax(tab_width, 1); /* * Now that we know what size each tab is going to be, we need to * the location for each tab. This is done differently depending * if we are doing a static or dynamic stacked layout. For the * static layout the tabs are always in the same location so we * can choose a row/column as we place them. For the dynamic we * will first choose a row column and then a pixel location. */ if( is_static ) { start_y = y = 0; on_line = 0; row = 0; if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { x = (int)XtWidth(tab) - tab_width; for( i = 0; i < cnt; ++i ) { actual[i].x = x; actual[i].y = y; actual[i].width = tab_width; actual[i].height = tab_height; actual[i].row = row; actual[i].column = on_line; if( ++on_line >= per_line ) { on_line = 0; start_y += offset; y = start_y; x -= tab_width; row++; } else { y += tab_height; } } } else { x = 0; for( i = 0; i < cnt; ++i ) { actual[i].x = x; actual[i].y = y; actual[i].width = tab_width; actual[i].height = tab_height; actual[i].row = row; actual[i].column = on_line; if( ++on_line >= per_line ) { on_line = 0; start_y += offset; y = start_y; x += tab_width; row++; } else { y += tab_height; } } } XmTabBox__num_rows(tab) = num_rows; XmTabBox__num_columns(tab) = per_line; } else { /* * The challenge here is to make sure that the selected tab is * always on row 0. So the first thing we need to do is break up * the tabs into rows. */ start_y = y = 0; on_line = 0; row = 0; if( XmTabBox__selected(tab) < 0 ) { idx = 0; } else { idx = (int)(XmTabBox__selected(tab)/ per_line) * per_line; } if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { x = (int)XtWidth(tab) - tab_width; for( i = 0; i < cnt; ++i ) { actual[idx].x = x; actual[idx].y = y; actual[idx].width = tab_width; actual[idx].height = tab_height; actual[idx].row = row; actual[idx++].column = on_line; if( ++on_line >= per_line || idx >= cnt ) { on_line = 0; start_y += offset; y = start_y; x -= tab_width; row++; } else { y += tab_height; } if( idx >= cnt ) idx = 0; } } else { x = 0; for( i = 0; i < cnt; ++i ) { actual[idx].x = x; actual[idx].y = y; actual[idx].width = tab_width; actual[idx].height = tab_height; actual[idx].row = row; actual[idx++].column = on_line; if( ++on_line >= per_line || idx >= cnt ) { on_line = 0; start_y += offset; y = start_y; x += tab_width; row++; } else { y += tab_height; } if( idx >= cnt ) idx = 0; } } XmTabBox__num_rows(tab) = num_rows; XmTabBox__num_columns(tab) = per_line; } } /* * Function: * RedisplayTabs(tab, region) * Description: * Walks the list of tabs and redisplays any tab that intersets with * the given region. If the region specified is "False" then all tabs * are exposed (see macro XiRectInRegion). * Input: * tab : XmTabBoxWidget - tab box, whose tabs need redisplayed * region : Region - the region to expose or False for all * Output: * None. */ static void RedisplayTabs(XmTabBoxWidget tab, Region region) { XiTabRect *geom; int i, count = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); XmTabAttributes info; /* * Now lets walk through our list of tabs and redisplay any tab that * lies in the region. */ geom = XmTabBox__actual(tab); for( i = 0; i < count; ++i ) { if( XiRectInRegion(region, geom[i].x, geom[i].y, geom[i].width, geom[i].height) ) { info = _XmTabbedStackListGet(XmTabBox_tab_list(tab), i); DrawTab(tab, info, &(geom[i]), (Boolean)(XmTabBox__selected(tab) == i), (Boolean)(XmTabBox__keyboard(tab) == i)); } } } static void HorizontalStackedBottomEdgeRedisplay(XmTabBoxWidget tab) { XmTabbedStackList list = XmTabBox_tab_list(tab); int i, count = _XmTabbedStackListCount(list), row = 0, col, shadow = tab->manager.shadow_thickness, x, height, offset, idx, below, corner, cnt, first, last, x1, x2; XmTabAttributes info; XiTabRect *geom; GC gc = XmTabBox__tab_GC(tab); Boolean do_top, do_bottom; #define _NUM_RECTS 10 XRectangle rect[_NUM_RECTS], top = {0, 0, 0, 0}, bottom = {0, 0, 0, 0}; /* * What we need to do in this mode is to extend the right most tab * on each row to the bottom of the widget(minus the shadow). Besides * the bcakground of the widget we also need to extend the shadow. */ offset = XmTabBox_tab_offset(tab); geom = XmTabBox__actual(tab); /* * First the quick check. If we only have one row then all we need to do * is draw the base line from the end of the last tab to the right edge. */ if( XmTabBox__num_rows(tab) == 1 && (idx = GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1)) >= 0 ) { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } x = geom[idx].x + geom[idx].width; XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, x, (int)XtHeight(tab) - shadow, (int)XtWidth(tab) - x, shadow); XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, x, 0, (int)XtWidth(tab) - x, (int)XtHeight(tab) - shadow); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, (int)XtWidth(tab) - shadow, (int)XtHeight(tab) - shadow, shadow, XmBEVEL_BOTTOM); return; } for( i = 0; i < count; ++i ) { corner = GetTabIndex(tab, geom[i].row-1, geom[i].column+1); below = GetTabIndex(tab, geom[i].row-1, geom[i].column); if( geom[i].row > 0 && (corner < 0 || below < 0) ) { cnt = 0; do_top = do_bottom = False; info = _XmTabbedStackListGet(list, i); if( XiBackgroundSpecified(info) ) { SetBackgroundGC(tab, info, gc); } else if( ValidPixmap(tab->core.background_pixmap) ) { SetTiledGC(XtDisplay(tab), gc, tab->core.background_pixmap); } else { SetSolidGC(XtDisplay(tab), gc, tab->core.background_pixel); } for( height = geom[i].height, row = geom[i].row - 2; row >= 0 && GetTabIndex(tab, row, geom[i].column+1) < 0; row--, height += geom[i].height ); if( corner < 0 ) { if (LayoutIsRtoLP(tab)) { rect[cnt].x = geom[i].x; rect[cnt].y = geom[i].y + geom[i].height; rect[cnt].width = offset; rect[cnt++].height = height; bottom.x = geom[i].x; bottom.y = geom[i].y + geom[i].height; } else { rect[cnt].x = geom[i].x + geom[i].width - offset; rect[cnt].y = geom[i].y + geom[i].height; rect[cnt].width = offset; rect[cnt++].height = height; bottom.x = geom[i].x + geom[i].width - shadow; bottom.y = geom[i].y + geom[i].height; } bottom.width = shadow; bottom.height = height; do_bottom = True; } if( below < 0 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = geom[i].x + offset; } else { rect[cnt].x = geom[i].x; } rect[cnt].y = geom[i].y + geom[i].height; rect[cnt].width = geom[i].width - offset; rect[cnt].height = geom[i].height; cnt++; if( LayoutIsRtoLP(tab) ) { top.x = geom[i].x + geom[i].width - shadow; } else { top.x = geom[i].x; } top.y = geom[i].y + geom[i].height; top.width = shadow; top.height = geom[i].height; do_top = True; if( geom[i].row > 1 && geom[i].column == XmTabBox__num_columns(tab) - 1 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = offset; } else { rect[cnt].x = geom[i].x + geom[i].width - (2*offset); } rect[cnt].y = geom[i].y + geom[i].height; rect[cnt].width = offset; rect[cnt].height = (int)XtHeight(tab) - rect[cnt].y; cnt++; } } XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); if( do_bottom ) { if( LayoutIsRtoLP(tab) ) XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, bottom.x, bottom.y, bottom.width, bottom.height); else XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, bottom.x, bottom.y, bottom.width, bottom.height); } if( do_top ) { if( LayoutIsRtoLP(tab) ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, top.x, top.y, top.width, top.height); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, top.x, top.y, top.width, top.height); } } } } /* * Now that all the tab stuff is done, lets clear all the background * areas to our parents background color. */ { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } cnt = 0; if (LayoutIsRtoLP(tab)) { for( i = 1; i < XmTabBox__num_rows(tab); ++i, x -= offset ) { if( (idx = GetTabIndex(tab, i, 0)) < 0 ) continue; rect[cnt].x = geom[idx].x + geom[idx].width; rect[cnt].y = geom[idx].y; rect[cnt].width = XtWidth(tab) - geom[idx].x; rect[cnt++].height = geom[idx].height; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } } else { x = offset; for( i = 1; i < XmTabBox__num_rows(tab); ++i, x += offset ) { if( (idx = GetTabIndex(tab, i, 0)) < 0 ) continue; rect[cnt].x = 0; rect[cnt].y = geom[idx].y; rect[cnt].width = x; rect[cnt++].height = geom[idx].height; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } } /* * We need to clear any area on the right side of the tabs. To do this * we find the tab in the upper right corner and clear down to the * bottom and then check the top row to see if it is full. */ last = -1; col = XmTabBox__num_columns(tab) - 1; for( i = 0; i < XmTabBox__num_rows(tab); ++i ) { if( (idx = GetTabIndex(tab, i, col)) >= 0 ) { last = idx; } } if( last != -1 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = 0; rect[cnt].y = 0; rect[cnt].width = geom[last].x; rect[cnt++].height = XtHeight(tab); last = GetTabIndex(tab, 0, 0); } rect[cnt].x = geom[last].x + geom[last].width; rect[cnt].y = 0; rect[cnt].width = (int)XtWidth(tab) - rect[cnt].x; rect[cnt++].height = XtHeight(tab); if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } row = XmTabBox__num_rows(tab) - 1; col = XmTabBox__num_columns(tab) - 1; last = -1; if( GetTabIndex(tab, row, col) < 0 ) { for( i = col; i >= 0 && last < 0; last = GetTabIndex(tab, row, --i) ); if( last >= 0 ) { if (LayoutIsRtoLP(tab)) { rect[cnt].x = 0; rect[cnt].width = geom[last].x; } else { rect[cnt].x = geom[last].x + geom[last].width; rect[cnt].width = (int)XtWidth(tab) - rect[cnt].x; } rect[cnt].y = 0; rect[cnt++].height = geom[last].height; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } } if( cnt > 0 ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } /* * If the users wants the special stacked effect then we are done so * lets get out of here. */ if( GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1) >= 0 && XmTabBox_stacked_effect(tab) ) return; /* * Now that we have all the tabs drawn we want to complete the * shadow line from the last tab in the first row to the last * tab in the last row. Lets start by finding the last tab in the * first row and the last tab in the last row. */ first = GetTabIndex(tab, 0, 0);; for( i = 0; i < XmTabBox__num_columns(tab); ++i ) { if( (idx = GetTabIndex(tab, 0, i)) < 0 ) break; first = idx; } if( XmTabBox_stacked_effect(tab) ) { if( first < 0 ) return; /* * If we got here that means that we are doing the stacked effect * and that row 0 is not complete. What this means is that we * need to do is draw a line from the last tab in row 0 to the * location where the row should end. */ if( LayoutIsRtoLP(tab) ) { x1 = offset * ((XmTabBox__num_rows(tab) - 1)); x2 = geom[first].x; } else { x1 = geom[first].x + geom[first].width; x2 = XmTabBox__num_columns(tab) * geom[first].width; } } else { x1 = geom[first].x + geom[first].width; x2 = XtWidth(tab); } /* * Now that we know what we are dealing with all we have to do * is draw the line. */ XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, x1, (int)XtHeight(tab) - shadow, x2 - x1, shadow); if( !LayoutIsRtoLP(tab) ) { XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, x2 - shadow, (int)XtHeight(tab) - shadow, shadow, XmBEVEL_BOTTOM); } } static void HorizontalStackedTopEdgeRedisplay(XmTabBoxWidget tab) { XmTabbedStackList list = XmTabBox_tab_list(tab); int i, count = _XmTabbedStackListCount(list), row = 0, col, shadow = tab->manager.shadow_thickness, x, height, offset, idx, below, corner, cnt, first, last, x1, x2; XmTabAttributes info; XiTabRect *geom; GC gc = XmTabBox__tab_GC(tab); Boolean do_top, do_bottom; #define _NUM_RECTS 10 XRectangle rect[_NUM_RECTS], top = {0, 0, 0, 0}, bottom = {0, 0, 0, 0}; offset = XmTabBox_tab_offset(tab); geom = XmTabBox__actual(tab); /* * First the quick check. If we only have one row then all we need to do * is draw the base line from the end of the last tab to the right edge. */ if( XmTabBox__num_rows(tab) == 1 && (idx = GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1)) >= 0 ) { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } x = geom[idx].x + geom[idx].width; XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, x, 0, (int)XtWidth(tab) - x, shadow); XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, x, shadow, (int)XtWidth(tab) - x, (int)XtHeight(tab) - shadow); return; } for( i = 0; i < count; ++i ) { corner = GetTabIndex(tab, geom[i].row-1, geom[i].column+1); below = GetTabIndex(tab, geom[i].row-1, geom[i].column); if( geom[i].row > 0 && (corner < 0 || below < 0) ) { cnt = 0; do_top = do_bottom = False; info = _XmTabbedStackListGet(list, i); if( XiBackgroundSpecified(info) ) { SetBackgroundGC(tab, info, gc); } else if( ValidPixmap(tab->core.background_pixmap) ) { SetTiledGC(XtDisplay(tab), gc, tab->core.background_pixmap); } else { SetSolidGC(XtDisplay(tab), gc, tab->core.background_pixel); } for( height = geom[i].height, row = geom[i].row - 2; row >= 0 && GetTabIndex(tab, row, geom[i].column+1) < 0; row--, height += geom[i].height ); if( corner < 0 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = geom[i].x; bottom.x = geom[i].x; } else { rect[cnt].x = geom[i].x + geom[i].width - offset; bottom.x = geom[i].x + geom[i].width - shadow; } rect[cnt].y = geom[i].y - height; rect[cnt].width = offset; rect[cnt++].height = height; bottom.y = geom[i].y - height; bottom.width = shadow; bottom.height = height; do_bottom = True; } if( below < 0 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = geom[i].x + offset; } else { rect[cnt].x = geom[i].x; } rect[cnt].y = geom[i].y - geom[i].height; rect[cnt].width = geom[i].width - offset; rect[cnt++].height = geom[i].height; if( LayoutIsRtoLP(tab) ) { top.x = geom[i].x + geom[i].width - shadow; } else { top.x = geom[i].x; } top.y = geom[i].y - geom[i].height; top.width = shadow; top.height = geom[i].height; do_top = True; if( geom[i].row > 1 && geom[i].column == XmTabBox__num_columns(tab) - 1 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = offset; } else { rect[cnt].x = geom[i].x + geom[i].width - (2*offset); } rect[cnt].y = 0; rect[cnt].width = offset; rect[cnt].height = geom[i].y; cnt++; } } XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); if( do_bottom ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), LayoutIsRtoLP(tab) ? tab->manager.top_shadow_GC : tab->manager.bottom_shadow_GC, bottom.x, bottom.y, bottom.width, bottom.height); } if( do_top ) { if( LayoutIsRtoLP(tab) ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, top.x, top.y, top.width, top.height); } else { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, top.x, top.y, top.width, top.height); } } } } /* * Now that all the tab stuff is done, lets clear all the background * areas to our parents background color. */ { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } x = offset; cnt = 0; for( i = 1; i < XmTabBox__num_rows(tab); ++i, x += offset ) { if( (idx = GetTabIndex(tab, i, 0)) < 0 ) continue; rect[cnt].x = LayoutIsRtoLP(tab) ? geom[idx].x + geom[idx].width : 0; rect[cnt].y = geom[idx].y; rect[cnt].width = x; rect[cnt++].height = geom[idx].height; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } /* * We need to clear any area on the right side of the tabs. To do this * we find the tab in the upper right corner and clear down to the * bottom and then check the top row to see if it is full. */ last = -1; col = XmTabBox__num_columns(tab) - 1; for( i = 0; i < XmTabBox__num_rows(tab); ++i ) { if( (idx = GetTabIndex(tab, i, col)) >= 0 ) { last = idx; } } if( last != -1 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = 0; rect[cnt].y = 0; rect[cnt].width = geom[last].x; rect[cnt++].height = XtHeight(tab); last = GetTabIndex(tab, 0, 0); } rect[cnt].x = geom[last].x + geom[last].width; rect[cnt].y = 0; rect[cnt].width = (int)XtWidth(tab) - rect[cnt].x; rect[cnt++].height = XtHeight(tab); if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } row = XmTabBox__num_rows(tab) - 1; col = XmTabBox__num_columns(tab) - 1; last = -1; if( GetTabIndex(tab, row, col) < 0 ) { for( i = col; i >= 0 && last < 0; last = GetTabIndex(tab, row, --i) ); if( last >= 0 ) { if( LayoutIsRtoLP(tab) ) { rect[cnt].x = 0; rect[cnt].y = (int)XtHeight(tab) - geom[last].height; rect[cnt].width = geom[last].x; rect[cnt++].height = geom[last].height; } else { rect[cnt].x = geom[last].x + geom[last].width; rect[cnt].y = (int)XtHeight(tab) - geom[last].height; rect[cnt].width = (int)XtWidth(tab) - rect[cnt].x; rect[cnt++].height = geom[last].height; } if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } } if( cnt > 0 ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } /* * If the users wants the special stacked effect then we are done so * lets get out of here. */ if( GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1) >= 0 && XmTabBox_stacked_effect(tab) ) return; /* * Now that we have all the tabs drawn we want to complete the * shadow line from the last tab in the first row to the last * tab in the last row. Lets start by finding the last tab in the * first row and the last tab in the last row. */ first = GetTabIndex(tab, 0, 0);; for( i = 0; i < XmTabBox__num_columns(tab); ++i ) { if( (idx = GetTabIndex(tab, 0, i)) < 0 ) break; first = idx; } if( XmTabBox_stacked_effect(tab) ) { if( first < 0 ) return; /* * If we got here that means that we are doing the stacked effect * and that row 0 is not complete. What this means is that we * need to do is draw a line from the last tab in row 0 to the * location where the row should end. */ if( LayoutIsRtoLP(tab) ) { x1 = offset * (XmTabBox__num_rows(tab) - 1) + shadow; x2 = geom[first].x; XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, x1 - shadow, 0, shadow, XmBEVEL_BOTH); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, tab->manager.top_shadow_GC, x2, 0, shadow, XmBEVEL_BOTH); } else { x1 = geom[first].x + geom[first].width; x2 = XmTabBox__num_columns(tab) * geom[first].width; } } else { x1 = geom[first].x + geom[first].width; x2 = XtWidth(tab); } /* * Now that we know what we are dealing with all we have to do * is draw the line. */ XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, x1, 0, x2 - x1, shadow); } static void HorizontalStackedRedisplay(XmTabBoxWidget tab) { if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { HorizontalStackedBottomEdgeRedisplay(tab); } else { HorizontalStackedTopEdgeRedisplay(tab); } } static void VerticalStackedRightEdgeRedisplay(XmTabBoxWidget tab) { XmTabbedStackList list = XmTabBox_tab_list(tab); int i, count = _XmTabbedStackListCount(list), row = 0, col, shadow = tab->manager.shadow_thickness, y, width, offset, idx, below, corner, cnt = 0, first, last, y1, y2; XmTabAttributes info; XiTabRect *geom; GC gc = XmTabBox__tab_GC(tab); Boolean do_top, do_bottom; #define _NUM_RECTS 10 XRectangle rect[_NUM_RECTS], top = {0, 0, 0, 0}, bottom = {0, 0, 0, 0}; /* * What we need to do in this mode is to extend the right most tab * on each row to the bottom of the widget(minus the shadow). Besides * the bcakground of the widget we also need to extend the shadow. */ offset = XmTabBox_tab_offset(tab); geom = XmTabBox__actual(tab); /* * First the quick check. If we only have one row then all we need to do * is draw the base line from the end of the last tab to the right edge. */ if( XmTabBox__num_rows(tab) == 1 && (idx = GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1)) >= 0 ) { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } y = geom[idx].y + geom[idx].height; XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, (int)XtWidth(tab) - shadow, y, shadow, (int)XtHeight(tab) - y); XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, 0, y, (int)XtWidth(tab) - shadow, (int)XtHeight(tab) - y); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, (int)XtWidth(tab) - shadow, (int)XtHeight(tab) - shadow, shadow, XmBEVEL_BOTTOM); return; } for( i = 0; i < count; ++i ) { corner = GetTabIndex(tab, geom[i].row-1, geom[i].column+1); below = GetTabIndex(tab, geom[i].row-1, geom[i].column); if( geom[i].row > 0 && (corner < 0 || below < 0) ) { cnt = 0; do_top = do_bottom = False; info = _XmTabbedStackListGet(list, i); if( XiBackgroundSpecified(info) ) { SetBackgroundGC(tab, info, gc); } else if( ValidPixmap(tab->core.background_pixmap) ) { SetTiledGC(XtDisplay(tab), gc, tab->core.background_pixmap); } else { SetSolidGC(XtDisplay(tab), gc, tab->core.background_pixel); } for( width = geom[i].width, row = geom[i].row - 2; row >= 0 && GetTabIndex(tab, row, geom[i].column+1) < 0; row--, width += geom[i].width ); if( corner < 0 ) { rect[cnt].x = geom[i].x + geom[i].width; rect[cnt].y = geom[i].y + geom[i].height- offset; rect[cnt].width = width; rect[cnt++].height = offset; bottom.x = geom[i].x + geom[i].width; bottom.y = geom[i].y + geom[i].height - shadow; bottom.width = width; bottom.height = shadow; do_bottom = True; } if( below < 0 ) { rect[cnt].x = geom[i].x + geom[i].width; rect[cnt].y = geom[i].y; rect[cnt].width = geom[i].width; rect[cnt++].height = geom[i].height - offset; top.x = geom[i].x + geom[i].width; top.y = geom[i].y; top.width = geom[i].width; top.height = shadow; do_top = True; if( geom[i].row > 1 && geom[i].column == XmTabBox__num_columns(tab) - 1 ) { rect[cnt].x = geom[i].x + geom[i].width; rect[cnt].y = geom[i].y + geom[i].height - (2*offset); rect[cnt].width = (int)XtWidth(tab) - rect[cnt].x; rect[cnt].height = offset; cnt++; } } XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); if( do_bottom ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, bottom.x, bottom.y, bottom.width, bottom.height); } if( do_top ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, top.x, top.y, top.width, top.height); } } } /* * Now that all the tab stuff is done, lets clear all the background * areas to our parents background color. */ { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } y = offset; cnt = 0; for( i = 1; i < XmTabBox__num_rows(tab); ++i, y += offset ) { if( (idx = GetTabIndex(tab, i, 0)) < 0 ) continue; rect[cnt].x = geom[idx].x; rect[cnt].y = 0; rect[cnt].width = geom[idx].width; rect[cnt++].height = y; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } /* * We need to clear any area on the right side of the tabs. To do this * we find the tab in the upper right corner and clear down to the * bottom and then check the top row to see if it is full. */ last = -1; col = XmTabBox__num_columns(tab) - 1; for( i = 0; i < XmTabBox__num_rows(tab); ++i ) { if( (idx = GetTabIndex(tab, i, col)) >= 0 ) { last = idx; } } if( last != -1 ) { rect[cnt].x = 0; rect[cnt].y = geom[last].y + geom[last].height; rect[cnt].width = XtWidth(tab); rect[cnt].height = (int)XtHeight(tab) - rect[cnt].y; cnt++; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } row = XmTabBox__num_rows(tab) - 1; col = XmTabBox__num_columns(tab) - 1; last = -1; if( GetTabIndex(tab, row, col) < 0 ) { for( i = col; i >= 0 && last < 0; last = GetTabIndex(tab, row, --i) ); if( last >= 0 ) { rect[cnt].x = 0; rect[cnt].y = geom[last].y + geom[last].height; rect[cnt].width = geom[last].width; rect[cnt].height = (int)XtHeight(tab) - rect[cnt].y; cnt++; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } } if( cnt > 0 ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } /* * If the users wants the special stacked effect then we are done so * lets get out of here. */ if( GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1) >= 0 && XmTabBox_stacked_effect(tab) ) return; /* * Now that we have all the tabs drawn we want to complete the * shadow line from the last tab in the first row to the last * tab in the last row. Lets start by finding the last tab in the * first row and the last tab in the last row. */ first = GetTabIndex(tab, 0, 0);; for( i = 0; i < XmTabBox__num_columns(tab); ++i ) { if( (idx = GetTabIndex(tab, 0, i)) < 0 ) break; first = idx; } if( XmTabBox_stacked_effect(tab) ) { if( first < 0 ) return; /* * If we got here that means that we are doing the stacked effect * and that row 0 is not complete. What this means is that we * need to do is draw a line from the last tab in row 0 to the * location where the row should end. */ y1 = geom[first].y + geom[first].height; y2 = XmTabBox__num_columns(tab) * geom[first].height; } else { y1 = geom[first].y + geom[first].height; y2 = XtHeight(tab); } /* * Now that we know what we are dealing with all we have to do * is draw the line. */ XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, (int)XtWidth(tab) - shadow, y1, shadow, y2 - y1); XmDrawBevel(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, (int)XtWidth(tab) - shadow, y2 - shadow, shadow, XmBEVEL_BOTTOM); } static void VerticalStackedLeftEdgeRedisplay(XmTabBoxWidget tab) { XmTabbedStackList list = XmTabBox_tab_list(tab); int i, count = _XmTabbedStackListCount(list), row = 0, col, shadow = tab->manager.shadow_thickness, y, width, offset, idx, below, corner, cnt = 0, first, last, y1, y2; XmTabAttributes info; XiTabRect *geom; GC gc = XmTabBox__tab_GC(tab); Boolean do_top, do_bottom; #define _NUM_RECTS 10 XRectangle rect[_NUM_RECTS], top = {0, 0, 0, 0}, bottom = {0, 0, 0, 0}; offset = XmTabBox_tab_offset(tab); geom = XmTabBox__actual(tab); if( XmTabBox__num_rows(tab) == 1 && (idx = GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1)) >= 0 ) { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } y = geom[idx].y + geom[idx].height; XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, 0, y, shadow, (int)XtHeight(tab) - y); XFillRectangle(XtDisplay(tab), XiCanvas(tab), gc, shadow, y, (int)XtWidth(tab) - shadow, (int)XtHeight(tab) - y); return; } for( i = 0; i < count; ++i ) { corner = GetTabIndex(tab, geom[i].row-1, geom[i].column+1); below = GetTabIndex(tab, geom[i].row-1, geom[i].column); if( geom[i].row > 0 && (corner < 0 || below < 0) ) { cnt = 0; do_top = do_bottom = False; info = _XmTabbedStackListGet(list, i); if( XiBackgroundSpecified(info) ) { SetBackgroundGC(tab, info, gc); } else if( ValidPixmap(tab->core.background_pixmap) ) { SetTiledGC(XtDisplay(tab), gc, tab->core.background_pixmap); } else { SetSolidGC(XtDisplay(tab), gc, tab->core.background_pixel); } for( width = geom[i].width, row = geom[i].row - 2; row >= 0 && GetTabIndex(tab, row, geom[i].column+1) < 0; row--, width += geom[i].width ); if( corner < 0 ) { rect[cnt].x = geom[i].x - width; rect[cnt].y = geom[i].y + geom[i].height - offset; rect[cnt].width = width; rect[cnt++].height = offset; bottom.x = geom[i].x - width; bottom.y = geom[i].y + geom[i].height - shadow; bottom.width = width; bottom.height = shadow; do_bottom = True; } if( below < 0 ) { rect[cnt].x = geom[i].x - geom[i].width; rect[cnt].y = geom[i].y; rect[cnt].width = geom[i].width; rect[cnt++].height = geom[i].height - offset; top.x = geom[i].x - geom[i].width; top.y = geom[i].y; top.width = geom[i].width; top.height = shadow; do_top = True; if( geom[i].row > 1 && geom[i].column == XmTabBox__num_columns(tab) - 1 ) { rect[cnt].x = 0; rect[cnt].y = geom[i].y + geom[i].height - (2*offset); rect[cnt].width = geom[i].x; rect[cnt].height = offset; cnt++; } } XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); if( do_bottom ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, bottom.x, bottom.y, bottom.width, bottom.height); } if( do_top ) { XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.top_shadow_GC, top.x, top.y, top.width, top.height); } } } /* * Now that all the tab stuff is done, lets clear all the background * areas to our parents background color. */ { Pixel pixel; Pixmap pixmap; XtVaGetValues(XiGCParent(tab), XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } y = offset; cnt = 0; for( i = 1; i < XmTabBox__num_rows(tab); ++i, y += offset ) { if( (idx = GetTabIndex(tab, i, 0)) < 0 ) continue; rect[cnt].x = geom[idx].x; rect[cnt].y = 0; rect[cnt].width = geom[idx].width; rect[cnt++].height = y; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } /* * We need to clear any area on the right side of the tabs. To do this * we find the tab in the upper right corner and clear down to the * bottom and then check the top row to see if it is full. */ last = -1; col = XmTabBox__num_columns(tab) - 1; for( i = 0; i < XmTabBox__num_rows(tab); ++i ) { if( (idx = GetTabIndex(tab, i, col)) >= 0 ) { last = idx; } } if( last != -1 ) { rect[cnt].x = 0; rect[cnt].y = geom[last].y + geom[last].height; rect[cnt].width = XtWidth(tab); rect[cnt].height = (int)XtHeight(tab) - rect[cnt].y; cnt++; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } row = XmTabBox__num_rows(tab) - 1; col = XmTabBox__num_columns(tab) - 1; last = -1; if( GetTabIndex(tab, row, col) < 0 ) { for( i = col; i >= 0 && last < 0; last = GetTabIndex(tab, row, --i) ); if( last >= 0 ) { rect[cnt].x = (int)XtWidth(tab) - geom[last].width; rect[cnt].y = geom[last].y + geom[last].height; rect[cnt].width = geom[last].width; rect[cnt].height = (int)XtHeight(tab) - rect[cnt].y; cnt++; if( cnt >= _NUM_RECTS ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } } } if( cnt > 0 ) { XFillRectangles(XtDisplay(tab), XiCanvas(tab), gc, rect, cnt); cnt=0; } /* * If the users wants the special stacked effect then we are done so * lets get out of here. */ if( GetTabIndex(tab, 0, XmTabBox__num_columns(tab) - 1) >= 0 && XmTabBox_stacked_effect(tab) ) return; /* * Now that we have all the tabs drawn we want to complete the * shadow line from the last tab in the first row to the last * tab in the last row. Lets start by finding the last tab in the * first row and the last tab in the last row. */ first = GetTabIndex(tab, 0, 0);; for( i = 0; i < XmTabBox__num_columns(tab); ++i ) { if( (idx = GetTabIndex(tab, 0, i)) < 0 ) break; first = idx; } if( XmTabBox_stacked_effect(tab) ) { if( first < 0 ) return; /* * If we got here that means that we are doing the stacked effect * and that row 0 is not complete. What this means is that we * need to do is draw a line from the last tab in row 0 to the * location where the row should end. */ y1 = geom[first].y + geom[first].height; y2 = XmTabBox__num_columns(tab) * geom[first].height; } else { y1 = geom[first].y + geom[first].height; y2 = XtHeight(tab); } /* * Now that we know what we are dealing with all we have to do * is draw the line. */ XFillRectangle(XtDisplay(tab), XiCanvas(tab), tab->manager.bottom_shadow_GC, 0, y1, shadow, y2 - y1); } static void VerticalStackedRedisplay(XmTabBoxWidget tab) { if( XmTabBox_tab_edge(tab) == XmTAB_EDGE_BOTTOM_RIGHT ) { VerticalStackedRightEdgeRedisplay(tab); } else { VerticalStackedLeftEdgeRedisplay(tab); } } static XmTabAttributes GetTabInfo(XmTabBoxWidget tab, int row, int column) { int idx = GetTabIndex(tab, row, column); if( idx < 0 ) return( NULL ); return( _XmTabbedStackListGet(XmTabBox_tab_list(tab), idx) ); } static int GetTabIndex(XmTabBoxWidget tab, int row, int column) { XmTabbedStackList list = XmTabBox_tab_list(tab); int i, count = _XmTabbedStackListCount(list); XiTabRect *rect = XmTabBox__actual(tab); if( row < 0 || column < 0 || count < 1 ) return( -1 ); for( i = 0; i < count; ++i ) { if( row == rect[i].row && column == rect[i].column ) { return( i ); } } return( -1 ); } static void SelectTab(XmTabBoxWidget tab, XEvent *event, int old, int set) { int old_row, set_row; if( old == set ) return; XmTabBox__selected(tab) = set; old_row = set_row = XmTabBox__actual(tab)[set].row; if( old >= 0 ) { old_row = XmTabBox__actual(tab)[old].row; } if( XmTabBox_tab_mode(tab) == XmTABS_STACKED && old_row != set_row ) { Layout(tab); if( XtIsRealized((Widget)tab) ) { Redisplay(XmTabBox__canvas(tab), NULL, False); } } else { if( old != -1 ) { DrawTab(tab, _XmTabbedStackListGet(XmTabBox_tab_list(tab), old), &(XmTabBox__actual(tab)[old]), False, False); } DrawTab(tab, _XmTabbedStackListGet(XmTabBox_tab_list(tab), set), &(XmTabBox__actual(tab)[set]), True, True); } CallCallbacks(tab, event, old, set); } void _XmTabBoxSelectTab(Widget widget, int idx) { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) || idx < 0 || idx >=_XmTabbedStackListCount(XmTabBox_tab_list(tab)) ) return; SelectTab(tab, NULL, XmTabBox__selected(tab), idx); } static Boolean IsTabSensitive(XmTabBoxWidget tab, int idx) { XmTabAttributes info = _XmTabbedStackListGet(XmTabBox_tab_list(tab), idx); if( info != NULL ) return( info->sensitive ); return( False ); } void _XmTabBoxStackedGeometry(XmTabBoxWidget tab, Dimension size, XRectangle *rect) { XmTabbedStackList list = XmTabBox_tab_list(tab); XmTabAttributes info; int i, count = _XmTabbedStackListCount(list), max_width, max_height, tab_width, tab_height, num_cols, num_rows, offset; Dimension d_width, d_height; if( count == 0 ) { if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { rect->width = 2 * tab->manager.shadow_thickness; rect->height = tab->manager.shadow_thickness; } else { rect->width = tab->manager.shadow_thickness; rect->height = 2 * tab->manager.shadow_thickness; } if( rect->width < 1 ) rect->width = 1; if( rect->height < 1 ) rect->height = 1; return; } /* * Calculating the geometry we want for the stack layout turns * out to be straight forward. What we do is find calculate the * size of the largest tab and then use that to calculate the * geometry we want. */ max_width = max_height = 1; for( i = 0; i < count; ++i ) { info = _XmTabbedStackListGet(list, i); XiCalcTabSize(tab, info, &d_width, &d_height); AssignMax(max_width, (int)d_width); AssignMax(max_height, (int)d_height); } if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { /* * Now that we know how big the tabs are lets see how many can fit in * the available space. */ num_cols = (int)size / max_width; AssignMax(num_cols, 1); /* * Now we know how many fit per row, so what we now need to do is * how many rows we need. */ num_rows = (count/ num_cols) + ((count % num_cols == 0) ? 0 : 1); /* * Now that we know how many rows and columns we need we can calculate * overall size. */ offset = XmTabBox_tab_offset(tab); tab_width = size + ((num_rows - 1) * offset); tab_height = num_rows * max_height; } else { num_cols = (int)size/ max_height; AssignMax(num_cols, 1); num_rows = (count/ num_cols) + ((count % num_cols == 0) ? 0 : 1); offset = XmTabBox_tab_offset(tab); tab_width = num_rows * max_width; tab_height = size + ((num_rows - 1) * offset); } rect->width = tab_width; rect->height = tab_height; } int XmTabBoxGetNumRows(Widget widget) { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) ) return( 0 ); return( XmTabBox__num_rows(tab) ); } int XmTabBoxGetNumColumns(Widget widget) { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) ) return( 0 ); return( XmTabBox__num_columns(tab) ); } void _XmTabBoxGetNumRowsColumns(Widget widget, int size, int *num_rows, int *num_cols) { XmTabBoxWidget tab = (XmTabBoxWidget) widget; int i, max, _num_rows, _num_cols, tmp, offset, cnt; XRectangle *wanted = XmTabBox__wanted(tab); *num_rows = 0; *num_cols = 0; if( !XmIsTabBox(widget) || (cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab))) == 0 || (XmTabBox_tab_mode(tab) != XmTABS_STACKED && XmTabBox_tab_mode(tab) != XmTABS_STACKED_STATIC) ) { return; } offset = XmTabBox_tab_offset(tab); max = 0; if( XmTabBox_orientation(tab) == XmHORIZONTAL ) { for( i = 0; i < cnt; ++i ) { AssignMax(max, (int)wanted[i].width); } } else { for( i = 0; i < cnt; ++i ) { AssignMax(max, (int)wanted[i].height); } } _num_cols = cnt; _num_rows = (int)(cnt/ _num_cols) + (cnt % _num_cols > 0 ? 1 : 0); tmp = (_num_cols * max) + (_num_rows * offset); while( _num_cols > 1 && tmp > size ) { _num_cols--; _num_rows = (int)(cnt/ _num_cols) + (cnt % _num_cols > 0 ? 1 : 0); tmp = (_num_cols * max) + (_num_rows * offset); } *num_rows = _num_rows; *num_cols = _num_cols; } int #ifndef _NO_PROTO XmTabBoxGetNumTabs(Widget widget) #else XmTabBoxGetNumTabs(widget) Widget widget; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) ) return( 0 ); return( _XmTabbedStackListCount(XmTabBox_tab_list(tab)) ); } int #ifndef _NO_PROTO _XiGetTabIndex(Widget tab, int row, int column) #else _XiGetTabIndex(tab, row, column) XmTabBoxWidget tab; int row, column; #endif { if( !XmIsTabBox(tab) ) return( -1 ); return( GetTabIndex((XmTabBoxWidget)tab, row, column) ); } int #ifndef _NO_PROTO _XmTabBoxGetTabWidth(Widget widget, int idx) #else _XmTabBoxGetTabWidth(widget, idx) Widget widget; int idx; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) || idx < 0 || idx > _XmTabbedStackListCount(XmTabBox_tab_list(tab)) ) return( -1 ); return( XmTabBox__actual(tab)[idx].width ); } int #ifndef _NO_PROTO _XmTabBoxGetTabHeight(Widget widget, int idx) #else _XmTabBoxGetTabHeight(widget, idx) Widget widget; int idx; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) || idx < 0 || idx > _XmTabbedStackListCount(XmTabBox_tab_list(tab)) ) return( -1 ); return( XmTabBox__actual(tab)[idx].height ); } static Widget #ifndef _NO_PROTO XiGCParent(XmTabBoxWidget tab) #else XiGCParent(tab) XmTabBoxWidget tab; #endif { Widget parent = XtParent(tab); if( XmIsTabStack(parent) ) { return( XtParent(parent) ); } return( parent ); } int #ifndef _NO_PROTO XmTabBoxGetTabRow(Widget widget, int idx) #else XmTabBoxGetTabRow(widget, idx) Widget widget; int idx; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) || idx < 0 || idx > _XmTabbedStackListCount(XmTabBox_tab_list(tab)) ) return( -1 ); return( XmTabBox__actual(tab)[idx].row ); } static void #ifndef _NO_PROTO ResetImageCache(XmTabBoxWidget tab) #else ResetImageCache(tab) XmTabBoxWidget tab; #endif { int i, cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); /* * First thing we will do is clear any existing cache. */ if( XmTabBox__cache_size(tab) > 0 ) { for( i = 0; i < XmTabBox__cache_size(tab); ++i ) { if( XmTabBox__cache(tab)[i].pixmap != NULL ) { XDestroyImage(XmTabBox__cache(tab)[i].pixmap); } if( XmTabBox__cache(tab)[i].label != NULL ) { XDestroyImage(XmTabBox__cache(tab)[i].label); } } } /* * If we have no tabs then we will free the cache. */ if( XmTabBox_tab_list(tab) == NULL || cnt == 0 ) { XtFree((XtPointer) XmTabBox__cache(tab)); XmTabBox__cache(tab) = NULL; XmTabBox__cache_size(tab) = 0; return; } /* * If we got here that means that we actually have some items so lets * size our cache to the correct size. */ if( cnt != XmTabBox__cache_size(tab) ) { XmTabBox__cache_size(tab) = cnt; XmTabBox__cache(tab) = (XiCache*) XtRealloc((XtPointer)XmTabBox__cache(tab), sizeof(XiCache) * cnt); } /* * Then lets zero the cache out. */ for( i = 0; i < cnt; ++i ) { XmTabBox__cache(tab)[i].pixmap = NULL; XmTabBox__cache(tab)[i].label = NULL; XmTabBox__cache(tab)[i].sensitive = False; } } static void #ifndef _NO_PROTO FreeImageCache(XmTabBoxWidget tab) #else FreeImageCache(tab) XmTabBoxWidget tab; #endif { int i; /* * First thing we will do is clear any existing cache. */ if( XmTabBox__cache_size(tab) > 0 ) { for( i = 0; i < XmTabBox__cache_size(tab); ++i ) { if( XmTabBox__cache(tab)[i].pixmap != NULL ) { XDestroyImage(XmTabBox__cache(tab)[i].pixmap); } if( XmTabBox__cache(tab)[i].label != NULL ) { XDestroyImage(XmTabBox__cache(tab)[i].label); } } } XtFree((XtPointer) XmTabBox__cache(tab)); XmTabBox__cache(tab) = NULL; XmTabBox__cache_size(tab) = 0; } static int #ifndef _NO_PROTO InfoToIndex(XmTabBoxWidget tab, XmTabAttributes info) #else InfoToIndex(tab, info) XmTabBoxWidget tab; XmTabAttributes info; #endif { return( (int)(info - _XmTabbedStackListArray(XmTabBox_tab_list(tab))) ); } Widget #ifndef _NO_PROTO _XmTabBoxCanvas(Widget widget) #else _XmTabBoxCanvas(widget) Widget widget; #endif { XmTabBoxWidget tab = (XmTabBoxWidget) widget; if( !XmIsTabBox(widget) ) return( NULL ); return( XmTabBox__canvas(tab) ); } int _XmTabBoxGetMaxTabWidth(Widget widget) { XmTabBoxWidget tab = (XmTabBoxWidget) widget; int i, max = 0, cnt; XRectangle *wanted; if( !XmIsTabBox(widget) ) return( 0 ); cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); wanted = XmTabBox__wanted(tab); for( i = 0; i < cnt; ++i ) { AssignMax(max, (int)wanted[i].width); } return( max ); } int _XmTabBoxGetMaxTabHeight(Widget widget) { XmTabBoxWidget tab = (XmTabBoxWidget) widget; int i, max = 0, cnt; XRectangle *wanted; if( !XmIsTabBox(widget) ) return( 0 ); cnt = _XmTabbedStackListCount(XmTabBox_tab_list(tab)); wanted = XmTabBox__wanted(tab); for( i = 0; i < cnt; ++i ) { AssignMax(max, (int)wanted[i].height); } return( max ); } int #ifndef _NO_PROTO XmTabBoxXYToIndex(Widget widget, int x, int y) #else XmTabBoxXYToIndex(widget, x, y) Widget widget; int x, y; #endif { if( !XmIsTabBox(widget) ) return( -1 ); return( XiXYtoTab((XmTabBoxWidget)widget, x, y) ); } static Visual* GetShellVisual(Widget widget) { Visual *visual; if( widget == NULL ) { return( NULL ); } if( XtIsShell(widget) ) { XtVaGetValues(widget, XmNvisual, &visual, NULL); return( visual ); } visual = GetShellVisual(XtParent(widget)); if( visual == NULL ) { return( DefaultVisualOfScreen(XtScreen(widget)) ); } return( visual ); } /* * XmRCallProc routine for checking font_list before setting it to NULL * If "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offs, XrmValue *value) { XmTabBoxWidget tb = (XmTabBoxWidget)wid; /* Check if been here before */ if (tb->tab_box.check_set_render_table) value->addr = NULL; else { tb->tab_box.check_set_render_table = True; value->addr = (char*)&(tb->tab_box.font_list); } } Widget XmCreateTabBox(Widget parent, String name, ArgList arg_list, Cardinal arg_cnt) { return( XtCreateWidget(name, xmTabBoxWidgetClass, parent, arg_list, arg_cnt) ); } motif-2.3.8/lib/Xm/BulletinBP.h0000644000175000017500000001217713145162623013101 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmBulletinBoardP_h #define _XmBulletinBoardP_h #include #include #ifdef __cplusplus extern "C" { #endif /**************************************************************************** * this suffix is added to dialog shells created by Xm convenience routines * * so that, for example, a call to create a form dialog named f generates a * * dialog shell named f_popup in addition to a form named f * ****************************************************************************/ #define XmDIALOG_SUFFIX "_popup" #define XmDIALOG_SUFFIX_SIZE 6 typedef struct _XmBulletinBoardConstraintPart { char unused; } XmBulletinBoardConstraintPart, * XmBulletinBoardConstraint; /* New fields for the BulletinBoard widget class record */ typedef struct { Boolean always_install_accelerators; XmGeoCreateProc geo_matrix_create; XmFocusMovedProc focus_moved_proc; XtPointer extension; } XmBulletinBoardClassPart; /* Full class record declaration */ typedef struct _XmBulletinBoardClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; } XmBulletinBoardClassRec; externalref XmBulletinBoardClassRec xmBulletinBoardClassRec; /* New fields for the BulletinBoard widget record */ typedef struct { Dimension margin_width; /* margins */ Dimension margin_height; Widget default_button; /* widgets */ Widget dynamic_default_button; /* widgets */ Widget cancel_button; Widget dynamic_cancel_button; XtCallbackList focus_callback; /* callback lists */ XtCallbackList map_callback; XtCallbackList unmap_callback; XtTranslations text_translations; XmFontList button_font_list; /* font lists */ XmFontList label_font_list; XmFontList text_font_list; Boolean allow_overlap; /* policies */ Boolean default_position; Boolean auto_unmanage; unsigned char resize_policy; Dimension old_width; /* shadow resources */ Dimension old_height; Dimension old_shadow_thickness; unsigned char shadow_type; Boolean in_set_values; /* internal flag */ Boolean initial_focus; Boolean no_resize; /* dialog resources */ unsigned char dialog_style; XmString dialog_title; Widget shell; Widget _UNUSED; XmGeoMatrix geo_cache; /* Cache for geometry management. */ unsigned char check_set; /* For XmNfontList & XmNRenderTable */ } XmBulletinBoardPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmBulletinBoardRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; } XmBulletinBoardRec; /* Access macros */ #define BB_CancelButton(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.cancel_button) #define BB_DynamicCancelButton(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.dynamic_cancel_button) #define BB_DefaultButton(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.default_button) #define BB_DynamicDefaultButton(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.dynamic_default_button) #define BB_MarginHeight(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.margin_height) #define BB_MarginWidth(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.margin_width) #define BB_ButtonFontList(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.button_font_list) #define BB_LabelFontList(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.label_font_list) #define BB_TextFontList(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.text_font_list) #define BB_StringDirection(w) (XmDirectionToStringDirection\ (((XmBulletinBoardWidget) w)->manager.string_direction)) #define BB_ResizePolicy(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.resize_policy) #define BB_InSetValues(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.in_set_values) #define BB_InitialFocus(w) \ (((XmBulletinBoardWidget) w)->bulletin_board.initial_focus) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmBulletinBoardP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStrDefs22.h0000644000175000017500000011104113211513004013075 00000000000000/* $TOG: XmStrDefs22.ht /main/2 1997/06/18 17:50:15 samborn $ */ #ifndef _XmStrDefs22_h_ #define _XmStrDefs22_h_ #include #ifndef _XmConst #define _XmConst /**/ #endif #ifdef __cplusplus extern "C" { #endif /* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */ /* This file is automatically generated. */ /* Default ABI version -- Do not edit */ /* TOG: xmstring.list /main/5 1997/06/20 08:37:02 samborn */ #ifdef XMSTRINGDEFINES #define XmNitemFoundCallback "itemFoundCallback" #define XmNitemNotFoundCallback "itemNotFoundCallback" #define XmRXmTabSide "XmTabSide" #define XmRTabSide "TabSide" #define XmRXmPixmapPlacement "XmPixmapPlacement" #define XmRXmPixmap "XmPixmap" #define XmRXmPixel "XmPixel" #define XmRXmIconPlacement "XmIconPlacement" #define XmRXmHierarchyNodeState "XmHierarchyNodeState" #define XmRXmFillOption "XmFillOption" #define XmRXmConnectStyle "XmConnectStyle" #define XmRXmColorMode "XmColorMode" #define XmRXmAlignment "XmAlignment" #define XmRTabStyle "TabStyle" #define XmRTabOrientation "TabOrientation" #define XmRTabMode "TabMode" #define XmRTabList "TabList" #define XmRTabEdge "TabEdge" #define XmRTabArrowPlacement "TabArrowPlacement" #define XmNxlfdString "xlfdString" #define XmNverticalNodeSpace "verticalNodeSpace" #define XmNverticalMargin "verticalMargin" #define XmNverifyTextFailedCallback "verifyTextFailedCallback" #define XmNverifyTextCallback "verifyTextCallback" #define XmNverify "verify" #define XmNvalues "values" #define XmNuseTextField "useTextField" #define XmNuseScaling "useScaling" #define XmNuseImageCache "useImageCache" #define XmNupdateTextCallback "updateTextCallback" #define XmNupdateShellCallback "updateShellCallback" #define XmNunselectCallback "unselectCallback" #define XmNuniformTabSize "uniformTabSize" #define XmNtraversalIndex "traversalIndex" #define XmNtitleString "titleString" #define XmNtextString "textString" #define XmNtextRows "textRows" #define XmNtearOffLabelString "tearOffLabelString" #define XmNtabTearOffEnabled "tabTearOffEnabled" #define XmNtabStyle "tabStyle" #define XmNtabStringDirection "tabStringDirection" #define XmNtabSide "tabSide" #define XmNtabSelectedCallback "tabSelectedCallback" #define XmNtabSelectPixmap "tabSelectPixmap" #define XmNtabSelectColor "tabSelectColor" #define XmNtabPixmapPlacement "tabPixmapPlacement" #define XmNtabOrientation "tabOrientation" #define XmNtabOffset "tabOffset" #define XmNtabMode "tabMode" #define XmNtabMarginWidth "tabMarginWidth" #define XmNtabMarginHeight "tabMarginHeight" #define XmNtabList "tabList" #define XmNtabLabelString "tabLabelString" #define XmNtabLabelSpacing "tabLabelSpacing" #define XmNtabLabelPixmap "tabLabelPixmap" #define XmNtabForeground "tabForeground" #define XmNtabEdge "tabEdge" #define XmNtabCornerPercent "tabCornerPercent" #define XmNtabBoxWidget "tabBoxWidget" #define XmNtabBackgroundPixmap "tabBackgroundPixmap" #define XmNtabBackground "tabBackground" #define XmNtabAutoSelect "tabAutoSelect" #define XmNtabArrowPlacement "tabArrowPlacement" #define XmNtabAlignment "tabAlignment" #define XmNstackedEffect "stackedEffect" #define XmNsortFunctions "sortFunctions" #define XmNsliderTogLabel "sliderTogLabel" #define XmNsizeString "sizeString" #define XmNshowValue "showValue" #define XmNshowSash "showSash" #define XmNshowNameString "showNameString" #define XmNshowLabel "showLabel" #define XmNshowFontName "showFontName" #define XmNshowFind "showFind" #define XmNselectedIndex "selectedIndex" #define XmNselectedColumn "selectedColumn" #define XmNselectCallback "selectCallback" #define XmNscalingString "scalingString" #define XmNsashTranslations "sashTranslations" #define XmNsampleText "sampleText" #define XmNrgbFile "rgbFile" #define XmNresizeToPreferred "resizeToPreferred" #define XmNresizeCallback "resizeCallback" #define XmNredSliderLabel "redSliderLabel" #define XmNpropSpaceString "propSpaceString" #define XmNpreferredPaneSize "preferredPaneSize" #define XmNposition "position" #define XmNpopupShellWidget "popupShellWidget" #define XmNpopupOffset "popupOffset" #define XmNpopupCursor "popupCursor" #define XmNpixmapWidth "pixmapWidth" #define XmNpixmapHeight "pixmapHeight" #define XmNparentNode "parentNode" #define XmNotherString "otherString" #define XmNoptionString "optionString" #define XmNopenFolderPixmap "openFolderPixmap" #define XmNopenClosePadding "openClosePadding" #define XmNnumValues "numValues" #define XmNnumStacks "numStacks" #define XmNnumRows "numRows" #define XmNnodeStateChangedCallback "nodeStateChangedCallback" #define XmNnodeStateCallback "nodeStateCallback" #define XmNnodeStateBegEndCallback "nodeStateBegEndCallback" #define XmNnodeState "nodeState" #define XmNnoCellError "noCellError" #define XmNmonoSpaceString "monoSpaceString" #define XmNminimumVerticalCells "minimumVerticalCells" #define XmNminimumHorizontalCells "minimumHorizontalCells" #define XmNminimumCellWidth "minimumCellWidth" #define XmNminimumCellHeight "minimumCellHeight" #define XmNmargin "margin" #define XmNlist "list" #define XmNlineWidth "lineWidth" #define XmNlineColor "lineColor" #define XmNlabel "label" #define XmNitalicString "italicString" #define XmNinsertBefore "insertBefore" #define XmNindentSpace "indentSpace" #define XmNiconTextPadding "iconTextPadding" #define XmNiconPlacement "iconPlacement" #define XmNhorizontalNodeSpace "horizontalNodeSpace" #define XmNhorizontalMargin "horizontalMargin" #define XmNgreenSliderLabel "greenSliderLabel" #define XmNfreeTabPixmap "freeTabPixmap" #define XmNfirstRow "firstRow" #define XmNfirstColumnPixmaps "firstColumnPixmaps" #define XmNfirstColumn "firstColumn" #define XmNfindLabel "findLabel" #define XmNfillOption "fillOption" #define XmNfileReadError "fileReadError" #define XmNfamilyString "familyString" #define XmNequalSize "equalSize" #define XmNentryLabelString "entryLabelString" #define XmNentryData "entryData" #define XmNencodingString "encodingString" #define XmNencodingList "encodingList" #define XmNdoubleClickCallback "doubleClickCallback" #define XmNdefaultEncodingString "defaultEncodingString" #define XmNdFieldPrefWidth "dFieldPrefWidth" #define XmNdFieldPrefHeight "dFieldPrefHeight" #define XmNdFieldMinWidth "dFieldMinWidth" #define XmNdFieldMinHeight "dFieldMinHeight" #define XmNdFieldMaxWidth "dFieldMaxWidth" #define XmNdFieldMaxHeight "dFieldMaxHeight" #define XmNcustomizedCombinationBox "customizedCombinationBox" #define XmNcursor "cursor" #define XmNcurrentFont "currentFont" #define XmNconnectStyle "connectStyle" #define XmNcomboTranslations "comboTranslations" #define XmNcolumnTitles "columnTitles" #define XmNcolorName "colorName" #define XmNcolorMode "colorMode" #define XmNcolorListTogLabel "colorListTogLabel" #define XmNcellY "cellY" #define XmNcellX "cellX" #define XmNbothString "bothString" #define XmNboldString "boldString" #define XmNblueSliderLabel "blueSliderLabel" #define XmCDistribution "Distribution" #define XmCFillStyle "FillStyle" #define XmCItemSpacing "ItemSpacing" #define XmCLabelSpacing "LabelSpacing" #define XmCShowLabel "ShowLabel" #define XmCStretchable "Stretchable" #define XmNdefaultEntryLabelAlignment "defaultEntryLabelAlignment" #define XmNdefaultEntryLabelFontList "defaultEntryLabelFontList" #define XmNdefaultFillStyle "defaultFillStyle" #define XmNdistribution "distribution" #define XmNentryLabelAlignment "entryLabelAlignment" #define XmNentryLabelFontList "entryLabelFontList" #define XmNentryLabelPixmap "entryLabelPixmap" #define XmNentryLabelType "entryLabelType" #define XmNfillStyle "fillStyle" #define XmNitemSpacing "itemSpacing" #define XmNlabelSpacing "labelSpacing" #define XmNshowEntryLabel "showEntryLabel" #define XmNstretchable "stretchable" #define XmRDistribution "Distribution" #define XmRFillStyle "FillStyle" #define XmCEqualSize "EqualSize" #define XmCFillOption "FillOption" #define XmCColorMode "ColorMode" #define XmCFileReadError "FileReadError" #define XmCNoCellError "NoCellError" #define XmCSliderLabel "SliderLabel" #define XmCTogLabel "TogLabel" #define XmCAutoFill "AutoFill" #define XmCPicture "Picture" #define XmNautoFill "autoFill" #define XmNpicture "picture" #define XmNpictureErrorCallback "pictureErrorCallback" #define XmNvalidateCallback "validateCallback" #define XmCFindLabel "FindLabel" #define XmCShowFind "ShowFind" #define XmNentryBackground "entryBackground" #define XmCColumnTitles "ColumnTitles" #define XmCEntryData "EntryData" #define XmCFirstColumnPixmaps "FirstColumnPixmaps" #define XmCFirstLocation "FirstLocation" #define XmCNewVisualStyle "NewVisualStyle" #define XmCNumRows "NumRows" #define XmCScrollBar "ScrollBar" #define XmCSelectedColumn "SelectedColumn" #define XmNnewVisualStyle "newVisualStyle" #define XmCPreferredPaneSize "PreferredPaneSize" #define XmCShowSash "ShowSash" #define XmC100DPIString "100DPIString" #define XmC75DPIString "75DPIString" #define XmCAnyLowerString "AnyLowerString" #define XmCAnyString "AnyString" #define XmCBoldString "BoldString" #define XmCBothString "BothString" #define XmCDefaultEncodingString "DefaultEncodingString" #define XmCEncodingList "EncodingList" #define XmCEncodingString "EncodingString" #define XmCFamilyString "FamilyString" #define XmCItalicString "ItalicString" #define XmCMonoSpaceString "MonoSpaceString" #define XmCOptionString "OptionString" #define XmCOtherString "OtherString" #define XmCPropSpaceString "PropSpaceString" #define XmCSampleText "SampleText" #define XmCScalingString "ScalingString" #define XmCShowNameString "ShowNameString" #define XmCSizeString "SizeString" #define XmCTextRows "TextRows" #define XmCXlfdSpaceString "XlfdSpaceString" #define XmN100DPIstring "100DPIstring" #define XmN75DPIstring "75DPIstring" #define XmNanyLowerString "anyLowerString" #define XmNanyString "anyString" #define XmCCellX "CellX" #define XmCCellY "CellY" #define XmCDefaultCells "DefaultCells" #define XmCMinimumCellSize "MinimumCellSize" #define XmCIconPlacement "IconPlacement" #define XmNpixmapDepth "pixmapDepth" #define XmCAutoClose "AutoClose" #define XmCInsertBefore "InsertBefore" #define XmCNodeState "NodeState" #define XmCNodeStateCallback "NodeStateCallback" #define XmCNodeStateChangedCallback "NodeStateChangedCallback" #define XmCParentNode "ParentNode" #define XmNautoClose "autoClose" #define XmNcloseFolderPixmap "closeFolderPixmap" #define XmNnodeCloseFolderPixmap "nodeCloseFolderPixmap" #define XmNnodeOpenFolderPixmap "nodeOpenFolderPixmap" #define XmNnodeStateBeginEndCallback "nodeStateBeginEndCallback" #define XmCConstrainWidth "ConstrainWidth" #define XmCIndentSpace "IndentSpace" #define XmNconnectNodes "connectNodes" #define XmNconstrainWidth "constrainWidth" #define XmCNumStacks "NumStacks" #define XmCSelectedIndex "SelectedIndex" #define XmCStackedEffect "StackedEffect" #define XmCTabAutoSelect "TabAutoSelect" #define XmCTabCornerPercent "TabCornerPercent" #define XmCTabEdge "TabEdge" #define XmCTabLabelSpacing "TabLabelSpacing" #define XmCTabMode "TabMode" #define XmCTabOffset "TabOffset" #define XmCTabOrientation "TabOrientation" #define XmCTabSelectColor "TabSelectColor" #define XmCTabSelectPixmap "TabSelectPixmap" #define XmCTabStyle "TabStyle" #define XmCTraversalIndex "TraversalIndex" #define XmCUniformTabSize "UniformTabSize" #define XmCUseImageCache "UseImageCache" #define XmCFreeTabPixmap "FreeTabPixmap" #define XmCICSEnhancementPakResourceError "ICSEnhancementPakResourceError" #define XmCTabLabelPixmap "TabLabelPixmap" #define XmCTabLabelString "TabLabelString" #define XmCTabPixmapPlacement "TabPixmapPlacement" #define XmCTabSide "TabSide" #define XmNillegalResourceValue "illegalResourceValue" #define XmCCompressStyle "CompressStyle" #define XmCConnectStyle "ConnectStyle" #define XmCHorizontalDelta "HorizontalDelta" #define XmCLineWidth "LineWidth" #define XmCOpenClosePadding "OpenClosePadding" #define XmCVerticalDelta "VerticalDelta" #define XmNcompressStyle "compressStyle" #define XmNhorizontalDelta "horizontalDelta" #define XmNlineBackgroundColor "lineBackgroundColor" #define XmNlineStyle "lineStyle" #define XmNverticalDelta "verticalDelta" #define XmRXmCompressStyle "XmCompressStyle" #define XmRXmLineStyle "XmLineStyle" #define XmCPopupOffset "PopupOffset" #define XmCUseTextField "UseTextField" #define XmCVerify "Verify" #else externalref _XmConst char _XmStrings22[]; #ifndef XmNitemFoundCallback #define XmNitemFoundCallback ((char*)&_XmStrings22[0]) #endif #ifndef XmNitemNotFoundCallback #define XmNitemNotFoundCallback ((char*)&_XmStrings22[18]) #endif #ifndef XmRXmTabSide #define XmRXmTabSide ((char*)&_XmStrings22[39]) #endif #ifndef XmRTabSide #define XmRTabSide ((char*)&_XmStrings22[49]) #endif #ifndef XmRXmPixmapPlacement #define XmRXmPixmapPlacement ((char*)&_XmStrings22[57]) #endif #ifndef XmRXmPixmap #define XmRXmPixmap ((char*)&_XmStrings22[75]) #endif #ifndef XmRXmPixel #define XmRXmPixel ((char*)&_XmStrings22[84]) #endif #ifndef XmRXmIconPlacement #define XmRXmIconPlacement ((char*)&_XmStrings22[92]) #endif #ifndef XmRXmHierarchyNodeState #define XmRXmHierarchyNodeState ((char*)&_XmStrings22[108]) #endif #ifndef XmRXmFillOption #define XmRXmFillOption ((char*)&_XmStrings22[129]) #endif #ifndef XmRXmConnectStyle #define XmRXmConnectStyle ((char*)&_XmStrings22[142]) #endif #ifndef XmRXmColorMode #define XmRXmColorMode ((char*)&_XmStrings22[157]) #endif #ifndef XmRXmAlignment #define XmRXmAlignment ((char*)&_XmStrings22[169]) #endif #ifndef XmRTabStyle #define XmRTabStyle ((char*)&_XmStrings22[181]) #endif #ifndef XmRTabOrientation #define XmRTabOrientation ((char*)&_XmStrings22[190]) #endif #ifndef XmRTabMode #define XmRTabMode ((char*)&_XmStrings22[205]) #endif #ifndef XmRTabList #define XmRTabList ((char*)&_XmStrings22[213]) #endif #ifndef XmRTabEdge #define XmRTabEdge ((char*)&_XmStrings22[221]) #endif #ifndef XmRTabArrowPlacement #define XmRTabArrowPlacement ((char*)&_XmStrings22[229]) #endif #ifndef XmNxlfdString #define XmNxlfdString ((char*)&_XmStrings22[247]) #endif #ifndef XmNverticalNodeSpace #define XmNverticalNodeSpace ((char*)&_XmStrings22[258]) #endif #ifndef XmNverticalMargin #define XmNverticalMargin ((char*)&_XmStrings22[276]) #endif #ifndef XmNverifyTextFailedCallback #define XmNverifyTextFailedCallback ((char*)&_XmStrings22[291]) #endif #ifndef XmNverifyTextCallback #define XmNverifyTextCallback ((char*)&_XmStrings22[316]) #endif #ifndef XmNverify #define XmNverify ((char*)&_XmStrings22[335]) #endif #ifndef XmNvalues #define XmNvalues ((char*)&_XmStrings22[342]) #endif #ifndef XmNuseTextField #define XmNuseTextField ((char*)&_XmStrings22[349]) #endif #ifndef XmNuseScaling #define XmNuseScaling ((char*)&_XmStrings22[362]) #endif #ifndef XmNuseImageCache #define XmNuseImageCache ((char*)&_XmStrings22[373]) #endif #ifndef XmNupdateTextCallback #define XmNupdateTextCallback ((char*)&_XmStrings22[387]) #endif #ifndef XmNupdateShellCallback #define XmNupdateShellCallback ((char*)&_XmStrings22[406]) #endif #ifndef XmNunselectCallback #define XmNunselectCallback ((char*)&_XmStrings22[426]) #endif #ifndef XmNuniformTabSize #define XmNuniformTabSize ((char*)&_XmStrings22[443]) #endif #ifndef XmNtraversalIndex #define XmNtraversalIndex ((char*)&_XmStrings22[458]) #endif #ifndef XmNtitleString #define XmNtitleString ((char*)&_XmStrings22[473]) #endif #ifndef XmNtextString #define XmNtextString ((char*)&_XmStrings22[485]) #endif #ifndef XmNtextRows #define XmNtextRows ((char*)&_XmStrings22[496]) #endif #ifndef XmNtearOffLabelString #define XmNtearOffLabelString ((char*)&_XmStrings22[505]) #endif #ifndef XmNtabTearOffEnabled #define XmNtabTearOffEnabled ((char*)&_XmStrings22[524]) #endif #ifndef XmNtabStyle #define XmNtabStyle ((char*)&_XmStrings22[542]) #endif #ifndef XmNtabStringDirection #define XmNtabStringDirection ((char*)&_XmStrings22[551]) #endif #ifndef XmNtabSide #define XmNtabSide ((char*)&_XmStrings22[570]) #endif #ifndef XmNtabSelectedCallback #define XmNtabSelectedCallback ((char*)&_XmStrings22[578]) #endif #ifndef XmNtabSelectPixmap #define XmNtabSelectPixmap ((char*)&_XmStrings22[598]) #endif #ifndef XmNtabSelectColor #define XmNtabSelectColor ((char*)&_XmStrings22[614]) #endif #ifndef XmNtabPixmapPlacement #define XmNtabPixmapPlacement ((char*)&_XmStrings22[629]) #endif #ifndef XmNtabOrientation #define XmNtabOrientation ((char*)&_XmStrings22[648]) #endif #ifndef XmNtabOffset #define XmNtabOffset ((char*)&_XmStrings22[663]) #endif #ifndef XmNtabMode #define XmNtabMode ((char*)&_XmStrings22[673]) #endif #ifndef XmNtabMarginWidth #define XmNtabMarginWidth ((char*)&_XmStrings22[681]) #endif #ifndef XmNtabMarginHeight #define XmNtabMarginHeight ((char*)&_XmStrings22[696]) #endif #ifndef XmNtabList #define XmNtabList ((char*)&_XmStrings22[712]) #endif #ifndef XmNtabLabelString #define XmNtabLabelString ((char*)&_XmStrings22[720]) #endif #ifndef XmNtabLabelSpacing #define XmNtabLabelSpacing ((char*)&_XmStrings22[735]) #endif #ifndef XmNtabLabelPixmap #define XmNtabLabelPixmap ((char*)&_XmStrings22[751]) #endif #ifndef XmNtabForeground #define XmNtabForeground ((char*)&_XmStrings22[766]) #endif #ifndef XmNtabEdge #define XmNtabEdge ((char*)&_XmStrings22[780]) #endif #ifndef XmNtabCornerPercent #define XmNtabCornerPercent ((char*)&_XmStrings22[788]) #endif #ifndef XmNtabBoxWidget #define XmNtabBoxWidget ((char*)&_XmStrings22[805]) #endif #ifndef XmNtabBackgroundPixmap #define XmNtabBackgroundPixmap ((char*)&_XmStrings22[818]) #endif #ifndef XmNtabBackground #define XmNtabBackground ((char*)&_XmStrings22[838]) #endif #ifndef XmNtabAutoSelect #define XmNtabAutoSelect ((char*)&_XmStrings22[852]) #endif #ifndef XmNtabArrowPlacement #define XmNtabArrowPlacement ((char*)&_XmStrings22[866]) #endif #ifndef XmNtabAlignment #define XmNtabAlignment ((char*)&_XmStrings22[884]) #endif #ifndef XmNstackedEffect #define XmNstackedEffect ((char*)&_XmStrings22[897]) #endif #ifndef XmNsortFunctions #define XmNsortFunctions ((char*)&_XmStrings22[911]) #endif #ifndef XmNsliderTogLabel #define XmNsliderTogLabel ((char*)&_XmStrings22[925]) #endif #ifndef XmNsizeString #define XmNsizeString ((char*)&_XmStrings22[940]) #endif #ifndef XmNshowValue #define XmNshowValue ((char*)&_XmStrings22[951]) #endif #ifndef XmNshowSash #define XmNshowSash ((char*)&_XmStrings22[961]) #endif #ifndef XmNshowNameString #define XmNshowNameString ((char*)&_XmStrings22[970]) #endif #ifndef XmNshowLabel #define XmNshowLabel ((char*)&_XmStrings22[985]) #endif #ifndef XmNshowFontName #define XmNshowFontName ((char*)&_XmStrings22[995]) #endif #ifndef XmNshowFind #define XmNshowFind ((char*)&_XmStrings22[1008]) #endif #ifndef XmNselectedIndex #define XmNselectedIndex ((char*)&_XmStrings22[1017]) #endif #ifndef XmNselectedColumn #define XmNselectedColumn ((char*)&_XmStrings22[1031]) #endif #ifndef XmNselectCallback #define XmNselectCallback ((char*)&_XmStrings22[1046]) #endif #ifndef XmNscalingString #define XmNscalingString ((char*)&_XmStrings22[1061]) #endif #ifndef XmNsashTranslations #define XmNsashTranslations ((char*)&_XmStrings22[1075]) #endif #ifndef XmNsampleText #define XmNsampleText ((char*)&_XmStrings22[1092]) #endif #ifndef XmNrgbFile #define XmNrgbFile ((char*)&_XmStrings22[1103]) #endif #ifndef XmNresizeToPreferred #define XmNresizeToPreferred ((char*)&_XmStrings22[1111]) #endif #ifndef XmNresizeCallback #define XmNresizeCallback ((char*)&_XmStrings22[1129]) #endif #ifndef XmNredSliderLabel #define XmNredSliderLabel ((char*)&_XmStrings22[1144]) #endif #ifndef XmNpropSpaceString #define XmNpropSpaceString ((char*)&_XmStrings22[1159]) #endif #ifndef XmNpreferredPaneSize #define XmNpreferredPaneSize ((char*)&_XmStrings22[1175]) #endif #ifndef XmNposition #define XmNposition ((char*)&_XmStrings22[1193]) #endif #ifndef XmNpopupShellWidget #define XmNpopupShellWidget ((char*)&_XmStrings22[1202]) #endif #ifndef XmNpopupOffset #define XmNpopupOffset ((char*)&_XmStrings22[1219]) #endif #ifndef XmNpopupCursor #define XmNpopupCursor ((char*)&_XmStrings22[1231]) #endif #ifndef XmNpixmapWidth #define XmNpixmapWidth ((char*)&_XmStrings22[1243]) #endif #ifndef XmNpixmapHeight #define XmNpixmapHeight ((char*)&_XmStrings22[1255]) #endif #ifndef XmNparentNode #define XmNparentNode ((char*)&_XmStrings22[1268]) #endif #ifndef XmNotherString #define XmNotherString ((char*)&_XmStrings22[1279]) #endif #ifndef XmNoptionString #define XmNoptionString ((char*)&_XmStrings22[1291]) #endif #ifndef XmNopenFolderPixmap #define XmNopenFolderPixmap ((char*)&_XmStrings22[1304]) #endif #ifndef XmNopenClosePadding #define XmNopenClosePadding ((char*)&_XmStrings22[1321]) #endif #ifndef XmNnumValues #define XmNnumValues ((char*)&_XmStrings22[1338]) #endif #ifndef XmNnumStacks #define XmNnumStacks ((char*)&_XmStrings22[1348]) #endif #ifndef XmNnumRows #define XmNnumRows ((char*)&_XmStrings22[1358]) #endif #ifndef XmNnodeStateChangedCallback #define XmNnodeStateChangedCallback ((char*)&_XmStrings22[1366]) #endif #ifndef XmNnodeStateCallback #define XmNnodeStateCallback ((char*)&_XmStrings22[1391]) #endif #ifndef XmNnodeStateBegEndCallback #define XmNnodeStateBegEndCallback ((char*)&_XmStrings22[1409]) #endif #ifndef XmNnodeState #define XmNnodeState ((char*)&_XmStrings22[1433]) #endif #ifndef XmNnoCellError #define XmNnoCellError ((char*)&_XmStrings22[1443]) #endif #ifndef XmNmonoSpaceString #define XmNmonoSpaceString ((char*)&_XmStrings22[1455]) #endif #ifndef XmNminimumVerticalCells #define XmNminimumVerticalCells ((char*)&_XmStrings22[1471]) #endif #ifndef XmNminimumHorizontalCells #define XmNminimumHorizontalCells ((char*)&_XmStrings22[1492]) #endif #ifndef XmNminimumCellWidth #define XmNminimumCellWidth ((char*)&_XmStrings22[1515]) #endif #ifndef XmNminimumCellHeight #define XmNminimumCellHeight ((char*)&_XmStrings22[1532]) #endif #ifndef XmNmargin #define XmNmargin ((char*)&_XmStrings22[1550]) #endif #ifndef XmNlist #define XmNlist ((char*)&_XmStrings22[1557]) #endif #ifndef XmNlineWidth #define XmNlineWidth ((char*)&_XmStrings22[1562]) #endif #ifndef XmNlineColor #define XmNlineColor ((char*)&_XmStrings22[1572]) #endif #ifndef XmNlabel #define XmNlabel ((char*)&_XmStrings22[1582]) #endif #ifndef XmNitalicString #define XmNitalicString ((char*)&_XmStrings22[1588]) #endif #ifndef XmNinsertBefore #define XmNinsertBefore ((char*)&_XmStrings22[1601]) #endif #ifndef XmNindentSpace #define XmNindentSpace ((char*)&_XmStrings22[1614]) #endif #ifndef XmNiconTextPadding #define XmNiconTextPadding ((char*)&_XmStrings22[1626]) #endif #ifndef XmNiconPlacement #define XmNiconPlacement ((char*)&_XmStrings22[1642]) #endif #ifndef XmNhorizontalNodeSpace #define XmNhorizontalNodeSpace ((char*)&_XmStrings22[1656]) #endif #ifndef XmNhorizontalMargin #define XmNhorizontalMargin ((char*)&_XmStrings22[1676]) #endif #ifndef XmNgreenSliderLabel #define XmNgreenSliderLabel ((char*)&_XmStrings22[1693]) #endif #ifndef XmNfreeTabPixmap #define XmNfreeTabPixmap ((char*)&_XmStrings22[1710]) #endif #ifndef XmNfirstRow #define XmNfirstRow ((char*)&_XmStrings22[1724]) #endif #ifndef XmNfirstColumnPixmaps #define XmNfirstColumnPixmaps ((char*)&_XmStrings22[1733]) #endif #ifndef XmNfirstColumn #define XmNfirstColumn ((char*)&_XmStrings22[1752]) #endif #ifndef XmNfindLabel #define XmNfindLabel ((char*)&_XmStrings22[1764]) #endif #ifndef XmNfillOption #define XmNfillOption ((char*)&_XmStrings22[1774]) #endif #ifndef XmNfileReadError #define XmNfileReadError ((char*)&_XmStrings22[1785]) #endif #ifndef XmNfamilyString #define XmNfamilyString ((char*)&_XmStrings22[1799]) #endif #ifndef XmNequalSize #define XmNequalSize ((char*)&_XmStrings22[1812]) #endif #ifndef XmNentryLabelString #define XmNentryLabelString ((char*)&_XmStrings22[1822]) #endif #ifndef XmNentryData #define XmNentryData ((char*)&_XmStrings22[1839]) #endif #ifndef XmNencodingString #define XmNencodingString ((char*)&_XmStrings22[1849]) #endif #ifndef XmNencodingList #define XmNencodingList ((char*)&_XmStrings22[1864]) #endif #ifndef XmNdoubleClickCallback #define XmNdoubleClickCallback ((char*)&_XmStrings22[1877]) #endif #ifndef XmNdefaultEncodingString #define XmNdefaultEncodingString ((char*)&_XmStrings22[1897]) #endif #ifndef XmNdFieldPrefWidth #define XmNdFieldPrefWidth ((char*)&_XmStrings22[1919]) #endif #ifndef XmNdFieldPrefHeight #define XmNdFieldPrefHeight ((char*)&_XmStrings22[1935]) #endif #ifndef XmNdFieldMinWidth #define XmNdFieldMinWidth ((char*)&_XmStrings22[1952]) #endif #ifndef XmNdFieldMinHeight #define XmNdFieldMinHeight ((char*)&_XmStrings22[1967]) #endif #ifndef XmNdFieldMaxWidth #define XmNdFieldMaxWidth ((char*)&_XmStrings22[1983]) #endif #ifndef XmNdFieldMaxHeight #define XmNdFieldMaxHeight ((char*)&_XmStrings22[1998]) #endif #ifndef XmNcustomizedCombinationBox #define XmNcustomizedCombinationBox ((char*)&_XmStrings22[2014]) #endif #ifndef XmNcursor #define XmNcursor ((char*)&_XmStrings22[2039]) #endif #ifndef XmNcurrentFont #define XmNcurrentFont ((char*)&_XmStrings22[2046]) #endif #ifndef XmNconnectStyle #define XmNconnectStyle ((char*)&_XmStrings22[2058]) #endif #ifndef XmNcomboTranslations #define XmNcomboTranslations ((char*)&_XmStrings22[2071]) #endif #ifndef XmNcolumnTitles #define XmNcolumnTitles ((char*)&_XmStrings22[2089]) #endif #ifndef XmNcolorName #define XmNcolorName ((char*)&_XmStrings22[2102]) #endif #ifndef XmNcolorMode #define XmNcolorMode ((char*)&_XmStrings22[2112]) #endif #ifndef XmNcolorListTogLabel #define XmNcolorListTogLabel ((char*)&_XmStrings22[2122]) #endif #ifndef XmNcellY #define XmNcellY ((char*)&_XmStrings22[2140]) #endif #ifndef XmNcellX #define XmNcellX ((char*)&_XmStrings22[2146]) #endif #ifndef XmNbothString #define XmNbothString ((char*)&_XmStrings22[2152]) #endif #ifndef XmNboldString #define XmNboldString ((char*)&_XmStrings22[2163]) #endif #ifndef XmNblueSliderLabel #define XmNblueSliderLabel ((char*)&_XmStrings22[2174]) #endif #ifndef XmCDistribution #define XmCDistribution ((char*)&_XmStrings22[2190]) #endif #ifndef XmCFillStyle #define XmCFillStyle ((char*)&_XmStrings22[2203]) #endif #ifndef XmCItemSpacing #define XmCItemSpacing ((char*)&_XmStrings22[2213]) #endif #ifndef XmCLabelSpacing #define XmCLabelSpacing ((char*)&_XmStrings22[2225]) #endif #ifndef XmCShowLabel #define XmCShowLabel ((char*)&_XmStrings22[2238]) #endif #ifndef XmCStretchable #define XmCStretchable ((char*)&_XmStrings22[2248]) #endif #ifndef XmNdefaultEntryLabelAlignment #define XmNdefaultEntryLabelAlignment ((char*)&_XmStrings22[2260]) #endif #ifndef XmNdefaultEntryLabelFontList #define XmNdefaultEntryLabelFontList ((char*)&_XmStrings22[2287]) #endif #ifndef XmNdefaultFillStyle #define XmNdefaultFillStyle ((char*)&_XmStrings22[2313]) #endif #ifndef XmNdistribution #define XmNdistribution ((char*)&_XmStrings22[2330]) #endif #ifndef XmNentryLabelAlignment #define XmNentryLabelAlignment ((char*)&_XmStrings22[2343]) #endif #ifndef XmNentryLabelFontList #define XmNentryLabelFontList ((char*)&_XmStrings22[2363]) #endif #ifndef XmNentryLabelPixmap #define XmNentryLabelPixmap ((char*)&_XmStrings22[2382]) #endif #ifndef XmNentryLabelType #define XmNentryLabelType ((char*)&_XmStrings22[2399]) #endif #ifndef XmNfillStyle #define XmNfillStyle ((char*)&_XmStrings22[2414]) #endif #ifndef XmNitemSpacing #define XmNitemSpacing ((char*)&_XmStrings22[2424]) #endif #ifndef XmNlabelSpacing #define XmNlabelSpacing ((char*)&_XmStrings22[2436]) #endif #ifndef XmNshowEntryLabel #define XmNshowEntryLabel ((char*)&_XmStrings22[2449]) #endif #ifndef XmNstretchable #define XmNstretchable ((char*)&_XmStrings22[2464]) #endif #ifndef XmRDistribution #define XmRDistribution ((char*)&_XmStrings22[2476]) #endif #ifndef XmRFillStyle #define XmRFillStyle ((char*)&_XmStrings22[2489]) #endif #ifndef XmCEqualSize #define XmCEqualSize ((char*)&_XmStrings22[2499]) #endif #ifndef XmCFillOption #define XmCFillOption ((char*)&_XmStrings22[2509]) #endif #ifndef XmCColorMode #define XmCColorMode ((char*)&_XmStrings22[2520]) #endif #ifndef XmCFileReadError #define XmCFileReadError ((char*)&_XmStrings22[2530]) #endif #ifndef XmCNoCellError #define XmCNoCellError ((char*)&_XmStrings22[2544]) #endif #ifndef XmCSliderLabel #define XmCSliderLabel ((char*)&_XmStrings22[2556]) #endif #ifndef XmCTogLabel #define XmCTogLabel ((char*)&_XmStrings22[2568]) #endif #ifndef XmCAutoFill #define XmCAutoFill ((char*)&_XmStrings22[2577]) #endif #ifndef XmCPicture #define XmCPicture ((char*)&_XmStrings22[2586]) #endif #ifndef XmNautoFill #define XmNautoFill ((char*)&_XmStrings22[2594]) #endif #ifndef XmNpicture #define XmNpicture ((char*)&_XmStrings22[2603]) #endif #ifndef XmNpictureErrorCallback #define XmNpictureErrorCallback ((char*)&_XmStrings22[2611]) #endif #ifndef XmNvalidateCallback #define XmNvalidateCallback ((char*)&_XmStrings22[2632]) #endif #ifndef XmCFindLabel #define XmCFindLabel ((char*)&_XmStrings22[2649]) #endif #ifndef XmCShowFind #define XmCShowFind ((char*)&_XmStrings22[2659]) #endif #ifndef XmNentryBackground #define XmNentryBackground ((char*)&_XmStrings22[2668]) #endif #ifndef XmCColumnTitles #define XmCColumnTitles ((char*)&_XmStrings22[2684]) #endif #ifndef XmCEntryData #define XmCEntryData ((char*)&_XmStrings22[2697]) #endif #ifndef XmCFirstColumnPixmaps #define XmCFirstColumnPixmaps ((char*)&_XmStrings22[2707]) #endif #ifndef XmCFirstLocation #define XmCFirstLocation ((char*)&_XmStrings22[2726]) #endif #ifndef XmCNewVisualStyle #define XmCNewVisualStyle ((char*)&_XmStrings22[2740]) #endif #ifndef XmCNumRows #define XmCNumRows ((char*)&_XmStrings22[2755]) #endif #ifndef XmCScrollBar #define XmCScrollBar ((char*)&_XmStrings22[2763]) #endif #ifndef XmCSelectedColumn #define XmCSelectedColumn ((char*)&_XmStrings22[2773]) #endif #ifndef XmNnewVisualStyle #define XmNnewVisualStyle ((char*)&_XmStrings22[2788]) #endif #ifndef XmCPreferredPaneSize #define XmCPreferredPaneSize ((char*)&_XmStrings22[2803]) #endif #ifndef XmCShowSash #define XmCShowSash ((char*)&_XmStrings22[2821]) #endif #ifndef XmC100DPIString #define XmC100DPIString ((char*)&_XmStrings22[2830]) #endif #ifndef XmC75DPIString #define XmC75DPIString ((char*)&_XmStrings22[2843]) #endif #ifndef XmCAnyLowerString #define XmCAnyLowerString ((char*)&_XmStrings22[2855]) #endif #ifndef XmCAnyString #define XmCAnyString ((char*)&_XmStrings22[2870]) #endif #ifndef XmCBoldString #define XmCBoldString ((char*)&_XmStrings22[2880]) #endif #ifndef XmCBothString #define XmCBothString ((char*)&_XmStrings22[2891]) #endif #ifndef XmCDefaultEncodingString #define XmCDefaultEncodingString ((char*)&_XmStrings22[2902]) #endif #ifndef XmCEncodingList #define XmCEncodingList ((char*)&_XmStrings22[2924]) #endif #ifndef XmCEncodingString #define XmCEncodingString ((char*)&_XmStrings22[2937]) #endif #ifndef XmCFamilyString #define XmCFamilyString ((char*)&_XmStrings22[2952]) #endif #ifndef XmCItalicString #define XmCItalicString ((char*)&_XmStrings22[2965]) #endif #ifndef XmCMonoSpaceString #define XmCMonoSpaceString ((char*)&_XmStrings22[2978]) #endif #ifndef XmCOptionString #define XmCOptionString ((char*)&_XmStrings22[2994]) #endif #ifndef XmCOtherString #define XmCOtherString ((char*)&_XmStrings22[3007]) #endif #ifndef XmCPropSpaceString #define XmCPropSpaceString ((char*)&_XmStrings22[3019]) #endif #ifndef XmCSampleText #define XmCSampleText ((char*)&_XmStrings22[3035]) #endif #ifndef XmCScalingString #define XmCScalingString ((char*)&_XmStrings22[3046]) #endif #ifndef XmCShowNameString #define XmCShowNameString ((char*)&_XmStrings22[3060]) #endif #ifndef XmCSizeString #define XmCSizeString ((char*)&_XmStrings22[3075]) #endif #ifndef XmCTextRows #define XmCTextRows ((char*)&_XmStrings22[3086]) #endif #ifndef XmCXlfdSpaceString #define XmCXlfdSpaceString ((char*)&_XmStrings22[3095]) #endif #ifndef XmN100DPIstring #define XmN100DPIstring ((char*)&_XmStrings22[3111]) #endif #ifndef XmN75DPIstring #define XmN75DPIstring ((char*)&_XmStrings22[3124]) #endif #ifndef XmNanyLowerString #define XmNanyLowerString ((char*)&_XmStrings22[3136]) #endif #ifndef XmNanyString #define XmNanyString ((char*)&_XmStrings22[3151]) #endif #ifndef XmCCellX #define XmCCellX ((char*)&_XmStrings22[3161]) #endif #ifndef XmCCellY #define XmCCellY ((char*)&_XmStrings22[3167]) #endif #ifndef XmCDefaultCells #define XmCDefaultCells ((char*)&_XmStrings22[3173]) #endif #ifndef XmCMinimumCellSize #define XmCMinimumCellSize ((char*)&_XmStrings22[3186]) #endif #ifndef XmCIconPlacement #define XmCIconPlacement ((char*)&_XmStrings22[3202]) #endif #ifndef XmNpixmapDepth #define XmNpixmapDepth ((char*)&_XmStrings22[3216]) #endif #ifndef XmCAutoClose #define XmCAutoClose ((char*)&_XmStrings22[3228]) #endif #ifndef XmCInsertBefore #define XmCInsertBefore ((char*)&_XmStrings22[3238]) #endif #ifndef XmCNodeState #define XmCNodeState ((char*)&_XmStrings22[3251]) #endif #ifndef XmCNodeStateCallback #define XmCNodeStateCallback ((char*)&_XmStrings22[3261]) #endif #ifndef XmCNodeStateChangedCallback #define XmCNodeStateChangedCallback ((char*)&_XmStrings22[3279]) #endif #ifndef XmCParentNode #define XmCParentNode ((char*)&_XmStrings22[3304]) #endif #ifndef XmNautoClose #define XmNautoClose ((char*)&_XmStrings22[3315]) #endif #ifndef XmNcloseFolderPixmap #define XmNcloseFolderPixmap ((char*)&_XmStrings22[3325]) #endif #ifndef XmNnodeCloseFolderPixmap #define XmNnodeCloseFolderPixmap ((char*)&_XmStrings22[3343]) #endif #ifndef XmNnodeOpenFolderPixmap #define XmNnodeOpenFolderPixmap ((char*)&_XmStrings22[3365]) #endif #ifndef XmNnodeStateBeginEndCallback #define XmNnodeStateBeginEndCallback ((char*)&_XmStrings22[3386]) #endif #ifndef XmCConstrainWidth #define XmCConstrainWidth ((char*)&_XmStrings22[3412]) #endif #ifndef XmCIndentSpace #define XmCIndentSpace ((char*)&_XmStrings22[3427]) #endif #ifndef XmNconnectNodes #define XmNconnectNodes ((char*)&_XmStrings22[3439]) #endif #ifndef XmNconstrainWidth #define XmNconstrainWidth ((char*)&_XmStrings22[3452]) #endif #ifndef XmCNumStacks #define XmCNumStacks ((char*)&_XmStrings22[3467]) #endif #ifndef XmCSelectedIndex #define XmCSelectedIndex ((char*)&_XmStrings22[3477]) #endif #ifndef XmCStackedEffect #define XmCStackedEffect ((char*)&_XmStrings22[3491]) #endif #ifndef XmCTabAutoSelect #define XmCTabAutoSelect ((char*)&_XmStrings22[3505]) #endif #ifndef XmCTabCornerPercent #define XmCTabCornerPercent ((char*)&_XmStrings22[3519]) #endif #ifndef XmCTabEdge #define XmCTabEdge ((char*)&_XmStrings22[3536]) #endif #ifndef XmCTabLabelSpacing #define XmCTabLabelSpacing ((char*)&_XmStrings22[3544]) #endif #ifndef XmCTabMode #define XmCTabMode ((char*)&_XmStrings22[3560]) #endif #ifndef XmCTabOffset #define XmCTabOffset ((char*)&_XmStrings22[3568]) #endif #ifndef XmCTabOrientation #define XmCTabOrientation ((char*)&_XmStrings22[3578]) #endif #ifndef XmCTabSelectColor #define XmCTabSelectColor ((char*)&_XmStrings22[3593]) #endif #ifndef XmCTabSelectPixmap #define XmCTabSelectPixmap ((char*)&_XmStrings22[3608]) #endif #ifndef XmCTabStyle #define XmCTabStyle ((char*)&_XmStrings22[3624]) #endif #ifndef XmCTraversalIndex #define XmCTraversalIndex ((char*)&_XmStrings22[3633]) #endif #ifndef XmCUniformTabSize #define XmCUniformTabSize ((char*)&_XmStrings22[3648]) #endif #ifndef XmCUseImageCache #define XmCUseImageCache ((char*)&_XmStrings22[3663]) #endif #ifndef XmCFreeTabPixmap #define XmCFreeTabPixmap ((char*)&_XmStrings22[3677]) #endif #ifndef XmCICSEnhancementPakResourceError #define XmCICSEnhancementPakResourceError ((char*)&_XmStrings22[3691]) #endif #ifndef XmCTabLabelPixmap #define XmCTabLabelPixmap ((char*)&_XmStrings22[3722]) #endif #ifndef XmCTabLabelString #define XmCTabLabelString ((char*)&_XmStrings22[3737]) #endif #ifndef XmCTabPixmapPlacement #define XmCTabPixmapPlacement ((char*)&_XmStrings22[3752]) #endif #ifndef XmCTabSide #define XmCTabSide ((char*)&_XmStrings22[3771]) #endif #ifndef XmNillegalResourceValue #define XmNillegalResourceValue ((char*)&_XmStrings22[3779]) #endif #ifndef XmCCompressStyle #define XmCCompressStyle ((char*)&_XmStrings22[3800]) #endif #ifndef XmCConnectStyle #define XmCConnectStyle ((char*)&_XmStrings22[3814]) #endif #ifndef XmCHorizontalDelta #define XmCHorizontalDelta ((char*)&_XmStrings22[3827]) #endif #ifndef XmCLineWidth #define XmCLineWidth ((char*)&_XmStrings22[3843]) #endif #ifndef XmCOpenClosePadding #define XmCOpenClosePadding ((char*)&_XmStrings22[3853]) #endif #ifndef XmCVerticalDelta #define XmCVerticalDelta ((char*)&_XmStrings22[3870]) #endif #ifndef XmNcompressStyle #define XmNcompressStyle ((char*)&_XmStrings22[3884]) #endif #ifndef XmNhorizontalDelta #define XmNhorizontalDelta ((char*)&_XmStrings22[3898]) #endif #ifndef XmNlineBackgroundColor #define XmNlineBackgroundColor ((char*)&_XmStrings22[3914]) #endif #ifndef XmNlineStyle #define XmNlineStyle ((char*)&_XmStrings22[3934]) #endif #ifndef XmNverticalDelta #define XmNverticalDelta ((char*)&_XmStrings22[3944]) #endif #ifndef XmRXmCompressStyle #define XmRXmCompressStyle ((char*)&_XmStrings22[3958]) #endif #ifndef XmRXmLineStyle #define XmRXmLineStyle ((char*)&_XmStrings22[3974]) #endif #ifndef XmCPopupOffset #define XmCPopupOffset ((char*)&_XmStrings22[3986]) #endif #ifndef XmCUseTextField #define XmCUseTextField ((char*)&_XmStrings22[3998]) #endif #ifndef XmCVerify #define XmCVerify ((char*)&_XmStrings22[4011]) #endif #endif /* XMSTRINGDEFINES */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs22_h_ */ motif-2.3.8/lib/Xm/CallbackI.c0000644000175000017500000001150513145162623012673 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: CallbackI.c /main/8 1995/07/14 10:13:10 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "CallbackI.h" /******************************************************************** * VendorShell and Dialog Shell's extension objects are no longer * full fledged Xt objects and therefore cannot be passed as an * argument to the Xt calls XtAddCallback(), XtRemoveCallback(), * and XtCallCallbackList(). The functions _XmAddCallback() * _XmRemoveCallback() and _XmCallCallbackList() replace these * Xt calls for non Xt objects. ********************************************************************/ /* However it doesn't contain a final NULL record */ #define ToList(p) ((XtCallbackList) (&(p)->callbacks)) void _XmAddCallback(InternalCallbackList* callbacks, XtCallbackProc callback, XtPointer closure) { register XtCallbackList cl; register InternalCallbackList icl = *callbacks; register int count = icl ? icl->count : 0; if (icl && icl->call_state) { icl->call_state |= _XtCBFreeAfterCalling; icl = (InternalCallbackList) XtMalloc(sizeof(InternalCallbackRec) + sizeof(XtCallbackRec) * count); memcpy((char *)ToList(icl), (char *)ToList(*callbacks), sizeof(XtCallbackRec) * count); } else { icl = (InternalCallbackList) XtRealloc((char *) icl, sizeof(InternalCallbackRec) + sizeof(XtCallbackRec) * count); } *callbacks = icl; icl->count = count + 1; icl->is_padded = 0; icl->call_state = 0; cl = ToList(icl) + count; cl->callback = callback; cl->closure = closure; } void _XmRemoveCallback (InternalCallbackList *callbacks, XtCallbackProc callback, XtPointer closure) { register int i, j; register XtCallbackList cl, ncl, ocl; register InternalCallbackList icl = *callbacks; if (!icl) return; cl = ToList(icl); for (i = icl->count; --i >= 0; cl++) { if (cl->callback == callback && cl->closure == closure) { if (icl->call_state) { icl->call_state |= _XtCBFreeAfterCalling; if (icl->count == 1) { *callbacks = NULL; } else { j = icl->count - i - 1; ocl = ToList(icl); icl = (InternalCallbackList) XtMalloc(sizeof(InternalCallbackRec) + sizeof(XtCallbackRec) * (i + j - 1)); icl->count = i + j; icl->is_padded = 0; icl->call_state = 0; ncl = ToList(icl); while (--j >= 0) *ncl++ = *ocl++; while (--i >= 0) *ncl++ = *++cl; *callbacks = icl; } } else { if (--icl->count) { ncl = cl + 1; while (--i >= 0) *cl++ = *ncl++; icl = (InternalCallbackList) XtRealloc((char *) icl, sizeof(InternalCallbackRec) + sizeof(XtCallbackRec) * (icl->count - 1)); icl->is_padded = 0; *callbacks = icl; } else { XtFree((char *) icl); *callbacks = NULL; } } return; } } } void _XmRemoveAllCallbacks(InternalCallbackList *callbacks) { register InternalCallbackList icl = *callbacks; if (icl) { if (icl->call_state) icl->call_state |= _XtCBFreeAfterCalling; else XtFree((char *) icl); *callbacks = NULL; } } void _XmCallCallbackList(Widget widget, XtCallbackList callbacks, XtPointer call_data) { register InternalCallbackList icl; register XtCallbackList cl; register int i; char ostate; if (!callbacks) return; icl = (InternalCallbackList)callbacks; cl = ToList(icl); if (icl->count == 1) { (*cl->callback) (widget, cl->closure, call_data); return; } ostate = icl->call_state; icl->call_state = _XtCBCalling; for (i = icl->count; --i >= 0; cl++) (*cl->callback) (widget, cl->closure, call_data); if (ostate) icl->call_state |= ostate; else if (icl->call_state & _XtCBFreeAfterCalling) XtFree((char *)icl); else icl->call_state = 0; } motif-2.3.8/lib/Xm/DragIcon.c0000644000175000017500000012360713145162623012563 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: DragIcon.c /main/17 1996/10/14 10:44:37 pascale $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include /* To make cpp on Sun happy. CR 5943 */ #include #include #include "TextDIconI.h" #include "DragCI.h" #include "DragICCI.h" #include "DragIconI.h" #include "ImageCachI.h" #include "MessagesI.h" #include "RegionI.h" #include "ScreenI.h" #include "XmI.h" #define MESSAGE1 _XmMMsgDragIcon_0000 #define MESSAGE2 _XmMMsgDragIcon_0001 #define PIXMAP_MAX_WIDTH 128 #define PIXMAP_MAX_HEIGHT 128 #define TheDisplay(dd) (XtDisplayOfObject(XtParent(dd))) typedef struct { unsigned int width, height; int hot_x, hot_y; int offset_x, offset_y; char *dataName; XmConst unsigned char *data; char *maskDataName; XmConst unsigned char *maskData; } XmCursorDataRec, *XmCursorData; /******** Static Function Declarations ********/ static void DragIconInitialize( Widget req, Widget new_w, ArgList args, Cardinal *numArgs) ; static Boolean SetValues( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static void ScreenObjectDestroy( Widget w, XtPointer client_data, XtPointer call_data) ; /******** End Static Function Declarations ********/ #define valid_width 16 #define valid_height 16 #define valid_x_hot 1 #define valid_y_hot 1 #define valid_x_offset 7 #define valid_y_offset 7 static XmConst unsigned char valid_bits[] = { 0x00, 0x00, 0xfe, 0x01, 0xfe, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char valid_m_bits[] = { 0xff, 0x07, 0xff, 0x03, 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00, 0x1f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst XmCursorDataRec validCursorDataRec = { valid_width, valid_height, valid_x_hot, valid_y_hot, valid_x_offset, valid_y_offset, "valid", valid_bits, "valid_m", valid_m_bits, }; #define invalid_width 16 #define invalid_height 16 #define invalid_x_hot 1 #define invalid_y_hot 1 #define invalid_x_offset 7 #define invalid_y_offset 7 static XmConst unsigned char invalid_bits[] = { 0x00, 0x00, 0xe0, 0x03, 0xf8, 0x0f, 0x1c, 0x1c, 0x0c, 0x1e, 0x06, 0x37, 0x86, 0x33, 0xc6, 0x31, 0xe6, 0x30, 0x76, 0x30, 0x3c, 0x18, 0x1c, 0x1c, 0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char invalid_m_bits[] = { 0xe0, 0x03, 0xf8, 0x0f, 0xfc, 0x1f, 0xfe, 0x3f, 0x1e, 0x3f, 0x8f, 0x7f, 0xcf, 0x7f, 0xef, 0x7b, 0xff, 0x79, 0xff, 0x78, 0x7e, 0x3c, 0xfe, 0x3f, 0xfc, 0x1f, 0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00}; static XmConst XmCursorDataRec invalidCursorDataRec = { invalid_width, invalid_height, invalid_x_hot, invalid_y_hot, invalid_x_offset, invalid_y_offset, "invalid", invalid_bits, "invalid_m", invalid_m_bits, }; #define none_width 16 #define none_height 16 #define none_x_hot 1 #define none_y_hot 1 #define none_x_offset 7 #define none_y_offset 7 static XmConst unsigned char none_bits[] = { 0x00, 0x00, 0xe0, 0x03, 0xf8, 0x0f, 0x1c, 0x1c, 0x0c, 0x1e, 0x06, 0x37, 0x86, 0x33, 0xc6, 0x31, 0xe6, 0x30, 0x76, 0x30, 0x3c, 0x18, 0x1c, 0x1c, 0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char none_m_bits[] = { 0xe0, 0x03, 0xf8, 0x0f, 0xfc, 0x1f, 0xfe, 0x3f, 0x1e, 0x3f, 0x8f, 0x7f, 0xcf, 0x7f, 0xef, 0x7b, 0xff, 0x79, 0xff, 0x78, 0x7e, 0x3c, 0xfe, 0x3f, 0xfc, 0x1f, 0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00}; static XmConst XmCursorDataRec noneCursorDataRec = { none_width, none_height, none_x_hot, none_y_hot, none_x_offset, none_y_offset, "none", none_bits, "none_m", none_m_bits, }; #define move_width 16 #define move_height 16 #define move_x_hot 1 #define move_y_hot 1 #define move_x_offset 14 #define move_y_offset 14 static XmConst unsigned char move_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char move_m_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst XmCursorDataRec moveCursorDataRec = { move_width, move_height, move_x_hot, move_y_hot, move_x_offset, move_y_offset, "move", move_bits, "move_m", move_m_bits, }; #define copy_width 16 #define copy_height 16 #define copy_x_hot 1 #define copy_y_hot 1 #define copy_x_offset 14 #define copy_y_offset 14 static XmConst unsigned char copy_bits[] = { 0x00, 0x00, 0xfe, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x1f, 0x02, 0x11, 0x02, 0x11, 0x02, 0x11, 0x02, 0x11, 0x02, 0x11, 0xfe, 0x11, 0x20, 0x10, 0x20, 0x10, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char copy_m_bits[] = { 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xf0, 0x3f, 0xf0, 0x3f, 0xf0, 0x3f, 0x00, 0x00}; static XmConst XmCursorDataRec copyCursorDataRec = { copy_width, copy_height, copy_x_hot, copy_y_hot, copy_x_offset, copy_y_offset, "copy", copy_bits, "copy_m", copy_m_bits, }; #define link_width 16 #define link_height 16 #define link_x_hot 1 #define link_y_hot 1 #define link_x_offset 14 #define link_y_offset 14 static XmConst unsigned char link_bits[] = { 0x00, 0x00, 0xfe, 0x03, 0x02, 0x02, 0x02, 0x02, 0x32, 0x02, 0x32, 0x3e, 0x42, 0x20, 0x82, 0x20, 0x02, 0x21, 0x3e, 0x26, 0x20, 0x26, 0x20, 0x20, 0x20, 0x20, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char link_m_bits[] = { 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xf0, 0x7f, 0xf0, 0x7f, 0xf0, 0x7f, 0xf0, 0x7f, 0x00, 0x00}; static XmConst XmCursorDataRec linkCursorDataRec = { link_width, link_height, link_x_hot, link_y_hot, link_x_offset, link_y_offset, "link", link_bits, "link_m", link_m_bits, }; #define Altsource16_width 16 #define Altsource16_height 16 #define Altsource16_x_hot 2 #define Altsource16_y_hot 2 static XmConst unsigned char Altsource16_bits[] = { 0xfc, 0x03, 0x04, 0x06, 0x04, 0x0a, 0x04, 0x12, 0x04, 0x3e, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0xfc, 0x3f}; static XmConst unsigned char Altsource16_m_bits[] = { 0xfc, 0x03, 0xfc, 0x07, 0xfc, 0x0f, 0xfc, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f}; static XmConst XmCursorDataRec Altsource16CursorDataRec = { Altsource16_width, Altsource16_height, Altsource16_x_hot, Altsource16_y_hot, 0, 0, "Altsource16", Altsource16_bits, "Altsource16_m", Altsource16_m_bits, }; #define Altsource_width 32 #define Altsource_height 32 #define Altsource_x_hot 3 #define Altsource_y_hot 3 static XmConst unsigned char Altsource_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x10, 0x00, 0xc0, 0x00, 0x10, 0x00, 0x40, 0x01, 0x10, 0x00, 0x40, 0x02, 0x10, 0x00, 0x40, 0x04, 0x10, 0x00, 0xc0, 0x0f, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0xf0, 0xff, 0xff, 0x0f}; static XmConst unsigned char Altsource_m_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f}; static XmConst XmCursorDataRec AltsourceCursorDataRec = { Altsource_width, Altsource_height, Altsource_x_hot, Altsource_y_hot, 0, 0, "Altsource", Altsource_bits, "Altsource_m", Altsource_m_bits, }; /* * The 16x16 default icon data. */ #define state16_width 16 #define state16_height 16 #define state16_x_hot 1 #define state16_y_hot 1 #define state16_x_offset -8 #define state16_y_offset -2 static XmConst unsigned char state16_bits[] = { 0x00, 0x00, 0x3e, 0x00, 0x1e, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst unsigned char state16M_bits[] = { 0x7f, 0x00, 0x7f, 0x00, 0x7f, 0x00, 0x3f, 0x00, 0x1f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst XmCursorDataRec state16CursorDataRec = { state16_width, state16_height, state16_x_hot, state16_y_hot, state16_x_offset, state16_y_offset, "state16", state16_bits, "state16M", state16M_bits, }; #define move16_width 16 #define move16_height 16 #define move16_x_hot 1 #define move16_y_hot 1 #define move16_x_offset -8 #define move16_y_offset -2 static XmConst unsigned char move16_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x40, 0x0c, 0x40, 0x1c, 0x40, 0x3c, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0xc0, 0x3f, 0x00, 0x00 }; static XmConst unsigned char move16M_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0xe0, 0x1f, 0xe0, 0x3f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f, 0xe0, 0x7f }; static XmConst XmCursorDataRec move16CursorDataRec = { move16_width, move16_height, move16_x_hot, move16_y_hot, move16_x_offset, move16_y_offset, "move16", move16_bits, "move16M", move16M_bits, }; #define copy16_width 16 #define copy16_height 16 #define copy16_x_hot 1 #define copy16_y_hot 1 #define copy16_x_offset -8 #define copy16_y_offset -2 static XmConst unsigned char copy16_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x80, 0x18, 0x80, 0x38, 0xb0, 0x78, 0x90, 0x40, 0x90, 0x40, 0x90, 0x40, 0x90, 0x40, 0x90, 0x40, 0x90, 0x7f, 0x10, 0x00, 0x10, 0x08, 0xf0, 0x0f, 0x00, 0x00 }; static XmConst unsigned char copy16M_bits[] = { 0x00, 0x00, 0xc0, 0x1f, 0xc0, 0x3f, 0xc0, 0x7f, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0xff, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f }; static XmConst XmCursorDataRec copy16CursorDataRec = { copy16_width, copy16_height, copy16_x_hot, copy16_y_hot, copy16_x_offset, copy16_y_offset, "copy16", copy16_bits, "copy16M", copy16M_bits, }; #define link16_width 16 #define link16_height 16 #define link16_x_hot 1 #define link16_y_hot 1 #define link16_x_offset -8 #define link16_y_offset -2 static XmConst unsigned char link16_bits[] = { 0x00, 0x00, 0x80, 0x0f, 0x80, 0x18, 0x80, 0x38, 0x80, 0x78, 0xb8, 0x40, 0x88, 0x4e, 0x88, 0x4c, 0x08, 0x4a, 0x08, 0x41, 0xa8, 0x7c, 0x68, 0x00, 0xe8, 0x04, 0x08, 0x04, 0xf8, 0x07, 0x00, 0x00 }; static XmConst unsigned char link16M_bits[] = { 0xc0, 0x1f, 0xc0, 0x3f, 0xc0, 0x7f, 0xc0, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f }; static XmConst XmCursorDataRec link16CursorDataRec = { link16_width, link16_height, link16_x_hot, link16_y_hot, link16_x_offset, link16_y_offset, "link16", link16_bits, "link16M", link16M_bits, }; #define source16_width 16 #define source16_height 16 #define source16_x_hot 0 #define source16_y_hot 0 static XmConst unsigned char source16_bits[] = { 0x00, 0x00, 0xaa, 0xca, 0x54, 0x85, 0xaa, 0xca, 0x54, 0xe0, 0x2a, 0xe3, 0x94, 0x81, 0xea, 0xf8, 0x54, 0xd4, 0xaa, 0xac, 0x94, 0xd9, 0xca, 0xac, 0x64, 0xd6, 0x32, 0xab, 0xa4, 0xd6, 0xfe, 0xff }; static XmConst XmCursorDataRec source16CursorDataRec = { source16_width, source16_height, source16_x_hot, source16_y_hot, 0, 0, "source16", /* a file icon */ source16_bits, NULL, NULL, }; /* * The 32x32 default icon data. */ #define state32_width 32 #define state32_height 32 #define state32_x_hot 1 #define state32_y_hot 1 #define state32_x_offset -16 #define state32_y_offset -4 static XmConst unsigned char state32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst unsigned char state32M_bits[] = { 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst XmCursorDataRec state32CursorDataRec = { state32_width, state32_height, state32_x_hot, state32_y_hot, state32_x_offset, state32_y_offset, "state32", state32_bits, "state32M", state32M_bits, }; #define move32_width 32 #define move32_height 32 #define move32_x_hot 1 #define move32_y_hot 1 #define move32_x_offset -16 #define move32_y_offset -4 static XmConst unsigned char move32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x20, 0x60, 0x00, 0x00, 0x20, 0xe0, 0x00, 0x00, 0x20, 0xe0, 0x01, 0x00, 0x20, 0xe0, 0x03, 0x00, 0x20, 0xe0, 0x07, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst unsigned char move32M_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x07, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst XmCursorDataRec move32CursorDataRec = { move32_width, move32_height, move32_x_hot, move32_y_hot, move32_x_offset, move32_y_offset, "move32", move32_bits, "move32M", move32M_bits, }; #define copy32_width 32 #define copy32_height 32 #define copy32_x_hot 1 #define copy32_y_hot 1 #define copy32_x_offset -16 #define copy32_y_offset -4 static XmConst unsigned char copy32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x20, 0x60, 0x00, 0x00, 0x20, 0xe0, 0x00, 0x00, 0x20, 0xe0, 0x01, 0x00, 0x20, 0xe0, 0x03, 0x00, 0x20, 0xe0, 0x07, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x2c, 0x00, 0x20, 0x00, 0x6c, 0x00, 0x20, 0x00, 0xec, 0x00, 0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01, 0x20, 0x00, 0x8c, 0x01, 0xe0, 0xff, 0x8f, 0x01, 0xc0, 0xff, 0x8f, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x04, 0x80, 0x01, 0x00, 0x04, 0x80, 0x01, 0x00, 0xfc, 0xff, 0x01, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00 }; static XmConst unsigned char copy32M_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x07, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfc, 0xff, 0x03 }; static XmConst XmCursorDataRec copy32CursorDataRec = { copy32_width, copy32_height, copy32_x_hot, copy32_y_hot, copy32_x_offset, copy32_y_offset, "copy32", copy32_bits, "copy32M", copy32M_bits, }; #define link32_width 32 #define link32_height 32 #define link32_x_hot 1 #define link32_y_hot 1 #define link32_x_offset -16 #define link32_y_offset -4 static XmConst unsigned char link32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x20, 0x30, 0x00, 0x00, 0x20, 0x70, 0x00, 0x00, 0x20, 0xf0, 0x00, 0x00, 0x20, 0xf0, 0x01, 0x00, 0x20, 0x00, 0x7b, 0x00, 0x20, 0x00, 0xc3, 0x00, 0x20, 0x04, 0xc3, 0x01, 0x20, 0x06, 0xc3, 0x03, 0x20, 0x0f, 0xc2, 0x07, 0x20, 0x36, 0x00, 0x0c, 0x20, 0xc4, 0x00, 0x0c, 0x20, 0x00, 0x23, 0x0c, 0x20, 0x00, 0x6c, 0x0c, 0x20, 0x00, 0xf0, 0x0c, 0xe0, 0xff, 0x61, 0x0c, 0xc0, 0xff, 0x23, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x80, 0x00, 0x0c, 0x00, 0x80, 0x00, 0x0c, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst unsigned char link32M_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x1f, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static XmConst XmCursorDataRec link32CursorDataRec = { link32_width, link32_height, link32_x_hot, link32_y_hot, link32_x_offset, link32_y_offset, "link32", link32_bits, "link32M", link32M_bits, }; #define source32_width 32 #define source32_height 32 #define source32_x_hot 0 #define source32_y_hot 0 static XmConst unsigned char source32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x54, 0x55, 0x55, 0xd5, 0xa8, 0xaa, 0xaa, 0xea, 0x54, 0x55, 0x55, 0xd1, 0xa8, 0xaa, 0xaa, 0xe0, 0x54, 0x55, 0x55, 0xd0, 0xa8, 0xaa, 0xaa, 0xf0, 0x54, 0x55, 0x55, 0xd9, 0xa8, 0xaa, 0x00, 0xee, 0x54, 0x55, 0x00, 0xd6, 0xa8, 0x2a, 0x3f, 0xea, 0x54, 0x95, 0x05, 0xd7, 0xa8, 0xea, 0x82, 0xee, 0x54, 0x45, 0xc1, 0xd5, 0xa8, 0xaa, 0xf4, 0x81, 0x54, 0xd5, 0x78, 0xff, 0xa8, 0xaa, 0xa0, 0xea, 0x54, 0x95, 0x41, 0xd5, 0xa8, 0x4a, 0x87, 0xea, 0x54, 0x85, 0x0d, 0xd5, 0xa8, 0xc2, 0x9a, 0xea, 0x54, 0x61, 0x05, 0xd5, 0xa8, 0xb0, 0xc2, 0xea, 0x54, 0x58, 0x61, 0xd5, 0x28, 0xac, 0xb0, 0xea, 0x14, 0x56, 0x58, 0xd5, 0x08, 0xab, 0xa8, 0xea, 0x14, 0x55, 0x51, 0xd5, 0x28, 0xaa, 0xaa, 0xea, 0xfc, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, }; static XmConst XmCursorDataRec source32CursorDataRec = { source32_width, source32_height, source32_x_hot, source32_y_hot, 0, 0, "source32", /* a file icon */ source32_bits, NULL, NULL, }; typedef struct _XmQuarkToCursorEntryRec{ XrmQuark *xrmName; XmConst XmCursorDataRec *cursor; } XmQuarkToCursorEntryRec, *XmQuarkToCursorEntry; /* Used to be XmConst, but this was not linking on Solaris */ static XmQuarkToCursorEntryRec AltquarkToCursorTable[] = { { &_XmValidCursorIconQuark, &state32CursorDataRec}, { &_XmInvalidCursorIconQuark,&state32CursorDataRec}, { &_XmNoneCursorIconQuark, &state32CursorDataRec}, { &_XmMoveCursorIconQuark, &move32CursorDataRec}, { &_XmCopyCursorIconQuark, ©32CursorDataRec}, { &_XmLinkCursorIconQuark, &link32CursorDataRec}, { &_XmDefaultDragIconQuark, &AltsourceCursorDataRec}, }; /* Used to be XmConst, but this was not linking on Solaris */ static XmQuarkToCursorEntryRec AltquarkTo16CursorTable[] = { { &_XmValidCursorIconQuark, &validCursorDataRec}, { &_XmInvalidCursorIconQuark,&invalidCursorDataRec}, { &_XmNoneCursorIconQuark, &noneCursorDataRec}, { &_XmMoveCursorIconQuark, &moveCursorDataRec}, { &_XmCopyCursorIconQuark, ©CursorDataRec}, { &_XmLinkCursorIconQuark, &linkCursorDataRec}, { &_XmDefaultDragIconQuark, &Altsource16CursorDataRec}, }; /* Used to be XmConst, but this was not linking on Solaris */ static XmQuarkToCursorEntryRec quarkToCursorTable[] = { {&_XmValidCursorIconQuark, &state32CursorDataRec}, {&_XmInvalidCursorIconQuark,&state32CursorDataRec}, {&_XmNoneCursorIconQuark, &state32CursorDataRec}, {&_XmMoveCursorIconQuark, &move32CursorDataRec}, {&_XmCopyCursorIconQuark, ©32CursorDataRec}, {&_XmLinkCursorIconQuark, &link32CursorDataRec}, {&_XmDefaultDragIconQuark, &source32CursorDataRec}, }; /* Used to be XmConst, but this was not linking on Solaris */ static XmQuarkToCursorEntryRec quarkTo16CursorTable[] = { {&_XmValidCursorIconQuark, &state16CursorDataRec}, {&_XmInvalidCursorIconQuark,&state16CursorDataRec}, {&_XmNoneCursorIconQuark, &state16CursorDataRec}, {&_XmMoveCursorIconQuark, &move16CursorDataRec}, {&_XmCopyCursorIconQuark, ©16CursorDataRec}, {&_XmLinkCursorIconQuark, &link16CursorDataRec}, {&_XmDefaultDragIconQuark, &source16CursorDataRec}, }; #undef Offset #define Offset(x) (XtOffsetOf( struct _XmDragIconRec, drag.x)) static XContext _XmTextualDragIconContext = (XContext) NULL; static XtResource resources[]= { { XmNdepth, XmCDepth, XmRInt, sizeof(int), Offset(depth), XmRImmediate, (XtPointer)1, }, { XmNwidth, XmCWidth, XmRHorizontalDimension, sizeof(Dimension), Offset(width), XmRImmediate, (XtPointer) 0, }, { XmNheight, XmCHeight, XmRVerticalDimension, sizeof(Dimension), Offset(height), XmRImmediate, (XtPointer) 0, }, { XmNhotX, XmCHot, XmRPosition, sizeof(Position), Offset(hot_x), XmRImmediate, (XtPointer)0, }, { XmNhotY, XmCHot, XmRPosition, sizeof(Position), Offset(hot_y), XmRImmediate, (XtPointer)0, }, { XmNmask, XmCPixmap, XmRBitmap, sizeof(Pixmap), Offset(mask), XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP, }, { XmNpixmap, XmCPixmap, XmRDynamicPixmap, sizeof(Pixmap), Offset(pixmap), XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP, }, { XmNoffsetX, XmCOffset, XmRPosition, sizeof(Position), Offset(offset_x), XmRImmediate, (XtPointer)0, }, { XmNoffsetY, XmCOffset, XmRPosition, sizeof(Position), Offset(offset_y), XmRImmediate, (XtPointer)0, }, { XmNattachment, XmCAttachment, XmRIconAttachment, sizeof(unsigned char), Offset(attachment), XmRImmediate, (XtPointer) XmATTACH_NORTH_WEST }, }; externaldef(xmdragiconclassrec) XmDragIconClassRec xmDragIconClassRec = { { (WidgetClass) &objectClassRec, /* superclass */ "XmDragIcon", /* class_name */ sizeof(XmDragIconRec), /* size */ NULL, /* Class Initializer */ NULL, /* class_part_init */ FALSE, /* Class init'ed ? */ DragIconInitialize, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ (XtResourceList)resources, /* resources */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ XtExposeNoCompress, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, { /* dragIcon */ NULL, /* extension */ }, }; externaldef(dragIconobjectclass) WidgetClass xmDragIconObjectClass = (WidgetClass) &xmDragIconClassRec; /************************************************************************ * * DragIconInitialize * ************************************************************************/ /*ARGSUSED*/ static void DragIconInitialize( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *numArgs ) /* unused */ { XmDragIconObject dragIcon = (XmDragIconObject)new_w; Screen *screen = XtScreenOfObject(XtParent(dragIcon)); Display * display = XtDisplay(new_w); XmDisplay xmdpy = (XmDisplay) XmGetXmDisplay(display); Boolean use_alt = xmdpy -> display.enable_drag_icon; dragIcon->drag.isDirty = False; if (dragIcon->drag.pixmap == XmUNSPECIFIED_PIXMAP) { XmCursorData cursorData = NULL; Cardinal i = 0; XImage *image = NULL; Dimension maxW, maxH; /* * If this is one of the default cursors (recognized by name) * then we use the built in images to generate the pixmap, its * mask (as appropriate), and its dimensions and hot spot. */ XmeQueryBestCursorSize (XtParent(dragIcon), &maxW, &maxH); if (maxW < 32 || maxH < 32) { /* * Use small icons. */ if (! use_alt) { for (i = 0; i < XtNumber(quarkTo16CursorTable); i++) { if ((*(quarkTo16CursorTable[i].xrmName)) == dragIcon->object.xrm_name) { cursorData = (XmCursorData) quarkTo16CursorTable[i].cursor; break; } } } else { for (i = 0; i < XtNumber(quarkTo16CursorTable); i++) { if ((*(AltquarkTo16CursorTable[i].xrmName)) == dragIcon->object.xrm_name) { cursorData = (XmCursorData) AltquarkTo16CursorTable[i].cursor; break; } } } } else { /* * Use large icons. */ if (! use_alt) { for (i = 0; i < XtNumber(quarkToCursorTable); i++) { if ((*(quarkToCursorTable[i].xrmName)) == dragIcon->object.xrm_name) { cursorData = (XmCursorData) quarkToCursorTable[i].cursor; break; } } } else { for (i = 0; i < XtNumber(quarkToCursorTable); i++) { if ((*(AltquarkToCursorTable[i].xrmName)) == dragIcon->object.xrm_name) { cursorData = (XmCursorData) AltquarkToCursorTable[i].cursor; break; } } } } if (cursorData) { dragIcon->drag.depth = 1; dragIcon->drag.width = cursorData->width; dragIcon->drag.height = cursorData->height; dragIcon->drag.hot_x = cursorData->hot_x; dragIcon->drag.hot_y = cursorData->hot_y; dragIcon->drag.offset_x = cursorData->offset_x; dragIcon->drag.offset_y = cursorData->offset_y; _XmCreateImage(image, display, (char *)cursorData->data, dragIcon->drag.width, dragIcon->drag.height, LSBFirst); _XmInstallImage(image, cursorData->dataName, (int)dragIcon->drag.hot_x, (int)dragIcon->drag.hot_y); dragIcon->drag.pixmap = XmGetPixmapByDepth (screen, cursorData->dataName, 1, 0, 1); if (cursorData->maskData) { _XmCreateImage(image, display, (char *)cursorData->maskData, dragIcon->drag.width, dragIcon->drag.height, LSBFirst); _XmInstallImage (image, cursorData->maskDataName, 0, 0); dragIcon->drag.mask = XmGetPixmapByDepth(screen, cursorData->maskDataName, 1, 0, 1); } } dragIcon->drag.region = NULL; } else if (dragIcon->drag.pixmap != XmUNSPECIFIED_PIXMAP) { int depth; unsigned int width, height; int hot_x, hot_y; String name; Pixel foreground, background; if ((dragIcon->drag.width == 0) || (dragIcon->drag.height == 0)) { if (XmeGetPixmapData(screen, dragIcon->drag.pixmap, &name, &depth, &foreground, &background, &hot_x, &hot_y, &width, &height)) { dragIcon->drag.depth = depth; dragIcon->drag.hot_x = hot_x; dragIcon->drag.hot_y = hot_y; dragIcon->drag.width = (Dimension)width; dragIcon->drag.height = (Dimension)height; } else { dragIcon->drag.width = dragIcon->drag.height = 0; dragIcon->drag.pixmap = XmUNSPECIFIED_PIXMAP; XmeWarning ((Widget) new_w, MESSAGE1); } } if (dragIcon->drag.mask != XmUNSPECIFIED_PIXMAP) { XImage * image; if (dragIcon->drag.width > 0 && dragIcon->drag.height > 0) { image = XGetImage(display, (Drawable) dragIcon->drag.mask, 0, 0, dragIcon->drag.width, dragIcon->drag.height, 1L, XYPixmap); dragIcon->drag.region = (Region) _XmRegionFromImage(image); if (image) XDestroyImage(image); } else dragIcon->drag.region = NULL; } else dragIcon->drag.region = NULL; } dragIcon->drag.restore_region = NULL; dragIcon->drag.x_offset = 0; dragIcon->drag.y_offset = 0; if (dragIcon->drag.pixmap == XmUNSPECIFIED_PIXMAP) { XmeWarning ((Widget) new_w, MESSAGE2); } } /************************************************************************ * * XmCreateDragIcon * ************************************************************************/ Widget XmCreateDragIcon( Widget parent, String name, ArgList argList, Cardinal argCount ) { return (XtCreateWidget (name, xmDragIconObjectClass, parent, argList, argCount)); } /************************************************************************ * * _XmDestroyDefaultDragIcon () * * A default XmDragIcon's pixmap and mask (if present) were installed in * the Xm pixmap cache from built-in images when the XmDragIcon was * initialized. ************************************************************************/ void _XmDestroyDefaultDragIcon( XmDragIconObject icon) { Screen *screen = XtScreenOfObject(XtParent(icon)); if (icon->drag.pixmap != XmUNSPECIFIED_PIXMAP) { XmDestroyPixmap (screen, icon->drag.pixmap); icon->drag.pixmap = XmUNSPECIFIED_PIXMAP; } if (icon->drag.mask != XmUNSPECIFIED_PIXMAP) { XmDestroyPixmap (screen, icon->drag.mask); icon->drag.mask = XmUNSPECIFIED_PIXMAP; } XtDestroyWidget ((Widget) icon); } /************************************************************************ * * _XmDragIconIsDirty () * * Test the isDirty member of XmDragIconObject. ************************************************************************/ Boolean _XmDragIconIsDirty( XmDragIconObject icon) { return (icon->drag.isDirty); } /************************************************************************ * * _XmDragIconClean () * * Clear the isDirty member of XmDragIconObjects. ************************************************************************/ void _XmDragIconClean( XmDragIconObject icon1, XmDragIconObject icon2, XmDragIconObject icon3) { if (icon1) icon1->drag.isDirty = False; if (icon2) icon2->drag.isDirty = False; if (icon3) icon3->drag.isDirty = False; } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget current, Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmDragIconObject newIcon = (XmDragIconObject) new_w; XmDragIconObject oldIcon = (XmDragIconObject) current; /* * Mark the icon as dirty if any of its resources have changed. */ if ((newIcon->drag.depth != oldIcon->drag.depth) || (newIcon->drag.pixmap != oldIcon->drag.pixmap) || (newIcon->drag.mask != oldIcon->drag.mask) || (newIcon->drag.width != oldIcon->drag.width) || (newIcon->drag.height != oldIcon->drag.height) || (newIcon->drag.attachment != oldIcon->drag.attachment) || (newIcon->drag.offset_x != oldIcon->drag.offset_x) || (newIcon->drag.offset_y != oldIcon->drag.offset_y) || (newIcon->drag.hot_x != oldIcon->drag.hot_x) || (newIcon->drag.hot_y != oldIcon->drag.hot_y)) { newIcon->drag.isDirty = True; } if (newIcon->drag.mask != oldIcon->drag.mask) { if (newIcon->drag.mask != XmUNSPECIFIED_PIXMAP) { XImage * image; if (newIcon->drag.width > 0 && newIcon->drag.height > 0) { image = XGetImage(XtDisplay(new_w), (Drawable) newIcon->drag.mask, 0, 0, newIcon->drag.width, newIcon->drag.height, 1L, XYPixmap); newIcon->drag.region = (Region) _XmRegionFromImage(image); if (image) XDestroyImage(image); } else newIcon->drag.region = NULL; } else newIcon->drag.region = NULL; if (oldIcon->drag.region) { XDestroyRegion(oldIcon->drag.region); oldIcon->drag.region = NULL; } } return False; } /************************************************************************ * * Destroy * * Remove any cached cursors referencing this icon. ************************************************************************/ static void Destroy( Widget w ) { XmDragIconObject dragIcon = (XmDragIconObject) w; if (dragIcon->drag.region != NULL) { XDestroyRegion(dragIcon->drag.region); dragIcon->drag.region = NULL; } if (dragIcon->drag.restore_region != NULL) { XDestroyRegion(dragIcon->drag.restore_region); dragIcon->drag.restore_region = NULL; } _XmScreenRemoveFromCursorCache (dragIcon); } /* ARGSUSED */ static void ScreenObjectDestroy( Widget w, XtPointer client_data, XtPointer call_data ) { Widget drag_icon = (Widget) client_data; XtDestroyWidget(drag_icon); /* destroy drag_icon */ _XmProcessLock(); XDeleteContext(XtDisplay(w), RootWindowOfScreen(XtScreen(w)), _XmTextualDragIconContext); _XmProcessUnlock(); } Widget XmeGetTextualDragIcon( Widget w ) { Widget drag_icon; Arg args[10]; int n = 0; Pixmap icon, icon_mask; Screen *screen = XtScreen(w); XImage *image = NULL; Window root; Widget screen_object; XmDisplay dpy; Boolean use_alt; XContext loc_context; _XmWidgetToAppContext(w); _XmAppLock(app); root = RootWindowOfScreen(XtScreen(w)); dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); use_alt = dpy -> display.enable_drag_icon; _XmProcessLock(); if (_XmTextualDragIconContext == (XContext) NULL) _XmTextualDragIconContext = XUniqueContext(); loc_context = _XmTextualDragIconContext; _XmProcessUnlock(); if (XFindContext(XtDisplay(w), root, loc_context, (char **) &drag_icon)) { Dimension height, width; int x_hot, y_hot; XmConst unsigned char *icon_bits; XmConst unsigned char *icon_mask_bits; XmeQueryBestCursorSize(w, &width, &height); if (width < 64 && height < 64) { if (use_alt) { icon_bits = XmTEXTUAL_DRAG_ICON_BITS_Alt_16; icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_Alt_16; height = XmTEXTUAL_DRAG_ICON_HEIGHT_Alt_16; width = XmTEXTUAL_DRAG_ICON_WIDTH_Alt_16; x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_Alt_16; y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_Alt_16; } else { icon_bits = XmTEXTUAL_DRAG_ICON_BITS_16; icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_16; height = XmTEXTUAL_DRAG_ICON_HEIGHT_16; width = XmTEXTUAL_DRAG_ICON_WIDTH_16; x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_16; y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_16; } } else { if (use_alt) { icon_bits = XmTEXTUAL_DRAG_ICON_BITS_Alt_32; icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_Alt_32; height = XmTEXTUAL_DRAG_ICON_HEIGHT_Alt_32; width = XmTEXTUAL_DRAG_ICON_WIDTH_Alt_32; x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_Alt_32; y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_Alt_32; } else { icon_bits = XmTEXTUAL_DRAG_ICON_BITS_32; icon_mask_bits = XmTEXTUAL_DRAG_ICON_MASK_BITS_32; height = XmTEXTUAL_DRAG_ICON_HEIGHT_32; width = XmTEXTUAL_DRAG_ICON_WIDTH_32; x_hot = XmTEXTUAL_DRAG_ICON_X_HOT_32; y_hot = XmTEXTUAL_DRAG_ICON_Y_HOT_32; } } _XmCreateImage(image, XtDisplay(w), (char *)icon_bits, width, height, LSBFirst); _XmInstallImage(image, "XmTextualDragIcon", x_hot, y_hot); icon = XmGetPixmapByDepth(screen, "XmTextualDragIcon", 1, 0, 1); _XmCreateImage(image, XtDisplay(w), (char *)icon_mask_bits, width, height, LSBFirst); _XmInstallImage(image, "XmTextualDragIconMask", x_hot, y_hot); icon_mask = XmGetPixmapByDepth(screen, "XmTextualDragIconMask", 1, 0, 1); screen_object = XmGetXmScreen(XtScreen(w)); XtSetArg(args[n], XmNhotX, x_hot); n++; XtSetArg(args[n], XmNhotY, y_hot); n++; XtSetArg(args[n], XmNheight, height); n++; XtSetArg(args[n], XmNwidth, width); n++; XtSetArg(args[n], XmNmaxHeight, height); n++; XtSetArg(args[n], XmNmaxWidth, width); n++; XtSetArg(args[n], XmNmask, icon_mask); n++; XtSetArg(args[n], XmNpixmap, icon); n++; drag_icon = XtCreateWidget("drag_icon", xmDragIconObjectClass, screen_object, args, n); XSaveContext(XtDisplay(w), root, loc_context, (char *) drag_icon); XtAddCallback(screen_object, XmNdestroyCallback, ScreenObjectDestroy, (XtPointer) drag_icon); } _XmAppUnlock(app); return drag_icon; } motif-2.3.8/lib/Xm/ToolTipT.h0000644000175000017500000000100612672140200012573 00000000000000/** * * $Id: ToolTipT.h,v 1.1 2004/11/18 08:54:33 yura Exp $ * **/ #ifndef _XmToolTipT_H #define _XmToolTipT_H #ifdef __cplusplus extern "C" { #endif #include externalref XrmQuark XmQTtoolTip; /* Trait structures and typedefs, place typedefs first */ typedef struct _XmToolTipTraitRec { int version; XmString tool_tip_string; } XmToolTipTraitRec, *XmToolTipTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmToolTipT_H */ motif-2.3.8/lib/Xm/Xm.c0000644000175000017500000003257213145162623011461 00000000000000/* $XConsortium: Xm.c /main/6 1995/10/25 20:28:03 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "MessagesI.h" #include #include #include #include #include #ifdef FIX_345 #include #endif /************************************************************************** * This is Xm.c * It contains global API that: * - it's not widget specific * - it's already used by various widgets (you don't get useless * code by linking with this module: all the functions * are useful and used. * For example, TrackingLocate or ResolvePartOffset do not belong * here because they are not used by everybody. *************************************************************************/ #ifdef FIX_345 Boolean _init_modifiers = TRUE; unsigned int NumLockMask = 0; unsigned int ScrollLockMask = 0; /*************************************<->************************************* * * _XmInitModifiers (void) * * Description: * ----------- * Sets the appropriate mask for NumLock and ScrollLock * * * Inputs: * ------ * None * * Outputs: * ------- * None * * Procedures Called * ----------------- * None * *************************************<->***********************************/ void _XmInitModifiers (void) { XModifierKeymap *modmap; Display *dpy; KeySym *keymap; unsigned int keycode; int min_keycode; int max_keycode; int keysyms_per_keycode; int i; dpy = _XmGetDefaultDisplay(); NumLockMask = 0; ScrollLockMask = 0; keysyms_per_keycode = 0; min_keycode = 0; max_keycode = 0; XDisplayKeycodes (dpy, &min_keycode, &max_keycode); modmap = XGetModifierMapping (dpy); keymap = XGetKeyboardMapping (dpy, min_keycode, max_keycode - min_keycode + 1, &keysyms_per_keycode); if (modmap && keymap) { for (i = 3 * modmap->max_keypermod; i < 8 * modmap->max_keypermod; i++) { keycode = modmap->modifiermap[i]; if ((keycode >= min_keycode) && (keycode <= max_keycode)) { int j; KeySym *syms = keymap + (keycode - min_keycode) * keysyms_per_keycode; for (j = 0; j < keysyms_per_keycode; j++) if (!NumLockMask && (syms[j] == XK_Num_Lock)) NumLockMask = (1 << (i / modmap->max_keypermod)); else if (!ScrollLockMask && (syms[j] == XK_Scroll_Lock)) ScrollLockMask = (1 << (i / modmap->max_keypermod)); } } } /* Cleanup memory */ if (modmap) XFreeModifiermap (modmap); if (keymap) XFree (keymap); } #endif /************************************************************************** * * * _XmSocorro - Help dispatch function. Start at the widget help was * * invoked on, find the first non-null help callback list, and call it. * * -- Called by various widgets across Xm * * * *************************************************************************/ /* ARGSUSED */ void _XmSocorro( Widget w, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmAnyCallbackStruct cb; if (w == NULL) return; cb.reason = XmCR_HELP; cb.event = event; do { if ((XtHasCallbacks(w, XmNhelpCallback) == XtCallbackHasSome)) { XtCallCallbacks (w, XmNhelpCallback, &cb); return; } else w = XtParent(w); } while (w != NULL); } /**************************************************************** * * _XmParentProcess * This is the entry point for parent processing. * -- Called by various widgets across Xm * ****************************************************************/ Boolean _XmParentProcess( Widget widget, XmParentProcessData data ) { XmManagerWidgetClass manClass ; manClass = (XmManagerWidgetClass) widget->core.widget_class ; if( XmIsManager( widget) && manClass->manager_class.parent_process ) { return( (*manClass->manager_class.parent_process)( widget, data)) ; } return( FALSE) ; } /************************************************************************ * * _XmDestroyParentCallback * Destroy parent. Used by various dialog subclasses * ************************************************************************/ /* ARGSUSED */ void _XmDestroyParentCallback( Widget w, XtPointer client_data, /* unused */ XtPointer call_data ) /* unused */ { XtDestroyWidget (XtParent (w)); } /************************************************************************ * * _XmClearShadowType * Clear the right and bottom border area and save * the old width, height and shadow type. * Used by various subclasses for resize larger situation, where the * inside shadow is not exposed. * Maybe that should be moved in Draw.c, maybe not, since it's a widget API * ************************************************************************/ void _XmClearShadowType( Widget w, #if NeedWidePrototypes int old_width, int old_height, int old_shadow_thickness, int old_highlight_thickness ) #else Dimension old_width, Dimension old_height, Dimension old_shadow_thickness, Dimension old_highlight_thickness ) #endif /* NeedWidePrototypes */ { if (old_shadow_thickness == 0) return; if (XtIsRealized(w)) { if (old_width <= w->core.width) XClearArea (XtDisplay (w), XtWindow (w), old_width - old_shadow_thickness - old_highlight_thickness, 0, old_shadow_thickness, old_height - old_highlight_thickness, False); if (old_height <= w->core.height) XClearArea (XtDisplay (w), XtWindow (w), 0, old_height - old_shadow_thickness - old_highlight_thickness, old_width - old_highlight_thickness, old_shadow_thickness, False); } } /********************************************************************** * * _XmReOrderResourceList * This procedure moves the given resource right after the * insert_after name in this class resource list. * (+ insert_after NULL means insert in front) * * ----Replace by a call to an Xt function in R6.----- **********************************************************************/ void _XmReOrderResourceList( WidgetClass widget_class, String res_name, String insert_after) { XrmResource **list; int len; XrmQuark res_nameQ = XrmPermStringToQuark(res_name); XrmResource *tmp ; int n ; _XmProcessLock(); list = (XrmResource **) widget_class->core_class.resources ; len = widget_class->core_class.num_resources; /* look for the named resource slot */ n = 0; while ((n < len) && (list[n]->xrm_name != res_nameQ)) n++; if (n < len) { int m, i; XrmQuark insert_afterQ ; if (insert_after) { insert_afterQ = XrmPermStringToQuark(insert_after) ; /* now look for the insert_after resource slot */ m = 0; while ((m < len) && (list[m]->xrm_name != insert_afterQ)) m++; } else m = len ; if (m == len) m = -1 ; /* now do the insertion/packing, both cases */ tmp = list[n] ; if (n > m) { for (i = n; i > m+1; i--) list[i] = list[i-1]; list[m+1] = tmp; } else { for (i = n; i < m; i++) list[i] = list[i+1]; list[m] = tmp; } } _XmProcessUnlock(); } /************************************************************************ * * _XmWarningMsg * Add XME_WARNING to Message list so MotifWarningHandler will * add Name: & Class: * ************************************************************************/ void _XmWarningMsg(Widget w, char *type, char *message, char **params, Cardinal num_params) { Display * dpy; char *new_params[11]; Cardinal num_new_params = num_params + 1; int i; if (num_new_params > 11) num_new_params = 11; for (i = 0; i < num_new_params-1; i++) new_params[i] = params[i]; new_params[num_new_params-1] = XME_WARNING; if (w != NULL) { XtAppWarningMsg (XtWidgetToApplicationContext(w), XrmQuarkToString (w->core.xrm_name), type, w->core.widget_class->core_class.class_name, message, new_params, &num_new_params); } else XtWarning(message); } /* ARGSUSED */ Boolean _XmIsISO10646(Display *dpy, XFontStruct *font) { Boolean ok; int i; char *regname; Atom registry; XFontProp *xfp; ok = False; registry = XInternAtom(dpy, "CHARSET_REGISTRY", False); for (i = 0, xfp = font->properties; ok == False && i < font->n_properties; xfp++, i++) { if (xfp->name == registry) { regname = XGetAtomName(dpy, (Atom) xfp->card32); if (strcmp(regname, "ISO10646") == 0 || strcmp(regname, "iso10646") == 0) ok = True; XFree(regname); } } return ok; } XChar2b* _XmUtf8ToUcs2(char *draw_text, size_t seg_len, size_t *ret_str_len) { char *ep; unsigned short codepoint; XChar2b *ptr; XChar2b *buf2b; /* * Convert to UCS2 string on the fly. */ buf2b = (XChar2b *)XtMalloc(seg_len * sizeof(XChar2b)); ep = draw_text + seg_len; for (ptr = buf2b; draw_text < ep; ptr++) { if((draw_text[0]&0x80)==0) { codepoint=draw_text[0]; draw_text++; } else if((draw_text[0]&0x20)==0) { codepoint = (draw_text[0]&0x1F)<<6 | (draw_text[1]&0x3F); draw_text+=2; } else if((draw_text[0]&0x10)==0) { codepoint = (draw_text[0]&0x0F)<<12 | (draw_text[1]&0x3F)<<6 | (draw_text[2]&0x3F); draw_text+=3; } else { /* wrong UTF-8 */ codepoint=(unsigned)'?'; draw_text++; } ptr->byte1 = (codepoint >> 8) & 0xff;; ptr->byte2 = codepoint & 0xff; } *ret_str_len = ptr - buf2b; return buf2b; } /***************************************/ /********---- PUBLIC API ----**********/ /*************************************/ /************************************************************************ * * XmeWarning * Build up a warning message and call Xt to get it displayed. * ************************************************************************/ void XmeWarning(Widget w, char *message ) { char *params[1]; Cardinal num_params = 0; Display * dpy; if (w != NULL) { /* the MotifWarningHandler installed in VendorS.c knows about this convention */ params[0] = XME_WARNING; num_params++; XtAppWarningMsg (XtWidgetToApplicationContext(w), XrmQuarkToString (w->core.xrm_name), "XmeWarning", w->core.widget_class->core_class.class_name, message, params, &num_params); } else XtWarning(message); } /************************************************************************ * * XmObjectAtPoint * new implementation that ask a manager class method * -- Called by various widgets across Xm * ************************************************************************/ Widget XmObjectAtPoint( Widget wid, Position x, Position y ) { XmManagerWidgetClass mw = (XmManagerWidgetClass) XtClass(wid); XmManagerClassExt *mext ; Widget return_wid = NULL; _XmWidgetToAppContext(wid); _XmAppLock(app); if (!XmIsManager(wid)) { _XmAppUnlock(app); return NULL; } mext = (XmManagerClassExt *) _XmGetClassExtensionPtr( (XmGenericClassExt *) &(mw->manager_class.extension), NULLQUARK) ; if (!*mext) { _XmAppUnlock(app); return NULL; } if ((*mext)->object_at_point) return_wid = ((*mext)->object_at_point)(wid, x, y); _XmAppUnlock(app); return return_wid; } #ifdef FIX_1381 /************************************************************************ * * _XmAssignInsensitiveColor * Allocate the Gray color for display widget like insensitive. * * ************************************************************************/ Pixel _XmAssignInsensitiveColor(Widget w) { Pixel p = 0; if (XmIsPrimitive(w)) { XmPrimitiveWidget pw = (XmPrimitiveWidget) w; p = pw->primitive.bottom_shadow_color; } else if (XmIsGadget(w)) { if (XmIsLabelGadget(w)) { XmLabelGadget lg = (XmLabelGadget) w; p = LabG_BottomShadowColor(lg); } if (XmIsIconGadget(w)) { XmIconGadget ig = (XmIconGadget) w; p = IG_BottomShadowColor(ig); } } else { p = 0; } return p; } #endif motif-2.3.8/lib/Xm/XmString.c0000644000175000017500000100270113145162623012640 00000000000000 /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: XmString.c /main/34 1998/04/16 14:35:32 mgreess $" #endif #endif #include #include /* for MB_LEN_MAX */ #ifndef X_NOT_STDC_ENV #include #endif #include #include #ifdef __cplusplus extern "C" { /* some 'locale.h' do not have prototypes (sun) */ #endif #include #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif /* __cplusplus */ #include #include /* for XmGetXmDisplay */ #include /* for noFontCallback list */ #include #include "MessagesI.h" #include "ResIndI.h" #include "XmI.h" #include "XmosI.h" #include "XmRenderTI.h" #include "XmStringI.h" #include "XmTabListI.h" # include #define FIX_1434 #define FIX_1488 #define FIX_1532 # define Va_start(a,b) va_start(a,b) /* Warning Messages */ #define NO_FONT_MSG _XmMMsgXmString_0000 /* These are the os-specific environment variables checked for a language ** specification. */ #define env_variable "LANG" struct __Xmlocale { char *tag; int taglen; Boolean inited; }; /* enums for which_seg for calculating widths */ enum { XmSTRING_FIRST_SEG, XmSTRING_MIDDLE_SEG, XmSTRING_LAST_SEG, XmSTRING_SINGLE_SEG }; /* Enums for marking internal_flags field in XmParseMappings. */ enum { XmSTRING_UNPARSE_UNKNOWN, /* Parse mapping hasn't been examined. */ XmSTRING_UNPARSE_PLAUSIBLE, /* Parse mapping might unparse. */ XmSTRING_UNPARSE_IMPLAUSIBLE /* Parse mapping will never unparse. */ }; /* Values for drawing underlining renditions. */ #define SINGLE_OFFSET 1 #define DOUBLE_OFFSET 2 #define Half(x) (x >> 1) /* _XmStringEntry macros only acessible inside XmString code */ #define _XmEntryRendCountedBegins(entry, count) \ (_XmEntryOptimized(entry) ? \ (((count) && _XmEntryRendIndex(entry) != REND_INDEX_UNSET) ? \ &(_tag_cache[_XmEntryRendIndex(entry)]) : NULL) : \ _XmUnoptSegRendBegins(entry)) #define _XmEntryRendBegins(entry) \ (_XmEntryOptimized(entry) ? \ ((_XmEntryRendBeginCountGet(entry) && \ _XmEntryRendIndex(entry) != REND_INDEX_UNSET) ? \ &(_tag_cache[_XmEntryRendIndex(entry)]) : NULL) : \ _XmUnoptSegRendBegins(entry)) #define _XmEntryRendCountedEnds(entry, count) \ (_XmEntryOptimized(entry) ? \ (((count) && _XmEntryRendIndex(entry) != REND_INDEX_UNSET) ? \ &(_tag_cache[_XmEntryRendIndex(entry)]) : NULL) : \ _XmUnoptSegRendEnds(entry)) #define _XmEntryRendEnds(entry) \ (_XmEntryOptimized(entry) ? \ ((_XmEntryRendEndCountGet(entry) && \ _XmEntryRendIndex(entry) != REND_INDEX_UNSET) ? \ &(_tag_cache[_XmEntryRendIndex(entry)]) : NULL) : \ _XmUnoptSegRendEnds(entry)) /* * this set constructs ASN.1 XmString format object. The TLV version */ /* The ASN.1 version of XmString is: COMPOUND_STRING 4 or 6 bytes (see description below) component tag 1 byte length 1 or 3 bytes value n bytes component tag 1 byte length 1 or 3 bytes value n bytes eg. very simple... */ /* * ASN.1 header for compound string - 3 byte header, followed by length * which is three bytes maximum, but almost always 1 byte. * * The first byte defines the ASN.1 space: (0xdf) * 1 1 0 1 1 1 1 1 * class form ID code * * class is private, form is primitive (not constructed from other * forms), and the ID code value means the actual ID code value is * extended into one or more octets. * * The second and third bytes define the actual ID code value. The * value used for 1.2 is the inverse of the original XUI value. * second byte: (0x80) * 1 0000000 * MSB high seven bits of ID code * * third byte: (0x06) * 0 0000110 * LSB low seven bits of ID code * * The length field of the ASN.1 conformant compound string header * is dynamically constructed. There are two possible forms depending * upon the length of the string. Note that this length excludes the * header bytes. * * Short Form: range 0 .. 127 * one byte * 0 nnnnnnn * short 7 bit length * * Long Form: range 128 .. 2**16-1 * three bytes * first: 1 nnnnnnn * long number of bytes to follow * * second: * nnnnnnnn * MSB of length * * third: * nnnnnnnn * LSB of length * * This process for constructing the length field will also be * used to construct the length field within individual tag-length-value * triplets. */ #define ASNHEADERLEN 3 static XmConst unsigned char ASNHeader[ASNHEADERLEN] = { 0xdf, 0x80, 0x06 }; #define MAXSHORTVALUE 127 /* maximum len to be used for short length form */ #define CSLONGLEN 3 #define CSSHORTLEN 1 #define CSLONGLEN1 0x82 #define CSLONGBIT 0x80 #define ASNTAG 1 /* Num bytes for tag & length = ASNTAG + [CSSHORTLEN | CSLONGLEN] */ #define HEADER 3 /* num bytes for tag & length */ /* * calculates the number of bytes in the header of an external compound * string, given the total length of the components. */ #define _calc_header_size(len) \ ((((unsigned short)(len)) > MAXSHORTVALUE) ? (ASNHEADERLEN + CSLONGLEN) : \ (ASNHEADERLEN + CSSHORTLEN)) #define _asn1_size(len) \ ((((unsigned short)(len)) > MAXSHORTVALUE) ? (ASNTAG + CSLONGLEN) : \ (ASNTAG + CSSHORTLEN)) #define _is_asn1_long(p) \ ((*((unsigned char *)(p) + ASNTAG)) & ((unsigned char)CSLONGBIT)) /******** Static Function Declarations ********/ static Boolean _is_short_length( unsigned char *p) ; static void _write_long_length( unsigned char *p, #if NeedWidePrototypes unsigned int length) ; #else unsigned short length) ; #endif /* NeedWidePrototypes */ static unsigned char * _write_header( unsigned char *p, #if NeedWidePrototypes unsigned int length) ; #else unsigned short length) ; #endif /* NeedWidePrototypes */ static unsigned char * _read_header( unsigned char *p) ; static unsigned short _read_header_length( unsigned char *p) ; static unsigned short _read_length( unsigned char *p) ; static unsigned short _read_string_length( unsigned char *p) ; static unsigned char * _write_component( unsigned char *p, #if NeedWidePrototypes unsigned int tag, unsigned int length, #else unsigned char tag, unsigned short length, #endif /* NeedWidePrototypes */ unsigned char *value, #if NeedWidePrototypes int move_by_length) ; #else Boolean move_by_length) ; #endif /* NeedWidePrototypes */ static unsigned char * _read_component( unsigned char *p, unsigned char *tag, unsigned short *length, unsigned char *value) ; static Boolean RenditionsCompatible(_XmStringEntry seg1, _XmStringEntry seg2); static void MergeEnds(_XmStringEntry a, _XmStringEntry b); static void MergeBegins(_XmStringEntry a, _XmStringEntry b); static Boolean _is_asn1(unsigned char *string) ; static XmString Clone(XmString string, int lines); static void OptLineMetrics(XmRenderTable rendertable, _XmString line, XmRendition *rend_io, XmRendition base_rend, Dimension *width, Dimension *height, Dimension *ascender, Dimension *descender ); static Dimension OptLineAscender( XmRenderTable f, _XmStringOpt opt) ; static void LineMetrics(_XmStringEntry line, XmRenderTable r, XmRendition *rend_io, XmRendition base, XmDirection prim_dir, Dimension *width, Dimension *height, Dimension *ascender, Dimension *descender); static void SubStringPosition( #if NeedWidePrototypes int one_byte, #else Boolean one_byte, #endif /* NeedWidePrototypes */ XmRenderTable rt, XmRendition entry, _XmStringEntry seg, _XmStringEntry under_seg, #if NeedWidePrototypes int x, #else Position x, #endif /* NeedWidePrototypes */ Dimension *under_begin, Dimension *under_end) ; static void recursive_layout(_XmString string, int *line_index, int *seg_index, #if NeedWidePrototypes int direction, int p_direction, #else XmDirection direction, XmDirection p_direction, #endif /* NeedWidePrototypes */ int depth); static void last_direction(_XmStringEntry line, int *index, XmDirection *direction); static void DrawLine(Display *d, Window w, Screen **pscreen, int x, int y, _XmStringEntry line, XmRendition *scr_rend, XmRendition base, XmRenderTable rendertable, XmDirection prim_dir, #if NeedWidePrototypes int image, #else Boolean image, #endif /* NeedWidePrototypes */ _XmString *underline, #if NeedWidePrototypes int descender, int opt, int opt_width, int opt_height #else Dimension descender, Boolean opt, Dimension opt_width, Dimension opt_height #endif /* NeedWidePrototypes */ ); static void _calc_align_and_clip( Display *d, Window w, GC gc, Position *x, #if NeedWidePrototypes int y, int width, #else Position y, Dimension width, #endif /* NeedWidePrototypes */ int line_width, #ifdef FIX_1488 int line_height, #endif #if NeedWidePrototypes unsigned int lay_dir, #else unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, #if NeedWidePrototypes unsigned int align, #else unsigned char align, #endif /* NeedWidePrototypes */ int descender, int *restore, XmFontType font_type) ; static void _draw( Display *d, Window w, XmRenderTable rendertable, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, #if NeedWidePrototypes int image, #else Boolean image, #endif /* NeedWidePrototypes */ _XmString underline) ; static void _render(Display *d, Drawable w, XmRenderTable rendertable, XmRendition rend, _XmString string, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, int image, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, Boolean image, #endif /* NeedWidePrototypes */ _XmString underline, XRectangle *clip); static _XmString _XmStringOptCreate( unsigned char *c, unsigned char *end, #if NeedWidePrototypes unsigned int textlen, int havetag, #else unsigned short textlen, Boolean havetag, #endif /* NeedWidePrototypes */ unsigned int tag_index) ; static void finish_segment(_XmString str, _XmStringUnoptSeg seg, int *lc, int *sc, Boolean *unopt, XmStringDirection dir); static _XmString _XmStringNonOptCreate( unsigned char *c, unsigned char *end, #if NeedWidePrototypes int havetag) ; #else Boolean havetag) ; #endif /* NeedWidePrototypes */ static Boolean SpecifiedSegmentExtents(_XmStringEntry entry, XmRenderTable rendertable, XmRendition *rend_in_out, XmRendition base, int which_seg, Dimension *width, Dimension *height, Dimension *ascent, Dimension *descent); static void ComputeMetrics(XmRendition rend, XtPointer text, unsigned int byte_count, XmTextType type, int which_seg, Dimension *width, Dimension *height, Dimension *ascent, Dimension *descent, Boolean utf8); static Dimension ComputeWidth(unsigned char which, XCharStruct char_ret); static void _parse_locale( char *str, int *indx, int *len) ; static Boolean match_pattern(XtPointer text, XmStringTag tag, XmTextType type, XmParseMapping pattern, int char_len, Boolean dir_change); static void parse_unmatched(XmString *result, char **ptr, XmTextType text_type, int length); static Boolean parse_pattern(XmString *result, char **ptr, XtPointer text_end, XmStringTag tag, XmTextType type, XmParseMapping pat, int length, XtPointer call_data, Boolean *terminate); static void check_unparse_models(XmStringContext context, XmStringTag tag, XmTextType tag_type, XmParseModel parse_model, Boolean *prev_text_match, Boolean *next_text_match, Boolean *non_text_match); static void unparse_text(char **result, int *length, XmTextType output_type, XmStringComponentType c_type, unsigned int c_length, XtPointer c_value); static Boolean unparse_is_plausible(XmParseMapping pattern); static void unparse_components(char **result, int *length, XmTextType output_type, XmStringContext context, XmParseTable parse_table, Cardinal parse_count); static void begin_context_rends(_XmStringContext context, Boolean update_context, XmStringTag *renditions, int count); static void end_context_rends(_XmStringContext context, Boolean update_context, XmStringTag *rendition, int count); static XFontStruct * GetFont(XmRenderTable rt, _XmStringEntry entry); static _XmStringCache CacheGet(_XmStringEntry entry, int type, int create, XtPointer match_value); static _XmStringEntry EntryCvtToOpt(_XmStringEntry entry); static _XmStringEntry EntryCvtToUnopt(_XmStringEntry entry); static XmString StringTabCreate(void); static XmString StringEmptyCreate(void); static int _get_generate_parse_table (XmParseTable *gen_table); /******** End Static Function Declarations ********/ static struct __Xmlocale locale; static char **_tag_cache; static int _cache_count = 0; /* * Determines whether this string has a short or long length field */ static Boolean _is_short_length( unsigned char *p ) { unsigned char *uchar_p = (unsigned char *) p; uchar_p += ASNHEADERLEN; if (*uchar_p & (char)CSLONGBIT) return (FALSE); else return (TRUE); } /* * Routine that writes a long length field */ static void _write_long_length( unsigned char *p, #if NeedWidePrototypes unsigned int length ) #else unsigned short length ) #endif /* NeedWidePrototypes */ { unsigned char * uchar_p = (unsigned char *) p; /* * flag the long version */ *uchar_p = CSLONGLEN1; uchar_p++; /* * need to pull off the high 8 bits */ *uchar_p = (unsigned char) (length >> 8); uchar_p++; *uchar_p = (unsigned char) (length & 0xff); } /* * Private routines for manipulating the ASN.1 header of external * compound strings. */ static unsigned char * _write_header( unsigned char *p, #if NeedWidePrototypes unsigned int length ) #else unsigned short length ) #endif /* NeedWidePrototypes */ { unsigned char * uchar_p = p; int headlen; /* write the header in. */ headlen = ASNHEADERLEN; memcpy( uchar_p, ASNHeader, ASNHEADERLEN); uchar_p += ASNHEADERLEN; /* short or long length value? */ if (length > MAXSHORTVALUE) { _write_long_length(uchar_p, length); headlen += CSLONGLEN; } else { /* Short version */ *uchar_p = (unsigned char) length; headlen += CSSHORTLEN; } return (p + headlen); } /* * extracts the ASN.1 header from the external compound string. */ static unsigned char * _read_header( unsigned char *p ) { /* * Read past the ASN.1 header; get the first length byte and see if this * is a one or three byte length. */ if (_is_short_length(p)) return (p + ASNHEADERLEN + CSSHORTLEN); else return (p + ASNHEADERLEN + CSLONGLEN); } /* * reads the length the ASN.1 header of an external * compound string. */ static unsigned short _read_header_length( unsigned char *p ) { /* * Get the first length byte and see if this * is a one or three byte length. */ if (_is_short_length(p)) return (ASNHEADERLEN + CSSHORTLEN); else return (ASNHEADERLEN + CSLONGLEN); } /* * calculates the length of the external compound string, excluding the * ASN.1 header. */ static unsigned short _read_string_length( unsigned char *p ) { unsigned char * uchar_p = (unsigned char *) p; unsigned short totallen = 0; /* * Read past the ASN.1 header; get the first length byte and see if this * is a one or three byte length. */ uchar_p += ASNHEADERLEN; if (_is_short_length(p)) { totallen += (unsigned short) *uchar_p; } else { unsigned short i; uchar_p++; i = ((unsigned short) *uchar_p) << 8; uchar_p++; i |= ((unsigned short) *uchar_p); /* Mask on the low byte */ totallen += i; } return (totallen); } /* * calculates length of component marked by a tag-length-value triple. */ static unsigned short _read_asn1_length( unsigned char *p ) { unsigned char * uchar_p = (unsigned char *) p; unsigned short totallen = 0; /* * Read past the tag; get the first length byte and see if this * is a one or three byte length. */ uchar_p += ASNTAG; if (_is_asn1_long(p)) { unsigned short i; uchar_p++; i = ((unsigned short) *uchar_p) << 8; uchar_p++; i |= ((unsigned short) *uchar_p); /* Mask on the low byte */ totallen += i; } else { totallen += (unsigned short) *uchar_p; } return (totallen); } /* * determines length of ASN.1 length field of component of external * compound string. */ static unsigned short _read_length( unsigned char *p ) { /* * Read past the tag field; get the first length byte and see if this * is a one or three byte length. */ if (_is_asn1_long(p)) return ((unsigned short)(ASNTAG + CSLONGLEN)); else return ((unsigned short)(ASNTAG + CSSHORTLEN)); } /* * Private routines for reading/writing the individual compound string * components */ static unsigned char * _write_component( unsigned char *p, #if NeedWidePrototypes unsigned int tag, unsigned int length, #else unsigned char tag, unsigned short length, #endif /* NeedWidePrototypes */ unsigned char *value, #if NeedWidePrototypes int move_by_length ) #else Boolean move_by_length ) #endif /* NeedWidePrototypes */ { unsigned char * uchar_p = p; *uchar_p = tag; /* stuff tag */ uchar_p += ASNTAG; /* short or long length value? */ if (length > MAXSHORTVALUE) { _write_long_length(uchar_p, length); uchar_p += CSLONGLEN; } else { /* Short version */ *uchar_p = (unsigned char) length; uchar_p += CSSHORTLEN; } if (value != (unsigned char *) NULL) memcpy((char *)uchar_p, (char *)value, (size_t)length); if (move_by_length) return (uchar_p + length); else return (uchar_p); } static unsigned char * _read_component( unsigned char *p, unsigned char *tag, unsigned short *length, unsigned char *value) { unsigned char * uchar_p = (unsigned char *) p; *tag = *uchar_p; /* read tag */ *length = _read_asn1_length(p); uchar_p += _read_length(p); /* move to value */ if (value != NULL) memcpy(value, uchar_p, *length); return (uchar_p + *length); } /* Create a new XmString */ XmString XmStringCreate( char *text, XmStringTag tag ) { XmString ret_val; _XmProcessLock(); ret_val = _XmStringNCreate (text, tag, -1); _XmProcessUnlock(); return ret_val; } /* Create a new XmString */ XmString _XmStringNCreate(char *text, XmStringTag tag, int len) { XmString str; char *curtag = NULL; int t_length; unsigned int tag_index = 0; _XmString opt_str; XmTextType type = XmCHARSET_TEXT; if (!text) return ((XmString) NULL); if (!tag) return ((XmString) NULL); t_length = ((len >= 0) ? len : strlen (text)); if ((tag == XmFONTLIST_DEFAULT_TAG) || (strcmp(tag, XmFONTLIST_DEFAULT_TAG) == 0)) { curtag = tag; type = XmMULTIBYTE_TEXT; } else { if ((strcmp(tag, XmSTRING_DEFAULT_CHARSET) == 0)) curtag = _XmStringGetCurrentCharset(); else curtag = tag; } tag_index = _XmStringIndexCacheTag(curtag, XmSTRING_TAG_STRLEN); if ((tag_index < TAG_INDEX_UNSET) && (t_length < (1 << BYTE_COUNT_BITS))) /* Create optimized string. */ { _XmStrCreate(opt_str, XmSTRING_OPTIMIZED, t_length); _XmStrTagIndex(opt_str) = tag_index; _XmStrTextType(opt_str) = type; memcpy(_XmStrText(opt_str), text, t_length); return(opt_str); } else /* Non-optimized */ { _XmStringUnoptSegRec seg; _XmStrCreate(str, XmSTRING_MULTIPLE_ENTRY, 0); _XmEntryInit((_XmStringEntry)&seg, XmSTRING_ENTRY_UNOPTIMIZED); _XmUnoptSegTag(&seg) = _XmStringCacheTag(curtag, XmSTRING_TAG_STRLEN); _XmEntryTextTypeSet(&seg, type); _XmEntryTextSet((_XmStringEntry)&seg, text); _XmUnoptSegByteCount(&seg) = t_length; _XmStringSegmentNew(str, 0, (_XmStringEntry)&seg, True); return(str); } } /* * Convenience routine creating localized XmString from NULL terminated string. */ XmString XmStringCreateLocalized( String text ) { return (XmStringGenerate(text, NULL, XmCHARSET_TEXT, NULL)); } /* Create an optimized _XmString with only direction set. */ XmString XmStringDirectionCreate( #if NeedWidePrototypes int direction ) #else XmStringDirection direction ) #endif /* NeedWidePrototypes */ { /* Maintain a static cache of the common results. */ static XmConst XmStringDirection dir_index[] = { XmSTRING_DIRECTION_L_TO_R, XmSTRING_DIRECTION_R_TO_L, XmSTRING_DIRECTION_UNSET, XmSTRING_DIRECTION_DEFAULT }; static _XmString cache_str[] = { NULL, NULL, NULL, NULL }; int index; _XmString opt_str = NULL; _XmProcessLock(); /* Find the static cache index and string for this direction. */ assert(XtNumber(dir_index) == XtNumber(cache_str)); for (index = 0; index < XtNumber(dir_index); index++) if (dir_index[index] == direction) { opt_str = cache_str[index]; break; } /* Create the return string if necessary and this is a known direction. */ if (!opt_str && (index < XtNumber(dir_index))) { _XmStrCreate(opt_str, XmSTRING_OPTIMIZED, 0); _XmStrDirection(opt_str) = direction; cache_str[index] = opt_str; } /* Try to copy a cached string by incrementing its reference count. */ if ((index < XtNumber(dir_index)) && (_XmStrRefCountInc(opt_str) == 0)) { _XmStrRefCountDec(opt_str); /* Undo previous increment. */ XmStringFree(opt_str); /* Release our cached copy. */ cache_str[index] = NULL; opt_str = XmStringDirectionCreate(direction); _XmProcessUnlock(); return (XmString) opt_str; } _XmProcessUnlock(); return (XmString) opt_str; } /* Create an empty non-optimized _XmString containing a single newline */ XmString XmStringSeparatorCreate( void ) { static _XmString str = NULL; XmString ret_val; _XmProcessLock(); if (!str) { int i; _XmStrCreate(str, XmSTRING_MULTIPLE_ENTRY, 0); _XmStrImplicitLine(str) = True; _XmStrEntry(str) = (_XmStringEntry *)XtMalloc(2*sizeof(_XmStringEntry)); _XmStrEntryCount(str) = 2; for (i = 0; i < 2; i++) { _XmEntryCreate(_XmStrEntry(str)[i], XmSTRING_ENTRY_OPTIMIZED); } } /* If the reference count gets too big free the old string. */ if (_XmStrRefCountInc(str) == 0) { _XmStrRefCountDec(str); /* Undo previous increment. */ XmStringFree(str); /* Release our cached copy. */ str = NULL; ret_val = XmStringSeparatorCreate(); _XmProcessUnlock(); return ret_val; } ret_val = Clone(str, _XmStrEntryCountGet(str)); /* ??? */ _XmProcessUnlock(); return (XmString)ret_val; } /* Create an empty optimized _XmString containing a single tab. */ static XmString StringTabCreate( void ) { static _XmString opt_str = NULL; if (!opt_str) { _XmStrCreate(opt_str, XmSTRING_OPTIMIZED, 0); _XmStrTabs(opt_str) = 1; } /* If the reference count gets too big free the old string. */ if (_XmStrRefCountInc(opt_str) == 0) { _XmStrRefCountDec(opt_str); /* Undo previous increment. */ XmStringFree(opt_str); /* Release our cached copy. */ opt_str = NULL; return StringTabCreate(); } return (XmString)opt_str; } /* Create an empty optimized _XmString. */ static XmString StringEmptyCreate( void ) { static _XmString opt_str = NULL; if (!opt_str) { _XmStrCreate(opt_str, XmSTRING_OPTIMIZED, 0); } /* If the reference count gets too big free the old string. */ if (_XmStrRefCountInc(opt_str) == 0) { _XmStrRefCountDec(opt_str); /* Undo previous increment. */ XmStringFree(opt_str); /* Release our cached copy. */ opt_str = NULL; return StringEmptyCreate(); } return (XmString)opt_str; } /* * this set provides access to the internal components of XmStrings */ /* * set up the read-out context */ Boolean XmStringInitContext( XmStringContext *context, XmString string ) { XmStringContext ct; _XmProcessLock(); /* Initialize the out parameters. */ if (context) *context = NULL; /* make sure there is something in the string. we are going to assume a good string in the get next routine */ if (!(string && context)) { _XmProcessUnlock(); return (FALSE); } ct = (XmStringContext) XtMalloc(sizeof(_XmStringContextRec)); _XmStringContextReInit(ct, string); *context = ct; _XmProcessUnlock(); return (TRUE); } /* * free the read-out context */ void XmStringFreeContext( _XmStringContext context ) { _XmProcessLock(); if (context) { _XmStringContextFree(context); XtFree((char *) context); } _XmProcessUnlock(); } /* * this set is the TCS font list handling stuff */ XmStringTag _XmStringIndexGetTag(int index) { XmStringTag ret_val; _XmProcessLock(); if (index > _cache_count) { _XmProcessUnlock(); return NULL; } ret_val = _tag_cache[index]; _XmProcessUnlock(); return ret_val; } int _XmStringIndexCacheTag(XmStringTag tag, int length ) { char *a; register int i; /* Initialize cache with XmFONTLIST_DEFAULT_TAG, _MOTIF_DEFAULT_LOCALE, and locale.tag if necessary, to keep indices low. */ _XmProcessLock(); if (_cache_count == 0) { _tag_cache = (char **)XtMalloc(sizeof(char **) * 3); _tag_cache[_cache_count] = XmFONTLIST_DEFAULT_TAG; _cache_count++; _tag_cache[_cache_count] = _MOTIF_DEFAULT_LOCALE; _cache_count++; _tag_cache[_cache_count] = _XmStringGetCurrentCharset(); _cache_count++; } /* Look for an existing cache entry. */ for (i = 0; i < _cache_count; i++) { if (((tag == _tag_cache[i]) || ((length != XmSTRING_TAG_STRLEN) && (strncmp(tag, _tag_cache[i], length) == 0)) || ((length == XmSTRING_TAG_STRLEN) && (strcmp(tag, _tag_cache[i]) == 0))) && ((length == XmSTRING_TAG_STRLEN) || (_tag_cache[i][length] == '\0'))) { _XmProcessUnlock(); return( i) ; } } /* Add this entry to the cache. */ if (length == XmSTRING_TAG_STRLEN) length = strlen(tag); _tag_cache = (char **) XtRealloc ((char *) _tag_cache, sizeof (char **) * (_cache_count + 1)); a = XtMalloc (length + 1); memcpy(a, tag, length); a[length] = '\0'; _tag_cache[_cache_count] = a; _cache_count++; _XmProcessUnlock(); return(i) ; } XmStringTag _XmStringCacheTag(XmStringTag tag, int length ) { int tag_index ; XmStringTag ret_val; _XmProcessLock(); if (tag == NULL) { _XmProcessUnlock(); return NULL; } tag_index = _XmStringIndexCacheTag( tag, length) ; ret_val = _tag_cache[tag_index] ; _XmProcessUnlock(); return ret_val; } static Boolean RenditionsCompatible(_XmStringEntry seg1, _XmStringEntry seg2) { int i; XmStringTag *begin1, *begin2, *end1, *end2; short bcnt1, bcnt2, ecnt1, ecnt2, diff; _XmProcessLock(); bcnt1 = _XmEntryRendBeginCountGet(seg1); bcnt2 = _XmEntryRendBeginCountGet(seg2); ecnt1 = _XmEntryRendEndCountGet(seg1); ecnt2 = _XmEntryRendEndCountGet(seg2); begin1 = _XmEntryRendCountedBegins(seg1, bcnt1); begin2 = _XmEntryRendCountedBegins(seg2, bcnt2); end1 = _XmEntryRendCountedEnds(seg1, ecnt1); end2 = _XmEntryRendCountedEnds(seg2, ecnt2); _XmProcessUnlock(); /* if seg1 is optimized, we are very limited in what renditions will be compatible, since there is only one rend_index. */ if (_XmEntryOptimized(seg1) && (((ecnt1 != 0) && (bcnt2 != 0)) || ((bcnt1 > 0) && (bcnt2 > 0)) || ((ecnt1 > 0) && (ecnt2 > 0)) || ((bcnt1 > 0) && (ecnt2 > 0) && (begin1[0] != end2[0])))) return (FALSE); if ((_XmEntryByteCountGet(seg1) == 0) && (ecnt1 == 0)) return(TRUE); if ((_XmEntryByteCountGet(seg2) == 0) && (bcnt2 == 0)) return(TRUE); if ((ecnt1 == 0) && (bcnt2 == 0)) return(TRUE); return(FALSE); } static void MergeEnds(_XmStringEntry a, _XmStringEntry b) { int i; short a_count, b_count; a_count = _XmEntryRendEndCountGet(a); b_count = _XmEntryRendEndCountGet(b); if ((a_count == 0) && (b_count == 0)) return; if (_XmEntryOptimized(a)) { if (a_count == 0 && b_count == 1) { _XmEntryRendIndex(a) = _XmEntryOptimized(b) ? _XmEntryRendIndex(b) : _XmStringIndexCacheTag(_XmEntryRendEndGet(b, 0), XmSTRING_TAG_STRLEN); _XmEntryRendEndCountSet(a, 1); } return; } _XmUnoptSegRendEnds(a) = (XmStringTag *)XtRealloc((char *)_XmUnoptSegRendEnds(a), (sizeof(XmStringTag) * (a_count + b_count))); for (i = 0; i < b_count; i++) _XmUnoptSegRendEnds(a)[(a_count + i)] = _XmEntryRendEndGet(b, i); _XmEntryRendEndCountSet(a, (a_count + b_count)); } static void MergeBegins(_XmStringEntry a, _XmStringEntry b) { XmStringTag *b_begin; short a_b_cnt; short b_b_cnt; int i; a_b_cnt = _XmEntryRendBeginCountGet(a); b_b_cnt = _XmEntryRendBeginCountGet(b); b_begin = _XmEntryRendCountedBegins(b, b_b_cnt); if ((a_b_cnt == 0) && (b_b_cnt == 0)) return; if (_XmEntryOptimized(a)) { if (a_b_cnt == 0 && b_b_cnt == 1) { _XmEntryRendIndex(a) = _XmEntryOptimized(b) ? _XmEntryRendIndex(b) : _XmStringIndexCacheTag(b_begin[0], XmSTRING_TAG_STRLEN); _XmEntryRendBeginCountSet(a, 1); } return; } _XmUnoptSegRendBegins(a) = (XmStringTag *)XtRealloc((char *)_XmUnoptSegRendBegins(a), sizeof(XmStringTag) * (a_b_cnt + b_b_cnt)); for (i = 0; i < b_b_cnt; i++) _XmUnoptSegRendBegins(a)[(a_b_cnt + i)] = _XmEntryRendBeginGet(b, i); _XmEntryRendBeginCountSet(a, (a_b_cnt + b_b_cnt)); } /* * general external TCS utilties */ static Boolean IsUnopt(_XmString str, int lines) { _XmStringEntry line; if (lines > 0) { line = _XmStrEntry(str)[0]; if ((_XmEntrySegmentCountGet(line) > 0) && (_XmEntryType(_XmEntrySegmentGet(line)[0]) != XmSTRING_ENTRY_OPTIMIZED)) return True; } return False; } static _XmStringEntry Unoptimize(_XmStringEntry entry, int free) { _XmStringEntry new_entry = NULL; _XmStringNREntry tmp_seg; int j; if (entry == NULL) return NULL; if (_XmEntryType(entry) == XmSTRING_ENTRY_OPTIMIZED) { new_entry = EntryCvtToUnopt(entry); if (free) _XmStringEntryFree(entry); } else if (_XmEntryMultiple(entry)) { if (free) { for (j = 0; j < _XmEntrySegmentCount(entry); j++) { tmp_seg = _XmEntrySegment(entry)[j]; if (_XmEntryType(tmp_seg) == XmSTRING_ENTRY_OPTIMIZED) { _XmEntrySegment(entry)[j] = (_XmStringNREntry)EntryCvtToUnopt((_XmStringEntry)tmp_seg); _XmStringEntryFree((_XmStringEntry)tmp_seg); } } new_entry = entry; } else { _XmEntryCreate(new_entry, XmSTRING_ENTRY_ARRAY); _XmEntrySegmentCount(new_entry) = _XmEntrySegmentCount(entry); _XmEntrySoftNewlineSet(new_entry, _XmEntrySoftNewlineGet(entry)); _XmEntrySegment(new_entry) = (_XmStringNREntry *)XtMalloc(_XmEntrySegmentCount(entry) * sizeof(_XmStringNREntry)); for (j = 0; j < _XmEntrySegmentCount(entry); j++) { tmp_seg = _XmEntrySegment(entry)[j]; if (_XmEntryType(tmp_seg) == XmSTRING_ENTRY_OPTIMIZED) _XmEntrySegment(new_entry)[j] = (_XmStringNREntry)EntryCvtToUnopt((_XmStringEntry)tmp_seg); else _XmEntrySegment(new_entry)[j] = (_XmStringNREntry)_XmStringEntryCopy((_XmStringEntry)tmp_seg); } } } else { if (free) new_entry = entry; else new_entry = _XmStringEntryCopy(entry); } return new_entry; } XmString XmStringConcat(XmString a, XmString b ) { return XmStringConcatAndFree (XmStringCopy(a), XmStringCopy(b)); } XmString XmStringConcatAndFree(XmString a, XmString b) { _XmString opt_str; unsigned int a_len, b_len, a_lc, b_lc, a_sc, b_sc, lc; unsigned int a_index, b_index, a_rend_index, b_rend_index; unsigned int a_tabs, b_tabs; XmTextType a_type, b_type; XmString a_str, b_str; _XmStringMultiRec b_tmp; _XmStringEntry a_line, b_line, tmp_line, *segs=NULL; _XmStringNREntry a_last, b_seg = NULL, tmp_seg; String a_tag; String b_tag; int i, j; int merged = 0; XmStringDirection last = XmSTRING_DIRECTION_UNSET; Boolean modify_a, modify_b, free_b; Boolean a_needs_unopt=False, b_needs_unopt=False; _XmStringArraySegRec array_seg; _XmProcessLock(); if (a == NULL) { _XmProcessUnlock(); return b; } if (b == NULL) { _XmProcessUnlock(); return a; } if ((_XmStrOptimized(a) && _XmStrOptimized(b))) { /* Both optimized */ a_len = _XmStrByteCount(a); b_len = _XmStrByteCount(b); a_index = _XmStrTagIndex(a); b_index = _XmStrTagIndex(b); a_rend_index = _XmStrRendIndex(a); b_rend_index = _XmStrRendIndex(b); a_type = (XmTextType) _XmStrTextType(a); b_type = (XmTextType) _XmStrTextType(b); a_tabs = _XmStrTabs(a); b_tabs = _XmStrTabs(b); if (((a_index == b_index) || (a_index == TAG_INDEX_UNSET) || (b_index == TAG_INDEX_UNSET)) && RenditionsCompatible((_XmStringEntry)a, (_XmStringEntry)b) && ((_XmStrDirection(a) == _XmStrDirection(b)) || (_XmStrDirection(b) == XmSTRING_DIRECTION_UNSET) || ((_XmStrDirection(a) == XmSTRING_DIRECTION_UNSET) && (a_len == 0))) && (a_type == b_type || a_type == XmNO_TEXT || b_type == XmNO_TEXT) && ((a_len + b_len) < (1 << BYTE_COUNT_BITS)) && ((_XmStrText(a) && b_tabs==0) || (!_XmStrText(a) && a_tabs+b_tabs <= 3))) { /* Compatible strings. Make an optimized string. */ if ((b_len == 0) && (_XmStrRefCountGet(a) == 1)) opt_str = (_XmString) a; else if ((a_len == 0) && (_XmStrRefCountGet(b) == 1)) opt_str = (_XmString) b; else _XmStrCreate(opt_str, XmSTRING_OPTIMIZED, a_len + b_len); _XmStrByteCount((_XmString)opt_str) = a_len + b_len; _XmStrTextType((_XmString)opt_str) = (a_type == XmNO_TEXT) ? b_type : a_type; _XmStrTagIndex((_XmString)opt_str) = (a_index == TAG_INDEX_UNSET) ? b_index : a_index; _XmStrRendIndex((_XmString)opt_str) = (a_rend_index == REND_INDEX_UNSET) ? b_rend_index : a_rend_index; /* Push begin and end state. */ _XmStrRendBegin((_XmString)opt_str) = (_XmStrRendBegin(a) ? _XmStrRendBegin(a) : _XmStrRendBegin(b)); _XmStrRendEnd((_XmString)opt_str) = (_XmStrRendEnd(b) ? _XmStrRendEnd(b) : _XmStrRendEnd(a)); _XmStrDirection((_XmString)opt_str) = (_XmStrDirection(a) == XmSTRING_DIRECTION_UNSET) ? _XmStrDirection(b) : _XmStrDirection(a); _XmStrTabs((_XmString)opt_str) = a_tabs+b_tabs; if (a_len && (opt_str != a)) memcpy(_XmStrText((_XmString)opt_str), _XmStrText(a), a_len); if (b_len && (opt_str != b)) memcpy((_XmStrText((_XmString)opt_str) + a_len), _XmStrText(b), b_len); if (opt_str != a) XmStringFree(a); if (opt_str != b) XmStringFree(b); _XmProcessUnlock(); return (XmString)opt_str; } } /* Concatenate non-optimized versions */ a_lc = _XmStrEntryCountGet(a); b_lc = _XmStrEntryCountGet(b); if (_XmStrAddNewline(a)) { if (_XmStrAddNewline(b) && b_lc > 0) lc = a_lc + b_lc - 1; else lc = a_lc; } else { if (_XmStrAddNewline(b)) lc = b_lc ? b_lc : 1; else lc = a_lc + b_lc; } modify_a = !_XmStrOptimized(a) && (_XmStrRefCountGet(a) == 1); if (modify_a) { a_str = a; if (a_lc > 1 && !_XmStrAddNewline(a) && _XmStrAddNewline(b)) { segs = _XmStrEntry(a_str); _XmStrEntry(a_str) = NULL; } _XmStrEntry(a_str) = (_XmStringEntry *) XtRealloc((char*) _XmStrEntry(a_str), sizeof(_XmStringEntry) * lc); for (i = (segs ? 0 : a_lc); i < lc; i++) _XmStrEntry(a_str)[i] = NULL; } else if (_XmStrOptimized(a)) { a_str = _XmStringOptToNonOpt((_XmStringOpt)a); if (a_lc > 1 && !_XmStrAddNewline(a) && _XmStrAddNewline(b)) { segs = _XmStrEntry(a_str); _XmStrEntry(a_str) = NULL; } _XmStrEntry(a_str) = (_XmStringEntry *) XtRealloc((char*) _XmStrEntry(a_str), sizeof(_XmStringEntry) * lc); for (i = (segs ? 0 : a_lc); i < lc; i++) _XmStrEntry(a_str)[i] = NULL; } else { if (a_lc > 1 && !_XmStrAddNewline(a) && _XmStrAddNewline(b)) { segs = _XmStrEntry(a); _XmStrEntry(a) = NULL; _XmStrEntryCount(a) = 0; } a_str = Clone(a, lc); if (a_lc > 1 && !_XmStrAddNewline(a) && _XmStrAddNewline(b)) { _XmStrEntry(a) = segs; _XmStrEntryCount(a) = a_lc; if (segs) { segs = (_XmStringEntry *)XtMalloc(a_lc * sizeof(_XmStringEntry)); for (i = 0; i < a_lc; i++) segs[i] = _XmStringEntryCopy(_XmStrEntry(a)[i]); } } } if (segs) { /* need to move a:s segments down one level */ _XmStringEntry line; _XmEntryCreate(line, XmSTRING_ENTRY_ARRAY); _XmEntrySegmentCount(line) = a_lc; _XmEntrySegment(line) = (_XmStringNREntry *)segs; _XmStrEntry(a_str)[0] = line; _XmStrImplicitLine(a_str) = True; a_lc = 1; } modify_b = !_XmStrOptimized(b) && (_XmStrRefCountGet(b) == 1); free_b = True; if (modify_b) b_str = b; else if (_XmStrOptimized(b)) { #ifndef _XmDEBUG_XMSTRING_MEM /* This won't work in that case - _XmStrMalloc adds bytes at the beginning */ if (_XmStrRefCountGet(b) == 1) { /* * An optimized XmString looks very much like an * optimized segment. In this case we can use the * optimized XmString as the segment with a little * of poking around in the last byte of the header. * This saves us from allocating a new string, which * will get free:d anyway. */ b_str = (XmString)&b_tmp; _XmStrInit(b_str, XmSTRING_MULTIPLE_ENTRY); _XmStrEntryCount(b_str) = 1; _XmStrRefCountSet(b, 0); _XmEntryTabsSet(b, _XmStrTabs(b)); _XmEntryImm(b) = 1; if (_XmStrText(b) != (char *)_XmEntryTextGet((_XmStringEntry)b)) { /* If the XtPointer in the union in the * optimized segment leads to padding in the structure * between the header and the text data * (it will on some 64-bit architectures) we have * to move the text data, since the optimized * string does not have this padding. */ unsigned int size = sizeof(_XmStringOptSegRec); if (_XmStrByteCount(b) > sizeof(XtPointer)) size += _XmStrByteCount(b) - sizeof(XtPointer); b = (XmString)XtRealloc((char *)b, size); memmove(_XmEntryTextGet((_XmStringEntry)b), _XmStrText(b), _XmStrByteCount(b)); } _XmStrEntry(b_str) = (_XmStringEntry *)&b; free_b = False; } else { #endif b_str = _XmStringOptToNonOpt((_XmStringOpt)b); XmStringFree(b); #ifndef _XmDEBUG_XMSTRING_MEM } #endif modify_b = TRUE; } else b_str = b; assert((a != b) || (!modify_a && !modify_b)); /* convert a to unopt segs if necessary */ a_needs_unopt = IsUnopt(a_str, a_lc); if (!a_needs_unopt) { b_needs_unopt = IsUnopt(b_str, _XmStrEntryCount(b_str)); if (b_needs_unopt) for (i = 0; i < a_lc; i++) _XmStrEntry(a_str)[i] = Unoptimize(_XmStrEntry(a_str)[i], True); } _XmStrEntryCount(a_str) = lc; _XmStrImplicitLine(a_str) = _XmStrImplicitLine(a_str) || _XmStrImplicitLine(b_str); /* Add first line of b_str to last line of a_str */ a_line = _XmStrEntry(a_str)[a_lc - 1]; if (_XmStrImplicitLine(b_str)) { b_line = _XmStrEntry(b_str)[0]; } else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(b_str); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(b_str); b_line = (_XmStringEntry)&array_seg; b_lc = 1; } a_sc = _XmEntrySegmentCountGet(a_line); b_sc = _XmEntrySegmentCountGet(b_line); if ((a_sc != 0) && (b_sc != 0)) { /* Need to combine last segment of a with first of b if compatible. */ a_last = _XmEntrySegmentGet(a_line)[a_sc - 1]; b_seg = _XmEntrySegmentGet(b_line)[0]; a_len = _XmEntryByteCountGet((_XmStringEntry)a_last); b_len = _XmEntryByteCountGet((_XmStringEntry)b_seg); /* Remember last direction set. */ last = _XmEntryDirectionGet((_XmStringEntry)a_last); a_tag = _XmEntryTag((_XmStringEntry)a_last); b_tag = _XmEntryTag((_XmStringEntry)b_seg); a_type = (XmTextType) _XmEntryTextTypeGet((_XmStringEntry)a_last); b_type = (XmTextType) _XmEntryTextTypeGet((_XmStringEntry)b_seg); a_tabs = _XmEntryTabsGet((_XmStringEntry)a_last); b_tabs = _XmEntryTabsGet((_XmStringEntry)b_seg); merged = 0; if (((a_tag == b_tag) || (a_tag == NULL) || (b_tag == NULL)) && RenditionsCompatible((_XmStringEntry)a_last, (_XmStringEntry)b_seg) && (a_type == b_type || a_type == XmNO_TEXT || b_type == XmNO_TEXT) && ((last == _XmEntryDirectionGet((_XmStringEntry)b_seg)) || (_XmEntryDirectionGet((_XmStringEntry)b_seg) == XmSTRING_DIRECTION_UNSET) || ((last == XmSTRING_DIRECTION_UNSET) && (a_len == 0))) && !_XmEntryPopGet((_XmStringEntry)a_last) && !_XmEntryPushGet((_XmStringEntry)b_seg) && (((a_len != 0) && b_tabs==0) || ((a_len == 0) && a_tabs+b_tabs <= 7))) { if (b_len) { if ((_XmEntryType(a_last) == XmSTRING_ENTRY_OPTIMIZED) && _XmEntryImm(a_last)) { unsigned int size = sizeof(_XmStringOptSegRec); if (a_len + b_len > sizeof(XtPointer)) size += a_len + b_len - sizeof(XtPointer); if (a_line == (_XmStringEntry)a_last) { a_last = (_XmStringNREntry)XtRealloc((char *)a_last, size); _XmStrEntry(a_str)[a_lc - 1] = a_line = (_XmStringEntry)a_last; } else _XmEntrySegmentGet(a_line)[a_sc-1] = a_last = (_XmStringNREntry)XtRealloc((char *)a_last, size); } else { _XmEntryTextSet((_XmStringEntry)a_last, XtRealloc((char *) _XmEntryTextGet((_XmStringEntry)a_last), a_len + b_len)); } } if (_XmEntryOptimized(a_last)) _XmEntryTagIndex(a_last) = ((a_tag == NULL) ? (b_tag == NULL ? TAG_INDEX_UNSET : _XmStringIndexCacheTag(b_tag, XmSTRING_TAG_STRLEN)) : _XmEntryTagIndex(a_last)); else _XmUnoptSegTag(a_last) = (a_tag == NULL) ? b_tag : a_tag; /* Fixup rendition begins and ends */ if (a_len == 0) MergeBegins((_XmStringEntry)a_last, (_XmStringEntry)b_seg); if (_XmEntryRendEnds((_XmStringEntry)a_last) == NULL) { if (_XmEntryOptimized(a_last) && _XmEntryRendEndCountGet((_XmStringEntry)b_seg) > 0) { b_tag = _XmEntryRendEndGet((_XmStringEntry)b_seg, 0); _XmEntryRendIndex(a_last) = _XmStringIndexCacheTag(b_tag, XmSTRING_TAG_STRLEN); } if (!_XmEntryOptimized(a_last) && (_XmEntryRendEndCountGet((_XmStringEntry)b_seg) != 0)) { if (_XmEntryOptimized(b_seg)) { _XmUnoptSegRendEnds(a_last) = (XmStringTag *)XtMalloc(sizeof(XmStringTag)); _XmUnoptSegRendEnds(a_last)[0] = _XmEntryRendEndGet((_XmStringEntry)b_seg, 0); } else if (modify_b) { _XmUnoptSegRendEnds(a_last) = _XmUnoptSegRendEnds(b_seg); } else { int end_count = _XmEntryRendEndCountGet((_XmStringEntry)b_seg); int k; _XmUnoptSegRendEnds(a_last) = (XmStringTag *)XtMalloc(end_count * sizeof(XmStringTag)); for (k = 0; k < end_count; k++) _XmUnoptSegRendEnds(a_last)[k] = _XmUnoptSegRendEnds(b_seg)[k]; } } _XmEntryRendEndCountSet (a_last, _XmEntryRendEndCountGet((_XmStringEntry)b_seg)); } else MergeEnds((_XmStringEntry)a_last, (_XmStringEntry)b_seg); _XmEntryTextTypeSet(a_last, (a_type == XmNO_TEXT) ? b_type : a_type); memcpy(((char *)_XmEntryTextGet((_XmStringEntry)a_last)) + a_len, _XmEntryTextGet((_XmStringEntry)b_seg), b_len); _XmEntryByteCountSet(a_last, a_len + b_len); _XmEntryTabsSet(a_last, a_tabs+b_tabs); if (last == XmSTRING_DIRECTION_UNSET) _XmEntryDirectionSet((_XmStringEntry)a_last, _XmEntryDirectionGet((_XmStringEntry)b_seg)); _XmEntryPopSet(a_last, _XmEntryPopGet((_XmStringEntry)b_seg)); if (modify_b) { /* Free leftover bits of b_seg */ if (_XmEntryUnoptimized(b_seg)) { if (_XmEntryOptimized(a_last) || (_XmUnoptSegRendBegins(a_last) != _XmUnoptSegRendBegins(b_seg))) XtFree((char *)_XmUnoptSegRendBegins(b_seg)); if (_XmEntryOptimized(a_last) || (_XmUnoptSegRendEnds(a_last) != _XmUnoptSegRendEnds(b_seg))) XtFree((char *)_XmUnoptSegRendEnds(b_seg)); } if ( ! ((_XmEntryType(b_seg) == XmSTRING_ENTRY_OPTIMIZED) && _XmEntryImm(b_seg))) XtFree((char*)_XmEntryTextGet((_XmStringEntry)b_seg)); XtFree((char *)b_seg); } merged = 1; } } else /* Need to figure out last direction set. */ { for (i = a_lc; i > 0; i--) { tmp_line = _XmStrEntry(a_str)[i - 1]; for (j = _XmEntrySegmentCountGet(tmp_line); j > 0; j--) { tmp_seg = _XmEntrySegmentGet(tmp_line)[j - 1]; if (_XmEntryDirectionGet((_XmStringEntry)tmp_seg) != XmSTRING_DIRECTION_UNSET) { last = _XmEntryDirectionGet((_XmStringEntry)tmp_seg); break; } } if (last != XmSTRING_DIRECTION_UNSET) break; } } if (merged && !_XmStrImplicitLine(a_str)) _XmStrEntryCount(a_str)--; if (b_sc - merged > 0 && _XmStrImplicitLine(a_str)) { Boolean free_b_line = (modify_b && _XmEntryMultiple(b_line) && ((_XmStringEntry)b_seg != b_line)); if (_XmEntryMultiple(a_line)) { _XmEntrySegment(a_line) = (_XmStringNREntry *)XtRealloc((char *)_XmEntrySegment(a_line), sizeof(_XmStringNREntry) * (a_sc + b_sc - merged)); _XmEntrySegmentCount(a_line) = a_sc + b_sc - merged; } else { _XmEntryCreate(a_line, XmSTRING_ENTRY_ARRAY); _XmEntrySegmentCount(a_line) = a_sc + b_sc - merged; _XmEntrySegment(a_line) = (_XmStringNREntry *)XtMalloc(sizeof(_XmStringNREntry) * (a_sc + b_sc - merged)); _XmEntrySegment(a_line)[0] = (_XmStringNREntry)_XmStrEntry(a_str)[a_lc - 1]; _XmStrEntry(a_str)[a_lc - 1] = a_line; _XmStrImplicitLine(a_str) = True; } for (i = 0; i < (b_sc - merged); i++) { b_seg = _XmEntrySegmentGet(b_line)[i + merged]; if (a_needs_unopt && !b_needs_unopt) b_seg = (_XmStringNREntry)Unoptimize((_XmStringEntry)b_seg,modify_b); else if (!modify_b) b_seg = (_XmStringNREntry)_XmStringEntryCopy((_XmStringEntry)b_seg); if (_XmEntryDirectionGet((_XmStringEntry)b_seg) == XmSTRING_DIRECTION_UNSET) _XmEntryDirectionSet((_XmStringEntry)b_seg, last); else last = _XmEntryDirectionGet((_XmStringEntry)b_seg); _XmEntrySegment(a_line)[i + a_sc] = b_seg; } if (free_b_line) { if (_XmEntrySegment(b_line) != (_XmStringNREntry *)&b && _XmEntrySegment(b_line) != (_XmStringNREntry *)_XmStrEntry(b_str)) XtFree((char *)_XmEntrySegment(b_line)); if (b_line != (_XmStringEntry)&array_seg) XtFree((char *)b_line); } } else if (b_sc - merged > 0 && !_XmStrImplicitLine(a_str)) { for (i = 0; i < (b_sc - merged); i++) { b_line = _XmStrEntry(b_str)[i + merged]; if (a_needs_unopt && !b_needs_unopt) _XmStrEntry(a_str)[a_lc] = Unoptimize(b_line, modify_b); else if (modify_b) _XmStrEntry(a_str)[a_lc] = b_line; else _XmStrEntry(a_str)[a_lc] = _XmStringEntryCopy(b_line); a_lc++; } } /* Add rest of b's lines to a */ for (i = 0; i < (b_lc - 1); i++) { b_line = _XmStrEntry(b_str)[i + 1]; if (a_needs_unopt && !b_needs_unopt) b_line = Unoptimize(b_line, modify_b); else if (!modify_b) b_line = _XmStringEntryCopy(b_line); b_sc = _XmEntrySegmentCountGet(b_line); for (j = 0; j < b_sc; j++) { b_seg = _XmEntrySegmentGet(b_line)[j]; if (_XmEntryDirectionGet((_XmStringEntry)b_seg) == XmSTRING_DIRECTION_UNSET) _XmEntryDirectionSet((_XmStringEntry)b_seg, last); else break; } _XmStrEntry(a_str)[i + a_lc] = b_line; } if (modify_b && free_b) { /* Free leftover bits of b_str. */ XtFree((char *)_XmStrEntry(b_str)); _XmStrFree ((char *)b_str); } /* Set layout cache dirty */ if (a_str && _XmStrEntryCount(a_str) > 0 ) { tmp_line = _XmStrEntry(a_str)[0]; if (tmp_line && _XmEntrySegmentCountGet(tmp_line) > 0) { _XmStringCache cache; tmp_seg = _XmEntrySegmentGet(tmp_line)[0]; for (cache = _XmStringCacheGet(_XmEntryCacheGet((_XmStringEntry)tmp_seg), _XmSCANNING_CACHE); cache; cache = _XmStringCacheGet(cache->next, _XmSCANNING_CACHE)) _XmCacheDirty(cache) = True; } } if (!modify_a) XmStringFree(a); if (!modify_b) XmStringFree(b); _XmProcessUnlock(); return (XmString)a_str; } /************************************************************************ * * * XmStringCompare - compare two strings. * * * * Returns TRUE if the strings are equal, FALSE o.w. * * * ************************************************************************/ Boolean XmStringCompare( XmString a, XmString b ) { _XmProcessLock(); if ((a == NULL) && (b == NULL)) { _XmProcessUnlock(); return TRUE; } if ((a == NULL) || (b == NULL)) { _XmProcessUnlock(); return FALSE; } if (_XmStrOptimized(a) && _XmStrOptimized(b)) { if (!((_XmStrTagGet(a) == _XmStrTagGet(b)) || (_XmStrTagGet(a) == NULL) || (_XmStrTagGet(b) == NULL) || ((strcmp(_XmStringIndexGetTag(_XmStrTagIndex(a)), XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(_XmStrTagGet(b))) || ((strcmp(_XmStringIndexGetTag(_XmStrTagIndex(b)), XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(_XmStrTagGet(a))))) { _XmProcessUnlock(); return (FALSE); } if (_XmStrByteCount(a) != _XmStrByteCount(b)) { _XmProcessUnlock(); return (FALSE); } if ((_XmStrDirection(a) != _XmStrDirection(b)) && (((_XmStrDirection(a) == XmSTRING_DIRECTION_UNSET) && (_XmStrDirection(b) != XmSTRING_DIRECTION_L_TO_R)) || ((_XmStrDirection(b) == XmSTRING_DIRECTION_UNSET) && (_XmStrDirection(a) != XmSTRING_DIRECTION_L_TO_R)))) { _XmProcessUnlock(); return (FALSE); } if (strncmp(_XmStrText(a), _XmStrText(b), _XmStrByteCount(a)) != 0) { _XmProcessUnlock(); return (FALSE); } } else { int i, j; _XmStringEntry *entry_a; _XmStringEntry *entry_b; XmString a_unopt = NULL; XmString b_unopt = NULL; if (_XmStrEntryCountGet(a) != _XmStrEntryCountGet(b)) { _XmProcessUnlock(); return (FALSE); } if (_XmStrOptimized(a)) { a_unopt = _XmStringOptToNonOpt((_XmStringOpt)a); entry_a = _XmStrEntry(a_unopt); } else { entry_a = _XmStrEntry(a); } if (_XmStrOptimized(b)) { b_unopt = _XmStringOptToNonOpt((_XmStringOpt)b); entry_b = _XmStrEntry(b_unopt); } else { entry_b = _XmStrEntry(b); } for (i = 0; i < _XmStrEntryCountGet(a); i++) { if (_XmEntryMultiple(entry_a[i]) && _XmEntryMultiple(entry_b[i])) { if (_XmEntrySegmentCount(entry_a[i]) != _XmEntrySegmentCount(entry_b[i])) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } for (j=0; j<_XmEntrySegmentCount(entry_a[i]); j++) { _XmStringNREntry a_seg = _XmEntrySegment(entry_a[i])[j]; _XmStringNREntry b_seg = _XmEntrySegment(entry_b[i])[j]; unsigned int len; XmStringTag a_tag = _XmEntryTag((_XmStringEntry)a_seg); XmStringTag b_tag = _XmEntryTag((_XmStringEntry)b_seg); if (!((a_tag == b_tag) || (a_tag == NULL) || (b_tag == NULL) || ((strcmp(a_tag, XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(b_tag)) || ((strcmp(b_tag, XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(a_tag)))) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } len = _XmEntryByteCountGet((_XmStringEntry)a_seg); if (len != _XmEntryByteCountGet((_XmStringEntry)b_seg)) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } { unsigned int a_dir = _XmEntryDirectionGet((_XmStringEntry)a_seg); unsigned int b_dir = _XmEntryDirectionGet((_XmStringEntry)b_seg); if ((a_dir != b_dir) && (((a_dir == XmSTRING_DIRECTION_UNSET) && (b_dir != XmSTRING_DIRECTION_L_TO_R)) || ((b_dir == XmSTRING_DIRECTION_UNSET) && (a_dir != XmSTRING_DIRECTION_L_TO_R)))) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } } if (strncmp ((char*)_XmEntryTextGet((_XmStringEntry)a_seg), (char*)_XmEntryTextGet((_XmStringEntry)b_seg), len) != 0) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } } } else if (!_XmEntryMultiple(entry_a[i]) && !_XmEntryMultiple(entry_b[i])) { unsigned int len; if (!((_XmEntryTag(entry_a[i]) == _XmEntryTag(entry_b[i])) || (_XmEntryTag(entry_a[i]) == NULL) || (_XmEntryTag(entry_b[i]) == NULL) || ((strcmp(_XmEntryTag(entry_a[i]), XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(_XmEntryTag(entry_b[i]))) || ((strcmp(_XmEntryTag(entry_b[i]), XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(_XmEntryTag(entry_a[i]))))) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } len = _XmEntryByteCountGet(entry_a[i]); if (len != _XmEntryByteCountGet(entry_b[i])) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } if ((_XmEntryDirectionGet(entry_a[i]) != _XmEntryDirectionGet(entry_b[i])) && (((_XmEntryDirectionGet(entry_a[i]) == XmSTRING_DIRECTION_UNSET) && (_XmEntryDirectionGet(entry_b[i]) != XmSTRING_DIRECTION_L_TO_R)) || ((_XmEntryDirectionGet(entry_b[i]) == XmSTRING_DIRECTION_UNSET) && (_XmEntryDirectionGet(entry_a[i]) != XmSTRING_DIRECTION_L_TO_R)))) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } if (strncmp ((char*) _XmEntryTextGet(entry_a[i]), (char*) _XmEntryTextGet(entry_b[i]), len) != 0) { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } } else { if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); _XmProcessUnlock(); return (FALSE); } } if (a_unopt) XmStringFree(a_unopt); if (b_unopt) XmStringFree(b_unopt); } _XmProcessUnlock(); return (TRUE); } int XmStringLength( XmString string ) { unsigned int len; if (!string) return (0); if (!XmeStringIsValid(string)) return (0); len = XmCvtXmStringToByteStream(string, NULL); return((int)len); } /************************************************************************ * * * XmeStringIsXmString - returns TRUE if the parameter is an XmString. * * * ************************************************************************/ Boolean XmeStringIsValid( XmString string ) { if (string == NULL) return(FALSE); return(TRUE); } /* * determines from ASN.1 header whether this is an ASN.1 conformant * external compound string. Returns T or F. */ static Boolean _is_asn1( unsigned char *string ) { unsigned char *uchar_p = string; /* Compare the ASN.1 header. */ return (strncmp ((char *)uchar_p, (char *)ASNHeader, ASNHEADERLEN) == 0); } /* * optimized internal TCS structure handling routines */ /* * find the ascender for the given optimized line */ static Dimension OptLineAscender( XmRenderTable f, _XmStringOpt opt ) { Dimension width, height, ascent, descent; OptLineMetrics(f, (_XmString)opt, NULL, NULL, &width, &height, &ascent, &descent); return(ascent); } int _XmConvertFactor(unsigned char units, float *factor) { switch (units) { case XmINCHES: *factor = 1000.0; return(Xm1000TH_INCHES); case XmCENTIMETERS: *factor = 1000.0; return(Xm100TH_MILLIMETERS); case XmMILLIMETERS: *factor = 100.0; return(Xm100TH_MILLIMETERS); case XmPOINTS: *factor = 100.0; return(Xm100TH_POINTS); case XmFONT_UNITS: *factor = 100.0; return(Xm100TH_FONT_UNITS); default: *factor = 1.0; return(units); } } static int TabVal(Display *d, Screen **pscreen, Window w, XmTab tab) { int fromType; int intValue; float multiplier, convertValue; fromType = _XmConvertFactor(_XmTabUnits(tab), &multiplier); convertValue = multiplier * _XmTabValue(tab); /* error */ if (((convertValue < 0.0) ? -convertValue : convertValue) > (float)INT_MAX) return(0); convertValue += (convertValue > 0.0) ? 0.5 : -0.5; intValue = convertValue; /* * The pscreen storage should be pushed higher; we may still make * several round trips to the server to draw a single string??? */ /* All we really want is the screen, but we may only have a drawable. */ assert(w || *pscreen); if (*pscreen == NULL) { Widget widget = XtWindowToWidget(d, w); /* If this drawable is really a widget Xt will have cached it. */ if (widget) *pscreen = XtScreenOfObject(widget); else { /* Give up and ask the server. */ XWindowAttributes attr; XGetWindowAttributes(d, w, &attr); *pscreen = attr.screen; } } return _XmConvertUnits(*pscreen, XmHORIZONTAL, fromType, intValue, XmPIXELS); } /* * Find width, height, ascent and descent for the given optimized line. */ static void OptLineMetrics(XmRenderTable r, _XmString opt, XmRendition *rend_io, XmRendition base_rend, Dimension *width, Dimension *height, Dimension *ascent, Dimension *descent) { short rend_index; XmRendition rend = NULL; XmStringTag tags[1]; Display *d; Screen *screen; int prev_val, val, i, ref_cnt, rt_ref_cnt; XmTabList tl = NULL; XmTab tab; unsigned short tab_cnt; Dimension tab_w = 0; _XmRendition rend_int; /* compute rendition */ /* Find font as per I 198. */ /* 1. Find font from rendition tags. */ /* 2. Find font from locale/charset tag. */ if (base_rend == NULL) { if (_XmStrRendBegin(opt)) rend = _XmRenderTableFindRendition(r, _XmStrRendTagGet(opt), TRUE, FALSE, TRUE, &rend_index); if ((rend == NULL) || (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL)) rend = _XmRenderTableFindRendition(r, _XmStrTagGet(opt), TRUE, FALSE, TRUE, &rend_index); } else { if (_XmStrRendBegin(opt)) { tags[0] = _XmStrRendTagGet(opt); rend = _XmRenditionMerge(_XmRendDisplay(base_rend), rend_io, base_rend, r, _XmStrTagGet(opt), tags, 1, FALSE); } else { rend = _XmRenditionMerge(_XmRendDisplay(base_rend), rend_io, base_rend, r, _XmStrTagGet(opt), NULL, 0, FALSE); } } /* 3. Default rendition. */ if ((rend == NULL) || (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL)) { tags[0] = ((_XmStrTextType(opt) == XmCHARSET_TEXT) ? XmFONTLIST_DEFAULT_TAG : _MOTIF_DEFAULT_LOCALE); rend = _XmRenderTableFindRendition(r, tags[0], TRUE, FALSE, FALSE, NULL); if ((rend != NULL) && (_XmRendFont(rend) == NULL) && (_XmRendXftFont(rend) == NULL) && (((base_rend != NULL) && (_XmRendDisplay(base_rend) != NULL)) || (_XmRendDisplay(rend) != NULL))) /* Call noFontCallback. */ { XmDisplay dsp; XmDisplayCallbackStruct cb; rt_ref_cnt = _XmRTRefcount(r); rend = _XmRTRenditions(r)[0]; rend_int = *rend; ref_cnt = _XmRendRefcount(rend); if ((base_rend != NULL) && (_XmRendDisplay(base_rend) != NULL)) dsp = (XmDisplay)XmGetXmDisplay(_XmRendDisplay(base_rend)); else dsp = (XmDisplay)XmGetXmDisplay(_XmRendDisplay(rend)); cb.reason = XmCR_NO_FONT; cb.event = NULL; cb.rendition = rend; cb.font_name = XmS; XtCallCallbackList((Widget)dsp, dsp->display.noFontCallback, &cb); if (rend_int != *rend) /* Changed in callback. */ { /* Need to split ref counts. */ _XmRendRefcount(&rend_int) = ref_cnt - rt_ref_cnt; _XmRendRefcount(rend) = rt_ref_cnt; } if (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL) rend = NULL; } /* 4a. Take the first one */ if ((rend == NULL) && ((_XmStrTextType(opt) == XmCHARSET_TEXT) || ((_XmStrTextType(opt) == XmMULTIBYTE_TEXT) && (_XmStrTagGet(opt) == XmFONTLIST_DEFAULT_TAG))) && (r != NULL) && (_XmRTCount(r) > 0)) _XmRenderTableFindFirstFont(r, &rend_index, &rend); if ((rend != NULL) && (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL) && (((base_rend != NULL) && (_XmRendDisplay(base_rend) != NULL)) || (_XmRendDisplay(rend) != NULL))) /* Call noFontCallback. */ { XmDisplay dsp; XmDisplayCallbackStruct cb; rt_ref_cnt = _XmRTRefcount(r); rend = _XmRTRenditions(r)[0]; rend_int = *rend; ref_cnt = _XmRendRefcount(rend); if ((base_rend != NULL) && (_XmRendDisplay(base_rend) != NULL)) dsp = (XmDisplay)XmGetXmDisplay(_XmRendDisplay(base_rend)); else dsp = (XmDisplay)XmGetXmDisplay(_XmRendDisplay(rend)); cb.reason = XmCR_NO_FONT; cb.event = NULL; cb.rendition = rend; cb.font_name = XmS; XtCallCallbackList((Widget)dsp, dsp->display.noFontCallback, &cb); if (rend_int != *rend) /* Changed in callback. */ { /* Need to split ref counts. */ _XmRendRefcount(&rend_int) = ref_cnt - rt_ref_cnt; _XmRendRefcount(rend) = rt_ref_cnt; } if (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL) rend = NULL; } /* 4b/5a. Emit warning and don't render. */ if ((rend == NULL) || (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL)) { /* Don't emit warning if no tags, e.g. just a dir component. */ if (_XmStrRendBegin(opt) || (_XmStrTagGet(opt) != NULL)) XmeWarning(NULL, NO_FONT_MSG); if ((base_rend != NULL) && (rend_io == NULL)) XmRenditionFree(rend); rend = NULL; return; } else if (rend_io != NULL) { _XmRendFont(*rend_io) = _XmRendFont(rend); #ifdef USE_XFT _XmRendXftFont(*rend_io) = _XmRendXftFont(rend); #endif _XmRendFontName(*rend_io) = _XmRendFontName(rend); _XmRendFontType(*rend_io) = _XmRendFontType(rend); } } /* Use the raster extent for a single line. */ if (rend != NULL) ComputeMetrics(rend, (XtPointer)_XmStrText(opt), _XmStrByteCount(opt), (XmTextType) _XmStrTextType(opt), XmSTRING_SINGLE_SEG, width, height, ascent, descent, #ifdef UTF8_SUPPORTED (_XmStrTextType(opt) == XmCHARSET_TEXT || _XmStrTextType(opt) == XmMULTIBYTE_TEXT) && ((_XmStrTagGet(opt) == XmFONTLIST_DEFAULT_TAG && _XmStringIsCurrentCharset("UTF-8")) || (_XmStrTagGet(opt) && strcmp(_XmStringIndexGetTag(_XmStrTagIndex(opt)), "UTF-8") == 0)) #else False #endif ); if (rend != NULL) tl = _XmRendTabs(rend); d = (_XmRTDisplay(r) == NULL) ? _XmGetDefaultDisplay() : _XmRTDisplay(r); screen = XtScreenOfObject(XmGetXmDisplay(d)); tab = ((tl == NULL) || ((long)tl == XmAS_IS)) ? NULL : _XmTabLStart(tl); prev_val = 0; tab_cnt = 0; /* If this string is tabbed, set width accordingly. */ if ((tab != NULL) && (_XmStrTabs(opt) != 0) && (tab_cnt < _XmTabLCount(tl))) { for (i = 0; (i < _XmStrTabs(opt)) && (tab_cnt < _XmTabLCount(tl)); tab = _XmTabNext(tab), tab_cnt++, i++) { val = TabVal(d, &screen, None, tab); if (_XmTabModel(tab) == XmABSOLUTE) { tab_w = val; prev_val = val; } else /* XmRELATIVE */ { tab_w = prev_val + val; prev_val += val; } } } (*width) += tab_w; if ((base_rend != NULL) && (rend_io == NULL)) XmRenditionFree(rend); } /* * internal TCS structure handling routines */ /* * find biggest ascender and descender and width and height in this line */ static void LineMetrics(_XmStringEntry line, XmRenderTable r, XmRendition *rend_io, XmRendition base, XmDirection prim_dir, Dimension *width, Dimension *height, Dimension *ascender, Dimension *descender) { int i, seg_index = 0; Dimension w, tab_w = 0, h, max_h = 0, asc, max_asc = 0, dsc, max_dsc = 0; Display *d; Screen *screen; int prev_val, val; XmTabList tl = NULL; XmTab tab; unsigned short tab_cnt; _XmStringNREntry seg, peek_seg; XmDirection lay_dir = 0; Boolean set_direction = FALSE; d = _XmRendDisplay(*rend_io); screen = XtScreenOfObject(XmGetXmDisplay(d)); seg = _XmEntrySegmentGet(line)[seg_index]; if (_XmEntryType(seg) != XmSTRING_ENTRY_OPTIMIZED) { lay_dir = _XmEntryLayoutGet(seg, prim_dir); if (XmDirectionMatch(lay_dir, XmLEFT_TO_RIGHT)) { while (_XmEntryLeftGet(seg, prim_dir) != NULL) seg = (_XmStringNREntry)_XmEntryLeftGet(seg, prim_dir); peek_seg = (_XmStringNREntry)_XmEntryRightGet(seg, prim_dir); } else { while (_XmEntryRightGet(seg, prim_dir) != NULL) seg = (_XmStringNREntry)_XmEntryRightGet(seg, prim_dir); peek_seg = (_XmStringNREntry)_XmEntryLeftGet(seg, prim_dir); } } else { peek_seg = ((seg_index + 1) < _XmEntrySegmentCountGet(line) ? _XmEntrySegmentGet(line)[seg_index + 1] : NULL); } if (_XmEntryDirectionGet((_XmStringEntry)seg) == XmSTRING_DIRECTION_UNSET) { _XmEntryDirectionSet((_XmStringEntry)seg, XmDirectionToStringDirection(prim_dir)); set_direction = True; } if (peek_seg != NULL) (void)SpecifiedSegmentExtents((_XmStringEntry)seg, r, rend_io, base, XmSTRING_FIRST_SEG, &w, &h, &asc, &dsc); else (void)SpecifiedSegmentExtents((_XmStringEntry)seg, r, rend_io, base, XmSTRING_SINGLE_SEG, &w, &h, &asc, &dsc); if (*rend_io != NULL) tl = _XmRendTabs(*rend_io); tab = ((tl == NULL) || ((long)tl == XmAS_IS)) ? NULL : _XmTabLStart(tl); prev_val = 0; tab_cnt = 0; while (seg != NULL) { /* If this segment is tabbed, set width accordingly. */ if ((tab != NULL) && (_XmEntryTabsGet((_XmStringEntry)seg) != 0) && (tab_cnt < _XmTabLCount(tl))) { for (i = 0; (i < _XmEntryTabsGet((_XmStringEntry)seg)) && (tab_cnt < _XmTabLCount(tl)); i++, tab = _XmTabNext(tab), tab_cnt++) { val = TabVal(d, &screen, None, tab); if (_XmTabModel(tab) == XmABSOLUTE) tab_w = MAX(tab_w, val); else /* XmRELATIVE */ tab_w = MAX(tab_w, prev_val + val); prev_val = tab_w; } } tab_w += w; if (h > max_h) max_h = h; if (asc > max_asc) max_asc = asc; if (dsc >max_dsc) max_dsc = dsc; if (set_direction) { _XmEntryDirectionSet((_XmStringEntry)seg, XmSTRING_DIRECTION_UNSET); set_direction = False; } if (_XmEntryType(seg) != XmSTRING_ENTRY_OPTIMIZED) { if (XmDirectionMatch(lay_dir, XmLEFT_TO_RIGHT)) { seg = (_XmStringNREntry)_XmEntryRightGet(seg, prim_dir); peek_seg = (_XmStringNREntry)_XmEntryRightGet(seg, prim_dir); } else { seg = (_XmStringNREntry)_XmEntryLeftGet(seg, prim_dir); peek_seg = (_XmStringNREntry)_XmEntryLeftGet(seg, prim_dir); } } else { seg_index++; seg = (seg_index < _XmEntrySegmentCountGet(line) ? _XmEntrySegmentGet(line)[seg_index] : NULL); peek_seg = ((seg_index + 1) < _XmEntrySegmentCountGet(line) ? _XmEntrySegmentGet(line)[seg_index + 1] : NULL); } if (seg != NULL) { if (_XmEntryDirectionGet((_XmStringEntry)seg) == XmSTRING_DIRECTION_UNSET) { _XmEntryDirectionSet((_XmStringEntry)seg, XmDirectionToStringDirection(prim_dir)); set_direction = True; } if (peek_seg != NULL) (void)SpecifiedSegmentExtents((_XmStringEntry)seg, r, rend_io, base, XmSTRING_MIDDLE_SEG, &w, &h, &asc, &dsc); else (void)SpecifiedSegmentExtents((_XmStringEntry)seg, r, rend_io, base, XmSTRING_LAST_SEG, &w, &h, &asc, &dsc); } } *width = tab_w; if (max_h > 0) *height = max_h; if (max_asc > 0) *ascender = max_asc; if (max_dsc > 0) *descender = max_dsc; } static XFontStruct * GetFont(XmRenderTable rt, _XmStringEntry entry) { XmRendition rend = NULL; short indx = -1; Cardinal n; Arg args[2]; XmFontType type; XtPointer font; rend = _XmEntryRenditionGet(entry, rt); if (rend == NULL) (void)_XmRenderTableFindFallback(rt, _XmEntryTag(entry), TRUE, &indx, &rend); if (rend != NULL) { n = 0; XtSetArg(args[n], XmNfontType, &type); n++; XtSetArg(args[n], XmNfont, &font); n++; XmRenditionRetrieve(rend, args, n); if (type == XmFONT_IS_FONT) return (XFontStruct *)font; else return (XFontStruct *)NULL; } return (XFontStruct *)NULL; } unsigned char _XmStringCharacterCount(XtPointer text, XmTextType text_type, int byte_count, XFontStruct *font) { if (text == NULL) return 0; if (byte_count == 0) byte_count = strlen((char *)text); switch (text_type) { case XmCHARSET_TEXT: { if (font && two_byte_font(font)) return (byte_count/2); else return byte_count; } case XmMULTIBYTE_TEXT: { char *s = (char *) text; if (MB_CUR_MAX == 1) return byte_count; else { int cnt = 0; int len; #ifndef NO_MULTIBYTE while (byte_count > 0 && (len = mblen(s, MB_CUR_MAX)) > 0) { cnt++; s += len; byte_count -= len; } #else while (byte_count > 0 && *s) { cnt++; s++; byte_count--; } #endif return cnt; } } case XmWIDECHAR_TEXT: { wchar_t *wcs = (wchar_t *)text; int cnt = 0; while (byte_count > 0 && wcs[cnt]) { cnt++; byte_count -= sizeof(wchar_t); } return cnt; } default: return byte_count; } } unsigned char _XmEntryCharCountGet(_XmStringEntry entry, XmRenderTable rt) { unsigned int len; if (_XmEntryOptimized(entry)) { if ((len = _XmEntryByteCountGet(entry)) == 0) { return 0; } else { return _XmStringCharacterCount((char *)_XmEntryTextGet(entry), (XmTextType) _XmEntryTextTypeGet(entry), len, GetFont(rt, entry)); } } if (_XmEntryUnoptimized(entry)) { if (((_XmStringUnoptSeg)entry)->char_count == 0 && (len = _XmEntryByteCountGet(entry)) != 0) { ((_XmStringUnoptSeg)entry)->char_count = _XmStringCharacterCount((char *)_XmEntryTextGet(entry), (XmTextType) _XmEntryTextTypeGet(entry), len, GetFont(rt, entry)); } return ((_XmStringUnoptSeg)entry)->char_count; } return(0); } _XmStringCache _XmStringCacheGet(_XmStringCache caches, int type) { _XmStringCache cache = caches; while (cache && cache->cache_type != type) cache = cache->next; return cache; } void _XmStringCacheFree(_XmStringCache caches) { _XmStringCache prev = NULL, current = caches; while (current) { prev = current; current = current->next; if (prev) { if (prev->cache_type == _XmRENDERING_CACHE && ((_XmStringRenderingCache)prev)->rendition != NULL) XmRenditionFree(((_XmStringRenderingCache)prev)->rendition); XtFree((char *)prev); } } } static _XmStringCache CacheGet(_XmStringEntry entry, int type, int create, XtPointer match_value) { _XmStringCache cache; if (!entry || !_XmEntryUnoptimized(entry)) return NULL; switch (type) { case _XmSCANNING_CACHE: { XmDirection d; d = (XmDirection)(long)match_value; if (d) { cache = _XmEntryCacheGet(entry); while (cache && !(cache->cache_type == type && (XmDirectionMatch(((_XmStringScanningCache)cache)->prim_dir, d)))) cache = cache->next; if (!cache && create) { cache = (_XmStringCache)XtCalloc(1, sizeof(_XmStringScanningRec)); cache->cache_type = type; cache->dirty = True; cache->next = _XmEntryCacheGet(entry); _XmEntryCacheSet(entry, cache); ((_XmStringScanningCache)cache)->prim_dir = d; } } else cache = NULL; } break; case _XmRENDERING_CACHE: { XmRenderTable rt; rt = (XmRenderTable)match_value; if (rt) { cache = _XmEntryCacheGet(entry); while (cache && !(cache->cache_type == type && ((_XmStringRenderingCache)cache)->rt == rt)) cache = cache->next; if (!cache && create) { cache = (_XmStringCache)XtCalloc(1, sizeof(_XmStringRenderingRec)); cache->cache_type = type; cache->dirty = True; cache->next = _XmEntryCacheGet(entry); _XmEntryCacheSet(entry, cache); ((_XmStringRenderingCache)cache)->rt = rt; } } else cache = NULL; } break; default: cache = NULL; break; } return cache; } XtPointer _XmScanningCacheGet(_XmStringNREntry entry, #if NeedWidePrototypes int d, #else XmDirection d, #endif /* NeedWidePrototypes */ int field) { _XmStringScanningCache cache; cache = (_XmStringScanningCache)CacheGet((_XmStringEntry)entry, _XmSCANNING_CACHE, False, (XtPointer)(long)d); if (!cache) { if (entry && _XmEntryUnoptimized(entry) && (field == _XmCACHE_DIRTY)) return (XtPointer)True; else return NULL; } switch (field) { case _XmCACHE_DIRTY: return (XtPointer)(long)cache->header.dirty; case _XmCACHE_SCAN_LEFT: return (XtPointer)cache->left; case _XmCACHE_SCAN_RIGHT: return (XtPointer)cache->right; case _XmCACHE_SCAN_LAYOUT: return (XtPointer)(long)cache->layout_direction; case _XmCACHE_SCAN_DEPTH: return (XtPointer)(long)cache->depth; default: return NULL; } } void _XmScanningCacheSet(_XmStringNREntry entry, #if NeedWidePrototypes int d, #else XmDirection d, #endif /* NeedWidePrototypes */ int field, XtPointer value) { _XmStringScanningCache cache; cache = (_XmStringScanningCache)CacheGet((_XmStringEntry)entry, _XmSCANNING_CACHE, True, (XtPointer)(long)d); if (!cache) return; switch (field) { case _XmCACHE_DIRTY: cache->header.dirty = (Boolean)(long)value; break; case _XmCACHE_SCAN_LEFT: cache->left = (_XmStringEntry)value; break; case _XmCACHE_SCAN_RIGHT: cache->right = (_XmStringEntry)value; break; case _XmCACHE_SCAN_LAYOUT: cache->layout_direction = (XmDirection)(long)value; break; case _XmCACHE_SCAN_DEPTH: cache->depth = (unsigned short)(long)value; break; } } XtPointer _XmRenderCacheGet(_XmStringEntry entry, XmRenderTable rt, int field) { _XmStringRenderingCache cache; cache = (_XmStringRenderingCache)CacheGet(entry, _XmRENDERING_CACHE, False, (XtPointer)rt); if (!cache) { if (entry && _XmEntryUnoptimized(entry) && (field == _XmCACHE_DIRTY)) return (XtPointer)True; else return NULL; } switch (field) { case _XmCACHE_DIRTY: return (XtPointer)(long)cache->header.dirty; case _XmCACHE_RENDER_X: return (XtPointer)(long)cache->x; case _XmCACHE_RENDER_Y: return (XtPointer)(long)cache->y; case _XmCACHE_RENDER_WIDTH: return (XtPointer)(long)cache->width; case _XmCACHE_RENDER_HEIGHT: return (XtPointer)(long)cache->height; case _XmCACHE_RENDER_BASELINE: return (XtPointer)(long)cache->baseline; case _XmCACHE_RENDER_ASCENT: return (XtPointer)(long)cache->ascent; case _XmCACHE_RENDER_DESCENT: return (XtPointer)(long)cache->descent; case _XmCACHE_RENDER_RENDITION: return (XtPointer)cache->rendition; case _XmCACHE_RENDER_PREV_TABS: return (XtPointer)(long)cache->prev_tabs; default: return NULL; } } void _XmRenderCacheSet(_XmStringEntry entry, XmRenderTable rt, int field, XtPointer value) { _XmStringRenderingCache cache; cache = (_XmStringRenderingCache)CacheGet(entry, _XmRENDERING_CACHE, True, (XtPointer)rt); if (!cache) return; switch (field) { case _XmCACHE_DIRTY: cache->header.dirty = (Boolean)(long)value; break; case _XmCACHE_RENDER_X: cache->x = (int)(long)value; break; case _XmCACHE_RENDER_Y: cache->y = (int)(long)value; break; case _XmCACHE_RENDER_WIDTH: cache->width = (int)(long)value; break; case _XmCACHE_RENDER_HEIGHT: cache->height = (int)(long)value; break; case _XmCACHE_RENDER_BASELINE: cache->baseline = (int)(long)value; break; case _XmCACHE_RENDER_ASCENT: cache->ascent = (int)(long)value; break; case _XmCACHE_RENDER_DESCENT: cache->descent = (int)(long)value; break; case _XmCACHE_RENDER_RENDITION: if (cache->rendition != NULL) XmRenditionFree(cache->rendition); cache->rendition = (XmRendition)value; break; case _XmCACHE_RENDER_PREV_TABS: cache->prev_tabs = (char)(long)value; break; } } /* * find width of widest line in XmString */ Dimension XmStringWidth( XmRenderTable rendertable, XmString string ) { Dimension width, height; XmStringExtent(rendertable, string, &width, &height); return(width); } /* * find total height of an XmString */ Dimension XmStringHeight( XmRenderTable rendertable, XmString string ) { Dimension width, height; XmStringExtent(rendertable, string, &width, &height); return(height); } /* * find the rectangle which will enclose the text */ void XmStringExtent( XmRenderTable rendertable, XmString string, Dimension *width, Dimension *height ) { Dimension cur_width = 0, max_width = 0; Dimension cur_height = 0, line_height = 0; Dimension asc, dsc; int j; Display *d; XtAppContext app = NULL; *width = 0, *height = 0; if ((rendertable == NULL) || (string == NULL)) return; #ifdef XTHREADS if (_XmRTDisplay(rendertable)) app = XtDisplayToApplicationContext(_XmRTDisplay(rendertable)); if (app) { _XmAppLock(app); } else { _XmProcessLock(); } #endif if (_XmStrOptimized(string)) OptLineMetrics(rendertable, string, NULL, NULL, width, height, NULL, NULL); else { _XmRenditionRec scratch; _XmRendition tmp; XmRendition rend; _XmStringArraySegRec array_seg; bzero((char*) &scratch, sizeof(_XmRenditionRec)); tmp = &scratch; rend = &tmp; /* Initialize for tabs. */ d = (_XmRTDisplay(rendertable) == NULL) ? _XmGetDefaultDisplay() : _XmRTDisplay(rendertable); _XmRendDisplay(rend) = d; _XmStringLayout(string, XmLEFT_TO_RIGHT); for (j = 0; j < _XmStrLineCountGet(string); j++) { _XmStringEntry line; if (_XmStrImplicitLine(string)) line = _XmStrEntry(string)[j]; else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(string); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(string); line = (_XmStringEntry)&array_seg; } LineMetrics(line, rendertable, &rend, NULL, XmLEFT_TO_RIGHT, &cur_width, &cur_height, &asc, &dsc); /* Returned height for empty lines is zero, so go with previous in that case. */ if (cur_height != 0) line_height = cur_height; *height += line_height; if (cur_width > max_width) max_width = cur_width; } *width = max_width; if (_XmRendTags(rend) != NULL) XtFree((char *)_XmRendTags(rend)); } #ifdef XTHREADS if (app) { _XmAppUnlock(app); } else { _XmProcessUnlock(); } #endif } Boolean XmStringEmpty( XmString string ) { int i, j; _XmProcessLock(); if (!string) { _XmProcessUnlock(); return (TRUE); } if (_XmStrOptimized(string)) { if (_XmStrByteCount(string) > 0) { _XmProcessUnlock(); return FALSE; } } else { _XmStringEntry *entry = _XmStrEntry(string); for (i = 0; i < _XmStrEntryCount(string); i++) { if (_XmEntryMultiple(entry[i])) { int segcount = _XmEntrySegmentCount(entry[i]); for (j = 0; j < segcount; j++) { _XmStringNREntry seg = _XmEntrySegment(entry[i])[j]; if (_XmEntryByteCountGet((_XmStringEntry)seg) > 0) { _XmProcessUnlock(); return (FALSE); } } } else { if (_XmEntryByteCountGet(entry[i]) > 0) { _XmProcessUnlock(); return (FALSE); } } } } _XmProcessUnlock(); return (TRUE); } Boolean XmStringIsVoid(XmString string) { XmStringComponentType type; _XmStringContextRec stack_context; unsigned int len; XtPointer val; _XmProcessLock(); if (!string) { _XmProcessUnlock(); return (TRUE); } _XmStringContextReInit(&stack_context, string); while ((type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END) { switch(type) { case XmSTRING_COMPONENT_TAB: case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: case XmSTRING_COMPONENT_SEPARATOR: _XmStringContextFree(&stack_context); _XmProcessUnlock(); return(FALSE); default: break; } } _XmStringContextFree(&stack_context); _XmProcessUnlock(); return(TRUE); } /**************************************************************** * EntryCvtToOpt: * * Converts a single segment to a single Opt segment. * Returns NULL if no conversion could be done. * ****************************************************************/ static _XmStringEntry EntryCvtToOpt(_XmStringEntry entry) { char *text; _XmStringEntry new_entry; if (!entry) return NULL; /* Array segment */ if (_XmEntryMultiple(entry)) return NULL; /* Unoptimized, convert if possible */ if (_XmEntryUnoptimized(entry)) { if (_XmEntryPushGet(entry) || _XmEntryPopGet(entry) || _XmUnoptSegRendBeginCount(entry) > 1 || _XmUnoptSegRendEndCount(entry) > 1 || _XmEntryTabsGet(entry) > 7 || _XmEntryByteCountGet(entry) > 255 || (_XmUnoptSegRendBeginCount(entry) && _XmStringIndexCacheTag(_XmEntryRendBeginGet(entry, 0), XmSTRING_TAG_STRLEN) >= REND_INDEX_MAX) || (_XmUnoptSegRendEndCount(entry) && _XmStringIndexCacheTag(_XmEntryRendEndGet(entry, 0), XmSTRING_TAG_STRLEN) >= REND_INDEX_MAX) || (_XmUnoptSegRendBeginCount(entry) && _XmUnoptSegRendEndCount(entry) && _XmEntryRendEndGet(entry, 0) != _XmEntryRendBeginGet(entry, 0)) || (_XmUnoptSegTag(entry) && _XmStringIndexCacheTag(_XmUnoptSegTag(entry), XmSTRING_TAG_STRLEN) >= TAG_INDEX_MAX)) return NULL; new_entry = (_XmStringEntry)XtCalloc(1, sizeof(_XmStringOptSegRec)); _XmEntryType(new_entry) = XmSTRING_ENTRY_OPTIMIZED; _XmEntryImm(new_entry) = 0; _XmEntryTextTypeSet(new_entry, (XmTextType) _XmEntryTextTypeGet(entry)); _XmEntryTagIndex(new_entry) = (_XmUnoptSegTag(entry) ? _XmStringIndexCacheTag(_XmUnoptSegTag(entry), XmSTRING_TAG_STRLEN) : TAG_INDEX_UNSET); _XmEntryByteCountSet(new_entry, _XmUnoptSegByteCount(entry)); _XmEntryRendIndex(new_entry) = (_XmUnoptSegRendBeginCount(entry) ? _XmStringIndexCacheTag(_XmEntryRendBeginGet(entry, 0), XmSTRING_TAG_STRLEN) : (_XmUnoptSegRendEndCount(entry) ? _XmStringIndexCacheTag(_XmEntryRendEndGet(entry, 0), XmSTRING_TAG_STRLEN) : REND_INDEX_UNSET)); _XmEntryRendBeginCountSet(new_entry, _XmUnoptSegRendBeginCount(entry)); _XmEntryRendEndCountSet(new_entry, _XmUnoptSegRendEndCount(entry)); _XmEntryTabsSet(new_entry, _XmEntryTabsGet(entry)); _XmEntryDirectionSet(new_entry, _XmEntryDirectionGet(entry)); _XmEntryFlippedSet(new_entry, _XmEntryFlippedGet(entry)); _XmEntryPermSet(new_entry, _XmEntryPermGet(entry)); _XmEntrySoftNewlineSet(new_entry, _XmEntrySoftNewlineGet(entry)); if (_XmEntryPermGet(entry)) _XmEntryTextSet(new_entry, _XmEntryTextGet(entry)); else { unsigned int len = _XmEntryByteCountGet(entry); text = (char *)XtMalloc(len); memcpy(text, _XmEntryTextGet(entry), len); _XmEntryTextSet(new_entry, text); } return new_entry; } /* If we were already opt., return a copy */ return _XmStringEntryCopy(entry); } /**************************************************************** * EntryCvtToUnOpt: * * Converts a single segment to a single UnOpt segment. * Returns NULL if no conversion could be done (only for Array segs) * ****************************************************************/ static _XmStringEntry EntryCvtToUnopt(_XmStringEntry entry) { char *text; _XmStringEntry new_entry; unsigned int len; if (!entry) return NULL; /* Array segment */ if (_XmEntryMultiple(entry)) return NULL; /* Unoptimized, return copy */ if (_XmEntryUnoptimized(entry)) return _XmStringEntryCopy(entry); /* Optimized: convert */ len = _XmEntryByteCountGet(entry); new_entry = (_XmStringEntry)XtCalloc(1, sizeof(_XmStringUnoptSegRec)); _XmEntryType(new_entry) = XmSTRING_ENTRY_UNOPTIMIZED; _XmEntryTextTypeSet(new_entry, (XmTextType) _XmEntryTextTypeGet(entry)); _XmUnoptSegTag(new_entry) = _XmEntryTag(entry); _XmUnoptSegByteCount(new_entry) = len; _XmUnoptSegRendBeginCount(new_entry) = _XmEntryRendBeginCountGet(entry); _XmUnoptSegRendEndCount(new_entry) = _XmEntryRendEndCountGet(entry); if (_XmEntryRendBeginCountGet(entry)) { _XmUnoptSegRendBegins(new_entry) = (XmStringTag *)XtMalloc(sizeof(XmStringTag)); _XmUnoptSegRendBegins(new_entry)[0] = _XmEntryRendBeginGet(entry, 0); } if (_XmEntryRendEndCountGet(entry)) { _XmUnoptSegRendEnds(new_entry) = (XmStringTag *)XtMalloc(sizeof(XmStringTag)); _XmUnoptSegRendEnds(new_entry)[0] = _XmEntryRendEndGet(entry, 0); } _XmEntryTabsSet(new_entry, _XmEntryTabsGet(entry)); _XmEntryDirectionSet(new_entry, _XmEntryDirectionGet(entry)); _XmEntryFlippedSet(new_entry, _XmEntryFlippedGet(entry)); _XmEntryPermSet(new_entry, _XmEntryPermGet(entry)); _XmEntrySoftNewlineSet(new_entry, _XmEntrySoftNewlineGet(entry)); _XmEntryPushSet(new_entry, _XmEntryPushGet(entry)); _XmEntryPopSet(new_entry, _XmEntryPopGet(entry)); if (_XmEntryPermGet(entry)) _XmEntryTextSet(new_entry, _XmEntryTextGet(entry)); else if (len>0) { text = (char *)XtMalloc(len); memcpy(text, _XmEntryTextGet(entry), len); _XmEntryTextSet(new_entry, text); } else _XmEntryTextSet(new_entry, NULL); return new_entry; } /* Convert an optimized _XmString to an equivalent non-optimized _XmString */ _XmString _XmStringOptToNonOpt(_XmStringOpt string) { _XmString str; _XmStringOptSegRec seg; _XmStrCreate(str, XmSTRING_MULTIPLE_ENTRY, 0); _XmEntryInit((_XmStringEntry)&seg, XmSTRING_ENTRY_OPTIMIZED); _XmEntryTagIndex(&seg) = _XmStrTagIndex((_XmString)string); _XmEntryRendIndex(&seg) = _XmStrRendIndex((_XmString)string); _XmEntryRendBeginCountSet(&seg, _XmStrRendBegin((_XmString)string)); _XmEntryRendEndCountSet(&seg, _XmStrRendEnd((_XmString)string)); _XmEntryTextTypeSet(&seg, (XmTextType) _XmStrTextType((_XmString)string)); _XmEntryByteCountSet(&seg, _XmStrByteCount((_XmString)string)); _XmEntryDirectionSet((_XmStringEntry)&seg, _XmStrDirection((_XmString)string)); _XmEntryTabsSet(&seg, _XmStrTabs((_XmString)string)); _XmEntryFlippedSet(&seg, _XmStrFlipped((_XmString)string)); _XmEntryTextSet((_XmStringEntry)&seg, _XmStrText((_XmString)string)); _XmStringSegmentNew(str, 0, (_XmStringEntry)&seg, True); return(str); } /* * figure out if there is sub string match, and if so the begining * and end of the match section in pixels. Don't touch anything if * there is no match */ static void SubStringPosition( #if NeedWidePrototypes int one_byte, #else Boolean one_byte, #endif /* NeedWidePrototypes */ XmRenderTable rt, XmRendition entry, _XmStringEntry seg, _XmStringEntry under_seg, #if NeedWidePrototypes int x, #else Position x, #endif /* NeedWidePrototypes */ Dimension *under_begin, Dimension *under_end ) { char *a = (char*) _XmEntryTextGet(seg); char *b = (char*) _XmEntryTextGet(under_seg); char *seg_tag = _XmEntryTag(seg); int i, j, k, begin, max, width; unsigned int seg_len, under_seg_len; Boolean fail; /* Metro Link fix: _XmEntryTag(seg) can be NULL, but the original Motif * code never checked for that. We check, and if it is NULL, we treat * it as if it was set to XmFONTLIST_DEFAULT_TAG. */ if (seg_tag == NULL) seg_tag = XmFONTLIST_DEFAULT_TAG; if (!((seg_tag == _XmEntryTag(under_seg)) || ((strcmp(seg_tag, XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(_XmEntryTag(under_seg))) || ((strcmp(_XmEntryTag(under_seg), XmFONTLIST_DEFAULT_TAG) == 0) && _XmStringIsCurrentCharset(seg_tag)))) return; seg_len = _XmEntryByteCountGet(seg); under_seg_len = _XmEntryByteCountGet(under_seg); if (seg_len < under_seg_len) return; max = (seg_len - under_seg_len); if (_XmRendFontType(entry) == XmFONT_IS_FONT || _XmRendFontType(entry) == XmFONT_IS_XFT) { XFontStruct *font_struct = (XFontStruct *)_XmRendFont(entry); if (one_byte) { for (i = 0; i <= max; i++) { fail = FALSE; begin = i; for (j = 0; j < under_seg_len; j++) { if (a[i+j] != b[j]) { fail = TRUE; break; } } if ( ! fail) { /* found it */ if (begin == 0) *under_begin = x; else if (_XmRendFontType(entry) == XmFONT_IS_FONT) *under_begin = x + abs(XTextWidth (font_struct, a, begin)); #ifdef USE_XFT else { XGlyphInfo ext; XftTextExtentsUtf8(_XmRendDisplay(entry), _XmRendXftFont(entry), (FcChar8*)a, begin, &ext); *under_begin = x + ext.xOff; } #endif width = _XmEntryWidthGet((_XmStringEntry)under_seg, rt); if (width == 0) { if (_XmRendFontType(entry) == XmFONT_IS_FONT) width = abs(XTextWidth(font_struct, b, under_seg_len)); #ifdef USE_XFT else { XGlyphInfo ext; XftTextExtentsUtf8(_XmRendDisplay(entry), _XmRendXftFont(entry), (FcChar8*)b, under_seg_len, &ext); width = ext.xOff; } #endif _XmEntryWidthSet((_XmStringEntry)under_seg, rt, width); } *under_end = *under_begin + width; return; } } } else { /* * If either string isn't even byte length, it can't be * two bytes/char. */ if (((seg_len % 2) != 0) || ((under_seg_len % 2) != 0)) return; /* * search for the substring */ for (i = 0; i <= max; i+=2) { fail = FALSE; begin = i; for (j = 0; j < under_seg_len; j+=2) { if ((a[i+j] != b[j]) || (a[i+j+1] != b[j+1])) { fail = TRUE; break; } } if ( ! fail) { /* found it */ if (begin == 0) *under_begin = x; else if (_XmRendFontType(entry) == XmFONT_IS_FONT) *under_begin = x + abs(XTextWidth16 (font_struct, (XChar2b *) a, begin/2)); #ifdef USE_XFT else { XGlyphInfo ext; XftTextExtents16(_XmRendDisplay(entry), _XmRendXftFont(entry), (FcChar16*)a, begin, &ext); *under_begin = x + ext.xOff; } #endif width = _XmEntryWidthGet((_XmStringEntry)under_seg, rt); if (width == 0) { if (_XmRendFontType(entry) == XmFONT_IS_FONT) width = abs(XTextWidth16(font_struct, (XChar2b *) b, under_seg_len/2)); #ifdef USE_XFT else { XGlyphInfo ext; XftTextExtents16(_XmRendDisplay(entry), _XmRendXftFont(entry), (FcChar16*)b, under_seg_len, &ext); width = ext.xOff; } #endif _XmEntryWidthSet((_XmStringEntry)under_seg, rt, width); } *under_end = *under_begin + width; return; } } } } else { XFontSet font_set = (XFontSet)_XmRendFont(entry); XmTextType type = (XmTextType) _XmEntryTextTypeGet(under_seg); int len_a, len_a1, len_b; for (i = 0; i <= max; i += len_a) { fail = FALSE; begin = i; if (type == XmWIDECHAR_TEXT) { len_a = sizeof(wchar_t); for (j = 0; j < under_seg_len; j += sizeof(wchar_t)) if (((wchar_t *)a)[(i+j)/len_a] != ((wchar_t *)b)[j/len_a]) { fail = TRUE; break; } } else { #ifndef NO_MULTIBYTE len_a = mblen(&a[i], MB_CUR_MAX); #else len_a = a[i] ? 1 : 0; #endif if (len_a < 1) return; len_a1 = len_a; for (j = 0; j < under_seg_len; j += len_b) { #ifndef NO_MULTIBYTE len_b = mblen(&b[j], MB_CUR_MAX); #else len_b = b[j] ? 1 : 0; #endif if (len_b < 1) return; if (len_b == len_a1) { for (k = 0; k < len_b; k++) { if (a[i+j+k] != b[j+k]) { fail = TRUE; break; } } if (fail == TRUE) break; } else { fail = TRUE; break; } } } if (!fail) { /* found it */ #ifdef UTF8_SUPPORTED Boolean utf8 = ((_XmEntryTextTypeGet(seg) == XmCHARSET_TEXT) && (((_XmEntryTag((_XmStringEntry)seg) == XmFONTLIST_DEFAULT_TAG) && _XmStringIsCurrentCharset("UTF-8")) || (strcmp(seg_tag, "UTF-8") == 0))); #else Boolean utf8 = False; #endif if (begin == 0) *under_begin = x; else if (type == XmWIDECHAR_TEXT) { *under_begin = x + abs(XwcTextEscapement(font_set, (wchar_t *)a, begin/sizeof(wchar_t))); } else { #ifdef UTF8_SUPPORTED if (utf8) *under_begin = x + abs(Xutf8TextEscapement(font_set, a, begin)); else #endif *under_begin = x + abs(XmbTextEscapement(font_set, a, begin)); } width = _XmEntryWidthGet((_XmStringEntry)under_seg, rt); if (width == 0) { #ifdef UTF8_SUPPORTED width = (type == XmWIDECHAR_TEXT) ? abs(XwcTextEscapement(font_set, (wchar_t *)b, under_seg_len / sizeof(wchar_t))) : (utf8 ? abs(Xutf8TextEscapement(font_set, b, under_seg_len)) : abs(XmbTextEscapement(font_set, b, under_seg_len))); #else width = (type == XmWIDECHAR_TEXT) ? abs(XwcTextEscapement(font_set, (wchar_t *)b, under_seg_len / sizeof(wchar_t))) : abs(XmbTextEscapement(font_set, b, under_seg_len)); #endif _XmEntryWidthSet((_XmStringEntry)under_seg, rt, width); } *under_end = *under_begin + width; return; } } } } /*ARGSUSED*/ extern void _XmStringDrawLining(Display *d, Drawable w, Position x, Position y, Dimension width, Dimension height, Dimension descender, XmRendition rend, Pixel select_color, /* unused */ XmHighlightMode mode, Boolean colors_set) { GC gc; XGCValues xgcv; Pixel fg, bg, old_fg, old_bg; unsigned char under, thru; XGCValues current_gcv; int style, old_style=LineSolid, cur_style=LineSolid; old_fg = old_bg = XmUNSPECIFIED_PIXEL; _XmRendDisplay(rend) = d; gc = _XmRendGC(rend); fg = _XmRendFG(rend); bg = _XmRendBG(rend); under = _XmRendUnderlineType(rend); thru = _XmRendStrikethruType(rend); if (!colors_set) { if (fg != XmUNSPECIFIED_PIXEL) { XGetGCValues(d, gc, GCForeground, ¤t_gcv); if (current_gcv.foreground != fg) { old_fg = current_gcv.foreground; xgcv.foreground = fg; XChangeGC(d, gc, GCForeground, &xgcv); } } if (bg != XmUNSPECIFIED_PIXEL) { XGetGCValues(d, gc, GCBackground, ¤t_gcv); if (current_gcv.background != bg) { old_bg = current_gcv.background; xgcv.background = bg; XChangeGC(d, gc, GCBackground, &xgcv); } } } if (mode == XmHIGHLIGHT_SECONDARY_SELECTED) { /* Draw lines */ XGetGCValues(d, gc, GCLineStyle, ¤t_gcv); old_style = current_gcv.line_style; style = LineSolid; if (old_style != style) { cur_style = xgcv.line_style = style; XChangeGC(d, gc, GCLineStyle, &xgcv); } XDrawLine (d, w, gc, x, y + SINGLE_OFFSET, x + width - 1, y + SINGLE_OFFSET); } else { XGetGCValues(d, gc, GCLineStyle, ¤t_gcv); cur_style = old_style = current_gcv.line_style; if ((under != XmAS_IS) && (under != XmNO_LINE)) { if ((under == XmSINGLE_DASHED_LINE) || (under == XmDOUBLE_DASHED_LINE)) style = LineDoubleDash; else style = LineSolid; if (cur_style != style) { cur_style = xgcv.line_style = style; XChangeGC(d, gc, GCLineStyle, &xgcv); } if ((under == XmSINGLE_LINE) || (under == XmSINGLE_DASHED_LINE)) { XDrawLine(d, w, gc, x, y + SINGLE_OFFSET, (x + width - 1), y + SINGLE_OFFSET); } else if ((under == XmDOUBLE_LINE) || (under == XmDOUBLE_DASHED_LINE)) { XSegment segs[2]; segs[0].x1 = segs[1].x1 = x; segs[0].x2 = segs[1].x2 = x + width - 1; segs[0].y1 = segs[0].y2 = y; segs[1].y1 = segs[1].y2 = y + DOUBLE_OFFSET; XDrawSegments(d, w, gc, segs, 2); } } if ((thru != XmAS_IS) && (thru != XmNO_LINE)) { if ((thru == XmSINGLE_DASHED_LINE) || (thru == XmDOUBLE_DASHED_LINE)) style = LineDoubleDash; else style = LineSolid; if (cur_style != style) { cur_style = xgcv.line_style = style; XChangeGC(d, gc, GCLineStyle, &xgcv); } if ((thru == XmSINGLE_LINE) || (thru == XmSINGLE_DASHED_LINE)) { XDrawLine(d, w, gc, x, (y + descender - height/2 - 1), (x + width - 1), (y + descender - height/2 - 1)); } else if ((thru == XmDOUBLE_LINE) || (thru == XmDOUBLE_DASHED_LINE)) { XSegment segs[2]; segs[0].x1 = segs[1].x1 = x; segs[0].x2 = segs[1].x2 = x + width - 1; segs[0].y1 = segs[0].y2 = (y + descender - height/2) - 2; segs[1].y1 = segs[1].y2 = (y + descender - height/2) + 1; XDrawSegments(d, w, gc, segs, 2); } } } if ((cur_style != old_style) && ((old_style == LineSolid) || (old_style == LineOnOffDash) || (old_style == LineDoubleDash))) { xgcv.line_style = old_style; XChangeGC(d, gc, GCLineStyle, &xgcv); } if (!colors_set) { if (old_fg != XmUNSPECIFIED_PIXEL) { xgcv.foreground = old_fg; XChangeGC(d, gc, GCForeground, &xgcv); } if (old_bg != XmUNSPECIFIED_PIXEL) { xgcv.background = old_bg; XChangeGC(d, gc, GCBackground, &xgcv); } } } extern void _XmStringDrawSegment(Display *d, Drawable w, #if NeedWidePrototypes int x, int y, int width, int height, #else Position x, Position y, Dimension width, Dimension height, #endif /* NeedWidePrototypes */ _XmStringNREntry seg, XmRendition rend, XmRenderTable rendertable, #if NeedWidePrototypes int image, #else Boolean image, #endif /* NeedWidePrototypes */ XmString *underline, #if NeedWidePrototypes unsigned int descender #else Dimension descender #endif /* NeedWidePrototypes */ ) { Boolean text16 = False, multibyte, widechar, utf8; Font oldfont = (Font) 0; GC gc; XGCValues xgcv; char *draw_text; /* text to be drawn - flipped in RtoL mode */ char flip_char[100]; /* but simple */ char *flip_char_extra = NULL; Pixel fg, bg, old_fg, old_bg; XGCValues current_gcv; Dimension under_begin, under_end; unsigned int seg_len; int font_type; int text_type; old_fg = old_bg = XmUNSPECIFIED_PIXEL; _XmRendDisplay(rend) = d; font_type = _XmRendFontType(rend); text_type = _XmEntryTextTypeGet((_XmStringEntry)seg); seg_len = _XmEntryByteCountGet((_XmStringEntry)seg); if (seg_len > 0) { multibyte = (((text_type == XmMULTIBYTE_TEXT) || (text_type == XmCHARSET_TEXT)) && (font_type == XmFONT_IS_FONTSET)); widechar = ((text_type == XmWIDECHAR_TEXT) && (font_type == XmFONT_IS_FONTSET)); #ifdef UTF8_SUPPORTED utf8 = ((text_type == XmMULTIBYTE_TEXT || text_type == XmCHARSET_TEXT) && (font_type == XmFONT_IS_FONTSET || font_type == XmFONT_IS_XFT || (font_type == XmFONT_IS_FONT && _XmIsISO10646(d, _XmRendFont(rend)))) && (((_XmEntryTag((_XmStringEntry)seg) == XmFONTLIST_DEFAULT_TAG && (_XmStringIsCurrentCharset("UTF-8"))) || ((_XmEntryTagIndex(seg) != TAG_INDEX_UNSET && strcmp(_XmEntryTag((_XmStringEntry)seg), "UTF-8") == 0))))); #else utf8 = False; #endif gc = _XmRendGC(rend); fg = _XmRendFG(rend); bg = _XmRendBG(rend); if (fg != XmUNSPECIFIED_PIXEL) { XGetGCValues(d, gc, GCForeground, ¤t_gcv); if (current_gcv.foreground != fg) { old_fg = current_gcv.foreground; xgcv.foreground = fg; XChangeGC(d, gc, GCForeground, &xgcv); } } if (bg != XmUNSPECIFIED_PIXEL) { XGetGCValues(d, gc, GCBackground, ¤t_gcv); if (current_gcv.background != bg) { old_bg = current_gcv.background; xgcv.background = bg; XChangeGC(d, gc, GCBackground, &xgcv); } } if (!multibyte && !widechar && _XmRendFontType(rend) != XmFONT_IS_XFT) { XFontStruct *f = (XFontStruct *)_XmRendFont(rend); /* If we don't have a font, don't render. */ if (f == NULL) return; text16 = two_byte_font(f); XGetGCValues(d, gc, GCFont, ¤t_gcv) ; xgcv.font = f->fid; /* get segment font */ if (current_gcv.font != xgcv.font) /* not right one */ { /* change it */ oldfont = current_gcv.font; XChangeGC(d, gc, GCFont, &xgcv); } } if (_XmEntryDirectionGet((_XmStringEntry)seg) == XmSTRING_DIRECTION_R_TO_L) { /* Flip the bytes. */ char *p = flip_char, *q; char *ltor_text; int i, j; if (seg_len > 100) p = flip_char_extra = (char *) ALLOCATE_LOCAL(seg_len); draw_text = p; ltor_text = (char *)_XmEntryTextGet((_XmStringEntry)seg); if (multibyte) /* Have to flip a mb character at time. */ { int len; q = ltor_text; p += seg_len; for (i = 0; i < seg_len; i += len) { #ifndef NO_MULTIBYTE len = mblen(q, MB_CUR_MAX); #else len = *q ? 1 : 0; #endif if (len < 1) /* Something went wrong, just return for now. */ return; p -= len; for (j = 0; j < len; j++) { p[j] = q[j]; } q += len; } } else if (!text16) { q = (ltor_text + seg_len - 1); for (i = 0; i < seg_len; i++) *p++ = *q--; } else /* Have to flip two at a time, maintaining their order. */ { char tmp; q = (ltor_text + seg_len - 1); for (i = 0; i < Half(seg_len); i++) { tmp = *q--; *p++ = *q--; *p++ = tmp; } } } else /* LtoR */ { draw_text = (char *)_XmEntryTextGet((_XmStringEntry)seg); } if (*underline != (_XmString)NULL) { under_begin = under_end = 0; if (_XmStrOptimized(*underline)) { /* * This is an optimized string; coerce underline to segment * and call the sub-string search routine. */ Boolean imm; _XmStringOptSegRec under_seg; if (_XmStrText(*underline) != (char *)_XmEntryTextGet((_XmStringEntry)*underline)) /* If XtPointer in union in optimized segment leads to * padding in struct between header and text data * (on some 64-bit architectures) we have to move * text data, since optimized string does not have padding. */ { bzero((char*)&under_seg, sizeof(_XmStringOptSegRec)); _XmEntryType(&under_seg) = XmSTRING_ENTRY_OPTIMIZED; _XmEntryTagIndex(&under_seg) = _XmStrTagIndex(*underline); _XmEntryByteCountSet(&under_seg, _XmStrByteCount(*underline)); _XmEntryTextTypeSet(&under_seg, (XmTextType)_XmStrTextType(*underline)); _XmEntryTextSet((_XmStringEntry)&under_seg, (char *)_XmStrText(*underline)); SubStringPosition((!text16), rendertable, rend, (_XmStringEntry)seg, (_XmStringEntry)&under_seg, x, &under_begin, &under_end); } else { imm = _XmEntryImm((_XmStringEntry)*underline); _XmEntryImm((_XmStringEntry)*underline) = TRUE; SubStringPosition((!text16), rendertable, rend, (_XmStringEntry)seg, (_XmStringEntry)*underline, x, &under_begin, &under_end); _XmEntryImm((_XmStringEntry)*underline) = imm; } } else { _XmStringEntry line; line = _XmStrEntry(*underline)[0]; if ((_XmStrEntryCount(*underline) > 0) && (_XmEntrySegmentCountGet(line) > 0)) { _XmStringNREntry under_seg; under_seg = (_XmStringNREntry)_XmEntrySegmentGet(line)[0]; SubStringPosition((!text16), rendertable, rend, (_XmStringEntry)seg, (_XmStringEntry)under_seg, x, &under_begin, &under_end); } } } #ifdef USE_XFT if (_XmRendFontType(rend) == XmFONT_IS_XFT) { _XmXftDrawString(d, w, rend, 1, x, y, draw_text, seg_len, image); } else /* TODO: fix indentation */ #endif { if (image) { if (text16) if (utf8) { size_t ucs_str_len; XChar2b *ucs_str; /* TODO: it is very unoptimized convert the same sting * twice - for getting extents and drawing */ ucs_str = _XmUtf8ToUcs2(draw_text, seg_len, &ucs_str_len); XDrawImageString16(d, w, gc, x, y, ucs_str, ucs_str_len); XFree(ucs_str); } else XDrawImageString16(d, w, gc, x, y, (XChar2b*)draw_text, Half(seg_len)); #ifdef UTF8_SUPPORTED else if (utf8) Xutf8DrawImageString(d, w, (XFontSet)_XmRendFont(rend), gc, x, y, draw_text, seg_len); #endif else if (multibyte) XmbDrawImageString (d, w, (XFontSet)_XmRendFont(rend), gc, x, y, draw_text, seg_len); else if (widechar) XwcDrawImageString (d, w, (XFontSet)_XmRendFont(rend), gc, x, y, (wchar_t *) draw_text, (seg_len / sizeof(wchar_t))); else XDrawImageString (d, w, gc, x, y, draw_text, seg_len); } else { if (text16) { if (utf8) { size_t ucs_str_len; XChar2b *ucs_str; /* TODO: it is very unoptimized convert the same sting * twice - for getting extents and drawing */ ucs_str = _XmUtf8ToUcs2(draw_text, seg_len, &ucs_str_len); XDrawString16(d, w, gc, x, y, ucs_str, ucs_str_len); XFree(ucs_str); } else XDrawString16 (d, w, gc, x, y, (XChar2b *)draw_text, Half(seg_len)); } #ifdef UTF8_SUPPORTED else if (utf8) Xutf8DrawString(d, w, (XFontSet)_XmRendFont(rend), gc, x, y, draw_text, seg_len); #endif else if (multibyte) XmbDrawString (d, w, (XFontSet)_XmRendFont(rend), gc, x, y, draw_text, seg_len); else if (widechar) XwcDrawString (d, w, (XFontSet)_XmRendFont(rend), gc, x, y, (wchar_t *) draw_text, (seg_len / sizeof(wchar_t))); else XDrawString(d, w, gc, x, y, draw_text, seg_len); } } /* Draw lines */ if ((*underline != NULL) && (under_begin != under_end)) { *underline = (_XmString) NULL; /* only once */ XDrawLine (d, w, gc, under_begin, (y + descender), under_end, (y + descender)); } _XmStringDrawLining(d, w, x, y, width, height, descender, rend, XmUNSPECIFIED_PIXEL, XmHIGHLIGHT_NORMAL, TRUE); if (((Font)0 != oldfont) && /* if font was changed */ ((Font)~0 != oldfont)) /* put it back */ { xgcv.font = oldfont; XChangeGC (d, gc, GCFont, &xgcv); } if (old_fg != XmUNSPECIFIED_PIXEL) { xgcv.foreground = old_fg; XChangeGC(d, gc, GCForeground, &xgcv); } if (old_bg != XmUNSPECIFIED_PIXEL) { xgcv.background = old_bg; XChangeGC(d, gc, GCBackground, &xgcv); } if (flip_char_extra != NULL) { DEALLOCATE_LOCAL(flip_char_extra); } } } /**************************************************************** * recursive_layout: * This (partly) recursive function sets up the left/right * pointers for segments to ensure that segments will be * laid out in the correct order ****************************************************************/ static void recursive_layout(_XmString string, int *line_index, int *seg_index, #if NeedWidePrototypes int direction, int p_direction, #else XmDirection direction, XmDirection p_direction, #endif int depth) { _XmStringEntry line; _XmStringNREntry seg, seg2; _XmStringNREntry last; XmDirection pop_dir = 0; int pop_index = -1; int nseg, nline; int push_line; if (*line_index >= (nline = _XmStrLineCountGet(string))) return; if (_XmStrImplicitLine(string)) { line = _XmStrEntry(string)[*line_index]; nseg = _XmEntrySegmentCountGet(line); } else nseg = _XmStrEntryCount(string); if (*seg_index >= nseg) { (*line_index)++; (*seg_index) = 0; if (*line_index >= nline) return; } if (*seg_index > 0) if (_XmStrImplicitLine(string)) last = _XmEntrySegmentGet(line)[*seg_index-1]; else last = (_XmStringNREntry)_XmStrEntry(string)[*seg_index-1]; else last = NULL; while (*line_index < nline) { if (_XmStrImplicitLine(string)) { line = _XmStrEntry(string)[*line_index]; nseg = _XmEntrySegmentCountGet(line); } else nseg = _XmStrEntryCount(string); while (*seg_index < nseg) { if (_XmStrImplicitLine(string)) seg = _XmEntrySegmentGet(line)[*seg_index]; else seg = (_XmStringNREntry)_XmStrEntry(string)[*seg_index]; if (_XmEntryPushGet((_XmStringEntry)seg) && !_XmEntryPopGet((_XmStringEntry)seg)) { push_line = *line_index; (*seg_index)++; _XmEntryLayoutSet(seg, p_direction, (long)_XmEntryPushGet((_XmStringEntry)seg)); _XmEntryLayoutDepthSet(seg, p_direction, (long)++depth); recursive_layout(string, line_index, seg_index, _XmEntryPushGet((_XmStringEntry)seg), p_direction, depth); if (XmDirectionMatch(_XmEntryPushGet((_XmStringEntry)seg),direction)) { /* False push - treat as normal case */ if (XmDirectionMatch(_XmEntryPushGet((_XmStringEntry)seg), XmLEFT_TO_RIGHT)) { if (last) { _XmEntryRightSet(last, p_direction, seg); _XmEntryLeftSet(seg, p_direction, last); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); } } else if (last) { _XmEntryLeftSet(last, p_direction, seg); _XmEntryRightSet(seg, p_direction, last); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); } if (_XmStrImplicitLine(string)) { if (*line_index < nline) { line = _XmStrEntry(string)[*line_index]; nseg = _XmEntrySegmentCountGet(line); last = _XmEntrySegmentGet(line)[*seg_index]; } else { line = NULL; nseg = 0; last = NULL; } } else { nseg = _XmStrEntryCount(string); last = (_XmStringNREntry)_XmStrEntry(string)[*seg_index]; } } else if (*line_index == push_line) { /* connect segment before push with pop segment */ if (_XmStrImplicitLine(string)) seg2 = _XmEntrySegmentGet(line)[*seg_index]; else seg2 = (_XmStringNREntry)_XmStrEntry(string)[*seg_index]; if (XmDirectionMatch(_XmEntryPushGet((_XmStringEntry)seg), XmLEFT_TO_RIGHT)) { if (last) { _XmEntryLeftSet(last, p_direction, seg2); _XmEntryRightSet(seg2, p_direction, last); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); _XmEntryDirtySet(seg2, _XmSCANNING_CACHE, p_direction, False); } } else { if (last){ _XmEntryRightSet(last, p_direction, seg2); _XmEntryLeftSet(seg2, p_direction, last); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); _XmEntryDirtySet(seg2, _XmSCANNING_CACHE, p_direction, False); } } last = seg; } else { /* pop is on a different line */ if (last && nseg > 0) { /* connect last segment on line with the one before push */ _XmStringNREntry conn_seg; if (_XmStrImplicitLine(string)) conn_seg = _XmEntrySegmentGet(line)[nseg-1]; else conn_seg = (_XmStringNREntry)_XmStrEntry(string)[nseg-1]; if (XmDirectionMatch(_XmEntryPushGet((_XmStringEntry)seg), XmLEFT_TO_RIGHT)) { while (_XmEntryRightGet(conn_seg, p_direction)) conn_seg = (_XmStringNREntry)_XmEntryRightGet(conn_seg, p_direction); _XmEntryLeftSet(last, p_direction, conn_seg); _XmEntryRightSet(conn_seg, p_direction, last); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); _XmEntryDirtySet(conn_seg, _XmSCANNING_CACHE, p_direction, False); } else { while (_XmEntryLeftGet(conn_seg, p_direction)) conn_seg = (_XmStringNREntry)_XmEntryLeftGet(conn_seg, p_direction); _XmEntryRightSet(last, p_direction, conn_seg); _XmEntryLeftSet(conn_seg, p_direction, last); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); _XmEntryDirtySet(conn_seg, _XmSCANNING_CACHE, p_direction, False); } last = NULL; } if (_XmStrImplicitLine(string)) { if (*line_index < nline) { line = _XmStrEntry(string)[*line_index]; nseg = _XmEntrySegmentCountGet(line); } else { line = NULL; nseg = 0; } } else if (*line_index > 0) { line = NULL; nseg = 0; } else nseg = _XmStrEntryCount(string); /* save these things till we return from this level */ pop_index = *seg_index; pop_dir = _XmEntryPushGet((_XmStringEntry)seg); } (*seg_index)++; } else if (!_XmEntryPushGet((_XmStringEntry)seg) && _XmEntryPopGet((_XmStringEntry)seg)) { /* attach this segment to the previous one */ if (last) { if (XmDirectionMatch(direction, XmLEFT_TO_RIGHT)) { _XmEntryLeftSet(seg, p_direction, last); _XmEntryRightSet(last, p_direction, seg); } else { _XmEntryRightSet(seg, p_direction, last); _XmEntryLeftSet(last, p_direction, seg); } _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); } _XmEntryLayoutSet(seg, p_direction, (long)direction); _XmEntryLayoutDepthSet(seg, p_direction, (long)depth); /* If we had a pop with its matching push on another line, now we know what will be adjacent to it in the layout If we popped from left-to-right, we will attach the leftmost segment in the previous level with the rightmost segment in the current level. Vice versa for right-to-left. */ if (pop_index >= 0 && pop_index != *seg_index) { if (_XmStrImplicitLine(string)) last = _XmEntrySegmentGet(line)[pop_index]; else last = (_XmStringNREntry)_XmStrEntry(string)[pop_index]; if (XmDirectionMatch(pop_dir, XmLEFT_TO_RIGHT)) { while (_XmEntryLeftGet(last, p_direction)) last = (_XmStringNREntry)_XmEntryLeftGet(last, p_direction); while (_XmEntryRightGet(seg, p_direction)) seg = (_XmStringNREntry)_XmEntryRightGet(seg, p_direction); _XmEntryRightSet(seg, p_direction, last); _XmEntryLeftSet(last, p_direction, seg); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); _XmEntryDirtySet(seg, _XmSCANNING_CACHE, p_direction, False); } else { while (_XmEntryRightGet(last, p_direction)) last = (_XmStringNREntry)_XmEntryRightGet(last, p_direction); while (_XmEntryLeftGet(seg, p_direction)) seg = (_XmStringNREntry)_XmEntryLeftGet(seg, p_direction); _XmEntryLeftSet(seg, p_direction, last); _XmEntryRightSet(last, p_direction, seg); _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); _XmEntryDirtySet(seg, _XmSCANNING_CACHE, p_direction, False); } } return; } else { /* Default: No push/pop or push, pop in same segment */ /* set up connection */ if (last) { if (XmDirectionMatch(direction, XmLEFT_TO_RIGHT)) { _XmEntryLeftSet(seg, p_direction, last); _XmEntryRightSet(last, p_direction, seg); } else { _XmEntryRightSet(seg, p_direction, last); _XmEntryLeftSet(last, p_direction, seg); } _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); } last = seg; _XmEntryLayoutSet(seg, p_direction, (long)direction); _XmEntryLayoutDepthSet(seg, p_direction, (long)depth); (*seg_index)++; } } /* If we had a pop with its matching push on another line, now we know what will be adjacent to it in the layout, namely the last segment on this line. */ if (pop_index >= 0 && last) { if (pop_index != *seg_index-1) { if (_XmStrImplicitLine(string)) seg2 = _XmEntrySegmentGet(line)[pop_index]; else seg2 = (_XmStringNREntry)_XmStrEntry(string)[pop_index]; if (XmDirectionMatch(pop_dir, XmLEFT_TO_RIGHT)) { _XmEntryRightSet(seg2, p_direction, last); _XmEntryLeftSet(last, p_direction, seg2); } else { _XmEntryLeftSet(seg2, p_direction, last); _XmEntryRightSet(last, p_direction, seg2); } _XmEntryDirtySet(last, _XmSCANNING_CACHE, p_direction, False); _XmEntryDirtySet(seg2, _XmSCANNING_CACHE, p_direction, False); } pop_index = -1; } (*line_index)++; (*seg_index) = 0; last = NULL; } } void _XmStringLayout(_XmString string, #if NeedWidePrototypes int direction) #else XmDirection direction) #endif { int seg_index=0, line_index=0; _XmStringEntry line; _XmStringNREntry seg; Boolean needs_recompute = False; if (!_XmStrMultiple(string)) return; if (_XmStrEntryCount(string)) { line = _XmStrEntry(string)[0]; if (_XmEntrySegmentCountGet(line)) { seg = _XmEntrySegmentGet(line)[0]; needs_recompute = _XmEntryDirtyGet(seg, _XmSCANNING_CACHE, direction); } } if (!needs_recompute) return; while (line_index < _XmStrEntryCount(string)) { line = _XmStrEntry(string)[line_index]; while (seg_index < _XmEntrySegmentCountGet(line)) { seg = _XmEntrySegmentGet(line)[seg_index]; if (_XmEntrySegmentCountGet(line) > 1) { _XmEntryDirtySet(seg, _XmSCANNING_CACHE, direction, True); _XmEntryLeftSet(seg, direction, NULL); _XmEntryRightSet(seg, direction, NULL); } seg_index++; } seg_index = 0; line_index++; } line_index = seg_index = 0; recursive_layout(string, &line_index, &seg_index, direction, direction, 0); /* if there are pops w/o matching pushes, ignore them */ while (line_index < _XmStrLineCountGet(string) && seg_index < _XmEntrySegmentCountGet(_XmStrEntry(string)[line_index])) { line = _XmStrEntry(string)[line_index]; seg = _XmEntrySegmentGet(line)[seg_index]; _XmEntryPopSet(seg, False); recursive_layout(string, &line_index, &seg_index, direction, direction, 0); _XmEntryPopSet(seg, True); } } /**************************************************************** * What's the layout direction at the end of the line? ****************************************************************/ static void last_direction(_XmStringEntry line, int *index, XmDirection *direction) { _XmStringNREntry seg; XmDirection sub_dir = *direction; while (*index < _XmEntrySegmentCountGet(line)) { seg = _XmEntrySegmentGet(line)[*index]; if (_XmEntryPushGet((_XmStringEntry)seg) && !_XmEntryPopGet((_XmStringEntry)seg)) { sub_dir = _XmEntryPushGet((_XmStringEntry)seg); (*index)++; last_direction(line, index, &sub_dir); if (*index < _XmEntrySegmentCountGet(line)) sub_dir = *direction; (*index)++; } else if (!_XmEntryPushGet((_XmStringEntry)seg) && _XmEntryPopGet((_XmStringEntry)seg)) return; else (*index)++; } *direction = sub_dir; } /* * Draw a single internal TCS line */ static void DrawLine( Display *d, Window w, Screen **pscreen, int x, int y, _XmStringEntry line, XmRendition *scr_rend, XmRendition base, XmRenderTable rendertable, XmDirection prim_dir, #if NeedWidePrototypes int image, #else Boolean image, #endif /* NeedWidePrototypes */ _XmString *underline, #if NeedWidePrototypes int descender, int opt, int opt_width, int opt_height #else Dimension descender, Boolean opt, Dimension opt_width, Dimension opt_height #endif /* NeedWidePrototypes */ ) { int i, prev_val, val, offset; XmTabList tl = NULL; XmTab tab; unsigned short tab_cnt; /* Absolute tabs use this as left margin */ offset = x; if (opt) { /* * This is optimized; build an optimized segment and call the drawing * routine. */ _XmStringOptSegRec segm; _XmString optline = (_XmString)line; _XmEntryInit((_XmStringEntry)&segm, XmSTRING_ENTRY_OPTIMIZED); _XmEntryTagIndex(&segm) = _XmStrTagIndex(optline); _XmEntryByteCountSet(&segm, _XmStrByteCount(optline)); _XmEntryTextTypeSet(&segm, (XmTextType) _XmStrTextType(optline)); _XmEntryTextSet((_XmStringEntry)&segm, _XmStrText(optline)); if (_XmStrDirection(optline) != XmSTRING_DIRECTION_UNSET) _XmEntryDirectionSet((_XmStringEntry)&segm, _XmStrDirection(optline)); else _XmEntryDirectionSet((_XmStringEntry)&segm, XmDirectionToStringDirection(prim_dir)); if (_XmStrRendBegin(optline)) _XmEntryRendIndex(&segm) = _XmStrRendIndex(optline); if (*scr_rend != NULL) tl = _XmRendTabs(*scr_rend); tab = (tl == NULL) ? NULL : _XmTabLStart(tl); prev_val = x; tab_cnt = 0; if ((tab != NULL) && (_XmEntryTabsGet((_XmStringEntry)&segm) != 0) && (tab_cnt < _XmTabLCount(tl)) && _XmEntryDirectionGet((_XmStringEntry)&segm) != XmSTRING_DIRECTION_R_TO_L) { for (i = 0; (i < _XmEntryTabsGet((_XmStringEntry)&segm)) && (tab_cnt < _XmTabLCount(tl)); i++, tab = _XmTabNext(tab), tab_cnt++) { val = TabVal(d, pscreen, w, tab); if (_XmTabModel(tab) == XmABSOLUTE) { x = val + offset; prev_val = x; } else /* XmRELATIVE */ { x = prev_val + val; prev_val += val; } } } _XmStringDrawSegment(d, w, x, y, opt_width, opt_height, (_XmStringNREntry)&segm, *scr_rend, rendertable, image, underline, descender); } else { _XmStringNREntry seg; int seg_index = 0; Boolean ok; Dimension width, height; Boolean set_direction = False; XmDirection lay_dir = prim_dir; /* layout direction of this line */ seg = _XmEntrySegmentGet(line)[seg_index]; if (_XmEntryType(seg) != XmSTRING_ENTRY_OPTIMIZED) { lay_dir = _XmEntryLayoutGet(seg, prim_dir); } if (XmDirectionMatch(lay_dir, XmLEFT_TO_RIGHT)) { if (_XmEntryType(seg) != XmSTRING_ENTRY_OPTIMIZED) { while (_XmEntryLeftGet(seg, prim_dir) != NULL) seg = (_XmStringNREntry)_XmEntryLeftGet(seg, prim_dir); } if (_XmEntryDirectionGet((_XmStringEntry)seg) == XmSTRING_DIRECTION_UNSET) { _XmEntryDirectionSet((_XmStringEntry)seg, XmDirectionToStringDirection(prim_dir)); set_direction = True; } ok = SpecifiedSegmentExtents((_XmStringEntry)seg, rendertable, scr_rend, base, XmSTRING_MIDDLE_SEG, &width, &height, NULL, NULL); if (*scr_rend != NULL) tl = _XmRendTabs(*scr_rend); tab = (tl == NULL) ? NULL : _XmTabLStart(tl); prev_val = x; tab_cnt = 0; while (seg != NULL) { /* If this segment is tabbed, set x accordingly. */ if ((tab != NULL) && (_XmEntryTabsGet((_XmStringEntry)seg) != 0) && (tab_cnt < _XmTabLCount(tl))) { int start_x = x; for (i = 0; (i < _XmEntryTabsGet((_XmStringEntry)seg)) && (tab_cnt < _XmTabLCount(tl)); i++, tab = _XmTabNext(tab), tab_cnt++) { val = TabVal(d, pscreen, w, tab); if (_XmTabModel(tab) == XmABSOLUTE) x = MAX(x, (val + offset)); else /* XmRELATIVE */ x = MAX(x, prev_val + val); prev_val = x; } _XmStringDrawLining(d, w, start_x, y, (x - start_x), height, descender, *scr_rend, XmUNSPECIFIED_PIXEL, XmHIGHLIGHT_NORMAL, FALSE); } if (ok) _XmStringDrawSegment(d, w, x, y, width, height, seg, *scr_rend, rendertable, image, underline, descender); x += width; if (set_direction) { _XmEntryDirectionSet((_XmStringEntry)seg, XmSTRING_DIRECTION_UNSET); set_direction = False; } if (_XmEntryType(seg) != XmSTRING_ENTRY_OPTIMIZED) { seg = (_XmStringNREntry)_XmEntryRightGet(seg, prim_dir); } else { seg_index++; seg = (seg_index < _XmEntrySegmentCountGet(line) ? _XmEntrySegmentGet(line)[seg_index] : NULL); } if (seg != NULL) { if (_XmEntryDirectionGet((_XmStringEntry)seg) == XmSTRING_DIRECTION_UNSET) { _XmEntryDirectionSet((_XmStringEntry)seg, XmDirectionToStringDirection(prim_dir)); set_direction = True; } ok = SpecifiedSegmentExtents((_XmStringEntry)seg, rendertable, scr_rend, base, XmSTRING_MIDDLE_SEG, &width, &height, NULL, NULL); } } } else { if (_XmEntryType(seg) != XmSTRING_ENTRY_OPTIMIZED) { while (_XmEntryRightGet(seg, prim_dir) != NULL) seg = (_XmStringNREntry)_XmEntryRightGet(seg, prim_dir); } if (_XmEntryDirectionGet((_XmStringEntry)seg) == XmSTRING_DIRECTION_UNSET) { _XmEntryDirectionSet((_XmStringEntry)seg, XmDirectionToStringDirection(prim_dir)); set_direction = True; } ok = SpecifiedSegmentExtents((_XmStringEntry)seg, rendertable, scr_rend, base, XmSTRING_MIDDLE_SEG, &width, &height, NULL, NULL); if (*scr_rend != NULL) tl = _XmRendTabs(*scr_rend); tab = (tl == NULL) ? NULL : _XmTabLStart(tl); x += opt_width; offset = prev_val = x; tab_cnt = 0; while (seg != NULL) { /* If this segment is tabbed, set x accordingly. */ if ((tab != NULL) && (_XmEntryTabsGet((_XmStringEntry)seg) != 0) && (tab_cnt < _XmTabLCount(tl))) { int start_x = x; for (i = 0; (i < _XmEntryTabsGet((_XmStringEntry)seg)) && (tab_cnt < _XmTabLCount(tl)); i++, tab = _XmTabNext(tab), tab_cnt++) { val = TabVal(d, pscreen, w, tab); if (_XmTabModel(tab) == XmABSOLUTE) x = MIN(x, offset - val); else /* XmRELATIVE */ x = MIN(x, prev_val - val); prev_val = x; } _XmStringDrawLining(d, w, x, y, (start_x - x), height, descender, *scr_rend, XmUNSPECIFIED_PIXEL, XmHIGHLIGHT_NORMAL, FALSE); } x -= width; if (ok) _XmStringDrawSegment(d, w, x, y, width, height, seg, *scr_rend, rendertable, image, underline, descender); if (set_direction) { _XmEntryDirectionSet((_XmStringEntry)seg, XmSTRING_DIRECTION_UNSET); set_direction = False; } if (_XmEntryType(seg) != XmSTRING_ENTRY_OPTIMIZED) { seg = (_XmStringNREntry)_XmEntryLeftGet(seg, prim_dir); } else { seg_index++; seg = (seg_index < _XmEntrySegmentCountGet(line) ? _XmEntrySegmentGet(line)[seg_index] : NULL); } if (seg != NULL) { if (_XmEntryDirectionGet((_XmStringEntry)seg) == XmSTRING_DIRECTION_UNSET) { _XmEntryDirectionSet((_XmStringEntry)seg, XmDirectionToStringDirection(prim_dir)); set_direction = True; } ok = SpecifiedSegmentExtents((_XmStringEntry)seg, rendertable, scr_rend, base, XmSTRING_MIDDLE_SEG, &width, &height, NULL, NULL); } } } } } /* * calculate the alignment, position and clipping for the string */ static void _calc_align_and_clip( Display *d, Window w, GC gc, Position *x, #if NeedWidePrototypes int y, int width, #else Position y, Dimension width, #endif /* NeedWidePrototypes */ int line_width, #ifdef FIX_1488 int line_height, #endif #if NeedWidePrototypes unsigned int lay_dir, #else unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, #if NeedWidePrototypes unsigned int align, #else unsigned char align, #endif /* NeedWidePrototypes */ int descender, int *restore, XmFontType font_type) { Boolean l_to_r = XmDirectionMatch(lay_dir, XmSTRING_DIRECTION_L_TO_R); switch (align) { case XmALIGNMENT_BEGINNING: if ( ! l_to_r) *x += width - line_width; break; case XmALIGNMENT_CENTER: *x += Half (width) - Half (line_width); break; case XmALIGNMENT_END : if (l_to_r) *x += width - line_width; break; } if ((clip != NULL) && ( ! *restore)) #ifdef FIX_1488 if (((*x) <= clip->x + clip->width) && (clip->x <= (*x) + line_width) && (y - line_height + descender <= clip->y + clip->height) && (clip->y <= y + descender)) #else /* BEGIN OSF Fix CR 5106 */ if ((line_width > clip->width) || /* END OSF Fix CR 5106 */ (y + descender) > (clip->y + clip->height)) #endif { *restore = TRUE; #ifdef USE_XFT if (font_type == XmFONT_IS_XFT) _XmXftSetClipRectangles(d, w, 0, 0, clip, 1); #ifndef FIX_1532 else #endif #endif XSetClipRectangles (d, gc, 0, 0, clip, 1, YXBanded); } } /* * draw a complete internal format TCS */ static void _draw( Display *d, Window w, XmRenderTable rendertable, _XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, #if NeedWidePrototypes int image, #else Boolean image, #endif /* NeedWidePrototypes */ _XmString underline ) { static XmRendition rend = NULL; if (!string) return; _XmProcessLock(); if (rend == NULL) rend = XmRenditionCreate(NULL, XmS, NULL, 0); _XmRendDisplay(rend) = d; _XmRendGC(rend) = gc; _XmRendTags(rend) = NULL; _XmRendTagCount(rend) = 0; _render(d, w, rendertable, rend, string, x, y, width, align, lay_dir, image, underline, clip); _XmProcessUnlock(); } /* * render a complete internal format TCS */ static void _render(Display *d, Drawable w, XmRenderTable rendertable, XmRendition rend, _XmString string, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, int image, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, Boolean image, #endif /* NeedWidePrototypes */ _XmString underline, XRectangle *clip) { Position base_x = x, draw_x; Dimension line_width, line_height, ascender = 0, descender = 0; _XmStringEntry line; int i; int restore_clip = FALSE; _XmRenditionRec scratch1, scratch2; _XmRendition tmp1, tmp2; XmRendition rend1, rend2; GC gc; Screen *screen = NULL; if (!string) return; tmp1 = &scratch1; bzero((char *)tmp1, sizeof(_XmRenditionRec)); rend1 = &tmp1; tmp2 = &scratch2; bzero((char *)tmp2, sizeof(_XmRenditionRec)); rend2 = &tmp2; _XmRendDisplay(rend1) = _XmRendDisplay(rend2) = d; gc = _XmRendGC(rend1) = _XmRendGC(rend2) = _XmRendGC(rend); _XmRendTags(rend1) = _XmRendTags(rend2) = NULL; _XmRendTagCount(rend1) = _XmRendTagCount(rend2) = 0; if (lay_dir <= 1) /* got passed XmStringDirection value */ lay_dir = XmStringDirectionToDirection(lay_dir); if (_XmStrOptimized(string)) { OptLineMetrics(rendertable, string, &rend2, rend, &line_width, &line_height, &ascender, &descender); y += ascender; if (line_width != 0) { draw_x = base_x ; /* most left position */ _calc_align_and_clip( d, w, gc, &draw_x, y, width, line_width, #ifdef FIX_1488 line_height, lay_dir, clip, align, descender, #else lay_dir, clip, align, descender, #endif #ifdef FIX_1521 &restore_clip, _XmRendFontType(rend2)); #else &restore_clip, _XmRendFontType(rend)); #endif DrawLine(d, w, &screen, draw_x, y, (_XmStringEntry)string, &rend2, rend, rendertable, lay_dir, image, &underline, descender, TRUE, line_width, line_height); } y += descender ; /* go to bottom of this line */ } else { XmDirection direction = lay_dir; int val; _XmStringArraySegRec array_seg; _XmStringLayout(string, lay_dir); for (i = 0; i < _XmStrLineCountGet(string); i++) { if (_XmStrImplicitLine(string)) { line = _XmStrEntry(string)[i]; } else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(string); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(string); line = (_XmStringEntry)&array_seg; } /* width, height, ascent, descent of this line */ #ifdef FIX_1521 LineMetrics(line, rendertable, &rend1, rend, lay_dir, #else LineMetrics(line, rendertable, &rend2, rend, lay_dir, #endif &line_width, &line_height, &ascender, &descender); y += ascender; if (line_width != 0) { draw_x = base_x; /* most left position */ _calc_align_and_clip(d, w, gc, &draw_x, y, width, line_width, #ifdef FIX_1488 line_height, direction, clip, align, descender, #else direction, clip, align, descender, #endif #ifdef FIX_1521 &restore_clip, _XmRendFontType(rend1)); #else &restore_clip, _XmRendFontType(rend)); #endif DrawLine(d, w, &screen, draw_x, y, line, &rend1, rend, rendertable, lay_dir, image, &underline, descender, FALSE, line_width, line_height); val = 0; last_direction((_XmStringEntry)line, &val, &direction); if (val < _XmEntrySegmentCountGet(line)) /* found an 'unmatched' pop */ direction = lay_dir; } y += descender; /* go to bottom of this line */ } } if (restore_clip) { #ifdef FIX_1521 #ifdef USE_XFT if (_XmRendFontType((_XmStrOptimized(string)) ? rend2 : rend1) == XmFONT_IS_XFT) { XftDraw *draw = _XmXftDrawCreate(d, w); XftDrawSetClip(draw, NULL); } else #endif #endif XSetClipMask (d, gc, None); } if (_XmRendTags(rend1) != NULL) XtFree((char *)_XmRendTags(rend1)); if (_XmRendTags(rend2) != NULL) XtFree((char *)_XmRendTags(rend2)); } void _XmStringRender(Display *d, Drawable w, XmRenderTable rendertable, XmRendition rend, _XmString string, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir #endif /* NeedWidePrototypes */ ) { _render(d, w, rendertable, rend, string, x, y, width, align, lay_dir, FALSE, NULL, NULL); } /* * add a new segment to a particular line in an XmString */ void _XmStringSegmentNew( _XmString string, int line_index, _XmStringEntry value, int copy) { _XmStringEntry line; _XmStringEntry seg; int sc; int lc = _XmStrEntryCount(string); if (lc == 0 || lc-1 < line_index) { _XmStrEntry(string) = (_XmStringEntry *) XtRealloc((char *) _XmStrEntry(string), sizeof(_XmStringEntry) * (lc + 1)); _XmStrEntryCount(string)++; if (line_index > lc) line_index = lc; if (copy) line = _XmStringEntryCopy(value); else { line = value; } _XmStrEntry(string)[line_index] = line; } else { line = _XmStrEntry(string)[line_index]; if (!_XmEntryMultiple(line)) { /* have to create an array entry */ sc = 1; seg = line; _XmEntryCreate(line, XmSTRING_ENTRY_ARRAY); _XmEntrySegmentCount(line) = sc; _XmEntrySoftNewlineSet(line, _XmEntrySoftNewlineGet(seg)); _XmEntrySegment(line) = (_XmStringNREntry *) XtMalloc(sizeof(_XmStringEntry) * 2); _XmEntrySegment(line)[0] = (_XmStringNREntry)seg; _XmStrEntry(string)[line_index] = line; _XmStrImplicitLine(string) = True; } else { sc = _XmEntrySegmentCount(line); _XmEntrySegment(line) = (_XmStringNREntry *) XtRealloc((char *) _XmEntrySegment(line), sizeof(_XmStringEntry) * (sc+1)); } seg = (copy ? _XmStringEntryCopy(value) : value); _XmEntrySegment(line)[sc] = (_XmStringNREntry)seg; _XmEntrySegmentCount(line)++; } } static _XmString _XmStringOptCreate( unsigned char *c, unsigned char *end, #if NeedWidePrototypes unsigned int textlen, int havetag, #else unsigned short textlen, Boolean havetag, #endif /* NeedWidePrototypes */ unsigned int tag_index ) { _XmString string; char *tag = NULL; unsigned short length; _XmStrCreate(string, XmSTRING_OPTIMIZED, textlen); if (havetag) { _XmStrTagIndex((_XmString)string) = tag_index ; } else { tag = XmFONTLIST_DEFAULT_TAG; _XmStrTagIndex((_XmString)string) = _XmStringIndexCacheTag((char *) tag, XmSTRING_TAG_STRLEN); } while (c < end) { length = _read_asn1_length (c); switch (*c) { case XmSTRING_COMPONENT_RENDITION_BEGIN: _XmStrRendIndex(string) = _XmStringIndexCacheTag((char *)(c + _asn1_size(length)), (int)length); _XmStrRendBegin(string) = TRUE; break; case XmSTRING_COMPONENT_LOCALE: _XmStrTextType((_XmString)string) = XmMULTIBYTE_TEXT; break; case XmSTRING_COMPONENT_TAG: _XmStrTextType((_XmString)string) = XmCHARSET_TEXT; break; case XmSTRING_COMPONENT_TAB: _XmStrTabs(string)++; break; case XmSTRING_COMPONENT_DIRECTION: /* record dir */ _XmStrDirection((_XmString) string) = ((XmStringDirection)*(c + _asn1_size(length))); break; case XmSTRING_COMPONENT_TEXT: _XmStrTextType((_XmString)string) = XmCHARSET_TEXT; memcpy(_XmStrText((_XmString)string), (c + _asn1_size(length)), textlen); break; case XmSTRING_COMPONENT_LOCALE_TEXT: _XmStrTextType((_XmString)string) = XmMULTIBYTE_TEXT; memcpy(_XmStrText((_XmString)string), (c + _asn1_size(length)), textlen); break; case XmSTRING_COMPONENT_RENDITION_END: _XmStrRendIndex(string) = _XmStringIndexCacheTag((char *)(c + _asn1_size(length)), (int)length); _XmStrRendEnd(string) = TRUE; break; case XmSTRING_COMPONENT_SEPARATOR: /* start new line */ _XmStrFree ((char *) string); return (NULL); /* break; */ default: break; } c += length + _asn1_size(length); } return((_XmString) string); } static void finish_segment(_XmString str, _XmStringUnoptSeg seg, int *lc, int *sc, Boolean *unopt, XmStringDirection dir) { _XmStringEntry opt_seg; _XmEntryDirectionSet((_XmStringEntry)seg, dir); if (!*unopt && (opt_seg = EntryCvtToOpt((_XmStringEntry)seg))) _XmStringSegmentNew(str, _XmStrImplicitLine(str) ? *lc : *sc, opt_seg, False); else _XmStringSegmentNew(str, _XmStrImplicitLine(str) ? *lc : *sc, (_XmStringEntry)seg, True); (*sc)++; *unopt = False; _XmEntryInit((_XmStringEntry)seg, XmSTRING_ENTRY_UNOPTIMIZED); } static _XmString _XmStringNonOptCreate( unsigned char *c, unsigned char *end, #if NeedWidePrototypes int havetag ) #else Boolean havetag ) #endif /* NeedWidePrototypes */ { int lc, sc; _XmStringUnoptSegRec seg; unsigned short length; _XmString string ; char *tag = NULL; Boolean needs_unopt = False; Boolean txt_seen = False; Boolean push_seen = False; Boolean pop_seen = False; Boolean need_finish = False; int rend_cnt; int tab_cnt; XmTextType prev_type = XmCHARSET_TEXT; XmStringDirection dir = XmSTRING_DIRECTION_UNSET; _XmStrCreate(string, XmSTRING_MULTIPLE_ENTRY, 0); _XmEntryInit((_XmStringEntry)&seg, XmSTRING_ENTRY_UNOPTIMIZED); if (!havetag) { tag = XmFONTLIST_DEFAULT_TAG; _XmUnoptSegTag(&seg) = _XmStringCacheTag((char *) (tag), XmSTRING_TAG_STRLEN); } _XmEntryDirectionSet((_XmStringEntry)&seg, XmSTRING_DIRECTION_L_TO_R); lc = sc = 0; while (c < end) { length = _read_asn1_length (c); need_finish = True; switch (*c) { case XmSTRING_COMPONENT_LAYOUT_PUSH: /* record dir */ if ((txt_seen) || (push_seen)) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } needs_unopt = True; push_seen = True; _XmEntryPushSet(&seg, (XmDirection)*(c + _asn1_size(length))); break; case XmSTRING_COMPONENT_RENDITION_BEGIN: if (txt_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } rend_cnt = ++(_XmUnoptSegRendBeginCount(&seg)); if (rend_cnt > 1) needs_unopt = True; _XmUnoptSegRendBegins(&seg) = (XmStringTag *) XtRealloc((char *)_XmUnoptSegRendBegins(&seg), rend_cnt); _XmUnoptSegRendBegins(&seg)[rend_cnt - 1] = _XmStringCacheTag((char *)(c + _asn1_size(length)), (int)length); break; case XmSTRING_COMPONENT_LOCALE: if (txt_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } _XmEntryTextTypeSet(&seg, XmMULTIBYTE_TEXT); prev_type = XmMULTIBYTE_TEXT; _XmUnoptSegTag(&seg) = _XmStringCacheTag((char *)(c+_asn1_size(length)), (int)length); break; case XmSTRING_COMPONENT_TAG: if (txt_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } _XmEntryTextTypeSet(&seg, XmCHARSET_TEXT); prev_type = XmCHARSET_TEXT; _XmUnoptSegTag(&seg) = _XmStringCacheTag((char *)(c+_asn1_size(length)), (int)length); break; case XmSTRING_COMPONENT_TAB: if (txt_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } tab_cnt = _XmEntryTabsGet((_XmStringEntry)&seg); if (++tab_cnt > 7) needs_unopt = True; _XmEntryTabsSet(&seg, tab_cnt); break; case XmSTRING_COMPONENT_DIRECTION: /* record dir */ if (txt_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } dir = (XmStringDirection)*(c + _asn1_size(length)); break; case XmSTRING_COMPONENT_WIDECHAR_TEXT: if (txt_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } _XmEntryTextTypeSet(&seg, XmWIDECHAR_TEXT); prev_type = XmWIDECHAR_TEXT; /* Fall through */ case XmSTRING_COMPONENT_LOCALE_TEXT: if (txt_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } /* from above */ if (_XmEntryTextTypeGet((_XmStringEntry)&seg) != XmWIDECHAR_TEXT) { _XmEntryTextTypeSet(&seg, XmMULTIBYTE_TEXT); prev_type = XmMULTIBYTE_TEXT; } _XmUnoptSegTag(&seg) = _XmStringCacheTag((char *) XmFONTLIST_DEFAULT_TAG, XmSTRING_TAG_STRLEN); /* Fall through to regular text. */ case XmSTRING_COMPONENT_TEXT: if (txt_seen) { push_seen = txt_seen = pop_seen = False; finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); } if (_XmEntryTextTypeGet((_XmStringEntry)&seg) == XmNO_TEXT) _XmEntryTextTypeSet(&seg, prev_type); _XmEntryTextSet((_XmStringEntry)&seg, (c + _asn1_size(length))); _XmUnoptSegByteCount(&seg) = length; txt_seen = True; break; case XmSTRING_COMPONENT_RENDITION_END: txt_seen = True; rend_cnt = ++(_XmUnoptSegRendEndCount(&seg)); if (rend_cnt > 1) needs_unopt = True; _XmUnoptSegRendEnds(&seg) = (XmStringTag *) XtRealloc((char *)_XmUnoptSegRendEnds(&seg), rend_cnt); _XmUnoptSegRendEnds(&seg)[rend_cnt - 1] = _XmStringCacheTag((char *)(c + _asn1_size(length)), (int)length); break; case XmSTRING_COMPONENT_LAYOUT_POP: if (pop_seen) { finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); push_seen = txt_seen = pop_seen = False; } needs_unopt = True; txt_seen = True; pop_seen = True; _XmEntryPopSet(&seg, TRUE); break; case XmSTRING_COMPONENT_SEPARATOR: /* start new line */ finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); need_finish = push_seen = txt_seen = pop_seen = False; if (!_XmStrImplicitLine(string) && _XmStrEntryCount(string) > 1) { /* need to move segments down one level */ _XmStringEntry line; line = (_XmStringEntry)XtMalloc(sizeof(_XmStringArraySegRec)); _XmEntryType(line) = XmSTRING_ENTRY_ARRAY; _XmEntrySoftNewlineSet(line, False); _XmEntrySegmentCount(line) = _XmStrEntryCount(string); _XmEntrySegment(line) = (_XmStringNREntry *)_XmStrEntry(string); _XmStrEntry(string) = (_XmStringEntry *)XtMalloc(sizeof(_XmStringEntry)); _XmStrEntry(string)[0] = line; _XmStrEntryCount(string) = 1; } _XmStrImplicitLine(string) = True; lc++; break; default: break; } c += length + _asn1_size(length); } if (need_finish) finish_segment(string, &seg, &lc, &sc, &needs_unopt, dir); return(string); } /* * Converts from ASN.1 formatted byte stream to XmString. */ /*ARGSUSED*/ XmString XmCvtByteStreamToXmString(unsigned char *property) { unsigned char *c; unsigned char *c_opt; unsigned char *end; unsigned short length; unsigned short txtlength; XmString string ; Boolean continue_flag; Boolean optimized; Boolean havetag; Boolean begin_seen, end_seen; Boolean txt_seen; unsigned int tag_index = TAG_INDEX_MAX; unsigned int begin_index = REND_INDEX_MAX; unsigned int end_index = REND_INDEX_MAX; unsigned char tab_cnt; _XmProcessLock(); if (!property) { _XmProcessUnlock(); return((XmString) NULL); } /* If property isn't an asn.1 conformant string, return NULL. */ if (!_is_asn1(property)) { _XmProcessUnlock(); return ((XmString) NULL); } c = (unsigned char *) _read_header((unsigned char *) property); end = c + _read_string_length ((unsigned char *) property); if (c >= end) { _XmProcessUnlock(); return ((_XmString) NULL); } /* * In order to build an optimized string, we have to see if this one * qualifies. Do some preprocessing to see. * We also need to know if this CS contains a character set component, * so look for that too. */ c_opt = c; continue_flag = TRUE; optimized = TRUE; txtlength = 0; /* For strings with no text component. */ havetag = FALSE; end_seen = begin_seen = FALSE; txt_seen = FALSE; tab_cnt = 0; while (continue_flag) { length = _read_asn1_length (c_opt); switch (*c_opt) { /* All non-optimized */ case XmSTRING_COMPONENT_LAYOUT_PUSH: case XmSTRING_COMPONENT_LAYOUT_POP: case XmSTRING_COMPONENT_SEPARATOR: /* start new line */ optimized = FALSE; break; case XmSTRING_COMPONENT_RENDITION_BEGIN: if (begin_seen || txt_seen) { optimized = FALSE; break; } else { begin_seen = TRUE; begin_index = _XmStringIndexCacheTag((char *)(c_opt + _asn1_size(length)), (int)length); if (begin_index >= REND_INDEX_MAX) optimized = FALSE ; } break; case XmSTRING_COMPONENT_LOCALE: case XmSTRING_COMPONENT_TAG: tag_index = _XmStringIndexCacheTag ((char *) (c_opt + _asn1_size(length)), (int) length); if (txt_seen || (tag_index >= TAG_INDEX_MAX)) optimized = FALSE ; havetag = TRUE; break; case XmSTRING_COMPONENT_TAB: if (++tab_cnt > 3) optimized = FALSE; break; case XmSTRING_COMPONENT_DIRECTION: if (txt_seen) optimized = FALSE; break; case XmSTRING_COMPONENT_WIDECHAR_TEXT: optimized = FALSE; txtlength = length; break; case XmSTRING_COMPONENT_LOCALE_TEXT: /* Check the tag. */ tag_index = _XmStringIndexCacheTag((char *)XmFONTLIST_DEFAULT_TAG, XmSTRING_TAG_STRLEN); havetag = TRUE; if ((txt_seen) || (tag_index >= TAG_INDEX_MAX)) { optimized = FALSE; break; } /* Else fall through to text case. */ case XmSTRING_COMPONENT_TEXT: if (txt_seen || (((c_opt + length + _asn1_size(length)) < end) || (length >= (1 << BYTE_COUNT_BITS)))) optimized = FALSE; txtlength = length; txt_seen = TRUE; break; case XmSTRING_COMPONENT_RENDITION_END: if (end_seen) { optimized = FALSE; break; } else { end_seen = TRUE; txt_seen = TRUE; end_index = _XmStringIndexCacheTag((char *)(c_opt + _asn1_size(length)), (int)length); if ((end_index >= REND_INDEX_MAX) || (end_index != begin_index)) optimized = FALSE; } break; default: break; } c_opt += length + _asn1_size(length); if ((c_opt >= end) || (!optimized)) continue_flag = FALSE; } if (optimized) string = (_XmString) _XmStringOptCreate(c, end, txtlength, havetag, tag_index); else string = _XmStringNonOptCreate(c, end, havetag); _XmProcessUnlock(); return (string); } _XmStringEntry _XmStringEntryCopy(_XmStringEntry entry) { int i; int size; XtPointer text; _XmStringEntry new_entry = NULL; unsigned int entry_len; if (!entry) return NULL; entry_len = _XmEntryByteCountGet(entry); switch (_XmEntryType(entry)) { case XmSTRING_ENTRY_OPTIMIZED: if (_XmEntryImm(entry)) { if (entry_len > sizeof(XtPointer)) size = sizeof(_XmStringOptSegRec) + entry_len - sizeof(XtPointer); else size = sizeof(_XmStringOptSegRec); new_entry = (_XmStringEntry)XtMalloc(size); memcpy((char *)new_entry, (char *)entry, size); } else { new_entry = (_XmStringEntry)XtMalloc(sizeof(_XmStringOptSegRec)); memcpy((char *)new_entry, (char *)entry, sizeof(_XmStringOptSegRec)); if (_XmEntryPermGet(entry)) { _XmEntryTextSet(new_entry, _XmEntryTextGet(entry)); } else if (entry_len > 0) { text = (XtPointer)XtMalloc(entry_len); memcpy((char *)text, (char *)_XmEntryTextGet(entry), entry_len); _XmEntryTextSet(new_entry, text); } else _XmEntryTextSet(new_entry, NULL); } break; case XmSTRING_ENTRY_ARRAY: { _XmStringNREntry *arr; new_entry = (_XmStringEntry)XtMalloc(sizeof(_XmStringArraySegRec)); memcpy((char *)new_entry, (char *)entry, sizeof(_XmStringArraySegRec)); if (_XmEntrySegmentCount(entry) > 0) { arr = (_XmStringNREntry *)XtMalloc(_XmEntrySegmentCount(entry) * sizeof(_XmStringNREntry)); for (i = 0; i < _XmEntrySegmentCount(entry); i++) arr[i] = (_XmStringNREntry) _XmStringEntryCopy((_XmStringEntry)_XmEntrySegment(entry)[i]); _XmEntrySegment(new_entry) = arr; } else _XmEntrySegment(new_entry) = NULL; } break; case XmSTRING_ENTRY_UNOPTIMIZED: { new_entry = (_XmStringEntry)XtMalloc(sizeof(_XmStringUnoptSegRec)); memcpy((char *)new_entry, (char *)entry, sizeof(_XmStringUnoptSegRec)); if (_XmEntryPermGet(entry)) { _XmEntryTextSet(new_entry, _XmEntryTextGet(entry)); } else if (entry_len > 0) { text = (XtPointer)XtMalloc(entry_len); memcpy((char *)text, (char *)_XmEntryTextGet((_XmStringEntry)entry), entry_len); _XmEntryTextSet(new_entry, text); } else _XmEntryTextSet(new_entry, NULL); if (_XmUnoptSegRendBegins(entry)) { _XmUnoptSegRendBegins(new_entry) = (XmStringTag *)XtMalloc(_XmUnoptSegRendBeginCount(entry) * sizeof(XmStringTag)); for (i = 0; i < _XmUnoptSegRendBeginCount(entry); i++) _XmUnoptSegRendBegins(new_entry)[i] = _XmUnoptSegRendBegins(entry)[i]; } else _XmUnoptSegRendBegins(new_entry) = NULL; if (_XmUnoptSegRendEnds(entry)) { _XmUnoptSegRendEnds(new_entry) = (XmStringTag *)XtMalloc(_XmUnoptSegRendEndCount(entry) * sizeof(XmStringTag)); for (i = 0; i < _XmUnoptSegRendEndCount(entry); i++) _XmUnoptSegRendEnds(new_entry)[i] = _XmUnoptSegRendEnds(entry)[i]; } else _XmUnoptSegRendEnds(new_entry) = NULL; _XmEntryCacheSet(new_entry, NULL); } break; } return(new_entry); } /** Begin macros converted to functions. **/ XmStringTag _XmEntryTag(_XmStringEntry entry) { #if 1 XmStringTag rettag; if (_XmEntryOptimized(entry)) { if (_XmEntryTagIndex(entry) != TAG_INDEX_UNSET) rettag = _XmStringIndexGetTag(_XmEntryTagIndex(entry)); else rettag = NULL; } else rettag = _XmUnoptSegTag(entry); return rettag; #else return (_XmEntryOptimized(entry) ? (_XmEntryTagIndex(entry) != TAG_INDEX_UNSET ? _XmStringIndexGetTag(_XmEntryTagIndex(entry)) : NULL) : _XmUnoptSegTag(entry)); #endif } void _XmEntryTagSet(_XmStringEntry entry, XmStringTag tag) { if (_XmEntryOptimized(entry)) { if (tag == NULL) _XmEntryTagIndex(entry) = TAG_INDEX_UNSET; else _XmEntryTagIndex(entry) = _XmStringIndexCacheTag(tag, XmSTRING_TAG_STRLEN); } else { _XmUnoptSegTag(entry) = tag; } } XmDirection _XmEntryPushGet(_XmStringEntry entry) { return (_XmEntryUnoptimized(entry) ? ((_XmStringEntry)(entry))->unopt_single.push_before : False); } unsigned int _XmEntryByteCountGet(_XmStringEntry entry) { switch (_XmEntryType(entry)) { case XmSTRING_ENTRY_OPTIMIZED: return ((_XmStringEntry)(entry))->single.byte_count; case XmSTRING_ENTRY_ARRAY: return 0; case XmSTRING_ENTRY_UNOPTIMIZED: return _XmUnoptSegByteCount(entry); default: assert(FALSE); return 0; } } void _XmEntryTextSet(_XmStringEntry entry, XtPointer val) { (_XmEntryOptimized(entry) ? (!_XmEntryImm(entry) ? (((_XmStringOptSeg)(entry))->data.text = val) : /* This below is potentially dangerous. This function needs a length parameter, or requires that the byte count is set in the segment. However, to my knowledge, nobody needs this now. But it needs to be looked at.. */ strcpy((char *)((_XmStringOptSeg)(entry))->data.chars, (char *)val)) : (((_XmStringUnoptSeg)(entry))->data.text = val)); } XtPointer _XmEntryTextGet(_XmStringEntry entry) { return(_XmEntryOptimized(entry) ? (!_XmEntryImm(entry) ? ((_XmStringOptSeg)(entry))->data.text : (XtPointer)((_XmStringOptSeg)(entry))->data.chars) : (((_XmStringUnoptSeg)(entry))->data.text)); } unsigned int _XmEntryDirectionGet(_XmStringEntry entry) { return(_XmEntryOptimized(entry) ? ((_XmStringEntry)(entry))->single.str_dir : ((_XmStringEntry)(entry))->unopt_single.str_dir); } void _XmEntryDirectionSet(_XmStringEntry entry, XmDirection val) { (_XmEntryOptimized(entry) ? (((_XmStringEntry)entry)->single.str_dir = val) : (((_XmStringEntry)entry)->unopt_single.str_dir = val)); } unsigned int _XmEntryTextTypeGet(_XmStringEntry entry) { return(_XmEntryOptimized(entry) ? ((_XmStringEntry)(entry))->single.text_type : ((_XmStringEntry)(entry))->unopt_single.text_type); } _XmStringCache _XmEntryCacheGet(_XmStringEntry entry) { return (_XmEntryUnoptimized(entry) ? ((_XmStringUnoptSeg)(entry))->cache : NULL); } unsigned char _XmEntryRendEndCountGet(_XmStringEntry entry) { return(_XmEntryOptimized(entry) ? ((_XmStringEntry)(entry))->single.rend_end : _XmUnoptSegRendEndCount(entry)); } unsigned char _XmEntryRendBeginCountGet(_XmStringEntry entry) { return(_XmEntryOptimized(entry) ? ((_XmStringEntry)(entry))->single.rend_begin : _XmUnoptSegRendBeginCount(entry)); } Boolean _XmEntryPopGet(_XmStringEntry entry) { return (_XmEntryUnoptimized(entry) ? ((_XmStringEntry)(entry))->unopt_single.pop_after : False); } XmStringTag _XmEntryRendEndGet(_XmStringEntry entry, int n) { return((_XmEntryRendEndCountGet(entry) > n) ? (_XmEntryOptimized(entry) ? (_XmEntryRendIndex(entry) != REND_INDEX_UNSET ? _XmStringIndexGetTag(_XmEntryRendIndex(entry)) : NULL) : (((_XmStringUnoptSeg)(entry))->rend_end_tags)[n]) : NULL); } XmStringTag _XmEntryRendBeginGet(_XmStringEntry entry, int n) { return((_XmEntryRendBeginCountGet(entry) > n) ? (_XmEntryOptimized(entry) ? (_XmEntryRendIndex(entry) != REND_INDEX_UNSET ? _XmStringIndexGetTag(_XmEntryRendIndex(entry)) : NULL) : (((_XmStringUnoptSeg)(entry))->rend_begin_tags)[n]) : NULL); } void _XmEntryRendEndSet(_XmStringEntry entry, XmStringTag tag, int n) { int i; if (_XmEntryOptimized(entry)) { if (tag == NULL) { if (_XmEntryRendBeginCountGet(entry) == 0) _XmEntryRendIndex(entry) = REND_INDEX_UNSET; } else { _XmEntryRendIndex(entry) = _XmStringIndexCacheTag(tag, XmSTRING_TAG_STRLEN); } _XmEntryRendEndCountSet(entry, ((tag == NULL) ? 0 : 1)); } else { if (tag == NULL) { if (_XmEntryRendEndCountGet(entry) > n) { for (i = n; i < _XmEntryRendEndCountGet(entry) - 1; i++) _XmUnoptSegRendEnds(entry)[i] = _XmUnoptSegRendEnds(entry)[i+1]; _XmUnoptSegRendEndCount(entry)--; _XmUnoptSegRendEnds(entry)[_XmEntryRendEndCountGet(entry)] = NULL; if (_XmEntryRendEndCountGet(entry) == 0) { XtFree((char *)_XmUnoptSegRendEnds(entry)); _XmUnoptSegRendEnds(entry) = NULL; } } } else { if (n >= _XmUnoptSegRendEndCount(entry)) { n = _XmUnoptSegRendEndCount(entry); _XmUnoptSegRendEndCount(entry)++; _XmUnoptSegRendEnds(entry) = (XmStringTag *)XtRealloc((char *)_XmUnoptSegRendEnds(entry), _XmUnoptSegRendEndCount(entry) * sizeof(XmStringTag)); } _XmUnoptSegRendEnds(entry)[n] = tag; } } } void _XmEntryRendBeginSet(_XmStringEntry entry, XmStringTag tag, int n) { int i; if (_XmEntryOptimized(entry)) { if (tag == NULL) { if (_XmEntryRendEndCountGet(entry) == 0) _XmEntryRendIndex(entry) = REND_INDEX_UNSET; } else { _XmEntryRendIndex(entry) = _XmStringIndexCacheTag(tag, XmSTRING_TAG_STRLEN); } _XmEntryRendBeginCountSet(entry, ((tag == NULL) ? 0 : 1)); } else { if (tag == NULL) { if (_XmEntryRendBeginCountGet(entry) > n) { for (i = n; i < _XmEntryRendBeginCountGet(entry) - 1; i++) _XmUnoptSegRendBegins(entry)[i] = _XmUnoptSegRendBegins(entry)[i+1]; _XmUnoptSegRendBeginCount(entry)--; _XmUnoptSegRendBegins(entry)[_XmEntryRendBeginCountGet(entry)] = NULL; if (_XmEntryRendBeginCountGet(entry) == 0) { XtFree((char *)_XmUnoptSegRendBegins(entry)); _XmUnoptSegRendBegins(entry) = NULL; } } } else { if (n >= _XmUnoptSegRendBeginCount(entry)) { n = _XmUnoptSegRendBeginCount(entry); _XmUnoptSegRendBeginCount(entry)++; _XmUnoptSegRendBegins(entry) = (XmStringTag *)XtRealloc((char *)_XmUnoptSegRendBegins(entry), _XmUnoptSegRendBeginCount(entry) * sizeof(XmStringTag)); } _XmUnoptSegRendBegins(entry)[n] = tag; } } } unsigned char _XmEntryTabsGet(_XmStringEntry entry) { return(_XmEntryOptimized(entry) ? ((_XmStringEntry)(entry))->single.tabs_before : ((_XmStringEntry)(entry))->unopt_single.tabs_before); } /** End macros converted to functions. **/ void _XmStringEntryFree(_XmStringEntry entry) { int i; if (!entry) return; switch (_XmEntryType(entry)) { case XmSTRING_ENTRY_OPTIMIZED: if (!_XmEntryImm(entry) && !_XmEntryPermGet(entry) && _XmEntryTextGet(entry)) XtFree((char *)_XmEntryTextGet(entry)); XtFree((char *)entry); break; case XmSTRING_ENTRY_ARRAY: for (i = 0; i < _XmEntrySegmentCount(entry); i++) _XmStringEntryFree((_XmStringEntry)_XmEntrySegment(entry)[i]); if (_XmEntrySegment(entry)) XtFree((char *)_XmEntrySegment(entry)); XtFree((char *)entry); break; case XmSTRING_ENTRY_UNOPTIMIZED: _XmStringCacheFree(_XmEntryCacheGet(entry)); if (_XmUnoptSegRendBegins(entry)) XtFree((char *)_XmUnoptSegRendBegins(entry)); if (_XmUnoptSegRendEnds(entry)) XtFree((char *)_XmUnoptSegRendEnds(entry)); if (_XmEntryTextGet(entry) && !_XmEntryPermGet(entry)) XtFree((char *)_XmEntryTextGet(entry)); XtFree((char *)entry); break; } } /* * free the XmString internal data structure */ void XmStringFree( XmString string ) { int i; int lcount; _XmProcessLock(); if (!string) { _XmProcessUnlock(); return; } /* Decrement refcount. If not zero, just return. */ if (_XmStrRefCountDec(string) != 0) { _XmProcessUnlock(); return; } if (!_XmStrOptimized(string)) { lcount = _XmStrEntryCount(string); for (i = 0; i < lcount; i++) { _XmStringEntryFree(_XmStrEntry(string)[i]); } XtFree((char *)_XmStrEntry(string)); } _XmStrFree ((char *) string); _XmProcessUnlock(); } static void ComputeMetrics(XmRendition rend, XtPointer text, unsigned int byte_count, XmTextType type, int which_seg, Dimension *width, Dimension *height, Dimension *ascent, Dimension *descent, Boolean utf8) { Dimension wid, hi; int dir, asc, desc; wid = 0; hi = 0; asc = 0; desc = 0; switch (_XmRendFontType(rend)) { case XmFONT_IS_FONT: { XFontStruct *font_struct = (XFontStruct *)_XmRendFont(rend); XCharStruct char_ret; if (two_byte_font(font_struct)) { #ifdef FIX_1434 if (byte_count >= 2 || utf8) #else if (byte_count >= 2) #endif { if (utf8) { /* TODO: it is very unoptimized convert the same sting * twice - for getting extents and drawing */ size_t str_len = 0; XChar2b *str = _XmUtf8ToUcs2(text, byte_count, &str_len); XTextExtents16(font_struct, str, str_len, &dir, &asc, &desc, &char_ret); } else XTextExtents16(font_struct, (XChar2b *)text, Half(byte_count), &dir, &asc, &desc, &char_ret); wid = ComputeWidth(which_seg, char_ret); /* pir 2967 */ if (wid == 0) wid = Half(byte_count) * (font_struct->max_bounds.width); hi = asc + desc; } } else { if (byte_count >= 1) { XTextExtents(font_struct, (char *)text, byte_count, &dir, &asc, &desc, &char_ret); wid = ComputeWidth(which_seg, char_ret); /* pir 2967 */ if (wid == 0) wid = byte_count * (font_struct->max_bounds.width); hi = asc + desc; } } } break; case XmFONT_IS_FONTSET: { if (byte_count >= 1) { XFontSet font_set = (XFontSet)_XmRendFont(rend); XRectangle ink, logical; if (type == XmWIDECHAR_TEXT) XwcTextExtents(font_set, (wchar_t *)text, byte_count/sizeof(wchar_t), &ink, &logical); else { #ifdef UTF8_SUPPORTED if (utf8) Xutf8TextExtents(font_set, (char *)text, byte_count, &ink, &logical); else #endif XmbTextExtents(font_set, (char *)text, byte_count, &ink, &logical); } if (logical.height == 0) { XFontSetExtents *extents = XExtentsOfFontSet(font_set); logical.height = extents->max_logical_extent.height; } wid = logical.width; hi = logical.height; asc = -(logical.y); desc = logical.height + logical.y; } } break; #ifdef USE_XFT case XmFONT_IS_XFT: asc = _XmRendXftFont(rend)->ascent; desc = _XmRendXftFont(rend)->descent; /* FIXME * Following Keith Packard comments it should be * hi = _XmRendXftFont(rend)->height; * but is looking ascent + descent better. Is it a bug? */ hi = asc+desc; { XGlyphInfo info; XftTextExtentsUtf8(_XmRendDisplay(rend), _XmRendXftFont(rend), text, byte_count, &info); wid = info.xOff; } #endif } /* Adjust for underlining. Add one pixel for line and one pixel at bottom so * that line doesn't bleed into background with select color of * XmREVERSED_GROUND_COLORS. */ switch (_XmRendUnderlineType(rend)) { case XmSINGLE_LINE: case XmSINGLE_DASHED_LINE: if (desc < (SINGLE_OFFSET + 2)) { hi += (SINGLE_OFFSET + 2) - desc; desc = SINGLE_OFFSET + 2; } break; case XmDOUBLE_LINE: case XmDOUBLE_DASHED_LINE: if (desc < (DOUBLE_OFFSET + 2)) { hi += (DOUBLE_OFFSET + 2) - desc; desc = DOUBLE_OFFSET + 2; } break; default: break; } if (width != NULL) *width = wid; if (height != NULL) *height = hi; if (ascent != NULL) *ascent = asc; if (descent != NULL) *descent = desc; } static Dimension ComputeWidth(unsigned char which, XCharStruct char_ret) { Dimension wid = 0; int bearing; /* Width of first segment is -leftbearing + width. */ /* Width of last segment is max of width and rightbearing. */ /* Width of single segment is max of width and rightbearing - leftbearing. */ /* Width of all other segments is width. */ switch (which) { case XmSTRING_FIRST_SEG: if (char_ret.lbearing < 0) wid = -(char_ret.lbearing); /* Fall through */ case XmSTRING_MIDDLE_SEG: wid += char_ret.width; break; case XmSTRING_LAST_SEG: wid = ((char_ret.width > char_ret.rbearing) ? char_ret.width : char_ret.rbearing); break; case XmSTRING_SINGLE_SEG: bearing = char_ret.rbearing - char_ret.lbearing; wid = (char_ret.width > bearing) ? char_ret.width : bearing; break; } return(wid); } /**************************************************************** * ****************************************************************/ Boolean _XmStringSegmentExtents(_XmStringEntry entry, XmRenderTable rendertable, XmRendition * rend_in_out, XmRendition base, Dimension * width, Dimension * height, Dimension * ascent, Dimension * descent) { return(SpecifiedSegmentExtents(entry, rendertable, rend_in_out, base, XmSTRING_MIDDLE_SEG, width, height, ascent, descent)); } static Boolean SpecifiedSegmentExtents(_XmStringEntry entry, XmRenderTable rendertable, XmRendition * rend_in_out, XmRendition base, int which_seg, Dimension * width, Dimension * height, Dimension * ascent, Dimension * descent) { unsigned short count; XmStringTag *tags = NULL; unsigned int tag_count =0; Display *d; XmStringTag def_tag; XmStringTag entry_tag; XmRendition rend, cached_rend = NULL, def_rend; int i, j, depth, hits, ref_cnt, rt_ref_cnt; Dimension h, w, asc, dsc; Boolean can_do = TRUE; _XmRendition rend_int; _XmStringRenderingCache render_cache; /* Fetching the cache once and accessing the fields directly saves * substantial time searching the cache */ render_cache = (_XmStringRenderingCache)CacheGet(entry, _XmRENDERING_CACHE, False, (XtPointer)rendertable); if ((render_cache != NULL) && !render_cache->header.dirty) { if (width != NULL) *width = (Dimension)render_cache->width; if (height != NULL) *height = (Dimension)render_cache->height; if (ascent != NULL) *ascent = (Dimension)render_cache->ascent; if (descent != NULL) *descent = (Dimension)render_cache->descent; if (rend_in_out != NULL) *rend_in_out = render_cache->rendition; return True; } else if (rend_in_out == NULL) { if (render_cache != NULL) cached_rend = render_cache->rendition; if (cached_rend == NULL) return(FALSE); else rend_in_out = &cached_rend; } entry_tag = _XmEntryTag(entry); if (cached_rend == NULL) /* Update *rend_in_out. */ { /* Add rendition begins */ d = _XmRendDisplay(*rend_in_out); /* Prepare tags. */ count = _XmEntryRendBeginCountGet(entry); tags = _XmRendTags(*rend_in_out); tag_count = _XmRendTagCount(*rend_in_out); /* Update tag stack. */ if (count > 0) { tags = (XmStringTag *)XtRealloc((char *)tags, (sizeof(XmStringTag) * (tag_count + count))); for (i = 0; i < count; i++) tags[tag_count + i] = _XmEntryRendBeginGet(entry, i); tag_count += count; } /* compute rendition */ /* Find font as per I 198. */ /* 1. Find font from rendition tags. */ /* 2. Find font from locale/charset tag. */ if ((_XmRendTag(*rend_in_out) != entry_tag) || (count != 0) || _XmRendHadEnds(*rend_in_out)) { *rend_in_out = _XmRenditionMerge(d, rend_in_out, base, rendertable, entry_tag, tags, tag_count, (render_cache != NULL)); _XmRendTag(*rend_in_out) = entry_tag; } /* 3. Default rendition. */ if (_XmRendFont(*rend_in_out) == NULL && _XmRendXftFont(*rend_in_out) == NULL) { def_tag = ((_XmEntryTextTypeGet(entry) == XmCHARSET_TEXT) ? XmFONTLIST_DEFAULT_TAG : _MOTIF_DEFAULT_LOCALE); rend = _XmRenditionMerge(d, rend_in_out, base, rendertable, def_tag, NULL, 0, (render_cache != NULL)); if ((rend != NULL) && (_XmRendFont(rend) == NULL) && (_XmRendXftFont(rend) == NULL) && ((def_rend = _XmRenderTableFindRendition(rendertable, def_tag, TRUE, FALSE, FALSE, NULL)) != NULL)) /* Call noFontCallback. */ { XmDisplay dsp; XmDisplayCallbackStruct cb; rt_ref_cnt = _XmRTRefcount(rendertable); def_rend = _XmRTRenditions(rendertable)[0]; rend_int = *def_rend; ref_cnt = _XmRendRefcount(def_rend); dsp = (XmDisplay)XmGetXmDisplay(d); cb.reason = XmCR_NO_FONT; cb.event = NULL; cb.rendition = def_rend; cb.font_name = XmS; XtCallCallbackList((Widget)dsp, dsp->display.noFontCallback, &cb); if (rend_int != *def_rend) /* Changed in callback. */ { /* Need to split ref counts. */ _XmRendRefcount(&rend_int) = ref_cnt - rt_ref_cnt; _XmRendRefcount(def_rend) = rt_ref_cnt; } if (_XmRendFont(def_rend) != NULL) { _XmRendFontType(rend) = _XmRendFontType(def_rend); _XmRendFont(rend) = _XmRendFont(def_rend); } #ifdef USE_XFT else if (_XmRendXftFont(def_rend) != NULL) { _XmRendFontType(rend) = _XmRendFontType(def_rend); _XmRendXftFont(rend) = _XmRendXftFont(def_rend); } #endif else rend = NULL; } /* 4a. Take the first one */ if ((rend == NULL) && ((_XmEntryTextTypeGet(entry) == XmCHARSET_TEXT) || ((_XmEntryTextTypeGet(entry) == XmMULTIBYTE_TEXT) && (entry_tag == XmFONTLIST_DEFAULT_TAG))) && (rendertable != NULL) && (_XmRTCount(rendertable) > 0)) rend = _XmRenditionMerge(d, rend_in_out, base, rendertable, NULL, NULL, 0, (render_cache != NULL)); if ((rend != NULL) && (_XmRendFont(rend) == NULL) && (_XmRendXftFont(rend) == NULL)) /* Call noFontCallback. */ { XmDisplay dsp; XmDisplayCallbackStruct cb; rt_ref_cnt = _XmRTRefcount(rendertable); def_rend = _XmRTRenditions(rendertable)[0]; rend_int = *def_rend; ref_cnt = _XmRendRefcount(def_rend); dsp = (XmDisplay)XmGetXmDisplay(d); cb.reason = XmCR_NO_FONT; cb.event = NULL; cb.rendition = def_rend; cb.font_name = XmS; XtCallCallbackList((Widget)dsp, dsp->display.noFontCallback, &cb); if (rend_int != *def_rend) /* Changed in callback. */ { /* Need to split ref counts. */ _XmRendRefcount(&rend_int) = ref_cnt - rt_ref_cnt; _XmRendRefcount(def_rend) = rt_ref_cnt; } if (_XmRendFont(def_rend) != NULL) { _XmRendFontType(rend) = _XmRendFontType(def_rend); _XmRendFont(rend) = _XmRendFont(def_rend); } #ifdef USE_XFT else if (_XmRendXftFont(def_rend) != NULL) { _XmRendFontType(rend) = _XmRendFontType(def_rend); _XmRendXftFont(rend) = _XmRendXftFont(def_rend); } #endif else rend = NULL; } /* 4b/5a. Emit warning and don't render. */ if ((rend == NULL) || (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL)) { /* No warning if no tags, e.g. just dir component. */ if ((tag_count > 0) || (entry_tag != NULL)) XmeWarning(NULL, NO_FONT_MSG); if (width != NULL) { *width = 0; if (render_cache) render_cache->width = 0; } if (height != NULL) { *height = 0; if (render_cache) render_cache->height = 0; } if (ascent != NULL) { *ascent = 0; if (render_cache) render_cache->ascent = 0; } if (descent != NULL) { *descent = 0; if (render_cache) render_cache->descent = 0; } can_do = FALSE; } } } if (can_do) { /* compute width & height */ ComputeMetrics(*rend_in_out, _XmEntryTextGet(entry), _XmEntryByteCountGet(entry), (XmTextType) _XmEntryTextTypeGet(entry), which_seg, &w, &h, &asc, &dsc, #ifdef UTF8_SUPPORTED _XmEntryType(entry) == XmCHARSET_TEXT && (_XmEntryTag(entry) == XmFONTLIST_DEFAULT_TAG && (_XmStringIsCurrentCharset("UTF-8") || (_XmEntryTagIndex(entry) != TAG_INDEX_UNSET && strcmp(_XmEntryTag(entry), "UTF-8") == 0))) #else False #endif ); /* If cache exists, set it. */ if (render_cache != NULL) { if (width != NULL) render_cache->width = w; if (height != NULL) render_cache->height = h; if (ascent != NULL) render_cache->ascent = asc; if (descent != NULL) render_cache->descent = dsc; render_cache->rendition = *rend_in_out; render_cache->header.dirty = False; } if (width != NULL) *width = w; if (height != NULL) *height = h; if (ascent != NULL) *ascent = asc; if (descent != NULL) *descent = dsc; } if (cached_rend == NULL) /* Update *rend_in_out */ { /* Remove rendition ends. */ count = _XmEntryRendEndCountGet(entry); if (count > 0) { depth = tag_count; hits = 0; for (i = 0; i < count; i++) for (j = (tag_count - 1); j >= 0; j--) if (_XmEntryRendEndGet(entry, i) == (tags)[j]) { tags[j] = NULL; depth = j; hits++; break; } j = depth; for (i = (depth + 1); i < tag_count; i++) if (tags[i] != NULL) { tags[j] = tags[i]; j++; } if(tags != NULL && tag_count - hits) tags = (XmStringTag *)XtRealloc((char *)tags, (sizeof(XmStringTag) * (tag_count - hits))); tag_count -= hits; _XmRendHadEnds(*rend_in_out) = TRUE; } else { _XmRendHadEnds(*rend_in_out) = FALSE; } _XmRendTagCount(*rend_in_out) = tag_count; _XmRendTags(*rend_in_out) = tags; } return(can_do); } static void _parse_locale( char *str, int *indx, int *len ) { char *temp; int start; int end; /* * Set the return variables to zero. If we find what we're looking * for, we reset them. */ *indx = 0; *len = 0; /* * The format of the locale string is: * language[_territory[.codeset]] */ temp = str; end = 0; while ((temp[end] != '.') && (temp[end] != 0)) end++; if (temp[end] == '.') { start = end + 1; *indx = start; end = start; while (temp[end] != 0) end++; *len = end - start; } } /* This function returns current default charset being used. This is */ /* determined from the value of the $LANG environment variable or */ /* XmFALLBACK_CHARSET. */ char * _XmStringGetCurrentCharset( void ) { char *str; char *ptr; int chlen; int indx; int len; char *ret_val; _XmProcessLock(); if (!locale.inited) { locale.tag = NULL; locale.taglen = 0; str = (char *)getenv(env_variable); if (str) { _parse_locale(str, &indx, &chlen); if (chlen > 0) { ptr = &str[indx]; len = chlen; } else { len = strlen(XmFALLBACK_CHARSET); ptr = XmFALLBACK_CHARSET; } } else { len = strlen(XmFALLBACK_CHARSET); ptr = XmFALLBACK_CHARSET; } locale.tag = (char *) XtMalloc(len + 1); strncpy(locale.tag, ptr, len); locale.tag[len] = '\0'; locale.taglen = len; /* Register XmSTRING_DEFAULT_CHARSET for compound text conversion. */ XmRegisterSegmentEncoding(XmSTRING_DEFAULT_CHARSET, XmFONTLIST_DEFAULT_TAG); locale.inited = TRUE; } ret_val = locale.tag; _XmProcessUnlock(); return (ret_val); } /* This function compares a given charset to the current default charset being used. It return TRUE if they match, FALSE otherwise. */ Boolean _XmStringIsCurrentCharset( XmStringCharSet c ) { return (strcmp(c, _XmStringGetCurrentCharset()) == 0); } /* * copy a refcounted string */ XmString XmStringCopy( XmString string ) { _XmProcessLock(); if (string == NULL) { _XmProcessUnlock(); return((XmString)NULL); } /* If the refcount wraps around, have to make clone, otherwise just return. */ if (_XmStrRefCountInc(string) != 0) { _XmProcessUnlock(); return(string); } else { XmString ret_val; _XmStrRefCountDec(string); ret_val = Clone(string, _XmStrEntryCountGet(string)); _XmProcessUnlock(); return ret_val; } } /* * duplicate structure of an internal string */ static XmString Clone(XmString string, int lines) { XmString new_string; if (_XmStrOptimized(string)) { _XmStringOpt n_o_string = (_XmStringOpt) _XmStrMalloc(sizeof(_XmStringOptRec) + _XmStrByteCount(string) - TEXT_BYTES_IN_STRUCT); memcpy(n_o_string, string, sizeof(_XmStringOptRec) + _XmStrByteCount(string) - TEXT_BYTES_IN_STRUCT) ; new_string = (XmString)n_o_string; } else { int i; _XmString n_string; _XmStrCreate(n_string, XmSTRING_MULTIPLE_ENTRY, 0); _XmStrImplicitLine(n_string) = _XmStrImplicitLine(string); _XmStrEntryCount(n_string) = _XmStrEntryCount(string); _XmStrEntry(n_string) = (_XmStringEntry *) XtMalloc(sizeof(_XmStringEntry) * lines); for (i = 0; i < _XmStrEntryCount(string); i++) _XmStrEntry(n_string)[i] = _XmStringEntryCopy(_XmStrEntry(string)[i]); for (i = _XmStrEntryCount(string); i < lines; i++) _XmStrEntry(n_string)[i] = NULL; new_string = (XmString)n_string; } _XmStrRefCountSet(new_string, 1); return(new_string); } /* * Given a string in ASN.1 format, return the size of the * string, including the header. */ unsigned int XmStringByteStreamLength(unsigned char *string) { unsigned int len; _XmProcessLock(); len = _read_string_length( string ); len += _calc_header_size(len); _XmProcessUnlock(); return (len); } /* * build the ASN.1 format given an XmString. * This makes a pass to figure out how big it * needs to be and builds the ASN.1 string in-place. * If prop_return is NULL, just computes size. */ unsigned int XmCvtXmStringToByteStream(XmString string, unsigned char **prop_return) { /* Using XmeStringGetComponent makes this almost trivial. */ _XmStringContextRec stack_context; unsigned int length; XtPointer value; unsigned int len; unsigned int str_len; unsigned char *ext; XmStringComponentType tag; _XmProcessLock(); if (!string) { if (prop_return != NULL) *prop_return = NULL; _XmProcessUnlock(); return(0); } _XmStringContextReInit(&stack_context, string); /* Compute size */ len = 0; while (XmeStringGetComponent(&stack_context, TRUE, FALSE, &length, &value) != XmSTRING_COMPONENT_END) len += _asn1_size(length) + length; str_len = len; len += _calc_header_size(len); _XmStringContextFree(&stack_context); /* We're just computing size. */ if (prop_return == NULL) { _XmProcessUnlock(); return(len); } /* Allocate. */ ext = (unsigned char *)XtMalloc(len); *prop_return = ext; /* Write components. */ ext = _write_header(ext, str_len); _XmStringContextReInit(&stack_context, string); while ((tag = XmeStringGetComponent(&stack_context, TRUE, FALSE, &length, &value)) != XmSTRING_COMPONENT_END) ext = _write_component(ext, tag, length, (unsigned char *)value, TRUE); _XmStringContextFree(&stack_context); _XmProcessUnlock(); return(len); } Dimension XmStringBaseline( XmRenderTable rendertable, XmString string ) { Dimension width, height, asc = 0, desc; _XmRenditionRec scratch; _XmRendition tmp; XmRendition rend; _XmStringEntry line; _XmStringArraySegRec array_seg; Display *d; XtAppContext app = NULL; if ((rendertable == NULL) || (string == NULL)) return(0); #ifdef XTHREADS if (_XmRTDisplay(rendertable)) app = XtDisplayToApplicationContext(_XmRTDisplay(rendertable)); if (app) { _XmAppLock(app); } else { _XmProcessLock(); } #endif bzero((char*) &scratch, sizeof(_XmRenditionRec)); tmp = &scratch; rend = &tmp; /* Initialize for tabs. */ d = (_XmRTDisplay(rendertable) == NULL) ? _XmGetDefaultDisplay() : _XmRTDisplay(rendertable); _XmRendDisplay(rend) = d; _XmStringLayout(string, XmLEFT_TO_RIGHT); if (!_XmStrOptimized(string)) { if (_XmStrImplicitLine(string)) line = _XmStrEntry(string)[0]; else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(string); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(string); line = (_XmStringEntry)&array_seg; } LineMetrics(line, rendertable, &rend, NULL, XmLEFT_TO_RIGHT, &width, &height, &asc, &desc); if (app) { _XmAppUnlock(app); } else { _XmProcessUnlock(); } return(asc); } else { if (app) { _XmAppUnlock(app); } else { _XmProcessUnlock(); } return (OptLineAscender(rendertable, (_XmStringOpt)string)); } } void _XmStringGetBaselines(XmRenderTable rendertable, _XmString string, Dimension **baselines, Cardinal *line_count) { /* Initialize the return values. */ *baselines = NULL; *line_count = 0; if (rendertable && string) *line_count = XmStringLineCount(string); if (*line_count == 1) { *baselines = (Dimension*) XtMalloc(*line_count * sizeof(Dimension)); (*baselines)[0] = XmStringBaseline(rendertable, string); } else if (*line_count > 1) { Cardinal line_num; Dimension offset; Dimension prev_height; Dimension width, height, asc, desc; _XmRenditionRec scratch; _XmRendition tmp = &scratch; XmRendition rend = &tmp; _XmStringArraySegRec array_seg; *baselines = (Dimension*) XtMalloc(*line_count * sizeof(Dimension)); /* Initialize the scratch rendition for tabs. */ bzero((char*) &scratch, sizeof(_XmRenditionRec)); _XmRendDisplay(rend) = ((_XmRTDisplay(rendertable) == NULL) ? _XmGetDefaultDisplay() : _XmRTDisplay(rendertable)); _XmStringLayout(string, XmLEFT_TO_RIGHT); offset = prev_height = 0; for (line_num = 0; line_num < *line_count; line_num++) { _XmStringEntry line; if (_XmStrImplicitLine(string)) line = _XmStrEntry(string)[line_num]; else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(string); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(string); line = (_XmStringEntry)&array_seg; } LineMetrics(line, rendertable, &rend, NULL, XmLEFT_TO_RIGHT, &width, &height, &asc, &desc); /* Treat empty lines as the same height as the previous line. */ if (height) prev_height = height; (*baselines)[line_num] = offset + asc; offset += prev_height; } } } /* * count the number of lines in an XmString. */ int XmStringLineCount( XmString string ) { int ret_val; _XmProcessLock(); if ((string == NULL)) { _XmProcessUnlock(); return(0); } if (_XmStrOptimized(string)) { _XmProcessUnlock(); return( 1) ; } ret_val = (int) _XmStrLineCountGet(string) ; _XmProcessUnlock(); return ret_val; } /* * drawing routine for external TCS */ void XmStringDraw( Display *d, Window w, XmRenderTable rendertable, XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip ) { _XmDisplayToAppContext(d); _XmAppLock(app); if (string) _draw (d, w, rendertable, (_XmString)string, gc, x, y, width, align, lay_dir, clip, FALSE, NULL); _XmAppUnlock(app); } void XmStringDrawImage( Display *d, Window w, XmRenderTable rendertable, XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip ) { _XmDisplayToAppContext(d); _XmAppLock(app); if (string) _draw (d, w, rendertable, (_XmString)string, gc, x, y, width, align, lay_dir, clip, TRUE, NULL); _XmAppUnlock(app); } void XmStringDrawUnderline( Display *d, Window w, XmRenderTable fntlst, XmString str, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, XmString under ) { _XmDisplayToAppContext(d); _XmAppLock(app); if (str) _draw (d, w, fntlst, (_XmString)str, gc, x, y, width, align, lay_dir, clip, FALSE, (_XmString)under); _XmAppUnlock(app); } #ifdef _XmDEBUG_XMSTRING void _Xm_dump_stream( unsigned char *cs ) { unsigned char *c; unsigned char *end; int k; if (_is_asn1(cs)) { printf ("Compound string\n"); printf ("overall length = %d\n", _read_string_length(cs)); c = _read_header(cs); } else { printf ("Not a compound string\n"); return; } c = (unsigned char *) cs; end = c + _read_string_length (c) + _read_header_length(c); while (c < end) { unsigned short length = _read_asn1_length (c); switch (*c) { case XmSTRING_COMPONENT_CHARSET: case XmSTRING_COMPONENT_LOCALE: if (*c == XmSTRING_COMPONENT_LOCALE) printf ("\tLocale name component\n"); else printf ("\tCharacter set component\n"); printf ("\tlength = %d\n", length); printf ("\tvalue = <"); for (k=0; k\n"); c += length + _asn1_size(length); break; case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: if (*c == XmSTRING_COMPONENT_TEXT) printf ("\tText component\n"); else printf ("\tLocalized text component\n"); printf ("\tlength = %d\n", length); printf ("\tvalue = <"); for (k=0; k\n"); c += length + _asn1_size(length); break; case XmSTRING_COMPONENT_WIDECHAR_TEXT: printf ("\tWide char text component\n"); printf ("\tlength = %d\n", length); printf ("\tvalue = <"); for (k=0; k\n"); c += length + _asn1_size(length); break; case XmSTRING_COMPONENT_DIRECTION: /* record dir */ printf ("\tDirection component\n"); printf ("\tlength = %d\n", length); printf ("\tvalue = %d\n", *(c + _asn1_size(length))); c += length + _asn1_size(length); break; case XmSTRING_COMPONENT_SEPARATOR: /* start new line */ printf ("\tSeparator component\n"); printf ("\tlength = %d\n", length); c += length + _asn1_size(length); break; default: printf ("\tUnknown component\n"); printf ("\tlength = %d\n", length); printf ("\tvalue = <"); for (k=0; k\n", _XmStrRendIndex(string), (_XmStrRendTagGet(string) ? _XmStrRendTagGet(string) : "(unset)")); printf ("\t tab_before = %4d\n", _XmStrTabs(string)); printf ("\t refcount = %4d\n", _XmStrRefCountGet(string)); printf ("\t char count = %4d\n", _XmStrByteCount(string)); printf ("\t text = <"); for (k=0; k<_XmStrByteCount(string); k++) printf ("%c", _XmStrText(string)[k]); printf (">\n"); } else { _XmStringEntry line; int line_count; _XmStringEntry seg; int seg_count; _XmStringArraySegRec array_seg; line_count = _XmStrLineCountGet(string); printf ("string with %d lines\n", line_count); for (i = 0; i < line_count; i++) { if (_XmStrImplicitLine(string)) { line = _XmStrEntry(string)[i]; } else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(string); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(string); line = (_XmStringEntry)&array_seg; } if (_XmEntryMultiple(line)) seg_count = _XmEntrySegmentCount(line); else seg_count = 1; printf ("\tline [%d] has %d segments\n", i, seg_count); for (j = 0; j < seg_count; j++) { if (_XmEntryMultiple(line)) seg = (_XmStringEntry)_XmEntrySegment(line)[j]; else seg = line; printf ("\t segment [%d]\n", j); if (seg == NULL) { printf ("\t\tNULL?\n"); continue; } printf ("\t\ttype = %d (%s)\n", _XmEntryType(seg), entry_type_image(_XmEntryType(seg))); printf ("\t\tpush before = %d \n", _XmEntryPushGet(seg)); printf ("\t\trend_begin_tags = (%d)\n", _XmEntryRendBeginCountGet(seg)); for (k=0; k<_XmEntryRendBeginCountGet(seg); k++) printf ("\t\t %4d <%s>\n", _XmStringIndexCacheTag(_XmEntryRendBeginGet(seg,k), XmSTRING_TAG_STRLEN), _XmEntryRendBeginGet(seg,k)); printf ("\t\ttag = <%s>\n", _XmEntryTag(seg)); printf ("\t\ttabs = %d\n", _XmEntryTabsGet(seg)); printf ("\t\tdirection = %d\n", _XmEntryDirectionGet(seg)); printf ("\t\ttext type = %d (%s)\n", _XmEntryTextTypeGet(seg), type_image(_XmEntryTextTypeGet(seg))); printf ("\t\ttext = <"); for (k=0; k<_XmEntryByteCountGet(seg); k++) printf ("%c", ((char *)_XmEntryTextGet(seg))[k]); printf (">\n"); printf ("\t\tbyte count = %d\n", _XmEntryByteCountGet(seg)); printf ("\t\trend_end_tags = (%d)\n", _XmEntryRendEndCountGet(seg)); for (k=0; k<_XmEntryRendEndCountGet(seg); k++) printf ("\t\t %4d <%s>\n", _XmStringIndexCacheTag(_XmEntryRendEndGet(seg,k), XmSTRING_TAG_STRLEN), _XmEntryRendEndGet(seg,k)); printf ("\t\tpop after = %d \n", _XmEntryPopGet(seg)); } } } printf("\n\n"); } #endif /* _XmDEBUG_XMSTRING */ /**************************************************************** * _XmStringGetTextConcat: * Note: at some point this could be reimplemented as two pass * process to eliminate calls to XtRealloc. ****************************************************************/ char * _XmStringGetTextConcat( XmString string) { _XmStringContextRec stack_context; XmStringComponentType type ; unsigned int len ; XtPointer val ; size_t OldLen ; size_t OutLen = 0 ; char * OutStr = NULL ; if (string) { _XmStringContextReInit(&stack_context, string); while((type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END) { switch( type) { case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: OldLen = OutLen; OutLen += len; OutStr = XtRealloc( OutStr, OutLen + 1) ; memcpy( &OutStr[OldLen], (char *)val, len) ; OutStr[OutLen] = '\0'; break ; default: break ; } } _XmStringContextFree(&stack_context); } return( OutStr) ; } /**************************************************************** * Allocates a copy of the text and character set of the specified XmString * if the XmString is composed of a single segment. * Returns TRUE if str is a single segment, FALSE otherwise. * If TRUE, pTextOut is valid; if FALSE, pTextOut and pTagOut are NULL. ****************/ Boolean _XmStringSingleSegment( XmString str, char **pTextOut, XmStringTag *pTagOut ) { _XmStringContextRec stack_context ; Boolean retVal; unsigned int len; XtPointer val; XmStringComponentType type; /* Initialize the return parameters. */ retVal = FALSE; *pTextOut = NULL; *pTagOut = NULL; if (str) { _XmStringContextReInit(&stack_context, str); /** Get the first tag and text. **/ /* Peak ahead and only copy tag or text. */ while ((type = XmeStringGetComponent(&stack_context, FALSE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END) { switch (type) { case XmSTRING_COMPONENT_TAG: case XmSTRING_COMPONENT_LOCALE: XmeStringGetComponent(&stack_context, TRUE, TRUE, &len, &val); XtFree((char *)*pTagOut); *pTagOut = (XmStringTag)val; break; case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: XmeStringGetComponent(&stack_context, TRUE, TRUE, &len, &val); retVal = TRUE; *pTextOut = (char *)val; if (type == XmSTRING_COMPONENT_LOCALE_TEXT) { XtFree((char *)*pTagOut); *pTagOut = (XmStringTag)XtNewString(XmFONTLIST_DEFAULT_TAG); } /* Make sure there are no more segments. */ while ((type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END) switch (type) { /* These are all okay */ case XmSTRING_COMPONENT_RENDITION_END: case XmSTRING_COMPONENT_LAYOUT_POP: case XmSTRING_COMPONENT_SEPARATOR: break; /* Anything else is a second segment. */ default: retVal = FALSE; continue; } continue; /* Advance the context. */ default: XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val); break; } } _XmStringContextFree(&stack_context); } if (!retVal) { XtFree(*pTextOut); XtFree((char *)*pTagOut); *pTextOut = NULL; *pTagOut = NULL; } return retVal; } /**************************************************************************** *** *** *** This next function SUPERCEDES UpdateWMShellTitle() in BulletinB.c! *** *** REMOVE other copy and reuse for 1.2.1! *** *** *** ****************************************************************************/ #define STRING_CHARSET "ISO8859-1" void XmeSetWMShellTitle( XmString xmstr, Widget shell) { char * text = (char*) NULL; XmStringTag tag = (XmStringTag) NULL; Arg al[10] ; Cardinal ac ; XrmValue from ; Atom encoding = None; XrmValue to ; _XmWidgetToAppContext(shell); _XmAppLock(app); /* Set WMShell title (if present). */ if( XtIsWMShell( shell) ) { /* Shell is a Window Manager Shell, so set WMShell title * from XmNdialogTitle. */ text = NULL ; ac = 0 ; if (_XmStringSingleSegment(xmstr, &text, &tag)) { if ((tag != NULL) && (strcmp(STRING_CHARSET, tag) == 0)) { /* dialog_title is a single segment of charset STRING_CHARSET, * so use atom of "STRING". Otherwise, convert to compound * text and use atom of "COMPOUND_TEXT". */ XtFree( (char *) tag) ; encoding = XA_STRING; } else if ((tag != NULL) && (strcmp(XmFONTLIST_DEFAULT_TAG, tag) == 0)) { /* dialog_title locale encoded so use constant of None */ XtFree((char *)tag); encoding = None; } else { /* Don't need this, since dialog_title will be converted from * original XmString to compound text. */ if (tag != NULL) XtFree( (char *) tag) ; XtFree( (char *) text) ; text = NULL ; } } if (!text) { from.addr = (char *) xmstr; if( XmCvtXmStringToText( XtDisplay( shell), NULL, NULL, &from, &to, NULL) ) { text = to.addr ; encoding = XInternAtom(XtDisplay(shell), XmSCOMPOUND_TEXT, FALSE); } } if( text ) { XtSetArg( al[ac], XtNtitle, text) ; ++ac ; XtSetArg( al[ac], XtNtitleEncoding, encoding) ; ++ac ; XtSetArg( al[ac], XtNiconName, text) ; ++ac ; XtSetArg( al[ac], XtNiconNameEncoding, encoding) ; ++ac ; XtSetValues( shell, al, ac) ; XtFree( (char *) text) ; } } _XmAppUnlock(app); } /* * XmeGetDirection: An XmParseProc to insert a direction component. * Does not consume the triggering character. */ /*ARGSUSED*/ XmIncludeStatus XmeGetDirection(XtPointer *in_out, XtPointer text_end, /* unused */ XmTextType type, XmStringTag tag, XmParseMapping entry, /* unused */ int pattern_length, /* unused */ XmString *str_include, XtPointer call_data) /* unused */ { XmCharDirectionProc char_proc = _XmOSGetCharDirection; XmStringDirection dir; (void) XmOSGetMethod(NULL, XmMCharDirection, (XtPointer *)&char_proc, NULL); /* Create a component for the new direction. */ dir = XmDirectionToStringDirection((*char_proc)(*in_out, type, tag)); *str_include = XmStringComponentCreate(XmSTRING_COMPONENT_DIRECTION, sizeof (dir), (XtPointer) &dir); /* Don't consume the triggering character. */ return XmINSERT; } /* * match_pattern: A helper for XmStringParseText. Determine whether * the text matches a XmParseMapping pattern. */ /*ARGSUSED*/ static Boolean match_pattern(XtPointer text, XmStringTag tag, /* unused */ XmTextType type, XmParseMapping pattern, int char_len, Boolean dir_change) { if (pattern == NULL) { return False; } else if (pattern->pattern == XmDIRECTION_CHANGE) { return dir_change; } else if ((pattern->pattern_type == XmWIDECHAR_TEXT) && (type == XmWIDECHAR_TEXT)) { /* Compare wchar_t text to wchar_t pattern. */ return (*((wchar_t*) text) == *((wchar_t*) pattern->pattern)); } else if (type == XmWIDECHAR_TEXT) { /* Compare wchar_t text to a mbs pattern. */ char mb_text[MB_LEN_MAX]; wctomb(mb_text, (wchar_t) '\0'); wctomb(mb_text, *((wchar_t*)text)); return !strncmp(mb_text, (char*) pattern->pattern, char_len); } else if (pattern->pattern_type == XmWIDECHAR_TEXT) { /* Compare mbs text to wchar_t pattern. */ char mb_pattern[MB_LEN_MAX]; wctomb(mb_pattern, (wchar_t) '\0'); wctomb(mb_pattern, *((wchar_t*)pattern->pattern)); return !strncmp((char*) text, mb_pattern, char_len); } else if (strlen((char*) pattern->pattern) == char_len) { /* The normal case: mbs text and pattern. */ return !strncmp((char*) text, (char*) pattern->pattern, char_len); } return False; } /* * parse_unmatched: A Helper routine for XmStringParseText. Produce * a component for characters that weren't matched by any pattern. */ static void parse_unmatched(XmString *result, char **ptr, XmTextType text_type, int length) { /* Insert length bytes from ptr into result, and update ptr. */ XmString tmp_1, tmp_2; XmStringComponentType ctype; /* Do nothing if there are no unmatched bytes. */ if (length <= 0) return; /* Choose a component type. */ switch (text_type) { case XmCHARSET_TEXT: ctype = XmSTRING_COMPONENT_TEXT; break; case XmMULTIBYTE_TEXT: ctype = XmSTRING_COMPONENT_LOCALE_TEXT; break; case XmWIDECHAR_TEXT: ctype = XmSTRING_COMPONENT_WIDECHAR_TEXT; break; default: return; } /* Can't concat without copying both strings? */ tmp_1 = *result; tmp_2 = XmStringComponentCreate(ctype, length, (XtPointer) *ptr); if (tmp_2 == NULL) return; *result = XmStringConcatAndFree(tmp_1, tmp_2); *ptr += length; } /* * parse_pattern: A helper routine for XmStringParseText. Process a * pattern that has matched. */ static Boolean parse_pattern(XmString *result, char **ptr, XtPointer text_end, XmStringTag tag, XmTextType type, XmParseMapping pat, int length, XtPointer call_data, Boolean *terminate) { /* Process a matched pattern. Return True if ptr is updated. */ char* orig_ptr = *ptr; XmIncludeStatus action = pat->include_status; XmString insertion = NULL; /* Compute the action and insertion. */ if (action == XmINVOKE) { /* Resolve parse procs. */ if (pat->parse_proc) action = (pat->parse_proc) ((XtPointer*) ptr, text_end, type, tag, pat, length, &insertion, call_data); /* Recursive parse procs are not supported. */ if (action == XmINVOKE) { *ptr = orig_ptr; XmStringFree (insertion); return False; } } else { /* Non-parse_procs always advance the pointer and terminate matching. */ *ptr += length; insertion = XmStringCopy(pat->substitute); } /* Insert the substitution. */ switch (action) { case XmTERMINATE: *terminate = True; /* Fall through. */ case XmINSERT: if (insertion != NULL) *result = XmStringConcatAndFree(*result, insertion); break; default: /* Ignore substitution string. */ XmStringFree(insertion); break; } /* Advancing the pointer prevents multiple matches. */ return (*ptr != orig_ptr); } XmString XmStringParseText(XtPointer text, XtPointer *text_end, XmStringTag tag, XmTextType type, XmParseTable parse_table, Cardinal parse_count, XtPointer call_data) { /* This routine needs to be reentrant so application supplied */ /* XmParseProcs can make recursive calls. */ static XmParseMapping default_dir_pattern = NULL; char* ptr = (char*) text; char* prev_ptr = ptr; XtPointer end_ptr = (text_end ? *text_end : NULL); XmString result; Boolean has_dir_pattern; Boolean wide_char = False; Boolean advanced; Boolean halt; unsigned int index; char* dir_ptr; XmStringComponentType tag_type; XmInitialDirectionProc init_char_proc = _XmOSGetInitialCharsDirection; _XmProcessLock(); /* Check some error conditions. */ if (parse_count && !parse_table) { _XmProcessUnlock(); return NULL; } if (!text) { _XmProcessUnlock(); return NULL; } /* Validate the tag and set the tag_type. */ switch (type) { case XmCHARSET_TEXT: if (tag == NULL) tag = XmFONTLIST_DEFAULT_TAG; tag_type = XmSTRING_COMPONENT_CHARSET; break; case XmWIDECHAR_TEXT: wide_char = True; /* Fall through */ case XmMULTIBYTE_TEXT: /* Non-NULL values (except _MOTIF_DEFAULT_LOCALE) are not accepted in Motif 2.0. */ if ((tag != NULL) && (strcmp(tag, _MOTIF_DEFAULT_LOCALE) != 0)) { _XmProcessUnlock(); return NULL; } if (tag == NULL) tag = _MOTIF_DEFAULT_LOCALE; tag_type = XmSTRING_COMPONENT_LOCALE; break; default: /* Error: bad text type. */ _XmProcessUnlock(); return NULL; } /* Create an empty segment with the right tag. */ result = XmStringComponentCreate(tag_type, strlen(tag), (XtPointer) tag); /* Did the user provide an XmDIRECTION_CHANGE pattern? */ has_dir_pattern = False; for (index = 0; (index < parse_count) && !has_dir_pattern; index++) has_dir_pattern = (parse_table[index]->pattern == XmDIRECTION_CHANGE); if (!has_dir_pattern && !default_dir_pattern) { /* Create a default direction pattern. */ Arg args[10]; Cardinal nargs = 0; XtSetArg(args[nargs], XmNincludeStatus, XmINVOKE), nargs++; XtSetArg(args[nargs], XmNinvokeParseProc, XmeGetDirection), nargs++; XtSetArg(args[nargs], XmNpattern, XmDIRECTION_CHANGE), nargs++; assert(nargs < XtNumber(args)); default_dir_pattern = XmParseMappingCreate(args, nargs); } /* Process characters until text has been consumed. */ dir_ptr = NULL; (void) mblen((char*) NULL, MB_CUR_MAX); (void) XmOSGetMethod(NULL, XmMInitialCharsDirection, (XtPointer *)&init_char_proc, NULL); halt = (end_ptr && (ptr >= (char*) end_ptr)); while (!halt && (wide_char ? *((wchar_t*) ptr) : *ptr)) { #ifndef NO_MULTIBYTE int len = (wide_char ? sizeof(wchar_t) : mblen(ptr, MB_CUR_MAX)); #else int len = (wide_char ? sizeof(wchar_t) : 1); #endif advanced = False; /* If we have an invalid character, treat it as a single byte. */ if (len < 0) len = 1; /* Reset dir_ptr if the input text has changed directions. */ if (ptr > dir_ptr) { XmDirection xm_dir; if ((*init_char_proc)((XtPointer) ptr, type, tag, &index, &xm_dir) == Success) dir_ptr = ptr + index; } /* Match against an implicit XmDIRECTION_CHANGE pattern. */ if (!has_dir_pattern && (ptr == dir_ptr)) { parse_unmatched(&result, &prev_ptr, type, ptr - prev_ptr); advanced = parse_pattern(&result, &ptr, end_ptr, tag, type, default_dir_pattern, len, call_data, &halt); } /* Try to match this character against the patterns. */ for (index = 0; !advanced && !halt && (index < parse_count); index++) { XmParseMapping pat = parse_table[index]; if (match_pattern(ptr, tag, type, pat, len, (ptr == dir_ptr))) { parse_unmatched(&result, &prev_ptr, type, ptr - prev_ptr); advanced = parse_pattern(&result, &ptr, end_ptr, tag, type, pat, len, call_data, &halt); #ifdef FIX_1398 /* Insert the charset component after pattern insertion */ result = XmStringConcatAndFree(result, XmStringComponentCreate(tag_type, strlen(tag), (XtPointer) tag)); #endif } } /* Match an implicit "self-insert" pattern if all else fails. */ if (!advanced) { /* Buffer unmatched characters into one long insertion. */ ptr += len; } else { /* Discard this character and reset unmatched pointer. */ prev_ptr = ptr; } /* Stop processing at the end of the text. */ halt |= (end_ptr && (ptr >= (char*) end_ptr)); } /* Output and trailing unmatched characters. */ parse_unmatched(&result, &prev_ptr, type, ptr - prev_ptr); /* Return the true end of parsing if possible. */ if (text_end) *text_end = (XtPointer) ptr; _XmProcessUnlock(); return result; } /* * check_unparse_models: A helper for XmStringUnparse. Invoked * after a text component is processed, this routine determines * whether future non-text and text components will be unparsed. */ static void check_unparse_models(XmStringContext context, XmStringTag tag, XmTextType tag_type, XmParseModel parse_model, Boolean *prev_text_match, Boolean *next_text_match, Boolean *non_text_match) { /* Scan ahead to see whether the next text segment will match. */ { /* Peek ahead in the iterator for a real text segment. */ Boolean done = False; _XmStringContextRec n_context; XtPointer n_value; unsigned int n_length; XmStringComponentType n_ctype; /* Compute text_match for the next text segment. */ *prev_text_match = *next_text_match; _XmStringContextCopy(&n_context, context); while (!done) { n_ctype = XmeStringGetComponent(&n_context, True, False, &n_length, &n_value); switch (n_ctype) { case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: if (!tag) *next_text_match = True; else if ((tag_type == _XmStrContTagType(&n_context)) && (!_XmStrContTag(&n_context) || (tag == _XmStrContTag(&n_context)) || (strcmp(tag, _XmStrContTag(&n_context)) == 0))) *next_text_match = True; else *next_text_match = False; done = True; break; case XmSTRING_COMPONENT_END: *next_text_match = False; done = True; break; } } _XmStringContextFree(&n_context); } /* Compute parse_match for components up to the next text segment. */ switch (parse_model) { case XmOUTPUT_ALL: *non_text_match = True; break; case XmOUTPUT_BETWEEN: *non_text_match = *prev_text_match && *next_text_match; break; case XmOUTPUT_BEGINNING: *non_text_match = *next_text_match; break; case XmOUTPUT_END: *non_text_match = *prev_text_match; break; case XmOUTPUT_BOTH: *non_text_match = *prev_text_match || *next_text_match; break; default: /* This is an error. */ *non_text_match = False; break; } } /* * unparse_text: A helper for XmStringUnparse. Output a matched text * component. */ static void unparse_text(char **result, int *length, XmTextType output_type, XmStringComponentType c_type, unsigned int c_length, XtPointer c_value) { /* If we have an invalid character, treat it as a single byte. */ if ((int)c_length < 0) c_length = 1; /* Convert c_value to the appropriate type and insert it. */ if ((c_type == XmSTRING_COMPONENT_WIDECHAR_TEXT) == (output_type == XmWIDECHAR_TEXT)) { /* No conversion is necessary. */ *result = XtRealloc(*result, *length + c_length); memcpy(*result + *length, c_value, c_length); *length += c_length; } else if (output_type != XmWIDECHAR_TEXT) { /* Convert c_value to a multibyte string. */ int len; int max_bytes = c_length * MB_CUR_MAX / sizeof(wchar_t); wchar_t *null_text = (wchar_t*) XtMalloc(c_length + sizeof(wchar_t)); memcpy(null_text, c_value, c_length); null_text[c_length / sizeof(wchar_t)] = (wchar_t) '\0'; *result = XtRealloc(*result, *length + max_bytes); len = wcstombs(*result + *length, null_text, max_bytes); if (len > 0) *length += len; XtFree((char*) null_text); } else { /* Convert c_value to a widechar string. */ int len; char *null_text = XtMalloc(c_length + 1); memcpy(null_text, c_value, c_length); null_text[c_length] = '\0'; *result = XtRealloc(*result, *length + c_length * sizeof(wchar_t)); len = mbstowcs((wchar_t*) (*result + *length), null_text, c_length); if (len > 0) *length += len * sizeof(wchar_t); XtFree(null_text); } } /* * unparse_is_plausible: A helper routine for unparse_components. * Decided whether a pattern is even eligible for unparsing. */ static Boolean unparse_is_plausible(XmParseMapping pattern) { /* Look for a cached result from previous computations. */ switch (pattern->internal_flags) { case XmSTRING_UNPARSE_UNKNOWN: break; case XmSTRING_UNPARSE_PLAUSIBLE: return True; case XmSTRING_UNPARSE_IMPLAUSIBLE: return False; } /* Test the pattern to see if it might ever be unparsed. */ if (/* Filter patterns based on the include status. */ (pattern->include_status == XmINVOKE) || /* Filter patterns based on the substitution. */ (!pattern->substitute) || /* Filter patterns based on the pattern. */ (pattern->pattern == XmDIRECTION_CHANGE)) { pattern->internal_flags = XmSTRING_UNPARSE_IMPLAUSIBLE; return False; } else { /* Give up and compare the segments component by component. */ pattern->internal_flags = XmSTRING_UNPARSE_PLAUSIBLE; return True; } } /* * unparse_components: A helper for XmStringUnparse. Compare * components against the parse table. */ static void unparse_components(char **result, int *length, XmTextType output_type, XmStringContext context, XmParseTable parse_table, Cardinal parse_count) { Boolean match = False; XmParseMapping pat; int n_pat; int n_comp; /* Compare each pattern component. */ for (n_pat = 0; !match && (n_pat < parse_count); n_pat++) { pat = parse_table[n_pat]; if (unparse_is_plausible(pat)) { _XmStringContextRec m_context, p_context; XmStringComponentType m_ctype, p_ctype; XtPointer m_value, p_value; unsigned int m_length, p_length; /* Setup master and pattern context iterators. */ _XmStringContextCopy(&m_context, context); _XmStringContextReInit(&p_context, pat->substitute); /* Iterate over each of the strings. */ match = True; for (n_comp = 0; match; n_comp++) { /* Get the next component from each source. */ m_ctype = XmeStringGetComponent(&m_context, True, False, &m_length, &m_value); p_ctype = XmeStringGetComponent(&p_context, True, False, &p_length, &p_value); /* It's a match! */ if (p_ctype == XmSTRING_COMPONENT_END) break; /* Comparison of text components always fails. */ if ((p_ctype == XmSTRING_COMPONENT_TEXT) || (p_ctype == XmSTRING_COMPONENT_LOCALE_TEXT) || (p_ctype == XmSTRING_COMPONENT_WIDECHAR_TEXT)) { pat->internal_flags = XmSTRING_UNPARSE_IMPLAUSIBLE; match = False; } /* Bit-compare components. */ else if ((m_ctype != p_ctype) || (m_length != p_length) || ((m_value != p_value) && memcmp(m_value, p_value, m_length))) match = False; } /* Should we undo this substitution? */ if (match) { /* Output the original pattern. */ if (pat->pattern_type == XmWIDECHAR_TEXT) unparse_text(result, length, output_type, XmSTRING_COMPONENT_WIDECHAR_TEXT, sizeof(wchar_t), pat->pattern); else unparse_text(result, length, output_type, XmSTRING_COMPONENT_TEXT, #ifndef NO_MULTIBYTE mblen((char*) pat->pattern, MB_CUR_MAX), #else *((char *) pat->pattern) ? 1: 0, #endif pat->pattern); /* Skip all but the last matched component. */ while (--n_comp > 0) { m_ctype = XmeStringGetComponent(context, True, False, &m_length, &m_value); assert(m_ctype != XmSTRING_COMPONENT_END); } } /* Cleanup. */ _XmStringContextFree(&m_context); _XmStringContextFree(&p_context); } } } XtPointer XmStringUnparse(XmString string, XmStringTag tag, XmTextType tag_type, XmTextType output_type, XmParseTable parse_table, Cardinal parse_count, XmParseModel parse_model) { char *result = NULL; int length = 0; _XmStringContextRec stack_context; Boolean prev_text_match; Boolean next_text_match; Boolean non_text_match; Boolean done; XmStringComponentType c_type; unsigned int c_length; XtPointer c_value; _XmProcessLock(); /* Convert special tags to real values. */ if ((tag_type == XmCHARSET_TEXT) && tag && ((tag == XmSTRING_DEFAULT_CHARSET) || (strcmp(tag, XmSTRING_DEFAULT_CHARSET) == 0))) tag = _XmStringGetCurrentCharset(); /* Process the components of string individually. */ prev_text_match = next_text_match = non_text_match = False; done = (string == NULL); if (!done) { _XmStringContextReInit(&stack_context, string); check_unparse_models(&stack_context, tag, tag_type, parse_model, &prev_text_match, &next_text_match, &non_text_match); } while (!done) { /* Peek at the next component. */ c_type = XmeStringGetComponent(&stack_context, False, False, &c_length, &c_value); switch (c_type) { case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: /* Text component matches are computed in advance. */ if (next_text_match) unparse_text(&result, &length, output_type, c_type, c_length, c_value); /* Advance to the next component. */ (void) XmeStringGetComponent(&stack_context, True, False, &c_length, &c_value); /* Update the text match values. */ check_unparse_models(&stack_context, tag, tag_type, parse_model, &prev_text_match, &next_text_match, &non_text_match); break; case XmSTRING_COMPONENT_END: done = True; /* We're done after processing this component. */ default: /* Non-text components are under the control of parse_model. */ if (non_text_match) unparse_components(&result, &length, output_type, &stack_context, parse_table, parse_count); /* Advance to the next component. */ if (!done) (void) XmeStringGetComponent(&stack_context, True, False, &c_length, &c_value); break; } } /* Clean up. */ if (string != NULL) _XmStringContextFree(&stack_context); /* Null terminate the result. */ switch(output_type) { case XmWIDECHAR_TEXT: { wchar_t zero = 0; unparse_text(&result, &length, output_type, XmSTRING_COMPONENT_WIDECHAR_TEXT, sizeof(wchar_t), (XtPointer) &zero); } break; case XmCHARSET_TEXT: case XmMULTIBYTE_TEXT: case XmNO_TEXT: unparse_text(&result, &length, output_type, XmSTRING_COMPONENT_TEXT, 1, (XtPointer) ""); break; } _XmProcessUnlock(); return (XtPointer) result; } XmString XmStringComponentCreate(XmStringComponentType c_type, unsigned int length, XtPointer value) { _XmString str; _XmStringUnoptSegRec seg; _XmStringEntry opt_seg; _XmStringOptRec opt; int tag_index = TAG_INDEX_UNSET; Boolean optimized = False; XmStringTag rend_tags[1]; _XmProcessLock(); /* We can't do anything if a needed value is missing. */ if ((length > 0) && (value == NULL)) { _XmProcessUnlock(); return NULL; } /* Initialize the proto-segments */ _XmEntryInit((_XmStringEntry)&seg, XmSTRING_ENTRY_UNOPTIMIZED); _XmStrInit((_XmString)&opt, XmSTRING_OPTIMIZED); /* Modify a proto-segment appropriately or return a special value. */ switch (c_type) { case XmSTRING_COMPONENT_CHARSET: if (!value || (length != strlen((char*) value))) { _XmProcessUnlock(); return NULL; } if ((value == XmSTRING_DEFAULT_CHARSET) || (strcmp((char*) value, XmSTRING_DEFAULT_CHARSET) == 0)) { value = _XmStringGetCurrentCharset(); length = strlen((char*) value); } tag_index = _XmStringIndexCacheTag((char*) value, length); optimized = (tag_index < TAG_INDEX_MAX); if (optimized) { _XmStrTextType((_XmString)&opt) = XmCHARSET_TEXT; _XmStrTagIndex((_XmString)&opt) = tag_index; } else { _XmEntryTextTypeSet(&seg, XmCHARSET_TEXT); _XmUnoptSegTag(&seg) = _XmStringCacheTag((char*) value, length); } break; case XmSTRING_COMPONENT_TEXT: optimized = (length < (1 << BYTE_COUNT_BITS)); if (optimized) { _XmStrTextType((_XmString)&opt) = XmCHARSET_TEXT; _XmStrByteCount((_XmString)&opt) = length; } else { _XmEntryTextTypeSet(&seg, XmCHARSET_TEXT); if (value != NULL) { _XmEntryTextSet((_XmStringEntry)&seg, value); _XmEntryByteCountSet(&seg, length); } } break; case XmSTRING_COMPONENT_DIRECTION: if (length != sizeof(XmStringDirection)) { _XmProcessUnlock(); return NULL; } _XmProcessUnlock(); return XmStringDirectionCreate(*((XmStringDirection*) value)); case XmSTRING_COMPONENT_SEPARATOR: if (value != NULL) { _XmProcessUnlock(); return NULL; } _XmProcessUnlock(); return XmStringSeparatorCreate(); case XmSTRING_COMPONENT_LOCALE_TEXT: tag_index = _XmStringIndexCacheTag( (char*) XmFONTLIST_DEFAULT_TAG, XmSTRING_TAG_STRLEN); if (length < (1 << BYTE_COUNT_BITS)) optimized = (tag_index < TAG_INDEX_MAX); if (optimized) { _XmStrTextType((_XmString)&opt) = XmMULTIBYTE_TEXT; _XmStrTagIndex((_XmString)&opt) = tag_index; _XmStrByteCount((_XmString)&opt) = length; } else { _XmEntryTextTypeSet(&seg, XmMULTIBYTE_TEXT); _XmUnoptSegTag(&seg) = _tag_cache[tag_index]; if (value != NULL) { _XmEntryTextSet((_XmStringEntry)&seg, value); _XmEntryByteCountSet(&seg, length); } } break; case XmSTRING_COMPONENT_LOCALE: if (!value || (length != strlen((char*) value))) { _XmProcessUnlock(); return NULL; } if (strcmp((char*) value, _MOTIF_DEFAULT_LOCALE) != 0) { _XmProcessUnlock(); return NULL; } tag_index = _XmStringIndexCacheTag((char*) value, length); optimized = (tag_index < TAG_INDEX_MAX); if (optimized) { _XmStrTextType((_XmString)&opt) = XmMULTIBYTE_TEXT; _XmStrTagIndex((_XmString)&opt) = tag_index; } else { _XmEntryTextTypeSet(&seg, XmMULTIBYTE_TEXT); _XmUnoptSegTag(&seg) = _XmStringCacheTag((char*) value, length); } break; case XmSTRING_COMPONENT_WIDECHAR_TEXT: optimized = (length < (1 << BYTE_COUNT_BITS)); if (optimized) { _XmStrTextType((_XmString)&opt) = XmWIDECHAR_TEXT; _XmStrTagIndex((_XmString)&opt) = tag_index; _XmStrByteCount((_XmString)&opt) = length; } else { _XmEntryTextTypeSet(&seg, XmWIDECHAR_TEXT); if (value != NULL) { _XmEntryTextSet((_XmStringEntry)&seg, value); _XmEntryByteCountSet(&seg, length); } } break; case XmSTRING_COMPONENT_LAYOUT_POP: if (value != NULL) { _XmProcessUnlock(); return NULL; } /* There is no optimized representation for layout components? */ optimized = False; _XmEntryPopSet(&seg, TRUE); break; case XmSTRING_COMPONENT_LAYOUT_PUSH: if (length != sizeof(XmDirection)) { _XmProcessUnlock(); return NULL; } /* There is no optimized representation for layout components? */ optimized = False; _XmEntryPushSet(&seg, *((XmDirection *)value)); break; case XmSTRING_COMPONENT_RENDITION_BEGIN: if (!value || (length != strlen((char*)value))) { _XmProcessUnlock(); return NULL; } tag_index = _XmStringIndexCacheTag((char *)value, length); optimized = (tag_index < REND_INDEX_MAX); if (optimized) { _XmStrRendIndex((_XmString)&opt) = tag_index; _XmStrRendBegin((_XmString)&opt) = TRUE; } else { _XmUnoptSegRendBegins(&seg) = rend_tags; rend_tags[0] = _XmStringCacheTag((char *)value, length); _XmUnoptSegRendBeginCount(&seg) = 1; } break; case XmSTRING_COMPONENT_RENDITION_END: if (!value || (length != strlen((char*)value))) { _XmProcessUnlock(); return NULL; } tag_index = _XmStringIndexCacheTag((char *)value, length); optimized = (tag_index < REND_INDEX_MAX); if (optimized) { _XmStrRendIndex((_XmString)&opt) = tag_index; _XmStrRendEnd((_XmString)&opt) = TRUE; } else { _XmUnoptSegRendEnds(&seg) = rend_tags; rend_tags[0] = _XmStringCacheTag((char *)value, length); _XmUnoptSegRendEndCount(&seg) = 1; } break; case XmSTRING_COMPONENT_TAB: { XmString ret_val; if (value != NULL) { _XmProcessUnlock(); return NULL; } ret_val = StringTabCreate(); _XmProcessUnlock(); return ret_val; } case XmSTRING_COMPONENT_END: { XmString ret_val; if (value != NULL) { _XmProcessUnlock(); return NULL; } ret_val = StringEmptyCreate(); _XmProcessUnlock(); return ret_val; } case XmSTRING_COMPONENT_UNKNOWN: default: _XmProcessUnlock(); return NULL; } /* Convert one of the proto-segments into a real _XmString. */ if (optimized) { /* Convert opt into an optimized XmString. */ str = (_XmString) _XmStrMalloc(sizeof(_XmStringOptRec) + (_XmStrByteCount((_XmString)&opt) ? (_XmStrByteCount((_XmString)&opt) - TEXT_BYTES_IN_STRUCT) : 0)); memcpy(str, &opt, sizeof(_XmStringOptRec) - TEXT_BYTES_IN_STRUCT); memcpy(_XmStrText(str), value, _XmStrByteCount((_XmString)&opt)); _XmStrRefCountSet(str, 1); } else { /* Convert seg into a non-optimized XmString. */ _XmStrCreate(str, XmSTRING_MULTIPLE_ENTRY, 0); if ((opt_seg = EntryCvtToOpt((_XmStringEntry)&seg)) != NULL) _XmStringSegmentNew(str, 0, opt_seg, False); else _XmStringSegmentNew(str, 0, (_XmStringEntry)&seg, True); } _XmProcessUnlock(); return (XmString) str; } XmStringComponentType XmStringGetNextTriple(XmStringContext context, unsigned int *length, XtPointer *value) { return XmeStringGetComponent((_XmStringContext) context, True, True, length, value); } /* * XmeStringGetComponent: A generalized implementation of XmStringGetNextTriple. */ XmStringComponentType XmeStringGetComponent(_XmStringContext context, Boolean update_context, Boolean copy_data, unsigned int *length, XtPointer *value) { short tmp_index; Boolean optimized; char state; Boolean last_seg, last_line; Boolean pop_dir; XmDirection push_dir; XmStringDirection dir; XmStringTag tag = NULL; int char_count = 0; XmTextType text_type = 0; char *seg_text = NULL; XmStringTag *begin_rends = NULL; short begin_count = 0; XmStringTag *end_rends = NULL; short end_count = 0; unsigned char tabs; _XmString opt = NULL; _XmStringEntry seg = NULL; _XmStringArraySegRec array_seg; Boolean skip; _XmProcessLock(); /* Initialize the out parameters. */ if (length) *length = 0; if (value) *value = NULL; /* No NULL pointers allowed. */ if (! (length && value)) { _XmProcessUnlock(); return XmSTRING_COMPONENT_END; } /* We may be done already. */ if (_XmStrContError(context)) { _XmProcessUnlock(); return XmSTRING_COMPONENT_END; } /* Gather the current segment information. */ state = _XmStrContState(context); optimized = _XmStrContOpt(context); if (optimized) { XmStringTag *rend_tag = NULL; opt = (_XmString) _XmStrContString(context); last_seg = True; last_line = True; /* Only lookup pop_dir when we need it. */ /* Only lookup push_dir when we need it. */ /* Only lookup dir when we need it. */ /* Only lookup tag when we need it. */ char_count = _XmStrByteCount(opt); text_type = (XmTextType) _XmStrTextType(opt); seg_text = _XmStrText(opt); begin_count = _XmStrRendBegin(opt); end_count = _XmStrRendEnd(opt); if (begin_count || end_count) { assert(_XmStrRendIndex(opt) != REND_INDEX_UNSET); rend_tag = _tag_cache + _XmStrRendIndex(opt); } begin_rends = (begin_count ? rend_tag : NULL); end_rends = (end_count ? rend_tag : NULL); /* Only lookup tabs when we need it. */ } else { _XmString str = _XmStrContString(context); _XmStringEntry line; /* If we've run off the end we're done. */ if (_XmStrContCurrLine(context) >= _XmStrLineCountGet(str)) { if (update_context) _XmStrContError(context) = TRUE; _XmProcessUnlock(); return XmSTRING_COMPONENT_END; } if (_XmStrImplicitLine(str)) { line = _XmStrEntry(str)[_XmStrContCurrLine(context)]; } else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(str); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(str); line = (_XmStringEntry)&array_seg; } last_line = (_XmStrContCurrLine(context) + 1 >= _XmStrLineCountGet(str)); if (_XmEntryMultiple(line)) last_seg = (_XmStrContCurrSeg(context) + 1 >=_XmEntrySegmentCount(line)); else last_seg = True; if (_XmEntryMultiple(line) && _XmEntrySegmentCount(line) == 0) { /* Empty lines are separators. */ state = SEP_STATE; /* The normal state variables shouldn't be referenced. */ } else { /* Extract data from a real segment. */ if (_XmEntryMultiple(line)) seg = (_XmStringEntry)_XmEntrySegment(line)[_XmStrContCurrSeg(context)]; else seg = line; /* Only lookup pop_dir when we need it. */ /* Only lookup push_dir when we need it. */ /* Only lookup dir when we need it. */ /* Only lookup tag when we need it. */ char_count = _XmEntryByteCountGet(seg); text_type = (XmTextType) _XmEntryTextTypeGet(seg); seg_text = (char*) _XmEntryTextGet(seg); begin_count = _XmEntryRendBeginCountGet(seg); begin_rends = _XmEntryRendCountedBegins(seg, begin_count); end_count = _XmEntryRendEndCountGet(seg); end_rends = _XmEntryRendCountedEnds(seg, end_count); /* Only lookup tabs when we need it. */ } } /* Return the next non-default component. */ switch (state) { case PUSH_STATE: push_dir = (optimized ? 0 : _XmEntryPushGet(seg)); if (push_dir != 0) { if (copy_data) { XmDirection* tmp = XtNew(XmDirection); *tmp = push_dir; *value = (XtPointer) tmp; *length = sizeof(XmDirection); } else { _XmStrContTmpDir(context) = push_dir; *value = (XtPointer) &_XmStrContTmpDir(context); *length = sizeof(XmDirection); } if (update_context) { _XmStrContState(context) = BEGIN_REND_STATE; _XmStrContRendIndex(context) = 0; } _XmProcessUnlock(); return XmSTRING_COMPONENT_LAYOUT_PUSH; } /* Fall through if no push components exist. */ case BEGIN_REND_STATE: tmp_index = ((_XmStrContState(context) == BEGIN_REND_STATE) ? _XmStrContRendIndex(context) : 0); if (tmp_index < begin_count) { /* Process another rendition start. */ if (copy_data) *value = (XtPointer) XtNewString(begin_rends[tmp_index]); else *value = (XtPointer) begin_rends[tmp_index]; *length = strlen((char*) *value); if (update_context) { /* Add this rendition to the list of active renditions. */ begin_context_rends(context, update_context, begin_rends + tmp_index, 1); _XmStrContState(context) = BEGIN_REND_STATE; _XmStrContRendIndex(context) = tmp_index + 1; } _XmProcessUnlock(); return XmSTRING_COMPONENT_RENDITION_BEGIN; } /* Fall through if there are no more rendition starts. */ case TAG_STATE: /* Don't output implicit leading charset component. */ tag = (optimized ? _XmStrTagGet(opt) : _XmEntryTag(seg)); if ((tag == XmSTRING_DEFAULT_CHARSET) || (tag && !strcmp((char*) tag, XmSTRING_DEFAULT_CHARSET))) tag = _XmStringGetCurrentCharset(); if ((text_type != XmNO_TEXT && text_type != _XmStrContTagType(context)) || (tag && (tag != _XmStrContTag(context)) && (!_XmStrContTag(context) || strcmp(tag, _XmStrContTag(context))))) { skip = (tag == NULL); assert(tag != XmSTRING_DEFAULT_CHARSET); /* If we have MB text with FONTLIST_DEFAULT_TAG, we really have * oldstyle locale_text so don't output tag component, but set * context if necessary for GetNextSegment. */ if ((tag == XmFONTLIST_DEFAULT_TAG) && (text_type == XmMULTIBYTE_TEXT)) { skip = TRUE; _XmStrContTag(context) = tag; } if (!skip) { /* Tag is changing. */ if (copy_data) *value = (XtPointer) XtNewString(tag); else *value = (XtPointer) tag; *length = strlen(tag); if (update_context) { _XmStrContTag(context) = tag; _XmStrContTagType(context) = text_type; _XmStrContState(context) = TAB_STATE; _XmStrContTabCount(context) = 0; } _XmProcessUnlock(); return ((text_type == XmCHARSET_TEXT) ? XmSTRING_COMPONENT_CHARSET : XmSTRING_COMPONENT_LOCALE); } } /* Fall through if no tag set. */ case TAB_STATE: tmp_index = ((_XmStrContState(context) == TAB_STATE) ? _XmStrContTabCount(context) : 0); tabs = (optimized ? _XmStrTabs(opt) : _XmEntryTabsGet(seg)); if (tmp_index < tabs) { /* A Tab precedes this segment. */ if (update_context) { _XmStrContState(context) = TAB_STATE; _XmStrContTabCount(context) = tmp_index + 1; } _XmProcessUnlock(); return XmSTRING_COMPONENT_TAB; } /* Fall through if there are no tabs. */ case DIR_STATE: dir = (optimized ? _XmStrDirection(opt) : _XmEntryDirectionGet(seg)); if (dir != _XmStrContDir(context)) { skip = FALSE; /* Try to resolve unset directions. */ if (dir == XmSTRING_DIRECTION_UNSET) { if ((char_count > 0) || (_XmStrContDir(context) == XmSTRING_DIRECTION_UNSET)) { XmCharDirectionProc char_proc = _XmOSGetCharDirection; (void)XmOSGetMethod(NULL, XmMCharDirection, (XtPointer *)&char_proc, NULL); if (state > TAG_STATE) tag = (optimized ? _XmStrTagGet(opt) : _XmEntryTag(seg)); dir = XmDirectionToStringDirection ((*char_proc)(seg_text, text_type, tag)); } else skip = TRUE; } if (!skip) { /* Direction is changing. */ if (copy_data) { XmStringDirection* tmp = XtNew(XmStringDirection); *tmp = dir; *value = (XtPointer) tmp; *length = sizeof(XmStringDirection); } else { _XmStrContTmpStrDir(context) = dir; *value = (XtPointer) &_XmStrContTmpStrDir(context); *length = sizeof(XmStringDirection); } if (update_context) { _XmStrContDir(context) = dir; _XmStrContState(context) = TEXT_STATE; } _XmProcessUnlock(); return XmSTRING_COMPONENT_DIRECTION; } } /* Fall through if no direction set. */ case TEXT_STATE: switch (text_type) { case XmCHARSET_TEXT: case XmMULTIBYTE_TEXT: case XmWIDECHAR_TEXT: if (copy_data) { char* tmp = XtMalloc(char_count + sizeof(wchar_t)); memcpy(tmp, seg_text, char_count); bzero(tmp + char_count, sizeof(wchar_t)); *value = (XtPointer) tmp; } else { if (seg_text != NULL) *value = seg_text; else *value = XmS; } *length = char_count; if (update_context) { _XmStrContState(context) = END_REND_STATE; _XmStrContRendIndex(context) = 0; } switch (text_type) { case XmCHARSET_TEXT: _XmProcessUnlock(); return XmSTRING_COMPONENT_TEXT; case XmMULTIBYTE_TEXT: _XmProcessUnlock(); return XmSTRING_COMPONENT_LOCALE_TEXT; case XmWIDECHAR_TEXT: _XmProcessUnlock(); return XmSTRING_COMPONENT_WIDECHAR_TEXT; case XmNO_TEXT: assert(FALSE); } case XmNO_TEXT: break; default: /* Something is wrong! */ assert(False); if (update_context) _XmStrContError(context) = True; _XmProcessUnlock(); return XmSTRING_COMPONENT_END; } /* Fall through if there is no text. */ case END_REND_STATE: tmp_index = ((_XmStrContState(context) == END_REND_STATE) ? _XmStrContRendIndex(context) : 0); if (tmp_index < end_count) { /* Process another rendition end. */ if (copy_data) *value = (XtPointer) XtNewString(end_rends[tmp_index]); else *value = (XtPointer) end_rends[tmp_index]; *length = strlen((char*) *value); if (update_context) { /* Remove this rendition from the list of active renditions. */ end_context_rends(context, update_context, end_rends + tmp_index, 1); _XmStrContState(context) = END_REND_STATE; _XmStrContRendIndex(context) = tmp_index + 1; } _XmProcessUnlock(); return XmSTRING_COMPONENT_RENDITION_END; } /* Fall through if there are no more rendition ends. */ case POP_STATE: pop_dir = (optimized ? 0 : _XmEntryPopGet(seg)); if (pop_dir) { /* A pop layout direction follows this segment. */ if (update_context) _XmStrContState(context) = SEP_STATE; _XmProcessUnlock(); return XmSTRING_COMPONENT_LAYOUT_POP; } /* Fall through if there is no pop layout direction. */ case SEP_STATE: /* This is the last possible component for a segment. */ if (last_seg && last_line) { /* Separators only appear between lines. */ if (update_context) _XmStrContError(context) = True; _XmProcessUnlock(); return XmSTRING_COMPONENT_END; } else if (last_seg && _XmStrImplicitLine(_XmStrContString(context))) { /* Advance to the next line. */ if (update_context) { _XmStrContState(context) = PUSH_STATE; _XmStrContCurrSeg(context) = 0; _XmStrContCurrLine(context)++; } _XmProcessUnlock(); return XmSTRING_COMPONENT_SEPARATOR; } else { /* Try the next segment of this line recursively. */ XmStringComponentType answer; char saved_state = _XmStrContState(context); unsigned short saved_seg = _XmStrContCurrSeg(context); _XmStrContState(context) = PUSH_STATE; _XmStrContCurrSeg(context)++; answer = XmeStringGetComponent(context, update_context, copy_data, length, value); if (!update_context) { _XmStrContState(context) = saved_state; _XmStrContCurrSeg(context) = saved_seg; } _XmProcessUnlock(); return answer; } /*NOTREACHED*/ assert(False); default: /* An unknown _XmStrContState? */ assert(False); if (update_context) _XmStrContError(context) = True; _XmProcessUnlock(); return XmSTRING_COMPONENT_END; } } /* * _XmStringContextReInit: Initialize an allocated _XmStringContext. */ void _XmStringContextReInit(_XmStringContext context, _XmString string) { assert(context != NULL); bzero((char*) context, sizeof(_XmStringContextRec)); _XmStrContString(context) = string; _XmStrContOpt(context) = _XmStrOptimized(string); _XmStrContDir(context) = XmSTRING_DIRECTION_UNSET; } /* * _XmStringContextCopy: Copy allocated _XmStringContexts. The active * rendition list is always copied because expanding it to * contain new entries via XtRealloc may free the old pointer. * Use _XmStringContextFree() to deallocate storage. */ void _XmStringContextCopy(_XmStringContext target, _XmStringContext source) { int size; assert(source && target && (source != target)); /* Copy the normal fields. */ memcpy(target, source, sizeof(_XmStringContextRec)); /* Copy the active renditions list so we can modify it. */ if (_XmStrContRendCount(target) > 0) { size = sizeof(XmStringTag) * _XmStrContRendCount(target); _XmStrContRendTags(target) = (XmStringTag*) XtMalloc(size); memcpy(_XmStrContRendTags(target), _XmStrContRendTags(source), size); } } /* * _XmStringContextFree: Deallocate an _XmStringContext's internal storage. */ void _XmStringContextFree(_XmStringContext context) { assert(context); /* Free the active rendition list. */ if (_XmStrContRendTags(context)) { XtFree((char*) _XmStrContRendTags(context)); } _XmStrContRendTags(context) = NULL; } /* * begin_context_rends: Update an _XmStringContext to reflect some * newly active renditions. */ static void begin_context_rends(_XmStringContext context, Boolean update_context, XmStringTag *rends, int count) { /* Append these renditions the context's list of active renditions. */ _XmStrContRendTags(context) = (XmStringTag*) XtRealloc((char*) _XmStrContRendTags(context), sizeof(XmStringTag) * (_XmStrContRendCount(context) + count)); memcpy(_XmStrContRendTags(context) + _XmStrContRendCount(context), rends, sizeof(XmStringTag) * count); /* Update the total number only if we're advancing the context. */ if (update_context) _XmStrContRendCount(context) += count; } /* * end_context_rends: Remove some renditions from an _XmStringContext's * list of active renditions. */ static void end_context_rends(_XmStringContext context, Boolean update_context, XmStringTag *rends, int count) { int n_rend, n_tag; int i; /* Check some simple error conditions. */ if (!update_context || (count <= 0)) return; /* Remove the last matching instance of each rendition. */ for (n_rend = 0; n_rend < count; n_rend++) { /* Renditions are cached, so we can compare pointers. */ n_tag = _XmStrContRendCount(context); while (--n_tag >= 0) if (_XmStrContRendTags(context)[n_tag] == rends[n_rend]) { /* Delete rendition n_tag from the context's list. */ for (i = n_tag; i < (_XmStrContRendCount(context) - 1); i++) _XmStrContRendTags(context)[i] = _XmStrContRendTags(context)[i + 1]; _XmStrContRendCount(context)--; } } } XmString XmStringGenerate(XtPointer text, XmStringTag tag, XmTextType type, XmStringTag rendition) { XmString result; int table_size; XmParseTable gen_table; int i; _XmProcessLock(); /* ** Get the parse table shared by generate and ungenerate. */ table_size = _get_generate_parse_table (&gen_table); /* Parse the text into an XmString. */ result = XmStringParseText (text, NULL, tag, type, gen_table, table_size, NULL); /* If no rendition was supplied return the parsetext result. */ if (rendition == NULL) { _XmProcessUnlock(); return result; } /* Try to wrap this rendition around an optimized result. */ if (_XmStrOptimized(result) && (_XmStrRendIndex(result) == REND_INDEX_UNSET)) { unsigned int rend_index; assert (!_XmStrRendBegin(result) && !_XmStrRendEnd(result)); rend_index = _XmStringIndexCacheTag((char *)rendition, XmSTRING_TAG_STRLEN); if (rend_index < REND_INDEX_MAX) { _XmStrRendIndex(result) = rend_index; _XmStrRendBegin(result) = _XmStrRendEnd(result) = True; _XmProcessUnlock(); return result; } } /* Try to wrap this rendition around an unoptimized result. */ if (!_XmStrOptimized(result)) { /* We only know how to do this if there is at least one segment. */ XmStringTag cached_rend = _XmStringCacheTag(rendition, XmSTRING_TAG_STRLEN); int n_line; _XmStringEntry line; _XmStringEntry seg; /* Locate the first segment. */ for (n_line = 0; n_line < _XmStrEntryCount(result); n_line++) { line = _XmStrEntry(result)[n_line]; if (_XmEntrySegmentCountGet(line) > 0) { /* Prepend rendition_begin to the first segment. */ if (_XmStrImplicitLine(result)) seg = (_XmStringEntry)_XmEntrySegmentGet(line)[0]; else seg = line; if (_XmEntryOptimized(seg) && _XmEntryRendIndex(seg) == REND_INDEX_UNSET) { unsigned int rend_index; assert (!_XmEntryRendBeginCountGet(seg) && !_XmEntryRendEndCountGet(seg)); rend_index = _XmStringIndexCacheTag((char *)rendition, XmSTRING_TAG_STRLEN); if (rend_index < REND_INDEX_MAX) { _XmEntryRendIndex(seg) = rend_index; _XmEntryRendBeginCountSet(seg, 1); } } else { if (_XmEntryOptimized(seg)) { _XmStringEntry new_seg = EntryCvtToUnopt(seg); _XmStringEntryFree(seg); seg = new_seg; if (_XmEntryMultiple(line)) _XmEntrySegment(line)[0] = (_XmStringNREntry)seg; else _XmStrEntry(result)[n_line] = seg; } _XmUnoptSegRendBegins(seg) = (XmStringTag*) XtRealloc((char*) _XmUnoptSegRendBegins(seg), (_XmUnoptSegRendBeginCount(seg) + 1)* sizeof(XmStringTag)); /* Put rendition first in begins. */ for (i = 0; i < _XmUnoptSegRendBeginCount(seg); i++) _XmUnoptSegRendBegins(seg)[i + 1] = _XmUnoptSegRendBegins(seg)[i]; _XmUnoptSegRendBegins(seg)[0] = cached_rend; _XmUnoptSegRendBeginCount(seg)++; } break; } } /* Locate the last segment. */ n_line = _XmStrEntryCount(result); while (--n_line >= 0) { line = _XmStrEntry(result)[n_line]; if (_XmEntrySegmentCountGet(line) > 0) { /* Append rendition_end to the last segment. */ if (_XmStrImplicitLine(result)) seg = (_XmStringEntry) _XmEntrySegmentGet(line)[_XmEntrySegmentCountGet(line)-1]; else seg = line; if (_XmEntryOptimized(seg)) { unsigned int rend_index; rend_index = _XmStringIndexCacheTag((char *)rendition, XmSTRING_TAG_STRLEN); assert ((_XmEntryRendBeginCountGet(seg) <= 1) && (_XmEntryRendEndCountGet(seg) == 0)); if (((_XmEntryRendIndex(seg) == REND_INDEX_UNSET) || (_XmEntryRendIndex(seg) == rend_index)) && (rend_index < REND_INDEX_MAX)) { _XmEntryRendIndex(seg) = rend_index; _XmEntryRendEndCountSet(seg, 1); _XmProcessUnlock(); return result; } else { break; } } else { if (_XmEntryOptimized(seg)) { _XmStringEntry new_seg = EntryCvtToUnopt(seg); if (_XmEntryMultiple(line)) _XmEntrySegment(line)[0] = (_XmStringNREntry)new_seg; else _XmStrEntry(result)[n_line] = new_seg; _XmStringEntryFree(seg); seg = new_seg; } _XmUnoptSegRendEnds(seg) = (XmStringTag*) XtRealloc((char*) _XmUnoptSegRendEnds(seg), (_XmUnoptSegRendEndCount(seg) + 1) * sizeof(XmStringTag)); _XmUnoptSegRendEnds(seg)[_XmUnoptSegRendEndCount(seg)] = cached_rend; _XmUnoptSegRendEndCount(seg)++; _XmProcessUnlock(); return result; } } } } /* As a last resort merge the rendition components normally. */ { XmString tmp_1, tmp_2; /* Prepend the rendition begin. */ tmp_1 = XmStringComponentCreate(XmSTRING_COMPONENT_RENDITION_BEGIN, strlen(rendition), rendition); tmp_2 = result; result = XmStringConcatAndFree(tmp_1, tmp_2); /* Append the rendition end. */ tmp_1 = result; tmp_2 = XmStringComponentCreate(XmSTRING_COMPONENT_RENDITION_END, strlen(rendition), rendition); result = XmStringConcatAndFree(tmp_1, tmp_2); } _XmProcessUnlock(); return result; } XtPointer _XmStringUngenerate(XmString string, XmStringTag tag, XmTextType tag_type, XmTextType output_type) { XtPointer result; int table_size; XmParseTable gen_table; /* ** Get the parse table shared by generate and ungenerate. */ table_size = _get_generate_parse_table (&gen_table); /* Unparse the XmString into text. */ result = XmStringUnparse (string, tag, tag_type, output_type, gen_table, table_size, XmOUTPUT_ALL); /* ** It might be useful to figure out rendition here to return the reverse of ** what came in for XmStringGenerate. I'm not real sure about how to do that ** and it isn't necessary for the immediate needs of CSText, so... ** RJS */ return result; } XmParseMapping XmParseMappingCreate(ArgList arg_list, Cardinal arg_count) { /* Allocate and initialize the return value. */ XmParseMapping result = XtNew(_XmParseMappingRec); bzero((char*)result, sizeof(_XmParseMappingRec)); /* Default values are established by bzero(). * * result->pattern = XmDIRECTION_CHANGE = NULL; * result->pattern_type = XmCHARSET_TEXT; * result->substitute = NULL; * result->parse_proc = NULL; * result->client_data = NULL; * result->include_status = XmINSERT; * result->internal_flags = XmSTRING_UNPARSE_UNKNOWN; */ /* Insert specified values. */ XmParseMappingSetValues(result, arg_list, arg_count); return result; } void XmParseMappingSetValues(XmParseMapping mapping, ArgList arg_list, Cardinal arg_count) { register Cardinal i; register String arg_name; Cardinal unknown = 0; _XmProcessLock(); /* Do a little error checking. */ if (mapping == NULL) { _XmProcessUnlock(); return; } /* Modify the specified values. */ for (i = 0; i < arg_count; i++) { arg_name = arg_list[i].name; if ((arg_name == XmNpattern) || (strcmp(arg_name, XmNpattern) == 0)) mapping->pattern = (XtPointer) arg_list[i].value; else if ((arg_name == XmNpatternType) || (strcmp(arg_name, XmNpatternType) == 0)) mapping->pattern_type = (XmTextType) arg_list[i].value; else if ((arg_name == XmNsubstitute) || (strcmp(arg_name, XmNsubstitute) == 0)) mapping->substitute = XmStringCopy((XmString) arg_list[i].value); else if ((arg_name == XmNinvokeParseProc) || (strcmp(arg_name, XmNinvokeParseProc) == 0)) mapping->parse_proc = (XmParseProc) arg_list[i].value; else if ((arg_name == XmNclientData) || (strcmp(arg_name, XmNclientData) == 0)) mapping->client_data = (XtPointer) arg_list[i].value; else if ((arg_name == XmNincludeStatus) || (strcmp(arg_name, XmNincludeStatus) == 0)) mapping->include_status = (XmIncludeStatus) arg_list[i].value; else unknown++; } /* If there were any known values reset internal_flags. */ if (unknown < arg_count) mapping->internal_flags = XmSTRING_UNPARSE_UNKNOWN; _XmProcessUnlock(); } static int _get_generate_parse_table (XmParseTable *gen_table) /* ** ** Utility function to build and supply the parse table shared by ** XmStringGenerate and _XmStringUngenerate. All of the information about ** the size and real storage of the table is maintained here. ** */ { int table_size = 2; Arg args[10]; Cardinal nargs; XmString tmp; int index = 0; static XmParseTable table = NULL; _XmProcessLock(); /* Allocate a parse table only if necessary. */ if (table) { *gen_table = table; _XmProcessUnlock(); return table_size; } else { table = (XmParseTable) XtCalloc (table_size, sizeof(XmParseMapping)); *gen_table = table; } _XmProcessUnlock(); /* Parse tab characters. */ tmp = XmStringComponentCreate(XmSTRING_COMPONENT_TAB, 0, NULL); nargs = 0; XtSetArg(args[nargs], XmNincludeStatus, XmINSERT), nargs++; XtSetArg(args[nargs], XmNsubstitute, tmp), nargs++; XtSetArg(args[nargs], XmNpattern, "\t"), nargs++; assert(nargs < XtNumber(args)); _XmProcessLock(); table[index++] = XmParseMappingCreate(args, nargs); _XmProcessUnlock(); XmStringFree(tmp); /* Parse newline characters. */ tmp = XmStringSeparatorCreate(); nargs = 0; XtSetArg(args[nargs], XmNincludeStatus, XmINSERT), nargs++; XtSetArg(args[nargs], XmNsubstitute, tmp), nargs++; XtSetArg(args[nargs], XmNpattern, "\n"), nargs++; assert(nargs < XtNumber(args)); _XmProcessLock(); table[index++] = XmParseMappingCreate(args, nargs); _XmProcessUnlock(); assert(index == table_size); return (table_size); } /* Destructively truncates str to be n bytes or less, insuring that it remains a legal ASN.1 encoding. */ unsigned char * _XmStringTruncateASN1(unsigned char *str, int n) { unsigned char *a = str; unsigned short used , delta, d1; unsigned char *new_c, *a_end; unsigned char *ap; unsigned char d2; short head_size; int len, length, header; if (a == NULL) return((unsigned char *)NULL); if (n < ASNHEADERLEN + CSSHORTLEN) return((unsigned char *)NULL); head_size = used = _read_header_length(a); len = _read_string_length(a); ap = _read_header(a); a_end = ((unsigned char *) a) + len + head_size; length = _read_asn1_length(ap); header = _asn1_size(length); /* Read the components adding up their lengths. */ while (((length + header) < (n - used)) && (ap < a_end)) { new_c = _read_component(ap, &d2, &d1, NULL); delta = length + header; used += delta; ap = new_c; length = _read_asn1_length(ap); header = _asn1_size(length); } if ((head_size == (ASNHEADERLEN + CSLONGLEN)) && ((used - head_size) <= MAXSHORTVALUE)) { /* Have to reallocate string. */ unsigned char *tmp; short diff = (CSLONGLEN - CSSHORTLEN); used -= diff; tmp = (unsigned char *)XtMalloc(used * sizeof(unsigned char)); memcpy(tmp, (str + diff), used); XtFree((char *)str); str = tmp; } else { str = (unsigned char *)XtRealloc((char *)str, used); } _write_header(str, used); return (str); } motif-2.3.8/lib/Xm/ScrolledWP.h0000644000175000017500000001174413145162623013116 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScrolledWindowP_h #define _XmScrolledWindowP_h #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef void (*XmGetAutoDragRectsProc)(Widget, XRectangle **, Cardinal *) ; #define XmInheritGetAutoDragRectsProc ((XmGetAutoDragRectsProc) _XtInherit) #define XmScrolledWindowClassExtVersion 1L typedef struct _XmScrolledWindowClassExtRec{ XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; XmGetAutoDragRectsProc get_hor_rects; XmGetAutoDragRectsProc get_vert_rects; } XmScrolledWindowClassExtRec, *XmScrolledWindowClassExt; /* New fields for the ScrolledWindow widget class record */ typedef struct { XtPointer extension; /* extension to new class methods */ } XmScrolledWindowClassPart; /**************** * * Class record declaration * ****************/ typedef struct _XmScrolledWindowClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmScrolledWindowClassPart swindow_class; } XmScrolledWindowClassRec; externalref XmScrolledWindowClassRec xmScrolledWindowClassRec; /**************** * * Scrolled Window instance structure. * ****************/ typedef struct { int vmin; /* slider minimum coordinate position */ int vmax; /* slider maximum coordinate position */ int vOrigin; /* slider edge location */ int vExtent; /* slider size */ int hmin; /* Same as above for horizontal bar. */ int hmax; int hOrigin; int hExtent; Position hsbX,hsbY; Dimension hsbWidth,hsbHeight; /* Dimensions for the horiz bar */ Position vsbX,vsbY; Dimension vsbWidth,vsbHeight; /* Dimensions for the vertical bar */ Position GivenHeight, GivenWidth; /* these 2 fields are now obsolete, we re-use them for a different purpose, to track the initial position of the scrollbars */ #define sw_prev_x GivenWidth #define sw_prev_y GivenHeight Dimension AreaWidth,AreaHeight; Dimension WidthPad,HeightPad; Position XOffset, YOffset; Dimension pad; Boolean hasHSB; Boolean hasVSB; Boolean InInit; Boolean FromResize; unsigned char VisualPolicy; unsigned char ScrollPolicy; unsigned char ScrollBarPolicy; unsigned char Placement; XmScrollBarWidget hScrollBar; XmScrollBarWidget vScrollBar; XmDrawingAreaWidget ClipWindow; Widget WorkWindow; XtCallbackList traverseObscuredCallback; XtEnum auto_drag_model; XtIntervalId auto_drag_timer; Boolean scroll_frame_inited ; XmScrollFrameData scroll_frame_data ; XtPointer auto_drag_rects; XtPointer auto_drag_closure; } XmScrolledWindowPart; /************************************************************************ * * * Full instance record declaration * * * ************************************************************************/ typedef struct _XmScrolledWindowRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmScrolledWindowPart swindow; } XmScrolledWindowRec; /* Frame constraint records */ typedef struct _XmScrolledWindowConstraintPart { unsigned char child_type; Position orig_x; Position orig_y; } XmScrolledWindowConstraintPart, * XmScrolledWindowConstraint; typedef struct _XmScrolledWindowConstraintRec { XmManagerConstraintPart manager; XmScrolledWindowConstraintPart swindow; } XmScrolledWindowConstraintRec, * XmScrolledWindowConstraintPtr; #define DEFAULT_HEIGHT 20 #define DEFAULT_WIDTH 20 #define RESOURCE_DEFAULT (-1) #define GetSWConstraint(w) \ (&((XmScrolledWindowConstraintPtr) (w)->core.constraints)->swindow) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScrolledWindowP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/IsMwmRun.c0000644000175000017500000000535512672140200012604 00000000000000/* $XConsortium: IsMwmRun.c /main/7 1996/05/21 12:02:11 pascale $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" /************************************************************************ * * XmIsMotifWMRunning * ************************************************************************/ Boolean XmIsMotifWMRunning( Widget shell ) { Atom motif_wm_info_atom; Atom actual_type; int actual_format; unsigned long num_items, bytes_after; PropMotifWmInfo *prop = 0; Window root = RootWindowOfScreen(XtScreen(shell)); _XmWidgetToAppContext(shell); _XmAppLock(app); motif_wm_info_atom = XInternAtom(XtDisplay(shell), _XA_MOTIF_WM_INFO, FALSE); _XmProcessLock(); XGetWindowProperty (XtDisplay(shell), root, motif_wm_info_atom, 0, (long)PROP_MOTIF_WM_INFO_ELEMENTS, FALSE, motif_wm_info_atom, &actual_type, &actual_format, &num_items, &bytes_after, (unsigned char **) &prop); _XmProcessUnlock(); if ((actual_type != motif_wm_info_atom) || (actual_format != 32) || (num_items < PROP_MOTIF_WM_INFO_ELEMENTS)) { if (prop != 0) XFree((char *)prop); _XmAppUnlock(app); return (FALSE); } else { Window wm_window = (Window) prop->wmWindow; Window top, parent, *children; unsigned int num_children; Boolean returnVal; Cardinal i; if (XQueryTree(XtDisplay(shell), root, &top, &parent, &children, &num_children)) { i = 0; while ((i < num_children) && (children[i] != wm_window)) i++; returnVal = (i == num_children) ? FALSE : TRUE; } else returnVal = FALSE; if (prop) XFree((char *)prop); if (children) XFree((char *)children); _XmAppUnlock(app); return (returnVal); } } motif-2.3.8/lib/Xm/TraitI.h0000644000175000017500000000257112672140200012261 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: TraitI.h /main/5 1995/07/13 18:13:57 drk $ */ #ifndef _XmTraitI_h #define _XmTraitI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmInitializeTraits(void); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTraitI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/LabelGI.h0000644000175000017500000000714412672140200012325 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: LabelGI.h /main/5 1995/07/13 17:31:31 drk $ */ #ifndef _XMLABELGI_H #define _XMLABELGI_H #include #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern int _XmLabelCacheCompare( XtPointer A, XtPointer B) ; extern void _XmCalcLabelGDimensions( Widget wid) ; extern void _XmReCacheLabG( Widget wid) ; extern void _XmAssignLabG_MarginHeight( XmLabelGadget lw, #if NeedWidePrototypes int value) ; #else Dimension value) ; #endif /* NeedWidePrototypes */ extern void _XmLabelGCalcTextRect( Widget wid) ; extern void _XmAssignLabG_MarginWidth( XmLabelGadget lw, #if NeedWidePrototypes int value) ; #else Dimension value) ; #endif /* NeedWidePrototypes */ extern void _XmAssignLabG_MarginLeft( XmLabelGadget lw, #if NeedWidePrototypes int value) ; #else Dimension value) ; #endif /* NeedWidePrototypes */ extern void _XmAssignLabG_MarginRight( XmLabelGadget lw, #if NeedWidePrototypes int value) ; #else Dimension value) ; #endif /* NeedWidePrototypes */ extern void _XmAssignLabG_MarginTop( XmLabelGadget lw, #if NeedWidePrototypes int value) ; #else Dimension value) ; #endif /* NeedWidePrototypes */ extern void _XmAssignLabG_MarginBottom( XmLabelGadget lw, #if NeedWidePrototypes int value) ; #else Dimension value) ; #endif /* NeedWidePrototypes */ extern void _XmProcessDrag( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern Boolean _XmLabelGCVTRedraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); extern void _XmRedisplayLabG (Widget w, XEvent *event, Region region, LRectangle *background_box); extern void _XmLabelGCloneMenuSavvy(WidgetClass, XmMenuSavvyTrait); extern void _XmLabelSetBackgroundGC(XmLabelGadget lw); extern void _XmLabelGCalcTextRect(Widget wid); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XMLABELGI_H */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Column.h0000644000175000017500000000325112672140200012316 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef __Xmcolumn_h__ #define __Xmcolumn_h__ #ifdef __cplusplus extern "C" { #endif #include #include extern WidgetClass xmColumnWidgetClass; typedef struct _XmColumnClassRec * XmColumnWidgetClass; typedef struct _XmColumnRec * XmColumnWidget; #ifndef XmIsColumn #define XmIsColumn(w) (XtIsSubclass(w, xmColumnWidgetClass)) #endif extern Widget XmCreateColumn(Widget, String, ArgList, Cardinal); /* * Variable argument list functions */ extern Widget XmVaCreateColumn( Widget parent, char *name, ...); extern Widget XmVaCreateManagedColumn( Widget parent, char *name, ...); #ifdef __cplusplus } #endif #endif /* __column_h__ */ motif-2.3.8/lib/Xm/CascadeBI.h0000644000175000017500000000343312672140200012621 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: CascadeBI.h /main/6 1995/07/14 10:15:09 drk $ */ #ifndef _XmCascadeBI_h #define _XmCascadeBI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmCBHelp( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmCascadingPopup( Widget cb, XEvent *event, #if NeedWidePrototypes int doCascade) ; #else Boolean doCascade) ; #endif /* NeedWidePrototypes */ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCascadeBI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DrawUtils.c0000644000175000017500000000724512672140200013001 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #include #include #define STATIC_RECTS 20 /* * Function: * XmDrawBevel(dpy, d, top_GC, bottom_GC, x, y, size, option) * Description: * Draws a shadow corner (beveled) at the given location and size. * Input: * dpy : Display* - the display to draw to * d : Drawable - the drawable to use * top_GC : GC - the GC to use to draw the top half of * the bevel * bottom_GC : GC - the GC to use to draw the bottom half * of the bevel * x : int - the x location of the corner * y : int - the y location of the corner * size : unsigned int - the size of the corner * (width = height = size) * option : XmBevelOption- what part of the bevel should we draw. * Output: * None. */ void #ifndef _NO_PROTO XmDrawBevel(Display *dpy, Drawable d, GC top_gc, GC bottom_gc, int x, int y, unsigned int size, XmBevelOption option) #else XmDrawBevel(dpy, d, top_gc, bottom_gc, x, y, size, option) Display *dpy; Drawable d; GC top_gc, bottom_gc; int x, y; unsigned int size; XmBevelOption option; #endif { static XRectangle saved[STATIC_RECTS], *alloced = NULL; static int numAlloced = 0; XRectangle *rt; int i; /* * First lets see if we can get away with using our list rectangles * without allocating any. */ if( size < STATIC_RECTS ) { /* * OK we don't need to allocate any so lets use the static * array. */ rt = saved; } else { /* * Well we need more than our static array holds so lets see * if we have enough in our alloced array and if no lets * allocate what we need. */ if( size > numAlloced ) { numAlloced = size; alloced = (XRectangle*) XtRealloc((XtPointer) alloced, sizeof(XRectangle) * numAlloced); } rt = alloced; } /* * Now that we have enough rectangles to fill in an area lets * set up the rectangles and pass them off to be drawn. First the * top half of the beveled corner ... */ if( option == XmBEVEL_TOP ) { for( i = 0; i < size; ++i ) { rt[i].x = x; rt[i].y = y + i; rt[i].width = size - i; rt[i].height = 1; } XFillRectangles(dpy, d, top_gc, rt, size); } else if( option == XmBEVEL_BOTH ) { XFillRectangle(dpy, d, top_gc, x, y, size, size); } /* * ... And the the bottom half of the beveled corner. */ if( option == XmBEVEL_BOTH || option == XmBEVEL_BOTTOM ) { for( i = 0; i < size; ++i ) { rt[i].x = x + size - i; rt[i].y = y + i; rt[i].width = i; rt[i].height = 1; } XFillRectangles(dpy, d, bottom_gc, rt, size); } } motif-2.3.8/lib/Xm/XmStringFunc.c0000644000175000017500000005371012672140200013450 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: XmStringFunc.c /main/9 1999/10/14 11:20:50 mgreess $" #endif #endif #include #include "XmI.h" #include "XmStringI.h" #include "XmRenderTI.h" #include "XmTabListI.h" /******** Static Function Declarations ********/ static void new_line(_XmString string) ; /******** End Static Function Declarations ********/ XmStringComponentType XmStringPeekNextTriple(XmStringContext context) { unsigned int len; XtPointer val; return XmeStringGetComponent((_XmStringContext) context, False, False, &len, &val); } Boolean XmStringHasSubstring( XmString string, XmString substring ) { _XmStringContextRec stack_context; char *text; char *subtext; short char_count; short subchar_count; Boolean found; int i, j, max; _XmStringEntry line, *entry, seg; XmStringComponentType type; unsigned int len; XtPointer val; _XmProcessLock(); if ((string == NULL) || (substring == NULL) || (XmStringEmpty(substring))) { _XmProcessUnlock(); return (FALSE); } /* * The substring must be a one line/one segment string. */ if (_XmStrEntryCountGet(substring) != 1) { _XmProcessUnlock(); return (FALSE); } if (((entry = _XmStrEntryGet(substring)) != NULL) && _XmEntrySegmentCountGet(entry[0]) > 1) { _XmProcessUnlock(); return (FALSE); } /* * Get the text out of the substring. */ if (_XmStrOptimized(substring)) { subchar_count = (short)_XmStrByteCount(substring); subtext = (char *)_XmStrText(substring); } else if (_XmStrMultiple(substring)) { line = entry[0]; if (_XmEntryMultiple(line)) { seg = (_XmStringEntry)_XmEntrySegmentGet(line)[0]; subchar_count = (short)_XmEntryByteCountGet(seg); subtext = (char*) _XmEntryTextGet(seg); } else { subchar_count = (short)_XmEntryByteCountGet(line); subtext = (char*) _XmEntryTextGet(line); } } else { /* Oops, some weird string! */ _XmProcessUnlock(); return (FALSE); } if ((subchar_count == 0) || (subtext == NULL)) { _XmProcessUnlock(); return (FALSE); } /** Find a text component that matches. **/ if (string) { _XmStringContextReInit(&stack_context, string); while ((type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END) { switch(type) { case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: char_count = len; text = (char *)val; if (char_count >= subchar_count) { max = char_count - subchar_count; for (i = 0; i <= max; i++) { found = TRUE; for (j = 0; j < subchar_count; j++) { if (text[i+j] != subtext[j]) { found = FALSE; break; } } if (found) { _XmStringContextFree(&stack_context); _XmProcessUnlock(); return(TRUE); } } } break; default: break; } } _XmStringContextFree(&stack_context); } _XmProcessUnlock(); return (FALSE); } XmStringTable XmStringTableParseStringArray(XtPointer *strings, Cardinal count, XmStringTag tag, XmTextType type, XmParseTable parse, Cardinal parse_count, XtPointer call_data) { int i; XmStringTable strs; _XmProcessLock(); if ((strings == NULL) || (count == 0)) { _XmProcessUnlock(); return(NULL); } strs = (XmStringTable)XtMalloc(count * sizeof(XmString)); for (i = 0; i < count; i++) { strs[i] = XmStringParseText(strings[i], NULL, tag, type, parse, parse_count, call_data); } _XmProcessUnlock(); return(strs); } XtPointer * XmStringTableUnparse(XmStringTable table, Cardinal count, XmStringTag tag, XmTextType tag_type, XmTextType output_type, XmParseTable parse, Cardinal parse_count, XmParseModel parse_model) { XtPointer *strs; int i; _XmProcessLock(); if ((table == NULL) || (count == 0)) { _XmProcessUnlock(); return(NULL); } strs = (XtPointer *)XtMalloc(count * sizeof(XtPointer)); for (i = 0; i < count; i++) strs[i] = XmStringUnparse(table[i], tag, tag_type, output_type, parse, parse_count, parse_model); _XmProcessUnlock(); return(strs); } XmString XmStringTableToXmString(XmStringTable table, Cardinal count, XmString break_comp) { /* Note: this is a very expensive way to do this. Fix for Beta */ int i; XmString str = NULL, tmp1, tmp2; _XmProcessLock(); tmp1 = NULL; for (i = 0; i < count; i++) { tmp2 = XmStringConcatAndFree(tmp1, XmStringCopy(table[i])); str = XmStringConcatAndFree(tmp2, XmStringCopy(break_comp)); tmp1 = str; } _XmProcessUnlock(); return(str); } XmString XmStringPutRendition(XmString string, XmStringTag rendition) { /* Quick and dirty. Fix for beta! */ XmString str, tmp1, tmp2; tmp1 = XmStringComponentCreate(XmSTRING_COMPONENT_RENDITION_BEGIN, strlen(rendition), (XtPointer)rendition); tmp2 = XmStringConcatAndFree(tmp1, XmStringCopy(string)); tmp1 = XmStringComponentCreate(XmSTRING_COMPONENT_RENDITION_END, strlen(rendition), (XtPointer)rendition); str = XmStringConcatAndFree(tmp2, tmp1); return(str); } void XmParseMappingGetValues(XmParseMapping mapping, ArgList arg_list, Cardinal arg_count) { register Cardinal i; register String arg_name; _XmProcessLock(); /* Do a little error checking. */ if (mapping == NULL) { _XmProcessUnlock(); return; } /* Modify the specified values. */ for (i = 0; i < arg_count; i++) { arg_name = arg_list[i].name; if ((arg_name == XmNpattern) || (strcmp(arg_name, XmNpattern) == 0)) *((XtPointer*)arg_list[i].value) = mapping->pattern; else if ((arg_name == XmNpatternType) || (strcmp(arg_name, XmNpatternType) == 0)) *((XmTextType*)arg_list[i].value) = mapping->pattern_type; else if ((arg_name == XmNsubstitute) || (strcmp(arg_name, XmNsubstitute) == 0)) *((XmString*)arg_list[i].value) = XmStringCopy(mapping->substitute); else if ((arg_name == XmNinvokeParseProc) || (strcmp(arg_name, XmNinvokeParseProc) == 0)) *((XmParseProc*)arg_list[i].value) = mapping->parse_proc; else if ((arg_name == XmNclientData) || (strcmp(arg_name, XmNclientData) == 0)) *((XtPointer*)arg_list[i].value) = mapping->client_data; else if ((arg_name == XmNincludeStatus) || (strcmp(arg_name, XmNincludeStatus) == 0)) *((XmIncludeStatus*)arg_list[i].value) = mapping->include_status; } _XmProcessUnlock(); } void XmParseMappingFree(XmParseMapping mapping) { _XmProcessLock(); if (mapping != NULL) { /* Free copied data. */ XmStringFree(mapping->substitute); /* Free the record. */ XtFree((char*) mapping); } _XmProcessUnlock(); } void XmParseTableFree(XmParseTable parse_table, Cardinal parse_count) { /* Free each entry in the table. */ Cardinal i; _XmProcessLock(); for (i = 0; i < parse_count; i++) XmParseMappingFree(parse_table[i]); /* Free the table itself. */ XtFree((char*) parse_table); _XmProcessUnlock(); } /* * XmeGetNextCharacter: An XmParseProc to consume the triggering * character and insert the following character. */ /*ARGSUSED*/ XmIncludeStatus XmeGetNextCharacter(XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag tag, XmParseMapping entry, /* unused */ int pattern_length, XmString *str_include, XtPointer call_data) /* unused */ { char* ptr = (char*) *in_out; int len = 0; XmStringComponentType comp_type; assert(in_out != NULL); _XmProcessLock(); /* Initialize the out parameters */ *str_include = NULL; /* Consume the triggering characters. */ ptr += pattern_length; /* Select the component type. */ switch (type) { case XmCHARSET_TEXT: if ((tag != NULL) && (strcmp(XmFONTLIST_DEFAULT_TAG, tag) == 0)) comp_type = XmSTRING_COMPONENT_LOCALE_TEXT; else comp_type = XmSTRING_COMPONENT_TEXT; if ((text_end == NULL) || (ptr < (char*) text_end)) #ifndef NO_MULTIBYTE len = mblen(ptr, MB_CUR_MAX); #else len = *ptr ? 1 : 0; #endif break; case XmMULTIBYTE_TEXT: /* In Motif 2.0 dynamic switching of locales isn't supported. */ comp_type = XmSTRING_COMPONENT_LOCALE_TEXT; if ((text_end == NULL) || (ptr < (char*) text_end)) #ifndef NO_MULTIBYTE len = mblen(ptr, MB_CUR_MAX); #else len = *ptr ? 1 : 0; #endif break; case XmWIDECHAR_TEXT: comp_type = XmSTRING_COMPONENT_WIDECHAR_TEXT; if ((text_end == NULL) || (ptr < (char*) text_end)) len = sizeof(wchar_t); break; default: comp_type = XmSTRING_COMPONENT_UNKNOWN; break; } /* Quit if mblen() failed or if type was unrecognized. */ if ((len <= 0) || (comp_type == XmSTRING_COMPONENT_UNKNOWN)) { *in_out = (XtPointer) ptr; _XmProcessUnlock(); return XmINSERT; } /* Create a component containing the next character. */ *str_include = XmStringComponentCreate(comp_type, len, ptr); ptr += len; *in_out = (XtPointer) ptr; _XmProcessUnlock(); return XmINSERT; } static void new_line( _XmString string ) { int lc = _XmStrEntryCount(string); _XmStringEntry line; _XmStrImplicitLine(string) = TRUE; _XmStrEntry(string) = (_XmStringEntry *) XtRealloc((char *) _XmStrEntry(string), sizeof(_XmStringEntry) * (lc + 1)); _XmEntryCreate(line, XmSTRING_ENTRY_ARRAY); _XmStrEntry(string)[lc] = line; _XmEntrySegmentCount(line) = 0; _XmEntrySegment(line) = NULL; _XmStrEntryCount(string)++; } static XmString MakeStrFromSeg(XmStringContext start) { _XmStringEntry *line; _XmStringEntry *segs, seg; _XmString str; if (_XmStrContOpt(start)) { _XmStrContError(start) = TRUE; return(XmStringCopy(_XmStrContString(start))); } else { /* get segment */ line = _XmStrEntry(_XmStrContString(start)); /* Create XmString structure */ _XmStrCreate(str, XmSTRING_MULTIPLE_ENTRY, 0); if (_XmEntryMultiple(line[_XmStrContCurrLine(start)])) { segs = (_XmStringEntry*)_XmEntrySegment(line[_XmStrContCurrLine(start)]); new_line(str); if (_XmStrContCurrSeg(start) < _XmEntrySegmentCount(line)) { seg = segs[_XmStrContCurrSeg(start)]; _XmStringSegmentNew(str, 0, seg, True); _XmStrContCurrSeg(start)++; _XmStrContDir(start) = _XmEntryDirectionGet(seg); _XmStrContTag(start) = _XmEntryTag(seg); _XmStrContTagType(start) = (XmTextType) _XmEntryTextTypeGet(seg); } else { new_line(str); _XmStrContCurrSeg(start) = 0; _XmStrContCurrLine(start)++; } } else { seg = line[_XmStrContCurrLine(start)]; _XmStringSegmentNew(str, 0, seg, True); _XmStrContCurrSeg(start) = 0; _XmStrContCurrLine(start)++; _XmStrContDir(start) = _XmEntryDirectionGet(seg); _XmStrContTag(start) = _XmEntryTag(seg); _XmStrContTagType(start) = (XmTextType) _XmEntryTextTypeGet(seg); } _XmStrContState(start) = PUSH_STATE; } return(str); } static Boolean LastSeg(XmStringContext start) { _XmStringEntry *line; if (_XmStrContOpt(start)) { return(TRUE); } else { line = _XmStrEntry(_XmStrContString(start)); if (_XmEntryMultiple(line[_XmStrContCurrLine(start)])) return(_XmStrContCurrSeg(start) == _XmEntrySegmentCount(line)); else return(TRUE); } } static Boolean ContextsMatch(XmStringContext a, XmStringContext b) { if ((_XmStrContCurrLine(a) == _XmStrContCurrLine(b)) && (_XmStrContCurrSeg(a) == _XmStrContCurrSeg(b)) && (_XmStrContState(a) == _XmStrContState(b))) if (((_XmStrContState(a) == BEGIN_REND_STATE) || (_XmStrContState(a) == END_REND_STATE))) if (_XmStrContRendIndex(a) == _XmStrContRendIndex(b)) return(TRUE); else return(FALSE); else return(TRUE); else return(FALSE); } static XmString MakeStr(XmStringContext start, XmStringContext end) { /* This is quick and dirty, need to be smarter about it before Beta. */ XmStringComponentType type; unsigned int len; XtPointer val; XmString str; /* Next component over start until at segment break */ str = NULL; while (_XmStrContState(start) != PUSH_STATE) { type = XmeStringGetComponent(start, TRUE, FALSE, &len, &val); if (ContextsMatch(start, end)) return(str); str = XmStringConcatAndFree(str, XmStringComponentCreate(type, len, val)); } /* Next segment over start incrementing until one segment before context */ while ((_XmStrContCurrLine(start) < (_XmStrContCurrLine(end) - 1)) || ((_XmStrContCurrLine(start) == _XmStrContCurrLine(end)) && (_XmStrContCurrSeg(start) < _XmStrContCurrSeg(end))) || !LastSeg(start)) { str = XmStringConcatAndFree(str, MakeStrFromSeg(start)); } /* Next component over start until it matches context */ type = XmeStringGetComponent(start, TRUE, FALSE, &len, &val); while (!ContextsMatch(start, end)) { str = XmStringConcatAndFree(str, XmStringComponentCreate(type, len, val)); type = XmeStringGetComponent(start, TRUE, FALSE, &len, &val); } return(str); } Cardinal XmStringToXmStringTable(XmString string, XmString break_component, XmStringTable *table) { /* Note: this is a very expensive way to do this. Fix for Beta */ _XmStringContextRec stack_context, stack_start; XmStringComponentType type, b_type; unsigned int len, b_len; XtPointer val, b_val; int i, count; _XmProcessLock(); /* Get triple for first component of break_component */ if (break_component) { _XmStringContextReInit(&stack_context, break_component); b_type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &b_len, &b_val); _XmStringContextFree(&stack_context); } else /* Nothing to match against. Return complete string. */ { if (table != NULL) { *table = (XmStringTable)XtMalloc(sizeof(XmString)); *table[0] = XmStringCopy(string); } _XmProcessUnlock(); return(1); } /* Get context */ if (!string) { if (table != NULL) *table = NULL; _XmProcessUnlock(); return(0); } _XmStringContextReInit(&stack_context, string); /* Count number of entries for table */ count = 0; while ((type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END) { if ((type == b_type) && (len == b_len) && (memcmp(val, b_val, len) == 0)) count++; } /* Allocate table and insert new strings */ if (table != NULL) { *table = (XmStringTable)XtMalloc(count * sizeof(XmString)); _XmStringContextReInit(&stack_context, string); _XmStringContextReInit(&stack_start, string); i = 0; while ((type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END) { if ((type == b_type) && (len == b_len) && (memcmp(val, b_val, len) == 0)) { /* make XmString from start to end */ (*table)[i] = MakeStr(&stack_start, &stack_context); i++; } } _XmStringContextFree(&stack_start); } _XmStringContextFree(&stack_context); _XmProcessUnlock(); return(count); } XmTabList XmStringTableProposeTablist(XmStringTable strings, Cardinal num_strings, Widget widget, float pad_value, XmOffsetModel offset_model) { int i, j; _XmStringContextRec stack_ctx; XmTabList tl; XmTab tab, prev, start; float width, val; unsigned char units; Arg args[1]; int n; _XmRenditionRec scratch; XmRendition rend; _XmRendition tmp; XmRenderTable rt; NextTabResult ret_val; _XmProcessLock(); if ((strings == NULL) || (num_strings == 0)) { _XmProcessUnlock(); return ((XmTabList)NULL); } bzero((char*) &scratch, sizeof(_XmRenditionRec)); tmp = &scratch; rend = &tmp; _XmRendDisplay(rend) = XtDisplayOfObject(widget); n = 0; XtSetArg(args[n], XmNrenderTable, &rt); n++; XtGetValues(widget, args, n); /* Work around weird bug with XtGetValues. */ n = 0; XtSetArg(args[n], XmNunitType, &units); n++; XtGetValues(widget, args, n); if (rt == NULL) rt = XmeGetDefaultRenderTable(widget, XmTEXT_FONTLIST); tab = XmTabCreate(0.0, units, offset_model, XmALIGNMENT_BEGINNING, "."); tl = XmTabListInsertTabs(NULL, &tab, 1, 0); XmTabFree(tab); for (i = 0; i < num_strings; i++) { if (!strings[i]) { /* Clean up */ XmTabListFree(tl); _XmProcessUnlock(); return((XmTabList)NULL); } _XmStringContextReInit(&stack_ctx, strings[i]); tab = _XmTabLStart(tl); val = 0.0; /* Scan str for tabs, update tl if necessary. */ j = 0; while ((ret_val = _XmStringGetNextTabWidth(&stack_ctx, widget, units, rt, &width, &rend)) != XmTAB_EOS) { if (ret_val == XmTAB_NEWLINE) { tab = _XmTabLStart(tl); j = 0; continue; } val = width + pad_value; if (j >= _XmTabLCount(tl)) /* Need to add a tab */ { tab = XmTabCreate(0.0, units, offset_model, XmALIGNMENT_BEGINNING, "."); start = _XmTabLStart(tl); prev = _XmTabPrev(start); _XmTabNext(prev) = tab; _XmTabPrev(tab) = prev; _XmTabNext(tab) = start; _XmTabPrev(start) = tab; _XmTabLCount(tl)++; } else if (j > 0) { tab = _XmTabNext(tab); } if (val > _XmTabValue(tab)) XmTabSetValue(tab, val); else val = _XmTabValue(tab); j++; } _XmStringContextFree(&stack_ctx); } if (offset_model == XmABSOLUTE) { start = _XmTabLStart(tl); val = _XmTabValue(start); for (tab = _XmTabNext(start); tab != start; tab = _XmTabNext(tab)) { val += _XmTabValue(tab); XmTabSetValue(tab, val); } } _XmProcessUnlock(); return(tl); } /* * Helper function for XmTabList.c * This routine performs successive reads on an XmStringContext * and returns the width (in units of XmNunitType of widget) of * the text segments between the previous and next tab or end of line. * It uses the XmNrenderTable from widget to calculate the width. It * returns XmTAB_EOS if the end of the string has been reached, XmTAB_NEWLINE * if the end of line is reached and XmTAB_NEXT if a tab is encountered. */ NextTabResult _XmStringGetNextTabWidth(XmStringContext ctx, Widget widget, unsigned char units, XmRenderTable rt, float *width, XmRendition *rend) { float divisor; int toType; /* passed to XmConvertUnits */ Dimension w_sum, w_cur; if (_XmStrContError(ctx)) { *width = 0.0; return(XmTAB_EOS); } w_sum = 0; *width = 0.0; /* Big units need to be converted to small ones. */ toType = _XmConvertFactor(units, &divisor); /* Calculate the width to the next tab. */ if (_XmStrContOpt(ctx)) { _XmStrContError(ctx) = True; return(XmTAB_EOS); } else { _XmString str = _XmStrContString(ctx); _XmStringEntry line; int line_count; _XmStringEntry seg; int seg_count; _XmStringArraySegRec array_seg; line_count = _XmStrLineCountGet(str); /* Keep checking lines and segments until we run out or hit a tab. */ if (_XmStrContCurrLine(ctx) < line_count) { if (_XmStrImplicitLine(str)) { line = _XmStrEntry(str)[_XmStrContCurrLine(ctx)]; } else { _XmEntryType(&array_seg) = XmSTRING_ENTRY_ARRAY; _XmEntrySegmentCount(&array_seg) = _XmStrEntryCount(str); _XmEntrySegment(&array_seg) = (_XmStringNREntry *)_XmStrEntry(str); line = (_XmStringEntry)&array_seg; } if (_XmEntryMultiple(line)) seg_count = _XmEntrySegmentCount(line); else seg_count = 1; if (seg_count == 0) { /* Empty line. */ _XmStrContCurrLine(ctx)++; *width = 0.0; return(XmTAB_NEWLINE); } while (_XmStrContCurrSeg(ctx) < seg_count) { if (_XmEntryMultiple(line)) seg = (_XmStringEntry)_XmEntrySegment(line)[_XmStrContCurrSeg(ctx)]; else seg = line; w_cur = 0; if (_XmStrContTabCount(ctx) < _XmEntryTabsGet(seg)) { _XmStrContTabCount(ctx)++; *width = (XmConvertUnits(widget, XmHORIZONTAL, XmPIXELS, w_sum, toType) / divisor); return(XmTAB_NEXT); } (void)_XmStringSegmentExtents(seg, rt, rend, NULL, &w_cur, NULL, NULL, NULL); w_sum += w_cur; _XmStrContCurrSeg(ctx)++; _XmStrContTabCount(ctx) = 0; } _XmStrContCurrLine(ctx)++; _XmStrContCurrSeg(ctx) = 0; _XmStrContTabCount(ctx) = 0; return(XmTAB_NEWLINE); } _XmStrContError(ctx) = True; return(XmTAB_EOS); } } motif-2.3.8/lib/Xm/ScroVis.c0000644000175000017500000001351412672140200012447 00000000000000/* $XConsortium: ScroVis.c /main/6 1995/09/19 23:07:44 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "ScrollFramTI.h" #include "MessagesI.h" #include "XmI.h" #define SWMessage1 _XmMMsgScrollVis_0000 /************************************************************************ * * * XmScrollVisible - TraverseObscureCallback helper * * * ************************************************************************/ void XmScrollVisible( Widget scrw, Widget wid, Dimension hor_margin, Dimension ver_margin) /********************* * A function that makes visible a unvisible or partially visible descendant * of an AUTOMATIC scrolledwindow workwindow. ********************* * - scrw is the ScrolledWindow whose workwindow act as the origin of the move. * - wid is the widget to be made visible. * - hor_margin, ver_margin are the margins between the widget in its new * position and the scrolledwindow clipwindow. **********************/ { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) scrw ; register Position newx, newy, /* new workwindow position */ wx, wy ; /* current workwindow position */ register unsigned short tw, th, /* widget sizes */ cw, ch ; /* clipwindow sizes */ Position dx, dy ; /* position inside the workwindow */ Position src_x, src_y, dst_x, dst_y ; Widget w ; XmScrolledWindowConstraint swc; XmNavigatorDataRec nav_data ; _XmWidgetToAppContext(scrw); _XmAppLock(app); /* check param */ if (!((scrw) && (XmIsScrolledWindow(scrw)) && (sw->swindow.ScrollPolicy == XmAUTOMATIC))) { XmeWarning(scrw, SWMessage1); _XmAppUnlock(app); return ; } /* loop up in search for a "workwindow" */ w = wid; while (w && (XtParent(w) != (Widget) sw->swindow.ClipWindow)) w = XtParent(w); if (!w) { XmeWarning(scrw, SWMessage1); _XmAppUnlock(app); return ; } /* w is the potentially scrollable ascendant of wid that needs to be scrolled, its parent is the clip window */ /* In the new scheme, w might not be able to scroll at all, or even in the direction the margins point to. There is nothing much we can do about that except document that traversing to an unvisible kid of unscrollable workwindow will not scroll it, resulting in unvisible focus widget. We could check for NO_SCROLL in w, but since we cannot check for SCROLL_HOR or SCROLL_VERT - depend on the traversal layout - I'd rather do nothing */ /* we need to get the position of wid relative to w, so we use 2 XtTranslateCoords */ XtTranslateCoords(wid, 0, 0, &src_x, &src_y); XtTranslateCoords(w, 0, 0, &dst_x, &dst_y); dx = src_x - dst_x ; dy = src_y - dst_y ; swc = GetSWConstraint(w); /* get the other positions and sizes */ cw = XtWidth((Widget) sw->swindow.ClipWindow) ; ch = XtHeight((Widget) sw->swindow.ClipWindow) ; wx = swc->orig_x - XtX(w) ; wy = swc->orig_y - XtY(w) ; /* both always positive */ tw = XtWidth(wid) ; th = XtHeight(wid) ; /* find out the zone where the widget lies and set newx,newy (neg) for the workw */ /* if the widget is bigger than the clipwindow, we put it on the left, top or top/left, depending on the zone it was */ if (dy < wy) { /* North */ newy = dy - (Position)ver_margin ; /* stuck it on top + margin */ } else if ((dy + th) <= (ch - XtY(w))) { newy = wy ; /* in the middle : don't move y */ } else { /* South */ if (th > ch) newy = dy - (Position)ver_margin ; /* stuck it on top if too big */ else newy = swc->orig_y + dy - ch + th + (Position)ver_margin; } if (dx < wx) { /* West */ newx = dx - (Position)hor_margin ; /* stuck it on left + margin */ } else if ((dx + tw) <= (cw - XtX(w))) { newx = wx ; /* in the middle : don't move x */ } else { /* East */ if (tw > cw) newx = dx - (Position)hor_margin ; /* stuck it on left if too big */ else newx = swc->orig_x + dx - cw + tw + (Position)hor_margin; } /* a last check */ if (newx > sw->swindow.hmax - sw->swindow.hExtent) newx = sw->swindow.hmax - sw->swindow.hExtent; if (newy > sw->swindow.vmax - sw->swindow.vExtent) newy = sw->swindow.vmax - sw->swindow.vExtent; if (newx < sw->swindow.hmin) newx = sw->swindow.hmin ; if (newy < sw->swindow.vmin) newy = sw->swindow.vmin ; nav_data.valueMask = NavValue ; nav_data.value.x = newx ; nav_data.value.y = newy ; nav_data.dimMask = NavigDimensionX|NavigDimensionY ; _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, True); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/CareVisualTI.h0000644000175000017500000000266512672140200013364 00000000000000/* $XConsortium: CareVisualTI.h /main/5 1995/07/15 20:48:25 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmCareVisualTI_h #define _XmCareVisualTI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern Boolean _XmNotifyChildrenVisual( Widget cur, Widget new_w, Mask visual_flag) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCareVisualTI_h */ motif-2.3.8/lib/Xm/GrabShell.h0000644000175000017500000000346412672140200012732 00000000000000/* $XConsortium: GrabShell.h /main/5 1995/07/15 20:51:22 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmGrabShell_h #define _XmGrabShell_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmGrabShellWidgetClass; typedef struct _XmGrabShellClassRec * XmGrabShellWidgetClass; typedef struct _XmGrabShellWidgetRec * XmGrabShellWidget; #ifndef XmIsGrabShell #define XmIsGrabShell(w) XtIsSubclass(w, xmGrabShellWidgetClass) #endif /* XmIsGrabShell */ /******** Public Function Declarations ********/ extern Widget XmCreateGrabShell( Widget parent, char *name, ArgList al, Cardinal ac) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGrabShell_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmCrIFrBuf.c0000644000175000017500000000752412672140200013152 00000000000000/* $XConsortium: XpmCrIFrBuf.c /main/2 1996/09/20 08:03:23 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrIFrBuf.c: * * * * XPM library * * Parse an Xpm buffer (file in memory) and create the image and possibly its * * mask * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" LFUNC(OpenBuffer, void, (char *buffer, xpmData *mdata)); int XpmCreateImageFromBuffer(display, buffer, image_return, shapeimage_return, attributes) Display *display; char *buffer; XImage **image_return; XImage **shapeimage_return; XpmAttributes *attributes; { XpmImage image; XpmInfo info; int ErrorStatus; xpmData mdata; xpmInitXpmImage(&image); xpmInitXpmInfo(&info); /* open buffer to read */ OpenBuffer(buffer, &mdata); /* create the XImage from the XpmData */ if (attributes) { xpmInitAttributes(attributes); xpmSetInfoMask(&info, attributes); ErrorStatus = xpmParseDataAndCreate(display, &mdata, image_return, shapeimage_return, &image, &info, attributes); } else ErrorStatus = xpmParseDataAndCreate(display, &mdata, image_return, shapeimage_return, &image, NULL, attributes); if (attributes) { if (ErrorStatus >= 0) /* no fatal error */ xpmSetAttributes(attributes, &image, &info); XpmFreeXpmInfo(&info); } /* free the XpmImage */ XpmFreeXpmImage(&image); return (ErrorStatus); } int XpmCreateXpmImageFromBuffer(buffer, image, info) char *buffer; XpmImage *image; XpmInfo *info; { xpmData mdata; int ErrorStatus; /* init returned values */ xpmInitXpmImage(image); xpmInitXpmInfo(info); /* open buffer to read */ OpenBuffer(buffer, &mdata); /* create the XpmImage from the XpmData */ ErrorStatus = xpmParseData(&mdata, image, info); return (ErrorStatus); } /* * open the given buffer to be read or written as an xpmData which is returned */ static void OpenBuffer(buffer, mdata) char *buffer; xpmData *mdata; { mdata->type = XPMBUFFER; mdata->cptr = buffer; mdata->CommentLength = 0; } motif-2.3.8/lib/Xm/DropSMgr.c0000644000175000017500000036520213145162623012571 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DropSMgr.c /main/21 1999/08/11 14:44:57 vipin $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /***************************************************************************** * THE DROPSITE DATABASE * * Drag and Drop maintains a two way mapping between information records * and the dropsites widgets they represent. There are two kinds of records * kept in the database. * * The first kind of records are associated with a real dropsite. These * contain the information the user passes in via XmDropSiteRegister and * modifies via XmDropSiteUpdate. * * The second kind are clipping records which represent widgets which * in some way obscure one or more dropsites. These are created and destroyed * by Drag and Drop as dynamic things (like a ScrolledWindow scrolling) * occur. * * When a new record is created, it is associated via a hashtable kept * in dsm -> dstable to the widget it represents. This mapping is maintained * by the RegisterInfo and UnregisterInfo functions. Additionally, the * records themselves are kept internally in a compacted form. This * translation occurs in CopyVariantIntoFull and CopyFullIntoVariant. * * While confusing, the compression saves significant room. The fields * are accessed by macros (defined in DropSMgrI.h) to avoid the problems * of constantly compressing and decompressing the records. * * WHEN A CHANGE OCCURS * * When a new DS is added, one is removed, or a geometry change occurs, * the database must be brought up to sync with the real widgets. * This is done in a number of stages. * * RemoveAllClippers(dsm, root) - This removes all the clippers created * in the database hierarchy. The dropsites become a flat list held in * the child list of the topmost node. * * SyncDropSiteGeometry(dsm, root) - Now we go down the flat list and * see what updates are needed to the internal geometry information. This * is really needed for PREREGISTER, as we'll finalize the update by * refreshing the information kept on the window properties. * * DetectAndInsertAllClippers(dsm, root) - We now rebuild the clipper * hierarchy. *****************************************************************************/ #include #include #include #include #include #include /* for bzero */ #include "XmI.h" #include "DisplayI.h" #include "DragBSI.h" #include "DragCI.h" #include "DragICCI.h" #include "DragUnderI.h" #include "DropSMgrI.h" #include "HashI.h" #include "MessagesI.h" #include "PixConvI.h" #include "RegionI.h" #include "TraversalI.h" /* for _XmIntersectionOf() */ #define FIX_1212 #define MESSAGE1 _XmMMsgDropSMgr_0001 #define MESSAGE2 _XmMMsgDropSMgr_0002 #define MESSAGE3 _XmMMsgDropSMgr_0003 #define MESSAGE4 _XmMMsgDropSMgr_0004 #define MESSAGE5 _XmMMsgDropSMgr_0005 #define MESSAGE6 _XmMMsgDropSMgr_0006 #define MESSAGE7 _XmMMsgDropSMgr_0007 #define MESSAGE8 _XmMMsgDropSMgr_0008 #define MESSAGE9 _XmMMsgDropSMgr_0009 #define MESSAGE10 _XmMMsgDropSMgr_0010 /* #define DEBUG */ #ifdef DEBUG #define DPRINT(x) printf x void _XmPrintDSTree(XmDropSiteManagerObject dsm, XmDSInfo root); #else #define DPRINT(x) #endif /******** Static Function Declarations ********/ static void ClassInit( void ) ; static void ClassPartInit( WidgetClass wc) ; static void DropSiteManagerInitialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void CreateTable( XmDropSiteManagerObject dsm) ; static void DestroyTable( XmDropSiteManagerObject dsm) ; static void RegisterInfo( register XmDropSiteManagerObject dsm, register Widget widget, register XtPointer info) ; static void UnregisterInfo( register XmDropSiteManagerObject dsm, register XtPointer info) ; static XtPointer WidgetToInfo( register XmDropSiteManagerObject dsm, register Widget widget) ; static Boolean Coincident( XmDropSiteManagerObject dsm, Widget w, XmDSClipRect *r) ; static Boolean IsDescendent( Widget parentW, Widget childW) ; static void DetectAncestorClippers( XmDropSiteManagerObject dsm, Widget w, XmDSClipRect *r, XmDSInfo info) ; static void DetectImpliedClipper( XmDropSiteManagerObject dsm, XmDSInfo info) ; static void DetectAllClippers( XmDropSiteManagerObject dsm, XmDSInfo parentInfo) ; static Boolean InsertClipper( XmDropSiteManagerObject dsm, XmDSInfo parentInfo, XmDSInfo clipper) ; static void DetectAndInsertAllClippers( XmDropSiteManagerObject dsm, XmDSInfo root) ; static void RemoveClipper( XmDropSiteManagerObject dsm, XmDSInfo clipper) ; static void RemoveAllClippers( XmDropSiteManagerObject dsm, XmDSInfo parentInfo) ; static void DestroyDSInfo( XmDSInfo info, #if NeedWidePrototypes int substructures) ; #else Boolean substructures) ; #endif /* NeedWidePrototypes */ static XmDSInfo CreateShellDSInfo( XmDropSiteManagerObject dsm, Widget widget) ; static XmDSInfo CreateClipperDSInfo( XmDropSiteManagerObject dsm, Widget clipW) ; static void InsertInfo( XmDropSiteManagerObject dsm, XtPointer info, XtPointer call_data) ; static void RemoveInfo( XmDropSiteManagerObject dsm, XtPointer info) ; static Boolean IntersectWithWidgetAncestors( Widget w, XmRegion r) ; static Boolean IntersectWithDSInfoAncestors( XmDSInfo parent, XmRegion r) ; static Boolean CalculateAncestorClip( XmDropSiteManagerObject dsm, XmDSInfo info, XmRegion r) ; static Boolean PointInDS( XmDropSiteManagerObject dsm, XmDSInfo info, #if NeedWidePrototypes int x, int y) ; #else Position x, Position y) ; #endif /* NeedWidePrototypes */ static XmDSInfo PointToDSInfo( XmDropSiteManagerObject dsm, XmDSInfo info, #if NeedWidePrototypes int x, int y) ; #else Position x, Position y) ; #endif /* NeedWidePrototypes */ static void DoAnimation( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XtPointer callback) ; static void ProxyDragProc( XmDropSiteManagerObject dsm, XtPointer client_data, XmDragProcCallbackStruct *callback) ; static void HandleEnter( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XmDragMotionCallbackStruct *callback, XmDSInfo info, #if NeedWidePrototypes unsigned int style) ; #else unsigned char style) ; #endif /* NeedWidePrototypes */ static void HandleMotion( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XmDragMotionCallbackStruct *callback, XmDSInfo info, #if NeedWidePrototypes unsigned int style) ; #else unsigned char style) ; #endif /* NeedWidePrototypes */ static void HandleLeave( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XmDragMotionCallbackStruct *callback, XmDSInfo info, #if NeedWidePrototypes unsigned int style, int enterPending) ; #else unsigned char style, Boolean enterPending) ; #endif /* NeedWidePrototypes */ static void ProcessMotion( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer calldata) ; static void ProcessDrop( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer cb) ; static void ChangeOperation( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer calldata) ; static void PutDSToStream( XmDropSiteManagerObject dsm, XmDSInfo dsInfo, #if NeedWidePrototypes int last, #else Boolean last, #endif /* NeedWidePrototypes */ XtPointer dataPtr) ; static void GetDSFromDSM( XmDropSiteManagerObject dsm, XmDSInfo parentInfo, #if NeedWidePrototypes int last, #else Boolean last, #endif /* NeedWidePrototypes */ XtPointer dataPtr) ; static int GetTreeFromDSM( XmDropSiteManagerObject dsm, Widget shell, XtPointer dataPtr) ; static XmDSInfo GetDSFromStream( XmDropSiteManagerObject dsm, XtPointer dataPtr, Boolean *close, unsigned char *type) ; static void GetNextDS( XmDropSiteManagerObject dsm, XmDSInfo parentInfo, XtPointer dataPtr) ; static XmDSInfo ReadTree( XmDropSiteManagerObject dsm, XtPointer dataPtr) ; static void FreeDSTree( XmDSInfo tree) ; static void ChangeRoot( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer callData) ; static int CountDropSites( XmDSInfo info) ; static void CreateInfo( XmDropSiteManagerObject dsm, Widget widget, ArgList args, Cardinal argCount) ; static void CopyVariantIntoFull( XmDropSiteManagerObject dsm, XmDSInfo variant, XmDSFullInfo full_info) ; static void RetrieveInfo( XmDropSiteManagerObject dsm, Widget widget, ArgList args, Cardinal argCount) ; static void CopyFullIntoVariant( XmDSFullInfo full_info, XmDSInfo variant) ; static void UpdateInfo( XmDropSiteManagerObject dsm, Widget widget, ArgList args, Cardinal argCount) ; static void StartUpdate( XmDropSiteManagerObject dsm, Widget refWidget) ; static void EndUpdate( XmDropSiteManagerObject dsm, Widget refWidget) ; static void DestroyInfo( XmDropSiteManagerObject dsm, Widget widget) ; static void SyncDropSiteGeometry( XmDropSiteManagerObject dsm, XmDSInfo info) ; static void SyncTree( XmDropSiteManagerObject dsm, Widget shell) ; static void Update( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer callData) ; static Boolean HasDropSiteDescendant( XmDropSiteManagerObject dsm, Widget widget) ; static void DestroyCallback( Widget widget, XtPointer client_data, XtPointer call_data) ; /******** End Static Function Declarations ********/ static XtResource resources[] = { { XmNnotifyProc, XmCNotifyProc, XmRCallbackProc, sizeof(XtCallbackProc), XtOffsetOf( struct _XmDropSiteManagerRec, dropManager.notifyProc), XmRImmediate, NULL }, { XmNtreeUpdateProc, XmCTreeUpdateProc, XmRCallbackProc, sizeof(XtCallbackProc), XtOffsetOf( struct _XmDropSiteManagerRec, dropManager.treeUpdateProc), XmRImmediate, NULL }, { XmNclientData, XmCClientData, XmRPointer, sizeof(XtPointer), XtOffsetOf( struct _XmDropSiteManagerRec, dropManager.client_data), XmRImmediate, NULL }, }; /* class record definition */ externaldef(xmdropsitemanagerclassrec) XmDropSiteManagerClassRec xmDropSiteManagerClassRec = { { (WidgetClass) &objectClassRec, /* superclass */ "XmDropSiteManager", /* class_name */ sizeof(XmDropSiteManagerRec), /* widget_size */ ClassInit, /* class_initialize */ ClassPartInit, /* class part initialize */ False, /* class_inited */ DropSiteManagerInitialize, /* initialize */ NULL, /* initialize_hook */ NULL, /* obj1 */ NULL, /* obj2 */ 0, /* obj3 */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* obj4 */ XtExposeCompressSeries, /* obj5 */ True, /* obj6 */ False, /* obj7 */ Destroy, /* destroy */ NULL, /* obj8 */ NULL, /* obj9 */ SetValues, /* set_values */ NULL, /* set_values_hook */ NULL, /* obj10 */ NULL, /* get_values_hook */ NULL, /* obj11 */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* obj12 */ NULL, /* obj13 */ NULL, /* obj14 */ NULL, /* extension */ }, { CreateInfo, /* createInfo */ DestroyInfo, /* destroyInfo */ StartUpdate, /* startUpdate */ RetrieveInfo, /* retrieveInfo */ UpdateInfo, /* updateInfo */ EndUpdate, /* endUpdate */ Update, /* updateDSM */ ProcessMotion, /* processMotion */ ProcessDrop, /* processDrop */ ChangeOperation, /* operationChanged */ ChangeRoot, /* changeDSRoot */ InsertInfo, /* insertInfo */ RemoveInfo, /* removeInfo */ SyncTree, /* syncTree */ GetTreeFromDSM, /* getTreeFromDSM */ CreateTable, /* createTable */ DestroyTable, /* destroyTable */ RegisterInfo, /* registerInfo */ WidgetToInfo, /* widgetToInfo */ UnregisterInfo, /* unregisterInfo */ NULL, /* extension */ }, }; externaldef(xmdropsitemanagerobjectclass) WidgetClass xmDropSiteManagerObjectClass = (WidgetClass) &xmDropSiteManagerClassRec; static void ClassInit( void ) { _XmRegisterPixmapConverters(); } /*ARGSUSED*/ static void ClassPartInit( WidgetClass wc ) { /*EMPTY*/ } /*ARGSUSED*/ static void DropSiteManagerInitialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject)nw; XmDSFullInfoRec info_rec; XmDSFullInfo info = &(info_rec); dsm->dropManager.dragUnderData = NULL; dsm->dropManager.curInfo = NULL; dsm->dropManager.curTime = 0; dsm->dropManager.oldX = dsm->dropManager.curX = 0; dsm->dropManager.oldY = dsm->dropManager.curY = 0; dsm->dropManager.curDropSiteStatus = XmINVALID_DROP_SITE; dsm->dropManager.curDragContext = NULL; dsm->dropManager.curAnimate = True; dsm->dropManager.curOperations = XmDROP_NOOP; dsm->dropManager.curOperation = XmDROP_NOOP; dsm->dropManager.curAncestorClipRegion = _XmRegionCreate(); dsm->dropManager.newAncestorClipRegion = _XmRegionCreate(); DSMCreateTable(dsm); dsm->dropManager.dsRoot = NULL; dsm->dropManager.rootX = dsm->dropManager.rootY = 0; dsm->dropManager.rootW = dsm->dropManager.rootH = ~0; dsm->dropManager.clipperList = NULL; dsm->dropManager.updateInfo = NULL; dsm->dropManager.updateTimeOutId = 0; /* Patch around broken Xt interfaces */ XtGetSubresources(nw, info, NULL, NULL, _XmDSResources, _XmNumDSResources, NULL, 0); } static void Destroy( Widget w ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject)w; if (dsm->dropManager.updateTimeOutId) XtRemoveTimeOut(dsm->dropManager.updateTimeOutId); DSMDestroyTable(dsm); _XmRegionDestroy(dsm->dropManager.curAncestorClipRegion); _XmRegionDestroy(dsm->dropManager.newAncestorClipRegion); } /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { /*EMPTY*/ return False; } /* Function for Hash table */ static Boolean CompareWidgets(XtPointer w1, XtPointer w2) { return(w1 == w2); } static XmHashValue HashWidget(XtPointer w1) { return((XmHashValue)(long)w1); } static void CreateTable( XmDropSiteManagerObject dsm ) { XtPointer *tab = &(dsm->dropManager.dsTable); _XmProcessLock(); *tab = (XtPointer) _XmAllocHashTable(100, CompareWidgets, HashWidget); _XmProcessUnlock(); } static void DestroyTable( XmDropSiteManagerObject dsm ) { XtPointer * tab = &(dsm->dropManager.dsTable); _XmProcessLock(); _XmFreeHashTable((XmHashTable) *tab); _XmProcessUnlock(); *tab = NULL; } #define DSTABLE(dsm) ((XmHashTable)(dsm->dropManager.dsTable)) static void RegisterInfo( register XmDropSiteManagerObject dsm, register Widget widget, register XtPointer info ) { register XmHashTable tab; if (GetDSRegistered(info)) return; DPRINT(("(RegI) Widget %p (%s) info %p (internal %d widget %p)\n", widget, XtName(widget), info, GetDSInternal(info), GetDSWidget(info))); tab = DSTABLE(dsm); _XmProcessLock(); /* Resize if the table has many more entries than slots */ if (_XmHashTableCount(tab) > (2 * _XmHashTableSize(tab))) _XmResizeHashTable(tab, 2 * _XmHashTableSize(tab)); _XmAddHashEntry(tab, widget, info); _XmProcessUnlock(); SetDSRegistered(info, True); } static void UnregisterInfo( register XmDropSiteManagerObject dsm, register XtPointer info ) { XmHashTable tab; XtPointer iterator; Widget widget = GetDSWidget(info); XtPointer data; if ((info == NULL) || !GetDSRegistered(info)) return; DPRINT(("(UnregI) Widget %p (%s) info %p (internal %d widget %p)\n", widget, XtName(widget), info, GetDSInternal(info), GetDSWidget(info))); tab = DSTABLE(dsm); iterator = NULL; _XmProcessLock(); while((data = _XmGetHashEntryIterate(tab, widget, &iterator)) != NULL) { if (data == info) { _XmRemoveHashIterator(tab, &iterator); break; } } _XmProcessUnlock(); SetDSRegistered(info, False); } static XtPointer WidgetToInfo( register XmDropSiteManagerObject dsm, register Widget widget ) { XmHashTable tab; XmDSInfo info; tab = DSTABLE(dsm); info = (XmDSInfo) _XmGetHashEntry(tab, widget); return((XtPointer) info); } static Boolean Coincident( XmDropSiteManagerObject dsm, Widget w, XmDSClipRect *r ) { XRectangle wR; Boolean hit = False; if (!XtIsShell(w)) { /* r is shell relative, so wR needs to be translated */ XtTranslateCoords(XtParent(w), XtX(w), XtY(w), &(wR.x), &(wR.y)); wR.x -= dsm->dropManager.rootX; wR.y -= dsm->dropManager.rootY; } else { wR.x = wR.y = 0; } wR.width = XtWidth(w); wR.height = XtHeight(w); if ( !(r->detected & XmDROP_SITE_LEFT_EDGE) && (r->x == wR.x)) { r->detected |= XmDROP_SITE_LEFT_EDGE; hit = True; } if ( !(r->detected & XmDROP_SITE_RIGHT_EDGE) && ((r->x + r->width) == (wR.x + wR.width))) { r->detected |= XmDROP_SITE_RIGHT_EDGE; hit = True; } if ( !(r->detected & XmDROP_SITE_TOP_EDGE) && (r->y == wR.y)) { r->detected |= XmDROP_SITE_TOP_EDGE; hit = True; } if ( !(r->detected & XmDROP_SITE_BOTTOM_EDGE) && ((r->y + r->height) == (wR.y + wR.height))) { r->detected |= XmDROP_SITE_BOTTOM_EDGE; hit = True; } return(hit); } static Boolean IsDescendent( Widget parentW, Widget childW ) { Widget tmp; if ((parentW == NULL) || (childW == NULL)) return(False); tmp = XtParent(childW); while (tmp != parentW) { if (XtIsShell(tmp)) return(False); tmp = XtParent(tmp); } return(True); } static void DetectAncestorClippers( XmDropSiteManagerObject dsm, Widget w, XmDSClipRect *r, XmDSInfo info ) { /* * We know that r represents the visible region of the dropSite * as clipped by its ancestors in shell relative coordinates. We * now search for the most ancient ancestor who provides that clip. * We do this by looking from the shell downward for the parent * whose edge is coincident with a clipped edge. * * We can add as many as four clippers to the tree as a result * of this routine. */ /* * Hygiene. */ if (w == NULL) return; if (!XtIsShell(w)) DetectAncestorClippers(dsm, XtParent(w), r, info); /* * We never need to add the shell to the tree as a clipper. * We call Coincident first so that any clipping provided by * the shell is marked in the cliprect structure. */ if ((Coincident(dsm, w, r)) && (!XtIsShell(w))) { XmDSInfo clipper; /* Have we already put this clipper in the tree? */ if ((clipper = (XmDSInfo) DSMWidgetToInfo(dsm, w)) != NULL) return; clipper = CreateClipperDSInfo(dsm, w); DSMRegisterInfo(dsm, w, (XtPointer) clipper); SetDSParent(clipper, dsm->dropManager.clipperList); dsm->dropManager.clipperList = (XtPointer) clipper; } } static void DetectImpliedClipper( XmDropSiteManagerObject dsm, XmDSInfo info ) { static XmRegion tmpRegion = NULL; if (tmpRegion == NULL) { tmpRegion = _XmRegionCreate(); } if ((GetDSType(info) == XmDROP_SITE_SIMPLE) && GetDSHasRegion(info)) { Widget w = GetDSWidget(info); XRectangle wr, tr, rr; /* * This step only has meaning if there is a separately * specified region for this drop site (which can only be done * for simple drop sites). */ /* The region will be relative to the origin of the widget */ wr.x = wr.y = 0; wr.width = XtWidth(w); wr.height = XtHeight(w); _XmRegionGetExtents(GetDSRegion(info), &rr); _XmIntersectionOf(&wr, &rr, &tr); if ((rr.x != tr.x) || (rr.y != tr.y) || (rr.width != tr.width) || (rr.height != tr.height)) { XmDSInfo clipper; /* * The implied clipper is magic. It's in the tree but not * of it. (It refers to the same widget, but it's not * registered.) */ clipper = CreateClipperDSInfo(dsm, w); SetDSParent(clipper, dsm->dropManager.clipperList); dsm->dropManager.clipperList = (XtPointer) clipper; } } } static void DetectAllClippers( XmDropSiteManagerObject dsm, XmDSInfo parentInfo ) { XmDSInfo childInfo; XmDSClipRect extents, clippedExtents; int i; Widget w; static XmRegion tmpR = NULL; if (GetDSLeaf(parentInfo)) return; _XmProcessLock(); if (tmpR == NULL) { tmpR = _XmRegionCreate(); } _XmProcessUnlock(); for (i = 0; i < (int)GetDSNumChildren(parentInfo); i++) { childInfo = (XmDSInfo) GetDSChild(parentInfo, i); /* * Because we don't allow composite drop sites to have * arbitrary regions, and Motif doesn't support shaped * widgets, we do a simple rectangle clip detection. * * IntersectWithAncestors expects the region to be in * widget relative coordinates, and returns in shell relative * coordinates (the ultimate ancestor is the shell). */ _XmRegionGetExtents(GetDSRegion(childInfo), (XRectangle *)(&extents)); _XmProcessLock(); _XmRegionUnion(GetDSRegion(childInfo), GetDSRegion(childInfo), tmpR); w = GetDSWidget(childInfo); IntersectWithWidgetAncestors(w, tmpR); _XmRegionGetExtents(tmpR, (XRectangle *)(&clippedExtents)); _XmProcessUnlock(); /* tmpR is now in shell relative position */ clippedExtents.detected = 0; if ((clippedExtents.width < extents.width) || (clippedExtents.height < extents.height)) { /* * We've been clipped. Find out who did it and add * them to the tree. */ DetectAncestorClippers(dsm, XtParent(GetDSWidget(childInfo)), &clippedExtents, childInfo); } /* * We now have inserted clippers for any ancestors which may * have clipped the widget. Now we need to check for the * case that the widget itself clips the region. */ DetectImpliedClipper(dsm, childInfo); /* Re-Curse */ DetectAllClippers(dsm, childInfo); } } static Boolean InsertClipper( XmDropSiteManagerObject dsm, XmDSInfo parentInfo, XmDSInfo clipper ) { int i; XmDSInfo childInfo; /* * Do a tail-end recursion which will insert the clipper into * the info tree as a child of its closest ancestor in the tree. */ if (GetDSLeaf(parentInfo)) return(False); for (i=0; i < (int)GetDSNumChildren(parentInfo); i++) { childInfo = (XmDSInfo) GetDSChild(parentInfo, i); if (InsertClipper(dsm, childInfo, clipper)) return(True); } if (IsDescendent(GetDSWidget(parentInfo), GetDSWidget(clipper))) { i = 0; while (i < (int)GetDSNumChildren(parentInfo)) { childInfo = (XmDSInfo) GetDSChild(parentInfo, i); if (IsDescendent(GetDSWidget(clipper), GetDSWidget(childInfo))) { RemoveDSChild(parentInfo, childInfo); AddDSChild(clipper, childInfo, GetDSNumChildren(clipper)); } else /* * Because RemoveDSChild monkeys with the num children, * we only increment i if we haven't called * RemoveDSChild. */ i++; } AddDSChild(parentInfo, clipper, GetDSNumChildren(parentInfo)); /* We have inserted the clipper into the tree */ return(True); } else return(False); } static void DetectAndInsertAllClippers( XmDropSiteManagerObject dsm, XmDSInfo root ) { XmDSInfo clipper; if ((!GetDSShell(root)) || (GetDSRemote(root))) return; DetectAllClippers(dsm, root); while ((clipper = (XmDSInfo) dsm->dropManager.clipperList) != NULL) { dsm->dropManager.clipperList = GetDSParent(clipper); (void) InsertClipper(dsm, root, clipper); } } static void RemoveClipper( XmDropSiteManagerObject dsm, XmDSInfo clipper ) { XmDSInfo parentInfo = (XmDSInfo) GetDSParent(clipper); int i; /* Remove the clipper from its parent */ RemoveDSChild(parentInfo, clipper); /* * Pull all of the children up into the parent's child * list between the clipper and the clipper's sibling. */ for (i = 0; i < (int)GetDSNumChildren(clipper); i++) { XmDSInfo childInfo = (XmDSInfo) GetDSChild(clipper, i); AddDSChild(parentInfo, childInfo, GetDSNumChildren(parentInfo)); } /* * Destroy the clipper */ DSMUnregisterInfo(dsm, clipper); DestroyDSInfo(clipper, True); } static void RemoveAllClippers( XmDropSiteManagerObject dsm, XmDSInfo parentInfo ) { XmDSInfo child; int i; if (!GetDSLeaf(parentInfo)) { i = 0; while(i < (int)GetDSNumChildren(parentInfo)) { child = (XmDSInfo) GetDSChild(parentInfo, i); RemoveAllClippers(dsm, child); if (GetDSInternal(child)) RemoveClipper(dsm, child); /* Only increment i if the current child wasn't removed. Otherwise we'll skip items in the list unintentionally */ if (child == (XmDSInfo) GetDSChild(parentInfo, i)) i++; } } } static void DestroyDSInfo( XmDSInfo info, #if NeedWidePrototypes int substructures ) #else Boolean substructures ) #endif /* NeedWidePrototypes */ { DestroyDS(info, substructures); } static XmDSInfo CreateShellDSInfo( XmDropSiteManagerObject dsm, Widget widget ) { XmDSInfo info; XmRegion region = _XmRegionCreate(); XRectangle rect; info = (XmDSInfo) XtCalloc(1, sizeof(XmDSLocalNoneNodeRec)); SetDSLeaf(info, True); SetDSShell(info, True); SetDSAnimationStyle(info, XmDRAG_UNDER_NONE); SetDSType(info, XmDROP_SITE_COMPOSITE); SetDSInternal(info, True); SetDSActivity(info, XmDROP_SITE_INACTIVE); SetDSWidget(info, widget); rect.x = rect.y = 0; rect.width = XtWidth(widget); rect.height = XtHeight(widget); _XmRegionUnionRectWithRegion(&rect, region, region); SetDSRegion(info, region); XtAddCallback(widget, XmNdestroyCallback, DestroyCallback, dsm); return(info); } /*ARGSUSED*/ static XmDSInfo CreateClipperDSInfo( XmDropSiteManagerObject dsm, Widget clipW ) { XmDSInfo info = NULL; XmRegion region = _XmRegionCreate(); XRectangle rect; info = (XmDSInfo) XtCalloc(1, sizeof(XmDSLocalNoneNodeRec)); SetDSLeaf(info, True); SetDSInternal(info, True); SetDSType(info, XmDROP_SITE_COMPOSITE); SetDSAnimationStyle(info, XmDRAG_UNDER_NONE); SetDSWidget(info, clipW); SetDSActivity(info, XmDROP_SITE_ACTIVE); rect.x = rect.y = 0; rect.width = XtWidth(clipW); rect.height = XtHeight(clipW); _XmRegionUnionRectWithRegion(&rect, region, region); SetDSRegion(info, region); /* * Don't need a destroy callback. When this widget is destroyed * the drop site children will be destroyed and as a side-effect * of the last drop site being destroyed, the clipper will be * destroyed. */ return(info); } /*ARGSUSED*/ static void InsertInfo( XmDropSiteManagerObject dsm, XtPointer info, XtPointer call_data ) { XmDSInfo childInfo = (XmDSInfo) info; XmDSInfo parentInfo = NULL; Widget parent = XtParent(GetDSWidget(childInfo)); while (!(parentInfo = (XmDSInfo) DSMWidgetToInfo(dsm, parent)) && !XtIsShell(parent)) { parent = XtParent(parent); } if (parentInfo == NULL) { /* * We've traversed clear back to the shell and not found a * parent for this info. Therefore this must be the first drop * site to be registered under this shell, and we must create a * parent place holder at for shell */ parentInfo = CreateShellDSInfo(dsm, parent); DSMRegisterInfo(dsm, parent, (XtPointer) parentInfo); AddDSChild(parentInfo, childInfo, GetDSNumChildren(parentInfo)); if ((dsm->dropManager.treeUpdateProc) && (!XtIsRealized(parent) || (_XmGetDragProtocolStyle(parent) == XmDRAG_DYNAMIC))) { /* * If this is a preregister client and the shell isn't * realized yet, we need to register this shell with the * DragDisplay so the DragDisplay can register a realize * callback on this shell. * * OR * * If this is a dynamic client, we need to notify the Drag- * Display exactly once so that event handlers and such * can be installed on this client. */ XmDropSiteTreeAddCallbackStruct outCB; outCB.reason = XmCR_DROP_SITE_TREE_ADD; outCB.event = NULL; outCB.rootShell = parent; outCB.numDropSites = 0; /* Unused */ outCB.numArgsPerDSHint = 0; (dsm->dropManager.treeUpdateProc) ((Widget) dsm, NULL, (XtPointer) &outCB); } } else if (GetDSType(parentInfo) == XmDROP_SITE_COMPOSITE) { AddDSChild(parentInfo, childInfo, GetDSNumChildren(parentInfo)); } else { XmeWarning(GetDSWidget(childInfo), MESSAGE1); } } static void RemoveInfo( XmDropSiteManagerObject dsm, XtPointer info ) { Widget widget = GetDSWidget(info); XmDSInfo parentInfo = (XmDSInfo) GetDSParent(info); RemoveDSChild(parentInfo, (XmDSInfo) info); DSMUnregisterInfo(dsm, info); XtRemoveCallback(widget, XmNdestroyCallback, DestroyCallback, dsm); if ((parentInfo != NULL) && (GetDSNumChildren(parentInfo) == 0) && (GetDSInternal(parentInfo))) { if (XtIsShell(GetDSWidget(parentInfo))) { /* * Need to notify the DragDisplay that this shell no * longer has any drop sites in it. */ if (dsm->dropManager.treeUpdateProc) { XmDropSiteTreeAddCallbackStruct outCB; outCB.reason = XmCR_DROP_SITE_TREE_REMOVE; outCB.event = NULL; outCB.rootShell = GetDSWidget(parentInfo); (dsm->dropManager.treeUpdateProc) ((Widget)dsm, NULL, (XtPointer) &outCB); } } DSMDestroyInfo(dsm, GetDSWidget(parentInfo)); } } static Boolean IntersectWithWidgetAncestors( Widget w, XmRegion r ) { /* * r is the bounding box of the region. It is in widget relative * coordinates. */ XRectangle parentR; static XmRegion tmpR = NULL; Dimension bw = XtBorderWidth(w); if (XtIsShell(w)) { return(True); } _XmProcessLock(); if (tmpR == NULL) { tmpR = _XmRegionCreate(); } _XmProcessUnlock(); /* Translate the coordinates into parent relative coords */ _XmRegionOffset(r, (XtX(w) + bw), (XtY(w) + bw)); parentR.x = parentR.y = 0; parentR.width = XtWidth(XtParent(w)); parentR.height = XtHeight(XtParent(w)); _XmProcessLock(); _XmRegionClear(tmpR); _XmRegionUnionRectWithRegion(&parentR, tmpR, tmpR); _XmRegionIntersect(tmpR, r, r); _XmProcessUnlock(); if (!_XmRegionIsEmpty(r)) return(IntersectWithWidgetAncestors(XtParent(w), r)); else return(False); } static Boolean IntersectWithDSInfoAncestors( XmDSInfo parent, XmRegion r ) { static XmRegion testR = (XmRegion) NULL; static XmRegion pR = (XmRegion) NULL; Dimension bw; _XmProcessLock(); if (testR == NULL) { testR = _XmRegionCreate(); pR = _XmRegionCreate(); } _XmProcessUnlock(); /* * A simplifying assumption in this code is that the regions * are all relative to the shell widget. We don't have to * do any fancy translations. * * All that we have to do is successively intersect the drop site * region with its ancestors until we reach the top of the drop * site tree. */ /* * If got to the top, then there is some part of the * region which is visible. */ if (parent == NULL) return(True); _XmProcessLock(); _XmRegionUnion(GetDSRegion(parent), GetDSRegion(parent), pR); _XmProcessUnlock(); if ((bw = GetDSBorderWidth(parent)) != 0) { /* * Adjust for the border width ala X clipping * Recall that all Composite's drop rectangles represent the * refW's sensitive area (including border width), but clipping * should be done to the window not the border. The clip * region is smaller than the sensitive region. */ _XmProcessLock(); _XmRegionShrink(pR, bw, bw); _XmProcessUnlock(); } _XmProcessLock(); _XmRegionIntersect(r, pR, r); _XmProcessUnlock(); /* C will ensure that we only recurse if testR is non-empty */ return((!_XmRegionIsEmpty(r)) && (IntersectWithDSInfoAncestors( (XmDSInfo) GetDSParent(parent), r))); } static Boolean CalculateAncestorClip( XmDropSiteManagerObject dsm, XmDSInfo info, XmRegion r ) { /* * When this procedure finishes, r will contain the composite * clip region for all ancestors of info. The clip region will * be in shell relative coordinates. */ _XmRegionClear(r); if (GetDSRemote(info)) { XRectangle universe; /* Set it to the "universe" -- which is shell relative */ universe.x = universe.y = 0; universe.width = dsm->dropManager.rootW; universe.height = dsm->dropManager.rootH; _XmRegionUnionRectWithRegion(&universe, r, r); /* * IntersectWithDSInfoAncestors will shoot the universe * through all of the DSInfo ancestors and return us what * is left in r. */ return(IntersectWithDSInfoAncestors( (XmDSInfo) GetDSParent(info), r)); } else { XRectangle parentR; Widget parentW = XtParent(GetDSWidget(info)); if (parentW == NULL) return(True); else { parentR.x = parentR.y = -(XtBorderWidth(parentW)); parentR.width = XtWidth(parentW); parentR.height = XtHeight(parentW); _XmRegionUnionRectWithRegion(&parentR, r, r); /* * IntersectWithWidgetAncestors will intersect the parent * of info with all successive parents and return us what * is left in r. */ return(IntersectWithWidgetAncestors(parentW, r)); } } } static Boolean PointInDS( XmDropSiteManagerObject dsm, XmDSInfo info, #if NeedWidePrototypes int x, int y ) #else Position x, Position y ) #endif /* NeedWidePrototypes */ { static XmRegion testR = (XmRegion) NULL; static XmRegion tmpR = (XmRegion) NULL; XmRegion *visR = &(dsm->dropManager.newAncestorClipRegion); Widget w = GetDSWidget(info); _XmProcessLock(); if (testR == NULL) { testR = _XmRegionCreate(); tmpR = _XmRegionCreate(); } _XmProcessUnlock(); /* * CalculateAncestorClip will intersect the universe with all of * the ancestors. If anything is left, it will return true the * intersection will be in tmpR. */ _XmProcessLock(); if (!CalculateAncestorClip(dsm, info, tmpR)) { _XmProcessUnlock(); return(False); } _XmProcessUnlock(); if (GetDSRemote(info)) { /* * We know that the region in the info struct is shell relative */ _XmProcessLock(); _XmRegionIntersect(tmpR, GetDSRegion(info), testR); _XmProcessUnlock(); } else { Position tmpX, tmpY; _XmRegionUnion(GetDSRegion(info), GetDSRegion(info), testR); /* * We know that the information is widget * relative so we will have to translate it. */ XtTranslateCoords(w, 0, 0, &tmpX, &tmpY); _XmProcessLock(); _XmRegionOffset(testR, (tmpX - dsm->dropManager.rootX), (tmpY - dsm->dropManager.rootY)); _XmRegionIntersect(tmpR, testR, testR); _XmProcessUnlock(); } _XmProcessLock(); if ((!_XmRegionIsEmpty(testR)) && (_XmRegionPointInRegion(testR, x, y))) { _XmRegionUnion(tmpR, tmpR, *visR); _XmProcessUnlock(); return(True); } else { _XmProcessUnlock(); return(False); } /* _XmProcessUnlock(); */ /* not reached */ } static XmDSInfo PointToDSInfo( XmDropSiteManagerObject dsm, XmDSInfo info, #if NeedWidePrototypes int x, int y ) #else Position x, Position y ) #endif /* NeedWidePrototypes */ { unsigned int i; XmDSInfo child = NULL; if (!GetDSLeaf(info)) { /* * This should be optimized at some point. * CalculateAncestorClip is having to do potentially * unneccessary work, because it starts from scratch each time. */ for (i = 0; i < GetDSNumChildren(info); i++) { Boolean managed; child = (XmDSInfo) GetDSChild(info,i); if (GetDSRemote(child)) managed = True; else { Widget child_widget; Widget parent; child_widget = GetDSWidget(child); parent = XtParent(child_widget); managed = XtIsManaged(child_widget); /* CR 7848, first check if DS widget is managed and all the parents are managed. To accomplish this we wander up to the shell and make sure all the widget parents are managed */ while(managed && ! XtIsShell(parent)) { managed = XtIsManaged(parent); parent = XtParent(parent); } } if (managed && PointInDS(dsm, child, x, y) && GetDSActivity(child) != XmDROP_SITE_INACTIVE) { if (!GetDSLeaf(child)) { XmDSInfo descendant = PointToDSInfo(dsm, child, x, y); if (descendant != NULL) return(descendant); } if (!GetDSInternal(child)) return(child); } } } return(NULL); } static void DoAnimation( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XtPointer callback ) { XmDSInfo info = (XmDSInfo) (dsm->dropManager.curInfo); XmDSInfo parentInfo = (XmDSInfo) GetDSParent(info); Widget w; int i, n; XmDSInfo child; XmAnimationDataRec animationData; static XmRegion dsRegion = (XmRegion) NULL; static XmRegion clipRegion = (XmRegion) NULL; static XmRegion tmpRegion = (XmRegion) NULL; Widget dc = dsm->dropManager.curDragContext; Boolean sourceIsExternal; Dimension bw = 0; Arg args[1]; if (GetDSAnimationStyle(info) == XmDRAG_UNDER_NONE) return; /* * Should we have saved this from the last top level enter? */ n = 0; XtSetArg(args[n], XmNsourceIsExternal, &sourceIsExternal); n++; XtGetValues(dc, args, n); _XmProcessLock(); if (dsRegion == NULL) { dsRegion = _XmRegionCreate(); clipRegion = _XmRegionCreate(); tmpRegion = _XmRegionCreate(); } _XmProcessUnlock(); if (sourceIsExternal) { animationData.dragOver = NULL; /* * The window is expected to the the shell window which will be * drawn in with include inferiors. */ animationData.window = XtWindow(GetDSWidget( dsm->dropManager.dsRoot)); animationData.screen = XtScreen(GetDSWidget( dsm->dropManager.dsRoot)); } else { animationData.dragOver = motionData->dragOver; animationData.window = motionData->window; animationData.screen = XtScreen(motionData->dragOver); } animationData.windowX = dsm->dropManager.rootX; animationData.windowY = dsm->dropManager.rootY; animationData.saveAddr = (XtPointer) &(dsm->dropManager.dragUnderData); /* We're going to need a copy. */ _XmProcessLock(); _XmRegionUnion(GetDSRegion(info), GetDSRegion(info), dsRegion); _XmProcessUnlock(); bw = GetDSBorderWidth(info); if (!GetDSRemote(info)) { Position wX, wY; w = GetDSWidget(info); XtTranslateCoords(w, 0, 0, &wX, &wY); _XmProcessLock(); _XmRegionOffset(dsRegion, (wX - dsm->dropManager.rootX), (wY - dsm->dropManager.rootY)); _XmProcessUnlock(); } /* All drawing occurs within the drop site */ _XmProcessLock(); _XmRegionUnion(dsRegion, dsRegion, clipRegion); _XmProcessUnlock(); if (bw && !GetDSHasRegion(info)) { /* * The region is stored widget relative, and it represents * the entire drop-sensitive area of the drop site. In the * case that we provided the region this includes the * border area (the x,y position of the bounding box is * negative), however, we don't animate the entire * sensitive region; we only animate the sensitive region * within the border. Sooo, if we provided the region, and * the widget has a border, shrink down the region * (which will offset it) before passing it on to the * animation code. */ _XmProcessLock(); _XmRegionShrink(clipRegion, bw, bw); _XmProcessUnlock(); } /* * trim off anything clipped by ancestors * ancestorClip region is in shell relative coordinates. */ _XmProcessLock(); _XmRegionIntersect(clipRegion, dsm->dropManager.curAncestorClipRegion, clipRegion); _XmProcessUnlock(); /* trim off anything obsucred by a sibling stacked above us */ if (parentInfo != NULL) { for (i = 0; i < (int)GetDSNumChildren(parentInfo); i++) { child = (XmDSInfo) GetDSChild(parentInfo, i); if (child == info) break; else { if (GetDSRemote(child)) { /* * Non-local case. The info region is in shell * relative coordinates. */ _XmProcessLock(); _XmRegionSubtract(clipRegion, GetDSRegion(child), clipRegion); _XmProcessUnlock(); } else { /* * Local case. We have to translate the region. */ Position wX, wY; Widget sibling = GetDSWidget(child); XtTranslateCoords(sibling, 0, 0, &wX, &wY); _XmProcessLock(); _XmRegionUnion(GetDSRegion(child), GetDSRegion(child), tmpRegion); _XmRegionOffset(tmpRegion, (wX - dsm->dropManager.rootX), (wY - dsm->dropManager.rootY)); _XmRegionSubtract(clipRegion, tmpRegion, clipRegion); _XmProcessUnlock(); } } } } _XmProcessLock(); animationData.clipRegion = clipRegion; animationData.dropSiteRegion = dsRegion; _XmProcessUnlock(); _XmDragUnderAnimation((Widget)dsm, (XtPointer) &animationData, (XtPointer) callback); } /*ARGSUSED*/ static void ProxyDragProc( XmDropSiteManagerObject dsm, XtPointer client_data, XmDragProcCallbackStruct *callback ) { XmDSInfo info = (XmDSInfo) dsm->dropManager.curInfo; XmDragContext dc = (XmDragContext) callback->dragContext; Atom *import_targets = NULL, *export_targets = NULL; Cardinal num_import = 0, num_export = 0; int n; Arg args[10]; Widget shell; unsigned char operations; operations = callback->operations & GetDSOperations(info); if (XmDROP_MOVE & operations) callback->operation = XmDROP_MOVE; else if (XmDROP_COPY & operations) callback->operation = XmDROP_COPY; else if (XmDROP_LINK & operations) callback->operation = XmDROP_LINK; else callback->operation = XmDROP_NOOP; n = 0; XtSetArg(args[n], XmNexportTargets, &export_targets); n++; XtSetArg(args[n], XmNnumExportTargets, &num_export); n++; XtGetValues ((Widget)dc, args, n); if (GetDSRemote(info)) shell = XtParent(dsm); else shell = GetDSWidget(info); while (!XtIsShell(shell)) shell = XtParent(shell); num_import = _XmIndexToTargets(shell, GetDSImportTargetsID(info), &import_targets); if ((callback->operation != XmDROP_NOOP) && (XmTargetsAreCompatible (XtDisplay (dsm), export_targets, num_export, import_targets, num_import))) callback->dropSiteStatus = XmVALID_DROP_SITE; else callback->dropSiteStatus = XmINVALID_DROP_SITE; callback->animate = True; } /*ARGSUSED*/ static void HandleEnter( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XmDragMotionCallbackStruct *callback, XmDSInfo info, #if NeedWidePrototypes unsigned int style ) /* unused */ #else unsigned char style ) #endif /* NeedWidePrototypes */ { XmDragProcCallbackStruct cbRec; Position tmpX, tmpY; XRectangle extents; cbRec.reason = XmCR_DROP_SITE_ENTER_MESSAGE; cbRec.event = (XEvent *) NULL; cbRec.timeStamp = callback->timeStamp; cbRec.dragContext = dsm->dropManager.curDragContext; cbRec.x = dsm->dropManager.curX; cbRec.y = dsm->dropManager.curY; cbRec.dropSiteStatus = XmVALID_DROP_SITE; cbRec.operations = callback->operations; cbRec.operation = callback->operation; cbRec.animate = True; ProxyDragProc(dsm, NULL, &cbRec); if ((!GetDSRemote(info)) && (GetDSDragProc(info) != NULL)) { Widget widget = GetDSWidget(info); /* Return if this is not a managed widget, CR5215 */ if (! XtIsManaged(widget)) return; /* Make the coordinates widget relative */ XtTranslateCoords(widget, 0, 0, &tmpX, &tmpY); cbRec.x -= tmpX; cbRec.y -= tmpY; (*(GetDSDragProc(info))) (widget, NULL, (XtPointer) &cbRec); } if ((cbRec.animate) && (cbRec.dropSiteStatus == XmVALID_DROP_SITE)) DoAnimation(dsm, motionData, (XtPointer) &cbRec); dsm->dropManager.curDropSiteStatus = cbRec.dropSiteStatus; dsm->dropManager.curAnimate = cbRec.animate; dsm->dropManager.curOperations = cbRec.operations; dsm->dropManager.curOperation = cbRec.operation; if (dsm->dropManager.notifyProc) { XmDropSiteEnterCallbackStruct outCB; _XmRegionGetExtents(GetDSRegion(info), &extents); outCB.reason = XmCR_DROP_SITE_ENTER; outCB.event = NULL; outCB.timeStamp = cbRec.timeStamp; outCB.dropSiteStatus = cbRec.dropSiteStatus; outCB.operations = cbRec.operations; outCB.operation = cbRec.operation; /* * Pass outCB.x and outCB.y as the root relative position * of the entered drop site. Remote info's are already * in shell coordinates; Local info's are in widget * relative coordinates. */ if (GetDSRemote(info)) { outCB.x = extents.x + dsm->dropManager.rootX; outCB.y = extents.y + dsm->dropManager.rootY; } else { Widget widget = GetDSWidget(info); XtTranslateCoords(widget, 0, 0, &tmpX, &tmpY); outCB.x = extents.x + tmpX; outCB.y = extents.y + tmpY; } (*(dsm->dropManager.notifyProc)) ((Widget)dsm, dsm->dropManager.client_data, (XtPointer) &outCB); } } /*ARGSUSED*/ static void HandleMotion( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XmDragMotionCallbackStruct *callback, XmDSInfo info, #if NeedWidePrototypes unsigned int style ) #else unsigned char style ) #endif /* NeedWidePrototypes */ { XmDragProcCallbackStruct cbRec; cbRec.reason = XmCR_DROP_SITE_MOTION_MESSAGE; cbRec.event = (XEvent *) NULL; cbRec.timeStamp = callback->timeStamp; cbRec.dragContext = dsm->dropManager.curDragContext; cbRec.x = dsm->dropManager.curX; cbRec.y = dsm->dropManager.curY; cbRec.animate = dsm->dropManager.curAnimate; cbRec.dropSiteStatus = dsm->dropManager.curDropSiteStatus; if (info != NULL) { cbRec.operations = dsm->dropManager.curOperations; cbRec.operation = dsm->dropManager.curOperation; if ( (!GetDSRemote(info)) && (GetDSDragProc(info) != NULL)) { Widget widget = GetDSWidget(info); Position tmpX, tmpY; /* Return if this is not a managed widget */ if (! XtIsManaged(widget)) return; /* Make the coordinates widget relative */ XtTranslateCoords(widget, 0, 0, &tmpX, &tmpY); cbRec.x -= tmpX; cbRec.y -= tmpY; (*(GetDSDragProc(info))) (widget, NULL, (XtPointer) &cbRec); } if ((cbRec.animate) && (cbRec.dropSiteStatus != dsm->dropManager.curDropSiteStatus)) { if (cbRec.dropSiteStatus == XmVALID_DROP_SITE) cbRec.reason = XmCR_DROP_SITE_ENTER; else cbRec.reason = XmCR_DROP_SITE_LEAVE; DoAnimation(dsm, motionData, (XtPointer) &cbRec); cbRec.reason = XmCR_DROP_SITE_MOTION_MESSAGE; } dsm->dropManager.curDropSiteStatus = cbRec.dropSiteStatus; dsm->dropManager.curAnimate = cbRec.animate; dsm->dropManager.curOperations = cbRec.operations; dsm->dropManager.curOperation = cbRec.operation; } else { cbRec.operations = callback->operations; cbRec.operation = callback->operation; cbRec.dropSiteStatus = XmNO_DROP_SITE; } if (dsm->dropManager.notifyProc) { XmDragMotionCallbackStruct outCB; outCB.reason = XmCR_DRAG_MOTION; outCB.event = NULL; outCB.timeStamp = cbRec.timeStamp; outCB.dropSiteStatus = cbRec.dropSiteStatus; outCB.x = dsm->dropManager.curX; outCB.y = dsm->dropManager.curY; outCB.operations = cbRec.operations; outCB.operation = cbRec.operation; (*(dsm->dropManager.notifyProc)) ((Widget)dsm, dsm->dropManager.client_data, (XtPointer)&outCB); } } /*ARGSUSED*/ static void HandleLeave( XmDropSiteManagerObject dsm, XmDragMotionClientData motionData, XmDragMotionCallbackStruct *callback, XmDSInfo info, #if NeedWidePrototypes unsigned int style, /* unused */ int enterPending ) #else unsigned char style, Boolean enterPending ) #endif /* NeedWidePrototypes */ { XmDragProcCallbackStruct cbRec; cbRec.reason = XmCR_DROP_SITE_LEAVE_MESSAGE; cbRec.event = (XEvent *) NULL; cbRec.timeStamp = callback->timeStamp; cbRec.dragContext = dsm->dropManager.curDragContext; cbRec.x = dsm->dropManager.oldX; cbRec.y = dsm->dropManager.oldY; cbRec.operations = callback->operations; cbRec.operation = callback->operation; cbRec.animate = dsm->dropManager.curAnimate; cbRec.dropSiteStatus = dsm->dropManager.curDropSiteStatus; if ( (!GetDSRemote(info) && (GetDSDragProc(info) != NULL))) { Widget widget = GetDSWidget(info); Position tmpX, tmpY; /* Make the coordinates widget relative */ XtTranslateCoords(widget, 0, 0, &tmpX, &tmpY); cbRec.x -= tmpX; cbRec.y -= tmpY; (*(GetDSDragProc(info))) (widget, NULL, (XtPointer) &cbRec); } if ((cbRec.animate) && (cbRec.dropSiteStatus == XmVALID_DROP_SITE)) DoAnimation(dsm, motionData, (XtPointer) &cbRec); if (dsm->dropManager.notifyProc) { XmDropSiteEnterPendingCallbackStruct outCB; outCB.reason = XmCR_DROP_SITE_LEAVE; outCB.event = callback->event; outCB.timeStamp = cbRec.timeStamp; outCB.enter_pending = enterPending; (*(dsm->dropManager.notifyProc)) ((Widget)dsm, dsm->dropManager.client_data, (XtPointer)&outCB); } } /*ARGSUSED*/ static void ProcessMotion( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer calldata ) { XmDragMotionCallbackStruct *callback = (XmDragMotionCallbackStruct *) calldata; XmDragMotionClientData motionData = (XmDragMotionClientData) clientData; Position x = callback->x, y = callback->y; XmDSInfo dsRoot = (XmDSInfo) (dsm->dropManager.dsRoot); XmDSInfo curDSInfo = (XmDSInfo)(dsm->dropManager.curInfo); XmDSInfo newDSInfo; unsigned char style; if (dsm->dropManager.curDragContext == NULL) { XmeWarning((Widget)dsm, MESSAGE2); return; } style = _XmGetActiveProtocolStyle(dsm->dropManager.curDragContext); dsm->dropManager.curTime = callback->timeStamp; dsm->dropManager.oldX = dsm->dropManager.curX; dsm->dropManager.oldY = dsm->dropManager.curY; dsm->dropManager.curX = x; dsm->dropManager.curY = y; if (dsRoot) { /* * Make x and y shell relative, preregister info's are shell * relative, and CalculateAncestorClip (called for dynammic) * returns a shell relative rectangle. */ x -= dsm->dropManager.rootX; y -= dsm->dropManager.rootY; newDSInfo = PointToDSInfo(dsm, dsRoot, x, y); if (curDSInfo != newDSInfo) { if (curDSInfo) { /* if we are entering a drop site as we leave * the old drop site, we don't want to set * the drop site status to NO_DROP_SITE. We * are using the event field of the callback * (since is is guarenteed to be NULL) for * use as a flag, since we can't modify the * public callback struct. */ if (newDSInfo) HandleLeave(dsm, motionData, callback, curDSInfo, style, True); else HandleLeave(dsm, motionData, callback, curDSInfo, style, False); } dsm->dropManager.curInfo = (XtPointer) newDSInfo; _XmRegionUnion(dsm->dropManager.newAncestorClipRegion, dsm->dropManager.newAncestorClipRegion, dsm->dropManager.curAncestorClipRegion); if (newDSInfo) HandleEnter(dsm, motionData, callback, newDSInfo, style); return; } } HandleMotion(dsm, motionData, callback, curDSInfo, style); } /*ARGSUSED*/ static void ProcessDrop( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer cb ) { XmDragTopLevelClientData cd = (XmDragTopLevelClientData) clientData; XmDropStartCallbackStruct *callback = (XmDropStartCallbackStruct *) cb; XmDropProcCallbackStruct cbRec; Widget dragContext = XmGetDragContext((Widget)dsm, callback->timeStamp); XmDSInfo info = NULL; Widget widget = NULL; Position x, y, tmpX, tmpY; XmDSInfo savRoot, savInfo; XmDSInfo newRoot = (XmDSInfo) DSMWidgetToInfo(dsm, cd->destShell); Position savX, savY; Dimension savW, savH; Time savTime; if (dragContext == NULL) { /* * Can't do a failure transfer. Just give up. * * Should we send a warning message? */ return; } /* * Look out for race conditions. * * This should be enough state saving to allow the drop to occur * in the middle of some other drag. */ savRoot = (XmDSInfo) dsm->dropManager.dsRoot; savInfo = (XmDSInfo) dsm->dropManager.curInfo; savX = dsm->dropManager.rootX; savY = dsm->dropManager.rootY; savW = dsm->dropManager.rootW; savH = dsm->dropManager.rootH; savTime = dsm->dropManager.curTime; dsm->dropManager.curTime = callback->timeStamp; dsm->dropManager.dsRoot = (XtPointer) newRoot; dsm->dropManager.rootX = cd->xOrigin; dsm->dropManager.rootY = cd->yOrigin; dsm->dropManager.rootW = cd->width; dsm->dropManager.rootH = cd->height; x = callback->x - dsm->dropManager.rootX; y = callback->y - dsm->dropManager.rootY; if (newRoot != NULL) info = PointToDSInfo(dsm, (XmDSInfo) dsm->dropManager.dsRoot, x, y); if (info != NULL) { widget = GetDSWidget(info); } /* Handle error conditions nicely */ if ((info == NULL) || ! XtIsManaged(widget) || /* CR 5215 */ /* These are wierd conditions */ (newRoot == NULL) || (GetDSRemote(info)) || (GetDSDropProc(info) == NULL)) { /* we will do a failure drop transfer */ Arg args[4]; Cardinal i = 0; XtSetArg(args[i], XmNtransferStatus, XmTRANSFER_FAILURE); i++; XtSetArg(args[i], XmNnumDropTransfers, 0); i++; (void) XmDropTransferStart(dragContext, args, i); /* ??? * Should we do something interesting with the callback * struct before calling notify in these cases? * ??? */ } else { /* This will be needed by the ProxyDragProc */ dsm->dropManager.curInfo = (XtPointer) info; /* Make the coordinates widget relative */ XtTranslateCoords(widget, 0, 0, &tmpX, &tmpY); /* Load the dropProcStruct */ cbRec.reason = XmCR_DROP_MESSAGE; cbRec.event = callback->event; cbRec.timeStamp = callback->timeStamp; cbRec.dragContext = dragContext; /* Make the coordinates widget relative */ XtTranslateCoords(widget, 0, 0, &tmpX, &tmpY); cbRec.x = callback->x - tmpX; cbRec.y = callback->y - tmpY; { /* Nonsense to pre-load the cbRec correctly */ XmDragProcCallbackStruct junkRec; junkRec.reason = XmCR_DROP_SITE_MOTION_MESSAGE; junkRec.event = callback->event; junkRec.timeStamp = cbRec.timeStamp; junkRec.dragContext = dragContext; junkRec.x = cbRec.x; junkRec.y = cbRec.y; junkRec.dropSiteStatus = dsm->dropManager.curDropSiteStatus; junkRec.operation = callback->operation; junkRec.operations = callback->operations; junkRec.animate = dsm->dropManager.curAnimate; ProxyDragProc(dsm, NULL, &junkRec); cbRec.dropSiteStatus = junkRec.dropSiteStatus; cbRec.operation = junkRec.operation; cbRec.operations = junkRec.operations; } cbRec.dropAction = callback->dropAction; /* Call the drop site's drop proc */ (*(GetDSDropProc(info))) (widget, NULL, (XtPointer) &cbRec); callback->operation = cbRec.operation; callback->operations = cbRec.operations; callback->dropSiteStatus = cbRec.dropSiteStatus; callback->dropAction = cbRec.dropAction; } if (dsm->dropManager.notifyProc) { (*(dsm->dropManager.notifyProc)) ((Widget)dsm, dsm->dropManager.client_data, (XtPointer)callback); } dsm->dropManager.dsRoot = (XtPointer) savRoot; dsm->dropManager.curInfo = (XtPointer) savInfo; dsm->dropManager.rootX = savX; dsm->dropManager.rootY = savY; dsm->dropManager.rootW = savW; dsm->dropManager.rootH = savH; dsm->dropManager.curTime = savTime; } /*ARGSUSED*/ static void ChangeOperation( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer calldata ) { XmOperationChangedCallbackStruct *callback = (XmOperationChangedCallbackStruct *) calldata; XmDragMotionClientData motionData = (XmDragMotionClientData) clientData; XmDragProcCallbackStruct cbRec; XmDSInfo info = (XmDSInfo) dsm->dropManager.curInfo; unsigned char style; if ((cbRec.dragContext = dsm->dropManager.curDragContext) == NULL) { XmeWarning((Widget)dsm, MESSAGE3); return; } else { style = _XmGetActiveProtocolStyle( dsm->dropManager.curDragContext); } cbRec.reason = callback->reason; cbRec.event = callback->event; cbRec.timeStamp = callback->timeStamp; cbRec.x = dsm->dropManager.curX; cbRec.y = dsm->dropManager.curY; cbRec.dropSiteStatus = dsm->dropManager.curDropSiteStatus; cbRec.animate = dsm->dropManager.curAnimate; cbRec.operation = callback->operation; cbRec.operations = callback->operations; if (info != NULL) { ProxyDragProc(dsm, NULL, &cbRec); if ((style == XmDRAG_DYNAMIC) && (!GetDSRemote(info)) && (GetDSDragProc(info) != NULL)) { Widget widget = GetDSWidget(info); Position tmpX, tmpY; /* Make the coordinates widget relative */ XtTranslateCoords(widget, 0, 0, &tmpX, &tmpY); cbRec.x -= tmpX; cbRec.y -= tmpY; (*(GetDSDragProc(info))) (widget, NULL, (XtPointer) &cbRec); } if ((cbRec.animate) && (cbRec.dropSiteStatus != dsm->dropManager.curDropSiteStatus)) { if (cbRec.dropSiteStatus == XmVALID_DROP_SITE) cbRec.reason = XmCR_DROP_SITE_ENTER_MESSAGE; else cbRec.reason = XmCR_DROP_SITE_LEAVE_MESSAGE; DoAnimation(dsm, motionData, (XtPointer) &cbRec); cbRec.reason = callback->reason; } /* Update the callback rec */ callback->operations = cbRec.operations; callback->operation = cbRec.operation; callback->dropSiteStatus = cbRec.dropSiteStatus; /* Update the drop site manager */ dsm->dropManager.curDropSiteStatus = cbRec.dropSiteStatus; dsm->dropManager.curAnimate = cbRec.animate; dsm->dropManager.curOperations = cbRec.operations; dsm->dropManager.curOperation = cbRec.operation; } else { callback->dropSiteStatus = XmNO_DROP_SITE; } if (dsm->dropManager.notifyProc) { (*(dsm->dropManager.notifyProc)) ((Widget)dsm, dsm->dropManager.client_data, (XtPointer)callback); } } /*ARGSUSED*/ static void PutDSToStream( XmDropSiteManagerObject dsm, XmDSInfo dsInfo, #if NeedWidePrototypes int last, #else Boolean last, #endif /* NeedWidePrototypes */ XtPointer dataPtr ) { static XmRegion tmpRegion = NULL; unsigned char dsType = 0, tType = 0; unsigned char unitType = XmPIXELS; Position wX, wY; Widget w = GetDSWidget(dsInfo); Dimension bw = XtBorderWidth(w); XmICCDropSiteInfoStruct iccInfo; Arg args[30]; int n; _XmProcessLock(); if (tmpRegion == NULL) { tmpRegion = _XmRegionCreate(); } _XmProcessUnlock(); /* * Clear out the info. This is especially important in the cases * that the widget does not define resources all of the required * animation resources. */ bzero(((void *) &iccInfo), sizeof(iccInfo)); if (last) tType |= XmDSM_T_CLOSE; else tType &= ~ XmDSM_T_CLOSE; if (GetDSLeaf(dsInfo) || (!GetDSNumChildren(dsInfo))) dsType |= XmDSM_DS_LEAF; else dsType &= ~ XmDSM_DS_LEAF; if (GetDSInternal(dsInfo)) dsType |= XmDSM_DS_INTERNAL; else dsType &= ~ XmDSM_DS_INTERNAL; if (GetDSHasRegion(dsInfo)) dsType |= XmDSM_DS_HAS_REGION; else dsType &= ~ XmDSM_DS_HAS_REGION; /* * The local drop site tree is always kept in widget relative * coordinates. We have to put shell relative coordinates on * the wire however, so we to a copy and translate into a tmp * region. */ XtTranslateCoords(w, 0, 0, &wX, &wY); if (GetDSHasRegion(dsInfo)) { _XmProcessLock(); _XmRegionUnion(GetDSRegion(dsInfo), GetDSRegion(dsInfo), tmpRegion); _XmProcessUnlock(); } else { XRectangle rect; rect.x = rect.y = -bw; rect.width = XtWidth(w) + (2 * bw); rect.height = XtHeight(w) + (2 * bw); _XmProcessLock(); _XmRegionClear(tmpRegion); _XmRegionUnionRectWithRegion(&rect, tmpRegion, tmpRegion); _XmProcessUnlock(); } _XmProcessLock(); _XmRegionOffset(tmpRegion, (wX - dsm->dropManager.rootX), (wY - dsm->dropManager.rootY)); _XmProcessUnlock(); /* * We need to pull up the relevant visual information from * the widget so it will be available for correct animation * by a non-local peregister initiator. */ iccInfo.header.dropType = dsType; iccInfo.header.dropActivity = GetDSActivity(dsInfo); iccInfo.header.traversalType = tType; iccInfo.header.animationStyle = GetDSAnimationStyle(dsInfo); iccInfo.header.operations = GetDSOperations(dsInfo); iccInfo.header.importTargetsID = GetDSImportTargetsID(dsInfo); _XmProcessLock(); iccInfo.header.region = tmpRegion; _XmProcessUnlock(); /* * We need to retrieve information from the widget. XtGetValues is * too slow, so retrieve the information directly from the widget * instance. * * XtGetValues is used for non-Motif widgets, just in case they provide * Motif-style resources. * * (See also XmDropSiteGetActiveVisuals() ) */ if (XmIsPrimitive(w)) { XmPrimitiveWidget pw= (XmPrimitiveWidget)w; switch(iccInfo.header.animationStyle) { case XmDRAG_UNDER_HIGHLIGHT: { XmICCDropSiteHighlight info = (XmICCDropSiteHighlight) (&iccInfo); info->animation_data.highlightPixmap = XmUNSPECIFIED_PIXMAP; if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = pw->core.border_width; info->animation_data.highlightThickness = pw->primitive.highlight_thickness; info->animation_data.highlightColor = pw->primitive.highlight_color; info->animation_data.highlightPixmap = pw->primitive.highlight_pixmap; info->animation_data.background = pw->core.background_pixel; } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmICCDropSiteShadow info = (XmICCDropSiteShadow) (&iccInfo); info->animation_data.topShadowPixmap = info->animation_data.bottomShadowPixmap = XmUNSPECIFIED_PIXMAP; if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = pw->core.border_width; info->animation_data.highlightThickness = pw->primitive.highlight_thickness; info->animation_data.shadowThickness = pw->primitive.shadow_thickness; info->animation_data.foreground = pw->primitive.foreground; info->animation_data.topShadowColor = pw->primitive.top_shadow_color; info->animation_data.topShadowPixmap = pw->primitive.top_shadow_pixmap; info->animation_data.bottomShadowColor = pw->primitive.bottom_shadow_color; info->animation_data.bottomShadowPixmap = pw->primitive.bottom_shadow_pixmap; } break; case XmDRAG_UNDER_PIXMAP: { XmICCDropSitePixmap info = (XmICCDropSitePixmap) (&iccInfo); XmDSLocalPixmapStyle ps = (XmDSLocalPixmapStyle) GetDSLocalAnimationPart(dsInfo); info->animation_data.animationPixmapDepth = ps->animation_pixmap_depth; info->animation_data.animationPixmap = ps->animation_pixmap; info->animation_data.animationMask = ps->animation_mask; if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = pw->core.border_width; info->animation_data.highlightThickness = pw->primitive.highlight_thickness; info->animation_data.shadowThickness = pw->primitive.shadow_thickness; info->animation_data.foreground = pw->primitive.foreground; info->animation_data.background = pw->core.background_pixel; } break; case XmDRAG_UNDER_NONE: { XmICCDropSiteNone info = (XmICCDropSiteNone) (&iccInfo); if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = pw->core.border_width; else info->animation_data.borderWidth = 0; } default: { /*EMPTY*/ } break; } } else if (XmIsManager(w) || XmIsGadget(w)) { XmManagerWidget mw; XmGadget g; Boolean is_gadget; if (XmIsGadget(w)) { mw = (XmManagerWidget) XtParent(w); g = (XmGadget) w; is_gadget = True; } else { mw = (XmManagerWidget) w; g = NULL; is_gadget = False; } switch(iccInfo.header.animationStyle) { case XmDRAG_UNDER_HIGHLIGHT: { XmICCDropSiteHighlight info = (XmICCDropSiteHighlight) (&iccInfo); info->animation_data.highlightPixmap = XmUNSPECIFIED_PIXMAP; if (!GetDSHasRegion(dsInfo)) { if (is_gadget) info->animation_data.borderWidth = w->core.border_width; else info->animation_data.borderWidth = mw->core.border_width; } /* Temporary hack until we support full defaulting */ info->animation_data.highlightThickness = 1; info->animation_data.highlightColor = mw->manager.highlight_color; info->animation_data.highlightPixmap = mw->manager.highlight_pixmap; info->animation_data.background = mw->core.background_pixel; } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmICCDropSiteShadow info = (XmICCDropSiteShadow) (&iccInfo); info->animation_data.topShadowPixmap = info->animation_data.bottomShadowPixmap = XmUNSPECIFIED_PIXMAP; if (is_gadget) { if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = w->core.border_width; info->animation_data.shadowThickness = g->gadget.shadow_thickness; } else { if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = mw->core.border_width; info->animation_data.shadowThickness = mw->manager.shadow_thickness; } info->animation_data.highlightThickness = 0; info->animation_data.foreground = mw->manager.foreground; info->animation_data.topShadowColor = mw->manager.top_shadow_color; info->animation_data.topShadowPixmap = mw->manager.top_shadow_pixmap; info->animation_data.bottomShadowColor = mw->manager.bottom_shadow_color; info->animation_data.bottomShadowPixmap = mw->manager.bottom_shadow_pixmap; } break; case XmDRAG_UNDER_PIXMAP: { XmICCDropSitePixmap info = (XmICCDropSitePixmap) (&iccInfo); XmDSLocalPixmapStyle ps = (XmDSLocalPixmapStyle) GetDSLocalAnimationPart(dsInfo); info->animation_data.animationPixmapDepth = ps->animation_pixmap_depth; info->animation_data.animationPixmap = ps->animation_pixmap; info->animation_data.animationMask = ps->animation_mask; if (is_gadget) { if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = w->core.border_width; info->animation_data.shadowThickness = g->gadget.shadow_thickness; } else { if (!GetDSHasRegion(dsInfo)) info->animation_data.borderWidth = mw->core.border_width; info->animation_data.shadowThickness = mw->manager.shadow_thickness; } info->animation_data.highlightThickness = 0; info->animation_data.foreground = mw->manager.foreground; info->animation_data.background = mw->core.background_pixel; } break; case XmDRAG_UNDER_NONE: { XmICCDropSiteNone info = (XmICCDropSiteNone) (&iccInfo); if (!GetDSHasRegion(dsInfo)) { if (is_gadget) info->animation_data.borderWidth = w->core.border_width; else info->animation_data.borderWidth = mw->core.border_width; } else info->animation_data.borderWidth = 0; } default: { /*EMPTY*/ } break; } } else /* non-Motif subclass */ { n = 0; XtSetArg(args[n], XmNunitType, &unitType); n++; XtGetValues(w, args, n); if (unitType != XmPIXELS) { /* we need values in pixels */ n = 0; XtSetArg(args[n], XmNunitType, XmPIXELS); n++; XtSetValues(w, args, n); } switch(iccInfo.header.animationStyle) { case XmDRAG_UNDER_HIGHLIGHT: { XmICCDropSiteHighlight info = (XmICCDropSiteHighlight) (&iccInfo); /* * Pre-load a sane pixmap default in case the * widget doesn't have a pixmap resource. */ info->animation_data.highlightPixmap = XmUNSPECIFIED_PIXMAP; n = 0; if (!GetDSHasRegion(dsInfo)) { XtSetArg(args[n], XmNborderWidth, &(info->animation_data.borderWidth)); n++; } XtSetArg(args[n], XmNhighlightThickness, &(info->animation_data.highlightThickness)); n++; XtSetArg(args[n], XmNbackground, &(info->animation_data.background)); n++; XtSetArg(args[n], XmNhighlightColor, &(info->animation_data.highlightColor)); n++; XtSetArg(args[n], XmNhighlightPixmap, &(info->animation_data.highlightPixmap)); n++; XtGetValues(w, args, n); } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmICCDropSiteShadow info = (XmICCDropSiteShadow) (&iccInfo); /* Pre-load some sane pixmap defaults */ info->animation_data.topShadowPixmap = info->animation_data.bottomShadowPixmap = XmUNSPECIFIED_PIXMAP; n = 0; if (!GetDSHasRegion(dsInfo)) { XtSetArg(args[n], XmNborderWidth, &(info->animation_data.borderWidth)); n++; } XtSetArg(args[n], XmNhighlightThickness, &(info->animation_data.highlightThickness)); n++; XtSetArg(args[n], XmNshadowThickness, &(info->animation_data.shadowThickness)); n++; XtSetArg(args[n], XmNforeground, &(info->animation_data.foreground)); n++; XtSetArg(args[n], XmNtopShadowColor, &(info->animation_data.topShadowColor)); n++; XtSetArg(args[n], XmNbottomShadowColor, &(info->animation_data.bottomShadowColor)); n++; XtSetArg(args[n], XmNtopShadowPixmap, &(info->animation_data.topShadowPixmap)); n++; XtSetArg(args[n], XmNbottomShadowPixmap, &(info->animation_data.bottomShadowPixmap)); n++; XtGetValues(w, args, n); } break; case XmDRAG_UNDER_PIXMAP: { XmICCDropSitePixmap info = (XmICCDropSitePixmap) (&iccInfo); XmDSLocalPixmapStyle ps = (XmDSLocalPixmapStyle) GetDSLocalAnimationPart(dsInfo); info->animation_data.animationPixmapDepth = ps->animation_pixmap_depth; info->animation_data.animationPixmap = ps->animation_pixmap; info->animation_data.animationMask = ps->animation_mask; n = 0; if (!GetDSHasRegion(dsInfo)) { XtSetArg(args[n], XmNborderWidth, &(info->animation_data.borderWidth)); n++; } XtSetArg(args[n], XmNhighlightThickness, &(info->animation_data.highlightThickness)); n++; XtSetArg(args[n], XmNshadowThickness, &(info->animation_data.shadowThickness)); n++; XtSetArg(args[n], XmNforeground, &(info->animation_data.foreground)); n++; XtSetArg(args[n], XmNbackground, &(info->animation_data.background)); n++; XtGetValues(w, args, n); } break; case XmDRAG_UNDER_NONE: { XmICCDropSiteNone info = (XmICCDropSiteNone) (&iccInfo); if (!GetDSHasRegion(dsInfo)) { n = 0; XtSetArg(args[n], XmNborderWidth, &(info->animation_data.borderWidth)); n++; XtGetValues(w, args, n); } else info->animation_data.borderWidth = 0; } default: { /*EMPTY*/ } break; } if (unitType != XmPIXELS) { n = 0; XtSetArg(args[n], XmNunitType, unitType); n++; XtSetValues(w, args, n); } } _XmWriteDSToStream(dsm, dataPtr, &iccInfo); } /*ARGSUSED*/ static void GetDSFromDSM( XmDropSiteManagerObject dsm, XmDSInfo parentInfo, #if NeedWidePrototypes int last, #else Boolean last, #endif /* NeedWidePrototypes */ XtPointer dataPtr ) { XmDSInfo child; int i; PutDSToStream(dsm, parentInfo, last, dataPtr); last = False; for (i = 0; i < (int)GetDSNumChildren(parentInfo); i++) { if ((i + 1) == GetDSNumChildren(parentInfo)) last = True; child = (XmDSInfo) GetDSChild(parentInfo, i); if (!GetDSLeaf(child)) GetDSFromDSM(dsm, child, last, dataPtr); else PutDSToStream(dsm, child, last, dataPtr); } } /*ARGSUSED*/ static int GetTreeFromDSM( XmDropSiteManagerObject dsm, Widget shell, XtPointer dataPtr ) { XmDSInfo root = (XmDSInfo) DSMWidgetToInfo(dsm, shell); Position shellX, shellY, savX, savY; if (root == NULL) return(0); XtTranslateCoords(shell, 0, 0, &shellX, &shellY); /* Save current */ savX = dsm->dropManager.rootX; savY = dsm->dropManager.rootY; dsm->dropManager.rootX = shellX; dsm->dropManager.rootY = shellY; DSMSyncTree(dsm, shell); GetDSFromDSM(dsm, root, True, dataPtr); dsm->dropManager.rootX = savX; dsm->dropManager.rootY = savY; return(CountDropSites(root)); } /*ARGSUSED*/ static XmDSInfo GetDSFromStream( XmDropSiteManagerObject dsm, XtPointer dataPtr, Boolean *close, unsigned char *type ) { XmDSInfo info; XmICCDropSiteInfoStruct iccInfo; size_t size; _XmReadDSFromStream(dsm, dataPtr, &iccInfo); switch(iccInfo.header.animationStyle) { case XmDRAG_UNDER_HIGHLIGHT: if (iccInfo.header.dropType & XmDSM_DS_LEAF) size = sizeof(XmDSRemoteHighlightLeafRec); else size = sizeof(XmDSRemoteHighlightNodeRec); break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: if (iccInfo.header.dropType & XmDSM_DS_LEAF) size = sizeof(XmDSRemoteShadowLeafRec); else size = sizeof(XmDSRemoteShadowNodeRec); break; case XmDRAG_UNDER_PIXMAP: if (iccInfo.header.dropType & XmDSM_DS_LEAF) size = sizeof(XmDSRemotePixmapLeafRec); else size = sizeof(XmDSRemotePixmapNodeRec); break; case XmDRAG_UNDER_NONE: if (iccInfo.header.dropType & XmDSM_DS_LEAF) size = sizeof(XmDSRemoteNoneLeafRec); else size = sizeof(XmDSRemoteNoneNodeRec); break; default: if (iccInfo.header.dropType & XmDSM_DS_LEAF) size = sizeof(XmDSRemoteNoneLeafRec); else size = sizeof(XmDSRemoteNoneNodeRec); break; } info = (XmDSInfo) XtCalloc(1, size); /* Load the Status fields */ SetDSRemote(info, True); if (iccInfo.header.dropType & XmDSM_DS_LEAF) { SetDSLeaf(info, True); SetDSType(info, XmDROP_SITE_SIMPLE); } else { SetDSLeaf(info, False); SetDSType(info, XmDROP_SITE_COMPOSITE); } SetDSAnimationStyle(info, iccInfo.header.animationStyle); if (iccInfo.header.dropType & XmDSM_DS_INTERNAL) SetDSInternal(info, True); else SetDSInternal(info, False); if (iccInfo.header.dropType & XmDSM_DS_HAS_REGION) SetDSHasRegion(info, True); else SetDSHasRegion(info, False); SetDSActivity(info, iccInfo.header.dropActivity); SetDSImportTargetsID(info, iccInfo.header.importTargetsID); SetDSOperations(info, iccInfo.header.operations); SetDSRegion(info, iccInfo.header.region); /* Load the animation data */ switch(GetDSAnimationStyle(info)) { case XmDRAG_UNDER_HIGHLIGHT: { XmDSRemoteHighlightStyle hs = (XmDSRemoteHighlightStyle) GetDSRemoteAnimationPart(info); XmICCDropSiteHighlight hi = (XmICCDropSiteHighlight) (&iccInfo); hs->highlight_color = hi->animation_data.highlightColor; hs->highlight_pixmap = hi->animation_data.highlightPixmap; hs->background = hi->animation_data.background; hs->highlight_thickness = hi->animation_data.highlightThickness; hs->border_width = hi->animation_data.borderWidth; } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmDSRemoteShadowStyle ss = (XmDSRemoteShadowStyle) GetDSRemoteAnimationPart(info); XmICCDropSiteShadow si = (XmICCDropSiteShadow) (&iccInfo); ss->top_shadow_color = si->animation_data.topShadowColor; ss->top_shadow_pixmap = si->animation_data.topShadowPixmap; ss->bottom_shadow_color = si->animation_data.bottomShadowColor; ss->bottom_shadow_pixmap = si->animation_data.bottomShadowPixmap; ss->foreground = si->animation_data.foreground; ss->shadow_thickness = si->animation_data.shadowThickness; ss->highlight_thickness = si->animation_data.highlightThickness; ss->border_width = si->animation_data.borderWidth; } break; case XmDRAG_UNDER_PIXMAP: { XmDSRemotePixmapStyle ps = (XmDSRemotePixmapStyle) GetDSRemoteAnimationPart(info); XmICCDropSitePixmap pi = (XmICCDropSitePixmap) (&iccInfo); ps->animation_pixmap = pi->animation_data.animationPixmap; ps->animation_pixmap_depth = pi->animation_data.animationPixmapDepth; ps->animation_mask = pi->animation_data.animationMask; ps->background = pi->animation_data.background; ps->foreground = pi->animation_data.foreground; ps->shadow_thickness = pi->animation_data.shadowThickness; ps->highlight_thickness = pi->animation_data.highlightThickness; ps->border_width = pi->animation_data.borderWidth; } break; case XmDRAG_UNDER_NONE: { XmDSRemoteNoneStyle ns = (XmDSRemoteNoneStyle) GetDSRemoteAnimationPart(info); XmICCDropSiteNone ni = (XmICCDropSiteNone) (&iccInfo); ns->border_width = ni->animation_data.borderWidth; } break; default: break; } *close = (iccInfo.header.traversalType & XmDSM_T_CLOSE); *type = iccInfo.header.dropType; return(info); } /*ARGSUSED*/ static void GetNextDS( XmDropSiteManagerObject dsm, XmDSInfo parentInfo, XtPointer dataPtr ) { Boolean close = TRUE; unsigned char type; XmDSInfo new_w = GetDSFromStream(dsm, dataPtr, &close, &type); while (!close) { AddDSChild(parentInfo, new_w, GetDSNumChildren(parentInfo)); if (! (type & XmDSM_DS_LEAF)) GetNextDS(dsm, new_w, dataPtr); new_w = GetDSFromStream(dsm, dataPtr, &close, &type); } AddDSChild(parentInfo, new_w, GetDSNumChildren(parentInfo)); if (! (type & XmDSM_DS_LEAF)) GetNextDS(dsm, new_w, dataPtr); } /*ARGSUSED*/ static XmDSInfo ReadTree( XmDropSiteManagerObject dsm, XtPointer dataPtr ) { Boolean junkb; unsigned char junkc; XmDSInfo root = GetDSFromStream(dsm, dataPtr, &junkb, &junkc); SetDSShell(root, True); GetNextDS(dsm, root, dataPtr); return root; } /*ARGSUSED*/ static void FreeDSTree( XmDSInfo tree ) { int i; XmDSInfo child; if (!GetDSLeaf(tree)) for (i = 0; i < (int)GetDSNumChildren(tree); i++) { child = (XmDSInfo) GetDSChild(tree, i); FreeDSTree(child); } DestroyDSInfo(tree, True); } static void ChangeRoot( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer callData ) { XmDragTopLevelClientData cd = (XmDragTopLevelClientData) clientData; XmTopLevelEnterCallback callback = (XmTopLevelEnterCallback) callData; Widget newRoot = cd->destShell; XtPointer dataPtr = cd->iccInfo; dsm->dropManager.curTime = callback->timeStamp; if (callback->reason == XmCR_TOP_LEVEL_ENTER) { /* * We assume that the drag context will not change without * a call to change the root. */ dsm->dropManager.curDragContext = (Widget) XmGetDragContext( (Widget)dsm, callback->timeStamp); if (newRoot) { dsm->dropManager.dsRoot = DSMWidgetToInfo(dsm, newRoot); /* * Do we need to do anything for prereg emulation of dyn? */ } else { dsm->dropManager.dsRoot = (XtPointer) ReadTree(dsm, dataPtr); } dsm->dropManager.rootX = cd->xOrigin; dsm->dropManager.rootY = cd->yOrigin; dsm->dropManager.rootW = cd->width; dsm->dropManager.rootH = cd->height; } else if (dsm->dropManager.dsRoot)/* XmCR_TOP_LEVEL_LEAVE */ { if (dsm->dropManager.curInfo != NULL) { XmDragMotionCallbackStruct cbRec ; XmDragMotionClientDataStruct cdRec ; unsigned char style = _XmGetActiveProtocolStyle( dsm->dropManager.curDragContext); /* Fake out a motion message from the DragC */ cbRec.reason = XmCR_DROP_SITE_LEAVE; cbRec.event = callback->event; cbRec.timeStamp = callback->timeStamp; cbRec.x = dsm->dropManager.curX; cbRec.y = dsm->dropManager.curY; /* These fields are irrelevant on a leave */ cbRec.operations = cbRec.operation = 0; cbRec.dropSiteStatus = 0; /* Need these too */ cdRec.window = cd->window; cdRec.dragOver = cd->dragOver; HandleLeave(dsm, &cdRec, &cbRec, (XmDSInfo) dsm->dropManager.curInfo, style, False); dsm->dropManager.curInfo = NULL; } if (GetDSRemote((XmDSInfo)(dsm->dropManager.dsRoot))) FreeDSTree((XmDSInfo)dsm->dropManager.dsRoot); /* Invalidate the root--force errors to show themselves */ dsm->dropManager.curDragContext = NULL; dsm->dropManager.dsRoot = (XtPointer) NULL; dsm->dropManager.rootX = (Position) -1; dsm->dropManager.rootY = (Position) -1; dsm->dropManager.rootW = 0; dsm->dropManager.rootH = 0; } } static int CountDropSites( XmDSInfo info ) { int i; XmDSInfo child; int acc = 1; if (!GetDSLeaf(info)) { for (i = 0; i < (int)GetDSNumChildren(info); i++) { child = (XmDSInfo) GetDSChild(info, i); acc += CountDropSites(child); } } return(acc); } /* This short resource list is used to initialize just the activity member. */ static XtResource mini_resources[] = { { XmNdropSiteActivity, XmCDropSiteActivity, XmRDropSiteActivity, sizeof(unsigned char), XtOffsetOf( struct _XmDSFullInfoRec, activity), XmRImmediate, (XtPointer) XmDROP_SITE_ACTIVE }, }; static void CreateInfo( XmDropSiteManagerObject dsm, Widget widget, ArgList args, Cardinal argCount ) { XmDSFullInfoRec fullInfoRec; XmDSInfo new_info, prev_info; XmRegion region = _XmRegionCreate(); Widget shell = widget; size_t size; /* zero out the working info struct */ bzero((void *)(&fullInfoRec), sizeof(fullInfoRec)); /* Load that puppy */ SetDSLeaf(&fullInfoRec, True); fullInfoRec.widget = widget; XtGetSubresources(widget, &fullInfoRec, NULL, NULL, _XmDSResources, _XmNumDSResources, args, argCount); /* Handle ignore first. */ if (fullInfoRec.activity == XmDROP_SITE_IGNORE) { return; } DSMStartUpdate(dsm, widget); /* Do some input validation */ if ((fullInfoRec.activity == XmDROP_SITE_ACTIVE) && (fullInfoRec.drop_proc == NULL)) { XmeWarning(widget, MESSAGE4); } if ((fullInfoRec.animation_style == XmDRAG_UNDER_PIXMAP) && (fullInfoRec.animation_pixmap != XmUNSPECIFIED_PIXMAP) && (fullInfoRec.animation_pixmap_depth == 0)) { /* * They didn't tell us the depth of the pixmaps. ask for it. */ XmeGetPixmapData(XtScreen(widget), fullInfoRec.animation_pixmap, NULL, (int*)&(fullInfoRec.animation_pixmap_depth), NULL, NULL, NULL, NULL, NULL, NULL); } if ((fullInfoRec.type == XmDROP_SITE_COMPOSITE) && ((fullInfoRec.rectangles != NULL) || (fullInfoRec.num_rectangles != 1))) { XmeWarning(widget, MESSAGE5); fullInfoRec.rectangles = NULL; fullInfoRec.num_rectangles = 1; } /* Handle the region*/ if (fullInfoRec.rectangles == NULL) { XRectangle rect; Dimension bw = XtBorderWidth(widget); rect.x = rect.y = -bw; rect.width = XtWidth(widget) + (2 * bw); rect.height = XtHeight(widget) + (2 * bw); _XmRegionUnionRectWithRegion(&rect, region, region); fullInfoRec.region = region; /* * Leave HasRegion == 0 indicating that we created this * region for the drop site. */ } else { int i; XRectangle *rects = fullInfoRec.rectangles; for (i=0; i < fullInfoRec.num_rectangles; i++) _XmRegionUnionRectWithRegion(&(rects[i]), region, region); fullInfoRec.region = region; fullInfoRec.status.has_region = True; } XtAddCallback(widget, XmNdestroyCallback, DestroyCallback, dsm); while(!XtIsShell(shell)) shell = XtParent(shell); fullInfoRec.import_targets_ID = _XmTargetsToIndex(shell, fullInfoRec.import_targets, fullInfoRec.num_import_targets); switch(fullInfoRec.animation_style) { case XmDRAG_UNDER_PIXMAP: if (fullInfoRec.type == XmDROP_SITE_COMPOSITE) size = sizeof(XmDSLocalPixmapNodeRec); else size = sizeof(XmDSLocalPixmapLeafRec); break; case XmDRAG_UNDER_HIGHLIGHT: case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: case XmDRAG_UNDER_NONE: default: if (fullInfoRec.type == XmDROP_SITE_COMPOSITE) size = sizeof(XmDSLocalNoneNodeRec); else size = sizeof(XmDSLocalNoneLeafRec); break; } new_info = (XmDSInfo) XtCalloc(1, size); CopyFullIntoVariant(&fullInfoRec, new_info); if ((prev_info = (XmDSInfo) DSMWidgetToInfo(dsm, widget)) == NULL) { DSMRegisterInfo(dsm, widget, (XtPointer) new_info); } else { if (GetDSInternal(prev_info)) { /* * They are registering a widget for which we already had * to register internally. The only types of widgets which * we register internally are of type * XmDROP_SITE_COMPOSITE with children! This means that * they are trying to create their drop sites out of order * (parents must be registered before their children). */ XmeWarning(widget, MESSAGE6); } else { XmeWarning(widget, MESSAGE7); } DestroyDSInfo(new_info, True); return; } DSMInsertInfo(dsm, (XtPointer) new_info, NULL); DSMEndUpdate(dsm, widget); } /*ARGSUSED*/ static void CopyVariantIntoFull( XmDropSiteManagerObject dsm, XmDSInfo variant, XmDSFullInfo full_info ) { Widget shell; Atom *targets; Cardinal num_targets; long num_rects; XRectangle *rects; int index; if (GetDSRemote(variant)) shell = XtParent(dsm); else shell = GetDSWidget(variant); while (!XtIsShell(shell)) shell = XtParent(shell); /* * Clear the full info back to the default (kind of) state. */ bzero((void *)(full_info), sizeof(XmDSFullInfoRec)); full_info->animation_pixmap = XmUNSPECIFIED_PIXMAP; full_info->animation_mask = XmUNSPECIFIED_PIXMAP; /* Structure copy the status stuff across */ full_info->status = variant->status; full_info->parent = GetDSParent(variant); full_info->import_targets_ID = GetDSImportTargetsID(variant); full_info->operations = GetDSOperations(variant); full_info->region = GetDSRegion(variant); full_info->drag_proc = GetDSDragProc(variant); full_info->drop_proc = GetDSDropProc(variant); full_info->client_data = GetDSClientData(variant); full_info->widget = GetDSWidget(variant); full_info->type = GetDSType(variant); full_info->animation_style = GetDSAnimationStyle(variant); full_info->activity = GetDSActivity(variant); index = GetDSImportTargetsID(variant); if (index) { num_targets = _XmIndexToTargets(shell, index, &targets); full_info->num_import_targets = num_targets; full_info->import_targets = targets; } else { full_info->num_import_targets = 0; full_info->import_targets = NULL; } _XmRegionGetRectangles(GetDSRegion(variant), &rects, &num_rects); full_info->rectangles = rects; full_info->num_rectangles = (Cardinal) num_rects; if (GetDSRemote(variant)) { switch(GetDSAnimationStyle(variant)) { case XmDRAG_UNDER_HIGHLIGHT: { XmDSRemoteHighlightStyle hs = (XmDSRemoteHighlightStyle) GetDSRemoteAnimationPart(variant); full_info->highlight_color = hs->highlight_color; full_info->highlight_pixmap = hs->highlight_pixmap; full_info->background = hs->background; full_info->highlight_thickness = hs->highlight_thickness; full_info->border_width = hs->border_width; } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmDSRemoteShadowStyle ss = (XmDSRemoteShadowStyle) GetDSRemoteAnimationPart(variant); full_info->top_shadow_color = ss->top_shadow_color; full_info->top_shadow_pixmap = ss->top_shadow_pixmap; full_info->bottom_shadow_color = ss->bottom_shadow_color; full_info->bottom_shadow_pixmap = ss->bottom_shadow_pixmap; full_info->foreground = ss->foreground; full_info->shadow_thickness = ss->shadow_thickness; full_info->highlight_thickness = ss->highlight_thickness; full_info->border_width = ss->border_width; } break; case XmDRAG_UNDER_PIXMAP: { XmDSRemotePixmapStyle ps = (XmDSRemotePixmapStyle) GetDSRemoteAnimationPart(variant); full_info->animation_pixmap = ps->animation_pixmap; full_info->animation_pixmap_depth = ps->animation_pixmap_depth; full_info->animation_mask = ps->animation_mask; full_info->background = ps->background; full_info->foreground = ps->foreground; full_info->shadow_thickness = ps->shadow_thickness; full_info->highlight_thickness = ps->highlight_thickness; full_info->border_width = ps->border_width; } break; case XmDRAG_UNDER_NONE: default: break; } } else { switch(GetDSAnimationStyle(variant)) { case XmDRAG_UNDER_HIGHLIGHT: break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: break; case XmDRAG_UNDER_PIXMAP: { XmDSLocalPixmapStyle ps = (XmDSLocalPixmapStyle) GetDSLocalAnimationPart(variant); full_info->animation_pixmap = ps->animation_pixmap; full_info->animation_pixmap_depth = ps->animation_pixmap_depth; full_info->animation_mask = ps->animation_mask; } break; case XmDRAG_UNDER_NONE: default: break; } } } /*ARGSUSED*/ static void RetrieveInfo( XmDropSiteManagerObject dsm, Widget widget, ArgList args, Cardinal argCount ) { XmDSFullInfoRec full_info_rec; XmDSInfo info; #ifdef FIX_1212 int i; Boolean freeRects; #else XRectangle *rects; #endif if (XmIsDragContext(widget)) { if (widget != dsm->dropManager.curDragContext) return; else info = (XmDSInfo) (dsm->dropManager.curInfo); } else info = (XmDSInfo) DSMWidgetToInfo(dsm, widget); if (info == NULL) return; CopyVariantIntoFull(dsm, info, &full_info_rec); XtGetSubvalues((XtPointer)(&full_info_rec), (XtResourceList)(_XmDSResources), (Cardinal)(_XmNumDSResources), (ArgList)(args), (Cardinal)(argCount)); #ifdef FIX_1212 freeRects = True; for (i = 0 ; i < argCount; i++) { if (strcmp(args[i].name, "dropRectangles") == 0) freeRects = False; } if (freeRects && full_info_rec.rectangles) XtFree((char *) full_info_rec.rectangles); #else rects = full_info_rec.rectangles; if (rects) XtFree((char *) rects); #endif } /*ARGSUSED*/ static void CopyFullIntoVariant( XmDSFullInfo full_info, XmDSInfo variant ) { /* * This procedure assumes that variant is a variant of Local, * there should be no calls to this procedure with variant of * remote. */ if (GetDSRemote(full_info)) return; /* Magic internal fields */ SetDSRemote(variant, GetDSRemote(full_info)); SetDSLeaf(variant, GetDSLeaf(full_info)); SetDSShell(variant, GetDSShell(full_info)); SetDSHasRegion(variant, full_info->status.has_region); /* Externally visible fields */ SetDSAnimationStyle(variant, full_info->animation_style); SetDSType(variant, full_info->type); SetDSActivity(variant, full_info->activity); SetDSImportTargetsID(variant, full_info->import_targets_ID); SetDSOperations(variant, full_info->operations); SetDSRegion(variant, full_info->region); SetDSDragProc(variant, full_info->drag_proc); SetDSDropProc(variant, full_info->drop_proc); SetDSClientData(variant, full_info->client_data); SetDSWidget(variant, full_info->widget); switch(full_info->animation_style) { case XmDRAG_UNDER_HIGHLIGHT: break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: break; case XmDRAG_UNDER_PIXMAP: { XmDSLocalPixmapStyle ps = (XmDSLocalPixmapStyle) GetDSLocalAnimationPart(variant); ps->animation_pixmap = full_info->animation_pixmap; ps->animation_pixmap_depth = full_info->animation_pixmap_depth; ps->animation_mask = full_info->animation_mask; } break; case XmDRAG_UNDER_NONE: default: break; } } /*ARGSUSED*/ static void UpdateInfo( XmDropSiteManagerObject dsm, Widget widget, ArgList args, Cardinal argCount ) { XmDSFullInfoRec full_info_rec; XmDSFullInfo full_info = &full_info_rec; XmDSInfo info = (XmDSInfo) DSMWidgetToInfo(dsm, widget); unsigned char type; XmRegion old_region; XRectangle *rects; long num_rects; if ((info == NULL) || GetDSInternal(info)) return; rects = NULL; DSMStartUpdate(dsm, widget); CopyVariantIntoFull(dsm, info, full_info); /* Save the type and region in case they try to cheat */ type = GetDSType(info); old_region = GetDSRegion(info); /* BEGIN OSF Fix CR 5335 */ /* * Set up the rectangle list stuff. */ rects = full_info->rectangles; num_rects = (long) full_info->num_rectangles; /* END OSF Fix CR 5335 */ /* Update the info */ { Atom *old_import_targets; Cardinal old_num_import_targets; old_num_import_targets = full_info->num_import_targets; old_import_targets = full_info->import_targets; XtSetSubvalues(full_info, _XmDSResources, _XmNumDSResources, args, argCount); if ( (full_info->num_import_targets != old_num_import_targets) || (full_info->import_targets != old_import_targets) ) { Widget shell = widget; while(!(XtIsShell(shell))) shell = XtParent(shell); full_info->import_targets_ID = _XmTargetsToIndex(shell, full_info->import_targets, full_info->num_import_targets); } } if (full_info->type != type) { XmeWarning(widget, MESSAGE8); full_info->type = type; } if ((full_info->rectangles != rects) || (full_info->num_rectangles != num_rects)) { if (type == XmDROP_SITE_SIMPLE) { int i; XmRegion new_region = _XmRegionCreate(); for (i=0; i < full_info->num_rectangles; i++) _XmRegionUnionRectWithRegion( &(full_info->rectangles[i]), new_region, new_region); full_info->region = new_region; full_info->status.has_region = True; _XmRegionDestroy(old_region); } else { XmeWarning(widget, MESSAGE9); } /* BEGIN OSF Fix CR 5335 */ /* END OSF Fix CR 5335 */ } if ((full_info->animation_style == XmDRAG_UNDER_PIXMAP) && (full_info->animation_pixmap_depth == 0)) { Widget widget = GetDSWidget(info); XmeGetPixmapData(XtScreen(widget), full_info->animation_pixmap, NULL, (int*)&(full_info->animation_pixmap_depth), NULL, NULL, NULL, NULL, NULL, NULL); } /* * If the animation style has changed, we need to change info * into a different variant. */ if (full_info->animation_style != GetDSAnimationStyle(info)) { XmDSInfo new_info; size_t size; switch (full_info->animation_style) { case XmDRAG_UNDER_PIXMAP: if (GetDSType(info) == XmDROP_SITE_COMPOSITE) size = sizeof(XmDSLocalPixmapNodeRec); else size = sizeof(XmDSLocalPixmapLeafRec); break; case XmDRAG_UNDER_HIGHLIGHT: case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: case XmDRAG_UNDER_NONE: default: if (GetDSType(info) == XmDROP_SITE_COMPOSITE) size = sizeof(XmDSLocalNoneNodeRec); else size = sizeof(XmDSLocalNoneLeafRec); break; } /* Allocate the new info rec */ new_info = (XmDSInfo) XtCalloc(1, size); CopyFullIntoVariant(full_info, new_info); /* * Fix the parent pointers of the children */ SetDSNumChildren(new_info, GetDSNumChildren(info)); SetDSChildren(new_info, GetDSChildren(info)); if ((GetDSType(new_info) == XmDROP_SITE_COMPOSITE) && (GetDSNumChildren(new_info))) { XmDSInfo child; int i; for (i=0; i < (int)GetDSNumChildren(new_info); i++) { child = (XmDSInfo) GetDSChild(new_info, i); SetDSParent(child, new_info); } } /* Clear the registered bit on the new one */ SetDSRegistered(new_info, False); /* Remove the old one from the hash table */ DSMUnregisterInfo(dsm, info); /* Replace the old one in the drop site tree */ ReplaceDSChild(info, new_info); /* Destroy the old one, but not anything it points to */ DestroyDSInfo(info, False); /* Register the new one */ DSMRegisterInfo(dsm, widget, (XtPointer) new_info); } else { CopyFullIntoVariant(full_info, info); } DSMEndUpdate(dsm, widget); if (rects!=NULL) XtFree ((char *)rects); } /*ARGSUSED*/ static void StartUpdate( XmDropSiteManagerObject dsm, Widget refWidget ) { Widget shell = refWidget; XmDSInfo shellInfo; while(!(XtIsShell(shell))) shell = XtParent(shell); shellInfo = (XmDSInfo) DSMWidgetToInfo(dsm, shell); if (shellInfo) SetDSUpdateLevel(shellInfo, (GetDSUpdateLevel(shellInfo) + 1)); } /*ARGSUSED*/ static void EndUpdate( XmDropSiteManagerObject dsm, Widget refWidget ) { _XmDropSiteUpdateInfo dsupdate, oldupdate; Boolean found = False; Boolean clean; Widget shell; XmDSInfo shellInfo; dsupdate = dsm -> dropManager.updateInfo; clean = (dsupdate == NULL); shell = refWidget; while(!(XtIsShell(shell))) shell = XtParent(shell); shellInfo = (XmDSInfo) DSMWidgetToInfo(dsm, shell); if (shellInfo == NULL) return; if (GetDSUpdateLevel(shellInfo) > 0) SetDSUpdateLevel(shellInfo, (GetDSUpdateLevel(shellInfo) - 1)); if (GetDSUpdateLevel(shellInfo) > 0) return; /* Fix CR 7976, losing track of some updates because of bad list manipulation */ oldupdate = dsupdate; /* Really, keep track of toplevel widgets to be updated */ while(dsupdate) { if (dsupdate -> refWidget == shell) { found = True; break; } dsupdate = dsupdate -> next; } if (! found) { /* Queue real end update to a timeout */ dsupdate = (_XmDropSiteUpdateInfo) XtMalloc(sizeof(_XmDropSiteUpdateInfoRec)); dsupdate -> dsm = dsm; dsupdate -> refWidget = shell; dsupdate -> next = oldupdate; dsm -> dropManager.updateInfo = dsupdate; } /* We don't add a timeout if the record is already marked for update */ if (clean) { dsm -> dropManager.updateTimeOutId = XtAppAddTimeOut(XtWidgetToApplicationContext(shell), 0, _XmIEndUpdate, dsm); } } /*ARGSUSED*/ void _XmIEndUpdate(XtPointer client_data, XtIntervalId *interval_id) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) client_data; _XmDropSiteUpdateInfo dsupdate; Widget shell; XmDSInfo shellInfo; /* Remove timeout if this is a forced update */ if (dsm -> dropManager.updateTimeOutId) { if (interval_id == NULL) XtRemoveTimeOut(dsm -> dropManager.updateTimeOutId); dsm -> dropManager.updateTimeOutId = 0; } /* Return if all updates have already happened */ while(dsm -> dropManager.updateInfo != NULL) { dsupdate = (_XmDropSiteUpdateInfo) dsm -> dropManager.updateInfo; shell = dsupdate -> refWidget; dsm -> dropManager.updateInfo = dsupdate -> next; XtFree((char*) dsupdate); while(!(XtIsShell(shell))) shell = XtParent(shell); shellInfo = (XmDSInfo) DSMWidgetToInfo(dsm, shell); if (shellInfo && XtIsRealized(shell)) { /* This one's for real */ if (_XmGetDragProtocolStyle(shell) != XmDRAG_DYNAMIC) { XmDropSiteTreeAddCallbackStruct outCB; /* Gotta' update that window property. */ outCB.reason = XmCR_DROP_SITE_TREE_ADD; outCB.event = NULL; outCB.rootShell = shell; outCB.numDropSites = CountDropSites(shellInfo); outCB.numArgsPerDSHint = 0; if (dsm->dropManager.treeUpdateProc) (dsm->dropManager.treeUpdateProc) ((Widget) dsm, NULL, (XtPointer) &outCB); } else { /* We have to Sync the regions with the widgets */ SyncTree(dsm, shell); } } } } static void DestroyInfo( XmDropSiteManagerObject dsm, Widget widget ) { XmDSInfo info = (XmDSInfo) DSMWidgetToInfo(dsm, widget); if (info == NULL) return; DSMStartUpdate(dsm, widget); if (info == (XmDSInfo) (dsm->dropManager.curInfo)) { Widget shell; XmDragMotionCallbackStruct cbRec ; XmDragMotionClientDataStruct cdRec ; unsigned char style = _XmGetActiveProtocolStyle( dsm->dropManager.curDragContext); /* Fake out a motion message from the DragC */ cbRec.reason = XmCR_DROP_SITE_LEAVE; cbRec.event = NULL; cbRec.timeStamp = dsm->dropManager.curTime; cbRec.x = dsm->dropManager.curX; cbRec.y = dsm->dropManager.curY; /* These fields are irrelevant on a leave */ cbRec.operations = cbRec.operation = 0; cbRec.dropSiteStatus = 0; /* Need these too */ shell = GetDSWidget(info); while (!XtIsShell(shell)) shell = XtParent(shell); cdRec.window = XtWindow(shell); cdRec.dragOver = (Widget) (((XmDragContext)(dsm->dropManager.curDragContext)) ->drag.curDragOver); HandleLeave(dsm, &cdRec, &cbRec, (XmDSInfo) dsm->dropManager.curInfo, style, False); dsm->dropManager.curInfo = NULL; } while(info != NULL) { DSMRemoveInfo(dsm, (XtPointer) info); DestroyDSInfo(info, True); /* This should be NULL now, otherwise, keep removing until done */ info = (XmDSInfo) DSMWidgetToInfo(dsm, widget); } DSMEndUpdate(dsm, widget); } static void SyncDropSiteGeometry( XmDropSiteManagerObject dsm, XmDSInfo info ) { XmDSInfo child; if (!GetDSLeaf(info)) { int i; for (i = 0; i < (int)GetDSNumChildren(info); i++) { child = (XmDSInfo) GetDSChild(info, i); SyncDropSiteGeometry(dsm, child); } } if (!GetDSHasRegion(info)) { Widget w = GetDSWidget(info); XRectangle rect; Dimension bw = XtBorderWidth(w); /* The region is the object rectangle */ /* assert(GetDSRegion(info) != NULL) */ /* The region comes from the widget */ rect.x = rect.y = -bw; rect.width = XtWidth(w) + (2 * bw); rect.height = XtHeight(w) + (2 * bw); _XmRegionClear(GetDSRegion(info)); _XmRegionUnionRectWithRegion(&rect, GetDSRegion(info), GetDSRegion(info)); } } static void SyncTree( XmDropSiteManagerObject dsm, Widget shell ) { XmDSInfo saveRoot; XmDSInfo root = (XmDSInfo) DSMWidgetToInfo(dsm, shell); Position shellX, shellY, savX, savY; if ((root == NULL) || (GetDSRemote(root))) return; /* * Set things up so that the shell coordinates are trivially * available. */ saveRoot = (XmDSInfo) dsm->dropManager.dsRoot; savX = dsm->dropManager.rootX; savY = dsm->dropManager.rootY; dsm->dropManager.dsRoot = (XtPointer) root; XtTranslateCoords(GetDSWidget(root), 0, 0, &shellX, &shellY); dsm->dropManager.rootX = shellX; dsm->dropManager.rootY = shellY; /* Do the work */ RemoveAllClippers(dsm, root); SyncDropSiteGeometry(dsm, root); DetectAndInsertAllClippers(dsm, root); /* Restore the DSM */ dsm->dropManager.dsRoot = (XtPointer) saveRoot; dsm->dropManager.rootX = savX; dsm->dropManager.rootY = savY; } void _XmSyncDropSiteTree( Widget shell ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(shell))); DSMSyncTree(dsm, shell); } static void Update( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer callData ) { XmAnyCallbackStruct *callback = (XmAnyCallbackStruct *)callData; switch(callback->reason) { case XmCR_TOP_LEVEL_ENTER: case XmCR_TOP_LEVEL_LEAVE: DSMChangeRoot(dsm, clientData, callData); break; case XmCR_DRAG_MOTION: DSMProcessMotion(dsm, clientData, callData); break; case XmCR_DROP_START: DSMProcessDrop(dsm, clientData, callData); break; case XmCR_OPERATION_CHANGED: DSMOperationChanged(dsm, clientData, callData); default: break; } } void _XmDSMUpdate( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer callData ) { DSMUpdate(dsm, clientData, callData); } int _XmDSMGetTreeFromDSM( XmDropSiteManagerObject dsm, Widget shell, XtPointer dataPtr ) { return(DSMGetTreeFromDSM(dsm, shell, dataPtr)); } Boolean _XmDropSiteShell( Widget widget ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); if ((XtIsShell(widget)) && (DSMWidgetToInfo(dsm, widget) != NULL)) return(True); else return(False); } static Boolean HasDropSiteDescendant( XmDropSiteManagerObject dsm, Widget widget ) { CompositeWidget cw; int i; Widget child; if (!XtIsComposite(widget)) return(False); cw = (CompositeWidget) widget; for (i = 0; i < cw->composite.num_children; i++) { child = cw->composite.children[i]; if ((DSMWidgetToInfo(dsm, child) != NULL) || (HasDropSiteDescendant(dsm, child))) { return(True); } } return(False); } Boolean _XmDropSiteWrapperCandidate( Widget widget ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); Widget shell; if (widget == NULL) return(False); if (DSMWidgetToInfo(dsm, widget) != NULL) return(True); else if (!XtIsComposite(widget)) return(False); /* * Make sure that there might be a drop site somewhere in * this shell before traversing the descendants. */ shell = widget; while (!XtIsShell(shell)) shell = XtParent(shell); if (!_XmDropSiteShell(shell)) return(False); return(HasDropSiteDescendant(dsm, widget)); } /*ARGSUSED*/ static void DestroyCallback( Widget widget, XtPointer client_data, XtPointer call_data ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) client_data; DSMDestroyInfo(dsm, widget); /* Force Update */ _XmIEndUpdate((XtPointer) dsm, (XtIntervalId *) NULL); } Boolean XmDropSiteRegistered( Widget widget ) { XmDropSiteManagerObject dsm; XtPointer info; _XmWidgetToAppContext(widget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); info = DSMWidgetToInfo(dsm, widget); if ((info == NULL)) { _XmAppUnlock(app); return False; } _XmAppUnlock(app); return True; } void XmDropSiteRegister( Widget widget, ArgList args, Cardinal argCount ) { XmDropSiteManagerObject dsm; _XmWidgetToAppContext(widget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); if (XtIsShell(widget)) { XmeWarning(widget, MESSAGE10); } else DSMCreateInfo(dsm, widget, args, argCount); _XmAppUnlock(app); } void XmDropSiteUnregister( Widget widget ) { XmDropSiteManagerObject dsm; _XmWidgetToAppContext(widget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); DSMDestroyInfo(dsm, widget); /* Force Update */ _XmIEndUpdate((XtPointer) dsm, (XtIntervalId *) NULL); _XmAppUnlock(app); } void XmDropSiteStartUpdate( Widget refWidget ) { XmDropSiteManagerObject dsm; _XmWidgetToAppContext(refWidget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(refWidget))); DSMStartUpdate(dsm, refWidget); _XmAppUnlock(app); } void XmDropSiteUpdate( Widget enclosingWidget, ArgList args, Cardinal argCount ) { XmDropSiteManagerObject dsm; _XmWidgetToAppContext(enclosingWidget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(enclosingWidget))); DSMUpdateInfo(dsm, enclosingWidget, args, argCount); _XmAppUnlock(app); } void XmDropSiteEndUpdate( Widget refWidget ) { XmDropSiteManagerObject dsm; _XmWidgetToAppContext(refWidget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(refWidget))); DSMEndUpdate(dsm, refWidget); _XmAppUnlock(app); } void XmDropSiteRetrieve( Widget enclosingWidget, ArgList args, Cardinal argCount ) { XmDropSiteManagerObject dsm; _XmWidgetToAppContext(enclosingWidget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(enclosingWidget))); /* Update if dsm is dirty */ _XmIEndUpdate((XtPointer) dsm, (XtIntervalId *) NULL); DSMRetrieveInfo(dsm, enclosingWidget, args, argCount); _XmAppUnlock(app); } Status XmDropSiteQueryStackingOrder( Widget widget, Widget *parent_rtn, Widget **children_rtn, Cardinal *num_children_rtn ) { XmDropSiteManagerObject dsm; XmDSInfo info; XmDSInfo parentInfo; Cardinal num_visible_children = 0; /* visible to application code */ int i,j; _XmWidgetToAppContext(widget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); info = (XmDSInfo) DSMWidgetToInfo(dsm, widget); /* Update if dsm is dirty */ _XmIEndUpdate((XtPointer) dsm, (XtIntervalId *) NULL); if (info == NULL) { _XmAppUnlock(app); return(0); } if (!GetDSLeaf(info)) { for (i=0; i < (int)GetDSNumChildren(info); i++) { XmDSInfo child = (XmDSInfo) GetDSChild(info, i); if (!GetDSInternal(child)) num_visible_children++; } if (num_visible_children) { *children_rtn = (Widget *) XtMalloc(sizeof(Widget) * num_visible_children); /* Remember to reverse the order */ for (j=0, i=(GetDSNumChildren(info) - 1); i >= 0; i--) { XmDSInfo child = (XmDSInfo) GetDSChild(info, i); if (!GetDSInternal(child)) (*children_rtn)[j++] = GetDSWidget(child); } /* assert(j == num_visible_children) */ } else *children_rtn = NULL; *num_children_rtn = num_visible_children; } else { *children_rtn = NULL; *num_children_rtn = 0; } parentInfo = (XmDSInfo) GetDSParent(info); if (GetDSInternal(parentInfo)) { *parent_rtn = NULL; while ((parentInfo = (XmDSInfo) GetDSParent(parentInfo)) != NULL) if (!GetDSInternal(parentInfo)) *parent_rtn = GetDSWidget(parentInfo); } else *parent_rtn = GetDSWidget(parentInfo); _XmAppUnlock(app); return(1); } void XmDropSiteConfigureStackingOrder( Widget widget, Widget sibling, Cardinal stack_mode ) { XmDropSiteManagerObject dsm; XmDSInfo info; XmDSInfo parent; _XmWidgetToAppContext(widget); if (widget == NULL) return; _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); info = (XmDSInfo) DSMWidgetToInfo(dsm, widget); if ((widget == sibling) || (info == NULL)) { _XmAppUnlock(app); return; } parent = (XmDSInfo) GetDSParent(info); if (sibling != NULL) { XmDSInfo sib = (XmDSInfo) DSMWidgetToInfo(dsm, sibling); Cardinal index, sib_index; int i; if ((sib == NULL) || (((XmDSInfo) GetDSParent(sib)) != parent) || (XtParent(widget) != XtParent(sibling))) { _XmAppUnlock(app); return; } index = GetDSChildPosition(parent, info); sib_index = GetDSChildPosition(parent, sib); switch(stack_mode) { case XmABOVE: if (index > sib_index) for(i=index; i > sib_index; i--) SwapDSChildren(parent, i, i - 1); else for (i=index; i < (sib_index - 1); i++) SwapDSChildren(parent, i, i + 1); break; case XmBELOW: if (index > sib_index) for(i=index; i > (sib_index + 1); i--) SwapDSChildren(parent, i, i - 1); else for (i=index; i < sib_index; i++) SwapDSChildren(parent, i, i + 1); break; default: /* do nothing */ break; } } else { Cardinal index = GetDSChildPosition(parent, info); int i; switch(stack_mode) { case XmABOVE: for (i=index; i > 0; i--) SwapDSChildren(parent, i, i - 1); break; case XmBELOW: for (i=index; i < (int)(GetDSNumChildren(parent) - 1); i++) SwapDSChildren(parent, i, i + 1); break; default: /* do nothing */ break; } } _XmAppUnlock(app); } XmDropSiteVisuals XmDropSiteGetActiveVisuals( Widget widget ) { XmDropSiteManagerObject dsm; XmDSInfo info; XmDropSiteVisuals dsv; _XmWidgetToAppContext(widget); _XmAppLock(app); dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); info = (XmDSInfo) dsm->dropManager.curInfo; dsv = (XmDropSiteVisuals) XtCalloc(1, sizeof(XmDropSiteVisualsRec)); /* Update if dsm is dirty */ _XmIEndUpdate((XtPointer) dsm, (XtIntervalId *) NULL); if (info == NULL) { XtFree((char *)dsv); _XmAppUnlock(app); return(NULL); } if (!GetDSRemote(info)) { Arg args[30]; int n; Widget w; unsigned char unitType; w = GetDSWidget(info); /* * We need to retrieve information from the widget. XtGetValues is * too slow, so retrieve the information directly from the widget * instance. * * XtGetValues is used for gadgets, since part of the instance * structure will be in the cache and not directly accessable. * * XtGetValues is used for non-Motif widgets, just in case they provide * Motif-style resources. * * (See also PutDSToStream() ) */ if (XmIsPrimitive(w)) { XmPrimitiveWidget pw = (XmPrimitiveWidget)w; dsv->background = pw->core.background_pixel; dsv->foreground = pw->primitive.foreground; dsv->topShadowColor = pw->primitive.top_shadow_color; dsv->topShadowPixmap = pw->primitive.top_shadow_pixmap; dsv->bottomShadowColor = pw->primitive.bottom_shadow_color; dsv->bottomShadowPixmap = pw->primitive.bottom_shadow_pixmap; dsv->shadowThickness = pw->primitive.shadow_thickness; dsv->highlightColor = pw->primitive.highlight_color; dsv->highlightPixmap = pw->primitive.highlight_pixmap; dsv->highlightThickness = pw->primitive.highlight_thickness; if (!GetDSHasRegion(info)) dsv->borderWidth = pw->core.border_width; else dsv->borderWidth = 0; } else if (XmIsManager(w)) { XmManagerWidget mw = (XmManagerWidget)w; dsv->background = mw->core.background_pixel; dsv->foreground = mw->manager.foreground; dsv->topShadowColor = mw->manager.top_shadow_color; dsv->topShadowPixmap = mw->manager.top_shadow_pixmap; dsv->bottomShadowColor = mw->manager.bottom_shadow_color; dsv->bottomShadowPixmap = mw->manager.bottom_shadow_pixmap; dsv->shadowThickness = mw->manager.shadow_thickness; dsv->highlightColor = mw->manager.highlight_color; dsv->highlightPixmap = mw->manager.highlight_pixmap; /* Temporary hack, until we support full defaulting */ if (GetDSAnimationStyle(info) == XmDRAG_UNDER_HIGHLIGHT) dsv->highlightThickness = 1; else dsv->highlightThickness = 0; if (!GetDSHasRegion(info)) dsv->borderWidth = mw->core.border_width; else dsv->borderWidth = 0; } else /* XmGadget or non-Motif subclass */ { n = 0; XtSetArg(args[n], XmNunitType, &unitType); n++; XtGetValues(w, args, n); if (unitType != XmPIXELS) { /* we need values in pixels */ n = 0; XtSetArg(args[n], XmNunitType, XmPIXELS); n++; XtSetValues(w, args, n); } n = 0; XtSetArg(args[n], XmNbackground, &(dsv->background)); n++; XtSetArg(args[n], XmNforeground, &(dsv->foreground)); n++; XtSetArg(args[n], XmNtopShadowColor, &(dsv->topShadowColor)); n++; XtSetArg(args[n], XmNtopShadowPixmap, &(dsv->topShadowPixmap)); n++; XtSetArg(args[n], XmNbottomShadowColor, &(dsv->bottomShadowColor)); n++; XtSetArg(args[n], XmNbottomShadowPixmap, &(dsv->bottomShadowPixmap)); n++; XtSetArg(args[n], XmNshadowThickness, &(dsv->shadowThickness)); n++; XtSetArg(args[n], XmNhighlightColor, &(dsv->highlightColor)); n++; XtSetArg(args[n], XmNhighlightPixmap, &(dsv->highlightPixmap)); n++; XtSetArg(args[n], XmNhighlightThickness, &(dsv->highlightThickness)); n++; if (!GetDSHasRegion(info)) { XtSetArg(args[n], XmNborderWidth, &(dsv->borderWidth)); n++; } else dsv->borderWidth = 0; XtGetValues(w, args, n); if (unitType != XmPIXELS) { n = 0; XtSetArg(args[n], XmNunitType, unitType); n++; XtSetValues(w, args, n); } } } else { switch (GetDSAnimationStyle(info)) { case XmDRAG_UNDER_HIGHLIGHT: { XmDSRemoteHighlightStyle hs = (XmDSRemoteHighlightStyle) GetDSRemoteAnimationPart(info); dsv->highlightColor = hs->highlight_color; dsv->highlightPixmap = hs->highlight_pixmap; dsv->background = hs->background; dsv->highlightThickness = hs->highlight_thickness; dsv->borderWidth = hs->border_width; } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmDSRemoteShadowStyle ss = (XmDSRemoteShadowStyle) GetDSRemoteAnimationPart(info); dsv->topShadowColor = ss->top_shadow_color; dsv->topShadowPixmap = ss->top_shadow_pixmap; dsv->bottomShadowColor = ss->bottom_shadow_color; dsv->bottomShadowPixmap = ss->bottom_shadow_pixmap; dsv->foreground = ss->foreground; dsv->shadowThickness = ss->shadow_thickness; dsv->highlightThickness = ss->highlight_thickness; dsv->borderWidth = ss->border_width; } break; case XmDRAG_UNDER_PIXMAP: { XmDSRemotePixmapStyle ps = (XmDSRemotePixmapStyle) GetDSRemoteAnimationPart(info); dsv->background = ps->background; dsv->foreground = ps->foreground; dsv->shadowThickness = ps->shadow_thickness; dsv->highlightThickness = ps->highlight_thickness; dsv->borderWidth = ps->border_width; } break; case XmDRAG_UNDER_NONE: default: break; } } _XmAppUnlock(app); return(dsv); } Widget _XmGetActiveDropSite( Widget widget ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) _XmGetDropSiteManagerObject((XmDisplay) XmGetXmDisplay( XtDisplayOfObject(widget))); XmDSInfo info = (XmDSInfo) dsm->dropManager.curInfo; /* Update if dsm is dirty */ _XmIEndUpdate((XtPointer) dsm, (XtIntervalId *) NULL); if ((!XmIsDragContext(widget)) || (GetDSRemote(info))) return(NULL); else return(GetDSWidget(info)); } #ifdef DEBUG /********************************************************************** * Debugging code for DropSMgr. This code will print out the current * state of the tree **********************************************************************/ static Boolean PrintHashEntry(XmHashKey key, XtPointer value, XtPointer data) { Widget wid = (Widget) key; printf("Widget %p (%s) Info %p\n", wid, XtName(wid), value); return(False); } static void PrintTree(XmDSInfo rec, int level) { int i; Widget wid = GetDSWidget(rec); char *name = ""; /* Indent for level */ for(i = 0; i < level; i++) printf(" "); if (wid != (Widget) NULL) name = XtName(wid); printf("%p (internal %d) - widget %p (%s)\n", rec, GetDSInternal(rec), wid, name); if (!GetDSLeaf(rec)) { int j; for(j = 0; j < GetDSNumChildren(rec); j++) PrintTree(GetDSChild(rec, j), level + 1); } } void _XmPrintDSTree(XmDropSiteManagerObject dsm, XmDSInfo root) { /* First print all the information records in tree format */ PrintTree(root, 0); /* Now print widget to info hash table */ _XmMapHashTable(DSTABLE(dsm), PrintHashEntry, NULL); } #endif /* DEBUG */ motif-2.3.8/lib/Xm/XmosP.h0000644000175000017500000001255013145162623012142 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmosP_h #define _XmosP_h /* Some SVR4 systems don't have bzero. */ #include /* for bzero et al */ /* * Fix for 8975 - using LOGNAME instead of USER on SYSV and SVR4 */ #ifndef USER_VAR #if defined(SYSV) || defined(SVR4) #define USER_VAR "LOGNAME" #else #define USER_VAR "USER" #endif #endif /* * Fix for 5222 - if NO_MEMMOVE is defined, some systems will still * require stdlib.h. */ #ifdef NO_MEMMOVE #ifdef bcopy #undef bcopy #endif #ifdef memmove #undef memmove #endif #define memmove( p1, p2, p3 ) bcopy( p2, p1, p3 ) #endif #ifndef X_NOT_STDC_ENV #include /* Needed for MB_CUR_MAX, mbtowc, mbstowcs and mblen */ #endif /* On Sun systems, mblen is broken. It doesn't return 0 when the string is empty. Here's a patch. NOTE: On Sun systems, mblen is a macro wrapper around mbtowc. Hence the implementation below. */ #if defined(sun) #undef mblen #define mblen(ptr, size) \ ((ptr && *(ptr) == '\0') ? 0 : mbtowc((wchar_t *)0, (ptr), (size))) #endif #include /* for MB_LEN_MAX et al */ #ifndef INT_MAX #define INT_MAX 2147483647 #endif #ifndef LONG_MAX #define LONG_MAX 2147483647 #endif #ifdef BOGUS_MB_MAX /* some systems don't properly set MB_[CUR|LEN]_MAX */ #undef MB_LEN_MAX #define MB_LEN_MAX 1 /* temp fix for ultrix */ #undef MB_CUR_MAX #define MB_CUR_MAX 1 /* temp fix for ultrix */ #endif /* BOGUS_MB_MAX */ /**********************************************************************/ /* here we duplicate Xtos.h, since we can't include this private file */ #if defined(INCLUDE_ALLOCA_H) || defined(HAVE_ALLOCA_H) #include #endif #ifdef CRAY #define WORD64 #endif /* Don't Use Alloca On Solaris */ #if defined(sun) #define NO_ALLOCA #endif /* stolen from server/include/os.h */ #ifndef NO_ALLOCA /* * os-dependent definition of local allocation and deallocation * If you want something other than XtMalloc/XtFree for ALLOCATE/DEALLOCATE * LOCAL then you add that in here. */ #if defined(__HIGHC__) #if HCVERSION < 21003 #define ALLOCATE_LOCAL(size) alloca(size) pragma on(alloca); #else /* HCVERSION >= 21003 */ #define ALLOCATE_LOCAL(size) _Alloca(size) #endif /* HCVERSION < 21003 */ #define DEALLOCATE_LOCAL(ptr) /* as nothing */ #endif /* defined(__HIGHC__) */ #ifdef __GNUC__ #ifndef alloca /* gnu itself might have done that already */ #define alloca __builtin_alloca #endif #define ALLOCATE_LOCAL(size) alloca(size) #define DEALLOCATE_LOCAL(ptr) /* as nothing */ #else /* ! __GNUC__ */ /* * warning: mips alloca is unsuitable, do not use. */ #if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) /* * Some System V boxes extract alloca.o from libPW.a; if you * decide that you don't want to use alloca, you might want to fix it here. */ char *alloca(); #define ALLOCATE_LOCAL(size) alloca(size) #define DEALLOCATE_LOCAL(ptr) /* as nothing */ #endif /* who does alloca */ #endif /* __GNUC__ */ #endif /* NO_ALLOCA */ #ifndef ALLOCATE_LOCAL #define ALLOCATE_LOCAL(size) XtMalloc(size) #define DEALLOCATE_LOCAL(ptr) XtFree(ptr) #endif /* ALLOCATE_LOCAL */ /* End of Xtos.h */ /*****************/ #include /* For padding structures in Mrm we need to know how big pointers are. */ #if !defined(CRAY) && !defined(__alpha) #define MrmShortPtr #endif #ifdef __cplusplus extern "C" { #endif #define MATCH_CHAR 'P' /* referenced in InitPath strings and in the files that uses it (ImageCache.c and Mrmhier.c) */ /* OS-dependent file info for VirtKeys */ #define XMBINDDIR "XMBINDDIR" #ifndef XMBINDDIR_FALLBACK #define XMBINDDIR_FALLBACK "/usr/lib/Xm/bindings" #endif #define XMBINDFILE "xmbind.alias" #define MOTIFBIND ".motifbind" typedef enum { XmOS_METHOD_NULL, XmOS_METHOD_DEFAULTED, XmOS_METHOD_REPLACED } XmOSMethodStatus; typedef XmDirection (*XmCharDirectionProc)(XtPointer /* char */, XmTextType /* type */, XmStringTag /* locale */); typedef Status (*XmInitialDirectionProc)(XtPointer /* chars */, XmTextType /* type */, XmStringTag /* locale */, unsigned int * /* num_bytes */, XmDirection * /* direction */); /******** Private Function Declarations ********/ extern XmOSMethodStatus XmOSGetMethod(Widget w, String method_name, XtPointer * method, XtPointer * os_data); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmosP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CommandP.h0000644000175000017500000000523013145162623012567 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCommandP_h #define _XmCommandP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Constraint part record for Command widget */ typedef struct _XmCommandConstraintPart { char unused; } XmCommandConstraintPart, * XmCommandConstraint; /* New fields for the Command widget class record */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmCommandClassPart; /* Full class record declaration */ typedef struct _XmCommandClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmSelectionBoxClassPart selection_box_class; XmCommandClassPart command_class; } XmCommandClassRec; externalref XmCommandClassRec xmCommandClassRec; /* New fields for the Command widget record */ typedef struct { XtCallbackList callback; XtCallbackList value_changed_callback; int history_max_items; Boolean error; /* error has been made visible in list */ } XmCommandPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmCommandRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmSelectionBoxPart selection_box; XmCommandPart command; } XmCommandRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCommandP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Xm.h.in0000644000175000017500000020043713211512233012056 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $TOG: Xm.h /main/38 1999/10/18 14:50:22 samborn $ */ #ifndef _Xm_h #define _Xm_h #ifndef OM22_COMPATIBILITY #undef OM22_COMPATIBILITY #endif #ifndef JPEG_SUPPORTED #undef JPEG_SUPPORTED #endif #ifndef PNG_SUPPORTED #undef PNG_SUPPORTED #endif #ifndef UTF8_SUPPORTED #undef UTF8_SUPPORTED #endif #ifndef PRINTING_SUPPORTED #undef PRINTING_SUPPORTED #endif #ifndef USE_XFT #undef USE_XFT #endif #if !defined(__STDC__) \ && !defined(__cplusplus) && !defined(c_plusplus) \ && !defined(FUNCPROTO) && !defined(XTFUNCPROTO) && !defined(XMFUNCPROTO) #define _NO_PROTO #endif /* __STDC__ */ #include #include #include #ifdef PRINTING_SUPPORTED #include #endif #include #include #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #define XmVERSION 2 #define XmREVISION 3 #define XmUPDATE_LEVEL 8 #define XmVersion (XmVERSION * 1000 + XmREVISION) #define XmVERSION_STRING "@(#)Motif Version 2.3.8" externalref int xmUseVersion; /* define used to denote an unspecified pixmap */ #define XmUNSPECIFIED_PIXMAP 2 /* define for an unspecified position */ #define XmUNSPECIFIED_POSITION -1 /******************* * * Defines for resources to be defaulted by vendors. * String are initialized in Xmos.c * ****************/ #define XmSTRING_OS_CHARSET XmSTRING_ISO8859_1 #ifndef XmFALLBACK_CHARSET #define XmFALLBACK_CHARSET XmSTRING_ISO8859_1 #endif #define XmDEFAULT_FONT _XmSDEFAULT_FONT #define XmDEFAULT_BACKGROUND _XmSDEFAULT_BACKGROUND #define XmDEFAULT_DARK_THRESHOLD 20 #define XmDEFAULT_LIGHT_THRESHOLD 93 #define XmDEFAULT_FOREGROUND_THRESHOLD 70 externalref char _XmSDEFAULT_FONT[]; /* In Xmos.c */ externalref char _XmSDEFAULT_BACKGROUND[]; /* In Xmos.c */ typedef unsigned char XmDirection; #define XmDIRECTION_IGNORED 0x30 #define XmRIGHT_TO_LEFT_MASK 0x01 /* 0x01 for bc */ #define XmLEFT_TO_RIGHT_MASK 0x02 #define XmHORIZONTAL_MASK 0x03 #define XmTOP_TO_BOTTOM_MASK 0x04 #define XmBOTTOM_TO_TOP_MASK 0x08 #define XmVERTICAL_MASK 0x0c #define XmPRECEDENCE_HORIZ_MASK 0x40 #define XmPRECEDENCE_VERT_MASK 0x80 #define XmPRECEDENCE_MASK 0xc0 enum { XmRIGHT_TO_LEFT_TOP_TO_BOTTOM = XmRIGHT_TO_LEFT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_HORIZ_MASK, XmLEFT_TO_RIGHT_TOP_TO_BOTTOM = XmLEFT_TO_RIGHT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_HORIZ_MASK, XmRIGHT_TO_LEFT_BOTTOM_TO_TOP = XmRIGHT_TO_LEFT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_HORIZ_MASK, XmLEFT_TO_RIGHT_BOTTOM_TO_TOP = XmLEFT_TO_RIGHT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_HORIZ_MASK, XmTOP_TO_BOTTOM_RIGHT_TO_LEFT = XmRIGHT_TO_LEFT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_VERT_MASK, XmTOP_TO_BOTTOM_LEFT_TO_RIGHT = XmLEFT_TO_RIGHT_MASK | XmTOP_TO_BOTTOM_MASK | XmPRECEDENCE_VERT_MASK, XmBOTTOM_TO_TOP_RIGHT_TO_LEFT = XmRIGHT_TO_LEFT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_VERT_MASK, XmBOTTOM_TO_TOP_LEFT_TO_RIGHT = XmLEFT_TO_RIGHT_MASK | XmBOTTOM_TO_TOP_MASK | XmPRECEDENCE_VERT_MASK, XmTOP_TO_BOTTOM = XmTOP_TO_BOTTOM_MASK | XmHORIZONTAL_MASK | XmPRECEDENCE_MASK, XmBOTTOM_TO_TOP = XmBOTTOM_TO_TOP_MASK | XmHORIZONTAL_MASK | XmPRECEDENCE_MASK, XmRIGHT_TO_LEFT = XmRIGHT_TO_LEFT_MASK | XmVERTICAL_MASK | XmPRECEDENCE_MASK, XmLEFT_TO_RIGHT = XmLEFT_TO_RIGHT_MASK | XmVERTICAL_MASK | XmPRECEDENCE_MASK, XmDEFAULT_DIRECTION = 0xff }; extern Boolean XmDirectionMatch(XmDirection d1, XmDirection d2); extern Boolean XmDirectionMatchPartial(XmDirection d1, XmDirection d2, XmDirection dmask); /**************** * * XmString structure defines. These must be here (at the start of the file) * becaused they are used later on. * ****************/ typedef enum{ XmFONT_IS_FONT, XmFONT_IS_FONTSET, XmFONT_IS_XFT } XmFontType; enum { XmSTRING_DIRECTION_L_TO_R, XmSTRING_DIRECTION_R_TO_L, XmSTRING_DIRECTION_UNSET = 3, XmSTRING_DIRECTION_DEFAULT = XmDEFAULT_DIRECTION }; typedef unsigned char XmStringDirection; typedef union __XmStringRec *XmString; /* opaque to outside */ typedef XmString * XmStringTable; /* opaque to outside */ typedef char * XmStringCharSet; /* Null term string */ typedef char * XmStringTag; /* Null term string */ typedef unsigned char XmStringComponentType; /* component tags */ typedef struct __XmRenditionRec **XmFontListEntry; /* opaque to outside */ typedef struct __XmRenderTableRec **XmFontList; /* opaque to outside */ typedef struct _XmFontListContextRec *XmFontContext; /* opaque to outside */ typedef struct __XmStringContextRec *_XmStringContext; /* opaque to outside */ typedef union __XmStringRec *_XmString; /* opaque to outside */ typedef struct __XmStringContextRec *XmStringContext; /* opaque to outside */ enum{ XmSTRING_COMPONENT_UNKNOWN, XmSTRING_COMPONENT_CHARSET, XmSTRING_COMPONENT_TEXT, XmSTRING_COMPONENT_DIRECTION, XmSTRING_COMPONENT_SEPARATOR, XmSTRING_COMPONENT_LOCALE_TEXT, XmSTRING_COMPONENT_LOCALE, XmSTRING_COMPONENT_WIDECHAR_TEXT, XmSTRING_COMPONENT_LAYOUT_PUSH, XmSTRING_COMPONENT_LAYOUT_POP, XmSTRING_COMPONENT_RENDITION_BEGIN, XmSTRING_COMPONENT_RENDITION_END, XmSTRING_COMPONENT_TAB /* 13-125 reserved */ } ; #define XmSTRING_COMPONENT_FONTLIST_ELEMENT_TAG XmSTRING_COMPONENT_CHARSET #define XmSTRING_COMPONENT_TAG XmSTRING_COMPONENT_CHARSET #define XmSTRING_COMPONENT_END ((XmStringComponentType) 126) #define XmSTRING_COMPONENT_USER_BEGIN ((XmStringComponentType) 128) /* 128-255 are user tags */ #define XmSTRING_COMPONENT_USER_END ((XmStringComponentType) 255) typedef enum { XmCHARSET_TEXT, XmMULTIBYTE_TEXT, XmWIDECHAR_TEXT, XmNO_TEXT } XmTextType; typedef enum { XmOUTPUT_ALL, XmOUTPUT_BETWEEN, XmOUTPUT_BEGINNING, XmOUTPUT_END, XmOUTPUT_BOTH } XmParseModel; typedef unsigned char XmIncludeStatus; enum { XmINSERT, XmTERMINATE, XmINVOKE }; /* We are making an attempt (perhaps unnecessaryily) to keep our style constants the same as the equivalent Xlib style constants. The first Motif specific style constant starts at 32 so that the consortium can add constants to their list without overlapping with ours. */ typedef enum { XmSTYLE_STRING = XStringStyle, XmSTYLE_COMPOUND_TEXT = XCompoundTextStyle, XmSTYLE_TEXT = XTextStyle, XmSTYLE_STANDARD_ICC_TEXT = XStdICCTextStyle, XmSTYLE_LOCALE = 32, XmSTYLE_COMPOUND_STRING } XmICCEncodingStyle; /**************** * * XmParseTable structure defines. These must be here (at the start of * the file) because they are used later on. * ****************/ typedef struct __XmParseMappingRec *XmParseMapping; /* opaque */ typedef XmParseMapping *XmParseTable; /* A special pattern used to match a change of character direction. */ #define XmDIRECTION_CHANGE NULL typedef XmIncludeStatus (*XmParseProc) (XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag locale_tag, XmParseMapping entry, int pattern_length, XmString *str_include, XtPointer call_data); /**************** * * XmTabList structure defines. These must be here (at the start of the file) * becaused they are used later on. * ****************/ typedef enum { XmABSOLUTE, XmRELATIVE } XmOffsetModel; typedef struct __XmTabRec *XmTab; /* opaque */ typedef struct __XmTabListRec *XmTabList; /* opaque */ /**************** * * XmRenderTable structure defines. These must be here (at the start of the file) * becaused they are used later on. * ****************/ /* XmRendition declarations */ typedef struct __XmRenditionRec **XmRendition; /* opaque */ typedef struct __XmRenderTableRec **XmRenderTable; /* opaque */ typedef enum { XmSKIP, XmMERGE_REPLACE, XmMERGE_OLD, XmMERGE_NEW, XmDUPLICATE /* For XmFontListAdd and XmFontListAppendEntry. */ } XmMergeMode; #define XmAS_IS 255 #define XmFORCE_COLOR 1 #define XmUNSPECIFIED_PIXEL ((Pixel) (~0)) #define XmDEFAULT_SELECT_COLOR XmUNSPECIFIED_PIXEL #define XmREVERSED_GROUND_COLORS (XmDEFAULT_SELECT_COLOR - 1) #define XmHIGHLIGHT_COLOR (XmREVERSED_GROUND_COLORS - 1) enum { XmUNSPECIFIED_LOAD_MODEL, XmLOAD_DEFERRED, XmLOAD_IMMEDIATE }; /************************************************************************ * Primitive Resources and define values ************************************************************************/ /* size policy values */ enum{ XmCHANGE_ALL, XmCHANGE_NONE, XmCHANGE_WIDTH, XmCHANGE_HEIGHT } ; /* unit type values */ enum{ XmPIXELS, Xm100TH_MILLIMETERS, Xm1000TH_INCHES, Xm100TH_POINTS, Xm100TH_FONT_UNITS, XmINCHES, XmCENTIMETERS, XmMILLIMETERS, XmPOINTS, XmFONT_UNITS } ; /* DeleteResponse values */ enum{ XmDESTROY, XmUNMAP, XmDO_NOTHING } ; enum{ XmEXPLICIT, XmPOINTER } ; /************************************************************************ * Navigation defines ************************************************************************/ enum{ XmNONE, XmTAB_GROUP, XmSTICKY_TAB_GROUP, XmEXCLUSIVE_TAB_GROUP } ; #define XmDYNAMIC_DEFAULT_TAB_GROUP (255) /************************************************************************ * Audible warning ************************************************************************/ enum{ /* XmNONE */ XmBELL = 1 } ; /************************************************************************ * Input Manager defines ************************************************************************/ enum { XmPER_SHELL, XmPER_WIDGET, XmINHERIT_POLICY = 255 } ; typedef unsigned char XmInputPolicy; /************************************************************************ * Menu defines ************************************************************************/ enum{ XmNO_ORIENTATION, XmVERTICAL, XmHORIZONTAL } ; enum{ XmWORK_AREA, XmMENU_BAR, XmMENU_PULLDOWN, XmMENU_POPUP, XmMENU_OPTION } ; enum{ XmNO_PACKING, XmPACK_TIGHT, XmPACK_COLUMN, XmPACK_NONE } ; enum{/* XmALIGNMENT_BASELINE_TOP, XmALIGNMENT_CENTER, XmALIGNMENT_BASELINE_BOTTOM, */ XmALIGNMENT_CONTENTS_TOP = 3, XmALIGNMENT_CONTENTS_BOTTOM } ; enum{ XmTEAR_OFF_ENABLED, XmTEAR_OFF_DISABLED } ; enum{ XmUNPOST, XmUNPOST_AND_REPLAY } ; enum{ XmLAST_POSITION = -1, XmFIRST_POSITION } ; enum{ XmPOPUP_DISABLED = 0, XmPOPUP_KEYBOARD = 1, XmPOPUP_AUTOMATIC, XmPOPUP_AUTOMATIC_RECURSIVE }; /************************************************************************ * Color Selector defines ************************************************************************/ typedef enum { XmListMode = 0, XmScaleMode = 1 } XmColorMode; /************************************************************************ * Column defines ************************************************************************/ enum { XmFILL_UNSPECIFIED, XmFILL_FLUSH, XmFILL_RAGGED }; enum { XmDISTRIBUTE_TIGHT, XmDISTRIBUTE_SPREAD }; /************************************************************************ * ComboBox defines ************************************************************************/ enum{ XmCOMBO_BOX=0, XmDROP_DOWN_COMBO_BOX, XmDROP_DOWN_LIST } ; enum{ /* XmNONE */ XmQUICK_NAVIGATE = 1, XmINVALID_MATCH_BEHAVIOR } ; enum{ XmZERO_BASED, XmONE_BASED } ; #define XmINVALID_POSITION -1 /************************************************************************ * Icon & Button Box defines ************************************************************************/ typedef enum { XmIconTop, XmIconLeft, XmIconRight, XmIconBottom, XmIconOnly, XmIconNone } XmIconPlacement; typedef enum { XmFillNone, XmFillMajor, XmFillMinor, XmFillAll } XmFillOption; /************************************************************************ * Hierarchy/Tree/Outline defines ************************************************************************/ typedef enum {XmAlwaysOpen, XmOpen, XmClosed, XmHidden, XmNotInHierarchy} XmHierarchyNodeState; typedef enum { XmTreeLadder, XmTreeDirect } XmTreeConnectStyle; typedef enum { XmTreeCompressNone=0, XmTreeCompressLeaves=1, XmTreeCompressAll=2 } XmTreeCompressStyle; /************************************************************************ * Label/Frame defines ************************************************************************/ enum{ XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER, XmALIGNMENT_END, XmALIGNMENT_UNSPECIFIED } ; enum{ XmALIGNMENT_BASELINE_TOP, /* XmALIGNMENT_CENTER, */ XmALIGNMENT_BASELINE_BOTTOM = 2, XmALIGNMENT_WIDGET_TOP, XmALIGNMENT_WIDGET_BOTTOM } ; /* new enum introduced in 2.0 to clear up the confusion in widget top/bottom attachment */ #define XmALIGNMENT_CHILD_TOP XmALIGNMENT_WIDGET_BOTTOM #define XmALIGNMENT_CHILD_BOTTOM XmALIGNMENT_WIDGET_TOP /************************************************************************ * Frame defines ************************************************************************/ enum{ XmFRAME_GENERIC_CHILD, XmFRAME_WORKAREA_CHILD, XmFRAME_TITLE_CHILD } ; /************************************************************************ * ToggleButton defines ************************************************************************/ enum{ XmN_OF_MANY = 1, XmONE_OF_MANY, XmONE_OF_MANY_ROUND, XmONE_OF_MANY_DIAMOND } ; /************************************************************************ * Form defines ************************************************************************/ enum{ XmATTACH_NONE, XmATTACH_FORM, XmATTACH_OPPOSITE_FORM, XmATTACH_WIDGET, XmATTACH_OPPOSITE_WIDGET, XmATTACH_POSITION, XmATTACH_SELF } ; enum{ XmRESIZE_NONE, XmRESIZE_GROW, XmRESIZE_ANY } ; /************************************************************************ * TabBox/TabStack defines ************************************************************************/ typedef enum {XmTABS_SQUARED, XmTABS_ROUNDED, XmTABS_BEVELED} XmTabStyle; typedef enum {XmTABS_BASIC, XmTABS_STACKED, XmTABS_STACKED_STATIC, XmTABS_SCROLLED, XmTABS_OVERLAYED} XmTabMode; typedef enum {XmTAB_ORIENTATION_DYNAMIC, XmTABS_RIGHT_TO_LEFT, XmTABS_LEFT_TO_RIGHT, XmTABS_TOP_TO_BOTTOM, XmTABS_BOTTOM_TO_TOP} XmTabOrientation; typedef enum {XmTAB_EDGE_TOP_LEFT, XmTAB_EDGE_BOTTOM_RIGHT} XmTabEdge; typedef enum {XmTAB_ARROWS_ON_RIGHT, XmTAB_ARROWS_ON_LEFT, XmTAB_ARROWS_SPLIT} XmTabArrowPlacement; enum {XmCR_TAB_SELECTED, XmCR_TAB_UNSELECTED}; typedef enum {XmTABS_ON_TOP, XmTABS_ON_BOTTOM, XmTABS_ON_RIGHT, XmTABS_ON_LEFT} XmTabSide; typedef enum {XmPIXMAP_TOP, XmPIXMAP_BOTTOM, XmPIXMAP_RIGHT, XmPIXMAP_LEFT, XmPIXMAP_NONE, XmPIXMAP_ONLY} XmPixmapPlacement; typedef enum {XmTAB_VALUE_COPY, XmTAB_VALUE_SHARE} XmTabValueMode; typedef enum {XmTAB_CMP_VISUAL, XmTAB_CMP_SIZE, XmTAB_CMP_EQUAL} XmTabResult; typedef struct _XmTabStackCallbackStruct { int reason; XEvent *event; Widget selected_child; } XmTabStackCallbackStruct; typedef struct _XmTabBoxCallbackStruct { int reason; XEvent *event; int tab_index; int old_index; } XmTabBoxCallbackStruct; /**************************************************************************** * Callback reasons ****************************************************************************/ enum{ XmCR_NONE, XmCR_HELP, XmCR_VALUE_CHANGED, XmCR_INCREMENT, XmCR_DECREMENT, XmCR_PAGE_INCREMENT, XmCR_PAGE_DECREMENT, XmCR_TO_TOP, XmCR_TO_BOTTOM, XmCR_DRAG, XmCR_ACTIVATE, XmCR_ARM, XmCR_DISARM, XmCR_MAP = 16, XmCR_UNMAP, XmCR_FOCUS, XmCR_LOSING_FOCUS, XmCR_MODIFYING_TEXT_VALUE, XmCR_MOVING_INSERT_CURSOR, XmCR_EXECUTE, XmCR_SINGLE_SELECT, XmCR_MULTIPLE_SELECT, XmCR_EXTENDED_SELECT, XmCR_BROWSE_SELECT, XmCR_DEFAULT_ACTION, XmCR_CLIPBOARD_DATA_REQUEST, XmCR_CLIPBOARD_DATA_DELETE, XmCR_CASCADING, XmCR_OK, XmCR_CANCEL, XmCR_APPLY = 34, XmCR_NO_MATCH, XmCR_COMMAND_ENTERED, XmCR_COMMAND_CHANGED, XmCR_EXPOSE, XmCR_RESIZE, XmCR_INPUT, XmCR_GAIN_PRIMARY, XmCR_LOSE_PRIMARY, XmCR_CREATE, XmCR_TEAR_OFF_ACTIVATE, XmCR_TEAR_OFF_DEACTIVATE, XmCR_OBSCURED_TRAVERSAL, XmCR_FOCUS_MOVED, XmCR_REPOST = 54, XmCR_COLLAPSED, XmCR_EXPANDED, XmCR_SELECT, XmCR_DRAG_START, XmCR_NO_FONT, XmCR_NO_RENDITION, XmCR_POST, XmCR_SPIN_NEXT, XmCR_SPIN_PRIOR, XmCR_SPIN_FIRST, XmCR_SPIN_LAST, XmCR_PAGE_SCROLLER_INCREMENT, XmCR_PAGE_SCROLLER_DECREMENT, XmCR_MAJOR_TAB, XmCR_MINOR_TAB, XmCR_START_JOB, XmCR_END_JOB, XmCR_PAGE_SETUP, XmCR_PDM_NONE, XmCR_PDM_UP, XmCR_PDM_START_ERROR, XmCR_PDM_START_VXAUTH, XmCR_PDM_START_PXAUTH, XmCR_PDM_OK, XmCR_PDM_CANCEL, XmCR_PDM_EXIT_ERROR, XmCR_UPDATE_SHELL, XmCR_UPDATE_TEXT, XmCR_VERIFY_TEXT, XmCR_VERIFY_TEXT_FAILED, XmCR_ENTER_CHILD, XmCR_LEAVE_CHILD, XmCR_PROTOCOLS = 6666 /* required for BC. See CR 9158 */ } ; /************************************************************************ * new ScrollBar showArrows define ************************************************************************/ enum{ /* XmNONE */ XmEACH_SIDE = 1, XmMAX_SIDE, XmMIN_SIDE } ; /************************************************************************ * Sliding mode ************************************************************************/ enum{ XmSLIDER, XmTHERMOMETER} ; /************************************************************************ * Slider Visual ************************************************************************/ enum{ XmBACKGROUND_COLOR, XmFOREGROUND_COLOR, XmTROUGH_COLOR, XmSHADOWED_BACKGROUND} ; /************************************************************************ * Slider Mark ************************************************************************/ enum{ /* XmNONE, */ XmETCHED_LINE = 1, XmTHUMB_MARK, XmROUND_MARK } ; /************************************************************************ * new Scale showValue ************************************************************************/ enum{ /* XmNONE */ XmNEAR_SLIDER = 1, XmNEAR_BORDER } ; /************************************************************************ * new ScrolledWindow/MainWindow chidType ************************************************************************/ /* XmWORK_AREA, XmMENU_BAR and XmSEPARATOR have to match the existing ones */ enum{ /* XmWORK_AREA = 0, XmMENU_BAR = 1, */ XmHOR_SCROLLBAR = 2, XmVERT_SCROLLBAR, XmCOMMAND_WINDOW, /* XmSEPARATOR = 5 */ XmMESSAGE_WINDOW = 6, XmSCROLL_HOR, XmSCROLL_VERT, XmNO_SCROLL, XmCLIP_WINDOW, XmGENERIC_CHILD } ; /************************************************************************ * new ScrolledWindow auto drag enum ************************************************************************/ enum{ XmAUTO_DRAG_ENABLED, XmAUTO_DRAG_DISABLED } ; /************************************************************************ * new Display enable warp enum ************************************************************************/ enum{ XmENABLE_WARP_ON, XmENABLE_WARP_OFF } ; /************************************************************************ * new Display enable btn1 transfer enum ************************************************************************/ enum{ XmOFF, XmBUTTON2_ADJUST, XmBUTTON2_TRANSFER }; /************************************************************************ * auto_selection_type ************************************************************************/ enum{ XmAUTO_UNSET, XmAUTO_BEGIN, XmAUTO_MOTION, XmAUTO_CANCEL, XmAUTO_NO_CHANGE, XmAUTO_CHANGE }; /************************************************************************ * Callback structures ************************************************************************/ typedef struct { int reason; XEvent *event; } XmAnyCallbackStruct; typedef struct { int reason; XEvent *event; int click_count; } XmArrowButtonCallbackStruct; typedef struct _XmDragStartCallbackStruct { int reason; XEvent *event; Widget widget; Boolean doit; } XmDragStartCallbackStruct, *XmDragStartCallback; typedef struct { int reason; XEvent *event; XmString item_or_text; int item_position; } XmComboBoxCallbackStruct; typedef struct { int reason; XEvent *event; Window window; } XmDrawingAreaCallbackStruct; typedef struct { int reason; XEvent *event; Window window; int click_count; } XmDrawnButtonCallbackStruct; typedef struct { int reason; XEvent *event; int click_count; } XmPushButtonCallbackStruct; typedef struct { int reason; XEvent *event; Widget widget; char *data; char *callbackstruct; } XmRowColumnCallbackStruct; typedef struct { int reason; XEvent * event; int value; int pixel; } XmScrollBarCallbackStruct; typedef struct { int reason; XEvent * event; int set; } XmToggleButtonCallbackStruct; typedef struct { int reason; XEvent *event; XmString item; int item_length; int item_position; XmString *selected_items; int selected_item_count; int *selected_item_positions; char selection_type; char auto_selection_type; } XmListCallbackStruct; typedef struct { int reason; XEvent *event; XmString value; int length; } XmSelectionBoxCallbackStruct; typedef struct { int reason; XEvent *event; XmString value; int length; } XmCommandCallbackStruct; typedef struct { int reason; XEvent *event; XmString value; int length; XmString mask; int mask_length; XmString dir ; int dir_length ; XmString pattern ; int pattern_length ; } XmFileSelectionBoxCallbackStruct; typedef struct { int reason; XEvent * event; int value; } XmScaleCallbackStruct; typedef struct { int reason; XEvent *event; Widget menuToPost; Boolean postIt; Widget target; } XmPopupHandlerCallbackStruct; typedef struct { int reason; XEvent *event; Widget item; unsigned char new_outline_state; } XmContainerOutlineCallbackStruct; typedef struct { int reason; XEvent *event; WidgetList selected_items; int selected_item_count; unsigned char auto_selection_type; } XmContainerSelectCallbackStruct; typedef struct { int reason; XEvent *event; int page_number; Widget page_widget; int prev_page_number; Widget prev_page_widget; } XmNotebookCallbackStruct; typedef struct { int reason; XEvent *event; XmRendition rendition; char *font_name; XmRenderTable render_table; XmStringTag tag; } XmDisplayCallbackStruct; #ifdef PRINTING_SUPPORTED typedef struct { int reason; /* XmCR_START_JOB, XmCR_END_JOB, XmCR_PAGE_SETUP */ XEvent *event; XPContext context; Boolean last_page; /* in_out */ XtPointer detail; } XmPrintShellCallbackStruct; #endif /* PRINTING_SUPPORTED */ /************************************************************************ * PushButton defines ************************************************************************/ enum{ XmMULTICLICK_DISCARD, XmMULTICLICK_KEEP } ; /************************************************************************ * DrawnButton defines ************************************************************************/ enum{ XmSHADOW_IN = 7, XmSHADOW_OUT } ; /************************************************************************ * Arrow defines ************************************************************************/ enum{ XmARROW_UP, XmARROW_DOWN, XmARROW_LEFT, XmARROW_RIGHT } ; /************************************************************************ * Separator defines * Note: XmINVALID_SEPARATOR_TYPE marks the last+1 separator type ************************************************************************/ enum{ XmNO_LINE, XmSINGLE_LINE, XmDOUBLE_LINE, XmSINGLE_DASHED_LINE, XmDOUBLE_DASHED_LINE, XmSHADOW_ETCHED_IN, XmSHADOW_ETCHED_OUT, XmSHADOW_ETCHED_IN_DASH, XmSHADOW_ETCHED_OUT_DASH, XmINVALID_SEPARATOR_TYPE } ; enum{ XmPIXMAP = 1, XmSTRING, XmPIXMAP_AND_STRING } ; /************************************************************************ * Drag and Drop defines ************************************************************************/ enum{ XmWINDOW, /* XmPIXMAP, */ XmCURSOR = 2, XmDRAG_WINDOW = 3 } ; /************************************************************************ * ScrollBar defines ************************************************************************/ enum{ XmMAX_ON_TOP, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT, XmMAX_ON_RIGHT } ; /************************************************************************ * * * List Widget defines * * * ************************************************************************/ enum{ XmSINGLE_SELECT, XmMULTIPLE_SELECT, XmEXTENDED_SELECT, XmBROWSE_SELECT } ; enum{ XmSTATIC, XmDYNAMIC } ; enum{ XmNORMAL_MODE, XmADD_MODE } ; /************************************************************************ * * * Container Widget defines * * * ************************************************************************/ /* XmRAutomaticSelection */ enum { XmNO_AUTO_SELECT, XmAUTO_SELECT }; /* XmRLineStyle */ enum { /* XmNO_LINE */ XmSINGLE = 1 }; /* XmREntryViewType */ enum { /* XmLARGE_ICON */ /* XmSMALL_ICON */ XmANY_ICON = 2 }; /* XmRSpatialIncludeModel */ enum { XmAPPEND, XmCLOSEST, XmFIRST_FIT }; /* XmRLayoutType */ enum { XmOUTLINE, XmSPATIAL, XmDETAIL }; /* XmNoutlineButtonPolicy */ enum { XmOUTLINE_BUTTON_PRESENT, XmOUTLINE_BUTTON_ABSENT }; /* XmRSpatialPlaceStyle */ enum { /* XmNONE */ XmGRID = 1, XmCELLS }; /* XmRPrimaryOwnership */ enum { XmOWN_NEVER, XmOWN_ALWAYS, XmOWN_MULTIPLE, XmOWN_POSSIBLE_MULTIPLE }; /* XmRSpatialResizeModel */ enum { XmGROW_MINOR, XmGROW_MAJOR, XmGROW_BALANCED }; /* XmRSelectionTechnique */ enum { XmMARQUEE, XmMARQUEE_EXTEND_START, XmMARQUEE_EXTEND_BOTH, XmTOUCH_ONLY, XmTOUCH_OVER }; /* XmRSpatialSnapModel */ enum { /* XmNONE */ XmSNAP_TO_GRID = 1, XmCENTER }; /* XmROutlineState */ enum { XmCOLLAPSED, XmEXPANDED }; /************************************************************************ * * * IconGadget defines * * * ************************************************************************/ /* XmRViewType */ enum { XmLARGE_ICON, XmSMALL_ICON }; /* XmRVisualEmphasis */ enum { XmSELECTED, XmNOT_SELECTED }; /************************************************************************ * * * Notebook Widget defines * * * ************************************************************************/ #define XmUNSPECIFIED_PAGE_NUMBER (-32768) /* XmRBindingType */ enum { /* XmNONE */ /* XmPIXMAP */ XmSOLID = 2, XmSPIRAL, XmPIXMAP_OVERLAP_ONLY }; /* XmRNBChildType */ enum { /* XmNONE */ XmPAGE = 1, XmMAJOR_TAB, XmMINOR_TAB, XmSTATUS_AREA, XmPAGE_SCROLLER }; /************************************************************************ * * * Spin button defines. * * * ************************************************************************/ /* XmNarrowOrientation */ enum { XmARROWS_VERTICAL, XmARROWS_HORIZONTAL }; /* XmNarrowLayout */ enum { XmARROWS_END, XmARROWS_BEGINNING, XmARROWS_SPLIT, XmARROWS_FLAT_END, XmARROWS_FLAT_BEGINNING }; /* XmNarrowSensitivity and XmNdefaultArrowSensitivity */ /* Please note that these arrows form the proper values for a bit mask. */ enum { XmARROWS_INSENSITIVE, XmARROWS_INCREMENT_SENSITIVE, XmARROWS_DECREMENT_SENSITIVE, XmARROWS_SENSITIVE, XmARROWS_DEFAULT_SENSITIVITY }; /* XmNpositionType */ enum { XmPOSITION_INDEX, XmPOSITION_VALUE }; /* XmNspinButtonChildType */ enum { /* XmPIXMAP = 1 */ /* XmSTRING */ XmNUMERIC = 3 }; /* Return values for Xm[Simple]SpinBoxValidatePosition */ enum { XmVALID_VALUE, XmCURRENT_VALUE, XmMAXIMUM_VALUE, XmMINIMUM_VALUE, XmINCREMENT_VALUE }; typedef struct { int reason; XEvent *event; Widget widget; Boolean doit; int position; XmString value; Boolean crossed_boundary; } XmSpinBoxCallbackStruct; /************************************************************************ * * * Scrolled Window defines. * * * ************************************************************************/ enum{ XmVARIABLE, XmCONSTANT, XmRESIZE_IF_POSSIBLE } ; enum{ XmAUTOMATIC, XmAPPLICATION_DEFINED } ; enum{ /* XmSTATIC */ XmAS_NEEDED = 1 } ; #define SW_TOP 1 #define SW_BOTTOM 0 #define SW_LEFT 2 #define SW_RIGHT 0 #define XmTOP_LEFT (SW_TOP | SW_LEFT) #define XmBOTTOM_LEFT (SW_BOTTOM | SW_LEFT) #define XmTOP_RIGHT (SW_TOP | SW_RIGHT) #define XmBOTTOM_RIGHT (SW_BOTTOM | SW_RIGHT) /************************************************************************ * * * MainWindow Resources * * * ************************************************************************/ enum{ XmCOMMAND_ABOVE_WORKSPACE, XmCOMMAND_BELOW_WORKSPACE } ; /************************************************************************ * * * Text Widget defines * * * ************************************************************************/ enum{ XmMULTI_LINE_EDIT, XmSINGLE_LINE_EDIT } ; typedef enum{ XmTEXT_FORWARD, XmTEXT_BACKWARD } XmTextDirection; typedef long XmTextPosition; typedef Atom XmTextFormat; #define XmFMT_8_BIT ((XmTextFormat) XA_STRING) /* 8-bit text. */ #define XmFMT_16_BIT ((XmTextFormat) 2) /* 16-bit text. */ #define FMT8BIT XmFMT_8_BIT /* For backwards compatibility only.*/ #define FMT16BIT XmFMT_16_BIT /* For backwards compatibility only.*/ typedef enum{ XmSELECT_POSITION, XmSELECT_WHITESPACE, XmSELECT_WORD, XmSELECT_LINE, XmSELECT_ALL, XmSELECT_PARAGRAPH, XmSELECT_OUT_LINE } XmTextScanType ; typedef enum{ XmHIGHLIGHT_NORMAL, XmHIGHLIGHT_SELECTED, XmHIGHLIGHT_SECONDARY_SELECTED, XmSEE_DETAIL } XmHighlightMode ; /* XmTextBlock's are used to pass text around. */ typedef struct { char *ptr; /* Pointer to data. */ int length; /* Number of bytes of data. */ XmTextFormat format; /* Representations format */ } XmTextBlockRec, *XmTextBlock; typedef struct { int reason; XEvent *event; Boolean doit; long currInsert, newInsert; long startPos, endPos; XmTextBlock text; } XmTextVerifyCallbackStruct, *XmTextVerifyPtr; /* XmTextBlockWcs's are used in 1.2 modifyVerifyWcs callbacks for Text[Field] * widgets. */ typedef struct { wchar_t *wcsptr; /* Pointer to data. */ int length; /* Number of characters (not bytes) of data. */ } XmTextBlockRecWcs, *XmTextBlockWcs; typedef struct { int reason; XEvent *event; Boolean doit; long currInsert, newInsert; long startPos, endPos; XmTextBlockWcs text; } XmTextVerifyCallbackStructWcs, *XmTextVerifyPtrWcs; /* functions renamed after 1.0 release due to resource name overlap */ #define XmTextGetTopPosition XmTextGetTopCharacter #define XmTextSetTopPosition XmTextSetTopCharacter #define XmCOPY_FAILED 0 #define XmCOPY_SUCCEEDED 1 #define XmCOPY_TRUNCATED 2 /************************************************************************ * * * DIALOG defines.. BulletinBoard and things common to its subclasses * * CommandBox MessageBox Selection FileSelection * * * ************************************************************************/ /* child type defines for Xm...GetChild() */ enum{ XmDIALOG_NONE, XmDIALOG_APPLY_BUTTON, XmDIALOG_CANCEL_BUTTON, XmDIALOG_DEFAULT_BUTTON, XmDIALOG_OK_BUTTON, XmDIALOG_FILTER_LABEL, XmDIALOG_FILTER_TEXT, XmDIALOG_HELP_BUTTON, XmDIALOG_LIST, XmDIALOG_LIST_LABEL, XmDIALOG_MESSAGE_LABEL, XmDIALOG_SELECTION_LABEL, XmDIALOG_SYMBOL_LABEL, XmDIALOG_TEXT, XmDIALOG_SEPARATOR, XmDIALOG_DIR_LIST, XmDIALOG_DIR_LIST_LABEL } ; #define XmDIALOG_HISTORY_LIST XmDIALOG_LIST #define XmDIALOG_PROMPT_LABEL XmDIALOG_SELECTION_LABEL #define XmDIALOG_VALUE_TEXT XmDIALOG_TEXT #define XmDIALOG_COMMAND_TEXT XmDIALOG_TEXT #define XmDIALOG_FILE_LIST XmDIALOG_LIST #define XmDIALOG_FILE_LIST_LABEL XmDIALOG_LIST_LABEL /* dialog style defines */ enum{ XmDIALOG_MODELESS, XmDIALOG_PRIMARY_APPLICATION_MODAL, XmDIALOG_FULL_APPLICATION_MODAL,XmDIALOG_SYSTEM_MODAL } ; /* The following is for compatibility only. Its use is deprecated. */ #define XmDIALOG_APPLICATION_MODAL XmDIALOG_PRIMARY_APPLICATION_MODAL /************************************************************************ * XmSelectionBox, XmFileSelectionBox and XmCommand - misc. stuff * ***********************************************************************/ /* Defines for Selection child placement */ enum{ XmPLACE_TOP, XmPLACE_ABOVE_SELECTION, XmPLACE_BELOW_SELECTION } ; /* Defines for file type mask: */ #define XmFILE_DIRECTORY (1 << 0) #define XmFILE_REGULAR (1 << 1) #define XmFILE_ANY_TYPE (XmFILE_DIRECTORY | XmFILE_REGULAR) /* Defines for selection dialog type: */ enum{ XmDIALOG_WORK_AREA, XmDIALOG_PROMPT, XmDIALOG_SELECTION, XmDIALOG_COMMAND, XmDIALOG_FILE_SELECTION } ; /************************************************************************ * XmMessageBox stuff not common to other dialogs * ***********************************************************************/ /* defines for dialog type */ enum{ XmDIALOG_TEMPLATE, XmDIALOG_ERROR, XmDIALOG_INFORMATION, XmDIALOG_MESSAGE, XmDIALOG_QUESTION, XmDIALOG_WARNING, XmDIALOG_WORKING } ; /* Traversal types */ typedef enum{ XmVISIBILITY_UNOBSCURED, XmVISIBILITY_PARTIALLY_OBSCURED, XmVISIBILITY_FULLY_OBSCURED } XmVisibility ; typedef enum{ XmTRAVERSE_CURRENT, XmTRAVERSE_NEXT, XmTRAVERSE_PREV, XmTRAVERSE_HOME, XmTRAVERSE_NEXT_TAB_GROUP, XmTRAVERSE_PREV_TAB_GROUP, XmTRAVERSE_UP, XmTRAVERSE_DOWN, XmTRAVERSE_LEFT, XmTRAVERSE_RIGHT, XmTRAVERSE_GLOBALLY_FORWARD, XmTRAVERSE_GLOBALLY_BACKWARD } XmTraversalDirection ; typedef struct _XmTraverseObscuredCallbackStruct { int reason ; XEvent * event ; Widget traversal_destination ; XmTraversalDirection direction ; } XmTraverseObscuredCallbackStruct ; typedef unsigned char XmNavigationType; /*********************************************************************** * * SimpleMenu declarations and definitions. * ***********************************************************************/ typedef unsigned char XmButtonType; typedef XmButtonType * XmButtonTypeTable; typedef KeySym * XmKeySymTable; typedef XmStringCharSet * XmStringCharSetTable; enum{ XmPUSHBUTTON = 1, XmTOGGLEBUTTON, XmRADIOBUTTON, XmCASCADEBUTTON, XmSEPARATOR, XmDOUBLE_SEPARATOR, XmTITLE } ; #define XmCHECKBUTTON XmTOGGLEBUTTON /*********************************************************************** * * BitmapConversionModel * ***********************************************************************/ enum{ XmMATCH_DEPTH, XmDYNAMIC_DEPTH } ; /************************************************************************ * PrintShell defines ************************************************************************/ enum { XmPDM_NOTIFY_FAIL, XmPDM_NOTIFY_SUCCESS } ; /************************************************************************ * MultiList defines ************************************************************************/ enum { XmMULTILIST_FOUND, XmMULTILIST_NOT_FOUND }; /************************************************************************ * DropDown defines ************************************************************************/ enum { XmDROPDOWN_LABEL, XmDROPDOWN_TEXT, XmDROPDOWN_ARROW_BUTTON, XmDROPDOWN_LIST }; /* This one cannot be put at the beginning because it needs XmStringTable */ #include /******** BaseClass.c ********/ typedef XtPointer (*XmResourceBaseProc)( Widget, XtPointer) ; typedef struct _XmSecondaryResourceDataRec{ XmResourceBaseProc base_proc; XtPointer client_data; String name; String res_class; XtResourceList resources; Cardinal num_resources; }XmSecondaryResourceDataRec, *XmSecondaryResourceData; /******** Public Function Declarations for BaseClass.c ********/ extern Cardinal XmGetSecondaryResourceData( WidgetClass w_class, XmSecondaryResourceData **secondaryDataRtn) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for ImageCache.c ********/ extern Boolean XmInstallImage( XImage *image, char *image_name) ; extern Boolean XmUninstallImage( XImage *image) ; extern Pixmap XmGetPixmap( Screen *screen, char *image_name, Pixel foreground, Pixel background) ; extern Pixmap XmGetPixmapByDepth( Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth) ; extern Boolean XmDestroyPixmap( Screen *screen, Pixmap pixmap) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for Resolve.c ********/ /*-- XmeResolvePartOffsets is defined in XmP.h. These also belong there but for source compatibility, we let them here --- */ typedef long XmOffset; typedef XmOffset *XmOffsetPtr; extern void XmResolveAllPartOffsets( WidgetClass w_class, XmOffsetPtr *offset, XmOffsetPtr *constraint_offset) ; extern void XmResolvePartOffsets( WidgetClass w_class, XmOffsetPtr *offset) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for Xm.c ********/ extern void XmUpdateDisplay( Widget w) ; extern Widget XmObjectAtPoint( Widget wid, Position x, Position y ) ; extern Boolean XmWidgetGetBaselines( Widget wid, Dimension **baselines, int *line_count); extern Boolean XmWidgetGetDisplayRect( Widget wid, XRectangle *displayrect); /******** End Public Function Declarations ********/ /******** Primitive.c ********/ /******** Public Function Declarations for Primitive.c ********/ /******** End Public Function Declarations ********/ /******** Public Function Declarations for ResConvert.c ********/ extern void XmCvtStringToUnitType( XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val) ; extern char * XmRegisterSegmentEncoding( char *fontlist_tag, char *ct_encoding) ; extern char * XmMapSegmentEncoding( char *fontlist_tag) ; extern XmString XmCvtCTToXmString( char *text) ; extern Boolean XmCvtTextToXmString( Display *display, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data) ; extern char * XmCvtXmStringToCT( XmString string) ; extern Boolean XmCvtXmStringToText( Display *display, XrmValuePtr args, Cardinal *num_args, XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data) ; #ifdef UTF8_SUPPORTED extern char * XmCvtXmStringToUTF8String( XmString string) ; #endif /******** End Public Function Declarations ********/ /******** Public Function Declarations for ResInd.c ********/ extern int XmConvertStringToUnits( Screen *screen, String spec, int orientation, int to_type, XtEnum *parse_error); extern int XmConvertUnits( Widget widget, int dimension, register int from_type, register int from_val, register int to_type) ; extern int XmCvtToHorizontalPixels( Screen *screen, register int from_val, register int from_type) ; extern int XmCvtToVerticalPixels( Screen *screen, register int from_val, register int from_type) ; extern int XmCvtFromHorizontalPixels( Screen *screen, register int from_val, register int to_type) ; extern int XmCvtFromVerticalPixels( Screen *screen, register int from_val, register int to_type) ; extern void XmSetFontUnits( Display *display, int h_value, int v_value) ; extern void XmSetFontUnit( Display *display, int value) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for MenuUtil.c ********/ extern void XmSetMenuCursor( Display *display, Cursor cursorId) ; extern Cursor XmGetMenuCursor( Display *display) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for Simple.c ********/ extern Widget XmCreateSimpleMenuBar( Widget parent, String name, ArgList args, Cardinal arg_count) ; extern Widget XmCreateSimplePopupMenu( Widget parent, String name, ArgList args, Cardinal arg_count) ; extern Widget XmCreateSimplePulldownMenu( Widget parent, String name, ArgList args, Cardinal arg_count) ; extern Widget XmCreateSimpleOptionMenu( Widget parent, String name, ArgList args, Cardinal arg_count) ; extern Widget XmCreateSimpleRadioBox( Widget parent, String name, ArgList args, Cardinal arg_count) ; extern Widget XmCreateSimpleCheckBox( Widget parent, String name, ArgList args, Cardinal arg_count) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for VaSimple.c ********/ extern Widget XmVaCreateSimpleMenuBar( Widget parent, String name, ...) ; extern Widget XmVaCreateSimplePopupMenu( Widget parent, String name, XtCallbackProc callback, ...) ; extern Widget XmVaCreateSimplePulldownMenu( Widget parent, String name, int post_from_button, XtCallbackProc callback, ...) ; extern Widget XmVaCreateSimpleOptionMenu( Widget parent, String name, XmString option_label, KeySym option_mnemonic, int button_set, XtCallbackProc callback, ...) ; extern Widget XmVaCreateSimpleRadioBox( Widget parent, String name, int button_set, XtCallbackProc callback, ...) ; extern Widget XmVaCreateSimpleCheckBox( Widget parent, String name, XtCallbackProc callback, ...) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for TrackLoc.c ********/ extern Widget XmTrackingEvent( Widget widget, Cursor cursor, #if NeedWidePrototypes int confineTo, #else Boolean confineTo, #endif /* NeedWidePrototypes */ XEvent *pev) ; extern Widget XmTrackingLocate( Widget widget, Cursor cursor, #if NeedWidePrototypes int confineTo) ; #else Boolean confineTo) ; #endif /* NeedWidePrototypes */ /******** End Public Function Declarations ********/ /******** Visual.c ********/ typedef void (*XmColorProc) (XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color); /******** Public Function Declarations for Visual.c ********/ extern XmColorProc XmSetColorCalculation( XmColorProc proc) ; extern XmColorProc XmGetColorCalculation( void ) ; extern void XmGetColors( Screen *screen, Colormap color_map, Pixel background, Pixel *foreground_ret, Pixel *top_shadow_ret, Pixel *bottom_shadow_ret, Pixel *select_ret) ; extern void XmChangeColor( Widget widget, Pixel background) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for XmString.c ********/ extern XmString XmStringCreate( char *text, XmStringCharSet charset) ; extern XmString XmStringCreateSimple( char *text) ; extern XmString XmStringCreateLocalized( String text) ; extern XmString XmStringDirectionCreate( #if NeedWidePrototypes int direction) ; #else XmStringDirection direction) ; #endif /* NeedWidePrototypes */ extern XmString XmStringSeparatorCreate( void ) ; extern XmString XmStringSegmentCreate( char *text, XmStringCharSet charset, #if NeedWidePrototypes int direction, int separator) ; #else XmStringDirection direction, Boolean separator) ; #endif /* NeedWidePrototypes */ extern XmString XmStringLtoRCreate( char *text, XmStringCharSet charset) ; extern XmString XmStringCreateLtoR( char *text, XmStringCharSet charset) ; extern Boolean XmStringInitContext( XmStringContext *context, XmString string) ; extern void XmStringFreeContext( XmStringContext context) ; extern XmStringComponentType XmStringGetNextComponent( XmStringContext context, char **text, XmStringCharSet *charset, XmStringDirection *direction, XmStringComponentType *unknown_tag, unsigned short *unknown_length, unsigned char **unknown_value) ; extern XmStringComponentType XmStringPeekNextComponent( XmStringContext context) ; extern Boolean XmStringGetNextSegment( XmStringContext context, char **text, XmStringCharSet *charset, XmStringDirection *direction, Boolean *separator) ; extern Boolean XmStringGetLtoR( XmString string, XmStringCharSet charset, char **text) ; extern XmFontListEntry XmFontListEntryCreate( char *tag, XmFontType type, XtPointer font) ; extern XmFontListEntry XmFontListEntryCreate_r( char *tag, XmFontType type, XtPointer font, Widget wid) ; extern void XmFontListEntryFree( XmFontListEntry *entry) ; extern XtPointer XmFontListEntryGetFont( XmFontListEntry entry, XmFontType *typeReturn) ; extern char * XmFontListEntryGetTag( XmFontListEntry entry) ; extern XmFontList XmFontListAppendEntry( XmFontList old, XmFontListEntry entry) ; extern XmFontListEntry XmFontListNextEntry( XmFontContext context) ; extern XmFontList XmFontListRemoveEntry( XmFontList old, XmFontListEntry entry) ; extern XmFontListEntry XmFontListEntryLoad( Display *display, char *fontName, XmFontType type, char *tag) ; extern XmFontList XmFontListCreate( XFontStruct *font, XmStringCharSet charset) ; extern XmFontList XmFontListCreate_r( XFontStruct *font, XmStringCharSet charset, Widget wid) ; extern XmFontList XmStringCreateFontList( XFontStruct *font, XmStringCharSet charset) ; extern XmFontList XmStringCreateFontList_r( XFontStruct *font, XmStringCharSet charset, Widget wid) ; extern void XmFontListFree( XmFontList fontlist) ; extern XmFontList XmFontListAdd( XmFontList old, XFontStruct *font, XmStringCharSet charset) ; extern XmFontList XmFontListCopy( XmFontList fontlist) ; extern Boolean XmFontListInitFontContext( XmFontContext *context, XmFontList fontlist) ; extern Boolean XmFontListGetNextFont( XmFontContext context, XmStringCharSet *charset, XFontStruct **font) ; extern void XmFontListFreeFontContext( XmFontContext context) ; extern XmString XmStringConcat( XmString a, XmString b) ; extern XmString XmStringConcatAndFree( XmString a, XmString b) ; extern XmString XmStringNConcat( XmString first, XmString second, int n) ; extern XmString XmStringCopy( XmString string) ; extern XmString XmStringNCopy( XmString str, int n) ; extern Boolean XmStringByteCompare( XmString a1, XmString b1) ; extern Boolean XmStringCompare( XmString a, XmString b) ; extern int XmStringLength( XmString string) ; extern Boolean XmStringEmpty( XmString string) ; extern Boolean XmStringIsVoid(XmString string); extern Boolean XmStringHasSubstring( XmString string, XmString substring) ; extern void XmStringFree( XmString string) ; extern Dimension XmStringBaseline( XmFontList fontlist, XmString string) ; extern Dimension XmStringWidth( XmFontList fontlist, XmString string) ; extern Dimension XmStringHeight( XmFontList fontlist, XmString string) ; extern void XmStringExtent( XmFontList fontlist, XmString string, Dimension *width, Dimension *height) ; extern int XmStringLineCount( XmString string) ; extern void XmStringDraw( Display *d, Window w, XmFontList fontlist, XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip) ; extern void XmStringDrawImage( Display *d, Window w, XmFontList fontlist, XmString string, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip) ; extern void XmStringDrawUnderline( Display *d, Window w, XmFontList fntlst, XmString str, GC gc, #if NeedWidePrototypes int x, int y, int width, unsigned int align, unsigned int lay_dir, #else Position x, Position y, Dimension width, unsigned char align, unsigned char lay_dir, #endif /* NeedWidePrototypes */ XRectangle *clip, XmString under) ; extern unsigned int XmCvtXmStringToByteStream( XmString string, unsigned char **prop_return); extern XmString XmCvtByteStreamToXmString( unsigned char *property); extern unsigned int XmStringByteStreamLength(unsigned char *string); extern XmStringComponentType XmStringPeekNextTriple(XmStringContext context); extern XmStringComponentType XmStringGetNextTriple(XmStringContext context, unsigned int *length, XtPointer *value); extern XmString XmStringComponentCreate(XmStringComponentType tag, unsigned int length, XtPointer value); extern XtPointer XmStringUnparse(XmString string, XmStringTag tag, XmTextType tag_type, XmTextType output_type, XmParseTable parse_table, Cardinal parse_count, XmParseModel parse_model); extern XmString XmStringParseText(XtPointer text, XtPointer *text_end, XmStringTag tag, XmTextType type, XmParseTable parse_table, Cardinal parse_count, XtPointer call_data); extern Cardinal XmStringToXmStringTable(XmString string, XmString break_comp, XmStringTable *table); extern XmString XmStringTableToXmString(XmStringTable table, Cardinal count, XmString break_component); extern XtPointer *XmStringTableUnparse(XmStringTable table, Cardinal count, XmStringTag tag, XmTextType tag_type, XmTextType output_type, XmParseTable parse, Cardinal parse_count, XmParseModel parse_model); extern XmStringTable XmStringTableParseStringArray(XtPointer *strings, Cardinal count, XmStringTag tag, XmTextType type, XmParseTable parse, Cardinal parse_count, XtPointer call_data); extern XmStringDirection XmDirectionToStringDirection(XmDirection dir); extern XmDirection XmStringDirectionToDirection(XmStringDirection dir); extern XmString XmStringGenerate(XtPointer text, XmStringTag tag, XmTextType type, XmStringTag rendition); extern XmString XmStringPutRendition(XmString string, XmStringTag rendition); extern XmParseMapping XmParseMappingCreate(ArgList arg_list, Cardinal arg_count); extern void XmParseMappingSetValues(XmParseMapping parse_mapping, ArgList arg_list, Cardinal arg_count); extern void XmParseMappingGetValues(XmParseMapping parse_mapping, ArgList arg_list, Cardinal arg_count); extern void XmParseMappingFree(XmParseMapping parse_mapping); extern void XmParseTableFree(XmParseTable parse_table, Cardinal parse_count); /******** End Public Function Declarations ********/ /******** Public Function Declarations for XmTabList.c ********/ extern XmTabList XmStringTableProposeTablist(XmStringTable strings, Cardinal num_strings, Widget widget, float pad_value, XmOffsetModel offset_model); extern void XmTabSetValue(XmTab xmtab, float value); extern float XmTabGetValues(XmTab xmtab, unsigned char *units, XmOffsetModel *offset, unsigned char *alignment, char **decimal); extern void XmTabFree(XmTab xmtab); extern XmTab XmTabCreate(float value, unsigned char units, XmOffsetModel offset_model, unsigned char alignment, char *decimal); extern XmTabList XmTabListRemoveTabs(XmTabList oldlist, Cardinal *position_list, Cardinal position_count); extern XmTabList XmTabListReplacePositions(XmTabList oldlist, Cardinal *position_list, XmTab *tabs, Cardinal tab_count); extern XmTab XmTabListGetTab(XmTabList tablist, Cardinal position); extern Cardinal XmTabListTabCount(XmTabList tablist); extern XmTabList XmTabListCopy(XmTabList tablist, int offset, Cardinal count); extern void XmTabListFree(XmTabList tablist); extern XmTabList XmTabListInsertTabs(XmTabList oldlist, XmTab *tabs, Cardinal tab_count, int position); /******** End Public Function Declarations ********/ /******** Public Function Declarations for XmRenderTable.c ********/ extern XmRenderTable XmRenderTableCvtFromProp(Widget, char *prop, unsigned int len); extern unsigned int XmRenderTableCvtToProp(Widget, XmRenderTable table, char **prop_return); extern void XmRenditionUpdate(XmRendition rendition, ArgList arglist, Cardinal argcount); extern void XmRenditionRetrieve(XmRendition rendition, ArgList arglist, Cardinal argcount); extern void XmRenditionFree(XmRendition rendition); extern XmRendition XmRenditionCreate(Widget widget, XmStringTag tag, ArgList arglist, Cardinal argcount); extern XmRendition *XmRenderTableGetRenditions(XmRenderTable table, XmStringTag *tags, Cardinal tag_count); extern XmRendition XmRenderTableGetRendition(XmRenderTable table, XmStringTag tag); extern int XmRenderTableGetTags(XmRenderTable table, XmStringTag **tag_list); extern void XmRenderTableFree(XmRenderTable table); extern XmRenderTable XmRenderTableCopy(XmRenderTable table, XmStringTag *tags, int tag_count); extern XmRenderTable XmRenderTableRemoveRenditions(XmRenderTable oldtable, XmStringTag *tags, int tag_count); extern XmRenderTable XmRenderTableAddRenditions(XmRenderTable oldtable, XmRendition *renditions, Cardinal rendition_count, XmMergeMode merge_mode); /******** End Public Function Declarations ********/ /******** Public Function Declarations for Dest.c ********/ extern Widget XmGetDestination( Display *display) ; /******** End Public Function Declarations ********/ /******** Public Function Declarations for Traversal.c ********/ extern Boolean XmIsTraversable( Widget wid) ; extern XmVisibility XmGetVisibility( Widget wid) ; extern Widget XmGetTabGroup( Widget wid) ; extern Widget XmGetFocusWidget( Widget wid) ; extern Boolean XmProcessTraversal( Widget w, XmTraversalDirection dir) ; extern void XmAddTabGroup( Widget tabGroup) ; extern void XmRemoveTabGroup( Widget w) ; /******** End Public Function Declarations ********/ /******** ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* * The following includes are for source compatibility. They might be * removed at some future time. */ #include #include #define XmINDICATOR_3D_BOX 0x01 #define XmINDICATOR_FLAT_BOX 0x02 #define XmINDICATOR_CHECK_GLYPH 0x10 #define XmINDICATOR_CROSS_GLYPH 0x20 enum { XmINDICATOR_NONE = 0, XmINDICATOR_FILL = 1, /* Treated as _BOX or _CHECK_BOX */ XmINDICATOR_BOX = 255, /* Treated as XmINDICATOR_3D_BOX */ XmINDICATOR_CHECK = XmINDICATOR_CHECK_GLYPH, XmINDICATOR_CHECK_BOX = XmINDICATOR_CHECK_GLYPH + XmINDICATOR_3D_BOX, XmINDICATOR_CROSS = XmINDICATOR_CROSS_GLYPH, XmINDICATOR_CROSS_BOX = XmINDICATOR_CROSS_GLYPH + XmINDICATOR_3D_BOX }; enum { XmUNSET, XmSET, XmINDETERMINATE }; enum { XmTOGGLE_BOOLEAN, XmTOGGLE_INDETERMINATE }; typedef unsigned char XmToggleButtonState; /* Shared text enum. */ typedef enum { EditDone, EditError, EditReject } XmTextStatus; /* XmDisplay.XmNdefaultButtonEmphasis enum */ enum { XmEXTERNAL_HIGHLIGHT, XmINTERNAL_HIGHLIGHT }; /* new for XmString */ #define _MOTIF_DEFAULT_LOCALE "_MOTIF_DEFAULT_LOCALE" enum { XmPATH_MODE_FULL, XmPATH_MODE_RELATIVE }; enum { XmFILTER_NONE, XmFILTER_HIDDEN_FILES} ; #endif /* _Xm_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/ToggleB.h0000644000175000017500000000540513145162623012420 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /*********************************************************************** * * Toggle Widget * ***********************************************************************/ #ifndef _XmToggle_h #define _XmToggle_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmToggleButtonWidgetClass; typedef struct _XmToggleButtonClassRec *XmToggleButtonWidgetClass; typedef struct _XmToggleButtonRec *XmToggleButtonWidget; /*fast subclass define */ #ifndef XmIsToggleButton #define XmIsToggleButton(w) XtIsSubclass(w, xmToggleButtonWidgetClass) #endif /* XmIsToggleButton */ /******** Public Function Declarations ********/ Boolean XmToggleButtonGetState( Widget w); void XmToggleButtonSetState( Widget w, #if NeedWidePrototypes int newstate, int notify); #else Boolean newstate, Boolean notify); #endif /* NeedWidePrototypes */ Boolean XmToggleButtonSetValue( Widget w, #if NeedWidePrototypes int newstate, int notify ); #else XmToggleButtonState newstate, Boolean notify ); #endif /* NeedWidePrototypes */ Widget XmCreateToggleButton( Widget parent, char *name, Arg *arglist, Cardinal argCount); Widget XmVaCreateToggleButton( Widget parent, char *name, ...); Widget XmVaCreateManagedToggleButton( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmToggle_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmCrPFrDat.c0000644000175000017500000000620712672140200013152 00000000000000/* $XConsortium: XpmCrPFrDat.c /main/2 1996/09/20 08:12:00 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrPFrData.c: * * * * XPM library * * Parse an Xpm array and create the pixmap and possibly its mask * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmCreatePixmapFromData(display, d, data, pixmap_return, shapemask_return, attributes) Display *display; Drawable d; char **data; Pixmap *pixmap_return; Pixmap *shapemask_return; XpmAttributes *attributes; { XImage *ximage, *shapeimage; int ErrorStatus; /* initialize return values */ if (pixmap_return) *pixmap_return = 0; if (shapemask_return) *shapemask_return = 0; /* create the images */ ErrorStatus = XpmCreateImageFromData(display, data, (pixmap_return ? &ximage : NULL), (shapemask_return ? &shapeimage : NULL), attributes); if (ErrorStatus != XpmSuccess) return (ErrorStatus); if (ErrorStatus < 0) /* fatal error */ return (ErrorStatus); /* create the pixmaps and destroy images */ if (pixmap_return && ximage) { xpmCreatePixmapFromImage(display, d, ximage, pixmap_return); XDestroyImage(ximage); } if (shapemask_return && shapeimage) { xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return); XDestroyImage(shapeimage); } return (ErrorStatus); } motif-2.3.8/lib/Xm/VendorSEI.h0000644000175000017500000000264412672140200012664 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: VendorSEI.h /main/5 1995/07/13 18:19:24 drk $ */ #ifndef _XmVendorSEI_h #define _XmVendorSEI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for VendorSE.c ********/ extern unsigned char _XmGetAudibleWarning(Widget w) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVendorSEI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/BBUtil.c0000644000175000017500000001140412672140200012174 00000000000000/* $TOG: BBUtil.c /main/8 1997/04/15 10:23:34 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "BulletinBI.h" #include "MessagesI.h" /* defines for label string resources coming from message catalog */ #define OK_STRING _XmMMsgResource_0001 #define CANCEL_STRING _XmMMsgResource_0002 #define SELECTION_STRING _XmMMsgResource_0003 #define APPLY_STRING _XmMMsgResource_0004 #define HELP_STRING _XmMMsgResource_0005 #define FILTER_STRING _XmMMsgResource_0006 #define DIRLIST_STRING _XmMMsgResource_0008 #define ITEMS_STRING _XmMMsgResource_0009 #define DIRTEXT_STRING _XmMMsgResource_0011 #define PROMPT_STRING _XmMMsgResource_0012 /****************************************************************/ static char * GetLabelString( XmLabelStringLoc l_loc ) { char *retval = (char*)NULL; switch (l_loc) { case XmOkStringLoc: retval = OK_STRING; break; case XmCancelStringLoc: retval = CANCEL_STRING; break; case XmSelectionStringLoc: retval = SELECTION_STRING; break; case XmApplyStringLoc: retval = APPLY_STRING; break; case XmHelpStringLoc: retval = HELP_STRING; break; case XmFilterStringLoc: retval = FILTER_STRING; break; case XmDirListStringLoc: retval = DIRLIST_STRING; break; case XmItemsStringLoc: retval = ITEMS_STRING; break; case XmDirTextStringLoc: retval = DIRTEXT_STRING; break; case XmPromptStringLoc: retval = PROMPT_STRING; break; default: /* internal error */ break; } return retval; } /****************************************************************/ Widget _XmBB_CreateButtonG( Widget bb, XmString l_string, char *name, XmLabelStringLoc l_loc ) { Arg al[10] ; register Cardinal ac = 0 ; Widget button ; XmTakesDefaultTrait trait_default ; XmString default_label_string_loc = NULL; /****************/ if( l_string ) { XtSetArg( al[ac], XmNlabelString, l_string) ; ac++ ; } else { default_label_string_loc = XmStringCreate(GetLabelString(l_loc), XmFONTLIST_DEFAULT_TAG); XtSetArg( al[ac], XmNlabelString, default_label_string_loc); ac++; } XtSetArg( al[ac], XmNstringDirection, BB_StringDirection( bb)) ; ac++ ; button = XmCreatePushButtonGadget( (Widget) bb, name, al, ac) ; trait_default = (XmTakesDefaultTrait) XmeTraitGet((XtPointer) XtClass(button), XmQTtakesDefault) ; if (trait_default) trait_default->showAsDefault (button, XmDEFAULT_READY); if (default_label_string_loc) XmStringFree(default_label_string_loc); return( button ) ; } /****************************************************************/ Widget _XmBB_CreateLabelG( Widget bb, XmString l_string, char *name, XmLabelStringLoc l_loc ) { Arg al[10] ; register int ac = 0 ; Widget label ; XmString default_label_string_loc = NULL; /****************/ if( l_string ) { XtSetArg( al[ac], XmNlabelString, l_string) ; ac++ ; } else { default_label_string_loc = XmStringCreate(GetLabelString(l_loc), XmFONTLIST_DEFAULT_TAG); XtSetArg( al[ac], XmNlabelString, default_label_string_loc); ac++; } XtSetArg( al[ac], XmNstringDirection, BB_StringDirection( bb)) ; ac++ ; XtSetArg( al[ac], XmNhighlightThickness, 0) ; ac++ ; XtSetArg( al[ac], XmNtraversalOn, False) ; ac++ ; XtSetArg( al[ac], XmNalignment, XmALIGNMENT_BEGINNING) ; ac++ ; label = XmCreateLabelGadget( bb, name, al, ac); if (default_label_string_loc) XmStringFree(default_label_string_loc); return( label ) ; } motif-2.3.8/lib/Xm/SpinB.c0000644000175000017500000024424213145162623012107 00000000000000/* $TOG: SpinB.c /main/27 1999/04/16 08:48:58 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "GeoUtilsI.h" #include "GMUtilsI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "TravActI.h" #include "TraversalI.h" #include "XmI.h" #include #define FIX_1519 static void ClassInitialize(void); static void ClassPartInitialize(WidgetClass classPart); static void Initialize(Widget req, Widget w, ArgList args, Cardinal *num_args); static void Destroy(Widget w); static void Resize(Widget w); static void Redisplay(Widget w, XEvent *event, Region region); static Boolean SetValues(Widget old, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry*req, XtWidgetGeometry*rep ); static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *rep); static void ChangeManaged(Widget w); static void InsertChild(Widget newChild); static void ConstraintInitialize(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void ConstraintDestroy(Widget w); static Boolean ConstraintSetValues(Widget old, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void SpinChildFocusChange(Widget focusWidget, XtPointer focusClient, XEvent *focusEvent, Boolean *focusContinue); static void SpinBArm(Widget armWidget, XEvent *armEvent, String *armParams, Cardinal *armCount ); static void SpinBDisarm(Widget disarmWidget, XEvent *disarmEvent, String *disarmParams, Cardinal *disarmCount); static void SpinBFirst(Widget firstWidget, XEvent *firstEvent, String *firstParams, Cardinal *firstCount ); static void SpinBLast(Widget lastWidget, XEvent *lastEvent, String *lastParams, Cardinal *lastCount ); static void SpinBLeft(Widget leftWidget, XEvent *leftEvent, String *leftParams, Cardinal *leftCount ); static void SpinBNext(Widget nextWidget, XEvent *nextEvent, String *nextParams, Cardinal *nextCount ); static void SpinBPrior(Widget priorWidget, XEvent *priorEvent, String *priorParams, Cardinal *priorCount ); static void SpinBRight(Widget rightWidget, XEvent *rightEvent, String *rightParams, Cardinal *rightCount ); static void SpinBEnter(Widget, XEvent*, String*, Cardinal*); static void SpinBLeave(Widget, XEvent*, String*, Cardinal*); static void ClearArrows(Widget clearW); static Boolean UpArrowSensitive(XmSpinBoxWidget spinW); static Boolean DownArrowSensitive(XmSpinBoxWidget spinW); static int NumericChildCount(XmSpinBoxWidget spinW); static Boolean WidgetIsChild(XmSpinBoxWidget spinW, Widget child); static Boolean ChildIsTraversable(Widget w); static int GetArrowDirection(Widget w, int spinDir); static void LayoutSpinBox(Widget w, XtWidgetGeometry *spinG, Widget child); static void NumToString(char **buffer, int min, int max, int decimal, int value ); static void DrawSpinArrow(Widget arrowWidget, int arrowFlag); static void SpinTimeOut(Widget w, int spinDelay); static void UpdateChildText(Widget textW); static Boolean ArrowWasHit(Widget arrowW, int arrowType, XEvent *arrowEvent); static void SpinBArrow(XtPointer spinData, XtIntervalId *spinInterval); static void SpinBAction(Widget actionWidget, short arrowHit ); static void FireCallbacks(XmSpinBoxCallbackStruct *spinBoxCallData, XtCallbackList callbackList, Widget arrowWidget, XEvent *arrowEvent, int arrowReason); static void ArrowCallback(Widget arrowWidget, XEvent *arrowEvent, int arrowReason); static Boolean ArrowVerify(Widget arrowWidget, XEvent *arrowEvent, int arrowReason ); static void ArrowSpinUp(Widget w, XEvent *callEvent); static void ArrowSpinDown(Widget w, XEvent *callEvent); static void GetSpinSize(Widget w, Dimension *wide, Dimension *high); static void SpinNChangeMoveCB(Widget nav, XtCallbackProc moveCB, XtPointer closure, Boolean setunset ); static void SpinNSetValue(Widget nav, XmNavigatorData nav_data, Boolean notify ); static void SpinNGetValue(Widget nav, XmNavigatorData nav_data ); static void GetPositionValue(Widget w, int offset, XtArgVal *value); static XmImportOperator SetPositionValue(Widget w, int offset, XtArgVal *value); static int GetMaximumPositionValue(XmSpinBoxConstraint sc); static int GetMinimumPositionValue(XmSpinBoxConstraint sc); static char * ValidatePositionValue(XmSpinBoxConstraint sc, int *position); static Boolean CvtStringToPositionValue(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *from, XrmValue *to, XtPointer *converter_data); /* Macros */ #define SB_ArrowLayout(w) (((XmSpinBoxWidget) (w))->spinBox.arrow_layout) #define SB_ArrowsAreStacked(w) \ ((SB_ArrowLayout(w) == XmARROWS_END) || \ (SB_ArrowLayout(w) == XmARROWS_BEGINNING)) #define SB_NumArrowsWide(w) ((SB_ArrowsAreStacked(w)) ? 1 : 2) #define SB_NumArrowsHigh(w) ((SB_ArrowsAreStacked(w)) ? 2 : 1) #define SB_ShadowMargin 2 #define SB_ShadowPixels(w) \ ( (((XmSpinBoxWidget) (w))->manager.shadow_thickness) ? \ (((XmSpinBoxWidget) (w))->manager.shadow_thickness + SB_ShadowMargin) : \ 0 ) /* Actions table */ static XtActionsRec actionsTable [] = { {"SpinBArm", SpinBArm }, {"SpinBDisarm", SpinBDisarm }, {"SpinBPrior", SpinBPrior }, {"SpinBNext", SpinBNext }, {"SpinBLeft", SpinBLeft }, {"SpinBRight", SpinBRight }, {"SpinBFirst", SpinBFirst }, {"SpinBLast", SpinBLast }, {"SpinBEnter", SpinBEnter }, {"SpinBLeave", SpinBLeave }, }; #define BAD_SPIN_VALUES _XmMMsgSpinB_0003 #define BAD_SPIN_INCREMENT _XmMMsgSpinB_0004 #define BAD_SPIN_DIRECTION _XmMMsgSpinB_0005 #define BAD_SPIN_POSITION_MIN _XmMMsgSpinB_0006 #define BAD_SPIN_POSITION_MAX _XmMMsgSpinB_0007 #define BAD_SPIN_POSITION_TYPE _XmMMsgSpinB_0008 #define DEFAULT_ARROW_SIZE 16 #define defaultTranslations _XmSpinB_defaultTranslations static XtAccelerators spinAccel; /* Resources */ #define Offset(field) XtOffsetOf(XmSpinBoxRec,spinBox.field) static XtResource resources[] = { { XmNarrowLayout, XmCArrowLayout, XmRArrowLayout, sizeof(unsigned char), Offset(arrow_layout), XmRImmediate, (XtPointer) XmARROWS_END }, { XmNarrowOrientation, XmCArrowOrientation, XmRArrowOrientation, sizeof(unsigned char), Offset(arrow_orientation), XmRImmediate, (XtPointer) XmARROWS_VERTICAL }, { XmNarrowSize, XmCArrowSize, XmRHorizontalDimension, sizeof(Dimension), Offset(arrow_size), XmRImmediate, (XtPointer) DEFAULT_ARROW_SIZE }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), Offset(margin_width), XmRImmediate, (XtPointer) 2 }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), Offset(margin_height), XmRImmediate, (XtPointer) 2 }, { XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), Offset(spacing), XmRImmediate, (XtPointer) 0 }, { XmNinitialDelay, XmCInitialDelay, XmRInt, sizeof(unsigned int), Offset(initial_delay), XmRImmediate, (XtPointer) 250 }, { XmNrepeatDelay, XmCRepeatDelay, XmRInt, sizeof(unsigned int), Offset(repeat_delay), XmRImmediate, (XtPointer) 200 }, { XmNdefaultArrowSensitivity, XmCDefaultArrowSensitivity, XmRArrowSensitivity, sizeof(unsigned char), Offset(default_arrow_sensitivity), XmRImmediate, (XtPointer) XmARROWS_SENSITIVE }, { XmNmodifyVerifyCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(modify_verify_cb), XmRPointer, NULL }, { XmNvalueChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(value_changed_cb), XmRPointer, NULL, }, { XmNdetailShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), Offset(detail_shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness } }; /* Resources */ #define ConstraintOffset(field)\ XtOffsetOf(XmSpinBoxConstraintRec,spinBox.field) static XtResource constraints[] = { { XmNspinBoxChildType, XmCSpinBoxChildType, XmRSpinBoxChildType, sizeof(unsigned char), ConstraintOffset(sb_child_type), XmRImmediate, (XtPointer) XmSTRING }, { XmNpositionType, XmCPositionType, XmRPositionType, sizeof(unsigned char), ConstraintOffset(position_type), XmRImmediate, (XtPointer) XmPOSITION_VALUE }, { XmNnumValues, XmCNumValues, XmRInt, sizeof(int), ConstraintOffset(num_values), XmRImmediate, (XtPointer) 0 }, { XmNvalues, XmCValues, XmRXmStringTable, sizeof(XmStringTable), ConstraintOffset(values), XmRStringTable, NULL }, { XmNminimumValue, XmCMinimumValue, XmRInt, sizeof(int), ConstraintOffset(minimum_value), XmRImmediate, (XtPointer) 0 }, { XmNmaximumValue, XmCMaximumValue, XmRInt, sizeof(int), ConstraintOffset(maximum_value), XmRImmediate, (XtPointer) 10 }, { XmNincrementValue, XmCIncrementValue, XmRInt, sizeof(int), ConstraintOffset(increment_value), XmRImmediate, (XtPointer) 1 }, { XmNdecimalPoints, XmCDecimalPoints, XmRShort, sizeof(short), ConstraintOffset(decimal_points), XmRImmediate, (XtPointer) 0 }, { XmNarrowSensitivity, XmCArrowSensitivity, XmRArrowSensitivity, sizeof(unsigned char), ConstraintOffset(arrow_sensitivity), XmRImmediate, (XtPointer) XmARROWS_DEFAULT_SENSITIVITY }, { XmNwrap, XmCWrap, XmRBoolean, sizeof(Boolean), ConstraintOffset(wrap), XmRImmediate, (XtPointer) True }, { XmNposition, XmCPosition, XmRPositionValue, sizeof(int), ConstraintOffset(position), XmRImmediate, (XtPointer) 0 } }; static XmSyntheticResource syn_resources[] = { { XmNspacing, sizeof(Dimension), Offset(spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), Offset(margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNmarginWidth, sizeof(Dimension), Offset(margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNdetailShadowThickness, sizeof(Dimension), Offset(detail_shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels } }; static XmSyntheticResource syn_constraints[] = { { XmNposition, sizeof(int), ConstraintOffset(position), GetPositionValue, SetPositionValue } }; static XmBaseClassExtRec spinBoxBaseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* getValuesPrehook */ NULL, /* getValuesPosthook */ NULL, /* ClassPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ NULL /* focusChange */ }; /* The Spin class record definition */ externaldef (xmspinboxclassrec) XmSpinBoxClassRec xmSpinBoxClassRec= { { (WidgetClass)&xmManagerClassRec, /* superclass */ "XmSpinBox", /* class_name */ sizeof(XmSpinBoxRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actionsTable, /* actions */ XtNumber(actionsTable), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal | /* compress_exposure */ XtExposeNoRegion, TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ XtInheritAcceptFocus, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ defaultTranslations, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&spinBoxBaseClassExtRec, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ InsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ constraints, /* resource list */ XtNumber(constraints), /* num resources */ sizeof(XmSpinBoxConstraintRec), /* constraint size */ ConstraintInitialize, /* init proc */ ConstraintDestroy, /* destroy proc */ ConstraintSetValues, /* set values proc */ NULL, /* extension */ }, /* manager_class fields */ { NULL, /* translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ syn_constraints, /* syn_cont_resources */ XtNumber(syn_constraints), /* num_syn_cont_resources */ NULL, /* parent_process */ NULL, /* extension */ }, /* spinbox_class fields */ { NULL, /* get_callback_widget */ NULL /* extension */ } }; externaldef(xmspinboxwidgetclass) WidgetClass xmSpinBoxWidgetClass = (WidgetClass)&xmSpinBoxClassRec; static XmConst XmNavigatorTraitRec spinBoxNT = { 0, SpinNChangeMoveCB, SpinNSetValue, SpinNGetValue, }; static XtConvertArgRec selfConvertArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof(int) } }; /****************************************************************************** ** *** METHODS ** *****************************************************************************/ static void ClassInitialize(void) { spinAccel = XtParseAcceleratorTable(_XmSpinB_defaultAccelerators); /* set up base class extension quark */ spinBoxBaseClassExtRec.record_type = XmQmotif; } static void ClassPartInitialize(WidgetClass classPart) { XmSpinBoxWidgetClass spinC; spinC = (XmSpinBoxWidgetClass) classPart; _XmFastSubclassInit(classPart, XmSPINBOX_BIT); /* Install the navigator trait for all subclasses */ XmeTraitSet((XtPointer)spinC, XmQTnavigator, (XtPointer) &spinBoxNT); XtSetTypeConverter( XmRString, XmRPositionValue, CvtStringToPositionValue, selfConvertArgs, XtNumber(selfConvertArgs), XtCacheNone, (XtDestructor) NULL) ; } /*ARGSUSED*/ static void Initialize(Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmSpinBoxWidget spinW = (XmSpinBoxWidget)new_w; XGCValues GCvalues; XtGCMask GCmask, unusedMask; spinW->spinBox.textw = 0; spinW->spinBox.dim_mask = 0; spinW->spinBox.last_hit = 0; spinW->spinBox.spin_timer = 0; spinW->spinBox.make_change = 0; spinW->spinBox.boundary = 0; spinW->spinBox.ideal_height = 0; spinW->spinBox.ideal_width = 0; spinW->spinBox.up_arrow_pressed = False; spinW->spinBox.down_arrow_pressed = False; spinW->spinBox.up_arrow_rect.x = 0; spinW->spinBox.up_arrow_rect.y = 0; spinW->spinBox.up_arrow_rect.width = 0; spinW->spinBox.up_arrow_rect.height = 0; spinW->spinBox.down_arrow_rect.x = 0; spinW->spinBox.down_arrow_rect.y = 0; spinW->spinBox.down_arrow_rect.width = 0; spinW->spinBox.down_arrow_rect.height = 0; if (!spinW->core.accelerators) spinW->core.accelerators = spinAccel; if (spinW->spinBox.initial_delay < 1) spinW->spinBox.initial_delay = spinW->spinBox.repeat_delay; /* Get arrow GC */ GCmask = GCForeground | GCBackground | GCGraphicsExposures; GCvalues.foreground = spinW->core.background_pixel; GCvalues.background = spinW->manager.foreground; GCvalues.graphics_exposures = False; /* Share gc with scrollbar */ spinW->spinBox.arrow_gc = XtAllocateGC(new_w, 0, GCmask, &GCvalues, 0, GCFont); GCmask |= GCFillStyle | GCStipple; unusedMask = GCClipXOrigin | GCClipYOrigin | GCFont; GCvalues.background = spinW->core.background_pixel; GCvalues.foreground = spinW->manager.foreground; GCvalues.fill_style = FillOpaqueStippled; GCvalues.stipple = _XmGetInsensitiveStippleBitmap(new_w); /* share GC with ArrowButton */ spinW->spinBox.insensitive_gc = XtAllocateGC(new_w, 0, GCmask, &GCvalues, GCClipMask, unusedMask); } static void Destroy(Widget w) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)w; if (spinW->spinBox.arrow_gc != NULL) { XtReleaseGC(w, spinW->spinBox.arrow_gc); spinW->spinBox.arrow_gc = NULL; } if (spinW->spinBox.insensitive_gc != NULL) { XtReleaseGC(w, spinW->spinBox.insensitive_gc); spinW->spinBox.insensitive_gc = NULL; } } static void Resize(Widget w) { XtWidgetGeometry spinG; spinG.width = XtWidth(w); spinG.height = XtHeight(w); LayoutSpinBox(w, &spinG, NULL); if (XtIsRealized(w)) XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True); /* Force Redisplay */ } /*ARGSUSED*/ static void Redisplay(Widget w, XEvent *event, /* unused */ Region region) /* unused */ { XmSpinBoxWidget spinW = (XmSpinBoxWidget) w; if (XtIsRealized(w)) { ClearArrows(w); if (spinW->manager.shadow_thickness > 0) { int width, height; width = (spinW->spinBox.ideal_width < XtWidth(spinW)) ? spinW->spinBox.ideal_width : XtWidth(spinW); height = (spinW->spinBox.ideal_height < XtHeight(spinW)) ? spinW->spinBox.ideal_height : XtHeight(spinW); XmeDrawShadows( XtDisplay(w), XtWindow(w), spinW->manager.top_shadow_GC, spinW->manager.bottom_shadow_GC, 0, 0, width, height, spinW->manager.shadow_thickness, XmSHADOW_OUT ); } _XmSetFocusFlag(w,XmFOCUS_IGNORE, False); DrawSpinArrow(w, XmARROW_UP); DrawSpinArrow(w, XmARROW_DOWN); } } /*ARGSUSED*/ static Boolean SetValues(Widget old, Widget req, Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XtWidgetGeometry spinG; XmSpinBoxWidget oldW = (XmSpinBoxWidget)old; XmSpinBoxWidget reqW = (XmSpinBoxWidget)req; XmSpinBoxWidget newW = (XmSpinBoxWidget)new_w; Boolean displayFlag; displayFlag = False; /* Initial delay must be positive */ if (newW->spinBox.initial_delay < 1) newW->spinBox.initial_delay = newW->spinBox.repeat_delay; if ((newW->core.sensitive != oldW->core.sensitive) || (newW->core.ancestor_sensitive != oldW->core.ancestor_sensitive)) displayFlag = True; /* Check for geo changes, if realized */ if (XtIsRealized(new_w) && (reqW->spinBox.arrow_layout != oldW->spinBox.arrow_layout || reqW->spinBox.margin_width != oldW->spinBox.margin_width || reqW->spinBox.margin_height != oldW->spinBox.margin_height || reqW->spinBox.spacing != oldW->spinBox.spacing || reqW->spinBox.arrow_size != oldW->spinBox.arrow_size)) { spinG.width = 0; spinG.height = 0; GetSpinSize(new_w, &spinG.width, &spinG.height); XtWidth(new_w) = spinG.width; XtHeight(new_w) = spinG.height; if (XtIsRealized(old)) ClearArrows(old); LayoutSpinBox(new_w, &spinG, NULL); displayFlag = True; } if (reqW->spinBox.default_arrow_sensitivity != oldW->spinBox.default_arrow_sensitivity || reqW->spinBox.detail_shadow_thickness != oldW->spinBox.detail_shadow_thickness) displayFlag = True; return(displayFlag); } static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *rep) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)w; if (!XtIsRealized((Widget)spinW)) { rep->width = XtWidth(w); rep->height = XtHeight(w); } else { rep->width = 0; rep->height = 0; } GetSpinSize(w, &rep->width, &rep->height); return(XmeReplyToQueryGeometry(w, req, rep)); } /*ARGSUSED*/ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *rep) /* unused */ { XtGeometryResult spinResult; XtWidgetGeometry spinG; XtWidgetGeometry origG; if (IsX(req)) if (w->core.x != req->x) return(XtGeometryNo); if (IsY(req)) if (w->core.y != req->y) return(XtGeometryNo); origG.width = w->core.width; origG.height = w->core.height; if (IsWidth(req)) w->core.width = req->width; if (IsHeight(req)) w->core.height = req->height; spinG.width = 0; spinG.height = 0; GetSpinSize(XtParent(w), &spinG.width, &spinG.height); spinG.request_mode = (CWWidth | CWHeight); spinResult = _XmMakeGeometryRequest(XtParent(w), &spinG); if (spinResult == XtGeometryYes) { LayoutSpinBox(XtParent(w), &spinG, w); /* Force Redisplay */ if (XtIsRealized(w)) XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True); } else { w->core.width = origG.width; w->core.height = origG.height; spinResult = XtGeometryNo; } return(spinResult); } static void ChangeManaged(Widget w) { XtWidgetGeometry spinG; XmSpinBoxWidget spinW = (XmSpinBoxWidget) w; int i; if (XtIsRealized(w)) { spinG.width = 0; spinG.height = 0; } else { spinG.width = XtWidth(w); spinG.height = XtHeight(w); } GetSpinSize(w, &spinG.width, &spinG.height); spinG.request_mode = CWWidth | CWHeight; _XmMakeGeometryRequest(w, &spinG); LayoutSpinBox(w, &spinG, NULL); /* Update managed children */ /* Also make sure that focus is on the last created and managed * text/text_field child. If the last text/text_field child is not managed, * focus should be on the one previous to that. XmQTaccessTextual trait can * not be used to confirm the child to be text or text_field as this trait * is held by other widgets such as label as well. */ for (i = 0; i < SB_ChildCount(spinW); i++) { if (XtIsManaged(spinW->composite.children[i])) { if (XmIsTextField(spinW->composite.children[i]) || XmIsText(spinW->composite.children[i])) { spinW->spinBox.textw = spinW->composite.children[i]; } UpdateChildText(spinW->composite.children[i]); } } } static void InsertChild(Widget newChild) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)XtParent(newChild); XtWidgetProc insert_child; /* call manager's InsertChild method */ _XmProcessLock(); insert_child = ((XmManagerWidgetClass)xmManagerWidgetClass) ->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(newChild); if (XmeTraitGet((XtPointer)XtClass(newChild), XmQTaccessTextual) != NULL) { spinW->spinBox.textw = newChild; XtInsertEventHandler( newChild, FocusChangeMask, False, SpinChildFocusChange, (XtPointer) spinW, XtListHead ); /* To handle implicit mode, we also call the focus change if a button is clicked. The work is finished in the event handler */ XtInsertEventHandler( newChild, ButtonPressMask, False, SpinChildFocusChange, (XtPointer) spinW, XtListHead ); } XtInstallAccelerators(newChild, (Widget)spinW); } /*ARGSUSED*/ static void ConstraintInitialize(Widget req, Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmSpinBoxConstraint newC = SB_GetConstraintRec(new_w); XmSpinBoxConstraint reqC = SB_GetConstraintRec(req); XmSpinBoxWidget spinW; int valLoop; char *error = (char *) NULL; spinW = (XmSpinBoxWidget)XtParent(new_w); /* Numeric Child*/ if (SB_ChildIsNumeric(newC)) { /* enforce reasonable parameters */ if (newC->increment_value == 0) { XmeWarning(new_w, BAD_SPIN_INCREMENT); newC->increment_value = 1; } if ((newC->minimum_value < newC->maximum_value && newC->increment_value < 0) || (newC->minimum_value > newC->maximum_value && newC->increment_value > 0)) { XmeWarning(new_w, BAD_SPIN_DIRECTION); newC->increment_value *= -1; } } /* String Child*/ else { if (reqC->values != NULL) { /* buffer the values XmStringTable */ newC->values = (XmString *)XtMalloc(reqC->num_values * sizeof(XmString)); if (newC->values != NULL) for (valLoop = 0; valLoop < reqC->num_values; valLoop++) newC->values[valLoop] = XmStringCopy(reqC->values[valLoop]); } #if 0 /* * This is ifdef'ed out to be BC with DtSpinBox warning messages. */ if (newC->values == NULL || newC->num_values == 0) if (ChildIsTraversable(new_w)) if (XmeTraitGet((XtPointer)XtClass(new_w), XmQTaccessTextual) != NULL) XmeWarning(new_w, BAD_SPIN_VALUES); #endif } if (newC->position_type != XmPOSITION_VALUE && newC->position_type != XmPOSITION_INDEX) { newC->position_type = XmPOSITION_VALUE; XmeWarning(new_w, BAD_SPIN_POSITION_TYPE); } error = ValidatePositionValue(newC, &newC->position); if (error) XmeWarning(new_w, error); spinW->spinBox.up_arrow_pressed = False; spinW->spinBox.down_arrow_pressed = False; /* No reason to do the work until the child is managed */ if (XtIsManaged(new_w)) UpdateChildText(new_w); } static void ConstraintDestroy( Widget w ) { XmSpinBoxConstraint spinC = SB_GetConstraintRec(w); int itemLoop; /* give back the old values XmStringTable */ if (spinC->values != NULL) { for (itemLoop = 0; itemLoop < spinC->num_values; itemLoop++) XmStringFree(spinC->values[itemLoop]); XtFree((char*)spinC->values); spinC->values = NULL; spinC->num_values = 0; } } /*ARGSUSED*/ static Boolean ConstraintSetValues(Widget old, Widget req, Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmSpinBoxConstraint oldC = SB_GetConstraintRec(old); XmSpinBoxConstraint reqC = SB_GetConstraintRec(req); XmSpinBoxConstraint newC = SB_GetConstraintRec(new_w); XmSpinBoxWidget spinW = (XmSpinBoxWidget)XtParent(new_w); Boolean redisplayText = False; int nvi; int valLoop; char *error = (char *) NULL; /* * These resources have CG permissions only: * XmNspinBoxChildType XmNpositionType */ if (newC->position_type != oldC->position_type) { newC->position_type = oldC->position_type; XmeWarning(new_w, BAD_SPIN_POSITION_TYPE); } /* * BINARY COMPATIBILITY with DTSPINBOX * * However, DtSpinBox does not prevent setting XmNspinBoxChildType * so we have to allow it. * newC->sb_child_type = oldC->sb_child_type; */ if (newC->sb_child_type != oldC->sb_child_type) redisplayText = True; /**** Numeric Child ****/ if (SB_ChildIsNumeric(newC)) { /* enforce reasonable parameters */ if (newC->increment_value == 0) { XmeWarning(new_w, BAD_SPIN_INCREMENT); newC->increment_value = 1; } /* if something has changed ... */ if (newC->minimum_value != oldC->minimum_value || newC->maximum_value != oldC->maximum_value || newC->increment_value != oldC->increment_value || newC->decimal_points != oldC->decimal_points || newC->position != oldC->position) { redisplayText = True; /* force the step to go the right way */ if ((newC->minimum_value < newC->maximum_value && newC->increment_value < 0) || (newC->minimum_value > newC->maximum_value && newC->increment_value > 0)) { XmeWarning(new_w, BAD_SPIN_DIRECTION); newC->increment_value *= -1; } error = ValidatePositionValue(newC, &newC->position); if (error) XmeWarning(new_w, error); } } /**** String Child ****/ else if (ChildIsTraversable(new_w)) { /* buffer the new values XmStringTable */ if (reqC->values == NULL) reqC->values = oldC->values; else if (reqC->values != oldC->values) { newC->values = (XmString *)XtMalloc(reqC->num_values * sizeof(XmString)); if (newC->values != NULL) for (valLoop = 0; valLoop < reqC->num_values; valLoop++) newC->values[valLoop] = XmStringCopy(reqC->values[valLoop]); } error = ValidatePositionValue(newC, &newC->position); if (error) XmeWarning(new_w, error); #if 0 if (newC->values == NULL || newC->num_values == 0) if (XmeTraitGet((XtPointer)XtClass(new_w), XmQTaccessTextual) != NULL) XmeWarning(new_w, BAD_SPIN_VALUES); #endif if ((newC->position != oldC->position) || (newC->values != oldC->values) || (newC->num_values < oldC->num_values && newC->position > newC->num_values)) redisplayText = True; /* give back the old values XmStringTable */ if (reqC->values != oldC->values) { if (oldC->values != NULL) for (nvi = 0; nvi < oldC->num_values; nvi++) XmStringFree(oldC->values[nvi]); XtFree((char*)oldC->values); oldC->values = NULL; } } /* If the current focus child is the one requesting the change */ if (XtIsRealized((Widget)spinW) && spinW->spinBox.textw == new_w) { if (newC->arrow_sensitivity != oldC->arrow_sensitivity) { DrawSpinArrow((Widget) spinW, XmARROW_UP); DrawSpinArrow((Widget) spinW, XmARROW_DOWN); } } if (redisplayText) UpdateChildText(new_w); return(False); } /****************************************************************************** ** *** EVENT HANDLERS ** *****************************************************************************/ /****************************************************************************** * SpinChildFocusChange * Event Handler for Focus Change. *****************************************************************************/ /*ARGSUSED*/ static void SpinChildFocusChange(Widget focusWidget, XtPointer focusClient, XEvent *focusEvent, Boolean *focusContinue) /* unused */ { XmSpinBoxWidget spinW = (XmSpinBoxWidget)focusClient; if (_XmGetFocusPolicy((Widget) focusClient) == XmEXPLICIT) { if (focusEvent->type == FocusIn) { if (spinW->spinBox.textw != focusWidget) { spinW->spinBox.textw = focusWidget; } } } else { /* Only care if this is BSelect */ if (focusEvent->type == ButtonPress && focusEvent->xbutton.button == Button1) { if (spinW->spinBox.textw != (Widget) NULL) { Widget child = spinW->spinBox.textw; WidgetClass wc = XtClass(child); if (XmIsPrimitive(child)) { (*(((XmPrimitiveWidgetClass) wc) ->primitive_class.border_unhighlight))(child) ; } } spinW->spinBox.textw = focusWidget; if (spinW->spinBox.textw != (Widget) NULL) { Widget child = spinW->spinBox.textw; WidgetClass wc = XtClass(child); if (XmIsPrimitive(child)) { (*(((XmPrimitiveWidgetClass) wc) ->primitive_class.border_highlight))(child) ; } } } } if (focusWidget != (Widget) NULL) { DrawSpinArrow((Widget)focusClient, XmARROW_UP); DrawSpinArrow((Widget)focusClient, XmARROW_DOWN); } } /****************************************************************************** ** *** ACTIONS ** *****************************************************************************/ /***************************************************************************** * The Enter and Leave actions deal with implicit mode * (keyboardFocusPolicy == POINTER), where we need to indicate to the user * which child widget is to be updated on a mouse action. *****************************************************************************/ static void SpinBEnter(Widget widget, XEvent *event, String *params, Cardinal *num_params) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)widget; Widget child = (Widget) spinW -> spinBox.textw; /* We only perform this action for POINTER mode */ if (_XmGetFocusPolicy(widget) != XmPOINTER) return; if (child != (Widget) NULL) { WidgetClass wc = XtClass(child); if (XmIsPrimitive(child)) { (*(((XmPrimitiveWidgetClass) wc) ->primitive_class.border_highlight))(child) ; } } } static void SpinBLeave(Widget widget, XEvent *event, String *params, Cardinal *num_params) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)widget; Widget child = (Widget) spinW -> spinBox.textw; /* We only perform this action for POINTER mode */ if (_XmGetFocusPolicy(widget) != XmPOINTER) return; if (child != (Widget) NULL) { WidgetClass wc = XtClass(child); if (XmIsPrimitive(child)) { (*(((XmPrimitiveWidgetClass) wc) ->primitive_class.border_unhighlight))(child) ; } } } /****************************************************************************** * SpinBArm * Action for BSelect Down. *****************************************************************************/ /*ARGSUSED*/ static void SpinBArm(Widget armWidget, XEvent *armEvent, String *armParams, /* unused */ Cardinal *armCount) /* unused */ { if (armEvent->type == ButtonPress) { if (ArrowWasHit(armWidget, XmARROW_UP, armEvent)) SpinBAction(armWidget, XmARROW_UP); else if (ArrowWasHit(armWidget, XmARROW_DOWN, armEvent)) SpinBAction(armWidget, XmARROW_DOWN); } } /****************************************************************************** * SpinBDisarm * Action for BSelect Up. *****************************************************************************/ /*ARGSUSED*/ static void SpinBDisarm(Widget disarmWidget, XEvent *disarmEvent, String *disarmParams, /* unused */ Cardinal *disarmCount) /* unused */ { XmSpinBoxWidget spinW = (XmSpinBoxWidget)disarmWidget; if (spinW->spinBox.up_arrow_pressed || spinW->spinBox.down_arrow_pressed) { if (spinW->spinBox.initial_delay > 0 && spinW->spinBox.repeat_delay > 0) if (spinW->spinBox.spin_timer) XtRemoveTimeOut(spinW->spinBox.spin_timer); spinW->spinBox.up_arrow_pressed = False; spinW->spinBox.down_arrow_pressed = False; DrawSpinArrow(disarmWidget, XmARROW_UP); DrawSpinArrow(disarmWidget, XmARROW_DOWN); if (spinW->spinBox.make_change) { if (spinW->spinBox.last_hit == XmARROW_UP) ArrowSpinUp(disarmWidget, disarmEvent); else if (spinW->spinBox.last_hit == XmARROW_DOWN) ArrowSpinDown(disarmWidget, disarmEvent); } ArrowCallback(disarmWidget, disarmEvent, XmCR_OK); } spinW->spinBox.make_change = False; } /****************************************************************************** * SpinBFirst * Action for BeginData Key. *****************************************************************************/ /*ARGSUSED*/ static void SpinBFirst(Widget firstWidget, XEvent *firstEvent, String *firstParams, /* unused */ Cardinal *firstCount) /* unused */ { XmSpinBoxConstraint spinC; XmSpinBoxWidget spinW = (XmSpinBoxWidget)firstWidget; Widget child; int savePosition; child = XtWindowToWidget(XtDisplay(firstWidget), firstEvent->xany.window); child = spinW->spinBox.textw; if (WidgetIsChild(spinW, child) && DownArrowSensitive(spinW)) { spinW->spinBox.textw = child; spinC = SB_GetConstraintRec(child); savePosition = spinC->position; spinC->position = SB_ChildMinimumPositionValue(spinC); if (ArrowVerify((Widget)spinW, firstEvent, XmCR_SPIN_FIRST)) { UpdateChildText(spinW->spinBox.textw); ArrowCallback((Widget)spinW, firstEvent, XmCR_SPIN_FIRST); ArrowCallback((Widget)spinW, firstEvent, XmCR_OK); } else spinC->position = savePosition; } } /****************************************************************************** * SpinBLast * Action for EndOfData Key. *****************************************************************************/ /*ARGSUSED*/ static void SpinBLast(Widget lastWidget, XEvent *lastEvent, String *lastParams, /* unused */ Cardinal *lastCount) /* unused */ { XmSpinBoxConstraint spinC; XmSpinBoxWidget spinW = (XmSpinBoxWidget)lastWidget; Widget child; int savePosition; child = XtWindowToWidget(XtDisplay(lastWidget), lastEvent->xany.window); child = spinW->spinBox.textw; if (WidgetIsChild(spinW, child) && UpArrowSensitive(spinW)) { spinW->spinBox.textw = child; spinC = SB_GetConstraintRec(child); savePosition = spinC->position; spinC->position = SB_ChildMaximumPositionValue(spinC); if (ArrowVerify((Widget)spinW, lastEvent, XmCR_SPIN_LAST)) { UpdateChildText(spinW->spinBox.textw); ArrowCallback((Widget)spinW, lastEvent, XmCR_SPIN_LAST); ArrowCallback((Widget)spinW, lastEvent, XmCR_OK); } else spinC->position = savePosition; } } /****************************************************************************** * SpinBLeft * Action for Left Arrow. *****************************************************************************/ static void SpinBLeft(Widget leftWidget, XEvent *leftEvent, String *leftParams, Cardinal *leftCount) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)leftWidget; if (LayoutIsRtoLM(spinW)) SpinBNext(leftWidget, leftEvent, leftParams, leftCount); else SpinBPrior(leftWidget, leftEvent, leftParams, leftCount); } /****************************************************************************** * SpinBNext * Action for UpArrow Key. *****************************************************************************/ /*ARGSUSED*/ static void SpinBNext(Widget nextWidget, XEvent *nextEvent, /* unused */ String *nextParams, /* unused */ Cardinal *nextCount) /* unused */ { SpinBAction(nextWidget, XmARROW_UP); } /****************************************************************************** * SpinBPrior * Action for DownArrow Key. *****************************************************************************/ /*ARGSUSED*/ static void SpinBPrior(Widget priorWidget, XEvent *priorEvent, /* unused */ String *priorParams, /* unused */ Cardinal *priorCount ) /* unused */ { SpinBAction(priorWidget, XmARROW_DOWN); } /****************************************************************************** * SpinBRight * Action for RightArrow Key. *****************************************************************************/ static void SpinBRight(Widget rightWidget, XEvent *rightEvent, String *rightParams, Cardinal *rightCount) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)rightWidget; if (LayoutIsRtoLM(spinW)) SpinBPrior(rightWidget, rightEvent, rightParams, rightCount); else SpinBNext(rightWidget, rightEvent, rightParams, rightCount); } /****************************************************************************** ** *** OTHER FUNCTIONS ** *****************************************************************************/ /****************************************************************************** * ClearArrows * Erase Exisiting Arrows *****************************************************************************/ static void ClearArrows(Widget clearW) { XClearArea(XtDisplay(clearW), XtWindow(clearW), 0, 0, 0, 0, False); } /****************************************************************************** * UpArrowSensitive * Returns sensitive/insensitive for arrow. *****************************************************************************/ static Boolean UpArrowSensitive(XmSpinBoxWidget spinW) { XmSpinBoxConstraint spinC; unsigned char upState; if (XtIsSensitive((Widget) spinW) != True) upState = (unsigned char)XmARROWS_INSENSITIVE; else if (SB_ChildCount(spinW) && SB_WithChild(spinW)) { spinC = SB_GetConstraintRec(spinW->spinBox.textw); upState = spinC->arrow_sensitivity; } else upState = (unsigned char)XmARROWS_DEFAULT_SENSITIVITY; if (upState == (unsigned char)XmARROWS_DEFAULT_SENSITIVITY) upState = spinW->spinBox.default_arrow_sensitivity; return(upState & (unsigned char)XmARROWS_INCREMENT_SENSITIVE); } /****************************************************************************** * DownArrowSensitive * Returns sensitive/insensitive for arrow. *****************************************************************************/ static Boolean DownArrowSensitive(XmSpinBoxWidget spinW) { XmSpinBoxConstraint spinC; unsigned char downState; if (XtIsSensitive((Widget) spinW) != True) downState = (unsigned char)XmARROWS_INSENSITIVE; else if (SB_ChildCount(spinW) && SB_WithChild(spinW)) { spinC = SB_GetConstraintRec(spinW->spinBox.textw); downState = spinC->arrow_sensitivity; } else downState = (unsigned char)XmARROWS_DEFAULT_SENSITIVITY; if (downState == (unsigned char)XmARROWS_DEFAULT_SENSITIVITY) downState = spinW->spinBox.default_arrow_sensitivity; return(downState & (unsigned char)XmARROWS_DECREMENT_SENSITIVE); } /****************************************************************************** * NumericChildCount * Return Number of Numeric Children. *****************************************************************************/ static int NumericChildCount(XmSpinBoxWidget spinW) { XmSpinBoxConstraint spinC; int i; int childCount; childCount = 0; if (SB_WithChild(spinW)) for (i = 0; i < SB_ChildCount(spinW); i++) { spinC = SB_GetConstraintRec(spinW->composite.children[i]); if (SB_ChildIsNumeric(spinC)) childCount++; } return(childCount); } /****************************************************************************** * WidgetIsChild * Return True if Widget is SpinBox Child *****************************************************************************/ static Boolean WidgetIsChild(XmSpinBoxWidget spinW, Widget child) { Boolean childFlag; int i; childFlag = False; if (SB_WithChild(spinW)) for (i = 0; i < SB_ChildCount(spinW); i++) if (spinW->composite.children[i] == child) { childFlag = True; break; } return(childFlag); } /****************************************************************************** * ChildIsTraversable * Return True if XmNtraversalOn is set for child. *****************************************************************************/ static Boolean ChildIsTraversable(Widget w) { Boolean traverseFlag; Arg argList[2]; int n = 0; XtSetArg(argList[n], XmNtraversalOn, &traverseFlag); n++; XtGetValues(w, argList, n); return(traverseFlag); } /****************************************************************************** * GetArrowDirection * Returns the direction in which the arrow should be drawn * * widget - the spin box widget whose arrows are being drawn. * spinDir - the direction the arrow should cause the spinbox to spin. *****************************************************************************/ static int GetArrowDirection(Widget w, int spinDir) { int arrowDirection; int downDirection; int upDirection; int isRtoL; isRtoL = (int) LayoutIsRtoLM(w); if (SB_GetArrowOrientation(w) == (unsigned char) XmARROWS_VERTICAL) { upDirection = XmARROW_UP; downDirection = XmARROW_DOWN; } else { if (isRtoL) { upDirection = XmARROW_LEFT; downDirection = XmARROW_RIGHT; } else { upDirection = XmARROW_RIGHT; downDirection = XmARROW_LEFT; } } if (spinDir == XmARROW_UP) arrowDirection = upDirection; else arrowDirection = downDirection; return(arrowDirection); } /****************************************************************************** * LayoutSpinBox * Position Children and Arrows. * * The ideal layout of the children and arrows have the centerline of * the arrow layout running through the center of the median child * position. The median child position is roughly at the center of the * widget, modified by the baseline positions. * * Degradation behavior will first sacrifice the margins if the widget * isn't given enough room. Following this will be the spacing between * widgets, then finally the children will be shrunk (although the arrows * will not be). * * At beta, this code will use the approximation of the centerline * of the widget for the center of the child position and will not * perform the widget shrinking part of the graceful degradation of * layout. * * At final, this should be updated. *****************************************************************************/ typedef XmSpinBoxRec MySpinBoxRec; /*ARGSUSED*/ static void LayoutSpinBox(Widget w, XtWidgetGeometry *spinG, Widget child) /* unused */ { XmSpinBoxWidget spinW = (XmSpinBoxWidget) w; MySpinBoxRec *myW = (MySpinBoxRec *) w; int arrowLayout; int arrowSize; int i; int marginX, marginY; int numArrowsX, numArrowsY; int spacingX, spacingY; int posX, posY; int Xposition, Xmargin; /* May need to update this if stacked arrows are put back */ Position upX =0 ; Position downX = 0; arrowLayout = (int) spinW->spinBox.arrow_layout; arrowSize = spinW->spinBox.arrow_size; /* * Figure the starting position of the arrows and children * in the X direction: * * 1. If there is enough room for our ideal width, then use the * .margin_width and .spacing resources to arrange the SpinBox. * 2. If not enough room, give up the .margin_width spacing. * 3. If still not enough room, shrink the spacing between * subwidgets. */ spacingX = spinW->spinBox.spacing; marginX = spinW->spinBox.margin_width + SB_ShadowPixels(spinW); numArrowsX = SB_NumArrowsWide(spinW); if (spinW->spinBox.ideal_width > spinG->width) { int requiredWidth = spinW->spinBox.ideal_width - (2 * spinW->spinBox.margin_width); marginX = 0; if (requiredWidth > spinG->width) { int spacesX = SB_ChildCount(spinW) + numArrowsX; int deltaX = requiredWidth - spinG->width; spacingX = ((spacesX * spinW->spinBox.spacing) - deltaX) / spacesX; if (spacingX < 0) spacingX = 0; } } /* * Figure the starting position of the arrows and children * in the Y direction. Use the same algorithm as for the * X direction with the following addition: * * 1a. If there is more room than required for our ideal width, * expand the margins 'til the arrows are centered vertically. */ spacingY = spinW->spinBox.spacing; numArrowsY = SB_NumArrowsHigh(spinW); if (spinW->spinBox.ideal_height > spinG->height) { int requiredHeight = spinW->spinBox.ideal_height - (2 * spinW->spinBox.margin_height); marginY = 0; if (requiredHeight > spinG->height) { int deltaY = requiredHeight - spinG->width; spacingY = ((numArrowsY * spinW->spinBox.spacing) - deltaY) / numArrowsY; if (spacingY < 0) spacingY = 0; } } else { int arrowsSpace = ((numArrowsY * arrowSize) + ((numArrowsY - 1) * spinW->spinBox.spacing)); marginY = (spinG->height - arrowsSpace) / 2; } /* * Get the starting position of the first SpinBox child in the X direction. */ posX = marginX; switch(arrowLayout) { case XmARROWS_BEGINNING: case XmARROWS_FLAT_BEGINNING: if (!LayoutIsRtoLM(w)) posX += (numArrowsX * (arrowSize + spacingX)); break; case XmARROWS_SPLIT: posX += ((numArrowsX / 2) * (arrowSize + spacingX)); break; case XmARROWS_END: case XmARROWS_FLAT_END: if (LayoutIsRtoLM(w)) posX += (numArrowsX * (arrowSize + spacingX)); break; default: break; } /* * Now position the managed children of the SpinBox. */ for (i = 0; i < SB_ChildCount(spinW); i++) { Widget childW = spinW->composite.children[i]; if (w != childW && XtIsManaged(childW)) { posY = (spinG->height - XtHeight(childW)) / 2; XmeConfigureObject(childW, posX, posY, ((Widget)childW)->core.width, ((Widget)childW)->core.height, ((Widget)childW)->core.border_width ); posX += XtWidth(childW) + spacingX; } } /* * Save the dimensions of the up and down arrows * for use by the arrow drawing procedure. */ spinW->spinBox.up_arrow_rect.width = spinW->spinBox.up_arrow_rect.height = spinW->spinBox.down_arrow_rect.width = spinW->spinBox.down_arrow_rect.height = arrowSize; /* * Save the X and Y positions of the up and down arrows * for use by the arrow drawing procedure. * NOTE: The window origin for X windows is the upper left-hand * corner. Therefore, the .up_arrow_rect.y gets the smaller * Y component. */ spinW->spinBox.up_arrow_rect.y = marginY; spinW->spinBox.down_arrow_rect.y = marginY + ((numArrowsY - 1) * (spacingY + arrowSize)); if (LayoutIsRtoLM(w)) { Xposition = marginX; Xmargin = posX; } else { Xposition = posX; Xmargin = marginX; } switch(arrowLayout) { case XmARROWS_BEGINNING: downX = upX = Xmargin; break; case XmARROWS_FLAT_BEGINNING: if(LayoutIsRtoLM(w)) { upX = Xmargin; downX = Xmargin + spacingX + arrowSize; } else { upX = Xmargin + spacingX + arrowSize; downX = Xmargin; } break; case XmARROWS_SPLIT: upX = Xposition; downX = Xmargin; break; case XmARROWS_END: downX = upX = Xposition; break; case XmARROWS_FLAT_END: if(LayoutIsRtoLM(w)) { upX = Xposition; downX = Xposition + spacingX + arrowSize; } else { upX = Xposition + spacingX + arrowSize; downX = Xposition; } break; default: break; } spinW->spinBox.up_arrow_rect.x = upX; spinW->spinBox.down_arrow_rect.x = downX; } /****************************************************************************** * NumToString * Convert Number to String to Be Displayed in Child *****************************************************************************/ /* ARGSUSED */ static void NumToString(char **buffer, int min, int max, int decimal, int value) { float result; int digits; int test; digits = 0; if (decimal < 1) decimal = 0; /* * BINARY COMPATIBILITY with DTSPINBOX * * This causes spaces to be insterted in the string passed back in * buffer. DtSpinBox does not do this so we have to alter the * behavior. * * test = MAX((int)abs(min), (int)abs(max)); */ if (value == 0) { digits = 1; if (decimal > 0) digits += decimal + 1; } else { test = abs(value); while (test > 0) { test = test / 10; digits++; } if (decimal > 0) digits = (digits <= decimal) ? decimal + 2 : digits + 1; if (value < 0) digits++; } test = decimal; result = (float)value; while (test > 0) { test--; result/=10.0; } *buffer = (char *)XtMalloc((digits + 1) * sizeof(char)); if (*buffer) { #ifdef __osf__ if (decimal == 0) sprintf(*buffer, "%*.0f", digits, result); else #endif sprintf(*buffer, "%*.*f", digits, decimal, result); } } /****************************************************************************** * DrawSpinArrow * Draw a Left or Right Arrow. *****************************************************************************/ static void DrawSpinArrow(Widget arrowWidget, int arrowFlag) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)arrowWidget; Dimension arrowHeight; Dimension arrowWidth; Position arrowX; Position arrowY; Boolean arrowPressed; int arrowDirection; GC arrowGC; if (XtIsRealized((Widget)spinW)) { arrowPressed = False; if (arrowFlag == XmARROW_UP) { arrowX = spinW->spinBox.up_arrow_rect.x; arrowY = spinW->spinBox.up_arrow_rect.y; arrowWidth = spinW->spinBox.up_arrow_rect.width; arrowHeight = spinW->spinBox.up_arrow_rect.height; if (UpArrowSensitive(spinW)) { arrowGC = spinW->spinBox.arrow_gc; arrowPressed = spinW->spinBox.up_arrow_pressed; } else { arrowGC = spinW->spinBox.insensitive_gc; XSetClipMask(XtDisplay(arrowWidget), arrowGC, None); } } else { arrowX = spinW->spinBox.down_arrow_rect.x; arrowY = spinW->spinBox.down_arrow_rect.y; arrowWidth = spinW->spinBox.down_arrow_rect.width; arrowHeight = spinW->spinBox.down_arrow_rect.height; if (DownArrowSensitive(spinW)) { arrowGC = spinW->spinBox.arrow_gc; arrowPressed = spinW->spinBox.down_arrow_pressed; } else { arrowGC = spinW->spinBox.insensitive_gc; XSetClipMask(XtDisplay(arrowWidget), arrowGC, None); } } arrowWidth = (arrowWidth > 1) ? arrowWidth - 1 : 0; arrowHeight = (arrowHeight > 1) ? arrowHeight - 1 : 0; arrowDirection = GetArrowDirection(arrowWidget, arrowFlag); XmeDrawArrow( XtDisplay(arrowWidget), XtWindow(arrowWidget), arrowPressed ? spinW->manager.bottom_shadow_GC : spinW->manager.top_shadow_GC, arrowPressed ? spinW->manager.top_shadow_GC : spinW->manager.bottom_shadow_GC, arrowGC, arrowX, arrowY, arrowWidth, arrowHeight, spinW->spinBox.detail_shadow_thickness, arrowDirection ); } } /****************************************************************************** * SpinTimeOut * Add TimeOut for Spinning. *****************************************************************************/ static void SpinTimeOut(Widget w, int spinDelay) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)w; if (spinW->spinBox.initial_delay > 0 && spinW->spinBox.repeat_delay > 0) spinW->spinBox.spin_timer = XtAppAddTimeOut( XtWidgetToApplicationContext(w), spinDelay, SpinBArrow, (XtPointer)w ); } /****************************************************************************** * UpdateChildText() * Updates the text widget with the current selection, by position. *****************************************************************************/ static void UpdateChildText(Widget textW) { XmAccessTextualTrait textT; XmSpinBoxConstraint textC; char *buffer = NULL; textT = (XmAccessTextualTrait) XmeTraitGet((XtPointer)XtClass(textW), XmQTaccessTextual); if (textT == NULL) return; if (textW) { textC = SB_GetConstraintRec(textW); if (SB_ChildIsNumeric(textC)) { NumToString(&buffer, textC->minimum_value, textC->maximum_value, textC->decimal_points, textC->position ); textT->setValue(textW, (XtPointer) buffer, XmFORMAT_MBYTE); if (buffer) XtFree(buffer); } else if (textC->values != NULL && textC->num_values) { textT->setValue(textW, (XtPointer) textC->values[textC->position], XmFORMAT_XmSTRING); } } } /****************************************************************************** * ArrowWasHit * Returns True if Pointer was Over Arrow When Bselect was Issued. *****************************************************************************/ static Boolean ArrowWasHit(Widget arrowW, int arrowType, XEvent *arrowEvent) { XmSpinBoxWidget spinW; XButtonEvent *hitEvent; XRectangle arrowArea; int arrowHit; int hitX; int hitY; arrowHit = False; if (arrowEvent->type == ButtonPress) { spinW = (XmSpinBoxWidget)arrowW; hitEvent = (XButtonEvent *)arrowEvent; if (arrowType == XmARROW_UP) arrowArea = spinW->spinBox.up_arrow_rect; else arrowArea = spinW->spinBox.down_arrow_rect; hitX = hitEvent->x - arrowArea.x; /* Normalize Event Position */ hitY = hitEvent->y - arrowArea.y; if (hitX < 0 || hitX > arrowArea.width || hitY < 0 || hitY > arrowArea.height) arrowHit = False; else arrowHit = True; } return(arrowHit); } /****************************************************************************** * SpinBArrow * Function Called by TimeOut. *****************************************************************************/ /*ARGSUSED*/ static void SpinBArrow(XtPointer spinData, XtIntervalId *spinInterval) /* unused */ { XmSpinBoxWidget spinW = (XmSpinBoxWidget)spinData; spinW->spinBox.make_change = False; if (spinW->spinBox.up_arrow_pressed) { if (UpArrowSensitive(spinW)) { SpinTimeOut((Widget) spinData, spinW->spinBox.repeat_delay); DrawSpinArrow((Widget) spinData, XmARROW_UP); ArrowSpinUp((Widget) spinData, (XEvent *) NULL); } else { spinW->spinBox.up_arrow_pressed = False; DrawSpinArrow((Widget) spinData, XmARROW_UP); } } else if (spinW->spinBox.down_arrow_pressed) { if (DownArrowSensitive(spinW)) { SpinTimeOut((Widget) spinData, spinW->spinBox.repeat_delay); DrawSpinArrow((Widget) spinData, XmARROW_DOWN); ArrowSpinDown((Widget) spinData, (XEvent *) NULL); } else { spinW->spinBox.down_arrow_pressed = False; DrawSpinArrow((Widget)spinData, XmARROW_DOWN); } } } /****************************************************************************** * SpinBAction * This Function Does the Work. *****************************************************************************/ static void SpinBAction(Widget actionWidget, short arrowHit) { XmSpinBoxWidget spinW = (XmSpinBoxWidget)actionWidget; Boolean upHit; Boolean downHit; upHit = (arrowHit == XmARROW_UP); downHit = (arrowHit == XmARROW_DOWN); if ((upHit && UpArrowSensitive(spinW)) || (downHit && DownArrowSensitive(spinW))) { spinW->spinBox.make_change = True; spinW->spinBox.last_hit = arrowHit; if (SB_ChildCount(spinW) && SB_WithChild(spinW)) XmProcessTraversal(spinW->spinBox.textw, XmTRAVERSE_CURRENT); if (upHit) { spinW->spinBox.up_arrow_pressed = True; DrawSpinArrow(actionWidget, XmARROW_UP); } else if (downHit) { spinW->spinBox.down_arrow_pressed = True; DrawSpinArrow(actionWidget, XmARROW_DOWN); } if (spinW->spinBox.initial_delay) SpinTimeOut(actionWidget, spinW->spinBox.initial_delay); } else spinW->spinBox.make_change = False; } /****************************************************************************** * FireCallbacks() * Setup Callback(s) for SpinBox. *****************************************************************************/ static void FireCallbacks(XmSpinBoxCallbackStruct *spinBoxCallData, XtCallbackList callbackList, Widget arrowWidget, XEvent *arrowEvent, int arrowReason) { XmSpinBoxConstraint spinC; XmSpinBoxWidget spinW; XmSpinBoxWidgetClass spinWC; XmString xmString = (XmString) NULL; spinW = (XmSpinBoxWidget) arrowWidget; spinWC = (XmSpinBoxWidgetClass) XtClass(arrowWidget); spinBoxCallData->reason = arrowReason; spinBoxCallData->event = arrowEvent; spinBoxCallData->widget = (spinWC->spinBox_class.get_callback_widget) ? (Widget) (*(spinWC->spinBox_class.get_callback_widget))((Widget)spinW) : (Widget) spinW->spinBox.textw; if (SB_ChildCount(spinW) && SB_WithChild(spinW)) { XtArgVal position; spinC = SB_GetConstraintRec(spinW->spinBox.textw); spinBoxCallData->doit = True; position = spinC->position; GetPositionValue( (Widget) spinW->spinBox.textw, XtOffset(XmSpinBoxConstraint, position), &position); spinBoxCallData->position = position; if (spinC->sb_child_type == XmSTRING) { if ((spinC->num_values > 0) && (spinC->position < spinC->num_values)) spinBoxCallData->value = spinC->values[spinC->position]; else spinBoxCallData->value = NULL; } else { char *buffer = (char *) NULL; NumToString(&buffer, spinC->minimum_value, spinC->maximum_value, spinC->decimal_points, spinC->position ); if (buffer) xmString = XmStringCreateLocalized(buffer); spinBoxCallData->value = xmString; if (buffer) XtFree(buffer); } if (arrowReason == XmCR_SPIN_NEXT || arrowReason == XmCR_SPIN_PRIOR) spinBoxCallData->crossed_boundary = spinW->spinBox.boundary; else spinBoxCallData->crossed_boundary = False; } else { spinBoxCallData->doit = False; spinBoxCallData->position = 0; spinBoxCallData->value = NULL; spinBoxCallData->crossed_boundary = False; } /* inform the application of the change */ XtCallCallbackList((Widget) spinW, callbackList, (XtPointer) spinBoxCallData); /* Clean up the temporary XmString created to hold the XmNUMERIC value. */ if (xmString != (XmString) NULL) XmStringFree(xmString); } /****************************************************************************** * ArrowCallback() * Setup and Call ValueChanged Callback(s) for SpinBox. *****************************************************************************/ static void ArrowCallback(Widget arrowWidget, XEvent *arrowEvent, int arrowReason) { XmSpinBoxWidget spinW = (XmSpinBoxWidget) arrowWidget; XmSpinBoxCallbackStruct spinBoxCallData; FireCallbacks(&spinBoxCallData, spinW->spinBox.value_changed_cb, arrowWidget, arrowEvent, arrowReason); } /****************************************************************************** * ArrowVerify() * Setup and Call ModifyVerify Callback(s) for SpinBox. *****************************************************************************/ static Boolean ArrowVerify(Widget arrowWidget, XEvent *arrowEvent, int arrowReason) { XmSpinBoxWidget spinW = (XmSpinBoxWidget) arrowWidget; XmSpinBoxCallbackStruct spinBoxCallData; FireCallbacks(&spinBoxCallData, spinW->spinBox.modify_verify_cb, arrowWidget, arrowEvent, arrowReason); if (SB_ChildCount(spinW) && SB_WithChild(spinW) && spinBoxCallData.doit) { char *error = (char *) NULL; XtArgVal position = spinBoxCallData.position; int int_pos; XmSpinBoxConstraint spinC = SB_GetConstraintRec(spinW->spinBox.textw); (void) SetPositionValue((Widget) spinW->spinBox.textw, XtOffset(XmSpinBoxConstraint, position), &position); int_pos = position; error = ValidatePositionValue(spinC, &int_pos); if (error) XmeWarning((Widget) spinW, error); spinC->position = int_pos; } return(spinBoxCallData.doit); } /****************************************************************************** * ArrowSpinUp() * Spin Increment Arrow. *****************************************************************************/ static void ArrowSpinUp(Widget w, XEvent *callEvent) { XmSpinBoxConstraint spinC; XmSpinBoxWidget spinW; int inPosition; spinW = (XmSpinBoxWidget)w; if (SB_ChildCount(spinW) && SB_WithChild(spinW)) { spinC = SB_GetConstraintRec(spinW->spinBox.textw); inPosition = spinC->position; spinW->spinBox.boundary = False; spinC->position += (SB_ChildIsNumeric(spinC) ? spinC->increment_value : 1); if (spinC->position > SB_ChildMaximumPositionValue(spinC)) { if (spinC->wrap) { spinW->spinBox.boundary = True; spinC->position = SB_ChildMinimumPositionValue(spinC); } else { spinC->position = inPosition; XBell(XtDisplay(spinW), 0); } } /* Update the Text Widget */ if (inPosition != spinC->position) { if (ArrowVerify((Widget)spinW, callEvent, XmCR_SPIN_NEXT)) { UpdateChildText(spinW->spinBox.textw); ArrowCallback((Widget)spinW, callEvent, XmCR_SPIN_NEXT); } else { spinC->position = inPosition; } } } else ArrowCallback((Widget)spinW, callEvent, XmCR_SPIN_NEXT); } /****************************************************************************** * ArrowSpinDown * Spin Decrement Arrow. *****************************************************************************/ static void ArrowSpinDown(Widget w, XEvent *callEvent) { XmSpinBoxConstraint spinC; XmSpinBoxWidget spinW; int inPosition; spinW = (XmSpinBoxWidget)w; if (SB_ChildCount(spinW) && SB_WithChild(spinW)) { spinC = SB_GetConstraintRec(spinW->spinBox.textw); inPosition = spinC->position; spinW->spinBox.boundary = False; spinC->position -= (SB_ChildIsNumeric(spinC) ? spinC->increment_value : 1); if (spinC->position < SB_ChildMinimumPositionValue(spinC)) { if (spinC->wrap) { spinW->spinBox.boundary = True; spinC->position = SB_ChildMaximumPositionValue(spinC); } else { spinC->position = inPosition; XBell(XtDisplay(spinW), 0); } } /* Update the Text Widget */ if (inPosition != spinC->position) { if (ArrowVerify((Widget)spinW, callEvent, XmCR_SPIN_PRIOR)) { UpdateChildText(spinW->spinBox.textw); ArrowCallback((Widget)spinW, callEvent, XmCR_SPIN_PRIOR); } else { spinC->position = inPosition; } } } else ArrowCallback((Widget)spinW, callEvent, XmCR_SPIN_PRIOR); } /***************************************************************************** * GetSpinSize *****************************************************************************/ static void GetSpinSize(Widget w, Dimension *wide, Dimension *high) { XmSpinBoxWidget spinW; Dimension childHeight; Dimension saveWide; Dimension saveHigh; Widget childW; int i; int arrowSize; int arrowsWide; int arrowsHigh; int spacing; spinW = (XmSpinBoxWidget)w; saveWide = XtWidth(spinW); saveHigh = XtHeight(spinW); XtWidth(spinW) = *wide; XtHeight(spinW) = *high; arrowSize = spinW->spinBox.arrow_size; arrowsWide = SB_NumArrowsWide(spinW); arrowsHigh = SB_NumArrowsHigh(spinW); spacing = spinW->spinBox.spacing; if (*wide == 0) { *wide = arrowsWide * arrowSize; *wide += (arrowsWide - 1) * spacing; *wide += 2 * spinW->spinBox.margin_width; *wide += 2 * SB_ShadowPixels(spinW); if (SB_WithChild(spinW)) for (i = 0; i < SB_ChildCount(spinW); i++) { childW = spinW->composite.children[i]; if (XtIsManaged(childW)) *wide += XtWidth(childW) + spinW->spinBox.spacing; } /* Remember our best width */ spinW->spinBox.ideal_width = *wide; } if (!*high) { *high = arrowsHigh * arrowSize; *high += (arrowsHigh - 1) * spacing; *high += 2 * spinW->spinBox.margin_height; if (SB_WithChild(spinW)) for (i = 0; i < SB_ChildCount(spinW); i++) { childW = spinW->composite.children[i]; if (XtIsManaged(childW)) { childHeight = XtHeight(childW); *high = MAX(*high, childHeight); } } /* Factor in the shadow thickness and remember our best size */ *high += 2 * SB_ShadowPixels(spinW); spinW->spinBox.ideal_height = *high; } if (*wide == 0) *wide = 1; if (*high == 0) *high = 1; XtWidth(spinW) = saveWide; XtHeight(spinW) = saveHigh; } /****************************************************************************** * SpinNChangeMoveCB * Navigator Trait Change/Move Callback. *****************************************************************************/ static void SpinNChangeMoveCB(Widget nav, XtCallbackProc moveCB, XtPointer closure, Boolean setunset) { if (setunset) XtAddCallback (nav, XmNvalueChangedCallback, moveCB, closure); else XtRemoveCallback (nav, XmNvalueChangedCallback, moveCB, closure); } /****************************************************************************** * SpinNSetValue * Navigator SetValue Function. *****************************************************************************/ static void SpinNSetValue(Widget nav, XmNavigatorData nav_data, Boolean notify) { XmSpinBoxConstraint spinC; XmSpinBoxWidget spinW = (XmSpinBoxWidget)nav; Arg arglist[6]; Cardinal argCount; int lastValue; int numericCount; int i; int minimum; int increment; Mask mask ; if (nav_data->valueMask & NavDimMask) spinW->spinBox.dim_mask = nav_data->dimMask ; if (!(numericCount = NumericChildCount(spinW))) return; if (!(spinW->spinBox.dim_mask & nav_data->dimMask)) return ; /* Spin box can be a 2d dimensional navigator at most. If there is only one dimension set, the following loop is only rnu once since the mask is update at the end of it */ mask = spinW->spinBox.dim_mask ; for (numericCount = 0, i = 0; i < SB_ChildCount(spinW) && numericCount < 2 && mask; i++) { spinC = SB_GetConstraintRec(spinW->composite.children[i]); if (SB_ChildIsNumeric(spinC)) { argCount = 0; numericCount++; lastValue = spinC->position; minimum=spinC->minimum_value; increment=spinC->increment_value; if ((nav_data->valueMask & NavMinimum) && (spinC->minimum_value != ACCESS_DIM(mask, nav_data->minimum))) { XtSetArg (arglist[argCount], XmNminimumValue, ACCESS_DIM(mask, nav_data->minimum)); minimum = ACCESS_DIM(mask, nav_data->minimum); argCount++; } if ((nav_data->valueMask & NavIncrement) && (spinC->increment_value != ACCESS_DIM(mask, nav_data->increment))) { XtSetArg (arglist[argCount], XmNincrementValue, ACCESS_DIM(mask, nav_data->increment)); increment = ACCESS_DIM(mask, nav_data->increment); argCount++; } /* Process value if different from current value or either increment or minimumValue changed (which will change the calculation */ if ((nav_data->valueMask & NavValue) && ((argCount != 0) || (lastValue != ACCESS_DIM(mask, nav_data->value)))) { XtArgVal position = ACCESS_DIM(mask, nav_data->value); GetPositionValue( (Widget) spinW->composite.children[i], XtOffset(XmSpinBoxConstraint, position), &position); XtSetArg (arglist[argCount], XmNposition, ((int)position)); argCount++; } if ((nav_data->valueMask & NavMaximum) && (spinC->maximum_value != ACCESS_DIM(mask, nav_data->maximum))) { XtSetArg (arglist[argCount], XmNmaximumValue, ACCESS_DIM(mask, nav_data->maximum) - 1); argCount++; } if (argCount) XtSetValues (spinW->composite.children[i], arglist, argCount); if (notify && ACCESS_DIM(mask, nav_data->value) != lastValue) ArrowCallback((Widget)spinW, NULL, XmCR_OK); /* mark the dimMask as x goes. So that if there is a second numeric child, it only gets y setting. If there was no X in the current mask, just stop here */ if (mask & NavigDimensionX) mask &= ~NavigDimensionX ; else mask = 0 ; } } } /****************************************************************************** * SpinNGetValue * Navigator GetValue Function. *****************************************************************************/ static void SpinNGetValue(Widget nav, XmNavigatorData nav_data) { XmSpinBoxConstraint spinC; XmSpinBoxWidget spinW; int i; int numericCount; Mask mask ; spinW = (XmSpinBoxWidget) nav; if (!(numericCount = NumericChildCount(spinW))) return; mask = nav_data->dimMask = spinW->spinBox.dim_mask; if (nav_data->valueMask & (NavValue|NavMinimum|NavMaximum|NavIncrement)) { /* get the value out of the numeric children, in order */ for (numericCount = 0, i = 0; i < SB_ChildCount(spinW) && numericCount < 2 && mask; i++) { spinC = SB_GetConstraintRec(spinW->composite.children[i]); if (SB_ChildIsNumeric(spinC)) { numericCount++; ASSIGN_DIM(mask, nav_data->value, spinC->position); ASSIGN_DIM(mask, nav_data->minimum, spinC->minimum_value); ASSIGN_DIM(mask, nav_data->maximum, spinC->maximum_value + 1); ASSIGN_DIM(mask, nav_data->increment, spinC->increment_value); mask &= ~NavigDimensionX ; } } } } /****************************************************************************** * GetPositionValue * XmExportProc conversion routine for converting between internal * and external representation for XmNposition resource. Internal * representation is always POSITION_VALUE. External representation * can be either POSITION_VALUE or POSITION_INDEX as determined * by XmNpositionType. *****************************************************************************/ static void GetPositionValue(Widget w, int offset, XtArgVal *value) { XmSpinBoxConstraint wc = SB_GetConstraintRec(w); if (SB_ChildIsNumeric(wc) && (!SB_ChildPositionTypeIsValue(wc))) *value = (*value - wc->minimum_value) / wc->increment_value; } /****************************************************************************** * SetPositionValue * XmImportProc conversion routine for converting between external * and internal representation for XmNposition resource. Internal * representation is always POSITION_VALUE. External representation * can be either POSITION_VALUE or POSITION_INDEX as determined * by XmNpositionType. *****************************************************************************/ static XmImportOperator SetPositionValue(Widget w, int offset, XtArgVal *value) { XmSpinBoxConstraint wc = SB_GetConstraintRec(w); if (SB_ChildIsNumeric(wc) && (!SB_ChildPositionTypeIsValue(wc))) *value = wc->minimum_value + (*value * wc->increment_value); return(XmSYNTHETIC_LOAD); } /****************************************************************************** * GetMaximumPositionValue * Returns the maximum allowable position for this widget. *****************************************************************************/ static int GetMaximumPositionValue(XmSpinBoxConstraint sc) { int max; if (sc == (XmSpinBoxConstraint) NULL) max = 0; else if (SB_ChildIsNumeric(sc)) max = sc->maximum_value; else max = (sc->num_values > 0) ? (sc->num_values - 1) : 0; return(max); } /****************************************************************************** * GetMinimumPositionValue * Returns the minimum allowable position for this widget. *****************************************************************************/ static int GetMinimumPositionValue(XmSpinBoxConstraint sc) { int min; if (sc == (XmSpinBoxConstraint) NULL) min = 0; else if (SB_ChildIsNumeric(sc)) min = sc->minimum_value; else min = 0; return(min); } /****************************************************************************** * ValidatePositionValue * Returns the minimum allowable position for this widget. *****************************************************************************/ static char * ValidatePositionValue(XmSpinBoxConstraint sc, int *position) { int val; char *err = (char *) NULL; val = SB_ChildMaximumPositionValue(sc); if (*position > val) { *position = val; err = BAD_SPIN_POSITION_MAX; } val = SB_ChildMinimumPositionValue(sc); if (*position < val) { *position = val; err = BAD_SPIN_POSITION_MIN; } return(err); } /*ARGSUSED*/ static Boolean CvtStringToPositionValue( Display *display, XrmValue *args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { XtArgVal value; int offset = XtOffset(XmSpinBoxConstraint, position); Widget w = *((Widget *) args[0].addr); if (sscanf(from->addr, "%ld", (long*)&value) == 0) { XtDisplayStringConversionWarning(display, (char *)from->addr, XmRPositionValue); return False; } (void) SetPositionValue(w, offset, &value); _XM_CONVERTER_DONE( to, int, (int)value, ; ) } /* * * Public API * */ /************************************************************************ * XmCreateSpinBox() * XmVaCreateSpinBox() * XmVaCreateManagedSpinBox() * Create an instance of a Spin widget and return the widget id. ************************************************************************/ Widget XmCreateSpinBox(Widget parent, String name, ArgList arglist, Cardinal argcount) { return(XtCreateWidget(name, xmSpinBoxWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateSpinBox( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSpinBoxWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedSpinBox( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSpinBoxWidgetClass, parent, True, var, count); va_end(var); return w; } /************************************************************************ * XmSpinBoxValidatePosition * Validate the position value specified in string. ************************************************************************/ int XmSpinBoxValidatePosition(Widget text_field, int *position) { int i; float fPosition; int iPosition; int positionOffset = XtOffset(XmSpinBoxConstraint, position); #ifdef FIX_1519 int iOffset; #endif String string; XmAccessTextualTrait textT; XmSpinBoxConstraint wc; XtAppContext app; if (text_field == (Widget) NULL) return(XmCURRENT_VALUE); app = XtWidgetToApplicationContext(text_field); _XmAppLock(app); textT = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(text_field), XmQTaccessTextual); if (textT == NULL) { _XmAppUnlock(app); return(XmCURRENT_VALUE); } wc = SB_GetConstraintRec(text_field); if ((wc == (XmSpinBoxConstraint) NULL) || (! SB_ChildIsNumeric(wc))) { if ((wc) && (position)) *position = wc->position; _XmAppUnlock(app); return(XmCURRENT_VALUE); } string = textT->getValue(text_field, XmFORMAT_MBYTE); if (sscanf(string, "%f", &fPosition) == 0) { if (position) { XtArgVal external_position = wc->position; GetPositionValue(text_field, positionOffset, &external_position); *position = (int)external_position; } _XmAppUnlock(app); return(XmCURRENT_VALUE); } XtFree(string); for (i=0; idecimal_points; i++) fPosition *= 10.0; iPosition = (int) fPosition; if (iPosition < SB_ChildMinimumPositionValue(wc)) { if (position) { XtArgVal external_position = SB_ChildMinimumPositionValue(wc); GetPositionValue(text_field, positionOffset, &external_position); *position = (int)external_position; } _XmAppUnlock(app); return(XmMINIMUM_VALUE); } if (iPosition > SB_ChildMaximumPositionValue(wc)) { if (position) { XtArgVal external_position = SB_ChildMaximumPositionValue(wc); GetPositionValue(text_field, positionOffset, &external_position); *position = (int)external_position; } _XmAppUnlock(app); return(XmMAXIMUM_VALUE); } #ifdef FIX_1519 iOffset = iPosition - SB_ChildMinimumPositionValue(wc); if ((iOffset % wc->increment_value) != 0) #else if ((iPosition % wc->increment_value) != 0) #endif { int iValue = wc->increment_value; if (position) { #ifdef FIX_1519 XtArgVal external_position = SB_ChildMinimumPositionValue(wc) + (iOffset / iValue) * iValue; #else XtArgVal external_position = (iPosition / iValue) * iValue; #endif GetPositionValue(text_field, positionOffset, &external_position); *position = (int)external_position; } _XmAppUnlock(app); return(XmINCREMENT_VALUE); } if (position) { XtArgVal external_position = iPosition; GetPositionValue(text_field, positionOffset, &external_position); *position = (int)external_position; } _XmAppUnlock(app); return(XmVALID_VALUE); } motif-2.3.8/lib/Xm/ToolTipCT.h0000644000175000017500000000202612672140200012701 00000000000000/** * * $Id: ToolTipCT.h,v 1.1 2004/11/18 08:54:33 yura Exp $ * **/ #ifndef _XmToolTipCT_H #define _XmToolTipCT_H #ifdef __cplusplus extern "C" { #endif #include externalref XrmQuark XmQTtoolTipConfig; /* Trait structures and typedefs, place typedefs first */ typedef struct _XmToolTipConfigTraitRec { int version; Widget label; /* XmLabel for the tips */ int post_delay; /* delay before posting XmNtoolTipPostDelay */ int post_duration; /* duration XmNtoolTipPostDuration */ XtIntervalId timer; /* timer for post delay */ XtIntervalId duration_timer; /* timer for duration */ Time leave_time; /* time of the last leave event */ Widget slider; /* the XmSlideContext used to slide in the tip */ Boolean enable; /* flag to disable all this stuff */ } XmToolTipConfigTraitRec, *XmToolTipConfigTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmToolTipCT_H */ motif-2.3.8/lib/Xm/BitmapsI.h0000644000175000017500000001440013145162623012600 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /*************************************<+>************************************* ***************************************************************************** ** ** File: BitmapsI.h ** ** Description: This file contains a set of predefines bitmaps ** which are used by the image caching functions. ** **************************************************************************** ************************************<+>*************************************/ #ifndef _XmBitmapsI_h #define _XmBitmapsI_h #include #ifdef __cplusplus extern "C" { #endif static XmConst unsigned char bitmaps [20][32] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Solid Background */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, /* 25 percent */ 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22 }, { 0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA, /* 50 percent */ 0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA }, { 0x55, 0x55, 0xFF, 0xFF, 0xAA, 0xAA, 0xFF, 0xFF, /* 75 percent */ 0x55, 0x55, 0xFF, 0xFF, 0xAA, 0xAA, 0xFF, 0xFF, 0x55, 0x55, 0xFF, 0xFF, 0xAA, 0xAA, 0xFF, 0xFF, 0x55, 0x55, 0xFF, 0xFF, 0xAA, 0xAA, 0xFF, 0xFF }, { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, /* Vertical tile */ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 }, { 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, /* Horizontal tile */ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }, { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, /* Vertical */ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 }, { 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, /* Horizontal */ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 }, { 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee, /* Slant Left */ 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee, 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee, 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee }, { 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77, /* Slant Right */ 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77, 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77, 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default Cascade */ 0x00, 0x03, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x18, 0xff, 0x3f, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default RtoL Cascade*/ 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0xfc, 0xff, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default CheckMark */ 0x00, 0x00, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x08, 0x06, 0x18, 0x03, 0xb0, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Default menu dash */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x3c, 0x00, /* collapsed */ 0xfc, 0x00, 0xfc, 0x03, 0xfc, 0x0f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x0f, 0xfc, 0x03, 0xfc, 0x00, 0x3c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x3c, /* collapsed_rtol */ 0x00, 0x3f, 0xc0, 0x3f, 0xf0, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf0, 0x3f, 0xc0, 0x3f, 0x00, 0x3f, 0x00, 0x3c, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xfc, 0x3f, /* expanded */ 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00 } }; static XmConst char *XmConst bitmap_name_set[] = { "background", "25_foreground", XmS50_foreground, "75_foreground", "vertical_tile", "horizontal_tile", /* for bc reason with 1.2.2, we have to put back the old names, but we also need to keep the new ones, for 1.2.3 users */ "vertical", "horizontal", "slant_right", "slant_left", "menu_cascade", "menu_cascade_rtol", "menu_checkmark", "menu_dash", "collapsed", "collapsed_rtol", "expanded", }; #define MAX_BUILTIN_IMAGES 17 #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmBitmapsI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Notebook.c0000644000175000017500000065002012672140200012636 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "CareVisualTI.h" #include "ColorI.h" #include "GeoUtilsI.h" #include "GMUtilsI.h" #include "MessagesI.h" #include "RegionI.h" #include "RepTypeI.h" #include "ScrollFramTI.h" #include "XmI.h" #define MESSAGE0 _XmMMsgNotebook_0000 #define MESSAGE1 _XmMMsgMotif_0001 /* Under SunOS /usr/include/sys/sysmacros.h (included by types.h) */ /* thoughtfully grabs part of our name space. */ #ifdef major #undef major #endif #ifdef minor #undef minor #endif /***************************************************************************** * * * constants & useful macros * * * *****************************************************************************/ /* names of notebook internal children */ #define MAJOR_TAB_NEXT_NAME "MajorTabScrollerNext" #define MAJOR_TAB_PREV_NAME "MajorTabScrollerPrevious" #define MINOR_TAB_NEXT_NAME "MinorTabScrollerNext" #define MINOR_TAB_PREV_NAME "MinorTabScrollerPrevious" #define PAGE_SCROLLER_NAME "PageScroller" #define NB_TEXT_FIELD_NAME "NBTextField" /* status values for notebook.scroller_status */ #define DEFAULT_NONE 0 /* default is not created yet */ #define DEFAULT_CREATE 1 /* default being created */ #define DEFAULT_USED 2 /* default is being used */ #define DEFAULT_GONE 3 /* default is destroyed */ /* Notebook position value */ #define LEFT 0 #define RIGHT 1 #define TOP 2 #define BOTTOM 4 /* tab traversal value */ #define _HOME 0 #define _END 1 #define _NEXT 2 #define _PREVIOUS 3 #define _FIRST_VISIBLE 4 /* For KNextTab/KPrevTab, scrolling */ #define _LAST_VISIBLE 5 /* For tab scrolling */ #define _CURRENT_VISIBLE 6 /* For tab group traversal */ /* status values for drawing minor tabs */ #define TAB_DRAW 0 /* tab is to be drawn */ #define TAB_DRAWING 1 /* tab is being drawn */ #define TAB_DRAWN 2 /* tab has been drawn */ /* XmNotebook default values */ #define FIRST_PAGE_NUMBER_DEFAULT 1 #define BACK_PAGE_NUMBER_DEFAULT 2 #define BACK_PAGE_SIZE_DEFAULT 8 #define BINDING_WIDTH_DEFAULT 25 #define MARGIN_WIDTH_DEFAULT 0 #define MARGIN_HEIGHT_DEFAULT 0 #define MAJOR_TAB_SPACING_DEFAULT 3 #define MINOR_TAB_SPACING_DEFAULT 3 #define TAB_SCROLLER_WIDTH_DEFAULT 20 #define TAB_SCROLLER_HEIGHT_DEFAULT 20 #define NOTEBOOK_MINIMUM_WIDTH 16 #define NOTEBOOK_MINIMUM_HEIGHT 16 #define MIN_DRAWABLE_SPIRAL_SIZE 6 /* macros */ #define NB_IS_CHILD_NONE(x) \ ((unsigned char)x == XmNONE) #define NB_IS_CHILD_PAGE(x) \ ((unsigned char)x == XmPAGE) #define NB_IS_CHILD_MAJOR(x) \ ((unsigned char)x == XmMAJOR_TAB) #define NB_IS_CHILD_MINOR(x) \ ((unsigned char)x == XmMINOR_TAB) #define NB_IS_CHILD_TAB(x) \ (((unsigned char)x == XmMAJOR_TAB) \ || ((unsigned char)x == XmMINOR_TAB)) #define NB_IS_CHILD_STATUS(x) \ ((unsigned char)x == XmSTATUS_AREA) #define NB_IS_CHILD_PAGE_SCROLLER(x) \ ((unsigned char)x == XmPAGE_SCROLLER) #define NB_IS_CHILD_MAJOR_SCROLLER(x) \ (((unsigned char)x == XmMAJOR_TAB_SCROLLER) \ || ((unsigned char)x == XmTAB_SCROLLER)) #define NB_IS_CHILD_MINOR_SCROLLER(x) \ (((unsigned char)x == XmMINOR_TAB_SCROLLER) \ || ((unsigned char)x == XmTAB_SCROLLER)) /* Layout defines */ #define NB_IS_VISIBLE(w) \ ((XtIsManaged(w) && \ ((w)->core.x > -(int)((w)->core.width + (w)->core.border_width * 2)) && \ ((w)->core.y > -(int)((w)->core.height + (w)->core.border_width * 2)))) #define NB_IS_HIDDEN(w) \ (((w)->core.x <= -(int)((w)->core.width + (w)->core.border_width * 2)) && \ ((w)->core.y <= -(int)((w)->core.height + (w)->core.border_width * 2))) #define NB_ENFORCE_SIGN(s,x) ((s) > 0 ? (x) : -(x)) /* Fixed placement of non-top minor tabs */ #define NB_MINOR_TAB_STEP(x) ((x) /2) /* Max dimension of major tab area, i.e., max of tab and tab scroller dimension */ #define NB_MAJOR_MAX(n,x,y) (MAX((x), (y))) /* MAX(0, (n)->notebook.shadow_thickness - (n)->notebook.back_page_size)) */ /* Max dimension of minor tab area, i.e., max of tab (minus fixed placement) and tab scroller dimension */ #define NB_MINOR_MAX(n,x,y) \ (MAX((int)((x) - NB_MINOR_TAB_STEP((n)->notebook.back_page_size)),(int)(y))) /* MAX(0, (n)->notebook.shadow_thickness - (n)->notebook.back_page_size)) */ /* Retrieve trait defines */ #define NB_SCROLL_FRAME(x) \ ((XmScrollFrameTrait)XmeTraitGet((XtPointer)XtClass((Widget)(x)), \ XmQTscrollFrame)) #define NB_ACTIVATABLE(x) \ ((XmActivatableTrait)XmeTraitGet((XtPointer)XtClass((Widget)(x)), \ XmQTactivatable)) #define NB_NAVIGATOR(x) \ ((XmNavigatorTrait)XmeTraitGet((XtPointer)XtClass((Widget)(x)), \ XmQTnavigator)) #define NB_JOINSIDE(x) \ ((XmJoinSideTrait)XmeTraitGet((XtPointer)XtClass((Widget)(x)), \ XmQTjoinSide)) /* Is trait defines */ #define NB_IS_CHILD_ACTIVATABLE(x) \ (((XmeTraitGet((XtPointer)XtClass(x),XmQTactivatable)) != NULL) \ ? True : False) #define NB_IS_CHILD_NAVIGATOR(x) \ (((XmeTraitGet((XtPointer)XtClass(x),XmQTnavigator)) != NULL) \ ? True : False) #define NB_IS_CHILD_JOINSIDE(x) \ (((XmeTraitGet((XtPointer)XtClass(x),XmQTjoinSide)) != NULL) \ ? True : False) #define NB_IS_CHILD_ACCESSTEXTUAL(x) \ (((XmeTraitGet((XtPointer)XtClass(x),XmQTaccessTextual)) != NULL) \ ? True : False) #define NotebookConstraint(w) \ (&((XmNotebookConstraintPtr) (w)->core.constraints)->notebook) /* If the original dimension is negative, then offset the original position by that negative amount and make it the new position. Also make the new dimension be the positive original dimension. So for instance, if the x value is 20 and the width is -10, then make the x value be 10 and the width be positive 10. If the original dimension is not negative, then just set the new values to be the same as the old values. */ #define ADJUST_NEGATIVE_DIMENSION(orig_pos, orig_dim, new_pos, new_dim) \ if (orig_dim < 0) \ { \ new_pos = orig_pos + orig_dim; \ new_dim = (Dimension) (orig_dim * -1) ; \ } \ else \ { \ new_pos = orig_pos; \ new_dim = (Dimension) orig_dim; \ } #define manager_translations _XmNotebook_manager_translations /***************************************************************************** * * * global variables * * * *****************************************************************************/ static XtAccelerators TabAcceleratorsParsed; /***************************************************************************** * * * Static function declarations * * * *****************************************************************************/ /* synthetic hook */ static void GetDefaultFrameBackground( Widget g, int offset, XrmValue *value) ; static void GetDefaultBackPageBackground( Widget g, int offset, XrmValue *value) ; static void GetDefaultBackPagePos( Widget w, int offset, XrmValue *value) ; static void FromOrientationPixels( Widget w, int offset, XtArgVal *value) ; static XmImportOperator ToOrientationPixels( Widget w, int offset, XtArgVal *value) ; static void FromOrientationOppositePixels( Widget w, int offset, XtArgVal *value) ; static XmImportOperator ToOrientationOppositePixels( Widget w, int offset, XtArgVal *value) ; /* core class method */ static void ClassInitialize ( void) ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num) ; static void Destroy( Widget w) ; static void Resize( Widget w) ; static void Redisplay( Widget w, XEvent *e, Region region) ; static Boolean SetValues( Widget ow, Widget rw, Widget nw, ArgList args, Cardinal *num) ; static XtGeometryResult QueryGeometry( Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *desired) ; static XtGeometryResult GeometryManager( Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget w) ; static void InsertChild( Widget child) ; static void DeleteChild( Widget child) ; static void ConstraintInitialize( Widget req, Widget new_w, ArgList args, Cardinal *num) ; static void CreateTabScrollers( XmNotebookWidget nb) ; static void SetVisualConfig( XmNotebookWidget nb) ; static Boolean UpdateJoinSide( XmNotebookWidget nb, Widget child, unsigned char child_type, Dimension shadow_thickness) ; static void UpdateJoinSideChildren( XmNotebookWidget nb, Dimension shadow_thickness) ; static void SetPageScroller( XmNotebookWidget nb) ; static void LayoutChildren( XmNotebookWidget nb, Widget instigator) ; static void LayoutPages( XmNotebookWidget nb, Widget instigator) ; static void LayoutMajorTabs( XmNotebookWidget nb, Widget instigator) ; static void LayoutMinorTabs( XmNotebookWidget nb, Widget instigator) ; static void ResetTopPointers( XmNotebookWidget nb, unsigned char reason, int scroll) ; static void GetFrameGCs( XmNotebookWidget nb) ; static void GetBackpageGCs( XmNotebookWidget nb) ; static void DrawBinding( XmNotebookWidget nb, XExposeEvent *event, Region region) ; static void MakeSpiralPixmap( XmNotebookWidget nb, Dimension width, Dimension height) ; static void DrawPixmapBinding( XmNotebookWidget nb, Dimension x, Dimension y, Dimension width, Dimension height, Pixmap pixmap) ; static void DrawFrameShadow( XmNotebookWidget nb, XExposeEvent *event, Region region) ; static void DrawBackPages( XmNotebookWidget nb, XExposeEvent *event, Region region) ; static Boolean NewPreferredGeometry( XmNotebookWidget nb, Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *preferred) ; static void AdjustGeometry( XmNotebookWidget nb, Widget instigator, XtWidgetGeometry *desired) ; static Boolean SetLastPageNumber ( XmNotebookWidget nb, int last_page_number) ; static Boolean AssignDefaultPageNumber( XmNotebookWidget nb) ; static Boolean ConstraintSetValues( Widget old_w, Widget req, Widget new_w, ArgList args, Cardinal *num) ; static void SetActiveChildren( XmNotebookWidget nb) ; static void RepositionChild( XmNotebookWidget nb, Widget child) ; static void SortChildren( XmNotebookWidget nb) ; static int GetNextAvailPageNum( XmNotebookWidget nb, int last) ; static Widget GetChildWidget( XmNotebookWidget nb, int page_number, unsigned char child_type) ; static void GotoPage( XmNotebookWidget nb, int page_number, XEvent *event, int reason) ; static void ShowChild( Widget child, Widget instigator, int x, int y, int width, int height) ; static void HideChild( Widget child, Widget instigator) ; static void HideShadowedTab( XmNotebookWidget nb, Widget child) ; static void FlipTabs( Widget w, XtPointer data, XtPointer call_data) ; static void TabPressed( Widget w, XtPointer data, XtPointer call_data) ; static void TraverseTab( Widget w, XEvent *event, String *params, Cardinal *num_params) ; static Widget GetNextTab( XmNotebookWidget nb, unsigned char child_type, int page_number, unsigned char direction) ; static Boolean MaxIsRightUp( XmNotebookWidget nb, unsigned char child_type) ; static void ScrollFrameInit( Widget w, XtCallbackProc moveCB, Widget scrollable) ; static Boolean ScrollFrameGetInfo( Widget w, Cardinal *dimension, Widget **nav_list, Cardinal *num_nav_list) ; static void AddNavigator( Widget w, Widget nav, Mask dimMask) ; static void RemoveNavigator( Widget w, Widget nav) ; static void PageMove( Widget w, XtPointer data, XtPointer call_data) ; static Widget RedirectTraversal( Widget old_focus, Widget new_focus, unsigned int focus_policy, XmTraversalDirection direction, unsigned int pass) ; static void UpdateNavigators( XmNotebookWidget nb) ; static GC GetUnhighlightGC( Widget w, Widget child) ; static unsigned char GetDefaultBackPagePosAgain( Widget w); /***************************************************************************** * * * Action Records * * * *****************************************************************************/ static XtActionsRec tab_actions_list[] = { {"TraverseTab", TraverseTab}, }; /***************************************************************************** * * * Resources * * * *****************************************************************************/ static XtResource resources[] = { { XmNcurrentPageNumber, XmCCurrentPageNumber, XmRInt, sizeof(int), XtOffsetOf(XmNotebookRec, notebook.current_page_number), XmRImmediate, (XtPointer)XmUNSPECIFIED_PAGE_NUMBER }, { XmNfirstPageNumber, XmCFirstPageNumber, XmRInt, sizeof(int), XtOffsetOf(XmNotebookRec, notebook.first_page_number), XmRImmediate, (XtPointer)FIRST_PAGE_NUMBER_DEFAULT, }, { XmNlastPageNumber, XmCLastPageNumber, XmRInt, sizeof(int), XtOffsetOf(XmNotebookRec, notebook.last_page_number), XmRImmediate, (XtPointer)XmUNSPECIFIED_PAGE_NUMBER }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf(XmNotebookRec, notebook.orientation), XmRImmediate, (XtPointer)XmHORIZONTAL }, { XmNframeBackground, XmCFrameBackground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmNotebookRec, notebook.frame_background), XmRCallProc, (XtPointer) GetDefaultFrameBackground }, { XmNbackPagePlacement, XmCBackPagePlacement, XmRScrollBarPlacement, sizeof(unsigned char), XtOffsetOf(XmNotebookRec, notebook.back_page_pos), XmRCallProc, (XtPointer)GetDefaultBackPagePos }, { XmNbackPageNumber, XmCBackPageNumber, XmRCardinal, sizeof(Cardinal), XtOffsetOf(XmNotebookRec, notebook.back_page_number), XmRImmediate, (XtPointer)BACK_PAGE_NUMBER_DEFAULT }, { XmNbackPageSize, XmCBackPageSize, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.back_page_size), XmRImmediate, (XtPointer)BACK_PAGE_SIZE_DEFAULT }, { XmNbackPageForeground, XmCBackPageForeground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmNotebookRec, notebook.back_page_foreground), XmRCallProc, (XtPointer)_XmForegroundColorDefault }, { XmNbackPageBackground, XmCBackPageBackground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmNotebookRec, notebook.back_page_background), XmRCallProc, (XtPointer)GetDefaultBackPageBackground }, { XmNbindingType, XmCBindingType, XmRBindingType, sizeof(unsigned char), XtOffsetOf(XmNotebookRec, notebook.binding_type), XmRImmediate, (XtPointer)XmSPIRAL }, { XmNbindingPixmap, XmCBindingPixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmNotebookRec, notebook.binding_pixmap), XmRImmediate, (XtPointer)XmUNSPECIFIED_PIXMAP }, { XmNbindingWidth, XmCBindingWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.binding_width), XmRImmediate, (XtPointer)BINDING_WIDTH_DEFAULT }, { XmNinnerMarginWidth, XmCInnerMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.margin_width), XmRImmediate, (XtPointer)MARGIN_WIDTH_DEFAULT }, { XmNinnerMarginHeight, XmCInnerMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.margin_height), XmRImmediate, (XtPointer)MARGIN_HEIGHT_DEFAULT }, { XmNmajorTabSpacing, XmCMajorTabSpacing, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.major_spacing), XmRImmediate, (XtPointer)MAJOR_TAB_SPACING_DEFAULT }, { XmNminorTabSpacing, XmCMinorTabSpacing, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.minor_spacing), XmRImmediate, (XtPointer)MINOR_TAB_SPACING_DEFAULT }, { XmNframeShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNpageChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmNotebookRec, notebook.page_change_callback), XmRPointer, (XtPointer)NULL } }; static XtResource constraint_resources[] = { { XmNnotebookChildType, XmCNotebookChildType, XmRNotebookChildType, sizeof(unsigned char), XtOffsetOf(XmNotebookConstraintRec, notebook.child_type), XmRImmediate, (XtPointer)XmNONE }, { XmNpageNumber, XmCPageNumber, XmRInt, sizeof(int), XtOffsetOf(XmNotebookConstraintRec, notebook.page_number), XmRImmediate, (XtPointer)XmUNSPECIFIED_PAGE_NUMBER }, { XmNresizable, XmCResizable, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmNotebookConstraintRec, notebook.resizable), XmRImmediate, (XtPointer)True } }; static XmSyntheticResource syn_resources[] = { { XmNbackPageSize, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.back_page_size), XmeFromHorizontalPixels,XmeToHorizontalPixels }, { XmNbindingWidth, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.binding_width), FromOrientationPixels,ToOrientationPixels }, { XmNinnerMarginWidth, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.margin_width), XmeFromHorizontalPixels,XmeToHorizontalPixels }, { XmNinnerMarginHeight, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.margin_height), XmeFromVerticalPixels,XmeToVerticalPixels }, { XmNmajorTabSpacing, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.major_spacing), FromOrientationOppositePixels,ToOrientationOppositePixels }, { XmNminorTabSpacing, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.minor_spacing), FromOrientationPixels,ToOrientationPixels }, { XmNframeShadowThickness, sizeof(Dimension), XtOffsetOf(XmNotebookRec, notebook.shadow_thickness), XmeFromHorizontalPixels,XmeToHorizontalPixels } }; /***************************************************************************** * * * Notebook class record definition * * * *****************************************************************************/ externaldef(xmnotebookclassrec) XmNotebookClassRec xmNotebookClassRec = { /* core class record */ { (WidgetClass)&xmManagerClassRec, /* superclass */ "XmNotebook", /* class_name */ sizeof(XmNotebookRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ tab_actions_list, /* actions */ XtNumber(tab_actions_list), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress enterleave */ TRUE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_value_almost */ NULL, /* get_values_hook */ NULL, /* accept focus */ XtVersion, /* current version */ NULL, /* callback private */ XtInheritTranslations, /* translation table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator */ NULL /* extension */ }, /* Composite class record */ { GeometryManager, /* childrens geometry_manager */ ChangeManaged, /* change_managed */ InsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL /* extension */ }, /* Constraint class record */ { constraint_resources, /* constraint resource */ XtNumber(constraint_resources), /* number of constraints */ sizeof(XmNotebookConstraintRec), /* size of constraint */ ConstraintInitialize, /* initialization */ NULL, /* destroy proc */ ConstraintSetValues, /* set_values proc */ NULL /* extension */ }, /* Manager class record */ { manager_translations, /* translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* get_cont_resources */ 0, /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL /* extension */ }, /* Notebook class record */ { NULL /* unused */ } }; externaldef(xmnotebookwidgetclass) WidgetClass xmNotebookWidgetClass = (WidgetClass) &xmNotebookClassRec; /* Trait record for Notebook scrollFrame */ static XmConst XmScrollFrameTraitRec notebookSFT = { 1, /* version */ ScrollFrameInit, /* initialize */ ScrollFrameGetInfo, /* get trait info */ AddNavigator, /* add navigator method */ RemoveNavigator, /* remove navigator method */ NULL /* update original geometry */ }; /* Trait record for Notebook traversalControl */ static XmConst XmTraversalControlTraitRec notebookTCT = { 0, /* version */ RedirectTraversal /* redirect */ }; /* Trait record for Notebook specifyUnhighlight */ static XmConst XmSpecifyUnhighlightTraitRec notebookSUT = { 0, /* version */ GetUnhighlightGC /* getUnhighlightGC */ }; /***************************************************************************** * * * Core method functions * * * *****************************************************************************/ /*- ClassInitialize --------------------------------------------------------- This routine is invoked only once. -----------------------------------------------------------------------------*/ static void ClassInitialize(void) { /* Parse the default accelerator table */ TabAcceleratorsParsed = XtParseAcceleratorTable( _XmNotebook_TabAccelerators ); } /*- ClassPartInitialize ----------------------------------------------------- Set up the fast subclassing for the widget and install traits -----------------------------------------------------------------------------*/ static void ClassPartInitialize ( WidgetClass wc) { _XmFastSubclassInit(wc, XmNOTEBOOK_BIT); XmeTraitSet((XtPointer)wc,XmQTscrollFrame,(XtPointer)¬ebookSFT); XmeTraitSet((XtPointer)wc,XmQTtraversalControl,(XtPointer)¬ebookTCT); XmeTraitSet((XtPointer)wc,XmQTspecifyUnhighlight,(XtPointer)¬ebookSUT); } /*- Initialize -------------------------------------------------------------- Initialize method -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void Initialize ( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num) /* unused */ { XmNotebookWidget new_w = (XmNotebookWidget)nw; XmScrollFrameTrait scroll_frameT; /* XmNaccelerators */ new_w->core.accelerators = TabAcceleratorsParsed; /* XmNorientation */ if (!XmRepTypeValidValue(XmRID_ORIENTATION,new_w->notebook.orientation,nw)) new_w->notebook.orientation = XmHORIZONTAL; /* XmNbackPagePlacement */ if (!XmRepTypeValidValue(XmRID_SCROLL_BAR_PLACEMENT, new_w->notebook.back_page_pos, nw)) new_w->notebook.back_page_pos = GetDefaultBackPagePosAgain(nw); /* XmNbindingType */ if (!XmRepTypeValidValue(XmRID_BINDING_TYPE, new_w->notebook.binding_type, nw)) new_w->notebook.binding_type = XmSOLID; /* set tab and binding positions */ SetVisualConfig(new_w); /* page number resources */ /* fix BUX 1183 in notebook widget, the real_back_page_number is used * for division, however it is never set unless the back_page_number * changed (in SetValues). */ ASSIGN_MIN(new_w->notebook.real_back_page_number, (Dimension)(new_w->notebook.back_page_size /2)); ASSIGN_MAX(new_w->notebook.real_back_page_number, 1); if (new_w->notebook.current_page_number == XmUNSPECIFIED_PAGE_NUMBER) new_w->notebook.current_page_number = new_w->notebook.first_page_number; if (new_w->notebook.last_page_number == XmUNSPECIFIED_PAGE_NUMBER) { new_w->notebook.last_page_number = new_w->notebook.first_page_number; new_w->notebook.dynamic_last_page_num = True; } else new_w->notebook.dynamic_last_page_num = False; new_w->notebook.last_alloc_num = new_w->notebook.first_page_number; /* intialize variables for layouting tabs */ new_w->notebook.first_major = NULL; new_w->notebook.old_top_major = NULL; new_w->notebook.top_major = NULL; new_w->notebook.last_major = NULL; new_w->notebook.first_minor = NULL; new_w->notebook.old_top_minor = NULL; new_w->notebook.top_minor = NULL; new_w->notebook.last_minor = NULL; new_w->notebook.constraint_child = NULL; /* shadow thickness state for current page major and minor tab */ new_w->notebook.major_shadow_thickness = (Dimension) 0; new_w->notebook.minor_shadow_thickness = (Dimension) 0; new_w->notebook.in_setshadow = False; new_w->notebook.major_shadow_child = NULL; new_w->notebook.minor_shadow_child = NULL; /* other misc. variables */ new_w->notebook.which_tab = XmMAJOR_TAB; new_w->notebook.scroller_status = DEFAULT_NONE; new_w->notebook.need_scroller = XmNONE; new_w->notebook.scroller = NULL; new_w->notebook.scroller_child = NULL; new_w->notebook.in_callback = False; new_w->notebook.frame_gc = NULL; new_w->notebook.binding_gc = NULL; new_w->notebook.background_gc = NULL; new_w->notebook.foreground_gc = NULL; new_w->notebook.spiral_pixmap = XmUNSPECIFIED_PIXMAP; /* initialize the scroll_frame and change_managed flags */ new_w->notebook.scroll_frame_data = NULL; new_w->notebook.first_change_managed = True; /* initialize the scrollFrame with move callback (subclass trait check) */ if (((scroll_frameT=NB_SCROLL_FRAME(nw)) != NULL) && (scroll_frameT->init != NULL) ) scroll_frameT->init(nw, PageMove, nw); /* creating GCs */ GetFrameGCs(new_w); GetBackpageGCs(new_w); /* create tab scrollers */ CreateTabScrollers(new_w); SetPageScroller(new_w); } /*- Destroy ----------------------------------------------------------------- Destroy the widget and its children -----------------------------------------------------------------------------*/ static void Destroy ( Widget w) { XmNotebookWidget nb = (XmNotebookWidget)w; /* release all GCs */ if (nb->notebook.frame_gc) XtReleaseGC(w, nb->notebook.frame_gc); if (nb->notebook.binding_gc) XtReleaseGC(w,nb->notebook.binding_gc); if (nb->notebook.foreground_gc) XtReleaseGC(w,nb->notebook.foreground_gc); if (nb->notebook.background_gc) XtReleaseGC(w,nb->notebook.background_gc); /* release spiral pixmap */ if (nb->notebook.spiral_pixmap != XmUNSPECIFIED_PIXMAP && nb->notebook.spiral_pixmap != XmNONE) XFreePixmap(XtDisplay(w), nb->notebook.spiral_pixmap); /* release scroll frame data */ if (nb->notebook.scroll_frame_data != NULL) XtFree((char*)nb->notebook.scroll_frame_data); } /*- Resize ----------------------------------------------------------------- Resize the widget -----------------------------------------------------------------------------*/ static void Resize ( Widget w) { XmNotebookWidget nb = (XmNotebookWidget)w; /* Adjust notebook children sizes based on notebook size */ AdjustGeometry(nb, NULL, NULL); /* Layout children based on notebook sizes */ LayoutChildren(nb, NULL); if (XtIsRealized(w)) XClearArea(XtDisplay(w),XtWindow(w),0,0,0,0,True); } /*- Redisplay --------------------------------------------------------------- Method for expose event -----------------------------------------------------------------------------*/ static void Redisplay ( Widget w, XEvent *e, Region region) { XmNotebookWidget nb = (XmNotebookWidget)w; XExposeEvent *event = (XExposeEvent *)e; Widget child; /* fix for CR8959, hack for CR9805 */ int i; /* fix for CR8959, hack for CR9805 */ int total_major_tabs,total_minor_tabs; XmNotebookConstraint nc; total_major_tabs = 0; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (NB_IS_CHILD_MAJOR(nc->child_type)) total_major_tabs++; } if (total_major_tabs > 0 ) { XtManageChild(nb->notebook.prev_major); XtManageChild(nb->notebook.next_major); } else { XtUnmanageChild(nb->notebook.prev_major); XtUnmanageChild(nb->notebook.next_major); } total_minor_tabs = 0; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (NB_IS_CHILD_MAJOR(nc->child_type)) total_minor_tabs++; } if (total_minor_tabs > 0 ) { XtManageChild(nb->notebook.prev_minor); XtManageChild(nb->notebook.next_minor); } else { XtUnmanageChild(nb->notebook.prev_minor); XtUnmanageChild(nb->notebook.next_minor); } /* draw the background */ DrawBackPages(nb, event, region); DrawBinding(nb, event, region); DrawFrameShadow(nb, event, region); /* display gadgets */ XmeRedisplayGadgets(w,e,region); /* Work-around due to PushBG not updating border highlight -- to be removed when PushBG is fixed, see CR9805 */ for (i=0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; if ( (NB_IS_CHILD_TAB(NotebookConstraint(child)->child_type)) && (NotebookConstraint(child)->active) && (XmIsPushButtonGadget((child)))) { (*(xmPushButtonGadgetClassRec.gadget_class.border_unhighlight))((child)); } } } /*- SetValues --------------------------------------------------------------- Set notebook widget resources -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static Boolean SetValues ( Widget ow, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num) /* unused */ { XmNotebookWidget old = (XmNotebookWidget) ow; XmNotebookWidget new_w = (XmNotebookWidget) nw; Boolean redraw = False; Boolean updateJoin = False; Boolean updateVisual = False; Boolean relayout = False; Mask visualFlag = NoVisualChange; /* XmNorientation */ if (new_w->notebook.orientation != old->notebook.orientation) { if (!XmRepTypeValidValue(XmRID_ORIENTATION, new_w->notebook.orientation, nw)) new_w->notebook.orientation = old->notebook.orientation; } /* XmNbackPagePlacement */ if (new_w->notebook.back_page_pos != old->notebook.back_page_pos) { if (!XmRepTypeValidValue(XmRID_SCROLL_BAR_PLACEMENT, new_w->notebook.back_page_pos, nw)) new_w->notebook.back_page_pos = old->notebook.back_page_pos; } /* XmNbindingType */ if (new_w->notebook.binding_type != old->notebook.binding_type) { if (!XmRepTypeValidValue(XmRID_BINDING_TYPE, new_w->notebook.binding_type, nw)) new_w->notebook.binding_type = old->notebook.binding_type; } /* XmNcurrentPageNumber */ /* current page must be in the page number range */ ASSIGN_MAX(new_w->notebook.current_page_number, new_w->notebook.first_page_number); ASSIGN_MIN(new_w->notebook.current_page_number, new_w->notebook.last_page_number); /* XmNlastPageNumber */ /* set static last page number, if the last page number is set */ if (new_w->notebook.last_page_number != old->notebook.last_page_number) new_w->notebook.dynamic_last_page_num = False; /* XmNfirstPageNumber */ /* re-determine active children, if page number range has been changed */ if (new_w->notebook.first_page_number != old->notebook.first_page_number || new_w->notebook.last_page_number != old->notebook.last_page_number) { /* Update navigators, unless GotoPage() will */ if (new_w->notebook.current_page_number == old->notebook.current_page_number) UpdateNavigators(new_w); SetActiveChildren(new_w); } /* if XmNcurrentPageNumber is changed, go to the new page */ if (new_w->notebook.current_page_number != old->notebook.current_page_number) { int page_number; page_number = new_w->notebook.current_page_number; new_w->notebook.current_page_number = old->notebook.current_page_number; GotoPage(new_w, page_number, NULL, XmCR_NONE); } /* * Notebook visuals */ /* XmNorientation, XmNbackPagePlacement */ if (new_w->notebook.orientation != old->notebook.orientation || new_w->notebook.back_page_pos != old->notebook.back_page_pos) { updateVisual = True; updateJoin = True; } /* XmNframeShadowThickness */ if (new_w->notebook.shadow_thickness != old->notebook.shadow_thickness) updateJoin = True; /* XmNbackPageNumber */ if (new_w->notebook.back_page_number != old->notebook.back_page_number) { /* set the real back page number */ new_w->notebook.real_back_page_number = new_w->notebook.back_page_number; ASSIGN_MIN(new_w->notebook.real_back_page_number, (Dimension)(new_w->notebook.back_page_size /2)); ASSIGN_MAX(new_w->notebook.real_back_page_number, 1); if (new_w->notebook.real_back_page_number != old->notebook.real_back_page_number) redraw = True; } /* XmNframeBackground */ if (new_w->notebook.frame_background != old->notebook.frame_background || new_w->manager.foreground != old->manager.foreground) { GetFrameGCs(new_w); visualFlag |= (VisualHighlightColor|VisualHighlightPixmap); } /* XmNbackPageBackground, XmNbackPageForeground */ if (new_w->notebook.back_page_background != old->notebook.back_page_background || new_w->notebook.back_page_foreground != old->notebook.back_page_foreground) GetBackpageGCs(new_w); /* Set new size, if necessary */ if (XtIsRealized((Widget)new_w) && (new_w->notebook.orientation != old->notebook.orientation || new_w->notebook.back_page_pos != old->notebook.back_page_pos || new_w->notebook.back_page_size != old->notebook.back_page_size || new_w->notebook.binding_type != old->notebook.binding_type || new_w->notebook.binding_width != old->notebook.binding_width || new_w->notebook.first_page_number != old->notebook.first_page_number || new_w->notebook.last_page_number != old->notebook.last_page_number || new_w->notebook.margin_width != old->notebook.margin_width || new_w->notebook.margin_height != old->notebook.margin_height || new_w->notebook.major_spacing != old->notebook.major_spacing || new_w->notebook.minor_spacing != old->notebook.minor_spacing || new_w->notebook.shadow_thickness != old->notebook.shadow_thickness)) { relayout = True; redraw = True; } /* if visual is changed, redraw */ if (new_w->notebook.frame_background != old->notebook.frame_background || new_w->notebook.binding_pixmap != old->notebook.binding_pixmap || new_w->notebook.back_page_foreground != old->notebook.back_page_foreground || new_w->notebook.back_page_background != old->notebook.back_page_background) { redraw = True; } if (updateVisual) SetVisualConfig(new_w); if (updateJoin) UpdateJoinSideChildren (new_w, (Dimension) 0); if (relayout) { Dimension save_width, save_height; XtWidgetGeometry preferred_geo; /* Store new w/h, restore old w/h, and adjust geometry to the old */ save_width = XtWidth(new_w); save_height = XtHeight(new_w); XtWidth(new_w) = XtWidth(old); XtHeight(new_w) = XtHeight(old); /* Adjust notebook's children type sizes to old size */ AdjustGeometry(new_w, NULL, NULL); /* Layout Children based on old notebook sizes */ LayoutChildren(new_w, NULL); /* Get preferred size unless app changed both width & height */ if ((XtWidth(old) == save_width) || (XtHeight(old) == save_height)) NewPreferredGeometry(new_w, NULL, NULL, &preferred_geo); /* App request for width takes precedence over NewPreferredGeometry */ if (XtWidth(old) != save_width) XtWidth(new_w) = save_width; else XtWidth(new_w) = preferred_geo.width; /* App request for height takes precedence over NewPreferredGeometry */ if (XtHeight(old) != save_height) XtHeight(new_w) = save_height; else XtHeight(new_w) = preferred_geo.height; } if (visualFlag) redraw |= _XmNotifyChildrenVisual (ow, nw, visualFlag); return(redraw); } /*- QueryGeometry ----------------------------------------------------------- Method for the composite widget's QueryGeometry Returns: preferred size if realized, else user/application w/h values -----------------------------------------------------------------------------*/ static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *desired) { /* Get the preferred w/h based on children preferred sizes */ NewPreferredGeometry((XmNotebookWidget)w, NULL, NULL, desired); /* Handle user initial size setting */ if (!XtIsRealized(w)) { if (XtWidth(w)) desired->width = XtWidth(w); if (XtHeight(w)) desired->height = XtHeight(w); } /* Return result, XmeReplyToQueryGeometry will set CWidth and CHeight */ return(XmeReplyToQueryGeometry(w, intended, desired)); } /***************************************************************************** * * * Composite Class Methods * * * *****************************************************************************/ /*- GeometryManager --------------------------------------------------------- Method for the composite widget's GeometryManager -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static XtGeometryResult GeometryManager ( Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *reply) /* unused */ { XmNotebookWidget nb = (XmNotebookWidget)XtParent(instigator); XmNotebookConstraint nc = NotebookConstraint(instigator); XtGeometryResult result = XtGeometryNo; XtWidgetGeometry myrequest, myallowed; /* handle changes during ConstraintSetValues layout */ if ( (nb->notebook.constraint_child == instigator) && ((IsX(desired)) && (IsY(desired)))) { nb->notebook.constraint_child = NULL; XtX(instigator) = desired->x; XtY(instigator) = desired->y; if (IsWidth(desired)) XtWidth(instigator) = desired->width; if (IsHeight(desired)) XtHeight(instigator) = desired->height; return XtGeometryYes; } /* only for resizing request */ if ((nc->resizable || NB_IS_CHILD_TAB(nc->child_type)) && (desired->request_mode & (CWWidth|CWHeight|CWBorderWidth)) && !nb->notebook.in_setshadow) { /* Determine preferred geometry based on instigator preferrences */ NewPreferredGeometry(nb, instigator, desired, &myrequest); /* * Prepare resize request (as needed) to the parent */ myrequest.request_mode = 0; if (IsQueryOnly(desired)) myrequest.request_mode |= XtCWQueryOnly; if (IsWidth(desired) && XtWidth(nb) != myrequest.width) myrequest.request_mode |= CWWidth; if (IsHeight(desired) && XtHeight(nb) != myrequest.height) myrequest.request_mode |= CWHeight; if (IsBorder(desired) && XtBorderWidth(nb) != myrequest.border_width) myrequest.border_width |= CWBorderWidth; /* ask parent, only if notebook resize request is needed */ if (myrequest.request_mode) { if (NB_IS_CHILD_TAB(nc->child_type)) result = XtGeometryYes; else /* nc->resizable */ { result = XtMakeGeometryRequest((Widget)nb, &myrequest, &myallowed); /* Parent unable to completely fulfill request */ if (result == XtGeometryAlmost) result = XtGeometryNo; } } /* Update the geometry, if necessary */ if (result == XtGeometryYes && !IsQueryOnly(desired)) { /* Adjust notebook's children type sizes to new size */ AdjustGeometry(nb, instigator, desired); /* Layout Children based on new notebook size */ LayoutChildren(nb, instigator); if (XtIsRealized((Widget)nb)) XClearArea(XtDisplay((Widget)nb),XtWindow((Widget)nb), 0,0,0,0,True); } } return result; } /*- ChangeManaged ----------------------------------------------------------- Method for the composite widget's ChangeManaged Something changed in the set of managed children, so place the children and change the form widget size to reflect new size, if possible. -----------------------------------------------------------------------------*/ static void ChangeManaged ( Widget w) { XmNotebookWidget nb = (XmNotebookWidget)w; XtWidgetGeometry preferred; /* ChangeManaged recursively called by SetPageScroller; return */ if (nb->notebook.scroller_status == DEFAULT_CREATE) return; /* if this is the first time through, set the page scroller */ if (nb->notebook.scroller_status == DEFAULT_NONE) { SetPageScroller(nb); UpdateNavigators(nb); } /* assign default page number to those who don't have */ AssignDefaultPageNumber(nb); /* invoke XmNpageChangedCallback for initial setting of current page */ if (nb->notebook.first_change_managed && XtHasCallbacks(w, XmNpageChangedCallback) == XtCallbackHasSome) { XmNotebookCallbackStruct cbs; cbs.reason = XmCR_NONE; cbs.event = NULL; cbs.page_number = nb->notebook.current_page_number; cbs.page_widget = GetChildWidget(nb, nb->notebook.current_page_number, XmPAGE); cbs.prev_page_number = XmUNSPECIFIED_PAGE_NUMBER; cbs.prev_page_widget = NULL; /* Mark that the callback is being called and when it finishes */ nb->notebook.in_callback = True; XtCallCallbackList(w, nb->notebook.page_change_callback, &cbs); nb->notebook.in_callback = False; } /* sort children by their page number and update their activity */ SortChildren(nb); /* * Determine preferred notebook size based on new managed child */ /* Check if current size is the preferred size */ if (NewPreferredGeometry(nb, NULL, NULL, &preferred)) { /* Prepare parent geometry request */ preferred.request_mode = 0; if (XtIsRealized((Widget)nb) || XtWidth(nb) == 0) preferred.request_mode |= CWWidth; if (XtIsRealized((Widget)nb) || XtHeight(nb) == 0) preferred.request_mode |= CWHeight; /* Make parent geometry request, if necessary */ if (preferred.request_mode) _XmMakeGeometryRequest((Widget)nb, &preferred); /* Clear notebook area otherwise binder and backpage don't update. */ if (XtIsRealized((Widget)nb) && !nb->notebook.first_change_managed) XClearArea(XtDisplay(nb), XtWindow(nb), 0, 0, 0, 0, True); } /* Adjust notebook's children type sizes (based on notebook size) */ AdjustGeometry(nb, NULL, NULL); /* Layout Children (based on notebook size) */ LayoutChildren(nb, NULL); XmeNavigChangeManaged(w); nb->notebook.first_change_managed = False; } /*- InsertChild ------------------------------------------------------------- Method for the composite widget's InsertChild -----------------------------------------------------------------------------*/ static void InsertChild ( Widget child) { XmNotebookWidget nb = (XmNotebookWidget)XtParent(child); XmNotebookConstraint nc = NotebookConstraint(child); XmScrollFrameTrait scroll_frameT; XtWidgetProc insert_child; /* check if trying to insert an invalid object */ if (!XtIsRectObj(child)) return; /* call manager's InsertChild method */ _XmProcessLock(); insert_child = ((XmManagerWidgetClass)xmManagerWidgetClass) ->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(child); /* add some keyboard traversal stuff */ switch (nc->child_type) { case XmPAGE_SCROLLER: /* First: take care of previous page scroller */ /* default page scroller not yet made, so just put this one in */ if (nb->notebook.scroller_status == DEFAULT_NONE) nb->notebook.scroller_status = DEFAULT_GONE; /* remove previously created default page scroller */ else if (nb->notebook.scroller_status == DEFAULT_USED) { nb->notebook.scroller_status = DEFAULT_CREATE; /* remove navigator, if page scroller is a navigator */ if (NB_IS_CHILD_NAVIGATOR(nb->notebook.scroller)) { if ((scroll_frameT=NB_SCROLL_FRAME(nb)) != NULL && scroll_frameT->removeNavigator != NULL) scroll_frameT->removeNavigator((Widget) nb, nb->notebook.scroller); } XtDestroyWidget(nb->notebook.scroller); nb->notebook.scroller_status = DEFAULT_GONE; } /* remove previously created non-default page scroller */ else if (nb->notebook.scroller_status == DEFAULT_GONE && nb->notebook.scroller != NULL) { nb->notebook.scroller_status = DEFAULT_CREATE; /* remove navigator, if page scroller is a navigator */ if (NB_IS_CHILD_NAVIGATOR(nb->notebook.scroller)) { if ((scroll_frameT=NB_SCROLL_FRAME(nb)) != NULL && scroll_frameT->removeNavigator != NULL) scroll_frameT->removeNavigator((Widget)nb, nb->notebook.scroller); } XtUnmanageChild(nb->notebook.scroller); nb->notebook.scroller_status = DEFAULT_GONE; } /* Second: take care of this new page scroller */ /* update scroller's translation table */ nb->notebook.scroller = child; /* add navigator, if page scroller has navigator trait */ if (NB_IS_CHILD_NAVIGATOR(nb->notebook.scroller)) { if ((scroll_frameT = NB_SCROLL_FRAME(nb)) != NULL && scroll_frameT->addNavigator != NULL) scroll_frameT->addNavigator((Widget)nb, child, NavigDimensionX); } /* update navigators so this one get initial info */ UpdateNavigators(nb); break; case XmPAGE: case XmSTATUS_AREA: XtVaSetValues(child, XmNnavigationType, XmTAB_GROUP, NULL); break; case XmMAJOR_TAB: case XmMINOR_TAB: /* Install activiation callback */ { XmActivatableTrait activeT; if ((activeT=NB_ACTIVATABLE(child)) != NULL && activeT->changeCB != NULL) activeT->changeCB(child, TabPressed, (XtPointer)(unsigned long)(NB_IS_CHILD_MAJOR(nc->child_type) ? XmCR_MAJOR_TAB : XmCR_MINOR_TAB), True); } /* Update JoinSide information */ (void) UpdateJoinSide(nb, child, nc->child_type, (Dimension) 0); /* Install accelerators */ if (!XmIsGadget(child)) XtInstallAccelerators(child, (Widget)nb); break; } } /*- DeleteChild ------------------------------------------------------------- Method for the composite widget's DeleteChild -----------------------------------------------------------------------------*/ static void DeleteChild ( Widget child) { XmNotebookWidget nb = (XmNotebookWidget)XtParent(child); XmNotebookConstraint nc = NotebookConstraint(child); XmScrollFrameTrait scroll_frameT; XtWidgetProc delete_child; /* clear child pointers in Notebook */ switch (nc->child_type) { case XmPAGE_SCROLLER: if (nb->notebook.scroller == child) { /* remove navigator */ if (NB_IS_CHILD_NAVIGATOR(nb->notebook.scroller)) { if ((scroll_frameT=NB_SCROLL_FRAME(nb)) != NULL && scroll_frameT->removeNavigator != NULL) scroll_frameT->removeNavigator((Widget)nb, nb->notebook.scroller); } /* Mark that no page scroller is established */ nb->notebook.scroller = NULL; nb->notebook.scroller_status = DEFAULT_GONE; } break; case XmMAJOR_TAB_SCROLLER: nb->notebook.next_major = NULL; nb->notebook.prev_major = NULL; break; case XmMINOR_TAB_SCROLLER: nb->notebook.next_minor = NULL; nb->notebook.prev_minor = NULL; break; } /* call manager's DeleteChild method */ _XmProcessLock(); delete_child = ((XmManagerWidgetClass)xmManagerWidgetClass) ->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child); } /***************************************************************************** * * * Constraint Class Methods * * * *****************************************************************************/ /*- ConstraintInitialize ---------------------------------------------------- Initialize method for Notebook's constraint class A default page number will be provided when the widget is managed. -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void ConstraintInitialize ( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num) /* unused */ { XmNotebookConstraint nc = NotebookConstraint(new_w); /* check for invalid object */ if (!XtIsRectObj(new_w)) return; /* validate the child type */ if (nc->child_type != XmMAJOR_TAB_SCROLLER && nc->child_type != XmMINOR_TAB_SCROLLER && !XmRepTypeValidValue(XmRID_NB_CHILD_TYPE, nc->child_type, new_w)) nc->child_type = XmNONE; /* convert to internal */ if (nc->child_type == XmNONE) { if (NB_IS_CHILD_ACTIVATABLE(new_w)) nc->child_type = XmMAJOR_TAB; else if (NB_IS_CHILD_ACCESSTEXTUAL(new_w)) nc->child_type = XmSTATUS_AREA; else if (NB_IS_CHILD_NAVIGATOR(new_w)) nc->child_type = XmPAGE_SCROLLER; else nc->child_type = XmPAGE; } } /*- ConstraintSetValues ----------------------------------------------------- SetValue method for notebook's constraint class -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static Boolean ConstraintSetValues ( Widget old_w, Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num) /* unused */ { XmNotebookWidget nb = (XmNotebookWidget)XtParent(new_w); XmNotebookConstraint old_nc = NotebookConstraint(old_w); XmNotebookConstraint new_nc = NotebookConstraint(new_w); Boolean redraw = False; Boolean need_reset = False; /* check for invalid object */ if (!XtIsRectObj(new_w)) return False; /* XmNnotebookChildType is only CG, not Settable */ if (new_nc->child_type != old_nc->child_type) { new_nc->child_type = old_nc->child_type; XmeWarning(new_w, MESSAGE0); } /* if the page number is changed, sort again */ /* by just repositioning that child */ if (new_nc->page_number != old_nc->page_number) { /* check for last page number change */ if (nb->notebook.dynamic_last_page_num) { if (new_nc->page_number > nb->notebook.last_page_number && XtIsManaged(new_w) && (NB_IS_CHILD_PAGE(new_nc->child_type) || NB_IS_CHILD_TAB(new_nc->child_type) || NB_IS_CHILD_STATUS(new_nc->child_type))) need_reset = SetLastPageNumber(nb, new_nc->page_number); else if (old_nc->page_number == nb->notebook.last_page_number) need_reset = AssignDefaultPageNumber(nb); } /* re-sort and check child list */ RepositionChild(nb, new_w); SetActiveChildren(nb); /* check for changes that affect layout */ if (!nb->notebook.in_callback) { switch(new_nc->child_type) { case XmPAGE: case XmSTATUS_AREA: if (nb->notebook.current_page_number == old_nc->page_number || nb->notebook.current_page_number == new_nc->page_number) { if (need_reset) ResetTopPointers(nb, XmNONE, 0); nb->notebook.constraint_child = new_w; LayoutPages(nb, NULL); redraw = True; } break; case XmMAJOR_TAB: ResetTopPointers(nb, XmNONE, 0); nb->notebook.constraint_child = new_w; LayoutMajorTabs(nb, NULL); LayoutMinorTabs(nb, NULL); redraw = True; break; case XmMINOR_TAB: ResetTopPointers(nb, XmNONE, 0); nb->notebook.constraint_child = new_w; LayoutMinorTabs(nb, NULL); redraw = True; break; } /* switch */ } /* if */ } /* if */ return(redraw); } /***************************************************************************** * * * Initializing & Resource Managing * * * *****************************************************************************/ /*- GetDefaultBackPagePos --------------------------------------------------- Get the default back page position -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void GetDefaultFrameBackground( Widget w, int offset, /* unused */ XrmValue *value) { value->addr = (XtPointer) &w->core.background_pixel; } /*ARGSUSED*/ static void GetDefaultBackPageBackground( Widget w, int offset, /* unused */ XrmValue *value) { XmNotebookWidget nb = (XmNotebookWidget)w; static Pixel pixel; value->addr = (XtPointer) &pixel; XmGetColors(XtScreen(w), nb->core.colormap, nb->notebook.frame_background, NULL, NULL, NULL, &pixel); } /*ARGSUSED*/ static void GetDefaultBackPagePos ( Widget w, int offset, /* unused */ XrmValue *value) { static unsigned char back_page_pos; XmNotebookWidget nb = (XmNotebookWidget)w; /* initialize the notebook layout default */ if (LayoutIsRtoLM(w)) { if (nb->notebook.orientation == XmVERTICAL) /* RIGHT_TO_LEFT and VERTICAL */ back_page_pos = XmBOTTOM_LEFT; else /* RIGHT_TO_LEFT and HORIZONTAL */ back_page_pos = XmBOTTOM_LEFT; } else { if (nb->notebook.orientation == XmVERTICAL) /* LEFT_TO_RIGHT and VERTICAL */ back_page_pos = XmBOTTOM_RIGHT; else /* LEFT_TO_RIGHT and HORIZONTAL */ back_page_pos = XmBOTTOM_RIGHT; } /* * This will have to change when BOTTOM_TO_TOP is supported for * XmNlayoutDirection. */ value->addr = (XPointer) &back_page_pos; } /* Same logic as the GetDefaultBackPagePos default proc ... rewritten * without the static variable - for use from the Initialize proc . */ static unsigned char GetDefaultBackPagePosAgain ( Widget w) { unsigned char back_page_pos; XmNotebookWidget nb = (XmNotebookWidget)w; if (LayoutIsRtoLM(w)) { if (nb->notebook.orientation == XmVERTICAL) /* RIGHT_TO_LEFT and VERTICAL */ back_page_pos = XmBOTTOM_LEFT; else /* RIGHT_TO_LEFT and HORIZONTAL */ back_page_pos = XmBOTTOM_LEFT; } else { if (nb->notebook.orientation == XmVERTICAL) /* LEFT_TO_RIGHT and VERTICAL */ back_page_pos = XmBOTTOM_RIGHT; else /* LEFT_TO_RIGHT and HORIZONTAL */ back_page_pos = XmBOTTOM_RIGHT; } return back_page_pos; } /*- FromOrientationPixels --------------------------------------------------- Determines orientation and calls appropriate converter. -----------------------------------------------------------------------------*/ static void FromOrientationPixels ( Widget w, int offset, XtArgVal *value) { XmNotebookWidget nb = (XmNotebookWidget)w; if ((int)(*value) < 0) *value = 0; if (nb->notebook.orientation == XmHORIZONTAL) XmeFromHorizontalPixels(w, offset, value); else XmeFromVerticalPixels(w, offset, value); } /*- ToOrientationPixels ---------------------------------------------------- Determines orientation and calls appropriate converter. -----------------------------------------------------------------------------*/ static XmImportOperator ToOrientationPixels ( Widget w, int offset, XtArgVal *value) { XmNotebookWidget nb = (XmNotebookWidget)w; if (nb->notebook.orientation == XmHORIZONTAL) return(XmeToHorizontalPixels(w, offset, value)); else return(XmeToVerticalPixels(w, offset, value)); } /*- FromOrientationOppositePixels ------------------------------------------- Determines orientation and calls appropriate converter. -----------------------------------------------------------------------------*/ static void FromOrientationOppositePixels ( Widget w, int offset, XtArgVal *value) { XmNotebookWidget nb = (XmNotebookWidget)w; if ((int)(*value) < 0) *value = 0; if (nb->notebook.orientation == XmHORIZONTAL) XmeFromVerticalPixels(w, offset, value); else XmeFromHorizontalPixels(w, offset, value); } /*- ToOrientationOppositePixels -------------------------------------------- Determines orientation and calls appropriate converter. -----------------------------------------------------------------------------*/ static XmImportOperator ToOrientationOppositePixels ( Widget w, int offset, XtArgVal *value) { XmNotebookWidget nb = (XmNotebookWidget)w; if (nb->notebook.orientation == XmHORIZONTAL) return(XmeToVerticalPixels(w, offset, value)); else return(XmeToHorizontalPixels(w, offset, value)); } /*- CreateTabScrollers ----------------------------------------------------- Create Notebook's tab scrollers -----------------------------------------------------------------------------*/ static void CreateTabScrollers ( XmNotebookWidget nb) { /* creating major tab scrollers */ nb->notebook.next_major = XtVaCreateManagedWidget(MAJOR_TAB_NEXT_NAME, xmArrowButtonGadgetClass, (Widget)nb, XmNwidth, TAB_SCROLLER_WIDTH_DEFAULT, XmNheight, TAB_SCROLLER_HEIGHT_DEFAULT, XmNnotebookChildType, XmMAJOR_TAB_SCROLLER, XmNtraversalOn, False, NULL); ((XmActivatableTrait)XmeTraitGet((XtPointer) XtClass((Widget)nb->notebook.next_major),XmQTactivatable))-> changeCB(nb->notebook.next_major,FlipTabs,NULL,True); nb->notebook.prev_major = XtVaCreateManagedWidget(MAJOR_TAB_PREV_NAME, xmArrowButtonGadgetClass, (Widget)nb, XmNwidth, TAB_SCROLLER_WIDTH_DEFAULT, XmNheight, TAB_SCROLLER_HEIGHT_DEFAULT, XmNnotebookChildType, XmMAJOR_TAB_SCROLLER, XmNtraversalOn, False, NULL); ((XmActivatableTrait)XmeTraitGet((XtPointer) XtClass((Widget)nb->notebook.prev_major),XmQTactivatable))-> changeCB(nb->notebook.prev_major,FlipTabs,NULL,True); /* creating minor tab scrollers */ nb->notebook.next_minor = XtVaCreateManagedWidget(MINOR_TAB_NEXT_NAME, xmArrowButtonGadgetClass, (Widget)nb, XmNwidth, TAB_SCROLLER_WIDTH_DEFAULT, XmNheight, TAB_SCROLLER_HEIGHT_DEFAULT, XmNnotebookChildType, XmMINOR_TAB_SCROLLER, XmNtraversalOn, False, NULL); ((XmActivatableTrait)XmeTraitGet((XtPointer) XtClass((Widget)nb->notebook.next_minor),XmQTactivatable))-> changeCB(nb->notebook.next_minor,FlipTabs,NULL,True); nb->notebook.prev_minor = XtVaCreateManagedWidget(MINOR_TAB_PREV_NAME, xmArrowButtonGadgetClass, (Widget)nb, XmNwidth, TAB_SCROLLER_WIDTH_DEFAULT, XmNheight, TAB_SCROLLER_HEIGHT_DEFAULT, XmNnotebookChildType, XmMINOR_TAB_SCROLLER, XmNtraversalOn, False, NULL); ((XmActivatableTrait)XmeTraitGet((XtPointer) XtClass((Widget)nb->notebook.prev_minor),XmQTactivatable))-> changeCB(nb->notebook.prev_minor,FlipTabs,NULL,True); } /*- SetVisualConfig --------------------------------------------------------- Sets Notebook visual configuration private variables. -----------------------------------------------------------------------------*/ static void SetVisualConfig ( XmNotebookWidget nb) { /* set tab and binding position variables */ if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { nb->notebook.major_pos = RIGHT; nb->notebook.minor_pos = BOTTOM; nb->notebook.binding_pos = LEFT; } else if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmVERTICAL) { nb->notebook.major_pos = BOTTOM; nb->notebook.minor_pos = RIGHT; nb->notebook.binding_pos = TOP; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmHORIZONTAL) { nb->notebook.major_pos = LEFT; nb->notebook.minor_pos = BOTTOM; nb->notebook.binding_pos = RIGHT; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmVERTICAL) { nb->notebook.major_pos = BOTTOM; nb->notebook.minor_pos = LEFT; nb->notebook.binding_pos = TOP; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { nb->notebook.major_pos = RIGHT; nb->notebook.minor_pos = TOP; nb->notebook.binding_pos = LEFT; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmVERTICAL) { nb->notebook.major_pos = TOP; nb->notebook.minor_pos = RIGHT; nb->notebook.binding_pos = BOTTOM; } else if (nb->notebook.back_page_pos == XmTOP_LEFT && nb->notebook.orientation == XmHORIZONTAL) { nb->notebook.major_pos = LEFT; nb->notebook.minor_pos = TOP; nb->notebook.binding_pos = RIGHT; } else if (nb->notebook.back_page_pos == XmTOP_LEFT && nb->notebook.orientation == XmVERTICAL) { nb->notebook.major_pos = TOP; nb->notebook.minor_pos = LEFT; nb->notebook.binding_pos = BOTTOM; } } /*- UpdateJoinSide ------------------------------------------------------------ Update tab's JoinSide Trait to match current visual configuration. Uses instance state: major_pos minor_pos Returns True, if the child is major or minor tab and holds the JoinSide trait. Otherwise, returns False. -----------------------------------------------------------------------------*/ static Boolean UpdateJoinSide ( XmNotebookWidget nb, Widget child, unsigned char child_type, Dimension shadow_thickness) { XmJoinSideTrait joinsideT; /* child JoinSide trait */ unsigned char side_of_book; /* side of notebook tab is on */ unsigned char side_to_join; /* side to join */ /* Determine side of nookbook tabs reside */ if (NB_IS_CHILD_MAJOR(child_type)) side_of_book = nb->notebook.major_pos; else if (NB_IS_CHILD_MINOR(child_type)) side_of_book = nb->notebook.minor_pos; else return(False); /* Update JoinSide trait infomation, unless trait not found */ if ((joinsideT=NB_JOINSIDE(child)) != NULL && joinsideT->setValue != NULL) { /* Convert notebook position to JoinSide position */ switch (side_of_book) { case RIGHT: side_to_join = XmLEFT; break; case BOTTOM: side_to_join = XmTOP; break; case LEFT: side_to_join = XmRIGHT; break; case TOP: default: side_to_join = XmBOTTOM; break; } /* Invoke JoinSideSetValues */ joinsideT->setValue(child, side_to_join, shadow_thickness); return(True); } return(False); } /*- UpdateJoinSideChildren -------------------------------------------------- Update JoinSide aware children of new shadow_thickness or JoinSide. -----------------------------------------------------------------------------*/ static void UpdateJoinSideChildren ( XmNotebookWidget nb, Dimension shadow_thickness) { Widget cw; /* child widget */ unsigned char ct; /* child constraint type */ int i; for (i=0; i < nb->composite.num_children; i++) { cw = nb->composite.children[i]; ct = NotebookConstraint(cw)->child_type; if (NB_IS_CHILD_TAB(ct)) (void) UpdateJoinSide(nb, cw, ct, shadow_thickness); } } /*- SetPageScroller --------------------------------------------------------- Set the visual configuration of the page scroller. It creates the default page scroller if no page scroller is created yet (consisting of a SpinBox with TextField child). -----------------------------------------------------------------------------*/ static void SetPageScroller ( XmNotebookWidget nb) { /* Only create default page scroller if none currently exists */ if (nb->notebook.scroller_status != DEFAULT_NONE) return; /* Mark that we are in the process of creating the default */ nb->notebook.scroller_status = DEFAULT_CREATE; nb->notebook.scroller = XtVaCreateManagedWidget(PAGE_SCROLLER_NAME, xmSpinBoxWidgetClass, (Widget)nb, XmNarrowLayout, XmARROWS_SPLIT, XmNnotebookChildType, XmPAGE_SCROLLER, NULL); nb->notebook.scroller_child = XtVaCreateManagedWidget(NB_TEXT_FIELD_NAME, xmTextFieldWidgetClass, nb->notebook.scroller, XmNspinBoxChildType, XmNUMERIC, XmNcolumns, 6, XmNmarginHeight, 2, XmNcursorPositionVisible, False, XmNeditable, False, XmNtraversalOn, True, NULL); /* Mark that the default page scroller has been established */ nb->notebook.scroller_status = DEFAULT_USED; } /***************************************************************************** * * * Child Layout Functions * * * *****************************************************************************/ /*- LayoutChildren ---------------------------------------------------------- Function to layout Notebook's children -----------------------------------------------------------------------------*/ static void LayoutChildren ( XmNotebookWidget nb, Widget instigator) { /* reset top pointers of tabs */ ResetTopPointers(nb, XmNONE, 0); /* layout children */ LayoutPages(nb, instigator); LayoutMajorTabs(nb, instigator); LayoutMinorTabs(nb, instigator); } /*- LayoutPages ------------------------------------------------------------- Function to layout Page, Status, and Page Scroller. Uses instance state: current_page_number, orientation, and precalculated sizes of each child type. Called from: LayoutChildren(), when performing complete relayout ConstraintSetValues(), when child page number changes GotoPage(), when notebook.current_page_number changes -----------------------------------------------------------------------------*/ static void LayoutPages ( XmNotebookWidget nb, Widget instigator) { XmNotebookConstraint nc; Widget child; int i; Dimension x, y, x1, y1, x2; /* get the page's x, y position */ x = nb->notebook.margin_width + nb->notebook.shadow_thickness + 1; y = nb->notebook.margin_height + nb->notebook.shadow_thickness + 1; if (nb->notebook.binding_pos == LEFT) x += nb->notebook.real_binding_width; else if (nb->notebook.binding_pos == TOP) y += nb->notebook.real_binding_width; if (nb->notebook.major_pos == LEFT) x += NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width) + nb->notebook.back_page_size; else if (nb->notebook.major_pos == TOP) y += NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height) + nb->notebook.back_page_size; if (nb->notebook.minor_pos == LEFT) x += NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) + nb->notebook.back_page_size; else if (nb->notebook.minor_pos == TOP) y += NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) + nb->notebook.back_page_size; /* get the status area and the page scroller's position */ y1 = y + nb->notebook.page_height + nb->notebook.margin_height; if (nb->notebook.back_page_pos == XmTOP_RIGHT || nb->notebook.back_page_pos == XmBOTTOM_RIGHT) { x1 = x; x2 = x + nb->notebook.page_width - nb->notebook.scroller_width; } else { x1 = x + nb->notebook.page_width - nb->notebook.status_width; x2 = x; } /* resize pages & status */ for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if ( NB_IS_CHILD_PAGE(nc->child_type) || NB_IS_CHILD_STATUS(nc->child_type) ) { if (nc->active && nc->page_number == nb->notebook.current_page_number) { if (NB_IS_CHILD_PAGE(nc->child_type)) ShowChild(child, instigator, x, y, nb->notebook.page_width, nb->notebook.page_height); else if (NB_IS_CHILD_STATUS(nc->child_type)) ShowChild(child, instigator, x1, y1, nb->notebook.status_width, nb->notebook.status_height); } else { /* This is to get HideChild to function properly on widgets such as Form which fail to properly set default width/height to a non-zero value */ if (nb->notebook.first_change_managed && (!XtWidth(child) && !XtHeight(child))) { XtWidth(child) = 10; XtHeight(child) = 10; HideChild(child, instigator); XtWidth(child) = 0; XtHeight(child) = 0; } else HideChild(child, instigator); } } } /* Show the page scroller */ if (nb->notebook.scroller != NULL) { child = nb->notebook.scroller; ShowChild(child, instigator, x2, y1, nb->notebook.scroller_width, nb->notebook.scroller_height); } } /*- LayoutMajorTabs --------------------------------------------------------- Function to layout major tabs -----------------------------------------------------------------------------*/ static void LayoutMajorTabs ( XmNotebookWidget nb, Widget instigator) { XmNotebookConstraint nc; /* constraint pointer */ Widget child; /* a major tab widget */ Widget join_child = NULL; /* top major and joinSide tab */ int x, y, tmpx, tmpy; /* tab's geometry */ int tab_count; /* # of tabs shown */ int margin_w, margin_h; /* temporary margin value */ int sx1, sy1, sx2, sy2; /* tab scroller position */ int fixed; /* back page fixed position */ int limit; /* the last possible position */ int delta, spacing; /* major tab spacing */ int first_major, top_major; /* page# of first and top major tabs */ unsigned char prev, next; /* for tab scroller arrow direction */ Boolean gray_prev, gray_next; /* True if need to gray out scrollers */ int i; unsigned char direction; int total_major_tabs, top_tab_count = 0, current_tab = 0; /* * Initialize */ first_major = nb->notebook.first_major ? NotebookConstraint(nb->notebook.first_major)->page_number : nb->notebook.first_page_number - 1; top_major = nb->notebook.top_major ? NotebookConstraint(nb->notebook.top_major)->page_number : nb->notebook.first_page_number - 1; gray_prev = gray_next = True; sx1 = sy1 = sx2 = sy2 = 0; /* * Determine tab margin spacing and tab staggering */ spacing = MAX(nb->notebook.major_spacing, nb->notebook.shadow_thickness); delta = nb->notebook.back_page_size / nb->notebook.real_back_page_number; /* * Determine tab positions */ if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ x = nb->notebook.real_binding_width + nb->notebook.frame_width; y = nb->notebook.back_page_size; fixed = x + nb->notebook.back_page_size; limit = nb->notebook.frame_height - nb->notebook.major_height - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = fixed; sy1 = y; sy2 = sy1 + nb->notebook.frame_height - nb->notebook.major_scroller_height; limit = nb->notebook.frame_height - MAX(0, (int)(nb->notebook.major_scroller_height - nb->notebook.back_page_size)) - nb->notebook.major_height - nb->notebook.shadow_thickness; y += nb->notebook.major_scroller_height + spacing; } else y += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_UP; next = XmARROW_DOWN; } else if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmVERTICAL) { /* set starting position */ x = nb->notebook.back_page_size; y = nb->notebook.real_binding_width + nb->notebook.frame_height; fixed = y + nb->notebook.back_page_size; limit = nb->notebook.frame_width - nb->notebook.major_width - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = fixed; sx1 = x; sx2 = sx1 + nb->notebook.frame_width - nb->notebook.major_scroller_width; limit = nb->notebook.frame_width - MAX(0, (int)(nb->notebook.major_scroller_width - nb->notebook.back_page_size)) - nb->notebook.major_width - nb->notebook.shadow_thickness; x += nb->notebook.major_scroller_width + spacing; } else x += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_LEFT; next = XmARROW_RIGHT; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ margin_w = NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width) +1; x = margin_w + nb->notebook.back_page_size - nb->notebook.major_width; y = nb->notebook.back_page_size; fixed = x - nb->notebook.back_page_size; limit = nb->notebook.frame_height - nb->notebook.major_height - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = margin_w - nb->notebook.minor_scroller_width; sy1 = y; sy2 = y + nb->notebook.frame_height - nb->notebook.major_scroller_height; limit = nb->notebook.frame_height - MAX(0, (int)(nb->notebook.major_scroller_height - nb->notebook.back_page_size)) - nb->notebook.major_height - nb->notebook.shadow_thickness; y += nb->notebook.major_scroller_height + spacing; } else y += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_UP; next = XmARROW_DOWN; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmVERTICAL) { /* set starting position */ margin_w = NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width); x = margin_w + nb->notebook.frame_width - nb->notebook.major_width; y = nb->notebook.real_binding_width + nb->notebook.frame_height; fixed = y + nb->notebook.back_page_size; limit = margin_w + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = fixed; sx1 = margin_w + nb->notebook.frame_width - nb->notebook.major_scroller_width; sx2 = margin_w; limit = margin_w + MAX(nb->notebook.back_page_size, nb->notebook.major_scroller_width) + nb->notebook.shadow_thickness; x -= nb->notebook.major_scroller_width + spacing; } else x -= spacing; /* set arrow direction resource */ prev = XmARROW_RIGHT; next = XmARROW_LEFT; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ margin_h = NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height); x = nb->notebook.real_binding_width + nb->notebook.frame_width; y = margin_h + nb->notebook.frame_height - nb->notebook.major_height; fixed = x + nb->notebook.back_page_size; limit = margin_h + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = fixed; sy1 = margin_h + nb->notebook.frame_height - nb->notebook.minor_scroller_height; sy2 = margin_h; limit = margin_h + MAX(nb->notebook.back_page_size, nb->notebook.major_scroller_height) + nb->notebook.shadow_thickness; y -= nb->notebook.major_scroller_height + spacing; } else y -= spacing; /* set arrow direction resource */ prev = XmARROW_DOWN; next = XmARROW_UP; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmVERTICAL) { /* set starting position */ margin_h = NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height) +1; x = nb->notebook.back_page_size; y = margin_h + nb->notebook.back_page_size - nb->notebook.major_height; fixed = margin_h - nb->notebook.major_height; limit = nb->notebook.frame_width - nb->notebook.major_width - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = margin_h - nb->notebook.major_scroller_height; sx1 = x; sx2 = nb->notebook.frame_width + nb->notebook.back_page_size - nb->notebook.major_scroller_width; limit = nb->notebook.frame_width - MAX(0, (int)(nb->notebook.major_scroller_width - nb->notebook.back_page_size)) - nb->notebook.major_width - nb->notebook.shadow_thickness; x += nb->notebook.major_scroller_width + spacing; } else x += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_LEFT; next = XmARROW_RIGHT; } else if (nb->notebook.back_page_pos == XmTOP_LEFT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ margin_w = NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width) +1; margin_h = NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) +1; x = margin_w + nb->notebook.back_page_size - nb->notebook.major_width; y = margin_h + nb->notebook.frame_height - nb->notebook.major_height; fixed = x - nb->notebook.back_page_size; limit = margin_h + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = margin_w - nb->notebook.minor_scroller_width; sy1 = margin_h + nb->notebook.frame_height - nb->notebook.major_scroller_height; sy2 = margin_h; limit = margin_h + MAX(nb->notebook.back_page_size, nb->notebook.major_scroller_height) + nb->notebook.shadow_thickness; y -= nb->notebook.major_scroller_height + spacing; } else y -= spacing; /* set arrow direction resource */ prev = XmARROW_DOWN; next = XmARROW_UP; } else { /* set starting position */ margin_w = NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) +1; margin_h = NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height) +1; x = margin_w + nb->notebook.frame_width - nb->notebook.major_width; y = margin_h + nb->notebook.back_page_size - nb->notebook.major_height; fixed = y - nb->notebook.back_page_size; limit = margin_w + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = margin_h - nb->notebook.major_scroller_height; sx1 = margin_w + nb->notebook.frame_width - nb->notebook.major_scroller_width; sx2 = margin_w; limit = margin_w + MAX(nb->notebook.back_page_size, nb->notebook.major_scroller_width) + nb->notebook.shadow_thickness; x -= nb->notebook.major_scroller_width + spacing; } else x -= spacing; /* set arrow direction resource */ prev = XmARROW_RIGHT; next = XmARROW_LEFT; } /* * Deal with previous top and current top tab shadowing */ /* Inform old top major to restore shadow_thickness */ if (nb->notebook.old_top_major != NULL && nb->notebook.old_top_major != nb->notebook.top_major) { /* Protect against geometry requests during join changes */ nb->notebook.in_setshadow = True; /* Inform join-aware tab else restore shadow thickness */ if (!UpdateJoinSide(nb, nb->notebook.old_top_major, XmMAJOR_TAB, (Dimension)0)) { /* Hide the old top major shadow */ HideShadowedTab(nb, nb->notebook.old_top_major); /* Restore child shadow thickness */ XtVaSetValues(nb->notebook.old_top_major, XmNshadowThickness, nb->notebook.major_shadow_thickness, NULL); } /* Release protection against geometry requests */ nb->notebook.in_setshadow = False; } /* Store & set new top major's shadow */ if (nb->notebook.top_major != NULL) { /* Hide the top major shadow, as it may be moving (shown or hidden) */ HideShadowedTab(nb, nb->notebook.top_major); /* Protect against geometry requests during join changes */ nb->notebook.in_setshadow = True; /* Set shadow thickness of new top tab */ if (!UpdateJoinSide(nb, nb->notebook.top_major, XmMAJOR_TAB, nb->notebook.shadow_thickness)) { /* Save shadow_thickness of top tab, unless we already have */ if (nb->notebook.top_major != nb->notebook.major_shadow_child) { XtVaGetValues(nb->notebook.top_major, XmNshadowThickness, &(nb->notebook.major_shadow_thickness), NULL); nb->notebook.major_shadow_child = nb->notebook.top_major; } else { /* CR 9903: The application may have set shadow_thickness. */ Dimension current = 0; XtVaGetValues(nb->notebook.top_major, XmNshadowThickness, ¤t, NULL); if (current != 0) nb->notebook.major_shadow_thickness = current; } /* Notebook will draw shadow for non-JoinSide trait tabs */ XtVaSetValues(nb->notebook.top_major, XmNshadowThickness, 0, NULL); } else join_child = nb->notebook.top_major; /* Release protection against geometry requests */ nb->notebook.in_setshadow = False; } else /* There is no top tab so advance to the first back page line */ { if (nb->notebook.major_pos == RIGHT) x += delta; else if (nb->notebook.major_pos == LEFT) x -= delta; else if (nb->notebook.major_pos == BOTTOM) y += delta; else /* if (nb->notebook.major_pos == TOP) */ y -= delta; } /* * FIX for CDExc23791 */ total_major_tabs = 0; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (NB_IS_CHILD_MAJOR(nc->child_type)) total_major_tabs++; if ( child == nb->notebook.top_major) top_tab_count = total_major_tabs; } /* * Layout major tabs */ tab_count = 0; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (NB_IS_CHILD_MAJOR(nc->child_type)) { if (!nc->active) HideChild(child, instigator); else if (nc->page_number < first_major) { HideChild(child, instigator); gray_prev = False; } else if ((nb->notebook.minor_pos == BOTTOM && y > limit) || (nb->notebook.minor_pos == TOP && y < limit) || (nb->notebook.minor_pos == RIGHT && x > limit) || (nb->notebook.minor_pos == LEFT && x < limit)) { HideChild(child, instigator); gray_next = False; } else { /* Display the tab */ if ( current_tab < top_tab_count - 1 ) { /* * FIX for CDExc23791 */ if (nb->notebook.orientation == XmHORIZONTAL) { if (nb->notebook.major_pos == RIGHT) tmpx = x + ( total_major_tabs + 1 - top_tab_count + current_tab) * delta; else tmpx = x - ( total_major_tabs + 1 - top_tab_count + current_tab) * delta; tmpy = y; } else { tmpx = x; if (nb->notebook.major_pos == TOP) tmpy = y - (total_major_tabs + 1 - top_tab_count + current_tab) * delta; else tmpy = y + (total_major_tabs + 1 - top_tab_count + current_tab) * delta; } } else { tmpx = x; tmpy = y; } if (/*(nb->notebook.orientation == XmHORIZONTAL && nc->page_number < top_major) ||*/ (nb->notebook.major_pos == RIGHT && tmpx > fixed) || (nb->notebook.major_pos == LEFT && tmpx < fixed)) { tmpx = fixed; } else if (/*(nb->notebook.orientation == XmVERTICAL && nc->page_number < top_major) ||*/ (nb->notebook.major_pos == BOTTOM && tmpy > fixed) || (nb->notebook.major_pos == TOP && tmpy < fixed)) { tmpy = fixed; } /* move joinSide top tab over to align with frame */ if ((join_child && (join_child == child)) || (nb->notebook.top_major && (nb->notebook.top_major == child))) { if (nb->notebook.major_pos == LEFT) tmpx = tmpx + nb->notebook.shadow_thickness; else if (nb->notebook.major_pos == RIGHT) tmpx = tmpx - nb->notebook.shadow_thickness; else if (nb->notebook.major_pos == TOP) tmpy = tmpy + nb->notebook.shadow_thickness; else /* (nb->notebook.major_pos == BOTTOM) */ tmpy = tmpy - nb->notebook.shadow_thickness; } /* Make tab visible */ ShowChild(child, instigator, tmpx, tmpy, nb->notebook.major_width, nb->notebook.major_height); tab_count++; /* Calculate the next position */ if (nb->notebook.minor_pos == BOTTOM) y += nb->notebook.major_height + spacing; else if (nb->notebook.minor_pos == TOP) y -= nb->notebook.major_height + spacing; else if (nb->notebook.minor_pos == RIGHT) x += nb->notebook.major_width + spacing; else /* (nb->notebook.minor_pos == LEFT) */ x -= nb->notebook.major_width + spacing; } /* to the next back page line */ if (nc->page_number >= top_major) { if (nb->notebook.major_pos == RIGHT) x += delta; else if (nb->notebook.major_pos == LEFT) x -= delta; else if (nb->notebook.major_pos == BOTTOM) y += delta; else y -= delta; } current_tab++; } /* if */ } /* for */ /* * Display the tab scrolling tab, if neccessary */ if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller) && tab_count) { /* set scroller's arrow directions */ XtVaGetValues(nb->notebook.prev_major, XmNarrowDirection, &direction, NULL); if (direction != prev) XtVaSetValues(nb->notebook.prev_major, XmNarrowDirection, prev, NULL); XtVaGetValues(nb->notebook.next_major, XmNarrowDirection, &direction, NULL); if (direction != next) XtVaSetValues(nb->notebook.next_major, XmNarrowDirection, next, NULL); /* Gray out scrollers, if necessary */ if (gray_prev) XtSetSensitive(nb->notebook.prev_major, False); else XtSetSensitive(nb->notebook.prev_major, True); if (gray_next) XtSetSensitive(nb->notebook.next_major, False); else XtSetSensitive(nb->notebook.next_major, True); /* show the scrollers */ ShowChild(nb->notebook.prev_major, instigator, sx1, sy1, nb->notebook.major_scroller_width, nb->notebook.major_scroller_height); ShowChild(nb->notebook.next_major, instigator, sx2, sy2, nb->notebook.major_scroller_width, nb->notebook.major_scroller_height); } else { HideChild(nb->notebook.prev_major, instigator); HideChild(nb->notebook.next_major, instigator); } } /*- LayoutMinorTabs --------------------------------------------------------- Function to layout minor tabs -----------------------------------------------------------------------------*/ static void LayoutMinorTabs ( XmNotebookWidget nb, Widget instigator) { XmNotebookConstraint nc; /* constraint pointer */ Widget child; /* a major tab widget */ Widget join_child = NULL; /* top minor and joinSide tab */ int x, y, tmpx, tmpy; /* tab's geometry */ int tab_count; /* # of tabs shown */ int backpage_h; /* temporary backpage value */ int margin_w, margin_h; /* temporary margin value */ int sx1, sy1, sx2, sy2; /* tab scroller position */ int fixed; /* back page fixed position */ int limit; /* the last possible position */ int spacing; /* major tab spacing */ int status; /* minor tab drawing status */ int top_major; /* page# of the top major tab */ int first_minor, top_minor; /* page# of first and top minor tabs */ unsigned char prev, next; /* for tab scroller arrow direction */ Boolean gray_prev, gray_next; /* True if need to gray out scrollers */ int i; unsigned char direction; int offset = 0; /* * Initialize */ top_major = nb->notebook.top_major ? NotebookConstraint(nb->notebook.top_major)->page_number : nb->notebook.first_page_number - 1; first_minor = nb->notebook.first_minor ? NotebookConstraint(nb->notebook.first_minor)->page_number : nb->notebook.first_page_number - 1; top_minor = nb->notebook.top_minor ? NotebookConstraint(nb->notebook.top_minor)->page_number : nb->notebook.first_page_number - 1; gray_prev = gray_next = True; sx1 = sy1 = sx2 = sy2 = 0; if ( nb->notebook.shadow_thickness == 0 ) offset = 1; /* * Determine tap spacing */ spacing = MAX(nb->notebook.minor_spacing, nb->notebook.shadow_thickness); /* * Determine tab positions */ if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ x = MAX((nb->notebook.real_binding_width + 1 + offset), nb->notebook.back_page_size); y = nb->notebook.frame_height; fixed = y + NB_MINOR_TAB_STEP(nb->notebook.back_page_size); limit = nb->notebook.real_binding_width + nb->notebook.frame_width - nb->notebook.minor_width - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = y + nb->notebook.back_page_size; sx1 = x; sx2 = nb->notebook.real_binding_width + nb->notebook.frame_width + nb->notebook.back_page_size - nb->notebook.minor_scroller_width; limit = nb->notebook.real_binding_width + nb->notebook.frame_width - nb->notebook.minor_width - nb->notebook.shadow_thickness - MAX(0, (int)(nb->notebook.minor_scroller_width - nb->notebook.back_page_size)); x += nb->notebook.minor_scroller_width + spacing; } else x += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_LEFT; next = XmARROW_RIGHT; } else if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmVERTICAL) { /* set starting position */ backpage_h = 1; if (nb->notebook.back_page_size > nb->notebook.real_binding_width) backpage_h = nb->notebook.back_page_size - nb->notebook.real_binding_width; x = nb->notebook.frame_width; y = nb->notebook.real_binding_width + backpage_h + offset; fixed = x + NB_MINOR_TAB_STEP(nb->notebook.back_page_size); limit = nb->notebook.real_binding_width + nb->notebook.frame_height - nb->notebook.minor_height - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = x + nb->notebook.back_page_size; sy1 = y; sy2 = nb->notebook.real_binding_width + nb->notebook.frame_height + nb->notebook.back_page_size - nb->notebook.minor_scroller_height; limit = nb->notebook.real_binding_width + nb->notebook.frame_height - MAX(0, (int)(nb->notebook.minor_scroller_height - nb->notebook.back_page_size)) - nb->notebook.minor_height - nb->notebook.shadow_thickness; y += nb->notebook.minor_scroller_height + spacing; } else y += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_UP; next = XmARROW_DOWN; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ margin_w = NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width); x = margin_w + nb->notebook.back_page_size + nb->notebook.frame_width - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - nb->notebook.minor_width - offset; y = nb->notebook.frame_height; fixed = y + NB_MINOR_TAB_STEP(nb->notebook.back_page_size); limit = margin_w + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = y + nb->notebook.back_page_size; sx1 = margin_w + nb->notebook.back_page_size + nb->notebook.frame_width - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - nb->notebook.minor_scroller_width; sx2 = margin_w; limit = margin_w + MAX(nb->notebook.minor_scroller_width, nb->notebook.back_page_size) + nb->notebook.shadow_thickness; x -= nb->notebook.minor_scroller_width + spacing; } else x -= nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_RIGHT; next = XmARROW_LEFT; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmVERTICAL) { /* set starting position */ margin_w = NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) +1; x = margin_w + nb->notebook.back_page_size - nb->notebook.minor_width; y = MAX((nb->notebook.real_binding_width + 1 + offset), nb->notebook.back_page_size); fixed = margin_w + NB_MINOR_TAB_STEP(nb->notebook.back_page_size) - nb->notebook.minor_width; limit = nb->notebook.real_binding_width + nb->notebook.frame_height - nb->notebook.minor_height - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = margin_w - nb->notebook.minor_scroller_width; sy1 = y; sy2 = nb->notebook.real_binding_width + nb->notebook.frame_height + nb->notebook.back_page_size - nb->notebook.minor_scroller_height; limit = nb->notebook.real_binding_width + nb->notebook.frame_height - MAX(0, (int)(nb->notebook.minor_scroller_height - nb->notebook.back_page_size)) - nb->notebook.minor_height - nb->notebook.shadow_thickness; y += nb->notebook.minor_scroller_height + spacing; } else y += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_UP; next = XmARROW_DOWN; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ margin_h = NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) + 1; x = MAX((nb->notebook.real_binding_width + 1 + offset), nb->notebook.back_page_size); y = margin_h + nb->notebook.back_page_size - nb->notebook.minor_height; fixed = margin_h + NB_MINOR_TAB_STEP(nb->notebook.back_page_size) - nb->notebook.minor_height; limit = nb->notebook.real_binding_width + nb->notebook.frame_width - nb->notebook.minor_width - nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = margin_h - nb->notebook.minor_scroller_height; sx1 = x; sx2 = nb->notebook.real_binding_width + nb->notebook.frame_width + nb->notebook.back_page_size - nb->notebook.minor_scroller_width; limit = nb->notebook.real_binding_width + nb->notebook.frame_width - MAX(0, (int)(nb->notebook.minor_scroller_width - nb->notebook.back_page_size)) - nb->notebook.minor_width - nb->notebook.shadow_thickness; x += nb->notebook.minor_scroller_width + spacing; } else x += nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_LEFT; next = XmARROW_RIGHT; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmVERTICAL) { /* set starting position */ backpage_h = 0; if (nb->notebook.back_page_size > nb->notebook.real_binding_width) backpage_h = nb->notebook.back_page_size - nb->notebook.real_binding_width; margin_h = NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height); x = nb->notebook.frame_width; y = margin_h + nb->notebook.back_page_size + nb->notebook.frame_height - nb->notebook.minor_height - backpage_h - offset; fixed = x + NB_MINOR_TAB_STEP(nb->notebook.back_page_size); limit = margin_h + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = x + nb->notebook.back_page_size; sy1 = margin_h + nb->notebook.back_page_size + nb->notebook.frame_height - nb->notebook.minor_scroller_height - backpage_h; sy2 = margin_h; limit = margin_h + MAX(nb->notebook.back_page_size, nb->notebook.minor_scroller_height) + nb->notebook.shadow_thickness; y -= (nb->notebook.minor_scroller_height + spacing); } else y -= nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_DOWN; next = XmARROW_UP; } else if (nb->notebook.back_page_pos == XmTOP_LEFT && nb->notebook.orientation == XmHORIZONTAL) { /* set starting position */ margin_w = NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width); margin_h = NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) +1; x = margin_w + nb->notebook.back_page_size + nb->notebook.frame_width - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - nb->notebook.minor_width - offset; y = margin_h + nb->notebook.back_page_size - nb->notebook.minor_height; fixed = y - NB_MINOR_TAB_STEP(nb->notebook.back_page_size); limit = margin_w + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sy1 = sy2 = margin_h - nb->notebook.minor_scroller_height; sx1 = margin_w + nb->notebook.back_page_size + nb->notebook.frame_width - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - nb->notebook.minor_scroller_width; sx2 = margin_w; limit = margin_w + MAX(nb->notebook.minor_scroller_width, nb->notebook.back_page_size) + nb->notebook.shadow_thickness; x -= nb->notebook.minor_scroller_width + spacing; } else x -= nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_RIGHT; next = XmARROW_LEFT; } else /* if (nb->notebook.back_page_pos == XmTOP_LEFT && nb->notebook.orientation == XmVERTICAL) */ { /* set starting position */ margin_w = NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) + 1; margin_h = NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height); x = margin_w + nb->notebook.back_page_size - nb->notebook.minor_width; y = margin_h + nb->notebook.back_page_size + nb->notebook.frame_height - nb->notebook.minor_height - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - offset; fixed = x - NB_MINOR_TAB_STEP(nb->notebook.back_page_size); limit = margin_h + nb->notebook.back_page_size + nb->notebook.shadow_thickness; if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller)) { sx1 = sx2 = margin_w - nb->notebook.minor_scroller_width; sy1 = margin_h + nb->notebook.back_page_size + nb->notebook.frame_height - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - nb->notebook.minor_scroller_height; sy2 = margin_h; limit = margin_h + MAX(nb->notebook.back_page_size, nb->notebook.minor_scroller_height) + nb->notebook.shadow_thickness; y -= nb->notebook.minor_scroller_height + spacing; } else y -= nb->notebook.shadow_thickness; /* set arrow direction resource */ prev = XmARROW_DOWN; next = XmARROW_UP; } /* * Deal with previous top and current top tab shadowing */ /* Inform old top minor to restore shadow_thickness */ if (nb->notebook.old_top_minor != NULL && nb->notebook.old_top_minor != nb->notebook.top_minor) { /* Protect against geometry requests during join changes */ nb->notebook.in_setshadow = True; /* Inform join-aware tab else restore shadow thickness */ if (!UpdateJoinSide(nb, nb->notebook.old_top_minor, XmMINOR_TAB, (Dimension)0)) { /* Hide the old top minor shadow */ HideShadowedTab(nb, nb->notebook.old_top_minor); /* Restore the old top minor shadow thickness */ XtVaSetValues(nb->notebook.old_top_minor, XmNshadowThickness, nb->notebook.minor_shadow_thickness, NULL); } /* Release protection against geometry requests */ nb->notebook.in_setshadow = False; } /* Store & set new top minor's shadow */ if (nb->notebook.top_minor != NULL) { /* Hide the top minor shadow, as it may be moving (shown or hidden) */ HideShadowedTab(nb, nb->notebook.top_minor); /* Protect against geometry requests during join changes */ nb->notebook.in_setshadow = True; /* Set shadow thickness of new top tab */ if (!UpdateJoinSide(nb, nb->notebook.top_minor, XmMINOR_TAB, nb->notebook.shadow_thickness)) { /* Save shadow_thickness of top tab, unless we already have */ if (nb->notebook.top_minor != nb->notebook.minor_shadow_child) { /* Save shadow_thickness of top tab, unless already saved */ XtVaGetValues(nb->notebook.top_minor, XmNshadowThickness, &(nb->notebook.minor_shadow_thickness), NULL); nb->notebook.minor_shadow_child = nb->notebook.top_minor; } else { /* CR 9903: The application may have set shadow_thickness. */ Dimension current = 0; XtVaGetValues(nb->notebook.top_minor, XmNshadowThickness, ¤t, NULL); if (current != 0) nb->notebook.minor_shadow_thickness = current; } /* Notebook will draw shadow */ XtVaSetValues(nb->notebook.top_minor, XmNshadowThickness, 0, NULL); } else join_child = nb->notebook.top_minor; /* Release protection against geometry requests */ nb->notebook.in_setshadow = False; } /* * Layout major tabs */ status = TAB_DRAW; tab_count = 0; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (first_minor < nb->notebook.first_page_number || (nc->active && NB_IS_CHILD_MAJOR(nc->child_type) && (status == TAB_DRAWING || nc->page_number > first_minor))) status = TAB_DRAWN; if (NB_IS_CHILD_MINOR(nc->child_type)) { if (!nc->active || status == TAB_DRAWN) HideChild(child, instigator); else if (nc->page_number < first_minor) { if (nc->page_number >= top_major) gray_prev = False; HideChild(child, instigator); } else if ((nb->notebook.binding_pos == LEFT && x > limit) || (nb->notebook.binding_pos == RIGHT && x < limit) || (nb->notebook.binding_pos == TOP && y > limit) || (nb->notebook.binding_pos == BOTTOM && y < limit)) { gray_next = False; HideChild(child, instigator); } else { /* Display the tab */ status = TAB_DRAWING; tmpx = x; tmpy = y; if (nc->page_number != top_minor) { if (nb->notebook.orientation == XmHORIZONTAL) tmpy = fixed; else tmpx = fixed; } /* move joinSide top tab over to align with frame */ if ((join_child && (join_child == child)) || (nb->notebook.top_minor && (nb->notebook.top_minor == child))) { if (nb->notebook.minor_pos == LEFT) tmpx = tmpx + nb->notebook.shadow_thickness; else if (nb->notebook.minor_pos == RIGHT) tmpx = tmpx - nb->notebook.shadow_thickness; else if (nb->notebook.minor_pos == TOP) tmpy = tmpy + nb->notebook.shadow_thickness; else if (nb->notebook.minor_pos == BOTTOM) tmpy = tmpy - nb->notebook.shadow_thickness; } /* Make tab visible */ ShowChild(child, instigator, tmpx, tmpy, nb->notebook.minor_width, nb->notebook.minor_height); tab_count++; /* Calculate the next position */ if (nb->notebook.binding_pos == LEFT) x += nb->notebook.minor_width + spacing; else if (nb->notebook.binding_pos == RIGHT) x -= nb->notebook.minor_width + spacing; else if (nb->notebook.binding_pos == TOP) y += nb->notebook.minor_height + spacing; else y -= nb->notebook.minor_height + spacing; } } } /* display the tab scrolling tab if neccessary */ if (NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller) && tab_count) { /* set scroller's arrow directions */ XtVaGetValues(nb->notebook.prev_minor, XmNarrowDirection, &direction, NULL); if (direction != prev) XtVaSetValues(nb->notebook.prev_minor, XmNarrowDirection, prev, NULL); XtVaGetValues(nb->notebook.next_minor, XmNarrowDirection, &direction, NULL); if (direction != next) XtVaSetValues(nb->notebook.next_minor, XmNarrowDirection, next, NULL); /* gray out scrollers if necessary */ if (gray_prev) XtSetSensitive(nb->notebook.prev_minor, False); else XtSetSensitive(nb->notebook.prev_minor, True); if (gray_next) XtSetSensitive(nb->notebook.next_minor, False); else XtSetSensitive(nb->notebook.next_minor, True); /* show the scrollers */ ShowChild(nb->notebook.prev_minor, instigator, sx1, sy1, nb->notebook.minor_scroller_width, nb->notebook.minor_scroller_height); ShowChild(nb->notebook.next_minor, instigator, sx2, sy2, nb->notebook.minor_scroller_width, nb->notebook.minor_scroller_height); } else { HideChild(nb->notebook.prev_minor, instigator); HideChild(nb->notebook.next_minor, instigator); } } /*- ResetTopPointers -------------------------------------------------------- Function to calculate and update needed information to perform layout for major and minor tabs, and the tab scroller. Uses instance state: notebook.current_page_number Updates instance state: notebook.first_major - page# of the first visible major tab notebook.first_minor - page# of the first visible minor tab notebook.top_major - page# of the currently active major tab notebook.top_minor - page# of the currently active minor tab notebook.need_scroller - tab scroller necessary, where XmNONE indicates none, XmMAJOR_TAB_SCROLLER indicates major only, XmMINOR_TAB_SCROLLER indicates minor only, XmTAB_SCROLLER indicates both are needed. Called from: LayoutChildren(), when performing layout GotoPage(), when changing the top pages FlipTabs(), when tab scrolling are activated TraverseTab(), when tab traverse actions are activated Parameters: IN reason - Why was this routine called? where XmNONE = reset all information XmPAGE = reset due to a page navigation (general) XmPAGE_SCROLLER = reset due to navigating via the page scroller XmMAJOR_TAB = reset due to activating a minor tab XmMINOR_TAB = reset due to activating a major tab XmMAJOR_TAB_SCROLLER = reset due to major scroller activation XmMINOR_TAB_SCROLLER = reset due to minor scroller activation IN scroll - What type of scrolling where _NEXT = scroll to the next major/minor tab _PREV = scroll to the previous major/minor tab _HOME = scroll to the first major/minor tab _END = scroll to the last major/minor tab (only used for reason == NB_IS_CHILD_MAJOR_SCROLLER or NB_IS_CHILD_MINOR_SCROLLER) -----------------------------------------------------------------------------*/ static void ResetTopPointers ( XmNotebookWidget nb, unsigned char reason, int scroll) { XmNotebookConstraint nc; /* constraint pointer */ Widget child; /* a tab widget */ int i; /* index */ int spacing; /* tab spacing */ int half; int count; /* temporary counting */ Dimension frame_dim, tab_dim, scroller_dim; /* temporary w/h */ /* major tab information */ Widget start_major; /* the very first major tab */ Widget top_major; /* the currently major tab */ Widget next_major; /* the next major tab of first_major */ Widget prev_major; /* the prev major tab of first_major */ int first_major_page; /* page# of the first visible major tab */ int top_major_page; /* page# of the current major tab */ int top_major_idx; /* top major tab's index in the child array */ int num_major; /* # of major tabs */ int num_visible_major; /* # of visible major tabs */ int num_rest_major; /* # of next major tabs of the current page */ int num_next_major; /* # of next major tabs of first_major */ int num_prev_major; /* # of prev major tabs of first_major */ /* minor tab information */ Widget start_minor; /* the first minor tab in the current major */ Widget top_minor; /* the current minor tab */ Widget next_minor; /* the next minor tab of first_minor */ Widget prev_minor; /* the prev minor tab of first_minor */ int first_minor_page; /* page# of the first visible minor tab */ int top_minor_page; /* page# of the current minor tab */ int top_minor_idx; /* top minor tab's index in the child array */ int start_minor_idx; /* start minor tab's index in the child array */ int end_minor_idx; /* end minor tab's index in the child array */ int num_minor; /* # of minor tabs */ int num_visible_minor; /* # of visible minor tabs */ int num_rest_minor; /* # of next minor tabs of the current page */ int num_next_minor; /* # of next minor tabs of first_minor */ int num_prev_minor; /* # of prev minor tabs of first_minor */ /* * Calculate general tab information, based on the current_page_number. */ /* Major tab */ first_major_page = nb->notebook.first_major ? NotebookConstraint(nb->notebook.first_major)->page_number : nb->notebook.first_page_number - 1; top_major_page = nb->notebook.first_page_number - 1; top_major_idx = -1; start_major = top_major = next_major = prev_major = NULL; num_major = num_rest_major = num_next_major = num_prev_major = 0; for (i=0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->active && NB_IS_CHILD_MAJOR(nc->child_type)) { if (!start_major) /* Mark the very first tab */ start_major = child; if (nc->page_number <= nb->notebook.current_page_number) { /* Mark the closest tab to the current page */ top_major = child; top_major_page = nc->page_number; top_major_idx = i; } else /* Count of tabs past the current page */ num_rest_major++; if (nc->page_number < first_major_page) { /* Mark the closest previous tab to the first visible tab */ prev_major = child; /* Count of tabs prior to the current page */ num_prev_major++; } else if (nc->page_number > first_major_page) { if (!num_next_major) /* Mark the closest next tab to the current page */ next_major = child; /* Count of tabs after the current page */ num_next_major++; } /* Count of all tabs */ num_major++; } } /* Minor tab */ first_minor_page = nb->notebook.first_minor ? NotebookConstraint(nb->notebook.first_minor)->page_number : nb->notebook.first_page_number - 1; top_minor_page = nb->notebook.first_page_number - 1; top_minor_idx = -1; start_minor_idx = end_minor_idx = -1; start_minor = top_minor = next_minor = prev_minor = NULL; num_minor = num_rest_minor = num_next_minor = num_prev_minor = 0; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->active) { /* Break out when next major tab section is reached */ if ( nc->page_number > top_major_page && NB_IS_CHILD_MAJOR(nc->child_type) ) break; /* This minor tab is in the current major tab section */ if ( nc->page_number >= top_major_page && NB_IS_CHILD_MINOR(nc->child_type) ) { if (!num_minor) { /* Mark the first tab in this section */ start_minor = child; start_minor_idx = i; } if (nc->page_number <= nb->notebook.current_page_number) { /* Mark the closest tab to the current page */ top_minor = child; top_minor_page = nc->page_number; top_minor_idx = i; } else { /* Count of tabs past the current page */ num_rest_minor++; } if (nc->page_number < first_minor_page) { /* Mark the closest previous tab to the first visible tab */ prev_minor = child; num_prev_minor++; } else if (nc->page_number > first_minor_page) { if (!num_next_minor) { /* Mark the closest next tab to the current page */ next_minor = child; } /* Count of tabs after the current page */ num_next_minor++; } end_minor_idx = i; num_minor++; } } } /* * Find the number of possibly visible tabs (num_visible_xxx), and * find whether the tab scroller is needed (notebook.need_scroller) */ nb->notebook.need_scroller = XmNONE; /* Major tab */ if (nb->notebook.orientation == XmHORIZONTAL) { frame_dim = nb->notebook.frame_height; tab_dim = MAX(nb->notebook.major_height, 1); /* Avoid div 0 */ scroller_dim = nb->notebook.major_scroller_height; } else /* (nb->notebook.orientation == XmVERTICAL) */ { frame_dim = nb->notebook.frame_width; tab_dim = MAX(nb->notebook.major_width, 1); /* Avoid div 0 */ scroller_dim = nb->notebook.major_scroller_width; } spacing = MAX(nb->notebook.major_spacing, nb->notebook.shadow_thickness); num_visible_major = (int)(frame_dim - nb->notebook.back_page_size - nb->notebook.shadow_thickness) / (int)(tab_dim + spacing); if (num_visible_major < num_major) { nb->notebook.need_scroller = XmMAJOR_TAB_SCROLLER; num_visible_major = (int)(frame_dim - nb->notebook.back_page_size - scroller_dim - MAX(0, (int)(scroller_dim - nb->notebook.back_page_size)) - nb->notebook.shadow_thickness ) / (int)(tab_dim + spacing); } /* Minor tab */ if (nb->notebook.orientation == XmHORIZONTAL) { frame_dim = nb->notebook.frame_width; tab_dim = MAX(nb->notebook.minor_width, 1); /* Avoid div 0 */ scroller_dim = nb->notebook.minor_scroller_width; } else /* (nb->notebook.orientation == XmVERTICAL) */ { frame_dim = nb->notebook.frame_height; tab_dim = MAX(nb->notebook.minor_height, 1); /* Avoid div 0 */ scroller_dim = nb->notebook.minor_scroller_height; } spacing = MAX(nb->notebook.minor_spacing, nb->notebook.shadow_thickness); num_visible_minor = (int)(frame_dim - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - nb->notebook.shadow_thickness) / (int)(tab_dim + spacing); if (num_visible_minor < num_minor) { if (NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller)) nb->notebook.need_scroller = XmTAB_SCROLLER; else nb->notebook.need_scroller = XmMINOR_TAB_SCROLLER; num_visible_minor = (int)(frame_dim - MAX(0, (int)(nb->notebook.back_page_size - nb->notebook.real_binding_width)) - scroller_dim - MAX(0, (int)(scroller_dim - nb->notebook.back_page_size)) - nb->notebook.shadow_thickness) / (int)(tab_dim + spacing); } /* * If tab scrolling, then determine first tab but leave top tab alone. */ /* Major tab */ if (NB_IS_CHILD_MAJOR_SCROLLER(reason)) { if (scroll == _NEXT) { /* If there is a next non-visible tab(s), move up one */ if (num_next_major >= num_visible_major) nb->notebook.first_major = next_major; } else if (scroll == _PREVIOUS) { /* If there is a prev non-visible tab(s), move back one */ if (num_prev_major > 0) nb->notebook.first_major = prev_major; } else if (scroll == _HOME) { /* If there is a starting tab, move to it */ if (start_major) nb->notebook.first_major = start_major; } else if (scroll == _END) { /* Back up from the last tab "num_visible_major" tabs */ for (count = num_visible_major,i = nb->composite.num_children -1; i >= 0 && count > 0; i--) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->active && NB_IS_CHILD_MAJOR(nc->child_type)) { nb->notebook.first_major = child; count--; } } } return; } /* Minor tab */ if (NB_IS_CHILD_MINOR_SCROLLER(reason)) { if (scroll == _NEXT) { if (num_next_minor >= num_visible_minor) nb->notebook.first_minor = next_minor; } else if (scroll == _PREVIOUS) { if (num_prev_minor > 0) nb->notebook.first_minor = prev_minor; } else if (scroll == _HOME) { nb->notebook.first_minor = start_minor; } else if (scroll == _END) { for (count = num_visible_minor,i = end_minor_idx; i >= 0 && i >= start_minor_idx && count > 0; i--) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->active && NB_IS_CHILD_MINOR(nc->child_type)) { nb->notebook.first_minor = child; count--; } } } return; } /* * If going to a new page, then determine if we need to scroll * the tabs to make the top major/minor tabs visible */ if (NB_IS_CHILD_PAGE(reason) || NB_IS_CHILD_PAGE_SCROLLER(reason) || NB_IS_CHILD_MAJOR(reason) || NB_IS_CHILD_MINOR(reason)) { if (top_major && (top_major != nb->notebook.top_major)) { if (NB_IS_VISIBLE(top_major)) reason = XmMAJOR_TAB; } else if (top_minor && (top_minor != nb->notebook.top_minor)) { if (NB_IS_VISIBLE(top_minor)) reason = XmMINOR_TAB; } } /* * Set new top major/minor tabs */ nb->notebook.old_top_major = nb->notebook.top_major; nb->notebook.top_major = top_major; nb->notebook.old_top_minor = nb->notebook.top_minor; nb->notebook.top_minor = top_minor; /* * Determine new first tab for the new top tab. * If apparently activated by a minor tab, we don't need to do anything * because the top major and minor must be visible . * If apparently activated by a major tab, we don't need to do anything. */ /* A page change NOT caused by a major tab activiation */ if (!NB_IS_CHILD_MAJOR(reason) && !NB_IS_CHILD_MINOR(reason)) { /* Set the first tab to the starting tab, if we do not need a page scroller or if the calculated top tab page number is less than the first page number */ if (!NB_IS_CHILD_MAJOR_SCROLLER(nb->notebook.need_scroller) || (top_major_page <= nb->notebook.first_page_number)) nb->notebook.first_major = start_major; /* Set the first tab to the calculated top tab, if it is the only one that might be visible */ else if (num_visible_major <= 1) nb->notebook.first_major = top_major; /* Set the first tab so that the top tab is near the center of the visible tabs */ else { half = num_visible_major /2; half += MAX(((num_visible_major - 1) /2) - num_rest_major, 0); nb->notebook.first_major = top_major; for (i = top_major_idx - 1; i >= 0 && half > 0; i--) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->active && NB_IS_CHILD_MAJOR(nc->child_type)) { nb->notebook.first_major = child; half--; } } } } /* Minor tab */ if (!(NB_IS_CHILD_MINOR(reason))) { /* Set the first tab to the starting tab in this tab section, if we do not need a page scroller or if the calculated top tab page number is less than the first page number */ if (!NB_IS_CHILD_MINOR_SCROLLER(nb->notebook.need_scroller) || (top_minor_page <= nb->notebook.first_page_number)) nb->notebook.first_minor = start_minor; /* Set the first tab to the calculated top tab, if it is the only one that might be visible */ else if (num_visible_minor <= 1) nb->notebook.first_minor = top_minor; /* Set the first tab so that the top tab is near the center of the visible tabs */ else { half = num_visible_minor /2; half += MAX(((num_visible_minor - 1) /2) - num_rest_minor, 0); nb->notebook.first_minor = top_minor; for (i = top_minor_idx - 1; i >= 0 && half > 0; i--) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->active) { if (NB_IS_CHILD_MAJOR(nc->child_type)) break; else if (NB_IS_CHILD_MINOR(nc->child_type)) { nb->notebook.first_minor = child; half--; } } } } } } /***************************************************************************** * * * Drawing Functions * * * *****************************************************************************/ /*- GetFrameGCs ------------------------------------------------------------- Get the GC's for drawing notebook frame and binding -----------------------------------------------------------------------------*/ static void GetFrameGCs ( XmNotebookWidget nb) { XGCValues values; XtGCMask mask, dynamicMask; if (nb->notebook.frame_gc) XtReleaseGC((Widget)nb, nb->notebook.frame_gc); if (nb->notebook.binding_gc) XtReleaseGC((Widget)nb, nb->notebook.binding_gc); dynamicMask = GCForeground; mask = GCForeground | GCBackground | GCLineWidth; values.foreground = nb->manager.foreground; values.background = nb->notebook.frame_background; values.line_width = 1; nb->notebook.frame_gc = XtAllocateGC((Widget)nb, 0, mask, &values, dynamicMask, 0); mask = GCForeground | GCBackground; dynamicMask = (GCFillStyle | GCTile | GCStipple | GCTileStipXOrigin | GCTileStipYOrigin); values.foreground = nb->manager.foreground; values.background = nb->notebook.frame_background; nb->notebook.binding_gc = XtAllocateGC((Widget)nb, 0, mask, &values, dynamicMask, 0); } /*- GetBackpageGCs --------------------------------------------------------- Get the GC's for drawing notebook backpages. These two may be shared with other widgets. -----------------------------------------------------------------------------*/ static void GetBackpageGCs ( XmNotebookWidget nb) { XGCValues values; XtGCMask mask, dynamicMask, unusedMask; if (nb->notebook.foreground_gc) XtReleaseGC((Widget)nb, nb->notebook.foreground_gc); if (nb->notebook.background_gc) XtReleaseGC((Widget)nb, nb->notebook.background_gc); /* Will often be the same as HighlightGC in List */ mask = GCForeground; dynamicMask = (GCLineWidth | GCLineStyle | GCClipMask | GCClipXOrigin | GCClipYOrigin); unusedMask = GCBackground | GCDashList; values.foreground = nb->notebook.back_page_foreground; nb->notebook.foreground_gc = XtAllocateGC((Widget)nb, 0, mask, &values, dynamicMask, unusedMask); /* Will often be the same as InverseGC in List */ mask |= GCGraphicsExposures; dynamicMask = GCClipMask | GCClipXOrigin | GCClipYOrigin; unusedMask = GCBackground | GCFont; values.foreground = nb->notebook.back_page_background; values.graphics_exposures = FALSE; nb->notebook.background_gc = XtAllocateGC((Widget)nb, 0, mask, &values, dynamicMask, unusedMask); } /*- MakeSpiralPixmap ------------------------------------------------------- Makes a spiral binding pixmap. Uses instance state: binding placement (XmNorientation and XmNbackPagePlacement) Updates instance state: spiral_pixmap Parameters: IN width - binding area width IN height - binding area height -----------------------------------------------------------------------------*/ static void MakeSpiralPixmap ( XmNotebookWidget nb, Dimension width, Dimension height) { int rx=0, ry=0, rw=0, rh=0; /* rectangle values for binding surface */ int sx=0, sy=0, sw=0, sh=0, sd=0; /* spiral values */ int a1=0, a2=0, a3=0, a4=0; /* spiral angle values */ int hx=0, hy=0, hd=0; /* hole values */ int lx1=0, ly1=0, lx2=0, ly2=0; /* line values for binding edge */ int pw=0, ph=0; /* pixmap size */ int gap=0; /* gap between spirals */ int div; /* division of binding width */ int i; Pixmap pixmap; /* check binding width for reasonable values */ if (width < MIN_DRAWABLE_SPIRAL_SIZE || height < MIN_DRAWABLE_SPIRAL_SIZE) return; /* * Determine spiral component values */ if (nb->notebook.binding_pos == LEFT) { div = width / 3; gap = div / 2; pw = width; ph = div + gap; sx = 0; sy = gap / 2; sw = div * 2; sh = div; sd = sh / 4; a1 = 270 - 20; a2 = -270; a3 = 90 - 20; a4 = 110; hx = sx + sw - sd; hy = sy + (sh / 2) - sd +1; hd = MIN(div, sd * 2); rx = div; ry = 0; rw = width - div; rh = ph; lx1 = div; ly1 = 0; lx2 = lx1; ly2 = ph; } else if (nb->notebook.binding_pos == RIGHT) { div = width / 3; gap = div / 2; pw = width; ph = div + gap; sx = div - 1; sy = gap / 2; sw = div * 2; sh = div; sd = sh / 4; a1 = 275; a2 = 270; a3 = 90 - 10; a4 = 100; hx = sx - (sd / 2); hy = sy + (sh / 2) - sd +1; hd = MIN(div, sd * 2); rx = 0; ry = 0; rw = pw - div; rh = ph; lx1 = pw - div; ly1 = 0; lx2 = lx1; ly2 = rh; } else if (nb->notebook.binding_pos == TOP) { div = height / 3; gap = div / 2; pw = div + gap; ph = height; sx = gap / 2; sy = 0; sw = div; sh = div * 2; sd = sw / 4; a1 = 0 + 15; a2 = 270; a3 = 90; a4 = 110; hx = sx + (sw / 2) - sd +1; hy = sh - sd; hd = MIN(div, sd * 2); rx = 0; ry = div; rw = pw; rh = height - div; lx1 = 0; ly1 = div; lx2 = pw; ly2 = ly1; } else if (nb->notebook.binding_pos == BOTTOM) { div = height / 3; gap = div / 2; pw = div + gap; ph = height; sx = gap / 2; sy = div -1; sw = div; sh = (div * 2); sd = sw / 4; a1 = 360 - 5; a2 = -295; a3 = 90 + 8; a4 = 110; hx = sx + (sw / 2); hy = sy; hd = MIN(div, sd * 2); rx = 0; ry = 0; rw = pw; rh = ph - div; lx1 = 0; ly1 = ph - div; lx2 = pw; ly2 = ly1; } /* * Create spiral pixmap, if previous one exists destroy it */ if (nb->notebook.spiral_pixmap != XmUNSPECIFIED_PIXMAP && nb->notebook.spiral_pixmap != XmNONE) XFreePixmap(XtDisplay(nb), nb->notebook.spiral_pixmap); pixmap = nb->notebook.spiral_pixmap = XCreatePixmap(XtDisplay(nb), XtWindow(nb), pw, ph, nb->core.depth); /* * Scribble in spiral pixmap */ /* Fill pixmap with notebook background */ XFillRectangle(XtDisplay(nb), pixmap, nb->manager.background_GC, 0, 0, pw, ph); /* draw binding surface */ XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->notebook.frame_background); XFillRectangle(XtDisplay(nb), pixmap, nb->notebook.frame_gc, rx, ry, rw, rh); /* draw line along binding surface */ XSetClipMask(XtDisplay(nb), nb->notebook.foreground_gc, None); XSetLineAttributes(XtDisplay(nb), nb->notebook.foreground_gc, 1, LineSolid, CapRound, JoinMiter); XDrawLine(XtDisplay(nb), pixmap, nb->notebook.foreground_gc, lx1, ly1, lx2, ly2); /* draw hole in binding surface with top/bottom shadows */ XFillArc(XtDisplay(nb), pixmap, nb->manager.background_GC, hx, hy, hd, hd, 0, 360 * 64); XDrawArc(XtDisplay(nb), pixmap, nb->manager.bottom_shadow_GC, hx, hy, hd, hd, 225 * 64, -180 * 64); XDrawArc(XtDisplay(nb), pixmap, nb->manager.top_shadow_GC, hx, hy, hd, hd, 45 * 64, -180 * 64); /* draw spiral with top/bottom shadows */ XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->manager.foreground); XSetLineAttributes(XtDisplay(nb), nb->notebook.frame_gc, 1, LineSolid, CapRound, JoinMiter); for(i=1; i < sd; i++) XDrawArc(XtDisplay(nb), pixmap, nb->notebook.frame_gc, sx +i, sy +i, sw -i, sh -i, a1 * 64, a2 * 64); XSetLineAttributes(XtDisplay(nb), nb->notebook.frame_gc, MAX(0,sd -2), LineSolid, CapRound, JoinMiter); XDrawArc(XtDisplay(nb), pixmap, nb->notebook.frame_gc, sx +(sd/2), sy +(sd/2), sw, sh, a3 * 64, a4 * 64); XDrawArc(XtDisplay(nb), pixmap, nb->manager.top_shadow_GC, sx, sy, sw, sh, a1 * 64, a2 * 64); XDrawArc(XtDisplay(nb), pixmap, nb->manager.bottom_shadow_GC, sx +sd, sy +sd, sw -sd, sh -sd, a1 * 64, a2 * 64); } /*- DrawBinding ------------------------------------------------------------- Draw the Notebook binding -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void DrawBinding ( XmNotebookWidget nb, XExposeEvent *event, /* unused */ Region region) { Dimension x, y, width, height; /* check binding type resource and binding width */ if (nb->notebook.binding_type == XmNONE || nb->notebook.real_binding_width <= 0) return; /* get the binding area */ x = y = 0; if (nb->notebook.major_pos == LEFT) x += NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width) + nb->notebook.back_page_size + nb->notebook.frame_width; else if (nb->notebook.major_pos == TOP) y += NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height) + nb->notebook.back_page_size + nb->notebook.frame_height; if (nb->notebook.minor_pos == LEFT) x += NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) + nb->notebook.back_page_size; else if (nb->notebook.minor_pos == TOP) y += NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) + nb->notebook.back_page_size; if (nb->notebook.orientation == XmHORIZONTAL) { width = nb->notebook.real_binding_width; height = nb->notebook.frame_height - 1; y += 1; } else { width = nb->notebook.frame_width - 1; height = nb->notebook.real_binding_width; x += 1; } /* draw the binding if applicable */ if (XRectInRegion(region, x, y, width, height)) { switch (nb->notebook.binding_type) { case XmSOLID: XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->manager.foreground); XFillRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.frame_gc, x, y, width, height); break; case XmSPIRAL: MakeSpiralPixmap (nb, width, height); DrawPixmapBinding(nb, x, y, width, height, nb->notebook.spiral_pixmap); break; case XmPIXMAP: DrawPixmapBinding(nb, x, y, width, height, nb->notebook.binding_pixmap); break; case XmPIXMAP_OVERLAP_ONLY: DrawPixmapBinding(nb, x, y, width, height, nb->notebook.binding_pixmap); break; } /* switch */ } /* if */ } /*- DrawPixmapBinding ------------------------------------------------------- Draw the pixmap binding -----------------------------------------------------------------------------*/ static void DrawPixmapBinding ( XmNotebookWidget nb, Dimension x, Dimension y, Dimension width, Dimension height, Pixmap pixmap) { int depth; int x_origin, y_origin; XGCValues values; XtGCMask mask; /* no pixmap? don't draw */ if (pixmap == XmUNSPECIFIED_PIXMAP || pixmap == XmNONE) return; /* get Pixmap depth */ XmeGetPixmapData(XtScreen(nb), pixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); /* creating the gc */ if (depth == 1) { mask = GCFillStyle | GCStipple; values.fill_style = FillStippled; values.stipple = pixmap; } else { mask = GCFillStyle | GCTile; values.fill_style = FillTiled; values.tile = pixmap; } XChangeGC(XtDisplay(nb), nb->notebook.binding_gc, mask, &values); /* * set TSOrigin */ if (nb->notebook.binding_pos == LEFT || nb->notebook.binding_pos == TOP) x_origin = x, y_origin = y; else if (nb->notebook.binding_pos == RIGHT) x_origin = x + width - 1, y_origin = y; else /* if (nb->notebook.binding_pos == BOTTOM) */ x_origin = x, y_origin = y + height; XSetTSOrigin(XtDisplay(nb), nb->notebook.binding_gc, x_origin, y_origin); /* display the pixmap binding */ XFillRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.binding_gc, x, y, width -1, height - 1); } /*- DrawFrameShadow --------------------------------------------------------- Draw the Notebook frame shadow -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void DrawFrameShadow ( XmNotebookWidget nb, XExposeEvent *event, /* unused */ Region region) /* unused */ { Dimension x, y, width, height; Region shadow_region; XRectangle rect; /* get the page's x, y position */ x = y = 1; if (nb->notebook.binding_pos == LEFT) x += nb->notebook.real_binding_width; else if (nb->notebook.binding_pos == TOP) y += nb->notebook.real_binding_width; if (nb->notebook.major_pos == LEFT) x += NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width) + nb->notebook.back_page_size; else if (nb->notebook.major_pos == TOP) y += NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height) + nb->notebook.back_page_size; if (nb->notebook.minor_pos == LEFT) x += NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) + nb->notebook.back_page_size; else if (nb->notebook.minor_pos == TOP) y += NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) + nb->notebook.back_page_size; width = nb->notebook.frame_width - 2; height = nb->notebook.frame_height - 2; XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->notebook.frame_background); /* draw the frame shadow */ if (nb->notebook.shadow_thickness) { /* draw the shadow */ /* creating the shadow region */ shadow_region = XCreateRegion(); /* adding the frame area to the shadow region */ rect.x = x; rect.y = y; rect.width = width; rect.height = height; XFillRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.frame_gc, x, y, width + 1, height + 1); XUnionRectWithRegion(&rect, shadow_region, shadow_region); /* adding the top major tab area to the shadow region */ if (nb->notebook.top_major && NB_IS_VISIBLE(nb->notebook.top_major) && !NB_IS_CHILD_JOINSIDE(nb->notebook.top_major)) { rect.x = nb->notebook.top_major->core.x - nb->notebook.shadow_thickness; rect.y = nb->notebook.top_major->core.y - nb->notebook.shadow_thickness; rect.width = nb->notebook.top_major->core.width + nb->notebook.shadow_thickness * 2 - 1; rect.height = nb->notebook.top_major->core.height + nb->notebook.shadow_thickness * 2 - 1; /* ensure x/y of rect does not go negative */ /* this can be removed when _XmRegionDrawShadow is fixed to allow negative y values */ if( rect.x < 0) { rect.width -= rect.x; rect.x = 0; } if( rect.y < 0) { rect.height -= rect.y; rect.y = 0; } XUnionRectWithRegion(&rect, shadow_region, shadow_region); } /* adding the top minor tab area to the shadow region */ if (nb->notebook.top_minor && NB_IS_VISIBLE(nb->notebook.top_minor) && !NB_IS_CHILD_JOINSIDE(nb->notebook.top_minor)) { rect.x = nb->notebook.top_minor->core.x - nb->notebook.shadow_thickness; rect.y = nb->notebook.top_minor->core.y - nb->notebook.shadow_thickness; rect.width = nb->notebook.top_minor->core.width + nb->notebook.shadow_thickness * 2 - 1; rect.height = nb->notebook.top_minor->core.height + nb->notebook.shadow_thickness * 2 - 1; /* ensure x/y of rect does not go negative */ /* this can be removed when _XmRegionDrawShadow is fixed to allow negative y values */ if( rect.x < 0) { rect.width -= rect.x; rect.x = 0; } if( rect.y < 0) { rect.height -= rect.y; rect.y = 0; } XUnionRectWithRegion(&rect, shadow_region, shadow_region); } /* draw the shadow */ _XmRegionDrawShadow(XtDisplay(nb), XtWindow(nb), nb->manager.top_shadow_GC, nb->manager.bottom_shadow_GC, (XmRegion)shadow_region, nb->core.border_width, nb->notebook.shadow_thickness, XmSHADOW_OUT); XDestroyRegion(shadow_region); } else { XFillRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.frame_gc, x, y, width, height); XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->manager.foreground); XDrawRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.frame_gc, x, y, width, height); if (nb->notebook.top_major && NB_IS_VISIBLE(nb->notebook.top_major) && !NB_IS_CHILD_JOINSIDE(nb->notebook.top_major)) { rect.x = nb->notebook.top_major->core.x - 1; rect.y = nb->notebook.top_major->core.y - 1; rect.width = nb->notebook.top_major->core.width + 1; rect.height = nb->notebook.top_major->core.height + 1; /* ensure x/y of rect does not go negative */ /* this can be removed when _XmRegionDrawShadow is fixed to allow negative y values */ if( rect.x < 0) { rect.width -= rect.x; rect.x = 0; } if( rect.y < 0) { rect.height -= rect.y; rect.y = 0; } XDrawRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.frame_gc, rect.x, rect.y, rect.width, rect.height); } /* adding the top minor tab area to the shadow region */ if (nb->notebook.top_minor && NB_IS_VISIBLE(nb->notebook.top_minor) && !NB_IS_CHILD_JOINSIDE(nb->notebook.top_minor)) { rect.x = nb->notebook.top_minor->core.x - 1; rect.y = nb->notebook.top_minor->core.y - 1; rect.width = nb->notebook.top_minor->core.width + 1; rect.height = nb->notebook.top_minor->core.height + 1; /* ensure x/y of rect does not go negative */ /* this can be removed when _XmRegionDrawShadow is fixed to allow negative y values */ if( rect.x < 0) { rect.width -= rect.x; rect.x = 0; } if( rect.y < 0) { rect.height -= rect.y; rect.y = 0; } XDrawRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.frame_gc, rect.x, rect.y, rect.width, rect.height); } } } /*- DrawBackPages ----------------------------------------------------------- Draw Notebook back pages -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void DrawBackPages ( XmNotebookWidget nb, XExposeEvent *event, /* unused */ Region region) { int delta, back; /* backpage foreground & background deltas */ int binding_width; /* the real binding width */ int dx, dy; /* delta-x and delta-y */ int mx, my; /* maximum delta-x and delta-y */ int x, y, limit; /* temporary variables */ XPoint p[5]; /* foreground line pattern */ XPoint q[3]; /* background line pattern */ /* * initialize */ delta = nb->notebook.back_page_size / nb->notebook.real_back_page_number; /* draw backpages on the frame, which is not necessarily along the entire binding */ if (nb->notebook.binding_type == XmPIXMAP) binding_width = MAX(nb->notebook.real_binding_width, nb->notebook.binding_width); else binding_width = MIN(nb->notebook.real_binding_width, nb->notebook.binding_width); /* find back page line pattern */ if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { p[1].x = nb->notebook.real_binding_width - binding_width; p[1].y = nb->notebook.frame_height; p[2].x = binding_width + nb->notebook.frame_width; p[2].y = 0; p[3].x = 0; p[3].y = - nb->notebook.frame_height; p[4].x = - delta; p[4].y = 0; p[0].x = p[1].x; p[0].y = p[1].y - delta; x = 0; y = delta; dx = dy = delta; mx = my = nb->notebook.back_page_size; } else if (nb->notebook.back_page_pos == XmBOTTOM_RIGHT && nb->notebook.orientation == XmVERTICAL) { p[1].x = nb->notebook.frame_width; p[1].y = nb->notebook.real_binding_width - binding_width; p[2].x = 0; p[2].y = binding_width + nb->notebook.frame_height; p[3].x = - nb->notebook.frame_width; p[3].y = 0; p[4].x = 0; p[4].y = - delta; p[0].x = p[1].x - delta; p[0].y = p[1].y; x = delta; y = 0; dx = dy = delta; mx = my = nb->notebook.back_page_size; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmHORIZONTAL) { p[1].x = NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width) + nb->notebook.back_page_size + nb->notebook.frame_width + binding_width - 1; p[1].y = nb->notebook.frame_height; p[2].x = - (nb->notebook.frame_width + binding_width); p[2].y = 0; p[3].x = 0; p[3].y = - nb->notebook.frame_height; p[4].x = delta; p[4].y = 0; p[0].x = p[1].x; p[0].y = p[1].y - delta; x = 0; y = delta; dx = - delta; dy = delta; mx = - nb->notebook.back_page_size; my = nb->notebook.back_page_size; } else if (nb->notebook.back_page_pos == XmBOTTOM_LEFT && nb->notebook.orientation == XmVERTICAL) { p[1].x = nb->notebook.back_page_size + NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) - 1; p[1].y = nb->notebook.real_binding_width - binding_width; p[2].x = 0; p[2].y = binding_width + nb->notebook.frame_height; p[3].x = nb->notebook.frame_width; p[3].y = 0; p[4].x = 0; p[4].y = - delta; p[0].x = p[1].x + delta; p[0].y = p[1].y; x = - delta; y = 0; dx = - delta; dy = delta; mx = - nb->notebook.back_page_size; my = nb->notebook.back_page_size; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmHORIZONTAL) { p[1].x = nb->notebook.real_binding_width - binding_width; p[1].y = nb->notebook.back_page_size + NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) - 1; p[2].x = binding_width + nb->notebook.frame_width; p[2].y = 0; p[3].x = 0; p[3].y = nb->notebook.frame_height; p[4].x = - delta; p[4].y = 0; p[0].x = p[1].x; p[0].y = p[1].y + delta; x = 0; y = - delta; dx = delta; dy = - delta; mx = nb->notebook.back_page_size; my = - nb->notebook.back_page_size; } else if (nb->notebook.back_page_pos == XmTOP_RIGHT && nb->notebook.orientation == XmVERTICAL) { p[1].x = nb->notebook.frame_width; p[1].y = nb->notebook.back_page_size + nb->notebook.frame_height + binding_width + NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height) - 1; p[2].x = 0; p[2].y = - (binding_width + nb->notebook.frame_height); p[3].x = - nb->notebook.frame_width; p[3].y = 0; p[4].x = 0; p[4].y = delta; p[0].x = p[1].x - delta; p[0].y = p[1].y; x = delta; y = 0; dx = delta; dy = - delta; mx = nb->notebook.back_page_size; my = - nb->notebook.back_page_size; } else if (nb->notebook.back_page_pos == XmTOP_LEFT && nb->notebook.orientation == XmHORIZONTAL) { p[1].x = nb->notebook.back_page_size + nb->notebook.frame_width + binding_width + NB_MAJOR_MAX(nb, nb->notebook.major_width, nb->notebook.major_scroller_width) - 1; p[1].y = nb->notebook.back_page_size + NB_MINOR_MAX(nb, nb->notebook.minor_height, nb->notebook.minor_scroller_height) - 1; p[2].x = - (binding_width + nb->notebook.frame_width); p[2].y = 0; p[3].x = 0; p[3].y = nb->notebook.frame_height; p[4].x = delta; p[4].y = 0; p[0].x = p[1].x; p[0].y = p[1].y + delta; x = 0; y = - delta; dx = - delta; dy = - delta; mx = - nb->notebook.back_page_size; my = - nb->notebook.back_page_size; } else { p[1].x = nb->notebook.back_page_size + NB_MINOR_MAX(nb, nb->notebook.minor_width, nb->notebook.minor_scroller_width) - 1; p[1].y = nb->notebook.back_page_size + nb->notebook.frame_height + binding_width + NB_MAJOR_MAX(nb, nb->notebook.major_height, nb->notebook.major_scroller_height) -1; p[2].x = 0; p[2].y = - (binding_width + nb->notebook.frame_height); p[3].x = nb->notebook.frame_width; p[3].y = 0; p[4].x = 0; p[4].y = delta; p[0].x = p[1].x + delta; p[0].y = p[1].y; x = - delta; y = 0; dx = - delta; dy = - delta; mx = - nb->notebook.back_page_size; my = - nb->notebook.back_page_size; } /* set the clipping region if necessary */ XSetRegion(XtDisplay(nb), nb->notebook.foreground_gc, region); XSetRegion(XtDisplay(nb), nb->notebook.background_gc, region); XSetClipOrigin(XtDisplay(nb), nb->notebook.foreground_gc, 0, 0); XSetClipOrigin(XtDisplay(nb), nb->notebook.background_gc, 0, 0); /* draw the first page outline */ XSetLineAttributes(XtDisplay(nb), nb->notebook.foreground_gc, 1, LineSolid, CapButt, JoinMiter); if (nb->notebook.binding_type == XmSPIRAL || nb->notebook.binding_type == XmPIXMAP || nb->notebook.binding_type == XmSOLID || nb->notebook.binding_type == XmNONE || nb->notebook.binding_type == XmPIXMAP_OVERLAP_ONLY) { Dimension width, height; Position x, y; /* We can't pass a negative width or height to the draw call. Since it appears that draw functions later in the code need the p values set as above, let's check whether the height and width here are negative and adjust the draw coordinates as appropriate. */ if (nb->notebook.orientation == XmHORIZONTAL) { ADJUST_NEGATIVE_DIMENSION(p[1].x, p[2].x, x, width); ADJUST_NEGATIVE_DIMENSION(p[1].y, p[3].y, y, height); XDrawRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.foreground_gc, x, y, width, height); } else { ADJUST_NEGATIVE_DIMENSION(p[1].x, p[3].x, x, width); ADJUST_NEGATIVE_DIMENSION(p[1].y, p[2].y, y, height); XDrawRectangle(XtDisplay(nb), XtWindow(nb), nb->notebook.foreground_gc, x, y, width, height); } } /* for XmSOLID, XmPIXMAP, and XmPIXMAP_OVERLAP_ONLY */ if (nb->notebook.binding_type == XmSOLID || nb->notebook.binding_type == XmPIXMAP || nb->notebook.binding_type == XmPIXMAP_OVERLAP_ONLY) { /* draw back page lines */ x = p[1].x; y = p[1].y; limit = nb->notebook.back_page_size; while (limit > 0) { /* draw backpage foreground */ XDrawLines(XtDisplay(nb), XtWindow(nb), nb->notebook.foreground_gc, &(p[1]), 4, CoordModePrevious); /* draw backpage background */ if (delta >= 2 && limit > delta - 2) { back = delta - 1; q[0].x = p[1].x; q[0].y = p[1].y; q[1].x = p[2].x; q[1].y = p[2].y; q[2].x = p[3].x; q[2].y = p[3].y; q[0].x += NB_ENFORCE_SIGN(dx, 1); q[0].y += NB_ENFORCE_SIGN(dy, 1); if (q[2].x) q[2].x += dx; if (q[2].y) q[2].y += dy; while (back > 0) { XDrawLines(XtDisplay(nb), XtWindow(nb), nb->notebook.background_gc, q, 3, CoordModePrevious); q[0].y += NB_ENFORCE_SIGN(dy, 1); q[0].x += NB_ENFORCE_SIGN(dx, 1); if (q[2].x) q[2].x -= NB_ENFORCE_SIGN(dx, 1); if (q[2].y) q[2].y -= NB_ENFORCE_SIGN(dy, 1); back--; } } p[1].x += dx; p[1].y += dy; limit -= delta; } /* draw the last page line */ p[0].x = x; p[0].y = y; p[1].x = mx; p[1].y = my; XSetLineAttributes(XtDisplay(nb), nb->notebook.foreground_gc, 2, LineSolid, CapButt, JoinMiter); XDrawLines(XtDisplay(nb), XtWindow(nb), nb->notebook.foreground_gc, p, 5, CoordModePrevious); } /* for XmNONE and XmSPIRAL */ else { /* draw back page lines */ p[1].x = x; p[1].y = y; x = p[0].x; y = p[0].y; limit = nb->notebook.back_page_size; while (limit > 0) { /* draw backpage foreground */ XDrawLines(XtDisplay(nb), XtWindow(nb), nb->notebook.foreground_gc, p, 5, CoordModePrevious); /* draw backpage background */ if (delta >= 2 && limit > delta - 2) { back = delta - 1; q[0].x = p[0].x + p[1].x; q[0].y = p[0].y + p[1].y; q[1].x = p[2].x; q[1].y = p[2].y; q[2].x = p[3].x; q[2].y = p[3].y; q[0].x += NB_ENFORCE_SIGN(dx, 1); q[0].y += NB_ENFORCE_SIGN(dy, 1); if (q[1].x) { q[0].x += dx; q[1].x -= dx; } if (q[1].y) { q[0].y += dy; q[1].y -= dy; } if (q[2].x) q[2].x += dx; if (q[2].y) q[2].y += dy; while (back > 0) { XDrawLines(XtDisplay(nb), XtWindow(nb), nb->notebook.background_gc, q, 3, CoordModePrevious); if (q[1].x) { q[0].y += NB_ENFORCE_SIGN(dy, 1); q[1].x += NB_ENFORCE_SIGN(dx, 1); } if (q[1].y) { q[0].x += NB_ENFORCE_SIGN(dx, 1); q[1].y += NB_ENFORCE_SIGN(dy, 1); } if (q[2].x) q[2].x -= NB_ENFORCE_SIGN(dx, 1); if (q[2].y) q[2].y -= NB_ENFORCE_SIGN(dy, 1); back--; } } p[0].x += dx; p[0].y += dy; limit -= delta; } /* draw the last page line */ p[0].x = x + mx; p[0].y = y + my; XSetLineAttributes(XtDisplay(nb), nb->notebook.foreground_gc, 2, LineSolid, CapButt, JoinMiter); XDrawLines(XtDisplay(nb), XtWindow(nb), nb->notebook.foreground_gc, p, 5, CoordModePrevious); } } /***************************************************************************** * * * Geometry Functions * * * *****************************************************************************/ /*- CalcGeoInfo ------------------------------------------------------------ Calculate Notebook's preferred geometry. Updates instance state: page_width page_height status_width status_height major_width major_height minor_width minor_height scroller_width scroller_height major_scroller_width major_scroller_height minor_scroller_width minor_scroller_height frame_width frame_height real_binding_width real_back_page_number, if adjust is True Parameters: IN instigator - child widget requesting geo request IN desired - instigator's requested geometry IN adjust - flag to indicate whether instance geometry variables used for layout should be set. OUT preferred_width, OUT preferred_height - notebook w/h based on children sizes -----------------------------------------------------------------------------*/ static void CalcGeoInfo ( XmNotebookWidget nb, Widget instigator, XtWidgetGeometry *desired, Dimension *preferred_width, Dimension *preferred_height, Boolean adjust) { XmNotebookConstraint nc; Dimension width, height; Widget child; XtWidgetGeometry preferred; int i; unsigned int w, h; Dimension page_width = 0,page_height = 0; Dimension status_width = 0,status_height = 0; Dimension major_width = 0,major_height = 0; Dimension minor_width = 0,minor_height = 0; Dimension scroller_width = 0,scroller_height = 0; Dimension major_scroller_width = 0,major_scroller_height = 0; Dimension minor_scroller_width = 0,minor_scroller_height = 0; Dimension frame_width,frame_height; Dimension real_binding_width,real_back_page_number; /* get width and height of children */ for (i = 0; i < nb->composite.num_children; i++) { /* ask preferred size */ child = nb->composite.children[i]; if (child == instigator) { width = IsWidth(desired) ? desired->width : XtWidth(instigator); width += (IsBorder(desired) ? desired->border_width : XtBorderWidth(instigator)) * 2; height = IsHeight(desired) ? desired->height : XtHeight(instigator); height += (IsBorder(desired) ? desired->border_width : XtBorderWidth(instigator)) * 2; } else { XtQueryGeometry(child, NULL, &preferred); width = (preferred.request_mode & CWWidth) ? preferred.width : XtWidth(child) + child->core.border_width*2; height = (preferred.request_mode & CWHeight) ? preferred.height : XtHeight(child) + child->core.border_width*2; } /* get the maximum */ if (XtIsManaged(child)) { nc = NotebookConstraint(child); switch (nc->child_type) { case XmPAGE: ASSIGN_MAX(page_width, width); ASSIGN_MAX(page_height, height); break; case XmSTATUS_AREA: ASSIGN_MAX(status_width, width); ASSIGN_MAX(status_height, height); break; case XmMAJOR_TAB: ASSIGN_MAX(major_width, width); ASSIGN_MAX(major_height, height); break; case XmMINOR_TAB: ASSIGN_MAX(minor_width, width); ASSIGN_MAX(minor_height, height); break; case XmPAGE_SCROLLER: ASSIGN_MAX(scroller_width, width); ASSIGN_MAX(scroller_height, height); break; case XmMAJOR_TAB_SCROLLER: ASSIGN_MAX(major_scroller_width, width); ASSIGN_MAX(major_scroller_height, height); break; case XmMINOR_TAB_SCROLLER: ASSIGN_MAX(minor_scroller_width, width); ASSIGN_MAX(minor_scroller_height, height); break; } } } /* adjust page's width */ page_width = MAX((int)page_width, (int)(status_width + nb->notebook.margin_width + scroller_width)); /* set the real binding width */ real_binding_width = nb->notebook.binding_width; switch (nb->notebook.binding_type) { case XmNONE: real_binding_width = 0; break; case XmSPIRAL: real_binding_width = ((int)(nb->notebook.binding_width * 3))/2; break; case XmPIXMAP: if (nb->notebook.binding_pixmap != XmUNSPECIFIED_PIXMAP && nb->notebook.binding_pixmap != XmNONE) { w = h = 0; XmeGetPixmapData(XtScreen(nb),nb->notebook.binding_pixmap, NULL,NULL,NULL,NULL,NULL,NULL,&w,&h); if (nb->notebook.orientation == XmHORIZONTAL) { ASSIGN_MAX(real_binding_width, w); } else { ASSIGN_MAX(real_binding_width, h); } } break; /* Note: in case of XmPIXMAP_OVERLAP_ONLY binding_width is used so we don't care about the Pixmap size here */ } /* Calculate the real back page number */ real_back_page_number = nb->notebook.back_page_number; ASSIGN_MIN(real_back_page_number, (Dimension)(nb->notebook.back_page_size /2)); ASSIGN_MAX(real_back_page_number, 1); /* Calculate status w/h based on page,margin,& scroller w/h */ status_width = MAX(0,(int) (page_width - nb->notebook.margin_width - scroller_width)); status_height = scroller_height = MAX(status_height,scroller_height); /* Calculate the notebook frame size based on page size,shadows,& margins*/ frame_width = page_width + (nb->notebook.shadow_thickness * 2) + (nb->notebook.margin_width * 2) + 1; frame_height = page_height + status_height + (nb->notebook.shadow_thickness * 2) + (nb->notebook.margin_height * 3) + 1; /* * Return calculated notebook's preferred size */ /* add frame and back pages area */ *preferred_width = frame_width + nb->notebook.back_page_size; *preferred_height = frame_height + nb->notebook.back_page_size; /* add binding and tab area */ if (nb->notebook.orientation == XmHORIZONTAL) { *preferred_width += real_binding_width + NB_MAJOR_MAX(nb, major_width, major_scroller_width); *preferred_height += NB_MINOR_MAX(nb, minor_height, minor_scroller_height); } else { *preferred_width += NB_MINOR_MAX(nb, minor_width, minor_scroller_width); *preferred_height += real_binding_width + NB_MAJOR_MAX(nb, major_height, major_scroller_height); } /* * Set notebook geometry, if adjusting */ if (adjust) { nb->notebook.page_width = page_width; nb->notebook.page_height = page_height; nb->notebook.status_width = status_width; nb->notebook.status_height = status_height; nb->notebook.major_width = major_width; nb->notebook.major_height = major_height; nb->notebook.minor_width = minor_width; nb->notebook.minor_height = minor_height; nb->notebook.scroller_width = scroller_width; nb->notebook.scroller_height = scroller_height; nb->notebook.major_scroller_width = major_scroller_width; nb->notebook.major_scroller_height = major_scroller_height; nb->notebook.minor_scroller_width = minor_scroller_width; nb->notebook.minor_scroller_height = minor_scroller_height; nb->notebook.frame_width = frame_width; nb->notebook.frame_height = frame_height; nb->notebook.real_binding_width = real_binding_width; nb->notebook.real_back_page_number = real_back_page_number; } } /*- NewPreferredGeometry ---------------------------------------------------- Get Notebook's preferred geometry Parameters: IN instigator - child widget requesting geo request IN desired - instigator's requested geometry OUT preferred - w/h based on child's preferred sizes -----------------------------------------------------------------------------*/ static Boolean NewPreferredGeometry ( XmNotebookWidget nb, Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *preferred) { Dimension preferred_width, preferred_height; /* calculate preferred geometry information */ CalcGeoInfo(nb, instigator, desired, &preferred_width, &preferred_height, FALSE); preferred->width = preferred_width; preferred->height = preferred_height; preferred->request_mode = CWHeight | CWWidth; return(!((preferred->width == nb->core.width) && (preferred->height == nb->core.height))); } /*- AdjustGeometry ---------------------------------------------------------- Adjust notebook's children sizes based on the Notebook's width and height. The minimum width needed is determined by the following: 1. page and status are minimized until they reach XmNbackPageWidth 2. binding is minimized 3. major tabs are minimized 4. page scroller is minimized 5. back pages and frame are clipped The minimum height needed is determined by the following: 1. page is minimized 2. status and page scroller are minimized 3. minor tabs are minimized 4. back pages and frame are clipped -----------------------------------------------------------------------------*/ static void AdjustGeometry ( XmNotebookWidget nb, Widget instigator, XtWidgetGeometry *desired) { Dimension ideal_width,ideal_height; /* the value min is the minimum width/height that the Notebook can be after a component is reduced to its minimum */ Dimension min; /* calculate preferred geometry information */ CalcGeoInfo(nb, instigator, desired, &ideal_width, &ideal_height, TRUE); /* adjust children's width */ /* Notebook's width is bigger than ideal width */ if (nb->core.width > ideal_width) nb->notebook.page_width += nb->core.width - ideal_width; /* Notebook's width is smaller than ideal width */ else if (nb->core.width < ideal_width) { /* minimize the page area */ min = ideal_width - nb->notebook.page_width + nb->notebook.scroller_width; if (nb->core.width >= min) nb->notebook.page_width = nb->core.width - (min - nb->notebook.scroller_width); else if (nb->core.width < min) { nb->notebook.page_width = nb->notebook.scroller_width; if (nb->notebook.orientation == XmHORIZONTAL) { /* minimize the binding area */ min -= nb->notebook.real_binding_width; if (nb->core.width >= min) nb->notebook.real_binding_width = nb->core.width - min; else { /* minimize major tabs */ nb->notebook.real_binding_width = 0; min -= nb->notebook.major_width; if (nb->core.width > min) nb->notebook.major_width = nb->core.width - min; else nb->notebook.major_width = 0; } } else { /* minimize minor tabs */ min -= nb->notebook.minor_width; if (nb->core.width > min) nb->notebook.minor_width = nb->core.width - min; else nb->notebook.minor_width = 0; } } } /* adjust children's height */ /* Notebook's height is bigger than ideal height */ if (nb->core.height > ideal_height) nb->notebook.page_height += nb->core.height - ideal_height; /* Notebook's height is smaller than ideal height */ else if (nb->core.height < ideal_height) { /* minimize the page area */ min = ideal_height - nb->notebook.page_height; if (nb->core.height >= min) nb->notebook.page_height = nb->core.height - min; else if (nb->core.height < min) { /* minimize the page scroller area */ nb->notebook.page_height = 0; min -= nb->notebook.scroller_height; if (nb->core.height >= min) nb->notebook.scroller_height = nb->notebook.status_height = nb->core.height - min; else { nb->notebook.scroller_height = nb->notebook.status_height = 0; if (nb->notebook.orientation == XmVERTICAL) { /* minimize the binding area */ min -= nb->notebook.real_binding_width; if (nb->core.height >= min) nb->notebook.real_binding_width = nb->core.height - min; else { /* minimize major tabs */ nb->notebook.real_binding_width = 0; min -= nb->notebook.major_height; if (nb->core.height > min) nb->notebook.major_height = nb->core.height - min; else nb->notebook.major_height = 0; } } else { /* minimize minor tabs */ min -= nb->notebook.minor_height; if (nb->core.height > min) nb->notebook.minor_height = nb->core.height - min; else nb->notebook.minor_height = 0; } } } } /* Calculate status w/h based on page,margin,& scroller w/h */ nb->notebook.status_width = MAX(0,(int)(nb->notebook.page_width - nb->notebook.margin_width - nb->notebook.scroller_width)); nb->notebook.status_height = nb->notebook.scroller_height = MAX(nb->notebook.status_height, nb->notebook.scroller_height); /* Calculate the notebook frame size based on page size,shadows,& margins*/ nb->notebook.frame_width = nb->notebook.page_width + (nb->notebook.shadow_thickness * 2) + (nb->notebook.margin_width * 2) + 1; nb->notebook.frame_height = nb->notebook.page_height + nb->notebook.status_height + (nb->notebook.shadow_thickness * 2) + (nb->notebook.margin_height * 3) + 1; } /***************************************************************************** * * * Child Managing Functions * * * *****************************************************************************/ /*- SetLastPageNumber ---------------------------------------------------- Sets XmNlastPageNumber if no explicit last page number was set, and updates navigators. Uses instance state: dynamic_last_page_num ,True, if no explicit setting Called from: AssignDefaultPageNumber ,when children are managed ConstraintSetValues ,when a child page # is changed Return: True, if last_page_number changed. Otherwise, False. -----------------------------------------------------------------------------*/ static Boolean SetLastPageNumber ( XmNotebookWidget nb, int last_page_number) { if (nb->notebook.dynamic_last_page_num && last_page_number > nb->notebook.last_page_number) { nb->notebook.last_page_number = last_page_number; UpdateNavigators(nb); return(True); } return(False); } /*- AssignDefaultPageNumber ------------------------------------------------- assign a default page number to those children who did not get from the application. When a page is managed without a page number, the Notebook provides the page with the smallest unallocated page number that is greater than or equal to the first page number and is greater than the last allocated page number. When a tab or a status area is managed without a page number, the widget gets the page number of the most recently managed page that does not have the same type of child. If the page does have the same type of child, however, the Notebook associates the child with the next page whose page number is one greater than the most recently managed one. The Notebook, then, assumes the new page number is occupied. The next subsequent page without a page number will not receive this number. The default page number that the Notebook generates can exceed the last page number, which makes those page inaccessable by the user. -----------------------------------------------------------------------------*/ static Boolean AssignDefaultPageNumber ( XmNotebookWidget nb) { XmNotebookConstraint nc; Widget child; int i, last_page_number; /* initialize */ last_page_number = nb->notebook.first_page_number; /* for all children */ for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); /* for all managed children */ if (XtIsManaged(child)) { /* assign a default page number */ if (nc->page_number == XmUNSPECIFIED_PAGE_NUMBER) { if (NB_IS_CHILD_PAGE(nc->child_type)) { nc->page_number = GetNextAvailPageNum(nb, i); nb->notebook.last_alloc_num = nc->page_number; } else if (NB_IS_CHILD_MAJOR(nc->child_type) || NB_IS_CHILD_MINOR(nc->child_type) || NB_IS_CHILD_STATUS(nc->child_type)) { if (GetChildWidget(nb, nb->notebook.last_alloc_num, nc->child_type)) { nc->page_number = GetNextAvailPageNum(nb, i); nb->notebook.last_alloc_num = nc->page_number; } else nc->page_number = nb->notebook.last_alloc_num; } } else nb->notebook.last_alloc_num = nc->page_number; /* update the last_page_number */ if (NB_IS_CHILD_PAGE(nc->child_type) || NB_IS_CHILD_TAB(nc->child_type) || NB_IS_CHILD_STATUS(nc->child_type)) { ASSIGN_MAX(last_page_number, nc->page_number); } } /* if */ } /* for */ return(SetLastPageNumber(nb, last_page_number)); } /*- SetActiveChildren ------------------------------------------------------ Determine which children should be active. Active children are all managed scrollers and managed pages, status areas, and tabs which are within the page number range and not duplicated or later matched ones if duplicated. Uses instance state: first_page_number last_page_number Updates child constraint "active" field FALSE, if child is NOT managed or child page # less than notebook.first_page_number or child page # greater than notebook.last_page_number or child page # duplicated by a child of the same type TRUE, otherwise -----------------------------------------------------------------------------*/ static void SetActiveChildren ( XmNotebookWidget nb) { Widget child; XmNotebookConstraint nc; XmNotebookConstraint last = NULL; /* initial previous child */ unsigned char type = XmNONE; /* initial previous type */ int num = XmUNSPECIFIED_PAGE_NUMBER; /* initial previous page */ int i; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (XtIsManaged(child) && nc->page_number >= nb->notebook.first_page_number && nc->page_number <= nb->notebook.last_page_number) { if (last) last->active = !(nc->child_type == type && nc->page_number == num); last = nc; type = nc->child_type; num = nc->page_number; } else /* NOT managed or NOT (1st page) <= (page #) <= (last page #) */ { nc->active = False; } } if (last) last->active = True; } /*- CompareChildren --------------------------------------------------------- Compares children, used for qsort() in SortChildren. -----------------------------------------------------------------------------*/ static int CompareChildren ( XmConst void *a, XmConst void *b) { XmNotebookConstraint ac = NotebookConstraint(*((Widget *)a)); XmNotebookConstraint bc = NotebookConstraint(*((Widget *)b)); int cmp; /* Compare page numbers */ cmp = ac->page_number - bc->page_number; /* Compare child types, if page numbers are same */ if (!cmp) cmp = ac->child_type - bc->child_type; /* Compare position in the array, if child types are the same */ if (!cmp) cmp = (unsigned long)a - (unsigned long)b; return cmp; } /*- SortChildren ------------------------------------------------------------ Sorts children by page number and type. Assumptions: Previously created children are already sorted, and newly created children are at the end of the composite.children list. -----------------------------------------------------------------------------*/ static void SortChildren ( XmNotebookWidget nb) { qsort(nb->composite.children, nb->composite.num_children, sizeof(Widget), CompareChildren); SetActiveChildren(nb); } /*- RepositionChild --------------------------------------------------------- Repositions a childs position in composite array using an insertion method. -----------------------------------------------------------------------------*/ static void RepositionChild ( XmNotebookWidget nb, Widget child) { XmNotebookConstraint rnc = NotebookConstraint(child); XmNotebookConstraint nc; /* temp comparator value */ Widget w; /* temp comparator value */ int cmp; /* temp comparator value */ int cur_pos = -1; /* position of changing child */ int ins_pos = -1; /* position to insert child */ int i; /* counter */ /* nothing to do, if there is only one child in array */ if (nb->composite.num_children == 1) return; for (i = 0; i < nb->composite.num_children; i++) { w = nb->composite.children[i]; nc = NotebookConstraint(w); if (rnc == nc) cur_pos = i; else if (ins_pos < 0) { cmp = rnc->page_number - nc->page_number; if (!cmp) cmp = rnc->child_type - nc->child_type; if (!cmp) cmp = (unsigned long)child - (unsigned long)w; if (cmp < 0) ins_pos = i; /* should be inserted before this element */ } } /* for */ /* error, unable to locate repositioning child in array??? */ if (cur_pos < 0) return; /* found no one less than, move others down, and insert at last position */ if (ins_pos < 0) { for (i = cur_pos; i < nb->composite.num_children -1; i++) nb->composite.children[i] = nb->composite.children[i+1]; nb->composite.children[nb->composite.num_children -1] = child; } /* found new position above, move others down, and then insert */ else if (cur_pos < ins_pos) { for (i = cur_pos; i < ins_pos -1; i++) nb->composite.children[i] = nb->composite.children[i+1]; nb->composite.children[ins_pos -1] = child; } /* found new position below, move others up, and then insert */ else if (cur_pos > ins_pos) { for (i = cur_pos; i > ins_pos; i--) nb->composite.children[i] = nb->composite.children[i-1]; nb->composite.children[ins_pos] = child; } } /*- GetNextAvailPageNum ----------------------------------------------------- Finds out the next available page number for allocating it to a newly created page or other child. -----------------------------------------------------------------------------*/ static int GetNextAvailPageNum( XmNotebookWidget nb, int last) { XmNotebookConstraint nc; Widget child; int i, avail; avail = nb->notebook.last_alloc_num; for (i = 0; i < last; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (XtIsManaged(child) && nc->page_number == avail) avail++; } return avail; } /*- GetChildWidget --------------------------------------------------------- Finds the later matched child widget of the specified type. It returns NULL if not found. -----------------------------------------------------------------------------*/ static Widget GetChildWidget( XmNotebookWidget nb, int page_number, unsigned char child_type) { XmNotebookConstraint nc; Widget child, this_w; int i; this_w = NULL; for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->page_number == page_number && nc->child_type == child_type) { this_w = child; } else { /* Skip remaining array once last matching child is found */ if (this_w) break; } } return this_w; } /*- GotoPage --------------------------------------------------------------- Places the specified page on top. If the specified page IS currently on top nothing is done. Otherwise, - the XmNpageChangedCallback is called. During which notebook.in_callback is set to True. This is checked in XmNotebook:ConstraintSetValues() to avoid performing layout at that time. - navigators are updated - relayout is performed Called from: SetValues(), when notebook.current_page_number is set TabPressed(), when tabs are activated PageMove(), when ScrollFrame trait navigation is triggered -----------------------------------------------------------------------------*/ static void GotoPage( XmNotebookWidget nb, int page_number, XEvent *event, int reason) { XmNotebookCallbackStruct call_value; Dimension save_width, save_height; Widget old_top_major, old_first_major; Widget old_top_minor, old_first_minor; int prev_page = nb->notebook.current_page_number; /* Don't bother when the page number is out of the page number range, or if it is same as the old page number */ if ( page_number == nb->notebook.current_page_number || page_number < nb->notebook.first_page_number || page_number > nb->notebook.last_page_number) return; /* Save the notebook's size before invoking the callback */ save_width = XtWidth(nb); save_height = XtHeight(nb); /* Set the NEW current page number */ nb->notebook.current_page_number = page_number; /* Invoke the XmNpageChangedCallback, if any exist */ if ((XtHasCallbacks((Widget)nb, XmNpageChangedCallback) == XtCallbackHasSome)) { call_value.reason = reason; call_value.event = event; call_value.page_number = page_number; call_value.page_widget = GetChildWidget(nb, page_number, XmPAGE); call_value.prev_page_number = prev_page; call_value.prev_page_widget = GetChildWidget(nb, prev_page, XmPAGE); /* Mark that the callback is being called and when it finishes */ nb->notebook.in_callback = True; XtCallCallbackList((Widget)nb, nb->notebook.page_change_callback, &call_value); nb->notebook.in_callback = False; } /* Tell all navigators about our page change */ UpdateNavigators(nb); /* If there is any visual change caused by the callback then relayout and redisplay children */ if (save_width != XtWidth(nb) || save_height != XtHeight(nb)) { LayoutChildren(nb, NULL); if (XtIsRealized((Widget)nb)) XClearArea(XtDisplay(nb),XtWindow(nb),0,0,0,0,True); } /* Otherwise just relayout children */ else { /* Save top tab pointers */ old_top_major = nb->notebook.top_major; old_first_major = nb->notebook.first_major; old_top_minor = nb->notebook.top_minor; old_first_minor = nb->notebook.first_minor; /* Reset tab pointers */ ResetTopPointers(nb, XmPAGE, 0); /* Layout children */ LayoutPages(nb, NULL); if ( old_top_major != nb->notebook.top_major || old_first_major != nb->notebook.first_major) LayoutMajorTabs(nb, NULL); if ( old_top_minor != nb->notebook.top_minor || old_first_minor != nb->notebook.first_minor) LayoutMinorTabs(nb, NULL); } } /***************************************************************************** * * * utility functions * * * *****************************************************************************/ /*- ShowChild --------------------------------------------------------------- Change the dimensional aspects of a child, and display it. -----------------------------------------------------------------------------*/ static void ShowChild ( Widget child, Widget instigator, int x, int y, int width, int height) { int border_width; /* adjust width and height and calculate border_width */ border_width = child->core.border_width; width -= border_width * 2; height -= border_width * 2; /* Since width and height can potentially be 0, need to check that they aren't negative after subtracting the border */ if (width <= 0) width = 1, border_width = 0; if (height <= 0) height = 1, border_width = 0; /* Configure the object */ if (child == instigator) { /* if this child is making a geometry request */ XtX(child) = x; XtY(child) = y; XtWidth(child) = width; XtHeight(child) = height; } else { /* otherwise, configure the child */ XmeConfigureObject(child, (Position)x, (Position)y, (Dimension)width, (Dimension)height, (Dimension)border_width); } } /*- HideChild --------------------------------------------------------------- Hide a child by placing it to invisible place. -----------------------------------------------------------------------------*/ static void HideChild ( Widget child, Widget instigator) { int x = - (int)(child->core.width + child->core.border_width * 2); int y = - (int)(child->core.height + child->core.border_width * 2); /* if the child is already invisible, don't bother */ if (!NB_IS_VISIBLE(child)) return; /* place the child to (x, y) */ if (child == instigator) { /* if child is making a geometry request */ XtX(child) = (Position)x; XtY(child) = (Position)y; } else { /* otherwise, configure the child */ XmeConfigureObject(child, (Position)x, (Position)y, child->core.width, child->core.height, child->core.border_width); } } /*- HideShadowedTab --------------------------------------------------------- Clear tab child and its surrounding frame shadow -----------------------------------------------------------------------------*/ static void HideShadowedTab ( XmNotebookWidget nb, Widget child) { int x, y, width, height; if (XtIsRealized((Widget)nb) && child && NB_IS_VISIBLE(child)) { x = child->core.x - nb->notebook.shadow_thickness; y = child->core.y - nb->notebook.shadow_thickness; width = child->core.width + nb->notebook.shadow_thickness * 2 + 1; height = child->core.height + nb->notebook.shadow_thickness * 2 + 1; if ( nb->notebook.shadow_thickness ) XClearArea(XtDisplay(nb), XtWindow(nb), x, y, width, height, True); else XClearArea(XtDisplay(nb), XtWindow(nb), x - 1 , y - 1, width + 1, height + 1, True); } } /***************************************************************************** * * * callback functions * * * *****************************************************************************/ /*- FlipTabs ---------------------------------------------------------------- callback function for events for tab scrolling -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void FlipTabs ( Widget w, XtPointer data, /* unused */ XtPointer call_data) /* unused */ { XmNotebookWidget nb = (XmNotebookWidget)XtParent(w); Widget old_first_major, old_first_minor; Widget cfw = XmGetFocusWidget((Widget)nb); /* save tab pointers */ old_first_major = nb->notebook.first_major; old_first_minor = nb->notebook.first_minor; /* request to reset notebook.first_major */ if (w == nb->notebook.next_major) ResetTopPointers(nb, XmMAJOR_TAB_SCROLLER, _NEXT); else if (w == nb->notebook.prev_major) ResetTopPointers(nb, XmMAJOR_TAB_SCROLLER, _PREVIOUS); else if (w == nb->notebook.next_minor) ResetTopPointers(nb, XmMINOR_TAB_SCROLLER, _NEXT); else if (w == nb->notebook.prev_minor) ResetTopPointers(nb, XmMINOR_TAB_SCROLLER, _PREVIOUS); /* redraw tabs if necessary */ if (old_first_major != nb->notebook.first_major) LayoutMajorTabs(nb, NULL); if (old_first_minor != nb->notebook.first_minor) LayoutMinorTabs(nb, NULL); /* * If focus was a tab widget that is now hidden due to tab scrolling then * move focus to the next visible tab */ if (cfw && XtParent(cfw) == (Widget)nb) { unsigned char ct = NotebookConstraint(cfw)->child_type; if (NB_IS_HIDDEN(cfw) && NB_IS_CHILD_TAB(ct)) { if ((w == nb->notebook.next_major) && NB_IS_CHILD_MAJOR(ct)) XmProcessTraversal( (Widget) GetNextTab(nb, XmMAJOR_TAB, 0, _FIRST_VISIBLE), XmTRAVERSE_CURRENT); else if (w == nb->notebook.prev_major && NB_IS_CHILD_MAJOR(ct)) XmProcessTraversal( (Widget) GetNextTab(nb, XmMAJOR_TAB, 0, _LAST_VISIBLE), XmTRAVERSE_CURRENT); else if (w == nb->notebook.next_minor && NB_IS_CHILD_MINOR(ct)) XmProcessTraversal( (Widget) GetNextTab(nb, XmMINOR_TAB, 0, _FIRST_VISIBLE), XmTRAVERSE_CURRENT); else if (w == nb->notebook.prev_minor && NB_IS_CHILD_MINOR(ct)) XmProcessTraversal( (Widget) GetNextTab(nb, XmMINOR_TAB, 0, _LAST_VISIBLE), XmTRAVERSE_CURRENT); } } } /*- TabPressed -------------------------------------------------------------- callback function for events for tab push-buttons. -----------------------------------------------------------------------------*/ static void TabPressed ( Widget w, XtPointer data, XtPointer call_data) { XmNotebookWidget nb = (XmNotebookWidget)XtParent(w); XmNotebookConstraint nc = NotebookConstraint(w); XmAnyCallbackStruct *cbs = (XmAnyCallbackStruct *)call_data; int reason = (unsigned long)data; /* move to the selected page */ GotoPage(nb, nc->page_number, cbs->event, reason); } /***************************************************************************** * * * Keyboard Traversal Functions & Action Procs * * * *****************************************************************************/ /*- TraverseTab ------------------------------------------------------------- action for moving the focus on tabs -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void TraverseTab ( Widget w, XEvent *event, /* unused */ String *params, Cardinal *num_params) { XmNotebookWidget nb = (XmNotebookWidget)w; XmNotebookConstraint nc; Widget first, last, next, prev, child = NULL; int traverse_to; /* Check error conditions */ if (nb && XmIsNotebook(nb)) child = XmGetFocusWidget(w); else while (nb && !(XmIsNotebook(nb))) { child = (Widget)nb; nb = (XmNotebookWidget)XtParent(child); } if (!nb || !child) return; if (!num_params || (*num_params != 1) || !params) { XmeWarning(w, MESSAGE1); return; } /* Only valid for major or minor tabs */ if (!(nc = NotebookConstraint(child)) || !(NB_IS_CHILD_MAJOR(nc->child_type) || NB_IS_CHILD_MINOR(nc->child_type))) return; if (_XmConvertActionParamToRepTypeId((Widget) nb, XmRID_NOTEBOOK_TRAVERSE_TAB_ACTION_PARAMS, params[0], False, &traverse_to) == False) traverse_to = _HOME; /* * Make the traversal */ if (traverse_to == _HOME) { /* Major HOME traversal */ first = GetNextTab(nb,nc->child_type,nc->page_number,_HOME); if ((first) && NB_IS_HIDDEN(first)) { if (NB_IS_CHILD_MAJOR(nc->child_type)) { ResetTopPointers(nb,XmMAJOR_TAB_SCROLLER,_HOME); LayoutMajorTabs(nb, NULL); } else { ResetTopPointers(nb,XmMINOR_TAB_SCROLLER,_HOME); LayoutMinorTabs(nb, NULL); } } if (first) XmProcessTraversal(first,XmTRAVERSE_CURRENT); } else if (traverse_to == _END) { last = GetNextTab(nb,nc->child_type,nc->page_number,_END); if ((last) && NB_IS_HIDDEN(last)) { if (NB_IS_CHILD_MAJOR(nc->child_type)) { ResetTopPointers(nb,XmMAJOR_TAB_SCROLLER,_END); LayoutMajorTabs(nb, NULL); } else { ResetTopPointers(nb,XmMINOR_TAB_SCROLLER,_END); LayoutMinorTabs(nb, NULL); } } if (last) XmProcessTraversal(last,XmTRAVERSE_CURRENT); } else if (traverse_to == _PREVIOUS) { prev = GetNextTab(nb,nc->child_type,nc->page_number,_PREVIOUS); if ((prev) && NB_IS_HIDDEN(prev)) { if (NB_IS_CHILD_MAJOR(nc->child_type)) FlipTabs( (MaxIsRightUp(nb,nc->child_type)) ? nb->notebook.prev_major : nb->notebook.next_major, NULL,NULL); else FlipTabs( (MaxIsRightUp(nb,nc->child_type)) ? nb->notebook.prev_minor : nb->notebook.next_minor, NULL,NULL); } if (prev) XmProcessTraversal(prev, XmTRAVERSE_CURRENT); } else if (traverse_to == _NEXT) { next = GetNextTab(nb,nc->child_type,nc->page_number,_NEXT); if ((next) && NB_IS_HIDDEN(next)) { if (NB_IS_CHILD_MAJOR(nc->child_type)) FlipTabs( (MaxIsRightUp(nb,nc->child_type)) ? nb->notebook.next_major : nb->notebook.prev_major, NULL,NULL); else FlipTabs( (MaxIsRightUp(nb,nc->child_type)) ? nb->notebook.next_minor : nb->notebook.prev_minor, NULL,NULL); } if (next) XmProcessTraversal(next, XmTRAVERSE_CURRENT); } } /*- RedirectTraversal ------------------------------------------------------- redirect traversal control trait Focus From Focus To Focus Request NEXT_TAB_GROUP MINOR _CURRENT_VISIBLE MAJOR MAJOR _CURRENT_VISIBLE MINOR PREV_TAB_GROUP MAJOR _CURRENT_VISIBLE MINOR MINOR _CURRENT_VISIBLE MAJOR -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static Widget RedirectTraversal( Widget old_focus, Widget new_focus, unsigned int focus_policy, XmTraversalDirection direction, unsigned int pass) /* unused */ { unsigned char to_type = XmMAJOR_TAB, from_type = XmMAJOR_TAB; Widget to_child, from_child; Widget to_parent, from_parent; Widget new_focus_widget; /* If we're in pointer focus mode there's nothing to be done. */ if ((focus_policy != XmEXPLICIT) || ((direction != XmTRAVERSE_NEXT_TAB_GROUP) && (direction != XmTRAVERSE_PREV_TAB_GROUP))) return new_focus; /* Determine nearest notebook parent for the target. */ to_parent = NULL; if ((to_child=new_focus)) { if ((to_parent=XtParent(to_child)) == NULL) return new_focus; while (!XmIsNotebook(to_parent)) { to_child = to_parent; if ((to_parent=XtParent(to_child)) == NULL) break; } } /* Determine target child type. */ if (to_parent) to_type = NotebookConstraint(to_child)->child_type; /* Determine nearest notebook parent for the source. */ from_parent = NULL; if ((from_child=old_focus)) { if ((from_parent = XtParent(from_child)) == NULL) return new_focus; while (!XmIsNotebook(from_parent)) { from_child = from_parent; if ((from_parent=XtParent(from_child)) == NULL) break; } } /* Determine source child type. */ if (from_parent) from_type = NotebookConstraint(from_child)->child_type; /* * Determine if we need to force traversal between major and * minor tabs (traverse to nearest tab to the current page) * * Note: If TO is NULL, then it is assumed that there is only * one TAB GROUP i.e., the Major/Minor tabs TAB GROUP */ new_focus_widget = NULL; if (direction == XmTRAVERSE_NEXT_TAB_GROUP) { /* If FROM Minor with a NULL TO then GOTO Major */ if (to_child == NULL && (from_parent && (from_type == XmMINOR_TAB))) new_focus_widget = GetNextTab((XmNotebookWidget)from_parent, XmMAJOR_TAB,0,_CURRENT_VISIBLE); /* If FROM Major with any TO then GOTO Minor */ else if (from_parent && (from_type == XmMAJOR_TAB)) new_focus_widget = GetNextTab((XmNotebookWidget)from_parent, XmMINOR_TAB,0,_CURRENT_VISIBLE); /* If *NOT* FROM Major and TO Minor then GOTO Major */ else if (to_parent && (to_type == XmMINOR_TAB)) new_focus_widget = GetNextTab((XmNotebookWidget)to_parent, XmMAJOR_TAB,0,_CURRENT_VISIBLE); /* If TO Major with any FROM then GOTO Major */ else if (to_parent && (to_type == XmMAJOR_TAB)) new_focus_widget = GetNextTab((XmNotebookWidget)to_parent, XmMAJOR_TAB,0,_CURRENT_VISIBLE); } else /* if (direction == XmTRAVERSE_PREV_TAB_GROUP) */ { /* If FROM Major with a NULL TO then GOTO Minor */ if (to_child == NULL && (from_parent && (from_type == XmMAJOR_TAB))) new_focus_widget = GetNextTab((XmNotebookWidget)from_parent, XmMINOR_TAB,0,_CURRENT_VISIBLE); /* If FROM Minor with any TO and then GOTO Major */ else if (from_parent && (from_type == XmMINOR_TAB)) new_focus_widget = GetNextTab((XmNotebookWidget)from_parent, XmMAJOR_TAB,0,_CURRENT_VISIBLE); /* If *NOT* FROM Minor with TO Major then GOTO Major */ else if (to_parent && (to_type == XmMAJOR_TAB)) new_focus_widget = GetNextTab((XmNotebookWidget)to_parent, XmMINOR_TAB,0,_CURRENT_VISIBLE); /* If to a Minor then traverse to a Minor nearest the current page */ else if (to_parent && (to_type == XmMINOR_TAB)) new_focus_widget = GetNextTab((XmNotebookWidget)to_parent, XmMINOR_TAB,0,_CURRENT_VISIBLE); } if (new_focus_widget && XmIsTraversable(new_focus_widget)) return new_focus_widget; return new_focus; } /*- GetNextTab -------------------------------------------------------------- Get next tab to set focus to. In Parameters: child_type XmMAJOR_TAB or XmMINOR_TAB page_number page number of interest direction traversal direction returns next major || minor tab (can be NULL) -----------------------------------------------------------------------------*/ static Widget GetNextTab ( XmNotebookWidget nb, unsigned char child_type, int page_number, unsigned char direction) { XmNotebookConstraint nc; Widget child; int i; Widget target; unsigned char target_dir; unsigned char target_child_type; Boolean target_found; int top_major_page; if (NB_IS_CHILD_MAJOR(child_type) || NB_IS_CHILD_MINOR(child_type)) target_child_type = child_type; else return(NULL); /* Bad parameter */ if (MaxIsRightUp(nb,target_child_type)) target_dir = direction; else switch(direction) { case _PREVIOUS: target_dir = _NEXT; break; case _NEXT: target_dir = _PREVIOUS; break; default: target_dir = direction; } /* * Attempt to return top tab */ if (target_dir == _CURRENT_VISIBLE) { if (NB_IS_CHILD_MAJOR(child_type)) { if ( (nb->notebook.top_major != NULL) && (NB_IS_VISIBLE(nb->notebook.top_major))) return nb->notebook.top_major; else target_dir = _FIRST_VISIBLE; } else if (NB_IS_CHILD_MINOR(child_type)) { if ( (nb->notebook.top_minor != NULL) && (NB_IS_VISIBLE(nb->notebook.top_minor))) return nb->notebook.top_minor; else target_dir = _FIRST_VISIBLE; } } i = 0; target = NULL; target_found = False; if (NB_IS_CHILD_MAJOR(target_child_type)) { while((!target_found) && (i < nb->composite.num_children)) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if ((nc->active) && (NB_IS_CHILD_MAJOR(nc->child_type))) switch (target_dir) { case _HOME: target = child; target_found = True; break; case _FIRST_VISIBLE: if (NB_IS_VISIBLE(child)) { target = child; target_found = True; } break; case _LAST_VISIBLE: if (NB_IS_VISIBLE(child)) { target = child; } break; case _PREVIOUS: if (nc->page_number < page_number) target = child; else target_found = True; break; case _NEXT: if (nc->page_number > page_number) { target = child; target_found = True; } break; case _END: target = child; } /* switch */ i++; } /* while */ } /* if */ else /* NB_IS_CHILD_MINOR(target_child_type) */ { top_major_page = nb->notebook.top_major ? NotebookConstraint(nb->notebook.top_major)->page_number : nb->notebook.first_page_number - 1; while((!target_found) && (i < nb->composite.num_children)) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (NB_IS_CHILD_MAJOR(nc->child_type) && (nc->page_number > top_major_page)) target_found = True; else if ((nc->active) && (NB_IS_CHILD_MINOR(nc->child_type)) && (nc->page_number >= top_major_page)) switch (target_dir) { case _HOME: target = child; target_found = True; break; case _FIRST_VISIBLE: if (NB_IS_VISIBLE(child)) { target = child; target_found = True; } break; case _LAST_VISIBLE: if (NB_IS_VISIBLE(child)) { target = child; } break; case _PREVIOUS: if (nc->page_number < page_number) target = child; else target_found = True; break; case _NEXT: if (nc->page_number > page_number) { target = child; target_found = True; } break; case _END: target = child; } /* switch */ i++; } /* while */ } /* else */ return(target); } /*- MaxIsRightUp ------------------------------------------------------------ returns True, if "osfRight" and "osfDown" mean "next" and "osfLeft" and "osfUp" mean "prev" False, if "osfLeft" and "osfUp" mean "next" and "osfRight" and "osfDown" mean "prev" -----------------------------------------------------------------------------*/ static Boolean MaxIsRightUp ( XmNotebookWidget nb, unsigned char child_type) { return( ( (NB_IS_CHILD_MAJOR(child_type)) && ( (nb->notebook.back_page_pos == XmBOTTOM_RIGHT) || ( (nb->notebook.back_page_pos == XmBOTTOM_LEFT) && (nb->notebook.orientation == XmHORIZONTAL)) || ( (nb->notebook.back_page_pos == XmTOP_RIGHT) && (nb->notebook.orientation == XmVERTICAL)))) || ( (NB_IS_CHILD_MINOR(child_type)) && ( (nb->notebook.back_page_pos == XmBOTTOM_RIGHT) || ( (nb->notebook.back_page_pos == XmBOTTOM_LEFT) && (nb->notebook.orientation == XmVERTICAL)) || ( (nb->notebook.back_page_pos == XmTOP_RIGHT) && (nb->notebook.orientation == XmHORIZONTAL))))); } /***************************************************************************** * * * Trait Stuff * * * *****************************************************************************/ /*- ScrollFrameInit --------------------------------------------------------- ScrollFrame init trait method -----------------------------------------------------------------------------*/ static void ScrollFrameInit ( Widget w, XtCallbackProc moveCB, Widget scrollable) { XmNotebookWidget nb = (XmNotebookWidget)w; if (nb->notebook.scroll_frame_data != NULL) return; nb->notebook.scroll_frame_data = (XmScrollFrameData) XtMalloc(sizeof(XmScrollFrameDataRec)); nb->notebook.scroll_frame_data->num_nav_list = 0 ; nb->notebook.scroll_frame_data->nav_list = NULL ; nb->notebook.scroll_frame_data->num_nav_slots = 0 ; nb->notebook.scroll_frame_data->move_cb = moveCB ; nb->notebook.scroll_frame_data->scrollable = scrollable ; } /*- ScrollFrameGetInfo ------------------------------------------------------ ScrollFrame getInfo trait method Notebook is a 1 dimensional frame. -----------------------------------------------------------------------------*/ static Boolean ScrollFrameGetInfo ( Widget w, Cardinal *dimension, Widget **nav_list, Cardinal *num_nav_list) { XmNotebookWidget nb = (XmNotebookWidget)w; if (dimension) *dimension = 1; /* one dimensional frame */ if (nb->notebook.scroll_frame_data != NULL) { if (nav_list) *nav_list = nb->notebook.scroll_frame_data->nav_list; if (num_nav_list) *num_nav_list = nb->notebook.scroll_frame_data->num_nav_list; } return( nb->notebook.scroll_frame_data != NULL ); } /*- AddNavigator ------------------------------------------------------------ ScrollFrame addNavigator trait method -----------------------------------------------------------------------------*/ static void AddNavigator ( Widget w, Widget nav, Mask dimMask) { XmNotebookWidget nb = (XmNotebookWidget)w; if (nb->notebook.scroll_frame_data != NULL) _XmSFAddNavigator(w, nav, dimMask, nb->notebook.scroll_frame_data); } /*- RemoveNavigator --------------------------------------------------------- ScrollFrame removeNavigator trait method -----------------------------------------------------------------------------*/ static void RemoveNavigator ( Widget w, Widget nav) { XmNotebookWidget nb = (XmNotebookWidget)w; if (nb->notebook.scroll_frame_data != NULL) _XmSFRemoveNavigator(w, nav, nb->notebook.scroll_frame_data); } /*- PageMove ---------------------------------------------------------------- Callback for the value changes of navigators. -----------------------------------------------------------------------------*/ /*ARGSUSED*/ static void PageMove ( Widget w, XtPointer data, XtPointer call_data) /* unused */ { /* w is a navigator widget */ XmNotebookWidget nb = (XmNotebookWidget)data; XmNavigatorDataRec nav_data; XmNavigatorTrait navigatorT; int reason; /* Get the new navigator value using the trait getValue */ nav_data.valueMask = NavValue; /* Check to ensure navigator is ok */ if ((navigatorT=NB_NAVIGATOR(w)) == NULL || navigatorT->getValue == NULL) return; navigatorT->getValue(w, &nav_data); /* Determine the callback reason */ if (nav_data.value.x > nb->notebook.current_page_number) reason = XmCR_PAGE_SCROLLER_INCREMENT; else if (nav_data.value.x < nb->notebook.current_page_number) reason = XmCR_PAGE_SCROLLER_DECREMENT; else reason = XmCR_NONE; /* Look at the kind of navigator and make the appropriate move */ if ((nav_data.dimMask & NavigDimensionX) && (reason != XmCR_NONE)) GotoPage(nb, nav_data.value.x, NULL, reason); } /*- UpdateNavigators -------------------------------------------------------- Update navigators due to page change -----------------------------------------------------------------------------*/ static void UpdateNavigators ( XmNotebookWidget nb) { XmNavigatorDataRec nav_data; /* update navigators */ nav_data.value.x = nb->notebook.current_page_number; nav_data.minimum.x = nb->notebook.first_page_number; nav_data.maximum.x = nb->notebook.last_page_number + 1; nav_data.slider_size.x = 1; nav_data.increment.x = 1; nav_data.page_increment.x = 1; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue | NavMinimum | NavMaximum | NavSliderSize | NavIncrement | NavPageIncrement; _XmSFUpdateNavigatorsValue((Widget)nb, &nav_data, True); /* Control arrow sensitivity if using default page scroller */ if (nb->notebook.scroller_status == DEFAULT_USED) { if ((nb->notebook.current_page_number ==nb->notebook.last_page_number) && (nb->notebook.current_page_number ==nb->notebook.first_page_number)) XtVaSetValues(nb->notebook.scroller_child,XmNarrowSensitivity, XmARROWS_INSENSITIVE, NULL); else if (nb->notebook.current_page_number == nb->notebook.last_page_number) XtVaSetValues(nb->notebook.scroller_child,XmNarrowSensitivity, XmARROWS_DECREMENT_SENSITIVE, NULL); else if (nb->notebook.current_page_number == nb->notebook.first_page_number) XtVaSetValues(nb->notebook.scroller_child,XmNarrowSensitivity, XmARROWS_INCREMENT_SENSITIVE, NULL); else XtVaSetValues(nb->notebook.scroller_child,XmNarrowSensitivity, XmARROWS_SENSITIVE, NULL); } } /*- GetUnhighlightGC -------------------------------------------------------- ScrollFrame removeNavigator trait method -----------------------------------------------------------------------------*/ static GC GetUnhighlightGC ( Widget w, Widget child) { XmNotebookWidget nb = (XmNotebookWidget)w; XmNotebookConstraint nc; GC background_GC = NULL; if (child) { nc = NotebookConstraint(child); switch (nc->child_type) { case XmMAJOR_TAB: if (nb->notebook.top_major == child) { XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->notebook.frame_background); background_GC = nb->notebook.frame_gc; } else background_GC = nb->manager.background_GC; break; case XmMINOR_TAB: if (nb->notebook.top_minor == child) { XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->notebook.frame_background); background_GC = nb->notebook.frame_gc; } else background_GC = nb->manager.background_GC; break; case XmPAGE: case XmPAGE_SCROLLER: case XmSTATUS_AREA: XSetForeground(XtDisplay(nb), nb->notebook.frame_gc, nb->notebook.frame_background); background_GC = nb->notebook.frame_gc; break; case XmMAJOR_TAB_SCROLLER: case XmMINOR_TAB_SCROLLER: background_GC = nb->manager.background_GC; break; } } return(background_GC); } /***************************************************************************** * * * Public Functions * * * *****************************************************************************/ XmNotebookPageStatus XmNotebookGetPageInfo ( Widget notebook, int page_number, XmNotebookPageInfo *page_info) { XmNotebookWidget nb = (XmNotebookWidget)notebook; XmNotebookConstraint nc; Widget child; Widget page, status, major_tab, minor_tab; XmNotebookPageStatus result; int i; _XmWidgetToAppContext(notebook); _XmAppLock(app); /* initialize */ page = status = major_tab = minor_tab = NULL; result = XmPAGE_EMPTY; /* searching for the page */ for (i = 0; i < nb->composite.num_children; i++) { child = nb->composite.children[i]; nc = NotebookConstraint(child); if (nc->page_number > page_number) break; switch (nc->child_type) { case XmPAGE: if (nc->page_number == page_number) { if (nc->active) { page = child; if (result == XmPAGE_EMPTY) result = XmPAGE_FOUND; } else result = XmPAGE_DUPLICATED; } break; case XmSTATUS_AREA: if ((nc->active) && (nc->page_number == page_number)) status = child; break; case XmMAJOR_TAB: if (nc->active) major_tab = child; break; case XmMINOR_TAB: if (nc->active) minor_tab = child; break; } } /* see if the page number is invalid */ if (page_number < nb->notebook.first_page_number || page_number > nb->notebook.last_page_number) result = XmPAGE_INVALID; /* fill the XmNotebookPageInfo struct */ page_info->page_number = page_number; page_info->page_widget = page; page_info->status_area_widget = status; page_info->major_tab_widget = major_tab; page_info->minor_tab_widget = minor_tab; _XmAppUnlock(app); return result; } Widget XmCreateNotebook( Widget parent, String name, ArgList arglist, Cardinal argcount) { /* * Create an instance of a notebook and return the widget id. */ return(XtCreateWidget(name,xmNotebookWidgetClass,parent,arglist,argcount)); } Widget XmVaCreateNotebook( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmNotebookWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedNotebook( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmNotebookWidgetClass, parent, True, var, count); va_end(var); return w; } /* End of Notebook.c */ motif-2.3.8/lib/Xm/XpmInfo.c0000644000175000017500000001002512672140200012431 00000000000000/* $XConsortium: XpmInfo.c /main/2 1996/09/20 08:12:43 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * Info.c: * * * * XPM library * * Functions related to the XpmInfo structure. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" /* * Init returned data to free safely later on */ void xpmInitXpmInfo(info) XpmInfo *info; { if (info) { info->hints_cmt = NULL; info->colors_cmt = NULL; info->pixels_cmt = NULL; info->extensions = NULL; info->nextensions = 0; } } /* * Free the XpmInfo data which have been allocated */ void XpmFreeXpmInfo(info) XpmInfo *info; { if (info) { if (info->valuemask & XpmComments) { if (info->hints_cmt) { XpmFree(info->hints_cmt); info->hints_cmt = NULL; } if (info->colors_cmt) { XpmFree(info->colors_cmt); info->colors_cmt = NULL; } if (info->pixels_cmt) { XpmFree(info->pixels_cmt); info->pixels_cmt = NULL; } } if (info->valuemask & XpmReturnExtensions && info->nextensions) { XpmFreeExtensions(info->extensions, info->nextensions); info->extensions = NULL; info->nextensions = 0; } info->valuemask = 0; } } /* * Set the XpmInfo valuemask to retrieve required info */ void xpmSetInfoMask(info, attributes) XpmInfo *info; XpmAttributes *attributes; { info->valuemask = 0; if (attributes->valuemask & XpmReturnInfos) info->valuemask |= XpmReturnComments; if (attributes->valuemask & XpmReturnExtensions) info->valuemask |= XpmReturnExtensions; } /* * Fill in the XpmInfo with the XpmAttributes */ void xpmSetInfo(info, attributes) XpmInfo *info; XpmAttributes *attributes; { info->valuemask = 0; if (attributes->valuemask & XpmInfos) { info->valuemask |= XpmComments | XpmColorTable; info->hints_cmt = attributes->hints_cmt; info->colors_cmt = attributes->colors_cmt; info->pixels_cmt = attributes->pixels_cmt; } if (attributes->valuemask & XpmExtensions) { info->valuemask |= XpmExtensions; info->extensions = attributes->extensions; info->nextensions = attributes->nextensions; } if (attributes->valuemask & XpmHotspot) { info->valuemask |= XpmHotspot; info->x_hotspot = attributes->x_hotspot; info->y_hotspot = attributes->y_hotspot; } } motif-2.3.8/lib/Xm/TxtPropCv.c0000644000175000017500000005301113066310437012775 00000000000000/* $TOG: TxtPropCv.c /main/15 1997/06/18 17:46:05 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include "XmI.h" #include "XmStringI.h" static Atom GetLocaleEncodingAtom(Display *dpy) { int ret_status = 0; XTextProperty tmp_prop; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ Atom encoding; tmp_prop.value = NULL; /* just in case X doesn't do it */ ret_status = XmbTextListToTextProperty(dpy, &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (ret_status == Success) encoding = tmp_prop.encoding; else encoding = None; /* XmbTextList... should always be able * to convert XPCS characters; but in * case its broken, this prevents a core * dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); return(encoding); } /************************************************************************ * * TextPropertyToSingleTextItem * ************************************************************************/ static int TextPropertyToSingleTextItem(Display *display, XTextProperty *text_prop, char **text_item) { int result, count; char **textlist; result = XmbTextPropertyToTextList(display, text_prop, &textlist, &count); if (result != Success) return(result); if (count == 1) { /* Otherwise just return the first element of the text list */ *text_item = XtNewString(textlist[0]); XFreeStringList(textlist); } else if (count > 1) { /* If we got back more than one string, then let's concatenate them all together. */ int i, length = 0; char *newstring; /* First figure out how big the final string will be */ for (i = 0; i < count; ++i) length += strlen(textlist[i]); /* Allocate a buffer and jam all the strings into it */ newstring = (char *)XtMalloc(sizeof(char)*(length+1)); newstring[0] = '\0'; for (i = 0; i < count; ++i) strcat(newstring, textlist[i]); *text_item = newstring; XFreeStringList(textlist); } return(Success); } /************************************************************************ * * GetTextSegment * * This function gets the next full segment from the given xmstring using * the given xmcontext and tries to extract either locale text or * string text (i.e. ISO8859-1 text) based on the texttype argument. * * This function can return one of three return values: * * _VALID_SEGMENT: we found a segment that we could decompose. The * appropriate text has been stored in the given buffer * * _INVALID_SEGMENT: we could not decompose the segment. The given * buffer does not contain valid data * * _NO_MORE_SEGMENTS: there are no more segments available in the * xmstring using the xmcontext. * ************************************************************************/ /* Segment type return value */ enum { _VALID_SEGMENT, _INVALID_SEGMENT, _NO_MORE_SEGMENTS }; /* Valid text types */ enum { _LOCALE_TEXT, _STRING_TEXT }; /*ARGSUSED*/ static unsigned char GetTextSegment(Display *display, /* unused */ XmStringContext xmcontext, XmString xmstring, /* unused */ char **buffer, unsigned char texttype) { XtPointer text; XmStringTag tag, *rendition_tags; XmTextType type; XmStringDirection direction; XmDirection push_before; Boolean separator, pop_after; unsigned int tag_count; unsigned char return_status, tabs; short char_count; char *encoding; int i; /* Initialize the locale_buffer just in case we need to return Failure at any point along the way. */ *buffer = NULL; return_status = _VALID_SEGMENT; /* Decompose the xmstring and handle each segment separately. */ if (_XmStringGetSegment(xmcontext, TRUE, FALSE, &text, &tag, &type, &rendition_tags, &tag_count, &direction, &separator, &tabs, &char_count, &push_before, &pop_after)) { switch (type) { case XmMULTIBYTE_TEXT: case XmWIDECHAR_TEXT: if (texttype == _LOCALE_TEXT) { /* The text should be already be valid locale text */ char *tmp = XtMalloc(char_count + sizeof(wchar_t)); memcpy(tmp, text, char_count); bzero(tmp + char_count, sizeof(wchar_t)); *buffer = tmp; } else if (texttype == _STRING_TEXT) { *buffer = NULL; return(_INVALID_SEGMENT); } break; case XmCHARSET_TEXT: /* "tag" is the charset when type is CHARSET_TEXT */ encoding = XmMapSegmentEncoding(tag); if (encoding != NULL) { if (texttype == _LOCALE_TEXT && (strcmp(encoding, _MOTIF_DEFAULT_LOCALE) == 0 || strcmp(encoding, XmFONTLIST_DEFAULT_TAG) == 0)) /* @@ Is ISO8859-1 valid here? */ { /* Given the above charset encodings, the text should already be valid locale text. */ char *tmp = XtMalloc(char_count + sizeof(wchar_t)); memcpy(tmp, text, char_count); bzero(tmp + char_count, sizeof(wchar_t)); *buffer = tmp; } else if (texttype == _STRING_TEXT && (strcmp(encoding, "ISO8859-1") == 0)) { /* The text is valid STRING text */ char *tmp = XtMalloc(char_count + sizeof(wchar_t)); memcpy(tmp, text, char_count); bzero(tmp + char_count, sizeof(wchar_t)); *buffer = tmp; } else return(_INVALID_SEGMENT); } else return(_INVALID_SEGMENT); /* the encoding was unregistered */ break; case XmNO_TEXT: break; } /* Before returning Success, check to see whether we need to prepend any tabs or append any newlines. */ if ((return_status == _VALID_SEGMENT) && (separator == True || tabs != 0)) { int newlength; char *newstring; newlength = strlen(*buffer) + (separator ? 1 : 0) + tabs; newstring = (char *)XtMalloc(sizeof(char) * (newlength + 1)); for (i = 0; i < tabs; i++) newstring[i] = '\t'; strcpy(&newstring[i], *buffer); strcat(newstring, "\n"); XtFree(*buffer); *buffer = newstring; } return(return_status); } else { /* Return NULL text but a value of Success to designate that there are no more segments to process. */ *buffer = NULL; return(_NO_MORE_SEGMENTS); } } /************************************************************************ * * GetUseableText * * Given an XmString, decompose it into text specified by the texttype * argument. Valid text types are _LOCALE_TEXT for text encoded in the * current locale and _STRING_TEXT for text encoded in ISO8859-1 with * newlines and tabs. * * If the "strict" argument is False, then any compound strings which * have a segment that can not be decomposed as specified will be converted * to compound text and then converted to the appropriate text by using * a series of XmbTextListToTextProperty and XmbTextPropertyToTextList * calls to acchive the conversion. * * If the "strict" argument is True, then all compound strings must be * fully convertible to the specified text type. If one is not in any * way, then XLocaleNotSupported is returned. * ************************************************************************/ static int GetUseableText(Display *display, XmString xmstring, char **buffer, Boolean strict, unsigned char texttype) { _XmStringContextRec stack_context; XTextProperty text_prop_return; char *text = NULL, *final_string = NULL, *text_item=NULL, *compound_text; unsigned char return_status; int result, size_so_far = 1; /* initialized for the ending NULL */ XICCEncodingStyle encoding_style; /* Initialize the buffer in case we have to abort and return failure. */ *buffer = NULL; switch(texttype) { case _LOCALE_TEXT: encoding_style = XTextStyle; break; case _STRING_TEXT: encoding_style = XStringStyle; break; default: return(XLocaleNotSupported); } /* Decompose the xmstring and handle each segment separately. */ _XmStringContextReInit(&stack_context, xmstring); /* Get text for each segment of the compound string. Concatenate all the text from the segments together into one string that will be returned in the buffer. */ while((return_status = GetTextSegment(display, &stack_context, xmstring, &text, texttype)) == _VALID_SEGMENT) { size_so_far += strlen(text); final_string = (char *)XtRealloc(final_string, size_so_far); final_string[0] = '\0'; strcat(final_string, text); XtFree(text); text = NULL; } /* If we encountered an invalid segment, then we will throw up our hands and try all over again by converting the compound string to compound text and then converting the compound text to a text property and from a text property back to a text list. This should result in text but with possible loss of information. */ if (return_status == _INVALID_SEGMENT) { int txt_len; char *txt_value; /* First, free what we've malloc'ed already */ if (final_string) XtFree(final_string); /* If we are in strict mode, then return XLocaleNotSupported to let the caller know that we could not decompose one of the XmStrings in the context of the current locale */ if (strict) { _XmStringContextFree(&stack_context); return(XLocaleNotSupported); } /* Now convert the compound string to compound text ... */ if ((compound_text = XmCvtXmStringToCT(xmstring)) == (char *)NULL) { _XmStringContextFree(&stack_context); return (XLocaleNotSupported); } /* then to a text property in TextStyle encoding ... */ txt_len = strlen(compound_text) + 1; txt_value = XtMalloc((txt_len + 1) * sizeof(char)); strcpy(txt_value, compound_text); text_prop_return.value = (unsigned char *) txt_value; text_prop_return.value[txt_len] = '\0'; text_prop_return.nitems = txt_len; text_prop_return.encoding = XInternAtom(display, XmSCOMPOUND_TEXT, False); text_prop_return.format = 8; XtFree(compound_text); /* then to a text list, which should result in text. */ result = TextPropertyToSingleTextItem(display, &text_prop_return, &text_item); if (text_prop_return.value != NULL) XtFree((char *)text_prop_return.value); if (result != Success) { _XmStringContextFree(&stack_context); return(result); } final_string = text_item; } /* Otherwise, we should have valid text */ *buffer = final_string; _XmStringContextFree(&stack_context); return(Success); } /************************************************************************ * * XmCvtXmStringTableToTextProperty * ************************************************************************/ int XmCvtXmStringTableToTextProperty(Display *display, XmStringTable string_table, int count, XmICCEncodingStyle style, XTextProperty *text_prop_return) { char **compound_text, **useable_text, *xm_compound_text, *ptr; unsigned char *ubufptr, *bufptr, texttype =_LOCALE_TEXT , *final_string; int i, result, total_size; Boolean strict = True; Atom encoding = 0; _XmDisplayToAppContext(display); _XmAppLock(app); switch (style) { case XmSTYLE_COMPOUND_TEXT: compound_text = (char **)XtMalloc(sizeof(char *) * count); /* Convert each XmString to Compound Text */ for (i = 0, total_size = 0; i < count; ++i) { compound_text[i] = XmCvtXmStringToCT(string_table[i]); total_size += (compound_text[i] ? strlen(compound_text[i]) : 0) +1; } /* Generate the resulting XTextProperty value as a set of null-separated compound text elements. A final terminating null is stored at the end of the value field of text_prop_return but is not included in the nitems member. */ ptr = xm_compound_text = (char *) XtMalloc(sizeof(char) * (total_size + 1)); for (i = 0; i < count; i++) { if (compound_text[i]) { strcpy(ptr, compound_text[i]); XtFree(compound_text[i]); } else { *ptr = '\0'; } ptr += strlen(ptr) + 1; } *ptr = '\0'; XtFree((char *) compound_text); text_prop_return->value = (unsigned char *) xm_compound_text; text_prop_return->encoding = XInternAtom(display, XmSCOMPOUND_TEXT, False); text_prop_return->format = 8; text_prop_return->nitems = total_size; _XmAppUnlock(app); return(Success); case XmSTYLE_COMPOUND_STRING: /* First calculate how much space the compound strings will occupy when they are all converted to ASN1 strings. */ for (i = 0, total_size = 0; i < count; ++i) total_size += XmCvtXmStringToByteStream(string_table[i],NULL); /* Allocate that amount of space and convert the compound strings to ASN1 strings, putting them directly into the buffer. */ text_prop_return->value = ubufptr = (unsigned char *) XtMalloc(sizeof(unsigned char) * total_size); for (i = 0; i < count; ++i) { int size; size = XmCvtXmStringToByteStream(string_table[i],&bufptr); memcpy(ubufptr, bufptr, size); XtFree((char *) bufptr); ubufptr += size; } *(++ubufptr) = '\0'; text_prop_return->nitems = total_size; text_prop_return->format = 8; text_prop_return->encoding = XInternAtom(display, XmS_MOTIF_COMPOUND_STRING, False); _XmAppUnlock(app); return(Success); case XmSTYLE_LOCALE: case XmSTYLE_TEXT: case XmSTYLE_STRING: case XmSTYLE_STANDARD_ICC_TEXT: /* We do mostly the same thing for these four styles. Do another switch to set up some parameters which will change the behavior slightly depending on which style is being requested. */ switch (style) { case XmSTYLE_LOCALE: strict = False; texttype = _LOCALE_TEXT; encoding = GetLocaleEncodingAtom(display); break; case XmSTYLE_TEXT: strict = True; texttype = _LOCALE_TEXT; encoding = GetLocaleEncodingAtom(display); break; case XmSTYLE_STRING: strict = False; texttype = _STRING_TEXT; encoding = XA_STRING; break; case XmSTYLE_STANDARD_ICC_TEXT: strict = True; texttype = _STRING_TEXT; encoding = XA_STRING; break; case XmSTYLE_COMPOUND_TEXT: case XmSTYLE_COMPOUND_STRING: break; } /* Get useable text for each compound string */ useable_text = (char **)XtMalloc(sizeof(char *) * count); for (i = 0; i < count; ++i) { result = GetUseableText(display, string_table[i], &useable_text[i], strict, texttype); if (result != Success) { /* Free up what we have so far ... */ --i; /* skip the one that failed */ while (i >= 0) XtFree(useable_text[i--]); if (strict) { /* If we got back XLocaleNotSupported, then pretend the caller asked for COMPOUND_TEXT style. */ if (result == XLocaleNotSupported) { /* Try to do a straight COMPOUND_TEXT conversion and return whatever we got back. */ _XmAppUnlock(app); return (XmCvtXmStringTableToTextProperty (display, string_table, count, XmSTYLE_COMPOUND_TEXT, text_prop_return)); } else { /* Otherwise, we got back an error we didn't know how to handle. Just return it. */ _XmAppUnlock(app); return(result); } } else { /* If we are not being strict, then an error was really an error that we could not handle. */ _XmAppUnlock(app); return(result); } } } /* Now take the useable_text array and convert it to one long string with null separated elements. */ for (i = 0, total_size = 0; i < count; ++i) total_size += strlen(useable_text[i]) + 1; final_string = (unsigned char *)XtMalloc(sizeof(char) * (total_size + 1)); final_string[0] = '\0'; bufptr = final_string; for (i = 0; i < count; ++i) { strcpy((char *)bufptr, useable_text[i]); bufptr += strlen(useable_text[i]) + 1; } *bufptr = '\0'; /* Fill in the text property with the data */ text_prop_return->encoding = encoding; text_prop_return->value = final_string; text_prop_return->nitems = total_size; text_prop_return->format = 8; /* Clean up and leave town */ for (i = 0; i < count; ++i) XtFree(useable_text[i]); XtFree((char *) useable_text); _XmAppUnlock(app); return(Success); default: _XmAppUnlock(app); return(XLocaleNotSupported); } } /************************************************************************ * * XmCvtTextPropertyToXmStringTable * ************************************************************************/ int XmCvtTextPropertyToXmStringTable(Display *display, XTextProperty *text_prop, XmStringTable *string_table_return, int *count_return) { enum { XmACOMPOUND_TEXT, XmA_MOTIF_COMPOUND_STRING, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char* atom_names[] = { XmSCOMPOUND_TEXT, XmS_MOTIF_COMPOUND_STRING, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; char **text_list; int i, result, elements = 0; XmStringTable string_table; XmStringTag tag; XmTextType type; Atom LOCALE_ATOM = GetLocaleEncodingAtom(display); Atom atoms[XtNumber(atom_names)]; _XmDisplayToAppContext(display); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms); _XmAppLock(app); if (text_prop->encoding == atoms[XmACOMPOUND_TEXT]) { char *ptr; /* First found how many XmString we need to allocate. */ for (*count_return = 1, i = 0; i < text_prop->nitems; i++) { if (text_prop->value[i] == '\0') (*count_return)++; } string_table = (XmStringTable)XtMalloc(sizeof(XmString) * (*count_return)); /* Now convert each compound text to an XmString. */ for (i = 0, ptr = (char *)text_prop->value; i < *count_return; i++, ptr += strlen(ptr) + 1) { XmString tempstr; tempstr = XmCvtCTToXmString(ptr); string_table[i] = tempstr; } *string_table_return = string_table; _XmAppUnlock(app); return(Success); } else if (text_prop->encoding == atoms[XmA_MOTIF_COMPOUND_STRING]) { unsigned char *asn1_head; /* First calculate how many elements there are */ asn1_head = text_prop->value; for (elements = 0; *asn1_head != '\0'; ++elements) asn1_head += XmStringByteStreamLength(asn1_head); /* Now allocate a string table to put them in */ string_table = (XmStringTable)XtMalloc(sizeof(XmString) * elements); /* Run through again, converting the strings. */ asn1_head = text_prop->value; for (elements = 0; *asn1_head != '\0'; ++elements) { string_table[elements] = XmCvtByteStreamToXmString(asn1_head); /* If the string is NULL, then we don't know what to do */ if (string_table[elements] == (XmString) NULL) { while (elements > 0) XtFree((char *)string_table[--elements]); XtFree((char *)string_table); _XmAppUnlock(app); return(XConverterNotFound); } /* Find the next asn1 string header */ asn1_head += XmStringByteStreamLength(asn1_head); } *string_table_return = string_table; *count_return = elements; _XmAppUnlock(app); return(Success); } else if (text_prop->encoding == LOCALE_ATOM) { tag = _MOTIF_DEFAULT_LOCALE; type = XmMULTIBYTE_TEXT; } else if (text_prop->encoding == XA_STRING) { tag = "ISO8859-1"; type = XmCHARSET_TEXT; } #ifdef UTF8_SUPPORTED else if (text_prop->encoding == atoms[XmAUTF8_STRING]) { tag = "UTF-8"; type = XmCHARSET_TEXT; } #endif else { _XmAppUnlock(app); return(XLocaleNotSupported); } /* We fell through the else-if's so pull apart the data in the text property and set up a return string table. */ /* First count up how many string elements there are in the value. */ for (i = 0, elements = 1; i < text_prop->nitems - 1; ++i) { /* The text prop value will have two NULL's at the end, one for the end of the last string and one to terminate the entire value. The terminating NULL will be excluded by looping until i == nitems since the terminating NULL is not included in the nitems calculation. */ if (text_prop->value[i] == '\0') ++elements; } /* Create an appropriately sized array of xmstrings */ string_table = (XmStringTable)XtMalloc(sizeof(XmString) * (elements)); /* Create XmStrings from each string in the value field */ string_table[0] = XmStringGenerate((XtPointer)text_prop->value, tag, type, NULL); for (i = 0, elements = 1; i < text_prop->nitems - 1; ++i) { if (text_prop->value[i] == '\0') string_table[elements++] = XmStringGenerate((XtPointer) &(text_prop->value[i + 1]), tag, type, NULL); } *string_table_return = string_table; *count_return = elements; _XmAppUnlock(app); return(Success); } motif-2.3.8/lib/Xm/IconH.h0000644000175000017500000000346112672140200012064 00000000000000/* $XConsortium: IconH.h /main/5 1995/07/15 20:52:21 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmIconH_h #define _XmIconH_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ extern WidgetClass xmIconHeaderClass; typedef struct _XmIconHeaderClassRec * XmIconHeaderClass; typedef struct _XmIconHeaderRec * XmIconHeader; #ifndef XmIsIconHeader #define XmIsIconHeader(w) XtIsSubclass(w, xmIconHeaderClass) #endif /* XmIsIconHeader */ /******** Public Function Declarations ********/ extern Widget XmCreateIconHeader( Widget parent, String name, ArgList arglist, Cardinal argcount) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIconH_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmWrFFrDat.c0000644000175000017500000000504212672140200013160 00000000000000/* $XConsortium: XpmWrFFrDat.c /main/2 1996/09/20 08:14:23 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * WrFFrData.c: * * * * XPM library * * Parse an Xpm array and write a file that corresponds to it. * * * * Developed by Dan Greening dgreen@cs.ucla.edu / dgreen@sti.com * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmWriteFileFromData(filename, data) char *filename; char **data; { XpmImage image; XpmInfo info; int ErrorStatus; info.valuemask = XpmReturnComments | XpmReturnExtensions; ErrorStatus = XpmCreateXpmImageFromData(data, &image, &info); if (ErrorStatus != XpmSuccess) return (ErrorStatus); ErrorStatus = XpmWriteFileFromXpmImage(filename, &image, &info); XpmFreeXpmImage(&image); XpmFreeXpmInfo(&info); return (ErrorStatus); } motif-2.3.8/lib/Xm/xmstring.list0000644000175000017500000006505413211512777013505 00000000000000! $TOG: xmstring.list /main/5 1997/06/20 08:37:02 samborn $ #prefix Xm #const _Xm #feature XMSTRINGDEFINES #externref externalref #externdef externaldef(_xmstrings) #ctmpl XmStrDefs.ct #file XmStrDefs.h #table _XmStrings #htmpl XmStrDefs.ht S CAccelerator CAcceleratorText CAdjustLast CAdjustMargin CAlignment CAllowOverlap CAllowUnusedSpace CAnimationMask CAnimationPixmap CAnimationPixmapDepth CAnimationStyle CApplyLabelString CArmCallback CArmColor CArmPixmap CArrowDirection CAttachment CAudibleWarning CAutoShowCursorPosition CAutoUnmanage CAutomaticSelection CAvailability CBackgroundPixmap CBlendModel CBlinkRate CBottomShadowColor CBottomShadowPixmap CButtonAcceleratorText CButtonAccelerators CButtonCount CButtonFontList CButtonMnemonicCharSets CButtonMnemonics CButtonSet CButtonType CButtons CCancelLabelString CChildHorizontalAlignment CChildHorizontalSpacing CChildPlacement CChildType CChildVerticalAlignment CChildren CClientData CClipWindow CColumns CCommandWindow CCommandWindowLocation CConvertProc CCursorBackground CCursorForeground CCursorPosition CCursorPositionVisible CDarkThreshold CDecimalPoints CDefaultButtonShadowThickness CDefaultButtonType CDefaultCopyCursorIcon CDefaultFontList CDefaultInvalidCursorIcon CDefaultLinkCursorIcon CDefaultMoveCursorIcon CDefaultNoneCursorIcon CDefaultPosition CDefaultSourceCursorIcon CDefaultValidCursorIcon CDeleteResponse CDesktopParent CDialogStyle CDialogTitle CDialogType CDirListItemCount CDirListItems CDirListLabelString CDirMask CDirSearchProc CDirSpec CDirectory CDirectoryValid CDisarmCallback CDoubleClickInterval CDragContextClass CDragDropFinishCallback CDragIconClass CDragInitiatorProtocolStyle CDragMotionCallback CDragOperations CDragOverMode CDragProc CDragReceiverProtocolStyle CDropProc CDropRectangles CDropSiteActivity CDropSiteEnterCallback CDropSiteLeaveCallback CDropSiteManagerClass CDropSiteOperations CDropSiteType CDropStartCallback CDropTransferClass CDropTransfers CEditable CEntryBorder CEntryClass CExportTargets CExposeCallback CExtensionType CFileListItemCount CFileListItems CFileListLabelString CFileSearchProc CFileTypeMask CFillOnArm CFillOnSelect CFilterLabelString CFontList CForegroundThreshold CHelpLabelString CHighlightColor CHighlightOnEnter CHighlightPixmap CHighlightThickness CHorizontalFontUnit CHorizontalScrollBar CHot CICCHandle CImportTargets CIncrement CIncremental CIndicatorOn CIndicatorSize CIndicatorType CInitialDelay CInitialFocus CInputCreate CInputMethod CInvalidCursorForeground CIsAligned CIsHomogeneous CItemCount CItems CKeyboardFocusPolicy CLabelFontList CLabelInsensitivePixmap CLabelPixmap CLabelString CLabelType CLightThreshold CListLabelString CListMarginHeight CListMarginWidth CListSizePolicy CListSpacing CListUpdated CLogicalParent CMainWindowMarginHeight CMainWindowMarginWidth CMappingDelay CMarginBottom CMarginHeight CMarginLeft CMarginRight CMarginTop CMarginWidth CMask CMaxItems CMaxLength CMaxValue CMaximum CMenuBar CMenuPost CMenuWidget CMessageProc CMessageWindow CMinimizeButtons CMinimum CMnemonic CMnemonicCharSet CMoveOpaque CMultiClick CMustMatch CMwmDecorations CMwmFunctions CMwmInputMode CMwmMenu CMwmMessages CNavigationType CNeedsMotion CNoMatchString CNoResize CNoneCursorForeground CNotifyProc CNumChildren CNumColumns CNumDropRectangles CNumDropTransfers CNumExportTargets CNumImportTargets COffset COkLabelString COperationChangedCallback COperationCursorIcon COptionLabel COptionMnemonic COutputCreate CPacking CPageIncrement CPaneMaximum CPaneMinimum CPattern CPendingDelete CPopupEnabled CPositionIndex CPostFromButton CPostFromCount CPostFromList CPreeditType CProcessingDirection CPromptString CProtocolCallback CPushButtonEnabled CQualifySearchDataProc CRadioAlwaysOne CRadioBehavior CRecomputeSize CRectangles CRepeatDelay CResizeCallback CResizeHeight CResizePolicy CResizeWidth CRowColumnType CRows CRubberPositioning CSashHeight CSashIndent CSashWidth CScaleHeight CScaleMultiple CScaleWidth CScroll CScrollBarDisplayPolicy CScrollBarPlacement CScrollSide CScrolledWindowMarginHeight CScrolledWindowMarginWidth CScrollingPolicy CSelectColor CSelectInsensitivePixmap CSelectPixmap CSelectThreshold CSelectedItemCount CSelectedItems CSelectionArrayCount CSelectionLabelString CSelectionPolicy CSeparatorOn CSeparatorType CSet CShadowThickness CShadowType CShellUnitType CShowArrows CShowAsDefault CShowSeparator CShowValue CSimpleCheckBox CSimpleMenuBar CSimpleOptionMenu CSimplePopupMenu CSimplePulldownMenu CSimpleRadioBox CSizePolicy CSliderSize CSource CSourceCursorIcon CSourceIsExternal CSourcePixmapIcon CSourceWidget CSourceWindow CSpacing CStartTime CStateCursorIcon CStringDirection CTearOffModel CTextFontList CTextString CTextValue CTitleString CTopCharacter CTopItemPosition CTopLevelEnterCallback CTopLevelLeaveCallback CTopShadowColor CTopShadowPixmap CTransferProc CTransferStatus CTraversalOn CTraversalType CTreeUpdateProc CTroughColor CUnitType CUnpostBehavior CUnselectPixmap CUpdateSliderSize CUseAsyncGeometry CUserData CValidCursorForeground CValueChangedCallback CValueWcs CVerifyBell CVerticalAlignment CVerticalFontUnit CVerticalScrollBar CVisibleItemCount CVisibleWhenOff CVisualPolicy CWhichButton CWordWrap CWorkWindow CXmString Naccelerator NacceleratorText NactivateCallback NadjustLast NadjustMargin Nalignment NallowOverlap NallowResize NallowUnusedSpace NanimationMask NanimationPixmap NanimationPixmapDepth NanimationStyle NapplyCallback NapplyLabelString NarmCallback NarmColor NarmPixmap NarrowDirection Nattachment NaudibleWarning NautoShowCursorPosition NautoUnmanage NautomaticSelection Navailability NblendModel NblinkRate NbottomAttachment NbottomOffset NbottomPosition NbottomShadowColor NbottomShadowPixmap NbottomWidget NbrowseSelectionCallback NbuttonAcceleratorText NbuttonAccelerators NbuttonCount NbuttonFontList NbuttonMnemonicCharSets NbuttonMnemonics NbuttonSet NbuttonType Nbuttons NcancelButton NcancelCallback NcancelLabelString NcascadePixmap NcascadingCallback NchildHorizontalAlignment NchildHorizontalSpacing NchildPlacement NchildPosition NchildType NchildVerticalAlignment NclientData NclipWindow Ncolumns Ncommand NcommandChangedCallback NcommandEnteredCallback NcommandWindow NcommandWindowLocation NconvertProc NcursorBackground NcursorForeground NcursorPosition NcursorPositionVisible NdarkThreshold NdecimalPoints NdecrementCallback NdefaultActionCallback NdefaultButton NdefaultButtonShadowThickness NdefaultButtonType NdefaultCopyCursorIcon NdefaultFontList NdefaultInvalidCursorIcon NdefaultLinkCursorIcon NdefaultMoveCursorIcon NdefaultNoneCursorIcon NdefaultPosition NdefaultSourceCursorIcon NdefaultValidCursorIcon NdeleteResponse NdesktopParent NdialogStyle NdialogTitle NdialogType NdirListItemCount NdirListItems NdirListLabelString NdirMask NdirSearchProc NdirSpec Ndirectory NdirectoryValid NdisarmCallback NdoubleClickInterval NdragCallback NdragContextClass NdragDropFinishCallback NdragIconClass NdragInitiatorProtocolStyle NdragMotionCallback NdragOperations NdragOverMode NdragProc NdragReceiverProtocolStyle NdropFinishCallback NdropProc NdropRectangles NdropSiteActivity NdropSiteEnterCallback NdropSiteLeaveCallback NdropSiteManagerClass NdropSiteOperations NdropSiteType NdropStartCallback NdropTransferClass NdropTransfers NeditMode Neditable NentryAlignment NentryBorder NentryCallback NentryClass NentryVerticalAlignment NexportTargets NexposeCallback NextendedSelectionCallback NextensionType NfileListItemCount NfileListItems NfileListLabelString NfileSearchProc NfileTypeMask NfillOnArm NfillOnSelect NfilterLabelString NfocusCallback NfocusMovedCallback NfocusPolicyChanged NfontList NforegroundThreshold NfractionBase NgainPrimaryCallback NhelpCallback NhelpLabelString NhighlightColor NhighlightOnEnter NhighlightPixmap NhighlightThickness NhistoryItemCount NhistoryItems NhistoryMaxItems NhistoryVisibleItemCount NhorizontalFontUnit NhorizontalScrollBar NhorizontalSpacing NhotX NhotY NiccHandle NimportTargets Nincrement NincrementCallback Nincremental NindicatorOn NindicatorSize NindicatorType NinitialDelay NinitialFocus NinputCallback NinputCreate NinputMethod NinvalidCursorForeground NisAligned NisHomogeneous NitemCount Nitems NkeyboardFocusPolicy NlabelFontList NlabelInsensitivePixmap NlabelPixmap NlabelString NlabelType NleftAttachment NleftOffset NleftPosition NleftWidget NlightThreshold NlineSpace NlistItemCount NlistItems NlistLabelString NlistMarginHeight NlistMarginWidth NlistSizePolicy NlistSpacing NlistUpdated NlistVisibleItemCount NlogicalParent NlosePrimaryCallback NlosingFocusCallback NmainWindowMarginHeight NmainWindowMarginWidth NmapCallback NmappingDelay Nmargin NmarginBottom NmarginHeight NmarginLeft NmarginRight NmarginTop NmarginWidth Nmask NmaxLength Nmaximum NmenuAccelerator NmenuBar NmenuCursor NmenuHelpWidget NmenuHistory NmenuPost NmessageAlignment NmessageProc NmessageString NmessageWindow NminimizeButtons Nminimum Nmnemonic NmnemonicCharSet NmodifyVerifyCallback NmodifyVerifyCallbackWcs NmotionVerifyCallback NmoveOpaque NmultiClick NmultipleSelectionCallback NmustMatch NmwmDecorations NmwmFunctions NmwmInputMode NmwmMenu NmwmMessages NnavigationType NneedsMotion NnoMatchCallback NnoMatchString NnoResize NnoneCursorForeground NnotifyProc NnumColumns NnumDropRectangles NnumDropTransfers NnumExportTargets NnumImportTargets NnumRectangles NoffsetX NoffsetY NokCallback NokLabelString NoperationChangedCallback NoperationCursorIcon NoptionLabel NoptionMnemonic NoutputCreate Npacking NpageDecrementCallback NpageIncrement NpageIncrementCallback NpaneMaximum NpaneMinimum Npattern NpendingDelete NpopupEnabled NpositionIndex NpostFromButton NpostFromCount NpostFromList NpreeditType NprocessingDirection NpromptString NprotocolCallback NpushButtonEnabled NqualifySearchDataProc NradioAlwaysOne NradioBehavior NrealizeCallback NrecomputeSize Nrectangles NrefigureMode NrepeatDelay Nresizable NresizeCallback NresizeHeight NresizePolicy NresizeWidth NrightAttachment NrightOffset NrightPosition NrightWidget NrowColumnType Nrows NrubberPositioning NsashHeight NsashIndent NsashShadowThickness NsashWidth NscaleHeight NscaleMultiple NscaleWidth NscrollBarDisplayPolicy NscrollBarPlacement NscrollHorizontal NscrollLeftSide NscrollTopSide NscrollVertical NscrolledWindowMarginHeight NscrolledWindowMarginWidth NscrollingPolicy NselectColor NselectInsensitivePixmap NselectPixmap NselectThreshold NselectedItemCount NselectedItems NselectionArrayCount NselectionLabelString NselectionPolicy NseparatorOn NseparatorType Nset Nshadow NshadowThickness NshadowType NshellUnitType NshowArrows NshowAsDefault NshowSeparator NshowValue NsimpleCallback NsingleSelectionCallback NsizePolicy NskipAdjust NsliderSize Nsource NsourceCursorIcon NsourceIsExternal NsourcePixmapIcon NsourceWidget NsourceWindow Nspacing NspotLocation NstartTime NstateCursorIcon NstringDirection NsubMenuId NsymbolPixmap NtearOffMenuActivateCallback NtearOffMenuDeactivateCallback NtearOffModel NtextAccelerators NtextColumns NtextFontList NtextString NtextTranslations NtextValue NtitleString NtoBottomCallback NtoPositionCallback NtoTopCallback NtopAttachment NtopCharacter NtopItemPosition NtopLevelEnterCallback NtopLevelLeaveCallback NtopOffset NtopPosition NtopShadowColor NtopShadowPixmap NtopWidget NtransferProc NtransferStatus NtraversalCallback NtraversalOn NtraversalType NtraverseObscuredCallback NtreeUpdateProc NtroughColor NunitType NunmapCallback NunpostBehavior NunselectPixmap NupdateSliderSize NuseAsyncGeometry NuserData NvalidCursorForeground NvalueChangedCallback NvalueWcs NverifyBell NverticalFontUnit NverticalScrollBar NverticalSpacing NvisibleItemCount NvisibleWhenOff NvisualPolicy NwhichButton NwordWrap NworkWindow RAlignment RAnimationMask RAnimationPixmap RAnimationStyle RArrowDirection RAtomList RAttachment RAudibleWarning RAvailability RBackgroundPixmap RBlendModel RBooleanDimension RBottomShadowPixmap RButtonType RCallbackProc RChar RCharSetTable RChildHorizontalAlignment RChildPlacement RChildType RChildVerticalAlignment RCommandWindowLocation RCompoundText RDefaultButtonType RDeleteResponse RDialogStyle RDialogType RDoubleClickInterval RDragInitiatorProtocolStyle RDragReceiverProtocolStyle RDropSiteActivity RDropSiteOperations RDropSiteType RDropTransfers RExtensionType RFileTypeMask RFontList RGadgetPixmap RHighlightPixmap RHorizontalDimension RHorizontalInt RHorizontalPosition RIconAttachment RImportTargets RIndicatorType RItemCount RItems RKeySym RKeySymTable RKeyboardFocusPolicy RLabelType RListMarginHeight RListMarginWidth RListSizePolicy RListSpacing RManBottomShadowPixmap RManForegroundPixmap RManHighlightPixmap RManTopShadowPixmap RMenuWidget RMnemonic RMultiClick RNavigationType RPacking RPrimForegroundPixmap RProc RProcessingDirection RRectangleList RResizePolicy RRowColumnType RScrollBarDisplayPolicy RScrollBarPlacement RScrollingPolicy RSelectedItemCount RSelectedItems RSelectionPolicy RSelectionType RSeparatorType RShadowType RShellHorizDim RShellHorizPos RShellUnitType RShellVertDim RShellVertPos RSizePolicy RStringDirection RTearOffModel RTopShadowPixmap RTransferStatus RTraversalType RUnitType RUnpostBehavior RValueWcs RVerticalAlignment RVerticalDimension RVerticalInt RVerticalPosition RVirtualBinding RVisibleItemCount RVisualPolicy RWhichButton RXmBackgroundPixmap RXmString RXmStringCharSet RXmStringTable VosfActivate VosfAddMode VosfBackSpace VosfBeginLine VosfCancel VosfClear VosfCopy VosfCut VosfDelete VosfDown VosfEndLine VosfHelp VosfInsert VosfLeft VosfMenu VosfMenuBar VosfPageDown VosfPageLeft VosfPageRight VosfPageUp VosfPaste VosfPrimaryPaste VosfQuickPaste VosfRight VosfSelect VosfUndo VosfUp SFONTLIST_DEFAULT_TAG_STRING SXmFONTLIST_DEFAULT_TAG_STRING RTopItemPosition #table _XmStrings20 NtearOffTitle CTearOffTitle NpopupHandlerCallback NconvertCallback NdestinationCallback NselectedItem CSelectedItem NselectionCallback NmatchBehavior CMatchBehavior NnoFontCallback NtextPath NeditingPath CEditingPath NbidirectionalCursor CBidirectionalCursor NcollapsedStatePixmap NdetailColumnHeading NdetailCount NdetailTabList NexpandedStatePixmap NlargeCellHeight NlargeCellWidth NlayoutType NoutlineIndentation NoutlineLineStyle NprimaryOwnership NselectionTechnique NsmallCellHeight NsmallCellWidth NspatialStyle NentryParent NlargeIconX NlargeIconY NsmallIconX NsmallIconY CCollapsedStatePixmap CDetailColumnHeading CDetailCount CDetailMask CEntryViewType CLineStyle CDetailTabList CExpandedStatePixmap CIncludeModel CCellHeight CCellWidth CLayoutType COutlineIndentation CPlaceModel CPrimaryOwnership CSelectionTechnique CSpatialStyle CEntryDetail CExpandState NlargeIcon NlargeIconMask NlargeIconPixmap NsmallIcon NsmallIconMask NsmallIconPixmap CIcon CViewType CVisualEmphasis NcurrentPageNumber NfirstPageNumber NlastPageNumber NbackPagePlacement NbackPageNumber NbackPageSize NbackPageForeground NbackPageBackground NframeBackground NbindingType NbindingPixmap NbindingWidth NmajorTabSpacing NminorTabSpacing NinnerMarginWidth NinnerMarginHeight NframeShadowThickness NpageNumber CCurrentPageNumber CFirstPageNumber CLastPageNumber CBackPagePlacement CBackPageNumber CBackPageSize CBackPageForeground CBackPageBackground CFrameBackground CBindingType CBindingPixmap CBindingWidth CMajorTabSpacing CMinorTabSpacing CInnerMarginWidth CInnerMarginHeight CPageChangeCallback CPageNumber RArrowLayout RArrowSensitivity RSpinBoxChildType NarrowLayout CArrowLayout NarrowSensitivity CArrowSensitivity NdefaultArrowSensitivity CDefaultArrowSensitivity NarrowSize CArrowSize NspinBoxChildType CSpinBoxChildType Nposition NnumValues CNumValues Nvalues CValues NminimumValue CMinimumValue NmaximumValue CMaximumValue NincrementValue CIncrementValue RAutomaticSelection RLineStyle REntryViewType RDirection RLayoutType RPrimaryOwnership RSelectionTechnique RSpatialStyle RTabList RViewType RVisualEmphasis RBindingType RNBChildType NentryViewType NinsensitiveStippleBitmap NlayoutDirection NviewType NvisualEmphasis CLayoutDirection NsnapBackMultiple NslidingMode NsliderVisual NautoDragModel NcolorCalculationProc NbitmapConversionModel NcolorAllocationProc NselectionMode NselectedPositions NselectedPositionCount CSnapBackMultiple CSliderVisual CSlidingMode CAutoDragModel CColorCalculationProc CBitmapConversionModel CColorAllocationProc CInsensitiveStippleBitmap CSelectionMode CSelectedPositions CSelectedPositionCount RSlidingMode RShowArrows RSliderVisual RShowValue RAutoDragModel RSWChildType RBitmapConversionModel RSelectionMode NinputPolicy CInputPolicy RInputPolicy NtoggleMode CToggleMode RToggleMode RIndicatorOn RSet NindeterminatePixmap CIndeterminatePixmap NunselectColor CUnselectColor NselectedPosition NarrowSpacing CArrowSpacing RMatchBehavior RComboBoxType CSelectedPosition NenableWarp CEnableWarp REnableWarp NmotifVersion CMotifVersion NdefaultGlyphPixmap CDefaultGlyphPixmap CRendition Ntag CTag NfontName CFontName NfontType CFontType RFontType NloadModel CLoadModel RLoadModel NtabList CTabList RRenditionPixel NunderlineType CUnderlineType NstrikethruType CStrikethruType RLineType NrenderTable CRenderTable RRenderTable NbuttonRenderTable CButtonRenderTable RButtonRenderTable NlabelRenderTable CLabelRenderTable RLabelRenderTable NtextRenderTable CTextRenderTable RTextRenderTable NdragStartCallback NnoRenditionCallback SXmAS_IS MIsWhiteSpaceMethod MIsScanBreakMethod MCharDirection MInitialCharsDirection NpatternType Nsubstitute NinvokeParseProc NincludeStatus VosfBackTab VosfBeginData VosfDeselectAll VosfEndData VosfEscape VosfExtend VosfLeftLine VosfNext VosfNextField VosfNextMenu VosfNextMinor VosfPrevField VosfPrevMenu VosfPrior VosfPriorMinor VosfReselect VosfRestore VosfRightLine VosfSelectAll VosfSwitchDirection NnotebookChildType CNotebookChildType RNotebookChildType NscrolledWindowChildType CScrolledWindowChildType RScrolledWindowChildType NselectedObjects CSelectedObjects NselectedObjectCount CSelectedObjectCount NcomboBoxType CComboBoxType NtabValue NoffsetModel Ndecimal Ndetail CDetail NdetailCount CDetailCount NcontainerID CContainerID SCLIENT_WINDOW SCLIP_TEMPORARY SCLIPBOARD SCOMPOUND_TEXT SDELETE SFILE SFILE_NAME SINCR SINSERT_PROPERTY SINSERT_SELECTION SLENGTH SLINK_SELECTION S_MOTIF_ATOM_0 S_MOTIF_BINDINGS S_MOTIF_DEFAULT_BINDINGS S_MOTIF_CANCEL_DROP_EFFECT S_MOTIF_CLIP_HEADER S_MOTIF_CLIP_DATA_REQUEST S_MOTIF_CLIP_DATA_DELETE S_MOTIF_CLIP_ITEM S_MOTIF_CLIP_LOCK S_MOTIF_CLIP_LOCK_ACCESS_VALID S_MOTIF_CLIP_MESSAGE S_MOTIF_CLIP_NEXT_ID S_MOTIF_CLIP_TIME S_MOTIF_CLIPBOARD_TARGETS S_MOTIF_COMPOUND_STRING S_MOTIF_DEFERRED_CLIPBOARD_TARGETS S_MOTIF_DESTINATION S_MOTIF_DRAG_OFFSET S_MOTIF_DROP S_MOTIF_ENCODING_REGISTRY S_MOTIF_EXPORT_TARGETS S_MOTIF_LOSE_SELECTION S_MOTIF_RENDER_TABLE S_MOTIF_WM_QUERY S_MOTIF_WM_ALL_CLIENTS SMULTIPLE SNULL STARGETS STEXT STIMESTAMP SWM_STATE STRANSFER_SUCCESS XmTRANSFER_SUCCESS STRANSFER_FAILURE XmTRANSFER_FAILURE NpathMode RPathMode CPathMode NfileFilterStyle RFileFilterStyle CFileFilterStyle NdirTextLabelString CDirTextLabelString NenableBtn1Transfer CEnableBtn1Transfer NenableButtonTab CEnableButtonTab NenableEtchedInMenu CEnableEtchedInMenu NdefaultButtonEmphasis CDefaultButtonEmphasis RDefaultButtonEmphasis NenableToggleColor CEnableToggleColor NenableToggleVisual CEnableToggleVisual NenableDragIcon CEnableDragIcon NenableUnselectableDrag CEnableUnselectableDrag NdragOverActiveMode CDragOverActiveMode NinstallColormap CInstallColormap COwnerEvents NownerEvents CGrabStyle NgrabStyle NforegroundState NbackgroundState CGroundState RGroundState RSelectColor RLargeIconPixmap RSmallIconPixmap NoutlineState COutlineState ROutlineState NspatialIncludeModel CSpatialIncludeModel RSpatialIncludeModel NspatialResizeModel CSpatialResizeModel RSpatialResizeModel NspatialSnapModel CSpatialSnapModel RSpatialSnapModel NdetailColumnHeadingCount CDetailColumnHeadingCount NdetailOrder CDetailOrder RCardinalList NdetailOrderCount CDetailOrderCount NoutlineColumnWidth COutlineColumnWidth NoutlineChangedCallback COutlineChangedCallback NoutlineButtonPolicy COutlineButtonPolicy ROutlineButtonPolicy CDefaultVirtualBindings NdefaultVirtualBindings CResizable RDynamicPixmap NpageChangedCallback Narea NdetailShadowThickness NsliderMark CSliderMark RSliderMark REnableBtn1Transfer NrenditionBackground NrenditionForeground CRenditionBackground CRenditionForeground NindeterminateInsensitivePixmap CIndeterminateInsensitivePixmap NframeChildType CFrameChildType #table _XmStrings21 NtextField CTextField NenableThinThickness CEnableThinThickness NprimaryColorSetId CPrimaryColorSetId NsecondaryColorSetId CSecondaryColorSetId NtextColorSetId CTextColorSetId NactiveColorSetId CActiveColorSetId NinactiveColorSetId CInactiveColorSetId NuseColorObj CUseColorObj NuseTextColor CUseTextColor NuseTextColorForList CUseTextColorForList NuseMask CUseMask NuseMultiColorIcons CUseMultiColorIcons NuseIconFileCache CUseIconFileCache SPIXEL_SET Pixel Sets SCUSTOMIZE_DATA Customize Data: SCOLOR_SRV_NAME ColorServer Nlist CList NarrowOrientation CArrowOrientation RArrowOrientation NpositionType CPositionType RPositionType Nwrap CWrap NpositionMode CPositionMode RPositionMode NprintOrientation CPrintOrientation NprintOrientations CPrintOrientations NprintResolution CPrintResolution NprintResolutions CPrintResolutions NdefaultPixmapResolution CDefaultPixmapResolution NstartJobCallback NendJobCallback NpageSetupCallback NpdmNotificationCallback NminX NminY NmaxX NmaxY CMinX CMinY CMaxX CMaxY NpreeditStartCallback NpreeditDoneCallback NpreeditDrawCallback NpreeditCaretCallback NverifyPreedit CVerifyPreedit NenableMultiKeyBindings CEnableMultiKeyBindings RButtonFontList RLabelFontList RTextFontList SPIXEL_SET_PROP SDT Pixel Set S50_foreground Sunspecified_pixmap #file XmStrDefs22.h #table _XmStrings22 #htmpl XmStrDefs22.ht !CAllowUnusedSpace !NallowUnusedSpace NitemFoundCallback NitemNotFoundCallback RXmTabSide RTabSide RXmPixmapPlacement RXmPixmap RXmPixel RXmIconPlacement RXmHierarchyNodeState RXmFillOption RXmConnectStyle RXmColorMode RXmAlignment RTabStyle RTabOrientation RTabMode RTabList RTabEdge RTabArrowPlacement NxlfdString NverticalNodeSpace NverticalMargin NverifyTextFailedCallback NverifyTextCallback Nverify Nvalues NuseTextField NuseScaling NuseImageCache NupdateTextCallback NupdateShellCallback NunselectCallback NuniformTabSize NtraversalIndex NtitleString NtextString NtextRows NtearOffLabelString NtabTearOffEnabled NtabStyle NtabStringDirection NtabSide NtabSelectedCallback NtabSelectPixmap NtabSelectColor NtabPixmapPlacement NtabOrientation NtabOffset NtabMode NtabMarginWidth NtabMarginHeight NtabList NtabLabelString NtabLabelSpacing NtabLabelPixmap NtabForeground NtabEdge NtabCornerPercent NtabBoxWidget NtabBackgroundPixmap NtabBackground NtabAutoSelect NtabArrowPlacement NtabAlignment NstackedEffect NsortFunctions NsliderTogLabel NsizeString NshowValue NshowSash NshowNameString NshowLabel NshowFontName NshowFind NselectedIndex NselectedColumn NselectCallback NscalingString NsashTranslations NsampleText NrgbFile NresizeToPreferred NresizeCallback NredSliderLabel NpropSpaceString NpreferredPaneSize Nposition NpopupShellWidget NpopupOffset NpopupCursor NpixmapWidth NpixmapHeight NparentNode NotherString NoptionString NopenFolderPixmap NopenClosePadding NnumValues NnumStacks NnumRows NnodeStateChangedCallback NnodeStateCallback NnodeStateBegEndCallback NnodeState NnoCellError NmonoSpaceString NminimumVerticalCells NminimumHorizontalCells NminimumCellWidth NminimumCellHeight Nmargin Nlist NlineWidth NlineColor Nlabel NitalicString NinsertBefore NindentSpace NiconTextPadding NiconPlacement NhorizontalNodeSpace NhorizontalMargin NgreenSliderLabel NfreeTabPixmap NfirstRow NfirstColumnPixmaps NfirstColumn NfindLabel NfillOption NfileReadError NfamilyString NequalSize NentryLabelString NentryData NencodingString NencodingList NdoubleClickCallback NdefaultEncodingString NdFieldPrefWidth NdFieldPrefHeight NdFieldMinWidth NdFieldMinHeight NdFieldMaxWidth NdFieldMaxHeight NcustomizedCombinationBox Ncursor NcurrentFont NconnectStyle NcomboTranslations NcolumnTitles NcolorName NcolorMode NcolorListTogLabel NcellY NcellX NbothString NboldString NblueSliderLabel CDistribution CFillStyle CItemSpacing CLabelSpacing CShowLabel CStretchable NdefaultEntryLabelAlignment NdefaultEntryLabelFontList NdefaultFillStyle Ndistribution NentryLabelAlignment NentryLabelFontList NentryLabelPixmap NentryLabelType NfillStyle NitemSpacing NlabelSpacing NshowEntryLabel Nstretchable RDistribution RFillStyle CEqualSize CFillOption CColorMode CFileReadError CNoCellError CSliderLabel CTogLabel CAutoFill CPicture NautoFill Npicture NpictureErrorCallback NvalidateCallback CFindLabel CShowFind NentryBackground CColumnTitles CEntryData CFirstColumnPixmaps CFirstLocation CNewVisualStyle CNumRows CScrollBar CSelectedColumn NnewVisualStyle CPreferredPaneSize CShowSash C100DPIString C75DPIString CAnyLowerString CAnyString CBoldString CBothString CDefaultEncodingString CEncodingList CEncodingString CFamilyString CItalicString CMonoSpaceString COptionString COtherString CPropSpaceString CSampleText CScalingString CShowNameString CSizeString CTextRows CXlfdSpaceString N100DPIstring N75DPIstring NanyLowerString NanyString CCellX CCellY CDefaultCells CMinimumCellSize CIconPlacement NpixmapDepth CAutoClose CInsertBefore CNodeState CNodeStateCallback CNodeStateChangedCallback CParentNode NautoClose NcloseFolderPixmap NnodeCloseFolderPixmap NnodeOpenFolderPixmap NnodeStateBeginEndCallback CConstrainWidth CIndentSpace NconnectNodes NconstrainWidth CNumStacks CSelectedIndex CStackedEffect CTabAutoSelect CTabCornerPercent CTabEdge CTabLabelSpacing CTabMode CTabOffset CTabOrientation CTabSelectColor CTabSelectPixmap CTabStyle CTraversalIndex CUniformTabSize CUseImageCache CFreeTabPixmap CICSEnhancementPakResourceError CTabLabelPixmap CTabLabelString CTabPixmapPlacement CTabSide NillegalResourceValue CCompressStyle CConnectStyle CHorizontalDelta CLineWidth COpenClosePadding CVerticalDelta NcompressStyle NhorizontalDelta NlineBackgroundColor NlineStyle NverticalDelta RXmCompressStyle RXmLineStyle CPopupOffset CUseTextField CVerify #file XmStrDefs23.h #table _XmStrings23 #htmpl XmStrDefs23.ht NdefaultEntryLabelRenderTable NentryLabelRenderTable NpixmapPlacement CPixmapPlacement RPixmapPlacement NpixmapTextPadding #table _XmStrings230 NfontStyle CFontStyle NfontSize CFontSize NfontFoundry CFontFoundry NfontEncoding CFontEncoding NxftFont CXftFont SUTF8_STRING #file XmStrDefsI.h #table _XmStringsI #htmpl XmStrDefsI.ht IATOM_PAIR IAVERAGE_WIDTH IBACKGROUND ICHARACTER_POSITION ICLASS ICOLUMN_NUMBER IDONE IFOREGROUND IHOST_NAME ILINE_NUMBER ILIST_LENGTH IMODULE INAME INone IODIF IOWNER_OS IPDM_EXIT_CANCEL IPDM_EXIT_ERROR IPDM_EXIT_OK IPDM_REPLY IPDM_START IPDM_START_ERROR IPDM_START_OK IPDM_START_PXAUTH IPDM_START_VXAUTH IPIXEL IPIXEL_SIZE IPROCEDURE IPROCESS IRESOLUTION_Y ISPAN ITASK IUSER IWM_DELETE_WINDOW I_MOTIF_CURRENT_TIME I_MOTIF_DRAG_ATOMS I_MOTIF_DRAG_INITIATOR_INFO I_MOTIF_DRAG_PROXY_WINDOW I_MOTIF_DRAG_RECEIVER_INFO I_MOTIF_DRAG_TARGETS I_MOTIF_DRAG_WINDOW I_MOTIF_INITIATOR I_MOTIF_RECEIVER I_MOTIF_SELECTION_TEXT motif-2.3.8/lib/Xm/DrawUtils.h0000644000175000017500000000236612672140200013005 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef __XmDraw_h__ #define __XmDraw_h__ #include #include #if defined(__cplusplus) extern "C" { #endif typedef enum {XmBEVEL_BOTTOM, XmBEVEL_TOP, XmBEVEL_BOTH} XmBevelOption; void XmDrawBevel( #ifndef _NO_PROTO Display*, Drawable, GC, GC, int, int, unsigned int, XmBevelOption #endif ); #if defined(__cplusplus) } #endif #endif /* __XmDraw_h__ */ motif-2.3.8/lib/Xm/BaseClass.c0000644000175000017500000021422013145162623012725 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: BaseClass.c /main/20 1997/03/31 13:14:31 dbl $" #endif #endif #define HAVE_EXTENSIONS #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include /* for bzero */ #include "BaseClassI.h" #include "CallbackI.h" #include "DropSMgrI.h" #include "MessagesI.h" #include "TraversalI.h" #include "XmI.h" #define FIX_1392 #define MSG1 _XmMMsgBaseClass_0000 #define MSG2 _XmMMsgBaseClass_0001 #define IsBaseClass(wc) \ ((wc == xmGadgetClass) ||\ (wc == xmManagerWidgetClass) ||\ (wc == xmPrimitiveWidgetClass) ||\ (wc == vendorShellWidgetClass) ||\ (wc == xmDisplayClass) ||\ (wc == xmScreenClass) ||\ (wc == xmExtObjectClass) ||\ (_XmIsFastSubclass(wc, XmMENU_SHELL_BIT))) #define isWrappedXtClass(wc) \ ((wc == rectObjClass) ||\ (wc == compositeWidgetClass)) /* * These must be initialized; otherwise they are "secondary symbols" * and are not actually present in the library under HP/UX 10.0. That * caused exportlistgen to hide them entirely, causing links to fail. */ externaldef(baseclass) XrmQuark XmQmotif = NULLQUARK; externaldef(baseclass) XmBaseClassExt *_Xm_fastPtr = NULL; typedef struct _XmObjectClassWrapper { XtInitProc initialize; XtSetValuesFunc setValues; XtArgsProc getValues; XtWidgetClassProc classPartInit; } XmObjectClassWrapper; static XmObjectClassWrapper objectClassWrapper; static XContext resizeRefWContext = 0; static XContext geoRefWContext = 0; #define GetRefW(dpy, context, w) \ if (XFindContext(dpy, None, context, (XPointer *) &w)) w = NULL #define SetRefW(dpy, context, w) \ XSaveContext(dpy, None, context, (char *)w) externaldef(xminheritclass) int _XmInheritClass = 0; /******** Static Function Declarations ********/ static XmWrapperData GetWrapperData(WidgetClass w_class); static XContext ExtTypeToContext(unsigned char extType); static void RealizeWrapper0(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper1(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper2(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper3(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper4(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper5(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper6(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper7(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper8(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper9(Widget w, Mask *vmask, XSetWindowAttributes *attr); static void RealizeWrapper10(Widget w, Mask *vmask, XSetWindowAttributes *attr); static Cardinal GetRealizeDepth(WidgetClass wc); static void RealizeWrapper(Widget w, Mask *vmask, XSetWindowAttributes *attr, Cardinal depth); static void ResizeWrapper0(Widget w); static void ResizeWrapper1(Widget w); static void ResizeWrapper2(Widget w); static void ResizeWrapper3(Widget w); static void ResizeWrapper4(Widget w); static void ResizeWrapper5(Widget w); static void ResizeWrapper6(Widget w); static void ResizeWrapper7(Widget w); static void ResizeWrapper8(Widget w); static void ResizeWrapper9(Widget w); static void ResizeWrapper10(Widget w); static void ResizeWrapper11(Widget w); static void ResizeWrapper12(Widget w); static void ResizeWrapper13(Widget w); static Cardinal GetResizeDepth(WidgetClass wc); static void ResizeWrapper(Widget w, int depth); static XtGeometryResult GeometryHandlerWrapper0(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper1(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper2(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper3(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper4(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper5(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper6(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper7(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper8(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper9(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper10(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper11(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static XtGeometryResult GeometryHandlerWrapper12(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static Cardinal GetGeometryHandlerDepth(WidgetClass wc); static XtGeometryResult GeometryHandlerWrapper(Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed, int depth); static XmBaseClassExt * BaseClassPartInitialize(WidgetClass wc); static void ClassPartInitRootWrapper(WidgetClass wc); static void ClassPartInitLeafWrapper(WidgetClass wc); static XtResourceList * CreateIndirectionTable(XtResourceList resources, Cardinal num_resources); static void InitializeRootWrapper( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializeLeafWrapper( Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth); static void CInitializeLeafWrapper( Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth); static Boolean SetValuesRootWrapper( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth); static Boolean CSetValuesLeafWrapper( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth); static void GetValuesRootWrapper( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper( Widget new_w, ArgList args, Cardinal *num_args, int depth); static int GetDepth(WidgetClass wc); static void InitializeLeafWrapper0( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper1( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper2( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper3( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper4( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper5( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper6( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper7( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper8( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializeLeafWrapper9( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper0( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper1( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper2( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper3( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper4( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper5( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper6( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper7( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper8( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void CInitializeLeafWrapper9( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper0( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper1( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper2( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper3( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper4( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper5( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper6( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper7( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper8( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesLeafWrapper9( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper0( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper1( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper2( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper3( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper4( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper5( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper6( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper7( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper8( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean CSetValuesLeafWrapper9( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper0( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper1( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper2( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper3( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper4( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper5( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper6( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper7( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper8( Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesLeafWrapper9( Widget new_w, ArgList args, Cardinal *num_args); /******** End Static Function Declarations ********/ XmGenericClassExt * _XmGetClassExtensionPtr( XmGenericClassExt *listHeadPtr, XrmQuark owner ) { XmGenericClassExt *lclPtr = listHeadPtr; #ifdef DEBUG if (!lclPtr) { XmeWarning(NULL, "_XmGetClassExtensionPtr: invalid class ext pointer"); return NULL; } #endif /* DEBUG */ while (lclPtr && *lclPtr && ((*lclPtr)->record_type != owner)) lclPtr = (XmGenericClassExt *) &((*lclPtr)->next_extension); return lclPtr; } static XmWrapperData GetWrapperData( WidgetClass w_class ) { XmBaseClassExt *wcePtr; wcePtr = _XmGetBaseClassExtPtr( w_class, XmQmotif); if (!*wcePtr) { *wcePtr = (XmBaseClassExt) XtCalloc(1, sizeof(XmBaseClassExtRec)); (*wcePtr)->next_extension = NULL; (*wcePtr)->record_type = XmQmotif; (*wcePtr)->version = XmBaseClassExtVersion; (*wcePtr)->record_size = sizeof( XmBaseClassExtRec); } if ((*wcePtr)->version < XmBaseClassExtVersion) return NULL; if (!((*wcePtr)->wrapperData)) (*wcePtr)->wrapperData = (XmWrapperData) XtCalloc(1, sizeof(XmWrapperDataRec)); return (*wcePtr)->wrapperData; } typedef struct _ExtToContextRec { unsigned char extType; XContext context; } ExtToContextRec, *ExtToContext; static XContext ExtTypeToContext( unsigned char extType ) { static ExtToContextRec extToContextMap[16]; Cardinal i; ExtToContext curr; XContext context = (XContext) NULL; _XmProcessLock(); for (i = 0, curr = &extToContextMap[0]; i < XtNumber(extToContextMap) && !context; i++, curr++) { if (curr->extType == extType) context = curr->context; else if (!curr->extType) { curr->extType = extType; context = curr->context = XUniqueContext(); } } _XmProcessUnlock(); if (!context) XmeWarning(NULL, MSG1); return context; } typedef struct _XmAssocDataRec { XtPointer data; struct _XmAssocDataRec *next; } XmAssocDataRec, *XmAssocData; void _XmPushWidgetExtData( Widget widget, XmWidgetExtData data, #if NeedWidePrototypes unsigned int extType ) #else unsigned char extType ) #endif /* NeedWidePrototypes */ { XmAssocData newData; XmAssocData assocData = NULL; XmAssocData *assocDataPtr; Boolean empty; XContext widgetExtContext = ExtTypeToContext(extType); newData = (XmAssocData) XtCalloc(1, sizeof(XmAssocDataRec)); newData->data = (XtPointer)data; empty = XFindContext(XtDisplay(widget), (Window) widget, widgetExtContext, (char **) &assocData); assocDataPtr = &assocData; while (*assocDataPtr) assocDataPtr = &((*assocDataPtr)->next); *assocDataPtr = newData; if (empty) XSaveContext(XtDisplay(widget), (Window) widget, widgetExtContext, (XPointer) assocData); } void _XmPopWidgetExtData( Widget widget, XmWidgetExtData *dataRtn, #if NeedWidePrototypes unsigned int extType ) #else unsigned char extType ) #endif /* NeedWidePrototypes */ { XmAssocData assocData = NULL; XmAssocData *assocDataPtr; XContext widgetExtContext = ExtTypeToContext(extType); /* Initialize the return parameter. */ *dataRtn = NULL; if (XFindContext(XtDisplay(widget), (Window) widget, widgetExtContext, (char **) &assocData)) { #ifdef DEBUG XmeWarning(NULL, MSG2); #endif return; } assocDataPtr = &assocData; while ((*assocDataPtr) && (*assocDataPtr)->next) assocDataPtr = &((*assocDataPtr)->next); if (*assocDataPtr == assocData) XDeleteContext(XtDisplay(widget), (Window)widget, widgetExtContext); if (*assocDataPtr) { *dataRtn = (XmWidgetExtData) (*assocDataPtr)->data; XtFree((char *) *assocDataPtr); *assocDataPtr = NULL; } } XmWidgetExtData _XmGetWidgetExtData( Widget widget, #if NeedWidePrototypes unsigned int extType ) #else unsigned char extType ) #endif /* NeedWidePrototypes */ { XmAssocData assocData = NULL; XmAssocData *assocDataPtr; XContext widgetExtContext = ExtTypeToContext(extType); if ((XFindContext(XtDisplay(widget), (Window) widget, widgetExtContext, (char **) &assocData))) { #ifdef DEBUG XmeWarning(NULL, "no extension data on stack"); #endif /* DEBUG */ return NULL; } else { assocDataPtr = &assocData; while ((*assocDataPtr)->next) assocDataPtr = &((*assocDataPtr)->next); return (XmWidgetExtData) (*assocDataPtr)->data; } } Boolean _XmIsSubclassOf( WidgetClass wc, WidgetClass sc) { WidgetClass p = wc; while ((p) && (p != sc)) p = p->core_class.superclass; return (p == sc); } /********************************************************************* * * RealizeWrappers for vendorShell * *********************************************************************/ static void RealizeWrapper0( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 0); } static void RealizeWrapper1( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 1); } static void RealizeWrapper2( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 2); } static void RealizeWrapper3( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 3); } static void RealizeWrapper4( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 4); } static void RealizeWrapper5( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 5); } static void RealizeWrapper6( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 6); } static void RealizeWrapper7( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 7); } static void RealizeWrapper8( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 8); } static void RealizeWrapper9( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 9); } static void RealizeWrapper10( Widget w, Mask *vmask, XSetWindowAttributes *attr ) { RealizeWrapper(w, vmask, attr, 10); } /* Used to be XmConst, but this was not linking on Solaris */ static XtRealizeProc realizeWrappers[] = { RealizeWrapper0, RealizeWrapper1, RealizeWrapper2, RealizeWrapper3, RealizeWrapper4, RealizeWrapper5, RealizeWrapper6, RealizeWrapper7, RealizeWrapper8, RealizeWrapper9, RealizeWrapper10 }; static Cardinal GetRealizeDepth( WidgetClass wc ) { Cardinal i; i = 0; while (wc && wc != vendorShellWidgetClass) { i++; wc = wc->core_class.superclass; } if (wc) return i; #ifdef DEBUG else XtError("bad class for shell realize"); #endif /* DEBUG */ return 0; } /************************************************************************ * * RealizeWrapper * ************************************************************************/ static void RealizeWrapper( Widget w, Mask *vmask, XSetWindowAttributes *attr, Cardinal depth ) { if (XmIsVendorShell(w)) { XmWidgetExtData extData; WidgetClass wc = XtClass(w); XmWrapperData wrapperData; XtRealizeProc realize; Cardinal leafDepth = GetRealizeDepth(wc); Cardinal depthDiff = leafDepth - depth; while (depthDiff) { depthDiff--; wc = wc->core_class.superclass; } _XmProcessLock(); wrapperData = GetWrapperData(wc); realize = wrapperData ? wrapperData->realize : NULL; _XmProcessUnlock(); if (realize) (*realize)(w, vmask, attr); #if 0 /* DRK 6/20/94 -- This change breaks our test environment; when * present the normal shell isn't added to the grab list * because VendorExtRealize is never called. It used to * be called for the ApplicationShell class. */ /* * CR 9266: Only call the RealizeCallback if we're doing the * VendorShell class level. Do not call multiple times for * VendorShell subclasses. */ if ((extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION)) && (extData->widget) && wc == vendorShellWidgetClass) #else /* * CR 3353 - Avoid calling the RealizeCallback twice for DialogShells * by checking the WidgetClass name. If it is XmDialogShell, * do not call the callback (it will be called prior when * the WidgetClass is VendorShell). */ if ((extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION)) && (extData->widget) && strcmp(wc->core_class.class_name, "XmDialogShell")) #endif { _XmCallCallbackList(extData->widget, ((XmVendorShellExtObject) (extData->widget))->vendor.realize_callback, NULL); } #ifdef DEBUG else XmeWarning(NULL, "we only support realize callbacks on shells"); #endif /* DEBUG */ } } /********************************************************************* * * ResizeWrappers for rectObj * *********************************************************************/ static void ResizeWrapper0( Widget w ) { ResizeWrapper(w, 0); } static void ResizeWrapper1( Widget w ) { ResizeWrapper(w, 1); } static void ResizeWrapper2( Widget w ) { ResizeWrapper(w, 2); } static void ResizeWrapper3( Widget w ) { ResizeWrapper(w, 3); } static void ResizeWrapper4( Widget w ) { ResizeWrapper(w, 4); } static void ResizeWrapper5( Widget w ) { ResizeWrapper(w, 5); } static void ResizeWrapper6( Widget w ) { ResizeWrapper(w, 6); } static void ResizeWrapper7( Widget w ) { ResizeWrapper(w, 7); } static void ResizeWrapper8( Widget w ) { ResizeWrapper(w, 8); } static void ResizeWrapper9( Widget w ) { ResizeWrapper(w, 9); } static void ResizeWrapper10( Widget w ) { ResizeWrapper(w, 10); } static void ResizeWrapper11( Widget w ) { ResizeWrapper(w, 11); } static void ResizeWrapper12( Widget w ) { ResizeWrapper(w, 12); } static void ResizeWrapper13( Widget w ) { ResizeWrapper(w, 13); } /* Used to be XmConst, but this was not linking on Solaris */ static XtWidgetProc resizeWrappers[] = { ResizeWrapper0, ResizeWrapper1, ResizeWrapper2, ResizeWrapper3, ResizeWrapper4, ResizeWrapper5, ResizeWrapper6, ResizeWrapper7, ResizeWrapper8, ResizeWrapper9, ResizeWrapper10, ResizeWrapper11, ResizeWrapper12, ResizeWrapper13 }; static Cardinal GetResizeDepth( WidgetClass wc ) { Cardinal i; i = 0; while (wc && wc != rectObjClass) { i++; wc = wc->core_class.superclass; } if (wc) return i; return 0; } /************************************************************************ * * ResizeWrapper * ************************************************************************/ static void ResizeWrapper( Widget w, int depth ) { Widget refW = NULL; WidgetClass wc = XtClass(w); Display *dpy = XtDisplay(w); XmWrapperData wrapperData; XtWidgetProc resize; Cardinal leafDepth = GetResizeDepth(wc); Cardinal depthDiff = leafDepth - depth; Boolean call_navig_resize = FALSE; /* Call _XmNavigResize() only once per resize event, so nested * resize calls are completed before evaluating the status of * the focus widget. Only check for lost focus in * response to resize events from a Shell; otherwise * _XmNavigResize may (prematurely) determine that the * focus widget is no longer traversable before the * new layout is complete. */ if (XtParent(w) && XtIsShell(XtParent(w))) call_navig_resize = TRUE; while (depthDiff) { depthDiff--; wc = wc->core_class.superclass; } GetRefW(dpy, resizeRefWContext, refW); _XmProcessLock(); wrapperData = GetWrapperData(wc); resize = wrapperData ? wrapperData->resize: NULL; _XmProcessUnlock(); if (resize) { if ((refW == NULL) && (_XmDropSiteWrapperCandidate(w))) { refW = w; SetRefW(dpy, resizeRefWContext, refW); XmDropSiteStartUpdate(refW); (*resize)(w); XmDropSiteEndUpdate(refW); refW = NULL; SetRefW(dpy, resizeRefWContext, refW); } else (*resize)(w); } if (call_navig_resize) _XmNavigResize( w); } /********************************************************************* * * GeometryHandlerWrappers for composite * *********************************************************************/ static XtGeometryResult GeometryHandlerWrapper0( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 0); } static XtGeometryResult GeometryHandlerWrapper1( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 1); } static XtGeometryResult GeometryHandlerWrapper2( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 2); } static XtGeometryResult GeometryHandlerWrapper3( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 3); } static XtGeometryResult GeometryHandlerWrapper4( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 4); } static XtGeometryResult GeometryHandlerWrapper5( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 5); } static XtGeometryResult GeometryHandlerWrapper6( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 6); } static XtGeometryResult GeometryHandlerWrapper7( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 7); } static XtGeometryResult GeometryHandlerWrapper8( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 8); } static XtGeometryResult GeometryHandlerWrapper9( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 9); } static XtGeometryResult GeometryHandlerWrapper10( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 10); } static XtGeometryResult GeometryHandlerWrapper11( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 11); } static XtGeometryResult GeometryHandlerWrapper12( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { return GeometryHandlerWrapper(w, desired, allowed, 12); } /* Used to be XmConst, but this was not linkking on Solaris */ static XtGeometryHandler geometryHandlerWrappers[] = { GeometryHandlerWrapper0, GeometryHandlerWrapper1, GeometryHandlerWrapper2, GeometryHandlerWrapper3, GeometryHandlerWrapper4, GeometryHandlerWrapper5, GeometryHandlerWrapper6, GeometryHandlerWrapper7, GeometryHandlerWrapper8, GeometryHandlerWrapper9, GeometryHandlerWrapper10, GeometryHandlerWrapper11, GeometryHandlerWrapper12 }; static Cardinal GetGeometryHandlerDepth( WidgetClass wc ) { Cardinal i; i = 0; while (wc && wc != rectObjClass) { i++; wc = wc->core_class.superclass; } if (wc) return i; return 0; } /************************************************************************ * * GeometryHandlerWrapper * ************************************************************************/ static XtGeometryResult GeometryHandlerWrapper( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed, int depth) { Widget refW = NULL; XtGeometryResult result = XtGeometryNo; Widget parent = XtParent(w); WidgetClass wc = XtClass(parent); Display *dpy = XtDisplay(w); XmWrapperData wrapperData; XtGeometryHandler geometry_manager; Cardinal leafDepth = GetGeometryHandlerDepth(wc); Cardinal depthDiff = leafDepth - depth; while (depthDiff) { depthDiff--; wc = wc->core_class.superclass; } GetRefW(dpy, geoRefWContext, refW); _XmProcessLock(); wrapperData = GetWrapperData(wc); geometry_manager = wrapperData ? wrapperData->geometry_manager: NULL; _XmProcessUnlock(); if (geometry_manager) { if ((refW == NULL) && (_XmDropSiteWrapperCandidate(w))) { refW = w; SetRefW(dpy, geoRefWContext, refW); XmDropSiteStartUpdate(refW); result = (*geometry_manager) (w, desired, allowed); XmDropSiteEndUpdate(refW); refW = NULL; SetRefW(dpy, geoRefWContext, refW); } else result = (*geometry_manager) (w, desired, allowed); } return result; } /************************************************************************ * * BaseClassPartInitialize * ************************************************************************/ static XmBaseClassExt * BaseClassPartInitialize( WidgetClass wc ) { XmBaseClassExt *wcePtr, *scePtr; Cardinal i; Boolean inited; XmWrapperData wcData, scData; Boolean isBaseClass = IsBaseClass(wc); /* * This routine is called out of the ClassPartInitRootWrapper. It * needs to make sure that this is a Motif class and if it is, * then to initialize it. We assume that the base classes always * have a static initializer !!! */ wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); scePtr = _XmGetBaseClassExtPtr(wc->core_class.superclass, XmQmotif); if (!isBaseClass && !isWrappedXtClass(wc) && (!scePtr || !(*scePtr))) return NULL; if ((isBaseClass) || (scePtr && (*scePtr))) { if (!(*wcePtr)) { inited = False; *wcePtr = (XmBaseClassExt) XtCalloc(1, sizeof(XmBaseClassExtRec)); (*wcePtr)->classPartInitPrehook = XmInheritClassPartInitPrehook; (*wcePtr)->classPartInitPosthook = XmInheritClassPartInitPosthook; (*wcePtr)->initializePrehook = XmInheritInitializePrehook; (*wcePtr)->setValuesPrehook = XmInheritSetValuesPrehook; (*wcePtr)->getValuesPrehook = XmInheritGetValuesPrehook; (*wcePtr)->initializePosthook = XmInheritInitializePosthook; (*wcePtr)->setValuesPosthook = XmInheritSetValuesPosthook; (*wcePtr)->getValuesPosthook = XmInheritGetValuesPosthook; (*wcePtr)->secondaryObjectClass = XmInheritClass; (*wcePtr)->secondaryObjectCreate = XmInheritSecObjectCreate; (*wcePtr)->getSecResData = XmInheritGetSecResData; (*wcePtr)->widgetNavigable = XmInheritWidgetNavigable; (*wcePtr)->focusChange = XmInheritFocusChange; } else inited = True; /* this should get done by the static initializers */ for (i = 0; i < 32; i++) (*wcePtr)->flags[i] = 0; if (scePtr && *scePtr) { if (!inited) { (*wcePtr)->next_extension = NULL; (*wcePtr)->record_type = (*scePtr)->record_type; (*wcePtr)->version = (*scePtr)->version; (*wcePtr)->record_size = (*scePtr)->record_size; } if ((*wcePtr)->classPartInitPrehook == XmInheritClassPartInitPrehook) (*wcePtr)->classPartInitPrehook = (*scePtr)->classPartInitPrehook; if ((*wcePtr)->classPartInitPosthook == XmInheritClassPartInitPosthook) (*wcePtr)->classPartInitPosthook = (*scePtr)->classPartInitPosthook; if ((*wcePtr)->initializePrehook == XmInheritInitializePrehook) (*wcePtr)->initializePrehook = (*scePtr)->initializePrehook; if ((*wcePtr)->setValuesPrehook == XmInheritSetValuesPrehook) (*wcePtr)->setValuesPrehook = (*scePtr)->setValuesPrehook; if ((*wcePtr)->getValuesPrehook == XmInheritGetValuesPrehook) (*wcePtr)->getValuesPrehook = (*scePtr)->getValuesPrehook; if ((*wcePtr)->initializePosthook == XmInheritInitializePosthook) (*wcePtr)->initializePosthook = (*scePtr)->initializePosthook; if ((*wcePtr)->setValuesPosthook == XmInheritSetValuesPosthook) (*wcePtr)->setValuesPosthook = (*scePtr)->setValuesPosthook; if ((*wcePtr)->getValuesPosthook == XmInheritGetValuesPosthook) (*wcePtr)->getValuesPosthook = (*scePtr)->getValuesPosthook; if ((*wcePtr)->secondaryObjectClass == XmInheritClass) (*wcePtr)->secondaryObjectClass = (*scePtr)->secondaryObjectClass; if ((*wcePtr)->secondaryObjectCreate == XmInheritSecObjectCreate) (*wcePtr)->secondaryObjectCreate = (*scePtr)->secondaryObjectCreate; if ((*wcePtr)->getSecResData == XmInheritGetSecResData) (*wcePtr)->getSecResData = (*scePtr)->getSecResData; if ((*wcePtr)->widgetNavigable == XmInheritWidgetNavigable) (*wcePtr)->widgetNavigable = (*scePtr)->widgetNavigable; if ((*wcePtr)->focusChange == XmInheritFocusChange) (*wcePtr)->focusChange = (*scePtr)->focusChange; } #ifdef DEBUG else if (!IsBaseClass(wc)) XtError("class must have non-null superclass extension"); #endif /* DEBUG */ /* * If this class has a secondary object class and that * class does not have it's own extension (or has not * been class inited because its a pseudo class) then * we will give a dummy pointer so that fast subclass * checking will not fail for the meta classes * (gadget, manager, etc...) */ { WidgetClass sec = (*wcePtr)->secondaryObjectClass; static XmBaseClassExtRec xmExtExtensionRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ }; if (xmExtExtensionRec.record_type == NULLQUARK) xmExtExtensionRec.record_type = XmQmotif; if (sec && !sec->core_class.extension) sec->core_class.extension = (XtPointer)&xmExtExtensionRec; } } wcData = GetWrapperData(wc); scData = GetWrapperData(wc->core_class.superclass); if ((wc == vendorShellWidgetClass) || _XmIsSubclassOf(wc, vendorShellWidgetClass)) { /* Wrap Realize */ /* * check if this widget was using XtInherit and got the wrapper * from the superclass */ if (wc->core_class.realize == XtInheritRealize) { wcData->realize = scData->realize; } /* * It has declared it's own realize routine so save it */ else { wcData->realize = wc->core_class.realize; } wc->core_class.realize = realizeWrappers[GetRealizeDepth(wc)]; } if ((wc == rectObjClass) || _XmIsSubclassOf(wc, rectObjClass)) { /* Wrap resize */ /* * check if this widget was using XtInherit and got the wrapper * from the superclass */ if (wc->core_class.resize == XtInheritResize) { wcData->resize = scData->resize; } /* * It has declared it's own resize routine so save it */ else { wcData->resize = wc->core_class.resize; } wc->core_class.resize = resizeWrappers[GetResizeDepth(wc)]; } if ((wc == compositeWidgetClass) || _XmIsSubclassOf(wc, compositeWidgetClass)) { /* Wrap GeometryManager */ /* * check if this widget was using XtInherit and got the wrapper * from the superclass */ if (((CompositeWidgetClass) wc)->composite_class.geometry_manager == XtInheritGeometryManager) { wcData->geometry_manager = scData->geometry_manager; } /* * It has declared it's own resize routine so save it */ else { wcData->geometry_manager = ((CompositeWidgetClass) wc) ->composite_class.geometry_manager; } ((CompositeWidgetClass) wc)->composite_class.geometry_manager = (XtGeometryHandler) geometryHandlerWrappers[GetGeometryHandlerDepth(wc)]; } return wcePtr; } /* * This function replaces the objectClass classPartInit slot and is * called at the start of the first XtCreate invocation. */ static void ClassPartInitRootWrapper( WidgetClass wc ) { XtWidgetClassProc *leafFuncPtr; XmBaseClassExt *wcePtr; wcePtr = BaseClassPartInitialize(wc); /* * check that it's a class that we know about */ if (wcePtr && *wcePtr) { if ((*wcePtr)->classPartInitPrehook) (*((*wcePtr)->classPartInitPrehook)) (wc); /* * If we have a prehook, then envelop the leaf class function * that whould be called last. */ if ((*wcePtr)->classPartInitPosthook) { XmWrapperData wrapperData; wrapperData = GetWrapperData(wc); leafFuncPtr = (XtWidgetClassProc *) &(wc->core_class.class_part_initialize); wrapperData->classPartInitLeaf = *leafFuncPtr; *leafFuncPtr = ClassPartInitLeafWrapper; } } if (objectClassWrapper.classPartInit) (* objectClassWrapper.classPartInit) (wc); } static void ClassPartInitLeafWrapper( WidgetClass wc ) { XtWidgetClassProc *leafFuncPtr; XmBaseClassExt *wcePtr; wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if (*wcePtr && (*wcePtr)->classPartInitPosthook) { XmWrapperData wrapperData; wrapperData = GetWrapperData(wc); leafFuncPtr = (XtWidgetClassProc *) &(wc->core_class.class_part_initialize); if (wrapperData->classPartInitLeaf) (* wrapperData->classPartInitLeaf) (wc); if ((*wcePtr)->classPartInitPosthook) (*((*wcePtr)->classPartInitPosthook)) (wc); #ifdef DEBUG else XmeWarning(NULL, "there should be a non-null hook for a leaf wrapper"); #endif /* DEBUG */ *leafFuncPtr = wrapperData->classPartInitLeaf; wrapperData->classPartInitLeaf = NULL; } } static Boolean is_constraint_subclass(WidgetClass cls) { WidgetClass sc; for (sc = cls; sc != NULL; sc = sc->core_class.superclass) if (sc == (WidgetClass) &constraintClassRec) return True; return False; } void _XmInitializeExtensions( void ) { static Boolean firstTime = True; if (firstTime) { XmQmotif = XrmPermStringToQuark("OSF_MOTIF"); objectClassWrapper.initialize = objectClass->core_class.initialize; objectClassWrapper.setValues = objectClass->core_class.set_values; objectClassWrapper.getValues = objectClass->core_class.get_values_hook; objectClassWrapper.classPartInit = objectClass->core_class.class_part_initialize; objectClass->core_class.class_part_initialize = ClassPartInitRootWrapper; objectClass->core_class.initialize = InitializeRootWrapper; objectClass->core_class.set_values = SetValuesRootWrapper; objectClass->core_class.get_values_hook = GetValuesRootWrapper; firstTime = False; } resizeRefWContext = XUniqueContext(); geoRefWContext = XUniqueContext(); } Cardinal _XmSecondaryResourceData( XmBaseClassExt bcePtr, XmSecondaryResourceData **secResDataRtn, XtPointer client_data, String name, String class_name, XmResourceBaseProc basefunctionpointer ) { WidgetClass secObjClass; XmSecondaryResourceData secResData, *sd; Cardinal count = 0; if (bcePtr) { secObjClass = ( (bcePtr)->secondaryObjectClass); if (secObjClass) { secResData = XtNew(XmSecondaryResourceDataRec); _XmTransformSubResources(secObjClass->core_class.resources, secObjClass->core_class.num_resources, &(secResData->resources), &(secResData->num_resources)); secResData->name = name; secResData->res_class = class_name; secResData->client_data = client_data; secResData->base_proc = basefunctionpointer; sd = XtNew(XmSecondaryResourceData); *sd = secResData; *secResDataRtn = sd; count++; } } return count; } /* * This function makes assumptions about what the Intrinsics is * doing with the resource lists. It is based on the X11R5 version * of the Intrinsics. It is used as a work around for a bug in * the Intrinsics that deals with recompiling already compiled resource * lists. When that bug is fixed, this function should be removed. */ static XtResourceList* CreateIndirectionTable(XtResourceList resources, Cardinal num_resources) { register int i; XtResourceList* table; table = (XtResourceList*)XtMalloc(num_resources * sizeof(XtResourceList)); for (i = 0; i < num_resources; i++) table[i] = (XtResourceList)(&(resources[i])); return table; } /* * The statement in this function calls CreateIndirectionTable() which * is scheduled for removal (see comment in function above). * It is used as a work around for an X11R5 Intrinsics bug. When the * bug is fixed, change to the assignement statement so the * constraint_class.reources is assigned comp_resources. Next, * change the class_inited field of the core_class record to False. * Then remove the check for class_inited, in the conditional statement * which calls XtInitializeWidgetClass() and move the call to * XtInitializeWidgetClass() to just above the call to * XtGetConstraintResourceList(). Then remove the call to * XtFree() and the last two assignment statements. */ void _XmTransformSubResources( XtResourceList comp_resources, Cardinal num_comp_resources, XtResourceList *resources, Cardinal *num_resources) { static ConstraintClassRec shadowObjectClassRec = { { /* superclass */ (WidgetClass) &constraintClassRec, /* class_name */ "Shadow", /* widget_size */ sizeof(ConstraintRec), /* class_initialize */ NULL, /* class_part_initialize*/ NULL, /* class_inited */ FALSE, /* initialize */ NULL, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ NULL, /* num_resources */ 0, /* xrm_class */ NULLQUARK, /* compress_motion */ FALSE, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ NULL }, { /**** CompositePart *****/ /* geometry_handler */ NULL, /* change_managed */ NULL, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL }, { /**** ConstraintPart ****/ /* resources */ NULL, /* num_resources */ 0, /* constraint_size */ 0, /* initialize */ NULL, /* destroy */ NULL, /* set_values */ NULL, /* extension */ NULL } }; if (((int)comp_resources[0].resource_offset) >= 0) { XtResourceList tmp_resources; tmp_resources = (XtResourceList) XtMalloc(sizeof(XtResource) * num_comp_resources); memcpy(tmp_resources, comp_resources, sizeof(XtResource) * num_comp_resources); *resources = tmp_resources; *num_resources = num_comp_resources; } else { if (!shadowObjectClassRec.core_class.class_inited) XtInitializeWidgetClass((WidgetClass) &shadowObjectClassRec); /* This next statement is marked for change */ shadowObjectClassRec.constraint_class.resources = (XtResourceList) CreateIndirectionTable(comp_resources, num_comp_resources); shadowObjectClassRec.constraint_class.num_resources = num_comp_resources; XtGetConstraintResourceList((WidgetClass) &shadowObjectClassRec, resources, num_resources); if (shadowObjectClassRec.constraint_class.resources) XtFree((char *) shadowObjectClassRec.constraint_class.resources); shadowObjectClassRec.constraint_class.resources = NULL; shadowObjectClassRec.constraint_class.num_resources = 0; } } static XtInitProc InitializeLeafWrappers[] = { InitializeLeafWrapper0, InitializeLeafWrapper1, InitializeLeafWrapper2, InitializeLeafWrapper3, InitializeLeafWrapper4, InitializeLeafWrapper5, InitializeLeafWrapper6, InitializeLeafWrapper7, InitializeLeafWrapper8, InitializeLeafWrapper9 }; static XtInitProc CInitializeLeafWrappers[] = { CInitializeLeafWrapper0, CInitializeLeafWrapper1, CInitializeLeafWrapper2, CInitializeLeafWrapper3, CInitializeLeafWrapper4, CInitializeLeafWrapper5, CInitializeLeafWrapper6, CInitializeLeafWrapper7, CInitializeLeafWrapper8, CInitializeLeafWrapper9 }; /* * This function replaces the objectClass initialize slot and is * called at the start of every XtCreate invocation. */ static void InitializeRootWrapper( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { WidgetClass wc = XtClass(new_w); XmBaseClassExt *wcePtr; wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if (wcePtr && *wcePtr) { if ((*wcePtr)->initializePrehook) (*((*wcePtr)->initializePrehook))(req, new_w, args, num_args); if ((*wcePtr)->initializePosthook) { XmWrapperData wrapperData; _XmProcessLock(); if (!XtIsShell(new_w) && XtParent(new_w) && XtIsConstraint(XtParent(new_w))) { ConstraintWidgetClass cwc; cwc = (ConstraintWidgetClass) XtClass(XtParent(new_w)); wrapperData = GetWrapperData((WidgetClass) cwc); if (wrapperData->constraintInitializeLeafCount ==0) { wrapperData->constraintInitializeLeaf = cwc->constraint_class.initialize; cwc->constraint_class.initialize = CInitializeLeafWrappers[ GetDepth((WidgetClass) cwc)]; } (wrapperData->constraintInitializeLeafCount)++; } else { wrapperData = GetWrapperData(wc); if (wrapperData->initializeLeafCount ==0) { wrapperData->initializeLeaf = wc->core_class.initialize; wc->core_class.initialize = InitializeLeafWrappers[ GetDepth(wc)]; } (wrapperData->initializeLeafCount)++; } _XmProcessUnlock(); } if (objectClassWrapper.initialize) (*objectClassWrapper.initialize)(req, new_w,args, num_args); } } static void InitializeLeafWrapper( Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth) { WidgetClass wc = XtClass(new_w); XtInitProc init_proc = NULL; XtInitProc post_proc = NULL; int leafDepth = GetDepth(wc); XmWrapperData wrapperData; _XmProcessLock(); if (leafDepth == depth) { /* Correct depth */ wrapperData = GetWrapperData(wc); if (!XtIsShell(new_w) && XtParent(new_w) && XtIsConstraint(XtParent(new_w))) { init_proc = wrapperData->initializeLeaf; } else { /* We're home ! */ XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); init_proc = wrapperData->initializeLeaf; post_proc = (*wcePtr)->initializePosthook; #ifdef FIX_1392 if (post_proc) { #endif if ((--(wrapperData->initializeLeafCount)) == 0) wc->core_class.initialize = wrapperData->initializeLeaf; #ifdef FIX_1392 } #endif } } else { int depthDiff = leafDepth - depth; for ( ; depthDiff; depthDiff--, wc = wc->core_class.superclass) {}; wrapperData = GetWrapperData(wc); init_proc = wrapperData->initializeLeaf; } _XmProcessUnlock(); if (init_proc) (*init_proc)(req, new_w, args, num_args); if (post_proc) (*post_proc)(req, new_w, args, num_args); } static void CInitializeLeafWrapper( Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth) { WidgetClass wc = XtClass(new_w); ConstraintWidgetClass cwc = (ConstraintWidgetClass) XtClass(XtParent(new_w)); XtInitProc init_proc = NULL; XtInitProc post_proc = NULL; int leafDepth = GetDepth((WidgetClass) cwc); XmWrapperData wrapperData; _XmProcessLock(); if (leafDepth == depth) { XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); wrapperData = GetWrapperData((WidgetClass) cwc); init_proc = wrapperData->constraintInitializeLeaf; post_proc = (*wcePtr)->initializePosthook; #ifdef FIX_1392 if (post_proc) { #endif if ((--(wrapperData->constraintInitializeLeafCount)) ==0) cwc->constraint_class.initialize = wrapperData->constraintInitializeLeaf; #ifdef FIX_1392 } #endif } else { int depthDiff = leafDepth - depth; for ( ; depthDiff; depthDiff--, cwc = (ConstraintWidgetClass) cwc->core_class.superclass) {}; wrapperData = GetWrapperData((WidgetClass) cwc); init_proc = wrapperData->constraintInitializeLeaf; } _XmProcessUnlock(); if (init_proc) (*init_proc)(req, new_w, args, num_args); if (post_proc) (*post_proc)(req, new_w, args, num_args); } static void InitializeLeafWrapper0( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 0); } static void InitializeLeafWrapper1( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 1); } static void InitializeLeafWrapper2( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 2); } static void InitializeLeafWrapper3( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 3); } static void InitializeLeafWrapper4( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 4); } static void InitializeLeafWrapper5( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 5); } static void InitializeLeafWrapper6( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 6); } static void InitializeLeafWrapper7( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 7); } static void InitializeLeafWrapper8( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 8); } static void InitializeLeafWrapper9( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { InitializeLeafWrapper(req, new_w, args, num_args, 9); } static void CInitializeLeafWrapper0( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,0); } static void CInitializeLeafWrapper1( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,1); } static void CInitializeLeafWrapper2( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,2); } static void CInitializeLeafWrapper3( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,3); } static void CInitializeLeafWrapper4( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,4); } static void CInitializeLeafWrapper5( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,5); } static void CInitializeLeafWrapper6( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,6); } static void CInitializeLeafWrapper7( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,7); } static void CInitializeLeafWrapper8( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,8); } static void CInitializeLeafWrapper9( Widget req, Widget new_w, ArgList args, Cardinal *num_args) { CInitializeLeafWrapper(req, new_w, args, num_args,9); } static XtSetValuesFunc SetValuesLeafWrappers[] = { SetValuesLeafWrapper0, SetValuesLeafWrapper1, SetValuesLeafWrapper2, SetValuesLeafWrapper3, SetValuesLeafWrapper4, SetValuesLeafWrapper5, SetValuesLeafWrapper6, SetValuesLeafWrapper7, SetValuesLeafWrapper8, SetValuesLeafWrapper9 }; static XtSetValuesFunc CSetValuesLeafWrappers[] = { CSetValuesLeafWrapper0, CSetValuesLeafWrapper1, CSetValuesLeafWrapper2, CSetValuesLeafWrapper3, CSetValuesLeafWrapper4, CSetValuesLeafWrapper5, CSetValuesLeafWrapper6, CSetValuesLeafWrapper7, CSetValuesLeafWrapper8, CSetValuesLeafWrapper9 }; /* * This function replaces the objectClass set_values slot and is * called at the start of every XtSetValues invocation. */ static Boolean SetValuesRootWrapper( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { WidgetClass wc = XtClass(new_w); XmBaseClassExt *wcePtr; Boolean returnVal = False; wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if (wcePtr && *wcePtr) { if ((*wcePtr)->setValuesPrehook) returnVal |= (*((*wcePtr)->setValuesPrehook)) (current, req, new_w, args, num_args); if ((*wcePtr)->setValuesPosthook) { XmWrapperData wrapperData; _XmProcessLock(); if (!XtIsShell(new_w) && XtParent(new_w) && XtIsConstraint(XtParent(new_w))) { ConstraintWidgetClass cwc; cwc = (ConstraintWidgetClass) XtClass(XtParent(new_w)); wrapperData = GetWrapperData((WidgetClass) cwc); if (wrapperData->constraintSetValuesLeafCount ==0) { wrapperData->constraintSetValuesLeaf = cwc->constraint_class.set_values; cwc->constraint_class.set_values = CSetValuesLeafWrappers[ GetDepth((WidgetClass) cwc)]; } (wrapperData->constraintSetValuesLeafCount)++; } else { wrapperData = GetWrapperData(wc); if (wrapperData->setValuesLeafCount ==0) { wrapperData->setValuesLeaf = wc->core_class.set_values; wc->core_class.set_values = SetValuesLeafWrappers[ GetDepth(wc)]; } (wrapperData->setValuesLeafCount)++; } _XmProcessUnlock(); } } if (objectClassWrapper.setValues) returnVal |= (*objectClassWrapper.setValues) (current, req, new_w, args, num_args); return returnVal; } static Boolean SetValuesLeafWrapper( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth) { WidgetClass wc = XtClass(new_w); XtSetValuesFunc setvalues_proc = NULL; XtSetValuesFunc post_proc = NULL; Boolean returnVal = False; int leafDepth = GetDepth(wc); XmWrapperData wrapperData; _XmProcessLock(); if (leafDepth == depth) { /* Correct depth */ wrapperData = GetWrapperData(wc); if (!XtIsShell(new_w) && XtParent(new_w) && XtIsConstraint(XtParent(new_w))) { setvalues_proc = wrapperData->setValuesLeaf; } else { /* We're home ! */ XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); setvalues_proc = wrapperData->setValuesLeaf; post_proc = (*wcePtr)->setValuesPosthook; #ifdef FIX_1392 if (post_proc) { #endif if ((--(wrapperData->setValuesLeafCount)) ==0) wc->core_class.set_values = wrapperData->setValuesLeaf; #ifdef FIX_1392 } #endif } } else { int depthDiff = leafDepth - depth; for ( ; depthDiff; depthDiff--, wc = wc->core_class.superclass) {}; wrapperData = GetWrapperData(wc); setvalues_proc = wrapperData->setValuesLeaf; } _XmProcessUnlock(); if (setvalues_proc) returnVal |= (*setvalues_proc) (current, req, new_w, args, num_args); if (post_proc) returnVal |= (*post_proc) (current, req, new_w, args, num_args); return returnVal; } static Boolean CSetValuesLeafWrapper( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args, int depth) { WidgetClass wc = XtClass(new_w); ConstraintWidgetClass cwc = (ConstraintWidgetClass) XtClass(XtParent(new_w)); XtSetValuesFunc setvalues_proc = NULL; XtSetValuesFunc post_proc = NULL; Boolean returnVal = False; int leafDepth = GetDepth((WidgetClass) cwc); XmWrapperData wrapperData; _XmProcessLock(); if (leafDepth == depth) { XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); wrapperData = GetWrapperData((WidgetClass) cwc); setvalues_proc = wrapperData->constraintSetValuesLeaf; post_proc = (*wcePtr)->setValuesPosthook; #ifdef FIX_1392 if (post_proc) { #endif if ((--(wrapperData->constraintSetValuesLeafCount)) ==0) cwc->constraint_class.set_values = wrapperData->constraintSetValuesLeaf; #ifdef FIX_1392 } #endif } else { int depthDiff = leafDepth - depth; for ( ; depthDiff; depthDiff--, cwc = (ConstraintWidgetClass) cwc->core_class.superclass) {}; wrapperData = GetWrapperData((WidgetClass) cwc); setvalues_proc = wrapperData->constraintSetValuesLeaf; } _XmProcessUnlock(); if (setvalues_proc) returnVal |= (*setvalues_proc) (current, req, new_w, args, num_args); if (post_proc) returnVal |= (*post_proc) (current, req, new_w, args, num_args); return returnVal; } static Boolean SetValuesLeafWrapper0( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 0); } static Boolean SetValuesLeafWrapper1( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 1); } static Boolean SetValuesLeafWrapper2( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 2); } static Boolean SetValuesLeafWrapper3( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 3); } static Boolean SetValuesLeafWrapper4( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 4); } static Boolean SetValuesLeafWrapper5( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 5); } static Boolean SetValuesLeafWrapper6( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 6); } static Boolean SetValuesLeafWrapper7( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 7); } static Boolean SetValuesLeafWrapper8( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 8); } static Boolean SetValuesLeafWrapper9( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return SetValuesLeafWrapper(current, req, new_w, args, num_args, 9); } static Boolean CSetValuesLeafWrapper0( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 0); } static Boolean CSetValuesLeafWrapper1( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 1); } static Boolean CSetValuesLeafWrapper2( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 2); } static Boolean CSetValuesLeafWrapper3( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 3); } static Boolean CSetValuesLeafWrapper4( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 4); } static Boolean CSetValuesLeafWrapper5( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 5); } static Boolean CSetValuesLeafWrapper6( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 6); } static Boolean CSetValuesLeafWrapper7( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 7); } static Boolean CSetValuesLeafWrapper8( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 8); } static Boolean CSetValuesLeafWrapper9( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { return CSetValuesLeafWrapper(current, req, new_w, args, num_args, 9); } static XtArgsProc GetValuesLeafWrappers[] = { GetValuesLeafWrapper0, GetValuesLeafWrapper1, GetValuesLeafWrapper2, GetValuesLeafWrapper3, GetValuesLeafWrapper4, GetValuesLeafWrapper5, GetValuesLeafWrapper6, GetValuesLeafWrapper7, GetValuesLeafWrapper8, GetValuesLeafWrapper9 }; /* * This function replaces the objectClass get_values slot and is * called at the start of every XtGetValues invocation. */ static void GetValuesRootWrapper( Widget new_w, ArgList args, Cardinal *num_args) { WidgetClass wc = XtClass(new_w); XmBaseClassExt *wcePtr; wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if (wcePtr && *wcePtr) { if ((*wcePtr)->getValuesPrehook) (*((*wcePtr)->getValuesPrehook))(new_w, args, num_args); if ((*wcePtr)->getValuesPosthook) { XmWrapperData wrapperData; _XmProcessLock(); wrapperData = GetWrapperData(wc); if (wrapperData->getValuesLeafCount == 0) { wrapperData->getValuesLeaf = wc->core_class.get_values_hook; wc->core_class.get_values_hook = GetValuesLeafWrappers[GetDepth(wc)]; } (wrapperData->getValuesLeafCount)++; _XmProcessUnlock(); } } if (objectClassWrapper.getValues) (*objectClassWrapper.getValues) (new_w, args, num_args); } static void GetValuesLeafWrapper( Widget new_w, ArgList args, Cardinal *num_args, int depth) { WidgetClass wc = XtClass(new_w); XtArgsProc getvalues_proc = NULL; XtArgsProc post_proc = NULL; int leafDepth = GetDepth(wc); XmWrapperData wrapperData; _XmProcessLock(); if (leafDepth == depth) { /* Correct depth */ XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); wrapperData = GetWrapperData(wc); getvalues_proc = wrapperData->getValuesLeaf; post_proc = ((*wcePtr)->getValuesPosthook); #ifdef FIX_1392 if (post_proc) { #endif if ((--(wrapperData->getValuesLeafCount)) == 0) wc->core_class.get_values_hook = wrapperData->getValuesLeaf; #ifdef FIX_1392 } #endif } else { int depthDiff = leafDepth - depth; for ( ; depthDiff; depthDiff--, wc = wc->core_class.superclass) {}; wrapperData = GetWrapperData(wc); getvalues_proc = wrapperData->getValuesLeaf; } _XmProcessUnlock(); if (getvalues_proc) (*getvalues_proc)(new_w, args, num_args); if (post_proc) (*post_proc)(new_w, args, num_args); } static void GetValuesLeafWrapper0( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 0); } static void GetValuesLeafWrapper1( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 1); } static void GetValuesLeafWrapper2( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 2); } static void GetValuesLeafWrapper3( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 3); } static void GetValuesLeafWrapper4( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 4); } static void GetValuesLeafWrapper5( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 5); } static void GetValuesLeafWrapper6( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 6); } static void GetValuesLeafWrapper7( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 7); } static void GetValuesLeafWrapper8( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 8); } static void GetValuesLeafWrapper9( Widget new_w, ArgList args,Cardinal *num_args) { GetValuesLeafWrapper(new_w, args, num_args, 9); } static int GetDepth(WidgetClass wc) { int i; for (i = 0; wc && wc != rectObjClass; i++, wc = wc->core_class.superclass) {}; if (wc) return i; else return 0; } /* * These symbols must always be present so applications compiling with * -DXTHREADS can still link against libraries built without it. How * those applications recognize non MT-safe libraries is a different * issue. */ #ifndef XTHREADS # undef _XmFastSubclassInit # undef _XmIsFastSubclass #endif void _XmFastSubclassInit(WidgetClass wc, unsigned int bit) { XmBaseClassExt *basePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if (basePtr && (*basePtr)) _XmSetFlagsBit(((*basePtr)->flags), bit); } Boolean _XmIsFastSubclass(WidgetClass wc, unsigned int bit) { XmBaseClassExt *basePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if (!basePtr || !(*basePtr)) return False; if (_XmGetFlagsBit(((*basePtr)->flags), bit)) return True; else return False; } motif-2.3.8/lib/Xm/SeparatoGP.h0000644000175000017500000001177113145162623013105 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmSeparatorGadgetP_h #define _XmSeparatorGadgetP_h #include #include #include #ifdef __cplusplus extern "C" { #endif /*****************************************************************/ /* The Separator Gadget Cache Object's class and instance records*/ /*****************************************************************/ typedef struct _XmSeparatorGCacheObjClassPart { int foo; } XmSeparatorGCacheObjClassPart; /* separator cache class record */ typedef struct _XmSeparatorGCacheObjClassRec { ObjectClassPart object_class; XmExtClassPart ext_class; XmSeparatorGCacheObjClassPart separator_class_cache; } XmSeparatorGCacheObjClassRec; externalref XmSeparatorGCacheObjClassRec xmSeparatorGCacheObjClassRec; /* The Separator Gadget Cache instance record */ typedef struct _XmSeparatorGCacheObjPart { Dimension margin; unsigned char orientation; unsigned char separator_type; GC separator_GC; GC background_GC; GC top_shadow_GC; GC bottom_shadow_GC; Pixel foreground; Pixel background; Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; } XmSeparatorGCacheObjPart; typedef struct _XmSeparatorGCacheObjRec { ObjectPart object; XmExtPart ext; XmSeparatorGCacheObjPart separator_cache; } XmSeparatorGCacheObjRec; /*****************************************************/ /* The Separator Widget Class and instance records */ /*****************************************************/ typedef struct _XmSeparatorGadgetClassPart { XtPointer extension; } XmSeparatorGadgetClassPart; /* Full class record declaration for Separator class */ typedef struct _XmSeparatorGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmSeparatorGadgetClassPart separator_class; } XmSeparatorGadgetClassRec; externalref XmSeparatorGadgetClassRec xmSeparatorGadgetClassRec; typedef struct _XmSeparatorGadgetPart { XmSeparatorGCacheObjPart *cache; Boolean fill_bg_box; } XmSeparatorGadgetPart; /* Full instance record declaration */ typedef struct _XmSeparatorGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmSeparatorGadgetPart separator; } XmSeparatorGadgetRec; /* MACROS for accessing instance fields*/ #define SEPG_Margin(w) \ (((XmSeparatorGadget)(w))->separator.cache->margin) #define SEPG_Orientation(w) \ (((XmSeparatorGadget)(w))->separator.cache->orientation) #define SEPG_SeparatorType(w) \ (((XmSeparatorGadget)(w))->separator.cache->separator_type) #define SEPG_SeparatorGC(w) \ (((XmSeparatorGadget)(w))->separator.cache->separator_GC) #define SEPG_BackgroundGC(w) \ (((XmSeparatorGadget)(w))->separator.cache->background_GC) #define SEPG_TopShadowGC(w) \ (((XmSeparatorGadget)(w))->separator.cache->top_shadow_GC) #define SEPG_BottomShadowGC(w) \ (((XmSeparatorGadget)(w))->separator.cache->bottom_shadow_GC) #define SEPG_Foreground(w) \ (((XmSeparatorGadget)(w))->separator.cache->foreground) #define SEPG_Background(w) \ (((XmSeparatorGadget)(w))->separator.cache->background) #define SEPG_TopShadowColor(w) \ (((XmSeparatorGadget)(w))->separator.cache->top_shadow_color) #define SEPG_TopShadowPixmap(w) \ (((XmSeparatorGadget)(w))->separator.cache->top_shadow_pixmap) #define SEPG_BottomShadowColor(w) \ (((XmSeparatorGadget)(w))->separator.cache->bottom_shadow_color) #define SEPG_BottomShadowPixmap(w) \ (((XmSeparatorGadget)(w))->separator.cache->bottom_shadow_pixmap) /* Convenience Macros */ #define SEPG_Cache(w) \ (((XmSeparatorGadget)(w))->separator.cache) #define SEPG_ClassCachePart(w) \ (((XmSeparatorGadgetClass)xmSeparatorGadgetClass)->gadget_class.cache_part) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSeparatorGadgetP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Picture.h0000644000175000017500000000327012672140200012475 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmPicture_h #define _XmPicture_h #include #include #include #include typedef struct _XmPictureRec* XmPicture; typedef struct _XmPictureStateRec* XmPictureState; #ifdef __cplusplus extern "C" { #endif XmPicture XmParsePicture (char*); XmPictureState XmGetNewPictureState (XmPicture); char* XmPictureProcessCharacter(XmPictureState, char, Boolean*); void XmPictureDelete (XmPicture); void XmPictureDeleteState (XmPictureState); char* XmPictureGetCurrentString(XmPictureState); char* XmPictureDoAutoFill (XmPictureState); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DialogSP.h0000644000175000017500000000527113145162623012540 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDialogShellP_h #define _XmDialogShellP_h #include #include #include #ifdef __cplusplus extern "C" { #endif /* The DialogShell instance record */ typedef struct { /* internal fields */ XtGrabKind grab_kind; Position old_x, old_y; } XmDialogShellPart; /* Full instance record declaration */ typedef struct _XmDialogShellRec { CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; VendorShellPart vendor; TransientShellPart transient; XmDialogShellPart dialog; } XmDialogShellRec; typedef struct _XmDialogShellWidgetRec /* OBSOLETE (for compatibility only).*/ { CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; VendorShellPart vendor; TransientShellPart transient; XmDialogShellPart dialog; } XmDialogShellWidgetRec; /* DialogShell class structure */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmDialogShellClassPart; /* Full class record declaration */ typedef struct _XmDialogShellClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; WMShellClassPart wm_shell_class; VendorShellClassPart vendor_shell_class; TransientShellClassPart transient_shell_class; XmDialogShellClassPart dialog_shell_part; } XmDialogShellClassRec; externalref XmDialogShellClassRec xmDialogShellClassRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDialogShellP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/UniqueEvnt.c0000644000175000017500000001463413145162623013177 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UniqueEvnt.c /main/14 1996/11/25 11:33:58 pascale $" #endif #endif #include #include #include #include "UniqueEvnI.h" #define XmCHECK_UNIQUENESS 1 #define XmRECORD_EVENT 2 /* XmUniqueStamp structure is per display */ typedef struct _XmUniqueStampRec { unsigned long serial; Time time; int type; } XmUniqueStampRec, *XmUniqueStamp; /******** Static Function Declarations ********/ static Time ExtractTime( XEvent *event) ; static Boolean ManipulateEvent( XEvent *event, int action) ; static XmUniqueStamp GetUniqueStamp( XEvent *event ) ; static void UniqueStampDisplayDestroyCallback( Widget w, XtPointer client_data, XtPointer call_data ) ; /******** End Static Function Declarations ********/ /************************************************************************ * * _XwExtractTime * Extract the time field from the event structure. * ************************************************************************/ static Time ExtractTime( XEvent *event ) { if ((event->type == ButtonPress) || (event->type == ButtonRelease)) return (event->xbutton.time); if ((event->type == KeyPress) || (event->type == KeyRelease)) return (event->xkey.time); return ((Time) 0); } static Boolean Later(unsigned long recorded, unsigned long new_l) { long normalizedNew; /* The pathogenic cases for this calculation involve numbers very close to 0 or ULONG_MAX. So the way we do it is by normalizing to 0 (signed). That way the differences are +/- in the appropriate way. These numbers are defined as a unsigned long. Please remember that when changing this code. */ normalizedNew = new_l - recorded; return (normalizedNew > 0); } static XmUniqueStamp GetUniqueStamp( XEvent *event ) { XmDisplay xmDisplay = (XmDisplay)XmGetXmDisplay(event->xany.display); XmUniqueStamp uniqueStamp = (XmUniqueStamp)NULL; if ((XmDisplay)NULL != xmDisplay) { uniqueStamp = (XmUniqueStamp)((XmDisplayInfo *)(xmDisplay->display. displayInfo))->UniqueStamp; if ((XmUniqueStamp)NULL == uniqueStamp) { uniqueStamp = (XmUniqueStamp) XtMalloc(sizeof(XmUniqueStampRec)); ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->UniqueStamp = (XtPointer)uniqueStamp; XtAddCallback((Widget)xmDisplay, XtNdestroyCallback, UniqueStampDisplayDestroyCallback, (XtPointer) NULL); uniqueStamp->serial = 0; uniqueStamp->time = 0; uniqueStamp->type = 0; } } return uniqueStamp; } /*ARGSUSED*/ static void UniqueStampDisplayDestroyCallback ( Widget w, XtPointer client_data, /* unused */ XtPointer call_data ) /* unused */ { XmDisplay xmDisplay = (XmDisplay)XmGetXmDisplay(XtDisplay(w)); if ((XmDisplay)NULL != xmDisplay) { XmUniqueStamp uniqueStamp = (XmUniqueStamp)((XmDisplayInfo *) (xmDisplay->display.displayInfo))->UniqueStamp; if ((XmUniqueStamp)NULL != uniqueStamp) { XtFree((char*)uniqueStamp); /* no need to set xmDisplay's displayInfo->UniqueStamp to NULL cause * it's being destroyed. */ } } } static Boolean ManipulateEvent( XEvent *event, int action ) { XmUniqueStamp uniqueStamp = GetUniqueStamp(event); switch (action) { case XmCHECK_UNIQUENESS: { /* * Ignore duplicate events, caused by an event being dispatched * to both the focus widget and the spring-loaded widget, where * these map to the same widget (menus). * Also, ignore an event which has already been processed by * another menu component. * * Changed D.Rand 6/26/92 Discussion: * * This used to be done by making an exact comparison with * a recorded event. But there are many times when we can * get an event, but not the original event. This cuts * down on some distributed processing in the menu * system. * * So now we compare the serial number of the * examined event against the recorded event. This needs * to be done carefully to include the case where the * serial number wraps * * 7/23/92 added discussion: * * The other case we must be careful of is when the serial * number are the same. This can only realistically occur * if the user is very fast and therefore clicks while no * protocol request occurs. XSentEvent would cause an * increment, so we needn't worry over synthetic events * causing problems. * * So if the serial numbers match, we use the timestamps. */ if ( Later(uniqueStamp->serial, event->xany.serial) || ( uniqueStamp->serial == event->xany.serial && Later(uniqueStamp->time, event->xbutton.time))) return (TRUE); else return (FALSE); } case XmRECORD_EVENT: { /* Save the fingerprints for the new event */ uniqueStamp->type = event->type; uniqueStamp->serial = event->xany.serial; uniqueStamp->time = ExtractTime(event); return (TRUE); } default: { return (FALSE); } } } /* * Check to see if this event has already been processed. */ Boolean _XmIsEventUnique( XEvent *event ) { return (ManipulateEvent (event, XmCHECK_UNIQUENESS)); } /* * Record the specified event, so that it will not be reprocessed. */ void _XmRecordEvent( XEvent *event ) { ManipulateEvent (event, XmRECORD_EVENT); } motif-2.3.8/lib/Xm/FileSBP.h0000644000175000017500000001731013145162623012317 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmFSelectP_h #define _XmFSelectP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Defines for use in allocation geometry matrix. */ #define XmFSB_MAX_WIDGETS_VERT 12 /* Bit locations for the state_flags bit field. */ #define XmFS_NO_MATCH (1 << 0) #define XmFS_IN_FILE_SEARCH (1 << 1) #define XmFS_DIR_SEARCH_PROC (1 << 2) /* Constraint part record for FileSelectionBox widget */ typedef struct _XmFileSelectionBoxConstraintPart { char unused; } XmFileSelectionBoxConstraintPart, * XmFileSelectionBoxConstraint; /* New fields for the FileSelectionBox widget class record */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmFileSelectionBoxClassPart; /* Full class record declaration */ typedef struct _XmFileSelectionBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmSelectionBoxClassPart selection_box_class; XmFileSelectionBoxClassPart file_selection_box_class; } XmFileSelectionBoxClassRec; externalref XmFileSelectionBoxClassRec xmFileSelectionBoxClassRec; /* New fields for the FileSelectionBox widget record */ typedef struct { XmString directory; /* directory specification */ XmString pattern; /* file search pattern */ Widget dir_list_label; /* directory list Label */ XmString dir_list_label_string;/* directory list label text */ Widget dir_list; /* directory List */ XmString * dir_list_items; /* items in directory List */ int dir_list_item_count;/* number of items in directory List */ int dir_list_selected_item_position; Widget filter_label; /* file search filter label */ XmString filter_label_string;/* filter label text */ Widget filter_text; /* filter text entry field */ XmString dir_mask; /* string in filter text entry field */ XmString no_match_string; /* string in list when no file match */ XmQualifyProc qualify_search_data_proc; /* directory and mask routine */ XmSearchProc dir_search_proc; /* change directory routine */ XmSearchProc file_search_proc; /* file search routine */ unsigned char file_type_mask; /* mask for type of files in file list */ Boolean list_updated; /* flag to indicate file list update */ Boolean directory_valid ; /* flag to indicate valid new directory*/ unsigned char state_flags ; /* internal flags to indicate state. */ XtEnum path_mode ; XtEnum file_filter_style ; Widget dir_text ; Widget dir_text_label ; XmString dir_text_label_string ; time_t prev_dir_modtime; } XmFileSelectionBoxPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmFileSelectionBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmSelectionBoxPart selection_box; XmFileSelectionBoxPart file_selection_box; } XmFileSelectionBoxRec; /* Access macros */ #define FS_Directory( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.directory) #define FS_DirMask( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.dir_mask) #define FS_DirListLabel( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.dir_list_label) #define FS_DirListLabelString( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.dir_list_label_string) #define FS_DirList( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.dir_list) #define FS_DirListItems( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.dir_list_items) #define FS_DirListItemCount( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.dir_list_item_count) #define FS_FilterLabel( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.filter_label) #define FS_FilterLabelString( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.filter_label_string) #define FS_FilterText( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.filter_text) #define FS_Pattern( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.pattern) #define FS_NoMatchString( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.no_match_string) #define FS_QualifySearchDataProc( w) (((XmFileSelectionBoxWidget) \ (w))->file_selection_box.qualify_search_data_proc) #define FS_DirSearchProc( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.dir_search_proc) #define FS_FileSearchProc( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.file_search_proc) #define FS_RealDefaultButton( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.real_default_button) #define FS_FileTypeMask( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.file_type_mask) #define FS_ListUpdated( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.list_updated) #define FS_DirectoryValid( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.directory_valid) #define FS_StateFlags( w) \ (((XmFileSelectionBoxWidget)(w))->file_selection_box.state_flags) #define FS_DirListSelectedItemPosition( w) (((XmFileSelectionBoxWidget) w) \ ->file_selection_box.dir_list_selected_item_position) #define FS_PathMode( w) (((XmFileSelectionBoxWidget) w) \ ->file_selection_box.path_mode) #define FS_FileFilterStyle( w) (((XmFileSelectionBoxWidget) w) \ ->file_selection_box.file_filter_style) #define FS_DirText( w) (((XmFileSelectionBoxWidget) w) \ ->file_selection_box.dir_text) #define FS_DirTextLabel( w) (((XmFileSelectionBoxWidget) w) \ ->file_selection_box.dir_text_label) #define FS_DirTextLabelString( w) (((XmFileSelectionBoxWidget) w) \ ->file_selection_box.dir_text_label_string) #define FS_PrevDirModTime( w) (((XmFileSelectionBoxWidget) w) \ ->file_selection_box.prev_dir_modtime) /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmFSelectP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/List.c0000644000175000017500000105714613145162623012015 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: List.c /main/47 1999/10/12 16:58:17 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ColorI.h" #include "DisplayI.h" #include "DrawI.h" #include "RepTypeI.h" #include "MessagesI.h" #include "ScreenI.h" #include "ScrollFramTI.h" #include "TransferI.h" /* for _XmConvertComplete() */ #include "TravActI.h" #include "TraversalI.h" #include "XmRenderTI.h" #include "XmStringI.h" #include "ToolTipI.h" #include #define FIX_1390 1 #define FIX_1365 1 #define FIX_1362 1 #define FIX_1636 1 #define BUTTONDOWN 1 #define SHIFTDOWN 2 #define CTRLDOWN 4 #define ALTDOWN 8 #define TOPLEAVE 1 #define BOTTOMLEAVE 2 #define LEFTLEAVE 4 #define RIGHTLEAVE 8 #define MOTION_THRESHOLD 3 #define LIST_MAX_INPUT_SIZE 64 #define UNKNOWN_LENGTH -1 #define LINEHEIGHTS(lw,lines) \ ((lines) * ((lw)->list.MaxItemHeight + (lw)->list.spacing)) #define RECOUNT_SELECTION -1 /**************** * * What do I set the inc to when I have no idea ofthe fonts?? * ****************/ #define CHAR_WIDTH_GUESS 10 /**************** * * List Error Messages * ****************/ #define ListMessage0 _XmMMsgList_0000 #define ListMessage5 _XmMMsgList_0005 #define ListMessage6 _XmMMsgList_0006 #define ListMessage8 _XmMMsgList_0007 #define ListMessage11 _XmMMsgList_0008 #define ListMessage12 _XmMMsgList_0009 #define ListMessage13 _XmMMsgList_0010 #define ListMessage14 _XmMMsgList_0011 #define ListMessage15 _XmMMsgList_0012 #define ListMessage16 _XmMMsgList_0013 #define ListMessage17 _XmMMsgList_0014 #define ListMessage18 _XmMMsgList_0015 /******** Static Function Declarations ********/ static void SliderMove(Widget w, XtPointer closure, XtPointer call_data); static void NullRoutine(Widget wid); static void ClassPartInitialize(WidgetClass wc); static void Initialize(Widget request, Widget w, ArgList args, Cardinal *num_args); static void Redisplay(Widget wid, XEvent *event, Region region); static void Resize(Widget wid); static Dimension CalcVizWidth(XmListWidget lw); static int ComputeVizCount(XmListWidget lw); static Boolean SetValues(Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args); static void Destroy(Widget wid); static XtGeometryResult QueryProc(Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *ret); static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value); static void CvtToExternalPos(Widget wid, int offset, XtArgVal *value); static XmImportOperator CvtToInternalPos(Widget wid, int offset, XtArgVal *value); static void DrawListShadow(XmListWidget w); static void DrawList(XmListWidget w, XEvent *event, Boolean all); static void DrawItem(Widget w, int position); static void DrawItems(XmListWidget lw, int top, int bot, Boolean all); static void DrawHighlight(XmListWidget lw, int position, Boolean on); static void SetClipRect(XmListWidget widget); static void SetDefaultSize(XmListWidget lw, Dimension *width, Dimension *height, Boolean reset_max_width, Boolean reset_max_height); static void MakeGC(XmListWidget lw); static void MakeHighlightGC(XmListWidget lw, Boolean AddMode); static void ChangeHighlightGC(XmListWidget lw, Boolean AddMode); static Boolean SetVerticalScrollbar(XmListWidget lw); static Boolean SetHorizontalScrollbar(XmListWidget lw); static void SetNewSize(XmListWidget lw, Boolean reset_max_width, Boolean reset_max_height, Dimension old_max_height); static void ResetExtents(XmListWidget lw, Boolean recache_extents); static void FixStartEnd(XmListWidget lw, int pos, int count, int *start, int *end); static int AddInternalElements(XmListWidget lw, XmString *items, int nitems, int position, Boolean selectable); static int DeleteInternalElements(XmListWidget lw, XmString string, int position, int count); static int DeleteInternalElementPositions(XmListWidget lw, int *position_list, int position_count, int oldItemCount); static int ReplaceInternalElement(XmListWidget lw, int position, Boolean selectable); static void AddItems(XmListWidget lw, XmString *items, int nitems, int pos); static void DeleteItems(XmListWidget lw, int nitems, int pos); static void DeleteItemPositions(XmListWidget lw, int *position_list, int position_count, Boolean track_kbd); static void ReplaceItem(XmListWidget lw, XmString item, int pos); static int ItemNumber(XmListWidget lw, XmString item); static int ItemExists(XmListWidget lw, XmString item); static Boolean OnSelectedList(XmListWidget lw, XmString item, int pos); static void CopyItems(XmListWidget lw); static void CopySelectedItems(XmListWidget lw); static void CopySelectedPositions(XmListWidget lw); static void ClearItemList(XmListWidget lw); static void ClearSelectedList(XmListWidget lw); static void ClearSelectedPositions(XmListWidget lw); static void BuildSelectedList(XmListWidget lw, Boolean commit); static void BuildSelectedPositions(XmListWidget lw, int count); static void UpdateSelectedList(XmListWidget lw, Boolean rebuild); static void UpdateSelectedPositions(XmListWidget lw, int count); static int WhichItem(XmListWidget w, Position EventY); static void SelectRange(XmListWidget lw, int first, int last, Boolean select); static void RestoreRange(XmListWidget lw, int first, int last, Boolean dostart); static void ArrangeRange(XmListWidget lw, int item); static void HandleNewItem(XmListWidget lw, int item, int olditem); static void HandleExtendedItem(XmListWidget lw, int item); static void VerifyMotion(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void SelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdSelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void UnSelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdUnSelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ExSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ExUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void CtrlBtnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void CtrlSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void CtrlUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdShiftSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdShiftUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdCtrlSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdCtrlUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdActivate(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdCancel(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdToggleAddMode(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdSelectAll(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdDeSelectAll(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void DefaultAction(XmListWidget lw, XEvent *event); static void ClickElement(XmListWidget lw, XEvent *event, Boolean default_action); static void ListFocusIn(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ListFocusOut(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void BrowseScroll(XtPointer closure, XtIntervalId *id); static void ListLeave(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ListEnter(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void MakeItemVisible(XmListWidget lw, int item); static void PrevElement(XmListWidget lw, XEvent *event, String *params, Cardinal *num_params); static void NextElement(XmListWidget lw, XEvent *event, String *params, Cardinal *num_params); static void NormalNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ShiftNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void CtrlNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ExtendAddNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void NormalPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ShiftPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void CtrlPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ExtendAddPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdPrevPage(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdNextPage(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdLeftChar(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdLeftPage(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void BeginLine(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdRightChar(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void KbdRightPage(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void EndLine(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void TopItem(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void EndItem(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ExtendTopItem(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ExtendEndItem(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ListItemVisible(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ListCopyToClipboard(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void DragDropFinished(Widget w, XtPointer closure, XtPointer call_data); static void ListProcessDrag(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void DragStart(XtPointer closure, XtIntervalId* id); static void ListProcessBtn1(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ListProcessBtn2(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ListQuickNavigate(Widget wid, XEvent *event, String *params, Cardinal *num_params); static wchar_t FirstChar(XmString string); static Boolean CompareCharAndItem(XmListWidget lw, wchar_t input_char, int pos); static void ListConvert(Widget, XtPointer, XmConvertCallbackStruct*); static void ListPreDestProc(Widget, XtPointer, XmDestinationCallbackStruct*); static void APIAddItems(XmListWidget lw, XmString *items, int item_count, int pos, Boolean select); static void CleanUpList(XmListWidget lw, Boolean always); static void APIReplaceItems(Widget w, XmString *old_items, int item_count, XmString *new_items, Boolean select); static void APIReplaceItemsPos(Widget w, XmString *new_items, int item_count, int position, Boolean select); static void APISelect(XmListWidget lw, int item_pos, Boolean notify); static void APIDeletePositions(XmListWidget lw, int *positions, int count, Boolean track_kbd); static void SetSelectionParams(XmListWidget lw); static void GetPreeditPosition(XmListWidget lw, XPoint *xmim_point); static void ScrollBarDisplayPolicyDefault(Widget widget, int offset, XrmValue *value); static void ListScrollUp(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ListScrollDown(Widget wid, XEvent *event, String *params, Cardinal *num_params); /******** End Static Function Declarations ********/ /************** * * Translation tables for List. These are used to drive the selections * **************/ #define ListXlations1 _XmList_ListXlations1 #define ListXlations2 _XmList_ListXlations2 /**************** * * Actions Lists * ****************/ static XtActionsRec ListActions[] = { { "ListButtonMotion", VerifyMotion }, { "ListShiftSelect", ExSelect }, { "ListShiftUnSelect", ExUnSelect }, { "ListBeginExtend", ExSelect }, { "ListEndExtend", ExUnSelect }, { "ListCtrlSelect", CtrlSelect }, { "ListCtrlUnSelect", CtrlUnSelect }, { "ListBeginToggle", CtrlBtnSelect }, { "ListEndToggle", CtrlUnSelect }, { "ListShiftCtrlSelect", ExSelect }, { "ListShiftCtrlUnSelect", ExUnSelect }, { "ListExtendAddSelect", ExSelect }, { "ListExtendAddUnSelect", ExUnSelect }, { "ListItemSelect", SelectElement }, { "ListItemUnSelect", UnSelectElement }, { "ListBeginSelect", SelectElement }, { "ListEndSelect", UnSelectElement }, { "ListKbdBeginSelect", KbdSelectElement }, { "ListKbdEndSelect", KbdUnSelectElement }, { "ListKbdShiftSelect", KbdShiftSelect }, { "ListKbdShiftUnSelect", KbdShiftUnSelect }, { "ListKbdCtrlSelect", KbdCtrlSelect }, { "ListKbdCtrlUnSelect", KbdCtrlUnSelect }, { "ListKbdBeginExtend", KbdShiftSelect }, { "ListKbdEndExtend", KbdShiftUnSelect }, { "ListKbdBeginToggle", KbdCtrlSelect }, { "ListKbdEndToggle", KbdCtrlUnSelect }, { "ListKbdSelectAll", KbdSelectAll }, { "ListKbdDeSelectAll", KbdDeSelectAll }, { "ListKbdActivate", KbdActivate }, { "ListKbdCancel", KbdCancel }, { "ListAddMode", KbdToggleAddMode }, { "ListPrevItem", NormalPrevElement }, { "ListNextItem", NormalNextElement }, { "ListPrevPage", KbdPrevPage }, { "ListNextPage", KbdNextPage }, { "ListLeftChar", KbdLeftChar }, { "ListLeftPage", KbdLeftPage }, { "ListRightChar", KbdRightChar }, { "ListRightPage", KbdRightPage }, { "ListCtrlPrevItem", CtrlPrevElement }, { "ListCtrlNextItem", CtrlNextElement }, { "ListShiftPrevItem", ShiftPrevElement }, { "ListShiftNextItem", ShiftNextElement }, { "List_ShiftCtrlPrevItem", ExtendAddPrevElement }, { "List_ShiftCtrlNextItem", ExtendAddNextElement }, { "ListAddPrevItem", CtrlPrevElement }, { "ListAddNextItem", CtrlNextElement }, { "ListExtendPrevItem", ShiftPrevElement }, { "ListExtendNextItem", ShiftNextElement }, { "ListExtendAddPrevItem", ExtendAddPrevElement }, { "ListExtendAddNextItem", ExtendAddNextElement }, { "ListBeginLine", BeginLine }, { "ListEndLine", EndLine }, { "ListBeginData", TopItem }, { "ListEndData", EndItem }, { "ListBeginDataExtend", ExtendTopItem }, { "ListEndDataExtend", ExtendEndItem }, { "ListFocusIn", ListFocusIn }, { "ListFocusOut", ListFocusOut }, { "ListEnter", ListEnter }, { "ListLeave", ListLeave }, { "ListScrollCursorVertically", ListItemVisible }, { "ListScrollCursorVisible", ListItemVisible }, { "ListScrollUp", ListScrollUp }, { "ListScrollDown", ListScrollDown }, /* name above is correct; maintain this one for 1.2.0 compatibility */ { "ListCopyToClipboard", ListCopyToClipboard }, { "ListProcessDrag", ListProcessDrag }, { "ListQuickNavigate", ListQuickNavigate }, { "ListProcessBtn1", ListProcessBtn1 }, { "ListProcessBtn2", ListProcessBtn2 }, }; /************************************************************************ * * * XmList Resources. * * * ************************************************************************/ static XtResource resources[] = { { XmNlistSpacing, XmCListSpacing, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmListRec, list.ItemSpacing), XmRImmediate, (XtPointer) 0 }, { XmNlistMarginWidth, XmCListMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmListRec, list.margin_width), XmRImmediate, (XtPointer) 0 }, { XmNlistMarginHeight, XmCListMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmListRec, list.margin_height), XmRImmediate, (XtPointer) 0 }, { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmListRec, list.MouseMoved), XmRImmediate, (XtPointer)False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmListRec, list.font), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmListRec, list.font), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNstringDirection, XmCStringDirection, XmRStringDirection, sizeof(XmStringDirection), XtOffsetOf(XmListRec, list.StrDir), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, #ifndef XM_PART_BC { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), XtOffsetOf(XmPrimitiveRec, primitive.layout_direction), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, #endif { XmNitems, XmCItems, XmRXmStringTable, sizeof(XmStringTable), XtOffsetOf(XmListRec, list.items), XmRStringTable, NULL }, { XmNitemCount, XmCItemCount, XmRInt, sizeof(int), XtOffsetOf(XmListRec, list.itemCount), XmRImmediate, (XtPointer) 0 }, { XmNselectedItems, XmCSelectedItems, XmRXmStringTable, sizeof(XmStringTable), XtOffsetOf(XmListRec, list.selectedItems), XmRStringTable, NULL }, { XmNselectedItemCount, XmCSelectedItemCount, XmRInt, sizeof(int), XtOffsetOf(XmListRec, list.selectedItemCount), XmRImmediate, (XtPointer) 0 }, { XmNselectedPositions, XmCSelectedPositions, XmRPointer, sizeof(XtPointer), XtOffsetOf(XmListRec, list.selectedPositions), XmRImmediate, (XtPointer) NULL }, { XmNselectedPositionCount, XmCSelectedPositionCount, XmRInt, sizeof(int), XtOffsetOf(XmListRec, list.selectedPositionCount), XmRImmediate, (XtPointer) 0 }, { XmNvisibleItemCount, XmCVisibleItemCount, XmRInt, sizeof(int), XtOffsetOf(XmListRec, list.visibleItemCount), XmRImmediate, (XtPointer) 0 }, { XmNtopItemPosition, XmCTopItemPosition, XmRTopItemPosition, sizeof(int), XtOffsetOf(XmListRec, list.top_position), XmRImmediate, (XtPointer) 0 }, { XmNselectionPolicy, XmCSelectionPolicy, XmRSelectionPolicy, sizeof(unsigned char), XtOffsetOf(XmListRec, list.SelectionPolicy), XmRImmediate, (XtPointer) XmBROWSE_SELECT }, { XmNselectionMode, XmCSelectionMode, XmRSelectionMode, sizeof(unsigned char), XtOffsetOf(XmListRec, list.SelectionMode), XmRImmediate, (XtPointer) XmNORMAL_MODE }, { XmNlistSizePolicy, XmCListSizePolicy, XmRListSizePolicy, sizeof(unsigned char), XtOffsetOf(XmListRec, list.SizePolicy), XmRImmediate, (XtPointer) XmVARIABLE }, { XmNscrollBarDisplayPolicy, XmCScrollBarDisplayPolicy, XmRScrollBarDisplayPolicy, sizeof(unsigned char), XtOffsetOf(XmListRec, list.ScrollBarDisplayPolicy), XmRCallProc, (XtPointer) ScrollBarDisplayPolicyDefault }, { XmNautomaticSelection, XmCAutomaticSelection, XmRAutomaticSelection, sizeof(XtEnum), XtOffsetOf(XmListRec, list.AutoSelect), XmRImmediate, (XtPointer) XmNO_AUTO_SELECT }, { XmNdoubleClickInterval, XmCDoubleClickInterval, XmRInt, sizeof(int), XtOffsetOf(XmListRec, list.ClickInterval), XmRImmediate, (XtPointer) (-1) }, { XmNsingleSelectionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmListRec, list.SingleCallback), XmRCallback, (XtPointer)NULL }, { XmNmultipleSelectionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmListRec, list.MultipleCallback), XmRCallback, (XtPointer)NULL }, { XmNextendedSelectionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmListRec, list.ExtendCallback), XmRCallback, (XtPointer)NULL }, { XmNbrowseSelectionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmListRec, list.BrowseCallback), XmRCallback, (XtPointer)NULL }, { XmNdefaultActionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmListRec, list.DefaultCallback), XmRCallback, (XtPointer)NULL }, { XmNdestinationCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmListRec, list.DestinationCallback), XmRCallback, (XtPointer)NULL }, { XmNhorizontalScrollBar, XmCHorizontalScrollBar, XmRWidget, sizeof(Widget), XtOffsetOf(XmListRec, list.hScrollBar), XmRImmediate, NULL }, { XmNverticalScrollBar, XmCVerticalScrollBar, XmRWidget, sizeof(Widget), XtOffsetOf(XmListRec, list.vScrollBar), XmRImmediate, NULL }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof(unsigned char), XtOffsetOf(XmListRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmTAB_GROUP }, { XmNprimaryOwnership, XmCPrimaryOwnership, XmRPrimaryOwnership, sizeof(unsigned char), XtOffsetOf(XmListRec, list.PrimaryOwnership), XmRImmediate, (XtPointer) XmOWN_NEVER }, { XmNmatchBehavior, XmCMatchBehavior, XmRMatchBehavior, sizeof(unsigned char), XtOffsetOf(XmListRec, list.matchBehavior), XmRImmediate, (XtPointer) XmQUICK_NAVIGATE }, { XmNselectColor, XmCSelectColor, XmRSelectColor, sizeof(Pixel), XtOffsetOf(XmListRec, list.selectColor), XmRImmediate, (XtPointer)XmREVERSED_GROUND_COLORS } }; /**************** * * Synthetic resources * ****************/ static XmSyntheticResource get_resources[] = { { XmNlistSpacing, sizeof(Dimension), XtOffsetOf(XmListRec, list.ItemSpacing), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNlistMarginWidth, sizeof(Dimension), XtOffsetOf(XmListRec, list.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNlistMarginHeight, sizeof(Dimension), XtOffsetOf(XmListRec, list.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNtopItemPosition, sizeof(int), XtOffsetOf(XmListRec, list.top_position), CvtToExternalPos, CvtToInternalPos }, }; /************************************************************************ * * * Class record for XmList class * * * ************************************************************************/ static XmBaseClassExtRec BaseClassExtRec = { NULL, /* next_extension */ NULLQUARK, /* record_type */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* record_size */ NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* get_values_prehook */ NULL, /* get_values_posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook */ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; externaldef(xmlistclassrec) XmListClassRec xmListClassRec = { { (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "XmList", /* class_name */ sizeof(XmListRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class part init */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* widget init hook */ XtInheritRealize, /* realize */ ListActions, /* actions */ XtNumber(ListActions), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ XtExposeCompressMaximal | /* compress_exposure */ XtExposeNoRegion, TRUE, /* compress enter/exit*/ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set values */ NULL, /* set values hook */ XtInheritSetValuesAlmost, /* set values almost */ NULL, /* get_values hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback offset */ NULL, /* default trans */ QueryProc, /* query geo proc */ NULL, /* disp accelerator */ (XtPointer) &BaseClassExtRec, /* extension */ }, { NullRoutine, /* border_highlight */ NullRoutine, /* border_unhighlight */ NULL, /* translations */ NULL, /* arm_and_activate */ get_resources, /* get resources */ XtNumber(get_resources), /* num get_resources */ NULL, /* extension */ }, { (XtPointer) NULL, /* extension */ } }; externaldef(xmlistwidgetclass) WidgetClass xmListWidgetClass = (WidgetClass)&xmListClassRec; /* Transfer trait record */ static XmConst XmTransferTraitRec ListTransfer = { 0, /* version */ (XmConvertCallbackProc) ListConvert, /* convertProc */ NULL, /* destinationProc */ (XmDestinationCallbackProc) ListPreDestProc, /* destinationPreHookProc */ }; /*ARGSUSED*/ static void NullRoutine(Widget wid) /* unused */ { /*EMPTY*/ } /************************************************************************ * * * SliderMove * * Callback for the value changes of navigators. * * * ************************************************************************/ /*ARGSUSED*/ static void SliderMove(Widget w, XtPointer closure, XtPointer cd) { /* w is a navigator widget */ XmListWidget lw = (XmListWidget) closure; XmNavigatorDataRec nav_data; /* get the navigator information using the trait getValue since I cannot use a callback struct */ nav_data.valueMask = NavValue; ((XmNavigatorTrait)XmeTraitGet((XtPointer) XtClass(w), XmQTnavigator)) ->getValue(w, &nav_data); if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); /* look at the kind of navigator and make the appropriate update */ if (nav_data.dimMask & NavigDimensionX) { lw->list.XOrigin = nav_data.value.x; lw->list.hOrigin = nav_data.value.x; } if (nav_data.dimMask & NavigDimensionY) { lw->list.top_position = (int) nav_data.value.y; } DrawList(lw, NULL, TRUE); /* now update the other navigator value */ _XmSFUpdateNavigatorsValue(XtParent((Widget)lw), &nav_data, False); } /************************************************************************ * * * ClassPartInitialize - Set up the fast subclassing. * * * ************************************************************************/ static void ClassPartInitialize(WidgetClass wc) { char *xlats; _XmFastSubclassInit (wc, XmLIST_BIT); xlats = (char *) ALLOCATE_LOCAL(strlen(ListXlations1) + strlen(ListXlations2) + 1); strcpy(xlats, ListXlations1); strcat(xlats, ListXlations2); wc->core_class.tm_table =(String) XtParseTranslationTable(xlats); DEALLOCATE_LOCAL((char *)xlats); /* Install transfer trait */ XmeTraitSet((XtPointer)wc, XmQTtransfer, (XtPointer) &ListTransfer); } /************************************************************************ * * * Initialize - initialize the instance. * * * ************************************************************************/ /*ARGSUSED*/ static void Initialize(Widget request, Widget w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmListWidget lw = (XmListWidget) w; Dimension width, height; int i, j; XmScrollFrameTrait scrollFrameTrait; XrmValue val; lw->list.LastItem = 0; lw->list.Event = 0; lw->list.LastHLItem = 0; lw->list.StartItem = 0; lw->list.EndItem = 0; lw->list.OldStartItem = 0; lw->list.OldEndItem = 0; lw->list.DownCount = 0; lw->list.DownTime = 0; lw->list.NormalGC = NULL; lw->list.InverseGC = NULL; lw->list.HighlightGC = NULL; lw->list.InsensitiveGC = NULL; lw->list.XOrigin = 0; lw->list.Traversing = FALSE; lw->list.KbdSelection = FALSE; lw->list.CurrentKbdItem = 0; lw->list.AppendInProgress = FALSE; lw->list.FromSetSB = FALSE; lw->list.FromSetNewSize = FALSE; lw->list.DragID = 0; lw->list.MaxItemHeight = 0; lw->list.LeaveDir = 0; lw->list.hOrigin = 0; lw->list.hExtent = lw->list.hmax = 0; lw->list.AutoSelectionType = XmAUTO_UNSET; lw->list.LastSetVizCount = 0; /* CR 6014 */ lw->list.scratchRend = NULL; lw->list.drag_start_timer = 0; lw->list.drag_abort_action = 0; lw->list.MaxWidth = 0; /* For Quick Navigate */ XmImRegister(w, 0); if (lw->list.ItemSpacing < 0) { lw->list.ItemSpacing = 0; XmeWarning((Widget) lw, ListMessage11); } if (lw->list.top_position < -1) { lw->list.top_position = 0; XmeWarning((Widget) lw, ListMessage15); } lw->list.previous_top_position = 0; if (lw->list.ClickInterval < 0) lw->list.ClickInterval = XtGetMultiClickTime(XtDisplay(lw)); if (lw->primitive.highlight_thickness) lw->list.HighlightThickness = lw->primitive.highlight_thickness + 1; else lw->list.HighlightThickness = 0; lw->list.BaseX = ((Position)lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness); lw->list.BaseY = ((Position)lw->list.margin_height + lw->list.HighlightThickness + lw->primitive.shadow_thickness); lw->list.InternalList = NULL; if (!XmRepTypeValidValue(XmRID_SELECTION_POLICY, lw->list.SelectionPolicy, (Widget) lw)) lw->list.SelectionPolicy = XmBROWSE_SELECT; if (!XmRepTypeValidValue(XmRID_LIST_SIZE_POLICY, lw->list.SizePolicy, (Widget) lw)) lw->list.SizePolicy = XmVARIABLE; if (!XmRepTypeValidValue(XmRID_SCROLL_BAR_DISPLAY_POLICY, lw->list.ScrollBarDisplayPolicy, (Widget) lw)) lw->list.ScrollBarDisplayPolicy = XmAS_NEEDED; if (!XmRepTypeValidValue(XmRID_PRIMARY_OWNERSHIP, lw->list.PrimaryOwnership, (Widget) lw)) lw->list.PrimaryOwnership = XmOWN_NEVER; if (!XmRepTypeValidValue(XmRID_MATCH_BEHAVIOR, lw->list.matchBehavior, (Widget) lw)) lw->list.matchBehavior = XmQUICK_NAVIGATE; #ifndef NO_XM_1_2_BC /* * Some pre-Motif 2.0 XmManager subclasses may be bypassing the * synthetic resouce GetValues hook and passing us the manager's raw * string_direction field (which is now a layout_direction). Fixup * the common/simple cases. */ switch (lw->list.StrDir) { case XmLEFT_TO_RIGHT: case XmRIGHT_TO_LEFT: /* These string directions are erroneous uses of layout directions. */ lw->list.StrDir = XmDirectionToStringDirection(lw->list.StrDir); break; default: /* Other unknown layout directions will still get a warning. */ break; } #endif /* If layout_direction is set, it overrides string_direction. * If string_direction is set, but not layout_direction, use * string_direction value. If neither is set, get from parent. */ if (XmPrim_layout_direction(lw) != XmDEFAULT_DIRECTION) { if (lw->list.StrDir == XmDEFAULT_DIRECTION) lw->list.StrDir = XmDirectionToStringDirection(XmPrim_layout_direction(lw)); } else if (lw->list.StrDir != XmDEFAULT_DIRECTION) { XmPrim_layout_direction(lw) = XmStringDirectionToDirection(lw->list.StrDir); } else { XmPrim_layout_direction(lw) = _XmGetLayoutDirection(XtParent(w)); lw->list.StrDir = XmDirectionToStringDirection(XmPrim_layout_direction(lw)); } if (!XmRepTypeValidValue(XmRID_STRING_DIRECTION, lw->list.StrDir, (Widget) lw)) lw->list.StrDir = XmSTRING_DIRECTION_L_TO_R; if (lw->list.font == NULL) lw->list.font = XmeGetDefaultRenderTable ((Widget) lw,XmTEXT_FONTLIST); lw->list.font = XmFontListCopy(lw->list.font); /* * Force selection mode to appropriate value, except for Extended * Select, where both modes are allowed (default is Normal, set in * the XtResource record) */ if ((lw->list.SelectionPolicy == XmMULTIPLE_SELECT) || (lw->list.SelectionPolicy == XmSINGLE_SELECT)) lw->list.SelectionMode = XmADD_MODE; else if (lw->list.SelectionPolicy == XmBROWSE_SELECT) lw->list.SelectionMode = XmNORMAL_MODE; else if (!XmRepTypeValidValue(XmRID_SELECTION_MODE, lw->list.SelectionMode, (Widget) lw)) lw->list.SelectionMode = XmADD_MODE; /* Deal with selectColor */ lw->list.scratchRend = XmRenditionCreate(NULL, XmS, NULL, 0); if (lw->list.selectColor == XmDEFAULT_SELECT_COLOR) { _XmSelectColorDefault((Widget)lw, XtOffsetOf(XmListRec, list.selectColor), &val); lw->list.selectColor = *((Pixel*) val.addr); } else if (lw->list.selectColor == XmHIGHLIGHT_COLOR) { lw->list.selectColor = lw->primitive.highlight_color; } MakeGC(lw); MakeHighlightGC(lw, (lw->list.SelectionMode == XmADD_MODE)); lw->list.spacing = lw->list.ItemSpacing + lw->list.HighlightThickness; /* Copy the font, item and selected item lists into our space. * THE USER IS RESPONSIBLE FOR FREEING THE ORIGINAL LISTS! */ ASSIGN_MAX(lw->list.itemCount, 0); ASSIGN_MAX(lw->list.selectedItemCount, 0); ASSIGN_MAX(lw->list.selectedPositionCount, 0); if ((lw->list.itemCount && !lw->list.items) || (!lw->list.itemCount && lw->list.items)) { XmeWarning((Widget) lw, ListMessage16); } if (lw->list.top_position == -1) lw->list.top_position = lw->list.itemCount ? lw->list.itemCount - 1 : 0; CopyItems(lw); CopySelectedItems(lw); /* If we have items, add them to the internal list and calculate our * default size. */ if (lw->list.items && (lw->list.itemCount > 0)) { lw->list.InternalList = NULL; (void) AddInternalElements(lw, lw->list.items, lw->list.itemCount, 0, TRUE); /* CR 9375: Preserve initial selectedItems a little longer. */ if (!lw->list.selectedItemCount) { /* CR 5560: Clear selected list to avoid memory leak. */ ClearSelectedList(lw); BuildSelectedList(lw, TRUE); BuildSelectedPositions(lw, lw->list.selectedItemCount); } else { BuildSelectedPositions(lw, RECOUNT_SELECTION); } } else { /* The selectedPositionList has not been copied yet, so we can't */ /* use ClearSelectedPositions() because it would free it. */ lw->list.selectedPositionCount = 0; lw->list.selectedPositions = NULL; } /* BEGIN OSF Fix pir 2730 */ /* Must have at least one visible. */ /* Save from AddInternalElement */ lw->list.visibleItemCount = ((XmListWidget)request)->list.visibleItemCount; if (lw->list.visibleItemCount < 0) { lw->list.visibleItemCount = 1; XmeWarning((Widget)lw, ListMessage0); } else if (lw->list.visibleItemCount == 0) { /* Assume that the user didn't set it.*/ lw->list.visibleItemCount = ComputeVizCount(lw); } else { /* Otherwise leave it to whatever it was set. */ lw->list.LastSetVizCount = lw->list.visibleItemCount; } /* END OSF Fix pir 2730 */ SetDefaultSize(lw, &width, &height, False, False); SetSelectionParams(lw); if (!request->core.width) lw->core.width = width; if (!request->core.height) lw->core.height = height; else { /* We got a height - make sure viz tracks */ lw->list.visibleItemCount = ComputeVizCount(lw); } /* CR 8298: The spot location may depend on lw->list.spacing. */ /* CR 8436: The spot location may depend on lw->list.top_position. */ if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget) lw, XmNspotLocation, &xmim_point, XmNfontList, lw->list.font, NULL); } /* * OK, we're all set for the list stuff. Now look at our parent and see * if it's a non inited ScrollFrame. If it is, create the navigators * and set up all the scrolling stuff using the trait. */ scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass(lw->core.parent), XmQTscrollFrame); if (scrollFrameTrait == NULL || scrollFrameTrait->getInfo (lw->core.parent, NULL, NULL, NULL)) { lw->list.Mom = NULL; return; } /* * Set up the default move callback so that our navigator gets * associated nicely by the scrollFrame. */ scrollFrameTrait->init (lw->core.parent, SliderMove, (Widget)lw); lw->list.Mom = (XmScrolledWindowWidget) lw->core.parent; /* The cast above is necessary because of the type of the Mom field, * but ScrolledWindow is no longer required, ScrollFrame is. */ { Arg vSBArgs[11]; i = 0; XtSetArg (vSBArgs[i], XmNorientation, XmVERTICAL), i++; XtSetArg (vSBArgs[i], XmNunitType, XmPIXELS), i++; XtSetArg (vSBArgs[i], XmNshadowThickness, lw->primitive.shadow_thickness), i++; XtSetArg (vSBArgs[i], XmNhighlightThickness, 0), i++; XtSetArg(vSBArgs[i], XmNtraversalOn, FALSE), i++; assert(i <= XtNumber(vSBArgs)); lw->list.vScrollBar = (XmScrollBarWidget) XmCreateScrollBar((Widget) lw->list.Mom, "VertScrollBar", vSBArgs, i); SetVerticalScrollbar(lw); } /* Only create the horizontal sb if in static size mode. */ if (lw->list.SizePolicy != XmVARIABLE) { /* This code probably not needed, since SetHorizontalScrollbar * does the same kind of thing. */ lw->list.hmin = 0; lw->list.hmax = lw->list.MaxWidth + (lw->list.BaseX * 2); lw->list.hExtent = lw->core.width; lw->list.hOrigin = lw->list.XOrigin; if ((lw->list.hExtent + lw->list.hOrigin) > lw->list.hmax) lw->list.hExtent = lw->list.hmax - lw->list.hOrigin; { Arg hSBArgs[11]; j = 0; XtSetArg (hSBArgs[j], XmNorientation, XmHORIZONTAL), j++; XtSetArg (hSBArgs[j], XmNunitType, XmPIXELS), j++; XtSetArg (hSBArgs[j], XmNshadowThickness, lw->primitive.shadow_thickness), j++; XtSetArg (hSBArgs[j], XmNhighlightThickness, 0), j++; XtSetArg(hSBArgs[j], XmNtraversalOn, FALSE), j++; assert(j <= XtNumber(hSBArgs)); lw->list.hScrollBar = (XmScrollBarWidget) XmCreateScrollBar((Widget)lw->list.Mom, "HorScrollBar", hSBArgs,j); SetHorizontalScrollbar(lw); } } } /************************************************************************ * * * ReDisplay - draw the visible list items. * * * ************************************************************************/ /*ARGSUSED*/ static void Redisplay(Widget wid, XEvent *event, Region region) { XmListWidget lw = (XmListWidget) wid; DrawListShadow(lw); DrawList(lw, event, TRUE); /* CR 6529: Redraw the highlight too. */ if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } /************************************************************************ * * * Resize - redraw the list in response to orders from above. * * * ************************************************************************/ static void Resize(Widget wid) { XmListWidget lw = (XmListWidget) wid; int listwidth, top; int viz; /* Don't allow underflow! */ int borders = 2 * (lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness); if ((int)lw->core.width <= borders) listwidth = 1; else listwidth = lw->core.width - borders; /**************** * * The current strategy here is to assume that the user initiated the * resize request on me, or on my parent. As such, we will calculate a * new visible item count, even though it may confuse the thing that * set the visible count in the first place. * Oh, well. * ****************/ top = lw->list.top_position; viz = ComputeVizCount(lw); /* CR 2782: Only force top_position if we've lost vScrollBar. */ if (!lw->list.vScrollBar || !XtIsManaged((Widget)lw->list.vScrollBar)) if ((lw->list.itemCount - top) < viz) { top = lw->list.itemCount - viz; ASSIGN_MAX(top, 0); lw->list.top_position = top; } lw->list.LastSetVizCount = lw->list.visibleItemCount = viz; SetVerticalScrollbar(lw); if (lw->list.SizePolicy != XmVARIABLE) { if ((int)(lw->list.MaxWidth - lw->list.XOrigin) < listwidth) lw->list.XOrigin = lw->list.MaxWidth - listwidth; ASSIGN_MAX(lw->list.XOrigin, 0); SetHorizontalScrollbar(lw); } if (XtIsRealized((Widget)lw)) SetClipRect(lw); } /************************************************************************ * * * ComputeVizCount - return the number of items that would fit in the * * current height. If there are no items, guess. * * * ************************************************************************/ static int ComputeVizCount(XmListWidget lw) { int viz, lineheight; int listheight; /* BEGIN OSF Fix pir 2730 */ XFontStruct *font_struct = (XFontStruct *) NULL; /* END OSF Fix pir 2730 */ /* Don't let listheight underflow to a large positive number! */ int borders = 2 * (lw->primitive.shadow_thickness + lw->list.HighlightThickness + lw->list.margin_height); if ((int)lw->core.height <= borders) listheight = 1; else listheight = lw->core.height - borders; /* CR 2730 */ if (lw->list.InternalList && lw->list.itemCount) { /* Just use the calculated heights of the items. */ lineheight = lw->list.MaxItemHeight; } else /* Have to guess by getting height of default font. */ { #if USE_XFT XmRenderTableGetDefaultFontExtents(lw->list.font, &lineheight, NULL, NULL); if (lineheight == 0) lineheight = 1; #else if (XmeRenderTableGetDefaultFont(lw->list.font, &font_struct)) lineheight = font_struct->ascent + font_struct->descent; else lineheight = 1; #endif } if (lineheight + lw->list.spacing != 0) viz = ((int)(listheight + lw->list.spacing) / (int)(lineheight + lw->list.spacing)); else viz = (int)(listheight + lw->list.spacing); if (!viz) viz++; /* Always have at least one item visible */ /* END OSF Fix pir 2730 */ return viz; } /************************************************************************ * * * SetValues - change the instance data * * * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues(Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args) { XmListWidget oldlw = (XmListWidget) old; XmListWidget newlw = (XmListWidget) new_w; Boolean new_size = FALSE; #ifdef FIX_1474 Boolean new_size_viz = FALSE; #endif Boolean reset_max = FALSE; Boolean redraw = FALSE; Boolean reset_select = FALSE; Boolean build_selected_list = FALSE; Dimension width = 0; Dimension height = 0; int i, j; XrmValue val; if (!XmRepTypeValidValue(XmRID_SELECTION_POLICY, newlw->list.SelectionPolicy, (Widget) newlw)) newlw->list.SelectionPolicy = oldlw->list.SelectionPolicy; if (!XmRepTypeValidValue(XmRID_SELECTION_MODE, newlw->list.SelectionMode, (Widget) newlw)) newlw->list.SelectionMode = oldlw->list.SelectionMode; if (!XmRepTypeValidValue(XmRID_PRIMARY_OWNERSHIP, newlw->list.PrimaryOwnership, (Widget) newlw)) newlw->list.PrimaryOwnership = oldlw->list.PrimaryOwnership; if (!XmRepTypeValidValue(XmRID_MATCH_BEHAVIOR, newlw->list.matchBehavior, (Widget) newlw)) newlw->list.matchBehavior = oldlw->list.matchBehavior; /* * Selection Policy changes take precedence over Selection Mode changes. * If an attempt is made to change both resources and they do not * complement one another, the Selection Policy value will be used. * XmEXTENDED_SELECT policy can be in ADD or NORMAL mode. */ if ((newlw->list.SelectionPolicy != oldlw->list.SelectionPolicy) || (newlw->list.SelectionMode != oldlw->list.SelectionMode)) { if ((newlw->list.SelectionPolicy == XmMULTIPLE_SELECT) || (newlw->list.SelectionPolicy == XmSINGLE_SELECT)) newlw->list.SelectionMode = XmADD_MODE; else if (newlw->list.SelectionPolicy == XmBROWSE_SELECT) newlw->list.SelectionMode = XmNORMAL_MODE; if (newlw->list.SelectionMode != oldlw->list.SelectionMode) { DrawHighlight(newlw, newlw->list.CurrentKbdItem, FALSE); ChangeHighlightGC(newlw, (newlw->list.SelectionMode == XmADD_MODE)); DrawHighlight(newlw, newlw->list.CurrentKbdItem, TRUE); } } if (!XmRepTypeValidValue(XmRID_LIST_SIZE_POLICY, newlw->list.SizePolicy, (Widget) newlw)) newlw->list.SizePolicy = oldlw->list.SizePolicy; if (!XmRepTypeValidValue(XmRID_SCROLL_BAR_DISPLAY_POLICY, newlw->list.ScrollBarDisplayPolicy, (Widget) newlw)) newlw->list.ScrollBarDisplayPolicy = oldlw->list.ScrollBarDisplayPolicy; if (!XmRepTypeValidValue(XmRID_STRING_DIRECTION, newlw->list.StrDir, (Widget) newlw)) newlw->list.StrDir = oldlw->list.StrDir; if (newlw->list.SizePolicy != oldlw->list.SizePolicy) { XmeWarning((Widget) newlw, ListMessage5); newlw->list.SizePolicy = oldlw->list.SizePolicy; } /**************** * * Visual attributes * ****************/ if (newlw->list.StrDir != oldlw->list.StrDir) redraw = TRUE; /* CR 6907: Redraw if layout direction changes. */ if (LayoutIsRtoLP(newlw) != LayoutIsRtoLP(oldlw)) redraw = TRUE; if ((newlw->list.margin_width != oldlw->list.margin_width) || (newlw->list.margin_height != oldlw->list.margin_height)) new_size = TRUE; if (newlw->list.ItemSpacing != oldlw->list.ItemSpacing) { if (newlw->list.ItemSpacing >= 0) { reset_max = new_size = TRUE; } else { newlw->list.ItemSpacing = oldlw->list.ItemSpacing; XmeWarning((Widget) newlw, ListMessage11); } } if ((newlw->list.ItemSpacing != oldlw->list.ItemSpacing) || (newlw->primitive.highlight_thickness != oldlw->primitive.highlight_thickness)) { reset_max = new_size = TRUE; if (newlw->primitive.highlight_thickness) newlw->list.HighlightThickness = newlw->primitive.highlight_thickness + 1; else newlw->list.HighlightThickness = 0; newlw->list.spacing = (newlw->list.HighlightThickness + newlw->list.ItemSpacing); if (newlw->primitive.highlight_thickness != oldlw->primitive.highlight_thickness) ChangeHighlightGC(newlw, (newlw->list.SelectionMode == XmADD_MODE)); ResetExtents(newlw, False); reset_max = FALSE; } /* CR 5583: Attempt to resize if shadow thickness changes. */ if (newlw->primitive.shadow_thickness != oldlw->primitive.shadow_thickness) new_size = TRUE; if (newlw->list.visibleItemCount != oldlw->list.visibleItemCount) { if (newlw->list.visibleItemCount < 0) { newlw->list.visibleItemCount = oldlw->list.visibleItemCount; XmeWarning((Widget) newlw, ListMessage0); } else if (newlw->list.visibleItemCount == 0) { /* CR 6014, 8655, 9604: Stop forcing list size. */ #ifdef FIX_1474 new_size_viz = TRUE; #else new_size = TRUE; #endif newlw->list.LastSetVizCount = 0; newlw->list.visibleItemCount = ComputeVizCount(newlw); } else { #ifdef FIX_1474 new_size_viz = TRUE; newlw->list.LastSetVizCount = newlw->list.visibleItemCount; newlw->list.visibleItemCount = oldlw->list.visibleItemCount; #else new_size = TRUE; newlw->list.LastSetVizCount = newlw->list.visibleItemCount; #endif } #ifdef FIX_1474 redraw = TRUE; #endif } if (XtIsSensitive(new_w) != XtIsSensitive(old)) { /* CR 6412: Redraw all the time, not just when we've a Mom. */ redraw = TRUE; if (! XtIsSensitive(new_w)) { DrawHighlight(newlw, newlw->list.CurrentKbdItem, FALSE); newlw->list.Traversing = FALSE; } } /* Select color */ if (newlw->list.selectColor != oldlw->list.selectColor) { if (newlw->list.selectColor == XmDEFAULT_SELECT_COLOR) { _XmSelectColorDefault((Widget)newlw, XtOffsetOf(struct _XmListRec, list.selectColor), &val); newlw->list.selectColor = *((Pixel*) val.addr); } else if (newlw->list.selectColor == XmHIGHLIGHT_COLOR) { newlw->list.selectColor = newlw->primitive.highlight_color; } if (newlw->list.selectColor != oldlw->list.selectColor) { redraw = TRUE; MakeGC(newlw); } } /**************** * * See if the Selected Items list or the Selected Positions list * has changed. If so, free up the old ones, and allocate the new. * ****************/ if ((newlw->list.selectedItems != oldlw->list.selectedItems) || (newlw->list.selectedItemCount != oldlw->list.selectedItemCount)) { if (newlw->list.selectedItems && (newlw->list.selectedItemCount > 0)) { CopySelectedItems(newlw); ClearSelectedList(oldlw); if (newlw->list.selectedPositions == oldlw->list.selectedPositions) newlw->list.selectedPositions = NULL; else CopySelectedPositions(newlw); ClearSelectedPositions(oldlw); reset_select = TRUE; } else if (newlw->list.selectedItemCount == 0) { ClearSelectedList(oldlw); ClearSelectedPositions(oldlw); newlw->list.selectedItems = NULL; newlw->list.selectedPositions = NULL; reset_select = TRUE; } else if ((newlw->list.selectedItemCount > 0) && (newlw->list.selectedItems == NULL)) { XmeWarning((Widget) newlw, ListMessage14); newlw->list.selectedItems = oldlw->list.selectedItems; newlw->list.selectedItemCount = oldlw->list.selectedItemCount; newlw->list.selectedPositions = oldlw->list.selectedPositions; newlw->list.selectedPositionCount = oldlw->list.selectedPositionCount; } else { XmeWarning((Widget) newlw, ListMessage13); newlw->list.selectedItems = oldlw->list.selectedItems; newlw->list.selectedItemCount = oldlw->list.selectedItemCount; newlw->list.selectedPositions = oldlw->list.selectedPositions; newlw->list.selectedPositionCount = oldlw->list.selectedPositionCount; } } else if ((newlw->list.selectedPositions != oldlw->list.selectedPositions) || (newlw->list.selectedPositionCount != oldlw->list.selectedPositionCount)) { if (newlw->list.selectedPositions && (newlw->list.selectedPositionCount > 0)) { ClearSelectedList(oldlw); ClearSelectedPositions(oldlw); CopySelectedPositions(newlw); reset_select = TRUE; build_selected_list = TRUE; } else if ((newlw->list.selectedPositionCount > 0) && (newlw->list.selectedPositions == NULL)) { XmeWarning((Widget) newlw, ListMessage18); newlw->list.selectedPositions = oldlw->list.selectedPositions; newlw->list.selectedPositionCount = oldlw->list.selectedPositionCount; } else { XmeWarning((Widget) newlw, ListMessage17); newlw->list.selectedPositions = oldlw->list.selectedPositions; newlw->list.selectedPositionCount = oldlw->list.selectedPositionCount; } } /* * If the item list has changed to valid data, free up the old and create * the new. If the item count went to zero, delete the old internal list. * If the count went < 0, or is > 0 with a NULL items list, complain. */ if ((newlw->list.items != oldlw->list.items) || (newlw->list.itemCount != oldlw->list.itemCount)) { CopyItems(newlw); /* Fix for CR 5571 */ if (newlw->list.items && (newlw->list.itemCount > 0)) { if (oldlw->list.items && (oldlw->list.itemCount > 0)) { j = oldlw->list.itemCount; oldlw->list.itemCount = 0; DeleteInternalElements(oldlw, NULL, 1, j); oldlw->list.itemCount = j; ClearItemList(oldlw); } reset_select = TRUE; newlw->list.LastItem = 0; newlw->list.LastHLItem = 0; newlw->list.InternalList = NULL; if ((newlw->list.top_position + newlw->list.visibleItemCount) > newlw->list.itemCount) newlw->list.top_position = MAX(newlw->list.itemCount - newlw->list.visibleItemCount, 0); AddInternalElements(newlw, newlw->list.items, newlw->list.itemCount, 0, TRUE); reset_max = new_size = TRUE; newlw->list.XOrigin = 0; newlw->list.CurrentKbdItem = 0; } else { if (newlw->list.itemCount == 0) { j = oldlw->list.itemCount; oldlw->list.itemCount = 0; DeleteInternalElements(oldlw, NULL, 1, j); oldlw->list.itemCount = j; ClearItemList(oldlw); newlw->list.LastItem = 0; newlw->list.LastHLItem = 0; newlw->list.InternalList = NULL; newlw->list.items = NULL; reset_select = TRUE; reset_max = new_size = TRUE; if ((newlw->list.top_position + newlw->list.visibleItemCount) > newlw->list.itemCount) newlw->list.top_position = MAX(newlw->list.itemCount - newlw->list.visibleItemCount, 0); newlw->list.XOrigin = 0; newlw->list.CurrentKbdItem = 0; } else { if ((newlw->list.itemCount > 0) && (newlw->list.items == NULL)) { XmeWarning((Widget) newlw, ListMessage12); newlw->list.items = oldlw->list.items; newlw->list.itemCount = oldlw->list.itemCount; } else { XmeWarning((Widget) newlw, ListMessage6); newlw->list.items = oldlw->list.items; newlw->list.itemCount = oldlw->list.itemCount; } } } } if (newlw->primitive.highlight_color != oldlw->primitive.highlight_color || newlw->primitive.highlight_pixmap != oldlw->primitive.highlight_pixmap) { MakeHighlightGC(newlw, (newlw->list.SelectionMode == XmADD_MODE)); } if ((newlw->primitive.foreground != oldlw->primitive.foreground) || (newlw->core.background_pixel != oldlw->core.background_pixel) || (newlw->list.font != oldlw->list.font)) { if (newlw->list.font == NULL) { XmFontList font = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); newlw->list.font = XmFontListCopy(font); } else if (newlw->list.font != oldlw->list.font) { newlw->list.font = XmFontListCopy(newlw->list.font); } if (newlw->list.font != oldlw->list.font) { XmFontListFree(oldlw->list.font); new_size = TRUE; ResetExtents(newlw, True); reset_max = FALSE; } MakeGC(newlw); redraw = TRUE; } if (newlw->list.top_position != oldlw->list.top_position) { if (newlw->list.top_position < -1) { newlw->list.top_position = oldlw->list.top_position; XmeWarning((Widget) newlw, ListMessage15); } else { /* BEGIN OSF Fix CR 5740 */ if (newlw->list.top_position == -1) newlw->list.top_position = (newlw->list.itemCount ? newlw->list.itemCount - 1 : 0); /* END OSF Fix CR 5740 */ if (oldlw->list.Traversing) DrawHighlight(oldlw, oldlw->list.CurrentKbdItem, FALSE); DrawList(newlw, NULL, TRUE); SetVerticalScrollbar(newlw); } } if (reset_select) { for (i = 0; i < newlw->list.itemCount; i++) { newlw->list.InternalList[i]->selected = OnSelectedList(newlw, newlw->list.items[i], i); newlw->list.InternalList[i]->last_selected = newlw->list.InternalList[i]->selected; } /* Only build this if selectedPositions was changed */ if (build_selected_list) { BuildSelectedList(newlw, TRUE); UpdateSelectedPositions(newlw, newlw->list.selectedItemCount); } else { UpdateSelectedPositions(newlw, RECOUNT_SELECTION); } if (!new_size) { DrawList (newlw, NULL, TRUE); SetSelectionParams(newlw); } } #ifdef FIX_1474 if (new_size || new_size_viz) #else if (new_size) #endif { redraw = TRUE; SetDefaultSize(newlw, &width, &height, reset_max, reset_max); newlw->list.BaseX = (Position)newlw->list.margin_width + newlw->list.HighlightThickness + newlw->primitive.shadow_thickness; newlw->list.BaseY = (Position)newlw->list.margin_height + newlw->list.HighlightThickness + newlw->primitive.shadow_thickness; #ifdef FIX_1474 if (((newlw->list.SizePolicy != XmCONSTANT) || !(newlw->core.width)) && new_size) #else if ((newlw->list.SizePolicy != XmCONSTANT) || !(newlw->core.width)) #endif newlw->core.width = width; newlw->core.height = height; } if (!newlw->list.FromSetNewSize) { if (newlw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(newlw); SetVerticalScrollbar(newlw); } if (newlw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(newlw, &xmim_point); if (newlw->list.font != oldlw->list.font || oldlw->list.matchBehavior != XmQUICK_NAVIGATE) XmImVaSetValues((Widget)newlw, XmNspotLocation, &xmim_point, XmNfontList, newlw->list.font, NULL); else XmImVaSetValues((Widget)newlw, XmNspotLocation, &xmim_point, NULL); } return redraw; } /************************************************************************ * * * Destroy - destroy the list instance. Free up all of our memory. * * * ************************************************************************/ static void Destroy(Widget wid) { XmListWidget lw = (XmListWidget) wid; int j; if (lw->list.drag_start_timer) XtRemoveTimeOut(lw->list.drag_start_timer); if (lw->list.DragID) XtRemoveTimeOut(lw->list.DragID); if (lw->list.NormalGC != NULL) XtReleaseGC((Widget) lw, lw->list.NormalGC); if (lw->list.InverseGC != NULL) XtReleaseGC((Widget) lw, lw->list.InverseGC); if (lw->list.HighlightGC != NULL) XtReleaseGC((Widget) lw, lw->list.HighlightGC); if (lw->list.InsensitiveGC != NULL) XtReleaseGC((Widget) lw, lw->list.InsensitiveGC); if (lw->list.scratchRend != NULL) XmRenditionFree(lw->list.scratchRend); if (lw->list.itemCount) { j = lw->list.itemCount; lw->list.itemCount = 0; DeleteInternalElements(lw, NULL, 1, j); lw->list.itemCount = j; ClearItemList(lw); } ClearSelectedList(lw); ClearSelectedPositions(lw); XmFontListFree(lw->list.font); XmImUnregister(wid); } /************************************************************************ * * * QueryProc - Look at a new geometry and add/delete scrollbars as * * needed. * * * ************************************************************************/ static XtGeometryResult QueryProc(Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *ret) { XmListWidget lw = (XmListWidget) wid; Dimension MyWidth, MyHeight, NewWidth, NewHeight, sbWidth, sbHeight; Dimension vizheight, lineheight, HSBheight = 0, VSBwidth = 0; Dimension HSBht = 0 , VSBht = 0; Dimension pad = 0, HSBbw = 0, VSBbw = 0; int viz; Boolean HasVSB, HasHSB; XtGeometryResult retval = XtGeometryYes; ret->request_mode = 0; /* If this is a request generated by our code, just return yes. */ if (lw->list.FromSetSB) return XtGeometryYes; /********* This code doesn't work, I'll find out later why, for now just out back the 1.2 code, which access the internal of ScrolledW and ScrollBar. get the pad from our parent, whatever its class is. XtVaGetValues(lw->core.parent, XmNspacing, &pad, NULL); if (lw->list.hScrollBar) { XtVaGetValues((Widget)lw->list.hScrollBar, XmNhighlightThickness, &HSBht, XmNborderWidth, &HSBbw, XmNheight, &HSBheight, NULL); } HSBht *= 2; if (lw->list.vScrollBar) { XtVaGetValues((Widget)lw->list.vScrollBar, XmNhighlightThickness, &VSBht, XmNborderWidth, &VSBbw, XmNheight, &VSBwidth, NULL); } VSBht *= 2; ****************/ pad = (lw->list.Mom ? ((XmScrolledWindowWidget)(lw->list.Mom))->swindow.pad : 0); HSBht = (lw->list.hScrollBar ? lw->list.hScrollBar->primitive.highlight_thickness * 2 : 0); HSBbw = (lw->list.hScrollBar ? lw->list.hScrollBar->core.border_width : 0); HSBheight = (lw->list.hScrollBar ? lw->list.hScrollBar->core.height : 0); VSBht = (lw->list.vScrollBar ? lw->list.vScrollBar->primitive.highlight_thickness * 2 : 0); VSBwidth = (lw->list.vScrollBar ? lw->list.vScrollBar->core.width : 0); VSBbw = (lw->list.vScrollBar ? lw->list.vScrollBar->core.border_width : 0); /*--- end of bad code (but works:-) */ /* If a preferred size query, make sure we use the last requested visible * item count for our basis. */ if (request->request_mode == 0) { viz = lw->list.visibleItemCount; /* BEGIN OSF Fix CR 6014 */ #ifdef FIX_1474 lw->list.LastSetVizCount = lw->list.visibleItemCount; #else if (lw->list.LastSetVizCount) lw->list.visibleItemCount = lw->list.LastSetVizCount; #endif /* END OSF Fix CR 6014 */ SetDefaultSize(lw, &MyWidth, &MyHeight, True, True); lw->list.visibleItemCount = viz; } else SetDefaultSize(lw, &MyWidth, &MyHeight, True, True); /* If the request mode is zero, fill out out default height & width. */ if ((request->request_mode == 0) || !lw->list.InternalList) { ret->width = MyWidth; ret->height = MyHeight; ret->request_mode = (CWWidth | CWHeight); return XtGeometryAlmost; } /* If we're not scrollable, or don' have any scrollbars, return yes. */ if ((!lw->list.Mom) || (!lw->list.vScrollBar && !lw->list.hScrollBar)) return XtGeometryYes; /**************** * * Else we're being queried from a scrolled window - look at the * dimensions and manage/unmanage the scroll bars according to the * new size. The scrolled window will take care of the actual sizing. * ****************/ if (request->request_mode & CWWidth) NewWidth = request->width; else NewWidth = lw->core.width; if (request->request_mode & CWHeight) NewHeight = request->height; else NewHeight = lw->core.height; /**************** * * Look at the dimensions and calculate if we need a scrollbar. This can * get hairy in the boundry conditions - where the addition/deletion of * one scrollbar can affect the other. * ****************/ if (((NewHeight < MyHeight) && (NewWidth < MyWidth)) || (lw->list.ScrollBarDisplayPolicy == XmSTATIC)) { HasVSB = HasHSB = TRUE; } else { /**************** * * Else we have do do some hard work. See if there is a definite * need for a horizontal scroll bar; and set the availible * height accordingly. Then, figure out how many lines will fit * in the space. If that is less than the number of items. then * fire up the vertical scrollbar. Then check to see if the act * of adding the vsb kicked in the hsb. Amazingly, it *seems* * to work right. * ****************/ lineheight = lw->list.MaxItemHeight; { /* Don't let NewHeight underflow to become a large positive # */ int borders = (2 * (lw->primitive.shadow_thickness + lw->list.HighlightThickness + lw->list.margin_height)); if ((int)NewHeight <= borders) NewHeight = 1; else NewHeight -= borders; } if ((MyWidth > NewWidth) && (lw->list.SizePolicy != XmVARIABLE)) { /* Take the height of the horizontal SB into account, but */ /* don't allow sbHeight to underflow to a large positive number. */ int borders = HSBheight + HSBht + HSBbw*2 + pad; if ((int)NewHeight <= borders) sbHeight = 1; else sbHeight = NewHeight - borders; } else sbHeight = NewHeight; viz = 0; vizheight = lineheight; while (vizheight <= sbHeight) { vizheight += lineheight + lw->list.spacing; viz++; } if (!viz) viz++; HasVSB = (lw->list.itemCount > viz); if (HasVSB) { /* Take the width of the vertical SB into account, but don't */ /* allow sbWidth to underflow to a large positive number */ int borders = VSBwidth + VSBht + VSBbw*2 + pad; if ((int)NewWidth <= borders) sbWidth = 1; else sbWidth = NewWidth - borders; } else sbWidth = NewWidth; HasHSB = (MyWidth > sbWidth); } if (lw->list.vScrollBar) { if (HasVSB) XtManageChild((Widget) lw->list.vScrollBar); else XtUnmanageChild((Widget) lw->list.vScrollBar); } if (lw->list.hScrollBar) { if (HasHSB && (lw->list.SizePolicy != XmVARIABLE)) XtManageChild((Widget) lw->list.hScrollBar); else XtUnmanageChild((Widget) lw->list.hScrollBar); } return retval; } /* * Dynamic default for ScrollBarDisplayPolicy based on the * type of CDE FileSB parent */ /*ARGSUSED*/ static void ScrollBarDisplayPolicyDefault(Widget widget, int offset, /* unused */ XrmValue *value) { static unsigned char sb_display_policy; value->addr = (XPointer) &sb_display_policy; /* If this is a scrolledlist in a filesb */ if (XmIsScrolledWindow(XtParent(widget)) && XmIsFileSelectionBox(XtParent(XtParent(widget)))) { XtEnum path_mode; XtVaGetValues(XtParent(XtParent(widget)), XmNpathMode, &path_mode, NULL); if (path_mode == XmPATH_MODE_RELATIVE) sb_display_policy = XmAS_NEEDED; else sb_display_policy = XmSTATIC; } else sb_display_policy = XmAS_NEEDED; } /* * XmRCallProc routine for checking list.font before setting it to NULL * if no value is specified for both XmNrenderTable and XmNfontList. * If MouseMoved == True then function has been called twice on same widget, thus * resource needs to be set NULL, otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmListWidget lw = (XmListWidget)wid; if (lw->list.MouseMoved) value->addr = NULL; else { value->addr = (char*)&(lw->list.font); lw->list.MouseMoved = True; } } /************************************************************************ * * * Conversion routines for XmNtopItemPostion. Necessary because the * * outside world is 1-based, and the inside world is 0-based. Sigh. * * * ************************************************************************/ /*ARGSUSED*/ static void CvtToExternalPos(Widget wid, int offset, XtArgVal *value) { XmListWidget lw = (XmListWidget) wid; (*value) = (XtArgVal) (lw->list.top_position + 1); } /*ARGSUSED*/ static XmImportOperator CvtToInternalPos(Widget wid, int offset, XtArgVal *value) { (* (int *) value)--; return XmSYNTHETIC_LOAD; } /************************************************************************ * * * Visiual Routines * * * ************************************************************************/ /************************************************************************ * * * DrawListShadow - draw the shadow * * * ************************************************************************/ static void DrawListShadow(XmListWidget w) { XmeDrawShadows(XtDisplay(w), XtWindow(w), w->primitive.bottom_shadow_GC, w->primitive.top_shadow_GC, 0, 0, (int)w->core.width, (int)w->core.height, w->primitive.shadow_thickness, XmSHADOW_OUT); } static Dimension CalcVizWidth(XmListWidget lw) { /* Don't allow underflow */ int borders = 2 * ((int)lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness); if ((int)lw->core.width <= borders) return 1; else return lw->core.width - borders; } /************************************************************************ * * * DrawList - draw the contents of the list. * * * ************************************************************************/ /*ARGSUSED*/ static void DrawList(XmListWidget lw, XEvent *event, Boolean all) { Position y = 0; int top, num; if (!XtIsRealized((Widget)lw)) return; if (lw->list.items && lw->list.itemCount) { SetClipRect(lw); lw->list.BaseY = ((int)lw->list.margin_height + lw->list.HighlightThickness + lw->primitive.shadow_thickness); top = lw->list.top_position; num = top + lw->list.visibleItemCount; ASSIGN_MIN(num, lw->list.itemCount); DrawItems(lw, top, num, all); if (top < num) y = LINEHEIGHTS(lw, num - top - 1) + lw->list.BaseY; y += lw->list.MaxItemHeight; { /* Don't allow underflow! */ int available_height; if (lw->core.height <= (Dimension)lw->list.BaseY) available_height = 1; else available_height = lw->core.height - lw->list.BaseY; if (y < available_height) XClearArea (XtDisplay (lw), XtWindow (lw), lw->list.BaseX, y, CalcVizWidth(lw), (available_height - y), False); } if (lw->list.Traversing) { if (lw->list.CurrentKbdItem >= lw->list.itemCount) lw->list.CurrentKbdItem = lw->list.itemCount - 1; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } } } /************************************************************************ * * * DrawItem - Draw the specified item from the internal list. * * * ************************************************************************/ static void DrawItem(Widget w, int position) { XmListWidget lw = (XmListWidget) w; if (!XtIsRealized((Widget)lw)) return; if ((position >= lw->list.itemCount) || (position < lw->list.top_position)|| (position >= (lw->list.top_position + lw->list.visibleItemCount))) return; if (lw->list.InternalList[position]->selected == lw->list.InternalList[position]->LastTimeDrawn) return; SetClipRect(lw); DrawItems(lw, position, position + 1, TRUE); } /************************************************************************ * * * DrawItems - draw some list items. * * * ************************************************************************/ /*ARGSUSED*/ static void DrawItems(XmListWidget lw, int top, int bot, Boolean all) { int pos; Position x, y = 0; int width = CalcVizWidth(lw); GC gc; if (LayoutIsRtoLP(lw)) x = lw->list.BaseX + lw->list.XOrigin; else x = lw->list.BaseX - lw->list.XOrigin; for (pos = top; pos < bot; pos++) { y = LINEHEIGHTS(lw, pos - lw->list.top_position) + lw->list.BaseY; if (!all && (lw->list.InternalList[pos]->selected == lw->list.InternalList[pos]->LastTimeDrawn)) break; lw->list.InternalList[pos]->LastTimeDrawn = lw->list.InternalList[pos]->selected; /* Need to pad dimensions by one because of X fill semantics. */ XFillRectangle(XtDisplay(lw), XtWindow(lw), ((lw->list.InternalList[pos]->selected) ? lw->list.NormalGC : lw->list.InverseGC), #ifdef FIX_1365 lw->list.BaseX, y - 1, width + 1, lw->list.MaxItemHeight + 1); #else lw->list.BaseX, y, width + 1, lw->list.MaxItemHeight); #endif if (XtIsSensitive((Widget)lw)) gc = ((lw->list.InternalList[pos]->selected) ? lw->list.InverseGC : lw->list.NormalGC); else #ifdef FIX_1381 { gc = lw->list.InsensitiveGC; _XmRendFG(lw->list.scratchRend) = _XmAssignInsensitiveColor((Widget)lw); } #else gc = lw->list.InsensitiveGC; #endif /* CR 7281: Set rendition background too. */ if ((lw->list.InternalList[pos]->selected) && (lw->list.selectColor == XmREVERSED_GROUND_COLORS)) { /* CR 7635: Fix selected insensitive item stippling. */ if (XtIsSensitive((Widget)lw)) { _XmRendFG(lw->list.scratchRend) = lw->core.background_pixel; _XmRendBG(lw->list.scratchRend) = lw->primitive.foreground; } else #ifdef FIX_1381 _XmRendBG(lw->list.scratchRend) = lw->core.background_pixel; #else { _XmRendFG(lw->list.scratchRend) = lw->primitive.foreground; _XmRendBG(lw->list.scratchRend) = lw->core.background_pixel; } #endif _XmRendFGState(lw->list.scratchRend) = XmFORCE_COLOR; _XmRendBGState(lw->list.scratchRend) = XmFORCE_COLOR; } else { #ifdef FIX_1381 if (XtIsSensitive((Widget)lw)) { _XmRendFG(lw->list.scratchRend) = lw->primitive.foreground; _XmRendFGState(lw->list.scratchRend) = XmAS_IS; _XmRendBG(lw->list.scratchRend) = lw->core.background_pixel; _XmRendBGState(lw->list.scratchRend) = XmAS_IS; } else _XmRendBG(lw->list.scratchRend) = lw->core.background_pixel; #else _XmRendFG(lw->list.scratchRend) = lw->primitive.foreground; _XmRendFGState(lw->list.scratchRend) = XmAS_IS; _XmRendBG(lw->list.scratchRend) = lw->core.background_pixel; _XmRendBGState(lw->list.scratchRend) = XmAS_IS; #endif } _XmRendGC(lw->list.scratchRend) = gc; #ifdef USE_XFT _XmRendXftFG(lw->list.scratchRend) = _XmXftGetXftColor(XtDisplay(lw), _XmRendFG(lw->list.scratchRend)); #endif #ifdef FIX_1381 if (!XtIsSensitive((Widget)lw)) { /*Draw shadow for insensitive text*/ Pixel p; p = _XmRendFG(lw->list.scratchRend); _XmRendFG(lw->list.scratchRend) = lw->primitive.top_shadow_color; _XmStringRender(XtDisplay(lw), XtWindow(lw), lw->list.font, lw->list.scratchRend, (_XmString)lw->list.items[pos], x + 1, y + 1 + ((int)(lw->list.MaxItemHeight - lw->list.InternalList[pos]->height) >> 1), width, XmALIGNMENT_BEGINNING, lw->list.StrDir); _XmRendFG(lw->list.scratchRend) = p; } #endif /* CR 9204: Let _XmStringRender handle right-to-left drawing. */ _XmStringRender(XtDisplay(lw), XtWindow(lw), lw->list.font, lw->list.scratchRend, (_XmString)lw->list.items[pos], x, y + ((int)(lw->list.MaxItemHeight - lw->list.InternalList[pos]->height) >> 1), width, XmALIGNMENT_BEGINNING, lw->list.StrDir); } } /************************************************************************ * * * DrawHighlight - Draw or clear the traversal highlight on an item. * * * ************************************************************************/ static void DrawHighlight(XmListWidget lw, int position, Boolean on) { Dimension width, height, ht; Position x, y; XRectangle rect; if (!XtIsRealized((Widget)lw) || !lw->list.Traversing || (lw->list.HighlightThickness < 1)) return; ht = lw->list.HighlightThickness; x = lw->list.BaseX - ht; width = lw->core.width - 2 * ((int)lw->list.margin_width + lw->primitive.shadow_thickness); /**************** * * First check for an "invisible" highlight... * ****************/ if ((position < lw->list.top_position) || (lw->list.items == NULL) || (lw->list.itemCount == 0) || (position >= (lw->list.top_position + lw->list.visibleItemCount))) { y = lw->list.BaseY - ht; height = lw->core.height - 2 * ((int)lw->list.margin_height + lw->primitive.shadow_thickness); } else { if (position >= lw->list.itemCount) position = lw->list.itemCount - 1; y = (LINEHEIGHTS(lw, position - lw->list.top_position) + lw->list.BaseY - ht); height = lw->list.MaxItemHeight + (2 * ht); } if (width <= 0 || height <= 0) return; { /* Set highlight clip */ rect.x = x; rect.y = lw->list.BaseY - ht; rect.width = width; rect.height = lw->core.height - 2 * rect.y; XSetClipRectangles(XtDisplay(lw), lw->list.HighlightGC, 0, 0, &rect, 1, Unsorted); } ht = lw->primitive.highlight_thickness; if (on) { if (lw->list.SelectionMode == XmADD_MODE) { ChangeHighlightGC(lw, True); _XmDrawHighlight(XtDisplay (lw), XtWindow (lw), lw->list.HighlightGC, x, y, width, height, ht, LineDoubleDash); } else XmeDrawHighlight(XtDisplay (lw), XtWindow (lw), lw->list.HighlightGC, x, y, width, height, ht); } else { XmeClearBorder(XtDisplay (lw), XtWindow (lw), x, y, width, height, ht); } } /************************************************************************ * * * SetClipRect - set a clipping rectangle for the visible area of the * * list. * * * ************************************************************************/ static void SetClipRect(XmListWidget widget) { XmListWidget lw = widget; Position x,y, ht; Dimension w,h; XRectangle rect; ht = lw->list.HighlightThickness; x = lw->list.margin_width + ht + lw->primitive.shadow_thickness; y = lw->list.margin_height + ht + lw->primitive.shadow_thickness; w = ((int)lw->core.width <= 2 * x) ? 1 : (lw->core.width - (2 * x)); h = ((int)lw->core.height <= 2 * y) ? 1 : (lw->core.height - (2 * y)); rect.x = 0; rect.y = 0; rect.width = w; rect.height = h; #ifdef USE_XFT _XmXftSetClipRectangles(XtDisplay(lw), XtWindow(lw), x, y, &rect, 1); #endif if (lw->list.NormalGC) XSetClipRectangles(XtDisplay(lw), lw->list.NormalGC, x, y, &rect, 1, Unsorted); if (lw->list.InverseGC) XSetClipRectangles(XtDisplay(lw), lw->list.InverseGC, x, y, &rect, 1, Unsorted); if (lw->list.InsensitiveGC) XSetClipRectangles(XtDisplay(lw), lw->list.InsensitiveGC, x, y, &rect, 1, Unsorted); /* Set highlight clip in DrawHighlight */ } /*************************************************************************** * * * SetDefaultSize * * Take an instance of the list widget and figure out how big the list * * work area should be. This uses the last set visible item count, because * * that's really what we want for a default. * * * ***************************************************************************/ static void SetDefaultSize(XmListWidget lw, Dimension *width, Dimension *height, Boolean reset_max_width, Boolean reset_max_height) { int visheight, wideborder, viz; XFontStruct *fs = (XFontStruct *)NULL; wideborder = 2 * (lw->primitive.shadow_thickness + lw->list.HighlightThickness + lw->list.margin_width); /* BEGIN OSF Fix CR 5460, 6014 */ if (lw->list.LastSetVizCount) viz = lw->list.LastSetVizCount; else viz = lw->list.visibleItemCount; /* END OSF Fix CR 5460, 6014 */ if (lw->list.itemCount == 0) { #if USE_XFT int height = 0; XmRenderTableGetDefaultFontExtents(lw->list.font, &height, NULL, NULL); lw->list.MaxItemHeight = (Dimension)height; if (lw->list.MaxItemHeight == 0) lw->list.MaxItemHeight = 1; #else if (XmeRenderTableGetDefaultFont(lw->list.font, &fs)) lw->list.MaxItemHeight = fs->ascent + fs->descent; else lw->list.MaxItemHeight = 1; #endif } else if (reset_max_width || reset_max_height) { ResetExtents(lw, False); } if (viz > 0) visheight = (LINEHEIGHTS(lw, viz - 1) + lw->list.MaxItemHeight); else visheight = lw->list.MaxItemHeight; *height = visheight + (2 * (lw->primitive.shadow_thickness + lw->list.HighlightThickness + lw->list.margin_height)); if (lw->list.itemCount == 0) lw->list.MaxWidth = visheight >> 1; /* If no list, but realized, stay the same width. */ if ((lw->list.itemCount) || (!XtIsRealized((Widget)lw))) *width = lw->list.MaxWidth + wideborder; else *width = lw->core.width; } /************************************************************************ * * * MakeGC - Get the GC's for normal and inverse. * * * ************************************************************************/ static void MakeGC(XmListWidget lw) { XGCValues values; XtGCMask modifyMask; XtGCMask valueMask; XFontStruct *fs = (XFontStruct *) NULL; valueMask = GCForeground | GCBackground | GCClipMask | GCGraphicsExposures; if (lw->list.NormalGC != NULL) XtReleaseGC((Widget) lw, lw->list.NormalGC); if (lw->list.InverseGC != NULL) XtReleaseGC((Widget) lw, lw->list.InverseGC); if (lw->list.InsensitiveGC != NULL) XtReleaseGC((Widget) lw, lw->list.InsensitiveGC); /* * This is sloppy - get the default font and use it for the GC. * The StringDraw routines will change it if needed. */ if (XmeRenderTableGetDefaultFont(lw->list.font, &fs)) values.font = fs->fid, valueMask |= GCFont; values.graphics_exposures = False; if (lw->list.selectColor == XmREVERSED_GROUND_COLORS) values.foreground = lw->primitive.foreground; else values.foreground = lw->list.selectColor; values.background = lw->core.background_pixel; values.clip_mask = None; /* CR 7663: SetClipRect() modifies the clip rectangles. */ modifyMask = GCClipMask | GCClipXOrigin | GCClipYOrigin; lw->list.NormalGC = XtAllocateGC((Widget) lw, lw->core.depth, valueMask, &values, modifyMask, 0); values.foreground = lw->core.background_pixel; values.background = lw->primitive.foreground; lw->list.InverseGC = XtAllocateGC((Widget) lw, lw->core.depth, valueMask, &values, modifyMask, 0); values.background = lw->core.background_pixel; #ifdef FIX_1381 /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor((Widget)lw); #else values.foreground = lw->primitive.foreground; valueMask |= GCStipple | GCFillStyle; values.fill_style = FillOpaqueStippled; values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw); #endif lw->list.InsensitiveGC = XtAllocateGC((Widget) lw, lw->core.depth, valueMask, &values, modifyMask, 0); } /************************************************************************ * * * MakeHighlightGC - Get the graphics context used for drawing the * * highlight border. I have to use my own because I * * need to set a clip rectangle, and I don't want to * * do that on the standard one (it's cached and * * shared among instances - that's the same reason I * * have to use the X calls.) * * * ************************************************************************/ static void MakeHighlightGC(XmListWidget lw, Boolean AddMode) { XGCValues values; XtGCMask valueMask; XtGCMask modifyMask; valueMask = (GCForeground | GCBackground | GCLineWidth | GCLineStyle | GCDashList); values.foreground = lw->primitive.highlight_color; values.background = lw->core.background_pixel; values.line_width = lw->primitive.highlight_thickness; values.dashes = MAX(values.line_width, 8); values.line_style = (AddMode) ? LineDoubleDash : LineSolid; if (lw->list.HighlightGC != NULL) XtReleaseGC((Widget) lw, lw->list.HighlightGC); modifyMask = (GCLineStyle | GCLineWidth | GCDashList | GCClipXOrigin | GCClipYOrigin | GCClipMask); lw->list.HighlightGC = XtAllocateGC((Widget) lw, lw->core.depth, valueMask, &values, modifyMask, 0); } /************************************************************************ * * * ChangeHighlightGC - change the highlight GC for add mode. If * * AddMode is true, change the fill style to dashed. Else set the * * fill style to solid * * * ************************************************************************/ static void ChangeHighlightGC(XmListWidget lw, Boolean AddMode) { XtGCMask valueMask; XGCValues values; valueMask = GCLineStyle | GCLineWidth | GCDashList; values.line_width = lw->primitive.highlight_thickness; values.dashes = MAX(values.line_width, 8); values.line_style = (AddMode) ? LineDoubleDash : LineSolid; if (lw->list.HighlightGC) XChangeGC (XtDisplay(lw), lw->list.HighlightGC, valueMask, &values); } /************************************************************************ * * * SetVerticalScrollbar - set up all the vertical scrollbar stuff. * * * * Set up on an item basis. Min is 0, max is ItemCount, origin is * * top_position, extent is visibleItemCount. * * * ************************************************************************/ static Boolean SetVerticalScrollbar(XmListWidget lw) { int viz; XmNavigatorDataRec nav_data; Boolean was_managed, is_managed; if ((!lw->list.Mom) || (!lw->list.vScrollBar) || (lw->list.FromSetSB)) return False; lw->list.FromSetSB = TRUE; viz = ComputeVizCount(lw); was_managed = XtIsManaged((Widget) lw->list.vScrollBar); if (lw->list.ScrollBarDisplayPolicy == XmAS_NEEDED) { if (((lw->list.itemCount <= viz) && (lw->list.top_position == 0)) || (lw->list.itemCount == 0)) XtUnmanageChild((Widget) lw->list.vScrollBar); else XtManageChild((Widget) lw->list.vScrollBar); } else XtManageChild((Widget) lw->list.vScrollBar); is_managed = XtIsManaged((Widget) lw->list.vScrollBar); if (lw->list.items && lw->list.itemCount) { int vmax = lw->list.itemCount; int vOrigin = lw->list.top_position; int vExtent = MIN(lw->list.visibleItemCount, lw->list.itemCount); /* CR 8889: Size slider based on visible item count. */ ASSIGN_MAX(vmax, vExtent + vOrigin); nav_data.value.y = vOrigin; nav_data.minimum.y = 0; nav_data.maximum.y = vmax; nav_data.slider_size.y = vExtent; nav_data.increment.y = 1; nav_data.page_increment.y = ((lw->list.visibleItemCount > 1) ? lw->list.visibleItemCount - 1 : 1); nav_data.dimMask = NavigDimensionY; nav_data.valueMask = (NavValue | NavMinimum | NavMaximum | NavSliderSize | NavIncrement | NavPageIncrement); _XmSFUpdateNavigatorsValue(XtParent((Widget)lw), &nav_data, True); } else if (XtIsManaged((Widget) lw->list.vScrollBar)) { nav_data.value.y = 0; nav_data.minimum.y = 0; nav_data.maximum.y = 1; nav_data.slider_size.y = 1; nav_data.increment.y = 1; nav_data.page_increment.y = 1; nav_data.dimMask = NavigDimensionY; nav_data.valueMask = (NavValue | NavMinimum | NavMaximum | NavSliderSize | NavIncrement | NavPageIncrement); _XmSFUpdateNavigatorsValue(XtParent((Widget)lw), &nav_data, True); } lw->list.FromSetSB = FALSE; return (was_managed != is_managed); } /************************************************************************ * * * SetHorizontalScrollbar - set up all the horizontal scrollbar stuff. * * * * This is set up differently than the vertical scrollbar. This is on a * * pixel basis, so redraws are kinda slow. Min is 0, max is (MaxWidth * * + 2*border). * * * ************************************************************************/ static Boolean SetHorizontalScrollbar(XmListWidget lw) { Arg hSBArgs[1]; int j = 0, listwidth; Dimension pginc; XmNavigatorDataRec nav_data; Boolean was_managed, is_managed; if ((!lw->list.Mom) || (!lw->list.hScrollBar) || (lw->list.FromSetSB)) return False; lw->list.FromSetSB = TRUE; listwidth = lw->core.width - 2 * (int)(lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness); was_managed = XtIsManaged((Widget) lw->list.vScrollBar); if (lw->list.ScrollBarDisplayPolicy == XmAS_NEEDED) { /* CR 9663: Hide scrollbars in empty lists. */ if ((lw->list.MaxWidth <= (Dimension)listwidth) || (lw->list.itemCount == 0)) { lw->list.BaseX = ((int) lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness); lw->list.XOrigin = 0; XtUnmanageChild((Widget) lw->list.hScrollBar); } else XtManageChild((Widget) lw->list.hScrollBar); } else XtManageChild((Widget) lw->list.hScrollBar); is_managed = XtIsManaged((Widget) lw->list.vScrollBar); if (lw->list.items && lw->list.itemCount) { if (LayoutIsRtoLP(lw)) XtSetArg(hSBArgs[j], XmNprocessingDirection, XmMAX_ON_LEFT), j++; else XtSetArg(hSBArgs[j], XmNprocessingDirection, XmMAX_ON_RIGHT), j++; assert(j <= XtNumber(hSBArgs)); XtSetValues((Widget) lw->list.hScrollBar, hSBArgs, j); lw->list.hmax = lw->list.MaxWidth + (lw->list.BaseX * 2); lw->list.hExtent = lw->core.width; ASSIGN_MAX(lw->list.XOrigin, 0); lw->list.hOrigin = lw->list.XOrigin; if ((lw->list.hExtent + lw->list.hOrigin) > lw->list.hmax) lw->list.hExtent = lw->list.hmax - lw->list.hOrigin; pginc = ((listwidth <= CHAR_WIDTH_GUESS) ? 1 : (listwidth - CHAR_WIDTH_GUESS)); if (pginc > lw->core.width) pginc = 1; nav_data.value.x = lw->list.hOrigin; nav_data.minimum.x = lw->list.hmin; nav_data.maximum.x = lw->list.hmax; nav_data.slider_size.x = lw->list.hExtent; nav_data.increment.x = CHAR_WIDTH_GUESS; nav_data.page_increment.x = pginc; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)lw), &nav_data, True); } else if (XtIsManaged((Widget) lw->list.hScrollBar)) { nav_data.value.x = 0; nav_data.minimum.x = 0; nav_data.maximum.x = 1; nav_data.slider_size.x = 1; nav_data.increment.x = 1; nav_data.page_increment.x = 1; nav_data.dimMask = NavigDimensionX; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement; _XmSFUpdateNavigatorsValue(XtParent((Widget)lw), &nav_data, True); } lw->list.FromSetSB = FALSE; return (was_managed != is_managed); } /************************************************************************ * * * SetNewSize - see if we need a new size. If so, do it. If the * * current item count is different from the desired count, calc a new * * height and width. Else just look at the width and change if needed. * * * * NOTE: THIS CAN ONLY BE CALLED FROM THE API ROUTINES, SINCE IT USES * * SETVALUES. * * * ************************************************************************/ static void SetNewSize(XmListWidget lw, Boolean reset_max_width, Boolean reset_max_height, Dimension old_max_height) { Dimension width, height; Boolean resized = FALSE; lw->list.FromSetNewSize = TRUE; SetDefaultSize(lw, &width, &height, reset_max_width, reset_max_height); if (lw->list.SizePolicy == XmCONSTANT) width = lw->core.width; if ((width != lw->core.width) || (height != lw->core.height)) { Arg args[2]; Cardinal nargs = 0; unsigned char units = lw->primitive.unit_type; Dimension old_width = XtWidth((Widget)lw); Dimension old_height = XtHeight((Widget)lw); lw->primitive.unit_type = XmPIXELS; XtSetArg(args[nargs], XmNwidth, (XtArgVal)width), nargs++; XtSetArg(args[nargs], XmNheight, (XtArgVal)height), nargs++; assert(nargs <= XtNumber(args)); XtSetValues((Widget) lw, args, nargs); lw->primitive.unit_type = units; resized = ((old_width != XtWidth((Widget)lw)) || (old_height != XtHeight((Widget)lw))); } /* CR 9488: Redraw and update visible item count if resize fails. */ if (!resized && (old_max_height != lw->list.MaxItemHeight)) { lw->list.visibleItemCount = ComputeVizCount(lw); CleanUpList(lw, True); DrawList(lw, NULL, True); } lw->list.FromSetNewSize = FALSE; } /************************************************************************ * * * ResetExtents - recalculate the cumulative extents of the list items. * * Called when the font or spacing changes. Computing individual * * dimenensions is just as expensive as computing both at once. * * * ************************************************************************/ static void ResetExtents(XmListWidget lw, Boolean recache_extents) { register int i; Dimension maxheight = 0; Dimension maxwidth = 0; if (!lw->list.InternalList || !lw->list.itemCount) return; for (i = 0; i < lw->list.itemCount; i++) { ElementPtr item = lw->list.InternalList[i]; if (recache_extents) XmStringExtent(lw->list.font, lw->list.items[i], &item->width, &item->height); ASSIGN_MAX(maxheight, item->height); ASSIGN_MAX(maxwidth, item->width); } lw->list.MaxItemHeight = maxheight; lw->list.MaxWidth = maxwidth; } /************************************************************************ * * * Item/Element Manupulation routines * * * ************************************************************************/ /* BEGIN OSF Fix CR 4656 */ /************************************************************************ * * * FixStartEnd - reset the (Old)StartItem and (Old)EndItem * * instance variables after a deletion based on the postion of * * the item deleted. * * * ************************************************************************/ static void FixStartEnd(XmListWidget lw, int pos, int count, int *start, int *end) { /* Range selections can leave start and end "backwards". */ if (*start > *end) { int save = *start; *start = *end; *end = save; } if (*start < 0) *start = 0; if (*end >= lw->list.itemCount) *end = lw->list.itemCount - 1; /* No overlap, before the deleted range. */ if (*end < pos) return; /* No overlap, after the deleted range. */ if (*start >= (pos + count)) { (*start) -= count; (*end) -= count; return; } /* Fixup the starting position. */ if (*start > pos) *start = pos; /* Fixup the end position. */ if (*end < (pos + count)) *end = pos - 1; else *end -= count; /* Normalize empty selections. */ if (*start > *end) *start = *end = 0; } /* END OSF Fix CR 4656 */ /*************************************************************************** * * * AddInternalElements() * * * * Takes elements from the items list and adds them to the internal list. * * NOTE: This code relies on the caller to insure that the list.itemCount * * field reflects the new total size of the list. * * * ***************************************************************************/ static int AddInternalElements(XmListWidget lw, XmString *items, int nitems, int position, Boolean selectable) { int pos; ElementPtr new_el; int i; int nsel = 0; if (nitems <= 0) return nsel; /* CR 9663: Discard default width when we get real items. */ if (lw->list.LastItem == 0) lw->list.MaxWidth = 0; if (position) pos = position - 1; else pos = lw->list.LastItem; lw->list.InternalList = (ElementPtr *) XtRealloc((char *)lw->list.InternalList, (sizeof(Element *) * lw->list.itemCount)); /* Make room in the InternalList for the new items. */ if (pos < lw->list.LastItem) memmove((char*)(lw->list.InternalList + pos + nitems), (char*)(lw->list.InternalList + pos), (lw->list.LastItem - pos) * sizeof(ElementPtr)); for (i = 0; i < nitems; i++) { new_el = (ElementPtr)XtMalloc(sizeof(Element)); /* Store an alias for string in the internal table. */ assert(items[i] == lw->list.items[pos]); new_el->length = UNKNOWN_LENGTH; XmStringExtent(lw->list.font, items[i], &new_el->width, &new_el->height); ASSIGN_MAX(lw->list.MaxWidth, new_el->width); ASSIGN_MAX(lw->list.MaxItemHeight, new_el->height); new_el->selected = (selectable && OnSelectedList(lw, items[i], pos)); new_el->last_selected = new_el->selected; new_el->LastTimeDrawn = !new_el->selected; if (new_el->selected) nsel++; new_el->first_char = 0; lw->list.InternalList[pos] = new_el; pos++; } lw->list.LastItem += nitems; return nsel; } /*************************************************************************** * * * DeleteInternalElements() * * * * Deletes elements from the internal list. If position is 0, we look * * for the specified string; if the string is NULL we look for specified * * position. * * NOTE: This code relies on the caller to insure that the list.itemCount * * field reflects the new total size of the list. * * * * ALSO NOTE that this function is sometimes called just after * * DeleteItems. This function expects position to be ONE * * based, while the other expects position to be ZERO based. * * * ***************************************************************************/ static int DeleteInternalElements(XmListWidget lw, XmString string, int position, int count) { Element *item; int curpos; int dsel = 0; int i; if (!position && string) position = ItemNumber(lw, string); if (!position) { XmeWarning((Widget) lw, ListMessage8); return 0; } curpos = position - 1; for (i = 0; i < count; i++) { item = lw->list.InternalList[curpos + i]; if (item->selected) dsel--; XtFree((char *)item); } /* If we didn't delete the end of the list repack it. */ if (curpos < lw->list.itemCount) memmove((char*)(lw->list.InternalList + curpos), (char*)(lw->list.InternalList + curpos + count), (lw->list.itemCount - curpos) * sizeof(ElementPtr)); lw->list.LastItem -= count; /* BEGIN OSF Fix CR 4656 */ /* Fix selection delimiters. */ FixStartEnd(lw, curpos, count, &lw->list.StartItem, &lw->list.EndItem); FixStartEnd(lw, curpos, count, &lw->list.OldStartItem, &lw->list.OldEndItem); /* END OSF Fix CR 4656 */ if (lw->list.itemCount) { lw->list.InternalList = (ElementPtr *) XtRealloc((char *) lw->list.InternalList, (sizeof(Element *) * lw->list.itemCount)); } else { XtFree((char*) lw->list.InternalList); lw->list.InternalList = NULL; } return dsel; } /*************************************************************************** * * * DeleteInternalElementPositions * * * ***************************************************************************/ static int DeleteInternalElementPositions(XmListWidget lw, int *position_list, int position_count, int oldItemCount) { ElementPtr ptr; int ix; int jx; int item_pos; Boolean reset_width = FALSE; Boolean reset_height = FALSE; int nsel = 0; /* See what caller can do to flag errors, if necessary, * when this information is not present. */ if (!position_list || !position_count) return nsel; /* Prepare ourselves to do a series of deletes. Scan the position_list * to free deleted positions. Set each freed position to NULL. Do not * try to refree already deleted positions. * * Any invalid position must be caught by the calling routine. These * positions have to be marked with a -1 to be ignored. * * This function can work in tandem with DeleteItemPositions which * will reset list.itemCount (just as DeleteItem does). This is * why we must have oldItemCount passed to us. */ for (ix = 0; ix < position_count; ix++) { item_pos = position_list[ ix ] - 1; if (item_pos >= 0 && item_pos < oldItemCount) { if ((ptr = lw->list.InternalList[item_pos]) != NULL) { reset_width |= (ptr->width >= lw->list.MaxWidth); reset_height |= (ptr->height >= lw->list.MaxItemHeight); if (ptr->selected) nsel--; XtFree((char*) ptr); lw->list.InternalList[item_pos] = NULL; lw->list.LastItem--; /* BEGIN OSF Fix CR 4656 */ /* Fix selection delimiters. */ FixStartEnd(lw, item_pos, 1, &lw->list.StartItem, &lw->list.EndItem); /* Fix old selection delimiters. */ FixStartEnd(lw, item_pos, 1, &lw->list.OldStartItem, &lw->list.OldEndItem); /* END OSF Fix CR 4656 */ } } } /* * The fixups above may leave a non-existent selection if multiple * selected items are deleted from the end of the list. */ if (oldItemCount > lw->list.itemCount) { FixStartEnd(lw, lw->list.itemCount, oldItemCount - lw->list.itemCount, &lw->list.StartItem, &lw->list.EndItem); FixStartEnd(lw, lw->list.itemCount, oldItemCount - lw->list.itemCount, &lw->list.OldStartItem, &lw->list.OldEndItem); } /* Re-pack InternalList in place. */ jx = 0; for (ix = 0; ix < oldItemCount; ix++) { if (lw->list.InternalList[ ix ] != NULL) { lw->list.InternalList[ jx ] = lw->list.InternalList[ ix ]; jx++; } } if (lw->list.itemCount) { lw->list.InternalList = (ElementPtr*) XtRealloc((char*) lw->list.InternalList, (sizeof(ElementPtr) * lw->list.itemCount)); } else { XtFree((char*) lw->list.InternalList); lw->list.InternalList = NULL; } /* The actual maximum width and height may not have changed. */ if (reset_width && lw->list.itemCount && (lw->list.InternalList[0]->width >= lw->list.MaxWidth)) reset_width = FALSE; if (reset_height && lw->list.itemCount && (lw->list.InternalList[0]->height >= lw->list.MaxItemHeight)) reset_height = FALSE; if (reset_width || reset_height) ResetExtents(lw, False); return nsel; } /*************************************************************************** * * * ReplaceInternalElement(lw, position, selected) * * * * Replaces the existing internal item with the specified new one. The new * * item is constructed by looking at the list.items - this means that the * * external one has to be replaced first! Note that this does not reset * * the CumHeight fields - it's up to the caller to do that. * * * * Returns the change in the number of selected positions. * * * ***************************************************************************/ static int ReplaceInternalElement(XmListWidget lw, int position, Boolean selectable) { int curpos = position - 1; Element *item = lw->list.InternalList[curpos]; int dsel = (item->selected ? -1 : 0); XmString name = lw->list.items[curpos]; /* The old name is an alias for an entry in the items list. */ item->first_char = 0; item->length = UNKNOWN_LENGTH; XmStringExtent(lw->list.font, name, &item->width, &item->height); item->selected = (selectable && OnSelectedList(lw, name, curpos)); item->last_selected = item->selected; item->LastTimeDrawn = !item->selected; ASSIGN_MAX(lw->list.MaxWidth, item->width); ASSIGN_MAX(lw->list.MaxItemHeight, item->height); dsel += (item->selected ? 1 : 0); return dsel; } /************************************************************************ * * * AddItems - add items to the item list at the specified position * * * ************************************************************************/ static void AddItems(XmListWidget lw, XmString *items, int nitems, int pos) { int i; int TotalItems = lw->list.itemCount + nitems; lw->list.items = (XmString *) XtRealloc((char *) lw->list.items, (sizeof(XmString) * (TotalItems))); /* Make a gap in the array for the new items. */ if (pos < lw->list.itemCount) memmove((char*) (lw->list.items + pos + nitems), (char*) (lw->list.items + pos), (lw->list.itemCount - pos) * sizeof(XmString)); /* Insert the new items into the array. */ for (i = 0; i < nitems; i++) lw->list.items[pos + i] = XmStringCopy(items[i]); lw->list.itemCount = TotalItems; } /************************************************************************ * * * DeleteItems - delete items from the item list. * * * * Note that this function is sometimes called just before * * DeleteInternalElements. This function expects position to be * * ZERO based, while the other expects position to be ONE based. * * * * ON DELETE, DO WE UPDATE MAXWIDTH?? * * * ************************************************************************/ static void DeleteItems(XmListWidget lw, int nitems, int pos) { int i; int TotalItems; if ((lw->list.itemCount < 1) || (nitems <= 0)) return; TotalItems = lw->list.itemCount - nitems; for (i = 0; i < nitems; i++) XmStringFree(lw->list.items[pos + i]); if (pos < TotalItems) memmove((char*) (lw->list.items + pos), (char*) (lw->list.items + pos + nitems), (TotalItems - pos) * sizeof(XmString)); if (TotalItems) { lw->list.items = (XmString *) XtRealloc((char *) lw->list.items, TotalItems * sizeof(XmString)); } else { /* Null out the list pointer, if we have deleted the last item. */ XtFree((char *) lw->list.items); lw->list.items = NULL; } lw->list.itemCount = TotalItems; } /************************************************************************ * * * DeleteItemPositions * * * ************************************************************************/ static void DeleteItemPositions(XmListWidget lw, int *position_list, int position_count, Boolean track_kbd) { int TotalItems; int item_pos; int ix; int jx; XmString item; if (lw->list.itemCount < 1) return; /* Prepare ourselves to do a series of deletes. Scan the position_list * to free deleted positions. Set each freed position to NULL. Do not * try to refree already deleted positions. * * Any invalid position must be caught by the calling routine. These * positions have to be marked with a -1 to be ignored. * * Re-pack "items" in place ignoring the previously freed positions. */ TotalItems = lw->list.itemCount; for (ix = 0; ix < position_count; ix++) { item_pos = position_list[ ix ] - 1; if (item_pos >= 0 && item_pos < lw->list.itemCount) { item = lw->list.items[item_pos]; if (item) { XmStringFree(item); lw->list.items[item_pos] = NULL; TotalItems--; /* CR 9630: XmListDeletePos and XmListDeletePositions */ /* track the keyboard location cursor differently. */ if (track_kbd && (item_pos <= lw->list.CurrentKbdItem)) { lw->list.CurrentKbdItem--; ASSIGN_MAX(lw->list.CurrentKbdItem, 0); if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) lw->list.LastHLItem = lw->list.CurrentKbdItem; } } } } jx = 0; for (ix = 0; ix < lw->list.itemCount; ix++) { if (lw->list.items[ ix ] != NULL) { lw->list.items[ jx ] = lw->list.items[ ix ]; jx++; } } if (TotalItems) { lw->list.items = (XmString *) XtRealloc((char *) lw->list.items, TotalItems * sizeof(XmString)); } else { /* Null out the list pointer, if we have deleted the last item. */ XtFree((char *) lw->list.items); lw->list.items = NULL; } lw->list.itemCount = TotalItems; } /************************************************************************ * * * ReplaceItem - Replace an item at the specified position * * * ************************************************************************/ static void ReplaceItem(XmListWidget lw, XmString item, int pos) { int i; pos--; XmStringFree(lw->list.items[pos]); lw->list.items[pos] = XmStringCopy(item); /*Selected items should be replaced also*/ #ifdef FIX_1390 UpdateSelectedPositions(lw, lw->list.selectedItemCount); #endif for(i=0; ilist.selectedItemCount; i++) { if(lw->list.selectedPositions[i]==pos+1) { XmStringFree(lw->list.selectedItems[i]); lw->list.selectedItems[i]=XmStringCopy(item); } } } /*************************************************************************** * * * ItemNumber - returns the item number of the specified item in the * * external item list. * * * ***************************************************************************/ static int ItemNumber(XmListWidget lw, XmString item) { register int i; for (i = 0; i < lw->list.itemCount; i++) if (XmStringCompare(lw->list.items[i], item)) return i + 1; return 0; } /*************************************************************************** * * * ItemExists - returns TRUE if the specified item matches an item in the * * List item list. * * * ***************************************************************************/ static int ItemExists(XmListWidget lw, XmString item) { register int i; for (i = 0; i < lw->list.itemCount; i++) if ((XmStringCompare(lw->list.items[i], item))) return TRUE; return FALSE; } /************************************************************************ * * * OnSelectedList - Returns TRUE if the given item is on the selected * * items list, or, if selectedItems is empty, if the item is on the * * selectedPositions list. * * * ************************************************************************/ static Boolean OnSelectedList( XmListWidget lw, XmString item, int intern_pos) { register int i; /* Use selectedItems if applicable, else use selectedPositions */ if (lw->list.selectedItems && (lw->list.selectedItemCount > 0)) { for (i = 0; i < lw->list.selectedItemCount; i++) if (XmStringCompare(lw->list.selectedItems[i], item)) return TRUE; } else if ((lw->list.selectedPositions != NULL) && (lw->list.selectedPositionCount > 0)) { for (i=0; i < lw->list.selectedPositionCount; i++) if (lw->list.selectedPositions[i] == (intern_pos + 1)) return TRUE; } return FALSE; } /************************************************************************ * * * CopyItems - Copy the item list into our space. * * * ************************************************************************/ static void CopyItems(XmListWidget lw) { register int i; XmString *il; if (lw->list.items && lw->list.itemCount) { il = (XmString *)XtMalloc(sizeof(XmString) * (lw->list.itemCount)); for (i = 0; i < lw->list.itemCount; i++) il[i] = XmStringCopy(lw->list.items[i]); lw->list.items = il; } } /************************************************************************ * * * CopySelectedItems - Copy the selected item list into our space. * * * ************************************************************************/ static void CopySelectedItems(XmListWidget lw) { register int i; XmString *sl; if (lw->list.selectedItems && lw->list.selectedItemCount) { sl = (XmString *) XtMalloc(sizeof(XmString) * (lw->list.selectedItemCount)); for (i = 0; i < lw->list.selectedItemCount; i++) sl[i] = XmStringCopy(lw->list.selectedItems[i]); lw->list.selectedItems = sl; } } /************************************************************************ * * * CopySelectedPositions - Copy the selected position list. * * * ************************************************************************/ static void CopySelectedPositions(XmListWidget lw) { if (lw->list.selectedPositions && lw->list.selectedPositionCount) { int size = sizeof(int) * lw->list.selectedPositionCount; int *sl = (int *) XtMalloc(size); memcpy((char*)sl, (char*)lw->list.selectedPositions, size); lw->list.selectedPositions = sl; } } /************************************************************************ * * * ClearItemList - delete all elements from the item list, and * * free the space associated with it. * * * ************************************************************************/ static void ClearItemList(XmListWidget lw) { register int i; if (!(lw->list.items && lw->list.itemCount)) return; for (i = 0; i < lw->list.itemCount; i++) XmStringFree(lw->list.items[i]); XtFree((char *) lw->list.items); lw->list.itemCount = 0; lw->list.items = NULL; lw->list.LastItem = 0; lw->list.LastHLItem = 0; lw->list.top_position = 0; lw->list.CurrentKbdItem = 0; lw->list.XOrigin = 0; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } } /************************************************************************ * * * ClearSelectedPositions - delete all elements from the selected * * positions list AND free the space associated with it. * * * ************************************************************************/ static void ClearSelectedPositions(XmListWidget lw) { if (!(lw->list.selectedPositions && lw->list.selectedPositionCount)) return; XtFree((char*) lw->list.selectedPositions); lw->list.selectedPositionCount = 0; lw->list.selectedPositions = NULL; } /************************************************************************ * * * ClearSelectedList - delete all elements from the selected list * * AND free the space associated with it. * * * ************************************************************************/ static void ClearSelectedList( XmListWidget lw) { register int i; if (!(lw->list.selectedItems && lw->list.selectedItemCount)) return; for (i = 0; i < lw->list.selectedItemCount; i++) XmStringFree(lw->list.selectedItems[i]); XtFree((char *) lw->list.selectedItems); lw->list.selectedItemCount = 0; lw->list.selectedItems = NULL; } /************************************************************************ * * * BuildSelectedList - traverse the element list and construct a list * * of selected elements and indices. * * * * NOTE: Must be called in tandem with and *AFTER* ClearSelectedList. * * Otherwise you have a memory leak... * * * ************************************************************************/ static void BuildSelectedList(XmListWidget lw, Boolean commit) { int i, j, count; Boolean sel; count = lw->list.itemCount; for (i = 0, j = 0; i < count; i++) { sel = lw->list.InternalList[i]->selected; if (sel) j++; /* Commit the selection */ if (commit) lw->list.InternalList[i]->last_selected = sel; } lw->list.selectedItemCount = j; lw->list.selectedItems = NULL; if (j == 0) return; lw->list.selectedItems = (XmString *)XtMalloc(sizeof(XmString) * j); for (i = 0, j = 0; i < count; i++) { if (lw->list.InternalList[i]->selected) { lw->list.selectedItems[j] = XmStringCopy(lw->list.items[i]); j++; } } } /************************************************************************ * * * BuildSelectedPositions - traverse the element list and construct * * a list of selected positions. * * * * NOTE: Must be called in tandem with and *AFTER* * * ClearSelectedPositions. Otherwise you have a memory leak... * * * ************************************************************************/ static void BuildSelectedPositions(XmListWidget lw, int count) { register int pos; register int nsel = count; register int nitems = lw->list.itemCount; if (nsel == RECOUNT_SELECTION) { for (pos = 0, nsel = 0; pos < nitems; pos++) if (lw->list.InternalList[pos]->selected) nsel++; } lw->list.selectedPositionCount = nsel; if (nsel == 0) { lw->list.selectedPositions = NULL; } else { lw->list.selectedPositions = (int *) XtMalloc(sizeof(int) * nsel); for (pos = 0, nsel = 0; pos < nitems; pos++) { if (lw->list.InternalList[pos]->selected) { lw->list.selectedPositions[nsel] = pos + 1; nsel++; if (nsel >= lw->list.selectedPositionCount) break; } } } } /************************************************************************ * * * UpdateSelectedList - Build a new selected list. * * * ************************************************************************/ static void UpdateSelectedList(XmListWidget lw, Boolean rebuild) { if (rebuild) { ClearSelectedList(lw); BuildSelectedList(lw, TRUE); } /* Do we want to do this conditional on the selected item count * not being 0 or should we always take primary? */ if ((lw->list.selectedItemCount > 0) && (lw->list.PrimaryOwnership != XmOWN_NEVER)) { /* We can take ownership of the primary if: * 1. ownership is XmOWN_ALWAYS * 2. ownership is XmOWN_MULTIPLE and more than one * item is selected * 3. ownership is XmOWN_POSSIBLE_MULTIPLE and selection * policy is EXTENDED * 4. ownership is XmOWN_POSSIBLE_MULTIPLE and selection * policy is MULTIPLE */ if (/* 1. */ (lw->list.PrimaryOwnership == XmOWN_ALWAYS) || /* 2. */ (lw->list.PrimaryOwnership == XmOWN_MULTIPLE && lw->list.selectedItemCount > 1) || /* 3. */ (lw->list.PrimaryOwnership == XmOWN_POSSIBLE_MULTIPLE && lw->list.SelectionPolicy == XmEXTENDED_SELECT) || /* 4. */ (lw->list.PrimaryOwnership == XmOWN_POSSIBLE_MULTIPLE && lw->list.SelectionPolicy == XmMULTIPLE_SELECT)) { XmePrimarySource((Widget) lw, 0); } } } /*************************************************************************** * * * UpdateSelectedPositions - Build a new selected positions list. * * * ***************************************************************************/ static void UpdateSelectedPositions(XmListWidget lw, int count) { ClearSelectedPositions(lw); BuildSelectedPositions(lw, count); } /*************************************************************************** * * * ListSelectionChanged - a utility function that determines whether the * * selection before the last selection activity and the current selection * * differ. * * * ***************************************************************************/ static Boolean ListSelectionChanged(XmListWidget w) { register int item; /* register int startitem; register int enditem; */ /* We can't simply compare the start and oldstart and compare * the end and oldend to see whether the boundaries have changed * because we don't know the state of all the items between * the boundaries. An easy way to do this is to form a union of * the old and current selection and loop through looking for * any selection state changes. So first find the boundaries * of the union ... */ /* startitem = MIN(w->list.StartItem, w->list.OldStartItem); enditem = MAX(w->list.EndItem, w->list.OldEndItem); */ /* Search through the union of the old selection and the * new selection. If any element has had a change of * selection state, then the selection has changed. [Note: we * are actually searching through the whole list right now * but this should be optimized at some point.] */ for (item = 0; item < w->list.itemCount; ++item) { if (w->list.InternalList[item]->selected != w->list.InternalList[item]->last_selected) { return True; } } /* Everything was the same, so return False. */ return False; } /************************************************************************ * * * Event Handlers for the various selection modes * * * ************************************************************************/ /************************************************************************ * * * WhichItem - Figure out which element we are on. * * * ************************************************************************/ static int WhichItem(XmListWidget w, Position EventY) { XmListWidget lw = w; Position y = EventY; int item, lines; if (lw->list.Traversing && lw->list.KbdSelection) return lw->list.CurrentKbdItem; /* BEGIN OSF Fix CR 5081 */ if (!lw->list.items) return -1; if (y <= (Position)(lw->list.BaseY - lw->list.HighlightThickness)) { /* END OSF Fix CR 5081 */ if (lw->list.top_position) return(-1); else return(0); } if ((Dimension) y > lw->core.height) { if ((lw->list.top_position + lw->list.visibleItemCount) >= lw->list.itemCount) return (lw->list.itemCount - 1); } if (y >= (Position)(lw->core.height - lw->list.BaseY)) return (lw->list.itemCount + 1); if ((int) (lw->list.MaxItemHeight + lw->list.spacing) == 0) return(-1); /* Calculate the line offset directly, since lines are fixed height. */ lines = (((int) (y + lw->list.spacing) - (int) (lw->list.BaseY + lw->list.HighlightThickness + 1)) / (int) (lw->list.MaxItemHeight + lw->list.spacing)); if (lines <= 0) item = lw->list.top_position; else if (lw->list.top_position + lines < lw->list.itemCount) item = lw->list.top_position + lines; else item = lw->list.itemCount; return item; } /************************************************************************ * * * SelectRange - Select/deselect the range between start and end. * * This does not set the last_selected flag. * * * ************************************************************************/ static void SelectRange(XmListWidget lw, int first, int last, Boolean select) { int start, end; if (first <= last) { start = first; end = last; } else { start = last; end = first; } if (start < 0) start = 0; if (end >= lw->list.itemCount) end = lw->list.itemCount - 1; for (; start <= end; start++) { lw->list.InternalList[start]->selected = select; DrawItem((Widget) lw, start); } } /************************************************************************ * * * RestoreRange - Restore the range between start and end. * * * ************************************************************************/ static void RestoreRange(XmListWidget lw, int first, int last, Boolean dostart) { register int tmp, start, end; start = first; end = last; if (start > end) { tmp = start; start = end; end = tmp; } if (start < 0) start = 0; if (end >= lw->list.itemCount) end = lw->list.itemCount - 1; if (start < 0) start = 0; if (end >= lw->list.itemCount) end = lw->list.itemCount - 1; tmp = lw->list.StartItem; for (; start <= end; start++) if ((start != tmp) || dostart) { lw->list.InternalList[start]->selected = lw->list.InternalList[start]->last_selected; DrawItem((Widget) lw, start); } } /************************************************************************ * * * ArrangeRange - This does all the necessary magic for movement in * * extended selection mode. This code handles all the various cases * * for relationships between the start, end and current item, restoring * * as needed, and selecting the appropriate range. This is called in * * both the mouse and keyboard cases. * * * ************************************************************************/ static void ArrangeRange(XmListWidget lw, int item) { int start = lw->list.StartItem; int end = lw->list.EndItem; int i = item; Boolean set = lw->list.InternalList[start]->selected; if (start < end) { if (i > end) SelectRange(lw, end, i, set); else if ((i < end) && (i >= start)) { /* CR 5676: Undo extended toggle drags properly. */ if (!set || (lw->list.Event & CTRLDOWN)) RestoreRange(lw, i + 1, end, FALSE); else SelectRange(lw, i + 1, end, FALSE); } else if (i <= start) { /* CR 5676: Undo extended toggle drags properly. */ if (!set || (lw->list.Event & CTRLDOWN)) RestoreRange(lw, start, end, FALSE); else SelectRange(lw, start, end, FALSE); SelectRange(lw, i, start, set); } } else if (start > end) { if (i <= end) SelectRange(lw, i, end, set); else if ((i > end) && (i <= start)) { /* CR 5676: Undo extended toggle drags properly. */ if (!set || (lw->list.Event & CTRLDOWN)) RestoreRange(lw, end, i - 1, FALSE); else SelectRange(lw, end, i - 1, FALSE); } else if (i >= start) { /* CR 5676: Undo extended toggle drags properly. */ if (!set || (lw->list.Event & CTRLDOWN)) RestoreRange(lw, end, start, FALSE); else SelectRange(lw, end, start, FALSE); SelectRange(lw, start, i, set); } } else SelectRange(lw, start, i, set); } /************************************************************************ * * * HandleNewItem - called when a new item is selected in browse or * * extended select mode. This does the deselection of previous items * * and the autoselection, if enabled. * * * ************************************************************************/ /*ARGSUSED*/ static void HandleNewItem(XmListWidget lw, int item, int olditem) { int dir; if (lw->list.LastHLItem == item) return; if (item < 0 || item >= lw->list.itemCount) return; if (item < 0 || item >= lw->list.itemCount) return; switch(lw->list.SelectionPolicy) { case XmBROWSE_SELECT: lw->list.InternalList[lw->list.LastHLItem]->selected = FALSE; if (lw->list.LastHLItem != lw->list.CurrentKbdItem) lw->list.InternalList[lw->list.LastHLItem]->last_selected = FALSE; DrawItem((Widget) lw, lw->list.LastHLItem); lw->list.InternalList[item]->selected = TRUE; /* lw->list.InternalList[item]->last_selected = TRUE; */ DrawItem((Widget) lw, item); lw->list.LastHLItem = item; lw->list.StartItem = item; lw->list.EndItem = item; if (lw->list.AutoSelect != XmNO_AUTO_SELECT) { DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); ClickElement(lw, NULL, FALSE); lw->list.CurrentKbdItem = item; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } break; case XmEXTENDED_SELECT: /* BEGIN OSF Fix CR 5954 */ dir = (lw->list.LastHLItem < item) ? 1 : -1; while (lw->list.LastHLItem != item && lw->list.StartItem >= 0 && lw->list.EndItem >= 0 && lw->list.StartItem < lw->list.itemCount && lw->list.EndItem < lw->list.itemCount) { lw->list.LastHLItem += dir; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.DidSelection)) ClickElement(lw, NULL, FALSE); ArrangeRange(lw, item); if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (!lw->list.DidSelection)) ClickElement(lw, NULL, FALSE); lw->list.EndItem += dir; } lw->list.DidSelection = TRUE; break; } /* END OSF Fix CR 5954 */ } /************************************************************************ * * * HandleExtendedItem - called when a new item is selected via the * * keyboard in extended select mode. This does the deselection of * * previous items and handles some of the add mode actions. * * * ************************************************************************/ static void HandleExtendedItem(XmListWidget lw, int item) { Boolean set; int i, start, end; if (lw->list.LastHLItem == item) return; if (item < 0 || item >= lw->list.itemCount) return; if (item < 0 || item >= lw->list.itemCount) return; /* First the non-addmode case */ if (lw->list.SelectionMode == XmNORMAL_MODE) { if (!(lw->list.Event & SHIFTDOWN)) /* And not shifted */ { lw->list.StartItem = item; lw->list.EndItem = item; lw->list.LastHLItem = item; for (i = 0; i < lw->list.selectedPositionCount; i++) { int pos = lw->list.selectedPositions[i] - 1; if (pos != item) { lw->list.InternalList[pos]->last_selected = lw->list.InternalList[pos]->selected; lw->list.InternalList[pos]->selected = FALSE; DrawItem((Widget) lw, pos); } } lw->list.InternalList[item]->last_selected = lw->list.InternalList[item]->selected; lw->list.InternalList[item]->selected = TRUE; DrawItem((Widget) lw, item); if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } ClickElement(lw, NULL, FALSE); } else /* Shifted */ { /* Save the current selection */ for (i = 0; i < lw->list.itemCount; i++) lw->list.InternalList[i]->last_selected = lw->list.InternalList[i]->selected; if (lw->list.selectedItemCount == 0) lw->list.StartItem = item; set = lw->list.InternalList[lw->list.StartItem]->selected; start = MIN(lw->list.StartItem, item); end = MAX(lw->list.StartItem, item); /* Deselect everything outside of the current range. */ for (i = 0; i < start; i++) if (lw->list.InternalList[i]->selected) { lw->list.InternalList[i]->selected = FALSE; DrawItem((Widget) lw, i); } for (i = end + 1; i < lw->list.itemCount; i++) if (lw->list.InternalList[i]->selected) { lw->list.InternalList[i]->selected = FALSE; DrawItem((Widget) lw, i); } lw->list.EndItem = item; lw->list.LastHLItem = item; SelectRange(lw, lw->list.StartItem, item, set); if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } ClickElement(lw, NULL, FALSE); } } else /* Add Mode next... */ { if (lw->list.Event & SHIFTDOWN) /* Shifted */ { ArrangeRange(lw, item); lw->list.EndItem = item; lw->list.LastHLItem = item; ClickElement(lw, NULL, FALSE); } } } /************************************************************************ * * * VerifyMotion - event handler for motion within the list. * * * ************************************************************************/ /*ARGSUSED*/ static void VerifyMotion(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget w = (XmListWidget) wid; int item; int interval = 100; register XmListWidget lw = w; unsigned char OldLeaveDir = lw->list.LeaveDir; if (!(lw->list.Event & BUTTONDOWN) || (lw->list.SelectionPolicy == XmSINGLE_SELECT) || (lw->list.SelectionPolicy == XmMULTIPLE_SELECT)) return; /**************** * * First, see if we're out of the window. If we are, and * if the direction is different than the last leave direction, fake a * leave window event. This allows you to drag out of the list, and then * futz around with the cursor outside of the window, and it will track * correctly. * ****************/ if ((event->xmotion.x < (int)lw->core.width) && (event->xmotion.x > (int)lw->core.x) && (event->xmotion.y < (int)lw->core.height) && (event->xmotion.y >(int)lw->core.y)) { if (lw->list.DragID) { XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = 0; } } else { if (LayoutIsRtoLP(lw)) { if (((event->xmotion.y >= (int)lw->core.height) && (lw->list.LeaveDir & TOPLEAVE)) || ((event->xmotion.y <= (int)lw->core.y) && (lw->list.LeaveDir & BOTTOMLEAVE)) || ((event->xmotion.x <= (int)lw->core.x) && (lw->list.LeaveDir & LEFTLEAVE)) || ((event->xmotion.x >= (int)lw->core.width) && (lw->list.LeaveDir & RIGHTLEAVE))) { if (lw->list.DragID) { XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = 0; } ListLeave((Widget) lw, event, params, num_params); return; } } else { if (((event->xmotion.y >= (int)lw->core.height) && (lw->list.LeaveDir & TOPLEAVE)) || ((event->xmotion.y <= (int)lw->core.y) && (lw->list.LeaveDir & BOTTOMLEAVE)) || ((event->xmotion.x <= (int)lw->core.x) && (lw->list.LeaveDir & RIGHTLEAVE)) || ((event->xmotion.x >= (int)lw->core.width) && (lw->list.LeaveDir & LEFTLEAVE))) { if (lw->list.DragID) { XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = 0; } ListLeave((Widget) lw, event, params, num_params); return; } } } lw->list.LeaveDir = 0; if (event->xmotion.y >= (int)lw->core.height) /* Bottom */ lw->list.LeaveDir |= BOTTOMLEAVE; if (event->xmotion.y <= (int)lw->core.y) /* Top */ lw->list.LeaveDir |= TOPLEAVE; if (LayoutIsRtoLP(lw)) { if (event->xmotion.x <= (int)lw->core.x) /* Left */ lw->list.LeaveDir |= RIGHTLEAVE; if (event->xmotion.x >= (int)lw->core.width)/* Right */ lw->list.LeaveDir |= LEFTLEAVE; } else { if (event->xmotion.x <= (int)lw->core.x) /* Left */ lw->list.LeaveDir |= LEFTLEAVE; if (event->xmotion.x >= (int)lw->core.width)/* Right */ lw->list.LeaveDir |= RIGHTLEAVE; } item = WhichItem(lw, event->xmotion.y); if (lw->list.LeaveDir) { if (lw->list.vScrollBar) XtVaGetValues((Widget)lw->list.vScrollBar, XmNrepeatDelay, &interval, NULL); if (!lw->list.DragID || (OldLeaveDir != lw->list.LeaveDir)) { if (lw->list.DragID) XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget) lw), (unsigned long) interval, BrowseScroll, (XtPointer) lw); } } if ((item == lw->list.LastHLItem) || (item >= lw->list.itemCount) || (item < lw->list.top_position)|| (item >= (lw->list.top_position + lw->list.visibleItemCount))) return; /* Ok, we have a new item. */ lw->list.DownCount = 0; lw->list.DidSelection = FALSE; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) lw->list.AutoSelectionType = XmAUTO_MOTION; HandleNewItem(lw, item, lw->list.LastHLItem); } /*************************************************************************** * * * Element Select - invoked on button down on a widget. * * * ***************************************************************************/ /*ARGSUSED*/ static void SelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; Time interval; int i, item; int start = 0, end = 1; Boolean sel; if (!lw->list.itemCount) return; interval = (Time) lw->list.ClickInterval; item = WhichItem(lw, event->xbutton.y); if ((item >= (lw->list.top_position+lw->list.visibleItemCount)) || (item < lw->list.top_position) || (item >= lw->list.itemCount)) return; lw->list.Event |= BUTTONDOWN; lw->list.LeaveDir = 0; if (lw->list.SelectionPolicy == XmEXTENDED_SELECT) { if (lw->list.Event & SHIFTDOWN) lw->list.SelectionType = XmMODIFICATION; else if (lw->list.Event & CTRLDOWN) lw->list.SelectionType = XmADDITION; else lw->list.SelectionType = XmINITIAL; } /* Look for a double click. */ if (!(lw->list.KbdSelection) && /* No more doubleclick from space... */ (lw->list.DownTime != 0) && (lw->list.DownCount > 0) && (event->xbutton.time < (lw->list.DownTime + interval))) { lw->list.DownCount++; lw->list.DownTime = 0; return; } /* Else initialize the count variables. */ lw->list.DownCount = 1; if (!(lw->list.KbdSelection)) lw->list.DownTime = event->xbutton.time; lw->list.DidSelection = FALSE; /* Unselect the previous selection if needed. */ sel = lw->list.InternalList[item]->selected; if (((lw->list.SelectionPolicy == XmSINGLE_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT) || (lw->list.SelectionPolicy == XmEXTENDED_SELECT)) && ((!lw->list.AppendInProgress) || ((lw->list.SelectionMode == XmNORMAL_MODE)&& (lw->list.KbdSelection) && (lw->list.SelectionPolicy == XmMULTIPLE_SELECT)))) { for (i = 0; i < lw->list.itemCount; i++) { lw->list.InternalList[i]->last_selected = lw->list.InternalList[i]->selected; if (lw->list.InternalList[i]->selected) { lw->list.InternalList[i]->selected = FALSE; DrawItem((Widget) lw, i); } } } if (lw->list.SelectionPolicy == XmEXTENDED_SELECT) { if (lw->list.Event & SHIFTDOWN) sel = lw->list.InternalList[lw->list.StartItem]->selected; else if (lw->list.Event & CTRLDOWN) { lw->list.InternalList[item]->selected = !(lw->list.InternalList[item]->selected); } else if ((lw->list.Traversing) && (lw->list.SelectionMode == XmADD_MODE)) { lw->list.InternalList[item]->last_selected = lw->list.InternalList[item]->selected; lw->list.InternalList[item]->selected = !lw->list.InternalList[item]->selected; } else { lw->list.InternalList[item]->selected = TRUE; } } else if ((lw->list.SelectionPolicy == XmMULTIPLE_SELECT) && (lw->list.InternalList[item]->selected)) { lw->list.InternalList[item]->selected = FALSE; } else if (((lw->list.SelectionPolicy == XmBROWSE_SELECT) || (lw->list.SelectionPolicy == XmSINGLE_SELECT)) && (lw->list.SelectionMode == XmADD_MODE)) { lw->list.InternalList[item]->selected = !sel; } else { lw->list.InternalList[item]->selected = TRUE; } DrawItem((Widget) lw, item); XmProcessTraversal((Widget) lw, XmTRAVERSE_CURRENT); lw->list.LastHLItem = item; lw->list.OldEndItem = lw->list.EndItem; lw->list.EndItem = item; /* If in extended select mode, and we're appending, select the * new range. Look and see if we need to unselect the old range * (the cases where the selection endpoint goes from one side of the * start to the other.) */ if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) && (lw->list.Event & SHIFTDOWN)) { start = lw->list.StartItem; end = lw->list.OldEndItem; i = item; if (start < end) { if (i > end) SelectRange(lw, end + 1, item, sel); else if ((i < end) && (i >= start)) RestoreRange(lw, i + 1, end, FALSE); else if (i < start) { if (sel) SelectRange(lw, start + 1, end, FALSE); else RestoreRange(lw, start + 1, end, FALSE); SelectRange(lw, item, start, sel); } } if (start > end) { if (i < end) SelectRange(lw, item, end + 1, sel); else if ((i > end) && (i <= start)) RestoreRange(lw, end, i - 1, FALSE); else if (i > start) { if (sel) SelectRange(lw, end, start - 1, FALSE); else RestoreRange(lw, end, start - 1, FALSE); SelectRange(lw, start, item, sel); } } if (start == end) SelectRange(lw, start, item, sel); if (lw->list.AutoSelect != XmNO_AUTO_SELECT) { /* We only want to set the auto selection type if * it hasn't been set already because there are a * number of different ways we can get to this function, * each of which could set this value. */ if (lw->list.AutoSelectionType == XmAUTO_UNSET) lw->list.AutoSelectionType = XmAUTO_BEGIN; ClickElement(lw, NULL, FALSE); } return; } lw->list.OldStartItem = lw->list.StartItem; lw->list.StartItem = item; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT))) { /* We only want to set the auto selection type if * it hasn't been set already because there are a * number of different ways we can get to this function, * each of which could set this value. */ if (lw->list.AutoSelectionType == XmAUTO_UNSET) lw->list.AutoSelectionType = XmAUTO_BEGIN; ClickElement(lw, NULL, FALSE); } } /*************************************************************************** * * * KbdSelectElement - invoked on keyboard selection. * * * ***************************************************************************/ /*ARGSUSED*/ static void KbdSelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.KbdSelection = TRUE; if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) && (lw->list.SelectionMode == XmADD_MODE)) { lw->list.Event |= CTRLDOWN; lw->list.AppendInProgress = TRUE; } if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) lw->list.AutoSelectionType = XmAUTO_BEGIN; SelectElement((Widget) lw, event, params, num_params); lw->list.KbdSelection = FALSE; } /*************************************************************************** * * * Element UnSelect - Handle the button up event. * * * ***************************************************************************/ /*ARGSUSED*/ static void UnSelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int item; if (!lw->list.itemCount) return; item = WhichItem(lw, event->xbutton.y); ASSIGN_MAX(item, lw->list.top_position); if (item > (lw->list.top_position + lw->list.visibleItemCount)) item = (lw->list.top_position + lw->list.visibleItemCount - 1); if (item >= lw->list.itemCount) item = lw->list.itemCount - 1; if (!(lw->list.Event & BUTTONDOWN)) return; if (!lw->list.KbdSelection) { lw->list.OldStartItem = lw->list.StartItem; lw->list.OldEndItem = lw->list.EndItem; } if (lw->list.Traversing) { if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.CurrentKbdItem = item; DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } else { DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.CurrentKbdItem = lw->list.LastHLItem; DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } } else lw->list.CurrentKbdItem = item; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if ((lw->list.SelectionPolicy == XmBROWSE_SELECT) || (lw->list.SelectionPolicy == XmEXTENDED_SELECT)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } } lw->list.Event = 0; /* CR 9442: Don't ClickElement twice in AutoSelect mode. */ if (lw->list.DownCount > 1) DefaultAction(lw, event); else if ((lw->list.AutoSelect == XmNO_AUTO_SELECT) || (!lw->list.DidSelection)) ClickElement(lw, event, FALSE); if (lw->list.AutoSelect != XmNO_AUTO_SELECT) { UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); } DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); lw->list.AppendInProgress = FALSE; } /*************************************************************************** * * * KbdUnSelectElement - invoked on keyboard selection. * * * ***************************************************************************/ /*ARGSUSED*/ static void KbdUnSelectElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.KbdSelection = TRUE; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } UnSelectElement((Widget) lw, event, params, num_params); lw->list.KbdSelection = FALSE; lw->list.AppendInProgress = FALSE; lw->list.Event = 0; } /************************************************************************ * * * Shift Select * * * ************************************************************************/ /*ARGSUSED*/ static void ExSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= SHIFTDOWN; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) lw->list.AutoSelectionType = XmAUTO_BEGIN; SelectElement((Widget) lw, event, params, num_params); } /************************************************************************ * * * Shift UnSelect * * * ************************************************************************/ /*ARGSUSED*/ static void ExUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; lw->list.AppendInProgress = FALSE; if (!(lw->list.Event & BUTTONDOWN) || (lw->list.SelectionPolicy != XmEXTENDED_SELECT)) { lw->list.Event &= ~SHIFTDOWN; UnSelectElement((Widget)lw, event, params, num_params); return; } if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } UnSelectElement((Widget) lw, event, params, num_params); lw->list.Event = 0; } /************************************************************************ * * * CtrlBtnSelect * * * ************************************************************************/ /*ARGSUSED*/ static void CtrlBtnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* * There's already an action for Ctrl-Btn1 when in Extended Select * mode, so we can't change that. */ if (lw->list.SelectionPolicy == XmEXTENDED_SELECT) CtrlSelect(wid, event, params, num_params); else XmProcessTraversal(wid, XmTRAVERSE_CURRENT); } /************************************************************************ * * * Ctrl Select * * * ************************************************************************/ /*ARGSUSED*/ static void CtrlSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; register int i, j; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= (CTRLDOWN); lw->list.OldStartItem = lw->list.StartItem; lw->list.OldEndItem = lw->list.EndItem; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) lw->list.AutoSelectionType = XmAUTO_BEGIN; /**************** * * Since we know we are adding items to a selection, save the state of * the last selected range. This allows the rubberbanding and * shift-select functionality to work correctly. * ****************/ i = MIN(lw->list.OldStartItem, lw->list.OldEndItem); i = MAX(i, 0); j = MAX(lw->list.OldStartItem, lw->list.OldEndItem); if ((i != 0) || (j != 0)) for (; i <= j && i < lw->list.itemCount; i++) lw->list.InternalList[i]->last_selected = lw->list.InternalList[i]->selected; SelectElement((Widget)lw, event, params, num_params); } /************************************************************************ * * * Ctrl UnSelect * * * ************************************************************************/ /*ARGSUSED*/ static void CtrlUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; lw->list.AppendInProgress = FALSE; if (!(lw->list.Event & BUTTONDOWN) || (lw->list.SelectionPolicy != XmEXTENDED_SELECT)) { lw->list.Event &= ~CTRLDOWN; UnSelectElement((Widget)lw, event, params, num_params); return; } if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } UnSelectElement((Widget)lw, event, params, num_params); lw->list.Event = 0; } /************************************************************************ * * * Keyboard Shift Select * * * ************************************************************************/ /*ARGSUSED*/ static void KbdShiftSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= SHIFTDOWN; lw->list.OldStartItem = lw->list.StartItem; lw->list.OldEndItem = lw->list.EndItem; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) lw->list.AutoSelectionType = XmAUTO_BEGIN; KbdSelectElement((Widget)lw, event, params, num_params); } /************************************************************************ * * * Keyboard Shift UnSelect * * * ************************************************************************/ /*ARGSUSED*/ static void KbdShiftUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (!(lw->list.Event & BUTTONDOWN) || (lw->list.SelectionPolicy != XmEXTENDED_SELECT)) return; lw->list.AppendInProgress = FALSE; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } KbdUnSelectElement((Widget)lw, event, params, num_params); lw->list.Event = 0; } /************************************************************************ * * * Keyboard Ctrl Select * * * ************************************************************************/ /*ARGSUSED*/ static void KbdCtrlSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; register int i, j; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; if (lw->list.SelectionMode == XmNORMAL_MODE) { KbdSelectElement((Widget)lw, event, params, num_params); return; } lw->list.AppendInProgress = TRUE; lw->list.Event |= CTRLDOWN; lw->list.OldStartItem = lw->list.StartItem; lw->list.OldEndItem = lw->list.EndItem; /**************** * * Since we know we are adding items to a selection, save the state of * the last selected range. This allows the rubberbanding and * shift-select functionality to work correctly. * ****************/ i = MIN(lw->list.OldStartItem, lw->list.OldEndItem); i = MAX(i, 0); j = MAX(lw->list.OldStartItem, lw->list.OldEndItem); if ((i != 0) || (j != 0)) for (; i <= j && i < lw->list.itemCount; i++) lw->list.InternalList[i]->last_selected = lw->list.InternalList[i]->selected; KbdSelectElement((Widget)lw, event, params, num_params); } /************************************************************************ * * * Keyboard Ctrl UnSelect * * * ************************************************************************/ /*ARGSUSED*/ static void KbdCtrlUnSelect(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (!(lw->list.Event & BUTTONDOWN) || (lw->list.SelectionPolicy != XmEXTENDED_SELECT)) return; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } if (lw->list.SelectionMode == XmNORMAL_MODE) { KbdUnSelectElement((Widget)lw, event, params, num_params); return; } lw->list.AppendInProgress = FALSE; KbdUnSelectElement((Widget)lw, event, params, num_params); lw->list.Event = 0; } /************************************************************************ * * * Keyboard Activate * * * ************************************************************************/ /*ARGSUSED*/ static void KbdActivate(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; XmParentInputActionRec p_event; int i; if (!lw->list.itemCount || !lw->list.items) return; lw->list.AppendInProgress = FALSE; if ((lw->list.SelectionPolicy == XmSINGLE_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { for (i = 0; i < lw->list.selectedPositionCount; i++) { int pos = lw->list.selectedPositions[i] - 1; lw->list.InternalList[pos]->selected = FALSE; lw->list.InternalList[pos]->last_selected = FALSE; DrawItem((Widget) lw, pos); } } if (lw->list.CurrentKbdItem >= lw->list.itemCount) lw->list.CurrentKbdItem = lw->list.itemCount - 1; lw->list.LastHLItem = lw->list.CurrentKbdItem; lw->list.InternalList[lw->list.CurrentKbdItem]->selected = TRUE; lw->list.InternalList[lw->list.CurrentKbdItem]->last_selected = TRUE; DrawItem((Widget) lw, lw->list.CurrentKbdItem); DefaultAction(lw, event); lw->list.Event = 0; p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_ACTIVATE; p_event.event = event; /* Pointer to XEvent. */ p_event.params = params; /* Or use what you have if */ p_event.num_params = num_params;/* input is from translation.*/ _XmParentProcess(XtParent(lw), (XmParentProcessData) &p_event); } /************************************************************************ * * * Keyboard Cancel * * * ************************************************************************/ /*ARGSUSED*/ static void KbdCancel(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; XmParentInputActionRec p_event; p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_CANCEL; p_event.event = event; /* Pointer to XEvent. */ p_event.params = params; /* Or use what you have if */ p_event.num_params = num_params;/* input is from translation.*/ if (!(lw->list.Event & BUTTONDOWN)) /* Only if not selecting */ { if (_XmParentProcess(XtParent(lw), (XmParentProcessData) &p_event)) return; } if (((lw->list.SelectionPolicy != XmEXTENDED_SELECT) && (lw->list.SelectionPolicy != XmBROWSE_SELECT)) || !(lw->list.Event & BUTTONDOWN)) return; if (lw->list.DragID) { XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = 0; } /* BEGIN OSF Fix CR 5644 */ if (lw->list.previous_top_position != -1) { DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = lw->list.previous_top_position; } /* END OSF Fix CR 5644 */ /* BEGIN OSF Fix CR 5117 */ RestoreRange(lw, 0, lw->list.itemCount - 1, TRUE); /* END OSF Fix CR 5117 */ lw->list.StartItem = lw->list.OldStartItem; lw->list.EndItem = lw->list.OldEndItem; lw->list.AppendInProgress = FALSE; lw->list.Event = 0; /* BEGIN OSF Fix CR 5644 */ if (lw->list.top_position == lw->list.previous_top_position) { SetVerticalScrollbar(lw); SetHorizontalScrollbar(lw); DrawList(lw, NULL, TRUE); lw->list.previous_top_position = -1; } /* END OSF Fix CR 5644 */ if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT))) { if (lw->list.AutoSelectionType == XmAUTO_UNSET) lw->list.AutoSelectionType = XmAUTO_CANCEL; ClickElement(lw, NULL, FALSE); } } /************************************************************************ * * * Keyboard toggle Add Mode * * * ************************************************************************/ /*ARGSUSED*/ static void KbdToggleAddMode(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.SelectionPolicy == XmEXTENDED_SELECT) { XmListSetAddMode((Widget) lw, !(lw->list.SelectionMode == XmADD_MODE)); ClickElement(lw, event, FALSE); } lw->list.Event = 0; } /************************************************************************ * * * Keyboard Select All * * * ************************************************************************/ /*ARGSUSED*/ static void KbdSelectAll(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; register int i; Boolean selection_changed = FALSE; /* Do nothing on empty lists. */ if (!lw->list.itemCount || !lw->list.items) return; lw->list.AppendInProgress = FALSE; if ((lw->list.SelectionPolicy != XmEXTENDED_SELECT) && (lw->list.SelectionPolicy != XmMULTIPLE_SELECT)) { for (i = 0; i < lw->list.selectedPositionCount; i++) { int pos = lw->list.selectedPositions[i] - 1; lw->list.InternalList[pos]->last_selected = lw->list.InternalList[pos]->selected; lw->list.InternalList[pos]->selected = FALSE; DrawItem((Widget) lw, pos); } lw->list.LastHLItem = lw->list.CurrentKbdItem; /* If we are in browse selection mode and the current selected * item was not selected in the last_selected list, then the * selection has changed. Otherwise, we are simply selecting the * same item again. */ if ((lw->list.SelectionPolicy == XmBROWSE_SELECT) && !lw->list.InternalList[lw->list.CurrentKbdItem]->last_selected) selection_changed = TRUE; lw->list.InternalList[lw->list.CurrentKbdItem]->selected = TRUE; lw->list.InternalList[lw->list.CurrentKbdItem]->last_selected = TRUE; DrawItem((Widget) lw, lw->list.CurrentKbdItem); } else if (lw->list.selectedPositionCount != lw->list.itemCount) { /* If any item is currently unselected, then the * selection is going to be different as a result of * doing an all select. */ selection_changed = TRUE; for (i = 0; i < lw->list.itemCount; i++) if (!(lw->list.InternalList[i]->selected)) { lw->list.InternalList[i]->last_selected = lw->list.InternalList[i]->selected; lw->list.InternalList[i]->selected = TRUE; DrawItem((Widget) lw, i); } } if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET) && (lw->list.SelectionPolicy == XmEXTENDED_SELECT || lw->list.SelectionPolicy == XmBROWSE_SELECT)) { if (selection_changed) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } ClickElement(lw, event, FALSE); lw->list.Event = 0; } /************************************************************************ * * * Keyboard DeSelect All * * * ************************************************************************/ /*ARGSUSED*/ static void KbdDeSelectAll(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; register int i, j; Boolean selection_changed = FALSE; /* Do nothing on empty lists. */ if (!lw->list.itemCount || !lw->list.items) return; if (((lw->list.SelectionPolicy == XmSINGLE_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) && (lw->list.SelectionMode == XmNORMAL_MODE)) return; if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) && (lw->list.SelectionMode == XmNORMAL_MODE) && (_XmGetFocusPolicy((Widget) lw) == XmEXPLICIT)) j = lw->list.CurrentKbdItem; else j = (-1); lw->list.AppendInProgress = FALSE; for (i = 0; i < lw->list.selectedPositionCount; i++) { int pos = lw->list.selectedPositions[i] - 1; if (pos != j) { /* If any item is currently selected, then the selection * will be different based on the deselect all action. */ selection_changed = TRUE; lw->list.InternalList[pos]->last_selected = lw->list.InternalList[pos]->selected; lw->list.InternalList[pos]->selected = FALSE; DrawItem((Widget) lw, pos); } } /* If auto selection is enabled and we are in extended * or browse selection modes, then we need to set up the * auto selection type. If the auto selection type has * already been set by someone else, then don't change it. */ if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET) && (lw->list.SelectionPolicy == XmEXTENDED_SELECT || lw->list.SelectionPolicy == XmBROWSE_SELECT)) { if (selection_changed) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } ClickElement(lw, event, FALSE); lw->list.Event = 0; } /*************************************************************************** * * * DefaultAction - call the double click callback. * * * ***************************************************************************/ static void DefaultAction(XmListWidget lw, XEvent *event) { XmListCallbackStruct cb; int item; int i, SLcount; item = lw->list.LastHLItem; lw->list.DidSelection = TRUE; if (item < 0 || item >= lw->list.itemCount) return; /* If there's a drag timeout, remove it so we don't see two selections. */ if (lw->list.DragID) { XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = 0; } if (lw->list.InternalList[item]->length == UNKNOWN_LENGTH) lw->list.InternalList[item]->length = XmStringLength(lw->list.items[item]); cb.reason = XmCR_DEFAULT_ACTION; cb.event = event; cb.item_length = lw->list.InternalList[item]->length; cb.item_position = item + 1; cb.item = XmStringCopy(lw->list.items[item]); cb.selected_item_count = 0; cb.selected_items = NULL; cb.selected_item_positions = NULL; UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); SLcount = lw->list.selectedItemCount; if (lw->list.selectedItems && lw->list.selectedItemCount) { cb.selected_items = (XmString *)ALLOCATE_LOCAL(sizeof(XmString) * SLcount); cb.selected_item_positions = (int *)ALLOCATE_LOCAL(sizeof(int) * SLcount); for (i = 0; i < SLcount; i++) { cb.selected_items[i] = XmStringCopy(lw->list.selectedItems[i]); cb.selected_item_positions[i] = lw->list.selectedPositions[i]; } } cb.selected_item_count = SLcount; cb.auto_selection_type = lw->list.AutoSelectionType; XtCallCallbackList((Widget) lw, lw->list.DefaultCallback, &cb); lw->list.AutoSelectionType = XmAUTO_UNSET; for (i = 0; i < SLcount; i++) XmStringFree(cb.selected_items[i]); DEALLOCATE_LOCAL((char*)cb.selected_items); DEALLOCATE_LOCAL((char*)cb.selected_item_positions); XmStringFree(cb.item); lw->list.DownCount = 0; } /************************************************************************ * * * ClickElement - invoked for all selection actions other than double * * click. This fills out the callback record and invokes the * * appropriate callback. * * * ************************************************************************/ static void ClickElement(XmListWidget lw, XEvent *event, Boolean default_action) { int item, SLcount, i; unsigned char selection_policy; XmListCallbackStruct cb; bzero((char*) &cb, sizeof(XmListCallbackStruct)); item = lw->list.LastHLItem; lw->list.DidSelection = TRUE; if (item < 0 || item >= lw->list.itemCount) return; /* If there's a drag timeout, remove it so we don't see two selections. */ if (lw->list.DragID) { XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = 0; } assert(lw->list.itemCount && lw->list.InternalList); if (lw->list.InternalList[item]->length == UNKNOWN_LENGTH) lw->list.InternalList[item]->length = XmStringLength(lw->list.items[item]); cb.event = event; cb.item_length = lw->list.InternalList[item]->length; cb.item_position = item + 1; cb.item = XmStringCopy(lw->list.items[item]); if (lw->list.AutoSelect != XmNO_AUTO_SELECT) { ClearSelectedList(lw); BuildSelectedList(lw, FALSE); /* Don't commit in auto mode. Yuk. */ } else UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); SLcount = lw->list.selectedItemCount; /* A callback can change the policy. Use the saved value for alloc and free of the selected_items list. */ selection_policy = lw->list.SelectionPolicy; if ((selection_policy == XmMULTIPLE_SELECT) || (selection_policy == XmEXTENDED_SELECT)) { if (lw->list.selectedItems && lw->list.selectedItemCount) { cb.selected_items = (XmString *)ALLOCATE_LOCAL(sizeof(XmString) * SLcount); cb.selected_item_positions = (int *)ALLOCATE_LOCAL(sizeof(int) * SLcount); for (i = 0; i < SLcount; i++) { cb.selected_items[i] = XmStringCopy(lw->list.selectedItems[i]); cb.selected_item_positions[i] = lw->list.selectedPositions[i]; } } } /* BEGIN OSF Fix CR 4576 */ cb.selected_item_count = SLcount; /* END OSF Fix CR 4576 */ if (default_action) { cb.reason = XmCR_DEFAULT_ACTION; cb.auto_selection_type = lw->list.AutoSelectionType; XtCallCallbackList((Widget) lw, lw->list.DefaultCallback, &cb); } else { switch(selection_policy) { case XmSINGLE_SELECT: cb.reason = XmCR_SINGLE_SELECT; XtCallCallbackList((Widget) lw, lw->list.SingleCallback, &cb); break; case XmBROWSE_SELECT: cb.reason = XmCR_BROWSE_SELECT; cb.auto_selection_type = lw->list.AutoSelectionType; XtCallCallbackList((Widget) lw, lw->list.BrowseCallback, &cb); break; case XmMULTIPLE_SELECT: cb.reason = XmCR_MULTIPLE_SELECT; XtCallCallbackList((Widget) lw, lw->list.MultipleCallback, &cb); break; case XmEXTENDED_SELECT: cb.reason = XmCR_EXTENDED_SELECT; cb.selection_type = lw->list.SelectionType; cb.auto_selection_type = lw->list.AutoSelectionType; XtCallCallbackList((Widget) lw, lw->list.ExtendCallback, &cb); break; } } /* Reset the AutoSelectionType. It may not actually be set to anything but * let's reset it in all cases just to be sure everthing remains clean. */ lw->list.AutoSelectionType = XmAUTO_UNSET; if ((selection_policy == XmMULTIPLE_SELECT) || (selection_policy == XmEXTENDED_SELECT)) { if (SLcount) { if (cb.selected_items) for (i = 0; i < SLcount; i++) if (cb.selected_items[i]) XmStringFree(cb.selected_items[i]); DEALLOCATE_LOCAL((char *) cb.selected_items); DEALLOCATE_LOCAL((char *) cb.selected_item_positions); } } XmStringFree(cb.item); } static void GetPreeditPosition(XmListWidget lw, XPoint *xmim_point) { xmim_point->x = lw->list.BaseX; if (lw->list.CurrentKbdItem == lw->list.top_position) { if (lw->list.visibleItemCount <= 1) /* on top */ xmim_point->y = lw->list.BaseY + lw->list.MaxItemHeight; else /* below current item */ xmim_point->y = lw->list.BaseY + 2*lw->list.MaxItemHeight + lw->list.spacing; } else if (lw->list.CurrentKbdItem < lw->list.top_position || lw->list.CurrentKbdItem >= lw->list.top_position + lw->list.visibleItemCount) { /* on top */ xmim_point->y = lw->list.BaseY + lw->list.MaxItemHeight; } else { /* above current item */ xmim_point->y = (lw->list.BaseY + LINEHEIGHTS(lw, (lw->list.CurrentKbdItem - lw->list.top_position)) - 2 * lw->list.HighlightThickness); } } /************************************************************************ * * * ListFocusIn * * * ************************************************************************/ /*ARGSUSED*/ static void ListFocusIn(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->primitive.traversal_on && (_XmGetFocusPolicy((Widget) lw) == XmEXPLICIT) && (event->xfocus.send_event)) { lw->list.Traversing = TRUE; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetFocusValues(wid, XmNspotLocation, &xmim_point, NULL); } } DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); _XmPrimitiveFocusIn((Widget) lw, event, NULL, NULL); } /************************************************************************ * * * ListFocusOut * * * ************************************************************************/ /*ARGSUSED*/ static void ListFocusOut(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (!(lw->list.Traversing)) return; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.Traversing = FALSE; _XmPrimitiveFocusOut((Widget) lw, event, NULL, NULL); } /************************************************************************ * * * BrowseScroll - timer proc that scrolls the list if the user has left * * the window with the button down. If the button has been * * released, call the standard click stuff. * * * ************************************************************************/ /*ARGSUSED*/ static void BrowseScroll(XtPointer closure, XtIntervalId *id) { XmListWidget lw = (XmListWidget) closure; int item, newitem; Boolean vLeave = TRUE; Boolean hLeave = TRUE; int interval = 100; int inc = 1; if (lw->list.DragID == 0) return; lw->list.DragID = 0; /* If the button went up, remove the timeout and call the selection * code. */ if (!(lw->list.Event & BUTTONDOWN)) { if (lw->list.DownCount > 1) DefaultAction(lw, NULL); else ClickElement(lw, NULL, FALSE); if (lw->list.Traversing) { DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.CurrentKbdItem = lw->list.LastHLItem; DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } else lw->list.CurrentKbdItem = lw->list.LastHLItem; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } return; } item = lw->list.LastHLItem; /* See if the user moved out the top of the list and there's another * element to go to. */ if (lw->list.LeaveDir & TOPLEAVE) { if ((lw->list.top_position <= 0) || !(lw->list.vScrollBar)) { vLeave = TRUE; } else { if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position--; item = lw->list.top_position; vLeave = FALSE; } } /* Now see if we went off the end and need to scroll up. */ if (lw->list.LeaveDir & BOTTOMLEAVE) { newitem = lw->list.top_position + lw->list.visibleItemCount; if ((newitem >= lw->list.itemCount) || !(lw->list.vScrollBar)) { vLeave = TRUE; } else { if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position++; item = newitem; vLeave = FALSE; } } /* Now see if we went off the right and need to scroll left. */ if (lw->list.LeaveDir & LEFTLEAVE) { if ((lw->list.hOrigin <= 0) || !(lw->list.hScrollBar)) { hLeave = TRUE; } else { if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); XtVaGetValues((Widget)lw->list.hScrollBar, XmNincrement, &inc, NULL); lw->list.hOrigin -= inc; lw->list.XOrigin = lw->list.hOrigin; hLeave = FALSE; } } /* Now see if we went off the left and need to scroll right. */ if (lw->list.LeaveDir & RIGHTLEAVE) { if ((lw->list.hOrigin >= lw->list.hmax - lw->list.hExtent) || !(lw->list.hScrollBar)) { hLeave = TRUE; } else { if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); XtVaGetValues((Widget)lw->list.hScrollBar, XmNincrement, &inc, NULL); lw->list.hOrigin += inc; lw->list.XOrigin = lw->list.hOrigin; hLeave = FALSE; } } if (vLeave && hLeave) return; if (!vLeave) SetVerticalScrollbar(lw); if (!hLeave) SetHorizontalScrollbar(lw); DrawList(lw, NULL, TRUE); if (lw->list.vScrollBar) XtVaGetValues((Widget)lw->list.vScrollBar, XmNrepeatDelay, &interval, NULL); /* Ok, we have a new item. */ lw->list.DownCount = 0; /* BEGIN OSF Fix CR 5954 */ lw->list.DidSelection = FALSE; /* END OSF Fix CR 5954 */ if (item != lw->list.LastHLItem) HandleNewItem(lw, item, lw->list.LastHLItem); XSync (XtDisplay (lw), False); lw->list.DragID = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)lw), (unsigned long) interval, BrowseScroll, (XtPointer) lw); } /************************************************************************ * * * ListLeave - If the user leaves in Browse or Extended Select mode * * with the button down, set up a timer to scroll the list * * elements. * * * ************************************************************************/ /*ARGSUSED*/ static void ListLeave(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmListWidget lw = (XmListWidget) wid; int interval = 200; _XmToolTipLeave(wid, event, params, num_params); if ((_XmGetFocusPolicy((Widget) lw) == XmPOINTER) && (lw->primitive.highlight_on_enter)) { DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.Traversing = FALSE; } if (((lw->list.SelectionPolicy != XmBROWSE_SELECT) && (lw->list.SelectionPolicy != XmEXTENDED_SELECT)) || !(lw->list.Event & BUTTONDOWN)) return; lw->list.LeaveDir = 0; if (event->xcrossing.y >= (int)lw->core.height) /* Bottom */ { lw->list.LeaveDir |= BOTTOMLEAVE; lw->list.previous_top_position = lw->list.top_position; } if (event->xcrossing.y <= (int)lw->core.y) /* Top */ { lw->list.LeaveDir |= TOPLEAVE; lw->list.previous_top_position = lw->list.top_position; } if (LayoutIsRtoLP(lw)) { if (event->xcrossing.x <= (int)lw->core.x) /* Left */ lw->list.LeaveDir |= RIGHTLEAVE; if (event->xcrossing.x >= (int)lw->core.width) /* Right */ lw->list.LeaveDir |= LEFTLEAVE; } else { if (event->xcrossing.x <= (int)lw->core.x) /* Left */ lw->list.LeaveDir |= LEFTLEAVE; if (event->xcrossing.x >= (int)lw->core.width) /* Right */ lw->list.LeaveDir |= RIGHTLEAVE; } if (lw->list.LeaveDir == 0) { lw->list.DragID = 0; return; } if (lw->list.vScrollBar) XtVaGetValues((Widget)lw->list.vScrollBar, XmNinitialDelay, &interval, NULL); lw->list.DragID = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)lw), (unsigned long) interval, BrowseScroll, (XtPointer) lw); _XmPrimitiveLeave((Widget) lw, event, NULL, NULL); } /************************************************************************ * * * ListEnter - If there is a drag timeout, remove it. * * * ************************************************************************/ /*ARGSUSED*/ static void ListEnter(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.DragID) { XtRemoveTimeOut(lw->list.DragID); lw->list.DragID = 0; } if ((_XmGetFocusPolicy((Widget) lw) == XmPOINTER) && (lw->primitive.highlight_on_enter)) { lw->list.Traversing = TRUE; DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } if ((_XmGetFocusPolicy((Widget) lw) == XmPOINTER) && (lw->list.matchBehavior == XmQUICK_NAVIGATE)) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetFocusValues(wid, XmNspotLocation, &xmim_point, NULL); } _XmPrimitiveEnter((Widget) lw, event, NULL, NULL); } /************************************************************************ * * * MakeItemVisible - scroll the list (if needed) such that the given * * item is visible * * * ************************************************************************/ static void MakeItemVisible(XmListWidget lw, int item) { if (item < lw->list.top_position) { if (lw->list.vScrollBar) { DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = item; DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } } if (item >= (lw->list.top_position + lw->list.visibleItemCount)) { if (!(lw->list.vScrollBar)) return; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = item - (lw->list.visibleItemCount - 1); DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } } /************************************************************************ * * * PrevElement - called when the user hits Up arrow. * * * ************************************************************************/ /*ARGSUSED*/ static void PrevElement(XmListWidget lw, XEvent *event, String *params, Cardinal *num_params) { int item, olditem; if (!(lw->list.items && lw->list.itemCount)) return; item = lw->list.CurrentKbdItem - 1; if (item < 0) return; if ((!lw->list.Mom) && (item < lw->list.top_position)) return; MakeItemVisible(lw, item); olditem = lw->list.CurrentKbdItem; DrawHighlight(lw, olditem, FALSE); lw->list.CurrentKbdItem = item; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { if (lw->list.AutoSelectionType == XmAUTO_UNSET) lw->list.AutoSelectionType = XmAUTO_CHANGE; HandleNewItem(lw, item, olditem); } else if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) HandleExtendedItem(lw, item); DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } /************************************************************************ * * * NextElement - called when the user hits Down arrow. * * * ************************************************************************/ /*ARGSUSED*/ static void NextElement(XmListWidget lw, XEvent *event, String *params, Cardinal *num_params) { int item, olditem; if (!(lw->list.items && lw->list.itemCount)) return; item = lw->list.CurrentKbdItem + 1; if (item >= lw->list.itemCount) return; if ((!lw->list.Mom) && (item >= (lw->list.top_position + lw->list.visibleItemCount))) return; MakeItemVisible(lw, item); olditem = lw->list.CurrentKbdItem; DrawHighlight(lw, olditem, FALSE); lw->list.CurrentKbdItem = item; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { if (lw->list.AutoSelectionType == XmAUTO_UNSET) lw->list.AutoSelectionType = XmAUTO_CHANGE; HandleNewItem(lw, item, olditem); } else if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { HandleExtendedItem(lw, item); } DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); } /************************************************************************ * * * Normal Next Element * * * ************************************************************************/ static void NormalNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = FALSE; lw->list.Event &= ~(SHIFTDOWN | CTRLDOWN | ALTDOWN); lw->list.SelectionType = XmINITIAL; NextElement(lw, event, params, num_params); } /************************************************************************ * * * Shift Next Element * * * ************************************************************************/ static void ShiftNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= SHIFTDOWN; lw->list.SelectionType = XmMODIFICATION; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) lw->list.AutoSelectionType = XmAUTO_CHANGE; NextElement(lw, event, params, num_params); lw->list.Event = 0; lw->list.AppendInProgress = FALSE; } /************************************************************************ * * * Ctrl Next Element * * * ************************************************************************/ static void CtrlNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= CTRLDOWN; lw->list.SelectionType = XmADDITION; NextElement(lw, event, params, num_params); lw->list.Event = 0; lw->list.AppendInProgress = FALSE; } /************************************************************************ * * * ExtendAdd Next Element * * * ************************************************************************/ static void ExtendAddNextElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= (SHIFTDOWN | CTRLDOWN); lw->list.SelectionType = XmMODIFICATION; NextElement(lw, event, params, num_params); lw->list.Event = 0; lw->list.AppendInProgress = FALSE; } /************************************************************************ * * * Normal Prev Element * * * ************************************************************************/ static void NormalPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = FALSE; lw->list.Event &= ~(SHIFTDOWN | CTRLDOWN | ALTDOWN); lw->list.SelectionType = XmINITIAL; PrevElement(lw, event, params, num_params); } /************************************************************************ * * * Shift Prev Element * * * ************************************************************************/ static void ShiftPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= SHIFTDOWN; lw->list.SelectionType = XmMODIFICATION; if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) lw->list.AutoSelectionType = XmAUTO_CHANGE; PrevElement(lw, event, params, num_params); lw->list.Event = 0; lw->list.AppendInProgress = FALSE; } /************************************************************************ * * * Ctrl Prev Element * * * ************************************************************************/ static void CtrlPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= CTRLDOWN; lw->list.SelectionType = XmADDITION; PrevElement(lw, event, params, num_params); lw->list.Event = 0; lw->list.AppendInProgress = FALSE; } /************************************************************************ * * * ExtendAdd Prev Element * * * ************************************************************************/ static void ExtendAddPrevElement(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (lw->list.SelectionPolicy != XmEXTENDED_SELECT) return; /* CR 6182: Let actions work from accelerators. */ if ((XtWindow((Widget) lw) == event->xany.window) && !lw->list.Traversing) return; lw->list.AppendInProgress = TRUE; lw->list.Event |= (SHIFTDOWN | CTRLDOWN); lw->list.SelectionType = XmMODIFICATION; PrevElement(lw, event, params, num_params); lw->list.Event = 0; lw->list.AppendInProgress = FALSE; } /************************************************************************ * * * PrevPage - called when the user hits PgUp * * * ************************************************************************/ /*ARGSUSED*/ static void KbdPrevPage(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int item, olditem, newtop; if (!(lw->list.items && lw->list.itemCount)) return; if (lw->list.top_position == 0) return; if (!lw->list.Mom) return; newtop = lw->list.top_position - lw->list.visibleItemCount + 1; ASSIGN_MAX(newtop, 0); item = lw->list.CurrentKbdItem - lw->list.visibleItemCount + 1; ASSIGN_MAX(item, 0); DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); olditem = lw->list.CurrentKbdItem; if (lw->list.vScrollBar) { lw->list.top_position = newtop; lw->list.CurrentKbdItem = item; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } else DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { if (lw->list.AutoSelectionType == XmAUTO_UNSET) lw->list.AutoSelectionType = XmAUTO_CHANGE; HandleNewItem(lw, item, olditem); } else if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) HandleExtendedItem(lw, item); } /************************************************************************ * * * NextPage - called when the user hits PgDn * * * ************************************************************************/ /*ARGSUSED*/ static void KbdNextPage(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int item, olditem, newtop; if (!(lw->list.items && lw->list.itemCount)) return; if (!lw->list.Mom) return; if (lw->list.top_position >= (lw->list.itemCount - lw->list.visibleItemCount)) return; newtop = lw->list.top_position + (lw->list.visibleItemCount - 1); ASSIGN_MIN(newtop, (lw->list.itemCount - lw->list.visibleItemCount)); item = lw->list.CurrentKbdItem + (lw->list.visibleItemCount - 1); if (item >= lw->list.itemCount) item = lw->list.itemCount - 1; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); olditem = lw->list.CurrentKbdItem; if (lw->list.vScrollBar) { lw->list.top_position = newtop; lw->list.CurrentKbdItem = item; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } else DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { if (lw->list.AutoSelectionType == XmAUTO_UNSET) lw->list.AutoSelectionType = XmAUTO_CHANGE; HandleNewItem(lw, item, olditem); } else if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) HandleExtendedItem(lw, item); } /************************************************************************ * * * KbdLeftChar - called when user hits left arrow. * * * ************************************************************************/ /*ARGSUSED*/ static void KbdLeftChar(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int pos; if (!lw->list.Mom) return; if (LayoutIsRtoLP(lw)) { pos = lw->list.hOrigin + CHAR_WIDTH_GUESS; if ((lw->list.hExtent + pos) > lw->list.hmax) pos = lw->list.hmax - lw->list.hExtent; } else { pos = lw->list.hOrigin - CHAR_WIDTH_GUESS; } XmListSetHorizPos((Widget) lw, pos); } /************************************************************************ * * * KbdLeftPage - called when user hits ctrl left arrow. * * * ************************************************************************/ /*ARGSUSED*/ static void KbdLeftPage(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int pos; if (!lw->list.Mom) return; if (LayoutIsRtoLP(lw)) { pos = lw->list.hOrigin + (lw->core.width - CHAR_WIDTH_GUESS - 2 * (int)(lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness)); if ((lw->list.hExtent + pos) > lw->list.hmax) pos = lw->list.hmax - lw->list.hExtent; } else { pos = lw->list.hOrigin - (lw->core.width - CHAR_WIDTH_GUESS - 2 * (int)(lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness)); } XmListSetHorizPos((Widget) lw, pos); } /************************************************************************ * * * Begin Line - go to the beginning of the line * * * ************************************************************************/ /*ARGSUSED*/ static void BeginLine(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (!lw->list.Mom) return; XmListSetHorizPos((Widget) lw, 0); } /************************************************************************ * * * KbdRightChar - called when user hits right arrow. * * * ************************************************************************/ /*ARGSUSED*/ static void KbdRightChar(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int pos; if (!lw->list.Mom) return; if (LayoutIsRtoLP(lw)) { pos = lw->list.hOrigin - CHAR_WIDTH_GUESS; } else { pos = lw->list.hOrigin + CHAR_WIDTH_GUESS; if ((lw->list.hExtent + pos) > lw->list.hmax) pos = lw->list.hmax - lw->list.hExtent; } XmListSetHorizPos((Widget) lw, pos); } /************************************************************************ * * * KbdRightPage - called when user hits ctrl right arrow. * * * ************************************************************************/ /*ARGSUSED*/ static void KbdRightPage(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int pos; if (!lw->list.Mom) return; if (LayoutIsRtoLP(lw)) { pos = lw->list.hOrigin - (lw->core.width - CHAR_WIDTH_GUESS - 2 * (int)(lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness)); } else { pos = lw->list.hOrigin + (lw->core.width - CHAR_WIDTH_GUESS - 2 * (int)(lw->list.margin_width + lw->list.HighlightThickness + lw->primitive.shadow_thickness)); if ((lw->list.hExtent + pos) > lw->list.hmax) pos = lw->list.hmax - lw->list.hExtent; } XmListSetHorizPos((Widget) lw, pos); } /************************************************************************ * * * End Line - go to the end of the line * * * ************************************************************************/ /*ARGSUSED*/ static void EndLine(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; if (!lw->list.Mom) return; XmListSetHorizPos((Widget) lw, lw->list.hmax - lw->list.hExtent); } /************************************************************************ * * * TopItem - go to the top item * * * ************************************************************************/ /*ARGSUSED*/ static void TopItem(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int newtop; if (!(lw->list.items && lw->list.itemCount)) return; if (!lw->list.Mom) newtop = lw->list.top_position; else newtop = 0; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.CurrentKbdItem = newtop; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } XmListSetPos((Widget) lw, newtop + 1); if (lw->list.SelectionMode == XmNORMAL_MODE) XmListSelectPos((Widget) lw, newtop + 1, TRUE); lw->list.StartItem = newtop; } /************************************************************************ * * * EndItem - go to the bottom item * * * ************************************************************************/ /*ARGSUSED*/ static void EndItem(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int newbot; if (!(lw->list.items && lw->list.itemCount)) return; if (!lw->list.Mom) { newbot = (lw->list.top_position + lw->list.visibleItemCount - 1); if (newbot >= (lw->list.itemCount - 1)) newbot = lw->list.itemCount - 1; } else newbot = lw->list.itemCount - 1; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.CurrentKbdItem = newbot; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } XmListSetBottomPos((Widget) lw, newbot + 1); DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); if (lw->list.SelectionMode == XmNORMAL_MODE) XmListSelectPos((Widget) lw, newbot + 1, TRUE); } /************************************************************************ * * * ExtendTopItem - Extend the selection to the top item * * * ************************************************************************/ /*ARGSUSED*/ static void ExtendTopItem(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int item, olditem; if (!(lw->list.items && lw->list.itemCount)) return; if ((lw->list.SelectionPolicy == XmBROWSE_SELECT) || (lw->list.SelectionPolicy == XmSINGLE_SELECT)) return; lw->list.Event |= (SHIFTDOWN); if (!lw->list.Mom) item = lw->list.top_position; else item = 0; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); olditem = lw->list.CurrentKbdItem; lw->list.top_position = item; lw->list.CurrentKbdItem = item; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } DrawList(lw, NULL, TRUE); if (lw->list.vScrollBar) SetVerticalScrollbar(lw); if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.SelectionPolicy == XmBROWSE_SELECT)) HandleNewItem(lw, item, olditem); else if (lw->list.SelectionPolicy == XmEXTENDED_SELECT) HandleExtendedItem(lw, item); lw->list.Event = 0; } /************************************************************************ * * * ExtendEndItem - extend the selection to the bottom item * * * ************************************************************************/ /*ARGSUSED*/ static void ExtendEndItem(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int item, newitem, olditem; if (!(lw->list.items && lw->list.itemCount)) return; if ((lw->list.SelectionPolicy == XmBROWSE_SELECT) || (lw->list.SelectionPolicy == XmSINGLE_SELECT)) return; lw->list.Event |= (SHIFTDOWN); newitem = lw->list.itemCount - lw->list.visibleItemCount; ASSIGN_MAX(newitem, 0); item = lw->list.itemCount - 1; if (!lw->list.Mom) { newitem = lw->list.top_position; item = newitem + lw->list.visibleItemCount; if (item >= lw->list.itemCount) item = lw->list.itemCount - 1; } DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); olditem = lw->list.CurrentKbdItem; lw->list.CurrentKbdItem = item; lw->list.top_position = newitem; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } DrawList(lw, NULL, TRUE); if (lw->list.vScrollBar) SetVerticalScrollbar(lw); if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.SelectionPolicy == XmBROWSE_SELECT)) HandleNewItem(lw, item, olditem); else if (lw->list.SelectionPolicy == XmEXTENDED_SELECT) HandleExtendedItem(lw, item); lw->list.Event = 0; } /*************************************************************************** * * * ListItemVisible - make the current keyboard item visible. * * * ***************************************************************************/ /*ARGSUSED*/ static void ListItemVisible(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int item, percentage; if (!(lw->list.items && lw->list.itemCount)) return; if (!lw->list.Mom) return; if (*num_params == 0) { item = WhichItem(lw, event->xbutton.y); if (item > 0) item -= lw->list.top_position; if ((item < 0) || (item >= lw->list.itemCount)) return; } else { sscanf(*params, "%d", &percentage); if (percentage == 100) percentage--; item = (lw->list.visibleItemCount * percentage) /100; } DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = lw->list.CurrentKbdItem - item; ASSIGN_MAX(lw->list.top_position, 0); DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } /*************************************************************************** * * * ListCopyToClipboard - copy the current selected items to the clipboard. * * * * This is a *sloow* process... * * * ***************************************************************************/ /*ARGSUSED*/ static void ListCopyToClipboard(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; /* * text to the clipboard */ if (lw->list.selectedItemCount > 0) (void) XmeClipboardSource(wid, XmCOPY, 0); } /*ARGSUSED*/ static void DragDropFinished(Widget w, /* unused */ XtPointer closure, XtPointer call_data) /* unused */ { int i; XmListWidget lw = (XmListWidget)closure; XmListDragConvertStruct *ListDragConv = lw->list.drag_conv; for (i = 0; i < ListDragConv->num_strings; i++) XmStringFree(ListDragConv->strings[i]); XtFree((char *) ListDragConv->strings); XtFree((char *) ListDragConv); } /*************************************************************************** * * * ListProcessDrag - drag the selected items * * * ***************************************************************************/ /*ARGSUSED*/ static void ListProcessDrag(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmListWidget lw = (XmListWidget) wid; register int i; int item = 0; Widget drag_icon, dc; Arg args[10]; int n, location_data; XmListDragConvertStruct *ListDragConv; /* Dequeue any pending drag initiation just to be safe. */ if (lw->list.drag_start_timer) { XtRemoveTimeOut(lw->list.drag_start_timer); lw->list.drag_start_timer = 0; lw->list.drag_abort_action = NULL; } /* CR 5141: Don't allow multi-button drags. */ if (event->xbutton.state & ~((Button1Mask >> 1) << event->xbutton.button) & (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)) return; if (!(lw->list.items && lw->list.itemCount)) return; item = WhichItem(lw, event->xbutton.y); if ((item < 0) || (item >= lw->list.itemCount)) return; location_data = 0; lw->list.drag_conv = ListDragConv = (XmListDragConvertStruct *) XtMalloc(sizeof(XmListDragConvertStruct)); ListDragConv->w = wid; if (lw->list.InternalList[item]->selected) { /* CR 8878: selectedItems may contain extraneous items. */ ListDragConv->strings = (XmString *) XtMalloc(sizeof(XmString) * lw->list.selectedPositionCount); ListDragConv->num_strings = lw->list.selectedPositionCount; for (i = 0; i < lw->list.selectedPositionCount; i++) { ListDragConv->strings[i] = XmStringCopy(lw->list.items[lw->list.selectedPositions[i] - 1]); } } else { ListDragConv->strings = (XmString *) XtMalloc(sizeof(XmString)); ListDragConv->num_strings = 1; ListDragConv->strings[0] = XmStringCopy(lw->list.items[item]); location_data = item; } /* OK, now start the drag... */ drag_icon = XmeGetTextualDragIcon(wid); n = 0; XtSetArg(args[n], XmNcursorForeground, lw->primitive.foreground), n++; XtSetArg(args[n], XmNcursorBackground, lw->core.background_pixel), n++; XtSetArg(args[n], XmNsourceCursorIcon, drag_icon), n++; XtSetArg(args[n], XmNdragOperations, XmDROP_COPY), n++; dc = XmeDragSource(wid, (XtPointer) (long) location_data, event, args, n); if (dc) XtAddCallback(dc, XmNdragDropFinishCallback, DragDropFinished, lw); else DragDropFinished(dc, lw, NULL); } /* * DragStart - begin a delayed drag. */ /*ARGSUSED*/ static void DragStart(XtPointer closure, XtIntervalId *id) /* unused */ { XmListWidget lw = (XmListWidget) closure; lw->list.drag_start_timer = 0; lw->list.drag_abort_action = NULL; ListProcessDrag((Widget) lw, &lw->list.drag_event, NULL, NULL); } /************************************************************************ * * * ListProcessBtn1 - handle enableBtn1Transfer. This action expects * * one parameter; the action to invoke if not dragging. This is * * the "normal" behavior for Button1. * * * ************************************************************************/ static void ListProcessBtn1(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XtEnum btn1_transfer; XmListWidget lw = (XmListWidget) wid; int item; XmDisplay dpy; if ((*num_params != 1) || !XmIsList(wid)) return; dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); btn1_transfer = dpy->display.enable_btn1_transfer; switch (btn1_transfer) { case XmOFF: /* Invoke the normal action. */ if (*num_params > 0) XtCallActionProc(wid, params[0], event, params, *num_params); break; case XmBUTTON2_ADJUST: case XmBUTTON2_TRANSFER: /* Invoke the normal action unless already considering dragging */ /* or a ButtonPress over a selected item. */ if (!lw->list.drag_start_timer && ((event->xany.type != ButtonPress) || ((item = WhichItem(lw, event->xbutton.y)) < 0) || (item >= lw->list.itemCount) || !OnSelectedList(lw, lw->list.items[item], item))) { XtCallActionProc(wid, params[0], event, params, *num_params); } else { switch(event->xany.type) { case ButtonPress: /* Queue a drag on the first button press only. */ if ((!lw->list.drag_start_timer) && !(event->xbutton.state & ~((Button1Mask >> 1) << event->xbutton.button) & (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask))) { /* Delay starting the drag briefly. */ memcpy(&lw->list.drag_event, event, sizeof(XButtonPressedEvent)); lw->list.drag_abort_action = params[0]; lw->list.drag_start_timer = XtAppAddTimeOut(XtWidgetToApplicationContext(wid), XtGetMultiClickTime(XtDisplay(wid)), DragStart, (XtPointer) lw); } else if (lw->list.drag_start_timer) { XtRemoveTimeOut(lw->list.drag_start_timer); lw->list.drag_start_timer = 0; /* If we guessed wrong about starting a drag we should */ /* still attempt the original "normal" actions. */ XtCallActionProc(wid, lw->list.drag_abort_action, &lw->list.drag_event, params, *num_params); XtCallActionProc(wid, params[0], event, params, *num_params); lw->list.drag_abort_action = NULL; } break; case ButtonRelease: /* Cancel any pending drag. */ if (lw->list.drag_start_timer) { XtRemoveTimeOut(lw->list.drag_start_timer); lw->list.drag_start_timer = 0; /* If we guessed wrong about starting a drag we should */ /* still attempt the original "normal" actions. */ XtCallActionProc(wid, lw->list.drag_abort_action, &lw->list.drag_event, params, *num_params); XtCallActionProc(wid, params[0], event, params, *num_params); lw->list.drag_abort_action = NULL; } break; case MotionNotify: /* Start a drag if we've moved far enough. */ if (lw->list.drag_start_timer) { int dx = ((int)lw->list.drag_event.xbutton.x_root - (int)event->xmotion.x_root); int dy = ((int)lw->list.drag_event.xbutton.y_root - (int)event->xmotion.y_root); if ((ABS(dx) > MOTION_THRESHOLD) || (ABS(dy) > MOTION_THRESHOLD)) { /* Start the drag now. */ if (lw->list.drag_start_timer) XtRemoveTimeOut(lw->list.drag_start_timer); DragStart((XtPointer)lw, &lw->list.drag_start_timer); } } break; default: break; } } break; default: assert(FALSE); break; } } /************************************************************************ * * * ListProcessBtn2 - handle enableBtn1Transfer. This action expects * * one parameter; the action to invoke if not dragging. This is * * the "alternate" behavior for Button2. * * * ************************************************************************/ static void ListProcessBtn2(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XtEnum btn1_transfer; XmListWidget lw = (XmListWidget) wid; XmDisplay dpy; if ((*num_params != 1) || !XmIsList(wid)) return; /* If there is a pending drag reject both actions. */ if (lw->list.drag_start_timer) { XtRemoveTimeOut(lw->list.drag_start_timer); lw->list.drag_start_timer = 0; lw->list.drag_abort_action = NULL; return; } dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); btn1_transfer = dpy->display.enable_btn1_transfer; switch (btn1_transfer) { case XmOFF: case XmBUTTON2_TRANSFER: /* Invoke the normal action by starting a drag immediately. */ if (event->xany.type == ButtonPress) ListProcessDrag(wid, event, params, num_params); break; case XmBUTTON2_ADJUST: /* Invoke the alternate action. */ XtCallActionProc(wid, params[0], event, params, *num_params); break; default: assert(FALSE); break; } } /*************************************************************************** * * * ListQuickNavigate - navigate to an item * * * ***************************************************************************/ /*ARGSUSED*/ static void ListQuickNavigate(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; char input_string[LIST_MAX_INPUT_SIZE + 1]; int input_length; Status status_return; Boolean found = False; int i; wchar_t input_char; if (lw->list.matchBehavior != XmQUICK_NAVIGATE) return; /* Determine what was pressed. */ input_length = XmImMbLookupString(wid, (XKeyEvent *) event, input_string, LIST_MAX_INPUT_SIZE, (KeySym *) NULL, &status_return); /* If there is more data than we can handle, bail out. */ if (((status_return == XLookupChars) || (status_return == XLookupBoth)) && (input_length > 0)) { if (lw->list.itemCount > 0) { /* Convert input to a wchar_t for easy comparison. */ (void) mbtowc(&input_char, NULL, 0); (void) mbtowc(&input_char, input_string, input_length); /* Search forward from the current position. */ for (i = lw->list.CurrentKbdItem + 1; i < lw->list.itemCount; i++) if (CompareCharAndItem(lw, input_char, i)) { found = True; break; } /* Wrap around to the start of the list if necessary. */ if (!found) { for (i = 0; i <= lw->list.CurrentKbdItem; i++) if (CompareCharAndItem(lw, input_char, i)) { found = True; break; } } } if (!found) XBell(XtDisplay(wid), 0); } } /*************************************************************************** * * * FirstChar - return the first wchar in an XmString. * * * ***************************************************************************/ static wchar_t FirstChar(XmString string) { /* This code is patterned on _XmStringGetTextConcat. */ _XmStringContextRec stack_context; XmStringComponentType type; unsigned int len; XtPointer val; wchar_t result = 0; if (string != NULL) { _XmStringContextReInit(&stack_context, string); (void) mbtowc(&result, NULL, 0); while((result == 0) && ((type = XmeStringGetComponent(&stack_context, TRUE, FALSE, &len, &val)) != XmSTRING_COMPONENT_END)) { switch( type) { case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: if (len) (void) mbtowc(&result, (char*)val, len); break; case XmSTRING_COMPONENT_WIDECHAR_TEXT: if (len) result = *((wchar_t*) val); break; default: break; } } _XmStringContextFree(&stack_context); } return result; } /*************************************************************************** * * * CompareCharAndItem * * * ***************************************************************************/ static Boolean CompareCharAndItem(XmListWidget lw, wchar_t input_char, int pos) { if (lw->list.InternalList[pos]->first_char == 0) lw->list.InternalList[pos]->first_char = FirstChar(lw->list.items[pos]); if (input_char == lw->list.InternalList[pos]->first_char) { XmListSetKbdItemPos((Widget) lw, pos + 1); XmListSelectPos((Widget) lw, pos + 1, True); return True; } return False; } /*************************************************************************** * * * ListConvert - Convert routine for dragNDrop. * * * ***************************************************************************/ /*ARGSUSED*/ static void ListConvert(Widget w, XtPointer client_data, XmConvertCallbackStruct *cs) { enum { XmA_MOTIF_COMPOUND_STRING, XmACOMPOUND_TEXT, XmATEXT, XmATARGETS, XmA_MOTIF_DROP, XmA_MOTIF_LOSE_SELECTION, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_COMPOUND_STRING, XmSCOMPOUND_TEXT, XmSTEXT, XmSTARGETS, XmS_MOTIF_DROP, XmS_MOTIF_LOSE_SELECTION, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSUTF8_STRING }; Atom atoms[XtNumber(atom_names)]; Atom C_ENCODING = XmeGetEncodingAtom(w); int target_count = 0; int i; Atom type = None; XtPointer value = NULL; unsigned long size = 0; int format = 8; XmListWidget lw = (XmListWidget) w; XmListDragConvertStruct *ListDragConv = lw->list.drag_conv; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); if (cs->target == atoms[XmATARGETS]) { Atom *targs = XmeStandardTargets(w, 5, &target_count); value = (XtPointer) targs; targs[target_count++] = atoms[XmA_MOTIF_COMPOUND_STRING]; targs[target_count++] = atoms[XmACOMPOUND_TEXT]; targs[target_count++] = atoms[XmATEXT]; targs[target_count++] = atoms[XmAUTF8_STRING]; targs[target_count++] = C_ENCODING; if (XA_STRING != C_ENCODING) targs[target_count++] = XA_STRING; type = XA_ATOM; size = target_count; format = 32; } else if ((cs->target == atoms[XmA_MOTIF_EXPORT_TARGETS]) || (cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS])) { Atom *targs = (Atom *) XtMalloc(sizeof(Atom) * 5); int n = 0; value = (XtPointer) targs; targs[n++] = atoms[XmA_MOTIF_COMPOUND_STRING]; targs[n++] = atoms[XmACOMPOUND_TEXT]; targs[n++] = atoms[XmATEXT]; targs[n++] = C_ENCODING; if (XA_STRING != C_ENCODING) targs[n++] = XA_STRING; format = 32; size = n; type = XA_ATOM; cs->status = XmCONVERT_DONE; } else if (cs->target == atoms[XmACOMPOUND_TEXT] || cs->target == atoms[XmA_MOTIF_COMPOUND_STRING] || cs->target == XA_STRING || cs->target == C_ENCODING || cs->target == atoms[XmATEXT] || cs->target == atoms[XmAUTF8_STRING]) { XmString concat; XmString sep = XmStringSeparatorCreate(); format = 8; if (cs->selection == atoms[XmA_MOTIF_DROP]) { int itemcount = ListDragConv->num_strings; XmString *items = ListDragConv->strings; concat = (itemcount ? XmStringCopy(items[0]) : NULL); for (i = 1; i < itemcount; i++) { concat = XmStringConcatAndFree(concat, XmStringCopy(sep)); concat = XmStringConcatAndFree(concat, XmStringCopy(items[i])); } } else { /* The selectedItems array may contain extraneous entries. */ int itemcount = lw->list.selectedPositionCount; XmString *items = lw->list.items; int *pos = lw->list.selectedPositions; concat = (itemcount ? XmStringCopy(items[pos[0] - 1]) : NULL); for (i = 1; i < itemcount; i++) { concat = XmStringConcatAndFree(concat, XmStringCopy(sep)); concat = XmStringConcatAndFree(concat, XmStringCopy(items[pos[i] - 1])); } } if (cs->target == atoms[XmACOMPOUND_TEXT] || cs->target == C_ENCODING || cs->target == XA_STRING || cs->target == atoms[XmATEXT]) { if (concat != NULL) value = XmCvtXmStringToCT(concat); else value = NULL; type = atoms[XmACOMPOUND_TEXT]; if (value != NULL) size = strlen((char*) value); else size = 0; if (cs->target == XA_STRING) { XTextProperty tmp_prop; int ret_status; /* convert value to 8859.1 */ ret_status = XmbTextListToTextProperty(XtDisplay(w), (char**) &value, 1, (XICCEncodingStyle) XStringStyle, &tmp_prop); XtFree((char*) value); if (ret_status == Success || ret_status > 0) { value = (XtPointer) tmp_prop.value; type = XA_STRING; size = tmp_prop.nitems; } else { value = NULL; size = 0; } /* If the target was TEXT then try and convert it. If * fully converted then we'll pass it back in locale * text. For locale text requests, always pass * back the converted text */ } else if ((cs->target == atoms[XmATEXT] || cs->target == C_ENCODING) && (value != NULL)) { char *cvt; Boolean success; cvt = _XmTextToLocaleText(w, value, type, format, size, &success); if ((cvt != NULL && success) || cs->target == C_ENCODING) { if (! success && cvt != NULL) cs->flags |= XmCONVERTING_PARTIAL; XtFree((char*) value); value = cvt; type = C_ENCODING; } } } #ifdef UTF8_SUPPORTED else if (cs->target == atoms[XmAUTF8_STRING]) { type = atoms[XmAUTF8_STRING]; value = XmCvtXmStringToUTF8String(concat); if (value != NULL) size = strlen((char*) value); else size = 0; } #endif else { size = XmCvtXmStringToByteStream(concat, (unsigned char**) &value); type = atoms[XmA_MOTIF_COMPOUND_STRING]; } XmStringFree(concat); XmStringFree(sep); } else if (cs->target == atoms[XmA_MOTIF_LOSE_SELECTION]) { /* Deselect everything in the list since we lost the primary selection. */ XmListDeselectAllItems(w); } _XmConvertComplete(w, value, size, format, type, cs); } /*ARGSUSED*/ static void ListPreDestProc(Widget w, XtPointer ignore, /* unused */ XmDestinationCallbackStruct *cs) { XmDropProcCallbackStruct *ds; Atom XA_MOTIF_DROP = XInternAtom(XtDisplay(w), XmS_MOTIF_DROP, False); int index; if (cs->selection != XA_MOTIF_DROP) return; /* If this is the result of a drop, we can fill in location_data with * the apparent site */ ds = (XmDropProcCallbackStruct *) cs->destination_data; index = XmListYToPos(w, ds->y); cs->location_data = (XtPointer) (long) index; } /************************************************************************ * * * Spiffy API entry points * * * ************************************************************************/ /************************************************************************ * * * XmListAddItem - add the item at the specified position. * * * ************************************************************************/ void XmListAddItem(Widget w, XmString item, int pos) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); APIAddItems(lw, &item, 1, pos, TRUE); _XmAppUnlock(app); } /*************************************************************************** * * * APIAddItems - do all the work for the XmListAddItems and * * AddItemsUnselected functions. * * * ***************************************************************************/ static void APIAddItems(XmListWidget lw, XmString *items, int item_count, int pos, Boolean select) { int intern_pos = pos - 1; Boolean bot = FALSE; Boolean change_managed; Boolean selectable; register int i; int nsel = lw->list.selectedPositionCount; Dimension old_max_height = lw->list.MaxItemHeight; if ((items == NULL) || (item_count == 0)) return; if ((intern_pos < 0) || (intern_pos >= lw->list.itemCount)) { intern_pos = lw->list.itemCount; pos = lw->list.itemCount + 1; bot = TRUE; } if ((lw->list.Traversing) && (intern_pos <= lw->list.CurrentKbdItem) && !bot) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); selectable = (select && (lw->list.SelectionPolicy != XmSINGLE_SELECT) && (lw->list.SelectionPolicy != XmBROWSE_SELECT)); AddItems(lw, items, item_count, intern_pos); nsel += AddInternalElements(lw, lw->list.items + intern_pos, item_count, pos, selectable); if ((intern_pos <= lw->list.CurrentKbdItem) && (lw->list.itemCount > 1) && !bot) { lw->list.CurrentKbdItem += item_count; /* CR 5804: Don't check lw->list.AutoSelect here. */ if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) lw->list.LastHLItem += item_count; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } } /* CR 5833: Enforce single/browse selection_policy. */ if (select && !selectable) { /* Find the last matching item. */ assert(lw->list.selectedPositionCount <= 1); i = item_count; while (i-- > 0) { if (OnSelectedList(lw, items[i], intern_pos + i)) { /* Select the last of the matching new items. */ lw->list.InternalList[intern_pos + i]->selected = TRUE; lw->list.InternalList[intern_pos + i]->last_selected = TRUE; lw->list.InternalList[intern_pos + i]->LastTimeDrawn = FALSE; nsel++; /* Deselect the previous selected item. */ if (lw->list.selectedPositionCount > 0) { int old_sel = lw->list.selectedPositions[0]; if (old_sel >= pos) old_sel += item_count; lw->list.InternalList[old_sel - 1]->selected = FALSE; lw->list.InternalList[old_sel - 1]->last_selected = FALSE; nsel--; if (old_sel <= (lw->list.top_position + lw->list.visibleItemCount)) DrawItem((Widget) lw, old_sel - 1); UpdateSelectedList(lw, TRUE); } break; } } } /* CR 9443: Inserting before selected items requires update too. */ if (select || (nsel != lw->list.selectedPositionCount) || (nsel && (intern_pos < lw->list.selectedPositions[nsel - 1]))) UpdateSelectedPositions(lw, nsel); if (intern_pos < (lw->list.top_position + lw->list.visibleItemCount)) DrawList(lw, NULL, TRUE); SetNewSize(lw, False, False, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); change_managed = SetVerticalScrollbar(lw); if (change_managed && lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); /* SetTraversal(lw); */ } /************************************************************************ * * * XmListAddItems - add the items starting at the specified position. * * * ************************************************************************/ void XmListAddItems(Widget w, XmString *items, int item_count, int pos) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); APIAddItems(lw, items, item_count, pos, TRUE); _XmAppUnlock(app); } /************************************************************************ * * * XmListAddItemsUnselected - add the items starting at the specified * * The selected List is not checked. * * * ************************************************************************/ void XmListAddItemsUnselected(Widget w, XmString *items, int item_count, int pos) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); APIAddItems(lw, items, item_count, pos, FALSE); _XmAppUnlock(app); } /************************************************************************ * * * XmListAddItemUnselected - add the item at the specified position. * * This does not check the selected list - the item is assumed to * * be unselected. * * * ************************************************************************/ void XmListAddItemUnselected(Widget w, XmString item, int pos) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); APIAddItems(lw, &item, 1, pos, FALSE); _XmAppUnlock(app); } /************************************************************************ * * * XmListDeleteItem - delete the specified item from the list. * * * ************************************************************************/ void XmListDeleteItem(Widget w, XmString item) { XmListWidget lw = (XmListWidget) w; int item_pos; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { XmeWarning((Widget) lw, ListMessage8); _XmAppUnlock(app); return; } item_pos = ItemNumber(lw, item); if (item_pos < 1 || item_pos > lw->list.itemCount) { XmeWarning((Widget) lw, ListMessage8); _XmAppUnlock(app); return; } APIDeletePositions(lw, &item_pos, 1, TRUE); _XmAppUnlock(app); } /************************************************************************ * * * CleanUpList - redraw the list if the items go to 0, and check for * * traversal locations. * * ** NOTE: CAN ONLY BE USED FROM API DELETE ROUTINES ** * * * ************************************************************************/ static void CleanUpList(XmListWidget lw, Boolean always) { Dimension VertMargin, HorzMargin; /* Special case for deleting the last item */ if (always || !lw->list.itemCount) { HorzMargin = lw->list.margin_width + lw->primitive.shadow_thickness; VertMargin = lw->list.margin_height + lw->primitive.shadow_thickness; if (XtIsRealized((Widget)lw)) XClearArea(XtDisplay (lw), XtWindow (lw), HorzMargin, VertMargin, lw->core.width - (2 * HorzMargin), lw->core.height - (2 * VertMargin), False); } } /************************************************************************ * * * XmListDeleteItems - delete the specified items from the list. * * * ************************************************************************/ void XmListDeleteItems(Widget w, XmString *items, int item_count) { XmListWidget lw = (XmListWidget) w; Boolean redraw = FALSE; Boolean reset_width = FALSE; Boolean reset_height = FALSE; Boolean rebuild_selection = FALSE; Dimension old_max_height = lw->list.MaxItemHeight; int item_pos; XmString *copy; register int i; _XmWidgetToAppContext(w); if ((items == NULL) || (item_count == 0)) return; _XmAppLock(app); if (lw->list.itemCount < 1) { XmeWarning((Widget) lw, ListMessage8); _XmAppUnlock(app); return; } /* Make a copy of items in case of XmNitems from w */ copy = (XmString *)ALLOCATE_LOCAL(item_count * sizeof(XmString)); for (i = 0; i < item_count; i++) copy[i] = XmStringCopy(items[i]); DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); for (i = 0; i < item_count; i++) { item_pos = ItemNumber(lw, copy[i]); if (item_pos < 1 || item_pos > lw->list.itemCount) XmeWarning(w, ListMessage8); else { if (lw->list.CurrentKbdItem >= (item_pos - 1)) { /* CR 8444: Don't let CurrentKbdItem go negative. */ if (lw->list.CurrentKbdItem > 0) lw->list.CurrentKbdItem--; } /* Fix for 2798 - If the LastHLItem is the item that * has been deleted, decrement the LastHLItem. */ if ((lw->list.LastHLItem > 0) && (lw->list.LastHLItem == (item_pos - 1))) lw->list.LastHLItem--; /* End Fix 2798 */ /* change < to <= since item_pos starts with 1 not 0 */ if (item_pos <= (lw->list.top_position + lw->list.visibleItemCount)) redraw = TRUE; reset_width |= (lw->list.InternalList[item_pos - 1]->width >= lw->list.MaxWidth); reset_height |= (lw->list.InternalList[item_pos - 1]->height >= lw->list.MaxItemHeight); DeleteItems(lw, 1, item_pos - 1); rebuild_selection |= DeleteInternalElements(lw, NULL, item_pos, 1); } } UpdateSelectedList(lw, rebuild_selection); UpdateSelectedPositions(lw, lw->list.selectedItemCount); if (lw->list.itemCount) { if ((lw->list.itemCount - lw->list.top_position) < lw->list.visibleItemCount) { lw->list.top_position = lw->list.itemCount - lw->list.visibleItemCount; ASSIGN_MAX(lw->list.top_position, 0); redraw = TRUE; } } else lw->list.top_position = 0; if (redraw) DrawList(lw, NULL, TRUE); CleanUpList(lw, False); /* We may not really need to reset width or height. */ if (reset_width && lw->list.itemCount && (lw->list.InternalList[0]->width >= lw->list.MaxWidth)) reset_width = FALSE; if (reset_height && lw->list.itemCount && (lw->list.InternalList[0]->height >= lw->list.MaxItemHeight)) reset_height = FALSE; SetNewSize(lw, reset_width, reset_height, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); SetVerticalScrollbar(lw); /* Free memory for copied list. */ for (i = 0; i < item_count; i++) XmStringFree(copy[i]); DEALLOCATE_LOCAL((char *)copy); _XmAppUnlock(app); } static void APIDeletePositions(XmListWidget lw, int *positions, int count, Boolean track_kbd) { Boolean redraw = FALSE; Boolean rebuild_selection; Boolean UpdateLastHL; int item_pos; int oldItemCount; int old_kbd = lw->list.CurrentKbdItem; Dimension old_max_height = lw->list.MaxItemHeight; register int i; if ((positions == NULL) || (count == 0)) return; /* CR 5760: Generate warnings for empty lists too. */ if (lw->list.itemCount < 1) { XmeWarning((Widget)lw, ListMessage8); return; } /* CR 5804: Don't check lw->list.AutoSelect here. */ UpdateLastHL = ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)); DrawHighlight (lw, lw->list.CurrentKbdItem, FALSE); /* Save itemCount because DeleteItemPositions recomputes value. */ oldItemCount = lw->list.itemCount; for (i = 0; i < count; i++) { item_pos = positions[i]; if ((item_pos < 1) || (item_pos > lw->list.itemCount)) { XmeWarning((Widget) lw, ListMessage8); item_pos = positions[i] = -1; /* mark position to be ignored */ } else if (item_pos <= (lw->list.top_position + lw->list.visibleItemCount)) redraw = TRUE; } DeleteItemPositions(lw, positions, count, track_kbd); rebuild_selection = DeleteInternalElementPositions(lw, positions, count, oldItemCount); if (lw->list.CurrentKbdItem >= lw->list.LastItem) { lw->list.CurrentKbdItem = lw->list.LastItem; ASSIGN_MAX(lw->list.CurrentKbdItem, 0); if (UpdateLastHL) lw->list.LastHLItem = lw->list.CurrentKbdItem; } UpdateSelectedList(lw, rebuild_selection); UpdateSelectedPositions(lw, lw->list.selectedItemCount); if (lw->list.itemCount) { if ((lw->list.itemCount - lw->list.top_position) < lw->list.visibleItemCount) { lw->list.top_position = lw->list.itemCount-lw->list.visibleItemCount; ASSIGN_MAX(lw->list.top_position, 0); redraw = TRUE; } } if ((lw->list.matchBehavior == XmQUICK_NAVIGATE) && (redraw || (old_kbd != lw->list.CurrentKbdItem))) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } if (redraw) DrawList(lw, NULL, TRUE); CleanUpList(lw, False); SetNewSize(lw, False, False, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); SetVerticalScrollbar(lw); } /************************************************************************ * * * XmListDeletePositions - delete the specified positions from the list * * * ************************************************************************/ void XmListDeletePositions(Widget w, int *position_list, int position_count) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); APIDeletePositions(lw, position_list, position_count, FALSE); _XmAppUnlock(app); } /************************************************************************ * * * XmListDeletePos - delete the item at the specified position from the * * list. * * * ************************************************************************/ void XmListDeletePos(Widget w, int pos) { XmListWidget lw = (XmListWidget) w; int position; _XmWidgetToAppContext(w); _XmAppLock(app); /* CR 9444: Allow 0 even though XmListDeletePositions doesn't. */ position = (pos ? pos : lw->list.itemCount); APIDeletePositions(lw, &position, 1, TRUE); _XmAppUnlock(app); } /************************************************************************ * * * XmListDeleteItemsPos - delete the items at the specified position * * from the list. * * * ************************************************************************/ void XmListDeleteItemsPos(Widget w, int item_count, int pos) { XmListWidget lw = (XmListWidget) w; int item_pos, last, new_top, old_kbd; Boolean reset_width = FALSE; Boolean reset_height = FALSE; Boolean rebuild_selection = FALSE; Dimension old_max_height; register int i; _XmWidgetToAppContext(w); _XmAppLock(app); old_max_height = lw->list.MaxItemHeight; /* CR 7270: Deleting zero items is not an error. */ if (item_count == 0) { _XmAppUnlock(app); return; } /* CR 5760: Generate warnings for empty lists too. */ if ((lw->list.itemCount < 1) || (item_count < 0)) { XmeWarning(w, ListMessage8); _XmAppUnlock(app); return; } item_pos = pos - 1; if ((item_pos < 0) || (item_pos >= lw->list.itemCount)) { XmeWarning((Widget) lw, ListMessage8); _XmAppUnlock(app); return; } if ((item_pos + item_count) >= lw->list.itemCount) item_count = lw->list.itemCount - item_pos; if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); old_kbd = lw->list.CurrentKbdItem; /**************** * * Delete the elements. Because of the way the internal routines * work (they ripple up the list items after each call), we keep * deleting the "same" element for item_count times. * ****************/ for (i = 0; i < item_count; i++) { reset_width |= (lw->list.InternalList[item_pos + i]->width >= lw->list.MaxWidth); reset_height |= (lw->list.InternalList[item_pos + i]->height >= lw->list.MaxItemHeight); } DeleteItems(lw, item_count, item_pos); rebuild_selection |= DeleteInternalElements(lw, NULL, pos, item_count); if (item_pos <= lw->list.CurrentKbdItem) { lw->list.CurrentKbdItem -= item_count; ASSIGN_MAX(lw->list.CurrentKbdItem, 0); if ((lw->list.SelectionPolicy == XmEXTENDED_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT)) lw->list.LastHLItem = lw->list.CurrentKbdItem; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } } UpdateSelectedList(lw, rebuild_selection); UpdateSelectedPositions(lw, lw->list.selectedItemCount); last = lw->list.top_position + lw->list.visibleItemCount; new_top = lw->list.top_position; if (lw->list.itemCount) { if (item_pos < new_top) { new_top-= item_count; ASSIGN_MAX(new_top, 0); } else if (item_pos < last) { /* CR 5080 - Do not let new_top go negative. Very, very bad * things happen when it does. */ if ((last > lw->list.itemCount) && (new_top > 0)) { new_top -= item_count; ASSIGN_MAX(new_top, 0); } } if (lw->list.top_position != new_top) { DrawHighlight(lw, old_kbd, FALSE); lw->list.top_position = new_top; DrawList(lw, NULL, TRUE); } else if (item_pos < last) DrawList(lw, NULL, TRUE); } else lw->list.top_position = 0; CleanUpList(lw, False); /* We may not really need to reset width or height. */ if (reset_width && lw->list.itemCount && (lw->list.InternalList[0]->width >= lw->list.MaxWidth)) reset_width = FALSE; if (reset_height && lw->list.itemCount && (lw->list.InternalList[0]->height >= lw->list.MaxItemHeight)) reset_height = FALSE; SetNewSize(lw, reset_width, reset_height, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); SetVerticalScrollbar(lw); _XmAppUnlock(app); } /************************************************************************ * * * XmListDeleteAllItems - clear the list. * * * ************************************************************************/ void XmListDeleteAllItems(Widget w) { XmListWidget lw = (XmListWidget) w; int j; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.items && (lw->list.itemCount > 0)) { #ifdef FIX_1636 XmListDeselectAllItems(w); SetSelectionParams(lw); #endif Dimension old_max_height = lw->list.MaxItemHeight; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); j = lw->list.itemCount; lw->list.itemCount = 0; DeleteInternalElements(lw, NULL, 1, j); lw->list.itemCount = j; ClearItemList(lw); ClearSelectedList(lw); ClearSelectedPositions(lw); CleanUpList(lw, False); SetNewSize(lw, True, True, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); SetVerticalScrollbar(lw); } _XmAppUnlock(app); } /************************************************************************ * * * APIReplaceItems - replace the given items with new ones. * * * ************************************************************************/ static void APIReplaceItems(Widget w, XmString *old_items, int item_count, XmString *new_items, Boolean select) { register int i, j; XmListWidget lw = (XmListWidget) w; Boolean redraw = FALSE; Dimension old_max_width = lw->list.MaxWidth; Dimension old_max_height = lw->list.MaxItemHeight; Boolean reset_width = FALSE; Boolean reset_height = FALSE; Boolean replaced_first = FALSE; int nsel = lw->list.selectedPositionCount; if ((old_items == NULL) || (new_items == NULL) || (lw->list.items == NULL)|| (item_count == 0)) return; for (i = 0; i < item_count; i++) { for (j = 1; j <= lw->list.itemCount; j++) { if (XmStringCompare(lw->list.items[j - 1], old_items[i])) { if (j <= (lw->list.top_position + lw->list.visibleItemCount)) redraw = TRUE; replaced_first |= (j == 1); reset_width |= (lw->list.InternalList[j - 1]->width == old_max_width); reset_height |= (lw->list.InternalList[j - 1]->height == old_max_height); ReplaceItem(lw, new_items[i], j); nsel += ReplaceInternalElement(lw, j, select); } } } if (select || (nsel != lw->list.selectedPositionCount)) UpdateSelectedPositions(lw, nsel); reset_width &= (old_max_width == lw->list.MaxWidth); if (reset_width && !replaced_first && (lw->list.InternalList[0]->width == lw->list.MaxWidth)) reset_width = FALSE; reset_height &= (old_max_height == lw->list.MaxItemHeight); if (reset_height && !replaced_first && (lw->list.InternalList[0]->height == lw->list.MaxItemHeight)) reset_height = FALSE; if (reset_width && reset_height) ResetExtents(lw, False); if (redraw) DrawList(lw, NULL, TRUE); SetNewSize(lw, False, False, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); SetVerticalScrollbar(lw); } /************************************************************************ * * * XmListReplaceItems - replace the given items with new ones. * * * ************************************************************************/ void XmListReplaceItems(Widget w, XmString *old_items, int item_count, XmString *new_items) { _XmWidgetToAppContext(w); _XmAppLock(app); APIReplaceItems(w, old_items, item_count, new_items, TRUE); _XmAppUnlock(app); } /************************************************************************ * * * XmListReplaceItemsUnselected - replace the given items with new ones.* * * ************************************************************************/ void XmListReplaceItemsUnselected(Widget w, XmString *old_items, int item_count, XmString *new_items) { _XmWidgetToAppContext(w); _XmAppLock(app); APIReplaceItems(w, old_items, item_count, new_items, FALSE); _XmAppUnlock(app); } /************************************************************************ * * * APIReplaceItemsPos - replace the given items with new ones. * * * ************************************************************************/ static void APIReplaceItemsPos(Widget w, XmString *new_items, int item_count, int position, Boolean select) { XmListWidget lw = (XmListWidget) w; int intern_pos; register int i; Dimension old_max_width = lw->list.MaxWidth; Dimension old_max_height = lw->list.MaxItemHeight; Boolean reset_width = FALSE; Boolean reset_height = FALSE; int nsel = lw->list.selectedPositionCount; if ((position < 1) || (new_items == NULL) || (lw->list.items == NULL)|| (item_count == 0)) return; intern_pos = position - 1; if ((intern_pos + item_count) > lw->list.itemCount) item_count = lw->list.itemCount - intern_pos; for (i = 0; i < item_count; i++, position++) { reset_width |= (lw->list.InternalList[position - 1]->width == old_max_width); reset_height |= (lw->list.InternalList[position - 1]->height == old_max_height); ReplaceItem(lw, new_items[i], position); #ifdef FIX_1362 if (lw->list.selectedItems && lw->list.selectedItemCount > 0) { BuildSelectedList(lw,TRUE); nsel += ReplaceInternalElement(lw, position, select); } #else nsel += ReplaceInternalElement(lw, position, select); #endif } if (select || (nsel != lw->list.selectedPositionCount)) UpdateSelectedPositions(lw, nsel); reset_width &= (old_max_width == lw->list.MaxWidth); if (reset_width && (position > 1) && (lw->list.InternalList[0]->width == lw->list.MaxWidth)) reset_width = FALSE; reset_height &= (old_max_height == lw->list.MaxItemHeight); if (reset_height && (position > 1) && (lw->list.InternalList[0]->height == lw->list.MaxItemHeight)) reset_height = FALSE; if (reset_width && reset_height) ResetExtents(lw, False); if (intern_pos < (lw->list.top_position + lw->list.visibleItemCount)) DrawList(lw, NULL, TRUE); SetNewSize(lw, False, False, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); SetVerticalScrollbar(lw); } /************************************************************************ * * * XmListReplaceItemsPos - replace the given items at the specified * * position with new ones. * * * ************************************************************************/ void XmListReplaceItemsPos(Widget w, XmString *new_items, int item_count, int position) { _XmWidgetToAppContext(w); _XmAppLock(app); APIReplaceItemsPos( w, new_items, item_count, position, TRUE); _XmAppUnlock(app); } /************************************************************************ * * * XmListReplaceItemsPosUnselected - replace the given items at the * * specified position with new ones. * * * ************************************************************************/ void XmListReplaceItemsPosUnselected(Widget w, XmString *new_items, int item_count, int position) { _XmWidgetToAppContext(w); _XmAppLock(app); APIReplaceItemsPos( w, new_items, item_count, position, FALSE); _XmAppUnlock(app); } /************************************************************************ * * * XmListReplacePositions - Replace a set of items based on a list of * * positions. * * * ************************************************************************/ void XmListReplacePositions(Widget w, int *position_list, XmString *item_list, int item_count) { int item_pos; register int i; XmListWidget lw = (XmListWidget) w; Boolean redraw = FALSE; Dimension old_max_width; Dimension old_max_height; Boolean reset_width = FALSE; Boolean reset_height = FALSE; Boolean replaced_first = FALSE; int nsel; _XmWidgetToAppContext(w); _XmAppLock(app); old_max_width = lw->list.MaxWidth; old_max_height = lw->list.MaxItemHeight; nsel = lw->list.selectedPositionCount; /* CR 5760: Generate warnings for empty lists too. */ if ((lw->list.itemCount < 1) && (position_list || item_list || item_count)) { if (position_list || item_count) XmeWarning(w, ListMessage8); _XmAppUnlock(app); return; } if ((position_list == NULL) || (item_list == NULL) || (lw->list.items == NULL) || (item_count == 0)) { _XmAppUnlock(app); return; } for (i = 0; i < item_count; i++) { item_pos = position_list[i]; if (item_pos < 1 || item_pos > lw->list.itemCount) XmeWarning((Widget) lw, ListMessage8); else { if (item_pos <= (lw->list.top_position + lw->list.visibleItemCount)) redraw = TRUE; replaced_first |= (item_pos == 1); reset_width |= (lw->list.InternalList[item_pos - 1]->width == old_max_width); reset_height |= (lw->list.InternalList[item_pos - 1]->height == old_max_height); ReplaceItem(lw, item_list[i], item_pos); nsel += ReplaceInternalElement(lw, item_pos, TRUE); } } UpdateSelectedPositions(lw, nsel); reset_width &= (old_max_width == lw->list.MaxWidth); if (reset_width && !replaced_first && (lw->list.InternalList[0]->width == lw->list.MaxWidth)) reset_width = FALSE; reset_height &= (old_max_height == lw->list.MaxItemHeight); if (reset_height && !replaced_first && (lw->list.InternalList[0]->height == lw->list.MaxItemHeight)) reset_height = FALSE; if (reset_width || reset_height) ResetExtents(lw, False); if (redraw) DrawList(lw, NULL, TRUE); SetNewSize(lw, False, False, old_max_height); if (lw->list.SizePolicy != XmVARIABLE) SetHorizontalScrollbar(lw); SetVerticalScrollbar(lw); _XmAppUnlock(app); } /************************************************************************ * * * APISelect - do the necessary selection work for the API select * * routines * * * ************************************************************************/ static void APISelect(XmListWidget lw, int item_pos, Boolean notify) { int i; /* Copy the current selection to the last selection */ for (i = 0; i < lw->list.itemCount; i++) lw->list.InternalList[i]->last_selected = lw->list.InternalList[i]->selected; item_pos--; /* Unselect the previous selection if needed. */ if (((lw->list.SelectionPolicy == XmSINGLE_SELECT) || (lw->list.SelectionPolicy == XmBROWSE_SELECT) || (lw->list.SelectionPolicy == XmEXTENDED_SELECT))) { for (i = 0; i < lw->list.selectedPositionCount; i++) { int pos = lw->list.selectedPositions[i] - 1; lw->list.InternalList[pos]->selected = FALSE; DrawItem((Widget) lw, pos); } } if (lw->list.SelectionPolicy == XmEXTENDED_SELECT) lw->list.SelectionType = XmINITIAL; lw->list.InternalList[item_pos]->selected = ((lw->list.SelectionPolicy != XmMULTIPLE_SELECT) || (!lw->list.InternalList[item_pos]->selected)); DrawItem((Widget) lw, item_pos); lw->list.LastHLItem = item_pos; if (notify) { /* Some action functions eventually end up in this * function to select a single item and such (for instance, * TopItem and EndItem). Therefore, we need to setup some * auto selection stuff before invoking ClickElement. */ if ((lw->list.AutoSelect != XmNO_AUTO_SELECT) && (lw->list.AutoSelectionType == XmAUTO_UNSET)) { if (ListSelectionChanged(lw)) lw->list.AutoSelectionType = XmAUTO_CHANGE; else lw->list.AutoSelectionType = XmAUTO_NO_CHANGE; } ClickElement(lw, NULL, FALSE); } else { UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); } } /************************************************************************ * * * SetSelectionParams - update the selection parameters so that an API * * selection looks the same as a user selection. * * * ************************************************************************/ static void SetSelectionParams(XmListWidget lw) { register int start, end, i; if (lw->list.items && lw->list.itemCount) { for (i = lw->list.itemCount - 1; i >= 0; i--) if (lw->list.InternalList[i]->selected) { end = i; while (i && (lw->list.InternalList[i]->selected)) i--; if ((i ==0) && (lw->list.InternalList[i]->selected)) start = i; else start = i + 1; lw->list.OldEndItem = lw->list.EndItem; lw->list.EndItem = end; lw->list.OldStartItem = lw->list.StartItem; lw->list.StartItem = start; lw->list.LastHLItem = end; if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.CurrentKbdItem = end; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); return; } /* When we get here, there are no selected items in the list. */ lw->list.OldEndItem = lw->list.EndItem; lw->list.EndItem = 0; lw->list.OldStartItem = lw->list.StartItem; lw->list.StartItem = 0; lw->list.LastHLItem = 0; } } /************************************************************************ * * * XmListSelectItem - select the given item and issue a callback if so * * requested. * * * ************************************************************************/ void XmListSelectItem(Widget w, XmString item, #if NeedWidePrototypes int notify) #else Boolean notify) #endif /* NeedWidePrototypes */ { XmListWidget lw = (XmListWidget) w; int item_pos; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if ((item_pos = ItemNumber(lw, item)) != 0) { APISelect(lw, item_pos, notify); SetSelectionParams(lw); } _XmAppUnlock(app); } /************************************************************************ * * * XmListSelectPos - select the item at the given position and issue a * * callback if so requested. * * * ************************************************************************/ void XmListSelectPos(Widget w, int pos, #if NeedWidePrototypes int notify) #else Boolean notify) #endif /* NeedWidePrototypes */ { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if (pos >= 0 && pos <= lw->list.itemCount) { if (pos == 0) pos = lw->list.itemCount; APISelect(lw, pos, notify); SetSelectionParams(lw); } _XmAppUnlock(app); } /************************************************************************ * * * XmListDeselectItem - deselect the given item and issue a callback if * * so requested. * * * ************************************************************************/ void XmListDeselectItem(Widget w, XmString item) { XmListWidget lw = (XmListWidget) w; int i; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if ((i = ItemNumber(lw, item)) != 0) { i--; lw->list.InternalList[i]->last_selected = FALSE; if (lw->list.InternalList[i]->selected) { lw->list.InternalList[i]->selected = FALSE; UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); DrawItem((Widget) lw, i); } } _XmAppUnlock(app); } /************************************************************************ * * * XmListDeselectPos - deselect the item at the given position and issue* * a callback if so requested. * * * ************************************************************************/ void XmListDeselectPos(Widget w, int pos) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if (pos >= 0 && pos <= lw->list.itemCount) { pos--; if (pos < 0) pos = lw->list.itemCount - 1; lw->list.InternalList[pos]->last_selected = FALSE; if (lw->list.InternalList[pos]->selected) { lw->list.InternalList[pos]->selected = FALSE; UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); DrawItem((Widget) lw, pos); } } _XmAppUnlock(app); } /************************************************************************ * * * XmListDeselectAllItems - hose the entire selected list * * * ************************************************************************/ void XmListDeselectAllItems(Widget w) { XmListWidget lw = (XmListWidget) w; int i; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if (lw->list.selectedItemCount > 0) { for (i = 0; i < lw->list.selectedPositionCount; i++) { int pos = lw->list.selectedPositions[i] - 1; lw->list.InternalList[pos]->selected = FALSE; lw->list.InternalList[pos]->last_selected = FALSE; DrawItem((Widget) lw, pos); } ClearSelectedList(lw); ClearSelectedPositions(lw); } _XmAppUnlock(app); } /************************************************************************ * * * XmListSetPos - Make the specified position the top visible position * * in the list. * * * ************************************************************************/ void XmListSetPos(Widget w, int pos) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if (pos == 0) pos = lw->list.itemCount; if (pos > 0 && pos <= lw->list.itemCount) { pos--; if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = pos; DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } _XmAppUnlock(app); } /************************************************************************ * * * XmListSetBottomPos - Make the specified position the bottom visible * * position in the list. * * * ************************************************************************/ void XmListSetBottomPos(Widget w, int pos) { XmListWidget lw = (XmListWidget) w; int top; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if (pos == 0) pos = lw->list.itemCount; if (pos > 0 && pos <= lw->list.itemCount) { top = pos - lw->list.visibleItemCount; ASSIGN_MAX(top, 0); if (top == lw->list.top_position) { _XmAppUnlock(app); return; } if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = top; DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } _XmAppUnlock(app); } /************************************************************************ * * * XmListSetItem - Make the specified item the top visible item * * in the list. * * * ************************************************************************/ void XmListSetItem(Widget w, XmString item) { XmListWidget lw = (XmListWidget) w; int i; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if ((i = ItemNumber(lw, item)) != 0) { i--; if (i == lw->list.top_position) { _XmAppUnlock(app); return; } if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = i; DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } _XmAppUnlock(app); } /************************************************************************ * * * XmListSetBottomItem - Make the specified item the bottom visible * * position in the list. * * * ************************************************************************/ void XmListSetBottomItem(Widget w, XmString item) { XmListWidget lw = (XmListWidget) w; int i, top; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if ((i = ItemNumber(lw, item)) != 0) { top = i - lw->list.visibleItemCount; ASSIGN_MAX(top, 0); if (top == lw->list.top_position) { _XmAppUnlock(app); return; } if (lw->list.Traversing) DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.top_position = top; DrawList(lw, NULL, TRUE); SetVerticalScrollbar(lw); } _XmAppUnlock(app); } /************************************************************************ * * * XmListSetAddMode - Programatically update XmNselectionMode value * * * ************************************************************************/ void XmListSetAddMode(Widget w, #if NeedWidePrototypes int add_mode) #else Boolean add_mode) #endif /* NeedWidePrototypes */ { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); /* Can't be false for single or multiple */ if ((!add_mode) && ((lw->list.SelectionPolicy == XmSINGLE_SELECT) || (lw->list.SelectionPolicy == XmMULTIPLE_SELECT))) { _XmAppUnlock(app); return; } /* Can't be true for browse */ if ((add_mode) && (lw->list.SelectionPolicy == XmBROWSE_SELECT)) { _XmAppUnlock(app); return; } DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.SelectionMode = (add_mode ? XmADD_MODE : XmNORMAL_MODE); ChangeHighlightGC(lw, add_mode); DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); /**************** * * Funky hacks for Ellis: If we enter add mode with one item selected, * deselect the current one. If we leave add mode with no items selected, * select the current one. * * rgcote 8/23/93: Here's a little more background for the "Funky hacks". * In normal mode, one item must be selected at all times. In add mode, * this is not the case. In add mode, a user wants to specify a set of * possibly discontiguous items to be the selection. If, when going from * normal mode to add mode, more than one item is already selected then * we assume that the user started selecting the items and decided that * he/she needed to now select more items that are discontiguous from the * currently selected items. On the other hand, if only one item was * selected, we assume that the single selected item is just the result * of normal mode forcing one item to be selected and we unselect that * single item. * ****************/ if ((add_mode) && (lw->list.itemCount != 0) && (lw->list.SelectionPolicy == XmEXTENDED_SELECT) && (lw->list.selectedPositionCount == 1) && (lw->list.InternalList[lw->list.CurrentKbdItem]->selected)) { lw->list.InternalList[lw->list.CurrentKbdItem]->selected = FALSE; lw->list.InternalList[lw->list.CurrentKbdItem]->last_selected = FALSE; DrawList(lw, NULL, TRUE); UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); } else if ((!add_mode) && (lw->list.itemCount != 0) && (lw->list.SelectionPolicy == XmEXTENDED_SELECT) && (lw->list.selectedPositionCount == 0)) { lw->list.InternalList[lw->list.CurrentKbdItem]->selected = TRUE; lw->list.InternalList[lw->list.CurrentKbdItem]->last_selected = TRUE; DrawList(lw, NULL, TRUE); UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); } _XmAppUnlock(app); } /************************************************************************ * * * XmListItemExists - returns TRUE if the given item exists in the * * list. * * * ************************************************************************/ Boolean XmListItemExists(Widget w, XmString item) { XmListWidget lw = (XmListWidget) w; Boolean exists; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return FALSE; } exists = ItemExists(lw, item); _XmAppUnlock(app); return exists; } /************************************************************************ * * * XmListItemPosition - returns the index (1-based) of the given item. * * Returns 0 if not found. * * * ************************************************************************/ int XmListItemPos(Widget w, XmString item) { XmListWidget lw = (XmListWidget) w; int pos; _XmWidgetToAppContext(w); _XmAppLock(app); if (item == NULL) { _XmAppUnlock(app); return 0; } pos = ItemNumber(lw, item); _XmAppUnlock(app); return pos; } /************************************************************************ * * * XmListGetKbdItemPos - returns the index (1-based) of the current * * keyboard item. * * Returns 0 if not found. * * * ************************************************************************/ int XmListGetKbdItemPos(Widget w) { XmListWidget lw = (XmListWidget) w; int pos; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.items == NULL) { _XmAppUnlock(app); return 0; } pos = lw->list.CurrentKbdItem + 1; _XmAppUnlock(app); return pos; } /************************************************************************ * * * XmListSetKbdItemPos - allows user to set the current keyboard item * * Returns True if successful. * * False if not * * * ************************************************************************/ Boolean XmListSetKbdItemPos(Widget w, int pos) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if ((lw->list.items == NULL) || (pos < 0) || (pos > lw->list.itemCount)) { _XmAppUnlock(app); return (False); } if (pos == 0) pos = lw->list.itemCount; DrawHighlight(lw, lw->list.CurrentKbdItem, FALSE); lw->list.CurrentKbdItem = pos - 1; if (lw->list.matchBehavior == XmQUICK_NAVIGATE) { XPoint xmim_point; GetPreeditPosition(lw, &xmim_point); XmImVaSetValues((Widget)lw, XmNspotLocation, &xmim_point, NULL); } DrawHighlight(lw, lw->list.CurrentKbdItem, TRUE); MakeItemVisible(lw, lw->list.CurrentKbdItem); /* do we need to do this? */ _XmAppUnlock(app); return TRUE; } /************************************************************************ * * * XmListGetMatchPos - returns the positions that an item appears at in * * the list. CALLER MUST FREE SPACE! * * * ************************************************************************/ Boolean XmListGetMatchPos(Widget w, XmString item, int **pos_list, int *pos_count) { XmListWidget lw = (XmListWidget) w; register int i, *pos; int j; _XmWidgetToAppContext(w); /* CR 7648: Be friendly and initialize the out parameters. */ *pos_list = NULL; *pos_count = 0; _XmAppLock(app); if ((lw->list.items == NULL) || (lw->list.itemCount <= 0)) { _XmAppUnlock(app); return FALSE; } pos = (int *)XtMalloc((sizeof(int) * lw->list.itemCount)); j = 0; for (i = 0; i < lw->list.itemCount; i++) { if ((XmStringCompare(lw->list.items[i], item))) pos[j++] = (i + 1); } if (j == 0) { XtFree((char *)pos); _XmAppUnlock(app); return (FALSE); } pos = (int *)XtRealloc((char *) pos, (sizeof(int) * j)); *pos_list = pos; *pos_count = j; _XmAppUnlock(app); return TRUE; } void ListScrollUp(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget) wid; int value; int slider_size; int increment; int page_increment; if (lw->list.vScrollBar) { int new_value; XmScrollBarGetValues(((Widget)(lw->list.vScrollBar)), &value, &slider_size, &increment, &page_increment); new_value = value-increment; if (new_value < lw->list.vScrollBar->scrollBar.minimum) new_value = lw->list.vScrollBar->scrollBar.minimum; XmScrollBarSetValues(((Widget)(lw->list.vScrollBar)), new_value, slider_size, increment, page_increment, True); } } void ListScrollDown(Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmListWidget lw = (XmListWidget)wid; int value; int slider_size; int increment; int page_increment; if (lw->list.vScrollBar) { int new_value; XmScrollBarGetValues(((Widget)(lw->list.vScrollBar)), &value, &slider_size, &increment, &page_increment); new_value = value+increment; if (new_value > lw->list.vScrollBar->scrollBar.maximum - slider_size) new_value = lw->list.vScrollBar->scrollBar.maximum - slider_size; XmScrollBarSetValues(((Widget)(lw->list.vScrollBar)), new_value, slider_size, increment, page_increment, True); } } /************************************************************************ * * * XmListGetSelectedPos - returns XmNselectedPositions and * * XmNselectedPositionCount. CALLER MUST FREE SPACE! * * * ************************************************************************/ Boolean XmListGetSelectedPos(Widget w, int **pos_list, int *pos_count) { XmListWidget lw = (XmListWidget) w; register int *posList; int count; _XmWidgetToAppContext(w); /* CR 7648: Be friendly and initialize the out parameters. */ *pos_list = NULL; *pos_count = 0; _XmAppLock(app); if (lw->list.items == NULL || lw->list.itemCount <= 0 || lw->list.selectedPositions == NULL || lw->list.selectedPositionCount <= 0) { _XmAppUnlock(app); return FALSE; } posList = (int *) XtMalloc(sizeof(int) * lw->list.selectedPositionCount); count = lw->list.selectedPositionCount; memcpy((char*) posList, (char*) lw->list.selectedPositions, count * sizeof(int)); *pos_list = posList; *pos_count = count; _XmAppUnlock(app); return TRUE; } /************************************************************************ * * * XmListSetHorizPos - move the hsb. * * * ************************************************************************/ void XmListSetHorizPos(Widget w, int position) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (lw->list.itemCount < 1) { _XmAppUnlock(app); return; } if (lw->list.hScrollBar) { ASSIGN_MAX(position, lw->list.hmin); if ((lw->list.hExtent + position) > lw->list.hmax) position = lw->list.hmax - lw->list.hExtent; if (position == lw->list.hOrigin) { _XmAppUnlock(app); return; } lw->list.hOrigin = position; lw->list.XOrigin = position; SetHorizontalScrollbar(lw); DrawList(lw, NULL, TRUE); } /* else * XmeWarning((Widget) lw, ListMessage9); */ _XmAppUnlock(app); } /************************************************************************ * * * XmListYToPos - return the index of the item underneath position Y * * returns 0 if there is no item at position Y. * * * ************************************************************************/ int XmListYToPos(Widget w, Position y) { /* Remember to convert to the 1-based user world. */ /* BEGIN OSF Fix CR 5081 */ XmListWidget lw = (XmListWidget)w; int pos; _XmWidgetToAppContext(w); _XmAppLock(app); /* BEGIN OSF Fix CR 5662 */ if ((y < (Position)0) || (y >= (Position)(lw->core.height - lw->list.BaseY))) { /* END OSF Fix CR 5662 */ _XmAppUnlock(app); return (0); } else { pos = WhichItem(lw, y) + 1; _XmAppUnlock(app); return pos; } /* END OSF Fix CR 5081 */ } /************************************************************************ * * * XmListPosToBounds * * * ************************************************************************/ Boolean XmListPosToBounds(Widget w, int position, Position *x, Position *y, Dimension *width, Dimension *height) { register XmListWidget lw; register Dimension ht; Position ix; /* values computed ahead... */ Position iy; /* ...of time... */ Dimension iwidth; /* ...for debugging... */ Dimension iheight; /* ...purposes */ _XmWidgetToAppContext(w); if (!XtIsRealized(w)) return False; _XmAppLock(app); lw = (XmListWidget) w; /* BEGIN OSF Fix CR 5764 */ /* Remember we're 0-based */ if (position == 0) position = lw->list.itemCount - 1; else position--; /* END OSF Fix CR 5764 */ if ((position >= lw->list.itemCount) || (position < lw->list.top_position) || (position >= (lw->list.top_position + lw->list.visibleItemCount))) { _XmAppUnlock(app); return (False); } ht = MAX((int)lw->list.HighlightThickness, 0); ix = lw->list.BaseX - ht; iwidth = lw->core.width - 2 * ((int)lw->list.margin_width + lw->primitive.shadow_thickness); iy = LINEHEIGHTS(lw, position - lw->list.top_position) + lw->list.BaseY - ht; iheight = lw->list.MaxItemHeight + (2 * ht); if (x != NULL) *x = ix; if (y != NULL) *y = iy; if (height != NULL) *height = iheight; if (width != NULL) *width = iwidth; _XmAppUnlock(app); return True; } /************************************************************************ * * * XmListUpdateSelectedList - regen the selected items and positions * * lists. * * * ************************************************************************/ void XmListUpdateSelectedList(Widget w) { XmListWidget lw = (XmListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); UpdateSelectedList(lw, TRUE); UpdateSelectedPositions(lw, lw->list.selectedItemCount); _XmAppUnlock(app); } /************************************************************************ * * * XmListPosSelected - Return selection state of item at position * * * ************************************************************************/ Boolean XmListPosSelected(Widget w, int pos) { int int_pos; XmListWidget lw = (XmListWidget) w; Boolean selected; _XmWidgetToAppContext(w); _XmAppLock(app); if ((lw->list.items == NULL) || (pos < 0) || (pos > lw->list.itemCount)) { _XmAppUnlock(app); return False; } if (pos == 0) int_pos = lw->list.LastItem - 1; else int_pos = pos - 1; selected = lw->list.InternalList[int_pos]->selected; _XmAppUnlock(app); return selected; } /************************************************************************ * * * XmCreateList - hokey interface to XtCreateWidget. * * * ************************************************************************/ Widget XmCreateList(Widget parent, char *name, ArgList args, Cardinal argCount) { return XtCreateWidget(name, xmListWidgetClass, parent, args, argCount); } Widget XmVaCreateList( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmListWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedList( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmListWidgetClass, parent, True, var, count); va_end(var); return w; } /************************************************************************ * * * XmCreateScrolledList - create a list inside of a scrolled window. * * * ************************************************************************/ Widget XmCreateScrolledList(Widget parent, char *name, ArgList args, Cardinal argCount) { Widget sw, lw; char *s; ArgList Args; Arg my_args[4]; Cardinal nargs; s = (char*) ALLOCATE_LOCAL(XmStrlen(name) + 3); /* Name+"SW"+NULL */ if (name) { strcpy(s, name); strcat(s, "SW"); } else { strcpy(s, "SW"); } nargs = 0; XtSetArg(my_args[nargs], XmNscrollingPolicy, XmAPPLICATION_DEFINED), nargs++; XtSetArg(my_args[nargs], XmNvisualPolicy, XmVARIABLE), nargs++; XtSetArg(my_args[nargs], XmNscrollBarDisplayPolicy, XmSTATIC), nargs++; XtSetArg(my_args[nargs], XmNshadowThickness, 0), nargs++; assert(nargs <= XtNumber(my_args)); Args = XtMergeArgLists(args, argCount, my_args, nargs); sw = XtCreateManagedWidget(s , xmScrolledWindowWidgetClass, parent, Args, argCount + nargs); DEALLOCATE_LOCAL(s); XtFree((char *) Args); lw = XtCreateWidget(name, xmListWidgetClass, sw, args, argCount); XtAddCallback (lw, XmNdestroyCallback, _XmDestroyParentCallback, NULL); return (lw); } motif-2.3.8/lib/Xm/GadgetUtiI.h0000644000175000017500000000305512672140200013051 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: GadgetUtiI.h /main/5 1995/07/13 17:27:26 drk $ */ #ifndef _XmGadgetUtilI_h #define _XmGadgetUtilI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for GadgetUtil.c ********/ extern XmGadget _XmInputForGadget(Widget cw, int x, int y) ; extern void _XmDispatchGadgetInput(Widget g, XEvent *event, Mask mask) ; extern Time _XmGetDefaultTime(Widget, XEvent*) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGadgetUtilI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PushB.h0000644000175000017500000000437113145162623012117 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /*********************************************************************** * * PushButton Widget * ***********************************************************************/ #ifndef _XmPButton_h #define _XmPButton_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsPushButton #define XmIsPushButton(w) XtIsSubclass(w, xmPushButtonWidgetClass) #endif /* XmIsPushButton */ /* PushButton Widget */ externalref WidgetClass xmPushButtonWidgetClass; typedef struct _XmPushButtonClassRec *XmPushButtonWidgetClass; typedef struct _XmPushButtonRec *XmPushButtonWidget; /******** Public Function Declarations ********/ extern Widget XmCreatePushButton( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; /* * Variable argument list functions */ extern Widget XmVaCreatePushButton( Widget parent, char *name, ...); extern Widget XmVaCreateManagedPushButton( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPButton_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStringObso.c0000644000175000017500000001177512672140200013464 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: XmStringObso.c /main/6 1995/09/19 23:13:52 cde-sun $" #endif #endif #include "XmStringI.h" #include "XmI.h" /* * as close as we can come to Latin1Create without knowing the charset of * Latin1. This imposes the semantic of \n meaning separator. */ XmString XmStringLtoRCreate( char *text, XmStringTag tag ) { char *start, *end; Boolean done; XmString string; _XmProcessLock(); if (!text) { _XmProcessUnlock(); return (NULL); } start = text; done = FALSE; /* Set the direction once only at the beginning. */ string = XmStringDirectionCreate(XmSTRING_DIRECTION_L_TO_R); while ( ! done) /* loop thu local copy */ { /* looking for \n */ end = start; while ((*end != '\0') && (*end != '\n')) end++; if (*end == '\0') done = TRUE; /* we are at the end */ /* Don't convert empty string unless it's an initial newline. */ /* Done so StringHeight has clue to size of empty lines. */ if ((start != end) || (start == text)) string = XmStringConcatAndFree (string, _XmStringNCreate(start, tag, end - start)); /* Make a separator if this isn't the last segment. */ if (!done) { string = XmStringConcatAndFree(string, XmStringSeparatorCreate()); start = ++end; /* start at next char */ } } _XmProcessUnlock(); return (string); } XmString XmStringCreateLtoR( char *text, XmStringTag tag ) { return (XmStringLtoRCreate (text, tag)); } /* * build an external TCS 'segment', just a high level create */ XmString XmStringSegmentCreate( char *text, XmStringTag tag, #if NeedWidePrototypes int direction, int separator ) #else XmStringDirection direction, Boolean separator ) #endif /* NeedWidePrototypes */ { XmString result; result = XmStringConcatAndFree (XmStringDirectionCreate (direction), XmStringCreate (text, tag)); if (separator) result = XmStringConcatAndFree (result, XmStringSeparatorCreate ()); return result; } /* * Convenience routine to create an XmString from a NULL terminated string. */ XmString XmStringCreateSimple( char *text ) { return (XmStringCreate(text, XmSTRING_DEFAULT_CHARSET)); } /* * concat two external strings. Only concat a component at a time * so that we always wind up with a meaningful string */ XmString XmStringNConcat(XmString first, XmString second, int n ) { XmString tmp, ret_val; _XmProcessLock(); tmp = XmStringConcat(first, second); ret_val = XmStringNCopy(tmp, XmStringLength(first) + n); XmStringFree(tmp); _XmProcessUnlock(); return(ret_val); } /* * Copy a compound string, such that the equivalent ASN.1 form * has <= n bytes. Only copy a component at a time * so that we always wind up with a meaningful string */ XmString XmStringNCopy( XmString str, int n ) { unsigned char *tmp; unsigned int len; XmString ret_val; _XmProcessLock(); len = XmCvtXmStringToByteStream(str, &tmp); if (n >= len) /* No need to truncate */ { ret_val = XmStringCopy(str); } else /* Truncate and convert */ { tmp = _XmStringTruncateASN1(tmp, n); ret_val = XmCvtByteStreamToXmString(tmp); } XtFree((char *)tmp); _XmProcessUnlock(); return(ret_val); } /* Compare ASN.1 form of strings. */ Boolean XmStringByteCompare( XmString a1, XmString b1 ) { unsigned char *a; unsigned char *b; unsigned short a_length, b_length; Boolean ret_val; _XmProcessLock(); if ((a1 == NULL) && (b1 == NULL)) { _XmProcessUnlock(); return (TRUE); } if ((a1 == NULL) || (b1 == NULL)) { _XmProcessUnlock(); return (FALSE); } a_length = XmCvtXmStringToByteStream(a1, &a); b_length = XmCvtXmStringToByteStream(b1, &b); if ((a_length != b_length) || (memcmp(a, b, a_length) != 0)) ret_val = FALSE; else ret_val = TRUE; XtFree((char *)a); XtFree((char *)b); _XmProcessUnlock(); return(ret_val); } motif-2.3.8/lib/Xm/ScrollFramTI.h0000644000175000017500000000333112672140200013361 00000000000000/* $XConsortium: ScrollFramTI.h /main/5 1995/07/15 20:55:16 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmScrollFrameTI_h #define _XmScrollFrameTI_h #include #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmSFAddNavigator( Widget sf, Widget nav, Mask dimMask, XmScrollFrameData scroll_frame_data); extern void _XmSFRemoveNavigator( Widget sf, Widget nav, XmScrollFrameData scroll_frame_data); extern void _XmSFUpdateNavigatorsValue( Widget sf, XmNavigatorData nav_data, Boolean notify); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScrollFrameTI_h */ motif-2.3.8/lib/Xm/VendorSI.h0000644000175000017500000000366412672140200012562 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: VendorSI.h /main/5 1995/07/13 18:19:43 drk $ */ #ifndef _XmVendorSI_h #define _XmVendorSI_h #include #ifdef __cplusplus extern "C" { #endif /* used in visual resources declaration and in _XmDefaultVisualResources. Cannot use 0 which is None = CopyFromParent, the Xt default */ #define INVALID_VISUAL ((Visual*)-1) /******** Private Function Declarations ********/ extern void _XmAddGrab( Widget wid, #if NeedWidePrototypes int exclusive, int spring_loaded) ; #else Boolean exclusive, Boolean spring_loaded) ; #endif /* NeedWidePrototypes */ extern void _XmRemoveGrab( Widget wid) ; extern void _XmDefaultVisualResources(Widget widget) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVendorSI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/SSpinB.c0000644000175000017500000007460613145162623012237 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /****************************************************************************** * * File: SSpinB.c * Date: June 1, 1995 * Author: Mitchell Greess * * Contents: * Implements the XmSimpleSpinBox widget. * ******************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "MessagesI.h" #include "XmI.h" #include #define FIX_1530 static void Initialize( Widget req, Widget w, ArgList args, Cardinal *num_args); static Boolean SetValues( Widget old, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InsertChild( Widget newChild); static Widget GetCallbackWidget( Widget widget); static void SyntheticGetValue( Widget widget, int offset, XtArgVal *value); /* Resources */ #define Offset(field) XtOffsetOf(XmSimpleSpinBoxRec,simpleSpinBox.field) #define ManagerOffset(field) XtOffsetOf(XmSimpleSpinBoxRec,manager.field) static XtResource resources[] = { /* * Inherited resources. */ { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), ManagerOffset(shadow_thickness), XmRImmediate, (XtPointer) 1 }, /* * SimpleSpinBox resources. */ { XmNarrowSensitivity, XmCArrowSensitivity, XmRArrowSensitivity, sizeof(unsigned char), Offset(arrow_sensitivity), XmRImmediate, (XtPointer) XmARROWS_DEFAULT_SENSITIVITY }, { XmNcolumns, XmCColumns, XmRShort, sizeof(short), Offset(columns), XmRImmediate, (XtPointer) 20 }, { XmNdecimalPoints, XmCDecimalPoints, XmRShort, sizeof(short), Offset(decimal_points), XmRImmediate, (XtPointer) 0 }, { XmNeditable, XmCEditable, XmRBoolean, sizeof(Boolean), Offset(editable), XmRImmediate, (XtPointer) True }, { XmNincrementValue, XmCIncrementValue, XmRInt, sizeof(int), Offset(increment_value), XmRImmediate, (XtPointer) 1 }, { XmNmaximumValue, XmCMaximumValue, XmRInt, sizeof(int), Offset(maximum_value), XmRImmediate, (XtPointer) 10 }, { XmNminimumValue, XmCMinimumValue, XmRInt, sizeof(int), Offset(minimum_value), XmRImmediate, (XtPointer) 0 }, { XmNnumValues, XmCNumValues, XmRInt, sizeof(int), Offset(num_values), XmRImmediate, (XtPointer) 0 }, { XmNposition, XmCPosition, XmRInt, sizeof(int), Offset(position), XmRImmediate, (XtPointer) 0 }, { XmNpositionType, XmCPositionType, XmRPositionType, sizeof(unsigned char), Offset(position_type), XmRImmediate, (XtPointer) XmPOSITION_VALUE }, { XmNspinBoxChildType, XmCSpinBoxChildType, XmRSpinBoxChildType, sizeof(unsigned char), Offset(sb_child_type), XmRImmediate, (XtPointer) XmSTRING }, { XmNtextField, XmCTextField, XmRWidget, sizeof(Widget), Offset(text_field), XmRImmediate, (XtPointer) NULL }, { XmNvalues, XmCValues, XmRXmStringTable, sizeof(XmStringTable), Offset(values), XmRStringTable, NULL }, { XmNwrap, XmCWrap, XmRBoolean, sizeof(Boolean), Offset(wrap), XmRImmediate, (XtPointer) True } }; static XmSyntheticResource syn_resources[] = { { XmNarrowSensitivity, sizeof(unsigned char), Offset(arrow_sensitivity), SyntheticGetValue, NULL }, { XmNcolumns, sizeof(short), Offset(columns), SyntheticGetValue, NULL }, { XmNdecimalPoints, sizeof(short), Offset(decimal_points), SyntheticGetValue, NULL }, { XmNeditable, sizeof(Boolean), Offset(editable), SyntheticGetValue, NULL }, { XmNincrementValue, sizeof(int), Offset(increment_value), SyntheticGetValue, NULL }, { XmNmaximumValue, sizeof(int), Offset(maximum_value), SyntheticGetValue, NULL }, { XmNminimumValue, sizeof(int), Offset(minimum_value), SyntheticGetValue, NULL }, { XmNnumValues, sizeof(int), Offset(num_values), SyntheticGetValue, NULL }, { XmNposition, sizeof(int), Offset(position), SyntheticGetValue, NULL }, { XmNpositionType, sizeof(unsigned char), Offset(position_type), SyntheticGetValue, NULL }, { XmNspinBoxChildType, sizeof(unsigned char), Offset(sb_child_type), SyntheticGetValue, NULL }, { XmNvalues, sizeof(XmStringTable), Offset(values), SyntheticGetValue, NULL }, { XmNwrap, sizeof(Boolean), Offset(wrap), SyntheticGetValue, NULL } }; /* The Spin class record definition */ externaldef (xmspinboxclassrec) XmSimpleSpinBoxClassRec xmSimpleSpinBoxClassRec= { { (WidgetClass)&xmSpinBoxClassRec, /* superclass */ "XmSimpleSpinBox", /* class_name */ sizeof(XmSimpleSpinBoxRec), /* widget_size */ (XtProc) NULL, /* class_initialize */ (XtWidgetClassProc) NULL, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ (XtWidgetProc) NULL, /* destroy */ XtInheritResize, /* resize */ XtInheritExpose, /* expose */ SetValues, /* set_values */ (XtArgsFunc) NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc) NULL, /* get_values_hook */ XtInheritAcceptFocus, /* accept_focus */ XtVersion, /* version */ (XtPointer) NULL, /* callback proc list */ XtInheritTranslations, /* tm_table */ XtInheritQueryGeometry, /* query_geometry */ (XtStringProc) NULL, /* display_accelerator */ (XtPointer) NULL, /* extension */ }, { /* composite_class fields */ XtInheritGeometryManager, /* geometry_manager */ XtInheritChangeManaged, /* change_managed */ InsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ (XtPointer) NULL, /* extension */ }, { /* constraint_class fields */ (XtResourceList) NULL, /* resource_list */ (Cardinal) 0, /* num_resources */ (Cardinal) sizeof( XmSimpleSpinBoxConstraintRec), /* constraint_size */ (XtInitProc) NULL, /* init_proc */ (XtWidgetProc) NULL, /* destroy_proc */ (XtSetValuesFunc) NULL, /* set_values_proc */ (XtPointer) NULL, /* extension */ }, /* manager_class fields */ { XtInheritTranslations, /* translations */ (XmSyntheticResource *) syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ (XmSyntheticResource *) NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ (XmParentProcessProc) NULL, /* parent_process */ (XtPointer) NULL, /* extension */ }, /* spinbox_class fields */ { (XmGetCallbackWidgetProc) GetCallbackWidget, /* get_callback_widget */ (XtPointer) NULL, /* extension */ }, /* simple_spinbox_class fields */ { (XtPointer) NULL, /* extension */ } }; externaldef(xmsimplespinboxwidgetclass) WidgetClass xmSimpleSpinBoxWidgetClass = (WidgetClass) &xmSimpleSpinBoxClassRec; #define BAD_SSPIN_SET_TEXT_FIELD _XmMMsgSSpinB_0001 #define BAD_SSPIN_SET_POSITION_TYPE _XmMMsgSSpinB_0002 #define BAD_SSPIN_SET_ITEM _XmMMsgSSpinB_0003 /****************************************************************************** ** *** MACROS ** *****************************************************************************/ #define SSB_TEXTFIELD_NAME_FORMAT "%s_TF" #define SSB_SIMPLE_SPIN_BOX_PART(w) \ (& ((XmSimpleSpinBoxWidget)(w))->simpleSpinBox) /****************************************************************************** ** *** METHODS ** *****************************************************************************/ /*ARGSUSED*/ static void Initialize(Widget request, /* unused */ Widget new, ArgList user_args, /* unused */ Cardinal *n_user_args) /* unused */ { char *widget_name; XmSimpleSpinBoxWidget ssb_w; XmSimpleSpinBoxPart *ssb_p; XmSpinBoxConstraint textf_c; Arg args[XtNumber(resources)]; int nargs = 0; ssb_w = (XmSimpleSpinBoxWidget) new; ssb_p = &ssb_w->simpleSpinBox; ssb_w->simpleSpinBox.text_field = (Widget) NULL; /* * Create and insert the text field child widget; */ widget_name = XtMalloc(strlen(XtName(new)) + 10); sprintf(widget_name, SSB_TEXTFIELD_NAME_FORMAT, XtName(new)); /* * Collect all the resources that apply to the TextField child, * and push include them in the creation call. * Allow the SpinBox widget worry about ensuring values are valid * and about saving values. * Once the child has been created, copy the relevant values out of * the constraint record for the TextField into our instance record. */ XtSetArg(args[nargs], XmNarrowSensitivity,ssb_p->arrow_sensitivity);nargs++; XtSetArg(args[nargs], XmNdecimalPoints, ssb_p->decimal_points); nargs++; XtSetArg(args[nargs], XmNincrementValue, ssb_p->increment_value); nargs++; XtSetArg(args[nargs], XmNmaximumValue, ssb_p->maximum_value); nargs++; XtSetArg(args[nargs], XmNminimumValue, ssb_p->minimum_value); nargs++; XtSetArg(args[nargs], XmNnumValues, ssb_p->num_values); nargs++; XtSetArg(args[nargs], XmNposition, ssb_p->position); nargs++; XtSetArg(args[nargs], XmNpositionType, ssb_p->position_type); nargs++; XtSetArg(args[nargs], XmNspinBoxChildType, ssb_p->sb_child_type); nargs++; XtSetArg(args[nargs], XmNvalues, ssb_p->values); nargs++; XtSetArg(args[nargs], XmNwrap,ssb_p->wrap);nargs++; XtSetArg(args[nargs], XmNeditable, ssb_p->editable); nargs++; XtSetArg(args[nargs], XmNcolumns, ssb_p->columns); nargs++; ssb_p->text_field = XtCreateManagedWidget( widget_name, xmTextFieldWidgetClass, (Widget) new, args, nargs); XtSetValues(ssb_p->text_field, args, nargs); textf_c = SB_GetConstraintRec(ssb_p->text_field); ssb_p->arrow_sensitivity = textf_c->arrow_sensitivity; ssb_p->decimal_points = textf_c->decimal_points; ssb_p->increment_value = textf_c->increment_value; ssb_p->maximum_value = textf_c->maximum_value; ssb_p->minimum_value = textf_c->minimum_value; ssb_p->num_values = textf_c->num_values; ssb_p->position = textf_c->position; ssb_p->position_type = textf_c->position_type; ssb_p->sb_child_type = textf_c->sb_child_type; ssb_p->values = textf_c->values; ssb_p->wrap = textf_c->wrap; XtVaGetValues(ssb_p->text_field, XmNeditable, &ssb_p->editable, XmNcolumns, &ssb_p->columns, NULL); XtFree(widget_name); } /*ARGSUSED*/ static Boolean SetValues(Widget current, Widget request, /* unused */ Widget new, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmSimpleSpinBoxPart *cur_ssbp = SSB_SIMPLE_SPIN_BOX_PART(current); XmSimpleSpinBoxPart *new_ssbp = SSB_SIMPLE_SPIN_BOX_PART(new); XmSpinBoxConstraint textf_c; Boolean display_flag; Arg changed_args[XtNumber(resources)]; int nchanged_args = 0; /* * These resources have CG permissions only: * XmNpositionType, XmNspinBoxChildType, XmNtextField * * BINARY COMPATIBILITY with DTSPINBOX * However, DtSpinBox does not prevent setting XmNspinBoxChildType * so we have to allow it. * * new_ssbp->sb_child_type = cur_ssbp->sb_child_type; */ if (new_ssbp->position_type != cur_ssbp->position_type) { new_ssbp->position_type = cur_ssbp->position_type; XmeWarning(new, BAD_SSPIN_SET_POSITION_TYPE); } if (new_ssbp->text_field != cur_ssbp->text_field) { new_ssbp->text_field = cur_ssbp->text_field; XmeWarning(new, BAD_SSPIN_SET_TEXT_FIELD); } /* * Collect changed args and push them onto the TextField child. * Let the SpinBox widget worry about ensuring values are valid * and about saving values. * * Later, we'll copy the relevant values back into the SimpleSpinBox * record to ensure consistancy. */ XtVaSetValues(new_ssbp->text_field, XmNarrowSensitivity, new_ssbp->arrow_sensitivity, XmNdecimalPoints, new_ssbp->decimal_points, XmNincrementValue, new_ssbp->increment_value, XmNmaximumValue, new_ssbp->maximum_value, XmNminimumValue, new_ssbp->minimum_value, XmNnumValues, new_ssbp->num_values, XmNposition, new_ssbp->position, XmNspinBoxChildType, new_ssbp->sb_child_type, XmNvalues, new_ssbp->values, XmNwrap, new_ssbp->wrap, XmNeditable, new_ssbp->editable, XmNcolumns, new_ssbp->columns, NULL); textf_c = SB_GetConstraintRec(new_ssbp->text_field); new_ssbp->arrow_sensitivity = textf_c->arrow_sensitivity; new_ssbp->decimal_points = textf_c->decimal_points; new_ssbp->increment_value = textf_c->increment_value; new_ssbp->maximum_value = textf_c->maximum_value; new_ssbp->minimum_value = textf_c->minimum_value; new_ssbp->num_values = textf_c->num_values; new_ssbp->position = textf_c->position; new_ssbp->sb_child_type = textf_c->sb_child_type; new_ssbp->values = textf_c->values; new_ssbp->wrap = textf_c->wrap; XtVaGetValues(new_ssbp->text_field, XmNeditable, &new_ssbp->editable, XmNcolumns, &new_ssbp->columns, NULL); return FALSE; } /*ARGSUSED*/ static void InsertChild(Widget newChild) { XmSimpleSpinBoxWidget ssb_w; WidgetClass super; XtWidgetProc insert_child; ssb_w = (XmSimpleSpinBoxWidget) XtParent(newChild); if (ssb_w->composite.num_children != 0) { XmeWarning((Widget) ssb_w, BAD_SSPIN_SET_TEXT_FIELD); return; } /* Call SpinBox's InsertChild method */ _XmProcessLock(); insert_child = ((XmSpinBoxWidgetClass)xmSpinBoxWidgetClass)-> composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(newChild); } /*ARGSUSED*/ static Widget GetCallbackWidget(Widget widget) { XmSimpleSpinBoxWidget ssb_w; WidgetClass super; ssb_w = (XmSimpleSpinBoxWidget) widget; return((Widget) ssb_w->simpleSpinBox.text_field); } /****************************************************************************** * SyntheticGetValue * XmExportProc conversion routine. * Used to retrieve constraint resources from the spinbox for the * textfield child. *****************************************************************************/ /*ARGSUSED*/ static void SyntheticGetValue(Widget widget, int offset, XtArgVal *value) { XmSimpleSpinBoxWidget ssb_w = (XmSimpleSpinBoxWidget) widget; switch (offset) { case Offset(arrow_sensitivity): #ifdef FIX_1530 { unsigned char new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNarrowSensitivity, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNarrowSensitivity, (unsigned char *) value, NULL); #endif break; case Offset(columns): #ifdef FIX_1530 { short new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNcolumns, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNcolumns, (short *) value, NULL); #endif break; case Offset(decimal_points): #ifdef FIX_1530 { short new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNdecimalPoints, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNdecimalPoints, (short *) value, NULL); #endif break; case Offset(editable): #ifdef FIX_1530 { Boolean new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNeditable, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNeditable, (Boolean *) value, NULL); #endif break; case Offset(increment_value): #ifdef FIX_1530 { short new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNincrementValue, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNincrementValue, (short *) value, NULL); #endif break; case Offset(minimum_value): #ifdef FIX_1530 { int new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNminimumValue, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNminimumValue, (int *) value, NULL); #endif break; case Offset(maximum_value): #ifdef FIX_1530 { int new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNmaximumValue, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNmaximumValue, (int *) value, NULL); #endif break; case Offset(num_values): #ifdef FIX_1530 { int new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNnumValues, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNnumValues, (int *) value, NULL); #endif break; case Offset(position): #ifdef FIX_1530 { int new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNposition, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNposition, (int *) value, NULL); #endif break; case Offset(position_type): #ifdef FIX_1530 { unsigned char new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNpositionType, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNpositionType, (unsigned char *) value, NULL); #endif break; case Offset(sb_child_type): #ifdef FIX_1530 { unsigned char new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNspinBoxChildType, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNspinBoxChildType, (unsigned char *) value, NULL); #endif break; case Offset(values): #ifdef FIX_1530 { XmStringTable new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNvalues, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNvalues, (XmStringTable *) value, NULL); #endif break; case Offset(wrap): #ifdef FIX_1530 { Boolean new_value; XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNwrap, &new_value, NULL); *value = (XtArgVal)new_value; } #else XtVaGetValues(ssb_w->simpleSpinBox.text_field, XmNwrap, (Boolean *) value, NULL); #endif break; default: fprintf(stderr, "SimpleSpinBox ERROR: Invalid synthetic resource offset %d\n", offset); break; } } /****************************************************************************** ** *** EVENT HANDLERS ** *****************************************************************************/ /****************************************************************************** ** *** ACTIONS ** *****************************************************************************/ /****************************************************************************** ** *** OTHER FUNCTIONS ** *****************************************************************************/ /* * Public API */ /************************************************************************ * XmCreateSimpleSpinBox * Create an instance of a Spin widget and return the widget id. ************************************************************************/ Widget XmCreateSimpleSpinBox( Widget parent, String name, ArgList arglist, Cardinal argcount) { return(XtCreateWidget(name, xmSimpleSpinBoxWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateSimpleSpinBox( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSimpleSpinBoxWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedSimpleSpinBox( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSimpleSpinBoxWidgetClass, parent, True, var, count); va_end(var); return w; } /************************************************************************ * XmSimpleSpinBoxAddItem * Add an item to the list of strings at the specified position. ************************************************************************/ void XmSimpleSpinBoxAddItem( Widget ssb_w, XmString item, int pos) { XmSimpleSpinBoxPart *ssb_p = SSB_SIMPLE_SPIN_BOX_PART(ssb_w); XmSpinBoxConstraint textf_c; XmStringTable values; int new_nvalues; int i; _XmWidgetToAppContext(ssb_w); _XmAppLock(app); /* * Get the latest resource values for the SimpleSpinBox child. * These may have been changed either by internal operation * of the SpinBox or by the application doing a SetValues on * the SimpleSpinBox child. */ XtVaGetValues(ssb_p->text_field, XmNarrowSensitivity, &ssb_p->arrow_sensitivity, XmNdecimalPoints, &ssb_p->decimal_points, XmNincrementValue, &ssb_p->increment_value, XmNmaximumValue, &ssb_p->maximum_value, XmNminimumValue, &ssb_p->minimum_value, XmNnumValues, &ssb_p->num_values, XmNposition, &ssb_p->position, XmNspinBoxChildType, &ssb_p->sb_child_type, XmNvalues, &ssb_p->values, XmNwrap, &ssb_p->wrap, XmNeditable, &ssb_p->editable, XmNcolumns, &ssb_p->columns, NULL); /* * Error checking. */ if (ssb_p->sb_child_type != XmSTRING) { _XmAppUnlock(app); return; } if (item == (XmString) NULL) { _XmAppUnlock(app); return; } /* * BINARY COMPATIBILITY with DTSPINBOX * * User gives pos starting at 1 (0 means end of list) */ pos--; if ((pos < 0) || (pos > ssb_p->num_values)) pos = ssb_p->num_values; new_nvalues = ssb_p->num_values + 1; /* * Keep the position up to date. */ if (ssb_p->position > pos) ssb_p->position++; /* * Copy the current array of values adding in the new item. */ values = (XmStringTable) XtRealloc((char *) NULL, sizeof(XmString) * new_nvalues); if (values == (XmStringTable) NULL) { _XmAppUnlock(app); return; } for (i=0; ivalues[i]); values[pos] = XmStringCopy(item); for (i=pos+1; ivalues[i-1]); /* * Set the values array in the parent and save the XmStringTable. */ XtVaSetValues(ssb_p->text_field, XmNvalues, values, XmNnumValues, new_nvalues, XmNposition, ssb_p->position, NULL); textf_c = SB_GetConstraintRec(ssb_p->text_field); ssb_p->values = textf_c->values; ssb_p->num_values = textf_c->num_values; ssb_p->position = textf_c->position; /* * Free up the memory in the values array. */ for (i=0; itext_field, XmNarrowSensitivity, &ssb_p->arrow_sensitivity, XmNdecimalPoints, &ssb_p->decimal_points, XmNincrementValue, &ssb_p->increment_value, XmNmaximumValue, &ssb_p->maximum_value, XmNminimumValue, &ssb_p->minimum_value, XmNnumValues, &ssb_p->num_values, XmNposition, &ssb_p->position, XmNspinBoxChildType, &ssb_p->sb_child_type, XmNvalues, &ssb_p->values, XmNwrap, &ssb_p->wrap, XmNeditable, &ssb_p->editable, XmNcolumns, &ssb_p->columns, NULL); /* * Error checking. */ if ((ssb_p->sb_child_type != XmSTRING) || (ssb_p->num_values < 1)) { _XmAppUnlock(app); return; } /* * BINARY COMPATIBILITY with DTSPINBOX * * User gives pos starting at 1 (0 means end of list) */ pos--; if ((pos < 0) || (pos > ssb_p->num_values)) pos = ssb_p->num_values - 1; new_nvalues = ssb_p->num_values - 1; /* * Keep the position up to date. */ if (ssb_p->position > pos) ssb_p->position--; /* * Copy the current array of values skipping the item in position 'pos'. */ values = (XmStringTable) XtRealloc((char *) NULL, sizeof(XmString) * new_nvalues); if (values == (XmStringTable) NULL) { _XmAppUnlock(app); return; } for (i=0, skipped=0; inum_values; i++) if (i != pos) values[i-skipped] = XmStringCopy(ssb_p->values[i]); else skipped++; /* * Set the values array in the parent and save the XmStringTable. */ XtVaSetValues(ssb_p->text_field, XmNvalues, values, XmNnumValues, new_nvalues, XmNposition, ssb_p->position, NULL); textf_c = SB_GetConstraintRec(ssb_p->text_field); ssb_p->values = textf_c->values; ssb_p->num_values = textf_c->num_values; ssb_p->position = textf_c->position; /* * Free up the memory in the values array. */ for (i=0; itext_field, XmNarrowSensitivity, &ssb_p->arrow_sensitivity, XmNdecimalPoints, &ssb_p->decimal_points, XmNincrementValue, &ssb_p->increment_value, XmNmaximumValue, &ssb_p->maximum_value, XmNminimumValue, &ssb_p->minimum_value, XmNnumValues, &ssb_p->num_values, XmNposition, &ssb_p->position, XmNspinBoxChildType, &ssb_p->sb_child_type, XmNvalues, &ssb_p->values, XmNwrap, &ssb_p->wrap, XmNeditable, &ssb_p->editable, XmNcolumns, &ssb_p->columns, NULL); if (item && ssb_p->num_values > 0) { for (pos=0; posnum_values; pos++) if (XmStringCompare(item, ssb_p->values[pos])) break; if (pos < ssb_p->num_values) { XtSetArg(args[0], XmNposition, pos); XtSetValues(ssb_p->text_field, args, 1); textf_c = SB_GetConstraintRec(ssb_p->text_field); ssb_p->position = textf_c->position; } else XmeWarning((Widget) ssb_w, BAD_SSPIN_SET_ITEM); } _XmAppUnlock(app); } motif-2.3.8/lib/Xm/CommandI.h0000644000175000017500000000333512672140200012553 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: CommandI.h /main/6 1995/07/14 10:16:31 drk $ */ #ifndef _XmCommandI_h #define _XmCommandI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmCommandReturn( Widget wid, XEvent *event, String *params, Cardinal *numParams) ; extern void _XmCommandUpOrDown( Widget wid, XEvent *event, String *argv, Cardinal *argc) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCommandI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MultiListP.h0000644000175000017500000002557512672140200013144 00000000000000#ifndef _XmMultiListP_h_ #define _XmMultiListP_h_ #include #include #include #if defined(__cplusplus) extern "C" { #endif /* * IList Stuff. */ #define XmMultiList_DEFAULT_VISIBLE_COUNT 5 /* XmNvisibleItemCount */ #define XmMultiListIndex (XmManagerIndex + 1) #define XmI18ListIndex (XmPrimitiveIndex + 1) #define XmI18List_selection_policy(w) (((XmI18ListWidget)(w))->ilist.selection_policy) #define XmI18List_num_columns(w) (((XmI18ListWidget)(w))->ilist.num_columns) #define XmI18List_column_titles(w) (((XmI18ListWidget)(w))->ilist.column_titles) #define XmI18List_num_rows(w) (((XmI18ListWidget)(w))->ilist.num_rows) #define XmI18List_row_data(w) (((XmI18ListWidget)(w))->ilist.row_data) #define XmI18List_first_col_pixmaps(w) (((XmI18ListWidget)(w))->ilist.first_col_pixmaps) #define XmI18List_font_list(w) (((XmI18ListWidget)(w))->ilist.font_list) #define XmI18List_v_bar(w) (((XmI18ListWidget)(w))->ilist.v_bar) #define XmI18List_h_bar(w) (((XmI18ListWidget)(w))->ilist.h_bar) #define XmI18List_first_row(w) (((XmI18ListWidget)(w))->ilist.first_row) #define XmI18List_first_col(w) (((XmI18ListWidget)(w))->ilist.first_col) #define XmI18List_double_click(w) (((XmI18ListWidget)(w))->ilist.double_click) #define XmI18List_single_select(w) (((XmI18ListWidget)(w))->ilist.single_select) #define XmI18List_selected_header(w) (((XmI18ListWidget)(w))->ilist.selected_header) #define XmI18List_sort_functions(w) (((XmI18ListWidget)(w))->ilist.sort_functions) #define XmI18List_string_direction(w) (((XmI18ListWidget)(w))->ilist.string_direction) #define XmI18List_alignment(w) (((XmI18ListWidget)(w))->ilist.alignment) #define XmI18List_column_widths(w) (((XmI18ListWidget)(w))->ilist.column_widths) #define XmI18List_end(w) (((XmI18ListWidget)(w))->ilist.end) #define XmI18List_anchor(w) (((XmI18ListWidget)(w))->ilist.anchor) #define XmI18List_sep_y(w) (((XmI18ListWidget)(w))->ilist.sep_y) #define XmI18List_title_row_height(w) (((XmI18ListWidget)(w))->ilist.title_row_height) #define XmI18List_row_height(w) (((XmI18ListWidget)(w))->ilist.row_height) #define XmI18List_gc(w) (((XmI18ListWidget)(w))->ilist.gc) #define XmI18List_rev_gc(w) (((XmI18ListWidget)(w))->ilist.rev_gc) #define XmI18List_stippled_gc(w) (((XmI18ListWidget)(w))->ilist.stippled_gc) #define XmI18List_stippled_rev_gc(w) (((XmI18ListWidget)(w))->ilist.stippled_rev_gc) #define XmI18List_inv_gc(w) (((XmI18ListWidget)(w))->ilist.inv_gc) #define XmI18List_state(w) (((XmI18ListWidget)(w))->ilist.state) #define XmI18List_timeout(w) (((XmI18ListWidget)(w))->ilist.timeout) #define XmI18List_working_row(w) (((XmI18ListWidget)(w))->ilist.working_row) #define XmI18List_working_col(w) (((XmI18ListWidget)(w))->ilist.working_col) #define XmI18List_time(w) (((XmI18ListWidget)(w))->ilist.time) #define XmI18List_left_loc(w) (((XmI18ListWidget)(w))->ilist.left_loc) #define XmI18List_search_column(w) (((XmI18ListWidget)(w))->ilist.search_column) #define XmI18List_visible_rows(w) (((XmI18ListWidget)(w))->ilist.visible_rows) #define XmI18List_new_visual_style(w) (((XmI18ListWidget)(w))->ilist.new_visual_style) #define XmI18List_entry_background_pixel(w) (((XmI18ListWidget)(w))->ilist.entry_background_pixel) #define XmI18List_entry_background_use(w) (((XmI18ListWidget)(w))->ilist.entry_background_use) #define XmI18List_entry_background_gc(w) (((XmI18ListWidget)(w))->ilist.entry_background_gc) #define XmI18List_entry_background_fill_gc(w) (((XmI18ListWidget)(w))->ilist.entry_background_fill_gc) #define XmI18List_entry_background_rev_gc(w) (((XmI18ListWidget)(w))->ilist.entry_background_rev_gc) #define XmI18List_entry_background_stippled_gc(w) (((XmI18ListWidget)(w))->ilist.entry_background_stippled_gc) #define XmI18List_entry_background_stippled_rev_gc(w) (((XmI18ListWidget)(w))->ilist.entry_background_stippled_rev_gc) #define XmI18List_entry_background_inv_gc(w) (((XmI18ListWidget)(w))->ilist.entry_background_inv_gc) #define XmMultiList_title(w) (((XmMultiListWidget)(w))->ext_list.title) #define XmMultiList_find_label(w) \ (((XmMultiListWidget)(w))->ext_list.find_label) #define XmMultiList_double_click(w) \ (((XmMultiListWidget)(w))->ext_list.double_click) #define XmMultiList_single_select(w) \ (((XmMultiListWidget)(w))->ext_list.single_select) #define XmMultiList_show_find(w) \ (((XmMultiListWidget)(w))->ext_list.show_find) #define XmMultiList_title_wid(w) \ (((XmMultiListWidget)(w))->ext_list.title_wid) #define XmMultiList_frame(w) (((XmMultiListWidget)(w))->ext_list.frame) #define XmMultiList_ilist(w) (((XmMultiListWidget)(w))->ext_list.ilist) #define XmMultiList_v_bar(w) (((XmMultiListWidget)(w))->ext_list.v_bar) #define XmMultiList_h_bar(w) (((XmMultiListWidget)(w))->ext_list.h_bar) #define XmMultiList_find(w) (((XmMultiListWidget)(w))->ext_list.find) #define XmMultiList_find_text(w) \ (((XmMultiListWidget)(w))->ext_list.find_text) #define XmMultiList_last_search(w) \ (((XmMultiListWidget)(w))->ext_list.last_search) #define XmMultiList_item_found(w) \ (((XmMultiListWidget)(w))->ext_list.item_found) #define XmMultiList_not_found(w) \ (((XmMultiListWidget)(w))->ext_list.not_found) #define XmMultiList_visible_rows(w) \ (((XmMultiListWidget)(w))->ext_list.visible_rows) #define XmMultiList_title_string(w) \ (((XmMultiListWidget)(w))->ext_list.title_string) /* * IList widget definitions. */ /* I18List struct passed to Convert proc for drag and drop */ typedef struct _XmI18ListDragConvertStruct { Widget w; XmString *strings; int num_items; Pixmap pixmap; } XmI18ListDragConvertStruct; typedef struct _I18ListClassPart { XtPointer extension; /* Just in case we need it later. */ } I18ListClassPart; typedef struct _XmI18ListClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive; I18ListClassPart ilist_class; } XmI18ListClassRec; externalref XmI18ListClassRec xmI18ListClassRec; typedef struct _XmI18ListPart { /* * Resources */ unsigned char selection_policy; /* selection mode - kat 12-28-90 */ short num_columns; /* number of columns in the list. */ XmString * column_titles; /* title for each column. */ short num_rows; /* number of rows in the list. */ XmMultiListRowInfo *row_data;/* Data to put into each column. */ Boolean first_col_pixmaps; /* Should we put mini_icons in the first column of each entry? */ XmFontList font_list; /* This widget's font list. */ Widget v_bar, h_bar; /* Scrollbars that may be used to scroll this widget. */ short first_row; /* which row is at the top of the display. */ short first_col; /* which column is at the far left. */ XtCallbackList double_click; /* The double click callback list. */ XtCallbackList single_select; /*The single click callback list. */ short selected_header; /* The currently selected header. */ Xm18SortFunction *sort_functions; /* The client supplied sort functions */ unsigned char string_direction; unsigned char alignment; /* * Private State */ short * column_widths; /* Width of each column. */ short end; /* The non-anchor end point. */ short anchor; /* The anchor point for the extended selection. */ int sep_y; /*location of the top of the separator line.*/ short title_row_height; /* height of title row */ short row_height; /* height of all other data rows */ GC gc; /* The graphics context for normal text. */ GC rev_gc; /* The graphics context for inverted text. */ GC stippled_gc; /* The graphics context for normal text. */ GC stippled_rev_gc; /* The graphics context for inverted text. */ GC inv_gc; /* The graphics context for inverting areas. */ unsigned short state; /* The state of this widget. */ XtIntervalId timeout; /* The mulit - click timout. */ short working_row, working_col; /* A Working row and column. */ Time time; /*The server time of the last button click. */ int left_loc; /* left margin in pixels. */ short search_column; /* added for I18List Find support */ int visible_rows; /* Visible item (row) count */ Boolean new_visual_style; Pixel entry_background_pixel; Boolean entry_background_use; GC entry_background_gc; GC entry_background_fill_gc; GC entry_background_stippled_gc; GC entry_background_stippled_rev_gc; GC entry_background_inv_gc; GC entry_background_rev_gc; Boolean check_set_render_table; /* used in CheckSetRenderTable */ XmI18ListDragConvertStruct * drag_conv; } XmI18ListPart; typedef struct _XmI18ListRec { CorePart core; XmPrimitivePart primitive; XmI18ListPart ilist; } XmI18ListRec; /* * Extended List. */ typedef struct { XtPointer extension; /* Just in case we need it later. */ } XmMultiListClassPart; typedef struct _XmMultiListClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmMultiListClassPart ext_list_class; } XmMultiListClassRec; typedef struct { /* resources */ XmString title; /* Title for the list (backwards compatible) */ XmString find_label; /* label for Find button */ XtCallbackList double_click; /* The double click callbacks. */ XtCallbackList single_select; /* The single click callbacks. -kat */ Boolean show_find; /* whether to display the Find button and textF */ /* private state */ Widget title_wid; /* The list title widget. */ Widget frame; /* Frame to display list into. */ Widget ilist; /* The internal list widget. */ Widget v_bar, h_bar; /* The scrollbars. */ Widget find, find_text; /* Widgets used for a find. */ String last_search; XtCallbackList item_found; /* Called when find succeeds */ XtCallbackList not_found; /* Called when find doesn't succeed */ int visible_rows; /* visible items (mirrored in XmI18ListPart) */ XmString title_string; /* (preferred use) Title for the list */ Boolean check_set_select_callback; } XmMultiListPart; typedef struct _XmMultiListRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmMultiListPart ext_list; } XmMultiListRec; /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ XmMultiListRowInfo ** XmI18ListGetSelectedRows(Widget); void Xm18IListUnselectItem(Widget, XmMultiListRowInfo *); void Xm18IListUnselectAllItems(Widget); void XmI18ListToggleRow(Widget , short); typedef struct _XmI18ListClassRec *XmI18ListWidgetClass; typedef struct _XmI18ListRec *XmI18ListWidget; extern XmMultiListClassRec xmMultiListClassRec; extern XmI18ListClassRec xiI18ListClassRec; extern WidgetClass xmI18ListWidgetClass; #if defined(__cplusplus) } #endif #endif /* _XmMultiListP_h_ */ motif-2.3.8/lib/Xm/HierarchyP.h0000644000175000017500000002131012672140200013113 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmHierarchyP_h #define _XmHierarchyP_h #if defined(VMS) || defined(__VMS) #include #endif /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #ifdef __cplusplus extern "C" { #endif #define IS_MAPPED (1L << 1) #define IS_COMPRESSED (1L << 2) #define PARENT_GONE (1L << 3) #define IS_SELECTED (1L << 4) /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ typedef struct _HierNodeInfo { /* * Public (Resource) data. */ XmHierarchyNodeState state; /* State of the node. */ Widget parent; /* parent of this child. */ Widget insert_before; /* Sibling to insert this node before; NULL will place it at the end. */ Pixmap open_folder, close_folder; /* Images for open/close buttons. */ /* * Private data. */ Widget widget; /* Back pointer to this node's widget. */ Widget open_close_button; /* The open or close button. */ struct _HierarchyConstraintRec ** children; /* norm children. */ Cardinal num_children; /* number of each type of children. */ Cardinal alloc_attrs, alloc; /* amount of allocated space for each */ unsigned char status; /* 8 status bits. */ } HierNodeInfo; typedef struct _HierarchyConstraintRec { XmManagerConstraintPart manager; HierNodeInfo hierarchy; } HierarchyConstraintRec, XmHierarchyConstraintRec, *HierarchyConstraints; typedef void (*XmHierarchyNodeProc)(HierarchyConstraints); typedef void (*XmHierarchyExtraNodeProc)(Widget, HierarchyConstraints); typedef void (*XmHierarchyBuildTableProc)(Widget, HierarchyConstraints, Cardinal *); typedef void (*XmHierarchyResetButtonProc)(Widget, HierarchyConstraints); typedef struct { /* Class function for changing node state. */ XmHierarchyNodeProc change_node_state; /* map or unmap a given node. */ XmHierarchyNodeProc map_node; XmHierarchyNodeProc unmap_node; /* Unmaps all the extra nodes. */ XmHierarchyExtraNodeProc unmap_all_extra_nodes; /* Builds the node table. */ XmHierarchyBuildTableProc build_node_table; /* Correctly sets the state of the open/close button. */ XmHierarchyResetButtonProc reset_open_close_button; /* Toggles state of a node. */ XtCallbackProc toggle_node_state; /* Just in case we need it later. */ XtPointer extension; } HierarchyClassPart; typedef struct _XmHierarchyClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; HierarchyClassPart hierarchy_class; } XmHierarchyClassRec; externalref XmHierarchyClassRec xmHierarchyClassRec; typedef struct _HierarchyPart { /* resources */ Boolean auto_close; /* Auto-close children when parent is closed?*/ Boolean refigure_mode; /* Do refigures? */ Dimension h_margin; /* The horizontal margin. */ Dimension v_margin; /* The vertical margin. */ Pixmap open_folder, close_folder; /* Images for open/close buttons. */ XtCallbackList node_state_callback; /* Called when the node button is clicked */ XtCallbackList node_state_changed_callback; /* Called when the node state changes */ XtCallbackList node_state_beg_end_callback; /* Called when beginning or ending a set of node state changes */ /* private state */ HierarchyConstraintRec ** node_table; HierarchyConstraints top_node; Cardinal num_nodes, alloc_nodes; Pixmap def_open_folder, def_close_folder; /* Default folder button Images*/ XtWorkProcId work_proc_id; /* work proc id for the move nodes wp */ } HierarchyPart; typedef struct _XmHierarchyRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; HierarchyPart hierarchy; } XmHierarchyRec; /* * These are necessary because the XmResolvePartOffset macros assume a * certain naming convention */ typedef HierarchyPart XmHierarchyPart; typedef HierNodeInfo XmHierarchyConstraintPart; #define XmHierarchy_auto_close(w) (((XmHierarchyWidget)(w))->hierarchy.auto_close) #define XmHierarchy_refigure_mode(w) (((XmHierarchyWidget)(w))->hierarchy.refigure_mode) #define XmHierarchy_h_margin(w) (((XmHierarchyWidget)(w))->hierarchy.h_margin) #define XmHierarchy_v_margin(w) (((XmHierarchyWidget)(w))->hierarchy.v_margin) #define XmHierarchy_open_folder(w) (((XmHierarchyWidget)(w))->hierarchy.open_folder) #define XmHierarchy_close_folder(w) (((XmHierarchyWidget)(w))->hierarchy.close_folder) #define XmHierarchy_node_state_callback(w) (((XmHierarchyWidget)(w))->hierarchy.node_state_callback) #define XmHierarchy_node_state_changed_callback(w) (((XmHierarchyWidget)(w))->hierarchy.node_state_changed_callback) #define XmHierarchy_node_state_beg_end_callback(w) (((XmHierarchyWidget)(w))->hierarchy.node_state_beg_end_callback) #define XmHierarchy_node_table(w) (((XmHierarchyWidget)(w))->hierarchy.node_table) #define XmHierarchy_top_node(w) (((XmHierarchyWidget)(w))->hierarchy.top_node) #define XmHierarchy_num_nodes(w) (((XmHierarchyWidget)(w))->hierarchy.num_nodes) #define XmHierarchy_alloc_nodes(w) (((XmHierarchyWidget)(w))->hierarchy.alloc_nodes) #define XmHierarchy_def_open_folder(w) (((XmHierarchyWidget)(w))->hierarchy.def_open_folder) #define XmHierarchy_def_close_folder(w) (((XmHierarchyWidget)(w))->hierarchy.def_close_folder) #define XmHierarchy_work_proc_id(w) (((XmHierarchyWidget)(w))->hierarchy.work_proc_id) #define XmHierarchyC_state(constraints) ((constraints)->hierarchy.state) #define XmHierarchyC_parent(constraints) ((constraints)->hierarchy.parent) #define XmHierarchyC_insert_before(constraints) ((constraints)->hierarchy.insert_before) #define XmHierarchyC_open_folder(constraints) ((constraints)->hierarchy.open_folder) #define XmHierarchyC_close_folder(constraints) ((constraints)->hierarchy.close_folder) #define XmHierarchyC_widget(constraints) ((constraints)->hierarchy.widget) #define XmHierarchyC_open_close_button(constraints) ((constraints)->hierarchy.open_close_button) #define XmHierarchyC_children(constraints) ((constraints)->hierarchy.children) #define XmHierarchyC_num_children(constraints) ((constraints)->hierarchy.num_children) #define XmHierarchyC_alloc_attrs(constraints) ((constraints)->hierarchy.alloc_attrs) #define XmHierarchyC_alloc(constraints) ((constraints)->hierarchy.alloc) #define XmHierarchyC_status(constraints) ((constraints)->hierarchy.status) #define XtInheritChangeNodeState ((XmHierarchyNodeProc)_XtInherit) #define XtInheritUnmapAllExtraNodes ((XmHierarchyExtraNodeProc)_XtInherit) #define XtInheritUnmapNode ((XmHierarchyNodeProc)_XtInherit) #define XtInheritMapNode ((XmHierarchyNodeProc)_XtInherit) #define XtInheritBuildNodeTable ((XmHierarchyBuildTableProc)_XtInherit) #define XtInheritResetOpenCloseButton ((XmHierarchyResetButtonProc)_XtInherit) #define XtInheritToggleNodeState ((XtCallbackProc)_XtInherit) /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ /************************************************************ * STATIC DECLARATIONS *************************************************************/ #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _HierarchyP_h */ motif-2.3.8/lib/Xm/UnhighlightT.h0000644000175000017500000000314112672140200013455 00000000000000/* $XConsortium: UnhighlightT.h /main/5 1995/07/15 20:56:56 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmSpecifyUnhighlightT_H #define _XmSpecifyUnhighlightT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTspecifyUnhighlight; /* Trait structures and typedefs, place typedefs first */ typedef GC (*XmSpecifyUnhighlightProc)(Widget wid, Widget child); /* Version 0: initial release. */ typedef struct _XmSpecifyUnhighlightTraitRec { int version; /* 0 */ XmSpecifyUnhighlightProc getUnhighlightGC; } XmSpecifyUnhighlightTraitRec, *XmSpecifyUnhighlightTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSpecifyUnhighlightT_H */ motif-2.3.8/lib/Xm/ResEncod.c0000644000175000017500000024303613066310437012576 00000000000000/* $XConsortium: ResEncod.c /main/8 1996/11/12 05:37:04 pascale $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #ifndef X_NOT_STDC_ENV #include #endif #include #include #ifdef UTF8_SUPPORTED #include #endif #include #include #include "MessagesI.h" #include "ResEncodI.h" #include "XmI.h" #include "XmosI.h" #include "XmStringI.h" #include "ResConverI.h" #define MSG8 _XmMMsgResConvert_0007 #define MSG9 _XmMMsgResConvert_0008 #define MSG10 _XmMMsgResConvert_0009 #define MSG11 _XmMMsgResConvert_0010 #define MSG13 _XmMMsgResConvert_0012 #define MSG14 _XmMMsgResConvert_0013 typedef unsigned char Octet; typedef Octet *OctetPtr; typedef XmConst Octet *const_OctetPtr; typedef enum { ct_Dir_StackEmpty, ct_Dir_Undefined, ct_Dir_LeftToRight, ct_Dir_RightToLeft } ct_Direction; /* ** ct_Charset is used in the xmstring_to_text conversion to keep track ** of the prevous character set. The order is not important. */ typedef enum { cs_none, cs_Hanzi, cs_JapaneseGCS, cs_Katakana, cs_KoreanGCS, cs_Latin1, cs_Latin2, cs_Latin3, cs_Latin4, cs_Latin5, cs_LatinArabic, cs_LatinCyrillic, cs_LatinGreek, cs_LatinHebrew, cs_NonStandard, cs_ir111 } ct_Charset; /* Internal context block */ typedef struct _ct_context { OctetPtr octet; /* octet ptr into compound text stream */ OctetPtr lastoctet; /* ptr to last octet in stream */ struct { /* flags */ unsigned dircs : 1; /* direction control seq encountered */ unsigned gchar : 1; /* graphic characters encountered */ unsigned ignext : 1; /* ignore extensions */ unsigned gl : 1; /* text is for gl */ unsigned text : 1; /* current item is a text seq */ } flags; ct_Direction *dirstack; /* direction stack pointer */ unsigned int dirsp; /* current dir stack index */ unsigned int dirstacksize; /* size of direction stack */ OctetPtr encoding; /* ptr to current encoding sequence */ unsigned int encodinglen; /* length of encoding sequence */ OctetPtr item; /* ptr to current item */ unsigned int itemlen; /* length of current item */ unsigned int version; /* version of compound text */ XmConst char* gl_charset; /* ptr to GL character set */ unsigned char gl_charset_size; /* # of chars in GL charset */ unsigned char gl_octets_per_char; /* # of octets per GL char */ XmConst char* gr_charset; /* ptr to GR character set */ unsigned char gr_charset_size; /* # of chars in GR charset */ unsigned char gr_octets_per_char; /* # of octets per GR char */ XmString xmstring; /* compound string to be returned */ XmString xmsep; /* compound string separator segment */ XmString xmtab; /* compound string tab segment */ } ct_context; /* * Segment Encoding Registry datatype and macros */ typedef struct _EncodingRegistry { char *fontlist_tag; char *ct_encoding; struct _EncodingRegistry *next; } SegmentEncoding; #define EncodingRegistryTag(er) ((SegmentEncoding *)(er))->fontlist_tag #define EncodingRegistryEncoding(er) ((SegmentEncoding *)(er))->ct_encoding #define EncodingRegistryNext(er) ((SegmentEncoding *)(er))->next /* ** Define standard character set strings */ static XmConst char CS_ISO8859_1[] = "ISO8859-1" ; static XmConst char CS_ISO8859_2[] = "ISO8859-2" ; static XmConst char CS_ISO8859_3[] = "ISO8859-3" ; static XmConst char CS_ISO8859_4[] = "ISO8859-4" ; static XmConst char CS_ISO8859_5[] = "ISO8859-5" ; static XmConst char CS_ISO8859_6[] = "ISO8859-6" ; static XmConst char CS_ISO8859_7[] = "ISO8859-7" ; static XmConst char CS_ISO8859_8[] = "ISO8859-8" ; static XmConst char CS_ISO8859_9[] = "ISO8859-9" ; static XmConst char CS_JISX0201[] = "JISX0201.1976-0" ; static XmConst char CS_GB2312_0[] = "GB2312.1980-0" ; static XmConst char CS_GB2312_1[] = "GB2312.1980-1" ; static XmConst char CS_JISX0208_0[] = "JISX0208.1983-0" ; static XmConst char CS_JISX0208_1[] = "JISX0208.1983-1" ; static XmConst char CS_KSC5601_0[] = "KSC5601.1987-0" ; static XmConst char CS_KSC5601_1[] = "KSC5601.1987-1" ; static XmConst char CS_UTF_8[] = "UTF-8" ; static XmConst char CS_ISO_IR_111[] = "ISO-IR-111" ; /* Define handy macros (note: these constants are in OCTAL) */ #define EOS 00 #define STX 02 #define HT 011 #define NL 012 #define ESC 033 #define CSI 0233 static XmConst Octet NEWLINESTRING[] = "\012"; #define NEWLINESTRING_LEN sizeof(NEWLINESTRING)-1 static XmConst Octet TABSTRING[] = "\011"; #define TABSTRING_LEN sizeof(TABSTRING)-1 static XmConst Octet CTEXT_L_TO_R[] = "\233\061\135"; #define CTEXT_L_TO_R_LEN sizeof(CTEXT_L_TO_R)-1 static XmConst Octet CTEXT_R_TO_L[] = "\233\062\135"; #define CTEXT_R_TO_L_LEN sizeof(CTEXT_R_TO_L)-1 static XmConst Octet CTEXT_SET_ISO8859_1[] = "\033\050\102\033\055\101"; #define CTEXT_SET_ISO8859_1_LEN sizeof(CTEXT_SET_ISO8859_1)-1 static XmConst Octet CTEXT_SET_ISO8859_2[] = "\033\050\102\033\055\102"; #define CTEXT_SET_ISO8859_2_LEN sizeof(CTEXT_SET_ISO8859_2)-1 static XmConst Octet CTEXT_SET_ISO8859_3[] = "\033\050\102\033\055\103"; #define CTEXT_SET_ISO8859_3_LEN sizeof(CTEXT_SET_ISO8859_3)-1 static XmConst Octet CTEXT_SET_ISO8859_4[] = "\033\050\102\033\055\104"; #define CTEXT_SET_ISO8859_4_LEN sizeof(CTEXT_SET_ISO8859_4)-1 static XmConst Octet CTEXT_SET_ISO8859_5[] = "\033\050\102\033\055\114"; #define CTEXT_SET_ISO8859_5_LEN sizeof(CTEXT_SET_ISO8859_5)-1 static XmConst Octet CTEXT_SET_ISO8859_6[] = "\033\050\102\033\055\107"; #define CTEXT_SET_ISO8859_6_LEN sizeof(CTEXT_SET_ISO8859_6)-1 static XmConst Octet CTEXT_SET_ISO8859_7[] = "\033\050\102\033\055\106"; #define CTEXT_SET_ISO8859_7_LEN sizeof(CTEXT_SET_ISO8859_7)-1 static XmConst Octet CTEXT_SET_ISO8859_8[] = "\033\050\102\033\055\110"; #define CTEXT_SET_ISO8859_8_LEN sizeof(CTEXT_SET_ISO8859_8)-1 static XmConst Octet CTEXT_SET_ISO8859_9[] = "\033\050\102\033\055\115"; #define CTEXT_SET_ISO8859_9_LEN sizeof(CTEXT_SET_ISO8859_9)-1 static XmConst Octet CTEXT_SET_JISX0201[] = "\033\050\112\033\051\111"; #define CTEXT_SET_JISX0201_LEN sizeof(CTEXT_SET_JISX0201)-1 static XmConst Octet CTEXT_SET_GB2312_0[] = "\033\044\050\101\033\044\051\101"; #define CTEXT_SET_GB2312_0_LEN sizeof(CTEXT_SET_GB2312_0)-1 static XmConst Octet CTEXT_SET_JISX0208_0[] = "\033\044\050\102\033\044\051\102"; #define CTEXT_SET_JISX0208_0_LEN sizeof(CTEXT_SET_JISX0208_0)-1 static XmConst Octet CTEXT_SET_KSC5601_0[] = "\033\044\050\103\033\044\051\103"; #define CTEXT_SET_KSC5601_0_LEN sizeof(CTEXT_SET_KSC5601_0)-1 static XmConst Octet CTEXT_SET_IR_111[] = "\033\050\102\033\055\100"; #define CTEXT_SET_IR_111_LEN sizeof(CTEXT_SET_IR_111)-1 #ifdef UTF8_SUPPORTED static XmConst char UTF8_NEWLINESTRING[] = "\012"; #define UTF8_NEWLINESTRING_LEN sizeof(UTF8_NEWLINESTRING)-1 static XmConst char UTF8_TABSTRING[] = "\011"; #define UTF8_TABSTRING_LEN sizeof(UTF8_TABSTRING)-1 static XmConst char UTF8_L_TO_R[] = "\342\200\216"; #define UTF8_L_TO_R_LEN sizeof(UTF8_L_TO_R)-1 static XmConst char UTF8_R_TO_L[] = "\342\200\217"; #define UTF8_R_TO_L_LEN sizeof(UTF8_R_TO_L)-1 #endif /* UTF8_SUPPORTED */ #define CTVERSION 1 #define _IsValidC0(ctx, c) (((c) == HT) || ((c) == NL) || ((ctx)->version > CTVERSION)) #define _IsValidC1(ctx, c) ((ctx)->version > CTVERSION) #define _IsValidESCFinal(c) (((c) >= 0x30) && ((c) <= 0x7e)) #define _IsValidCSIFinal(c) (((c) >= 0x40) && ((c) <= 0x7e)) #define _IsInC0Set(c) ((c) <= 0x1f) #define _IsInC1Set(c) (((c) >= 0x80) && ((c) <= 0x9f)) #define _IsInGLSet(c) (((c) >= 0x20) && ((c) <= 0x7f)) #define _IsInGRSet(c) ((c) >= 0xa0) #define _IsInColumn2(c) (((c) >= 0x20) && ((c) <= 0x2f)) #define _IsInColumn3(c) (((c) >= 0x30) && ((c) <= 0x3f)) #define _IsInColumn4(c) (((c) >= 0x40) && ((c) <= 0x4f)) #define _IsInColumn5(c) (((c) >= 0x50) && ((c) <= 0x5f)) #define _IsInColumn6(c) (((c) >= 0x60) && ((c) <= 0x6f)) #define _IsInColumn7(c) (((c) >= 0x70) && ((c) <= 0x7f)) #define _IsInColumn4or5(c) (((c) >= 0x40) && ((c) <= 0x5f)) #define _SetGL(ctx, charset, size, octets)\ (ctx)->flags.gl = True;\ (ctx)->gl_charset = (charset);\ (ctx)->gl_charset_size = (size);\ (ctx)->gl_octets_per_char = (octets) #define _SetGR(ctx, charset, size, octets)\ (ctx)->flags.gl = False;\ (ctx)->gr_charset = (charset);\ (ctx)->gr_charset_size = (size);\ (ctx)->gr_octets_per_char = (octets) #define _PushDir(ctx, dir)\ if ( (ctx)->dirsp == ((ctx)->dirstacksize - 1) ) {\ (ctx)->dirstacksize += 8;\ (ctx)->dirstack = \ (ct_Direction *)XtRealloc((char *)(ctx)->dirstack,\ (ctx)->dirstacksize * sizeof(ct_Direction));\ }\ (ctx)->dirstack[++((ctx)->dirsp)] = dir;\ (ctx)->flags.dircs = True #define _PopDir(ctx) ((ctx)->dirsp)-- #define _CurDir(ctx) (ctx)->dirstack[(ctx)->dirsp] /* this should probably be the other way around, (XmFONTLIST_DEFAULT_TAG map to _MOTIF_DEFAULT_LOCALE) but this is the smallest code change, and the code will not work any differently */ /* Define the MIT registered charset */ static SegmentEncoding _mit_ISO_IR_1111_registry = { "ISO-IR-111", "ISO-IR-111", NULL}; static SegmentEncoding _mit_UTF_8_registry = { "UTF-8", "UTF-8", &_mit_ISO_IR_1111_registry}; static SegmentEncoding _mit_KSC5601_1987_1_registry = { "KSC5601.1987-1", "KSC5601.1987-1", &_mit_UTF_8_registry}; static SegmentEncoding _mit_KSC5601_1987_0_registry = { "KSC5601.1987-0", "KSC5601.1987-0", &_mit_KSC5601_1987_1_registry}; static SegmentEncoding _mit_JISX0208_1983_1_registry = { "JISX0208.1983-1", "JISX0208.1983-1", &_mit_KSC5601_1987_0_registry}; static SegmentEncoding _mit_JISX0208_1983_0_registry = { "JISX0208.1983-0", "JISX0208.1983-0", &_mit_JISX0208_1983_1_registry}; static SegmentEncoding _mit_GB2312_1980_1_registry = { "GB2312.1980-1", "GB2312.1980-1", &_mit_JISX0208_1983_0_registry}; static SegmentEncoding _mit_GB2312_1980_0_registry = { "GB2312.1980-0", "GB2312.1980-0", &_mit_GB2312_1980_1_registry}; static SegmentEncoding _mit_JISX0201_1976_0_registry = { "JISX0201.1976-0", "JISX0201.1976-0", &_mit_GB2312_1980_0_registry}; static SegmentEncoding _mit_ISO8859_9_registry = { "ISO8859-9", "ISO8859-9", &_mit_JISX0201_1976_0_registry}; static SegmentEncoding _mit_ISO8859_8_registry = { "ISO8859-8", "ISO8859-8", &_mit_ISO8859_9_registry}; static SegmentEncoding _mit_ISO8859_7_registry = { "ISO8859-7", "ISO8859-7", &_mit_ISO8859_8_registry}; static SegmentEncoding _mit_ISO8859_6_registry = { "ISO8859-6", "ISO8859-6", &_mit_ISO8859_7_registry}; static SegmentEncoding _mit_ISO8859_5_registry = { "ISO8859-5", "ISO8859-5", &_mit_ISO8859_6_registry}; static SegmentEncoding _mit_ISO8859_4_registry = { "ISO8859-4", "ISO8859-4", &_mit_ISO8859_5_registry}; static SegmentEncoding _mit_ISO8859_3_registry = { "ISO8859-3", "ISO8859-3", &_mit_ISO8859_4_registry}; static SegmentEncoding _mit_ISO8859_2_registry = { "ISO8859-2", "ISO8859-2", &_mit_ISO8859_3_registry}; static SegmentEncoding _mit_ISO8859_1_registry = { "ISO8859-1", "ISO8859-1", &_mit_ISO8859_2_registry}; static SegmentEncoding _loc_encoding_registry = { _MOTIF_DEFAULT_LOCALE, XmFONTLIST_DEFAULT_TAG, &_mit_ISO8859_1_registry}; static SegmentEncoding _encoding_registry = { XmFONTLIST_DEFAULT_TAG, XmFONTLIST_DEFAULT_TAG, &_loc_encoding_registry}; static SegmentEncoding *_encoding_registry_ptr = &_encoding_registry; /******** Static Function Declarations ********/ static SegmentEncoding * FindEncoding( char *fontlist_tag) ; static Boolean processCharsetAndText(XmStringCharSet tag, OctetPtr ctext, #if NeedWidePrototypes int separator, #else Boolean separator, #endif /* NeedWidePrototypes */ OctetPtr *outc, unsigned int *outlen, ct_Charset *prev); #ifdef UTF8_SUPPORTED static Boolean processCharsetAndTextUtf8(XmStringCharSet tag, OctetPtr ctext, #if NeedWidePrototypes int separator, #else Boolean separator, #endif /* NeedWidePrototypes */ OctetPtr *outc, unsigned int *outlen, ct_Charset *prev); #endif static Boolean processESCHack( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean processExtendedSegmentsHack( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean cvtTextToXmString( XrmValue *from, XrmValue *to) ; static void outputXmString( ct_context *ctx, #if NeedWidePrototypes int separator) ; #else Boolean separator) ; #endif /* NeedWidePrototypes */ static XmString concatStringToXmString( XmString compoundstring, char *textstring, int textlen, char *charset, #if NeedWidePrototypes int direction, int separator) ; #else XmStringDirection direction, Boolean separator) ; #endif /* NeedWidePrototypes */ static Boolean processESC( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean processCSI( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean processExtendedSegments( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean process94n( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean process94GL( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean process94GR( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean process96GR( ct_context *ctx, #if NeedWidePrototypes int final) ; #else Octet final) ; #endif /* NeedWidePrototypes */ static Boolean cvtXmStringToText( XrmValue *from, XrmValue *to) ; static OctetPtr ctextConcat( OctetPtr str1, unsigned int str1len, const_OctetPtr str2, unsigned int str2len) ; #ifdef UTF8_SUPPORTED static Boolean cvtXmStringToUTF8String( XrmValue *from, XrmValue *to ) ; static char* Convert( const char *str, unsigned int len, const char *to_codeset, const char *from_codeset); static char* ConvertWithIconv( const char *str, unsigned int len, iconv_t converter); #endif /******** End Static Function Declarations ********/ /************************************************************************ * * FindEncoding * Find the SegmentEncoding with fontlist_tag. Return NULL if no * such SegmentEncoding exists. As a side effect, free any encodings * encountered that have been unregistered. * ************************************************************************/ static SegmentEncoding * FindEncoding(char *fontlist_tag) { SegmentEncoding *prevPtr, *encodingPtr = _encoding_registry_ptr; String encoding = NULL; if (encodingPtr) { if (strcmp(fontlist_tag, EncodingRegistryTag(encodingPtr)) == 0) { encoding = EncodingRegistryEncoding(encodingPtr); /* Free unregistered encodings. */ if (encoding == NULL) { _encoding_registry_ptr = EncodingRegistryNext(encodingPtr); XtFree( (char *) encodingPtr); encodingPtr = NULL; } return(encodingPtr); } } else return(encodingPtr); for (prevPtr = encodingPtr, encodingPtr = EncodingRegistryNext(encodingPtr); encodingPtr != NULL; prevPtr = encodingPtr, encodingPtr = EncodingRegistryNext(encodingPtr)) { if (strcmp(fontlist_tag, EncodingRegistryTag(encodingPtr)) == 0) { encoding = EncodingRegistryEncoding(encodingPtr); /* Free unregistered encodings. */ if (encoding == NULL) { EncodingRegistryNext(prevPtr) = EncodingRegistryNext(encodingPtr); XtFree( (char *) encodingPtr); encodingPtr = NULL; } return(encodingPtr); } /* Free unregistered encodings. */ else if (EncodingRegistryEncoding(encodingPtr) == NULL) { EncodingRegistryNext(prevPtr) = EncodingRegistryNext(encodingPtr); XtFree( (char *) encodingPtr); } } return(NULL); } /************************************************************************ * * XmRegisterSegmentEncoding * Register a compound text encoding format for a specified font list * element tag. Returns NULL for a new tag or a copy of the old encoding * for an already registered tag. * ************************************************************************/ char * XmRegisterSegmentEncoding( char *fontlist_tag, char *ct_encoding) { SegmentEncoding *encodingPtr = NULL; String ret_val = NULL; _XmProcessLock(); encodingPtr = FindEncoding(fontlist_tag); if (encodingPtr) { ret_val = XtNewString(EncodingRegistryEncoding(encodingPtr)); EncodingRegistryEncoding(encodingPtr) = ct_encoding ? XtNewString(ct_encoding) : (String)NULL; } else if (ct_encoding != NULL) { encodingPtr = (SegmentEncoding *)XtMalloc((Cardinal)sizeof(SegmentEncoding)); EncodingRegistryTag(encodingPtr) = XtNewString(fontlist_tag); EncodingRegistryEncoding(encodingPtr) = XtNewString(ct_encoding); EncodingRegistryNext(encodingPtr) = _encoding_registry_ptr; _encoding_registry_ptr = encodingPtr; } _XmProcessUnlock(); return(ret_val); } /************************************************************************ * * _XmGetEncodingRegistryTarget returns the current encoding registry * as a list of NULL separated items. The length is returned through * the passed length pointer. * ************************************************************************/ XtPointer _XmGetEncodingRegistryTarget(int *length) { int i, count, total_size; SegmentEncoding *current; char *rval; total_size = 0; _XmProcessLock(); current = _encoding_registry_ptr; while(current != NULL) { total_size += strlen(EncodingRegistryTag(current)) + strlen(EncodingRegistryEncoding(current)) + 2; current = EncodingRegistryNext(current); } *length = total_size; /* Create output buffer large enough for all the pairs of tags and encodings */ rval = XtMalloc(sizeof(char) * total_size); i = 0; current = _encoding_registry_ptr; while(current != NULL) { count = strlen(EncodingRegistryTag(current)); strcpy(&rval[i], EncodingRegistryTag(current)); i += count; rval[i] = 0; i++; count = strlen(EncodingRegistryEncoding(current)); strcpy(&rval[i], EncodingRegistryEncoding(current)); i += count; rval[i] = 0; i++; current = EncodingRegistryNext(current); } _XmProcessUnlock(); return((XtPointer) rval); } /************************************************************************ * * XmMapSegmentEncoding * Returns the compound text encoding format associated with the * specified font list element tag. Returns NULL if not found. * ************************************************************************/ char * XmMapSegmentEncoding(char *fontlist_tag) { SegmentEncoding *encodingPtr = NULL; String ret_val = NULL; _XmProcessLock(); encodingPtr = FindEncoding(fontlist_tag); if (encodingPtr) ret_val = XtNewString(EncodingRegistryEncoding(encodingPtr)); _XmProcessUnlock(); return(ret_val); } /************************************************************************ * * XmCvtCTToXmString * Convert a compound text string to a XmString. This is the public * version which takes only a compound text string as an argument. * Note: processESC and processExtendedSegments have to be hacked * for this to work. * ************************************************************************/ XmString XmCvtCTToXmString( char *text ) { ct_context *ctx; /* compound text context block */ Boolean ok = True; Octet c; XmString xmsReturned; /* returned Xm string */ ctx = (ct_context *) XtMalloc(sizeof(ct_context)); /* initialize the context block */ ctx->octet = (OctetPtr)text; ctx->flags.dircs = False; ctx->flags.gchar = False; ctx->flags.ignext = False; ctx->flags.gl = False; ctx->flags.text = False; ctx->dirstacksize = 8; ctx->dirstack = (ct_Direction *) XtMalloc(ctx->dirstacksize*sizeof(ct_Direction)); /* * Define XLIB_HANDLES_DIRECTION if vendor's X library knows how * to deal with direction control sequences in CT. Otherwise * no such ones will be output if there are no Rtol segments * in the XmString. Note that the MIT sample implementation * does not deal with direction control sequences... */ #ifdef XLIB_HANDLES_DIRECTION ctx->dirstack[0] = ct_Dir_StackEmpty; ctx->dirsp = 0; #else ctx->dirstack[0] = ct_Dir_StackEmpty; ctx->dirstack[1] = ct_Dir_LeftToRight; ctx->dirsp = 1; #endif ctx->encoding = NULL; ctx->encodinglen = 0; ctx->item = NULL; ctx->itemlen = 0; ctx->version = CTVERSION; ctx->gl_charset = CS_ISO8859_1; ctx->gl_charset_size = 94; ctx->gl_octets_per_char = 1; ctx->gr_charset = CS_ISO8859_1; ctx->gr_charset_size = 96; ctx->gr_octets_per_char = 1; ctx->xmstring = NULL; ctx->xmsep = NULL; ctx->xmtab = NULL; /* ** check for version/ignore extensions sequence (must be first if present) ** Format is: ESC 02/03 V 03/00 ignoring extensions is OK ** ESC 02/03 V 03/01 ignoring extensions is not OK ** where V is in the range 02/00 thru 02/15 and represents versions 1 thru 16 */ if ( (ctx->octet[0] == ESC) && (ctx->octet[1] == 0x23) && (_IsInColumn2(ctx->octet[2]) && ((ctx->octet[3] == 0x30) || ctx->octet[3] == 0x31)) ) { ctx->version = ctx->octet[2] - 0x1f; /* 0x20-0x2f => version 1-16 */ if (ctx->octet[3] == 0x30) /* 0x30 == can ignore extensions */ ctx->flags.ignext = True; ctx->octet += 4; /* advance ptr to next seq */ } while (ctx->octet[0] != 0) { switch (*ctx->octet) { /* look at next octet in seq */ case ESC: /* %%% TEMP ** if we have any text to output, do it ** this section needs to be optimized so that it handles ** paired character sets without outputting a new segment. */ if (ctx->flags.text) { outputXmString(ctx, False); /* with no separator */ } ctx->flags.text = False; ctx->item = ctx->octet; /* remember start of this item */ ctx->itemlen = 0; ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ /* scan for final char */ while ( (ctx->octet[0] != 0) && (_IsInColumn2(*ctx->octet)) ) { ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ } if (ctx->octet[0] == 0) { /* if nothing after this, it's an error */ ok = False; break; } c = *ctx->octet; /* get next char in seq */ ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ if (_IsValidESCFinal(c)) { /* we have a valid ESC sequence - handle it */ ok = processESCHack(ctx, c); } else { ok = False; } if (ok) { ctx->encoding = ctx->item; ctx->encodinglen = ctx->itemlen; } break; case CSI: /* ** CSI format is: CSI P I F where ** 03/00 <= P <= 03/15 ** 02/00 <= I <= 02/15 ** 04/00 <= F <= 07/14 */ /* %%% TEMP ** if we have any text to output, do it ** This may need optimization. */ if (ctx->flags.text) { /* check whether we have a specific direction set */ if (((ctx->octet[1] == 0x31) && (ctx->octet[2] == 0x5d))|| ((ctx->octet[1] == 0x32) && (ctx->octet[2] == 0x5d))|| (ctx->octet[1] == 0x5d)) outputXmString(ctx, False); /* without a separator*/ else outputXmString(ctx, True); /* with a separator */ } ctx->flags.text = False; ctx->item = ctx->octet; /* remember start of this item */ ctx->itemlen = 0; ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ /* scan for final char */ while ( (ctx->octet[0] != 0) && _IsInColumn3(*ctx->octet) ) { ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ } while ( (ctx->octet[0] != 0) && _IsInColumn2(*ctx->octet) ) { ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ } /* if nothing after this, it's an error */ if (ctx->octet[0] == 0) { ok = False; break; } c = *ctx->octet; /* get next char in seq */ ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ if (_IsValidCSIFinal(c)) { /* we have a valid CSI sequence - handle it */ ok = processCSI(ctx, c); } else { ok = False; } break; case NL: /* new line */ /* if we have any text to output, do it */ if (ctx->flags.text) { outputXmString(ctx, True); /* with a separator */ ctx->flags.text = False; } else { if (ctx->xmsep == NULL) { ctx->xmsep = XmStringSeparatorCreate(); } ctx->xmstring = XmStringConcatAndFree(ctx->xmstring, XmStringCopy(ctx->xmsep)); } ctx->octet++; /* advance ptr to next char */ break; case HT: /* if we have any text to output, do it */ if (ctx->flags.text) { outputXmString(ctx, False); ctx->flags.text = False; } if (ctx->xmtab == NULL) { ctx->xmtab = XmStringComponentCreate(XmSTRING_COMPONENT_TAB, 0, NULL); } ctx->xmstring = XmStringConcatAndFree(ctx->xmstring, XmStringCopy(ctx->xmtab)); ctx->octet++; /* advance ptr to next char */ break; default: /* just 'normal' text */ ctx->item = ctx->octet; /* remember start of this item */ ctx->itemlen = 0; ctx->flags.text = True; while (ctx->octet[0] != 0) { c = *ctx->octet; if ((c == ESC) || (c == CSI) || (c == NL) || (c == HT)) { break; } if ( (_IsInC0Set(c) && (!_IsValidC0(ctx, c))) || (_IsInC1Set(c) && (!_IsValidC1(ctx, c))) ) { ok = False; break; } ctx->flags.gchar = True; /* We have a character! */ /* * We should look at the actual character to * decide whether it's a gl or gr character. * * We'll hit the problem if we get a CT that * isn't generated by Motif. */ if (isascii((unsigned char)c)) { ctx->itemlen += ctx->gl_octets_per_char; ctx->octet += ctx->gl_octets_per_char; } else { ctx->octet += ctx->gr_octets_per_char; ctx->itemlen += ctx->gr_octets_per_char; } } /* end while */ break; } /* end switch */ if (!ok) break; } /* end while */ /* if we have any text left to output, do it */ if (ctx->flags.text) { outputXmString(ctx, False); /* with no separator */ } XtFree((char *) ctx->dirstack); if (ctx->xmsep != NULL) XmStringFree(ctx->xmsep); if (ctx->xmtab != NULL) XmStringFree(ctx->xmtab); xmsReturned = (XmString)ctx->xmstring; XtFree((char *) ctx); if (ok) return ( xmsReturned ); else return ( (XmString)NULL ); } /*********************************************************************** * * Hacked procedures to work with XmCvtCTToXmString. * ***********************************************************************/ /* processESCHack - handle valid ESC sequences */ static Boolean processESCHack( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { Boolean ok; switch (ctx->item[1]) { case 0x24: /* 02/04 - invoke 94(n) charset into GL or GR */ ok = process94n(ctx, final); break; case 0x25: /* 02/05 - extended segments */ /* if we have any text to output, do it */ if (ctx->flags.text) { outputXmString(ctx, False); /* with no separator */ ctx->flags.text = False; } ok = processExtendedSegmentsHack(ctx, final); break; case 0x28: /* 02/08 - invoke 94 charset into GL */ ok = process94GL(ctx, final); break; case 0x29: /* 02/09 - invoke 94 charset into GR */ ok = process94GR(ctx, final); break; case 0x2d: /* 02/13 - invoke 96 charset into GR */ ok = process96GR(ctx, final); break; default: ok = False; break; } return(ok); } static Boolean processExtendedSegmentsHack( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { OctetPtr esptr; /* ptr into ext seg */ unsigned int seglen; /* length of ext seg */ unsigned int len; /* length */ String charset_copy; /* ptr to NULL-terminated copy of ext seg charset */ OctetPtr text_copy; /* ptr to NULL-terminated copy of ext seg text */ XmString tempxm1; Boolean ok = True; /* Extended segments ** 01/11 02/05 02/15 03/00 M L variable # of octets/char ** 01/11 02/05 02/15 03/01 M L 1 octet/char ** 01/11 02/05 02/15 03/02 M L 2 octets/char ** 01/11 02/05 02/15 03/03 M L 3 octets/char ** 01/11 02/05 02/15 03/04 M L 4 octets/char */ if ( (ctx->itemlen == 4) && (ctx->item[2] == 0x2f) && (_IsInColumn3(final)) ) { if ( (ctx->octet[0] < 0x80) || (ctx->octet[1] < 0x80) ) { return(False); } /* ** The most significant bit of M and L are always set to 1 ** The number is computed as ((M-128)*128)+(L-128) */ seglen = *ctx->octet - 0x80; ctx->octet++; ctx->itemlen++; /* advance pointer */ seglen = (seglen << 7) + (*ctx->octet - 0x80); ctx->octet++; ctx->itemlen++; /* advance pointer */ /* Check for premature end. */ for (esptr = ctx->octet; esptr < (ctx->octet + seglen); esptr++) { if (*esptr == 0) { return(False); } } esptr = ctx->octet; /* point to charset */ ctx->itemlen += seglen; /* advance pointer over segment */ ctx->octet += seglen; switch (final) { case 0x30: /* variable # of octets per char */ case 0x31: /* 1 octet per char */ case 0x32: /* 2 octets per char */ /* scan for STX separator between charset and text */ len = 0; while (esptr[len] != STX) len++; if (len > ctx->itemlen) { /* if we ran off the end, error */ ok = False; break; } charset_copy = XtMalloc(len + 1); strncpy(charset_copy, (char *) esptr, len); charset_copy[len] = EOS; esptr += len + 1; /* point to text part */ len = seglen - len - 1; /* calc length of text part */ /* For two-octets charsets, make sure the text * contains an integral number of characters. */ if (final == 0x32 && len % 2) { XtFree(charset_copy); return (False); } text_copy = (unsigned char *) XtMalloc(len + 1); memcpy( text_copy, esptr, len); text_copy[len] = EOS; tempxm1 = XmStringConcatAndFree( XmStringDirectionCreate((_CurDir(ctx) == ct_Dir_LeftToRight ? XmSTRING_DIRECTION_L_TO_R : (_CurDir(ctx) == ct_Dir_RightToLeft ? XmSTRING_DIRECTION_R_TO_L : XmSTRING_DIRECTION_UNSET))), XmStringCreate((char *)text_copy, charset_copy)); ctx->xmstring = XmStringConcatAndFree(ctx->xmstring, tempxm1); XtFree((char *) text_copy); XtFree((char *) charset_copy); ok = True; break; case 0x33: /* 3 octets per char */ case 0x34: /* 4 octets per char */ /* not supported */ ok = False; break; default: /* reserved for future use */ ok = False; break; } /* end switch */ } /* end if */ return(ok); } /************************************************************************ * * XmCvtTextToXmString * Convert a compound text string to a XmString. * ************************************************************************/ /*ARGSUSED*/ Boolean XmCvtTextToXmString( Display *display, XrmValuePtr args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data ) /* unused */ { Boolean ok; if (from_val->addr == NULL) return( FALSE); ok = cvtTextToXmString(from_val, to_val); if (!ok) { to_val->addr = NULL; to_val->size = 0; XtAppWarningMsg(XtDisplayToApplicationContext(display), "conversionError","compoundText", "XtToolkitError", MSG13, (String *)NULL, (Cardinal *)NULL); } return(ok); } static Boolean cvtTextToXmString( XrmValue *from, XrmValue *to ) { ct_context *ctx; /* compound text context block */ Boolean ok = True; Octet c; ctx = (ct_context *) XtMalloc(sizeof(ct_context)); /* initialize the context block */ ctx->octet = (OctetPtr)from->addr; ctx->lastoctet = ctx->octet + from->size; ctx->flags.dircs = False; ctx->flags.gchar = False; ctx->flags.ignext = False; ctx->flags.gl = False; ctx->flags.text = False; ctx->dirstacksize = 8; ctx->dirstack = (ct_Direction *) XtMalloc(ctx->dirstacksize*sizeof(ct_Direction)); /* * Define XLIB_HANDLES_DIRECTION if vendor's X library knows how * to deal with direction control sequences in CT. Otherwise * no such ones will be output if there are no Rtol segments * in the XmString. Note that the MIT sample implementation * does not deal with direction control sequences... */ #ifdef XLIB_HANDLES_DIRECTION ctx->dirstack[0] = ct_Dir_StackEmpty; ctx->dirsp = 0; #else ctx->dirstack[0] = ct_Dir_StackEmpty; ctx->dirstack[1] = ct_Dir_LeftToRight; ctx->dirsp = 1; #endif ctx->encoding = NULL; ctx->encodinglen = 0; ctx->item = NULL; ctx->itemlen = 0; ctx->version = CTVERSION; ctx->gl_charset = CS_ISO8859_1; ctx->gl_charset_size = 94; ctx->gl_octets_per_char = 1; ctx->gr_charset = CS_ISO8859_1; ctx->gr_charset_size = 96; ctx->gr_octets_per_char = 1; ctx->xmstring = NULL; ctx->xmsep = NULL; ctx->xmtab = NULL; /* ** check for version/ignore extensions sequence (must be first if present) ** Format is: ESC 02/03 V 03/00 ignoring extensions is OK ** ESC 02/03 V 03/01 ignoring extensions is not OK ** where V is in the range 02/00 thru 02/15 and represents versions 1 thru 16 */ if ( (from->size >= 4) && (ctx->octet[0] == ESC) && (ctx->octet[1] == 0x23) && (_IsInColumn2(ctx->octet[2]) && ((ctx->octet[3] == 0x30) || ctx->octet[3] == 0x31)) ) { ctx->version = ctx->octet[2] - 0x1f; /* 0x20-0x2f => version 1-16 */ if (ctx->octet[3] == 0x30) /* 0x30 == can ignore extensions */ ctx->flags.ignext = True; ctx->octet += 4; /* advance ptr to next seq */ } while (ctx->octet < ctx->lastoctet) { switch (*ctx->octet) { /* look at next octet in seq */ case ESC: /* %%% TEMP ** if we have any text to output, do it ** this section needs to be optimized so that it handles ** paired character sets without outputting a new segment. */ if (ctx->flags.text) { outputXmString(ctx, False); /* with no separator */ } ctx->flags.text = False; ctx->item = ctx->octet; /* remember start of this item */ ctx->itemlen = 0; ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ /* scan for final char */ while ( (ctx->octet != ctx->lastoctet) && (_IsInColumn2(*ctx->octet)) ) { ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ } if (ctx->octet == ctx->lastoctet) { /* if nothing after this, it's an error */ ok = False; break; } c = *ctx->octet; /* get next char in seq */ ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ if (_IsValidESCFinal(c)) { /* we have a valid ESC sequence - handle it */ ok = processESC(ctx, c); } else { ok = False; } if (ok) { ctx->encoding = ctx->item; ctx->encodinglen = ctx->itemlen; } break; case CSI: /* ** CSI format is: CSI P I F where ** 03/00 <= P <= 03/15 ** 02/00 <= I <= 02/15 ** 04/00 <= F <= 07/14 */ /* %%% TEMP ** if we have any text to output, do it ** This may need optimization. */ if (ctx->flags.text) { /* check whether we have a specific direction set */ if (((ctx->octet[1] == 0x31) && (ctx->octet[2] == 0x5d))|| ((ctx->octet[1] == 0x32) && (ctx->octet[2] == 0x5d))|| (ctx->octet[1] == 0x5d)) outputXmString(ctx, False); /* without a separator*/ else outputXmString(ctx, True); /* with a separator */ } ctx->flags.text = False; ctx->item = ctx->octet; /* remember start of this item */ ctx->itemlen = 0; ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ /* scan for final char */ while ( (ctx->octet != ctx->lastoctet) && _IsInColumn3(*ctx->octet) ) { ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ } while ( (ctx->octet != ctx->lastoctet) && _IsInColumn2(*ctx->octet) ) { ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ } /* if nothing after this, it's an error */ if (ctx->octet == ctx->lastoctet) { ok = False; break; } c = *ctx->octet; /* get next char in seq */ ctx->octet++; ctx->itemlen++; /* advance ptr to next char */ if (_IsValidCSIFinal(c)) { /* we have a valid CSI sequence - handle it */ ok = processCSI(ctx, c); } else { ok = False; } break; case NL: /* new line */ /* if we have any text to output, do it */ if (ctx->flags.text) { outputXmString(ctx, True); /* with a separator */ ctx->flags.text = False; } else { if (ctx->xmsep == NULL) { ctx->xmsep = XmStringSeparatorCreate(); } ctx->xmstring = XmStringConcatAndFree(ctx->xmstring, XmStringCopy(ctx->xmsep)); } ctx->octet++; /* advance ptr to next char */ break; case HT: /* if we have any text to output, do it */ if (ctx->flags.text) { outputXmString(ctx, False); ctx->flags.text = False; } if (ctx->xmtab == NULL) { ctx->xmtab = XmStringComponentCreate(XmSTRING_COMPONENT_TAB, 0, NULL); } ctx->xmstring = XmStringConcatAndFree(ctx->xmstring, XmStringCopy(ctx->xmtab)); ctx->octet++; /* advance ptr to next char */ break; default: /* just 'normal' text */ ctx->item = ctx->octet; /* remember start of this item */ ctx->itemlen = 0; ctx->flags.text = True; while (ctx->octet < ctx->lastoctet) { c = *ctx->octet; if ((c == ESC) || (c == CSI) || (c == NL) || (c == HT)) { break; } if ( (_IsInC0Set(c) && (!_IsValidC0(ctx, c))) || (_IsInC1Set(c) && (!_IsValidC1(ctx, c))) ) { ok = False; break; } ctx->flags.gchar = True; /* We have a character! */ /* * We should look at the actual character to * decide whether it's a gl or gr character. * * We'll hit the problem if we get a CT that * isn't generated by Motif. */ if (isascii((unsigned char)c)) { ctx->octet += ctx->gl_octets_per_char; ctx->itemlen += ctx->gl_octets_per_char; } else { ctx->octet += ctx->gr_octets_per_char; ctx->itemlen += ctx->gr_octets_per_char; } if (ctx->octet > ctx->lastoctet) { ok = False; break; } } /* end while */ break; } /* end switch */ if (!ok) break; } /* end while */ /* if we have any text left to output, do it */ if (ctx->flags.text) { outputXmString(ctx, False); /* with no separator */ } XtFree((char *) ctx->dirstack); if (ctx->xmstring != NULL) { to->addr = (char *) ctx->xmstring; to->size = sizeof(XmString); } if (ctx->xmsep != NULL) XmStringFree(ctx->xmsep); if (ctx->xmtab != NULL) XmStringFree(ctx->xmtab); XtFree((char *) ctx); return (ok); } static char ** cvtCTsegment(ct_context *ctx, OctetPtr item, unsigned int length) { XTextProperty tmp_prop; OctetPtr octets; Boolean free_octets = False; int count; int ret_val; char **strings = NULL; if (ctx->encoding) { if (ctx->encoding + ctx->encodinglen != item) { octets = (OctetPtr)XtMalloc((ctx->encodinglen + length) * sizeof(Octet)); memcpy((char *)octets, (char *)ctx->encoding, ctx->encodinglen); memcpy((char *)(octets + ctx->encodinglen), (char *)item, length); free_octets = True; } else { octets = ctx->encoding; } } else { octets = ctx->item; } tmp_prop.value = octets; tmp_prop.encoding = XInternAtom(_XmGetDefaultDisplay(), XmSCOMPOUND_TEXT, False); tmp_prop.format = 8; tmp_prop.nitems = ctx->encodinglen + length; ret_val = XmbTextPropertyToTextList(_XmGetDefaultDisplay(), &tmp_prop, &strings, &count); if (ret_val > 0) { XFreeStringList(strings); strings = NULL; } if (free_octets) XtFree((char *)octets); return strings; } /* outputXmString */ static void outputXmString( ct_context *ctx, #if NeedWidePrototypes int separator ) #else Boolean separator ) #endif /* NeedWidePrototypes */ { char **strings = NULL; /* * CR # 8544: XmbTextListToTextProperty converts from locale encoding * to MIT registered encodings. We have to convert back - UNLESS the * CT was not created with XmbTextListToTextProperty. However, there * is no way to tell how we got the CT, but in most cases, the * tag will be FONTLIST_DEFAULT_TAG, and then we want to do this. So * we try this, and only use the encoding tags if we could not convert. */ strings = cvtCTsegment(ctx, ctx->item, ctx->itemlen); if (strings) { ctx->xmstring = concatStringToXmString (ctx->xmstring, strings[0], strlen(strings[0]), XmFONTLIST_DEFAULT_TAG, (XmStringDirection) ((_CurDir(ctx) == ct_Dir_LeftToRight) ? XmSTRING_DIRECTION_L_TO_R : ((_CurDir(ctx) == ct_Dir_RightToLeft) ? XmSTRING_DIRECTION_R_TO_L : XmSTRING_DIRECTION_UNSET)), separator ); XFreeStringList(strings); return; } /* If we couldn't convert to locale encoding... */ /* This is not really right. We can probably never draw this string and get something that looks right out of this */ /* * If the GL charset is ISO8859-1, and the GR charset is any ISO8859 * charset, then they're a pair, so we can create a single segment using * just the GR charset. * * If GL and GR are multibyte charsets and they match (both GB2312 or both * KSC5601) except for JISX0208, then we can create a single segment using * just the GR charset. If GL and GR are multibyte charsets and they DON'T * match, or if GL or GR is multibyte and the other is singlebyte, then * there's no way to tell which characters belong to GL and which to GR, * so treat it like a non-Latin1 in GL - 7 bit characters go to GL, 8 bit * characters to to GR. *** THIS APPEARS TO BE A HOLE IN THE COMPOUND * TEXT SPEC ***. * * Otherwise the charsets are not a pair and we will switch between GL * and GR segments each time the high bit changes. */ if (((ctx->gl_charset == CS_ISO8859_1) && ((ctx->gr_charset == CS_ISO8859_1) || (ctx->gr_charset == CS_ISO8859_2) || (ctx->gr_charset == CS_ISO8859_3) || (ctx->gr_charset == CS_ISO8859_4) || (ctx->gr_charset == CS_ISO8859_5) || (ctx->gr_charset == CS_ISO8859_6) || (ctx->gr_charset == CS_ISO8859_7) || (ctx->gr_charset == CS_ISO8859_8) || (ctx->gr_charset == CS_ISO8859_9))) || ((ctx->gl_charset == CS_GB2312_0) && (ctx->gr_charset == CS_GB2312_1)) || ((ctx->gl_charset == CS_KSC5601_0) && (ctx->gr_charset == CS_KSC5601_1))) { /* OK to do single segment output but always use GR charset */ ctx->xmstring = concatStringToXmString (ctx->xmstring, (char *) ctx->item, ctx->itemlen, (char *) ctx->gr_charset, (XmStringDirection) ((_CurDir(ctx) == ct_Dir_LeftToRight) ? XmSTRING_DIRECTION_L_TO_R : ((_CurDir(ctx) == ct_Dir_RightToLeft) ? XmSTRING_DIRECTION_R_TO_L : XmSTRING_DIRECTION_UNSET)), separator ); } else { /* have to create a new segment everytime the highbit changes */ unsigned int j = 0; unsigned int start = 0; Octet c; Boolean curseg_is_gl; curseg_is_gl = isascii((unsigned char)ctx->item[0]); while (j < ctx->itemlen) { c = ctx->item[j]; if (isascii((unsigned char)c)) { if (!curseg_is_gl) { /* output gr string */ assert(j > start); ctx->xmstring = concatStringToXmString (ctx->xmstring, (char *)ctx->item + start, j - start, (char *) ctx->gr_charset, (XmStringDirection) ((_CurDir(ctx) == ct_Dir_LeftToRight) ? XmSTRING_DIRECTION_L_TO_R : ((_CurDir(ctx) == ct_Dir_RightToLeft) ? XmSTRING_DIRECTION_R_TO_L : XmSTRING_DIRECTION_UNSET)), False ); start = j; curseg_is_gl = True; /* start gl segment */ }; j++; } else { if (curseg_is_gl) { /* output gl string */ assert(j > start); ctx->xmstring = concatStringToXmString (ctx->xmstring, (char *)ctx->item + start, j - start, (char *) ctx->gl_charset, (XmStringDirection) ((_CurDir(ctx) == ct_Dir_LeftToRight) ? XmSTRING_DIRECTION_L_TO_R : ((_CurDir(ctx) == ct_Dir_RightToLeft) ? XmSTRING_DIRECTION_R_TO_L : XmSTRING_DIRECTION_UNSET)), False ); start = j; curseg_is_gl = False; /* start gr segment */ }; j++; }; /* end if */ }; /* end while */ /* output last segment */ ctx->xmstring = concatStringToXmString (ctx->xmstring, (char *)ctx->item + start, ctx->itemlen - start, (char *) ((curseg_is_gl) ? ctx->gl_charset : ctx->gr_charset ), (XmStringDirection) ((_CurDir(ctx) == ct_Dir_LeftToRight) ? XmSTRING_DIRECTION_L_TO_R : ((_CurDir(ctx) == ct_Dir_RightToLeft) ? XmSTRING_DIRECTION_R_TO_L : XmSTRING_DIRECTION_UNSET)), False ); if (separator) { if (ctx->xmsep == NULL) { ctx->xmsep = XmStringSeparatorCreate(); }; ctx->xmstring = XmStringConcatAndFree(ctx->xmstring, XmStringCopy(ctx->xmsep)); }; }; /* end if paired */ } static XmString concatStringToXmString( XmString compoundstring, char *textstring, int textlen, char *charset, #if NeedWidePrototypes int direction, int separator ) #else XmStringDirection direction, Boolean separator ) #endif /* NeedWidePrototypes */ { XmString tempxm1; tempxm1 = XmStringConcatAndFree(XmStringDirectionCreate(direction), _XmStringNCreate(textstring, charset, textlen)); if (separator) tempxm1 = XmStringConcatAndFree(tempxm1, XmStringSeparatorCreate()); compoundstring = XmStringConcatAndFree(compoundstring, tempxm1); return (compoundstring); } /* processESC - handle valid ESC sequences */ static Boolean processESC( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { Boolean ok; switch (ctx->item[1]) { case 0x24: /* 02/04 - invoke 94(n) charset into GL or GR */ ok = process94n(ctx, final); break; case 0x25: /* 02/05 - extended segments */ /* if we have any text to output, do it */ if (ctx->flags.text) { outputXmString(ctx, False); /* with no separator */ ctx->flags.text = False; } ok = processExtendedSegments(ctx, final); break; case 0x28: /* 02/08 - invoke 94 charset into GL */ ok = process94GL(ctx, final); break; case 0x29: /* 02/09 - invoke 94 charset into GR */ ok = process94GR(ctx, final); break; case 0x2d: /* 02/13 - invoke 96 charset into GR */ ok = process96GR(ctx, final); break; default: ok = False; break; } return(ok); } /* ** processCSI - handle valid CSI sequences ** CSI sequences ** 09/11 03/01 05/13 begin left-to-right text ** 09/11 03/02 05/13 begin right-to-left text ** 09/11 05/13 end of string ** 09/11 P I F reserved for use in future extensions */ static Boolean processCSI( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { Boolean ok = True; switch (final) { case 0x5d: /* end of direction sequence */ switch (ctx->item[1]) { case 0x31: /* start left to right */ if (ctx->flags.gchar && ctx->dirsp == 0) { ok = False; } else { _PushDir(ctx, ct_Dir_LeftToRight); } break; case 0x32: /* start right to left */ if (ctx->flags.gchar && ctx->dirsp == 0) { ok = False; } else { _PushDir(ctx, ct_Dir_RightToLeft); } break; case 0x5d: /* Just CSI EOS - revert */ if (ctx->dirsp > 0) { _PopDir(ctx); } else { ok = False; } break; default: /* anything else is an error */ ok = False; } break; default: /* reserved for future extensions */ ok = False; break; } return(ok); } static Boolean processExtendedSegments( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { OctetPtr esptr; /* ptr into ext seg */ unsigned int seglen; /* length of ext seg */ unsigned int len; /* length */ String charset_copy; /* ptr to NULL-terminated copy of ext seg charset */ OctetPtr text_copy; /* ptr to NULL-terminated copy of ext seg text */ XmString tempxm1; Boolean ok = True; /* Extended segments ** 01/11 02/05 02/15 03/00 M L variable # of octets/char ** 01/11 02/05 02/15 03/01 M L 1 octet/char ** 01/11 02/05 02/15 03/02 M L 2 octets/char ** 01/11 02/05 02/15 03/03 M L 3 octets/char ** 01/11 02/05 02/15 03/04 M L 4 octets/char */ if ( (ctx->itemlen == 4) && (ctx->item[2] == 0x2f) && (_IsInColumn3(final)) ) { if ( ((ctx->lastoctet - ctx->octet) < 2) || (ctx->octet[0] < 0x80) || (ctx->octet[1] < 0x80) ) { return(False); } /* ** The most significant bit of M and L are always set to 1 ** The number is computed as ((M-128)*128)+(L-128) */ seglen = *ctx->octet - 0x80; ctx->octet++; ctx->itemlen++; /* advance pointer */ seglen = (seglen << 7) + (*ctx->octet - 0x80); ctx->octet++; ctx->itemlen++; /* advance pointer */ if ((ctx->lastoctet - ctx->octet) < seglen) { return(False); } esptr = ctx->octet; /* point to charset */ ctx->itemlen += seglen; /* advance pointer over segment */ ctx->octet += seglen; switch (final) { case 0x30: /* variable # of octets per char */ case 0x31: /* 1 octet per char */ case 0x32: /* 2 octets per char */ /* scan for STX separator between charset and text */ len = 0; while (esptr[len] != STX) len++; if (len > ctx->itemlen) { /* if we ran off the end, error */ ok = False; break; } charset_copy = XtMalloc(len + 1); strncpy(charset_copy, (char *) esptr, len); charset_copy[len] = EOS; esptr += len + 1; /* point to text part */ len = seglen - len - 1; /* calc length of text part */ text_copy = (unsigned char *) XtMalloc(len + 1); memcpy( text_copy, esptr, len); text_copy[len] = EOS; tempxm1 = XmStringConcatAndFree( XmStringDirectionCreate((_CurDir(ctx) == ct_Dir_LeftToRight ? XmSTRING_DIRECTION_L_TO_R : (_CurDir(ctx) == ct_Dir_RightToLeft ? XmSTRING_DIRECTION_R_TO_L : XmSTRING_DIRECTION_UNSET))), XmStringCreate((char *)text_copy, charset_copy)); ctx->xmstring = XmStringConcatAndFree(ctx->xmstring, tempxm1); XtFree((char *) text_copy); XtFree(charset_copy); ok = True; break; case 0x33: /* 3 octets per char */ case 0x34: /* 4 octets per char */ /* not supported */ ok = False; break; default: /* reserved for future use */ ok = False; break; } /* end switch */ } /* end if */ return(ok); } static Boolean process94n( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { if (ctx->itemlen > 3) { switch (ctx->item[2]) { case 0x28: /* into GL */ switch (final) { case 0x41: /* 04/01 - China (PRC) Hanzi */ _SetGL(ctx, CS_GB2312_0, 94, 2); break; case 0x42: /* 04/02 - Japanese GCS, level 2 */ _SetGL(ctx, CS_JISX0208_0, 94, 2); break; case 0x43: /* 04/03 - Korean GCS */ _SetGL(ctx, CS_KSC5601_0, 94, 2); break; default: /* other character sets are not supported */ return False; } /* end switch (final) */ break; case 0x29: /* into GR */ switch (final) { case 0x41: /* 04/01 - China (PRC) Hanzi */ _SetGR(ctx, CS_GB2312_1, 94, 2); break; case 0x42: /* 04/02 - Japanese GCS, level 2 */ _SetGR(ctx, CS_JISX0208_1, 94, 2); break; case 0x43: /* 04/03 - Korean GCS */ _SetGR(ctx, CS_KSC5601_1, 94, 2); break; default: /* other character sets are not supported */ return False; } /* end switch (final) */ break; default: /* error */ return False; } /* end switch item[2] */ } else { /* error */ return False; } /* end if */ return True; } static Boolean process94GL( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { switch (final) { case 0x42: /* 04/02 - Left half, ISO8859* (ASCII) */ _SetGL(ctx, CS_ISO8859_1, 94, 1); break; case 0x4a: /* 04/10 - Left half, Katakana */ _SetGL(ctx, CS_JISX0201, 94, 1); break; default: return False; } return(True); } static Boolean process94GR( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { switch (final) { case 0x49: /* 04/09 - Right half, Katakana */ _SetGR(ctx, CS_JISX0201, 94, 1); break; default: return False; } return(True); } static Boolean process96GR( ct_context *ctx, #if NeedWidePrototypes int final ) #else Octet final ) #endif /* NeedWidePrototypes */ { switch (final) { case 0x40: /* 04/00 - Right half, IR-111 */ _SetGR(ctx, CS_ISO_IR_111, 96, 1); break; case 0x41: /* 04/01 - Right half, Latin 1 */ _SetGR(ctx, CS_ISO8859_1, 96, 1); break; case 0x42: /* 04/02 - Right half, Latin 2 */ _SetGR(ctx, CS_ISO8859_2, 96, 1); break; case 0x43: /* 04/03 - Right half, Latin 3 */ _SetGR(ctx, CS_ISO8859_3, 96, 1); break; case 0x44: /* 04/04 - Right half, Latin 4 */ _SetGR(ctx, CS_ISO8859_4, 96, 1); break; case 0x46: /* 04/06 - Right half, Latin/Greek */ _SetGR(ctx, CS_ISO8859_7, 96, 1); break; case 0x47: /* 04/07 - Right half, Latin/Arabic */ _SetGR(ctx, CS_ISO8859_6, 96, 1); break; case 0x48: /* 04/08 - Right half, Latin/Hebrew */ _SetGR(ctx, CS_ISO8859_8, 96, 1); break; case 0x4c: /* 04/12 - Right half, Latin/Cyrillic */ _SetGR(ctx, CS_ISO8859_5, 96, 1); break; case 0x4d: /* 04/13 - Right half, Latin 5 */ _SetGR(ctx, CS_ISO8859_9, 96, 1); break; default: return False; } return(True); } /************************************************************************ * * XmCvtXmStringToCT * Convert an XmString to a compound text string directly. * This is the public version of the resource converter and only * requires the XmString as an argument. * ************************************************************************/ char * XmCvtXmStringToCT( XmString string ) { Boolean ok; /* Dummy up some XrmValues to pass to cvtXmStringToText. */ XrmValue from_val; XrmValue to_val; if (string == NULL) return ( (char *) NULL ); from_val.addr = (char *) string; ok = cvtXmStringToText(&from_val, &to_val); if (!ok) { XtWarningMsg( "conversionError","compoundText", "XtToolkitError", MSG8, NULL, NULL) ; return( (char *) NULL ) ; } return( (char *) to_val.addr) ; } #ifdef UTF8_SUPPORTED /************************************************************************ * * XmCvtXmStringToUTF8String * Convert an XmString to a compound utf8 string directly. * This is the public version of the resource converter and only * requires the XmString as an argument. * ************************************************************************/ char * XmCvtXmStringToUTF8String( XmString string ) { Boolean ok; /* Dummy up some XrmValues to pass to cvtXmStringToText. */ XrmValue from_val; XrmValue to_val; if (string == NULL) return ( (char *) NULL ); from_val.addr = (char *) string; ok = cvtXmStringToUTF8String(&from_val, &to_val); if (!ok) { XtWarningMsg( "conversionError","compoundText", "XtToolkitError", MSG8, NULL, NULL) ; return( (char *) NULL ) ; } return( (char *) to_val.addr) ; } #endif /*************************************************************************** * * * _XmConvertCSToString - Converts compound string to corresponding * * STRING if it can be fully converted. Otherwise returns NULL. * * * ***************************************************************************/ /*ARGSUSED*/ char * _XmConvertCSToString(XmString cs) /* unused */ { return((char *)NULL); } /*************************************************************************** * * * _XmCvtXmStringToCT - public wrapper for the widgets to use. * * This returns the length info as well - critical for the list widget * * * ***************************************************************************/ Boolean _XmCvtXmStringToCT( XrmValue *from, XrmValue *to ) { return (cvtXmStringToText( from, to )); } #ifdef UTF8_SUPPORTED /*************************************************************************** * * * _XmCvtXmStringToUTF8String - public wrapper for the widgets to use. * * This returns the length info as well - critical for the list widget * * * ***************************************************************************/ Boolean _XmCvtXmStringToUTF8String( XrmValue *from, XrmValue *to ) { return (cvtXmStringToUTF8String( from, to )); } #endif /************************************************************************ * * XmCvtXmStringToText * Convert an XmString to an ASCII string. * ************************************************************************/ /*ARGSUSED*/ Boolean XmCvtXmStringToText( Display *display, XrmValuePtr args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from_val, XrmValue *to_val, XtPointer *converter_data ) /* unused */ { Boolean ok; if (from_val->addr == NULL) return( FALSE) ; ok = cvtXmStringToText(from_val, to_val); if (!ok) { XtAppWarningMsg(XtDisplayToApplicationContext(display), "conversionError","compoundText", "XtToolkitError", MSG14, (String *)NULL, (Cardinal *)NULL); } return(ok); } #ifdef UTF8_SUPPORTED /************************************************************************ * * cvtXmStringToUTF8String * Convert an XmString to a compound text string. This is the * underlying conversion routine for XmCvtXmStringToUTF8String, * _XmCvtXmStringToUTF8String. * ************************************************************************/ static Boolean cvtXmStringToUTF8String( XrmValue *from, XrmValue *to ) { Boolean ok; OctetPtr outc = NULL; unsigned int outlen = 0; _XmStringContextRec stack_context; XmStringCharSet ct_encoding = NULL, cset_save = NULL; ct_Direction prev_direction = ct_Dir_LeftToRight; ct_Charset prev_charset = cs_Latin1; XmStringComponentType comp; unsigned int len; XtPointer val = NULL; Octet tmp_buf[256]; OctetPtr tmp; /* Initialize the return parameters. */ to->addr = (XPointer) NULL; to->size = 0; if (!from->addr) return(False); _XmStringContextReInit(&stack_context, (XmString) from->addr); /* BEGIN OSF Fix CR 7403 */ while ((comp = XmeStringGetComponent(&stack_context, True, False, &len, &val)) != XmSTRING_COMPONENT_END) { switch (comp) { case XmSTRING_COMPONENT_LOCALE_TEXT: cset_save = XmFONTLIST_DEFAULT_TAG; /* Fall through */ case XmSTRING_COMPONENT_TEXT: if (cset_save != NULL) { /* Check Registry */ if (ct_encoding) XtFree((char *)ct_encoding); ct_encoding = XmMapSegmentEncoding(cset_save); } /* We must duplicate val because the routines we want to */ /* call don't take a length parameter. */ tmp = (OctetPtr) XmStackAlloc(len + 1, tmp_buf); memcpy((char*)tmp, val, len); tmp[len] = EOS; if (ct_encoding != NULL) { /* We have a mapping. */ ok = processCharsetAndTextUtf8(ct_encoding, tmp, FALSE, &outc, &outlen, &prev_charset); } else { /* No mapping. Vendor dependent. */ ok = processCharsetAndTextUtf8(cset_save, tmp, FALSE, &outc, &outlen, &prev_charset); } /* Free our local copy of val. */ XmStackFree((char*) tmp, tmp_buf); if (!ok) { _XmStringContextFree(&stack_context); return(False); } break; case XmSTRING_COMPONENT_CHARSET: cset_save = (XmStringCharSet)val; break; case XmSTRING_COMPONENT_DIRECTION: /* Output the direction, if changed */ if (*(XmStringDirection *)val == XmSTRING_DIRECTION_L_TO_R) { if (prev_direction != ct_Dir_LeftToRight) { outc = ctextConcat(outc, outlen, (unsigned char *) UTF8_L_TO_R, (unsigned int)UTF8_L_TO_R_LEN); outlen += UTF8_L_TO_R_LEN; prev_direction = ct_Dir_LeftToRight; } } else { if (prev_direction != ct_Dir_RightToLeft) { outc = ctextConcat(outc, outlen, (unsigned char *) UTF8_R_TO_L, (unsigned int)UTF8_R_TO_L_LEN); outlen += UTF8_R_TO_L_LEN; prev_direction = ct_Dir_RightToLeft; } }; break; case XmSTRING_COMPONENT_SEPARATOR: if (ct_encoding != NULL) { /* We have a mapping. */ ok = processCharsetAndTextUtf8(ct_encoding, NULL, TRUE, &outc, &outlen, &prev_charset); } else { /* No mapping. Vendor dependent. */ ok = processCharsetAndTextUtf8(cset_save, NULL, TRUE, &outc, &outlen, &prev_charset); } if (!ok) { _XmStringContextFree(&stack_context); return(False); } break; case XmSTRING_COMPONENT_TAB: outc = ctextConcat(outc, outlen, (unsigned char *)UTF8_TABSTRING, (unsigned int)UTF8_TABSTRING_LEN); outlen++; break; default: /* Just ignore it. */ break; } } /* end while */ if (ct_encoding) XtFree((char *)ct_encoding); /* END OSF Fix CR 7403 */ if (outc != NULL) { to->addr = (char *) outc; to->size = outlen; } _XmStringContextFree(&stack_context); return(True); } #endif /************************************************************************ * * cvtXmStringToText * Convert an XmString to a compound text string. This is the * underlying conversion routine for XmCvtXmStringToCT, * _XmCvtXmStringToCT, and XmCvtXmStringToText. * ************************************************************************/ static Boolean cvtXmStringToText( XrmValue *from, XrmValue *to ) { Boolean ok; OctetPtr outc = NULL; unsigned int outlen = 0; _XmStringContextRec stack_context; XmStringCharSet ct_encoding = NULL, cset_save = NULL; /* * Define XLIB_HANDLES_DIRECTION if vendor's X library knows how * to deal with direction control sequences in CT. Otherwise * no such beasts will be output if there are no Rtol segments * in the XmString. Note that the MIT sample implementation * does not deal with direction control sequences... */ #ifdef XLIB_HANDLES_DIRECTION ct_Direction prev_direction = ct_Dir_Undefined; #else ct_Direction prev_direction = ct_Dir_LeftToRight; #endif ct_Charset prev_charset = cs_Latin1; XmStringComponentType comp; unsigned int len; XtPointer val = NULL; Octet tmp_buf[256]; OctetPtr tmp; /* Initialize the return parameters. */ to->addr = (XPointer) NULL; to->size = 0; if (!from->addr) return(False); _XmStringContextReInit(&stack_context, (XmString) from->addr); /* BEGIN OSF Fix CR 7403 */ while ((comp = XmeStringGetComponent(&stack_context, True, False, &len, &val)) != XmSTRING_COMPONENT_END) { switch (comp) { case XmSTRING_COMPONENT_LOCALE_TEXT: cset_save = XmFONTLIST_DEFAULT_TAG; /* Fall through */ case XmSTRING_COMPONENT_TEXT: if (cset_save != NULL) { /* Check Registry */ if (ct_encoding) XtFree((char *)ct_encoding); ct_encoding = XmMapSegmentEncoding(cset_save); } /* We must duplicate val because the routines we want to */ /* call don't take a length parameter. */ tmp = (OctetPtr) XmStackAlloc(len + 1, tmp_buf); memcpy((char*)tmp, val, len); tmp[len] = EOS; if (ct_encoding != NULL) { /* We have a mapping. */ ok = processCharsetAndText(ct_encoding, tmp, FALSE, &outc, &outlen, &prev_charset); } else { /* No mapping. Vendor dependent. */ ok = _XmOSProcessUnmappedCharsetAndText(cset_save, tmp, FALSE, &outc, &outlen, &prev_charset); } /* Free our local copy of val. */ XmStackFree((char*) tmp, tmp_buf); if (!ok) { _XmStringContextFree(&stack_context); return(False); } break; case XmSTRING_COMPONENT_CHARSET: cset_save = (XmStringCharSet)val; break; case XmSTRING_COMPONENT_DIRECTION: /* Output the direction, if changed */ if (*(XmStringDirection *)val == XmSTRING_DIRECTION_L_TO_R) { if (prev_direction != ct_Dir_LeftToRight) { outc = ctextConcat(outc, outlen, (unsigned char *) CTEXT_L_TO_R, (unsigned int)CTEXT_L_TO_R_LEN); outlen += CTEXT_L_TO_R_LEN; prev_direction = ct_Dir_LeftToRight; } } else { if (prev_direction != ct_Dir_RightToLeft) { outc = ctextConcat(outc, outlen, (unsigned char *) CTEXT_R_TO_L, (unsigned int)CTEXT_R_TO_L_LEN); outlen += CTEXT_R_TO_L_LEN; prev_direction = ct_Dir_RightToLeft; } }; break; case XmSTRING_COMPONENT_SEPARATOR: if (ct_encoding != NULL) { /* We have a mapping. */ ok = processCharsetAndText(ct_encoding, NULL, TRUE, &outc, &outlen, &prev_charset); } else { /* No mapping. Vendor dependent. */ ok = _XmOSProcessUnmappedCharsetAndText(cset_save, NULL, TRUE, &outc, &outlen, &prev_charset); } if (!ok) { _XmStringContextFree(&stack_context); return(False); } break; case XmSTRING_COMPONENT_TAB: outc = ctextConcat(outc, outlen, (unsigned char *)TABSTRING, (unsigned int)TABSTRING_LEN); outlen++; break; default: /* Just ignore it. */ break; } } /* end while */ if (ct_encoding) XtFree((char *)ct_encoding); /* END OSF Fix CR 7403 */ if (outc != NULL) { to->addr = (char *) outc; to->size = outlen; } _XmStringContextFree(&stack_context); return(True); } #ifdef UTF8_SUPPORTED static Boolean processCharsetAndTextUtf8(XmStringCharSet tag, OctetPtr ctext, #if NeedWidePrototypes int separator, #else Boolean separator, #endif /* NeedWidePrototypes */ OctetPtr *outc, unsigned int *outlen, ct_Charset *prev) { unsigned int ctlen = 0, len; if (strcmp(tag, XmFONTLIST_DEFAULT_TAG) == 0) { if (_XmStringIsCurrentCharset("UTF-8")) { if (ctext) ctlen = strlen((char *)ctext); if (ctlen > 0) { *outc = ctextConcat(*outc, *outlen, ctext, ctlen); *outlen += ctlen; }; } else { XTextProperty prop_rtn; int ret_val; String msg; /* Call XmbTextListToTextProperty */ ret_val = XmbTextListToTextProperty(_XmGetDefaultDisplay(), (char **)&ctext, 1, XUTF8StringStyle, &prop_rtn); if (ret_val) { switch (ret_val) { case XNoMemory: msg = MSG9; break; case XLocaleNotSupported: msg = MSG10; break; default: msg = MSG11; break; } XtWarningMsg("conversionError", "textProperty", "XtToolkitError", msg, NULL, 0); return(False); } ctlen = strlen((char *)prop_rtn.value); /* Now copy in the text */ if (ctlen > 0) { *outc = ctextConcat(*outc, *outlen, prop_rtn.value, ctlen); *outlen += ctlen; }; XFree(prop_rtn.value); } /* Finally, add the separator if any */ if (separator) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)UTF8_NEWLINESTRING, (unsigned int)UTF8_NEWLINESTRING_LEN); (*outlen)++; }; *prev = cs_none; return(True); } if (ctext) ctlen = strlen((char *)ctext); /* Now copy in the text */ if (ctlen > 0) { char *text = Convert((char *)ctext, ctlen, "UTF-8", tag); if (text == NULL) return(False); *outc = ctextConcat(*outc, *outlen, (const_OctetPtr)text, strlen(text)); *outlen += ctlen; XtFree(text); }; /* Finally, add the separator if any */ if (separator) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)UTF8_NEWLINESTRING, (unsigned int)UTF8_NEWLINESTRING_LEN); (*outlen)++; } return(True); } #endif static Boolean processCharsetAndText(XmStringCharSet tag, OctetPtr ctext, #if NeedWidePrototypes int separator, #else Boolean separator, #endif /* NeedWidePrototypes */ OctetPtr *outc, unsigned int *outlen, ct_Charset *prev) { unsigned int ctlen = 0, len; if (strcmp(tag, CS_UTF_8) == 0) tag = XmFONTLIST_DEFAULT_TAG; if (strcmp(tag, XmFONTLIST_DEFAULT_TAG) == 0) { XTextProperty prop_rtn; int ret_val; String msg; /* Call XmbTextListToTextProperty */ ret_val = XmbTextListToTextProperty(_XmGetDefaultDisplay(), (char **)&ctext, 1, XCompoundTextStyle, &prop_rtn); if (ret_val) { switch (ret_val) { case XNoMemory: msg = MSG9; break; case XLocaleNotSupported: msg = MSG10; break; default: msg = MSG11; break; } XtWarningMsg("conversionError", "textProperty", "XtToolkitError", msg, NULL, 0); return(False); } /* Now copy in the text */ if (prop_rtn.value) { ctlen = strlen((char *)prop_rtn.value); *outc = ctextConcat(*outc, *outlen, prop_rtn.value, ctlen); *outlen += ctlen; }; XFree(prop_rtn.value); /* Finally, add the separator if any */ if (separator) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)NEWLINESTRING, (unsigned int)NEWLINESTRING_LEN); (*outlen)++; }; *prev = cs_none; return(True); } if (ctext) ctlen = strlen((char *)ctext); /* Next output the charset */ if (strcmp(tag, CS_ISO8859_1) == 0) { if (*prev != cs_Latin1) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_1, (unsigned int)CTEXT_SET_ISO8859_1_LEN); *outlen += CTEXT_SET_ISO8859_1_LEN; *prev = cs_Latin1; }; } else if (strcmp(tag, CS_ISO8859_2) == 0) { if (*prev != cs_Latin2) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_2, (unsigned int)CTEXT_SET_ISO8859_2_LEN); *outlen += CTEXT_SET_ISO8859_2_LEN; *prev = cs_Latin2; }; } else if (strcmp(tag, CS_ISO8859_3) == 0) { if (*prev != cs_Latin3) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_3, (unsigned int)CTEXT_SET_ISO8859_3_LEN); *outlen += CTEXT_SET_ISO8859_3_LEN; *prev = cs_Latin3; }; } else if (strcmp(tag, CS_ISO8859_4) == 0) { if (*prev != cs_Latin4) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_4, (unsigned int)CTEXT_SET_ISO8859_4_LEN); *outlen += CTEXT_SET_ISO8859_4_LEN; *prev = cs_Latin4; }; } else if (strcmp(tag, CS_ISO8859_5) == 0) { if (*prev != cs_LatinCyrillic) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_5, (unsigned int)CTEXT_SET_ISO8859_5_LEN); *outlen += CTEXT_SET_ISO8859_5_LEN; *prev = cs_LatinCyrillic; }; } else if (strcmp(tag, CS_ISO8859_6) == 0) { if (*prev != cs_LatinArabic) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_6, (unsigned int)CTEXT_SET_ISO8859_6_LEN); *outlen += CTEXT_SET_ISO8859_6_LEN; *prev = cs_LatinArabic; }; } else if (strcmp(tag, CS_ISO8859_7) == 0) { if (*prev != cs_LatinGreek) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_7, (unsigned int)CTEXT_SET_ISO8859_7_LEN); *outlen += CTEXT_SET_ISO8859_7_LEN; *prev = cs_LatinGreek; }; } else if (strcmp(tag, CS_ISO8859_8) == 0) { if (*prev != cs_LatinHebrew) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_8, (unsigned int)CTEXT_SET_ISO8859_8_LEN); *outlen += CTEXT_SET_ISO8859_8_LEN; *prev = cs_LatinHebrew; }; } else if (strcmp(tag, CS_ISO8859_9) == 0) { if (*prev != cs_Latin5) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_ISO8859_9, (unsigned int)CTEXT_SET_ISO8859_9_LEN); *outlen += CTEXT_SET_ISO8859_9_LEN; *prev = cs_Latin5; }; } else if (strcmp(tag, CS_JISX0201) == 0) { if (*prev != cs_Katakana) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_JISX0201, (unsigned int)CTEXT_SET_JISX0201_LEN); *outlen += CTEXT_SET_JISX0201_LEN; *prev = cs_Katakana; }; } else if ((strcmp(tag, CS_GB2312_0) == 0) || (strcmp(tag, CS_GB2312_1) == 0)) { if (*prev != cs_Hanzi) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_GB2312_0, (unsigned int)CTEXT_SET_GB2312_0_LEN); *outlen += CTEXT_SET_GB2312_0_LEN; *prev = cs_Hanzi; }; } else if ((strcmp(tag, CS_JISX0208_0) == 0) || (strcmp(tag, CS_JISX0208_1) == 0)) { if (*prev != cs_JapaneseGCS) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_JISX0208_0, (unsigned int)CTEXT_SET_JISX0208_0_LEN); *outlen += CTEXT_SET_JISX0208_0_LEN; *prev = cs_JapaneseGCS; }; } else if ((strcmp(tag, CS_KSC5601_0) == 0) || (strcmp(tag, CS_KSC5601_1) == 0)) { if (*prev != cs_KoreanGCS) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_KSC5601_0, (unsigned int)CTEXT_SET_KSC5601_0_LEN); *outlen += CTEXT_SET_KSC5601_0_LEN; *prev = cs_KoreanGCS; }; } else if (strcmp(tag, CS_ISO_IR_111) == 0) { if (*prev != cs_ir111) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)CTEXT_SET_IR_111, (unsigned int)CTEXT_SET_IR_111_LEN); *outlen += CTEXT_SET_IR_111_LEN; *prev = cs_ir111; }; } else { /* Must be a non-standard character set! */ OctetPtr temp; len = strlen(tag); temp = (unsigned char *) XtMalloc(*outlen + 6 + len + 2); /* orig + header + tag + STX + EOS */ memcpy( temp, *outc, *outlen); XtFree((char *) *outc); *outc = temp; temp = &((*outc)[*outlen]); /* ** Format is: ** 01/11 02/05 02/15 03/nn M L tag 00/02 text */ *temp++ = 0x1b; *temp++ = 0x25; *temp++ = 0x2f; /* ** HACK! The next octet in the sequence is the # of octets/char. ** XmStrings don't have this information, so just set it to be ** variable # of octets/char, and hope the caller knows what to do. */ *temp++ = 0x30; /* encode len in next 2 octets */ *temp++ = 0x80 + (len+ctlen+1)/128; *temp++ = 0x80 + (len+ctlen+1)%128; strcpy((char *) temp, tag); temp += len; *temp++ = STX; *temp = EOS; /* make sure there's a \0 on the end */ *prev = cs_NonStandard; *outlen += 6 + len + 1; }; /* Now copy in the text */ if (ctlen > 0) { *outc = ctextConcat(*outc, *outlen, ctext, ctlen); *outlen += ctlen; }; /* Finally, add the separator if any */ if (separator) { *outc = ctextConcat(*outc, *outlen, (unsigned char *)NEWLINESTRING, (unsigned int)NEWLINESTRING_LEN); (*outlen)++; } return(True); } static OctetPtr ctextConcat( OctetPtr str1, unsigned int str1len, const_OctetPtr str2, unsigned int str2len ) { str1 = (OctetPtr)XtRealloc((char *)str1, (str1len + str2len + 1)); memcpy( &str1[str1len], str2, str2len); str1[str1len+str2len] = EOS; return(str1); } #ifdef UTF8_SUPPORTED char* Convert(const char *str, unsigned int len, const char *to_codeset, const char *from_codeset) { char *res; iconv_t cd; if (str == NULL || to_codeset == NULL || from_codeset == NULL) return NULL; cd = iconv_open(to_codeset, from_codeset); if (cd == (iconv_t) -1) { char msg[255]; snprintf(msg, sizeof(msg), "Could not open converter from '%s' to '%s'", from_codeset, to_codeset); XmeWarning(NULL, msg); return NULL; } res = ConvertWithIconv(str, len, cd); iconv_close(cd); return res; } char* ConvertWithIconv(const char *str, unsigned int len, iconv_t converter) { char *dest; char *outp; const char *p; size_t inbytes_remaining; size_t outbytes_remaining; size_t err; size_t outbuf_size; Boolean have_error = FALSE; if (str == NULL || converter == (iconv_t) -1) return NULL; if (len < 0) len = strlen(str); p = str; inbytes_remaining = len; outbuf_size = len + 1; /* + 1 for nul in case len == 1 */ outbytes_remaining = outbuf_size - 1; /* -1 for nul */ outp = dest = XtMalloc(outbuf_size); again: err = iconv(converter, (char **)&p, &inbytes_remaining, &outp, &outbytes_remaining); if (err == (size_t) -1) { switch (errno) { case EINVAL: /* Incomplete text, do not report an error */ break; case E2BIG: { size_t used = outp - dest; outbuf_size *= 2; dest = XtRealloc(dest, outbuf_size); outp = dest + used; outbytes_remaining = outbuf_size - used - 1; /* -1 for nul */ goto again; } case EILSEQ: XmeWarning(NULL, "Invalid byte sequence in conversion input"); have_error = TRUE; break; default: { char msg[255]; snprintf(msg, sizeof(msg), "Error during conversion: %s", strerror(errno)); XmeWarning(NULL, msg); have_error = TRUE; break; } } } *outp = '\0'; if (have_error) { XtFree(dest); dest = NULL; } return dest; } #endif motif-2.3.8/lib/Xm/ContItemT.h0000644000175000017500000000460612672140200012734 00000000000000/* $XConsortium: ContItemT.h /main/5 1995/07/15 20:49:36 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmContainerItemT_H #define _XmContainerItemT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTcontainerItem; /* Trait structures and typedefs, place typedefs first */ /* this one can be expanded in the future */ typedef struct _XmContainerItemDataRec { Mask valueMask ; /* on setValues, give the information on what to change in the Icon, on getValues, on what to put in the record returned */ unsigned char view_type; unsigned char visual_emphasis; Dimension icon_width ; /* get value */ Cardinal detail_count; /* get value */ } XmContainerItemDataRec, *XmContainerItemData; #define ContItemAllValid (0xFFFF) #define ContItemViewType (1L<<0) #define ContItemVisualEmphasis (1L<<1) #define ContItemIconWidth (1L<<2) #define ContItemDetailCount (1L<<3) typedef void (*XmContainerItemSetValuesProc)(Widget w, XmContainerItemData contItemData); typedef void (*XmContainerItemGetValuesProc)(Widget w, XmContainerItemData contItemData); /* Version 0: initial release. */ typedef struct _XmContainerItemTraitRec { int version; /* 0 */ XmContainerItemSetValuesProc setValues; XmContainerItemGetValuesProc getValues; } XmContainerItemTraitRec, *XmContainerItemTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmContainerItemT_H */ motif-2.3.8/lib/Xm/SelectioBP.h0000644000175000017500000001362613145162623013072 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmSelectionBoxP_h #define _XmSelectionBoxP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Defines for use in allocation geometry matrix. */ #define XmSB_MAX_WIDGETS_VERT 8 /* Constraint part record for SelectionBox widget */ typedef struct _XmSelectionBoxConstraintPart { char unused; } XmSelectionBoxConstraintPart, * XmSelectionBoxConstraint; /* New fields for the SelectionBox widget class record */ typedef struct { XtCallbackProc list_callback ; XtPointer extension; /* Pointer to extension record */ } XmSelectionBoxClassPart; /* Full class record declaration */ typedef struct _XmSelectionBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmSelectionBoxClassPart selection_box_class; } XmSelectionBoxClassRec; externalref XmSelectionBoxClassRec xmSelectionBoxClassRec; /* New fields for the SelectionBox widget record */ typedef struct { Widget list_label; /* list Label */ XmString list_label_string; Widget list; /* List */ XmString *list_items; int list_item_count; int list_visible_item_count; int list_selected_item_position; Widget selection_label; /* selection Label */ XmString selection_label_string; Widget text; /* Text */ XmString text_string; short text_columns; Widget work_area; /* other widget */ Widget separator; /* separator */ Widget ok_button; /* enter button */ XmString ok_label_string; Widget apply_button; /* apply button */ XmString apply_label_string; XmString cancel_label_string; /* cancel button label */ Widget help_button; /* help button */ XmString help_label_string; XtCallbackList ok_callback; /* callbacks */ XtCallbackList apply_callback; XtCallbackList cancel_callback; XtCallbackList no_match_callback; XtAccelerators text_accelerators; Boolean must_match; /* flags */ Boolean adding_sel_widgets; Boolean minimize_buttons; unsigned char dialog_type; /* prompt or selection */ unsigned char child_placement; } XmSelectionBoxPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmSelectionBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmSelectionBoxPart selection_box; } XmSelectionBoxRec; /* Access Macros */ #define SB_ListLabel(w) \ (((XmSelectionBoxWidget) (w))->selection_box.list_label) #define SB_List(w) \ (((XmSelectionBoxWidget) (w))->selection_box.list) #define SB_SelectionLabel(w) \ (((XmSelectionBoxWidget) (w))->selection_box.selection_label) #define SB_Text(w) \ (((XmSelectionBoxWidget) (w))->selection_box.text) #define SB_WorkArea(w) \ (((XmSelectionBoxWidget) (w))->selection_box.work_area) #define SB_Separator(w) \ (((XmSelectionBoxWidget) (w))->selection_box.separator) #define SB_OkButton(w) \ (((XmSelectionBoxWidget) (w))->selection_box.ok_button) #define SB_ApplyButton(w) \ (((XmSelectionBoxWidget) (w))->selection_box.apply_button) #define SB_CancelButton(w) \ (((XmSelectionBoxWidget) (w))->bulletin_board.cancel_button) #define SB_HelpButton(w) \ (((XmSelectionBoxWidget) (w))->selection_box.help_button) #define SB_DefaultButton(w) \ (((XmSelectionBoxWidget) (w))->bulletin_board.default_button) #define SB_MarginHeight(w) \ (((XmSelectionBoxWidget) (w))->bulletin_board.margin_height) #define SB_MarginWidth(w) \ (((XmSelectionBoxWidget) (w))->bulletin_board.margin_width) #define SB_ButtonFontList(w) \ (((XmSelectionBoxWidget) (w))->bulletin_board.button_font_list) #define SB_LabelFontList(w) \ (((XmSelectionBoxWidget) (w))->bulletin_board.label_font_list) #define SB_TextFontList(w) \ (((XmSelectionBoxWidget) (w))->bulletin_board.text_font_list) #define SB_StringDirection(w) \ (XmDirectionToStringDirection\ (((XmSelectionBoxWidget)(w))->manager.string_direction)) #define SB_AddingSelWidgets(w) \ (((XmSelectionBoxWidget) w)->selection_box.adding_sel_widgets) #define SB_TextAccelerators(w) \ (((XmSelectionBoxWidget) w)->selection_box.text_accelerators) #define SB_ListItemCount(w) \ (((XmSelectionBoxWidget) w)->selection_box.list_item_count) #define SB_ListSelectedItemPosition(w) \ (((XmSelectionBoxWidget) w)->selection_box.list_selected_item_position) #define SB_ListVisibleItemCount(w) \ (((XmSelectionBoxWidget) w)->selection_box.list_visible_item_count) #define SB_TextColumns(w) \ (((XmSelectionBoxWidget) w)->selection_box.text_columns) #define SB_MinimizeButtons(w) \ (((XmSelectionBoxWidget) w)->selection_box.minimize_buttons) #define SB_MustMatch(w) \ (((XmSelectionBoxWidget) w)->selection_box.must_match) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSelectionBoxP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/VaSimpleP.h0000644000175000017500000000240113145162623012726 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmVaSimpleP_h #define _XmVaSimpleP_h #include # include # define Va_start(a,b) va_start(a,b) #ifdef __cplusplus extern "C" { #endif #define StringToName(string) XrmStringToName(string) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVaSimpleP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/BulletinBI.h0000644000175000017500000000570112672140200013054 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: BulletinBI.h /main/7 1996/06/14 23:09:13 pascale $ */ #ifndef _XmBulletinBI_h #define _XmBulletinBI_h #include #ifdef __cplusplus extern "C" { #endif typedef enum { XmOkStringLoc, XmCancelStringLoc, XmSelectionStringLoc, XmApplyStringLoc, XmHelpStringLoc, XmFilterStringLoc, XmDirListStringLoc, XmItemsStringLoc, XmDirTextStringLoc, XmPromptStringLoc } XmLabelStringLoc; /******** Private Function Declarations ********/ extern Widget _XmBB_CreateButtonG( Widget bb, XmString l_string, char *name, XmLabelStringLoc l_loc) ; extern Widget _XmBB_CreateLabelG( Widget bb, XmString l_string, char *name, XmLabelStringLoc l_loc) ; extern void _XmBulletinBoardSizeUpdate( Widget wid) ; extern void _XmBulletinBoardFocusMoved( Widget wid, XtPointer client_data, XtPointer data) ; extern void _XmBulletinBoardReturn( Widget wid, XEvent *event, String *params, Cardinal *numParams) ; extern void _XmBulletinBoardCancel( Widget wid, XEvent *event, String *params, Cardinal *numParams) ; extern void _XmBulletinBoardMap( Widget wid, XEvent *event, String *params, Cardinal *numParams) ; extern void _XmBulletinBoardSetDynDefaultButton( Widget wid, Widget newDefaultButton) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmBulletinBI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TravAct.c0000644000175000017500000004335113145162623012436 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TravAct.c /main/14 1999/05/27 13:58:09 mgreess $" #endif #endif #include "TraversalI.h" #include "TravActI.h" #include #include #include #include #include #include "RepTypeI.h" #include #include #include #include "ToolTipI.h" #define EVENTS_EQ(ev1, ev2) \ ((((ev1)->type == (ev2)->type) &&\ ((ev1)->serial == (ev2)->serial) &&\ ((ev1)->time == (ev2)->time) &&\ ((ev1)->x == (ev2)->x) &&\ ((ev1)->y == (ev2)->y)) ? TRUE : FALSE) /******** Static Function Declarations ********/ static Boolean UpdatePointerData(Widget w, XEvent *event); static void FlushPointerData(Widget w, XEvent *event); static void DispatchGadgetInput(XmGadget g, XEvent *event, Mask mask); /******** End Static Function Declarations ********/ /* * The following functions are used by the widgets to query or modify one * of the display dependent global variabled used by traversal mechanism. */ unsigned short _XmGetFocusFlag(Widget w, unsigned int mask) { XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(w)); return ((unsigned short)((XmDisplayInfo *) (dd->display.displayInfo))->resetFocusFlag & mask); } void _XmSetFocusFlag(Widget w, unsigned int mask, #if NeedWidePrototypes int value) #else Boolean value) #endif /* NeedWidePrototypes */ { XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(w)); if (value) ((XmDisplayInfo *) (dd->display.displayInfo))->resetFocusFlag |= mask; else ((XmDisplayInfo *) (dd->display.displayInfo))->resetFocusFlag &= ~mask; } static Boolean UpdatePointerData(Widget w, XEvent *event) { XmFocusData focusData; if ((focusData = _XmGetFocusData(w)) != NULL) { XCrossingEvent *lastEvent = &(focusData->lastCrossingEvent); focusData->needToFlush = TRUE; if (!EVENTS_EQ(lastEvent, (XCrossingEvent *)event)) { focusData->old_pointer_item = focusData->pointer_item; focusData->pointer_item = w; focusData->lastCrossingEvent = *(XCrossingEvent *) event; return TRUE; } } return FALSE; } static void FlushPointerData(Widget w, XEvent *event) { XmFocusData focusData = _XmGetFocusData(w); if (focusData && focusData->needToFlush) { XCrossingEvent lastEvent; lastEvent = focusData->lastCrossingEvent; focusData->needToFlush = FALSE; /* * We are munging data into the event to fake out the focus * code when Mwm is trying to catch up with the pointer. * This event that we are munging might already have been * munged by XmDispatchGadgetInput from a motion event to a * crossing event !!!!! */ lastEvent.serial = event->xany.serial; if ( (LeaveNotify == event->type) || (EnterNotify == event->type) ) lastEvent.time = event->xcrossing.time; else /* Approximation; the code appears to need even Focus events, ** so make up a time and try to continue, rather than limit ** lastEvent to XCrossingEvents. (It is a flaw in the X ** Protocol that Focus events do not have timestamps.) */ lastEvent.time = XtLastTimestampProcessed(XtDisplay(w)); lastEvent.focus = True; XtDispatchEvent((XEvent *) &lastEvent); } } /************************************************************************ * * _XmTrackShellFocus * * This handler is added by ShellExt initialize to the front of the * queue * ************************************************************************/ void _XmTrackShellFocus(Widget widget, XtPointer client_data, XEvent *event, Boolean *dontSwallow) { XmVendorShellExtObject ve = (XmVendorShellExtObject) client_data; XmFocusData focusData; XmGeneology oldFocalPoint; XmGeneology newFocalPoint; if (widget->core.being_destroyed) { *dontSwallow = False; return; } if ((focusData = ve->vendor.focus_data) == NULL) return; oldFocalPoint = newFocalPoint = focusData->focalPoint; switch(event->type) { case EnterNotify: case LeaveNotify: /* * If operating in a focus driven model, then enter and * leave events do not affect the keyboard focus. */ if ((event->xcrossing.detail != NotifyInferior) && (event->xcrossing.focus)) { switch (oldFocalPoint) { case XmUnrelated: if (event->type == EnterNotify) newFocalPoint = XmMyAncestor; break; case XmMyAncestor: if (event->type == LeaveNotify) newFocalPoint = XmUnrelated; break; case XmMyDescendant: case XmMyCousin: case XmMySelf: default: break; } } break; case FocusIn: switch (event->xfocus.detail) { case NotifyNonlinear: case NotifyAncestor: case NotifyInferior: newFocalPoint = XmMySelf; break; case NotifyNonlinearVirtual: case NotifyVirtual: newFocalPoint = XmMyDescendant; break; case NotifyPointer: newFocalPoint = XmMyAncestor; break; } break; case FocusOut: switch (event->xfocus.detail) { case NotifyPointer: case NotifyNonlinear: case NotifyAncestor: case NotifyNonlinearVirtual: case NotifyVirtual: newFocalPoint = XmUnrelated; break; case NotifyInferior: return; } break; } if (newFocalPoint == XmUnrelated) { focusData->old_focus_item = NULL; if (focusData->trav_graph.num_alloc) { /* Free traversal graph, since focus is leaving hierarchy. */ _XmFreeTravGraph(&(focusData->trav_graph)); } } if ((focusData->focus_policy == XmEXPLICIT) && (oldFocalPoint != newFocalPoint) && focusData->focus_item) { if (oldFocalPoint == XmUnrelated) _XmCallFocusMoved(NULL, focusData->focus_item, event); else if (newFocalPoint == XmUnrelated) _XmCallFocusMoved(focusData->focus_item, NULL, event); } focusData->focalPoint = newFocalPoint; } /************************************************************************ * * Enter & Leave * Enter and leave event processing routines. * ************************************************************************/ /*ARGSUSED*/ void _XmPrimitiveEnter(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { _XmToolTipEnter(wid, event, params, num_params); if (_XmGetFocusPolicy(wid) == XmPOINTER) { if (event->xcrossing.focus) { _XmCallFocusMoved(XtParent(wid), wid, event); _XmWidgetFocusChange(wid, XmENTER); } UpdatePointerData(wid, event); } } /*ARGSUSED*/ void _XmPrimitiveLeave(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { _XmToolTipLeave(wid, event, params, num_params); if (_XmGetFocusPolicy(wid) == XmPOINTER) { if (event->xcrossing.focus) { _XmCallFocusMoved(wid, XtParent(wid), event); _XmWidgetFocusChange(wid, XmLEAVE); } } } /************************************************************************ * * Focus In & Out * ************************************************************************/ /*ARGSUSED*/ void _XmPrimitiveFocusInInternal(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { if (!(event->xfocus.send_event) || _XmGetFocusFlag(wid, XmFOCUS_IGNORE)) return; if (_XmGetFocusPolicy(wid) == XmPOINTER) { /* Maybe Mwm trying to catch up with us. */ if (XtIsShell(XtParent(wid))) FlushPointerData(wid, event); } else { /* We should only be recieving the focus from a traversal request. */ if (!_XmGetActiveTabGroup(wid)) _XmMgrTraversal(_XmFindTopMostShell(wid), XmTRAVERSE_NEXT_TAB_GROUP); else _XmWidgetFocusChange(wid, XmFOCUS_IN); } } /*ARGSUSED*/ void _XmPrimitiveFocusOut(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { if (event->xfocus.send_event && !(wid->core.being_destroyed) && (_XmGetFocusPolicy(wid) == XmEXPLICIT)) { _XmWidgetFocusChange(wid, XmFOCUS_OUT); } } void _XmPrimitiveFocusIn(Widget pw, XEvent *event, String *params, Cardinal *num_params) { _XmPrimitiveFocusInInternal(pw, event, params, num_params); } /************************************************************************ * * _XmEnterGadget * This function processes enter window conditions occuring in a gadget * ************************************************************************/ /*ARGSUSED*/ void _XmEnterGadget(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { if (XmIsGadget(wid) && ((XmGadget)wid)->gadget.traversal_on) { _XmToolTipEnter(wid, event, params, num_params); } if (_XmGetFocusPolicy(wid) == XmPOINTER) { XmFocusData focusData = _XmGetFocusData(wid); /* We may be getting called as a result of Mwm catching up * with the pointer and setting input focus to the shell * which then gets forwarded to us. */ if (focusData && (focusData->focalPoint != XmUnrelated)) { _XmCallFocusMoved(XtParent(wid), wid, event); _XmWidgetFocusChange(wid, XmENTER); } } } /************************************************************************ * * DispatchGadgetInput * This routine is used instead of _XmDispatchGadgetInput due to * the fact that it needs to dispatch to unmanaged gadgets * ************************************************************************/ static void DispatchGadgetInput(XmGadget g, XEvent *event, Mask mask) { if ((g->gadget.event_mask & mask) && XtIsSensitive((Widget)g)) { (*(((XmGadgetClass) (g->object.widget_class))-> gadget_class.input_dispatch)) ((Widget) g, event, mask); } } /************************************************************************ * * _XmLeaveGadget * This function processes leave window conditions occuring in a gadget * ************************************************************************/ /*ARGSUSED*/ void _XmLeaveGadget(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { if (XmIsGadget(wid) && ((XmGadget)wid)->gadget.traversal_on) { _XmToolTipLeave(wid, event, params, num_params); } if (_XmGetFocusPolicy(wid) == XmPOINTER) { _XmCallFocusMoved(wid, XtParent(wid), event); _XmWidgetFocusChange(wid, XmLEAVE); } } /************************************************************************ * * _XmFocusInGadget * This function processes focusIn conditions occuring in a gadget * ************************************************************************/ /*ARGSUSED*/ void _XmFocusInGadget(Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { if (_XmGetFocusPolicy(wid) == XmEXPLICIT) _XmWidgetFocusChange(wid, XmFOCUS_IN); } /************************************************************************ * * _XmFocusOutGadget * This function processes FocusOut conditions occuring in a gadget * ************************************************************************/ /*ARGSUSED*/ void _XmFocusOutGadget(Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { if (_XmGetFocusPolicy(wid) == XmEXPLICIT) _XmWidgetFocusChange(wid, XmFOCUS_OUT); } /************************************************************************ * * Enter, FocusIn and Leave Window procs * * These two procedures handle traversal activation and deactivation * for manager widgets. They are invoked directly throught the * the action table of a widget. * ************************************************************************/ /************************************************************************ * * _XmManagerEnter * This function handles both focusIn and Enter. Don't ask me why * :-( * ************************************************************************/ /*ARGSUSED*/ void _XmManagerEnter(Widget wid, XEvent *event_in, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid; XCrossingEvent *event = (XCrossingEvent *) event_in; if (_XmGetFocusPolicy((Widget) mw) == XmPOINTER) { if (UpdatePointerData((Widget) mw, event_in) && event->focus) { Widget old; if (event->detail == NotifyInferior) old = XtWindowToWidget(event->display, event->subwindow); else old = XtParent(mw); _XmCallFocusMoved(old, (Widget) mw, (XEvent *) event); _XmWidgetFocusChange((Widget) mw, XmENTER); } } } /*ARGSUSED*/ void _XmManagerLeave(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { /* * This code is inefficient since it is called twice for each * internal move in the hierarchy ||| */ if (event->type == LeaveNotify) { if (_XmGetFocusPolicy(wid) == XmPOINTER) { Widget new_wid; if (event->xcrossing.detail == NotifyInferior) new_wid = XtWindowToWidget(event->xcrossing.display, event->xcrossing.subwindow); else new_wid = XtParent(wid); if (UpdatePointerData(wid, event) && event->xcrossing.focus) { _XmCallFocusMoved(wid, new_wid, event); _XmWidgetFocusChange(wid, XmLEAVE); } } } } /*ARGSUSED*/ void _XmManagerFocusInInternal(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { Widget child; /* * Managers ignore all focus events which have been generated by the * window system; only those sent to us by a window manager or the * Xtk focus code is accepted. * Bail out if the focus policy is not set to explicit */ if (!(event->xfocus.send_event) || _XmGetFocusFlag(wid, XmFOCUS_RESET | XmFOCUS_IGNORE)) return; if (_XmGetFocusPolicy(wid) == XmPOINTER) { FlushPointerData(wid, event); } else if (!_XmGetActiveTabGroup(wid)) { /* If the heirarchy doesn't have an active tab group give it one. */ _XmMgrTraversal(_XmFindTopMostShell(wid), XmTRAVERSE_NEXT_TAB_GROUP); } else if ((child = ((XmManagerWidget) wid)->manager.active_child) && XmIsGadget(child)) { /* If focus went to a gadget, then force it to highlight */ DispatchGadgetInput((XmGadget) child, event, XmFOCUS_IN_EVENT); } else { _XmWidgetFocusChange(wid, XmFOCUS_IN); } } /* * Non-menu widgets use this entry point, so that they will ignore focus * events during menu activities. */ void _XmManagerFocusIn(Widget mw, XEvent *event, String *params, Cardinal *num_params) { _XmManagerFocusInInternal(mw, event, params, num_params); } /* * If the manager widget received a FocusOut while it is processing its * FocusIn event, then it knows that the focus has been successfully moved * to one of its children. However, if no FocusOut is received, then the * manager widget must manually force the child to take the focus. */ /*ARGSUSED*/ void _XmManagerFocusOut(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { Widget child; if (!event->xfocus.send_event) return; if (_XmGetFocusPolicy(wid) == XmEXPLICIT) { /* If focus is in a gadget, then force it to unhighlight. */ if ((child = ((XmManagerWidget) wid)->manager.active_child) && XmIsGadget(child)) { DispatchGadgetInput((XmGadget) child, event, XmFOCUS_OUT_EVENT); } else { _XmWidgetFocusChange(wid, XmFOCUS_OUT); } } } /*ARGSUSED*/ void _XmManagerUnmap(Widget mw, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { /* This functionality is bogus, since a good implementation * requires more code (hooks for mapping of widgets) than it's * worth. To move focus away from a widget when it is unmapped * implies the ability to recover from the case when the last * traversable widget in a hierarchy is unmapped and then re-mapped. * Since we don't have the hooks in place for the mapping of these * widgets, and since the old code only worked some of the time, * and since it is arguable that the focus should never be * changed in response to a widget being unmapped, we should choose * to do NO traversal in response to the unmapping of a widget. * However, historical precedent again defeats good design. */ _XmValidateFocus(mw); } /*ARGSUSED*/ void _XmPrimitiveUnmap(Widget pw, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { _XmValidateFocus(pw); } motif-2.3.8/lib/Xm/ScrollBarP.h0000644000175000017500000001127713145162623013104 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScrollBarP_h #define _XmScrollBarP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Minimum slider width or height */ #define MIN_SLIDER_THICKNESS 1 #define MIN_SLIDER_LENGTH 6 #define DEFAULT_ROUND_MARK_RADIUS 3 #define THERMO_MARK_OFFSET 10 /* ScrollBar class structure */ typedef struct _XmScrollBarClassPart { XtPointer extension; /* Pointer to extension record */ } XmScrollBarClassPart; /* Full class record declaration for CheckBox class */ typedef struct _XmScrollBarClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmScrollBarClassPart scrollBar_class; } XmScrollBarClassRec; externalref XmScrollBarClassRec xmScrollBarClassRec; /* The ScrollBar instance record */ typedef struct _XmScrollBarPart { int value; int minimum; int maximum; int slider_size; unsigned char orientation; unsigned char processing_direction; XtEnum show_arrows; int increment; int page_increment; int initial_delay; int repeat_delay; XtCallbackList value_changed_callback; XtCallbackList increment_callback; XtCallbackList decrement_callback; XtCallbackList page_increment_callback; XtCallbackList page_decrement_callback; XtCallbackList to_top_callback; XtCallbackList to_bottom_callback; XtCallbackList drag_callback; /* obsolete */ GC unhighlight_GC; /* Change the logical name of this one in 2.0 */ GC foreground_GC; Pixel trough_color; Drawable pixmap; Boolean sliding_on; int saved_value; XtEnum etched_slider; /* we used a #define slider_visual to referenced this field in the c file, etched_slider is not a good name anymore, */ XtEnum slider_mark; unsigned char flags; /* Values for the XmScrollBarPart flags field */ #define FIRST_SCROLL_FLAG (1<<0) #define VALUE_SET_FLAG (1<<1) #define END_TIMER (1<<2) #define ARROW1_AVAILABLE (1<<3) #define ARROW2_AVAILABLE (1<<4) #define SLIDER_AVAILABLE (1<<5) #define KEYBOARD_GRABBED (1<<6) #define OPERATION_CANCELLED (1<<7) /* last field */ unsigned char add_flags; /* Values for the additionnal flags field */ #define SNAPPED_OUT (1<<0) unsigned char change_type; XtIntervalId timer; short initial_x; short initial_y; short separation_x; short separation_y; short slider_x; short slider_y; short slider_width; short slider_height; short slider_area_x; short slider_area_y; short slider_area_width; short slider_area_height; short arrow1_x; short arrow1_y; unsigned char arrow1_orientation; Boolean arrow1_selected; short arrow2_x; short arrow2_y; unsigned char arrow2_orientation; Boolean arrow2_selected; short arrow_width; short arrow_height; /* Obsolete fields as 1.2.0 */ short arrow1_top_count; short arrow1_cent_count; short arrow1_bot_count; XRectangle * arrow1_top; XRectangle * arrow1_cent; XRectangle * arrow1_bot; short arrow2_top_count; short arrow2_cent_count; short arrow2_bot_count; XRectangle * arrow2_top; XRectangle * arrow2_cent; XRectangle * arrow2_bot; /***********/ /* new for 1.2 */ GC unavailable_GC; /* new for 2.0 */ unsigned short snap_back_multiple; XtEnum sliding_mode; Boolean editable; Mask dimMask ; /* for the navigator trait */ } XmScrollBarPart; /* Full instance record declaration */ typedef struct _XmScrollBarRec { CorePart core; XmPrimitivePart primitive; XmScrollBarPart scrollBar; } XmScrollBarRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScrollBarP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TransferT.h0000644000175000017500000000310312672140200012765 00000000000000/* $XConsortium: TransferT.h /main/4 1995/07/15 20:56:34 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmTransferT_H #define _XmTransferT_H #include #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTtransfer; /* Trait structures and typedefs, place typedefs first */ /* Version 0: initial release. */ typedef struct _XmTransferTraitRec { int version; /* 0 */ XmConvertCallbackProc convertProc; XmDestinationCallbackProc destinationProc; XmDestinationCallbackProc destinationPreHookProc; } XmTransferTraitRec, *XmTransferTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTransferT_H */ motif-2.3.8/lib/Xm/AccTextT.h0000644000175000017500000000350712672140200012544 00000000000000/* $XConsortium: AccTextT.h /main/5 1995/07/15 20:48:04 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmAccessTextualT_H #define _XmAccessTextualT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTaccessTextual; typedef XtPointer (*XmAccessTextualGetValuesProc)(Widget, int); typedef int (*XmAccessTextualPreferredProc)(Widget); typedef void (*XmAccessTextualSetValuesProc)(Widget, XtPointer, int); enum { XmFORMAT_XmSTRING, XmFORMAT_MBYTE, XmFORMAT_WCS }; /* Trait structures and typedefs, place typedefs first */ /* Version 0: initial release. */ typedef struct _XmAccessTextualTraitRec { int version; /* 0 */ XmAccessTextualGetValuesProc getValue; XmAccessTextualSetValuesProc setValue; XmAccessTextualPreferredProc preferredFormat; } XmAccessTextualTraitRec, *XmAccessTextualTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmAccessTextualT_H */ motif-2.3.8/lib/Xm/Cache.c0000644000175000017500000001027113145162623012070 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Cache.c /main/12 1995/07/14 10:12:26 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "CacheI.h" #include /******** Static Function Declarations ********/ /******** End Static Function Declarations ********/ /************************************************************************ * * _XmCacheDelete * Delete an existing cache record. NOTE: is a pointer to the * fourth field in the cache record - It is *not* a pointer to the * cache record itself! * ************************************************************************/ void _XmCacheDelete( XtPointer data ) { XmGadgetCachePtr ptr; ptr = (XmGadgetCachePtr) DataToGadgetCache(data); if (--ptr->ref_count <= 0) { (ptr->prev)->next = ptr->next; if (ptr->next) /* not the last record */ (ptr->next)->prev = ptr->prev; XtFree( (char *) ptr ); } } /************************************************************************ * * _XmCacheCopy * Copy bytes from to . * ************************************************************************/ void _XmCacheCopy( XtPointer src, XtPointer dest, size_t size ) { memcpy( dest, src, size); } /************************************************************************ * * _XmCachePart * Pass in a pointer, , to bytes of a temporary Cache * record. * - If the Class cache head is NULL (no entries yet!), allocate a new * cache record, copy in temporary Cache bytes, append it to the * class-cache linked list, and return the address. * - Else, run through the class linked list. * = If a match is found, increment the ref_count and return the * address. * = Else, allocate a new cache record, copy in temporary Cache bytes, * append it to the class-cache linked list, and return the address. * ************************************************************************/ XtPointer _XmCachePart( XmCacheClassPartPtr cp, XtPointer cpart, size_t size ) { XmGadgetCachePtr ptr, last; if (ClassCacheHead(cp).next == NULL) /* First one */ { ClassCacheHead(cp).next = (struct _XmGadgetCache *)XtMalloc( size + XtOffsetOf(XmGadgetCacheRef, data)); ptr = (XmGadgetCachePtr)ClassCacheHead(cp).next; ClassCacheCopy(cp)(cpart, CacheDataPtr(ptr), size ); ptr-> ref_count = 1; ptr-> next = NULL; ptr-> prev = (struct _XmGadgetCache *)&ClassCacheHead(cp); return (CacheDataPtr(ptr)); } ptr = (XmGadgetCachePtr)ClassCacheHead(cp).next; do { if ((ClassCacheCompare(cp)( cpart, CacheDataPtr(ptr)))) { ptr->ref_count++; return ((XtPointer) CacheDataPtr(ptr)); } else { last = ptr; ptr = (XmGadgetCachePtr)ptr->next; } } while (ptr); /* Malloc a new rec off of last, fill it out*/ ptr = (XmGadgetCachePtr)XtMalloc( size + XtOffsetOf(XmGadgetCacheRef, data) ); last->next = (struct _XmGadgetCache *)ptr; ClassCacheCopy(cp)(cpart, CacheDataPtr(ptr), size); ptr-> ref_count = 1; ptr-> next = NULL; ptr-> prev = last; return (CacheDataPtr(ptr)); } motif-2.3.8/lib/Xm/DialogSE.c0000644000175000017500000001476313145162623012526 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: DialogSE.c /main/10 1995/07/14 10:19:03 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include /* To make cpp on Sun happy. CR 5943 */ #include #include #include /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void DeleteWindowHandler( Widget wid, XtPointer closure, XtPointer call_data) ; static Widget GetManagedKid( CompositeWidget p) ; /******** End Static Function Declarations ********/ static XtResource extResources[]= { { XmNdeleteResponse, XmCDeleteResponse, XmRDeleteResponse, sizeof(unsigned char), XtOffsetOf( struct _XmDialogShellExtRec, vendor.delete_response), XmRImmediate, (XtPointer) XmUNMAP, }, }; static XmBaseClassExtRec myExtExtension = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ XmInheritInitializePrehook, /* initialize prehook */ XmInheritSetValuesPrehook, /* set_values prehook */ XmInheritInitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ XmInheritGetSecResData, /* getSecRes data */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ XmInheritClassPartInitPrehook, /* class_part_prehook */ XmInheritClassPartInitPosthook, /* class_part_posthook */ NULL, /* compiled_ext_resources*/ NULL, /* ext_resources */ 0, /* resource_count */ TRUE, /* use_sub_resources */ }; /* ext rec static initialization */ externaldef(xmdialogshellextclassrec) XmDialogShellExtClassRec xmDialogShellExtClassRec = { { (WidgetClass) &xmVendorShellExtClassRec, /* superclass */ "XmDialogShell", /* class_name */ sizeof(XmDialogShellExtRec), /* size */ ClassInitialize, /* Class Initializer */ NULL, /* class_part_init */ FALSE, /* Class init'ed ? */ NULL, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ extResources, /* resources */ XtNumber(extResources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ NULL, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer) &myExtExtension, /* extension */ }, { NULL, /* synthetic resources */ 0, /* num syn resources */ NULL, /* extension */ }, { /* desktop */ NULL, /* child_class */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* shell extension */ XmInheritEventHandler, /* structureNotify */ NULL, /* extension */ }, { /* vendor ext */ DeleteWindowHandler, /* delete window handler*/ XmInheritProtocolHandler, /* offset_handler */ NULL, /* extension */ }, { /* dialog ext */ (XtPointer) NULL, /* extension */ } }; externaldef(xmdialogshellextobjectclass) WidgetClass xmDialogShellExtObjectClass = (WidgetClass) &xmDialogShellExtClassRec; static void ClassInitialize( void ) { myExtExtension.record_type = XmQmotif; } /************************************************************************ * * DeleteWindowHandler * ************************************************************************/ /*ARGSUSED*/ static void DeleteWindowHandler( Widget wid, XtPointer closure, XtPointer call_data ) /* unused */ { VendorShellWidget w = (VendorShellWidget) wid ; XmVendorShellExtObject ve = (XmVendorShellExtObject) closure; switch(ve->vendor.delete_response) { case XmUNMAP: { Widget managedKid; if ((managedKid = GetManagedKid((CompositeWidget) w)) != NULL) XtUnmanageChild(managedKid); break; } case XmDESTROY: XtDestroyWidget(wid); break; case XmDO_NOTHING: default: break; } } static Widget GetManagedKid( CompositeWidget p ) { Cardinal i; Widget *currKid; for (i = 0, currKid = p->composite.children; i < p->composite.num_children; i++, currKid++) { if (XtIsManaged(*currKid)) return (*currKid); } return NULL; } motif-2.3.8/lib/Xm/XmIm.c0000644000175000017500000021234513145162623011745 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: XmIm.c /main/28 1997/10/13 14:57:31 cshi $" #endif #endif #include #include #include #include #include #include #include /* for bzero */ #include "BaseClassI.h" #include "MessagesI.h" #include "XmI.h" #include "XmImI.h" #include #define FIX_1534 # include # define Va_start(a,b) va_start(a,b) #define FIX_1510 #define FIX_1129 #define FIX_1196 #ifdef NO_XICPROC typedef Bool (*XICProc)( XIC, XPointer, XPointer); #endif /* Data structures: * While multiple XIMs are not currently supported, some thought * was given to how they might be implemented. Currently both * XmImDisplayInfo and XmImShellInfo contain per-XIM fields. Also the * locale and XmNinputMethod are implicit in the XmImDisplayInfo. * The back-pointer for the original source of shared XICs is perhaps * overly general, but will ease XmPER_MANAGER sharing if implemented. * * If an XIC is shared among several widgets, all will reference a * single XmImXICInfo. */ typedef struct _XmImRefRec { Cardinal num_refs; /* Number of referencing widgets. */ Cardinal max_refs; /* Maximum length of refs array. */ Widget* refs; /* Array of referencing widgets. */ XtPointer **callbacks; } XmImRefRec, *XmImRefInfo; typedef struct _PreeditBufferRec { unsigned short length; wchar_t *text; XIMFeedback *feedback; int caret; XIMCaretStyle style; } PreeditBufferRec, *PreeditBuffer; typedef struct _XmImXICRec { struct _XmImXICRec *next; /* Links all have the same XIM. */ XIC xic; /* The XIC. */ Window focus_window; /* Cached information about the XIC. */ XIMStyle input_style; /* ...ditto... */ int status_width; /* ...ditto... */ int preedit_width; /* ...ditto... */ int sp_height; /* ...ditto... */ Boolean has_focus; /* Does this XIC have keyboard focus. */ Boolean anonymous; /* Do we have exclusive rights to this XIC. */ XmImRefRec widget_refs; /* Widgets referencing this XIC. */ struct _XmImXICRec **source; /* Original source of shared XICs. */ PreeditBuffer preedit_buffer; } XmImXICRec, *XmImXICInfo; typedef struct _XmImShellRec { /* per-Shell fields. */ Widget im_widget; /* Dummy widget to make intrinsics behave. */ Widget current_widget; /* Widget whose visual we're matching. */ /* per fields. */ XmImXICInfo shell_xic; /* For PER_SHELL sharing policy. */ XmImXICInfo iclist; /* All known XICs for this . */ } XmImShellRec, *XmImShellInfo; typedef struct { /* per-Display fields. */ XContext current_xics; /* Map widget -> current XmImXICInfo. */ /* per-XIM fields. */ XIM xim; /* The XIM. */ XIMStyles *styles; /* XNQueryInputStyle result. */ XmImRefRec shell_refs; /* Shells referencing this XIM. */ } XmImDisplayRec, *XmImDisplayInfo; /* * Although the current implementation of XVaNestedList is similar * to an Xt ArgList, this is not guaranteed by the spec. The only * approved interface for creating XVaNestedLists takes pairs of * (char*, XPointer) paramters. */ typedef struct { char *name; XPointer value; } VaArg; typedef struct { Cardinal count; Cardinal max; VaArg *args; } VaArgListRec, *VaArgList; /******** Static Function Declarations ********/ static int add_sp(String name, XPointer value, VaArgList slp, VaArgList plp, VaArgList vlp); static int add_p(String name, XPointer value, VaArgList slp, VaArgList plp, VaArgList vlp); static int add_fs(String name, XPointer value, VaArgList slp, VaArgList plp, VaArgList vlp); static int add_bgpxmp(String name, XPointer value, VaArgList slp, VaArgList plp, VaArgList vlp); static XIMStyle check_style(XIMStyles *styles, XIMStyle preedit_style, XIMStyle status_style); static int ImGetGeo(Widget vw, XmImXICInfo this_icp ); static void ImSetGeo(Widget vw, XmImXICInfo this_icp ); static void ImGeoReq(Widget vw); static XFontSet extract_fontset(XmFontList fl); static XmImDisplayInfo get_xim_info(Widget w); static XtPointer* get_im_info_ptr(Widget w, Boolean create); static XmImShellInfo get_im_info(Widget w, Boolean create); static void draw_separator(Widget vw); static void null_proc(Widget w, XtPointer ptr, XEvent *ev, Boolean *b); static void ImCountVaList(va_list var, int *total_count); static ArgList ImCreateArgList(va_list var, int total_count); static XmImXICInfo create_xic_info(Widget shell, XmImDisplayInfo xim_info, XmImShellInfo im_info, #if NeedWidePrototypes unsigned int input_policy); #else XmInputPolicy input_policy); #endif /*NeedWidePrototypes*/ static XmImXICInfo recreate_xic_info(XIC xic, Widget shell, XmImDisplayInfo xim_info, XmImShellInfo im_info); static void set_values(Widget w, ArgList args, Cardinal num_args, #if NeedWidePrototypes unsigned int policy); #else XmInputPolicy policy); #endif /*NeedWidePrototypes*/ static XmImXICInfo get_current_xic(XmImDisplayInfo xim_info, Widget widget); static void set_current_xic(XmImXICInfo xic_info, XmImDisplayInfo xim_info, Widget widget); static void unset_current_xic(XmImXICInfo xic_info, XmImShellInfo im_info, XmImDisplayInfo xim_info, Widget widget); static Cardinal add_ref(XmImRefInfo refs, Widget widget); static Cardinal remove_ref(XmImRefInfo refs, Widget widget); static XVaNestedList VaCopy(VaArgList list); static void VaSetArg(VaArgList list, char *name, XPointer value); static int ImPreeditStartCallback(XIC xic, XPointer client_data, XPointer call_data); static void ImPreeditDoneCallback(XIC xic, XPointer client_data, XPointer call_data); static void ImPreeditDrawCallback(XIC xic, XPointer client_data, XPointer call_data); static void ImPreeditCaretCallback(XIC xic, XPointer client_data, XPointer call_data); static void ImFreePreeditBuffer(PreeditBuffer pb); static void set_callback_values(Widget w, String name, XIMCallback *value, VaArgList vlp, XmInputPolicy input_policy); static void regist_real_callback(Widget w, XIMProc call, int swc); static XICProc get_real_callback(Widget w, int swc, Widget *real_widget); static void move_preedit_string(XmImXICInfo icp, Widget wfrom, Widget wto); /******** End Static Function Declarations ********/ typedef int (*XmImResLProc)(String, XPointer, VaArgList, VaArgList, VaArgList); typedef struct { String xmstring; String xstring; XrmName xrmname; XmImResLProc proc; } XmImResListRec; static XmImResListRec XmImResList[] = { {XmNbackground, XNBackground, NULLQUARK, add_sp}, {XmNforeground, XNForeground, NULLQUARK, add_sp}, {XmNbackgroundPixmap, XNBackgroundPixmap, NULLQUARK, add_bgpxmp}, {XmNspotLocation, XNSpotLocation, NULLQUARK, add_p}, {XmNfontList, XNFontSet, NULLQUARK, add_fs}, {XmNrenderTable, XNFontSet, NULLQUARK, add_fs}, {XmNlineSpace, XNLineSpace, NULLQUARK, add_sp}, {XmNarea, XNArea, NULLQUARK, add_p}, {XmNpreeditStartCallback, XNPreeditStartCallback, NULLQUARK, NULL}, {XmNpreeditDoneCallback, XNPreeditDoneCallback, NULLQUARK, NULL}, {XmNpreeditDrawCallback, XNPreeditDrawCallback, NULLQUARK, NULL}, {XmNpreeditCaretCallback, XNPreeditCaretCallback, NULLQUARK, NULL}, }; #define OVERTHESPOT "overthespot" #define OFFTHESPOT "offthespot" #define ROOT "root" #define ONTHESPOT "onthespot" #define PREEDIT_START 0 #define PREEDIT_DONE 1 #define PREEDIT_DRAW 2 #define PREEDIT_CARET 3 #define SEPARATOR_HEIGHT 2 #define GEO_CHG 0x1 #define BG_CHG 0x2 #define MSG1 _XmMMsgXmIm_0000 /*ARGSUSED*/ void XmImRegister(Widget w, unsigned int reserved) /* unused */ { Widget p; XmImShellInfo im_info; XmImDisplayInfo xim_info; XmInputPolicy input_policy = XmINHERIT_POLICY; _XmWidgetToAppContext(w); _XmAppLock(app); /* Find the enclosing shell. */ p = XtParent(w); while (!XtIsShell(p)) p = XtParent(p); /* Lookup or create per-shell IM info and an XIM. */ if (((xim_info = get_xim_info(p)) == NULL) || (xim_info->xim == NULL)) { _XmAppUnlock(app); return; } if ((im_info = get_im_info(p, True)) == NULL) { _XmAppUnlock(app); return; } /* Check that this widget doesn't already have a current XIC. */ if (get_current_xic(xim_info, w) != NULL) { _XmAppUnlock(app); return; } /* See if this widget will be sharing an existing XIC. */ XtVaGetValues(p, XmNinputPolicy, &input_policy, NULL); switch (input_policy) { case XmPER_SHELL: if (im_info->shell_xic == NULL) (void) create_xic_info(p, xim_info, im_info, input_policy); set_current_xic(im_info->shell_xic, xim_info, w); break; case XmPER_WIDGET: set_current_xic(create_xic_info(p, xim_info, im_info, input_policy), xim_info, w); break; case XmINHERIT_POLICY: break; default: assert(False); } _XmAppUnlock(app); } void XmImUnregister(Widget w) { register XmImDisplayInfo xim_info; register XmImShellInfo im_info; register XmImXICInfo xic_info; XtAppContext app; /* Punt if insufficient information was provided. */ if (w == NULL) return; app = XtWidgetToApplicationContext(w); _XmAppLock(app); /* Locate this record. */ xim_info = get_xim_info(w); if ((xic_info = get_current_xic(xim_info, w)) == NULL) { _XmAppUnlock(app); return; } if ((im_info = get_im_info(w, False)) == NULL) { _XmAppUnlock(app); return; } /* Unregister this record. */ unset_current_xic(xic_info, im_info, xim_info, w); if (im_info->iclist == NULL) { Widget vw = XtParent(w); while (!XtIsShell(vw)) vw = XtParent(vw); ImGeoReq(vw); } _XmAppUnlock(app); } void XmImSetFocusValues(Widget w, ArgList args, Cardinal num_args) { register XmImXICInfo xic_info; Widget p; Pixel fg, bg; XmFontList fl=NULL; XFontSet fs=NULL; XmVendorShellExtObject ve; XmWidgetExtData extData; XmImShellInfo im_info; XVaNestedList list; Window wind; XmInputPolicy input_policy; _XmWidgetToAppContext(w); _XmAppLock(app); p = w; while (!XtIsShell(p)) p = XtParent(p); if ((xic_info = get_current_xic(get_xim_info(p), w)) == NULL) { _XmAppUnlock(app); return; } wind = xic_info->focus_window; xic_info->focus_window = XtWindow(w); set_values(w, args, num_args, XmINHERIT_POLICY); if (wind != XtWindow(w)) { /* Safe, since we have a window - so it's no gadget */ XtVaGetValues(w, XmNbackground, &bg, NULL); XtVaGetValues(w, XmNforeground, &fg, NULL); XtVaGetValues(w, XmNfontList, &fl, NULL); if (fl) fs = extract_fontset(fl); if (fs) list = XVaCreateNestedList(0, XNBackground, bg, XNForeground, fg, XNFontSet, fs, NULL); else list = XVaCreateNestedList(0, XNBackground, bg, XNForeground, fg, NULL); XSetICValues(xic_info->xic, XNFocusWindow, XtWindow(w), XNStatusAttributes, list, XNPreeditAttributes, list, NULL); XFree(list); if (xic_info->input_style & XIMPreeditCallbacks) { XtVaGetValues(p, XmNinputPolicy, &input_policy, NULL); if (input_policy == XmPER_SHELL && wind) move_preedit_string(xic_info, XtWindowToWidget(XtDisplay(w), wind), w); } } XSetICFocus(xic_info->xic); xic_info->has_focus = True; extData = _XmGetWidgetExtData((Widget)p, XmSHELL_EXTENSION); if (extData) { ve = (XmVendorShellExtObject) extData->widget; if (ve->vendor.im_height) { im_info = (XmImShellInfo)ve->vendor.im_info; im_info->current_widget = w; XtVaGetValues(w, XmNbackground, &bg, NULL); XtVaSetValues(p, XmNbackground, bg, NULL); #ifdef FIX_1129 ImGeoReq(p); #endif draw_separator(p); } } _XmAppUnlock(app); } void XmImSetValues(Widget w, ArgList args, Cardinal num_args ) { _XmWidgetToAppContext(w); _XmAppLock(app); set_values(w, args, num_args, XmINHERIT_POLICY); _XmAppUnlock(app); } void XmImUnsetFocus(Widget w) { register XmImXICInfo xic_info; _XmWidgetToAppContext(w); _XmAppLock(app); if ((xic_info = get_current_xic(get_xim_info(w), w)) == NULL) { _XmAppUnlock(app); return; } if (xic_info->xic) XUnsetICFocus(xic_info->xic); xic_info->has_focus = False; _XmAppUnlock(app); } XIM XmImGetXIM(Widget w) { XmImDisplayInfo xim_info; _XmWidgetToAppContext(w); _XmAppLock(app); xim_info = get_xim_info(w); if (xim_info != NULL) { _XmAppUnlock(app); return xim_info->xim; } else { _XmAppUnlock(app); return NULL; } } void XmImCloseXIM(Widget w) { XmDisplay xmDisplay; XmImDisplayInfo xim_info; Widget shell; XmVendorShellExtObject ve; XmWidgetExtData extData; int height, base_height; Arg args[1]; XtWidgetGeometry my_request; _XmWidgetToAppContext(w); _XmAppLock(app); /* Allow (xim_info->xim == NULL) so we can reset the "failed" flag. */ if ((xim_info = get_xim_info(w)) == NULL) { _XmAppUnlock(app); return; } /* Remove all references to all XICs */ while (xim_info->shell_refs.refs != NULL) { shell = xim_info->shell_refs.refs[0]; _XmImFreeShellData(shell, get_im_info_ptr(shell, False)); assert((xim_info->shell_refs.refs == NULL) || (xim_info->shell_refs.refs[0] != shell)); } shell = w; while (!XtIsShell(shell)) shell = XtParent(shell); extData = _XmGetWidgetExtData((Widget)shell, XmSHELL_EXTENSION); if (extData) { ve = (XmVendorShellExtObject) extData->widget; height = ve->vendor.im_height; if (height != 0){ XtSetArg(args[0], XtNbaseHeight, &base_height); XtGetValues(shell, args, 1); if (base_height > 0){ base_height -= height; XtSetArg(args[0], XtNbaseHeight, base_height); XtSetValues(shell, args, 1); } if(!(XtIsRealized(shell))) shell->core.height -= height; else { my_request.height = shell->core.height - height; my_request.request_mode = CWHeight; XtMakeGeometryRequest(shell, &my_request, NULL); } ve->vendor.im_height = 0; } } /* Close the XIM. */ if (xim_info->xim != NULL) { XCloseIM(xim_info->xim); xim_info->xim = NULL; } XFree(xim_info->styles); xim_info->styles = NULL; xmDisplay = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); xmDisplay->display.xmim_info = NULL; XtFree((char *) xim_info); _XmAppUnlock(app); } int XmImMbLookupString(Widget w, XKeyPressedEvent *event, char *buf, int nbytes, KeySym *keysym, int *status ) { register XmImXICInfo icp; int ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); if ((icp = get_current_xic(get_xim_info(w), w)) == NULL || icp->xic == NULL) { if (status) *status = XLookupBoth; ret_val = XLookupString(event, buf, nbytes, keysym, 0); _XmAppUnlock(app); return ret_val; } ret_val = XmbLookupString( icp->xic, event, buf, nbytes, keysym, status ); _XmAppUnlock(app); return ret_val; } XIC XmImGetXIC(Widget w, #if NeedWidePrototypes unsigned int input_policy, #else XmInputPolicy input_policy, #endif /*NeedWidePrototypes*/ ArgList args, Cardinal num_args) { XmImDisplayInfo xim_info; XmImShellInfo im_info; XmImXICInfo xic_info; Widget shell; _XmWidgetToAppContext(w); _XmAppLock(app); xim_info = get_xim_info(w); im_info = get_im_info(w, True); xic_info = get_current_xic(xim_info, w); if ((xim_info == NULL) || (xim_info->xim == NULL)) { _XmAppUnlock(app); return NULL; } /* Find the enclosing shell. */ shell = w; while (!XtIsShell(shell)) shell = XtParent(shell); /* Resolve the true input policy. */ if (input_policy == XmINHERIT_POLICY) XtVaGetValues(shell, XmNinputPolicy, &input_policy, NULL); /* If there is already a current XIC, we may want to unregister it. */ switch (input_policy) { case XmPER_SHELL: if ((xic_info != NULL) && (im_info->shell_xic != xic_info)) { unset_current_xic(xic_info, im_info, xim_info, w); xic_info = NULL; } break; case XmPER_WIDGET: if (xic_info != NULL) { unset_current_xic(xic_info, im_info, xim_info, w); xic_info = NULL; } break; default: assert(False); } /* Register an XIC with the desired input policy. */ if (xic_info == NULL) { xic_info = create_xic_info(shell, xim_info, im_info, input_policy); set_current_xic(xic_info, xim_info, w); } /* Set the values, which creates an XIC. */ set_values(w, args, num_args, input_policy); /* Return the current XIC. */ if (xic_info != NULL) { _XmAppUnlock(app); return xic_info->xic; } _XmAppUnlock(app); return NULL; } XIC XmImSetXIC(Widget widget, XIC xic) { XmImDisplayInfo xim_info; XmImShellInfo im_info; XmImXICInfo xic_info; Widget shell; _XmWidgetToAppContext(widget); _XmAppLock(app); xim_info = get_xim_info(widget); im_info = get_im_info(widget, True); xic_info = get_current_xic(xim_info, widget); if ((xim_info == NULL) || (xim_info->xim == NULL)) { _XmAppUnlock(app); return NULL; } /* This may be a simple query. */ if (xic == NULL) { /* No XIC is registered for this widget. */ if (xic_info == NULL) { _XmAppUnlock(app); return NULL; } /* Force creation of the XIC. */ if (xic_info->xic == NULL) set_values(widget, NULL, 0, XmINHERIT_POLICY); _XmAppUnlock(app); return xic_info->xic; } /* We don't support multiple IMs. */ if (XIMOfIC(xic) != xim_info->xim) { _XmAppUnlock(app); return NULL; } /* Unregister the current XIC. */ if (xic_info != NULL) { /* Setting the current XIC to itself is a no-op. */ if (xic_info->xic == xic) { _XmAppUnlock(app); return xic; } unset_current_xic(xic_info, im_info, xim_info, widget); xic_info = NULL; } /* Find the enclosing shell. */ shell = widget; while (!XtIsShell(shell)) shell = XtParent(shell); /* Get or create xic_info for this xic. */ xic_info = recreate_xic_info(xic, shell, xim_info, im_info); /* Make this the current XIC for this widget. */ set_current_xic(xic_info, xim_info, widget); _XmAppUnlock(app); return xic; } void XmImFreeXIC(Widget w, XIC context) { register int index; register XmImDisplayInfo xim_info; register XmImShellInfo im_info; register XmImXICInfo xic_info; XtAppContext app; /* Punt if insufficient information was provided. */ if (w == NULL) return; app = XtWidgetToApplicationContext(w); _XmAppLock(app); /* Locate this record. */ xim_info = get_xim_info(w); if ((xic_info = get_current_xic(xim_info, w)) == NULL) { _XmAppUnlock(app); return; } if ((im_info = get_im_info(w, False)) == NULL) { _XmAppUnlock(app); return; } if ((context != NULL) && (xic_info->xic != context)) { _XmAppUnlock(app); return; } /* Remove all references. */ index = xic_info->widget_refs.num_refs; while (--index >= 0) unset_current_xic(xic_info, im_info, xim_info, xic_info->widget_refs.refs[index]); _XmAppUnlock(app); } /********************* * Private Functions * *********************/ /* Free a VendorShellExt's im_info field. */ void _XmImFreeShellData(Widget widget, XtPointer* data) { XmImShellInfo im_info; XmImDisplayInfo xim_info; XmImXICInfo xic_info; Widget reference; if ((data == NULL) || (im_info = (XmImShellInfo) *data) == NULL) return; /* Ignore (xim_info->xim == NULL), since it is immaterial here. */ xim_info = get_xim_info(widget); if (xim_info == NULL) return; /* Remove any dangling references. */ while (im_info->iclist != NULL) { xic_info = im_info->iclist; reference = xic_info->widget_refs.refs[0]; unset_current_xic(xic_info, im_info, xim_info, reference); assert((xic_info != im_info->iclist) || (reference != xic_info->widget_refs.refs[0])); } assert(im_info->shell_xic == NULL); /* Delete the dummy widget. */ #ifdef FIX_1534 if (im_info->im_widget != NULL && !widget->core.being_destroyed) #else if (im_info->im_widget != NULL) #endif { XtDestroyWidget(im_info->im_widget); im_info->im_widget = NULL; } /* Remove this shell as a reference to the XIM. */ (void) remove_ref(&xim_info->shell_refs, widget); /* Delete the data. */ XtFree((char *) im_info); *data = NULL; } void _XmImChangeManaged( Widget vw ) { XmVendorShellExtObject ve; XmWidgetExtData extData; register int height, old_height; extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION); if (extData) { ve = (XmVendorShellExtObject) extData->widget; old_height = ve->vendor.im_height; height = ImGetGeo(vw, NULL); if (!ve->vendor.im_vs_height_set) { Arg args[1]; int base_height; XtSetArg(args[0], XtNbaseHeight, &base_height); XtGetValues(vw, args, 1); if (base_height > 0) { base_height += (height - old_height); XtSetArg(args[0], XtNbaseHeight, base_height); XtSetValues(vw, args, 1); } vw->core.height += (height - old_height); } } } void _XmImRealize( Widget vw ) { XmImXICInfo icp; Pixel bg; XmVendorShellExtObject ve; XmWidgetExtData extData; XmImShellInfo im_info; XmImDisplayInfo xim_info; xim_info = get_xim_info(vw); im_info = get_im_info(vw, False); if ((xim_info == NULL) || (im_info == NULL) || (im_info->iclist == NULL)) return; /* We need to synchronize here to make sure the server has created * the client window before the input server attempts to reparent * any windows to it */ XSync(XtDisplay(vw), False); for (icp = im_info->iclist; icp != NULL; icp = icp->next) { if (!icp->xic) continue; XSetICValues(icp->xic, XNClientWindow, XtWindow(vw), NULL); } extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION); if (extData) ve = (XmVendorShellExtObject) extData->widget; else ve = NULL; if (ve && ve->vendor.im_height == 0) { ShellWidget shell = (ShellWidget)(vw); Boolean resize = shell->shell.allow_shell_resize; if (!resize) shell->shell.allow_shell_resize = True; ImGeoReq(vw); if (!resize) shell->shell.allow_shell_resize = False; } else ImSetGeo(vw, NULL); /* For some reason we need to wait till now before we set the * initial background pixmap. */ if (ve && ve->vendor.im_height && im_info->current_widget) { XtVaGetValues(im_info->current_widget, XmNbackground, &bg, NULL); XtVaSetValues(vw, XmNbackground, bg, NULL); } } void _XmImResize( Widget vw ) { ImGetGeo(vw, NULL); ImSetGeo(vw, NULL); } void _XmImRedisplay( Widget vw ) { XmVendorShellExtObject ve; XmWidgetExtData extData; if ((extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION)) == NULL) return; ve = (XmVendorShellExtObject) extData->widget; if (ve->vendor.im_height == 0) return; draw_separator(vw); } /******************** * Static functions * ********************/ /* Locate an XmImXICInfo struct for an existing XIC. */ static XmImXICInfo recreate_xic_info(XIC xic, Widget shell, XmImDisplayInfo xim_info, XmImShellInfo im_info) { Cardinal index; XmImXICInfo xic_info; assert(xic != NULL); /* Search for an existing record in this shell's im_info. */ for (xic_info = im_info->iclist; xic_info != NULL; xic_info = xic_info->next) { if (xic_info->xic == xic) return xic_info; } /* Search for an existing record in another shell's im_info? */ for (index = 0; index < xim_info->shell_refs.num_refs; index++) if (shell != xim_info->shell_refs.refs[index]) { XmImShellInfo tmp_info = get_im_info(xim_info->shell_refs.refs[index], False); assert(tmp_info != NULL); for (xic_info = tmp_info->iclist; xic_info != NULL; xic_info = xic_info->next) { if (xic_info->xic == xic) return xic_info; } } /* This XIC must have been created by the application directly. */ xic_info = XtNew(XmImXICRec); bzero((char*) xic_info, sizeof(XmImXICRec)); (void) XGetICValues(xic, XNInputStyle, &xic_info->input_style, NULL); xic_info->next = im_info->iclist; im_info->iclist = xic_info; if (XtIsRealized (shell)) { /* If client_window hasn't been set already, set it now. */ (void) XSetICValues(xic, XNClientWindow, XtWindow(shell), NULL); /* Update cached geometry fields */ ImGetGeo(shell, xic_info); ImSetGeo(shell, xic_info); } return xic_info; } /* Attempt to create an XmImXICInfo struct. Return it or NULL. */ static XmImXICInfo create_xic_info(Widget shell, XmImDisplayInfo xim_info, XmImShellInfo im_info, #if NeedWidePrototypes unsigned int input_policy) #else XmInputPolicy input_policy) #endif /*NeedWidePrototypes*/ { XIMStyle style = 0; char tmp[BUFSIZ]; char *cp = NULL; char *tp = NULL; char *cpend = NULL; register XIMStyles *styles; XmImXICInfo xic_info; /* Determine the input style to be used for this XIC. */ styles = xim_info->styles; XtVaGetValues(shell, XmNpreeditType, &cp, NULL); if (cp != NULL) { /* Parse for the successive commas */ cp = strcpy(tmp,cp); cpend = &tmp[strlen(tmp)]; assert(strlen(tmp) < BUFSIZ); while((style == 0) && (cp < cpend)) { tp = strchr(cp,','); if (tp) *tp = 0; else tp = cpend; /* Look for an acceptable supported style. */ if (XmeNamesAreEqual(cp, OVERTHESPOT)) style = check_style(styles, XIMPreeditPosition, XIMStatusArea|XIMStatusNothing|XIMStatusNone); else if (XmeNamesAreEqual(cp, OFFTHESPOT)) style = check_style(styles, XIMPreeditArea, XIMStatusArea|XIMStatusNothing|XIMStatusNone); else if (XmeNamesAreEqual(cp, ROOT)) style = check_style(styles, XIMPreeditNothing, XIMStatusNothing|XIMStatusNone); else if (XmeNamesAreEqual(cp, ONTHESPOT)) style = check_style(styles, XIMPreeditCallbacks, XIMStatusArea|XIMStatusNothing|XIMStatusNone); cp = tp+1; } } if (style == 0) { /* Try for a fallback style, or give up and use XLookupString. */ if ((style = check_style(styles, XIMPreeditNone, XIMStatusNone)) == 0) return NULL; } /* We need to create this widget whenever there is a non-simple * input method in order to stop the intrinsics from calling * XMapSubwindows, thereby improperly mapping input method * windows which have been made children of the client or * focus windows. */ if ((im_info->im_widget == NULL) && (style & (XIMStatusArea | XIMPreeditArea | XIMPreeditPosition))) im_info->im_widget = XtVaCreateWidget("xmim_wrapper", coreWidgetClass, shell, XmNwidth, 10, XmNheight, 10, NULL); /* Create the XIC info record. */ xic_info = XtNew(XmImXICRec); bzero((char*) xic_info, sizeof(XmImXICRec)); xic_info->input_style = style; xic_info->anonymous = True; xic_info->preedit_buffer = XtNew(PreeditBufferRec); bzero((char *) xic_info->preedit_buffer, sizeof(PreeditBufferRec)); xic_info->next = im_info->iclist; im_info->iclist = xic_info; /* Setup sharing for this XIC. */ switch (input_policy) { case XmPER_SHELL: assert (im_info->shell_xic == NULL); im_info->shell_xic = xic_info; im_info->shell_xic->source = &im_info->shell_xic; break; case XmPER_WIDGET: break; case XmINHERIT_POLICY: break; default: assert(False); } return xic_info; } #define IsCallback(name) \ if (name == XrmStringToName(XmNpreeditStartCallback) || \ name == XrmStringToName(XmNpreeditDoneCallback) || \ name == XrmStringToName(XmNpreeditDrawCallback) || \ name == XrmStringToName(XmNpreeditCaretCallback)) static void set_values(Widget w, ArgList args, Cardinal num_args, #if NeedWidePrototypes unsigned int input_policy ) #else XmInputPolicy input_policy ) #endif /*NeedWidePrototypes*/ { register XmImXICInfo icp; XmImDisplayInfo xim_info; XmImResListRec *rlp; register int i, j; register ArgList argp = args; VaArgListRec status_vlist, preedit_vlist, xic_vlist; XVaNestedList va_slist, va_plist, va_vlist; XrmName name, area_name = XrmStringToName(XmNarea); Widget p; XmImShellInfo im_info; int flags = 0; Pixel bg; char *ret; unsigned long mask = 0; Boolean unrecognized = False; p = w; while (!XtIsShell(p)) p = XtParent(p); xim_info = get_xim_info(p); if ((icp = get_current_xic(xim_info, w)) == NULL) return; im_info = get_im_info(p, False); assert(im_info != NULL); if (!XtIsRealized(p)) { /* If vendor widget not realized, then the current info * is that for the last widget to set values. */ im_info->current_widget = w; } if (icp->xic && icp->focus_window && icp->focus_window != XtWindow(w)) return; bzero((char*) &status_vlist, sizeof(VaArgListRec)); bzero((char*) &preedit_vlist, sizeof(VaArgListRec)); bzero((char*) &xic_vlist, sizeof(VaArgListRec)); for (i = num_args; i > 0; i--, argp++) { name = XrmStringToName(argp->name); if (name == area_name && !(icp->input_style & XIMPreeditPosition)) continue; IsCallback(name){ if (icp->input_style & XIMPreeditCallbacks){ set_callback_values(w, argp->name, (XIMCallback *)(argp->value), &preedit_vlist, input_policy); continue; } else continue; } _XmProcessLock(); for (rlp = XmImResList, j = XtNumber(XmImResList); j != 0; j--, rlp++) { if (rlp->xrmname == name) { flags |= (*rlp->proc)(rlp->xstring, (XPointer) argp->value, &status_vlist, &preedit_vlist, &xic_vlist); break; } } _XmProcessUnlock(); if (j == 0) { /* Simply pass unrecognized values along */ VaSetArg(&xic_vlist, argp->name, (XPointer) argp->value); unrecognized = True; } } /* We do not create the IC until the initial data is ready to be passed */ assert(xim_info != NULL); if (icp->xic == NULL) { if (XtIsRealized(p)) { XSync(XtDisplay(p), False); VaSetArg(&xic_vlist, XNClientWindow, (XPointer) XtWindow(p)); } if (icp->focus_window) { VaSetArg(&xic_vlist, XNFocusWindow, (XPointer) icp->focus_window); } VaSetArg(&xic_vlist, XNInputStyle, (XPointer) icp->input_style); va_plist = VaCopy(&preedit_vlist); if (va_plist) VaSetArg(&xic_vlist, XNPreeditAttributes, (XPointer)va_plist); va_slist = VaCopy(&status_vlist); if (va_slist) VaSetArg(&xic_vlist, XNStatusAttributes, (XPointer)va_slist); va_vlist = VaCopy(&xic_vlist); if (va_vlist) { icp->xic = XCreateIC(xim_info->xim, XNVaNestedList, va_vlist, NULL); #ifdef FIX_1510 if (icp->xic == NULL) { icp->input_style = XIMPreeditNothing | XIMStatusNothing; icp->xic = XCreateIC(xim_info->xim, XNInputStyle, icp->input_style, XNClientWindow, XtWindow(p), XNFocusWindow, XtWindow(p), NULL); } #endif } else icp->xic = XCreateIC(xim_info->xim, NULL); if (va_vlist) XFree(va_vlist); if (va_plist) XFree(va_plist); if (va_slist) XFree(va_slist); if (preedit_vlist.args) XtFree((char *)preedit_vlist.args); if (status_vlist.args) XtFree((char *)status_vlist.args); if (xic_vlist.args) XtFree((char *)xic_vlist.args); if (icp->xic == NULL) { unset_current_xic(icp, im_info, xim_info, w); return; } XGetICValues(icp->xic, XNFilterEvents, &mask, NULL); if (mask) { XtAddEventHandler(p, (EventMask)mask, False, null_proc, NULL); } if (XtIsRealized(p)) { #ifdef FIX_1129 im_info->current_widget = w; #endif if (XmIsDialogShell(p)) { for (i = 0; i < ((CompositeWidget)p)->composite.num_children; i++) if (XtIsManaged(((CompositeWidget)p)->composite.children[i])) { ImGeoReq(p); break; } } else ImGeoReq(p); #ifndef FIX_1129 im_info->current_widget = w; #endif } /* Is this new XIC supposed to be shared? */ switch (input_policy) { case XmPER_SHELL: assert(im_info->shell_xic == NULL); im_info->shell_xic = icp; break; case XmPER_WIDGET: break; default: assert(False); } } else { /* Try to modify the existing XIC. */ va_plist = VaCopy(&preedit_vlist); if (va_plist) VaSetArg(&xic_vlist, XNPreeditAttributes, (XPointer)va_plist); va_slist = VaCopy(&status_vlist); if (va_slist) VaSetArg(&xic_vlist, XNStatusAttributes, (XPointer)va_slist); va_vlist = VaCopy(&xic_vlist); if (va_vlist) ret = XSetICValues(icp->xic, XNVaNestedList, va_vlist, NULL); else ret = NULL; if (va_vlist) XFree(va_vlist); if (va_plist) XFree(va_plist); if (va_slist) XFree(va_slist); if (preedit_vlist.args) XtFree((char *)preedit_vlist.args); if (status_vlist.args) XtFree((char *)status_vlist.args); if (xic_vlist.args) XtFree((char *)xic_vlist.args); /* ??? Both a write-once and an unrecognized arg might be present. */ if ((ret != NULL) && unrecognized) { unsigned long status_bg, status_fg; unsigned long preedit_bg, preedit_fg; /* ??? This code assumes that the XIM hasn't changed. */ assert(XIMOfIC(icp->xic) == xim_info->xim); /* We do this in case an input method does not support * change of some value, but does allow it to be set on * create. If however the value is not one of the * standard values, this im may not support it so we * should ignore it. */ va_slist = XVaCreateNestedList(0, XNBackground, &status_bg, XNForeground, &status_fg, NULL); va_plist = XVaCreateNestedList(0, XNBackground, &preedit_bg, XNForeground, &preedit_fg, NULL); XGetICValues(icp->xic, XNStatusAttributes, va_slist, XNPreeditAttributes, va_plist, NULL); XFree(va_slist); XFree(va_plist); if (icp->anonymous) XDestroyIC(icp->xic); icp->anonymous = TRUE; icp->xic = NULL; VaSetArg(&status_vlist, XNBackground, (XPointer) status_bg); VaSetArg(&status_vlist, XNForeground, (XPointer) status_fg); VaSetArg(&preedit_vlist, XNBackground, (XPointer) preedit_bg); VaSetArg(&preedit_vlist, XNForeground, (XPointer) preedit_fg); if (XtIsRealized(p)) { XSync(XtDisplay(p), False); VaSetArg(&xic_vlist, XNClientWindow, (XPointer) XtWindow(p)); } if (icp->focus_window) { VaSetArg(&xic_vlist, XNFocusWindow, (XPointer)icp->focus_window); } VaSetArg(&xic_vlist, XNInputStyle, (XPointer) icp->input_style); va_plist = VaCopy(&preedit_vlist); if (va_plist) VaSetArg(&xic_vlist, XNPreeditAttributes, (XPointer)va_plist); va_slist = VaCopy(&status_vlist); if (va_slist) VaSetArg(&xic_vlist, XNStatusAttributes, (XPointer)va_slist); va_vlist = VaCopy(&xic_vlist); if (va_vlist) { icp->xic = XCreateIC(xim_info->xim, XNVaNestedList, va_vlist, NULL); #ifdef FIX_1510 if (icp->xic == NULL) { icp->input_style = XIMPreeditNothing | XIMStatusNothing; icp->xic = XCreateIC(xim_info->xim, XNInputStyle, icp->input_style, XNClientWindow, XtWindow(p), XNFocusWindow, XtWindow(p), NULL); } #endif } else icp->xic = XCreateIC(xim_info->xim, NULL); if (va_vlist) XFree(va_vlist); if (va_plist) XFree(va_plist); if (va_slist) XFree(va_slist); if (preedit_vlist.args) XtFree((char *)preedit_vlist.args); if (status_vlist.args) XtFree((char *)status_vlist.args); if (xic_vlist.args) XtFree((char *)xic_vlist.args); if (icp->xic == NULL) { unset_current_xic(icp, im_info, xim_info, w); return; } ImGeoReq(p); if (icp->has_focus) XSetICFocus(icp->xic); return; } if (flags & GEO_CHG) { ImGeoReq(p); if (icp->has_focus) XSetICFocus(icp->xic); } } /* Since we do not know whether a set values may have been done * on top shadow or bottom shadow (used for the separator), we * will redraw the separator in order to keep the visuals in sync * with the current text widget. Also repaint background if needed. */ if ((im_info->current_widget == w) && (flags & BG_CHG)) { XtVaGetValues(w, XmNbackground, &bg, NULL); XtVaSetValues(p, XmNbackground, bg, NULL); } } static void ImFreePreeditBuffer(PreeditBuffer pb) { if (pb->text) XtFree((char *)pb->text); if (pb->feedback) XtFree((char *)pb->feedback); XtFree((char *)pb); } static int ImPreeditStartCallback(XIC xic, XPointer client_data, XPointer call_data) { XICProc proc; Widget real = NULL; if (!client_data){ assert(False); } proc = get_real_callback((Widget)client_data, PREEDIT_START, &real); if (proc) (*proc)(xic, (XPointer)real, call_data); return (-1); } static void ImPreeditDoneCallback(XIC xic, XPointer client_data, XPointer call_data) { XICProc proc; Widget w = (Widget)client_data; XmImShellInfo im_info; XmImXICInfo icp; Widget real = NULL; if (!client_data){ assert(False); } if ((im_info = get_im_info(w, False)) == NULL) return; if ((icp = im_info->shell_xic) == NULL) return; proc = get_real_callback((Widget)client_data, PREEDIT_DONE, &real); if (proc) (*proc)(xic, (XPointer)real, call_data); if (icp->preedit_buffer->text) XtFree((char *)icp->preedit_buffer->text); if (icp->preedit_buffer->feedback) XtFree((char *)icp->preedit_buffer->feedback); bzero((char *)icp->preedit_buffer, sizeof(PreeditBufferRec)); } static void ImPreeditDrawCallback(XIC xic, XPointer client_data, XPointer call_data) { XICProc proc; Widget w = (Widget)client_data; XmImShellInfo im_info; XmImXICInfo icp; PreeditBuffer pb; XIMText *text; XIMPreeditDrawCallbackStruct *data = (XIMPreeditDrawCallbackStruct *) call_data; int from=0, to=0, ml=0; wchar_t *wchar; Widget real = NULL; if (!client_data){ assert(False); } /* update the preedit buffer */ if ((im_info = get_im_info(w, False)) == NULL) return; if ((icp = im_info->shell_xic) == NULL) return; pb = icp->preedit_buffer; pb->caret = data->caret; text = data->text; if ((int)data->chg_length > (int)pb->length) data->chg_length = pb->length; if (data->text) { /* text field is non-NULL */ if (data->chg_length > 0) { /* replace */ if ((int)text->length > (int)data->chg_length) { pb->text = (wchar_t *) XtRealloc((char *)pb->text, (pb->length - data->chg_length + text->length + 1) * sizeof(wchar_t)); pb->feedback = (XIMFeedback *) XtRealloc((char *)pb->feedback, (pb->length - data->chg_length + text->length + 1) *sizeof(XIMFeedback)); } from = data->chg_first + data->chg_length; to = data->chg_first + text->length; ml = pb->length - from; } else if (data->chg_length == 0) { /* insert */ /* do we really need to change anything? */ if (data->text->length) { pb->text = (wchar_t *) XtRealloc((char *)pb->text, (pb->length + text->length +1) * sizeof(wchar_t)); pb->feedback = (XIMFeedback *) XtRealloc((char *)pb->feedback, (pb->length + text->length +1) * sizeof(XIMFeedback)); from = data->chg_first; to = data->chg_first + text->length; ml = pb->length - from; } } /* ** if preedit buffer changed, then we munge it, ** otherwise we just leave it alone */ if (from || to || ml) { /* convert multibyte to wide char */ wchar = (wchar_t *)XtMalloc ((text->length +1) * sizeof(wchar_t)); if (text->encoding_is_wchar) memcpy(wchar, text->string.wide_char, text->length * sizeof(wchar_t)); else mbstowcs(wchar, text->string.multi_byte, text->length + 1); /* make change */ memmove((char *)pb->text + to * sizeof(wchar_t), (char *)pb->text + from * sizeof(wchar_t), ml * sizeof(wchar_t)); memmove((char *)pb->feedback + to * sizeof(XIMFeedback), (char *)pb->feedback + from * sizeof(XIMFeedback), ml * sizeof(XIMFeedback)); memmove((char *)pb->text + data->chg_first * sizeof(wchar_t), (char *)wchar, text->length * sizeof(wchar_t)); /* feedback may be NULL, check for it */ if (text->feedback) memmove((char *)pb->feedback + data->chg_first * sizeof(XIMFeedback), (char *)text->feedback, text->length * sizeof(XIMFeedback)); pb->length = pb->length + text->length - data->chg_length; bzero((char *)pb->text + pb->length * sizeof(wchar_t), sizeof(wchar_t)); bzero((char *)pb->feedback + pb->length * sizeof(XIMFeedback), sizeof(XIMFeedback)); XtFree((char *) wchar); } } else { /* text field is NULL, delete */ from = data->chg_first + data->chg_length; to = data->chg_first; ml = pb->length - from; memmove((char *)pb->text + to * sizeof(wchar_t), (char *)pb->text + from * sizeof(wchar_t), ml * sizeof(wchar_t)); memmove((char *)pb->feedback + to * sizeof(XIMFeedback), (char *)pb->feedback + from * sizeof(XIMFeedback), ml * sizeof(XIMFeedback)); pb->length = pb->length - data->chg_length; bzero((char *)pb->text + pb->length * sizeof(wchar_t), data->chg_length * sizeof(wchar_t)); bzero((char *)pb->feedback + pb->length * sizeof(XIMFeedback), data->chg_length * sizeof(XIMFeedback)); } proc = get_real_callback((Widget)client_data, PREEDIT_DRAW, &real); if (proc) (*proc)(xic, (XPointer)real, call_data); } static void ImPreeditCaretCallback(XIC xic, XPointer client_data, XPointer call_data) { XICProc proc; Widget w = (Widget)client_data; XmImShellInfo im_info; XmImXICInfo icp; PreeditBuffer pb; XIMPreeditCaretCallbackStruct *data = (XIMPreeditCaretCallbackStruct *) call_data; Widget real = NULL; if (!client_data){ assert(False); } /* update the preedit buffer */ if ((im_info = get_im_info(w, False)) == NULL) return; if ((icp = im_info->shell_xic) == NULL) return; pb = icp->preedit_buffer; pb->style = data->style; switch (data->direction) { case XIMForwardChar: pb->caret = pb->caret + 1; break; case XIMBackwardChar: pb->caret = pb->caret - 1; break; case XIMAbsolutePosition: pb->caret = data->position; break; default: break; } proc = get_real_callback((Widget)client_data, PREEDIT_CARET, &real); if (proc) (*proc)(xic, (XPointer)real, call_data); } static XICProc get_real_callback(Widget w, int swc, Widget *real_widget) { XmImShellInfo im_info; XmImXICInfo icp; int i, target; XmImRefRec refs; if ((im_info = get_im_info(w, False)) == NULL) return (XICProc)NULL; if ((icp = im_info->shell_xic) == NULL) return (XICProc)NULL; if (*real_widget == NULL) *real_widget = XtWindowToWidget(XtDisplay(w), icp->focus_window); refs = icp->widget_refs; target = refs.num_refs; for (i = 0; i < refs.num_refs; i++){ if (refs.refs[i] == *real_widget){ target = i; break; } } if (target == refs.num_refs){ assert(False); } if (refs.callbacks[target]) return (XICProc)refs.callbacks[target][swc]; else return (XICProc)NULL; } static void regist_real_callback(Widget w, XIMProc call, int swc) { Widget p; register XmImXICInfo icp; XmImDisplayInfo xim_info; XmImRefRec refs; int i, target = 0; p = w; while (!XtIsShell(p)) { p = XtParent(p); } xim_info = get_xim_info(p); if ((icp = get_current_xic(xim_info, w)) == NULL) { return; } refs = icp->widget_refs; for (i = 0; i < refs.num_refs; i++) { if (refs.refs[i] == w) { target = i; break; } } if (!refs.callbacks[target]) refs.callbacks[target] = (XtPointer *)XtMalloc(4 * sizeof(XtPointer)); refs.callbacks[target][swc] = (XtPointer)call; } static int NameToSwitch(String name) { if (!strcmp(name, XmNpreeditStartCallback)) return PREEDIT_START; if (!strcmp(name, XmNpreeditDoneCallback)) return PREEDIT_DONE; if (!strcmp(name, XmNpreeditDrawCallback)) return PREEDIT_DRAW; if (!strcmp(name, XmNpreeditCaretCallback)) return PREEDIT_CARET; return 100; } static void set_callback_values(Widget w, String name, XIMCallback *value, VaArgList vlp, XmInputPolicy input_policy) { XIMProc call = value->callback; int s = NameToSwitch(name); XmInputPolicy ip = input_policy; Widget p =NULL; if (input_policy == XmINHERIT_POLICY){ p = w; while (!XtIsShell(p)) p = XtParent(p); XtVaGetValues(p, XmNinputPolicy, &ip, NULL); } switch (s) { case PREEDIT_START : if (ip == XmPER_SHELL){ call = value->callback; regist_real_callback(w, call, s); value->client_data = (XPointer)p; value->callback = (XIMProc) ImPreeditStartCallback; VaSetArg(vlp, XNPreeditStartCallback, (XPointer)value); } else VaSetArg(vlp, XNPreeditStartCallback, (XPointer)value); break; case PREEDIT_DONE : if (ip == XmPER_SHELL){ call = value->callback; regist_real_callback(w, call, s); value->client_data = (XPointer)p; value->callback = (XIMProc) ImPreeditDoneCallback; VaSetArg(vlp, XNPreeditDoneCallback, (XPointer)value); } else VaSetArg(vlp, XNPreeditDoneCallback, (XPointer)value); break; case PREEDIT_DRAW : if (ip == XmPER_SHELL){ call = value->callback; regist_real_callback(w, call, s); value->client_data = (XPointer)p; value->callback = (XIMProc) ImPreeditDrawCallback; VaSetArg(vlp, XNPreeditDrawCallback, (XPointer)value); } else VaSetArg(vlp, XNPreeditDrawCallback, (XPointer)value); break; case PREEDIT_CARET : if (ip == XmPER_SHELL){ call = value->callback; regist_real_callback(w, call, s); value->client_data = (XPointer)p; value->callback = (XIMProc) ImPreeditCaretCallback; VaSetArg(vlp, XNPreeditCaretCallback, (XPointer)value); } else VaSetArg(vlp, XNPreeditCaretCallback, (XPointer)value); break; default : assert(False); } } static void move_preedit_string(XmImXICInfo icp, Widget wfrom, Widget wto) { PreeditBuffer pb = icp->preedit_buffer; XIMPreeditDrawCallbackStruct draw_data; XIMText text; XICProc proc; proc = get_real_callback(wfrom, PREEDIT_DONE, &wfrom); if (proc) (*proc)(icp->xic, (XPointer)wfrom, NULL); proc = get_real_callback(wto, PREEDIT_START, &wto); if (proc) (*proc)(icp->xic, (XPointer)wto, NULL); if (pb->length == 0) return; draw_data.caret = pb->caret; draw_data.chg_first = 0; draw_data.chg_length = 0; text.length = pb->length; text.feedback = pb->feedback; text.encoding_is_wchar = True; text.string.wide_char = pb->text; draw_data.text = &text; proc = get_real_callback(wto, PREEDIT_DRAW, &wto); if (proc) (*proc)(icp->xic, (XPointer)wto, (XPointer)&draw_data); } /*ARGSUSED*/ static int add_sp(String name, XPointer value, VaArgList slp, VaArgList plp, VaArgList vlp ) /* unused */ { VaSetArg(slp, name, value); VaSetArg(plp, name, value); return BG_CHG; } /*ARGSUSED*/ static int add_p(String name, XPointer value, VaArgList slp, /* unused */ VaArgList plp, VaArgList vlp ) /* unused */ { VaSetArg(plp, name, value); return 0; } /*ARGSUSED*/ static int add_fs(String name, XPointer value, VaArgList slp, VaArgList plp, VaArgList vlp ) /* unused */ { XFontSet fs; if ( (fs = extract_fontset((XmFontList)value)) == NULL) return 0; VaSetArg(slp, name, (XPointer) fs); VaSetArg(plp, name, (XPointer) fs); return GEO_CHG; } static int add_bgpxmp(String name, XPointer value, VaArgList slp, VaArgList plp, VaArgList vlp ) { if ( (Pixmap)value == XtUnspecifiedPixmap ) return 0; return add_sp( name, value, slp, plp, vlp ); } static XIMStyle check_style(XIMStyles *styles, XIMStyle preedit_style, XIMStyle status_style ) { register int i; /* Is this preedit & status style combination supported? */ for (i=0; i < (int) styles->count_styles; i++) { if ((styles->supported_styles[i] & preedit_style) && (styles->supported_styles[i] & status_style)) return styles->supported_styles[i]; } return 0; } /* if this_icp is non-null, operations will only be performed on the corresponding IC. (Basically disables looping) */ static int ImGetGeo(Widget vw, XmImXICInfo this_icp ) { XmImXICInfo icp; XmVendorShellExtObject ve; XmWidgetExtData extData; int height = 0; XRectangle rect; XRectangle *rp; XmImShellInfo im_info; XVaNestedList set_list, get_list; extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION); if (extData) ve = (XmVendorShellExtObject) extData->widget; else ve = NULL; im_info = get_im_info(vw, False); if (ve && ((im_info == NULL) || (im_info->iclist == NULL))) { ve->vendor.im_height = 0; return 0; } set_list = XVaCreateNestedList(0, XNAreaNeeded, (XPointer) &rect, NULL); get_list = XVaCreateNestedList(0, XNAreaNeeded, (XPointer) &rp, NULL); for (icp = this_icp ? this_icp : im_info->iclist; icp != NULL; icp = icp->next) { if (icp->xic) { if (icp->input_style & XIMStatusArea) { rect.width = vw->core.width; rect.height = 0; XSetICValues(icp->xic, XNStatusAttributes, set_list, NULL); XGetICValues(icp->xic, XNStatusAttributes, get_list, NULL); if ((int) rp->height > height) height = rp->height; icp->status_width = MIN(rp->width, vw->core.width); icp->sp_height = rp->height; XFree(rp); } if (icp->input_style & XIMPreeditArea) { rect.width = vw->core.width; rect.height = 0; XSetICValues(icp->xic, XNPreeditAttributes, set_list, NULL); XGetICValues(icp->xic, XNPreeditAttributes, get_list, NULL); if ((int) rp->height > height) height = rp->height; icp->preedit_width = MIN((int) rp->width, (int) (vw->core.width - icp->status_width)); if (icp->sp_height < (int) rp->height) icp->sp_height = rp->height; XFree(rp); } } if (this_icp) break; } XFree(set_list); XFree(get_list); if (height) height += SEPARATOR_HEIGHT; if (ve) ve->vendor.im_height = height; return height; } /* if this_icp is non-null, operations will only be performed on the corresponding IC. (Basically disables looping) */ static void ImSetGeo(Widget vw, XmImXICInfo this_icp ) { XmVendorShellExtObject ve; XmWidgetExtData extData; register XmImXICInfo icp; XRectangle rect_status; XRectangle rect_preedit; XmImShellInfo im_info; XVaNestedList va_slist, va_plist; unsigned long use_slist, use_plist; im_info = get_im_info(vw, False); if ((im_info == NULL) || (im_info->iclist == NULL)) return; extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION); if (!extData) return; ve = (XmVendorShellExtObject) extData->widget; if (ve->vendor.im_height == 0) return; va_slist = XVaCreateNestedList(0, XNArea, &rect_status, NULL); va_plist = XVaCreateNestedList(0, XNArea, &rect_preedit, NULL); for (icp = this_icp ? this_icp : im_info->iclist; icp != NULL; icp = icp->next) { if ((use_slist = (icp->input_style & XIMStatusArea)) != 0) { rect_status.x = 0; rect_status.y = vw->core.height - icp->sp_height; rect_status.width = icp->status_width; rect_status.height = icp->sp_height; } if ((use_plist = (icp->input_style & XIMPreeditArea)) != 0) { rect_preedit.x = icp->status_width; rect_preedit.y = vw->core.height - icp->sp_height; rect_preedit.width = icp->preedit_width; rect_preedit.height = icp->sp_height; } else if ((use_plist = (icp->input_style & XIMPreeditPosition)) != 0) { unsigned int margin; #ifdef FIX_1129 /* * im_info->current_widget can contains NULL, * for example, when widget having XIC focus is disposed. * Thus, we should check this and avoid dereferencing NULL pointer. */ if (im_info->current_widget == NULL) break; #endif margin = ((XmPrimitiveWidget)im_info->current_widget) ->primitive.shadow_thickness + ((XmPrimitiveWidget)im_info->current_widget) ->primitive.highlight_thickness; rect_preedit.width = MIN(icp->preedit_width, XtWidth(im_info->current_widget) - 2*margin); rect_preedit.height = MIN(icp->sp_height, XtHeight(im_info->current_widget) - 2*margin); } if (use_slist && use_plist) XSetICValues(icp->xic, XNStatusAttributes, va_slist, XNPreeditAttributes, va_plist, NULL); else if (use_slist) XSetICValues(icp->xic, XNStatusAttributes, va_slist, NULL); else if (use_plist) XSetICValues(icp->xic, XNPreeditAttributes, va_plist, NULL); if (this_icp) break; } XFree(va_slist); XFree(va_plist); } static void ImGeoReq(Widget vw ) { XmVendorShellExtObject ve; XmWidgetExtData extData; XtWidgetGeometry my_request; int old_height; int delta_height; ShellWidget shell = (ShellWidget)(vw); if (!(shell->shell.allow_shell_resize) && XtIsRealized(vw)) return; extData = _XmGetWidgetExtData(vw, XmSHELL_EXTENSION); if (!extData) return; ve = (XmVendorShellExtObject) extData->widget; old_height = ve->vendor.im_height; ImGetGeo(vw, NULL); if ((delta_height = ve->vendor.im_height - old_height) != 0) { int base_height; Arg args[1]; XtSetArg(args[0], XtNbaseHeight, &base_height); XtGetValues(vw, args, 1); if (base_height > 0) { base_height += delta_height; XtSetArg(args[0], XtNbaseHeight, base_height); XtSetValues(vw, args, 1); } my_request.height = vw->core.height + delta_height; my_request.request_mode = CWHeight; XtMakeGeometryRequest(vw, &my_request, NULL); } ImSetGeo(vw, NULL); } static XFontSet extract_fontset( XmFontList fl ) { XmFontContext context; XmFontListEntry next_entry; XmFontType type_return; XtPointer tmp_font; XFontSet first_fs = NULL; char *font_tag = NULL; if (!XmFontListInitFontContext(&context, fl)) return NULL; do { next_entry = XmFontListNextEntry(context); if (next_entry) { tmp_font = XmFontListEntryGetFont(next_entry, &type_return); if (type_return == XmFONT_IS_FONTSET) { font_tag = XmFontListEntryGetTag(next_entry); if (!strcmp(font_tag, XmFONTLIST_DEFAULT_TAG)) { XmFontListFreeFontContext(context); if (font_tag) XtFree(font_tag); return (XFontSet)tmp_font; } if (font_tag) XtFree(font_tag); if (first_fs == NULL) first_fs = (XFontSet)tmp_font; } } } while (next_entry); XmFontListFreeFontContext(context); return first_fs; } /* Fetch (creating if necessary) the Display's xmim_info. */ static XmImDisplayInfo get_xim_info(Widget widget) { XmDisplay xmDisplay; char tmp[BUFSIZ]; char *cp = NULL; XmImDisplayInfo xim_info; String name, w_class; Display *dpy; Widget shell; if (widget == NULL) return NULL; /* Find the parent shell. */ shell = widget; while (!XtIsShell(shell)) shell = XtParent(shell); dpy = XtDisplay(shell); xmDisplay = (XmDisplay) XmGetXmDisplay(dpy); xim_info = (XmImDisplayInfo)xmDisplay->display.xmim_info; /* If this is a simple lookup we're done. */ if (xim_info != NULL) return xim_info; /* Create a record so that we only try XOpenIM() once. */ xim_info = XtNew(XmImDisplayRec); bzero((char*) xim_info, sizeof(XmImDisplayRec)); xmDisplay->display.xmim_info = (XtPointer)xim_info; /* Setup any specified locale modifiers. */ XtVaGetValues(shell, XmNinputMethod, &cp, NULL); if (cp != NULL) { strcpy(tmp,"@im="); strcat(tmp,cp); assert(strlen(tmp) < BUFSIZ); XSetLocaleModifiers(tmp); } XtGetApplicationNameAndClass(dpy, &name, &w_class); /* Try to open the input method. */ xim_info->xim = XOpenIM(dpy, XtDatabase(dpy), name, w_class); if (xim_info->xim == NULL) { #ifdef XOPENIM_WARNING /* Generate a warning if XOpenIM was supposed to work. */ /* Use the WMShell's XmNtitleEncoding as a shibboleth. */ Atom encoding = (Atom) 0; XtVaGetValues(shell, XmNtitleEncoding, &encoding, NULL); if (encoding != XA_STRING) XmeWarning ((Widget)widget, MSG1); #endif /* Leave the null xim_info attached to the display so we only */ /* print the warning message once. */ return xim_info; } /* Lookup the styles this input method supports. */ if (XGetIMValues(xim_info->xim, XNQueryInputStyle, &xim_info->styles, NULL) != NULL) { XCloseIM(xim_info->xim); xim_info->xim = NULL; XmeWarning ((Widget)widget, MSG1); return xim_info; } /* Initialize the list of xrm names */ { XmImResListRec *rlp; register int i; _XmProcessLock(); for (rlp = XmImResList, i = XtNumber(XmImResList); i != 0; i--, rlp++) rlp->xrmname = XrmStringToName(rlp->xmstring); _XmProcessUnlock(); } return xim_info; } static XtPointer* get_im_info_ptr(Widget w, Boolean create) { Widget p; XmVendorShellExtObject ve; XmWidgetExtData extData; XmImShellInfo im_info; XmImDisplayInfo xim_info; if (w == NULL) return NULL; p = w; while (!XtIsShell(p)) p = XtParent(p); /* Check extension data since app could be attempting to create * a text widget as child of menu shell. This is illegal, and will * be detected later, but check here so we don't core dump. */ if ((extData = _XmGetWidgetExtData((Widget)p, XmSHELL_EXTENSION)) == NULL) return NULL; ve = (XmVendorShellExtObject) extData->widget; if ((ve->vendor.im_info == NULL) && create) { im_info = XtNew(XmImShellRec); bzero((char*) im_info, sizeof(XmImShellRec)); ve->vendor.im_info = (XtPointer)im_info; xim_info = get_xim_info(p); (void) add_ref(&xim_info->shell_refs, p); } return &ve->vendor.im_info; } static XmImShellInfo get_im_info(Widget w, Boolean create) { XmImShellInfo* ptr = (XmImShellInfo *) get_im_info_ptr(w, create); if (ptr != NULL) return *ptr; else return NULL; } static void draw_separator(Widget vw ) { XmPrimitiveWidget pw; XmVendorShellExtObject ve; XmWidgetExtData extData; XmImShellInfo im_info; extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION); if (!extData) return; ve = (XmVendorShellExtObject) extData->widget; if ((im_info = (XmImShellInfo)ve->vendor.im_info) == NULL) return; pw = (XmPrimitiveWidget)im_info->current_widget; if (!pw || !XmIsPrimitive(pw)) return; XmeDrawSeparator(XtDisplay(vw), XtWindow(vw), pw->primitive.top_shadow_GC, pw->primitive.bottom_shadow_GC, 0, 0, vw->core.height - ve->vendor.im_height, vw->core.width, SEPARATOR_HEIGHT, SEPARATOR_HEIGHT, 0, /* separator.margin */ XmHORIZONTAL, /* separator.orientation */ XmSHADOW_ETCHED_IN); /* separator.separator_type */ } /*ARGSUSED*/ static void null_proc(Widget w, /* unused */ XtPointer ptr, /* unused */ XEvent *ev, /* unused */ Boolean *b ) /* unused */ { /* This function does nothing. It is only there to allow the * event mask required by the input method to be added to * the client window. */ } /* The following section contains the varargs functions */ /*VARARGS*/ void XmImVaSetFocusValues(Widget w, ... ) { va_list var; int total_count; ArgList args; _XmWidgetToAppContext(w); _XmAppLock(app); Va_start(var,w); ImCountVaList(var, &total_count); va_end(var); Va_start(var,w); args = ImCreateArgList(var, total_count); va_end(var); XmImSetFocusValues(w, args, total_count); XtFree((char *)args); _XmAppUnlock(app); } /*VARARGS*/ void XmImVaSetValues(Widget w, ... ) { va_list var; int total_count; ArgList args; _XmWidgetToAppContext(w); _XmAppLock(app); Va_start(var,w); ImCountVaList(var, &total_count); va_end(var); Va_start(var,w); args = ImCreateArgList(var, total_count); va_end(var); XmImSetValues(w, args, total_count); XtFree((char *)args); _XmAppUnlock(app); } static void ImCountVaList(va_list var, int *total_count ) { String attr; *total_count = 0; for(attr = va_arg(var, String); attr != NULL; attr = va_arg(var, String)) { (void) va_arg(var, XPointer); ++(*total_count); } } static ArgList ImCreateArgList(va_list var, int total_count ) { ArgList args = (ArgList)XtCalloc(total_count, sizeof(Arg)); register int i; assert(args || (total_count == 0)); for (i = 0; i < total_count; i++) { args[i].name = va_arg(var,String); args[i].value = (XtArgVal)va_arg(var,XPointer); } return args; } /* Return the current xic info for a widget, or NULL. */ static XmImXICInfo get_current_xic(XmImDisplayInfo xim_info, Widget widget) { XmImXICInfo xic_info; if ((xim_info == NULL) || (xim_info->current_xics == (XContext) 0)) return NULL; if (XFindContext(XtDisplay(widget), (XID) widget, xim_info->current_xics, (XPointer*) &xic_info) != 0) return NULL; else return xic_info; } /* Set the current XIC for an unregistered widget. */ static void set_current_xic(XmImXICInfo xic_info, XmImDisplayInfo xim_info, Widget widget) { if (xic_info == NULL) return; /* Record this widget as a reference to this XIC. */ (void) add_ref(&xic_info->widget_refs, widget); /* Set the current XIC for this widget. */ if (xim_info->current_xics == (XContext) NULL) xim_info->current_xics = XUniqueContext(); (void) XSaveContext(XtDisplay(widget), (XID) widget, xim_info->current_xics, (XPointer) xic_info); } /* Unset the current XIC for a widget, freeing data as necesary. */ static void unset_current_xic(XmImXICInfo xic_info, XmImShellInfo im_info, XmImDisplayInfo xim_info, Widget widget) { /* Remove the current xic for this widget. */ assert(xim_info->current_xics != (XContext) 0); (void) XDeleteContext(XtDisplay(widget), (XID) widget, xim_info->current_xics); #ifdef FIX_1196 if (im_info->current_widget == widget) im_info->current_widget = NULL; #endif /* Remove this widget as a reference to this XIC. */ if (remove_ref(&xic_info->widget_refs, widget) == 0) { /* Remove this xic_info from the master list. */ XmImXICInfo *ptr; for (ptr = &(im_info->iclist); *ptr != NULL; ptr = &((*ptr)->next)) if (*ptr == xic_info) { *ptr = xic_info->next; break; } #ifndef FIX_1196 if (im_info->current_widget == widget) im_info->current_widget = NULL; #endif /* Don't let anyone share this XIC. */ if (xic_info->source != NULL) *(xic_info->source) = NULL; /* Destroy the XIC */ if ((xic_info->anonymous) && (xic_info->xic != NULL)) XDestroyIC(xic_info->xic); ImFreePreeditBuffer (xic_info->preedit_buffer); XtFree((char *) xic_info); } } /* Add a widget to a list of references. */ static Cardinal add_ref(XmImRefInfo refs, Widget widget) { #ifdef DEBUG /* Verify that we don't already have a reference. */ register Cardinal index; for (index = 0; index < refs->num_refs; index++) assert(refs->refs[index] != widget); #endif /* Make room in the array. */ if (refs->num_refs == refs->max_refs) { if (refs->max_refs == 0) refs->max_refs = 10; else refs->max_refs += (refs->max_refs / 2); refs->refs = (Widget*) XtRealloc((char *) refs->refs, refs->max_refs * sizeof(Widget)); refs->callbacks = (XtPointer **) XtRealloc((char *) refs->callbacks, refs->max_refs * sizeof(XtPointer *)); } assert(refs->num_refs < refs->max_refs); refs->callbacks[refs->num_refs] = NULL; /* Insert this reference. */ refs->refs[refs->num_refs++] = widget; return refs->num_refs; } /* Remove a widget from a list of references. */ static Cardinal remove_ref(XmImRefInfo refs, Widget widget) { /* Is this the last reference? */ refs->num_refs--; if (refs->num_refs > 0) { /* Just remove this reference. */ int index = 0; while (index <= refs->num_refs) { if (refs->refs[index] == widget) { refs->refs[index] = refs->refs[refs->num_refs]; refs->refs[refs->num_refs] = NULL; XtFree((char *)refs->callbacks[index]); refs->callbacks[index] = refs->callbacks[refs->num_refs]; refs->callbacks[refs->num_refs] = NULL; break; } index++; } /* Free some storage from the array? */ if ((refs->num_refs * 3 < refs->max_refs) && (refs->max_refs >= 20)) { refs->max_refs /= 2; refs->refs = (Widget*) XtRealloc((char *) refs->refs, refs->max_refs * sizeof(Widget)); refs->callbacks = (XtPointer **) XtRealloc((char *) refs->callbacks, refs->max_refs * sizeof(XtPointer *)); } } else { /* Free the references array. */ XtFree((char *) refs->refs); refs->refs = NULL; XtFree((char *) refs->callbacks[0]); XtFree((char *) refs->callbacks); refs->callbacks = NULL; refs->max_refs = 0; } return refs->num_refs; } /* Convert a VaArgList into a true XVaNestedList. */ static XVaNestedList VaCopy(VaArgList list) { /* This is ugly, but it's a legal way to construct a nested */ /* list whose length is unknown at compile time. If MAXARGS is */ /* increased more parameter pairs should be added below. A */ /* recursive approach would leak memory. */ register Cardinal count = list->count; register VaArg *args = list->args; #define VA_NAME(index) (index < count ? args[index].name : NULL) #define VA_VALUE(index) (index < count ? args[index].value : NULL) assert(count <= 10); return XVaCreateNestedList(0, VA_NAME(0), VA_VALUE(0), VA_NAME(1), VA_VALUE(1), VA_NAME(2), VA_VALUE(2), VA_NAME(3), VA_VALUE(3), VA_NAME(4), VA_VALUE(4), VA_NAME(5), VA_VALUE(5), VA_NAME(6), VA_VALUE(6), VA_NAME(7), VA_VALUE(7), VA_NAME(8), VA_VALUE(8), VA_NAME(9), VA_VALUE(9), NULL); #undef VA_NAME #undef VA_VALUE } static void VaSetArg(VaArgList list, char *name, XPointer value) { if (list->max <= list->count) { list->max += 10; list->args = (VaArg*) XtRealloc((char*) list->args, list->max * sizeof(VaArg)); } list->args[list->count].name = name; list->args[list->count].value = value; list->count++; } void XmImMbResetIC( Widget w, char **mb) { register XmImXICInfo icp; _XmWidgetToAppContext(w); _XmAppLock(app); *mb = NULL; if ((icp = get_current_xic(get_xim_info(w), w)) == NULL || icp->xic == NULL) { _XmAppUnlock(app); return; } if (!(icp->input_style & XIMPreeditCallbacks)) { _XmAppUnlock(app); return; } *mb = XmbResetIC(icp->xic); _XmAppUnlock(app); } XIMResetState XmImGetXICResetState(Widget w) { XmImXICInfo icp; XIMResetState state = XIMInitialState; icp = get_current_xic(get_xim_info(w), w); if (icp != NULL && icp->xic != NULL) XGetICValues(icp->xic, XNResetState, &state, NULL); return state; } motif-2.3.8/lib/Xm/TearOff.c0000644000175000017500000012257213145162623012423 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TearOff.c /main/15 1997/08/21 14:19:26 csn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* for bzero */ #include "MenuStateI.h" #include "MenuUtilI.h" #include "RCMenuI.h" #include "RowColumnI.h" #include "ScreenI.h" #include "TearOffI.h" #include "TraversalI.h" #include "XmI.h" #define IsPopup(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_POPUP) #define IsPulldown(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_PULLDOWN) #define IsOption(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_OPTION) #define IsBar(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_BAR) /* Bury these here for now - not spec'd for 1.2, maybe for 1.3? */ #define CREATE_TEAR_OFF 0 #define RESTORE_TEAR_OFF_TO_TOPLEVEL_SHELL 1 #define RESTORE_TEAR_OFF_TO_MENUSHELL 2 #define DESTROY_TEAR_OFF 3 #define OUTLINE_WIDTH 2 #define SEGS_PER_DRAW (4*OUTLINE_WIDTH) /******** Static Function Declarations ********/ static GC InitXmTearOffXorGC( Widget wid) ; static void SetupOutline( Widget wid, GC gc, XSegment pOutline[], XEvent *event, Dimension delta_x, Dimension delta_y ) ; static void EraseOutline( Widget wid, GC gc, XSegment *pOutline) ; static void MoveOutline( Widget wid, GC gc, XSegment *pOutline, XEvent *event, Dimension delta_x, Dimension delta_y ) ; static void PullExposureEvents( Widget wid ) ; static void MoveOpaque( Widget wid, XEvent *event, Dimension delta_x, Dimension delta_y ) ; static void GetConfigEvent( Display *display, Window window, unsigned long mask, XEvent *event) ; static Cursor GetTearOffCursor( Widget wid) ; static Boolean DoPlacement( Widget wid, XEvent *event) ; static void CallTearOffMenuActivateCallback( Widget wid, XEvent *event, #if NeedWidePrototypes int origin) ; #else unsigned short origin) ; #endif /*NeedWidePrototypes */ static void CallTearOffMenuDeactivateCallback( Widget wid, XEvent *event, #if NeedWidePrototypes int origin) ; #else unsigned short origin) ; #endif /*NeedWidePrototypes */ static void RemoveTearOffEventHandlers( Widget wid ) ; static void DismissOnPostedFromDestroy( Widget w, XtPointer clientData, XtPointer callData ) ; static void DisplayDestroyCallback ( Widget w, XtPointer client_data, XtPointer call_data ); /******** End Static Function Declarations ********/ static GC InitXmTearOffXorGC( Widget wid ) { XGCValues gcv; XtGCMask mask; mask = GCFunction | GCLineWidth | GCSubwindowMode | GCCapStyle; gcv.function = GXinvert; gcv.line_width = 0; gcv.cap_style = CapNotLast; gcv.subwindow_mode = IncludeInferiors; return (XCreateGC (XtDisplay(wid), wid->core.screen->root, mask, &gcv)); } static void SetupOutline( Widget wid, GC gc, XSegment pOutline[], XEvent *event, Dimension delta_x, Dimension delta_y) { Position x, y; Dimension w, h; int n = 0; int i; x = event->xbutton.x_root - delta_x; y = event->xbutton.y_root - delta_y; w = wid->core.width; h = wid->core.height; for(i=0; icore.screen->root, gc, pOutline, SEGS_PER_DRAW); } static void EraseOutline( Widget wid, GC gc, XSegment *pOutline ) { XDrawSegments(XtDisplay(wid), wid->core.screen->root, gc, pOutline, SEGS_PER_DRAW); } static void MoveOutline( Widget wid, GC gc, XSegment *pOutline, XEvent *event, Dimension delta_x, Dimension delta_y ) { EraseOutline(wid, gc, pOutline); SetupOutline(wid, gc, pOutline, event, delta_x, delta_y); } static void PullExposureEvents( Widget wid ) { XEvent event; /* * Force the exposure events into the queue */ XSync (XtDisplay(wid), False); /* * Selectively extract the exposure events */ while (XCheckMaskEvent (XtDisplay(wid), ExposureMask, &event)) { /* * Dispatch widget related event: */ XtDispatchEvent (&event); } } static void MoveOpaque( Widget wid, XEvent *event, Dimension delta_x, Dimension delta_y ) { /* Move the MenuShell */ XMoveWindow(XtDisplay(wid), XtWindow(XtParent(wid)), event->xbutton.x_root - delta_x, event->xbutton.y_root - delta_y); /* cleanup exposed frame parts */ PullExposureEvents (wid); } #define CONFIG_GRAB_MASK (ButtonPressMask|ButtonReleaseMask|\ PointerMotionMask|PointerMotionHintMask|\ KeyPress|KeyRelease) #define POINTER_GRAB_MASK (ButtonPressMask|ButtonReleaseMask|\ PointerMotionMask|PointerMotionHintMask) static void GetConfigEvent( Display *display, Window window, unsigned long mask, XEvent *event ) { Window root_ret, child_ret; int root_x, root_y, win_x, win_y; unsigned int mask_ret; /* Block until a motion, button, or key event comes in */ XWindowEvent(display, window, mask, event); if (event->type == MotionNotify && event->xmotion.is_hint == NotifyHint) { /* * "Ack" the motion notify hint */ if ((XQueryPointer (display, window, &root_ret, &child_ret, &root_x, &root_y, &win_x, &win_y, &mask_ret))) { /* * The query pointer values say that the pointer * moved to a new location. */ event->xmotion.window = root_ret; event->xmotion.subwindow = child_ret; event->xmotion.x = root_x; event->xmotion.y = root_y; event->xmotion.x_root = root_x; event->xmotion.y_root = root_y; } } } /*ARGSUSED*/ static void DisplayDestroyCallback ( Widget w, XtPointer client_data, XtPointer call_data ) /* unused */ { XFreeCursor(XtDisplay(w), (Cursor)client_data); } static Cursor GetTearOffCursor( Widget wid ) { XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Cursor TearOffCursor = ((XmDisplayInfo *)(dd->display.displayInfo))->TearOffCursor; if (0L == TearOffCursor) { /* create some data shared among all instances on this ** display; the first one along can create it, and ** any one can remove it; note no reference count */ TearOffCursor = XCreateFontCursor(XtDisplay(wid), XC_fleur); if (0L == TearOffCursor) TearOffCursor = XmGetMenuCursor(XtDisplay(wid)); else XtAddCallback((Widget)dd, XtNdestroyCallback, DisplayDestroyCallback,(XtPointer)TearOffCursor); ((XmDisplayInfo *)(dd->display.displayInfo))->TearOffCursor = TearOffCursor; } return TearOffCursor; } static Boolean DoPlacement( Widget wid, XEvent *event ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid; XSegment outline[SEGS_PER_DRAW]; Boolean placementDone; KeyCode *KCancel; KeySym keysym = osfXK_Cancel; int num_keys, index; XmKeyBinding keys; Boolean moveOpaque = False; Dimension delta_x, delta_y; Dimension old_x_root = 0; Dimension old_y_root = 0; GC tearoffGC; /* Determine which keycodes are bound to osfXK_Cancel. */ num_keys = XmeVirtualToActualKeysyms(XtDisplay(rc), keysym, &keys); KCancel = (KeyCode*) XtMalloc(num_keys * sizeof(KeyCode)); for (index = 0; index < num_keys; index++) KCancel[index] = XKeysymToKeycode(XtDisplay(rc), keys[index].keysym); XtFree((char*) keys); /* Regrab the pointer and keyboard to the root window. Grab in Async * mode to free up the input queues. */ XGrabPointer(XtDisplay(rc), rc->core.screen->root, FALSE, (unsigned int)POINTER_GRAB_MASK, GrabModeAsync, GrabModeAsync, rc->core.screen->root, GetTearOffCursor(wid), CurrentTime); XGrabKeyboard(XtDisplay(rc), rc->core.screen->root, FALSE, GrabModeAsync, GrabModeAsync, CurrentTime); tearoffGC = InitXmTearOffXorGC((Widget)rc); delta_x = event->xbutton.x_root - XtX(XtParent(rc)); delta_y = event->xbutton.y_root - XtY(XtParent(rc)); moveOpaque = _XmGetMoveOpaqueByScreen(XtScreen(rc)); /* Set up a dummy event of the menu's current position in case the * move-opaque is cancelled. */ if (moveOpaque) { old_x_root = XtX(XtParent(rc)); old_y_root = XtY(XtParent(rc)); MoveOpaque((Widget)rc, event, delta_x, delta_y); } else SetupOutline((Widget)rc, tearoffGC, outline, event, delta_x, delta_y); placementDone = FALSE; while (!placementDone) { GetConfigEvent (XtDisplay(rc), rc->core.screen->root, CONFIG_GRAB_MASK, event); /* ok to overwrite event? */ switch (event->type) { case ButtonRelease: if (event->xbutton.button == /*BDrag */ 2) { if (!moveOpaque) EraseOutline((Widget)rc, tearoffGC, outline); else /* Signal next menushell post to reposition */ XtX(XtParent(rc)) = XtY(XtParent(rc)) = 0; placementDone = TRUE; event->xbutton.x_root -= delta_x; event->xbutton.y_root -= delta_y; } break; case MotionNotify: if (moveOpaque) MoveOpaque((Widget)rc, event, delta_x, delta_y); else MoveOutline((Widget)rc, tearoffGC, outline, event, delta_x, delta_y); break; case KeyPress: /* Shouldn't we be checking modifiers too??? */ for (index = 0; index < num_keys; index++) if (event->xkey.keycode == KCancel[index]) { if (!moveOpaque) EraseOutline((Widget)rc, tearoffGC, outline); else { event->xbutton.x_root = old_x_root; event->xbutton.y_root = old_y_root; MoveOpaque((Widget)rc, event, 0, 0); } XtFree((char*) KCancel); return(FALSE); } break; } } XFreeGC(XtDisplay(rc), tearoffGC); XUngrabKeyboard(XtDisplay(rc), CurrentTime); XUngrabPointer(XtDisplay(rc), CurrentTime); XtFree((char*) KCancel); return (TRUE); } static void CallTearOffMenuActivateCallback( Widget wid, XEvent *event, #if NeedWidePrototypes int origin ) #else unsigned short origin ) #endif /*NeedWidePrototypes */ { XmRowColumnWidget rc = (XmRowColumnWidget) wid; XmRowColumnCallbackStruct callback; if (!rc->row_column.tear_off_activated_callback) return; callback.reason = XmCR_TEAR_OFF_ACTIVATE; callback.event = event; callback.widget = NULL; /* these next two fields are spec'd NULL */ callback.data = (char *)(unsigned long) origin; callback.callbackstruct = NULL; XtCallCallbackList ((Widget)rc, rc->row_column.tear_off_activated_callback, &callback); } static void CallTearOffMenuDeactivateCallback( Widget wid, XEvent *event, #if NeedWidePrototypes int origin ) #else unsigned short origin ) #endif /*NeedWidePrototypes */ { XmRowColumnWidget rc = (XmRowColumnWidget) wid; XmRowColumnCallbackStruct callback; if (!rc->row_column.tear_off_deactivated_callback) return; callback.reason = XmCR_TEAR_OFF_DEACTIVATE; callback.event = event; callback.widget = NULL; /* these next two fields are spec'd NULL */ callback.data = (char *)(unsigned long) origin; callback.callbackstruct = NULL; XtCallCallbackList ((Widget) rc, rc->row_column.tear_off_deactivated_callback, &callback); } /* * This event handler is added to label widgets and separator widgets inside * a tearoff menu pane. This enables the RowColumn to watch for the button * presses inside these widgets and to 'do the right thing'. */ /*ARGSUSED*/ void _XmTearOffBtnDownEventHandler( Widget reportingWidget, XtPointer data, /* unused */ XEvent *event, Boolean *cont ) { Widget parent; if (reportingWidget) { /* make sure only called for widgets inside a menu rowcolumn */ if ((XmIsRowColumn(parent = XtParent(reportingWidget))) && (RC_Type(parent) != XmWORK_AREA)) { _XmMenuBtnDown (parent, event, NULL, 0); } } *cont = True; } /*ARGSUSED*/ void _XmTearOffBtnUpEventHandler( Widget reportingWidget, XtPointer data, /* unused */ XEvent *event, Boolean *cont ) { Widget parent; if (reportingWidget) { /* make sure only called for widgets inside a menu rowcolumn */ if ((XmIsRowColumn(parent = XtParent(reportingWidget))) && (RC_Type(parent) != XmWORK_AREA)) { _XmMenuBtnUp (parent, event, NULL, 0); } } *cont = True; } void _XmAddTearOffEventHandlers( Widget wid ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid; Widget child; int i; Cursor cursor = XmGetMenuCursor(XtDisplay(wid)); XmMenuSavvyTrait mtrait; for (i=0; i < rc->composite.num_children; i++) { child = rc->composite.children[i]; mtrait = (XmMenuSavvyTrait) XmeTraitGet(XtClass(child), XmQTmenuSavvy); /* * The label and separator widgets do not care about * button presses. Add an event handler for these widgets * so that the tearoff RowColumn is alerted about presses in * these widgets. * * This now determines the right widgets to install the * handlers on by using the MenuSavvy trait. If the * widget can't supply an activateCB name, then it is * assumed that the widget isn't activatable. * */ if (! XmIsGadget(child) && (mtrait == (XmMenuSavvyTrait) NULL || mtrait -> getActivateCBName == (XmMenuSavvyGetActivateCBNameProc) NULL)) { XtAddEventHandler(child, ButtonPressMask, False, _XmTearOffBtnDownEventHandler, NULL); XtAddEventHandler(child, ButtonReleaseMask, False, _XmTearOffBtnUpEventHandler, NULL); } if (XtIsWidget(child)) XtGrabButton (child, (int)AnyButton, AnyModifier, TRUE, (unsigned int)ButtonPressMask, GrabModeAsync, GrabModeAsync, None, cursor); } } static void RemoveTearOffEventHandlers( Widget wid ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid; Widget child; int i; for (i=0; i < rc->composite.num_children; i++) { child = rc->composite.children[i]; /* * Remove the event handlers on the label and separator widgets. */ if ((XtClass(child) == xmLabelWidgetClass) || _XmIsFastSubclass(XtClass(child), XmSEPARATOR_BIT)) { XtRemoveEventHandler(child, ButtonPressMask, False, _XmTearOffBtnDownEventHandler, NULL); XtRemoveEventHandler(child, ButtonReleaseMask, False, _XmTearOffBtnUpEventHandler, NULL); } if (XtIsWidget(child) && !child->core.being_destroyed) XtUngrabButton(child, (unsigned int)AnyButton, AnyModifier); } } void _XmDestroyTearOffShell( Widget wid ) { TopLevelShellWidget to_shell = (TopLevelShellWidget)wid; to_shell->composite.num_children = 0; if (to_shell->core.being_destroyed) return; XtPopdown((Widget)to_shell); if (to_shell->core.background_pixmap != XtUnspecifiedPixmap) { XFreePixmap(XtDisplay(to_shell), to_shell->core.background_pixmap); to_shell->core.background_pixmap = XtUnspecifiedPixmap; } /* Before destroying the shell, force XtSetKeyboardFocus to remove any ** XmNdestroyCallbacks on other widgets which name this shell as client_data */ XtSetKeyboardFocus((Widget)to_shell, NULL); XtDestroyWidget((Widget)to_shell); } /*ARGSUSED*/ void _XmDismissTearOff( Widget shell, XtPointer closure, XtPointer call_data) /* unused */ { XmRowColumnWidget submenu = NULL; /* The first time a pane is torn, there's no tear off shell to destroy. */ if (!shell || !(((ShellWidget)shell)->composite.num_children) || !(submenu = (XmRowColumnWidget)(((ShellWidget)shell)->composite.children[0])) || !RC_TornOff(submenu)) return; RC_SetTornOff(submenu, FALSE); RC_SetTearOffActive(submenu, FALSE); /* Unhighlight the active child and clear the focus for the next post */ if (submenu->manager.active_child) { /* update visible focus/highlighting */ if (XmIsPrimitive(submenu->manager.active_child)) { (*(((XmPrimitiveClassRec *)XtClass(submenu->manager. active_child))->primitive_class.border_unhighlight)) (submenu->manager.active_child); } else if (XmIsGadget(submenu->manager.active_child)) { (*(((XmGadgetClassRec *)XtClass(submenu->manager. active_child))->gadget_class.border_unhighlight)) (submenu->manager.active_child); } /* update internal focus state */ _XmClearFocusPath((Widget) submenu); /* Clear the Intrinsic focus from the tear off widget hierarchy. * Necessary to remove the FocusChangeCallback from the active item. */ XtSetKeyboardFocus(shell, NULL); } if (XmIsMenuShell(shell)) { /* Shared menupanes require extra manipulation. We gotta be able * to optimize this when there's more time. */ if ((((ShellWidget)shell)->composite.num_children) > 1) XUnmapWindow(XtDisplay(submenu), XtWindow(submenu)); _XmDestroyTearOffShell(RC_ParentShell(submenu)); /* remove orphan destroy callback from postFromWidget */ XtRemoveCallback(submenu->row_column.tear_off_lastSelectToplevel, XtNdestroyCallback, (XtCallbackProc)DismissOnPostedFromDestroy, (XtPointer) RC_ParentShell(submenu)); } else /* toplevel shell! */ { /* Shared menupanes require extra manipulation. We gotta be able * to optimize this when there's more time. */ if ((((ShellWidget)RC_ParentShell(submenu))->composite.num_children) > 1) XUnmapWindow(XtDisplay(submenu), XtWindow(submenu)); _XmDestroyTearOffShell(shell); if (submenu) { XtParent(submenu) = RC_ParentShell(submenu); XReparentWindow(XtDisplay(submenu), XtWindow(submenu), XtWindow(XtParent(submenu)), XtX(submenu), XtY(submenu)); submenu->core.mapped_when_managed = False; submenu->core.managed = False; if (RC_TearOffControl(submenu)) XtManageChild(RC_TearOffControl(submenu)); } /* Only Call the callbacks if we're not popped up (parent is not a * menushell). Popping up the shell caused the unmap & deactivate * callbacks to be called already. */ _XmCallRowColumnUnmapCallback((Widget)submenu, NULL); CallTearOffMenuDeactivateCallback((Widget)submenu, (XEvent *)closure, DESTROY_TEAR_OFF); RemoveTearOffEventHandlers ((Widget) submenu); /* remove orphan destroy callback from postFromWidget */ XtRemoveCallback(submenu->row_column.tear_off_lastSelectToplevel, XtNdestroyCallback, (XtCallbackProc)DismissOnPostedFromDestroy, (XtPointer) shell); } } /*ARGSUSED*/ static void DismissOnPostedFromDestroy( Widget w, /* unused */ XtPointer clientData, XtPointer callData ) /* unused */ { _XmDismissTearOff((Widget)clientData, NULL, NULL); } #define DEFAULT_TEAR_OFF_TITLE "" #define TEAR_OFF_TITLE_SUFFIX " Tear-off" #define TEAR_OFF_CHARSET "ISO8859-1" void _XmTearOffInitiate( Widget wid, XEvent *event ) { enum { XmAWM_DELETE_WINDOW, XmA_MOTIF_WM_HINTS, NUM_ATOMS }; static char *atom_names[] = { XmIWM_DELETE_WINDOW, _XA_MOTIF_WM_HINTS }; XmRowColumnWidget submenu = (XmRowColumnWidget)wid; Widget cb; XmRowColumnWidget rc; XmString label_xms; unsigned char label_type; Arg args[20]; ShellWidget to_shell; Widget toplevel; PropMwmHints *rprop = NULL; /* receive pointer */ PropMwmHints sprop; /* send structure */ Atom atoms[XtNumber(atom_names)]; Atom actual_type; int actual_format; unsigned long num_items, bytes_after; XEvent newEvent; XmMenuState mst = _XmGetMenuState((Widget)wid); XtWidgetProc proc; if (IsPulldown(submenu)) cb = RC_CascadeBtn(submenu); else cb = NULL; if (RC_TearOffModel(submenu) == XmTEAR_OFF_DISABLED) return; /* The submenu must be posted before we allow the tear off action */ if (!(XmIsMenuShell(XtParent(submenu)) && ((XmMenuShellWidget)XtParent(submenu))->shell.popped_up)) return; if (XmIsRowColumn(wid)) rc = (XmRowColumnWidget)wid; else rc = (XmRowColumnWidget) XtParent (wid); _XmGetActiveTopLevelMenu((Widget)rc, (Widget *)&rc); /* Set up the important event fields for the new position */ memcpy(&newEvent, event, sizeof(XButtonEvent)); /* if it's from a BDrag, find the eventual destination */ if ((event->xbutton.type == ButtonPress) && (event->xbutton.button == 2/*BDrag*/)) { if (!DoPlacement((Widget) submenu, &newEvent)) /* Cancelled! */ { /* restore grabs back to menu and reset menu cursor? */ /* If the toplevel menu is an option menu, the grabs are attached to * the top submenu else leave it as the menubar or popup. */ if (IsOption(rc)) rc = (XmRowColumnWidget)RC_OptionSubMenu(rc); _XmGrabPointer((Widget) rc, True, (unsigned int)(ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask), GrabModeSync, GrabModeAsync, None, XmGetMenuCursor(XtDisplay(rc)), CurrentTime); _XmGrabKeyboard((Widget)rc, True, GrabModeSync, GrabModeSync, CurrentTime); XAllowEvents(XtDisplay(rc), AsyncKeyboard, CurrentTime); XAllowEvents(XtDisplay(rc), SyncPointer, CurrentTime); /* and reset the input focus to the leaf submenu's menushell */ _XmMenuFocus(XtParent(submenu), XmMENU_MIDDLE, CurrentTime); return; } } else { newEvent.xbutton.x_root = XtX(XtParent(submenu)); newEvent.xbutton.y_root = XtY(XtParent(submenu)); } /* If the submenu already exists, take it down for a retear */ _XmDismissTearOff(XtParent(submenu), (XtPointer)event, NULL); /* Shared menupanes require extra manipulation. We gotta be able * to optimize this when there's more time. */ if ((((ShellWidget)XtParent(submenu))->composite.num_children) > 1) XMapWindow(XtDisplay(submenu), XtWindow(submenu)); /* * Popdown the menu hierarchy! */ /* First save the GetPostedFromWidget */ if (mst->RC_LastSelectToplevel) { submenu->row_column.tear_off_lastSelectToplevel = mst->RC_LastSelectToplevel; } else if (RC_TornOff(rc) && RC_TearOffActive(rc)) submenu->row_column.tear_off_lastSelectToplevel = rc->row_column.tear_off_lastSelectToplevel; else { /* Fix CR 7983 - Assigning NULL RC_CascadeBtn causes core dump */ if (IsPopup(submenu) && RC_CascadeBtn(submenu)) submenu->row_column.tear_off_lastSelectToplevel = RC_CascadeBtn(submenu); else submenu->row_column.tear_off_lastSelectToplevel = (Widget)rc; } if (!XmIsMenuShell(XtParent(rc))) /* MenuBar or TearOff */ (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))(RC_PopupPosted(rc), event, NULL, NULL); else (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))(XtParent(rc), event, NULL, NULL); _XmSetInDragMode((Widget) rc, False); /* popdownEveryone() calls popdownDone() which will call MenuDisarm() for * each pane. We need to take care of non-popup toplevel menus (bar/option). */ (*(((XmRowColumnClassRec *)XtClass(rc))->row_column_class. menuProcedures)) (XmMENU_DISARM, (Widget) rc); _XmMenuFocus( (Widget) rc, XmMENU_END, CurrentTime); XtUngrabPointer( (Widget) rc, CurrentTime); XtUnmanageChild(RC_TearOffControl(submenu)); /* Use the toplevel application shell for the parent of the new transient * shell. This way, the submenu won't inadvertently be destroyed on * associated-widget's shell destruction. We'll make the connection to * associate-widget with XmNtransientFor. */ for (toplevel = wid; XtParent(toplevel); ) toplevel = XtParent(toplevel); XtSetArg(args[0], XmNdeleteResponse, XmDO_NOTHING); /* system & title */ XtSetArg(args[1], XmNmwmDecorations, MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MENU); XtSetArg(args[2], XmNmwmFunctions, MWM_FUNC_MOVE | MWM_FUNC_CLOSE); /* need shell resize for pulldown to resize correctly when reparenting * back without tear off control managed. */ XtSetArg(args[3], XmNallowShellResize, True); if (XmIsRowColumn(submenu->row_column.tear_off_lastSelectToplevel) && IsPopup(submenu->row_column.tear_off_lastSelectToplevel)) { XtSetArg(args[4], XmNtransientFor, _XmFindTopMostShell(RC_CascadeBtn( submenu->row_column.tear_off_lastSelectToplevel))); } else XtSetArg(args[4], XmNtransientFor, _XmFindTopMostShell(submenu->row_column.tear_off_lastSelectToplevel)); /* Sorry, still a menu - explicit mode only so focus doesn't screw up */ XtSetArg(args[5], XmNkeyboardFocusPolicy, XmEXPLICIT); /* Start Fix CR 5459 * It is important to set the shell's visual information (visual, colormap, * depth) to match the menu whose parent it is becoming. If you fail to do * so, then when the user brings up a second copy of a menu that is already * posted, a BADMATCH error occurs. */ XtSetArg(args[6], XmNvisual, ((XmMenuShellWidget)(XtParent(wid)))->shell.visual); XtSetArg(args[7], XmNcolormap, ((XmMenuShellWidget)(XtParent(wid)))->core.colormap); XtSetArg(args[8], XmNdepth, ((XmMenuShellWidget)(XtParent(wid)))->core.depth); /* End Fix CR 5459 */ to_shell = (ShellWidget)XtCreatePopupShell(DEFAULT_TEAR_OFF_TITLE, transientShellWidgetClass, toplevel, args, 9); if (RC_TearOffTitle(submenu) != NULL) XmeSetWMShellTitle(RC_TearOffTitle(submenu), (Widget) to_shell); else if (cb) { Widget lwid, mwid; /* If the top menu of the active menu hierarchy is an option menu, * use the option menu's label for the name of the shell. */ mwid = XmGetPostedFromWidget(XtParent(cb)); if (mwid && IsOption(mwid)) lwid = XmOptionLabelGadget(mwid); else lwid = cb; XtSetArg(args[0], XmNlabelType, &label_type); XtGetValues((Widget)lwid, args, 1); /* better be a compound string! */ if (label_type == XmSTRING || label_type == XmPIXMAP_AND_STRING) { XmString title_xms, suffix_xms; XtSetArg(args[0], XmNlabelString, &label_xms); XtGetValues((Widget)lwid, args, 1); suffix_xms = XmStringCreate(TEAR_OFF_TITLE_SUFFIX, TEAR_OFF_CHARSET); title_xms = XmStringConcatAndFree(label_xms, suffix_xms); XmeSetWMShellTitle(title_xms, (Widget)to_shell); XmStringFree(title_xms); } } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(to_shell), atom_names, XtNumber(atom_names), FALSE, atoms); XmAddWMProtocolCallback((Widget)to_shell, atoms[XmAWM_DELETE_WINDOW], _XmDismissTearOff, NULL); /* Add internal destroy callback to postFromWidget to eliminate orphan tear * off menus. */ XtAddCallback(submenu->row_column.tear_off_lastSelectToplevel, XtNdestroyCallback, (XtCallbackProc)DismissOnPostedFromDestroy, (XtPointer) to_shell); RC_ParentShell(submenu) = XtParent(submenu); XtParent(submenu) = (Widget)to_shell; /* Needs to be set before the user gets a callback */ RC_SetTornOff(submenu, TRUE); RC_SetTearOffActive(submenu, TRUE); _XmAddTearOffEventHandlers ((Widget) submenu); CallTearOffMenuActivateCallback((Widget)submenu, event, CREATE_TEAR_OFF); _XmCallRowColumnMapCallback((Widget)submenu, event); /* To get Traversal: _XmGetManagedInfo() to work correctly */ submenu->core.mapped_when_managed = True; XtManageChild((Widget)submenu); /* Insert submenu into the new toplevel shell */ _XmProcessLock(); proc = ((TransientShellWidgetClass)transientShellWidgetClass)-> composite_class.insert_child; _XmProcessUnlock(); (*proc)((Widget)submenu); /* Quick! Configure the size (and location) of the shell before managing * so submenu doesn't get resized. */ XmeConfigureObject((Widget) to_shell, newEvent.xbutton.x_root, newEvent.xbutton.y_root, XtWidth(submenu), XtHeight(submenu), XtBorderWidth(to_shell)); /* Call change_managed routine to set up focus info */ _XmProcessLock(); proc = ((TransientShellWidgetClass)transientShellWidgetClass)-> composite_class.change_managed; _XmProcessUnlock(); (*proc)((Widget)to_shell); XtRealizeWidget((Widget)to_shell); /* Wait until after to_shell realize to set the focus */ XmProcessTraversal((Widget)submenu, XmTRAVERSE_CURRENT); XGetWindowProperty(XtDisplay(to_shell), XtWindow(to_shell), atoms[XmA_MOTIF_WM_HINTS], 0, PROP_MWM_HINTS_ELEMENTS, False, atoms[XmA_MOTIF_WM_HINTS], &actual_type, &actual_format, &num_items, &bytes_after, (unsigned char **)&rprop); if ((actual_type != atoms[XmA_MOTIF_WM_HINTS]) || (actual_format != 32) || (num_items < PROP_MOTIF_WM_INFO_ELEMENTS)) { if (rprop != NULL) XFree((char *)rprop); } else { bzero((void *)&sprop, sizeof(sprop)); /* Fix for 9346, use sizeof(long) to calculate total size of block from get property */ memcpy(&sprop, rprop, (size_t)sizeof(long) * num_items); if (rprop != NULL) XFree((char *)rprop); sprop.flags |= MWM_HINTS_STATUS; sprop.status |= MWM_TEAROFF_WINDOW; XChangeProperty(XtDisplay(to_shell), XtWindow(to_shell), atoms[XmA_MOTIF_WM_HINTS], atoms[XmA_MOTIF_WM_HINTS], 32, PropModeReplace, (unsigned char *) &sprop, PROP_MWM_HINTS_ELEMENTS); } /* Notify the server of the change */ XReparentWindow(XtDisplay(to_shell), XtWindow(submenu), XtWindow(to_shell), 0, 0); XtPopup((Widget)to_shell, XtGrabNone); RC_SetArmed (submenu, FALSE); RC_SetTearOffDirty(submenu, FALSE); } Boolean _XmIsTearOffShellDescendant( Widget wid ) { XmRowColumnWidget rc = (XmRowColumnWidget)wid; Widget cb; while (rc && (IsPulldown(rc) || IsPopup(rc)) && XtIsShell(XtParent(rc))) { if (RC_TearOffActive(rc)) return(True); /* Popup is the top! "cascadeBtn" is postFromWidget! */ if (IsPopup(rc)) break; if (!(cb = RC_CascadeBtn(rc))) break; rc = (XmRowColumnWidget)XtParent(cb); } return (False); } void _XmLowerTearOffObscuringPoppingDownPanes( Widget ancestor, Widget tearOff ) { XRectangle tearOff_rect, intersect_rect; ShellWidget shell; _XmSetRect(&tearOff_rect, tearOff); if (IsBar(ancestor) || IsOption(ancestor)) { if ((shell = (ShellWidget)RC_PopupPosted(ancestor)) != NULL) ancestor = shell->composite.children[0]; } while (ancestor && (IsPulldown(ancestor) || IsPopup(ancestor))) { if (_XmIntersectRect( &tearOff_rect, ancestor, &intersect_rect )) { XtUnmapWidget(XtParent(ancestor)); RC_SetTearOffDirty(tearOff, True); } if ((shell = (ShellWidget)RC_PopupPosted(ancestor)) != NULL) ancestor = shell->composite.children[0]; else break; } if (RC_TearOffDirty(tearOff)) XFlush(XtDisplay(ancestor)); } /*ARGSUSED*/ void _XmRestoreExcludedTearOffToToplevelShell( Widget wid, XEvent *event ) { int i; Widget pane; XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(wid)); XmExcludedParentPaneRec *excPP = &(((XmDisplayInfo *)(dd->display.displayInfo))->excParentPane); for(i=0; i < excPP->num_panes; i++) { if ((pane = (excPP->pane)[i]) != NULL) { /* Reset to NULL first so that _XmRestoreTearOffToToplevelShell() * doesn't prematurely abort. */ (excPP->pane)[i] = NULL; _XmRestoreTearOffToToplevelShell(pane, event); } else break; } excPP->num_panes = 0; } /* * The menupane was just posted, it's current parent is the original menushell. * Reparent the pane back to the tear off toplevel shell. */ void _XmRestoreTearOffToToplevelShell( Widget wid, XEvent *event ) { XmRowColumnWidget rowcol = (XmRowColumnWidget)wid; XtGeometryResult answer; Dimension almostWidth, almostHeight; int i; XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(wid)); XmExcludedParentPaneRec *excPP = &(((XmDisplayInfo *)(dd->display.displayInfo))->excParentPane); for(i=0; i < excPP->num_panes; i++) if ((Widget)rowcol == (excPP->pane)[i]) return; if (RC_TornOff(rowcol) && !RC_TearOffActive(rowcol)) { ShellWidget shell; /* Unmanage the toc before reparenting to preserve the focus item. */ XtUnmanageChild(RC_TearOffControl(rowcol)); /* In case we're dealing with a shared menushell, the rowcol is kept * managed. We need to reforce the pane to be managed so that the * pane's geometry is recalculated. This allows the tear off to be * forced larger by mwm so that the title is not clipped. It's * done here to minimize the lag time/flashing. */ XtUnmanageChild((Widget)rowcol); /* swap parents to the toplevel shell */ shell = (ShellWidget)XtParent(rowcol); XtParent(rowcol) = RC_ParentShell(rowcol); RC_ParentShell(rowcol) = (Widget)shell; RC_SetTearOffActive(rowcol, TRUE); /* Sync up the server */ XReparentWindow(XtDisplay(shell), XtWindow(rowcol), XtWindow(XtParent(rowcol)), 0, 0); XFlush(XtDisplay(shell)); if (XtParent(rowcol)->core.background_pixmap != XtUnspecifiedPixmap) { XFreePixmap(XtDisplay(XtParent(rowcol)), XtParent(rowcol)->core.background_pixmap); XtParent(rowcol)->core.background_pixmap = XtUnspecifiedPixmap; } /* The menupost that reparented the pane back to the menushell has * wiped out the active_child. We need to restore it. * Check this out if FocusPolicy == XmPOINTER! */ rowcol->manager.active_child = _XmGetActiveItem((Widget)rowcol); _XmAddTearOffEventHandlers ((Widget) rowcol); /* Restore lastSelectToplevel as if the (torn) menu is posted */ if (IsPulldown(rowcol)) rowcol->row_column.lastSelectToplevel = rowcol->row_column.tear_off_lastSelectToplevel; else /* IsPopup */ RC_CascadeBtn(rowcol) = rowcol->row_column.tear_off_lastSelectToplevel; CallTearOffMenuActivateCallback((Widget)rowcol, event, RESTORE_TEAR_OFF_TO_TOPLEVEL_SHELL); _XmCallRowColumnMapCallback((Widget)rowcol, event); /* * In case the rowcolumn's geometry has changed, make a resize * request to the top level shell so that it can changed. All * geometry requests were handled through the menushell and the * top level shell was left unchanged. */ answer = XtMakeResizeRequest (XtParent(rowcol), XtWidth(rowcol), XtHeight(rowcol), &almostWidth, &almostHeight); if (answer == XtGeometryAlmost) answer = XtMakeResizeRequest (XtParent(rowcol), almostWidth, almostHeight, NULL, NULL); /* As in _XmTearOffInitiate(), To get Traversal: _XmGetManagedInfo() * to work correctly. */ rowcol->core.mapped_when_managed = True; XtManageChild((Widget)rowcol); /* rehighlight the previous focus item */ XmProcessTraversal(rowcol->row_column.tear_off_focus_item, XmTRAVERSE_CURRENT); } } void _XmRestoreTearOffToMenuShell( Widget wid, XEvent *event ) { XmRowColumnWidget submenu = (XmRowColumnWidget) wid; XmMenuState mst = _XmGetMenuState((Widget)wid); XtExposeProc expose; Boolean wasDirty = False; if (RC_TornOff(submenu) && RC_TearOffActive(submenu)) { ShellWidget shell; GC gc; XGCValues values; int i; Widget child; /* If the pane was previously obscured, it may require redrawing * before taking a pixmap snapshot. * Note: event could be NULL on right arrow browse through menubar back * to this submenu. */ if (RC_TearOffDirty(submenu) || (event && (event->type == ButtonPress) && (event->xbutton.time == mst->RC_ReplayInfo.time) && (mst->RC_ReplayInfo.toplevel_menu == (Widget)submenu)) || XmeFocusIsInShell((Widget)submenu)) { RC_SetTearOffDirty(submenu, False); wasDirty = True; /* First make sure that the previous active child is unhighlighted. * In the tear off's inactive state, no children should be * highlighted. */ if ((child = submenu->manager.active_child) != NULL) { if (XtIsWidget(child)) (*(((XmPrimitiveClassRec *)XtClass(child))-> primitive_class.border_unhighlight))(child); else (*(((XmGadgetClassRec *)XtClass(child))-> gadget_class.border_unhighlight))(child); } /* Redraw the submenu and its gadgets */ _XmProcessLock(); expose = XtClass(submenu)->core_class.expose; _XmProcessUnlock(); if (expose) (*expose)((Widget)submenu, NULL, NULL); /* Redraw the submenu's widgets */ for (i=0; icomposite.num_children; i++) { child = submenu->composite.children[i]; if (XtIsWidget(child)) { _XmProcessLock(); expose = XtClass(child)->core_class.expose; _XmProcessUnlock(); if (expose) (*expose)(child, event, NULL); } } XFlush(XtDisplay(submenu)); } shell = (ShellWidget)XtParent(submenu); /* this is a toplevel */ /* Save away current focus item. Then clear the focus path so that * the XmProcessTraversal() in _XmRestoreTOToTopLevelShell() re- * highlights the focus_item. */ submenu->row_column.tear_off_focus_item = XmGetFocusWidget((Widget)submenu); _XmClearFocusPath((Widget) submenu); /* Get a pixmap holder first! */ values.graphics_exposures = False; values.subwindow_mode = IncludeInferiors; gc = XtGetGC((Widget) shell, GCGraphicsExposures | GCSubwindowMode, &values); /* Fix for CR #4855, use of default depth, DRand 6/4/92 */ shell->core.background_pixmap = XCreatePixmap(XtDisplay(shell), RootWindowOfScreen(XtScreen(shell)), shell->core.width, shell->core.height, shell->core.depth); /* End of Fix #4855 */ XCopyArea(XtDisplay(shell), XtWindow(submenu), shell->core.background_pixmap, gc, 0, 0, shell->core.width, shell->core.height, 0, 0); XtReleaseGC((Widget) shell, gc); XtParent(submenu) = RC_ParentShell(submenu); RC_ParentShell(submenu) = (Widget)shell; RC_SetTearOffActive(submenu, False); if (wasDirty) XtMapWidget(XtParent(submenu)); submenu->core.mapped_when_managed = False; submenu->core.managed = False; /* Sync up the server */ XSetWindowBackgroundPixmap(XtDisplay(shell), XtWindow(shell), shell->core.background_pixmap); XReparentWindow(XtDisplay(shell), XtWindow(submenu), XtWindow(XtParent(submenu)), XtX(submenu), XtY(submenu)); XtManageChild(RC_TearOffControl(submenu)); /* The traversal graph needs to be zeroed/freed when reparenting back * to a MenuShell. This handles the case of shared/torn panes where * the pane moves from shell(context1) -> torn-shell -> shell(context2). * Shell(context2) receives the TravGraph from shell(context1). */ /* even if only one pane, sensitivity of menu items may have changed, so ** wind up forcing a reevaluation of the traversing graph */ if (submenu->row_column.postFromCount >= 1) _XmResetTravGraph(submenu->core.parent); _XmCallRowColumnUnmapCallback((Widget)submenu, event); CallTearOffMenuDeactivateCallback((Widget)submenu, event, RESTORE_TEAR_OFF_TO_MENUSHELL); RemoveTearOffEventHandlers ((Widget) submenu); } } motif-2.3.8/lib/Xm/GetPixData.c0000644000175000017500000000627012672140200013052 00000000000000/* $XConsortium: GetPixData.c /main/6 1995/10/25 20:05:46 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include "ImageCachI.h" #include "XmI.h" /******************************************************************* * * XmeGetPixmapData. * see if this pixmap is in the cache. If it is then return all the * gory details about it. If not put it in the cache first. * The RETURN pointers can be NULL. * This function never fails (unless pixmap bad id) and always returns * valid information for depth, with, height, etc . * It returns True if the pixmap was in the cache to start with * and True if it had to fetch it to the server first. * *******************************************************************/ Boolean XmeGetPixmapData( Screen *screen, Pixmap pixmap, char **image_name, int *depth, Pixel *foreground, Pixel *background, int *hot_x, int *hot_y, unsigned int *width, unsigned int *height) { char *loc_image_name; int loc_depth; Pixel loc_foreground; Pixel loc_background; int loc_hot_x; int loc_hot_y; unsigned int loc_width = 0; unsigned int loc_height; XtAppContext app; app = XtDisplayToApplicationContext(DisplayOfScreen(screen)); _XmAppLock(app); /* support passed NULL argument */ if (!image_name) image_name = &loc_image_name ; if (!depth) depth = &loc_depth ; if (!background) background = &loc_background ; if (!foreground) foreground = &loc_foreground ; if (!hot_x) hot_x = &loc_hot_x ; if (!hot_y) hot_y = &loc_hot_y ; if (!width) width = &loc_width ; if (!height) height = &loc_height ; if (_XmGetPixmapData(screen, pixmap, image_name, depth, foreground, background, hot_x, hot_y, width, height)) { _XmAppUnlock(app); return True ; } /* not in the cache, generate an incomplete entry in the pixmap cache */ /* Use a magic name, which will have _XmCachePixmap not cache this one in the pixmap_data name based cache */ if (_XmCachePixmap(pixmap, screen, DIRECT_PIXMAP_CACHED, 1, 0, 0, 0, 0)) { /* and query again */ _XmGetPixmapData(screen, pixmap, image_name, depth, foreground, background, hot_x, hot_y, width, height); } _XmAppUnlock(app); return (False); } motif-2.3.8/lib/Xm/PushBP.h0000644000175000017500000000536013145162623012236 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmPButtonP_h #define _XmPButtonP_h #include #include #ifdef __cplusplus extern "C" { #endif /* PushButton class structure */ typedef struct _XmPushButtonClassPart { XtPointer extension; /* Pointer to extension record */ } XmPushButtonClassPart; /* Full class record declaration for PushButton class */ typedef struct _XmPushButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmLabelClassPart label_class; XmPushButtonClassPart pushbutton_class; } XmPushButtonClassRec; externalref XmPushButtonClassRec xmPushButtonClassRec; /* PushButton instance record */ typedef struct _XmPushButtonPart { Boolean fill_on_arm; Dimension show_as_default; Pixel arm_color; Pixmap arm_pixmap; XtCallbackList activate_callback; XtCallbackList arm_callback; XtCallbackList disarm_callback; Boolean armed; Pixmap unarm_pixmap; GC fill_gc; GC background_gc; XtIntervalId timer; unsigned char multiClick; /* KEEP/DISCARD resource */ int click_count; Time armTimeStamp; Boolean compatible; /* if false it is Motif 1.1 else Motif 1.0 */ Dimension default_button_shadow_thickness; /* New resource - always add it to widgets dimension. */ } XmPushButtonPart; /* Full instance record declaration */ typedef struct _XmPushButtonRec { CorePart core; XmPrimitivePart primitive; XmLabelPart label; XmPushButtonPart pushbutton; } XmPushButtonRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPButtonP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ScrolledWI.h0000644000175000017500000000356612672140200013101 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ScrolledWI.h /main/5 1995/07/13 17:56:39 drk $ */ #ifndef _XmScrolledWI_h #define _XmScrolledWI_h #include #ifdef __cplusplus extern "C" { #endif #define SWCEPTR(wc) ((XmScrolledWindowClassExt *)(&(((XmScrolledWindowWidgetClass)(wc))->swindow_class.extension))) #define _XmGetScrolledWindowClassExtPtr(wc, owner) \ ((*SWCEPTR(wc) && (((*SWCEPTR(wc))->record_type) == owner))\ ? SWCEPTR(wc) \ :((XmScrolledWindowClassExt *) _XmGetClassExtensionPtr(((XmGenericClassExt *)SWCEPTR(wc)), owner))) /******** Private Function Declarations ********/ extern void _XmSWNotifyGeoChange(Widget sw, Widget child, XtWidgetGeometry *request); extern Boolean _XmSWGetClipArea(Widget widget, XRectangle *rect); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScrolledWI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ImageCachI.h0000644000175000017500000000714212672140200012776 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ImageCachI.h /main/7 1996/01/29 13:19:43 daniel $ */ #ifndef _XmImageCacheI_h #define _XmImageCacheI_h #include /* this name is used by XmeGetPixmapData to cache a pixmap in the pixmap cache with no associated name. _XmCachePixmap knows about it and will not add this one in the pixmap_data cache because it is a _name_ based pixmap cache used during conversion */ #define DIRECT_PIXMAP_CACHED "" #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for ImageCache.c ********/ extern Boolean _XmInstallImage( XImage *image, char *image_name, int hot_x, int hot_y) ; extern Boolean _XmGetImage( Screen *screen, char *image_name, XImage **image) ; extern Boolean _XmCachePixmap( Pixmap pixmap, Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth, Dimension width, Dimension height) ; extern Pixmap _XmGetColoredPixmap(Screen *screen, char *image_name, XmAccessColorData acc_color, int depth, #if NeedWidePrototypes int only_if_exists) ; #else Boolean only_if_exists) ; #endif /* NeedWidePrototypes */ extern Boolean _XmGetPixmapData( Screen *screen, Pixmap pixmap, char **image_name, int *depth, Pixel *foreground, Pixel *background, int *hot_x, int *hot_y, unsigned int *width, unsigned int *height) ; extern Boolean _XmInImageCache( String image_name); extern Pixmap _XmGetScaledPixmap( Screen *screen, Widget widget, char *image_name, XmAccessColorData acc_color, int depth, #if NeedWidePrototypes int only_if_exists, #else Boolean only_if_exists, #endif /* NeedWidePrototypes */ double scaling_ratio); extern void _XmPutScaledImage ( Display* display , Drawable d , GC gc , XImage* src_image , int src_x , int src_y , int dest_x , int dest_y , unsigned int src_width , unsigned int src_height, unsigned int dest_width , unsigned int dest_height); extern void _XmCleanPixmapCache(Screen * screen, Widget shell); /* for Xm.h */ extern Pixmap XmGetScaledPixmap( Widget widget, char *image_name, Pixel foreground, Pixel background, int depth, double scaling_ratio); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmImageCacheI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CntrbmI.h0000644000175000017500000000375212672140200012425 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: CntrbmI.h /main/5 1995/07/14 10:15:34 drk $" #endif #endif #ifndef _XmCntrbmP_h #define _XmCntrbmP_h #ifdef __cplusplus extern "C" { #endif /***************************/ /* Default collapsedPixmap */ /***************************/ #define xm_collapsed16_width 16 #define xm_collapsed16_height 16 static char xm_collapsed16_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01}; /**************************/ /* Default expandedPixmap */ /**************************/ #define xm_expanded16_width 16 #define xm_expanded16_height 16 static char xm_expanded16_bits[] = { 0x80, 0x01, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07, 0xf0, 0x0f, 0xf0, 0x0f, 0xf8, 0x1f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff}; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCntrbmP_h */ motif-2.3.8/lib/Xm/DragBSI.h0000644000175000017500000000701013145162623012302 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragBSI_h #define _XmDragBSI_h #include #include /* for CARD32, B32, etc. */ #ifdef __cplusplus extern "C" { #endif /* * defalut values for XmNnumImportTargets and XmNimportTargets. */ #define _XmDefaultNumImportTargets 0; #define _XmDefaultImportTargets NULL; /* * atoms and targets table structures */ typedef struct { Atom atom; Time time; } xmAtomsTableEntryRec, *xmAtomsTableEntry; typedef struct { Cardinal numEntries; xmAtomsTableEntry entries; } xmAtomsTableRec, *xmAtomsTable; typedef struct { Cardinal numTargets; Atom *targets; } xmTargetsTableEntryRec, *xmTargetsTableEntry; typedef struct { Cardinal numEntries; xmTargetsTableEntry entries; } xmTargetsTableRec, *xmTargetsTable; /* * The following are structures for property access. * They must have 64-bit multiple lengths to support 64-bit architectures. */ typedef struct { CARD32 atom B32; CARD16 name_length B16; CARD16 pad B16; } xmMotifAtomPairRec; typedef struct { BYTE byte_order; BYTE protocol_version; CARD16 num_atom_pairs B16; CARD32 heap_offset B32; /* xmMotifAtomPairRec atomPairs[]; */ } xmMotifAtomPairPropertyRec; typedef struct { CARD32 atom B32; CARD32 time B32; } xmMotifAtomsTableRec; typedef struct { BYTE byte_order; BYTE protocol_version; CARD16 num_atoms B16; CARD32 heap_offset B32; /* xmMotifAtomsTableRec atoms[]; */ } xmMotifAtomsPropertyRec; typedef struct { BYTE byte_order; BYTE protocol_version; CARD16 num_target_lists B16; CARD32 heap_offset B32; } xmMotifTargetsPropertyRec; /******** Private Function Declarations for DragBS.c ********/ extern void _XmInitTargetsTable( Display *display) ; extern void _XmClearDisplayTables (Display *display); extern Cardinal _XmIndexToTargets( Widget shell, Cardinal t_index, Atom **targetsRtn) ; extern Cardinal _XmTargetsToIndex( Widget shell, Atom *targets, Cardinal numTargets) ; extern Atom _XmAllocMotifAtom( Widget shell, Time time) ; extern void _XmFreeMotifAtom( Widget shell, Atom atom) ; extern void _XmDestroyMotifWindow( Display *dpy) ; extern Window _XmGetDragProxyWindow( Display *display) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragBSI_h */ motif-2.3.8/lib/Xm/Hierarchy.c0000644000175000017500000013230712672140200012777 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES *************************************************************/ #include #include "XmI.h" #include #include #include /* * The bits for the default folder images. */ #define open_file_width 12 #define open_file_height 8 static unsigned char open_file_bits[] = { 0x06, 0x00, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0xf9, 0x0f, 0x05, 0x04, 0x03, 0x02, 0xff, 0x01}; #define close_file_width 12 #define close_file_height 8 static unsigned char close_file_bits[] = { 0x0e, 0x00, 0xf1, 0x01, 0xff, 0x02, 0x81, 0x02, 0x81, 0x02, 0x81, 0x02, 0x81, 0x02, 0xff, 0x01}; /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define SUPERCLASS ((WidgetClass) &xmManagerClassRec) #define ALLOC_INC 10 typedef enum {YES, NO, DONT_CARE} SuccessType; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /************************************************************ * STATIC FUNCTION DECLARATIONS *************************************************************/ static void ClassInit(), ClassPartInitialize(WidgetClass), InsertChild(Widget); static void Destroy(Widget), ConstraintDestroy(Widget); static void Realize(Widget, Mask *, XSetWindowAttributes *); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void ConstraintInitialize(Widget, Widget, ArgList, Cardinal *); static Boolean ConstraintSetValues(Widget, Widget, Widget, ArgList, Cardinal*); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal*); static void ChangeNodeState(HierarchyConstraints); static void MapNode(HierarchyConstraints), UnmapNode(HierarchyConstraints); static void UnmapAllExtraNodes(Widget, HierarchyConstraints); static void BuildNodeTable(Widget, HierarchyConstraints, Cardinal *); static void ResetOpenCloseButton(Widget, HierarchyConstraints); static void ToggleNodeState(Widget, XtPointer, XtPointer); /****************** * Action Routines ******************/ /****************** * Type Converters ******************/ static Boolean CvtStringToNodeState(Display *, XrmValuePtr, Cardinal *, XrmValuePtr, XrmValuePtr, XtPointer *); /********************* * Internal Routines. *********************/ static void BumpChildren(HierarchyConstraints *, int, int); static void RemoveNodeFromParent(HierarchyConstraints); static void AddChild(HierarchyConstraints, HierarchyConstraints); static void AddChildToList(HierarchyConstraints **, Cardinal *, Cardinal *, HierarchyConstraints); static void RemoveChildren(HierarchyConstraints *, Cardinal); static void DestroyFolderImages(Widget); static Boolean LoadFolderImages(Widget,Widget); static HierarchyConstraints GetNodeInfo(Widget); static Boolean AncestorClosed(HierarchyConstraints); /************************************************************ * STATIC DECLARATIONS *************************************************************/ static char defaultTranslations[] = ": ManagerEnter() \n\ : ManagerLeave() \n\ : ManagerFocusOut() \n\ : ManagerFocusIn()"; static XtResource resources[] = { { XmNwidth, XmCWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(CoreRec, core.width), XmRImmediate, (XtPointer) 300 }, { XmNheight, XmCHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(CoreRec, core.height), XmRImmediate, (XtPointer) 300 }, { XmNautoClose, XmCAutoClose, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmHierarchyRec, hierarchy.auto_close), XmRImmediate, (XtPointer) True }, { XmNrefigureMode, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmHierarchyRec, hierarchy.refigure_mode), XmRImmediate, (XtPointer) True }, { XmNnodeStateCallback, XmCNodeStateCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmHierarchyRec, hierarchy.node_state_callback), XmRPointer, (XtPointer) NULL }, { XmNverticalMargin, XmCDimension, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmHierarchyRec, hierarchy.v_margin), XmRImmediate, (XtPointer) 2 }, { XmNhorizontalMargin, XmCDimension, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmHierarchyRec, hierarchy.h_margin), XmRImmediate, (XtPointer) 2 }, { XmNopenFolderPixmap, XmCPixmap, XmRPrimForegroundPixmap, sizeof(Pixmap), XtOffsetOf(XmHierarchyRec, hierarchy.open_folder), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNcloseFolderPixmap, XmCPixmap, XmRPrimForegroundPixmap, sizeof(Pixmap), XtOffsetOf(XmHierarchyRec, hierarchy.close_folder), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNnodeStateChangedCallback, XmCNodeStateChangedCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmHierarchyRec, hierarchy.node_state_changed_callback), XmRPointer, (XtPointer) NULL }, { XmNnodeStateBegEndCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmHierarchyRec, hierarchy.node_state_beg_end_callback), XmRPointer, (XtPointer) NULL }, { XmNnodeStateBeginEndCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmHierarchyRec, hierarchy.node_state_beg_end_callback), XmRPointer, (XtPointer) NULL } }; static XmSyntheticResource get_resources[] = { { XmNhorizontalMargin, sizeof(Dimension), XtOffsetOf(XmHierarchyRec, hierarchy.h_margin), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNverticalMargin, sizeof(Dimension), XtOffsetOf(XmHierarchyRec, hierarchy.v_margin), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels } }; static XtResource constraints[] = { { XmNnodeState, XmCNodeState, XmRXmHierarchyNodeState, sizeof(XmHierarchyNodeState), XtOffsetOf(XmHierarchyConstraintRec, hierarchy.state), XmRImmediate, (XtPointer) XmOpen }, { XmNparentNode, XmCParentNode, XmRWidget, sizeof(Widget), XtOffsetOf(XmHierarchyConstraintRec, hierarchy.parent), XmRImmediate, (XtPointer) NULL }, { XmNinsertBefore, XmCInsertBefore, XmRWidget, sizeof(Widget), XtOffsetOf(XmHierarchyConstraintRec, hierarchy.insert_before), XmRImmediate, (XtPointer) NULL }, { XmNnodeOpenFolderPixmap, XmCPixmap, XmRPrimForegroundPixmap, sizeof(Pixmap), XtOffsetOf(XmHierarchyConstraintRec, hierarchy.open_folder), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNnodeCloseFolderPixmap, XmCPixmap, XmRPrimForegroundPixmap, sizeof(Pixmap), XtOffsetOf(XmHierarchyConstraintRec, hierarchy.close_folder), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP } }; XmHierarchyClassRec xmHierarchyClassRec = { { /* core fields */ /* superclass */ SUPERCLASS, /* class_name */ "XmHierarchy", /* widget_size */ sizeof(XmHierarchyRec), /* class_initialize */ ClassInit, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ NULL, /* expose */ NULL, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ NULL, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite_class fields */ /* geometry_manager */ XtInheritGeometryManager, /* change_managed */ XtInheritChangeManaged, /* insert_child */ InsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ (XtResource*)constraints, /* num resources */ XtNumber(constraints), /* constraint size */ sizeof(XmHierarchyConstraintRec), /* init proc */ ConstraintInitialize, /* destroy proc */ ConstraintDestroy, /* set values proc */ ConstraintSetValues, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ NULL, /* num_syn_cont_resources */ 0, /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* Hierarchy fields */ ChangeNodeState, /* The function for changing the node state. */ MapNode, /* Maps a given node. */ UnmapNode, /* Unmaps a given node. */ UnmapAllExtraNodes, /* Unmaps all extra nodes. */ BuildNodeTable, /* Builds up the node table. */ ResetOpenCloseButton, /* Resets the information about the o/c button. */ ToggleNodeState, /* node_toggle function. */ NULL, /* extension */ } }; WidgetClass xmHierarchyWidgetClass = (WidgetClass) &xmHierarchyClassRec; /************************************************************ * STATIC CODE *************************************************************/ /* Function Name: ClassInit * Description: Called to initialize information specific * to this widget class. * Arguments: none. * Returns: none. */ /*ARGSUSED*/ static void ClassInit() { XmHierarchyClassRec* wc = &xmHierarchyClassRec; XtSetTypeConverter(XmRString, XmRXmHierarchyNodeState,CvtStringToNodeState, NULL, (Cardinal) 0, XtCacheAll, (XtDestructor) NULL); } /* Function Name: ClassPartInitialize * Description: handles inheritance of class functions. * Arguments: class - the widget class of this widget. * Returns: none. */ static void ClassPartInitialize(WidgetClass class) { XmHierarchyWidgetClass superC, wc = (XmHierarchyWidgetClass) class; _XmProcessLock(); superC = (XmHierarchyWidgetClass)wc->core_class.superclass; /* * We don't need to check for NULL super since we'll get to The functions * defined by the Hierarchy class eventually. */ if (wc->hierarchy_class.change_node_state == XtInheritChangeNodeState) { wc->hierarchy_class.change_node_state = superC->hierarchy_class.change_node_state; } if (wc->hierarchy_class.map_node == XtInheritMapNode) wc->hierarchy_class.map_node = superC->hierarchy_class.map_node; if (wc->hierarchy_class.unmap_node == XtInheritUnmapNode) wc->hierarchy_class.unmap_node = superC->hierarchy_class.unmap_node; if (wc->hierarchy_class.unmap_all_extra_nodes==XtInheritUnmapAllExtraNodes) { wc->hierarchy_class.unmap_all_extra_nodes = superC->hierarchy_class.unmap_all_extra_nodes; } if (wc->hierarchy_class.build_node_table == XtInheritBuildNodeTable) { wc->hierarchy_class.build_node_table = superC->hierarchy_class.build_node_table; } if (wc->hierarchy_class.reset_open_close_button == XtInheritResetOpenCloseButton) { wc->hierarchy_class.reset_open_close_button = superC->hierarchy_class.reset_open_close_button; } if (wc->hierarchy_class.toggle_node_state == XtInheritToggleNodeState) { wc->hierarchy_class.toggle_node_state = superC->hierarchy_class.toggle_node_state; } _XmProcessUnlock(); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /*ARGSUSED*/ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmHierarchyWidget hw = (XmHierarchyWidget) set; HierarchyConstraints top_node; Window root = RootWindowOfScreen(XtScreen(set)); top_node = ((HierarchyConstraints) XtMalloc(sizeof(HierarchyConstraintRec))); XmHierarchy_work_proc_id(hw) = (XtWorkProcId) NULL; XmHierarchy_node_table(hw) = NULL; XmHierarchy_num_nodes(hw) = XmHierarchy_alloc_nodes(hw) = 0; XmHierarchy_top_node(hw) = top_node; /* make default folder button images */ XmHierarchy_def_open_folder(hw) = XCreateBitmapFromData(XtDisplay(set),root, (char *)open_file_bits, open_file_width, open_file_height); XmHierarchy_def_close_folder(hw) = XCreateBitmapFromData(XtDisplay(set), root,(char *)close_file_bits, close_file_width, close_file_height); XmHierarchyC_state(top_node) = XmHidden; XmHierarchyC_parent(top_node) = NULL; XmHierarchyC_widget(top_node) = NULL; XmHierarchyC_status(top_node) = IS_COMPRESSED; XmHierarchyC_num_children(top_node) = XmHierarchyC_alloc(top_node) = 0; XmHierarchyC_children(top_node) = NULL; (void)LoadFolderImages(req, set ); } /* Function Name: Realize * Description: Called to realize this widget. * Arguments: w - Widget to realize. * valueMask, attributes - attributes to use when creating * this widget's window. * Returns: none. * * This overrides the Manager's frobbing with various values. */ static void Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes) { XtCreateWindow (w, InputOutput, CopyFromParent, *valueMask, attributes); } /* Function Name: Destroy * Description: Cleans up after my widget. * Arguments: w - the widget. * Returns: none. */ static void Destroy(Widget w) { XmHierarchyWidget hw = (XmHierarchyWidget) w; if( XmHierarchy_work_proc_id(hw) != (XtWorkProcId) NULL ) { XtRemoveWorkProc(XmHierarchy_work_proc_id(hw)); XmHierarchy_work_proc_id(hw) = (XtWorkProcId) NULL; } DestroyFolderImages(w); XtFree((char *) XmHierarchy_node_table(hw)); XtFree((char *) XmHierarchyC_children(XmHierarchy_top_node(hw))); XtFree((char *) XmHierarchy_top_node(hw)); XtRemoveAllCallbacks(w, XmNnodeStateBegEndCallback); } /* Function Name: InsertChild * Description: called when a new child is to be added. * Arguments: w - the new child. * Returns: none. * * This routine simply makes sure that no gadgets are added. */ static void InsertChild(Widget w) { XtWidgetProc insert_child; if (_XmGadgetWarning(w)) return; _XmProcessLock(); insert_child = ((CompositeWidgetClass) SUPERCLASS)->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(w); } /************************************************************ * * Functions for handling the Constraint resources. * ************************************************************/ /* Function Name: ConstraintInitialize * Description: Called when a child's constriaint's need initializing. * Arguments: req - the widget being requested. * set - what this will become. * args, num_args - the argument list. * Returns: none. */ /*ARGSUSED*/ static void ConstraintInitialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmHierarchyWidget hw = (XmHierarchyWidget) XtParent(set); XmHierarchyWidgetClass hc = (XmHierarchyWidgetClass) XtClass(hw); HierarchyConstraints node = GetNodeInfo(set); if (XmHierarchyC_parent(node) == set) { XmeWarning(set, XmNnodeParentIsSelfMsg); XmHierarchyC_parent(node) = NULL; } XmHierarchyC_widget(node) = set; XmHierarchyC_status(node) = IS_COMPRESSED; XmHierarchyC_num_children(node) = XmHierarchyC_alloc(node) = 0; XmHierarchyC_children(node) = NULL; /* * I will be handling the mapped state of this widget * myself, not letting the Intrinsics get in the way. */ XtSetMappedWhenManaged(set, False); XmHierarchyC_open_close_button(node) = NULL; if (XmHierarchyC_state(node) != XmNotInHierarchy) { XmHierarchyResetButtonProc reset_open_close_button; _XmProcessLock(); reset_open_close_button = hc->hierarchy_class.reset_open_close_button; _XmProcessUnlock(); (*reset_open_close_button)((Widget) hw, node); if (XmHierarchyC_parent(node) == NULL) AddChild(XmHierarchy_top_node(hw), node); else AddChild(GetNodeInfo(XmHierarchyC_parent(node)), node); } } /* Function Name: ConstraintDestroy * Description: Destroys all data allocated by the constriaint * record. * Arguments: w - the widget. * Returns: none. */ /* * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * DANGER DANGER DANGER * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * * This code exercises a bug in the MIT R4 Xt Intrinsics * that will occur if a large number of widgets deleted from within * a ConstraintDestroy procedure or a Destroy Proceedure. * */ static void ConstraintDestroy(Widget w) { HierarchyConstraints node = GetNodeInfo(w); XmHierarchyWidget hw = (XmHierarchyWidget) XtParent(w); if (XmHierarchyC_state(node) == XmNotInHierarchy) return; /* * If the Hierarchy is being destroyed then we do not want to * destroy widgets that may already be gone. */ if (!hw->core.being_destroyed) { XmHierarchyWidgetClass hc; Cardinal current; hc = (XmHierarchyWidgetClass) XtClass((Widget) hw); RemoveNodeFromParent(node); RemoveChildren(XmHierarchyC_children(node), XmHierarchyC_num_children(node)); if (XmHierarchyC_open_close_button(node) != NULL) XtDestroyWidget(XmHierarchyC_open_close_button(node)); current = 0; { XmHierarchyBuildTableProc build_node_table; _XmProcessLock(); build_node_table = hc->hierarchy_class.build_node_table; _XmProcessUnlock(); (*build_node_table) ((Widget)hw, XmHierarchy_top_node(hw), ¤t); } XmHierarchy_num_nodes(hw) = current; } XtFree((char *) XmHierarchyC_children(node)); } /* Function Name: RecursiveChildSetValues * Description: Gets the id of the old pixmap and then sets the * folder buttons * Arguments: HierarchyConstraints node - current node * Pixmap open_folder - new open folder image * Pixmap close_folder - new close folder image * Returns: none */ static void SetChildValues( HierarchyConstraints node, Pixmap open_folder, Pixmap close_folder ) { Arg args[1]; Pixmap which = None; if (XmHierarchyC_state(node) == XmOpen) { if ( (XmUNSPECIFIED_PIXMAP != XmHierarchyC_open_folder(node)) && XmHierarchyC_open_folder(node)) which = XmHierarchyC_open_folder(node); else which = open_folder; /* can be None */ XtSetArg(args[0], XmNpixmap, which ); XtSetValues(XmHierarchyC_open_close_button(node), args, 1 ); } else if (XmHierarchyC_state(node) == XmClosed) { if ( (XmUNSPECIFIED_PIXMAP != XmHierarchyC_close_folder(node)) && XmHierarchyC_close_folder(node)) which = XmHierarchyC_close_folder(node); else which = close_folder; /* can be None */ XtSetArg(args[0], XmNpixmap, which ); XtSetValues(XmHierarchyC_open_close_button(node), args, 1 ); } } /* Function Name: RecursiveChildSetValues * Description: Traverses the tree, and calls SetChildValues on each * node * Arguments: HierarchyConstraints curr_node * Pixmap open_folder * Pixmap close_folder * Returns: none */ static void RecursiveSetChildValues( HierarchyConstraints curr_node, Pixmap open_folder, Pixmap close_folder ) { HierarchyConstraints *curr_child; Cardinal num=0, i; if (XmHierarchyC_widget(curr_node) != NULL) SetChildValues( curr_node, open_folder, close_folder ); if (XmHierarchyC_num_children(curr_node) == 0) return; curr_child = XmHierarchyC_children(curr_node); num = XmHierarchyC_num_children(curr_node); for (i = 0; i < num; i++, curr_child++) { RecursiveSetChildValues( *curr_child, open_folder, close_folder ); } } /* Function Name: SetValues * Description: Called when XtSetValues is called * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: Boolean */ /*ARGSUSED*/ static Boolean SetValues(Widget w, Widget request, Widget set, ArgList args, Cardinal *num_args) { XmHierarchyWidget setw = (XmHierarchyWidget)set; if (!LoadFolderImages( w, set )) return(False); RecursiveSetChildValues(XmHierarchy_top_node(setw), XmHierarchy_open_folder(setw), XmHierarchy_close_folder(setw)); return(True); } /* Function Name: ConstraintSetValues * Description: Called a constraint is changed on my children. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /*ARGSUSED*/ static Boolean ConstraintSetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmHierarchyWidgetClass hc; XmHierarchyWidget hw = (XmHierarchyWidget) XtParent(set); HierarchyConstraints new_node = GetNodeInfo(set); HierarchyConstraints old_node = GetNodeInfo(current); Boolean insert_change = False; int i; for (i = 0; i < *num_args; i++) if (streq(args[i].name, XmNinsertBefore)) { insert_change = True; break; } hc = (XmHierarchyWidgetClass) XtClass(XtParent(set)); if ((XmHierarchyC_parent(new_node) != XmHierarchyC_parent(old_node)) || (insert_change)) { Widget parent = XmHierarchyC_parent(new_node); if (XmHierarchyC_parent(new_node) == set) { XmeWarning(set, XmNnodeParentIsSelfMsg); XmHierarchyC_parent(new_node) = XmHierarchyC_parent(old_node); } else { /* * We can't just remove old_node because it is a copy of * the widget and our compare to see if exists in the parent * will fail. So we store the new parent in a temp variable. * reset parent to the old one, then remove it from the old parent, * and finnally add it to the new parent. */ XmHierarchyC_parent(new_node) = XmHierarchyC_parent(old_node); RemoveNodeFromParent(new_node); XmHierarchyC_parent(new_node) = parent; if (parent == NULL) { XmHierarchyWidget hw = (XmHierarchyWidget) XtParent(set); AddChild(XmHierarchy_top_node(hw), new_node); } else AddChild(GetNodeInfo(XmHierarchyC_parent(new_node)), new_node); } } if (XmHierarchyC_state(new_node) != XmHierarchyC_state(old_node)) { XtCallCallbackList((Widget) hw, XmHierarchy_node_state_beg_end_callback(hw), (XtPointer) True); { XmHierarchyNodeProc change_node_state; _XmProcessLock(); change_node_state = hc->hierarchy_class.change_node_state; _XmProcessUnlock(); (*change_node_state)(new_node); } XtCallCallbackList((Widget) hw, XmHierarchy_node_state_beg_end_callback(hw), (XtPointer) False); } if ((XmHierarchyC_open_folder(new_node) != XmHierarchyC_open_folder(old_node)) || (XmHierarchyC_close_folder(new_node) != XmHierarchyC_close_folder(old_node)) ) SetChildValues(new_node, XmHierarchy_open_folder(hw), XmHierarchy_close_folder(hw)); return(False); } /* Function Name: Change node state * Description: Responds to changes in this node's state. * Arguments: node - the node that has changed. * Returns: none * * This function closes all ancestors */ /*ARGSUSED*/ static void ChangeNodeState(HierarchyConstraints node) { register int i, num; HierarchyConstraints * childp; XmHierarchyWidget hw = (XmHierarchyWidget) XtParent(XmHierarchyC_widget(node)); XmHierarchyWidgetClass hc = (XmHierarchyWidgetClass) XtClass(hw); XmHierarchyNodeStateData node_data; XmHierarchyNodeProc change_node_state; XmHierarchyResetButtonProc reset_open_close_button; _XmProcessLock(); change_node_state = hc->hierarchy_class.change_node_state; reset_open_close_button = hc->hierarchy_class.reset_open_close_button; _XmProcessUnlock(); (*reset_open_close_button) (XtParent(XmHierarchyC_widget(node)), node); node_data.widget = XmHierarchyC_widget(node); node_data.state = XmHierarchyC_state(node); XtCallCallbackList((Widget) hw, XmHierarchy_node_state_changed_callback(hw), &node_data); if (XmHierarchy_auto_close(hw)) { if ((XmHierarchyC_state(node) == XmClosed) || ((XmHierarchyC_state(node) == XmHidden) && AncestorClosed(node))) { childp = XmHierarchyC_children(node); num = XmHierarchyC_num_children(node); for (i = 0; i < num; i++, childp++) { if (XmHierarchyC_state(*childp) == XmOpen) { XmHierarchyC_state(*childp) = XmClosed; } (*change_node_state)(*childp); } } } } /* Function Name: AncestorClosed * Description: Returns true if the first non-hidden ancestor of * this widget is closed. * Arguments: node - node to check. * Returns: A Boolean */ static Boolean AncestorClosed(HierarchyConstraints node) { while ((XmHierarchyC_parent(node) != NULL) && (XmHierarchyC_state(node) == XmHidden)) { node = GetNodeInfo(XmHierarchyC_parent(node)); } return(XmHierarchyC_state(node) == XmClosed); } /* Function Name: UnmapAllExtraNodes * Description: Correctly unmaps each node in the hierarchy that is * currently compresed out. * Arguments: w - the ow. * node - node to work one. * Returns: none */ static void UnmapAllExtraNodes(Widget w, HierarchyConstraints node) { register int i; XmHierarchyWidgetClass hc = (XmHierarchyWidgetClass) (XtClass(w)); register int num; register HierarchyConstraints * ptr; void (*unmap_extra)(Widget, HierarchyConstraints); XmHierarchyNodeProc unmap_node; _XmProcessLock(); unmap_extra = hc->hierarchy_class.unmap_all_extra_nodes; unmap_node = hc->hierarchy_class.unmap_node; _XmProcessUnlock(); if (XmHierarchyC_status(node) & IS_COMPRESSED) (*unmap_node)(node); ptr = XmHierarchyC_children(node); for (num = XmHierarchyC_num_children(node), i = 0; i < num; i++, ptr++) (*unmap_extra)(w, *ptr); } /* Function Name: MapNode * Description: Maps all children of a given node. * Arguments: node - node to map. * Returns: none. */ static void MapNode(HierarchyConstraints node) { if (XmHierarchyC_status(node) & IS_MAPPED) return; if (XmHierarchyC_widget(node) != NULL) { XmHierarchyC_status(node) |= IS_MAPPED; XtSetMappedWhenManaged(XmHierarchyC_widget(node), True); } if (XmHierarchyC_open_close_button(node) != NULL) XtSetMappedWhenManaged(XmHierarchyC_open_close_button(node), True); } /* Function Name: UnmapNode * Description: Unmaps all children of a given node. * Arguments: node - node to unmap. * Returns: none. */ static void UnmapNode(HierarchyConstraints node) { if (!(XmHierarchyC_status(node) & IS_MAPPED)) return; if (XmHierarchyC_widget(node) != NULL) { XmHierarchyC_status(node) &= ~(IS_MAPPED); /* Unset the IS_MAPPED bit. */ XtSetMappedWhenManaged(XmHierarchyC_widget(node), False); } if (XmHierarchyC_open_close_button(node) != NULL) XtSetMappedWhenManaged(XmHierarchyC_open_close_button(node), False); } /* Function Name: _BuildNodeTable * Description: Recursive part of code that builds the table of * nodes to display. * Arguments: w - the hw widget. * node - node to add. * current_index - where to add this node. * Returns: none */ static void _BuildNodeTable(Widget w, HierarchyConstraints node, Cardinal * current_index) { XmHierarchyWidget hw = (XmHierarchyWidget) w; register int i; if ((node == NULL) || ((XmHierarchyC_widget(node) != NULL) && !XtIsManaged(XmHierarchyC_widget(node)))) { return; } if (XmHierarchyC_state(node) != XmHidden) { XmHierarchyC_status(node) &= ~(IS_COMPRESSED); /* No longer compressed. */ XmHierarchy_node_table(hw)[*current_index] = node; (*current_index)++; } if (XmHierarchyC_state(node) == XmClosed) return; for (i = 0; i < XmHierarchyC_num_children(node); i++) _BuildNodeTable(w, XmHierarchyC_children(node)[i], current_index); } /* Function Name: BuildNodeTable * Description: builds the table of nodes to display. * Arguments: w - the hw widget. * node - node to add. * current_index - where to add this node. * Returns: none */ static void BuildNodeTable(Widget w, HierarchyConstraints node, Cardinal * current_index) { XmHierarchyWidget hw = (XmHierarchyWidget) w; if ((XmHierarchy_node_table(hw) == NULL) || (XmHierarchy_alloc_nodes(hw) < hw->composite.num_children)) { /* * This will allocate more space than we need, but shouldn't be too * terrible. */ XmHierarchy_node_table(hw) = (HierarchyConstraints *) XtRealloc((XtPointer) XmHierarchy_node_table(hw), sizeof(HierarchyConstraints) * hw->composite.num_children); XmHierarchy_alloc_nodes(hw) = hw->composite.num_children; } _BuildNodeTable(w, node, current_index); } /* Function Name: ResetOpenCloseButton * Description: Creates or Destroys the Open/Close button * as appropriate. * Arguments: node - the node to check. * Returns: none. */ static void ResetOpenCloseButton(Widget w, HierarchyConstraints node) { Arg args[5]; Pixmap image; Cardinal num_args; XmHierarchyWidget hw = (XmHierarchyWidget) w; XmHierarchyWidgetClass hc = (XmHierarchyWidgetClass) XtClass(w); if (XmHierarchyC_state(node) == XmAlwaysOpen) { if (XmHierarchyC_open_close_button(node) != NULL) { XtDestroyWidget(XmHierarchyC_open_close_button(node)); XmHierarchyC_open_close_button(node) = NULL; } return; } switch(XmHierarchyC_state(node)) { case XmOpen: case XmHidden: default: if ( (XmUNSPECIFIED_PIXMAP != XmHierarchyC_open_folder(node)) && XmHierarchyC_open_folder(node)) image = XmHierarchyC_open_folder(node); else image = XmHierarchy_open_folder(hw); break; case XmClosed: if ( (XmUNSPECIFIED_PIXMAP != XmHierarchyC_close_folder(node)) && XmHierarchyC_close_folder(node)) image = XmHierarchyC_close_folder(node); else image = XmHierarchy_close_folder(hw); break; } num_args = 0; XtSetArg(args[num_args], XmNpixmap, image); num_args++; if (XmHierarchyC_open_close_button(node) == NULL) { XtSetArg(args[num_args], XmNmappedWhenManaged, False); num_args++; /* * Special node state for items that should not be * considered part of the hierarchy, but are children of this * widget. */ XtSetArg(args[num_args], XmNnodeState, XmNotInHierarchy); num_args++; XtSetArg(args[num_args], XmNiconPlacement, XmIconOnly); num_args++; XmHierarchyC_open_close_button(node) = XtCreateManagedWidget("openAndClose", xmIconButtonWidgetClass, w, args, num_args); /* * Make sure the mapped state of open/close button matches the * node button that it corrosponds to. */ XtSetMappedWhenManaged(XmHierarchyC_open_close_button(node), ((XmHierarchyC_status(node) & IS_MAPPED) ? True: False)); _XmProcessLock(); XtAddCallback(XmHierarchyC_open_close_button(node), XmNactivateCallback, hc->hierarchy_class.toggle_node_state, (XtPointer) node); _XmProcessUnlock(); } else { XtSetValues(XmHierarchyC_open_close_button(node), args, num_args); } } /* Function Name: ToggleNodeState * Description: Toggles the open/close state of a toggle button. * Arguments: w - the command button that activated this. * node_ptr - a pointer to the node info. * call_data - UNUSED. * Returns: none. */ static void ToggleNodeState ( Widget w, XtPointer node_ptr, XtPointer call_data ) { Arg args[1]; XmHierarchyWidget hw = ( XmHierarchyWidget ) XtParent ( w ); HierarchyConstraints node = ( HierarchyConstraints ) node_ptr; XmHierarchyWidgetClass hc = (XmHierarchyWidgetClass) XtClass ((Widget) hw ); XmHierarchyNodeStateData node_data; XmHierarchyNodeProc change_node_state; _XmProcessLock(); change_node_state = hc->hierarchy_class.change_node_state; _XmProcessUnlock(); /* * Unset the icon button. */ XtSetArg ( args[0], XmNset, False ); XtSetValues ( w, args, ( Cardinal ) 1 ); if (XmHierarchyC_state(node) == XmOpen ) { XtCallCallbackList( (Widget) hw, XmHierarchy_node_state_beg_end_callback ( hw ), (XtPointer) True ); XmHierarchyC_state ( node ) = XmClosed; (*change_node_state) ( (HierarchyConstraints) node ); } else if ( XmHierarchyC_state ( node ) == XmClosed ) { XtCallCallbackList ( ( Widget ) hw, XmHierarchy_node_state_beg_end_callback ( hw ), ( XtPointer ) True ); XmHierarchyC_state ( node ) = XmOpen; (*change_node_state) ( (HierarchyConstraints) node ); } else return; node_data.widget = XmHierarchyC_widget ( node ); node_data.state = XmHierarchyC_state ( node ); XtCallCallbackList ( ( Widget ) hw, XmHierarchy_node_state_callback ( hw ), &node_data ); XtCallCallbackList ( ( Widget ) hw, XmHierarchy_node_state_beg_end_callback ( hw ), ( XtPointer ) False ); } /************************************************************ * * Type Converters. * ************************************************************/ /* Function Name: CvtStringToNodeState * Description: Converts a string to a NodeState. * Arguments: dpy - the X Display. * args, num_args - *** NOT USED *** * fromVal - contains the string to convert. * toVal - contains the converted node state. * junk - *** UNUSED ***. * Returns: */ /*ARGSUSED*/ static Boolean CvtStringToNodeState(Display * dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal, XtPointer *junk) { static XmHierarchyNodeState type; static XrmQuark XtQEAlwaysOpen, XtQEOpen, XtQEClosed, XtQEHidden; static XrmQuark XtQENotInHierarchy; static Boolean haveQuarks = FALSE; XrmQuark q; char lowerName[BUFSIZ]; if (!haveQuarks) { XtQEAlwaysOpen = XrmStringToQuark("alwaysopen"); XtQEOpen = XrmStringToQuark("open"); XtQEClosed = XrmStringToQuark("closed"); XtQEHidden = XrmStringToQuark("hidden"); XtQENotInHierarchy = XrmStringToQuark("notinhierarchy"); haveQuarks = TRUE; } XmCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr); q = XrmStringToQuark(lowerName); if (q == XtQEAlwaysOpen) type = XmAlwaysOpen; else if (q == XtQEOpen) type = XmOpen; else if (q == XtQEClosed) type = XmClosed; else if (q == XtQEHidden) type = XmHidden; else if (q == XtQENotInHierarchy) /* note! shouldn't ever be needed */ type = XmNotInHierarchy; else { XtDisplayStringConversionWarning(dpy, fromVal->addr, XmRXmHierarchyNodeState); return(False); /* Conversion failed. */ } toVal->size = sizeof(XmHierarchyNodeState); if (toVal->addr == NULL) { toVal->addr = (XtPointer) &type; return(TRUE); } if (toVal->size >= sizeof(XmHierarchyNodeState)) { *((XmHierarchyNodeState *) toVal->addr) = type; return(TRUE); } return(FALSE); } /************************************************************ * * Actions and Callbacks. * ************************************************************/ /************************************************************ * * Internal routines. * ************************************************************/ /* Function Name: LoadFolderImages * Description: Loads the folder images. * Arguments: w - the hierarchy widget. * Returns: none. * * If the new image resource value is XmUNSPECIFIED_PIXMAP, * the image is given the default value. If the image has * changed return True, otherwise return False * * It would be nice if these values were cached per screen or display. */ static Boolean LoadFolderImages(Widget old, Widget set) { XmHierarchyWidget setw = (XmHierarchyWidget) set; XmHierarchyWidget oldw = (XmHierarchyWidget) old; if (XmHierarchy_open_folder(setw) == XmUNSPECIFIED_PIXMAP){ XmHierarchy_open_folder(setw) = XmHierarchy_def_open_folder(setw); } if (XmHierarchy_close_folder(setw) == XmUNSPECIFIED_PIXMAP){ XmHierarchy_close_folder(setw) = XmHierarchy_def_close_folder(setw); } if (XmHierarchy_open_folder(oldw) != XmHierarchy_open_folder(setw)) return(True); if (XmHierarchy_close_folder(oldw) != XmHierarchy_close_folder(setw)) return(True); return(False); } /* Function Name: DestroyFolderImages * Description: Destroys the internal default folder images. * Arguments: w - the hierarchy widget. * Returns: none. */ static void DestroyFolderImages(Widget w) { XmHierarchyWidget hw = (XmHierarchyWidget) w; XFreePixmap(XtDisplay(w), XmHierarchy_def_open_folder(hw)); XFreePixmap(XtDisplay(w), XmHierarchy_def_close_folder(hw)); } /* Function Name: RemoveChildren * Description: removes a list of children from this node. * Arguments: list - list of children to remove. * num - number of children in the list. * Returns: none. */ static void RemoveChildren(HierarchyConstraints * list, Cardinal num) { register int i; for (i = 0 ; i < num ; i++, list++ ) { /* * Our parent is already gone. */ XmHierarchyC_status(*list) |= PARENT_GONE; XtDestroyWidget(XmHierarchyC_widget(*list)); } } /* Function Name: AddChild * Description: Adds the child specified to the parent. * Arguments: parent - parent to add this child to. * child - child to add to this parent. * Returns: none. */ static void AddChild(HierarchyConstraints parent, HierarchyConstraints child) { if (parent == NULL) return; AddChildToList(&(XmHierarchyC_children(parent)), &(XmHierarchyC_num_children(parent)), &(XmHierarchyC_alloc(parent)), child); } /* Function Name: AddChildToList * Description: Adds a child the the specified list. * Arguments: * IN/OUT list - pointer to the list of children to add child to. * IN/OUT num - pointer to the number of children. * IN/OUT alloc - the amount of space allocated for children. * child - child to insert. * Returns: none. */ static void AddChildToList(HierarchyConstraints ** list, Cardinal * num, Cardinal * alloc, HierarchyConstraints child) { register int i, j; HierarchyConstraints *l_child; SuccessType success = DONT_CARE; Widget insert_before = XmHierarchyC_insert_before(child); if (*alloc <= *num) { Cardinal size; (*alloc) += ALLOC_INC; size = sizeof(HierarchyConstraints) * (*alloc); *list = (HierarchyConstraints *) XtRealloc((XtPointer)*list, size); } if (insert_before != NULL) { success = NO; /* * Hunt for the sibling that matches the insert_before widget. */ for (l_child = (*list) + (i = (*num - 1)); i >= 0; i--, l_child--) if (XmHierarchyC_widget(*l_child) == insert_before) { /* * Bump each child down and then insert the new child. */ for (j = (*num - 1); j >= i; j--) (*list)[j + 1] = (*list)[j]; (*list)[i] = child; success = YES; break; } } if (success == NO) { String params[1]; Cardinal num = 1; params[0] = XtName(XmHierarchyC_widget(child)); _XmWarningMsg(XmHierarchyC_widget(child), XmNinsertBeforeNotSibling, XmNinsertBeforeNotSiblingMsg, params, num); } if (success != YES) /* Stick it on the end of the list. */ (*list)[*num] = child; (*num)++; /* It always goes somewhere. */ } /* Function Name: GetNodeInfo * Description: Gets the node info associated with this widget. * Arguments: w - the widget. * Returns: the node info about this widget. */ static HierarchyConstraints GetNodeInfo(Widget w) { return((HierarchyConstraints) ((HierarchyConstraints)w->core.constraints)); } /* Function Name: RemoveNodeFromParent * Description: Removes the node from its parents children list. * Arguments: node - the node to remove. * Returns: none */ static void RemoveNodeFromParent(HierarchyConstraints node) { register int i; HierarchyConstraints pnode; if (XmHierarchyC_status(node) & PARENT_GONE) return; if (XmHierarchyC_parent(node) == NULL) { XmHierarchyWidget hw; hw = (XmHierarchyWidget) XtParent(XmHierarchyC_widget(node)); pnode = XmHierarchy_top_node(hw); } else pnode = GetNodeInfo(XmHierarchyC_parent(node)); for (i = 0; i < XmHierarchyC_num_children(pnode); i++) { if (XmHierarchyC_children(pnode)[i] == node) { BumpChildren(XmHierarchyC_children(pnode), i, (int) XmHierarchyC_num_children(pnode)); XmHierarchyC_num_children(pnode)--; return; } } } /* Function Name: BumpChildren * Description: Bumps the children after this node up one. * Arguments: nlist - the node list * i - where to begin bumping. * num - number of children in list. * Returns: none */ static void BumpChildren(HierarchyConstraints * nlist, int i, int num) { for (i++ ; i < num ; i++ ) nlist[i - 1] = nlist[i]; } /************************************************************ * * Public Functions * ************************************************************/ /* Function Name: XmHierarchyOpenAllAncestors * Description: This function opens all ancestors of the given node. * Arguments: nw - the node (widget) that will be changed. * Returns: none */ void XmHierarchyOpenAllAncestors(Widget nw) { Widget parent; HierarchyConstraints node; static Arg args[] = { { XmNnodeState, (XtArgVal) XmOpen } }; _XmWidgetToAppContext(nw); _XmAppLock(app); if (!XtParent(nw) || !XtIsSubclass(XtParent(nw), xmHierarchyWidgetClass)) { _XmAppUnlock(app); return; } node = GetNodeInfo(nw); while ((parent = XmHierarchyC_parent(node)) != NULL) { node = GetNodeInfo(parent); if (XmHierarchyC_state(node) == XmClosed) XtSetValues(XmHierarchyC_widget(node), args, XtNumber(args)); } _XmAppUnlock(app); } /* Function Name: XmHierarchyGetChildNodes * Description: This function returns the node children of a node * Arguments: nw - the node (widget) that will be examined * Returns: a list of Widgets (must be XtFree'd) or NULL */ WidgetList XmHierarchyGetChildNodes(Widget nw) { HierarchyConstraints node; WidgetList retval = (WidgetList)NULL; int i; _XmWidgetToAppContext(nw); _XmAppLock(app); if (!XtParent(nw) || !XtIsSubclass(XtParent(nw), xmHierarchyWidgetClass)) { _XmAppUnlock(app); return retval; } node = GetNodeInfo(nw); if (0 == XmHierarchyC_num_children(node)) { _XmAppUnlock(app); return retval; } retval = (WidgetList)XtMalloc((XmHierarchyC_num_children(node) + 1) * sizeof(Widget)); for (i=0; i < XmHierarchyC_num_children(node); i++) retval[i] = XmHierarchyC_widget(XmHierarchyC_children(node)[i]); retval[i] = (Widget)NULL; _XmAppUnlock(app); return retval; } motif-2.3.8/lib/Xm/ComboBox.h0000644000175000017500000000542412672140200012575 00000000000000/* $TOG: ComboBox.h /main/7 1998/02/23 10:32:29 cshi $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* ComboBox.h */ #ifndef _XmComboBox_h #define _XmComboBox_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmComboBoxWidgetClass; typedef struct _XmComboBoxClassRec * XmComboBoxWidgetClass; typedef struct _XmComboBoxRec * XmComboBoxWidget; /* XmIsComboBox may already be defined for Fast Subclassing */ #ifndef XmIsComboBox #define XmIsComboBox(w) XtIsSubclass(w, xmComboBoxWidgetClass) #endif /* XmIsComboBox */ /******** Public Function Declarations ********/ extern Widget XmCreateComboBox (Widget parent, char *name, ArgList args, Cardinal argCount); extern Widget XmCreateDropDownComboBox (Widget parent, char *name, ArgList args, Cardinal argCount); extern Widget XmCreateDropDownList (Widget parent, char *name, ArgList args, Cardinal argCount); extern Widget XmVaCreateComboBox( Widget parent, char *name, ...); extern Widget XmVaCreateManagedComboBox( Widget parent, char *name, ...); extern void XmComboBoxAddItem (Widget widget, XmString item, int pos, Boolean unique); extern void XmComboBoxDeletePos (Widget widget, int pos); extern void XmComboBoxSelectItem (Widget widget, XmString item); /* JIM ADDED THIS TO APEASE SYMBOL GOD */ extern XmString XmCombinationBoxGetValue(Widget widget); extern void XmComboBoxSetItem (Widget widget, XmString item); extern void XmComboBoxUpdate (Widget widget); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmComboBox_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/RegionI.h0000644000175000017500000001613413145162623012432 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmRegionI_h #define _XmRegionI_h #include #ifdef __cplusplus extern "C" { #endif #define ISEMPTY(r) ((r)->numRects == 0) /* 1 if two Boxs overlap. * 0 if two Boxs do not overlap. * Remember, x2 and y2 are not in the region */ #define EXTENTCHECK(r1, r2) \ ((r1)->x2 > (r2)->x1 && \ (r1)->x1 < (r2)->x2 && \ (r1)->y2 > (r2)->y1 && \ (r1)->y1 < (r2)->y2) /* * update region extents */ #define EXTENTS(r,idRect){\ if((r)->x1 < (idRect)->extents.x1)\ (idRect)->extents.x1 = (r)->x1;\ if((r)->y1 < (idRect)->extents.y1)\ (idRect)->extents.y1 = (r)->y1;\ if((r)->x2 > (idRect)->extents.x2)\ (idRect)->extents.x2 = (r)->x2;\ if((r)->y2 > (idRect)->extents.y2)\ (idRect)->extents.y2 = (r)->y2;\ } /* * Check to see if there is enough memory in the present region. */ #define MEMCHECK(reg, rect, firstrect){\ if ((reg)->numRects >= ((reg)->size - 1)){\ (firstrect) = (XmRegionBox *) XtRealloc \ ((char *)(firstrect), \ (unsigned) (2*(sizeof(XmRegionBox))*((reg)->size)));\ if ((firstrect) == 0)\ return;\ (reg)->size *= 2;\ (rect) = &(firstrect)[(reg)->numRects];\ }\ } /* this routine checks to see if the previous rectangle is the same * or subsumes the new rectangle to add. */ #define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\ (!(((Reg)->numRects > 0)&&\ ((R-1)->y1 == (Ry1)) &&\ ((R-1)->y2 == (Ry2)) &&\ ((R-1)->x1 <= (Rx1)) &&\ ((R-1)->x2 >= (Rx2)))) /* add a rectangle to the given XmRegion */ #define ADDRECT(reg, r, fr, rx1, ry1, rx2, ry2){\ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ if ((reg)->numRects == (reg)->size){\ if (!(reg)->size) (reg)->size = 1;\ else (reg)->size += (reg)->numRects;\ (reg)->rects = (XmRegionBox *) realloc((reg)->rects,\ sizeof(XmRegionBox) *\ (reg)->size);\ fr = REGION_BOXPTR(reg);\ r = fr + (reg)->numRects;\ }\ (r)->x1 = (rx1);\ (r)->y1 = (ry1);\ (r)->x2 = (rx2);\ (r)->y2 = (ry2);\ EXTENTS((r), (reg));\ (reg)->numRects++;\ (r)++;\ }\ } /* add a rectangle to the given XmRegion */ #define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\ if ((rx1 < rx2) && (ry1 < ry2) &&\ CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ (r)->x1 = (rx1);\ (r)->y1 = (ry1);\ (r)->x2 = (rx2);\ (r)->y2 = (ry2);\ (reg)->numRects++;\ (r)++;\ }\ } #define INBOX(r, x, y) \ ( ( ((r).x2 >= x)) && \ ( ((r).x1 <= x)) && \ ( ((r).y2 >= y)) && \ ( ((r).y1 <= y)) ) /* * used by _XmRegionDrawShadow */ #define TL_OPEN (1 << 0) #define BL_OPEN (1 << 1) #define TR_OPEN (1 << 2) #define BR_OPEN (1 << 3) #define TL_MATCH (1 << 4) #define BL_MATCH (1 << 5) #define TR_MATCH (1 << 6) #define BR_MATCH (1 << 7) /* * The following macro were ported from the X server include file regionstr.h */ #define REGION_BOXPTR(reg) ((XmRegionBox *)((reg)->rects)) /******** Private Function Declarations for Region.c ********/ extern XmRegion _XmRegionCreate( void ) ; extern XmRegion _XmRegionCreateSize( long size) ; extern void _XmRegionComputeExtents( XmRegion r) ; extern void _XmRegionGetExtents( XmRegion r, XRectangle *rect) ; extern void _XmRegionUnionRectWithRegion( XRectangle *rect, XmRegion source, XmRegion dest) ; extern void _XmRegionIntersectRectWithRegion( XRectangle *rect, XmRegion source, XmRegion dest) ; extern long _XmRegionGetNumRectangles( XmRegion r) ; extern void _XmRegionGetRectangles( XmRegion r, XRectangle **rects, long *nrects) ; extern void _XmRegionSetGCRegion( Display *dpy, GC gc, int x_origin, int y_origin, XmRegion r) ; extern void _XmRegionDestroy( XmRegion r) ; extern void _XmRegionOffset( XmRegion pRegion, int x, int y) ; extern void _XmRegionIntersect( XmRegion reg1, XmRegion reg2, XmRegion newReg) ; extern void _XmRegionUnion( XmRegion reg1, XmRegion reg2, XmRegion newReg) ; extern void _XmRegionSubtract( XmRegion regM, XmRegion regS, XmRegion regD) ; extern Boolean _XmRegionIsEmpty( XmRegion r) ; extern Boolean _XmRegionEqual( XmRegion r1, XmRegion r2) ; extern Boolean _XmRegionPointInRegion( XmRegion pRegion, int x, int y) ; extern void _XmRegionClear( XmRegion r ) ; extern void _XmRegionShrink( XmRegion r, int dx, int dy) ; extern void _XmRegionDrawShadow( Display *display, Drawable d, GC top_gc, GC bottom_gc, XmRegion region, #if NeedWidePrototypes int border_thick, int shadow_thick, #else Dimension border_thick, Dimension shadow_thick, #endif /* NeedWidePrototypes */ unsigned int shadow_type ) ; extern XmRegion _XmRegionFromImage( XImage *image ); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRegionI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconG.c0000644000175000017500000034257212672140561012101 00000000000000/* $TOG: IconG.c /main/28 1999/01/26 15:30:46 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include /* for XmeTraitSet */ #include #include #include "BaseClassI.h" #include "CacheI.h" #include "ColorI.h" #include "DrawI.h" #include "ExtObjectI.h" #include "ImageCachI.h" #include "MessagesI.h" #include "PixConvI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "SyntheticI.h" #include "TravActI.h" #include "XmI.h" #include "XmTabListI.h" #include "XmosI.h" #include "IconGI.h" #include /* spacing between the line and the detail string. Those could be moved as plain resources later. */ #define DEFAULT_LABEL_MARGIN_WIDTH 2 #define DEFAULT_LABEL_MARGIN_HEIGHT 2 #define DEFAULT_HOR_SPACING 4 /* This macro should probably be put in XmI.h and used everywhere */ #define PIXMAP_VALID(pix) \ (pix != XmUNSPECIFIED_PIXMAP && pix != None) #define SHOW_DETAIL(wid, container_data) \ (IG_Detail(wid) && IG_DetailCount(wid) && \ (container_data)->detail_order_count) #define INVALID_DIMENSION ((Dimension)-1) /******** Static Function Declarations ********/ /* XmRCallProcs */ static void CheckSetRenderTable( Widget wid, int offset, XrmValue *value); /* Converters */ static Boolean CvtStringToIconPixmap( Display *dpy, XrmValue *args, Cardinal *numArgs, XrmValue *fromVal, XrmValue *toVal, XtPointer *closure_ret) ; /* Hooks */ static void GetLabelString( Widget wid, int offset, XtArgVal *value); /* BaseClass methods */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static int IconGCacheCompare( XtPointer A, XtPointer B) ; static Cardinal GetIconGClassSecResData( WidgetClass w_class, XmSecondaryResourceData **data_rtn) ; static XtPointer GetIconGClassSecResBase( Widget widget, XtPointer client_data) ; /* RectObj methods */ static void ClassInitialize( void ); static void ClassPartInitialize( WidgetClass wc); static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void Destroy( Widget wid); static void Redisplay( Widget wid, XEvent *event, Region region); static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *reply); /* XmGadget methods */ static void HighlightBorder( Widget w) ; static void UnhighlightBorder( Widget w) ; static void InputDispatch( Widget wid, XEvent *event, Mask event_mask); static Boolean GetBaselines( Widget wid, Dimension **baselines, int *line_count); static void MarginsProc( Widget w, XmBaselineMargins *margins_rec); static Boolean GetDisplayRect( Widget wid, XRectangle *displayrect); /* XmIconGadget methods */ /* Action procs */ /* Internal functions */ static void GetLabelXY( Widget wid, Position * x_ret, Position * y_ret); static Position GetLargeIconX( Widget wid); static Position GetSmallIconY( Widget wid); static Dimension GetIconLabelWidth( Widget wid); static Dimension GetIconLabelHeight( Widget wid); static Cardinal GetShapeInfo( Widget wid, Position large_icon_x, Position small_icon_y, Position label_x, Position label_y, Dimension first_column_width, Dimension ht, XPoint * points); static void GetContainerData( Widget wid, XmContainerData container_data); static void ChangeHighlightGC( Widget wid, XtEnum selection_mode, int line_width); static void UpdateSelectGCs( Widget wid, Pixel select_color); static void UpdateGCs( Widget wid); static XmStringTable GetStringTableReOrdered( XmStringTable st, Cardinal st_count, Cardinal * order, Cardinal order_count); static void GetStringTableExtent( Screen * screen, XmStringTable st, Cardinal st_count, XmRenderTable render_table, XmTabList tab_list, Dimension hor_spacing, Dimension * width_ret, Dimension * height_ret, Position * baseline_ret); static void GetSize( Widget wid, Dimension *ideal_width, Dimension *ideal_height); /* Trait methods */ static void ContItemSetValues(Widget w, XmContainerItemData contItemData); static void ContItemGetValues(Widget w, XmContainerItemData contItemData); static Boolean HandleRedraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static void GetColors(Widget widget, XmAccessColorData color_data); static Boolean PointIn(Widget widget, Position x, Position y); /******** End Static Function Declarations ********/ /*** Xt trivia: How do you manage a flag that tells you that something happened during a resource conversion ? We need a association outside the widget instance for the OwnIconMask flag. This is because the converter sets this flag and the widget Initialize cannot initialize it afterward without overiding it. So we use the XContext manager for that. (I could probably have used private resource too...) ***/ /* those are created in ClassInitialize and filled by the IconConverter. */ static XContext largeIconContext = (XContext) NULL; static XContext smallIconContext = (XContext) NULL; static XPointer dummy; #define OwnLargeMask(widget) \ (XFindContext(XtDisplay(widget), \ (Window) widget, \ largeIconContext, \ &dummy) == 0) #define OwnSmallMask(widget) \ (XFindContext(XtDisplay(widget), \ (Window) widget, \ smallIconContext, \ &dummy) == 0) #define MESSAGE0 _XmMMsgPixConv_0000 /***** The resources of this class */ static XtResource resources[] = { /* The following hackery is a way in Xt to see if a widget has been initialized. We need to know whether or not the gadget cache is valid. We use "." in the name so that an end user cannot access it from a resource file. With that in place, we just need to check IG_Cache(w) != NULL to see if the gadget has been initialized. */ { XmNdotCache, XmCDotCache, XmRPointer, sizeof(XtPointer), XtOffset(XmIconGadget, icong.cache), XtRImmediate, (XtPointer) NULL}, { XmNlabelString,XmCXmString,XmRXmString,sizeof(XmString), XtOffset(XmIconGadget,icong.label_string), XmRImmediate,(XtPointer)NULL}, { XmNlargeIconMask,XmCIconMask,XmRBitmap,sizeof(Pixmap), XtOffset(XmIconGadget,icong.large_icon_mask), XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP}, { XmNlargeIconPixmap,XmCIconPixmap,XmRLargeIconPixmap,sizeof(Pixmap), XtOffset(XmIconGadget,icong.large_icon_pixmap), XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP}, { XmNsmallIconMask,XmCIconMask,XmRBitmap,sizeof(Pixmap), XtOffset(XmIconGadget,icong.small_icon_mask), XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP}, { XmNsmallIconPixmap,XmCIconMask,XmRSmallIconPixmap,sizeof(Pixmap), XtOffset(XmIconGadget,icong.small_icon_pixmap), XmRImmediate,(XtPointer)XmUNSPECIFIED_PIXMAP}, { XmNviewType,XmCViewType,XmRViewType,sizeof(unsigned char), XtOffset(XmIconGadget,icong.viewtype), XmRImmediate,(XtPointer)XmLARGE_ICON}, { XmNvisualEmphasis,XmCVisualEmphasis,XmRVisualEmphasis, sizeof(unsigned char), XtOffset(XmIconGadget,icong.visual_emphasis), XmRImmediate,(XtPointer)XmNOT_SELECTED}, { XmNdetail,XmCDetail,XmRXmStringTable, sizeof(XmStringTable), XtOffset(XmIconGadget,icong.detail), XmRImmediate,(XtPointer)NULL}, { XmNdetailCount,XmCDetailCount,XmRCardinal,sizeof(Cardinal), XtOffset(XmIconGadget,icong.detail_count), XmRImmediate,(XtPointer)0}, { "pri.vate","Pri.vate",XmRBoolean, sizeof(Boolean), XtOffset(XmIconGadget, icong.check_set_render_table), XmRImmediate, (XtPointer) False}, }; static XtResource cache_resources[] = { { XmNfontList, XmCFontList, XmRFontList, sizeof(XmRenderTable), XtOffsetOf(XmIconGCacheObjRec, icon_cache.render_table), XmRCallProc,(XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmIconGCacheObjRec, icon_cache.render_table), XmRCallProc,(XtPointer)CheckSetRenderTable }, { XmNbackground, XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf(XmIconGCacheObjRec, icon_cache.background), XmRCallProc, (XtPointer) _XmBackgroundColorDefault }, { XmNforeground, XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf(XmIconGCacheObjRec, icon_cache.foreground), XmRCallProc, (XtPointer) _XmForegroundColorDefault }, { XmNtopShadowColor, XmCTopShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmIconGCacheObjRec, icon_cache.top_shadow_color), XmRCallProc, (XtPointer) _XmTopShadowColorDefault }, { XmNbottomShadowColor, XmCBottomShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmIconGCacheObjRec, icon_cache.bottom_shadow_color), XmRCallProc, (XtPointer) _XmBottomShadowColorDefault }, { XmNhighlightColor, XmCHighlightColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmIconGCacheObjRec, icon_cache.highlight_color), XmRCallProc, (XtPointer) _XmHighlightColorDefault }, { XmNbackgroundPixmap, XmCBackgroundPixmap, XmRPixmap, sizeof (Pixmap), XtOffsetOf(XmIconGCacheObjRec, icon_cache.background_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XmRTopShadowPixmap, sizeof (Pixmap), XtOffsetOf(XmIconGCacheObjRec, icon_cache.top_shadow_pixmap), XmRCallProc, (XtPointer) _XmTopShadowPixmapDefault }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XmRBottomShadowPixmap, sizeof (Pixmap), XtOffsetOf(XmIconGCacheObjRec, icon_cache.bottom_shadow_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNhighlightPixmap, XmCHighlightPixmap, XmRHighlightPixmap, sizeof (Pixmap), XtOffsetOf(XmIconGCacheObjRec, icon_cache.highlight_pixmap), XmRCallProc, (XtPointer) _XmHighlightPixmapDefault }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf(XmIconGCacheObjRec, icon_cache.alignment), XmRImmediate, (XtPointer) XmALIGNMENT_CENTER }, { XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmIconGCacheObjRec, icon_cache.spacing), XmRImmediate, (XtPointer) 4 }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmIconGCacheObjRec, icon_cache.margin_width), XmRImmediate, (XtPointer) 2 }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmIconGCacheObjRec, icon_cache.margin_height), XmRImmediate, (XtPointer) 2 }, }; static XmSyntheticResource syn_resources[] = { { XmNlabelString,sizeof(XmString), XtOffset(XmIconGadget,icong.label_string),GetLabelString,NULL }, }; static XmSyntheticResource cache_syn_resources[] = { { XmNspacing, sizeof(Dimension), XtOffsetOf(XmIconGCacheObjRec, icon_cache.spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(XmIconGCacheObjRec, icon_cache.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmIconGCacheObjRec, icon_cache.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, }; /* ext rec static initialization */ externaldef(xmicongcacheobjclassrec) XmIconGCacheObjClassRec xmIconGCacheObjClassRec = { { /* superclass */ (WidgetClass) &xmExtClassRec, /* class_name */ "XmIconGadget", /* widget_size */ sizeof(XmIconGCacheObjRec), /* class_initialize */ NULL, /* chained class init */ NULL, /* class_inited */ False, /* initialize */ NULL, /* initialize hook */ NULL, /* realize */ NULL, /* actions */ NULL, /* num_actions */ 0, /* resources */ cache_resources, /* num_resources */ XtNumber(cache_resources), /* xrm_class */ NULLQUARK, /* compress_motion */ False, /* compress_exposure */ False, /* compress enter/exit*/ False, /* visible_interest */ False, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set values hook */ NULL, /* set values almost */ NULL, /* get values hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ NULL, /* query geo proc */ NULL, /* display accelerator*/ NULL, /* extension record */ NULL, }, { /* synthetic resources */ cache_syn_resources, /* num_syn_resources */ XtNumber(cache_syn_resources), /* extension */ NULL, } }; static XmBaseClassExtRec iconGBaseClassExtRec = { NULL, /* next_extension */ NULLQUARK, /* record_typ */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* record_size */ XmInheritInitializePrehook, /* initializePrehook */ SetValuesPrehook, /* setValuesPrehook */ InitializePosthook, /* initializePosthook */ SetValuesPosthook, /* setValuesPosthook */ (WidgetClass)&xmIconGCacheObjClassRec, /* secondaryObjectClass */ SecondaryObjectCreate, /* secondaryObjectCreate */ GetIconGClassSecResData, /* getSecResData */ {0}, /* Other Flags */ GetValuesPrehook, /* getValuesPrehook */ GetValuesPosthook, /* getValuesPosthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; static XmCacheClassPart IconGClassCachePart = { {NULL, 0, 0}, /* head of class cache list */ _XmCacheCopy, /* Copy routine */ _XmCacheDelete, /* Delete routine */ IconGCacheCompare, /* Comparison routine */ }; static XmGadgetClassExtRec GadClassExtRec = { NULL, NULLQUARK, XmGadgetClassExtVersion, sizeof(XmGadgetClassExtRec), GetBaselines, /* widget_baseline */ GetDisplayRect, /* widget_display_rect */ MarginsProc, /* widget_margins */ }; externaldef( xmicongadgetclassrec) XmIconGadgetClassRec xmIconGadgetClassRec = { /* RectObjClassPart */ { (WidgetClass) &xmGadgetClassRec, /* superclass */ "XmIconGadget", /* class_name */ sizeof (XmIconGadgetRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize*/ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber (resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ True, /* compress_exposure */ True, /* compress_enterleave */ False, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&iconGBaseClassExtRec, /* extension */ }, /* XmGadget Class Part */ { HighlightBorder, /* border_highlight */ UnhighlightBorder, /* border_unhighlight */ NULL, /* arm_and_activate */ InputDispatch, /* input_dispatch */ NULL, /* visual_change */ syn_resources, /* get_resources */ XtNumber(syn_resources), /* num_get_resources */ &IconGClassCachePart, /* class_cache_part */ (XtPointer)&GadClassExtRec, /* extension */ }, /* XmIconGadget Class Part */ { NULL, /* get_container_parent */ NULL, /* extension */ }, }; externaldef(xmicongadgetclass) WidgetClass xmIconGadgetClass=(WidgetClass)&xmIconGadgetClassRec; /* ContainerItem Trait record for IconGadget */ static XmConst XmContainerItemTraitRec iconCIT = { 0, /* version */ ContItemSetValues, ContItemGetValues, }; /* CareVisual Trait record for IconGadget */ static XmConst XmCareVisualTraitRec iconCVT = { 0, /* version */ HandleRedraw, }; /* Access Colors Trait record for IconGadget */ static XmConst XmAccessColorsTraitRec iconACT = { 0, /* version */ GetColors }; /* Point In Trait record for IconGadget */ static XmConst XmPointInTraitRec iconPIT = { 0, /* version */ PointIn, }; /******** for the special IconPixmap/Mask converter */ static XtConvertArgRec largeIconArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof (int) }, { XtAddress, (XtPointer)(int)XmLARGE_ICON, 0} }; static XtConvertArgRec smallIconArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof (int) }, { XtAddress, (XtPointer)(int)XmSMALL_ICON, 0} }; /*** XmRCallProcs ***/ /* * XmRCallProc routine for checking icon_cache.render_table before setting * it to NULL. If "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmIconGadget ig = (XmIconGadget)wid; /* Check if been here before */ if (ig->icong.check_set_render_table) value->addr = NULL; else { ig->icong.check_set_render_table = True; value->addr = (char*)&(IG_RenderTable(ig)); } } /************************************************************************ * * FetchPixmap * ************************************************************************/ /*ARGSUSED*/ static void FetchPixmap( Widget widget, String image_name, unsigned char res_type, Pixmap * pixmap) { int depth ; XtPointer mask_addr ; XmAccessColorDataRec acc_color_rec; XmAccessColorsTrait access_colors_trait ; depth = - XtParent(widget)->core.depth; /* this is the convention used by XmGetPixmapByDepth, pass a negative depth means do bitmap if you can */ /* always called when the cache is valid and the colors can be returned */ access_colors_trait = (XmAccessColorsTrait) XmeTraitGet((XtPointer)XtClass(widget), XmQTaccessColors) ; access_colors_trait->getColors(widget, &acc_color_rec); *pixmap = _XmGetScaledPixmap (XtScreen(widget), widget, image_name, &acc_color_rec, depth, FALSE, 0); if (*pixmap == XmUNSPECIFIED_PIXMAP) { return ; } /* now we see if a mask is to be fetched too */ if (res_type == XmLARGE_ICON) { mask_addr = (XtPointer)&(IG_LargeIconMask(widget)) ; } else { mask_addr = (XtPointer)&(IG_SmallIconMask(widget)) ; } /* fetch only if a mask has not been specified in the resource slot */ if (*(Pixmap *)mask_addr == XmUNSPECIFIED_PIXMAP) { char mask_name[255] ; /* Fetch the mask out of image_name and ask for it. ImageCache: The mask_name returned is the same as the one used by the ImageCache reader to cache the mask associated with an XPM file, so we will get it from the cache if an XPM file with a mask was specified for image_name. When an XPM file with a mask in it is read, the mask is cached with mask_name. */ _XmOSGenerateMaskName(image_name, mask_name) ; *(Pixmap*)mask_addr = (Pixmap) XmGetScaledPixmap(widget, mask_name, 1, 0, 1, 0); /* mark that we have to destroy the mask */ if (*(Pixmap *)mask_addr != XmUNSPECIFIED_PIXMAP) { if (res_type == XmLARGE_ICON) { XSaveContext(XtDisplay(widget), (Window) widget, largeIconContext, (XPointer) True); } else { XSaveContext(XtDisplay(widget), (Window) widget, smallIconContext, (XPointer) True); } } } } /************************************************************************ * * CvtStringToIconPixmap * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToIconPixmap( Display *dpy, XrmValue *args, Cardinal *numArgs, XrmValue *fromVal, XrmValue *toVal, XtPointer *closure_ret) /* unused */ { Pixmap pixmap = XmUNSPECIFIED_PIXMAP; String image_name = (String) (fromVal->addr); Widget widget ; unsigned char res_type; if (*numArgs != 2) { XtAppWarningMsg (XtDisplayToApplicationContext(dpy), "wrongParameters", "cvtStringToPixmap", "XtToolkitError", MESSAGE0, (String *) NULL, (Cardinal *)NULL); return False; } /* CR 7568: Set widget before we use it. */ widget = *((Widget *) args[0].addr); /* get back the resource type: LARGE or SMALL_ICON */ res_type = (unsigned char) (int) (long) args[1].addr; if (XmeNamesAreEqual(image_name, "none")) { pixmap = None ; _XM_CONVERTER_DONE ( toVal, Pixmap, pixmap, XmDestroyPixmap(XtScreen(widget), pixmap) ;) } if (XmeNamesAreEqual(image_name, XmSunspecified_pixmap)) { pixmap = XmUNSPECIFIED_PIXMAP ; _XM_CONVERTER_DONE ( toVal, Pixmap, pixmap, XmDestroyPixmap(XtScreen(widget), pixmap) ;) } /* First we have to check if the gadget has been initialized before trying to create the pixmap. We need the colors and if the cache is not yet created, we have to delay the conversion. */ if (!IG_Cache(widget)) { pixmap = XmDELAYED_PIXMAP; /* we need to stach away the name of the pixmap resource, since we'll need it in Initialize, when XmDELAYED_PIXMAP is treated, and XtGetSubResources is not going to work for XtVaTypeArg time resource, which are not in the database. */ if (res_type == XmLARGE_ICON) IG_LargePixmapName(widget) = image_name ; else IG_SmallPixmapName(widget) = image_name ; _XM_CONVERTER_DONE ( toVal, Pixmap, pixmap, XmDestroyPixmap(XtScreen(widget), pixmap) ;) } /* fetch the pixmap */ FetchPixmap(widget, image_name, res_type, &pixmap); if (pixmap == XmUNSPECIFIED_PIXMAP) { XtDisplayStringConversionWarning(dpy, image_name, "Large/SmallIconPixmap"); return False; } _XM_CONVERTER_DONE ( toVal, Pixmap, pixmap, XmDestroyPixmap(XtScreen(widget), pixmap) ;) } /************************************************************************ * GetLabelString ************************************************************************/ /*ARGSUSED*/ static void GetLabelString( Widget wid, int offset, /* unused */ XtArgVal *value) { XmString string = NULL; if (IG_LabelString(wid)) string = XmStringCopy(IG_LabelString(wid)); *value = (XtArgVal)string; } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /* ARGSUSED */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *cePtr; XmWidgetExtData extData; WidgetClass wc; Cardinal size; XtPointer newSec, reqSec; cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); wc = (*cePtr)->secondaryObjectClass; size = wc->core_class.widget_size; newSec = _XmExtObjAlloc(size); reqSec = _XmExtObjAlloc(size); /* * Update pointers in instance records now so references to resources * in the cache record will be valid for use in CallProcs. */ IG_Cache(new_w) = &(((XmIconGCacheObject)newSec)->icon_cache); IG_Cache(req) = &(((XmIconGCacheObject)reqSec)->icon_cache); /* * fetch the resources in superclass to subclass order */ XtGetSubresources(new_w, newSec, NULL, NULL, wc->core_class.resources, wc->core_class.num_resources, args, *num_args ); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; ((XmIconGCacheObject)newSec)->ext.extensionType = XmCACHE_EXTENSION; ((XmIconGCacheObject)newSec)->ext.logicalParent = new_w; _XmPushWidgetExtData(new_w, extData, ((XmIconGCacheObject)newSec)->ext.extensionType); memcpy(reqSec, newSec, size); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /* ARGSUSED */ static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; XmIconGadget sw = (XmIconGadget)new_w; /* * - register parts in cache. * - update cache pointers * - and free req */ _XmProcessLock(); IG_Cache(sw) = (XmIconGCacheObjPart *) _XmCachePart( IG_ClassCachePart(sw), (XtPointer) IG_Cache(sw), sizeof(XmIconGCacheObjPart)); /* * might want to break up into per-class work that gets explicitly * chained. For right now, each class has to replicate all * superclass logic in hook routine */ /* * free the req subobject used for comparisons */ _XmPopWidgetExtData((Widget) sw, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); _XmProcessUnlock(); XtFree( (char *) ext); } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; XmIconGCacheObject newSec, reqSec; Cardinal size; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmIconGCacheObject)_XmExtObjAlloc(size); reqSec = (XmIconGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy( &(newSec->icon_cache), IG_Cache(newParent), sizeof(XmIconGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); XtSetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); memcpy((XtPointer)reqSec, (XtPointer)newSec, size); IG_Cache(newParent) = &(((XmIconGCacheObject)newSec)->icon_cache); IG_Cache(refParent) = &(((XmIconGCacheObject)extData->reqWidget)->icon_cache); _XmExtImportArgs((Widget)newSec, args, num_args); return FALSE; } /************************************************************************ * * GetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; XmIconGCacheObject newSec; Cardinal size; cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; _XmProcessLock(); newSec = (XmIconGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy( &(newSec->icon_cache), IG_Cache(newParent), sizeof(XmIconGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); XtGetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmExtGetValuesHook((Widget)newSec, args, num_args); } /************************************************************************ * * GetValuesPosthook * ************************************************************************/ /* ARGSUSED */ static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmProcessLock(); _XmExtObjFree((XtPointer) ext->widget); _XmProcessUnlock(); XtFree( (char *) ext); } /************************************************************************ * * SetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; /* * - register parts in cache. * - update cache pointers * - and free req */ /* assign if changed! */ _XmProcessLock(); if (!IconGCacheCompare((XtPointer) IG_Cache(new_w), (XtPointer) IG_Cache(current))) { /* delete the old one */ _XmCacheDelete( (XtPointer) IG_Cache(current)); IG_Cache(new_w) = (XmIconGCacheObjPart *) _XmCachePart(IG_ClassCachePart(new_w), (XtPointer) IG_Cache(new_w), sizeof(XmIconGCacheObjPart)); } else IG_Cache(new_w) = IG_Cache(current); _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); _XmProcessUnlock(); XtFree( (char *) ext); return FALSE; } /*---------------- | RectObj methods | ----------------*/ /************************************************************************ * ClassInitialize * ************************************************************************/ static void ClassInitialize( void ) { iconGBaseClassExtRec.record_type = XmQmotif; /* Install the special converters for pixmap/mask */ XtSetTypeConverter (XmRString, XmRLargeIconPixmap, CvtStringToIconPixmap, largeIconArgs, XtNumber(largeIconArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRSmallIconPixmap, CvtStringToIconPixmap, smallIconArgs, XtNumber(smallIconArgs), (XtCacheNone | XtCacheRefCount), NULL); largeIconContext = XUniqueContext(); smallIconContext = XUniqueContext(); } /************************************************************************ * ClassPartInitialize * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc) { _XmFastSubclassInit(wc, XmICONGADGET_BIT); /* Install the containerItem trait for me and all subclasses */ XmeTraitSet((XtPointer) wc, XmQTcontainerItem, (XtPointer)&iconCIT); /* Install the care Visual trait for me and all subclasses */ XmeTraitSet((XtPointer) wc, XmQTcareParentVisual, (XtPointer)&iconCVT); /* Install the accessColors trait for all subclasses as well. */ XmeTraitSet((XtPointer) wc, XmQTaccessColors, (XtPointer)&iconACT); /* Install the pointIn trait for all subclasses as well. */ XmeTraitSet((XtPointer) wc, XmQTpointIn, (XtPointer)&iconPIT); } /************************************************************************ * Initialize ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmIconGadget new_ig = (XmIconGadget)nw; unsigned int w = 0, h = 0; Cardinal i ; /* XmNviewType */ if (!XmRepTypeValidValue(XmRID_VIEW_TYPE,IG_ViewType(nw),nw)) IG_ViewType(nw) = XmLARGE_ICON; /* XmNvisualEmphasis */ if (!XmRepTypeValidValue(XmRID_VISUAL_EMPHASIS, IG_VisualEmphasis(nw),nw)) IG_VisualEmphasis(nw) = XmNOT_SELECTED; /* XmNalignment */ if (!XmRepTypeValidValue(XmRID_ALIGNMENT, IG_Alignment(nw), nw)) IG_Alignment(nw) = XmALIGNMENT_CENTER; /* XmNrenderTable */ if (IG_RenderTable(nw) == NULL) { XmRenderTable defaultRT = NULL; XtVaGetValues(XtParent(nw), XmNrenderTable, &defaultRT, NULL); if (defaultRT == NULL) defaultRT = XmeGetDefaultRenderTable(nw, XmLABEL_FONTLIST); IG_RenderTable(nw) = XmRenderTableCopy(defaultRT, NULL, 0); } else IG_RenderTable(nw) = XmRenderTableCopy(IG_RenderTable(nw), NULL, 0); /* XmNlabelString */ if (!IG_LabelString(nw)) { IG_LabelString(nw) = XmeGetLocalizedString ( (char *) NULL, nw, XmNlabelString, XrmQuarkToString(new_ig->object.xrm_name)); } else IG_LabelString(nw) = XmStringCopy(IG_LabelString(nw)); /* XmNdetail */ if (IG_Detail(nw) && IG_DetailCount(nw)) { IG_Detail(nw) = (XmStringTable) XtMalloc(IG_DetailCount(nw) * sizeof(XmString)); for (i=0; irectangle.width == 0) new_ig->rectangle.width = 0; if (((XmGadget)rw)->rectangle.height == 0) new_ig->rectangle.height = 0; /* if a size has been specified (not 0), it won't be altered by the GetSize function */ GetSize(nw, &new_ig->rectangle.width, &new_ig->rectangle.height); IG_NormalGC(nw) = NULL; IG_BackgroundGC(nw) = NULL; IG_InsensitiveGC(nw) = NULL; #ifdef FIX_1381 IG_ShadowGC(nw) = NULL; #endif IG_TopShadowGC(nw) = NULL; IG_BottomShadowGC(nw) = NULL; IG_HighlightGC(nw) = NULL; IG_InverseGC(nw) = NULL; IG_SelectedGC(nw) = NULL; /* otherwize UpdateGCs frees them */ UpdateGCs(nw); new_ig->gadget.event_mask = XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT ; } /************************************************************************ * Destroy ************************************************************************/ static void Destroy( Widget wid) { Cardinal i ; if (IG_RenderTable(wid) != NULL) XmRenderTableFree(IG_RenderTable(wid)); if (IG_LabelString(wid) != NULL) XmStringFree(IG_LabelString(wid)); if (IG_Detail(wid) && IG_DetailCount(wid)) { for (i=0; i IG_LabelRectWidth(wid))) label_x += (IG_LargeIconRectWidth(wid) - IG_LabelRectWidth(wid))/2; else if ((IG_Alignment(wid) == XmALIGNMENT_CENTER) && HAS_MASK(wid) && (IG_LargeIconRectWidth(wid) > IG_LabelRectWidth(wid) + 2*ist)) label_x += (IG_LargeIconRectWidth(wid) - IG_LabelRectWidth(wid) - 2*ist)/2; else if ((IG_Alignment(wid) == XmALIGNMENT_END) && !HAS_MASK(wid) && (IG_LargeIconRectWidth(wid) > IG_LabelRectWidth(wid))) label_x += IG_LargeIconRectWidth(wid) - IG_LabelRectWidth(wid); else if ((IG_Alignment(wid) == XmALIGNMENT_END) && HAS_MASK(wid) && (IG_LargeIconRectWidth(wid) > IG_LabelRectWidth(wid) + 2*ist)) label_x += IG_LargeIconRectWidth(wid) - IG_LabelRectWidth(wid) - 2*ist; label_y += IG_LargeIconRectHeight(wid) + SPACING(wid); } else { /* XmSMALL_ICON */ label_x += IG_SmallIconRectWidth(wid) + SPACING(wid); if (!HAS_MASK(wid) && (IG_SmallIconRectHeight(wid) > IG_LabelRectHeight(wid))) label_y += (IG_SmallIconRectHeight(wid) - IG_LabelRectHeight(wid))/2 ; else if (HAS_MASK(wid) && (IG_SmallIconRectHeight(wid) > IG_LabelRectHeight(wid) + 2*ist)) label_y += (IG_SmallIconRectHeight(wid) - IG_LabelRectHeight(wid) - 2*ist)/2 ; } label_x += IG_MarginWidth(wid); /* test LayoutIsRtoLG(wid) here */ if (LayoutIsRtoLG(wid)) { label_x = XtWidth(wid) - label_x - IG_LabelRectWidth(wid) - IG_HLThickness(wid); } else { label_x += IG_HLThickness(wid) ; } if (x_ret) *x_ret = label_x; if (y_ret) *y_ret = label_y + IG_HLThickness(wid) + IG_MarginHeight(wid); } /************************************************************************ * GetLargeIconX ************************************************************************/ static Position GetLargeIconX( Widget wid) { /* no test LayoutIsRtoLG(wid) here */ Dimension ist = IG_ShadowThickness(wid); Position large_x = IG_HLThickness(wid) + IG_MarginWidth(wid); if ((IG_Alignment(wid) == XmALIGNMENT_CENTER) && !HAS_MASK(wid) && (IG_LabelRectWidth(wid) > IG_LargeIconRectWidth(wid))) large_x += (IG_LabelRectWidth(wid) - IG_LargeIconRectWidth(wid)) /2; else if ((IG_Alignment(wid) == XmALIGNMENT_CENTER) && HAS_MASK(wid) && (IG_LabelRectWidth(wid) + 2*ist > IG_LargeIconRectWidth(wid))) large_x += (IG_LabelRectWidth(wid) + 2*ist - IG_LargeIconRectWidth(wid)) /2; else if ((IG_Alignment(wid) == XmALIGNMENT_END) && !HAS_MASK(wid) && (IG_LargeIconRectWidth(wid) < IG_LabelRectWidth(wid))) large_x += IG_LabelRectWidth(wid) - IG_LargeIconRectWidth(wid); else if ((IG_Alignment(wid) == XmALIGNMENT_END) && HAS_MASK(wid) && (IG_LargeIconRectWidth(wid) < IG_LabelRectWidth(wid) + 2*ist)) large_x += IG_LabelRectWidth(wid) + 2*ist - IG_LargeIconRectWidth(wid); if (!HAS_MASK(wid)) large_x += ist; return large_x; } /************************************************************************ * GetLargeIconY ************************************************************************/ /* the shadow thickness is only incorporated when there is no mask */ #define GetLargeIconY(wid) (IG_HLThickness(wid) + IG_MarginHeight(wid) + \ (HAS_MASK(wid) ? 0 : IG_ShadowThickness(wid))) /************************************************************************ * GetSmallIconX ************************************************************************/ /* the shadow thickness is only incorporated when there is no mask */ #define GetSmallIconX(wid) (IG_HLThickness(wid) + IG_MarginWidth(wid) + \ (HAS_MASK(wid) ? 0 : IG_ShadowThickness(wid))) /************************************************************************ * GetSmallIconY ************************************************************************/ static Position GetSmallIconY( Widget wid) { Dimension ist = IG_ShadowThickness(wid); Position small_y = IG_HLThickness(wid) + IG_MarginHeight(wid); if (!HAS_MASK(wid) && (IG_LabelRectHeight(wid) > IG_SmallIconRectHeight(wid))) small_y += (IG_LabelRectHeight(wid) - IG_SmallIconRectHeight(wid))/2; else if (HAS_MASK(wid) && (IG_LabelRectHeight(wid) + 2*ist > IG_SmallIconRectHeight(wid))) small_y += (IG_LabelRectHeight(wid) + 2*ist - IG_SmallIconRectHeight(wid))/2; if (!HAS_MASK(wid)) small_y += ist; return small_y; } /************************************************************************ * GetIconLabelWidth * including the shadows, the spacing, and the margin ************************************************************************/ static Dimension GetIconLabelWidth( Widget wid) { Dimension width = 2*IG_MarginWidth(wid); if (IG_ViewType(wid) == XmLARGE_ICON) { if (!HAS_MASK(wid)) width += MAX(IG_LargeIconRectWidth(wid), IG_LabelRectWidth(wid)) + 2*IG_ShadowThickness(wid); else width += MAX(IG_LargeIconRectWidth(wid), IG_LabelRectWidth(wid) + 2*IG_ShadowThickness(wid)); } else { /* XmSMALL_ICON */ width += IG_SmallIconRectWidth(wid) + IG_LabelRectWidth(wid) + 2*IG_ShadowThickness(wid) + SPACING(wid); } return width; } /************************************************************************ * GetIconLabelHeight * including the shadows, the possible spacing, and the margin ************************************************************************/ static Dimension GetIconLabelHeight( Widget wid) { Dimension height = 2*IG_MarginHeight(wid); if (IG_ViewType(wid) == XmLARGE_ICON) { height += IG_LargeIconRectHeight(wid) + IG_LabelRectHeight(wid) + 2*IG_ShadowThickness(wid) + SPACING(wid); } else { if (!HAS_MASK(wid)) height += MAX(IG_SmallIconRectHeight(wid), IG_LabelRectHeight(wid)) + 2*IG_ShadowThickness(wid); else height += MAX(IG_SmallIconRectHeight(wid), IG_LabelRectHeight(wid) + 2*IG_ShadowThickness(wid)); } return height; } /*********** * GetShapeInfo. * This return the points that defines the shadow rectangle. * Since this function is used for both shadow and highlight, * the ht parameter is used to differentiate both case. It is -1 * for the highlight case and the real highlightthickness for * the shadow case. * The coordinates passed in should not have integrate any RtoL * layout yet, since the function is doing mirroring at the end. * * The function returns the number of valid points (8 points in * the generic case or only 2 points for a rectangle). * **********/ static Cardinal GetShapeInfo( Widget wid, Position large_icon_x, Position small_icon_y, Position label_x, Position label_y, Dimension first_column_width, Dimension ht, XPoint * points) { Dimension ist = IG_ShadowThickness(wid), rht = IG_HLThickness(wid); Cardinal i, n = 8; XmIconGadget ig = (XmIconGadget) wid ; Boolean highlight_case ; Dimension mh, mw, rmh = IG_MarginHeight(wid), rmw = IG_MarginWidth(wid); Dimension maxX; if (ht == INVALID_DIMENSION) { /* If we're doing the highlight case, mark the dimension as zero but remember it so that the shadow is not drawn later on in this routine */ ht = 0 ; highlight_case = True ; mw = mh = 0; } else { highlight_case = False ; mw = rmw; mh = rmh; } /* then first treat the simple case where either the pixmap or the label is missing */ points[0].x = ht + mw; points[0].y = ht + mh; points[1].x = 2*ist + 2*rht - ht + 2*rmw - mw; points[1].y = 2*ist + 2*rht - ht + 2*rmh - mh; if (XmStringEmpty(IG_LabelString(wid))) { /* no label */ if ((IG_ViewType(wid) == XmLARGE_ICON) && (PIXMAP_VALID(IG_LargeIconPixmap(wid)))) { points[1].x += IG_LargeIconRectWidth(wid) ; points[1].y += IG_LargeIconRectHeight(wid) ; } if ((IG_ViewType(wid) == XmSMALL_ICON) && (PIXMAP_VALID(IG_SmallIconPixmap(wid)))) { points[1].x += IG_SmallIconRectWidth(wid) ; points[1].y += IG_SmallIconRectHeight(wid) ; } n = 2 ; } else {/* a label */ if (!HAS_PIXMAP(wid)) { /* but no pixmap */ points[1].x += IG_LabelRectWidth(wid) ; points[1].y += IG_LabelRectHeight(wid) ; n = 2 ; } } if (n == 8 && IG_ViewType(wid) == XmLARGE_ICON) { /* point #0 is top left corner of label */ points[0].x = label_x - ist - rht + ht - rmw + mw; points[0].y = ht + mh + IG_LargeIconRectHeight(wid); if ((!HAS_MASK(wid) && (IG_LargeIconRectWidth(wid) > IG_LabelRectWidth(wid))) || (HAS_MASK(wid) && (IG_LargeIconRectWidth(wid) > IG_LabelRectWidth(wid) + 2*ist))) { points[0].y += 2*rht - 2*ht + 2*rmh - 2*mh; if (!HAS_MASK(wid)) points[0].y += 2*ist -1; else if (highlight_case) points[0].y -= 1; if (!highlight_case && HAS_MASK(wid)) points[0].y += SPACING(wid); } else points[0].y += SPACING(wid); points[1].x = large_icon_x - (ist + rht - ht + rmw - mw); if (highlight_case && HAS_MASK(wid)) points[1].x += ist; points[1].y = points[0].y ; points[2].x = points[1].x ; points[2].y = ht + mh; points[3].x = large_icon_x + IG_LargeIconRectWidth(wid) + ist + rht - ht + rmw - mw -1; if (highlight_case && HAS_MASK(wid)) points[3].x -= ist; points[3].y = points[2].y ; points[4].x = points[3].x ; points[4].y = points[0].y; points[5].x = label_x + IG_LabelRectWidth(wid) + ist + rht - ht + rmw - mw -1; if (!highlight_case && HAS_MASK(wid) && ist) points[5].x += 1 ; points[5].y = points[0].y ; points[6].x = points[5].x ; points[6].y = IG_LargeIconRectHeight(wid) + IG_LabelRectHeight(wid) + 2*ist + 2*rht - ht + 2*rmh - mh + SPACING(wid) -1; if (!highlight_case && HAS_MASK(wid) && ist) points[6].y += 1 ; points[7].x = points[0].x ; points[7].y = points[6].y ; } else if (n == 8) { /* SMALL_ICON */ /* point #0 is top left corner of pixmap */ points[0].x = ht + mw; points[0].y = small_icon_y - ist - rht + ht - rmh + mh; if (highlight_case && HAS_MASK(wid)) points[0].y += ist; points[1].x = IG_SmallIconRectWidth(wid) + ht + mw; if ((!HAS_MASK(wid) && (IG_SmallIconRectHeight(wid) > IG_LabelRectHeight(wid))) || (HAS_MASK(wid) && (IG_SmallIconRectHeight(wid) > IG_LabelRectHeight(wid) + 2*ist))){ points[1].x += 2*rht - 2*ht + 2*rmw - 2*mw; if (!HAS_MASK(wid)) points[1].x += 2*ist -1; else if (highlight_case) points[1].x -= 1; if (!highlight_case && HAS_MASK(wid)) points[1].x += SPACING(wid); } else points[1].x += SPACING(wid); points[1].y = points[0].y; points[2].x = points[1].x; points[2].y = label_y - ist - rht + ht - rmh + mh; points[3].x = IG_SmallIconRectWidth(wid) + SPACING(wid) + IG_LabelRectWidth(wid) + 2*ist + 2*rht - ht + 2*rmw - mw -1; if (highlight_case && HAS_MASK(wid)) points[3].x -= 1 ; points[3].y = points[2].y; points[4].x = points[3].x; points[4].y = label_y + IG_LabelRectHeight(wid) + ist + rht - ht + rmh - mh -1; if (!highlight_case && HAS_MASK(wid) && ist) points[4].y += 1; points[5].x = points[1].x; points[5].y = points[4].y; points[6].x = points[5].x; points[6].y = small_icon_y + IG_SmallIconRectHeight(wid) + ist + rht - ht + rmh - mh -1; if (highlight_case && HAS_MASK(wid)) points[6].y -= ist; points[7].x = points[0].x ; points[7].y = points[6].y; } /* now treat the case where the pixmap is present but it has a mask: no shadow around the pixmap, just the label, if there is a label of course. Only aply for the shadow, not for the highlight, so we checked that using the ht parameter at the beginning */ if (HAS_MASK(wid) && !highlight_case) { if (XmStringEmpty(IG_LabelString(wid))) { return 0 ; } else if (n == 8) { /* uses the points already computed for the polygon shadow case */ if (IG_ViewType(wid) == XmLARGE_ICON) { points[0].x = points[0].x ; points[0].y = points[0].y ; points[1].x = points[6].x ; points[1].y = points[6].y ; } else { points[0].x = points[2].x ; points[0].y = points[2].y ; points[1].x = points[4].x ; points[1].y = points[4].y ; } n = 2 ; } } /* put the points in the frame */ if (highlight_case) maxX = ig->rectangle.width - ht - mw; else maxX = MIN(ig->rectangle.width - ht - mw, first_column_width); for (i=0; i maxX) points[i].x = maxX; if (points[i].y > ig->rectangle.height - ht - mh) points[i].y = ig->rectangle.height - ht - mh; /* add the gadget position in its parent */ points[i].x += ig->rectangle.x ; points[i].y += ig->rectangle.y ; } /* test LayoutIsRtoLG(wid) here */ if (LayoutIsRtoLG(wid) ) { /* mirror the x position */ for (i = 0; i < n; i++) points[i].x = 2*ig->rectangle.x + XtWidth(wid) - points[i].x -1; /* + in the rectangle case, switch x because of XmeDrawShadow required left-upper right-bottom point order */ if (n == 2) { Position save_x = points[1].x ; points[1].x = points[0].x +1; points[0].x = save_x +1; } } return n ; } /*********** * GetContainerData **********/ static void GetContainerData( Widget wid, XmContainerData container_data) { XmIconGadgetClass igc = (XmIconGadgetClass) XtClass(wid); Widget container_id ; XmContainerTrait container_trait ; XmIconGadget ig = (XmIconGadget)wid; /**** initialize the trait struct */ /* need to set detail_order_count and first_column so that container gets a min base. The problem we're trying to solve here is when the first kid gets created, when it computes its preferred size from its Initialize method, the container cannot come up for a valid dynamic detail_order_count or first_column_width since it doesn't have any child in it yet (this one hasn't been inserted yet: Initialize < InsertChild in Xt). So we pass the current kid value and the Container will use them as min, or default if you want. */ container_data->detail_order_count = IG_DetailCount(wid); container_data->first_column_width = IG_HLThickness(wid) + GetIconLabelWidth(wid) - IG_MarginWidth(wid); container_data->selection_mode = XmNORMAL_MODE ; container_data->detail_order = NULL ; container_data->detail_tablist = NULL ; container_data->select_color = XmREVERSED_GROUND_COLORS ; /*** get the Container information using the trait */ /* first get the widget id from which to fetch the trait */ container_id = (igc->icong_class.get_container_parent)? (*(igc->icong_class.get_container_parent))(wid) : XtParent(wid); /* then get the trait info */ container_trait = (XmContainerTrait) XmeTraitGet((XtPointer) XtClass(container_id), XmQTcontainer) ; if (container_trait) container_trait->getValues(container_id, container_data); else return ; /*** detail_order_count might be 0: mean no detail displayed, even if the icon has some. detail_order might be NULL: mean if there is detail to display, we'll use a default order [1..N] when we need it. detail_tablist might be null, mean concat for the kid. (XmContainer returns NULL unless it can't come up with a reasonable tablist due to its size being NULL or too small) first_column_width might be 0, which mean spatial: use icon/label only */ /* a return of 0 for first column width means we are in spatial, in this case, don't use rectangle.x at all */ if (!container_data->first_column_width) { container_data->first_column_width = IG_HLThickness(wid) + GetIconLabelWidth(wid) - IG_MarginWidth(wid); } else { /* remove the current hor indentation */ if (LayoutIsRtoLG(wid)) { if (XtWidth(XtParent(wid))) { if ((Position)container_data->first_column_width > (XtWidth(XtParent(wid)) - ig->rectangle.width - ig->rectangle.x)) { container_data->first_column_width -= (XtWidth(XtParent(wid)) - ig->rectangle.width - ig->rectangle.x) ; } else { container_data->first_column_width = IG_HLThickness(wid) + IG_MarginWidth(wid); } } else { /* parent not sized yet */ if ((Position)container_data->first_column_width > ig->rectangle.x) container_data->first_column_width -= ig->rectangle.x ; else container_data->first_column_width = IG_HLThickness(wid) + IG_MarginWidth(wid); } } else /* regular case: not RtoL*/ /* here we have to worry of special cases where the first_column_width and the position of the kid are extreme */ if (((Position)container_data->first_column_width > ig->rectangle.x) && ig->rectangle.x >= 0) { container_data->first_column_width -= ig->rectangle.x ; if (container_data->first_column_width < IG_HLThickness(wid) + IG_MarginWidth(wid)) container_data->first_column_width = IG_HLThickness(wid) + IG_MarginWidth(wid); } else container_data->first_column_width = IG_HLThickness(wid) + IG_MarginWidth(wid); } /*** leaving this routine: detail_order_count might be 0: no detail to display detail_order might be NULL. : use implicit order container_data->detail_tablist might be NULL: use concat container_data->first_column_width is: in spatial, Container returned first_column_width=0, and we turned it in GetContainerData into icon_width (included highlight). in outline/detail, first_column_width is the clipping width from the current position of the icon to the start of the detail rendering (included highlight too). */ } /************************************************************************ * Redisplay * This is the main routine of this baby. ************************************************************************/ /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, /* unused */ Region region) /* unused */ { XmIconGadget ig = (XmIconGadget)wid; GC gc; GC background_gc; Dimension pm_width,pm_height; XRectangle clip_rect; Boolean clip_set = False; int depth; XmContainerDataRec container_data ; Position large_icon_x = 0, small_icon_y = 0, small_icon_x, label_x = 0, label_y = 0 ; Dimension w, h, ist = IG_ShadowThickness(wid), ht = IG_HLThickness(wid); Dimension mw = IG_MarginWidth(wid), mh = IG_MarginHeight(wid); Cardinal i ; XPoint shad_points[8] ; /* a gc for the ink (text only) */ if (!XtIsSensitive(wid)) gc = IG_InsensitiveGC(wid); else gc = IG_NormalGC(wid); /**** invert the background gc for selected view */ if (IG_VisualEmphasis(wid) == XmSELECTED) { background_gc = IG_SelectedGC(wid); /* if inverse_gc has been set, it holds the parent background as its foreground (ink). Use it when in selected mode */ if (IG_InverseGC(wid)) gc = IG_InverseGC(wid); } else { background_gc = IG_BackgroundGC(wid); } /**** get the container information */ container_data.valueMask = ContAllValid ; GetContainerData(wid, &container_data); /**** clear the background */ /* in detail mode, clear the entire gadget area using background_gc (which, depending on the selected mode is the selectedGC or the BackgroundGC of the icon), while in iconlabel only, only clear the iconlabel using cleararea (and we will later clear the label part using background_gc) */ if (SHOW_DETAIL(wid, &container_data)) { XSetClipMask(XtDisplay(wid), background_gc, None); XFillRectangle(XtDisplay(wid), XtWindow(wid), background_gc, ig->rectangle.x, ig->rectangle.y, ig->rectangle.width, ig->rectangle.height); } else { XSetClipMask(XtDisplay(wid), IG_BackgroundGC(wid), None); } /**** render the pixmap first */ if ((IG_ViewType(wid) == XmLARGE_ICON) && (PIXMAP_VALID(IG_LargeIconPixmap(wid)))) { large_icon_x = GetLargeIconX(wid); /* no rtl yet */ XmeGetPixmapData(XtScreen(wid), IG_LargeIconPixmap(wid), NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); pm_width = IG_LargeIconRectWidth(wid); if (large_icon_x + pm_width > MIN(ig->rectangle.width, container_data.first_column_width)) { pm_width = MIN(ig->rectangle.width - 2*ht, container_data.first_column_width - ht); pm_width -= MIN(pm_width, (Dimension)large_icon_x); if (LayoutIsRtoLG(wid)) large_icon_x = ig->rectangle.width - MIN(ig->rectangle.width - 2*ht, container_data.first_column_width - ht) ; } else { if (LayoutIsRtoLG(wid)) large_icon_x = ig->rectangle.width - large_icon_x - pm_width ; } pm_height = IG_LargeIconRectHeight(wid) ; if (ht + ist + pm_height > ig->rectangle.height - 2*ht) pm_height = ig->rectangle.height - ist - ht; /* clip with the mask if any */ if (PIXMAP_VALID(IG_LargeIconMask(wid))) { XSetClipMask(XtDisplay(wid), IG_NormalGC(wid), IG_LargeIconMask(wid)); XSetClipOrigin(XtDisplay(wid), IG_NormalGC(wid), ig->rectangle.x + large_icon_x, ig->rectangle.y + ht + mh); } else { XSetClipMask(XtDisplay(wid), IG_NormalGC(wid),None); } if (depth == XtParent(wid)->core.depth) XCopyArea(XtDisplay(wid),IG_LargeIconPixmap(wid), XtWindow(wid), IG_NormalGC(wid), 0,0, pm_width, pm_height, ig->rectangle.x + large_icon_x, ig->rectangle.y + GetLargeIconY(wid)); else if (depth == 1) XCopyPlane(XtDisplay(wid),IG_LargeIconPixmap(wid), XtWindow(wid), IG_NormalGC(wid), 0,0, pm_width, pm_height, ig->rectangle.x + large_icon_x, ig->rectangle.y + GetLargeIconY(wid), 1); } if ((IG_ViewType(wid) == XmSMALL_ICON) && (PIXMAP_VALID(IG_SmallIconPixmap(wid)))) { small_icon_y = GetSmallIconY(wid); XmeGetPixmapData(XtScreen(wid), IG_SmallIconPixmap(wid), NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); pm_width = IG_SmallIconRectWidth(wid); small_icon_x = GetSmallIconX(wid); if (small_icon_x + pm_width > MIN(ig->rectangle.width - 2*ht, container_data.first_column_width - 2*ht)) { pm_width = MIN(ig->rectangle.width, container_data.first_column_width) - 2*ht; pm_width -= MIN(pm_width, (Dimension)small_icon_x); if (LayoutIsRtoLG(wid)) small_icon_x = ig->rectangle.width + 2*ht - MIN(ig->rectangle.width, container_data.first_column_width) ; } else { if (LayoutIsRtoLG(wid)) small_icon_x = ig->rectangle.width - small_icon_x - pm_width ; } pm_height = IG_SmallIconRectHeight(wid); if (small_icon_y + pm_height > ig->rectangle.height - 2*ht) pm_height = ig->rectangle.height - small_icon_y; /* clip with the mask if any */ if (PIXMAP_VALID(IG_SmallIconMask(wid))) { XSetClipMask(XtDisplay(wid), IG_NormalGC(wid), IG_SmallIconMask(wid)); XSetClipOrigin(XtDisplay(wid), IG_NormalGC(wid), ig->rectangle.x + small_icon_x, ig->rectangle.y + small_icon_y); } else { XSetClipMask(XtDisplay(wid), IG_NormalGC(wid),None); } if (depth == XtParent(wid)->core.depth) XCopyArea(XtDisplay(wid),IG_SmallIconPixmap(wid), XtWindow(wid), IG_NormalGC(wid),0,0, pm_width,pm_height, ig->rectangle.x + small_icon_x, ig->rectangle.y + small_icon_y); else if (depth == 1) XCopyPlane(XtDisplay(wid),IG_SmallIconPixmap(wid), XtWindow(wid), IG_NormalGC(wid),0,0, pm_width,pm_height, ig->rectangle.x + small_icon_x, ig->rectangle.y + small_icon_y, 1); } clip_rect.y = ig->rectangle.y + ht + mh; clip_rect.width = MIN(ig->rectangle.width - 2*ht - 2*mw, container_data.first_column_width - ht - mw); clip_rect.height = ig->rectangle.height - 2*ht - 2*mh; if (LayoutIsRtoLG(wid)) { clip_rect.x = ig->rectangle.x + ig->rectangle.width - ht - clip_rect.width - mw; } else { clip_rect.x = ig->rectangle.x + ht + mw; } XSetClipRectangles(XtDisplay(wid),gc,0,0,&clip_rect,1,Unsorted); XSetClipRectangles(XtDisplay(wid),background_gc,0,0,&clip_rect,1,Unsorted); /**** then draw the label part of the icon */ GetLabelXY(wid, &label_x, &label_y) ; if (!XmStringEmpty(IG_LabelString(wid))) { XFillRectangle(XtDisplay(wid), XtWindow(wid), background_gc, ig->rectangle.x + label_x, ig->rectangle.y + label_y, IG_LabelRectWidth(wid), IG_LabelRectHeight(wid)); /* if we are in the inverse_color case, we need to draw the string with parent background ink, and parent foreground as back color (The previous fillrectangle took care of that last part). gc has been set up to IG_InverseGC at the beginning of this routine, so what's left is the forcing of this ink/foreground */ #ifdef FIX_1381 /*Draw shadow for insensitive text*/ if (!XtIsSensitive(wid)) { XmStringDraw(XtDisplay(wid),XtWindow(wid), IG_RenderTable(wid),IG_LabelString(wid), IG_ShadowGC(wid), ig->rectangle.x + label_x+1 + DEFAULT_LABEL_MARGIN_WIDTH, ig->rectangle.y + label_y+1 + DEFAULT_LABEL_MARGIN_HEIGHT, IG_LabelRectWidth(wid) - 2*DEFAULT_LABEL_MARGIN_WIDTH, XmALIGNMENT_BEGINNING, LayoutG(wid), NULL); } #endif XmStringDraw(XtDisplay(wid),XtWindow(wid), IG_RenderTable(wid),IG_LabelString(wid), gc, ig->rectangle.x + label_x + DEFAULT_LABEL_MARGIN_WIDTH, ig->rectangle.y + label_y + DEFAULT_LABEL_MARGIN_HEIGHT, IG_LabelRectWidth(wid) - 2*DEFAULT_LABEL_MARGIN_WIDTH, XmALIGNMENT_BEGINNING, LayoutG(wid), NULL); } XSetClipMask(XtDisplay(wid),background_gc,None); /**** now the polygon shadow around the icon+label, or the square shadow around a masked pixmap or a no pixmap icon */ /* only draw shadows if there is something inside */ if (container_data.first_column_width) { Cardinal n ; /* undo the ltr layout for label_x, because getshapeinfo does it */ if (LayoutIsRtoLG(wid)) { label_x = XtWidth(wid) - IG_LabelRectWidth(wid) - label_x ; } n = GetShapeInfo(wid, GetLargeIconX(wid), small_icon_y, label_x, label_y, container_data.first_column_width, ht, &shad_points[0]) ; /* only draw the polygon shadow if there is no mask and an existing pixmap */ if (n == 2) { XmeDrawShadows(XtDisplay(wid),XtWindow(wid), IG_TopShadowGC(wid), IG_BottomShadowGC(wid), shad_points[0].x, shad_points[0].y, shad_points[1].x - shad_points[0].x, shad_points[1].y - shad_points[0].y, ist, XmSHADOW_OUT); } else if (n == 8) { XmeDrawPolygonShadow (XtDisplay(wid),XtWindow(wid), IG_TopShadowGC(wid), IG_BottomShadowGC(wid), shad_points, n, ist, XmSHADOW_OUT); } } /**** then comes the details rendering */ if (SHOW_DETAIL(wid, &container_data)&& container_data.first_column_width >= ht + mw) { unsigned int tab_count = 0 ; Dimension detail_x, detail_y; XmStringTable new_detail ; int lab_baseline = 0, detail_baseline ; /* get the detail table to be displayed */ new_detail = GetStringTableReOrdered(IG_Detail(wid), IG_DetailCount(wid), container_data.detail_order, container_data.detail_order_count); if (container_data.detail_tablist) tab_count = XmTabListTabCount(container_data.detail_tablist) ; /* the extra tabs are ignored */ tab_count = MIN(tab_count, container_data.detail_order_count); /* tab_count might be 0 at this point, but it won't be treated as a special case */ if (IG_LabelString(wid)) lab_baseline = XmStringBaseline(IG_RenderTable(wid), IG_LabelString(wid)) ; /* detail_x is in gadget relative coordinate */ detail_x = container_data.first_column_width; for (i = 0 ; i < IG_DetailCount(wid) ; i++) { Position next_tab_x = 0 ; w = 0 ; detail_x += DEFAULT_HOR_SPACING ; if (container_data.detail_tablist) next_tab_x = container_data.first_column_width + _XmTabListGetPosition(XtScreen(wid), container_data.detail_tablist, XmPIXELS, i); if (new_detail[i]) { /* if we have a tab, use it, don't bother to call an expensive string extent. */ if (i < tab_count) { clip_rect.width = MIN (next_tab_x - detail_x, ig->rectangle.width - 2*ht - 2*mw - detail_x); clip_rect.x = ig->rectangle.x + detail_x; if (LayoutIsRtoLG(wid)) clip_rect.x = ig->rectangle.x + ig->rectangle.width - detail_x - clip_rect.width; clip_rect.y = ig->rectangle.y + ht + mh; clip_rect.height = ig->rectangle.height - 2*ht - 2*mh; XSetClipRectangles(XtDisplay(wid),gc,0,0,&clip_rect,1, Unsorted); } else { XmStringExtent(IG_RenderTable(wid), new_detail[i], &w, &h); if (!clip_set) { clip_rect.x = ig->rectangle.x + ht + mw; clip_rect.y = ig->rectangle.y + ht + mh; clip_rect.width = ig->rectangle.width - 2*ht - 2*mw; clip_rect.height = ig->rectangle.height - 2*ht - 2*mh; XSetClipRectangles(XtDisplay(wid),gc,0,0,&clip_rect,1, Unsorted); /* only set this clip once */ clip_set = True ; } } detail_baseline = XmStringBaseline(IG_RenderTable(wid), new_detail[i]); detail_y = label_y + DEFAULT_LABEL_MARGIN_HEIGHT + lab_baseline - detail_baseline; XmStringDraw(XtDisplay(wid),XtWindow(wid), IG_RenderTable(wid), new_detail[i], gc, (LayoutIsRtoLG(wid)) ? (ig->rectangle.x + ig->rectangle.width - detail_x - ((i < tab_count) ? clip_rect.width : w)) : (ig->rectangle.x + detail_x), ig->rectangle.y + detail_y, ((i < tab_count) ? clip_rect.width : w), XmALIGNMENT_BEGINNING, LayoutG(wid), NULL); /* clip is done in gc */ } if (i < tab_count) { detail_x = next_tab_x; } else { detail_x += w ; } } } /**** draw the highlight if needed */ if (ig->gadget.highlighted) { if(((XmGadgetClass) XtClass(wid))->gadget_class.border_highlight){ (*(((XmGadgetClass) XtClass(wid)) ->gadget_class.border_highlight))(wid) ; } } } /************************************************************************ * SetValues ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { Boolean Relayout = False; Boolean Redraw = False; unsigned int w, h ; Cardinal i ; if (IG_ViewType(nw) != IG_ViewType(cw)) { if (XmRepTypeValidValue(XmRID_VIEW_TYPE,IG_ViewType(nw),nw)) Relayout = Redraw = True; else IG_ViewType(nw) = IG_ViewType(cw); } if (IG_VisualEmphasis(nw) != IG_VisualEmphasis(cw)) { if (XmRepTypeValidValue(XmRID_VISUAL_EMPHASIS, IG_VisualEmphasis(nw),nw)) Redraw = True; else IG_VisualEmphasis(nw) = IG_VisualEmphasis(cw); } if (IG_Alignment(nw) != IG_Alignment(cw)) { if (XmRepTypeValidValue(XmRID_ALIGNMENT, IG_Alignment(nw), nw)) Relayout = Redraw = True; else IG_Alignment(nw) = IG_Alignment(cw); } if ((IG_Background(nw) != IG_Background(cw)) || (IG_Foreground(nw) != IG_Foreground(cw)) || (IG_TopShadowColor(nw) != IG_TopShadowColor(cw)) || (IG_BottomShadowColor(nw) != IG_BottomShadowColor(cw)) || (IG_HighlightColor(nw) != IG_HighlightColor(cw)) || (IG_BackgroundPixmap(nw) != IG_BackgroundPixmap(cw)) || (IG_TopShadowPixmap(nw) != IG_TopShadowPixmap(cw)) || (IG_BottomShadowPixmap(nw) != IG_BottomShadowPixmap(cw)) || (IG_HighlightPixmap(nw) != IG_HighlightPixmap(cw))) { UpdateGCs(nw); } if (IG_RenderTable(nw) != IG_RenderTable(cw)) { XmRenderTableFree(IG_RenderTable(cw)); IG_RenderTable(nw) = XmRenderTableCopy(IG_RenderTable(nw), NULL, 0); UpdateGCs(nw); if (!XmStringEmpty(IG_LabelString(nw))) XmStringExtent(IG_RenderTable(nw), IG_LabelString(nw), &(IG_LabelRectWidth(nw)), &(IG_LabelRectHeight(nw))); IG_LabelRectWidth(nw) += 2*DEFAULT_LABEL_MARGIN_WIDTH ; IG_LabelRectHeight(nw) += 2*DEFAULT_LABEL_MARGIN_HEIGHT ; Relayout = Redraw = True; } if (IG_LabelString(nw) != IG_LabelString(cw)) { XmStringFree(IG_LabelString(cw)); IG_LabelString(nw) = XmStringCopy(IG_LabelString(nw)); if (!XmStringEmpty(IG_LabelString(nw))) XmStringExtent(IG_RenderTable(nw), IG_LabelString(nw), &(IG_LabelRectWidth(nw)), &(IG_LabelRectHeight(nw))); else { IG_LabelRectWidth(nw) = 0 ; IG_LabelRectHeight(nw) = 0 ; } IG_LabelRectWidth(nw) += 2*DEFAULT_LABEL_MARGIN_WIDTH ; IG_LabelRectHeight(nw) += 2*DEFAULT_LABEL_MARGIN_HEIGHT ; Relayout = Redraw = True; } if (IG_LargeIconMask(nw) != IG_LargeIconMask(cw)) { if (OwnLargeMask(cw)) { XDeleteContext(XtDisplay(nw), (Window) nw, largeIconContext) ; if (PIXMAP_VALID(IG_LargeIconMask(cw))) XmDestroyPixmap(XtScreen(cw), IG_LargeIconMask(cw)); } if (IG_ViewType(nw) == XmLARGE_ICON) Relayout = Redraw = True; } if (IG_LargeIconPixmap(nw) != IG_LargeIconPixmap(cw)) { if (IG_ViewType(nw) == XmLARGE_ICON) Relayout = Redraw = True; /* if the new icon is different, refetch the sizes */ if (PIXMAP_VALID(IG_LargeIconPixmap(nw))) XmeGetPixmapData(XtScreen(nw), IG_LargeIconPixmap(nw), NULL, NULL, NULL, NULL, NULL, NULL, &w, &h); else { w = h = 0 ; } IG_LargeIconRectWidth(nw) = (unsigned short)w; IG_LargeIconRectHeight(nw) = (unsigned short)h; } if (IG_SmallIconMask(nw) != IG_SmallIconMask(cw)) { if (OwnSmallMask(cw)) { XDeleteContext(XtDisplay(nw), (Window) nw, smallIconContext) ; if (PIXMAP_VALID(IG_SmallIconMask(cw))) XmDestroyPixmap(XtScreen(cw), IG_SmallIconMask(cw)); } if (IG_ViewType(nw) == XmSMALL_ICON) Relayout = Redraw = True; } if (IG_SmallIconPixmap(nw) != IG_SmallIconPixmap(cw)) { if (IG_ViewType(nw) == XmSMALL_ICON) Relayout = Redraw = True; if (PIXMAP_VALID(IG_SmallIconPixmap(nw))) XmeGetPixmapData(XtScreen(nw), IG_SmallIconPixmap(nw), NULL, NULL, NULL, NULL, NULL, NULL, &w, &h); else { w = h = 0 ; } IG_SmallIconRectWidth(nw) = (unsigned short)w; IG_SmallIconRectHeight(nw) = (unsigned short)h; } if (IG_Detail(nw) != IG_Detail(cw)) { /* new XmNdetail copy in */ /* first free the current detail table and strings if present */ if (IG_Detail(cw) && IG_DetailCount(cw)) { for (i=0; icore.width == cw->core.width) nw->core.width = 0; if (rw->core.height == cw->core.height) nw->core.height = 0; } GetSize(nw, &nw->core.width, &nw->core.height); } return(Redraw); } /************************************************************************ * QueryGeometry ************************************************************************/ static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired) { if (IG_RecomputeSize(wid) == False) { desired->width = XtWidth(wid) ; desired->height = XtHeight(wid) ; } else { desired->width = 0 ; desired->height = 0 ; GetSize(wid, &desired->width, &desired->height); /* the above asks for the containertrait firstColumnWidth */ } return XmeReplyToQueryGeometry(wid, intended, desired) ; } /*----------------- | XmGadget methods | -----------------*/ /************************************************************************ * HighlightBorder ************************************************************************/ static void HighlightBorder( Widget w ) { XmIconGadget ig = (XmIconGadget) w ; XmContainerDataRec container_data ; Dimension ht = IG_HLThickness(w) ; /* test LayoutIsRtoLG(wid) here */ ig->gadget.highlighted = True ; ig->gadget.highlight_drawn = True ; if(ig->rectangle.width == 0 || ig->rectangle.height == 0 || ig->gadget.highlight_thickness == 0) return ; /* The highlight is different depending if there is a detail or not. With a detail, it's a rectangular shadow, otherwise it's drawn around the icon+label */ /**** get the container information */ container_data.valueMask = ContFirstColumnWidth | ContSelectionMode ; GetContainerData(w, &container_data); XSetClipMask(XtDisplay(w), IG_HighlightGC(w), None); if (SHOW_DETAIL(w, &container_data)) { ChangeHighlightGC(w, container_data.selection_mode, ht); if (container_data.selection_mode == XmADD_MODE) _XmDrawHighlight(XtDisplay(w),XtWindow(w), IG_HighlightGC(w), ig->rectangle.x, ig->rectangle.y, ig->rectangle.width, ig->rectangle.height, ht, LineDoubleDash); else XmeDrawHighlight(XtDisplay(w),XtWindow(w), IG_HighlightGC(w), ig->rectangle.x, ig->rectangle.y, ig->rectangle.width, ig->rectangle.height, ht); } else { Position label_x, label_y ; XPoint points[8] ; /* do the polygon highlight around the icon + label part */ GetLabelXY(w, &label_x, &label_y) ; /* undo the ltr layout for label_x, because getshapeinfo does it */ if (LayoutIsRtoLG(w)) { label_x = XtWidth(w) - IG_LabelRectWidth(w) - label_x ; } if (GetShapeInfo(w, GetLargeIconX(w), GetSmallIconY(w), label_x, label_y, container_data.first_column_width, INVALID_DIMENSION, points) == 2) { /* only 2 points have been set, that's the simple case */ if (container_data.selection_mode == XmADD_MODE) { ChangeHighlightGC(w, container_data.selection_mode, ht); _XmDrawHighlight(XtDisplay(w),XtWindow(w), IG_HighlightGC(w), points[0].x, points[0].y, points[1].x - points[0].x, points[1].y - points[0].y, ht, LineDoubleDash); } else XmeDrawHighlight(XtDisplay(w),XtWindow(w), IG_HighlightGC(w), points[0].x, points[0].y, points[1].x - points[0].x, points[1].y - points[0].y, ht); } else { ChangeHighlightGC(w, container_data.selection_mode, 1); XmeDrawPolygonShadow (XtDisplay(w),XtWindow(w), IG_HighlightGC(w), IG_HighlightGC(w), points, 8, ht, XmSHADOW_OUT); } } } /************************************************************************ * UnhighlightBorder ************************************************************************/ static void UnhighlightBorder( Widget w ) { XmIconGadget ig = (XmIconGadget) w ; XmContainerDataRec container_data ; Dimension ht = IG_HLThickness(w) ; GC background_gc ; /* test LayoutIsRtoLG(wid) here */ ig->gadget.highlighted = False ; ig->gadget.highlight_drawn = False ; if(ig->rectangle.width == 0 || ig->rectangle.height == 0 || ig->gadget.highlight_thickness == 0) return ; /* unhighlight has to use the current selected background, it cannot call the superclass unhighlight as in highlight because Gadget does a simple clearborder. */ /**** get the container information */ container_data.valueMask = ContFirstColumnWidth ; GetContainerData(w, &container_data); if(XmIsManager (XtParent(w))) { background_gc = ((XmManagerWidget)XtParent(w)) ->manager.background_GC ; } else { XSetClipMask(XtDisplay(w), IG_BackgroundGC(w), None); background_gc = IG_BackgroundGC(w) ; } if (SHOW_DETAIL(w, &container_data)) { /* unhighlight the entire gadget area */ XmeDrawHighlight(XtDisplay(w),XtWindow(w), background_gc, ig->rectangle.x, ig->rectangle.y, ig->rectangle.width, ig->rectangle.height, ht); } else { Position label_x, label_y ; XPoint points[8] ; /* do the polygon unhighlight around the icon + label part */ GetLabelXY(w, &label_x, &label_y) ; /* undo the ltr layout for label_x, because getshapeinfo does it */ if (LayoutIsRtoLG(w)) { label_x = XtWidth(w) - IG_LabelRectWidth(w) - label_x ; } if (GetShapeInfo(w, GetLargeIconX(w), GetSmallIconY(w), label_x, label_y, container_data.first_column_width, INVALID_DIMENSION, points) == 2) { /* only 2 points have been set, that's the simple case */ XmeDrawHighlight(XtDisplay(w),XtWindow(w), background_gc, points[0].x, points[0].y, points[1].x - points[0].x, points[1].y - points[0].y, ht); } else { XmeDrawPolygonShadow (XtDisplay(w),XtWindow(w), background_gc, background_gc, points, 8, ht, XmSHADOW_OUT); } } } /******************************************************************* * * IconGCacheCompare * *******************************************************************/ static int IconGCacheCompare( XtPointer A, XtPointer B ) { XmIconGCacheObjPart *icon_inst = (XmIconGCacheObjPart *) A ; XmIconGCacheObjPart *icon_cache_inst = (XmIconGCacheObjPart *) B ; if((icon_inst-> render_table == icon_cache_inst->render_table) && (icon_inst-> selected_GC == icon_cache_inst->selected_GC) && (icon_inst-> inverse_GC == icon_cache_inst->inverse_GC) && (icon_inst-> normal_GC == icon_cache_inst->normal_GC) && (icon_inst-> background_GC == icon_cache_inst->background_GC) && (icon_inst-> insensitive_GC == icon_cache_inst->insensitive_GC) && (icon_inst-> top_shadow_GC == icon_cache_inst->top_shadow_GC) && (icon_inst-> bottom_shadow_GC == icon_cache_inst->bottom_shadow_GC) && (icon_inst-> highlight_GC == icon_cache_inst->highlight_GC) && (icon_inst-> background == icon_cache_inst->background) && (icon_inst-> foreground == icon_cache_inst->foreground) && (icon_inst-> top_shadow_color == icon_cache_inst->top_shadow_color) && (icon_inst-> highlight_color == icon_cache_inst->highlight_color) && (icon_inst-> top_shadow_pixmap == icon_cache_inst->background_pixmap) && (icon_inst-> background_pixmap == icon_cache_inst->top_shadow_pixmap) && (icon_inst-> highlight_pixmap == icon_cache_inst->highlight_pixmap) && (icon_inst-> bottom_shadow_color == icon_cache_inst->bottom_shadow_color) && (icon_inst-> bottom_shadow_pixmap == icon_cache_inst->bottom_shadow_pixmap) && (icon_inst-> alignment == icon_cache_inst->alignment) && (icon_inst-> spacing == icon_cache_inst->spacing) && (icon_inst-> margin_width == icon_cache_inst->margin_width) && (icon_inst-> margin_height == icon_cache_inst->margin_height) ) return 1; else return 0; } /**************************************************** * Functions for manipulating Secondary Resources. *********************************************************/ /* * GetIconGClassSecResData() * Create a XmSecondaryResourceDataRec for each secondary resource; * Put the pointers to these records in an array of pointers; * Return the pointer to the array of pointers. * client_data = Address of the structure in the class record which * represents the (template of ) the secondary data. */ /*ARGSUSED*/ static Cardinal GetIconGClassSecResData( WidgetClass w_class, /* unused */ XmSecondaryResourceData **data_rtn ) { int arrayCount; XmBaseClassExt bcePtr; String resource_class, resource_name; XtPointer client_data; bcePtr = &(iconGBaseClassExtRec ); client_data = NULL; resource_class = NULL; resource_name = NULL; arrayCount = _XmSecondaryResourceData ( bcePtr, data_rtn, client_data, resource_name, resource_class, GetIconGClassSecResBase); return (arrayCount); } /* * GetIconGClassResBase () * retrun the address of the base of resources. * If client data is the same as the address of the secndary data in the * class record then send the base address of the cache-resources for this * instance of the widget. * Right now we do not try to get the address of the cached_data from * the Gadget component of this instance - since Gadget class does not * have any cached_resources defined. If later secondary resources are * defined for Gadget class then this routine will have to change. */ /*ARGSUSED*/ static XtPointer GetIconGClassSecResBase( Widget widget, XtPointer client_data ) /* unused */ { XtPointer widgetSecdataPtr; widgetSecdataPtr = (XtPointer) (IG_Cache(widget)); return (widgetSecdataPtr); } /************************************************************************ * InputDispatch ************************************************************************/ static void InputDispatch( Widget wid, XEvent *event, Mask event_mask) { if (event_mask & XmHELP_EVENT) _XmSocorro(wid,event,NULL,NULL); else if (event_mask & XmFOCUS_IN_EVENT) _XmFocusInGadget (wid, event, NULL, NULL); else if (event_mask & XmFOCUS_OUT_EVENT) _XmFocusOutGadget (wid, event, NULL, NULL); else if (event_mask & XmENTER_EVENT) _XmEnterGadget (wid, event, NULL, NULL); else if (event_mask & XmLEAVE_EVENT) _XmLeaveGadget (wid, event, NULL, NULL); } /************************************************************************ * GetBaselines ************************************************************************/ static Boolean GetBaselines( Widget wid, Dimension **baselines, int *line_count) { Dimension * base_array; Position label_y ; *line_count = 1; base_array = (Dimension *)XtMalloc(sizeof(Dimension)); GetLabelXY(wid, NULL, &label_y); if (IG_LabelString(wid) == NULL) { base_array[0] = IG_HLThickness(wid) + label_y ; } else { base_array[0] = IG_HLThickness(wid) + label_y + DEFAULT_LABEL_MARGIN_HEIGHT + XmStringBaseline(IG_RenderTable(wid), IG_LabelString(wid)); } *baselines = base_array; return(True); } /************************************************************************ * GetDisplayRect ************************************************************************/ static Boolean GetDisplayRect( Widget wid, XRectangle *displayrect) { Dimension w = 0, h = 0 ; (*displayrect).x = IG_HLThickness(wid); (*displayrect).y = IG_HLThickness(wid); GetSize(wid, &w, &h); (*displayrect).width = w - 2*IG_HLThickness(wid); (*displayrect).height = h - 2*IG_HLThickness(wid) ; return(True); } /************************************************************************ * MarginsProc ************************************************************************/ static void MarginsProc( Widget w, XmBaselineMargins *margins_rec) { if (margins_rec->get_or_set == XmBASELINE_GET) { margins_rec->margin_top = DEFAULT_LABEL_MARGIN_HEIGHT; margins_rec->margin_bottom = DEFAULT_LABEL_MARGIN_HEIGHT; margins_rec->shadow = IG_ShadowThickness(w); margins_rec->highlight = IG_HLThickness(w); margins_rec->text_height = IG_LabelRectHeight(w); margins_rec->margin_height = DEFAULT_LABEL_MARGIN_HEIGHT; } } /*--------------------- | XmIconGadget methods | ---------------------*/ /*------------ | ActionProcs | ------------*/ /*------------------- | Internal functions | -------------------*/ /************************************************************************ * ChangeHighlightGC ************************************************************************/ static void ChangeHighlightGC( Widget wid, XtEnum selection_mode, int line_width) { XtGCMask valueMask; XGCValues values; valueMask = GCLineStyle | GCLineWidth | GCDashList | GCCapStyle ; values.line_width = line_width; values.dashes = MAX(IG_HLThickness(wid), 8); values.cap_style = CapProjecting; values.line_style = (selection_mode == XmADD_MODE) ? LineDoubleDash : LineSolid; XChangeGC(XtDisplay(wid), IG_HighlightGC(wid), valueMask, &values); } /************************************************************************ * UpdateSelectGCs ************************************************************************/ static void UpdateSelectGCs( Widget wid, Pixel select_color) { XGCValues values; XtGCMask valueMask; XFontStruct *fs = (XFontStruct *)NULL; XtGCMask modifyMask = GCClipMask | GCClipXOrigin | GCClipYOrigin; if (IG_SelectedGC(wid)) XtReleaseGC(XtParent(wid),IG_SelectedGC(wid)); if (IG_InverseGC(wid)) XtReleaseGC(XtParent(wid),IG_InverseGC(wid)); valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.graphics_exposures = FALSE; /* we need a font becasue the inverse gc is going to be used to render some text */ if (XmeRenderTableGetDefaultFont(IG_RenderTable(wid), &fs)) { values.font = fs->fid; valueMask |= GCFont; } /* the select color can take the special value XmREVERSED_GROUND_COLORS, which means use parent background as ink for text and parent foreground as back for the icon rendering */ values.background = IG_Foreground(wid) ; if (select_color != XmREVERSED_GROUND_COLORS) { values.foreground = select_color ; IG_InverseGC(wid) = NULL ; } else { /* we need a GC to hold the parent background as ink */ XtVaGetValues(XtParent(wid), XmNbackground, &(values.foreground), NULL); IG_InverseGC(wid) = XtAllocateGC(XtParent(wid), XtParent(wid)->core.depth, valueMask, &values, modifyMask, 0); /* get the foreground for the inversed selected background */ values.background = IG_Background(wid) ; XtVaGetValues(XtParent(wid), XmNforeground, &(values.foreground), NULL); } IG_SelectedGC(wid) = XtAllocateGC(XtParent(wid), XtParent(wid)->core.depth, valueMask, &values, modifyMask, 0); } /************************************************************************ * UpdateGCs ************************************************************************/ static void UpdateGCs( Widget wid) { XGCValues values; XtGCMask valueMask; XFontStruct *fs = (XFontStruct *)NULL; XmContainerDataRec container_data ; Pixel select_color; XtGCMask modifyMask = GCClipMask | GCClipXOrigin | GCClipYOrigin; if (IG_NormalGC(wid)) XtReleaseGC(XtParent(wid),IG_NormalGC(wid)); if (IG_InsensitiveGC(wid)) XtReleaseGC(XtParent(wid),IG_InsensitiveGC(wid)); if (IG_BackgroundGC(wid)) XtReleaseGC(XtParent(wid),IG_BackgroundGC(wid)); if (IG_TopShadowGC(wid)) XtReleaseGC(XtParent(wid),IG_TopShadowGC(wid)); if (IG_BottomShadowGC(wid)) XtReleaseGC(XtParent(wid),IG_BottomShadowGC(wid)); if (IG_HighlightGC(wid)) XtReleaseGC(XtParent(wid),IG_HighlightGC(wid)); /** normal gc **/ valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = IG_Foreground(wid) ; values.background = IG_Background(wid) ; values.graphics_exposures = FALSE; if (XmeRenderTableGetDefaultFont(IG_RenderTable(wid), &fs)) { values.font = fs->fid; valueMask |= GCFont; } IG_NormalGC(wid) = XtAllocateGC(XtParent(wid), XtParent(wid)->core.depth, valueMask, &values, modifyMask, 0); /** background gc **/ values.foreground = IG_Background(wid) ; values.background = IG_Foreground(wid) ; if (PIXMAP_VALID(IG_BackgroundPixmap(wid))) { int depth ; XmeGetPixmapData(XtScreen(wid),IG_BackgroundPixmap(wid) , NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == 1) { valueMask |= GCFillStyle | GCStipple ; values.fill_style = FillOpaqueStippled; values.stipple = IG_BackgroundPixmap(wid); } else { valueMask |= GCFillStyle | GCTile ; values.fill_style = FillTiled; values.tile = IG_BackgroundPixmap(wid); } } IG_BackgroundGC(wid) = XtAllocateGC(XtParent(wid), XtParent(wid)->core.depth, valueMask, &values, modifyMask, 0); /** selected gcs **/ /* use a select color from the trait if possible, otherwise default to select background of the parent (or is it of the container logical parent ? not really important for the header case is not selectable... */ /* get the container information */ /* I need the selection mode for the highlight init value */ container_data.valueMask = ContSelectColor | ContSelectionMode; GetContainerData(wid, &container_data); if (container_data.valueMask & ContSelectColor) { select_color = container_data.select_color; } else { select_color = XmREVERSED_GROUND_COLORS ; } UpdateSelectGCs(wid, select_color) ; /** insensitive gc **/ #ifdef FIX_1381 /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor( wid); #else values.foreground = IG_Foreground(wid) ; #endif values.background = IG_Background(wid) ; #ifdef FIX_1381 valueMask |= GCFillStyle; values.fill_style = FillSolid; #else valueMask |= GCFillStyle | GCStipple; values.fill_style = FillOpaqueStippled; values.stipple = _XmGetInsensitiveStippleBitmap(wid); #endif IG_InsensitiveGC(wid) = XtAllocateGC(XtParent(wid), XtParent(wid)->core.depth, valueMask, &values, modifyMask, 0); #ifdef FIX_1381 /*light shadow for insensitive text (instead stipple)*/ values.foreground = IG_TopShadowColor(wid); IG_ShadowGC(wid) = XtAllocateGC(XtParent(wid), XtParent(wid)->core.depth, valueMask, &values, modifyMask, 0); #endif /** highlight **/ valueMask = (GCForeground | GCBackground | GCLineWidth | GCLineStyle | GCDashList); modifyMask = (GCLineStyle | GCLineWidth | GCDashList | GCClipXOrigin | GCClipYOrigin | GCClipMask); values.foreground = IG_HighlightColor(wid); XtVaGetValues(XtParent(wid), XmNbackground, &(values.background), NULL); values.line_width = IG_HLThickness(wid); values.dashes = MAX(values.line_width, 8); values.line_style = (container_data.selection_mode == XmADD_MODE) ? LineDoubleDash : LineSolid; IG_HighlightGC(wid) = XtAllocateGC(XtParent(wid), XtParent(wid)->core.depth, valueMask, &values, modifyMask, 0); /** topshadow, bottomshadow gc */ IG_TopShadowGC(wid) = _XmGetPixmapBasedGC (wid, IG_TopShadowColor(wid), IG_Background(wid), IG_TopShadowPixmap(wid)); IG_BottomShadowGC(wid) = _XmGetPixmapBasedGC (wid, IG_BottomShadowColor(wid), IG_Background(wid), IG_BottomShadowPixmap(wid)); } /************************************************************************ * GetStringTableReOrdered. * lazy alloc/filling using realloc * --- Never free the returned array.--- ************************************************************************/ static XmStringTable GetStringTableReOrdered( XmStringTable st, Cardinal st_count, Cardinal * order, Cardinal order_count) { static XmString * Default_st = NULL ; static Cardinal Max_st_count = 0; Cardinal i, count ; if (!order_count || !st_count) return NULL ; /* here we are filling up a new string table out of an existing one and a new order table. Take only the minimum number of both */ count = MIN(order_count, st_count); if (count > Max_st_count) { Max_st_count = MAX(count, 33); Default_st = (XmStringTable) XtRealloc((char*) Default_st, Max_st_count * sizeof(XmString)); } for (i = 0; i < count; i++) { if (order) { if (order[i] <= st_count) Default_st[i] = st[order[i] - 1]; else Default_st[i] = NULL ; } else { Default_st[i] = st[i]; } } return Default_st ; /* This is realloced memory, be sure that no one is keeping reference to this stuff longer enough for it to be realloced again */ } /************************************************************************ * GetStringTableExtent * 1> If the XmTablist has exactly as many entries as XmNdetailOrderCount, the last entry is clipped, and consequently, all IconGadgets will ask for the same size. 2> If the XmTablist is greater than XmNdetailOrderCount, the extra tabs are ignored 3> if the XmTablist is XmNdetailOrderCount-1, then the last detail is not clipped, but extends as far as needed. The IconGadget geometry request will be for the full size. The Container will ask for the maximum width requested by all its IconGadgets. 4> If the XmTablist is less than XmNdetailOrderCount-1, then, concatenate the extra details at the end and request the additional width. ************************************************************************/ static void GetStringTableExtent( Screen * screen, XmStringTable st, Cardinal st_count, XmRenderTable render_table, XmTabList tab_list, Dimension hor_spacing, /* for the tab-less concat details */ Dimension * width_ret, Dimension * height_ret, Position * baseline_ret) { Cardinal i ; Dimension w, h, baseline ; unsigned int tab_count = 0 ; Dimension height_under_max = 0 ; *baseline_ret = 0 ; *width_ret = 0 ; *height_ret = 0 ; if (tab_list) tab_count = XmTabListTabCount(tab_list) ; if (st == NULL || !st_count) return ; /* the extra tabs are ignored */ tab_count = MIN(tab_count, st_count); /* the width is given by the last tab position + the remaining items */ if (tab_count) *width_ret = _XmTabListGetPosition(screen, tab_list, XmPIXELS, tab_count-1); /* the height is the sum of max baseline + max height under baseline */ for (i = 0; i < st_count; i++) { if (st[i]) { XmStringExtent(render_table, st[i], &w, &h); baseline = XmStringBaseline(render_table, st[i]); } else { h = 0 ; w = 0 ; baseline = 0 ; } height_under_max = MAX(height_under_max, h - baseline); *baseline_ret = MAX(*baseline_ret, (Position)baseline); if (i >= tab_count) *width_ret += w + hor_spacing; } *height_ret = *baseline_ret + height_under_max ; } /************************************************************************ * GetSize ************************************************************************/ static void GetSize( Widget wid, Dimension * ret_width, Dimension * ret_height) { XmContainerDataRec container_data ; Dimension ht = IG_HLThickness(wid); Dimension mw = IG_MarginWidth(wid), mh = IG_MarginHeight(wid); int ideal_width, ideal_height; Dimension detail_width, detail_height; XmStringTable new_detail ; Position label_y, lab_baseline, detail_baseline ; /* get the container information */ container_data.valueMask = ContAllValid ; GetContainerData(wid, &container_data); /**** first the size without the detail */ ideal_width = GetIconLabelWidth(wid) ; ideal_height = GetIconLabelHeight(wid) ; if (SHOW_DETAIL(wid, &container_data)) { /* get the detail table to be displayed */ new_detail = GetStringTableReOrdered(IG_Detail(wid), IG_DetailCount(wid), container_data.detail_order, container_data.detail_order_count); /* ask for its extent using the provided container tab list */ /* new_detail might be NULL at this point, extent should return 0 size if so. some new_detail[i] might also be NULL, in which case extent should go to the next tab. note that tab might also be NULL. */ GetStringTableExtent(XtScreen(wid), new_detail, MIN(container_data.detail_order_count, IG_DetailCount(wid)), IG_RenderTable(wid), container_data.detail_tablist, DEFAULT_HOR_SPACING, &detail_width, &detail_height, &detail_baseline); /* width in detail is sum of first_column_width (where the x has been removed already) + the detail width */ ideal_width = container_data.first_column_width + (int)detail_width + mw - ht; /* the baseline have to be taken into account in the calculation of the height needed */ GetLabelXY(wid, NULL, &label_y); lab_baseline = XmStringBaseline(IG_RenderTable(wid), IG_LabelString(wid)); ideal_height = MAX(ideal_height, label_y - ht + DEFAULT_LABEL_MARGIN_HEIGHT + lab_baseline - mh - detail_baseline + detail_height); } /* do not set non null dimensions */ if (*ret_width == 0) *ret_width = ideal_width + 2*ht; if (*ret_height == 0) *ret_height = ideal_height + 2*ht; } /*------------------- | Trait methods | -------------------*/ /************************************************************************ * ContItemSetValues * * Deal with a container setting new attributes on me ************************************************************************/ static void ContItemSetValues(Widget w, XmContainerItemData contItemData) { XtExposeProc expose; /* here there is a match between the containerItem and the IconGadget resource values, because we are doing both at the same time and it's convenient. Others IconGadget kind might have to map our viewType, visualEmphasis values onto their corresponding types */ if (contItemData->valueMask & ContItemViewType) XtVaSetValues(w, XmNviewType, contItemData->view_type, NULL); if (contItemData->valueMask & ContItemVisualEmphasis) { IG_VisualEmphasis(w) = contItemData->visual_emphasis ; if (XtIsRealized(XtParent(w))) { _XmProcessLock(); expose = w->core.widget_class->core_class.expose; _XmProcessUnlock(); (* (expose)) (w, NULL, NULL); } } } /************************************************************************ * ContItemGetValues * ************************************************************************/ static void ContItemGetValues(Widget w, XmContainerItemData contItemData) { if (contItemData->valueMask & ContItemViewType) contItemData->view_type = IG_ViewType(w); if (contItemData->valueMask & ContItemVisualEmphasis) contItemData->visual_emphasis = IG_VisualEmphasis(w); if (contItemData->valueMask & ContItemIconWidth) { contItemData->icon_width = 2*IG_HLThickness(w) + GetIconLabelWidth(w); } if (contItemData->valueMask & ContItemDetailCount) { contItemData->detail_count = IG_DetailCount(w); } } /*ARGSUSED*/ static Boolean HandleRedraw ( Widget kid, Widget cur_parent, /* unused */ Widget new_parent, /* unused */ Mask visual_flag) { XmIconGadget ig = (XmIconGadget) kid ; Boolean redraw = False; XmIconGCacheObjPart oldCopy; if (visual_flag & VisualSelectColor) { XmContainerDataRec container_data ; Pixel select_color; /* this is all shared data, so we need to make a copy because changing any field */ _XmProcessLock(); _XmCacheCopy((XtPointer) IG_Cache(ig), (XtPointer) &oldCopy, sizeof(XmIconGCacheObjPart)); _XmCacheDelete ((XtPointer) IG_Cache(ig)); _XmProcessUnlock(); IG_Cache(ig) = &oldCopy; /* use a select color from the trait if possible, otherwise default to select background of the parent (or is it of the container logical parent ? not really important for the header case is not selectable... */ /* get the container information */ /* I need the selection mode for the highlight init value */ container_data.valueMask = ContSelectColor ; GetContainerData(kid, &container_data); if (container_data.valueMask & ContSelectColor) { select_color = container_data.select_color; } else { select_color = XmREVERSED_GROUND_COLORS ; } UpdateSelectGCs(kid, select_color) ; redraw = True; /* now cache back the new version */ _XmProcessLock(); IG_Cache(ig) = (XmIconGCacheObjPart *) _XmCachePart( IG_ClassCachePart(ig), (XtPointer) IG_Cache(ig), sizeof(XmIconGCacheObjPart)); _XmProcessUnlock(); } return redraw ; } static void GetColors(Widget w, XmAccessColorData color_data) { XmContainerDataRec container_data ; /* since we use our own private converter, no real need to check for validity here, we already do it in the converter itself, but it doesn't hurt and if we ever change IconG to use a generic pixmap converter (solve the mask pixmap setting), it will work all by itself */ if (IG_Cache(w)) { /* mean it's valid */ color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor | AccessSelectColor; color_data->background = IG_Background(w); color_data->foreground = IG_Foreground(w); color_data->highlight_color = IG_Foreground(w); color_data->top_shadow_color = IG_TopShadowColor(w); color_data->bottom_shadow_color = IG_BottomShadowColor(w); container_data.valueMask = ContSelectColor ; /*** get the Container select color using the trait */ { XmIconGadgetClass igc = (XmIconGadgetClass) XtClass(w); Widget container_id ; XmContainerTrait container_trait ; container_id = (igc->icong_class.get_container_parent) ? (*(igc->icong_class.get_container_parent))(w) : XtParent(w); container_trait = (XmContainerTrait) XmeTraitGet((XtPointer)XtClass(container_id), XmQTcontainer) ; /* remove message about uninitialized memory read */ container_data.first_column_width = 0; container_data.select_color = XmREVERSED_GROUND_COLORS; if (container_trait) container_trait->getValues(container_id, &container_data); } if (container_data.valueMask & ContSelectColor) { color_data->select_color = container_data.select_color; } else { color_data->select_color = XmREVERSED_GROUND_COLORS ; } } else { /* cannot access the color of the gadget, because the cache is not yet present. Return that value, so that the converter (probably the one calling it) can take the appropriate step */ color_data->valueMask = AccessColorInvalid ; } } static Boolean PointIn(Widget wid, Position x, Position y) { XmContainerDataRec container_data ; /* x, y in parent coordinates system */ /* first check that point is in bbox */ if (!(x >= wid->core.x && y >= wid->core.y && x < wid->core.x + wid->core.width && y < wid->core.y + wid->core.height)) return False; /* if we have detail then it's enough to answer yes */ container_data.valueMask = ContAllValid ; GetContainerData(wid, &container_data); if (SHOW_DETAIL(wid, &container_data)) return True; else { Position label_x, label_y; XPoint points[8]; Cardinal n; /* now check if it's not in empty space at the corners */ GetLabelXY(wid, &label_x, &label_y); /* undo the ltr layout for label_x, because getshapeinfo does it */ if (LayoutIsRtoLG(wid)) { label_x = XtWidth(wid) - IG_LabelRectWidth(wid) - label_x; } n = GetShapeInfo(wid, GetLargeIconX(wid), GetSmallIconY(wid), label_x, label_y, container_data.first_column_width, INVALID_DIMENSION, points); if (n == 2) { return (x >= points[0].x && x <= points[1].x && y >= points[0].y && y <= points[1].y); } else if (n == 8) { if (IG_ViewType(wid) == XmLARGE_ICON) { Cardinal p0, p2, p3, p5; if (!LayoutIsRtoLG(wid)) { p0 = 0; p2 = 2; p3 = 3; p5 = 5; } else { p0 = 5; p2 = 3; p3 = 2; p5 = 0; } return (y <= points[1].y && /* pixmap row */ x >= points[p2].x && x <= points[p3].x) || (y >= points[1].y && /* label row */ x >= points[p0].x && x <= points[p5].x); } else { /* SMALL_ICON */ return (((!LayoutIsRtoLG(wid) && x <= points[1].x) || (LayoutIsRtoLG(wid) && x >= points[1].x)) && /* pixmap column */ y >= points[0].y && y <= points[7].y) || (((!LayoutIsRtoLG(wid) && x >= points[1].x) || (LayoutIsRtoLG(wid) && x <= points[1].x)) && /* label row */ y >= points[2].y && y <= points[5].y); } } return True; /* actually we should never get there */ } } /*------------------- | _Xm functions | --------------------*/ void _XmIconGadgetIconPos(Widget wid, int *x, int *y) { XmIconGadget ig = (XmIconGadget)wid; Position icon_x; if (ig -> icong.viewtype == XmSMALL_ICON) { icon_x = GetSmallIconX(wid); if (LayoutIsRtoLG(wid)) icon_x = XtWidth(wid) - icon_x - IG_SmallIconRectWidth(wid); *x = icon_x; *y = GetSmallIconY(wid); } else { icon_x = GetLargeIconX(wid); if (LayoutIsRtoLG(wid)) icon_x = XtWidth(wid) - icon_x - IG_LargeIconRectWidth(wid); *x = icon_x; *y = GetLargeIconY(wid); } } /*------------------- | External functions | -------------------*/ /************************************************************************ * XmCreateIconGadget * ************************************************************************/ Widget XmCreateIconGadget( Widget parent, char *name, ArgList arglist, Cardinal argcount) { return(XtCreateWidget(name,xmIconGadgetClass,parent,arglist,argcount)); } Widget XmVaCreateIconGadget( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmIconGadgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedIconGadget( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmIconGadgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/Ext18ListP.h0000644000175000017500000000600712672140200012750 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmExt18ListP_h_ #define _XmExt18ListP_h_ #include "XmP.h" #undef XmIsExt18List #define XmIsExt18List(w) \ (_XmIsFastSubclass(XtClass(w), XmEXT18LIST_BIT)) #include #include #include #include #if defined(__cplusplus) extern "C" { #endif #define XmExt18List_DEFAULT_VISIBLE_COUNT XmMULTILIST_DEFAULT_VISIBLE_COUNT #define XmExt18ListIndex (XmManagerIndex + 1) #define XmExt18List_title(w) (((XmExt18ListWidget)(w))->ext_list.title) #define XmExt18List_find_label(w) (((XmExt18ListWidget)(w))->ext_list.find_label) #define XmExt18List_double_click(w) (((XmExt18ListWidget)(w))->ext_list.double_click) #define XmExt18List_single_select(w) (((XmExt18ListWidget)(w))->ext_list.single_select) #define XmExt18List_show_find(w) (((XmExt18ListWidget)(w))->ext_list.show_find) #define XmExt18List_title_wid(w) (((XmExt18ListWidget)(w))->ext_list.title_wid) #define XmExt18List_frame(w) (((XmExt18ListWidget)(w))->ext_list.frame) #define XmExt18List_ilist(w) (((XmExt18ListWidget)(w))->ext_list.ilist) #define XmExt18List_v_bar(w) (((XmExt18ListWidget)(w))->ext_list.v_bar) #define XmExt18List_h_bar(w) (((XmExt18ListWidget)(w))->ext_list.h_bar) #define XmExt18List_find(w) (((XmExt18ListWidget)(w))->ext_list.find) #define XmExt18List_find_text(w) (((XmExt18ListWidget)(w))->ext_list.find_text) #define XmExt18List_last_search(w) (((XmExt18ListWidget)(w))->ext_list.last_search) #define XmExt18List_item_found(w) (((XmExt18ListWidget)(w))->ext_list.item_found) #define XmExt18List_not_found(w) (((XmExt18ListWidget)(w))->ext_list.not_found) #define XmExt18List_visible_rows(w) (((XmExt18ListWidget)(w))->ext_list.visible_rows) #define XmExt18List_title_string(w) (((XmExt18ListWidget)(w))->ext_list.title_string) typedef XmMultiListClassPart XmExt18ListClassPart; typedef XmMultiListClassRec XmExt18ListClassRec; typedef XmMultiListPart XmExt18ListPart; typedef XmMultiListRec XmExt18ListRec; extern XmExt18ListClassRec xmExt18ListClassRec XM_DEPRECATED; extern XmI18ListClassRec xiI18ListClassRec; extern WidgetClass xmI18ListWidgetClass; #if defined(__cplusplus) } #endif #endif /* _XmExt18ListP_h_ */ motif-2.3.8/lib/Xm/RCHook.c0000644000175000017500000001512512672140200012204 00000000000000/* $XConsortium: RCHook.c /main/10 1996/12/16 18:32:29 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "ColorObjI.h" #include "RCHookI.h" /**********************************************************************/ /** RCHook **/ /** With new "per-display" color objects, we need to check to see **/ /** if this ColorObj is using the color server before we set up **/ /** any special colors. **/ /** **/ /**********************************************************************/ /*ARGSUSED*/ void _XmRCColorHook( Widget w, ArgList alIn, /* unused */ Cardinal *acPtrIn ) /* unused */ { Arg al[10]; int ac; unsigned char rcType; static int mono, color, colorPrim, init=0; static Screen *screen; Pixmap ditherPix, solidPix; XmColorObj tmpColorObj=NULL; Pixel defaultBackground; int depth = w->core.depth ; Display *ColorObjCacheDisplay; XContext ColorObjCache; XmColorObj DefaultColorObj; _XmProcessLock(); ColorObjCacheDisplay = _XmColorObjCacheDisplay; ColorObjCache = _XmColorObjCache; DefaultColorObj = _XmDefaultColorObj; _XmProcessUnlock(); /** get the colorObj for this display connection **/ if (XFindContext(ColorObjCacheDisplay, (XID)XtDisplay(w), ColorObjCache, (XPointer *)&tmpColorObj) != 0) { /* none found, use default */ if (DefaultColorObj) tmpColorObj = DefaultColorObj; else /* this should NEVER happen... RowColInitHook won't get called */ return; } /** don't set colors if this display isn't using the color server **/ if (!tmpColorObj->color_obj.colorIsRunning) return; ac = 0; XtSetArg (al[ac], XmNrowColumnType, &rcType); ac++; XtSetArg (al[ac], XmNbackground, &defaultBackground); ac++; XtGetValues (w, al, ac); if (rcType == XmMENU_BAR) /* set to secondary, rather than primary */ { _XmProcessLock(); if (!init) { if (tmpColorObj->color_obj. colorUse[tmpColorObj->color_obj.myScreen] == XmCO_BLACK_WHITE) mono = 1; else mono = 0; color = tmpColorObj->color_obj.secondary; colorPrim = tmpColorObj->color_obj.primary; screen = XtScreen(tmpColorObj); init = 1; } _XmProcessUnlock(); /** if background didn't default to ColorObj, don't overwrite colors **/ if (defaultBackground != tmpColorObj->color_obj.myColors[colorPrim].bg) return; ac = 0; XtSetArg (al[ac], XmNbackground, tmpColorObj->color_obj.myColors[color].bg); ac++; XtSetArg (al[ac], XmNforeground, tmpColorObj->color_obj.myColors[color].fg); ac++; XtSetArg (al[ac], XmNtopShadowColor, tmpColorObj->color_obj.myColors[color].ts); ac++; XtSetArg (al[ac], XmNbottomShadowColor, tmpColorObj->color_obj.myColors[color].bs); ac++; /** put dithers for top shadows if needed **/ if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, tmpColorObj->color_obj.myScreen, &tmpColorObj->color_obj.myColors[color])) { if (mono) ditherPix = XmGetPixmapByDepth (screen, XmS50_foreground, BlackPixelOfScreen(screen), WhitePixelOfScreen(screen), depth); else ditherPix = XmGetPixmapByDepth (screen, XmS50_foreground, tmpColorObj->color_obj.myColors[color].bg, WhitePixelOfScreen(screen), depth); XtSetArg (al[ac], XmNtopShadowPixmap, ditherPix); ac++; } else /** see if we need to "undo" primary dither **/ if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, tmpColorObj->color_obj.myScreen, &tmpColorObj->color_obj.myColors[colorPrim])) { /* simulate solid white (will happen for B_W case only)*/ solidPix = XmGetPixmapByDepth (screen, "background", WhitePixelOfScreen(screen), WhitePixelOfScreen(screen), depth); XtSetArg (al[ac], XmNtopShadowPixmap, solidPix); ac++; } /** put dithers for bottom shadows if needed **/ if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, tmpColorObj->color_obj.myScreen, &tmpColorObj->color_obj.myColors[color])) { if (mono) ditherPix = XmGetPixmapByDepth (screen, XmS50_foreground, BlackPixelOfScreen(screen), WhitePixelOfScreen(screen), depth); else ditherPix = XmGetPixmapByDepth (screen, XmS50_foreground, tmpColorObj->color_obj.myColors[color].bg, BlackPixelOfScreen(screen), depth); XtSetArg (al[ac], XmNbottomShadowPixmap, ditherPix); ac++; } else /** see if we need to "undo" primary dither **/ if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, tmpColorObj->color_obj.myScreen, &tmpColorObj->color_obj.myColors[colorPrim])) { /* simulate solid black (will happen for B_W case only)*/ solidPix = XmGetPixmapByDepth (screen, "background", BlackPixelOfScreen(screen), BlackPixelOfScreen(screen), depth); XtSetArg (al[ac], XmNbottomShadowPixmap, solidPix); ac++; } XtSetValues (w, al, ac); } } motif-2.3.8/lib/Xm/ScrollBar.h0000644000175000017500000000531313145162623012756 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScrollBar_h #define _XmScrollBar_h #include #ifdef __cplusplus extern "C" { #endif /* ScrollBar Widget */ externalref WidgetClass xmScrollBarWidgetClass; typedef struct _XmScrollBarClassRec * XmScrollBarWidgetClass; typedef struct _XmScrollBarRec * XmScrollBarWidget; /* ifndef for Fast Subclassing */ #ifndef XmIsScrollBar #define XmIsScrollBar(w) XtIsSubclass(w, xmScrollBarWidgetClass) #endif /* XmIsScrollBar */ /******** Public Function Declarations ********/ extern Widget XmCreateScrollBar( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern void XmScrollBarGetValues( Widget w, int *value, int *slider_size, int *increment, int *page_increment) ; extern void XmScrollBarSetValues( Widget w, int value, int slider_size, int increment, int page_increment, #if NeedWidePrototypes int notify) ; #else Boolean notify) ; #endif /* NeedWidePrototypes */ /* * Variable argument list functions */ extern Widget XmVaCreateScrollBar( Widget parent, char *name, ...); extern Widget XmVaCreateManagedScrollBar( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScrollBar_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TabBoxP.h0000644000175000017500000001720212672140200012361 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmTabBoxP_h_ #define _XmTabBoxP_h_ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmTabBoxClassPart { XtPointer extension; } XmTabBoxClassPart; typedef struct _XmTabBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmTabBoxClassPart tab_box_class; } XmTabBoxClassRec; externalref XmTabBoxClassRec xmTabBoxClassRec; typedef struct _XmTabBoxPart { XmFontList font_list; XmTabStyle tab_style; XmTabMode tab_mode; XmTabbedStackList tab_list; XmTabOrientation tab_orientation; XmTabEdge tab_edge; XmTabArrowPlacement arrow_placement; unsigned char orientation; Dimension tab_margin_width; Dimension tab_margin_height; Dimension tab_label_spacing; Dimension highlight_thickness; int tab_corner_percent; Dimension tab_offset; Boolean uniform_tab_size; Boolean tab_auto_select; Boolean use_image_cache; Pixel select_color; Pixmap select_pixmap; int num_stacks; int selected_index; int traversal_index; Boolean stacked_effect; XtCallbackList select_callback; XtCallbackList unselect_callback; /* Private */ GC _tab_GC; GC _text_GC; Pixmap _gray_stipple; XRectangle *_wanted; int _num_wanted; struct _XmTabRect *_actual; int _num_actual; int _selected; int _keyboard; int _armed_tab; int _scroll_x; XRectangle _scroll_rect; int _corner_size; int _num_columns; int _num_rows; /* * The following data memebers are used for the rotation of * the pixmap and the text. */ int _bitmap_width; int _bitmap_height; Pixmap _bitmap; GC _zero_GC; GC _one_GC; Widget _canvas; Widget _left_arrow; Widget _right_arrow; Boolean _inited; struct _XmCache *_cache; int _cache_size; Boolean check_set_render_table; } XmTabBoxPart; /* * Access macros for instance variables */ #define XmTabBox_font_list(w) (((XmTabBoxWidget)(w))->tab_box.font_list) #define XmTabBox_tab_style(w) (((XmTabBoxWidget)(w))->tab_box.tab_style) #define XmTabBox_tab_mode(w) (((XmTabBoxWidget)(w))->tab_box.tab_mode) #define XmTabBox_tab_list(w) (((XmTabBoxWidget)(w))->tab_box.tab_list) #define XmTabBox_tab_orientation(w) (((XmTabBoxWidget)(w))->tab_box.tab_orientation) #define XmTabBox_tab_edge(w) (((XmTabBoxWidget)(w))->tab_box.tab_edge) #define XmTabBox_arrow_placement(w) (((XmTabBoxWidget)(w))->tab_box.arrow_placement) #define XmTabBox_orientation(w) (((XmTabBoxWidget)(w))->tab_box.orientation) #define XmTabBox_tab_margin_width(w) (((XmTabBoxWidget)(w))->tab_box.tab_margin_width) #define XmTabBox_tab_margin_height(w) (((XmTabBoxWidget)(w))->tab_box.tab_margin_height) #define XmTabBox_tab_label_spacing(w) (((XmTabBoxWidget)(w))->tab_box.tab_label_spacing) #define XmTabBox_highlight_thickness(w) (((XmTabBoxWidget)(w))->tab_box.highlight_thickness) #define XmTabBox_tab_corner_percent(w) (((XmTabBoxWidget)(w))->tab_box.tab_corner_percent) #define XmTabBox_tab_offset(w) (((XmTabBoxWidget)(w))->tab_box.tab_offset) #define XmTabBox_uniform_tab_size(w) (((XmTabBoxWidget)(w))->tab_box.uniform_tab_size) #define XmTabBox_tab_auto_select(w) (((XmTabBoxWidget)(w))->tab_box.tab_auto_select) #define XmTabBox_use_image_cache(w) (((XmTabBoxWidget)(w))->tab_box.use_image_cache) #define XmTabBox_select_color(w) (((XmTabBoxWidget)(w))->tab_box.select_color) #define XmTabBox_select_pixmap(w) (((XmTabBoxWidget)(w))->tab_box.select_pixmap) #define XmTabBox_num_stacks(w) (((XmTabBoxWidget)(w))->tab_box.num_stacks) #define XmTabBox_selected_index(w) (((XmTabBoxWidget)(w))->tab_box.selected_index) #define XmTabBox_traversal_index(w) (((XmTabBoxWidget)(w))->tab_box.traversal_index) #define XmTabBox_stacked_effect(w) (((XmTabBoxWidget)(w))->tab_box.stacked_effect) #define XmTabBox_select_callback(w) (((XmTabBoxWidget)(w))->tab_box.select_callback) #define XmTabBox_unselect_callback(w) (((XmTabBoxWidget)(w))->tab_box.unselect_callback) #define XmTabBox__tab_GC(w) (((XmTabBoxWidget)(w))->tab_box._tab_GC) #define XmTabBox__text_GC(w) (((XmTabBoxWidget)(w))->tab_box._text_GC) #define XmTabBox__gray_stipple(w) (((XmTabBoxWidget)(w))->tab_box._gray_stipple) #define XmTabBox__wanted(w) (((XmTabBoxWidget)(w))->tab_box._wanted) #define XmTabBox__num_wanted(w) (((XmTabBoxWidget)(w))->tab_box._num_wanted) #define XmTabBox__actual(w) (((XmTabBoxWidget)(w))->tab_box._actual) #define XmTabBox__num_actual(w) (((XmTabBoxWidget)(w))->tab_box._num_actual) #define XmTabBox__selected(w) (((XmTabBoxWidget)(w))->tab_box._selected) #define XmTabBox__keyboard(w) (((XmTabBoxWidget)(w))->tab_box._keyboard) #define XmTabBox__armed_tab(w) (((XmTabBoxWidget)(w))->tab_box._armed_tab) #define XmTabBox__scroll_x(w) (((XmTabBoxWidget)(w))->tab_box._scroll_x) #define XmTabBox__scroll_rect(w) (((XmTabBoxWidget)(w))->tab_box._scroll_rect) #define XmTabBox__corner_size(w) (((XmTabBoxWidget)(w))->tab_box._corner_size) #define XmTabBox__num_columns(w) (((XmTabBoxWidget)(w))->tab_box._num_columns) #define XmTabBox__num_rows(w) (((XmTabBoxWidget)(w))->tab_box._num_rows) #define XmTabBox__bitmap_width(w) (((XmTabBoxWidget)(w))->tab_box._bitmap_width) #define XmTabBox__bitmap_height(w) (((XmTabBoxWidget)(w))->tab_box._bitmap_height) #define XmTabBox__bitmap(w) (((XmTabBoxWidget)(w))->tab_box._bitmap) #define XmTabBox__zero_GC(w) (((XmTabBoxWidget)(w))->tab_box._zero_GC) #define XmTabBox__one_GC(w) (((XmTabBoxWidget)(w))->tab_box._one_GC) #define XmTabBox__canvas(w) (((XmTabBoxWidget)(w))->tab_box._canvas) #define XmTabBox__left_arrow(w) (((XmTabBoxWidget)(w))->tab_box._left_arrow) #define XmTabBox__right_arrow(w) (((XmTabBoxWidget)(w))->tab_box._right_arrow) #define XmTabBox__inited(w) (((XmTabBoxWidget)(w))->tab_box._inited) #define XmTabBox__cache(w) (((XmTabBoxWidget)(w))->tab_box._cache) #define XmTabBox__cache_size(w) (((XmTabBoxWidget)(w))->tab_box._cache_size) typedef struct _XmTabBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmTabBoxPart tab_box; } XmTabBoxRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* __TabBoxP_h__ */ motif-2.3.8/lib/Xm/TransferP.h0000644000175000017500000000421112672140200012762 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $TOG: TransferP.h /main/6 1999/09/01 17:14:43 mgreess $ */ #ifndef _TransferP_H #define _TransferP_H #include #ifdef __cplusplus extern "C" { #endif extern void XmeConvertMerge(XtPointer, Atom, int, unsigned long, XmConvertCallbackStruct*); extern Boolean XmePrimarySource(Widget, Time); extern Boolean XmeNamedSource(Widget, Atom, Time); extern Boolean XmeSecondarySource(Widget, Time); extern void XmeSecondaryTransfer(Widget, Atom, XtEnum, Time); extern Boolean XmeClipboardSource(Widget, XtEnum, Time); extern Widget XmeDragSource(Widget, XtPointer, XEvent*, ArgList, Cardinal); extern Boolean XmePrimarySink(Widget, XtEnum, XtPointer, Time); extern Boolean XmeNamedSink(Widget, Atom, XtEnum, XtPointer, Time); extern Boolean XmeSecondarySink(Widget, Time); extern Boolean XmeClipboardSink(Widget, XtEnum, XtPointer); extern void XmeDropSink(Widget, ArgList, Cardinal); extern Atom *XmeStandardTargets(Widget, int, int*); extern void XmeStandardConvert(Widget, XtPointer, XmConvertCallbackStruct*); extern Atom XmeGetEncodingAtom(Widget); extern void XmeTransferAddDoneProc(XtPointer, XmSelectionFinishedProc); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _TransferP_H */ motif-2.3.8/lib/Xm/FormP.h0000644000175000017500000000622613145162623012122 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmFormP_h #define _XmFormP_h #include #include #ifdef __cplusplus extern "C" { #endif /* define index constants which are used to access attribute array of Form * so that subclass of Form can make use of them. */ #define _XmFORM_LEFT 0 #define _XmFORM_RIGHT 1 #define _XmFORM_TOP 2 #define _XmFORM_BOTTOM 3 typedef struct _XmFormAttachmentRec { unsigned char type; Widget w; int percent; int offset; int value; int tempValue; } XmFormAttachmentRec, * XmFormAttachment; #ifdef att #undef att #endif typedef struct _XmFormConstraintPart { XmFormAttachmentRec att[4]; Widget next_sibling; Boolean sorted; Boolean resizable; Dimension preferred_width, preferred_height; } XmFormConstraintPart, * XmFormConstraint; typedef struct _XmFormConstraintRec { XmManagerConstraintPart manager; XmFormConstraintPart form; } XmFormConstraintRec, * XmFormConstraintPtr; /* Form class structure */ typedef struct _XmFormClassPart { XtPointer extension; /* Pointer to extension record */ } XmFormClassPart; /* Full class record declaration for form class */ typedef struct _XmFormClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmFormClassPart form_class; } XmFormClassRec; externalref XmFormClassRec xmFormClassRec; /* The Form instance record */ typedef struct _XmFormPart { Dimension horizontal_spacing; Dimension vertical_spacing; int fraction_base; Boolean rubber_positioning; Widget first_child; Boolean initial_width, initial_height; Boolean processing_constraints; } XmFormPart; /* Full instance record declaration */ typedef struct _XmFormRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmFormPart form; } XmFormRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmFormP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DrawingA.c0000644000175000017500000004670513145162623012574 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DrawingA.c /main/16 1999/10/13 16:16:41 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include "DrawingAI.h" #include "GadgetUtiI.h" #include "GMUtilsI.h" #include "RepTypeI.h" #include "TraversalI.h" #include "XmI.h" #define MARGIN_DEFAULT 10 #define defaultTranslations _XmDrawingA_defaultTranslations #define traversalTranslations _XmDrawingA_traversalTranslations /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass w_class) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void Resize( Widget wid) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget wid) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired) ; static XmNavigability WidgetNavigable( Widget wid) ; /******** End Static Function Declarations ********/ static XtActionsRec actionsList[] = { { "DrawingAreaInput", _XmDrawingAreaInput }, }; /* Resource definitions for DrawingArea */ static XtResource resources[] = { { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmDrawingAreaRec, drawing_area.margin_width), XmRImmediate, (XtPointer) MARGIN_DEFAULT }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf(XmDrawingAreaRec, drawing_area.margin_height), XmRImmediate, (XtPointer) MARGIN_DEFAULT }, { XmNresizeCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(XmDrawingAreaRec, drawing_area.resize_callback), XmRImmediate, (XtPointer) NULL }, { XmNexposeCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(XmDrawingAreaRec, drawing_area.expose_callback), XmRImmediate, (XtPointer) NULL }, { XmNinputCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(XmDrawingAreaRec, drawing_area.input_callback), XmRImmediate, (XtPointer) NULL }, #ifndef XM_PART_BC { XmNconvertCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(XmDrawingAreaRec, drawing_area.convert_callback), XmRImmediate, (XtPointer) NULL }, { XmNdestinationCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(XmDrawingAreaRec, drawing_area.destination_callback), XmRImmediate, (XtPointer) NULL }, #endif { XmNresizePolicy, XmCResizePolicy, XmRResizePolicy, sizeof (unsigned char), XtOffsetOf(XmDrawingAreaRec, drawing_area.resize_policy), XmRImmediate, (XtPointer) XmRESIZE_ANY }, }; static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof (Dimension), XtOffsetOf(XmDrawingAreaRec, drawing_area.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof (Dimension), XtOffsetOf(XmDrawingAreaRec, drawing_area.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, }; /**************************************************************** * * Full class record constant * ****************************************************************/ static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* getValuesPrehook */ NULL, /* getValuesPosthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ NULL /* focusChange */ }; externaldef( xmdrawingareaclassrec) XmDrawingAreaClassRec xmDrawingAreaClassRec = { { /* core_class fields */ (WidgetClass) &xmManagerClassRec, /* superclass */ "XmDrawingArea", /* class_name */ sizeof(XmDrawingAreaRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_init */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ FALSE, /* compress_exposure */ TRUE, /* compress_enterlv */ FALSE, /* visible_interest */ NULL, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ defaultTranslations, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator*/ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ NULL, /* resource list */ 0, /* num resources */ sizeof(XmManagerConstraintRec), /* constraint size */ NULL, /* init proc */ NULL, /* destroy proc */ NULL, /* set values proc */ NULL, /* extension */ }, { /* manager_class fields */ traversalTranslations, /* translations */ syn_resources, /* syn_resources */ XtNumber (syn_resources), /* num_get_resources */ NULL, /* syn_cont_resources */ 0, /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* drawingArea class */ (XtPointer) NULL, /* extension pointer */ } }; externaldef( xmdrawingareawidgetclass) WidgetClass xmDrawingAreaWidgetClass = (WidgetClass) &xmDrawingAreaClassRec ; /****************************************************************/ static void ClassInitialize( void ) { baseClassExtRec.record_type = XmQmotif ; } /****************************************************************/ static void ClassPartInitialize( WidgetClass w_class ) { _XmFastSubclassInit( w_class, XmDRAWING_AREA_BIT) ; } /**************************************************************** * Initialize. Check resizePolicy resource value ****************/ /*ARGSUSED*/ static void Initialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmDrawingAreaWidget new_w = (XmDrawingAreaWidget) nw ; if(new_w->drawing_area.resize_policy != XmRESIZE_SWINDOW && !XmRepTypeValidValue(XmRID_RESIZE_POLICY, new_w->drawing_area.resize_policy, (Widget) new_w) ) { new_w->drawing_area.resize_policy = XmRESIZE_ANY ; } } /**************************************************************** * General redisplay function called on exposure events. ****************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmDrawingAreaWidget da = (XmDrawingAreaWidget) wid ; XmDrawingAreaCallbackStruct cb; /****************/ cb.reason = XmCR_EXPOSE; cb.event = event; cb.window = XtWindow (da); XtCallCallbackList ((Widget) da, da->drawing_area.expose_callback, &cb); XmeRedisplayGadgets( (Widget) da, event, region); } /**************************************************************** * Invoke the application resize callbacks. ****************/ static void Resize( Widget wid ) { XmDrawingAreaWidget da = (XmDrawingAreaWidget) wid ; XmDrawingAreaCallbackStruct cb; cb.reason = XmCR_RESIZE; cb.event = NULL; cb.window = XtWindow (da); XtCallCallbackList ((Widget) da, da->drawing_area.resize_callback, &cb); } static Widget ObjectAtPoint( Widget wid, Position x, Position y ) { CompositeWidget cw = (CompositeWidget) wid ; register int i; register Widget widget; i = cw->composite.num_children ; while( i-- ) { widget = cw->composite.children[i]; /* do not care for gadget only for the DA input */ if (XmIsGadget(widget) && XtIsManaged (widget)) { if (x >= widget->core.x && y >= widget->core.y && x < widget->core.x + widget->core.width && y < widget->core.y + widget->core.height) return (widget); } } return (NULL); } /**************************************************************** * This function processes key and button presses and releases * belonging to the DrawingArea. ****************/ /*ARGSUSED*/ void _XmDrawingAreaInput( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDrawingAreaWidget da = (XmDrawingAreaWidget) wid ; XmDrawingAreaCallbackStruct cb ; int x, y ; Boolean button_event = True, input_on_gadget ; if ((event->type == ButtonPress) || (event->type == ButtonRelease)) { x = event->xbutton.x ; y = event->xbutton.y ; } else if (event->type == MotionNotify) { x = event->xmotion.x ; y = event->xmotion.y ; } else if ((event->type == KeyPress) || (event->type == KeyRelease)) { x = event->xkey.x ; y = event->xkey.y ; button_event = False ; } else return ; /* Unrecognized event (cannot determine x, y of pointer).*/ input_on_gadget = (ObjectAtPoint((Widget)da, x, y) != NULL); if (!input_on_gadget && (!da->manager.active_child || button_event)) { cb.reason = XmCR_INPUT ; cb.event = event ; cb.window = XtWindow( da) ; XtCallCallbackList ((Widget) da, da->drawing_area.input_callback, &cb) ; } } /****************************************************************/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XmDrawingAreaWidget da; /* XtGeometryHandler manager ; */ /****************/ da = (XmDrawingAreaWidget) w->core.parent; /* function shared with Bulletin Board */ return(_XmGMHandleGeometryManager((Widget)da, w, request, reply, da->drawing_area.margin_width, da->drawing_area.margin_height, da->drawing_area.resize_policy, True)); /* no overlap checking */ } /**************************************************************** * Re-layout children. ****************/ static void ChangeManaged( Widget wid ) { XmDrawingAreaWidget da = (XmDrawingAreaWidget) wid ; /* function shared with Bulletin Board */ _XmGMEnforceMargin((XmManagerWidget)da, da->drawing_area.margin_width, da->drawing_area.margin_height, False); /* use movewidget, not setvalue */ /* The first time, reconfigure only if explicit size were not given */ if (XtIsRealized((Widget)da) || (!XtWidth(da)) || (!XtHeight(da))) { /* function shared with Bulletin Board */ (void)_XmGMDoLayout((XmManagerWidget)da, da->drawing_area.margin_width, da->drawing_area.margin_height, da->drawing_area.resize_policy, False); /* queryonly not specified */ } XmeNavigChangeManaged((Widget) da) ; } /****************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmDrawingAreaWidget current = (XmDrawingAreaWidget) cw ; XmDrawingAreaWidget new_w = (XmDrawingAreaWidget) nw ; if(new_w->drawing_area.resize_policy != XmRESIZE_SWINDOW && !XmRepTypeValidValue(XmRID_RESIZE_POLICY, new_w->drawing_area.resize_policy, (Widget) new_w) ) { new_w->drawing_area.resize_policy = current->drawing_area.resize_policy ; } /* If new margins, re-enforce them using movewidget, then update the width and height so that XtSetValues does the geometry request */ if (XtIsRealized((Widget) new_w) && (((new_w->drawing_area.margin_width != current->drawing_area.margin_width) || (new_w->drawing_area.margin_height != current->drawing_area.margin_height)))) { /* move the child around if necessary */ _XmGMEnforceMargin((XmManagerWidget)new_w, new_w->drawing_area.margin_width, new_w->drawing_area.margin_height, False); /* use movewidget, no request */ _XmGMCalcSize ((XmManagerWidget)new_w, new_w->drawing_area.margin_width, new_w->drawing_area.margin_height, &new_w->core.width, &new_w->core.height); } return( False) ; } /**************************************************************** * Handle query geometry requests ****************/ static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) { XmDrawingAreaWidget da = (XmDrawingAreaWidget) wid ; /* function shared with Bulletin Board */ return(_XmGMHandleQueryGeometry(wid, intended, desired, da->drawing_area.margin_width, da->drawing_area.margin_height, da->drawing_area.resize_policy)); } /**************************************************************** * Xm private class method ****************/ static XmNavigability WidgetNavigable( Widget wid) { if( XtIsSensitive(wid) && ((XmManagerWidget) wid)->manager.traversal_on ) { XmNavigationType nav_type = ((XmManagerWidget) wid) ->manager.navigation_type ; Widget *children = ((XmManagerWidget) wid)->composite.children ; unsigned idx = 0 ; /* If a Drawing Area has a navigable child, and initial focus is either NULL or point to this child, allow navigation to it. */ while(idx < ((XmManagerWidget) wid)->composite.num_children) { if (_XmGetNavigability(children[idx]) && ((((XmManagerWidget) wid)->manager.initial_focus == NULL) || (((XmManagerWidget) wid)->manager.initial_focus == children[idx]))){ if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid))) { return XmDESCENDANTS_TAB_NAVIGABLE ; } return XmDESCENDANTS_NAVIGABLE ; } ++idx ; } /* else just return the DA itself */ if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmTAB_NAVIGABLE ; } return XmCONTROL_NAVIGABLE ; } return XmNOT_NAVIGABLE ; } /**************************************************************** * This function creates and returns a DrawingArea widget. ****************/ Widget XmCreateDrawingArea( Widget p, String name, ArgList args, Cardinal n ) { /****************/ return( XtCreateWidget( name, xmDrawingAreaWidgetClass, p, args, n)) ; } Widget XmVaCreateDrawingArea( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDrawingAreaWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedDrawingArea( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDrawingAreaWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/PanedW.h0000644000175000017500000000443113145162623012251 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /**************************************************************** * * Vertical Paned Widget (SubClass of CompositeClass) * ****************************************************************/ #ifndef _XmPanedW_h #define _XmPanedW_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constant */ externalref WidgetClass xmPanedWindowWidgetClass; #ifndef XmIsPanedWindow #define XmIsPanedWindow(w) XtIsSubclass(w, xmPanedWindowWidgetClass) #endif /* XmIsPanedWindow */ typedef struct _XmPanedWindowClassRec *XmPanedWindowWidgetClass; typedef struct _XmPanedWindowRec *XmPanedWindowWidget; /******** Public Function Declarations ********/ extern Widget XmCreatePanedWindow( Widget parent, char *name, ArgList args, Cardinal argCount) ; /* * Variable argument list functions */ extern Widget XmVaCreatePanedWindow( Widget parent, char *name, ...); extern Widget XmVaCreateManagedPanedWindow( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPanedWindow_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ResEncodI.h0000644000175000017500000000263112672140200012675 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ResEncodI.h /main/5 1995/07/13 17:49:43 drk $ */ #ifndef _XmResEncodI_h #define _XmResEncodI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for ResEncod.c ********/ XtPointer _XmGetEncodingRegistryTarget(int*); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmResEncodI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStrDefs22.ht0000644000175000017500000000074012672140200013270 00000000000000/* $TOG: XmStrDefs22.ht /main/2 1997/06/18 17:50:15 samborn $ */ #ifndef _XmStrDefs22_h_ #define _XmStrDefs22_h_ #include #ifndef _XmConst #define _XmConst /**/ #endif #ifdef __cplusplus extern "C" { #endif <<>> #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs22_h_ */ motif-2.3.8/lib/Xm/DragIconP.h0000644000175000017500000000413013145162623012675 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragIconP_h #define _XmDragIconP_h #include #include #ifdef __cplusplus extern "C" { #endif typedef void (*XmCloneVisualProc) (XmDragIconObject, Widget, Widget); typedef void (*XmMovePixmapProc) (XmDragIconObject, XmDragIconObject, XmDragIconObject, #if NeedWidePrototypes int, int); #else Position, Position); #endif /* NeedWidePrototypes */ typedef struct { XtPointer extension; } XmDragIconClassPart; typedef struct _XmDragIconClassRec{ RectObjClassPart rectangle_class; XmDragIconClassPart dragIcon_class; } XmDragIconClassRec; typedef struct { Cardinal depth; Pixmap pixmap; Dimension width, height; Pixmap mask; Position hot_x, hot_y; Position offset_x, offset_y; unsigned char attachment; Boolean isDirty; Region region; Region restore_region; Position x_offset, y_offset; } XmDragIconPart, *XmDragIconPartPtr; externalref XmDragIconClassRec xmDragIconClassRec; typedef struct _XmDragIconRec{ ObjectPart object; RectObjPart rectangle; XmDragIconPart drag; } XmDragIconRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragIconP_h */ motif-2.3.8/lib/Xm/ToggleBGI.h0000644000175000017500000000264312672140200012630 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ToggleBGI.h /main/5 1995/07/13 18:13:03 drk $ */ #ifndef _XmToggleBGI_h #define _XmToggleBGI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern int _XmToggleBCacheCompare(XtPointer A, XtPointer B) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmToggleBGI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Separator.c0000644000175000017500000005147413145162623013037 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Separator.c /main/14 1996/03/25 17:53:11 barstow $" #endif #endif #include #include #include #include #include "XmI.h" #include #include #include "RepTypeI.h" #include #include #include #include /******** Static Function Declarations ********/ static void ClassInitialize() ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetSeparatorGC( XmSeparatorWidget mw) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void Destroy( Widget wid) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; /******** End Static Function Declarations ********/ /* Menu Savvy trait record */ static XmConst XmMenuSavvyTraitRec MenuSavvySeparatorRecord = { 0, /* version */ NULL, /* disableCallback */ NULL, /* getAccelerator */ NULL, /* getMnemonic */ NULL, /* getActivateCBName */ }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNmargin, sizeof (Dimension), XtOffsetOf( struct _XmSeparatorRec, separator.margin), XmeFromHorizontalPixels, XmeToHorizontalPixels }, }; /* Resource list for Separator */ static XtResource resources[] = { { XmNseparatorType, XmCSeparatorType, XmRSeparatorType, sizeof (unsigned char), XtOffsetOf( struct _XmSeparatorRec, separator.separator_type), XmRImmediate, (XtPointer) XmSHADOW_ETCHED_IN }, { XmNmargin, XmCMargin, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmSeparatorRec, separator.margin), XmRImmediate, (XtPointer) 0 }, { XmNorientation, XmCOrientation, XmROrientation, sizeof (unsigned char), XtOffsetOf( struct _XmSeparatorRec, separator.orientation), XmRImmediate, (XtPointer) XmHORIZONTAL }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) FALSE }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmPrimitiveRec, primitive.highlight_thickness), XmRImmediate, (XtPointer) 0 }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmPrimitiveRec, primitive.shadow_thickness), XmRImmediate, (XtPointer) 2 }, }; /* The Separator class record definition */ externaldef(xmseparatorclassrec) XmSeparatorClassRec xmSeparatorClassRec = { { (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "XmSeparator", /* class_name */ sizeof(XmSeparatorRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber (resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressSeries | /* compress_exposure */ XtExposeNoRegion, TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ (XtWidgetProc)NULL, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* tm_table */ (XtGeometryHandler)NULL, /* query_geometry */ (XtStringProc)NULL, /* display_accelerator */ NULL, /* extension */ }, { (XtWidgetProc)NULL, /* Primitive border_highlight */ (XtWidgetProc)NULL, /* Primitive border_unhighlight */ NULL, /* translations */ (XtActionProc)NULL, /* arm_and_activate */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num syn_resources */ NULL, /* extension */ }, { (XtPointer) NULL, /* extension */ } }; externaldef(xmseparatorwidgetclass) WidgetClass xmSeparatorWidgetClass = (WidgetClass) &xmSeparatorClassRec; /************************************************************************ * * ClassInitialize * ************************************************************************/ static void ClassInitialize( void ) { /* Install the menu savvy trait. */ XmeTraitSet((XtPointer) xmSeparatorWidgetClass, XmQTmenuSavvy, (XtPointer) &MenuSavvySeparatorRecord); } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmSEPARATOR_BIT); } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmSeparatorWidget request = (XmSeparatorWidget) rw ; XmSeparatorWidget new_w = (XmSeparatorWidget) nw ; new_w -> primitive.traversal_on = FALSE; /* Force highlightThickness to zero if in a menu. */ if (XmIsRowColumn(XtParent(new_w)) && ((RC_Type(XtParent(new_w)) == XmMENU_PULLDOWN) || (RC_Type(XtParent(new_w)) == XmMENU_POPUP))) new_w->primitive.highlight_thickness = 0; if( !XmRepTypeValidValue( XmRID_SEPARATOR_TYPE, new_w->separator.separator_type, (Widget) new_w) ) { new_w -> separator.separator_type = XmSHADOW_ETCHED_IN; } if( !XmRepTypeValidValue( XmRID_ORIENTATION, new_w->separator.orientation, (Widget) new_w) ) { new_w -> separator.orientation = XmHORIZONTAL; } if (new_w->separator.orientation == XmHORIZONTAL) { if (request -> core.width == 0) new_w -> core.width = 2 * new_w -> primitive.highlight_thickness +2; if (request -> core.height == 0) { new_w -> core.height = 2 * new_w -> primitive.highlight_thickness; if (new_w -> separator.separator_type == XmSINGLE_LINE || new_w -> separator.separator_type == XmSINGLE_DASHED_LINE) new_w -> core.height += 3; else if (new_w -> separator.separator_type == XmSHADOW_ETCHED_IN || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT || new_w -> separator.separator_type == XmSHADOW_ETCHED_IN_DASH || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT_DASH) new_w -> core.height += new_w -> primitive.shadow_thickness; else if (new_w -> separator.separator_type == XmDOUBLE_LINE || new_w -> separator.separator_type == XmDOUBLE_DASHED_LINE) new_w -> core.height += 5; else if (new_w -> core.height == 0) new_w -> core.height = 1; } } if (new_w->separator.orientation == XmVERTICAL) { if (request -> core.height == 0) new_w -> core.height = 2 * new_w -> primitive.highlight_thickness +2; if (request -> core.width == 0) { new_w -> core.width = 2 * new_w -> primitive.highlight_thickness; if (new_w -> separator.separator_type == XmSINGLE_LINE || new_w -> separator.separator_type == XmSINGLE_DASHED_LINE) new_w -> core.width += 3; else if (new_w -> separator.separator_type == XmSHADOW_ETCHED_IN || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT || new_w -> separator.separator_type == XmSHADOW_ETCHED_IN_DASH || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT_DASH) new_w -> core.width += new_w -> primitive.shadow_thickness; else if (new_w -> separator.separator_type == XmDOUBLE_LINE || new_w -> separator.separator_type == XmDOUBLE_DASHED_LINE) new_w -> core.width += 5; else if (new_w -> core.width == 0) new_w -> core.width = 1; } } /* Get the drawing graphics contexts. */ GetSeparatorGC (new_w); } /************************************************************************ * * GetSeparatorGC * Get the graphics context used for drawing the separator. * ************************************************************************/ static void GetSeparatorGC( XmSeparatorWidget mw ) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground; values.foreground = mw -> primitive.foreground; values.background = mw -> core.background_pixel; if (mw -> separator.separator_type == XmSINGLE_DASHED_LINE || mw -> separator.separator_type == XmDOUBLE_DASHED_LINE) { valueMask = valueMask | GCLineStyle; values.line_style = LineDoubleDash; } mw -> separator.separator_GC = XtGetGC ((Widget) mw, valueMask, &values); } /************************************************************************ * * Redisplay * Invoke the application exposure callbacks. * ************************************************************************/ /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmSeparatorWidget mw = (XmSeparatorWidget) wid ; XmeDrawSeparator(XtDisplay(wid), XtWindow(wid), mw->primitive.top_shadow_GC, mw->primitive.bottom_shadow_GC, mw->separator.separator_GC, mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - 2*mw->primitive.highlight_thickness, mw->core.height - 2*mw->primitive.highlight_thickness, mw->primitive.shadow_thickness, mw->separator.margin, mw->separator.orientation, mw->separator.separator_type); } /************************************************************************ * * Destroy * Remove the callback lists. * ************************************************************************/ static void Destroy( Widget wid ) { XtReleaseGC (wid, ((XmSeparatorWidget) wid)->separator.separator_GC); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmSeparatorWidget current = (XmSeparatorWidget) cw ; XmSeparatorWidget request = (XmSeparatorWidget) rw ; XmSeparatorWidget new_w = (XmSeparatorWidget) nw ; Boolean flag = FALSE; /* * We never allow our traversal flags to be changed during SetValues(); * this is enforced by our superclass. */ /* Force traversal_on to FALSE */ new_w -> primitive.traversal_on = FALSE; /* Force highlightThickness to zero if in a menu. */ if (XmIsRowColumn(XtParent(new_w)) && ((RC_Type(XtParent(new_w)) == XmMENU_PULLDOWN) || (RC_Type(XtParent(new_w)) == XmMENU_POPUP))) new_w->primitive.highlight_thickness = 0; if( !XmRepTypeValidValue( XmRID_SEPARATOR_TYPE, new_w->separator.separator_type, (Widget) new_w) ) { new_w -> separator.separator_type = current -> separator.separator_type; } if( !XmRepTypeValidValue( XmRID_ORIENTATION, new_w->separator.orientation, (Widget) new_w) ) { new_w -> separator.orientation = current -> separator.orientation; } if (new_w -> separator.orientation == XmHORIZONTAL) { if (request -> core.width == 0) new_w -> core.width = 2 * new_w->primitive.highlight_thickness + 2; if (request -> core.height == 0) { new_w -> core.height = 2 * new_w -> primitive.highlight_thickness; if (new_w -> separator.separator_type == XmSINGLE_LINE || new_w -> separator.separator_type == XmSINGLE_DASHED_LINE) new_w -> core.height += 3; else if (new_w -> separator.separator_type == XmSHADOW_ETCHED_IN || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT || new_w -> separator.separator_type == XmSHADOW_ETCHED_IN_DASH || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT_DASH) new_w -> core.height += new_w -> primitive.shadow_thickness; else if (new_w -> separator.separator_type == XmDOUBLE_LINE || new_w -> separator.separator_type == XmDOUBLE_DASHED_LINE) new_w -> core.height += 5; else if (new_w -> core.height == 0) new_w -> core.height = 1; } if ((new_w -> separator.separator_type != current -> separator.separator_type || new_w -> primitive.shadow_thickness != current -> primitive.shadow_thickness || new_w -> primitive.highlight_thickness != current -> primitive.highlight_thickness) && request -> core.height == current -> core.height) { if (new_w -> separator.separator_type == XmSINGLE_LINE || new_w -> separator.separator_type == XmSINGLE_DASHED_LINE) new_w -> core.height = 2 * new_w -> primitive.highlight_thickness + 3; else if (new_w -> separator.separator_type == XmSHADOW_ETCHED_IN || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT || new_w -> separator.separator_type == XmSHADOW_ETCHED_IN_DASH || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT_DASH) new_w -> core.height = 2 * new_w -> primitive.highlight_thickness + new_w -> primitive.shadow_thickness; else if (new_w -> separator.separator_type == XmDOUBLE_LINE || new_w -> separator.separator_type == XmDOUBLE_DASHED_LINE) new_w -> core.height = 2 * new_w -> primitive.highlight_thickness + 5; } } if (new_w -> separator.orientation == XmVERTICAL) { if (request -> core.height == 0) new_w -> core.height = 2 * new_w->primitive.highlight_thickness + 2; if (request -> core.width == 0) { new_w -> core.width = 2 * new_w -> primitive.highlight_thickness; if (new_w -> separator.separator_type == XmSINGLE_LINE || new_w -> separator.separator_type == XmSINGLE_DASHED_LINE) new_w -> core.width += 3; else if (new_w -> separator.separator_type == XmSHADOW_ETCHED_IN || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT || new_w -> separator.separator_type == XmSHADOW_ETCHED_IN_DASH || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT_DASH) new_w -> core.width += new_w -> primitive.shadow_thickness; else if (new_w -> separator.separator_type == XmDOUBLE_LINE || new_w -> separator.separator_type == XmDOUBLE_DASHED_LINE) new_w -> core.width += 5; else if (new_w -> core.width == 0) new_w -> core.width = 1; } if ((new_w -> separator.separator_type != current -> separator.separator_type || new_w -> primitive.shadow_thickness != current -> primitive.shadow_thickness || new_w -> primitive.highlight_thickness != current -> primitive.highlight_thickness) && request -> core.width == current -> core.width) { if (new_w -> separator.separator_type == XmSINGLE_LINE || new_w -> separator.separator_type == XmSINGLE_DASHED_LINE) new_w -> core.width = 2 * new_w -> primitive.highlight_thickness + 3; else if (new_w -> separator.separator_type == XmSHADOW_ETCHED_IN || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT || new_w -> separator.separator_type == XmSHADOW_ETCHED_IN_DASH || new_w -> separator.separator_type == XmSHADOW_ETCHED_OUT_DASH) new_w -> core.width = 2 * new_w -> primitive.highlight_thickness + new_w -> primitive.shadow_thickness; else if (new_w -> separator.separator_type == XmDOUBLE_LINE || new_w -> separator.separator_type == XmDOUBLE_DASHED_LINE) new_w -> core.width = 2 * new_w -> primitive.highlight_thickness + 5; } } if (new_w -> separator.orientation != current -> separator.orientation || new_w -> separator.margin != current -> separator.margin || new_w -> primitive.shadow_thickness != current -> primitive.shadow_thickness) flag = TRUE; if (new_w -> separator.separator_type != current -> separator.separator_type || new_w -> core.background_pixel != current -> core.background_pixel || new_w -> primitive.foreground != current -> primitive.foreground) { XtReleaseGC ((Widget) new_w, new_w -> separator.separator_GC); GetSeparatorGC (new_w); flag = TRUE; } return (flag); } /************************************************************************ * * XmCreateSeparator() * XmVaCreateSeparator() * XmVaCreateManagedSeparator() * Create an instance of a separator and return the widget id. * ************************************************************************/ Widget XmCreateSeparator( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget (name, xmSeparatorWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateSeparator( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSeparatorWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedSeparator( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSeparatorWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/VirtKeys.c0000644000175000017500000007504013145162623012652 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: VirtKeys.c /main/22 1999/06/02 14:45:52 samborn $" #endif #endif #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include #include #include #include #include #include "MapEventsI.h" #include "VirtKeysI.h" #include "XmosI.h" #include "XmI.h" #define defaultFallbackBindings _XmVirtKeys_fallbackBindingString #define BUFFERSIZE 2048 #define MAXLINE 256 /* FIXES */ #define FIX_1604 /******** Static Function Declarations ********/ static Boolean CvtStringToVirtualBinding(Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal, XtPointer *closure_ret); static void FillBindingsFromDB(Display *dpy, XrmDatabase rdb, XmVKeyBinding *keys, Cardinal *num_keys); static Boolean GetBindingsProperty(Display *display, String property, String *binding); static void FindVirtKey(Display *dpy, KeyCode keycode, Modifiers modifiers, Modifiers *modifiers_return, KeySym *keysym_return); static Modifiers EffectiveStdModMask(Display *dpy, KeySym *kc_map, int ks_per_kc); static void LoadVendorBindings(Display *display, char *path, FILE *fp, String *binding); /******** End Static Function Declarations ********/ static XmConst XmVirtualKeysymRec virtualKeysyms[] = { { XmVosfActivate, osfXK_Activate }, { XmVosfAddMode, osfXK_AddMode }, { XmVosfBackSpace, osfXK_BackSpace }, { XmVosfBackTab, osfXK_BackTab }, /* Defunct */ { XmVosfBeginData, osfXK_BeginData }, /* Defunct */ { XmVosfBeginLine, osfXK_BeginLine }, { XmVosfCancel, osfXK_Cancel }, { XmVosfClear, osfXK_Clear }, { XmVosfCopy, osfXK_Copy }, { XmVosfCut, osfXK_Cut }, { XmVosfDelete, osfXK_Delete }, { XmVosfDeselectAll, osfXK_DeselectAll }, { XmVosfDown, osfXK_Down }, { XmVosfEndData, osfXK_EndData }, /* Defunct */ { XmVosfEndLine, osfXK_EndLine }, { XmVosfEscape, osfXK_Escape }, /* Defunct */ { XmVosfExtend, osfXK_Extend }, /* Defunct */ { XmVosfHelp, osfXK_Help }, { XmVosfInsert, osfXK_Insert }, { XmVosfLeft, osfXK_Left }, { XmVosfLeftLine, osfXK_LeftLine }, /* X11R6 */ { XmVosfMenu, osfXK_Menu }, { XmVosfMenuBar, osfXK_MenuBar }, { XmVosfNext, osfXK_Next }, /* X11R6 */ { XmVosfNextField, osfXK_NextField }, /* Defunct */ { XmVosfNextMenu, osfXK_NextMenu }, /* Defunct */ { XmVosfNextMinor, osfXK_NextMinor }, /* X11R6 */ { XmVosfPageDown, osfXK_PageDown }, { XmVosfPageLeft, osfXK_PageLeft }, { XmVosfPageRight, osfXK_PageRight }, { XmVosfPageUp, osfXK_PageUp }, { XmVosfPaste, osfXK_Paste }, { XmVosfPrevField, osfXK_PrevField }, /* Defunct */ { XmVosfPrevMenu, osfXK_PrevMenu }, /* Defunct */ { XmVosfPrimaryPaste, osfXK_PrimaryPaste }, { XmVosfPrior, osfXK_Prior }, /* X11R6 */ { XmVosfPriorMinor, osfXK_PriorMinor }, /* X11R6 */ { XmVosfQuickPaste, osfXK_QuickPaste }, { XmVosfReselect, osfXK_Reselect }, { XmVosfRestore, osfXK_Restore }, { XmVosfRight, osfXK_Right }, { XmVosfRightLine, osfXK_RightLine }, /* X11R6 */ { XmVosfSelect, osfXK_Select }, { XmVosfSelectAll, osfXK_SelectAll }, { XmVosfSwitchDirection, osfXK_SwitchDirection }, /* X11R6 */ { XmVosfUndo, osfXK_Undo }, { XmVosfUp, osfXK_Up } }; static XmConst XmDefaultBindingStringRec fallbackBindingStrings[] = { { "Acorn Computers Ltd", _XmVirtKeys_acornFallbackBindingString }, { "Apollo Computer Inc.", _XmVirtKeys_apolloFallbackBindingString }, { "DECWINDOWS DigitalEquipmentCorp.", _XmVirtKeys_decFallbackBindingString }, { "Data General Corporation Rev 04", _XmVirtKeys_dgFallbackBindingString }, { "Double Click Imaging, Inc. KeyX", _XmVirtKeys_dblclkFallbackBindingString }, { "Hewlett-Packard Company", _XmVirtKeys_hpFallbackBindingString }, { "International Business Machines", _XmVirtKeys_ibmFallbackBindingString }, { "Intergraph Corporation", _XmVirtKeys_ingrFallbackBindingString }, { "Megatek Corporation", _XmVirtKeys_megatekFallbackBindingString }, { "Motorola Inc. (Microcomputer Division) ", _XmVirtKeys_motorolaFallbackBindingString }, { "Silicon Graphics Inc.", _XmVirtKeys_sgiFallbackBindingString }, { "Silicon Graphics", _XmVirtKeys_sgiFallbackBindingString }, { "Siemens Munich by SP-4's Hacker Crew", _XmVirtKeys_siemensWx200FallbackBindingString }, { "Siemens Munich (SP-4's hacker-clan)", _XmVirtKeys_siemens9733FallbackBindingString }, { "Sun Microsystems, Inc.", _XmVirtKeys_sunFallbackBindingString }, { "X11/NeWS - Sun Microsystems Inc.", _XmVirtKeys_sunFallbackBindingString }, { "Tektronix, Inc.", _XmVirtKeys_tekFallbackBindingString } }; /*ARGSUSED*/ static Boolean CvtStringToVirtualBinding(Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal, XtPointer *closure_ret ) { char *str = (char *)fromVal->addr; XKeyEvent event; int count, tmp; int *eventTypes; KeySym *keysyms; unsigned int *modifiers; int j; int codes_per_sym; KeyCode minK; Modifiers used_mods; /* Lookup codes_per_sym, and let Xt cache the result instead of */ /* always downloading a new copy with XGetKeyboardMapping(). */ /* This also initializes Xt's per-display data structures, so */ /* we can use XtTranslateKey() instead of XLookupString(). */ (void) XtGetKeysymTable(dpy, &minK, &codes_per_sym); count = _XmMapKeyEvents(str, &eventTypes, &keysyms, &modifiers); if (count > 0) { Boolean fini; for (tmp = 0; tmp < count; tmp++) { fini = False; /* * Here's a nasty bit of code. If some vendor defines one of * the standard modifiers to be the mode switch mod, the * keysym returned by XtTranslateKey is the mode-shifted * one. This may or may not be bogus, but we have to live * with it :-(. Soo, we need to translate the keysym to a * keycode, then ask someone to translate the combo for us. */ event.display = dpy; event.keycode = XKeysymToKeycode(dpy, keysyms[tmp]); /* * In case the guy specifies a symbol that is modified (like * HP's Del which is ), we'll find the implied * modifers and 'OR' it together with the explicitly stated * modifers. */ event.state = 0; #ifdef FIX_1604 int keysyms_per_keycode=0; int min_codes_per_sym = 0; if (event.keycode > 0) { KeySym *keysymTab = XGetKeyboardMapping(dpy, event.keycode, 1, &keysyms_per_keycode); if ((keysymTab != NULL) && (keysyms_per_keycode > 0)) { if (keysyms_per_keycode > codes_per_sym) min_codes_per_sym = codes_per_sym; else min_codes_per_sym = keysyms_per_keycode; if (keysymTab[0] != keysyms[tmp]) for (j = 1; j < min_codes_per_sym; j++) if (keysymTab[j] == keysyms[tmp]) { /* * Gross Hack for Hobo keyboard .. * Assumptions: * 1. Hobo keyboard has XK_Return as the first entry * and XK_KP_Enter as the 4th entry in its * keycode to keysym key map. * 2. This fix is only designed to work for the precise * combination of the Sun server with vendor * string "Sun Microsystems, Inc." and the Hobo * keyboard, as the fix assumes knowledge of the * server keycode to keysym key map. */ if ((keysyms[tmp] == XK_KP_Enter) && (j == 4) && (keysymTab[0] == XK_Return) && (strcmp("Sun Microsystems, Inc.", ServerVendor(dpy)) == 0)) { fini = True; } else event.state = 1 << (j-1); break; } XFree(keysymTab); } } #else if (XKeycodeToKeysym(dpy, event.keycode, 0) != keysyms[tmp]) for (j = 1; j < codes_per_sym; j++) if (XKeycodeToKeysym(dpy, event.keycode, j) == keysyms[tmp]) { /* * Gross Hack for Hobo keyboard .. * Assumptions: * 1. Hobo keyboard has XK_Return as the first entry * and XK_KP_Enter as the 4th entry in its * keycode to keysym key map. * 2. This fix is only designed to work for the precise * combination of the Sun server with vendor * string "Sun Microsystems, Inc." and the Hobo * keyboard, as the fix assumes knowledge of the * server keycode to keysym key map. */ if ((keysyms[tmp] == XK_KP_Enter) && (j == 4) && (XKeycodeToKeysym(dpy, event.keycode, 0) == XK_Return) && (strcmp("Sun Microsystems, Inc.", ServerVendor(dpy)) == 0)) { fini = True; } else event.state = 1 << (j-1); break; } #endif if (!fini) { event.state |= modifiers[tmp]; XtTranslateKey(dpy, event.keycode, event.state, &used_mods, keysyms + tmp); } } /* Fail if insufficient storage was provided. */ if ((toVal->addr != NULL) && (toVal->size < sizeof(XmKeyBindingRec) * count)) { toVal->size = sizeof(XmKeyBindingRec) * count; XtFree((char*) eventTypes); XtFree((char*) keysyms); XtFree((char*) modifiers); return False; } /* Allocate storage if none was provided. */ toVal->size = sizeof(XmKeyBindingRec) * count; if (toVal->addr == NULL) toVal->addr = XtMalloc(toVal->size); /* Copy the data. */ for (tmp = 0; tmp < count; tmp++) { ((XmKeyBinding) toVal->addr)[tmp].keysym = keysyms[tmp]; ((XmKeyBinding) toVal->addr)[tmp].modifiers = modifiers[tmp]; } XtFree((char*) eventTypes); XtFree((char*) keysyms); XtFree((char*) modifiers); return True; } /* The value supplied could not be converted. */ XtDisplayStringConversionWarning(dpy, str, XmRVirtualBinding); return False; } static void FillBindingsFromDB(Display *dpy, XrmDatabase rdb, XmVKeyBinding *keys, Cardinal *num_keys) { XrmName xrm_name[2]; XrmClass xrm_class[2]; XrmRepresentation rep_type; XrmValue value; Cardinal vk_num; XrmQuark XmQVirtualBinding = XrmPermStringToQuark(XmRVirtualBinding); XrmQuark XmQString = XrmPermStringToQuark(XmRString); xrm_class[0] = XmQVirtualBinding; xrm_class[1] = 0; /* Previously entries in display.bindings corresponded exactly to */ /* entries in virtualKeysyms. Since multiple keysyms can be bound */ /* to a single virtual key, display.num_bindings and the virtkey */ /* field in XmVKeyBindingRec were added. This also allows us to */ /* remove null bindings from the table, improving search times. */ /* Allocate the initial arrays. */ *num_keys = 0; *keys = NULL; /* Process each known virtual key. */ for (vk_num = 0; vk_num < XtNumber(virtualKeysyms); vk_num++) { Boolean free_keys = False; XmKeyBinding new_keys = NULL; Cardinal new_num = 0; xrm_name[0] = XrmPermStringToQuark(virtualKeysyms[vk_num].name); xrm_name[1] = 0; if (XrmQGetResource(rdb, xrm_name, xrm_class, &rep_type, &value)) { if (rep_type == XmQVirtualBinding) { /* Resource already exists in the desired format? */ new_keys = (XmKeyBinding) value.addr; new_num = value.size / sizeof(XmKeyBindingRec); } else if (rep_type == XmQString) { /* Convert String resource to key bindings. */ XrmValue toVal; toVal.addr = NULL; toVal.size = 0; if (XtCallConverter(dpy, CvtStringToVirtualBinding, NULL, 0, &value, &toVal, NULL)) { new_keys = (XmKeyBinding) toVal.addr; new_num = toVal.size / sizeof(XmKeyBindingRec); free_keys = True; } } /* Append the new bindings to the end of the table. */ if (new_num > 0) { int tmp; *keys = (XmVKeyBinding) XtRealloc((char*) *keys, (*num_keys + new_num) * sizeof(XmVKeyBindingRec)); for (tmp = 0; tmp < new_num; tmp++) { (*keys)[*num_keys + tmp].keysym = new_keys[tmp].keysym; (*keys)[*num_keys + tmp].modifiers = new_keys[tmp].modifiers; (*keys)[*num_keys + tmp].virtkey = virtualKeysyms[vk_num].keysym; } *num_keys += new_num; } if (free_keys) XtFree((char *)new_keys); } } } static Boolean GetBindingsProperty(Display *display, String property, String *binding) { char *prop = NULL; Atom actual_type; int actual_format; unsigned long num_items; unsigned long bytes_after; if ( binding == NULL ) return False; XGetWindowProperty (display, RootWindow(display, 0), XInternAtom(display, property, FALSE), 0, (long)1000000, FALSE, XA_STRING, &actual_type, &actual_format, &num_items, &bytes_after, (unsigned char **) &prop); if ((actual_type != XA_STRING) || (actual_format != 8) || (num_items == 0)) { if (prop != NULL) XFree(prop); return False; } else { *binding = prop; return True; } } /* * This routine is called by the XmDisplay Initialize method to set * up the virtual bindings table, XtKeyProc, and event handler. */ void _XmVirtKeysInitialize(Widget widget) { XmDisplay xmDisplay = (XmDisplay) widget; Display *dpy = XtDisplay(xmDisplay); XrmDatabase keyDB; String bindingsString; String fallbackString = NULL; Boolean needXFree = False; if (!XmIsDisplay(widget)) return; bindingsString = xmDisplay->display.bindingsString; xmDisplay->display.lastKeyEvent = NULL; if (bindingsString == NULL) { /* XmNdefaultVirtualBindings not set, try _MOTIF_BINDINGS */ if (GetBindingsProperty(XtDisplay(xmDisplay), XmS_MOTIF_BINDINGS, &bindingsString) == True) { needXFree = True; } else if (GetBindingsProperty(XtDisplay(xmDisplay), XmS_MOTIF_DEFAULT_BINDINGS, &bindingsString) == True) { needXFree = True; } else { /* property not set, find a useful fallback */ _XmVirtKeysLoadFallbackBindings(XtDisplay(xmDisplay), &fallbackString); bindingsString = fallbackString; } } XtSetTypeConverter(XmRString, XmRVirtualBinding, CvtStringToVirtualBinding, NULL, 0, XtCacheNone, (XtDestructor)NULL); keyDB = XrmGetStringDatabase( bindingsString ); FillBindingsFromDB (XtDisplay(xmDisplay), keyDB, &xmDisplay->display.bindings, &xmDisplay->display.num_bindings); XrmDestroyDatabase(keyDB); if (needXFree) XFree (bindingsString); if (fallbackString) XtFree (fallbackString); XtSetKeyTranslator(dpy, (XtKeyProc)XmTranslateKey); } /* * This routine is called by the XmDisplay Destroy method to free * up the virtual bindings table. */ void _XmVirtKeysDestroy(Widget widget) { XmDisplay xmDisplay = (XmDisplay) widget; XtFree((char*)xmDisplay->display.lastKeyEvent); XtFree((char*)xmDisplay->display.bindings); } static void FindVirtKey(Display *dpy, KeyCode keycode, Modifiers modifiers, Modifiers *modifiers_return, KeySym *keysym_return ) { Cardinal i; XmDisplay xmDisplay = (XmDisplay) XmGetXmDisplay( dpy); XmVKeyBinding keyBindings = xmDisplay->display.bindings; KeyCode min_kcode; int ks_per_kc; KeySym *ks_table = XtGetKeysymTable( dpy, &min_kcode, &ks_per_kc); KeySym *kc_map = &ks_table[(keycode - min_kcode) * ks_per_kc]; Modifiers EffectiveSMMask = EffectiveStdModMask( dpy, kc_map, ks_per_kc); /* Get the modifiers from the actual event */ Modifiers VirtualStdMods = 0; Modifiers StdModMask; for (i = 0; i < xmDisplay->display.num_bindings; i++) { unsigned j = ks_per_kc; KeySym vks = keyBindings[i].keysym; if (vks) { while (j--) { /* Want to walk through keymap (containing all possible * keysyms generated by this keycode) to compare against * virtual key keysyms. Any keycode that can possibly * generate a virtual keysym must be sure to return all * modifiers that are in the virtual key binding, since * this means that those modifiers are now part of the * "standard modifiers" for this keycode. (A "standard * modifier" is a modifier that can affect which keysym * is generated from a particular keycode.) */ if ((j == 1) && (kc_map[j] == NoSymbol)) { KeySym uc, lc; XtConvertCase( dpy, kc_map[0], &lc, &uc); if ((vks == lc) || (vks == uc)) VirtualStdMods |= keyBindings[i].modifiers; break; } else if (vks == kc_map[j]) { /* The keysym generated by this keycode can possibly * be influenced by the virtual key modifier(s), so must * add the modifier(s) associated with this virtual * key to the returned list of "standard modifiers". * The Intrinsics requires that the set of modifiers * returned by the keyproc is constant for a given * keycode. */ VirtualStdMods |= keyBindings[i].modifiers; break; } } } } /* Don't want to return standard modifiers that do not * impact the keysym selected for a particular keycode, * since this blocks matching of translation productions * which use ":" style translations with the returned * standard modifier in the production. The ":" style * of production is essential for proper matching of * Motif translations (PC numeric pad, for instance). * * Recent fixes to the Intrinsics should have included this * change to the set of standard modifiers returned from * the default key translation routine, but could not be * done for reasons of backwards compatibility (which is * not an issue for Xm, since we do not export this facility). * So, we do the extra masking here after the return from * the call to XtTranslateKey. */ *modifiers_return &= EffectiveSMMask; /* Modifiers present in the virtual binding table for the * keysyms associated with this keycode, which are or might * have been used to change the keysym generated by this * keycode (to a virtual keysym), must be included in the * returned set of standard modifiers. Remember that "standard * modifiers" for a keycode are those modifiers that can affect * which keysym is generated by that keycode. */ *modifiers_return |= VirtualStdMods; /* Effective standard modifiers that are set in the event * will be 0 in the following bit mask, which will be used * to collapse conflicting modifiers in the virtual * key binding table, as described below. */ StdModMask = ~(modifiers & EffectiveSMMask); for (i = 0; i < xmDisplay->display.num_bindings; i++) { XmVKeyBinding currBinding = &keyBindings[i]; KeySym vks = currBinding->keysym; /* The null binding should not be interpreted as a match * keysym is zero (e.g. pre-edit terminator) */ /* Those modifiers that are effective standard modifiers and * that are set in the event will be ignored in the following * conditional (i.e., the state designated in the virtual key * binding will not be considered), since these modifiers have * already had their affect in the determination of the value * of *keysym_return. This allows matching that is consistent * with industry-standard interpretation for keys such as * those of the PC-style numeric pad. This apparent loss of * binding semantics is an unavoidable consequence of specifying * a modifier in the virtual binding table that is already being * used to select one of several keysyms associated with a * particular keycode (usually as printed on the keycap). * The disambiguation of the collapsing of key bindings * is based on "first match" in the virtual key binding table. */ if (vks && (vks == *keysym_return) && ((currBinding->modifiers & StdModMask) == (modifiers & VirtualStdMods & StdModMask))) { *keysym_return = currBinding->virtkey; break; } } } static Modifiers EffectiveStdModMask(Display *dpy, KeySym *kc_map, int ks_per_kc) { /* This routine determines which set of modifiers can possibly * impact the keysym that is generated by the keycode associated * with the keymap passed in. The basis of the algorithm used * here is described in section 12.7 "Keyboard Encoding" of the * R5 "Xlib - C Language X Interface" specification. */ KeySym uc; KeySym lc; /* Since the group modifier can be any of Mod1-Mod5 or Control, we will * return all of these bits if the group modifier is found to be effective. * Lock will always be returned (for backwards compatibility with * productions assuming that Lock is always a "don't care" modifier * for non-alphabetic keys). Shift will be returned unless it has * no effect on the selection of keysyms within either group. */ Modifiers esm_mask = (Mod5Mask | Mod4Mask | Mod3Mask | Mod2Mask | Mod1Mask | ControlMask | LockMask | ShiftMask); switch (ks_per_kc) { default: /* CR 8799: Ignore non-standard modifier groups. */ case 4: if (kc_map[3] != NoSymbol) { /* The keysym in position 4 is selected when the group * modifier is set and the Shift (or Lock) modifier is * set, so both Shift/Lock and the group modifiers are * all "effective" standard modifiers. */ break; } case 3: if (kc_map[2] == NoSymbol) { /* Both Group 2 keysyms are NoSymbol, so the group * modifier has no effect; only Shift and Lock remain * as possible effective modifiers. */ esm_mask = ShiftMask | LockMask; } else { XtConvertCase( dpy, kc_map[2], &lc, &uc); if (lc != uc) { /* The Group 2 keysym is case-sensitive, so group * modifiers and Shift/Lock modifiers are effective. */ break; } } /* At this fall-through, the group modifier bits have been * decided, while the case is still out on Shift/Lock. */ case 2: if (kc_map[1] != NoSymbol) { /* Shift/Lock modifier selects keysym from Group 1, * so leave those bits in the mask. The group modifier * was determined above, so leave those bits in the mask. */ break; } case 1: if (kc_map[0] != NoSymbol) { XtConvertCase( dpy, kc_map[0], &lc, &uc); if (lc != uc) { /* The Group 1 keysym is case-sensitive, so Shift/Lock * modifiers are effective. */ break; } } /* If we did not break out of the switch before this, then * the Shift modifier is not effective; mask it out. */ esm_mask &= ~ShiftMask; case 0: break; } return esm_mask; } void XmTranslateKey(Display *dpy, #if NeedWidePrototypes unsigned int keycode, #else KeyCode keycode, #endif /* NeedWidePrototypes */ Modifiers modifiers, Modifiers *modifiers_return, KeySym *keysym_return ) { _XmDisplayToAppContext(dpy); _XmAppLock(app); XtTranslateKey(dpy, keycode, modifiers, modifiers_return, keysym_return); FindVirtKey(dpy, keycode, modifiers, modifiers_return, keysym_return); _XmAppUnlock(app); } int XmeVirtualToActualKeysyms(Display *dpy, KeySym virtKeysym, XmKeyBinding *actualKeyData) { int matches; Cardinal index; XmDisplay xmDisplay = (XmDisplay)XmGetXmDisplay (dpy); XmVKeyBinding keyBindings = xmDisplay->display.bindings; _XmDisplayToAppContext(dpy); _XmAppLock(app); /* Initialize the return parameters. */ *actualKeyData = NULL; /* Count the number of matches. */ matches = 0; for (index = 0; index < xmDisplay->display.num_bindings; index++) if (keyBindings[index].virtkey == virtKeysym) matches++; /* Allocate the return array. */ if (matches > 0) { *actualKeyData = (XmKeyBinding) XtMalloc(matches * sizeof(XmKeyBindingRec)); matches = 0; for (index = 0; index < xmDisplay->display.num_bindings; index++) if (keyBindings[index].virtkey == virtKeysym) { (*actualKeyData)[matches].keysym = keyBindings[index].keysym; (*actualKeyData)[matches].modifiers = keyBindings[index].modifiers; matches++; } } _XmAppUnlock(app); return matches; } Boolean _XmVirtKeysLoadFileBindings(char *fileName, String *binding ) { FILE *fileP; int buffersize; int count; int firsttime; char line[256]; Boolean skip; if ((fileP = fopen (fileName, "r")) != NULL) { skip = False; count = 0; buffersize = 1; firsttime = 1; while (fgets(line, sizeof(line), fileP) != NULL) { /* handle '!' comments; they can extend across mutliple reads */ if (skip) { if (line[strlen(line) - 1] == '\n') skip = False; continue; } if (line[0] == '!') { if (line[strlen(line) - 1] == '\n') continue; else { skip = True; continue; } } /* must be >=, because buffersize is always 1 bigger for '\0' */ if (count + strlen(line) >= buffersize) { buffersize += BUFFERSIZE; *binding = XtRealloc(*binding, buffersize); /* always make sure that the end of *binding is null terminated */ if (firsttime) { *binding[0] = '\0'; firsttime = 0; } } count += strlen(line); strcat(*binding, line); } /* trim unused buffer space */ *binding = XtRealloc (*binding, count + 1); fclose (fileP); return True; } return False; } static void LoadVendorBindings(Display *display, char *path, FILE *fp, String *binding ) { char buffer[MAXLINE]; char *bindFile; char *vendor; char *vendorV; char *ptr; char *start; vendor = ServerVendor(display); vendorV = XtMalloc (strlen(vendor) + 20); /* assume rel.# is < 19 digits */ sprintf (vendorV, "%s %d", vendor, VendorRelease(display)); while (fgets (buffer, MAXLINE, fp) != NULL) { ptr = buffer; while (*ptr != '"' && *ptr != '!' && *ptr != '\0') ptr++; if (*ptr != '"') continue; start = ++ptr; while (*ptr != '"' && *ptr != '\0') ptr++; if (*ptr != '"') continue; *ptr = '\0'; if ((strcmp (start, vendor) == 0) || (strcmp (start, vendorV) == 0)) { ptr++; while (isspace((unsigned char)*ptr) && *ptr) ptr++; if (*ptr == '\0') continue; start = ptr; while (!isspace((unsigned char)*ptr) && *ptr != '\n' && *ptr) ptr++; *ptr = '\0'; bindFile = _XmOSBuildFileName (path, start); if (_XmVirtKeysLoadFileBindings (bindFile, binding)) { XtFree (bindFile); break; } XtFree (bindFile); } } XtFree (vendorV); } int _XmVirtKeysLoadFallbackBindings(Display *display, String *binding ) { enum { XmA_MOTIF_BINDINGS, XmA_MOTIF_DEFAULT_BINDINGS, NUM_ATOMS }; static char *atom_names[] = {XmS_MOTIF_BINDINGS, XmS_MOTIF_DEFAULT_BINDINGS}; XmConst XmDefaultBindingStringRec *currDefault; int i; FILE *fp; char *homeDir; char *fileName; char *bindDir; static XmConst char xmbinddir_fallback[] = XMBINDDIR_FALLBACK; Atom atoms[XtNumber(atom_names)]; *binding = NULL; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms); /* Load .motifbind - necessary, if mwm and xmbind are not used */ homeDir = XmeGetHomeDirName(); fileName = _XmOSBuildFileName(homeDir, MOTIFBIND); _XmVirtKeysLoadFileBindings(fileName, binding); XtFree(fileName); /* Look for a match in the user's xmbind.alias */ if (*binding == NULL) { fileName = _XmOSBuildFileName (homeDir, XMBINDFILE); if ((fp = fopen (fileName, "r")) != NULL) { LoadVendorBindings (display, homeDir, fp, binding); fclose (fp); } XtFree (fileName); } if (*binding != NULL) { /* Set the user property for future Xm applications. */ XChangeProperty (display, RootWindow(display, 0), atoms[XmA_MOTIF_BINDINGS], XA_STRING, 8, PropModeReplace, (unsigned char *)*binding, strlen(*binding)); return 0; } /* Look for a match in the system xmbind.alias */ if (*binding == NULL) { if ((bindDir = getenv(XMBINDDIR)) == NULL) bindDir = (char*) xmbinddir_fallback; fileName = _XmOSBuildFileName (bindDir, XMBINDFILE); if ((fp = fopen (fileName, "r")) != NULL) { LoadVendorBindings (display, bindDir, fp, binding); fclose (fp); } XtFree (fileName); } /* Check hardcoded fallbacks (for 1.1 bc) */ if (*binding == NULL) { for (i = 0, currDefault = fallbackBindingStrings; i < XtNumber(fallbackBindingStrings); i++, currDefault++) { if (strcmp(currDefault->vendorName, ServerVendor(display)) == 0) { *binding = XtMalloc (strlen (currDefault->defaults) + 1); strcpy (*binding, currDefault->defaults); break; } } } /* Use generic fallback bindings */ if (*binding == NULL) { *binding = XtMalloc (strlen (defaultFallbackBindings) + 1); strcpy (*binding, defaultFallbackBindings); } /* Set the fallback property for future Xm applications */ XChangeProperty (display, RootWindow(display, 0), atoms[XmA_MOTIF_DEFAULT_BINDINGS], XA_STRING, 8, PropModeReplace, (unsigned char *)*binding, strlen(*binding)); return 0; } motif-2.3.8/lib/Xm/LabelG.h0000644000175000017500000000403713145162623012223 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmLabelG_h #define _XmLabelG_h #include #ifdef __cplusplus extern "C" { #endif /* Widget class and record definitions */ externalref WidgetClass xmLabelGadgetClass; typedef struct _XmLabelGadgetClassRec * XmLabelGadgetClass; typedef struct _XmLabelGadgetRec * XmLabelGadget; typedef struct _XmLabelGCacheObjRec * XmLabelGCacheObject; /*fast subclass define */ #ifndef XmIsLabelGadget #define XmIsLabelGadget(w) XtIsSubclass(w, xmLabelGadgetClass) #endif /* XmIsLabelGadget */ /******** Public Function Declarations ********/ extern Widget XmCreateLabelGadget( Widget parent, char *name, Arg *arglist, Cardinal argCount) ; extern Widget XmVaCreateLabelGadget( Widget parent, char *name, ...); extern Widget XmVaCreateManagedLabelGadget( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmLabelG_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStringGet.c0000644000175000017500000000774112672140200013277 00000000000000/* $XConsortium: XmStringGet.c /main/6 1995/09/19 23:13:21 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmStringI.h" #include "XmI.h" XmStringComponentType XmStringGetNextComponent( XmStringContext context, char **text, XmStringTag *str_tag, XmStringDirection *direction, XmStringComponentType *unknown_tag, unsigned short *unknown_length, unsigned char **unknown_value ) { XmStringComponentType type; unsigned int len; XtPointer val; _XmProcessLock(); type = XmeStringGetComponent((_XmStringContext) context, True, True, &len, &val); /* Case on return type */ /* Set appropriate return value and return. */ switch (type) { case XmSTRING_COMPONENT_DIRECTION: *direction = *(XmStringDirection *)val; XtFree((char *)val); break; case XmSTRING_COMPONENT_TAG: *str_tag = (XmStringTag)val; break; case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: *text = (char *)val; break; case XmSTRING_COMPONENT_SEPARATOR: case XmSTRING_COMPONENT_END: break; default: *unknown_tag = type; *unknown_length = len; *unknown_value = (unsigned char *)val; type = XmSTRING_COMPONENT_UNKNOWN; } _XmProcessUnlock(); return(type); } XmStringComponentType XmStringPeekNextComponent(XmStringContext context) { unsigned int len; XtPointer val; return XmeStringGetComponent((_XmStringContext) context, False, False, &len, &val); } /* * fetch the first text 'segment' of the external TCS that matches the given * char set. */ Boolean XmStringGetLtoR( XmString string, XmStringTag tag, char **text ) { XmStringContext context; char * t; XmStringTag c, curtag = NULL; XmStringDirection d; Boolean s, is_local = FALSE, done = FALSE, is_default = FALSE; _XmProcessLock(); if (!string) { _XmProcessUnlock(); return(FALSE); } if (!tag) { _XmProcessUnlock(); return (FALSE); } if ((tag == XmFONTLIST_DEFAULT_TAG) || (strcmp(tag, XmFONTLIST_DEFAULT_TAG) == 0)) is_local = TRUE; *text = NULL; /* pre-condition result */ if (!is_local) { if ((strcmp(tag, XmSTRING_DEFAULT_CHARSET) == 0)) { curtag = _XmStringGetCurrentCharset(); is_default = TRUE; } else curtag = tag; } XmStringInitContext (&context, string); while ( ! done) { if (XmStringGetNextSegment (context, &t, &c, &d, &s)) { if (c && ((d == XmSTRING_DIRECTION_L_TO_R) || (d == XmSTRING_DIRECTION_UNSET)) && (((is_local || is_default) && ((c == XmFONTLIST_DEFAULT_TAG) || (strcmp(c, XmFONTLIST_DEFAULT_TAG) == 0) || (strcmp(c, _XmStringGetCurrentCharset()) == 0))) || (curtag && (strcmp (c, curtag) == 0)))) { *text = t; /* OK, pass text to caller */ done = TRUE; } else XtFree (t); /* not this text */ if (c) XtFree (c); /* always dump charset */ } else done = TRUE; } XmStringFreeContext (context); _XmProcessUnlock(); return (*text != NULL); } motif-2.3.8/lib/Xm/Label.h0000644000175000017500000000366213145162623012117 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmLabel_h #define _XmLabel_h #include #ifdef __cplusplus extern "C" { #endif /* Widget class and record definitions */ externalref WidgetClass xmLabelWidgetClass; typedef struct _XmLabelClassRec * XmLabelWidgetClass; typedef struct _XmLabelRec * XmLabelWidget; /*fast subclass define */ #ifndef XmIsLabel #define XmIsLabel(w) XtIsSubclass(w, xmLabelWidgetClass) #endif /* XmIsLabel */ /******** Public Function Declarations ********/ extern Widget XmCreateLabel( Widget parent, char *name, Arg *arglist, Cardinal argCount) ; extern Widget XmVaCreateLabel( Widget parent, char *name, ...); extern Widget XmVaCreateManagedLabel( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmLabel_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Outline.c0000644000175000017500000015174713066310437012522 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include #include "XmI.h" /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define SUPERCLASS (&xmHierarchyClassRec) #define DEF_INDENT_SPACE 30 #define MOVE_TIME 200 typedef struct { int x; int y; } LadderPoint; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /************************************************************ * STATIC FUNCTION DECLARATIONS *************************************************************/ static void ClassInitialize(); static void Resize(Widget), ClassPartInitialize(WidgetClass); static void Redisplay(Widget, XEvent *, Region); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void Destroy(Widget widget); static void ConstraintInitialize(Widget, Widget, ArgList, Cardinal *); static void ConstraintDestroy(Widget); static void ToggleNodeState(Widget, XtPointer, XtPointer); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static Boolean ConstraintSetValues(Widget, Widget, Widget, ArgList, Cardinal*); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal*); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *, XtWidgetGeometry *); /************************ * Actions and callbacks. ************************/ /********************* * Internal Routines. *********************/ static Bool CheckExpose(Display *, XEvent *, char *); static OutlineConstraints GetNodeInfo(Widget); static int CalcMaxWidth(Widget); static void ChangeManaged(Widget); static void RequestNewSize(Widget), CalcLocations(Widget, Boolean); static void GetNodeDimensions(Widget, OutlineConstraints, Cardinal, Cardinal *); static void GetNodeHeightAndWidth(Widget, OutlineConstraints, Cardinal, Boolean, Cardinal *); static void GetDesiredSize(Widget, Dimension*, Dimension*, Dimension *, Dimension *, Boolean, Boolean); static void LayoutChildren(Widget, Widget); static Boolean LocInRect(XRectangle *, Widget, Position, Position); static Boolean WidgetInRect(XRectangle *, Widget); static Boolean CheckWidget(XRectangle *, OutlineConstraints); static void ProcessChildQueue(XmOutlineWidget, XRectangle *); static void MoveNode(XmOutlineWidget, OutlineConstraints, Position, Position, Position, Position, Boolean); static void ProcessNode(OutlineConstraints); static Boolean MoveNodesTimer(XtPointer); static void UnmapNode(XmOutlineWidget ow, OutlineConstraints node); static void UnmapAllExtraNodes(Widget w, HierarchyConstraints node); static void NegotiateNodeWidth(Widget w, OutlineConstraints node); static void RedrawOutlineLines(Widget, XRectangle *); static void DrawOutlineLine(Widget, XRectangle *, OutlineConstraints); static void _CalcNodeMidPoint( OutlineConstraints node, Widget w, LadderPoint *ret_point ); static void _OutlineDrawLine(Widget w, XRectangle *rect, OutlineConstraints parent, OutlineConstraints child, LadderPoint from_ladder_point, LadderPoint *to_ladder_point ); static void CreateGC(XmOutlineWidget ow); /************************************************************ * STATIC DECLARATIONS *************************************************************/ static XtResource resources[] = { { XmNindentSpace, XmCIndentSpace, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmOutlineRec, outline.indent_space), XmRImmediate, (XtPointer)DEF_INDENT_SPACE }, { XmNconstrainWidth, XmCConstrainWidth, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmOutlineRec, outline.constrain_width), XmRImmediate, (XtPointer)False }, { XmNconnectNodes, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmOutlineRec, outline.connect_nodes), XmRImmediate, (XtPointer)False } }; static XmSyntheticResource get_resources[] = { { XmNindentSpace, sizeof(Dimension), XtOffsetOf(XmOutlineRec, outline.indent_space), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels } }; XmOutlineClassRec xmOutlineClassRec = { { /* core fields */ /* superclass */ ((WidgetClass) SUPERCLASS), /* class_name */ "XmOutline", /* widget_size */ sizeof(XmOutlineRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMultiple, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite_class fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ NULL, /* num resources */ 0, /* constraint size */ sizeof(XmOutlineConstraintRec), /* init proc */ ConstraintInitialize, /* destroy proc */ ConstraintDestroy, /* set values proc */ ConstraintSetValues, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ NULL, /* num_syn_cont_resources */ 0, /* parent_process */ NULL, /* extension */ NULL, }, { /* Hierarchy fields */ XtInheritChangeNodeState, /* The function for changing the node state. */ XtInheritMapNode, /* Maps a given node. */ XtInheritUnmapNode, /* Unmaps a given node. */ UnmapAllExtraNodes, /* Unmaps all extra nodes. */ XtInheritBuildNodeTable, /* Builds up the node table. */ XtInheritResetOpenCloseButton, /* Resets the the o/c button. */ ToggleNodeState, /* Called to toggle the state of node. */ NULL, /* extension */ }, { /* Outline fields */ CalcMaxWidth, /* calculates the max width of the outline. */ CalcLocations, /* calculates were children will be placed. */ NULL /* extension */ } }; WidgetClass xmOutlineWidgetClass = (WidgetClass) &xmOutlineClassRec; /************************************************************ * STATIC CODE *************************************************************/ /* Function Name: ClassInitialize * Description: Initializes class-specific data (offsets) * Arguments: none * Returns: nothing */ static void ClassInitialize() { /* do nothing */ } /* Function Name: ClassPartInitialize * Description: handles inheritance of class functions. * Arguments: class - the widget class of this widget. * Returns: none. */ static void ClassPartInitialize(WidgetClass class) { XmOutlineWidgetClass wc = (XmOutlineWidgetClass) class; XmOutlineWidgetClass superC; _XmProcessLock(); superC = (XmOutlineWidgetClass) wc->core_class.superclass; /* * We don't need to check for NULL super since we'll get to The functions * defined by the Outline class eventually. */ if (wc->outline_class.calc_max_width == XtInheritCalcMaxWidth) wc->outline_class.calc_max_width= superC->outline_class.calc_max_width; if (wc->outline_class.calc_locations == XtInheritCalcLocations) wc->outline_class.calc_locations= superC->outline_class.calc_locations; _XmProcessUnlock(); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /*ARGSUSED*/ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmOutlineWidget ow = (XmOutlineWidget) set; XmHierarchy_top_node(ow) = ((HierarchyConstraints) XtRealloc((XtPointer) XmHierarchy_top_node(ow), sizeof(OutlineConstraintRec))); XmOutline_top_node_of_display(ow) = NULL; XmOutline_max_width(ow) = 0; XmOutline_max_widget_width(ow) = 0; XmOutline_ul_point(ow).x = ow->core.width; XmOutline_ul_point(ow).y = ow->core.height; XmOutline_lr_point(ow).x = 0; XmOutline_lr_point(ow).y = 0; XmOutline_child_op_list(ow) = _XmListInit(); CreateGC(ow); } static void CreateGC(XmOutlineWidget ow) { XGCValues values; values.foreground = ow->manager.foreground; XmOutline_draw_gc(ow) = XtGetGC((Widget)ow, GCForeground, &values); } /* Function Name: Destroy * Description: Destroys all data allocated by the widget * Arguments: w - the widget. * Returns: none. */ static void Destroy(Widget widget) { XmOutlineWidget ow = (XmOutlineWidget) widget; _XmListFree(XmOutline_child_op_list(ow)); XtReleaseGC(widget,XmOutline_draw_gc(ow)); } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - Extended List Widget to resize. * Returns: none. */ static void Resize(Widget w) { XmOutlineWidget ow = (XmOutlineWidget) w; if (XmHierarchy_refigure_mode(ow)) { if(XmOutline_constrain_width(ow)) CalcLocations(w, False); LayoutChildren(w, NULL); if (XtIsRealized((Widget)ow)) { XClearArea(XtDisplay(ow), XtWindow(ow), 0, 0, ow->core.width, ow->core.height, True); } } } /* Function Name: Redisplay * Description: This function deals with any pending moves/maps/unmaps * in the queue before redisplay * Arguments: w - the Outline widget. * event - event that caused the exposure. * region - the region containing all the exposures. * Returns: none */ typedef struct _RedispInfo { Window window; Boolean found; } RedispInfo; /* ARGSUSED */ static void Redisplay(Widget w, XEvent * event, Region region) { XmOutlineWidget ow = (XmOutlineWidget) w; XEvent junk; RedispInfo info; int lrx, lry; /* local variables for lower left corner. */ XmDropSiteStartUpdate(w); /* * Make sure that there are not more expose events pending in the queue */ info.window = XtWindow(w); info.found = False; XCheckIfEvent(XtDisplay(w), &junk, CheckExpose, (char *) &info); /* * Compute the maximum bounding rectangle for all expose events * that have yet to be processed. */ if (event->xexpose.x < XmOutline_ul_point(ow).x) XmOutline_ul_point(ow).x = event->xexpose.x; if (event->xexpose.y < XmOutline_ul_point(ow).y) XmOutline_ul_point(ow).y = event->xexpose.y; lrx = event->xexpose.x + event->xexpose.width; lry = event->xexpose.y + event->xexpose.height; if (lrx > XmOutline_lr_point(ow).x) XmOutline_lr_point(ow).x = lrx; if (lry > XmOutline_lr_point(ow).y) XmOutline_lr_point(ow).y = lry; if (!info.found) { /* No more expose events waiting - process these. */ XRectangle rect; rect.x = XmOutline_ul_point(ow).x; rect.y = XmOutline_ul_point(ow).y; rect.width = XmOutline_lr_point(ow).x - XmOutline_ul_point(ow).x; rect.height = XmOutline_lr_point(ow).y - XmOutline_ul_point(ow).y; ProcessChildQueue((XmOutlineWidget) w, &rect); if (XmOutline_connect_nodes(w)) RedrawOutlineLines(w,&rect); /* * Reset upper right and lower left points. */ XmOutline_ul_point(ow).x = w->core.width; XmOutline_ul_point(ow).y = w->core.height; XmOutline_lr_point(ow).x = XmOutline_lr_point(ow).y = 0; } XmDropSiteEndUpdate(w); } /* Function Name: CheckExpose * Description: Checks to see if there is an expose event on the queue. * Arguments: disp - the X Display. * event - the event to check for. * info_ptr - a pointer to the redispInfo. * Returns: Always False. */ /* ARGSUSED */ static Bool CheckExpose(Display *disp, XEvent *event, char *info_ptr) { RedispInfo *info = (RedispInfo *) info_ptr; if (info->found || event->xany.type != Expose) return(False); if (event->xexpose.window == info->window) info->found = True; return(False); } /* Function Name: QueryGeometry * Description: Called when my parent wants to know what size * I would like to be. * Arguments: w - the drt widget. * indended - constriants imposed by the parent. * preferred - what I would like. * Returns: See Xt Manual. */ static XtGeometryResult QueryGeometry(Widget w,XtWidgetGeometry *intended, XtWidgetGeometry *preferred) { Dimension *width_intended = NULL; Dimension *height_intended = NULL; if(!(intended->request_mode & XtCWQueryOnly)) { if(intended->request_mode & CWWidth) width_intended = &(intended->width); if(intended->request_mode & CWHeight) height_intended = &(intended->height); } GetDesiredSize(w, width_intended, height_intended, &(preferred->width), &(preferred->height), True, False); preferred->request_mode = CWWidth | CWHeight; return(_XmHWQuery(w, intended, preferred)); } /* Function Name: SetValues * Description: Called a resources is changed. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /* ARGSUSED */ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmOutlineWidget c_outline = (XmOutlineWidget) current; XmOutlineWidget outline = (XmOutlineWidget) set; Boolean layout = False; Boolean retval = False; if ((XmHierarchy_v_margin(c_outline) != XmHierarchy_v_margin(outline)) || (XmHierarchy_h_margin(c_outline) != XmHierarchy_h_margin(outline))) { layout = True; } if (XmOutline_indent_space(c_outline) != XmOutline_indent_space(outline)) { layout = True; } if (XmOutline_constrain_width(c_outline) != XmOutline_constrain_width(outline)) { layout = True; } if (XmHierarchy_refigure_mode(c_outline) != XmHierarchy_refigure_mode(outline)) layout = XmHierarchy_refigure_mode(outline); if (XmOutline_connect_nodes(c_outline) != XmOutline_connect_nodes(outline)) retval = True; if (layout) { XmOutlineWidgetClass oc = (XmOutlineWidgetClass) XtClass(set); XmOutlineCalcLocationProc calc_locations; _XmProcessLock() calc_locations = oc->outline_class.calc_locations; _XmProcessUnlock() (*calc_locations)(set, True); LayoutChildren(set, NULL); retval = True; } if (c_outline->manager.foreground != outline->manager.foreground) { XtReleaseGC(current,XmOutline_draw_gc(c_outline)); CreateGC(outline); retval = True; } return(retval); } /************************************************************ * * Composite Widget class procedures. * ************************************************************/ /* Function Name: ChangeManaged * Description: When a management change has occured... * Arguments: w - the icon box widget. * Returns: none. */ static void ChangeManaged(Widget w) { XmOutlineWidgetClass oc = (XmOutlineWidgetClass) XtClass(w); XmOutlineWidget ow = (XmOutlineWidget) w; if (XmHierarchy_refigure_mode(ow)) { XmOutlineCalcLocationProc calc_locations; _XmProcessLock() calc_locations = oc->outline_class.calc_locations; _XmProcessUnlock() (*calc_locations)(w, True); LayoutChildren(w, NULL); if (XtIsRealized((Widget)ow)) { XClearArea(XtDisplay(ow), XtWindow(ow), 0, 0, ow->core.width, ow->core.height, True); } } XmeNavigChangeManaged(w); /* for Motif navigation */ } /* Function Name: GeometryManager * Description: handles requests from children for a size change. * Arguments: child - the child to change. * request - the geometry that the child wants. * return - what we will allow if this is an almost. * Returns: status. */ /*ARGSUSED*/ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry * request, XtWidgetGeometry * result) { XmOutlineWidgetClass oc = (XmOutlineWidgetClass) XtClass(XtParent(w)); XmOutlineWidget ow = (XmOutlineWidget)(XtParent(w)); result->request_mode = 0; /* if nothing we're interested in, say No */ if (!(request->request_mode & (CWWidth | CWHeight | CWBorderWidth))) return(XtGeometryNo); if((XmOutline_constrain_width(ow)) && (request->request_mode & CWWidth) && (request->width > w->core.width)) { result->request_mode = CWWidth; result->width = w->core.width; return XtGeometryAlmost; } /* else we have something that we're interested in. Do we also have ** something that we're not granting? If so, say that we'll grant the ** stuff that we're interested in but not the other items */ if (request->request_mode & (CWX | CWY | CWStackMode | CWSibling)) { result->request_mode = request->request_mode & (CWWidth | CWHeight | CWBorderWidth); result->width = request->width; result->height = request->height; result->border_width = request->border_width; return(XtGeometryAlmost); } if (!(request->request_mode & CWWidth)) { request->width = w->core.width; result->request_mode |= CWWidth; } if (!(request->request_mode & CWBorderWidth)) { request->border_width = w->core.border_width; result->request_mode |= CWBorderWidth; } if (!(request->request_mode & CWHeight)) { request->height = w->core.height; result->request_mode |= CWHeight; } *result = *request; if (request->request_mode & XtCWQueryOnly) return(XtGeometryYes); /* * Correct for stupid children */ if(result->width <= 0) result->width = 1; if(result->height <= 0) result->height = 1; /* * A real allowed request, make the change. */ _XmResizeWidget(w, result->width, result->height, result->border_width); if (XmHierarchy_refigure_mode(ow)) { XmOutlineCalcLocationProc calc_locations; _XmProcessLock() calc_locations = oc->outline_class.calc_locations; _XmProcessUnlock() (*calc_locations)(XtParent(w), True); LayoutChildren(XtParent(w), w); if (XtIsRealized((Widget)ow)) { XClearArea(XtDisplay(ow), XtWindow(ow), 0, 0, ow->core.width, ow->core.height, True); } } return(XtGeometryYes); } /************************************************************ * * Constraint widget class procedures. * ************************************************************/ /* Function Name: ConstraintInitialize * Description: Called when a childs constriaints need initializing. * Arguments: req - the widget being requested. * set - what this will become. * args, num_args - the argument list. * Returns: none. */ /*ARGSUSED*/ static void ConstraintInitialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmOutlineC_widget_x(set->core.constraints) = XmOutlineC_open_close_x(set->core.constraints) = 0; } /* Function Name: ConstraintSetValues * Description: Called a constraint is changed on my children. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /*ARGSUSED*/ static Boolean ConstraintSetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { Widget ow = XtParent(set); OutlineConstraints set_node = GetNodeInfo(set); OutlineConstraints old_node = GetNodeInfo(current); Boolean insert_change = False, redisplay = False; int i; for (i = 0; i < *num_args; i++) if (streq(args[i].name, XmNinsertBefore)) { insert_change = True; break; } /* * Nothing below here needs to be done before we are realized. */ if (!XtIsRealized(set)) return(False); if ((XmHierarchyC_parent(set_node) != XmHierarchyC_parent(old_node)) || (XmHierarchyC_state(set_node) != XmHierarchyC_state(old_node)) || (insert_change)) { /* * Other operations have already been performed by my superclass. */ if (XmHierarchy_refigure_mode((XmOutlineWidget)ow)) { CalcLocations(ow, True); LayoutChildren(ow, NULL); redisplay = True; } /* * Since Layout children has (possibily) moved this widget * to a new location. The current state of the widget * must be updated so that neither the intrinsics nor * any sub-classes of this widget attempt to move it * to the new location, since it is already there. */ current->core.x = set->core.x; current->core.y = set->core.y; } if (XtIsRealized(ow) && redisplay && (XmHierarchy_refigure_mode((XmOutlineWidget)ow))) { XClearArea(XtDisplay(ow), XtWindow(ow), 0, 0, ow->core.width, ow->core.height, True); } return(False); } /* Function Name: ConstraintDestroy * Description: Destroys all data allocated by the constraint * record. * Arguments: w - the widget. * Returns: none. * * Removes the destroyed children from the list of children that still * need to be moved. */ static void ConstraintDestroy(Widget w) { OutlineConstraints node = GetNodeInfo(w); XmListElem *elem, *next; XmOutlineWidget ow; if (XmHierarchyC_state(node) == XmNotInHierarchy) return; ow = (XmOutlineWidget) XtParent(w); elem = XmListFirst(XmOutline_child_op_list(ow)); while(elem != NULL) { OutlineConstraints info = (OutlineConstraints) XmListElemData(elem); next = XmListElemNext(elem); if (XmHierarchyC_widget(info) == w) { /* * Each widget will only be in the list once. */ _XmListRemove(XmOutline_child_op_list(ow), elem); break; } elem = next; } } /************************************************************ * * Hierarchy Widget class proceedures. * ************************************************************/ /* Function Name: ToggleNodeState * Description: Toggles the open/close state of a toggle button. * Arguments: w - the command button that activated this. * node_ptr - a pointer to the node info. * call_data - UNUSED. * Returns: none. */ /*ARGSUSED*/ static void ToggleNodeState(Widget w, XtPointer node_ptr, XtPointer call_data) { Widget ow = XtParent(w); XmOutlineWidgetClass oc = (XmOutlineWidgetClass) XtClass(ow); { XtCallbackProc toggle_node_state; _XmProcessLock() toggle_node_state = SUPERCLASS->hierarchy_class.toggle_node_state; _XmProcessUnlock() (*toggle_node_state)(w, node_ptr, call_data); } { XmOutlineCalcLocationProc calc_locations; _XmProcessLock() calc_locations = oc->outline_class.calc_locations; _XmProcessUnlock() (*calc_locations)(ow, True); } LayoutChildren(ow, NULL); /* * Could check for a size change and abort if we really wanted * to be clever. */ if (XtIsRealized(ow)) { XClearArea(XtDisplay(ow), XtWindow(ow), 0, 0, ow->core.width, ow->core.height, True); } } /************************************************************ * * Outline widget class proceedures. * ************************************************************/ /************************************************************ * * Actions and Callbacks. * ************************************************************/ /************************************************************ * * Internal routines. * ************************************************************/ /* Function Name: CalcLocations * Description: Calculates the location of each widget in the outline. * Arguments: w - the outline widget. * allow_resize - allow shell to resize? * Returns: none. */ static void CalcLocations(Widget w, Boolean allow_resize) { Cardinal outline_depth, current_index; XmOutlineWidget ow = (XmOutlineWidget) w; OutlineConstraints node; XmOutlineWidgetClass oc = (XmOutlineWidgetClass) XtClass(w); register int i; unsigned int num_nodes; if (!XmHierarchy_refigure_mode(ow)) return; XmOutline_max_widget_width(ow) = 0; /* reset max_width. */ /* * Reset each node to be hidden; */ for( i = 0; i < ow->composite.num_children; ++i ) { node = GetNodeInfo(ow->composite.children[i]); XmHierarchyC_status(node) |= IS_COMPRESSED; } num_nodes = 0; outline_depth = 0; GetNodeDimensions(w, (OutlineConstraints) XmHierarchy_top_node(ow), outline_depth, &num_nodes); { XmOutlineMaxWidthProc calc_max_width; _XmProcessLock(); calc_max_width = oc->outline_class.calc_max_width; _XmProcessUnlock() XmOutline_max_width(ow) = (*calc_max_width)(w); } XmHierarchy_num_nodes(ow) = num_nodes; current_index = 0; { XmHierarchyBuildTableProc build_node_table; _XmProcessLock(); build_node_table = oc->hierarchy_class.build_node_table; _XmProcessUnlock(); (*build_node_table)(w, XmHierarchy_top_node(ow), ¤t_index); } if (num_nodes != 0) { XmOutline_top_node_of_display(ow) = (OutlineConstraints) XmHierarchy_node_table(ow)[0]; } else XmOutline_top_node_of_display(ow) = NULL; if (allow_resize) RequestNewSize(w); } /* Function Name: GetNodeDimensions Description: Calls GetNodeHeightAndWidth, but first resets maximum Arguments: w - outline widget node - the starting node depth - outline depth num_nodes - like num_nuts... hahaha Returns: none */ static void GetNodeDimensions(Widget w, OutlineConstraints node, Cardinal depth, Cardinal *num) { XmOutlineWidget ow = (XmOutlineWidget) w; XmOutline_max_widget_width(ow) = 2 * XmHierarchy_h_margin(ow); GetNodeHeightAndWidth(w, node, depth, TRUE, num); } /* Function Name: RequestNewSize * Description: Asks our parent for a new size. * Arguments: w - the data request outline widget. * Returns: none. */ static void RequestNewSize(Widget w) { Dimension width, height, rwidth, rheight; XtGeometryResult ret_val; GetDesiredSize(w, NULL, NULL, &width, &height, False, True); /* * It is just barely possible that our height or width could go to * zero. If this happens then do no request a new size because the * X server will generate a protocol error. It is best to just * stay where we are. */ if ((width == 0) || (height == 0)) return; ret_val = XtMakeResizeRequest(w, width, height, &rwidth, &rheight); while (ret_val == XtGeometryAlmost) { Dimension fwidth, fheight; /* Final values */ if(XmOutline_constrain_width(w)) { GetDesiredSize(w, &rwidth, &rheight, &fwidth, &fheight, False, True); ret_val = XtMakeResizeRequest(w, fwidth, fheight, &rwidth, &rheight); } else { ret_val = XtMakeResizeRequest(w, rwidth, rheight, NULL, NULL); } } } /* Function Name: GetDesiredSize * Description: Returns the desired size of the outline widget. * Arguments: w - the outline widget. * width - the intended width * height - the intended height * width_ret - the desired width. * height_ret - the desired height. * recalc - recalculate the new size if row height unset? * allow_resize - allow the outline to attempt a resize? * Returns: none. */ static void GetDesiredSize(Widget w, Dimension *width, Dimension *height, Dimension *width_ret, Dimension *height_ret, Boolean recalc, Boolean allow_resize) { XmOutlineWidget ow = (XmOutlineWidget) w; register int i, num, temp_height; OutlineConstraints * node; XmOutlineWidgetClass oc = (XmOutlineWidgetClass) XtClass(w); if (recalc) { if(XmOutline_constrain_width(w)) { Dimension tmp_width, tmp_height; tmp_height = w->core.height; tmp_width = w->core.width; if(width) w->core.width = *width; if(height) w->core.height = *height; { XmOutlineCalcLocationProc calc_locations; _XmProcessLock(); calc_locations = oc->outline_class.calc_locations; _XmProcessUnlock(); (*calc_locations)(w, allow_resize); } if(width) w->core.width = tmp_width; if(height) w->core.height = tmp_height; } else { { XmOutlineCalcLocationProc calc_locations; _XmProcessLock(); calc_locations = oc->outline_class.calc_locations; _XmProcessUnlock(); (*calc_locations)(w, allow_resize); } } } if(XmOutline_constrain_width(ow) && width) { *width_ret = *width; } else { *width_ret = XmOutline_max_width(ow); } temp_height = 0; node = (OutlineConstraints *) XmHierarchy_node_table(ow); num = XmHierarchy_num_nodes(ow); for (i = 0; i < num; i++, node++) temp_height += XmOutlineC_height(*node) + XmHierarchy_v_margin(ow); *height_ret = temp_height + XmHierarchy_v_margin(ow); } /* Function Name: LayoutChildren * Description: all the fun stuff for positioning the children is here. * Arguments: w - the outline widget. * assign_child - The child to assign values to rather * than _XiMove. * Returns: none. */ static void LayoutChildren(Widget w, Widget assign_child) { XmOutlineWidget ow = (XmOutlineWidget) w; XmOutlineWidgetClass oc = (XmOutlineWidgetClass) XtClass(w); register OutlineConstraints disp_top = XmOutline_top_node_of_display(ow); register HierarchyConstraints * node_table = XmHierarchy_node_table(ow); register Cardinal num_nodes = XmHierarchy_num_nodes(ow); register Position cur_y; register int cur_node, v_margin; int oc_x = 0, oc_y = 0; Boolean register_workproc = True; if (!XmHierarchy_refigure_mode(ow)) return; XmDropSiteStartUpdate(w); /* * Remove the old list, replace it with the new one. */ if (XmListFirst(XmOutline_child_op_list(ow)) != NULL) { if( XmHierarchy_work_proc_id(ow) != (XtWorkProcId) NULL ) { XtRemoveWorkProc(XmHierarchy_work_proc_id(ow)); XmHierarchy_work_proc_id(ow) = (XtWorkProcId) NULL; } _XmListFree(XmOutline_child_op_list(ow)); XmOutline_child_op_list(ow) = _XmListInit(); register_workproc = False; } /* * Unmap all nodes that no longer are visible. */ { XmHierarchyExtraNodeProc unmap_all_extra_nodes; _XmProcessLock(); unmap_all_extra_nodes = oc->hierarchy_class.unmap_all_extra_nodes; _XmProcessUnlock(); (*unmap_all_extra_nodes)(w, XmHierarchy_top_node(ow)); } /* * Find the first node to be displayed, and unmap all nodes that would be * above that one. */ for (cur_node = 0; cur_node < num_nodes; cur_node++, node_table++) { if (*node_table == (HierarchyConstraints) disp_top) break; UnmapNode(ow, (OutlineConstraints) *node_table); } cur_y = (Position) (v_margin = XmHierarchy_v_margin(ow)); while ( ((int)cur_node < (int)num_nodes) && (XmOutline_connect_nodes(ow) || ((int)cur_y < (int)ow->core.height) ) ) { register Widget w; OutlineConstraints node = (OutlineConstraints) *node_table; if (XmHierarchyC_open_close_button(node) != NULL) { Position offset; Widget w; w = XmHierarchyC_open_close_button(node); offset = (XmOutlineC_height(node) - (w->core.height + 2 * w->core.border_width)); oc_x = XmOutlineC_open_close_x(node); oc_y = cur_y + offset/2; } w = XmHierarchyC_widget(node); if (assign_child == w) { w->core.x = XmOutlineC_widget_x(node); w->core.y = cur_y; } MoveNode(ow, node, XmOutlineC_widget_x(node), cur_y, oc_x, oc_y, True); cur_y += XmOutlineC_height(node) + v_margin; cur_node++; node_table++; } /* * We have used all the window, unmap all other nodes. */ while(cur_node < num_nodes) { UnmapNode(ow, (OutlineConstraints) *node_table); cur_node++; node_table++; } if (register_workproc) { XmHierarchy_work_proc_id(ow) = XtAppAddWorkProc(XtWidgetToApplicationContext(w), MoveNodesTimer, (XtPointer) w); } XmDropSiteEndUpdate(w); } /* Function Name: GetNodeHeightAndWidth * Description: Gets the size of each node. * Arguments: w - the drt widget. * node - the node to get the height and width of. * outline_depth - depth of the outline at this node. * recurse - recurse all subnodes?. * IN/OUT num - number of nodes. * Returns: none */ static void GetNodeHeightAndWidth(Widget w, OutlineConstraints node, Cardinal outline_depth, Boolean recurse, Cardinal * num) { XmOutlineWidget ow = (XmOutlineWidget) w; register int i; XtWidgetGeometry geom_pref; if ((node == NULL) || ((XmHierarchyC_widget(node) != NULL) && !XtIsManaged(XmHierarchyC_widget(node)))) { return; } if (XmHierarchyC_state(node) != XmHidden) { Arg args[5]; Cardinal num_args; Dimension width, open_height, node_height, width2, border_width; if (XmHierarchyC_open_close_button(node) != NULL) { num_args = 0; XtSetArg(args[num_args], XmNwidth, &width); num_args++; XtSetArg(args[num_args], XmNheight, &open_height); num_args++; XtSetArg(args[num_args], XmNborderWidth, &border_width);num_args++; XtGetValues(XmHierarchyC_open_close_button(node), args, num_args); border_width *= 2; width += border_width; open_height += border_width; } else { width = 0; open_height = 0; } num_args = 0; /* XtSetArg(args[num_args], XmNwidth, &width2); num_args++; */ /* XtSetArg(args[num_args], XmNheight, &node_height); num_args++; */ XtSetArg(args[num_args], XmNborderWidth, &border_width); num_args++; XtGetValues(XmHierarchyC_widget(node), args, num_args); XtQueryGeometry(XmHierarchyC_widget(node), NULL, &geom_pref); width2 = geom_pref.width; node_height = geom_pref.height; border_width *= 2; width2 += border_width; node_height += border_width; /* * indent_level = outline_depth; */ XmOutlineC_open_close_x(node) = ((outline_depth *XmOutline_indent_space(ow)) + XmHierarchy_h_margin(ow)); if (XmHierarchyC_open_close_button(node) == NULL) XmOutlineC_widget_x(node) = XmOutlineC_open_close_x(node); else XmOutlineC_widget_x(node) = (XmOutlineC_open_close_x(node) + width + XmHierarchy_h_margin(ow)); width2 += XmOutlineC_widget_x(node) + XmHierarchy_h_margin(ow); if ( width2 > XmOutline_max_widget_width(ow) ) XmOutline_max_widget_width(ow) = width2; /* * Now, if we are set to constrain our childrens' widths, we need * to do a geometry negotiation and reset the width to whatever we * decide. */ if(XmOutline_constrain_width(w)) { NegotiateNodeWidth(w, node); num_args = 0; XtSetArg(args[num_args], XmNheight, &node_height); num_args++; XtGetValues(XmHierarchyC_widget(node), args, num_args); } XmOutlineC_height(node) = MAX(node_height, open_height); (*num)++; } if (!recurse || (XmHierarchyC_state(node) == XmClosed)) return; /* * Hidden nodes don't count as another level down the outline. */ if (XmHierarchyC_state(node) != XmHidden) outline_depth++; for (i = 0; i < XmHierarchyC_num_children(node); i++) { GetNodeHeightAndWidth(w, (OutlineConstraints) XmHierarchyC_children(node)[i], outline_depth, TRUE, num); } if (XmHierarchyC_state(node) != XmHidden) outline_depth--; } /* Function Name: GetNodeInfo * Description: Gets the node info associated with this widget. * Arguments: w - the widget. * Returns: the node info about this widget. */ static OutlineConstraints GetNodeInfo(Widget w) { return((OutlineConstraints) w->core.constraints); } /* Function Name: CalcMaxWidth * Description: Calculates the maximum width of the outline. * Arguments: w - the outline. * Returns: The max width the outline would like to be. */ static int CalcMaxWidth(Widget w) { return XmOutline_max_widget_width(w) + 2 * XmHierarchy_h_margin(w); } /************************************************************ * * Code for handling the node queue. * ************************************************************/ /* Function Name: UnmapAllExtraNodes * Description: Correctly unmaps each node in the hierarchy that is * currently compressed out. * Arguments: w - the ow. * node - node to work one. * Returns: none */ static void UnmapAllExtraNodes(Widget w, HierarchyConstraints node) { register int i, num; register HierarchyConstraints * ptr; if ((XmHierarchyC_status(node) & IS_COMPRESSED) && (XmHierarchyC_status(node) & IS_MAPPED)) { UnmapNode((XmOutlineWidget) w, (OutlineConstraints) node); } ptr = XmHierarchyC_children(node); for (num = XmHierarchyC_num_children(node), i = 0; i < num; i++, ptr++) UnmapAllExtraNodes(w, *ptr); } /* Function Name: MoveNode * Description: This function adds a widget to the movment queue * but does not move it until it becomes visible. * Arguments: ow - the outline widget. * node - the node to move. * x, y - the X and Y location. * oc_x, oc_y - the X and Y location of the open close button. * map - map this child? * Returns: none. */ static void MoveNode(XmOutlineWidget ow, OutlineConstraints node, Position x, Position y, Position oc_x, Position oc_y, Boolean map) { XmOutlineC_new_x(node) = x; XmOutlineC_new_y(node) = y; XmOutlineC_oc_new_x(node) = oc_x; XmOutlineC_oc_new_y(node) = oc_y; XmOutlineC_map(node) = map; XmOutlineC_move(node) = True; XmOutlineC_unmap(node) = False; _XmListAddBefore(XmOutline_child_op_list(ow), NULL, (XtPointer) node); } /* Function Name: UnmapNode * Description: This function adds a widget to the movment queue * telling it to be unmapped. * Arguments: ow - the outline widget. * node - the node to move. * Returns: none. */ static void UnmapNode(XmOutlineWidget ow, OutlineConstraints node) { XmOutlineC_map(node) = False; XmOutlineC_move(node) = False; XmOutlineC_unmap(node) = True; _XmListAddBefore(XmOutline_child_op_list(ow), NULL, (XtPointer) node); } /* Function Name: ProcessChildQueue * Description: Processes the child queue. * Arguments: ow - the outline widget. * vis - the visible rect. * Returns: none. */ static void ProcessChildQueue(XmOutlineWidget ow, XRectangle *vis) { XmListElem *elem, *next; elem = XmListFirst(XmOutline_child_op_list(ow)); while(elem != NULL) { OutlineConstraints info = (OutlineConstraints) XmListElemData(elem); next = XmListElemNext(elem); if (CheckWidget(vis, info)) _XmListRemove(XmOutline_child_op_list(ow), elem); elem = next; } } /* Function Name: CheckWidget * Description: This function checks a widget to see if it * needs to be operated on. * Arguments: visible - visible rect. * info - the child op info. * Returns: True if operation complete. * * NOTES: A widget will need to be operated on if it is mapped an will show * on the screen, or if the new location is on the screen. */ static Boolean CheckWidget(XRectangle * visible, OutlineConstraints node) { if (( ((XmHierarchyC_status(node) & IS_MAPPED) || XmOutlineC_map(node)) && ( WidgetInRect(visible, XmHierarchyC_open_close_button(node)) || WidgetInRect(visible, XmHierarchyC_parent(node)) || WidgetInRect(visible, XmHierarchyC_widget(node)) ) ) || LocInRect(visible, XmHierarchyC_open_close_button(node), XmOutlineC_oc_new_x(node), XmOutlineC_oc_new_y(node)) || LocInRect(visible, XmHierarchyC_widget(node), XmOutlineC_new_x(node), XmOutlineC_new_y(node)) ) { ProcessNode(node); return(True); } return(False); } /* Function Name: ProcessNode * Description: Processes the request made of this outline node. * Arguments: node - the Outline node to process. * Returns: none. */ static void ProcessNode(OutlineConstraints node) { XmOutlineWidgetClass tc; Widget w = XmHierarchyC_widget(node); if (w == NULL) return; tc = (XmOutlineWidgetClass) XtClass(XtParent(w)); if (XmOutlineC_move(node)) { _XmMoveWidget(XmHierarchyC_widget(node), XmOutlineC_new_x(node), XmOutlineC_new_y(node)); if (XmHierarchyC_open_close_button(node) != NULL) _XmMoveWidget(XmHierarchyC_open_close_button(node), XmOutlineC_oc_new_x(node), XmOutlineC_oc_new_y(node)); XmOutlineC_move(node) = False; } if (XmOutlineC_map(node)) { { XmHierarchyNodeProc map_node; _XmProcessLock(); map_node = tc->hierarchy_class.map_node _XmProcessUnlock(); (*map_node)((HierarchyConstraints) node); } XmOutlineC_map(node) = False; } if (XmOutlineC_unmap(node)) { { XmHierarchyNodeProc unmap_node; _XmProcessLock(); unmap_node = tc->hierarchy_class.unmap_node _XmProcessUnlock(); (*unmap_node)((HierarchyConstraints) node); } XmOutlineC_unmap(node) = False; } } /* Function Name: WidgetInRect * Description: Checks to see if widget is in the rect specified. * Arguments: rect - the rect to check. * w - the widget to check. * Returns: True if the widget is in the regien specified. */ static Boolean WidgetInRect(XRectangle *rect, Widget w) { if (w == NULL) return(False); return(LocInRect(rect, w, w->core.x, w->core.y)); } /* Function Name: LocInRect * Description: Checks to see if widget is in the rect specified. * given new X and Y locations. * Arguments: rect - the rectangle to check. * w - the widget to check. * x, y - the new x and y locations. * Returns: True if the widget is in the regien specified. */ static Boolean LocInRect(XRectangle *rect, Widget w, Position x, Position y) { register int x1, x2; register int y1, y2; if (w == NULL) return(False); x1 = x + w->core.width; y1 = y + w->core.height; x2 = rect->x + rect->width; y2 = rect->y + rect->height; return (!((x > x2) || (y > y2) || (x1 < rect->x) || (y1 < rect->y))); } /* Function Name: MoveNodesTimer * Description: processes one node from the movement queue. * Arguments: data - A Pointer to the outline widget. * id - th ext interval id. * Returns: none */ /* ARGSUSED */ static Boolean MoveNodesTimer(XtPointer data) { XmOutlineWidget ow = (XmOutlineWidget) data; XmListElem *elem = XmListFirst(XmOutline_child_op_list(ow)); if (elem != NULL) { OutlineConstraints node = (OutlineConstraints) XmListElemData(elem); ProcessNode(node); _XmListRemove(XmOutline_child_op_list(ow), elem); return (False); } XmHierarchy_work_proc_id(ow) = (XtWorkProcId) NULL; return (True); } /* Function Name: NegotiateNodeWidth * Description: Does a geometry negoation with the child * specified by node with the intent of fitting * the child within the existing width of the * Outline widget. * Arguments: w - The XmOutline widget * node - The constraint record for the child in * question * Returns: The width negotiated */ static void NegotiateNodeWidth(Widget w, OutlineConstraints node) { Dimension width_avail; XtWidgetGeometry geom_asked, geom_agreed; XtGeometryResult result; Dimension curr_width, curr_height; width_avail = w->core.width - XmOutlineC_widget_x(node); curr_width = XmHierarchyC_widget(node)->core.width; curr_height = XmHierarchyC_widget(node)->core.height; geom_asked.request_mode = XtCWQueryOnly; result = XtQueryGeometry(XmHierarchyC_widget(node), &geom_asked, &geom_agreed); if(geom_agreed.width < 1) geom_agreed.width = 1; if(geom_agreed.height < 1) geom_agreed.height = 1; if(geom_agreed.width <= width_avail) { /* * If it's the right size already, just return */ if(curr_width == geom_agreed.width && curr_height == geom_agreed.height) { return; } else { _XmResizeWidget(XmHierarchyC_widget(node), geom_agreed.width, geom_agreed.height, geom_agreed.border_width); return; } } /* * Otherwise tell the widget to size itself to the right width and * see what we get */ geom_asked.request_mode = CWWidth; geom_asked.width = width_avail; result = XtQueryGeometry(XmHierarchyC_widget(node), &geom_asked, &geom_agreed); if(geom_agreed.width < 1) geom_agreed.width = 1; if(geom_agreed.height < 1) geom_agreed.height = 1; if(result == XtGeometryYes) { _XmResizeWidget(XmHierarchyC_widget(node), width_avail, geom_agreed.height, geom_agreed.border_width); return; } else if(result == XtGeometryAlmost) { /* * See if it lied and set the width correctly anyway */ if(geom_agreed.width <= width_avail) { _XmResizeWidget(XmHierarchyC_widget(node), geom_agreed.width, geom_agreed.height, geom_agreed.border_width); return; } } /* * If we get here, the sucker tried to deny the request, so just * clip the thing. Thbbbt! */ _XmResizeWidget(XmHierarchyC_widget(node), width_avail, geom_agreed.height, geom_agreed.border_width); } /* drawing on expose; taken from XmTree in horizontal mode with ** ladder drawing ** Note: it looks not so good when indentSpace is very small */ static void RedrawOutlineLines(Widget w, XRectangle * rect) { XmOutlineWidget ow = (XmOutlineWidget) w; if (XtIsRealized(w)) /* && has children */ DrawOutlineLine(w, rect, (OutlineConstraints) XmHierarchy_top_node(ow)); } static void DrawOutlineLine(Widget w, XRectangle *rect, OutlineConstraints node) { OutlineConstraints from_node = node; if (XmHierarchyC_widget(node) != NULL && !XtIsManaged(XmHierarchyC_widget(node))) return; /* * Hunt up the list until we find a non-hidden parent to be the from * node. */ while ((XmHierarchyC_parent(from_node) != NULL) && (XmHierarchyC_state(from_node) == XmHidden)) { from_node = GetNodeInfo(XmHierarchyC_parent(from_node)); } { OutlineConstraints * kids; register int i, num_kids; Boolean anyKidManaged = False; /* CR03730 Support Case 22066 */ LadderPoint from_node_point ={0, 0}, kid_point = {0, 0}; LadderPoint last_kid_point ={0, 0}; XmOutlineWidget ow = (XmOutlineWidget)w; num_kids = XmHierarchyC_num_children(node); kids = (OutlineConstraints *) XmHierarchyC_children(node); /* * This only executes if the root is hidden. */ if (XmHierarchyC_state(from_node) == XmHidden) { for (i = 0; i < num_kids; i++, kids++) DrawOutlineLine(w, rect, *kids); /* recurse to descendants. */ return; } if (XmHierarchyC_state(from_node) == XmClosed) return; _CalcNodeMidPoint( from_node, w, &from_node_point ); for (i = 0; i < num_kids; i++, kids++) { if (XtIsManaged(XmHierarchyC_widget((*kids)))) { anyKidManaged = True; /* CR03730 Support Case 22066 */ if (XmHierarchyC_state((*kids)) != XmHidden) { _OutlineDrawLine(w, rect, from_node, *kids, from_node_point, &kid_point); /* set up the points to draw ladder lines */ last_kid_point.x = kid_point.x; last_kid_point.y = kid_point.y; } DrawOutlineLine(w, rect, *kids); /* recurse to descendants. */ } } /* Draw extra ladder lines if necessary. */ if (num_kids > 0 && anyKidManaged) { /* CR03730 Support Case 22066 anyKidManaged added to prevent draw needless (x & y are not initialized if no kid managed) line */ XDrawLine(XtDisplay(w), XtWindow(w), XmOutline_draw_gc(ow), from_node_point.x, from_node_point.y, from_node_point.x, last_kid_point.y ); } } } static void _CalcNodeMidPoint( OutlineConstraints node, Widget w, LadderPoint *ret_point ) { if (!XmHierarchyC_widget(node)) return; { XmOutlineWidget ow = (XmOutlineWidget)w; Widget which; int value; if (XmHierarchyC_open_close_button(node)) value = (int)XtWidth(which=XmHierarchyC_open_close_button(node)); else { value = (int)XmOutline_indent_space(ow); which = XmHierarchyC_widget(node); } ret_point->x = XmOutlineC_open_close_x(node) + value/2; ret_point->y = XtY(which)+XtHeight(which); /* plus possible pad */ } } static void _OutlineDrawLine(Widget w, XRectangle *rect, OutlineConstraints parent, OutlineConstraints child, LadderPoint from_ladder_point, LadderPoint *to_ladder_point ) { GC gc; XmOutlineWidget ow = (XmOutlineWidget) w; register int x2, y2; register int rx2, ry2, cx1, cx2, cy1, cy2; /* * (from_ladder_point.x, from_ladder_point.y) are the coordinates * of the parent's midpoint * (x2, y2) are the coordinates of the child midpoint * * We will end up drawing a partial ladder line from * (cx1, cy1) to (cx2, cy2) * * (rx2, ry2) are the coordinates of the lower right of clip rectangle */ /* * Must always do the first node since it is what draws the root * of the ladder. */ if (child != (OutlineConstraints) XmHierarchyC_children(parent)[0] && (!(XmHierarchyC_status(child) & IS_MAPPED) || (XmHierarchyC_status(child) & IS_COMPRESSED))) { return; } gc = XmOutline_draw_gc(ow); x2 = XmOutlineC_open_close_x(child); y2 = XtY(XmHierarchyC_widget(child)) + XtHeight(XmHierarchyC_widget(child))/2; cx1 = MIN(from_ladder_point.x, x2); cx2 = MAX(from_ladder_point.x, x2); cy1 = MIN(from_ladder_point.y, y2); cy2 = MAX(from_ladder_point.y, y2); cy1 = cy2 = y2; rx2 = rect->x + rect->width; ry2 = rect->y + rect->height; /* * Not very pretty, only checks to see if the rect containing the * line is partially within the exposed rectangle. */ if (!((cx1 > rx2) || (cy1 > ry2) || (cx2 < rect->x) || (cy2 < rect->y))) XDrawLine(XtDisplay(w), XtWindow(w), gc, cx1, cy1, cx2, cy2); /* This is sent back because the ladder lines get connected later */ to_ladder_point->x = cx1; to_ladder_point->y = cy1; } /************************************************************ * * Public functions. * ************************************************************/ /* Function Name: XmCreateOutline * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateOutline(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmOutlineWidgetClass, parent, args, num_args)); } motif-2.3.8/lib/Xm/XmRenderTI.h0000644000175000017500000002222712672140200013046 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: XmRenderTI.h /main/5 1995/07/13 18:24:12 drk $ */ #ifndef _XmRenderTI_h #define _XmRenderTI_h #include #ifdef USE_XFT #include #endif #ifdef __cplusplus extern "C" { #endif /* Internal types for XmRenderTable.c */ #define REND_OPTIMIZED_BITS 1 #define REND_MARK_BITS REND_OPTIMIZED_BITS #define REND_REFCOUNT_BITS (16 - REND_OPTIMIZED_BITS) /* * Macros for Rendition data structure access */ #define _XmRendRefcount(r) ((_XmRendition)*(r))->refcount #define _XmRendFontOnly(r) ((_XmRendition)*(r))->fontOnly #define _XmRendLoadModel(r) ((_XmRendition)*(r))->loadModel #define _XmRendTag(r) ((_XmRendition)*(r))->tag #define _XmRendFontName(r) ((_XmRendition)*(r))->fontName #define _XmRendFontType(r) ((_XmRendition)*(r))->fontType #define _XmRendFont(r) ((_XmRendition)*(r))->font #define _XmRendDisplay(r) ((_XmRendition)*(r))->display #define _XmRendTabs(r) ((_XmRendition)*(r))->tabs #if USE_XFT #define _XmRendBG(r) ((_XmRendition)*(r))->xftBackground.pixel #define _XmRendFG(r) ((_XmRendition)*(r))->xftForeground.pixel #define _XmRendXftFont(r) ((_XmRendition)*(r))->xftFont #define _XmRendXftFG(r) ((_XmRendition)*(r))->xftForeground #define _XmRendXftBG(r) ((_XmRendition)*(r))->xftBackground #define _XmRendPattern(r) ((_XmRendition)*(r))->pattern #define _XmRendFontStyle(r) ((_XmRendition)*(r))->fontStyle #define _XmRendFontFoundry(r) ((_XmRendition)*(r))->fontFoundry #define _XmRendFontEncoding(r) ((_XmRendition)*(r))->fontEncoding #define _XmRendFontSize(r) ((_XmRendition)*(r))->fontSize #define _XmRendPixelSize(r) ((_XmRendition)*(r))->pixelSize #define _XmRendFontSlant(r) ((_XmRendition)*(r))->fontSlant #define _XmRendFontSpacing(r) ((_XmRendition)*(r))->fontSpacing #define _XmRendFontWeight(r) ((_XmRendition)*(r))->fontWeight #else #define _XmRendBG(r) ((_XmRendition)*(r))->background #define _XmRendFG(r) ((_XmRendition)*(r))->foreground #define _XmRendXftFont(r) (NULL) #endif #define _XmRendBGState(r) ((_XmRendition)*(r))->backgroundState #define _XmRendFGState(r) ((_XmRendition)*(r))->foregroundState #define _XmRendUnderlineType(r) ((_XmRendition)*(r))->underlineType #define _XmRendStrikethruType(r)((_XmRendition)*(r))->strikethruType #define _XmRendGC(r) ((_XmRendition)*(r))->gc #define _XmRendTags(r) ((_XmRendition)*(r))->tags #define _XmRendTagCount(r) ((_XmRendition)*(r))->count #define _XmRendHadEnds(r) ((_XmRendition)*(r))->hadEnds #define _XmRendRefcountInc(r) ++(((_XmRendition)*(r))->refcount) #define _XmRendRefcountDec(r) --(((_XmRendition)*(r))->refcount) #define FIX_1415 typedef struct __XmRenditionRec { /* flag indicating _XmFontRenditionRec */ unsigned int fontOnly : REND_OPTIMIZED_BITS; unsigned int refcount : REND_REFCOUNT_BITS; unsigned char loadModel; XmStringTag tag; String fontName; XmFontType fontType; XtPointer font; Display *display; GC gc; XmStringTag *tags; unsigned int count; Boolean hadEnds; XmTabList tabs; Pixel background; Pixel foreground; unsigned char underlineType; unsigned char strikethruType; unsigned char backgroundState; unsigned char foregroundState; #ifdef USE_XFT char *fontStyle, /* *family, Use font_name instead. */ *fontFoundry, *fontEncoding; int fontSize, pixelSize, fontSlant, fontSpacing, fontWeight; XftPattern *pattern; XftFont *xftFont; XftColor xftForeground, xftBackground; #endif } _XmRenditionRec, *_XmRendition; typedef struct __XmFontRenditionRec { /* flag indicating _XmFontRenditionRec */ unsigned int fontOnly : REND_OPTIMIZED_BITS; unsigned int refcount : REND_REFCOUNT_BITS; unsigned char loadModel; XmStringTag tag; String fontName; XmFontType fontType; XtPointer font; Display *display; GC *gc; XmStringTag *tags; unsigned int count; } _XmFontRenditionRec, *_XmFontRendition; /* Accessor macros. */ #define _XmRTCount(rt) ((_XmRenderTable)*(rt))->count #define _XmRTRenditions(rt) ((_XmRenderTable)*(rt))->renditions #define _XmRTDisplay(rt) ((_XmRenderTable)*(rt))->display #define _XmRTMark(rt) ((_XmRenderTable)*(rt))->mark #define _XmRTRefcount(rt) ((_XmRenderTable)*(rt))->refcount #define _XmRTRefcountInc(rt) ++(((_XmRenderTable)*(rt))->refcount) #define _XmRTRefcountDec(rt) --(((_XmRenderTable)*(rt))->refcount) #define RENDITIONS_IN_STRUCT 1 typedef struct __XmRenderTableRec { unsigned int mark : REND_MARK_BITS; unsigned int refcount : REND_REFCOUNT_BITS; unsigned short count; Display *display; XmRendition renditions[RENDITIONS_IN_STRUCT]; } _XmRenderTableRec, *_XmRenderTable; /******** Private Function Declarations for XmRenderTable.c ********/ extern XmRendition _XmRenderTableFindRendition(XmRenderTable table, XmStringTag tag, #if NeedWidePrototypes int cached_tag, int need_font, int call, #else Boolean cached_tag, Boolean need_font, Boolean call, #endif /* NeedWidePrototypes */ short *index); extern XmRendition _XmRenditionCreate(Display *display, Widget widget, String resname, String resclass, XmStringTag tag, ArgList arglist, Cardinal argcount, Boolean *in_db); extern XmRendition _XmRenderTableGetMerged(XmRenderTable rt, XmStringTag base, XmStringTag *tags, #if NeedWidePrototypes unsigned int tag_count #else unsigned short tag_count #endif /* NeedWidePrototypes */ ); extern XmRendition _XmRenditionMerge(Display *d, XmRendition *scr, XmRendition base_rend, XmRenderTable rt, XmStringTag base_tag, XmStringTag *tags, #if NeedWidePrototypes unsigned int tag_count, unsigned int copy #else unsigned short tag_count, Boolean copy #endif /* NeedWidePrototypes */ ); extern Widget _XmCreateRenderTable(Widget parent, String name, ArgList arglist, Cardinal argcount); extern Widget _XmCreateRendition(Widget parent, String name, ArgList arglist, Cardinal argcount); extern Display *_XmRenderTableDisplay(XmRenderTable table); extern XmRendition _XmRenditionCopy(XmRendition rend, Boolean shared); extern Boolean _XmRenderTableFindFallback(XmRenderTable , XmStringTag tag, #if NeedWidePrototypes int cached_tag, #else Boolean cached_tag, #endif /* NeedWidePrototypes */ short *indx, XmRendition *rend_ptr) ; extern Boolean _XmRenderTableFindFirstFont(XmRenderTable rendertable, short *indx, XmRendition *rend_ptr); extern XmRenderTable _XmRenderTableRemoveRenditions(XmRenderTable oldtable, XmStringTag *tags, int tag_count, #if NeedWidePrototypes int chk_font, #else Boolean chk_font, #endif /* NeedWidePrototypes */ XmFontType type, XtPointer font); #ifdef USE_XFT /* * XftDraw cache functions, implemented in lib/Xm/FontList.c */ XftDraw * _XmXftDrawCreate(Display *display, Window window); void _XmXftDrawDestroy(Display *display, Window window, XftDraw *d); void _XmXftDrawString(Display *display, Window window, XmRendition rend, int bpc, #if NeedWidePrototypes int x, int y, #else Position x, Position y, #endif /* NeedWidePrototypes */ char *s, int len, #if NeedWidePrototypes int image #else Boolean image #endif /* NeedWidePrototypes */ ); void _XmXftDrawString2(Display *display, Window window, GC gc, XftFont *font, int bpc, #if NeedWidePrototypes int x, int y, #else Position x, Position y, #endif char *s, int len); void _XmXftSetClipRectangles(Display *display, Window window, Position x, Position y, XRectangle *rects, int n); XftColor _XmXftGetXftColor(Display *display, Pixel color); #ifdef FIX_1415 void _XmXftFontAverageWidth(Widget w, XtPointer f, int *width); #endif #endif /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRenderTI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TraversalI.h0000644000175000017500000002205113145162623013145 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTraversalI_h #define _XmTraversalI_h #include #ifdef __cplusplus extern "C" { #endif #define NavigTypeIsTabGroup(navigation_type) \ ((navigation_type == XmTAB_GROUP) || \ (navigation_type == XmSTICKY_TAB_GROUP) || \ (navigation_type == XmEXCLUSIVE_TAB_GROUP)) typedef enum { XmUnrelated, XmMyAncestor, XmMyDescendant, XmMyCousin, XmMySelf } XmGeneology; typedef struct _XmTravGraphRec { union _XmTraversalNodeRec *head ; Widget top ; union _XmTraversalNodeRec *current ; unsigned short num_entries ; unsigned short num_alloc ; unsigned short next_alloc ; unsigned short exclusive ; unsigned short tab_list_alloc ; unsigned short num_tab_list ; Widget *excl_tab_list ; } XmTravGraphRec, * XmTravGraph ; typedef struct _XmFocusDataRec { Widget active_tab_group; Widget focus_item; Widget old_focus_item; Widget pointer_item; Widget old_pointer_item; Boolean needToFlush; XCrossingEvent lastCrossingEvent; XmGeneology focalPoint; unsigned char focus_policy ; /* Mirrors focus_policy resource when focus */ XmTravGraphRec trav_graph ; /* data retrieved using _XmGetFocusData().*/ Widget first_focus ; } XmFocusDataRec ; typedef enum { XmTAB_GRAPH_NODE, XmTAB_NODE, XmCONTROL_GRAPH_NODE, XmCONTROL_NODE } XmTravGraphNodeType ; typedef union _XmDeferredGraphLink { int offset ; struct _XmGraphNodeRec *link ; } XmDeferredGraphLink ; typedef struct _XmAnyNodeRec /* Common */ { unsigned char type ; XmNavigationType nav_type ; XmDeferredGraphLink tab_parent ; Widget widget ; XRectangle rect ; union _XmTraversalNodeRec *next ; union _XmTraversalNodeRec *prev ; } XmAnyNodeRec, *XmAnyNode ; typedef struct _XmControlNodeRec { XmAnyNodeRec any ; union _XmTraversalNodeRec *up ; union _XmTraversalNodeRec *down ; } XmControlNodeRec, *XmControlNode ; typedef struct _XmTabNodeRec { XmAnyNodeRec any ; } XmTabNodeRec, *XmTabNode ; typedef struct _XmGraphNodeRec { XmAnyNodeRec any ; union _XmTraversalNodeRec *sub_head ; union _XmTraversalNodeRec *sub_tail ; } XmGraphNodeRec, *XmGraphNode ; typedef union _XmTraversalNodeRec { XmAnyNodeRec any ; XmControlNodeRec control ; XmTabNodeRec tab ; XmGraphNodeRec graph ; } XmTraversalNodeRec, *XmTraversalNode ; typedef struct { XmTraversalNode *items; XmTraversalNode lead_item; Cardinal num_items; Cardinal max_items; Position min_hint; Position max_hint; } XmTraversalRow; /******** Private Function Declarations for Traversal.c ********/ extern XmFocusData _XmCreateFocusData( void ) ; extern void _XmDestroyFocusData( XmFocusData focusData) ; extern void _XmSetActiveTabGroup( XmFocusData focusData, Widget tabGroup) ; extern Widget _XmGetActiveItem( Widget w) ; extern void _XmNavigInitialize( Widget request, Widget new_wid, ArgList args, Cardinal *num_args) ; extern Boolean _XmNavigSetValues( Widget current, Widget request, Widget new_wid, ArgList args, Cardinal *num_args) ; extern void _XmNavigResize( Widget wid) ; extern void _XmValidateFocus( Widget wid) ; extern void _XmNavigDestroy( Widget wid) ; extern Boolean _XmCallFocusMoved( Widget old, Widget new_wid, XEvent *event) ; extern Boolean _XmMgrTraversal( Widget wid, XmTraversalDirection direction) ; extern void _XmClearFocusPath( Widget wid) ; extern Boolean _XmFocusIsHere( Widget w) ; extern unsigned char _XmGetFocusPolicy( Widget w) ; extern Widget _XmFindTopMostShell( Widget w) ; extern void _XmFocusModelChanged( Widget wid, XtPointer client_data, XtPointer call_data) ; extern XmFocusData _XmGetFocusData( Widget wid) ; extern Boolean _XmComputeVisibilityRect( Widget w, XRectangle *rectPtr, Boolean include_initial_border, Boolean allow_scrolling) ; extern Boolean _XmGetPointVisibility(Widget w, int root_x, int root_y); extern void _XmSetRect( register XRectangle *rect, Widget w) ; extern int _XmIntersectRect( register XRectangle *srcRectA, register Widget widget, register XRectangle *dstRect) ; extern int _XmEmptyRect( register XRectangle *r) ; extern void _XmClearRect( register XRectangle *r) ; extern Boolean _XmIsNavigable( Widget wid) ; extern void _XmWidgetFocusChange( Widget wid, XmFocusChange change) ; extern Widget _XmNavigate( Widget wid, XmTraversalDirection direction) ; extern void _XmSetInitialOfTabGroup( Widget tab_group, Widget init_focus) ; extern void _XmResetTravGraph( Widget wid) ; extern Boolean _XmShellIsExclusive( Widget wid) ; extern Widget _XmGetFirstFocus( Widget wid) ; /******** End Private Function Declarations ********/ /******** Private Function Declarations for TraversalI.c ********/ extern XmNavigability _XmGetNavigability( Widget wid) ; extern Boolean _XmIsViewable( Widget wid) ; extern Widget _XmIsScrollableClipWidget( Widget work_window, Boolean scrollable, XRectangle *visRect) ; extern Boolean _XmGetEffectiveView( Widget wid, XRectangle *visRect) ; extern Boolean _XmIntersectionOf( register XRectangle *srcRectA, register XRectangle *srcRectB, register XRectangle *destRect) ; extern XmNavigationType _XmGetNavigationType( Widget widget) ; extern Widget _XmGetActiveTabGroup( Widget wid) ; extern Widget _XmTraverseAway( XmTravGraph list, Widget wid, #if NeedWidePrototypes int wid_is_control) ; #else Boolean wid_is_control) ; #endif /* NeedWidePrototypes */ extern Widget _XmTraverse( XmTravGraph list, XmTraversalDirection action, XmTraversalDirection *local_dir, Widget reference_wid) ; extern void _XmFreeTravGraph( XmTravGraph trav_list) ; extern void _XmTravGraphRemove( XmTravGraph tgraph, Widget wid) ; extern void _XmTravGraphAdd( XmTravGraph tgraph, Widget wid) ; extern void _XmTravGraphUpdate( XmTravGraph tgraph, Widget wid) ; extern Boolean _XmNewTravGraph( XmTravGraph trav_list, Widget top_wid, Widget init_current) ; extern Boolean _XmSetInitialOfTabGraph( XmTravGraph trav_graph, Widget tab_group, Widget init_focus) ; extern void _XmTabListAdd( XmTravGraph graph, Widget wid) ; extern void _XmTabListDelete( XmTravGraph graph, Widget wid) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTraversalI_h */ motif-2.3.8/lib/Xm/XmStrDefs23.ht0000644000175000017500000000074012672140200013271 00000000000000/* $TOG: XmStrDefs23.ht /main/2 1997/06/18 17:50:15 samborn $ */ #ifndef _XmStrDefs23_h_ #define _XmStrDefs23_h_ #include #ifndef _XmConst #define _XmConst /**/ #endif #ifdef __cplusplus extern "C" { #endif <<>> #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs23_h_ */ motif-2.3.8/lib/Xm/Simple.c0000644000175000017500000003103313145162623012315 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Simple.c /main/11 1995/09/19 23:08:54 cde-sun $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "XmI.h" /******** Static Function Declarations ********/ static void EvaluateConvenienceStructure( Widget wid, XmSimpleMenu sm) ; /******** End Static Function Declarations ********/ static XtResource SimpleMenuResources[] = { { XmNbuttonCount, XmCButtonCount, XmRInt, sizeof(int), XtOffsetOf( struct _XmSimpleMenuRec, count), XmRImmediate, (XtPointer) 0 }, { XmNpostFromButton, XmCPostFromButton, XmRInt, sizeof(int), XtOffsetOf( struct _XmSimpleMenuRec, post_from_button), XmRImmediate, (XtPointer) -1 }, { XmNsimpleCallback, XmCCallback, XmRCallbackProc, sizeof(XtCallbackProc), XtOffsetOf( struct _XmSimpleMenuRec, callback), XmRImmediate, (XtPointer) NULL }, { XmNbuttons, XmCButtons, XmRXmStringTable, sizeof(XmStringTable), XtOffsetOf( struct _XmSimpleMenuRec, label_string), XmRImmediate, (XtPointer) NULL }, { XmNbuttonAccelerators, XmCButtonAccelerators, XmRStringTable, sizeof(String *), XtOffsetOf( struct _XmSimpleMenuRec, accelerator), XmRImmediate, (XtPointer) NULL }, { XmNbuttonAcceleratorText, XmCButtonAcceleratorText, XmRXmStringTable, sizeof(XmStringTable), XtOffsetOf( struct _XmSimpleMenuRec, accelerator_text), XmRImmediate, (XtPointer) NULL }, { XmNbuttonMnemonics, XmCButtonMnemonics, XmRKeySymTable, sizeof(XmKeySymTable), XtOffsetOf( struct _XmSimpleMenuRec, mnemonic), XmRImmediate, (XtPointer) NULL }, { XmNbuttonMnemonicCharSets, XmCButtonMnemonicCharSets, XmRCharSetTable, sizeof(XmStringCharSetTable), XtOffsetOf( struct _XmSimpleMenuRec, mnemonic_charset), XmRImmediate, (XtPointer) NULL }, { XmNbuttonType, XmCButtonType, XmRButtonType, sizeof(XmButtonTypeTable), XtOffsetOf( struct _XmSimpleMenuRec, button_type), XmRImmediate, (XtPointer) NULL }, { XmNbuttonSet, XmCButtonSet, XmRInt, sizeof(int), XtOffsetOf( struct _XmSimpleMenuRec, button_set), XmRImmediate, (XtPointer) -1 }, { XmNoptionLabel, XmCOptionLabel, XmRXmString, sizeof(XmString), XtOffsetOf( struct _XmSimpleMenuRec, option_label), XmRImmediate, (XtPointer) NULL }, { XmNoptionMnemonic, XmCOptionMnemonic, XmRKeySym, sizeof (KeySym), XtOffsetOf( struct _XmSimpleMenuRec, option_mnemonic), XmRImmediate, (XtPointer) NULL }, }; static void EvaluateConvenienceStructure( Widget wid, XmSimpleMenu sm ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; int i, n; char name_buf[20]; int button_count = 0; int separator_count = 0; int label_count = 0; Arg args[6]; Widget child; XmButtonType btype; for (i = 0; i < sm->count; i++) { n = 0; if (sm->label_string && sm->label_string[i]) { XtSetArg(args[n], XmNlabelString, sm->label_string[i]); n++; } if (sm->accelerator && sm->accelerator[i]) { XtSetArg(args[n], XmNaccelerator, sm->accelerator[i]); n++; } if (sm->accelerator_text && sm->accelerator_text[i]) { XtSetArg(args[n], XmNacceleratorText, sm->accelerator_text[i]); n++; } if (sm->mnemonic && sm->mnemonic[i]) { XtSetArg(args[n], XmNmnemonic, sm->mnemonic[i]); n++; } if (sm->mnemonic_charset && sm->mnemonic_charset[i]) { XtSetArg(args[n], XmNmnemonicCharSet, sm->mnemonic_charset[i]); n++; } /* Dynamic Defaulting of button type */ if (sm->button_type && sm->button_type[i]) btype = sm->button_type[i]; else btype = XmNONE; if (btype == XmNONE) { if (rc->row_column.type == XmMENU_BAR) btype = XmCASCADEBUTTON; else btype = XmPUSHBUTTON; } switch (btype) { case XmTITLE: sprintf(name_buf,"label_%d", label_count++); child = XtCreateManagedWidget( name_buf, xmLabelGadgetClass, (Widget) rc, args, n); break; case XmDOUBLE_SEPARATOR: XtSetArg(args[n], XmNseparatorType, XmDOUBLE_LINE); n++; case XmSEPARATOR: sprintf(name_buf,"separator_%d", separator_count++); child = XtCreateManagedWidget(name_buf, xmSeparatorGadgetClass, (Widget) rc, args, n); break; case XmPUSHBUTTON: sprintf(name_buf,"button_%d", button_count++); child = XtCreateManagedWidget(name_buf, xmPushButtonGadgetClass, (Widget) rc, args, n); if (sm->callback) XtAddCallback(child, XmNactivateCallback, sm->callback, (XtPointer)(unsigned long)(button_count - 1)); break; case XmRADIOBUTTON: XtSetArg(args[n], XmNindicatorType, XmONE_OF_MANY); n++; case XmCHECKBUTTON: sprintf(name_buf,"button_%d", button_count++); XtSetArg(args[n], XmNindicatorOn, TRUE); n++; child = XtCreateManagedWidget(name_buf, xmToggleButtonGadgetClass, (Widget) rc, args, n); if (sm->callback) XtAddCallback(child, XmNvalueChangedCallback, sm->callback, (XtPointer)(unsigned long)(button_count - 1)); break; case XmCASCADEBUTTON: sprintf(name_buf,"button_%d", button_count++); child = XtCreateManagedWidget(name_buf, xmCascadeButtonGadgetClass, (Widget) rc, args, n); if (sm->callback) XtAddCallback(child, XmNactivateCallback, sm->callback, (XtPointer)(unsigned long)(button_count - 1)); break; default: /* this is an error condition */ ; break; } } } Widget XmCreateSimpleMenuBar( Widget parent, String name, ArgList args, Cardinal arg_count ) { Widget rc; XmSimpleMenuRec mr; _XmWidgetToAppContext(parent); _XmAppLock(app); XtGetSubresources(parent, &mr, name, XmCSimpleMenuBar, SimpleMenuResources, XtNumber(SimpleMenuResources), args, arg_count); rc = XmCreateMenuBar(parent, name, args, arg_count); EvaluateConvenienceStructure( rc, &mr); _XmAppUnlock(app); return(rc); } Widget XmCreateSimplePopupMenu( Widget parent, String name, ArgList args, Cardinal arg_count ) { Widget rc; XmSimpleMenuRec mr; _XmWidgetToAppContext(parent); _XmAppLock(app); XtGetSubresources(parent, &mr, name, XmCSimplePopupMenu, SimpleMenuResources, XtNumber(SimpleMenuResources), args, arg_count); rc = XmCreatePopupMenu(parent, name, args, arg_count); EvaluateConvenienceStructure( rc, &mr); _XmAppUnlock(app); return(rc); } Widget XmCreateSimplePulldownMenu( Widget parent, String name, ArgList args, Cardinal arg_count ) { Widget rc; XmSimpleMenuRec mr; int n, i; Arg local_args[3]; WidgetList buttons; Cardinal num_buttons; _XmWidgetToAppContext(parent); _XmAppLock(app); XtGetSubresources(parent, &mr, name, XmCSimplePulldownMenu, SimpleMenuResources, XtNumber(SimpleMenuResources), args, arg_count); rc = XmCreatePulldownMenu(parent, name, args, arg_count); EvaluateConvenienceStructure(rc, &mr); if (mr.post_from_button >= 0) { n = 0; XtSetArg(local_args[n], XtNchildren, &buttons); n++; XtSetArg(local_args[n], XtNnumChildren, &num_buttons); n++; XtGetValues(parent, local_args, n); if (!num_buttons) { /* error condition */ _XmAppUnlock(app); return(rc); } else { for (i = 0; i < num_buttons; i++) { if (((XmIsCascadeButtonGadget(buttons[i])) || (XmIsCascadeButton(buttons[i]))) && (i == mr.post_from_button)) break; } if ( i < num_buttons) { n = 0; XtSetArg(local_args[n], XmNsubMenuId, rc); n++; XtSetValues(buttons[i], local_args, n); } } } _XmAppUnlock(app); return(rc); } Widget XmCreateSimpleOptionMenu( Widget parent, String name, ArgList args, Cardinal arg_count ) { Widget rc, sub_rc; XmSimpleMenuRec mr; int n, i, button_count; Arg local_args[5]; WidgetList buttons; Cardinal num_buttons; _XmWidgetToAppContext(parent); _XmAppLock(app); XtGetSubresources(parent, &mr, name, XmCSimpleOptionMenu, SimpleMenuResources, XtNumber(SimpleMenuResources), args, arg_count); rc = XmCreateOptionMenu(parent, name, args, arg_count); sub_rc = XmCreatePulldownMenu(parent, name, args, arg_count); EvaluateConvenienceStructure(sub_rc, &mr); n = 0; if (mr.option_label) { XtSetArg(local_args[n], XmNlabelString, mr.option_label); n++; } if (mr.option_mnemonic) { XtSetArg(local_args[n], XmNmnemonic, mr.option_mnemonic); n++; } XtSetArg(local_args[n], XmNsubMenuId, sub_rc); n++; XtSetValues(rc, local_args, n); if (mr.button_set >= 0) { n = 0; XtSetArg(local_args[n], XtNchildren, &buttons); n++; XtSetArg(local_args[n], XtNnumChildren, &num_buttons); n++; XtGetValues(sub_rc, local_args, n); if (!num_buttons) { /* error condition */ _XmAppUnlock(app); return(rc); } else { button_count = 0; for (i = 0; i < num_buttons; i++) { /* count only PushB */ if ((XmIsPushButtonGadget(buttons[i])) || (XmIsPushButton(buttons[i]))) { if (button_count == mr.button_set) break; button_count++; } } if ( i < num_buttons) { n = 0; XtSetArg(local_args[n], XmNmenuHistory, buttons[i]); n++; XtSetValues(rc, local_args, n); } } } _XmAppUnlock(app); return(rc); } Widget XmCreateSimpleRadioBox( Widget parent, String name, ArgList args, Cardinal arg_count ) { Arg local_args[5]; Widget rc, child; int i, n; XmSimpleMenuRec mr; char name_buf[20]; rc = XmCreateRadioBox(parent, name, args, arg_count); XtGetSubresources(parent, &mr, name, XmCSimpleRadioBox, SimpleMenuResources, XtNumber(SimpleMenuResources), args, arg_count); for(i=0; i < mr.count; i++) { sprintf(name_buf,"button_%d", i); n = 0; if (mr.label_string && mr.label_string[i]) { XtSetArg(local_args[n], XmNlabelString, mr.label_string[i]); n++; } if (mr.button_set == i) { XtSetArg(local_args[n], XmNset, TRUE); n++; } child = XtCreateManagedWidget(name_buf, xmToggleButtonGadgetClass, (Widget) rc, local_args, n); if (mr.callback) XtAddCallback(child, XmNvalueChangedCallback, mr.callback, (XtPointer)(unsigned long)i); } return(rc); } Widget XmCreateSimpleCheckBox( Widget parent, String name, ArgList args, Cardinal arg_count ) { Arg local_args[5]; Widget rc, child; int i, n; XmSimpleMenuRec mr; char name_buf[20]; rc = XmCreateRadioBox(parent, name, args, arg_count); n = 0; XtSetArg(local_args[n], XmNradioBehavior, FALSE); n++; XtSetValues(rc, local_args, n); XtGetSubresources(parent, &mr, name, XmCSimpleCheckBox, SimpleMenuResources, XtNumber(SimpleMenuResources), args, arg_count); for(i=0; i < mr.count; i++) { sprintf(name_buf,"button_%d", i); n = 0; if (mr.label_string && mr.label_string[i]) { XtSetArg(local_args[n], XmNlabelString, mr.label_string[i]); n++; } child = XtCreateManagedWidget(name_buf, xmToggleButtonGadgetClass, (Widget) rc, local_args, n); if (mr.callback) XtAddCallback(child, XmNvalueChangedCallback, mr.callback, (XtPointer)(unsigned long)i); } return(rc); } motif-2.3.8/lib/Xm/Screen.h0000644000175000017500000000346313145162623012316 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScreen_h #define _XmScreen_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsScreen #define XmIsScreen(w) (XtIsSubclass(w, xmScreenClass)) #endif /* XmIsScreen */ /* Class record constants */ typedef struct _XmScreenRec *XmScreen; typedef struct _XmScreenClassRec *XmScreenClass; externalref WidgetClass xmScreenClass; /******** Public Function Declarations ********/ typedef void (*XmScreenColorProc) (Screen * screen, XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color); typedef Status (*XmAllocColorProc) (Display *display, Colormap colormap, XColor *screen_in_out); extern Widget XmGetXmScreen( Screen *screen) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScreen_h */ motif-2.3.8/lib/Xm/MainW.c0000644000175000017500000013044713145162623012110 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MainW.c /main/20 1996/10/17 15:21:07 cde-osf $" #endif #endif #include "XmI.h" #include /* just access the position/dimension fields,*/ #include /* could live without that if needed */ #include #include #include #include #include "MessagesI.h" #include "RepTypeI.h" #include "GeoUtilsI.h" #define MWMessage1 _XmMMsgMainW_0000 #define MWMessage2 _XmMMsgMainW_0001 #define ExistManaged( wid) (wid && XtIsManaged( wid)) #define DEFAULT_SIZE 50 /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void DeleteChild( Widget w) ; static void InsertChild( Widget w) ; static void Layout( XmMainWindowWidget mw) ; static void Resize( Widget wid) ; static void GetSize( XmMainWindowWidget mw, Dimension *pwidth, Dimension *pheight) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget wid) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetVertRects( Widget sw, XRectangle ** vrect, Cardinal * num_vrect); static void CheckKids( XmMainWindowWidget mw); /******** End Static Function Declarations ********/ /************************************************************************ * * * Main Window Resources * * * ************************************************************************/ static XtResource resources[] = { { XmNcommandWindow, XmCCommandWindow, XmRWidget, sizeof(Widget), XtOffsetOf(XmMainWindowRec, mwindow.CommandWindow), XmRImmediate, NULL }, { XmNcommandWindowLocation, XmCCommandWindowLocation, XmRCommandWindowLocation, sizeof(unsigned char), XtOffsetOf(XmMainWindowRec, mwindow.CommandLoc), XmRImmediate, (XtPointer) XmCOMMAND_ABOVE_WORKSPACE }, { XmNmenuBar, XmCMenuBar, XmRWidget, sizeof(Widget), XtOffsetOf(XmMainWindowRec, mwindow.MenuBar), XmRImmediate, NULL }, { XmNmessageWindow, XmCMessageWindow, XmRWidget, sizeof(Widget), XtOffsetOf(XmMainWindowRec, mwindow.Message), XmRImmediate, NULL }, { XmNmainWindowMarginWidth, XmCMainWindowMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmMainWindowRec, mwindow.margin_width), XmRImmediate, (XtPointer) 0 }, { XmNmainWindowMarginHeight, XmCMainWindowMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf(XmMainWindowRec, mwindow.margin_height), XmRImmediate, (XtPointer) 0 }, { XmNshowSeparator, XmCShowSeparator, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmMainWindowRec, mwindow.ShowSep), XmRImmediate, (XtPointer) False } }; /**************** * * Resolution independent resources * ****************/ static XmSyntheticResource syn_resources[] = { { XmNmainWindowMarginWidth, sizeof (Dimension), XtOffsetOf(XmMainWindowRec, mwindow.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmainWindowMarginHeight, sizeof (Dimension), XtOffsetOf(XmMainWindowRec, mwindow.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, }; /*******************************************/ /* Declaration of class extension records */ /*******************************************/ static XmScrolledWindowClassExtRec scrolled_windowClassExtRec = { NULL, NULLQUARK, XmScrolledWindowClassExtVersion, sizeof(XmScrolledWindowClassExtRec), NULL, /* inherit get_hor_rects */ GetVertRects, /* overide get_vert_rects */ }; /**************************************************************** * * Full class record constant * ****************************************************************/ externaldef(xmmainwindowclassrec) XmMainWindowClassRec xmMainWindowClassRec = { { /* core_class fields */ /* superclass */ (WidgetClass) &xmScrolledWindowClassRec, /* class_name */ "XmMainWindow", /* widget_size */ sizeof(XmMainWindowRec), /* class_initialize */ NULL, /* class_partinit */ ClassPartInitialize, /* class_inited */ False, /* initialize */ Initialize, /* Init hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ True, /* compress_exposure */ XtExposeCompressSeries, /* compress_enterleave*/ True, /* visible_interest */ False, /* destroy */ NULL, /* resize */ Resize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set values hook */ NULL, /* set values almost */ XtInheritSetValuesAlmost, /* get values hook */ NULL, /* accept_focus */ NULL, /* Version */ XtVersion, /* PRIVATE cb list */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ NULL, /* display_accelerator*/ NULL, /* extension */ NULL, }, { /* composite_class fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ InsertChild, /* delete_child */ DeleteChild, /* Extension */ NULL, },{ /* Constraint class Init */ NULL, 0, sizeof (XmScrolledWindowConstraintRec), NULL, NULL, NULL, NULL }, /* Manager Class */ { XtInheritTranslations, /* translations */ syn_resources, /* get resources */ XtNumber(syn_resources), /* num get_resources */ NULL, /* get_cont_resources */ 0, /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* Scrolled Window class */ (XtPointer) &scrolled_windowClassExtRec, /* auto drag extension */ }, { /* Main Window class - just the extension pointer */ /* extension */ (XtPointer) NULL } }; externaldef(xmmainwindowwidgetclass) WidgetClass xmMainWindowWidgetClass = (WidgetClass)&xmMainWindowClassRec; /************************************************************************ * * * ClassPartInitialize - Set up the fast subclassing. * * * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmMAIN_WINDOW_BIT); } /************************************************************************ * * * Initialize * * * ************************************************************************/ /* ARGSUSED */ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmMainWindowWidget new_w = (XmMainWindowWidget) nw ; int n; Arg loc_args[20]; /* First, undo our superclass defaulting to a real size in AUTOMATIC mode, because MainWindow can build a real size out of its children in AUTOMATIC */ if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) { if ((rw->core.width == 0) && new_w->core.width) new_w->core.width = 0 ; if ((rw->core.height == 0) && new_w->core.height) new_w->core.height = 0 ; } if (!XmRepTypeValidValue(XmRID_COMMAND_WINDOW_LOCATION, new_w->mwindow.CommandLoc, nw)) new_w->mwindow.CommandLoc = XmCOMMAND_ABOVE_WORKSPACE; n = 0; XtSetArg (loc_args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg (loc_args[n], XmNscrolledWindowChildType, XmSEPARATOR); n++; new_w->mwindow.ManagingSep = True ; new_w->mwindow.Sep1 = (XmSeparatorGadget) XtCreateManagedWidget("Separator1", xmSeparatorGadgetClass, nw, loc_args, n); new_w->mwindow.Sep2 = (XmSeparatorGadget) XtCreateManagedWidget("Separator2", xmSeparatorGadgetClass, nw, loc_args, n); new_w->mwindow.Sep3 = (XmSeparatorGadget) XtCreateManagedWidget("Separator3", xmSeparatorGadgetClass, nw, loc_args, n); new_w->mwindow.ManagingSep = False ; /* override the SW setting here */ new_w->swindow.XOffset = new_w->mwindow.margin_width; new_w->swindow.YOffset = new_w->mwindow.margin_height; new_w->swindow.WidthPad = new_w->mwindow.margin_width; new_w->swindow.HeightPad = new_w->mwindow.margin_height; } /************************************************************************ * * * DeleteChild * * * ************************************************************************/ /* ARGSUSED */ static void DeleteChild( Widget child) { XmMainWindowWidget mw = (XmMainWindowWidget) XtParent(child); CompositeWidgetClass superclass = (CompositeWidgetClass) xmMainWindowClassRec.core_class.superclass ; XtWidgetProc delete_child; /* update our own internals first */ if (child == mw->mwindow.CommandWindow) mw->mwindow.CommandWindow = NULL; if (child == mw->mwindow.MenuBar) mw->mwindow.MenuBar = NULL; if (child == mw->mwindow.Message) mw->mwindow.Message = NULL; _XmProcessLock(); delete_child = superclass->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child); } static void CheckKids( XmMainWindowWidget mw ) { /* do a sanity check */ if( mw->swindow.WorkWindow != NULL && mw->swindow.WorkWindow->core.being_destroyed ) { mw->swindow.WorkWindow = NULL; } if( mw->swindow.hScrollBar != NULL && mw->swindow.hScrollBar->core.being_destroyed ) { mw->swindow.hScrollBar = NULL; } if( mw->swindow.vScrollBar != NULL && mw->swindow.vScrollBar->core.being_destroyed ) { mw->swindow.vScrollBar = NULL; } if( mw->mwindow.CommandWindow != NULL && mw->mwindow.CommandWindow->core.being_destroyed ) { mw->mwindow.CommandWindow = NULL; } if( mw->mwindow.MenuBar != NULL && mw->mwindow.MenuBar->core.being_destroyed ) { mw->mwindow.MenuBar = NULL; } if( mw->mwindow.Message != NULL && mw->mwindow.Message->core.being_destroyed ) { mw->mwindow.Message = NULL; } } /************************************************************************ * * * InsertChild * * * ************************************************************************/ static void InsertChild( Widget w ) { CompositeWidgetClass superclass = (CompositeWidgetClass) xmMainWindowClassRec.core_class.superclass ; XmMainWindowWidget mw = (XmMainWindowWidget ) w->core.parent; XmScrolledWindowConstraint nc = GetSWConstraint(w); XtWidgetProc insert_child; if (!XtIsRectObj(w)) return; /* Try to guess the nature of the child_type . If we're lucky, fine, otherwise, something bad might happens: the scrolledwindow can take it as a workwindow and possibly reparents it to the clipwindow. In the absence of a set childType constraint resource set, there is not much we can do to avoid the problem */ /* Note: auto created Separator were already labelled in Initialize */ if (nc->child_type == (unsigned char) RESOURCE_DEFAULT) { XmMenuSystemTrait menuSTrait; if ((menuSTrait = (XmMenuSystemTrait) XmeTraitGet ((XtPointer) XtClass(w), XmQTmenuSystem)) != NULL) { if (menuSTrait->type(w) == XmMENU_BAR && !mw->mwindow.MenuBar) { /* If it's a menubar, and we don't have one yet, use it. */ nc->child_type = XmMENU_BAR ; } } else if (XmIsCommandBox(w)) { if (!mw->mwindow.CommandWindow) { /* If it's a command, and we don't have one, get it */ nc->child_type = XmCOMMAND_WINDOW ; } } else /* new in 2.0 */ if (XmIsMessageBox(w)) { if (!mw->mwindow.Message) { nc->child_type = XmMESSAGE_WINDOW ; } } } if (nc->child_type == XmMENU_BAR) { mw->mwindow.MenuBar = w; } else if (nc->child_type == XmCOMMAND_WINDOW) { mw->mwindow.CommandWindow = w; } else if (nc->child_type == XmMESSAGE_WINDOW) { mw->mwindow.Message = w; } /* call ScrolledWindow InsertChild directly, since it does nothing to the MainWindow known childType */ _XmProcessLock(); insert_child = superclass->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(w); } /************************************************************************ * * * Layout - Layout the main window. * * * * * ************************************************************************/ static void Layout( XmMainWindowWidget mw ) { Position mbx,mby, cwx,cwy, swy, mwx, mwy, sepy, sep2y = 0; Dimension mbwidth, mbheight, cwwidth= 0, cwheight; Dimension MyXpad, MyYpad, mwwidth, mwheight; Dimension bw = 0, sep2h, sep3h; XtWidgetGeometry desired, preferred; int tmp ; /* used for checking negative Dimension value */ CheckKids(mw); /**************** * * Query the kids - and we have definite preferences as to their sizes. * The Menubar gets top billing - we tell it it how wide it is going to be , * and let it have whatever height it wants. The command box gets to stay * it's current height, but has to go to the new width. The scrolled window * gets the leftovers. * ****************/ MyXpad = mw->mwindow.margin_width; MyYpad = mw->mwindow.margin_height; mw->swindow.XOffset = MyXpad; mw->swindow.YOffset = MyYpad; mw->swindow.HeightPad = mw->mwindow.margin_height; mw->swindow.WidthPad = mw->mwindow.margin_width; cwx = MyXpad; cwy = swy = MyYpad; mw->mwindow.ManagingSep = True; if (ExistManaged(mw->mwindow.MenuBar)) { bw = mw->mwindow.MenuBar->core.border_width; mbx = MyXpad; mby = MyYpad; tmp = mw->core.width - (2 * (MyXpad + bw)); if (tmp <= 0) mbwidth = 10; else mbwidth = tmp ; mbheight = mw->mwindow.MenuBar->core.height; desired.x = mbx; desired.y = mby; desired.border_width = bw; desired.width = mbwidth; desired.height = mbheight; desired.request_mode = (CWWidth); if (XtQueryGeometry(mw->mwindow.MenuBar, &desired, &preferred) != XtGeometryYes) { bw = preferred.border_width; mbheight = preferred.height; } XmeConfigureObject(mw->mwindow.MenuBar, mbx, mby, mbwidth, mbheight,bw); if (mw->mwindow.ShowSep) { XtManageChild((Widget) mw->mwindow.Sep1); XmeConfigureObject( (Widget) mw->mwindow.Sep1, 0, mby + mbheight + (2 * bw), mw->core.width, mw->mwindow.Sep1->rectangle.height, 0); cwy = swy = mw->mwindow.Sep1->rectangle.y + mw->mwindow.Sep1->rectangle.height ; } else { XtUnmanageChild((Widget) mw->mwindow.Sep1); cwy = swy = mby + mbheight + (2 * bw); } } else { XtUnmanageChild((Widget) mw->mwindow.Sep1); } if (ExistManaged(mw->mwindow.CommandWindow)) { bw = mw->mwindow.CommandWindow->core.border_width; tmp = mw->core.width - (2 * (MyXpad + bw)); if (tmp <= 0) cwwidth = 10; else cwwidth = tmp ; cwheight = mw->mwindow.CommandWindow->core.height; desired.x = cwx; desired.y = cwy; desired.border_width = bw; desired.width = cwwidth; desired.height = cwheight; desired.request_mode = (CWWidth); if (XtQueryGeometry(mw->mwindow.CommandWindow, &desired, &preferred) != XtGeometryYes) { bw = preferred.border_width; cwheight = preferred.height; } if ((cwheight + cwy + (2 * bw)) > (mw->core.height - MyYpad)) { tmp = mw->core.height - (2 * bw) - MyYpad - cwy; if (tmp <= 0) cwheight = 10 ; else cwheight = tmp; } if (mw->mwindow.ShowSep) sep2h = mw->mwindow.Sep2->rectangle.height; else sep2h = 0; sep2y = (cwy + cwheight) + 2 * bw; swy = sep2y + sep2h ; if (mw->mwindow.CommandLoc == XmCOMMAND_BELOW_WORKSPACE) { mby = swy; sep2y = cwy + (mw->core.height - swy - MyYpad); swy = cwy; mw->swindow.HeightPad = sep2h + cwheight + mw->mwindow.margin_height; if (mw->mwindow.ShowSep) cwy = sep2y + mw->mwindow.Sep2->rectangle.height; else cwy = sep2y; } } else { XtUnmanageChild((Widget) mw->mwindow.Sep2); sep2h = 0; cwheight = 0; } if (ExistManaged(mw->mwindow.Message)) { bw = mw->mwindow.Message->core.border_width; mwx = MyXpad; tmp = mw->core.width - (2 * (MyXpad + bw)); if (tmp <= 0) mwwidth = 10 ; else mwwidth = tmp ; mwheight = mw->mwindow.Message->core.height; desired.x = mwx; desired.y = swy; desired.border_width = bw; desired.width = mwwidth; desired.height = mwheight; desired.request_mode = (CWWidth); if (XtQueryGeometry(mw->mwindow.Message, &desired, &preferred) != XtGeometryYes) { bw = preferred.border_width; mwheight = preferred.height; } if (mw->mwindow.ShowSep) sep3h = mw->mwindow.Sep3->rectangle.height; else sep3h = 0; sepy = mw->core.height - mwheight - (2 * bw) - mw->mwindow.margin_height - sep3h; mwy = sepy + sep3h; if (mw->mwindow.CommandLoc == XmCOMMAND_BELOW_WORKSPACE) { mw->swindow.HeightPad = sep2h + cwheight + sep3h + mwheight + mw->mwindow.margin_height; sep2y -= (sep3h + mwheight); cwy -= (sep3h + mwheight); } else mw->swindow.HeightPad = sep3h + mwheight + mw->mwindow.margin_height; XmeConfigureObject(mw->mwindow.Message, mwx, mwy, mwwidth, mwheight, bw); if (mw->mwindow.ShowSep) { XtManageChild((Widget) mw->mwindow.Sep3); XmeConfigureObject( (Widget) mw->mwindow.Sep3, 0, sepy, mw->core.width, mw->mwindow.Sep3->rectangle.height, 0); } else XtUnmanageChild((Widget) mw->mwindow.Sep3); } else { XtUnmanageChild((Widget) mw->mwindow.Sep3); } if (ExistManaged(mw->mwindow.CommandWindow)) { XmeConfigureObject( mw->mwindow.CommandWindow, cwx, cwy, cwwidth, cwheight, bw); if (mw->mwindow.ShowSep) { XtManageChild((Widget) mw->mwindow.Sep2); XmeConfigureObject((Widget) mw->mwindow.Sep2, 0, sep2y, mw->core.width, mw->mwindow.Sep2->rectangle.height, 0); } else XtUnmanageChild((Widget) mw->mwindow.Sep2); } mw->swindow.YOffset = swy; mw->mwindow.ManagingSep = False; } /************************************************************************ * * * Relayout the main window. * * * ************************************************************************/ static void Resize( Widget wid ) { CompositeWidgetClass superclass = (CompositeWidgetClass) xmMainWindowClassRec.core_class.superclass ; XtWidgetProc resize; Layout((XmMainWindowWidget) wid); /* call our superclass layout now that MainWindow has updated some internal positional fields: offset, pads */ _XmProcessLock(); resize = superclass->core_class.resize; _XmProcessUnlock(); (*resize)(wid); } /************************************************************************ * * * GetSize - compute the size of the Main window to enclose all the * * visible widgets. * * * ************************************************************************/ static void GetSize( XmMainWindowWidget mw, Dimension *pwidth, Dimension *pheight) { Dimension newWidth,newHeight; XmScrollBarWidget hsb = mw->swindow.hScrollBar, vsb = mw->swindow.vScrollBar; Widget w; Dimension hsheight = 0, vmwidth = 0, ht = mw->manager.shadow_thickness * 2, hsbht = 0, vsbht = 0; Dimension width, MyXpad, MyYpad; XtWidgetGeometry preferred; MyXpad = mw->mwindow.margin_width * 2; MyYpad = mw->mwindow.margin_height * 2; /* what id to use for the sw frame */ if (mw->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) w = mw->swindow.WorkWindow; else w = (Widget)mw->swindow.ClipWindow; /* note: first time through, all relevant values are 0, but we need to ** take account of the preferred size anyway */ if (ExistManaged((Widget) vsb) && ((0 == mw->core.width) || ((Dimension)vsb->core.x < mw->core.width))) /* needed */ { vsbht = 2 * vsb->primitive.highlight_thickness; vmwidth = vsb->core.width + mw->swindow.pad + (2 * vsb->primitive.highlight_thickness); } if (ExistManaged((Widget) hsb) && ((0 == mw->core.height) || ((Dimension)hsb->core.y < mw->core.height))) /* needed */ { hsbht = 2 * hsb->primitive.highlight_thickness; hsheight = hsb->core.height + mw->swindow.pad + (2 * hsb->primitive.highlight_thickness); } /**************** * * Use the work window as the basis for our height. If the mode is * constant, and we are not realized, use the areawidth and areaheight * variables instead of the clipwindow width and height, since they are a * match for the workspace until the swindow is realized. * ****************/ if (ExistManaged(w)) { if ((mw->swindow.ScrollPolicy == XmAUTOMATIC) && !XtIsRealized((Widget)mw)) { newWidth = mw->swindow.AreaWidth + (w->core.border_width * 2) + hsbht + vmwidth + ht + MyXpad; newHeight = mw->swindow.AreaHeight + (w->core.border_width * 2) + vsbht + hsheight + ht + MyYpad; } else { XtQueryGeometry(w, NULL, &preferred); newWidth = preferred.width + (w->core.border_width * 2) + hsbht + vmwidth + ht + MyXpad; newHeight = preferred.height + (w->core.border_width * 2) + vsbht + hsheight + ht + MyYpad; } } else { newWidth = MyXpad; newHeight = MyYpad; } /* Take the max width, add the height of the other kids */ if (ExistManaged(mw->mwindow.CommandWindow)) { XtQueryGeometry(mw->mwindow.CommandWindow, NULL, &preferred); width = preferred.width + MyXpad + (2 * mw->mwindow.CommandWindow->core.border_width); if (newWidth < width) newWidth = width; newHeight += preferred.height + (2 * mw->mwindow.CommandWindow->core.border_width); if (mw->mwindow.Sep2 && mw->mwindow.ShowSep) newHeight += mw->mwindow.Sep2->rectangle.height; } if (ExistManaged(mw->mwindow.MenuBar)) { XtQueryGeometry(mw->mwindow.MenuBar, NULL, &preferred); width = preferred.width + MyXpad + (2 * mw->mwindow.MenuBar->core.border_width); if (newWidth < width) newWidth = width; newHeight += preferred.height + (2 * mw->mwindow.MenuBar->core.border_width); if (mw->mwindow.Sep1 && mw->mwindow.ShowSep) newHeight += mw->mwindow.Sep1->rectangle.height; } if (ExistManaged(mw->mwindow.Message)) { XtQueryGeometry(mw->mwindow.Message, NULL, &preferred); width = preferred.width + MyXpad + (2 * mw->mwindow.Message->core.border_width); if (newWidth < width) newWidth = width; newHeight += preferred.height + (2 * mw->mwindow.Message->core.border_width); if (mw->mwindow.Sep3 && mw->mwindow.ShowSep) newHeight += mw->mwindow.Sep3->rectangle.height; } if (!*pwidth) *pwidth = newWidth ; if (!*pheight) *pheight = newHeight ; /* might still be null */ if (!*pwidth) *pwidth = DEFAULT_SIZE ; if (!*pheight) *pheight = DEFAULT_SIZE ; } /************************************************************************ * * * GeometryManager * * * ************************************************************************/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { CompositeWidgetClass superclass = (CompositeWidgetClass) xmMainWindowClassRec.core_class.superclass ; XmMainWindowWidget mw = (XmMainWindowWidget ) w->core.parent; XtGeometryResult res; Dimension newWidth,newHeight, OldHeight; Dimension bw; XtWidgetGeometry parent_request ; XtWidgetGeometry desired, preferred; XtWidgetProc resize; CheckKids(mw); /**************** * * If it's not a mainwindow kid, let the scrolled window deal with it. * If it's from the workwindow, and the width changed, resize the menubar * and ask for a new height so my layout routine doesn't clip the workwindow. * ****************/ if (w != mw->mwindow.MenuBar && w != mw->mwindow.Message && w != mw->mwindow.CommandWindow && w != (Widget )mw->mwindow.Sep1 && w != (Widget) mw->mwindow.Sep2 && w != (Widget) mw->mwindow.Sep3) { /* this is the only case of geometry manager enveloping that I know of in Motif */ XtGeometryHandler geo_mgr; _XmProcessLock(); geo_mgr = superclass->composite_class.geometry_manager; _XmProcessUnlock(); res = (*geo_mgr)(w, request, reply); if (res == XtGeometryYes) { Widget mb = mw->mwindow.MenuBar; if ((w == mw->swindow.WorkWindow) && (request->request_mode & CWWidth) && mb && XtIsManaged(mb)) { desired.x = mb->core.x; desired.y = mb->core.y; desired.border_width = mb->core.border_width; desired.width = mw->core.width - (2 * mw->mwindow.margin_width); desired.height = mb->core.height; desired.request_mode = (CWWidth); XtQueryGeometry(mw->mwindow.MenuBar, &desired, &preferred); if (preferred.height != mb->core.height) { parent_request.request_mode = CWWidth | CWHeight; if (request->request_mode & XtCWQueryOnly) parent_request.request_mode |= XtCWQueryOnly; parent_request.width = mw->core.width ; parent_request.height = newHeight = mw->core.height - (mb->core.height - (2 * mb->core.border_width)) + preferred.height + (2 *preferred.border_width); if (XtMakeGeometryRequest((Widget) mw, &parent_request, NULL) == XtGeometryYes) { if (!(request->request_mode & XtCWQueryOnly)) XmeConfigureObject(mw->mwindow.MenuBar, mb->core.x, mb->core.y, preferred.width, preferred.height, preferred.border_width); else return XtGeometryYes ; } } } _XmProcessLock(); resize = XtCoreProc(mw, resize); _XmProcessUnlock(); (*resize)((Widget)mw) ; } return(res); } /** Disallow any X or Y changes for MainW children **/ if ((request -> request_mode & CWX || request -> request_mode & CWY)) return(XtGeometryNo); if(request->request_mode & CWBorderWidth) bw = request->border_width; else bw = w->core.border_width; if (request->request_mode & CWWidth) newWidth = request->width + 2 * (bw + mw->mwindow.margin_width); else newWidth = mw->core.width ; /* grow only in width */ if (newWidth <= mw->core.width) newWidth = mw->core.width; /**************** * * Margins are already included in the old width & height * ****************/ if(request->request_mode & CWHeight) newHeight = mw->core.height - (w->core.height - (2 * w->core.border_width)) + request->height + 2 * bw; else newHeight = mw->core.height; OldHeight = mw->core.height; parent_request.request_mode = CWWidth | CWHeight; if (request->request_mode & XtCWQueryOnly) parent_request.request_mode |= XtCWQueryOnly; parent_request.width = newWidth ; parent_request.height = newHeight; res = XtMakeGeometryRequest((Widget) mw, &parent_request, NULL) ; if (res == XtGeometryYes) { if (!(request->request_mode & XtCWQueryOnly)) { if(request->request_mode & CWWidth) w->core.width = request->width; if(request->request_mode & CWHeight) w->core.height = request->height; mw->swindow.YOffset = mw->swindow.YOffset + (newHeight - OldHeight); _XmProcessLock(); resize = XtCoreProc(mw, resize); _XmProcessUnlock(); (*resize) ((Widget)mw) ; } } return(res); } /************************************************************************ * * * ChangeManaged - called whenever there is a change in the managed * * set. * * * ************************************************************************/ static void ChangeManaged( Widget wid ) { XmMainWindowWidget mw = (XmMainWindowWidget) wid ; XtWidgetGeometry desired ; CompositeWidget cw = (CompositeWidget) mw->swindow.ClipWindow; Widget w; register int i; XtWidgetProc resize; if (mw->mwindow.ManagingSep || mw->swindow.FromResize) return; CheckKids(mw); /**************** * * This is an ugly bit of work... It's possible for the clip window to get * "extra" kids that really want to be mainwindow widgets. * ****************/ if ((mw->swindow.ScrollPolicy == XmAUTOMATIC) && (cw->composite.num_children > 1) && (mw->swindow.WorkWindow != NULL)) { /* loop over the clip window child list and treat the bogus */ for (i = 0; i < cw->composite.num_children; i++) { XmScrolledWindowConstraint swc ; int j ; w = cw->composite.children[i]; swc = GetSWConstraint(w); /* only those kind are allowed as clipwindow kids */ if ((swc->child_type != XmWORK_AREA) && (swc->child_type != XmSCROLL_HOR) && (swc->child_type != XmSCROLL_VERT) && (swc->child_type != XmNO_SCROLL)) { /* add it to the main window child list. first increase the list if needed- Gee, I wish I remember what made me keep this hacky code around... */ if (mw->composite.num_children == mw->composite.num_slots) { mw->composite.num_slots += (mw->composite.num_slots / 2) + 2; mw->composite.children = (WidgetList) XtRealloc( (char *) mw->composite.children, (unsigned) (mw->composite.num_slots) * sizeof(Widget)); } mw->composite.children[mw->composite.num_children++] = w; w->core.parent = (Widget) mw; /* remove it from the clipwindow child list by moving all the siblings that comes after it one slot down */ for (j = i+1; j < cw->composite.num_children; j++) { cw->composite.children[i-1] = cw->composite.children[i] ; } cw->composite.num_children -- ; } } } if (!XtIsRealized(wid)) { desired.width = XtWidth(wid) ; /* might be 0 */ desired.height = XtHeight(wid) ; /* might be 0 */ } else { desired.width = 0 ; desired.height = 0 ; } GetSize(mw, &desired.width, &desired.height); desired.request_mode = (CWWidth | CWHeight); (void) _XmMakeGeometryRequest(wid, &desired); _XmProcessLock(); resize = XtCoreProc(mw, resize); _XmProcessUnlock(); (*resize) (wid) ; XmeNavigChangeManaged(wid); } /************************************************************************ * * * SetValues * * * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmMainWindowWidget current = (XmMainWindowWidget) cw ; XmMainWindowWidget new_w = (XmMainWindowWidget) nw ; Boolean flag = False; CheckKids(new_w); /* somehow, this used not to create problem in 1.2, some apps did setvalue of XmNmenubar to itself ? check that and change back */ if ((new_w->mwindow.MenuBar != current->mwindow.MenuBar) && (new_w->mwindow.MenuBar == nw)) { new_w->mwindow.MenuBar = current->mwindow.MenuBar; } /* fix for 8990: these warnings must be here for bc... */ if ((new_w->mwindow.MenuBar != current->mwindow.MenuBar) && (new_w->mwindow.MenuBar == NULL)) { XmeWarning( (Widget) new_w, MWMessage1); new_w->mwindow.MenuBar = current->mwindow.MenuBar; } if ((new_w->mwindow.CommandWindow != current->mwindow.CommandWindow) && (new_w->mwindow.CommandWindow == NULL)) { XmeWarning( (Widget) new_w, MWMessage2); new_w->mwindow.CommandWindow = current->mwindow.CommandWindow; } /* first deal with the layout attributes, and set up a flag */ /* There is a potential bug here: if the change in margin concur with a change on some other stuff, like separator or a new child, and the getSize call return the same size, no resize call will be generated by Xt. A way to fix that is to check this no change in size and to fake a request.. maybe not worth. */ if ((new_w->mwindow.margin_width != current->mwindow.margin_width) || (new_w->mwindow.margin_height != current->mwindow.margin_height) || (new_w->mwindow.ShowSep != current->mwindow.ShowSep)) { flag = True; } if ((new_w->mwindow.CommandLoc != current->mwindow.CommandLoc) && (XmRepTypeValidValue(XmRID_COMMAND_WINDOW_LOCATION, new_w->mwindow.CommandLoc, (Widget) new_w))) { XtWidgetProc resize; _XmProcessLock(); resize = XtCoreProc(nw, resize); _XmProcessUnlock(); (*resize) (nw) ; } else new_w->mwindow.CommandLoc = current->mwindow.CommandLoc; /* At InsertChild time, a lot of bad things might have happened. The command window, messagewindow and work window, which we have no real way to identify at that time, might have been mixed up. (MenuBar and application ScrollBars shouldn't be a problem) The first unidentifiable kid will take the workwindow slot (and possibly be reparented), and the followers will be just inserted in the child list without reparenting (to the clipwindow in AUTO mode I mean). After creation time, the application will use XtSetValues to set up things correctly (except changing the workwindow in AUTO, which is not allowed). The requirement, if a childType resource isn't provided, is that the workwindow be created first, at least in AUTO mode where the reparenting happens */ if ((new_w->mwindow.MenuBar != current->mwindow.MenuBar) || (new_w->mwindow.Message != current->mwindow.Message) || (new_w->mwindow.CommandWindow != current->mwindow.CommandWindow ) || (new_w->swindow.hScrollBar != current->swindow.hScrollBar) || (new_w->swindow.vScrollBar != current->swindow.vScrollBar) || (new_w->swindow.WorkWindow != current->swindow.WorkWindow ) || (flag)) { /* set our core geometry to the needed size - no resizePolicy here... Change in child type can happen before realize time, before change managed has been called, and we don't want to set up a size for the main window at this point, since its children size haven't been set up yet */ if (XtIsRealized((Widget)new_w)) { Dimension width = 0, height = 0 ; GetSize (new_w, &width, &height); new_w->core.width = width ; new_w->core.height = height ; } } return (False); } /************************************************************************ * * * GetAutoDragVertRects class methods * * * ************************************************************************/ static void GetVertRects( Widget sw, XRectangle ** vrect, Cardinal * num_vrect) { Widget w ; XmMainWindowWidget mw = (XmMainWindowWidget) sw ; *num_vrect = 2 ; *vrect = (XRectangle *) XtMalloc(sizeof(XRectangle) * (*num_vrect)) ; /* The vertical rectangles are the ones that vertically auto scroll, they are defined by areas on the top and bottom of the workarea, e.g. the margins, the spacing, the scrollbars and the shadows */ /* Both rects are computed using only the relative work_area or clipwindow (in AUTO) location within the scrolled window: this is the area between the widget and its parent frame. Then they need to be translated into the scrollbar coord system. */ /* what id to use for the sw child frame */ if (mw->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) { w = mw->swindow.WorkWindow; if (!w) w = sw ; /* fallback */ } else w = (Widget) mw->swindow.ClipWindow; /* the vertical rectangle are more complex to compute than for the SW case because we cannot go blindy to the SW boundary, we have to stop at the next sibling window boundary */ /* We have to consider all case of existing/managed menubar, command, or message area, with the command up or down too. */ if (!ExistManaged(mw->mwindow.MenuBar) && !ExistManaged(mw->mwindow.CommandWindow)) { (*vrect)[0].y = 0 ; (*vrect)[0].height = w->core.y ; } else if (ExistManaged(mw->mwindow.MenuBar) && !ExistManaged(mw->mwindow.CommandWindow)) { (*vrect)[0].y = mw->mwindow.MenuBar->core.y + mw->mwindow.MenuBar->core.height ; (*vrect)[0].height = w->core.y - mw->mwindow.MenuBar->core.y - mw->mwindow.MenuBar->core.height ; } else if (ExistManaged(mw->mwindow.MenuBar) && ExistManaged(mw->mwindow.CommandWindow) && (mw->mwindow.CommandLoc == XmCOMMAND_ABOVE_WORKSPACE)) { (*vrect)[0].y = mw->mwindow.CommandWindow->core.y + mw->mwindow.CommandWindow->core.height ; (*vrect)[0].height = w->core.y - mw->mwindow.CommandWindow->core.y - mw->mwindow.CommandWindow->core.height ; } /* The first rectangle is the one that makes the scrollbar goes up */ (*vrect)[0].x = w->core.x - mw->swindow.vScrollBar->core.x ; /* just translate to the scrollbar coordinate */ (*vrect)[0].y =- mw->swindow.vScrollBar->core.y ; (*vrect)[0].width = w->core.width ; /* The second rectangle is the one that makes the scrollbar goes down */ (*vrect)[1].x = (*vrect)[0].x ; (*vrect)[1].y = w->core.y + w->core.height - mw->swindow.vScrollBar->core.y ; (*vrect)[1].width = (*vrect)[0].width ; if (!ExistManaged(mw->mwindow.CommandWindow) && !ExistManaged(mw->mwindow.Message)) { (*vrect)[1].height = mw->core.height - (*vrect)[1].y ; } else if (ExistManaged(mw->mwindow.CommandWindow) && (mw->mwindow.CommandLoc == XmCOMMAND_BELOW_WORKSPACE)) { (*vrect)[1].height = mw->mwindow.CommandWindow->core.y - w->core.y - w->core.height; } else if (ExistManaged(mw->mwindow.Message)) { (*vrect)[1].height = mw->mwindow.Message->core.y - w->core.y - w->core.height; } } /************************************************************************ * * * Public API Functions * * * ************************************************************************/ /************************************************************************ * * * XmMainWindowSetAreas - set a new children set. * * -to be deprecated in favor of XtSetValues * * -doesn't even handle message window * * * ************************************************************************/ void XmMainWindowSetAreas( Widget w, Widget menu, Widget command, Widget hscroll, Widget vscroll, Widget wregion ) { Arg args[5] ; Cardinal n; n = 0; if (menu) { XtSetArg (args[n], XmNmenuBar, menu); n++; } if (command) { XtSetArg (args[n], XmNcommandWindow, command); n++; } if (hscroll) { XtSetArg (args[n], XmNhorizontalScrollBar, hscroll); n++; } if (vscroll) { XtSetArg (args[n], XmNverticalScrollBar, vscroll); n++; } if (wregion) { XtSetArg (args[n], XmNworkWindow, wregion); n++; } XtSetValues(w, args, n); } /************************************************************************ * * * XmMainWindowSep1, 2 and 3 * * - return the id of the top seperator widget. * * - to be deprecated in favor of using XtNameToWidget * * * * * ************************************************************************/ Widget XmMainWindowSep1( Widget w ) { XmMainWindowWidget mw = (XmMainWindowWidget) w; Widget separator; _XmWidgetToAppContext(w); _XmAppLock(app); separator = (Widget) mw->mwindow.Sep1; _XmAppUnlock(app); return separator; } Widget XmMainWindowSep2( Widget w ) { XmMainWindowWidget mw = (XmMainWindowWidget) w; Widget separator; _XmWidgetToAppContext(w); _XmAppLock(app); separator = (Widget) mw->mwindow.Sep2; _XmAppUnlock(app); return separator; } Widget XmMainWindowSep3( Widget w ) { XmMainWindowWidget mw = (XmMainWindowWidget) w; Widget separator; _XmWidgetToAppContext(w); _XmAppLock(app); separator = (Widget) mw->mwindow.Sep3; _XmAppUnlock(app); return separator; } /************************************************************************ * * * XmCreateMainWindow - * * * ************************************************************************/ Widget XmCreateMainWindow( Widget parent, char *name, ArgList args, Cardinal argCount ) { return (XtCreateWidget(name, xmMainWindowWidgetClass, parent, args, argCount ) ); } Widget XmVaCreateMainWindow( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmMainWindowWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedMainWindow( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmMainWindowWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/Transfer.h0000644000175000017500000000653112672140200012651 00000000000000/* $TOG: Transfer.h /main/8 1998/02/03 14:55:22 csn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmTransfer_H #define _XmTransfer_H #include #ifdef __cplusplus extern "C" { #endif /* Proc typedefs */ #define XmConvertCallbackProc XtCallbackProc #define XmSelectionDoneProc XtSelectionDoneProc #define XmCancelSelectionProc XtCancelConvertSelectionProc #define XmDestinationCallbackProc XtCallbackProc #define XmSelectionCallbackProc XtSelectionCallbackProc /* Flags */ typedef enum { XmTRANSFER_DONE_SUCCEED = 0, XmTRANSFER_DONE_FAIL, XmTRANSFER_DONE_CONTINUE, XmTRANSFER_DONE_DEFAULT } XmTransferStatus; enum { XmSELECTION_DEFAULT = 0, XmSELECTION_INCREMENTAL, XmSELECTION_PERSIST, XmSELECTION_SNAPSHOT, XmSELECTION_TRANSACT }; enum { XmCONVERTING_NONE = 0, XmCONVERTING_SAME = 1, XmCONVERTING_TRANSACT = 2, XmCONVERTING_PARTIAL = 4 }; enum { XmCONVERT_DEFAULT = 0, XmCONVERT_MORE, XmCONVERT_MERGE, XmCONVERT_REFUSE, XmCONVERT_DONE }; /* Callback structures */ typedef struct { int reason; XEvent *event; Atom selection; Atom target; XtPointer source_data; XtPointer location_data; int flags; XtPointer parm; int parm_format; unsigned long parm_length; Atom parm_type; int status; XtPointer value; Atom type; int format; unsigned long length; } XmConvertCallbackStruct; typedef struct { int reason; XEvent *event; Atom selection; XtEnum operation; int flags; XtPointer transfer_id; XtPointer destination_data; XtPointer location_data; Time time; } XmDestinationCallbackStruct; typedef struct { int reason; XEvent *event; Atom selection; Atom target; Atom type; XtPointer transfer_id; int flags; int remaining; XtPointer value; unsigned long length; int format; } XmSelectionCallbackStruct; typedef struct { int reason; XEvent *event; Atom selection; XtPointer transfer_id; XmTransferStatus status; XtPointer client_data; } XmTransferDoneCallbackStruct; typedef void (*XmSelectionFinishedProc)(Widget, XtEnum, XmTransferDoneCallbackStruct*); void XmTransferDone(XtPointer, XmTransferStatus); void XmTransferValue(XtPointer, Atom, XtCallbackProc, XtPointer, Time); void XmTransferSetParameters(XtPointer, XtPointer, int, unsigned long, Atom); void XmTransferStartRequest(XtPointer); void XmTransferSendRequest(XtPointer, Time); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTransfer_H */ motif-2.3.8/lib/Xm/XpmP.h0000644000175000017500000004541713145162623011770 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XpmP_h #define _XpmP_h /* Xpm external symbols are prefixed with Xme */ #define XpmCreatePixmapFromData XmeXpmCreatePixmapFromData #define XpmCreateDataFromPixmap XmeXpmCreateDataFromPixmap #define XpmReadFileToPixmap XmeXpmReadFileToPixmap #define XpmWriteFileFromPixmap XmeXpmWriteFileFromPixmap #define XpmCreateImageFromData XmeXpmCreateImageFromData #define XpmCreateDataFromImage XmeXpmCreateDataFromImage #define XpmReadFileToImage XmeXpmReadFileToImage #define XpmWriteFileFromImage XmeXpmWriteFileFromImage #define XpmCreateImageFromBuffer XmeXpmCreateImageFromBuffer #define XpmCreatePixmapFromBuffer XmeXpmCreatePixmapFromBuffer #define XpmCreateBufferFromImage XmeXpmCreateBufferFromImage #define XpmCreateBufferFromPixmap XmeXpmCreateBufferFromPixmap #define XpmReadFileToBuffer XmeXpmReadFileToBuffer #define XpmWriteFileFromBuffer XmeXpmWriteFileFromBuffer #define XpmReadFileToData XmeXpmReadFileToData #define XpmWriteFileFromData XmeXpmWriteFileFromData #define XpmAttributesSize XmeXpmAttributesSize #define XpmFreeAttributes XmeXpmFreeAttributes #define XpmFreeExtensions XmeXpmFreeExtensions #define XpmFreeXpmImage XmeXpmFreeXpmImage #define XpmFreeXpmInfo XmeXpmFreeXpmInfo #define XpmGetErrorString XmeXpmGetErrorString #define XpmLibraryVersion XmeXpmLibraryVersion #define XpmReadFileToXpmImage XmeXpmReadFileToXpmImage #define XpmWriteFileFromXpmImage XmeXpmWriteFileFromXpmImage #define XpmCreatePixmapFromXpmImage XmeXpmCreatePixmapFromXpmImage #define XpmCreateImageFromXpmImage XmeXpmCreateImageFromXpmImage #define XpmCreateXpmImageFromImage XmeXpmCreateXpmImageFromImage #define XpmCreateXpmImageFromPixmap XmeXpmCreateXpmImageFromPixmap #define XpmCreateDataFromXpmImage XmeXpmCreateDataFromXpmImage #define XpmCreateXpmImageFromData XmeXpmCreateXpmImageFromData #define XpmCreateXpmImageFromBuffer XmeXpmCreateXpmImageFromBuffer #define XpmCreateBufferFromXpmImage XmeXpmCreateBufferFromXpmImage #define XpmFree XmeXpmFree /* The following is the original xpm.h header file */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * xpm.h: * * * * XPM library * * Include file * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* * The code related to FOR_MSW has been added by * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ #ifndef XPM_h #define XPM_h /* * first some identification numbers: * the version and revision numbers are determined with the following rule: * SO Major number = LIB minor version number. * SO Minor number = LIB sub-minor version number. * e.g: Xpm version 3.2f * we forget the 3 which is the format number, 2 gives 2, and f gives 6. * thus we have XpmVersion = 2 and XpmRevision = 6 * which gives SOXPMLIBREV = 2.6 * * Then the XpmIncludeVersion number is built from these numbers. */ #define XpmFormat 3 #define XpmVersion 4 #define XpmRevision 9 #define XpmIncludeVersion ((XpmFormat * 100 + XpmVersion) * 100 + XpmRevision) #ifndef XPM_NUMBERS #ifdef FOR_MSW # define SYSV /* uses memcpy string.h etc. */ # include # include "simx.h" /* defines some X stuff using MSW types */ #define NEED_STRCASECMP /* at least for MSVC++ */ #else /* FOR_MSW */ # include # include #endif /* FOR_MSW */ /* let's define Pixel if it is not done yet */ #if ! defined(_XtIntrinsic_h) && ! defined(PIXEL_ALREADY_TYPEDEFED) typedef unsigned long Pixel; /* Index into colormap */ # define PIXEL_ALREADY_TYPEDEFED #endif /* make sure we know whether function prototypes are needed or not */ #ifndef NeedFunctionPrototypes # if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) # define NeedFunctionPrototypes 1 # else # define NeedFunctionPrototypes 0 # endif #endif /* Return ErrorStatus codes: * null if full success * positive if partial success * negative if failure */ #define XpmColorError 1 #define XpmSuccess 0 #define XpmOpenFailed -1 #define XpmFileInvalid -2 #define XpmNoMemory -3 #define XpmColorFailed -4 typedef struct { char *name; /* Symbolic color name */ char *value; /* Color value */ Pixel pixel; /* Color pixel */ } XpmColorSymbol; typedef struct { char *name; /* name of the extension */ unsigned int nlines; /* number of lines in this extension */ char **lines; /* pointer to the extension array of strings */ } XpmExtension; typedef struct { char *string; /* characters string */ char *symbolic; /* symbolic name */ char *m_color; /* monochrom default */ char *g4_color; /* 4 level grayscale default */ char *g_color; /* other level grayscale default */ char *c_color; /* color default */ } XpmColor; typedef struct { unsigned int width; /* image width */ unsigned int height; /* image height */ unsigned int cpp; /* number of characters per pixel */ unsigned int ncolors; /* number of colors */ XpmColor *colorTable; /* list of related colors */ unsigned int *data; /* image data */ } XpmImage; typedef struct { unsigned long valuemask; /* Specifies which attributes are defined */ char *hints_cmt; /* Comment of the hints section */ char *colors_cmt; /* Comment of the colors section */ char *pixels_cmt; /* Comment of the pixels section */ unsigned int x_hotspot; /* Returns the x hotspot's coordinate */ unsigned int y_hotspot; /* Returns the y hotspot's coordinate */ unsigned int nextensions; /* number of extensions */ XpmExtension *extensions; /* pointer to array of extensions */ } XpmInfo; typedef int (*XpmAllocColorFunc)( #if NeedFunctionPrototypes Display* /* display */, Colormap /* colormap */, char* /* colorname */, XColor* /* xcolor */, void* /* closure */ #endif ); typedef int (*XpmFreeColorsFunc)( #if NeedFunctionPrototypes Display* /* display */, Colormap /* colormap */, Pixel* /* pixels */, int /* npixels */, void* /* closure */ #endif ); typedef struct { unsigned long valuemask; /* Specifies which attributes are defined */ Visual *visual; /* Specifies the visual to use */ Colormap colormap; /* Specifies the colormap to use */ unsigned int depth; /* Specifies the depth */ unsigned int width; /* Returns the width of the created pixmap */ unsigned int height; /* Returns the height of the created pixmap */ unsigned int x_hotspot; /* Returns the x hotspot's coordinate */ unsigned int y_hotspot; /* Returns the y hotspot's coordinate */ unsigned int cpp; /* Specifies the number of char per pixel */ Pixel *pixels; /* List of used color pixels */ unsigned int npixels; /* Number of used pixels */ XpmColorSymbol *colorsymbols; /* List of color symbols to override */ unsigned int numsymbols; /* Number of symbols */ char *rgb_fname; /* RGB text file name */ unsigned int nextensions; /* Number of extensions */ XpmExtension *extensions; /* List of extensions */ unsigned int ncolors; /* Number of colors */ XpmColor *colorTable; /* List of colors */ /* 3.2 backward compatibility code */ char *hints_cmt; /* Comment of the hints section */ char *colors_cmt; /* Comment of the colors section */ char *pixels_cmt; /* Comment of the pixels section */ /* end 3.2 bc */ unsigned int mask_pixel; /* Color table index of transparent color */ /* Color Allocation Directives */ Bool exactColors; /* Only use exact colors for visual */ unsigned int closeness; /* Allowable RGB deviation */ unsigned int red_closeness; /* Allowable red deviation */ unsigned int green_closeness; /* Allowable green deviation */ unsigned int blue_closeness; /* Allowable blue deviation */ int color_key; /* Use colors from this color set */ Pixel *alloc_pixels; /* Returns the list of alloc'ed color pixels */ Bool nalloc_pixels; /* Returns the number of alloc'ed color pixels */ Bool alloc_close_colors; /* Specify whether close colors should be allocated using XAllocColor or not */ int bitmap_format; /* Specify the format of 1bit depth images: ZPixmap or XYBitmap */ /* Color functions */ XpmAllocColorFunc alloc_color; /* Application color allocator */ XpmFreeColorsFunc free_colors; /* Application color de-allocator */ void *color_closure; /* Application private data to pass to alloc_color and free_colors */ } XpmAttributes; /* XpmAttributes value masks bits */ #define XpmVisual (1L<<0) #define XpmColormap (1L<<1) #define XpmDepth (1L<<2) #define XpmSize (1L<<3) /* width & height */ #define XpmHotspot (1L<<4) /* x_hotspot & y_hotspot */ #define XpmCharsPerPixel (1L<<5) #define XpmColorSymbols (1L<<6) #define XpmRgbFilename (1L<<7) /* 3.2 backward compatibility code */ #define XpmInfos (1L<<8) #define XpmReturnInfos XpmInfos /* end 3.2 bc */ #define XpmReturnPixels (1L<<9) #define XpmExtensions (1L<<10) #define XpmReturnExtensions XpmExtensions #define XpmExactColors (1L<<11) #define XpmCloseness (1L<<12) #define XpmRGBCloseness (1L<<13) #define XpmColorKey (1L<<14) #define XpmColorTable (1L<<15) #define XpmReturnColorTable XpmColorTable #define XpmReturnAllocPixels (1L<<16) #define XpmAllocCloseColors (1L<<17) #define XpmBitmapFormat (1L<<18) #define XpmAllocColor (1L<<19) #define XpmFreeColors (1L<<20) #define XpmColorClosure (1L<<21) /* XpmInfo value masks bits */ #define XpmComments XpmInfos #define XpmReturnComments XpmComments /* XpmAttributes mask_pixel value when there is no mask */ #ifndef FOR_MSW #define XpmUndefPixel 0x80000000 #else /* int is only 16 bit for MSW */ #define XpmUndefPixel 0x8000 #endif /* * color keys for visual type, they must fit along with the number key of * each related element in xpmColorKeys[] defined in XpmI.h */ #define XPM_MONO 2 #define XPM_GREY4 3 #define XPM_GRAY4 3 #define XPM_GREY 4 #define XPM_GRAY 4 #define XPM_COLOR 5 /* macros for forward declarations of functions with prototypes */ #if NeedFunctionPrototypes #define FUNC(f, t, p) extern t f p #define LFUNC(f, t, p) static t f p #else #define FUNC(f, t, p) extern t f() #define LFUNC(f, t, p) static t f() #endif /* * functions declarations */ #ifdef __cplusplus extern "C" { #endif /* FOR_MSW, all ..Pixmap.. are excluded, only the ..XImage.. are used */ #ifndef FOR_MSW FUNC(XpmCreatePixmapFromData, int, (Display *display, Drawable d, char **data, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)); FUNC(XpmCreateDataFromPixmap, int, (Display *display, char ***data_return, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes)); FUNC(XpmReadFileToPixmap, int, (Display *display, Drawable d, char *filename, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)); FUNC(XpmWriteFileFromPixmap, int, (Display *display, char *filename, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes)); #endif /* ndef FOR_MSW */ FUNC(XpmCreateImageFromData, int, (Display *display, char **data, XImage **image_return, XImage **shapemask_return, XpmAttributes *attributes)); FUNC(XpmCreateDataFromImage, int, (Display *display, char ***data_return, XImage *image, XImage *shapeimage, XpmAttributes *attributes)); FUNC(XpmReadFileToImage, int, (Display *display, char *filename, XImage **image_return, XImage **shapeimage_return, XpmAttributes *attributes)); FUNC(XpmWriteFileFromImage, int, (Display *display, char *filename, XImage *image, XImage *shapeimage, XpmAttributes *attributes)); FUNC(XpmCreateImageFromBuffer, int, (Display *display, char *buffer, XImage **image_return, XImage **shapemask_return, XpmAttributes *attributes)); #ifndef FOR_MSW FUNC(XpmCreatePixmapFromBuffer, int, (Display *display, Drawable d, char *buffer, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)); FUNC(XpmCreateBufferFromImage, int, (Display *display, char **buffer_return, XImage *image, XImage *shapeimage, XpmAttributes *attributes)); FUNC(XpmCreateBufferFromPixmap, int, (Display *display, char **buffer_return, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes)); #endif /* ndef FOR_MSW */ FUNC(XpmReadFileToBuffer, int, (char *filename, char **buffer_return)); FUNC(XpmWriteFileFromBuffer, int, (char *filename, char *buffer)); FUNC(XpmReadFileToData, int, (char *filename, char ***data_return)); FUNC(XpmWriteFileFromData, int, (char *filename, char **data)); FUNC(XpmAttributesSize, int, ()); FUNC(XpmFreeAttributes, void, (XpmAttributes *attributes)); FUNC(XpmFreeExtensions, void, (XpmExtension *extensions, int nextensions)); FUNC(XpmFreeXpmImage, void, (XpmImage *image)); FUNC(XpmFreeXpmInfo, void, (XpmInfo *info)); FUNC(XpmGetErrorString, char *, (int errcode)); FUNC(XpmLibraryVersion, int, ()); /* XpmImage functions */ FUNC(XpmReadFileToXpmImage, int, (char *filename, XpmImage *image, XpmInfo *info)); FUNC(XpmWriteFileFromXpmImage, int, (char *filename, XpmImage *image, XpmInfo *info)); #ifndef FOR_MSW FUNC(XpmCreatePixmapFromXpmImage, int, (Display *display, Drawable d, XpmImage *image, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)); #endif FUNC(XpmCreateImageFromXpmImage, int, (Display *display, XpmImage *image, XImage **image_return, XImage **shapeimage_return, XpmAttributes *attributes)); FUNC(XpmCreateXpmImageFromImage, int, (Display *display, XImage *image, XImage *shapeimage, XpmImage *xpmimage, XpmAttributes *attributes)); #ifndef FOR_MSW FUNC(XpmCreateXpmImageFromPixmap, int, (Display *display, Pixmap pixmap, Pixmap shapemask, XpmImage *xpmimage, XpmAttributes *attributes)); #endif FUNC(XpmCreateDataFromXpmImage, int, (char ***data_return, XpmImage *image, XpmInfo *info)); FUNC(XpmCreateXpmImageFromData, int, (char **data, XpmImage *image, XpmInfo *info)); FUNC(XpmCreateXpmImageFromBuffer, int, (char *buffer, XpmImage *image, XpmInfo *info)); FUNC(XpmCreateBufferFromXpmImage, int, (char **buffer_return, XpmImage *image, XpmInfo *info)); FUNC(XpmFree, void, (void *ptr)); #ifdef __cplusplus } /* for C++ V2.0 */ #endif /* backward compatibility */ /* for version 3.0c */ #define XpmPixmapColorError XpmColorError #define XpmPixmapSuccess XpmSuccess #define XpmPixmapOpenFailed XpmOpenFailed #define XpmPixmapFileInvalid XpmFileInvalid #define XpmPixmapNoMemory XpmNoMemory #define XpmPixmapColorFailed XpmColorFailed #define XpmReadPixmapFile(dpy, d, file, pix, mask, att) \ XpmReadFileToPixmap(dpy, d, file, pix, mask, att) #define XpmWritePixmapFile(dpy, file, pix, mask, att) \ XpmWriteFileFromPixmap(dpy, file, pix, mask, att) /* for version 3.0b */ #define PixmapColorError XpmColorError #define PixmapSuccess XpmSuccess #define PixmapOpenFailed XpmOpenFailed #define PixmapFileInvalid XpmFileInvalid #define PixmapNoMemory XpmNoMemory #define PixmapColorFailed XpmColorFailed #define ColorSymbol XpmColorSymbol #define XReadPixmapFile(dpy, d, file, pix, mask, att) \ XpmReadFileToPixmap(dpy, d, file, pix, mask, att) #define XWritePixmapFile(dpy, file, pix, mask, att) \ XpmWriteFileFromPixmap(dpy, file, pix, mask, att) #define XCreatePixmapFromData(dpy, d, data, pix, mask, att) \ XpmCreatePixmapFromData(dpy, d, data, pix, mask, att) #define XCreateDataFromPixmap(dpy, data, pix, mask, att) \ XpmCreateDataFromPixmap(dpy, data, pix, mask, att) #endif /* XPM_NUMBERS */ #endif #endif /* _XpmP_h */ motif-2.3.8/lib/Xm/PointInT.h0000644000175000017500000000273612672140200012574 00000000000000/* $XConsortium: PointInT.h /main/5 1995/07/15 20:54:18 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmPointInT_H #define _XmPointInT_H #ifdef __cplusplus extern "C" { #endif #include externalref XrmQuark XmQTpointIn; /* Trait structures and typedefs, place typedefs first */ typedef Boolean (*XmPointInProc)(Widget w, Position x, Position y); typedef struct _XmPointInTraitRec { int version ; XmPointInProc pointIn; } XmPointInTraitRec, *XmPointInTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPointInT_H */ motif-2.3.8/lib/Xm/SeparatorP.h0000644000175000017500000000417213145162623013155 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmSeparatorP_h #define _XmSeparatorP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Separator class structure */ typedef struct _XmSeparatorClassPart { XtPointer extension; /* Pointer to extension record */ } XmSeparatorClassPart; /* Full class record declaration for Separator class */ typedef struct _XmSeparatorClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmSeparatorClassPart separator_class; } XmSeparatorClassRec; externalref XmSeparatorClassRec xmSeparatorClassRec; /* The Separator instance record */ typedef struct _XmSeparatorPart { Dimension margin; unsigned char orientation; unsigned char separator_type; GC separator_GC; } XmSeparatorPart; /* Full instance record declaration */ typedef struct _XmSeparatorRec { CorePart core; XmPrimitivePart primitive; XmSeparatorPart separator; } XmSeparatorRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSeparatorP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/LabelG.c0000644000175000017500000040125713145162623012223 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: LabelG.c /main/24 1999/01/26 15:31:18 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #define FIX_1517 #define FIX_1654 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CacheI.h" #include "ColorI.h" #include "ExtObjectI.h" #include "GadgetUtiI.h" #include "LabelGI.h" #include "MessagesI.h" #include "MenuProcI.h" #include "PixConvI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "SyntheticI.h" #include "TravActI.h" #include "XmI.h" #include "XmosI.h" #include "XmStringI.h" #include #include #include #ifdef FIX_1381 #include #endif #ifdef FIX_1521 #ifdef USE_XFT #include "XmRenderTI.h" #include #endif #endif #define Pix(w) LabG_Pixmap(w) #define Pix_insen(w) LabG_PixmapInsensitive(w) /* Warning Messages */ #define CS_STRING_MESSAGE _XmMMsgLabel_0003 #define ACC_MESSAGE _XmMMsgLabel_0004 /******** Static Function Declarations ********/ static Pixmap GetTopShadowPixmapDefault(Widget); static Pixmap GetLabelHighlightPixmapDefault(Widget); static void ClassInitialize(void); static void ClassPartInitialize(WidgetClass cl); static void SecondaryObjectCreate(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializePosthook(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesPrehook(Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args); static void GetValuesPrehook(Widget newParent, ArgList args, Cardinal *num_args); static void GetValuesPosthook(Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesPosthook(Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void BorderHighlight(Widget w); static void SetNormalGC(XmLabelGadget lw); static void Resize(Widget wid); static void Initialize(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static XtGeometryResult QueryGeometry(Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *reply); static void Destroy(Widget w); static void Redisplay(Widget wid, XEvent *event, Region region); static Boolean SetValues(Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void InputDispatch(Widget wid, XEvent *event, Mask event_mask); static void Help(Widget w, XEvent *event); static void GetLabelString(Widget wid, int offset, XtArgVal *value); static void GetAccelerator(Widget wid, int offset, XtArgVal *value); static void GetAcceleratorText(Widget wid, int offset, XtArgVal *value); static XmStringCharSet _XmStringCharsetCreate(XmStringCharSet stringcharset); static void GetMnemonicCharset(Widget wid, int resource, XtArgVal *value); static void QualifyLabelLocalCache(XmLabelGadget w); static void SetOverrideCallback(Widget w); static Cardinal GetLabelBGClassSecResData(WidgetClass w_class, XmSecondaryResourceData **data_rtn); static XtPointer GetLabelClassResBase(Widget widget, XtPointer client_data); static void SetValuesAlmost(Widget cw, Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply); static Boolean XmLabelGadgetGetBaselines(Widget wid, Dimension **baselines, int *line_count); static Boolean XmLabelGadgetGetDisplayRect(Widget w, XRectangle *displayrect); static void XmLabelGadgetMarginsProc(Widget w, XmBaselineMargins *margins_rec); static Widget GetPixmapDragIcon(Widget w); static void SetGadgetActivateCallbackState(Widget w, XmActivateState state); static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value); static void FromPaddingPixels(Widget, int, XtArgVal *); static XmImportOperator ToPaddingPixels(Widget, int, XtArgVal*); static Boolean HandleRedraw(Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static void InitNewColorBehavior(XmLabelGadget lw); static void DealWithColors(XmLabelGadget lw); static void DealWithPixmaps(XmLabelGadget lw); static void InitNewPixmapBehavior(XmLabelGadget lw); static char* GetLabelGadgetAccelerator(Widget); static KeySym GetLabelGadgetMnemonic(Widget); static void GetColors(Widget widget, XmAccessColorData color_data); /******** End Static Function Declarations ********/ void _XmLabelConvert(Widget w, XtPointer ignore, XmConvertCallbackStruct*); /* Transfer trait record */ static XmConst XmTransferTraitRec LabelGTransfer = { 0, /* version */ (XmConvertCallbackProc) _XmLabelConvert, /* convertProc */ NULL, /* destinationProc */ NULL /* destinationPreHookProc */ }; /* Menu Savvy trait record */ static XmConst XmMenuSavvyTraitRec MenuSavvyGadgetRecord = { 0, /* version */ SetGadgetActivateCallbackState, /* disableCallback */ GetLabelGadgetAccelerator, /* getAccelerator */ GetLabelGadgetMnemonic, /* getMnemonic */ NULL /* getActivateCBName */ }; /* Used to be: extern XmConst XmAccessTextualTraitRec _XmLabel_AccessTextualRecord; but that was giving a linkage undefined with g++. It looks like a G++ bug. */ extern XmAccessTextualTraitRec _XmLabel_AccessTextualRecord; static XmConst XmCareVisualTraitRec LabelGCVT = { 0, /* version */ HandleRedraw /* redraw */ }; /* Access Colors Trait record for label gadget */ static XmConst XmAccessColorsTraitRec labACT = { 0, /* version */ GetColors, /* getColors */ NULL /* setColors */ }; /* * Uncached resources for Label Gadget */ static XtResource resources[] = { /* The following hackery is a way in Xt to see if a widget has been * initialized. We need to know whether or not the gadget cache is * valid. We use "." in the name so that an end user cannot access * it from a resource file. With that in place, we just need to * check label.cache != NULL to see if the gadget has been * initialized and that we can access the colors for instance. */ { XmNdotCache, XmCDotCache, XmRPointer, sizeof(XtPointer), XtOffsetOf(XmLabelGadgetRec, label.cache), XtRImmediate, (XtPointer) NULL }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGadgetRec, gadget.shadow_thickness), XmRImmediate, (XtPointer) 0 }, { XmNlabelPixmap, XmCLabelPixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelGadgetRec, label.pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNlabelInsensitivePixmap, XmCLabelInsensitivePixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelGadgetRec, label.pixmap_insen), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNlabelString, XmCXmString, XmRXmString, sizeof(XmString), XtOffsetOf(XmLabelGadgetRec, label._label), XmRImmediate, (XtPointer) NULL }, { "pri.vate","Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmLabelGadgetRec, label.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmLabelGadgetRec, label.font), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmLabelGadgetRec, label.font), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNmnemonic, XmCMnemonic, XmRKeySym, sizeof(KeySym), XtOffsetOf(XmLabelGadgetRec, label.mnemonic), XmRImmediate, (XtPointer) XK_VoidSymbol }, { XmNmnemonicCharSet, XmCMnemonicCharSet, XmRString, sizeof(XmStringCharSet), XtOffsetOf(XmLabelGadgetRec,label.mnemonicCharset), XmRImmediate, (XtPointer) XmFONTLIST_DEFAULT_TAG }, { XmNaccelerator, XmCAccelerator, XmRString, sizeof(char *), XtOffsetOf(XmLabelGadgetRec, label.accelerator), XmRImmediate, (XtPointer) NULL }, { XmNacceleratorText, XmCAcceleratorText, XmRXmString, sizeof(XmString), XtOffsetOf(XmLabelGadgetRec, label._acc_text), XmRImmediate, (XtPointer) NULL }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmGadgetRec, gadget.traversal_on), XmRImmediate, (XtPointer) False }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmGadgetRec, gadget.highlight_thickness), XmRImmediate, (XtPointer) 0 }, { XmNpixmapPlacement, XmCPixmapPlacement, XmRPixmapPlacement, sizeof(XmPixmapPlacement), XtOffsetOf(XmLabelGadgetRec, label.pixmap_placement), XmRImmediate, (XtPointer) XmPIXMAP_LEFT }, { XmNpixmapTextPadding, XmCSpace, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGadgetRec, label.pixmap_text_padding), XmRImmediate, (XtPointer) 2 } }; /* These 2 slots are needed for the delayed conversion. */ static XtResource label_pixmap_resource[] = { { XmNlabelPixmap, XmCLabelPixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelGadgetRec, label.pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP } }; static XtResource label_pixmap_insen_resource[] = { { XmNlabelInsensitivePixmap, XmCLabelInsensitivePixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelGadgetRec, label.pixmap_insen), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP } }; /* * Cached resources for Label Gadget */ static XtResource cache_resources[] = { { XmNlabelType, XmCLabelType, XmRLabelType, sizeof(unsigned char), XtOffsetOf(XmLabelGCacheObjRec, label_cache.label_type), XmRImmediate, (XtPointer) XmSTRING }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf(XmLabelGCacheObjRec, label_cache.alignment), XmRImmediate, (XtPointer) XmALIGNMENT_CENTER }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_width), XmRImmediate, (XtPointer) 2 }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_height), XmRImmediate, (XtPointer) 2 }, { XmNmarginLeft, XmCMarginLeft, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_left), XmRImmediate, (XtPointer) 0 }, { XmNmarginRight, XmCMarginRight, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_right), XmRImmediate, (XtPointer) 0 }, { XmNmarginTop, XmCMarginTop, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_top), XmRImmediate, (XtPointer) 0 }, { XmNmarginBottom, XmCMarginBottom, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_bottom), XmRImmediate, (XtPointer) 0 }, { XmNrecomputeSize, XmCRecomputeSize, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmLabelGCacheObjRec, label_cache.recompute_size), XmRImmediate, (XtPointer) True }, { XmNstringDirection, XmCStringDirection, XmRStringDirection, sizeof(unsigned char), XtOffsetOf(XmLabelGCacheObjRec, label_cache.string_direction), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), XtOffsetOf(XmGadgetRec, gadget.layout_direction), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, { XmNbackground, XmCBackground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmLabelGCacheObjRec, label_cache.background), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNforeground, XmCForeground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmLabelGCacheObjRec, label_cache.foreground), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNtopShadowColor, XmCTopShadowColor, XmRPixel, sizeof(Pixel), XtOffsetOf(XmLabelGCacheObjRec, label_cache.top_shadow_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelGCacheObjRec, label_cache.top_shadow_pixmap), XmRImmediate, (XtPointer) INVALID_PIXMAP }, { XmNbottomShadowColor, XmCBottomShadowColor, XmRPixel, sizeof(Pixel), XtOffsetOf(XmLabelGCacheObjRec, label_cache.bottom_shadow_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelGCacheObjRec, label_cache.bottom_shadow_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNhighlightColor, XmCHighlightColor, XmRPixel, sizeof(Pixel), XtOffsetOf(XmLabelGCacheObjRec, label_cache.highlight_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNhighlightPixmap, XmCHighlightPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmLabelGCacheObjRec, label_cache.highlight_pixmap), XmRImmediate, (XtPointer) INVALID_PIXMAP } }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNlabelString, sizeof(XmString), XtOffsetOf(XmLabelGadgetRec, label._label), GetLabelString, NULL }, { XmNaccelerator, sizeof(String), XtOffsetOf(XmLabelGadgetRec, label.accelerator), GetAccelerator, NULL }, { XmNacceleratorText, sizeof(XmString), XtOffsetOf(XmLabelGadgetRec, label._acc_text), GetAcceleratorText, NULL }, { XmNmnemonicCharSet, sizeof(XmStringCharSet), XtOffsetOf(XmLabelGadgetRec,label.mnemonicCharset), GetMnemonicCharset, NULL }, { XmNpixmapTextPadding, sizeof(Dimension), XtOffsetOf(XmLabelGadgetRec, label.pixmap_text_padding), FromPaddingPixels, (XmImportProc) ToPaddingPixels } }; static XmSyntheticResource cache_syn_resources[] = { { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNmarginLeft, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_left), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginRight, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_right), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginTop, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_top), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNmarginBottom, sizeof(Dimension), XtOffsetOf(XmLabelGCacheObjRec, label_cache.margin_bottom), XmeFromVerticalPixels, XmeToVerticalPixels } }; static XmCacheClassPart LabelClassCachePart = { { /* head of class cache list */ NULL, 0, 0 }, _XmCacheCopy, /* Copy routine */ _XmCacheDelete, /* Delete routine */ _XmLabelCacheCompare /* Comparison routine */ }; static XmBaseClassExtRec labelBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ XmInheritInitializePrehook, /* initialize prehook */ SetValuesPrehook, /* set_values prehook */ InitializePosthook, /* initialize posthook */ SetValuesPosthook, /* set_values posthook */ (WidgetClass)&xmLabelGCacheObjClassRec, /* secondary class */ SecondaryObjectCreate, /* creation proc */ GetLabelBGClassSecResData, /* getSecResData */ { /* fast subclass */ 0 }, GetValuesPrehook, /* get_values prehook */ GetValuesPosthook, /* get_values posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook */ NULL, /* ext_resources */ NULL, /* compiled_ext_resources */ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange /* focusChange */ }; externaldef (xmlabelgcacheobjclassrec) XmLabelGCacheObjClassRec xmLabelGCacheObjClassRec = { { (WidgetClass) &xmExtClassRec, /* superclass */ "XmLabelGadget", /* class_name */ sizeof(XmLabelGCacheObjRec), /* widget_size */ NULL, /* class_initialize */ NULL, /* chained class init */ False, /* class_inited */ NULL, /* initialize */ NULL, /* initialize hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ cache_resources, /* resources */ XtNumber(cache_resources), /* num_resources */ NULLQUARK, /* xrm_class */ False, /* compress_motion */ False, /* compress_exposure */ False, /* compress enter/exit */ False, /* visible_interest */ NULL, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set values hook */ NULL, /* set values almost */ NULL, /* get values hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback offsetlst */ NULL, /* default trans */ NULL, /* query geo proc */ NULL, /* display accelerator */ NULL /* extension record */ }, { cache_syn_resources, /* synthetic resources */ XtNumber(cache_syn_resources), /* num_syn_resources */ NULL /* extension */ } }; /* This is the class record that gets set at compile/link time */ /* this is what is passed to the widget create routine as the */ /* the class. All fields must be inited at compile time. */ static XmGadgetClassExtRec _XmLabelGadClassExtRec = { NULL, /* next_extension */ NULLQUARK, /* record_type */ XmGadgetClassExtVersion, /* version */ sizeof(XmGadgetClassExtRec), /* record_size */ XmLabelGadgetGetBaselines, /* widget_baseline */ XmLabelGadgetGetDisplayRect, /* widget_display_rect */ XmLabelGadgetMarginsProc, /* widget_margins */ }; externaldef (xmlabelgadgetclassrec) XmLabelGadgetClassRec xmLabelGadgetClassRec = { { (WidgetClass) &xmGadgetClassRec, /* superclass */ "XmLabelGadget", /* class_name */ sizeof(XmLabelGadgetRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* chained class init */ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ True, /* compress enter/exit */ False, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set values hook */ SetValuesAlmost, /* set values almost */ NULL, /* get values hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback offsetlst */ NULL, /* default trans */ QueryGeometry, /* query geo proc */ NULL, /* display accelerator */ (XtPointer)&labelBaseClassExtRec /* extension record */ }, { /* XmGadgetClassPart */ BorderHighlight, /* border_highlight */ XmInheritBorderUnhighlight, /* border_unhighlight */ NULL, /* arm_and_activate */ InputDispatch, /* input dispatch */ XmInheritVisualChange, /* visual_change */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num syn_resources */ &LabelClassCachePart, /* class cache part */ (XtPointer)&_XmLabelGadClassExtRec /* extension */ }, { /* XmLabelGadgetClassPart */ SetOverrideCallback, /* override_callback */ NULL, /* menu procedure interface */ NULL /* extension record */ } }; externaldef(xmlabelgadgetclass) WidgetClass xmLabelGadgetClass = (WidgetClass) &xmLabelGadgetClassRec; /*ARGSUSED*/ static Pixmap GetTopShadowPixmapDefault(Widget widget) { XmLabelGadget lg = (XmLabelGadget) widget; XmManagerWidget mw = (XmManagerWidget)XtParent(lg); Pixmap result = XmUNSPECIFIED_PIXMAP; if (LabG_TopShadowColor(lg) == LabG_Background(lg)) result = XmGetPixmapByDepth (XtScreen (lg), XmS50_foreground, LabG_TopShadowColor(lg), LabG_Foreground(lg), mw->core.depth); else if (DefaultDepthOfScreen (XtScreen (widget)) == 1) result = XmGetPixmapByDepth (XtScreen (lg), XmS50_foreground, LabG_TopShadowColor(lg), LabG_Background(lg), mw->core.depth); return result; } /*ARGSUSED*/ static Pixmap GetLabelHighlightPixmapDefault(Widget widget) { XmLabelGadget lg = (XmLabelGadget) widget; XmManagerWidget mw = (XmManagerWidget)XtParent(lg); Pixmap result = XmUNSPECIFIED_PIXMAP; if (LabG_HighlightColor(lg) == LabG_Background(lg)) result = XmGetPixmapByDepth (XtScreen (lg), XmS50_foreground, LabG_HighlightColor(lg), LabG_Foreground(lg), mw->core.depth); return result; } /******************************************************************* * * _XmLabelCacheCompare * *******************************************************************/ int _XmLabelCacheCompare( XtPointer A, XtPointer B) { XmLabelGCacheObjPart *label_inst = (XmLabelGCacheObjPart *) A; XmLabelGCacheObjPart *label_cache_inst = (XmLabelGCacheObjPart *) B; if ((label_inst->label_type == label_cache_inst->label_type) && (label_inst->alignment == label_cache_inst->alignment) && (label_inst->string_direction == label_cache_inst->string_direction) && (label_inst->margin_height == label_cache_inst->margin_height) && (label_inst->margin_width == label_cache_inst->margin_width) && (label_inst->margin_left == label_cache_inst->margin_left) && (label_inst->margin_right == label_cache_inst->margin_right) && (label_inst->margin_top == label_cache_inst->margin_top) && (label_inst->margin_bottom == label_cache_inst->margin_bottom) && (label_inst->recompute_size == label_cache_inst->recompute_size) && (label_inst->skipCallback == label_cache_inst->skipCallback) && (label_inst->menu_type == label_cache_inst->menu_type) && (label_inst->background_GC == label_cache_inst->background_GC) && (label_inst->top_shadow_GC == label_cache_inst->top_shadow_GC) && (label_inst->bottom_shadow_GC == label_cache_inst->bottom_shadow_GC) && (label_inst->highlight_GC == label_cache_inst->highlight_GC) && (label_inst->foreground == label_cache_inst->foreground) && (label_inst->background == label_cache_inst->background) && (label_inst->top_shadow_color == label_cache_inst->top_shadow_color) && (label_inst->top_shadow_pixmap == label_cache_inst->top_shadow_pixmap) && (label_inst->bottom_shadow_color == label_cache_inst->bottom_shadow_color) && (label_inst->bottom_shadow_pixmap == label_cache_inst->bottom_shadow_pixmap) && (label_inst->highlight_color == label_cache_inst->highlight_color) && (label_inst->highlight_pixmap == label_cache_inst->highlight_pixmap)) return 1; else return 0; } /*********************************************************** * * ClassInitialize * ************************************************************/ static void ClassInitialize(void) { labelBaseClassExtRec.record_type = XmQmotif; /* Install menu savvy on just this class */ XmeTraitSet((XtPointer) &xmLabelGadgetClassRec, XmQTmenuSavvy, (XtPointer) &MenuSavvyGadgetRecord); } void _XmLabelGCloneMenuSavvy(WidgetClass wc, XmMenuSavvyTrait mst) { /* Modify and reinstall menu savvy trait */ if (mst->version == -1) { mst->version = MenuSavvyGadgetRecord.version; mst->disableCallback = MenuSavvyGadgetRecord.disableCallback; mst->getAccelerator = MenuSavvyGadgetRecord.getAccelerator; mst->getMnemonic = MenuSavvyGadgetRecord.getMnemonic; } /* Install the new record */ XmeTraitSet((XtPointer) wc, XmQTmenuSavvy, (XtPointer) mst); } /************************************************************************ * * ClassPartInitialize * Processes the class fields which need to be inherited. * ************************************************************************/ static void ClassPartInitialize(WidgetClass cl) { register XmLabelGadgetClass wc = (XmLabelGadgetClass) cl; XmLabelGadgetClass super = (XmLabelGadgetClass)wc->rect_class.superclass; XmGadgetClassExt *wcePtr, *scePtr; if (wc->label_class.setOverrideCallback == XmInheritSetOverrideCallback) wc->label_class.setOverrideCallback = super->label_class.setOverrideCallback; if (wc->rect_class.resize == XmInheritResize) wc->rect_class.resize = super->rect_class.resize; wcePtr = _XmGetGadgetClassExtPtr(wc, NULLQUARK); scePtr = _XmGetGadgetClassExtPtr(super, NULLQUARK); if ((*wcePtr)->widget_baseline == XmInheritBaselineProc) (*wcePtr)->widget_baseline = (*scePtr)->widget_baseline; if ((*wcePtr)->widget_display_rect == XmInheritDisplayRectProc) (*wcePtr)->widget_display_rect = (*scePtr)->widget_display_rect; _XmFastSubclassInit (((WidgetClass)wc), XmLABEL_GADGET_BIT); /* Install transfer trait */ XmeTraitSet((XtPointer)cl, XmQTtransfer, (XtPointer) &LabelGTransfer); XmeTraitSet((XtPointer) cl, XmQTaccessTextual, (XtPointer) &_XmLabel_AccessTextualRecord); /* Install the careParentVisual trait for all subclasses as well. */ XmeTraitSet((XtPointer)cl, XmQTcareParentVisual, (XtPointer)&LabelGCVT); /* Install the accessColors trait for all subclasses as well. */ XmeTraitSet((XtPointer)cl, XmQTaccessColors, (XtPointer)&labACT); } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /*ARGSUSED*/ static void SecondaryObjectCreate(Widget req, Widget new_w, ArgList args, Cardinal *num_args) { XmBaseClassExt *cePtr; XmWidgetExtData extData; WidgetClass wc; Cardinal size; XtPointer newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); wc = (*cePtr)->secondaryObjectClass; size = wc->core_class.widget_size; newSec = _XmExtObjAlloc(size); reqSec = _XmExtObjAlloc(size); _XmProcessUnlock(); /* * Update pointers in instance records now so references to resources * in the cache record will be valid for use in CallProcs. * CallProcs are invoked by XtGetSubresources(). */ LabG_Cache(new_w) = &(((XmLabelGCacheObject)newSec)->label_cache); LabG_Cache(req) = &(((XmLabelGCacheObject)reqSec)->label_cache); /* * Fetch the resources in superclass to subclass order */ XtGetSubresources(new_w, newSec, NULL, NULL, wc->core_class.resources, wc->core_class.num_resources, args, *num_args); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; ((XmLabelGCacheObject)newSec)->ext.extensionType = XmCACHE_EXTENSION; ((XmLabelGCacheObject)newSec)->ext.logicalParent = new_w; _XmPushWidgetExtData((Widget) new_w, extData, ((XmLabelGCacheObject)newSec)->ext.extensionType); memcpy(reqSec, newSec, size); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /*ARGSUSED*/ static void InitializePosthook(Widget req, Widget new_w, ArgList args, Cardinal *num_args) { XmWidgetExtData ext; XmLabelGadget lw = (XmLabelGadget)new_w; /* * - register parts in cache. * - update cache pointers * - and free req */ _XmProcessLock(); LabG_Cache(lw) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(lw), (XtPointer) LabG_Cache(lw), sizeof(XmLabelGCacheObjPart)); /* * Might want to break up into per-class work that gets explicitly * chained. For right now, each class has to replicate all * superclass logic in hook routine. */ /* * free the req subobject used for comparisons */ _XmPopWidgetExtData((Widget) lw, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer)ext->widget); _XmExtObjFree((XtPointer)ext->reqWidget); _XmProcessUnlock(); XtFree((char *) ext); } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPrehook(Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; XmLabelGCacheObject newSec, reqSec; Cardinal size; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmLabelGCacheObject)_XmExtObjAlloc(size); reqSec = (XmLabelGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy(&(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); XtSetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmExtImportArgs((Widget)newSec, args, num_args); memcpy((XtPointer)reqSec, (XtPointer)newSec, size); LabG_Cache(newParent) = &((newSec)->label_cache); LabG_Cache(refParent) = &((reqSec)->label_cache); return FALSE; } /************************************************************************ * * GetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static void GetValuesPrehook(Widget newParent, ArgList args, Cardinal *num_args) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; XmLabelGCacheObject newSec; Cardinal size; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmLabelGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy(&(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); XtGetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmExtGetValuesHook((Widget)newSec, args, num_args); } /************************************************************************ * * GetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static void GetValuesPosthook(Widget new_w, ArgList args, Cardinal *num_args) { XmWidgetExtData ext; _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmProcessLock(); _XmExtObjFree((XtPointer)ext->widget); _XmProcessUnlock(); XtFree((char *) ext); } /************************************************************************ * * SetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPosthook(Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) { XmWidgetExtData ext; /* * - register parts in cache. * - update cache pointers * - and free req */ /* assign if changed! */ _XmProcessLock(); if (!_XmLabelCacheCompare((XtPointer)LabG_Cache(new_w), (XtPointer)LabG_Cache(current))) { /* delete the old one */ _XmCacheDelete((XtPointer) LabG_Cache(current)); LabG_Cache(new_w) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(new_w), (XtPointer) LabG_Cache(new_w), sizeof(XmLabelGCacheObjPart)); } else LabG_Cache(new_w) = LabG_Cache(current); _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer)ext->widget); _XmExtObjFree((XtPointer)ext->reqWidget); XtFree((char *) ext); _XmProcessUnlock(); return FALSE; } static void BorderHighlight(Widget w) { XmLabelGadget lg = (XmLabelGadget) w; if (lg->rectangle.width == 0 || lg->rectangle.height == 0 || lg->gadget.highlight_thickness == 0) { return; } lg->gadget.highlighted = True; lg->gadget.highlight_drawn = True; /* CR 7330: Use XmeDrawHighlight, not _XmDrawHighlight. */ XmeDrawHighlight(XtDisplay((Widget) lg), XtWindow((Widget) lg), LabG_HighlightGC(lg), lg->rectangle.x, lg->rectangle.y, lg->rectangle.width, lg->rectangle.height, lg->gadget.highlight_thickness); } /************************************************************************ * * SetNormalGC * Create the normal and insensitive GC's for the gadget. * ************************************************************************/ static void SetNormalGC(XmLabelGadget lw) { XGCValues values; XtGCMask valueMask, dynamicMask; XmManagerWidget mw; XFontStruct *fs = (XFontStruct *) NULL; mw = (XmManagerWidget) XtParent(lw); valueMask = GCForeground | GCBackground | GCGraphicsExposures; dynamicMask = GCClipXOrigin | GCClipYOrigin | GCClipMask; values.foreground = LabG_Foreground(lw); values.background = LabG_Background(lw); values.graphics_exposures = FALSE; if (XmeRenderTableGetDefaultFont(LabG_Font(lw), &fs)) { valueMask |= GCFont; values.font = fs->fid; } LabG_NormalGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values, dynamicMask, 0); #ifdef FIX_1381 /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor((Widget)lw); values.background = LabG_Background(lw); #else valueMask |= GCFillStyle | GCStipple; values.foreground = LabG_Background(lw); values.background = LabG_Foreground(lw); values.fill_style = FillOpaqueStippled; values.stipple = _XmGetInsensitiveStippleBitmap((Widget) lw); #endif LabG_InsensitiveGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values, dynamicMask, 0); #ifdef FIX_1381 /*light shadow for insensitive text (instead stipple)*/ values.foreground = LabG_TopShadowColor(lw); LabG_ShadowGC(lw) = XtAllocateGC((Widget) mw, 0, valueMask, &values, dynamicMask, 0); #endif } /************************************************************************ * * _XmLabelSetBackgroundGC * Get the graphics context used for drawing the shadows. * ************************************************************************/ void _XmLabelSetBackgroundGC(XmLabelGadget lw) { XGCValues values; XtGCMask valueMask; XmManagerWidget mw; XFontStruct *fs = (XFontStruct *) NULL; mw = (XmManagerWidget) XtParent(lw); if (lw->label.fill_bg_box != _XmALWAYS_FILL_BG_BOX) { if ((mw->core.background_pixel != LabG_Background(lw)) && (mw->core.background_pixmap == XmUNSPECIFIED_PIXMAP)) lw->label.fill_bg_box = _XmFILL_BG_BOX; else lw->label.fill_bg_box = _XmPLAIN_BG_BOX; } valueMask = GCForeground | GCBackground | GCGraphicsExposures | GCClipMask; values.foreground = LabG_Background(lw); values.background = LabG_Foreground(lw); values.graphics_exposures = FALSE; values.clip_mask = None; /* CR 8980: Use parent's background_pixmap if possible. */ if (mw->core.background_pixmap != XmUNSPECIFIED_PIXMAP) { int depth; XmeGetPixmapData(XtScreen((Widget)lw), mw->core.background_pixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == 1) { valueMask |= GCFillStyle | GCStipple ; values.fill_style = FillOpaqueStippled; values.stipple = mw->core.background_pixmap; } else { valueMask |= GCFillStyle | GCTile ; values.fill_style = FillTiled; values.tile = mw->core.background_pixmap; } } if (XmeRenderTableGetDefaultFont(LabG_Font(lw), &fs)) { valueMask |= GCFont; values.font = fs->fid; } LabG_BackgroundGC(lw) = XtGetGC ((Widget) mw, valueMask, &values); } /************************************************************************ * * _XmCalcLabelGDimensions() * Calculates the dimensionsof the label text and pixmap, and updates * the TextRect fields appropriately. Called at Initialize and SetValues. * This is also called by the subclasses to recalculate label dimensions. * *************************************************************************/ void _XmCalcLabelGDimensions(Widget wid) { XmLabelGadget newlw = (XmLabelGadget) wid; unsigned int w = 0 , h = 0; /* initialize TextRect width and height to 0, reset if needed */ LabG_AccTextRect(newlw).width = 0; LabG_AccTextRect(newlw).height = 0; LabG_StringRect(newlw).x = 0; LabG_StringRect(newlw).y = 0; LabG_StringRect(newlw).width = 0; LabG_StringRect(newlw).height = 0; LabG_PixmapRect(newlw).x = 0; LabG_PixmapRect(newlw).y = 0; LabG_PixmapRect(newlw).width = 0; LabG_PixmapRect(newlw).height = 0; if (LabG_IsPixmap(newlw) || LabG_IsPixmapAndText(newlw)) { if (XtIsSensitive(wid)) { if (Pix (newlw) != XmUNSPECIFIED_PIXMAP) { XmeGetPixmapData(XtScreen(newlw), Pix(newlw), NULL, NULL, NULL, NULL, NULL, NULL, &w, &h); LabG_PixmapRect(newlw).width = (unsigned short) w; LabG_PixmapRect(newlw).height = (unsigned short) h; } } else { Pixmap pix_use = Pix_insen (newlw) ; if (pix_use == XmUNSPECIFIED_PIXMAP) pix_use = Pix(newlw); if (pix_use != XmUNSPECIFIED_PIXMAP) { XmeGetPixmapData(XtScreen(newlw), pix_use, NULL, NULL, NULL, NULL, NULL, NULL, &w, &h); LabG_PixmapRect(newlw).width = (unsigned short) w; LabG_PixmapRect(newlw).height = (unsigned short) h; } } } if (LabG_IsText (newlw) || LabG_IsPixmapAndText(newlw)) { Dimension w, h; /* If we have a string then size it. */ if (!XmStringEmpty (LabG__label(newlw))) { XmStringExtent (LabG_Font(newlw), LabG__label(newlw), &w, &h); LabG_StringRect(newlw).width = (unsigned short)w; LabG_StringRect(newlw).height = (unsigned short)h; } } _XmLabelGCalcTextRect(wid); if (LabG__acceleratorText(newlw) != NULL) { /* If we have a string then size it. */ Dimension w,h; if (!XmStringEmpty (LabG__acceleratorText(newlw))) { XmStringExtent(LabG_Font(newlw), LabG__acceleratorText(newlw), &w, &h); LabG_AccTextRect(newlw).width = (unsigned short)w; LabG_AccTextRect(newlw).height = (unsigned short)h; } } } void _XmLabelGCalcTextRect(Widget wid) { LabG_TextRect(wid).width = 0; LabG_TextRect(wid).height = 0; if (LabG_IsPixmap(wid)) { LabG_TextRect(wid).width = LabG_PixmapRect(wid).width; LabG_TextRect(wid).height = LabG_PixmapRect(wid).height; } else if (LabG_IsText(wid)) { LabG_TextRect(wid).width = LabG_StringRect(wid).width; LabG_TextRect(wid).height = LabG_StringRect(wid).height; } else if (LabG_IsPixmapAndText(wid)) { if (LabG_PixmapPlacement(wid) == XmPIXMAP_TOP || LabG_PixmapPlacement(wid) == XmPIXMAP_BOTTOM) { LabG_TextRect(wid).height = LabG_PixmapRect(wid).height + LabG_StringRect(wid).height + LabG_PixmapTextPadding(wid); LabG_TextRect(wid).width = MAX(LabG_StringRect(wid).width, LabG_PixmapRect(wid).width); } else if (LabG_PixmapPlacement(wid) == XmPIXMAP_LEFT || LabG_PixmapPlacement(wid) == XmPIXMAP_RIGHT) { LabG_TextRect(wid).width = LabG_PixmapRect(wid).width + LabG_StringRect(wid).width + LabG_PixmapTextPadding(wid); LabG_TextRect(wid).height = MAX(LabG_StringRect(wid).height, LabG_PixmapRect(wid).height); } if (LabG_PixmapPlacement(wid) == XmPIXMAP_TOP) { LabG_PixmapRect(wid).y = 0; LabG_StringRect(wid).y = LabG_PixmapRect(wid).height + LabG_PixmapTextPadding(wid); } else if (LabG_PixmapPlacement(wid) == XmPIXMAP_BOTTOM) { LabG_StringRect(wid).y = 0; LabG_PixmapRect(wid).y = LabG_StringRect(wid).height + LabG_PixmapTextPadding(wid); } else if ((LabG_PixmapPlacement(wid) == XmPIXMAP_RIGHT && LayoutIsRtoLG(wid)) || (LabG_PixmapPlacement(wid) == XmPIXMAP_LEFT && !LayoutIsRtoLG(wid))) { LabG_PixmapRect(wid).x = 0; LabG_StringRect(wid).x = LabG_PixmapRect(wid).width + LabG_PixmapTextPadding(wid); } else if ((LabG_PixmapPlacement(wid) == XmPIXMAP_LEFT && LayoutIsRtoLG(wid)) || (LabG_PixmapPlacement(wid) == XmPIXMAP_RIGHT && !LayoutIsRtoLG(wid))) { LabG_StringRect(wid).x = 0; LabG_PixmapRect(wid).x = LabG_StringRect(wid).width + LabG_PixmapTextPadding(wid); } if (LabG_PixmapPlacement(wid) == XmPIXMAP_RIGHT || LabG_PixmapPlacement(wid) == XmPIXMAP_LEFT) { LabG_PixmapRect(wid).y = (LabG_TextRect(wid).height - LabG_PixmapRect(wid).height) / 2; LabG_StringRect(wid).y = (LabG_TextRect(wid).height - LabG_StringRect(wid).height) / 2; } else { if (LabG_Alignment(wid) == XmALIGNMENT_CENTER) { LabG_PixmapRect(wid).x = (LabG_TextRect(wid).width - LabG_PixmapRect(wid).width) / 2; LabG_StringRect(wid).x = (LabG_TextRect(wid).width - LabG_StringRect(wid).width) / 2; } else if ((LabG_Alignment(wid) == XmALIGNMENT_END && !LayoutIsRtoLG(wid)) || (LabG_Alignment(wid) == XmALIGNMENT_BEGINNING && LayoutIsRtoLG(wid))) { LabG_PixmapRect(wid).x = LabG_TextRect(wid).width - LabG_PixmapRect(wid).width; LabG_StringRect(wid).x = LabG_TextRect(wid).width - LabG_StringRect(wid).width; } } } } /************************************************************************ * * Resize * Sets new width, new height, and new label.TextRect * appropriately. It is called by Initialize and SetValues. * ************************************************************************/ static void Resize(Widget wid) { XmLabelGadget newlw = (XmLabelGadget) wid; int leftx, rightx; /* increase margin width if necessary to accomodate accelerator text */ if (LabG__acceleratorText(newlw) != NULL) { if (LayoutIsRtoLG(newlw)) { if (LabG_MarginLeft(newlw) < LabG_AccTextRect(newlw).width + LABELG_ACC_PAD) { int delta = LabG_AccTextRect(newlw).width + LABELG_ACC_PAD - LabG_MarginLeft(newlw); newlw->label.acc_left_delta += delta; LabG_MarginLeft(newlw) += delta; } } else { if (LabG_MarginRight(newlw) < LabG_AccTextRect(newlw).width + LABELG_ACC_PAD) { int delta = LabG_AccTextRect(newlw).width + LABELG_ACC_PAD - LabG_MarginRight(newlw); newlw->label.acc_right_delta += delta; LabG_MarginRight(newlw) += delta; } } } /* Has a width been specified? */ if (newlw->rectangle.width == 0) newlw->rectangle.width = LabG_TextRect(newlw).width + LabG_MarginLeft(newlw) + LabG_MarginRight(newlw) + (2 * (LabG_MarginWidth(newlw) + newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness)); leftx = newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness + LabG_MarginWidth(newlw) + LabG_MarginLeft(newlw); rightx = newlw->rectangle.width - newlw->gadget.highlight_thickness - newlw->gadget.shadow_thickness - LabG_MarginWidth(newlw) - LabG_MarginRight(newlw); switch (LabG_Alignment(newlw)) { case XmALIGNMENT_BEGINNING: if (LayoutIsRtoLG(newlw)) LabG_TextRect(newlw).x = rightx - LabG_TextRect(newlw).width; else LabG_TextRect(newlw).x = leftx; break; case XmALIGNMENT_END: if (LayoutIsRtoLG(newlw)) LabG_TextRect(newlw).x = leftx; else LabG_TextRect(newlw).x = rightx - LabG_TextRect(newlw).width; break; default: /* XmALIGNMENT_CENTER */ LabG_TextRect(newlw).x = leftx + (rightx - leftx - (int)LabG_TextRect(newlw).width) / 2; break; } /* Has a height been specified? */ if (newlw->rectangle.height == 0) newlw->rectangle.height = MAX(LabG_TextRect(newlw).height, LabG_AccTextRect(newlw).height) + LabG_MarginTop(newlw) + LabG_MarginBottom(newlw) + (2 * (LabG_MarginHeight(newlw) + newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness)); LabG_TextRect(newlw).y = (short) (newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness + LabG_MarginHeight(newlw) + LabG_MarginTop(newlw) + ((int) (newlw->rectangle.height - LabG_MarginTop(newlw) - LabG_MarginBottom(newlw) - (2 * (LabG_MarginHeight(newlw) + newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness)) - LabG_TextRect(newlw).height) / 2)); if (LabG__acceleratorText(newlw) != NULL) { Dimension base_label, base_accText, diff; if (LayoutIsRtoLG(newlw)) LabG_AccTextRect(newlw).x = newlw->rectangle .x + (newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness + LabG_MarginWidth(newlw)); else LabG_AccTextRect(newlw).x = (newlw->rectangle.width - newlw->gadget.highlight_thickness - newlw->gadget.shadow_thickness - LabG_MarginWidth(newlw) - LabG_MarginRight(newlw) + LABELG_ACC_PAD); LabG_AccTextRect(newlw).y = newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness + LabG_MarginHeight(newlw) + LabG_MarginTop(newlw) + ((int) (newlw->rectangle.height - LabG_MarginTop(newlw) - LabG_MarginBottom(newlw) - (2 * (LabG_MarginHeight(newlw) + newlw->gadget.highlight_thickness + newlw->gadget.shadow_thickness)) - LabG_AccTextRect(newlw).height) / 2); /* make sure the label and accelerator text line up */ /* when the fonts are different */ if (LabG_IsText (newlw)) { base_label = XmStringBaseline (LabG_Font(newlw), LabG__label(newlw)); base_accText = XmStringBaseline (LabG_Font(newlw), LabG__acceleratorText(newlw)); if (base_label > base_accText) { diff = base_label - base_accText; LabG_AccTextRect(newlw).y = LabG_TextRect(newlw).y + diff - 1; } else if (base_label < base_accText) { diff = base_accText - base_label; LabG_TextRect(newlw).y = LabG_AccTextRect(newlw).y + diff - 1; } } } /* Set core dimensions so we don't get a Toolkit error. */ if (newlw->rectangle.width == 0) newlw->rectangle.width = 1; if (newlw->rectangle.height == 0) newlw->rectangle.height = 1; } /************************************************************************ * * Initialize * This is the widget's instance initialize routine. It is * called once for each widget. * Changes: Treat label, pixmap, labeltype, mnemoniccharset as independently * setable resource. ************************************************************************/ /*ARGSUSED*/ static void Initialize(Widget req, Widget new_w, ArgList args, Cardinal *num_args) { XmMenuSystemTrait menuSTrait; XmLabelGadget lw = (XmLabelGadget) new_w; XmLabelGadget rw = (XmLabelGadget) req; lw->label.baselines = NULL; /* Before doing anything with the pixmap, check if we have to * re-ask for a conversion */ if (Pix (new_w) == XmDELAYED_PIXMAP) { /* This test means that a conversion was asked for * but failed because the colors were not accessible * prior to Initialize, because the cache wasn't there yet. * We have to try again from here. */ XtGetSubresources(new_w, new_w, NULL, NULL, label_pixmap_resource, 1, args, *num_args); } if (Pix_insen (new_w) == XmDELAYED_PIXMAP) { XtGetSubresources(new_w, new_w, NULL, NULL, label_pixmap_insen_resource, 1, args, *num_args); } /* If menuProcs is not set up yet, try again */ _XmProcessLock(); if (xmLabelGadgetClassRec.label_class.menuProcs == NULL) xmLabelGadgetClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); _XmProcessUnlock(); LabG_SkipCallback(new_w) = FALSE; /* Check for Invalid enumerated types */ if (!XmRepTypeValidValue(XmRID_LABEL_TYPE, LabG_LabelType(new_w), new_w)) LabG_LabelType(new_w) = XmSTRING; if (!XmRepTypeValidValue(XmRID_ALIGNMENT, LabG_Alignment(new_w), new_w)) LabG_Alignment(new_w) = XmALIGNMENT_CENTER; if (!XmRepTypeValidValue(XmRID_PIXMAP_PLACEMENT, LabG_PixmapPlacement(new_w), new_w)) LabG_PixmapPlacement(new_w) = XmPIXMAP_LEFT; #ifndef NO_XM_1_2_BC /* * Some pre-Motif 2.0 XmManager subclasses may be bypassing the * synthetic resouce GetValues hook and passing us the manager's raw * string_direction field (which is now a layout_direction). Fixup * the common/simple cases. */ switch (LabG_StringDirection(lw)) { case XmLEFT_TO_RIGHT: case XmRIGHT_TO_LEFT: /* These string directions are erroneous uses of layout directions. */ LabG_StringDirection(lw) = XmDirectionToStringDirection(LabG_StringDirection(lw)); break; default: /* Other unknown layout directions will still get a warning. */ break; } #endif /* If layout_direction is set, it overrides string_direction. * If string_direction is set, but not layout_direction, use * string_direction value. * If neither is set, get from parent. */ if (lw->gadget.layout_direction != XmDEFAULT_DIRECTION) { if (LabG_StringDirection(lw) == XmDEFAULT_DIRECTION) LabG_StringDirection(lw) = XmDirectionToStringDirection(lw->gadget.layout_direction); } else if (LabG_StringDirection(lw) != XmDEFAULT_DIRECTION) { lw->gadget.layout_direction = XmStringDirectionToDirection(LabG_StringDirection(lw)); } else { lw->gadget.layout_direction = _XmGetLayoutDirection(XtParent(new_w)); LabG_StringDirection(lw) = XmDirectionToStringDirection(lw->gadget.layout_direction); } if (!XmRepTypeValidValue(XmRID_STRING_DIRECTION, LabG_StringDirection(new_w), new_w)) LabG_StringDirection(new_w) = XmSTRING_DIRECTION_L_TO_R; /* Make a local copy of the font list */ if (LabG_Font(new_w) == NULL) { /* CR 2990: Let subclasses choose their own default font. */ LabG_Font(new_w) = XmeGetDefaultRenderTable (new_w, XmLABEL_FONTLIST); } LabG_Font(new_w) = XmFontListCopy(LabG_Font(new_w)); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) XtParent(new_w)), XmQTmenuSystem); if (menuSTrait != (XmMenuSystemTrait) NULL) LabG_MenuType(new_w) = menuSTrait->type(XtParent(new_w)); else LabG_MenuType(new_w) = XmWORK_AREA; /* Handle the label string : * If no label string is given accept widget's name as default. * convert the widgets name to an XmString before storing; * else * save a copy of the given string. * If the given string is not an XmString issue an warning. */ if (LabG__label(new_w) == NULL) { /* reserved */ LabG__label(new_w) = XmeGetLocalizedString ((char *) NULL, (Widget) lw, XmNlabelString, XrmQuarkToString(lw->object.xrm_name)); } else if (XmeStringIsValid((XmString) LabG__label(new_w))) { LabG__label(new_w) = XmStringCopy((XmString) LabG__label(new_w)); } else { XmeWarning((Widget) lw, CS_STRING_MESSAGE); LabG__label(new_w) = XmStringCreateLocalized(XrmQuarkToString(lw->object.xrm_name)); } /* * Convert the given mnemonicCharset to the internal Xm-form. */ if (LabG_MnemonicCharset(new_w) != NULL) { LabG_MnemonicCharset (new_w) = _XmStringCharsetCreate (LabG_MnemonicCharset (new_w)); } else LabG_MnemonicCharset (new_w) = _XmStringCharsetCreate (XmFONTLIST_DEFAULT_TAG); /* Accelerators are currently only supported in menus */ if ((LabG__acceleratorText(new_w) != NULL) && LabG_IsMenupane(new_w)) { if (XmeStringIsValid((XmString) LabG__acceleratorText(new_w))) { /* Copy the input string into local space if not a Cascade Button. */ if (XmIsCascadeButtonGadget(new_w)) LabG__acceleratorText(new_w) = NULL; else LabG__acceleratorText(new_w)= XmStringCopy((XmString) LabG__acceleratorText(new_w)); } else { XmeWarning((Widget) lw, ACC_MESSAGE); LabG__acceleratorText(new_w) = NULL; } } else LabG__acceleratorText(new_w) = NULL; if ((LabG_Accelerator(new_w) != NULL) && LabG_IsMenupane(new_w)) { /* Copy the accelerator into local space */ LabG_Accelerator(lw) = XtNewString(LabG_Accelerator(new_w)); } else LabG_Accelerator(lw) = NULL; LabG_SkipCallback(lw) = FALSE; lw->label.acc_left_delta = 0; lw->label.acc_right_delta = 0; /* If zero width and height was requested by the application, */ /* reset new's width and height to zero to allow Resize() */ /* to operate properly. */ if (rw->rectangle.width == 0) lw->rectangle.width = 0; if (rw->rectangle.height == 0) lw->rectangle.height = 0; /* CR 6267: Suppress highlight thickness before sizing also. */ if ((LabG_MenuType(new_w) == XmMENU_POPUP) || (LabG_MenuType(new_w) == XmMENU_PULLDOWN) || (LabG_MenuType(new_w) == XmMENU_BAR)) lw->gadget.highlight_thickness = 0; _XmCalcLabelGDimensions(new_w); /* CR 7283: Can't use the resize method pointer here because */ /* subclasses haven't been initialized. */ Resize((Widget) lw); DealWithColors(lw); DealWithPixmaps(lw); /* Initialize only; set properly in _XmLabelSetBackgroundGC(). */ lw->label.fill_bg_box = _XmPLAIN_BG_BOX; SetNormalGC(lw); _XmLabelSetBackgroundGC (lw); LabG_HighlightGC(lw) = _XmGetPixmapBasedGC (XtParent(new_w), LabG_HighlightColor(lw), LabG_Background(lw), LabG_HighlightPixmap(lw)); LabG_TopShadowGC(lw) = _XmGetPixmapBasedGC (XtParent(new_w), LabG_TopShadowColor(lw), LabG_Background(lw), LabG_TopShadowPixmap(lw)); LabG_BottomShadowGC(lw) = _XmGetPixmapBasedGC (XtParent(new_w), LabG_BottomShadowColor(lw), LabG_Background(lw), LabG_BottomShadowPixmap(lw)); /* Force the label traversal flag when in a menu */ if ((XtClass(lw) == xmLabelGadgetClass) && ((LabG_MenuType(new_w) == XmMENU_POPUP) || (LabG_MenuType(new_w) == XmMENU_PULLDOWN) || (LabG_MenuType(new_w) == XmMENU_OPTION))) { lw->gadget.traversal_on = False; lw->gadget.highlight_on_enter = False; } /* Initialize the interesting input types. */ lw->gadget.event_mask = XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmBDRAG_EVENT; } /* * DealWithColors * Deal with compatibility. */ static void DealWithColors(XmLabelGadget lw) { XmManagerWidget mw = (XmManagerWidget) XtParent(lw); /* * If the gadget color is set to the tag value or it is the * same as the manager color; bc mode is enabled otherwise * initialize like a widget. */ if ((LabG_Background(lw) == INVALID_PIXEL || LabG_Background(lw) == mw->core.background_pixel) && (LabG_Foreground(lw) == INVALID_PIXEL || LabG_Foreground(lw) == mw->manager.foreground) && (LabG_TopShadowColor(lw) == INVALID_PIXEL || LabG_TopShadowColor(lw) == mw->manager.top_shadow_color) && (LabG_BottomShadowColor(lw) == INVALID_PIXEL || LabG_BottomShadowColor(lw) == mw->manager.bottom_shadow_color) && (LabG_HighlightColor(lw) == INVALID_PIXEL || LabG_HighlightColor(lw) == mw->manager.highlight_color)) { LabG_Background(lw) = mw->core.background_pixel; LabG_Foreground(lw) = mw->manager.foreground; LabG_TopShadowColor(lw) = mw->manager.top_shadow_color; LabG_BottomShadowColor(lw) = mw->manager.bottom_shadow_color; LabG_HighlightColor(lw) = mw->manager.highlight_color; } else { InitNewColorBehavior(lw); } } /* * InitNewColorBehavior * Initialize colors like a widget. These are CallProcs so * they should be called with a correct offset. However offset * isn't used by these functions. Even so I supply offset. * You make the call. */ static void InitNewColorBehavior(XmLabelGadget lw) { XrmValue value; value.size = sizeof(Pixel); if (LabG_Background(lw) == INVALID_PIXEL) { _XmBackgroundColorDefault ((Widget) lw, XtOffsetOf(struct _XmLabelGCacheObjRec, label_cache.background), &value); memcpy((char*) &LabG_Background(lw), value.addr, value.size); } if (LabG_Foreground(lw) == INVALID_PIXEL) { _XmForegroundColorDefault ((Widget) lw, XtOffsetOf(struct _XmLabelGCacheObjRec, label_cache.foreground), &value); memcpy((char*) &LabG_Foreground(lw), value.addr, value.size); } if (LabG_TopShadowColor(lw) == INVALID_PIXEL) { _XmTopShadowColorDefault ((Widget) lw, XtOffsetOf(struct _XmLabelGCacheObjRec, label_cache.top_shadow_color), &value); memcpy((char*) &LabG_TopShadowColor(lw), value.addr, value.size); } if (LabG_BottomShadowColor(lw) == INVALID_PIXEL) { _XmBottomShadowColorDefault ((Widget) lw, XtOffsetOf(struct _XmLabelGCacheObjRec, label_cache.bottom_shadow_color), &value); memcpy((char*) &LabG_BottomShadowColor(lw), value.addr, value.size); } if (LabG_HighlightColor(lw) == INVALID_PIXEL) { _XmHighlightColorDefault ((Widget) lw, XtOffsetOf(struct _XmLabelGCacheObjRec, label_cache.highlight_color), &value); memcpy((char*) &LabG_HighlightColor(lw), value.addr, value.size); } } /* * DealWithPixmaps * Deal with compatibility. If any resource is set initialize * like a widget otherwise get everything from the parent. */ static void DealWithPixmaps(XmLabelGadget lw) { XmManagerWidget mw = (XmManagerWidget) XtParent(lw); if ((LabG_TopShadowPixmap(lw) == INVALID_PIXMAP || LabG_TopShadowPixmap(lw) == mw->manager.top_shadow_pixmap) && (LabG_HighlightPixmap(lw) == INVALID_PIXMAP || LabG_HighlightPixmap(lw) == mw->manager.highlight_pixmap)) { LabG_TopShadowPixmap(lw) = mw->manager.top_shadow_pixmap; LabG_HighlightPixmap(lw) = mw->manager.highlight_pixmap; } else { InitNewPixmapBehavior(lw); } } /* * InitNewPixmapBehavior * Initialize colors like a widget. */ static void InitNewPixmapBehavior(XmLabelGadget lw) { if (LabG_TopShadowPixmap(lw) == INVALID_PIXMAP) LabG_TopShadowColor(lw) = GetTopShadowPixmapDefault((Widget)lw); if (LabG_HighlightPixmap(lw) == INVALID_PIXMAP) LabG_HighlightPixmap(lw) = GetLabelHighlightPixmapDefault((Widget)lw); } /************************************************************************ * * QueryGeometry * ************************************************************************/ static XtGeometryResult QueryGeometry(Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *reply) { XmLabelGadget lg = (XmLabelGadget) wid; reply->request_mode = 0; /* Don't really know what to do with queries about x,y,border,stacking. * Since we are interpreting unset bits as a request for information * (asking about neither height or width does the old 0-0 request) * a caller asking about x,y should not get back width and height, * especially since it is an expensive operation. So x, y, border, stack * all return No, this indicates we'd prefer to remain as is. Parent * is free to change it anyway... */ if (GMode(intended) & ~(CWWidth | CWHeight)) return XtGeometryNo; if (LabG_RecomputeSize(lg) == FALSE) return XtGeometryNo; /* pre-load the reply with input values */ reply->request_mode = (CWWidth | CWHeight); reply->width = LabG_TextRect(lg).width + (2 * (LabG_MarginWidth(lg) + lg->gadget.highlight_thickness + lg->gadget.shadow_thickness)) + LabG_MarginLeft(lg) + LabG_MarginRight(lg); if (reply->width == 0) reply->width = 1; reply->height = MAX(LabG_TextRect(lg).height, LabG_AccTextRect(lg).height) + (2 * (LabG_MarginHeight(lg) + lg->gadget.highlight_thickness + lg->gadget.shadow_thickness)) + LabG_MarginTop(lg) + LabG_MarginBottom(lg); if (reply->height == 0) reply->height = 1; if ((IsWidth(intended) && (reply->width != intended->width)) || (IsHeight(intended) && (reply->height != intended->height)) || (GMode(intended) != GMode(reply))) { return XtGeometryAlmost; } else { reply->request_mode = 0; return XtGeometryYes; } } /************************************************************************ * * Destroy * Free up the label gadget allocated space. This includes * the label, and GC's. * ************************************************************************/ static void Destroy(Widget w) { if (LabG__label(w) != NULL) XmStringFree (LabG__label(w)); if (LabG__acceleratorText(w) != NULL) XmStringFree (LabG__acceleratorText(w)); XtFree (LabG_Accelerator(w)); if (LabG_Font(w) != NULL) XmFontListFree (LabG_Font(w)); XtFree (LabG_MnemonicCharset (w)); XtFree ((char*) ((XmLabelGadget)w)->label.baselines); XtReleaseGC (XtParent(w), LabG_NormalGC(w)); XtReleaseGC (XtParent(w), LabG_InsensitiveGC(w)); #ifdef FIX_1381 XtReleaseGC (XtParent(w), LabG_ShadowGC(w)); #endif XtReleaseGC (XtParent(w), LabG_BackgroundGC(w)); XtReleaseGC (XtParent(w), LabG_HighlightGC(w)); XtReleaseGC (XtParent(w), LabG_TopShadowGC(w)); XtReleaseGC (XtParent(w), LabG_BottomShadowGC(w)); /* CR 6571: Free cache *after* making all references. */ _XmProcessLock(); _XmCacheDelete((XtPointer) LabG_Cache(w)); _XmProcessUnlock(); } /*ARGSUSED*/ static void LabelDrawBackground(Widget wid, XEvent *event, /* unused */ Region region, /* unused */ LRectangle *background_box) { XmLabelGadget lw = (XmLabelGadget) wid; switch (lw->label.fill_bg_box) { case _XmPLAIN_BG_BOX: return; case _XmFILL_BG_BOX: case _XmALWAYS_FILL_BG_BOX: default: break; } /* * Background_box is a parameter because subclasses like * PushBG and ToggleBG need to be able to adjust this rectangle. */ if (background_box->width < 0) background_box->width = 0; if (background_box->height < 0) background_box->height = 0; XFillRectangle(XtDisplay(lw), XtWindow((Widget) lw), LabG_BackgroundGC(lw), background_box->x, background_box->y, background_box->width, background_box->height); } /************************************************************************ * * Redisplay * ************************************************************************/ static void Redisplay(Widget wid, XEvent *event, Region region) { XmLabelGadget lw = (XmLabelGadget) wid; LRectangle background_box; background_box.x = lw->rectangle.x + LabG_Highlight(lw); background_box.y = lw->rectangle.y + LabG_Highlight(lw); background_box.width = lw->rectangle.width - (2 * LabG_Highlight(lw)); background_box.height = lw->rectangle.height - (2 * LabG_Highlight(lw)); _XmRedisplayLabG(wid, event, region, &background_box); } void _XmRedisplayLabG(Widget wid, XEvent *event, Region region, LRectangle *background_box) { XmLabelGadget lw = (XmLabelGadget) wid; GC gc; GC clipgc = NULL; XRectangle clip_rect; Dimension availW, availH, marginal_width, marginal_height, max_text_height; if (!XtIsRealized(wid)) return ; if (LabG_IsMenupane(lw)) { ShellWidget mshell = (ShellWidget) XtParent(XtParent(lw)); if (! mshell->shell.popped_up) return; } availH = lw->rectangle.height; availW = lw->rectangle.width; /* * Don't count MarginWidth to be consistent with Label Widget. * * Adjust definitions of temporary variables */ marginal_width = LabG_MarginLeft(lw) + LabG_MarginRight(lw) + (2 * (lw->gadget.highlight_thickness + lw->gadget.shadow_thickness)); marginal_height = LabG_MarginTop(lw) + LabG_MarginBottom(lw) + (2 * (lw->gadget.highlight_thickness + lw->gadget.shadow_thickness)); max_text_height = MAX(LabG_TextRect(lw).height, LabG_AccTextRect(lw).height); if (XtIsSensitive(wid)) clipgc = LabG_NormalGC(lw); else clipgc = LabG_InsensitiveGC(lw); /* Clip should include critical margins (see Label.c) */ if (availH < (marginal_height + max_text_height) || availW < (marginal_width + LabG_TextRect(lw).width)) { clip_rect.x = lw->rectangle.x + lw->gadget.highlight_thickness + lw->gadget.shadow_thickness + LabG_MarginLeft(lw); clip_rect.y = lw->rectangle.y + lw->gadget.highlight_thickness + lw->gadget.shadow_thickness + LabG_MarginTop(lw); /* Don't allow negative dimensions */ if (availW > marginal_width) clip_rect.width = availW - marginal_width; else clip_rect.width = 0; if (availH > marginal_height) clip_rect.height = availH - marginal_height; else clip_rect.height = 0; XSetClipRectangles(XtDisplay(lw), clipgc, 0,0, &clip_rect, 1, Unsorted); #ifdef FIX_1521 #ifdef USE_XFT _XmXftSetClipRectangles(XtDisplay(lw), XtWindow(lw), 0, 0, &clip_rect, 1); #endif #endif } else { XSetClipMask (XtDisplay (lw), clipgc, None); #ifdef FIX_1521 #ifdef USE_XFT XftDraw *draw = _XmXftDrawCreate(XtDisplay(lw), XtWindow(lw)); XftDrawSetClip(draw, NULL); #endif #endif } #ifdef FIX_1517 #ifdef USE_XFT { int width, height; int x = lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x; int y = lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y; if (LabG_StringRect(lw).width < availW - marginal_width) width = LabG_StringRect(lw).width; else #ifdef FIX_1654 width = availW - marginal_width; #else width = availW - marginal_width - x; #endif if (LabG_StringRect(lw).height < availH - marginal_height) height = LabG_StringRect(lw).height; else #ifdef FIX_1654 height = availH - marginal_height; #else height = availH - marginal_height - y; #endif XFillRectangle(XtDisplay(lw), XtWindow(lw), LabG_BackgroundGC(lw), x, y, width, height); } #endif #endif /* Draw the pixmap or text */ LabelDrawBackground((Widget)lw, event, region, background_box); if (LabG_IsPixmap(lw) || LabG_IsPixmapAndText(lw)) { int depth; /* moved before the condition: LabelDrawBackground((Widget)lw, event, region, background_box); */ if (XtIsSensitive(wid)) { if (Pix (lw) != XmUNSPECIFIED_PIXMAP) { gc = LabG_NormalGC(lw); XmeGetPixmapData(XtScreen(lw), Pix(lw), NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == XtParent(lw)->core.depth) XCopyArea (XtDisplay(lw), Pix(lw), XtWindow(lw), gc, 0, 0, LabG_PixmapRect(lw).width, LabG_PixmapRect(lw).height, lw->rectangle.x + LabG_TextRect(lw).x + LabG_PixmapRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y); else if (depth == 1) XCopyPlane (XtDisplay(lw), Pix(lw), XtWindow(lw), gc, 0, 0, LabG_PixmapRect(lw).width, LabG_PixmapRect(lw).height, lw->rectangle.x + LabG_TextRect(lw).x + LabG_PixmapRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y, 1); } } else { Pixmap pix_use = Pix_insen (lw) ; if (pix_use == XmUNSPECIFIED_PIXMAP) #ifdef FIX_1381 Pix_insen(lw) = pix_use = _XmConvertToBW(wid, Pix(lw)); #else pix_use = Pix(lw); #endif if (pix_use != XmUNSPECIFIED_PIXMAP) { gc = LabG_InsensitiveGC(lw); XmeGetPixmapData(XtScreen(lw), pix_use, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == XtParent(lw)->core.depth) XCopyArea (XtDisplay(lw), pix_use, XtWindow(lw), gc, 0, 0, LabG_PixmapRect(lw).width, LabG_PixmapRect(lw).height, lw->rectangle.x + LabG_TextRect(lw).x + LabG_PixmapRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y); else if (depth == 1) XCopyPlane (XtDisplay(lw), pix_use, XtWindow(lw), gc, 0, 0, LabG_PixmapRect(lw).width, LabG_PixmapRect(lw).height, lw->rectangle.x + LabG_TextRect(lw).x + LabG_PixmapRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y, 1); #ifndef FIX_1381 /* if no insensitive pixmap but a regular one, we need to do the stipple manually, since copyarea doesn't */ if (pix_use == Pix(lw)) { /* need fill stipple, not opaque */ XSetFillStyle(XtDisplay(lw), gc, FillStippled); XFillRectangle(XtDisplay(lw), XtWindow(lw), gc, lw->rectangle.x + LabG_TextRect(lw).x + LabG_PixmapRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y, LabG_PixmapRect(lw).width, LabG_PixmapRect(lw).height); XSetFillStyle(XtDisplay(lw), gc, FillOpaqueStippled); } #endif #ifdef FIX_1505 if (pix_use == Pix(lw)) { XSetFillStyle(XtDisplay(lw), gc, FillStippled); XSetStipple(XtDisplay(lw), gc, _XmGetInsensitiveStippleBitmap((Widget)lw)); XFillRectangle(XtDisplay(lw), XtWindow(lw), gc, lw->rectangle.x + LabG_TextRect(lw).x + LabG_PixmapRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_PixmapRect(lw).y, LabG_PixmapRect(lw).width, LabG_PixmapRect(lw).height); XSetFillStyle(XtDisplay(lw), gc, FillSolid); } #endif } } } if ((LabG_IsText(lw) || LabG_IsPixmapAndText(lw)) && (LabG__label(lw) != NULL)) { /* TODO this clears the pixmap, but this is needed to draw background */ /* LabelDrawBackground((Widget)lw, event, region, background_box); */ if (LabG_Mnemonic(lw) != XK_VoidSymbol) { /* CR 5181: Convert the mnemonic keysym to a character string. */ char tmp[MB_LEN_MAX * 2]; XmString underline; tmp[_XmOSKeySymToCharacter(LabG_Mnemonic(lw), NULL, tmp)] = '\0'; underline = XmStringCreate(tmp, LabG_MnemonicCharset(lw)); #ifdef FIX_1381 if (XtIsSensitive(wid) ) { /*Draw normal text*/ XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), LabG_NormalGC(lw), lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL, underline); } else { /*Draw shadow for insensitive text*/ XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), LabG_ShadowGC(lw), lw->rectangle.x+1 + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y+1 + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL, underline); /*Draw insensitive text*/ XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), LabG_InsensitiveGC(lw), lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL, underline); } #else XmStringDrawUnderline(XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), (XtIsSensitive(wid) ? LabG_NormalGC(lw) : LabG_InsensitiveGC(lw)), lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL, underline); #endif XmStringFree(underline); } else #ifdef FIX_1381 { if (XtIsSensitive(wid) ) { /*Draw normal text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), LabG_NormalGC(lw), lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL); } else { /*Draw shadow for insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), LabG_ShadowGC(lw), lw->rectangle.x + LabG_TextRect(lw).x+1 + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y+1 + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL); /*Draw insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), LabG_InsensitiveGC(lw), lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL); } } #else XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__label(lw), (XtIsSensitive(wid) ? LabG_NormalGC(lw) : LabG_InsensitiveGC(lw)), lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_Alignment(lw), LayoutG(lw), NULL); #endif #ifndef FIX_1381 #ifdef USE_XFT if (!XtIsSensitive(wid)) { XSetFillStyle(XtDisplay(lw), LabG_InsensitiveGC(lw), FillStippled); XFillRectangle(XtDisplay(lw), XtWindow(lw), LabG_InsensitiveGC(lw), lw->rectangle.x + LabG_TextRect(lw).x + LabG_StringRect(lw).x, lw->rectangle.y + LabG_TextRect(lw).y + LabG_StringRect(lw).y, LabG_StringRect(lw).width, LabG_StringRect(lw).height); XSetFillStyle(XtDisplay(lw), LabG_InsensitiveGC(lw), FillOpaqueStippled); } #endif #endif } if (LabG__acceleratorText(lw) != NULL) { /* Since accelerator text is drawn by moving in from the right, * it is possible to overwrite label text when there is clipping, * Therefore draw accelerator text only if there is enough * room for everything */ if ((lw->rectangle.width) >= (2 * (lw->gadget.highlight_thickness + lw->gadget.shadow_thickness + LabG_MarginWidth(lw)) + LabG_MarginLeft(lw) + LabG_TextRect(lw).width + LabG_MarginRight(lw))) { #ifdef FIX_1381 if (XtIsSensitive(wid) ) { /*Draw normal text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__acceleratorText(lw), LabG_NormalGC(lw), lw->rectangle.x + LabG_AccTextRect(lw).x, lw->rectangle.y + LabG_AccTextRect(lw).y, LabG_AccTextRect(lw).width, XmALIGNMENT_END, LayoutG(lw), NULL); } else { /*Draw shadow for insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__acceleratorText(lw), LabG_ShadowGC(lw) , lw->rectangle.x + LabG_AccTextRect(lw).x+1, lw->rectangle.y + LabG_AccTextRect(lw).y+1, LabG_AccTextRect(lw).width, XmALIGNMENT_END, LayoutG(lw), NULL); /*Draw insensitive text*/ XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__acceleratorText(lw), LabG_InsensitiveGC(lw), lw->rectangle.x + LabG_AccTextRect(lw).x, lw->rectangle.y + LabG_AccTextRect(lw).y, LabG_AccTextRect(lw).width, XmALIGNMENT_END, LayoutG(lw), NULL); } #else XmStringDraw (XtDisplay(lw), XtWindow(lw), LabG_Font(lw), LabG__acceleratorText(lw), (XtIsSensitive(wid) ? LabG_NormalGC(lw) : LabG_InsensitiveGC(lw)), lw->rectangle.x + LabG_AccTextRect(lw).x, lw->rectangle.y + LabG_AccTextRect(lw).y, LabG_AccTextRect(lw).width, XmALIGNMENT_END, LayoutG(lw), NULL); #endif } } /* Redraw the proper highlight */ if (! LabG_IsMenupane(lw) && LabG_MenuType(lw) != XmMENU_BAR) { if (lw->gadget.highlighted) { (*((XmGadgetClass) XtClass(lw))->gadget_class.border_highlight) ((Widget) lw); } } } /************************************************************************ * * SetValues * This routine will take care of any changes that have been made * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues(Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmLabelGadget current = (XmLabelGadget) cw; XmLabelGadget req = (XmLabelGadget) rw; XmLabelGadget new_w = (XmLabelGadget) nw; Boolean flag = False; Boolean newstring = False; Boolean ProcessFlag = FALSE; Boolean CleanupFontFlag = FALSE; Boolean Call_Resize = False; XmMenuSystemTrait menuSTrait; /* Invalidate the basline cache if necessary. */ if ((LabG__label(new_w) != LabG__label(current)) || (LabG_Font(new_w) != LabG_Font(current))) { if (new_w->label.baselines) { XtFree ((char*) new_w->label.baselines); new_w->label.baselines = NULL; } } /* If the label has changed, make a copy of the new label, */ /* and free the old label. */ if (LabG__label(new_w)!= LabG__label(current)) { newstring = True; if (LabG__label(new_w) == NULL) { LabG__label(new_w) = XmStringCreateLocalized(XrmQuarkToString (current->object.xrm_name)); } else { if (XmeStringIsValid((XmString) LabG__label(new_w))) { LabG__label(new_w) = XmStringCopy((XmString) LabG__label(new_w)); } else { XmeWarning((Widget) new_w, CS_STRING_MESSAGE); LabG__label(new_w) = XmStringCreateLocalized(XrmQuarkToString(new_w->object.xrm_name)); } } XmStringFree(LabG__label(current)); LabG__label(current)= NULL; LabG__label(req)= NULL; } if (LabG_MarginRight(new_w) != LabG_MarginRight(current)) new_w->label.acc_right_delta = 0; if (LabG_MarginLeft(new_w) != LabG_MarginLeft(current)) new_w->label.acc_left_delta = 0; if ((LabG__acceleratorText(new_w) != LabG__acceleratorText(current)) && LabG_IsMenupane(new_w)) { /* BEGIN OSF Fix pir 1098 */ newstring = TRUE; /* END OSF Fix pir 1098 */ if (LabG__acceleratorText(new_w) != NULL) { if (XmeStringIsValid((XmString) LabG__acceleratorText(new_w))) { if ((XmIsCascadeButtonGadget(new_w)) && (LabG__acceleratorText(new_w) != NULL)) LabG__acceleratorText(new_w) = NULL; else LabG__acceleratorText(new_w) = XmStringCopy(LabG__acceleratorText(new_w)); XmStringFree(LabG__acceleratorText(current)); LabG__acceleratorText(current)= NULL; LabG__acceleratorText(req)= NULL; } else { XmeWarning((Widget) new_w, ACC_MESSAGE); LabG__acceleratorText(new_w) = NULL; XmStringFree(LabG__acceleratorText(current)); LabG__acceleratorText(current)= NULL; LabG__acceleratorText(req)= NULL; } } /* BEGIN OSF Fix pir 1098 */ else if (LabG__acceleratorText(current)) { /* CR 3481: Don't blindly force the margin back to 0; */ /* try to preserve the user specified value. */ if (LayoutIsRtoLG(new_w)) { LabG_MarginLeft(new_w) -= new_w->label.acc_left_delta; new_w->label.acc_left_delta = 0; } else { LabG_MarginRight(new_w) -= new_w->label.acc_right_delta; new_w->label.acc_right_delta = 0; } } /* END OSF Fix pir 1098 */ } else LabG__acceleratorText(new_w) = LabG__acceleratorText(current); if (LabG_Font(new_w) != LabG_Font(current)) { CleanupFontFlag = True; if (LabG_Font(new_w) == NULL) { /* CR 2990: let subclasses pick their own default fonts. */ LabG_Font(new_w) = XmeGetDefaultRenderTable((Widget) new_w, XmLABEL_FONTLIST); } LabG_Font(new_w) = XmFontListCopy (LabG_Font(new_w)); } /* Reinitialize the interesting input types. */ new_w->gadget.event_mask = XmHELP_EVENT; new_w->gadget.event_mask |= XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmBDRAG_EVENT; if ((LabG_MenuType(new_w) == XmMENU_POPUP) || (LabG_MenuType(new_w) == XmMENU_PULLDOWN) || (LabG_MenuType(new_w) == XmMENU_BAR)) new_w->gadget.highlight_thickness = 0; if (!XmRepTypeValidValue(XmRID_LABEL_TYPE, LabG_LabelType(new_w), (Widget) new_w)) { LabG_LabelType(new_w) = LabG_LabelType(current); } if (!XmRepTypeValidValue(XmRID_PIXMAP_PLACEMENT, LabG_PixmapPlacement(new_w), (Widget) new_w)) { LabG_PixmapPlacement(new_w) = LabG_PixmapPlacement(current); } if (LayoutG(new_w) != LayoutG(current)) { /* If no new margins specified swap them */ if ((LayoutIsRtoLG(current) != LayoutIsRtoLG(new_w)) && (LabG_MarginLeft(current) == LabG_MarginLeft(new_w)) && (LabG_MarginRight(current) == LabG_MarginRight(new_w))) { LabG_MarginLeft(new_w) = LabG_MarginRight(current); LabG_MarginRight(new_w) = LabG_MarginLeft(current); } flag = TRUE; } /* ValidateInputs(new_w); */ if (((LabG_IsText(new_w) || LabG_IsPixmapAndText(new_w)) && (newstring || (LabG_Font(new_w) != LabG_Font(current)))) || ((LabG_IsPixmap(new_w) || LabG_IsPixmapAndText(new_w)) && ((LabG_Pixmap(new_w) != LabG_Pixmap(current)) || (LabG_PixmapInsensitive(new_w) != LabG_PixmapInsensitive(current)) || /* When you have different sized pixmaps for sensitive and */ /* insensitive states and sensitivity changes, */ /* the right size is chosen. (osfP2560) */ (XtIsSensitive(nw) != XtIsSensitive(cw)))) || (LabG_IsPixmapAndText(new_w) && LabG_PixmapPlacement(new_w) != LabG_PixmapPlacement(current)) || (LabG_LabelType(new_w) != LabG_LabelType(current))) { /* CR 9179: back out CR 5419 changes. */ _XmCalcLabelGDimensions((Widget) new_w); if (LabG_RecomputeSize(new_w)) { if (req->rectangle.width == current->rectangle.width) new_w->rectangle.width = 0; if (req->rectangle.height == current->rectangle.height) new_w->rectangle.height = 0; } Call_Resize = True; flag = True; } if ((LabG_Alignment(new_w)!= LabG_Alignment(current)) || (LayoutG(new_w) != LayoutG(current))) { if (!XmRepTypeValidValue(XmRID_ALIGNMENT, LabG_Alignment(new_w), (Widget) new_w)) { LabG_Alignment(new_w) = LabG_Alignment(current); } Call_Resize = True; flag = True; } if ((LabG_MarginHeight(new_w) != LabG_MarginHeight(current)) || (LabG_MarginWidth(new_w) != LabG_MarginWidth(current)) || (LabG_MarginRight(new_w) != LabG_MarginRight(current)) || (LabG_MarginLeft(new_w)!= LabG_MarginLeft(current)) || (LabG_MarginTop(new_w)!= LabG_MarginTop(current)) || (LabG_MarginBottom(new_w)!= LabG_MarginBottom(current)) || (new_w->gadget.shadow_thickness != current->gadget.shadow_thickness) || (new_w->gadget.highlight_thickness != current->gadget.highlight_thickness) || ((new_w->rectangle.width <= 0) || (new_w->rectangle.height <= 0)) || (LabG_PixmapTextPadding(new_w) != LabG_PixmapTextPadding(current))) { if (LabG_RecomputeSize(new_w)) { if (req->rectangle.width == current->rectangle.width) new_w->rectangle.width = 0; if (req->rectangle.height == current->rectangle.height) new_w->rectangle.height = 0; } Call_Resize = True; flag = True; } /* Resize is called only if we need to calculate the dimensions or */ /* coordinates for the string. */ if (Call_Resize) { XtWidgetProc resize; _XmProcessLock(); resize = (((XmLabelGadgetClassRec *)(new_w->object.widget_class))-> rect_class.resize); _XmProcessUnlock(); (* (resize)) ((Widget) new_w); } /* If the sensitivity has changed then we must redisplay. */ if (XtIsSensitive(nw) != XtIsSensitive(cw)) { flag = True; } /* Force the traversal flag when in a menu. */ if ((XtClass(new_w) == xmLabelGadgetClass) && ((LabG_MenuType(new_w) == XmMENU_POPUP) || (LabG_MenuType(new_w) == XmMENU_PULLDOWN) || (LabG_MenuType(new_w) == XmMENU_OPTION))) { new_w->gadget.traversal_on = False; new_w->gadget.highlight_on_enter = False; } if (LabG_Font(new_w) != LabG_Font(current) || LabG_Foreground(new_w) != LabG_Foreground(current) || LabG_Background(new_w) != LabG_Background(current)) { /* Recreate the GC's if the font has been changed */ XtReleaseGC (XtParent (current), LabG_NormalGC(current)); XtReleaseGC (XtParent (current), LabG_InsensitiveGC(current)); SetNormalGC(new_w); flag = True; } /* * The test for foreground is done here to allow for subclasses * to use this gc in a graphix op that may reference the background * field of the GC (i.e. in this gc background is set to LabG_Foreground. */ if (LabG_Background(new_w) != LabG_Background(current) || LabG_Foreground(new_w) != LabG_Foreground(current)) { XtReleaseGC (XtParent (current), LabG_BackgroundGC(current)); _XmLabelSetBackgroundGC(new_w); flag = True; } if (LabG_TopShadowColor(new_w) != LabG_TopShadowColor(current) || LabG_TopShadowPixmap(new_w) != LabG_TopShadowPixmap(current)) { XtReleaseGC (XtParent (current), LabG_TopShadowGC(current)); LabG_TopShadowGC(new_w) = _XmGetPixmapBasedGC (XtParent(nw), LabG_TopShadowColor(new_w), LabG_Background(new_w), LabG_TopShadowPixmap(new_w)); flag = True; } if (LabG_BottomShadowColor(new_w) != LabG_BottomShadowColor(current) || LabG_BottomShadowPixmap(new_w) != LabG_BottomShadowPixmap(current)) { XtReleaseGC (XtParent (current), LabG_BottomShadowGC(current)); LabG_BottomShadowGC(new_w) = _XmGetPixmapBasedGC (XtParent(nw), LabG_BottomShadowColor(new_w), LabG_Background(new_w), LabG_BottomShadowPixmap(new_w)); flag = True; } if (LabG_HighlightColor(new_w) != LabG_HighlightColor(current) || LabG_HighlightPixmap(new_w) != LabG_HighlightPixmap(current)) { XtReleaseGC (XtParent (current), LabG_HighlightGC(current)); LabG_HighlightGC(new_w) = _XmGetPixmapBasedGC (XtParent(nw), LabG_HighlightColor(new_w), LabG_Background(new_w), LabG_HighlightPixmap(new_w)); flag = True; } if ((LabG_MenuType(new_w) != XmWORK_AREA) && (LabG_Mnemonic(new_w) != LabG_Mnemonic(current))) { /* New grabs only required if mnemonic changes */ ProcessFlag = TRUE; if (LabG_LabelType(new_w) == XmSTRING || LabG_LabelType(new_w) == XmPIXMAP_AND_STRING) flag = TRUE; } if (LabG_MnemonicCharset(new_w) != LabG_MnemonicCharset(current)) { if (LabG_MnemonicCharset(new_w)) LabG_MnemonicCharset(new_w) = _XmStringCharsetCreate(LabG_MnemonicCharset (new_w)); else LabG_MnemonicCharset(new_w) = _XmStringCharsetCreate(XmFONTLIST_DEFAULT_TAG); if (LabG_MnemonicCharset (current) != NULL) XtFree(LabG_MnemonicCharset(current)); if (LabG_LabelType(new_w) == XmSTRING || LabG_LabelType(new_w) == XmPIXMAP_AND_STRING) flag = TRUE; } if (LabG_IsMenupane(new_w) && (LabG_Accelerator(new_w) != LabG_Accelerator(current))) { if (LabG_Accelerator(new_w) != NULL) { /* Copy the accelerator into local space */ LabG_Accelerator(new_w) = XtNewString(LabG_Accelerator(new_w)); } if (LabG_Accelerator(current) != NULL) XtFree(LabG_Accelerator(current)); LabG_Accelerator(current) = NULL; LabG_Accelerator(req) = NULL; ProcessFlag = TRUE; } else LabG_Accelerator(new_w) = LabG_Accelerator(current); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(new_w)), XmQTmenuSystem); if (ProcessFlag && menuSTrait != NULL) menuSTrait->updateBindings((Widget)new_w, XmREPLACE); if (flag && (LabG_MenuType(new_w) == XmMENU_PULLDOWN) && menuSTrait != NULL) menuSTrait->updateHistory(XtParent(new_w), (Widget) new_w, True); if (CleanupFontFlag) if (LabG_Font(current)) XmFontListFree(LabG_Font(current)); return flag; } /* * So complications. HandleRedraw is a wrapper that calls _XmLabelGCVTRedraw * which does the work for the trait stuff. * * _XmLabelGCVTRedraw returns a boolean which determines if the child, not the * parent should be redrawn. * * This is done to serve as a form of inheritance. ToggleBG needs all the * LabelG stuff changed plus some of its own state. Therefore ToggleBG * will call _XmLabelGCVTRedraw. */ static Boolean HandleRedraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag) { Boolean redraw = False; XtExposeProc expose; /* Don't change with parent. New Gadget behavior has been enabled. */ redraw = _XmLabelGCVTRedraw (kid, cur_parent, new_parent, visual_flag); _XmProcessLock(); expose = ((XmLabelGadgetClassRec *)(XtClass(kid)))->rect_class.expose; _XmProcessUnlock(); if (redraw) { if (! XtIsRealized(kid)) { return redraw; } else { (* (expose)) ((Widget)kid, NULL, (Region) NULL); } } return False; } Boolean _XmLabelGCVTRedraw(Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag) { XmLabelGadget lw = (XmLabelGadget) kid; XmManagerWidget mw = (XmManagerWidget) new_parent; XmManagerWidget curmw = (XmManagerWidget) cur_parent; Boolean redraw = False, do_normal = False, do_background = False; XmLabelGCacheObjPart oldCopy; /* * Since we are here the instance record is going to be changed. * So break this out out the cache, make the changes and reinsert * below. */ _XmProcessLock(); _XmCacheCopy((XtPointer) LabG_Cache(lw), (XtPointer) &oldCopy, sizeof(XmLabelGCacheObjPart)); _XmCacheDelete ((XtPointer) LabG_Cache(lw)); _XmProcessUnlock(); LabG_Cache(lw) = &oldCopy; if ((visual_flag & VisualBackgroundPixel) && (LabG_Background(lw) == curmw->core.background_pixel)) { redraw = do_background = do_normal = True; LabG_Background(lw) = mw->core.background_pixel; } if (visual_flag & VisualBackgroundPixmap) { redraw = do_background = True; } if ((visual_flag & VisualForeground) && (LabG_Foreground(lw) == curmw->manager.foreground)) { redraw = do_normal = True; LabG_Foreground(lw) = mw->manager.foreground; } if (do_background) { XtReleaseGC (XtParent(lw), LabG_BackgroundGC(lw)); _XmLabelSetBackgroundGC((XmLabelGadget)lw); } if (do_normal) { XtReleaseGC (XtParent(lw), LabG_NormalGC(lw)); XtReleaseGC (XtParent(lw), LabG_InsensitiveGC(lw)); SetNormalGC((XmLabelGadget)lw); } if (visual_flag & (VisualTopShadowColor | VisualTopShadowPixmap)) { XtReleaseGC (XtParent(lw), LabG_TopShadowGC(lw)); if(LabG_TopShadowColor(lw) == curmw->manager.top_shadow_color) LabG_TopShadowColor(lw) = mw->manager.top_shadow_color; if(LabG_TopShadowPixmap(lw) == curmw->manager.top_shadow_pixmap && (LabG_TopShadowPixmap(lw) != XmUNSPECIFIED_PIXMAP || LabG_TopShadowColor(lw) == curmw->manager.top_shadow_color)) LabG_TopShadowPixmap(lw) = mw->manager.top_shadow_pixmap; LabG_TopShadowGC(lw) = _XmGetPixmapBasedGC (XtParent(lw), LabG_TopShadowColor(lw), LabG_Background(lw), LabG_TopShadowPixmap(lw)); redraw = True; } if (visual_flag & (VisualBottomShadowColor | VisualBottomShadowPixmap)) { XtReleaseGC (XtParent(lw), LabG_BottomShadowGC(lw)); if(LabG_BottomShadowColor(lw) == curmw->manager.bottom_shadow_color) LabG_BottomShadowColor(lw) = mw->manager.bottom_shadow_color; if(LabG_BottomShadowPixmap(lw) == curmw->manager.bottom_shadow_pixmap && (LabG_BottomShadowPixmap(lw) != XmUNSPECIFIED_PIXMAP || LabG_BottomShadowColor(lw) == curmw->manager.bottom_shadow_color)) LabG_BottomShadowPixmap(lw) = mw->manager.bottom_shadow_pixmap; LabG_BottomShadowGC(lw) = _XmGetPixmapBasedGC (XtParent(lw), LabG_BottomShadowColor(lw), LabG_Background(lw), LabG_BottomShadowPixmap(lw)); redraw = True; } if (visual_flag & (VisualHighlightColor | VisualHighlightPixmap)) { XtReleaseGC (XtParent(lw), LabG_HighlightGC(lw)); if(LabG_HighlightColor(lw) == curmw->manager.highlight_color) LabG_HighlightColor(lw) = mw->manager.highlight_color; if(LabG_HighlightPixmap(lw) == curmw->manager.highlight_pixmap && (LabG_HighlightPixmap(lw) != XmUNSPECIFIED_PIXMAP || LabG_HighlightColor(lw) == curmw->manager.highlight_color)) LabG_HighlightPixmap(lw) = mw->manager.highlight_pixmap; LabG_HighlightGC(lw) = _XmGetPixmapBasedGC (XtParent(lw), LabG_HighlightColor(lw), LabG_Background(lw), LabG_HighlightPixmap(lw)); redraw = True; } _XmProcessLock(); LabG_Cache(lw) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(lw), (XtPointer) LabG_Cache(lw), sizeof(XmLabelGCacheObjPart)); _XmProcessUnlock(); return redraw; } /************************************************************************ * * InputDispatch * This function catches input sent by a manager and dispatches it * to the individual routines. * ************************************************************************/ static void InputDispatch(Widget wid, XEvent *event, Mask event_mask) { XmLabelGadget lg = (XmLabelGadget) wid; if (event_mask & XmHELP_EVENT) Help ((Widget) lg, event); else if (event_mask & XmENTER_EVENT) _XmEnterGadget ((Widget) lg, event, NULL, NULL); else if (event_mask & XmLEAVE_EVENT) _XmLeaveGadget ((Widget) lg, event, NULL, NULL); else if (event_mask & XmFOCUS_IN_EVENT) _XmFocusInGadget ((Widget) lg, event, NULL, NULL); else if (event_mask & XmFOCUS_OUT_EVENT) _XmFocusOutGadget ((Widget) lg, event, NULL, NULL); else if (event_mask & XmBDRAG_EVENT) _XmProcessDrag ((Widget) lg, event, NULL, NULL); } /************************************************************************ * * Help * This routine is called if the user made a help selection * on the widget. * ************************************************************************/ static void Help(Widget w, XEvent *event) { XmLabelGadget lg = (XmLabelGadget) w; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(lg)), XmQTmenuSystem); if (LabG_IsMenupane(lg) && (menuSTrait != NULL)) menuSTrait->popdown(XtParent(lg), event); _XmSocorro(w, event, NULL, NULL); } /************************************************************************ * * GetLabelString * This is a get values hook function that returns the external * form of the label string from the internal form. * ***********************************************************************/ /*ARGSUSED*/ static void GetLabelString(Widget wid, int offset, XtArgVal *value) { XmLabelGadget lw = (XmLabelGadget) wid; XmString string; string = XmStringCopy(LabG__label(lw)); *value = (XtArgVal) string; } /************************************************************************ * * GetAccelerator * This is a get values hook function that returns a copy * of the accelerator string. * ***********************************************************************/ /*ARGSUSED*/ static void GetAccelerator(Widget wid, int offset, XtArgVal *value) { XmLabelGadget lw = (XmLabelGadget) wid; String string; string = XtNewString(LabG_Accelerator(lw)); *value = (XtArgVal) string; } /************************************************************************ * * GetAcceleratorText * This is a get values hook function that returns the external * form of the accelerator text from the internal form. * ***********************************************************************/ /*ARGSUSED*/ static void GetAcceleratorText(Widget wid, int offset, XtArgVal *value) { XmLabelGadget lw = (XmLabelGadget) wid; XmString string; string = XmStringCopy(LabG__acceleratorText(lw)); *value = (XtArgVal) string; } /************************************************************************ * * _XmStringCharsetCreate * ************************************************************************/ static XmStringCharSet _XmStringCharsetCreate(XmStringCharSet stringcharset) { return (XmStringCharSet) XtNewString((char*) stringcharset); } /************************************************************************ * * GetMnemonicCharset * This is a get values hook function that returns the external * form of the mnemonicCharset from the internal form. * : Returns a string containg the mnemonicCharset. * Caller must free the string . * ***********************************************************************/ /*ARGSUSED*/ static void GetMnemonicCharset(Widget wid, int resource, /* unused */ XtArgVal *value) { XmLabelGadget lw = (XmLabelGadget) wid; char *cset; int size; cset = NULL; if (LabG_MnemonicCharset (lw)) { size = strlen (LabG_MnemonicCharset (lw)); if (size > 0) cset = (char *) (_XmStringCharsetCreate(LabG_MnemonicCharset (lw))); } *value = (XtArgVal) cset; } /************************************************************************ * * Caching Assignment help * These routines are for manager widgets that go into Label's * fields and set them, instead of doing a SetValues. * ************************************************************************/ static XmLabelGCacheObjPart local_cache; static Boolean local_cache_inited = FALSE; /* * QualifyLabelLocalCache * Checks to see if local cache is set up */ static void QualifyLabelLocalCache(XmLabelGadget w) { if (!local_cache_inited) { local_cache_inited = TRUE; ClassCacheCopy(LabG_ClassCachePart(w)) (LabG_Cache(w), &local_cache, sizeof(local_cache)); } } /************************************************************************ * * _XmReCacheLabG() * Check to see if ReCaching is necessary as a result of fields having * been set by a mananger widget. This routine is called by the * manager widget in their SetValues after a change is made to any * of Label's cached fields. * ************************************************************************/ void _XmReCacheLabG(Widget wid) { XmLabelGadget lw = (XmLabelGadget) wid; _XmProcessLock(); if (local_cache_inited && (!_XmLabelCacheCompare((XtPointer)&local_cache, (XtPointer)LabG_Cache(lw)))) { /* Delete the old one. */ _XmCacheDelete((XtPointer) LabG_Cache(lw)); LabG_Cache(lw) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(lw), (XtPointer) &local_cache, sizeof(local_cache)); } local_cache_inited = FALSE; _XmProcessUnlock(); } void _XmAssignLabG_MarginHeight(XmLabelGadget lw, #if NeedWidePrototypes int value) #else Dimension value) #endif /* NeedWidePrototypes */ { _XmProcessLock(); QualifyLabelLocalCache(lw); local_cache.margin_height = value; _XmProcessUnlock(); } void _XmAssignLabG_MarginWidth(XmLabelGadget lw, #if NeedWidePrototypes int value) #else Dimension value) #endif /* NeedWidePrototypes */ { _XmProcessLock(); QualifyLabelLocalCache(lw); local_cache.margin_width = value; _XmProcessUnlock(); } void _XmAssignLabG_MarginLeft(XmLabelGadget lw, #if NeedWidePrototypes int value) #else Dimension value) #endif /* NeedWidePrototypes */ { _XmProcessLock(); QualifyLabelLocalCache(lw); local_cache.margin_left = value; _XmProcessUnlock(); } void _XmAssignLabG_MarginRight(XmLabelGadget lw, #if NeedWidePrototypes int value) #else Dimension value) #endif /* NeedWidePrototypes */ { _XmProcessLock(); QualifyLabelLocalCache(lw); local_cache.margin_right = value; _XmProcessUnlock(); } void _XmAssignLabG_MarginTop(XmLabelGadget lw, #if NeedWidePrototypes int value) #else Dimension value) #endif /* NeedWidePrototypes */ { _XmProcessLock(); QualifyLabelLocalCache(lw); local_cache.margin_top = value; _XmProcessUnlock(); } void _XmAssignLabG_MarginBottom(XmLabelGadget lw, #if NeedWidePrototypes int value) #else Dimension value) #endif /* NeedWidePrototypes */ { _XmProcessLock(); QualifyLabelLocalCache(lw); local_cache.margin_bottom = value; _XmProcessUnlock(); } /************************************************************************ * * SetGadgetActivateCallbackState * * This function is used as the method of the menuSavvy trait. It is * used by menu savvy parents to set whether or not the child will * invoke its own activate callback or whether it will defer to the * entryCallback of the parent. * ************************************************************************/ static void SetGadgetActivateCallbackState(Widget wid, XmActivateState state) { XmLabelGCacheObjPart localCache; _XmQualifyLabelLocalCache(&localCache, (XmLabelGadget)wid); switch (state) { case XmDISABLE_ACTIVATE: localCache.skipCallback = True; break; case XmENABLE_ACTIVATE: localCache.skipCallback = False; break; } _XmReCacheLabG_r(&localCache, (XmLabelGadget)wid); } /************************************************************************ * * SetOverrideCallback * * Used by subclasses. If this is set true, then there is a RowColumn * parent with the entryCallback resource set. The subclasses do not * do their activate callbacks, instead the RowColumn callbacks are called * by RowColumn. ************************************************************************/ /*ARGSUSED*/ static void SetOverrideCallback( Widget w) { XmLabelGCacheObjPart localCache; _XmQualifyLabelLocalCache(&localCache, (XmLabelGadget)w); localCache.skipCallback= True; _XmReCacheLabG_r(&localCache, (XmLabelGadget)w); } /************************************************************************ * * XmCreateLabelGadget() * XmVaCreateLabelGadget() * XmVaCreateManagedLabelGadget() * * Externally accessable function for creating a label gadget. * ************************************************************************/ Widget XmCreateLabelGadget(Widget parent, char *name, Arg *arglist, Cardinal argCount) { return XtCreateWidget(name, xmLabelGadgetClass, parent, arglist, argCount); } Widget XmVaCreateLabelGadget( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmLabelGadgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedLabelGadget( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmLabelGadgetClass, parent, True, var, count); va_end(var); return w; } /* * GetLabelBGClassSecResData () * Class function to be called to copy secondary resource for external * use. i.e. copy the cached resources and send it back. */ /*ARGSUSED*/ static Cardinal GetLabelBGClassSecResData(WidgetClass w_class, XmSecondaryResourceData **data_rtn) { int arrayCount; XmBaseClassExt bcePtr; String resource_class, resource_name; XtPointer client_data; _XmProcessLock(); bcePtr = &(labelBaseClassExtRec); client_data = NULL; resource_class = NULL; resource_name = NULL; arrayCount = _XmSecondaryResourceData(bcePtr, data_rtn, client_data, resource_name, resource_class, GetLabelClassResBase); _XmProcessUnlock(); return arrayCount; } /* * GetLabelClassResBase () * retrun the address of the base of resources. * - Not yet implemented. */ /*ARGSUSED*/ static XtPointer GetLabelClassResBase(Widget widget, XtPointer client_data) /* unused */ { XtPointer widgetSecdataPtr; int labg_cache_size = sizeof(XmLabelGCacheObjPart); char *cp; widgetSecdataPtr = (XtPointer) (XtMalloc (labg_cache_size +1)); _XmProcessLock(); if (widgetSecdataPtr) { cp = (char *) widgetSecdataPtr; memcpy(cp, LabG_Cache(widget), labg_cache_size); } _XmProcessUnlock(); return widgetSecdataPtr; } /*ARGSUSED*/ static void SetValuesAlmost(Widget cw, /* unused */ Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply) { XmLabelGadget new_w = (XmLabelGadget) nw; XtWidgetProc resize; _XmProcessLock(); resize = ((XmLabelGadgetClassRec *)(new_w->object.widget_class))-> rect_class.resize; _XmProcessUnlock(); (* (resize)) ((Widget) new_w); *request = *reply; } static void GetColors(Widget w, XmAccessColorData color_data) { if (LabG_Cache(w)) { color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor; color_data->background = LabG_Background(w); color_data->foreground = LabG_Foreground(w); color_data->highlight_color = LabG_HighlightColor(w); color_data->top_shadow_color = LabG_TopShadowColor(w); color_data->bottom_shadow_color = LabG_BottomShadowColor(w); } else { color_data->valueMask = AccessColorInvalid; } } /************************************************************************ * * XmLabelGadgetGetBaselines * * A Class function which when called returns True, if the widget has * a baseline and also determines the number of pixels from the y * origin to the first line of text and assigns it to the variable * being passed in. * ************************************************************************/ static Boolean XmLabelGadgetGetBaselines(Widget wid, Dimension **baselines, int *line_count) { XmLabelGadget lw = (XmLabelGadget)wid; Cardinal count; int delta; if (LabG_IsPixmap(wid)) return False; /* Compute raw baselines if unavailable. */ if (lw->label.baselines == NULL) { _XmStringGetBaselines(LabG_Font(lw), LabG__label(lw), &(lw->label.baselines), &count); assert(lw->label.baselines != NULL); /* Store the current offset in an extra location. */ lw->label.baselines = (Dimension*) XtRealloc((char*) lw->label.baselines, (count+1) * sizeof(Dimension)); lw->label.baselines[count] = 0; } else { count = XmStringLineCount(LabG__label(lw)); } /* Readjust offsets if necessary. */ delta = LabG_TextRect_y(lw) - lw->label.baselines[count]; if (delta) { int tmp; for (tmp = 0; tmp <= count; tmp++) lw->label.baselines[tmp] += delta; } /* Copy the cached data. */ *line_count = count; *baselines = (Dimension*) XtMalloc(*line_count * sizeof(Dimension)); memcpy((char*) *baselines, (char*) lw->label.baselines, *line_count * sizeof(Dimension)); return True; } /************************************************************************ * * XmLabelGadgetGetDisplayRect * * A Class function which returns true if the widget being passed in * has a display rectangle associated with it. It also determines the * x,y coordinates of the character cell or pixmap relative to the origin * and the width and height in pixels of the smallest rectangle that encloses * the text or pixmap. This is assigned to the variable being passed in * ***********************************************************************/ static Boolean XmLabelGadgetGetDisplayRect(Widget w, XRectangle *displayrect) { XmLabelGadget wid = (XmLabelGadget) w; displayrect->x = wid->label.TextRect.x; displayrect->y = wid->label.TextRect.y; displayrect->width = wid->label.TextRect.width; displayrect->height = wid->label.TextRect.height; return TRUE; } /************************************************************************ * * XmLabelGadgetMarginsProc * ***********************************************************************/ /* ARGSUSED */ static void XmLabelGadgetMarginsProc(Widget w, XmBaselineMargins *margins_rec) { XmLabelGCacheObjPart localCache; if (margins_rec->get_or_set == XmBASELINE_SET) { _XmQualifyLabelLocalCache(&localCache, (XmLabelGadget)w); _XmAssignLabG_MarginTop_r((&localCache), margins_rec->margin_top); _XmAssignLabG_MarginBottom_r((&localCache), margins_rec->margin_bottom); _XmReCacheLabG_r(&localCache, (XmLabelGadget)w); } else { margins_rec->margin_top = LabG_MarginTop(w); margins_rec->margin_bottom = LabG_MarginBottom(w); margins_rec->shadow = LabG_Shadow(w); margins_rec->highlight = LabG_Highlight(w); margins_rec->text_height = LabG_TextRect_height(w); margins_rec->margin_height = LabG_MarginHeight(w); } } static Widget GetPixmapDragIcon(Widget w) { XmLabelGadget lw = (XmLabelGadget) w; Arg args[10]; int n = 0; Widget drag_icon; Widget screen_object = XmGetXmScreen(XtScreen(w)); unsigned int wid, hei; int d; /* it's a labelPixmap, use directly the pixmap */ XmeGetPixmapData(XtScreen(lw), Pix(lw), NULL, &d, NULL, NULL, NULL, NULL, &wid, &hei); n = 0; XtSetArg(args[n], XmNhotX, 0), n++; XtSetArg(args[n], XmNhotY, 0), n++; XtSetArg(args[n], XmNwidth, wid), n++; XtSetArg(args[n], XmNheight, hei), n++; XtSetArg(args[n], XmNmaxWidth, wid), n++; XtSetArg(args[n], XmNmaxHeight, hei), n++; XtSetArg(args[n], XmNdepth, d), n++; XtSetArg(args[n], XmNpixmap, Pix(lw)), n++; XtSetArg(args[n], XmNforeground, LabG_Background(lw)), n++; XtSetArg(args[n], XmNbackground, LabG_Foreground(lw)), n++; assert(n <= XtNumber(args)); drag_icon = XtCreateWidget("drag_icon", xmDragIconObjectClass, screen_object, args, n); return drag_icon; } /*ARGSUSED*/ void _XmProcessDrag(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmLabelGadget lw = (XmLabelGadget) w; Widget drag_icon; Arg args[10]; int n; XmManagerWidget mw; Time _time = _XmGetDefaultTime(w, event); XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); mw = (XmManagerWidget) XtParent(lw); if (LabG_IsMenupane(w)) XAllowEvents(XtDisplay(mw), SyncPointer, _time); /* Disallow drag if this is a cascade button and armed - Hack alert */ if (XmIsCascadeButtonGadget(w) && CBG_IsArmed(w)) return; /* CDE - allow user to not drag labels and label subclasses also, disable drag if enable_btn1_transfer is set to BUTTON2_ADJUST and the trigger was button2 */ if (! dpy -> display.enable_unselectable_drag || (dpy -> display.enable_btn1_transfer == XmBUTTON2_ADJUST && event && event -> xany.type == ButtonPress && event -> xbutton.button == 2)) return; n = 0; XtSetArg(args[n], XmNcursorBackground, LabG_Background(lw)), n++; XtSetArg(args[n], XmNcursorForeground, LabG_Foreground(lw)), n++; /* If it's a labelPixmap, only specify the pixmap icon */ if (LabG_IsPixmap(lw) && (Pix(lw) != XmUNSPECIFIED_PIXMAP)) { drag_icon = GetPixmapDragIcon(w); XtSetArg(args[n], XmNsourcePixmapIcon, drag_icon), n++; } else { drag_icon = XmeGetTextualDragIcon(w); XtSetArg(args[n], XmNsourceCursorIcon, drag_icon), n++; } XtSetArg(args[n], XmNdragOperations, XmDROP_COPY), n++; (void) XmeDragSource(w, NULL, event, args, n); } /* * XmRCallProc routine for checking label.font before setting it to NULL * If "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmLabelGadget lw = (XmLabelGadget)wid; /* Check if been here before */ if (lw->label.check_set_render_table) value->addr = NULL; else { lw->label.check_set_render_table = True; value->addr = (char*)&(lw->label.font); } } /************************************************************************** * FromPaddingPixels * * Converts from pixels to current unit type does either horiz or vert * depending on icon placement. * widget - the icon button widget. * offset, value - passed to correct function based on orientation. **************************************************************************/ static void FromPaddingPixels(Widget widget, int offset, XtArgVal *value) { switch(LabG_PixmapPlacement(widget)) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: XmeFromVerticalPixels(widget, offset, value); break; default: /* everything else is horiz. */ XmeFromHorizontalPixels(widget, offset, value); break; } } /************************************************************************** * ToPaddingPixels * * Converts from pixels to current unit type does either horiz or vert * depending on icon placement. * widget - the icon button widget. * offset, value - passed to correct function based on orientation. * Returns the import order from _XmTo{Horizontal, Vertical}Pixels. **************************************************************************/ static XmImportOperator ToPaddingPixels(Widget widget, int offset, XtArgVal *value) { switch(LabG_PixmapPlacement(widget)) { case XmPIXMAP_TOP: case XmPIXMAP_BOTTOM: return(XmeToVerticalPixels(widget, offset, value)); default: return(XmeToHorizontalPixels(widget, offset, value)); } } static char* GetLabelGadgetAccelerator(Widget w) { if (XtClass(w) == xmLabelGadgetClass) return NULL; else return LabG_Accelerator(w); } static KeySym GetLabelGadgetMnemonic(Widget w) { if (XtClass(w) == xmLabelGadgetClass) return XK_VoidSymbol; else return LabG_Mnemonic(w); } void _XmQualifyLabelLocalCache( XmLabelGCacheObjPart *local_cache, XmLabelGadget w) { _XmProcessLock(); ClassCacheCopy(LabG_ClassCachePart(w)) (LabG_Cache(w), local_cache, sizeof(XmLabelGCacheObjPart) ); _XmProcessUnlock(); } void _XmReCacheLabG_r(XmLabelGCacheObjPart *local_cache, XmLabelGadget w) { _XmProcessLock(); if (!_XmLabelCacheCompare(local_cache, (XtPointer)LabG_Cache(w))) { _XmCacheDelete((XtPointer)LabG_Cache(w)); LabG_Cache(w) = (XmLabelGCacheObjPart *)_XmCachePart( LabG_ClassCachePart(w), local_cache, sizeof(XmLabelGCacheObjPart)); } _XmProcessUnlock(); } motif-2.3.8/lib/Xm/BaseClassI.h0000644000175000017500000000540612672140200013036 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: BaseClassI.h /main/6 1995/07/14 10:10:58 drk $ */ #ifndef _XmBaseClassI_h #define _XmBaseClassI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmPushWidgetExtData( Widget widget, XmWidgetExtData data, #if NeedWidePrototypes unsigned int extType) ; #else unsigned char extType) ; #endif /* NeedWidePrototypes */ extern void _XmPopWidgetExtData( Widget widget, XmWidgetExtData *dataRtn, #if NeedWidePrototypes unsigned int extType) ; #else unsigned char extType) ; #endif /* NeedWidePrototypes */ extern XmWidgetExtData _XmGetWidgetExtData( Widget widget, #if NeedWidePrototypes unsigned int extType) ; #else unsigned char extType) ; #endif /* NeedWidePrototypes */ extern void _XmInitializeExtensions( void ) ; extern void _XmTransformSubResources( XtResourceList comp_resources, Cardinal num_comp_resources, XtResourceList *resources, Cardinal *num_resources) ; extern Cardinal _XmSecondaryResourceData( XmBaseClassExt bcePtr, XmSecondaryResourceData **secResDataRtn, XtPointer client_data, String name, String class_name, XmResourceBaseProc basefunctionpointer) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmBaseClassI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MessageB.c0000644000175000017500000015175513145162623012570 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: MessageB.c /main/18 1999/10/13 16:17:09 mgreess $" #endif #endif #include #include /* for XmAccessColorDataRec */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* for the default display */ #include #include "BulletinBI.h" #include "GeoUtilsI.h" #include "ImageCachI.h" #include "MessageBI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "TraversalI.h" #include "XmI.h" #include "ScreenI.h" /* convenience macros */ #define Double(d) ((d) << 1) #define TotalWidth(w) ((w)->core.width + Double ((w)->core.border_width)) #define TotalHeight(w) ((w)->core.height + Double ((w)->core.border_width)) #define BottomEdge(w) ((w)->core.y + TotalHeight (w)) #define IsButton(w) \ (((XtPointer) XmeTraitGet((XtPointer) XtClass(w), XmQTactivatable) != NULL)) #define IsAutoChild(mb, w) ( \ (w) == mb->message_box.symbol_wid || \ (w) == mb->message_box.message_wid || \ (w) == mb->message_box.separator || \ (w) == mb->message_box.ok_button || \ (w) == mb->bulletin_board.cancel_button || \ (w) == mb->message_box.help_button) #define ARG_LIST_CNT 25 #define PIXMAP_LIST_MOD 6 /* defines for warning message */ #define WARNING4 _XmMMsgMessageB_0003 #define WARNING5 _XmMMsgMessageB_0004 /******** Static Function Declarations ********/ static XImage * CreateDefaultImage( char *bits, unsigned int width, unsigned int height) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Destroy( Widget wid) ; static void DeleteChild( Widget child) ; static void MessageCallback( Widget w, XtPointer closure, XtPointer call_data) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void SetUpSymbol( XmMessageBoxWidget w) ; static void SetUpMessage( XmMessageBoxWidget w) ; static void CreateWidgets( XmMessageBoxWidget w) ; static Widget CreateDialog( Widget parent, char *name, ArgList al, int ac, #if NeedWidePrototypes unsigned int type) ; #else unsigned char type) ; #endif /* NeedWidePrototypes */ static void GetMessageString( Widget wid, int resource_offset, XtArgVal *value) ; static void GetSymbolPixmap( Widget wid, int resource_offset, XtArgVal *value) ; static void GetOkLabelString( Widget wid, int resource_offset, XtArgVal *value) ; static void GetCancelLabelString( Widget wid, int resource_offset, XtArgVal *value) ; static void GetHelpLabelString( Widget wid, int resource_offset, XtArgVal *value) ; static void GetMsgBoxPixmap( XmMessageBoxWidget mBox) ; /******** End Static Function Declarations ********/ /* Resource definitions, "get resources" first */ static XmSyntheticResource syn_resources[] = { { XmNmessageString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.message_string), GetMessageString, NULL}, { XmNsymbolPixmap, sizeof (Pixmap), XtOffsetOf( struct _XmMessageBoxRec, message_box.symbol_pixmap), GetSymbolPixmap, NULL}, { XmNokLabelString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.ok_label_string), GetOkLabelString, NULL}, { XmNcancelLabelString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.cancel_label_string), GetCancelLabelString, NULL}, { XmNhelpLabelString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.help_label_string), GetHelpLabelString, NULL}, }; static XtResource resources[] = { { XmNdialogType, XmCDialogType, XmRDialogType, sizeof(unsigned char), XtOffsetOf( struct _XmMessageBoxRec, message_box.dialog_type), XmRImmediate, (XtPointer) XmDIALOG_MESSAGE}, { XmNminimizeButtons, XmCMinimizeButtons, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmMessageBoxRec, message_box.minimize_buttons), XmRImmediate, (XtPointer) False}, { XmNdefaultButtonType, XmCDefaultButtonType, XmRDefaultButtonType, sizeof(unsigned char), XtOffsetOf( struct _XmMessageBoxRec, message_box.default_type), XmRImmediate, (XtPointer) XmDIALOG_OK_BUTTON}, { XmNmessageString, XmCXmString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.message_string), XmRXmString, NULL}, { XmNmessageAlignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf( struct _XmMessageBoxRec, message_box.message_alignment), XmRImmediate, (XtPointer) XmALIGNMENT_BEGINNING}, { XmNsymbolPixmap, XmCPixmap, XmRDynamicPixmap, sizeof (Pixmap), XtOffsetOf( struct _XmMessageBoxRec, message_box.symbol_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP}, { XmNokLabelString, XmCXmString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.ok_label_string), XmRXmString, NULL}, /* "OK" default dynamically set from label name */ { XmNokCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmMessageBoxRec, message_box.ok_callback), XmRCallback, NULL}, { XmNcancelLabelString, XmCXmString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.cancel_label_string), XmRXmString, NULL}, /* "Cancel" default dynamically set from label name */ { XmNcancelCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmMessageBoxRec, message_box.cancel_callback), XmRCallback, NULL}, { XmNhelpLabelString, XmCXmString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmMessageBoxRec, message_box.help_label_string), XmRXmString, NULL}, /* "Help" default dynamically set from label name */ }; /**************************************************************** * * Full class record constant * ****************************************************************/ externaldef( xmmessageboxclassrec) XmMessageBoxClassRec xmMessageBoxClassRec = { { /* core_class fields */ (WidgetClass) &xmBulletinBoardClassRec, /* superclass */ "XmMessageBox", /* class_name */ sizeof(XmMessageBoxRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_init */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ FALSE, /* compress_enterlv */ FALSE, /* visible_interest */ Destroy, /* destroy */ XtInheritResize, /* resize */ XtInheritExpose, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ XtInheritAcceptFocus, /* enter_focus */ XtVersion, /* version */ NULL, /* callback_private */ XtInheritTranslations, /* tm_table */ XtInheritQueryGeometry, /* query_geometry */ NULL, /* display_accelerator*/ NULL, /* extension */ }, { /* composite_class fields */ XtInheritGeometryManager, /* geometry_manager */ XtInheritChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ NULL, /* resource list */ 0, /* num resources */ sizeof(XmManagerConstraintRec), /* constraint size */ NULL, /* init proc */ NULL, /* destroy proc */ NULL, /* set values proc */ NULL, /* extension */ }, { /* manager_class fields */ XmInheritTranslations, /* translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* bulletinBoard class */ TRUE, /*always_install_accelerators*/ _XmMessageBoxGeoMatrixCreate, /* geo__matrix_create */ XmInheritFocusMovedProc, /* focus_moved_proc */ NULL /* extension */ }, { /* messageBox class */ (XtPointer) NULL /* extension */ } }; externaldef( xmmessageboxwidgetclass) WidgetClass xmMessageBoxWidgetClass = (WidgetClass) &xmMessageBoxClassRec ; /************************************************************************ * Bitmap Data for Default Symbol **********************************<->***********************************/ static XmConst unsigned char errorBits[] = { 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0xf0, 0x3a, 0x00, 0x58, 0x55, 0x00, 0x2c, 0xa0, 0x00, 0x56, 0x40, 0x01, 0xaa, 0x80, 0x02, 0x46, 0x81, 0x01, 0x8a, 0x82, 0x02, 0x06, 0x85, 0x01, 0x0a, 0x8a, 0x02, 0x06, 0x94, 0x01, 0x0a, 0xe8, 0x02, 0x14, 0x50, 0x01, 0x28, 0xb0, 0x00, 0xd0, 0x5f, 0x00, 0xa0, 0x2a, 0x00, 0x40, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char infoBits[] = { 0x00, 0x00, 0x78, 0x00, 0x54, 0x00, 0x2c, 0x00, 0x54, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x2a, 0x00, 0x5c, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0xae, 0x01, 0x56, 0x01, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char questionBits[] = { 0xf0, 0x3f, 0x00, 0x58, 0x55, 0x00, 0xac, 0xaa, 0x00, 0xd6, 0x5f, 0x01, 0xea, 0xbf, 0x02, 0xf6, 0x7f, 0x01, 0xea, 0xba, 0x02, 0xf6, 0x7d, 0x05, 0xea, 0xba, 0x0a, 0x56, 0x7d, 0x15, 0xaa, 0xbe, 0x1e, 0x56, 0x5f, 0x01, 0xac, 0xaf, 0x02, 0x58, 0x57, 0x01, 0xb0, 0xaf, 0x00, 0x60, 0x55, 0x01, 0xa0, 0xaa, 0x00, 0x60, 0x17, 0x00, 0xa0, 0x2f, 0x00, 0x60, 0x17, 0x00, 0xb0, 0x2a, 0x00, 0x50, 0x55, 0x00}; static XmConst unsigned char warningBits[] = { 0x00, 0x00, 0x18, 0x00, 0x2c, 0x00, 0x56, 0x00, 0x2a, 0x00, 0x56, 0x00, 0x2a, 0x00, 0x56, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00}; static XmConst unsigned char workingBits[] = { 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0xaa, 0xaa, 0x0a, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x84, 0x15, 0x06, 0x8c, 0x2a, 0x02, 0x04, 0x15, 0x06, 0x0c, 0x0a, 0x02, 0x04, 0x06, 0x06, 0x0c, 0x0b, 0x02, 0x84, 0x15, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xfe, 0xff, 0x0f, 0x56, 0x55, 0x05, 0x00, 0x00, 0x00}; /**************************************************************** * Create a default images for symbol... used in ClassInitialize. ****************/ static XImage * CreateDefaultImage( char *bits, unsigned int width, unsigned int height ) { XImage * image ; Display * display = _XmGetDefaultDisplay() ; /* we don't have one here */ _XmCreateImage(image, display, bits, width, height, LSBFirst); return( image) ; } /****************************************************************/ static void ClassInitialize( void ) { XImage *image; /****************/ /* create and install the default images for the symbol */ image = CreateDefaultImage ((char *)errorBits, 20, 20); XmInstallImage (image, "default_xm_error"); image = CreateDefaultImage ((char *)infoBits, 11, 24); XmInstallImage (image, "default_xm_information"); image = CreateDefaultImage ((char *)questionBits, 22, 22); XmInstallImage (image, "default_xm_question"); image = CreateDefaultImage ((char *)warningBits, 9, 22); XmInstallImage (image, "default_xm_warning"); image = CreateDefaultImage ((char *)workingBits, 21, 23); XmInstallImage (image, "default_xm_working"); return ; } /****************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { /****************/ _XmFastSubclassInit (wc, XmMESSAGE_BOX_BIT); return ; } /**************************************************************** * MessageBox widget specific initialization ****************/ /*ARGSUSED*/ static void Initialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmMessageBoxWidget new_w = (XmMessageBoxWidget) nw ; Widget defaultButton ; /****************/ new_w->message_box.message_wid = NULL; new_w->message_box.symbol_wid = NULL; new_w->message_box.separator = NULL; new_w->message_box.ok_button = NULL; new_w->bulletin_board.cancel_button = NULL; new_w->message_box.help_button = NULL; new_w->bulletin_board.default_button = NULL; new_w->message_box.internal_pixmap = FALSE ; if( !XmRepTypeValidValue( XmRID_DIALOG_TYPE, new_w->message_box.dialog_type, (Widget) new_w) ) { new_w->message_box.dialog_type = XmDIALOG_MESSAGE ; } if( !XmRepTypeValidValue( XmRID_ALIGNMENT, new_w->message_box.message_alignment, (Widget) new_w) ) { new_w->message_box.message_alignment = XmALIGNMENT_BEGINNING ; } CreateWidgets( new_w) ; if( !XmRepTypeValidValue( XmRID_DEFAULT_BUTTON_TYPE, new_w->message_box.default_type, (Widget) new_w) ) { new_w->message_box.default_type = XmDIALOG_OK_BUTTON ; } switch( new_w->message_box.default_type ) { case XmDIALOG_CANCEL_BUTTON: { defaultButton = new_w->bulletin_board.cancel_button ; break ; } case XmDIALOG_HELP_BUTTON: { defaultButton = new_w->message_box.help_button ; break ; } case XmDIALOG_OK_BUTTON: { defaultButton = new_w->message_box.ok_button ; break ; } default: { defaultButton = NULL ; } } if( defaultButton ) { BB_DefaultButton( new_w) = defaultButton ; new_w->manager.initial_focus = defaultButton ; _XmBulletinBoardSetDynDefaultButton( (Widget) new_w, defaultButton) ; } return ; } /**************************************************************** * Destroy the widget specific data structs ****************/ static void Destroy( Widget wid ) { XmMessageBoxWidget d = (XmMessageBoxWidget) wid ; /****************/ if( (d->message_box.symbol_pixmap != XmUNSPECIFIED_PIXMAP) && d->message_box.internal_pixmap ) { XmDestroyPixmap( d->core.screen, d->message_box.symbol_pixmap) ; } return ; } /**************************************************************** * Set the widget id to NULL for the child widget being destroyed. ****************/ static void DeleteChild( Widget child ) { XmMessageBoxWidget mbox ; XtWidgetProc delete_child; /****************/ if( XtIsRectObj( child) ) { mbox = (XmMessageBoxWidget) XtParent( child) ; /* Check for which child is getting destroyed and set to NULL. */ if( child == mbox->message_box.message_wid ) { mbox->message_box.message_wid = NULL ; } else { if( child == mbox->message_box.symbol_wid ) { mbox->message_box.symbol_wid = NULL ; } else { if( child == mbox->message_box.ok_button ) { mbox->message_box.ok_button = NULL ; } else { if( child == mbox->message_box.help_button ) { mbox->message_box.help_button = NULL ; } else { if( child == mbox->message_box.separator ) { mbox->message_box.separator = NULL ; } } } } } } _XmProcessLock(); delete_child = ((XmBulletinBoardWidgetClass) xmBulletinBoardWidgetClass) ->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child) ; return ; } /****************************************************************/ static void MessageCallback( Widget w, XtPointer closure, XtPointer call_data ) { XmMessageBoxWidget tag = (XmMessageBoxWidget) closure ; XmAnyCallbackStruct temp; /****************/ if (call_data) { temp.reason = ((XmAnyCallbackStruct *) call_data)->reason; temp.event = ((XmAnyCallbackStruct *) call_data)->event; } else { temp.reason = 0; temp.event = NULL; } if (tag->message_box.ok_button == w) { temp.reason = XmCR_OK; XtCallCallbackList ((Widget) tag, tag->message_box.ok_callback, &temp); } else if (tag->bulletin_board.cancel_button == w) { temp.reason = XmCR_CANCEL; XtCallCallbackList ((Widget) tag, tag->message_box.cancel_callback, &temp); } else if (tag->message_box.help_button == w) { temp.reason = XmCR_HELP; XtCallCallbackList ((Widget) tag, tag->manager.help_callback, &temp); } return ; } /**************************************************************** * Set attributes of a message widget ****************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmMessageBoxWidget current = (XmMessageBoxWidget) cw ; XmMessageBoxWidget new_w = (XmMessageBoxWidget) nw ; Arg al[ARG_LIST_CNT] ; /* arg list */ Cardinal ac ; /* arg list count */ Boolean need_layout = FALSE ; Boolean newPixmap = FALSE ; Widget defaultButton ; /****************/ /* "in_set_values" means the GeometryManager won't try to resize * and/or re-layout subwidgets. */ BB_InSetValues( new_w) = True; /* fix for CR 5895 */ if( !new_w->message_box.symbol_pixmap ) { new_w->message_box.symbol_pixmap = XmUNSPECIFIED_PIXMAP ; } /* Over-ride BBoard to disallow a direct change of button id's * unless it's a template dialog. For those, if you can't set it * here then you can never set it. */ if ( ( current->message_box.dialog_type != XmDIALOG_TEMPLATE ) && ( current->bulletin_board.cancel_button != new_w->bulletin_board.cancel_button ) ) { new_w->bulletin_board.cancel_button = current->bulletin_board.cancel_button; XmeWarning( (Widget) new_w, WARNING5); } if( (current->message_box.dialog_type != new_w->message_box.dialog_type) && !XmRepTypeValidValue( XmRID_DIALOG_TYPE, new_w->message_box.dialog_type, (Widget) new_w) ) { new_w->message_box.dialog_type = current->message_box.dialog_type ; } if( new_w->message_box.symbol_pixmap != current->message_box.symbol_pixmap ) { newPixmap = TRUE ; new_w->message_box.internal_pixmap = FALSE ; if( (current->message_box.symbol_pixmap != XmUNSPECIFIED_PIXMAP) && current->message_box.internal_pixmap ) { XmDestroyPixmap( current->core.screen, current->message_box.symbol_pixmap) ; } } else { /* If symbol pixmap is unchanged and a new dialog type is specified, * then set to default pixmap. */ if( new_w->message_box.dialog_type != current->message_box.dialog_type ) { newPixmap = TRUE ; GetMsgBoxPixmap( new_w) ; if( (current->message_box.symbol_pixmap != XmUNSPECIFIED_PIXMAP) && current->message_box.internal_pixmap ) { XmDestroyPixmap( current->core.screen, current->message_box.symbol_pixmap) ; } } } if( newPixmap ) { need_layout = TRUE ; /* CR 7596, create child widget if needed */ if( ! new_w->message_box.symbol_wid ) { SetUpSymbol(new_w); XtManageChild(new_w->message_box.symbol_wid); } ac = 0 ; XtSetArg( al[ac], XmNlabelPixmap, new_w->message_box.symbol_pixmap) ; ++ac ; XtSetValues( new_w->message_box.symbol_wid, al, ac) ; } /* Check the buttons and labels */ ac = 0 ; if( new_w->message_box.message_string ) { XtSetArg( al[ac], XmNlabelString, new_w->message_box.message_string) ; ++ac ; XtSetArg( al[ac], XmNstringDirection, BB_StringDirection( new_w)) ; ++ac ; new_w->message_box.message_string = NULL ; need_layout = TRUE ; } if( current->message_box.message_alignment != new_w->message_box.message_alignment ) { if( !XmRepTypeValidValue( XmRID_ALIGNMENT, new_w->message_box.message_alignment, (Widget) new_w) ) { new_w->message_box.message_alignment = current->message_box.message_alignment ; } else { XtSetArg( al[ac], XmNalignment, new_w->message_box.message_alignment) ; ++ac ; need_layout = TRUE ; } } if( ac ) { /* CR 7596, create message widget if not there */ if ( ! new_w->message_box.message_wid ) { SetUpMessage(new_w); XtManageChild(new_w->message_box.message_wid); } XtSetValues( new_w->message_box.message_wid, al, ac) ; } if( new_w->message_box.ok_label_string ) { if( new_w->message_box.ok_button ) { ac = 0 ; XtSetArg( al[ac], XmNlabelString, new_w->message_box.ok_label_string) ; ++ac ; XtSetArg( al[ac], XmNstringDirection, BB_StringDirection( new_w)) ; ++ac ; XtSetValues( new_w->message_box.ok_button, al, ac) ; } new_w->message_box.ok_label_string = NULL ; need_layout = TRUE ; } if( new_w->message_box.cancel_label_string ) { if( new_w->bulletin_board.cancel_button ) { ac = 0 ; XtSetArg( al[ac], XmNlabelString, new_w->message_box.cancel_label_string) ; ++ac ; XtSetArg( al[ac], XmNstringDirection, BB_StringDirection( new_w)) ; ++ac ; XtSetValues( new_w->bulletin_board.cancel_button, al, ac) ; } new_w->message_box.cancel_label_string = NULL ; need_layout = TRUE ; } if( new_w->message_box.help_label_string ) { if( new_w->message_box.help_button ) { ac = 0 ; XtSetArg( al[ac], XmNlabelString, new_w->message_box.help_label_string) ; ++ac ; XtSetArg( al[ac], XmNstringDirection, BB_StringDirection( new_w)) ; ++ac ; XtSetValues( new_w->message_box.help_button, al, ac) ; } new_w->message_box.help_label_string = NULL ; need_layout = TRUE ; } /* If Default Pushbutton changes, reset showAsDefault. */ if( current->message_box.default_type != new_w->message_box.default_type ) { if( !XmRepTypeValidValue( XmRID_DEFAULT_BUTTON_TYPE, new_w->message_box.default_type, (Widget) new_w) ) { new_w->message_box.default_type = current->message_box.default_type ; } else { switch( new_w->message_box.default_type ) { case XmDIALOG_CANCEL_BUTTON: { defaultButton = new_w->bulletin_board.cancel_button ; break ; } case XmDIALOG_HELP_BUTTON: { defaultButton = new_w->message_box.help_button ; break ; } case XmDIALOG_OK_BUTTON: { defaultButton = new_w->message_box.ok_button ; break ; } default: { defaultButton = NULL ; } } BB_DefaultButton( new_w) = defaultButton ; _XmBulletinBoardSetDynDefaultButton( (Widget) new_w, defaultButton); if( (current->manager.initial_focus == BB_DefaultButton( current)) && (current->manager.initial_focus == new_w->manager.initial_focus) ) { new_w->manager.initial_focus = defaultButton ; _XmSetInitialOfTabGroup( (Widget) new_w, defaultButton) ; } } } BB_InSetValues( new_w) = False; /* Re-layout the sub-widgets if necessary */ if( need_layout && (XtClass( new_w) == xmMessageBoxWidgetClass) ) { _XmBulletinBoardSizeUpdate( (Widget) new_w) ; } return( FALSE) ; } /**************************************************************** * Set up the icon (pixmap label widget) and the label widget itself. ****************/ static void SetUpSymbol( XmMessageBoxWidget w ) { Arg al[ARG_LIST_CNT]; int ac; /****************/ /* If no pixmap specified, try to get from bitmap file or default */ if( w->message_box.symbol_pixmap == XmUNSPECIFIED_PIXMAP ) { GetMsgBoxPixmap( w) ; } if( !w->message_box.symbol_pixmap ) { w->message_box.symbol_pixmap = XmUNSPECIFIED_PIXMAP ; } /* Create symbol label even if no pixmap specified; allows SetValues * on dialogType to make pixmap appear in what starts as message box. */ ac = 0; XtSetArg (al[ac], XmNwidth, 0); ac++; XtSetArg (al[ac], XmNheight, 0); ac++; XtSetArg (al[ac], XmNlabelType, XmPIXMAP); ac++; XtSetArg (al[ac], XmNlabelPixmap, w->message_box.symbol_pixmap); ac++; XtSetArg (al[ac], XmNtraversalOn, False); ac++; w->message_box.symbol_wid = XmCreateLabelGadget( (Widget) w, "Symbol", al, ac); return ; } /**************************************************************** * Set up the message label (assumes none set yet). ****************/ static void SetUpMessage( XmMessageBoxWidget w ) { Arg al[ARG_LIST_CNT]; int ac; XmString empty_string = NULL ; /****************/ /* set up y value dependent on symbol_wid */ ac = 0; XtSetArg (al[ac], XmNalignment, w->message_box.message_alignment); ac++; XtSetArg (al[ac], XmNborderWidth, 0); ac++; XtSetArg (al[ac], XmNtraversalOn, False); ac++; if (w->message_box.message_string) { XtSetArg(al[ac], XmNlabelString, w->message_box.message_string); ac++; w->message_box.message_string = NULL; } else { /* we don't want "Message", the name of the label, to become the label string, it would break the AES */ /* BEGIN OSF Fix CR 4847 */ empty_string = XmStringCreateLocalized(XmS); /* END OSF Fix CR 4847 */ XtSetArg(al[ac], XmNlabelString, empty_string); ac++; } XtSetArg (al[ac], XmNstringDirection, BB_StringDirection( w)) ; ac++; w->message_box.message_wid = XmCreateLabelGadget( (Widget) w, "Message", al, ac); /* BEGIN OSF Fix CR 4847 */ if (empty_string != NULL) XmStringFree(empty_string); /* END OSF Fix CR 4847 */ return ; } /****************************************************************/ XmGeoMatrix _XmMessageBoxGeoMatrixCreate( Widget wid, Widget instigator, XtWidgetGeometry *desired ) { XmMessageBoxWidget mb = (XmMessageBoxWidget) wid ; XmGeoMatrix geoSpec ; register XmGeoRowLayout layoutPtr ; register XmKidGeometry boxPtr ; XmKidGeometry firstBoxInRow ; Widget menubar = NULL; Widget workarea = NULL; Boolean has_buttons = False; Boolean has_message = False; Boolean menubar_adjust = False; Boolean add_pixmap = False; int nrows = 2; int nchildren = mb->composite.num_children; int i; /* * Layout MessageBox XmGeoMatrix. * Each row is terminated by leaving an empty XmKidGeometry and * moving to the next XmGeoRowLayout. */ /* identify menu bar and work area children. */ for (i=0; i < nchildren; i++) { register Widget w = mb->composite.children[i]; if( menubar == NULL && XmIsRowColumn(w) && ((XmRowColumnWidget)w)->row_column.type == XmMENU_BAR) { menubar = w; nrows += 1; } else { if (IsButton(w)) { has_buttons = True; } else { if (workarea == NULL && !IsAutoChild(mb,w)) { workarea = w; nrows += 1; } } } } if (has_buttons) nrows += 1; geoSpec = _XmGeoMatrixAlloc( nrows, nchildren, 0) ; geoSpec->composite = (Widget) mb ; geoSpec->instigator = (Widget) instigator ; if (desired) geoSpec->instig_request = *desired ; geoSpec->margin_w = BB_MarginWidth( mb) + mb->manager.shadow_thickness ; geoSpec->margin_h = BB_MarginHeight( mb) + mb->manager.shadow_thickness ; geoSpec->no_geo_request = _XmMessageBoxNoGeoRequest ; layoutPtr = &(geoSpec->layouts->row) ; boxPtr = geoSpec->boxes ; /* menu bar */ if( menubar && _XmGeoSetupKid( boxPtr, menubar) ) { layoutPtr->fix_up = _XmMenuBarFix ; menubar_adjust = True ; boxPtr += 2; ++layoutPtr; } /* symbol pixmap and message string */ firstBoxInRow = boxPtr ; if (LayoutIsRtoLM(mb)) { if( _XmGeoSetupKid( boxPtr, mb->message_box.message_wid) ) { has_message = True ; ++boxPtr ; } if( (mb->message_box.symbol_pixmap != XmUNSPECIFIED_PIXMAP) && _XmGeoSetupKid( boxPtr, mb->message_box.symbol_wid) ) { ++boxPtr ; } } else { if( (mb->message_box.symbol_pixmap != XmUNSPECIFIED_PIXMAP) && _XmGeoSetupKid( boxPtr, mb->message_box.symbol_wid) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, mb->message_box.message_wid) ) { has_message = True ; ++boxPtr ; } } if( boxPtr != firstBoxInRow && (workarea == NULL || has_message) ) { if( menubar_adjust ) { menubar_adjust = False ; } else { layoutPtr->space_above = BB_MarginHeight( mb) ; } layoutPtr->space_between = BB_MarginWidth( mb) ; ++boxPtr ; ++layoutPtr ; firstBoxInRow = boxPtr ; } /* work area */ if (LayoutIsRtoLM(mb) && !has_message && boxPtr != firstBoxInRow) { --boxPtr; /* we want the workarea to the left of the pixmap */ add_pixmap = True; } if( workarea && _XmGeoSetupKid( boxPtr, workarea) ) { ++boxPtr ; } if (add_pixmap) if( (mb->message_box.symbol_pixmap != XmUNSPECIFIED_PIXMAP) && _XmGeoSetupKid( boxPtr, mb->message_box.symbol_wid) ) { ++boxPtr ; } if( boxPtr != firstBoxInRow ) { layoutPtr->fill_mode = XmGEO_EXPAND; layoutPtr->fit_mode = XmGEO_PROPORTIONAL; if( menubar_adjust ) { menubar_adjust = False; } else { layoutPtr->space_above = BB_MarginHeight( mb) ; } layoutPtr->space_between = BB_MarginWidth(mb); layoutPtr->stretch_height = True; layoutPtr->even_height = 1; boxPtr++; ++layoutPtr ; } /* separator */ if( _XmGeoSetupKid( boxPtr, mb->message_box.separator) ) { layoutPtr->fix_up = _XmSeparatorFix ; layoutPtr->space_above = BB_MarginHeight( mb) ; boxPtr += 2 ; ++layoutPtr ; } /* buttons */ if (LayoutIsRtoLM(mb)) { if( _XmGeoSetupKid( boxPtr, mb->message_box.help_button) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, mb->bulletin_board.cancel_button) ) { ++boxPtr ; } for (i = 0; i < nchildren; i++) { register Widget w = mb->composite.children[nchildren-i-1]; if( !IsAutoChild(mb,w) && IsButton(w) && _XmGeoSetupKid(boxPtr, w) ) { ++boxPtr; } } if( _XmGeoSetupKid( boxPtr, mb->message_box.ok_button) ) { ++boxPtr ; } } else { if( _XmGeoSetupKid( boxPtr, mb->message_box.ok_button) ) { ++boxPtr ; } for (i = 0; i < nchildren; i++) { register Widget w = mb->composite.children[i]; if( !IsAutoChild(mb,w) && IsButton(w) && _XmGeoSetupKid(boxPtr, w) ) { ++boxPtr; } } if( _XmGeoSetupKid( boxPtr, mb->bulletin_board.cancel_button) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, mb->message_box.help_button) ) { ++boxPtr ; } } if( has_buttons ) { layoutPtr->fill_mode = XmGEO_CENTER ; layoutPtr->fit_mode = XmGEO_WRAP ; if( !mb->message_box.minimize_buttons ) { layoutPtr->even_width = 1 ; } layoutPtr->even_height = 1 ; layoutPtr->space_above = BB_MarginHeight( mb) ; ++layoutPtr ; } /* end */ layoutPtr->space_above = BB_MarginHeight( mb) ; layoutPtr->end = TRUE ; return( geoSpec) ; } /****************************************************************/ Boolean _XmMessageBoxNoGeoRequest( XmGeoMatrix geoSpec ) { /****************/ if( BB_InSetValues( geoSpec->composite) && (XtClass( geoSpec->composite) == xmMessageBoxWidgetClass) ) { return( TRUE) ; } return( FALSE) ; } /**************************************************************** * Construct the required captive widgets for the box. Don't worry about * positioning since a layout will happen later on. ****************/ static void CreateWidgets( XmMessageBoxWidget w ) { Arg al[2]; /****************/ /* create the symbol label */ if (!(w->message_box.dialog_type == XmDIALOG_TEMPLATE && w->message_box.symbol_pixmap == XmUNSPECIFIED_PIXMAP)) SetUpSymbol (w); /* create the message label, after symbol is created */ if (!(w->message_box.dialog_type == XmDIALOG_TEMPLATE && w->message_box.message_string == NULL)) SetUpMessage (w); /* create the separator */ XtSetArg (al[0], XmNhighlightThickness, 0); w->message_box.separator = XmCreateSeparatorGadget( (Widget) w, "Separator", al, 1); /* create all pushbuttons, user can unmanage if they don't want them */ /* "Ok" button... if no label, use default localized "OK" string from message catalog, or "OK" if no message catatlog, for label */ if (!(w->message_box.dialog_type == XmDIALOG_TEMPLATE && w->message_box.ok_label_string == NULL && w->message_box.ok_callback == NULL)) { w->message_box.ok_button = _XmBB_CreateButtonG( (Widget) w, w->message_box.ok_label_string, "OK", XmOkStringLoc) ; w->message_box.ok_label_string = NULL; XtAddCallback( w->message_box.ok_button, XmNactivateCallback, MessageCallback, (XtPointer) w) ; } /* "Cancel" button... if no label, use default localized "Cancel" string from message catalog, or "Cancel" if no message catalog, for label */ if (!(w->message_box.dialog_type == XmDIALOG_TEMPLATE && w->message_box.cancel_label_string == NULL && w->message_box.cancel_callback == NULL)) { w->bulletin_board.cancel_button = _XmBB_CreateButtonG( (Widget) w, w->message_box.cancel_label_string, "Cancel", XmCancelStringLoc) ; w->message_box.cancel_label_string = NULL; XtAddCallback( w->bulletin_board.cancel_button, XmNactivateCallback, MessageCallback, (XtPointer) w) ; } /* "Help" button... if no label, use default localized "Help" string from message catalog, or "Help" if no message catalog, for label */ if (!(w->message_box.dialog_type == XmDIALOG_TEMPLATE && w->message_box.help_label_string == NULL && w->manager.help_callback == NULL)) { w->message_box.help_button = _XmBB_CreateButtonG( (Widget) w, w->message_box.help_label_string, "Help", XmHelpStringLoc) ; w->message_box.help_label_string = NULL; /* Remove BulletinBoard Unmanage callback from help button. */ XtRemoveAllCallbacks( w->message_box.help_button, XmNactivateCallback) ; XtAddCallback( w->message_box.help_button, XmNactivateCallback, MessageCallback, (XtPointer) w) ; } /* Now manage all my children. */ XtManageChildren (w->composite.children, w->composite.num_children); return ; } /**************************************************************** * Common create routine for message dialogs... * it will create the shell and widgets, and set the dialog_type to * whatever has been passed in... ****************/ static Widget CreateDialog( Widget parent, char *name, ArgList al, int ac, #if NeedWidePrototypes unsigned int type ) #else unsigned char type ) /* type of dialog being created */ #endif /* NeedWidePrototypes */ { Widget w; ArgList argsNew; /****************/ /* add dialogType to arglist and force to type passed in... */ /* allocate arglist, copy args, add dialog type arg */ argsNew = (ArgList) XtMalloc (sizeof(Arg) * (ac + 1)); memcpy( argsNew, al, sizeof(Arg) * ac); XtSetArg (argsNew[ac], XmNdialogType, type); ac++; /* create MessageBoxDialog free argsNew, return */ w = XmeCreateClassDialog (xmMessageBoxWidgetClass, parent, name, argsNew, ac) ; XtFree((char*)argsNew); return w ; } /****************************************************************/ Widget XmCreateMessageBox( Widget parent, char *name, ArgList al, Cardinal ac ) { return XtCreateWidget (name, xmMessageBoxWidgetClass, parent, al, ac); } Widget XmVaCreateMessageBox( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmMessageBoxWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedMessageBox( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmMessageBoxWidgetClass, parent, True, var, count); va_end(var); return w; } /****************************************************************/ Widget XmCreateMessageDialog( Widget parent, char *name, ArgList al, Cardinal ac ) { return CreateDialog (parent, name, al, ac, XmDIALOG_MESSAGE); } /****************************************************************/ Widget XmCreateErrorDialog( Widget parent, char *name, ArgList al, Cardinal ac ) { return CreateDialog (parent, name, al, ac, XmDIALOG_ERROR); } /****************************************************************/ Widget XmCreateInformationDialog( Widget parent, char *name, ArgList al, Cardinal ac ) { return CreateDialog (parent, name, al, ac, XmDIALOG_INFORMATION); } /****************************************************************/ Widget XmCreateQuestionDialog( Widget parent, char *name, ArgList al, Cardinal ac ) { return CreateDialog (parent, name, al, ac, XmDIALOG_QUESTION); } /****************************************************************/ Widget XmCreateWarningDialog( Widget parent, char *name, ArgList al, Cardinal ac ) { return CreateDialog (parent, name, al, ac, XmDIALOG_WARNING); } /****************************************************************/ Widget XmCreateWorkingDialog( Widget parent, char *name, ArgList al, Cardinal ac ) { return CreateDialog (parent, name, al, ac, XmDIALOG_WORKING); } /****************************************************************/ Widget XmCreateTemplateDialog( Widget parent, char *name, ArgList al, Cardinal ac ) { return CreateDialog (parent, name, al, ac, XmDIALOG_TEMPLATE); } /****************************************************************/ Widget XmMessageBoxGetChild( Widget widget, #if NeedWidePrototypes unsigned int child ) #else unsigned char child ) #endif /* NeedWidePrototypes */ { XmMessageBoxWidget w = (XmMessageBoxWidget)widget; Widget child_widget = NULL; _XmWidgetToAppContext(widget); /****************/ _XmAppLock(app); switch (child) { case XmDIALOG_DEFAULT_BUTTON: child_widget = w->bulletin_board.default_button; break; case XmDIALOG_SYMBOL_LABEL: child_widget = w->message_box.symbol_wid; break; case XmDIALOG_MESSAGE_LABEL: child_widget = w->message_box.message_wid; break; case XmDIALOG_OK_BUTTON: child_widget = w->message_box.ok_button; break; case XmDIALOG_CANCEL_BUTTON: child_widget = w->bulletin_board.cancel_button; break; case XmDIALOG_HELP_BUTTON: child_widget = w->message_box.help_button; break; case XmDIALOG_SEPARATOR: child_widget = w->message_box.separator; break; default: XmeWarning( (Widget) w, WARNING4); break ; break; } _XmAppUnlock(app); return child_widget ; } /****************************************************************/ /*ARGSUSED*/ static void GetMessageString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmMessageBoxWidget w = (XmMessageBoxWidget) wid ; XmString data; Arg al[1]; /****************/ if (w->message_box.message_wid) { XtSetArg (al[0], XmNlabelString, &data); XtGetValues (w->message_box.message_wid, al, 1); *value = (XtArgVal) data; } else *value = (XtArgVal) NULL; return ; } /****************************************************************/ /*ARGSUSED*/ static void GetSymbolPixmap( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmMessageBoxWidget w = (XmMessageBoxWidget) wid ; Pixmap data; Arg al[1]; /****************/ if (w->message_box.symbol_wid) { XtSetArg (al[0], XmNlabelPixmap, &data); XtGetValues (w->message_box.symbol_wid, al, 1); *value = (XtArgVal) data; } else *value = (XtArgVal) NULL; return ; } /****************************************************************/ /*ARGSUSED*/ static void GetOkLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmMessageBoxWidget w = (XmMessageBoxWidget) wid ; XmString data; Arg al[1]; /****************/ if (w->message_box.ok_button) { XtSetArg (al[0], XmNlabelString, &data); XtGetValues (w->message_box.ok_button, al, 1); *value = (XtArgVal) data; } else *value = (XtArgVal) NULL; return ; } /****************************************************************/ /*ARGSUSED*/ static void GetCancelLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmMessageBoxWidget w = (XmMessageBoxWidget) wid ; XmString data; Arg al[1]; /****************/ if (w->bulletin_board.cancel_button) { XtSetArg (al[0], XmNlabelString, &data); XtGetValues (w->bulletin_board.cancel_button, al, 1); *value = (XtArgVal) data; } else *value = (XtArgVal) NULL; return ; } /****************************************************************/ /*ARGSUSED*/ static void GetHelpLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmMessageBoxWidget w = (XmMessageBoxWidget) wid ; XmString data; Arg al[1]; /****************/ if (w->message_box.help_button) { XtSetArg (al[0], XmNlabelString, &data); XtGetValues (w->message_box.help_button, al, 1); *value = (XtArgVal) data; } else *value = (XtArgVal) NULL; return ; } /****************************************************************/ static void GetMsgBoxPixmap( XmMessageBoxWidget mBox ) { Pixmap tmpPix = XmUNSPECIFIED_PIXMAP ; char * fileName ; char * defaultName ; XmAccessColorDataRec acc_color_rec; /* Try to get pixmap from bitmap file or default. */ switch( mBox->message_box.dialog_type ) { case XmDIALOG_ERROR: { fileName = "xm_error" ; defaultName = "default_xm_error" ; break ; } case XmDIALOG_INFORMATION: { fileName = "xm_information" ; defaultName = "default_xm_information" ; break ; } case XmDIALOG_QUESTION: { fileName = "xm_question" ; defaultName = "default_xm_question" ; break ; } case XmDIALOG_WARNING: { fileName = "xm_warning" ; defaultName = "default_xm_warning" ; break ; } case XmDIALOG_WORKING: { fileName = "xm_working" ; defaultName = "default_xm_working" ; break ; } default: { fileName = NULL ; defaultName = NULL ; break ; } } if( fileName ){ int depth ; if (_XmGetBitmapConversionModel(XtScreen((Widget)mBox)) == XmMATCH_DEPTH) /* we want pixmap out of xbm, use the plain depth*/ depth = mBox->core.depth ; else /* we want bitmap out of xbm, use the private convention */ depth = -mBox->core.depth ; /* use full color spec, so that one can take advantage of symbolic shadow in the symbol pixmap */ acc_color_rec.foreground = mBox->manager.foreground ; acc_color_rec.background = mBox->core.background_pixel ; acc_color_rec.top_shadow_color = mBox->manager.top_shadow_color ; acc_color_rec.bottom_shadow_color = mBox->manager.bottom_shadow_color ; acc_color_rec.highlight_color = mBox->manager.highlight_color ; acc_color_rec.select_color = XmUNSPECIFIED_PIXEL ; tmpPix = _XmGetScaledPixmap(mBox->core.screen, (Widget)mBox, fileName, &acc_color_rec, depth, FALSE, 0) ; if( tmpPix == XmUNSPECIFIED_PIXMAP ) { tmpPix = _XmGetScaledPixmap(mBox->core.screen, (Widget)mBox, defaultName, &acc_color_rec, depth, FALSE, 0) ; } } mBox->message_box.symbol_pixmap = tmpPix ; mBox->message_box.internal_pixmap = TRUE ; return ; } /****************************************************************/ motif-2.3.8/lib/Xm/XmMsgI.h0000644000175000017500000007100413145162623012237 00000000000000/* $XConsortium: XmMsgI.h /main/15 1996/08/15 17:27:54 pascale $ */ /* * * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* This file is automatically generated. */ /* Do not edit. */ #ifndef NO_MESSAGE_CATALOG #include #include "XmMsgCatI.h" externalref nl_catd Xm_catd; #define _XmCatgets(catd, set_num, msg_num, def_str) \ catgets(catd, set_num, msg_num, def_str) #else #define _XmCatgets(catd, set_num, msg_num, def_str) def_str #endif /* NO_MESSAGE_CATALOG */ #define _XmMMsgBulletinB_0001 _XmCatgets(Xm_catd, MS_BulletinB, MSG_BulletinB_0001, _XmMsgBulletinB_0001) #define _XmMMsgCascadeB_0001 _XmCatgets(Xm_catd, MS_CascadeB, MSG_CascadeB_0001, _XmMsgCascadeB_0001) #define _XmMMsgCascadeB_0002 _XmCatgets(Xm_catd, MS_CascadeB, MSG_CascadeB_0002, _XmMsgCascadeB_0002) #define _XmMMsgCascadeB_0000 _XmCatgets(Xm_catd, MS_CascadeB, MSG_CascadeB_0000, _XmMsgCascadeB_0000) #define _XmMMsgCascadeB_0003 _XmCatgets(Xm_catd, MS_CascadeB, MSG_CascadeB_0003, _XmMsgCascadeB_0003) #define _XmMMsgRowColText_0024 _XmCatgets(Xm_catd, MS_CascadeB, MSG_RowColText_0024, _XmMsgRowColText_0024) #define _XmMMsgCommand_0000 _XmCatgets(Xm_catd, MS_Command, MSG_Command_0000, _XmMsgCommand_0000) #define _XmMMsgCommand_0001 _XmCatgets(Xm_catd, MS_Command, MSG_Command_0001, _XmMsgCommand_0001) #define _XmMMsgCommand_0002 _XmCatgets(Xm_catd, MS_Command, MSG_Command_0002, _XmMsgCommand_0002) #define _XmMMsgCommand_0003 _XmCatgets(Xm_catd, MS_Command, MSG_Command_0003, _XmMsgCommand_0003) #define _XmMMsgCommand_0004 _XmCatgets(Xm_catd, MS_Command, MSG_Command_0004, _XmMsgCommand_0004) #define _XmMMsgCommand_0005 _XmCatgets(Xm_catd, MS_Command, MSG_Command_0005, _XmMsgCommand_0005) #define _XmMMsgCutPaste_0000 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0000, _XmMsgCutPaste_0000) #define _XmMMsgCutPaste_0001 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0001, _XmMsgCutPaste_0001) #define _XmMMsgCutPaste_0002 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0002, _XmMsgCutPaste_0002) #define _XmMMsgCutPaste_0003 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0003, _XmMsgCutPaste_0003) #define _XmMMsgCutPaste_0004 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0004, _XmMsgCutPaste_0004) #define _XmMMsgCutPaste_0005 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0005, _XmMsgCutPaste_0005) #define _XmMMsgCutPaste_0006 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0006, _XmMsgCutPaste_0006) #define _XmMMsgCutPaste_0007 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0007, _XmMsgCutPaste_0007) #define _XmMMsgCutPaste_0008 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0008, _XmMsgCutPaste_0008) #define _XmMMsgCutPaste_0009 _XmCatgets(Xm_catd, MS_CutPaste, MSG_CutPaste_0009, _XmMsgCutPaste_0009) #define _XmMMsgDialogS_0000 _XmCatgets(Xm_catd, MS_DialogS, MSG_DialogS_0000, _XmMsgDialogS_0000) #define _XmMMsgForm_0000 _XmCatgets(Xm_catd, MS_Form, MSG_Form_0000, _XmMsgForm_0000) #define _XmMMsgForm_0002 _XmCatgets(Xm_catd, MS_Form, MSG_Form_0002, _XmMsgForm_0002) #define _XmMMsgForm_0003 _XmCatgets(Xm_catd, MS_Form, MSG_Form_0003, _XmMsgForm_0003) #define _XmMMsgGadget_0000 _XmCatgets(Xm_catd, MS_Gadget, MSG_Gadget_0000, _XmMsgGadget_0000) #define _XmMMsgLabel_0003 _XmCatgets(Xm_catd, MS_Label, MSG_Label_0003, _XmMsgLabel_0003) #define _XmMMsgLabel_0004 _XmCatgets(Xm_catd, MS_Label, MSG_Label_0004, _XmMsgLabel_0004) #define _XmMMsgList_0000 _XmCatgets(Xm_catd, MS_List, MSG_List_0000, _XmMsgList_0000) #define _XmMMsgList_0005 _XmCatgets(Xm_catd, MS_List, MSG_List_0005, _XmMsgList_0005) #define _XmMMsgList_0006 _XmCatgets(Xm_catd, MS_List, MSG_List_0006, _XmMsgList_0006) #define _XmMMsgList_0007 _XmCatgets(Xm_catd, MS_List, MSG_List_0007, _XmMsgList_0007) #define _XmMMsgList_0008 _XmCatgets(Xm_catd, MS_List, MSG_List_0008, _XmMsgList_0008) #define _XmMMsgList_0009 _XmCatgets(Xm_catd, MS_List, MSG_List_0009, _XmMsgList_0009) #define _XmMMsgList_0010 _XmCatgets(Xm_catd, MS_List, MSG_List_0010, _XmMsgList_0010) #define _XmMMsgList_0011 _XmCatgets(Xm_catd, MS_List, MSG_List_0011, _XmMsgList_0011) #define _XmMMsgList_0012 _XmCatgets(Xm_catd, MS_List, MSG_List_0012, _XmMsgList_0012) #define _XmMMsgList_0013 _XmCatgets(Xm_catd, MS_List, MSG_List_0013, _XmMsgList_0013) #define _XmMMsgList_0014 _XmCatgets(Xm_catd, MS_List, MSG_List_0014, _XmMsgList_0014) #define _XmMMsgList_0015 _XmCatgets(Xm_catd, MS_List, MSG_List_0015, _XmMsgList_0015) #define _XmMMsgMainW_0000 _XmCatgets(Xm_catd, MS_MainW, MSG_MainW_0000, _XmMsgMainW_0000) #define _XmMMsgMainW_0001 _XmCatgets(Xm_catd, MS_MainW, MSG_MainW_0001, _XmMsgMainW_0001) #define _XmMMsgMenuShell_0000 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0000, _XmMsgMenuShell_0000) #define _XmMMsgMenuShell_0001 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0001, _XmMsgMenuShell_0001) #define _XmMMsgMenuShell_0002 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0002, _XmMsgMenuShell_0002) #define _XmMMsgMenuShell_0003 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0003, _XmMsgMenuShell_0003) #define _XmMMsgMenuShell_0004 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0004, _XmMsgMenuShell_0004) #define _XmMMsgMenuShell_0005 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0005, _XmMsgMenuShell_0005) #define _XmMMsgMenuShell_0006 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0006, _XmMsgMenuShell_0006) #define _XmMMsgMenuShell_0007 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0007, _XmMsgMenuShell_0007) #define _XmMMsgMenuShell_0008 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0008, _XmMsgMenuShell_0008) #define _XmMMsgMenuShell_0009 _XmCatgets(Xm_catd, MS_MenuShell, MSG_MenuShell_0009, _XmMsgMenuShell_0009) #define _XmMMsgMessageB_0003 _XmCatgets(Xm_catd, MS_MessageB, MSG_MessageB_0003, _XmMsgMessageB_0003) #define _XmMMsgMessageB_0004 _XmCatgets(Xm_catd, MS_MessageB, MSG_MessageB_0004, _XmMsgMessageB_0004) #define _XmMMsgPanedW_0000 _XmCatgets(Xm_catd, MS_PanedW, MSG_PanedW_0000, _XmMsgPanedW_0000) #define _XmMMsgPanedW_0001 _XmCatgets(Xm_catd, MS_PanedW, MSG_PanedW_0001, _XmMsgPanedW_0001) #define _XmMMsgPanedW_0002 _XmCatgets(Xm_catd, MS_PanedW, MSG_PanedW_0002, _XmMsgPanedW_0002) #define _XmMMsgPanedW_0004 _XmCatgets(Xm_catd, MS_PanedW, MSG_PanedW_0004, _XmMsgPanedW_0004) #define _XmMMsgPanedW_0005 _XmCatgets(Xm_catd, MS_PanedW, MSG_PanedW_0005, _XmMsgPanedW_0005) #define _XmMMsgProtocols_0000 _XmCatgets(Xm_catd, MS_Protocols, MSG_Protocols_0000, _XmMsgProtocols_0000) #define _XmMMsgProtocols_0001 _XmCatgets(Xm_catd, MS_Protocols, MSG_Protocols_0001, _XmMsgProtocols_0001) #define _XmMMsgProtocols_0002 _XmCatgets(Xm_catd, MS_Protocols, MSG_Protocols_0002, _XmMsgProtocols_0002) #define _XmMMsgRowColumn_0000 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0000, _XmMsgRowColumn_0000) #define _XmMMsgRowColumn_0001 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0001, _XmMsgRowColumn_0001) #define _XmMMsgRowColumn_0002 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0002, _XmMsgRowColumn_0002) #define _XmMMsgRowColumn_0003 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0003, _XmMsgRowColumn_0003) #define _XmMMsgRowColumn_0004 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0004, _XmMsgRowColumn_0004) #define _XmMMsgRowColumn_0005 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0005, _XmMsgRowColumn_0005) #define _XmMMsgRowColumn_0007 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0007, _XmMsgRowColumn_0007) #define _XmMMsgRowColumn_0008 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0008, _XmMsgRowColumn_0008) #define _XmMMsgRowColumn_0015 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0015, _XmMsgRowColumn_0015) #define _XmMMsgRowColumn_0016 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0016, _XmMsgRowColumn_0016) #define _XmMMsgRowColumn_0017 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0017, _XmMsgRowColumn_0017) #define _XmMMsgRowColumn_0018 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0018, _XmMsgRowColumn_0018) #define _XmMMsgRowColumn_0019 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0019, _XmMsgRowColumn_0019) #define _XmMMsgRowColumn_0020 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0020, _XmMsgRowColumn_0020) #define _XmMMsgRowColumn_0022 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0022, _XmMsgRowColumn_0022) #define _XmMMsgRowColumn_0023 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0023, _XmMsgRowColumn_0023) #define _XmMMsgRowColumn_0025 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0025, _XmMsgRowColumn_0025) #define _XmMMsgRowColumn_0026 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0026, _XmMsgRowColumn_0026) #define _XmMMsgRowColumn_0027 _XmCatgets(Xm_catd, MS_RowColumn, MSG_RowColumn_0027, _XmMsgRowColumn_0027) #define _XmMMsgScale_0000 _XmCatgets(Xm_catd, MS_Scale, MSG_Scale_0000, _XmMsgScale_0000) #define _XmMMsgScale_0001 _XmCatgets(Xm_catd, MS_Scale, MSG_Scale_0001, _XmMsgScale_0001) #define _XmMMsgScale_0002 _XmCatgets(Xm_catd, MS_Scale, MSG_Scale_0002, _XmMsgScale_0002) #define _XmMMsgScaleScrBar_0004 _XmCatgets(Xm_catd, MS_Scale, MSG_ScaleScrBar_0004, _XmMsgScaleScrBar_0004) #define _XmMMsgScale_0006 _XmCatgets(Xm_catd, MS_Scale, MSG_Scale_0006, _XmMsgScale_0006) #define _XmMMsgScale_0007 _XmCatgets(Xm_catd, MS_Scale, MSG_Scale_0007, _XmMsgScale_0007) #define _XmMMsgScale_0008 _XmCatgets(Xm_catd, MS_Scale, MSG_Scale_0008, _XmMsgScale_0008) #define _XmMMsgScale_0009 _XmCatgets(Xm_catd, MS_Scale, MSG_Scale_0009, _XmMsgScale_0009) #define _XmMMsgScrollBar_0000 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0000, _XmMsgScrollBar_0000) #define _XmMMsgScrollBar_0001 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0001, _XmMsgScrollBar_0001) #define _XmMMsgScrollBar_0002 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0002, _XmMsgScrollBar_0002) #define _XmMMsgScrollBar_0003 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0003, _XmMsgScrollBar_0003) #define _XmMMsgScrollBar_0004 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0004, _XmMsgScrollBar_0004) #define _XmMMsgScrollBar_0005 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0005, _XmMsgScrollBar_0005) #define _XmMMsgScrollBar_0006 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0006, _XmMsgScrollBar_0006) #define _XmMMsgScrollBar_0007 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0007, _XmMsgScrollBar_0007) #define _XmMMsgScrollBar_0008 _XmCatgets(Xm_catd, MS_ScrollBar, MSG_ScrollBar_0008, _XmMsgScrollBar_0008) #define _XmMMsgScrolledW_0004 _XmCatgets(Xm_catd, MS_ScrolledW, MSG_ScrolledW_0004, _XmMsgScrolledW_0004) #define _XmMMsgScrolledW_0005 _XmCatgets(Xm_catd, MS_ScrolledW, MSG_ScrolledW_0005, _XmMsgScrolledW_0005) #define _XmMMsgScrolledW_0006 _XmCatgets(Xm_catd, MS_ScrolledW, MSG_ScrolledW_0006, _XmMsgScrolledW_0006) #define _XmMMsgScrolledW_0007 _XmCatgets(Xm_catd, MS_ScrolledW, MSG_ScrolledW_0007, _XmMsgScrolledW_0007) #define _XmMMsgScrolledW_0008 _XmCatgets(Xm_catd, MS_ScrolledW, MSG_ScrolledW_0008, _XmMsgScrolledW_0008) #define _XmMMsgScrolledW_0009 _XmCatgets(Xm_catd, MS_ScrolledW, MSG_ScrolledW_0009, _XmMsgScrolledW_0009) #define _XmMMsgScrollVis_0000 _XmCatgets(Xm_catd, MS_ScrolledW, MSG_ScrollVis_0000, _XmMsgScrollVis_0000) #define _XmMMsgSelectioB_0001 _XmCatgets(Xm_catd, MS_SelectioB, MSG_SelectioB_0001, _XmMsgSelectioB_0001) #define _XmMMsgSelectioB_0002 _XmCatgets(Xm_catd, MS_SelectioB, MSG_SelectioB_0002, _XmMsgSelectioB_0002) #define _XmMMsgText_0000 _XmCatgets(Xm_catd, MS_Text, MSG_Text_0000, _XmMsgText_0000) #define _XmMMsgTextIn_0000 _XmCatgets(Xm_catd, MS_Text, MSG_TextIn_0000, _XmMsgTextIn_0000) #define _XmMMsgTextOut_0000 _XmCatgets(Xm_catd, MS_Text, MSG_TextOut_0000, _XmMsgTextOut_0000) #define _XmMMsgTextF_0002 _XmCatgets(Xm_catd, MS_Text, MSG_TextF_0002, _XmMsgTextF_0002) #define _XmMMsgTextF_0003 _XmCatgets(Xm_catd, MS_Text, MSG_TextF_0003, _XmMsgTextF_0003) #define _XmMMsgTextF_0004 _XmCatgets(Xm_catd, MS_Text, MSG_TextF_0004, _XmMsgTextF_0004) #define _XmMMsgTextFWcs_0000 _XmCatgets(Xm_catd, MS_Text, MSG_TextFWcs_0000, _XmMsgTextFWcs_0000) #define _XmMMsgTextF_0000 _XmCatgets(Xm_catd, MS_TextF, MSG_TextF_0000, _XmMsgTextF_0000) #define _XmMMsgTextF_0001 _XmCatgets(Xm_catd, MS_TextF, MSG_TextF_0001, _XmMsgTextF_0001) #define _XmMMsgTextF_0006 _XmCatgets(Xm_catd, MS_TextF, MSG_TextF_0006, _XmMsgTextF_0006) #define _XmMMsgVendor_0000 _XmCatgets(Xm_catd, MS_Vendor, MSG_Vendor_0000, _XmMsgVendor_0000) #define _XmMMsgVendor_0001 _XmCatgets(Xm_catd, MS_Vendor, MSG_Vendor_0001, _XmMsgVendor_0001) #define _XmMMsgVendor_0002 _XmCatgets(Xm_catd, MS_Vendor, MSG_Vendor_0002, _XmMsgVendor_0002) #define _XmMMsgVendor_0003 _XmCatgets(Xm_catd, MS_Vendor, MSG_Vendor_0003, _XmMsgVendor_0003) #define _XmMMsgVisual_0000 _XmCatgets(Xm_catd, MS_Visual, MSG_Visual_0000, _XmMsgVisual_0000) #define _XmMMsgVisual_0001 _XmCatgets(Xm_catd, MS_Visual, MSG_Visual_0001, _XmMsgVisual_0001) #define _XmMMsgVisual_0002 _XmCatgets(Xm_catd, MS_Visual, MSG_Visual_0002, _XmMsgVisual_0002) #define _XmMMsgXmIm_0000 _XmCatgets(Xm_catd, MS_XmIm, MSG_XmIm_0000, _XmMsgXmIm_0000) #define _XmMMsgResource_0001 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0001, _XmMsgResource_0001) #define _XmMMsgResource_0002 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0002, _XmMsgResource_0002) #define _XmMMsgResource_0003 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0003, _XmMsgResource_0003) #define _XmMMsgResource_0004 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0004, _XmMsgResource_0004) #define _XmMMsgResource_0005 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0005, _XmMsgResource_0005) #define _XmMMsgResource_0006 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0006, _XmMsgResource_0006) #define _XmMMsgResource_0007 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0007, _XmMsgResource_0007) #define _XmMMsgResource_0008 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0008, _XmMsgResource_0008) #define _XmMMsgResource_0009 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0009, _XmMsgResource_0009) #define _XmMMsgResource_0010 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0010, _XmMsgResource_0010) #define _XmMMsgResource_0011 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0011, _XmMsgResource_0011) #define _XmMMsgResource_0012 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0012, _XmMsgResource_0012) #define _XmMMsgResource_0013 _XmCatgets(Xm_catd, MS_Resources, MSG_Resource_0013, _XmMsgResource_0013) #define _XmMMsgBaseClass_0000 _XmCatgets(Xm_catd, MS_BaseClass, MSG_BaseClass_0000, _XmMsgBaseClass_0000) #define _XmMMsgBaseClass_0001 _XmCatgets(Xm_catd, MS_BaseClass, MSG_BaseClass_0001, _XmMsgBaseClass_0001) #define _XmMMsgDisplay_0001 _XmCatgets(Xm_catd, MS_Display, MSG_Display_0001, _XmMsgDisplay_0001) #define _XmMMsgDisplay_0002 _XmCatgets(Xm_catd, MS_Display, MSG_Display_0002, _XmMsgDisplay_0002) #define _XmMMsgDisplay_0003 _XmCatgets(Xm_catd, MS_Display, MSG_Display_0003, _XmMsgDisplay_0003) #define _XmMMsgDragBS_0000 _XmCatgets(Xm_catd, MS_DragBS, MSG_DragBS_0000, _XmMsgDragBS_0000) #define _XmMMsgDragBS_0001 _XmCatgets(Xm_catd, MS_DragBS, MSG_DragBS_0001, _XmMsgDragBS_0001) #define _XmMMsgDragBS_0002 _XmCatgets(Xm_catd, MS_DragBS, MSG_DragBS_0002, _XmMsgDragBS_0002) #define _XmMMsgDragBS_0003 _XmCatgets(Xm_catd, MS_DragBS, MSG_DragBS_0003, _XmMsgDragBS_0003) #define _XmMMsgDragBS_0004 _XmCatgets(Xm_catd, MS_DragBS, MSG_DragBS_0004, _XmMsgDragBS_0004) #define _XmMMsgDragBS_0005 _XmCatgets(Xm_catd, MS_DragBS, MSG_DragBS_0005, _XmMsgDragBS_0005) #define _XmMMsgDragBS_0006 _XmCatgets(Xm_catd, MS_DragBS, MSG_DragBS_0006, _XmMsgDragBS_0006) #define _XmMMsgDragC_0001 _XmCatgets(Xm_catd, MS_DragC, MSG_DragC_0001, _XmMsgDragC_0001) #define _XmMMsgDragC_0002 _XmCatgets(Xm_catd, MS_DragC, MSG_DragC_0002, _XmMsgDragC_0002) #define _XmMMsgDragC_0003 _XmCatgets(Xm_catd, MS_DragC, MSG_DragC_0003, _XmMsgDragC_0003) #define _XmMMsgDragC_0004 _XmCatgets(Xm_catd, MS_DragC, MSG_DragC_0004, _XmMsgDragC_0004) #define _XmMMsgDragC_0005 _XmCatgets(Xm_catd, MS_DragC, MSG_DragC_0005, _XmMsgDragC_0005) #define _XmMMsgDragC_0006 _XmCatgets(Xm_catd, MS_DragC, MSG_DragC_0006, _XmMsgDragC_0006) #define _XmMMsgDragICC_0000 _XmCatgets(Xm_catd, MS_DragICC, MSG_DragICC_0000, _XmMsgDragICC_0000) #define _XmMMsgDragICC_0001 _XmCatgets(Xm_catd, MS_DragICC, MSG_DragICC_0001, _XmMsgDragICC_0001) #define _XmMMsgDragIcon_0000 _XmCatgets(Xm_catd, MS_DragIcon, MSG_DragIcon_0000, _XmMsgDragIcon_0000) #define _XmMMsgDragIcon_0001 _XmCatgets(Xm_catd, MS_DragIcon, MSG_DragIcon_0001, _XmMsgDragIcon_0001) #define _XmMMsgDragOverS_0000 _XmCatgets(Xm_catd, MS_DragOverS, MSG_DragOverS_0000, _XmMsgDragOverS_0000) #define _XmMMsgDragOverS_0001 _XmCatgets(Xm_catd, MS_DragOverS, MSG_DragOverS_0001, _XmMsgDragOverS_0001) #define _XmMMsgDragOverS_0002 _XmCatgets(Xm_catd, MS_DragOverS, MSG_DragOverS_0002, _XmMsgDragOverS_0002) #define _XmMMsgDragOverS_0003 _XmCatgets(Xm_catd, MS_DragOverS, MSG_DragOverS_0003, _XmMsgDragOverS_0003) #define _XmMMsgDragUnder_0000 _XmCatgets(Xm_catd, MS_DragUnder, MSG_DragUnder_0000, _XmMsgDragUnder_0000) #define _XmMMsgDragUnder_0001 _XmCatgets(Xm_catd, MS_DragUnder, MSG_DragUnder_0001, _XmMsgDragUnder_0001) #define _XmMMsgDropSMgr_0001 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0001, _XmMsgDropSMgr_0001) #define _XmMMsgDropSMgr_0002 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0002, _XmMsgDropSMgr_0002) #define _XmMMsgDropSMgr_0003 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0003, _XmMsgDropSMgr_0003) #define _XmMMsgDropSMgr_0004 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0004, _XmMsgDropSMgr_0004) #define _XmMMsgDropSMgr_0005 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0005, _XmMsgDropSMgr_0005) #define _XmMMsgDropSMgr_0006 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0006, _XmMsgDropSMgr_0006) #define _XmMMsgDropSMgr_0007 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0007, _XmMsgDropSMgr_0007) #define _XmMMsgDropSMgr_0008 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0008, _XmMsgDropSMgr_0008) #define _XmMMsgDropSMgr_0009 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0009, _XmMsgDropSMgr_0009) #define _XmMMsgDropSMgr_0010 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgr_0010, _XmMsgDropSMgr_0010) #define _XmMMsgDropSMgrI_0001 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgrI_0001, _XmMsgDropSMgrI_0001) #define _XmMMsgDropSMgrI_0002 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgrI_0002, _XmMsgDropSMgrI_0002) #define _XmMMsgDropSMgrI_0003 _XmCatgets(Xm_catd, MS_DropSMgr, MSG_DropSMgrI_0003, _XmMsgDropSMgrI_0003) #define _XmMMsgRegion_0000 _XmCatgets(Xm_catd, MS_Region, MSG_Region_0000, _XmMsgRegion_0000) #define _XmMMsgRepType_0001 _XmCatgets(Xm_catd, MS_RepType, MSG_RepType_0001, _XmMsgRepType_0001) #define _XmMMsgRepType_0002 _XmCatgets(Xm_catd, MS_RepType, MSG_RepType_0002, _XmMsgRepType_0002) #define _XmMMsgRepType_0000 _XmCatgets(Xm_catd, MS_RepType, MSG_RepType_0000, _XmMsgRepType_0000) #define _XmMMsgResConvert_0001 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0001, _XmMsgResConvert_0001) #define _XmMMsgResConvert_0002 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0002, _XmMsgResConvert_0002) #define _XmMMsgResConvert_0003 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0003, _XmMsgResConvert_0003) #define _XmMMsgResConvert_0005 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0005, _XmMsgResConvert_0005) #define _XmMMsgResConvert_0006 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0006, _XmMsgResConvert_0006) #define _XmMMsgResConvert_0007 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0007, _XmMsgResConvert_0007) #define _XmMMsgResConvert_0008 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0008, _XmMsgResConvert_0008) #define _XmMMsgResConvert_0009 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0009, _XmMsgResConvert_0009) #define _XmMMsgResConvert_0010 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0010, _XmMsgResConvert_0010) #define _XmMMsgResConvert_0011 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0011, _XmMsgResConvert_0011) #define _XmMMsgResConvert_0012 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0012, _XmMsgResConvert_0012) #define _XmMMsgResConvert_0013 _XmCatgets(Xm_catd, MS_ResConvert, MSG_ResConvert_0013, _XmMsgResConvert_0013) #define _XmMMsgScreen_0000 _XmCatgets(Xm_catd, MS_Screen, MSG_Screen_0000, _XmMsgScreen_0000) #define _XmMMsgScreen_0001 _XmCatgets(Xm_catd, MS_Screen, MSG_Screen_0001, _XmMsgScreen_0001) #define _XmMMsgColObj_0001 _XmCatgets(Xm_catd, MS_ColObj, MSG_ColObj_0001, _XmMsgColObj_0001) #define _XmMMsgColObj_0002 _XmCatgets(Xm_catd, MS_ColObj, MSG_ColObj_0002, _XmMsgColObj_0002) #define _XmMMsgComboBox_0000 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0000, _XmMsgComboBox_0000) #define _XmMMsgComboBox_0001 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0001, _XmMsgComboBox_0001) #define _XmMMsgComboBox_0004 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0004, _XmMsgComboBox_0004) #define _XmMMsgComboBox_0005 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0005, _XmMsgComboBox_0005) #define _XmMMsgComboBox_0006 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0006, _XmMsgComboBox_0006) #define _XmMMsgComboBox_0007 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0007, _XmMsgComboBox_0007) #define _XmMMsgComboBox_0008 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0008, _XmMsgComboBox_0008) #define _XmMMsgComboBox_0009 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0009, _XmMsgComboBox_0009) #define _XmMMsgComboBox_0010 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0010, _XmMsgComboBox_0010) #define _XmMMsgComboBox_0011 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0011, _XmMsgComboBox_0011) #define _XmMMsgComboBox_0012 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0012, _XmMsgComboBox_0012) #define _XmMMsgComboBox_0013 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0013, _XmMsgComboBox_0013) #define _XmMMsgComboBox_0014 _XmCatgets(Xm_catd, MS_ComboBox, MSG_ComboBox_0014, _XmMsgComboBox_0014) #define _XmMMsgContainer_0000 _XmCatgets(Xm_catd, MS_Container, MSG_Container_0000, _XmMsgContainer_0000) #define _XmMMsgContainer_0001 _XmCatgets(Xm_catd, MS_Container, MSG_Container_0001, _XmMsgContainer_0001) #define _XmMMsgManager_0000 _XmCatgets(Xm_catd, MS_Manager, MSG_Manager_0000, _XmMsgManager_0000) #define _XmMMsgManager_0001 _XmCatgets(Xm_catd, MS_Manager, MSG_Manager_0001, _XmMsgManager_0001) #define _XmMMsgNotebook_0000 _XmCatgets(Xm_catd, MS_Notebook, MSG_Notebook_0000, _XmMsgNotebook_0000) #define _XmMMsgPixConv_0000 _XmCatgets(Xm_catd, MS_PixConv, MSG_PixConv_0000, _XmMsgPixConv_0000) #define _XmMMsgPrimitive_0000 _XmCatgets(Xm_catd, MS_Primitive, MSG_Primitive_0000, _XmMsgPrimitive_0000) #define _XmMMsgScrollFrameT_0000 _XmCatgets(Xm_catd, MS_ScrollFrameT, MSG_ScrollFrameT_0000, _XmMsgScrollFrameT_0000) #define _XmMMsgScrollFrameT_0001 _XmCatgets(Xm_catd, MS_ScrollFrameT, MSG_ScrollFrameT_0001, _XmMsgScrollFrameT_0001) #define _XmMMsgSpinB_0003 _XmCatgets(Xm_catd, MS_SpinB, MSG_SpinB_0003, _XmMsgSpinB_0003) #define _XmMMsgSpinB_0004 _XmCatgets(Xm_catd, MS_SpinB, MSG_SpinB_0004, _XmMsgSpinB_0004) #define _XmMMsgSpinB_0005 _XmCatgets(Xm_catd, MS_SpinB, MSG_SpinB_0005, _XmMsgSpinB_0005) #define _XmMMsgSpinB_0006 _XmCatgets(Xm_catd, MS_SpinB, MSG_SpinB_0006, _XmMsgSpinB_0006) #define _XmMMsgSpinB_0007 _XmCatgets(Xm_catd, MS_SpinB, MSG_SpinB_0007, _XmMsgSpinB_0007) #define _XmMMsgSpinB_0008 _XmCatgets(Xm_catd, MS_SpinB, MSG_SpinB_0008, _XmMsgSpinB_0008) #define _XmMMsgTransfer_0000 _XmCatgets(Xm_catd, MS_Transfer, MSG_Transfer_0000, _XmMsgTransfer_0000) #define _XmMMsgTransfer_0002 _XmCatgets(Xm_catd, MS_Transfer, MSG_Transfer_0002, _XmMsgTransfer_0002) #define _XmMMsgTransfer_0003 _XmCatgets(Xm_catd, MS_Transfer, MSG_Transfer_0003, _XmMsgTransfer_0003) #define _XmMMsgTransfer_0004 _XmCatgets(Xm_catd, MS_Transfer, MSG_Transfer_0004, _XmMsgTransfer_0004) #define _XmMMsgTransfer_0005 _XmCatgets(Xm_catd, MS_Transfer, MSG_Transfer_0005, _XmMsgTransfer_0005) #define _XmMMsgTransfer_0006 _XmCatgets(Xm_catd, MS_Transfer, MSG_Transfer_0006, _XmMsgTransfer_0006) #define _XmMMsgTransfer_0007 _XmCatgets(Xm_catd, MS_Transfer, MSG_Transfer_0007, _XmMsgTransfer_0007) #define _XmMMsgVaSimple_0000 _XmCatgets(Xm_catd, MS_VaSimple, MSG_VaSimple_0000, _XmMsgVaSimple_0000) #define _XmMMsgVaSimple_0001 _XmCatgets(Xm_catd, MS_VaSimple, MSG_VaSimple_0001, _XmMsgVaSimple_0001) #define _XmMMsgVaSimple_0002 _XmCatgets(Xm_catd, MS_VaSimple, MSG_VaSimple_0002, _XmMsgVaSimple_0002) #define _XmMMsgMotif_0000 _XmCatgets(Xm_catd, MS_Xm, MSG_Motif_0000, _XmMsgMotif_0000) #define _XmMMsgMotif_0001 _XmCatgets(Xm_catd, MS_Xm, MSG_Motif_0001, _XmMsgMotif_0001) #define _XmMMsgXmRenderT_0000 _XmCatgets(Xm_catd, MS_XmRenderT, MSG_XmRenderT_0000, _XmMsgXmRenderT_0000) #define _XmMMsgXmRenderT_0001 _XmCatgets(Xm_catd, MS_XmRenderT, MSG_XmRenderT_0001, _XmMsgXmRenderT_0001) #define _XmMMsgXmRenderT_0002 _XmCatgets(Xm_catd, MS_XmRenderT, MSG_XmRenderT_0002, _XmMsgXmRenderT_0002) #define _XmMMsgXmRenderT_0003 _XmCatgets(Xm_catd, MS_XmRenderT, MSG_XmRenderT_0003, _XmMsgXmRenderT_0003) #define _XmMMsgXmRenderT_0004 _XmCatgets(Xm_catd, MS_XmRenderT, MSG_XmRenderT_0004, _XmMsgXmRenderT_0004) #define _XmMMsgXmRenderT_0005 _XmCatgets(Xm_catd, MS_XmRenderT, MSG_XmRenderT_0005, _XmMsgXmRenderT_0005) #define _XmMMsgXmString_0000 _XmCatgets(Xm_catd, MS_XmString, MSG_XmString_0000, _XmMsgXmString_0000) #define _XmMMsgXmTabList_0000 _XmCatgets(Xm_catd, MS_XmTabList, MSG_XmTabList_0000, _XmMsgXmTabList_0000) #define _XmMMsgSSpinB_0001 _XmCatgets(Xm_catd, MS_SSpinB, MSG_SSpinB_0001, _XmMsgSSpinB_0001) #define _XmMMsgSSpinB_0002 _XmCatgets(Xm_catd, MS_SSpinB, MSG_SSpinB_0002, _XmMsgSSpinB_0002) #define _XmMMsgSSpinB_0003 _XmCatgets(Xm_catd, MS_SSpinB, MSG_SSpinB_0003, _XmMsgSSpinB_0003) #define _XmMMsgDataF_0000 _XmCatgets(Xm_catd, MS_DataF, MSG_DataF_0000, _XmMsgDataF_0000) #define _XmMMsgDataF_0001 _XmCatgets(Xm_catd, MS_DataF, MSG_DataF_0001, _XmMsgDataF_0001) #define _XmMMsgDataF_0002 _XmCatgets(Xm_catd, MS_DataF, MSG_DataF_0002, _XmMsgDataF_0002) #define _XmMMsgDataF_0003 _XmCatgets(Xm_catd, MS_DataF, MSG_DataF_0003, _XmMsgDataF_0003) #define _XmMMsgDataF_0004 _XmCatgets(Xm_catd, MS_DataF, MSG_DataF_0004, _XmMsgDataF_0004) #define _XmMMsgDataF_0005 _XmCatgets(Xm_catd, MS_DataF, MSG_DataF_0005, _XmMsgDataF_0005) #define _XmMMsgDataF_0006 _XmCatgets(Xm_catd, MS_DataF, MSG_DataF_0006, _XmMsgDataF_0006) #define _XmMMsgDataFWcs_0000 _XmCatgets(Xm_catd, MS_DataFWcs, MSG_DatFWcs_0000, _XmMsgDataFWcs_0000) #define _XmMMsgDataFWcs_0001 _XmCatgets(Xm_catd, MS_DataFWcs, MSG_DataFWcs_0001, _XmMsgDataFWcs_0001) motif-2.3.8/lib/Xm/TabStack.h0000644000175000017500000000402612672140200012556 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef __XmTabStack_h__ #define __XmTabStack_h__ #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmTabStackRec *XmTabStackWidget; typedef struct _XmTabStackClassRec *XmTabStackWidgetClass; extern WidgetClass xmTabStackWidgetClass; #ifndef XmIsTabStack #define XmIsTabStack(w) XtIsSubclass(w, xmTabStackWidgetClass) #endif /* XmIsTabStack */ extern Widget XmCreateTabStack(Widget, String, ArgList, Cardinal); extern Widget XmTabStackGetSelectedTab(Widget); extern void XmTabStackSelectTab(Widget, Boolean); extern Widget XmTabStackIndexToWidget(Widget, int); extern Widget XmTabStackXYToWidget(Widget, int, int); /* * Variable argument list functions */ extern Widget XmVaCreateTabStack( Widget parent, char *name, ...); extern Widget XmVaCreateManagedTabStack( Widget parent, char *name, ...); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* __TabStack_h__ */ motif-2.3.8/lib/Xm/SeparatoG.h0000644000175000017500000000420513145162623012757 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* Separator Gadget */ #ifndef _XmSeparatorGadget_h #define _XmSeparatorGadget_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsSeparatorGadget #define XmIsSeparatorGadget(w) XtIsSubclass(w, xmSeparatorGadgetClass) #endif /* XmIsSeparator */ externalref WidgetClass xmSeparatorGadgetClass; typedef struct _XmSeparatorGadgetClassRec * XmSeparatorGadgetClass; typedef struct _XmSeparatorGadgetRec * XmSeparatorGadget; typedef struct _XmSeparatorGCacheObjRec * XmSeparatorGCacheObject; /******** Public Function Declarations ********/ Widget XmCreateSeparatorGadget( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; Widget XmVaCreateSeparatorGadget( Widget parent, char *name, ...); Widget XmVaCreateManagedSeparatorGadget( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSeparatorGadget_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Png.c0000644000175000017500000003730312672140561011617 00000000000000#include #include #include #include "PngI.h" static double get_display_exponent(void); static int png_process_image(Screen *screen, XImage *ximage, int image_rowbytes, int image_channels, unsigned char bg_red, unsigned char bg_green, unsigned char bg_blue, unsigned char *image_data); static int png_msb(unsigned long u32val); static int png_load_file(FILE *infile, unsigned long *pWidth, unsigned long *pHeight, unsigned char *red, unsigned char *green, unsigned char *blue, int *pChannels, unsigned long *pRowbytes, unsigned char **image_data); int _XmPngGetImage(Screen *screen, FILE *infile, Pixel background, XImage **ximage) { XColor xcolor; int image_channels; unsigned char bg_red = 0, bg_green = 0, bg_blue = 0; unsigned char *image_data = NULL; unsigned long image_width, image_height, image_rowbytes; unsigned char *xdata; int pad; int rc; xcolor.pixel = background; XQueryColor(screen->display, screen->cmap, &xcolor); bg_red = xcolor.red; bg_green = xcolor.green; bg_blue = xcolor.blue; rc = png_load_file(infile, &image_width, &image_height, NULL, NULL, NULL, &image_channels, &image_rowbytes, &image_data); /* XXX if background is XmINSPECIFIED_PIXEL, we cat try to get background from the PNG image, but I can doesn't have this information. rc = readpng_load_file(infile, &image_width, &image_height, &bg_red, &bg_green, &bg_blue, &image_channels, &image_rowbytes, &image_data); */ if (rc) return rc; if (screen->root_depth == 24 || screen->root_depth == 32) { xdata = (unsigned char *) malloc(4 * image_width * image_height); pad = 32; } else if (screen->root_depth == 16) { xdata = (unsigned char *) malloc(2 * image_width * image_height); pad = 16; } else { /* depth == 8 */ xdata = (unsigned char *) malloc(image_width * image_height); pad = 8; } if (!xdata) return 4; *ximage = XCreateImage(screen->display, screen->root_visual, screen->root_depth, ZPixmap, 0, (char *) xdata, image_width, image_height, pad, 0); if (!*ximage) { free(xdata); return 4; } (*ximage)->byte_order = MSBFirst; rc = png_process_image(screen, *ximage, image_rowbytes, image_channels, bg_red, bg_green, bg_blue, image_data); if (image_data) { free(image_data); image_data = NULL; } return rc; } static double get_display_exponent(void) { double LUT_exponent; /* just the lookup table */ double CRT_exponent = 2.2; /* just the monitor */ double default_display_exponent; /* whole display system */ char *p; double display_exponent; /* First set the default value for our display-system exponent, i.e., * the product of the CRT exponent and the exponent corresponding to * the frame-buffer's lookup table (LUT), if any. This is not an * exhaustive list of LUT values (e.g., OpenStep has a lot of weird * ones), but it should cover 99% of the current possibilities. */ LUT_exponent = 1.0; /* assume no LUT: most PCs */ /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */ default_display_exponent = LUT_exponent * CRT_exponent; /* If the user has set the SCREEN_GAMMA environment variable as suggested * (somewhat imprecisely) in the libpng documentation, use that; otherwise * use the default value we just calculated. Either way, the user may * override this via a command-line option. */ if ((p = getenv("SCREEN_GAMMA")) != NULL) display_exponent = atof(p); else display_exponent = default_display_exponent; return display_exponent; } /* return value = 0 for success, 1 for bad sig, 2 for bad struct (IHDR or kBGD), 4 for no mem 5 if fails due to no bKGD chunk */ static int png_load_file(FILE *infile, unsigned long *pWidth, unsigned long *pHeight, unsigned char *red, unsigned char *green, unsigned char *blue, int *pChannels, unsigned long *pRowbytes, unsigned char **image_data) { png_structp png_ptr = NULL; png_infop info_ptr = NULL; int bit_depth, color_type; png_uint_32 width, height; // int rc; unsigned char sig[8]; png_color_16p pBackground; double gamma; png_uint_32 i, rowbytes; png_bytepp row_pointers = NULL; fread(sig, 1, 8, infile); if (png_sig_cmp(sig, 0, 8)) return 1; /* bad signature */ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_ptr) return 4; /* out of memory */ info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) { png_destroy_read_struct(&png_ptr, NULL, NULL); return 4; /* out of memory */ } /* setjmp() must be called in every function that calls a PNG-reading * libpng function */ if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return 2; } png_init_io(png_ptr, infile); png_set_sig_bytes(png_ptr, 8); /* we already read the 8 signature bytes */ png_read_info(png_ptr, info_ptr); /* read all PNG info up to image data */ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, NULL, NULL, NULL); if (pWidth) *pWidth = width; if (pHeight) *pHeight = height; if (red && green && blue) { if (png_get_valid(png_ptr, info_ptr, PNG_INFO_bKGD)) { png_get_bKGD(png_ptr, info_ptr, &pBackground); if (bit_depth == 16) { *red = pBackground->red >> 8; *green = pBackground->green >> 8; *blue = pBackground->blue >> 8; } else if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) { if (bit_depth == 1) *red = *green = *blue = pBackground->gray ? 255 : 0; else if (bit_depth == 2) *red = *green = *blue = (255 / 3) * pBackground->gray; else /* bit_depth == 4 */ *red = *green = *blue = (255 / 15) * pBackground->gray; } else { *red = (unsigned char) pBackground->red; *green = (unsigned char) pBackground->green; *blue = (unsigned char) pBackground->blue; } } } if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_expand(png_ptr); if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 16) png_set_expand(png_ptr); if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_expand(png_ptr); if (bit_depth == 16) png_set_strip_16(png_ptr); if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb(png_ptr); if (png_get_gAMA(png_ptr, info_ptr, &gamma)) png_set_gamma(png_ptr, get_display_exponent(), gamma); /* all transformations have been registered; now update info_ptr data, * get rowbytes and channels, and allocate image memory */ png_read_update_info(png_ptr, info_ptr); *pRowbytes = rowbytes = png_get_rowbytes(png_ptr, info_ptr); *pChannels = (int) png_get_channels(png_ptr, info_ptr); if ((*image_data = (unsigned char *) malloc(rowbytes * height)) == NULL) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return 4; } if ((row_pointers = (png_bytepp) malloc(height * sizeof(png_bytep))) == NULL) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); free(*image_data); *image_data = NULL; return 4; } /* set the individual row_pointers to point at the correct offsets */ for (i = 0; i < height; ++i) row_pointers[i] = *image_data + i * rowbytes; /* now we can go ahead and just read the whole image */ png_read_image(png_ptr, row_pointers); /* and we're done! (png_read_end() can be omitted if no processing of * post-IDAT text/time/etc. is desired) */ free(row_pointers); row_pointers = NULL; png_read_end(png_ptr, NULL); if (png_ptr && info_ptr) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); png_ptr = NULL; info_ptr = NULL; } return 0; } static int png_process_image(Screen *screen, XImage *ximage, int image_rowbytes, int image_channels, unsigned char bg_red, unsigned char bg_green, unsigned char bg_blue, unsigned char *image_data) { unsigned char *src; char *dest; unsigned char r, g, b, a; unsigned long i, row, lastrow = 0; unsigned long pixel; int ximage_rowbytes = ximage->bytes_per_line; static int RShift, GShift, BShift; static unsigned long RMask, GMask, BMask; unsigned short red, green, blue; RMask = screen->root_visual->red_mask; GMask = screen->root_visual->green_mask; BMask = screen->root_visual->blue_mask; if (screen->root_depth == 15 || screen->root_depth == 16) { RShift = 15 - png_msb(RMask); GShift = 15 - png_msb(GMask); BShift = 15 - png_msb(BMask); } else if (screen->root_depth > 16) { RShift = png_msb(RMask) - 7; GShift = png_msb(GMask) - 7; BShift = png_msb(BMask) - 7; } if (screen->root_depth == 24 || screen->root_depth == 32) { for (lastrow = row = 0; row < ximage->height; ++row) { src = image_data + row * image_rowbytes; dest = ximage->data + row * ximage_rowbytes; if (image_channels == 3) { for (i = ximage->width; i > 0; --i) { red = *src++; green = *src++; blue = *src++; #ifdef NO_24BIT_MASKS pixel = (red << RShift) | (green << GShift) | (blue << BShift); /* recall that we set ximage->byte_order = MSBFirst above */ /* GRR BUG: this assumes bpp == 32, but may be 24: */ *dest++ = (char) ((pixel >> 24) & 0xff); *dest++ = (char) ((pixel >> 16) & 0xff); *dest++ = (char) ((pixel >> 8) & 0xff); *dest++ = (char) (pixel & 0xff); #else red = (RShift < 0) ? red << (-RShift) : red >> RShift; green = (GShift < 0) ? green << (-GShift) : green >> GShift; blue = (BShift < 0) ? blue << (-BShift) : blue >> BShift; pixel = (red & RMask) | (green & GMask) | (blue & BMask); /* recall that we set ximage->byte_order = MSBFirst above */ *dest++ = (char) ((pixel >> 24) & 0xff); *dest++ = (char) ((pixel >> 16) & 0xff); *dest++ = (char) ((pixel >> 8) & 0xff); *dest++ = (char) (pixel & 0xff); #endif } } else { /* if (image_channels == 4) */ for (i = ximage->width; i > 0; --i) { r = *src++; g = *src++; b = *src++; a = *src++; if (a == 255) { red = r; green = g; blue = b; } else if (a == 0) { red = bg_red; green = bg_green; blue = bg_blue; } else { /* this macro (from png.h) composites the foreground * and background values and puts the result into the * first argument */ png_composite(red, r, a, bg_red); png_composite(green, g, a, bg_green); png_composite(blue, b, a, bg_blue); } pixel = (red << RShift) | (green << GShift) | (blue << BShift); /* recall that we set ximage->byte_order = MSBFirst above */ *dest++ = (char) ((pixel >> 24) & 0xff); *dest++ = (char) ((pixel >> 16) & 0xff); *dest++ = (char) ((pixel >> 8) & 0xff); *dest++ = (char) (pixel & 0xff); } } } } else if (screen->root_depth == 16) { for (lastrow = row = 0; row < ximage->height; ++row) { src = image_data + row * image_rowbytes; dest = ximage->data + row * ximage_rowbytes; if (image_channels == 3) { for (i = ximage->width; i > 0; --i) { red = ((unsigned short) (*src) << 8); ++src; green = ((unsigned short) (*src) << 8); ++src; blue = ((unsigned short) (*src) << 8); ++src; pixel = ((red >> RShift) & RMask) | ((green >> GShift) & GMask) | ((blue >> BShift) & BMask); /* recall that we set ximage->byte_order = MSBFirst above */ *dest++ = (char) ((pixel >> 8) & 0xff); *dest++ = (char) (pixel & 0xff); } } else { /* if (image_channels == 4) */ for (i = ximage->width; i > 0; --i) { r = *src++; g = *src++; b = *src++; a = *src++; if (a == 255) { red = ((unsigned short) r << 8); green = ((unsigned short) g << 8); blue = ((unsigned short) b << 8); } else if (a == 0) { red = ((unsigned short) bg_red << 8); green = ((unsigned short) bg_green << 8); blue = ((unsigned short) bg_blue << 8); } else { /* this macro (from png.h) composites the foreground * and background values and puts the result back into * the first argument (== fg byte here: safe) */ png_composite(r, r, a, bg_red); png_composite(g, g, a, bg_green); png_composite(b, b, a, bg_blue); red = ((unsigned short) r << 8); green = ((unsigned short) g << 8); blue = ((unsigned short) b << 8); } pixel = ((red >> RShift) & RMask) | ((green >> GShift) & GMask) | ((blue >> BShift) & BMask); /* recall that we set ximage->byte_order = MSBFirst above */ *dest++ = (char) ((pixel >> 8) & 0xff); *dest++ = (char) (pixel & 0xff); } } } } else { /* depth == 8 */ /* XXX: add 8-bit support */ } return 0; } static int png_msb(unsigned long u32val) { int i; for (i = 31; i >= 0; --i) { if (u32val & 0x80000000L) break; u32val <<= 1; } return i; } motif-2.3.8/lib/Xm/TextFSelP.h0000644000175000017500000000221613145162623012710 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextFSelP_h #define _XmTextFSelP_h #include #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextFSelP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmRenderT.c0000644000175000017500000027520013066310437012742 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #define FIX_1152 #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: XmRenderT.c /main/14 1998/10/26 20:14:42 samborn $" #endif #endif #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #ifdef __cplusplus extern "C" { /* some 'locale.h' do not have prototypes (sun) */ #endif #include #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif /* __cplusplus */ #include /* For ALLOCATE/DEALLOCATE_LOCAL */ #include #include #include #include /* For XmGetXmDisplay */ #include /* For direct access to callback fields */ #include "MessagesI.h" #include "XmI.h" #include "XmRenderTI.h" #include "XmStringI.h" #include "XmTabListI.h" #ifdef USE_XFT #include #endif /* Warning Messages */ #define NO_NULL_TAG_MSG _XmMMsgXmRenderT_0000 #define NULL_DISPLAY_MSG _XmMMsgXmRenderT_0001 #define INVALID_TYPE_MSG _XmMMsgXmRenderT_0002 #define CONVERSION_FAILED_MSG _XmMMsgXmRenderT_0003 #define NULL_FONT_TYPE_MSG _XmMMsgXmRenderT_0004 #define NULL_LOAD_IMMEDIATE_MSG _XmMMsgXmRenderT_0005 /* local macros */ #define GetHandle(type) (type *)XtMalloc(sizeof(type)) #define FreeHandle(handle) XtFree((char *)handle) #define SetPtr(handle, ptr) *(handle) = ptr #define GetPtr(handle) *(handle) #define NameIsString(fontname) \ (((fontname) != NULL) && ((fontname) != (String)XmAS_IS)) #define ListIsList(tablist) \ (((tablist) != NULL) && \ ((unsigned int)(unsigned long)(tablist) != XmAS_IS)) #define FIX_1414 #define FIX_1449 #define FIX_1444 #define FIX_1451 #define FIX_1536 /********************************************************************** * IMPORTANT NOTE: IMPLEMENTATION OF SHARING * * Instances of XmRenderTable and XmRendition are shared via a * reference counting mechanism. This comment provides a general * overview of how this is done. * * First, both rendertable and renditions are indirectly * referenced via a handle mechanism. See the GetHandle, * FreeHandle, SetPtr and GetPtr macros above. This allows * either the handle to change without the underlying data * structure changing, or the underlying data structure to change * without the handle changing. I will indicate below where this * happens. * * Second, the real data structure for rendertable and rendition * contain a reference count. This count is incremented on copy * and decremented on free. If a decrement produces a zero * refcount, the actual memory is freed. If an increment * produces a zero refcount, then the refcount has overflowed. The * refcount is decremented, and new memory is allocated for a new * copy. * * Finally, I have defined a terminology for the different types * of "copying" that can done based on allocating a new handle or * not and allocating a new data structure or not. This probably * conflicts with some other existing terminology, probably in * object oriented programming. Sorry about that. * * Function: Clone Copy Renew Duplicate * (Mutate) (Update) * * handle new new old old * structure new inc new inc * (changed) (changed) * * (changed) indicates that the data in the new structure has * been changed from the data in the old structure. * * I will use these terms as a short hand in describing the * functions below. **********************************************************************/ /******** Static Function Declarations ********/ static void CopyInto(XmRendition toRend, XmRendition fromRend); static void MergeInto(XmRendition toRend, XmRendition fromRend); static XmRendition CloneRendition(XmRendition rend); static XmRendition CopyRendition(XmRendition rend); static XmRendition RenewRendition(XmRendition rend); static XmRendition DuplicateRendition(XmRendition rend); static Boolean FreeRendition(XmRendition rend); static void RenditionWarning(char *tag, char *type, char *message, Display *dpy); static void CleanupResources(XmRendition rend, Boolean copy); static void ValidateTag(XmRendition rend, XmStringTag dflt); static void ValidateAndLoadFont(XmRendition rend, Display *display); static void SetRend(XmRendition to, XmRendition from); static Boolean RendComplete(XmRendition rend); static void CopyFromArg(XtArgVal src, char *dst, unsigned int size); static void CopyToArg(char *src, XtArgVal *dst, unsigned int size); static Cardinal GetNamesAndClasses(Widget w, XrmNameList names, XrmClassList classes); static XrmResourceList CompileResourceTable(XtResourceList resources, Cardinal num_resources); static Boolean GetResources(XmRendition rend, Display *dsp, Widget wid, String resname, String resclass, XmStringTag tag, ArgList arglist, Cardinal argcount); static void SetDefault(XmRendition rend); #ifdef USE_XFT #ifdef FIX_1536 static XftColor GetCachedXftColor(Display *display, Pixel color); #endif #endif /******** End Static Function Declarations ********/ /* Resource List. */ /************************************************************************/ /* N.B.: The SetDefault procedure has a hardcoded list of all the */ /* common resources. Be sure to update it when adding resources. */ /************************************************************************/ #define DEFAULT_loadModel XmAS_IS #define DEFAULT_tag XmS #define DEFAULT_fontName (String)XmAS_IS #define DEFAULT_fontType (XmFontType)XmAS_IS #define DEFAULT_font (XtPointer)XmAS_IS #define DEFAULT_tabs (XmTabList)XmAS_IS #define DEFAULT_background XmUNSPECIFIED_PIXEL #define DEFAULT_foreground XmUNSPECIFIED_PIXEL #define DEFAULT_underlineType XmAS_IS #define DEFAULT_strikethruType XmAS_IS #define DEFAULT_backgroundState XmAS_IS #define DEFAULT_foregroundState XmAS_IS #ifdef USE_XFT #define DEFAULT_xftFont (XtPointer)XmAS_IS #define DEFAULT_fontStyle (String)NULL #define DEFAULT_fontFoundry (String)NULL #define DEFAULT_fontEncoding (String)NULL #define DEFAULT_fontSize 0 #endif static XtResource _XmRenditionResources[] = { { XmNtag, XmCTag, XmRString, sizeof(XmStringTag), XtOffsetOf(_XmRenditionRec, tag), XmRImmediate, (XtPointer) DEFAULT_tag }, { XmNfontName, XmCFontName, XmRString, sizeof(String), XtOffsetOf(_XmRenditionRec, fontName), XmRImmediate, (XtPointer) DEFAULT_fontName }, { XmNfontType, XmCFontType, XmRFontType, sizeof(XmFontType), XtOffsetOf(_XmRenditionRec, fontType), XmRImmediate, (XtPointer) DEFAULT_fontType }, { XmNfont, XmCFont, XmRFontStruct, sizeof(XtPointer), XtOffsetOf(_XmRenditionRec, font), XmRImmediate, (XtPointer) DEFAULT_font }, { XmNloadModel, XmCLoadModel, XmRLoadModel, sizeof(unsigned char), XtOffsetOf(_XmRenditionRec, loadModel), XmRImmediate, (XtPointer) DEFAULT_loadModel }, { XmNtabList, XmCTabList, XmRTabList, sizeof(XmTabList), XtOffsetOf(_XmRenditionRec, tabs), XmRImmediate, (XtPointer) DEFAULT_tabs }, #if USE_XFT { XmNxftFont, XmCXftFont, XmRPointer, sizeof (XtPointer), XtOffsetOf (_XmRenditionRec, xftFont), XmRImmediate, (XtPointer) DEFAULT_xftFont }, { XmNrenditionBackground, XmCRenditionBackground, XmRRenditionPixel, sizeof (Pixel), XtOffsetOf (_XmRenditionRec, xftBackground.pixel), XmRImmediate, (XtPointer) DEFAULT_background }, { XmNrenditionForeground, XmCRenditionForeground, XmRRenditionPixel, sizeof (Pixel), XtOffsetOf (_XmRenditionRec, xftForeground.pixel), XmRImmediate, (XtPointer) DEFAULT_foreground }, { XmNfontStyle, XmCFontStyle, XmRString, sizeof(String), XtOffsetOf (_XmRenditionRec, fontStyle), XmRImmediate, (XtPointer) DEFAULT_fontStyle }, { XmNfontFoundry, XmCFontFoundry, XmRString, sizeof(String), XtOffsetOf (_XmRenditionRec, fontFoundry), XmRImmediate, (XtPointer) DEFAULT_fontFoundry }, { XmNfontEncoding, XmCFontEncoding, XmRString, sizeof(String), XtOffsetOf (_XmRenditionRec, fontEncoding), XmRImmediate, (XtPointer) DEFAULT_fontEncoding }, { XmNfontSize, XmCFontSize, XmRInt, sizeof(int), XtOffsetOf (_XmRenditionRec, fontSize), XmRImmediate, (XtPointer) DEFAULT_fontSize }, #else { XmNrenditionBackground, XmCRenditionBackground, XmRRenditionPixel, sizeof (Pixel), XtOffsetOf (_XmRenditionRec, background), XmRImmediate, (XtPointer) DEFAULT_background }, { XmNrenditionForeground, XmCRenditionForeground, XmRRenditionPixel, sizeof (Pixel), XtOffsetOf (_XmRenditionRec, foreground), XmRImmediate, (XtPointer) DEFAULT_foreground }, #endif { XmNunderlineType, XmCUnderlineType, XmRLineType, sizeof(unsigned char), XtOffsetOf(_XmRenditionRec, underlineType), XmRImmediate, (XtPointer) DEFAULT_underlineType }, { XmNstrikethruType, XmCStrikethruType, XmRLineType, sizeof(unsigned char), XtOffsetOf(_XmRenditionRec, strikethruType), XmRImmediate, (XtPointer) DEFAULT_strikethruType }, { XmNforegroundState, XmCGroundState, XmRGroundState, sizeof(unsigned char), XtOffsetOf(_XmRenditionRec, foregroundState), XmRImmediate, (XtPointer) DEFAULT_foregroundState }, { XmNbackgroundState, XmCGroundState, XmRGroundState, sizeof(unsigned char), XtOffsetOf(_XmRenditionRec, backgroundState), XmRImmediate, (XtPointer) DEFAULT_backgroundState }, }; static XmConst Cardinal _XmNumRenditionResources = XtNumber(_XmRenditionResources); /* Searches up widget hierarchy, quarkifying ancestor names and */ /* classes. */ static Cardinal GetNamesAndClasses(Widget w, XrmNameList names, XrmClassList classes) { Cardinal length, j; XrmQuark t; WidgetClass wc; /* Return null-terminated quark arrays, with length the number of quarks (not including NULL) */ for (length = 0; w != NULL; w = (Widget)w->core.parent) { names[length] = w->core.xrm_name; wc = XtClass(w); /* KLUDGE KLUDGE KLUDGE KLUDGE */ if (w->core.parent == NULL && XtIsApplicationShell(w)) { classes[length] = ((ApplicationShellWidget) w)->application.xrm_class; } else classes[length] = wc->core_class.xrm_class; length++; } /* They're in backwards order, flop them around */ for (j = 0; j < length/2; j++) { t = names[j]; names[j] = names[length-j-1]; names[length-j-1] = t; t = classes[j]; classes[j] = classes[length-j-1]; classes[length-j-1] = t; } names[length] = NULLQUARK; classes[length] = NULLQUARK; return length; } /* GetNamesAndClasses */ /* Converts resource list to quarkified list. */ static XrmResourceList CompileResourceTable(XtResourceList resources, Cardinal num_resources) { Cardinal count; XrmResourceList table, tPtr; XtResourceList rPtr; tPtr = table = (XrmResourceList)XtMalloc(num_resources * sizeof(XrmResource)); rPtr = resources; for (count = 0; count < num_resources; count++, tPtr++, rPtr++) { tPtr->xrm_name = XrmPermStringToQuark(rPtr->resource_name); tPtr->xrm_class = XrmPermStringToQuark(rPtr->resource_class); tPtr->xrm_type = XrmPermStringToQuark(rPtr->resource_type); tPtr->xrm_size = rPtr->resource_size; tPtr->xrm_offset = rPtr->resource_offset; tPtr->xrm_default_type = XrmPermStringToQuark(rPtr->default_type); tPtr->xrm_default_addr = rPtr->default_addr; } return(table); } /* Does resource database lookup for arglist, filling in defaults from */ /* resource list as necessary. */ static Boolean GetResources(XmRendition rend, Display *dsp, Widget wid, String resname, String resclass, XmStringTag tag, ArgList arglist, Cardinal argcount) { XrmName names[100]; XrmClass classes[100]; Cardinal length = 0; static XrmQuarkList quarks = NULL; static Cardinal num_quarks = 0; static Boolean *found = NULL; int i, j; static XrmResourceList table = NULL; static XrmQuark QString; static XrmQuark Qfont; Arg *arg; XrmName argName; XrmResource *res; XrmDatabase db = NULL; XrmHashTable stackSearchList[100]; XrmHashTable *searchList = stackSearchList; unsigned int searchListSize = 100; Boolean got_one = False; XrmValue value; XrmQuark rawType; XrmValue convValue; Boolean have_value, copied; #ifdef XTHREADS XtAppContext app=NULL; if (wid) app = XtWidgetToApplicationContext(wid); else if (dsp) app = XtDisplayToApplicationContext(dsp); if (app) { _XmAppLock(app); } _XmProcessLock(); #endif /* Initialize quark cache */ if (quarks == NULL) { quarks = (XrmQuark *)XtMalloc(_XmNumRenditionResources * sizeof(XrmQuark)); num_quarks = _XmNumRenditionResources; } /* Initialize found */ if (found == NULL) found = (Boolean *)XtMalloc(_XmNumRenditionResources * sizeof(Boolean)); bzero(found, _XmNumRenditionResources * sizeof(Boolean)); /* Compile names and classes. */ if (wid != NULL) length = GetNamesAndClasses(wid, names, classes); names[length] = XrmStringToQuark(resname); classes[length] = XrmStringToQuark(resclass); length++; if (tag != NULL) { names[length] = XrmStringToQuark(tag); classes[length] = XrmPermStringToQuark(XmCRendition); length++; } names[length] = NULLQUARK; classes[length] = NULLQUARK; /* Cache arglist */ if (num_quarks < argcount) { quarks = (XrmQuark *)XtRealloc((char *)quarks, argcount * sizeof(XrmQuark)); num_quarks = argcount; } for (i = 0; i < argcount; i++) quarks[i] = XrmStringToQuark(arglist[i].name); /* Compile resource description into XrmResourceList if not already done. */ if (table == NULL) { table = CompileResourceTable(_XmRenditionResources, _XmNumRenditionResources); QString = XrmPermStringToQuark(XtCString); Qfont = XrmPermStringToQuark(XmNfont); } /* Set resources from arglist. */ for (arg = arglist, i = 0; i < argcount; arg++, i++) { argName = quarks[i]; for (j = 0, res = table; j < _XmNumRenditionResources; j++, res++) { if (res->xrm_name == argName) { CopyFromArg((arg->value), ((char *)GetPtr(rend) + res->xrm_offset), res->xrm_size); found[j] = TRUE; break; } } } /* DB query */ /* Get database */ if ((wid != NULL) || (dsp != NULL)) { if (wid != NULL) db = XtScreenDatabase(XtScreenOfObject(wid)); else db = XtScreenDatabase(DefaultScreenOfDisplay(dsp)); /* Get searchlist */ while (!XrmQGetSearchList(db, names, classes, searchList, searchListSize)) { if (searchList == stackSearchList) searchList = NULL; searchList = (XrmHashTable *)XtRealloc((char*)searchList, sizeof(XrmHashTable) * (searchListSize *= 2)); } } /* Loop over table */ for (j = 0, res = table; j < _XmNumRenditionResources; j++, res++) { if (!found[j]) { copied = False; have_value = False; if ((db != NULL) && (XrmQGetSearchResource(searchList, res->xrm_name, res->xrm_class, &rawType, &value))) { /* convert if necessary */ if (rawType != res->xrm_type) { if (wid != NULL) { convValue.size = res->xrm_size; convValue.addr = (char *)GetPtr(rend) + res->xrm_offset; /* * Check for special font case. * Depending upon the fontType resource, try to convert * to a FontSet, else to a FontStruct. */ if ((res->xrm_name == Qfont) && (_XmRendFontType(rend) == XmFONT_IS_FONTSET)) copied = have_value = XtConvertAndStore(wid, XrmQuarkToString(rawType), &value, "FontSet", &convValue); else copied = have_value = XtConvertAndStore(wid, XrmQuarkToString(rawType), &value, XrmQuarkToString(res->xrm_type), &convValue); } else have_value = False; } else have_value = True; /* Check for special font case */ if (have_value) { if (res->xrm_name == Qfont) { _XmRendFontName(rend) = value.addr; copied = True; } } } if (!got_one && have_value) got_one = True; /* Set defaults */ if (!have_value) { CopyFromArg((XtArgVal)(res->xrm_default_addr), ((char *)GetPtr(rend) + res->xrm_offset), res->xrm_size); copied = True; } /* Copy if needed */ if (!copied) { if (res->xrm_type == QString) *((String *)((char *)GetPtr(rend) + res->xrm_offset)) = value.addr; else if (value.addr != NULL) memcpy(((char *)GetPtr(rend) + res->xrm_offset), value.addr, res->xrm_size); else bzero(((char *)GetPtr(rend) + res->xrm_offset), res->xrm_size); } } } if (searchList != stackSearchList) XtFree((char *)searchList); #ifdef XTHREADS _XmProcessUnlock(); if (app) { _XmAppUnlock(app); } #endif return(got_one); } /* Sets all resources to defaults from resource list. */ static void SetDefault(XmRendition rend) { /* A more robust implementation of this routine would to to loop * over _XmRenditionResources and use CopyFromArg to reset values * in rend, but to improve performance we use direct assignments. */ if (rend == NULL) return; #ifdef USE_XFT memset (&(_XmRendXftFG(rend)), 0, sizeof (XftColor)); memset (&(_XmRendXftBG(rend)), 0, sizeof (XftColor)); #endif /* Leave _XmRendFontOnly unchanged. */ /* Leave _XmRendRefcount unchanged. */ _XmRendLoadModel(rend) = DEFAULT_loadModel; _XmRendTag(rend) = DEFAULT_tag; _XmRendFontName(rend) = DEFAULT_fontName; _XmRendFontType(rend) = DEFAULT_fontType; _XmRendFont(rend) = DEFAULT_font; /* Leave _XmRendDisplay unchanged. */ /* Leave _XmRendGC unchanged. */ /* Leave _XmRendTags unchanged. */ /* Leave _XmRendCount unchanged. */ /* Leave _XmRendHadEnds unchanged. */ _XmRendTabs(rend) = DEFAULT_tabs; _XmRendBG(rend) = DEFAULT_background; _XmRendFG(rend) = DEFAULT_foreground; _XmRendUnderlineType(rend) = DEFAULT_underlineType; _XmRendStrikethruType(rend) = DEFAULT_strikethruType; _XmRendBGState(rend) = DEFAULT_backgroundState; _XmRendFGState(rend) = DEFAULT_foregroundState; #ifdef USE_XFT _XmRendXftFG (rend).color.alpha = 0xFFFF; /*TODO: it is really needed? (yura)*/ _XmRendXftBG (rend).color.alpha = 0xFFFF; /*TODO: it is really needed? (yura)*/ _XmRendXftFont(rend) = DEFAULT_xftFont; _XmRendPattern(rend) = NULL; _XmRendFontStyle(rend) = DEFAULT_fontStyle; _XmRendFontFoundry(rend) = DEFAULT_fontFoundry; _XmRendFontEncoding(rend) = DEFAULT_fontEncoding; _XmRendFontSize(rend) = DEFAULT_fontSize; _XmRendPixelSize(rend) = 0; _XmRendFontSlant(rend) = 0; _XmRendFontSpacing(rend) = 0; _XmRendFontWeight(rend) = 0; #endif } /* Extern function to pick out display from rendertable. */ Display * _XmRenderTableDisplay(XmRenderTable table) { return(_XmRTDisplay(table)); } /* Find a rendition in table with matching tag. Call callback if not */ /* found and callback available. Fail if need_font is true and */ /* rendition found does not provide font. */ XmRendition _XmRenderTableFindRendition(XmRenderTable table, XmStringTag tag, #if NeedWidePrototypes int cached_tag, int need_font, int call, #else Boolean cached_tag, Boolean need_font, Boolean call, #endif /* NeedWidePrototypes */ short *index) { int i, j; XmRendition rend; Boolean hit = FALSE; XmDisplayCallbackStruct cb; XmDisplay dsp; XmRenderTable copy; if ((table == NULL) || (tag == NULL)) return(NULL); for (;;) /* May have to try twice */ { for (i = 0; i < _XmRTCount(table); i++) { rend = _XmRTRenditions(table)[i]; if ((cached_tag) ? (_XmRendTag(rend) == tag) : (strcmp(_XmRendTag(rend), tag) == 0)) { hit = TRUE; if ((_XmRendFont(rend) == NULL) && (_XmRendXftFont (rend) == NULL) && NameIsString(_XmRendFontName(rend))) { if (_XmRendLoadModel(rend) == XmLOAD_DEFERRED) _XmRendLoadModel(rend) = XmLOAD_IMMEDIATE; ValidateAndLoadFont(rend, _XmRendDisplay(rend)); if (need_font && (_XmRendFont(rend) == NULL && _XmRendXftFont(rend) == NULL)) break; } if (index != NULL) *index = i; return(rend); } } /* Are we done? */ if (hit || !call) break; call = FALSE; /* Call callback */ if (_XmRTDisplay(table) != NULL) { dsp = (XmDisplay) XmGetXmDisplay(_XmRTDisplay(table)); /* CR 7964: XtHasCallbacks is surprisingly expensive, */ /* so we use a conservative approximation here. */ if (dsp && dsp->display.noRenditionCallback) { copy = XmRenderTableCopy(table, NULL, 0); cb.reason = XmCR_NO_RENDITION; cb.event = NULL; cb.render_table = copy; cb.tag = tag; XtCallCallbackList((Widget)dsp, dsp->display.noRenditionCallback, &cb); if (cb.render_table != copy) { /* Callback mutated table. Update table with */ /* substitution and search again. */ for (j = 0; j < _XmRTCount(table); j++) if (FreeRendition(_XmRTRenditions(table)[j])) FreeHandle(_XmRTRenditions(table)[j]); if (_XmRTRefcountDec(table) == 0) XtFree((char *)GetPtr(table)); SetPtr(table, GetPtr(cb.render_table)); FreeHandle(cb.render_table); } else break; } else break; } else break; } /* Didn't find it. */ if (index != NULL) *index = -1; return(NULL); } /* If to has resource unset and from has it set, set in to. */ static void SetRend(XmRendition to, XmRendition from) { if (NameIsString(_XmRendFontName(from)) && !NameIsString(_XmRendFontName(to))) _XmRendFontName(to) = _XmRendFontName(from); if ((_XmRendFontType(from) != XmAS_IS) && (_XmRendFontType(to) == XmAS_IS)) _XmRendFontType(to) = _XmRendFontType(from); if ((_XmRendLoadModel(from) != XmAS_IS) && (_XmRendLoadModel(to) == XmAS_IS)) _XmRendLoadModel(to) = _XmRendLoadModel(from); if ((_XmRendFont(from) != NULL) && ((unsigned int)(unsigned long)_XmRendFont(to) == XmAS_IS)) _XmRendFont(to) = _XmRendFont(from); if (ListIsList(_XmRendTabs(from)) && !ListIsList(_XmRendTabs(to))) _XmRendTabs(to) = _XmRendTabs(from); #if USE_XFT if ((_XmRendFG(from) != XmUNSPECIFIED_PIXEL) && (_XmRendFG(to) == XmUNSPECIFIED_PIXEL)) { #ifdef FIX_1536 _XmRendFG(to) = _XmRendFG(from); _XmRendXftFG(to) = GetCachedXftColor(_XmRendDisplay(to), _XmRendFG(to)); #else XColor xcolor; _XmRendFG(to) = _XmRendFG(from); xcolor.pixel = _XmRendFG(to); XQueryColor(_XmRendDisplay(to), DefaultColormapOfScreen( DefaultScreenOfDisplay(_XmRendDisplay(to))), &xcolor); /* doesn't needed (_XmRendXftFG (to)).pixel = xcolor.pixel; */ (_XmRendXftFG(to)).color.red = xcolor.red; (_XmRendXftFG(to)).color.green = xcolor.green; (_XmRendXftFG(to)).color.blue = xcolor.blue; (_XmRendXftFG(to)).color.alpha = 0xFFFF; #endif } if ((_XmRendBG(from) != XmUNSPECIFIED_PIXEL) && (_XmRendBG(to) == XmUNSPECIFIED_PIXEL)) { #ifdef FIX_1536 _XmRendBG(to) = _XmRendBG (from); _XmRendXftBG(to) = GetCachedXftColor(_XmRendDisplay(to), _XmRendBG(to)); #else XColor xcolor; _XmRendBG(to) = _XmRendBG (from); xcolor.pixel = _XmRendBG (to); XQueryColor(_XmRendDisplay(to), DefaultColormapOfScreen( DefaultScreenOfDisplay(_XmRendDisplay(to))), &xcolor); /* doesn't needed (_XmRendXftBG (to)).pixel = xcolor.pixel; */ (_XmRendXftBG(to)).color.red = xcolor.red; (_XmRendXftBG(to)).color.green = xcolor.green; (_XmRendXftBG(to)).color.blue = xcolor.blue; (_XmRendXftBG(to)).color.alpha = 0xFFFF; #endif } if ((_XmRendXftFont (from) != NULL) && ((unsigned int) (unsigned long) _XmRendXftFont (to) == XmAS_IS)) _XmRendXftFont (to) = _XmRendXftFont (from); if ((_XmRendFontStyle (from) != NULL) && _XmRendFontStyle (to) == NULL) _XmRendFontStyle (to) = _XmRendFontStyle (from); if ((_XmRendFontFoundry (from) != NULL) && _XmRendFontFoundry (to) == NULL) _XmRendFontFoundry (to) = _XmRendFontFoundry (from); if ((_XmRendFontEncoding (from) != NULL) && _XmRendFontEncoding (to) == NULL) _XmRendFontEncoding (to) = _XmRendFontEncoding (from); if (_XmRendFontSize (to) == 0) _XmRendFontSize (to) = _XmRendFontSize (from); #else if ((_XmRendFG(from) != XmUNSPECIFIED_PIXEL) && (_XmRendFG(to) == XmUNSPECIFIED_PIXEL)) _XmRendFG(to) = _XmRendFG (from); if ((_XmRendBG(from) != XmUNSPECIFIED_PIXEL) && (_XmRendBG(to) == XmUNSPECIFIED_PIXEL)) _XmRendBG(to) = _XmRendBG (from); #endif if ((_XmRendUnderlineType(from) != XmAS_IS) && (_XmRendUnderlineType(to) == XmAS_IS)) _XmRendUnderlineType(to) = _XmRendUnderlineType(from); if ((_XmRendStrikethruType(from) != XmAS_IS) && (_XmRendStrikethruType(to) == XmAS_IS)) _XmRendStrikethruType(to) = _XmRendStrikethruType(from); } /* Check that all resources are not default values. */ static Boolean RendComplete(XmRendition rend) { return(((unsigned int)(unsigned long)_XmRendFontName(rend) != XmAS_IS) && (_XmRendFontType(rend) != XmAS_IS) && (_XmRendLoadModel(rend) != XmAS_IS) && ( ((unsigned int) (unsigned long) _XmRendFont (rend) != XmAS_IS) #ifdef USE_XFT || ((unsigned int) (unsigned long) _XmRendXftFont (rend) != XmAS_IS) #endif ) && ((unsigned int)(unsigned long)_XmRendTabs(rend) != XmAS_IS) && (_XmRendFG(rend) != XmUNSPECIFIED_PIXEL) && (_XmRendBG(rend) != XmUNSPECIFIED_PIXEL) && (_XmRendUnderlineType(rend) != XmAS_IS) && (_XmRendStrikethruType(rend) != XmAS_IS)); } /* Search rt for all renditions matching tags, successively merging */ /* resource values in scr rendition. */ /*ARGSUSED*/ XmRendition _XmRenditionMerge(Display *d, /* unused */ XmRendition *scr, XmRendition base_rend, XmRenderTable rt, XmStringTag base_tag, XmStringTag *tags, #if NeedWidePrototypes unsigned int tag_count, unsigned int copy #else unsigned short tag_count, Boolean copy #endif /* NeedWidePrototypes */ ) { XmRendition rend, tmp; int i; if (scr == NULL) { rend = XmRenditionCreate(NULL, XmS, NULL, 0); /* Create new */ } else { rend = *scr; if (copy) { if (NameIsString(_XmRendFontName(rend))) XtFree(_XmRendFontName(rend)); if (ListIsList(_XmRendTabs(rend))) XmTabListFree(_XmRendTabs(rend)); } SetDefault(rend); /* Reset state */ } for (i = (tag_count - 1); i >= 0; i--) { tmp = _XmRenderTableFindRendition(rt, tags[i], TRUE, FALSE, TRUE, NULL); if (tmp == NULL) continue; SetRend(rend, tmp); if (RendComplete(rend)) break; } if (!RendComplete(rend)) { short index; _XmRenderTableFindFallback(rt, base_tag, TRUE, &index, &tmp); if (tmp != NULL) SetRend(rend, tmp); } if (base_rend != NULL) { SetRend(rend, base_rend); if (_XmRendFGState(base_rend) == XmFORCE_COLOR) #if USE_XFT _XmRendXftFG(rend) = _XmRendXftFG(base_rend); #else _XmRendFG(rend) = _XmRendFG(base_rend); #endif if (_XmRendBGState(base_rend) == XmFORCE_COLOR) _XmRendBG(rend) = _XmRendBG(base_rend); } CleanupResources(rend, copy); return(rend); } /**************** * If the cached_tag flag is true, _XmRenderTableFindFallback assumes that the * tag pointer is a pointer out of the (local) tag cache. * Since XmRenditionCreate also uses tag pointers out of this cache, * a string compare is avoided by simply comparing pointer values. ****************/ extern Boolean _XmRenderTableFindFallback( XmRenderTable rendertable, XmStringTag tag, #if NeedWidePrototypes int cached_tag, #else Boolean cached_tag, #endif /* NeedWidePrototypes */ short *indx, XmRendition *rend_ptr ) { XmStringTag search_cset = NULL; *indx = -1 ; if ((rendertable != NULL) && (_XmRTCount(rendertable) == 0)) { *rend_ptr = NULL; return(FALSE); } if (rendertable != NULL) { if (tag != NULL) { if (cached_tag) /* No XmSTRING_DEFAULT_CHARSET */ { *rend_ptr = (XmRendition) _XmRenderTableFindRendition(rendertable, tag, TRUE, TRUE, FALSE, indx); if (*rend_ptr != NULL) return(TRUE); } else { XmStringTag curtag; if ((strcmp(tag, XmSTRING_DEFAULT_CHARSET) == 0)) curtag = _XmStringGetCurrentCharset(); else curtag = tag; *rend_ptr = (XmRendition) _XmRenderTableFindRendition(rendertable, curtag, FALSE, TRUE, FALSE, indx); if (*rend_ptr != NULL) return(TRUE); } /* Didn't find a match. See if tag is one of the defaults and search for the other. */ if (_XmStringIsCurrentCharset(tag)) { search_cset = XmFONTLIST_DEFAULT_TAG; *rend_ptr = (XmRendition) _XmRenderTableFindRendition(rendertable, search_cset, TRUE, TRUE, FALSE, indx); if (*rend_ptr != NULL) return(TRUE); } else if ((tag == XmFONTLIST_DEFAULT_TAG) || (strcmp(tag, XmFONTLIST_DEFAULT_TAG) == 0)) { search_cset = _XmStringGetCurrentCharset(); *rend_ptr = (XmRendition) _XmRenderTableFindRendition(rendertable, search_cset, FALSE, TRUE, FALSE, indx); if (*rend_ptr != NULL) return(TRUE); } } /* Otherwise pick up first font(set) if tag a default value. */ if ((tag == NULL) || (tag == XmFONTLIST_DEFAULT_TAG) || (strcmp(tag, XmFONTLIST_DEFAULT_TAG) == 0) || _XmStringIsCurrentCharset(tag)) return(_XmRenderTableFindFirstFont(rendertable, indx, rend_ptr)); } *rend_ptr = NULL; *indx = -1; return(FALSE); } extern Boolean _XmRenderTableFindFirstFont(XmRenderTable rendertable, short *indx, XmRendition *rend_ptr) { int i, f_idx = -1, fs_idx = -1; #ifdef USE_XFT int xft_idx = -1; #endif for (i = _XmRTCount(rendertable) - 1; i >= 0; i--) { *rend_ptr = _XmRTRenditions(rendertable)[i]; if (_XmRendFont(*rend_ptr) != NULL) { if (_XmRendFontType(*rend_ptr) == XmFONT_IS_FONT) f_idx = i; else if (_XmRendFontType(*rend_ptr) == XmFONT_IS_FONTSET) fs_idx = i; #ifdef USE_XFT } else if (_XmRendXftFont(*rend_ptr) != NULL) { if (_XmRendFontType(*rend_ptr) == XmFONT_IS_XFT) xft_idx = i; #endif } } #ifdef USE_XFT if (xft_idx >= 0) { *rend_ptr = _XmRTRenditions (rendertable)[xft_idx]; *indx = xft_idx; } else #endif if (fs_idx >= 0) { *rend_ptr = _XmRTRenditions(rendertable)[fs_idx]; *indx = fs_idx; } else if (f_idx >= 0) { *rend_ptr = _XmRTRenditions(rendertable)[f_idx]; *indx = f_idx; } else { *rend_ptr = NULL; *indx = -1; return(FALSE); } return(TRUE); } /* Put value of every resource in fromRend into toRend, copying where */ /* necessary. */ static void CopyInto(XmRendition toRend, XmRendition fromRend) { _XmRendTag(toRend) = _XmStringCacheTag(_XmRendTag(fromRend), XmSTRING_TAG_STRLEN); /* CR 7890 - the fontName might be XmAS_IS here - if so, we ** obviously don't want to do an XtNewString (implicit strcpy) */ if (!NameIsString(_XmRendFontName(fromRend))) _XmRendFontName(toRend) = NULL; else _XmRendFontName(toRend) = XtNewString(_XmRendFontName(fromRend)); _XmRendFontType(toRend) = _XmRendFontType(fromRend); _XmRendLoadModel(toRend) = _XmRendLoadModel(fromRend); _XmRendFont(toRend) = _XmRendFont(fromRend); _XmRendDisplay(toRend) = _XmRendDisplay(fromRend); if (!ListIsList(_XmRendTabs(fromRend))) _XmRendTabs(toRend) = NULL; else _XmRendTabs(toRend) = XmTabListCopy(_XmRendTabs(fromRend), 0, 0); #if USE_XFT _XmRendXftFont (toRend) = _XmRendXftFont (fromRend); _XmRendXftBG (toRend) = _XmRendXftBG (fromRend); _XmRendXftFG (toRend) = _XmRendXftFG (fromRend); _XmRendFontStyle (toRend) = _XmRendFontStyle (fromRend); _XmRendFontFoundry (toRend) = _XmRendFontFoundry (fromRend); _XmRendFontEncoding (toRend) = _XmRendFontEncoding (fromRend); _XmRendFontSize (toRend) = _XmRendFontSize (fromRend); #else _XmRendBG (toRend) = _XmRendBG (fromRend); _XmRendFG (toRend) = _XmRendFG (fromRend); #endif _XmRendUnderlineType(toRend) = _XmRendUnderlineType(fromRend); _XmRendStrikethruType(toRend) = _XmRendStrikethruType(fromRend); } /* As above, except only change resources in toRend that are default. */ static void MergeInto(XmRendition toRend, XmRendition fromRend) { _XmRendTag(toRend) = _XmStringCacheTag(_XmRendTag(fromRend), XmSTRING_TAG_STRLEN); if ((_XmRendFontName(toRend) == NULL) && NameIsString(_XmRendFontName(fromRend))) _XmRendFontName(toRend) = XtNewString(_XmRendFontName(fromRend)); if (_XmRendFontType(toRend) == XmAS_IS) _XmRendFontType(toRend) = _XmRendFontType(fromRend); if (_XmRendLoadModel(toRend) == XmAS_IS) _XmRendLoadModel(toRend) = _XmRendLoadModel(fromRend); if (_XmRendFont(toRend) == NULL) _XmRendFont(toRend) = _XmRendFont(fromRend); if (!ListIsList(_XmRendTabs(toRend)) && ListIsList(_XmRendTabs(fromRend))) _XmRendTabs(toRend) = XmTabListCopy(_XmRendTabs(fromRend), 0, 0); #if USE_XFT if (_XmRendXftFont(toRend) == NULL) _XmRendXftFont(toRend) = _XmRendXftFont(fromRend); if (_XmRendBG(toRend) == XmUNSPECIFIED_PIXEL) _XmRendXftBG(toRend) = _XmRendXftBG(fromRend); if (_XmRendFG(toRend) == XmUNSPECIFIED_PIXEL) _XmRendXftFG(toRend) = _XmRendXftFG(fromRend); if (_XmRendFontStyle(toRend) == NULL) _XmRendFontStyle(toRend) = _XmRendFontStyle(fromRend); if (_XmRendFontFoundry(toRend) == NULL) _XmRendFontFoundry(toRend) = _XmRendFontFoundry(fromRend); if (_XmRendFontEncoding(toRend) == NULL) _XmRendFontEncoding(toRend) = _XmRendFontEncoding(fromRend); if (_XmRendFontSize(toRend) == 0) _XmRendFontSize(toRend) = _XmRendFontSize(fromRend); #else if (_XmRendBG(toRend) == XmUNSPECIFIED_PIXEL) _XmRendBG(toRend) = _XmRendBG (fromRend); if (_XmRendFG(toRend) == XmUNSPECIFIED_PIXEL) _XmRendFG(toRend) = _XmRendFG (fromRend); #endif if (_XmRendUnderlineType(toRend) == XmAS_IS) _XmRendUnderlineType(toRend) = _XmRendUnderlineType(fromRend); if (_XmRendUnderlineType(toRend) == XmAS_IS) _XmRendStrikethruType(toRend) = _XmRendStrikethruType(fromRend); } /* Make a Clone--new handle and new data structure--of a rendition. */ static XmRendition CloneRendition(XmRendition rend) { _XmRendition copy; XmRendition copy_handle; if (rend == NULL) return(NULL); copy = (_XmRendition)XtMalloc(sizeof(_XmRenditionRec)); bzero((char*)copy, sizeof(_XmRenditionRec)); copy_handle = GetHandle(_XmRendition); SetPtr(copy_handle, copy); _XmRendFontOnly(copy_handle) = FALSE; _XmRendRefcount(copy_handle) = 1; CopyInto(copy_handle, rend); return(copy_handle); } /* Set the old handle to point to a new data structure. */ static XmRendition RenewRendition(XmRendition rend) { _XmRendition copy; if (rend == NULL) return(NULL); copy = (_XmRendition)XtMalloc(sizeof(_XmRenditionRec)); memcpy((char *)copy, (char *)GetPtr(rend), sizeof(_XmRenditionRec)); SetPtr(rend, copy); _XmRendFontOnly(rend) = FALSE; _XmRendRefcount(rend) = 1; return(rend); } /* Allocate a new handle which points to the old data structure with */ /* an incremented refcount. */ static XmRendition CopyRendition(XmRendition rend) { XmRendition copy; if (rend == NULL) return(NULL); if (_XmRendRefcountInc(rend) == 0) { _XmRendRefcountDec(rend); return(CloneRendition(rend)); } else { copy = GetHandle(_XmRendition); SetPtr(copy, GetPtr(rend)); return(copy); } } /* Increment the refcount. Clone if overflow. */ static XmRendition DuplicateRendition(XmRendition rend) { if (rend == NULL) return(NULL); if (_XmRendRefcountInc(rend) == 0) { _XmRendRefcountDec(rend); return(CloneRendition(rend)); } else { return(rend); } } /* Make a copy of a rendition, *including* the "scratch" info (tags, * GC, hadEnds). * Shared indicates whether or not this is a shared copy. */ XmRendition _XmRenditionCopy(XmRendition rend, Boolean shared) { XmRendition toRend; int i; if (rend == NULL) return(NULL); if (shared) toRend = CopyRendition(rend); else toRend = CloneRendition(rend); /* If we had to clone, copy the 'scratch' info. */ if (*toRend != *rend) { _XmRendGC(toRend) = _XmRendGC(rend); _XmRendTagCount(toRend) = _XmRendTagCount(rend); _XmRendHadEnds(toRend) = _XmRendHadEnds(rend); _XmRendTags(toRend) = (XmStringTag *)XtMalloc(sizeof(XmStringTag) * _XmRendTagCount(rend)); for (i = 0; i < _XmRendTagCount(rend); i++) _XmRendTags(toRend)[i] = _XmRendTags(rend)[i]; } return(toRend); } /* Creates new rendertable, adding any new renditions. */ /* Mutate rendertable. Copy renditions. */ XmRenderTable XmRenderTableAddRenditions(XmRenderTable oldtable, XmRendition *renditions, Cardinal rendition_count, XmMergeMode merge_mode) { int i, next; int count = rendition_count; XmRendition rend, match; _XmRenderTable table; XmRenderTable newtable, tmptable = NULL; Boolean *matches; short idx; XtAppContext app=NULL; if ((renditions == NULL) || (rendition_count == 0)) return(oldtable); #ifdef XTHREADS if (_XmRendDisplay(renditions[0])) app = XtDisplayToApplicationContext(_XmRendDisplay(renditions[0])); if (app) { _XmAppLock(app); } else { _XmProcessLock(); } #endif if (oldtable == NULL) { /* Malloc new table */ table = (_XmRenderTable)XtMalloc(sizeof(_XmRenderTableRec) + (sizeof(XmRendition) * (rendition_count - RENDITIONS_IN_STRUCT))); oldtable = GetHandle(_XmRenderTable); SetPtr(oldtable, table); _XmRTCount(oldtable) = rendition_count; _XmRTDisplay(oldtable) = NULL; _XmRTRefcount(oldtable) = 1; /* Copy renditions */ for (i = 0; i < rendition_count; i++) { _XmRTRenditions(oldtable)[i] = CopyRendition(renditions[i]); if (_XmRTDisplay(oldtable) == NULL) _XmRTDisplay(oldtable) = _XmRendDisplay(renditions[i]); } } else { matches = (Boolean *)ALLOCATE_LOCAL(rendition_count * sizeof(Boolean)); bzero(matches, rendition_count * sizeof(Boolean)); /* May have to copy table if shared. */ if (_XmRTRefcount(oldtable) > 1) { /* Allocate new table */ table = (_XmRenderTable) XtMalloc(sizeof(_XmRenderTableRec) + (sizeof(XmRendition) * (_XmRTCount(oldtable) - RENDITIONS_IN_STRUCT))); newtable = GetHandle(_XmRenderTable); SetPtr(newtable, table); _XmRTDisplay(newtable) = _XmRTDisplay(oldtable); _XmRTRefcount(newtable) = 1; /* Move old Renditions. */ for (i = 0; i < _XmRTCount(oldtable); i++) _XmRTRenditions(newtable)[i] = _XmRTRenditions(oldtable)[i]; _XmRTCount(newtable) = _XmRTCount(oldtable); _XmRTRefcountDec(oldtable); /* Free at end so we don't get same memory from malloc. */ tmptable = oldtable; oldtable = newtable; } /* Merge matching renditions */ for (i = 0; i < rendition_count; i++) { rend = renditions[i]; match = _XmRenderTableFindRendition(oldtable, _XmRendTag(rend), TRUE, FALSE, FALSE, &idx); if ((match != NULL) && (merge_mode != XmDUPLICATE)) { /* Merge renditions. */ switch (merge_mode) { case XmMERGE_REPLACE: if (FreeRendition(match)) FreeHandle(match); _XmRTRenditions(oldtable)[idx] = CopyRendition(rend); break; case XmSKIP: break; case XmMERGE_OLD: if (_XmRendRefcount(match) > 1) { match = CloneRendition(match); _XmRTRenditions(oldtable)[idx] = match; } MergeInto(match, rend); break; case XmMERGE_NEW: rend = CloneRendition(rend); MergeInto(rend, match); _XmRTRenditions(oldtable)[idx] = rend; if (FreeRendition(match)) FreeHandle(match); break; default: printf("NYI"); break; } matches[i] = TRUE; --count; } } if (count > 0) /* Allocate new table */ { table = (_XmRenderTable) XtMalloc(sizeof(_XmRenderTableRec) + (sizeof(XmRendition) * (_XmRTCount(oldtable) + count - RENDITIONS_IN_STRUCT))); newtable = GetHandle(_XmRenderTable); SetPtr(newtable, table); _XmRTDisplay(newtable) = _XmRTDisplay(oldtable); _XmRTRefcount(newtable) = 1; /* Move old Renditions. */ for (i = 0; i < _XmRTCount(oldtable); i++) _XmRTRenditions(newtable)[i] = _XmRTRenditions(oldtable)[i]; /* Copy new renditions. */ next = _XmRTCount(oldtable); for (i = 0; i < rendition_count; i++) { if (!matches[i]) { _XmRTRenditions(newtable)[next] = CopyRendition(renditions[i]); if (_XmRTDisplay(newtable) == NULL) _XmRTDisplay(newtable) = _XmRTDisplay(oldtable); ++next; } } _XmRTCount(newtable) = _XmRTCount(oldtable) + count; /* Deallocate oldtable */ XtFree((char *)GetPtr(oldtable)); FreeHandle(oldtable); } /* Otherwise just return newhandle to oldtable */ else { table = GetPtr(oldtable); newtable = GetHandle(_XmRenderTable); SetPtr(newtable, table); FreeHandle(oldtable); } DEALLOCATE_LOCAL((char *)matches); oldtable = newtable; } if (tmptable != NULL) FreeHandle(tmptable); #ifdef XTHREADS if (app) { _XmAppUnlock(app); } else { _XmProcessUnlock(); } #endif return(oldtable); } /* Remove matching renditions. */ /* Mutates oldtable, decrements removed renditions. */ XmRenderTable XmRenderTableRemoveRenditions(XmRenderTable oldtable, XmStringTag *tags, int tag_count) { XmRenderTable ret_val; #ifdef XTHREADS XtAppContext app=NULL; if (_XmRTDisplay(oldtable)) app = XtDisplayToApplicationContext(_XmRTDisplay(oldtable)); if (app) { _XmAppLock(app); } else { _XmProcessLock(); } #endif ret_val = _XmRenderTableRemoveRenditions(oldtable, tags,tag_count, FALSE, XmFONT_IS_FONT, NULL); #ifdef XTHREADS if (app) { _XmAppUnlock(app); } else { _XmProcessUnlock(); } #endif return ret_val; } /* Remove matching renditions. */ /* Mutates oldtable, decrements removed renditions. */ /* If chk_font TRUE, checks that font and type also match. */ XmRenderTable _XmRenderTableRemoveRenditions(XmRenderTable oldtable, XmStringTag *tags, int tag_count, #if NeedWidePrototypes int chk_font, #else Boolean chk_font, #endif /* NeedWidePrototypes */ XmFontType type, XtPointer font) { int i, j; int count; _XmRenderTable table; XmRenderTable newtable = NULL; if ((oldtable == NULL) || (tags == NULL) || (tag_count == 0)) return(oldtable); count = 0; if (_XmRTRefcount(oldtable) > 1) { /* Allocate new table */ table = (_XmRenderTable) XtMalloc(sizeof(_XmRenderTableRec) + (sizeof(XmRendition) * (_XmRTCount(oldtable) - RENDITIONS_IN_STRUCT))); newtable = GetHandle(_XmRenderTable); SetPtr(newtable, table); _XmRTDisplay(newtable) = _XmRTDisplay(oldtable); _XmRTRefcount(newtable) = 1; /* Move old Renditions. */ for (i = 0; i < _XmRTCount(oldtable); i++) _XmRTRenditions(newtable)[i] = _XmRTRenditions(oldtable)[i]; _XmRTCount(newtable) = _XmRTCount(oldtable); if (_XmRTRefcountDec(oldtable) == 0) XtFree((char *)GetPtr(oldtable)); FreeHandle(oldtable); oldtable = newtable; } /* Iterate over renditions */ for (i = 0; i < _XmRTCount(oldtable); i++) { /* Match against tags */ for (j = 0; j < tag_count; j++) { if ((strcmp(_XmRendTag(_XmRTRenditions(oldtable)[i]), tags[j]) == 0) && (!chk_font || ((font == _XmRendFont(_XmRTRenditions(oldtable)[i])) && (type == _XmRendFontType(_XmRTRenditions(oldtable)[i]))))) { if (FreeRendition(_XmRTRenditions(oldtable)[i])) FreeHandle(_XmRTRenditions(oldtable)[i]); _XmRTRenditions(oldtable)[i] = NULL; break; } } if (_XmRTRenditions(oldtable)[i] != NULL) { if (count != i) _XmRTRenditions(oldtable)[count] = _XmRTRenditions(oldtable)[i]; count++; } } if (count == 0) /* No renditions left. Return NULL. */ { XmRenderTableFree(oldtable); return(NULL); } else if (count < _XmRTCount(oldtable)) { /* Realloc table */ table = (_XmRenderTable)XtRealloc((char *)*oldtable, sizeof(_XmRenderTableRec) + (sizeof(XmRendition) * (count - RENDITIONS_IN_STRUCT))); if (newtable == NULL) { newtable = GetHandle(_XmRenderTable); FreeHandle(oldtable); } SetPtr(newtable, table); _XmRTCount(newtable) = count; return(newtable); } return(oldtable); } static void CopyFromArg(XtArgVal src, char *dst, unsigned int size) { if (size > sizeof(XtArgVal)) memcpy((char *)dst, (char *)src, (size_t)size); else { union { long longval; #ifdef FIX_1152 int intval; #endif short shortval; char charval; char* charptr; XtPointer ptr; } u; char *p = (char*)&u; if (size == sizeof(long)) u.longval = (long)src; #ifdef FIX_1152 else if (size == sizeof(int)) u.intval = (int) src; #endif else if (size == sizeof(short)) u.shortval = (short)src; else if (size == sizeof(char)) u.charval = (char)src; else if (size == sizeof(XtPointer)) u.ptr = (XtPointer)src; else if (size == sizeof(char*)) u.charptr = (char*)src; else p = (char*)&src; memcpy((char *)dst, p, (size_t)size); } } /* CopyFromArg */ static void CopyToArg(char *src, XtArgVal *dst, unsigned int size) { if ((void *)(*dst) == NULL) { /* old GetValues semantics (storing directly into arglists) are bad, * but preserve for compatibility as long as arglist contains NULL. */ if (size == sizeof(long)) *dst = (XtArgVal)*(long*)src; #ifdef FIX_1152 else if (size == sizeof(int)) *dst = (XtArgVal)*(int*)src; #endif else if (size == sizeof(short)) *dst = (XtArgVal)*(short*)src; else if (size == sizeof(char)) *dst = (XtArgVal)*(char*)src; else if (size == sizeof(XtPointer)) *dst = (XtArgVal)*(XtPointer*)src; else if (size == sizeof(char*)) *dst = (XtArgVal)*(char**)src; else if (size == sizeof(XtArgVal)) *dst = *(XtArgVal*)src; else memcpy((char*)dst, (char*)src, (size_t)size); } else { /* proper GetValues semantics: argval is pointer to destination */ if (size == sizeof(long)) *((long*)*dst) = *(long*)src; #ifdef FIX_1152 else if (size == sizeof(int)) *((int*)*dst) = *(int*)src; #endif else if (size == sizeof(short)) *((short*)*dst) = *(short*)src; else if (size == sizeof(char)) *((char*)*dst) = *(char*)src; else if (size == sizeof(XtPointer)) *((XtPointer*)*dst) = *(XtPointer*)src; else if (size == sizeof(char*)) *((char**)*dst) = *(char**)src; else if (size == sizeof(XtArgVal)) *((XtArgVal*)*dst)= *(XtArgVal*)src; else memcpy((char *)*dst, (char *)src, (size_t)size); } } /* CopyToArg */ /* Copies renditions matching tags to a new table. */ /* If all renditions copied then duplicate rendertable, duplicate */ /* renditions. Otherwise, mutate rendertable, duplicate renditions. */ XmRenderTable XmRenderTableCopy(XmRenderTable table, XmStringTag *tags, int tag_count) { XmRenderTable rt = NULL; _XmRenderTable t = NULL; int i, j, count; int size; XmRendition rend = NULL; XtAppContext app = NULL; if (table == NULL) return((XmRenderTable)NULL); #ifdef XTHREADS if (_XmRTDisplay(table)) app = XtDisplayToApplicationContext(_XmRTDisplay(table)); if (app) { _XmAppLock(app); } else { _XmProcessLock(); } #endif count = 0; if ((_XmRTRefcountInc(table) == 0) || (tags != NULL)) { /* Malloc new table */ _XmRTRefcountDec(table); if (tag_count > 0) size = (sizeof(_XmRendition) * (tag_count - RENDITIONS_IN_STRUCT)); else size = (sizeof(_XmRendition) * (_XmRTCount(table) - RENDITIONS_IN_STRUCT)); size = (size < 0) ? 0 : size; t = (_XmRenderTable)XtMalloc(sizeof(_XmRenderTableRec) + size); rt = GetHandle(_XmRenderTable); SetPtr(rt, t); _XmRTRefcount(rt) = 1; } if (tags == NULL) { /* Increment renditions. */ for (i = 0; i < _XmRTCount(table); i++) { rend = DuplicateRendition(_XmRTRenditions(table)[i]); /* Check for overflow. */ if (rend != _XmRTRenditions(table)[i]) break; } if (i < _XmRTCount(table)) /* Overflow! */ { /* Malloc new table. */ t = (_XmRenderTable)XtMalloc(sizeof(_XmRenderTableRec) + (sizeof(_XmRendition) * (_XmRTCount(table) - RENDITIONS_IN_STRUCT))); rt = GetHandle(_XmRenderTable); SetPtr(rt, t); _XmRTRefcount(rt) = 1; _XmRTCount(rt) = _XmRTCount(table); /* Move renditions done already. */ for (j = 0; j < i; j++) _XmRTRenditions(rt)[j] = _XmRTRenditions(table)[j]; _XmRTRenditions(rt)[i] = rend; /* Copy rest */ for (j = i + 1; j < _XmRTCount(rt); j++) _XmRTRenditions(rt)[j] = DuplicateRendition(_XmRTRenditions(table)[j]); } else { rt = GetHandle(_XmRenderTable); SetPtr(rt, GetPtr(table)); } } else { /* Copy matching renditions. */ for (i = 0; i < tag_count; i++) { XmRendition match; match = XmRenderTableGetRendition(table, tags[i]); if (match != NULL) { _XmRTRenditions(rt)[i] = match; ++count; } } /* Realloc table */ t = (_XmRenderTable)XtRealloc((char *)t, sizeof(_XmRenderTableRec) + (sizeof(XmRendition) * (count - RENDITIONS_IN_STRUCT))); SetPtr(rt, t); _XmRTCount(rt) = count; } _XmRTDisplay(rt) = _XmRTDisplay(table); #ifdef XTHREADS if (app) { _XmAppUnlock(app); } else { _XmProcessUnlock(); } #endif return(rt); } /* Decrement rendertable, free if refcount is zero. XmRenditionFree */ /* renditions. */ void XmRenderTableFree(XmRenderTable table) { int i; _XmProcessLock(); for (i = 0; i < _XmRTCount(table); i++) if (FreeRendition(_XmRTRenditions(table)[i])) FreeHandle(_XmRTRenditions(table)[i]); if (_XmRTRefcountDec(table) == 0) XtFree((char *)GetPtr(table)); FreeHandle(table); _XmProcessUnlock(); } /* Get list of tags of all renditions in table. */ int XmRenderTableGetTags(XmRenderTable table, XmStringTag **tag_list) { int i, ret_val; XtAppContext app = NULL; if (table == NULL) { *tag_list = NULL; return(0); } app = XtDisplayToApplicationContext(_XmRTDisplay(table)); _XmAppLock(app); *tag_list = (XmStringTag *)XtMalloc(sizeof(XmStringTag) * _XmRTCount(table)); for (i = 0; i < _XmRTCount(table); i++) (*tag_list)[i] = XtNewString(_XmRendTag(_XmRTRenditions(table)[i])); ret_val = _XmRTCount(table); _XmAppUnlock(app); return ret_val; } /* Returns copy of matching rendition. */ XmRendition XmRenderTableGetRendition(XmRenderTable table, XmStringTag tag) { XmRendition ret_val; _XmDisplayToAppContext(_XmRTDisplay(table)); _XmAppLock(app); ret_val = CopyRendition(_XmRenderTableFindRendition(table, tag, FALSE, FALSE, FALSE, NULL)); _XmAppUnlock(app); return ret_val; } /* Returns array of copies of matching renditions. */ XmRendition * XmRenderTableGetRenditions(XmRenderTable table, char **tags, Cardinal tag_count) { XmRendition rend, *rends; int i, count; XtAppContext app = NULL; if ((table == NULL) || (tags == NULL) || (tag_count == 0)) return(NULL); #ifdef XTHREADS if (_XmRTDisplay(table)) { app = XtDisplayToApplicationContext(_XmRTDisplay(table)); _XmAppLock(app); } #endif rends = (XmRendition *)XtMalloc(tag_count * sizeof(XmRendition)); count = 0; for (i = 0; i < tag_count; i++) { rend = _XmRenderTableFindRendition(table, tags[i], FALSE, FALSE, FALSE, NULL); if (rend != NULL) { rends[count] = CopyRendition(rend); count++; } } if (count < tag_count) rends = (XmRendition *)XtRealloc((char *)rends, count * sizeof(XmRendition)); #ifdef XTHREADS if (app) { _XmAppUnlock(app); } #endif return(rends); } /* Wrapper for calling XtWarning functions. */ static void RenditionWarning(char *tag, char *type, char *message, Display *dpy) { char *params[1]; Cardinal num_params = 1 ; Display *d; /* the MotifWarningHandler installed in VendorS.c knows about this convention */ params[0] = XME_WARNING; if (dpy) d = dpy; else d = _XmGetDefaultDisplay(); if (d) XtAppWarningMsg (XtDisplayToApplicationContext(d), tag, type, "XmRendition", message, params, &num_params); else XtWarning(message); } /* Replace XmAS_IS and copy as necessary. */ static void CleanupResources(XmRendition rend, Boolean copy) { if ((unsigned int)(unsigned long)_XmRendFont(rend) == XmAS_IS) _XmRendFont(rend) = NULL; else if (_XmRendFontType(rend) == XmAS_IS) _XmRendFontType(rend) = XmFONT_IS_FONT; #ifdef USE_XFT if ((unsigned int)(unsigned long)_XmRendXftFont (rend) == XmAS_IS) _XmRendXftFont (rend) = NULL; #endif if (((unsigned int)(unsigned long)_XmRendFontName(rend) == XmAS_IS) || (strcmp(_XmRendFontName(rend), XmSXmAS_IS) == 0)) _XmRendFontName(rend) = NULL; else if (copy) _XmRendFontName(rend) = XtNewString(_XmRendFontName(rend)); if ((unsigned int)(unsigned long)_XmRendTabs(rend) == XmAS_IS) _XmRendTabs(rend) = NULL; else if (copy) _XmRendTabs(rend) = XmTabListCopy(_XmRendTabs(rend), 0, 0); } /* Emit warning and set default if tag is NULL. */ static void ValidateTag(XmRendition rend, XmStringTag dflt) { if (_XmRendTag(rend) == NULL) { RenditionWarning(_XmRendTag(rend), "NO_NULL_TAG", NO_NULL_TAG_MSG, _XmRendDisplay(rend)); _XmRendTag(rend) = _XmStringCacheTag(dflt, XmSTRING_TAG_STRLEN); } } #ifdef FIX_1414 #ifdef USE_XFT static int GetSameRenditions(XmRendition *rend_cache, XmRendition rend, int count_rend) { int i; for (i=0; i=0) _XmRendXftFont(rend) = _XmRendXftFont(rend_cache[num_rend]); else { #endif _XmRendPattern(rend) = FcPatternCreate(); if (_XmRendFontName(rend)) FcPatternAddString(_XmRendPattern(rend), FC_FAMILY, (XftChar8 *)_XmRendFontName(rend)); if (_XmRendFontFoundry(rend)) FcPatternAddString(_XmRendPattern(rend), FC_FOUNDRY, (XftChar8 *)_XmRendFontFoundry(rend)); if (_XmRendFontEncoding(rend)) FcPatternAddString(_XmRendPattern(rend), XFT_ENCODING, (XftChar8 *)_XmRendFontEncoding(rend)); if (_XmRendFontStyle(rend)) FcPatternAddString(_XmRendPattern(rend), FC_STYLE, (XftChar8 *)_XmRendFontStyle(rend)); if (_XmRendFontSize(rend)) FcPatternAddInteger(_XmRendPattern(rend), FC_SIZE, _XmRendFontSize(rend)); if (_XmRendPixelSize(rend)) FcPatternAddInteger(_XmRendPattern(rend), FC_PIXEL_SIZE, _XmRendPixelSize(rend)); if (_XmRendFontSlant(rend)) FcPatternAddInteger(_XmRendPattern(rend), FC_SLANT, _XmRendFontSlant(rend)); if (_XmRendFontWeight(rend)) FcPatternAddInteger(_XmRendPattern(rend), FC_WEIGHT, _XmRendFontWeight(rend)); if (_XmRendFontSpacing(rend)) FcPatternAddInteger(_XmRendPattern(rend), FC_SPACING, _XmRendFontSpacing(rend)); p = XftFontMatch(display, 0, _XmRendPattern(rend), &res); #ifdef FIX_1414 _XmRendXftFont(rend) = XftFontOpenPattern(display, p); rend_cache = (XmRendition *) XtRealloc((char *)rend_cache, (Cardinal)(sizeof(XmRendition) * (count_rend + 1))); rend_cache[count_rend] =_XmRenditionCopy(rend, TRUE); count_rend++; } #else _XmRendXftFont(rend) = XftFontOpenPattern(display, p); #endif } result = _XmRendXftFont(rend) != NULL; break; #endif default: RenditionWarning(_XmRendTag(rend), "INVALID_TYPE", INVALID_TYPE_MSG, _XmRendDisplay(rend)); break; } /* NoFontCallback. */ if (!result) { if (display != NULL) { dsp = (XmDisplay) XmGetXmDisplay(display); cb.reason = XmCR_NO_FONT; cb.event = NULL; cb.rendition = rend; cb.font_name = _XmRendFontName(rend); /* We must know for sure whether there are any */ /* callbacks, so we have to use XtHasCallbacks. */ if (XtHasCallbacks((Widget)dsp, XmNnoFontCallback) == XtCallbackHasSome) { XtCallCallbackList((Widget)dsp, dsp->display.noFontCallback, &cb); return; } } RenditionWarning(_XmRendTag(rend), "CONVERSION_FAILED", CONVERSION_FAILED_MSG, _XmRendDisplay(rend)); } else { #ifdef USE_XFT if (_XmRendFontType(rend) != XmFONT_IS_XFT) #endif _XmRendFont(rend) = font; } } else { RenditionWarning(_XmRendTag(rend), "NULL_FONT_TYPE", NULL_FONT_TYPE_MSG, _XmRendDisplay(rend)); } } else if ((_XmRendLoadModel(rend) == XmLOAD_IMMEDIATE) && (_XmRendFont(rend) == NULL) && #ifdef USE_XFT (_XmRendXftFont (rend) == NULL) && #endif (_XmRendFontName(rend) == NULL)) { RenditionWarning(_XmRendTag(rend), "NULL_LOAD_IMMEDIATE", NULL_LOAD_IMMEDIATE_MSG, _XmRendDisplay(rend)); } } } /* Create new rendition. */ XmRendition XmRenditionCreate(Widget widget, XmStringTag tag, ArgList arglist, Cardinal argcount) { XmRendition ret_val; XtAppContext app=NULL; /* If cannot applock, assume its an internal call (from * fontlist code, etc.) and already process locked. */ if (widget) app = XtWidgetToApplicationContext(widget); if (app) { _XmAppLock(app); } else { _XmProcessLock(); } ret_val = _XmRenditionCreate(NULL, widget, XmS, XmCRenderTable, tag, arglist, argcount, NULL); if (app) { _XmAppUnlock(app); } else { _XmProcessUnlock(); } return ret_val; } /* Internal function. Called from XmRenditionCreate, resource */ /* converter, and Mrm create function. */ XmRendition _XmRenditionCreate(Display *display, Widget widget, String resname, String resclass, XmStringTag tag, ArgList arglist, Cardinal argcount, Boolean *in_db) { XmRendition rend; _XmRendition rend_int; Boolean result; if ((display == NULL) && (widget != NULL)) display = XtDisplayOfObject(widget); if ((tag != NULL) && (tag != XmFONTLIST_DEFAULT_TAG) && (strcmp(tag, XmSTRING_DEFAULT_CHARSET) == 0)) tag = _XmStringGetCurrentCharset(); /* Allocate rendition. */ rend_int = (_XmRendition)XtMalloc(sizeof(_XmRenditionRec)); bzero((char*)rend_int, sizeof(_XmRenditionRec)); rend = GetHandle(_XmRendition); SetPtr(rend, rend_int); _XmRendRefcount(rend) = 1; /* For now, FontOnly renditions aren't implemented. */ _XmRendFontOnly(rend) = FALSE; /* X resource DB query */ result = GetResources(rend, display, widget, resname, resclass, tag, arglist, argcount); if (in_db != NULL) *in_db = result; if (tag == NULL) { if (result == FALSE) { XtFree((char *)rend_int); FreeHandle(rend); return(NULL); } else tag = _MOTIF_DEFAULT_LOCALE; } _XmRendTag(rend) = _XmStringCacheTag(tag, XmSTRING_TAG_STRLEN); /* Cleanup and validate resources. */ CleanupResources(rend, TRUE); ValidateTag(rend, XmS); ValidateAndLoadFont(rend, display); return(rend); } /* Mrm create function for rendertables. */ /*ARGSUSED*/ Widget _XmCreateRenderTable(Widget parent, String name, /* unused */ ArgList arglist, /* unused */ Cardinal argcount) /* unused */ { XmRenderTable newtable; _XmRenderTable table; /* Malloc new table */ table = (_XmRenderTable)XtMalloc(sizeof(_XmRenderTableRec)); newtable = GetHandle(_XmRenderTable); SetPtr(newtable, table); _XmRTCount(newtable) = 0; _XmRTRefcount(newtable) = 1; _XmRTDisplay(newtable) = XtDisplay(parent); return((Widget)newtable); } /* Mrm create function for renditions. */ Widget _XmCreateRendition(Widget parent, String name, ArgList arglist, Cardinal argcount) { XmRenderTable rt = (XmRenderTable)parent; _XmRenderTable table; XmRendition rend; table = GetPtr(rt); rend = _XmRenditionCreate(_XmRTDisplay(rt), NULL, XmS, XmCRenderTable, name, arglist, argcount, NULL); /* Ignore repeats */ if (_XmRenderTableFindRendition(rt, _XmRendTag(rend), TRUE, FALSE, FALSE, NULL) != NULL) { if (FreeRendition(rend)) FreeHandle(rend); return((Widget)NULL); } table = (_XmRenderTable) XtRealloc((char *)table, sizeof(_XmRenderTableRec) + (sizeof(XmRendition) * ((_XmRTCount(rt) + 1) - RENDITIONS_IN_STRUCT))); SetPtr(rt, table); /* Copy new rendition. */ _XmRTRenditions(rt)[_XmRTCount(rt)] = CopyRendition(rend); _XmRTCount(rt)++; return((Widget)rend); } /* Free data structure and any copied values. */ /* TRUE return -> freed. FALSE -> just decremented. */ static Boolean FreeRendition(XmRendition rendition) { if (rendition == NULL) return(FALSE); if (_XmRendRefcountDec(rendition) == 0) { /* CR 7890 - the fontName might be XmAS_IS here */ if (NameIsString(_XmRendFontName(rendition))) XtFree(_XmRendFontName(rendition)); if (ListIsList(_XmRendTabs(rendition))) XmTabListFree(_XmRendTabs(rendition)); if (_XmRendTagCount(rendition) != 0) XtFree((char *)_XmRendTags(rendition)); #ifdef USE_XFT if (_XmRendXftFont(rendition)) { XftFontClose(_XmRendDisplay(rendition), _XmRendXftFont(rendition)); _XmRendXftFont(rendition) = NULL; } if (_XmRendPattern(rendition)) { FcPatternDestroy(_XmRendPattern(rendition)); _XmRendPattern(rendition) = NULL; } #endif XtFree((char *)GetPtr(rendition)); return(TRUE); } return(FALSE); } void XmRenditionFree(XmRendition rendition) { XtAppContext app; if (rendition == NULL) return; _XmProcessLock(); FreeRendition(rendition); FreeHandle(rendition); _XmProcessUnlock(); } /* Get resource values from rendition. */ void XmRenditionRetrieve(XmRendition rendition, ArgList arglist, Cardinal argcount) { int i, j; Arg *arg; XtResource *res; char *as_is = (char *)XmAS_IS; if (rendition == NULL) return; _XmProcessLock(); /* Get resources */ for (i = 0; i < argcount; i++) { arg = &(arglist[i]); for (j = 0; j < _XmNumRenditionResources; j++) { res = &(_XmRenditionResources[j]); if (strcmp(res->resource_name, arg->name) == 0) { /* CR 7890: Font hook - if there's a fontName but the ** font hasn't been fetched yet, now's a good time to ** get it - if the caller wants to use the font to, say, ** compute font metrics for layout (as CSText does), it won't ** like to get NULL back */ if (strcmp(res->resource_name, XmNfont) == 0) { if ((_XmRendFont(rendition) == NULL) && #ifdef USE_XFT (_XmRendXftFont (rendition) == NULL) && #endif (_XmRendFontName(rendition) != NULL)) { if (_XmRendLoadModel(rendition) == XmLOAD_DEFERRED) _XmRendLoadModel(rendition) = XmLOAD_IMMEDIATE; ValidateAndLoadFont(rendition, _XmRendDisplay(rendition)); } if (_XmRendFont (rendition) == NULL #ifdef USE_XFT && _XmRendXftFont (rendition) == NULL #endif ) CopyToArg((char*)&as_is, &(arg->value), sizeof(char*)); else CopyToArg(((char *)GetPtr(rendition) + res->resource_offset), &(arg->value), res->resource_size); } else if (((strcmp(res->resource_name, XmNfontName) == 0) && (_XmRendFontName(rendition) == NULL)) || ((strcmp(res->resource_name, XmNtabList) == 0) && (_XmRendTabs(rendition) == NULL))) CopyToArg((char*)&as_is, &(arg->value), sizeof(char*)); else CopyToArg(((char *)GetPtr(rendition) + res->resource_offset), &(arg->value), res->resource_size); break; } } } _XmProcessUnlock(); } /* Set resources in rendition. */ /* Renew rendition if necessary, then update resources. */ void XmRenditionUpdate(XmRendition rendition, ArgList arglist, Cardinal argcount) { XmStringTag oldtag; char *oldname; XtPointer oldfont; XmTabList oldtabs; int i, j; XtResource *res; Arg *arg; Display *display = _XmGetDefaultDisplay(); Boolean can_free; XtAppContext app = NULL; if (rendition == NULL) return; #ifdef XTHREADS if (_XmRendDisplay(rendition)) { app = XtDisplayToApplicationContext(_XmRendDisplay(rendition)); _XmAppLock(app); } if (_XmRendDisplay(rendition) && (_XmRendDisplay(rendition) != display) ) display = _XmRendDisplay(rendition); #endif /* Save old values to check for dependencies and free memory. */ oldtag = _XmRendTag(rendition); oldname = _XmRendFontName(rendition); oldfont = _XmRendFont(rendition); oldtabs = _XmRendTabs(rendition); can_free = TRUE; /* New memory if needed. */ if (_XmRendRefcount(rendition) > 1) { _XmRendRefcountDec(rendition); RenewRendition(rendition); can_free = FALSE; } for (i = 0; i < argcount; i++) { arg = &(arglist[i]); for (j = 0; j < _XmNumRenditionResources; j++) { res = &(_XmRenditionResources[j]); if (strcmp(res->resource_name, arg->name) == 0) { CopyFromArg((arg->value), ((char *)GetPtr(rendition) + res->resource_offset), res->resource_size); break; } } } CopyInto(rendition, rendition); /** Validate resources **/ /* CR 7890 - handle cases of fontName == NULL and fontName == XmAS_IS */ /* If fontName changed but not font, NULL font so it's updated. ** (first make sure we won't crash on the strcmp) */ if (NameIsString(oldname) && NameIsString(_XmRendFontName(rendition))) { if (strcmp(oldname, _XmRendFontName(rendition)) != 0) { if (oldfont == _XmRendFont(rendition)) _XmRendFont(rendition) = NULL; } if (can_free) XtFree(oldname); } /* Also handle the case where we started with a NULL fontName and ** had a real fontName specified */ else if ((oldname == NULL) && NameIsString(_XmRendFontName(rendition))) { if (oldfont == _XmRendFontName(rendition)) _XmRendFont(rendition) = NULL; } if (_XmRendFont(rendition) == (XtPointer)XmAS_IS) _XmRendFont(rendition) = NULL; if ((oldtabs != _XmRendTabs(rendition)) && can_free) XmTabListFree(oldtabs); ValidateTag(rendition, oldtag); ValidateAndLoadFont(rendition, display); #ifdef XTHREADS if (app) { _XmAppUnlock(app); } #endif } /*****************************************************************************/ /* XmRenderTableCvtToProp takes a rendertable and converts it to */ /* an ascii string in the following format: */ /* tag : char* */ /* font : either fontid (integer) or [ fontid, fontid ... fontid ] or -1 */ /* tablist : [ tab1, ... tabn ] or -1 */ /* background : pixel or -1 */ /* foreground : pixel or -1 */ /* underlineType : integer (from enum in Xm.h ) or -1 */ /* strikethruType : integer (from enum in Xm.h ) or -1 */ /* */ /* example: */ /* "tag, font, tablist, background, foreground, underlineType, */ /* strikethruType\n */ /* bold, 10000031, -1, -1, -1, -1, -1\n */ /* underline, 10000029, -1, -1, -1, -1, -1\n */ /* default, 10000029, [ 1.234 1 0 0, 2.43 2 0 2], 1, 2, 0, 0\n */ /* japanese, [10000029, 10000030], -1, -1, -1, -1, -1" */ /* */ /* The first line gives a complete list of the attributes by name. */ /* on the destination side, attributes which are not understood */ /* or are outdated can be ignored. The conversion of each rendition */ /* passes a single "line" which contains the fields in order. */ /*****************************************************************************/ /* Note that this MUST be in the same order as the output conversion below!! */ static XmConst char *CVTproperties[] = { XmNtag, XmNfont, XmNtabList, XmNbackground, XmNforeground, XmNunderlineType, XmNstrikethruType, NULL, }; /* Must be big enough to take all the above strings concatenated with commas separating them */ static char CVTtransfervector[256]; static int CVTtvinited = 0; /* Use this macro to encapsulate the code that extends the output buffer as needed */ #define CVTaddString(dest, src, srcsize)\ {\ if ((chars_used + srcsize) > allocated_size) {\ allocated_size *= 2;\ buffer = XtRealloc(buffer, allocated_size);\ }\ strcat(buffer, src);\ chars_used += srcsize;\ } /*ARGSUSED*/ unsigned int XmRenderTableCvtToProp(Widget widget, /* unused */ XmRenderTable table, char **prop_return) { int i; int allocated_size = 256; int chars_used = 0, size; char *buffer; char *str; XmRendition rendition; _XmWidgetToAppContext(widget); _XmAppLock(app); buffer = XtMalloc(allocated_size); _XmProcessLock(); if (CVTtvinited == 0) { CVTtvinited = 1; strcpy(CVTtransfervector, ""); for(i = 0; CVTproperties[i] != NULL; i++) { strcat(CVTtransfervector, CVTproperties[i]); strcat(CVTtransfervector, ","); } strcat(CVTtransfervector, "\n"); } /* Copy the transfer vector into the output buffer. */ strcpy(buffer, CVTtransfervector); chars_used = strlen(buffer); _XmProcessUnlock(); /* Now iterate over the list of renditions */ for(i = 0; i < _XmRTCount(table); i++) { char temp[2048]; rendition = _XmRTRenditions(table)[i]; sprintf(temp, "\"%s\", ", _XmRendTag(rendition)); size = strlen(temp); CVTaddString(buffer, temp, size); if (_XmRendFontType(rendition) == XmAS_IS) str = "-1, "; else { sprintf(temp, "%d \"%s\" %d,", _XmRendFontType(rendition), _XmRendFontName(rendition), _XmRendLoadModel(rendition)); str = temp; } size = strlen(str); CVTaddString(buffer, str, size); if ((unsigned int)(unsigned long)_XmRendTabs(rendition) == XmAS_IS || _XmRendTabs(rendition) == NULL) str = "-1, "; else { _XmTab tab; _XmTabList tlist; int number; strcpy(temp, "[ "); tlist = (_XmTabList) _XmRendTabs(rendition); number = tlist -> count; tab = (_XmTab) tlist -> start; while(number > 0) { sprintf(temp, "%s %f %d %d %d, ", temp, tab -> value, tab -> units, tab -> alignment, tab -> offsetModel); tab = (_XmTab) tab -> next; number--; } strcat(temp, " ], "); str = temp; } size = strlen(str); CVTaddString(buffer, str, size); if (_XmRendBG(rendition) == XmAS_IS) str = "-1, "; else { sprintf(temp, "%ld, ", _XmRendBG(rendition)); str = temp; } size = strlen(str); CVTaddString(buffer, str, size); if (_XmRendFG(rendition) == XmAS_IS) str = "-1, "; else { sprintf(temp, "%ld, ", _XmRendFG(rendition)); str = temp; } size = strlen(str); CVTaddString(buffer, str, size); if (_XmRendUnderlineType(rendition) == XmAS_IS) str = "-1, "; else { sprintf(temp, "%d, ", _XmRendUnderlineType(rendition)); str = temp; } size = strlen(str); CVTaddString(buffer, str, size); if (_XmRendStrikethruType(rendition) == XmAS_IS) str = "-1, "; else { sprintf(temp, "%d, ", _XmRendStrikethruType(rendition)); str = temp; } size = strlen(str); CVTaddString(buffer, str, size); CVTaddString(buffer, "\n", size); } /* Return the converted rendertable string */ *prop_return = buffer; _XmAppUnlock(app); /* chars_used is always the size - the NULL terminator */ return(chars_used + 1); } typedef enum { T_NL, T_INT, T_FLOAT, T_SEP, T_OPEN, T_CLOSE, T_STR, T_EOF } TokenType; typedef struct _TokenRec { TokenType type; int integer; float real; char *string; } TokenRec, *Token; #ifndef XTHREADS static TokenRec reusetoken; #endif static Token ReadToken(char *string, int *position) { #ifdef XTHREADS TokenRec reusetoken; Token new_token = &reusetoken; #else Token new_token = &reusetoken; #endif int pos = *position; int count; /* Skip whitespace but not newlines */ while (isspace(string[pos]) && ! (string[pos] == '\n')) pos++; /* Select token type */ switch(string[pos]) { case '\0': new_token -> type = T_EOF; break; case '\n': new_token -> type = T_NL; pos++; break; case ',': new_token -> type = T_SEP; pos++; break; case '[': new_token -> type = T_OPEN; pos++; break; case ']': new_token -> type = T_CLOSE; pos++; break; case '"': /* String result */ count = 1; while (string[pos + count] != '"' && string[pos + count] != '\0') count++; /* Scan for end of string */ new_token -> type = T_STR; new_token -> string = NULL; count -= 1; if (count > 0) { new_token -> string = (char*) XtMalloc(count + 1); strncpy(new_token -> string, &string[pos + 1], count); pos += count + 2; /* Move past end quote */ new_token -> string[count] = 0; /* Null terminate */ } break; default: if (isalpha(string[pos])) /* String result */ { char temp[80]; int count; for(count = 0; isalpha(string[pos + count]) && count < 79; count++) temp[count] = string[pos + count]; temp[count] = 0; pos += count; new_token -> type = T_STR; new_token -> string = XtNewString(temp); } else { /* start converting a float number. If it is exactly integer then we return an int, otherwise return a float */ double result; int intresult; char *newpos; result=strtod(&(string[pos]), &newpos); intresult= (int) result; pos = newpos - string; if (((double) intresult) == result) /* Integer result */ { new_token -> type = T_INT; new_token -> integer = intresult; } else { new_token -> type = T_FLOAT; new_token -> real = (float) result; } } } *position = pos; return(new_token); } #ifdef USE_XFT static struct _XmXftDrawCacheStruct { Display *display; Window window; XftDraw *draw; } *_XmXftDrawCache = NULL; static int _XmXftDrawCacheSize = 0; static XErrorHandler oldErrorHandler; static int xft_error; static int _XmXftErrorHandler( Display *display, XErrorEvent *error ) { (void) fprintf(stderr, "Ignoring Xlib error: error code %d request code %d\n", error->error_code, error->request_code) ; xft_error = BadWindow; /* No exit! - but keep lint happy */ return 0 ; } XftDraw * _XmXftDrawCreate(Display *display, Window window) { XftDraw *draw; XWindowAttributes wa; int i; Status status; for (i=0; i<_XmXftDrawCacheSize; i++) { if (_XmXftDrawCache[i].display == display && _XmXftDrawCache[i].window == window) { return _XmXftDrawCache[i].draw; } } #ifdef FIX_1444 if (!(draw = XftDrawCreate(display, window, DefaultVisual(display, DefaultScreen(display)), DefaultColormap(display, DefaultScreen(display))))) draw = XftDrawCreateBitmap(display, window); #else oldErrorHandler = XSetErrorHandler (_XmXftErrorHandler); xft_error = 0; XGetWindowAttributes(display, window, &wa); XSetErrorHandler(oldErrorHandler); if (xft_error != BadWindow) { draw = XftDrawCreate(display, window, DefaultVisual(display, DefaultScreen(display)), DefaultColormap(display, DefaultScreen(display))); } else { draw = XftDrawCreateBitmap(display, window); } #endif /* Store it in the cache. Look for an empty slot first */ for (i=0; i<_XmXftDrawCacheSize; i++) if (_XmXftDrawCache[i].display == NULL) { _XmXftDrawCache[i].display = display; _XmXftDrawCache[i].draw = draw; _XmXftDrawCache[i].window = window; return draw; } i = _XmXftDrawCacheSize; /* Next free index */ _XmXftDrawCacheSize = _XmXftDrawCacheSize * 2 + 8; _XmXftDrawCache = (struct _XmXftDrawCacheStruct *) XtRealloc((char *)_XmXftDrawCache, sizeof(struct _XmXftDrawCacheStruct) * _XmXftDrawCacheSize); #ifdef FIX_1449 memset(_XmXftDrawCache + i, 0, (_XmXftDrawCacheSize - i) * sizeof(*_XmXftDrawCache)); #endif _XmXftDrawCache[i].display = display; _XmXftDrawCache[i].draw = draw; _XmXftDrawCache[i].window = window; return draw; } void _XmXftDrawDestroy(Display *display, Window window, XftDraw *draw) { int i; for (i=0; i<_XmXftDrawCacheSize; i++) if (_XmXftDrawCache[i].display == display && _XmXftDrawCache[i].window == window) { _XmXftDrawCache[i].display = NULL; _XmXftDrawCache[i].draw = NULL; _XmXftDrawCache[i].window = None; XftDrawDestroy(draw); return; } XmeWarning(NULL, "_XmXftDrawDestroy() this should not happen\n"); } void _XmXftDrawString2(Display *display, Window window, GC gc, XftFont *font, int bpc, #if NeedWidePrototypes int x, int y, #else Position x, Position y, #endif char *s, int len) { XftDraw *draw = _XmXftDrawCreate(display, window); XGCValues gc_val; XColor xcol; XftColor xftcol; XGetGCValues(display, gc, GCForeground, &gc_val); xcol.pixel = gc_val.foreground; XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &xcol); xftcol.color.red = xcol.red; xftcol.color.blue = xcol.blue; xftcol.color.green = xcol.green; xftcol.color.alpha = 0xFFFF; switch (bpc) { case 1: XftDrawStringUtf8(draw, &xftcol, font, x, y, (XftChar8 *)s, len); break; case 2: XftDrawString16(draw, &xftcol, font, x, y, (XftChar16 *)s, len); break; case 4: XftDrawString32(draw, &xftcol, font, x, y, (XftChar32 *)s, len); break; default: XmeWarning(NULL, "_XmXftDrawString(unsupported bpc)\n"); } } void _XmXftDrawString(Display *display, Window window, XmRendition rend, int bpc, #if NeedWidePrototypes int x, int y, #else Position x, Position y, #endif char *s, int len, #if NeedWidePrototypes int image #else Boolean image #endif ) { XftDraw *draw = _XmXftDrawCreate(display, window); XftColor fg_color = _XmRendXftFG(rend); if (image) { XftColor bg_color = _XmRendXftBG(rend); XGlyphInfo ext; ext.xOff = 0; switch (bpc) { case 1: XftTextExtentsUtf8(display, _XmRendXftFont(rend), (FcChar8*)s, len, &ext); break; case 2: XftTextExtents16(display, _XmRendXftFont(rend), (FcChar16*)s, len, &ext); break; case 4: XftTextExtents32(display, _XmRendXftFont(rend), (FcChar32*)s, len, &ext); break; } if (_XmRendBG(rend) == XmUNSPECIFIED_PIXEL) { XGCValues gc_val; XColor xcol; XGetGCValues(display, _XmRendGC(rend), GCBackground, &gc_val); xcol.pixel = gc_val.background; XQueryColor(display, DefaultColormapOfScreen( DefaultScreenOfDisplay(display)), &xcol); bg_color.pixel = xcol.pixel; bg_color.color.red = xcol.red; bg_color.color.green = xcol.green; bg_color.color.blue = xcol.blue; bg_color.color.alpha = 0xFFFF; } #ifdef FIX_1451 XftDrawRect(draw, &bg_color, x, y - _XmRendXftFont(rend)->ascent, ext.xOff, _XmRendXftFont(rend)->ascent + _XmRendXftFont(rend)->descent); #else XftDrawRect(draw, &bg_color, x - 10, y - _XmRendXftFont(rend)->ascent - 10, ext.xOff +20, _XmRendXftFont(rend)->ascent + _XmRendXftFont(rend)->descent + 20); #endif } if (_XmRendFG(rend) == XmUNSPECIFIED_PIXEL) { XGCValues gc_val; XColor xcol; XGetGCValues(display, _XmRendGC(rend), GCForeground, &gc_val); xcol.pixel = gc_val.foreground; XQueryColor(display, DefaultColormapOfScreen( DefaultScreenOfDisplay(display)), &xcol); fg_color.pixel = xcol.pixel; fg_color.color.red = xcol.red; fg_color.color.green = xcol.green; fg_color.color.blue = xcol.blue; fg_color.color.alpha = 0xFFFF; } switch (bpc) { case 1: XftDrawStringUtf8(draw, &fg_color, _XmRendXftFont(rend), x, y, (XftChar8 *)s, len); break; case 2: XftDrawString16(draw, &fg_color, _XmRendXftFont(rend), x, y, (XftChar16 *)s, len); break; case 4: XftDrawString32(draw, &fg_color, _XmRendXftFont(rend), x, y, (XftChar32 *)s, len); break; default: XmeWarning(NULL, "_XmXftDrawString(unsupported bpc)\n"); } } void _XmXftSetClipRectangles(Display *display, Window window, Position x, Position y, XRectangle *rects, int n) { XftDraw *d = _XmXftDrawCreate(display, window); XftDrawSetClipRectangles(d, x, y, rects, n); } #ifdef FIX_1536 static XftColor GetCachedXftColor(Display *display, Pixel color) { static XftColor *color_cache = NULL; static int colors_count = 0; XftColor xftcol = {0, {0,0,0,0xFFFF}}; XColor xcol; Boolean color_exist = FALSE; int i; if (color_cache != NULL) { for (i = 0; i < colors_count; ++i) { if (color_cache[i].pixel == color) { xftcol = color_cache[i]; color_exist = TRUE; break; } } } if (!color_exist) { xcol.pixel = color; XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &xcol); xftcol.pixel = color; xftcol.color.red = xcol.red; xftcol.color.blue = xcol.blue; xftcol.color.green = xcol.green; xftcol.color.alpha = 0xFFFF; color_cache = (XftColor *) XtRealloc((char *) color_cache, (Cardinal) (sizeof(XftColor) * (colors_count + 1))); if (color_cache != NULL) color_cache[colors_count++] = xftcol; } return xftcol; } #endif XftColor _XmXftGetXftColor(Display *display, Pixel color) { #ifdef FIX_1536 return GetCachedXftColor(display, color); #else XColor xcol; XftColor xftcol; xcol.pixel = color; XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &xcol); xftcol.pixel = color; xftcol.color.red = xcol.red; xftcol.color.blue = xcol.blue; xftcol.color.green = xcol.green; xftcol.color.alpha = 0xFFFF; return xftcol; #endif } #ifdef FIX_1415 void _XmXftFontAverageWidth(Widget w, XtPointer f, int *width) { XftFont *fp = (XftFont *)f; static char *s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; int l = 62; /* strlen(s) */ XGlyphInfo ext; XftTextExtents8(XtDisplay(w), fp, (unsigned char *)s, l, &ext); if (width) *width = ext.width / l; } #endif #endif /*ARGSUSED*/ XmRenderTable XmRenderTableCvtFromProp(Widget w, char *prop, unsigned int len) /* unused */ { XmRenderTable new_rt; XmRendition rendition; XmRendition *rarray; int rarray_count, rarray_max; /* These must both be big enough for the number of passed parameters */ char *items[20]; char *name; Arg args[20]; /* This must be big enough to hold all the strings returned by readtoken */ char *freelater[5]; int scanpointer, j, count, freecount, i; Token token; _XmWidgetToAppContext(w); _XmAppLock(app); new_rt = NULL; scanpointer = 0; rarray_max = 10; rarray_count = 0; rarray = (XmRendition *) XtMalloc(sizeof(XmRendition) * rarray_max); name = ""; for(j = 0; j < 20; j++) items[j] = NULL; /* Read the list of items */ for(j = 0; j < 20; ) { token = ReadToken(prop, &scanpointer); if (token -> type == T_NL) break; if (token -> type == T_STR) { items[j] = token -> string; j++; } } j = -1; count = 0; freecount = 0; while(True) { token = ReadToken(prop, &scanpointer); /* We skip the separators */ while(token -> type == T_SEP && token -> type != T_EOF) token = ReadToken(prop, &scanpointer); if (token -> type == T_EOF) goto finish; j++; /* Go to next item in items array */ if (items[j] == NULL) { /* End of line processing. Scan for NewLine */ while(token -> type != T_NL && token -> type != T_EOF) token = ReadToken(prop, &scanpointer); /* Store rendition */ rendition = XmRenditionCreate(w, name, args, count); name = ""; count = 0; /* Reset index into namelist */ j = -1; /* Free temp strings returned by ReadToken */ for(i = 0; i < freecount; i++) XtFree(freelater[i]); freecount = 0; /* Record rendition in array */ if (rarray_count >= rarray_max) { /* Extend array if necessary */ rarray_max += 10; rarray = (XmRendition *) XtRealloc((char*) rarray, sizeof(XmRendition) * rarray_max); } if (token -> type == T_EOF) goto finish; rarray[rarray_count] = rendition; rarray_count++; } else if (strcmp(items[j], XmNtag) == 0) { /* Next item should be a string with the name of the new rendition to create */ if (token -> type == T_STR) { name = token -> string; freelater[freecount] = token -> string; freecount++; } else { goto error; } } else if (strcmp(items[j], XmNfont) == 0) { /* If the next item is a number then we have a font id, otherwise we are reading in a fontset */ if (token -> type != T_INT) goto error; if (token -> integer != -1) { /* AS IS */ XtSetArg(args[count], XmNfontType, token -> integer); count++; token = ReadToken(prop, &scanpointer); if (token -> type != T_STR) goto error; XtSetArg(args[count], XmNfontName, token -> string); count++; freelater[freecount] = token -> string; freecount++; token = ReadToken(prop, &scanpointer); if (token -> type != T_INT) goto error; XtSetArg(args[count], XmNloadModel, token -> integer); count++; } } else if (strcmp(items[j], XmNtabList) == 0) { /* This starts with an OPEN then a number of FLOAT INT INT INT then CLOSE and SEP */ if (token -> type == T_INT) { /* Should be AS IS */ if (token -> integer != -1) goto error; } else if (token -> type == T_OPEN) { float value; int units, align; XmOffsetModel model; XmTabList tablist; XmTab tabs[1]; tablist = NULL; token = ReadToken(prop, &scanpointer); while(token -> type != T_CLOSE) { if (token -> type != T_FLOAT && token -> type != T_INT) goto error; if (token -> type == T_FLOAT) value = token -> real; else value = (float) token -> integer; token = ReadToken(prop, &scanpointer); if (token -> type != T_INT) goto error; units = token -> integer; token = ReadToken(prop, &scanpointer); if (token -> type != T_INT) goto error; align = token -> integer; token = ReadToken(prop, &scanpointer); if (token -> type != T_INT) goto error; model = (XmOffsetModel) token -> integer; tabs[0] = XmTabCreate(value, units, model, align, NULL); tablist = XmTabListInsertTabs(tablist, tabs, 1, 1000); XtFree((char*) tabs[0]); /* Go to next separator to skip unknown future values */ while(token -> type != T_SEP) token = ReadToken(prop, &scanpointer); if (token -> type == T_SEP) token = ReadToken(prop, &scanpointer); } XtSetArg(args[count], XmNtabList, tablist); count++; } else goto error; } else if (strcmp(items[j], XmNbackground) == 0) { if (token -> type != T_INT) goto error; if (token -> type != -1) { XtSetArg(args[count], XmNrenditionBackground, token -> integer); count++; } } else if (strcmp(items[j], XmNforeground) == 0) { if (token -> type != T_INT) goto error; if (token -> type != -1) { XtSetArg(args[count], XmNrenditionForeground, token -> integer); count++; } } else if (strcmp(items[j], XmNunderlineType) == 0) { if (token -> type != T_INT) goto error; if (token -> type != -1) { XtSetArg(args[count], XmNunderlineType, token -> integer); count++; } } else if (strcmp(items[j], XmNstrikethruType) == 0) { if (token -> type != T_INT) goto error; if (token -> type != -1) { XtSetArg(args[count], XmNstrikethruType, token -> integer); count++; } } } finish: new_rt = XmRenderTableAddRenditions(new_rt, rarray, rarray_count, XmMERGE_REPLACE); for (i = 0; i < rarray_count; i++) XmRenditionFree(rarray[i]); _XmAppUnlock(app); return(new_rt); error: /* Free temp strings returned by ReadToken */ for(i = 0; i < freecount; i++) XtFree((char*) freelater[i]); freecount = 0; goto finish; } void XmRenderTableGetDefaultFontExtents(XmRenderTable rendertable, int *height, int *ascent, int *descent) { XmStringTag tag = XmFONTLIST_DEFAULT_TAG; XmRendition rend; Boolean success; short indx; int h,a,d; #ifdef XTHREADS XtAppContext app=NULL; if ( _XmRTDisplay(rendertable) ) app = XtDisplayToApplicationContext(_XmRTDisplay(rendertable)); if (app) _XmAppLock(app); else _XmProcessLock(); #endif a = d = h = 0; /* Get default rendition */ success = _XmRenderTableFindFallback(rendertable, tag, FALSE, &indx, &rend); /* For backward compatibility we must try to return something for */ /* any non-null charset, not just XmFONTLIST_DEFAULT_TAG. */ if (rendertable && tag && !success) success = _XmRenderTableFindFirstFont(rendertable, &indx, &rend); if (success) { /* Find font height */ switch (_XmRendFontType(rend)) { case XmFONT_IS_FONT: if (_XmRendFont(rend)) { a = ((XFontStruct*)_XmRendFont(rend))->ascent; d = ((XFontStruct*)_XmRendFont(rend))->descent; h = a + d; } break; case XmFONT_IS_FONTSET: if (_XmRendFont(rend)) { XFontStruct **font_struct_list; char **font_name_list; if (XFontsOfFontSet((XFontSet)_XmRendFont(rend), &font_struct_list, &font_name_list)) { a = font_struct_list[0]->ascent; d = font_struct_list[0]->descent; h = a + d; } } break; #ifdef USE_XFT case XmFONT_IS_XFT: if (_XmRendXftFont(rend)) { a = _XmRendXftFont(rend)->ascent; d = _XmRendXftFont(rend)->descent; h = a + d; } break; #endif } } #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif if (ascent) *ascent = a; if (descent) *descent = d; if (height) *height = h; } motif-2.3.8/lib/Xm/GrabShellP.h0000644000175000017500000000553313145162623013062 00000000000000/* $XConsortium: GrabShellP.h /main/5 1995/07/15 20:51:26 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmGrabShellP_h #define _XmGrabShellP_h #include #include #include #ifdef __cplusplus extern "C" { #endif /* The GrabShell instance record */ typedef struct { Cursor cursor; Dimension shadow_thickness; Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; GC top_shadow_GC; GC bottom_shadow_GC; Boolean owner_events; int grab_style; /* Internal fields */ Time post_time; Time unpost_time; Boolean mapped; Window old_focus; int old_revert_to; } XmGrabShellPart; /* Full instance record declaration */ typedef struct _XmGrabShellRec { CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm_shell; VendorShellPart vendor_shell; XmGrabShellPart grab_shell; } XmGrabShellRec; typedef struct _XmGrabShellWidgetRec /* OBSOLETE (for compatibility only).*/ { CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm_shell; VendorShellPart vendor_shell; XmGrabShellPart grab_shell; } XmGrabShellWidgetRec; /* GrabShell class structure */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmGrabShellClassPart; /* Full class record declaration */ typedef struct _XmGrabShellClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; WMShellClassPart wm_shell_class; VendorShellClassPart vendor_shell_class; XmGrabShellClassPart grab_shell_class; } XmGrabShellClassRec; externalref XmGrabShellClassRec xmGrabShellClassRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGrabShellP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragIcon.h0000644000175000017500000000351113145162623012557 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragIcon_h #define _XmDragIcon_h #include #ifdef __cplusplus extern "C" { #endif #define XmIsDragIconObjectClass(w) (XtIsSubclass(w, xmDragIconObjectClass)) enum { XmATTACH_NORTH_WEST, XmATTACH_NORTH, XmATTACH_NORTH_EAST, XmATTACH_EAST, XmATTACH_SOUTH_EAST, XmATTACH_SOUTH, XmATTACH_SOUTH_WEST, XmATTACH_WEST, XmATTACH_CENTER, XmATTACH_HOT }; typedef struct _XmDragIconRec *XmDragIconObject; typedef struct _XmDragIconClassRec *XmDragIconObjectClass; externalref WidgetClass xmDragIconObjectClass; /******** Public Function Declarations ********/ extern Widget XmCreateDragIcon( Widget parent, String name, ArgList argList, Cardinal argCount) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragIcon_h */ motif-2.3.8/lib/Xm/ExtP.h0000644000175000017500000000752012672140561011756 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmExtP_h_ #define _XmExtP_h_ #include /************************************************************ * INCLUDE FILES *************************************************************/ #if defined(hpux) && OS_MAJOR_VERSION < 10 #include #endif /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #if defined(__cplusplus) extern "C" { #endif typedef void (*XmVoidFunc)(void); typedef int (*XmIntFunc)(void); typedef unsigned int (*XmUnsignedIntFunc)(void); extern String xm_std_filter[], xm_std_constraint_filter[]; /************************************************************ * MACROS *************************************************************/ #define streq(a, b) (((a) != NULL) && ((b) != NULL) && (strcmp((a), (b)) == 0)) #define ForAllChildren(w, childP) \ for ( (childP) = (w)->composite.children ; \ (childP) < (w)->composite.children + (w)->composite.num_children ; \ (childP)++ ) /* * Math Stuff * * Some Systems define MIN and MAX so I have to undef them before I make * my own definitions. */ #define XM_ICON_BUTTON_CLASS_NAME ("XmIconButton") #define XM_EXT_LIST_CLASS_NAME ("XmExtendedList") #define XM_ILIST_CLASS_NAME ("XmIList") #define XM_EXT_18_LIST_CLASS_NAME ("XmExtended18List") #define XM_I18LIST_CLASS_NAME ("XmI18List") /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ void XmResolveAllPartOffsets64(WidgetClass, XmOffsetPtr*, XmOffsetPtr*); void _XmMoveWidget(Widget, Position, Position); void _XmResizeWidget(Widget, Dimension, Dimension, Dimension); void _XmConfigureWidget(Widget, Position, Position, Dimension, Dimension, Dimension); XtGeometryResult _XmRequestNewSize(Widget, Boolean, Dimension, Dimension, Dimension *, Dimension *); XtGeometryResult _XmHWQuery(Widget, XtWidgetGeometry*, XtWidgetGeometry *); void _XmGetFocus(Widget, XEvent *, String *, Cardinal *); void _XmFilterArgs(ArgList, Cardinal, String *, ArgList *, Cardinal *); void _XmSetValuesOnChildren(Widget, ArgList, Cardinal); Boolean _XmGadgetWarning(Widget); String _XmGetMBStringFromXmString(XmString); /* * Context Managment Routines. */ void _XmSetContextData(Widget, XContext, XtPointer); void _XmDeleteContextData(Widget, XContext); Boolean _XmGetContextData(Widget, XContext, XtPointer *); Boolean _XmUtilIsSubclassByNameQ(Widget, XrmQuark); void _XmInitialIzeConverters(Widget); void _XmExtHighlightBorder(Widget); void _XmExtUnhighlightBorder(Widget); /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ #if defined(__cplusplus) } #endif #endif motif-2.3.8/lib/Xm/ArrowBP.h0000644000175000017500000000503513145162623012410 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmArrowButtonP_h #define _XmArrowButtonP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Arrow class structure */ typedef struct _XmArrowButtonClassPart { XtPointer extension; } XmArrowButtonClassPart; /* Full class record declaration for Arrow class */ typedef struct _XmArrowButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmArrowButtonClassPart arrowbutton_class; } XmArrowButtonClassRec; externalref XmArrowButtonClassRec xmArrowButtonClassRec; /* The ArrowButton instance record */ typedef struct _XmArrowButtonPart { XtCallbackList activate_callback; XtCallbackList arm_callback; XtCallbackList disarm_callback; unsigned char direction; /* The direction the arrow is pointing. */ Boolean selected; short top_count; short cent_count; short bot_count; XRectangle *top; XRectangle *cent; XRectangle *bot; GC arrow_GC; XtIntervalId timer; unsigned char multiClick; /* KEEP/DISCARD resource */ int click_count; Time armTimeStamp; GC insensitive_GC; Dimension detail_shadow_thickness ; } XmArrowButtonPart; /* Full instance record declaration */ typedef struct _XmArrowButtonRec { CorePart core; XmPrimitivePart primitive; XmArrowButtonPart arrowbutton; } XmArrowButtonRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmArrowButtonP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/JoinSideT.h0000644000175000017500000000343512672140200012715 00000000000000/* $XConsortium: JoinSideT.h /main/5 1995/07/15 20:52:34 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmJoinSideT_H #define _XmJoinSideT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTjoinSide; /* Trait structures and typedefs, place typedefs first */ typedef void (*XmJoinSideSetValueProc)(Widget tab, unsigned char join_side, Dimension join_thickness) ; typedef unsigned char (*XmJoinSideGetValueProc)(Widget tab, Dimension * join_thickness); /* Version 0: initial release. */ typedef struct _XmJoinSideTraitRec { int version; /* 0 */ XmJoinSideSetValueProc setValue; XmJoinSideGetValueProc getValue; } XmJoinSideTraitRec, *XmJoinSideTrait; enum {/* XmNONE already defined in Xm.h */ XmLEFT = 1, XmRIGHT, XmTOP, XmBOTTOM} ; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmJoinSideT_H */ motif-2.3.8/lib/Xm/GeoUtilsI.h0000644000175000017500000001367712672140200012742 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: GeoUtilsI.h /main/5 1995/07/13 17:28:18 drk $ */ #ifndef _XmGeoUtilsI_h #define _XmGeoUtilsI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for GeoUtils.c ********/ extern XtGeometryResult _XmHandleQueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired, #if NeedWidePrototypes unsigned int policy, #else unsigned char policy, #endif /* NeedWidePrototypes */ XmGeoCreateProc createMatrix) ; extern XtGeometryResult _XmHandleGeometryManager( Widget wid, Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *allowed, #if NeedWidePrototypes unsigned int policy, #else unsigned char policy, #endif /* NeedWidePrototypes */ XmGeoMatrix *cachePtr, XmGeoCreateProc createMatrix) ; extern void _XmHandleSizeUpdate( Widget wid, #if NeedWidePrototypes unsigned int policy, #else unsigned char policy, #endif /* NeedWidePrototypes */ XmGeoCreateProc createMatrix) ; extern XmGeoMatrix _XmGeoMatrixAlloc( unsigned int numRows, unsigned int numBoxes, unsigned int extSize) ; extern void _XmGeoMatrixFree( XmGeoMatrix geo_spec) ; extern Boolean _XmGeoSetupKid( XmKidGeometry geo, Widget kidWid) ; extern void _XmGeoMatrixGet( XmGeoMatrix geoSpec, int geoType) ; extern void _XmGeoMatrixSet( XmGeoMatrix geoSpec) ; extern void _XmGeoAdjustBoxes( XmGeoMatrix geoSpec) ; extern void _XmGeoGetDimensions( XmGeoMatrix geoSpec) ; extern void _XmGeoArrangeBoxes( XmGeoMatrix geoSpec, #if NeedWidePrototypes int x, int y, #else Position x, Position y, #endif /* NeedWidePrototypes */ Dimension *pW, Dimension *pH) ; extern Dimension _XmGeoBoxesSameWidth( XmKidGeometry rowPtr, #if NeedWidePrototypes int width) ; #else Dimension width) ; #endif /* NeedWidePrototypes */ extern Dimension _XmGeoBoxesSameHeight( XmKidGeometry rowPtr, #if NeedWidePrototypes int height) ; #else Dimension height) ; #endif /* NeedWidePrototypes */ extern void _XmSeparatorFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, XmKidGeometry rowPtr) ; extern void _XmMenuBarFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, XmKidGeometry rowPtr) ; extern void _XmGeoLoadValues( Widget wid, int geoType, Widget instigator, XtWidgetGeometry *request, XtWidgetGeometry *geoResult) ; extern int _XmGeoCount_kids( register CompositeWidget c) ; extern XmKidGeometry _XmGetKidGeo( Widget wid, Widget instigator, XtWidgetGeometry *request, int uniform_border, #if NeedWidePrototypes int border, #else Dimension border, #endif /* NeedWidePrototypes */ int uniform_width_margins, int uniform_height_margins, Widget help, int geo_type) ; extern void _XmGeoClearRectObjAreas( RectObj r, XWindowChanges *old) ; extern void _XmSetKidGeo( XmKidGeometry kg, Widget instigator) ; extern Boolean _XmGeometryEqual( Widget wid, XtWidgetGeometry *geoA, XtWidgetGeometry *geoB) ; extern Boolean _XmGeoReplyYes( Widget wid, XtWidgetGeometry *desired, XtWidgetGeometry *response) ; extern XtGeometryResult _XmMakeGeometryRequest( Widget w, XtWidgetGeometry *geom) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGeoUtilsI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CareVisualT.h0000644000175000017500000000427212672140200013247 00000000000000/* $XConsortium: CareVisualT.h /main/5 1995/07/15 20:48:21 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmCareVisualT_H #define _XmCareVisualT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTcareParentVisual; /* Trait structures and typedefs, place typedefs first */ typedef Boolean (*XmCareVisualRedrawProc)(Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); /* Version 0: initial release. */ typedef struct _XmCareVisualTraitRec { int version; /* 0 */ XmCareVisualRedrawProc redraw; } XmCareVisualTraitRec, *XmCareVisualTrait; #define NoVisualChange 0L #define VisualForeground (1L<<0) #define VisualHighlightPixmap (1L<<1) #define VisualHighlightColor (1L<<2) #define VisualBottomShadowPixmap (1L<<3) #define VisualBottomShadowColor (1L<<4) #define VisualTopShadowPixmap (1L<<5) #define VisualTopShadowColor (1L<<6) #define VisualBackgroundPixel (1L<<7) #define VisualBackgroundPixmap (1L<<8) #define VisualSelectColor (1L<<9) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCareVisualT_H */ motif-2.3.8/lib/Xm/PixConv.c0000644000175000017500000003665113145162623012465 00000000000000/* $XConsortium: PixConv.c /main/12 1996/12/16 18:32:08 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "XmI.h" #include "ImageCachI.h" #include "PixConvI.h" #include "ScreenI.h" /* Warning and Error messages */ #define DEPTH(widget) \ (XtIsWidget(widget))? \ ((widget)->core.depth):((XtParent(widget))->core.depth) /******** Static Function Declarations ********/ static Boolean GetColorInfo ( Widget widget, XmAccessColorData acc_color); static Pixmap GetPixmap ( Widget widget, unsigned char conv_type, String image_name, Boolean scaling); static Boolean CvtStringToPixmap( Display *dpy, XrmValue *args, Cardinal *numArgs, XrmValue *fromVal, XrmValue *toVal, XtPointer *closure_ret) ; /******** End Static Function Declarations ********/ /*--------------------------------------------------------------*/ /* Argument lists sent down to all pixmap converter functions */ #define CONVERT_BITMAP 0 #define CONVERT_DYNAMIC 1 #define CONVERT_PIXMAP 2 static XtConvertArgRec bitmapArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof (int) }, /* to get the widget */ { XtAddress, (XtPointer)CONVERT_BITMAP, 0}, { XtAddress, (XtPointer)True, 0} /* scaling */ }; static XtConvertArgRec bitmapNoScalingArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof (int) }, { XtAddress, (XtPointer)CONVERT_BITMAP, 0}, { XtAddress, (XtPointer)False, 0} }; static XtConvertArgRec dynamicArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof (int) }, { XtAddress, (XtPointer)CONVERT_DYNAMIC, 0}, { XtAddress, (XtPointer)True, 0} }; static XtConvertArgRec dynamicNoScalingArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof (int) }, { XtAddress, (XtPointer)CONVERT_DYNAMIC, 0}, { XtAddress, (XtPointer)False, 0} }; static XtConvertArgRec pixmapArgs[] = { { XtBaseOffset, (XtPointer) 0, sizeof (int) }, { XtAddress, (XtPointer)CONVERT_PIXMAP, 0}, { XtAddress, (XtPointer)False, 0} }; /************************************************************************ * * _XmRegisterPixmapConverters * Register the pixmap converters used in Motif 2.0 * ************************************************************************/ void _XmRegisterPixmapConverters( void ) { static Boolean inited = False; _XmProcessLock(); if (inited == False) { inited = True; /* for icon masks - need scaling */ XtSetTypeConverter (XmRString, XmRBitmap, CvtStringToPixmap, bitmapArgs, XtNumber(bitmapArgs), (XtCacheNone | XtCacheRefCount), NULL); /* for insensitive stipple */ XtSetTypeConverter (XmRString, XmRNoScalingBitmap, CvtStringToPixmap, bitmapNoScalingArgs, XtNumber(bitmapNoScalingArgs), (XtCacheNone | XtCacheRefCount), NULL); /* for most pixmap used as icon - need scaling */ XtSetTypeConverter (XmRString, XmRDynamicPixmap, CvtStringToPixmap, dynamicArgs, XtNumber(dynamicArgs), (XtCacheNone | XtCacheRefCount), NULL); /* for pixmap used as tiling */ XtSetTypeConverter (XmRString, XmRNoScalingDynamicPixmap, CvtStringToPixmap, dynamicNoScalingArgs, XtNumber(dynamicNoScalingArgs), (XtCacheNone | XtCacheRefCount), NULL); /* for background and shell iconPixmap: no scaling by default */ XtSetTypeConverter (XmRString, XmRPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); #ifndef _NO_PIXMAP_CONV_BC /* Here we install the 1.2 pixmap converters by default, so that subwidgets can still use them. They use the pixmapArgs, meaning they create a matching depth pixmap, with background and foreground color, not highlight, top_shadow, etc. define _NO_PIXMAP_CONV_BC if you don't want them */ XtSetTypeConverter (XmRString, XmRXmBackgroundPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRPrimForegroundPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRPrimHighlightPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRPrimTopShadowPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRPrimBottomShadowPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRManForegroundPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRManHighlightPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRManTopShadowPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRManBottomShadowPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRGadgetPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRAnimationPixmap, CvtStringToPixmap, pixmapArgs, XtNumber(pixmapArgs), (XtCacheNone | XtCacheRefCount), NULL); XtSetTypeConverter (XmRString, XmRAnimationMask, CvtStringToPixmap, bitmapArgs, XtNumber(bitmapArgs), (XtCacheNone | XtCacheRefCount), NULL); #endif /* _NO_PIXMAP_CONV_BC */ } _XmProcessUnlock(); } /************************************************************************ * * CvtStringToPixmap * ************************************************************************/ /*ARGSUSED*/ static Boolean CvtStringToPixmap( Display *dpy, XrmValue *args, Cardinal *numArgs, XrmValue *fromVal, XrmValue *toVal, XtPointer *closure_ret) /* unused */ { Pixmap pixmap = XmUNSPECIFIED_PIXMAP; String image_name = (String) (fromVal->addr); Widget widget ; unsigned char conv_type ; Boolean scaling; /* only called locally, no need to check number of arguments, just be sure it's 3 */ widget = *((Widget *) args[0].addr); if (XmeNamesAreEqual(image_name, "none")) { pixmap = None ; _XM_CONVERTER_DONE ( toVal, Pixmap, pixmap, XmDestroyPixmap(XtScreen(widget), pixmap) ;) } if (XmeNamesAreEqual(image_name, XmSunspecified_pixmap)) { pixmap = XmUNSPECIFIED_PIXMAP ; _XM_CONVERTER_DONE ( toVal, Pixmap, pixmap, XmDestroyPixmap(XtScreen(widget), pixmap) ;) } conv_type = (unsigned char) (int) (long) args[1].addr; scaling = (unsigned char) (int) (long) args[2].addr; pixmap = GetPixmap (widget, conv_type, image_name, scaling) ; if (pixmap == XmUNSPECIFIED_PIXMAP) { XtDisplayStringConversionWarning(dpy, image_name, XmRPixmap); return False; } _XM_CONVERTER_DONE ( toVal, Pixmap, pixmap, XmDestroyPixmap(XtScreen(widget), pixmap) ;) } static Pixmap GetPixmap ( Widget widget, unsigned char converter_type, String image_name, Boolean scaling) { int depth ; Screen * screen = XtScreen(widget); Pixmap pixmap ; XmAccessColorDataRec acc_color_rec; double scaling_ratio ; if (scaling) scaling_ratio = 0 ; else scaling_ratio = 1; if (converter_type == CONVERT_BITMAP) { pixmap = XmGetScaledPixmap (widget, image_name, 1, 0, 1, scaling_ratio); /* pass a double: 0 means scaling using print shell resolution, etc and 1 means no scaling explicitly */ /* use the widget to find the print shell which gives the pixmap resolution to be applied */ return pixmap ; } /* else it's the CONVERT_DYNAMIC or CONVERT_PIXMAP case */ /* ask the class for color info */ if (!GetColorInfo (widget, &acc_color_rec)) /* If we cannot get the colors out of the widget, we have to delay the conversion. So we return a magic value for the pixmap, so that the conversion be done later in Initialize. This probably happens for gadget when the cache is not yet created at the time the pixmap is converted, so the colors cannot be accessed. */ return XmDELAYED_PIXMAP; depth = DEPTH(widget); /* here we want the function to return a bitmap in the xbm case or a pixmap (match depth actually) in the xpm case. since it is a breakage, I can either use a new private API, or a private convention, useful for others who know it :-) the convention is -depth (depth is an int). Positive depth will still fetch pixmap even for xbm. */ depth = -depth ; /* if PIXMAP forced, force depth to be positive, meaning always a pixmap even if xbm specified */ /* ...as long as the foreground color is not XmUNSPECIFIED_PIXEL. Otherwise, the pixmap gets created with a bogus foreground color. (Metro Link fix) */ /* this is mainly for backgroundPixmap */ /* if the resource name was available in the converter, I could give it to GetColorInfo and have the class decide.. Xt problem */ if ((depth < 0) && (acc_color_rec.foreground != XmUNSPECIFIED_PIXEL) && ((converter_type == CONVERT_PIXMAP) || (_XmGetBitmapConversionModel(screen) == XmMATCH_DEPTH))) depth = - depth ; pixmap = _XmGetScaledPixmap (screen, widget, image_name, &acc_color_rec, depth, FALSE, scaling_ratio); /* pass scaling down to ImageCache */ return pixmap ; } static Boolean GetColorInfo ( Widget widget, XmAccessColorData acc_color) { XmAccessColorsTrait access_colors_trait ; access_colors_trait = (XmAccessColorsTrait) XmeTraitGet((XtPointer)XtClass(widget), XmQTaccessColors) ; if (access_colors_trait) { acc_color->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor | AccessSelectColor; access_colors_trait->getColors(widget, acc_color) ; /* some widget don't have select color */ if (!(acc_color->valueMask & AccessSelectColor)) acc_color->select_color = XmUNSPECIFIED_PIXEL ; if (acc_color->valueMask == AccessColorInvalid) return False ; } else /* not one of ours, set dumb default */ { if (XtIsWidget(widget)) acc_color->background = widget->core.background_pixel; else acc_color->background = WhitePixelOfScreen(XtScreen(widget)); acc_color->foreground = BlackPixelOfScreen(XtScreen(widget)); acc_color->highlight_color = acc_color->top_shadow_color = acc_color->bottom_shadow_color = acc_color->select_color = XmUNSPECIFIED_PIXEL ; } return True ; } /************************************************************************ * * Dynamic defaulting pixmap functions. * Usable by most classes since they query the class back for pixel * and depth information. * ************************************************************************/ /*ARGSUSED*/ void _XmTopShadowPixmapDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { static Pixmap pixmap; XmAccessColorDataRec acc_color_rec ; int depth ; pixmap = XmUNSPECIFIED_PIXMAP; value->addr = (char *) &pixmap; value->size = sizeof (Pixmap); /* no need to check for return value from GetColorInfo here since these resources are always converted for valid widget or gadget */ (void) GetColorInfo (widget, &acc_color_rec) ; depth = DEPTH(widget); /* no scaling in this case: last arg 1 */ if (depth == 1) pixmap = XmGetScaledPixmap (widget, XmS50_foreground, 1, 0, 1, 1); else if (acc_color_rec.top_shadow_color == acc_color_rec.background) { /* forces a real pixmap here, otherwise the widget will still use the top_shadow_color == background as a stipple, so don't negative depth */ pixmap = XmGetScaledPixmap (widget, XmS50_foreground, acc_color_rec.top_shadow_color, acc_color_rec.foreground, depth, 1); } } /*ARGSUSED*/ void _XmHighlightPixmapDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { static Pixmap pixmap; XmAccessColorDataRec acc_color_rec ; int depth ; pixmap = XmUNSPECIFIED_PIXMAP; value->addr = (char *) &pixmap; value->size = sizeof (Pixmap); /* no need to check for return value from GetColorInfo here since these resources are always converted for valid widget or gadget */ (void) GetColorInfo (widget, &acc_color_rec) ; depth = DEPTH(widget); if (acc_color_rec.highlight_color == acc_color_rec.background) { /* forces a real pixmap here, otherwise the widget will still use the highlight_color == background as a stipple */ pixmap = XmGetScaledPixmap (widget, XmS50_foreground, acc_color_rec.highlight_color, acc_color_rec.foreground, depth, 1); } } /************************************************************************ * * _XmGetPixmapBasedGC * Get the graphics context used for drawing with a pixmap. * ************************************************************************/ GC _XmGetPixmapBasedGC( Widget w, Pixel foreground, Pixel background, Pixmap pixmap) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground; values.foreground = foreground; values.background = background; if ((pixmap != None) && (pixmap != XmUNSPECIFIED_PIXMAP)) { int depth ; XmeGetPixmapData(XtScreen(w), pixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == 1) { valueMask |= GCFillStyle | GCStipple ; values.fill_style = FillOpaqueStippled; values.stipple = pixmap; /* topShadowPixmap has a foreground=background=1 */ if (foreground == background) values.foreground = background?0:1; } else { valueMask |= GCFillStyle | GCTile ; values.fill_style = FillTiled; values.tile = pixmap; } } return (XtGetGC (w, valueMask, &values)); } motif-2.3.8/lib/Xm/TreeP.h0000644000175000017500000001571212672140200012105 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmTreeP_h_ #define _XmTreeP_h_ /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #ifdef __cplusplus extern "C" { #endif /************************************************************ * MACROS *************************************************************/ #define XmTree_h_node_space(w) (((XmTreeWidget)(w))->tree.h_node_space) #define XmTree_v_node_space(w) (((XmTreeWidget)(w))->tree.v_node_space) #define XmTree_connect_style(w) (((XmTreeWidget)(w))->tree.connect_style) #define XmTree_max_width(w) (((XmTreeWidget)(w))->tree.max_width) #define XmTree_max_height(w) (((XmTreeWidget)(w))->tree.max_height) #define XmTree_child_op_list(w) (((XmTreeWidget)(w))->tree.child_op_list) #define XmTree_ul_point(w) (((XmTreeWidget)(w))->tree.ul_point) #define XmTree_lr_point(w) (((XmTreeWidget)(w))->tree.lr_point) #define XmTree_orientation(w) (((XmTreeWidget)(w))->tree.orientation) #define XmTree_compress_style(w) (((XmTreeWidget)(w))->tree.compress_style) #define XmTree_vertical_delta(w) (((XmTreeWidget)(w))->tree.vertical_delta) #define XmTree_horizontal_delta(w) (((XmTreeWidget)(w))->tree.horizontal_delta) #define XmTreeC_open_close_padding(c) (((XmTreeConstraintPtr)(c))->tree.open_close_padding) #define XmTreeC_box_x(c) (((XmTreeConstraintPtr)(c))->tree.box_x) #define XmTreeC_box_y(c) (((XmTreeConstraintPtr)(c))->tree.box_y) #define XmTreeC_bb_width(c) (((XmTreeConstraintPtr)(c))->tree.bb_width) #define XmTreeC_bb_height(c) (((XmTreeConstraintPtr)(c))->tree.bb_height) #define XmTreeC_widget_offset(c) (((XmTreeConstraintPtr)(c))->tree.widget_offset) #define XmTreeC_placed(c) (((XmTreeConstraintPtr)(c))->tree.placed) #define XmTreeC_color(c) (((XmTreeConstraintPtr)(c))->tree.color) #define XmTreeC_background_color(c) (((XmTreeConstraintPtr)(c))->tree.background_color) #define XmTreeC_line_width(c) (((XmTreeConstraintPtr)(c))->tree.line_width) #define XmTreeC_line_style(c) (((XmTreeConstraintPtr)(c))->tree.line_style) #define XmTreeC_gc(c) (((XmTreeConstraintPtr)(c))->tree.gc) #define XmTreeC_new_x(c) (((XmTreeConstraintPtr)(c))->tree.new_x) #define XmTreeC_new_y(c) (((XmTreeConstraintPtr)(c))->tree.new_y) #define XmTreeC_oc_new_x(c) (((XmTreeConstraintPtr)(c))->tree.oc_new_x) #define XmTreeC_oc_new_y(c) (((XmTreeConstraintPtr)(c))->tree.oc_new_y) #define XmTreeC_map(c) (((XmTreeConstraintPtr)(c))->tree.map) #define XmTreeC_unmap(c) (((XmTreeConstraintPtr)(c))->tree.unmap) #define XmTreeC_move(c) (((XmTreeConstraintPtr)(c))->tree.move) #define XmTreeC_is_compressed(c) (((XmTreeConstraintPtr)(c))->tree.is_compressed) /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ typedef struct { XtPointer extension; /* Just in case we need it later. */ } TreeClassPart; typedef struct _XmTreeClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; HierarchyClassPart hierarchy_class; TreeClassPart tree_class; } XmTreeClassRec; externalref XmTreeClassRec xmTreeClassRec; typedef struct _TreeNodeInfo { /* * Public (Resource) data. */ int open_close_padding; /* Number of pixels to leave between o/c button and node button (can be negative). */ /* * Private data. */ Position box_x, box_y; Dimension bb_width, bb_height; /*Bounding box for myself and my children*/ Dimension widget_offset; /* Amount of space to leave for the open close button to the left of the node.*/ Boolean placed; Pixel color; /* color to draw line in. */ int line_width; GC gc; Position new_x, new_y, oc_new_x, oc_new_y; Boolean map, unmap, move; Boolean is_compressed; /* for space compression, is this node moved? */ /* more resources */ int line_style; Pixel background_color; /* color to draw line in. */ } TreeNodeInfo; typedef struct _TreeConstraintRec { XmManagerConstraintPart manager; HierNodeInfo hierarchy; TreeNodeInfo tree; } XmTreeConstraintRec, TreeConstraintRec, *TreeConstraints, *XmTreeConstraintPtr; typedef struct _TreePart { /* Resources */ Dimension h_node_space, v_node_space; /* Space between various nodes. */ XmTreeConnectStyle connect_style; /* The connection style. */ /* Private State */ Dimension max_width; /* Our new desired width. */ Dimension max_height; /* Our new desired height. */ XmList child_op_list; /* List of child operations */ XPoint ul_point, lr_point; /* Bounding box for exposure compression. */ /* more resources */ unsigned char orientation; /* XmHORIZONTAL or XmVERTICAL */ XmTreeCompressStyle compress_style; /* how to do space compression */ Dimension vertical_delta; /* if doing space compression, how many pixels */ /* to offset alternating siblings vertically */ Dimension horizontal_delta; /* or horizontally */ } TreePart; typedef struct _XmTreeRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; HierarchyPart hierarchy; TreePart tree; } XmTreeRec; /* * Typedefs to conform to the XmField macro's naming convention */ typedef TreePart XmTreePart; typedef TreeNodeInfo XmTreeConstraintPart; /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ extern XmTreeClassRec xmTreeClassRec; /************************************************************ * STATIC DECLARATIONS *************************************************************/ #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _TreeP_h */ motif-2.3.8/lib/Xm/TextFind.c0000644000175000017500000010046113145162623012613 00000000000000/* $XConsortium: TextFind.c /main/6 1995/09/19 23:17:17 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* for , and wcstombs() */ #include "XmI.h" #include "TextI.h" #include "TextStrSoI.h" Boolean _XmTextFindStringBackwards(Widget w, XmTextPosition start, char* search_string, XmTextPosition *position) { register int i; XmTextWidget tw = (XmTextWidget) w; XmSourceData data = ((XmTextWidget)w)->text.source->data; Boolean return_val = False, match = False; int search_length = 0; char *ptr, *end_ptr, *tmp_ptr, *end_of_data; search_length = _XmTextCountCharacters(search_string,strlen(search_string)); if (!search_length || !data->length || search_length > data->length) return FALSE; /* Search can be broken into three phases for fastest search: * * - search from data_end - strlen(search_string) back until * base search is at gap_end. This is a fast simple compare * that doesn't worry about incursions into the gap. * * - search from gap_start-strlen(search_string) until the base * of the search is moved across the gap. * * - search from start up to gap_start-strlen(search_string). * This is a fast simple compare that doesn't worry about * incursions into the gap. */ switch ((int)tw->text.char_size) { case 1: { /* Make sure you don't search past end of data. End of data is... */ end_of_data = data->ptr + data->length + (data->gap_end - data->gap_start); /* actually, no need to search beyond end - search_length position */ if (end_of_data - search_length >= data->gap_end) end_ptr = end_of_data - search_length; else end_ptr = data->gap_start - (search_length - (end_of_data - data->gap_end)); /* Phase one: search from start back to gap_end */ /* Set the base for the search */ if (data->ptr + start > data->gap_start) /* backside of gap */ ptr = data->ptr + (data->gap_end - data->gap_start) + start; else /* we're starting before the gap */ ptr = data->ptr + start; if (ptr > end_ptr) ptr = end_ptr; /* no need search where a match can't be found */ while (!return_val && ptr >= data->gap_end) { if (*ptr == *search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (ptr[i] != search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = ptr - data->ptr - (data->gap_end - data->gap_start); return_val = True; } } ptr--; /* decrement base of search */ match = True; } /* Phase two: these searches span the gap and are SLOW! * Two possibilities: either I've just backed the base back to gap * end (and must do searches that span the gap) or start puts * the base prior to the gap end. Also, possibility that there * isn't enough room after the gap for a complete match * (so no need to search it). This phase must be performed as * long as data->ptr + start places the base to the right of * gap_start - search_length. */ /* Do this as nested for loops; the outer loop decrements the base for * the search, the inner loop compares character elements from 0 to * length(search_string). */ /* If no match yet and if need to search prior to gap_start... */ /* Set the base for the search. */ if (!return_val && (data->ptr + start) > (data->gap_start - search_length)) { if (data->ptr < data->gap_start) ptr = data->gap_start - 1; /* else, we're done... gap_start is at data->ptr and still no match*/ for (match = True; ptr >= data->ptr && (data->gap_start - ptr) + (end_of_data - data->gap_end) >= search_length; ptr--, match = True) { if (*ptr == *search_string) { /* we have a potential winner */ for (i = 1; i < search_length && match == True; i ++) { if (ptr + i >= data->gap_start) { tmp_ptr = ptr +(data->gap_end - data->gap_start) + i; if (*tmp_ptr != search_string[i]) { match = False; i--; } } else { if (ptr[i] != search_string[i]) { match = False; i--; } } } /* end inner for loop - searching from current base */ if (match && (i == search_length)) {/* a winner! */ *position = ptr - data->ptr; return_val = True; } } if (return_val) break; } /* end outer for - restart search from a new base */ } /* phase three: search backwards from base == gap_start - search_length * through and including base == data->ptr. */ if (!return_val) { if (data->ptr + start > data->gap_start - search_length) ptr = data->gap_start - search_length; else ptr = data->ptr + start; while (!return_val && ptr >= data->ptr) { if (*ptr == *search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (ptr[i] != search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = ptr - data->ptr; return_val = True; } } ptr--; /* decrement base of search */ match = True; } } break; } /* end case 1 */ case 2: { BITS16 *bits16_ptr, *bits16_search_string, *bits16_gap_start; BITS16 *bits16_gap_end, *bits16_end_ptr, *bits16_tmp_ptr; BITS16 *bits16_end_of_data; bits16_ptr = bits16_search_string = NULL; bits16_gap_start = bits16_gap_end = NULL; /* search_length is number of characters (!bytes) in search_string */ bits16_search_string = (BITS16 *) XtMalloc((unsigned) (search_length + 1) * (int)tw->text.char_size); (void) _XmTextBytesToCharacters((char *) bits16_search_string, search_string, search_length, True, (int)tw->text.char_size); /* setup the variables for the search */ bits16_gap_start = (BITS16 *) data->gap_start; bits16_gap_end = (BITS16 *) data->gap_end; /* Make sure you don't search past end of data. End of data is... */ bits16_ptr = (BITS16 *)data->ptr; bits16_end_of_data = bits16_ptr + data->length + (bits16_gap_end - bits16_gap_start); /* only need to search up to end - search_length position */ if (bits16_end_of_data - search_length >= bits16_gap_end) bits16_end_ptr = bits16_end_of_data - search_length; else bits16_end_ptr = bits16_gap_start - (search_length - (bits16_end_of_data - bits16_gap_end)); /* Phase one: search from start back to gap_end */ bits16_ptr = (BITS16 *)data->ptr; if (bits16_ptr + start > bits16_gap_start) /* backside of gap */ bits16_ptr = (BITS16 *)data->ptr + (bits16_gap_end - bits16_gap_start) + start; else /* we're starting before the gap */ bits16_ptr = (BITS16 *)data->ptr + start; /* no need search where a match can't be found */ if (bits16_ptr > bits16_end_ptr) bits16_ptr = bits16_end_ptr; while (!return_val && bits16_ptr >= bits16_gap_end) { if (*bits16_ptr == *bits16_search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (bits16_ptr[i] != bits16_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = bits16_ptr - (BITS16 *)data->ptr - (bits16_gap_end - bits16_gap_start); return_val = True; } } bits16_ptr--; /* decrement base of search */ match = True; } /* Phase two: these searches span the gap and are SLOW! * Two possibilities: either I've just backed the base back to gap * end (and must do searches that span the gap) or start puts * the base prior to the gap end. Also, possibility that there * isn't enough room after the gap for a complete match * (so no need to search it). This phase must be performed as * long as data->ptr + start places the base to the right of * gap_start - search_length. */ /* Do this as nested for loops; the outer loop decrements the base for * the search, the inner loop compares character elements from 0 to * length(search_string). */ /* If no match yet and if need to search prior to gap_start... */ /* Set the base for the search. */ bits16_ptr = (BITS16 *) data->ptr; if (!return_val && (bits16_ptr + start) > (bits16_gap_start - search_length)) { if (bits16_ptr < bits16_gap_start) bits16_ptr = bits16_gap_start - 1; /* else, we're done... gap_start is at data->ptr and still no match*/ for (match = True; bits16_ptr >= (BITS16*)data->ptr && (bits16_gap_start - bits16_ptr) + (bits16_end_of_data - bits16_gap_end) >= search_length; bits16_ptr--, match = True) { if (*bits16_ptr == *bits16_search_string) { /* potential winner */ for (i = 1; i < search_length && match == True; i ++) { if (bits16_ptr + i >= bits16_gap_start) { bits16_tmp_ptr = bits16_ptr + (bits16_gap_end - bits16_gap_start) + i; if (*bits16_tmp_ptr != bits16_search_string[i]) { match = False; i--; } } else { if (bits16_ptr[i] != bits16_search_string[i]) { match = False; i--; } } } /* end inner for loop - searching from current base */ if (match && (i == search_length)) {/* a winner! */ *position = bits16_ptr - (BITS16*)data->ptr; return_val = True; } } if (return_val) break; } /* end outer for - restart search from a new base */ } /* phase three: search backwards from base == gap_start - search_length * through and including base == data->ptr. */ if (!return_val) { bits16_ptr = (BITS16 *) data->ptr; if (bits16_ptr + start > bits16_gap_start - search_length) bits16_ptr = bits16_gap_start - search_length; else bits16_ptr = bits16_ptr + start; while (!return_val && bits16_ptr >= (BITS16 *)data->ptr) { if (*bits16_ptr == *bits16_search_string) {/* potential winner!*/ for (match = True, i = 1; match && (i < search_length); i++) { if (bits16_ptr[i] != bits16_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = bits16_ptr - (BITS16 *)data->ptr; return_val = True; } } bits16_ptr--; /* decrement base of search */ match = True; } } /* clean up before you go */ if (bits16_search_string != NULL) XtFree((char*)bits16_search_string); break; } /* end case 2 */ default: { wchar_t *wchar_t_ptr, *wchar_t_search_string, *wchar_t_gap_start; wchar_t *wchar_t_gap_end, *wchar_t_end_ptr, *wchar_t_tmp_ptr; wchar_t *wchar_t_end_of_data; wchar_t_ptr = wchar_t_search_string = NULL; wchar_t_gap_start = wchar_t_gap_end = NULL; wchar_t_search_string = (wchar_t *) XtMalloc((unsigned) (search_length + 1) * sizeof(wchar_t)); (void)_XmTextBytesToCharacters((char *) wchar_t_search_string, search_string, search_length, True, (int)tw->text.char_size); /* setup the variables for the search of new lines before the gap */ wchar_t_gap_start = (wchar_t *) data->gap_start; wchar_t_gap_end = (wchar_t *) data->gap_end; /* Make sure you don't search past end of data. End of data is... */ wchar_t_ptr = (wchar_t *)data->ptr; wchar_t_end_of_data = wchar_t_ptr + data->length + (wchar_t_gap_end - wchar_t_gap_start); /* only need to search up to end - search_length position */ if (wchar_t_end_of_data - search_length >= wchar_t_gap_end) wchar_t_end_ptr = wchar_t_end_of_data - search_length; else wchar_t_end_ptr = wchar_t_gap_start - (search_length - (wchar_t_end_of_data - wchar_t_gap_end)); /* Phase one: search from start back to gap_end */ wchar_t_ptr = (wchar_t *)data->ptr; if (wchar_t_ptr + start > wchar_t_gap_start) /* backside of gap */ wchar_t_ptr = (wchar_t *)data->ptr + (wchar_t_gap_end - wchar_t_gap_start) + start; else /* we're starting before the gap */ wchar_t_ptr = (wchar_t *)data->ptr + start; /* no need search where a match can't be found */ if (wchar_t_ptr > wchar_t_end_ptr) wchar_t_ptr = wchar_t_end_ptr; while (!return_val && wchar_t_ptr >= wchar_t_gap_end) { if (*wchar_t_ptr == *wchar_t_search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (wchar_t_ptr[i] != wchar_t_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = wchar_t_ptr - (wchar_t *)data->ptr - (wchar_t_gap_end - wchar_t_gap_start); return_val = True; } } wchar_t_ptr--; /* decrement base of search */ match = True; } /* Phase two: these searches span the gap and are SLOW! * Two possibilities: either I've just backed the base back to gap * end (and must do searches that span the gap) or start puts * the base prior to the gap end. Also, possibility that there * isn't enough room after the gap for a complete match * (so no need to search it). This phase must be performed as * long as data->ptr + start places the base to the right of * gap_start - search_length. */ /* Do this as nested for loops; the outer loop decrements the base for * the search, the inner loop compares character elements from 0 to * length(search_string). */ /* If no match yet and if need to search prior to gap_start... */ /* Set the base for the search. */ wchar_t_ptr = (wchar_t *) data->ptr; if (!return_val && (wchar_t_ptr + start) > (wchar_t_gap_start - search_length)) { if (wchar_t_ptr < wchar_t_gap_start) wchar_t_ptr = wchar_t_gap_start - 1; /*else, we're done... gap_start is at data->ptr and still no match*/ for (match = True; wchar_t_ptr >= (wchar_t*)data->ptr && (wchar_t_gap_start - wchar_t_ptr) + (wchar_t_end_of_data - wchar_t_gap_end) >= search_length; wchar_t_ptr--, match = True) { if (*wchar_t_ptr == *wchar_t_search_string) {/* potential winner */ for (i = 1; i < search_length && match == True; i ++) { if (wchar_t_ptr + i >= wchar_t_gap_start) { wchar_t_tmp_ptr = wchar_t_ptr + (wchar_t_gap_end - wchar_t_gap_start) + i; if (*wchar_t_tmp_ptr != wchar_t_search_string[i]) { match = False; i--; } } else { if (wchar_t_ptr[i] != wchar_t_search_string[i]) { match = False; i--; } } } /* end inner for loop - searching from current base */ if (match && (i == search_length)) {/* a winner! */ *position = wchar_t_ptr - (wchar_t*)data->ptr; return_val = True; } } if (return_val) break; } /* end outer for - restart search from a new base */ } /* phase three: search backwards from base == gap_start - search_length * through and including base == data->ptr. */ if (!return_val) { wchar_t_ptr = (wchar_t *) data->ptr; if (wchar_t_ptr + start > wchar_t_gap_start - search_length) wchar_t_ptr = wchar_t_gap_start - search_length; else wchar_t_ptr = wchar_t_ptr + start; while (!return_val && wchar_t_ptr >= (wchar_t *)data->ptr) { if (*wchar_t_ptr == *wchar_t_search_string) {/* potential winner!*/ for (match = True, i = 1; match && (i < search_length); i++) { if (wchar_t_ptr[i] != wchar_t_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = wchar_t_ptr - (wchar_t *)data->ptr; return_val = True; } } wchar_t_ptr--; /* decrement base of search */ match = True; } } /* clean up before you go */ if (wchar_t_search_string != NULL) XtFree((char*)wchar_t_search_string); break; } /* end default */ } /* end switch */ return return_val; } Boolean _XmTextFindStringForwards(Widget w, XmTextPosition start, char* search_string, XmTextPosition *position) { register int i; XmTextWidget tw = (XmTextWidget) w; XmSourceData data = tw->text.source->data; Boolean return_val = False, match = False; int search_length = 0; char *ptr, *end_ptr, *tmp_ptr, *end_of_data; search_length = _XmTextCountCharacters(search_string,strlen(search_string)); if (!search_length || !data->length || search_length > data->length) return FALSE; /* Search can be broken into three phases for fastest search: * * - search from start up to gap_start-strlen(search_string). * This is a fast simple compare that doesn't worry about * incursions into the gap. * * - search from gap_start-strlen(search_string) until the base * of the search is moved across the gap. * * - search from gap_end to data_end - strlen(search_string). * This is a fast, simple compare that doesn't worry about * incursions into the gap or overrunning end of data. */ switch ((int)tw->text.char_size) { case 1: { /* Make sure you don't search past end of data. End of data is... */ end_of_data = data->ptr + data->length + (data->gap_end - data->gap_start); /* actually, only need to search up to end - search_length position */ if (end_of_data - search_length >= data->gap_end) end_ptr = end_of_data - search_length; else end_ptr = data->gap_start - (search_length - (end_of_data - data->gap_end)); /* Phase one: search from start to gap_start-strlen(search_string) */ ptr = data->ptr + start; while (!return_val && ptr + search_length <= data->gap_start) { if (*ptr == *search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (ptr[i] != search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = ptr - data->ptr; return_val = True; } } ptr++; /* advance base of search */ match = True; } /* Phase two: these searches span the gap and are SLOW! * Two possibilities: either I'm just short of the gap * (and must do searches that span the gap) or start puts * the base after gap end. Also, possibility that there * isn't enough room after the gap for a complete match * (so no need to search it). */ /* Do this as nested for loops; the outer loop advances the base for * the search, the inner loop compares character elements from 0 to * length(search_string). */ /* if no match yet and if need to search prior to gap_start... */ if (!return_val && (data->ptr + start) < data->gap_start) { if (data->ptr + start < data->gap_start - search_length) ptr = data->gap_start - search_length; else ptr = data->ptr + start; for (match = True; ptr < data->gap_start && (data->gap_start - ptr) + (end_of_data - data->gap_end) >= search_length; ptr++, match = True) { if (*ptr == *search_string) { /* we have a potential winner */ for (i = 1; i < search_length && match == True; i ++) { if (ptr + i >= data->gap_start) { tmp_ptr = ptr +(data->gap_end - data->gap_start) + i; if (*tmp_ptr != search_string[i]) { match = False; i--; } } else { if (ptr[i] != search_string[i]) { match = False; i--; } } } /* end inner for loop - searching from current base */ if (match && (i == search_length)) {/* a winner! */ *position = ptr - data->ptr; return_val = True; } } if (return_val) break; } /* end outer for - restart search from a new base */ } /* phase three: search after gap end upto end of data - search_length */ if (!return_val) { if (data->ptr + start < data->gap_start) ptr = data->gap_end; /* we've already started - continue at * gap end. */ else ptr = data->ptr + (data->gap_end - data->gap_start) + start; while (!return_val && ptr <= end_ptr) { if (*ptr == *search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (ptr[i] != search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = ptr - data->ptr - (data->gap_end - data->gap_start); return_val = True; } } ptr++; /* advance base of search */ match = True; } } } /* end case 1 */ break; case 2: { BITS16 *bits16_ptr, *bits16_search_string, *bits16_gap_start; BITS16 *bits16_gap_end, *bits16_end_ptr, *bits16_tmp_ptr; BITS16 *bits16_end_of_data; bits16_ptr = bits16_search_string = NULL; bits16_gap_start = bits16_gap_end = NULL; /* search_length is number of characters (!bytes) in search_string */ bits16_search_string = (BITS16 *) XtMalloc((unsigned) (search_length + 1) * (int)tw->text.char_size); (void) _XmTextBytesToCharacters((char *) bits16_search_string, search_string, search_length, True, (int)tw->text.char_size); /* setup the variables for the search */ bits16_gap_start = (BITS16 *) data->gap_start; bits16_gap_end = (BITS16 *) data->gap_end; /* Make sure you don't search past end of data. End of data is... */ bits16_ptr = (BITS16 *)data->ptr; bits16_end_of_data = bits16_ptr + data->length + (bits16_gap_end - bits16_gap_start); /* only need to search up to end - search_length position */ if (bits16_end_of_data - search_length >= bits16_gap_end) bits16_end_ptr = bits16_end_of_data - search_length; else bits16_end_ptr = bits16_gap_start - (search_length - (bits16_end_of_data - bits16_gap_end)); /* Phase one: search from start to gap start - search_length */ bits16_ptr = (BITS16 *)data->ptr + start; while (!return_val && bits16_ptr + search_length <= bits16_gap_start) { if (*bits16_ptr == *bits16_search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (bits16_ptr[i] != bits16_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = bits16_ptr - (BITS16 *)data->ptr; return_val = True; } } bits16_ptr++; /* advance base of search */ match = True; } /* Phase two: these searches span the gap and are SLOW! * Two possibilities: either I'm just short of the gap * (and must do searches that span the gap) or start puts * the base after gap end. Also, possibility that there * isn't enough room after the gap for a complete match * (so no need to search it). */ /* Do this as nested for loops; the outer loop advances the base for * the search, the inner loop compares character elements from 0 to * length(search_string). */ /* if no match yet and if need to search prior to gap_start... */ bits16_ptr = (BITS16 *) data->ptr; if (!return_val && (bits16_ptr + start) < bits16_gap_start) { if (bits16_ptr + start < bits16_gap_start - search_length) bits16_ptr = bits16_gap_start - search_length; else bits16_ptr = (BITS16*)data->ptr + start; for (match = True; bits16_ptr < bits16_gap_start && (bits16_gap_start - bits16_ptr) + (bits16_end_of_data - bits16_gap_end) >= search_length; bits16_ptr++, match = True) { if (*bits16_ptr == *bits16_search_string) { /* have a potential winner*/ for (i = 1; i < search_length && match == True; i ++) { if (bits16_ptr + i >= bits16_gap_start) { bits16_tmp_ptr = bits16_ptr + (bits16_gap_end - bits16_gap_start) + i; if (*bits16_tmp_ptr != bits16_search_string[i]) { match = False; i--; } } else { if (bits16_ptr[i] != bits16_search_string[i]) { match = False; i--; } } } /* end inner for loop - searching from current base */ if (match && (i == search_length)) { /* a winner! */ *position = bits16_ptr - (BITS16*)data->ptr; return_val = True; } } if (return_val) break; } /* end outer for - restart search from a new base */ } /* phase three: search after gap end upto end of data - search_length */ if (!return_val) { bits16_ptr = (BITS16 *) data->ptr; if (bits16_ptr + start < bits16_gap_start) bits16_ptr = bits16_gap_end; /* we've already started... * continue at gap end. */ else bits16_ptr = (BITS16*)data->ptr + (bits16_gap_end - bits16_gap_start) + start; while (!return_val && bits16_ptr <= bits16_end_ptr) { if (*bits16_ptr == *bits16_search_string) { /* potential winner! */ for (match = True, i=1; match && (i < search_length); i++) { if (bits16_ptr[i] != bits16_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = bits16_ptr - (BITS16 *)data->ptr - (bits16_gap_end - bits16_gap_start); return_val = True; } } bits16_ptr++; /* advance base of search */ match = True; } } /* clean up before you go */ if (bits16_search_string != NULL) XtFree((char*)bits16_search_string); break; } /* end case 2 */ default: { wchar_t *wchar_t_ptr, *wchar_t_search_string, *wchar_t_gap_start; wchar_t *wchar_t_gap_end, *wchar_t_end_ptr, *wchar_t_tmp_ptr; wchar_t *wchar_t_end_of_data; wchar_t_ptr = wchar_t_search_string = NULL; wchar_t_gap_start = wchar_t_gap_end = NULL; wchar_t_search_string = (wchar_t *) XtMalloc((unsigned) (search_length + 1) * sizeof(wchar_t)); (void)_XmTextBytesToCharacters((char *) wchar_t_search_string, search_string, search_length, True, (int)tw->text.char_size); /* setup the variables for the search of new lines before the gap */ wchar_t_gap_start = (wchar_t *) data->gap_start; wchar_t_gap_end = (wchar_t *) data->gap_end; wchar_t_ptr = (wchar_t *)data->ptr; /* Make sure you don't search past end of data. End of data is... */ wchar_t_end_of_data = wchar_t_ptr + data->length + (wchar_t_gap_end - wchar_t_gap_start); /* only need to search up to end - search_length position */ if (wchar_t_end_of_data - search_length >= wchar_t_gap_end) wchar_t_end_ptr = wchar_t_end_of_data - search_length; else wchar_t_end_ptr = wchar_t_gap_start - (search_length - (wchar_t_end_of_data - wchar_t_gap_end)); /* Phase one: search from start to gap start - search_length */ wchar_t_ptr = (wchar_t *)data->ptr + start; while (!return_val && wchar_t_ptr + search_length <= wchar_t_gap_start) { if (*wchar_t_ptr == *wchar_t_search_string) { /* potential winner! */ for (match = True, i = 1; match && (i < search_length); i++) { if (wchar_t_ptr[i] != wchar_t_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = wchar_t_ptr - (wchar_t *)data->ptr; return_val = True; } } wchar_t_ptr++; /* advance base of search */ match = True; } /* Phase two: these searches span the gap and are SLOW! * Two possibilities: either I'm just short of the gap * (and must do searches that span the gap) or start puts * the base after gap end. Also, possibility that there * isn't enough room after the gap for a complete match * (so no need to search it). */ /* Do this as nested for loops; the outer loop advances the base for * the search, the inner loop compares character elements from 0 to * length(search_string). */ /* if no match yet and if need to search prior to gap_start... */ wchar_t_ptr = (wchar_t *) data->ptr; if (!return_val && (wchar_t_ptr + start) < wchar_t_gap_start) { if (wchar_t_ptr + start < wchar_t_gap_start - search_length) wchar_t_ptr = wchar_t_gap_start - search_length; else wchar_t_ptr = (wchar_t*)data->ptr + start; for (match = True; wchar_t_ptr < wchar_t_gap_start && (wchar_t_gap_start - wchar_t_ptr) + (wchar_t_end_of_data - wchar_t_gap_end) >= search_length; wchar_t_ptr++, match = True) { if (*wchar_t_ptr == *wchar_t_search_string) { /* have a potential winner */ for (i = 1; i < search_length && match == True; i ++) { if (wchar_t_ptr + i >= wchar_t_gap_start) { wchar_t_tmp_ptr = wchar_t_ptr + (wchar_t_gap_end - wchar_t_gap_start) + i; if (*wchar_t_tmp_ptr != wchar_t_search_string[i]) { match = False; i--; } } else { if (wchar_t_ptr[i] != wchar_t_search_string[i]) { match = False; i--; } } } /* end inner for loop - searching from current base */ if (match && (i == search_length)) { /* a winner! */ *position = wchar_t_ptr - (wchar_t*)data->ptr; return_val = True; } } if (return_val) break; } /* end outer for - restart search from a new base */ } /* phase three: search after gap end upto end of data - search_length */ if (!return_val) { wchar_t_ptr = (wchar_t *) data->ptr; if (wchar_t_ptr + start < wchar_t_gap_start) wchar_t_ptr = wchar_t_gap_end; /* we've already started... * continue at gap end. */ else wchar_t_ptr = (wchar_t*)data->ptr + (wchar_t_gap_end - wchar_t_gap_start) + start; while (!return_val && wchar_t_ptr <= wchar_t_end_ptr) { if (*wchar_t_ptr == *wchar_t_search_string) { /* potential winner!*/ for (match = True, i = 1; match && (i < search_length); i++) { if (wchar_t_ptr[i] != wchar_t_search_string[i]) { match = False; i--; } } if (i == search_length) { /* we have a winner! */ *position = wchar_t_ptr - (wchar_t *)data->ptr - (wchar_t_gap_end - wchar_t_gap_start); return_val = True; } } wchar_t_ptr++; /* advance base of search */ match = True; } } /* clean up before you go */ if (wchar_t_search_string != NULL) XtFree((char*)wchar_t_search_string); break; } /* end default */ } /* end switch */ return return_val; } Boolean XmTextFindString(Widget w, XmTextPosition start, char* search_string, XmTextDirection direction, XmTextPosition *position) { XmSourceData data; Boolean ret_val; _XmWidgetToAppContext(w); if (XmIsTextField(w)) return False; _XmAppLock(app); data = ((XmTextWidget)w)->text.source->data; if (start > data->length) start = data->length; else if (start < 0) start = 0; if (direction == XmTEXT_BACKWARD) ret_val = _XmTextFindStringBackwards(w, start, search_string, position); else ret_val = _XmTextFindStringForwards(w, start, search_string, position); _XmAppUnlock(app); return (ret_val); } Boolean XmTextFindStringWcs(Widget w, XmTextPosition start, wchar_t* wc_string, XmTextDirection direction, XmTextPosition *position) { wchar_t *tmp_wc; char *string; int num_chars = 0; Boolean return_val = False; XmTextWidget tw = (XmTextWidget) w; int wcs_ret_val = 0; _XmWidgetToAppContext(w); _XmAppLock(app); if (!XmIsTextField(w)) { for (num_chars = 0, tmp_wc = wc_string; *tmp_wc != (wchar_t)0L; num_chars++) tmp_wc++; string = XtMalloc ((unsigned) (num_chars + 1) * (int)tw->text.char_size); wcs_ret_val = wcstombs(string, wc_string, (num_chars + 1) * (int)tw->text.char_size); if (wcs_ret_val >= 0) return_val = XmTextFindString(w, start, string, direction, position); XtFree(string); _XmAppUnlock(app); return(return_val); } else { _XmAppUnlock(app); return False; } } motif-2.3.8/lib/Xm/TextF.c0000644000175000017500000114075113146675203012133 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TextF.c /main/65 1999/09/01 17:28:48 mgreess $" #endif #endif #include #include /* required for MB_LEN_MAX definition */ #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "DestI.h" #include "DisplayI.h" #include "GMUtilsI.h" #include "ImageCachI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "TextFI.h" #include "TextFSelI.h" #include "TravActI.h" #include "TraversalI.h" #include "VendorSEI.h" #include "XmStringI.h" #ifdef PRINTING_SUPPORTED #include /* for XmIsPrintShell */ #endif #ifdef USE_XFT #include #include "XmRenderTI.h" #endif #include #define FIX_1409 #if (defined(__FreeBSD__) && (__FreeBSD__ < 4)) || \ (defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)) /* * Modification by Integrated Computer Solutions, Inc. May 2000 * * FreeBSD (pre-4.0), DARWIN, NetBSD, and OpenBSD do not include the necessary * wide character string functions. Use the internal _Xwc... routines and add * the other missing functions as _Xmwc... routines. The new functions are * added static to this file. */ #define wcslen(c) _Xwcslen(c) #define wcscpy(d,s) _Xwcscpy(d,s) #define wcsncpy(d,s,l) _Xwcsncpy(d,s,l) static wchar_t* _Xmwcschr(const wchar_t *ws, wchar_t wc) { for (;; ++ws) { if (*ws == wc) return((wchar_t *)ws); if (!*ws) return((wchar_t *)NULL); } /* NOTREACHED */ } #define wcschr(w,c) _Xmwcschr(w,c) static wchar_t* _Xmwcscat(wchar_t *ws1, const wchar_t *ws2) { wchar_t *save = ws1; for (; *ws1; ++ws1); while (*ws1++ = *ws2++); return save; } #define wcscat(w1,w2) _Xmwcscat(w1,w2) static wchar_t* _Xmwcsncat(wchar_t *ws1, const wchar_t *ws2, size_t n) { if (n != 0) { register wchar_t *d = ws1; register const wchar_t *s = ws2; while (*d != 0) d++; do { if ((*d = *s++) == 0) break; d++; } while (--n != 0); *d = 0; } return ws1; } #define wcsncat(w1,w2,l) _Xmwcsncat(w1,w2,l) #else /* !__FreeBSD__ */ #include #endif /* __FreeBSD__ */ #define MSG1 _XmMMsgTextF_0000 #define MSG2 _XmMMsgTextF_0001 #define MSG3 _XmMMsgTextF_0002 #define MSG4 _XmMMsgTextF_0003 #define MSG5 _XmMMsgTextF_0004 #define MSG7 _XmMMsgTextF_0006 #define WC_MSG1 _XmMMsgTextFWcs_0000 #define GRABKBDERROR _XmMMsgRowColText_0024 #define TEXT_INCREMENT 32 #define PRIM_SCROLL_INTERVAL 100 #define SEC_SCROLL_INTERVAL 200 #define XmDYNAMIC_BOOL 255 /* For the action parameters that are processed as reptypes */ #define _RIGHT 0 #define _LEFT 1 #define EventBindings1 _XmTextF_EventBindings1 #define EventBindings2 _XmTextF_EventBindings2 #define EventBindings3 _XmTextF_EventBindings3 #define TEXT_MAX_INSERT_SIZE 64 /* Size of buffer for XLookupString. */ typedef struct { Boolean has_destination; XmTextPosition position; int replace_length; Boolean quick_key; } TextFDestDataRec, *TextFDestData; /******** Static Function Declarations ********/ static void MakeCopy(Widget w, int n, XtArgVal *value); static void WcsMakeCopy(Widget w, int n, XtArgVal *value); static void FreeContextData(Widget w, XtPointer clientData, XtPointer callData); static TextFDestData GetTextFDestData(Widget w); static _XmHighlightRec * FindHighlight(XmTextFieldWidget w, XmTextPosition position); static void InsertHighlight(XmTextFieldWidget w, XmTextPosition position, XmHighlightMode mode); static void TextFieldSetHighlight(XmTextFieldWidget tf, XmTextPosition left, XmTextPosition right, XmHighlightMode mode); static Boolean GetXYFromPos(XmTextFieldWidget tf, XmTextPosition position, Position *x, Position *y); static Boolean CurrentCursorState(XmTextFieldWidget tf); static void PaintCursor(XmTextFieldWidget tf); static void BlinkInsertionPoint(XmTextFieldWidget tf); static void HandleTimer(XtPointer closure, XtIntervalId *id); static void ChangeBlinkBehavior(XmTextFieldWidget tf, #if NeedWidePrototypes int turn_on); #else Boolean turn_on); #endif /* NeedWidePrototypes */ static void GetRect(XmTextFieldWidget tf, XRectangle *rect); static void SetFullGC(XmTextFieldWidget tf, GC gc); static void SetMarginGC(XmTextFieldWidget tf, GC gc); static void SetNormGC(XmTextFieldWidget tf, GC gc, #if NeedWidePrototypes int change_stipple, int stipple); #else Boolean change_stipple, Boolean stipple); #endif /* NeedWidePrototypes */ #ifdef FIX_1381 static void SetShadowGC(XmTextFieldWidget tf, GC gc); #endif static void SetInvGC(XmTextFieldWidget tf, GC gc); static void DrawText(XmTextFieldWidget tf, GC gc, int x, int y, char *string, int length); static int FindPixelLength(XmTextFieldWidget tf, char *string, int length); static void DrawTextSegment(XmTextFieldWidget tf, XmHighlightMode mode, XmTextPosition prev_seg_start, XmTextPosition seg_start, XmTextPosition seg_end, XmTextPosition next_seg, #if NeedWidePrototypes int stipple, #else Boolean stipple, #endif /* NeedWidePrototypes */ int y, int *x); static void RedisplayText(XmTextFieldWidget tf, XmTextPosition start, XmTextPosition end); static void ComputeSize(XmTextFieldWidget tf, Dimension *width, Dimension *height); static XtGeometryResult TryResize(XmTextFieldWidget tf, #if NeedWidePrototypes int width, int height); #else Dimension width, Dimension height); #endif /* NeedWidePrototypes */ static Boolean AdjustText(XmTextFieldWidget tf, XmTextPosition position, #if NeedWidePrototypes int flag); #else Boolean flag); #endif /* NeedWidePrototypes */ static void AdjustSize(XmTextFieldWidget tf); static Boolean ModifyVerify(XmTextFieldWidget tf, XEvent *event, XmTextPosition *replace_prev, XmTextPosition *replace_next, char **insert, int *insert_length, XmTextPosition *newInsert, int *free_insert); static void ResetClipOrigin(XmTextFieldWidget tf); static void InvertImageGC(XmTextFieldWidget tf); static void ResetImageGC(XmTextFieldWidget tf); typedef enum { ForceTrue, DontCare } PassDisown; static void SetCursorPosition(XmTextFieldWidget tf, XEvent *event, XmTextPosition position, #if NeedWidePrototypes int adjust_flag, int call_cb, int set_dest, #else Boolean adjust_flag, Boolean call_cb, Boolean set_dest, #endif /* NeedWidePrototypes */ PassDisown passDisown); static void VerifyBounds(XmTextFieldWidget tf, XmTextPosition *from, XmTextPosition *to); static XmTextPosition GetPosFromX(XmTextFieldWidget tf, #if NeedWidePrototypes int x); #else Position x); #endif /* NeedWidePrototypes */ static Boolean SetDestination(Widget w, XmTextPosition position, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time set_time); static Boolean VerifyLeave(XmTextFieldWidget tf, XEvent *event); static Boolean _XmTextFieldIsWordBoundary(XmTextFieldWidget tf, XmTextPosition pos1, XmTextPosition pos2); static Boolean _XmTextFieldIsWSpace(wchar_t wide_char, wchar_t *white_space, int num_entries); static void FindWord(XmTextFieldWidget tf, XmTextPosition begin, XmTextPosition *left, XmTextPosition *right); static void FindPrevWord(XmTextFieldWidget tf, XmTextPosition *left, XmTextPosition *right); static void FindNextWord(XmTextFieldWidget tf, XmTextPosition *left, XmTextPosition *right); static void CheckDisjointSelection(Widget w, XmTextPosition position, Time sel_time); static Boolean NeedsPendingDelete(XmTextFieldWidget tf); static Boolean NeedsPendingDeleteDisjoint(XmTextFieldWidget tf); static void InsertChar(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeletePrevChar(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeleteNextChar(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeletePrevWord(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeleteNextWord(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeleteToEndOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeleteToStartOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessCancel(Widget w, XEvent *event, char **params, Cardinal *num_params); static void Activate(Widget w, XEvent *event, char **params, Cardinal *num_params); static void SetAnchorBalancing(XmTextFieldWidget tf, XmTextPosition position); static void SetNavigationAnchor(XmTextFieldWidget tf, XmTextPosition old_position, XmTextPosition new_position, #if NeedWidePrototypes int extend); #else Boolean extend); #endif /* NeedWidePrototypes */ static void CompleteNavigation(XmTextFieldWidget tf, XEvent *event, XmTextPosition position, Time time, #if NeedWidePrototypes int extend); #else Boolean extend); #endif /* NeedWidePrototypes */ static void SimpleMovement(Widget w, XEvent *event, String *params, Cardinal *num_params, XmTextPosition cursorPos, XmTextPosition position); static void BackwardChar(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ForwardChar(Widget w, XEvent *event, char **params, Cardinal *num_params); static void BackwardWord(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ForwardWord(Widget w, XEvent *event, char **params, Cardinal *num_params); static void EndOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params); static void BeginningOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params); static void SetSelection(XmTextFieldWidget tf, XmTextPosition left, XmTextPosition right, #if NeedWidePrototypes int redisplay); #else Boolean redisplay); #endif /* NeedWidePrototypes */ static void ProcessHorizontalParams(Widget w, XEvent *event, char **params, Cardinal *num_params, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position); static void ProcessSelectParams(Widget w, XEvent *event, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position); static void KeySelection(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TextFocusIn(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TextFocusOut(Widget w, XEvent *event, char **params, Cardinal *num_params); static void SetScanIndex(XmTextFieldWidget tf, XEvent *event); static void ExtendScanSelection(XmTextFieldWidget tf, XEvent *event); static void SetScanSelection(XmTextFieldWidget tf, XEvent *event); static void StartPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params); static void MoveDestination(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ExtendPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ExtendEnd(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DoExtendedSelection(Widget w, Time time); static void DoSecondaryExtend(Widget w, Time ev_time); static void BrowseScroll(XtPointer closure, XtIntervalId *id); static Boolean CheckTimerScrolling(Widget w, XEvent *event); static void RestorePrimaryHighlight(XmTextFieldWidget tf, XmTextPosition prim_left, XmTextPosition prim_right); static void StartDrag(Widget w, XEvent *event, String *params, Cardinal *num_params); static void DragStart(XtPointer data, XtIntervalId *id); static void StartSecondary(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessBDrag(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessBDragEvent(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessBDragRelease(Widget w, XEvent *event, String *params, Cardinal *num_params); static Boolean InSelection(Widget w, XEvent *event); static void ProcessBSelect(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessBSelectEvent(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ExtendSecondary(Widget w, XEvent *event, char **params, Cardinal *num_params); static void Stuff(Widget w, XEvent *event, char **params, Cardinal *num_params); static void SecondaryNotify(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessCopy(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessLink(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessMove(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeleteSelection(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ClearSelection(Widget w, XEvent *event, char **params, Cardinal *num_params); static void PageRight(Widget w, XEvent *event, char **params, Cardinal *num_params); static void PageLeft(Widget w, XEvent *event, char **params, Cardinal *num_params); static void CopyPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params); static void CutPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params); static void LinkPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params); static void SetAnchor(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ToggleOverstrike(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ToggleAddMode(Widget w, XEvent *event, char **params, Cardinal *num_params); static void SelectAll(Widget w, XEvent *event, char **params, Cardinal *num_params); static void DeselectAll(Widget w, XEvent *event, char **params, Cardinal *num_params); static void VoidAction(Widget w, XEvent *event, char **params, Cardinal *num_params); static void CutClipboard(Widget w, XEvent *event, char **params, Cardinal *num_params); static void CopyClipboard(Widget w, XEvent *event, char **params, Cardinal *num_params); static void PasteClipboard(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TraverseDown(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TraverseUp(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TraverseHome(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TraverseNextTabGroup(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TraversePrevTabGroup(Widget w, XEvent *event, char **params, Cardinal *num_params); static void TextEnter(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TextLeave(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ClassInitialize(void); static void ClassPartInitialize(WidgetClass w_class); static void Validates(XmTextFieldWidget tf); static Boolean LoadFontMetrics(XmTextFieldWidget tf); static void ValidateString(XmTextFieldWidget tf, char *value, #if NeedWidePrototypes int is_wchar); #else Boolean is_wchar); #endif /* NeedWidePrototypes */ static void InitializeTextStruct(XmTextFieldWidget tf); static void LoadGCs(XmTextFieldWidget tf, Pixel background, Pixel foreground); static void MakeIBeamOffArea(XmTextFieldWidget tf, #if NeedWidePrototypes int width, int height); #else Dimension width, Dimension height); #endif /* NeedWidePrototypes */ static Pixmap FindPixmap(Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth); static void MakeIBeamStencil(XmTextFieldWidget tf, int line_width); static void MakeAddModeCursor(XmTextFieldWidget tf, int line_width); static void MakeCursors(XmTextFieldWidget tf); static void DragProcCallback(Widget w, XtPointer client, XtPointer call); static void RegisterDropSite(Widget w); static void Initialize(Widget request, Widget new_w, ArgList args, Cardinal *num_args); static void Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes); static void Destroy(Widget wid); static void Resize(Widget w); static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *reply); static void TextFieldExpose(Widget w, XEvent *event, Region region); static Boolean SetValues(Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args); static Boolean TextFieldGetBaselines(Widget w, Dimension **baselines, int *line_count); static Boolean TextFieldGetDisplayRect(Widget w, XRectangle *display_rect); static void TextFieldMarginsProc(Widget w, XmBaselineMargins *margins_rec); static XtPointer TextFieldGetValue(Widget w, int format); static void TextFieldSetValue(Widget w, XtPointer s, int format); static int TextFieldPreferredValue(Widget w); static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value); static Boolean TextFieldRemove(Widget w, XEvent *event); static void TextFieldReplace(Widget w, XmTextPosition from_pos, XmTextPosition to_pos, char *value, int is_wc); static void CursorPosVisDefault( Widget widget, int offset, XrmValue *value) ; static int PreeditStart(XIC xic, XPointer client_data, XPointer call_data); static void PreeditDone(XIC xic, XPointer client_data, XPointer call_data); static void PreeditDraw(XIC xic, XPointer client_data, XIMPreeditDrawCallbackStruct *call_data); static void PreeditCaret(XIC xic, XPointer client_data, XIMPreeditCaretCallbackStruct *call_data); static void PreeditSetCursorPosition(XmTextFieldWidget tf, XmTextPosition position); static void TextFieldResetIC(Widget w); static void doSetHighlight(Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode) ; static Boolean TrimHighlights(XmTextFieldWidget tf, int *low, int *high); static void ResetUnder(XmTextFieldWidget tf); /******** End Static Function Declarations ********/ static XmConst XmTextScanType sarray[] = { XmSELECT_POSITION, XmSELECT_WORD, XmSELECT_LINE }; static XContext _XmTextFDestContext = 0; /* default translations and action recs */ static XtActionsRec text_actions[] = { /* Text Replacing Bindings */ {"self-insert", InsertChar}, {"delete-previous-character", DeletePrevChar}, {"delete-next-character", DeleteNextChar}, {"delete-previous-word", DeletePrevWord}, {"delete-next-word", DeleteNextWord}, {"delete-to-end-of-line", DeleteToEndOfLine}, {"delete-to-start-of-line", DeleteToStartOfLine}, /* Miscellaneous Bindings */ {"activate", Activate}, {"process-cancel", ProcessCancel}, {"process-bdrag", ProcessBDrag}, {"process-bdrag-event", ProcessBDragEvent}, {"process-bselect", ProcessBSelect}, {"process-bselect-event", ProcessBSelectEvent}, /* Motion Bindings */ {"backward-character", BackwardChar}, {"forward-character", ForwardChar}, {"backward-word", BackwardWord}, {"forward-word", ForwardWord}, {"end-of-line", EndOfLine}, {"beginning-of-line", BeginningOfLine}, {"page-left", PageLeft}, {"page-right", PageRight}, /* Selection Bindings */ {"key-select", KeySelection}, {"grab-focus", StartPrimary}, {"move-destination", MoveDestination}, {"extend-start", ExtendPrimary}, {"extend-adjust", ExtendPrimary}, {"extend-end", ExtendEnd}, {"delete-selection", DeleteSelection}, {"clear-selection", ClearSelection}, {"cut-primary", CutPrimary}, {"link-primary", LinkPrimary}, {"copy-primary", CopyPrimary}, {"set-anchor", SetAnchor}, {"toggle-overstrike", ToggleOverstrike}, {"toggle-add-mode", ToggleAddMode}, {"select-all", SelectAll}, {"deselect-all", DeselectAll}, /* Quick Cut and Paste Bindings */ {"secondary-start", StartSecondary}, {"secondary-adjust", ExtendSecondary}, {"copy-to", ProcessCopy}, {"link-to", ProcessLink}, {"move-to", ProcessMove}, {"quick-cut-set", VoidAction}, {"quick-copy-set", VoidAction}, {"do-quick-action", VoidAction}, /* Clipboard Bindings */ {"cut-clipboard", CutClipboard}, {"copy-clipboard", CopyClipboard}, {"paste-clipboard", PasteClipboard}, /* Traversal */ {"traverse-next", TraverseDown}, {"traverse-prev", TraverseUp}, {"traverse-home", TraverseHome}, {"next-tab-group", TraverseNextTabGroup}, {"prev-tab-group", TraversePrevTabGroup}, /* Focus */ {"focusIn", TextFocusIn}, {"focusOut", TextFocusOut}, {"enter", TextEnter}, {"leave", TextLeave}, }; static XtResource resources[] = { { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.activate_callback), XmRCallback, NULL }, { XmNlosingFocusCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.losing_focus_callback), XmRCallback, NULL }, { XmNfocusCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.focus_callback), XmRCallback, NULL }, { XmNmodifyVerifyCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.modify_verify_callback), XmRCallback, NULL }, { XmNmodifyVerifyCallbackWcs, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.wcs_modify_verify_callback), XmRCallback, NULL }, { XmNmotionVerifyCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.motion_verify_callback), XmRCallback, NULL }, { XmNgainPrimaryCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.gain_primary_callback), XmRCallback, NULL }, { XmNlosePrimaryCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.lose_primary_callback), XmRCallback, NULL }, { XmNvalueChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.value_changed_callback), XmRCallback, NULL }, { XmNdestinationCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextFieldRec, text.destination_callback), XmRCallback, NULL }, { XmNvalue, XmCValue, XmRString, sizeof(String), XtOffsetOf(struct _XmTextFieldRec, text.value), XmRString, "" }, { XmNvalueWcs, XmCValueWcs, XmRValueWcs, sizeof(wchar_t*), XtOffsetOf(struct _XmTextFieldRec, text.wc_value), XmRString, NULL }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(struct _XmTextFieldRec, text.margin_height), XmRImmediate, (XtPointer) 5 }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(struct _XmTextFieldRec, text.margin_width), XmRImmediate, (XtPointer) 5 }, { XmNcursorPosition, XmCCursorPosition, XmRTextPosition, sizeof (XmTextPosition), XtOffsetOf(struct _XmTextFieldRec, text.cursor_position), XmRImmediate, (XtPointer) 0 }, { XmNcolumns, XmCColumns, XmRShort, sizeof(short), XtOffsetOf(struct _XmTextFieldRec, text.columns), XmRImmediate, (XtPointer) 20 }, { XmNmaxLength, XmCMaxLength, XmRInt, sizeof(int), XtOffsetOf(struct _XmTextFieldRec, text.max_length), XmRImmediate, (XtPointer) INT_MAX }, { XmNblinkRate, XmCBlinkRate, XmRInt, sizeof(int), XtOffsetOf(struct _XmTextFieldRec, text.blink_rate), XmRImmediate, (XtPointer) 500 }, { "pri.vate","Pri.vate",XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextFieldRec, text.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(struct _XmTextFieldRec, text.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(struct _XmTextFieldRec, text.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNselectionArray, XmCSelectionArray, XmRPointer, sizeof(XtPointer), XtOffsetOf(struct _XmTextFieldRec, text.selection_array), XmRImmediate, (XtPointer) sarray }, { XmNselectionArrayCount, XmCSelectionArrayCount, XmRInt, sizeof(int), XtOffsetOf(struct _XmTextFieldRec, text.selection_array_count), XmRImmediate, (XtPointer) XtNumber(sarray) }, { XmNresizeWidth, XmCResizeWidth, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextFieldRec, text.resize_width), XmRImmediate, (XtPointer) False }, { XmNpendingDelete, XmCPendingDelete, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextFieldRec, text.pending_delete), XmRImmediate, (XtPointer) True }, { XmNeditable, XmCEditable, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextFieldRec, text.editable), XmRImmediate, (XtPointer) True }, { XmNcursorPositionVisible, XmCCursorPositionVisible, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextFieldRec, text.cursor_position_visible), XmRCallProc, (XtPointer) CursorPosVisDefault }, { XmNverifyBell, XmCVerifyBell, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextFieldRec, text.verify_bell), XmRImmediate, (XtPointer) XmDYNAMIC_BOOL }, { XmNselectThreshold, XmCSelectThreshold, XmRInt, sizeof(int), XtOffsetOf(struct _XmTextFieldRec, text.threshold), XmRImmediate, (XtPointer) 5 }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf(struct _XmPrimitiveRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmTAB_GROUP } }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(struct _XmTextFieldRec, text.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(struct _XmTextFieldRec, text.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNvalue, sizeof(char *), XtOffsetOf(struct _XmTextFieldRec, text.value), MakeCopy, }, { XmNvalueWcs, sizeof(wchar_t *), XtOffsetOf(struct _XmTextFieldRec, text.wc_value), WcsMakeCopy, } }; static XmPrimitiveClassExtRec _XmTextFPrimClassExtRec = { NULL, NULLQUARK, XmPrimitiveClassExtVersion, sizeof(XmPrimitiveClassExtRec), TextFieldGetBaselines, /* widget_baseline */ TextFieldGetDisplayRect, /* widget_display_rect */ TextFieldMarginsProc, /* get/set widget margins */ }; externaldef(xmtextfieldclassrec) XmTextFieldClassRec xmTextFieldClassRec = { { (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "XmTextField", /* class_name */ sizeof(XmTextFieldRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initiali*/ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ Realize, /* realize */ text_actions, /* actions */ XtNumber(text_actions), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal | /* compress_exposure */ XtExposeNoRegion, TRUE, /* compress_enterleave*/ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ TextFieldExpose, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ NULL, /* tm_table */ QueryGeometry, /* query_geometry */ (XtStringProc)NULL, /* display accel */ NULL, /* extension */ }, { /* Xmprimitive */ XmInheritBorderHighlight, /* border_highlight */ XmInheritBorderUnhighlight, /* border_unhighlight */ NULL, /* translations */ (XtActionProc)NULL, /* arm_and_activate */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num syn_resources */ (XtPointer) &_XmTextFPrimClassExtRec, /* extension */ }, { /* text class */ NULL, /* extension */ } }; externaldef(xmtextfieldwidgetclass) WidgetClass xmTextFieldWidgetClass = (WidgetClass) &xmTextFieldClassRec; /* AccessXmString Trait record for TextField */ static XmConst XmAccessTextualTraitRec textFieldCS = { 0, /* version */ TextFieldGetValue, TextFieldSetValue, TextFieldPreferredValue, }; static void ClassInitialize(void) { _XmTextFieldInstallTransferTrait(); XmeTraitSet((XtPointer)xmTextFieldWidgetClass, XmQTaccessTextual, (XtPointer) &textFieldCS); } /********************************************************************* * * CursorPosVisDefault * * *********************************************************************/ /*ARGSUSED*/ static void CursorPosVisDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { static Boolean cursor_pos_vis ; Widget print_shell ; value->addr = (XPointer) &cursor_pos_vis; print_shell = widget ; while(print_shell && !XmIsPrintShell(print_shell)) print_shell = XtParent(print_shell); if (print_shell) cursor_pos_vis = False ; else cursor_pos_vis = True ; } /* USE ITERATIONS OF mblen TO COUNT THE NUMBER OF CHARACTERS REPRESENTED * BY n_bytes BYTES POINTED TO BY ptr, a pointer to char*. * n_bytes does not include NULL terminator (if any), nor does return. */ /* ARGSUSED */ int _XmTextFieldCountCharacters(XmTextFieldWidget tf, char *ptr, int n_bytes) { char * bptr; int count = 0; #ifndef NO_MULTIBYTE int char_size = 0; #else int char_size = 1; #endif if (n_bytes <= 0 || ptr == NULL || *ptr == '\0') return 0; if (tf->text.max_char_size == 1) return n_bytes; bptr = ptr; #ifndef NO_MULTIBYTE for (bptr = ptr; n_bytes > 0; count++, bptr+= char_size) { char_size = mblen(bptr, tf->text.max_char_size); if (char_size <= 0) break; /* error */ n_bytes -= char_size; } #else while (*bptr++ && n_bytes--) count++; #endif return count; } /* USE ITERATIONS OF wctomb TO COUNT THE NUMBER OF BYTES REQUIRED FOR THE * MULTI-BYTE REPRESENTION OF num_chars WIDE CHARACTERS IN wc_value. * COUNT TERMINATED IF NULL ENCOUNTERED IN THE STRING. * NUMBER OF BYTES IS RETURNED. */ /* ARGSUSED */ int _XmTextFieldCountBytes(XmTextFieldWidget tf, wchar_t * wc_value, int num_chars) { wchar_t * wc_ptr; char tmp[MB_LEN_MAX]; /* defined in limits.h: max in any locale */ int n_bytes = 0; int n_bytes_per_char = 0; if (num_chars <= 0 || wc_value == NULL || *wc_value == (wchar_t)0L) return 0; if (tf->text.max_char_size == 1) return num_chars; wc_ptr = wc_value; while ((num_chars > 0) && (*wc_ptr != (wchar_t)0L)) { n_bytes_per_char = wctomb(tmp, *wc_ptr); if (n_bytes_per_char > 0 ) n_bytes += n_bytes_per_char; num_chars--; wc_ptr++; } return n_bytes; } /*ARGSUSED*/ static void MakeCopy(Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmTextFieldGetString (w); } /*ARGSUSED*/ static void WcsMakeCopy(Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmTextFieldGetStringWcs (w); } /*ARGSUSED*/ static void FreeContextData(Widget w, /* unused */ XtPointer clientData, XtPointer callData) /* unused */ { XmTextContextData ctx_data = (XmTextContextData) clientData; Display *display = DisplayOfScreen(ctx_data->screen); XtPointer data_ptr; if (XFindContext(display, (Window) ctx_data->screen, ctx_data->context, (char **) &data_ptr)) { if (ctx_data->type != '\0') { if (data_ptr) XtFree((char *) data_ptr); } XDeleteContext (display, (Window) ctx_data->screen, ctx_data->context); } XtFree ((char *) ctx_data); } static TextFDestData GetTextFDestData(Widget w) { TextFDestData dest_data; Display *display = XtDisplay(w); Screen *screen = XtScreen(w); XContext loc_context; _XmProcessLock(); if (_XmTextFDestContext == 0) _XmTextFDestContext = XUniqueContext(); loc_context = _XmTextFDestContext; _XmProcessUnlock(); if (XFindContext(display, (Window) screen, loc_context, (char **) &dest_data)) { XmTextContextData ctx_data; Widget xm_display = (Widget) XmGetXmDisplay(display); ctx_data = (XmTextContextData) XtMalloc(sizeof(XmTextContextDataRec)); ctx_data->screen = screen; ctx_data->context = loc_context; ctx_data->type = _XM_IS_DEST_CTX; dest_data = (TextFDestData) XtCalloc((unsigned)sizeof(TextFDestDataRec), (unsigned) 1); XtAddCallback(xm_display, XmNdestroyCallback, (XtCallbackProc) FreeContextData, (XtPointer) ctx_data); XSaveContext(XtDisplay(w), (Window) screen, loc_context, (XPointer)dest_data); } return dest_data; } void _XmTextFToggleCursorGC(Widget widget) { XmTextFieldWidget tf = (XmTextFieldWidget) widget; XGCValues values; unsigned long valueMask; Pixmap stipple = XmUNSPECIFIED_PIXMAP; SetFullGC(tf, tf->text.image_gc); ResetClipOrigin(tf); if (!XtIsRealized(widget)) return; #ifdef FIX_1501 if (!XtIsSensitive((Widget)tf)) { valueMask = GCForeground|GCBackground|GCFillStyle|GCStipple|GCFunction; values.foreground = _XmAssignInsensitiveColor((Widget)tf); values.background = tf->core.background_pixel; values.fill_style = FillStippled; if (tf->text.overstrike) { if (tf->text.stipple_tile == XmUNSPECIFIED_PIXMAP) return; values.stipple = tf->text.stipple_tile; values.function = GXxor; } else { if (tf->text.cursor == XmUNSPECIFIED_PIXMAP) return; values.stipple = tf->text.cursor; values.function = GXcopy; } } else { #endif if (tf->text.overstrike) { valueMask = GCFillStyle|GCFunction|GCForeground|GCBackground; if (!tf->text.add_mode && XtIsSensitive(widget) && (tf->text.has_focus || tf->text.has_destination)) { values.fill_style = FillSolid; } else { valueMask |= GCStipple; values.fill_style = FillStippled; values.stipple = tf->text.stipple_tile; } values.foreground = values.background = tf->primitive.foreground ^ tf->core.background_pixel; values.function = GXxor; } else { valueMask = GCStipple; if (XGetGCValues(XtDisplay(widget), tf->text.image_gc, valueMask, &values)) stipple = values.stipple; valueMask = GCFillStyle|GCFunction|GCForeground|GCBackground; if (XtIsSensitive(widget) && !tf->text.add_mode && (tf->text.has_focus || tf->text.has_destination)) { if (tf->text.cursor == XmUNSPECIFIED_PIXMAP) return; if (stipple != tf->text.cursor) { values.stipple = tf->text.cursor; valueMask |= GCStipple; } } else { if (tf->text.add_mode_cursor == XmUNSPECIFIED_PIXMAP) return; if (stipple != tf->text.add_mode_cursor) { values.stipple = tf->text.add_mode_cursor; valueMask |= GCStipple; } } values.fill_style = FillStippled; values.function = GXcopy; if (tf->text.have_inverted_image_gc) { values.background = tf->primitive.foreground; values.foreground = tf->core.background_pixel; } else { values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; } } #ifdef FIX_1501 } #endif XSetClipMask(XtDisplay(widget), tf->text.save_gc, None); XChangeGC(XtDisplay(widget), tf->text.image_gc, valueMask, &values); } /* * Find the highlight record corresponding to the given position. Returns a * pointer to the record. The third argument indicates whether we are probing * the left or right edge of a highlighting range. */ static _XmHighlightRec * FindHighlight(XmTextFieldWidget w, XmTextPosition position) { _XmHighlightRec *l = w->text.highlight.list; int i; for (i=w->text.highlight.number - 1; i>=0; i--) if (position >= l[i].position) { l = l + i; break; } return(l); } static void InsertHighlight(XmTextFieldWidget w, XmTextPosition position, XmHighlightMode mode) { _XmHighlightRec *l1; _XmHighlightRec *l = w->text.highlight.list; int i, j; l1 = FindHighlight(w, position); if (l1->position == position) l1->mode = mode; else { i = (l1 - l) + 1; w->text.highlight.number++; if (w->text.highlight.number > w->text.highlight.maximum) { w->text.highlight.maximum = w->text.highlight.number; l = w->text.highlight.list = (_XmHighlightRec *) XtRealloc((char *) l, (unsigned)(w->text.highlight.maximum * sizeof(_XmHighlightRec))); } for (j=w->text.highlight.number-1; j>i; j--) l[j] = l[j-1]; l[i].position = position; l[i].mode = mode; } } static void TextFieldSetHighlight(XmTextFieldWidget tf, XmTextPosition left, XmTextPosition right, XmHighlightMode mode) { _XmHighlightRec *l; XmHighlightMode endmode; int i, j; if (left >= right || right <= 0) return; _XmTextFieldDrawInsertionPoint(tf, False); endmode = FindHighlight(tf, right)->mode; InsertHighlight(tf, left, mode); InsertHighlight(tf, right, endmode); l = tf->text.highlight.list; i = 1; while (i < tf->text.highlight.number) { if (l[i].position >= left && l[i].position < right) l[i].mode = mode; if (l[i].mode == l[i-1].mode) { tf->text.highlight.number--; for (j=i; jtext.highlight.number; j++) l[j] = l[j+1]; } else i++; } if (TextF_CursorPosition(tf) > left && TextF_CursorPosition(tf) < right) { if (mode == XmHIGHLIGHT_SELECTED) { InvertImageGC(tf); } else if (mode != XmHIGHLIGHT_SELECTED) { ResetImageGC(tf); } } tf->text.refresh_ibeam_off = True; _XmTextFieldDrawInsertionPoint(tf, True); } /* * Get x and y based on position. */ static Boolean GetXYFromPos(XmTextFieldWidget tf, XmTextPosition position, Position *x, Position *y) { /* initialize the x and y positions to zero */ *x = 0; *y = 0; if (position > tf->text.string_length) return False; if (tf->text.max_char_size != 1) { *x += FindPixelLength(tf, (char*)TextF_WcValue(tf), (int)position); } else { *x += FindPixelLength(tf, TextF_Value(tf), (int)position); } *y += tf->primitive.highlight_thickness + tf->primitive.shadow_thickness + tf->text.margin_top + TextF_FontAscent(tf); *x += (Position) tf->text.h_offset; return True; } static Boolean CurrentCursorState(XmTextFieldWidget tf) { if (tf->text.cursor_on < 0) return False; if (tf->text.blink_on || !XtIsSensitive((Widget)tf)) return True; return False; } /* * Paint insert cursor */ static void PaintCursor(XmTextFieldWidget tf) { Position x, y; XmTextPosition position; if (!TextF_CursorPositionVisible(tf)) return; _XmTextFToggleCursorGC((Widget)tf); position = TextF_CursorPosition(tf); (void) GetXYFromPos(tf, position, &x, &y); if (!tf->text.overstrike) x -=(tf->text.cursor_width >> 1) + 1; /* "+1" for 1 pixel left of char */ else { int pxlen; if (tf->text.max_char_size != 1) pxlen = FindPixelLength(tf, (char*)&(TextF_WcValue(tf)[position]), 1); else pxlen = FindPixelLength(tf, &(TextF_Value(tf)[position]), 1); if (pxlen > tf->text.cursor_width) x += (pxlen - tf->text.cursor_width) >> 1; } y = (y + (Position) TextF_FontDescent(tf)) - (Position) tf->text.cursor_height; /* If time to paint the I Beam... first capture the IBeamOffArea, then draw * the IBeam */ if (tf->text.refresh_ibeam_off == True) { /* get area under IBeam first */ /* Fill is needed to realign clip rectangle with gc */ XFillRectangle(XtDisplay((Widget)tf), XtWindow((Widget)tf), tf->text.save_gc, 0, 0, 0, 0); XCopyArea(XtDisplay(tf), XtWindow(tf), tf->text.ibeam_off, tf->text.save_gc, x, y, tf->text.cursor_width, tf->text.cursor_height, 0, 0); tf->text.refresh_ibeam_off = False; } /* redraw cursor, being very sure to keep it within the bounds of the ** text area, not spilling into the highlight area */ { int cursor_width = tf->text.cursor_width; int cursor_height = tf->text.cursor_height; if ((tf->text.cursor_on >= 0) && tf->text.blink_on) { if ((int)(x + tf->text.cursor_width) > (int)(tf->core.width - tf->primitive.shadow_thickness - tf->primitive.highlight_thickness)) cursor_width = (tf->core.width - (tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)) - x; #ifdef FIX_1501 if (cursor_width > 0 && cursor_height > 0) { if (!XtIsSensitive((Widget) tf)) { SetShadowGC(tf, tf->text.image_gc); XFillRectangle(XtDisplay(tf), XtWindow(tf), tf->text.image_gc, x + 1, y + 1, (unsigned int) cursor_width, (unsigned int) cursor_height); } _XmTextFToggleCursorGC((Widget) tf); #else if ( cursor_width > 0 && cursor_height > 0 ) #endif XFillRectangle(XtDisplay(tf), XtWindow(tf), tf->text.image_gc, x, y, cursor_width, cursor_height); #ifdef FIX_1501 } #endif } else { Position src_x = 0; if ((int)(x + tf->text.cursor_width) > (int)(tf->core.width - tf->primitive.shadow_thickness - tf->primitive.highlight_thickness)) { cursor_width = (tf->core.width - (tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)) - x; } else if (x < (Position)(tf->primitive.highlight_thickness + tf->primitive.shadow_thickness)) { cursor_width = tf->text.cursor_width - (tf->primitive.highlight_thickness + tf->primitive.shadow_thickness - x); src_x = tf->text.cursor_width - cursor_width; x = tf->primitive.highlight_thickness + tf->primitive.shadow_thickness; } if ((int)(y + tf->text.cursor_height) > (int)(tf->core.height - (tf->primitive.highlight_thickness + tf->primitive.shadow_thickness))) { cursor_height = tf->text.cursor_height - ((y + tf->text.cursor_height) - (tf->core.height - (tf->primitive.highlight_thickness + tf->primitive.shadow_thickness))); } if (cursor_width > 0 && cursor_height > 0) XCopyArea(XtDisplay(tf), tf->text.ibeam_off, XtWindow(tf), tf->text.save_gc, src_x, 0, cursor_width, cursor_height, x, y); } } } void _XmTextFieldDrawInsertionPoint(XmTextFieldWidget tf, #if NeedWidePrototypes int turn_on) #else Boolean turn_on) #endif /* NeedWidePrototypes */ { if (turn_on == True) { tf->text.cursor_on += 1; if (TextF_BlinkRate(tf) == 0 || !tf->text.has_focus) tf->text.blink_on = True; } else { if (tf->text.blink_on && (tf->text.cursor_on == 0)) if (tf->text.blink_on == CurrentCursorState(tf) && XtIsRealized((Widget)tf)) { tf->text.blink_on = !tf->text.blink_on; PaintCursor(tf); } tf->text.cursor_on -= 1; } if (tf->text.cursor_on < 0 || !XtIsRealized((Widget) tf)) return; PaintCursor(tf); } static void BlinkInsertionPoint(XmTextFieldWidget tf) { if ((tf->text.cursor_on >= 0) && (tf->text.blink_on == CurrentCursorState(tf)) && XtIsRealized((Widget)tf)) { tf->text.blink_on = !tf->text.blink_on; PaintCursor(tf); } } /* * Handle blink on and off */ /* ARGSUSED */ static void HandleTimer(XtPointer closure, XtIntervalId *id) { XmTextFieldWidget tf = (XmTextFieldWidget) closure; if (TextF_BlinkRate(tf) != 0) tf->text.timer_id = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)tf), (unsigned long)TextF_BlinkRate(tf), HandleTimer, (XtPointer) closure); if (tf->text.has_focus && XtIsSensitive((Widget)tf)) BlinkInsertionPoint(tf); } /* * Change state of blinking insert cursor on and off */ static void ChangeBlinkBehavior(XmTextFieldWidget tf, #if NeedWidePrototypes int turn_on) #else Boolean turn_on) #endif /* NeedWidePrototypes */ { if (turn_on) { if (TextF_BlinkRate(tf) != 0 && tf->text.timer_id == (XtIntervalId)0) tf->text.timer_id = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)tf), (unsigned long)TextF_BlinkRate(tf), HandleTimer, (XtPointer) tf); tf->text.blink_on = True; } else { if (tf->text.timer_id) XtRemoveTimeOut(tf->text.timer_id); tf->text.timer_id = (XtIntervalId)0; } } static void GetRect(XmTextFieldWidget tf, XRectangle *rect) { Dimension margin_width = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_top = tf->text.margin_top + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_bottom = tf->text.margin_bottom + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; if (margin_width < tf->core.width) rect->x = margin_width; else rect->x = tf->core.width; if (margin_top < tf->core.height) rect->y = margin_top; else rect->y = tf->core.height; if ((Dimension)(2 * margin_width) < tf->core.width) rect->width = (int) tf->core.width - (2 * margin_width); else rect->width = 0; if ((Dimension)(margin_top + margin_bottom) < tf->core.height) rect->height = (int) tf->core.height - (margin_top + margin_bottom); else rect->height = 0; } static void SetFullGC(XmTextFieldWidget tf, GC gc) { XRectangle ClipRect; /* adjust clip rectangle to allow the cursor to paint into the margins */ ClipRect.x = tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; ClipRect.y = tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; ClipRect.width = tf->core.width - (2 * (tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)); ClipRect.height = tf->core.height - (2 *(tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)); XSetClipRectangles(XtDisplay(tf), gc, 0, 0, &ClipRect, 1, Unsorted); } static void SetMarginGC(XmTextFieldWidget tf, GC gc) { XRectangle ClipRect; GetRect(tf, &ClipRect); #ifdef USE_XFT if (TextF_UseXft(tf)) _XmXftSetClipRectangles(XtDisplay(tf), XtWindow(tf), 0, 0, &ClipRect, 1); #endif XSetClipRectangles(XtDisplay(tf), gc, 0, 0, &ClipRect, 1, Unsorted); } /* * Set new clipping rectangle for text field. This is * done on each focus in event since the text field widgets * share the same GC. */ void _XmTextFieldSetClipRect(XmTextFieldWidget tf) { XGCValues values; unsigned long valueMask = (unsigned long) 0; SetMarginGC(tf, tf->text.gc); /* Restore cached text gc to state correct for this instantiation */ if (tf->text.gc) { #if USE_XFT if (!TextF_UseFontSet(tf) && !TextF_UseXft(tf) && (TextF_Font(tf) != NULL)) { #else if (!TextF_UseFontSet(tf) && (TextF_Font(tf) != NULL)) { #endif valueMask |= GCFont; values.font = TextF_Font(tf)->fid; } values.foreground = tf->primitive.foreground ^ tf->core.background_pixel; values.background = 0; XChangeGC(XtDisplay(tf), tf->text.gc, valueMask, &values); } } static void SetNormGC(XmTextFieldWidget tf, GC gc, #if NeedWidePrototypes int change_stipple, int stipple) #else Boolean change_stipple, Boolean stipple) #endif /* NeedWidePrototypes */ { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; _XmTextFieldSetClipRect(tf); values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; if (change_stipple) { valueMask |= GCFillStyle; if (stipple) { #ifdef FIX_1381 /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor((Widget)tf); values.fill_style = FillSolid; #else values.fill_style = FillStippled; valueMask |= GCStipple; values.stipple = tf->text.stipple_tile; #endif } else values.fill_style = FillSolid; } XChangeGC(XtDisplay(tf), gc, valueMask, &values); } #ifdef FIX_1381 static void SetShadowGC(XmTextFieldWidget tf, GC gc) { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; values.foreground = tf->primitive.top_shadow_color; values.background = tf->core.background_pixel; XChangeGC(XtDisplay(tf), gc, valueMask, &values); } #endif static void SetInvGC(XmTextFieldWidget tf, GC gc) { unsigned long valueMask = (GCForeground | GCBackground); XGCValues values; _XmTextFieldSetClipRect(tf); values.foreground = tf->core.background_pixel; values.background = tf->primitive.foreground; XChangeGC(XtDisplay(tf), gc, valueMask, &values); } static void DrawText(XmTextFieldWidget tf, GC gc, int x, int y, char * string, int length) { if (TextF_UseFontSet(tf)) { if (tf->text.max_char_size != 1) XwcDrawString (XtDisplay(tf), XtWindow(tf), (XFontSet)TextF_Font(tf), gc, x, y, (wchar_t*) string, length); else /* one byte chars */ XmbDrawString (XtDisplay(tf), XtWindow(tf), (XFontSet)TextF_Font(tf), gc, x, y, string, length); #ifdef USE_XFT } else if (TextF_UseXft(tf)) { if (tf->text.max_char_size != 1) { /* was passed a wchar_t* */ char stack_cache[400], *tmp; wchar_t tmp_wc; wchar_t *wc_string = (wchar_t*)string; int num_bytes = 0; /* ptr = tmp = XtMalloc((int)(length + 1)*sizeof(wchar_t)); */ tmp = (char *)XmStackAlloc((Cardinal) ((length + 1)*sizeof(wchar_t)), stack_cache); tmp_wc = wc_string[length]; wc_string[length] = 0L; num_bytes = wcstombs(tmp, wc_string, (int)((length + 1) * sizeof(wchar_t))); wc_string[length] = tmp_wc; if (num_bytes >= 0) _XmXftDrawString2(XtDisplay(tf), XtWindow(tf), gc, TextF_XftFont(tf), 1, x, y, tmp, num_bytes); XmStackFree(tmp, stack_cache); } else /* one byte chars */ _XmXftDrawString2(XtDisplay(tf), XtWindow(tf), gc, TextF_XftFont(tf), 1, x, y, string, length); #endif } else { /* have a font struct, not a font set */ if (tf->text.max_char_size != 1) { /* was passed a wchar_t* */ char stack_cache[400], *tmp; wchar_t tmp_wc; wchar_t *wc_string = (wchar_t*)string; int num_bytes = 0; /* ptr = tmp = XtMalloc((int)(length + 1)*sizeof(wchar_t)); */ tmp = (char *)XmStackAlloc((Cardinal) ((length + 1)*sizeof(wchar_t)), stack_cache); tmp_wc = wc_string[length]; wc_string[length] = 0L; num_bytes = wcstombs(tmp, wc_string, (int)((length + 1) * sizeof(wchar_t))); wc_string[length] = tmp_wc; if (num_bytes >= 0) { if (_XmIsISO10646(XtDisplay(tf), TextF_Font(tf))) { size_t str_len = 0; XChar2b *str = _XmUtf8ToUcs2(tmp, num_bytes, &str_len); XDrawString16(XtDisplay(tf), XtWindow(tf), gc, x, y, str, str_len); XFree(str); } else XDrawString (XtDisplay(tf), XtWindow(tf), gc, x, y, tmp, num_bytes); } XmStackFree(tmp, stack_cache); } else /* one byte chars */ XDrawString (XtDisplay(tf), XtWindow(tf), gc, x, y, string, length); } } static int FindPixelLength(XmTextFieldWidget tf, char * string, int length) { if (TextF_UseFontSet(tf)) { if (tf->text.max_char_size != 1) return (XwcTextEscapement((XFontSet)TextF_Font(tf), (wchar_t *) string, length)); else /* one byte chars */ return (XmbTextEscapement((XFontSet)TextF_Font(tf), string, length)); #ifdef USE_XFT } else if (TextF_UseXft(tf)) { XGlyphInfo ext; if (tf->text.max_char_size != 1) { /* was passed a wchar_t* */ wchar_t *wc_string = (wchar_t*)string; wchar_t wc_tmp = wc_string[length]; char stack_cache[400], *tmp; int num_bytes; wc_string[length] = 0L; tmp = (char*)XmStackAlloc((Cardinal)((length + 1) * sizeof(wchar_t)), stack_cache); num_bytes = wcstombs(tmp, wc_string, (int)((length + 1)*sizeof(wchar_t))); wc_string[length] = wc_tmp; XftTextExtentsUtf8(XtDisplay(tf), TextF_XftFont(tf), (FcChar8*)tmp, num_bytes, &ext); XmStackFree(tmp, stack_cache); } else /* one byte chars */ XftTextExtentsUtf8(XtDisplay(tf), TextF_XftFont(tf), (FcChar8*)string, length, &ext); return ext.xOff; #endif } else { /* have font struct, not a font set */ if (tf->text.max_char_size != 1) { /* was passed a wchar_t* */ wchar_t *wc_string = (wchar_t*)string; wchar_t wc_tmp = wc_string[length]; char stack_cache[400], *tmp; int num_bytes, ret_len = 0; wc_string[length] = 0L; tmp = (char*)XmStackAlloc((Cardinal)((length + 1) * sizeof(wchar_t)), stack_cache); num_bytes = wcstombs(tmp, wc_string, (int)((length + 1)*sizeof(wchar_t))); wc_string[length] = wc_tmp; if (num_bytes >= 0) { if (_XmIsISO10646(XtDisplay(tf), TextF_Font(tf))) { size_t str_len = 0; XChar2b *str = _XmUtf8ToUcs2(tmp, num_bytes, &str_len); ret_len = XTextWidth16(TextF_Font(tf), str, str_len); XFree(str); } else ret_len = XTextWidth(TextF_Font(tf), tmp, num_bytes); } XmStackFree(tmp, stack_cache); return (ret_len); } else /* one byte chars */ return XTextWidth(TextF_Font(tf), string, length); } } static void DrawTextSegment(XmTextFieldWidget tf, XmHighlightMode mode, XmTextPosition prev_seg_start, XmTextPosition seg_start, XmTextPosition seg_end, XmTextPosition next_seg, #if NeedWidePrototypes int stipple, #else Boolean stipple, #endif /* NeedWidePrototypes */ int y, int *x) { int x_seg_len; /* update x position up to start position */ if (tf->text.max_char_size != 1) { *x += FindPixelLength(tf, (char*)(TextF_WcValue(tf) + prev_seg_start), (int)(seg_start - prev_seg_start)); x_seg_len = FindPixelLength(tf, (char*)(TextF_WcValue(tf) + seg_start), (int)seg_end - (int)seg_start); } else { *x += FindPixelLength(tf, TextF_Value(tf) + prev_seg_start, (int)(seg_start - prev_seg_start)); x_seg_len = FindPixelLength(tf, TextF_Value(tf) + seg_start, (int)seg_end - (int)seg_start); } if (mode == XmHIGHLIGHT_SELECTED) { /* Draw the selected text using an inverse gc */ SetNormGC(tf, tf->text.gc, False, False); XFillRectangle(XtDisplay(tf), XtWindow(tf), tf->text.gc, *x, y - TextF_FontAscent(tf), x_seg_len, TextF_FontAscent(tf) + TextF_FontDescent(tf)); SetInvGC(tf, tf->text.gc); } else { SetInvGC(tf, tf->text.gc); XFillRectangle(XtDisplay(tf), XtWindow(tf), tf->text.gc, *x, y - TextF_FontAscent(tf), x_seg_len, TextF_FontAscent(tf) + TextF_FontDescent(tf)); SetNormGC(tf, tf->text.gc, True, stipple); } #ifdef FIX_1381 if (stipple){ /*Draw shadow for insensitive text*/ SetShadowGC(tf, tf->text.gc); if (tf->text.max_char_size != 1) { DrawText(tf, tf->text.gc, *x+1, y+1, (char*) (TextF_WcValue(tf) + seg_start), (int)seg_end - (int)seg_start); } else { DrawText(tf, tf->text.gc, *x+1, y+1, TextF_Value(tf) + seg_start, (int)seg_end - (int)seg_start); } SetNormGC(tf, tf->text.gc, True, stipple); } #endif if (tf->text.max_char_size != 1) { DrawText(tf, tf->text.gc, *x, y, (char*) (TextF_WcValue(tf) + seg_start), (int)seg_end - (int)seg_start); } else { DrawText(tf, tf->text.gc, *x, y, TextF_Value(tf) + seg_start, (int)seg_end - (int)seg_start); } if (stipple) SetNormGC(tf, tf->text.gc, True, !stipple); if (mode == XmHIGHLIGHT_SECONDARY_SELECTED) XDrawLine(XtDisplay(tf), XtWindow(tf), tf->text.gc, *x, y, *x + x_seg_len - 1, y); /* update x position up to the next highlight position */ if (tf->text.max_char_size != 1) *x += FindPixelLength(tf, (char*) (TextF_WcValue(tf) + seg_start), (int)(next_seg - (int)seg_start)); else *x += FindPixelLength(tf, TextF_Value(tf) + seg_start, (int)(next_seg - (int)seg_start)); } /* * Redisplay the new adjustments that have been made the the text * field widget. */ static void RedisplayText(XmTextFieldWidget tf, XmTextPosition start, XmTextPosition end) { _XmHighlightRec *l = tf->text.highlight.list; XRectangle rect; int x, y, i; Dimension margin_width = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_top = tf->text.margin_top + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension margin_bottom = tf->text.margin_bottom + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Boolean stipple = False; if (!XtIsRealized((Widget)tf)) return; if (tf->text.in_setvalues) { tf->text.redisplay = True; return; } if ((int)tf->core.width - (int)(2 * margin_width) <= 0) return; if ((int)tf->core.height - (int)(margin_top + margin_bottom) <= 0) return; _XmTextFieldDrawInsertionPoint(tf, False); /* Get the current rectangle. */ GetRect(tf, &rect); x = (int) tf->text.h_offset; y = margin_top + TextF_FontAscent(tf); if (!XtIsSensitive((Widget)tf)) stipple = True; /* search through the highlight array and draw the text */ for (i = 0; i + 1 < tf->text.highlight.number; i++) { /* make sure start is within current highlight */ if (l[i].position <= start && start < l[i+1].position && l[i].position < end) { if (end > l[i+1].position) { DrawTextSegment(tf, l[i].mode, l[i].position, start, l[i+1].position, l[i+1].position, stipple, y, &x); /* update start position to the next highlight position */ start = l[i+1].position; } else { if (start > end) { XmTextPosition tmp = start; start = end; end = tmp; } DrawTextSegment(tf, l[i].mode, l[i].position, start, end, l[i+1].position, stipple, y, &x); start = end; } } else { /* start not within current record */ if (tf->text.max_char_size != 1) x += FindPixelLength(tf, (char*)(TextF_WcValue(tf) + l[i].position), (int)(l[i+1].position - l[i].position)); else x += FindPixelLength(tf, TextF_Value(tf) + l[i].position, (int)(l[i+1].position - l[i].position)); } } /* end for loop */ /* complete the drawing of the text to the end of the line */ if (l[i].position < end) { DrawTextSegment(tf, l[i].mode, l[i].position, start, end, tf->text.string_length, stipple, y, &x); } else { if (tf->text.max_char_size != 1) x += FindPixelLength(tf, (char*) (TextF_WcValue(tf) + l[i].position), tf->text.string_length - (int)l[i].position); else x += FindPixelLength(tf, TextF_Value(tf) + l[i].position, tf->text.string_length - (int)l[i].position); } if (x < (Position)(rect.x + rect.width)) { SetInvGC(tf, tf->text.gc); XFillRectangle(XtDisplay(tf), XtWindow(tf), tf->text.gc, x, rect.y, rect.x + rect.width - x, rect.height); } tf->text.refresh_ibeam_off = True; _XmTextFieldDrawInsertionPoint(tf, True); } /* * Use the font along with the resources that have been set * to determine the height and width of the text field widget. */ static void ComputeSize(XmTextFieldWidget tf, Dimension *width, Dimension *height) { Dimension tmp = 0; if (TextF_ResizeWidth(tf) && TextF_Columns(tf) < tf->text.string_length) { if (tf->text.max_char_size != 1) tmp = FindPixelLength(tf, (char *)TextF_WcValue(tf), tf->text.string_length); else tmp = FindPixelLength(tf, TextF_Value(tf), tf->text.string_length); *width = tmp + (2 * (TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)); } else { *width = TextF_Columns(tf) * tf->text.average_char_width + 2 * (TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); } if (height != NULL) *height = TextF_FontDescent(tf) + TextF_FontAscent(tf) + 2 * (TextF_MarginHeight(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); } /* * TryResize - Attempts to resize the width of the text field widget. * If the attempt fails or is ineffective, return GeometryNo. */ static XtGeometryResult TryResize(XmTextFieldWidget tf, #if NeedWidePrototypes int width, int height) #else Dimension width, Dimension height) #endif /* NeedWidePrototypes */ { Dimension reswidth, resheight; Dimension origwidth = tf->core.width; XtGeometryResult result; result = XtMakeResizeRequest((Widget)tf, width, height, &reswidth, &resheight); if (result == XtGeometryAlmost) { result = XtMakeResizeRequest((Widget)tf, reswidth, resheight, &reswidth, &resheight); if (reswidth == origwidth) result = XtGeometryNo; return result; } /* * Caution: Some geometry managers return XtGeometryYes * and don't change the widget's size. */ if (tf->core.width != width || tf->core.height != height) result = XtGeometryNo; return result; } /* * Function AdjustText * * AdjustText ensures that the character at the given position is entirely * visible in the Text Field widget. If the character is not already entirely * visible, AdjustText changes the Widget's h_offset appropriately. If * the text must be redrawn, AdjustText calls RedisplayText. * */ static Boolean AdjustText(XmTextFieldWidget tf, XmTextPosition position, #if NeedWidePrototypes int flag) #else Boolean flag) #endif /* NeedWidePrototypes */ { int left_edge = 0; int diff; Dimension margin_width = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension thickness = 2 * (tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); Dimension temp; if (tf->text.max_char_size != 1) { left_edge = FindPixelLength(tf, (char *) TextF_WcValue(tf), (int)position) + (int) tf->text.h_offset; } else { left_edge = FindPixelLength(tf, TextF_Value(tf), (int)position) + (int) tf->text.h_offset; } if (left_edge <= (int)margin_width && position == tf->text.string_length) { position = MAX(position - TextF_Columns(tf)/2, 0); if (tf->text.max_char_size != 1) { left_edge = FindPixelLength(tf, (char *) TextF_WcValue(tf), (int)position) + (int) tf->text.h_offset; } else { left_edge = FindPixelLength(tf, TextF_Value(tf), (int)position) + (int) tf->text.h_offset; } } if ((diff = left_edge - margin_width) < 0) { /* We need to scroll the string to the right. */ if (!XtIsRealized((Widget)tf)) { tf->text.h_offset -= diff; return True; } _XmTextFieldDrawInsertionPoint(tf, False); tf->text.h_offset -= diff; SetInvGC(tf, tf->text.gc); SetFullGC(tf, tf->text.gc); if (tf->core.height <= thickness) temp = 0; else temp = tf->core.height - thickness; XFillRectangle(XtDisplay(tf), XtWindow(tf), tf->text.gc, tf->primitive.shadow_thickness + tf->primitive.highlight_thickness, tf->primitive.shadow_thickness + tf->primitive.highlight_thickness, TextF_MarginWidth(tf), temp); SetMarginGC(tf, tf->text.gc); RedisplayText(tf, 0, tf->text.string_length); _XmTextFieldDrawInsertionPoint(tf, True); return True; } else if ((diff = (left_edge - (int)(tf->core.width - margin_width))) > 0) { /* We need to scroll the string to the left. */ if (!XtIsRealized((Widget)tf)) { tf->text.h_offset -= diff; return True; } _XmTextFieldDrawInsertionPoint(tf, False); tf->text.h_offset -= diff; SetInvGC(tf, tf->text.gc); SetFullGC(tf, tf->text.gc); if (tf->core.width <= thickness) temp = 0; else temp = tf->core.width - thickness; XFillRectangle(XtDisplay(tf), XtWindow(tf), tf->text.gc, tf->core.width - margin_width, tf->primitive.shadow_thickness + tf->primitive.highlight_thickness, TextF_MarginWidth(tf), temp); SetMarginGC(tf, tf->text.gc); RedisplayText(tf, 0, tf->text.string_length); _XmTextFieldDrawInsertionPoint(tf, True); return True; } if (flag) RedisplayText(tf, position, tf->text.string_length); return False; } /* * AdjustSize * * Adjust size will resize the text to ensure that all the text is visible. * It will also adjust text that is shrunk. Shrinkage is limited to the * size determined by the XmNcolumns resource. */ static void AdjustSize(XmTextFieldWidget tf) { XtGeometryResult result = XtGeometryYes; int left_edge = 0; int diff; Boolean redisplay = False; Dimension margin_width = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; if (tf->text.max_char_size != 1) { left_edge = FindPixelLength(tf, (char *) TextF_WcValue(tf), tf->text.string_length) + margin_width; } else { left_edge = FindPixelLength(tf, TextF_Value(tf), tf->text.string_length) + margin_width; } if ((diff = (left_edge - (tf->core.width - (margin_width)))) > 0) { if (tf->text.in_setvalues) { tf->core.width += diff; return; } /* Attempt to resize. If it doesn't succeed, do scrolling. */ result = TryResize(tf, tf->core.width + diff, tf->core.height); if (result == XtGeometryYes) { XtWidgetProc resize; _XmProcessLock(); resize = tf->core.widget_class->core_class.resize; _XmProcessUnlock(); (*resize)((Widget)tf); return; } else { /* We need to scroll the string to the left. */ tf->text.h_offset = margin_width - diff; } } else { Dimension width; /* If the new size is smaller than core size, we need * to shrink. Note: new size will never be less than the * width determined by the columns resource. */ ComputeSize(tf, &width, NULL); if (width < tf->core.width) { if (tf->text.in_setvalues) { tf->core.width = width; return; } result = TryResize(tf, width, tf->core.height); if (result == XtGeometryYes) { XtWidgetProc resize; _XmProcessLock(); resize = tf->core.widget_class->core_class.resize; _XmProcessUnlock(); (*resize)((Widget)tf); return; } } } redisplay = AdjustText(tf, TextF_CursorPosition(tf), False); if (!redisplay) RedisplayText(tf, 0, tf->text.string_length); } /* If MB_CUR_MAX == 1, insert is a char* pointer; else, it is a wchar_t * * pointer and must be appropriately cast. In all cases, insert_length * is the number of characters, not the number of bytes pointed to by * insert */ static Boolean ModifyVerify(XmTextFieldWidget tf, XEvent *event, XmTextPosition *replace_prev, XmTextPosition *replace_next, char **insert, int *insert_length, XmTextPosition *newInsert, int *free_insert) { XmTextVerifyCallbackStruct vcb; XmTextVerifyCallbackStructWcs wcs_vcb; XmTextBlockRec newblock; XmTextBlockRecWcs wcs_newblock; Boolean do_free = False; Boolean wcs_do_free = False; int count; wchar_t *wptr; *newInsert = TextF_CursorPosition(tf); *free_insert = (int)False; /* if there are no callbacks, don't waste any time... just return True */ if (!TextF_ModifyVerifyCallback(tf) && !TextF_ModifyVerifyCallbackWcs(tf)) return(True); newblock.format = XmFMT_8_BIT; newblock.length = *insert_length * tf->text.max_char_size; if (*insert_length) { if (TextF_ModifyVerifyCallback(tf)) { newblock.ptr = (char *) XtMalloc((unsigned)newblock.length + tf->text.max_char_size); if (tf->text.max_char_size == 1) { (void)memcpy((void*)newblock.ptr, (void*)*insert, newblock.length); newblock.ptr[newblock.length]='\0'; } else { count = (int) wcstombs(newblock.ptr, (wchar_t*)*insert, newblock.length); if (count < 0) { /* bad wchar; don't pass anything */ newblock.ptr[0] = '\0'; newblock.length = 0; } else if (count == newblock.length) { newblock.ptr[newblock.length] = '\0'; } else { newblock.ptr[count] = '\0'; newblock.length = count; } } do_free = True; } else newblock.ptr = NULL; } else newblock.ptr = NULL; /* Fill in the appropriate structs */ vcb.reason = XmCR_MODIFYING_TEXT_VALUE; vcb.event = (XEvent *) event; vcb.doit = True; vcb.currInsert = TextF_CursorPosition(tf); vcb.newInsert = TextF_CursorPosition(tf); vcb.text = &newblock; vcb.startPos = *replace_prev; vcb.endPos = *replace_next; /* Call the modify verify callbacks. */ if (TextF_ModifyVerifyCallback(tf)) XtCallCallbackList((Widget) tf, TextF_ModifyVerifyCallback(tf), (XtPointer) &vcb); if (TextF_ModifyVerifyCallbackWcs(tf) && vcb.doit) { if (do_free) { /* there is a char* modify verify callback; the data we * want is in vcb struct */ wcs_newblock.wcsptr = (wchar_t *) XtMalloc((unsigned) (vcb.text->length + 1) * sizeof(wchar_t)); wcs_newblock.length = mbstowcs(wcs_newblock.wcsptr, vcb.text->ptr, vcb.text->length); if (wcs_newblock.length < 0) { /* bad value; don't pass anything */ wcs_newblock.wcsptr[0] = 0L; wcs_newblock.length = 0; } else wcs_newblock.wcsptr[wcs_newblock.length] = 0L; } else { /* there was no char* modify verify callback; use data * passed in from caller instead of that in vcb struct. */ wcs_newblock.wcsptr = (wchar_t *) XtMalloc((unsigned) (*insert_length + 1) * sizeof(wchar_t)); if (tf->text.max_char_size == 1) wcs_newblock.length = mbstowcs(wcs_newblock.wcsptr, *insert, *insert_length); else { wcs_newblock.length = *insert_length; (void)memcpy((void*)wcs_newblock.wcsptr, (void*)*insert, *insert_length * sizeof(wchar_t)); } if (wcs_newblock.length < 0) { /* bad value; don't pass anything */ wcs_newblock.wcsptr[0] = 0L; wcs_newblock.length = 0; } else wcs_newblock.wcsptr[wcs_newblock.length] = 0L; } wcs_do_free = True; wcs_vcb.reason = XmCR_MODIFYING_TEXT_VALUE; wcs_vcb.event = (XEvent *) event; wcs_vcb.doit = True; wcs_vcb.currInsert = vcb.currInsert; wcs_vcb.newInsert = vcb.newInsert; wcs_vcb.text = &wcs_newblock; wcs_vcb.startPos = vcb.startPos; wcs_vcb.endPos = vcb.endPos; XtCallCallbackList((Widget) tf, TextF_ModifyVerifyCallbackWcs(tf), (XtPointer) &wcs_vcb); } /* copy the newblock.ptr, length, start, and end to the pointers passed */ if (TextF_ModifyVerifyCallbackWcs(tf)) { /* use wcs_vcb data */ *insert_length = wcs_vcb.text->length; /* length is char count*/ if (wcs_vcb.doit) { if (tf->text.max_char_size == 1) { /* caller expects char */ wcs_vcb.text->wcsptr[wcs_vcb.text->length] = 0L; if (*insert_length > 0) { *insert = XtMalloc((unsigned) *insert_length + 1); *free_insert = (int)True; count = wcstombs(*insert, wcs_vcb.text->wcsptr, *insert_length + 1); if (count < 0) { (*insert)[0] = 0; *insert_length = 0; } } } else { /* callback struct has wchar*; caller expects wchar* */ if (*insert_length > 0) { *insert = XtMalloc((unsigned)(*insert_length + 1) * sizeof(wchar_t)); *free_insert = (int)True; (void)memcpy((void*)*insert, (void*)wcs_vcb.text->wcsptr, *insert_length * sizeof(wchar_t)); wptr = (wchar_t*) *insert; wptr[*insert_length] = 0L; } } *replace_prev = wcs_vcb.startPos; *replace_next = wcs_vcb.endPos; *newInsert = wcs_vcb.newInsert; } } else { /* use vcb data */ if (vcb.doit) { if (tf->text.max_char_size == 1) { /* caller expects char* */ *insert_length = vcb.text->length; if (*insert_length > 0) { *insert = XtMalloc((unsigned) *insert_length + 1); *free_insert = (int)True; (void)memcpy((void*)*insert, (void*)vcb.text->ptr, *insert_length); (*insert)[*insert_length] = 0; } } else { /* caller expects wchar_t* back */ *insert_length = _XmTextFieldCountCharacters(tf, vcb.text->ptr, vcb.text->length); if (*insert_length > 0) { *insert = XtMalloc((unsigned)(*insert_length + 1) * sizeof(wchar_t)); *free_insert = (int)True; count = mbstowcs((wchar_t*)*insert, vcb.text->ptr, *insert_length); wptr = (wchar_t*) *insert; if (count < 0) { wptr[0] = 0L; *insert_length = 0; } else wptr[count] = 0L; } } *replace_prev = vcb.startPos; *replace_next = vcb.endPos; *newInsert = vcb.newInsert; } } if (do_free) XtFree(newblock.ptr); if (wcs_do_free) XtFree((char*)wcs_newblock.wcsptr); /* If doit becomes False, then don't allow the change. */ if (TextF_ModifyVerifyCallbackWcs(tf)) return wcs_vcb.doit; else return vcb.doit; } static void ResetClipOrigin(XmTextFieldWidget tf) { int x, y; Position x_pos, y_pos; (void) GetXYFromPos(tf, TextF_CursorPosition(tf), &x_pos, &y_pos); if (!XtIsRealized((Widget)tf)) return; x = (int) x_pos; y = (int) y_pos; x -=(tf->text.cursor_width >> 1) + 1; y = (y + TextF_FontDescent(tf)) - tf->text.cursor_height; XSetTSOrigin(XtDisplay(tf), tf->text.image_gc, x, y); } static void InvertImageGC (XmTextFieldWidget tf) { if (tf->text.have_inverted_image_gc) return; tf->text.have_inverted_image_gc = True; } static void ResetImageGC (XmTextFieldWidget tf) { if (!tf->text.have_inverted_image_gc) return; tf->text.have_inverted_image_gc = False; } /* * Calls the motion verify callback. If the doit flag is true, * then reset the cursor_position and call AdjustText() to * move the text if need be. */ void _XmTextFieldSetCursorPosition(XmTextFieldWidget tf, XEvent *event, XmTextPosition position, #if NeedWidePrototypes int adjust_flag, int call_cb) #else Boolean adjust_flag, Boolean call_cb) #endif /* NeedWidePrototypes */ { SetCursorPosition(tf, event, position, adjust_flag, call_cb, True,DontCare); } static void SetCursorPosition(XmTextFieldWidget tf, XEvent *event, XmTextPosition position, #if NeedWidePrototypes int adjust_flag, int call_cb, int set_dest, #else Boolean adjust_flag, Boolean call_cb, Boolean set_dest, #endif /* NeedWidePrototypes */ PassDisown passDisown) { XmTextVerifyCallbackStruct cb; Boolean flag = False; XPoint xmim_point; XRectangle xmim_area; _XmHighlightRec *hl_list = tf->text.highlight.list; int i; if (position < 0) position = 0; if (position > tf->text.string_length) position = tf->text.string_length; if (TextF_CursorPosition(tf) != position && call_cb) { /* Call Motion Verify Callback before Cursor Changes Positon */ cb.reason = XmCR_MOVING_INSERT_CURSOR; cb.event = event; cb.currInsert = TextF_CursorPosition(tf); cb.newInsert = position; cb.doit = True; XtCallCallbackList((Widget) tf, TextF_MotionVerifyCallback(tf), (XtPointer) &cb); if (!cb.doit) { if (tf->text.verify_bell) XBell(XtDisplay((Widget)tf), 0); return; } } _XmTextFieldDrawInsertionPoint(tf, False); TextF_CursorPosition(tf) = position; if (!tf->text.add_mode && tf->text.pending_off && tf->text.has_primary) { SetSelection(tf, position, position, True); flag = True; } /* Deterimine if we need an inverted image GC or not. Get the highlight * record for the cursor position. If position is on a boundary of * a highlight, then we always display cursor in normal mode (i.e. set * normal image GC). If position is within a selected highlight rec, * then make sure the image GC is inverted. If we've moved out of a * selected highlight region, restore the normal image GC. */ for (i = tf->text.highlight.number - 1; i >= 0; i--) { if (position >= hl_list[i].position || i == 0) break; } if (position == hl_list[i].position) ResetImageGC(tf); else if (hl_list[i].mode != XmHIGHLIGHT_SELECTED) ResetImageGC(tf); else InvertImageGC(tf); if (adjust_flag) (void) AdjustText(tf, position, flag); tf->text.refresh_ibeam_off = True; _XmTextFieldDrawInsertionPoint(tf, True); (void) GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, &xmim_point.y); (void)TextFieldGetDisplayRect((Widget)tf, &xmim_area); XmImVaSetValues((Widget)tf, XmNspotLocation, &xmim_point, XmNarea, &xmim_area, NULL); if (set_dest) (void) SetDestination((Widget) tf, TextF_CursorPosition(tf), (DontCare == passDisown) ? False : True, XtLastTimestampProcessed(XtDisplay((Widget)tf))); } /* * This routine is used to verify that the positions are within the bounds * of the current TextField widgets value. Also, it ensures that left is * less than right. */ static void VerifyBounds(XmTextFieldWidget tf, XmTextPosition *from, XmTextPosition *to) { XmTextPosition tmp; if (*from < 0) *from = 0; else if (*from > tf->text.string_length) { *from = tf->text.string_length; } if (*to < 0) *to = 0; else if (*to > tf->text.string_length) { *to = tf->text.string_length; } if (*from > *to) { tmp = *to; *to = *from; *from = tmp; } } /* * Function _XmTextFieldReplaceText * * _XmTextFieldReplaceText is a utility function for the text-modifying * action procedures below (InsertChar, DeletePrevChar, and so on). * _XmTextFieldReplaceText does the real work of editing the string, * including: * * (1) invoking the modify verify callbacks, * (2) allocating more memory for the string if necessary, * (3) doing the string manipulation, * (4) moving the selection (the insertion point), and * (5) redrawing the text. * * Though the procedure claims to take a char* argument, MB_CUR_MAX determines * what the different routines will actually pass to it. If MB_CUR_MAX is * greater than 1, then "insert" points to wchar_t data and we must set up * the appropriate cast. In all cases, insert_length is the number of * characters (not bytes) to be inserted. */ Boolean _XmTextFieldReplaceText(XmTextFieldWidget tf, XEvent *event, XmTextPosition replace_prev, XmTextPosition replace_next, char *insert, int insert_length, #if NeedWidePrototypes int move_cursor) #else Boolean move_cursor) #endif /* NeedWidePrototypes */ { int replace_length, i; char *src, *dst; wchar_t *wc_src, *wc_dst; int delta = 0; XmTextPosition cursorPos, newInsert; XmTextPosition old_pos = replace_prev; int free_insert = (int)False; char *insert_orig; int insert_length_orig; int size = 0; VerifyBounds(tf, &replace_prev, &replace_next); if (!TextF_Editable(tf)) { if (tf->text.verify_bell) XBell(XtDisplay((Widget)tf), 0); return False; } if (tf->text.programmatic_highlights) { /* ** XmTextFieldSetHighlight called since last interaction here ** that resulted in clearing program-set highlights */ int low = 0, high = 0; if (TrimHighlights(tf, &low, &high)) { RedisplayText(tf, low, high); tf->text.programmatic_highlights = False; } } replace_length = (int) (replace_next - replace_prev); delta = insert_length - replace_length; /* Disallow insertions that go beyond max length boundries. */ if ((delta >= 0) && !FUnderVerifyPreedit(tf) && ((tf->text.string_length + delta) - (TextF_MaxLength(tf)) > 0)) { if (tf->text.verify_bell) XBell(XtDisplay(tf), 0); return False; } /* If there are modify verify callbacks, verify that we want to continue * the action. */ newInsert = TextF_CursorPosition(tf); if (TextF_ModifyVerifyCallback(tf) || TextF_ModifyVerifyCallbackWcs(tf)) { /* If the function ModifyVerify() returns false then don't * continue with the action. */ insert_length_orig = insert_length; if (insert_length > 0) { if (tf->text.max_char_size == 1) size = sizeof(char); else size = sizeof(wchar_t); insert_orig = XtMalloc(insert_length * size); bcopy(insert, insert_orig, insert_length * size); } else insert_orig = NULL; if (!ModifyVerify(tf, event, &replace_prev, &replace_next, &insert, &insert_length, &newInsert, &free_insert)) { if (tf->text.verify_bell) XBell(XtDisplay(tf), 0); if (free_insert) XtFree(insert); if (FUnderVerifyPreedit(tf)) { FVerifyCommitNeeded(tf) = True; PreEnd(tf) -= insert_length_orig; } return False; } else { if (FUnderVerifyPreedit(tf)) if (insert_length != insert_length_orig || memcmp(insert, insert_orig, insert_length * size) != 0) { FVerifyCommitNeeded(tf) = True; PreEnd(tf) += insert_length - insert_length_orig; } VerifyBounds(tf, &replace_prev, &replace_next); replace_length = (int) (replace_next - replace_prev); delta = insert_length - replace_length; /* Disallow insertions that go beyond max length boundries. */ if ((delta >= 0) && !FUnderVerifyPreedit(tf) && ((tf->text.string_length + delta) - (TextF_MaxLength(tf)) > 0)) { if (tf->text.verify_bell) XBell(XtDisplay(tf), 0); if (free_insert) XtFree(insert); return False; } } XtFree(insert_orig); } /* make sure selections are turned off prior to changeing text */ if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) doSetHighlight((Widget)tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_NORMAL); _XmTextFieldDrawInsertionPoint(tf, False); /* Allocate more space if we need it. */ if (tf->text.max_char_size == 1) { if (tf->text.string_length + insert_length - replace_length >= tf->text.size_allocd) { tf->text.size_allocd += MAX(insert_length + TEXT_INCREMENT, (tf->text.size_allocd * 2)); tf->text.value = (char *) XtRealloc((char*)TextF_Value(tf), (unsigned) (tf->text.size_allocd * sizeof(char))); } } else { if ((tf->text.string_length + insert_length - replace_length) * sizeof(wchar_t) >= tf->text.size_allocd) { tf->text.size_allocd += MAX((insert_length + TEXT_INCREMENT)*sizeof(wchar_t), (tf->text.size_allocd * 2)); tf->text.wc_value = (wchar_t *) XtRealloc((char*)TextF_WcValue(tf), (unsigned) tf->text.size_allocd); } } if (tf->text.has_primary && replace_prev < tf->text.prim_pos_right && replace_next > tf->text.prim_pos_left) { if (replace_prev <= tf->text.prim_pos_left) { if (replace_next < tf->text.prim_pos_right) { /* delete encompasses left half of the selection * so move left endpoint */ tf->text.prim_pos_left = replace_next; } else { /* delete encompasses the selection so set selection to NULL */ tf->text.prim_pos_left = tf->text.prim_pos_right; } } else { /* * the 2 cases below were incorrect, and have now * been synchronized with the corresponding block of code in * TextStrSo.c */ if (replace_next > tf->text.prim_pos_right) { /* delete encompasses the right half of the selection * so move right endpoint */ tf->text.prim_pos_right = replace_prev; } else { /* delete is completely within the selection * so decrease size of selection. */ tf->text.prim_pos_right -= (replace_next - replace_prev); } } } if (tf->text.max_char_size == 1) { if (replace_length > insert_length) /* We need to shift the text at and after replace_next to the left. */ for (src = TextF_Value(tf) + replace_next, dst = src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; ++src, ++dst, --i) *dst = *src; else if (replace_length < insert_length) /* We need to shift the text at and after replace_next to the right. */ /* Need to add 1 to string_length to handle the NULL terminator on */ /* the string. */ for (src = TextF_Value(tf) + tf->text.string_length, dst = src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; --src, --dst, --i) *dst = *src; /* Update the string. */ if (insert_length != 0) { for (src = insert, dst = TextF_Value(tf) + replace_prev, i = insert_length; i > 0; ++src, ++dst, --i) *dst = *src; } } else { /* have wchar_t* data */ if (replace_length > insert_length) /* We need to shift the text at and after replace_next to the left. */ for (wc_src = TextF_WcValue(tf) + replace_next, wc_dst = wc_src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; ++wc_src, ++wc_dst, --i) *wc_dst = *wc_src; else if (replace_length < insert_length) /* We need to shift the text at and after replace_next to the right. */ /* Need to add 1 to string_length to handle the NULL terminator on */ /* the string. */ for (wc_src = TextF_WcValue(tf) + tf->text.string_length, wc_dst = wc_src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; --wc_src, --wc_dst, --i) *wc_dst = *wc_src; /* Update the string. */ if (insert_length != 0) { for (wc_src = (wchar_t *)insert, wc_dst = TextF_WcValue(tf) + replace_prev, i = insert_length; i > 0; ++wc_src, ++wc_dst, --i) *wc_dst = *wc_src; } } if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) { if (replace_prev <= tf->text.prim_pos_left) { tf->text.prim_pos_left += delta; tf->text.prim_pos_right += delta; } if (tf->text.prim_pos_left > tf->text.prim_pos_right) tf->text.prim_pos_right = tf->text.prim_pos_left; } /* make sure the selection are redisplay, since they were turned off earlier */ if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) doSetHighlight((Widget)tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_SELECTED); tf->text.string_length += insert_length - replace_length; if (move_cursor) { if (TextF_CursorPosition(tf) != newInsert) { if (newInsert > tf->text.string_length) { cursorPos = tf->text.string_length; } else if (newInsert < 0) { cursorPos = 0; } else { cursorPos = newInsert; } } else cursorPos = replace_next + (insert_length - replace_length); if (event != NULL) { (void)SetDestination((Widget)tf, cursorPos, False, event->xkey.time); } else { (void) SetDestination((Widget)tf, cursorPos, False, XtLastTimestampProcessed(XtDisplay((Widget)tf))); } _XmTextFieldSetCursorPosition(tf, event, cursorPos, False, True); } if (TextF_ResizeWidth(tf) && tf->text.do_resize) { AdjustSize(tf); } else { AdjustText(tf, TextF_CursorPosition(tf), False); RedisplayText(tf, old_pos, tf->text.string_length); } _XmTextFieldDrawInsertionPoint(tf, True); if (free_insert) XtFree(insert); return True; } /* * Reset selection flag and selection positions and then display * the new settings. */ void _XmTextFieldDeselectSelection(Widget w, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time sel_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; if (w != NULL && disown) { if (!sel_time) sel_time = _XmValidTimestamp(w); /* * Disown the primary selection (This function is a no-op if * this widget doesn't own the primary selection) */ XtDisownSelection(w, XA_PRIMARY, sel_time); } if (tf != NULL) { _XmTextFieldDrawInsertionPoint(tf, False); tf->text.has_primary = False; tf->text.take_primary = True; TextFieldSetHighlight(tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_NORMAL); tf->text.prim_pos_left = tf->text.prim_pos_right = tf->text.prim_anchor = TextF_CursorPosition(tf); if (!tf->text.has_focus && tf->text.add_mode) tf->text.add_mode = False; RedisplayText(tf, 0, tf->text.string_length); _XmTextFieldDrawInsertionPoint(tf, True); } } /* * Finds the cursor position from the given X value. */ static XmTextPosition GetPosFromX(XmTextFieldWidget tf, #if NeedWidePrototypes int x) #else Position x) #endif /* NeedWidePrototypes */ { XmTextPosition position; int temp_x = 0; int next_char_width = 0; /* Decompose the x to equal the length of the text string */ temp_x += (int) tf->text.h_offset; /* Next width is an offset allowing button presses on the left side * of a character to select that character, while button presses * on the rigth side of the character select the NEXT character. */ if (tf->text.string_length > 0) { if (tf->text.max_char_size != 1) { next_char_width = FindPixelLength(tf, (char*)TextF_WcValue(tf), 1); } else { next_char_width = FindPixelLength(tf, TextF_Value(tf), 1); } } for (position = 0; temp_x + next_char_width/2 < (int) x && position < tf->text.string_length; position++) { temp_x+=next_char_width; /* * We still haven't reached the x pos. * Add the width and find the next chars * width. */ /* * If there is a next position, find its width. Otherwise, use the * current "next" width. */ if (tf->text.string_length > position + 1) { if (tf->text.max_char_size != 1) { next_char_width = FindPixelLength(tf, (char*)(TextF_WcValue(tf) + position + 1), 1); } else { next_char_width = FindPixelLength(tf, TextF_Value(tf) + position + 1, 1); } } } /* for */ return position; } /* ARGSUSED */ static Boolean SetDestination(Widget w, XmTextPosition position, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time set_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean result = TRUE; Atom MOTIF_DESTINATION = XInternAtom(XtDisplay(w), XmS_MOTIF_DESTINATION, False); if (!XtIsRealized(w)) return False; _XmTextFieldDrawInsertionPoint(tf, False); if (!disown) { if (!tf->text.has_destination) { if (!set_time) set_time = _XmValidTimestamp(w); result = XmeSecondarySink(w, set_time); tf->text.dest_time = set_time; tf->text.has_destination = result; if (result) _XmSetDestination(XtDisplay(w), w); } } else { if (tf->text.has_destination) { if (!set_time) set_time = _XmValidTimestamp(w); XtDisownSelection(w, MOTIF_DESTINATION, set_time); /* Call XmGetDestination(dpy) to get widget that last had destination cursor. */ if (w == XmGetDestination(XtDisplay(w))) _XmSetDestination(XtDisplay(w), (Widget)NULL); tf->text.has_destination = False; } } _XmTextFieldDrawInsertionPoint(tf, True); return result; } Boolean _XmTextFieldSetDestination(Widget w, XmTextPosition position, Time set_time) { Boolean result; result = SetDestination(w, position, False, set_time); return result; } /* * Calls the losing focus verify callback to verify that the application * want to traverse out of the text field widget. Returns the result. */ static Boolean VerifyLeave(XmTextFieldWidget tf, XEvent *event) { XmTextVerifyCallbackStruct cbdata; cbdata.reason = XmCR_LOSING_FOCUS; cbdata.event = event; cbdata.doit = True; cbdata.currInsert = TextF_CursorPosition(tf); cbdata.newInsert = TextF_CursorPosition(tf); cbdata.startPos = TextF_CursorPosition(tf); cbdata.endPos = TextF_CursorPosition(tf); cbdata.text = NULL; XtCallCallbackList((Widget) tf, TextF_LosingFocusCallback(tf), (XtPointer) &cbdata); tf->text.take_primary = True; return(cbdata.doit); } /* This routine is used to determine if two adjacent wchar_t characters * constitute a word boundary */ /* ARGSUSED */ static Boolean _XmTextFieldIsWordBoundary(XmTextFieldWidget tf, XmTextPosition pos1 , XmTextPosition pos2) { int size_pos1 = 0; int size_pos2 = 0; char s1[MB_LEN_MAX]; char s2[MB_LEN_MAX]; /* if positions aren't adjacent, return False */ if(pos1 < pos2 && ((pos2 - pos1) != 1)) return False; else if(pos2 < pos1 && ((pos1 - pos2) != 1)) return False; if (tf->text.max_char_size == 1) { /* data is char* and one-byte per char */ if (isspace((unsigned char)TextF_Value(tf)[pos1]) || isspace((unsigned char)TextF_Value(tf)[pos2])) return True; } else { size_pos1 = wctomb(s1, TextF_WcValue(tf)[pos1]); size_pos2 = wctomb(s2, TextF_WcValue(tf)[pos2]); if (size_pos1 == 1 && (size_pos2 != 1 || isspace((unsigned char)*s1))) return True; if (size_pos2 == 1 && (size_pos1 != 1 || isspace((unsigned char)*s2))) return True; } return False; } /* This routine accepts an array of wchar_t's containing wchar encodings * of whitespace characters (and the number of array elements), comparing * the wide character passed to each element of the array. If a match * is found, we got a white space. This routine exists only because * iswspace(3c) is not yet standard. If a system has isw* available, * calls to this routine should be changed to iswspace(3c) (and callers * should delete initialization of the array), and this routine should * be deleted. Its a stop gap measure to avoid allocating an instance * variable for the white_space array and/or declaring a widget wide * global for the data and using a macro. Its ugly, but it works and * in the long run will be replaced by standard functionality. */ /* ARGSUSED */ static Boolean _XmTextFieldIsWSpace(wchar_t wide_char, wchar_t * white_space , int num_entries) { int i; for (i=0; i < num_entries; i++) { if (wide_char == white_space[i]) return True; } return False; } static void FindWord(XmTextFieldWidget tf, XmTextPosition begin, XmTextPosition *left, XmTextPosition *right) { XmTextPosition start, end; wchar_t white_space[3]; if (tf->text.max_char_size == 1) { for (start = begin; start > 0; start--) { if (isspace((unsigned char)TextF_Value(tf)[start - 1])) { break; } } *left = start; for (end = begin; end <= tf->text.string_length; end++) { if (isspace((unsigned char)TextF_Value(tf)[end])) { end++; break; } } *right = end - 1; } else { /* check for iswspace and iswordboundary in each direction */ (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); for (start = begin; start > 0; start --) { if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start-1],white_space, 3) || _XmTextFieldIsWordBoundary(tf, (XmTextPosition) start - 1, start)) { break; } } *left = start; for (end = begin; end <= tf->text.string_length; end++) { if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) { end++; break; } else if (end < tf->text.string_length) { if (_XmTextFieldIsWordBoundary(tf, end, (XmTextPosition)end + 1)) { end += 2; /* want to return position of next word; end + 1 */ break; /* is that position && *right = end - 1... */ } } } *right = end - 1; } } static void FindPrevWord(XmTextFieldWidget tf, XmTextPosition *left, XmTextPosition *right) { XmTextPosition start = TextF_CursorPosition(tf); wchar_t white_space[3]; if (tf->text.max_char_size != 1) { (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); } if (tf->text.max_char_size == 1) { if ((start > 0) && (isspace((unsigned char)TextF_Value(tf)[start - 1]))) { for (; start > 0; start--) { if (!isspace((unsigned char)TextF_Value(tf)[start - 1])) { start--; break; } } } FindWord(tf, start, left, right); } else { if ((start > 0) && (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start - 1], white_space, 3))) { for (; start > 0; start--) { if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[start -1], white_space, 3)) { start--; break; } } } else if ((start > 0) && _XmTextFieldIsWordBoundary(tf, (XmTextPosition) start - 1, start)) { start--; } FindWord(tf, start, left, right); } } static void FindNextWord(XmTextFieldWidget tf, XmTextPosition *left, XmTextPosition *right) { XmTextPosition end = TextF_CursorPosition(tf); wchar_t white_space[3]; if (tf->text.max_char_size != 1) { (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); } if(tf->text.max_char_size == 1) { if (isspace((unsigned char)TextF_Value(tf)[end])) { for (end = TextF_CursorPosition(tf); end < tf->text.string_length; end++) { if (!isspace((unsigned char)TextF_Value(tf)[end])) { break; } } } FindWord(tf, end, left, right); /* * Set right to the last whitespace following the end of the * current word. */ while (*right < tf->text.string_length && isspace((unsigned char)TextF_Value(tf)[(int)*right])) *right = *right + 1; if (*right < tf->text.string_length) *right = *right - 1; } else { if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) { for (; end < tf->text.string_length; end ++) { if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) { break; } } } else { /* if for other reasons at word boundry, advance to next word */ if ((end < tf->text.string_length) && _XmTextFieldIsWordBoundary(tf, end, (XmTextPosition) end + 1)) end++; } FindWord(tf, end, left, right); /* * If word boundary caused by whitespace, set right to the last * whitespace following the end of the current word. */ if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], white_space, 3)) { while (*right < tf->text.string_length && _XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], white_space, 3)) { *right = *right + 1; } if (*right < tf->text.string_length) *right = *right - 1; } } } static void CheckDisjointSelection(Widget w, XmTextPosition position, Time sel_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; if (tf->text.add_mode || (tf->text.has_primary && left != right && position >= left && position <= right)) tf->text.pending_off = FALSE; else tf->text.pending_off = TRUE; if (left == right) { (void) SetDestination(w, position, False, sel_time); tf->text.prim_anchor = position; } else { (void) SetDestination(w, position, False, sel_time); if (!tf->text.add_mode) tf->text.prim_anchor = position; } } static Boolean NeedsPendingDelete(XmTextFieldWidget tf) { return (tf->text.add_mode ? (TextF_PendingDelete(tf) && tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right && tf->text.prim_pos_left <= TextF_CursorPosition(tf) && tf->text.prim_pos_right >= TextF_CursorPosition(tf)) : (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right)); } static Boolean NeedsPendingDeleteDisjoint(XmTextFieldWidget tf) { return (TextF_PendingDelete(tf) && tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right && tf->text.prim_pos_left <= TextF_CursorPosition(tf) && tf->text.prim_pos_right >= TextF_CursorPosition(tf)); } /*ARGSUSED*/ static Boolean PrintableString(XmTextFieldWidget tf, char* str, int n, Boolean use_wchar) /* sometimes unused */ { #ifdef SUPPORT_ZERO_WIDTH /* some locales (such as Thai) have characters that are * printable but non-spacing. These should be inserted, * even if they have zero width. */ if (tf->text.max_char_size == 1) { int i; if (!use_wchar) { for (i = 0; i < n; i++) { if (!isprint((unsigned char)str[i])) { return False; } } } else { char scratch[8]; wchar_t *ws = (wchar_t *) str; for (i = 0; i < n; i++) { if (wctomb(scratch, ws[i]) <= 0) return False; if (!isprint((unsigned char)scratch[0])) { return False; } } } return True; } else { /* tf->text.max_char_size > 1 */ #ifdef HAS_WIDECHAR_FUNCTIONS if (use_wchar) { int i; wchar_t *ws = (wchar_t *) str; for (i = 0; i < n; i++) { if (!iswprint(ws[i])) { return False; } } return True; } else { int i, csize; wchar_t wc; #ifndef NO_MULTIBYTE for (i = 0, csize = mblen(str, tf->text.max_char_size); i < n; i += csize, csize=mblen(&(str[i]), tf->text.max_char_size)) #else for (i = 0, csize = *str ? 1 : 0; i < n; i += csize, csize = str[i] ? 1 : 0) #endif { if (csize < 0) return False; if (mbtowc(&wc, &(str[i]), tf->text.max_char_size) <= 0) return False; if (!iswprint(wc)) { return False; } } } #else /* HAS_WIDECHAR_FUNCTIONS */ /* * This will only check if any single-byte characters are non- * printable. Better than nothing... */ int i, csize; if (!use_wchar) { #ifndef NO_MULTIBYTE for (i = 0, csize = mblen(str, tf->text.max_char_size); i < n; i += csize, csize=mblen(&(str[i]), tf->text.max_char_size)) #else for (i = 0, csize = *str ? 1 : 0; i < n; i += csize, csize = str[i] ? 1 : 0) #endif { if (csize < 0) return False; if (csize == 1 && !isprint((unsigned char)str[i])) { return False; } } } else { char scratch[8]; wchar_t *ws = (wchar_t *) str; for (i = 0; i < n; i++) { if ((csize = wctomb(scratch, ws[i])) <= 0) return False; if (csize == 1 && !isprint((unsigned char)scratch[0])) { return False; } } } #endif /* HAS_WIDECHAR_FUNCTIONS */ return True; } #else /* SUPPORT_ZERO_WIDTH */ if (TextF_UseFontSet(tf)) { if(use_wchar) return (XwcTextEscapement((XFontSet)TextF_Font(tf), (wchar_t *)str, n) != 0); else return (XmbTextEscapement((XFontSet)TextF_Font(tf), str, n) != 0); #ifdef USE_XFT } else if (TextF_UseXft(tf)) { XGlyphInfo ext; XftTextExtentsUtf8(XtDisplay(tf), TextF_XftFont(tf), (FcChar8*)str, n, &ext); return ext.xOff != 0; #endif } else { if (use_wchar) { char cache[100]; char *tmp, *cache_ptr; wchar_t *tmp_str; int ret_val, buf_size, count; Boolean is_printable; buf_size = (n * MB_CUR_MAX) + 1; cache_ptr = tmp = XmStackAlloc(buf_size, cache); tmp_str = (wchar_t *)str; // Fixed MZ BZ#1257: by Brad Despres count = 0; do { ret_val = wctomb(tmp, *tmp_str); count += 1; tmp += ret_val; buf_size -= ret_val; tmp_str++; } while ( (ret_val > 0)&& (buf_size >= MB_CUR_MAX) && (count < n) ) ; if (ret_val == -1) /* bad character */ return (False); is_printable = XTextWidth(TextF_Font(tf), cache_ptr, tmp - cache_ptr); XmStackFree(cache_ptr, cache); return (is_printable); } else { return (XTextWidth(TextF_Font(tf), str, n) != 0); } } #endif /* SUPPORT_ZERO_WIDTH */ } /**************************************************************** * * Input functions defined in the action table. * ****************************************************************/ /* ARGSUSED */ static void InsertChar(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; char insert_string[TEXT_MAX_INSERT_SIZE + 1]; /* NULL-terminated below */ XmTextPosition cursorPos =0 , nextPos = 0; wchar_t * wc_insert_string; int insert_length, i; int num_chars; Boolean replace_res; Boolean pending_delete = False; Status status_return; XmAnyCallbackStruct cb; /* Determine what was pressed. */ insert_length = XmImMbLookupString(w, (XKeyEvent *) event, insert_string, TEXT_MAX_INSERT_SIZE, (KeySym *) NULL, &status_return); if (insert_length > 0 && !TextF_Editable(tf)) { if (tf->text.verify_bell) XBell(XtDisplay((Widget)tf), 0); return; } /* If there is more data than we can handle, bail out */ if (status_return == XBufferOverflow || insert_length > TEXT_MAX_INSERT_SIZE) return; /* *LookupString in some cases can return the NULL as a character, such * as when the user types or <@>. Text widget * can't handle the NULL as a character, so we dump it here. */ for (i=0; i < insert_length; i++) if (insert_string[i] == 0) insert_length = 0; /* toss out input string */ if (insert_length > 0) { /* do not insert non-printing characters */ if (!PrintableString(tf, insert_string, insert_length, False)) return; _XmTextFieldDrawInsertionPoint(tf, False); if (NeedsPendingDeleteDisjoint(tf)) { if (!tf->text.has_primary || (cursorPos = tf->text.prim_pos_left) == (nextPos = tf->text.prim_pos_right)) { tf->text.prim_anchor = TextF_CursorPosition(tf); } pending_delete = True; tf->text.prim_anchor = TextF_CursorPosition(tf); } else { cursorPos = nextPos = TextF_CursorPosition(tf); } if (tf->text.max_char_size == 1) { if (tf->text.overstrike) nextPos += insert_length; if (nextPos > tf->text.string_length) nextPos = tf->text.string_length; replace_res = _XmTextFieldReplaceText(tf, (XEvent *) event, cursorPos, nextPos, insert_string, insert_length, True); } else { char stack_cache[100]; insert_string[insert_length] = '\0'; /* NULL terminate for mbstowcs */ wc_insert_string = (wchar_t*)XmStackAlloc((Cardinal)(insert_length+1) * sizeof(wchar_t), stack_cache); num_chars = mbstowcs(wc_insert_string, insert_string, insert_length+1); if (num_chars < 0) num_chars = 0; if (tf->text.overstrike) nextPos += num_chars; if (nextPos > tf->text.string_length) nextPos = tf->text.string_length; replace_res = _XmTextFieldReplaceText(tf, (XEvent *) event, cursorPos, nextPos, (char*) wc_insert_string, num_chars, True); XmStackFree((char *)wc_insert_string, stack_cache); } if (replace_res) { if (pending_delete) { _XmTextFieldStartSelection(tf, TextF_CursorPosition(tf), TextF_CursorPosition(tf), event->xkey.time); tf->text.pending_off = False; } CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } _XmTextFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void DeletePrevChar(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmTextFieldDrawInsertionPoint(tf, False); if (NeedsPendingDelete(tf)) (void) TextFieldRemove(w, event); else { if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) { if (TextF_CursorPosition(tf) - 1 >= 0) if (_XmTextFieldReplaceText(tf, event, TextF_CursorPosition(tf) - 1, TextF_CursorPosition(tf), NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } else if (TextF_CursorPosition(tf) - 1 >= 0) { if (_XmTextFieldReplaceText(tf, event, TextF_CursorPosition(tf) - 1, TextF_CursorPosition(tf), NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DeleteNextChar(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmTextFieldDrawInsertionPoint(tf, False); if (NeedsPendingDelete(tf)) (void) TextFieldRemove(w, event); else { if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) { if (TextF_CursorPosition(tf) < tf->text.string_length) if (_XmTextFieldReplaceText(tf, event, TextF_CursorPosition(tf), TextF_CursorPosition(tf) + 1, NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } else if (TextF_CursorPosition(tf) < tf->text.string_length) if (_XmTextFieldReplaceText(tf, event, TextF_CursorPosition(tf), TextF_CursorPosition(tf) + 1, NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DeletePrevWord(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition left, right; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmTextFieldDrawInsertionPoint(tf, False); if (NeedsPendingDelete(tf)) (void) TextFieldRemove(w, event); else { FindPrevWord(tf, &left, &right); if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) { if (_XmTextFieldReplaceText(tf, event, left, TextF_CursorPosition(tf), NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } else if (TextF_CursorPosition(tf) - 1 >= 0) if (_XmTextFieldReplaceText(tf, event, left, TextF_CursorPosition(tf), NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DeleteNextWord(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition left, right; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmTextFieldDrawInsertionPoint(tf, False); if (NeedsPendingDelete(tf)) (void) TextFieldRemove(w, event); else { FindNextWord(tf, &left, &right); if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) { if (_XmTextFieldReplaceText(tf, event, TextF_CursorPosition(tf), right, NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } else if (TextF_CursorPosition(tf) < tf->text.string_length) if (_XmTextFieldReplaceText(tf, event, TextF_CursorPosition(tf), right, NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DeleteToEndOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmTextFieldDrawInsertionPoint(tf, False); if (NeedsPendingDelete(tf)) (void) TextFieldRemove(w, event); else if (TextF_CursorPosition(tf) < tf->text.string_length) { if (_XmTextFieldReplaceText(tf, event, TextF_CursorPosition(tf), tf->text.string_length, NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DeleteToStartOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmAnyCallbackStruct cb; /* if pending delete is on and there is a selection */ _XmTextFieldDrawInsertionPoint(tf, False); if (NeedsPendingDelete(tf)) (void) TextFieldRemove(w, event); else if (TextF_CursorPosition(tf) - 1 >= 0) { if (_XmTextFieldReplaceText(tf, event, 0, TextF_CursorPosition(tf), NULL, 0, True)) { CheckDisjointSelection(w, TextF_CursorPosition(tf), event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), False, True); cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void ProcessCancel(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmParentInputActionRec p_event; p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_CANCEL; p_event.event = event;/* Pointer to XEvent. */ p_event.params = params; /* Or use what you have if */ p_event.num_params = num_params;/* input is from translation.*/ _XmTextFieldDrawInsertionPoint(tf, False); if (tf->text.has_secondary) { tf->text.cancel = True; /* This will mark the has_secondary field to False. */ _XmTextFieldSetSel2(w, 1, 0, False, event->xkey.time); XtUngrabKeyboard(w, CurrentTime); } if (tf->text.has_primary && tf->text.extending) { tf->text.cancel = True; /* reset orig_left and orig_right */ _XmTextFieldStartSelection(tf, tf->text.orig_left, tf->text.orig_right, event->xkey.time); tf->text.pending_off = False; _XmTextFieldSetCursorPosition(tf, NULL, tf->text.stuff_pos, True, True); } if (!tf->text.cancel) (void) _XmParentProcess(XtParent(tf), (XmParentProcessData) &p_event); if (tf->text.select_id) { XtRemoveTimeOut(tf->text.select_id); tf->text.select_id = 0; } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void Activate(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmAnyCallbackStruct cb; XmTextFieldWidget tf = (XmTextFieldWidget) w; XmParentInputActionRec p_event; p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_ACTIVATE; p_event.event = event;/* Pointer to XEvent. */ p_event.params = params; /* Or use what you have if */ p_event.num_params = num_params;/* input is from translation.*/ cb.reason = XmCR_ACTIVATE; cb.event = event; XtCallCallbackList(w, TextF_ActivateCallback(tf), (XtPointer) &cb); (void) _XmParentProcess(XtParent(w), (XmParentProcessData) &p_event); } static void SetAnchorBalancing(XmTextFieldWidget tf, XmTextPosition position) { XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; float bal_point; if (!tf->text.has_primary || left == right) { tf->text.prim_anchor = position; } else { bal_point = (float)(((float)(right - left) / 2.0) + (float)left); /* shift anchor and direction to opposite end of the selection */ if ((float)position < bal_point) { tf->text.prim_anchor = tf->text.orig_right; } else if ((float)position > bal_point) { tf->text.prim_anchor = tf->text.orig_left; } } } static void SetNavigationAnchor(XmTextFieldWidget tf, XmTextPosition old_position, XmTextPosition new_position, #if NeedWidePrototypes int extend) #else Boolean extend) #endif /* NeedWidePrototypes */ { XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; Boolean has_selection = tf->text.has_primary && left != right; if (!tf->text.add_mode) { if (extend) { if (old_position < left || old_position > right) { /* start outside selection - anchor at start position */ tf->text.prim_anchor = old_position; } else if (!has_selection || ((left <= new_position) && (new_position <= right))) { /* no selection, or moving into selection */ SetAnchorBalancing(tf, old_position); } else { /* moving to outside selection */ SetAnchorBalancing(tf, new_position); } } else { if (has_selection) { SetSelection(tf, old_position, old_position, True); tf->text.prim_anchor = old_position; } } } else if (extend) { if (old_position < left || old_position > right) { /* start outside selection - anchor at start position */ tf->text.prim_anchor = old_position; } else if (!has_selection || ((left <= new_position )&& (new_position <= right))) { /* no selection, or moving into selection */ SetAnchorBalancing(tf, old_position); } else { /* moving to outside selection */ SetAnchorBalancing(tf, new_position); } } } static void CompleteNavigation(XmTextFieldWidget tf, XEvent *event, XmTextPosition position, Time time, #if NeedWidePrototypes int extend) #else Boolean extend) #endif /* NeedWidePrototypes */ { XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; if ((tf->text.add_mode && tf->text.has_primary && position >= left && position <= right) || extend) tf->text.pending_off = FALSE; else tf->text.pending_off = TRUE; _XmTextFieldSetCursorPosition(tf, event, position, True, True); if (extend) { if (tf->text.prim_anchor > position) { left = position; right = tf->text.prim_anchor; } else { left = tf->text.prim_anchor; right = position; } _XmTextFieldStartSelection(tf, left, right, time); tf->text.pending_off = False; tf->text.orig_left = left; tf->text.orig_right = right; } } /* ARGSUSED */ static void SimpleMovement(Widget w, XEvent *event, String *params, Cardinal *num_params, XmTextPosition cursorPos, XmTextPosition position) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean extend = False; int value; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". If we found a match then set the Boolean to true. */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } _XmTextFieldDrawInsertionPoint(tf, False); SetNavigationAnchor(tf, cursorPos, position, extend); CompleteNavigation(tf, event, position, event->xkey.time, extend); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void BackwardChar(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = TextF_CursorPosition(tf); if (cursorPos > 0) { _XmTextFieldDrawInsertionPoint(tf, False); position = cursorPos - 1; SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmTextFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void ForwardChar(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = TextF_CursorPosition(tf); if (cursorPos < tf->text.string_length) { _XmTextFieldDrawInsertionPoint(tf, False); position = cursorPos + 1; SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmTextFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void BackwardWord(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos, position, dummy; cursorPos = TextF_CursorPosition(tf); if (cursorPos > 0) { _XmTextFieldDrawInsertionPoint(tf, False); FindPrevWord(tf, &position, &dummy); SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmTextFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void ForwardWord(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos, position, dummy; wchar_t white_space[3]; if (tf->text.max_char_size != 1) { (void)mbtowc(&white_space[0], " ", 1); (void)mbtowc(&white_space[1], "\n", 1); (void)mbtowc(&white_space[2], "\t", 1); } cursorPos = TextF_CursorPosition(tf); _XmTextFieldDrawInsertionPoint(tf, False); if (cursorPos < tf->text.string_length) { if (tf->text.max_char_size == 1) { if (isspace((unsigned char)TextF_Value(tf)[cursorPos])) FindWord(tf, cursorPos, &dummy, &position); else FindNextWord(tf, &dummy, &position); if(isspace((unsigned char)TextF_Value(tf)[position])) { for (;position < tf->text.string_length; position++) { if (!isspace((unsigned char)TextF_Value(tf)[position])) break; } } } else { if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[cursorPos], white_space, 3)) FindWord(tf, cursorPos, &dummy, &position); else FindNextWord(tf, &dummy, &position); if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[position], white_space, 3)) { for (; position < tf->text.string_length; position++) { if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[position], white_space, 3)) break; } } } SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void EndOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = TextF_CursorPosition(tf); if (cursorPos < tf->text.string_length) { _XmTextFieldDrawInsertionPoint(tf, False); position = tf->text.string_length; SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmTextFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void BeginningOfLine(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos, position; cursorPos = TextF_CursorPosition(tf); if (cursorPos > 0) { position = 0; _XmTextFieldDrawInsertionPoint(tf, False); SimpleMovement((Widget) tf, event, params, num_params, cursorPos, position); _XmTextFieldDrawInsertionPoint(tf, True); } } static void SetSelection(XmTextFieldWidget tf, XmTextPosition left, XmTextPosition right, #if NeedWidePrototypes int redisplay) #else Boolean redisplay) #endif /* NeedWidePrototypes */ { XmTextPosition display_left, display_right; XmTextPosition old_prim_left, old_prim_right; if (left < 0) left = 0; if (right < 0) right = 0; if (left > tf->text.string_length) left = tf->text.string_length; if (right > tf->text.string_length) right = tf->text.string_length; if (left == right && tf->text.prim_pos_left != tf->text.prim_pos_right && tf->text.add_mode) { _XmTextFieldDrawInsertionPoint(tf, False); tf->text.add_mode = False; _XmTextFieldDrawInsertionPoint(tf, True); } if (left == tf->text.prim_pos_left && right == tf->text.prim_pos_right) return; TextFieldSetHighlight(tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_NORMAL); old_prim_left = tf->text.prim_pos_left; old_prim_right = tf->text.prim_pos_right; if (left > right) { tf->text.prim_pos_left = right; tf->text.prim_pos_right = left; } else { tf->text.prim_pos_left = left; tf->text.prim_pos_right = right; } TextFieldSetHighlight(tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_SELECTED); if (redisplay) { if (old_prim_left > tf->text.prim_pos_left) { display_left = tf->text.prim_pos_left; } else if (old_prim_left < tf->text.prim_pos_left) { display_left = old_prim_left; } else display_left = (old_prim_right > tf->text.prim_pos_right) ? tf->text.prim_pos_right : old_prim_right; if (old_prim_right < tf->text.prim_pos_right) { display_right = tf->text.prim_pos_right; } else if (old_prim_right > tf->text.prim_pos_right) { display_right = old_prim_right; } else display_right = (old_prim_left < tf->text.prim_pos_left) ? tf->text.prim_pos_left : old_prim_left; if (display_left > tf->text.string_length) display_left = tf->text.string_length; if (display_right > tf->text.string_length) display_right = tf->text.string_length; RedisplayText(tf, display_left, display_right); } tf->text.refresh_ibeam_off = True; } /* * Begin the selection by gaining ownership of the selection * and setting the selection parameters. */ void _XmTextFieldStartSelection(XmTextFieldWidget tf, XmTextPosition left, XmTextPosition right, Time sel_time) { if (!XtIsRealized((Widget)tf)) return; /* if we don't already own the selection */ if (tf->text.take_primary || (tf->text.prim_pos_left == tf->text.prim_pos_right && left != right)) { if (!sel_time) sel_time = _XmValidTimestamp((Widget)tf); /* Try to gain ownership. */ if (XmePrimarySource((Widget) tf, sel_time)) { XmAnyCallbackStruct cb; tf->text.prim_time = sel_time; _XmTextFieldDrawInsertionPoint(tf, False); if (tf->text.prim_pos_left != tf->text.prim_pos_right) doSetHighlight((Widget)tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_NORMAL); tf->text.has_primary = True; tf->text.take_primary = False; tf->text.prim_pos_left = tf->text.prim_pos_right = tf->text.prim_anchor = TextF_CursorPosition(tf); /* * Set the selection boundries for highlighting the text, * and marking the selection. */ SetSelection(tf, left, right, True); _XmTextFieldDrawInsertionPoint(tf, True); /* Call the gain selection callback */ cb.reason = XmCR_GAIN_PRIMARY; cb.event = NULL; XtCallCallbackList((Widget) tf, tf->text.gain_primary_callback, (XtPointer) &cb); } else /* * Failed to gain ownership of the selection so make sure * the text does not think it owns the selection. * (this might be overkill) */ _XmTextFieldDeselectSelection((Widget)tf, True, sel_time); } else { _XmTextFieldDrawInsertionPoint(tf, False); doSetHighlight((Widget)tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_NORMAL); tf->text.prim_pos_left = tf->text.prim_pos_right = tf->text.prim_anchor = TextF_CursorPosition(tf); /* * Set the new selection boundries for highlighting the text, * and marking the selection. */ SetSelection(tf, left, right, True); _XmTextFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void ProcessHorizontalParams(Widget w, XEvent *event, char **params, Cardinal *num_params, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition old_cursorPos = TextF_CursorPosition(tf); int direction; *position = TextF_CursorPosition(tf); if (!tf->text.has_primary || (*left = tf->text.prim_pos_left) == (*right = tf->text.prim_pos_right)) { tf->text.orig_left = tf->text.orig_right = tf->text.prim_anchor; *left = *right = old_cursorPos; } if (*num_params > 0) { /* Process the parameters. We can only have a single parameter which will be either "right" or "left". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_DIRECTION_ACTION_PARAMS, params[0], False, &direction) == True) { if (direction == _RIGHT) { if (*position >= tf->text.string_length) return; (*position)++; } else if (direction == _LEFT) { if (*position <= 0) return; (*position)--; } } } } /* ARGSUSED */ static void ProcessSelectParams(Widget w, XEvent *event, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position) { XmTextFieldWidget tf = (XmTextFieldWidget) w; *position = TextF_CursorPosition(tf); if (!tf->text.has_primary || tf->text.prim_pos_left == tf->text.prim_pos_right) { if (*position > tf->text.prim_anchor) { *left = tf->text.prim_anchor; *right = *position; } else { *left = *position; *right = tf->text.prim_anchor; } } } /* ARGSUSED */ static void KeySelection(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextPosition position = 0, left, right; XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition cursorPos; int direction; TextFieldResetIC(w); _XmTextFieldDrawInsertionPoint(tf,False); /* Turn off I beam blink during selection */ tf->text.orig_left = tf->text.prim_pos_left; tf->text.orig_right = tf->text.prim_pos_right; cursorPos = TextF_CursorPosition(tf); if (*num_params > 0) { /* Process the parameters. The only legal values are "right" and "left". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_DIRECTION_ACTION_PARAMS, params[0], False, &direction) == True) { SetAnchorBalancing(tf, cursorPos); } } tf->text.extending = True; if (*num_params == 0) { position = cursorPos; ProcessSelectParams(w, event, &left, &right, &position); } else if (*num_params > 0) { /* Process the parameters. The only legal values are "right" and "left". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_DIRECTION_ACTION_PARAMS, params[0], False, &direction) == True) { ProcessHorizontalParams(w, event, params, num_params, &left, &right, &position); } } cursorPos = position; if (position < 0 || position > tf->text.string_length) { _XmTextFieldDrawInsertionPoint(tf,True); /* Turn on I beam now that we are done */ tf->text.extending = False; return; } /* shift anchor and direction to opposite end of the selection */ if (position > tf->text.prim_anchor) { right = cursorPos = position; left = tf->text.prim_anchor; } else { left = cursorPos = position; right = tf->text.prim_anchor; } if (left > right) { XmTextPosition tempIndex = left; left = right; right = tempIndex; } if (tf->text.take_primary) _XmTextFieldStartSelection(tf, left, right, event->xbutton.time); else SetSelection(tf, left, right, True); tf->text.pending_off = False; _XmTextFieldSetCursorPosition(tf, event, cursorPos, True, True); (void) SetDestination(w, cursorPos, False, event->xkey.time); tf->text.orig_left = tf->text.prim_pos_left; tf->text.orig_right = tf->text.prim_pos_right; tf->text.extending = False; _XmTextFieldDrawInsertionPoint(tf,True); /* Turn on I beam now that we are done */ } /* ARGSUSED */ static void TextFocusIn(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmAnyCallbackStruct cb; XRectangle xmim_area; XPoint xmim_point; if (event->xfocus.send_event && !(tf->text.has_focus)) { tf->text.has_focus = True; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.blink_on = False; tf->text.refresh_ibeam_off = True; if (_XmGetFocusPolicy(w) == XmEXPLICIT) { if (((XmTextFieldWidgetClass) XtClass(w))->primitive_class.border_highlight) { (*((XmTextFieldWidgetClass) XtClass(w))->primitive_class.border_highlight)(w); } if (!tf->text.has_destination && !tf->text.sel_start) (void) SetDestination(w, TextF_CursorPosition(tf), False, XtLastTimestampProcessed(XtDisplay(w))); } if (XtIsSensitive(w)) ChangeBlinkBehavior(tf, True); _XmTextFieldDrawInsertionPoint(tf, True); (void) GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, &xmim_point.y); (void)TextFieldGetDisplayRect((Widget)tf, &xmim_area); XmImVaSetFocusValues(w, XmNspotLocation, &xmim_point, XmNarea, &xmim_area, NULL); cb.reason = XmCR_FOCUS; cb.event = event; XtCallCallbackList (w, tf->text.focus_callback, (XtPointer) &cb); } _XmPrimitiveFocusIn(w, event, params, num_params); } /* ARGSUSED */ static void TextFocusOut(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; if (event->xfocus.send_event && tf->text.has_focus) { ChangeBlinkBehavior(tf, False); _XmTextFieldDrawInsertionPoint(tf, False); tf->text.has_focus = False; tf->text.blink_on = True; _XmTextFieldDrawInsertionPoint(tf, True); if (((XmTextFieldWidgetClass) XtClass(tf)) ->primitive_class.border_unhighlight) { (*((XmTextFieldWidgetClass) XtClass(tf)) ->primitive_class.border_unhighlight)((Widget) tf); } XmImUnsetFocus(w); } /* If traversal is on, then the leave verification callback is called in the traversal event handler */ if (event->xfocus.send_event && !tf->text.traversed && _XmGetFocusPolicy(w) == XmEXPLICIT) { if (!VerifyLeave(tf, event)) { if (tf->text.verify_bell) XBell(XtDisplay(w), 0); return; } } else if (tf->text.traversed) { tf->text.traversed = False; } } static void SetScanIndex(XmTextFieldWidget tf, XEvent *event) { Time sel_time; if (event->type == ButtonPress) sel_time = event->xbutton.time; else sel_time = event->xkey.time; if (sel_time > tf->text.last_time && sel_time - tf->text.last_time < XtGetMultiClickTime(XtDisplay(tf))) { /* * Fix for HaL DTS 9841 - Increment the sarray_index first, then check to * see if it is greater that the count. Otherwise, * an error will occur. */ tf->text.sarray_index++; if (tf->text.sarray_index >= TextF_SelectionArrayCount(tf)) { tf->text.sarray_index = 0; } /* * End fix for HaL DTS 9841 */ } else tf->text.sarray_index = 0; tf->text.last_time = sel_time; } static void ExtendScanSelection(XmTextFieldWidget tf, XEvent *event) { XmTextPosition pivot_left, pivot_right; XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; XmTextPosition new_position = GetPosFromX(tf, (Position) event->xbutton.x); XmTextPosition cursorPos = TextF_CursorPosition(tf); Boolean pivot_modify = False; float bal_point; if (!tf->text.has_primary || left == right) { tf->text.orig_left = tf->text.orig_right = tf->text.prim_anchor = TextF_CursorPosition(tf); bal_point = (XmTextPosition) tf->text.prim_anchor ; } else bal_point = (float)(((float)(right - left) / 2.0) + (float)left); if (!tf->text.extending) { if ((float)new_position < bal_point) { tf->text.prim_anchor = tf->text.orig_right; } else if ((float)new_position > bal_point) { tf->text.prim_anchor = tf->text.orig_left; } } tf->text.extending = True; switch (TextF_SelectionArray(tf)[tf->text.sarray_index]) { case XmSELECT_POSITION: if (tf->text.take_primary && new_position != tf->text.prim_anchor) _XmTextFieldStartSelection(tf, tf->text.prim_anchor, new_position, event->xbutton.time); else if (tf->text.has_primary) SetSelection(tf, tf->text.prim_anchor, new_position, True); tf->text.pending_off = False; cursorPos = new_position; break; case XmSELECT_WHITESPACE: case XmSELECT_WORD: FindWord(tf, new_position, &left, &right); FindWord(tf, tf->text.prim_anchor, &pivot_left, &pivot_right); tf->text.pending_off = False; if (left != pivot_left || right != pivot_right) { if (left > pivot_left) left = pivot_left; if (right < pivot_right) right = pivot_right; pivot_modify = True; } if (tf->text.take_primary) _XmTextFieldStartSelection(tf, left, right, event->xbutton.time); else SetSelection(tf, left, right, True); if (pivot_modify) { if ((((right - left) / 2) + left) <= new_position) { cursorPos = right; } else cursorPos = left; } else { if (left >= TextF_CursorPosition(tf)) cursorPos = left; else cursorPos = right; } break; default: break; } if (cursorPos != TextF_CursorPosition(tf)) { (void) SetDestination((Widget)tf, cursorPos, False, event->xkey.time); _XmTextFieldSetCursorPosition(tf, event, cursorPos, True, True); } } static void SetScanSelection(XmTextFieldWidget tf, XEvent *event) { XmTextPosition left, right; XmTextPosition new_position = 0; XmTextPosition cursorPos = TextF_CursorPosition(tf); Position dummy = 0; Boolean update_position = False; SetScanIndex(tf, event); if (event->type == ButtonPress) new_position = GetPosFromX(tf, (Position) event->xbutton.x); else new_position = TextF_CursorPosition(tf); _XmTextFieldDrawInsertionPoint(tf,False); /* Turn off I beam blink during selection */ switch (TextF_SelectionArray(tf)[tf->text.sarray_index]) { case XmSELECT_POSITION: tf->text.prim_anchor = new_position; if (tf->text.has_primary) { SetSelection(tf, new_position, new_position, True); tf->text.pending_off = False; } cursorPos = new_position; update_position = True; break; case XmSELECT_WHITESPACE: case XmSELECT_WORD: FindWord(tf, TextF_CursorPosition(tf), &left, &right); if (tf->text.take_primary) _XmTextFieldStartSelection(tf, left, right, event->xbutton.time); else SetSelection(tf, left, right, True); tf->text.pending_off = False; if ((((right - left) / 2) + left) <= new_position) cursorPos = right; else cursorPos = left; break; case XmSELECT_LINE: case XmSELECT_OUT_LINE: case XmSELECT_PARAGRAPH: case XmSELECT_ALL: if (tf->text.take_primary) _XmTextFieldStartSelection(tf, 0, tf->text.string_length, event->xbutton.time); else SetSelection(tf, 0, tf->text.string_length, True); tf->text.pending_off = False; if (event->type == ButtonPress) { if ((tf->text.string_length) / 2 <= new_position) { cursorPos = tf->text.string_length; } else { cursorPos = 0; } } break; } (void) SetDestination((Widget)tf, cursorPos, False, event->xkey.time); if (cursorPos != TextF_CursorPosition(tf) || update_position) { _XmTextFieldSetCursorPosition(tf, event, cursorPos, True, True); } GetXYFromPos(tf, cursorPos, &(tf->text.select_pos_x), &dummy); _XmTextFieldDrawInsertionPoint(tf,True); } /* ARGSUSED */ static void StartPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFieldResetIC(w); if (!tf->text.has_focus && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); _XmTextFieldDrawInsertionPoint(tf,False); SetScanSelection(tf, event); /* use scan type to set the selection */ tf->text.stuff_pos = TextF_CursorPosition(tf); _XmTextFieldDrawInsertionPoint(tf,True); } /* ARGSUSED */ static void MoveDestination(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; XmTextPosition new_position; Boolean old_has_focus = tf->text.has_focus; Boolean reset_cursor = False; TextFieldResetIC(w); new_position = GetPosFromX(tf, (Position) event->xbutton.x); _XmTextFieldDrawInsertionPoint(tf, False); if (tf->text.has_primary && (right != left)) (void) SetDestination(w, new_position, False, event->xbutton.time); tf->text.pending_off = False; if (!tf->text.has_focus && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); /* Doing the the MoveDestination caused a traversal into my, causing * me to gain focus... Cursor is now on when it shouldn't be. */ if ((reset_cursor = !old_has_focus && tf->text.has_focus) != False) _XmTextFieldDrawInsertionPoint(tf, False); _XmTextFieldSetCursorPosition(tf, event, new_position, True, True); if (new_position < left && new_position > right) tf->text.pending_off = True; /* * if cursor was turned off as a result of the focus state changing * then we need to undo the decrement to the cursor_on variable * by redrawing the insertion point. */ if (reset_cursor) _XmTextFieldDrawInsertionPoint(tf, True); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void ExtendPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFieldResetIC(w); if (tf->text.cancel) return; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.do_drop = False; if (event->type == ButtonPress) tf->text.stuff_pos = TextF_CursorPosition(tf); if (!CheckTimerScrolling(w, event)) { if (event->type == ButtonPress) DoExtendedSelection(w, event->xbutton.time); else DoExtendedSelection(w, event->xkey.time); } else ExtendScanSelection(tf, event); /* use scan type to set the selection */ _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void ExtendEnd(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; if (tf->text.prim_pos_left == 0 && tf->text.prim_pos_right == 0) tf->text.orig_left = tf->text.orig_right = TextF_CursorPosition(tf); else { tf->text.orig_left = tf->text.prim_pos_left; tf->text.orig_right = tf->text.prim_pos_right; tf->text.cancel = False; } if (tf->text.select_id) { XtRemoveTimeOut(tf->text.select_id); tf->text.select_id = 0; } tf->text.select_pos_x = 0; tf->text.extending = False; } /* ARGSUSED */ static void DoExtendedSelection(Widget w, Time time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition position, cursorPos; XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; XmTextPosition pivot_left, pivot_right; Boolean pivot_modify = False; float bal_point; if (tf->text.cancel) { if (tf->text.select_id) { XtRemoveTimeOut(tf->text.select_id); tf->text.select_id = 0; } return; } cursorPos = TextF_CursorPosition(tf); _XmTextFieldDrawInsertionPoint(tf, False); if (!tf->text.has_primary || left == right) { tf->text.prim_anchor = tf->text.cursor_position; left = right = TextF_CursorPosition(tf); tf->text.orig_left = tf->text.orig_right = tf->text.prim_anchor; bal_point = tf->text.prim_anchor; } else bal_point = (float)(((float)(tf->text.orig_right - tf->text.orig_left) / 2.0) + (float)tf->text.orig_left); position = GetPosFromX(tf, tf->text.select_pos_x); if (!tf->text.extending) { if ((float)position < bal_point) { tf->text.prim_anchor = tf->text.orig_right; } else if ((float)position > bal_point) { tf->text.prim_anchor = tf->text.orig_left; } } tf->text.extending = True; /* Extend selection in same way as ExtendScan would do */ switch (TextF_SelectionArray(tf)[tf->text.sarray_index]) { case XmSELECT_POSITION: if (tf->text.take_primary && position != tf->text.prim_anchor) _XmTextFieldStartSelection(tf, tf->text.prim_anchor, position, time); else if (tf->text.has_primary) SetSelection(tf, tf->text.prim_anchor, position, True); tf->text.pending_off = False; cursorPos = position; break; case XmSELECT_WHITESPACE: case XmSELECT_WORD: FindWord(tf, position, &left, &right); FindWord(tf, tf->text.prim_anchor, &pivot_left, &pivot_right); tf->text.pending_off = False; if (left != pivot_left || right != pivot_right) { if (left > pivot_left) left = pivot_left; if (right < pivot_right) right = pivot_right; pivot_modify = True; } if (tf->text.take_primary) _XmTextFieldStartSelection(tf, left, right, time); else SetSelection(tf, left, right, True); if (pivot_modify) { if ((((right - left) / 2) + left) <= position) { cursorPos = right; } else cursorPos = left; } else { if (left >= TextF_CursorPosition(tf)) cursorPos = left; else cursorPos = right; } break; default: break; } if (cursorPos != TextF_CursorPosition(tf)) { (void) SetDestination((Widget)tf, cursorPos, False, time); _XmTextFieldSetCursorPosition(tf, NULL, cursorPos, True, True); } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DoSecondaryExtend(Widget w, Time ev_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition position = GetPosFromX(tf, tf->text.select_pos_x); if (tf->text.cancel) return; if (position < tf->text.sec_anchor) { if (tf->text.sec_pos_left > 0) _XmTextFieldSetSel2(w, position, tf->text.sec_anchor, False, ev_time); if (tf->text.sec_pos_left >= 0) AdjustText(tf, tf->text.sec_pos_left, True); } else if (position > tf->text.sec_anchor) { if (tf->text.sec_pos_right < tf->text.string_length) _XmTextFieldSetSel2(w, tf->text.sec_anchor, position, False, ev_time); if (tf->text.sec_pos_right >= 0) AdjustText(tf, tf->text.sec_pos_right, True); } else { _XmTextFieldSetSel2(w, position, position, False, ev_time); if (position >= 0) AdjustText(tf, position, True); } tf->text.sec_extending = True; } /************************************************************************ * * * BrowseScroll - timer proc that scrolls the list if the user has left * * the window with the button down. If the button has been * * released, call the standard click stuff. * * * ************************************************************************/ /* ARGSUSED */ static void BrowseScroll(XtPointer closure, XtIntervalId *id) { Widget w = (Widget) closure; XmTextFieldWidget tf = (XmTextFieldWidget) w; if (tf->text.cancel) { tf->text.select_id = 0; return; } if (!tf->text.select_id) return; _XmTextFieldDrawInsertionPoint(tf, False); if (tf->text.sec_extending) DoSecondaryExtend(w, XtLastTimestampProcessed(XtDisplay(w))); else if (tf->text.extending) DoExtendedSelection(w, XtLastTimestampProcessed(XtDisplay(w))); XSync (XtDisplay(w), False); _XmTextFieldDrawInsertionPoint(tf, True); tf->text.select_id = XtAppAddTimeOut(XtWidgetToApplicationContext(w), (unsigned long) PRIM_SCROLL_INTERVAL, BrowseScroll, (XtPointer) w); } /* ARGSUSED */ static Boolean CheckTimerScrolling(Widget w, XEvent *event) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Dimension margin_size = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Dimension top_margin = TextF_MarginHeight(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; tf->text.select_pos_x = event->xmotion.x; if ((event->xmotion.x > (int) margin_size) && (event->xmotion.x < (int) (tf->core.width - margin_size)) && (event->xmotion.y > (int) top_margin) && (event->xmotion.y < (int) (top_margin + TextF_FontAscent(tf) + TextF_FontDescent(tf)))) { if (tf->text.select_id) { XtRemoveTimeOut(tf->text.select_id); tf->text.select_id = 0; } } else { /* to the left of the text */ if (event->xmotion.x <= (int) margin_size) tf->text.select_pos_x = (Position) (margin_size - (tf->text.average_char_width + 1)); /* to the right of the text */ else if (event->xmotion.x >= (int) (tf->core.width - margin_size)) tf->text.select_pos_x = (Position) ((tf->core.width - margin_size) + tf->text.average_char_width + 1); if (!tf->text.select_id) tf->text.select_id = XtAppAddTimeOut(XtWidgetToApplicationContext(w), (unsigned long) SEC_SCROLL_INTERVAL, BrowseScroll, (XtPointer) w); return True; } return False; } static void RestorePrimaryHighlight(XmTextFieldWidget tf, XmTextPosition prim_left, XmTextPosition prim_right) { if (tf->text.sec_pos_right >= prim_left && tf->text.sec_pos_right <= prim_right) { /* secondary selection is totally inside primary selection */ if (tf->text.sec_pos_left >= prim_left) { TextFieldSetHighlight(tf, prim_left, tf->text.sec_pos_left, XmHIGHLIGHT_SELECTED); TextFieldSetHighlight(tf, tf->text.sec_pos_left, tf->text.sec_pos_right, XmHIGHLIGHT_NORMAL); TextFieldSetHighlight(tf, tf->text.sec_pos_right, prim_right, XmHIGHLIGHT_SELECTED); /* right side of secondary selection is inside primary selection */ } else { TextFieldSetHighlight(tf, tf->text.sec_pos_left, prim_left, XmHIGHLIGHT_NORMAL); TextFieldSetHighlight(tf, prim_left, tf->text.sec_pos_right, XmHIGHLIGHT_SELECTED); } } else { /* left side of secondary selection is inside primary selection */ if (tf->text.sec_pos_left <= prim_right && tf->text.sec_pos_left >= prim_left) { TextFieldSetHighlight(tf, tf->text.sec_pos_left, prim_right, XmHIGHLIGHT_SELECTED); TextFieldSetHighlight(tf, prim_right, tf->text.sec_pos_right, XmHIGHLIGHT_NORMAL); } else { /* secondary selection encompasses the primary selection */ if (tf->text.sec_pos_left <= prim_left && tf->text.sec_pos_right >= prim_right) { TextFieldSetHighlight(tf, tf->text.sec_pos_left, prim_left, XmHIGHLIGHT_NORMAL); TextFieldSetHighlight(tf, prim_left, prim_right, XmHIGHLIGHT_SELECTED); TextFieldSetHighlight(tf, prim_right, tf->text.sec_pos_right, XmHIGHLIGHT_NORMAL); /* secondary selection is outside primary selection */ } else { TextFieldSetHighlight(tf, prim_left, prim_right, XmHIGHLIGHT_SELECTED); TextFieldSetHighlight(tf, tf->text.sec_pos_left, tf->text.sec_pos_right, XmHIGHLIGHT_NORMAL); } } } } void _XmTextFieldSetSel2(Widget w, XmTextPosition left, XmTextPosition right, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time sel_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean result; if (tf->text.has_secondary) { if (left == tf->text.sec_pos_left && right == tf->text.sec_pos_right) return; /* If the widget has the primary selection, make sure the selection * highlight is restored appropriately. */ if (tf->text.has_primary) RestorePrimaryHighlight(tf, tf->text.prim_pos_left, tf->text.prim_pos_right); else TextFieldSetHighlight(tf, tf->text.sec_pos_left, tf->text.sec_pos_right, XmHIGHLIGHT_NORMAL); } if (left < right) { if (!tf->text.has_secondary) { if (!sel_time) sel_time = _XmValidTimestamp(w); result = XmeSecondarySource(w, sel_time); tf->text.sec_time = sel_time; tf->text.has_secondary = result; if (result) { tf->text.sec_pos_left = left; tf->text.sec_pos_right = right; } } else { tf->text.sec_pos_left = left; tf->text.sec_pos_right = right; } tf->text.sec_drag = True; } else { if (left > right) tf->text.has_secondary = False; tf->text.sec_pos_left = tf->text.sec_pos_right = left; if (disown) { if (!sel_time) sel_time = _XmValidTimestamp(w); XtDisownSelection(w, XA_SECONDARY, sel_time); tf->text.has_secondary = False; } } TextFieldSetHighlight((XmTextFieldWidget) w, tf->text.sec_pos_left, tf->text.sec_pos_right, XmHIGHLIGHT_SECONDARY_SELECTED); /* This can be optimized for performance enhancement */ RedisplayText(tf, 0, tf->text.string_length); } /* ARGSUSED */ static void StartDrag(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Widget drag_icon; Arg args[6]; int n; drag_icon = XmeGetTextualDragIcon(w); n = 0; XtSetArg(args[n], XmNcursorBackground, tf->core.background_pixel); n++; XtSetArg(args[n], XmNcursorForeground, tf->primitive.foreground); n++; XtSetArg(args[n], XmNsourceCursorIcon, drag_icon); n++; if (TextF_Editable(tf)) { XtSetArg(args[n], XmNdragOperations, (XmDROP_MOVE | XmDROP_COPY)); n++; } else { XtSetArg(args[n], XmNdragOperations, XmDROP_COPY); n++; } (void) XmeDragSource(w, (XtPointer) w, event, args, n); } /*ARGSUSED*/ static void DragStart(XtPointer data, XtIntervalId *id) /* unused */ { XmTextFieldWidget tf = (XmTextFieldWidget)data; tf->text.drag_id = 0; StartDrag((Widget)tf, tf->text.transfer_action->event, tf->text.transfer_action->params, tf->text.transfer_action->num_params); } /* ARGSUSED */ static void StartSecondary(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition position = GetPosFromX(tf, (Position) event->xbutton.x); int status; tf->text.sel_start = True; XAllowEvents(XtDisplay(w), AsyncBoth, event->xbutton.time); tf->text.sec_anchor = position; tf->text.selection_move = FALSE; tf->text.selection_link = FALSE; status = XtGrabKeyboard(w, False, GrabModeAsync, GrabModeAsync, event->xbutton.time); if (status != GrabSuccess) XmeWarning(w, GRABKBDERROR); } /* ARGSUSED */ static void ProcessBDrag(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFieldResetIC(w); if (tf->text.extending) return; /* if the user has clicked twice very quickly, don't lose the original left ** position */ if (!tf->text.has_secondary || (tf->text.sec_pos_left == tf->text.sec_pos_right)) tf->text.sec_pos_left = GetPosFromX(tf, (Position) event->xbutton.x); _XmTextFieldDrawInsertionPoint(tf, False); if (InSelection(w, event)) { tf->text.sel_start = False; StartDrag(w, event, params, num_params); } else { StartSecondary(w, event, params, num_params); } _XmTextFieldDrawInsertionPoint(tf, True); } static void ProcessBDragEvent(Widget w, XEvent *event, String *params, Cardinal *num_params) { XtEnum drag_on_btn1 = XmOFF; XmDisplay dpy; dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); drag_on_btn1 = dpy->display.enable_btn1_transfer; if (drag_on_btn1 == XmBUTTON2_ADJUST && *num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); else if (*num_params > 1) XtCallActionProc(w, params[1], event, NULL, 0); } /* ARGSUSED */ static Boolean InSelection(Widget w, XEvent *event) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition position; XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; Position left_x, right_x, dummy; position = GetPosFromX(tf, (Position) event->xbutton.x); return (tf->text.has_primary && left != right && ( (position > left && position < right) || ( position == left && GetXYFromPos(tf, left, &left_x, &dummy) && event->xbutton.x > left_x) || ( position == right && GetXYFromPos(tf, right, &right_x, &dummy) && event->xbutton.x < right_x))); } /* ARGSUSED */ static void ProcessBSelect(Widget w, XEvent *event, char **params, Cardinal *num_params) { #define ABS_DELTA(x1, x2) (x1 < x2 ? x2 - x1 : x1 - x2) XmTextFieldWidget tf = (XmTextFieldWidget) w; XtEnum drag_on_btn1 = XmOFF; Time event_time = event->xbutton.time; XmDisplay dpy; dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); drag_on_btn1 = dpy->display.enable_btn1_transfer; if (!drag_on_btn1) { if (*num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); return; } if (*num_params == 0) { if (event->type == ButtonPress && InSelection(w, event)) StartDrag(w, event, params, num_params); } else { switch (event->type) { case ButtonPress: if (!InSelection(w, event) || (event_time > tf->text.last_time && event_time - tf->text.last_time < XtGetMultiClickTime(XtDisplay(w)))) { if (*num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); } else { if (tf->text.drag_id) XtRemoveTimeOut(tf->text.drag_id); if (tf->text.transfer_action == NULL) { tf->text.transfer_action = (_XmTextActionRec *) XtMalloc(sizeof(_XmTextActionRec)); tf->text.transfer_action->event = (XEvent *)XtMalloc(sizeof(XEvent)); } memcpy((void *)tf->text.transfer_action->event, (void *)event, sizeof(XEvent)); tf->text.transfer_action->params = params; tf->text.transfer_action->num_params = num_params; tf->text.drag_id = XtAppAddTimeOut(XtWidgetToApplicationContext(w), XtGetMultiClickTime(XtDisplay(w)), DragStart, (XtPointer)w); } break; case ButtonRelease: if (tf->text.drag_id) { XtRemoveTimeOut(tf->text.drag_id); tf->text.drag_id = 0; if (*tf->text.transfer_action->num_params) { XtCallActionProc(w, tf->text.transfer_action->params[0], tf->text.transfer_action->event, NULL, 0); } } XtCallActionProc(w, params[0], event, NULL, 0); break; case MotionNotify: if (tf->text.drag_id) { XEvent *press = tf->text.transfer_action->event; if (ABS_DELTA(press->xbutton.x_root, event->xmotion.x_root) > tf->text.threshold || ABS_DELTA(press->xbutton.y_root, event->xmotion.y_root) > tf->text.threshold) { XtRemoveTimeOut(tf->text.drag_id); tf->text.drag_id = 0; StartDrag(w, event, params, num_params); } } else if (*num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); break; } } } static void ProcessBSelectEvent(Widget w, XEvent *event, String *params, Cardinal *num_params) { XtEnum drag_on_btn1 = XmOFF; XmDisplay dpy; dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); drag_on_btn1 = dpy->display.enable_btn1_transfer; if (drag_on_btn1 == XmBUTTON2_TRANSFER && *num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); else if (*num_params > 1) XtCallActionProc(w, params[1], event, NULL, 0); } /* ARGSUSED */ static void ExtendSecondary(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition position = GetPosFromX(tf, (Position) event->xbutton.x); TextFieldResetIC(w); if (tf->text.cancel) return; _XmTextFieldDrawInsertionPoint(tf, False); if (position < tf->text.sec_anchor) { _XmTextFieldSetSel2(w, position, tf->text.sec_anchor, False, event->xbutton.time); } else if (position > tf->text.sec_anchor) { _XmTextFieldSetSel2(w, tf->text.sec_anchor, position, False, event->xbutton.time); } else { _XmTextFieldSetSel2(w, position, position, False, event->xbutton.time); } tf->text.sec_extending = True; if (!CheckTimerScrolling(w, event)) DoSecondaryExtend(w, event->xmotion.time); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void Stuff(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XPoint *point = NULL; /* Request targets from the selection owner so you can decide what to * request. The decision process and request for the selection is * taken care of in HandleTargets(). */ if (event && event->type == ButtonRelease) { /* WARNING: do not free the following memory in this module. It * will be freed in FreeLocationData, triggered at the end of * the data transfer operation. */ point = (XPoint *) XtMalloc(sizeof(XPoint)); point->x = event->xbutton.x; point->y = event->xbutton.y; } if (tf->text.selection_link) XmePrimarySink(w, XmLINK, (XtPointer) point, event->xbutton.time); else if (tf->text.selection_move) XmePrimarySink(w, XmMOVE, (XtPointer) point, event->xbutton.time); else XmePrimarySink(w, XmCOPY, (XtPointer) point, event->xbutton.time); } /* ARGSUSED */ void _XmTextFieldHandleSecondaryFinished(Widget w, XEvent *event) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFDestData dest_data; XmTextPosition left, right; int adjustment = 0; Time time = XtLastTimestampProcessed(XtDisplay(w)); XmAnyCallbackStruct cb; dest_data = GetTextFDestData(w); if (dest_data->has_destination) { adjustment = (int) (tf->text.sec_pos_right - tf->text.sec_pos_left); doSetHighlight(w, tf->text.sec_pos_left, tf->text.sec_pos_right, XmHIGHLIGHT_NORMAL); if (dest_data->position <= tf->text.sec_pos_left) { tf->text.sec_pos_left += adjustment - dest_data->replace_length; tf->text.sec_pos_right += adjustment - dest_data->replace_length; } else if (dest_data->position > tf->text.sec_pos_left && dest_data->position < tf->text.sec_pos_right) { tf->text.sec_pos_left -= dest_data->replace_length; tf->text.sec_pos_right += adjustment - dest_data->replace_length; } } left = tf->text.sec_pos_left; right = tf->text.sec_pos_right; /* This will mark the has_secondary field to False. */ (void) _XmTextFieldSetSel2(w, 1, 0, False, time); if (_XmTextFieldReplaceText(tf, event, left, right, NULL, 0, False /* don't adjust cursor position */)) { XmTextPosition cursorPos; if (dest_data->has_destination && TextF_CursorPosition(tf) > right) { cursorPos = TextF_CursorPosition(tf) - (right - left); if (!dest_data->quick_key) _XmTextFieldSetCursorPosition(tf, NULL, cursorPos, True, True); (void) SetDestination((Widget) tf, cursorPos, False, time); } if (!dest_data->has_destination) { /* make some adjustments necessary -- cursor position may refer to ** text which is gone */ cursorPos = TextF_CursorPosition(tf); if (left < cursorPos) cursorPos -= (right - left); tf->text.prim_anchor = cursorPos; if (tf->text.add_mode) { _XmTextFieldDrawInsertionPoint(tf, False); tf->text.add_mode = False; TextF_CursorPosition(tf) = cursorPos; _XmTextFieldDrawInsertionPoint(tf, True); } else if (cursorPos != TextF_CursorPosition(tf)) { /* if it changed, redraw, carefully using internal routines ** to avoid calling _XmSetDestination */ _XmTextFieldDrawInsertionPoint(tf, False); TextF_CursorPosition(tf) = cursorPos; SetCursorPosition(tf, NULL, cursorPos, False, False, True, ForceTrue); _XmTextFieldDrawInsertionPoint(tf, True); } } cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } } /* * Notify the primary selection that the secondary selection * wants to insert it's selection data into the primary selection. */ /* REQUEST TARGETS FROM SELECTION RECEIVER; THEN CALL HANDLETARGETS * WHICH LOOKS AT THE TARGET LIST AND DETERMINE WHAT TARGET TO PLACE * IN THE PAIR. IT WILL THEN DO ANY NECESSARY CONVERSIONS BEFORE * TELLING THE RECEIVER WHAT TO REQUEST AS THE SELECTION VALUE. * THIS WILL GUARANTEE THE BEST CHANCE AT A SUCCESSFUL EXCHANGE. */ /* ARGSUSED */ static void SecondaryNotify(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Atom CS_OF_ENCODING = XmeGetEncodingAtom(w); TextFDestData dest_data; XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; if (tf->text.selection_move == TRUE && tf->text.has_destination && TextF_CursorPosition(tf) >= tf->text.sec_pos_left && TextF_CursorPosition(tf) <= tf->text.sec_pos_right) { /* This will mark the has_secondary field to False. */ (void) _XmTextFieldSetSel2(w, 1, 0, False, event->xbutton.time); return; } /* * Determine what the reciever supports so you can tell 'em what to * request. */ dest_data = GetTextFDestData(w); dest_data->has_destination = tf->text.has_destination; dest_data->position = TextF_CursorPosition(tf); dest_data->replace_length = 0; if (*(num_params) == 1) dest_data->quick_key = True; else dest_data->quick_key = False; if (tf->text.has_primary && left != right) { if (dest_data->position >= left && dest_data->position <= right) dest_data->replace_length = (int) (right - left); } /* * Make a request for the primary selection to convert to * type INSERT_SELECTION as per ICCCM. */ if (tf->text.selection_link) XmeSecondaryTransfer(w, CS_OF_ENCODING, XmLINK, event->xbutton.time); else if (tf->text.selection_move) XmeSecondaryTransfer(w, CS_OF_ENCODING, XmMOVE, event->xbutton.time); else XmeSecondaryTransfer(w, CS_OF_ENCODING, XmCOPY, event->xbutton.time); } /* * LOOKS AT THE TARGET LIST AND DETERMINE WHAT TARGET TO PLACE * IN THE PAIR. IT WILL THEN DO ANY NECESSARY CONVERSIONS BEFORE * TELLING THE RECEIVER WHAT TO REQUEST AS THE SELECTION VALUE. * THIS WILL GUARANTEE THE BEST CHANCE AT A SUCCESSFUL EXCHANGE. */ static void ProcessBDragRelease(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XButtonEvent *ev = (XButtonEvent *) event; XmTextPosition position; if (tf->text.extending) return; /* Work around for intrinsic bug. Remove once bug is fixed. */ XtUngrabPointer(w, ev->time); _XmTextFieldDrawInsertionPoint(tf, False); if (!tf->text.cancel) XtUngrabKeyboard(w, CurrentTime); position = GetPosFromX(tf, (Position) event->xbutton.x); if (tf->text.sel_start) { if (tf->text.has_secondary && tf->text.sec_pos_left != tf->text.sec_pos_right) { if ((Dimension)ev->x > tf->core.width || ev->x < 0 || (Dimension)ev->y > tf->core.height || ev->y < 0) { /* This will mark the has_secondary field to False. */ _XmTextFieldSetSel2(w, 1, 0, False, event->xkey.time); } else { SecondaryNotify(w, event, params, num_params); } } else if (!tf->text.sec_drag && !tf->text.cancel && tf->text.sec_pos_left == position) { /* * Copy contents of primary selection to the stuff position found above. */ Stuff(w, event, params, num_params); } } if (tf->text.select_id) { XtRemoveTimeOut(tf->text.select_id); tf->text.select_id = 0; } tf->text.sec_extending = False; tf->text.sec_drag = False; tf->text.sel_start = False; tf->text.cancel = False; _XmTextFieldDrawInsertionPoint(tf, True); } static void ProcessCopy(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.selection_move = FALSE; tf->text.selection_link = FALSE; ProcessBDragRelease(w, event, params, num_params); _XmTextFieldDrawInsertionPoint(tf, True); } static void ProcessLink(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.selection_move = FALSE; tf->text.selection_link = TRUE; ProcessBDragRelease(w, event, params, num_params); _XmTextFieldDrawInsertionPoint(tf, True); } static void ProcessMove(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.selection_move = TRUE; tf->text.selection_link = FALSE; ProcessBDragRelease(w, event, params, num_params); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DeleteSelection(Widget w, XEvent *event, char **params, Cardinal *num_params) { (void) TextFieldRemove(w, event); } /* ARGSUSED */ static void ClearSelection(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition left = tf->text.prim_pos_left; XmTextPosition right = tf->text.prim_pos_right; int num_spaces = 0; XmAnyCallbackStruct cb; Boolean rep_result = False; if (left < right) num_spaces = (int)(right - left); else num_spaces = (int)(left - right); if (num_spaces) { _XmTextFieldDrawInsertionPoint(tf, False); if (tf->text.max_char_size == 1) { char spaces_cache[100]; Cardinal spaces_size; char *spaces; int i; spaces_size = num_spaces + 1; spaces = (char *)XmStackAlloc(spaces_size, spaces_cache); for (i = 0; i < num_spaces; i++) spaces[i] = ' '; spaces[num_spaces] = 0; rep_result = _XmTextFieldReplaceText(tf, (XEvent *)event, left, right, spaces, num_spaces, False); XmStackFree(spaces, spaces_cache); } else { wchar_t *wc_spaces; int i; wc_spaces = (wchar_t *)XtMalloc((unsigned) (num_spaces + 1) * sizeof(wchar_t)); for (i = 0; i < num_spaces; i++) { (void)mbtowc(&wc_spaces[i], " ", 1); } rep_result = _XmTextFieldReplaceText(tf, (XEvent *)event, left, right, (char*)wc_spaces, num_spaces, False); XtFree((char*)wc_spaces); } if (rep_result) { cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } _XmTextFieldDrawInsertionPoint(tf, True); } } /* ARGSUSED */ static void PageRight(Widget w, XEvent *event, char **params, Cardinal *num_params) { Position x, y; int length = 0, value; XmTextFieldWidget tf = (XmTextFieldWidget) w; Dimension margin_width = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; TextFieldResetIC(w); if (tf->text.max_char_size != 1) { length = FindPixelLength(tf, (char*)TextF_WcValue(tf), tf->text.string_length); } else { length = FindPixelLength(tf, TextF_Value(tf), tf->text.string_length); } /* if widget is wider than text, ignore page-right action*/ if (length <= (int)(tf->core.width - (2 * margin_width))) return; _XmTextFieldDrawInsertionPoint(tf, False); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { SetAnchorBalancing(tf, TextF_CursorPosition(tf)); } } GetXYFromPos(tf, TextF_CursorPosition(tf), &x, &y); if ((int)(length - ((int)(tf->core.width - (2 * margin_width)) - tf->text.h_offset) ) > (int)(tf->core.width - (2 * margin_width))) tf->text.h_offset -= tf->core.width - (2 * margin_width); else tf->text.h_offset = -(length - (tf->core.width - (2 * margin_width))); RedisplayText(tf, 0, tf->text.string_length); _XmTextFieldSetCursorPosition(tf, event, GetPosFromX(tf, x), True, True); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { KeySelection(w, event, params, num_params); } } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void PageLeft(Widget w, XEvent *event, char **params, Cardinal *num_params) { Position x, y; int value; XmTextFieldWidget tf = (XmTextFieldWidget) w; int margin_width = (int)TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; TextFieldResetIC(w); _XmTextFieldDrawInsertionPoint(tf, False); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { SetAnchorBalancing(tf, TextF_CursorPosition(tf)); } } GetXYFromPos(tf, TextF_CursorPosition(tf), &x, &y); if (margin_width <= tf->text.h_offset + ((int)tf->core.width - (2 * margin_width))) tf->text.h_offset = margin_width; else tf->text.h_offset += tf->core.width - (2 * margin_width); RedisplayText(tf, 0, tf->text.string_length); _XmTextFieldSetCursorPosition(tf, event, GetPosFromX(tf, x), True, True); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXTFIELD_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { KeySelection(w, event, params, num_params); } } _XmTextFieldDrawInsertionPoint(tf, True); } static void CopyPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFieldResetIC(w); _XmTextFieldDrawInsertionPoint(tf, False); tf->text.selection_move = False; tf->text.selection_link = False; /* perform the primary paste action */ Stuff(w, event, params, num_params); _XmTextFieldDrawInsertionPoint(tf, True); } static void CutPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFieldResetIC(w); _XmTextFieldDrawInsertionPoint(tf, False); tf->text.selection_move = True; tf->text.selection_link = False; Stuff(w, event, params, num_params); _XmTextFieldDrawInsertionPoint(tf, True); } static void LinkPrimary(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.selection_move = False; tf->text.selection_link = True; Stuff(w, event, params, num_params); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void SetAnchor(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; tf->text.prim_anchor = TextF_CursorPosition(tf); (void) SetDestination(w, tf->text.prim_anchor, False, event->xkey.time); if (tf->text.has_primary) { _XmTextFieldStartSelection(tf, tf->text.prim_anchor, tf->text.prim_anchor, event->xkey.time); if (tf->text.add_mode) { _XmTextFieldDrawInsertionPoint(tf, False); tf->text.add_mode = False; _XmTextFieldDrawInsertionPoint(tf, True); } } } /* ARGSUSED */ static void ToggleOverstrike(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFieldResetIC(w); _XmTextFieldDrawInsertionPoint(tf, False); tf->text.overstrike = !tf->text.overstrike; tf->text.refresh_ibeam_off = True; if (tf->text.overstrike) tf->text.cursor_width = tf->text.cursor_height >> 1; else { tf->text.cursor_width = 5; if (tf->text.cursor_height > 19) tf->text.cursor_width++; } _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void ToggleAddMode(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmTextFieldDrawInsertionPoint(tf, False); tf->text.add_mode = !tf->text.add_mode; if (tf->text.add_mode && (!tf->text.has_primary || tf->text.prim_pos_left == tf->text.prim_pos_right)) tf->text.prim_anchor = TextF_CursorPosition(tf); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void SelectAll(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; TextFieldResetIC(w); _XmTextFieldDrawInsertionPoint(tf, False); if (tf->text.take_primary) _XmTextFieldStartSelection(tf, 0, tf->text.string_length, event->xbutton.time); else SetSelection(tf, 0, tf->text.string_length, True); /* Call _XmTextFieldSetCursorPosition to force image gc to be updated * in case the i-beam is contained within the selection */ tf->text.pending_off = False; _XmTextFieldSetCursorPosition(tf, NULL, TextF_CursorPosition(tf), False, False); tf->text.prim_anchor = 0; (void) SetDestination(w, TextF_CursorPosition(tf), False, event->xkey.time); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void DeselectAll(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmTextFieldDrawInsertionPoint(tf, False); SetSelection(tf, TextF_CursorPosition(tf), TextF_CursorPosition(tf), True); tf->text.pending_off = True; _XmTextFieldSetCursorPosition(tf, event, TextF_CursorPosition(tf), True, True); tf->text.prim_anchor = TextF_CursorPosition(tf); (void) SetDestination(w, TextF_CursorPosition(tf), False, event->xkey.time); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void VoidAction(Widget w, XEvent *event, char **params, Cardinal *num_params) { /* Do Nothing */ } /* ARGSUSED */ static void CutClipboard(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget)w; _XmTextFieldDrawInsertionPoint(tf, False); if (TextF_Editable(tf) && tf->text.prim_pos_left != tf->text.prim_pos_right) (void) XmeClipboardSource(w, XmMOVE, event->xkey.time); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void CopyClipboard(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmTextFieldDrawInsertionPoint(tf, False); if (tf->text.prim_pos_left != tf->text.prim_pos_right) (void) XmeClipboardSource(w, XmCOPY, event->xkey.time); (void) SetDestination(w, TextF_CursorPosition(tf), False, event->xkey.time); _XmTextFieldDrawInsertionPoint(tf, True); } /* ARGSUSED */ static void PasteClipboard(Widget w, XEvent *event, char **params, Cardinal *num_params) { _XmTextFieldDrawInsertionPoint((XmTextFieldWidget)w, False); ((XmTextFieldWidget)w)->text.selection_move = FALSE; ((XmTextFieldWidget)w)->text.selection_link = FALSE; XmeClipboardSink(w, XmCOPY, NULL); _XmTextFieldDrawInsertionPoint((XmTextFieldWidget)w, True); } Boolean XmTextFieldPaste(Widget w) { Boolean status; _XmWidgetToAppContext(w); _XmAppLock(app); TextFieldResetIC(w); ((XmTextFieldWidget)w)->text.selection_move = FALSE; ((XmTextFieldWidget)w)->text.selection_link = FALSE; status = XmeClipboardSink(w, XmCOPY, NULL); _XmAppUnlock(app); return(status); } Boolean XmTextFieldPasteLink(Widget w) { Boolean status; _XmWidgetToAppContext(w); _XmAppLock(app); ((XmTextFieldWidget)w)->text.selection_move = FALSE; ((XmTextFieldWidget)w)->text.selection_link = TRUE; status = XmeClipboardSink(w, XmLINK, NULL); _XmAppUnlock(app); return(status); } /* ARGSUSED */ static void TraverseDown(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; if (tf->primitive.navigation_type == XmNONE && VerifyLeave(tf, event)) { tf->text.traversed = True; if (!_XmMgrTraversal(w, XmTRAVERSE_DOWN)) tf->text.traversed = False; } } /* ARGSUSED */ static void TraverseUp(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; if (tf->primitive.navigation_type == XmNONE && VerifyLeave(tf, event)) { tf->text.traversed = True; if (!_XmMgrTraversal(w, XmTRAVERSE_UP)) tf->text.traversed = False; } } /* ARGSUSED */ static void TraverseHome(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; /* Allow the verification routine to control the traversal */ if (tf->primitive.navigation_type == XmNONE && VerifyLeave(tf, event)) { tf->text.traversed = True; if (!_XmMgrTraversal(w, XmTRAVERSE_HOME)) tf->text.traversed = False; } } /* ARGSUSED */ static void TraverseNextTabGroup(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; /* Allow the verification routine to control the traversal */ if (VerifyLeave(tf, event)) { XmTraversalDirection dir; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean enable_button_tab = xm_dpy->display.enable_button_tab; dir = (enable_button_tab ? XmTRAVERSE_GLOBALLY_FORWARD : XmTRAVERSE_NEXT_TAB_GROUP); tf->text.traversed = True; if (!_XmMgrTraversal(w, dir)) tf->text.traversed = False; } } /* ARGSUSED */ static void TraversePrevTabGroup(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; /* Allow the verification routine to control the traversal */ if (VerifyLeave(tf, event)) { XmTraversalDirection dir; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean enable_button_tab = xm_dpy->display.enable_button_tab; dir = (enable_button_tab ? XmTRAVERSE_GLOBALLY_BACKWARD : XmTRAVERSE_PREV_TAB_GROUP); tf->text.traversed = True; if (!_XmMgrTraversal(w, dir)) tf->text.traversed = False; } } /* ARGSUSED */ static void TextEnter(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmAnyCallbackStruct cb; XRectangle xmim_area; XPoint xmim_point; /* Use != NotifyInferior along with event->xcrossing.focus to avoid * sending input method info if reason for the event is pointer moving * from TextF widget to over-the-spot window (case when over-the-spot * is child of TextF widget). */ if (_XmGetFocusPolicy(w) != XmEXPLICIT && !(tf->text.has_focus) && event->xcrossing.focus && (event->xcrossing.detail != NotifyInferior)) { _XmTextFieldDrawInsertionPoint(tf, False); tf->text.blink_on = False; tf->text.has_focus = True; if (XtIsSensitive(w)) ChangeBlinkBehavior(tf, True); _XmTextFieldDrawInsertionPoint(tf, True); GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, &xmim_point.y); (void)TextFieldGetDisplayRect((Widget)tf, &xmim_area); XmImVaSetFocusValues(w, XmNspotLocation, &xmim_point, XmNarea, &xmim_area, NULL); cb.reason = XmCR_FOCUS; cb.event = event; XtCallCallbackList (w, tf->text.focus_callback, (XtPointer) &cb); } _XmPrimitiveEnter(w, event, params, num_params); } /* ARGSUSED */ static void TextLeave(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextFieldWidget tf = (XmTextFieldWidget) w; /* use detail!= NotifyInferior to handle focus change due to pointer * wandering into over-the-spot input window - we don't want to change * IM's focus state in this case. */ if (_XmGetFocusPolicy(w) != XmEXPLICIT && tf->text.has_focus && event->xcrossing.focus && (event->xcrossing.detail != NotifyInferior)) { if (XtIsSensitive(w)) ChangeBlinkBehavior(tf, False); _XmTextFieldDrawInsertionPoint(tf, False); tf->text.has_focus = False; tf->text.blink_on = True; _XmTextFieldDrawInsertionPoint(tf, True); (void) VerifyLeave(tf, event); XmImUnsetFocus(w); } _XmPrimitiveLeave(w, event, params, num_params); } /**************************************************************** * * Private definitions. * ****************************************************************/ /* * ClassPartInitialize sets up the fast subclassing for the widget.i * It also merges translation tables. */ static void ClassPartInitialize(WidgetClass w_class) { char *event_bindings; _XmFastSubclassInit (w_class, XmTEXT_FIELD_BIT); event_bindings = (char *)XtMalloc((unsigned) (strlen(EventBindings1) + strlen(EventBindings2) + strlen(EventBindings3) + 1)); strcpy(event_bindings, EventBindings1); strcat(event_bindings, EventBindings2); strcat(event_bindings, EventBindings3); w_class->core_class.tm_table = (String) XtParseTranslationTable(event_bindings); XtFree(event_bindings); } /**************************************************************** * * Private functions used in Initialize. * ****************************************************************/ /* * Verify that the resource settings are valid. Print a warning * message and reset the s if the are invalid. */ static void Validates(XmTextFieldWidget tf) { XtPointer temp_ptr; if (TextF_CursorPosition(tf) < 0) { XmeWarning ((Widget)tf, MSG1); TextF_CursorPosition(tf) = 0; } if (TextF_Columns(tf) <= 0) { XmeWarning ((Widget)tf, MSG2); TextF_Columns(tf) = 20; } if (TextF_SelectionArray(tf) == NULL) TextF_SelectionArray(tf) = (XmTextScanType *) sarray; if (TextF_SelectionArrayCount(tf) <= 0) TextF_SelectionArrayCount(tf) = XtNumber(sarray); /* * Fix for HaL DTS 9841 - copy the selectionArray into dedicated memory. */ temp_ptr = (XtPointer)TextF_SelectionArray(tf); TextF_SelectionArray(tf) = (XmTextScanType *)XtMalloc(TextF_SelectionArrayCount(tf) * sizeof(XmTextScanType)); memcpy((void *)TextF_SelectionArray(tf), (void *)temp_ptr, (TextF_SelectionArrayCount(tf) * sizeof(XmTextScanType))); /* * End fix for HaL DTS 9841 */ } static Boolean LoadFontMetrics(XmTextFieldWidget tf) { XmFontContext context; XmFontListEntry next_entry; XmFontType type_return = XmFONT_IS_FONT; XtPointer tmp_font; Boolean have_font_struct = False; Boolean have_font_set = False; #ifdef USE_XFT Boolean have_xft_font = False; #endif XFontSetExtents *fs_extents; XFontStruct *font; unsigned long charwidth = 0; char* font_tag = NULL; if (!XmFontListInitFontContext(&context, TextF_FontList(tf))) XmeWarning ((Widget)tf, MSG3); do { next_entry = XmFontListNextEntry(context); if (next_entry && (tmp_font = XmFontListEntryGetFont(next_entry, &type_return))) { if (type_return == XmFONT_IS_FONTSET) { font_tag = XmFontListEntryGetTag(next_entry); if (!have_font_set) { /* this saves the first fontset found, just in * case we don't find a default tag set. */ TextF_UseFontSet(tf) = True; #ifdef USE_XFT TextF_UseXft(tf) = False; #endif tf->text.font = (XFontStruct *)tmp_font; have_font_struct = True; /* we have a font set, so no need to * consider future font structs */ have_font_set = True; /* we have a font set. */ if (!strcmp(XmFONTLIST_DEFAULT_TAG, font_tag)) { if (font_tag) XtFree(font_tag); break; /* Break out! We've found the one we want. */ } } else if (!strcmp(XmFONTLIST_DEFAULT_TAG, font_tag)) { tf->text.font = (XFontStruct *)tmp_font; have_font_set = True; /* we have a font set. */ if (font_tag) XtFree(font_tag); break; /* Break out! We've found the one we want. */ } if (font_tag) XtFree(font_tag); } else if (type_return == XmFONT_IS_FONT && !have_font_struct) { /* return_type must be XmFONT_IS_FONT */ TextF_UseFontSet(tf) = False; #ifdef USE_XFT TextF_UseXft(tf) = False; #endif tf->text.font=(XFontStruct*)tmp_font; /* save the first font * struct in case no font * set is found */ have_font_struct = True; #ifdef USE_XFT } else if (type_return == XmFONT_IS_XFT && !have_xft_font) { TextF_UseFontSet(tf) = False; TextF_UseXft(tf) = True; have_xft_font = True; tf->text.font = tmp_font; #endif } } } while(next_entry != NULL); XmFontListFreeFontContext(context); #if USE_XFT if (!have_font_struct && !have_font_set && !have_xft_font) { #else if (!have_font_struct && !have_font_set) { #endif XmeWarning ((Widget)tf, MSG4); return False; } if(TextF_UseFontSet(tf)) { fs_extents = XExtentsOfFontSet((XFontSet)TextF_Font(tf)); charwidth = (unsigned long)fs_extents->max_logical_extent.width; /* max_logical_extent.y is number of pixels from origin to top of * rectangle (i.e. y is negative) */ TextF_FontAscent(tf) = -fs_extents->max_logical_extent.y; TextF_FontDescent(tf) = fs_extents->max_logical_extent.height + fs_extents->max_logical_extent.y; #ifdef USE_XFT } else if (TextF_UseXft(tf)) { #ifdef FIX_1415 _XmXftFontAverageWidth((Widget) tf, TextF_XftFont(tf), (int *)&charwidth); #else charwidth = TextF_XftFont(tf)->max_advance_width; #endif TextF_FontAscent(tf) = TextF_XftFont(tf)->ascent; TextF_FontDescent(tf) = TextF_XftFont(tf)->descent; #endif } else { font = TextF_Font(tf); if (!XGetFontProperty(font, XA_QUAD_WIDTH, &charwidth) || charwidth == 0) { if (font->per_char && font->min_char_or_byte2 <= '0' && font->max_char_or_byte2 >= '0') charwidth = font->per_char['0' - font->min_char_or_byte2].width; else charwidth = font->max_bounds.width; } TextF_FontAscent(tf) = font->max_bounds.ascent; TextF_FontDescent(tf) = font->max_bounds.descent; } tf->text.average_char_width = (Dimension) charwidth; return True; } /* ValidateString makes the following assumption: if MB_CUR_MAX == 1, value * is a char*, otherwise value is a wchar_t*. The Boolean "is_wchar" indicates * if value points to char* or wchar_t* data. * * It is ValidateString's task to verify that "value" contains only printing * characters; all others are discarded. ValidateString then mallocs data * to store the value and assignes it to tf->text.value (if MB_CUR_MAX == 1) * or to tf->text.wc_value (if MB_CUR_MAX != 1), setting the opposite * pointer to NULL. It is the callers responsibility to free data before * calling ValidateString. */ static void ValidateString(XmTextFieldWidget tf, char *value, #if NeedWidePrototypes int is_wchar) #else Boolean is_wchar) #endif /* NeedWidePrototypes */ { /* if value is wchar_t *, must count the characters; else use strlen */ int str_len = 0; int i, j; char stack_cache[400]; if (!is_wchar) { char *temp_str, *curr_str, *start_temp; str_len = strlen(value); temp_str = (char*)XmStackAlloc((Cardinal)str_len + 1, stack_cache); start_temp = temp_str; curr_str = value; for (i = 0; i < str_len;) { if (tf->text.max_char_size == 1) { if (PrintableString(tf, curr_str, 1, False)) { *temp_str = *curr_str; temp_str++; } else { char *params[1], err_str[5]; sprintf(err_str, "\\%o", (unsigned char) *curr_str); params[0] = err_str; _XmWarningMsg ((Widget)tf, "Unsupported char", MSG5, params, 1); } curr_str++; i++; } else { wchar_t tmp; int num_conv; Boolean printable; #ifdef USE_XFT if (TextF_UseXft(tf)) { num_conv = strlen(curr_str); printable = (num_conv >= 0 && PrintableString(tf, curr_str, num_conv, True)); } else #endif { num_conv = mbtowc(&tmp, curr_str, tf->text.max_char_size); printable = (num_conv >= 0 && PrintableString(tf, (char*)&tmp, 1, True)); } if (printable) { for (j = 0; j < num_conv; j++) { *temp_str = *curr_str; temp_str++; curr_str++; i++; } } else { char *params[1], *err_str; if (num_conv >= 0) { int i; err_str = XtMalloc((4 * num_conv) + 1); for (i = 0; i < num_conv; i++) { sprintf(err_str + (i * 4), "\\%o", (unsigned char) curr_str[i]); } } else { err_str = XtMalloc(5); sprintf(err_str, "\\%o", (unsigned char) *curr_str); num_conv = 1; } params[0] = err_str; _XmWarningMsg ((Widget)tf, "Unsupported char", MSG5, params, 1); XtFree(err_str); if (num_conv > 0) { curr_str += num_conv; i += num_conv; } else { curr_str++; i++; } } } } *temp_str = '\0'; /* value contains validated string; now stuff it into the proper * instance pointer. */ if (tf->text.max_char_size == 1) { tf->text.string_length = strlen(start_temp); /* malloc the space for the text value */ TextF_Value(tf) = (char *) memcpy(XtMalloc((unsigned)(tf->text.string_length + 30)), (void *)start_temp, tf->text.string_length + 1); tf->text.size_allocd = tf->text.string_length + 30; TextF_WcValue(tf) = NULL; } else { /* Need wchar_t* data to set as the widget's value */ /* count number of wchar's */ str_len = strlen(start_temp); tf->text.string_length = str_len; tf->text.size_allocd = (tf->text.string_length + 30)*sizeof(wchar_t); TextF_WcValue(tf) = (wchar_t*)XtMalloc((unsigned)tf->text.size_allocd); tf->text.string_length = mbstowcs(TextF_WcValue(tf), start_temp, tf->text.string_length + 30); if (tf->text.string_length < 0) tf->text.string_length = 0; TextF_Value(tf) = NULL; } XmStackFree(start_temp, stack_cache); } else { /* pointer passed points to wchar_t* data */ wchar_t *wc_value, *wcs_temp_str, *wcs_start_temp, *wcs_curr_str; char scratch[8]; int new_len = 0; int csize = 1; wc_value = (wchar_t *) value; for (str_len = 0, i = 0; *wc_value != (wchar_t)0L; str_len++) wc_value++; /* count number of wchars */ wcs_temp_str=(wchar_t *)XmStackAlloc((Cardinal) ((str_len+1) * sizeof(wchar_t)), stack_cache); wcs_start_temp = wcs_temp_str; wcs_curr_str = (wchar_t *) value; for (i = 0; i < str_len; i++, wcs_curr_str++) { if (tf->text.max_char_size == 1) { csize = wctomb(scratch, *wcs_curr_str); if (csize >= 0 && PrintableString(tf, scratch, csize, False)) { *wcs_temp_str = *wcs_curr_str; wcs_temp_str++; new_len++; } else { char *params[1]; char *err_str; if (csize >= 0) { int i; err_str = XtMalloc((4 * csize) + 1); for (i = 0; i < csize; i++) { sprintf(err_str + (i * 4), "\\%o", (unsigned char) scratch[i]); } } else { err_str = XtMalloc(1); err_str[0] = '\0'; } params[0] = err_str; _XmWarningMsg ((Widget)tf, "Unsupported wchar", WC_MSG1, params, 1); XtFree(err_str); } } else { if (PrintableString(tf, (char*)wcs_curr_str, 1, True)) { *wcs_temp_str = *wcs_curr_str; wcs_temp_str++; new_len++; } else { char *params[1]; char *err_str; csize = wctomb(scratch, *wcs_curr_str); if (csize >= 0) { int i; err_str = XtMalloc((4 * csize) + 1); for (i = 0; i < csize; i++) { sprintf(err_str + (i * 4), "\\%o", (unsigned char) scratch[i]); } } else { err_str = XtMalloc(1); err_str[0] = '\0'; } params[0] = err_str; _XmWarningMsg ((Widget)tf, "Unsupported wchar", WC_MSG1, params, 1); XtFree(err_str); } } } str_len = new_len; *wcs_temp_str = (wchar_t)0L; /* terminate with a wchar_t NULL */ tf->text.string_length = str_len; /* This is *wrong* if MB_CUR_MAX > 2 * with no font set... but what can * ya do? Spec says let it dump core. */ tf->text.size_allocd = (str_len + 30) * sizeof(wchar_t); if (tf->text.max_char_size == 1) { /* Need to store data as char* */ int ret_val = 0; TextF_Value(tf) = XtMalloc((unsigned)tf->text.size_allocd); ret_val = wcstombs(TextF_Value(tf), wcs_start_temp, tf->text.size_allocd); if (ret_val < 0) tf->text.value[0] = '\0'; TextF_WcValue(tf) = NULL; } else { /* Need to store data as wchar_t* */ TextF_WcValue(tf) = (wchar_t*)memcpy(XtMalloc((unsigned) tf->text.size_allocd), (void*)wcs_start_temp, (1 + str_len) * sizeof(wchar_t)); TextF_Value(tf) = NULL; } XmStackFree((char *)wcs_start_temp, stack_cache); } } /* * Initialize the s in the text fields instance record. */ static void InitializeTextStruct(XmTextFieldWidget tf) { /* Flag used in losing focus verification to indicate that a traversal * key was pressed. Must be initialized to False. */ XIMCallback xim_cb[5]; /* on the spot im callbacks */ Arg args[11]; /* To set initial values to input method */ Cardinal n = 0; XPoint xmim_point; XRectangle xmim_area; tf->text.traversed = False; tf->text.add_mode = False; tf->text.has_focus = False; tf->text.blink_on = True; tf->text.cursor_on = 0; tf->text.has_rect = False; tf->text.has_primary = False; tf->text.take_primary = True; tf->text.has_secondary = False; tf->text.has_destination = False; tf->text.overstrike = False; tf->text.selection_move = False; tf->text.sel_start = False; tf->text.pending_off = True; tf->text.fontlist_created = False; tf->text.cancel = False; tf->text.extending = False; tf->text.prim_time = 0; tf->text.dest_time = 0; tf->text.select_id = 0; tf->text.select_pos_x = 0; tf->text.sec_extending = False; tf->text.sec_drag = False; tf->text.changed_visible = False; tf->text.refresh_ibeam_off = True; tf->text.in_setvalues = False; tf->text.do_resize = True; tf->text.have_inverted_image_gc = False; tf->text.margin_top = TextF_MarginHeight(tf); tf->text.margin_bottom = TextF_MarginHeight(tf); tf->text.programmatic_highlights = False; /* tf->text.rt_save = False; */ tf->text.max_char_size = MB_CUR_MAX; /* copy over the font list */ if (TextF_FontList(tf) == NULL) { TextF_FontList(tf) = XmeGetDefaultRenderTable((Widget)tf, (unsigned char) XmTEXT_FONTLIST); TextF_FontList(tf) = (XmFontList)XmFontListCopy(TextF_FontList(tf)); (void)LoadFontMetrics(tf); } else { TextF_FontList(tf) = (XmFontList)XmFontListCopy(TextF_FontList(tf)); if(!LoadFontMetrics(tf)) {/*if failed use default */ XmFontListFree(TextF_FontList(tf)); TextF_FontList(tf) = XmeGetDefaultRenderTable((Widget)tf, (unsigned char) XmTEXT_FONTLIST); TextF_FontList(tf) = (XmFontList)XmFontListCopy(TextF_FontList(tf)); (void)LoadFontMetrics(tf); } } tf->text.gc = NULL; tf->text.image_gc = NULL; tf->text.save_gc = NULL; tf->text.cursor_gc = NULL; tf->text.h_offset = (TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); /* ValidateString will verify value contents, convert to appropriate * storage form (i.e. char* or wchar_t*), place in the appropriate * location (text.value or text.wc_value), and null out opposite * pointer. */ if (TextF_WcValue(tf) != NULL) { /* XmNvalueWcs was set - it rules */ TextF_Value(tf) = NULL; ValidateString(tf, (char*)TextF_WcValue(tf), True); } else if (TextF_Value(tf) != NULL) ValidateString(tf, TextF_Value(tf), False); else /* TextF_Value(tf) is null pointer */ ValidateString(tf, "", False); if (TextF_CursorPosition(tf) > tf->text.string_length) TextF_CursorPosition(tf) = tf->text.string_length; tf->text.orig_left = tf->text.orig_right = tf->text.prim_pos_left = tf->text.prim_pos_right = tf->text.prim_anchor = TextF_CursorPosition(tf); tf->text.sec_pos_left = tf->text.sec_pos_right = tf->text.sec_anchor = TextF_CursorPosition(tf); tf->text.cursor_height = tf->text.cursor_width = 0; tf->text.stipple_tile = _XmGetInsensitiveStippleBitmap((Widget) tf); tf->text.add_mode_cursor = XmUNSPECIFIED_PIXMAP; tf->text.cursor = XmUNSPECIFIED_PIXMAP; tf->text.ibeam_off = XmUNSPECIFIED_PIXMAP; tf->text.image_clip = XmUNSPECIFIED_PIXMAP; tf->text.last_time = 0; tf->text.sarray_index = 0; /* Initialize highlight elements */ tf->text.highlight.number = tf->text.highlight.maximum = 1; tf->text.highlight.list = (_XmHighlightRec *)XtMalloc((unsigned)sizeof(_XmHighlightRec)); tf->text.highlight.list[0].position = 0; tf->text.highlight.list[0].mode = XmHIGHLIGHT_NORMAL; tf->text.timer_id = (XtIntervalId)0; tf->text.drag_id = (XtIntervalId)0; tf->text.transfer_action = NULL; XmTextFieldSetEditable((Widget)tf, TextF_Editable(tf)); if (TextF_Editable(tf)) { XmImRegister((Widget)tf, (unsigned int) NULL); GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, &xmim_point.y); (void)TextFieldGetDisplayRect((Widget)tf, &xmim_area); n = 0; XtSetArg(args[n], XmNfontList, TextF_FontList(tf)); n++; XtSetArg(args[n], XmNbackground, tf->core.background_pixel); n++; XtSetArg(args[n], XmNforeground, tf->primitive.foreground); n++; XtSetArg(args[n], XmNbackgroundPixmap,tf->core.background_pixmap);n++; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XtSetArg(args[n], XmNlineSpace, TextF_FontAscent(tf) + TextF_FontDescent(tf)); n++; /* * On the spot support. Register preedit callbacks during initialize. */ xim_cb[0].client_data = (XPointer)tf; xim_cb[0].callback = (XIMProc)PreeditStart; xim_cb[1].client_data = (XPointer)tf; xim_cb[1].callback = (XIMProc)PreeditDone; xim_cb[2].client_data = (XPointer)tf; xim_cb[2].callback = (XIMProc)PreeditDraw; xim_cb[3].client_data = (XPointer)tf; xim_cb[3].callback = (XIMProc)PreeditCaret; XtSetArg(args[n], XmNpreeditStartCallback, &xim_cb[0]); n++; XtSetArg(args[n], XmNpreeditDoneCallback, &xim_cb[1]); n++; XtSetArg(args[n], XmNpreeditDrawCallback, &xim_cb[2]); n++; XtSetArg(args[n], XmNpreeditCaretCallback, &xim_cb[3]); n++; XmImSetValues((Widget)tf, args, n); } /* * Initialize on the spot data in tf structure */ tf->text.onthespot = (OnTheSpotData)XtMalloc(sizeof(OnTheSpotDataRec)); tf->text.onthespot->start = tf->text.onthespot->end = tf->text.onthespot->cursor = 0; tf->text.onthespot->under_preedit = False; tf->text.onthespot->under_verify_preedit = False; tf->text.onthespot->verify_commit = False; } /* * Get the graphics context for filling the background, and for drawing * and inverting text. Used a unique pixmap so all text field widgets * share common GCs. */ static void LoadGCs(XmTextFieldWidget tf, Pixel background, Pixel foreground) { XGCValues values; unsigned long valueMask = (GCFunction | GCForeground | GCBackground | GCGraphicsExposures); unsigned long dynamicMask = GCClipMask; unsigned long unusedMask = GCClipXOrigin | GCClipYOrigin | GCFont; /* * Get GC for saving area under the cursor. */ values.function = GXcopy; values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; values.graphics_exposures = (Bool) False; if (tf->text.save_gc != NULL) XtReleaseGC((Widget)tf, tf->text.save_gc); tf->text.save_gc = XtAllocateGC((Widget) tf, tf->core.depth, valueMask, &values, dynamicMask, unusedMask); /* * Get GC for drawing text. */ #if USE_XFT if (!TextF_UseFontSet(tf) && !TextF_UseXft(tf)) { #else if (!TextF_UseFontSet(tf)) { #endif valueMask |= GCFont; values.font = TextF_Font(tf)->fid; } values.foreground = foreground ^ background; values.background = 0; values.graphics_exposures = (Bool) True; if (tf->text.gc != NULL) XtReleaseGC((Widget)tf, tf->text.gc); dynamicMask |= GCForeground | GCBackground | GCFillStyle | GCStipple; tf->text.gc = XtAllocateGC((Widget) tf, tf->core.depth, valueMask, &values, dynamicMask, 0); /* Create a temporary GC - change it later in make IBEAM */ valueMask |= GCStipple | GCFillStyle; values.stipple = tf->text.stipple_tile; values.fill_style = FillStippled; values.graphics_exposures = (Bool) False; if (tf->text.image_gc != NULL) XtReleaseGC((Widget)tf, tf->text.image_gc); dynamicMask |= (GCTileStipXOrigin | GCTileStipYOrigin | GCFunction); tf->text.image_gc = XtAllocateGC((Widget) tf, tf->core.depth, valueMask, &values, dynamicMask, 0); } static void MakeIBeamOffArea(XmTextFieldWidget tf, #if NeedWidePrototypes int width, int height) #else Dimension width, Dimension height) #endif /* NeedWidePrototypes */ { Display *dpy = XtDisplay(tf); Screen *screen = XtScreen(tf); /* Create a pixmap for storing the screen data where the I-Beam will * be painted */ tf->text.ibeam_off = XCreatePixmap(dpy, RootWindowOfScreen(screen), width, height, tf->core.depth); tf->text.refresh_ibeam_off = True; } static Pixmap FindPixmap( Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth ) { XmAccessColorDataRec acc_color_rec; acc_color_rec.foreground = foreground; acc_color_rec.background = background; acc_color_rec.top_shadow_color = XmUNSPECIFIED_PIXEL; acc_color_rec.bottom_shadow_color = XmUNSPECIFIED_PIXEL; acc_color_rec.select_color = XmUNSPECIFIED_PIXEL; acc_color_rec.highlight_color = XmUNSPECIFIED_PIXEL; return _XmGetColoredPixmap(screen, image_name, &acc_color_rec, depth, True); } static void MakeIBeamStencil(XmTextFieldWidget tf, int line_width) { Screen *screen = XtScreen(tf); char pixmap_name[64]; XGCValues values; unsigned long valueMask; sprintf(pixmap_name, "_XmText_%d_%d", tf->text.cursor_height, line_width); tf->text.cursor = FindPixmap(screen, pixmap_name, 1, 0, 1); if (tf->text.cursor == XmUNSPECIFIED_PIXMAP) { Display *dpy = XtDisplay(tf); XSegment segments[3]; /* Create a pixmap for the I-Beam stencil */ tf->text.cursor = XCreatePixmap(dpy, XtWindow(tf), tf->text.cursor_width, tf->text.cursor_height, 1); /* Fill in the stencil with a solid in preparation * to "cut out" the I-Beam */ values.foreground = 0; values.line_width = 0; values.fill_style = FillSolid; values.function = GXcopy; valueMask = GCForeground | GCLineWidth | GCFillStyle | GCFunction; XChangeGC(dpy, tf->text.cursor_gc, valueMask, &values); XFillRectangle(dpy, tf->text.cursor, tf->text.cursor_gc, 0, 0, tf->text.cursor_width, tf->text.cursor_height); /* Change the GC for use in "cutting out" the I-Beam shape */ values.foreground = 1; values.line_width = line_width; XChangeGC(dpy, tf->text.cursor_gc, GCForeground | GCLineWidth, &values); /* Draw the segments of the I-Beam */ /* 1st segment is the top horizontal line of the 'I' */ segments[0].x1 = 0; segments[0].y1 = line_width - 1; segments[0].x2 = tf->text.cursor_width; segments[0].y2 = line_width - 1; /* 2nd segment is the bottom horizontal line of the 'I' */ segments[1].x1 = 0; segments[1].y1 = tf->text.cursor_height - 1; segments[1].x2 = tf->text.cursor_width; segments[1].y2 = tf->text.cursor_height - 1; /* 3rd segment is the vertical line of the 'I' */ segments[2].x1 = tf->text.cursor_width >> 1; segments[2].y1 = line_width; segments[2].x2 = tf->text.cursor_width >> 1; segments[2].y2 = tf->text.cursor_height - 1; /* Draw the segments onto the cursor */ XDrawSegments(dpy, tf->text.cursor, tf->text.cursor_gc, segments, 3); /* Install the cursor for pixmap caching */ (void) _XmCachePixmap(tf->text.cursor, XtScreen(tf), pixmap_name, 1, 0, 1, tf->text.cursor_width, tf->text.cursor_height); } /* Get/create the image_gc used to paint the I-Beam */ valueMask = (GCStipple | GCForeground | GCBackground | GCFillStyle); if (!tf->text.overstrike) { values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; } else values.background = values.foreground = tf->core.background_pixel ^ tf->primitive.foreground; values.stipple = tf->text.cursor; values.fill_style = FillStippled; XChangeGC(XtDisplay(tf), tf->text.image_gc, valueMask, &values); } /* The IBeam Stencil must have already been created before this routine * is called. */ static void MakeAddModeCursor(XmTextFieldWidget tf, int line_width) { Screen *screen = XtScreen(tf); char pixmap_name[64]; sprintf(pixmap_name, "_XmText_AddMode_%d_%d", tf->text.cursor_height, line_width); tf->text.add_mode_cursor = FindPixmap(screen, pixmap_name, 1, 0, 1); if (tf->text.add_mode_cursor == XmUNSPECIFIED_PIXMAP) { XtGCMask valueMask; XGCValues values; Display *dpy = XtDisplay(tf); tf->text.add_mode_cursor = XCreatePixmap(dpy, XtWindow(tf), tf->text.cursor_width, tf->text.cursor_height, 1); values.function = GXcopy; valueMask = GCFunction; XChangeGC(dpy, tf->text.cursor_gc, valueMask, &values); XCopyArea(dpy, tf->text.cursor, tf->text.add_mode_cursor, tf->text.cursor_gc, 0, 0, tf->text.cursor_width, tf->text.cursor_height, 0, 0); valueMask = (GCForeground | GCBackground | GCTile | GCFillStyle | GCFunction | GCTileStipXOrigin); values.function = GXand; values.tile = tf->text.stipple_tile; values.fill_style = FillTiled; values.ts_x_origin = -1; values.foreground = tf->primitive.foreground; values.background = tf->core.background_pixel; XChangeGC(dpy, tf->text.cursor_gc, valueMask, &values); XFillRectangle(dpy, tf->text.add_mode_cursor, tf->text.cursor_gc, 0, 0, tf->text.cursor_width, tf->text.cursor_height); /* Install the pixmap for pixmap caching */ _XmCachePixmap(tf->text.add_mode_cursor, XtScreen(tf), pixmap_name, 1, 0, 1, tf->text.cursor_width, tf->text.cursor_height); } } static void MakeCursors(XmTextFieldWidget tf) { Screen *screen = XtScreen(tf); int line_width = 1; int oldwidth = tf->text.cursor_width; int oldheight = tf->text.cursor_height; if (!XtIsRealized((Widget) tf)) return; tf->text.cursor_width = 5; tf->text.cursor_height = TextF_FontAscent(tf) + TextF_FontDescent(tf); /* setup parameters to make a thicker I-Beam */ if (tf->text.cursor_height > 19) { tf->text.cursor_width++; line_width = 2; } if (tf->text.cursor == XmUNSPECIFIED_PIXMAP || tf->text.add_mode_cursor == XmUNSPECIFIED_PIXMAP || tf->text.ibeam_off == XmUNSPECIFIED_PIXMAP || oldheight != tf->text.cursor_height || oldwidth != tf->text.cursor_width) { if (tf->text.cursor_gc == NULL) { unsigned long valueMask = 0; XGCValues values; unsigned long dynamicMask = GCForeground | GCLineWidth | GCTile | GCFillStyle | GCBackground | GCFunction | GCTileStipXOrigin; tf->text.cursor_gc = XtAllocateGC((Widget)tf, 1, valueMask, &values, dynamicMask, 0); } /* Remove old ibeam off area */ if (tf->text.ibeam_off != XmUNSPECIFIED_PIXMAP) XFreePixmap(XtDisplay((Widget)tf), tf->text.ibeam_off); /* Remove old insert cursor */ if (tf->text.cursor != XmUNSPECIFIED_PIXMAP) { (void) XmDestroyPixmap(screen, tf->text.cursor); tf->text.cursor = XmUNSPECIFIED_PIXMAP; } /* Remove old add mode cursor */ if (tf->text.add_mode_cursor != XmUNSPECIFIED_PIXMAP) { (void) XmDestroyPixmap(screen, tf->text.add_mode_cursor); tf->text.add_mode_cursor = XmUNSPECIFIED_PIXMAP; } /* Create area in which to save text located underneath I beam */ MakeIBeamOffArea(tf, MAX(tf->text.cursor_height>>1,tf->text.cursor_height), tf->text.cursor_height); /* Create a new i-beam cursor */ MakeIBeamStencil(tf, line_width); /* Create a new add_mode cursor */ MakeAddModeCursor(tf, line_width); } if (tf->text.overstrike) tf->text.cursor_width = tf->text.cursor_height >> 1; } /* ARGSUSED */ static void DragProcCallback(Widget w, XtPointer client, XtPointer call) { enum { XmACOMPOUND_TEXT, XmATEXT, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSTEXT, XmSUTF8_STRING }; XmDragProcCallbackStruct *cb = (XmDragProcCallbackStruct *)call; Widget drag_cont; Atom targets[5]; Arg args[10]; Atom *exp_targets; Cardinal num_exp_targets, n; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); targets[0] = XmeGetEncodingAtom(w); targets[1] = atoms[XmACOMPOUND_TEXT]; targets[2] = XA_STRING; targets[3] = atoms[XmATEXT]; targets[4] = atoms[XmAUTF8_STRING]; drag_cont = cb->dragContext; n = 0; XtSetArg(args[n], XmNexportTargets, &exp_targets); n++; XtSetArg(args[n], XmNnumExportTargets, &num_exp_targets); n++; XtGetValues(drag_cont, args, n); switch(cb->reason) { case XmCR_DROP_SITE_ENTER_MESSAGE: if (XmTargetsAreCompatible(XtDisplay(drag_cont), exp_targets, num_exp_targets, targets, 4)) cb->dropSiteStatus = XmVALID_DROP_SITE; else cb->dropSiteStatus = XmINVALID_DROP_SITE; break; case XmCR_DROP_SITE_LEAVE_MESSAGE: case XmCR_DROP_SITE_MOTION_MESSAGE: case XmCR_OPERATION_CHANGED: break; default: /* other messages we consider invalid */ cb->dropSiteStatus = XmINVALID_DROP_SITE; break; } if (cb -> dropSiteStatus == XmVALID_DROP_SITE) { if (cb -> operation != XmDROP_COPY && cb -> operation != XmDROP_MOVE) cb -> dropSiteStatus = XmINVALID_DROP_SITE; } } static void RegisterDropSite(Widget w) { enum { XmACOMPOUND_TEXT, XmATEXT, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSTEXT, XmSUTF8_STRING }; Atom targets[5]; Arg args[10]; int n; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); targets[0] = XmeGetEncodingAtom(w); targets[1] = atoms[XmACOMPOUND_TEXT]; targets[2] = XA_STRING; targets[3] = atoms[XmATEXT]; targets[4] = atoms[XmAUTF8_STRING]; n = 0; XtSetArg(args[n], XmNimportTargets, targets); n++; XtSetArg(args[n], XmNnumImportTargets, 5); n++; XtSetArg(args[n], XmNdragProc, DragProcCallback); n++; XmeDropSink(w, args, n); } /* * Initialize * Intializes the text data and ensures that the data in new * is valid. */ /* ARGSUSED */ static void Initialize(Widget request, Widget new_w, ArgList args, Cardinal *num_args) { XmTextFieldWidget req_tf = (XmTextFieldWidget) request; XmTextFieldWidget new_tf = (XmTextFieldWidget) new_w; Dimension width, height; Validates(new_tf); InitializeTextStruct(new_tf); LoadGCs(new_tf, new_tf->core.background_pixel, new_tf->primitive.foreground); ComputeSize(new_tf, &width, &height); if (req_tf->core.width == 0) new_tf->core.width = width; if (req_tf->core.height == 0) new_tf->core.height = height; RegisterDropSite(new_w); if (new_tf->text.verify_bell == (Boolean) XmDYNAMIC_BOOL) { if (_XmGetAudibleWarning(new_w) == XmBELL) new_tf->text.verify_bell = True; else new_tf->text.verify_bell = False; } } static void Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Arg args[11]; /* To set initial values to input method */ XIMCallback xim_cb[5]; /* on the spot im callback data */ Cardinal n = 0; XtCreateWindow(w, (unsigned int) InputOutput, (Visual *) CopyFromParent, *valueMask, attributes); MakeCursors(tf); if (TextF_Editable(tf)){ /* * On the spot support. Register preedit callbacks. */ xim_cb[0].client_data = (XPointer)tf; xim_cb[0].callback = (XIMProc)PreeditStart; xim_cb[1].client_data = (XPointer)tf; xim_cb[1].callback = (XIMProc)PreeditDone; xim_cb[2].client_data = (XPointer)tf; xim_cb[2].callback = (XIMProc)PreeditDraw; xim_cb[3].client_data = (XPointer)tf; xim_cb[3].callback = (XIMProc)PreeditCaret; XtSetArg(args[n], XmNpreeditStartCallback, &xim_cb[0]); n++; XtSetArg(args[n], XmNpreeditDoneCallback, &xim_cb[1]); n++; XtSetArg(args[n], XmNpreeditDrawCallback, &xim_cb[2]); n++; XtSetArg(args[n], XmNpreeditCaretCallback, &xim_cb[3]); n++; XmImSetValues((Widget)tf, args, n); } } static void Destroy(Widget wid) { XmTextFieldWidget tf = (XmTextFieldWidget) wid; Widget dest = XmGetDestination(XtDisplay(wid)); if (dest == wid) _XmSetDestination(XtDisplay(wid), NULL); if (tf->text.timer_id) XtRemoveTimeOut(tf->text.timer_id); if (tf->text.drag_id) XtRemoveTimeOut(tf->text.drag_id); if (tf->text.select_id) { XtRemoveTimeOut(tf->text.select_id); tf->text.select_id = 0; } if (tf->text.transfer_action) { XtFree((char *)tf->text.transfer_action->event); XtFree((char *)tf->text.transfer_action); } if (tf->text.max_char_size == 1) XtFree(TextF_Value(tf)); else XtFree((char *)TextF_WcValue(tf)); XtReleaseGC(wid, tf->text.gc); XtReleaseGC(wid, tf->text.image_gc); XtReleaseGC(wid, tf->text.save_gc); XtReleaseGC(wid, tf->text.cursor_gc); XtFree((char *)tf->text.highlight.list); XmFontListFree((XmFontList)TextF_FontList(tf)); if (tf->text.add_mode_cursor != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(XtScreen(tf), tf->text.add_mode_cursor); if (tf->text.cursor != XmUNSPECIFIED_PIXMAP) (void) XmDestroyPixmap(XtScreen(tf), tf->text.cursor); if (tf->text.ibeam_off != XmUNSPECIFIED_PIXMAP) XFreePixmap(XtDisplay((Widget)tf), tf->text.ibeam_off); if (tf->text.onthespot != NULL) XtFree((char *)tf->text.onthespot); /* * Fix for HaL DTS 9841 - release the data for the selectionArray. */ XtFree((char *)TextF_SelectionArray(tf)); XmImUnregister(wid); } static void Resize(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; int text_width, new_width, offset; tf->text.do_resize = False; #ifdef AS_TEXTFIELD tf->text.h_offset = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; #else new_width = tf->core.width - (2 * (TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness)); offset = tf->text.h_offset - (TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness); if (tf->text.max_char_size != 1) text_width = FindPixelLength(tf, (char *)TextF_WcValue(tf), tf->text.string_length); else text_width = FindPixelLength(tf, TextF_Value(tf), tf->text.string_length); if (text_width - new_width < -offset) { if (text_width - new_width >= 0) { tf->text.h_offset = (new_width - text_width) + TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; } else { tf->text.h_offset = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; } } #endif tf->text.refresh_ibeam_off = True; (void) AdjustText(tf, TextF_CursorPosition(tf), True); tf->text.do_resize = True; } /************************************************************************ * * QueryGeometry * ************************************************************************/ static XtGeometryResult QueryGeometry(Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired) { /* this function deals with resizeWidth False */ ComputeSize((XmTextFieldWidget) widget, &desired->width, &desired->height); return XmeReplyToQueryGeometry(widget, intended, desired); } /* * Redisplay will redraw shadows, borders, and text. */ /* ARGSUSED */ static void TextFieldExpose(Widget w, XEvent *event, Region region) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XGCValues values; if (event->xany.type != Expose) return; tf->text.do_resize = False; /* I can get here even though the widget isn't visible (i.e. my parent is * sized so that I have nothing visible. In this case, capturing the putback * area yields garbage... And if this area is not in an area where text * will be drawn (i.e. forcing something new/valid to be there next time I * go to capture it) the garbage persists. To prevent this, initialize the * putback area and then update it to a solid background color. */ tf->text.refresh_ibeam_off = False; values.clip_mask = None; values.foreground = tf->core.background_pixel; XChangeGC(XtDisplay(w), tf->text.save_gc, GCForeground|GCClipMask, &values); XFillRectangle(XtDisplay(w), tf->text.ibeam_off, tf->text.save_gc, 0, 0, tf->text.cursor_width, tf->text.cursor_height); values.foreground = tf->primitive.foreground; XChangeGC(XtDisplay(w), tf->text.save_gc, GCForeground, &values); _XmTextFieldDrawInsertionPoint(tf, False); if (XtIsRealized((Widget)tf)) { if (tf->primitive.shadow_thickness > 0) XmeDrawShadows(XtDisplay(tf), XtWindow(tf), tf->primitive.bottom_shadow_GC, tf->primitive.top_shadow_GC, (int) tf->primitive.highlight_thickness, (int) tf->primitive.highlight_thickness, (int) (tf->core.width - (2 * tf->primitive.highlight_thickness)), (int) (tf->core.height - (2 * tf->primitive.highlight_thickness)), (int) tf->primitive.shadow_thickness, XmSHADOW_OUT); if (tf->primitive.highlighted) { if (((XmTextFieldWidgetClass)XtClass(tf)) ->primitive_class.border_highlight) { (*((XmTextFieldWidgetClass) XtClass(tf)) ->primitive_class.border_highlight)((Widget) tf); } } else { if (((XmTextFieldWidgetClass) XtClass(tf)) ->primitive_class.border_unhighlight) { (*((XmTextFieldWidgetClass) XtClass(tf)) ->primitive_class.border_unhighlight)((Widget) tf); } } RedisplayText(tf, 0, tf->text.string_length); } tf->text.refresh_ibeam_off = True; _XmTextFieldDrawInsertionPoint(tf, True); tf->text.do_resize = True; } /* * * SetValues * Checks the new text data and ensures that the data is valid. * Invalid values will be rejected and changed back to the old * values. * */ /* ARGSUSED */ static Boolean SetValues(Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args) { XmTextFieldWidget new_tf = (XmTextFieldWidget) new_w; XmTextFieldWidget old_tf = (XmTextFieldWidget) old; Boolean cursor_pos_set = False; Boolean new_size = False; Boolean redisplay = False; Boolean redisplay_text = False; Boolean new_font = False; Boolean mod_ver_ret = False; Boolean diff_values = False; Dimension new_width = new_tf->core.width; Dimension new_height = new_tf->core.height; Arg im_args[10]; XPoint xmim_point; XRectangle xmim_area; XmTextPosition new_position = 0; XmTextPosition newInsert; int n = 0; if (new_w->core.being_destroyed) return False; TextFieldResetIC(old); new_tf->text.in_setvalues = True; new_tf->text.redisplay = False; /* If new cursor position, copy the old cursor pos to the new widget * so that when we turn off the i-beam, the current location (old * widget) is used, but the new i-beam parameters (on/off, state, ...) * are utilized. Then move the cursor. Otherwise, just turn off * the i-beam. */ if (TextF_CursorPosition(new_tf) != TextF_CursorPosition(old_tf)) { new_position = TextF_CursorPosition(new_tf); TextF_CursorPosition(new_tf) = TextF_CursorPosition(old_tf); _XmTextFieldDrawInsertionPoint(old_tf, False); new_tf->text.blink_on = old_tf->text.blink_on; new_tf->text.cursor_on = old_tf->text.cursor_on; _XmTextFieldSetCursorPosition(new_tf, NULL, new_position, True, True); (void) SetDestination(new_w, TextF_CursorPosition(new_tf), False, XtLastTimestampProcessed(XtDisplay(new_w))); cursor_pos_set = True; } else { int ix; for (ix = 0; ix < *num_args; ix++) if (strcmp(args[ix].name, XmNcursorPosition) == 0) { cursor_pos_set = True; new_position = TextF_CursorPosition(new_tf); break; } _XmTextFieldDrawInsertionPoint(old_tf, False); new_tf->text.blink_on = old_tf->text.blink_on; new_tf->text.cursor_on = old_tf->text.cursor_on; } if (!XtIsSensitive(new_w) && new_tf->text.has_destination) { (void) SetDestination(new_w, TextF_CursorPosition(new_tf), True, XtLastTimestampProcessed(XtDisplay(new_w))); } if (TextF_SelectionArray(new_tf) == NULL) TextF_SelectionArray(new_tf) = TextF_SelectionArray(old_tf); if (TextF_SelectionArrayCount(new_tf) <= 0) TextF_SelectionArrayCount(new_tf) = TextF_SelectionArrayCount(old_tf); /* * Fix for HaL DTS 9841 - If the new and old selectionArrays do not match, * free the old array and then copy the new array. */ if (TextF_SelectionArray(new_tf) != TextF_SelectionArray(old_tf)) { XtPointer temp_ptr; XtFree((char *)TextF_SelectionArray(old_tf)); temp_ptr = (XtPointer)TextF_SelectionArray(new_tf); TextF_SelectionArray(new_tf) = (XmTextScanType *)XtMalloc(TextF_SelectionArrayCount(new_tf) * sizeof(XmTextScanType)); memcpy((void *)TextF_SelectionArray(new_tf), (void *)temp_ptr, (TextF_SelectionArrayCount(new_tf) * sizeof(XmTextScanType))); } /* * End fix for HaL DTS 9841 */ /* Make sure the new_tf cursor position is a valid value. */ if (TextF_CursorPosition(new_tf) < 0) { XmeWarning (new_w, MSG1); TextF_CursorPosition(new_tf) = TextF_CursorPosition(old_tf); cursor_pos_set = False; } if (TextF_FontList(new_tf)!= TextF_FontList(old_tf)) { new_font = True; if (TextF_FontList(new_tf) == NULL) TextF_FontList(new_tf) = XmeGetDefaultRenderTable(new_w, XmTEXT_FONTLIST); TextF_FontList(new_tf) = (XmFontList)XmFontListCopy(TextF_FontList(new_tf)); if (!LoadFontMetrics(new_tf)) { /* Fails if font set required but not * available. */ XmFontListFree((XmFontList)TextF_FontList(new_tf)); TextF_FontList(new_tf) = TextF_FontList(old_tf); (void)LoadFontMetrics(new_tf); /* it *was* correct, so re-use it */ new_font = False; } else { XtSetArg(im_args[n], XmNfontList, TextF_FontList(new_tf)); n++; redisplay = True; } } /* Four cases to handle for value: * 1. user set both XmNvalue and XmNwcValue. * 2. user set the opposite resource (i.e. value is a char* * and user set XmNwcValue, or vice versa). * 3. user set the corresponding resource (i.e. value is a char* * and user set XmNValue, or vice versa). * 4. user set neither XmNValue nor XmNwcValue */ /* OSF says: if XmNvalueWcs set, it overrides all else */ if (new_tf->text.max_char_size == 1) { /* wc_value on new will be NULL unless XmNvalueWcs was set. */ if (TextF_WcValue(new_tf) != NULL) { /* must be new if MB_CUR... == 1 */ ValidateString(new_tf, (char*) TextF_WcValue(new_tf), True); diff_values = True; } else if (TextF_Value(new_tf) != TextF_Value(old_tf)) { diff_values = True; if (TextF_Value(new_tf) == NULL) { ValidateString(new_tf, "", False); } else ValidateString(new_tf, TextF_Value(new_tf), False); } /* else, no change so don't do anything */ } else { if (TextF_WcValue(new_tf) != TextF_WcValue(old_tf)) { diff_values = True; if (TextF_WcValue(new_tf) == NULL) { TextF_WcValue(new_tf) = (wchar_t*) XtMalloc(sizeof(wchar_t)); *TextF_WcValue(new_tf) = (wchar_t)NULL; } ValidateString(new_tf, (char*)TextF_WcValue(new_tf), True); } else if (TextF_Value(new_tf) != TextF_Value(old_tf)) { /* Someone set XmNvalue */ diff_values = True; if (TextF_Value(new_tf) == NULL) ValidateString(new_tf, "", True); else ValidateString(new_tf, TextF_Value(new_tf), False); } /* else, no change so don't do anything */ } if (diff_values) { /* old value != new value */ Boolean do_it = True; /* If there are modify verify callbacks, verify that we want to continue * the action. */ if (TextF_ModifyVerifyCallback(new_tf) || TextF_ModifyVerifyCallbackWcs(new_tf)) { /* If the function ModifyVerify() returns false then don't * continue with the action. */ char *temp, *old; int free_insert = (int)False; XmTextPosition fromPos = 0, toPos; int ret_val = 0; toPos = old_tf->text.string_length; if (new_tf->text.max_char_size == 1) { temp = TextF_Value(new_tf); mod_ver_ret = ModifyVerify(new_tf, NULL, &fromPos, &toPos, &temp, &new_tf->text.string_length, &newInsert, &free_insert); } else { old = temp = XtMalloc((unsigned)((new_tf->text.string_length + 1) * new_tf->text.max_char_size)); ret_val = wcstombs(temp, TextF_WcValue(new_tf), (new_tf->text.string_length + 1) * new_tf->text.max_char_size); if (ret_val < 0) temp[0] = '\0'; /* Fixed bug #1214. ModifyVerify needs wchar_t*, not char*. */ /* old code: mod_ver_ret = ModifyVerify(new_tf, NULL, &fromPos, &toPos, &temp, &new_tf->text.string_length, &newInsert, &free_insert); */ #ifdef FIX_1409 mod_ver_ret = ModifyVerify(new_tf, NULL, &fromPos, &toPos, &temp, &ret_val, &newInsert, &free_insert); #else mod_ver_ret = ModifyVerify(new_tf, NULL, &fromPos, &toPos, (char**)&TextF_WcValue(new_tf), &ret_val, &newInsert, &free_insert); #endif /* end if fix of bug #1214 */ if (old != temp) XtFree (old); } if (free_insert) XtFree(temp); if (!mod_ver_ret) { if (new_tf->text.verify_bell) XBell(XtDisplay(new_w), 0); if (new_tf->text.max_char_size == 1) { TextF_Value(new_tf) = (char *) memcpy(XtRealloc(TextF_Value(new_tf), (unsigned)old_tf->text.size_allocd), (void*)TextF_Value(old_tf), old_tf->text.string_length + 1); new_tf->text.string_length = old_tf->text.string_length; new_tf->text.size_allocd = old_tf->text.size_allocd; XtFree(TextF_Value(old_tf)); } else { /* realloc to old size, cast to wchar_t*, and copy the data */ TextF_WcValue(new_tf) = (wchar_t*)memcpy( XtRealloc((char *)TextF_WcValue(new_tf), (unsigned)old_tf->text.size_allocd), (void*)TextF_WcValue(old_tf), (size_t) old_tf->text.size_allocd); new_tf->text.string_length = old_tf->text.string_length; new_tf->text.size_allocd = old_tf->text.size_allocd; XtFree((char *)TextF_WcValue(old_tf)); } do_it = False; } } if (do_it) { XmAnyCallbackStruct cb; if (new_tf->text.max_char_size == 1) XtFree(TextF_Value(old_tf)); else XtFree((char *)TextF_WcValue(old_tf)); doSetHighlight(new_w, new_tf->text.prim_pos_left, new_tf->text.prim_pos_right, XmHIGHLIGHT_NORMAL); new_tf->text.pending_off = True; /* if new_position was > old_tf->text.string_length, last time * the SetCursorPosition didn't take. */ if (!cursor_pos_set || new_position > old_tf->text.string_length) { _XmTextFieldSetCursorPosition(new_tf, NULL, new_position, True, False); if (new_tf->text.has_destination) (void) SetDestination(new_w, TextF_CursorPosition(new_tf), False, XtLastTimestampProcessed(XtDisplay(new_w))); } if (TextF_ResizeWidth(new_tf) && new_tf->text.do_resize) AdjustSize(new_tf); else { new_tf->text.h_offset = TextF_MarginWidth(new_tf) + new_tf->primitive.shadow_thickness + new_tf->primitive.highlight_thickness; if (!AdjustText(new_tf, TextF_CursorPosition(new_tf), False)) redisplay_text = True; } cb.reason = XmCR_VALUE_CHANGED; cb.event = NULL; XtCallCallbackList(new_w, TextF_ValueChangedCallback(new_tf), (XtPointer) &cb); } } if (new_tf->primitive.foreground != old_tf->primitive.foreground || TextF_FontList(new_tf)!= TextF_FontList(old_tf) || new_tf->core.background_pixel != old_tf->core.background_pixel) { LoadGCs(new_tf, new_tf->primitive.foreground, new_tf->core.background_pixel); MakeCursors(new_tf); redisplay = True; XtSetArg(im_args[n], XmNbackground, new_tf->core.background_pixel); n++; XtSetArg(im_args[n], XmNforeground, new_tf->primitive.foreground); n++; } if (new_tf->text.has_focus && XtIsSensitive((Widget)new_tf) && TextF_BlinkRate(new_tf) != TextF_BlinkRate(old_tf)) { if (TextF_BlinkRate(new_tf) == 0) { new_tf->text.blink_on = True; if (new_tf->text.timer_id) { XtRemoveTimeOut(new_tf->text.timer_id); new_tf->text.timer_id = (XtIntervalId)0; } } else if (new_tf->text.timer_id == (XtIntervalId)0) { new_tf->text.timer_id = XtAppAddTimeOut(XtWidgetToApplicationContext(new_w), (unsigned long)TextF_BlinkRate(new_tf), HandleTimer, (XtPointer) new_tf); } BlinkInsertionPoint(new_tf); } if (TextF_MarginHeight(new_tf) != TextF_MarginHeight(old_tf)) { new_tf->text.margin_top = TextF_MarginHeight(new_tf); new_tf->text.margin_bottom = TextF_MarginHeight(new_tf); } new_size = TextF_MarginWidth(new_tf) != TextF_MarginWidth(old_tf) || TextF_MarginHeight(new_tf) != TextF_MarginHeight(old_tf) || TextF_FontList(new_tf) != TextF_FontList(old_tf) || new_tf->primitive.highlight_thickness != old_tf->primitive.highlight_thickness || new_tf->primitive.shadow_thickness != old_tf->primitive.shadow_thickness; if (TextF_Columns(new_tf) < 0) { XmeWarning (new_w, MSG7); TextF_Columns(new_tf) = TextF_Columns(old_tf); } if (!(new_width != old_tf->core.width && new_height != old_tf->core.height)) { if (TextF_Columns(new_tf) != TextF_Columns(old_tf) || new_size) { Dimension width, height; ComputeSize(new_tf, &width, &height); AdjustText(new_tf, 0, False); if (new_width == old_tf->core.width) new_w->core.width = width; if (new_height == old_tf->core.height) new_w->core.height = height; new_tf->text.h_offset = TextF_MarginWidth(new_tf) + new_tf->primitive.shadow_thickness + new_tf->primitive.highlight_thickness; redisplay = True; } } else { if (new_width != new_tf->core.width) new_tf->core.width = new_width; if (new_height != new_tf->core.height) new_tf->core.height = new_height; } new_tf->text.refresh_ibeam_off = True; /* force update of putback area */ _XmTextFieldDrawInsertionPoint(new_tf, True); if (XtIsSensitive((Widget)new_tf) != XtIsSensitive((Widget)old_tf)) { if (XtIsSensitive(new_w)) { _XmTextFieldDrawInsertionPoint(new_tf, False); new_tf->text.blink_on = False; _XmTextFieldDrawInsertionPoint(new_tf, True); } else { if (new_tf->text.has_focus) { ChangeBlinkBehavior(new_tf, False); _XmTextFieldDrawInsertionPoint(new_tf, False); new_tf->text.has_focus = False; new_tf->text.blink_on = True; _XmTextFieldDrawInsertionPoint(new_tf, True); (void) VerifyLeave(new_tf, NULL); } } if (new_tf->text.string_length > 0) redisplay = True; } (void)TextFieldGetDisplayRect((Widget)new_tf, &xmim_area); GetXYFromPos(new_tf, TextF_CursorPosition(new_tf), &xmim_point.x, &xmim_point.y); if (TextF_Editable(old_tf) != TextF_Editable(new_tf)) { Boolean editable = TextF_Editable(new_tf); TextF_Editable(new_tf) = TextF_Editable(old_tf); XmTextFieldSetEditable(new_w, editable); } else if (new_font && TextF_Editable(new_tf)) { /* We want to be able to connect to an IM if XmNfontList has changed. */ TextF_Editable(new_tf) = False; XmTextFieldSetEditable(new_w, True); } XtSetArg(im_args[n], XmNbackgroundPixmap, new_tf->core.background_pixmap); n++; XtSetArg(im_args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(im_args[n], XmNarea, &xmim_area); n++; XtSetArg(im_args[n], XmNlineSpace, TextF_FontAscent(new_tf) + TextF_FontDescent(new_tf)); n++; XmImSetValues((Widget)new_tf, im_args, n); if (new_font) XmFontListFree((XmFontList)TextF_FontList(old_tf)); if (!redisplay) redisplay = new_tf->text.redisplay; /* If I'm forced to redisplay, then actual widget won't be updated * until the expose proc. Force the ibeam putback to be refreshed * at expose time so that it reflects true visual state of the * widget. */ if (redisplay) new_tf->text.refresh_ibeam_off = True; new_tf->text.in_setvalues = False; if ((!TextF_Editable(new_tf) || !XtIsSensitive(new_w)) && new_tf->text.has_destination) (void) SetDestination(new_w, 0, False, (Time)0); /* don't shrink to nothing */ if (new_tf->core.width == 0) new_tf->core.width = old_tf->core.width; if (new_tf->core.height == 0) new_tf->core.height = old_tf->core.height; if (!redisplay && redisplay_text) RedisplayText(new_tf, 0, new_tf->text.string_length); return redisplay; } /******************************************** * AccessTextual trait method implementation ********************************************/ static XtPointer TextFieldGetValue(Widget w, int format) { char *str; XmString tmp; switch(format) { case XmFORMAT_XmSTRING: str = XmTextFieldGetString(w); tmp = XmStringCreateLocalized(str); if (str != NULL) XtFree(str); return((XtPointer) tmp); case XmFORMAT_MBYTE: return((XtPointer) XmTextFieldGetString(w)); case XmFORMAT_WCS: return((XtPointer) XmTextFieldGetStringWcs(w)); } return(NULL); } static void TextFieldSetValue(Widget w, XtPointer s, int format) { char *str; switch(format) { case XmFORMAT_XmSTRING: str = _XmStringGetTextConcat((XmString) s); XmTextFieldSetString(w, str); if (str != NULL) XtFree(str); break; case XmFORMAT_MBYTE: XmTextFieldSetString(w, (char*) s); break; case XmFORMAT_WCS: XmTextFieldSetStringWcs(w, (wchar_t *) s); } } /*ARGSUSED*/ static int TextFieldPreferredValue(Widget w) /* unused */ { return(XmFORMAT_MBYTE); } /* * XmRCallProc routine for checking text.font_list before setting it to NULL * if no value is specified for both XmNrenderTable and XmNfontList. * If "check_set_render_table" == True, then function has been called twice * on same widget, thus resource needs to be set NULL, otherwise leave it * alone. */ /* ARGSUSED */ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmTextFieldWidget tf = (XmTextFieldWidget)wid; if (tf->text.check_set_render_table) value->addr = NULL; else { tf->text.check_set_render_table = True; value->addr = (char*)&(tf->text.font_list); } } static Boolean TextFieldRemove(Widget w, XEvent *event) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition left = tf->text.prim_pos_left, right = tf->text.prim_pos_right; XmAnyCallbackStruct cb; if (TextF_Editable(tf) == False) return False; TextFieldResetIC(w); if (!tf->text.has_primary || left == right) { tf->text.prim_anchor = TextF_CursorPosition(tf); return False; } if (_XmTextFieldReplaceText(tf, event, left, right, NULL, 0, True)) { _XmTextFieldStartSelection(tf, TextF_CursorPosition(tf), TextF_CursorPosition(tf), XtLastTimestampProcessed(XtDisplay(w))); tf->text.pending_off = False; cb.reason = XmCR_VALUE_CHANGED; cb.event = event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } tf->text.prim_anchor = TextF_CursorPosition(tf); return True; } /* ARGSUSED */ static Boolean TextFieldGetBaselines(Widget w, Dimension ** baselines, int *line_count) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Dimension *base_array; *line_count = 1; base_array = (Dimension *) XtMalloc(sizeof(Dimension)); base_array[0] = tf->text.margin_top + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness + TextF_FontAscent(tf); *baselines = base_array; return (TRUE); } static Boolean TextFieldGetDisplayRect(Widget w, XRectangle * display_rect) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Position margin_width = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Position margin_top = tf->text.margin_top + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; Position margin_bottom = tf->text.margin_bottom + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; (*display_rect).x = margin_width; (*display_rect).y = margin_top; (*display_rect).width = tf->core.width - (2 * margin_width); (*display_rect).height = tf->core.height - (margin_top + margin_bottom); return(TRUE); } /* ARGSUSED */ static void TextFieldMarginsProc(Widget w, XmBaselineMargins *margins_rec) { XmTextFieldWidget tf = (XmTextFieldWidget) w; if (margins_rec->get_or_set == XmBASELINE_SET) { tf->text.margin_top = margins_rec->margin_top; } else { margins_rec->margin_top = tf->text.margin_top; margins_rec->margin_bottom = tf->text.margin_bottom; margins_rec->text_height = TextF_FontAscent(tf) + TextF_FontDescent(tf); margins_rec->shadow = tf->primitive.shadow_thickness; margins_rec->highlight = tf->primitive.highlight_thickness; margins_rec->margin_height = 0; } } /* * This procedure and _XmTextFieldReplaceText are almost same. * The difference is that this function doesn't call user's callbacks, * like XmNmodifyVerifyCallback. */ static Boolean _XmTextFieldReplaceTextForPreedit(XmTextFieldWidget tf, XmTextPosition replace_prev, XmTextPosition replace_next, char *insert, int insert_length, Boolean move_cursor ) { int replace_length, i; char *src, *dst; wchar_t *wc_src, *wc_dst; XmAnyCallbackStruct cb; int delta = 0; XmTextPosition cursorPos, newInsert; XmTextPosition old_pos = replace_prev; XmTextPosition redisplay_start; int free_insert = (int)False; VerifyBounds(tf, &replace_prev, &replace_next); if (!TextF_Editable(tf)) { if (tf->text.verify_bell) XBell(XtDisplay((Widget)tf), 0); return False; } /* * If composite sequences were supported, we had to * redisplay from the nearest composite sequence break. * But for current implementation, just use old_pos. */ redisplay_start = old_pos; replace_length = (int) (replace_next - replace_prev); delta = insert_length - replace_length; /* Disallow insertions that go beyond max length boundries. */ if ((delta >= 0) && ((tf->text.string_length + delta) - (TextF_MaxLength(tf)) > 0)) { if (tf->text.verify_bell) XBell(XtDisplay(tf), 0); return False; } newInsert = TextF_CursorPosition(tf); /* make sure selections are turned off prior to changeing text */ if (tf->text.has_primary && tf->text.prim_pos_left != tf->text.prim_pos_right) doSetHighlight((Widget)tf, tf->text.prim_pos_left, tf->text.prim_pos_right, XmHIGHLIGHT_NORMAL); _XmTextFieldDrawInsertionPoint(tf, False); /* Allocate more space if we need it. */ if (tf->text.max_char_size == 1){ if (tf->text.string_length + insert_length - replace_length >= tf->text.size_allocd) { tf->text.size_allocd += MAX(insert_length + TEXT_INCREMENT, (tf->text.size_allocd * 2)); tf->text.value = (char *) XtRealloc((char*)TextF_Value(tf), (unsigned) (tf->text.size_allocd * sizeof(char))); } } else { if ((tf->text.string_length + insert_length - replace_length) * sizeof(wchar_t) >= tf->text.size_allocd) { tf->text.size_allocd += MAX(insert_length + TEXT_INCREMENT, (tf->text.size_allocd * 2)); tf->text.wc_value = (wchar_t *) XtRealloc((char*)TextF_WcValue(tf), (unsigned) (sizeof(wchar_t) * tf->text.size_allocd)); } } if (tf->text.max_char_size == 1) { if (replace_length > insert_length) /* We need to shift the text at and after replace_next to the left. */ for (src = TextF_Value(tf) + replace_next, dst = src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; ++src, ++dst, --i) *dst = *src; else if (replace_length < insert_length) /* We need to shift the text at and after replace_next to the right. */ /* Need to add 1 to string_length to handle the NULL terminator on */ /* the string. */ for (src = TextF_Value(tf) + tf->text.string_length, dst = src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; --src, --dst, --i) *dst = *src; /* Update the string. */ if (insert_length != 0) { for (src = insert, dst = TextF_Value(tf) + replace_prev, i = insert_length; i > 0; ++src, ++dst, --i) *dst = *src; } } else { /* have wchar_t* data */ if (replace_length > insert_length) /* We need to shift the text at and after replace_next to the left. */ for (wc_src = TextF_WcValue(tf) + replace_next, wc_dst = wc_src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; ++wc_src, ++wc_dst, --i) *wc_dst = *wc_src; else if (replace_length < insert_length) /* We need to shift the text at and after replace_next to the right. */ /* Need to add 1 to string_length to handle the NULL terminator on */ /* the string. */ for (wc_src = TextF_WcValue(tf) + tf->text.string_length, wc_dst = wc_src + (insert_length - replace_length), i = (int) ((tf->text.string_length + 1) - replace_next); i > 0; --wc_src, --wc_dst, --i) *wc_dst = *wc_src; /* Update the string. */ if (insert_length != 0) { for (wc_src = (wchar_t *)insert, wc_dst = TextF_WcValue(tf) + replace_prev, i = insert_length; i > 0; ++wc_src, ++wc_dst, --i) *wc_dst = *wc_src; } } tf->text.string_length += insert_length - replace_length; if (move_cursor) { if (TextF_CursorPosition(tf) != newInsert) { if (newInsert > tf->text.string_length) { cursorPos = tf->text.string_length; } else if (newInsert < 0) { cursorPos = 0; } else { cursorPos = newInsert; } } else cursorPos = replace_next + (insert_length - replace_length); (void) SetDestination((Widget)tf, cursorPos, False, XtLastTimestampProcessed(XtDisplay((Widget)tf))); PreeditSetCursorPosition(tf, cursorPos); } if (TextF_ResizeWidth(tf) && tf->text.do_resize) { AdjustSize(tf); } else { AdjustText(tf, TextF_CursorPosition(tf), False); /* * If composite sequences where supported, we had to * adjust redisplay_start once more here, since the widget * value was updated. * But for current implementation, there is no need * to do so. */ RedisplayText(tf, redisplay_start, tf->text.string_length); } _XmTextFieldDrawInsertionPoint(tf, True); if (free_insert) XtFree(insert); return True; } /* * This function shows the correspondence of rendition data between the input * server and XmTextField */ static XmHighlightMode _XimFeedbackToXmHighlightMode(XIMFeedback fb) { switch (fb) { case XIMReverse: return(XmHIGHLIGHT_SELECTED); case XIMUnderline: return(XmHIGHLIGHT_SECONDARY_SELECTED); case XIMHighlight: return(XmHIGHLIGHT_NORMAL); case XIMPrimary: return(XmHIGHLIGHT_SELECTED); case XIMSecondary: return(XmHIGHLIGHT_SECONDARY_SELECTED); case XIMTertiary: return(XmHIGHLIGHT_SELECTED); default: return(XmHIGHLIGHT_NORMAL); } } /* * This function treats the rendition data. */ static void PreeditSetRendition(Widget w, XIMPreeditDrawCallbackStruct* data) { XIMText *text = data->text; int cnt; XIMFeedback fb; XmTextPosition prestart = PreStart((XmTextFieldWidget)w)+data->chg_first, left, right; XmHighlightMode mode; XmTextFieldWidget tf = (XmTextFieldWidget)w; if (!text->length) { return; } if (!text->feedback) return; fb = text->feedback[0]; /* initial feedback */ left = right = prestart; /* mode start/end position */ mode = _XimFeedbackToXmHighlightMode(fb); /* mode */ cnt = 1; /* counter initialize */ while (cnt < (int)text->length) { if (fb != text->feedback[cnt]) { right = prestart + cnt; doSetHighlight(w, left, right, mode); left = right; /* start position update */ fb = text->feedback[cnt]; /* feedback update */ mode = _XimFeedbackToXmHighlightMode(fb); } cnt++; /* counter increment */ } doSetHighlight(w, left, (prestart + cnt), mode); /* for the last segment */ } /* * This function and _XmTextFieldSetCursorPosition are almost same. The * difference is that this function don't call user's callbacks link * XmNmotionVerifyCallback. */ static void PreeditSetCursorPosition(XmTextFieldWidget tf, XmTextPosition position) { int i; _XmHighlightRec *hl_list = tf->text.highlight.list; if (position < 0) position = 0; if (position > tf->text.string_length) position = tf->text.string_length; _XmTextFieldDrawInsertionPoint(tf, False); TextF_CursorPosition(tf) = position; for (i = tf->text.highlight.number - 1; i >= 0; i--){ if (position >= hl_list[i].position || i == 0) break; } if (position == hl_list[i].position) ResetImageGC(tf); else if (hl_list[i].mode != XmHIGHLIGHT_SELECTED) ResetImageGC(tf); else InvertImageGC(tf); ResetClipOrigin(tf); tf->text.refresh_ibeam_off = True; _XmTextFieldDrawInsertionPoint(tf, True); } static void PreeditVerifyReplace(XmTextFieldWidget tf, XmTextPosition start, XmTextPosition end, char *insert, char insert_length, XmTextPosition cursor, Boolean *end_preedit) { FUnderVerifyPreedit(tf) = True; _XmTextFieldReplaceText(tf, NULL, start, end, insert, insert_length, True); FUnderVerifyPreedit(tf) = False; if (FVerifyCommitNeeded(tf)) { TextFieldResetIC((Widget) tf); *end_preedit = True; } _XmTextFieldSetCursorPosition(tf, NULL, cursor, False, True); } /* * This is the function set to XNPreeditStartCallback resource. * This function is called when the preedit process starts. * Initialize the preedit data and also treat pending delete. */ static int PreeditStart(XIC xic, XPointer client_data, XPointer call_data) { XmTextPosition cursorPos, nextPos, lastPos; Boolean replace_res, pending_delete = False; wchar_t *wc; char *mb; Widget w = (Widget) client_data; XmTextFieldWidget tf = (XmTextFieldWidget) client_data; tf->text.onthespot->over_len = 0; tf->text.onthespot->over_str = NULL; tf->text.onthespot->over_maxlen = 0; /* If TextField is not editable, returns 0. So input server never */ /* call Preedit Draw callback */ if (!TextF_Editable(tf)) { if (tf->text.verify_bell) XBell(XtDisplay((Widget)tf), 0); tf->text.onthespot->under_preedit = False; return 0; } if (NeedsPendingDeleteDisjoint(tf)){ _XmTextFieldDrawInsertionPoint(tf, False); if (!XmTextFieldGetSelectionPosition(w, &cursorPos, &nextPos) || cursorPos == nextPos) { tf->text.prim_anchor = TextF_CursorPosition(tf); } pending_delete = True; tf->text.prim_anchor = TextF_CursorPosition(tf); replace_res = _XmTextFieldReplaceText(tf, NULL, cursorPos, nextPos, NULL, 0, True); if (replace_res){ if (pending_delete) XmTextFieldSetSelection(w, TextF_CursorPosition(tf), TextF_CursorPosition(tf), XtLastTimestampProcessed(XtDisplay((Widget)tf))); CheckDisjointSelection(w, TextF_CursorPosition(tf), XtLastTimestampProcessed(XtDisplay((Widget)tf))); _XmTextFieldSetCursorPosition(tf, NULL, TextF_CursorPosition(tf), False, True); } _XmTextFieldDrawInsertionPoint(tf, True); } PreStart(tf) = PreEnd(tf) = PreCursor(tf) = TextF_CursorPosition(tf); tf->text.onthespot->under_preedit = True; if (tf->text.overstrike) { lastPos = tf->text.string_length; tf->text.onthespot->over_len = lastPos - PreCursor(tf); if (tf->text.max_char_size == 1){ mb = XtMalloc(tf->text.onthespot->over_len + 1); bcopy(&tf->text.value[PreStart(tf)], mb, tf->text.onthespot->over_len); mb[tf->text.onthespot->over_len] = '\0'; tf->text.onthespot->over_str = mb; } else { wc = (wchar_t *) XtMalloc( (tf->text.onthespot->over_len+1)*sizeof(wchar_t)); bcopy((char *)&tf->text.wc_value[PreStart(tf)], (char *)wc, tf->text.onthespot->over_len*sizeof(wchar_t)); wc[tf->text.onthespot->over_len] = (wchar_t)'\0'; tf->text.onthespot->over_str = (char *)wc; } } return (-1); } /* * This is the function set to XNPreeditDoneCallback resource. * This function is called when the preedit process is finished. */ static void PreeditDone(XIC xic, XPointer client_data, XPointer call_data) { Boolean replace_res; XmTextFieldWidget tf = (XmTextFieldWidget)client_data; Widget p = (Widget) tf; Boolean need_verify, end_preedit = False; if (!TextF_Editable(tf)) return; while (!XtIsShell(p)) p = XtParent(p); XtVaGetValues(p, XmNverifyPreedit, &need_verify, NULL); if (PreEnd(tf) > PreStart(tf)) { if (need_verify) { PreeditVerifyReplace(tf, PreStart(tf), PreEnd(tf), NULL, 0, PreStart(tf), &end_preedit); if (end_preedit) return; } else _XmTextFieldReplaceTextForPreedit(tf, PreStart(tf), PreEnd(tf), NULL, 0, True ); } if (tf->text.overstrike){ if (need_verify) { int cur = PreStart(tf); PreeditVerifyReplace(tf, PreStart(tf), PreStart(tf), (char*) tf->text.onthespot->over_str, tf->text.onthespot->over_maxlen, PreStart(tf), &end_preedit); if (end_preedit) return; } else { _XmTextFieldDrawInsertionPoint(tf, False); replace_res = _XmTextFieldReplaceTextForPreedit(tf, PreStart(tf), PreStart(tf), (char*) tf->text.onthespot->over_str, tf->text.onthespot->over_maxlen, True); TextF_CursorPosition(tf) = PreStart(tf); PreeditSetCursorPosition(tf, TextF_CursorPosition(tf)); _XmTextFieldDrawInsertionPoint(tf, True); } XtFree((char *)tf->text.onthespot->over_str); tf->text.onthespot->over_len = tf->text.onthespot->over_maxlen = 0; } PreStart(tf) = PreEnd(tf) = PreCursor(tf) = 0; tf->text.onthespot->under_preedit = False; } /* * This is the function set to XNPreeditDrawCallback resource. * This function is called when the input server requests XmTextField * to draw a preedit string. */ static void PreeditDraw(XIC xic, XPointer client_data, XIMPreeditDrawCallbackStruct *call_data) { Widget w = (Widget) client_data; XmTextFieldWidget tf = (XmTextFieldWidget) client_data; int escapement, insert_length = 0; char *mb = NULL, *over_mb = NULL; wchar_t *wc = NULL, *over_wc = NULL, *tab_wc = NULL , *recover_wc = NULL; XmTextPosition startPos, endPos, cursorPos, rest_len =0 , tmp_end; Boolean replace_res; XRectangle overall_ink; int i; int recover_len=0; char *ptr=NULL; Widget p =w; Boolean need_verify, end_preedit = False; if (!TextF_Editable(tf)) return; if (call_data->text && (insert_length = call_data->text->length) > TEXT_MAX_INSERT_SIZE) return; if (call_data->chg_length>PreEnd(tf)-PreStart(tf)) call_data->chg_length = PreEnd(tf)-PreStart(tf); while (!XtIsShell(p)) p = XtParent(p); XtVaGetValues(p, XmNverifyPreedit, &need_verify, NULL); _XmTextFieldDrawInsertionPoint(tf, False); doSetHighlight(w, PreStart(tf)+call_data->chg_first, PreStart(tf)+call_data->chg_first + call_data->chg_length, XmHIGHLIGHT_NORMAL); if (!tf->text.overstrike && (!call_data->text || !insert_length)) { startPos = PreStart(tf) + call_data->chg_first; endPos = startPos + call_data->chg_length; PreEnd(tf) -= endPos - startPos; if (need_verify) { PreeditVerifyReplace(tf, startPos, endPos, NULL, 0, startPos, &end_preedit); if (end_preedit) { _XmTextFieldDrawInsertionPoint(tf, True); return; } } else { replace_res = _XmTextFieldReplaceTextForPreedit(tf, startPos, endPos, NULL, 0, True); } _XmTextFieldDrawInsertionPoint(tf, True); return; } if (call_data->text) { if ((call_data->text->encoding_is_wchar && !call_data->text->string.wide_char) || (!call_data->text->encoding_is_wchar && !call_data->text->string.multi_byte)){ PreeditSetRendition(w, call_data); PreeditSetCursorPosition(tf, TextF_CursorPosition(tf)); _XmTextFieldDrawInsertionPoint(tf, True); return; } } if (insert_length > 0){ if (TextF_UseFontSet(tf)){ if (call_data->text->encoding_is_wchar){ escapement = XwcTextExtents((XFontSet)TextF_Font(tf), call_data->text->string.wide_char, insert_length, &overall_ink, NULL); tab_wc = (wchar_t*) XtMalloc((unsigned)(1+1) * sizeof(wchar_t)); mbstowcs(tab_wc, "\t", 1); if ( escapement == 0 && overall_ink.width == 0 && wcschr(call_data->text->string.wide_char, *tab_wc) == 0){ /* cursor on */ XtFree((char *) tab_wc); return; } XtFree((char *) tab_wc); } else { mb = XtMalloc((insert_length+1)*(tf->text.max_char_size)); strcpy(mb, call_data->text->string.multi_byte); escapement = XmbTextExtents((XFontSet)TextF_Font(tf), mb, strlen(mb), &overall_ink, NULL); if ( escapement == 0 && overall_ink.width == 0 && strchr(call_data->text->string.multi_byte, '\t') == 0){ /* cursor on */ if (mb) XtFree(mb); return; } } } } else { mb = XtMalloc(4); mb[0] = '\0'; wc = (wchar_t *) XtMalloc((unsigned) sizeof(wchar_t)); wc[0] = (wchar_t) '\0'; } startPos = PreStart(tf) + call_data->chg_first; endPos = startPos + call_data->chg_length; if (tf->text.overstrike){ startPos = PreStart(tf) + call_data->chg_first; tmp_end = (XmTextPosition)(PreEnd(tf) + insert_length - call_data->chg_length); if (tf->text.onthespot->over_maxlen < tmp_end - PreStart(tf)){ if (tmp_end - PreStart(tf) > tf->text.onthespot->over_len){ endPos = startPos + call_data->chg_length; tf->text.onthespot->over_maxlen = tf->text.onthespot->over_len; } else { endPos = PreEnd(tf) + tmp_end - PreStart(tf) - tf->text.onthespot->over_maxlen; tf->text.onthespot->over_maxlen = tmp_end - PreStart(tf); } } else if (tf->text.onthespot->over_maxlen > tmp_end - PreStart(tf)) { endPos = PreEnd(tf); recover_len = tf->text.onthespot->over_maxlen - tmp_end + PreStart(tf); tf->text.onthespot->over_maxlen = tmp_end - PreStart(tf); } else endPos = startPos + call_data->chg_length; rest_len = (XmTextPosition)(PreEnd(tf) - PreStart(tf) - call_data->chg_first - call_data->chg_length); if (rest_len){ if (tf->text.max_char_size == 1){ over_mb = XtMalloc(rest_len+1); bcopy(&tf->text.value[PreStart(tf)+call_data->chg_first+ call_data->chg_length], over_mb, rest_len); over_mb[rest_len] = '\0'; } else { over_wc = (wchar_t *)XtMalloc((rest_len+1)*sizeof(wchar_t)); bcopy((char *)&tf->text.wc_value[PreStart(tf)+ call_data->chg_first+call_data->chg_length], (char *)over_wc, rest_len*sizeof(wchar_t)); over_wc[rest_len] = (wchar_t)'\0'; } } } if (tf->text.overstrike) PreEnd(tf) = startPos + insert_length; else PreEnd(tf) += insert_length - endPos + startPos; if (PreEnd(tf) < PreStart(tf)) PreEnd(tf) = PreStart(tf); PreCursor(tf) = PreStart(tf) + call_data->caret; if (tf->text.max_char_size == 1) { if (call_data->text) { if (call_data->text->encoding_is_wchar){ mb = XtMalloc((insert_length+1)*sizeof(char)); wcstombs(mb, call_data->text->string.wide_char, insert_length); mb[insert_length] = '\0'; } else { mb = XtMalloc((insert_length+1)*sizeof(char)); strcpy(mb, call_data->text->string.multi_byte); } } if (tf->text.overstrike && rest_len){ mb = XtRealloc(mb, strlen(mb)+strlen(over_mb)+1); strcat(mb, over_mb); XtFree(over_mb); } if (tf->text.overstrike && recover_len > 0) { mb = XtRealloc(mb, strlen(mb)+(recover_len+1)); ptr = tf->text.onthespot->over_str + tf->text.onthespot->over_maxlen; i = strlen(mb); strncat(mb, ptr, recover_len); mb[i+recover_len] = '\0'; } if (need_verify) { PreeditVerifyReplace(tf, startPos, endPos, mb, strlen(mb), PreCursor(tf), &end_preedit); if (end_preedit) { _XmTextFieldDrawInsertionPoint(tf, True); return; } } else { replace_res = _XmTextFieldReplaceTextForPreedit(tf, startPos, endPos, mb, strlen(mb), True); PreeditSetCursorPosition(tf, PreCursor(tf)); } } else { if (call_data->text) { if (!call_data->text->encoding_is_wchar){ wc = (wchar_t*)XtMalloc((unsigned)(insert_length+1) * sizeof(wchar_t)); mbstowcs( wc, call_data->text->string.multi_byte, insert_length); } else { wc = (wchar_t*)XtMalloc((unsigned)(insert_length+1) * sizeof(wchar_t)); wcscpy(wc, call_data->text->string.wide_char); } wc[insert_length] = (wchar_t) '\0'; } if (tf->text.overstrike && rest_len){ wc = (wchar_t *)XtRealloc((char *)wc, (insert_length+rest_len+1)*sizeof(wchar_t)); wcscat(wc, over_wc); XtFree((char *)over_wc); } if (tf->text.overstrike && recover_len > 0) { wc = (wchar_t *)XtRealloc((char *)wc, wcslen(wc)+(recover_len+1)*sizeof(wchar_t)); ptr = XtMalloc((tf->text.onthespot->over_len+1)*sizeof(char)); wcstombs(ptr, (wchar_t *)tf->text.onthespot->over_str, tf->text.onthespot->over_len); ptr[tf->text.onthespot->over_len] = '\0'; for (i=0; i < tf->text.onthespot->over_maxlen; i++) { ptr += mblen(ptr, 4); } recover_wc = (wchar_t*) XtMalloc((unsigned)(recover_len+1) * sizeof(wchar_t)); mbstowcs(recover_wc, ptr, recover_len); i = wcslen(wc); wcsncat(wc, recover_wc, recover_len); wc[i+recover_len] = (wchar_t) '\0'; XtFree((char *) recover_wc); if (ptr) XtFree(ptr); } if (need_verify) { PreeditVerifyReplace(tf, startPos, endPos, (char *)wc, wcslen(wc), PreCursor(tf), &end_preedit); if (end_preedit) { _XmTextFieldDrawInsertionPoint(tf, True); return; } } else { replace_res = _XmTextFieldReplaceTextForPreedit(tf, startPos, endPos, (char *)wc, wcslen(wc), True); PreeditSetCursorPosition(tf, PreCursor(tf)); } } if (insert_length > 0) PreeditSetRendition(w, call_data); _XmTextFieldDrawInsertionPoint(tf, True); if (mb) XtFree(mb); if (wc) XtFree((char *) wc); } /* * This is the function set to XNPreeditCaretCallback resource. * This function is called when the input server requests XmTextField to move * the caret. */ static void PreeditCaret(XIC xic, XPointer client_data, XIMPreeditCaretCallbackStruct *call_data) { XmTextPosition new_position; XmTextFieldWidget tf = (XmTextFieldWidget)client_data; Widget p = (Widget) tf; Boolean need_verify; if (!TextF_Editable(tf)) return; while (!XtIsShell(p)) p = XtParent(p); XtVaGetValues(p, XmNverifyPreedit, &need_verify, NULL); _XmTextFieldDrawInsertionPoint(tf, False); switch (call_data->direction) { case XIMForwardChar: new_position = PreCursor(tf) + 1 - PreStart(tf); break; case XIMBackwardChar: new_position = PreCursor(tf) - 1 - PreStart(tf); break; case XIMAbsolutePosition: new_position = (XmTextPosition) call_data->position; break; default: new_position = PreCursor(tf) - PreStart(tf); } TextF_CursorPosition(tf) = PreCursor(tf) = PreStart(tf) + new_position; if (need_verify) { FUnderVerifyPreedit(tf) = True; _XmTextFieldSetCursorPosition(tf, NULL, PreCursor(tf), False, True); FUnderVerifyPreedit(tf) = False; } else PreeditSetCursorPosition(tf, TextF_CursorPosition(tf)); _XmTextFieldDrawInsertionPoint(tf, True); } /* * 1. Call XmImMbResetIC to reset the input method and get the current * preedit string. * 2. Set the string to XmTextField */ static void TextFieldResetIC(Widget w) { int insert_length, escapement, num_chars; char *mb, *str=NULL; Boolean replace_res; wchar_t *wc_insert_string; XRectangle overall_ink; XmTextPosition cursorPos, nextPos; XmTextFieldWidget tf = (XmTextFieldWidget)w; if (!(tf->text.onthespot->under_preedit)) return; if (FVerifyCommitNeeded(tf)) { FVerifyCommitNeeded(tf) = False; str = XtMalloc((PreEnd(tf) - PreStart(tf)+1)*sizeof(wchar_t)); if (tf->text.max_char_size == 1) { bcopy(&tf->text.value[PreStart(tf)], str, PreEnd(tf) - PreStart(tf)); str[PreEnd(tf) - PreStart(tf)] = '\0'; } else { int num_bytes; wchar_t *wc_string; wc_string = (wchar_t *)XtMalloc((PreEnd(tf) - PreStart(tf)+1) *sizeof(wchar_t)); bcopy((char *)&tf->text.wc_value[PreStart(tf)], (char *)wc_string, (PreEnd(tf) - PreStart(tf))*sizeof(wchar_t)); wc_string[PreEnd(tf) - PreStart(tf)] = (wchar_t)'\0'; num_bytes = wcstombs(str, wc_string, (PreEnd(tf) - PreStart(tf)+1)*sizeof(wchar_t)); str[num_bytes] = '\0'; XtFree((char *)wc_string); } XmImMbResetIC(w, &mb); mb = str; } else XmImMbResetIC(w, &mb); if (!mb) { ResetUnder(tf); return; } if (!TextF_Editable(tf)) { if (tf->text.verify_bell) XBell(XtDisplay((Widget)tf), 0); } if ((insert_length = strlen(mb)) > TEXT_MAX_INSERT_SIZE) { ResetUnder(tf); return; } if (insert_length > 0) { if (TextF_UseFontSet(tf)){ escapement = XmbTextExtents((XFontSet)TextF_Font(tf), mb, insert_length, &overall_ink, NULL ); if ( escapement == 0 && overall_ink.width == 0 ) { ResetUnder(tf); return; } #ifdef USE_XFT } else if (TextF_UseXft(tf)) { XGlyphInfo ext; XftTextExtentsUtf8(XtDisplay((Widget)tf), TextF_XftFont(tf), (FcChar8*)mb, insert_length, &ext); if (!ext.xOff) { ResetUnder(tf); return; } #endif } else { if (!XTextWidth(TextF_Font(tf), mb, insert_length)) { ResetUnder(tf); return; } } } cursorPos = nextPos = TextF_CursorPosition(tf); if (tf->text.overstrike) { if (nextPos != tf->text.string_length) nextPos++; } if (tf->text.max_char_size == 1) { replace_res = _XmTextFieldReplaceText(tf, NULL, cursorPos, nextPos, mb, insert_length, True); } else { mb[insert_length] = '\0'; wc_insert_string = (wchar_t*)XtMalloc((unsigned)(insert_length+1) * sizeof(wchar_t)); num_chars = mbstowcs( wc_insert_string, mb, insert_length+1); replace_res = _XmTextFieldReplaceText(tf, NULL, cursorPos, nextPos, (char*) wc_insert_string, num_chars, True); XtFree((char *)wc_insert_string); } if (replace_res) _XmTextFieldSetCursorPosition(tf, NULL, TextF_CursorPosition(tf), False, True); _XmTextFieldDrawInsertionPoint(tf, True); if (str) XtFree(str); ResetUnder(tf); } static void ResetUnder(XmTextFieldWidget tf) { if (XmImGetXICResetState((Widget)tf) != XIMPreserveState) tf->text.onthespot->under_preedit = False; } /***********************************<->*************************************** * Public Functions * ***********************************<->***************************************/ char * XmTextFieldGetString(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; char *temp_str; int ret_val = 0; _XmWidgetToAppContext(w); _XmAppLock(app); if (tf->text.string_length > 0) { if (tf->text.max_char_size == 1) { temp_str = XtNewString(TextF_Value(tf)); _XmAppUnlock(app); return temp_str; } else { temp_str = (char *) XtMalloc((unsigned) tf->text.max_char_size * (tf->text.string_length + 1)); ret_val = wcstombs(temp_str, TextF_WcValue(tf), (tf->text.string_length + 1)*tf->text.max_char_size); if (ret_val < 0) temp_str[0] = '\0'; _XmAppUnlock(app); return temp_str; } } else { _XmAppUnlock(app); return(XtNewString("")); } } int XmTextFieldGetSubstring(Widget widget, XmTextPosition start, int num_chars, int buf_size, char *buffer) { XmTextFieldWidget tf = (XmTextFieldWidget) widget; int ret_value = XmCOPY_SUCCEEDED; int n_bytes = 0; int wcs_ret = 0; _XmWidgetToAppContext(widget); _XmAppLock(app); if (tf->text.max_char_size != 1) n_bytes = _XmTextFieldCountBytes(tf, TextF_WcValue(tf)+start, num_chars); else n_bytes = num_chars; if (buf_size < n_bytes + 1) { _XmAppUnlock(app); return XmCOPY_FAILED; } if (start + num_chars > tf->text.string_length) { num_chars = (int) (tf->text.string_length - start); if (tf->text.max_char_size != 1) n_bytes = _XmTextFieldCountBytes(tf, TextF_WcValue(tf)+start, num_chars); else n_bytes = num_chars; ret_value = XmCOPY_TRUNCATED; } if (num_chars > 0) { if (tf->text.max_char_size == 1) { (void)memcpy((void*)buffer, (void*)&TextF_Value(tf)[start], num_chars); } else { wcs_ret = wcstombs(buffer, &TextF_WcValue(tf)[start], n_bytes); if (wcs_ret < 0) n_bytes = 0; } buffer[n_bytes] = '\0'; } else ret_value = XmCOPY_FAILED; _XmAppUnlock(app); return (ret_value); } wchar_t * XmTextFieldGetStringWcs(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; wchar_t *temp_wcs; int num_wcs = 0; _XmWidgetToAppContext(w); _XmAppLock(app); if (tf->text.string_length > 0) { temp_wcs = (wchar_t*) XtMalloc((unsigned) sizeof(wchar_t) * (tf->text.string_length + 1)); if (tf->text.max_char_size != 1) { (void)memcpy((void*)temp_wcs, (void*)TextF_WcValue(tf), sizeof(wchar_t) * (tf->text.string_length + 1)); } else { num_wcs = mbstowcs(temp_wcs, TextF_Value(tf), tf->text.string_length + 1); if (num_wcs < 0) temp_wcs[0] = (wchar_t)0L; } _XmAppUnlock(app); return temp_wcs; } else { temp_wcs = (wchar_t*) XtMalloc((unsigned) sizeof(wchar_t)); temp_wcs[0] = (wchar_t)0L; /* put a wchar_t NULL in position 0 */ _XmAppUnlock(app); return temp_wcs; } } int XmTextFieldGetSubstringWcs(Widget widget, XmTextPosition start, int num_chars, int buf_size, wchar_t *buffer) { XmTextFieldWidget tf = (XmTextFieldWidget) widget; int ret_value = XmCOPY_SUCCEEDED; int num_wcs = 0; _XmWidgetToAppContext(widget); _XmAppLock(app); if (start + num_chars > tf->text.string_length) { num_chars = (int) (tf->text.string_length - start); ret_value = XmCOPY_TRUNCATED; } if (buf_size < num_chars + 1) { _XmAppUnlock(app); return XmCOPY_FAILED; } if (num_chars > 0) { if (tf->text.max_char_size == 1) { num_wcs = mbstowcs(buffer, &TextF_Value(tf)[start], num_chars); if (num_wcs < 0) num_chars = 0; } else { (void)memcpy((void*)buffer, (void*)&TextF_WcValue(tf)[start], (size_t) num_chars * sizeof(wchar_t)); } buffer[num_chars] = '\0'; } else if (num_chars == 0) { buffer[num_chars] = '\0'; } else ret_value = XmCOPY_FAILED; _XmAppUnlock(app); return (ret_value); } XmTextPosition XmTextFieldGetLastPosition(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = (tf->text.string_length); _XmAppUnlock(app); return ret_val; } void XmTextFieldSetString(Widget w, char *value) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmAnyCallbackStruct cb; XmTextPosition fromPos, toPos, newInsert; int length; int free_insert = False; int ret_val = 0; char * tmp_ptr; char * mod_value = NULL; _XmWidgetToAppContext(w); _XmAppLock(app); TextFieldResetIC(w); fromPos = 0; if (value == NULL) value = ""; toPos = tf->text.string_length; if (tf->text.max_char_size == 1) length = strlen(value); else { for (length = 0, tmp_ptr = value, ret_val = mblen(tmp_ptr, MB_CUR_MAX); ret_val > 0; ret_val = mblen(tmp_ptr, MB_CUR_MAX)){ if (ret_val < 0){ length = 0; /* If error, treat the whole string as bad */ break; } else { length += ret_val; tmp_ptr += ret_val; } } } if (XtIsSensitive(w) && tf->text.has_focus) ChangeBlinkBehavior(tf, False); _XmTextFieldDrawInsertionPoint(tf, False); if (TextF_ModifyVerifyCallback(tf) || TextF_ModifyVerifyCallbackWcs(tf)) { /* If the function ModifyVerify() returns false then don't * continue with the action. */ if (tf->text.max_char_size == 1) { if (!ModifyVerify(tf, NULL, &fromPos, &toPos, &value, &length, &newInsert, &free_insert)) { if (tf->text.verify_bell) XBell(XtDisplay(w), 0); if (free_insert) XtFree(value); _XmAppUnlock(app); return; } } else { wchar_t * wbuf; wchar_t * orig_wbuf; wbuf = (wchar_t*)XtMalloc((unsigned) ((strlen(value) + 1) * sizeof(wchar_t))); length = mbstowcs(wbuf, value, (size_t)(strlen(value) + 1)); if (length < 0) length = 0; orig_wbuf = wbuf; /* save the pointer to free later */ if (!ModifyVerify(tf, NULL, &fromPos, &toPos, (char**)&wbuf, &length, &newInsert, &free_insert)) { if (tf->text.verify_bell) XBell(XtDisplay(w), 0); if (free_insert) XtFree((char*)wbuf); XtFree((char*)orig_wbuf); _XmAppUnlock(app); return; } else { mod_value = XtMalloc((unsigned) ((length + 1) * tf->text.max_char_size)); ret_val = wcstombs(mod_value, wbuf, (size_t) ((length + 1) * tf->text.max_char_size)); if (free_insert) { XtFree((char*)wbuf); free_insert = False; } XtFree((char*)orig_wbuf); if (ret_val < 0){ XtFree(mod_value); length = strlen(value); } else { value = mod_value; } } } } TextFieldSetHighlight((XmTextFieldWidget) w, 0, tf->text.string_length, XmHIGHLIGHT_NORMAL); if (tf->text.max_char_size == 1) XtFree(TextF_Value(tf)); else /* convert to wchar_t before calling ValidateString */ XtFree((char *)TextF_WcValue(tf)); ValidateString(tf, value, False); if(mod_value) XtFree(mod_value); tf->text.pending_off = True; SetCursorPosition(tf, NULL, 0, True, True, False, DontCare); if (TextF_ResizeWidth(tf) && tf->text.do_resize) AdjustSize(tf); else { tf->text.h_offset = TextF_MarginWidth(tf) + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; if (!AdjustText(tf, TextF_CursorPosition(tf), False)) RedisplayText(tf, 0, tf->text.string_length); } cb.reason = XmCR_VALUE_CHANGED; cb.event = NULL; XtCallCallbackList(w, TextF_ValueChangedCallback(tf), (XtPointer) &cb); tf->text.refresh_ibeam_off = True; if (XtIsSensitive(w) && tf->text.has_focus) ChangeBlinkBehavior(tf, True); _XmTextFieldDrawInsertionPoint(tf, True); if (free_insert) XtFree(value); _XmAppUnlock(app); } void XmTextFieldSetStringWcs(Widget w, wchar_t *wc_value) { XmTextFieldWidget tf = (XmTextFieldWidget) w; char * tmp; wchar_t *tmp_wc; int num_chars = 0; int result; _XmWidgetToAppContext(w); _XmAppLock(app); TextFieldResetIC(w); for (num_chars = 0, tmp_wc = wc_value; *tmp_wc != (wchar_t)0L; num_chars++) tmp_wc++; /* count number of wchar_t's */ tmp = XtMalloc((unsigned) (num_chars + 1) * tf->text.max_char_size); result = wcstombs(tmp, wc_value, (num_chars + 1) * tf->text.max_char_size); if (result == (size_t) -1) /* if wcstombs fails, it returns (size_t) -1 */ tmp = ""; /* if invalid data, pass in the empty string */ XmTextFieldSetString(w, tmp); XtFree(tmp); _XmAppUnlock(app); } static void TextFieldReplace(Widget w, XmTextPosition from_pos, XmTextPosition to_pos, char *value, int is_wc) { XmTextFieldWidget tf = (XmTextFieldWidget) w; int save_maxlength = TextF_MaxLength(tf); Boolean save_editable = TextF_Editable(tf); Boolean deselected = False; Boolean rep_result = False; wchar_t *wc_value = (wchar_t *)value; int length = 0; XmAnyCallbackStruct cb; _XmWidgetToAppContext(w); _XmAppLock(app); if (value == NULL) value = ""; VerifyBounds(tf, &from_pos, &to_pos); if (tf->text.has_primary) { if ((tf->text.prim_pos_left > from_pos && tf->text.prim_pos_left < to_pos) || (tf->text.prim_pos_right >from_pos && tf->text.prim_pos_right < to_pos) || (tf->text.prim_pos_left <= from_pos && tf->text.prim_pos_right >= to_pos)) { _XmTextFieldDeselectSelection(w, False, XtLastTimestampProcessed(XtDisplay(w))); deselected = True; } } TextF_Editable(tf) = True; TextF_MaxLength(tf) = INT_MAX; if (is_wc) { /* Count the number of wide chars in the array */ for (length = 0; wc_value[length] != (wchar_t)0L; length++) /*EMPTY*/; if (tf->text.max_char_size != 1) { rep_result = _XmTextFieldReplaceText(tf, NULL, from_pos, to_pos, (char*)wc_value, length, False); } else { /* need to convert to char* before calling Replace */ value = XtMalloc((unsigned) (length + 1) * tf->text.max_char_size); length = wcstombs(value, wc_value, (length + 1) * tf->text.max_char_size); if (length < 0) { /* if wcstombs fails, it returns -1 */ value = ""; /* if invalid data, pass in the empty string */ length = 0; } rep_result = _XmTextFieldReplaceText(tf, NULL, from_pos, to_pos, (char*)value, length, False); XtFree(value); } } else { if (tf->text.max_char_size == 1) { length = strlen(value); rep_result = _XmTextFieldReplaceText(tf, NULL, from_pos, to_pos, value, length, False); } else { /* need to convert to wchar_t* before calling Replace */ wc_value = (wchar_t *) XtMalloc((unsigned) sizeof(wchar_t) * (1 + strlen(value))); length = mbstowcs(wc_value, value, (unsigned) (strlen(value) + 1)); if (length < 0) { wc_value[0] = (wchar_t) 0L;/* if invalid data, pass in empty string */ length = 0; } rep_result = _XmTextFieldReplaceText(tf, NULL, from_pos, to_pos, (char*)wc_value, length, False); XtFree((char *)wc_value); } } if (from_pos <= TextF_CursorPosition(tf)) { XmTextPosition cursorPos; /* Replace will not move us, we still want this to happen */ if (TextF_CursorPosition(tf) < to_pos) { if (TextF_CursorPosition(tf) - from_pos <= length) cursorPos = TextF_CursorPosition(tf); else cursorPos = from_pos + length; } else { cursorPos = TextF_CursorPosition(tf) - (to_pos - from_pos) + length; } SetCursorPosition(tf, NULL, cursorPos, True, True, False, DontCare); } TextF_Editable(tf) = save_editable; TextF_MaxLength(tf) = save_maxlength; /* * Replace Text utilizes an optimization in deciding which text to redraw; * in the case that the selection has been changed (as above), this can * cause part/all of the replaced text to NOT be redrawn. The following * AdjustText call ensures that it IS drawn in this case. */ if (deselected) AdjustText(tf, from_pos, True); (void) SetDestination(w, TextF_CursorPosition(tf), False, XtLastTimestampProcessed(XtDisplay(w))); if (rep_result) { cb.reason = XmCR_VALUE_CHANGED; cb.event = NULL; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } _XmAppUnlock(app); } void XmTextFieldReplace(Widget w, XmTextPosition from_pos, XmTextPosition to_pos, char *value) { _XmWidgetToAppContext(w); _XmAppLock(app); TextFieldReplace(w, from_pos, to_pos, value, False); _XmAppUnlock(app); } void XmTextFieldReplaceWcs(Widget w, XmTextPosition from_pos, XmTextPosition to_pos, wchar_t *wc_value) { _XmWidgetToAppContext(w); _XmAppLock(app); TextFieldReplace(w, from_pos, to_pos, (char *)wc_value, True); _XmAppUnlock(app); } void XmTextFieldInsert(Widget w, XmTextPosition position, char *value) { _XmWidgetToAppContext(w); _XmAppLock(app); /* XmTextFieldReplace takes care of converting to wchar_t* if needed */ XmTextFieldReplace(w, position, position, value); _XmAppUnlock(app); } void XmTextFieldInsertWcs(Widget w, XmTextPosition position, wchar_t *wcstring) { _XmWidgetToAppContext(w); _XmAppLock(app); /* XmTextFieldReplaceWcs takes care of converting to wchar_t* if needed */ XmTextFieldReplaceWcs(w, position, position, wcstring); _XmAppUnlock(app); } void XmTextFieldSetAddMode(Widget w, #if NeedWidePrototypes int state) #else Boolean state) #endif /* NeedWidePrototypes */ { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (tf->text.add_mode == state) { _XmAppUnlock(app); return; } _XmTextFieldDrawInsertionPoint(tf, False); tf->text.add_mode = state; _XmTextFieldDrawInsertionPoint(tf, True); _XmAppUnlock(app); } Boolean XmTextFieldGetAddMode(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = tf->text.add_mode; _XmAppUnlock(app); return ret_val; } Boolean XmTextFieldGetEditable(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = TextF_Editable(tf); _XmAppUnlock(app); return ret_val; } void XmTextFieldSetEditable(Widget w, #if NeedWidePrototypes int editable) #else Boolean editable) #endif /* NeedWidePrototypes */ { XmTextFieldWidget tf = (XmTextFieldWidget) w; XPoint xmim_point; XRectangle xmim_area; Arg args[11]; /* To set initial values to input method */ XIMCallback xim_cb[5]; /* on the spot im callbacks */ Cardinal n = 0; _XmWidgetToAppContext(w); _XmAppLock(app); /* if widget previously wasn't editable, no input method has yet been * registered. So, if we're making it editable now, register the IM and * give the IM the relevent values. */ if (!TextF_Editable(tf) && editable) { XmImRegister((Widget)tf, (unsigned int) NULL); GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, &xmim_point.y); (void)TextFieldGetDisplayRect((Widget)tf, &xmim_area); n = 0; XtSetArg(args[n], XmNfontList, TextF_FontList(tf)); n++; XtSetArg(args[n], XmNbackground, tf->core.background_pixel); n++; XtSetArg(args[n], XmNforeground, tf->primitive.foreground); n++; XtSetArg(args[n], XmNbackgroundPixmap,tf->core.background_pixmap);n++; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XtSetArg(args[n], XmNlineSpace, TextF_FontAscent(tf)+ TextF_FontDescent(tf)); n++; /* * On the spot support. Register preedit callbacks. */ xim_cb[0].client_data = (XPointer)tf; xim_cb[0].callback = (XIMProc)PreeditStart; xim_cb[1].client_data = (XPointer)tf; xim_cb[1].callback = (XIMProc)PreeditDone; xim_cb[2].client_data = (XPointer)tf; xim_cb[2].callback = (XIMProc)PreeditDraw; xim_cb[3].client_data = (XPointer)tf; xim_cb[3].callback = (XIMProc)PreeditCaret; XtSetArg(args[n], XmNpreeditStartCallback, &xim_cb[0]); n++; XtSetArg(args[n], XmNpreeditDoneCallback, &xim_cb[1]); n++; XtSetArg(args[n], XmNpreeditDrawCallback, &xim_cb[2]); n++; XtSetArg(args[n], XmNpreeditCaretCallback, &xim_cb[3]); n++; if (tf->text.has_focus) XmImSetFocusValues((Widget)tf, args, n); else XmImSetValues((Widget)tf, args, n); } else if (TextF_Editable(tf) && !editable) { XmImUnregister(w); } TextF_Editable(tf) = editable; n = 0; if (editable) { XtSetArg(args[n], XmNdropSiteActivity, XmDROP_SITE_ACTIVE); n++; } else { XtSetArg(args[n], XmNdropSiteActivity, XmDROP_SITE_INACTIVE); n++; } XmDropSiteUpdate((Widget)tf, args, n); _XmAppUnlock(app); } int XmTextFieldGetMaxLength(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; int ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = TextF_MaxLength(tf); _XmAppUnlock(app); return ret_val; } void XmTextFieldSetMaxLength(Widget w, int max_length) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); TextF_MaxLength(tf) = max_length; _XmAppUnlock(app); } XmTextPosition XmTextFieldGetInsertionPosition(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = TextF_CursorPosition(tf); _XmAppUnlock(app); return ret_val; } void XmTextFieldSetInsertionPosition(Widget w, XmTextPosition position) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); TextFieldResetIC(w); SetCursorPosition(tf, NULL, position, True, True, False, DontCare); _XmAppUnlock(app); } Boolean XmTextFieldGetSelectionPosition(Widget w, XmTextPosition *left, XmTextPosition *right) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if (tf->text.has_primary) { *left = tf->text.prim_pos_left; *right = tf->text.prim_pos_right; } _XmAppUnlock(app); return tf->text.has_primary; } char * XmTextFieldGetSelection(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; size_t length, num_chars; char *value; _XmWidgetToAppContext(w); _XmAppLock(app); if (tf->text.prim_pos_left == tf->text.prim_pos_right) { _XmAppUnlock(app); return NULL; } num_chars = (size_t) (tf->text.prim_pos_right - tf->text.prim_pos_left); length = num_chars; if (tf->text.max_char_size == 1) { value = XtMalloc((unsigned) num_chars + 1); (void) memcpy((void*)value, (void*)(TextF_Value(tf) + tf->text.prim_pos_left), num_chars); } else { value = XtMalloc((unsigned) ((num_chars + 1) * tf->text.max_char_size)); length = wcstombs(value, TextF_WcValue(tf) + tf->text.prim_pos_left, (num_chars + 1) * tf->text.max_char_size); if (length == (size_t) -1) { length = 0; } else { for(length = 0;num_chars > 0; num_chars--) #ifndef NO_MULTIBYTE length += mblen(&value[length], tf->text.max_char_size); #else length += value[length] ? 1 : 0; #endif } } value[length] = (char)'\0'; _XmAppUnlock(app); return (value); } wchar_t * XmTextFieldGetSelectionWcs(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; size_t length; wchar_t *wc_value; int return_val = 0; _XmWidgetToAppContext(w); _XmAppLock(app); if (tf->text.prim_pos_left == tf->text.prim_pos_right) { _XmAppUnlock(app); return NULL; } length = (size_t) (tf->text.prim_pos_right - tf->text.prim_pos_left); wc_value = (wchar_t*)XtMalloc((unsigned) (length + 1) * sizeof(wchar_t)); if (tf->text.max_char_size == 1) { return_val = mbstowcs(wc_value, TextF_Value(tf) + tf->text.prim_pos_left, length); if (return_val < 0) length = 0; } else { (void)memcpy((void*)wc_value, (void*)(TextF_WcValue(tf) + tf->text.prim_pos_left), length * sizeof(wchar_t)); } wc_value[length] = (wchar_t)0L; _XmAppUnlock(app); return (wc_value); } Boolean XmTextFieldRemove(Widget w) { Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = TextFieldRemove(w, NULL); _XmAppUnlock(app); return ret_val; } Boolean XmTextFieldCopy(Widget w, Time clip_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); /* using the clipboard facilities, copy the selected text to the clipboard */ if (tf->text.prim_pos_left != tf->text.prim_pos_right) { _XmAppUnlock(app); return XmeClipboardSource(w, XmCOPY, clip_time); } _XmAppUnlock(app); return False; } Boolean XmTextFieldCopyLink(Widget w, Time clip_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); if (tf->text.prim_pos_left != tf->text.prim_pos_right) { ret_val = XmeClipboardSource(w, XmLINK, clip_time); _XmAppUnlock(app); return ret_val; } _XmAppUnlock(app); return False; } Boolean XmTextFieldCut(Widget w, Time clip_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); if (TextF_Editable(tf) == False) { _XmAppUnlock(app); return False; } if (tf->text.prim_pos_left != tf->text.prim_pos_right) { ret_val = XmeClipboardSource(w, XmMOVE, clip_time); _XmAppUnlock(app); return ret_val; } _XmAppUnlock(app); return False; } void XmTextFieldClearSelection(Widget w, Time sel_time) { _XmWidgetToAppContext(w); _XmAppLock(app); _XmTextFieldDeselectSelection(w, False, sel_time); _XmAppUnlock(app); } void XmTextFieldSetSelection(Widget w, XmTextPosition first, XmTextPosition last, Time sel_time) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); TextFieldResetIC(w); tf->text.take_primary = True; _XmTextFieldStartSelection(tf, first, last, sel_time); tf->text.pending_off = False; SetCursorPosition(tf, NULL, last, True, True, False, DontCare); _XmAppUnlock(app); } /* ARGSUSED */ XmTextPosition XmTextFieldXYToPos(Widget w, #if NeedWidePrototypes int x, int y) #else Position x, Position y) #endif /* NeedWidePrototypes */ { XmTextFieldWidget tf = (XmTextFieldWidget) w; XmTextPosition ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = GetPosFromX(tf, x); _XmAppUnlock(app); return (ret_val); } Boolean XmTextFieldPosToXY(Widget w, XmTextPosition position, Position *x, Position *y) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = GetXYFromPos(tf, position, x, y); _XmAppUnlock(app); return (ret_val); } /* * Force the given position to be displayed. If position is out of bounds, * then don't force any position to be displayed. */ void XmTextFieldShowPosition(Widget w, XmTextPosition position) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); if ( (position < 0) || (position > tf->text.string_length) ) { _XmAppUnlock(app); return; } AdjustText(tf, position, True); _XmAppUnlock(app); } /* ARGSUSED */ void XmTextFieldSetHighlight(Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode) { XmTextFieldWidget tf = (XmTextFieldWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); doSetHighlight(w, left, right, mode); tf->text.programmatic_highlights = True; _XmAppUnlock(app); } static Boolean TrimHighlights(XmTextFieldWidget tf, int *low, int *high) { /* ** We have a situation in which the programmer has called ** XmTextFieldSetHighlight and the user is now interacting with the ** text, which has the possible effect of mis-inserting and doing all ** sorts of nasty stuff, mostly because this widget assumes that such ** settings are ephemeral and last only as long as user interaction. ** As programmer-defined highlights are assumed to be reasonable only ** for e.g. non-editable text areas, reset them. */ Boolean changed = False; Boolean justChanged = False; _XmHighlightRec *l = tf->text.highlight.list; int i; for (i=0; i < tf->text.highlight.number; i++) { /* iterate through list, resetting spurious back to normal; ** unfortunately, we can have has_primary even when there is ** no primary selection anymore, so check pending-deleteness */ if (justChanged) *high = l[i].position; if (((XmHIGHLIGHT_SECONDARY_SELECTED == l[i].mode) && !tf->text.has_secondary) ||((XmHIGHLIGHT_SELECTED == l[i].mode) && !NeedsPendingDelete(tf))) { l[i].mode = XmHIGHLIGHT_NORMAL; if (!changed) *low = l[i].position; changed = True; justChanged = True; } else justChanged = False; } if (justChanged) *high = tf->text.string_length; if (changed) { int j; /* coalescing blocks; reduce number only */ i = 1; while (i < tf->text.highlight.number) { if (l[i].mode == l[i-1].mode) { tf->text.highlight.number--; for (j=i; jtext.highlight.number; j++) l[j] = l[j+1]; } else i++; } } return changed; } /* ARGSUSED */ static void doSetHighlight(Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode) { XmTextFieldWidget tf = (XmTextFieldWidget) w; /* If right position is out-bound, change it to the last position. */ if (right > tf->text.string_length) right = tf->text.string_length; /* If left is out-bound, don't do anything. */ if (left >= right || right <= 0) { return; } if (left < 0) left = 0; TextFieldSetHighlight(tf, left, right, mode); RedisplayText(tf, left, right); } int XmTextFieldGetBaseline(Widget w) { XmTextFieldWidget tf = (XmTextFieldWidget) w; Dimension margin_top; int ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); margin_top = tf->text.margin_top + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; ret_val = (int) margin_top + (int) TextF_FontAscent(tf); _XmAppUnlock(app); return(ret_val); } /* * Function: * XmCreateTextField() * XmVaCreateTextField() * XmVaCreateManagedTextField() * * Description: * Basic creation routines for the motif TextField Widget Class. */ Widget XmCreateTextField(Widget parent, char *name, ArgList arglist, Cardinal argcount) { return (XtCreateWidget(name, xmTextFieldWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateTextField( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmTextFieldWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedTextField( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmTextFieldWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/ManagerI.h0000644000175000017500000001263712672140200012554 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ManagerI.h /main/5 1995/07/13 17:35:08 drk $ */ #ifndef _XmManagerI_h #define _XmManagerI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmGadgetTraverseCurrent( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraversePrevTabGroup( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraverseNextTabGroup( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraverseLeft( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraverseRight( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraverseUp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraverseDown( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraverseNext( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraversePrev( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetTraverseHome( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmManagerParentActivate( Widget mw, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmManagerParentCancel( Widget mw, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetButtonMotion( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetKeyInput( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetArm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetDrag( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmManagerHelp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetMultiArm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmGadgetMultiActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmManagerI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Command.c0000644000175000017500000011143713145162623012451 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Command.c /main/21 1999/01/26 18:12:51 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "CommandI.h" #include #include #include #include #include "BulletinBI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "SelectioBI.h" #include "XmStringI.h" #include #ifndef X_NOT_STDC_ENV #include #endif #define ARG_LIST_CNT 25 /* defines for warning messages */ #define WARNING1 _XmMMsgCommand_0000 #define WARNING2 _XmMMsgCommand_0001 #define WARNING3 _XmMMsgCommand_0002 #define WARNING4 _XmMMsgCommand_0003 #define WARNING5 _XmMMsgCommand_0004 #define WARNING6 _XmMMsgCommand_0005 /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void ListCallback( Widget w, XtPointer client_data, XtPointer call_data) ; static void CommandCallback( Widget w, XtPointer cl_data, XtPointer call_data) ; static Boolean CommandParentProcess( Widget wid, XmParentProcessData event) ; static void Resize( Widget wid); static Boolean SetValues( Widget ow, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; /******** End Static Function Declarations ********/ static XtActionsRec actionsList[] = { { "Return", _XmCommandReturn }, /* Motif 1.0 */ { "UpOrDown", _XmCommandUpOrDown }, /* Motif 1.0 */ { "BulletinBoardReturn", _XmCommandReturn }, { "SelectionBoxUpOrDown", _XmCommandUpOrDown }, }; /* define the resource stuff for a command widget */ static XmSyntheticResource syn_resources[] = { { XmNpromptString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.selection_label_string), _XmSelectionBoxGetSelectionLabelString, NULL }, { XmNcommand, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.text_string), _XmSelectionBoxGetTextString, NULL }, { XmNhistoryItems, sizeof (XmString *), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_items), _XmSelectionBoxGetListItems, NULL }, { XmNhistoryItemCount, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_item_count), _XmSelectionBoxGetListItemCount, NULL }, { XmNhistoryVisibleItemCount, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_visible_item_count), _XmSelectionBoxGetListVisibleItemCount, NULL }, }; static XtResource resources[] = { { XmNcommandEnteredCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmCommandRec, command.callback), XmRCallback, (XtPointer)NULL}, { XmNcommandChangedCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmCommandRec, command.value_changed_callback), XmRCallback, (XtPointer) NULL}, { XmNpromptString, XmCPromptString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.selection_label_string), XmRImmediate, (XtPointer) XmUNSPECIFIED}, { XmNcommand, XmCTextString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.text_string), XmRImmediate, (XtPointer) XmUNSPECIFIED}, { XmNhistoryItems, XmCItems, XmRXmStringTable, sizeof (XmString *), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_items), XmRImmediate, NULL}, { XmNhistoryItemCount, XmCItemCount, XmRInt, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_item_count), XmRImmediate, (XtPointer) XmUNSPECIFIED_COUNT}, { XmNhistoryMaxItems, XmCMaxItems, XmRInt, sizeof(int), XtOffsetOf( struct _XmCommandRec, command.history_max_items), XmRImmediate, (XtPointer) 100}, { XmNhistoryVisibleItemCount, XmCVisibleItemCount, XmRInt, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_visible_item_count), XmRImmediate, (XtPointer) 8}, { XmNdialogType, XmCDialogType, XmRSelectionType, sizeof (unsigned char), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.dialog_type), XmRImmediate, (XtPointer) XmDIALOG_COMMAND}, { XmNdefaultPosition, XmCDefaultPosition, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.default_position), XmRImmediate, (XtPointer) False}, { XmNautoUnmanage, XmCAutoUnmanage, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.auto_unmanage), XmRImmediate, (XtPointer) False}, { XmNresizePolicy, XmCResizePolicy, XmRResizePolicy, sizeof (unsigned char), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.resize_policy), XmRImmediate, (XtPointer) XmRESIZE_NONE}, }; /**************************************************************** * * Full class record constant * ****************************************************************/ externaldef( xmcommandclassrec) XmCommandClassRec xmCommandClassRec = { { /*core class record */ (WidgetClass) &xmSelectionBoxClassRec, /* superclass ptr */ "XmCommand", /* class_name */ sizeof(XmCommandRec), /* size of widget instance */ NULL, /* class init proc */ ClassPartInitialize, /* class part init proc */ FALSE, /* class is not init'ed */ Initialize, /* widget init proc */ NULL, /* widget init hook */ XtInheritRealize, /* widget realize proc */ actionsList, /* class action table */ XtNumber (actionsList), /* class action count */ resources, /* class resource list */ XtNumber (resources), /* class resource_count */ NULLQUARK, /* xrm_class */ TRUE, /* compressed motion */ XtExposeCompressSeries, /* compressed exposure */ TRUE, /* compressed enter/exit */ FALSE, /* VisibilityNotify */ NULL, /* class destroy proc */ Resize, /* class resize proc */ XtInheritExpose, /* class expose proc */ SetValues, /* class set_value proc */ NULL, /* widget setvalues hook */ XtInheritSetValuesAlmost, /* set values almost */ NULL, /* widget getvalues hook */ NULL, /* class accept focus proc */ XtVersion, /* version */ NULL, /* callback offset list */ XtInheritTranslations, /* default translations */ XtInheritQueryGeometry, /* query geometry */ NULL, /* Display Accelerator */ NULL, /* Extension pointer */ }, { /*composite class record */ XtInheritGeometryManager, /* childrens geo mgr proc */ XtInheritChangeManaged, /* set changed proc */ XtInheritInsertChild, /* add a child */ XtInheritDeleteChild, /* remove a child */ NULL, /* Extension pointer */ }, { /*constraint class record */ NULL, /* no additional resources */ 0, /* num additional resources */ 0, /* size of constraint rec */ NULL, /* constraint_initialize */ NULL, /* constraint_destroy */ NULL, /* constraint_setvalue */ NULL, /* Extension pointer */ }, { /*manager class record */ XtInheritTranslations, /* default translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ CommandParentProcess, /* parent_process */ NULL, /* extension */ }, { /*bulletin board class rec */ TRUE, /*always_install_accelerators*/ XmInheritGeoMatrixCreate, /* geo_matrix_create */ XmInheritFocusMovedProc, /* focus_moved_proc */ NULL /* Extension pointer - none */ }, { /*selection box class rec */ ListCallback, /* list_callback */ NULL, /* Extension pointer - none */ }, { /*command class record */ NULL, /* Extension pointer - none */ } }; /* * now make a public symbol that points to this class record */ externaldef( xmcommandwidgetclass) WidgetClass xmCommandWidgetClass = (WidgetClass) &xmCommandClassRec ; /****************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { /****************/ _XmFastSubclassInit (wc, XmCOMMAND_BOX_BIT); return ; } /**************************************************************** * Set attributes of a command widget ****************/ /*ARGSUSED*/ static void Initialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmCommandWidget new_w = (XmCommandWidget) nw ; int max; Arg argv[5] ; Cardinal argc ; /****************/ /* Here we have now to take care of XmUNSPECIFIED (CR 4856). */ if (new_w->selection_box.selection_label_string == (XmString) XmUNSPECIFIED) { XmString local_xmstring ; local_xmstring = XmStringCreate(">", XmFONTLIST_DEFAULT_TAG); argc = 0 ; XtSetArg( argv[argc], XmNlabelString, local_xmstring) ; ++argc ; XtSetValues( SB_SelectionLabel( new_w), argv, argc) ; XmStringFree(local_xmstring); new_w->selection_box.selection_label_string = NULL ; } /* mustMatch does not apply to command... (it is always false) */ if (new_w->selection_box.must_match != False) { new_w->selection_box.must_match = False; XmeWarning( (Widget) new_w, WARNING5); } /* check for and change max history items (remove items if needed) */ if (new_w->command.history_max_items < 1) { new_w->command.history_max_items = 100; XmeWarning( (Widget) new_w, WARNING6); } argc = 0 ; XtSetArg( argv[argc], XmNitemCount, &max) ; ++argc ; XtGetValues( SB_List( new_w), argv, argc) ; if (new_w->command.history_max_items < max) { while (max > new_w->command.history_max_items) { XmListDeletePos (new_w->selection_box.list, 1); if (new_w->selection_box.list_selected_item_position > 0) new_w->selection_box.list_selected_item_position--; max--; } } if (new_w->selection_box.dialog_type != XmDIALOG_COMMAND) { new_w->selection_box.dialog_type = XmDIALOG_COMMAND ; XmeWarning( (Widget) new_w, WARNING1); } XtAddCallback (new_w->selection_box.text, XmNvalueChangedCallback, CommandCallback, (XtPointer) new_w); new_w->command.error = FALSE; return ; } /**************************************************************** * Process callback from the List in a SelectionBox. ****************/ /*ARGSUSED*/ static void ListCallback( Widget w, /* unused */ XtPointer client_data, XtPointer call_data ) { XmListCallbackStruct * listCB = (XmListCallbackStruct *) call_data ; XmCommandCallbackStruct cmdCB ; XmCommandWidget cmdWid = (XmCommandWidget) client_data ; char * text_value ; Arg argv[5] ; Cardinal argc ; int count ; XmString tmpXmString ; /*********** reset is not used ************ Boolean reset = FALSE ; ****************/ argc = 0 ; XtSetArg( argv[argc], XmNitemCount, &count) ; ++argc ; XtGetValues( SB_List( cmdWid), argv, argc) ; if( !count ) { return ; } if( cmdWid->command.error ) { if( (listCB->item_position == (count - 1)) || ( (listCB->item_position == count) && (listCB->reason != XmCR_DEFAULT_ACTION)) ) { /* Selection or default action on the blank line, or selection on * error message. Restore previous selection and return. */ XmListDeselectPos( SB_List( cmdWid), listCB->item_position) ; if( cmdWid->selection_box.list_selected_item_position ) { XmListSelectPos( SB_List( cmdWid), cmdWid->selection_box.list_selected_item_position, FALSE) ; } return ; } XmListDeletePos( SB_List( cmdWid), 0) ; /* Delete error message.*/ XmListDeletePos( SB_List( cmdWid), 0) ; /* Delete blank line.*/ cmdWid->command.error = FALSE ; if( count <= 2 ) { /* List only contained error message and blank line. */ cmdWid->selection_box.list_selected_item_position = 0 ; return ; } count -= 2 ; if( (listCB->item_position > count) && (listCB->reason == XmCR_DEFAULT_ACTION) ) { /* Default action on the error message line. Restore previous * selection, clear text area, and return. */ if( cmdWid->selection_box.list_selected_item_position ) { XmListSelectPos( SB_List( cmdWid), cmdWid->selection_box.list_selected_item_position, FALSE) ; } XmTextFieldSetString( cmdWid->selection_box.text, "") ; return ; } } if( listCB->reason == XmCR_DEFAULT_ACTION ) { /* If we are already at max items, remove first item. */ if( count >= cmdWid->command.history_max_items ) { XmListDeletePos( cmdWid->selection_box.list, 1) ; if( cmdWid->selection_box.list_selected_item_position > 0 ) { cmdWid->selection_box.list_selected_item_position-- ; } } tmpXmString = XmStringCopy( listCB->item) ; XmListAddItemUnselected( cmdWid->selection_box.list, tmpXmString, 0) ; XmListSetBottomPos( cmdWid->selection_box.list, 0) ; XmTextFieldSetString( cmdWid->selection_box.text, "") ; /* Call the users command entered callback. */ cmdCB.reason = XmCR_COMMAND_ENTERED ; cmdCB.event = NULL ; cmdCB.value = tmpXmString ; cmdCB.length = XmStringLength( tmpXmString) ; XtCallCallbackList( (Widget) cmdWid, cmdWid->command.callback, &cmdCB) ; XmStringFree( tmpXmString) ; } else /* listCB->reason is BROWSE_SELECT or SINGLE_SELECT */ { /* Update the text widget to relect the latest list selection. */ cmdWid->selection_box.list_selected_item_position = listCB->item_position ; if((text_value = _XmStringGetTextConcat( listCB->item)) != NULL) { XmTextFieldSetString( SB_Text( cmdWid), text_value) ; XmTextFieldSetInsertionPosition( SB_Text( cmdWid), XmTextFieldGetLastPosition( SB_Text( cmdWid))) ; XtFree( text_value) ; } } return ; } /**************************************************************** * Callback for Text ValueChanged callback ****************/ /*ARGSUSED*/ static void CommandCallback( Widget w, /* unused */ XtPointer cl_data, XtPointer call_data ) { XmCommandWidget client_data = (XmCommandWidget) cl_data ; XmCommandCallbackStruct cb; char *str; /****************/ cb.reason = XmCR_COMMAND_CHANGED; cb.event = ((XmAnyCallbackStruct *) call_data)->event ; /* get char* string from text and convert to XmString type */ str = XmTextFieldGetString (client_data->selection_box.text); cb.value = XmStringGenerate(str, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); XtFree (str); cb.length = XmStringLength (cb.value); XtCallCallbackList ((Widget) client_data, client_data->command.value_changed_callback, &cb); XmStringFree (cb.value); return ; } /****************************************************************/ static Boolean CommandParentProcess( Widget wid, XmParentProcessData event ) { XmCommandWidget cmd = (XmCommandWidget) wid ; /****************/ if( (event->any.process_type == XmINPUT_ACTION) && ( (event->input_action.action == XmPARENT_ACTIVATE) || ( (event->input_action.action == XmPARENT_CANCEL) && BB_CancelButton( cmd))) ) { if( event->input_action.action == XmPARENT_ACTIVATE ) { _XmCommandReturn( (Widget) cmd, event->input_action.event, event->input_action.params, event->input_action.num_params) ; } else { _XmBulletinBoardCancel( (Widget) cmd, event->input_action.event, event->input_action.params, event->input_action.num_params) ; } return( TRUE) ; } return( _XmParentProcess( XtParent( cmd), event)) ; } /**************************************************************** * Return function to "complete" text entry ****************/ /*ARGSUSED*/ void _XmCommandReturn( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *numParams ) /* unused */ { XmCommandWidget w = (XmCommandWidget) wid ; XmCommandCallbackStruct cb; XmString tmpXmString; String tmpString; Arg argv[5] ; Cardinal argc ; int count ; /****************/ /* if an error has been sent to the history list, remove it now */ if (w->command.error) { XmListDeletePos (w->selection_box.list, 0); /* delete error msg */ XmListDeletePos (w->selection_box.list, 0); /* delete blank line */ w->command.error = FALSE; XmListSetBottomPos (w->selection_box.list, 0); } /* update the history: - get text, check null/empty */ /* - create XmString from text */ /* - increment local list count */ /* - add to history list */ /* - delete first element if too */ /* many items (maxItemCount) */ /* - position list to end */ /* - reset selection list ptr */ /* - reset command to "" */ tmpString = XmTextFieldGetString (w->selection_box.text); if ((tmpString == NULL) || (strcmp(tmpString, "") == 0)) { if (tmpString) XtFree(tmpString); return; } argc = 0 ; XtSetArg( argv[argc], XmNitemCount, &count) ; ++argc ; XtGetValues( SB_List( w), argv, argc) ; /* if already at max items, remove first item in list */ if (count >= w->command.history_max_items) { XmListDeletePos (w->selection_box.list, 1); if (w->selection_box.list_selected_item_position > 0) w->selection_box.list_selected_item_position--; } tmpXmString = XmStringGenerate(tmpString, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); XmListAddItemUnselected (w->selection_box.list, tmpXmString, 0); XmListSetBottomPos (w->selection_box.list, 0); XmTextFieldSetString (w->selection_box.text, ""); /* call the users command entered callback */ cb.reason = XmCR_COMMAND_ENTERED; cb.event = event; cb.value = tmpXmString; cb.length = XmStringLength (tmpXmString); XtCallCallbackList ((Widget) w, w->command.callback, &cb); XmStringFree (tmpXmString); XtFree (tmpString); return ; } /****************************************************************/ /*ARGSUSED*/ void _XmCommandUpOrDown( Widget wid, XEvent *event, /* unused */ String *argv, Cardinal *argc ) /* unused */ { XmCommandWidget cmd = (XmCommandWidget) wid ; int visible ; int top ; int key_pressed ; Widget list ; int * position ; int count ; Arg av[5] ; Cardinal ac ; int selected_count ; /****************/ if( !(list = cmd->selection_box.list) ) { return ; } ac = 0 ; XtSetArg( av[ac], XmNitemCount, &count) ; ++ac ; XtSetArg( av[ac], XmNtopItemPosition, &top) ; ++ac ; XtSetArg( av[ac], XmNvisibleItemCount, &visible) ; ++ac ; XtSetArg( av[ac], XmNselectedItemCount, &selected_count); ac++; XtGetValues( (Widget) list, av, ac) ; if( !count || (cmd->command.error && (count <= 2)) ) { return ; } /* * Fix for 5237 - Check the selected_count to ensure that a selection * exists. No items may be selected if the application * has run XmListDeselect* routine. If no items in the * list are selected, set list_selected_item_position to 0. */ if (!selected_count) cmd->selection_box.list_selected_item_position = 0; if (_XmConvertActionParamToRepTypeId((Widget) cmd, XmRID_COMMAND_SELECTION_BOX_UP_OR_DOWN_ACTION_PARAMS, argv[0], True, &key_pressed) == False) { /* We couldn't convert the value. Just assume a value of 0. */ key_pressed = 0; } position = &(cmd->selection_box.list_selected_item_position) ; if( *position == 0 ) { /* If error is visible, select last item - 2. Otherwise, select * last item in list. */ if( cmd->command.error ) { *position = count - 2 ; } else { *position = count ; } XmListSelectPos( list, *position, True) ; } else { if( !key_pressed && (*position > 1) ) { /* up */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, --*position, True) ; } else { if( (key_pressed == 1) && (*position < count) ) { /* down */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, ++*position, True) ; } else { if( key_pressed == 2 ) { /* home */ XmListDeselectPos( list, *position) ; *position = 1 ; XmListSelectPos( list, *position, True) ; } else { if( key_pressed == 3 ) { /* end */ XmListDeselectPos( list, *position) ; *position = count ; XmListSelectPos( list, *position, True) ; } } } } } if( top > *position ) { XmListSetPos( list, *position) ; } else { if( (top + visible) <= *position ) { XmListSetBottomPos( list, *position) ; } } return ; } /************************************************************************* * * * Resize - update visibleItemCount when resized * * ************************************************************************/ static void Resize(Widget wid) { Cardinal ac; Arg av[5] ; XmCommandWidget cw = (XmCommandWidget)wid; XtWidgetProc resize; _XmProcessLock(); resize = xmSelectionBoxClassRec.core_class.resize; _XmProcessUnlock(); (*resize) ((Widget) cw) ; /* keep list_visible_item_count in sync with List's visibleItemCount*/ ac = 0 ; XtSetArg( av[ac], XmNvisibleItemCount, &(cw->selection_box.list_visible_item_count)) ; ++ac ; XtGetValues( cw->selection_box.list, av, ac) ; } /**************************************************************** * Set attributes of a command widget ****************/ /*ARGSUSED*/ static Boolean SetValues( Widget ow, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmCommandWidget old = (XmCommandWidget) ow ; XmCommandWidget new_w = (XmCommandWidget) nw ; int max; Arg argv[5] ; Cardinal argc ; /****************/ /* mustMatch does not apply to command... (it is always false) */ if (new_w->selection_box.must_match != False) { new_w->selection_box.must_match = False; XmeWarning( (Widget) new_w, WARNING5); } if (new_w->selection_box.dialog_type != XmDIALOG_COMMAND) { new_w->selection_box.dialog_type = XmDIALOG_COMMAND; XmeWarning( (Widget) new_w, WARNING1); } /* check for and change max history items (remove items if needed) */ if (new_w->command.history_max_items < 1) { new_w->command.history_max_items = old->command.history_max_items; XmeWarning( (Widget) new_w, WARNING6); } if (new_w->command.history_max_items < old->command.history_max_items) { argc = 0 ; XtSetArg( argv[argc], XmNitemCount, &max) ; ++argc ; XtGetValues( SB_List( new_w), argv, argc) ; while (max > new_w->command.history_max_items) { XmListDeletePos (new_w->selection_box.list, 1); if (new_w->selection_box.list_selected_item_position > 0) new_w->selection_box.list_selected_item_position--; max--; } } if (old->command.error) { XmString new_xms, old_xms; int new_count = new_w->selection_box.list_item_count; int old_count = old->selection_box.list_item_count; if (new_count > 2 && old_count > 2) { XmString new_blank, old_blank, new_error, old_error; new_error = new_w->selection_box.list_items[new_count-1]; old_error = old->selection_box.list_items[new_count-1]; new_blank = new_w->selection_box.list_items[new_count-2]; old_blank = old->selection_box.list_items[new_count-2]; if (XmStringCompare(new_error, old_error) && XmStringCompare(new_blank, old_blank)) { new_w->command.error = FALSE; #if 0 XmListDeletePos(SB_List(old), 0); /* Delete error message.*/ XmListDeletePos(SB_List(old), 0) ; /* Delete blank line.*/ old->command.error = FALSE ; #endif } } else new_w->command.error = FALSE; } /* require redisplay */ return(True); } /**************************************************************** * Create an instance of the widget ****************/ Widget XmCreateCommand( Widget parent, String name, ArgList al, Cardinal ac ) { Widget w; ArgList argsNew; /* add dialogType to arglist and force to XmDIALOG_COMMAND... */ /* big time bad stuff will happen if they use prompt type... */ /* (like, no list gets created, but used all through command) */ /* allocate arglist, copy args, add dialog type arg */ argsNew = (ArgList) XtMalloc (sizeof(Arg) * (ac + 1)); memcpy( argsNew, al, sizeof(Arg) * ac); XtSetArg (argsNew[ac], XmNdialogType, XmDIALOG_COMMAND); ac++; /* create Command, free argsNew, return */ w = XtCreateWidget (name, xmCommandWidgetClass, parent, argsNew, ac); XtFree ((char *) argsNew); return (w); } Widget XmVaCreateCommand( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmCommandWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedCommand( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmCommandWidgetClass, parent, True, var, count); va_end(var); return w; } Widget XmCommandGetChild( Widget widget, #if NeedWidePrototypes unsigned int child ) #else unsigned char child ) #endif /* NeedWidePrototypes */ { XmCommandWidget w = (XmCommandWidget)widget; Widget ret_widget = NULL; _XmWidgetToAppContext(widget); /****************/ _XmAppLock(app); switch (child) { case XmDIALOG_COMMAND_TEXT: ret_widget = w->selection_box.text; break; case XmDIALOG_HISTORY_LIST: ret_widget = w->selection_box.list; break; case XmDIALOG_PROMPT_LABEL: ret_widget = w->selection_box.selection_label; break; case XmDIALOG_WORK_AREA: ret_widget = w->selection_box.work_area; break; default: XmeWarning( (Widget) w, WARNING2); break; } _XmAppUnlock(app); return ret_widget; } /**************************************************************** * Replace the text value with "value" * note: selection_box.text_string isn't updated, as we are not * going to guarantee that text_string is up to date with * the text widget string at all times... ****************/ void XmCommandSetValue( Widget widget, XmString value ) { XmCommandWidget w = (XmCommandWidget)widget; char *str; _XmWidgetToAppContext(widget); /****************/ _XmAppLock(app); if( !(str = _XmStringGetTextConcat( value)) ) { XmeWarning( (Widget) w, WARNING3); _XmAppUnlock(app); return; } XmTextFieldSetString(w->selection_box.text, str); XtFree(str); _XmAppUnlock(app); return ; } /**************************************************************** * Append "value" to the end of the current text value ****************/ void XmCommandAppendValue( Widget widget, XmString value ) { XmCommandWidget w = (XmCommandWidget)widget; char *strNew; XmTextPosition endPosition; _XmWidgetToAppContext(widget); /****************/ if (value == NULL) return; _XmAppLock(app); /* return if invalid string from "value" passed in */ if( !(strNew = _XmStringGetTextConcat( value)) ) { XmeWarning( (Widget) w, WARNING3); _XmAppUnlock(app); return; } if( !strNew || !*strNew ) { XmeWarning( (Widget) w, WARNING4); _XmAppUnlock(app); return; } /* get string length of current command string */ endPosition = XmTextFieldGetLastPosition( w->selection_box.text) ; /* append new string to existing string */ XmTextFieldReplace (w->selection_box.text, endPosition, endPosition, strNew) ; /* reset insertion position to end of text, and free new string */ XmTextFieldSetInsertionPosition( w->selection_box.text, XmTextFieldGetLastPosition( w->selection_box.text)) ; XtFree (strNew); _XmAppUnlock(app); return ; } /**************************************************************** * Print a blank string and error string, which will get removed the next * time a string is added to the history. ****************/ void XmCommandError( Widget widget, XmString error ) { XmCommandWidget w = (XmCommandWidget)widget; XmString blankXmString; _XmWidgetToAppContext(widget); /****************/ if (error == NULL) return; _XmAppLock(app); /* If error is currently in list remove it, but leave (or add) blank item. */ if( w->command.error ) { XmListDeletePos (w->selection_box.list, 0); } else { blankXmString = XmStringCreate(" ", XmFONTLIST_DEFAULT_TAG); XmListAddItemUnselected (w->selection_box.list, blankXmString, 0); XmStringFree (blankXmString); w->command.error = TRUE; } /* create and add the error string as a list item */ XmListAddItemUnselected (w->selection_box.list, error, 0); XmListSetBottomPos (w->selection_box.list, 0); _XmAppUnlock(app); return ; } /**************************************************************** * This convenience function creates a DialogShell and a Command * child of the shell; returns the Command widget. ****************/ Widget XmCreateCommandDialog( Widget ds_p, String name, ArgList com_args, Cardinal com_n ) { return XmeCreateClassDialog (xmCommandWidgetClass, ds_p, name, com_args, com_n) ; } motif-2.3.8/lib/Xm/XpmCrBufFrP.c0000644000175000017500000000603512672140200013155 00000000000000/* $XConsortium: XpmCrBufFrP.c /main/2 1996/09/20 08:01:38 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrBufFrP.c: * * * * XPM library * * Scan a pixmap and possibly its mask and create an XPM buffer * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmCreateBufferFromPixmap(display, buffer_return, pixmap, shapemask, attributes) Display *display; char **buffer_return; Pixmap pixmap; Pixmap shapemask; XpmAttributes *attributes; { XImage *ximage = NULL; XImage *shapeimage = NULL; unsigned int width = 0; unsigned int height = 0; int ErrorStatus; /* get geometry */ if (attributes && attributes->valuemask & XpmSize) { width = attributes->width; height = attributes->height; } /* get the ximages */ if (pixmap) xpmCreateImageFromPixmap(display, pixmap, &ximage, &width, &height); if (shapemask) xpmCreateImageFromPixmap(display, shapemask, &shapeimage, &width, &height); /* create the buffer */ ErrorStatus = XpmCreateBufferFromImage(display, buffer_return, ximage, shapeimage, attributes); /* destroy the ximages */ if (ximage) XDestroyImage(ximage); if (shapeimage) XDestroyImage(shapeimage); return (ErrorStatus); } motif-2.3.8/lib/Xm/Synthetic.c0000644000175000017500000004772012672140200013037 00000000000000/* $TOG: Synthetic.c /main/8 1999/04/13 13:21:09 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include #include #ifdef PRINTING_SUPPORTED #include #endif #include "SyntheticI.h" /******* Static Function Declarations ********/ static void GetValuesHook(Widget w, XtPointer base, Widget alt_w, XtPointer alt_base, Cardinal alt_mask, XmSyntheticResource *resources, int num_resources, ArgList args, Cardinal num_args) ; static void ConstraintGetValuesHook(Widget w, Widget alt_w, Cardinal alt_mask, ArgList args, Cardinal *num_args) ; static void ImportArgs(Widget w, XtPointer base, Widget alt_w, XtPointer alt_base, Cardinal alt_mask, XmSyntheticResource *resources, int num_resources, ArgList args, Cardinal num_args) ; static void ImportConstraintArgs(Widget w, Widget alt_w, Cardinal alt_mask, ArgList args, Cardinal *num_args) ; /******** End Static Function Declarations ********/ /********************************************************************** * * _XmBuildResources * Build up a new synthetic resource list based on a combination * the the widget's class and super class resource list. * **********************************************************************/ void _XmBuildResources(XmSyntheticResource **wc_resources_ptr, int *wc_num_resources_ptr, XmSyntheticResource *sc_resources, int sc_num_resources) { XmSyntheticResource *wc_resources; int wc_num_resources; XmSyntheticResource *new_resources; int new_num_resources; int i, j; Boolean override; wc_resources = (XmSyntheticResource *) *wc_resources_ptr; wc_num_resources = (int) *wc_num_resources_ptr; /* If there are no new resources, just use the super class data */ if (wc_num_resources == 0) { *wc_resources_ptr = sc_resources; *wc_num_resources_ptr = sc_num_resources; return; } /* * Allocate a new resource list to contain the combined set of * resources from the class and super class. This allocation * may create to much space if there are overrides in the new * resource list. Copy sc's resources into the space. */ new_resources = (XmSyntheticResource *) XtMalloc(sizeof (XmSyntheticResource) * (wc_num_resources + sc_num_resources)); if (sc_num_resources) memcpy ((char *) new_resources, (char *) sc_resources, sc_num_resources * sizeof (XmSyntheticResource)); /* * Loop through the wc resources and copy * them into the new resources */ new_num_resources = sc_num_resources; for (i = 0; i < wc_num_resources; i++) { /* First check to see if this is an override */ override = False; for (j = 0; j < sc_num_resources; j++) { /* ??? * We do name overrides while the intrinsics do offset overrides. * Be sure to mask off alt_mask if we change this. */ if (new_resources[j].resource_name == wc_resources[i].resource_name) { override = True; new_resources[j].export_proc = wc_resources[i].export_proc; new_resources[j].import_proc = wc_resources[i].import_proc; break; } } /* If it wasn't an override stuff it into the list */ if (override == False) new_resources[new_num_resources++] = wc_resources[i]; } /* Replace the resource list and count will the new one. */ *wc_resources_ptr = new_resources; *wc_num_resources_ptr = new_num_resources; } /********************************************************************** * * InitializeSyntheticResources * Initialize a synthetic resource list. This is called before * Primitive, Manager and Gadgets build resources to convert the * resource names to quarks in the class' synthetic processing * lists. * **********************************************************************/ void _XmInitializeSyntheticResources(XmSyntheticResource *resources, int num_resources ) { register int i; for (i = 0; i < num_resources; i++) resources[i].resource_name = (String) XrmPermStringToQuark (resources[i].resource_name); } /********************************************************************** * * GetValuesHook * This procedure is used as the synthetic hook in Primitive, * Manager, and Gadget. It uses the synthetic resource list * attached to the class, comparing it to the input resource list, * and for each match, calling the function to process the get * value data. * **********************************************************************/ static void GetValuesHook(Widget w, XtPointer base, Widget alt_w, XtPointer alt_base, Cardinal alt_mask, XmSyntheticResource *resources, int num_resources, ArgList args, Cardinal num_args) { int i, j; XrmQuark quark; XtArgVal value; XtArgVal orig_value; Cardinal value_size; XtPointer value_ptr; Widget value_widget; Cardinal value_offset; /* Loop through each argument, quarkifing the name. Then loop */ /* through each synthetic resource to see if there is a match. */ for (i = 0; i < num_args; i++) { quark = XrmStringToQuark (args[i].name); for (j = 0; j < num_resources; j++) { if ((resources[j].export_proc) && (XrmQuark)(resources[j].resource_name) == quark) { value_size = resources[j].resource_size; /* CR 5385: Use alt_w and alt_base if alt_mask is set in the */ /* offset. This lets extension sythetic resources */ /* point to the "real" widget class resources. */ value_offset = resources[j].resource_offset; if (value_offset & alt_mask) { value_widget = alt_w; value_offset &= ~alt_mask; value_ptr = (XtPointer) ((char *) alt_base + value_offset); } else { value_widget = w; value_ptr = (XtPointer) ((char *) base + value_offset); } if (value_size == sizeof(long)) value = (XtArgVal)(*(long *)value_ptr); else if (value_size == sizeof(int)) value = (XtArgVal)(*(int *)value_ptr); else if (value_size == sizeof(short)) value = (XtArgVal)(*(short *)value_ptr); else if (value_size == sizeof(char)) value = (XtArgVal)(*(char *)value_ptr); else value = *(XtArgVal*)value_ptr; orig_value = value; (*(resources[j].export_proc)) (value_widget, value_offset, &value); #if defined(GETVALUES_BUG) /* if the value that was in the widget prior to calling the get hook is the same as the one put by Xt in the arg list, we are in the XtSetArg(args[i], XtNfoo, NULL) case, where args[i].value is supposed to receive the result of the conversion. */ if (orig_value == args[i].value) { args[i].value = value; } else #endif { value_ptr = (XtPointer) args[i].value; if (value_size == sizeof(long)) *(long *) value_ptr = (long) value; else if (value_size == sizeof(int)) *(int *) value_ptr = (int) value; else if (value_size == sizeof(short)) *(short *) value_ptr = (short) value; else if (value_size == sizeof(char)) *(char *) value_ptr = (char) value; else *(XtArgVal*) value_ptr = value; } break; } } } } /********************************************************************** * * ConstraintGetValuesHook * When a widget is a child of a constraint manager, this function * processes the synthetic arg list with for any constraint based * resource processing that needs to be done. * **********************************************************************/ static void ConstraintGetValuesHook(Widget w, Widget alt_w, Cardinal alt_mask, ArgList args, Cardinal *num_args ) { XmManagerWidgetClass parent_wc = (XmManagerWidgetClass) w->core.parent->core.widget_class; if (XmIsManager(w->core.parent) && parent_wc->manager_class.num_syn_constraint_resources) GetValuesHook(w, w->core.constraints, alt_w, alt_w->core.constraints, alt_mask, parent_wc->manager_class.syn_constraint_resources, parent_wc->manager_class.num_syn_constraint_resources, args, *num_args); } /********************************************************************** * * _XmPrimitiveGetValuesHook * Process the synthetic resources that need to be synthesized * **********************************************************************/ void _XmPrimitiveGetValuesHook( Widget w, ArgList args, Cardinal *num_args ) { XmPrimitiveWidgetClass wc; _XmProcessLock(); wc = (XmPrimitiveWidgetClass) w->core.widget_class; if (wc->primitive_class.num_syn_resources != 0) GetValuesHook (w, (XtPointer)w, w, (XtPointer)w, None, wc->primitive_class.syn_resources, wc->primitive_class.num_syn_resources, args, *num_args); if (w->core.constraints != NULL) ConstraintGetValuesHook (w, w, None, args, num_args); _XmProcessUnlock(); } /********************************************************************** * * _XmGadgetGetValuesHook * Process the synthetic resources that need to be synthesized * **********************************************************************/ void _XmGadgetGetValuesHook(Widget w, ArgList args, Cardinal *num_args ) { XmGadgetClass wc; _XmProcessLock(); wc = (XmGadgetClass) w->core.widget_class; if (wc->gadget_class.num_syn_resources != 0) GetValuesHook (w, (XtPointer) w, w, (XtPointer) w, None, wc->gadget_class.syn_resources, wc->gadget_class.num_syn_resources, args, *num_args); if (w->core.constraints != NULL) ConstraintGetValuesHook (w, w, None, args, num_args); _XmProcessUnlock(); } /********************************************************************** * * _XmManagerGetValuesHook * Process the synthetic resources that need to be synthesized * **********************************************************************/ void _XmManagerGetValuesHook(Widget w, ArgList args, Cardinal *num_args) { XmManagerWidgetClass wc; _XmProcessLock(); wc = (XmManagerWidgetClass) w->core.widget_class; if (wc->manager_class.num_syn_resources != 0) GetValuesHook (w, (XtPointer) w, w, (XtPointer) w, None, wc->manager_class.syn_resources, wc->manager_class.num_syn_resources, args, *num_args); if (w->core.constraints != NULL) ConstraintGetValuesHook (w, w, None, args, num_args); _XmProcessUnlock(); } #ifdef PRINTING_SUPPORTED /********************************************************************** * * _XmPrintShellGetValuesHook * Process the synthetic resources that need to be synthesized * **********************************************************************/ void _XmPrintShellGetValuesHook(Widget w, ArgList args, Cardinal *num_args) { XmPrintShellWidgetClass wc; _XmProcessLock(); wc = (XmPrintShellWidgetClass) w->core.widget_class; if (wc->print_shell_class.num_syn_resources != 0) GetValuesHook (w, (XtPointer) w, w, (XtPointer) w, None, wc->print_shell_class.syn_resources, wc->print_shell_class.num_syn_resources, args, *num_args); _XmProcessUnlock(); } #endif /* PRINTING_SUPPORTED */ /********************************************************************** * * _XmExtGetValuesHook * Process the synthetic resources that need to be synthesized * **********************************************************************/ void _XmExtGetValuesHook(Widget w, ArgList args, Cardinal *num_args ) { XmExtObjectClass wc; Widget parent; _XmProcessLock(); wc = (XmExtObjectClass)XtClass(w); parent = ((XmExtObject)w)->ext.logicalParent; if (wc->ext_class.num_syn_resources != 0) GetValuesHook(w, (XtPointer) w, parent, (XtPointer) parent, XmLOGICAL_PARENT_RESOURCE, wc->ext_class.syn_resources, wc->ext_class.num_syn_resources, args, *num_args); _XmProcessUnlock(); } /********************************************************************** * * ImportArgs * Convert the value in the arg list from the application type to the * appropriate internal representation by calling the import_proc * specified for the given resource. * **********************************************************************/ static void ImportArgs(Widget w, XtPointer base, Widget alt_w, XtPointer alt_base, Cardinal alt_mask, XmSyntheticResource *resources, int num_resources, ArgList args, Cardinal num_args ) { int i, j; XrmQuark quark; XtArgVal value; Cardinal value_size; XtPointer value_ptr; Cardinal value_offset; Widget value_widget; XtPointer value_base; XmImportOperator op; /* Loop through each argument, quarkifing the name. Then loop */ /* through each synthetic resource to see if there is a match. */ for (i = 0; i < num_args; i++) { quark = XrmStringToQuark (args[i].name); for (j = 0; j < num_resources; j++) { if ((resources[j].import_proc) && (XrmQuark)(resources[j].resource_name) == quark) { value = args[i].value; /* CR 5385: Let VendorSE mix real and extension resources. */ value_offset = resources[j].resource_offset; if (value_offset & alt_mask) { value_offset &= ~alt_mask; value_widget = alt_w; value_base = alt_base; } else { value_base = base; value_widget = w; } op = (*(resources[j].import_proc)) (value_widget, value_offset, &value); if ((op == XmSYNTHETIC_LOAD) && (value_base != NULL)) { /* Load the converted value into the structure */ value_size = resources[j].resource_size; value_ptr = (XtPointer) ((char *) value_base + value_offset); if (value_size == sizeof(long)) *(long *) value_ptr = (long) value; else if (value_size == sizeof(int)) *(int *) value_ptr = (int) value; else if (value_size == sizeof(short)) *(short *) value_ptr = (short) value; else if (value_size == sizeof(char)) *(char *) value_ptr = (char) value; else *(XtArgVal*) value_ptr= value; } else { args[i].value = value; } break; } } } } /********************************************************************** * * ImportConstraintArgs * When a widget is a child of a constraint manager, this function * processes the synthetic arg list with for any constraint based * resource processing that needs to be done. * **********************************************************************/ static void ImportConstraintArgs(Widget w, Widget alt_w, Cardinal alt_mask, ArgList args, Cardinal *num_args ) { XmManagerWidgetClass parent_wc = (XmManagerWidgetClass) w->core.parent->core.widget_class; if (XmIsManager(w->core.parent) && parent_wc->manager_class.num_syn_constraint_resources) ImportArgs(w, w->core.constraints, alt_w, alt_w->core.constraints, alt_mask, parent_wc->manager_class.syn_constraint_resources, parent_wc->manager_class.num_syn_constraint_resources, args, *num_args); } /********************************************************************** * * _XmExtImportArgs * Does arg importing for sub-classes of VendorExt. * **********************************************************************/ void _XmExtImportArgs(Widget w, ArgList args, Cardinal *num_args ) { XmExtObjectClass wc; Widget parent; _XmProcessLock(); wc = (XmExtObjectClass)XtClass(w); parent = ((XmExtObject)w)->ext.logicalParent; if (wc->ext_class.num_syn_resources != 0) ImportArgs(w, (XtPointer) w, parent, (XtPointer)parent, XmLOGICAL_PARENT_RESOURCE, wc->ext_class.syn_resources, wc->ext_class.num_syn_resources, args, *num_args); _XmProcessUnlock(); } /********************************************************************** * * _XmPrimitiveImportArgs * Does arg importing for sub-classes of XmPrimitive. * **********************************************************************/ void _XmPrimitiveImportArgs(Widget w, ArgList args, Cardinal *num_args ) { XmPrimitiveWidgetClass wc; _XmProcessLock(); wc = (XmPrimitiveWidgetClass) w->core.widget_class; if (wc->primitive_class.num_syn_resources != 0) ImportArgs (w, (XtPointer) w, w, (XtPointer) w, None, wc->primitive_class.syn_resources, wc->primitive_class.num_syn_resources, args, *num_args); if (w->core.constraints != NULL) ImportConstraintArgs (w, w, None, args, num_args); _XmProcessUnlock(); } /********************************************************************** * * _XmGadgetImportArgs * Does arg importing for sub-classes of XmGadget. * **********************************************************************/ void _XmGadgetImportArgs(Widget w, ArgList args, Cardinal *num_args ) { XmGadgetClass wc; /* Main object args */ _XmProcessLock(); wc = (XmGadgetClass) w->core.widget_class; if (wc->gadget_class.num_syn_resources != 0) ImportArgs (w, (XtPointer) w, w, (XtPointer) w, None, wc->gadget_class.syn_resources, wc->gadget_class.num_syn_resources, args, *num_args); if (w->core.constraints != NULL) ImportConstraintArgs (w, w, None, args, num_args); _XmProcessUnlock(); } /********************************************************************** * * _XmGadgetImportSecondaryArgs * Does arg importing for sub-classes of XmGadget which have secondary * objects. * **********************************************************************/ void _XmGadgetImportSecondaryArgs(Widget w, ArgList args, Cardinal *num_args) { XmGadgetClass wc; XmBaseClassExt *classExtPtr; XmExtClassRec *secondaryObjClass; _XmProcessLock(); wc = (XmGadgetClass) w->core.widget_class; classExtPtr = _XmGetBaseClassExtPtr(wc, XmQmotif); secondaryObjClass = (XmExtClassRec *) ((*classExtPtr)->secondaryObjectClass); /* Secondary object args */ if ((secondaryObjClass != NULL) && (secondaryObjClass->ext_class.num_syn_resources != 0)) ImportArgs (w, NULL, w, NULL, None, secondaryObjClass->ext_class.syn_resources, secondaryObjClass->ext_class.num_syn_resources, args, *num_args); _XmProcessUnlock(); } /********************************************************************** * * _XmManagerImportArgs * Does arg importing for sub-classes of XmManager. * **********************************************************************/ void _XmManagerImportArgs(Widget w, ArgList args, Cardinal *num_args ) { XmManagerWidgetClass wc = (XmManagerWidgetClass) w->core.widget_class; _XmProcessLock(); wc = (XmManagerWidgetClass) w->core.widget_class; if (wc->manager_class.num_syn_resources != 0) ImportArgs (w, (XtPointer) w, w, (XtPointer) w, None, wc->manager_class.syn_resources, wc->manager_class.num_syn_resources, args, *num_args); if (w->core.constraints != NULL) ImportConstraintArgs (w, w, None, args, num_args); _XmProcessUnlock(); } motif-2.3.8/lib/Xm/PrintSI.h0000644000175000017500000000234313145162623012423 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmPrintSI_h #define _XmPrintSI_h #include #ifdef __cplusplus extern "C" { #endif extern XContext _XmPrintScreenToShellContext; extern Cardinal _XmPrintShellCounter ; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPrintSI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/TxtPropCv.h0000644000175000017500000000326112672140200012773 00000000000000/* $XConsortium: TxtPropCv.h /main/5 1995/07/15 20:56:52 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmTxtPropCvP_h #define _XmTxtPropCvP_h #include #ifdef __cplusplus extern "C" { #endif /******** Public Function Declarations ********/ extern int XmCvtXmStringTableToTextProperty(Display *display, XmStringTable string_table, int count, XmICCEncodingStyle style, XTextProperty *text_prop_return); extern int XmCvtTextPropertyToXmStringTable(Display *display, XTextProperty *text_prop, XmStringTable *string_table_return, int *count_return); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTxtPropCvP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmRdFToI.c0000644000175000017500000001507212672140200012634 00000000000000/* $TOG: XpmRdFToI.c /main/8 1998/07/22 15:43:27 mgreess $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * RdFToI.c: * * * * XPM library * * Parse an XPM file and create the image and possibly its mask * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" #include #include #if !defined(NO_ZPIPE) && defined(WIN32) # define popen _popen # define pclose _pclose # if defined(STAT_ZFILE) # include # define stat _stat # define fstat _fstat # endif #endif LFUNC(OpenReadFile, int, (char *filename, xpmData *mdata)); LFUNC(xpmDataClose, void, (xpmData *mdata)); int XpmReadFileToImage(display, filename, image_return, shapeimage_return, attributes) Display *display; char *filename; XImage **image_return; XImage **shapeimage_return; XpmAttributes *attributes; { XpmImage image; XpmInfo info; int ErrorStatus; xpmData mdata; xpmInitXpmImage(&image); xpmInitXpmInfo(&info); /* open file to read */ if ((ErrorStatus = OpenReadFile(filename, &mdata)) != XpmSuccess) return (ErrorStatus); /* create the XImage from the XpmData */ if (attributes) { xpmInitAttributes(attributes); xpmSetInfoMask(&info, attributes); ErrorStatus = xpmParseDataAndCreate(display, &mdata, image_return, shapeimage_return, &image, &info, attributes); } else ErrorStatus = xpmParseDataAndCreate(display, &mdata, image_return, shapeimage_return, &image, NULL, attributes); if (attributes) { if (ErrorStatus >= 0) /* no fatal error */ xpmSetAttributes(attributes, &image, &info); XpmFreeXpmInfo(&info); } xpmDataClose(&mdata); /* free the XpmImage */ XpmFreeXpmImage(&image); return (ErrorStatus); } int XpmReadFileToXpmImage(filename, image, info) char *filename; XpmImage *image; XpmInfo *info; { xpmData mdata; int ErrorStatus; /* init returned values */ xpmInitXpmImage(image); xpmInitXpmInfo(info); /* open file to read */ if ((ErrorStatus = OpenReadFile(filename, &mdata)) != XpmSuccess) return (ErrorStatus); /* create the XpmImage from the XpmData */ ErrorStatus = xpmParseData(&mdata, image, info); xpmDataClose(&mdata); return (ErrorStatus); } /* * open the given file to be read as an xpmData which is returned. */ #ifndef NO_ZPIPE FILE *Xpms_popen(char *cmd, const char *type); #else # define Xpms_popen popen #endif static int OpenReadFile(filename, mdata) char *filename; xpmData *mdata; { #ifndef NO_ZPIPE char *compressfile, buf[(2*MAXPATHLEN) + 1]; # ifdef STAT_ZFILE struct stat status; # endif #endif if (!filename) { mdata->stream.file = (stdin); mdata->type = XPMFILE; } else { #ifndef NO_ZPIPE size_t len = strlen(filename); if(len == 0 || filename[len-1] == '/') return(XpmOpenFailed); if ((len > 2) && !strcmp(".Z", filename + (len - 2))) { mdata->type = XPMPIPE; snprintf(buf, sizeof(buf), "uncompress -c \"%s\"", filename); if (!(mdata->stream.file = Xpms_popen(buf, "r"))) return (XpmOpenFailed); } else if ((len > 3) && !strcmp(".gz", filename + (len - 3))) { mdata->type = XPMPIPE; snprintf(buf, sizeof(buf), "gunzip -qc \"%s\"", filename); if (!(mdata->stream.file = Xpms_popen(buf, "r"))) return (XpmOpenFailed); } else { # ifdef STAT_ZFILE if (!(compressfile = (char *) XpmMalloc(len + 4))) return (XpmNoMemory); snprintf(compressfile, len+4, "%s.Z", filename); if (!stat(compressfile, &status)) { snprintf(buf, sizeof(buf), "uncompress -c \"%s\"", compressfile); if (!(mdata->stream.file = Xpms_popen(buf, "r"))) { XpmFree(compressfile); return (XpmOpenFailed); } mdata->type = XPMPIPE; } else { snprintf(compressfile, len+4, "%s.gz", filename); if (!stat(compressfile, &status)) { snprintf(buf, sizeof(buf), "gunzip -c \"%s\"", compressfile); if (!(mdata->stream.file = Xpms_popen(buf, "r"))) { XpmFree(compressfile); return (XpmOpenFailed); } mdata->type = XPMPIPE; } else { # endif #endif if (!(mdata->stream.file = fopen(filename, "r"))) { #if !defined(NO_ZPIPE) && defined(STAT_ZFILE) XpmFree(compressfile); #endif return (XpmOpenFailed); } mdata->type = XPMFILE; #ifndef NO_ZPIPE # ifdef STAT_ZFILE } } XpmFree(compressfile); # endif } #endif } mdata->CommentLength = 0; return (XpmSuccess); } /* * close the file related to the xpmData if any */ static void xpmDataClose(mdata) xpmData *mdata; { switch (mdata->type) { case XPMFILE: if (mdata->stream.file != (stdin)) fclose(mdata->stream.file); break; #ifndef NO_ZPIPE case XPMPIPE: fclose(mdata->stream.file); break; #endif } } motif-2.3.8/lib/Xm/GadgetI.h0000644000175000017500000000261712672140200012372 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: GadgetI.h /main/5 1995/07/13 17:27:09 drk $ */ #ifndef _XmGadgetI_h #define _XmGadgetI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmBuildGadgetResources(WidgetClass c) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGadgetI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmWrFFrI.c0000644000175000017500000002274312672140200012647 00000000000000/* $TOG: XpmWrFFrI.c /main/3 1998/07/22 15:43:49 mgreess $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * WrFFrI.c: * * * * XPM library * * Write an image and possibly its mask to an XPM file * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" #if !defined(NO_ZPIPE) && defined(WIN32) # define popen _popen # define pclose _pclose #endif /* MS Windows define a function called WriteFile @#%#&!!! */ LFUNC(xpmWriteFile, int, (FILE *file, XpmImage *image, char *name, XpmInfo *info)); LFUNC(WriteColors, void, (FILE *file, XpmColor *colors, unsigned int ncolors)); LFUNC(WritePixels, int, (FILE *file, unsigned int width, unsigned int height, unsigned int cpp, unsigned int *pixels, XpmColor *colors)); LFUNC(WriteExtensions, void, (FILE *file, XpmExtension *ext, unsigned int num)); LFUNC(OpenWriteFile, int, (char *filename, xpmData *mdata)); LFUNC(xpmDataClose, void, (xpmData *mdata)); int XpmWriteFileFromImage(display, filename, image, shapeimage, attributes) Display *display; char *filename; XImage *image; XImage *shapeimage; XpmAttributes *attributes; { XpmImage xpmimage; XpmInfo info; int ErrorStatus; /* create an XpmImage from the image */ ErrorStatus = XpmCreateXpmImageFromImage(display, image, shapeimage, &xpmimage, attributes); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* write the file from the XpmImage */ if (attributes) { xpmSetInfo(&info, attributes); ErrorStatus = XpmWriteFileFromXpmImage(filename, &xpmimage, &info); } else ErrorStatus = XpmWriteFileFromXpmImage(filename, &xpmimage, NULL); /* free the XpmImage */ XpmFreeXpmImage(&xpmimage); return (ErrorStatus); } int XpmWriteFileFromXpmImage(filename, image, info) char *filename; XpmImage *image; XpmInfo *info; { xpmData mdata; char *name, *dot, *s, new_name[BUFSIZ] = {0}; int ErrorStatus; /* open file to write */ if ((ErrorStatus = OpenWriteFile(filename, &mdata)) != XpmSuccess) return (ErrorStatus); /* figure out a name */ if (filename) { #ifdef VMS name = filename; #else if (!(name = rindex(filename, '/'))) name = filename; else name++; #endif /* let's try to make a valid C syntax name */ if ((dot = index(name, '.'))) { strncpy(new_name, name, sizeof(new_name)); new_name[sizeof(new_name)-1] = 0; /* change '.' to '_' */ name = s = new_name; while ((dot = index(s, '.'))) { *dot = '_'; s = dot; } } if ((dot = index(name, '-'))) { if (name != new_name) { strncpy(new_name, name, sizeof(new_name)); new_name[sizeof(new_name)-1] = 0; name = new_name; } /* change '-' to '_' */ s = name; while ((dot = index(s, '-'))) { *dot = '_'; s = dot; } } } else name = "image_name"; /* write the XpmData from the XpmImage */ if (ErrorStatus == XpmSuccess) ErrorStatus = xpmWriteFile(mdata.stream.file, image, name, info); xpmDataClose(&mdata); return (ErrorStatus); } static int xpmWriteFile(file, image, name, info) FILE *file; XpmImage *image; char *name; XpmInfo *info; { /* calculation variables */ unsigned int cmts, extensions; int ErrorStatus; cmts = info && (info->valuemask & XpmComments); extensions = info && (info->valuemask & XpmExtensions) && info->nextensions; /* print the header line */ fprintf(file, "/* XPM */\nstatic char * %s[] = {\n", name); /* print the hints line */ if (cmts && info->hints_cmt) fprintf(file, "/*%s*/\n", info->hints_cmt); fprintf(file, "\"%d %d %d %d", image->width, image->height, image->ncolors, image->cpp); if (info && (info->valuemask & XpmHotspot)) fprintf(file, " %d %d", info->x_hotspot, info->y_hotspot); if (extensions) fprintf(file, " XPMEXT"); fprintf(file, "\",\n"); /* print colors */ if (cmts && info->colors_cmt) fprintf(file, "/*%s*/\n", info->colors_cmt); WriteColors(file, image->colorTable, image->ncolors); /* print pixels */ if (cmts && info->pixels_cmt) fprintf(file, "/*%s*/\n", info->pixels_cmt); ErrorStatus = WritePixels(file, image->width, image->height, image->cpp, image->data, image->colorTable); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* print extensions */ if (extensions) WriteExtensions(file, info->extensions, info->nextensions); /* close the array */ fprintf(file, "};\n"); return (XpmSuccess); } static void WriteColors(file, colors, ncolors) FILE *file; XpmColor *colors; unsigned int ncolors; { unsigned int a, key; char *s; char **defaults; for (a = 0; a < ncolors; a++, colors++) { defaults = (char **) colors; fprintf(file, "\"%s", *defaults++); for (key = 1; key <= NKEYS; key++, defaults++) { if ((s = *defaults)) fprintf(file, "\t%s %s", xpmColorKeys[key - 1], s); } fprintf(file, "\",\n"); } } static int WritePixels(file, width, height, cpp, pixels, colors) FILE *file; unsigned int width; unsigned int height; unsigned int cpp; unsigned int *pixels; XpmColor *colors; { char *s, *p, *buf; unsigned int x, y, h; h = height - 1; if (cpp != 0 && width >= (UINT_MAX - 3)/cpp) return XpmNoMemory; p = buf = (char *) XpmMalloc(width * cpp + 3); if (!buf) return (XpmNoMemory); *buf = '"'; p++; for (y = 0; y < h; y++) { s = p; for (x = 0; x < width; x++, pixels++) { strncpy(s, colors[*pixels].string, cpp); s += cpp; } *s++ = '"'; *s = '\0'; fprintf(file, "%s,\n", buf); } /* duplicate some code to avoid a test in the loop */ s = p; for (x = 0; x < width; x++, pixels++) { strncpy(s, colors[*pixels].string, cpp); s += cpp; } *s++ = '"'; *s = '\0'; fprintf(file, "%s", buf); XpmFree(buf); return (XpmSuccess); } static void WriteExtensions(file, ext, num) FILE *file; XpmExtension *ext; unsigned int num; { unsigned int x, y, n; char **line; for (x = 0; x < num; x++, ext++) { fprintf(file, ",\n\"XPMEXT %s\"", ext->name); n = ext->nlines; for (y = 0, line = ext->lines; y < n; y++, line++) fprintf(file, ",\n\"%s\"", *line); } fprintf(file, ",\n\"XPMENDEXT\""); } /* * open the given file to be written as an xpmData which is returned */ #ifndef NO_ZPIPE FILE *Xpms_popen(char *cmd, const char *type); #else # define Xpms_popen popen #endif static int OpenWriteFile(filename, mdata) char *filename; xpmData *mdata; { #ifndef NO_ZPIPE char buf[BUFSIZ]; #endif if (!filename) { mdata->stream.file = (stdout); mdata->type = XPMFILE; } else { #ifndef NO_ZPIPE size_t len = strlen(filename); if(len == 0) return(XpmOpenFailed); if (len > 2 && !strcmp(".Z", filename + (len - 2))) { snprintf(buf, sizeof(buf), "compress > \"%s\"", filename); if (!(mdata->stream.file = Xpms_popen(buf, "w"))) return (XpmOpenFailed); mdata->type = XPMPIPE; } else if (len > 3 && !strcmp(".gz", filename + (len - 3))) { snprintf(buf, sizeof(buf), "gzip -q > \"%s\"", filename); if (!(mdata->stream.file = Xpms_popen(buf, "w"))) return (XpmOpenFailed); mdata->type = XPMPIPE; } else { #endif if (!(mdata->stream.file = fopen(filename, "w"))) return (XpmOpenFailed); mdata->type = XPMFILE; #ifndef NO_ZPIPE } #endif } return (XpmSuccess); } /* * close the file related to the xpmData if any */ static void xpmDataClose(mdata) xpmData *mdata; { switch (mdata->type) { case XPMFILE: if (mdata->stream.file != (stdout)) fclose(mdata->stream.file); break; #ifndef NO_ZPIPE case XPMPIPE: fclose(mdata->stream.file); break; #endif } } motif-2.3.8/lib/Xm/BulletinB.h0000644000175000017500000000446213145162623012757 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmBulletinBoard_h #define _XmBulletinBoard_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmBulletinBoardWidgetClass; typedef struct _XmBulletinBoardClassRec * XmBulletinBoardWidgetClass; typedef struct _XmBulletinBoardRec * XmBulletinBoardWidget; #ifndef XmIsBulletinBoard #define XmIsBulletinBoard(w) (XtIsSubclass (w, xmBulletinBoardWidgetClass)) #endif /******** Public Function Declarations ********/ extern Widget XmCreateBulletinBoard( Widget p, String name, ArgList args, Cardinal n) ; extern Widget XmCreateBulletinBoardDialog( Widget ds_p, String name, ArgList bb_args, Cardinal bb_n) ; /* * Variable argument list functions */ extern Widget XmVaCreateBulletinBoard( Widget parent, char *name, ...); extern Widget XmVaCreateManagedBulletinBoard( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmBulletinBoard_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PushB.c0000644000175000017500000026500013145162623012110 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: PushB.c /main/29 1999/01/27 16:08:33 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ColorI.h" #include "LabelI.h" #include "MenuProcI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "PrimitiveI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "XmI.h" #include "VaSimpleI.h" #include "ExtP.h" #define XmINVALID_MULTICLICK 255 #define DELAY_DEFAULT 100 #define FIX_1516 /******** Static Function Declarations ********/ static void Arm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void MultiArm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Activate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params) ; static void MultiActivate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params) ; static void ActivateCommon( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ArmTimeout( XtPointer data, XtIntervalId *id) ; static void Disarm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BtnDown( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BtnUp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Enter( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Leave( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BorderHighlight( Widget wid) ; static void DrawBorderHighlight( Widget wid) ; static void BorderUnhighlight( Widget wid) ; static void KeySelect( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetFillGC( XmPushButtonWidget pb) ; static void GetBackgroundGC( XmPushButtonWidget pb) ; static Boolean SetValuesPrehook( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Help( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Destroy( Widget w) ; static void Resize( Widget w) ; static void EraseDefaultButtonShadow( XmPushButtonWidget pb) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void DrawPushButtonBackground( XmPushButtonWidget pb) ; static void DrawPushButtonLabel( XmPushButtonWidget pb, XEvent *event, Region region) ; static void DrawPushButtonShadows( XmPushButtonWidget pb) ; static void ComputePBLabelArea( XmPushButtonWidget pb, XRectangle *box) ; static void DrawPBPrimitiveShadows( XmPushButtonWidget pb) ; static void DrawDefaultButtonShadows( XmPushButtonWidget pb) ; static XmImportOperator ShowAsDef_ToHorizPix( Widget widget, int offset, XtArgVal *value) ; static int AdjustHighLightThickness( XmPushButtonWidget new_w, XmPushButtonWidget current) ; static void ExportHighlightThickness( Widget widget, int offset, XtArgVal *value) ; static void FillBorderWithParentColor( XmPushButtonWidget pb, int borderwidth, int dx, int dy, int rectwidth, int rectheight) ; static void SetPushButtonSize( XmPushButtonWidget newtb) ; static void ChangeCB(Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) ; static void ShowAsDefault(Widget w, XtEnum state) ; static Boolean ParentVisualChanged(Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static void PB_FixTearoff(XmPushButtonWidget pb); /******** End Static Function Declarations ********/ /*************************************<->************************************* * * * Description: translation tables for class: PushButton * ----------- * * Matches events with string descriptors for internal routines. * *************************************<->***********************************/ static XtTranslations default_parsed; #define defaultTranslations _XmPushB_defaultTranslations static XtTranslations menu_parsed; #define menuTranslations _XmPushB_menuTranslations /*************************************<->************************************* * * * Description: action list for class: PushButton * ----------- * * Matches string descriptors with internal routines. * Note that Primitive will register additional event handlers * for traversal. * *************************************<->***********************************/ static XtActionsRec actionsList[] = { { "Arm", Arm }, { "MultiArm", MultiArm }, { "Activate", Activate }, { "MultiActivate", MultiActivate }, { "ArmAndActivate", ArmAndActivate }, { "Disarm", Disarm }, { "BtnDown", BtnDown }, { "BtnUp", BtnUp }, { "Enter", Enter }, { "Leave", Leave }, { "ButtonTakeFocus", _XmButtonTakeFocus }, { "MenuButtonTakeFocus", _XmMenuButtonTakeFocus }, { "MenuButtonTakeFocusUp", _XmMenuButtonTakeFocusUp }, { "KeySelect", KeySelect }, { "Help", Help }, }; /* The resource list for Push Button. */ static XtResource resources[] = { { XmNmultiClick, XmCMultiClick, XmRMultiClick, sizeof (unsigned char), XtOffsetOf(XmPushButtonRec, pushbutton.multiClick), XmRImmediate, (XtPointer) XmINVALID_MULTICLICK }, { XmNfillOnArm, XmCFillOnArm, XmRBoolean, sizeof (Boolean), XtOffsetOf(XmPushButtonRec, pushbutton.fill_on_arm), XmRImmediate, (XtPointer) True }, { XmNarmColor, XmCArmColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmPushButtonRec, pushbutton.arm_color), XmRCallProc, (XtPointer) _XmSelectColorDefault }, { XmNarmPixmap, XmCArmPixmap, XmRDynamicPixmap, sizeof (Pixmap), XtOffsetOf(XmPushButtonRec, pushbutton.arm_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNshowAsDefault, XmCShowAsDefault, XmRBooleanDimension, sizeof (Dimension), XtOffsetOf(XmPushButtonRec, pushbutton.show_as_default), XmRImmediate, (XtPointer) 0 }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmPushButtonRec, pushbutton.activate_callback), XmRPointer, (XtPointer) NULL }, { XmNarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmPushButtonRec, pushbutton.arm_callback), XmRPointer, (XtPointer) NULL }, { XmNdisarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmPushButtonRec, pushbutton.disarm_callback), XmRPointer, (XtPointer) NULL }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmPushButtonRec, primitive.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNdefaultButtonShadowThickness, XmCDefaultButtonShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmPushButtonRec, pushbutton.default_button_shadow_thickness), XmRImmediate, (XtPointer) 0 }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmPrimitiveRec, primitive.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, }; /* Synthetic resources list */ static XmSyntheticResource syn_resources[] = { { XmNshowAsDefault, sizeof (Dimension), XtOffsetOf(XmPushButtonRec, pushbutton.show_as_default), XmeFromHorizontalPixels, ShowAsDef_ToHorizPix }, { XmNdefaultButtonShadowThickness, sizeof (Dimension), XtOffsetOf(XmPushButtonRec, pushbutton.default_button_shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNhighlightThickness, sizeof (Dimension), XtOffsetOf(XmPrimitiveRec, primitive.highlight_thickness), ExportHighlightThickness, XmeToHorizontalPixels }, }; /*************************************<->************************************* * * * Description: global class record for instances of class: PushButton * ----------- * * Defines default field settings for this class record. * *************************************<->***********************************/ static XmBaseClassExtRec pushBBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ SetValuesPrehook, /* set_values prehook */ InitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ XmInheritGetSecResData, /* getSecResData */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ (XtWidgetClassProc)NULL, /* classPartInitPrehook */ (XtWidgetClassProc)NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; externaldef(xmpushbuttonclassrec) XmPushButtonClassRec xmPushButtonClassRec = { { /* core_class record */ /* superclass */ (WidgetClass) &xmLabelClassRec, /* class_name */ "XmPushButton", /* widget_size */ sizeof(XmPushButtonRec), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ (XtArgsProc)NULL, /* realize */ XtInheritRealize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterlv */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ (XtArgsFunc)NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ (XtArgsProc)NULL, /* accept_focus */ (XtAcceptFocusProc)NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ NULL, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator*/ (XtStringProc)NULL, /* extension record */ (XtPointer)&pushBBaseClassExtRec, }, { /* primitive_class record */ /* Primitive border_highlight */ BorderHighlight, /* Primitive border_unhighlight */ BorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ ArmAndActivate, /* get resources */ syn_resources, /* num get_resources */ XtNumber(syn_resources), /* extension */ NULL, }, { /* label_class record */ /* setOverrideCallback*/ XmInheritWidgetProc, /* menu procedures */ XmInheritMenuProc, /* menu traversal xlation */ XtInheritTranslations, /* extension */ (XtPointer) NULL, }, { /* pushbutton_class record */ /* extension */ (XtPointer) NULL, } }; externaldef(xmpushbuttonwidgetclass) WidgetClass xmPushButtonWidgetClass = (WidgetClass)&xmPushButtonClassRec; /* Activatable Trait record for pushButton */ static XmConst XmActivatableTraitRec pushButtonAT = { 0, /* version */ ChangeCB, }; /* Care visual Trait record for pushButton */ static XmConst XmCareVisualTraitRec pushButtonCVT = { 0, /* version */ ParentVisualChanged, }; /* TakesDefault Trait record for pushButton */ static XmConst XmTakesDefaultTraitRec pushButtonTDT = { 0, /* version */ ShowAsDefault, }; /* Menu Savvy trait record */ static XmMenuSavvyTraitRec MenuSavvyRecord = { /* version: */ -1, NULL, NULL, NULL, _XmCBNameActivate, }; /*************************************<->************************************* * * Synthetic hooks * *************************************<->***********************************/ static XmImportOperator ShowAsDef_ToHorizPix( Widget widget, int offset, XtArgVal *value ) { XtArgVal oldValue ; XmImportOperator returnVal ; oldValue = *value ; returnVal = XmeToHorizontalPixels (widget, offset, value) ; if (oldValue && !*value) *value = (XtArgVal) 1; return (returnVal) ; } static void ExportHighlightThickness( Widget widget, int offset, XtArgVal *value ) { XmPushButtonWidget pbw = (XmPushButtonWidget) widget; if (pbw->pushbutton.show_as_default || pbw->pushbutton.default_button_shadow_thickness) { if ((int)*value >= Xm3D_ENHANCE_PIXEL) *value -= Xm3D_ENHANCE_PIXEL; } XmeFromHorizontalPixels (widget, offset, value); } /*************************************<->************************************* * * ClassInitialize * *************************************<->***********************************/ static void ClassInitialize( void ) { /* parse the various translation tables */ menu_parsed = XtParseTranslationTable(menuTranslations); default_parsed = XtParseTranslationTable(defaultTranslations); /* set up base class extension quark */ pushBBaseClassExtRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmPUSH_BUTTON_BIT); /* Install the menu savvy trait record, copying fields from XmLabel */ _XmLabelCloneMenuSavvy (wc, &MenuSavvyRecord); /* Install the activatable trait for all subclasses */ XmeTraitSet((XtPointer) wc, XmQTactivatable, (XtPointer) &pushButtonAT); /* Install the takesDefault trait for all subclasses */ XmeTraitSet((XtPointer) wc, XmQTtakesDefault, (XtPointer) &pushButtonTDT); /* Override primitive's careParentVisual trait for all subclasses. */ XmeTraitSet((XtPointer) wc, XmQTcareParentVisual, (XtPointer)&pushButtonCVT); } /************************************************************ * * InitializePrehook * * Put the proper translations in core_class tm_table so that * the data is massaged correctly * ************************************************************/ /*ARGSUSED*/ static void InitializePrehook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmPushButtonWidget bw = (XmPushButtonWidget) new_w; unsigned char type; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(new_w)), XmQTmenuSystem); _XmSaveCoreClassTranslations (new_w); if (menuSTrait != NULL) type = menuSTrait->type(XtParent(new_w)); else type = XmWORK_AREA; _XmProcessLock(); if (type == XmMENU_PULLDOWN || type == XmMENU_POPUP) new_w->core.widget_class->core_class.tm_table = (String) menu_parsed; else new_w->core.widget_class->core_class.tm_table = (String) default_parsed; /* CR 2990: Use XmNbuttonFontList as the default font. */ if (bw->label.font == NULL) bw->label.font = XmeGetDefaultRenderTable (new_w, XmBUTTON_FONTLIST); _XmProcessUnlock(); } /************************************************************ * * InitializePosthook * * restore core class translations * ************************************************************/ /*ARGSUSED*/ static void InitializePosthook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { _XmRestoreCoreClassTranslations (new_w); } /************************************************************************ * * GetFillGC * Get the graphics context used for filling in background of button. * ************************************************************************/ static void GetFillGC( XmPushButtonWidget pb ) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground | GCFillStyle; values.foreground = pb->pushbutton.arm_color; values.background = pb->core.background_pixel; values.fill_style = FillSolid; pb->pushbutton.fill_gc = XtGetGC ((Widget) pb, valueMask, &values); } /************************************************************************ * * GetBackgroundGC * Get the graphics context used for filling in background of * the pushbutton when not armed. * ************************************************************************/ static void GetBackgroundGC( XmPushButtonWidget pb ) { XGCValues values; XtGCMask valueMask; XFontStruct *fs; valueMask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; values.foreground = pb->core.background_pixel; values.background = pb->primitive.foreground; values.graphics_exposures = False; if (XmeRenderTableGetDefaultFont(pb->label.font, &fs)) values.font = fs->fid; else valueMask &= ~GCFont; /* add background_pixmap to GC */ if (pb->core.background_pixmap != XmUNSPECIFIED_PIXMAP) { values.tile = pb->core.background_pixmap; values.fill_style = FillTiled; valueMask |= (GCTile | GCFillStyle); } pb->pushbutton.background_gc = XtGetGC ((Widget) pb,valueMask,&values); } /*************************************<->************************************* * * Initialize * *************************************<->***********************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmPushButtonWidget request = (XmPushButtonWidget) rw ; XmPushButtonWidget new_w = (XmPushButtonWidget) nw ; int increase; int adjustment = 0; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(new_w)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (new_w->pushbutton.multiClick == XmINVALID_MULTICLICK) { if (Lab_IsMenupane(new_w)) new_w->pushbutton.multiClick = XmMULTICLICK_DISCARD; else new_w->pushbutton.multiClick = XmMULTICLICK_KEEP; } /* if menuProcs is not set up yet, try again */ _XmProcessLock(); if (xmLabelClassRec.label_class.menuProcs == NULL) xmLabelClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); _XmProcessUnlock(); /* * Fix to introduce Resource XmNdefaultBorderWidth and compatibility * variable. * if defaultBorderWidth > 0, the program knows about this resource * and is therefore a Motif 1.1 program; otherwise it is a Motif 1.0 * program and old semantics of XmNshowAsDefault prevails. */ if (new_w->pushbutton.default_button_shadow_thickness > 0) new_w->pushbutton.compatible = False; else new_w->pushbutton.compatible = True; /* * showAsDefault as boolean if compatibility is false (Motif 1.1) else * treat it to indicate the thickness of defaultButtonShadow. */ if (new_w->pushbutton.compatible) new_w->pushbutton.default_button_shadow_thickness = new_w->pushbutton.show_as_default; #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen(nw), NULL, NULL) != XmUNSPECIFIED_PIXMAP) { new_w->pushbutton.compatible = False; new_w->pushbutton.default_button_shadow_thickness = 0 ; } #endif new_w->pushbutton.armed = FALSE; new_w->pushbutton.timer = 0; /* No unarm_pixmap but do have an arm_pixmap, use that. */ if ((new_w->label.pixmap == XmUNSPECIFIED_PIXMAP) && (new_w->pushbutton.arm_pixmap != XmUNSPECIFIED_PIXMAP)) { XtWidgetProc resize; new_w->label.pixmap = new_w->pushbutton.arm_pixmap; if (request->core.width == 0) new_w->core.width = 0; if (request->core.height == 0) new_w->core.height = 0; _XmCalcLabelDimensions(nw); _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize) ((Widget) new_w); } if ((new_w->label.label_type == XmPIXMAP || new_w->label.label_type == XmPIXMAP_AND_STRING) && (new_w->pushbutton.arm_pixmap != XmUNSPECIFIED_PIXMAP)) { if (request->core.width == 0) new_w->core.width = 0; if (request->core.height == 0) new_w->core.height = 0; SetPushButtonSize(new_w); } new_w->pushbutton.unarm_pixmap = new_w->label.pixmap; if (new_w->pushbutton.default_button_shadow_thickness) { /* * Special hack for 3d enhancement of location cursor highlight. * - Make the box bigger. During drawing of location cursor * make it smaller. See in Primitive.c * Maybe we should use the macro: G_HighLightThickness(pbgadget); */ new_w->primitive.highlight_thickness += Xm3D_ENHANCE_PIXEL; adjustment = Xm3D_ENHANCE_PIXEL; increase = (2 * new_w->pushbutton.default_button_shadow_thickness + new_w->primitive.shadow_thickness + adjustment); /* Add the increase to the core to compensate for extra space */ if (increase != 0) { Lab_MarginLeft(new_w) += increase; Lab_MarginRight(new_w) += increase; Lab_TextRect_x(new_w) += increase ; new_w->core.width += (increase << 1); Lab_MarginTop(new_w) += increase; Lab_MarginBottom(new_w) += increase; Lab_TextRect_y(new_w) += increase ; new_w->core.height += (increase << 1); } } if (Lab_IsMenupane(new_w)) { new_w->primitive.traversal_on = TRUE; } if (etched_in || !Lab_IsMenupane(new_w)) { /* Initialize GCs for fill and background */ GetFillGC (new_w); GetBackgroundGC (new_w); } } #ifdef DEFAULT_GLYPH_PIXMAP /* * DrawDefaultGlyphPixmap (pb) */ static void DrawDefaultGlyphPixmap( XmPushButtonWidget pb ) { int dx, dy, width, height ; Pixmap def_pixmap ; unsigned int def_pixmap_width, def_pixmap_height ; def_pixmap = _XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), &def_pixmap_width, &def_pixmap_height) ; /* we draw in the margin right area here */ dx = pb->core.width - (Lab_MarginRight(pb) + Lab_MarginWidth(pb) + pb->primitive.highlight_thickness + pb->primitive.shadow_thickness) ; dy = pb->primitive.highlight_thickness + pb->primitive.shadow_thickness + Lab_MarginTop(pb) + Lab_MarginHeight(pb) + (MAX(Lab_TextRect_height(pb), pb->label.acc_TextRect.height) - def_pixmap_height)/2; width = MIN(def_pixmap_width, Lab_MarginRight(pb)); height = MIN(def_pixmap_height, MAX(Lab_TextRect_height(pb), pb->label.acc_TextRect.height)); XCopyPlane (XtDisplay (pb), def_pixmap, XtWindow (pb), pb->label.normal_GC, 0, 0, width, height, dx, dy, 1); } #endif /* DEFAULT_GLYPH_PIXMAP */ #ifdef DEFAULT_GLYPH_PIXMAP /* * EraseDefaultGlyphPixmap (pb) */ static void EraseDefaultGlyphPixmap( XmPushButtonWidget pb ) { int dx, dy, width, height ; /* we clear the margin right area here */ dx = pb->core.width - (Lab_MarginRight(pb) + Lab_MarginWidth(pb) + pb->primitive.highlight_thickness + pb->primitive.shadow_thickness) ; dy = pb->primitive.highlight_thickness + pb->primitive.shadow_thickness + Lab_MarginTop(pb) + Lab_MarginHeight(pb) ; width = Lab_MarginRight(pb) ; height = MAX(Lab_TextRect_height(pb), pb->label.acc_TextRect.height) ; XClearArea (XtDisplay (pb), XtWindow (pb), dx, dy, width, height, False); } #endif /* DEFAULT_GLYPH_PIXMAP */ /* * EraseDefaultButtonShadow (pb) * - Called from SetValues() - effort to optimize shadow drawing. */ static void EraseDefaultButtonShadow( XmPushButtonWidget pb ) { int size, x, y, width, height, delta; XtEnum default_button_emphasis; #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) { EraseDefaultGlyphPixmap( pb) ; return ; } #endif size = pb->pushbutton.default_button_shadow_thickness; if (size > 0) { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmEXTERNAL_HIGHLIGHT: delta = pb->primitive.highlight_thickness; break; case XmINTERNAL_HIGHLIGHT: delta = Xm3D_ENHANCE_PIXEL; break; default: assert(FALSE); return; } size += Xm3D_ENHANCE_PIXEL; x = y = delta; width = pb->core.width - (2 * delta); height = pb->core.height - (2 * delta); FillBorderWithParentColor(pb, size, x, y, width, height); } } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPrehook( Widget cw, /* unused */ Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmPushButtonWidget new_w = (XmPushButtonWidget) nw ; /* CR 2990: Use XmNbuttonFontList as the default font. */ if (new_w->label.font == NULL) new_w->label.font = XmeGetDefaultRenderTable (nw, XmBUTTON_FONTLIST); return False; } /*************************************<->************************************* * * SetValues(current, request, new_w) * *************************************<->***********************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmPushButtonWidget current = (XmPushButtonWidget) cw ; XmPushButtonWidget request = (XmPushButtonWidget) rw ; XmPushButtonWidget new_w = (XmPushButtonWidget) nw ; int increase; Boolean flag = FALSE; /* our return value */ int adjustment; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(new_w)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* * Fix to introduce Resource XmNdefaultBorderWidth and compatibility * variable. * if the XmNdefaultBorderWidth resource in the current differ from the * one in "new_w", then the programmer is setting this resource - so this * is known to the programmer and hence it is a Motif1.1 program. * If they are same then either it is a Motif 1.0 program or there has been * no change in the resource (Motif 1.1 program). If it is a Motif 1.0 * program, then we should copy the value of XmNshowAsDefault to the * XmNdefaultBorderWidth. If it is Motif 1.1 program (Compatible * flag is false) - then we should not do the copy. * This logic will maintain the semantics of the XmNshowAsDefault of Motif * 1.0. For a full explanation see the Design architecture document. */ if ((current->pushbutton.default_button_shadow_thickness) != (new_w->pushbutton.default_button_shadow_thickness)) new_w->pushbutton.compatible = False; if (new_w->pushbutton.compatible) new_w->pushbutton.default_button_shadow_thickness = new_w->pushbutton.show_as_default; adjustment = AdjustHighLightThickness (new_w, current); /* * Compute size change. */ if (new_w->pushbutton.default_button_shadow_thickness != current->pushbutton.default_button_shadow_thickness) { if (new_w->pushbutton.default_button_shadow_thickness > current->pushbutton.default_button_shadow_thickness) { increase = (2 * new_w->pushbutton.default_button_shadow_thickness + new_w->primitive.shadow_thickness); if (current->pushbutton.default_button_shadow_thickness > 0) increase -= (2 * current->pushbutton.default_button_shadow_thickness + current->primitive.shadow_thickness); } else { increase = -(2 * current->pushbutton.default_button_shadow_thickness + current->primitive.shadow_thickness); if (new_w->pushbutton.default_button_shadow_thickness > 0) increase += (2 * new_w->pushbutton.default_button_shadow_thickness + new_w->primitive.shadow_thickness); } increase += adjustment ; if (new_w->label.recompute_size || request->core.width == 0) { Lab_MarginLeft(new_w) += increase; Lab_MarginRight(new_w) += increase; new_w->core.width += (increase << 1); flag = TRUE; } else if (increase != 0) { /* Add the change due to default button to the core */ Lab_MarginLeft(new_w) += increase; Lab_MarginRight(new_w) += increase; new_w->core.width += (increase << 1); flag = TRUE; } if (new_w->label.recompute_size || request->core.height == 0) { Lab_MarginTop(new_w) += increase; Lab_MarginBottom(new_w) += increase; new_w->core.height += (increase << 1); flag = TRUE; } else if (increase != 0) { /* Add the change due to default button to the core */ Lab_MarginTop(new_w) += increase; Lab_MarginBottom(new_w) += increase; new_w->core.height += (increase << 1); flag = TRUE; } } if ((new_w->pushbutton.arm_pixmap != current->pushbutton.arm_pixmap) && (new_w->label.label_type == XmPIXMAP) && (new_w->pushbutton.armed)) flag = TRUE; /* No unarm_pixmap but do have an arm_pixmap, use that. */ if ((new_w->label.pixmap == XmUNSPECIFIED_PIXMAP) && (new_w->pushbutton.arm_pixmap != XmUNSPECIFIED_PIXMAP)) { XtWidgetProc resize; new_w->label.pixmap = new_w->pushbutton.arm_pixmap; if (new_w->label.recompute_size && request->core.width == current->core.width) new_w->core.width = 0; if (new_w->label.recompute_size && request->core.height == current->core.height) new_w->core.width = 0; _XmCalcLabelDimensions(nw); _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize) ((Widget) new_w); } if (new_w->label.pixmap != current->label.pixmap) { new_w->pushbutton.unarm_pixmap = new_w->label.pixmap; if ((new_w->label.label_type == XmPIXMAP) && (!new_w->pushbutton.armed)) flag = TRUE; } if ((new_w->label.label_type == XmPIXMAP || new_w->label.label_type == XmPIXMAP_AND_STRING) && (new_w->pushbutton.arm_pixmap != current->pushbutton.arm_pixmap)) { if ((new_w->label.recompute_size)) { if (request->core.width == current->core.width) new_w->core.width = 0; if (request->core.height == current->core.height) new_w->core.height = 0; } SetPushButtonSize(new_w); flag = TRUE; } if ((new_w->pushbutton.fill_on_arm != current->pushbutton.fill_on_arm) && (new_w->pushbutton.armed == TRUE)) flag = TRUE; if (! Lab_IsMenupane(new_w) || etched_in) { /* See if the GC need to be regenerated and widget redrawn. */ if (new_w->pushbutton.arm_color != current->pushbutton.arm_color) { if (new_w->pushbutton.armed) flag = TRUE; /* see PIR 5091 */ XtReleaseGC ((Widget) new_w, new_w->pushbutton.fill_gc); GetFillGC (new_w); } if (new_w->core.background_pixel != current->core.background_pixel || (new_w->core.background_pixmap != XmUNSPECIFIED_PIXMAP && new_w->core.background_pixmap != current->core.background_pixmap)) { flag = TRUE; /* label will cause redisplay anyway */ XtReleaseGC ((Widget) new_w, new_w->pushbutton.background_gc); GetBackgroundGC (new_w); } } /* OSF Fix pir 3469 */ if (flag == False && XtIsRealized((Widget)new_w)) { /* Size is unchanged - optimize the shadow drawing */ if ((current->pushbutton.show_as_default != 0) && (new_w->pushbutton.show_as_default == 0)) EraseDefaultButtonShadow (new_w); if ((current->pushbutton.show_as_default == 0) && (new_w->pushbutton.show_as_default != 0)) DrawDefaultButtonShadows (new_w); } return flag; } /************************************************************************** * * Resize(w) * **************************************************************************/ static void Resize( Widget w ) { register XmPushButtonWidget tb = (XmPushButtonWidget) w; if (Lab_IsPixmap(w) || Lab_IsPixmapAndText(w)) SetPushButtonSize((XmPushButtonWidget) tb); else { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize)((Widget) tb); } } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget w ) { XmPushButtonWidget pb = (XmPushButtonWidget) w ; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (pb->pushbutton.timer) XtRemoveTimeOut (pb->pushbutton.timer); if (!Lab_IsMenupane(pb) || etched_in) { XtReleaseGC ((Widget) pb, pb->pushbutton.fill_gc); XtReleaseGC ((Widget) pb, pb->pushbutton.background_gc); } } /*************************************<->************************************* * * Redisplay (pb, event, region) * Completely rewritten to accommodate defaultButtonShadowThickness * Description: * ----------- * Cause the widget, identified by pb, to be redisplayed. * If XmNfillOnArm is True and the pushbutton is not in a menu, * the background will be filled with XmNarmColor. * If XmNinvertOnArm is True and XmNLabelType is XmPIXMAP, * XmNarmPixmap will be used in the label. * *************************************<->***********************************/ /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; if (XtIsRealized((Widget)pb)) { if (Lab_IsMenupane(pb)) { DrawPushButtonLabel (pb, event, region); /* CR 5991: Refresh border highlight too. */ if (pb->pushbutton.armed) (*(((XmPushButtonWidgetClass) XtClass (pb)) ->primitive_class.border_highlight)) ((Widget) pb) ; } else { DrawPushButtonBackground (pb); DrawPushButtonLabel (pb, event, region); DrawPushButtonShadows (pb); } } } /* * DrawPushButtonBackground () * - Compute the area allocated to the pushbutton and fill it with * the background or the fill gc; */ static void DrawPushButtonBackground( XmPushButtonWidget pb ) { XRectangle box; GC tmp_gc; ComputePBLabelArea (pb, &box); if ((pb->pushbutton.armed) && (pb->pushbutton.fill_on_arm)) tmp_gc = pb->pushbutton.fill_gc; else tmp_gc = pb->pushbutton.background_gc; /* really need to fill with background if not armed ? */ if (tmp_gc) XFillRectangle (XtDisplay(pb), XtWindow(pb), tmp_gc, box.x, box.y, box.width, box.height); } /* * DrawPushButtonLabel (pb, event, region) * Draw the label contained in the pushbutton. */ static void DrawPushButtonLabel( XmPushButtonWidget pb, XEvent *event, Region region ) { GC tmp_gc = NULL; Boolean replaceGC = False; Boolean replaceBg = False; Boolean deadjusted = False; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (pb->pushbutton.armed && ((! Lab_IsMenupane(pb) && pb->pushbutton.fill_on_arm) || (Lab_IsMenupane(pb) && etched_in))) { XSetWindowBackground(XtDisplay(pb), XtWindow(pb), pb->pushbutton.arm_color); replaceBg = True; if ((pb->label.label_type == XmSTRING || pb->label.label_type == XmPIXMAP_AND_STRING) && (pb->pushbutton.arm_color == pb->primitive.foreground)) { tmp_gc = pb->label.normal_GC; pb->label.normal_GC = pb->pushbutton.background_gc; replaceGC = True; } } if (pb->label.label_type == XmPIXMAP || pb->label.label_type == XmPIXMAP_AND_STRING) { if (pb->pushbutton.armed) { if (pb->pushbutton.arm_pixmap != XmUNSPECIFIED_PIXMAP) pb->label.pixmap = pb->pushbutton.arm_pixmap; else pb->label.pixmap = pb->pushbutton.unarm_pixmap; } else /* pushbutton is unarmed */ pb->label.pixmap = pb->pushbutton.unarm_pixmap; } /* * Temporarily remove the Xm3D_ENHANCE_PIXEL hack ("adjustment") * from the margin values, so we don't confuse Label. */ if (pb->pushbutton.default_button_shadow_thickness > 0) { deadjusted = True; Lab_MarginLeft(pb) -= Xm3D_ENHANCE_PIXEL; Lab_MarginRight(pb) -= Xm3D_ENHANCE_PIXEL; Lab_MarginTop(pb) -= Xm3D_ENHANCE_PIXEL; Lab_MarginBottom(pb) -= Xm3D_ENHANCE_PIXEL; } { XtExposeProc expose; _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (* expose) ((Widget) pb, event, region) ; } if (deadjusted) { Lab_MarginLeft(pb) += Xm3D_ENHANCE_PIXEL; Lab_MarginRight(pb) += Xm3D_ENHANCE_PIXEL; Lab_MarginTop(pb) += Xm3D_ENHANCE_PIXEL; Lab_MarginBottom(pb) += Xm3D_ENHANCE_PIXEL; } if (replaceGC) pb->label.normal_GC = tmp_gc; if (replaceBg) { XSetWindowBackground(XtDisplay(pb), XtWindow(pb), XtBackground(pb)); if (pb->core.background_pixmap != XmUNSPECIFIED_PIXMAP) { XSetWindowBackgroundPixmap(XtDisplay(pb), XtWindow(pb), pb->core.background_pixmap); } } } /* * DrawPushButtonShadows() * Note: PushButton has two types of shadows: primitive-shadow and * default-button-shadow. * If pushbutton is in a menu only primitive shadows are drawn. */ static void DrawPushButtonShadows( XmPushButtonWidget pb ) { XRectangle box; XtEnum default_button_emphasis; int adjust; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmEXTERNAL_HIGHLIGHT: adjust = (pb->primitive.highlight_thickness - (pb->pushbutton.default_button_shadow_thickness ? Xm3D_ENHANCE_PIXEL : 0)); break; case XmINTERNAL_HIGHLIGHT: adjust = 0; break; default: assert(FALSE); return; } /* Clear the area not occupied by label with parents background color. */ /* Label will invoke BorderUnhighlight() on the highlight_thickness */ /* area, which is redundant when XmEXTERNAL_HIGHLIGHT default button */ /* shadow emphasis is used. */ ComputePBLabelArea (pb, &box); if (box.x > adjust) { FillBorderWithParentColor(pb, box.x - adjust, adjust, adjust, pb->core.width - 2 * adjust, pb->core.height - 2 * adjust); switch (default_button_emphasis) { case XmINTERNAL_HIGHLIGHT: /* The call above erases the border highlighting. */ if (pb->primitive.highlight_drawn) (*(((XmPushButtonWidgetClass) XtClass (pb)) ->primitive_class.border_highlight)) ((Widget) pb) ; break; default: break; } } if (pb->pushbutton.default_button_shadow_thickness #ifdef DEFAULT_GLYPH_PIXMAP || (_XmGetDefaultGlyphPixmap(XtScreen((Widget)pb), NULL, NULL) != XmUNSPECIFIED_PIXMAP) #endif ) { if (pb->pushbutton.show_as_default) DrawDefaultButtonShadows (pb); } if (pb->primitive.shadow_thickness) DrawPBPrimitiveShadows (pb); } /*ARGSUSED*/ static Boolean ParentVisualChanged(Widget kid, Widget cur_parent, /* unused */ Widget new_parent, /* unused */ Mask visual_flag) { XmPushButtonWidget pb = (XmPushButtonWidget) kid ; /* CR 9333: The primitive Redraw procedure only redraws the */ /* highighlight area, but push buttons needs to redraw the */ /* default button shadow emphasis area too. */ if (visual_flag & (VisualBackgroundPixel|VisualBackgroundPixmap)) { XmPrimitiveClassRec* kid_class = (XmPrimitiveClassRec*) XtClass(kid); if (! XtIsRealized(kid)) return True; if (!pb->primitive.highlighted && kid_class->primitive_class.border_unhighlight) kid_class->primitive_class.border_unhighlight(kid); DrawPushButtonShadows(pb); } return False; } /* * ComputePBLabelArea() * Compute the area allocated to the label of the pushbutton; * fill in the dimensions in the box. */ static void ComputePBLabelArea( XmPushButtonWidget pb, XRectangle *box ) { int dx, adjust; short fill = 0; if ((pb->pushbutton.arm_color == pb->primitive.top_shadow_color) || (pb->pushbutton.arm_color == pb->primitive.bottom_shadow_color)) fill = 1; if (pb->pushbutton.compatible) adjust = pb->pushbutton.show_as_default; else adjust = pb->pushbutton.default_button_shadow_thickness; if (adjust > 0) { adjust = adjust + pb->primitive.shadow_thickness; adjust = (adjust << 1); dx = pb->primitive.highlight_thickness + adjust + fill; } else dx = (pb->primitive.highlight_thickness + pb->primitive.shadow_thickness + fill); box->x = dx; box->y = dx; adjust = (dx << 1); box->width = pb->core.width - adjust; box->height = pb->core.height - adjust; } /* * DrawPBPrimitiveShadow (pb) * - Should be called only if PrimitiveShadowThickness > 0 */ static void DrawPBPrimitiveShadows( XmPushButtonWidget pb ) { GC top_gc, bottom_gc; int dx, adjust, shadow_thickness; if (pb->pushbutton.armed) { bottom_gc = pb->primitive.top_shadow_GC; top_gc = pb->primitive.bottom_shadow_GC; } else { bottom_gc = pb->primitive.bottom_shadow_GC; top_gc = pb->primitive.top_shadow_GC; } shadow_thickness = pb->primitive.shadow_thickness; /* * This might have to be modified. * - this is where dependency on compatibility with 1.0 * and defaultButtonShadowThickness etc. will showup. * NOTE: defaultButtonShadowThickness is not supported in * RowColumn children. * 1. Compute (x,y,width,height) for the rectangle within which * the shadow is to be drawn. */ if ((shadow_thickness > 0) && (top_gc) && (bottom_gc)) { if (pb->pushbutton.compatible) adjust = pb->pushbutton.show_as_default; else adjust = pb->pushbutton.default_button_shadow_thickness; if (adjust > 0) { adjust = (adjust << 1); dx = (pb->primitive.highlight_thickness + adjust + pb->primitive.shadow_thickness); } else dx = pb->primitive.highlight_thickness ; /* CR 7115: Deal with degenerate cases. */ if ((pb->core.width > 2 * dx) && (pb->core.height > 2 * dx)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), top_gc, bottom_gc, dx, dx, pb->core.width - 2 * dx, pb->core.height - 2 * dx, shadow_thickness, XmSHADOW_OUT); } } /* * DrawDefaultButtonShadows() * - get the topShadowColor and bottomShadowColor from the parent; * use those colors to construct top and bottom gc; use these * GCs to draw the shadows of the button. * - Should not be called if pushbutton is in a row column or in a menu. * - Should be called only if a defaultbuttonshadow is to be drawn. */ static void DrawDefaultButtonShadows( XmPushButtonWidget pb ) { GC top_gc, bottom_gc; int default_button_shadow_thickness; int x, y, width, height, delta; Widget parent; XtEnum default_button_emphasis; XmDisplay xm_dpy; if (pb->pushbutton.compatible && (pb->pushbutton.show_as_default == 0)) return; #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) { DrawDefaultGlyphPixmap( pb) ; return ; } #endif if (!pb->pushbutton.compatible && (pb->pushbutton.default_button_shadow_thickness == 0)) return ; /* * May need more complex computation for getting the GCs. */ parent = XtParent(pb); if (XmIsManager(parent)) { /* CR 5894: Use the parent's GC so monochrome works. */ bottom_gc = XmParentTopShadowGC(pb); top_gc = XmParentBottomShadowGC(pb); } else { /* Use your own pixel for drawing. */ bottom_gc = pb->primitive.top_shadow_GC; top_gc = pb->primitive.bottom_shadow_GC; } if ((bottom_gc == None) || (top_gc == None)) return; if (pb->pushbutton.compatible) default_button_shadow_thickness = pb->pushbutton.show_as_default; else default_button_shadow_thickness = pb->pushbutton.default_button_shadow_thickness; /* * Compute location of bounding box to contain the defaultButtonShadow. */ xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmEXTERNAL_HIGHLIGHT: delta = pb->primitive.highlight_thickness; break; case XmINTERNAL_HIGHLIGHT: delta = Xm3D_ENHANCE_PIXEL; break; default: assert(FALSE); return; } x = y = delta; width = pb->core.width - 2 * delta; height = pb->core.height - 2 * delta; if ((width > 0) && (height > 0)) XmeDrawShadows(XtDisplay(pb), XtWindow(pb), top_gc, bottom_gc, x, y, width, height, default_button_shadow_thickness, XmSHADOW_OUT); } /*************************************<->************************************* * * BorderHighlight * *************************************<->***********************************/ static void BorderHighlight( Widget wid ) { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; XEvent * event = NULL; if (Lab_IsMenupane(pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; Boolean already_armed = pb->pushbutton.armed; pb->pushbutton.armed = TRUE; if (etched_in && !XmIsTearOffButton(pb) ) { XFillRectangle (XtDisplay(pb), XtWindow(pb), pb->pushbutton.fill_gc, 0, 0, pb->core.width, pb->core.height); DrawPushButtonLabel (pb, event, NULL); } if ((pb->core.width > 2 * pb->primitive.highlight_thickness) && (pb->core.height > 2 * pb->primitive.highlight_thickness)) XmeDrawShadows(XtDisplay (pb), XtWindow (pb), pb->primitive.top_shadow_GC, pb->primitive.bottom_shadow_GC, pb->primitive.highlight_thickness, pb->primitive.highlight_thickness, pb->core.width - 2 * pb->primitive.highlight_thickness, pb->core.height - 2 * pb->primitive.highlight_thickness, pb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (!already_armed && pb->pushbutton.arm_callback) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) pb, pb->pushbutton.arm_callback, &call_value); } } else { DrawBorderHighlight ((Widget) pb) ; } } static void DrawBorderHighlight( Widget wid) { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; int x, y, width, height, delta; Dimension highlight_width ; XtEnum default_button_emphasis; if (!XtWidth (pb) || !XtHeight (pb)) return; pb->primitive.highlighted = True; pb->primitive.highlight_drawn = True; if (pb->pushbutton.default_button_shadow_thickness) highlight_width = pb->primitive.highlight_thickness - Xm3D_ENHANCE_PIXEL; else highlight_width = pb->primitive.highlight_thickness; if (highlight_width > 0) { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmEXTERNAL_HIGHLIGHT: delta = 0; break; case XmINTERNAL_HIGHLIGHT: if (pb->pushbutton.default_button_shadow_thickness) delta = Xm3D_ENHANCE_PIXEL + 2 * (pb->pushbutton.compatible ? pb->pushbutton.show_as_default : pb->pushbutton.default_button_shadow_thickness); else delta = 0; break; default: assert(FALSE); return; } x = y = delta; width = pb->core.width - 2 * delta; height = pb->core.height - 2 * delta; XmeDrawHighlight(XtDisplay(pb), XtWindow(pb), pb->primitive.highlight_GC, x, y, width, height, highlight_width); } } /*************************************<->************************************* * * BorderUnhighlight * *************************************<->***********************************/ static void BorderUnhighlight( Widget wid ) { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; XEvent * event = NULL; if (Lab_IsMenupane(pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; Boolean already_armed = pb->pushbutton.armed; pb->pushbutton.armed = FALSE; if (etched_in && !XmIsTearOffButton(pb) ) { XFillRectangle (XtDisplay(pb), XtWindow(pb), pb->pushbutton.background_gc, 0, 0, pb->core.width, pb->core.height); DrawPushButtonLabel (pb, event, NULL); } else XmeClearBorder ( XtDisplay (pb), XtWindow (pb), pb->primitive.highlight_thickness, pb->primitive.highlight_thickness, pb->core.width - 2 * pb->primitive.highlight_thickness, pb->core.height - 2 * pb->primitive.highlight_thickness, pb->primitive.shadow_thickness); if (already_armed && pb->pushbutton.disarm_callback) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) pb, pb->pushbutton.disarm_callback, &call_value); } } else { /* PushButton is not in a menu - parent may be a shell or manager */ int border = pb->primitive.highlight_thickness - Xm3D_ENHANCE_PIXEL; XtEnum default_button_emphasis; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmINTERNAL_HIGHLIGHT: if (pb->pushbutton.default_button_shadow_thickness && (border > 0)) { int x, y, width, height, delta; pb->primitive.highlighted = False; pb->primitive.highlight_drawn = False; delta = Xm3D_ENHANCE_PIXEL + 2 * (pb->pushbutton.compatible ? pb->pushbutton.show_as_default : pb->pushbutton.default_button_shadow_thickness); x = y = delta; width = pb->core.width - 2 * delta; height = pb->core.height - 2 * delta; FillBorderWithParentColor(pb, border, x, y, width, height); break; } /* else fall through to XmEXTERNAL_HIGHLIGHT. */ case XmEXTERNAL_HIGHLIGHT: (*(xmLabelClassRec.primitive_class.border_unhighlight)) (wid) ; break; default: assert(FALSE); return; } } } /* * AdjustHighLightThickness () * HighlightThickness has a dependency on default_button-shadow-thickness; * This routine (called from SetValues) adjust for that dependency. * Applications should be aware that * if a pushbutton gadget has with (default_button-shadow-thickness == 0) * - then if through a XtSetValue it sets (default_button-shadow-thickness > 0) * the application-specified highlight-thickness is internally increased by * Xm3D_ENHANCE_PIXEL to enhance the 3D-appearance of the defaultButton * Shadow. Similarly if a pushbutton gadget has (default_button-shadow_ * thickness > 0), and it resets the (default_button-shadow-thickness = 0) * through a XtSetValue , then the existing highlight-thickness is decreased * by Xm3D_ENHANCE_PIXEL. * The border-highlight when drawn is however is always of the same * thickness as specified by the application since compensation is done * in the drawing routine (see BorderHighlight). */ static int AdjustHighLightThickness( XmPushButtonWidget new_w, XmPushButtonWidget current ) { int adjustment = 0; if (new_w->pushbutton.default_button_shadow_thickness > 0) { if (current->pushbutton.default_button_shadow_thickness == 0) { new_w->primitive.highlight_thickness += Xm3D_ENHANCE_PIXEL; adjustment = Xm3D_ENHANCE_PIXEL; } else if (new_w->primitive.highlight_thickness != current->primitive.highlight_thickness) { new_w->primitive.highlight_thickness += Xm3D_ENHANCE_PIXEL; adjustment = Xm3D_ENHANCE_PIXEL; } } else { if (current->pushbutton.default_button_shadow_thickness > 0) /* default_button_shadow_thickness was > 0 and is now being set to 0, * so take away the adjustment for enhancement. */ { if (new_w->primitive.highlight_thickness == current->primitive.highlight_thickness) { new_w->primitive.highlight_thickness -= Xm3D_ENHANCE_PIXEL; adjustment -= Xm3D_ENHANCE_PIXEL; } /* * This will appear to be a bug if in a XtSetValues the application * removes the default_button_shadow_thickness and also * sets the high-light-thickness to a value of * (old-high-light-thickness (from previous XtSetValue) + * Xm3D_ENHANCE_PIXEL) at the same time. * This will be documented. */ } } return (adjustment); } static void FillBorderWithParentColor( XmPushButtonWidget pb, int borderwidth, int dx, int dy, int rectwidth, int rectheight ) { if (XmIsManager(XtParent(pb))) { /* CR 5551: Use the manager gc rather than creating a new one. */ XmeDrawHighlight(XtDisplay(pb), XtWindow(pb), XmParentBackgroundGC(pb), dx, dy, rectwidth, rectheight, borderwidth); } else { /* CR 6038: This is wrong, but is the way Label (by calling * Primitive.c:UnhighlightBorder) clears borders in shells. */ XmeClearBorder(XtDisplay(pb), XtWindow(pb), dx, dy, rectwidth, rectheight, borderwidth); } } /************************************************************************* * * SetPushButtonSize(newpb) * Picks the larger dimension when the armPixmap is a * different size than the label pixmap(i.e the unarm pixmap). * ************************************************************************/ static void SetPushButtonSize( XmPushButtonWidget newpb) { XmLabelPart *lp = &(newpb->label); unsigned int onW = 0, onH = 0, onW2 = 0, onH2 = 0; XtWidgetProc resize; if (newpb->pushbutton.arm_pixmap != XmUNSPECIFIED_PIXMAP) { #ifdef FIX_1516 if (newpb->label.pixmap != XmUNSPECIFIED_PIXMAP) #endif XmeGetPixmapData(XtScreen(newpb), newpb->label.pixmap, NULL, NULL, NULL, NULL, NULL, NULL, &onW, &onH); XmeGetPixmapData(XtScreen(newpb), newpb->pushbutton.arm_pixmap, NULL, NULL, NULL, NULL, NULL, NULL, &onW2, &onH2); newpb->label.PixmapRect.width = MAX(onW2, onW); newpb->label.PixmapRect.height = MAX(onH2, onH); _XmLabelCalcTextRect((Widget)newpb); } /* Let Label do the rest. */ _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize) ((Widget) newpb); } /************************************************************************ * * Actions ----------- * ************************************************************************/ /************************************************************************ * * Arm * * This function processes button 1 down occuring on the pushbutton. * Mark the pushbutton as armed (i.e. active). * The callbacks for XmNarmCallback are called. * ************************************************************************/ /*ARGSUSED*/ static void Arm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; XtExposeProc expose; (void) XmProcessTraversal ((Widget) pb, XmTRAVERSE_CURRENT); pb->pushbutton.armed = TRUE; if (event != NULL && (event->xany.type == ButtonPress || event->xany.type == ButtonRelease)) pb->pushbutton.armTimeStamp = event->xbutton.time; else pb->pushbutton.armTimeStamp = 0; _XmProcessLock(); expose = XtClass(pb)->core_class.expose; _XmProcessUnlock(); (* expose)(wid, event, (Region) NULL); if (pb->pushbutton.arm_callback) { XFlush(XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget) pb, pb->pushbutton.arm_callback, &call_value); } } /*ARGSUSED*/ static void MultiArm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; if (pb->pushbutton.multiClick == XmMULTICLICK_KEEP) Arm ((Widget) pb, event, NULL, NULL); } /************************************************************************ * * Activate * * Mark the pushbutton as unarmed (i.e. inactive). * If the button release occurs inside of the PushButton, the * callbacks for XmNactivateCallback are called. * ************************************************************************/ static void Activate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params ) { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; if (pb->pushbutton.armed == FALSE) return; pb->pushbutton.click_count = 1; ActivateCommon ((Widget) pb, buttonEvent, params, num_params); } static void MultiActivate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params ) { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; /* When a multi click sequence occurs and the user Button Presses and * holds for a length of time, the final release should look like a * new_w/separate activate. */ if (pb->pushbutton.multiClick == XmMULTICLICK_KEEP) { if ((buttonEvent->xbutton.time - pb->pushbutton.armTimeStamp) > XtGetMultiClickTime(XtDisplay(pb))) pb->pushbutton.click_count = 1; else pb->pushbutton.click_count++; ActivateCommon ((Widget) pb, buttonEvent, params, num_params); Disarm ((Widget) pb, buttonEvent, params, num_params); } } /*ARGSUSED*/ static void ActivateCommon( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; XtExposeProc expose; pb->pushbutton.armed = FALSE; _XmProcessLock(); expose = ((WidgetClass)XtClass(pb))->core_class.expose; _XmProcessUnlock(); (* expose)(wid, event, (Region) NULL); /* CR 9181: Consider clipping when testing visibility. */ if ((event->xany.type == ButtonPress || event->xany.type == ButtonRelease) && _XmGetPointVisibility(wid, event->xbutton.x_root, event->xbutton.y_root)) { call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = pb->pushbutton.click_count; if ((pb->pushbutton.multiClick == XmMULTICLICK_DISCARD) && (call_value.click_count > 1)) return; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(pb)), XmQTmenuSystem); /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) menuSTrait->entryCallback(XtParent(pb), (Widget) pb, &call_value); if ((! pb->label.skipCallback) && (pb->pushbutton.activate_callback)) { XFlush (XtDisplay (pb)); XtCallCallbackList ((Widget) pb, pb->pushbutton.activate_callback, &call_value); } } } static void PB_FixTearoff( XmPushButtonWidget pb) { if (XmMENU_PULLDOWN == pb->label.menu_type) { Widget mwid = XmGetPostedFromWidget(XtParent(pb)); if (mwid && XmIsRowColumn(mwid) && (XmMENU_OPTION == RC_Type(mwid)) && _XmIsActiveTearOff(XtParent(pb))) XmProcessTraversal((Widget) pb, XmTRAVERSE_CURRENT); } } /************************************************************************ * * ArmAndActivate * ************************************************************************/ /*ARGSUSED*/ static void ArmAndActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; Boolean already_armed = pb->pushbutton.armed; XmPushButtonCallbackStruct call_value; Boolean is_menupane = Lab_IsMenupane(pb); Boolean torn_has_focus = FALSE; /* must be torn! */ XmMenuSystemTrait menuSTrait; if (is_menupane && !XmIsMenuShell(XtParent(XtParent(pb)))) { /* Because the pane is torn and the parent is a transient shell, * the shell's focal point from _XmGetFocusData should be valid * (as opposed to getting it from a MenuShell). */ if (XmeFocusIsInShell((Widget)pb)) { /* In case allowAcceleratedInsensitiveUnmanagedMenuItems is True */ if (!XtIsSensitive((Widget)pb) || (!XtIsManaged((Widget)pb))) return; torn_has_focus = TRUE; } } menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget)XtParent(pb)), XmQTmenuSystem); if (is_menupane && menuSTrait != NULL) { pb->pushbutton.armed = FALSE; /* CR 7799: Torn off menus shouldn't be shared, so don't reparent. */ if (torn_has_focus) menuSTrait->popdown(XtParent(pb), event); else menuSTrait->buttonPopdown(XtParent(pb), event); /* if its in a torn off menu pane, show depressed button briefly */ if (torn_has_focus) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* Set the focus here. */ XmProcessTraversal((Widget) pb, XmTRAVERSE_CURRENT); if ((pb->core.width > 2 * pb->primitive.highlight_thickness) && (pb->core.height > 2 * pb->primitive.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), pb->primitive.bottom_shadow_GC, pb->primitive.top_shadow_GC, pb->primitive.highlight_thickness, pb->primitive.highlight_thickness, pb->core.width - 2 * pb->primitive.highlight_thickness, pb->core.height - 2 * pb->primitive.highlight_thickness, pb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } } else { XtExposeProc expose; pb->pushbutton.armed = TRUE; _XmProcessLock(); expose = XtClass(pb)->core_class.expose; _XmProcessUnlock(); (* expose)(wid, event, (Region) NULL); } XFlush (XtDisplay (pb)); /* If the parent is menu system able, set the lastSelectToplevel before * the arm. It's ok if this is recalled later. */ if (menuSTrait != NULL) menuSTrait->getLastSelectToplevel(XtParent(pb)); if (pb->pushbutton.arm_callback && !already_armed) { call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget)pb, pb->pushbutton.arm_callback, &call_value); } call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = 1; /* always 1 in kselect */ /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) menuSTrait->entryCallback(XtParent(pb), (Widget)pb, &call_value); #ifdef FIX_1375 pb->label.pixmap = pb->pushbutton.unarm_pixmap; #endif if ((! pb->label.skipCallback) && (pb->pushbutton.activate_callback)) { XFlush (XtDisplay (pb)); XtCallCallbackList ((Widget) pb, pb->pushbutton.activate_callback, &call_value); } pb->pushbutton.armed = FALSE; if (pb->pushbutton.disarm_callback) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; XtCallCallbackList ((Widget) pb, pb->pushbutton.disarm_callback, &call_value); } if (is_menupane && menuSTrait != NULL) { if (torn_has_focus && XtIsSensitive(wid)) { /* Leave the focus widget in an armed state */ pb->pushbutton.armed = TRUE; if (pb->pushbutton.arm_callback) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; XtCallCallbackList ((Widget) pb, pb->pushbutton.arm_callback, &call_value); } } else { menuSTrait->reparentToTearOffShell(XtParent(pb), event); PB_FixTearoff(pb); } } /* * If the button is still around, show it released, after a short delay. * This is done if the button is outside of a menus, or if in a torn * off menupane. */ if (!is_menupane || torn_has_focus) { if ((pb->core.being_destroyed == False) && (!pb->pushbutton.timer)) pb->pushbutton.timer = XtAppAddTimeOut (XtWidgetToApplicationContext((Widget)pb), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)(pb)); } } /*ARGSUSED*/ static void ArmTimeout( XtPointer data, XtIntervalId *id ) { XmPushButtonWidget pb = (XmPushButtonWidget) data; pb->pushbutton.timer = 0; if (XtIsRealized ((Widget)pb) && XtIsManaged ((Widget)pb)) { if (Lab_IsMenupane(pb)) { /* When rapidly clicking, the focus may have moved away from this * widget, so check before changing the shadow. */ if (XmeFocusIsInShell((Widget)pb) && (XmGetFocusWidget((Widget)pb) == (Widget)pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* in a torn off menu, redraw shadows */ if ((pb->core.width > 2 * pb->primitive.highlight_thickness) && (pb->core.height > 2 * pb->primitive.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), pb->primitive.top_shadow_GC, pb->primitive.bottom_shadow_GC, pb->primitive.highlight_thickness, pb->primitive.highlight_thickness, pb->core.width - 2 * pb->primitive.highlight_thickness, pb->core.height - 2 * pb->primitive.highlight_thickness, pb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } } else { XtExposeProc expose; _XmProcessLock(); expose = XtClass(pb)->core_class.expose; _XmProcessUnlock(); (* expose) ((Widget) pb, NULL, (Region) NULL); } XFlush (XtDisplay (pb)); } } /************************************************************************ * * Disarm * * Mark the pushbutton as unarmed (i.e. active). * The callbacks for XmNdisarmCallback are called.. * ************************************************************************/ /*ARGSUSED*/ static void Disarm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; XtExposeProc expose; /* BEGIN OSF Fix pir 2826 */ if (pb->pushbutton.armed == TRUE) { pb->pushbutton.armed = FALSE; Redisplay((Widget) pb, event, (Region)NULL); _XmProcessLock(); expose = XtClass(pb)->core_class.expose; _XmProcessUnlock(); if (expose) (* expose)((Widget)(pb), event, (Region)NULL); } /* END OSF Fix pir 2826 */ if (pb->pushbutton.disarm_callback) { call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) pb, pb->pushbutton.disarm_callback, &call_value); } } /************************************************************************ * * BtnDown * * This function processes a button down occuring on the pushbutton * when it is in a popup, pulldown, or option menu. * Popdown the posted menu. * Turn parent's traversal off. * Mark the pushbutton as armed (i.e. active). * The callbacks for XmNarmCallback are called. * ************************************************************************/ /*ARGSUSED*/ static void BtnDown( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; Boolean validButton = False; Boolean already_armed; ShellWidget popup; XmMenuSystemTrait menuSTrait; /* Support menu replay, free server input queue until next button event */ XAllowEvents(XtDisplay(pb), SyncPointer, CurrentTime); /* If no menu system trait then parent isn't a menu as it should be. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(pb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (event && (event->type == ButtonPress)) validButton = menuSTrait->verifyButton(XtParent(pb), event); if (!validButton) return; _XmSetInDragMode((Widget)pb, True); /* Popdown other popus that may be up */ if (!(popup = (ShellWidget)_XmGetRC_PopupPosted(XtParent(pb)))) { if (!XmIsMenuShell(XtParent(XtParent(pb)))) { /* In case tear off not armed and no grabs in place, do it now. * Ok if already armed and grabbed - nothing done. */ menuSTrait->tearOffArm(XtParent(pb)); } } if (popup) { if (popup->shell.popped_up) menuSTrait->popdownEveryone((Widget) popup, event); } /* Set focus to this pushbutton. This must follow the possible * unhighlighting of the CascadeButton else it'll screw up active_child. */ (void)XmProcessTraversal ((Widget) pb, XmTRAVERSE_CURRENT); /* get the location cursor - get consistent with Gadgets */ already_armed = pb->pushbutton.armed; pb->pushbutton.armed = TRUE; if (pb->pushbutton.arm_callback && !already_armed) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget) pb, pb->pushbutton.arm_callback, &call_value); } _XmRecordEvent (event); } /************************************************************************ * * BtnUp * * This function processes a button up occuring on the pushbutton * when it is in a popup, pulldown, or option menu. * Mark the pushbutton as unarmed (i.e. inactive). * The callbacks for XmNactivateCallback are called. * The callbacks for XmNdisarmCallback are called. * ************************************************************************/ /*ARGSUSED*/ static void BtnUp( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; Widget parent = XtParent(pb); XmPushButtonCallbackStruct call_value; Boolean flushDone = False; Boolean validButton = False; Boolean popped_up; Boolean is_menupane = Lab_IsMenupane(pb); Widget shell = XtParent(XtParent(pb)); XmMenuSystemTrait menuSTrait; /* If no menu system trait then parent isn't a menu as it should be. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(pb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (event && (event->type == ButtonRelease)) validButton = menuSTrait->verifyButton(parent, event); if (!validButton || (pb->pushbutton.armed == FALSE)) return; pb->pushbutton.armed = FALSE; if (is_menupane && !XmIsMenuShell(shell)) popped_up = menuSTrait->popdown((Widget) pb, event); else popped_up = menuSTrait->buttonPopdown((Widget) pb, event); _XmRecordEvent(event); /* XmMENU_POPDOWN left the menu posted on button click - don't activate! */ if (popped_up) return; call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = 1; /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) { menuSTrait->entryCallback(parent, (Widget) pb, &call_value); flushDone = True; } if ((! pb->label.skipCallback) && (pb->pushbutton.activate_callback)) { XFlush (XtDisplay (pb)); flushDone = True; XtCallCallbackList ((Widget) pb, pb->pushbutton.activate_callback, &call_value); } if (pb->pushbutton.disarm_callback) { if (!flushDone) XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) pb, pb->pushbutton.disarm_callback, &call_value); } /* If the original shell does not indicate an active menu, but rather a * tear off pane, leave the button in an armed state. Also, briefly * display the button as depressed to give the user some feedback of * the selection. */ if (is_menupane) /* necessary check? */ { if (!XmIsMenuShell(shell)) { if (XtIsSensitive((Widget)pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; if ((pb->core.width > 2 * pb->primitive.highlight_thickness) && (pb->core.height > 2 * pb->primitive.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), pb->primitive.bottom_shadow_GC, pb->primitive.top_shadow_GC, pb->primitive.highlight_thickness, pb->primitive.highlight_thickness, pb->core.width - 2 * pb->primitive.highlight_thickness, pb->core.height - 2 * pb->primitive.highlight_thickness, pb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); XFlush (XtDisplay (pb)); flushDone = True; if (pb->core.being_destroyed == False) { if (!pb->pushbutton.timer) pb->pushbutton.timer = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)pb), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)(pb)); } pb->pushbutton.armed = TRUE; if (pb->pushbutton.arm_callback) { if (!flushDone) XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) pb, pb->pushbutton.arm_callback, &call_value); } } } else menuSTrait->reparentToTearOffShell(XtParent(pb), event); } _XmSetInDragMode((Widget)pb, False); /* For the benefit of tear off menus, we must set the focus item * to this button. In normal menus, this would not be a problem * because the focus is cleared when the menu is unposted. */ if (!XmIsMenuShell(shell)) XmProcessTraversal((Widget) pb, XmTRAVERSE_CURRENT); PB_FixTearoff(pb); } /************************************************************************ * * Enter * ************************************************************************/ /*ARGSUSED*/ static void Enter( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; if (Lab_IsMenupane(pb)) { if ((((ShellWidget) XtParent(XtParent(pb)))->shell.popped_up) && _XmGetInDragMode((Widget)pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (pb->pushbutton.armed) return; /* So KHelp event is delivered correctly */ _XmSetFocusFlag (XtParent(XtParent(pb)), XmFOCUS_IGNORE, TRUE); XtSetKeyboardFocus(XtParent(XtParent(pb)), (Widget)pb); _XmSetFocusFlag (XtParent(XtParent(pb)), XmFOCUS_IGNORE, FALSE); pb -> pushbutton.armed = TRUE; ((XmManagerWidget) XtParent(wid))->manager.active_child = wid; /* etched in menu button */ if (etched_in && !XmIsTearOffButton(pb) ) { XFillRectangle (XtDisplay(pb), XtWindow(pb), pb->pushbutton.fill_gc, 0, 0, pb->core.width, pb->core.height); DrawPushButtonLabel( pb, event, NULL ); } if ((pb->core.width > 2 * pb->primitive.highlight_thickness) && (pb->core.height > 2 * pb->primitive.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), pb->primitive.top_shadow_GC, pb->primitive.bottom_shadow_GC, pb->primitive.highlight_thickness, pb->primitive.highlight_thickness, pb->core.width - 2 * pb->primitive.highlight_thickness, pb->core.height - 2 * pb->primitive.highlight_thickness, pb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (pb->pushbutton.arm_callback) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) pb, pb->pushbutton.arm_callback, &call_value); } } } else { XtExposeProc expose; _XmPrimitiveEnter ((Widget) pb, event, NULL, NULL); if (pb->pushbutton.armed == TRUE) { _XmProcessLock(); expose = XtClass(pb)->core_class.expose; _XmProcessUnlock(); (* expose)(wid, event, (Region) NULL); } } } /************************************************************************ * * Leave * ************************************************************************/ /*ARGSUSED*/ static void Leave( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; if (Lab_IsMenupane(pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (_XmGetInDragMode((Widget)pb) && pb->pushbutton.armed && (/* !ActiveTearOff || */ event->xcrossing.mode == NotifyNormal)) { pb->pushbutton.armed = FALSE; ((XmManagerWidget) XtParent(wid))->manager.active_child = NULL; if (etched_in && !XmIsTearOffButton(pb) ) { XFillRectangle (XtDisplay(pb), XtWindow(pb), pb->pushbutton.background_gc, 0, 0, pb->core.width, pb->core.height); DrawPushButtonLabel (pb, event, NULL); } else XmeClearBorder (XtDisplay (pb), XtWindow (pb), pb->primitive.highlight_thickness, pb->primitive.highlight_thickness, pb->core.width - 2 * pb->primitive.highlight_thickness, pb->core.height - 2 * pb->primitive.highlight_thickness, pb->primitive.shadow_thickness); if (pb->pushbutton.disarm_callback) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) pb, pb->pushbutton.disarm_callback, &call_value); } } } else { _XmPrimitiveLeave ((Widget) pb, event, NULL, NULL); if (pb->pushbutton.armed == TRUE) { XtExposeProc expose; pb->pushbutton.armed = FALSE; _XmProcessLock(); expose = XtClass(pb)->core_class.expose; _XmProcessUnlock(); (* expose)(wid, event, (Region) NULL); pb->pushbutton.armed = TRUE; } } } /*************************************<->************************************* * * KeySelect * * If the menu system traversal is enabled, do an activate and disarm * *************************************<->***********************************/ /*ARGSUSED*/ static void KeySelect( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; XmPushButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; if (!_XmIsEventUnique(event)) return; if (!_XmGetInDragMode((Widget)pb)) { menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(pb)), XmQTmenuSystem); pb->pushbutton.armed = FALSE; if (menuSTrait != NULL) menuSTrait->buttonPopdown(XtParent(pb), event); _XmRecordEvent(event); call_value.reason = XmCR_ACTIVATE; call_value.event = event; /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) menuSTrait->entryCallback(XtParent(pb), (Widget) pb, &call_value); if ((! pb->label.skipCallback) && (pb->pushbutton.activate_callback)) { XFlush (XtDisplay (pb)); XtCallCallbackList ((Widget) pb, pb->pushbutton.activate_callback, &call_value); } if (menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(pb), event); } } /************************************************************************ * * Help * This function processes Function Key 1 press occuring on the PushButton. * ************************************************************************/ /*ARGSUSED*/ static void Help( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonWidget pb = (XmPushButtonWidget) wid ; Boolean is_menupane = Lab_IsMenupane(pb); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (is_menupane && menuSTrait != NULL) menuSTrait->buttonPopdown(XtParent(pb), event); _XmPrimitiveHelp ((Widget) pb, event, NULL, NULL); /*** * call_value.reason = XmCR_HELP; * call_value.event = event; * XtCallCallbackList ((Widget) pb, pb->primitive.help_callback, &call_value); ***/ if (is_menupane && menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(pb), event); } /************************************************************************ * * Trait methods -------- * ************************************************************************/ /************************************************************************ * * ChangeCB * add or remove the activate callback list. * ************************************************************************/ static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) { if (setunset) XtAddCallback (w, XmNactivateCallback, activCB, closure); else XtRemoveCallback (w, XmNactivateCallback, activCB, closure); } /************************************************************************ * * ShowAsDefault * set up the default visual * ************************************************************************/ static void ShowAsDefault(Widget w, XtEnum state) { XmPushButtonWidget pb = (XmPushButtonWidget) w ; Dimension dbShadowTh ; switch (state) { case XmDEFAULT_READY: { /* We have pixels, but the button unit type might not be * pixel, so save it and restore it after the setvalues */ unsigned char saved_unit_type = ((XmPrimitiveWidget)w)->primitive.unit_type ; #ifdef DEFAULT_GLYPH_PIXMAP unsigned int def_pixmap_width ; if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), &def_pixmap_width, NULL) != XmUNSPECIFIED_PIXMAP) { /* We will use the margin right area, so increase it */ pb->pushbutton.compatible = False; ((XmPrimitiveWidget)w)->primitive.unit_type = XmPIXELS; XtVaSetValues(w, XmNmarginRight, def_pixmap_width, NULL); ((XmPrimitiveWidget)w)->primitive.unit_type = saved_unit_type; } else #endif if (!pb->pushbutton.default_button_shadow_thickness) { if (pb->primitive.shadow_thickness > 1) dbShadowTh = pb->primitive.shadow_thickness >> 1 ; else dbShadowTh = pb->primitive.shadow_thickness ; /* CR 7474: Disable pushbutton compatibility mode. */ pb->pushbutton.compatible = False; ((XmPrimitiveWidget)w)->primitive.unit_type = XmPIXELS; XtVaSetValues(w, XmNdefaultButtonShadowThickness, dbShadowTh, NULL); ((XmPrimitiveWidget)w)->primitive.unit_type = saved_unit_type; } } break ; case XmDEFAULT_ON : /* CR 7474: Disable pushbutton compatibility mode. */ pb->pushbutton.compatible = False; XtVaSetValues(w, XmNshowAsDefault, True, NULL); break ; case XmDEFAULT_OFF : XtVaSetValues(w, XmNshowAsDefault, False, NULL); break ; case XmDEFAULT_FORGET : default: #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) XtVaSetValues(w, XmNmarginRight, 0, NULL); else #endif if (!pb->pushbutton.default_button_shadow_thickness) XtVaSetValues(w, XmNdefaultButtonShadowThickness, 0, NULL); } } /************************************************************************ * * Application Accessible External Functions * ************************************************************************/ /************************************************************************ * * XmCreatePushButton * Create an instance of a pushbutton and return the widget id. * ************************************************************************/ Widget XmCreatePushButton( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return XtCreateWidget(name, xmPushButtonWidgetClass, parent, arglist, argcount); } Widget XmVaCreatePushButton( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmPushButtonWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedPushButton( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmPushButtonWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/XmTabList.c0000644000175000017500000004147312672140200012733 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: XmTabList.c /main/9 1999/04/27 17:49:59 samborn $" #endif #endif #ifndef X_NOT_STDC_ENV #include #endif #include #include #include /* For ALLOCATE/DEALLOCATE_LOCAL */ #include "MessagesI.h" #include "ResIndI.h" #include "XmI.h" #include "XmRenderTI.h" #include "XmStringI.h" #include "XmTabListI.h" /* Warning Messages */ #define NEGATIVE_VALUE_MSG _XmMMsgXmTabList_0000 /******** Static Function Declarations ********/ static XmTab GetNthTab(XmTabList tl, int pos, XmTab cur_tab, int cur_pos); /******** End Static Function Declarations ********/ /* * This function returns the tab in tl at position pos. It starts searching * either from the start of the tablist or from cur_tab if cur_pos is closer to * pos than zero and cur_tab is not NULL. */ static XmTab GetNthTab(XmTabList tl, int pos, XmTab cur_tab, int cur_pos) { XmTab prev_tab; unsigned int count; int i; if (pos == 0) return(_XmTabLStart(tl)); count = _XmTabLCount(tl); if (abs(pos) >= count) { if (pos > 0) return(_XmTabPrev(_XmTabLStart(tl))); else return(_XmTabLStart(tl)); } /* Convert pos and cur_pos to positives less than count */ if (pos < 0) pos += count; cur_pos %= count; if (cur_pos < 0) cur_pos += count; if (pos == cur_pos) return(cur_tab); /* Is start or cur_tab closer? */ if ((cur_tab != NULL) && ((pos > cur_pos/2) || (pos < (count + cur_pos)/2))) { prev_tab = cur_tab; i = pos - cur_pos; } else { prev_tab = _XmTabLStart(tl); i = (pos < count/2) ? pos : pos - count; } switch (i/abs(i)) { case 1: for (; i > 0; i--) prev_tab = _XmTabNext(prev_tab); break; case -1: for (; i < 0; i++) prev_tab = _XmTabPrev(prev_tab); break; } return(prev_tab); } /* * A tablist is a doubly linked ring of tabs. */ XmTabList XmTabListInsertTabs(XmTabList oldlist, XmTab *tabs, Cardinal tab_count, int position) { XmTabList tl; int i; XmTab prev_tab, tab, next_tab; _XmProcessLock(); if ((tabs == NULL) || (tab_count == 0)) { _XmProcessUnlock(); return(oldlist); } if (oldlist == NULL) { tl = (XmTabList)XtMalloc(sizeof(_XmTabListRec)); _XmTabLCount(tl) = tab_count; prev_tab = _XmTabCopy(tabs[0]); _XmTabLStart(tl) = prev_tab; for (i = 1; i < tab_count; i++) { tab = _XmTabCopy(tabs[i]); _XmTabPrev(tab) = prev_tab; _XmTabNext(prev_tab) = tab; prev_tab = tab; } _XmTabNext(prev_tab) = _XmTabLStart(tl); _XmTabPrev(_XmTabLStart(tl)) = prev_tab; } else { tl = XmTabListCopy(oldlist, 0, 0); /* Hook in first tab */ tab = _XmTabCopy(tabs[0]); prev_tab = GetNthTab(tl, position, NULL, 0); if (position == 0) _XmTabLStart(tl) = tab; next_tab = _XmTabNext(prev_tab); _XmTabNext(prev_tab) = tab; _XmTabPrev(tab) = prev_tab; prev_tab = tab; /* Hook in rest of tabs. */ for (i = 1; i < tab_count; i++) { tab = _XmTabCopy(tabs[i]); _XmTabNext(prev_tab) = tab; _XmTabPrev(tab) = prev_tab; prev_tab = tab; } /* Complete circle */ _XmTabNext(prev_tab) = next_tab; _XmTabPrev(next_tab) = prev_tab; _XmTabLCount(tl) += tab_count; XmTabListFree( oldlist ); } _XmProcessUnlock(); return(tl); } /*ARGSUSED*/ Widget _XmCreateTabList(Widget parent, String name, /* unused */ ArgList arglist, /* unused */ Cardinal argcount) /* unused */ { XmRendition rend = (XmRendition)parent; XmTabList tl = NULL; if (_XmRendTabs(rend) == NULL) { tl = (XmTabList)XtMalloc(sizeof(_XmTabListRec)); bzero((char *)tl, sizeof(_XmTabListRec)); _XmRendTabs(rend) = tl; } return((Widget)tl); } /* * This copying routine also works with the internal marking scheming used * by the insert and replace routines. */ XmTabList XmTabListCopy(XmTabList tablist, int offset, Cardinal count) { XmTabList tl; XmTab old_tab, tab, next_tab; unsigned int i; _XmProcessLock(); if (tablist == NULL) { _XmProcessUnlock(); return(NULL); } tl = (XmTabList)XtMalloc(sizeof(_XmTabListRec)); /* Zero count implies copy from offset to end/beginning */ if (count == 0) count = (_XmTabLCount(tablist) - abs(offset)); if (count > _XmTabLCount(tablist)) count = _XmTabLCount(tablist); old_tab = GetNthTab(tablist, offset, NULL, 0); /* If marked, routine called by insert/replace. Don't copy. */ tab = _XmTabMark(old_tab) ? old_tab : _XmTabCopy(old_tab); /* Add first. */ _XmTabLCount(tl) = count; _XmTabLStart(tl) = tab; /* Add rest. */ for (i = 1; i < count; i++) { old_tab = (offset >= 0) ? _XmTabNext(old_tab) : _XmTabPrev(old_tab); /* See above. Don't copy if marked. */ next_tab = _XmTabMark(old_tab)? old_tab : _XmTabCopy(old_tab); _XmTabNext(tab) = next_tab; _XmTabPrev(next_tab) = tab; tab = next_tab; } /* Complete circle. */ _XmTabNext(tab) = _XmTabLStart(tl); _XmTabPrev(_XmTabLStart(tl)) = tab; _XmProcessUnlock(); return(tl); } /* * Marked tabs have mark cleared but aren't actually freed. */ void XmTabListFree(XmTabList tablist) { int i; XmTab tab, next; _XmProcessLock(); if (tablist == NULL) { _XmProcessUnlock(); return; } tab = _XmTabLStart(tablist); for (i = 1; i < _XmTabLCount(tablist); i++) { next = _XmTabNext(tab); if (_XmTabMark(tab)) _XmTabMark(tab) = FALSE; else XmTabFree(tab); tab = next; } if (_XmTabMark(tab)) _XmTabMark(tab) = FALSE; else XmTabFree(tab); _XmProcessUnlock(); XtFree((char *)tablist); } Cardinal XmTabListTabCount(XmTabList tablist) { Cardinal ret_val; _XmProcessLock(); if (tablist == NULL) { _XmProcessUnlock(); return 0; } ret_val = _XmTabLCount(tablist); _XmProcessUnlock(); return ret_val; } XmTab XmTabListGetTab(XmTabList tablist, Cardinal position) { XmTab ret_val; _XmProcessLock(); if (tablist == NULL || abs(position) >= _XmTabLCount(tablist)) { _XmProcessUnlock(); return((XmTab)NULL); } ret_val = _XmTabCopy(GetNthTab(tablist, position, NULL, 0)); _XmProcessUnlock(); return ret_val; } /* * This routine uses the mark bit of tabs so that replaced tabs can * be copied upon replacement and not copied when the rest of the tabs * are copied or freed when the old tabs are freed. */ XmTabList XmTabListReplacePositions(XmTabList oldlist, Cardinal *position_list, XmTab *tabs, Cardinal tab_count) { unsigned int i; unsigned int cur_pos; XmTab cur_tab, tab, prev, next; XmTabList tl; _XmProcessLock(); if ((oldlist == NULL) || (position_list == NULL) || (tabs == NULL) || (tab_count == 0)) { _XmProcessUnlock(); return(oldlist); } tl = (XmTabList)XtMalloc(sizeof(_XmTabListRec)); _XmTabLCount(tl) = _XmTabLCount(oldlist); cur_tab = _XmTabLStart(tl) = _XmTabLStart(oldlist); cur_pos = 0; /* Make the replacement in the old list, then copy and free. */ for (i = 0; i < tab_count; i++) { cur_tab = GetNthTab(tl, position_list[i], cur_tab, cur_pos); cur_pos = position_list[i]; prev = _XmTabPrev(cur_tab); next = _XmTabNext(cur_tab); /* replace tab copying */ tab = _XmTabCopy(tabs[i]); if (prev == cur_tab) { /* only one tab in list */ _XmTabPrev(tab) = _XmTabNext(tab) = tab; } else { _XmTabNext(prev) = tab; _XmTabPrev(tab) = prev; _XmTabNext(tab) = next; _XmTabPrev(next) = tab; } if (cur_tab == _XmTabLStart(tl)) _XmTabLStart(tl) = tab; XmTabFree(cur_tab); cur_tab = tab; } XtFree((char *)oldlist); _XmProcessUnlock(); return(tl); } /* * This routine uses a mark/sweep algorithm. * A pass over position_list is made to mark tabs for removal without * disturbing their positions. * Then a pass is made over the oldlist removing marked tabs. * A final pass is made to copy the remaining tabs. */ XmTabList XmTabListRemoveTabs(XmTabList oldlist, Cardinal *position_list, Cardinal position_count) { XmTab cur_tab, tab, prev, next; int cur_pos, i; XmTabList tl; _XmProcessLock(); if ((oldlist == NULL) || (position_list == NULL) || (position_count == 0)) { _XmProcessUnlock(); return(oldlist); } cur_tab = _XmTabLStart(oldlist); cur_pos = 0; /* Get position, set mark */ for (i = 0; i < position_count; i++) { cur_tab = GetNthTab(oldlist, position_list[i], cur_tab, cur_pos); cur_pos = position_list[i]; _XmTabMark(cur_tab) = TRUE; } /* Free marked tabs */ for (tab = _XmTabNext(_XmTabLStart(oldlist)); tab != _XmTabLStart(oldlist); tab = next) { if (_XmTabMark(tab)) { prev = _XmTabPrev(tab); next = _XmTabNext(tab); _XmTabNext(prev) = next; _XmTabPrev(next) = prev; XmTabFree(tab); _XmTabLCount(oldlist) --; } else next = _XmTabNext(tab); } /* tab is now at start. */ if (_XmTabMark(tab)) { if (tab == _XmTabNext(tab)) /* We've deleted all the tabs. */ { _XmTabLCount(oldlist) = 1; _XmTabMark(tab) = FALSE; XmTabListFree(oldlist); _XmProcessUnlock(); return((XmTabList)NULL); } _XmTabLStart(oldlist) = _XmTabNext(tab); prev = _XmTabPrev(tab); next = _XmTabNext(tab); _XmTabNext(prev) = next; _XmTabPrev(next) = prev; XmTabFree(tab); _XmTabLCount(oldlist) --; } tl = XmTabListCopy(oldlist, 0, 0); XmTabListFree(oldlist); _XmProcessUnlock(); return(tl); } XmTab XmTabCreate(float value, unsigned char units, XmOffsetModel offset_model, unsigned char alignment, char *decimal) { XmTab tab; _XmProcessLock(); tab = (XmTab)XtMalloc(sizeof(_XmTabRec)); _XmTabMark(tab) = FALSE; if (value >= 0) { _XmTabValue(tab) = value; } else { _XmTabValue(tab) = 0.0; XmeWarning(NULL, NEGATIVE_VALUE_MSG); } _XmTabUnits(tab) = units; _XmTabModel(tab) = offset_model; _XmTabAlign(tab) = alignment; _XmTabDecimal(tab) = XtNewString(decimal); _XmProcessUnlock(); return(tab); } /*ARGSUSED*/ Widget _XmCreateTab(Widget parent, String name, /* unused */ ArgList arglist, Cardinal argcount) { static XrmQuark quarks[] = {0, 0, 0, 0, 0}; XmTabList tl = (XmTabList)parent; XrmQuark qarg; float value = 0.0; unsigned char units = XmPIXELS; XmOffsetModel model = XmABSOLUTE; unsigned char alignment = XmALIGNMENT_BEGINNING; char *decimal = "."; XmTab tab, start; int i; /* Init quark list */ if (quarks[0] == 0) { quarks[0] = XrmPermStringToQuark(XmNtabValue); quarks[1] = XrmPermStringToQuark(XmNunitType); quarks[2] = XrmPermStringToQuark(XmNoffsetModel); quarks[3] = XrmPermStringToQuark(XmNalignment); quarks[4] = XrmPermStringToQuark(XmNdecimal); } /* Get arguments from arglist */ for (i = 0; i < argcount; i++) { qarg = XrmStringToQuark(arglist[i].name); if (qarg == quarks[0]) value = (float)arglist[i].value; else if (qarg == quarks[1]) units = (unsigned char)arglist[i].value; else if (qarg == quarks[2]) model = (XmOffsetModel)arglist[i].value; else if (qarg == quarks[3]) alignment = (unsigned char)arglist[i].value; else if (qarg == quarks[4]) decimal = (char *)arglist[i].value; } tab = XmTabCreate(value, units, model, alignment, decimal); if (_XmTabLCount(tl) == 0) { _XmTabLStart(tl) = tab; _XmTabPrev(tab) = tab; _XmTabNext(tab) = tab; } else { start = _XmTabLStart(tl); _XmTabNext(tab) = start; _XmTabPrev(tab) = _XmTabPrev(start); _XmTabNext(_XmTabPrev(start)) = tab; _XmTabPrev(start) = tab; } _XmTabLCount(tl)++; return((Widget)NULL); } void XmTabFree(XmTab tab) { if (tab == NULL) return; XtFree(_XmTabDecimal(tab)); XtFree((char *)tab); } float XmTabGetValues(XmTab tab, unsigned char *units, XmOffsetModel *offset, unsigned char *alignment, char **decimal) { float ret_val; _XmProcessLock(); if (units != NULL) *units = _XmTabUnits(tab); if (offset != NULL) *offset = _XmTabModel(tab); if (alignment != NULL) *alignment = _XmTabAlign(tab); if (decimal != NULL) *decimal = _XmTabDecimal(tab); ret_val = _XmTabValue(tab); _XmProcessUnlock(); return ret_val; } void XmTabSetValue(XmTab tab, float value) { _XmProcessLock(); if (value >= 0) _XmTabValue(tab) = value; else XmeWarning(NULL, NEGATIVE_VALUE_MSG); _XmProcessUnlock(); } XmTab _XmTabCopy(XmTab tab) { XmTab new_tab; new_tab = (XmTab)XtMalloc(sizeof(_XmTabRec)); memcpy((char *)new_tab, (char *)tab, sizeof(_XmTabRec)); _XmTabMark(new_tab) = FALSE; _XmTabDecimal(new_tab) = XtNewString(_XmTabDecimal(tab)); return(new_tab); } /*********** * _XmTabListGetPosition * returns the x pixel coordinate of the specified tab. **********/ Position _XmTabListGetPosition( Screen * screen, XmTabList tab_list, unsigned char unit_type, Cardinal tab_position) { XmTab tab ; Position xpos = 0 ; unsigned char units; XmOffsetModel offset; tab = XmTabListGetTab(tab_list, tab_position); if (tab) { xpos = (Position) XmTabGetValues(tab, &units, &offset, NULL, NULL); xpos = _XmConvertUnits(screen, XmHORIZONTAL, units, xpos, unit_type); /* a little bit of recursivity here */ if ((offset == XmRELATIVE) && tab_position){ xpos += _XmTabListGetPosition(screen, tab_list, unit_type, tab_position-1); } XmTabFree(tab) ; } return xpos ; } #ifdef _XmDEBUG_XMTABLIST static char * units_image(XtEnum units) { static char buf[100]; switch (units) { case XmPIXELS: return "px"; case Xm100TH_MILLIMETERS: return "100mm"; case Xm1000TH_INCHES: return "1000in"; case Xm100TH_POINTS: return "100pt"; case Xm100TH_FONT_UNITS: return "100fu"; case XmINCHES: return "in"; case XmCENTIMETERS: return "cm"; case XmMILLIMETERS: return "mm"; case XmPOINTS: return "pt"; case XmFONT_UNITS: return "fu"; default: sprintf(buf, "", units); return buf; } } static char * model_image(XmOffsetModel model) { static char buf[100]; switch (model) { case XmABSOLUTE: return "abs."; case XmRELATIVE: return "rel."; default: sprintf(buf, "", model); return buf; } } static char * alignment_image(XtEnum alignment) { static char buf[100]; switch (alignment) { case XmALIGNMENT_BEGINNING: return "beginning"; case XmALIGNMENT_CENTER: return "center"; case XmALIGNMENT_END: return "end"; default: sprintf(buf, "", alignment); return buf; } } void _Xm_dump_tab(XmTab tab) { unsigned int mark = _XmTabMark(tab); /* unsigned int ref_count = ((_XmTab)tab)->ref_count; */ float value = _XmTabValue(tab); unsigned char units = _XmTabUnits(tab); XmOffsetModel model = _XmTabModel(tab); unsigned char alignment = _XmTabAlign(tab); char *decimal = _XmTabDecimal(tab); XmTab next = _XmTabNext(tab); XmTab prev = _XmTabPrev(tab); printf ("%p: %f %s, %s from %s '%s', %p %p, %d\n", tab, value, units_image(units), model_image(model), alignment_image(alignment), decimal, next, prev, mark); } void _Xm_dump_tablist(XmTabList list) { int i; int count = _XmTabLCount(list); XmTab tab = _XmTabLStart(list); printf("(XmTabList)%p: count %d, start %p.\n", list, count, tab); for (i = 0; i < count; i++) { printf (" #%d> ", i); _Xm_dump_tab(tab); tab = _XmTabNext(tab); } } #endif /* _XmDEBUG_XMTABLIST */ motif-2.3.8/lib/Xm/SashP.h0000644000175000017500000000550413145162623012113 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * SashP.h - Private definitions for Sash widget (Used by VPane Widget) * */ #ifndef _XmSashP_h #define _XmSashP_h #include #ifdef __cplusplus extern "C" { #endif /***************************************************************************** * * Sash Widget Private Data * *****************************************************************************/ /* New fields for the Sash widget class record */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmSashClassPart; /* Full Class record declaration */ typedef struct _XmSashClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmSashClassPart sash_class; } XmSashClassRec; typedef struct _XmSashClassRec *XmSashWidgetClass; externalref XmSashClassRec xmSashClassRec; /* New fields for the Sash widget record */ typedef struct { XtCallbackList sash_action; Boolean has_focus; } XmSashPart; /***************************************************************************** * * Full instance record declaration * ****************************************************************************/ typedef struct _XmSashRec { CorePart core; XmPrimitivePart primitive; XmSashPart sash; } XmSashRec; typedef struct _XmSashRec *XmSashWidget; typedef struct { XEvent *event; /* the event causing the SashAction */ String *params; /* the TranslationTable params */ Cardinal num_params; /* count of params */ } SashCallDataRec, *SashCallData; /* Class Record Constant */ externalref WidgetClass xmSashWidgetClass; #ifndef XmIsSash #define XmIsSash(w) XtIsSubclass(w, xmSashWidgetClass) #endif /* XmIsSash */ /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSashP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Xmfuncs.h0000644000175000017500000000612512672140200012507 00000000000000/* * $TOG: Xmfuncs.h /main/1 1997/03/24 16:25:46 dbl $ * * Copyright (c) 1990 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. * */ #ifndef _XFUNCS_H_ #define _XFUNCS_H_ #include /* the old Xfuncs.h, for pre-R6 */ #ifdef X_USEBFUNCS void bcopy(); void bzero(); int bcmp(); #else #if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_) #include #define _XFUNCS_H_INCLUDED_STRING_H #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len)) #define bzero(b,len) memset(b, 0, (size_t)(len)) #define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len)) #else #ifdef sgi #include #else #ifdef SYSV #include void bcopy(); #define bzero(b,len) memset(b, 0, len) #define bcmp(b1,b2,len) memcmp(b1, b2, len) #else /* bsd */ void bcopy(); void bzero(); int bcmp(); #endif /* SYSV */ #endif /* sgi */ #endif /* __STDC__ and relatives */ #endif /* X_USEBFUNCS */ /* the new Xfuncs.h */ #if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4)) /* the ANSI C way */ #ifndef _XFUNCS_H_INCLUDED_STRING_H #include #endif #undef bzero #define bzero(b,len) memset(b,0,len) #else /* else X_NOT_STDC_ENV or SunOS 4 */ #if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__) #include #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len)) #if defined(SYSV) && defined(_XBCOPYFUNC) #undef memmove #define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len)) #define _XNEEDBCOPYFUNC #endif #else /* else vanilla BSD */ #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len)) #define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len)) #define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len)) #endif /* SYSV else */ #endif /* ! X_NOT_STDC_ENV else */ #endif /* _XFUNCS_H_ */ motif-2.3.8/lib/Xm/ScrollBar.c0000644000175000017500000041736313145162623012765 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: ScrollBar.c /main/20 1997/03/10 14:52:28 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #ifndef X_NOT_STDC_ENV #include #endif #include /* for enableThinThickness */ #include #include /* for XmDropSiteStartUpdate/EndUPdate */ #include #include #include #include #include #include #include "ColorI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "XmI.h" /* see comments in ScrollBarP.h */ #define slider_visual etched_slider #define flat_slider_GC unhighlight_GC #define MESSAGE1 _XmMMsgScrollBar_0000 #define MESSAGE2 _XmMMsgScrollBar_0001 #define MESSAGE3 _XmMMsgScrollBar_0002 #define MESSAGE4 _XmMMsgScrollBar_0003 #define MESSAGE6 _XmMMsgScaleScrBar_0004 #define MESSAGE7 _XmMMsgScrollBar_0004 #define MESSAGE8 _XmMMsgScrollBar_0005 #define MESSAGE9 _XmMMsgScrollBar_0006 #define MESSAGE10 _XmMMsgScrollBar_0007 #define MESSAGE13 _XmMMsgScrollBar_0008 #define MESSAGE14 _XmMMsgMotif_0001 #define MAXDIMENSION 65535 #define DRAWARROW(sbw, t_gc, b_gc, x, y, dir)\ XmeDrawArrow(XtDisplay ((Widget) sbw),\ XtWindow ((Widget) sbw),\ t_gc, b_gc,\ sbw->scrollBar.foreground_GC,\ x-1, y-1,\ sbw->scrollBar.arrow_width+2,\ sbw->scrollBar.arrow_height+2,\ sbw->primitive.shadow_thickness,\ dir); #define PROCESS_DIR_INVERSED(sbw) \ ((sbw->scrollBar.processing_direction == XmMAX_ON_LEFT) || \ (sbw->scrollBar.processing_direction == XmMAX_ON_TOP)) #define INVERSED_VALUE(sbw) \ (sbw->scrollBar.maximum + sbw->scrollBar.minimum - \ sbw->scrollBar.value - sbw->scrollBar.slider_size) /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc) ; static void ProcessingDirectionDefault( XmScrollBarWidget widget, int offset, XrmValue *value) ; static void BackgroundPixelDefault( XmScrollBarWidget widget, int offset, XrmValue *value) ; static void TraversalDefault( XmScrollBarWidget widget, int offset, XrmValue *value) ; static void HighlightDefault( XmScrollBarWidget widget, int offset, XrmValue *value) ; static void SliderVisualDefault( XmScrollBarWidget widget, int offset, XrmValue *value) ; static void SliderMarkDefault( XmScrollBarWidget widget, int offset, XrmValue *value) ; static void EditableDefault( XmScrollBarWidget widget, int offset, XrmValue *value) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetForegroundGC( XmScrollBarWidget sbw) ; static void GetUnavailableGC( XmScrollBarWidget sbw) ; static void GetFlatSliderGC( XmScrollBarWidget sbw) ; static void GetSliderPixmap( XmScrollBarWidget sbw) ; static void CalcSliderRect( XmScrollBarWidget sbw, short *slider_x, short *slider_y, short *slider_width, short *slider_height) ; static void DrawSliderPixmap( XmScrollBarWidget sbw) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void Resize( Widget wid) ; static void Realize( Widget sbw, XtValueMask *window_mask, XSetWindowAttributes *window_attributes) ; static void Destroy( Widget wid) ; static Boolean ValidateInputs( XmScrollBarWidget current, XmScrollBarWidget request, XmScrollBarWidget new_w) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static int CalcSliderVal( XmScrollBarWidget sbw, int x, int y) ; static void Select( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Release( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Moved( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void TopOrBottom( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void IncrementUpOrLeft( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void IncrementDownOrRight( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void PageUpOrLeft( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void PageDownOrRight( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void CancelDrag( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void MoveSlider( XmScrollBarWidget sbw, int currentX, int currentY) ; static void RedrawSliderWindow( XmScrollBarWidget sbw) ; static Boolean ChangeScrollBarValue( XmScrollBarWidget sbw) ; static void TimerEvent( XtPointer closure, XtIntervalId *id) ; static void ScrollCallback( XmScrollBarWidget sbw, int reason, int value, int xpixel, int ypixel, XEvent *event) ; static void ExportScrollBarValue( Widget wid, int offset, XtArgVal *value) ; static XmImportOperator ImportScrollBarValue( Widget wid, int offset, XtArgVal *value) ; static void NavigChangeMoveCB(Widget nav, XtCallbackProc moveProc, XtPointer closure, Boolean setunset) ; static void NavigSetValue(Widget nav, XmNavigatorData nav_data, Boolean notify) ; static void NavigGetValue(Widget nav, XmNavigatorData nav_data) ; /******** End Static Function Declarations ********/ /* Default translation table and action list */ #define defaultTranslations _XmScrollBar_defaultTranslations static XtActionsRec actions[] = { { "Select", Select }, { "Release", Release }, { "Moved", Moved }, { "TopOrBottom", TopOrBottom }, { "IncrementUpOrLeft", IncrementUpOrLeft }, { "IncrementDownOrRight", IncrementDownOrRight }, { "PageUpOrLeft", PageUpOrLeft }, { "PageDownOrRight", PageDownOrRight }, { "CancelDrag", CancelDrag }, }; /* Resource list for ScrollBar */ static XtResource resources[] = { { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof(unsigned char), XtOffsetOf(XmScrollBarRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmSTICKY_TAB_GROUP }, { XmNbackground, XmCBackground, XmRPixel, sizeof(Pixel), XtOffsetOf(XmScrollBarRec, core.background_pixel), XmRCallProc, (XtPointer) BackgroundPixelDefault }, { XmNtroughColor, XmCTroughColor, XmRPixel, sizeof(Pixel), XtOffsetOf(XmScrollBarRec, scrollBar.trough_color), XmRCallProc, (XtPointer) _XmSelectColorDefault }, { XmNvalue, XmCValue, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.value), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNminimum, XmCMinimum, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.minimum), XmRImmediate, (XtPointer) 0 }, { XmNmaximum, XmCMaximum, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.maximum), XmRImmediate, (XtPointer) 100 }, { XmNsliderSize, XmCSliderSize, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.slider_size), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNshowArrows, XmCShowArrows, XmRShowArrows, sizeof (XtEnum), XtOffsetOf(XmScrollBarRec, scrollBar.show_arrows), XmRImmediate, (XtPointer) XmEACH_SIDE }, { XmNorientation, XmCOrientation, XmROrientation, sizeof (unsigned char), XtOffsetOf(XmScrollBarRec, scrollBar.orientation), XmRImmediate, (XtPointer) XmVERTICAL }, { XmNprocessingDirection, XmCProcessingDirection, XmRProcessingDirection, sizeof (unsigned char), XtOffsetOf(XmScrollBarRec, scrollBar.processing_direction), XmRCallProc, (XtPointer) ProcessingDirectionDefault }, { XmNincrement, XmCIncrement, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.increment), XmRImmediate, (XtPointer) 1 }, { XmNpageIncrement, XmCPageIncrement, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.page_increment), XmRImmediate, (XtPointer) 10 }, { XmNinitialDelay, XmCInitialDelay, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.initial_delay), XmRImmediate, (XtPointer) 250 }, { XmNrepeatDelay, XmCRepeatDelay, XmRInt, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.repeat_delay), XmRImmediate, (XtPointer) 50 }, { XmNvalueChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.value_changed_callback), XmRPointer, (XtPointer) NULL }, { XmNincrementCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.increment_callback), XmRPointer, (XtPointer) NULL }, { XmNdecrementCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.decrement_callback), XmRPointer, (XtPointer) NULL }, { XmNpageIncrementCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.page_increment_callback), XmRPointer, (XtPointer) NULL }, { XmNpageDecrementCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.page_decrement_callback), XmRPointer, (XtPointer) NULL }, { XmNtoTopCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.to_top_callback), XmRPointer, (XtPointer) NULL }, { XmNtoBottomCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.to_bottom_callback), XmRPointer, (XtPointer) NULL }, { XmNdragCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrollBarRec, scrollBar.drag_callback), XmRPointer, (XtPointer) NULL }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf(XmPrimitiveRec, primitive.traversal_on), XmRCallProc, (XtPointer) TraversalDefault }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmPrimitiveRec, primitive.highlight_thickness), XmRCallProc, (XtPointer) HighlightDefault }, { XmNsnapBackMultiple, XmCSnapBackMultiple, XmRShort, sizeof (unsigned short), XtOffsetOf(XmScrollBarRec, scrollBar.snap_back_multiple), XmRImmediate, (XtPointer) MAXDIMENSION }, { XmNslidingMode, XmCSlidingMode, XmRSlidingMode, sizeof(XtEnum), XtOffsetOf(XmScrollBarRec, scrollBar.sliding_mode), XmRImmediate, (XtPointer) XmSLIDER }, { XmNeditable, XmCEditable, XmRBoolean, sizeof(XtEnum), XtOffsetOf(XmScrollBarRec,scrollBar.editable), XmRCallProc, (XtPointer) EditableDefault }, { XmNsliderVisual, XmCSliderVisual, XmRSliderVisual, sizeof (XtEnum), XtOffsetOf(XmScrollBarRec, scrollBar.slider_visual), XmRCallProc, (XtPointer) SliderVisualDefault }, { XmNsliderMark, XmCSliderMark, XmRSliderMark, sizeof (XtEnum), XtOffsetOf(XmScrollBarRec, scrollBar.slider_mark), XmRCallProc, (XtPointer) SliderMarkDefault }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNvalue, sizeof (int), XtOffsetOf(XmScrollBarRec, scrollBar.value), ExportScrollBarValue, ImportScrollBarValue }, }; externaldef(xmscrollbarclassrec) XmScrollBarClassRec xmScrollBarClassRec = { { (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "XmScrollBar", /* class_name */ sizeof(XmScrollBarRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ Realize, /* realize */ actions, /* actions */ XtNumber(actions), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ defaultTranslations, /* tm_table */ (XtGeometryHandler)NULL, /* query_geometry */ (XtStringProc)NULL, /* display_accelerator */ (XtPointer) NULL, /* extension */ }, { XmInheritWidgetProc, /* border_highlight */ XmInheritWidgetProc, /* border_unhighlight */ NULL, /* translations */ (XtActionProc)NULL, /* arm_and_activate */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num syn_resources */ NULL, /* extension */ }, { (XtPointer) NULL, /* extension */ }, }; externaldef(xmscrollbarwidgetclass) WidgetClass xmScrollBarWidgetClass = (WidgetClass) &xmScrollBarClassRec; /* Trait record for ScrollBar */ static XmConst XmNavigatorTraitRec scrollBarNT = { 0, /* version */ NavigChangeMoveCB, NavigSetValue, NavigGetValue, }; /********************************************************************* * * ExportScrollBarValue * Convert the scrollbar value from the normal processing direction * to reverse processing if needed. * *********************************************************************/ /*ARGSUSED*/ static void ExportScrollBarValue( Widget wid, int offset, /* unused */ XtArgVal *value ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; if (PROCESS_DIR_INVERSED(sbw)) *value = (XtArgVal) INVERSED_VALUE(sbw); else *value = (XtArgVal) sbw->scrollBar.value; } /********************************************************************* * * ImportScrollBarValue * Indicate that the value did indeed change. * *********************************************************************/ /*ARGSUSED*/ static XmImportOperator ImportScrollBarValue( Widget wid, int offset, /* unused */ XtArgVal *value ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; sbw->scrollBar.flags |= VALUE_SET_FLAG; *value = (XtArgVal)sbw->scrollBar.value; return(XmSYNTHETIC_LOAD); } /********************************************************************* * * ProcessingDirectionDefault * This procedure provides the dynamic default behavior for * the processing direction resource dependent on the orientation. * *********************************************************************/ /*ARGSUSED*/ static void ProcessingDirectionDefault( XmScrollBarWidget widget, int offset, /* unused */ XrmValue *value ) { static unsigned char direction; value->addr = (XPointer) &direction; if (widget->scrollBar.orientation == XmHORIZONTAL) { if (LayoutIsRtoLP(widget)) direction = XmMAX_ON_LEFT; else direction = XmMAX_ON_RIGHT; } else /* XmVERTICAL -- range checking done during widget initialization */ direction = XmMAX_ON_BOTTOM; } /********************************************************************* * * BackgroundPixelDefault * This procedure provides the dynamic default behavior for * the background color. It looks to see if the parent is a * ScrolledWindow, and if so, it uses the parent background. * This is mostly for compatibility with 1.1 where the scrolledwindow * was forcing its scrollbar color to its own background. * Note that it works for both automatic and non automatic SW, * which is a new feature for non automatic. * *********************************************************************/ static void BackgroundPixelDefault( XmScrollBarWidget widget, int offset, XrmValue *value ) { static Pixel background; Widget parent = XtParent(widget) ; if (XmIsScrolledWindow(parent)) { value->addr = (XPointer) &background; background = parent->core.background_pixel; return ; } /* else use the primitive defaulting mechanism */ _XmBackgroundColorDefault((Widget )widget, offset, value); } /********************************************************************* * * TraversalDefault * This procedure provides the dynamic default behavior for * the traversal. It looks to see if the parent is a * ScrolledWindow, and if so, it sets it to On. * This is mostly for compatibility with 1.1 where the scrolledwindow * was forcing its scrollbar traversal to On * Note that it works only for automatic. * *********************************************************************/ /*ARGSUSED*/ static void TraversalDefault( XmScrollBarWidget widget, int offset, /* unused */ XrmValue *value ) { static Boolean traversal ; Widget parent = XtParent(widget) ; Arg al[1] ; unsigned char sp ; traversal = False ; value->addr = (XPointer) &traversal; if (XmIsScrolledWindow(parent)) { XtSetArg(al[0], XmNscrollingPolicy, &sp); XtGetValues(parent, al, 1); if (sp == XmAUTOMATIC) { traversal = True ; return ; } } } /********************************************************************* * * SliderVisualDefault * * *********************************************************************/ /*ARGSUSED*/ static void SliderVisualDefault( XmScrollBarWidget widget, int offset, /* unused */ XrmValue *value ) { static XtEnum slider_visual ; value->addr = (XPointer) &slider_visual; if (widget->scrollBar.sliding_mode == XmTHERMOMETER) { slider_visual = XmTROUGH_COLOR ; } else { slider_visual = XmSHADOWED_BACKGROUND ; } } /********************************************************************* * * SliderMarkDefault * * *********************************************************************/ /*ARGSUSED*/ static void SliderMarkDefault( XmScrollBarWidget widget, int offset, /* unused */ XrmValue *value ) { static XtEnum slider_mark ; value->addr = (XPointer) &slider_mark; if ((widget->scrollBar.sliding_mode == XmTHERMOMETER) && (widget->scrollBar.editable)) slider_mark = XmROUND_MARK ; else slider_mark = XmNONE ; } /********************************************************************* * * EditableDefault * * *********************************************************************/ /*ARGSUSED*/ static void EditableDefault( XmScrollBarWidget widget, int offset, /* unused */ XrmValue *value ) { static XtEnum editable ; value->addr = (XPointer) &editable; if (widget->scrollBar.sliding_mode == XmTHERMOMETER) { editable = False ; } else { editable = True ; } } /********************************************************************* * * HighlightDefault * This procedure provides the dynamic default behavior for * the highlight. It looks to see if the parent is a * ScrolledWindow, and if so, it sets it to 2 or 1 depending on * the enableThinThickness resource, otherwise, 0. * Note that it works only for automatic. * *********************************************************************/ /*ARGSUSED*/ static void HighlightDefault( XmScrollBarWidget widget, int offset, /* unused */ XrmValue *value ) { static Dimension highlight ; Widget parent = XtParent(widget) ; Arg al[1] ; unsigned char sp ; Boolean thinthickness = False; highlight = 0 ; value->addr = (XPointer) &highlight; if (XmIsScrolledWindow(parent)) { XtSetArg(al[0], XmNscrollingPolicy, &sp); XtGetValues(parent, al, 1); if (sp == XmAUTOMATIC) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(widget)); thinthickness = dpy->display.enable_thin_thickness; if (thinthickness) { highlight = 1; } else { highlight = 2 ; } return ; } } } /********************************************************************* * * ClassPartInitialize * Initialize the fast subclassing. * *********************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmSCROLL_BAR_BIT); /* Install the navigator trait for all subclasses */ XmeTraitSet((XtPointer)wc, XmQTnavigator, (XtPointer) &scrollBarNT); } /********************************************************************* * * Initialize * The main widget instance initialization routine. * *********************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmScrollBarWidget request = (XmScrollBarWidget) rw ; XmScrollBarWidget new_w = (XmScrollBarWidget) nw ; Boolean default_value = FALSE; if(!XmRepTypeValidValue( XmRID_SHOW_ARROWS, new_w->scrollBar.show_arrows, (Widget) new_w) ) { new_w->scrollBar.show_arrows = XmEACH_SIDE; } if(!XmRepTypeValidValue( XmRID_SLIDER_VISUAL, new_w->scrollBar.slider_visual, (Widget) new_w) ) { new_w->scrollBar.slider_visual = XmSHADOWED_BACKGROUND; } if(!XmRepTypeValidValue( XmRID_SLIDER_MARK, new_w->scrollBar.slider_mark, (Widget) new_w) ) { new_w->scrollBar.slider_mark = XmNONE; } if(!XmRepTypeValidValue( XmRID_SLIDING_MODE, new_w->scrollBar.sliding_mode, (Widget) new_w) ) { new_w->scrollBar.sliding_mode = XmSLIDER; } if (new_w->scrollBar.value == XmINVALID_DIMENSION) { new_w->scrollBar.value = 0; default_value = True; } /* Validate the incoming data */ if (new_w->scrollBar.minimum >= new_w->scrollBar.maximum) { new_w->scrollBar.minimum = 0; new_w->scrollBar.maximum = 100; XmeWarning( (Widget) new_w, MESSAGE1); } if (new_w->scrollBar.slider_size == XmINVALID_DIMENSION) { new_w->scrollBar.slider_size = (new_w->scrollBar.maximum - new_w->scrollBar.minimum) / 10; if (new_w->scrollBar.slider_size < 1) new_w->scrollBar.slider_size = 1; } if (new_w->scrollBar.slider_size < 1) { new_w->scrollBar.slider_size = 1; XmeWarning( (Widget) new_w, MESSAGE2); } if (new_w->scrollBar.slider_size > (new_w->scrollBar.maximum - new_w->scrollBar.minimum)) { new_w->scrollBar.slider_size = new_w->scrollBar.maximum - new_w->scrollBar.minimum; XmeWarning( (Widget) new_w, MESSAGE13); } /* in thermo, slider_size is forced to be 0 */ if (new_w->scrollBar.sliding_mode == XmTHERMOMETER) new_w->scrollBar.slider_size = 0 ; if (new_w->scrollBar.value < new_w->scrollBar.minimum) { new_w->scrollBar.value = new_w->scrollBar.minimum; if (!default_value) XmeWarning( (Widget) new_w, MESSAGE3); } if (new_w->scrollBar.value > new_w->scrollBar.maximum - new_w->scrollBar.slider_size) { new_w->scrollBar.value = new_w->scrollBar.minimum; if (!default_value) XmeWarning( (Widget) new_w, MESSAGE4); } if( !XmRepTypeValidValue(XmRID_ORIENTATION, new_w->scrollBar.orientation, (Widget) new_w)) { new_w->scrollBar.orientation = XmVERTICAL; } if (new_w->scrollBar.orientation == XmHORIZONTAL) { if ((new_w->scrollBar.processing_direction != XmMAX_ON_RIGHT) && (new_w->scrollBar.processing_direction != XmMAX_ON_LEFT)) { new_w->scrollBar.processing_direction = XmMAX_ON_RIGHT; XmeWarning( (Widget) new_w, MESSAGE6); } } else { if ((new_w->scrollBar.processing_direction != XmMAX_ON_TOP) && (new_w->scrollBar.processing_direction != XmMAX_ON_BOTTOM)) { new_w->scrollBar.processing_direction = XmMAX_ON_BOTTOM; XmeWarning( (Widget) new_w, MESSAGE6); } } if (new_w->scrollBar.increment <= 0) { new_w->scrollBar.increment = 1; XmeWarning( (Widget) new_w, MESSAGE7); } if (new_w->scrollBar.page_increment <= 0) { new_w->scrollBar.page_increment = 10; XmeWarning( (Widget) new_w, MESSAGE8); } if (new_w->scrollBar.initial_delay <= 0) { new_w->scrollBar.initial_delay = 250; XmeWarning( (Widget) new_w, MESSAGE9); } if (new_w->scrollBar.repeat_delay <= 0) { new_w->scrollBar.repeat_delay = 75; XmeWarning( (Widget) new_w, MESSAGE10); } /* Set up a geometry for the widget if it is currently 0. */ if (request->core.width == 0) { if (new_w->scrollBar.orientation == XmHORIZONTAL) new_w->core.width += 100; else new_w->core.width += 11; } if (request->core.height == 0) { if (new_w->scrollBar.orientation == XmHORIZONTAL) new_w->core.height += 11; else new_w->core.height += 100; } /* Reverse the value for reverse processing. */ if (PROCESS_DIR_INVERSED(new_w)) new_w->scrollBar.value = INVERSED_VALUE(new_w); /* Set the internally used variables. */ new_w->scrollBar.flags = 0; if (new_w->scrollBar.slider_size < (new_w->scrollBar.maximum - new_w->scrollBar.minimum)) { new_w->scrollBar.flags |= SLIDER_AVAILABLE; if (new_w->scrollBar.value > new_w->scrollBar.minimum) new_w->scrollBar.flags |= ARROW1_AVAILABLE; if (new_w->scrollBar.value < (new_w->scrollBar.maximum - new_w->scrollBar.slider_size)) new_w->scrollBar.flags |= ARROW2_AVAILABLE; } else { /* * For correct setvalues processing, when the slider is * unavailable, the arrows should be available. */ new_w->scrollBar.flags |= ARROW1_AVAILABLE; new_w->scrollBar.flags |= ARROW2_AVAILABLE; } new_w->scrollBar.pixmap = 0; new_w->scrollBar.sliding_on = FALSE; new_w->scrollBar.timer = 0; new_w->scrollBar.add_flags = 0 ; new_w->scrollBar.arrow_width = 0; new_w->scrollBar.arrow_height = 0; new_w->scrollBar.arrow1_x = 0; new_w->scrollBar.arrow1_y = 0; new_w->scrollBar.arrow1_selected = FALSE; new_w->scrollBar.arrow2_x = 0; new_w->scrollBar.arrow2_y = 0; new_w->scrollBar.arrow2_selected = FALSE; new_w->scrollBar.saved_value = new_w->scrollBar.value; if (LayoutIsRtoLP(new_w)) new_w->scrollBar.flags &= ~VALUE_SET_FLAG; /* Get the drawing graphics contexts. */ GetForegroundGC(new_w); GetUnavailableGC(new_w); GetFlatSliderGC(new_w); /* call the resize method to get an initial size */ { XtWidgetProc resize; _XmProcessLock(); resize = new_w->core.widget_class->core_class.resize; _XmProcessUnlock(); (* (resize)) ((Widget) new_w); } } /************************************************************************ * * GetForegroundGC * Get the graphics context used for drawing the slider and arrows. * ************************************************************************/ static void GetForegroundGC( XmScrollBarWidget sbw ) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = sbw->core.background_pixel; values.background = sbw->primitive.foreground; values.graphics_exposures = False; sbw->scrollBar.foreground_GC = XtAllocateGC ((Widget) sbw, 0, valueMask, &values, 0, GCFont); } /************************************************************************ * * GetFlatSliderGC * Get the graphics context used for drawing the flat slider * ************************************************************************/ static void GetFlatSliderGC( XmScrollBarWidget sbw ) { XGCValues values; XtGCMask valueMask, unusedMask; valueMask = GCForeground | GCBackground | GCGraphicsExposures; unusedMask = GCFont | GCClipXOrigin | GCClipYOrigin; if (sbw->scrollBar.slider_visual == XmTROUGH_COLOR) values.foreground = sbw->scrollBar.trough_color; else values.foreground = sbw->primitive.foreground; values.background = sbw->core.background_pixel; values.graphics_exposures = False; sbw->scrollBar.flat_slider_GC = XtAllocateGC ((Widget) sbw, 0, valueMask, &values, GCClipMask, unusedMask); } /************************************************************************ * * GetUnavailableGC * Get the graphics context used for drawing the slider and arrows * as being unavailable. * ************************************************************************/ static void GetUnavailableGC( XmScrollBarWidget sbw ) { XGCValues values; XtGCMask valueMask, unusedMask; valueMask = GCForeground | GCBackground | GCGraphicsExposures | GCFillStyle | GCStipple; unusedMask = GCClipXOrigin | GCClipYOrigin | GCFont; values.graphics_exposures = False; values.fill_style = FillStippled; values.background = sbw->core.background_pixel; values.foreground = sbw->primitive.foreground; values.stipple = _XmGetInsensitiveStippleBitmap((Widget) sbw); sbw->scrollBar.unavailable_GC = XtAllocateGC((Widget) sbw, 0, valueMask, &values, GCClipMask, unusedMask); } /************************************************************************ * * Logic of the scrollbar pixmap management: * ---------------------------------------- * A pixmap the size of the trough area is created each time the * scrollbar changes size. * This pixmap receives the drawing of the slider which is then * copied on the scrollbar window whenever exposure is needed. * GetSliderPixmap: * creates the pixmap and possibly free the current one if present. * the pixmap is free upon destruction of the widget. * the field pixmap == 0 means there is no pixmap to freed. * Is called from Resize method. * DrawSliderPixmap: * draws the slider graphics (sized shadowed rectangle) in the pixmap. * the fields slider_width and height must have been calculated. * Is called from Resize, after the pixmap has been created, * and from SetValues, if something has changed in the visual * of the slider. * RedrawSliderWindow: * clears the current scrollbar slider area, computes the * new position and call CopySliderInWindow. * Is called from SetValues method, from increment actions, and * from ChangeScrollBarValue (from Select, Timer). * CopySliderInWindow: * color slider case and then dump the slider pixmap using * XCopyArea. Called from Redisplay and from Move, where * the more expensive RedrawSliderWindow is not needed. * ************************************************************************/ /************************************************************************ * * GetSliderPixmap * Create the new pixmap for the slider. * This pixmap is the size of the widget minus the arrows. * ************************************************************************/ static void GetSliderPixmap( XmScrollBarWidget sbw ) { if (sbw->scrollBar.pixmap) XFreePixmap (XtDisplay (sbw), sbw->scrollBar.pixmap); sbw->scrollBar.pixmap = XCreatePixmap (XtDisplay(sbw), RootWindowOfScreen(XtScreen(sbw)), sbw->scrollBar.slider_area_width, sbw->scrollBar.slider_area_height, sbw->core.depth); } /************************************************************************ * * DrawSliderPixmap * Draw the slider graphic into the pixmap. * Draw the rectangle with a shadow or not and a mark in * the middle or the side. * ************************************************************************/ static void DrawSliderPixmap( XmScrollBarWidget sbw ) { register int slider_width = sbw->scrollBar.slider_width; register int slider_height = sbw->scrollBar.slider_height; register Drawable slider = sbw->scrollBar.pixmap; if ((sbw->scrollBar.slider_visual == XmFOREGROUND_COLOR) || (sbw->scrollBar.slider_visual == XmTROUGH_COLOR)) { /* we use the same GC, previously filled with either the foreground or the trough_color pixel */ /* The trough area itself has been set, as the window background, to either the trough color (not in that case) or the background pixel */ XSetClipMask(XtDisplay((Widget) sbw), sbw->scrollBar.flat_slider_GC, None); XFillRectangle (XtDisplay ((Widget) sbw), slider, sbw->scrollBar.flat_slider_GC, 0, 0, slider_width, slider_height); } else if ((sbw->scrollBar.slider_visual == XmBACKGROUND_COLOR) || (sbw->scrollBar.slider_visual == XmSHADOWED_BACKGROUND)) { /* in all other case, draw the shadow */ XFillRectangle (XtDisplay ((Widget) sbw), slider, sbw->scrollBar.foreground_GC, 0, 0, slider_width, slider_height); if (sbw->scrollBar.slider_visual == XmSHADOWED_BACKGROUND) XmeDrawShadows (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, 0, 0, slider_width, slider_height, sbw->primitive.shadow_thickness, XmSHADOW_OUT); } if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) { /* in thermo mode, the mark must go on the side of the slider, not in the middle. We do that by modifying slider_width or _height up front and share the same code thereafter */ if (sbw->scrollBar.orientation == XmHORIZONTAL) { if (PROCESS_DIR_INVERSED(sbw)) { slider_width = THERMO_MARK_OFFSET ; } else { slider_width = 2 * slider_width - THERMO_MARK_OFFSET ; } } else { if (PROCESS_DIR_INVERSED(sbw)) { slider_height = THERMO_MARK_OFFSET; } else { slider_height = 2 * slider_height - THERMO_MARK_OFFSET; } } } if (sbw->scrollBar.slider_mark == XmETCHED_LINE) { if (sbw->scrollBar.orientation == XmHORIZONTAL) { XDrawLine (XtDisplay (sbw), slider, sbw->primitive.bottom_shadow_GC, slider_width / 2 - 1, 1, slider_width / 2 - 1, slider_height - 2); XDrawLine (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, slider_width / 2, 1, slider_width / 2, slider_height - 2); } else { XDrawLine (XtDisplay (sbw), slider, sbw->primitive.bottom_shadow_GC, 1, slider_height / 2 - 1, slider_width - 2, slider_height / 2 - 1); XDrawLine (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, 1, slider_height / 2, slider_width - 2, slider_height / 2); } } else if (sbw->scrollBar.slider_mark == XmTHUMB_MARK) { Dimension thumb_spacing = 4, margin = 2 ; if (sbw->scrollBar.orientation == XmHORIZONTAL) { XmeDrawSeparator (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, NULL, slider_width / 2, 0, 2, slider_height, 2, margin, XmVERTICAL, XmSHADOW_ETCHED_OUT); XmeDrawSeparator (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, NULL, slider_width / 2 - thumb_spacing, 0, 2, slider_height, 2, margin, XmVERTICAL, XmSHADOW_ETCHED_OUT); XmeDrawSeparator (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, NULL, slider_width / 2 + thumb_spacing, 0, 2, slider_height, 2, margin, XmVERTICAL, XmSHADOW_ETCHED_OUT); } else { XmeDrawSeparator (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, NULL, 0, slider_height / 2, slider_width, 2, 2, margin, XmHORIZONTAL, XmSHADOW_ETCHED_OUT); XmeDrawSeparator (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, NULL, 0, slider_height / 2 - thumb_spacing, slider_width, 2, 2, margin, XmHORIZONTAL, XmSHADOW_ETCHED_OUT); XmeDrawSeparator (XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, NULL, 0, slider_height / 2 + thumb_spacing, slider_width, 2, 2, margin, XmHORIZONTAL, XmSHADOW_ETCHED_OUT); } } if (sbw->scrollBar.slider_mark == XmROUND_MARK) { Dimension radius = DEFAULT_ROUND_MARK_RADIUS ; XmeDrawCircle(XtDisplay (sbw), slider, sbw->primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, NULL, slider_width / 2 - radius, slider_height / 2 - radius, 2*radius, 2*radius, sbw->primitive.shadow_thickness, 0); } } /************************************************************************ * * CopySliderInWindow * Dump the slider pixmap into the window using CopyArea. * ************************************************************************/ static void CopySliderInWindow( XmScrollBarWidget sbw ) { /* use the pixmap that contains the slider graphics */ if (XtIsRealized((Widget)sbw) && sbw->scrollBar.pixmap) { XCopyArea (XtDisplay ((Widget) sbw), sbw->scrollBar.pixmap, XtWindow ((Widget) sbw), sbw->scrollBar.foreground_GC, 0, 0, sbw->scrollBar.slider_width, sbw->scrollBar.slider_height, sbw->scrollBar.slider_x, sbw->scrollBar.slider_y); } } /************************************************************************ * * RedrawSliderWindow * Clear the trough area at the current slider position, * recompute the slider coordinates and redraw the slider the window by * copying from the pixmap graphics. * ************************************************************************/ static void RedrawSliderWindow( XmScrollBarWidget sbw ) { short old_slider_width = sbw->scrollBar.slider_width ; short old_slider_height = sbw->scrollBar.slider_height ; if (XtIsRealized((Widget)sbw)) XClearArea(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw), (int) sbw->scrollBar.slider_area_x, (int) sbw->scrollBar.slider_area_y, (unsigned int) sbw->scrollBar.slider_area_width, (unsigned int) sbw->scrollBar.slider_area_height, (Bool) FALSE); CalcSliderRect(sbw, &(sbw->scrollBar.slider_x), &(sbw->scrollBar.slider_y), &(sbw->scrollBar.slider_width), &(sbw->scrollBar.slider_height)); if ((old_slider_width != sbw->scrollBar.slider_width) || (old_slider_height != sbw->scrollBar.slider_height)) DrawSliderPixmap(sbw); CopySliderInWindow(sbw); } /************************************************************************ * * CalcSliderRect * Calculate the slider location and size in pixels so that * it can be drawn. Note that number and location of pixels * is always positive, so no special case rounding is needed. * DD: better be a CalcSliderPosition and CalcSliderSize, since * this routine is often use for one _or_ the other case. * ************************************************************************/ static void CalcSliderRect( XmScrollBarWidget sbw, short *slider_x, short *slider_y, short *slider_width, short *slider_height ) { float range; float trueSize; float factor; float slideSize; int minSliderWidth; int minSliderHeight; int hitTheWall = 0; int value ; /* Set up */ if (sbw->scrollBar.orientation == XmHORIZONTAL) { trueSize = sbw->scrollBar.slider_area_width; minSliderWidth = MIN_SLIDER_LENGTH; if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) minSliderWidth = 1; minSliderHeight = MIN_SLIDER_THICKNESS; } else /* orientation == XmVERTICAL */ { trueSize = sbw->scrollBar.slider_area_height; minSliderWidth = MIN_SLIDER_THICKNESS; minSliderHeight = MIN_SLIDER_LENGTH; if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) minSliderHeight = 1; } /* Total number of user units displayed */ range = sbw->scrollBar.maximum - sbw->scrollBar.minimum; /* A naive notion of pixels per user unit */ factor = trueSize / range; if (PROCESS_DIR_INVERSED(sbw)) value = INVERSED_VALUE(sbw); else value = sbw->scrollBar.value ; /* A naive notion of the size of the slider in pixels */ /* in thermo, slider_size is 0 ans is ignored */ if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) slideSize = (float) value * factor; else slideSize = (float) (sbw->scrollBar.slider_size) * factor; /* NOTE SIDE EFFECT */ #define MAX_SCROLLBAR_DIMENSION(val, min)\ ((val) > (min)) ? (val) : (hitTheWall = min) /* Don't let the slider get too small */ if (sbw->scrollBar.orientation == XmHORIZONTAL) { *slider_width = MAX_SCROLLBAR_DIMENSION( (int) (slideSize + 0.5), minSliderWidth); *slider_height = MAX(sbw->scrollBar.slider_area_height, minSliderHeight); } else /* orientation == XmVERTICAL */ { *slider_width = MAX(sbw->scrollBar.slider_area_width, minSliderWidth); *slider_height = MAX_SCROLLBAR_DIMENSION((int) (slideSize + 0.5), minSliderHeight); } if (hitTheWall) { /* * The slider has not been allowed to take on its true * proportionate size (it would have been too small). This * breaks proportionality of the slider and the conversion * between pixels and user units. * * The factor needs to be tweaked in this case. */ trueSize -= hitTheWall; /* actual pixels available */ range -= sbw->scrollBar.slider_size; /* actual range */ if (range == 0) range = 1; factor = trueSize / range; } if (sbw->scrollBar.orientation == XmHORIZONTAL) { /* Many parentheses to explicitly control type conversion. */ if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) { if (PROCESS_DIR_INVERSED(sbw)) { *slider_x = sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width - *slider_width; } else { *slider_x = sbw->scrollBar.slider_area_x; } } else *slider_x = ((int) (((((float) sbw->scrollBar.value) - ((float) sbw->scrollBar.minimum)) * factor) + 0.5)) + sbw->scrollBar.slider_area_x; *slider_y = sbw->scrollBar.slider_area_y ; } else { *slider_x = sbw->scrollBar.slider_area_x; if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) { if (PROCESS_DIR_INVERSED(sbw)) { *slider_y = sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height - *slider_height; } else { *slider_y = sbw->scrollBar.slider_area_y ; } } else *slider_y = ((int) (((((float) sbw->scrollBar.value) - ((float) sbw->scrollBar.minimum)) * factor) + 0.5)) + sbw->scrollBar.slider_area_y; } /* One final adjustment (of questionable value--preserved for visual backward compatibility) */ if ((sbw->scrollBar.orientation == XmHORIZONTAL) && ((*slider_x + *slider_width) > (sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width))) { *slider_x = sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width - *slider_width; } if ((sbw->scrollBar.orientation == XmVERTICAL) && ((*slider_y + *slider_height) > (sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height))) { *slider_y = sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height - *slider_height; } } /************************************************************************ * * Redisplay * General redisplay function called on exposure events. * ************************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; if (sbw->primitive.shadow_thickness > 0) XmeDrawShadows (XtDisplay (sbw), XtWindow (sbw), sbw->primitive.bottom_shadow_GC, sbw->primitive.top_shadow_GC, sbw->primitive.highlight_thickness, sbw->primitive.highlight_thickness, sbw->core.width-2 * sbw->primitive.highlight_thickness, sbw->core.height-2 * sbw->primitive.highlight_thickness, sbw->primitive.shadow_thickness, XmSHADOW_OUT); /* dump the pixmap that contains the slider graphics */ CopySliderInWindow(sbw); if (sbw -> scrollBar.show_arrows) { DRAWARROW(sbw, ((sbw->scrollBar.arrow1_selected)? sbw -> primitive.bottom_shadow_GC: sbw -> primitive.top_shadow_GC), ((sbw->scrollBar.arrow1_selected)? sbw -> primitive.top_shadow_GC : sbw -> primitive.bottom_shadow_GC), sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); DRAWARROW(sbw, ((sbw->scrollBar.arrow2_selected)? sbw -> primitive.bottom_shadow_GC: sbw -> primitive.top_shadow_GC), ((sbw->scrollBar.arrow2_selected)? sbw -> primitive.top_shadow_GC : sbw -> primitive.bottom_shadow_GC), sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); } if (!(XtIsSensitive(wid))) { XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness, sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness, XtWidth(sbw) - (2 * (sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness)), XtHeight(sbw) - (2 * (sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness))); } #ifdef FUNKY_INSENSITIVE_VISUAL else if (sbw->scrollBar.show_arrows) { XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); if (!(sbw->scrollBar.flags & ARROW1_AVAILABLE)) { XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); } if (!(sbw->scrollBar.flags & ARROW2_AVAILABLE)) { XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); } } #endif /* envelop primitive expose method for highlight */ { XtExposeProc expose; _XmProcessLock(); expose = xmPrimitiveClassRec.core_class.expose; _XmProcessUnlock(); (*(expose))(wid, event, region) ; } } /************************************************************************ * * Resize * Process resizes on the widget by destroying and recreating the * slider pixmap. * Also draw the correct sized slider onto this pixmap. * ************************************************************************/ static void Resize( Widget wid ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; register int ht = sbw->primitive.highlight_thickness; register int st = sbw->primitive.shadow_thickness; #define CHECK(x) if (x <= 0) x = 1 #define BOTH_ARROWS_NEAR_SIDE(sbw) \ (((sbw->scrollBar.show_arrows == XmMIN_SIDE) &&\ !PROCESS_DIR_INVERSED(sbw)) ||\ ((sbw->scrollBar.show_arrows == XmMAX_SIDE) &&\ PROCESS_DIR_INVERSED(sbw))) #define BOTH_ARROWS_FAR_SIDE(sbw) \ (((sbw->scrollBar.show_arrows == XmMIN_SIDE) &&\ PROCESS_DIR_INVERSED(sbw)) ||\ ((sbw->scrollBar.show_arrows == XmMAX_SIDE) &&\ !PROCESS_DIR_INVERSED(sbw))) #define ARROW1_NEAR_SIDE(sbw) \ ( (sbw->scrollBar.show_arrows == XmEACH_SIDE) ||\ BOTH_ARROWS_NEAR_SIDE (sbw) ) #define ARROW2_FAR_SIDE(sbw) \ ((sbw->scrollBar.show_arrows == XmEACH_SIDE) ||\ BOTH_ARROWS_FAR_SIDE (sbw) ) /* Calculate all of the internal data for slider */ if (sbw->scrollBar.show_arrows) { if (sbw->scrollBar.orientation == XmHORIZONTAL) { sbw->scrollBar.arrow1_orientation = XmARROW_LEFT; sbw->scrollBar.arrow2_orientation = XmARROW_RIGHT; /* left arrow position and size */ sbw->scrollBar.arrow1_y = ht + st; sbw->scrollBar.arrow_width = sbw->scrollBar.arrow_height = sbw->core.height - 2 * (ht + st); if (ARROW1_NEAR_SIDE (sbw)) { sbw->scrollBar.arrow1_x = ht + st; } else { sbw->scrollBar.arrow1_x = sbw->core.width -ht -st - 2 * sbw->scrollBar.arrow_width; } if (sbw->core.width < 2 * (sbw->scrollBar.arrow_width + ht + st) + MIN_SLIDER_LENGTH + 2) sbw->scrollBar.arrow_width = (sbw->core.width - (MIN_SLIDER_LENGTH + 2 + 2 * (ht + st))) / 2; /* slide area position and size */ if (sbw->scrollBar.show_arrows == XmEACH_SIDE) { sbw->scrollBar.slider_area_x = ht + st + sbw->scrollBar.arrow_width + 1; } else if (BOTH_ARROWS_NEAR_SIDE (sbw)) { sbw->scrollBar.slider_area_x = ht + st + 2 * sbw->scrollBar.arrow_width + 2; } else { sbw->scrollBar.slider_area_x = ht + st ; } sbw->scrollBar.slider_area_width = sbw->core.width - 2 * (ht + st + sbw->scrollBar.arrow_width + 1); if ((2*(ht+st)) > XtHeight(sbw)) sbw->scrollBar.slider_area_y = XtHeight(sbw) / 2; else sbw->scrollBar.slider_area_y = ht + st; sbw->scrollBar.slider_area_height = sbw->core.height - 2 * (ht + st); /* right arrow position */ if (ARROW2_FAR_SIDE(sbw)) { sbw->scrollBar.arrow2_x = ht + st + sbw->scrollBar.arrow_width + 1 + sbw->scrollBar.slider_area_width + 1; } else { sbw->scrollBar.arrow2_x = ht + st + sbw->scrollBar.arrow_width ; } sbw->scrollBar.arrow2_y = ht + st; } else { /* VERTICAL */ sbw->scrollBar.arrow1_orientation = XmARROW_UP; sbw->scrollBar.arrow2_orientation = XmARROW_DOWN; /* top arrow position and size */ sbw->scrollBar.arrow1_x = ht + st; sbw->scrollBar.arrow_width = sbw->scrollBar.arrow_height = sbw->core.width - 2 * (ht + st); if (ARROW1_NEAR_SIDE(sbw)) { sbw->scrollBar.arrow1_y = ht + st; } else { sbw->scrollBar.arrow1_y = sbw->core.height -ht -st - 2 * sbw->scrollBar.arrow_height; } if (sbw->core.height < 2 * (sbw->scrollBar.arrow_height + ht + st) + MIN_SLIDER_LENGTH +2) sbw->scrollBar.arrow_height = (sbw->core.height - (MIN_SLIDER_LENGTH + 2 + 2 * (ht + st))) / 2; /* slide area position and size */ if (sbw->scrollBar.show_arrows == XmEACH_SIDE) { sbw->scrollBar.slider_area_y = ht + st + sbw->scrollBar.arrow_height + 1; } else if (BOTH_ARROWS_NEAR_SIDE (sbw)) { sbw->scrollBar.slider_area_y = ht + st + 2 * sbw->scrollBar.arrow_height + 2 ; } else { sbw->scrollBar.slider_area_y = ht + st ; } sbw->scrollBar.slider_area_height = sbw->core.height - 2 * (ht + st + sbw->scrollBar.arrow_height +1); if ((2*(st+ht)) > XtWidth(sbw)) sbw->scrollBar.slider_area_x = XtWidth(sbw) / 2; else sbw->scrollBar.slider_area_x = ht + st; sbw->scrollBar.slider_area_width = sbw->core.width - 2 * (ht + st); /* down arrow position */ if (ARROW2_FAR_SIDE(sbw)) { sbw->scrollBar.arrow2_y = ht + st + sbw->scrollBar.arrow_height + 1 + sbw->scrollBar.slider_area_height + 1; } else { sbw->scrollBar.arrow2_y = ht + st + sbw->scrollBar.arrow_height ; } sbw->scrollBar.arrow2_x = ht + st; } CHECK(sbw->scrollBar.arrow_height); CHECK(sbw->scrollBar.arrow_width); } else { sbw->scrollBar.arrow_width = 0; sbw->scrollBar.arrow_height = 0; if (sbw->scrollBar.orientation == XmHORIZONTAL) { /* slide area position and size */ sbw->scrollBar.slider_area_x = ht + st; sbw->scrollBar.slider_area_width = sbw->core.width - 2 * (ht + st); if ((2*(ht+st)) > XtHeight(sbw)) sbw->scrollBar.slider_area_y = XtHeight(sbw) / 2; else sbw->scrollBar.slider_area_y = ht + st; sbw->scrollBar.slider_area_height = sbw->core.height - 2 * (ht + st); } else { /* slide area position and size */ sbw->scrollBar.slider_area_y = ht + st; sbw->scrollBar.slider_area_height = sbw->core.height - 2 * (ht + st); if ((2*(st+ht)) > XtWidth(sbw)) sbw->scrollBar.slider_area_x = XtWidth(sbw) / 2; else sbw->scrollBar.slider_area_x = ht + st; sbw->scrollBar.slider_area_width = sbw->core.width - 2 * (ht + st); } } CHECK(sbw->scrollBar.slider_area_height); CHECK(sbw->scrollBar.slider_area_width); GetSliderPixmap (sbw); /* the size of the scrollbar window - arrows */ CalcSliderRect(sbw, &(sbw->scrollBar.slider_x), &(sbw->scrollBar.slider_y), &(sbw->scrollBar.slider_width), &(sbw->scrollBar.slider_height)); DrawSliderPixmap (sbw); } /********************************************************************* * * Realize * ********************************************************************/ static void Realize( Widget wid, XtValueMask *window_mask, XSetWindowAttributes *window_attributes ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; *window_mask |= CWBitGravity; window_attributes->bit_gravity = ForgetGravity; /* if we are in the slider color = trough color case, we need to get the regular background as the trough (= window) color, otherwise, we need to get the trough color */ if (sbw->scrollBar.slider_visual != XmTROUGH_COLOR) { *window_mask |= CWBackPixel ; window_attributes->background_pixel = sbw->scrollBar.trough_color; } XtCreateWindow (wid, InputOutput, CopyFromParent, *window_mask, window_attributes); } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget wid ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; XtReleaseGC ((Widget) sbw, sbw->scrollBar.foreground_GC); XtReleaseGC ((Widget) sbw, sbw->scrollBar.unavailable_GC); XtReleaseGC ((Widget) sbw, sbw->scrollBar.flat_slider_GC); if (sbw->scrollBar.pixmap != 0) XFreePixmap (XtDisplay (sbw), sbw->scrollBar.pixmap); if (sbw->scrollBar.timer != 0) { XtRemoveTimeOut (sbw->scrollBar.timer); sbw->scrollBar.timer = 0; } } /************************************************************************ * * ValidateInputs * ************************************************************************/ /*ARGSUSED*/ static Boolean ValidateInputs( XmScrollBarWidget current, XmScrollBarWidget request, /* unused */ XmScrollBarWidget new_w ) { Boolean returnFlag = TRUE; int value ; /* Validate the incoming data */ if (new_w->scrollBar.minimum >= new_w->scrollBar.maximum) { new_w->scrollBar.minimum = current->scrollBar.minimum; new_w->scrollBar.maximum = current->scrollBar.maximum; XmeWarning( (Widget) new_w, MESSAGE1); returnFlag = FALSE; } if (new_w->scrollBar.sliding_mode != current->scrollBar.sliding_mode) { if (new_w->scrollBar.sliding_mode != XmTHERMOMETER) { new_w->scrollBar.slider_size = (new_w->scrollBar.maximum - new_w->scrollBar.minimum) / 10; if (new_w->scrollBar.slider_size < 1) new_w->scrollBar.slider_size = 1; } else new_w->scrollBar.slider_size = 0 ; } if (new_w->scrollBar.sliding_mode != XmTHERMOMETER) { if (new_w->scrollBar.slider_size < 1) { if ((new_w->scrollBar.maximum - new_w->scrollBar.minimum) < current->scrollBar.slider_size) new_w->scrollBar.slider_size = new_w->scrollBar.maximum - new_w->scrollBar.minimum; else new_w->scrollBar.slider_size = current->scrollBar.slider_size; XmeWarning( (Widget) new_w, MESSAGE2); returnFlag = FALSE; } if ((new_w->scrollBar.slider_size > new_w->scrollBar.maximum - new_w->scrollBar.minimum)) { if ((new_w->scrollBar.maximum - new_w->scrollBar.minimum) < current->scrollBar.slider_size) new_w->scrollBar.slider_size = new_w->scrollBar.maximum - new_w->scrollBar.minimum; else new_w->scrollBar.slider_size = current->scrollBar.slider_size; XmeWarning( (Widget) new_w, MESSAGE13); returnFlag = FALSE; } } else new_w->scrollBar.slider_size = 0 ; if (new_w->scrollBar.value < new_w->scrollBar.minimum) { new_w->scrollBar.value = new_w->scrollBar.minimum; XmeWarning( (Widget) new_w, MESSAGE3); returnFlag = FALSE; } /* do the checking on the real user value */ if (new_w->scrollBar.value == current->scrollBar.value) { if (PROCESS_DIR_INVERSED(new_w)) /* use new for value since that's the one getting changed below */ #ifdef FIX_1396 value = INVERSED_VALUE(new_w); #else value = INVERSED_VALUE(current); #endif else value = new_w->scrollBar.value ; } else value = new_w->scrollBar.value ; if (value > new_w->scrollBar.maximum - new_w->scrollBar.slider_size) { new_w->scrollBar.value = new_w->scrollBar.maximum - new_w->scrollBar.slider_size; new_w->scrollBar.flags |= VALUE_SET_FLAG; XmeWarning( (Widget) new_w, MESSAGE4); } if( !XmRepTypeValidValue( XmRID_ORIENTATION, new_w->scrollBar.orientation, (Widget) new_w)) { new_w->scrollBar.orientation = current->scrollBar.orientation; returnFlag = FALSE; } if (new_w->scrollBar.orientation == XmHORIZONTAL) { if ((new_w->scrollBar.processing_direction != XmMAX_ON_LEFT) && (new_w->scrollBar.processing_direction != XmMAX_ON_RIGHT)) { new_w->scrollBar.processing_direction = current->scrollBar.processing_direction; XmeWarning( (Widget) new_w, MESSAGE6); returnFlag = FALSE; } } else /* new_w->scrollBar.orientation == XmVERTICAL */ { if ((new_w->scrollBar.processing_direction != XmMAX_ON_TOP) && (new_w->scrollBar.processing_direction != XmMAX_ON_BOTTOM)) { new_w->scrollBar.processing_direction = current->scrollBar.processing_direction; XmeWarning( (Widget) new_w, MESSAGE6); returnFlag = FALSE; } } if (new_w->scrollBar.increment <= 0) { new_w->scrollBar.increment = current->scrollBar.increment; XmeWarning( (Widget) new_w, MESSAGE7); returnFlag = FALSE; } if (new_w->scrollBar.page_increment <= 0) { new_w->scrollBar.page_increment = current->scrollBar.page_increment; XmeWarning( (Widget) new_w, MESSAGE8); returnFlag = FALSE; } if (new_w->scrollBar.initial_delay <= 0) { new_w->scrollBar.initial_delay = current->scrollBar.initial_delay; XmeWarning( (Widget) new_w, MESSAGE9); returnFlag = FALSE; } if (new_w->scrollBar.repeat_delay <= 0) { new_w->scrollBar.repeat_delay = current->scrollBar.repeat_delay; XmeWarning( (Widget) new_w, MESSAGE10); returnFlag = FALSE; } if (new_w->core.width == 0) { if (new_w->scrollBar.orientation == XmHORIZONTAL) new_w->core.width += 100; else new_w->core.width += 11; } if (new_w->core.height == 0) { if (new_w->scrollBar.orientation == XmHORIZONTAL) new_w->core.height += 11; else new_w->core.height += 100; } return(returnFlag); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmScrollBarWidget current = (XmScrollBarWidget) cw ; XmScrollBarWidget request = (XmScrollBarWidget) rw ; XmScrollBarWidget new_w = (XmScrollBarWidget) nw ; Boolean returnFlag = FALSE; Boolean current_backwards = PROCESS_DIR_INVERSED(current); Boolean new_backwards = PROCESS_DIR_INVERSED(new_w); if(!XmRepTypeValidValue( XmRID_SHOW_ARROWS, new_w->scrollBar.show_arrows, (Widget) new_w) ) { new_w->scrollBar.show_arrows = current->scrollBar.sliding_mode; } if(!XmRepTypeValidValue( XmRID_SLIDING_MODE, new_w->scrollBar.sliding_mode, (Widget) new_w) ) { new_w->scrollBar.sliding_mode = current->scrollBar.sliding_mode; } if(!XmRepTypeValidValue( XmRID_SLIDER_VISUAL, new_w->scrollBar.slider_visual, (Widget) new_w) ) { new_w->scrollBar.slider_visual = current->scrollBar.slider_visual; } if(!XmRepTypeValidValue( XmRID_SLIDER_MARK, new_w->scrollBar.slider_mark, (Widget) new_w) ) { new_w->scrollBar.slider_mark = current->scrollBar.slider_mark; } if (new_w->scrollBar.orientation == XmHORIZONTAL) { if (new_w->scrollBar.processing_direction == XmMAX_ON_LEFT && !(new_w->scrollBar.flags & VALUE_SET_FLAG) && ((new_w->scrollBar.slider_size != current->scrollBar.slider_size) || (new_w->scrollBar.maximum != current->scrollBar.maximum) || (new_w->scrollBar.minimum != current->scrollBar.minimum) )) { new_w->scrollBar.value = (new_w->scrollBar.maximum + new_w->scrollBar.minimum - new_w->scrollBar.slider_size) - INVERSED_VALUE(current); new_backwards = FALSE; current_backwards = FALSE; } } /* Make sure that processing direction tracks orientation */ if ((new_w->scrollBar.orientation != current->scrollBar.orientation) && (new_w->scrollBar.processing_direction == current->scrollBar.processing_direction)) { if ((new_w->scrollBar.orientation == XmHORIZONTAL) && (current->scrollBar.processing_direction == XmMAX_ON_TOP)) new_w->scrollBar.processing_direction = XmMAX_ON_LEFT; else if ((new_w->scrollBar.orientation == XmHORIZONTAL) && (current->scrollBar.processing_direction == XmMAX_ON_BOTTOM)) new_w->scrollBar.processing_direction = XmMAX_ON_RIGHT; else if ((new_w->scrollBar.orientation == XmVERTICAL) && (current->scrollBar.processing_direction == XmMAX_ON_LEFT)) new_w->scrollBar.processing_direction = XmMAX_ON_TOP; else if ((new_w->scrollBar.orientation == XmVERTICAL) && (current->scrollBar.processing_direction == XmMAX_ON_RIGHT)) new_w->scrollBar.processing_direction = XmMAX_ON_BOTTOM; } while (!ValidateInputs(current, request, new_w)) /*EMPTY*/; /* * Because someone somewhere originally thought that it was clever * for the scrollbar widget to do all of its internal processing in * just one direction, all of the interface procedures have to go * through extreme gymnastics to support reversal. */ if ((new_backwards && !current_backwards) || (!new_backwards && current_backwards)) { if (new_w->scrollBar.flags & VALUE_SET_FLAG) { if (new_backwards) new_w->scrollBar.value = INVERSED_VALUE(new_w); } else { new_w->scrollBar.value = INVERSED_VALUE(new_w); } } else { if ((new_w->scrollBar.flags & VALUE_SET_FLAG) && (new_backwards)) new_w->scrollBar.value = INVERSED_VALUE(new_w); } if (new_w->scrollBar.flags & VALUE_SET_FLAG) new_w->scrollBar.flags &= ~VALUE_SET_FLAG; /* See if the GC needs to be regenerated */ if (new_w->core.background_pixel != current->core.background_pixel) { XtReleaseGC((Widget) new_w, new_w->scrollBar.foreground_GC); GetForegroundGC(new_w); } if (((new_w->scrollBar.slider_visual == XmTROUGH_COLOR) && (new_w->scrollBar.trough_color != current->scrollBar.trough_color)) || ((new_w->scrollBar.slider_visual == XmFOREGROUND_COLOR) && (new_w->primitive.foreground != current->primitive.foreground))) { XtReleaseGC((Widget) new_w, new_w->scrollBar.flat_slider_GC); GetFlatSliderGC(new_w); } /* * See if the trough (a.k.a the window background) needs to be * changed to use a different pixel. */ if (XtIsRealized(nw)) { Pixel change_to = XmUNSPECIFIED_PIXEL ; /* slider_visual == XmTROUGH_COLOR is the case where the window background is the real core.background_pixel, all the other use the trough_color as the window background */ if ((new_w->scrollBar.slider_visual == XmTROUGH_COLOR) && (current->scrollBar.slider_visual != XmTROUGH_COLOR)) { /* no need to care for background change since Core did it */ change_to = new_w->core.background_pixel; } if ((new_w->scrollBar.slider_visual != XmTROUGH_COLOR) && ((current->scrollBar.slider_visual == XmTROUGH_COLOR) || (new_w->scrollBar.trough_color != current->scrollBar.trough_color) || /* if the background had changed, Core has certainly reset the window background already, so we need to undo that */ (new_w->core.background_pixel != current->core.background_pixel))) { change_to = new_w->scrollBar.trough_color ; } if (change_to != XmUNSPECIFIED_PIXEL) { returnFlag = TRUE; XtReleaseGC((Widget) new_w, new_w->scrollBar.flat_slider_GC); GetFlatSliderGC(new_w); XSetWindowBackground(XtDisplay((Widget)new_w), XtWindow((Widget)new_w), change_to); } } /* * See if the widget needs to be redrawn. Minimize the amount * of redraw by having specific checks. */ if ((new_w->scrollBar.orientation != current->scrollBar.orientation) || (new_w->primitive.shadow_thickness != current->primitive.shadow_thickness) || (new_w->primitive.highlight_thickness != current->primitive.highlight_thickness) || (new_w->scrollBar.show_arrows != current->scrollBar.show_arrows)) { /* call Resize method, that will have the effect of recomputing all the internal variables (arrow size, trough are) and recreating the slider pixmap. */ XtWidgetProc resize; _XmProcessLock(); resize = new_w->core.widget_class->core_class.resize; _XmProcessUnlock(); (* (resize)) ((Widget) new_w); returnFlag = TRUE; } if ((new_w->primitive.foreground != current->primitive.foreground) || (new_w->core.background_pixel != current->core.background_pixel) || (new_w->primitive.top_shadow_color != current->primitive.top_shadow_color) || (new_w->scrollBar.slider_visual != current->scrollBar.slider_visual) || (new_w->scrollBar.slider_mark != current->scrollBar.slider_mark) || (new_w->scrollBar.trough_color != current->scrollBar.trough_color) || (new_w->primitive.bottom_shadow_color != current->primitive.bottom_shadow_color)) { returnFlag = TRUE; /* only draw the slider graphics, no need to change the pixmap (call to GetSliderPixmap) nor the slider size (call to CalcSliderRect). */ DrawSliderPixmap(new_w); } if ((new_w->scrollBar.slider_size != current->scrollBar.slider_size) || (new_w->scrollBar.minimum != current->scrollBar.minimum) || (new_w->scrollBar.maximum != current->scrollBar.maximum) || (new_w->scrollBar.processing_direction != current->scrollBar.processing_direction)) { /* have to clear the current slider before setting the new slider position and size */ if (XtIsRealized(nw)) XClearArea(XtDisplay((Widget)new_w), XtWindow((Widget)new_w), new_w->scrollBar.slider_x, new_w->scrollBar.slider_y, new_w->scrollBar.slider_width, new_w->scrollBar.slider_height, False); /* recompute the slider size and draw in the pixmap */ CalcSliderRect(new_w, &(new_w->scrollBar.slider_x), &(new_w->scrollBar.slider_y), &(new_w->scrollBar.slider_width), &(new_w->scrollBar.slider_height)); /* redraw the slider in the pixmap */ DrawSliderPixmap (new_w); if (new_w->scrollBar.slider_size >= (new_w->scrollBar.maximum - new_w->scrollBar.minimum)) { new_w->scrollBar.flags &= ~SLIDER_AVAILABLE; /* * Disabling the slider enables the arrows. This * leaves the scrollbar in a state amenable to reenabling * the slider. */ new_w->scrollBar.flags |= ARROW1_AVAILABLE; new_w->scrollBar.flags |= ARROW2_AVAILABLE; returnFlag = TRUE; } else { if (! (new_w->scrollBar.flags & SLIDER_AVAILABLE)) { returnFlag = TRUE; new_w->scrollBar.flags |= SLIDER_AVAILABLE; } else { /* directly use the pixmap that contains the slider graphics, no need to call RedrawSliderWindow since the cleararea and the calcrect have already been made */ CopySliderInWindow(new_w); } } } if (new_w->scrollBar.value != current->scrollBar.value) { /* the value has changed, the slider needs to move. */ RedrawSliderWindow (new_w); if (XtIsRealized(nw)) { /* Following lines taken from Redisplay code; the XmNvalue can change ** even when the widget is insensitive. Other paths through the code ** involve user interaction and so sensitivity doesn't need to be ** considered. ** NOTE! doesn't deal with FUNKY_INSENSITIVE_VISUAL */ if (!(XtIsSensitive((Widget)new_w))) { XmScrollBarWidget sbw = (XmScrollBarWidget) new_w; XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness, sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness, XtWidth(sbw) - (2 * (sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness)), XtHeight(sbw) - (2 * (sbw->primitive.highlight_thickness + sbw->primitive.shadow_thickness))); } } } if (XtIsSensitive(nw) != XtIsSensitive(cw)) returnFlag = TRUE; return(returnFlag); } /************************************************************************ * * CalcSliderVal * Calculate the slider val in application coordinates given * the input x and y. * ************************************************************************/ static int CalcSliderVal( XmScrollBarWidget sbw, int x, int y ) { float range; float trueSize; /* size of slider area in pixels */ float referencePoint; /* origin of slider */ float proportion; int int_proportion; int slider_area_origin; if (sbw->scrollBar.orientation == XmHORIZONTAL) { referencePoint = (float) x - sbw->scrollBar.separation_x; trueSize = sbw->scrollBar.slider_area_width; if (sbw->scrollBar.sliding_mode != XmTHERMOMETER) trueSize -= sbw->scrollBar.slider_width; slider_area_origin = sbw->scrollBar.slider_area_x; } else { referencePoint = (float) y - sbw->scrollBar.separation_y; trueSize = sbw->scrollBar.slider_area_height; if (sbw->scrollBar.sliding_mode != XmTHERMOMETER) trueSize -= sbw->scrollBar.slider_height; slider_area_origin = sbw->scrollBar.slider_area_y; } if (trueSize > 0) /* figure the proportion of slider area between the origin of the slider area and the origin of the slider. */ proportion = (referencePoint - slider_area_origin + (((sbw->scrollBar.show_arrows == XmEACH_SIDE) && (sbw->scrollBar.sliding_mode != XmTHERMOMETER))?1:0)) / trueSize; else /* * We've got an interesting problem here. There isn't any * slider area available to slide in. What should the value * of the scrollbar be when the user tries to drag the slider? * * Setting proportion to 1 snaps to maximum. Setting * proportion to the reciprocal of "range" will cause the * slider to snap to the minimum. * */ proportion = 1; /* Actual range displayed */ range = sbw->scrollBar.maximum - sbw->scrollBar.minimum - sbw->scrollBar.slider_size; /* Now scale the proportion in pixels to user units */ proportion = (proportion * range) + ((float) sbw->scrollBar.minimum); /* Round off appropriately */ if (proportion > 0) proportion += 0.5; else if (proportion < 0) proportion -= 0.5; int_proportion = (int) proportion; if (int_proportion < sbw->scrollBar.minimum) int_proportion = sbw->scrollBar.minimum; else if (int_proportion > (sbw->scrollBar.maximum - sbw->scrollBar.slider_size)) int_proportion = sbw->scrollBar.maximum - sbw->scrollBar.slider_size; return (int_proportion); } /************************************************************************ * * Select * This function processes selections occuring on the scrollBar. * ************************************************************************/ static void Select( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; XButtonPressedEvent *buttonEvent = (XButtonPressedEvent *) event ; int slider_x = sbw->scrollBar.slider_x; int slider_y = sbw->scrollBar.slider_y; int slider_width = sbw->scrollBar.slider_width; int slider_height = sbw->scrollBar.slider_height; Boolean slider_moved; if (!sbw->scrollBar.editable) return ; /* add a start update when the button is pressed so that scrollbar moves generating widget configurations be bracketed for dropsite update. The endupdate is done in Release */ XmDropSiteStartUpdate(wid); sbw->scrollBar.flags &= ~OPERATION_CANCELLED ; #ifndef DEBUG_NO_SB_GRAB if (XtGrabKeyboard(wid, False, GrabModeAsync, GrabModeAsync, buttonEvent->time) == GrabSuccess) sbw->scrollBar.flags |= KEYBOARD_GRABBED; #endif XAllowEvents(XtDisplay(wid), AsyncPointer, CurrentTime); XAllowEvents(XtDisplay(wid), AsyncKeyboard, CurrentTime); if (!(sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; if ((buttonEvent->button == Button1) && (!XmIsScrolledWindow(XtParent(wid)))) (void) XmProcessTraversal( (Widget) sbw, XmTRAVERSE_CURRENT); sbw->scrollBar.separation_x = 0; sbw->scrollBar.separation_y = 0; if ((sbw->scrollBar.orientation == XmHORIZONTAL) && (buttonEvent->y >= slider_y) && (buttonEvent->y <= slider_y + slider_height) && (buttonEvent->button == Button1) && (sbw->scrollBar.sliding_mode == XmTHERMOMETER) && (((PROCESS_DIR_INVERSED(sbw)) && (buttonEvent->x >= slider_x) && (buttonEvent->x <= slider_x + THERMO_MARK_OFFSET)) || (!PROCESS_DIR_INVERSED(sbw) && (buttonEvent->x <= slider_x + slider_width) && (buttonEvent->x >= slider_x + slider_width - THERMO_MARK_OFFSET)))) /* hack */ buttonEvent->button = Button2 ; if ((sbw->scrollBar.orientation == XmVERTICAL) && (buttonEvent->x >= slider_x) && (buttonEvent->x <= slider_x + slider_width) && (buttonEvent->button == Button1) && (sbw->scrollBar.sliding_mode == XmTHERMOMETER) && (((PROCESS_DIR_INVERSED(sbw)) && (buttonEvent->y >= slider_y) && (buttonEvent->y <= slider_y + THERMO_MARK_OFFSET)) || (!PROCESS_DIR_INVERSED(sbw) && (buttonEvent->y >= slider_y + slider_height - THERMO_MARK_OFFSET) && (buttonEvent->y <= slider_y + slider_height)))) /* hack */ buttonEvent->button = Button2 ; /* Calculate whether the selection point is in the slider */ if ((buttonEvent->x >= slider_x) && (buttonEvent->x <= slider_x + slider_width) && (buttonEvent->y >= slider_y) && (buttonEvent->y <= slider_y + slider_height) && ((buttonEvent->button != Button1) || (sbw->scrollBar.sliding_mode != XmTHERMOMETER))) { sbw->scrollBar.initial_x = slider_x; sbw->scrollBar.initial_y = slider_y; sbw->scrollBar.sliding_on = True; sbw->scrollBar.saved_value = sbw->scrollBar.value; sbw->scrollBar.arrow1_selected = FALSE; sbw->scrollBar.arrow2_selected = FALSE; if ((buttonEvent->button == Button1) && (sbw->scrollBar.sliding_mode != XmTHERMOMETER)) { sbw->scrollBar.separation_x = buttonEvent->x - slider_x; sbw->scrollBar.separation_y = buttonEvent->y - slider_y; } else if (buttonEvent->button == Button2) { /* Warp the slider to the cursor, and then drag */ if (sbw->scrollBar.sliding_mode != XmTHERMOMETER) { if (sbw->scrollBar.orientation == XmHORIZONTAL) sbw->scrollBar.separation_x = sbw->scrollBar.slider_width / 2; else sbw->scrollBar.separation_y = sbw->scrollBar.slider_height / 2; } else { sbw->scrollBar.separation_x = 0 ; sbw->scrollBar.separation_y = 0 ; } Moved ((Widget) sbw, (XEvent *) buttonEvent, params, num_params); } return; } /* ... in the trough (i.e. slider area)... */ else if ((buttonEvent->x >= sbw->scrollBar.slider_area_x) && (buttonEvent->y >= sbw->scrollBar.slider_area_y) && (buttonEvent->x <= sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width) && (buttonEvent->y <= sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height)) { sbw->scrollBar.arrow1_selected = FALSE; sbw->scrollBar.arrow2_selected = FALSE; sbw->scrollBar.saved_value = sbw->scrollBar.value; if (buttonEvent->button == Button1) { Position limit_x, limit_y ; /* Page the slider up or down */ /* what is up or down depends on the processing direction... */ limit_x = sbw->scrollBar.slider_x ; limit_y = sbw->scrollBar.slider_y ; if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) { if (PROCESS_DIR_INVERSED(sbw)) { limit_x = sbw->scrollBar.slider_area_width - sbw->scrollBar.slider_width ; limit_y = sbw->scrollBar.slider_area_height - sbw->scrollBar.slider_height ; } else { limit_x = sbw->scrollBar.slider_width ; limit_y = sbw->scrollBar.slider_height ; } } if (sbw->scrollBar.orientation == XmHORIZONTAL) { if (buttonEvent->x < limit_x) sbw->scrollBar.change_type = XmCR_PAGE_DECREMENT; else sbw->scrollBar.change_type = XmCR_PAGE_INCREMENT; } else { if (buttonEvent->y < limit_y) sbw->scrollBar.change_type = XmCR_PAGE_DECREMENT; else sbw->scrollBar.change_type = XmCR_PAGE_INCREMENT; } slider_moved = ChangeScrollBarValue(sbw); } else /* Button2 */ { /* Warp the slider to the cursor, and then drag */ if (sbw->scrollBar.sliding_mode != XmTHERMOMETER) { if (sbw->scrollBar.orientation == XmHORIZONTAL) sbw->scrollBar.separation_x = sbw->scrollBar.slider_width / 2; else sbw->scrollBar.separation_y = sbw->scrollBar.slider_height / 2; } else { sbw->scrollBar.separation_x = 0 ; sbw->scrollBar.separation_y = 0 ; } sbw->scrollBar.initial_x = slider_x; sbw->scrollBar.initial_y = slider_y; sbw->scrollBar.sliding_on = True; Moved ((Widget) sbw, (XEvent *) buttonEvent, params, num_params); return; } } /* ... in arrow 1 */ else if ((buttonEvent->x >= sbw->scrollBar.arrow1_x) && (buttonEvent->y >= sbw->scrollBar.arrow1_y) && (buttonEvent->x <= sbw->scrollBar.arrow1_x + sbw->scrollBar.arrow_width) && (buttonEvent->y <= sbw->scrollBar.arrow1_y + sbw->scrollBar.arrow_height)) { sbw->scrollBar.change_type = XmCR_DECREMENT; sbw->scrollBar.saved_value = sbw->scrollBar.value; sbw->scrollBar.arrow1_selected = True; slider_moved = ChangeScrollBarValue(sbw) ; DRAWARROW(sbw, sbw->primitive.bottom_shadow_GC, sbw -> primitive.top_shadow_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); } /* ... in arrow 2 */ else if ((buttonEvent->x >= sbw->scrollBar.arrow2_x) && (buttonEvent->y >= sbw->scrollBar.arrow2_y) && (buttonEvent->x <= sbw->scrollBar.arrow2_x + sbw->scrollBar.arrow_width) && (buttonEvent->y <= sbw->scrollBar.arrow2_y + sbw->scrollBar.arrow_height)) { sbw->scrollBar.change_type = XmCR_INCREMENT; sbw->scrollBar.saved_value = sbw->scrollBar.value; sbw->scrollBar.arrow2_selected = True; slider_moved = ChangeScrollBarValue(sbw) ; DRAWARROW(sbw, sbw->primitive.bottom_shadow_GC, sbw -> primitive.top_shadow_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); } else /* ... in the highlight area. */ return; if (slider_moved) { ScrollCallback (sbw, sbw->scrollBar.change_type, sbw->scrollBar.value, 0, 0, (XEvent *) buttonEvent); XSync (XtDisplay((Widget)sbw), False); sbw->scrollBar.flags |= FIRST_SCROLL_FLAG ; sbw->scrollBar.flags &= ~END_TIMER; if (!sbw->scrollBar.timer) sbw->scrollBar.timer = XtAppAddTimeOut (XtWidgetToApplicationContext((Widget) sbw), (unsigned long) sbw->scrollBar.initial_delay, TimerEvent, (XtPointer) sbw); } } /************************************************************************ * * Release * This function processes releases occuring on the scrollBar. * ************************************************************************/ /*ARGSUSED*/ static void Release( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; if (!sbw->scrollBar.editable) return ; /* add an end update when the button is released. see comment in Select for the start update */ XmDropSiteEndUpdate(wid); sbw->scrollBar.flags &= ~OPERATION_CANCELLED ; if (sbw->scrollBar.flags & KEYBOARD_GRABBED) { XtUngrabKeyboard(wid, ((XButtonPressedEvent *)event)->time); sbw->scrollBar.flags &= ~KEYBOARD_GRABBED; } #ifdef FUNKY_INSENSITIVE_VISUAL if ( (!(sbw->scrollBar.flags & ARROW1_AVAILABLE)) && (sbw->scrollBar.value > sbw->scrollBar.minimum)) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); sbw->scrollBar.flags |= ARROW1_AVAILABLE; } else if (sbw->scrollBar.value == sbw->scrollBar.minimum) sbw->scrollBar.flags &= ~ARROW1_AVAILABLE; if ( (!(sbw->scrollBar.flags & ARROW2_AVAILABLE)) && (sbw->scrollBar.value < (sbw->scrollBar.maximum - sbw->scrollBar.slider_size))) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw->primitive.top_shadow_GC, sbw -> primitive.bottom_shadow_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); sbw->scrollBar.flags |= ARROW2_AVAILABLE; } else if (sbw->scrollBar.value == (sbw->scrollBar.maximum - sbw->scrollBar.slider_size)) sbw->scrollBar.flags &= ~ARROW2_AVAILABLE; #endif if (sbw->scrollBar.arrow1_selected) { sbw->scrollBar.arrow1_selected = False; DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); } if (sbw->scrollBar.arrow2_selected) { sbw->scrollBar.arrow2_selected = False; DRAWARROW (sbw, sbw->primitive.top_shadow_GC, sbw -> primitive.bottom_shadow_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); } if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; if (sbw->scrollBar.timer != 0) { sbw->scrollBar.flags |= END_TIMER; } if (sbw->scrollBar.sliding_on == True) { sbw->scrollBar.sliding_on = False; ScrollCallback (sbw, XmCR_VALUE_CHANGED, sbw->scrollBar.value, event->xbutton.x, event->xbutton.y, event); } #ifdef FUNKY_INSENSITIVE_VISUAL XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); if (! (sbw->scrollBar.flags & ARROW1_AVAILABLE)) { XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); } else if (! (sbw->scrollBar.flags & ARROW2_AVAILABLE)) { XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); } #endif } /************************************************************************ * * Moved * This function processes mouse moved events during interactive * slider moves. * ************************************************************************/ /*ARGSUSED*/ static void Moved( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; XButtonPressedEvent * buttonEvent = (XButtonPressedEvent *) event; int newX, newY; int realX, realY; int slideVal; int button_x; int button_y; int real_width_limit = (sbw->scrollBar.snap_back_multiple + (buttonEvent->x > 0)) * XtWidth(wid); int real_height_limit = (sbw->scrollBar.snap_back_multiple + (buttonEvent->y > 0)) * XtHeight(wid) ; if (!sbw->scrollBar.editable) return ; if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; /* operation was cancelled, so don't restart the move as it could happen with the snapBack stuff */ if (sbw->scrollBar.flags & OPERATION_CANCELLED) return; if (!sbw->scrollBar.sliding_on) return; /* Only deal with snap_back if operation was started by a click in the slider. */ if (((sbw->scrollBar.orientation == XmVERTICAL) && ((buttonEvent->x > real_width_limit) || (-buttonEvent->x > real_width_limit))) || ((sbw->scrollBar.orientation == XmHORIZONTAL) && ((buttonEvent->y > real_height_limit) || (-buttonEvent->y > real_height_limit)))) { /* going out of the snap back area */ if (!(sbw->scrollBar.add_flags & SNAPPED_OUT)) { short savedX, savedY, j1, j2; /* get the saved value, also used by the Cancel action */ sbw->scrollBar.value = sbw->scrollBar.saved_value; CalcSliderRect(sbw, &savedX, &savedY, &j1, &j2); MoveSlider(sbw, savedX, savedY); if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_VALUE_CHANGED, sbw->scrollBar.value, savedX, savedY, (XEvent *) buttonEvent); sbw->scrollBar.add_flags |= SNAPPED_OUT ; } return ; } else { /* moving in the snap back area */ sbw->scrollBar.add_flags &= ~SNAPPED_OUT ; ; } button_x = buttonEvent->x; button_y = buttonEvent->y; /* * Force button_x and button_y to be within the slider_area. */ if (button_x < sbw->scrollBar.slider_area_x) button_x = sbw->scrollBar.slider_area_x; if (button_x > sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width) button_x = sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width; if (button_y < sbw->scrollBar.slider_area_y) button_y = sbw->scrollBar.slider_area_y; if (button_y > sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height) button_y = sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height; /* * Calculate the new origin of the slider. * Bound the values with the slider area. */ if (sbw->scrollBar.orientation == XmHORIZONTAL) { newX = realX = button_x - sbw->scrollBar.separation_x; newY = realY = sbw->scrollBar.slider_y; if (newX < sbw->scrollBar.slider_area_x) newX = sbw->scrollBar.slider_area_x; if ((newX + sbw->scrollBar.slider_width > sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width) && (sbw->scrollBar.sliding_mode != XmTHERMOMETER)) newX = sbw->scrollBar.slider_area_x + sbw->scrollBar.slider_area_width - sbw->scrollBar.slider_width; } else { newX = realX = sbw->scrollBar.slider_x; newY = realY = button_y - sbw->scrollBar.separation_y; if (newY < sbw->scrollBar.slider_area_y) newY = sbw->scrollBar.slider_area_y; if ((newY + sbw->scrollBar.slider_height > sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height) && (sbw->scrollBar.sliding_mode != XmTHERMOMETER)) newY = sbw->scrollBar.slider_area_y + sbw->scrollBar.slider_area_height - sbw->scrollBar.slider_height; } if (((sbw->scrollBar.orientation == XmHORIZONTAL) && (realX != sbw->scrollBar.initial_x)) || ((sbw->scrollBar.orientation == XmVERTICAL) && (realY != sbw->scrollBar.initial_y))) { slideVal = CalcSliderVal (sbw, button_x, button_y); if ((newX != sbw->scrollBar.initial_x) || (newY != sbw->scrollBar.initial_y)) { MoveSlider (sbw, newX, newY); sbw->scrollBar.initial_x = newX; sbw->scrollBar.initial_y = newY; } if (slideVal != sbw->scrollBar.value) { sbw->scrollBar.value = slideVal; if (slideVal >= (sbw->scrollBar.maximum - sbw->scrollBar.slider_size)) slideVal = sbw->scrollBar.maximum - sbw->scrollBar.slider_size; if (slideVal <= sbw->scrollBar.minimum) slideVal = sbw->scrollBar.minimum; if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback(sbw, XmCR_DRAG, sbw->scrollBar.value = slideVal, buttonEvent->x, buttonEvent->y, (XEvent *) buttonEvent); } } } /********************************************************************* * * TopOrBottom * Issue the to top or bottom callbacks. * *********************************************************************/ /*ARGSUSED*/ static void TopOrBottom( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; XmScrollBarPart *sbp = (XmScrollBarPart *) &(sbw->scrollBar); if (!sbw->scrollBar.editable) return ; sbw->scrollBar.flags &= ~OPERATION_CANCELLED ; if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; if (event->type == KeyPress) { Modifiers junk; KeySym key_sym; XKeyPressedEvent *keyEvent = (XKeyPressedEvent *) event; key_sym = XtGetActionKeysym(event, &junk); if (key_sym == osfXK_BeginLine) { if (sbp->orientation == XmVERTICAL) { if (sbp->processing_direction == XmMAX_ON_BOTTOM) MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y); else MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y + sbp->slider_area_height - sbp->slider_height); } else { if (sbp->processing_direction == XmMAX_ON_RIGHT) MoveSlider(sbw, sbp->slider_area_x, sbp->slider_y); else MoveSlider(sbw, sbp->slider_area_x + sbp->slider_area_width - sbp->slider_width, sbp->slider_y); } /* * The following grevious bogosity is due to the fact * that the key behavior was implemented long after * the rest of this code, and so we have to work around * currently operating nonsense. * * Specifically, since the dawn of time, ScrollBar * processes in just one direction, and does any necessary * reversal just before calling the callback. * * We now proceed to trick that code into doing the right * thing anyway */ if (!PROCESS_DIR_INVERSED(sbw)) { sbp->value = sbp->minimum; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback(sbw, XmCR_TO_TOP, sbp->value, keyEvent->x, keyEvent->y, (XEvent *) keyEvent); } else { sbp->value = sbp->maximum - sbp->slider_size; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback(sbw, XmCR_TO_BOTTOM, sbp->value, keyEvent->x, keyEvent->y, (XEvent *) keyEvent); } } else /* key_sym == osfXK_EndLine */ { if (sbp->orientation == XmVERTICAL) { if (sbp->processing_direction == XmMAX_ON_BOTTOM) MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y + sbp->slider_area_height - sbp->slider_height); else MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y); } else { if (sbp->processing_direction == XmMAX_ON_RIGHT) MoveSlider(sbw, sbp->slider_area_x + sbp->slider_area_width - sbp->slider_width, sbp->slider_y); else MoveSlider(sbw, sbp->slider_area_x, sbp->slider_y); } /* See above for explanation of this nonsense */ if (!PROCESS_DIR_INVERSED(sbw)) { sbp->value = sbp->maximum - sbp->slider_size; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback(sbw, XmCR_TO_BOTTOM, sbp->value, keyEvent->x, keyEvent->y, (XEvent *) keyEvent); } else { sbp->value = sbp->minimum; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_TO_TOP, sbp->value, keyEvent->x, keyEvent->y, (XEvent *) keyEvent); } } } else /* event->type == ButtonPress */ { XButtonPressedEvent *buttonEvent = (XButtonPressedEvent *) event; XmDropSiteStartUpdate(wid); if /* In arrow1... */ ((buttonEvent->x >= sbp->arrow1_x) && (buttonEvent->y >= sbp->arrow1_y) && (buttonEvent->x <= sbp->arrow1_x + sbp->arrow_width) && (buttonEvent->y <= sbp->arrow1_y + sbp->arrow_height)) { sbp->change_type = XmCR_DECREMENT; sbp->arrow1_selected = True; DRAWARROW(sbw, sbw->primitive.bottom_shadow_GC, sbw -> primitive.top_shadow_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); if (sbp->orientation == XmVERTICAL) MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y); else MoveSlider(sbw, sbp->slider_area_x, sbp->slider_y); sbp->value = sbp->minimum; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_TO_TOP, sbp->value, buttonEvent->x, buttonEvent->y, (XEvent *) buttonEvent); } else if /* In arrow2... */ ((buttonEvent->x >= sbp->arrow2_x) && (buttonEvent->y >= sbp->arrow2_y) && (buttonEvent->x <= sbp->arrow2_x + sbp->arrow_width) && (buttonEvent->y <= sbp->arrow2_y + sbp->arrow_height)) { sbp->change_type = XmCR_INCREMENT; sbp->arrow2_selected = True; DRAWARROW (sbw, sbw->primitive.bottom_shadow_GC, sbw -> primitive.top_shadow_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); if (sbp->orientation == XmVERTICAL) MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y + sbp->slider_area_height - sbp->slider_height); else MoveSlider(sbw, sbp->slider_area_x + sbp->slider_area_width - sbp->slider_width, sbp->slider_y); sbp->value = sbp->maximum - sbp->slider_size; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_TO_BOTTOM, sbp->value, buttonEvent->x, buttonEvent->y, (XEvent *) buttonEvent); } else if /* in the trough between arrow2 and the slider... */ (((sbp->sliding_mode != XmTHERMOMETER) && (((sbp->orientation == XmHORIZONTAL) && (buttonEvent->x >= sbp->slider_area_x) && (buttonEvent->x < sbp->slider_x) && (buttonEvent->y >= sbp->slider_area_y) && (buttonEvent->y <= sbp->slider_area_y + sbp->slider_area_height)) || ((sbp->orientation == XmVERTICAL) && (buttonEvent->y >= sbp->slider_area_y) && (buttonEvent->y < sbp->slider_y) && (buttonEvent->x >= sbp->slider_area_x) && (buttonEvent->x < sbp->slider_area_x + sbp->slider_area_width)))) || /* only partial treatment, processing direction has to be handled here */ ((sbp->sliding_mode == XmTHERMOMETER) && (((sbp->orientation == XmHORIZONTAL) && (buttonEvent->x >= sbp->slider_area_x) && (buttonEvent->x < sbp->slider_width) && (buttonEvent->y >= sbp->slider_area_y) && (buttonEvent->y <= sbp->slider_area_y + sbp->slider_area_height)) || ((sbp->orientation == XmVERTICAL) && (buttonEvent->y < sbp->slider_area_height - sbp->slider_height) && (buttonEvent->x >= sbp->slider_area_x) && (buttonEvent->x < sbp->slider_area_x + sbp->slider_area_width))))) { if (sbp->orientation == XmVERTICAL) MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y); else MoveSlider(sbw, sbp->slider_area_x, sbp->slider_y); sbp->value = sbp->minimum; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_TO_TOP, sbp->value, buttonEvent->x, buttonEvent->y, (XEvent *) buttonEvent); } else if /* in the trough between arrow1 and the slider... */ (((sbp->orientation == XmHORIZONTAL) && (buttonEvent->x > sbp->slider_x + sbp->slider_width) && (buttonEvent->x <= sbp->slider_area_x + sbp->slider_area_width) && (buttonEvent->y >= sbp->slider_area_y) && (buttonEvent->y <= sbp->slider_area_y + sbp->slider_area_height)) || ((sbp->orientation == XmVERTICAL) && (buttonEvent->y > sbp->slider_y + sbp->slider_height) && (buttonEvent->y <= sbp->slider_area_y + sbp->slider_area_height) && (buttonEvent->x >= sbp->slider_area_x) && (buttonEvent->x <= sbp->slider_area_x + sbp->slider_area_width)) || (sbp->sliding_mode == XmTHERMOMETER)) { if (sbp->orientation == XmVERTICAL) MoveSlider(sbw, sbp->slider_x, sbp->slider_area_y + sbp->slider_area_height - sbp->slider_height); else MoveSlider(sbw, sbp->slider_area_x + sbp->slider_area_width - sbp->slider_width, sbp->slider_y); sbp->value = sbp->maximum - sbp->slider_size; if (sbp->sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_TO_BOTTOM, sbp->value, buttonEvent->x, buttonEvent->y, (XEvent *) buttonEvent); } } #ifdef FUNKY_INSENSITIVE_VISUAL XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); if (sbp->value == sbp->minimum) { XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); sbw->scrollBar.flags &= ~ARROW1_AVAILABLE; if (! (sbw->scrollBar.flags & ARROW2_AVAILABLE)) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); sbw->scrollBar.flags |= ARROW2_AVAILABLE; } } else /* sbp->value == (sbp->maximum - sbp->slider_size) */ { /* XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); */ sbw->scrollBar.flags &= ~ARROW2_AVAILABLE; if (! (sbw->scrollBar.flags & ARROW1_AVAILABLE)) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); sbw->scrollBar.flags |= ARROW1_AVAILABLE; } } #endif } /********************************************************************* * * IncrementUpOrLeft * The up or left key was pressed, decrease the value by * one increment. * *********************************************************************/ /*ARGSUSED*/ static void IncrementUpOrLeft( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; int new_value; int key_pressed; if (!num_params || (*num_params != 1) || !params) { XmeWarning(wid, MESSAGE14); return; } if (!sbw->scrollBar.editable) return ; sbw->scrollBar.flags &= ~OPERATION_CANCELLED ; if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; /* * arg value passed in will either be "up" for the up key or * "left" for the left arrow key (or for compatibility 0 -> up * key or 1 -> left key. The key needs to be compared with the * scrollbar orientation to ensure only the proper directional key * presses work. */ if (_XmConvertActionParamToRepTypeId((Widget) sbw, XmRID_SCROLL_BAR_INCREMENT_UP_OR_LEFT_ACTION_PARAMS, params[0], True, &key_pressed) == False) { /* We couldn't convert the value. Just assume a value of 0. */ key_pressed = 0; } if (((key_pressed == 0) && (sbw->scrollBar.orientation == XmHORIZONTAL)) || ((key_pressed == 1) && (sbw->scrollBar.orientation == XmVERTICAL))) return; new_value = sbw->scrollBar.value - sbw->scrollBar.increment; if (new_value < sbw->scrollBar.minimum) new_value = sbw->scrollBar.minimum; if (new_value != sbw->scrollBar.value) { sbw->scrollBar.value = new_value; #ifdef FUNKY_INSENSITIVE_VISUAL if ((sbw->scrollBar.value = new_value) == sbw->scrollBar.minimum) { XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); sbw->scrollBar.flags &= ~ARROW1_AVAILABLE; } #endif if ((sbw->scrollBar.show_arrows) && (! (sbw->scrollBar.flags & ARROW2_AVAILABLE))) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); sbw->scrollBar.flags |= ARROW2_AVAILABLE; } RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_DECREMENT, sbw->scrollBar.value, event->xbutton.x, event->xbutton.y, event); } } /********************************************************************* * * IncrementDownOrRight * The down or right key was pressed, increase the value by * one increment. * *********************************************************************/ /*ARGSUSED*/ static void IncrementDownOrRight( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; int new_value; int key_pressed; if (!num_params || (*num_params != 1) || !params) { XmeWarning(wid, MESSAGE14); return; } if (!sbw->scrollBar.editable) return ; sbw->scrollBar.flags &= ~OPERATION_CANCELLED ; if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; /* * arg value passed in will either be "down" for the down key or * "right" for the right arrow key (or for compatibility 0 -> down * key or 1 -> right key. The key needs to be compared with the * scrollbar orientation to ensure only the proper directional key * presses work. */ if (_XmConvertActionParamToRepTypeId((Widget) sbw, XmRID_SCROLL_BAR_INCREMENT_DOWN_OR_RIGHT_ACTION_PARAMS, params[0], True, &key_pressed) == False) { /* We couldn't convert the value. Just assume a value of 0. */ key_pressed = 0; } if (((key_pressed == 0) && (sbw->scrollBar.orientation == XmHORIZONTAL)) || ((key_pressed == 1) && (sbw->scrollBar.orientation == XmVERTICAL))) return; new_value = sbw->scrollBar.value + sbw->scrollBar.increment; if (new_value > sbw->scrollBar.maximum - sbw->scrollBar.slider_size) new_value = sbw->scrollBar.maximum - sbw->scrollBar.slider_size; if (new_value != sbw->scrollBar.value) { sbw->scrollBar.value = new_value; #ifdef FUNKY_INSENSITIVE_VISUAL if ((sbw->scrollBar.value = new_value) == (sbw->scrollBar.maximum - sbw->scrollBar.slider_size)) { XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); sbw->scrollBar.flags &= ~ARROW2_AVAILABLE; } #endif if ((sbw->scrollBar.show_arrows) && (! (sbw->scrollBar.flags & ARROW1_AVAILABLE))) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); sbw->scrollBar.flags |= ARROW1_AVAILABLE; } RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_INCREMENT, sbw->scrollBar.value, event->xbutton.x, event->xbutton.y, event); } } /********************************************************************* * * PageUpOrLeft * The up or left key was pressed, decrease the value by * one increment. * *********************************************************************/ /*ARGSUSED*/ static void PageUpOrLeft( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; int new_value; int key_pressed; if (!num_params || (*num_params != 1) || !params) { XmeWarning(wid, MESSAGE14); return; } if (!sbw->scrollBar.editable) return ; sbw->scrollBar.flags &= ~OPERATION_CANCELLED ; if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; /* * arg value passed in will either be "up" for the up key or * "left" for the left arrow key (or for compatibility 0 -> up * key or 1 -> left key. The key needs to be compared with the * scrollbar orientation to ensure only the proper directional key * presses work. */ if (_XmConvertActionParamToRepTypeId((Widget) sbw, XmRID_SCROLL_BAR_PAGE_UP_OR_LEFT_ACTION_PARAMS, params[0], True, &key_pressed) == False) { /* We couldn't convert the value. Just assume a value of 0. */ key_pressed = 0; } if (((key_pressed == 0) && (sbw->scrollBar.orientation == XmHORIZONTAL)) || ((key_pressed == 1) && (sbw->scrollBar.orientation == XmVERTICAL))) return; new_value = sbw->scrollBar.value - sbw->scrollBar.page_increment; if (new_value < sbw->scrollBar.minimum) new_value = sbw->scrollBar.minimum; if (new_value != sbw->scrollBar.value) { sbw->scrollBar.value = new_value; #ifdef FUNKY_INSENSITIVE_VISUAL if ((sbw->scrollBar.value = new_value) == sbw->scrollBar.minimum) { XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); sbw->scrollBar.flags &= ~ARROW1_AVAILABLE; } #endif if ((sbw->scrollBar.show_arrows) && (! (sbw->scrollBar.flags & ARROW2_AVAILABLE))) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow2_orientation); sbw->scrollBar.flags |= ARROW2_AVAILABLE; } RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_PAGE_DECREMENT, sbw->scrollBar.value, event->xbutton.x, event->xbutton.y, event); } } /********************************************************************* * * PageDownOrRight * The down or right key was pressed, increase the value by * one increment. * *********************************************************************/ /*ARGSUSED*/ static void PageDownOrRight( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid ; int new_value; int key_pressed; if (!num_params || (*num_params != 1) || !params) { XmeWarning(wid, MESSAGE14); return; } if (!sbw->scrollBar.editable) return ; sbw->scrollBar.flags &= ~OPERATION_CANCELLED ; if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return; /* * arg value passed in will either be "down" for the down key or * "right" for the right arrow key (or for compatibility 0 -> down * key or 1 -> right key. The key needs to be compared with the * scrollbar orientation to ensure only the proper directional key * presses work. */ if (_XmConvertActionParamToRepTypeId((Widget) sbw, XmRID_SCROLL_BAR_PAGE_DOWN_OR_RIGHT_ACTION_PARAMS, params[0], True, &key_pressed) == False) { /* We couldn't convert the value. Just assume a value of 0. */ key_pressed = 0; } if (((key_pressed == 0) && (sbw->scrollBar.orientation == XmHORIZONTAL)) || ((key_pressed == 1) && (sbw->scrollBar.orientation == XmVERTICAL))) return; new_value = sbw->scrollBar.value + sbw->scrollBar.page_increment; if (new_value > sbw->scrollBar.maximum - sbw->scrollBar.slider_size) new_value = sbw->scrollBar.maximum - sbw->scrollBar.slider_size; if (new_value != sbw->scrollBar.value) { sbw->scrollBar.value = new_value; #ifdef FUNKY_INSENSITIVE_VISUAL if ((sbw->scrollBar.value = new_value) == (sbw->scrollBar.maximum - sbw->scrollBar.slider_size)) { XSetClipMask(XtDisplay(sbw), sbw->scrollBar.unavailable_GC, None); XFillRectangle(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.unavailable_GC, sbw->scrollBar.arrow2_x, sbw->scrollBar.arrow2_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height); sbw->scrollBar.flags &= ~ARROW2_AVAILABLE; } #endif if ((sbw->scrollBar.show_arrows) && (! (sbw->scrollBar.flags & ARROW1_AVAILABLE))) { XClearArea(XtDisplay(sbw), XtWindow(sbw), sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow_width, sbw->scrollBar.arrow_height, FALSE); DRAWARROW (sbw, sbw -> primitive.top_shadow_GC, sbw->primitive.bottom_shadow_GC, sbw->scrollBar.arrow1_x, sbw->scrollBar.arrow1_y, sbw->scrollBar.arrow1_orientation); sbw->scrollBar.flags |= ARROW1_AVAILABLE; } RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_PAGE_INCREMENT, sbw->scrollBar.value, event->xbutton.x, event->xbutton.y, event); } } /*ARGSUSED*/ static void CancelDrag( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmScrollBarWidget sbw = (XmScrollBarWidget) wid; if (!sbw->scrollBar.editable) return ; if (sbw->scrollBar.flags & KEYBOARD_GRABBED) { short savedX, savedY, j1, j2; XtUngrabKeyboard(wid, ((XButtonPressedEvent *)event)->time); sbw->scrollBar.flags &= ~KEYBOARD_GRABBED; sbw->scrollBar.flags |= OPERATION_CANCELLED; sbw->scrollBar.sliding_on = False; sbw->scrollBar.value = sbw->scrollBar.saved_value; CalcSliderRect(sbw, &savedX, &savedY, &j1, &j2); MoveSlider(sbw, savedX, savedY); if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) RedrawSliderWindow (sbw); ScrollCallback (sbw, XmCR_VALUE_CHANGED, sbw->scrollBar.value, savedX, savedY, (XEvent *) event); if (sbw->scrollBar.timer != 0) { sbw->scrollBar.flags |= END_TIMER; } } else { XmParentInputActionRec pp_data ; pp_data.process_type = XmINPUT_ACTION ; pp_data.action = XmPARENT_CANCEL ; pp_data.event = event ; pp_data.params = params ; pp_data.num_params = num_params ; _XmParentProcess( XtParent( wid), (XmParentProcessData) &pp_data) ; } } /********************************************************************* * * MoveSlider * Given x and y positions, move the slider and clear the area * moved out of. * *********************************************************************/ static void MoveSlider( XmScrollBarWidget sbw, int currentX, int currentY ) { int oldX = sbw->scrollBar.slider_x; int oldY = sbw->scrollBar.slider_y; int width = sbw->scrollBar.slider_width; int height = sbw->scrollBar.slider_height; XSegment seg[2]; if ((currentX == oldX) && (currentY == oldY)) return; if (sbw->scrollBar.sliding_mode == XmTHERMOMETER) { if (sbw->scrollBar.orientation == XmHORIZONTAL) sbw->scrollBar.slider_x = currentX; else sbw->scrollBar.slider_y = currentY; return ; } if (sbw->scrollBar.orientation == XmHORIZONTAL) { sbw->scrollBar.slider_x = currentX; seg[0].y1 = seg[0].y2 = oldY + 2; seg[1].y1 = seg[1].y2 = oldY + height - 3; if (oldX < currentX) { seg[0].x1 = seg[1].x1 = oldX; seg[0].x2 = seg[1].x2 = oldX + currentX - oldX - 1; } else { seg[0].x1 = seg[1].x1 = currentX + width; seg[0].x2 = seg[1].x2 = seg[0].x1 + oldX - currentX - 1; } if (sbw->scrollBar.pixmap != 0) { CopySliderInWindow(sbw); XClearArea (XtDisplay((Widget)sbw), XtWindow((Widget)sbw), seg[0].x1, oldY, seg[0].x2 - seg[0].x1 + 1, height, False); } } else /* sbw->scrollBar.orientation == XmVERTICAL */ { sbw->scrollBar.slider_y = currentY; seg[0].x1 = seg[0].x2 = oldX + 2; seg[1].x1 = seg[1].x2 = oldX + width - 3; if (oldY < currentY) { seg[0].y1 = seg[1].y1 = oldY; seg[0].y2 = seg[1].y2 = oldY + currentY - oldY - 1; } else { seg[0].y1 = seg[1].y1 = currentY + height; seg[0].y2 = seg[1].y2 = seg[0].y1 + oldY - currentY - 1; } if (sbw->scrollBar.pixmap != 0) { CopySliderInWindow(sbw); XClearArea (XtDisplay((Widget)sbw), XtWindow((Widget)sbw), oldX, seg[0].y1, width, seg[0].y2 - seg[0].y1 + 1, False); } } } /************************************************************************ * * ChangeScrollBarValue * Change the scrollbar value by the indicated change type. Return * True if the value changes, False otherwise. * ************************************************************************/ static Boolean ChangeScrollBarValue( XmScrollBarWidget sbw ) { register unsigned char change_type = sbw->scrollBar.change_type; register int change_amount = 0; register Boolean returnFlag = TRUE; register int old_value = sbw->scrollBar.value; if (! (sbw->scrollBar.flags & SLIDER_AVAILABLE)) return(FALSE); /* Get the amount to change the scroll bar value based on */ /* the type of change occuring. */ if (change_type == XmCR_INCREMENT) change_amount = sbw->scrollBar.increment; else if (change_type == XmCR_PAGE_INCREMENT) change_amount = sbw->scrollBar.page_increment; else if (change_type == XmCR_DECREMENT) change_amount = -sbw->scrollBar.increment; else if (change_type == XmCR_PAGE_DECREMENT) change_amount = -sbw->scrollBar.page_increment; /* Change the value */ sbw->scrollBar.value += change_amount; /* Truncate and set flags as appropriate */ if (sbw->scrollBar.value >= (sbw->scrollBar.maximum - sbw->scrollBar.slider_size)) sbw->scrollBar.value = sbw->scrollBar.maximum - sbw->scrollBar.slider_size; if (sbw->scrollBar.value <= sbw->scrollBar.minimum) sbw->scrollBar.value = sbw->scrollBar.minimum; if ((returnFlag = (sbw->scrollBar.value != old_value)) != False) { RedrawSliderWindow (sbw); } return (returnFlag); } /********************************************************************* * * TimerEvent * This is an event processing function which handles timer * event evoked because of arrow selection. * *********************************************************************/ /*ARGSUSED*/ static void TimerEvent( XtPointer closure, XtIntervalId *id ) /* unused */ { XmScrollBarWidget sbw = (XmScrollBarWidget) closure ; Boolean flag; sbw->scrollBar.timer = 0; if (sbw->scrollBar.flags & END_TIMER) { sbw->scrollBar.flags &= ~END_TIMER; return; } if (sbw->scrollBar.flags & FIRST_SCROLL_FLAG) { XSync (XtDisplay (sbw), False); sbw->scrollBar.flags &= ~FIRST_SCROLL_FLAG; sbw->scrollBar.timer = XtAppAddTimeOut (XtWidgetToApplicationContext((Widget) sbw), (unsigned long) sbw->scrollBar.repeat_delay, TimerEvent, (XtPointer) sbw); return; } /* Change the scrollbar slider value */ flag = ChangeScrollBarValue (sbw); /* If the orgin was changed invoke the application supplied */ /* slider moved callbacks */ if (flag) ScrollCallback (sbw, sbw->scrollBar.change_type, sbw->scrollBar.value, 0, 0, NULL); /* * If the callback does alot of processing, and XSync is needed * to flush the output and input buffers. If this is not done, * the entry back to MainLoop will cause the flush. The server * will then perform it work which may take longer than the timer * interval which will cause the scrollbar to be stuck in a loop. */ XSync (XtDisplay (sbw), False); /* Add the repeat timer and check that the scrollbar hasn't been set insensitive by some callbacks */ if (flag) { sbw->scrollBar.timer = XtAppAddTimeOut (XtWidgetToApplicationContext((Widget) sbw), (unsigned long) sbw->scrollBar.repeat_delay, TimerEvent, (XtPointer) sbw); } } /************************************************************************ * * ScrollCallback * This routine services the widget's callbacks. It calls the * specific callback if it is not empty. If it is empty then the * main callback is called. * ************************************************************************/ static void ScrollCallback( XmScrollBarWidget sbw, int reason, int value, int xpixel, int ypixel, XEvent *event ) { XmScrollBarCallbackStruct call_value; call_value.reason = reason; call_value.event = event; if (PROCESS_DIR_INVERSED(sbw)) { switch (reason) { case XmCR_INCREMENT: call_value.reason = reason = XmCR_DECREMENT; break; case XmCR_DECREMENT: call_value.reason = reason = XmCR_INCREMENT; break; case XmCR_PAGE_INCREMENT: call_value.reason = reason = XmCR_PAGE_DECREMENT; break; case XmCR_PAGE_DECREMENT: call_value.reason = reason = XmCR_PAGE_INCREMENT; break; case XmCR_TO_TOP: call_value.reason = reason = XmCR_TO_BOTTOM; break; case XmCR_TO_BOTTOM: call_value.reason = reason = XmCR_TO_TOP; break; } call_value.value = sbw->scrollBar.maximum + sbw->scrollBar.minimum - value - sbw->scrollBar.slider_size; } else call_value.value = value; if (sbw->scrollBar.orientation == XmHORIZONTAL) call_value.pixel = xpixel; else call_value.pixel = ypixel; switch (reason) { case XmCR_VALUE_CHANGED: XtCallCallbackList ((Widget) sbw, sbw->scrollBar.value_changed_callback, &call_value); break; case XmCR_INCREMENT: if (sbw->scrollBar.increment_callback) XtCallCallbackList ((Widget) sbw, sbw->scrollBar.increment_callback, &call_value); else { call_value.reason = XmCR_VALUE_CHANGED; XtCallCallbackList ((Widget) sbw, sbw->scrollBar.value_changed_callback, &call_value); } break; case XmCR_DECREMENT: if (sbw->scrollBar.decrement_callback) XtCallCallbackList ((Widget) sbw, sbw->scrollBar.decrement_callback, &call_value); else { call_value.reason = XmCR_VALUE_CHANGED; XtCallCallbackList ((Widget) sbw, sbw->scrollBar.value_changed_callback, &call_value); } break; case XmCR_PAGE_INCREMENT: if (sbw->scrollBar.page_increment_callback) XtCallCallbackList ((Widget) sbw, sbw->scrollBar.page_increment_callback, &call_value); else { call_value.reason = XmCR_VALUE_CHANGED; XtCallCallbackList ((Widget) sbw, sbw->scrollBar.value_changed_callback, &call_value); } break; case XmCR_PAGE_DECREMENT: if (sbw->scrollBar.page_decrement_callback) XtCallCallbackList ((Widget) sbw, sbw->scrollBar.page_decrement_callback, &call_value); else { call_value.reason = XmCR_VALUE_CHANGED; XtCallCallbackList ((Widget) sbw, sbw->scrollBar.value_changed_callback, &call_value); } break; case XmCR_TO_TOP: if (sbw->scrollBar.to_top_callback) XtCallCallbackList ((Widget) sbw, sbw->scrollBar.to_top_callback, &call_value); else { call_value.reason = XmCR_VALUE_CHANGED; XtCallCallbackList ((Widget) sbw, sbw->scrollBar.value_changed_callback, &call_value); } break; case XmCR_TO_BOTTOM: if (sbw->scrollBar.to_bottom_callback) XtCallCallbackList ((Widget) sbw, sbw->scrollBar.to_bottom_callback, &call_value); else { call_value.reason = XmCR_VALUE_CHANGED; XtCallCallbackList ((Widget) sbw, sbw->scrollBar.value_changed_callback, &call_value); } break; case XmCR_DRAG: if (sbw->scrollBar.drag_callback) XtCallCallbackList ((Widget) sbw, sbw->scrollBar.drag_callback, &call_value); break; } } /************************************************************************ * * NavigChangeMoveCB * add or remove the callback list to be called on any move. * Since valueChangedCallback is not called on increment (& co) * if an increment callback is present, we have to set them all. * ************************************************************************/ static void NavigChangeMoveCB( Widget nav, XtCallbackProc moveCB, XtPointer closure, Boolean setunset) { if (setunset) { XtAddCallback (nav, XmNvalueChangedCallback, moveCB, closure); XtAddCallback (nav, XmNincrementCallback, moveCB, closure); XtAddCallback (nav, XmNdecrementCallback, moveCB, closure); XtAddCallback (nav, XmNpageIncrementCallback, moveCB, closure); XtAddCallback (nav, XmNpageDecrementCallback, moveCB, closure); XtAddCallback (nav, XmNtoTopCallback, moveCB, closure); XtAddCallback (nav, XmNtoBottomCallback, moveCB, closure); XtAddCallback (nav, XmNdragCallback, moveCB, closure); } else { XtRemoveCallback (nav, XmNvalueChangedCallback, moveCB, closure); XtRemoveCallback (nav, XmNincrementCallback, moveCB, closure); XtRemoveCallback (nav, XmNdecrementCallback, moveCB, closure); XtRemoveCallback (nav, XmNpageIncrementCallback, moveCB, closure); XtRemoveCallback (nav, XmNpageDecrementCallback, moveCB, closure); XtRemoveCallback (nav, XmNtoTopCallback, moveCB, closure); XtRemoveCallback (nav, XmNtoBottomCallback, moveCB, closure); XtRemoveCallback (nav, XmNdragCallback, moveCB, closure); } } /************************************************************************ * * NavigSetValue * change the value and possibly call the callbacks * ************************************************************************/ static void NavigSetValue( Widget nav, XmNavigatorData nav_data, Boolean notify) { XmScrollBarWidget sbw = (XmScrollBarWidget) nav; int save_value; Arg arglist[6]; Cardinal n; /* register which dimension this scrollbar is to operate */ if (nav_data->valueMask & NavDimMask) { sbw->scrollBar.dimMask = nav_data->dimMask ; } /* scrollbar is a one dimensional navigator, it expects only one dimension to be set, the one that has been registered for using the NavDimMask (as treated above) */ if (!(sbw->scrollBar.dimMask & nav_data->dimMask)) return ; /* we need to fetch either the x or y values out of the passed nav_data record, depending on the dimmask. scrollbar is only interested in one value */ save_value = sbw->scrollBar.value; n = 0; if (nav_data->valueMask & NavValue) { if ((PROCESS_DIR_INVERSED(sbw) ? INVERSED_VALUE(sbw) : sbw->scrollBar.value) != ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->value)) { XtSetArg (arglist[n], XmNvalue, ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->value));n++; } } if ((nav_data->valueMask & NavMinimum) && (sbw->scrollBar.minimum != ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->minimum))) { XtSetArg (arglist[n], XmNminimum, ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->minimum));n++; } if ((nav_data->valueMask & NavMaximum) && (sbw->scrollBar.maximum != ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->maximum))) { XtSetArg (arglist[n], XmNmaximum, ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->maximum));n++; } if (sbw->scrollBar.sliding_mode != XmTHERMOMETER) { if ((nav_data->valueMask & NavSliderSize) && (sbw->scrollBar.slider_size != ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->slider_size)) && (ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->slider_size) != 0)) { XtSetArg (arglist[n], XmNsliderSize, ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->slider_size)); n++; } } if ((nav_data->valueMask & NavIncrement) && (sbw->scrollBar.increment != ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->increment)) && (ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->increment) != 0)) { XtSetArg (arglist[n], XmNincrement, ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->increment)); n++; } if ((nav_data->valueMask & NavPageIncrement) && (sbw->scrollBar.page_increment != ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->page_increment)) && (ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->page_increment) != 0)) { XtSetArg (arglist[n], XmNpageIncrement, ACCESS_DIM(sbw->scrollBar.dimMask, nav_data->page_increment)); n++; } if (n) XtSetValues (nav, arglist, n); if (notify && sbw->scrollBar.value != save_value) ScrollCallback (sbw, XmCR_VALUE_CHANGED, sbw->scrollBar.value, 0, 0, NULL); } /************************************************************************ * * NavigGetValue * reports the all the data for this navigator scrollbar * nav_data allocated by the caller ************************************************************************/ static void NavigGetValue( Widget nav, XmNavigatorData nav_data) { XmScrollBarWidget sbw = (XmScrollBarWidget) nav; nav_data->dimMask = sbw->scrollBar.dimMask; if (nav_data->valueMask & NavValue) { int value ; if (PROCESS_DIR_INVERSED(sbw)) { value = INVERSED_VALUE(sbw); } else value = sbw->scrollBar.value; ASSIGN_DIM(nav_data->dimMask, nav_data->value, value) ; } if (nav_data->valueMask & NavMinimum) ASSIGN_DIM(nav_data->dimMask, nav_data->minimum, sbw->scrollBar.minimum) ; if (nav_data->valueMask & NavMaximum) ASSIGN_DIM(nav_data->dimMask, nav_data->maximum, sbw->scrollBar.maximum) ; if (nav_data->valueMask & NavSliderSize) ASSIGN_DIM(nav_data->dimMask, nav_data->slider_size, sbw->scrollBar.slider_size) ; if (nav_data->valueMask & NavIncrement) ASSIGN_DIM(nav_data->dimMask, nav_data->increment, sbw->scrollBar.increment) ; if (nav_data->valueMask & NavPageIncrement) ASSIGN_DIM(nav_data->dimMask, nav_data->page_increment, sbw->scrollBar.page_increment) ; } /************************************************************************ * * Application Accessible External Functions * ************************************************************************/ /************************************************************************ * * XmCreateScrollBar * Create an instance of a scrollbar and return the widget id. * ************************************************************************/ Widget XmCreateScrollBar( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget (name, xmScrollBarWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateScrollBar( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmScrollBarWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedScrollBar( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmScrollBarWidgetClass, parent, True, var, count); va_end(var); return w; } /************************************************************************ * * XmScrollBarGetValues * Return some scrollbar values. * ************************************************************************/ void XmScrollBarGetValues( Widget w, int *value, int *slider_size, int *increment, int *page_increment ) { XmScrollBarWidget sbw = (XmScrollBarWidget) w; XtAppContext app = XtWidgetToApplicationContext(w); _XmAppLock(app); if (PROCESS_DIR_INVERSED(sbw)) { if (value) *value = INVERSED_VALUE(sbw); } else if (value) *value = sbw->scrollBar.value; if (slider_size) *slider_size = sbw->scrollBar.slider_size; if (increment) *increment = sbw->scrollBar.increment; if (page_increment) *page_increment = sbw->scrollBar.page_increment; _XmAppUnlock(app); } /************************************************************************ * * XmScrollBarSetValues * Set some scrollbar values. * ************************************************************************/ void XmScrollBarSetValues( Widget w, int value, int slider_size, int increment, int page_increment, #if NeedWidePrototypes int notify ) #else Boolean notify ) #endif /* NeedWidePrototypes */ { XmScrollBarWidget sbw = (XmScrollBarWidget) w; int save_value; Arg arglist[4]; Cardinal n; XtAppContext app = XtWidgetToApplicationContext(w); _XmAppLock(app); save_value = sbw->scrollBar.value; n = 0; XtSetArg (arglist[n], XmNvalue, value); n++; if (sbw->scrollBar.sliding_mode != XmTHERMOMETER) { if (slider_size != 0) { XtSetArg (arglist[n], XmNsliderSize, slider_size); n++; } } if (increment != 0) { XtSetArg (arglist[n], XmNincrement, increment); n++; } if (page_increment != 0) { XtSetArg (arglist[n], XmNpageIncrement, page_increment); n++; } XtSetValues ((Widget) sbw, arglist, n); if (notify && sbw->scrollBar.value != save_value) ScrollCallback (sbw, XmCR_VALUE_CHANGED, sbw->scrollBar.value, 0, 0, NULL); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/RowColumn.c0000644000175000017500000036111713145162623013022 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: RowColumn.c /main/25 1998/07/22 15:41:49 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "GeoUtilsI.h" #include "GMUtilsI.h" #include "LabelGI.h" #include "ManagerI.h" #include "MapEventsI.h" #include "MenuProcI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "MessagesI.h" #include "RCLayoutI.h" #include "RCMenuI.h" #include "RepTypeI.h" #include "RowColumnI.h" #include "ScreenI.h" #include "TearOffI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "RCHookI.h" #define FIX_1351 #define FIX_1410 /******** Static Function Declarations ********/ static void Destroy( Widget w) ; static void ConstraintDestroy( Widget w) ; static void FixWidget( XmRowColumnWidget m, Widget w) ; static Cardinal InsertPosition( Widget w) ; static void InsertChild( Widget w) ; static void DeleteChild( Widget child) ; static void ChangeManaged( Widget wid) ; static void Realize( Widget wid, XtValueMask *window_mask, XSetWindowAttributes *window_attributes) ; static Boolean DoEntryStuff( XmRowColumnWidget old, XmRowColumnWidget new_w) ; static void DoSize( XmRowColumnWidget old, XmRowColumnWidget new_w) ; static Boolean set_values_non_popup( XmRowColumnWidget old, XmRowColumnWidget new_w) ; static Boolean set_values_popup( XmRowColumnWidget old, XmRowColumnWidget new_w) ; static void set_values_passive_grab( XmRowColumnWidget old, XmRowColumnWidget new_w) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *reply); static XtGeometryResult GeometryManager( Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *allowed) ; static char * GetRealKey( XmRowColumnWidget rc, char *str) ; static void MenuBarInitialize( XmRowColumnWidget bar) ; static void PreparePostFromList( XmRowColumnWidget rowcol) ; static void PopupInitialize( XmRowColumnWidget popup) ; static void PulldownInitialize( XmRowColumnWidget pulldown) ; static void OptionInitialize( XmRowColumnWidget option) ; static void WorkAreaInitialize( XmRowColumnWidget work) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void ConstraintInitialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean ConstraintSetValues( Widget old, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Widget create( Widget p, char *name, ArgList old_al, Cardinal old_ac, int type, int is_radio) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass rcc) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean TraversalChildren( Widget wid, Widget **childList, Cardinal *numChildren) ; static void FixEventBindings( XmRowColumnWidget m, Widget w) ; static Widget FindFirstManagedChild( CompositeWidget m, #if NeedWidePrototypes int first_button) ; #else Boolean first_button) ; #endif /* NeedWidePrototypes */ static void Resize( Widget wid) ; static void Redisplay( Widget w, XEvent *event, Region region) ; static void FixVisual( XmRowColumnWidget m, Widget w) ; static void FixCallback( XmRowColumnWidget m, Widget w) ; static void ActionNoop( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void EventNoop( Widget reportingWidget, XtPointer data, XEvent *event, Boolean *cont) ; static void MenuFocusIn( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void MenuFocusOut( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void MenuUnmap( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void MenuEnter( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void GadgetEscape( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void GetMnemonicCharSet( Widget wid, int resource, XtArgVal *value) ; static void GetMenuAccelerator( Widget wid, int resource, XtArgVal *value) ; static void GetMenuPost( Widget wid, int resource, XtArgVal *value) ; static void GetLabelString( Widget wid, int resource_offset, XtArgVal *value) ; static void GetTearOffTitle( Widget wid, int resource_offset, XtArgVal *value) ; static XmNavigability WidgetNavigable( Widget wid) ; /******** End Static Function Declarations ********/ /* Traits Declarations */ extern XmMenuSystemTraitRec _XmRC_menuSystemRecord; /* * event translation tables for a menu widget, we use the parameters to * signal that this widget invoking the action proc is the menu, not a * child of the menu */ static XtTranslations menu_traversal_parsed; #define menu_traversal_table _XmRowColumn_menu_traversal_table static XtTranslations bar_parsed; #define bar_table _XmRowColumn_bar_table static XtTranslations option_parsed; #define option_table _XmRowColumn_option_table static XtTranslations menu_parsed; #define menu_table _XmRowColumn_menu_table /* * auto create child names */ #define TEAROFF_CONTROL "TearOffControl" #define OPTION_LABEL "OptionLabel" #define OPTION_BUTTON "OptionButton" #define POPUP_PREFIX "popup_%s" /* * default sizes */ #define DEFAULT_WIDTH 16 #define DEFAULT_HEIGHT 16 #define UNSET_POSTBUTTON ((unsigned int) -1) /* * action binding table for row column widget */ static XtActionsRec actions [] = { {"Help", _XmManagerHelp}, {"MenuHelp", _XmMenuHelp}, {"MenuBtnDown", _XmMenuBtnDown}, {"MenuBtnUp", _XmMenuBtnUp}, {"PulldownBtnDown", _XmMenuBtnDown}, {"PulldownBtnUp", _XmMenuBtnUp}, {"PopupBtnDown", _XmMenuBtnDown}, {"PopupBtnUp", _XmMenuBtnUp}, {"MenuBarBtnDown", _XmMenuBtnDown}, {"MenuBarBtnUp", _XmMenuBtnUp}, {"WorkAreaBtnDown", _XmGadgetArm}, {"WorkAreaBtnUp", _XmGadgetActivate}, {"MenuBarGadgetSelect", _XmMenuBarGadgetSelect}, {"MenuGadgetTraverseCurrent", _XmMenuGadgetTraverseCurrent}, {"MenuGadgetTraverseCurrentUp", _XmMenuGadgetTraverseCurrentUp}, {"MenuGadgetDrag", _XmMenuGadgetDrag}, {"FocusOut", _XmMenuFocusOut}, {"FocusIn", _XmMenuFocusIn}, {"Unmap", _XmMenuUnmap}, {"Noop", ActionNoop}, {"MenuTraverseLeft", _XmMenuTraverseLeft}, {"MenuTraverseRight", _XmMenuTraverseRight}, {"MenuTraverseUp", _XmMenuTraverseUp}, {"MenuTraverseDown", _XmMenuTraverseDown}, {"MenuEscape", _XmMenuEscape}, {"MenuFocusIn", MenuFocusIn}, {"MenuFocusOut", MenuFocusOut}, {"MenuUnmap", MenuUnmap}, {"MenuEnter", MenuEnter}, {"MenuGadgetReturn", _XmGadgetSelect}, {"MenuGadgetEscape", GadgetEscape}, {"MenuGadgetTraverseLeft", _XmRC_GadgetTraverseLeft}, {"MenuGadgetTraverseRight", _XmRC_GadgetTraverseRight}, {"MenuGadgetTraverseUp", _XmRC_GadgetTraverseUp}, {"MenuGadgetTraverseDown", _XmRC_GadgetTraverseDown} }; /* * define the resourse stuff for a rowcolumn widget */ static XtResource resources[] = { { XmNresizeWidth, XmCResizeWidth, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.resize_width), XmRImmediate, (XtPointer) TRUE }, { XmNresizeHeight, XmCResizeHeight, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.resize_height), XmRImmediate, (XtPointer) TRUE }, { XmNwhichButton, XmCWhichButton, XmRWhichButton, sizeof(unsigned int), XtOffsetOf( struct _XmRowColumnRec, row_column.postButton), XmRImmediate, (XtPointer) UNSET_POSTBUTTON, }, { XmNmenuPost, XmCMenuPost, XmRString, sizeof(String), XtOffsetOf( struct _XmRowColumnRec, row_column.menuPost), XmRString, NULL, }, { XmNadjustLast, XmCAdjustLast, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.adjust_last), XmRImmediate, (XtPointer) TRUE, }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmRowColumnRec, row_column.margin_width), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf( struct _XmRowColumnRec, row_column.margin_height), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNentryCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmRowColumnRec, row_column.entry_callback), XmRCallback, NULL }, { XmNmapCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmRowColumnRec, row_column.map_callback), XmRCallback, NULL }, { XmNunmapCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmRowColumnRec, row_column.unmap_callback), XmRCallback, NULL }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf( struct _XmRowColumnRec, row_column.orientation), XmRImmediate, (XtPointer)XmNO_ORIENTATION }, { XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _XmRowColumnRec, row_column.spacing), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNentryBorder, /* border width of all the */ XmCEntryBorder, /* entries, always uniform */ XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _XmRowColumnRec, row_column.entry_border), XmRImmediate, (XtPointer) 0 }, { XmNisAligned, /* T/F, do all entrys have */ XmCIsAligned, /* same alignment */ XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.do_alignment), XmRImmediate, (XtPointer)TRUE }, { XmNentryAlignment, /* how entries are to be */ XmCAlignment, /* aligned */ XmRAlignment, sizeof(unsigned char), XtOffsetOf( struct _XmRowColumnRec, row_column.entry_alignment), XmRImmediate, (XtPointer)XmALIGNMENT_BEGINNING }, { XmNadjustMargin, /* should all entries have */ XmCAdjustMargin, /* the same label margins */ XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.adjust_margin), XmRImmediate, (XtPointer)TRUE }, { XmNpacking, /* how to pack menu entries */ XmCPacking, /* Tight, Column, None */ XmRPacking, sizeof (unsigned char), XtOffsetOf( struct _XmRowColumnRec, row_column.packing), XmRImmediate, (XtPointer)XmNO_PACKING }, { XmNnumColumns, /* if packing columnar then */ XmCNumColumns, /* this is how many */ XmRShort, sizeof (short), XtOffsetOf( struct _XmRowColumnRec, row_column.num_columns), XmRImmediate, (XtPointer)1 }, { XmNradioBehavior, /* should the menu enforce */ XmCRadioBehavior, /* toggle button exclusivity, */ XmRBoolean, /* ie, radio buttons */ sizeof (Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.radio), XmRImmediate, (XtPointer)FALSE }, { XmNradioAlwaysOne, /* should there always be one */ XmCRadioAlwaysOne, /* radio button on. */ XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.radio_one), XmRImmediate, (XtPointer)TRUE }, { XmNisHomogeneous, /* should we enforce the */ XmCIsHomogeneous, /* rule that only one type of */ XmRBoolean, /* entry is allow in the menu */ sizeof (Boolean), XtOffsetOf( struct _XmRowColumnRec, row_column.homogeneous), XmRImmediate, (XtPointer)FALSE }, { XmNentryClass, /* if enforcing homogeneous */ XmCEntryClass, /* menu, this tells the class */ XmRWidgetClass, sizeof (WidgetClass), XtOffsetOf( struct _XmRowColumnRec, row_column.entry_class), XmRWidgetClass, (XtPointer) NULL }, { XmNrowColumnType, /* warning - non-standard resource */ XmCRowColumnType, XmRRowColumnType, sizeof(unsigned char), XtOffsetOf( struct _XmRowColumnRec, row_column.type), XmRImmediate, (XtPointer)XmWORK_AREA }, { XmNmenuHelpWidget, /* which widget is the help */ XmCMenuWidget, /* widget */ XmRMenuWidget, sizeof (Widget), XtOffsetOf( struct _XmRowColumnRec, row_column.help_pushbutton), XmRImmediate, (XtPointer)NULL }, { XmNlabelString, /* option menus have a label */ XmCXmString, XmRXmString, sizeof(XmString), XtOffsetOf( struct _XmRowColumnRec, row_column.option_label), XmRXmString, (XtPointer)NULL }, { XmNsubMenuId, /* option menus have built-in */ XmCMenuWidget, /* submenu */ XmRMenuWidget, sizeof (Widget), XtOffsetOf( struct _XmRowColumnRec, row_column.option_submenu), XmRImmediate, (XtPointer)NULL }, { XmNmenuHistory, /* pretend a subwidget fired */ XmCMenuWidget, /* off, used to pre-load the */ XmRMenuWidget, /* option menu and popup menu */ sizeof (Widget), /* mouse/muscle memory */ XtOffsetOf( struct _XmRowColumnRec, row_column.memory_subwidget), XmRImmediate, (XtPointer)NULL }, { XmNpopupEnabled, /* are accelerator enabled */ XmCPopupEnabled, /* in the popup menu? */ XmREnum, sizeof (XtEnum), XtOffsetOf( struct _XmRowColumnRec, row_column.popup_enabled), XmRImmediate, (XtPointer) 1 }, { XmNmenuAccelerator, /* popup menu accelerator */ XmCAccelerators, XmRString, sizeof (char *), XtOffsetOf( struct _XmRowColumnRec, row_column.menu_accelerator), XmRString, (XtPointer) "" }, { XmNmnemonic, /* option menu mnemonic */ XmCMnemonic, XmRKeySym, sizeof (KeySym), XtOffsetOf( struct _XmRowColumnRec, row_column.mnemonic), XmRImmediate, (XtPointer) XK_VoidSymbol }, { XmNmnemonicCharSet, XmCMnemonicCharSet, XmRString, sizeof(XmStringCharSet), XtOffsetOf( struct _XmRowColumnRec,row_column.mnemonicCharSet), XmRImmediate, (XtPointer) XmFONTLIST_DEFAULT_TAG }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmRowColumnRec, manager.shadow_thickness), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNpostFromList, XmCPostFromList, XmRWidgetList, sizeof (Widget *), XtOffsetOf( struct _XmRowColumnRec, row_column.postFromList), XmRWidgetList, (XtPointer) NULL, }, { XmNpostFromCount, XmCPostFromCount, XmRInt, sizeof (int), XtOffsetOf( struct _XmRowColumnRec, row_column.postFromCount), XmRImmediate, (XtPointer) -1 }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf( struct _XmManagerRec, manager.navigation_type), XmRImmediate, (XtPointer) XmDYNAMIC_DEFAULT_TAB_GROUP, }, { XmNentryVerticalAlignment, /* how entries are to be */ XmCVerticalAlignment, /* aligned */ XmRVerticalAlignment, sizeof(unsigned char), XtOffsetOf( struct _XmRowColumnRec, row_column.entry_vertical_alignment), XmRImmediate, (XtPointer)XmALIGNMENT_CENTER }, { XmNtearOffModel, XmCTearOffModel, XmRTearOffModel, sizeof(unsigned char), XtOffsetOf( struct _XmRowColumnRec, row_column.TearOffModel), XmRImmediate, (XtPointer)XmTEAR_OFF_DISABLED }, { XmNtearOffMenuActivateCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmRowColumnRec, row_column.tear_off_activated_callback), XmRCallback, NULL }, { XmNtearOffMenuDeactivateCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmRowColumnRec, row_column.tear_off_deactivated_callback), XmRCallback, NULL }, { XtNinsertPosition, XtCInsertPosition, XtRFunction, sizeof(XtOrderProc), XtOffsetOf(XmRowColumnWidgetRec, composite.insert_position), XtRImmediate, (XtPointer) InsertPosition }, { XmNtearOffTitle, XmCTearOffTitle, XmRXmString, sizeof (XmString), XtOffsetOf(XmRowColumnWidgetRec, row_column.tear_off_title), XmRString, (XtPointer) NULL }, }; static XtResource constraint_resources[] = { { XmNpositionIndex, XmCPositionIndex, XmRShort, sizeof(short), XtOffsetOf(XmRowColumnConstraintRec, row_column.position_index), XmRImmediate, (XtPointer) XmLAST_POSITION }, }; static XmSyntheticResource syn_resources[] = { { XmNmnemonicCharSet, sizeof(XmStringCharSet), XtOffsetOf( struct _XmRowColumnRec,row_column.mnemonicCharSet), GetMnemonicCharSet, NULL, }, { XmNmenuAccelerator, sizeof(char *), XtOffsetOf( struct _XmRowColumnRec, row_column.menu_accelerator), GetMenuAccelerator, NULL, }, { XmNmenuPost, sizeof(String), XtOffset(XmRowColumnWidget, row_column.menuPost), GetMenuPost, NULL, }, { XmNlabelString, /* option menus have a label */ sizeof(XmString), XtOffsetOf( struct _XmRowColumnRec, row_column.option_label), GetLabelString, NULL, }, { XmNspacing, sizeof(Dimension), XtOffsetOf( struct _XmRowColumnRec,row_column.spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf( struct _XmRowColumnRec, row_column.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels, }, { XmNmarginWidth, sizeof(Dimension), XtOffsetOf( struct _XmRowColumnRec, row_column.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNentryBorder, sizeof(Dimension), XtOffsetOf( struct _XmRowColumnRec, row_column.entry_border), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, { XmNtearOffTitle, sizeof(XmString), XtOffsetOf( struct _XmRowColumnRec, row_column.tear_off_title), GetTearOffTitle, NULL, }, }; /* * static initialization of the row column widget class record, must do * each field */ static XmBaseClassExtRec baseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ XmInheritSetValuesPrehook, /* set_values prehook */ InitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ XmInheritGetSecResData, /* getSecResData */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; static XmManagerClassExtRec managerClassExtRec = { NULL, NULLQUARK, XmManagerClassExtVersion, sizeof(XmManagerClassExtRec), TraversalChildren, /* traversal_children */ XmInheritObjectAtPointProc }; externaldef(xmrowcolumnclassrec) XmRowColumnClassRec xmRowColumnClassRec = { { /* core class record */ (WidgetClass)&xmManagerClassRec, /* superclass ptr */ "XmRowColumn", /* class_name */ sizeof (XmRowColumnRec), /* size of widget instance */ ClassInitialize, /* class init proc */ ClassPartInitialize, /* class part init */ FALSE, /* class is not init'ed */ Initialize, /* widget init proc*/ _XmRCColorHook, /* init_hook proc */ Realize, /* widget realize proc */ actions, /* class action table */ XtNumber (actions), resources, /* this class's resource list */ XtNumber (resources), /* " " resource_count */ NULLQUARK, /* xrm_class */ TRUE, /* don't compress motion */ XtExposeCompressMaximal, /* do compress exposure */ FALSE, /* don't compress enter-leave */ FALSE, /* no VisibilityNotify */ Destroy, /* class destroy proc */ Resize, /* class resize proc */ Redisplay, /* class expose proc */ SetValues, /* class set_value proc */ NULL, /* set_value_hook proc */ XtInheritSetValuesAlmost, /* set_value_almost proc */ NULL, /* get_values_hook */ NULL, /* class accept focus proc */ XtVersion, /* current version */ NULL, /* callback offset list */ NULL, /* translation table */ QueryGeometry, /* query geo proc */ NULL, /* display accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite class record */ GeometryManager, /* childrens geo mgr proc */ ChangeManaged, /* set changed proc */ InsertChild, /* add a child */ DeleteChild, /* remove a child */ NULL, /* extension */ }, { /* constraint class record */ constraint_resources, /* constraint resources */ XtNumber(constraint_resources), /* constraint resource_count */ sizeof(XmRowColumnConstraintRec), /* constraint_size */ ConstraintInitialize, /* initialize */ ConstraintDestroy, /* destroy */ ConstraintSetValues, /* set_values */ NULL, /* extension */ }, { /* manager class record */ XtInheritTranslations, /* translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* syn_constraint_resources */ 0, /* num_syn_constraint_resources */ XmInheritParentProcess, /* parent_process */ (XtPointer)&managerClassExtRec, /* extension */ }, { /* row column class record */ _XmRCMenuProcedureEntry, /* proc to interface with menu widgets */ _XmRCArmAndActivate, /* proc to arm&activate menu */ _XmMenuTraversalHandler, /* traversal handler */ NULL, /* extension */ } }; /* * now make a public symbol that points to this class record */ externaldef(xmrowcolumnwidgetclass) WidgetClass xmRowColumnWidgetClass = (WidgetClass) &xmRowColumnClassRec; /* * Destroy the widget, and any subwidgets there are */ static void Destroy( Widget w ) { XmRowColumnWidget m = (XmRowColumnWidget) w; Widget topManager; int i; if (RC_TornOff(m)) { if (!XmIsMenuShell(XtParent(m))) { _XmDestroyTearOffShell(XtParent(m)); /* See TearOff.c: Possible to destroy the tearoff * while its still up. It doesn't have to be dismissed * by the user as was assumed originally. * So if its destroyed, remove the callbacks as is * done in _XmDismissTearOff(). */ XtRemoveAllCallbacks ( m->row_column.tear_off_lastSelectToplevel, XmNdestroyCallback); /* Quick switch the parent for MenuShell's DeleteChild to work. * We're taking for granted that the Transient shell's deletechild * has already done everything it needs to do */ m->core.parent = RC_ParentShell(m); if (XmIsMenuShell(RC_ParentShell(m))) { XtWidgetProc delete_child; _XmProcessLock(); delete_child = ((CompositeWidgetClass) RC_ParentShell(m)->core.widget_class)-> composite_class.delete_child; _XmProcessUnlock(); (*delete_child)((Widget)m); } } else if (RC_ParentShell(m)) { _XmDestroyTearOffShell(RC_ParentShell(m)); } } if (RC_TearOffControl(m)) { XtDestroyWidget(RC_TearOffControl(m)); /* Unnecessary... RC_TearOffControl(new_w) = NULL; */ } /* * If we had added any event handlers for processing accelerators or * mnemonics, then we must remove them now. */ if (IsPopup(m)) { if (RC_PopupEnabled(m)) _XmRC_RemovePopupEventHandlers (m); /* If a timer is present, we're going to take for granted that the * pending grab belongs to this popup because no other popup can have * intervened during this grab. */ if (m->row_column.popup_workproc) { XtRemoveWorkProc(m->row_column.popup_workproc); /* Ungrab and reset the ButtonEventStatus record */ _XmRC_PostTimeOut( (XtPointer) m ); } /* Remove attach_widget destroy callbacks to update this popup's * postFromList */ for (i=0; i < m->row_column.postFromCount; i++) { if (! m->row_column.postFromList[i]->core.being_destroyed) { XtRemoveCallback(m->row_column.postFromList[i], XtNdestroyCallback, (XtCallbackProc)_XmRC_RemoveFromPostFromListOnDestroyCB, (XtPointer)m); } } } else if (IsOption(m) || IsBar(m)) { /* Remove it from the associated widget */ _XmRCGetTopManager ((Widget) m, &topManager); XtRemoveEventHandler(topManager, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, m); /* Remove it from us */ XtRemoveEventHandler( (Widget) m, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) m); } /* * If we're still connected to a cascade button, then we need to break * that link, so that the cascade button doesn't attempt to reference * us again, and also so that accelerators and mnemonics can be cleared up. */ else { Arg args[1]; for (i=m->row_column.postFromCount-1; i >= 0; i--) /* reverse order; side-effect below is to change list in _XmRC_RemoveFromPostFromList */ { XtSetArg (args[0], XmNsubMenuId, NULL); XtSetValues (m->row_column.postFromList[i], args, 1); } } if ((IsPopup(m) && RC_PopupEnabled(m)) || (IsBar(m) && RC_MenuAccelerator(m)) || (IsOption(m) && (RC_Mnemonic(m) != XK_VoidSymbol))) { Cardinal num_children; /* * By the time we reach here, our children are destroyed, but * the children's list is bogus; so we need to temporarily zero * out our num_children field, so _XmRC_DoProcessMenuTree() will not * attempt to process our children. */ num_children = m->composite.num_children; m->composite.num_children = 0; _XmRC_DoProcessMenuTree((Widget) m, XmDELETE); m->composite.num_children = num_children; } /* free postFromList for popups and pulldowns, zero postFromCount * Moved after DoProcessMenuTree() so RemoveFromKeyboardList() can * detect if this was a shared menupane. */ if (IsPopup(m) || IsPulldown(m)) { XtFree ( (char *) m->row_column.postFromList); m->row_column.postFromCount = 0; } /* After _XmRC_DoProcessMenuTree() so RemoveFromKeyboardList() works properly. */ XtFree((char *) MGR_KeyboardList(m)); /* Free menuPost string. */ if (!IsPulldown(m) && RC_MenuPost(m)) XtFree(RC_MenuPost(m)); /* Free accelerator string */ if ((IsPopup(m) && RC_MenuAccelerator(m)) || (IsBar(m) && RC_MenuAccelerator(m))) XtFree(RC_MenuAccelerator(m)); } /* * Destroy any keyboard grabs/entries for the child */ static void ConstraintDestroy( Widget w ) { if (!XtIsRectObj(w)) return; _XmRC_DoProcessMenuTree(w, XmDELETE); } /* * do all the stuff needed to make a subwidget of a menu work correctly */ static void FixWidget( XmRowColumnWidget m, Widget w ) { /* * now patchup the event binding table for the subwidget so that * it acts the way we want it to */ FixEventBindings (m, w); /* * and patch the visual aspects of the subwidget */ FixVisual (m, w); /* * and patch the callback list so that we will be called whenever * he fires off */ FixCallback (m, w); } static Cardinal InsertPosition(Widget w) { XmRowColumnWidget rc = (XmRowColumnWidget) XtParent(w); /* if a positionIndex has been specified and is a correct value, * use it as the new position for this child */ if (RCIndex(w) != XmLAST_POSITION) { if ((RCIndex(w) >= 0) && (RCIndex(w) <= rc->composite.num_children)) { return RCIndex(w) ; } } /* otherwise, return the default (we'll set its value in the instance field and reset the others index values for syblins at the end of InsertChild */ /* Note: the tearoffcontrol doesn't go thru this function, since InsertChild filter its case */ return rc->composite.num_children ; } /* * Add a child to this row column widget */ static void InsertChild( Widget w ) { XmRowColumnWidget m = (XmRowColumnWidget) XtParent(w); Widget *p ; int i ; /* Special case the hidden tear off control */ if (RC_FromInit(m)) { /* can't let XmLAST_POSITION in, this value is used in * geometry manager to denote a special case */ RCIndex(w) = 0 ; return; } if (!IsWorkArea(m) /* it's a menu */ && !(XmeTraitGet((XtPointer) XtClass(w), XmQTmenuSavvy) != NULL)) XmeWarning( (Widget) m, WrongMenuChildMsg); /* * if the rowcolumn is homogeneous, make sure that class matches * the entry class. Three exceptions are made: 1) if the entry class is * CascadeButton or CascadeButtonGadget, either of those classes are * allowed. 2) if the entry class is ToggleButton or ToggleButtonGadget, * either of those classes are allowed. 3) if the entry class is * PushButton or PushButtonGadget, either of those classes are allowed. */ if (XtIsRectObj(w) && RC_IsHomogeneous(m) && #ifdef FIX_1410 RC_EntryClass(m) && #endif (RC_EntryClass(m) != XtClass(w))) { /* CR 7807: using _XmIsFastSubclass checks is subtly wrong??? * If an application asks for a specific subclass of * XmToggleButtonWidget, then using plain XmToggleButtonGadget * children should generate warnings. But this is a very rare * condition, so we'll ignore it unless someone complains. The * benefit of not linking in all the other widgets is significant. */ if (!((_XmIsFastSubclass(RC_EntryClass(m), XmCASCADE_BUTTON_BIT) && XmIsCascadeButtonGadget(w)) || (_XmIsFastSubclass(RC_EntryClass(m), XmCASCADE_BUTTON_GADGET_BIT) && XmIsCascadeButton(w)) || (_XmIsFastSubclass(RC_EntryClass(m), XmTOGGLE_BUTTON_BIT) && XmIsToggleButtonGadget(w)) || (_XmIsFastSubclass(RC_EntryClass(m), XmTOGGLE_BUTTON_GADGET_BIT) && XmIsToggleButton(w)) || (_XmIsFastSubclass(RC_EntryClass(m), XmPUSH_BUTTON_BIT) && XmIsPushButtonGadget(w)) || (_XmIsFastSubclass(RC_EntryClass(m), XmPUSH_BUTTON_GADGET_BIT) && XmIsPushButton(w)))) { XmeWarning( (Widget) m, WrongChildMsg); } } /* * use composite class insert proc to do all the dirty work */ { XtWidgetProc insert_child; _XmProcessLock(); insert_child = ((XmManagerWidgetClass)xmManagerWidgetClass)-> composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(w); } /* * now change the subwidget so that it acts the way we want it to */ FixWidget (m, w); /* * re-set the correct positionIndex values for everybody if * the new kid has been inserted in the list instead of put at the end */ if( RCIndex( w) == XmLAST_POSITION ) { RCIndex( w) = m->composite.num_children - 1 ; } if (RCIndex(w) != (m->composite.num_children - 1)) { i = RCIndex( w) ; p = m->composite.children + i ; while( ++i < m->composite.num_children ) { ++p ; RCIndex(*p) = i ; } } /* * if in a torn off menu pane, then add the event handlers for tear offs */ if (RC_TornOff(m) && !XmIsMenuShell(XtParent(m))) _XmAddTearOffEventHandlers ((Widget) m); /* * Fix for CR 5401 - If the RowColumn is a radiobox, check to see if the * menu history has been set. If it has, the user has * forced this selection or another child has already been * managed. If not, then this is the first managed child * and it should be loaded into the menu history. */ if (IsRadio(m) && (RC_MemWidget(m) == (Widget) NULL)) RC_MemWidget(m) = w; return; } /* * "child" is no longer a valid memory widget (menu history). We must * reset any option menus who are currently referring it. A recursive * search up the widget tree is necessary in case shared menupanes are * utilized. */ static void ResetMatchingOptionMemWidget( XmRowColumnWidget menu, Widget child ) { int i; if (IsPulldown(menu)) { for (i=0; i < menu->row_column.postFromCount; i++) { ResetMatchingOptionMemWidget( (XmRowColumnWidget) XtParent(menu->row_column.postFromList[i]), child); } } else if (IsOption(menu) && (child == RC_MemWidget(menu))) { Widget cb; /* Fix CR 7609 */ if (RC_OptionSubMenu(menu) && RC_MemWidget(RC_OptionSubMenu(menu))) { RC_MemWidget(menu) = RC_MemWidget(RC_OptionSubMenu(menu)); } else { RC_MemWidget(menu) = FindFirstManagedChild((CompositeWidget) RC_OptionSubMenu(menu), True); /* For what it's worth - nothing in SharedMenupanes */ if (RC_OptionSubMenu(menu)) RC_MemWidget(RC_OptionSubMenu(menu)) = RC_MemWidget(menu); } if ((cb = XmOptionButtonGadget( (Widget) menu)) != NULL) _XmRC_UpdateOptionMenuCBG (cb, RC_MemWidget(menu)); } } /* * delete a single widget from a parent widget */ static void DeleteChild( Widget child ) { XmRowColumnWidget m = (XmRowColumnWidget) XtParent(child); Widget *p ; int i ; /* Fix CR 7982, tear off control not in child list, so ignore */ if (child == RC_TearOffControl(m) ) return; if (child == RC_HelpPb (m)) RC_HelpPb (m) = NULL; else if (child == RC_MemWidget(m)) RC_MemWidget(m) = NULL; /* * If this child is in a top level menupane, then we want to remove * the event handler we added for catching keyboard input. */ if (XtIsWidget(child) && ((IsPopup(m) || IsBar(m) || IsPulldown(m)) && XmIsLabel(child) && (child->core.widget_class != xmLabelWidgetClass))) { XtRemoveEventHandler(child, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, m); } /* * use composite class delete proc to do all the dirty work */ { XtWidgetProc delete_child; _XmProcessLock(); delete_child = ((CompositeWidgetClass)compositeWidgetClass)-> composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child); } /* * Re-set the correct positionIndex values for everybody if * the new kid was not deleted from the end of the list. * Composite class delete_child has already decremented num_chidren! */ if (RCIndex(child) != m->composite.num_children) ForAllChildren (m, i, p) { RCIndex(*p) = i ; } /* If this child is any option menu's menu history, reset * that option menu's menu history. */ ResetMatchingOptionMemWidget(m, child); } /* * The set of our managed children changed, so maybe change the size of the * row column widget to fit them; there is no instigator of this change, and * ignore any dimensional misfit of the row column widget and the entries, * which is a result of our geometry mgr being nasty. Get it laid out. */ static void ChangeManaged( Widget wid ) { XmRowColumnWidget m = (XmRowColumnWidget) wid ; Widget *q; int i; Dimension w = 0; Dimension h = 0; Boolean any_changed = FALSE; /* * We have to manage the "was_managed" field of the * constraint record. */ ForAllChildren(m, i, q) { if (WasManaged(*q) != IsManaged(*q)) { _XmRC_ProcessSingleWidget(*q, IsManaged(*q) ? XmADD: XmDELETE); any_changed = TRUE; } WasManaged(*q) = IsManaged(*q); } if (RC_TearOffControl(m)) { if (WasManaged(RC_TearOffControl(m)) != IsManaged(RC_TearOffControl(m))) any_changed = TRUE; WasManaged(RC_TearOffControl(m)) = IsManaged(RC_TearOffControl(m)); } if (!any_changed) { /* Must have been a popup child -- we don't really care */ return; } if ((PackColumn(m) && (IsVertical(m) || IsHorizontal(m))) || (PackTight(m) && IsHorizontal(m))) { ForManagedChildren(m, i, q) { if (XmIsGadget(*q) || XmIsPrimitive(*q)) { XmBaselineMargins textMargins; textMargins.margin_top = SavedMarginTop(*q); textMargins.margin_bottom = SavedMarginBottom(*q); _XmRC_SetOrGetTextMargins(*q, XmBASELINE_SET, &textMargins); } } } _XmRCDoMarginAdjustment (m); /* * find out what size we need to be with the current set of kids */ _XmRCPreferredSize (m, &w, &h); /* * now decide if the menu needs to change size */ if ((w != XtWidth (m)) || (h != XtHeight (m))) { XtWidgetGeometry menu_desired; menu_desired.request_mode = 0; if (w != XtWidth (m)) { menu_desired.width = w; menu_desired.request_mode |= CWWidth; } if (h != XtHeight (m)) { menu_desired.height = h; menu_desired.request_mode |= CWHeight; } /* use a function that always accepts Almost */ _XmMakeGeometryRequest( (Widget) m, &menu_desired); } /* * if we get to here the row column widget has been changed and his * window has been resized, so effectively we need to do a Resize. */ _XmRCAdaptToSize (m, NULL, NULL); /* Clear shadow if necessary. */ if (m->row_column.old_shadow_thickness) _XmClearShadowType( (Widget) m, m->row_column.old_width, m->row_column.old_height, m->row_column.old_shadow_thickness, 0); /* and redraw it for shrinking size */ if (XtIsRealized ((Widget)m) && m->manager.shadow_thickness ) XmeDrawShadows (XtDisplay (m), XtWindow (m), m->manager.top_shadow_GC, m->manager.bottom_shadow_GC, 0, 0, m->core.width, m->core.height, m->manager.shadow_thickness, XmSHADOW_OUT); m->row_column.old_width = m->core.width; m->row_column.old_height = m->core.height; m->row_column.old_shadow_thickness = m->manager.shadow_thickness; XmeNavigChangeManaged( (Widget) m); } /* * make the row column widget appear */ static void Realize( Widget wid, XtValueMask *window_mask, XSetWindowAttributes *window_attributes ) { XmRowColumnWidget m = (XmRowColumnWidget) wid ; if (IsOption(m)) { XmRowColumnWidget sm = (XmRowColumnWidget) RC_OptionSubMenu(m); Dimension w=0, h=0; if (!IsNull(sm)) { if (RC_MemWidget(m)) { Widget cb; /* Set the Option Menu's Cascade Button */ if ((cb = XmOptionButtonGadget( (Widget) m)) != NULL) _XmRC_UpdateOptionMenuCBG (cb, RC_MemWidget(m)); } else /* if there is no memory widget, set it up */ ResetMatchingOptionMemWidget(m, NULL); /* find out what size we need to be */ _XmRCPreferredSize (m, &w, &h); /* now decide if the menu needs to change size */ if ((w != XtWidth (m)) || (h != XtHeight (m))) { XtWidgetGeometry menu_desired; menu_desired.request_mode = 0; if (w != XtWidth (m)) { menu_desired.width = w; menu_desired.request_mode |= CWWidth; } if (h != XtHeight (m)) { menu_desired.height = h; menu_desired.request_mode |= CWHeight; } /* use a function that always accepts Almost */ _XmMakeGeometryRequest( (Widget) m, &menu_desired); } _XmRCAdaptToSize (m, NULL, NULL); } } /* fix menu window so that any button down is OwnerEvent true. */ if (!IsWorkArea(m)) { /* * Originally, we simply set the OwnerGrabButtonMask in our * event mask. Unfortunately, if the application ever modifies * our translations or adds an event handler which caused the * intrinsics to regenerate our X event mask, this bit was * lost. So .. we add a dummy event handler for this mask bit, * thus guaranteeing that it is always part of our event mask. */ window_attributes->event_mask |= OwnerGrabButtonMask; XtAddEventHandler( (Widget) m, OwnerGrabButtonMask, False, EventNoop, NULL); } /* * Don't propagate events for row column widgets * and set bit gravity to NW */ (*window_mask) |= CWDontPropagate | CWBitGravity; window_attributes->bit_gravity = NorthWestGravity; window_attributes->do_not_propagate_mask = ButtonPressMask| ButtonReleaseMask|KeyPressMask|KeyReleaseMask|PointerMotionMask; XtCreateWindow ( (Widget) m, InputOutput, CopyFromParent, *window_mask, window_attributes); /* * Keep menus which are a child of shell widgets mapped at all times. * Mapping is now done by the menu shell widget. */ if (XmIsMenuShell (XtParent(m))) m->core.mapped_when_managed = FALSE; if (RC_TearOffControl(m)) { if (!XtIsRealized(RC_TearOffControl(m))) XtRealizeWidget(RC_TearOffControl(m)); XtMapWidget(RC_TearOffControl(m)); } } /* * utilities for setvalue procs */ static Boolean DoEntryStuff( XmRowColumnWidget old, XmRowColumnWidget new_w ) { XtWidgetGeometry desired; Boolean need_expose = FALSE; if (RC_EntryBorder (old) != RC_EntryBorder (new_w)) { Widget *p; int i; desired.request_mode = CWBorderWidth; desired.border_width = RC_EntryBorder (new_w); ForAllChildren (new_w, i, p) { /* fix for 7660, setting entryborder before realize time has the width and height moved from 0 to 1, a side-effect of XmeConfigureObject, and then the widget loses its preferred geometry. A better fix might be to remove the check for 0 in XmeConfigureObject, but this might be a behavior compatibility issue */ if (XtIsRealized(*p)) XmeConfigureObject( *p,(*p)->core.x,(*p)->core.y, (*p)->core.width, (*p)->core.height, desired.border_width); else (*p)->core.border_width = desired.border_width; } need_expose = TRUE; } if ((RC_EntryAlignment (old) != RC_EntryAlignment (new_w)) && (IsAligned (new_w)) && (!IsOption(new_w))) { Widget *p; Arg al[2]; int i; XtSetArg (al[0], XmNalignment, RC_EntryAlignment(new_w)); ForAllChildren (new_w, i, p) { XtSetValues (*p, al, 1); } need_expose = TRUE; } if ((RC_EntryVerticalAlignment (old) != RC_EntryVerticalAlignment (new_w)) && (!IsOption(new_w))) need_expose = TRUE; return (need_expose); } static void DoSize( XmRowColumnWidget old, XmRowColumnWidget new_w ) { Widget *p; int i; int orient = RC_Orientation (old) != RC_Orientation (new_w); Dimension w; Dimension h; if (orient) /* flip all the separator */ { /* widgets too */ Arg al[2]; int ac = 0; XtSetArg (al[ac], XmNorientation, (IsVertical (new_w) ? XmHORIZONTAL : XmVERTICAL)); ForAllChildren (new_w, i, p) { if (XmIsSeparator(*p) || XmIsSeparatorGadget(*p)) XtSetValues (*p, al, 1); } } if ((!XtWidth(new_w)) || (XtWidth (new_w) != XtWidth(old)) || (!XtHeight(new_w)) || (XtHeight (new_w) != XtHeight(old)) || (orient || ((IsPopup(new_w) || IsPulldown(new_w) || IsBar(new_w)) && (MGR_ShadowThickness(new_w) != MGR_ShadowThickness(old))) || (RC_EntryBorder (old) != RC_EntryBorder (new_w)) || (RC_MarginW (old) != RC_MarginW (new_w)) || (RC_MarginH (old) != RC_MarginH (new_w)) || (RC_Spacing (old) != RC_Spacing (new_w)) || (RC_Packing (old) != RC_Packing (new_w)) || (RC_NCol (old) != RC_NCol (new_w)) || (RC_AdjLast (old) != RC_AdjLast (new_w)) || (RC_AdjMargin (old) != RC_AdjMargin (new_w)) || (RC_EntryVerticalAlignment(old) != RC_EntryVerticalAlignment(new_w)) || (RC_HelpPb (old) != RC_HelpPb (new_w)))) { if (RC_AdjMargin(old) != RC_AdjMargin (new_w)) _XmRCDoMarginAdjustment(new_w); if (!RC_ResizeWidth(new_w) && RC_ResizeHeight(new_w)) { w = new_w->core.width; h = 0; } else if (RC_ResizeWidth(new_w) && !RC_ResizeHeight(new_w)) { w = 0; h = new_w->core.height; } else if (RC_ResizeWidth(new_w) && RC_ResizeHeight(new_w)) { w = 0; h = 0; } else { _XmRCAdaptToSize(new_w,NULL,NULL); return; } _XmRCPreferredSize (new_w, &w, &h); XtWidth(new_w) = w; XtHeight(new_w) = h; _XmRCAdaptToSize(new_w,NULL,NULL); } } static Boolean set_values_non_popup( XmRowColumnWidget old, XmRowColumnWidget new_w ) { Widget child; Arg args[4]; int n; Boolean need_expose = FALSE; /* fdt : should this only be done for a menubar?? */ need_expose |= RC_HelpPb (old) != RC_HelpPb (new_w); /* * If we are an option menu, then we must check to see if our mnemonic * has changed. If we're a menubar, then see if our accelerator has * changed. */ if (IsOption(new_w)) { if (RC_OptionSubMenu(new_w) != RC_OptionSubMenu(old)) { _XmRC_CheckAndSetOptionCascade(new_w); /* CR 4346 */ XtSetArg(args[0], XmNsubMenuId, RC_OptionSubMenu(new_w)); if ((child = XmOptionButtonGadget( (Widget) new_w)) != NULL) XtSetValues(child, args, 1); if (!RC_MemWidget(new_w) || (RC_MemWidget(old) == RC_MemWidget(new_w))) { if ((child = FindFirstManagedChild( (CompositeWidget) RC_OptionSubMenu(new_w), FIRST_BUTTON)) != NULL) { RC_MemWidget (new_w) = child; } } } if (RC_MemWidget (old) != RC_MemWidget (new_w)) { _XmRC_SetOptionMenuHistory (new_w, (RectObj) RC_MemWidget (new_w)); _XmRC_UpdateOptionMenuCBG (XmOptionButtonGadget((Widget)new_w), RC_MemWidget (new_w)); } n = 0; if (RC_OptionLabel(new_w) != RC_OptionLabel(old)) { XtSetArg(args[n], XmNlabelString, RC_OptionLabel(new_w)); n++; XtSetArg(args[n], XmNlabelType, XmSTRING); n++; } if (RC_MnemonicCharSet(new_w) != RC_MnemonicCharSet(old)) { XtSetArg(args[n], XmNmnemonicCharSet, RC_MnemonicCharSet(new_w)); n++; } if (n && (child = XmOptionLabelGadget( (Widget) new_w))) XtSetValues(child, args, n); _XmRC_DoProcessMenuTree((Widget) new_w, XmREPLACE); } else if (IsBar(new_w) && (RC_MenuAccelerator(new_w) != RC_MenuAccelerator(old))) { if (RC_MenuAccelerator(new_w)) { RC_MenuAccelerator(new_w) = (String)strcpy(XtMalloc( XmStrlen( RC_MenuAccelerator(new_w)) + 1), RC_MenuAccelerator(new_w)); } _XmRC_DoProcessMenuTree((Widget) new_w, XmREPLACE); if (RC_MenuAccelerator(old)) XtFree(RC_MenuAccelerator(old)); } /* * Moved here in case Option Menu geometry changed */ need_expose |= DoEntryStuff (old, new_w); DoSize (old, new_w); return (need_expose); } static Boolean set_values_popup( XmRowColumnWidget old, XmRowColumnWidget new_w ) { int need_expose = FALSE; Arg args[4]; int n = 0; need_expose |= DoEntryStuff (old, new_w); DoSize (old, new_w); if ((XtX (old) != XtX (new_w)) || /* signal the shell that it */ (XtY (old) != XtY (new_w))) /* had better move itself */ { /* to the menu's location */ RC_SetWidgetMoved (new_w, TRUE); /* and that it has to move */ RC_SetWindowMoved (new_w, TRUE); /* the menu's window back */ } /* * If we are a popup menu, then we need to check the * state of the popupEnabled resource; we may need to add or remove the * event handler we use to catch accelerators and mnemonics. */ if (IsPopup(new_w)) { if (RC_PopupEnabled(new_w) != RC_PopupEnabled(old)) { if (RC_PopupEnabled(new_w)) { /* If this was enabled before with a different value, then first remove the popup handlers, then reinstall */ if (RC_PopupEnabled(old) != XmPOPUP_DISABLED) _XmRC_RemovePopupEventHandlers(new_w); /* Now reinstall */ _XmRC_AddPopupEventHandlers(new_w); _XmRC_DoProcessMenuTree( (Widget) new_w, XmADD); } else { _XmRC_RemovePopupEventHandlers (new_w); _XmRC_DoProcessMenuTree( (Widget) new_w, XmDELETE); } } /* See if our accelerator has changed */ if (RC_MenuAccelerator(new_w) != RC_MenuAccelerator(old)) { if (RC_MenuAccelerator(new_w)) { RC_MenuAccelerator(new_w) = (String)strcpy(XtMalloc( XmStrlen( RC_MenuAccelerator(new_w)) + 1), RC_MenuAccelerator(new_w)); } if (RC_PopupEnabled(new_w)) _XmRC_DoProcessMenuTree( (Widget) new_w, XmREPLACE); if (RC_MenuAccelerator(old)) XtFree(RC_MenuAccelerator(old)); } } /* For both pulldowns and popups */ if (RC_TearOffModel(old) != RC_TearOffModel(new_w)) { if ((RC_TearOffModel(new_w) != XmTEAR_OFF_DISABLED) && !RC_TearOffControl(new_w)) { XmTearOffButtonWidget tw; /* prevent RowColumn: InsertChild() from inserting tear off button * into child list. */ RC_SetFromInit(new_w, TRUE); tw = (XmTearOffButtonWidget) XtCreateWidget(TEAROFF_CONTROL, xmTearOffButtonWidgetClass, (Widget)new_w, args, n); RC_TearOffControl(new_w) = (Widget) tw; RC_SetFromInit(new_w, FALSE); /* Catching this bogus case is rediculous, but still, who knows * what the app developer from DSU will do? * So, like the Init method, we'll put off realize/manage until * later (RowColumn.c: Realize()) if the submenu isn't realized. * * If the menu is tear_off_activated, then you better not manage * the tear off control or it shows up in the tear off menu! */ if (XmIsMenuShell(XtParent(new_w))) { if (XtIsRealized((Widget)new_w)) { XtRealizeWidget(RC_TearOffControl(new_w)); XtManageChild(RC_TearOffControl(new_w)); } else RC_TearOffControl(new_w)->core.managed = TRUE; } } else if ((RC_TearOffModel(new_w) == XmTEAR_OFF_DISABLED) && RC_TearOffControl(new_w)) { XtUnmanageChild(RC_TearOffControl(new_w)); /* otherwise ChangeManaged is too clever and doesn't catch change if tear-off goes away */ XtDestroyWidget(RC_TearOffControl(new_w)); RC_TearOffControl(new_w) = NULL; /* If the model has changed while the tear-off is visible, take ** it down. For consistency with other non-interactive forms ** of takedown (DELETE messages and destruction), use the common ** routine, which results in application callbacks to e.g. ** XmNtearOffMenuDeactivateCallback (with a NULL event). */ if(RC_TornOff(new_w)) _XmDismissTearOff(XtParent(new_w), NULL, NULL); } } if ((old->core.background_pixel != new_w->core.background_pixel) && RC_TearOffControl(new_w)) { XtSetArg(args[0], XmNbackground, new_w->core.background_pixel); XtSetValues(RC_TearOffControl(new_w), args, 1); } /* Update title if menu torn off */ if ((RC_TearOffTitle(new_w) != RC_TearOffTitle(old)) && RC_TornOff(old)) { XmeSetWMShellTitle(RC_TearOffTitle(new_w), (Widget) XtParent(new_w)); } return (need_expose); } static void set_values_passive_grab( XmRowColumnWidget old, XmRowColumnWidget new_w ) { int i; Cursor cursor; if (IsPopup(old)) { /* Keep our passive grab up to date. */ if (RC_PopupEnabled(old)) { /* Remove it from the postFrom widgets */ for (i=0; i < old->row_column.postFromCount; i++) { /* Remove our passive grab */ XtUngrabButton (old->row_column.postFromList[i], RC_PostButton(old), RC_PostModifiers(old)); } if (RC_PopupEnabled(new_w)) { cursor = _XmGetMenuCursorByScreen(XtScreen(new_w)); /* add to all of the widgets in the postFromList*/ for (i=0; i < new_w->row_column.postFromCount; i++) { /* * Must add a passive grab, so that owner_events is * set to True when the button grab is activated * this is so that enter/leave * events get dispatched by the server to the client. */ XtGrabButton (new_w->row_column.postFromList[i], RC_PostButton(new_w), RC_PostModifiers(new_w), TRUE, (unsigned int) ButtonReleaseMask, GrabModeSync, GrabModeSync, None, cursor); } } } } } /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmRowColumnWidget old = (XmRowColumnWidget) cw ; XmRowColumnWidget req = (XmRowColumnWidget) rw ; XmRowColumnWidget new_w = (XmRowColumnWidget) nw ; int i; int need_expose = FALSE; if (!XtWidth(req)) { XmeWarning( (Widget) new_w, BadWidthSVMsg); XtWidth(new_w) = XtWidth(old); } if (!XtHeight(req)) { XmeWarning( (Widget) new_w, BadHeightSVMsg); XtHeight(new_w) = XtHeight(old); } if (!XmRepTypeValidValue( XmRID_ORIENTATION, RC_Orientation(new_w), (Widget)new_w)) { RC_Orientation(new_w) = RC_Orientation(old); } if (!XmRepTypeValidValue( XmRID_PACKING, RC_Packing(new_w), (Widget)new_w)) { RC_Packing(new_w) = RC_Packing(old); } if (RC_Type(req) != RC_Type(old)) { /* Type CANNOT be changed after initialization */ XmeWarning( (Widget) new_w, BadTypeSVMsg); RC_Type(new_w) = RC_Type(old); } if (!XmRepTypeValidValue( XmRID_ALIGNMENT, RC_EntryAlignment(new_w), (Widget)new_w)) { RC_EntryAlignment(new_w) = RC_EntryAlignment(old); } if (!XmRepTypeValidValue( XmRID_VERTICAL_ALIGNMENT, RC_EntryVerticalAlignment(new_w), (Widget)new_w)) { RC_EntryVerticalAlignment(new_w) = RC_EntryVerticalAlignment(old); } if (IsBar(new_w)) { if (RC_IsHomogeneous(req) != RC_IsHomogeneous(old)) { /* can't change this for menu bars */ XmeWarning( (Widget) new_w, BadMenuBarHomogenousSVMsg); RC_IsHomogeneous(new_w) = TRUE; } if (RC_EntryClass(req) != RC_EntryClass(old)) { /* can't change this for menu bars */ XmeWarning( (Widget) new_w, BadMenuBarEntryClassSVMsg); RC_EntryClass(new_w) = xmCascadeButtonWidgetClass; } } /* CR 7807: Make sure the EntryClass's fast subclass bits are set. */ if (RC_EntryClass(req) != RC_EntryClass(old)) XtInitializeWidgetClass(RC_EntryClass(req)); if (RC_MenuPost(new_w) != RC_MenuPost(old)) { if (IsPulldown(new_w)) { /* MenuPost cannot be changed via SetValues for Pulldowns */ XmeWarning( (Widget) new_w, BadPulldownMenuPostSVMsg); /* just in case WhichButton was set */ RC_PostButton(new_w) = RC_PostButton(old); } else { if (_XmMapBtnEvent(RC_MenuPost(new_w), &RC_PostEventType(new_w), &RC_PostButton(new_w), &RC_PostModifiers(new_w)) == FALSE) { XmeWarning( (Widget) new_w, BadMenuPostMsg); /* Do Nothing - No change to postButton/Modifiers/EventType */ } else if (RC_MenuPost(new_w)) RC_MenuPost(new_w) = XtNewString(RC_MenuPost(new_w)); set_values_passive_grab(old, new_w); if (RC_MenuPost(old)) XtFree(RC_MenuPost(old)); } } else /* For backwards compatibility... */ if (RC_PostButton(new_w) != RC_PostButton(old)) { if (IsPulldown(new_w)) { /* WhichButton cannot be changed via SetValues for Pulldowns */ XmeWarning( (Widget) new_w, BadPulldownWhichButtonSVMsg); RC_PostButton(new_w) = RC_PostButton(old); } else { RC_PostModifiers(new_w) = AnyModifier; RC_PostEventType(new_w) = ButtonPress; set_values_passive_grab(old, new_w); } } /* * Shadow thickness is forced to zero for all types except * pulldown, popup, and menubar */ if (IsPulldown(new_w) || IsPopup(new_w) || IsBar(new_w)) { if (MGR_ShadowThickness(req) != MGR_ShadowThickness(old)) need_expose |= TRUE; } else if (MGR_ShadowThickness(req) != MGR_ShadowThickness(old)) { XmeWarning( (Widget) new_w, BadShadowThicknessSVMsg); MGR_ShadowThickness(new_w) = 0; } /* BEGIN OSF fix pir 2429 */ if (IsOption(new_w) && (RC_IsHomogeneous(req) != RC_IsHomogeneous(old))) { XmeWarning((Widget)new_w, BadOptionIsHomogeneousSVMsg); RC_IsHomogeneous(new_w) = FALSE; } /* END OSF fix pir 2429 */ /* postFromList changes, popups and pulldowns only */ if (IsPopup(new_w) || IsPulldown(new_w)) { if ((new_w->row_column.postFromList != old->row_column.postFromList) || (new_w->row_column.postFromCount != old->row_column.postFromCount)) { /* use temp - postFromCount decremented in RemoveFromPostFromList() */ int cnt; if (old->row_column.postFromList) { cnt = old->row_column.postFromCount; for (i=0; i < cnt; i++) { _XmRC_RemoveHandlersFromPostFromWidget((Widget) new_w, old->row_column.postFromList[i]); } XtFree( (char *) old->row_column.postFromList); } PreparePostFromList(new_w); } } /* Copy new value, free old value, update real title in set_values_popup */ if ((RC_TearOffTitle(new_w) != RC_TearOffTitle(old))) { XmStringFree(RC_TearOffTitle(old)); RC_TearOffTitle(new_w) = XmStringCopy(RC_TearOffTitle(new_w)); } if (IsBar (new_w) || IsWorkArea (new_w) || IsOption (new_w)) need_expose |= set_values_non_popup (old, new_w); else need_expose |= set_values_popup (old, new_w); return (need_expose); } /************************************************************************ * * QueryGeometry * ************************************************************************/ static XtGeometryResult QueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) { XmRowColumnWidget m = (XmRowColumnWidget) widget ; Dimension width = 0, height = 0 ; /* first determine what is the desired size, using the resizeWidth and resizeHeight resource and the intended value */ if (GMode(intended) & CWWidth) width = intended->width; if (GMode(intended) & CWHeight) height = intended->height; if (!RC_ResizeWidth(m)) width = XtWidth(widget) ; if (!RC_ResizeHeight(m)) height = XtHeight(widget) ; _XmRCPreferredSize (m, &width, &height); desired->width = width ; desired->height = height ; /* deal with user initial size setting */ /**************** Comment that out for now, too fragile... if (!XtIsRealized(widget)) { if (XtWidth(widget) != 0) desired->width = XtWidth(widget) ; if (XtHeight(widget) != 0) desired->height = XtHeight(widget) ; } ****************/ return XmeReplyToQueryGeometry(widget, intended, desired) ; } /************************************************************************ * * GeometryManager class method * ************************************************************************/ static XtGeometryResult GeometryManager( Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { XmRowColumnWidget m = (XmRowColumnWidget) XtParent(instigator); Dimension w = 0; Dimension h = 0; XtGeometryResult result = XtGeometryYes; /* First treat the special case resulting from a change in positionIndex */ if (RCIndex(instigator) == XmLAST_POSITION) { /* set in ConstraintSetValues */ int i ; /* first reset the value of positionIndex to its real value */ for (i = 0 ; i < m->composite.num_children; i++) if (m->composite.children[i] == instigator) { RCIndex(instigator) = i ; break ; } /* then accept the desired change */ if (IsX(desired) && desired->x >= 0) instigator->core.x = desired->x; if (IsY(desired) && desired->y >= 0) instigator->core.y = desired->y; if (IsHeight(desired) && desired->height > 0) instigator->core.height = desired->height; if (IsWidth(desired) && desired->width > 0) instigator->core.width = desired->width; return XtGeometryYes; } /* * find out what size we need to be with this new widget */ RC_Boxes(m) = (XmRCKidGeometry) _XmRCGetKidGeo( (Widget) m, instigator, desired, RC_EntryBorder(m), RC_EntryBorder (m), (IsVertical (m) && RC_DoMarginAdjust (m)), (IsHorizontal (m) && RC_DoMarginAdjust (m)), RC_HelpPb (m), RC_TearOffControl(m), XmGET_PREFERRED_SIZE); _XmRCThinkAboutSize(m, &w, &h, instigator, desired); if (IsOption(m)) { XmRCKidGeometry kg; Widget omcb = XmOptionButtonGadget((Widget)m); Widget oml = XmOptionLabelGadget((Widget)m); /* _XmRCGetKidGeo() does not allocate a geometry box for unmanaged * children. */ for(kg=RC_Boxes(m); (kg->kid != NULL) && (kg->kid != omcb); kg++) /*EMPTY*/; if (kg->kid && (instigator == omcb)) { /* * Fix for 5388 - Check to see if the OptionLabel is Managed. * If it is base comparisons off of RC_Boxes(m)[1]. * If not, base comparisons off of RC_Boxes(m)[0] */ XtWidgetGeometry *button_box; if (!XtIsManaged(XmOptionLabelGadget( (Widget) m))) { button_box = &(RC_Boxes(m)[0].box); } else { button_box = &(RC_Boxes(m)[1].box); } /* * Grow only */ if ((desired->request_mode & CWWidth) && (desired->width < BWidth(button_box))) { allowed->width = BWidth(button_box); allowed->height = BHeight(button_box); allowed->request_mode = (CWHeight | CWWidth); result = XtGeometryAlmost; } if ((desired->request_mode & CWHeight) && (desired->height < BHeight(button_box))) { allowed->width = BWidth(button_box); allowed->height = BHeight(button_box); allowed->request_mode = (CWHeight | CWWidth); result = XtGeometryAlmost; } if (result != XtGeometryYes) { XtFree( (char *) RC_Boxes(m)); return(result); } } for(kg=RC_Boxes(m); (kg->kid != NULL) && (kg->kid != oml); kg++) /*EMPTY*/; if (kg->kid && (instigator == oml)) { /* * Can't get shorter */ if ((desired->request_mode & CWHeight) && (desired->height < kg->box.height)) { allowed->width = kg->box.width; allowed->height = kg->box.height; allowed->request_mode = (CWHeight | CWWidth); result = XtGeometryAlmost; } if (result != XtGeometryYes) { XtFree( (char *) RC_Boxes(m)); return(result); } } } /* * now decide if the menu needs to change size. */ XtFree( (char *) RC_Boxes(m)); if ((w != XtWidth (m)) || (h != XtHeight (m))) { XtWidgetGeometry menu_desired, menu_allowed; menu_desired.request_mode = 0; if (w != XtWidth (m)) { menu_desired.width = w; menu_desired.request_mode |= CWWidth; } if (h != XtHeight (m)) { menu_desired.height = h; menu_desired.request_mode |= CWHeight; } /* Check for the query only bit. */ if (desired->request_mode & XtCWQueryOnly) menu_desired.request_mode |= XtCWQueryOnly; result = XtMakeGeometryRequest( (Widget) m,&menu_desired,&menu_allowed); switch (result) { case XtGeometryAlmost: case XtGeometryNo: /* * Fix 5579 - If XtGeometryNo is returned, but the requested height and the * requested width are less that the current, allow the children * to shrink if they want to while maintaining our own size. */ #ifdef FIX_1474 if (((XtWidth(m) < w) && desired->request_mode & CWWidth) \ || ((XtHeight(m) < h) && desired->request_mode & CWHeight)) #else if ((XtWidth(m) < w) || (XtHeight(m) < h)) #endif return (XtGeometryNo); break; default: /* fall out */ break; } } /* Check for the query only bit. */ if (!(desired->request_mode & XtCWQueryOnly)) { _XmRCAdaptToSize(m,instigator,desired); /* Clear shadow if necessary. */ if (m->row_column.old_shadow_thickness && ( (m->row_column.old_width != m->core.width) ||(m->row_column.old_height != m->core.height) ||(m->row_column.old_shadow_thickness != m->manager.shadow_thickness) ) ) _XmClearShadowType( (Widget) m, m->row_column.old_width, m->row_column.old_height, m->row_column.old_shadow_thickness, 0); m->row_column.old_width = m->core.width; m->row_column.old_height = m->core.height; m->row_column.old_shadow_thickness = m->manager.shadow_thickness; } return (XtGeometryYes); } static char * GetRealKey( XmRowColumnWidget rc, char *str ) { KeySym keysym; Modifiers mods; char buf[1000]; char *tmp = buf; char *ks; int num_keys; XmKeyBinding keys; keysym = XStringToKeysym(str); if (keysym == NoSymbol) return(NULL); *tmp = '\0'; num_keys = XmeVirtualToActualKeysyms(XtDisplay(rc), keysym, &keys); while (--num_keys >= 0) if ((ks = XKeysymToString(keys[num_keys].keysym)) != NULL) { mods = keys[num_keys].modifiers; if (mods & ControlMask) strcpy(tmp, "Ctrl "); if (mods & ShiftMask) strcat(tmp, "Shift "); if (mods & Mod1Mask) strcat(tmp, "Alt "); strcat(tmp,""); strcat(tmp, ks); if (num_keys > 0) strcat(tmp, ", "); tmp += strlen(tmp); } XtFree((char*) keys); if (tmp != buf) return XtNewString(buf); else return NULL; } static void MenuBarInitialize( XmRowColumnWidget bar ) { Widget topManager; RC_IsHomogeneous(bar) = TRUE; RC_EntryClass(bar) = xmCascadeButtonWidgetClass; bar->manager.traversal_on = False; bar->row_column.lastSelectToplevel = (Widget) bar; if (RC_PostButton(bar) == UNSET_POSTBUTTON) RC_PostButton(bar) = Button1; if (RC_Packing(bar) == XmNO_PACKING) RC_Packing(bar) = XmPACK_TIGHT; if (RC_Orientation(bar) == XmNO_ORIENTATION) RC_Orientation(bar) = XmHORIZONTAL; if (RC_Spacing(bar) == XmINVALID_DIMENSION) RC_Spacing(bar) = 0; XtOverrideTranslations((Widget) bar, menu_traversal_parsed); if (RC_MenuAccelerator(bar)) { if (*RC_MenuAccelerator(bar) == '\0') { if (!(RC_MenuAccelerator(bar) = GetRealKey(bar, "osfMenuBar"))) RC_MenuAccelerator(bar) = XtNewString("F10"); } else /* Save a copy of the accelerator string */ RC_MenuAccelerator(bar) = XtNewString(RC_MenuAccelerator(bar)); } /* * Add an event handler to both us and the associated widget; we * need one in case we have gadget children. */ _XmRCGetTopManager ((Widget) bar, &topManager); XtAddEventHandler( (Widget) bar, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) bar); XtAddEventHandler( (Widget) topManager, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) bar); if (RC_MenuAccelerator(bar)) _XmRC_DoProcessMenuTree( (Widget) bar, XmADD); if (bar->manager.navigation_type == XmDYNAMIC_DEFAULT_TAB_GROUP) bar->manager.navigation_type = XmSTICKY_TAB_GROUP; } /* * prepare postFromList: if its at its default state, its parent should * be in the list. If a list has been specified but the count has not, * then set the count to 0. This is only useful for Popup and Pulldown panes. */ static void PreparePostFromList( XmRowColumnWidget rowcol ) { Widget * tempPtr; Boolean forceParent = FALSE; int i; if (rowcol->row_column.postFromCount < 0) { if (IsPopup(rowcol) && rowcol->row_column.postFromList == NULL) { /* default state for popups, set to parent */ rowcol->row_column.postFromCount = 1; forceParent = True; } else /* user provided a list but no count, default count to 0 */ rowcol->row_column.postFromCount = 0; } /* malloc enough space for 1 more addition to the list */ rowcol->row_column.postFromListSize = rowcol->row_column.postFromCount + 1; tempPtr = rowcol->row_column.postFromList; rowcol->row_column.postFromList = (Widget *) XtMalloc (rowcol->row_column.postFromListSize * sizeof(Widget)); if (tempPtr) { /* use temp - postFromCount incremented in _XmRC_AddToPostFromList() */ int cnt = rowcol->row_column.postFromCount; /* reset the postFromCount for correct _XmRC_AddToPostFromList() assignment */ rowcol->row_column.postFromCount = 0; for (i=0; i < cnt; i++) { _XmRC_AddToPostFromList ( rowcol, tempPtr[i]); } } else if (forceParent) { /* no postFromList, then parent of Popup is on this list */ rowcol->row_column.postFromList[0] = XtParent(XtParent(rowcol)); } } static void PopupInitialize( XmRowColumnWidget popup ) { Arg args[4]; int n = 0; popup->row_column.lastSelectToplevel = (Widget) popup; if (RC_PostButton(popup) == UNSET_POSTBUTTON) RC_PostButton(popup) = Button3; if (RC_Packing(popup) == XmNO_PACKING) RC_Packing(popup) = XmPACK_TIGHT; if (RC_Orientation(popup) == (char) XmNO_ORIENTATION) RC_Orientation(popup) = XmVERTICAL; if (RC_HelpPb(popup) != NULL) { XmeWarning( (Widget)popup, BadPopupHelpMsg); RC_HelpPb(popup) = NULL; } if (RC_Spacing(popup) == XmINVALID_DIMENSION) RC_Spacing(popup) = 0; XtOverrideTranslations( (Widget) popup, menu_traversal_parsed); /* If no accelerator specified, use the default */ if (RC_MenuAccelerator(popup)) { if (*RC_MenuAccelerator(popup) == '\0') { if (!(RC_MenuAccelerator(popup) = GetRealKey(popup, "osfMenu"))) RC_MenuAccelerator(popup) = XtNewString("ShiftF10"); } else /* Save a copy of the accelerator string */ RC_MenuAccelerator(popup) = XtNewString(RC_MenuAccelerator(popup)); } PreparePostFromList(popup); /* Add event handlers to all appropriate widgets */ if (RC_PopupEnabled(popup)) { _XmRC_AddPopupEventHandlers (popup); /* Register all accelerators */ _XmRC_DoProcessMenuTree( (Widget) popup, XmADD); } if (RC_TearOffModel(popup) != XmTEAR_OFF_DISABLED) { /* prevent RowColumn: InsertChild() from inserting tear off button * into child list. */ RC_SetFromInit(popup, TRUE); RC_TearOffControl(popup) = XtCreateWidget(TEAROFF_CONTROL, xmTearOffButtonWidgetClass, (Widget)popup, args, n); RC_SetFromInit(popup, FALSE); /* Can't call XtManageChild() 'cause popup's not realized yet */ RC_TearOffControl(popup)->core.managed = TRUE; } popup->row_column.popup_workproc = 0; } static void PulldownInitialize( XmRowColumnWidget pulldown ) { Arg args[4]; int n = 0; pulldown->row_column.lastSelectToplevel = (Widget) NULL; if (RC_Packing(pulldown) == XmNO_PACKING) RC_Packing(pulldown) = XmPACK_TIGHT; if (RC_Orientation(pulldown) == (char) XmNO_ORIENTATION) RC_Orientation(pulldown) = XmVERTICAL; if (RC_HelpPb(pulldown) != NULL) { XmeWarning( (Widget)pulldown, BadPulldownHelpMsg); RC_HelpPb(pulldown) = NULL; } if (RC_Spacing(pulldown) == XmINVALID_DIMENSION) RC_Spacing(pulldown) = 0; XtOverrideTranslations((Widget) pulldown, menu_traversal_parsed); RC_MenuAccelerator(pulldown) = NULL; PreparePostFromList(pulldown); /* add event handler to myself for gadgets */ XtAddEventHandler( (Widget) pulldown, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) pulldown); if (RC_TearOffModel(pulldown) != XmTEAR_OFF_DISABLED) { /* prevent RowColumn: InsertChild() from inserting separator into child * list. */ RC_SetFromInit(pulldown, TRUE); RC_TearOffControl(pulldown) = XtCreateWidget(TEAROFF_CONTROL, xmTearOffButtonWidgetClass, (Widget)pulldown, args, n); RC_SetFromInit(pulldown, FALSE); /* Can't call XtManageChild() 'cause pulldown's not realized yet */ RC_TearOffControl(pulldown)->core.managed = TRUE; } } static void OptionInitialize( XmRowColumnWidget option ) { int n; Arg args[4]; Widget topManager; Widget child; XmString empty_string = NULL ; /* BEGIN OSFfix pir 2121 */ MGR_ShadowThickness(option) = 0; /* END OSFfix pir 2121 */ if (RC_HelpPb(option) != NULL) { XmeWarning( (Widget)option, BadOptionHelpMsg); RC_HelpPb(option) = NULL; } RC_Packing(option) = XmPACK_TIGHT; /* BEGIN OSF fix pir 2429 */ RC_IsHomogeneous(option) = FALSE; if (RC_Orientation(option) == (char) XmNO_ORIENTATION) RC_Orientation(option) = XmHORIZONTAL; /* END OSF fix pir 2429 */ option->row_column.lastSelectToplevel = (Widget) option; if (RC_PostButton(option) == UNSET_POSTBUTTON) RC_PostButton(option) = Button1; if (RC_Spacing(option) == XmINVALID_DIMENSION) RC_Spacing(option) = 3; { XtTranslations translations; _XmProcessLock(); translations = (XtTranslations) ((XmManagerClassRec *)XtClass(option))-> manager_class.translations; _XmProcessUnlock(); XtOverrideTranslations((Widget)option, translations); } /* Create the label widget portion of the option menu */ n = 0; /* fix for 5235 */ if (RC_OptionLabel(option)) { XtSetArg(args[n], XmNlabelString, RC_OptionLabel(option)); n++; } else { /* if NULL, OPTION_LABEL will be used as default label, and we want an empty string */ /* Note: since this resource "labelString" in C only in the AES, no need to add a synthetic getvalue that will return NULL instead of this empty_string */ empty_string = XmStringCreateLocalized(XmS); XtSetArg(args[n], XmNlabelString, empty_string); n++; } if (RC_MnemonicCharSet(option)) { XtSetArg(args[n], XmNmnemonicCharSet, RC_MnemonicCharSet(option)); n++; } child = XmCreateLabelGadget( (Widget) option,OPTION_LABEL,args,n); XtManageChild (child); if (empty_string != NULL) XmStringFree(empty_string); /* end fix for 5235 */ /* Create the cascade button widget portion of the option menu */ n = 0; XtSetArg(args[n], XmNsubMenuId, RC_OptionSubMenu(option)); n++; XtSetArg(args[n], XmNalignment, XmALIGNMENT_CENTER); n++; /* * set recomputeSize false: the option menu continually recalculates * the best size for this button. By setting this false, we prevent * geometry requests every time the label is updated to the most * recent label. This also allows for the user to do a setvalues * on the buttons width or height and it will be honored, as long as * it is big enough to handle the largest button in the pulldown menu. */ XtSetArg(args[n], XmNrecomputeSize, FALSE); n++; child = XmCreateCascadeButtonGadget((Widget)option,OPTION_BUTTON,args,n); XtManageChild (child); RC_MenuAccelerator(option) = NULL; /* Add event handlers for catching keyboard input */ _XmRCGetTopManager ((Widget) option, &topManager); XtAddEventHandler( (Widget) option, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) option); XtAddEventHandler( (Widget) topManager, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, (XtPointer) option); if (RC_Mnemonic(option) != XK_VoidSymbol) _XmRC_DoProcessMenuTree( (Widget) option, XmADD); if (option->manager.navigation_type == XmDYNAMIC_DEFAULT_TAB_GROUP) option->manager.navigation_type = XmNONE; } static void WorkAreaInitialize( XmRowColumnWidget work ) { MGR_ShadowThickness(work) = 0; if (RC_PostButton(work) == UNSET_POSTBUTTON) RC_PostButton(work) = Button1; if (work->row_column.radio) { if (RC_Packing(work) == XmNO_PACKING) RC_Packing(work) = XmPACK_COLUMN; if (RC_EntryClass(work) == NULL) RC_EntryClass(work) = xmToggleButtonGadgetClass; } else if (RC_Packing(work) == XmNO_PACKING) RC_Packing(work) = XmPACK_TIGHT; if (RC_Orientation(work) == (char) XmNO_ORIENTATION) RC_Orientation(work) = XmVERTICAL; if (RC_HelpPb(work) != NULL) { XmeWarning( (Widget)work, BadWorkAreaHelpMsg); RC_HelpPb(work) = NULL; } if (RC_Spacing(work) == XmINVALID_DIMENSION) RC_Spacing(work) = 3; { XtTranslations translations; _XmProcessLock(); translations = (XtTranslations) ((XmManagerClassRec *)XtClass(work))-> manager_class.translations; _XmProcessUnlock(); XtOverrideTranslations((Widget)work, translations); } RC_MenuAccelerator(work) = NULL; if (work->manager.navigation_type == XmDYNAMIC_DEFAULT_TAB_GROUP) work->manager.navigation_type = XmTAB_GROUP; } /* * Initialize a row column widget */ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmRowColumnWidget req = (XmRowColumnWidget) rw ; XmRowColumnWidget m = (XmRowColumnWidget) nw ; Boolean CallNavigInitAgain = FALSE ; if (!XtWidth(req)) { XtWidth(m) = DEFAULT_WIDTH; } if (!XtHeight(req)) { XtHeight(m) = DEFAULT_HEIGHT; } if (IsPulldown(m) || IsPopup(m)) { if (RC_MarginW(m) == XmINVALID_DIMENSION) RC_MarginW(m) = 0; if (RC_MarginH(m) == XmINVALID_DIMENSION) RC_MarginH(m) = 0; } else { if (RC_MarginW(m) == XmINVALID_DIMENSION) RC_MarginW(m) = 3; if (RC_MarginH(m) == XmINVALID_DIMENSION) RC_MarginH(m) = 3; } if ((RC_Orientation(nw) != XmNO_ORIENTATION) && !XmRepTypeValidValue( XmRID_ORIENTATION, RC_Orientation(nw), (Widget)nw)) { RC_Orientation(nw) = XmNO_ORIENTATION; } if ((RC_Packing(nw) != XmNO_PACKING) && !XmRepTypeValidValue( XmRID_PACKING, RC_Packing(nw), (Widget)nw)) { RC_Packing(nw) = XmNO_PACKING; } if (!XmRepTypeValidValue( XmRID_ROW_COLUMN_TYPE, RC_Type(nw), (Widget)nw)) { RC_Type(nw) = XmWORK_AREA; } else if ((RC_Type(req) == XmMENU_POPUP) || (RC_Type(req) == XmMENU_PULLDOWN)) { if (!XmIsMenuShell(XtParent(req)) || !XtParent(XtParent(req))) { XmeWarning( (Widget)m,BadTypeParentMsg); RC_Type(m) = XmWORK_AREA; } } if (!XmRepTypeValidValue( XmRID_ALIGNMENT, RC_EntryAlignment(nw), (Widget)nw)) { RC_EntryAlignment(nw) = XmALIGNMENT_BEGINNING; } if (!XmRepTypeValidValue( XmRID_VERTICAL_ALIGNMENT, RC_EntryVerticalAlignment(nw), (Widget)nw)) { RC_EntryVerticalAlignment(nw) = XmALIGNMENT_CENTER; } RC_CascadeBtn(m) = NULL; RC_Boxes(m) = NULL; m->row_column.armed = 0; RC_SetExpose (m, TRUE); /* and ready to paint gadgets */ RC_SetWidgetMoved (m, TRUE); /* and menu and shell are not */ RC_SetWindowMoved (m, TRUE); /* in synch, positiongally */ RC_SetArmed (m, FALSE); RC_SetPoppingDown (m, FALSE); /* not popping down */ RC_PopupPosted(m) = NULL; /* no popup submenus posted */ RC_TearOffControl(m) = NULL; m->row_column.to_state = 0; RC_SetFromInit(m, FALSE); RC_SetTornOff(m, FALSE); RC_SetTearOffActive(m, FALSE); RC_SetFromResize(m, FALSE); RC_popupMenuClick(m) = TRUE; if (m->manager.shadow_thickness == XmINVALID_DIMENSION) { XrmValue xrm_value; /* Depend on the enableThinThickness Display resource. */ _XmSetThickness((Widget) m, (int) 0, &xrm_value); m->manager.shadow_thickness = *((Dimension *) xrm_value.addr); } m->row_column.old_width = XtWidth(m); m->row_column.old_height = XtHeight(m); m->row_column.old_shadow_thickness = m->manager.shadow_thickness; /* Post initialization for whichButton - done before PopupInitialize * because RC_PostModifiers used in eventual XtGrabButton() */ RC_PostModifiers(m) = AnyModifier; RC_PostEventType(m) = ButtonPress; /* allow menuPost override */ if ((RC_MenuPost(m) != NULL) && !IsPulldown(m)) { if (_XmMapBtnEvent(RC_MenuPost(m), &RC_PostEventType(m), &RC_PostButton(m), &RC_PostModifiers(m)) == FALSE) { XmeWarning( (Widget)m,BadMenuPostMsg); } RC_MenuPost(m) = XtNewString(RC_MenuPost(m)); } if (m->manager.navigation_type == XmDYNAMIC_DEFAULT_TAB_GROUP) { /* Call _XmNavigInitialize a second time only if XmNnavigationType * is XmDYNAMIC_DEFAULT_TAB_GROUP, which causes the first call * to _XmNavigInitialize to do nothing. */ CallNavigInitAgain = TRUE ; } if (IsBar(m)) MenuBarInitialize(m); else if (IsPopup(m)) PopupInitialize(m); else if (IsPulldown(m)) PulldownInitialize(m); else if (IsOption(m)) OptionInitialize(m); else WorkAreaInitialize(m); /* CR 7807: Make sure the EntryClass's fast subclass bits are set. */ if (RC_EntryClass(m) != NULL) XtInitializeWidgetClass(RC_EntryClass(m)); if (m->manager.navigation_type == XmDYNAMIC_DEFAULT_TAB_GROUP) m->manager.navigation_type = XmTAB_GROUP; if( CallNavigInitAgain ) { _XmNavigInitialize( rw, nw, args, num_args) ; } if (IsOption(m)) _XmRC_SetOptionMenuHistory (m, (RectObj) RC_MemWidget (m)); else _XmRC_SetMenuHistory (m, (RectObj) RC_MemWidget (m)); if (!IsWorkArea(m) && (XmIsManager(XtParent(m)))) { /* save the parent's accelerator widget. Force it to NULL if this RC * is a menu so Manager.c: ConstraintInitialize() doesn't overwrite * menu's "accelerators". This is ack-awwful! */ m->manager.accelerator_widget = ((XmManagerWidget)XtParent(m))->manager.accelerator_widget; ((XmManagerWidget)XtParent(m))->manager.accelerator_widget = NULL; } /* Copy tearofftitle if given */ if (RC_TearOffTitle(m) != NULL) RC_TearOffTitle(m) = XmStringCopy(RC_TearOffTitle(m)); } /* ARGSUSED */ static void ConstraintInitialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { if (!XtIsRectObj(new_w)) return; WasManaged(new_w) = False; if (XmIsGadget(new_w) || XmIsPrimitive(new_w)) { XmBaselineMargins textMargins; _XmRC_SetOrGetTextMargins(new_w, XmBASELINE_GET, &textMargins); SavedMarginTop(new_w) = textMargins.margin_top; SavedMarginBottom(new_w) = textMargins.margin_bottom; } /* * Restore parent of parent's accelerator widget. * accelerator widget should be null if parent's parent is not a manager! */ if (((XmManagerWidget)XtParent(new_w))->manager.accelerator_widget) { ((XmManagerWidget)XtParent(XtParent(new_w)))->manager.accelerator_widget = ((XmManagerWidget)XtParent(new_w))->manager.accelerator_widget; ((XmManagerWidget)XtParent(new_w))->manager.accelerator_widget = NULL; } } /*ARGSUSED*/ static Boolean ConstraintSetValues( Widget old, Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmRowColumnWidget rc = (XmRowColumnWidget) XtParent(new_w); register Widget tmp; int i ; XtWidgetGeometry current ; Boolean margins_changed; /* RCIndex (old) is valid in [0, num_children-1] and should stay valid */ /* Note: the tearoffcontrol should not change its index value, undefined behavior */ if (!XtIsRectObj(new_w)) return(FALSE); /* CR 7038: Readjust margins if they have changed. */ if (XmIsLabelGadget(old)) { margins_changed = ((LabG_MarginTop(old) != LabG_MarginTop(new_w)) || (LabG_MarginBottom(old) != LabG_MarginBottom(new_w)) || (LabG_MarginLeft(old) != LabG_MarginLeft(new_w)) || (LabG_MarginRight(old) != LabG_MarginRight(new_w))); } else if (XmIsLabel(old)) { margins_changed = ((Lab_MarginTop(old) != Lab_MarginTop(new_w)) || (Lab_MarginBottom(old) != Lab_MarginBottom(new_w)) || (Lab_MarginLeft(old) != Lab_MarginLeft(new_w)) || (Lab_MarginRight(old) != Lab_MarginRight(new_w))); } else margins_changed = FALSE; if (margins_changed) _XmRCDoMarginAdjustment(rc); if (RCIndex(old) != RCIndex(new_w)) { /* special public value */ if (RCIndex(new_w) == XmLAST_POSITION) RCIndex(new_w) = rc->composite.num_children - 1 ; if ((RCIndex(new_w) < 0) || (RCIndex(new_w) >= rc->composite.num_children)) { RCIndex(new_w) = RCIndex(old) ; } else { int inc ; /* change the configuration of the children list: put the requesting child at the new position and shift the others as needed (2 cases here) */ tmp = rc->composite.children[RCIndex(old)] ; if (RCIndex(new_w) < RCIndex(old)) inc = -1 ; else inc = 1 ; for (i = RCIndex(old) ; i != RCIndex(new_w) ; i+=inc) { rc->composite.children[i] = rc->composite.children[i+inc]; RCIndex(rc->composite.children[i]) = i ; } rc->composite.children[RCIndex(new_w)] = tmp ; /* save the current geometry of the child */ current.x = XtX(new_w) ; current.y = XtY(new_w) ; current.width = XtWidth(new_w) ; current.height = XtHeight(new_w) ; current.border_width = XtBorderWidth(new_w) ; /* re-layout, move the child and possibly change the rc size */ WasManaged(new_w) = False ; /* otherwise, changemanaged just exits */ /* call the ChangeManaged of the real superclass */ ChangeManaged((Widget) rc) ; /* as we have changed the position/size of this child, next step after this setvalues chain is the geometry manager request. We need to tell the geometry manager that this request is to be always honored. As the positionIndex field itself is self-computable, we can use it to track this case. We set it to a magic value here, and in the geometry manager, we'll have to reset it to its correct value by re-computing it - adding a field in the instance is another way for doing that, clever but more expensive */ if ((current.x != XtX(new_w)) || (current.width != XtWidth(new_w)) || (current.height != XtHeight(new_w)) || (current.border_width != XtBorderWidth(new_w))) RCIndex(new_w) = XmLAST_POSITION ; return (True); } } return (False); } /* * the main create section, mostly just tacks on the type to the arg * list */ static Widget create( Widget p, /* parent widget */ char *name, ArgList old_al, Cardinal old_ac, int type, /* menu kind to create */ int is_radio ) /* the radio flag */ { Arg al[256]; Widget m; int i, ac = 0; if (is_radio) /* get ours in ahead of the */ { /* caller's, so his override */ XtSetArg (al[ac], XmNpacking, XmPACK_COLUMN); ac++; XtSetArg (al[ac], XmNradioBehavior, is_radio); ac++; XtSetArg (al[ac], XmNisHomogeneous, TRUE); ac++; XtSetArg (al[ac], XmNentryClass, xmToggleButtonGadgetClass); ac++; } for (i=0; icore.num_popups; i++) { if ((XmIsMenuShell(pw->core.popup_list[i])) && (((XmMenuShellWidget)pw->core.popup_list[i])->menu_shell. private_shell) && (!(pw->core.popup_list[i])->core.being_destroyed)) { pop = (XmMenuShellWidget)pw->core.popup_list[i]; break; } } } /* No shell - create a new one */ if (pop == NULL) { char *b; /* should pass in the old al */ for (i=0; imenu_shell.private_shell = True; XtFree(b); } m = XtCreateWidget ( name, xmRowColumnWidgetClass, (Widget) pop, al, ac); } else m = XtCreateWidget (name, xmRowColumnWidgetClass, (Widget) p, al, ac); return (m); } /* ************************************************************************* * * Public Routines * ************************************************************************* */ Widget XmCreateRowColumn( Widget p, char *name, ArgList al, Cardinal ac ) { Widget w; _XmWidgetToAppContext(p); _XmAppLock(app); w = create (p, name, al, ac, UNDEFINED_TYPE, FALSE); _XmAppUnlock(app); return w; } Widget XmVaCreateRowColumn( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmRowColumnWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedRowColumn( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmRowColumnWidgetClass, parent, True, var, count); va_end(var); return w; } Widget XmCreateWorkArea( Widget p, char *name, ArgList al, Cardinal ac ) { Widget w; _XmWidgetToAppContext(p); _XmAppLock(app); w = create (p, name, al, ac, XmWORK_AREA, FALSE); _XmAppUnlock(app); return w; } Widget XmCreateRadioBox( Widget p, char *name, ArgList al, Cardinal ac ) { Widget w; _XmWidgetToAppContext(p); _XmAppLock(app); w = create (p, name, al, ac, XmWORK_AREA, TRUE); _XmAppUnlock(app); return w; } Widget XmCreateOptionMenu( Widget p, char *name, ArgList al, Cardinal ac ) { Widget w; _XmWidgetToAppContext(p); _XmAppLock(app); w = create (p, name, al, ac, XmMENU_OPTION, FALSE); _XmAppUnlock(app); return w; } Widget XmOptionLabelGadget( Widget m ) { int i; Widget child; _XmWidgetToAppContext(m); _XmAppLock(app); if (XmIsRowColumn(m) && IsOption(m)) { XmRowColumnWidget rowcol = (XmRowColumnWidget) m; if (rowcol->core.being_destroyed) { _XmAppUnlock(app); return NULL; } for (i = 0; i < rowcol->composite.num_children; i++) { child = rowcol->composite.children[i]; if (XtClass(child) == xmLabelGadgetClass) { _XmAppUnlock(app); return (child); } } } _XmAppUnlock(app); /* did not find a label gadget in the child list */ return (NULL); } Widget XmOptionButtonGadget( Widget m ) { int i; Widget child; _XmWidgetToAppContext(m); _XmAppLock(app); if (XmIsRowColumn(m) && IsOption(m)) { XmRowColumnWidget rowcol = (XmRowColumnWidget) m; if (rowcol->core.being_destroyed) { _XmAppUnlock(app); return NULL; } for (i = 0; i < rowcol->composite.num_children; i++) { child = rowcol->composite.children[i]; if (XmIsCascadeButtonGadget(child)) { _XmAppUnlock(app); return (child); } } } _XmAppUnlock(app); /* did not find a cascadebuttongadget in the child list */ return (NULL); } Widget XmCreateMenuBar( Widget p, char *name, ArgList al, Cardinal ac ) { Widget w; _XmWidgetToAppContext(p); _XmAppLock(app); w = create (p, name, al, ac, XmMENU_BAR, FALSE); _XmAppUnlock(app); return w; } Widget XmCreatePopupMenu( Widget p, char *name, ArgList al, Cardinal ac ) { Widget w; _XmWidgetToAppContext(p); _XmAppLock(app); w = create (p, name, al, ac, XmMENU_POPUP, FALSE); _XmAppUnlock(app); return w; } Widget XmCreatePulldownMenu( Widget p, char *name, ArgList al, Cardinal ac ) { Widget w; _XmWidgetToAppContext(p); _XmAppLock(app); w = create (p, name, al, ac, XmMENU_PULLDOWN, FALSE); _XmAppUnlock(app); return w; } /* * class initialization */ static void ClassInitialize( void ) { /* * parse the various translation tables */ menu_parsed = XtParseTranslationTable (menu_table); bar_parsed = XtParseTranslationTable (bar_table); option_parsed = XtParseTranslationTable (option_table); menu_traversal_parsed = XtParseTranslationTable (menu_traversal_table); /* set up base class extension quark */ baseClassExtRec.record_type = XmQmotif; /* set up the menu procedure entry for button children to access */ _XmSaveMenuProcContext( (XtPointer) _XmRCMenuProcedureEntry); /* Trait records */ XmeTraitSet((XtPointer) xmRowColumnWidgetClass, XmQTmenuSystem, (XtPointer) &_XmRC_menuSystemRecord); } static void ClassPartInitialize( WidgetClass rcc ) { _XmFastSubclassInit(rcc,XmROW_COLUMN_BIT); /* Allow inheritance for subclasses */ if ((WidgetClass) rcc != xmRowColumnWidgetClass) { XmRowColumnClass this_class = (XmRowColumnClass) rcc; XmRowColumnClass super = (XmRowColumnClass) rcc -> core_class.superclass; if (this_class -> row_column_class.menuProcedures == XmInheritMenuProceduresProc) this_class -> row_column_class.menuProcedures = super -> row_column_class.menuProcedures; if (this_class -> row_column_class.armAndActivate == XmInheritArmAndActivateProc) this_class -> row_column_class.armAndActivate = super -> row_column_class.armAndActivate; if (this_class -> row_column_class.traversalHandler == XmInheritMenuTraversalProc) this_class -> row_column_class.traversalHandler = super -> row_column_class.traversalHandler; } } /************************************************************ * * InitializePrehook * * Put the proper translations in core_class tm_table so that * the data is massaged correctly * ************************************************************/ /*ARGSUSED*/ static void InitializePrehook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { _XmSaveCoreClassTranslations (new_w); _XmProcessLock(); if ((RC_Type(new_w) == XmMENU_PULLDOWN) || (RC_Type(new_w) == XmMENU_POPUP)) { new_w->core.widget_class->core_class.tm_table = (String) menu_parsed; } else if (RC_Type(new_w) == XmMENU_OPTION) { new_w->core.widget_class->core_class.tm_table = (String) option_parsed; } else if (RC_Type(new_w) == XmMENU_BAR) { new_w->core.widget_class->core_class.tm_table = (String) bar_parsed; } else new_w->core.widget_class->core_class.tm_table = xmManagerClassRec.core_class.tm_table; _XmProcessUnlock(); } /************************************************************ * * InitializePosthook * * restore core class translations * ************************************************************/ /*ARGSUSED*/ static void InitializePosthook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { _XmRestoreCoreClassTranslations (new_w); } /* * Class method for traversal. If there is a tear off control visible, * it must be put into a list so that the traversal code can find it. */ static Boolean TraversalChildren ( Widget wid , Widget ** childList , Cardinal * numChildren ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid; int i; if (RC_TearOffControl(rc)) { /* * add the TOC to the children list */ *childList = (WidgetList) XtMalloc(sizeof(Widget) * (rc->composite.num_children+1)); (*childList)[0] = RC_TearOffControl(rc); for (i=1; i <= rc->composite.num_children; i++) { (*childList)[i] = rc->composite.children[i-1]; } *numChildren = rc->composite.num_children+1; return (True); } else return (False); } /********************************************************************** * * next section knows how to composite row column entries */ static void FixEventBindings( XmRowColumnWidget m, /* row column (parent) widget */ Widget w ) /* subwidget */ { if (XtIsWidget(w) && ((IsPopup(m) || IsBar(m) || IsPulldown(m)) && XmIsLabel(w) && (w->core.widget_class != xmLabelWidgetClass))) { XtAddEventHandler(w, KeyPressMask|KeyReleaseMask, False, _XmRC_KeyboardInputHandler, m); } /* set up accelerators and mnemonics */ _XmRC_ProcessSingleWidget (w, XmADD); } /***************************************************************************** * * RowColumn's map and unmap callbacks funneled through here. * *****************************************************************************/ void _XmCallRowColumnMapCallback( Widget wid, XEvent *event ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid; XmRowColumnCallbackStruct callback; if (!RC_Map_cb(rc)) return; callback.reason = XmCR_MAP; callback.event = event; callback.widget = NULL; /* these next two fields are spec'd NULL */ callback.data = NULL; callback.callbackstruct = NULL; XtCallCallbackList ((Widget)rc, RC_Map_cb(rc), &callback); } void _XmCallRowColumnUnmapCallback( Widget wid, XEvent *event ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid; XmRowColumnCallbackStruct callback; if (!RC_Unmap_cb(rc)) return; callback.reason = XmCR_UNMAP; callback.event = event; callback.widget = NULL; /* these next two fields are spec'd NULL */ callback.data = NULL; callback.callbackstruct = NULL; XtCallCallbackList ((Widget)rc, RC_Unmap_cb(rc), &callback); } /************************************************************************** * * class support procedures */ static Widget FindFirstManagedChild( CompositeWidget m, #if NeedWidePrototypes int first_button ) #else Boolean first_button ) #endif /* NeedWidePrototypes */ { register Widget *kid; register int i = 0; register int n; if (!m) return(NULL); kid = m->composite.children; n = m->composite.num_children; /* This used to use XmIsPushButton(Gadget) and XmIsToggleButton(Gadget) */ while( (i < n) && ((*kid)->core.being_destroyed || (!XtIsManaged(*kid) || (first_button && !(XmIsTraversable(*kid)) ))) ) kid++, i++; if (i >= n) return(NULL); else return(*kid); } /* * Resize the row column widget, and any subwidgets there are. * Since the gravity is set to NW, handle shrinking when there may not * be a redisplay. */ static void Resize( Widget wid ) { XmRowColumnWidget m = (XmRowColumnWidget) wid ; Boolean draw_shadow = False; RC_SetFromResize(m, TRUE); if ( (m->row_column.old_width != m->core.width) ||(m->row_column.old_height != m->core.height) ||(m->row_column.old_shadow_thickness != m->manager.shadow_thickness) ) /* clear the shadow if its needed (will check if its now larger) */ _XmClearShadowType( (Widget) m, m->row_column.old_width, m->row_column.old_height, m->row_column.old_shadow_thickness, 0); /* * if it is now smaller, redraw the shadow since there may not be a * redisplay - DON'T draw shadows for OPTION MENUS! */ if (!IsOption(m) && (m->row_column.old_height > m->core.height || m->row_column.old_width > m->core.width)) draw_shadow = True; m->row_column.old_width = m->core.width; m->row_column.old_height = m->core.height; m->row_column.old_shadow_thickness = m->manager.shadow_thickness; _XmRCAdaptToSize (m, NULL, NULL); if (draw_shadow && XtIsRealized ((Widget)m) && m->manager.shadow_thickness ) /* pop-out not pop-in */ XmeDrawShadows (XtDisplay (m), XtWindow (m), m->manager.top_shadow_GC, m->manager.bottom_shadow_GC, 0, 0, m->core.width, m->core.height, m->manager.shadow_thickness, XmSHADOW_OUT); RC_SetFromResize(m, FALSE); } /* * class Redisplay proc */ static void Redisplay( Widget w, XEvent *event, Region region ) { XmRowColumnWidget m = (XmRowColumnWidget) w; XEvent tempEvent; /* Ignore exposures generated as we unpost */ if ((IsPopup (m) || IsPulldown (m)) && !((XmMenuShellWidget)XtParent(m))->shell.popped_up) { RC_SetExpose (m, TRUE); return; } if (RC_DoExpose (m)) /* a one-shot set on popup */ { /* so we ignore next expose */ if (event == NULL) /* Fast exposure is happening */ { event = &tempEvent; event->xexpose.x = 0; event->xexpose.y = 0; event->xexpose.width = m->core.width; event->xexpose.height = m->core.height; } XmeRedisplayGadgets( (Widget) m, event, region); if (IsPopup (m) || IsPulldown (m) || IsBar(m)) { if (MGR_ShadowThickness(m)) XmeDrawShadows (XtDisplay (m), XtWindow (m), /* pop-out not pop-in */ m->manager.top_shadow_GC, m->manager.bottom_shadow_GC, 0, 0, m->core.width, m->core.height, m->manager.shadow_thickness, XmSHADOW_OUT); } } RC_SetExpose (m, TRUE); } /* * fix the visual attributes of the subwidget to be what we like * * 1. make border width uniform * 2. maybe set the label alignment */ static void FixVisual( XmRowColumnWidget m, Widget w ) { Arg al[10]; int ac; if (RC_EntryBorder(m)) { /* fix for 7660, setting entryborder before realize time has the width and height moved from 0 to 1, a side-effect of XmeConfigureObject, and then the widget loses its preferred geometry. A better fix might be to remove the check for 0 in XmeConfigureObject, but this might be a behavior compatibility issue */ if (XtIsRealized(w)) XmeConfigureObject(w, w->core.x,w->core.y, w->core.width, w->core.height, RC_EntryBorder(m)) ; else w->core.border_width = RC_EntryBorder(m); } if (IsOption(m)) return; if (XmIsLabelGadget(w)) { if (IsAligned (m)) { if (IsWorkArea(m) || ((w->core.widget_class != xmLabelWidgetClass) && (w->core.widget_class != xmLabelGadgetClass))) { ac = 0; XtSetArg (al[ac], XmNalignment, RC_EntryAlignment (m)); ac++; XtSetValues (w, al, ac); } } } else if (XmIsLabel (w)) { if (IsAligned (m)) { if ((w->core.widget_class != xmLabelWidgetClass) || IsWorkArea(m)) { ac = 0; XtSetArg (al[ac], XmNalignment, RC_EntryAlignment (m)); ac++; XtSetValues (w, al, ac); } } } } /* * If an entryCallback exists, set a flag in the buttons to not do * their activate callbacks. */ static void FixCallback( XmRowColumnWidget m, Widget w ) { XmMenuSavvyTrait menuSavvyRec; char *c; menuSavvyRec = (XmMenuSavvyTrait) XmeTraitGet((XtPointer) XtClass(w), XmQTmenuSavvy); if (menuSavvyRec == (XmMenuSavvyTrait) NULL || menuSavvyRec -> getActivateCBName == NULL) return; c = menuSavvyRec -> getActivateCBName(); if (c == NULL) return; /* can't do it to this guy */ if (m->row_column.entry_callback) { /* * Disable the buttons activate callbacks */ if (menuSavvyRec->disableCallback != (XmMenuSavvyDisableProc) NULL ) (menuSavvyRec->disableCallback)(w, XmDISABLE_ACTIVATE); } } /* ARGSUSED */ static void ActionNoop( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { /* * Do nothing; the purpose is to override the actions taken by the * Primitive translations. */ } /* ARGSUSED */ static void EventNoop( Widget reportingWidget, XtPointer data, XEvent *event, Boolean *cont ) { /* * Do nothing; the purpose is to override the actions taken by the * Primitive translations. */ } /* ARGSUSED */ static void MenuFocusIn( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; /* * For popup and pulldown menupanes, we want to ignore focusIn request * which occur when we are not visible. */ if (IsBar(rc)) _XmManagerFocusIn( (Widget) rc, event, NULL, NULL); else if ((((XmMenuShellWidget)XtParent(rc))->shell.popped_up) && !_XmGetInDragMode((Widget) rc)) _XmManagerFocusInInternal( (Widget) rc, event, NULL, NULL); } /* ARGSUSED */ static void MenuFocusOut( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; _XmManagerFocusOut( (Widget) rc, event, NULL, NULL); /* Attempt to fix locking up problem with system modal dialogs. CR 6795 */ XAllowEvents(XtDisplay(wid), SyncPointer, CurrentTime); } /* ARGSUSED */ static void MenuUnmap( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { /* * For popup and pulldown menupanes, we never care about being notified * when we are unmapped. For menubars, we want normal unmapping * processing to occur. */ if (IsBar(wid)) _XmManagerUnmap( wid, event, params, num_params); } /*ARGSUSED*/ static void MenuEnter( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; if (IsBar(rc) && RC_IsArmed(rc)) return; _XmManagerEnter( (Widget) rc, event, NULL, NULL); } /* * Catch an 'Escape' which occurs within a gadget, and bring down the * menu system. */ /*ARGSUSED*/ static void GadgetEscape( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; /* Process the event only if not already processed */ if (!_XmIsEventUnique(event)) return; if (IsBar(rc)) { /* * We're in the PM menubar mode, so let our own arm and activate * procedure clean things up . */ if (RC_IsArmed(rc)) (* (((XmRowColumnClassRec *) (rc->core.widget_class))-> row_column_class.armAndActivate)) ((Widget) rc, event, NULL, NULL); } else { /* Let the menushell widget clean things up */ (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownOne))(XtParent(rc), event, NULL, NULL); } _XmRecordEvent(event); } /* * Copy the String in XmNmnemonicCharSet before returning it to the user. */ /*ARGSUSED*/ static void GetMnemonicCharSet( Widget wid, int resource, /* unused */ XtArgVal *value) /**************** ARGSUSED ****************/ { String data ; Arg al[1]; Widget label; /****************/ label = XmOptionLabelGadget(wid); if (label) { XtSetArg(al[0], XmNmnemonicCharSet, &data); XtGetValues(label, al, 1); *value = (XtArgVal) data; } else *value = (XtArgVal) NULL; return ; } /* * Copy the String in XmNmenuAccelerator before returning it to the user. */ /*ARGSUSED*/ static void GetMenuAccelerator( Widget wid, int resource, /* unused */ XtArgVal *value ) /**************** ARGSUSED ****************/ { String data ; XmRowColumnWidget rc = (XmRowColumnWidget) wid; /****************/ if (rc->row_column.menu_accelerator != NULL) { data = (String)XtMalloc(strlen(RC_MenuAccelerator(rc)) + 1); strcpy(data, RC_MenuAccelerator(rc)); *value = (XtArgVal) data ; } else *value = (XtArgVal) NULL; return ; } /* * Copy the String in XmNmenuPost before returning it to the user. */ /*ARGSUSED*/ static void GetMenuPost( Widget wid, int resource, /* unused */ XtArgVal * value ) /**************** ARGSUSED ****************/ { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; /****************/ if (rc->row_column.menuPost != NULL) { *value = (XtArgVal) XtNewString(RC_MenuPost(rc)) ; } else *value = (XtArgVal) NULL; return ; } /* * Copy the XmString in XmNlabelString before returning it to the user. */ /*ARGSUSED*/ static void GetLabelString( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; XmString data ; /****************/ data = XmStringCopy(RC_OptionLabel(rc)); *value = (XtArgVal) data ; return ; } /* * Copy the XmString in XmNtearOffTitle before returning it to the user. */ /*ARGSUSED*/ static void GetTearOffTitle( Widget wid, int resource_offset, /* unused */ XtArgVal *value ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; XmString data ; /****************/ data = XmStringCopy(RC_TearOffTitle(rc)); *value = (XtArgVal) data ; return ; } static XmNavigability WidgetNavigable( Widget wid) { XmNavigationType nav_type = ((XmManagerWidget) wid) ->manager.navigation_type ; /* Need to make sure that XmDYNAMIC_DEFAULT_TAB_GROUP causes * return value of XmNOT_NAVIGABLE, so that initial call * to _XmNavigInitialize from Manager Initialize does nothing. */ if( XtIsSensitive(wid) && ((XmManagerWidget) wid)->manager.traversal_on && (nav_type != XmDYNAMIC_DEFAULT_TAB_GROUP) ) { if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmDESCENDANTS_TAB_NAVIGABLE ; } return XmDESCENDANTS_NAVIGABLE ; } return XmNOT_NAVIGABLE ; } motif-2.3.8/lib/Xm/ReadImageI.h0000644000175000017500000000305212672140200013007 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ReadImageI.h /main/5 1995/07/13 17:46:29 drk $ */ #ifndef _XmReadImageI_h #define _XmReadImageI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for ReadImage.c ********/ extern XImage * _XmReadImageAndHotSpotFromFile( Display * display, char *filename, int *hot_x, int *hot_y) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmReadImageI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/AtomMgr.h0000644000175000017500000000313213145162623012436 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmAtomMgr_h #define _XmAtomMgr_h #include #include #ifdef __cplusplus extern "C" { #endif /* X11r5' XInternAtom equivalent */ extern Atom XmInternAtom( Display *display, String name, #if NeedWidePrototypes int only_if_exists ); #else Boolean only_if_exists ); #endif /* NeedWidePrototypes */ /* X11r5's XGetAtomName equivalent */ extern String XmGetAtomName( Display *display, Atom atom); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* This macro name is confusing, and of unknown benefit. * #define XmNameToAtom(display, atom) \ * XmGetAtomName(display, atom) */ #endif /* _XmAtomMgr_h */ motif-2.3.8/lib/Xm/ScreenP.h0000644000175000017500000001014113145162623012425 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScreenP_h #define _XmScreenP_h #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmScreenClassPart { XtPointer extension; } XmScreenClassPart, *XmScreenClassPartPtr; typedef struct _XmScreenClassRec { /* ObjectClassPart object_class; XmExtClassPart ext_class; */ CoreClassPart core_class ; XmDesktopClassPart desktop_class; XmScreenClassPart screen_class; } XmScreenClassRec; typedef struct _XmDragCursorRec { struct _XmDragCursorRec *next; Cursor cursor; XmDragIconObject stateIcon; XmDragIconObject opIcon; XmDragIconObject sourceIcon; Boolean dirty; } XmDragCursorRec, *XmDragCursorCache; typedef struct _XmScratchPixmapKeyRec *XmScratchPixmapKey; typedef struct _XmScratchPixmapKeyRec { Cardinal depth; Dimension width; Dimension height; } XmScratchPixmapKeyRec; typedef struct { Boolean mwmPresent; unsigned short numReparented; int darkThreshold; int foregroundThreshold; int lightThreshold; XmDragIconObject defaultNoneCursorIcon; XmDragIconObject defaultValidCursorIcon; XmDragIconObject defaultInvalidCursorIcon; XmDragIconObject defaultMoveCursorIcon; XmDragIconObject defaultCopyCursorIcon; XmDragIconObject defaultLinkCursorIcon; XmDragIconObject defaultSourceCursorIcon; Cursor nullCursor; XmDragCursorRec *cursorCache; Cardinal maxCursorWidth; Cardinal maxCursorHeight; Cursor menuCursor; unsigned char unpostBehavior; XFontStruct * font_struct; int h_unit; int v_unit; XtPointer scratchPixmaps; unsigned char moveOpaque; XmScreenColorProc color_calc_proc; XmAllocColorProc color_alloc_proc; XtEnum bitmap_conversion_model; /* to save internally-created XmDragIcons */ XmDragIconObject xmStateCursorIcon; XmDragIconObject xmMoveCursorIcon; XmDragIconObject xmCopyCursorIcon; XmDragIconObject xmLinkCursorIcon; XmDragIconObject xmSourceCursorIcon; GC imageGC; /* OBSOLETE FIELD */ int imageGCDepth; /* OBSOLETE FIELD */ Pixel imageForeground; /* OBSOLETE FIELD */ Pixel imageBackground; /* OBSOLETE FIELD */ XtPointer screenInfo; /* extension */ XtPointer user_data; Pixmap insensitive_stipple_bitmap; #ifdef DEFAULT_GLYPH_PIXMAP Pixmap default_glyph_pixmap ; unsigned int default_glyph_pixmap_width ; unsigned int default_glyph_pixmap_height ; #endif XtPointer inUsePixmaps; } XmScreenPart, *XmScreenPartPtr; typedef struct _XmScreenInfo { /* so much for information hiding */ XtPointer menu_state; /* MenuUtil.c */ Boolean destroyCallbackAdded; /* ImageCache.c */ } XmScreenInfo; externalref XmScreenClassRec xmScreenClassRec; typedef struct _XmScreenRec { /* ObjectPart object; XmExtPart ext; */ CorePart core ; XmDesktopPart desktop; XmScreenPart screen; } XmScreenRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScreenP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/VendorSP.h0000644000175000017500000000246113145162623012574 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmVendorSP_h #define _XmVendorSP_h #ifndef _XmNO_BC_INCL #define _XmNO_BC_INCL #endif #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif externalref VendorShellClassRec vendorShellClassRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVendorSP_h */ motif-2.3.8/lib/Xm/ContainerP.h0000644000175000017500000003470212672140200013130 00000000000000/* $XConsortium: ContainerP.h /main/8 1996/06/13 16:45:53 pascale $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmContainerP_h #define _XmContainerP_h #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* * One _XmCwidNodeRec structure is allocated by Container for each of * it's children (except for OutlineButtons). Information about the * relationship of the child to other Container children (parentage and * order) is maintained here by Container. * * _XmCwidNodeRec structures are XtCalloc'd by Container in the * ConstraintInitialize method and XtFree'd in the ConstraintDestroy method. * They are linked/unlinked to other _XmCwidNodeRec structures in the * ChangeManaged method. */ typedef struct _XmCwidNodeRec { struct _XmCwidNodeRec * next_ptr; struct _XmCwidNodeRec * prev_ptr; struct _XmCwidNodeRec * child_ptr; struct _XmCwidNodeRec * parent_ptr; Widget widget_ptr; } XmCwidNodeRec, *CwidNode; /* * Container allocates a _XmContainerXfrActionRec structure to store * the data from a ContainerStartTransfer action until it can determine * whether the action should start a primary transfer or begin a drag. */ typedef struct _XmContainerXfrActionRec { Widget wid; XEvent *event; String *params; Cardinal *num_params; Atom operation; } XmContainerXfrActionRec, *ContainerXfrAction; /* * Container allocates an array of _XmContainerCwidCellInfoRec structures * to use in calculating an ideal size in the GetSpatialSize procedure when * XmNspatialStyle is XmCELLS. The array is created and destroyed in the * GetSpatialSize procedure. */ typedef struct _XmContainerCwidCellInfoRec { int cwid_width_in_cells; int cwid_height_in_cells; } XmContainerCwidCellInfoRec, *ContainerCwidCellInfo; /* Container constraint class part record */ typedef struct _XmContainerConstraintPart { Widget entry_parent; /* XmNentryParent */ Widget related_cwid; CwidNode node_ptr; int position_index; /* XmNpositionIndex */ int depth; int cell_idx; Boolean visible_in_outline; Position user_x; Position user_y; unsigned char outline_state; /* XmNoutlineState */ unsigned char selection_visual; unsigned char selection_state; unsigned char cwid_type; } XmContainerConstraintPart, * XmContainerConstraint; typedef struct _XmContainerConstraintRec { XmManagerConstraintPart manager; XmContainerConstraintPart container; } XmContainerConstraintRec, * XmContainerConstraintPtr; /* move the other typedef here */ typedef void (*XmSpatialGetSize)(Widget, Dimension *, Dimension *); /* Container widget class record */ typedef struct _XmContainerClassPart { XmSpatialTestFitProc test_fit_item; XmSpatialPlacementProc place_item; XmSpatialRemoveProc remove_item; XmSpatialGetSize get_spatial_size; XtPointer extension; } XmContainerClassPart; /* Full class record declaration */ typedef struct _XmContainerClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmContainerClassPart container_class; } XmContainerClassRec, *XmContainerClass; externalref XmContainerClassRec xmContainerClassRec; /* Container instance record */ typedef struct _XmContainerPart { WidgetList selected_items; /* XmNselectedItems */ Widget icon_header; Widget anchor_cwid; Widget druggee; Widget size_ob; Widget drag_context; CwidNode first_node; CwidNode last_node; Cardinal * detail_order; /* XmNdetailOrder */ XmString * detail_heading; /* XmNdetailColumnHeading */ XSegment * outline_segs; XtCallbackList convert_cb; /* XmNconvertCallback */ XtCallbackList default_action_cb; /* XmNdefaultActionCallback */ XtCallbackList destination_cb; /* XmNdestinationCallback */ XtCallbackList outline_cb; /* XmNoutlineChangedCallback */ XtCallbackList selection_cb; /* XmNselectionCallback */ XmTabList detail_tablist; /* XmNdetailTabList */ XmFontList render_table; /* XmNfontList */ Pixel select_color; /* XmNselectColor */ Pixmap collapsed_state_pixmap; /* XmNcollapsedStatePixmap */ Pixmap expanded_state_pixmap; /* XmNexpandedStatePixmap */ GC normalGC; GC marqueeGC; Time last_click_time; Region cells_region; ContainerXfrAction transfer_action; XtIntervalId transfer_timer_id; XPoint anchor_point; XPoint marquee_start; XPoint marquee_end; XPoint marquee_smallest; XPoint marquee_largest; XPoint dropspot; unsigned long dynamic_resource; int max_depth; int outline_seg_count; int *cells; int cell_count; int next_free_cell; int current_width_in_cells; int current_height_in_cells; int drag_offset_x; int drag_offset_y; unsigned int selected_item_count; /* XmNselectedItemCount */ Cardinal detail_heading_count; /* XmNdetailColumnHeadingCount */ Cardinal saved_detail_heading_count; Cardinal detail_order_count; /* XmNdetailOrderCount */ Dimension first_col_width; /* XmNoutlineColumnWidth */ Dimension real_first_col_width; Dimension large_cell_height; /* XmNlargeCellHeight */ Dimension large_cell_width; /* XmNlargeCellWidth */ Dimension small_cell_height; /* XmNsmallCellHeight */ Dimension small_cell_width; /* XmNsmallCellWidth */ Dimension real_large_cellh; Dimension real_large_cellw; Dimension real_small_cellh; Dimension real_small_cellw; Dimension margin_h; /* XmNmarginHeight */ Dimension margin_w; /* XmNmarginWidth */ Dimension outline_indent; /* XmNoutlineIndentation */ Dimension ob_width; Dimension ob_height; Dimension prev_width; Dimension ideal_width; Dimension ideal_height; /* Note: first_change_managed is also used to resolve between * XmRenderTable & XmFontList when setting up the resource table */ Boolean first_change_managed; Boolean extending_mode; Boolean marquee_mode; Boolean self; Boolean toggle_pressed; Boolean extend_pressed; Boolean ob_pressed; Boolean cancel_pressed; Boolean kaddmode; Boolean no_auto_sel_changes; Boolean started_in_anchor; Boolean marquee_drawn; Boolean have_primary; Boolean selecting; Boolean large_cell_dim_fixed; Boolean small_cell_dim_fixed; unsigned char automatic; /* XmNautomaticSelection */ unsigned char entry_viewtype; /* XmNentryViewType */ unsigned char include_model; /* XmNspatialIncludeModel */ unsigned char layout_type; /* XmNlayoutType */ unsigned char ob_policy; /* XmNoutlineButtonPolicy */ unsigned char outline_sep_style; /* XmNoutlineLineStyle */ unsigned char spatial_style; /* XmNspatialStyle */ unsigned char primary_ownership; /* XmNprimaryOwnership */ unsigned char resize_model; /* XmNspatialResizeModel */ unsigned char selection_policy; /* XmNselectionPolicy */ unsigned char selection_technique; /* XmNselectionTechnique */ unsigned char snap_model; /* XmNspatialSnapModel */ unsigned char create_cwid_type; unsigned char selection_state; unsigned char LeaveDir; /* leave direction */ XtIntervalId scroll_proc_id; /* scroll TimeOutProc */ int last_xmotion_x; int last_xmotion_y; XmString * cache_detail_heading; /* XmNdetailColumnHeading getValues */ } XmContainerPart; /* Full instance record declaration */ typedef struct _XmContainerRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmContainerPart container; } XmContainerRec; /* enums to keep up with cwid types */ enum { CONTAINER_ICON, CONTAINER_OUTLINE_BUTTON, CONTAINER_HEADER}; #define TABLIST (1L<<0) #define FIRSTCW (1L<<1) #define CtrIsDynamic(w,mask) \ (((XmContainerWidget)(w))->container.dynamic_resource & mask) #define CtrDynamicSmallCellHeight(w) \ (((XmContainerWidget)(w))->container.small_cell_height == 0) #define CtrDynamicSmallCellWidth(w) \ (((XmContainerWidget)(w))->container.small_cell_width == 0) #define CtrDynamicLargeCellHeight(w) \ (((XmContainerWidget)(w))->container.large_cell_height == 0) #define CtrDynamicLargeCellWidth(w) \ (((XmContainerWidget)(w))->container.large_cell_width == 0) #define CtrIsAUTO_SELECT(w) \ ((((XmContainerWidget)(w))->container.automatic == XmAUTO_SELECT) && \ (((XmContainerWidget)(w))->container.selection_policy \ != XmSINGLE_SELECT)) #define CtrViewIsLARGE_ICON(w) \ (((XmContainerWidget)(w))->container.entry_viewtype == XmLARGE_ICON) #define CtrViewIsSMALL_ICON(w) \ (((XmContainerWidget)(w))->container.entry_viewtype == XmSMALL_ICON) #define CtrViewIsANY_ICON(w) \ (((XmContainerWidget)(w))->container.entry_viewtype == XmANY_ICON) #define CtrIsHORIZONTAL(w) \ (XmDirectionMatchPartial \ (((XmContainerWidget)(w))->manager.string_direction,\ XmDEFAULT_DIRECTION,XmPRECEDENCE_HORIZ_MASK)) #define CtrIsVERTICAL(w) \ (XmDirectionMatchPartial \ (((XmContainerWidget)(w))->manager.string_direction,\ XmDEFAULT_DIRECTION,XmPRECEDENCE_VERT_MASK)) #define CtrLayoutIsDETAIL(w) \ (((XmContainerWidget)(w))->container.layout_type == XmDETAIL) #define CtrLayoutIsOUTLINE_DETAIL(w) \ ((((XmContainerWidget)(w))->container.layout_type == XmDETAIL) || \ (((XmContainerWidget)(w))->container.layout_type == XmOUTLINE)) #define CtrDrawLinesOUTLINE(w) \ (CtrLayoutIsOUTLINE_DETAIL(w) && \ (((XmContainerWidget)(w))->container.outline_sep_style \ == XmSINGLE)) #define CtrLayoutIsSPATIAL(w) \ (((XmContainerWidget)(w))->container.layout_type == XmSPATIAL) #define CtrSpatialStyleIsNONE(w) \ (((XmContainerWidget)(w))->container.spatial_style == XmNONE) #define CtrSpatialStyleIsGRID(w) \ (((XmContainerWidget)(w))->container.spatial_style == XmGRID) #define CtrSpatialStyleIsCELLS(w) \ (((XmContainerWidget)(w))->container.spatial_style == XmCELLS) #define CtrIncludeIsAPPEND(w) \ (((XmContainerWidget)(w))->container.include_model == XmAPPEND) #define CtrIncludeIsCLOSEST(w) \ (((XmContainerWidget)(w))->container.include_model == XmCLOSEST) #define CtrIncludeIsFIRST_FIT(w) \ (((XmContainerWidget)(w))->container.include_model == XmFIRST_FIT) #define CtrSnapModelIsNONE(w) \ (((XmContainerWidget)(w))->container.snap_model == XmNONE) #define CtrSnapModelIsSNAP(w) \ (((XmContainerWidget)(w))->container.snap_model == XmSNAP_TO_GRID) #define CtrSnapModelIsCENTER(w) \ (((XmContainerWidget)(w))->container.snap_model == XmCENTER) #define CtrResizeModelIsGROW_MINOR(w) \ (((XmContainerWidget)(w))->container.resize_model == XmGROW_MINOR) #define CtrResizeModelIsGROW_MAJOR(w) \ (((XmContainerWidget)(w))->container.resize_model == XmGROW_MAJOR) #define CtrResizeModelIsGROW_BALANCED(w) \ (((XmContainerWidget)(w))->container.resize_model == XmGROW_BALANCED) #define CtrPolicyIsSINGLE(w) \ (((XmContainerWidget)(w))->container.selection_policy \ == XmSINGLE_SELECT) #define CtrPolicyIsBROWSE(w) \ (((XmContainerWidget)(w))->container.selection_policy \ == XmBROWSE_SELECT) #define CtrPolicyIsMULTIPLE(w) \ (((XmContainerWidget)(w))->container.selection_policy \ == XmMULTIPLE_SELECT) #define CtrPolicyIsEXTENDED(w) \ (((XmContainerWidget)(w))->container.selection_policy \ == XmEXTENDED_SELECT) #define CtrTechIsTOUCH_OVER(w) \ (((XmContainerWidget)(w))->container.selection_technique \ == XmTOUCH_OVER) #define CtrTechIsTOUCH_ONLY(w) \ (((XmContainerWidget)(w))->container.selection_technique \ == XmTOUCH_ONLY) #define CtrTechIsMARQUEE(w) \ (((XmContainerWidget)(w))->container.selection_technique \ == XmMARQUEE) #define CtrTechIsMARQUEE_ES(w) \ (((XmContainerWidget)(w))->container.selection_technique \ == XmMARQUEE_EXTEND_START) #define CtrTechIsMARQUEE_EB(w) \ (((XmContainerWidget)(w))->container.selection_technique \ == XmMARQUEE_EXTEND_BOTH) #define CtrOB_PRESENT(w) \ (((XmContainerWidget)(w))->container.ob_policy \ == XmOUTLINE_BUTTON_PRESENT) #define CtrOB_ABSENT(w) \ (((XmContainerWidget)(w))->container.ob_policy \ == XmOUTLINE_BUTTON_ABSENT) #define GetContainerConstraint(w) \ (&((XmContainerConstraintPtr) (w)->core.constraints)->container) #define CtrItemIsPlaced(w) \ (((XmContainerConstraintPtr)(w)->core.constraints)->container.cell_idx \ != NO_CELL) #define CtrICON(w) \ (((XmContainerConstraintPtr)(w)->core.constraints)->container.cwid_type\ == CONTAINER_ICON) #define CtrOUTLINE_BUTTON(w) \ (((XmContainerConstraintPtr)(w)->core.constraints)->container.cwid_type\ == CONTAINER_OUTLINE_BUTTON) #define CtrHEADER(w) \ (((XmContainerConstraintPtr)(w)->core.constraints)->container.cwid_type\ == CONTAINER_HEADER) #define XmInheritSpatialTestFitProc ((XmSpatialTestFitProc) _XtInherit) #define XmInheritSpatialPlacementProc ((XmSpatialPlacementProc) _XtInherit) #define XmInheritSpatialRemoveProc ((XmSpatialRemoveProc) _XtInherit) #define XmInheritSpatialGetSize ((XmSpatialGetSize) _XtInherit) /* possible directions when leaving the container */ #define TOPLEAVE (1<<0) #define BOTTOMLEAVE (1<<1) #define LEFTLEAVE (1<<2) #define RIGHTLEAVE (1<<3) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmContainerP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DisplayI.h0000644000175000017500000000421313145162623012607 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDisplayI_h #define _XmDisplayI_h #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmDisplayEventQueryStruct { XmDisplay dd; XmDragContext dc; XmTopLevelEnterCallbackStruct *enterCB; XmDragMotionCallbackStruct *motionCB; XmTopLevelLeaveCallbackStruct *leaveCB; XmDropStartCallbackStruct *dropStartCB; Boolean hasEnter; Boolean hasMotion; Boolean hasLeave; Boolean hasDropStart; } XmDisplayEventQueryStruct; /******** Private Function Declarations ********/ extern XmDropSiteManagerObject _XmGetDropSiteManagerObject( XmDisplay xmDisplay) ; extern unsigned char _XmGetDragProtocolStyle( Widget w) ; extern unsigned char _XmGetDragTrackingMode( Widget w) ; extern Widget _XmGetDragContextFromHandle( Widget w, Atom iccHandle) ; extern WidgetClass _XmGetXmDisplayClass( void ) ; extern WidgetClass _XmSetXmDisplayClass( WidgetClass wc) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDisplayI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/ShellE.c0000644000175000017500000002166413145162623012251 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: ShellE.c /main/10 1995/10/25 20:19:54 cde-sun $" #endif #endif #include #include #include #include #include "XmI.h" /******** Static Function Declarations ********/ static void ShellClassPartInitialize( WidgetClass w) ; static void StructureNotifyHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch) ; /******** End Static Function Declarations ********/ /*************************************************************************** * * Class Record * ***************************************************************************/ #define Offset(field) XtOffsetOf( struct _XmShellExtRec, shell.field) static XtResource shellResources[] = { { XmNuseAsyncGeometry, XmCUseAsyncGeometry, XmRBoolean, sizeof(Boolean), Offset(useAsyncGeometry), XmRImmediate, FALSE, }, }; #undef Offset externaldef(xmshellextclassrec) XmShellExtClassRec xmShellExtClassRec = { { (WidgetClass) &xmDesktopClassRec,/* superclass */ "Shell", /* class_name */ sizeof(XmShellExtRec), /* size */ NULL, /* Class Initializer */ ShellClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ NULL, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ shellResources, /* resources */ XtNumber(shellResources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ NULL, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, { /* ext */ NULL, /* synthetic resources */ 0, /* num syn resources */ NULL, /* extension */ }, { /* desktop */ NULL, /* child_class */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* shell ext */ StructureNotifyHandler, /* structureNotify*/ NULL, /* extension */ }, }; externaldef(xmShellExtobjectclass) WidgetClass xmShellExtObjectClass = (WidgetClass) (&xmShellExtClassRec); /************************************************************************ * * ClassPartInitialize * Set up the inheritance mechanism for the routines exported by * vendorShells class part. * ************************************************************************/ static void ShellClassPartInitialize( WidgetClass w ) { XmShellExtObjectClass wc = (XmShellExtObjectClass) w; XmShellExtObjectClass sc = (XmShellExtObjectClass) wc->object_class.superclass; if (wc == (XmShellExtObjectClass)xmShellExtObjectClass) return; if (wc->shell_class.structureNotifyHandler == XmInheritEventHandler) wc->shell_class.structureNotifyHandler = sc->shell_class.structureNotifyHandler; } /************************************************************************ * * StructureNotifyHandler * ************************************************************************/ /* ARGSUSED */ static void StructureNotifyHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch ) { register ShellWidget w = (ShellWidget) wid; WMShellWidget wmshell = (WMShellWidget) w; Boolean sizechanged = FALSE; Position tmpx, tmpy; XmShellExtObject shellExt = (XmShellExtObject) closure; XmVendorShellExtObject vendorExt = (XmVendorShellExtObject)closure; XmVendorShellExtPart *vePPtr; XmScreen xmScreen; /* * for right now if this is being used by overrides bug out */ if (!XmIsVendorShell(wid)) return; else vePPtr = (XmVendorShellExtPart *) &(vendorExt->vendor); if (XmIsScreen(vendorExt->desktop.parent)) xmScreen = (XmScreen) (vendorExt->desktop.parent); else xmScreen = (XmScreen) XmGetXmScreen(XtScreen(wid)); switch(event->type) { case MapNotify: break; case UnmapNotify: /* * try to keep the pop up field synced up so it won't disallow * a new pop up request. */ /* * make sure we have good coords */ XtTranslateCoords((Widget) w, 0, 0, &tmpx, &tmpy); /* * if the offsets match up, then offset our values so we'll go in * the same place the next time. */ if ((vePPtr->xAtMap != w->core.x) || (vePPtr->yAtMap != w->core.y)) { if (xmScreen->screen.mwmPresent) { if (vePPtr->lastOffsetSerial && (vePPtr->lastOffsetSerial >= vendorExt->shell.lastConfigureRequest) && ((vePPtr->xOffset + vePPtr->xAtMap) == w->core.x) && ((vePPtr->yOffset + vePPtr->yAtMap) == w->core.y)) { w->core.x -= vePPtr->xOffset; w->core.y -= vePPtr->yOffset; w->shell.client_specified &= ~_XtShellPositionValid; vePPtr->externalReposition = False; } else { vePPtr->externalReposition = True; } } else vePPtr->externalReposition = True; } break; case ConfigureNotify: /* * only process configureNotifies that aren't stale */ if (event->xany.serial < shellExt->shell.lastConfigureRequest) { /* * make sure the hard wired event handler in shell is not called */ if (shellExt->shell.useAsyncGeometry) *continue_to_dispatch = False; } else { #define NEQ(x) ( w->core.x != event->xconfigure.x ) if( NEQ(width) || NEQ(height) || NEQ(border_width) ) { sizechanged = TRUE; } #undef NEQ w->core.width = event->xconfigure.width; w->core.height = event->xconfigure.height; w->core.border_width = event->xconfigure.border_width; if (event->xany.send_event /* ICCCM compliant synthetic ev */ /* || w->shell.override_redirect */ || w->shell.client_specified & _XtShellNotReparented) { w->core.x = event->xconfigure.x; w->core.y = event->xconfigure.y; w->shell.client_specified |= _XtShellPositionValid; } else w->shell.client_specified &= ~_XtShellPositionValid; if (XtIsWMShell(wid) && !wmshell->wm.wait_for_wm) { /* Consider trusting the wm again */ register WMShellPart *wmp = &(wmshell->wm); #define EQ(x) (wmp->size_hints.x == w->core.x) if (EQ(x) && EQ(y) && EQ(width) && EQ(height)) { wmshell->wm.wait_for_wm = TRUE; } #undef EQ } } break; case ReparentNotify: if (event->xreparent.window == XtWindow(w)) { if (event->xreparent.parent != RootWindowOfScreen(XtScreen(w))) { w->shell.client_specified &= ~_XtShellNotReparented; /* * check to see if it's mwm */ if (!(xmScreen->screen.numReparented++)) xmScreen->screen.mwmPresent = XmIsMotifWMRunning( (Widget) w); } else { w->core.x = event->xreparent.x; w->core.y = event->xreparent.y; w->shell.client_specified |= _XtShellNotReparented; xmScreen->screen.numReparented--; } w->shell.client_specified &= ~_XtShellPositionValid; } return; default: return; } if (sizechanged) { XtWidgetProc resize; _XmProcessLock(); resize = XtClass(w)->core_class.resize; _XmProcessUnlock(); if (resize != (XtWidgetProc) NULL) (*resize)((Widget) w); } } motif-2.3.8/lib/Xm/ColorObjP.h0000644000175000017500000001200712672140200012711 00000000000000/* $XConsortium: ColorObjP.h /main/10 1996/12/16 18:30:49 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmColorObjP_h #define _XmColorObjP_h #include #ifdef __cplusplus extern "C" { #endif /** misc structures, defines, and functions for using ColorObj **/ #define XmCO_MAX_NUM_COLORS 8 #define XmCO_NUM_COLORS XmCO_MAX_NUM_COLORS #define XmPIXEL_SET_PROP_VERSION '1' /* Constants for color usage */ enum { XmCO_BLACK_WHITE, XmCO_LOW_COLOR, XmCO_MEDIUM_COLOR, XmCO_HIGH_COLOR }; typedef struct { Pixel fg; Pixel bg; Pixel ts; Pixel bs; Pixel sc; } XmPixelSet; typedef XmPixelSet Colors[XmCO_NUM_COLORS]; typedef struct _XmColorObjPart { XtArgsProc RowColInitHook; XmPixelSet *myColors; /* colors for my (application) screen */ int myScreen; Display *display; /* display connection for "pseudo-app" */ Colors *colors; /* colors per screen for workspace mgr */ int numScreens; /* for workspace manager */ Atom *atoms; /* to identify colorsrv screen numbers */ Boolean colorIsRunning; /* used for any color problem */ Boolean done; int *colorUse; int primary; int secondary; int text; /* color set id for text widgets */ int active; int inactive; Boolean useColorObj; /* read only resource variable */ Boolean useText; /* use text color set id for text? */ Boolean useTextForList; /* use text color set id for lists? */ Boolean useMask; Boolean useMultiColorIcons; Boolean useIconFileCache; } XmColorObjPart; typedef struct _XmColorObjRec { CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; XmColorObjPart color_obj; } XmColorObjRec; typedef struct _XmColorObjClassPart { XtPointer extension; } XmColorObjClassPart; /* * we make it a appShell subclass so it can have it's own instance * hierarchy */ typedef struct _XmColorObjClassRec{ CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; WMShellClassPart wm_shell_class; XmColorObjClassPart color_obj_class; } XmColorObjClassRec; externalref XmColorObjClassRec xmColorObjClassRec; #ifndef XmIsColorObj #define XmIsColorObj(w) (XtIsSubclass(w, xmColorObjClass)) #endif /* XmIsXmDisplay */ externalref WidgetClass xmColorObjClass; typedef struct _XmColorObjClassRec *XmColorObjClass; typedef struct _XmColorObjRec *XmColorObj; #define XmCO_DitherTopShadow(display, screen, pixelSet) \ ((pixelSet)->bs == BlackPixel((display), (screen))) #define XmCO_DitherBottomShadow(display, screen, pixelSet) \ ((pixelSet)->ts == WhitePixel((display), (screen))) #define XmCO_DITHER XmS50_foreground #define XmCO_NO_DITHER XmSunspecified_pixmap /******** Private Function Declarations ********/ extern Boolean XmeGetIconControlInfo( Screen *screen, Boolean *useMaskRtn, Boolean *useMultiColorIconsRtn, Boolean *useIconFileCacheRtn) ; extern Boolean XmeUseColorObj( void ) ; extern Boolean XmeGetColorObjData( Screen * screen, int *colorUse, XmPixelSet *pixelSet, unsigned short num_pixelSet, short *active_id, short *inactive_id, short *primary_id, short *secondary_id, short *text_id) ; extern Boolean XmeGetDesktopColorCells ( Screen * screen, Colormap colormap, XColor * colors, int n_colors, int * ncolors_returns) ; extern Boolean XmeGetPixelData ( int screen_number, int *colorUse, XmPixelSet *pixelSet, short *a, short *i, short *p, short *s) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmColorObjP_h */ motif-2.3.8/lib/Xm/CascadeBGI.h0000644000175000017500000000317112672140200012727 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: CascadeBGI.h /main/6 1995/07/14 10:14:47 drk $ */ #ifndef _XmCascadeBGI_h #define _XmCascadeBGI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern int _XmArrowPixmapCacheCompare( XtPointer A, XtPointer B) ; extern void _XmArrowPixmapCacheDelete( XtPointer data) ; extern void _XmCreateArrowPixmaps( Widget wid) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCascadeBGI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/FrameP.h0000644000175000017500000000526213145162623012250 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmFrameP_h #define _XmFrameP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Full class records */ typedef struct { XtPointer extension; } XmFrameClassPart; typedef struct _XmFrameClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmFrameClassPart frame_class; } XmFrameClassRec; externalref XmFrameClassRec xmFrameClassRec; /* Frame instance records */ typedef struct { Dimension margin_width; Dimension margin_height; unsigned char shadow_type; Dimension old_width; Dimension old_height; Dimension old_shadow_thickness; Position old_shadow_x; Position old_shadow_y; Widget work_area; Widget title_area; Boolean processing_constraints; } XmFramePart; typedef struct _XmFrameRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmFramePart frame; } XmFrameRec; /* Frame constraint records */ typedef struct _XmFrameConstraintPart { /* "unused" is actually being used in the CheckSetChildType defaultproc ! */ int unused; unsigned char child_type; unsigned char child_h_alignment; Dimension child_h_spacing; unsigned char child_v_alignment; } XmFrameConstraintPart, * XmFrameConstraint; typedef struct _XmFrameConstraintRec { XmManagerConstraintPart manager; XmFrameConstraintPart frame; } XmFrameConstraintRec, * XmFrameConstraintPtr; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmFrameP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/NavigatorT.h0000644000175000017500000000566112672140200013146 00000000000000/* $XConsortium: NavigatorT.h /main/5 1995/07/15 20:53:08 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmNavigatorT_H #define _XmNavigatorT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTnavigator; /* Trait structures and typedefs, place typedefs first */ /* this structure is equivalent to an XPoint but in int, not in Position, which are short */ typedef struct _TwoDInt { int x; int y; } TwoDIntRec, *TwoDInt; /* this one can be expanded in the future */ typedef struct _XmNavigatorDataRec { Mask valueMask ; Mask dimMask ; TwoDIntRec value; TwoDIntRec minimum; TwoDIntRec maximum; TwoDIntRec slider_size; TwoDIntRec increment; TwoDIntRec page_increment; } XmNavigatorDataRec, *XmNavigatorData; #define NavAllValid (OxFFFF) #define NavDimMask (1L<<0) #define NavValue (1L<<1) #define NavMinimum (1L<<2) #define NavMaximum (1L<<3) #define NavSliderSize (1L<<4) #define NavIncrement (1L<<5) #define NavPageIncrement (1L<<6) typedef void (*XmNavigatorMoveCBProc)(Widget nav, XtCallbackProc moveCB, XtPointer closure, Boolean setunset); typedef void (*XmNavigatorSetValueProc)(Widget nav, XmNavigatorData nav_data, Boolean notify); typedef void (*XmNavigatorGetValueProc)(Widget nav, XmNavigatorData nav_data); /* Version 0: initial release. */ typedef struct _XmNavigatorTraitRec { int version; /* 0 */ XmNavigatorMoveCBProc changeMoveCB; XmNavigatorSetValueProc setValue; XmNavigatorGetValueProc getValue; } XmNavigatorTraitRec, *XmNavigatorTrait; #define NavigDimensionX (1L<<0) #define NavigDimensionY (1L<<1) /* convenience Macros */ #define ACCESS_DIM(mask,field) ((mask & NavigDimensionX)?(field.x):(field.y)) #define ASSIGN_DIM(mask,field,val) \ { \ if (mask & NavigDimensionX) \ (field.x)=(val); \ else \ (field.y)=(val); \ } #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmNavigatorT_H */ motif-2.3.8/lib/Xm/LabelP.h0000644000175000017500000001311313145162623012227 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmLabelP_h_ #define _XmLabelP_h_ #include #include #include #ifdef __cplusplus extern "C" { #endif /* The Label Widget Class and instance records */ typedef struct _XmLabelClassPart /* label class record */ { XtWidgetProc setOverrideCallback; XmMenuProc menuProcs; String translations; XtPointer extension; } XmLabelClassPart; typedef struct _XmLabelClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmLabelClassPart label_class; } XmLabelClassRec; externalref XmLabelClassRec xmLabelClassRec; /* Inherited Functions exported by label */ #define XmInheritSetOverrideCallback ((XtWidgetProc) _XtInherit) #define XmInheritResize ((XtWidgetProc) _XtInherit) #define XmInheritRealize ((XtRealizeProc) _XtInherit) /* The padding between label text and accelerator text */ # define LABEL_ACC_PAD 15 /* The Label instance record */ typedef struct _XmLabelPart { _XmString _label; /* String sent to this widget */ _XmString _acc_text; KeySym mnemonic; XmStringCharSet mnemonicCharset; char *accelerator; unsigned char label_type; unsigned char alignment; unsigned char string_direction; XmFontList font; Dimension margin_height; /* margin around widget */ Dimension margin_width; Dimension margin_left; /* additional margins on */ Dimension margin_right; /* each side of widget */ Dimension margin_top; /* text (or pixmap) is placed */ Dimension margin_bottom; /* inside the margins */ Boolean recompute_size; Pixmap pixmap; Pixmap pixmap_insen; /* PRIVATE members -- values computed by LabelWidgetClass methods */ GC normal_GC; /* GC for text */ GC insensitive_GC; XRectangle TextRect; /* The bounding box of the text or clip */ XRectangle acc_TextRect; /* rectangle of the window; whichever is */ /* smaller */ Boolean skipCallback; /* set by RowColumn with entryCallback. */ unsigned char menu_type; Boolean computing_size; /* suppresses DrawnB resize callbacks. */ Dimension acc_left_delta; /* Amount we increased the margins */ Dimension acc_right_delta; /* to accomodate accelerator text. */ Dimension * baselines; /* Cached baseline information */ Boolean check_set_render_table; XmPixmapPlacement pixmap_placement; /* Where to place the icon label. */ Dimension pixmap_text_padding; /* padding between the icon and the text. */ XRectangle PixmapRect; /* The bounding box of the pixmap in TextRect */ XRectangle StringRect; /* The bounding box of the string in TextRect */ #ifdef FIX_1381 GC shadow_GC; #endif } XmLabelPart; typedef struct _XmLabelRec { CorePart core; XmPrimitivePart primitive; XmLabelPart label; } XmLabelRec; /* MACROS */ #define Lab_MarginWidth(w) (((XmLabelWidget)(w)) ->label.margin_width) #define Lab_MarginHeight(w) (((XmLabelWidget)(w)) ->label.margin_height) #define Lab_MarginTop(w) (((XmLabelWidget)(w)) ->label.margin_top) #define Lab_MarginBottom(w) (((XmLabelWidget)(w)) ->label.margin_bottom) #define Lab_MarginRight(w) (((XmLabelWidget)(w)) ->label.margin_right) #define Lab_MarginLeft(w) (((XmLabelWidget)(w)) ->label.margin_left) #define Lab_TextRect_x(w) (((XmLabelWidget)(w)) ->label.TextRect.x) #define Lab_TextRect_y(w) (((XmLabelWidget)(w)) ->label.TextRect.y) #define Lab_TextRect_width(w) (((XmLabelWidget)(w)) ->label.TextRect.width) #define Lab_TextRect_height(w) (((XmLabelWidget)(w)) ->label.TextRect.height) #define Lab_IsText(w) (((XmLabelWidget)(w)) ->label.label_type == XmSTRING) #define Lab_IsPixmap(w) (((XmLabelWidget)(w)) ->label.label_type == XmPIXMAP) #define Lab_IsPixmapAndText(w) (((XmLabelWidget)(w)) ->label.label_type == \ XmPIXMAP_AND_STRING) #define Lab_Font(w) (((XmLabelWidget)(w)) ->label.font) #define Lab_Mnemonic(w) (((XmLabelWidget)(w)) ->label.mnemonic) #define Lab_Accelerator(w) (((XmLabelWidget)(w)) ->label.accelerator) #define Lab_AcceleratorText(w) (((XmLabelWidget)(w)) ->label.acc_text) #define Lab_MenuType(w) (((XmLabelWidget)(w))->label.menu_type) #define Lab_Shadow(w) (((XmLabelWidget)(w))->primitive.shadow_thickness) #define Lab_Highlight(w) (((XmLabelWidget)(w))->primitive.highlight_thickness) #define Lab_Baseline(w) \ (_XmStringBaseline (((XmLabelWidget)(w))->label.font, \ ((XmLabelWidget)(w))->label._label)) #define Lab_ComputingSize(w) (((XmLabelWidget)(w))->label.computing_size) #define Lab_IsMenupane(w) ((Lab_MenuType(w) == XmMENU_POPUP) || \ (Lab_MenuType(w) == XmMENU_PULLDOWN)) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmLabelP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextStrSo.c0000644000175000017500000014576613145162623013026 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: TextStrSo.c /main/14 1996/10/23 16:05:21 cde-osf $" #endif #endif #define FIX_1320 #include #include #include #include #include #include #include #include #include "XmI.h" /* for _XmValidTimestamp() */ #include "TextI.h" #include "TextStrSoI.h" /******** Static Function Declarations ********/ static void AddWidget(XmTextSource source, XmTextWidget tw); static char * _XmStringSourceGetChar(XmSourceData data, XmTextPosition position); static int CountLines(XmTextSource source, XmTextPosition start, unsigned long length); static void RemoveWidget(XmTextSource source, XmTextWidget tw); static void _XmStringSourceReadString(XmTextSource source, int start, XmTextBlock block); static XmTextPosition ReadSource(XmTextSource source, XmTextPosition position, XmTextPosition last_position, XmTextBlock block); static XmTextStatus Replace(XmTextWidget initiator, XEvent *event, XmTextPosition *start, XmTextPosition *end, XmTextBlock block, #if NeedWidePrototypes int call_callbacks); #else Boolean call_callbacks); #endif /* NeedsWidePrototypes */ static void ScanParagraph(XmSourceData data, XmTextPosition *new_position, XmTextScanDirection dir, int ddir, XmTextPosition *last_char); static XmTextPosition Scan(XmTextSource source, XmTextPosition pos, XmTextScanType sType, XmTextScanDirection dir, int count, #if NeedWidePrototypes int include); #else Boolean include); #endif /* NeedWidePrototypes */ static Boolean GetSelection(XmTextSource source, XmTextPosition *left, XmTextPosition *right); static void SetSelection(XmTextSource source, XmTextPosition left, XmTextPosition right, Time set_time); /******** End Static Function Declarations ********/ #define TEXT_INCREMENT 1024 #define TEXT_INITIAL_INCREM 64 /* Convert a stream of bytes into a char*, BITS16*, or wchar_t* array. * Return number of characters created. * * If num_chars == 1, don't add a null terminator, else if a null terminator * is present on the byte stream, convert it and add it to the character * array; Count returned does not include NULL terminator (just like strlen). * * This routine assumes that a BITS16 is two-bytes; * the routine must be modified if these assumptions are incorrect. */ /* ARGSUSED */ int _XmTextBytesToCharacters(char * characters, char * bytes, int num_chars, #if NeedWidePrototypes int add_null_terminator, #else Boolean add_null_terminator, #endif /* NeedWidePrototypes */ int max_char_size) { unsigned char * tmp_bytes; int num_bytes; int count=0; BITS16 *bits16_ptr, temp_bits16; wchar_t *wchar_t_ptr; /* If 0 characters requested, or a null pointer passed, dont do * anything... just return 0 characters converted. */ if (num_chars == 0 || bytes == NULL) return 0; switch (max_char_size) { case 1: { (void) memcpy((void*)characters, (void*)bytes, num_chars); count = num_chars; break; } /* end case 1 */ case 2: { bits16_ptr = (BITS16 *) characters; tmp_bytes = (unsigned char*) bytes; for ( #ifndef NO_MULTIBYTE num_bytes = mblen((char*)tmp_bytes, max_char_size), #else num_bytes = *tmp_bytes ? 1 : 0, #endif temp_bits16 = 0; num_chars > 0 && num_bytes > 0; num_chars--, #ifndef NO_MULTIBYTE num_bytes = mblen((char*)tmp_bytes, max_char_size), #else num_bytes = *tmp_bytes ? 1 : 0, #endif temp_bits16 = 0, bits16_ptr ++) { if (num_bytes == 1) { temp_bits16 = (BITS16) *tmp_bytes++; } else { temp_bits16 = (BITS16) *tmp_bytes++; temp_bits16 = temp_bits16 << 8; temp_bits16 |= (BITS16) *tmp_bytes++; } *bits16_ptr = temp_bits16; count++; } /* if bytes is NULL terminated, characters should be too */ if (add_null_terminator == True) *bits16_ptr = (BITS16) 0; break; } /* end case 2 */ default: { wchar_t_ptr = (wchar_t *)characters; count = mbstowcs(wchar_t_ptr, bytes, num_chars); if (add_null_terminator == True && count >= 0) wchar_t_ptr[count] = (wchar_t)0; break; } /* end default */ } /* end switch */ return count; } /* Convert an array of char*, BITS16*, or wchar_t* into a stream of bytes. * Return the number of bytes placed into 'bytes' * * Null terminate the byte stream - caller better have alloc'ed enough space! */ /* ARGSUSED */ int _XmTextCharactersToBytes(char * bytes, char * characters, int num_chars, int max_char_size) { unsigned char *temp_char; unsigned char *byte_ptr; int count = 0; int i, j; BITS16 *bits16_ptr, temp_bits16; wchar_t *wchars; if (num_chars == 0 || characters == 0) { *bytes = '\0'; return 0; } switch (max_char_size) { case 1: { (void) memcpy((void*)bytes, (void*)characters, num_chars); count = num_chars; break; } /* end case 1 */ case 2: { bits16_ptr = (BITS16 *) characters; byte_ptr = (unsigned char*) bytes; temp_char = (unsigned char*) XtMalloc (max_char_size); for (i = 0; i < num_chars && *bits16_ptr != 0; i++, bits16_ptr++) { temp_bits16 = *bits16_ptr; /* create an array of chars; char[max_char_size - 1] contains the * low order byte */ for (j = max_char_size - 1; j >= 0; j--) { temp_char[j] = (unsigned char)(temp_bits16 & 0377); temp_bits16 = temp_bits16 >> 8; } /* start with high order byte. If any byte is 0, skip it. */ for (j = 0; j < max_char_size; j++) { if (temp_char[j] > 0) { *byte_ptr = temp_char[j]; byte_ptr++; count++; } } } XtFree ((char*)temp_char); if (count < num_chars) *byte_ptr = '\0'; break; } /* end case 2 */ default: { int nbytes; wchars = (wchar_t *)characters; for (i = 0; i < num_chars && *wchars != 0L; i++, wchars++) { nbytes = wctomb(bytes, *wchars); if (nbytes < 0) break; /* illegal char */ count += nbytes; bytes += nbytes; } if (count >= 0) bytes[count] = '\0'; break; } /* end default */ } /* end switch */ return (count); /* return the number of bytes placed in bptr */ } char * _XmStringSourceGetString(XmTextWidget tw, XmTextPosition from, XmTextPosition to, #if NeedWidePrototypes int want_wchar) #else Boolean want_wchar) #endif /* NeedWidePrototypes */ { char *buf; wchar_t *wc_buf; XmTextBlockRec block; int destpos; XmTextPosition pos, ret_pos; int return_val = 0; destpos = 0; if (!want_wchar) { /* NOTE: to - from could result in a truncated long. */ buf = XtMalloc(((int)(to - from) + 1) * (int)tw->text.char_size); for (pos = from; pos < to; ) { pos = ReadSource(tw->text.source, pos, to, &block); if (block.length == 0) break; (void)memcpy((void*)&buf[destpos], (void*)block.ptr, block.length); destpos += block.length; } buf[destpos] = 0; return buf; } else { /* want buffer of wchar_t * data */ /* NOTE: to - from could result in a truncated long. */ buf = XtMalloc(((int)(to - from) + 1) * sizeof(wchar_t)); wc_buf = (wchar_t *)buf; for (pos = from; pos < to; ) { ret_pos = ReadSource(tw->text.source, pos, to, &block); if (block.length == 0) break; /* NOTE: ret_pos - pos could result in a truncated long. */ return_val = mbstowcs(&wc_buf[destpos], block.ptr, (unsigned int) (ret_pos - pos)); if (return_val > 0) destpos += return_val; pos = ret_pos; } wc_buf[destpos] = (wchar_t)0L; return ((char*)wc_buf); } } static void AddWidget(XmTextSource source, XmTextWidget tw) { XmSourceData data = source->data; data->numwidgets++; data->widgets = (XmTextWidget *) XtRealloc((char *) data->widgets, (unsigned) (sizeof(XmTextWidget) * data->numwidgets)); data->widgets[data->numwidgets - 1] = tw; if (data->numwidgets == 1) _XmTextSetHighlight((Widget) tw, 0, tw->text.last_position, XmHIGHLIGHT_NORMAL); else { tw->text.highlight.list = (_XmHighlightRec *) XtRealloc((char *) tw->text.highlight.list, data->widgets[0]->text.highlight.maximum * sizeof(_XmHighlightRec)); tw->text.highlight.maximum = data->widgets[0]->text.highlight.maximum; tw->text.highlight.number = data->widgets[0]->text.highlight.number; memmove((void *) tw->text.highlight.list, (void *) data->widgets[0]->text.highlight.list, (size_t) data->widgets[0]->text.highlight.number * sizeof(_XmHighlightRec)); } if (data->hasselection && data->numwidgets == 1) { Time select_time = XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (!select_time) select_time = _XmValidTimestamp((Widget)tw); if (!XmePrimarySource((Widget) data->widgets[0], select_time)) { (*source->SetSelection)(source, 1, 0, select_time); } else { XmAnyCallbackStruct cb; data->prim_time = select_time; cb.reason = XmCR_GAIN_PRIMARY; cb.event = NULL; XtCallCallbackList ((Widget) data->widgets[0], data->widgets[0]->text.gain_primary_callback, (XtPointer) &cb); } } } /********************************<->***********************************/ static char * _XmStringSourceGetChar(XmSourceData data, XmTextPosition position) /* starting position */ { /* gap_size is the number of character in the gap, not number of bytes */ register int gap_size; register XmTextPosition char_pos; XmTextWidget tw = (XmTextWidget) data->widgets[0]; int char_size; if (tw->text.char_size > 1) { if (tw->text.char_size == 2) char_size = 2; else char_size = sizeof(wchar_t); char_pos = position * char_size; /* regardless of what it contains, data->ptr is treated as a char * ptr */ if (data->ptr + char_pos < data->gap_start) return (&data->ptr[char_pos]); gap_size = (data->gap_end - data->gap_start) / char_size; if (position + gap_size >= data->maxlength) return (""); return (&data->ptr[(position + gap_size) * char_size]); } else { char_pos = position; /* regardless of what it contains, data->ptr is treated as a char * ptr */ if (data->ptr + char_pos < data->gap_start) return (&data->ptr[char_pos]); gap_size = (data->gap_end - data->gap_start); if (char_pos + gap_size >= data->maxlength) return (""); return (&data->ptr[(char_pos + gap_size)]); } } /*DELTA: length IS NOW TREATED AS NUMBER OF CHARACTERS - CALLERS MUST CHANGE*/ static int CountLines(XmTextSource source, XmTextPosition start, unsigned long length) { XmSourceData data = source->data; XmTextWidget tw = (XmTextWidget) data->widgets[0]; int num_lines = 0; unsigned long seg_length; char *ptr; BITS16 *bits16_ptr, *bits16_gap_start, *bits16_gap_end; wchar_t *wchar_t_ptr, *wchar_t_gap_start, *wchar_t_gap_end; /* verify that the 'start' and 'length' parameters are reasonable */ if (start + length > data->length) length = data->length - start; if (length == 0) return num_lines; seg_length = (data->gap_start - data->ptr) / (tw->text.char_size < 3 ? (int)tw->text.char_size : sizeof(wchar_t)); /* make sure the segment length is not greater than the length desired */ if (length < seg_length) seg_length = length; switch ((int)tw->text.char_size) { case 1: { /* setup the variables for the search of new lines before the gap */ ptr = data->ptr + start; /* search up to gap */ while (seg_length--) { if (*ptr++ == *(data->PSWC_NWLN)) ++num_lines; } /* check to see if we need more data after the gap */ if ((int)length > data->gap_start - (data->ptr + start)) { if (data->gap_start - (data->ptr + start) > 0) /* if we searched * before gap, * adjust length */ length -= data->gap_start - (data->ptr + start); ptr = data->gap_end; /* continue search till length is completed */ while (length--) { if (*ptr++ == *(data->PSWC_NWLN)) ++num_lines; } } break; } /* end case 1 */ case 2: { /* setup the variables for the search of new lines before the gap */ bits16_ptr = (BITS16 *) data->ptr; bits16_gap_start = (BITS16 *) data->gap_start; bits16_gap_end = (BITS16 *) data->gap_end; bits16_ptr += start; /* search up to gap */ while (seg_length--) { if (*bits16_ptr++ == *(BITS16 *)(data->PSWC_NWLN)) ++num_lines; } /* check to see if we need more data after the gap */ if ((int)length > bits16_gap_start - ((BITS16 *)data->ptr + start)) { /* if we searched before gap, adjust length */ if (bits16_gap_start - ((BITS16 *)data->ptr + start) > 0) length -= bits16_gap_start - ((BITS16 *)data->ptr + start); bits16_ptr = bits16_gap_end; /* continue search till length is completed */ while (length--) { if (*bits16_ptr++ == *(BITS16 *)(data->PSWC_NWLN)) ++num_lines; } } break; } /* end case 2 */ default: { /* setup the variables for the search of new lines before the gap */ wchar_t_ptr = (wchar_t *) data->ptr; wchar_t_gap_start = (wchar_t *) data->gap_start; wchar_t_gap_end = (wchar_t *) data->gap_end; wchar_t_ptr += start; /* search up to gap */ while (seg_length--) { if (*wchar_t_ptr++ == *(wchar_t *)(data->PSWC_NWLN)) ++num_lines; } /* check to see if we need more data after the gap */ if ((int)length > wchar_t_gap_start - ((wchar_t *)data->ptr + start)) { /* if we searched before gap, adjust length */ if (wchar_t_gap_start - ((wchar_t *)data->ptr + start) > 0) length -= wchar_t_gap_start - ((wchar_t *)data->ptr + start); wchar_t_ptr = wchar_t_gap_end; /* continue search till length is completed */ while (length--) { if (*wchar_t_ptr++ == *(wchar_t *)(data->PSWC_NWLN)) ++num_lines; } } break; } /* end default */ } /* end switch */ return num_lines; } static void RemoveWidget(XmTextSource source, XmTextWidget tw) { XmSourceData data = source->data; int i; for (i=0; inumwidgets; i++) { if (data->widgets[i] == tw) { XmTextPosition left, right; Boolean had_selection = False; Time select_time = XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (data->hasselection) { (*source->GetSelection)(source, &left, &right); (*source->SetSelection)(source, 1, -999, select_time); had_selection = True; } data->numwidgets--; data->widgets[i] = data->widgets[data->numwidgets]; if (i == 0 && data->numwidgets > 0 && had_selection) (*source->SetSelection)(source, left, right, select_time); if (data->numwidgets == 0) _XmStringSourceDestroy(source); return; } } } Boolean * _XmStringSourceGetPending(XmTextWidget tw) { Boolean *pending; XmSourceData data = tw->text.source->data; int i; pending = (Boolean *)XtMalloc(data->numwidgets*sizeof(Boolean)); for (i=0; inumwidgets; i++) pending[i] = ((XmTextWidget)data->widgets[i])->text.pendingoff; return pending; } void _XmStringSourceSetPending(XmTextWidget tw, Boolean *pending) { XmSourceData data = tw->text.source->data; int i; if ((long)pending > 1) for (i=0; inumwidgets; i++) ((XmTextWidget)data->widgets[i])->text.pendingoff = pending[i]; else for (i=0; inumwidgets; i++) ((XmTextWidget)data->widgets[i])->text.pendingoff = (Boolean)(long)pending; } /* * Determines where to move the gap and calls memmove to move the gap. */ /********************************<->***********************************/ void _XmStringSourceSetGappedBuffer(XmSourceData data, XmTextPosition position) /* starting position */ { XmTextWidget tw = (XmTextWidget) data->widgets[0]; int count, char_size = (tw->text.char_size < 3 ? (int)tw->text.char_size : sizeof(wchar_t)); /* if no change in gap placement, return */ if (data->ptr + (position * char_size) == data->gap_start) return; if (data->ptr + (position * char_size) < data->gap_start) { /* move gap to the left */ count = data->gap_start - (data->ptr + (position * char_size)); memmove(data->gap_end - count, data->ptr + (position*char_size), count); data->gap_start -= count; /* ie, data->gap_start = position; */ data->gap_end -= count; /* ie, data->gap_end = position + gap_size; */ } else { /* move gap to the right */ count = (data->ptr + (position * char_size)) - data->gap_start; memmove(data->gap_start, data->gap_end, count); data->gap_start += count; /* ie, data->gap_start = position; */ data->gap_end += count; /* ie, data->gap_end = position + gap_size; */ } } /********************************<->***********************************/ /* The only caller of this routine expects to get char* in block */ static void _XmStringSourceReadString(XmTextSource source, int start, XmTextBlock block) { XmSourceData data = source->data; XmTextWidget tw = (XmTextWidget) data->widgets[0]; int gap_size = data->gap_end - data->gap_start; int byte_start = start * (tw->text.char_size < 3 ? (int)tw->text.char_size : sizeof(wchar_t)); if (data->ptr + byte_start + block->length <= data->gap_start) block->ptr = data->ptr + byte_start; else if (data->ptr + byte_start + gap_size >= data->gap_end) block->ptr = data->ptr + byte_start + gap_size; else { block->ptr = data->ptr + byte_start; block->length = data->gap_start - (data->ptr + byte_start); } } /* Caller wants block to contain char*; _XmStringSourceReadString provides * char*, BITS16* or wchar_t*; so we need to modify what it gives us. */ static XmTextPosition ReadSource(XmTextSource source, XmTextPosition position, /* starting position */ XmTextPosition last_position, /* The last position we're interested in. Don't return info about any later positions. */ XmTextBlock block) /* RETURN: text read in */ { XmTextPosition return_pos; int num_bytes; XmSourceData data = source->data; XmTextWidget tw = (XmTextWidget) data->widgets[0]; int char_size = (tw->text.char_size < 3 ? (int)tw->text.char_size : sizeof(wchar_t)); if (last_position > data->length) last_position = data->length; /* NOTE: the length calculation could result in a truncated long */ block->length = (int)((last_position - position) * char_size); if (block->length < 0 ) block->length = 0; block->format = XmFMT_8_BIT; _XmStringSourceReadString(source, (int)position, block); if (block->length > 0) { if (data->old_length == 0) { data->value = (char *) XtMalloc((unsigned)(block->length + 1) * (int)tw->text.char_size); data->old_length = block->length; } else if (block->length > data->old_length) { data->value = XtRealloc(data->value, (unsigned) ((block->length + 1) * (int)tw->text.char_size)); data->old_length = block->length; } if ((int)tw->text.char_size == 1) { return_pos = position + block->length; } else { return_pos = position + (block->length / char_size); num_bytes = _XmTextCharactersToBytes(data->value, block->ptr, block->length / char_size, (int)tw->text.char_size); block->length = num_bytes; block->ptr = data->value; } return return_pos; } else return 0; } void _XmTextValidate(XmTextPosition * start, XmTextPosition * end, int maxsize) { if (*start < 0) *start = 0; if (*start > maxsize) { *start = maxsize; } if (*end < 0) *end = 0; if (*end > maxsize) { *end = maxsize; } if (*start > *end) { XmTextPosition tmp; /* tmp variable for swapping positions */ tmp = *end; *end = *start; *start = tmp; } } Boolean _XmTextModifyVerify(XmTextWidget initiator, XEvent *event, XmTextPosition *start, XmTextPosition *end, XmTextPosition *cursorPos, /* RETURN, may be NULL if not */ XmTextBlock block, XmTextBlock newblock, /* RETURN */ Boolean *freeBlock) { register XmSourceData data = initiator->text.source->data; register long delta; register int block_num_chars; /* number of characters in the block */ XmTextPosition newInsert = initiator->text.cursor_position; XmTextVerifyCallbackStruct tvcb; XmTextVerifyCallbackStructWcs wcs_tvcb; XmTextBlockRecWcs wcs_newblock; *freeBlock = False; if (*start == *end && block->length == 0) return False; _XmTextValidate(start, end, data->length); newblock->length = block->length; /* RETURNed values */ newblock->format = block->format; newblock->ptr = block->ptr; if (!initiator->text.modify_verify_callback && !initiator->text.wcs_modify_verify_callback) { /* we have neither callback, so do expensive ** computation only if cursorPos is needed */ if (cursorPos) { block_num_chars = _XmTextCountCharacters(block->ptr, block->length); *cursorPos = *start + block_num_chars; } return True; } /* cursorPos may be needed to be returned. If not, and if the text is ** not editable, can drop out now */ if (!cursorPos && !data->editable) return False; /* there is at least one callback, so block_num_chars is needed; ** this is the potentially-expensive operation that we're trying to avoid */ block_num_chars = _XmTextCountCharacters(block->ptr, block->length); if (cursorPos) *cursorPos = *start + block_num_chars; if (!data->editable) /* if cursorPos was needed, it's set; can now drop out */ return False; /* we have at least one callback on editable text, and cursorPos may or may ** not need to be set. block_num_chars has been set, so perform some other ** quick evaluations on whether or not the modify is reasonable. Then ** call one or both of the callbacks, and if necessary reset cursorPos. */ delta = block_num_chars - (*end - *start); if (delta > 0 && (data->length + delta > data->maxallowed)) return False; /* If both modify_verify and modify_verify_wcs are registered: * - first call the char* callback, then * - pass the modified data from the char* callback to the * wchar_t callback. * If programmers set both callback lists, they get's what they asked for. */ wcs_newblock.wcsptr = (wchar_t *)NULL; wcs_newblock.length = 0; /* If there are char* callbacks registered, call them. */ if (initiator->text.modify_verify_callback) { /* Fill in the block to pass to the callback. */ if (block->length) { newblock->ptr = (char *) XtMalloc(block->length + 1); *freeBlock = True; (void) memcpy((void*) newblock->ptr, (void*) block->ptr, block->length); newblock->ptr[block->length] = '\0'; } /* Call Verification Callback to indicate that text is being modified */ tvcb.reason = XmCR_MODIFYING_TEXT_VALUE; tvcb.event = event; tvcb.currInsert = (XmTextPosition) (initiator->text.cursor_position); tvcb.newInsert = (XmTextPosition) (initiator->text.cursor_position); tvcb.startPos = *start; tvcb.endPos = *end; tvcb.doit = True; tvcb.text = newblock; XtCallCallbackList ((Widget) initiator, initiator->text.modify_verify_callback, (XtPointer) &tvcb); /* If doit flag is false, application wants to negate the action, * so free allocate space and return False. */ if (!tvcb.doit) { if (newblock->ptr && newblock->ptr != block->ptr) XtFree(newblock->ptr); *freeBlock = False; return False; } else { *start = tvcb.startPos; *end = tvcb.endPos; newInsert = tvcb.newInsert; _XmTextValidate (start, end, data->length); if (tvcb.text != newblock || tvcb.text->ptr != newblock->ptr) { newblock->length = tvcb.text->length; if (newblock->ptr && newblock->ptr != block->ptr) XtFree(newblock->ptr); *freeBlock = False; if (newblock->length) { newblock->ptr = XtMalloc(newblock->length + 1); *freeBlock = True; (void)memcpy((void*)newblock->ptr, (void*)tvcb.text->ptr, tvcb.text->length); } else newblock->ptr = NULL; } newblock->format = tvcb.text->format; block_num_chars = _XmTextCountCharacters(newblock->ptr, newblock->length); delta = block_num_chars - (*end - *start); if (delta > 0 && data->length + delta > data->maxallowed && (!UnderVerifyPreedit(initiator))) { if (newblock->ptr && newblock->ptr != block->ptr) XtFree(newblock->ptr); *freeBlock = False; return False; } } } /* end if there are char* modify verify callbacks */ if (initiator->text.wcs_modify_verify_callback) { wcs_newblock.wcsptr = (wchar_t *)XtMalloc((unsigned)sizeof(wchar_t) * (newblock->length + 1)); wcs_newblock.length = mbstowcs(wcs_newblock.wcsptr, newblock->ptr, block_num_chars); if (wcs_newblock.length < 0) wcs_newblock.length = 0; wcs_tvcb.reason = XmCR_MODIFYING_TEXT_VALUE; wcs_tvcb.event = event; wcs_tvcb.currInsert = initiator->text.cursor_position; wcs_tvcb.newInsert = initiator->text.cursor_position; wcs_tvcb.startPos = *start; wcs_tvcb.endPos = *end; wcs_tvcb.doit = True; wcs_tvcb.text = &wcs_newblock; XtCallCallbackList((Widget) initiator, initiator->text.wcs_modify_verify_callback, (XtPointer) &wcs_tvcb); if (!wcs_tvcb.doit) { if (newblock->ptr && newblock->ptr != block->ptr) XtFree(newblock->ptr); *freeBlock = False; if (wcs_newblock.wcsptr) XtFree((char*)wcs_newblock.wcsptr); return False; } else { *start = wcs_tvcb.startPos; *end = wcs_tvcb.endPos; newInsert = wcs_tvcb.newInsert; _XmTextValidate (start, end, data->length); /* use newblock as a temporary holder and put the char* * data there */ if (newblock->ptr && newblock->ptr != block->ptr) { XtFree(newblock->ptr); newblock->ptr = NULL; } *freeBlock = False; if (wcs_tvcb.text->length) { newblock->ptr = (char*) XtMalloc((unsigned) (1 + wcs_tvcb.text->length) * (int)initiator->text.char_size); *freeBlock = True; wcs_tvcb.text->wcsptr[wcs_tvcb.text->length] = (wchar_t) 0L; /* NOTE: wcstombs returns a long which could be truncated */ newblock->length = (int) wcstombs(newblock->ptr, wcs_tvcb.text->wcsptr, (wcs_tvcb.text->length + 1) * (int)initiator->text.char_size); if (newblock->length < 0) newblock->length = 0; } else { newblock->ptr = NULL; newblock->length = 0; } block_num_chars = wcs_tvcb.text->length; delta = block_num_chars - (*end - *start); /* if the wcstombs found bad data, newblock->length is negative */ if ((delta > 0 && data->length + delta > data->maxallowed && (!UnderVerifyPreedit(initiator))) || newblock->length < 0) { if (newblock->ptr && newblock->ptr != block->ptr) XtFree(newblock->ptr); *freeBlock = False; if (wcs_newblock.wcsptr) XtFree((char*)wcs_newblock.wcsptr); return False; } } /* If we alloced space for the wcs_newblock, we need to clean it up */ if (wcs_newblock.wcsptr) XtFree((char*)wcs_newblock.wcsptr); } /* end if there are wide char modify verify callbacks */ if (cursorPos) { if (initiator->text.cursor_position != newInsert) /* true only if we have callbacks */ { if (newInsert > data->length + delta) { *cursorPos = data->length + delta; } else if (newInsert < 0) { *cursorPos = 0; } else { *cursorPos = newInsert; } } else *cursorPos = *start + block_num_chars; } return True; } /*ARGSUSED*/ static XmTextStatus Replace(XmTextWidget initiator, XEvent * event, /* unused */ XmTextPosition *start, XmTextPosition *end, XmTextBlock block, #if NeedWidePrototypes int call_callbacks) /* unused */ #else Boolean call_callbacks) /* unused */ #endif { register XmSourceData data = initiator->text.source->data; register int i; register long delta; register int block_num_chars; /* number of characters in the block */ int gap_size; int old_maxlength; int char_size = (initiator->text.char_size < 3 ? (int)initiator->text.char_size : sizeof(wchar_t)); if (*start == *end && block->length == 0) return EditReject; _XmTextValidate(start, end, data->length); block_num_chars = _XmTextCountCharacters(block->ptr, block->length); delta = block_num_chars - (*end - *start); if (!data->editable || (delta > 0 && data->length + delta > data->maxallowed && (!UnderVerifyPreedit(initiator)))) return EditError; /**********************************************************************/ initiator->text.output->DrawInsertionPoint(initiator, initiator->text.cursor_position, off); /* Move the gap to the editing position (*start). */ _XmStringSourceSetGappedBuffer(data, *start); for (i=0; inumwidgets; i++) { _XmTextDisableRedisplay(data->widgets[i], TRUE); if (data->hasselection) _XmTextSetHighlight((Widget)data->widgets[i], data->left, data->right, XmHIGHLIGHT_NORMAL); } old_maxlength = data->maxlength; if (data->length + delta >= data->maxlength) { int gap_start_offset, gap_end_offset; while (data->length + delta >= data->maxlength) { if (data->maxlength < TEXT_INCREMENT) data->maxlength *= 2; else data->maxlength += TEXT_INCREMENT; } gap_start_offset = data->gap_start - data->ptr; gap_end_offset = data->gap_end - data->ptr; data->ptr = XtRealloc(data->ptr, (unsigned) ((data->maxlength) * char_size)); data->gap_start = data->ptr + gap_start_offset; data->gap_end = data->ptr + gap_end_offset + (char_size * (data->maxlength - old_maxlength)); if (gap_end_offset != (old_maxlength * char_size)) memmove(data->gap_end, data->ptr + gap_end_offset, (char_size * old_maxlength) - gap_end_offset); /* Do something to move the allocated space into the buffer */ } /* NOTE: the value of delta could be truncated by cast to int. */ data->length += (int) delta; if (data->hasselection && *start < data->right && *end > data->left) { if (*start <= data->left) { if (*end < data->right) { data->left = *end; /* delete encompasses left half of the selection so move left endpoint */ } else { data->right = data->left; /* delete encompasses the selection so set selection to NULL */ } } else { if (*end >= data->right) { data->right = *start; /* delete encompasses the right half of the selection so move right endpoint */ } else { data->right -= (*end - *start); /* delete is completely within the selection so shrink the selection */ } } } /* delete data */ gap_size = data->gap_end - data->gap_start; /* expand the end of the gap to the right */ if ((data->ptr + gap_size + (*end * char_size)) > data->gap_end) data->gap_end += ((*end - *start) * char_size); /* add data */ /* copy the data into the gap_start and increment the gap start pointer */ /* convert data from char* to characters and copy into the gapped buffer */ if ((int)initiator->text.char_size == 1) { for (i=0; i < block->length; i++) { /* if (data->gap_start == data->gap_end) break; */ *data->gap_start++ = block->ptr[i]; } } else { data->gap_start += char_size * _XmTextBytesToCharacters(data->gap_start, &block->ptr[0], block_num_chars, False, (int)initiator->text.char_size); } if (data->hasselection && data->left != data->right) { if (*end <= data->left) { data->left += delta; data->right += delta; } if (data->left > data->right) data->right = data->left; } for (i=0; inumwidgets; i++) { _XmTextInvalidate(data->widgets[i], *start, *end, delta); _XmTextUpdateLineTable((Widget) data->widgets[i], *start, *end, block, True); if (data->hasselection) _XmTextSetHighlight((Widget)data->widgets[i], data->left, data->right, XmHIGHLIGHT_SELECTED); _XmTextEnableRedisplay(data->widgets[i]); } initiator->text.output->DrawInsertionPoint(initiator, initiator->text.cursor_position, on); if (data->maxlength != TEXT_INITIAL_INCREM && ((data->maxlength > TEXT_INCREMENT && data->length <= data->maxlength - TEXT_INCREMENT) || data->length <= data->maxlength >> 1)) { /* Move the gap to the last position. */ _XmStringSourceSetGappedBuffer(data, data->length); data->maxlength = TEXT_INITIAL_INCREM; while (data->length >= data->maxlength) { if (data->maxlength < TEXT_INCREMENT) data->maxlength *= 2; else data->maxlength += TEXT_INCREMENT; } data->ptr = XtRealloc(data->ptr, (unsigned) ((data->maxlength) * char_size)); data->gap_start = data->ptr + (data->length * char_size); data->gap_end = data->ptr + ((data->maxlength - 1) * char_size); } return EditDone; } #define Increment(data, position, direction)\ {\ if (direction == XmsdLeft) {\ if (position > 0) \ position--;\ } else {\ if (position < data->length)\ position++;\ }\ } #define Look(data, position, dir) \ ((dir == XmsdLeft) \ ? ((position) ? _XmStringSourceGetChar(data, position - 1) \ : NULL) \ : ((position == data->length) ? NULL \ : _XmStringSourceGetChar(data, position))) static void ScanParagraph(XmSourceData data, XmTextPosition *new_position, XmTextScanDirection dir, int ddir, XmTextPosition *last_char) { Boolean found = False; XmTextPosition position = *new_position; char mb_char[1 + MB_LEN_MAX]; char * c; while (position >= 0 && position <= data->length) { /* DELTA: Look now returns a pointer */ /* DELTA: EFFECIENCY: LEAVE AS SHORT*, INT*, ... COMPARE TO PSWC_NWLN */ c = Look(data, position, dir); (void) _XmTextCharactersToBytes(mb_char, c, 1, (int)data->widgets[0]->text.char_size); if (*mb_char == '\n') { /* DELTA: Look now returns a pointer */ c = Look(data, position + ddir, dir); (void) _XmTextCharactersToBytes(mb_char, c, 1, (int)data->widgets[0]->text.char_size); while (isspace((unsigned char)*mb_char)) { if (*mb_char == '\n') { found = True; while (isspace((unsigned char)*mb_char)) { /* DELTA: Look now returns a pointer */ c = Look(data, position + ddir, dir); (void) _XmTextCharactersToBytes(mb_char, c, 1, (int)data->widgets[0]->text.char_size); Increment(data, position, dir); } break; } /* DELTA: Look now returns a pointer */ c = Look(data, position + ddir, dir); (void) _XmTextCharactersToBytes(mb_char, c, 1, (int)data->widgets[0]->text.char_size); Increment(data, position, dir); /* BEGIN 3145 fix -- Do not bypass a nonspace character */ if (!isspace((unsigned char)*c)) *last_char = (position) + ddir; /* END 3145 */ } if (found) break; } else if (!isspace((unsigned char)*mb_char)) { *last_char = (position) + ddir; } if(((dir == XmsdRight) && (position == data->length)) || ((dir == XmsdLeft) && (position == 0))) break; Increment(data, position, dir); } *new_position = position; } static XmTextPosition Scan(XmTextSource source, XmTextPosition pos, XmTextScanType sType, XmTextScanDirection dir, int count, #if NeedWidePrototypes int include) #else Boolean include) #endif /* NeedWidePrototypes */ { register long whiteSpace = -1; register XmTextPosition position = pos; register int i; XmTextPosition temp; XmSourceData data = source->data; XmTextWidget tw = (XmTextWidget)data->widgets[0]; char * c; BITS16 * bits16_ptr; wchar_t * wchar_t_ptr; char mb_char[1 + MB_LEN_MAX]; Boolean start_is_mb, cur_is_mb; /* False == 1-byte char, else multi-byte */ int num_bytes = 0; int ddir = (dir == XmsdRight) ? 1 : -1; switch (sType) { case XmSELECT_POSITION: if (!include && count > 0) count -= 1; for (i = 0; i < count; i++) { Increment(data, position, dir); } break; case XmSELECT_WHITESPACE: case XmSELECT_WORD: if (tw->text.char_size == 1) { char * c; for (i = 0; i < count; i++) { whiteSpace = -1; while (position >= 0 && position <= data->length) { c = Look(data, position, dir); if (c && isspace((unsigned char)*c)) { if (whiteSpace < 0) whiteSpace = position; #ifdef FIX_1320 if (*c == '\n') break; #endif } else if (whiteSpace >= 0) break; position += ddir; } } } else { for (i = 0; i < count; i++) { whiteSpace = -1; num_bytes = _XmTextCharactersToBytes(mb_char, Look(data, position, dir), 1,(int)tw->text.char_size); start_is_mb = (num_bytes < 2 ? False : True); while (position >= 0 && position <= data->length) { num_bytes = _XmTextCharactersToBytes(mb_char, Look(data, position, dir), 1, (int)tw->text.char_size); cur_is_mb = (num_bytes < 2 ? False : True); if (!cur_is_mb && isspace((unsigned char)*mb_char)) { if (whiteSpace < 0) whiteSpace = position; } else if ((sType == XmSELECT_WORD) && (start_is_mb ^ cur_is_mb)) { if (whiteSpace < 0) whiteSpace = position; break; } else if (whiteSpace >= 0) break; position += ddir; } } } if (!include) { if(whiteSpace < 0 && dir == XmsdRight) whiteSpace = data->length; position = whiteSpace; } break; case XmSELECT_LINE: for (i = 0; i < count; i++) { while (position >= 0 && position <= data->length) { /* DELTA: Look now returns a pointer */ if ((int)tw->text.char_size == 1) { c = Look(data, position, dir); if ((c == '\0') || (*c == *data->PSWC_NWLN)) break; } else if ((int)tw->text.char_size == 2) { bits16_ptr = (BITS16 *) Look(data, position, dir); if ((bits16_ptr == NULL) || (*bits16_ptr == *(BITS16 *)data->PSWC_NWLN)) break; } else { /* MB_CUR_MAX == 3 or 4 or more */ wchar_t_ptr = (wchar_t *) Look(data, position, dir); if ((wchar_t_ptr == NULL) || (*wchar_t_ptr == *(wchar_t *)data->PSWC_NWLN)) break; } if(((dir == XmsdRight) && (position == data->length)) || ((dir == XmsdLeft) && (position == 0))) break; Increment(data, position, dir); } if (i + 1 != count) Increment(data, position, dir); } if (include) { /* later!!!check for last char in file # eol */ Increment(data, position, dir); } break; case XmSELECT_PARAGRAPH: /* Muliple paragraph scanning is not guarenteed to work. */ for (i = 0; i < count; i++) { XmTextPosition start_position = position; XmTextPosition last_char = position; /* if scanning forward, check for between paragraphs condition */ if (dir == XmsdRight) { /* DELTA: Look now returns a pointer */ c = Look(data, position, dir); (void) _XmTextCharactersToBytes(mb_char, Look(data, position, dir), 1, (int)tw->text.char_size); /* if is space, go back to first non-space */ while (isspace((unsigned char)*mb_char)) { if (position > 0) position--; else if (position == 0) break; (void) _XmTextCharactersToBytes(mb_char, Look(data, position, dir), 1, (int)tw->text.char_size); } } temp = position; ScanParagraph(data, &temp, dir, ddir, &last_char); position = temp; /* * If we are at the beginning of the paragraph and we are * scanning left, we need to rescan to find the character * at the beginning of the next paragraph. */ if (dir == XmsdLeft) { /* If we started at the beginning of the paragraph, rescan */ if (last_char == start_position) { temp = position; ScanParagraph(data, &temp, dir, ddir, &last_char); } /* * Set position to the last non-space * character that was scanned. */ position = last_char; } if (i + 1 != count) Increment(data, position, dir); } if (include) { Increment(data, position, dir); } break; case XmSELECT_ALL: default: if (dir == XmsdLeft) position = 0; else position = data->length; } if (position < 0) position = 0; if (position > data->length) position = data->length; return(position); } static Boolean GetSelection(XmTextSource source, XmTextPosition *left, XmTextPosition *right) { XmSourceData data = source->data; if (data->hasselection && data->left < data->right && data->left >= 0) { *left = data->left; *right = data->right; return True; } else { *left = *right = 0; data->hasselection = False; data->take_selection = True; } return False; } static void SetSelection(XmTextSource source, XmTextPosition left, XmTextPosition right, /* if right == -999, then we're in LoseSelection, so don't call XtDisownSelection.*/ Time set_time) { XmSourceData data = source->data; XmTextWidget tw; int i; int oldleft, oldright; if (!XtIsRealized((Widget)data->widgets[0]) || (left > right && !data->hasselection)) return; if (left < 0) left = right = 0; for (i=0; inumwidgets; i++) { tw = (XmTextWidget)(data->widgets[i]); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); _XmTextDisableRedisplay(data->widgets[i], FALSE); if (data->hasselection) _XmTextSetHighlight((Widget)data->widgets[i], data->left, data->right, XmHIGHLIGHT_NORMAL); data->widgets[i]->text.output->data->refresh_ibeam_off = True; } oldleft = data->left; oldright = data->right; data->left = left; data->right = right; if (data->numwidgets > 0) { Widget widget = (Widget) data->widgets[0]; tw = (XmTextWidget)widget; if (!set_time) set_time = _XmValidTimestamp(widget); if (left <= right) { if (data->take_selection || (oldleft == oldright && left != right)) { if (!XmePrimarySource(widget, set_time)) { (*source->SetSelection)(source, 1, 0, set_time); } else { XmAnyCallbackStruct cb; data->prim_time = set_time; data->hasselection = True; data->take_selection = False; cb.reason = XmCR_GAIN_PRIMARY; cb.event = NULL; XtCallCallbackList ((Widget) data->widgets[0], data->widgets[0]->text.gain_primary_callback, (XtPointer) &cb); } } if (data->hasselection && data->left < data->right) { for (i=0; inumwidgets; i++) { _XmTextSetHighlight((Widget) data->widgets[i], data->left, data->right, XmHIGHLIGHT_SELECTED); } } if (left == right) tw->text.add_mode = False; } else { if (right != -999) XtDisownSelection(widget, XA_PRIMARY, set_time); data->hasselection = False; data->take_selection = True; tw->text.add_mode = False; } } for (i=0; inumwidgets; i++) { tw = (XmTextWidget)(data->widgets[i]); _XmTextEnableRedisplay(data->widgets[i]); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); } } /* Public routines. */ void _XmTextValueChanged(XmTextWidget initiator, XEvent *event) { XmAnyCallbackStruct cb; cb.reason = XmCR_VALUE_CHANGED; cb.event = event; if (initiator->text.value_changed_callback) XtCallCallbackList((Widget)initiator, initiator->text.value_changed_callback, (XtPointer)&cb); } XmTextSource _XmStringSourceCreate(char *value, #if NeedWidePrototypes int is_wchar) #else Boolean is_wchar) #endif /* NeedWidePrototypes */ { XmTextSource source; XmSourceData data; int num_chars; char newline = '\n'; wchar_t *wc_value; char * tmp_value; int char_size, max_char_size; int ret_value = 0; source = (XmTextSource) XtMalloc((unsigned) sizeof(XmTextSourceRec)); data = source->data = (XmSourceData) XtMalloc((unsigned) sizeof(XmSourceDataRec)); source->AddWidget = AddWidget; source->CountLines = CountLines; source->RemoveWidget = RemoveWidget; source->ReadSource = ReadSource; source->Replace = (ReplaceProc) Replace; source->Scan = Scan; source->GetSelection = GetSelection; source->SetSelection = SetSelection; data->source = source; switch (MB_CUR_MAX) { case 1: case 2: max_char_size = char_size = MB_CUR_MAX; break; case 0: max_char_size = char_size = 1; break; default: max_char_size = MB_CUR_MAX; char_size = sizeof(wchar_t); } if (is_wchar) { for (num_chars = 0, wc_value = (wchar_t*)value; wc_value[num_chars] != 0L; num_chars++) /*EMPTY*/; data->maxlength = TEXT_INITIAL_INCREM; while ((num_chars + 1) >= data->maxlength) { if (data->maxlength < TEXT_INCREMENT) data->maxlength *= 2; else data->maxlength += TEXT_INCREMENT; } data->old_length = 0; data->ptr = XtMalloc((unsigned)((data->maxlength) * char_size)); tmp_value = XtMalloc((unsigned)((num_chars + 1) * max_char_size)); ret_value = wcstombs(tmp_value, wc_value, (num_chars + 1) * max_char_size); data->value = NULL; /* Scratch area for block->ptr conversions */ /* Doesnt include NULL */ if (ret_value < 0) data->length = 0; else data->length = _XmTextBytesToCharacters(data->ptr, tmp_value, num_chars, False, max_char_size); XtFree(tmp_value); } else { if (value) num_chars = _XmTextCountCharacters(value, strlen(value)); else num_chars = 0; data->maxlength = TEXT_INITIAL_INCREM; while ((num_chars + 1) >= data->maxlength) { if (data->maxlength < TEXT_INCREMENT) data->maxlength *= 2; else data->maxlength += TEXT_INCREMENT; } data->old_length = 0; data->ptr = XtMalloc((unsigned)((data->maxlength) * char_size)); data->value = NULL; /* Scratch area for block->ptr conversions */ data->length = _XmTextBytesToCharacters(data->ptr, value, num_chars, False, max_char_size); } data->PSWC_NWLN = (char *) XtMalloc(char_size); _XmTextBytesToCharacters(data->PSWC_NWLN, &newline, 1, False, max_char_size); data->numwidgets = 0; data->widgets = (XmTextWidget *) XtMalloc((unsigned) sizeof(XmTextWidget)); data->hasselection = False; data->take_selection = True; data->left = data->right = 0; data->editable = True; data->maxallowed = INT_MAX; data->gap_start = data->ptr + (data->length * char_size); data->gap_end = data->ptr + ((data->maxlength - 1) * char_size); data->prim_time = 0; return source; } void _XmStringSourceDestroy(XmTextSource source) { XtFree((char *) source->data->ptr); XtFree((char *) source->data->value); XtFree((char *) source->data->widgets); XtFree((char *) source->data->PSWC_NWLN); XtFree((char *) source->data); XtFree((char *) source); source = NULL; } char * _XmStringSourceGetValue(XmTextSource source, #if NeedWidePrototypes int want_wchar) #else Boolean want_wchar) #endif /* NeedWidePrototypes */ { XmSourceData data = source->data; XmTextWidget tw = (XmTextWidget) data->widgets[0]; XmTextBlockRec block; int length = 0; XmTextPosition pos = 0; XmTextPosition ret_pos = 0; XmTextPosition last_pos = 0; char * temp; wchar_t * wc_temp; int return_val; if (!want_wchar) { if (data->length > 0) temp = (char *) XtMalloc((unsigned) (data->length + 1) * (int)tw->text.char_size); else return(XtNewString("")); last_pos = (XmTextPosition) data->length; while (pos < last_pos) { ret_pos = ReadSource(source, pos, last_pos, &block); if (block.length == 0) break; (void)memcpy((void*)&temp[length], (void*)block.ptr, block.length); length += block.length; pos = ret_pos; } temp[length] = '\0'; return (temp); } else { if (data->length > 0) wc_temp = (wchar_t*)XtMalloc((unsigned) (data->length+1) * sizeof(wchar_t)); else { wc_temp = (wchar_t*)XtMalloc((unsigned) sizeof(wchar_t)); wc_temp[0] = (wchar_t)0L; return (char*) wc_temp; } last_pos = (XmTextPosition) data->length; while (pos < last_pos) { ret_pos = ReadSource(source, pos, last_pos, &block); if (block.length == 0) break; /* NOTE: ret_pos - pos could result in a truncated long. */ return_val = mbstowcs(&wc_temp[length], block.ptr, (int)(ret_pos - pos)); if (return_val > 0) length += return_val; pos = ret_pos; } wc_temp[length] = (wchar_t)0L; return ((char*)wc_temp); } } void _XmStringSourceSetValue(XmTextWidget tw, char *value) { XmTextSource source = tw->text.source; XmSourceData data = source->data; Boolean editable, freeBlock; int maxallowed; XmTextBlockRec block, newblock; XmTextPosition fromPos = 0; XmTextPosition toPos = data->length; (*source->SetSelection)(source, 1, 0, XtLastTimestampProcessed(XtDisplay(tw))); block.format = XmFMT_8_BIT; block.length = strlen(value); block.ptr = value; editable = data->editable; maxallowed = data->maxallowed; data->editable = TRUE; data->maxallowed = INT_MAX; _XmTextSetHighlight((Widget)tw, 0, tw->text.last_position, XmHIGHLIGHT_NORMAL); if (_XmTextModifyVerify(tw, NULL, &fromPos, &toPos, NULL, &block, &newblock, &freeBlock)) { (void)(source->Replace)(tw, NULL, &fromPos, &toPos, &newblock, False); if (freeBlock && newblock.ptr) XtFree(newblock.ptr); _XmTextValueChanged(tw, NULL); } data->editable = editable; data->maxallowed = maxallowed; } Boolean _XmStringSourceHasSelection(XmTextSource source) { return source->data->hasselection; } Boolean _XmStringSourceGetEditable(XmTextSource source) { return source->data->editable; } void _XmStringSourceSetEditable(XmTextSource source, #if NeedWidePrototypes int editable) #else Boolean editable) #endif /* NeedWidePrototypes */ { source->data->editable = editable; } int _XmStringSourceGetMaxLength(XmTextSource source) { return source->data->maxallowed; } void _XmStringSourceSetMaxLength(XmTextSource source, int max) { source->data->maxallowed = max; } motif-2.3.8/lib/Xm/JpegI.h0000644000175000017500000000065512672140200012064 00000000000000#ifndef _XmJpegI_h #define _XmJpegI_h #include #include #include #include typedef struct _XmJpegErrorMgrRec { struct jpeg_error_mgr pub; jmp_buf setjmp_buffer; } XmJpegErrorMgrRec, *XmJpegErrorMgr; typedef struct { JSAMPLE red, green, blue; } CTable; void _XmJpegErrorExit(j_common_ptr cinfo); int _XmJpegGetImage(Screen *screen, FILE *infile, XImage **ximage); #endif motif-2.3.8/lib/Xm/MenuUtilP.h0000644000175000017500000000225013145162623012752 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMenuUtilP_h #define _XmMenuUtilP_h #include #include #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuUtilP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Draw.c0000644000175000017500000003431513145162623011767 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Draw.c /main/12 1995/10/25 20:02:15 cde-sun $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include /********************************************************************* * Only goes in this module the Draw API used by everybody in Xm. * Anything specific to a class should go in its own Dr*.c module. *********************************************************************/ /******** Static Function Declarations ********/ static void DrawSimpleShadow(Display *display, Drawable d, GC top_gc, GC bottom_gc, Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension cor); /******** End Static Function Declarations ********/ /*-------------------- Private functions ----------------------*/ /*-------------------------------------------------------------*/ static void DrawSimpleShadow (Display *display, Drawable d, GC top_gc, GC bottom_gc, Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension cor) /* New implementation (1.2 vs 1.1) uses XSegments instead of XRectangles. */ /* Used for the simple shadow, the etched shadow and the separators */ /* Segment has been faster than Rectangles in all my benches, either on Hp, Sun or Pmax. Lines has been slower, that I don't understand... */ { static XSegment * segms = NULL; static int segm_count = 0; register int i, size2, size3; if (!d) return; ASSIGN_MIN(shadow_thick, (width >> 1)); ASSIGN_MIN(shadow_thick, (height >> 1)); if (shadow_thick <= 0) return; size2 = (shadow_thick << 1); size3 = size2 + shadow_thick; _XmProcessLock(); if (segm_count < shadow_thick) { segms = (XSegment *) XtRealloc((char*)segms, sizeof (XSegment) * (size2 << 1)); segm_count = shadow_thick; } for (i = 0; i < shadow_thick; i++) { /* Top segments */ segms[i].x1 = x; segms[i].y2 = segms[i].y1 = y + i; segms[i].x2 = x + width - i - 1; /* Left segments */ segms[i + shadow_thick].x2 = segms[i + shadow_thick].x1 = x + i; segms[i + shadow_thick].y1 = y + shadow_thick; segms[i + shadow_thick].y2 = y + height - i - 1; /* Bottom segments */ segms[i + size2].x1 = x + i + ((cor)?0:1) ; segms[i + size2].y2 = segms[i + size2].y1 = y + height - i - 1; segms[i + size2].x2 = x + width - 1 ; /* Right segments */ segms[i + size3].x2 = segms[i + size3].x1 = x + width - i - 1; segms[i + size3].y1 = y + i + 1 - cor; segms[i + size3].y2 = y + height - 1 ; } XDrawSegments (display, d, top_gc, &segms[0], size2); XDrawSegments (display, d, bottom_gc, &segms[size2], size2); _XmProcessUnlock(); } /**************************** Public functions *************************/ /***********************************************************************/ /****************************XmeDrawShadows****************************/ void XmeDrawShadows(Display *display, Drawable d, GC top_gc, GC bottom_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shad_thick, #else Position x, Position y, Dimension width, Dimension height, Dimension shad_thick, #endif unsigned int shad_type) { GC tmp_gc ; XtAppContext app; if(!d) return ; app = XtDisplayToApplicationContext(display); _XmAppLock(app); if ((shad_type == XmSHADOW_IN) || (shad_type == XmSHADOW_ETCHED_IN)) { tmp_gc = top_gc ; top_gc = bottom_gc ; /* switch top and bottom shadows */ bottom_gc = tmp_gc ; } if ((shad_type == XmSHADOW_ETCHED_IN || shad_type == XmSHADOW_ETCHED_OUT) && (shad_thick != 1)) { DrawSimpleShadow (display, d, top_gc, bottom_gc, x, y, width, height, shad_thick/2, 1); DrawSimpleShadow (display, d, bottom_gc, top_gc, x + shad_thick/2, y + shad_thick/2, width - (shad_thick/2)*2, height - (shad_thick/2)*2, shad_thick/2, 1); } else DrawSimpleShadow (display, d, top_gc, bottom_gc, x, y, width, height, shad_thick, 0); _XmAppUnlock(app); } /*****************************XmeClearBorder*********************************/ void XmeClearBorder (Display *display, Window w, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick) #endif /* NeedWidePrototypes */ { XtAppContext app; if (!w || !shadow_thick || !width || !height) return ; app = XtDisplayToApplicationContext(display); _XmAppLock(app); XClearArea (display, w, x, y, width, shadow_thick, FALSE); XClearArea (display, w, x, y + height - shadow_thick, width, shadow_thick, FALSE); XClearArea (display, w, x, y, shadow_thick, height, FALSE); XClearArea (display, w, x + width - shadow_thick, y, shadow_thick, height, FALSE); _XmAppUnlock(app); } /****************************XmeDrawHighlight*************************/ void XmeDrawHighlight(Display *display, Drawable d, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int highlight_thickness) #else Position x, Position y, Dimension width, Dimension height, Dimension highlight_thickness) #endif /* NeedWidePrototypes */ { XRectangle rect[4] ; XtAppContext app; if (!d || !highlight_thickness || !width || !height) return ; app = XtDisplayToApplicationContext(display); _XmAppLock(app); rect[0].x = rect[1].x = rect[2].x = x ; rect[3].x = x + width - highlight_thickness ; rect[0].y = rect[2].y = rect[3].y = y ; rect[1].y = y + height - highlight_thickness ; rect[0].width = rect[1].width = width ; rect[2].width = rect[3].width = highlight_thickness ; rect[0].height = rect[1].height = highlight_thickness ; rect[2].height = rect[3].height = height ; XFillRectangles (display, d, gc, rect, 4); _XmAppUnlock(app); } /******************************XmeDrawSeparator**********************/ void XmeDrawSeparator(Display *display, Drawable d, GC top_gc, GC bottom_gc, GC separator_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, int margin, unsigned int orientation, unsigned int separator_type) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension margin, unsigned char orientation, unsigned char separator_type) #endif /* NeedWidePrototypes */ { Position center; XSegment segs[2]; GC tmp_gc; int i, ndash, shadow_dash_size ; XtAppContext app; if (!d || (separator_type == XmNO_LINE)) return ; app = XtDisplayToApplicationContext(display); _XmAppLock(app); if (orientation == XmHORIZONTAL) { center = y + height / 2; } else { center = x + width / 2; } if (separator_type == XmSINGLE_LINE || separator_type == XmSINGLE_DASHED_LINE) { if (orientation == XmHORIZONTAL) { segs[0].x1 = x + margin; segs[0].y1 = segs[0].y2 = center; segs[0].x2 = x + width - margin - 1; } else { segs[0].y1 = y + margin; segs[0].x1 = segs[0].x2 = center; segs[0].y2 = y + height - margin - 1; } XDrawSegments (display, d, separator_gc, segs, 1); _XmAppUnlock(app); return; } if (separator_type == XmDOUBLE_LINE || separator_type == XmDOUBLE_DASHED_LINE) { if (orientation == XmHORIZONTAL) { segs[0].x1 = segs[1].x1 = x + margin; segs[0].x2 = segs[1].x2 = x + width - margin - 1; segs[0].y1 = segs[0].y2 = center - 1; segs[1].y1 = segs[1].y2 = center + 1; } else { segs[0].y1 = segs[1].y1 = y + margin; segs[0].y2 = segs[1].y2 = y + height - margin - 1; segs[0].x1 = segs[0].x2 = center - 1; segs[1].x1 = segs[1].x2 = center + 1; } XDrawSegments (display, d, separator_gc, segs, 2); _XmAppUnlock(app); return; } /* only shadowed stuff in the following, so shadowThickness has to be something real */ if (!shadow_thick) { _XmAppUnlock(app); return ; } /* do the in/out effect now */ if (separator_type == XmSHADOW_ETCHED_IN || separator_type == XmSHADOW_ETCHED_IN_DASH) { tmp_gc = top_gc ; top_gc = bottom_gc ; bottom_gc = tmp_gc ; } /* In the following, we need to special case the shadow_thick = 2 or 3 case, since : it's the default and we don't like changes in visual here, and also it looks non symetrical the way it is without special code: ...... .,,,,, and you really want to have ...... ,,,,,, So we won't use DrawSimpleShadow in this case, painful but hey.. */ /* Now the regular shadowed cases, in one pass with one looong dash for the non dashed case */ if (separator_type == XmSHADOW_ETCHED_IN_DASH || separator_type == XmSHADOW_ETCHED_OUT_DASH) /* for now, shadowed dash use three time the shadow thickness as a dash size, and worried about the shadow_thick odd values as well */ shadow_dash_size = (shadow_thick/2)*2*3 ; else /* regular case, only one dash, the length of the separator */ shadow_dash_size = (orientation == XmHORIZONTAL)? (width - 2*margin):(height - 2*margin) ; /* special case for shadowThickness = 1 */ if (shadow_dash_size == 0) shadow_dash_size = 5 ; /* ndash value will be 1 for the regular shadow case (not dashed) */ if (orientation == XmHORIZONTAL) { ndash = ((width - 2*margin)/shadow_dash_size + 1)/2 ; for (i=0; i 1) XDrawLine(display, d, bottom_gc, x + margin + 2*i*shadow_dash_size, center, x + margin + (2*i + 1)*shadow_dash_size -1, center); } else { DrawSimpleShadow(display, d, top_gc, bottom_gc, x + margin + i*2*shadow_dash_size, center - shadow_thick/2, shadow_dash_size, (shadow_thick/2)*2, shadow_thick/2, 0); } /* draw the last dash, with possibly a different size */ if (i*2*shadow_dash_size < (width - 2*margin)) { if (shadow_thick < 4) { XDrawLine(display, d, top_gc, x + margin + 2*i*shadow_dash_size, center - shadow_thick/2, x + (width - 2*margin), center - shadow_thick/2); if (shadow_thick > 1) { XDrawLine(display, d, bottom_gc, x + margin + 2*i*shadow_dash_size, center, x + (width - 2*margin), center); } } else { DrawSimpleShadow(display, d, top_gc, bottom_gc, x + margin + i*2*shadow_dash_size, center - shadow_thick/2, (width - 2*margin) - i*2*shadow_dash_size, (shadow_thick/2)*2, shadow_thick/2, 0); } } } else { ndash = ((height - 2*margin)/shadow_dash_size + 1)/2 ; for (i=0; i 1) XDrawLine(display, d, bottom_gc, center, y + margin + 2*i*shadow_dash_size, center, y + margin + (2*i + 1)*shadow_dash_size -1); } else { DrawSimpleShadow(display, d, top_gc, bottom_gc, center - shadow_thick/2, y + margin + i*2*shadow_dash_size, (shadow_thick/2)*2, shadow_dash_size, shadow_thick/2, 0); } if (i*2*shadow_dash_size < (height - 2*margin)) { if (shadow_thick < 4) { XDrawLine(display, d, top_gc, center - shadow_thick/2, y + margin + 2*i*shadow_dash_size, center - shadow_thick/2, y + (height - 2*margin)); if (shadow_thick > 1) XDrawLine(display, d, bottom_gc, center, y + margin + 2*i*shadow_dash_size, center, y + (height - 2*margin)); } else { DrawSimpleShadow(display, d, top_gc, bottom_gc, center - shadow_thick/2, y + margin + i*2*shadow_dash_size, (shadow_thick/2)*2, (height - 2*margin) - i*2*shadow_dash_size, shadow_thick/2, 0); } } } _XmAppUnlock(app); } motif-2.3.8/lib/Xm/IconGP.h0000644000175000017500000002213612672140200012203 00000000000000/* $XConsortium: IconGP.h /main/9 1995/10/25 20:06:59 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmIconGP_h #define _XmIconGP_h #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef Widget (*XmGetContainerParentProc)(Widget) ; #define XmInheritGetContainerParentProc ((XmGetContainerParentProc) _XtInherit) /* IconGadget class record */ typedef struct _XmIconGadgetClassPart { XmGetContainerParentProc get_container_parent; XtPointer extension ; } XmIconGadgetClassPart; /* Full class record declaration */ typedef struct _XmIconGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmIconGadgetClassPart icong_class; } XmIconGadgetClassRec; extern XmIconGadgetClassRec xmIconGadgetClassRec; /*****************************************************************/ /* The Icon Gadget Cache Object's class and instance records*/ /*****************************************************************/ typedef struct _XmIconGCacheObjClassPart { XtPointer extension; } XmIconGCacheObjClassPart; typedef struct _XmIconGCacheObjClassRec /* Icon cache class record */ { ObjectClassPart object_class; XmExtClassPart ext_class; XmIconGCacheObjClassPart icon_class_cache; } XmIconGCacheObjClassRec; externalref XmIconGCacheObjClassRec xmIconGCacheObjClassRec; /* The Icon Gadget Cache instance record */ typedef struct _XmIconGCacheObjPart { XmRenderTable render_table; /* XmNrenderTable */ GC selected_GC; GC inverse_GC; Pixel background; Pixel foreground; Pixel top_shadow_color; Pixel bottom_shadow_color; Pixel highlight_color; Pixmap background_pixmap; Pixmap top_shadow_pixmap; Pixmap bottom_shadow_pixmap; Pixmap highlight_pixmap; GC normal_GC; GC background_GC; GC insensitive_GC; GC top_shadow_GC; GC bottom_shadow_GC; GC highlight_GC; unsigned char alignment; Dimension spacing; Dimension margin_width; Dimension margin_height; #ifdef FIX_1381 GC shadow_GC; #endif } XmIconGCacheObjPart; typedef struct _XmIconGCacheObjRec { ObjectPart object; XmExtPart ext; XmIconGCacheObjPart icon_cache; } XmIconGCacheObjRec; typedef struct _XmIconGCacheObjRec * XmIconGCacheObject; /* IconGadget instance record */ typedef struct _XmIconGadgetPart { XmString label_string; /* XmNlabelString */ Pixmap large_icon_mask; /* XmNlargeIconMask */ Pixmap large_icon_pixmap; /* XmNlargeIconPixmap */ Pixmap small_icon_mask; /* XmNsmallIconMask */ Pixmap small_icon_pixmap; /* XmNsmallIconPixmap */ unsigned char viewtype; /* XmNviewType */ unsigned char visual_emphasis; /* XmNvisualEmphasis */ XmString * detail; /* XmNdetail */ Cardinal detail_count; /* XmNdetailCount */ /* Private variables */ Dimension label_rect_width ; Dimension label_rect_height ; Dimension large_icon_rect_width; Dimension large_icon_rect_height; Dimension small_icon_rect_width; Dimension small_icon_rect_height; String large_pixmap_name ; String small_pixmap_name ; XmIconGCacheObjPart *cache; Boolean check_set_render_table; } XmIconGadgetPart; /* Full instance record declaration */ typedef struct _XmIconGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmIconGadgetPart icong; } XmIconGadgetRec; /* Useful macros */ #define IG_LabelString(w) (((XmIconGadget)(w))->icong.label_string) #define IG_LargeIconMask(w) (((XmIconGadget)(w))->icong.large_icon_mask) #define IG_LargeIconPixmap(w) (((XmIconGadget)(w))->icong.large_icon_pixmap) #define IG_SmallIconMask(w) (((XmIconGadget)(w))->icong.small_icon_mask) #define IG_SmallIconPixmap(w) (((XmIconGadget)(w))->icong.small_icon_pixmap) #define IG_ViewType(w) (((XmIconGadget)(w))->icong.viewtype) #define IG_VisualEmphasis(w) (((XmIconGadget)(w))->icong.visual_emphasis) #define IG_Detail(w) (((XmIconGadget)(w))->icong.detail) #define IG_DetailCount(w) (((XmIconGadget)(w))->icong.detail_count) #define IG_LabelRectWidth(w) (((XmIconGadget)(w))->icong.label_rect_width) #define IG_LabelRectHeight(w) (((XmIconGadget)(w))->icong.label_rect_height) #define IG_LargeIconRectWidth(w) \ (((XmIconGadget)(w))->icong.large_icon_rect_width) #define IG_LargeIconRectHeight(w) \ (((XmIconGadget)(w))->icong.large_icon_rect_height) #define IG_SmallIconRectWidth(w) \ (((XmIconGadget)(w))->icong.small_icon_rect_width) #define IG_SmallIconRectHeight(w) \ (((XmIconGadget)(w))->icong.small_icon_rect_height) #define IG_LargePixmapName(w) (((XmIconGadget)(w))->icong.large_pixmap_name) #define IG_SmallPixmapName(w) (((XmIconGadget)(w))->icong.small_pixmap_name) /* XmNrecomputeSize didn't make it as a resource, but since the code is already written, I'll keep it and force its value here. If it's ever wanted back, just replace that macro by: #define IG_RecomputeSize(w) (((XmIconGadget)(w))->icong.recompute_size) */ #define IG_RecomputeSize(w) (True) #define IG_LayoutDirection(w) (((XmIconGadget)(w))->gadget.layout_direction) #define IG_Highlighted(w) (((XmIconGadget)(w))->gadget.highlighted) #define IG_HLThickness(w) (((XmIconGadget)(w))->gadget.highlight_thickness) #define IG_ShadowThickness(w) (((XmIconGadget)(w))->gadget.shadow_thickness) #define IG_Depth(w) (((XmManagerWidget) \ (((XmGadget)(w))->object.parent))->core.depth) /* cached resources for IconGadget */ #define IG_RenderTable(w) (((XmIconGadget)(w))-> \ icong.cache->render_table) #define IG_SelectedGC(w) (((XmIconGadget)(w))-> \ icong.cache->selected_GC) #define IG_InverseGC(w) (((XmIconGadget)(w))-> \ icong.cache->inverse_GC) /** These are gadget resources really. hopefully in 2.1, that will be replaced by stuff like: #define IG_Background(w) Gad_Background(w) #define IG_BackgroundGC(w) Gad_BackgroundGC(w) etc, etc ***/ #define IG_Background(w) (((XmIconGadget)(w))-> \ icong.cache->background) #define IG_Foreground(w) (((XmIconGadget)(w))-> \ icong.cache->foreground) #define IG_TopShadowColor(w) (((XmIconGadget)(w))-> \ icong.cache->top_shadow_color) #define IG_BottomShadowColor(w) (((XmIconGadget)(w))-> \ icong.cache->bottom_shadow_color) #define IG_HighlightColor(w) (((XmIconGadget)(w))-> \ icong.cache->highlight_color) #define IG_BackgroundPixmap(w) (((XmIconGadget)(w))-> \ icong.cache->background_pixmap) #define IG_TopShadowPixmap(w) (((XmIconGadget)(w))-> \ icong.cache->top_shadow_pixmap) #define IG_BottomShadowPixmap(w) (((XmIconGadget)(w))-> \ icong.cache->bottom_shadow_pixmap) #define IG_HighlightPixmap(w) (((XmIconGadget)(w))-> \ icong.cache->highlight_pixmap) #define IG_NormalGC(w) (((XmIconGadget)(w))-> \ icong.cache->normal_GC) #define IG_BackgroundGC(w) (((XmIconGadget)(w))-> \ icong.cache->background_GC) #define IG_InsensitiveGC(w) (((XmIconGadget)(w))-> \ icong.cache->insensitive_GC) #ifdef FIX_1381 #define IG_ShadowGC(w) (((XmIconGadget)(w))-> \ icong.cache->shadow_GC) #endif #define IG_TopShadowGC(w) (((XmIconGadget)(w))-> \ icong.cache->top_shadow_GC) #define IG_BottomShadowGC(w) (((XmIconGadget)(w))-> \ icong.cache->bottom_shadow_GC) #define IG_HighlightGC(w) (((XmIconGadget)(w))-> \ icong.cache->highlight_GC) #define IG_Alignment(w) (((XmIconGadget)(w))-> \ icong.cache->alignment) #define IG_Spacing(w) (((XmIconGadget)(w))-> \ icong.cache->spacing) #define IG_MarginWidth(w) (((XmIconGadget)(w))-> \ icong.cache->margin_width) #define IG_MarginHeight(w) (((XmIconGadget)(w))-> \ icong.cache->margin_height) /* Convenience Macros */ #define IG_Cache(w) (((XmIconGadget)(w))->icong.cache) #define IG_ClassCachePart(w) (((XmIconGadgetClass)xmIconGadgetClass)->\ gadget_class.cache_part) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIconGP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/RCLayout.c0000644000175000017500000021223412672140200012561 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char *rcsid = "$XConsortium: RCLayout.c /main/6 1995/10/25 20:14:15 cde-sun $"; #endif #endif #include #include #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include #include #include #include #include #include #include /* for bzero */ #include "LabelGI.h" #include "GeoUtilsI.h" #include "RCLayoutI.h" #include "RowColumnI.h" #include "XmI.h" #define RESOURCE_MIN_WIDTH 16 /* 'cuz it's the size of a hot spot... */ #define RESOURCE_MIN_HEIGHT 16 static void CalcHelp( XmRowColumnWidget m, Dimension *m_width, Dimension *m_height, #if NeedWidePrototypes int b, int max_x, int max_y, #else Dimension b, Position max_x, Position max_y, #endif /* NeedWidePrototypes */ Position *x, Position *y, #if NeedWidePrototypes int w, int h) ; #else Dimension w, Dimension h) ; #endif /* NeedWidePrototypes */ static void GetMaxValues( XmRowColumnWidget m, Dimension *border, Dimension *w, Dimension *h, int *items_per, Dimension *baseline, Dimension *shadow, Dimension *highlight, Dimension *margin_top, Dimension *margin_height, Dimension *text_height) ; static void AdjustLast( XmRowColumnWidget m, int start_i, #if NeedWidePrototypes int w, int h) ; #else Dimension w, Dimension h) ; #endif /* NeedWidePrototypes */ static void SetAsking( XmRowColumnWidget m, Dimension *m_width, Dimension *m_height, #if NeedWidePrototypes int b, int max_x, int max_y, int x, int y, int w, int h) ; #else Dimension b, Position max_x, Position max_y, Position x, Position y, Dimension w, Dimension h) ; #endif /* NeedWidePrototypes */ static void FindLargestOption( XmRowColumnWidget submenu, Dimension *c_width, Dimension *c_height) ; static void TopOrBottomAlignment( XmRowColumnWidget m, #if NeedWidePrototypes int h, int shadow, int highlight, int baseline, int margin_top, int margin_height, int text_height, #else Dimension h, Dimension shadow, Dimension highlight, Dimension baseline, Dimension margin_top, Dimension margin_height, Dimension text_height, #endif /* NeedWidePrototypes */ Dimension *new_height, int start_i, int end_i) ; static void BaselineAlignment( XmRowColumnWidget m, #if NeedWidePrototypes int h, int shadow, int highlight, int baseline, #else Dimension h, Dimension shadow, Dimension highlight, Dimension baseline, #endif /* NeedWidePrototypes */ Dimension *new_height, int start_i, int end_i) ; static void CenterAlignment( XmRowColumnWidget m, #if NeedWidePrototypes int h, #else Dimension h, #endif /* NeedWidePrototypes */ int start_i, int end_i) ; static void ComputeTearOffHeight( XmRowColumnWidget m, Dimension *toc_b, Dimension *b, Dimension *toc_height, int *start_i, int *child_i, int r); static void LayoutColumn( XmRowColumnWidget m, Dimension *m_width, Dimension *m_height) ; static void LayoutVerticalTight( XmRowColumnWidget m, Dimension *m_width, Dimension *m_height) ; static void LayoutHorizontaltight( XmRowColumnWidget m, Dimension *m_width, Dimension *m_height) ; static void LayoutNone( XmRowColumnWidget m, Dimension *m_width, Dimension *m_height) ; static void LayoutOptionAndSize( register XmRowColumnWidget menu, Dimension *width, Dimension *height, Widget instigator, XtWidgetGeometry *request, #if NeedWidePrototypes int calcMenuDimension) ; #else Boolean calcMenuDimension) ; #endif /* NeedWidePrototypes */ static void GetMenuKidMargins( XmRowColumnWidget m, Dimension *width, Dimension *height, Dimension *left, Dimension *right, Dimension *top, Dimension *bottom ); /************************************************************************* * * This section is all the layout stuff, the whole thing has to operate * in two different modes, one: a read-only mode which * is nice for making decisions about the size of the row column vs. the size * of the children. two: a change everything mode which implements the * change. * * further complicated by the xtoolkit restriction that a subwidget making * a geo request (referred to as the 'instigator') of the row column may not * have his resize proc called but all other widget children must. * * this is done by building a set of XtWidgetGeometry request blocks, one * for each child (widget and gadget), which holds the changes we would like * to make for this child. If needed then another pass is made over the * requests to actually implement the changes. *************************************************************************/ /* * Decide where to put the help child. He better be the last one * 'cuz we may trash the x, y's */ static void CalcHelp( XmRowColumnWidget m, Dimension *m_width, /* if 0 then caller's asking */ Dimension *m_height, /* if 0 then caller's asking */ #if NeedWidePrototypes int b, int max_x, int max_y, #else Dimension b, Position max_x, Position max_y, #endif /* NeedWidePrototypes */ Position *x, Position *y, #if NeedWidePrototypes int w, int h ) #else Dimension w, Dimension h ) #endif /* NeedWidePrototypes */ { register Dimension subtrahend; if (IsVertical (m)) /* glue to bottom edge of ... */ { if (Asking (*m_height)) { if (RC_NCol (m) == 1) /* just use max_y */ *y = max_y; else /* go up from max_y */ { subtrahend = RC_Spacing (m) + h + b; *y = (max_y > (int)subtrahend) ? max_y - subtrahend : 0; } } else { subtrahend = MGR_ShadowThickness(m) + RC_MarginH (m) + h + b; *y = (*m_height > (int)subtrahend) ? *m_height - subtrahend : 0; } } else /* glue to right edge of ... */ { if (Asking (*m_width)) { if (RC_NCol (m) == 1) *x = max_x; else { subtrahend = RC_Spacing (m) + w + b; *x = (max_x > (int)subtrahend) ? max_x - subtrahend : 0; } } else { subtrahend = MGR_ShadowThickness(m) + RC_MarginW (m) + w + b; *x = (*m_width > (int)subtrahend) ? *m_width - subtrahend : 0; } } } /* * count the widest & tallest entry dimensions * and compute entries per row/column */ static void GetMaxValues( XmRowColumnWidget m, Dimension *border, Dimension *w, Dimension *h, int *items_per, Dimension *baseline, Dimension *shadow, Dimension *highlight, Dimension *margin_top, Dimension *margin_height, Dimension *text_height ) { XtWidgetGeometry *b; Widget k ; int i, n ; *border = *w = *h = *baseline = *shadow = *highlight = *margin_top = *margin_height = *text_height = 0; /* skip the tearoff control */ for (i = (RC_TearOffControl(m) && XtIsManaged(RC_TearOffControl(m)))? 1 : 0, n = 0; RC_Boxes (m) [i].kid != NULL; i++, n++) { b = &(RC_Boxes (m) [i].box); k = RC_Boxes (m) [i].kid ; ASSIGN_MAX(*w, BWidth (b)); ASSIGN_MAX(*h, BHeight (b)); if (XtIsWidget(k)) { ASSIGN_MAX(*border, k->core.border_width); } else if (XmIsGadget(k)) { ASSIGN_MAX(*border, ((XmGadget)k)->rectangle.border_width); } ASSIGN_MAX(*baseline, RC_Boxes (m) [i].baseline); if (XmIsGadget (k) || XmIsPrimitive (k) ) { XmBaselineMargins textMargins; _XmRC_SetOrGetTextMargins(k, XmBASELINE_GET, &textMargins); ASSIGN_MAX(*shadow, textMargins.shadow); ASSIGN_MAX(*highlight, textMargins.shadow); ASSIGN_MAX(*margin_top, textMargins.margin_top); ASSIGN_MAX(*margin_height, textMargins.margin_height); ASSIGN_MAX(*text_height, textMargins.text_height); } } *items_per = n / RC_NCol (m); /* calc column size */ if ((n % RC_NCol (m)) != 0) (*items_per)++; /* some left overs */ /* add another row/col */ } /* * Make sure that entries in the right most column/row extend all the * way to the right/bottom edge of the row column widget. This keeps * 'dead space' in the row column widget to a minimum. For single * column widgets, the only column is the right most. * */ static void AdjustLast( XmRowColumnWidget m, int start_i, #if NeedWidePrototypes int w, int h ) #else Dimension w, Dimension h ) #endif /* NeedWidePrototypes */ { XmRCKidGeometry kg = RC_Boxes (m); XtWidgetGeometry *b; register Dimension subtrahend; for ( ; kg [start_i].kid != NULL; start_i++) { b = &(kg[start_i].box); if (IsVertical (m)) { subtrahend = MGR_ShadowThickness(m) + RC_MarginW (m) + BX (b) + Double (BBorder (b)); /* if w (rowcol width) is greater than subtrahend (the smallest * width of the child, we'll guarantee at least a width of 1. */ if (w > subtrahend) BWidth (b) = w-subtrahend; } else { subtrahend = MGR_ShadowThickness(m) + RC_MarginH (m) + BY (b) + Double (BBorder (b)); /* When adjusting the last line, text and label widgets or gadgets, */ /* use the extra height that is added differently. Text just adds */ /* it on whereas label tries to center it in the extra space. */ /* In order to make the baselines align again as a result of the */ /* above behavior, Text's margin top has to be adjusted. */ if (h > subtrahend) { Dimension m_top; /* Check for underflow */ /* The difference is what it grows in height */ m_top = ((h-subtrahend) > BHeight(b)) ? ((h-subtrahend) - BHeight (b)) : 0 ; BHeight (b) = h-subtrahend; if (m_top && (XmIsText(kg [start_i].kid) || XmIsTextField(kg [start_i].kid) || XmIsCSText(kg [start_i].kid))) { kg [start_i].margin_top += m_top/2; /* Since labels center it */ } } } } } /* * decide exactly the dimensions of the row column widget we will return to * an asking caller based on the accumulated layout information. */ static void SetAsking( XmRowColumnWidget m, Dimension *m_width, /* if 0 then caller's asking */ Dimension *m_height, /* if 0 then caller's asking */ #if NeedWidePrototypes int b, int max_x, int max_y, int x, int y, int w, int h ) #else Dimension b, Position max_x, Position max_y, Position x, Position y, Dimension w, Dimension h ) #endif /* NeedWidePrototypes */ { long iheight; long iwidth; if (IsVertical (m)) /* tell caller what he wants */ { if (Asking (*m_width)) *m_width = x + w + b /* right edge of last child */ + MGR_ShadowThickness(m) + RC_MarginW (m); /* plus margin on right */ if (Asking (*m_height)) { ASSIGN_MAX (max_y, y); iheight = (long) max_y /* last unused y */ - (long) (RC_Spacing (m)) /* up by unused spacing */ + (long) (MGR_ShadowThickness(m)) + (long) (RC_MarginH (m)) ; /* plus margin on bottom */ if (iheight < 0) /* this is a temporary fix */ *m_height = 0; /* to make sure we don't */ else /* compute a negative height */ *m_height = (Dimension) iheight; /*in an unsigned short */ } } else { if (Asking (*m_width)) { ASSIGN_MAX (max_x, x); iwidth = (long) max_x - (long) (RC_Spacing (m)) + (long) (MGR_ShadowThickness(m)) + (long) (RC_MarginW (m)) ; if (iwidth < 0) *m_width = 0; else *m_width = (Dimension) iwidth ; } if (Asking (*m_height)) *m_height = y + h + b + MGR_ShadowThickness(m) + RC_MarginH (m); } } static void FindLargestOption( XmRowColumnWidget submenu, Dimension *c_width, Dimension *c_height ) { int i; Widget *child ; if (!submenu) return ; ForManagedChildren (submenu, i, child) { /* Is this recursivity wanted ? */ if (XmIsCascadeButton(*child)) { FindLargestOption((XmRowColumnWidget) CB_Submenu(*child), c_width, c_height); } else if (XmIsCascadeButtonGadget(*child)) { FindLargestOption((XmRowColumnWidget) CBG_Submenu(*child), c_width, c_height); } else { /* The entire size of the largest menu * item is used instead of only its TextRect. This may * result in large expanses of label white space when items * utilize left and right margins, shadow, or accelerator * text - but the glyph will be visible when the submenu is * posted! */ if (XmIsMenuShell(XtParent(submenu))) { ASSIGN_MAX(*c_width, XtWidth(*child)); ASSIGN_MAX(*c_height, XtHeight(*child)); } /* * must be a torn pane. Don't rely on its dimensions * since it may be stretched in the tear off so that * the label string fits into the titlebar */ else { XtWidgetGeometry preferred; XtQueryGeometry (*child, NULL, &preferred); ASSIGN_MAX(*c_width, preferred.width); ASSIGN_MAX(*c_height, preferred.height); } } } } void _XmRC_CheckAndSetOptionCascade( XmRowColumnWidget menu ) { Dimension width = 0; Dimension height = 0; int i; Widget cb; /* * if its is a pulldown menu, travel up the cascades to verify the * option menus cascade button is sized large enough. */ if (IsPulldown(menu)) { for (i=0; i < menu->row_column.postFromCount; i++) { _XmRC_CheckAndSetOptionCascade((XmRowColumnWidget) XtParent(menu->row_column.postFromList[i])); } } if (!IsOption(menu) || RC_FromResize(menu)) return ; if ((cb = XmOptionButtonGadget( (Widget) menu)) != NULL) { if (RC_OptionSubMenu(menu)) { FindLargestOption ((XmRowColumnWidget)RC_OptionSubMenu(menu), &width, &height ); if (LayoutIsRtoLG(cb)) width += Double(G_HighlightThickness(cb)) + G_ShadowThickness(cb) + LabG_MarginLeft(cb) + Double(MGR_ShadowThickness(RC_OptionSubMenu(menu))) - 2; else width += Double(G_HighlightThickness(cb)) + G_ShadowThickness(cb) + LabG_MarginRight(cb) + Double(MGR_ShadowThickness(RC_OptionSubMenu(menu))) - 2; height += Double(G_HighlightThickness(cb)) + LabG_MarginTop(cb) + LabG_MarginBottom(cb); /* change cb if needed */ if ((width != XtWidth(cb)) || (height != XtHeight(cb))) { /* we have pixels, but the cascade unit type might not be pixel, so save it and restore it after the setvalues */ unsigned char saved_unit_type = ((XmGadget)cb)->gadget.unit_type ; ((XmGadget)cb)->gadget.unit_type = XmPIXELS; XtVaSetValues (cb, XmNwidth, width, XmNheight, height, NULL); ((XmGadget)cb)->gadget.unit_type = saved_unit_type; } } } } /*ARGSUSED*/ static void TopOrBottomAlignment( XmRowColumnWidget m, #if NeedWidePrototypes int h, int shadow, int highlight, int baseline, /* unused */ int margin_top, int margin_height, int text_height, #else Dimension h, Dimension shadow, Dimension highlight, Dimension baseline, /* unused */ Dimension margin_top, Dimension margin_height, Dimension text_height, #endif /* NeedWidePrototypes */ Dimension *new_height, int start_i, int end_i) { XmRCKidGeometry kg = RC_Boxes (m); while (start_i < end_i) { if (XmIsGadget(kg [start_i].kid) || XmIsPrimitive(kg [start_i].kid)) { XmBaselineMargins textMargins; _XmRC_SetOrGetTextMargins(kg[start_i].kid, XmBASELINE_GET, &textMargins); kg[start_i].margin_top = textMargins.margin_top; kg[start_i].margin_bottom = textMargins.margin_bottom; if (textMargins.shadow < shadow) { kg[start_i].margin_top += shadow - textMargins.shadow; kg[start_i].box.height += shadow - textMargins.shadow; } if (textMargins.highlight < highlight) { kg[start_i].margin_top += highlight - textMargins.highlight; kg[start_i].box.height += highlight - textMargins.highlight; } if (textMargins.margin_top < margin_top) { kg[start_i].margin_top += margin_top - textMargins.margin_top; kg[start_i].box.height += margin_top - textMargins.margin_top; } if (textMargins.margin_height < margin_height) { kg[start_i].margin_top += margin_height - textMargins.margin_height; kg[start_i].box.height += margin_height - textMargins.margin_height; } if (AlignmentBottom (m)) if (textMargins.text_height < text_height) { kg[start_i].margin_top += text_height - textMargins.text_height; kg[start_i].box.height += text_height - textMargins.text_height; } if (kg[start_i].box.height < h) { kg[start_i].margin_bottom += h - kg[start_i].box.height; kg[start_i].box.height = h; } } if (kg[start_i].box.height > h) if (kg[start_i].box.height > *new_height) *new_height = kg[start_i].box.height; start_i++; } } /*ARGSUSED*/ static void BaselineAlignment( XmRowColumnWidget m, #if NeedWidePrototypes int h, int shadow, /* unused */ int highlight, /* unused */ int baseline, #else Dimension h, Dimension shadow, /* unused */ Dimension highlight, /* unused */ Dimension baseline, #endif /* NeedWidePrototypes */ Dimension *new_height, int start_i, int end_i) { XmRCKidGeometry kg = RC_Boxes (m); XmBaselineMargins textMargins; while (start_i < end_i) { if (XmIsPrimitive (kg [start_i].kid) || XmIsGadget (kg [start_i].kid)) { unsigned char label_type; _XmRC_SetOrGetTextMargins(kg [start_i].kid, XmBASELINE_GET, &textMargins); kg[start_i].margin_top = textMargins.margin_top; kg[start_i].margin_bottom = textMargins.margin_bottom; XtVaGetValues(kg [start_i].kid, XmNlabelType, &label_type, NULL); if (label_type == XmSTRING) { if (kg[start_i].baseline < baseline) { kg[start_i].margin_top += baseline - kg[start_i].baseline; if (kg[start_i].box.height + (baseline - kg[start_i].baseline) > h) { if (kg[start_i].box.height + (baseline - kg[start_i].baseline) > *new_height) *new_height = kg[start_i].box.height + (baseline - kg[start_i].baseline); kg[start_i].box.height += baseline - kg[start_i].baseline; } else { kg[start_i].margin_bottom += h - (kg[start_i].box.height + (baseline - kg[start_i].baseline)); kg[start_i].box.height = h; } } else { kg[start_i].margin_bottom += h - (kg[start_i].box.height + (baseline - kg[start_i].baseline)); kg[start_i].box.height = h; } } else kg[start_i].box.height = h; } else kg[start_i].box.height = h; start_i++; } } static void CenterAlignment( XmRowColumnWidget m, #if NeedWidePrototypes int h, #else Dimension h, #endif /* NeedWidePrototypes */ int start_i, int end_i) { XmRCKidGeometry kg = RC_Boxes (m); while(start_i < end_i) { if (XmIsGadget (kg [start_i].kid) || XmIsPrimitive (kg [start_i].kid)) { XmBaselineMargins textMargins; _XmRC_SetOrGetTextMargins(kg [start_i].kid, XmBASELINE_GET, &textMargins); kg[start_i].margin_top = textMargins.margin_top; kg[start_i].margin_bottom = textMargins.margin_bottom; } kg[start_i++].box.height = h; } } static void ComputeTearOffHeight( XmRowColumnWidget m, Dimension *toc_b, Dimension *b, Dimension *toc_height, int *start_i, int *child_i, int r) { XmRCKidGeometry kg = RC_Boxes (m); *toc_b = *b = Double (RC_EntryBorder (m)); if (RC_TearOffControl(m) && XtIsManaged(RC_TearOffControl(m))) { XmTearOffButtonWidget tw = (XmTearOffButtonWidget)RC_TearOffControl(m); if (!RC_EntryBorder(m) && kg[0].kid && XtIsWidget(kg[0].kid)) *toc_b = Double(kg[0].kid->core.border_width); *toc_height = 0; /* Remember! If toc exists, it has the first kid geo */ for (*start_i = 1; kg[*start_i].kid != NULL; (*start_i)++) ASSIGN_MAX(*toc_height, kg[*start_i].box.height); *toc_height = *toc_height >> r; /* r is 1 or 2 depending on the orientation. 1 makes the tear off half the highest, 2 makes 1/4 */ ASSIGN_MAX(*toc_height, 2 + *toc_b + 2* ((XmPrimitiveWidget)kg[0].kid)->primitive.shadow_thickness); /* Sync up the kid geo */ /* Fix CR# 4778 */ if (tw -> label.recompute_size == True) kg[0].box.height = *toc_height; else kg[0].box.height = *toc_height = XtHeight(tw); kg[0].box.width = XtWidth(m); *start_i = *child_i = 1; } else *toc_height = *toc_b = *start_i = *child_i = 0; } /* * figure out where all the children of a column style widget go. The * border widths are already set. * * In columnar mode, all heights and widths are identical. They are the * size of the largest item. * * For vertical widgets the items are laid out in columns, going down the * first column and then down the second. For horizonatal, think of the * columns as rows. * * By convention incoming row column size can be zero, indicating a request * for preferred size, this means lay it out and record the needed size. * * NOTE: the layout is predicated on the help child being the last one since * it messes up the x, y for a following child. */ static void LayoutColumn( XmRowColumnWidget m, Dimension *m_width, /* if 0 then caller's asking */ Dimension *m_height ) /* if 0 then caller's asking */ { XmRCKidGeometry kg = RC_Boxes (m); XtWidgetGeometry *bx; Position x, y, max_x = 0, max_y = 0; int items_per_column, kid_i, child_i, /* which child we are doing */ col_c = 0, /* items in col being done */ start_i = 0; /* index of first item in col */ Dimension border, w, h, baseline, shadow, highlight, margin_top, margin_height, text_height; Dimension toc_height; Dimension new_height= 0; Dimension toc_b, b; ComputeTearOffHeight(m, &toc_b, &b, &toc_height, &start_i, &child_i, 1); /* loc of first item */ x = MGR_ShadowThickness(m) + RC_MarginW (m); y = MGR_ShadowThickness(m) + RC_MarginH (m) + toc_height + toc_b; GetMaxValues (m, &border, &w, &h, &items_per_column, &baseline, &shadow, &highlight, &margin_top, &margin_height, &text_height); if (!RC_EntryBorder(m) && kg[child_i].kid && XtIsWidget(kg[child_i].kid)) b = Double(border); /* Loop through and find the new height, if any, that the RowColumn */ /* children need to grow to as a result of adjusting the baselines. */ /* The empty loop determine the number of kids */ if (AlignmentBaselineTop(m) || AlignmentBaselineBottom(m)) { kid_i = 0; while (kg [kid_i].kid != NULL) kid_i++; BaselineAlignment(m, h, shadow, highlight, baseline, &new_height, 0, kid_i); } else if (AlignmentTop(m) || AlignmentBottom(m)) { kid_i = 0; while (kg [kid_i].kid != NULL) kid_i++; TopOrBottomAlignment(m, h, shadow, highlight, baseline, margin_top, margin_height, text_height, &new_height, 0, kid_i); } else if (AlignmentCenter(m)) { kid_i = 0; while (kg [kid_i].kid != NULL) kid_i++; CenterAlignment(m, h, start_i, kid_i); } if (!new_height) new_height = h; for (; kg [child_i].kid != NULL; child_i++) { bx = &(kg[child_i].box); BWidth (bx) = w; /* all have same dimensions */ if (AlignmentCenter(m)) BHeight(bx) = h; if (++col_c > items_per_column) /* start a new column */ { if (IsVertical (m)) /* calc loc of new column */ { x += w + b + RC_Spacing (m); /* to the right */ /*back at top of menu */ y = MGR_ShadowThickness(m) + RC_MarginH (m) + toc_height + toc_b; } else /* calc loc of new row */ { /* back to left edge */ x = MGR_ShadowThickness(m) + RC_MarginW (m); /* down a row */ y += new_height + b + RC_Spacing (m); } col_c = 1; /* already doing this one */ start_i = child_i; /* record index */ } if (IsHelp (m, ((Widget) kg[child_i].kid))) CalcHelp (m, m_width, m_height, b, max_x, max_y, &x, &y, w, new_height); SetPosition (bx, x, y); /* plunk him down */ if (IsVertical (m)) /* get ready for next item */ y += new_height + b + RC_Spacing (m); else x += w + b + RC_Spacing (m); ASSIGN_MAX (max_y, y); ASSIGN_MAX (max_x, x); /* record for use later */ } if (new_height > h) { for(kid_i = 0; kid_i < child_i; kid_i++) { bx = &(kg[kid_i].box); if (BHeight(bx) != new_height) { kg[kid_i].margin_bottom += new_height - kg[kid_i].box.height; BHeight(bx) = new_height; } } } SetAsking (m, m_width, m_height, b, max_x, max_y, x, y, w, new_height); /* Set toc width to the width of the pane */ /* declare a macro and use it in the next 3 routines */ #define SET_TEAR_OFF_BOX(toc_height) \ if (toc_height) {\ kg[0].box.x = MGR_ShadowThickness(m) + RC_MarginW (m);\ kg[0].box.y = MGR_ShadowThickness(m) + RC_MarginH (m);\ kg[0].box.height = toc_height;\ kg[0].box.width = *m_width - Double(MGR_ShadowThickness(m) + \ RC_MarginW(m)) - toc_b; \ } SET_TEAR_OFF_BOX(toc_height); if (RC_AdjLast(m)) AdjustLast (m, start_i, *m_width, *m_height); if (LayoutIsRtoLM(m)) for (child_i=0; kg [child_i].kid != NULL; child_i++) { bx = &(kg[child_i].box); /* Adjust x */ BX (bx) = *m_width - BX (bx) - BWidth (bx) - b ; } } /* * do a vertical tight (non-column) layout. * * In a tight layout one dimension of the items is left alone and the other * is kept uniform. In a vertical row column widgets, the widths of each child * are uniform for each column, the heights are never changed. In a horiz * row column widget, the widths are never changed and the heights are kept * uniform for each row. * * It gets messy w.r.t. the help child because we don't know if there will * be room in the last column/row for it. If there isn't room then a whole * new column/row has to be added. * * NOTE: the layout is predicated on the help child being the last one since * it messes up the x, y for a following child. */ static void LayoutVerticalTight( XmRowColumnWidget m, Dimension *m_width, /* if 0 then caller's asking */ Dimension *m_height ) /* if 0 then caller's asking */ { XmRCKidGeometry kg = RC_Boxes (m); XtWidgetGeometry *bx; Position x, y, max_y = 0; Dimension h = 0; Dimension w = 0; /* widest item width in col */ int child_i, start_i; Dimension toc_height; Dimension toc_b, b; Dimension border = 0; ComputeTearOffHeight(m, &toc_b, &b, &toc_height, &start_i, &child_i, 1); /* first item location */ x = MGR_ShadowThickness(m) + RC_MarginW (m); y = MGR_ShadowThickness(m) + RC_MarginH (m) + toc_height + toc_b; for (; kg [child_i].kid != NULL; child_i++) { bx = &(kg[child_i].box); if (!RC_EntryBorder(m) && kg[child_i].kid && XtIsWidget(kg[child_i].kid)) b = Double(kg[child_i].kid->core.border_width); h = BHeight (bx) + b; /* calc this item's height */ if (((y + h) > *m_height) && ( ! Asking (*m_height)) && (child_i)) { /* start new column */ while (start_i < child_i) kg[start_i++].box.width = w; /* set uniform width */ x += w + Double(border) + MGR_ShadowThickness(m) + RC_MarginW (m); /* go right and */ y = MGR_ShadowThickness(m) + RC_MarginH (m) + toc_height + toc_b; /* back to top of menu */ w = BWidth (bx); /* reset for new column */ if (kg[child_i].kid && XtIsWidget(kg[child_i].kid)) border = kg[child_i].kid->core.border_width; else border = ((XmGadget)kg[child_i].kid)->rectangle.border_width; } if (IsHelp (m, ((Widget) kg[child_i].kid))) CalcHelp (m, m_width, m_height, b, 0, max_y, &x, &y, w, h); SetPosition (bx, x, y); ASSIGN_MAX(w, BWidth (bx)); if (kg[child_i].kid && XtIsWidget(kg[child_i].kid)) { if (border < kg[child_i].kid->core.border_width) border = kg[child_i].kid->core.border_width; } else { if (border < ((XmGadget)kg[child_i].kid)->rectangle.border_width) border = ((XmGadget)kg[child_i].kid)->rectangle.border_width; } y += h + RC_Spacing (m); /* loc of next item */ ASSIGN_MAX(max_y, y); /* record for use later */ } SetAsking (m, m_width, m_height, Double(border), 0, max_y, x, y, w, h); /* Set toc width to the width of the pane */ SET_TEAR_OFF_BOX(toc_height); if (RC_AdjLast(m)) AdjustLast (m, start_i, *m_width, *m_height); else while (start_i < child_i) kg[start_i++].box.width = w; /* set uniform width */ if (LayoutIsRtoLM(m)) for (child_i=0; kg [child_i].kid != NULL; child_i++) { bx = &(kg[child_i].box); /* Adjust x */ BX (bx) = *m_width - BX (bx) - BWidth (bx) - b ; } } static void LayoutHorizontaltight( XmRowColumnWidget m, Dimension *m_width, /* if 0 then caller's asking */ Dimension *m_height ) /* if 0 then caller's asking */ { XmRCKidGeometry kg = RC_Boxes (m); XtWidgetGeometry *bx; Position x, y, max_x = 0; Dimension w = 0; Dimension h = 0; /* tallest item height in row */ Dimension new_height = 0; Dimension baseline = 0; Dimension shadow = 0; Dimension highlight = 0; Dimension margin_height = 0; Dimension margin_top = 0; Dimension text_height = 0; Dimension border = 0; int child_i, start_i; /* index of first item in row */ Dimension toc_height; Dimension toc_b, b; ComputeTearOffHeight(m, &toc_b, &b, &toc_height, &start_i, &child_i, 2); /* first item location */ x = MGR_ShadowThickness(m) + RC_MarginW (m); y = MGR_ShadowThickness(m) + RC_MarginH (m) + toc_height + toc_b; for (; kg [child_i].kid != NULL; child_i++) { bx = &(kg[child_i].box); if (!RC_EntryBorder(m) && kg[child_i].kid && XtIsWidget(kg[child_i].kid)) b = Double(kg[child_i].kid->core.border_width); w = BWidth (bx) + b; /* item's width */ if (((x + w) > *m_width) && ( ! Asking (*m_width)) && (child_i)) { /* start a new row */ if (AlignmentBaselineTop(m) || AlignmentBaselineBottom(m)) BaselineAlignment(m, h, shadow, highlight, baseline, &new_height, start_i, child_i); else if (AlignmentTop(m) || AlignmentBottom(m)) TopOrBottomAlignment(m, h, shadow, highlight, baseline, margin_top, margin_height, text_height, &new_height, start_i, child_i); else if (AlignmentCenter(m)) CenterAlignment(m, h, start_i, child_i); if (new_height > h) { while (start_i < child_i) { if (kg[start_i].box.height != new_height) { kg[start_i].margin_bottom += new_height - kg[start_i].box.height; kg[start_i].box.height = new_height; } start_i++; } h = new_height; } start_i = child_i; x = MGR_ShadowThickness(m) + RC_MarginW (m); /* left edge of menu */ y += h + Double(border) + MGR_ShadowThickness(m) + RC_MarginH (m); /* down to top of next row */ h = BHeight (bx); /* reset for this row */ new_height = 0; baseline = kg[child_i].baseline; if (kg[child_i].kid && XtIsWidget (kg[child_i].kid)) border = kg[child_i].kid->core.border_width; else if (XmIsGadget (kg[child_i].kid)) border = ((XmGadget)kg[child_i].kid)->rectangle.border_width; if (XmIsGadget (kg[child_i].kid) || XmIsPrimitive (kg[child_i].kid)) { XmBaselineMargins textMargins; _XmRC_SetOrGetTextMargins(kg[child_i].kid, XmBASELINE_GET, &textMargins); shadow = textMargins.shadow; highlight = textMargins.highlight; margin_top = textMargins.margin_top; text_height = textMargins.text_height; margin_height = textMargins.margin_height; } } if (IsHelp (m, ((Widget) kg[child_i].kid))) CalcHelp (m, m_width, m_height, b, max_x, 0, &x, &y, w, h); SetPosition (bx, x, y); if (XmIsGadget (kg[child_i].kid) || XmIsPrimitive (kg[child_i].kid)) ASSIGN_MAX(baseline, kg[child_i].baseline); ASSIGN_MAX(h, BHeight (bx)); if (kg[child_i].kid && XtIsWidget (kg[child_i].kid)) { ASSIGN_MAX(border, kg[child_i].kid->core.border_width); } else if (XmIsGadget (kg[child_i].kid)) { ASSIGN_MAX(border, ((XmGadget)kg[child_i].kid)->rectangle.border_width); } if (XmIsGadget (kg[child_i].kid) || XmIsPrimitive (kg[child_i].kid)) { XmBaselineMargins textMargins; _XmRC_SetOrGetTextMargins(kg[child_i].kid, XmBASELINE_GET, &textMargins); ASSIGN_MAX(shadow, textMargins.shadow); ASSIGN_MAX(highlight, textMargins.highlight); ASSIGN_MAX(margin_top, textMargins.margin_top); ASSIGN_MAX(text_height, textMargins.text_height); ASSIGN_MAX(margin_height, textMargins.margin_height); } x += w + RC_Spacing (m); /* loc of next item */ ASSIGN_MAX (max_x, x); /* record for use later */ } /* Set toc width to the width of the pane */ SET_TEAR_OFF_BOX(toc_height); if (AlignmentBaselineTop(m) || AlignmentBaselineBottom(m)) BaselineAlignment(m, h, shadow, highlight, baseline, &new_height, start_i, child_i); else if (AlignmentTop(m) || AlignmentBottom(m)) TopOrBottomAlignment(m, h, shadow, highlight, baseline, margin_top, margin_height, text_height, &new_height, start_i, child_i); else if (AlignmentCenter(m)) CenterAlignment(m, h, start_i, child_i); if (new_height > h){ while (start_i < child_i){ bx = &(kg[start_i].box); if (BHeight(bx) != new_height) { kg[start_i].margin_bottom += new_height - kg [start_i].box.height; BHeight(bx) = new_height; } start_i++; } } if (new_height > h) SetAsking (m, m_width, m_height, Double(border), max_x, 0, x, y, w, new_height); else SetAsking (m, m_width, m_height, Double(border), max_x, 0, x, y, w, h); #ifdef FIX_1521 for (child_i = 0; kg[child_i].kid != NULL; child_i++) { bx = &(kg[child_i].box); ASSIGN_MIN(BWidth(bx), *m_width - Double(MGR_ShadowThickness(m)) - Double(RC_MarginW(m)) - Double(BBorder(bx))); if (IsHelp(m, ((Widget) kg[child_i].kid))) ASSIGN_MAX(BX(&(kg[child_i].box)), MGR_ShadowThickness(m) + RC_MarginW(m)); } #endif if (RC_AdjLast(m)) AdjustLast (m, start_i, *m_width, *m_height); else while (start_i < child_i) { if (new_height > h) kg[start_i++].box.height = new_height; else kg[start_i++].box.height = h; /* set uniform height */ } if (LayoutIsRtoLM(m)) for (child_i=0; kg [child_i].kid != NULL; child_i++) { bx = &(kg[child_i].box); /* Adjust x */ BX (bx) = *m_width - BX (bx) - BWidth (bx) - b ; } } /* * wrap a box around the entries, used with packing mode of none. * * we ignore negative positioning, ie. only worry about being wide enough * for the right edge of the rightmost entry (similarly for height) */ static void LayoutNone( XmRowColumnWidget m, Dimension *m_width, Dimension *m_height ) { XtWidgetGeometry *b; XmRCKidGeometry kg = RC_Boxes (m); int i, dum; Dimension w, max_w = 0, max_h = 0; Dimension toc_height; Dimension toc_b, bw; short temp; ComputeTearOffHeight(m, &toc_b, &bw, &toc_height, &dum, &i, 2); for (; kg [i].kid != NULL; i++) { b = &(kg[i].box); if (!RC_EntryBorder(m) && kg[i].kid && XtIsWidget(kg[i].kid)) bw = Double(kg[i].kid->core.border_width); if (Asking (*m_width)) { /* be careful about negative positions */ w = BWidth (b) + bw; temp = ((short)w) + BX (b); if (temp <= 0) w = 1; else w = (Dimension) temp; ASSIGN_MAX (max_w, w); } if (Asking (*m_height)) { /* be careful about negative positions */ w = BHeight (b) + Double (bw); temp = ((short)w) + BY (b); if (temp <= 0) w = 1; else w = (Dimension) temp; ASSIGN_MAX (max_h, w); } } /* Set toc width to the width of the pane */ SET_TEAR_OFF_BOX(toc_height); if (Asking (*m_width)) *m_width = max_w; if (Asking (*m_height)) *m_height = max_h; } /* * Routine used to determine the size of the option menu or to layout * the option menu given the current size. The boolean calcMenuDimension * indicates whether the dimensions of the menu should be recalculated. * This is true when called from _XmRCThinkAboutSize and false when called * from AdaptToSize. * * This combines the two routines from Motif1.1: think_about_option_size * and option_layout. Also new for Motif 1.2, the instigator is considered. * If the instigator is the label or the cascabebuttongadget, then the * dimensions are honored if they are large enough. */ /* ARGSUSED */ static void LayoutOptionAndSize ( register XmRowColumnWidget menu, Dimension *width, Dimension *height, Widget instigator, XtWidgetGeometry *request, #if NeedWidePrototypes int calcMenuDimension ) #else Boolean calcMenuDimension ) #endif /* NeedWidePrototypes */ { XtWidgetGeometry *label_box = NULL, *button_box = NULL; Dimension c_width; Dimension c_height; register XmRowColumnWidget p = (XmRowColumnWidget) RC_OptionSubMenu(menu); XmCascadeButtonGadget cb = (XmCascadeButtonGadget)XmOptionButtonGadget( (Widget) menu); /* * if this is being destroyed, don't get new dimensions. This routine * assumes that cb is valid. */ if (menu->core.being_destroyed) { if (calcMenuDimension) { *width = XtWidth(menu); *height = XtHeight(menu); } return; } /* Find the interesting boxes */ if (!XtIsManaged(XmOptionLabelGadget( (Widget) menu))) { button_box = &(RC_Boxes(menu)[0].box); } else { label_box = &(RC_Boxes(menu)[0].box); button_box = &(RC_Boxes(menu)[1].box); } if (p) { c_width = c_height = 0; FindLargestOption( p, &c_width, &c_height ); if (LayoutIsRtoLG(cb)) c_width += Double(G_HighlightThickness(cb)) + G_ShadowThickness(cb) + LabG_MarginLeft(cb) + Double(MGR_ShadowThickness(p)) - /* magic value */ 2; else c_width += Double(G_HighlightThickness(cb)) + G_ShadowThickness(cb) + LabG_MarginRight(cb) + Double(MGR_ShadowThickness(p)) - /* magic value */ 2; c_height += Double(G_HighlightThickness(cb)) + LabG_MarginTop(cb) + LabG_MarginBottom(cb); /* allow settings in cbg to be honored if greater than best size */ if (instigator == (Widget) cb) { if ((request->request_mode & CWHeight) && (request->height > c_height)) { c_height = request->height; } if ((request->request_mode & CWWidth) && (request->width > c_width)) { c_width = request->width; } } BWidth(button_box) = c_width; BHeight(button_box) = c_height; } else { /* Option menu draws a toggle indicator with a childless submenu */ c_width = BWidth(button_box); c_height = BHeight(button_box); } /* treat separate the case where the label is unmanaged */ if (!XtIsManaged(XmOptionLabelGadget( (Widget) menu))) { if (!calcMenuDimension && c_height > XtHeight(menu)) c_height = XtHeight(menu) - 2*RC_MarginH(menu); if (!calcMenuDimension && c_width > XtWidth (menu)) c_width = XtWidth(menu) - 2*RC_MarginW(menu); BWidth(button_box) = c_width; BHeight(button_box) = c_height; BX(button_box) = RC_MarginW(menu); BY(button_box) = RC_MarginH(menu); if (calcMenuDimension) { *width = c_width + 2*RC_MarginW(menu); *height = c_height + 2*RC_MarginH(menu); } return ; } if (IsHorizontal(menu)) { /* * Set the height to the highest of the two but if calcMenuDimension * is false, limit it to the size of the option menu */ if (BHeight(label_box) > c_height) c_height = BHeight(label_box); if (!calcMenuDimension && c_height > XtHeight(menu)) c_height = XtHeight(menu) - 2*RC_MarginH(menu); BHeight(label_box) = c_height; BHeight(button_box) = c_height; /* The label box is placed at... */ /* The button is placed just next to the label */ /* Reverse if RtoL */ if (LayoutIsRtoLM(menu)) { BX(button_box) = RC_MarginW(menu); BX(label_box) = BX(button_box) + BWidth(button_box) + RC_Spacing(menu); } else { BX(label_box) = RC_MarginW(menu); BX(button_box) = BX(label_box) + BWidth(label_box) + RC_Spacing(menu); } BY(label_box) = RC_MarginH(menu); BY(button_box) = RC_MarginH(menu); if (calcMenuDimension) { if (LayoutIsRtoLM(menu)) *width = BX(label_box) + BWidth(label_box) + RC_MarginW(menu); else *width = BX(button_box) + c_width + RC_MarginW(menu); *height = c_height + 2*RC_MarginH(menu); } } else /* is vertical menu */ { /* * Set the height to the highest of the two but if calcMenuDimension * is false, limit it to the size of the option menu */ if (BWidth(label_box) > c_width) c_width = BWidth(label_box); if (!calcMenuDimension && c_width > XtWidth (menu)) c_width = XtWidth(menu) - 2*RC_MarginW(menu); BWidth(label_box) = c_width; BWidth(button_box) = c_width; /* The label box is placed at... */ BX(label_box) = RC_MarginW(menu); BY(label_box) = RC_MarginH(menu); /* The button is placed just below the label */ BX(button_box) = RC_MarginW(menu); BY(button_box) = BY(label_box) + BHeight(label_box) + RC_Spacing(menu); if (calcMenuDimension) { *width = c_width + 2*RC_MarginW(menu); *height = BY(button_box) + c_height + RC_MarginH(menu); } } } void _XmRCThinkAboutSize( register XmRowColumnWidget m, Dimension *w, Dimension *h, Widget instigator, XtWidgetGeometry *request ) { if (!RC_ResizeWidth(m)) *w = XtWidth (m); if (!RC_ResizeHeight(m)) *h = XtHeight (m); if (IsOption(m)) LayoutOptionAndSize(m, w, h, instigator, request, TRUE); else if (PackNone (m)) LayoutNone (m, w, h); else if (PackColumn (m)) LayoutColumn (m, w, h); else { if (IsVertical (m)) LayoutVerticalTight (m, w, h); else LayoutHorizontaltight (m, w, h); } if (!RC_ResizeHeight(m) && !RC_ResizeWidth(m)) return; ASSIGN_MAX(*w, RESOURCE_MIN_WIDTH); ASSIGN_MAX(*h, RESOURCE_MIN_HEIGHT); } void _XmRCPreferredSize( XmRowColumnWidget m, Dimension *w, Dimension *h ) { Widget *q; int i; Dimension * baselines; int line_count; Dimension y; if ((!IsOption(m)) && ((PackColumn(m) && (IsVertical(m) || IsHorizontal(m))) || (PackTight(m) && IsHorizontal(m)))) { if ((PackColumn(m) && (IsVertical(m) || IsHorizontal(m))) || (PackTight(m) && IsHorizontal(m))) { if (*h == 0) { ForManagedChildren(m, i, q) /* reset Top and Bottom Margins that were */ { /* set for vertical Alignment to work */ if (XmIsGadget(*q) || XmIsPrimitive(*q)) { XmBaselineMargins textMargins; textMargins.margin_top = SavedMarginTop(*q); textMargins.margin_bottom = SavedMarginBottom(*q); _XmRC_SetOrGetTextMargins(*q, XmBASELINE_SET, &textMargins); } } } } /* * get array built for both widgets and gadgets layout is based only on * this array, adjust width margins & adjust height margins */ RC_Boxes(m)= (XmRCKidGeometry)_XmRCGetKidGeo( (Widget) m, NULL, NULL, RC_EntryBorder(m), RC_EntryBorder (m), (IsVertical (m) && RC_DoMarginAdjust (m)), (IsHorizontal (m) && RC_DoMarginAdjust (m)), RC_HelpPb (m), RC_TearOffControl(m), XmGET_PREFERRED_SIZE); for (i = 0; RC_Boxes(m) [i].kid != NULL; i++) { Widget rc_kid; XmBaselineMargins textMargins; XRectangle displayRect; unsigned char label_type = XmSTRING; rc_kid = RC_Boxes(m) [i].kid; if (XmIsGadget (rc_kid) || XmIsPrimitive (rc_kid)) { XtVaGetValues(rc_kid, XmNlabelType, &label_type, NULL); if (label_type == XmSTRING) { if (XmIsLabel(rc_kid) || XmIsLabelGadget(rc_kid)) { /* The baseline functions returns the baseline on the current size */ /* Since we need the preferred baseline, we need to calculate the y */ /* coordinate on the preferred size and add this in to the baseline */ /* returned, after subtracting the y coordinate of the current widget */ _XmRC_SetOrGetTextMargins(rc_kid, XmBASELINE_GET, &textMargins); y = ( textMargins.highlight + textMargins.shadow + textMargins.margin_height + textMargins.margin_top + (( RC_Boxes(m) [i].box.height - textMargins.margin_top - textMargins.margin_bottom - (2 * ( textMargins.margin_height + textMargins.shadow + textMargins.highlight)) - textMargins.text_height) / 2)); XmWidgetGetDisplayRect(rc_kid, &displayRect); } else { displayRect.y = y = 0; } if (AlignmentBaselineTop(m) || AlignmentBaselineBottom(m)) { if (XmWidgetGetBaselines(rc_kid, &baselines, &line_count)) { if (AlignmentBaselineTop(m)) RC_Boxes(m) [i].baseline = baselines[0] - displayRect.y + y; else if (AlignmentBaselineBottom(m)) RC_Boxes(m) [i].baseline = baselines[line_count - 1] - displayRect.y + y; XtFree((char *)baselines); } else { RC_Boxes(m) [i].baseline = 0; } } RC_Boxes(m) [i].margin_top = 0; RC_Boxes(m) [i].margin_bottom = 0; } else { RC_Boxes(m) [i].baseline = 0; RC_Boxes(m) [i].margin_top = 0; RC_Boxes(m) [i].margin_bottom = 0; } } } } else { /* * get array built for both widgets and gadgets layout is based only on * this array, adjust width margins & adjust height margins */ RC_Boxes(m)= (XmRCKidGeometry)_XmRCGetKidGeo( (Widget) m, NULL, NULL, RC_EntryBorder(m), RC_EntryBorder (m), (IsVertical (m) && RC_DoMarginAdjust (m)), (IsHorizontal (m) && RC_DoMarginAdjust (m)), RC_HelpPb (m), RC_TearOffControl(m), XmGET_PREFERRED_SIZE); } _XmRCThinkAboutSize (m, w, h, NULL, NULL); XtFree ((char *) RC_Boxes(m)); } /* * Layout the row column widget to fit it's current size; ignore possible * non-fitting of the entries into a too small row column widget. * * Don't forget the instigator. */ void _XmRCAdaptToSize( XmRowColumnWidget m, Widget instigator, XtWidgetGeometry *request ) { Dimension w = XtWidth (m); Dimension h = XtHeight (m); Dimension instigator_w = 0 ; Dimension instigator_h = 0; short i; Widget *q; if ((!IsOption(m)) && ((PackColumn(m) && (IsVertical(m) || IsHorizontal(m))) || (PackTight(m) && IsHorizontal(m)))) { ForManagedChildren(m, i, q) { if (XmIsGadget (*q) || XmIsPrimitive (*q)) { XmBaselineMargins textMargins; textMargins.margin_top = SavedMarginTop(*q); textMargins.margin_bottom = SavedMarginBottom(*q); _XmRC_SetOrGetTextMargins(*q, XmBASELINE_SET, &textMargins); } } } /* * get array built for both widgets and gadgets, * layout is based only on this array, * adjust width margins and adjust height margins */ RC_Boxes(m) = (XmRCKidGeometry)_XmRCGetKidGeo( (Widget) m, instigator, request, RC_EntryBorder(m), RC_EntryBorder (m), (IsVertical (m) && RC_DoMarginAdjust (m)), (IsHorizontal (m) && RC_DoMarginAdjust (m)), RC_HelpPb (m), RC_TearOffControl(m), XmGET_PREFERRED_SIZE); if ((!IsOption(m)) && ((PackColumn(m) && (IsVertical(m) || IsHorizontal(m))) || (PackTight(m) && IsHorizontal(m)))) { for (i = 0; RC_Boxes(m) [i].kid != NULL; i++) { if (XmIsGadget(RC_Boxes(m) [i].kid) || XmIsPrimitive(RC_Boxes(m) [i].kid)) { unsigned char label_type = XmSTRING; RectObj ro = (RectObj) RC_Boxes(m) [i].kid; if (XtHeight (RC_Boxes(m) [i].kid) != RC_Boxes(m) [i].box.height) { XmeConfigureObject( (Widget) ro, ro->rectangle.x, ro->rectangle.y, ro->rectangle.width, RC_Boxes(m) [i].box.height, ro->rectangle.border_width); } XtVaGetValues(RC_Boxes(m) [i].kid, XmNlabelType, &label_type, NULL); if (label_type == XmSTRING && (AlignmentBaselineTop(m) || AlignmentBaselineBottom(m))) { Dimension *baselines; int line_count; XmWidgetGetBaselines(RC_Boxes(m) [i].kid, &baselines, &line_count); if (AlignmentBaselineTop(m)) RC_Boxes(m) [i].baseline = baselines[0]; else if (AlignmentBaselineBottom(m)) RC_Boxes(m) [i].baseline = baselines[line_count - 1]; XtFree((char *)baselines); } else RC_Boxes(m) [i].baseline = 0; } } } if (IsOption(m)) LayoutOptionAndSize (m, &w, &h, instigator, request, FALSE); else if (PackColumn (m)) LayoutColumn (m, &w, &h); else if (!PackNone (m)) { if (IsVertical (m)) LayoutVerticalTight (m, &w, &h); else LayoutHorizontaltight (m, &w, &h); } if ((!IsOption(m)) && ((PackColumn(m) && (IsVertical(m) || IsHorizontal(m))) || (PackTight(m) && IsHorizontal(m)))) { for (i = 0; RC_Boxes(m) [i].kid != NULL; i++) { if (XmIsGadget(RC_Boxes(m) [i].kid) || XmIsPrimitive(RC_Boxes(m) [i].kid)) { XmBaselineMargins textMargins; textMargins.margin_top = RC_Boxes(m) [i].margin_top; textMargins.margin_bottom = RC_Boxes(m) [i].margin_bottom; _XmRC_SetOrGetTextMargins(RC_Boxes(m) [i].kid, XmBASELINE_SET, &textMargins); } } } if (instigator) { /* CR 5419: Save the original instigator dimensions */ instigator_w = XtWidth(instigator); instigator_h = XtHeight(instigator); } _XmRCSetKidGeo ((XmRCKidGeometry)RC_Boxes(m), instigator); /* ** Hack alert! ** This is special code to enforce that the CBG in an option menu is ** kept correctly-sized when the items in this pulldown, associated with ** that cascade, change. There is no protocol for communicating this ** information nor any mechanism for adapting one; so we make the size ** request ourselves, here. The point is not that we are setting to the ** correct size so much as that the cascade's size is being adjusted after ** the menu size is fixed. calc_CBG_dims is probably being called an extra ** time to figure out the real size. This is not a frequent case. * * Do not call this routine below if this call was initiated by a geometry * request from an option menu's label or cascade button. In that case, * the geometry has already been taken care of and must not be meddled * with or it will reset some values incorrectly. */ if (!IsOption(m) || !instigator || !((instigator == RC_Boxes(m)[0].kid) || (instigator == RC_Boxes(m)[1].kid))) { _XmRC_CheckAndSetOptionCascade(m); } /* The old geometry management took care of resizing the instigator if XtGeometryYes was returned even if core.width and core.height had not changed. However this is not the case with the new geometry management. Therefore if margins have changed but not the core width and height label's resize needs to be called to calculate the x & y coordinates for the label text, with the new margins. */ if ((instigator) && (instigator_w == XtWidth(instigator)) && (instigator_h == XtHeight(instigator)) && (XmIsLabel(instigator) || XmIsLabelGadget(instigator))) { WidgetClass wc = XtClass(instigator); XtWidgetProc resize; _XmProcessLock(); resize = wc->core_class.resize; _XmProcessUnlock(); (*resize) ((Widget) instigator); } /* Patch submitted by Kevin B. Hendrix of Java-Linux project. */ if (RC_Boxes(m)) { XtFree ( (char *) RC_Boxes(m)); RC_Boxes(m) = NULL; } } void _XmRC_SetOrGetTextMargins( Widget wid, #if NeedWidePrototypes unsigned int op, #else unsigned char op, #endif /* NeedWidePrototypes */ XmBaselineMargins *textMargins ) { WidgetClass wc = XtClass(wid); if (op == XmBASELINE_GET) { /* in case the class does not have this procedure */ bzero((void *) textMargins, sizeof(XmBaselineMargins)); } textMargins->get_or_set = op; if (XmIsGadget(wid)) { XmGadgetClassExt *wcePtr; wcePtr = _XmGetGadgetClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->version == XmGadgetClassExtVersion && (*wcePtr)->widget_margins) (*((*wcePtr)->widget_margins)) (wid, textMargins) ; } else if (XmIsPrimitive(wid)) { XmPrimitiveClassExt *wcePtr; wcePtr = _XmGetPrimitiveClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->widget_margins) (*((*wcePtr)->widget_margins)) (wid, textMargins) ; } } /**************************************************************** * Assemble a kid box for each child widget and gadget, fill in data about * each widget and optionally set up uniform border widths. * Returns a list of records, last one has a 'kid' field of NULL. This memory * for this list should eventually be freed with a call to XtFree(). ****************/ /*ARGSUSED*/ XmRCKidGeometry _XmRCGetKidGeo( Widget wid, /* Widget w/ children. */ Widget instigator, /* May point to a child who */ XtWidgetGeometry *request, /* is asking to change. */ int uniform_border, /* T/F, enforce it. */ #if NeedWidePrototypes int border, #else Dimension border, /* Value to use if enforcing.*/ #endif /* NeedWidePrototypes */ int uniform_width_margins, /* unused, T/F, enforce it. */ int uniform_height_margins, /* unused, T/F, enforce it. */ Widget help, /* May point to a help kid. */ Widget toc, /* May point to tear_off_control kid. */ int geo_type ) /* Actual or preferred. */ { CompositeWidget c = (CompositeWidget) wid ; XmRCKidGeometry geo ; Widget kidWid ; int i ; int j = 0 ; Boolean helpFound = FALSE ; Boolean tocFound; tocFound = (toc && XtIsManaged(toc)) & 0x1; geo = (XmRCKidGeometry) XtMalloc((_XmGeoCount_kids(c) + 1 + tocFound) * sizeof (XmRCKidGeometryRec)); i = 0; if (tocFound) { geo[j].kid = toc ; _XmGeoLoadValues( toc, geo_type, instigator, request, &(geo[j].box)); geo[j].margin_top = 0; geo[j].margin_bottom = 0; geo[j].baseline = 0; if (uniform_border) /* if asked override border */ { geo[j].box.border_width = border ; } j++ ; } /* load all managed kids */ for( ; i < c->composite.num_children ; i++ ) { kidWid = c->composite.children[i] ; if (XtIsManaged( kidWid)) { if( kidWid == help ) { /* Save to put help widget at the end of the widget list.*/ helpFound = TRUE ; } else { geo[j].kid = kidWid ; _XmGeoLoadValues( kidWid, geo_type, instigator, request, &(geo[j].box)) ; geo[j].margin_top = 0; geo[j].margin_bottom = 0; geo[j].baseline = 0; /* Fix for CR 5598 - If the child is a separator widget or gadget, set the width in the geo box to 0. This will take the separator out of the width consideration. */ /* Fix for 8131: only does that to Separators when packing if not none: this is the only time when it matters, plus pack_none does not correct the setting to 0 and the rowcolumn dies in protocol error later when trying to configure the separator to its 0 box.width or height */ if ((XmIsSeparator(kidWid) || XmIsSeparatorGadget(kidWid)) && (RC_Packing (c) != XmPACK_NONE)) { unsigned char orientation; Arg args[1]; XtSetArg(args[0], XmNorientation, &orientation); XtGetValues(kidWid, args, 1); if (orientation == XmHORIZONTAL) geo[j].box.width = 0; else geo[j].box.height = 0; } /* End fix for CR 5598 and 8131 */ if (uniform_border) /* if asked override border */ { geo[j].box.border_width = border ; } j++ ; } } } if (helpFound) /* put help guy into list */ { geo[j].kid = help ; _XmGeoLoadValues( help, geo_type, instigator, request, &(geo[j].box)) ; geo[j].margin_top = 0; geo[j].margin_bottom = 0; geo[j].baseline = 0; if (uniform_border) /* if asked override border */ { geo[j].box.border_width = border ; } j++ ; } geo[j].kid = NULL ; /* signal end of list */ return( geo) ; } /**************************************************************** ARGSUSED * Take the kid geometry array and change each kid to match them. * remember not to do the resize of the instigator. * The kid geometry "kg" is assumed to be fully specified. ****************/ void _XmRCSetKidGeo( XmRCKidGeometry kg, Widget instigator ) { Widget w ; XtWidgetGeometry * b ; int i ; /****************/ for(i=0 ; kg[i].kid != NULL ; i++) { w = (Widget) kg[i].kid ; b = &(kg[i].box) ; if( w != instigator ) { XmeConfigureObject(w, b->x, b->y, b->width, b->height, b->border_width) ; } else { XtX( w) = b->x ; XtY( w) = b->y ; XtWidth( w) = b->width ; XtHeight( w) = b->height ; XtBorderWidth( w) = b->border_width ; } } return ; } static void GetMenuKidMargins( XmRowColumnWidget m, Dimension *width, Dimension *height, Dimension *left, Dimension *right, Dimension *top, Dimension *bottom ) { register int i; Widget *q; *width = *height = *left = *right = *top = *bottom = 0; ForManagedChildren(m, i, q) { if (XmIsLabelGadget(*q)) { ASSIGN_MAX(*width, LabG_MarginWidth (*q)); ASSIGN_MAX(*height, LabG_MarginHeight (*q)); ASSIGN_MAX(*left, LabG_MarginLeft (*q)); ASSIGN_MAX(*right, LabG_MarginRight (*q)); } else if (XmIsLabel(*q)) { ASSIGN_MAX(*width, Lab_MarginWidth (*q)); ASSIGN_MAX(*height, Lab_MarginHeight (*q)); ASSIGN_MAX(*left, Lab_MarginLeft (*q)); ASSIGN_MAX(*right, Lab_MarginRight (*q)); } } ForManagedChildren (m, i, q) { if (XmIsLabel(*q) || XmIsLabelGadget(*q)) { if (SavedMarginTop(*q) > *top) *top = SavedMarginTop(*q); if (SavedMarginBottom(*q) > *bottom) *bottom = SavedMarginBottom(*q); } } } /* * Toggle buttons have this thingy hanging off the left of the * widget, before the text. This dimension is known as the MarginLeft. * Pulldown's have hot spots in the MarginRight, accelerators go in the * marginRight also. * * For generality's sake we should insure that all * of the current label subclass widgets in the menu have the * margins set to the same value. */ void _XmRCDoMarginAdjustment( XmRowColumnWidget m ) { register Widget *p; register int i; Dimension m_w, m_h, m_l, m_r, m_t, m_b; Dimension w, h; if ((!RC_DoMarginAdjust (m)) || (IsOption(m))) { ForManagedChildren (m, i, p) { if (XmIsGadget(*p) || XmIsPrimitive(*p)) { XmBaselineMargins textMargins; _XmRC_SetOrGetTextMargins(*p, XmBASELINE_GET, &textMargins); SavedMarginTop(*p) = textMargins.margin_top; SavedMarginBottom(*p) = textMargins.margin_bottom; } } return; } /* * this should almost be part * of the layout process, except this requires a setvalue not a resize... */ GetMenuKidMargins (m, &m_w, &m_h, &m_l, &m_r, &m_t, &m_b); ForManagedChildren (m, i, p) { if (XmIsLabelGadget(*p)) { XmLabelGadget q; XmLabelGCacheObjPart localCache; /* * If in a popup or pulldown pane, * don't do labels; i.e. only do buttons. */ if (((*p)->core.widget_class == xmLabelGadgetClass) && (IsPulldown(m) || IsPopup(m))) continue; w = XtWidth (*p); h = XtHeight (*p); q = (XmLabelGadget) (*p); if (IsVertical (m)) { _XmQualifyLabelLocalCache(&localCache, q); /* change horiz margins to be uniform */ if (LabG_MarginLeft(q) != m_l) { w += m_l - LabG_MarginLeft(q); _XmAssignLabG_MarginLeft_r((&localCache), m_l); } if (LabG_MarginRight(q) != m_r) { w += m_r - LabG_MarginRight(q); _XmAssignLabG_MarginRight_r((&localCache), m_r); } if (LabG_MarginWidth(q) != m_w) { w += m_w - LabG_MarginWidth(q); _XmAssignLabG_MarginWidth_r((&localCache), m_w); } _XmReCacheLabG_r(&localCache, q); if (q->rectangle.width != w) { XmeConfigureObject( (Widget) q, q->rectangle.x, q->rectangle.y, w, q->rectangle.height, q->rectangle.border_width); } } if (!IsVertical (m) || PackColumn(m)) { _XmQualifyLabelLocalCache(&localCache, q); /* change vert margins */ if (LabG_MarginTop(q) != m_t) { h += m_t - LabG_MarginTop(q); _XmAssignLabG_MarginTop_r((&localCache), m_t); } if (LabG_MarginBottom(q) != m_b) { h += m_b - LabG_MarginBottom(q); _XmAssignLabG_MarginBottom_r((&localCache), m_b); } if (LabG_MarginHeight(q) != m_h) { h += m_h - LabG_MarginHeight(q); _XmAssignLabG_MarginHeight_r((&localCache), m_h); } _XmReCacheLabG_r(&localCache, q); if (q->rectangle.height != h) { XmeConfigureObject( (Widget) q, q->rectangle.x, q->rectangle.y, q->rectangle.width, h, q->rectangle.border_width); } SavedMarginTop(*p) = LabG_MarginTop (q); SavedMarginBottom(*p) = LabG_MarginBottom (q); } } else if (XmIsLabel(*p)) { XmLabelWidget lw; /* * If in a popup or pulldown pane, * don't do labels; i.e. only do buttons. */ if (((*p)->core.widget_class == xmLabelWidgetClass) && (IsPulldown(m) || IsPopup(m))) continue; w = XtWidth (*p); h = XtHeight (*p); lw = (XmLabelWidget) (*p); if (IsVertical (m)) /* change horiz margins to */ { /* be uniform */ ChangeMargin (Lab_MarginLeft (lw), m_l, w); ChangeMargin (Lab_MarginRight (lw), m_r, w); ChangeMargin (Lab_MarginWidth (lw), m_w, w); if (XtWidth (lw) != w) { XmeConfigureObject( (Widget) lw, lw->core.x, lw->core.y, w, lw->core.height, lw->core.border_width); } } if (!IsVertical (m) || PackColumn(m)) /* change vert margins */ { ChangeMargin (Lab_MarginTop (lw), m_t, h); ChangeMargin (Lab_MarginBottom (lw), m_b, h); ChangeMarginDouble (Lab_MarginHeight (lw), m_h, h); if (XtHeight (lw) != h) { XmeConfigureObject( (Widget) lw, lw->core.x,lw->core.y, lw->core.width, h, lw->core.border_width); } SavedMarginTop(*p) = Lab_MarginTop (lw); SavedMarginBottom(*p) = Lab_MarginBottom (lw); } } } } motif-2.3.8/lib/Xm/Hierarchy.h0000644000175000017500000000436112672140200013002 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmHierarchy_h #define _XmHierarchy_h #if defined(VMS) || defined(__VMS) #include #endif #include /************************************************************ * INCLUDE FILES *************************************************************/ /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #if defined(__cplusplus) extern "C" { #endif typedef struct _XmHierarchyClassRec *XmHierarchyWidgetClass; typedef struct _XmHierarchyRec *XmHierarchyWidget; typedef struct _XmHierarchyNodeStateData { Widget widget; XmHierarchyNodeState state; } XmHierarchyNodeStateData; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL FUNCTION DECLARATIONS *************************************************************/ /* Function Name: XmHierarchyOpenAllAncestors * Description: This function opens all ancestors of the given node. * Arguments: nw - the node (widget) that will be changed. * Returns: none */ void XmHierarchyOpenAllAncestors(Widget); WidgetList XmHierarchyGetChildNodes(Widget); extern WidgetClass xmHierarchyWidgetClass; #if defined(__cplusplus) } #endif #endif /* _Hierarchy_h */ motif-2.3.8/lib/Xm/DropTransP.h0000644000175000017500000000557713145162623013143 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDropTransferP_h #define _XmDropTransferP_h #include #include #ifdef __cplusplus extern "C" { #endif /* DropTransfer class structure */ typedef Widget (*XmDropTransferStartTransferProc)(Widget, ArgList, Cardinal); typedef void (*XmDropTransferAddTransferProc)(Widget, XmDropTransferEntry, Cardinal); typedef struct _XmDropTransferClassPart { XmDropTransferStartTransferProc start_drop_transfer; XmDropTransferAddTransferProc add_drop_transfer; XtPointer extension; } XmDropTransferClassPart; /* Full class record declaration */ typedef struct _XmDropTransferClassRec { ObjectClassPart object_class; XmDropTransferClassPart dropTransfer_class; } XmDropTransferClassRec; externalref XmDropTransferClassRec xmDropTransferClassRec; typedef struct _XmDropTransferListRec { XmDropTransferEntry transfer_list; Cardinal num_transfers; } XmDropTransferListRec, * XmDropTransferList; /* The DropTransfer instance record */ typedef struct _XmDropTransferPart { XmDropTransferEntry drop_transfers; Cardinal num_drop_transfers; Atom selection; Widget dragContext; Time timestamp; Boolean incremental; Window source_window; unsigned int tag; XtSelectionCallbackProc transfer_callback; unsigned char transfer_status; Atom motif_drop_atom; XmDropTransferList drop_transfer_lists; Cardinal num_drop_transfer_lists; Cardinal cur_drop_transfer_list; Cardinal cur_xfer; Atom * cur_targets; XtPointer * cur_client_data; } XmDropTransferPart; /* Full instance record declaration */ typedef struct _XmDropTransferRec { ObjectPart object; XmDropTransferPart dropTransfer; } XmDropTransferRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDropTransferP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Jpeg.c0000644000175000017500000001111212672140200011734 00000000000000#include "JpegI.h" #include #include #include void _XmJpegErrorExit(j_common_ptr cinfo) { int rc; XmJpegErrorMgr err = (XmJpegErrorMgr) cinfo->err; switch (cinfo->err->msg_code) { case JERR_NO_SOI: rc = 1; break; case JERR_OUT_OF_MEMORY: rc = 4; break; default: rc = 2; break; } longjmp(err->setjmp_buffer, rc); } int load_jpeg(FILE * infile, unsigned long *pWidth, unsigned long *pHeight, CTable ** image_data) { CTable *buf; struct jpeg_decompress_struct cinfo; XmJpegErrorMgrRec jerr; JSAMPROW row_pointer[1]; int x, y; int rc; *image_data = NULL; cinfo.err = jpeg_std_error((struct jpeg_error_mgr *) &jerr); jerr.pub.error_exit = _XmJpegErrorExit; if ((rc = setjmp(jerr.setjmp_buffer))) { jpeg_destroy_decompress(&cinfo); return rc; } jpeg_create_decompress(&cinfo); jpeg_stdio_src(&cinfo, infile); jpeg_read_header(&cinfo, TRUE); jpeg_calc_output_dimensions(&cinfo); jpeg_start_decompress(&cinfo); *pWidth = cinfo.output_width; *pHeight = cinfo.output_height; *image_data = malloc(cinfo.output_width * cinfo.output_height * sizeof(CTable)); for (buf = *image_data; cinfo.output_scanline < cinfo.output_height; buf += cinfo.output_width) jpeg_read_scanlines(&cinfo, (JSAMPARRAY) (&buf), 1); if (cinfo.out_color_space == JCS_GRAYSCALE) { for (y = 0, buf = *image_data; y < cinfo.output_height; y++, buf += cinfo.output_width) for (x = cinfo.output_width - 1; x >= 0; x--) buf[x].red = buf[x].green = buf[x].blue = ((JSAMPLE *) buf)[x]; } jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); return 0; } Pixel get_cval(unsigned char c, unsigned long mask) { Pixel value = c, x; int i; for (i = 0, x = 1; i < 32; i++, x <<= 1) if (mask & x) break; for (; i < 32; i++, x <<= 1) if (!(mask & x)) break; if (i < 8) value >>= 8 - i; else if (i > 8) value <<= i - 8; return (value & mask); } void store_pixel(Screen * screen, CTable * p, int x, char *cdata) { Pixel px = get_cval(p->red, screen->root_visual->red_mask) | get_cval(p->green, screen->root_visual->green_mask) | get_cval(p->blue, screen->root_visual->blue_mask); if (screen->root_depth <= 16) { if (ImageByteOrder(screen->display) == MSBFirst) { cdata[x * 2] = (px >> 8); cdata[x * 2 + 1] = (px & 0xff); } else { cdata[x * 2] = (px & 0xff); cdata[x * 2 + 1] = (px >> 8); } } else { if (ImageByteOrder(screen->display) == MSBFirst) { cdata[x * 4] = (px >> 24); cdata[x * 4 + 1] = (px >> 16); cdata[x * 4 + 2] = (px >> 8); cdata[x * 4 + 3] = (px & 0xff); } else { cdata[x * 4 + 3] = (px >> 24); cdata[x * 4 + 2] = (px >> 16); cdata[x * 4 + 1] = (px >> 8); cdata[x * 4] = (px & 0xff); } } } int _XmJpegGetImage(Screen * screen, FILE * infile, XImage ** ximage) { unsigned long image_width, image_height; unsigned char *xdata; int pad; CTable *image_data; int rc; if ((rc = load_jpeg(infile, &image_width, &image_height, &image_data))) return rc; if (screen->root_depth == 24 || screen->root_depth == 32) { xdata = (unsigned char *) malloc(4 * image_width * image_height); pad = 32; } else if (screen->root_depth == 16) { xdata = (unsigned char *) malloc(2 * image_width * image_height); pad = 16; } else { /* depth == 8 */ xdata = (unsigned char *) malloc(image_width * image_height); pad = 8; } if (!xdata) return 4; *ximage = XCreateImage(screen->display, screen->root_visual, screen->root_depth, ZPixmap, 0, (char *) xdata, image_width, image_height, pad, 0); if (!*ximage) { free(xdata); return 4; } { int xx, yy; CTable *p; for (yy = 0; yy < (*ximage)->height; yy++) { p = image_data + yy * (*ximage)->width; for (xx = 0; xx < (*ximage)->width; xx++, p++) store_pixel(screen, p, xx + yy * (*ximage)->width, (*ximage)->data); } } if (image_data) { free(image_data); image_data = NULL; } return 0; } motif-2.3.8/lib/Xm/ScaleP.h0000644000175000017500000000716713145162623012253 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScaleP_h #define _XmScaleP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Constraint part record for Scale widget */ typedef struct _XmScaleConstraintPart { char unused; } XmScaleConstraintPart, * XmScaleConstraint; /* New fields for the Scale widget class record */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmScaleClassPart; /* Full class record declaration */ typedef struct _XmScaleClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmScaleClassPart scale_class; } XmScaleClassRec; externalref XmScaleClassRec xmScaleClassRec; /* New fields for the Scale widget record */ typedef struct { int value; int maximum; int minimum; unsigned char orientation; unsigned char processing_direction; XmString title; XmFontList font_list; XFontStruct * font_struct; Boolean show_value; short decimal_points; Dimension scale_width; Dimension scale_height; Dimension highlight_thickness; Boolean highlight_on_enter; XtCallbackList drag_callback; XtCallbackList value_changed_callback; /* this field is unused since 1.2 and has a new meaning in 2.0: a bitfield that carries instance states: FROM_SET_VALUE, etc The field will be referenced as scale.state_flags using a define in the .c file */ /* Note: Instead, last_value is now being used to resolve between * XmRenderTable & XmFontList when setting up the resource table */ int last_value; int slider_size; GC foreground_GC; int show_value_x; int show_value_y; int show_value_width; int show_value_height; int scale_multiple; XtEnum sliding_mode; XtEnum slider_visual; XtEnum slider_mark; XtEnum show_arrows; Boolean editable; XtCallbackList convert_callback; /* Selection convert callback */ Region value_region; } XmScalePart; #define FROM_SET_VALUE (1<<0) /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmScaleRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmScalePart scale; } XmScaleRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScaleP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TabStack.c0000644000175000017500000041365612672140561012600 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * TabStack.c - Source code for the XmTabStack Widget Class. * * This file contains the source code that implements the XmTabStack * WidgetClass. The XmTabStack is a manager widget where each child of * the TabStack is associated with a label and/or pixmap that is * positioned on the side to simulate a folder tab. * */ #include #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #undef TEAR_OFF_TABS #ifdef TEAR_OFF_TABS #include #include #include #include #endif #ifdef _ARGS #undef _ARGS #endif #ifndef _NO_PROTO #define _ARGS(a) a #else #define _ARGS(a) () #endif extern int _XiGetTabIndex _ARGS((Widget, int, int)); extern int _GetTabWidth _ARGS((Widget, int)); extern int _XmTabBoxGetTabHeight _ARGS((Widget, int)); extern Widget _XmTabBoxCanvas _ARGS((Widget)); extern void _XmTabBoxGetNumRowColumns _ARGS((Widget, int, int*, int*)); extern int _XmTabBoxGetMaxTabWidth _ARGS((Widget)); extern int _XmTabBoxGetMaxTabHeight _ARGS((Widget)); extern void _XmTabBoxSelectTab _ARGS((Widget, int)); extern void _XmTabBoxGetNumRowsColumns _ARGS((Widget, int, int *, int *)); extern void _XmTabBoxStackedGeometry _ARGS((Widget, int, XRectangle *)); extern int _XmTabbedStackListCount _ARGS((XmTabbedStackList)); #ifndef _NO_PROTO static void ClassInitialize (void); #else static void ClassInitialize (); #endif #ifdef TEAR_OFF_TABS static void ClassPartInitialize _ARGS((WidgetClass)); #endif static void Initialize _ARGS((Widget, Widget, ArgList, Cardinal*)); static void Destroy _ARGS((Widget)); static void Resize _ARGS((Widget)); static void Realize _ARGS((Widget, XtValueMask *, XSetWindowAttributes *)); static void Redisplay _ARGS((Widget, XEvent*, Region)); static Boolean SetValues _ARGS((Widget, Widget, Widget, ArgList, Cardinal*)); static XtGeometryResult QueryGeometry _ARGS((Widget, XtWidgetGeometry*, XtWidgetGeometry*)); static XtGeometryResult GeometryManager _ARGS((Widget, XtWidgetGeometry*, XtWidgetGeometry*)); static void ChangeManaged _ARGS((Widget)); static void ConstraintInitialize _ARGS((Widget, Widget, ArgList, Cardinal*)); static void ConstraintDestroy _ARGS((Widget)); static Boolean ConstraintSetValues _ARGS((Widget, Widget, Widget, ArgList, Cardinal*)); static Boolean CvtStringToXmTabSide _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static Boolean CvtStringToXmPixmapPlacement _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static Boolean CvtStringToXiPixel _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static Boolean CvtStringToXiPixmap _ARGS((Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer*)); static void PickSizes _ARGS((XmTabStackWidget, int, int, XRectangle*, XRectangle*)); static void Layout _ARGS((XmTabStackWidget)); static void DrawShadows _ARGS((XmTabStackWidget, GC, GC, int, int, int, int)); static void DrawStackedShadows _ARGS((XmTabStackWidget, GC, GC, int, int, int, int)); static void TabSelectedCallback _ARGS((Widget, XtPointer, XtPointer)); static void CheckSetRenderTable(Widget wid, int offs, XrmValue *value); #ifdef TEAR_OFF_TABS static void TearOffCallback _ARGS((Widget, XtPointer, XtPointer)); static void XmTabStackMenu _ARGS((Widget, XEvent*, String*, Cardinal*)); static void BuildMenu _ARGS((XmTabStackWidget)); static void XmTabBoxDragTab _ARGS((Widget, XEvent*, String*, Cardinal*)); static Atom TabAtom _ARGS((Widget)); static void HandleTabDrop _ARGS((Widget, XtPointer, XtPointer)); static void TabTransferProc _ARGS((Widget, XtPointer, Atom*, Atom*, XtPointer, unsigned long*, int)); static Boolean TabConvertProc _ARGS((Widget, Atom*, Atom*, Atom*, XtPointer*, unsigned long*, int*, unsigned long*, XtPointer, XtRequestId)); static void XiMoveTabPanel _ARGS((Widget, Widget)); #define WidgetAtom(w) XmInternAtom(XtDisplay(w), "WIDGET", False) #endif #define ValidPixmap(p) ((p) != (Pixmap)NULL && \ (p) != (Pixmap)XmUNSPECIFIED_PIXMAP && \ (p) != (Pixmap)XmPIXMAP_DYNAMIC) #define SetSolidGC(d,g,p) \ { \ XGCValues _macro_gc_values; \ _macro_gc_values.foreground = (p); \ _macro_gc_values.fill_style = FillSolid; \ XChangeGC((d),(g), GCForeground | GCFillStyle, &_macro_gc_values); \ } #define SetTiledGC(d,g,p) \ { \ XGCValues _macro_gc_values; \ _macro_gc_values.tile = (p); \ _macro_gc_values.fill_style = FillTiled; \ XChangeGC((d),(g), GCTile | GCFillStyle, &_macro_gc_values); \ } #define XiBackgroundSpecified(c) \ (XmTabStackC_tab_background(c) != XmCOLOR_DYNAMIC || \ ValidPixmap(XmTabStackC_tab_background_pixmap(c))) #define SetChildGC(c,g) \ { \ if( ValidPixmap(XmTabStackC_tab_background_pixmap(c)) ) \ { \ SetTiledGC(XtDisplay(c), (g), XmTabStackC_tab_background_pixmap(c)); \ } \ else \ { \ SetSolidGC(XtDisplay(c), (g), XmTabStackC_tab_background(c)); \ }\ } #define XiSelectSpecified(t) \ (XmTabStack_select_color((t)) != XmCOLOR_DYNAMIC || \ ValidPixmap(XmTabStack_select_pixmap((t)))) #define SetSelectGC(t,g) \ { \ if( ValidPixmap(XmTabStack_select_pixmap((t))) ) \ { \ SetTiledGC(XtDisplay(t), (g), XmTabStack_select_pixmap((t))); \ } \ else \ { \ SetSolidGC(XtDisplay(t), (g), XmTabStack_select_color((t))); \ }\ } #ifndef AssignMax #define AssignMax(x,y) if((y)>(x)) (x)=(y); else #endif #ifndef AssignMin #define AssignMin(x,y) if((y)<(x)) (x)=(y); else #endif #ifndef Max #define Max(x,y) (((x)>(y))?(x):(y)) #endif #define LocalTabBox(t) (XtParent(XmTabStack_tab_box((t))) == (Widget)(t)) #define IsTabBox(t,k) (XmTabStack_tab_box((t)) == (k)) #define IsValidChild(t, k) (XtIsManaged(k) && !(k)->core.being_destroyed && \ !IsTabBox(t,k)) //#define BBPart(w) (*(XmBulletinBoardPart*)((char*)(w) + XmTabStack_offsets[XmBulletinBoardIndex])) #define BBPart(w) (((XmBulletinBoardWidget)(w))->bulletin_board) #ifdef TEAR_OFF_TABS static XtActionsRec actions[] = { { "XmTabStackMenu", (XtActionProc) XmTabStackMenu }, { "XmTabBoxDragTab", (XtActionProc) XmTabBoxDragTab }, }; static char drag_translations[] = ": XmTabBoxArmTab() XmTabBoxDragTab()\n\ : XmTabStackMenu()\n\ osfMenu: XmTabStackMenu()"; #endif static XtConvertArgRec XmColorConvertArgs[] = { {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.self), sizeof(Widget)}, }; static String tab_stack_filter[] = { XmNx, XmNy, XmNwidth, XmNheight, XmNdestroyCallback, XmNsensitive, XmNuserData, XmNnavigationType, XmNmarginWidth, XmNmarginHeight, XmNtabList, XmNtabOrientation, XmNorientation, XmNtabEdge, XmNselectCallback, XmNunselectCallback, NULL }; #ifdef TEAR_OFF_TABS /* * Bitmap used for Drag Icon */ #define tab_pix_width 32 #define tab_pix_height 32 #define tab_pix_x_hot 0 #define tab_pix_y_hot 0 static unsigned char tab_pix_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xa9, 0xea, 0x03, 0x00, 0x54, 0xd5, 0xfb, 0xff, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xaa, 0xaa, 0xaa, 0xba, 0x54, 0x55, 0x55, 0xf5, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static unsigned char tab_mask_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0xfe, 0x1f, 0xec, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* static unsigned char invalid_bits[] = { 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x0e, 0x70, 0x00, 0x00, 0x01, 0x80, 0x00, 0xff, 0x00, 0x00, 0xe3, 0x3f, 0xe0, 0x07, 0xec, 0x13, 0x1c, 0x3c, 0xd8, 0x0b, 0xfe, 0x7f, 0xb0, 0x08, 0x01, 0x20, 0xf0, 0x86, 0xaa, 0x1a, 0xa0, 0x42, 0x55, 0x0d, 0xc2, 0xa2, 0xaa, 0x06, 0xc7, 0x62, 0x55, 0x83, 0xc5, 0xa1, 0xaa, 0xc1, 0x86, 0x51, 0xd5, 0x60, 0x8d, 0xb1, 0x6a, 0xb0, 0x8a, 0x51, 0x35, 0x58, 0x8d, 0xb1, 0x1a, 0xac, 0x8a, 0x51, 0x0d, 0x56, 0x8d, 0xb1, 0x06, 0xab, 0x8a, 0x61, 0x83, 0x55, 0x85, 0xa2, 0xc1, 0xaa, 0xc6, 0xe2, 0x60, 0x55, 0xc5, 0x42, 0xb0, 0xaa, 0xc2, 0x04, 0x58, 0x55, 0xe1, 0x0a, 0xac, 0xaa, 0xb0, 0x0c, 0x56, 0x55, 0xf0, 0x1e, 0xfc, 0x3f, 0xf8, 0x20, 0xe0, 0x07, 0x04, 0xc0, 0x00, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0x00, 0x0e, 0x70, 0x00, 0x00, 0xf0, 0x0f, 0x00, }; static unsigned char invalid_mask_bits[] = { 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0xe0, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xf0, 0x0f, 0x00, }; */ static unsigned char invalid_bits[] = { 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x0e, 0x70, 0x00, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0x00, 0x03, 0x20, 0xe0, 0x07, 0x04, 0x10, 0x1c, 0x38, 0x08, 0x08, 0x02, 0x40, 0x10, 0x08, 0x01, 0x20, 0x10, 0x86, 0x00, 0x10, 0x20, 0x42, 0x00, 0x08, 0x42, 0x22, 0x00, 0x04, 0x45, 0x22, 0x00, 0x82, 0x44, 0x21, 0x00, 0x41, 0x84, 0x11, 0x80, 0x20, 0x88, 0x11, 0x40, 0x10, 0x88, 0x11, 0x20, 0x08, 0x88, 0x11, 0x10, 0x04, 0x88, 0x11, 0x08, 0x02, 0x88, 0x11, 0x04, 0x01, 0x88, 0x21, 0x82, 0x00, 0x84, 0x22, 0x41, 0x00, 0x44, 0xa2, 0x20, 0x00, 0x44, 0x42, 0x10, 0x00, 0x42, 0x04, 0x08, 0x00, 0x21, 0x08, 0x04, 0x80, 0x10, 0x08, 0x02, 0x40, 0x10, 0x10, 0x1c, 0x38, 0x08, 0x20, 0xe0, 0x07, 0x04, 0xc0, 0x00, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0x00, 0x0e, 0x70, 0x00, 0x00, 0xf0, 0x0f, 0x00, }; static unsigned char invalid_mask_bits[] = { 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0x1f, 0xf8, 0x0f, 0xf8, 0x03, 0xc0, 0x1f, 0xf8, 0x01, 0xe0, 0x1f, 0xfe, 0x00, 0xf0, 0x3f, 0x7e, 0x00, 0xf8, 0x7f, 0x3e, 0x00, 0xfc, 0x7d, 0x3e, 0x00, 0xfe, 0x7c, 0x3f, 0x00, 0x7f, 0xfc, 0x1f, 0x80, 0x3f, 0xf8, 0x1f, 0xc0, 0x1f, 0xf8, 0x1f, 0xe0, 0x0f, 0xf8, 0x1f, 0xf0, 0x07, 0xf8, 0x1f, 0xf8, 0x03, 0xf8, 0x1f, 0xfc, 0x01, 0xf8, 0x3f, 0xfe, 0x00, 0xfc, 0x3e, 0x7f, 0x00, 0x7c, 0xbe, 0x3f, 0x00, 0x7c, 0xfe, 0x1f, 0x00, 0x7e, 0xfc, 0x0f, 0x00, 0x3f, 0xf8, 0x07, 0x80, 0x1f, 0xf8, 0x03, 0xc0, 0x1f, 0xf0, 0x1f, 0xf8, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xf0, 0x0f, 0x00, }; #endif static XtResource resources[] = { /* Inherit (but changed default) resources */ { XmNshadowThickness, XmCShadowThickness, XmRDimension, sizeof(Dimension), XtOffsetOf(XmManagerRec, manager.shadow_thickness), XmRImmediate, (XtPointer) 2 }, { XmNautoUnmanage, XmCAutoUnmanage, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmBulletinBoardRec, bulletin_board.auto_unmanage), XmRImmediate, (XtPointer) False }, /* TabBox Resources */ #ifdef TEAR_OFF_TABS { XmNallowTearOffTabs, XmCAllowTearOffTabs, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackRec, tab_stack.allow_tear_offs), XmRImmediate, (XtPointer) True }, { XmNtearOffLabelString, XmCTearOffLabelString, XmRXmString, sizeof(XmString), XtOffsetOf(XmTabStackRec, tab_stack.tear_off_label), XmRString, (XtPointer) "Tear Off Tab" }, #endif { XmNtabAutoSelect, XmCTabAutoSelect, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackRec, tab_stack.tab_auto_select), XmRImmediate, (XtPointer) True }, { XmNtabStyle, XmCTabStyle, XmRTabStyle, sizeof(XmTabStyle), XtOffsetOf(XmTabStackRec, tab_stack.tab_style), XmRImmediate, (XtPointer) XmTABS_BEVELED }, { XmNtabMode, XmCTabMode, XmRTabMode, sizeof(XmTabMode), XtOffsetOf(XmTabStackRec, tab_stack.tab_mode), XmRImmediate, (XtPointer) XmTABS_BASIC }, { XmNtabMarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_margin_width), XmRImmediate, (XtPointer) 3 }, { XmNtabMarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_margin_height), XmRImmediate, (XtPointer) 3 }, { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackRec, tab_stack.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof (XmFontList), XtOffsetOf(XmTabStackRec, tab_stack.font_list), XmRCallProc, (XtPointer) CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmTabStackRec, tab_stack.font_list), XmRCallProc, (XtPointer) CheckSetRenderTable }, { XmNhighlightThickness, XmCHighlightThickness, XmRDimension, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.highlight_thickness), XmRImmediate, (XtPointer) 2 }, { XmNtabSide, XmCTabSide, XmRXmTabSide, sizeof(XmTabSide), XtOffsetOf(XmTabStackRec, tab_stack.tab_side), XmRImmediate, (XtPointer) XmTABS_ON_TOP }, { XmNtabOrientation, XmCTabOrientation, XmRTabOrientation, sizeof(XmTabOrientation), XtOffsetOf(XmTabStackRec, tab_stack.tab_orientation), XmRImmediate, (XtPointer) XmTAB_ORIENTATION_DYNAMIC }, { XmNuniformTabSize, XmCUniformTabSize, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackRec, tab_stack.uniform_tab_size), XmRImmediate, (XtPointer) True }, { XmNtabSelectColor, XmCTabSelectColor, XmRXmPixel, sizeof(Pixel), XtOffsetOf(XmTabStackRec, tab_stack.select_color), XmRImmediate, (XtPointer) XmCOLOR_DYNAMIC }, { XmNtabSelectPixmap, XmCTabSelectPixmap, XmRXmPixmap, sizeof(Pixmap), XtOffsetOf(XmTabStackRec, tab_stack.select_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNstackedEffect, XmCStackedEffect, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackRec, tab_stack.stacked_effect), XmRImmediate, (XtPointer) True }, { XmNtabCornerPercent, XmCTabCornerPercent, XmRInt, sizeof(int), XtOffsetOf(XmTabStackRec, tab_stack.tab_corner_percent), XmRImmediate, (XtPointer) 40 }, { XmNtabLabelSpacing, XmCTabLabelSpacing, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_label_spacing), XmRImmediate, (XtPointer) 2 }, { XmNtabOffset, XmCTabOffset, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_offset), XmRImmediate, (XtPointer) 10 }, { XmNuseImageCache, XmCUseImageCache, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackRec, tab_stack.use_image_cache), XmRImmediate, (XtPointer) True }, { XmNtabSelectedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmTabStackRec, tab_stack.tab_select_callback), XmRImmediate, (XtPointer) NULL }, /* appears to be intentionally undocumented; interface not yet public */ { XmNtabBoxWidget, XmCWidget, XmRWidget, sizeof(Widget), XtOffsetOf(XmTabStackRec, tab_stack.tab_box), XmRImmediate, (XtPointer) NULL } }; static XmSyntheticResource get_resources[] = { { XmNtabMarginWidth, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_margin_width), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNtabMarginHeight, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_margin_height), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNtabLabelSpacing, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_label_spacing), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNtabOffset, sizeof(Dimension), XtOffsetOf(XmTabStackRec, tab_stack.tab_offset), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels } }; static XtResource constraint_resources[] = { { XmNtabLabelString, XmCTabLabelString, XmRXmString, sizeof(XmString), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_label_string), XmRImmediate, (XtPointer) NULL }, { XmNtabAlignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_alignment), XmRImmediate, (XtPointer) XmALIGNMENT_CENTER }, { XmNtabStringDirection, XmCStringDirection, XmRStringDirection, sizeof(unsigned char), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_string_direction), XmRImmediate, (XtPointer) XmSTRING_DIRECTION_DEFAULT }, { XmNtabLabelPixmap, XmCTabLabelPixmap, XmRManForegroundPixmap, sizeof(Pixmap), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_label_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNtabPixmapPlacement, XmCTabPixmapPlacement, XmRXmPixmapPlacement, sizeof(XmPixmapPlacement), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_pixmap_placement), XmRImmediate, (XtPointer) XmPIXMAP_RIGHT }, { XmNfreeTabPixmap, XmCFreeTabPixmap, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackConstraintRec, tab_stack.free_tab_pixmap), XmRImmediate, (XtPointer) False }, { XmNtabBackground, XmCBackground, XmRXmPixel, sizeof(Pixel), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_background), XmRImmediate, (XtPointer) XmCOLOR_DYNAMIC }, { XmNtabBackgroundPixmap, XmCBackgroundPixmap, XmRXmPixmap, sizeof(Pixmap), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_background_pixmap), XmRImmediate, (XtPointer) XmPIXMAP_DYNAMIC }, { XmNtabForeground, XmCForeground, XmRXmPixel, sizeof(Pixel), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_foreground), XmRImmediate, (XtPointer) XmCOLOR_DYNAMIC }, #ifdef TEAR_OFF_TABS { XmNtabTearOffEnabled, XmCTabTearOffEnabled, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tear_off_enabled), XmRImmediate, (XtPointer) True } #endif }; static void Get_tabLabelString(Widget, int, XtArgVal *); static XmSyntheticResource cont_get_resources[] = { { XmNtabLabelString, sizeof(XmString), XtOffsetOf(XmTabStackConstraintRec, tab_stack.tab_label_string), Get_tabLabelString, (XmImportProc) NULL } }; /* ARGSUSED */ static void Get_tabLabelString (Widget widget, int offset, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmTabStackC_tab_label_string(widget)); } XmTabStackClassRec xmTabStackClassRec = { { /* Core Fields */ /* superclass */ (WidgetClass) &xmBulletinBoardClassRec, /* class_name */ "XmTabStack", /* widget_size */ sizeof(XmTabStackRec), /* class_initialize */ ClassInitialize, #ifdef TEAR_OFF_TABS /* class_part_initial */ ClassPartInitialize, #else /* class_part_initial */ NULL, #endif /* class_inited */ False, /* initialize */ Initialize, /* initialize hook */ NULL, /* realize */ Realize, #ifdef TEAR_OFF_TABS /* actions */ actions, /* num_actions */ XtNumber(actions), #else /* actions */ NULL, /* num_actions */ 0, #endif /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ True, /* compress_exposure */ XtExposeCompressMultiple, /* compress enter/exit*/ True, /* visible_interest */ False, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set values hook */ NULL, /* set values almost */ XtInheritSetValuesAlmost, /* get values hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ XtInheritTranslations, /* query geo proc */ QueryGeometry, /* display accelerator*/ NULL, /* extension record */ (XtPointer) NULL }, { /* Composite Fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ (XtPointer) NULL }, { /* Constraint Fields */ /* resources */ constraint_resources, /* num_resources */ XtNumber(constraint_resources), /* constraint_size */ sizeof (XmTabStackConstraintRec), /* initialize */ ConstraintInitialize, /* destroy */ ConstraintDestroy, /* set_values */ ConstraintSetValues, /* extension */ (XtPointer) NULL }, { /* OSF/Motif Manager Fields */ /* translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_resources */ cont_get_resources, /* num_syn_resources */ XtNumber(cont_get_resources), /* parent_process */ XmInheritParentProcess, /* extension */ (XtPointer) NULL }, { /* OSF/Motif BulletinBoard */ /* always_install_acc */ False, /* geo_matrix_create */ XmInheritGeoMatrixCreate, /* focus_moved_proc */ XmInheritFocusMovedProc, /* extension */ (XtPointer) NULL }, { /* EPak Stack Box Fields */ #ifdef TEAR_OFF_TABS /* drag_translations */ drag_translations, #else /* drag_translations */ "", #endif /* extension */ (XtPointer) NULL } }; WidgetClass xmTabStackWidgetClass = (WidgetClass) &xmTabStackClassRec; /* * Note these aren't static, even though they should be. TabBox.c * uses the instance data too. */ /* * Function: * ClassInitialize(void) * Description: * This function sets all the type converters needed for the * XmTabStack widget class. * Input: * None. * Output: * None. */ static void #ifndef _NO_PROTO ClassInitialize(void) #else ClassInitialize() #endif { XmTabStackClassRec* wc = &xmTabStackClassRec; /* * Initialize the XmTabBox class to add its type converters which we * also use. */ XtInitializeWidgetClass(xmTabBoxWidgetClass); XtSetTypeConverter(XmRString, XmRXmTabSide, CvtStringToXmTabSide, NULL, 0, XtCacheNone, NULL); XtSetTypeConverter(XmRString, XmRXmPixmapPlacement, CvtStringToXmPixmapPlacement, NULL, 0, XtCacheNone, NULL); XtSetTypeConverter(XmRString, XmRXmPixel, CvtStringToXiPixel, XmColorConvertArgs, XtNumber(XmColorConvertArgs), XtCacheNone, NULL); XtSetTypeConverter(XmRString, XmRXmPixmap, CvtStringToXiPixmap, XmColorConvertArgs, XtNumber(XmColorConvertArgs), XtCacheNone, NULL); } #ifdef TEAR_OFF_TABS static void #ifndef _NO_PROTO ClassPartInitialize(WidgetClass widget_class) #else ClassPartInitialize(widget_class) WidgetClass widget_class; #endif { XmTabStackWidgetClass tab = (XmTabStackWidgetClass) widget_class; _XmFastSubclassInit (w_class, XmTABSTACK_BIT); if( XmTabStack_class(tab).drag_translations != NULL ) { if( (String)XmTabStack_class(tab).drag_translations == XtInheritTranslations ) { XmTabStack_class(tab).drag_translations = (String) ((XmTabStackWidgetClass) tab->core_class.superclass)-> tab_stack_class.drag_translations; } else { XmTabStack_class(tab).drag_translations = (String) XtParseTranslationTable((String) XmTabStack_class(tab). drag_translations); } } } #endif /* * Function: * Initialize(request, set, arg_list, arg_cnt) * Description: * This function initializes the widget data structure for an * instance of the XmTabStack. * Input: * request : Widget - the user's requested resources * set : Widget - the initial resource values * arg_list : ArgList - the argument list passed in with creation * arg_cnt : Cardinal* - the number of arguments * Output: * None. */ static void #ifndef _NO_PROTO Initialize(Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) #else Initialize(request, set, arg_list, arg_cnt) Widget request, set; ArgList arg_list; Cardinal *arg_cnt; #endif { XmTabStackWidget ts = (XmTabStackWidget) set; Arg args[50]; ArgList filtered_args, merged_args; Cardinal n = 0, num_filtered_args; XmTabOrientation orientation = XmTabStack_tab_orientation(ts); XmTabStack__inited(ts) = False; /* By default call XmNtabSelectedCallback callbacks when tab is selected */ XmTabStack_do_notify(ts) = True; /* * Lets make sure that our font list is not NULL. If it is we will * set it to the appropriate default. */ if( XmTabStack_font_list(ts) == NULL ) { XmTabStack_font_list(ts) = XmeGetDefaultRenderTable(set, XmLABEL_FONTLIST); } XmTabStack_font_list(ts) = XmFontListCopy(XmTabStack_font_list(ts)); XmTabStack__gc(ts) = NULL; /* * For our stack we need to create a TabBox, to do this we need to set * up some arguments depending on which side the caller wants the tabs * on. */ switch( XmTabStack_tab_side(ts) ) { case XmTABS_ON_TOP: default: XtSetArg(args[n], XmNorientation, XmHORIZONTAL); ++n; if( orientation == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_LEFT_TO_RIGHT); ++n; } else { XtSetArg(args[n], XmNtabOrientation, orientation); ++n; } XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_BOTTOM_RIGHT); ++n; break; case XmTABS_ON_BOTTOM: XtSetArg(args[n], XmNorientation, XmHORIZONTAL); ++n; if( orientation == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_LEFT_TO_RIGHT); ++n; } else { XtSetArg(args[n], XmNtabOrientation, orientation); ++n; } XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_TOP_LEFT); ++n; break; case XmTABS_ON_RIGHT: XtSetArg(args[n], XmNorientation, XmVERTICAL); ++n; if( orientation == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_TOP_TO_BOTTOM); ++n; } else { XtSetArg(args[n], XmNtabOrientation, orientation); ++n; } XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_TOP_LEFT); ++n; break; case XmTABS_ON_LEFT: XtSetArg(args[n], XmNorientation, XmVERTICAL); ++n; if( orientation == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_BOTTOM_TO_TOP); ++n; } else { XtSetArg(args[n], XmNtabOrientation, orientation); ++n; } XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_BOTTOM_RIGHT); ++n; break; } /* * Lets do a real quick check here. If we are in a stacked mode * and XmNuniformTabSize is False, then lets set it to true. * * We have to add the XtSetArg for the default value of XmNuniformTabSize * here because we may override it later. */ XtSetArg(args[n], XmNuniformTabSize, XmTabStack_uniform_tab_size(ts)); ++n; if( !XmTabStack_uniform_tab_size(ts) && (XmTabStack_tab_mode(ts) == XmTABS_STACKED || XmTabStack_tab_mode(ts) == XmTABS_STACKED_STATIC) ) { /* * Well it appears that we need to issue a warning here, because * the user tried to set XmNuniformTabSize to False, while in a * stacked mode. */ XmTabStack_uniform_tab_size(ts) = True; XmeWarning(set, XmNillegalUniformTabSizeMsg); XtSetArg(args[n], XmNuniformTabSize, True); ++n; } /* * Lets make sure we pass certain resource down to our children, like * color and font specification. This way if they were set via app * defaults the correct thing will happen. */ XtSetArg(args[n], XmNrenderTable, XmTabStack_font_list(ts)); ++n; XtSetArg(args[n], XmNbackground, ts->core.background_pixel); ++n; XtSetArg(args[n], XmNshadowThickness, ts->manager.shadow_thickness); ++n; XtSetArg(args[n], XmNtabMode, XmTabStack_tab_mode(ts)); ++n; XtSetArg(args[n], XmNtabStyle, XmTabStack_tab_style(ts)); ++n; XtSetArg(args[n], XmNtabAutoSelect, XmTabStack_tab_auto_select(ts)); ++n; XtSetArg(args[n], XmNtabSelectColor, XmTabStack_select_color(ts)); ++n; XtSetArg(args[n], XmNtabSelectPixmap, XmTabStack_select_pixmap(ts));++n; XtSetArg(args[n], XmNtabMarginWidth, XmTabStack_tab_margin_width(ts)); ++n; XtSetArg(args[n], XmNtabMarginHeight, XmTabStack_tab_margin_height(ts));++n; XtSetArg(args[n], XmNtabLabelSpacing, XmTabStack_tab_label_spacing(ts));++n; XtSetArg(args[n], XmNtabCornerPercent, XmTabStack_tab_corner_percent(ts)); ++n; XtSetArg(args[n], XmNtabOffset, XmTabStack_tab_offset(ts)); ++n; XtSetArg(args[n], XmNhighlightThickness, XmTabStack_highlight_thickness(ts)); ++n; XtSetArg(args[n], XmNuseImageCache, XmTabStack_use_image_cache(ts)); ++n; XtSetArg(args[n], XmNunitType, XmPIXELS); ++n; /* * We also want to filter the other arguments that the user has * assigned to us. We will then merge these with the argument * list we created and pass this to the children we create. */ _XmFilterArgs(arg_list, *arg_cnt, tab_stack_filter, &filtered_args, &num_filtered_args); merged_args = XtMergeArgLists(filtered_args, num_filtered_args, args, n); if( XmTabStack_tab_box(ts) == NULL ) { XmTabStack_tab_box(ts) = XtCreateManagedWidget("tabBox", xmTabBoxWidgetClass, set, merged_args, n + num_filtered_args); } else { XtSetValues(XmTabStack_tab_box(ts), merged_args, n + num_filtered_args); } #ifdef TEAR_OFF_TABS if( XmTabStack_tear_off_label(ts) != NULL ) { XmTabStack_tear_off_label(ts) = XmStringCopy(XmTabStack_tear_off_label(ts)); } canvas = XmTabBox__canvas(XmTabStack_tab_box((XmTabBoxWidget)ts)); n = 0; XmTabStack__menu(ts) = XmCreatePopupMenu(canvas, "tabMenu", args, n); XtOverrideTranslations(canvas, (XtTranslations)((XmTabStackWidgetClass)(ts->core.widget_class)) ->tab_stack_class.drag_translations); target = TabAtom(set); n = 0; XtSetArg(args[n], XmNdropSiteActivity, XmDROP_SITE_ACTIVE); ++n; XtSetArg(args[n], XmNdropSiteOperations, XmDROP_MOVE); ++n; XtSetArg(args[n], XmNdropSiteType, XmDROP_SITE_COMPOSITE); ++n; XtSetArg(args[n], XmNimportTargets, &target); ++n; XtSetArg(args[n], XmNnumImportTargets, 1); ++n; XtSetArg(args[n], XmNdropProc, HandleTabDrop); ++n; XmDropSiteRegister(set, args, n); n = 0; XtSetArg(args[n], XmNlabelString, XmTabStack_tear_off_label(ts)); ++n; XmTabStack__tear_off_button(ts) = XtCreateManagedWidget("tearOffTab", xmPushButtonWidgetClass, XmTabStack__menu(ts), args, n); XtAddCallback(XmTabStack__tear_off_button(ts), XmNactivateCallback, TearOffCallback, NULL); n = 0; (void) XtCreateManagedWidget("separator", xmSeparatorWidgetClass, XmTabStack__menu(ts), NULL, 0); #endif /* * Add a callback to the XmTabBox so that we know when to display * the correct child. */ XtAddCallback(XmTabStack_tab_box(ts), XmNselectCallback, TabSelectedCallback, NULL); /* * Now that we are done with these argument list lets deallocate * them. */ XtFree((XtPointer)filtered_args); XtFree((XtPointer)merged_args); /* * Lets initialize some of the instances values. */ XmTabStack__size(ts).x = -1; XmTabStack__active_child(ts) = (Widget) NULL; XmTabStack__tab_list(ts) = (XmTabbedStackList) NULL; XmTabStack__source_icon(ts) = NULL; XmTabStack__invalid_icon(ts) = NULL; XmTabStack__source_pixmap(ts) = XmUNSPECIFIED_PIXMAP; XmTabStack__source_mask(ts) = XmUNSPECIFIED_PIXMAP; XmTabStack__invalid_pixmap(ts) = XmUNSPECIFIED_PIXMAP; XmTabStack__invalid_mask(ts) = XmUNSPECIFIED_PIXMAP; XmTabStack__set_tab_list(ts) = False; /* * Finally if the caller did not assign us a geometry lets pick * an appropriate default. */ if( request->core.width == 0 ) { ts->core.width = 2 * (ts->manager.shadow_thickness + BBPart(ts).margin_width) + 50; } if( request->core.height == 0 ) { ts->core.height = 2 * (ts->manager.shadow_thickness + BBPart(ts).margin_height) + 50; } /* Used to select tabs before they are realized */ XmTabStack__selected_tab(ts) = NULL; XmTabStack__selected_notify(ts) = False; /* * Now that the widget is initialized lets flag that fact. */ XmTabStack__inited(ts) = True; } /* * Function: * Destroy(widget) * Description: * Deallocates all the memory allocated during the lifetime of the * given widget instance. * Input: * widget : Widget - the widget being destroyed. * Output: * None. */ static void #ifndef _NO_PROTO Destroy(Widget widget) #else Destroy(widget) Widget widget; #endif { XmTabStackWidget tab = (XmTabStackWidget) widget; /* * If we have a tab list lets deallocate it. */ if( XmTabStack__tab_list(tab) != NULL ) { XmTabbedStackListFree(XmTabStack__tab_list(tab)); } XmFontListFree(XmTabStack_font_list(tab)); if( XmTabStack__gc(tab) != NULL ) { XFreeGC(XtDisplay(tab), XmTabStack__gc(tab)); } #ifdef TEAR_OFF_TABS if( XmTabStack_tear_off_label(tab) != NULL ) { XmStringFree(XmTabStack_tear_off_label(tab)); } if( ValidPixmap(XmTabStack__source_pixmap(tab)) ) { XFreePixmap(XtDisplay(widget), XmTabStack__source_pixmap(tab)); } if( ValidPixmap(XmTabStack__source_mask(tab)) ) { XFreePixmap(XtDisplay(widget), XmTabStack__source_mask(tab)); } if( ValidPixmap(XmTabStack__invalid_pixmap(tab)) ) { XFreePixmap(XtDisplay(widget), XmTabStack__invalid_pixmap(tab)); } if( ValidPixmap(XmTabStack__invalid_mask(tab)) ) { XFreePixmap(XtDisplay(widget), XmTabStack__invalid_mask(tab)); } #endif } /* * Function: * Realize(widget, XtValueMask *, XSetWindowAttributes *) * Description: * A realize method is used to address a timing issue that blocks * XmTabStackSelectTab() from working before a selected tab widget * has been realized... * Input: * widget : Widget - the widget being resized. * * * Output: * None. */ static void #ifndef _NO_PROTO Realize(Widget w, XtValueMask *mask, XSetWindowAttributes *attr) #else Realize(w, mask, attr) Widget w; #endif { XmTabStackWidget tab = (XmTabStackWidget) w; /* Call superclass realize method... */ XtRealizeProc realize; _XmProcessLock(); realize = xmTabStackWidgetClass->core_class.superclass->core_class.realize; _XmProcessUnlock(); (*realize) (w, mask, attr); /* Now that we are realized, let's select that tab, finally... */ if ((XmTabStack__selected_tab(tab) != NULL) && !XmTabStack__selected_tab(tab)->core.being_destroyed) { XmTabStackSelectTab(XmTabStack__selected_tab(tab), XmTabStack__selected_notify(tab)); } /* * Lets create a GC that we will use for drawing. */ XmTabStack__gc(tab) = XCreateGC(XtDisplay(tab), XtWindow(tab), 0, NULL); } /* * Function: * Resize(widget) * Description: * Handles everything when the XmTabStack is resized. This means * that is shifts the children around to their new locations and * sizes. * Input: * widget : Widget - the widget being resized. * Output: * None. */ static void #ifndef _NO_PROTO Resize(Widget widget) #else Resize(widget) Widget widget; #endif { XmTabStackWidget tab = (XmTabStackWidget) widget; Widget active = XmTabStack__active_child(tab); XRectangle *size = &(XmTabStack__size(tab)); Boolean stacked = False; int cnt = _XmTabbedStackListCount(XmTabStack__tab_list(tab)); GC gc = tab->manager.background_GC; if( XmTabStack_tab_mode(tab) == XmTABS_STACKED || XmTabStack_tab_mode(tab) == XmTABS_STACKED_STATIC ) { stacked = True; } /* * First lets relayout all our children. */ Layout(tab); /* * If we are realized then we want to do something about our * shadows, like erase the old one and redraw them at their * new location. */ if( XtIsRealized(widget) ) { if( stacked || size->x != -1 ) { if( active != NULL && XiBackgroundSpecified(active) ) { gc = XmTabStack__gc(tab); SetChildGC(active, gc); } if( (!stacked || cnt < 1) && size->x != -1 ) { DrawShadows(tab, gc, gc, size->x, size->y, size->width, size->height); } } if( stacked && active != NULL && cnt > 0 ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, active->core.x - BBPart(tab).margin_width, active->core.y - BBPart(tab).margin_height, XtWidth(active) + 2*BBPart(tab).margin_width, XtHeight(active)+ 2*BBPart(tab).margin_height); } else { DrawShadows(tab, tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, 0, 0, XtWidth(widget), XtHeight(widget)); } size->x = size->y = 0; size->width = XtWidth(widget); size->height = XtHeight(widget); } } /* * Function: * Redisplay(widget, event, region) * Description: * Draws all the visuals for the TabStack. * Input: * widget : Widget - the widget that needs redisplayed * event : XEvent* - the event causing the redisplay * region : Region - the region that is being redisplayed. * Output: * None. */ static void #ifndef _NO_PROTO Redisplay(Widget widget, XEvent *event, Region region) #else Redisplay(widget, event, region) Widget widget; XEvent *event; Region region; #endif { XmTabStackWidget tab = (XmTabStackWidget) widget; XRectangle *size = &(XmTabStack__size(tab)); Widget active = XmTabStack__active_child(tab); int cnt = _XmTabbedStackListCount(XmTabStack__tab_list(tab)); Boolean stacked = False; if( XmTabStack_stacked_effect(tab) && active != NULL && (XmTabStack_tab_mode(tab) == XmTABS_STACKED || XmTabStack_tab_mode(tab) == XmTABS_STACKED_STATIC) ) { stacked = True; } /* * Now lets look at our active child and if they have a background * set lets color ourselves that background. */ if( (active != NULL) && (XiBackgroundSpecified(active) || XiSelectSpecified(tab)) ) { GC gc = XmTabStack__gc(tab); if( XiSelectSpecified(tab) ) { SetSelectGC(tab, gc); } else { SetChildGC(active, gc); } if( stacked ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, active->core.x - BBPart(tab).margin_width, active->core.y - BBPart(tab).margin_height, XtWidth(active) + 2 * (BBPart(tab).margin_width), XtHeight(active) + 2 * (BBPart(tab).margin_height)); } else { if( event == NULL || event->xany.type != Expose ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, 0, 0, XtWidth(tab), XtHeight(tab)); } else { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, event->xexpose.x, event->xexpose.y, event->xexpose.width, event->xexpose.height); } } } /* * next if we have any gadget children lets be sure to * redisplay them. */ XmeRedisplayGadgets(widget, event, region); /* * Now lets redray our shadows. */ if( stacked && cnt > 0 ) { DrawStackedShadows(tab, tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, 0, 0, XtWidth(active) + (2 * BBPart(tab).margin_width), XtHeight(active) + (2 * BBPart(tab).margin_height)); } else { DrawShadows(tab, tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, 0, 0, XtWidth(widget), XtHeight(widget)); } size->x = size->y = 0; size->width = XtWidth(widget); size->height = XtHeight(widget); } /* * Function: * SetValues(current, request, set, arg_list, arg_cnt) * Description: * Handles changes to the widget induced by resource settings. * Input: * current : Widget - the current state of the widget * request : Widget - the request made by the caller * set : Widget - the widget as it will appear * arg_list : ArgList - the argument list to implement the changes * arg_cnt : Cardinal* - the number of arguments * Output: * Boolean - True if a redisplay is needed, else False. */ #define rfield(f) (XmTabStack_##f(r_tab)) #define cfield(f) (XmTabStack_##f(c_tab)) #define sfield(f) (XmTabStack_##f(s_tab)) #define bcfield(f) \ (((XmBulletinBoardWidget) c_tab)->bulletin_board.f) #define bsfield(f) \ (((XmBulletinBoardWidget) s_tab)->bulletin_board.f) //#define bcfield(f) ((XmBulletinBoardPart*) \ // ((char*)c_tab + XmTabStack_offsets[XmBulletinBoardIndex]))->f //#define bsfield(f) ((XmBulletinBoardPart*) \ // ((char*)s_tab + XmTabStack_offsets[XmBulletinBoardIndex]))->f static Boolean #ifndef _NO_PROTO SetValues(Widget current, Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) #else SetValues(current, request, set, arg_list, arg_cnt) Widget current, request, set; ArgList arg_list; Cardinal *arg_cnt; #endif { XmTabStackWidget c_tab = (XmTabStackWidget) current, s_tab = (XmTabStackWidget) set; Arg args[25]; ArgList filtered_args, merged_args; int n = 0; Cardinal num_filtered_args; Boolean need_redraw = False, need_resize = False, need_layout = False; if( c_tab->manager.shadow_thickness != s_tab->manager.shadow_thickness ) { need_resize = True; need_layout = True; } if( bcfield(margin_width) != bsfield(margin_width) || bcfield(margin_height) != bsfield(margin_height) || cfield(tab_side) != sfield(tab_side) || cfield(tab_orientation) != sfield(tab_orientation) ) { need_layout = True; need_resize = True; } if( cfield(select_color) != sfield(select_color) || cfield(select_pixmap) != sfield(select_pixmap) ) { need_redraw = True; } if( cfield(font_list) != sfield(font_list) ) { XmFontListFree(cfield(font_list)); if( sfield(font_list) == NULL ) { sfield(font_list) = XmeGetDefaultRenderTable(set, XmLABEL_FONTLIST); } sfield(font_list) = XmFontListCopy(sfield(font_list)); } if( cfield(tab_side) != sfield(tab_side) || cfield(tab_orientation) != sfield(tab_orientation) ) { switch( sfield(tab_side) ) { case XmTABS_ON_TOP: default: XtSetArg(args[n], XmNorientation, XmHORIZONTAL); ++n; XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_BOTTOM_RIGHT); ++n; if( sfield(tab_orientation) == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_LEFT_TO_RIGHT); } else { XtSetArg(args[n], XmNtabOrientation, sfield(tab_orientation)); } n++; break; case XmTABS_ON_BOTTOM: XtSetArg(args[n], XmNorientation, XmHORIZONTAL); ++n; XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_TOP_LEFT); ++n; if( sfield(tab_orientation) == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_LEFT_TO_RIGHT); } else { XtSetArg(args[n], XmNtabOrientation, sfield(tab_orientation)); } n++; break; case XmTABS_ON_RIGHT: XtSetArg(args[n], XmNorientation, XmVERTICAL); ++n; XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_TOP_LEFT); ++n; if( sfield(tab_orientation) == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_TOP_TO_BOTTOM); } else { XtSetArg(args[n], XmNtabOrientation, sfield(tab_orientation)); } n++; break; case XmTABS_ON_LEFT: XtSetArg(args[n], XmNorientation, XmVERTICAL); ++n; XtSetArg(args[n], XmNtabEdge, XmTAB_EDGE_BOTTOM_RIGHT); ++n; if( sfield(tab_orientation) == XmTAB_ORIENTATION_DYNAMIC ) { XtSetArg(args[n], XmNtabOrientation, XmTABS_BOTTOM_TO_TOP); } else { XtSetArg(args[n], XmNtabOrientation, sfield(tab_orientation)); } n++; break; } need_layout = True; need_resize = True; need_redraw = True; } if( !sfield(uniform_tab_size) && sfield(uniform_tab_size) != cfield(uniform_tab_size) && (XmTabStack_tab_mode(s_tab) == XmTABS_STACKED || XmTabStack_tab_mode(s_tab) == XmTABS_STACKED_STATIC) ) { XmeWarning(set, XmNillegalUniformTabSizeMsg); XtSetArg(args[n], XmNuniformTabSize, True); ++n; } if( (sfield(tab_mode) == XmTABS_STACKED || sfield(tab_mode) == XmTABS_STACKED_STATIC) && sfield(tab_mode) != cfield(tab_mode) && !sfield(uniform_tab_size) ) { XmeWarning(set, XmNillegalUniformTabSizeMsg); XtSetArg(args[n], XmNuniformTabSize, True); ++n; } if( XmTabStack__inited(s_tab) && (XmTabStack_tab_box(s_tab) != NULL )) { _XmFilterArgs(arg_list, *arg_cnt, tab_stack_filter, &filtered_args, &num_filtered_args); merged_args = XtMergeArgLists(filtered_args, num_filtered_args, args, n); XtSetValues(XmTabStack_tab_box(s_tab), merged_args, n + num_filtered_args); n = 0; XtFree((XtPointer)filtered_args); XtFree((XtPointer)merged_args); } #ifdef TEAR_OFF_TABS if( cfield(tear_off_label) != sfield(tear_off_label) ) { if( cfield(tear_off_label) != NULL ) { XmStringFree(cfield(tear_off_label)); } if( sfield(tear_off_label) != NULL ) { sfield(tear_off_label) = XmStringCopy(sfield(tear_off_label)); } XtVaSetValues(sfield(_tear_off_button), XmNlabelString, sfield(tear_off_label), NULL); } #endif /* TEAR_OFF_TABS */ if( need_layout ) { Resize(set); } if( need_redraw ) { Widget canvas = _XmTabBoxCanvas(XmTabStack_tab_box(s_tab)); if( XtIsRealized(canvas) ) { XClearArea(XtDisplay(set), XtWindow(canvas), 0, 0, 0, 0, True); } } if( need_resize ) { XtWidgetGeometry unused, allowed; unused.request_mode = 0; QueryGeometry(set, &unused, &allowed); if( BBPart(s_tab).resize_policy != XmRESIZE_NONE ) { /* * Lets just adjust the values depending on our resize * policy. */ if( BBPart(s_tab).resize_policy == XmRESIZE_GROW ) { if( allowed.width < s_tab->core.width ) { allowed.width = s_tab->core.width; } if( allowed.height < s_tab->core.height ) { allowed.height = s_tab->core.height; } } if( XtWidth(request) == XtWidth(current) ) { s_tab->core.width = allowed.width; } if( XtHeight(request) == XtHeight(current) ) { s_tab->core.height = allowed.height; } } } return( need_redraw || need_layout || need_resize ); } #undef cfield #undef rfield #undef sfield #undef bcfield #undef bsfield static XtGeometryResult #ifndef _NO_PROTO QueryGeometry(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *allowed) #else QueryGeometry(widget, request, allowed) Widget widget; XtWidgetGeometry *request, *allowed; #endif { XmTabStackWidget tab = (XmTabStackWidget)widget; WidgetList kid; XtWidgetGeometry tab_wanted; Cardinal i; Boolean have_width, have_height; int kid_width = 0, kid_height = 0, width, height; /* * First lets check to see if the caller is interested in the * same things we are, i.e. if the caller does not care about * the width or height then we will accept whatever they * give us. */ if( request->request_mode != 0 && !(request->request_mode & (CWWidth | CWHeight)) ) { return( XtGeometryYes ); } *allowed = *request; allowed->request_mode = CWWidth | CWHeight; /* * If we get this far we know that they care about our Dimensions * so lets grab the desired width/height of our kids and see what * they want. We calculate our kids width by taking the max of * all the widths and heights and then adding room for the margins. */ for( i = 0, kid = tab->composite.children; i < tab->composite.num_children; ++i ) { if( !IsValidChild(tab, kid[i]) ) continue; AssignMax(kid_width, (int)XmTabStackC_width(kid[i])); AssignMax(kid_height, (int)XmTabStackC_height(kid[i])); } /* * Now that we know the bounding box of all the children lets add the * margin to that area. */ width = kid_width += 2 * BBPart(tab).margin_width + tab->manager.shadow_thickness; height = kid_height += 2 * BBPart(tab).margin_height + tab->manager.shadow_thickness; if (XmTabStack_tab_side(tab) == XmTABS_ON_TOP || XmTabStack_tab_side(tab) == XmTABS_ON_BOTTOM) { width += tab->manager.shadow_thickness; } else /* if (XmTabStack_tab_side(tab) == XmTABS_ON_LEFT || XmTabStack_tab_side(tab) == XmTABS_ON_RIGHT) */ { height += tab->manager.shadow_thickness; } if( LocalTabBox(tab) ) { /* * Now lets find out what size the TabBox wants to be. */ if( XmTabStack_tab_mode(tab) == XmTABS_STACKED || XmTabStack_tab_mode(tab) == XmTABS_STACKED_STATIC ) { XRectangle tab_rect; switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: case XmTABS_ON_BOTTOM: _XmTabBoxStackedGeometry(XmTabStack_tab_box(tab), width, &tab_rect); break; case XmTABS_ON_RIGHT: case XmTABS_ON_LEFT: _XmTabBoxStackedGeometry(XmTabStack_tab_box(tab), height, &tab_rect); break; } tab_wanted.width = tab_rect.width; tab_wanted.height = tab_rect.height; } else { XtQueryGeometry(XmTabStack_tab_box(tab), NULL, &tab_wanted); } /* * Now we need to look at the placement of the TabBox and * determine how we should merge its desired size in with the * size of the children. */ switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: case XmTABS_ON_BOTTOM: default: /* * For these cases we need to take the max of the width of the * children and the TabBox and then add the TabBox's height * to the children's. */ AssignMax(width, (int)tab_wanted.width); height += tab_wanted.height; break; case XmTABS_ON_RIGHT: case XmTABS_ON_LEFT: /* * For these cases we need to take the max of the height of the * children and the TabBox and then add the TabBox's width * to the children's. */ width += tab_wanted.width; AssignMax(height, (int)tab_wanted.height); break; } } /* * Lets first check the simple case. This is the case where the * caller is interested in the geometry that we would like to * be. */ if( request->request_mode == 0 ) { /* * Well it seems that the caller is just interested in the * size that we want to be, so lets stuff that away to our * return structure and send that back. */ allowed->width = width; allowed->height = height; /* * Before we give a result lets see if the geometry that * we would give back is our current geometry and if it is * we will return XtGeometryNo to indicate that we want to * stay the way we are. */ if( XmCompareXtWidgetGeometryToWidget(allowed, widget) ) { return( XtGeometryNo ); } return( XtGeometryYes ); } /* * If we got here that means that the caller wants to specify * either our width or height and see how we would react to such * a change. So lets what they want. */ have_width = ((request->request_mode & CWWidth) != 0); have_height = ((request->request_mode & CWHeight) != 0); if( have_width && have_height ) { /* * It seems that the caller wants to specify our with and * height. If this is the case then we want to tell them that * we prefer our desired geometry. */ allowed->width = width; allowed->height = height; if( XmCompareXtWidgetGeometryToWidget(allowed, widget) ) { return( XtGeometryNo ); } if( XmCompareXtWidgetGeometry(request, allowed) ) { return( XtGeometryYes ); } return( XtGeometryAlmost ); } /* * Finally the hard part. Here it seems that the caller wants to * freeze either our width or height and have us adjust the other * dimension. */ if( have_width ) { /* * Ok it seems that the caller wants to freeze our width so lets * find out what we can do about this. This case is only interesting * if the tabs are on the top or the bottom. Because if they are * on the sides this case diverts to the we want our preferred geomtry * case because we don't want to shrink our kids below their * preferred size and we don't want to shrink the tabs height. */ switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_RIGHT: case XmTABS_ON_LEFT: /* * This is the boring case and degrades to the "we want our * preferred geometry" case. */ allowed->width = width; allowed->height = height; break; case XmTABS_ON_TOP: case XmTABS_ON_BOTTOM: default: /* * Here is the interesting case. The uses has frozen our width * but not our height. Now as long as the width they specified * is greater than the width of the kids we are in business, else * we degrade to give me what I want. */ if( (int)request->width < kid_width ) { /* * The degraded case: "Give me what I want" */ allowed->width = width; allowed->height = height; } else { XtWidgetGeometry ask, got; /* * We actually get to have some fun now. What we now * do is ask the TabBox what it is willing to do * "heightwise" if we freeze its width. */ ask.request_mode = CWWidth; ask.width = request->width; got.request_mode = 0; switch( XtQueryGeometry(XmTabStack_tab_box(tab), &ask, &got) ) { case XtGeometryYes: case XtGeometryAlmost: default: if( !(got.request_mode & CWWidth) ) { got.width = tab_wanted.width; } if( !(got.request_mode & CWHeight) ) { got.height = tab_wanted.height; } /* * Now we have the height that the TabBox is willing * to take if we freeze its width so lets * store this information back into our return * structure. */ allowed->width = Max(kid_width, (int)got.width); allowed->height = kid_height + got.height; break; case XtGeometryNo: allowed->width = width; allowed->height = height; break; } } break; } } else if( have_height ) { /* * It seems that the caller want to freeze our height and see how * we react "widthwise". This case degrades to the default if * the tabs are on the right or left. */ switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: case XmTABS_ON_BOTTOM: default: allowed->width = width; allowed->height = height; break; case XmTABS_ON_RIGHT: case XmTABS_ON_LEFT: /* * First we will do a quick check to make sure that the height * they are asking about will fit all the children at least, and * if not we will reject it out of hand. */ if( (int)request->height < kid_height ) { allowed->width = width; allowed->height = height; } else { XtWidgetGeometry ask, got; /* * Now letws see how the TabBox reacts to the new size. */ ask.request_mode = CWHeight; ask.request_mode = request->height; got.request_mode = 0; switch( XtQueryGeometry(XmTabStack_tab_box(tab), &ask, &got) ) { case XtGeometryYes: case XtGeometryAlmost: default: if( !(got.request_mode & CWWidth) ) { got.width = tab_wanted.width; } if( !(got.request_mode & CWHeight) ) { got.height = tab_wanted.height; } /* * Now we have the info we need so lets stuff that back * into our return structure. */ allowed->width = kid_width + got.width; allowed->height = Max(kid_height, (int)got.height); break; case XtGeometryNo: allowed->width = width; allowed->height = height; break; } } break; } } if( XmCompareXtWidgetGeometryToWidget(allowed, widget) ) { return( XtGeometryNo ); } else if( XmCompareXtWidgetGeometry(request, allowed) ) { return( XtGeometryYes ); } return( XtGeometryNo ); } #if 0 #define XiReturn(i,r) \ printf("%d: RESULT: XtGeometry", i); \ switch( r ) \ { \ case XtGeometryYes: \ default: \ printf("Yes"); \ break; \ case XtGeometryNo: \ printf("No"); \ break; \ case XtGeometryAlmost: \ printf("Almost"); \ break; \ case XtGeometryDone: \ printf("Done"); \ break; \ } \ if( request->request_mode & XtCWQueryOnly ) printf("(QUERY)\n"); \ else printf("\n"); \ printf(" WIDGET: %s\n", XtName(widget)); \ printf(" X : "); \ if( allowed->request_mode & CWX ) printf("%d\n", allowed->x); \ else printf("N/A\n"); \ printf(" Y : "); \ if( allowed->request_mode & CWY ) printf("%d\n", allowed->y); \ else printf("N/A\n"); \ printf(" WIDTH : "); \ if( allowed->request_mode & CWWidth ) printf("%d\n", allowed->width); \ else printf("N/A\n"); \ printf(" HEIGHT : "); \ if( allowed->request_mode & CWHeight ) printf("%d\n", allowed->height); \ else printf("N/A\n"); \ printf(" BORDER : "); \ if( allowed->request_mode & CWBorderWidth ) \ printf("%d\n", allowed->border_width); \ else printf("N/A\n"); \ printf("\n"); \ return(r); #else #define XiReturn(i,r) return( r ) #endif static XtGeometryResult #ifndef _NO_PROTO GeometryNo(XmTabStackWidget tab, Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *allowed) #else GeometryNo(tab, widget, request, allowed) XmTabStackWidget tab; Widget widget; XtWidgetGeometry *request, *allowed; #endif { XRectangle box, kid; /* * If we are not dealing with the tab box child then we really want * to return No, so lets to that. */ if( widget != XmTabStack_tab_box(tab) ) { return( XtGeometryNo ); } /* * If we got here that means that we know we are dealing with our * tab box child, and we are about to deny a size request from that * child. The problem is that we do not want to do this. Actually * we want to resize the tab box child to fix in the space provided. */ PickSizes(tab, XtWidth(tab), XtHeight(tab), &box, &kid); allowed->request_mode = CWWidth | CWHeight; allowed->width = box.width; allowed->height = box.height; if( XmCompareXtWidgetGeometryToWidget(allowed, XmTabStack_tab_box(tab)) ) { return( XtGeometryNo ); } if( XmCompareXtWidgetGeometry(request, allowed) ) { if( !(request->request_mode & XtCWQueryOnly) ) { Resize((Widget)tab); if( XtIsRealized((Widget)tab) ) Redisplay((Widget)tab,NULL,False); } return( XtGeometryYes ); } return( XtGeometryAlmost ); } /* * Function: * GeometryManager(widget, request, allowed) * Description: * This function handles geometry requests. These requests are * sent from the children. * Input: * widget : Widget - the widget making the request. * request : XtWidgetGeometry* - the size the child wants * allowed : XtWidgetGeometry* - the size the child gets * Output: * XtGeometryResult - specifies information about the allowed geometry * result. */ static XtGeometryResult #ifndef _NO_PROTO GeometryManager(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *allowed) #else GeometryManager(widget, request, allowed) Widget widget; XtWidgetGeometry *request, *allowed; #endif { XmTabStackWidget tab = (XmTabStackWidget) XtParent(widget); int save_width, save_height, save_border; Dimension child_save_width, child_save_height; XtWidgetGeometry want, got; XRectangle box, kids; #if 0 printf("REQUEST: "); if( request->request_mode & XtCWQueryOnly ) printf("QUERY"); printf("\n"); printf(" WIDGET: %s\n", XtName(widget)); printf(" X : "); if( request->request_mode & CWX ) printf("%d\n", request->x); else printf("N/A\n"); printf(" Y : "); if( request->request_mode & CWY ) printf("%d\n", request->y); else printf("N/A\n"); printf(" WIDTH : "); if( request->request_mode & CWWidth ) printf("%d\n", request->width); else printf("N/A\n"); printf(" HEIGHT : "); if( request->request_mode & CWHeight ) printf("%d\n", request->height); else printf("N/A\n"); printf(" BORDER : "); if( request->request_mode & CWBorderWidth ) printf("%d\n", request->border_width); else printf("N/A\n"); printf("\n"); #endif if( XmTabStack__set_tab_list(tab) && (request->request_mode & CWBorderWidth) ) { XmTabStack__set_tab_list(tab) = False; XtVaSetValues(XmTabStack_tab_box(tab), XmNtabList, XmTabStack__tab_list(tab), NULL); #ifdef TEAR_OFF_TABS BuildMenu(tab); #endif XiReturn( 1, XtGeometryNo ); } *allowed = *request; /* * Ok playing with geometry is real easy. This is because we only * let our children change their dimensions and not their location. * So if the caller wants to muck with their X or Y we ignore it. * * Also stacking order does not matter because only one child is * visible at a time. */ allowed->request_mode &= ~(CWX | CWY | CWStackMode | CWSibling); /* * If the child wants does not want to change its dimensions (width, * height or border width) then we are done. */ if( !(allowed->request_mode & (CWWidth | CWHeight | CWBorderWidth)) ) { /* * It turns out that we have weeded out everything from their * request which means that we are not excepting any of their * changes and we can just return XtGeometryNo. */ XiReturn( 2, XtGeometryNo ); } /* * Lets find out what size we want to be if we accept this kids * request. */ save_width = XtWidth(widget); save_height = XtHeight(widget); save_border = widget->core.border_width; if( allowed->request_mode & CWWidth ) { widget->core.width = allowed->width; XmTabStackC_width(widget) = allowed->width; } if( allowed->request_mode & CWHeight ) { widget->core.height = allowed->height; XmTabStackC_height(widget) = allowed->height; } if( allowed->request_mode & CWBorderWidth ) { widget->core.border_width = allowed->border_width; } child_save_width = widget->core.width; child_save_height = widget->core.height; want.request_mode = 0; QueryGeometry((Widget)tab, &want, &got); widget->core.width = save_width; widget->core.height = save_height; widget->core.border_width = save_border; XmTabStackC_width(widget) = save_width; XmTabStackC_height(widget) = save_height; /* * Lets store away the width and height we want. */ save_width = XtWidth(tab); save_height = XtHeight(tab); if( got.request_mode & CWWidth ) { save_width = got.width; } if( got.request_mode & CWHeight ) { save_height = got.height; } /* * Lets first check to see if we can satify this request without * changing our size and if so we will just return yes. We will * also use this chance to check our resize policy. */ #ifdef DKB if( save_width == XtWidth(tab) && save_height == XtHeight(tab) ) { /* * We can satify this request without changing our size so * lets retrun XtGeometryNo, to let the kid know it should * stay the same size. */ XiReturn( 3, GeometryNo(tab, widget, request, allowed) ); } #endif /* * If we got here that means that the our child wants us to change * our size, so lets see if our resize polify will allow this * chnage. */ if( BBPart(tab).resize_policy == XmRESIZE_NONE || (BBPart(tab).resize_policy == XmRESIZE_GROW && (save_width < (int)XtWidth(tab) ||save_height < (int)XtHeight(tab))) ) { /* * Well we cannot allow this change so what we want is our child * to stay the same size it is, so lets return XtGeometryNo. */ XiReturn( 4, GeometryNo(tab, widget, request, allowed) ); } /* * Now we know what size we want to be if we accept this kids request * so now lets if we can be this size. */ want.request_mode = CWWidth | CWHeight | XtCWQueryOnly; want.width = save_width; want.height = save_height; switch( XtMakeGeometryRequest((Widget)tab, &want, &got) ) { case XtGeometryYes: default: /* * Well our parent said yes, so we can accept the request from * our kid, so what we will do is now check if they really want * us to do it or if this was a query. */ if( (request->request_mode & XtCWQueryOnly) == 0 ) { /* * This was not a query so we now really want to make the * request to our parent. We don't care about the return * value from this call because the parent already said that * they would accept this. */ XtMakeResizeRequest((Widget)tab, save_width, save_height, NULL, NULL); XmTabStackC_width(widget) = child_save_width; XmTabStackC_height(widget) = child_save_height; Resize((Widget)tab); if( XtIsRealized((Widget)tab) ) Redisplay((Widget)tab,NULL,False); } XiReturn( 5, XtGeometryYes ); case XtGeometryNo: /* * Our parent said no, so we must also say no. */ XiReturn( 6, GeometryNo(tab, widget, request, allowed) ); case XtGeometryAlmost: /* * Out parent said almost, so we need to figure out how this * affects our children, i.e. what is our children's dimensions * with this change. */ break; case XtGeometryDone: XmTabStackC_width(widget) = child_save_width; XmTabStackC_height(widget) = child_save_height; XiReturn( 99, XtGeometryDone ); break; } /* * This is the almost case. To get here we have had to ask our parent for * a size change, and our parent said we could not be the size that * we want to be, but we could be a "close" size. So what we have to * do is figure out how this affects our children and return the * proper response. */ /* * First lets see if we can allow the size change that our parent * has said OK to. This means that we have fake a layout to find * out what size our tabbox and children will be. */ if( BBPart(tab).resize_policy == XmRESIZE_GROW && (got.width < XtWidth(tab) || got.height < XtHeight(tab)) ) { /* * It turns out that our resize policy want allow us to make * this compromise so lets just return no. */ XiReturn( 7, GeometryNo(tab, widget, request, allowed) ); } /* * Ok we could accept this compromise, so lets see how it effects * the size of our kids. */ PickSizes(tab, got.width, got.height, &box, &kids); allowed->request_mode |= (CWWidth | CWHeight); if( widget == XmTabStack_tab_box(tab) ) { /* * In this case we are dealing with our tab box child, so * lets set the almost result to size we picked. */ allowed->width = box.width; allowed->height = box.height; } else { /* * In this case we are dealing with our children, so lets * set the almost return value. */ allowed->width = kids.width; allowed->height = kids.height; } XiReturn( 8, XtGeometryAlmost ); } static void #ifndef _NO_PROTO ChangeManaged(Widget widget) #else ChangeManaged(widget) Widget widget; #endif { XmTabStackWidget tab = (XmTabStackWidget) widget; WidgetList kid; Widget active; int idx = 0; Cardinal i; XmTabbedStackList tl = NULL; XmTabAttributeRec attr; XtWidgetGeometry request, geom; XmString xmstr; Boolean changed_size = False; Boolean select_new_kid = False; if( !XmTabStack__inited(tab) ) return; /* * Lets first find out if our active child is still managed, and * if it is not then lets NULLify our active child. */ if( XmTabStack__active_child(tab) != NULL && !XtIsManaged(XmTabStack__active_child(tab)) ) { XmTabStack__active_child(tab) = (Widget) NULL; } /* * If we do not have an active child then lets find the first * managed child and make it active. We will walk the whole list * of children and make sure that the active child is the only * child that is visible. */ for( i = 0, kid = tab->composite.children; i < tab->composite.num_children; ++i, ++kid ) { if( IsTabBox(tab, *kid) ) continue; if( !XtIsManaged(*kid) ) { /* * If this child is not managed then lets zero out * the widgets managed width and height so that * when it becomes managed again we will grab the * new managed width/height. */ XmTabStackC_width(*kid) = 0; XmTabStackC_height(*kid) = 0; XmTabStackC_index(*kid) = -1; continue; } XmTabStackC_index(*kid) = idx++; if( XmTabStack__active_child(tab) == NULL ) { select_new_kid = True; XmTabStack__active_child(tab) = *kid; } /* * Now that we know that we are dealing with a managed child * lets add them to the tab list we are building up to * pass off to the TabBox. */ if( tl == NULL ) { tl = XmTabbedStackListCreate(); } if( XmTabStackC_tab_label_string(*kid) == NULL ) { xmstr = attr.label_string = XmStringCreateLocalized(XtName(*kid)); attr.value_mode = XmTAB_VALUE_COPY; } else { xmstr = NULL; attr.label_string = XmTabStackC_tab_label_string(*kid); attr.value_mode = XmTAB_VALUE_SHARE; } attr.string_direction = XmTabStackC_tab_string_direction(*kid); attr.label_pixmap = XmTabStackC_tab_label_pixmap(*kid); attr.label_alignment = XmTabStackC_tab_alignment(*kid); attr.pixmap_placement = XmTabStackC_tab_pixmap_placement(*kid); attr.foreground = XmTabStackC_tab_foreground(*kid); attr.background = XmTabStackC_tab_background(*kid); attr.background_pixmap = XmTabStackC_tab_background_pixmap(*kid); attr.sensitive = XtIsSensitive(*kid); XmTabbedStackListAppend(tl, XmTAB_ALL_FLAGS, &attr); if( xmstr != NULL ) XmStringFree(xmstr); /* * Next lets check if this kid has its managed width and * height set and if not lets set it. */ if( XmTabStackC_width(*kid) == 0 ) { XmTabStackC_width(*kid) = XtWidth(*kid); XmTabStackC_height(*kid) = XtHeight(*kid); } } if( (active = XmTabStack__active_child(tab)) != NULL ) { XtVaSetValues(XmTabStack_tab_box(tab), XmNtabList, tl, XmNselectedIndex, XmTabStackC_index(active), XmNtraversalIndex, XmTabStackC_index(active), NULL); } else { XtVaSetValues(XmTabStack_tab_box(tab), XmNtabList, tl, NULL); } if( XmTabStack__tab_list(tab) != NULL ) { XmTabbedStackListFree(XmTabStack__tab_list(tab)); } XmTabStack__tab_list(tab) = tl; #ifdef TEAR_OFF_TABS BuildMenu(tab); #endif /* * Now lets see how this new kid affects our geometry and request * a new size. */ request.request_mode = 0; QueryGeometry((Widget)tab, &request, &geom); /* * Now that we know the size that we want to be lets see if we are * that size and if not lets request a new size. But before we do this * lets check our resize policy to see if we want to change size. */ if( (geom.width != XtWidth(tab) || geom.height != XtHeight(tab)) && BBPart(tab).resize_policy != XmRESIZE_NONE ) { Dimension width, height; if( BBPart(tab).resize_policy != XmRESIZE_GROW || (geom.width >= XtWidth(tab) && geom.height >= XtHeight(tab)) ) { switch( XtMakeResizeRequest((Widget)tab, geom.width, geom.height, &width, &height) ) { case XtGeometryYes: changed_size = True; case XtGeometryNo: default: break; case XtGeometryAlmost: /* * Our parent gave us an alternate suggestion so lets do what * mom or dad says and take it. */ if( BBPart(tab).resize_policy != XmRESIZE_GROW || (width >= XtWidth(tab) && height >= XtHeight(tab)) ) { XtMakeResizeRequest((Widget)tab, width, height, NULL, NULL); changed_size = True; } break; } } } Resize((Widget)tab); if( !changed_size && XtIsRealized((Widget)tab) ) { Redisplay((Widget)tab, NULL, False); } /* * If new tab is selected as a result of a manage set changed, then notify * the next tab stack widget through callbacks that it is now selected... */ if (select_new_kid) { XmTabStackCallbackStruct cbdata; cbdata.reason = XmCR_TAB_SELECTED; cbdata.event = NULL; cbdata.selected_child = XmTabStack__active_child(tab); XtCallCallbackList((Widget)tab, XmTabStack_tab_select_callback(tab), (XtPointer) &cbdata); } } /* ARGSUSED */ static void #ifndef _NO_PROTO ConstraintInitialize(Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) #else ConstraintInitialize(request, set, arg_list, arg_cnt) Widget request, set; ArgList arg_list; Cardinal *arg_cnt; #endif { XmTabStackWidget tab = (XmTabStackWidget) XtParent(set); if( XmTabStackC_tab_label_string(set) != NULL ) { XmTabStackC_tab_label_string(set) = XmStringCopy(XmTabStackC_tab_label_string(set)); } if( XmTabStackC_tab_string_direction(set) == XmSTRING_DIRECTION_DEFAULT ) { XmTabStackC_tab_string_direction(set) = tab->manager.string_direction; } XmTabStackC_width(set) = 0; XmTabStackC_height(set) = 0; XmTabStackC_index(set) = -1; } static void #ifndef _NO_PROTO ConstraintDestroy(Widget widget) #else ConstraintDestroy(widget) Widget widget; #endif { if( XmTabStackC_tab_label_string(widget) != NULL ) { XmStringFree(XmTabStackC_tab_label_string(widget)); } if( XmTabStackC_free_tab_pixmap(widget) && ValidPixmap(XmTabStackC_tab_label_pixmap(widget)) ) { XFreePixmap(XtDisplay(widget), XmTabStackC_tab_label_pixmap(widget)); } } #define cfield(f) (XmTabStackC_##f(current)) #define rfield(f) (XmTabStackC_##f(request)) #define sfield(f) (XmTabStackC_##f(set)) /* ARGSUSED */ static Boolean #ifndef _NO_PROTO ConstraintSetValues(Widget current, Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) #else ConstraintSetValues(current, request, set, arg_list, arg_cnt) Widget current, request, set; ArgList arg_list; Cardinal *arg_cnt; #endif { XmTabStackWidget tab = (XmTabStackWidget) XtParent(set); XmTabAttributeRec attr; WidgetList kid; Cardinal i; /* * If any of the following have changed that means we need to * build a new TabList and send it to our child. */ if( cfield(tab_label_string) != sfield(tab_label_string) || cfield(tab_alignment) != sfield(tab_alignment) || cfield(tab_string_direction ) != sfield(tab_string_direction) || cfield(tab_label_pixmap ) != sfield(tab_label_pixmap) || cfield(tab_pixmap_placement ) != sfield(tab_pixmap_placement) || cfield(tab_background ) != sfield(tab_background) || cfield(tab_background_pixmap) != sfield(tab_background_pixmap) || cfield(tab_foreground ) != sfield(tab_foreground) || XtIsSensitive(current) != XtIsSensitive(set) ) { XmTabbedStackList tl = NULL; XmString xmstr; if( cfield(tab_label_string) != sfield(tab_label_string) ) { if( cfield(tab_label_string) != NULL ) { XmStringFree(cfield(tab_label_string)); } sfield(tab_label_string) = XmStringCopy(sfield(tab_label_string)); } for( i = 0, kid = tab->composite.children; i < tab->composite.num_children; ++i, ++kid ) { if( !IsValidChild(tab, *kid) ) continue; if( tl == NULL ) tl = XmTabbedStackListCreate(); if( XmTabStackC_tab_label_string(*kid) == NULL ) { xmstr = attr.label_string = XmStringCreateLocalized(XtName(*kid)); attr.value_mode = XmTAB_VALUE_COPY; } else { xmstr = NULL; attr.label_string = XmTabStackC_tab_label_string(*kid); attr.value_mode = XmTAB_VALUE_SHARE; } attr.string_direction = XmTabStackC_tab_string_direction(*kid); attr.label_pixmap = XmTabStackC_tab_label_pixmap(*kid); attr.label_alignment = XmTabStackC_tab_alignment(*kid); attr.pixmap_placement = XmTabStackC_tab_pixmap_placement(*kid); attr.foreground = XmTabStackC_tab_foreground(*kid); attr.background = XmTabStackC_tab_background(*kid); attr.background_pixmap = XmTabStackC_tab_background_pixmap(*kid); attr.sensitive = XtIsSensitive(*kid); XmTabbedStackListAppend(tl, XmTAB_ALL_FLAGS, &attr); if( xmstr != NULL ) XmStringFree(xmstr); } if( XmTabStack__tab_list(tab) != NULL ) { XmTabbedStackListFree(XmTabStack__tab_list(tab)); } XmTabStack__tab_list(tab) = tl; if( XtIsManaged(set) && XtIsRealized(set) ) { set->core.border_width++; XmTabStack__set_tab_list(tab) = True; } } /* * If the background color for our tab changes and this is the * active tab then we need cause a refresh to happen in the stack. */ if( (cfield(tab_background ) != sfield(tab_background) || cfield(tab_background_pixmap) != sfield(tab_background_pixmap)) && XtIsRealized((Widget)tab) ) { XClearArea(XtDisplay(tab), XtWindow(tab), 0, 0, 0, 0, True); } return( False ); } #undef cfield #undef rfield #undef sfield #define XiCvtDone(type, value) \ { \ if( to->addr != NULL ) \ { \ if( to->size < sizeof(type) ) \ { \ to->size = sizeof(type); \ return( False ); \ } \ *(type*)(to->addr) = (value); \ } \ else \ { \ static type static_val; \ static_val = (value); \ to->addr = (XtPointer) &static_val; \ } \ to->size = sizeof(type); \ return( True ); \ } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToXiPixel(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToXiPixel(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static Pixel result = XmCOLOR_DYNAMIC; String str = (String) from->addr; Widget widget; widget = *((Widget*) arg_list[0].addr); if( XmCompareISOLatin1(str, "color_dynamic") == 0 || XmCompareISOLatin1(str, "dynamic") == 0 ) { XiCvtDone(Pixel, result); } return( XtConvertAndStore(widget, XmRString, from, XmRPixel, to) ); } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToXiPixmap(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToXiPixmap(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static Pixmap result = XmPIXMAP_DYNAMIC; String str = (String) from->addr; Widget widget; widget = *((Widget*) arg_list[0].addr); if( XmCompareISOLatin1(str, "pixmap_dynamic") == 0 || XmCompareISOLatin1(str, "dynamic") == 0 ) { XiCvtDone(Pixel, result); } return( XtConvertAndStore(widget, XmRString, from, XmRPrimForegroundPixmap, to) ); } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToXmTabSide(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToXmTabSide(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static int result = XmTABS_ON_TOP; String str = (String) (from->addr); if( XmCompareISOLatin1(str, "TOP") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_TOP") == 0 ) { result = XmTABS_ON_TOP; } else if( XmCompareISOLatin1(str, "BOTTOM") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_BOTTOM") == 0 ) { result = XmTABS_ON_BOTTOM; } else if( XmCompareISOLatin1(str, "LEFT") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_LEFT") == 0 ) { result = XmTABS_ON_LEFT; } else if( XmCompareISOLatin1(str, "RIGHT") == 0 || XmCompareISOLatin1(str, "XmTABS_ON_RIGHT") == 0 ) { result = XmTABS_ON_RIGHT; } else { XtDisplayStringConversionWarning(dpy, str, XmRXmTabSide); return( False ); } XiCvtDone(int, result); } /* ARGSUSED */ static Boolean #ifndef _NO_PROTO CvtStringToXmPixmapPlacement(Display *dpy, XrmValue *arg_list, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer *data) #else CvtStringToXmPixmapPlacement(dpy, arg_list, arg_cnt, from, to, data) Display *dpy; XrmValue *arg_list; Cardinal *arg_cnt; XrmValue *from, *to; XtPointer *data; #endif { static XmPixmapPlacement result = XmPIXMAP_RIGHT; String str = (String) (from->addr); if( XmCompareISOLatin1(str, "TOP") == 0 || XmCompareISOLatin1(str, "XmPIXMAP_TOP") == 0 ) { result = XmPIXMAP_TOP; } else if( XmCompareISOLatin1(str, "BOTTOM") == 0 || XmCompareISOLatin1(str, "XmPIXMAP_BOTTOM") == 0 ) { result = XmPIXMAP_BOTTOM; } else if( XmCompareISOLatin1(str, "RIGHT") == 0 || XmCompareISOLatin1(str, "XmPIXMAP_RIGHT") == 0 ) { result = XmPIXMAP_RIGHT; } else if( XmCompareISOLatin1(str, "LEFT") == 0 || XmCompareISOLatin1(str, "XmPIXMAP_LEFT") == 0 ) { result = XmPIXMAP_LEFT; } else if( XmCompareISOLatin1(str, "NONE") == 0 || XmCompareISOLatin1(str, "XmPIXMAP_NONE") == 0 ) { result = XmPIXMAP_NONE; } else if( XmCompareISOLatin1(str, "ONLY") == 0 || XmCompareISOLatin1(str, "XmPIXMAP_ONLY") == 0 ) { result = XmPIXMAP_ONLY; } else { XtDisplayStringConversionWarning(dpy, str, XmRXmPixmapPlacement); return( False ); } XiCvtDone(XmPixmapPlacement, result); } static void #ifndef _NO_PROTO DrawShadows(XmTabStackWidget tab, GC top_GC, GC bottom_GC, int x, int y, int width, int height) #else DrawShadows(tab, top_GC, bottom_GC, x, y, width, height) XmTabStackWidget tab; GC top_GC, bottom_GC; int x, y, width, height; #endif { XRectangle top_rects[2], bottom_rects[2]; XPoint bevel; int num_top_rects = 0, num_bottom_rects = 0, shadow = tab->manager.shadow_thickness; /* * The only bit of redisplaying that we really have to do is draw * the three sides of the shadow that the XmTabBox does not draw. */ switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: default: top_rects[0].x = x; top_rects[0].y = y; top_rects[0].width = shadow; top_rects[0].height = height; num_top_rects = 1; bottom_rects[0].x = x; bottom_rects[0].y = y + height - shadow; bottom_rects[0].width = width; bottom_rects[0].height = shadow; bottom_rects[1].x = x + width - shadow; bottom_rects[1].y = y; bottom_rects[1].width = shadow; bottom_rects[1].height = height; num_bottom_rects = 2; bevel.x = x; bevel.y = y + height - shadow; break; case XmTABS_ON_BOTTOM: top_rects[0].x = x; top_rects[0].y = y; top_rects[0].width = shadow; top_rects[0].height = height; top_rects[1].x = x; top_rects[1].y = y; top_rects[1].width = width; top_rects[1].height = shadow; num_top_rects = 2; bottom_rects[0].x = x + width - shadow; bottom_rects[0].y = y; bottom_rects[0].width = shadow; bottom_rects[0].height = height; num_bottom_rects = 1; bevel.x = x + width - shadow; bevel.y = y; break; case XmTABS_ON_LEFT: top_rects[0].x = x; top_rects[0].y = y; top_rects[0].width = width; top_rects[0].height = shadow; num_top_rects = 1; bottom_rects[0].x = x; bottom_rects[0].y = y + height - shadow; bottom_rects[0].width = width; bottom_rects[0].height = shadow; bottom_rects[1].x = x + width - shadow; bottom_rects[1].y = y; bottom_rects[1].width = shadow; bottom_rects[1].height = height; num_bottom_rects = 2; bevel.x = x + width - shadow; bevel.y = y; break; case XmTABS_ON_RIGHT: top_rects[0].x = x; top_rects[0].y = y; top_rects[0].width = shadow; top_rects[0].height = height; top_rects[1].x = x; top_rects[1].y = y; top_rects[1].width = width; top_rects[1].height = shadow; num_top_rects = 2; bottom_rects[0].x = x; bottom_rects[0].y = y + height - shadow; bottom_rects[0].width = width; bottom_rects[0].height = shadow; num_bottom_rects = 1; bevel.x = x; bevel.y = y + height - shadow; break; } XFillRectangles(XtDisplay(tab), XtWindow(tab), top_GC, top_rects, num_top_rects); XFillRectangles(XtDisplay(tab), XtWindow(tab), bottom_GC, bottom_rects, num_bottom_rects); XmDrawBevel(XtDisplay(tab), XtWindow(tab), top_GC, bottom_GC, bevel.x, bevel.y, shadow, XmBEVEL_BOTH); } static void #ifndef _NO_PROTO PickSizes(XmTabStackWidget tab, int tab_width, int tab_height, XRectangle *box, XRectangle *kid) #else PickSizes(tab, tab_width, tab_height, box, kid) XmTabStackWidget tab; int tab_width, tab_height; XRectangle *box, *kid; #endif { int max, width, height, row_width, offset = 0, num_rows, num_cols; XtWidgetGeometry ask, got; Boolean stacked = False; /* * The first thing that we need to do is find out how much space we * will have for our children. This is the space that is not * taken up by our XmTabBox Child. We give first priority to the * XmTabBoxChild. */ switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: case XmTABS_ON_BOTTOM: default: /* * For this case the amount of width is fixed so we want to know, * given a fixed width what height are you interested in. */ ask.request_mode = CWWidth | CWHeight; ask.width = tab_width; ask.height = 0; XtQueryGeometry(XmTabStack_tab_box(tab), &ask, &got); /* * Now that we have a response back from the kid we need to make * sure that the height it wants is not larger than we can * accomidate. If it is then we will scale it down. */ max = tab_height - 2 * BBPart(tab).margin_height - tab->manager.shadow_thickness; if( (int)got.height > max ) got.height = max; width = tab_width - 2 * ((int)BBPart(tab).margin_width+ (int)tab->manager.shadow_thickness); height = max - (int)got.height; AssignMax(width, 1); AssignMax(height, 1); break; case XmTABS_ON_RIGHT: case XmTABS_ON_LEFT: /* * For this case the amount of height is fixed so we want to know, * given a fixed height what width are you interested in. */ ask.request_mode = CWWidth | CWHeight; ask.width = 0; ask.height = tab_height; XtQueryGeometry(XmTabStack_tab_box(tab), &ask, &got); /* * Now that we have a response back from the kid we need to make * sure that the width it wants is not larger than we can * accomidate. If it is then we will scale it down. */ max = tab_width - 2 * BBPart(tab).margin_width - tab->manager.shadow_thickness; if( (int)got.width > max ) got.height = max; height = tab_height - 2 * ((int)BBPart(tab).margin_height + (int)tab->manager.shadow_thickness); width = max - (int)got.width; AssignMax(width, 1); AssignMax(height, 1); break; } if( XmTabStack_stacked_effect(tab) && (XmTabStack_tab_mode(tab) == XmTABS_STACKED || XmTabStack_tab_mode(tab) == XmTABS_STACKED_STATIC) ) { Dimension doffset; stacked = True; XtVaGetValues(XmTabStack_tab_box(tab), XmNtabOffset, &doffset, NULL); offset = doffset; } /* * Now that we know the size of the XmTabBox we can now layout it and * our other children. We will start out with the XmTabBox. */ switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: default: box->x = 0; box->y = 0; box->width = tab_width; box->height = got.height; kid->x = BBPart(tab).margin_width + tab->manager.shadow_thickness; kid->y = got.height + BBPart(tab).margin_height; break; case XmTABS_ON_BOTTOM: box->x = 0; box->y = tab_height - (int)got.height; box->width = tab_width; box->height = got.height; kid->x = BBPart(tab).margin_width + tab->manager.shadow_thickness; kid->y = BBPart(tab).margin_height + tab->manager.shadow_thickness; break; case XmTABS_ON_LEFT: box->x = 0; box->y = 0; box->width = got.width; box->height = tab_height; kid->x = got.width + BBPart(tab).margin_height; kid->y = BBPart(tab).margin_height + tab->manager.shadow_thickness; break; case XmTABS_ON_RIGHT: box->x = tab_width - (int)got.width; box->y = 0; box->width = got.width; box->height = tab_height; kid->x = BBPart(tab).margin_width + tab->manager.shadow_thickness; kid->y = BBPart(tab).margin_height + tab->manager.shadow_thickness; break; } /* * If we are doing a stacked layout we need to change the size of * our children to make room for some special effects. "Hey, Special * Effects ..." */ if( stacked ) { /* * What we need to do is make the size of our child, the size of * a row of tabs minus the shadows. */ switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: case XmTABS_ON_BOTTOM: default: _XmTabBoxGetNumRowsColumns(XmTabStack_tab_box(tab), tab_width, &num_rows, &num_cols); if( num_rows <= 1 || num_cols < 1 ) { width = tab_width - 2 * (BBPart(tab).margin_width + tab->manager.shadow_thickness); } else { int tmp; if (LayoutIsRtoL(tab)) kid->x += offset * (num_rows-1); tmp = (((int)tab_width) - ((num_rows-1) * offset))/ num_cols; row_width = num_cols * tmp; width = row_width - 2 * (BBPart(tab).margin_width + tab->manager.shadow_thickness); } break; case XmTABS_ON_LEFT: case XmTABS_ON_RIGHT: _XmTabBoxGetNumRowsColumns(XmTabStack_tab_box(tab), tab_height, &num_rows, &num_cols); if( num_rows <= 1 || num_cols < 1 ) { height = tab_height - 2 * (BBPart(tab).margin_height + tab->manager.shadow_thickness); } else { int tmp = (((int)tab_height) - ((num_rows-1) * offset))/ num_cols; row_width = num_cols * tmp; height = row_width - 2 * (BBPart(tab).margin_height + tab->manager.shadow_thickness); } break; } } kid->width = width; kid->height = height; } static void #ifndef _NO_PROTO Layout(XmTabStackWidget tab) #else Layout(tab) XmTabStackWidget tab; #endif { XRectangle box, child; WidgetList kid; int i, neg_x; /* * Lets start by finding out what size everything should be. */ PickSizes(tab, XtWidth(tab), XtHeight(tab), &box, &child); /* * Now that we know the sizes lets start by placing the tab box. */ if( LocalTabBox(tab) ) { _XmConfigureWidget(XmTabStack_tab_box(tab), box.x, box.y, box.width, box.height, 0); } /* * ... And now place the kiddies. */ for( i = 0, kid = tab->composite.children; i < tab->composite.num_children; ++i, ++kid ) { if( *kid == XmTabStack_tab_box(tab) || !XtIsManaged(*kid) ) continue; if( XmTabStack__active_child(tab) == *kid ) { _XmConfigureWidget(*kid, child.x, child.y, child.width, child.height, (*kid)->core.border_width); } else { neg_x = -((int)child.width) - 2 * (int)((*kid)->core.border_width); _XmConfigureWidget(*kid, (Position)neg_x, child.y, child.width, child.height, (*kid)->core.border_width); } } } /* * Function: * TabSelectedCallback(widget, client, cbdata) * Description: * This callback is activated when the user selects a tab. This * callback brings the active child to the front and hides the * old active child. * Input: * widget : Widget - the XmTabBox Widget * client : XtPointer - unused * cbdata : XtPointer - the callback data from the XmTabBox * Output: * None. */ /* ARGSUSED */ static void #ifndef _NO_PROTO TabSelectedCallback(Widget widget, XtPointer client, XtPointer cbdata) #else TabSelectedCallback(widget, client, cbdata) Widget widget; XtPointer client, cbdata; #endif { XmTabBoxCallbackStruct *info = (XmTabBoxCallbackStruct*) cbdata; XmTabStackWidget tab = (XmTabStackWidget) XtParent(widget); XmTabStackCallbackStruct data; WidgetList kid = tab->composite.children; Widget old, active = NULL; Cardinal i, idx = 0; int neg_x, x, y, width, height; /* * It seems that a tab has been selected so we need to swap our * active widgets. Lets start by grabbing a pointer to our soon * to be active widget. To do this we have to walk our child list * and find our info->tab_index managed widget. */ for( i = 0; i < tab->composite.num_children; ++i, ++kid ) { if( !XtIsManaged(*kid) || IsTabBox(tab, *kid) ) continue; if( idx == info->tab_index ) { active = *kid; break; } idx++; } /* * Lets do a quick check here to make sure we found something. If not * something is probably seriously wrong so we will just bail. */ if( active == NULL ) { return; } old = XmTabStack__active_child(tab); /* * We know that our new active widget is going to be placed at the * same location and of the same dimensions as our currently active * child so lets more the new active child to those coords. */ _XmConfigureWidget(active, old->core.x, old->core.y, XtWidth(old), XtHeight(old), active->core.border_width); neg_x = -((int)XtWidth(old)) - 2 * (int)((*kid)->core.border_width); _XmMoveWidget(old, (Position)neg_x, old->core.y); /* * Now lets set the active child. */ XmTabStack__active_child(tab) = active; x = active->core.x - BBPart(tab).margin_width; y = active->core.y - BBPart(tab).margin_height; width = XtWidth(active) + (2 * BBPart(tab).margin_width); height = XtHeight(active) + (2 * BBPart(tab).margin_height); /* * Now if the active child has a background specified, or if the old * active child had one, then we need to redraw our background. */ if( XiBackgroundSpecified(old) || XiBackgroundSpecified(active) || XiSelectSpecified(tab) ) { if( XiSelectSpecified(tab) ) { SetSelectGC(tab, XmTabStack__gc(tab)); XFillRectangle(XtDisplay(tab), XtWindow(tab), XmTabStack__gc(tab), x, y, width, height); } else if( XiBackgroundSpecified(active) ) { SetChildGC(active, XmTabStack__gc(tab)); XFillRectangle(XtDisplay(tab), XtWindow(tab), XmTabStack__gc(tab), x, y, width, height); } else { XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.background_GC, x, y, width, height); } } /* * Now, if we are stacked, lets check to see if are old child * and our newly selected child are on the same row, and if * not, and we are not a perfect square (all rows and columns filled) * then we need to redraw our stacked shadows. */ if( ((XmTabStack_tab_mode(tab) == XmTABS_STACKED || XmTabStack_tab_mode(tab) == XmTABS_STACKED_STATIC) && XmTabStack_stacked_effect(tab)) && (info->old_index >= 0 && info->tab_index >= 0 && XmTabBoxGetTabRow(XmTabStack_tab_box(tab), info->old_index) != XmTabBoxGetTabRow(XmTabStack_tab_box(tab), info->tab_index)) ) { DrawStackedShadows(tab, tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, 0, 0, XtWidth(active) + (2 * BBPart(tab).margin_width), XtHeight(active) + (2 * BBPart(tab).margin_height)); } /* * And finally lets call the select callback for the XmTabStack * so that the user knows something has changed. */ if (XmTabStack_do_notify(tab)) { data.reason = XmCR_TAB_SELECTED; data.event = info->event; data.selected_child = active; XtCallCallbackList((Widget)tab, XmTabStack_tab_select_callback(tab), (XtPointer)&data); } } /* * XmRCallProc routine for checking font_list before setting it to NULL * If "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offs, XrmValue *value) { XmTabStackWidget lw = (XmTabStackWidget)wid; /* Check if been here before */ if (lw->tab_stack.check_set_render_table) value->addr = NULL; else { lw->tab_stack.check_set_render_table = True; value->addr = (char*)&(lw->tab_stack.font_list); } } #ifdef UNUSED_FUNCTION /* ARGSUSED */ static Widget #ifndef _NO_PROTO IndexToTab(XmTabStackWidget tab, int idx) #else IndexToTab(tab, idx) XmTabStackWidget tab; int idx; #endif { WidgetList kid = tab->composite.children; int i; if( tab == NULL || idx < 0 ) return( (Widget)NULL ); for( i = 0; kid != NULL; kid++ ) { if( !IsValidChild(tab, *kid) ) continue; if( i == idx ) { return( *kid ); } ++i; } return( (Widget)NULL ); } #endif static int #ifndef _NO_PROTO TabToIndex(XmTabStackWidget tab, Widget child) #else TabToIndex(tab, child) XmTabStackWidget tab; Widget child; #endif { WidgetList kid; int i; if( tab == NULL || child == NULL ) return( -1 ); kid = tab->composite.children; for( i = 0; kid != NULL; kid++ ) { if( !IsValidChild(tab, *kid) ) continue; if( *kid == child ) return( i ); ++i; } return( -1 ); } Widget #ifndef _NO_PROTO XmCreateTabStack(Widget parent, String name, ArgList arg_list, Cardinal arg_cnt) #else XmCreateTabStack(parent, name, arg_list, arg_cnt) Widget parent; String name; ArgList arg_list; Cardinal arg_cnt; #endif { return( XtCreateWidget(name, xmTabStackWidgetClass, parent, arg_list, arg_cnt) ); } Widget XmVaCreateTabStack( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmTabStackWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedTabStack( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmTabStackWidgetClass, parent, True, var, count); va_end(var); return w; } void #ifndef _NO_PROTO XmTabStackSelectTab(Widget widget, Boolean notify) #else XmTabStackSelectTab(widget, notify) Widget widget; Boolean notify; #endif { XmTabStackWidget tab = (XmTabStackWidget) XtParent(widget); _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmIsTabStack((Widget)tab)) { _XmAppUnlock(app); return; } if (!XtIsRealized((Widget)tab)) { /* wherehouse the selected widget id to use later in realize proc */ XmTabStack__selected_tab(tab) = widget; XmTabStack__selected_notify(tab) = notify; } else { /* * _XmTabBoxSelectTab will call our internal callback routine, * TabSelectedCallback() which in turn calls the XmNtabSelectedCallback * callbacks if the "do_notify" flag is set... The do_notify flag is * normally TRUE, but can be switched off through this interface. */ XmTabStack_do_notify(tab) = notify; _XmTabBoxSelectTab(XmTabStack_tab_box(tab), TabToIndex(tab, widget)); XmTabStack_do_notify(tab) = True; } _XmAppUnlock(app); } static void #ifndef _NO_PROTO DrawStackedShadows(XmTabStackWidget tab, GC top_GC, GC bottom_GC, int x, int y, int base_width, int base_height) #else DrawStackedShadows(tab, top_GC, bottom_GC, x, y, base_width, base_height) XmTabStackWidget tab; GC top_GC, bottom_GC; int x, y, base_width, base_height; #endif { Widget parent = XtParent(tab); int i, num_rows, num_cols, offset, shadow, y2, x2, idx; Dimension doffset; GC gc; XRectangle rts[2]; Pixel pixel = XmUNSPECIFIED_PIXEL; Pixmap pixmap = None; shadow = tab->manager.shadow_thickness; num_rows = XmTabBoxGetNumRows(XmTabStack_tab_box(tab)); num_cols = XmTabBoxGetNumColumns(XmTabStack_tab_box(tab)); XtVaGetValues(XmTabStack_tab_box(tab), XmNtabOffset, &doffset, NULL); offset = doffset; if( !XmIsManager(parent) ) { XtVaGetValues(parent, XmNbackground, &pixel, XmNbackgroundPixmap, &pixmap, NULL); } switch( XmTabStack_tab_side(tab) ) { case XmTABS_ON_TOP: default: if (LayoutIsRtoLM(tab)) { x = 0; y = XmTabStack_tab_box(tab)->core.height; XFillRectangle(XtDisplay(tab), XtWindow(tab), bottom_GC, x + shadow + offset * (num_rows - 1), y + base_height, base_width + shadow, shadow); x += offset * (num_rows - 1); x2 = x + offset; y2 = y + base_height; for( i = 0; i < num_rows; ++i ) { if (i == 0) { XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, x, y, shadow, y2 - y); XmDrawBevel(XtDisplay(tab), XtWindow(tab), top_GC, bottom_GC, x, y2, shadow, XmBEVEL_BOTH); y2 -= offset; x -= offset; x2 -= offset; } else { if( (idx = _XiGetTabIndex(XmTabStack_tab_box(tab), i, (num_cols-1))) >= 0 ) { Widget child = XmTabStackIndexToWidget((Widget)tab, idx); if( child == NULL || !XiBackgroundSpecified(child) ) { gc = tab->manager.background_GC; } else { gc = XmTabStack__gc(tab); SetChildGC(child, gc); } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y, x2 - x, y2 - y); if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y2, x2 - x, (int)XtHeight(tab) - y2); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, x, y, shadow, y2 - y); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y2 - shadow, x2 - x, shadow); XmDrawBevel(XtDisplay(tab), XtWindow(tab), top_GC, bottom_GC, x, y2 - shadow, shadow, XmBEVEL_BOTH); x2 -= offset; } x -= offset; y2 -= offset; } } /* for */ if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, offset * (num_rows-1) + base_width + 2*shadow, 0, XtWidth(tab) - offset * (num_rows-1) + base_width + 2*shadow, XtHeight(tab)); if( _XiGetTabIndex(XmTabStack_tab_box(tab), num_rows-1, num_cols-1) < 0 ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, 0, 0, offset, XtHeight(tab)); } XFillRectangle(XtDisplay(tab), XtWindow(tab), bottom_GC, offset * (num_rows - 1) + base_width + shadow, y, shadow, base_height + shadow); } else { x = 0; y = XmTabStack_tab_box(tab)->core.height; XFillRectangle(XtDisplay(tab), XtWindow(tab), top_GC, x, y, shadow, base_height + shadow); XFillRectangle(XtDisplay(tab), XtWindow(tab), bottom_GC, x + shadow, y + base_height, base_width + shadow, shadow); XmDrawBevel(XtDisplay(tab), XtWindow(tab), top_GC, bottom_GC, x, y + base_height, shadow, XmBEVEL_BOTTOM); x += base_width + shadow; x2 = x + offset; y2 = y + base_height; for( i = 0; i < num_rows; ++i ) { if( i == 0 ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y, shadow, y2 - y); x += shadow; x2 = x + offset; } else { if( (idx = _XiGetTabIndex(XmTabStack_tab_box(tab), i, (num_cols-1))) >= 0 ) { Widget child = XmTabStackIndexToWidget((Widget)tab, idx); if( child == NULL || !XiBackgroundSpecified(child) ) { gc = tab->manager.background_GC; } else { gc = XmTabStack__gc(tab); SetChildGC(child, gc); } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y, x2 - x, y2 - y); if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y2, x2 - x, (int)XtHeight(tab) - y2); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x2 - shadow, y, shadow, y2 - y); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y2 - shadow, x2 - x, shadow); x = x2; } x2 += offset; } y2 -= offset; } if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } if( x < (int)XtWidth(tab) ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, 0, (int)XtWidth(tab) - x, XtHeight(tab)); } } break; case XmTABS_ON_BOTTOM: if( LayoutIsRtoL(tab) ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), bottom_GC, offset * (num_rows - 1) + base_width + shadow, 0, shadow, XtHeight(tab)); XFillRectangle(XtDisplay(tab), XtWindow(tab), top_GC, offset * (num_rows - 1), 0, base_width + shadow, shadow); x = offset * (num_rows - 1); y = 0; x2 = x + offset; y2 = y + offset; for( i = 0; i < num_rows; ++i ) { if (i == 0) { XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, x, y + shadow, shadow, base_height); x -= offset; x2 -= offset; } else { if( (idx = _XiGetTabIndex(XmTabStack_tab_box(tab), i, (num_cols-1))) >= 0 ) { Widget child = XmTabStackIndexToWidget((Widget)tab, idx); if( child == NULL || !XiBackgroundSpecified(child) ) { gc = tab->manager.background_GC; } else { gc = XmTabStack__gc(tab); SetChildGC(child, gc); } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y2 + shadow, x2 - x, base_height - y2); if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y, x2 - x, y2 - y); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, x, y2 + shadow, shadow, base_height - y2); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, x, y2, x2 - x, shadow); x2 -= offset; } x -= offset; y2 += offset; } } if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } i = offset * (num_rows-1) + base_width + shadow*2; if( i < (int)XtWidth(tab) ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, i, 0, (int)XtWidth(tab) - i, XtHeight(tab)); } if( _XiGetTabIndex(XmTabStack_tab_box(tab), num_rows-1, num_cols-1) < 0 ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, 0, 0, offset, XtHeight(tab)); } } else { rts[0].x = 0; rts[0].y = 0; rts[0].width = shadow; rts[0].height = XtHeight(tab); rts[1].x = shadow; rts[1].y = 0; rts[1].width = base_width + shadow; rts[1].height = shadow; XFillRectangles(XtDisplay(tab), XtWindow(tab), top_GC, rts, 2); x += base_width + shadow; XmDrawBevel(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, x, 0, shadow, XmBEVEL_BOTTOM); x2 = x + offset; y += shadow; y2 = y + base_height; for( i = 0; i < num_rows; ++i ) { if( i == 0 ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y, shadow, y2 - y); x += shadow; x2 = x + offset; } else { if( (idx = _XiGetTabIndex(XmTabStack_tab_box(tab), i, (num_cols-1))) >= 0 ) { Widget child = XmTabStackIndexToWidget((Widget)tab, idx); if( child == NULL || !XiBackgroundSpecified(child) ) { gc = tab->manager.background_GC; } else { gc = XmTabStack__gc(tab); SetChildGC(child, gc); } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y, x2 - x, y2 - y); if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, 0, x2 - x, y); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x2 - shadow, y, shadow, y2 - y); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, x, y, x2 - x, shadow); XmDrawBevel(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, x2 - shadow, y, shadow, XmBEVEL_BOTTOM); x = x2; } x2 += offset; } y += offset; } if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } if( x < (int)XtWidth(tab) ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, 0, (int)XtWidth(tab) - x, XtHeight(tab)); } } break; case XmTABS_ON_RIGHT: rts[0].x = 0; rts[0].y = 0; rts[0].width = XtWidth(tab); rts[0].height = shadow; rts[1].x = 0; rts[1].y = shadow; rts[1].width = shadow; rts[1].height = base_width + shadow; XFillRectangles(XtDisplay(tab), XtWindow(tab), top_GC, rts, 2); y += base_height + shadow; XmDrawBevel(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, 0, y, shadow, XmBEVEL_BOTTOM); y2 = y + offset; x += shadow; x2 = y + base_width; for( i = 0; i < num_rows; ++i ) { if( i == 0 ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y, x2 - x, shadow); y += shadow; y2 = y + offset; } else { if( (idx = _XiGetTabIndex(XmTabStack_tab_box(tab), i, (num_cols-1))) >= 0 ) { Widget child = XmTabStackIndexToWidget((Widget)tab, idx); if( child == NULL || !XiBackgroundSpecified(child) ) { gc = tab->manager.background_GC; } else { gc = XmTabStack__gc(tab); SetChildGC(child, gc); } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y, x2 - x, y2 - y); if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, 0, y, x, y2 - y); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y2 - shadow, x2 - x, shadow); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, x, y, shadow, y2 - y); XmDrawBevel(XtDisplay(tab), XtWindow(tab), tab->manager.top_shadow_GC, tab->manager.bottom_shadow_GC, x, y2 - shadow, shadow, XmBEVEL_BOTTOM); y = y2; } y2 += offset; } x += offset; } if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } if( x < (int)XtWidth(tab) ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, 0, y, XtWidth(tab), (int)XtHeight(tab) - y); } break; case XmTABS_ON_LEFT: y = 0; x = XtWidth(XmTabStack_tab_box(tab)); XFillRectangle(XtDisplay(tab), XtWindow(tab), top_GC, x, y, base_width + shadow, shadow); XFillRectangle(XtDisplay(tab), XtWindow(tab), bottom_GC, x + base_width, y + shadow, shadow, base_height + shadow); XmDrawBevel(XtDisplay(tab), XtWindow(tab), top_GC, bottom_GC, x + base_width, y, shadow, XmBEVEL_BOTTOM); y += base_height + shadow; y2 = y + offset; x2 = x + base_width; for( i = 0; i < num_rows; ++i ) { if( i == 0 ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y, x2 - x, shadow); y += shadow; y2 = y + offset; } else { if( (idx = _XiGetTabIndex(XmTabStack_tab_box(tab), i, (num_cols-1))) >= 0 ) { Widget child = XmTabStackIndexToWidget((Widget)tab, idx); if( child == NULL || !XiBackgroundSpecified(child) ) { gc = tab->manager.background_GC; } else { gc = XmTabStack__gc(tab); SetChildGC(child, gc); } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x, y, x2 - x, y2 - y); if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, x2, y, (int)XtWidth(tab) - x2, y2 - y); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x, y2 - shadow, x2 - x, shadow); XFillRectangle(XtDisplay(tab), XtWindow(tab), tab->manager.bottom_shadow_GC, x2 - shadow, y, shadow, y2 - y); y = y2; } y2 += offset; } x2 -= offset; } if( XmIsManager(parent) ) { gc = ((XmManagerWidget)parent)->manager.background_GC; } else { gc = XmTabStack__gc(tab); if( ValidPixmap(pixmap) ) { SetTiledGC(XtDisplay(tab), gc, pixmap); } else { SetSolidGC(XtDisplay(tab), gc, pixel); } } if( x < (int)XtWidth(tab) ) { XFillRectangle(XtDisplay(tab), XtWindow(tab), gc, 0, y, XtWidth(tab), (int)XtHeight(tab) - y); } break; } } /* note: intentionally undocumented. It may be here for historical reasons ** so keep it around; but the function isn't useful. It's used internally ** and was probably intended not to be publicized. */ Widget #ifndef _NO_PROTO XmTabStackIndexToWidget(Widget widget, int idx) #else XmTabStackIndexToWidget(widget, idx) Widget widget; int idx; #endif { XmTabStackWidget tab = (XmTabStackWidget) widget; Cardinal i, cnt; WidgetList kid; _XmWidgetToAppContext(widget); _XmAppLock(app); if( !XmIsTabStack(widget) || idx < 0 ) { _XmAppUnlock(app); return( NULL ); } for( i = 0, cnt = 0, kid = tab->composite.children; i < tab->composite.num_children; ++i, ++kid ) { if( IsTabBox(tab, *kid) || !XtIsManaged(*kid) ) continue; if( cnt++ == idx ) { _XmAppUnlock(app); return( *kid ); } } _XmAppUnlock(app); return( NULL ); } Widget #ifndef _NO_PROTO XmTabStackGetSelectedTab(Widget widget) #else XmTabStackGetSelectedTab(widget) Widget widget; #endif { XmTabStackWidget tab = (XmTabStackWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmIsTabStack(widget)) { _XmAppUnlock(app); return(NULL); } if (!XtIsRealized((Widget)tab) && XmTabStack__selected_tab(tab)) { _XmAppUnlock(app); return (XmTabStack__selected_tab(tab)); } _XmAppUnlock(app); return (XmTabStack__active_child(tab)); } #ifdef TEAR_OFF_TABS static void #ifndef _NO_PROTO TearOffCallback(Widget widget, XtPointer client, XtPointer cbdata) #else TearOffCallback(widget, client, cbdata) Widget widget; XtPointer client, cbdata; #endif { XtPointer data; XtVaGetValues(widget, XmNuserData, &data, NULL); if( data == NULL ) return; } static void #ifndef _NO_PROTO MenuSelectCallback(Widget widget, XtPointer client, XtPointer cbdata) #else MenuSelectCallback(widget, client, cbdata) Widget widget; XtPointer client, cbdata; #endif { XtPointer data; XtVaGetValues(widget, XmNuserData, &data, NULL); XmTabStackSelectTab((Widget)data); } static void #ifndef _NO_PROTO BuildMenu(XmTabStackWidget tab) #else BuildMenu(tab) XmTabStackWidget tab; #endif { WidgetList kids, buttons; Cardinal kidCnt, validKids, i, j, buttonCnt, validButtons; Widget menu = XmTabStack__menu(tab), tmp; Boolean done; /* * First thing we need to do is get the list of child for the * menu. */ XtVaGetValues(tab, XmNchildren, &kids, XmNnumChildren, &kidCnt, NULL); for( i = 0, validKids = 0; i < kidCnt; ++i ) { if( IsValidChild(tab, kids[i]) ) validKids++; } XtVaGetValues(menu, XmNchildren, &buttons, XmNnumChildren, &buttonCnt, NULL); for( i = 0, validButtons = 0; i < buttonCnt; ++i ) { if( XmIsPushButton(buttons[i]) ) validButtons++; } for( i = validButtons; i <= validKids; ++i ) { tmp = XtVaCreateWidget("menuItem", xmPushButtonWidgetClass, menu, NULL); XtAddCallback(tmp, XmNactivateCallback, MenuSelectCallback, NULL); } XtVaGetValues(menu, XmNchildren, &buttons, XmNnumChildren, &buttonCnt, NULL); for( j = 0; j < buttonCnt; ++j ) { if( !XmIsSeparator(buttons[j]) && buttons[j] != XmTabStack__tear_off_button(tab) ) break; } for( i = 0, done = False; i < kidCnt; ++i) { if( !IsValidChild(tab, kids[i]) ) continue; XtVaSetValues(buttons[j], XmNlabelString, XmTabStackC_tab_label_string(kids[i]), XmNuserData, (XtPointer) kids[i], NULL); XtManageChild(buttons[j]); for( j++; j < buttonCnt; ++j ) { if( !XmIsSeparator(buttons[j]) && buttons[j] != XmTabStack__tear_off_button(tab) ) break; } } for( ; j < buttonCnt; ++j ) { if( XmIsSeparator(buttons[j]) ) continue; XtUnmanageChild(buttons[j]); } } static void #ifndef _NO_PROTO TabTransferProc(Widget widget, XtPointer closure, Atom *selType, Atom *type, XtPointer value, unsigned long *length, int format) #else TabTransferProc(widget, closure, selType, type, value, length, format) Widget widget; XtPointer closure; Atom *selType, *type; XtPointer value; unsigned long *length; int format; #endif { Widget child, tmp, tab = (Widget)closure; Colormap c_cmap, p_cmap; Cardinal c_depth, p_depth; if( *length != sizeof(Widget) || *type != WidgetAtom(widget) ) { XtVaSetValues(widget, XmNtransferStatus, XmTRANSFER_FAILURE, NULL); return; } child = *((Widget*)value); /* * Lets just do a quick validity check here. Also if the child is * already a child of the tab stack then lets fail. */ if( child->core.self != child || tab->core.self != tab || XtParent(child) == tab ) { XtVaSetValues(widget, XmNtransferStatus, XmTRANSFER_FAILURE, NULL); return; } /* * Now lets check some specific values to make sure that the * transfer will not cause an X Error. */ XtVaGetValues(child, XmNcolormap, &c_cmap, XmNdepth, &c_depth, NULL); XtVaGetValues(tab, XmNcolormap, &p_cmap, XmNdepth, &p_depth, NULL); if( c_cmap != p_cmap || c_depth != p_depth ) { XtVaSetValues(widget, XmNtransferStatus, XmTRANSFER_FAILURE, NULL); return; } /* * The final safty check is to see if we are trying to move a parent * into a child. */ for( tmp = tab; tmp != NULL && tmp != child; tmp = XtParent(tmp) ); if( tmp == child ) { XtVaSetValues(widget, XmNtransferStatus, XmTRANSFER_FAILURE, NULL); return; } /* * If we got here that means that we really want to move this * panel so lets do it. */ XiMoveTabPanel(child, tab); XtVaSetValues(widget, XmNtransferStatus, XmTRANSFER_SUCCESS, NULL); } static void #ifndef _NO_PROTO HandleTabDrop(Widget widget, XtPointer client, XtPointer cbdata) #else HandleTabDrop(widget, client, cbdata) Widget widget; XtPointer client, cbdata; #endif { XmDropProcCallback drop = (XmDropProcCallback) cbdata; XmDropTransferEntryRec transferEntries[2]; XmDropTransferEntry transferList; Arg args[10]; int n = 0; if( drop->dropAction != XmDROP || drop->operation != XmDROP_MOVE ) { XtSetArg(args[n], XmNtransferStatus, XmTRANSFER_FAILURE); ++n; } else { transferEntries[0].target = TabAtom(widget); transferEntries[0].client_data = (XtPointer) widget; transferList = transferEntries; XtSetArg(args[n], XmNdropTransfers, transferList); ++n; XtSetArg(args[n], XmNnumDropTransfers, 1); ++n; XtSetArg(args[n], XmNtransferProc, TabTransferProc); ++n; XtSetArg(args[n], XmNtransferStatus, XmTRANSFER_SUCCESS); ++n; } XmDropTransferStart(drop->dragContext, args, n); } static Boolean #ifndef _NO_PROTO TabConvertProc(Widget widget, Atom *selection, Atom *target, Atom *typeRtn, XtPointer *valueRtn, unsigned long *lengthRtn, int *formatRtn, unsigned long *max_lengthRtn, XtPointer client_data, XtRequestId request_id) #else TabConvertProc(widget, selection, target, typeRtn, valueRtn, lengthRtn, formatRtn, max_lengthRtn, client_data, request_id) Widget widget; Atom *selection, *target, *typeRtn; XtPointer *valueRtn; unsigned long *lengthRtn; int *formatRtn; unsigned long *max_lengthRtn; XtPointer client_data; XtRequestId request_id; #endif { Widget child, *passed_child; XtPointer child_data; XtVaGetValues(widget, XmNclientData, &child_data, NULL); child = (Widget) child_data; if( *target != TabAtom(widget) ) return( False ); passed_child = XtNew(Widget); *passed_child = child; *typeRtn = WidgetAtom(widget); *valueRtn = (XtPointer) passed_child; *lengthRtn = sizeof(Widget); *formatRtn = 8; return( True ); } static Atom #ifndef _NO_PROTO TabAtom(Widget widget) #else TabAtom(widget) Widget widget; #endif { char pid_buf[64]; sprintf(pid_buf, "ICS_TAB_PID_%d\n", (int)getpid()); return( XmInternAtom(XtDisplay(widget), pid_buf, False) ); } Widget #ifndef _NO_PROTO XmTabStackXYToWidget(Widget widget, int x, int y) #else XmTabStackXYToWidget(widget, x, y) Widget widget; int x, y; #endif { Widget tab_stack, tab_box; _XmWidgetToAppContext(widget); _XmAppLock(app); if( XmIsTabStack(widget) ) { tab_stack = widget; tab_box = XmTabStack_tab_box((XmTabStackWidget)widget); } else if( XmIsTabBox(widget) ) { tab_stack = XtParent(widget); tab_box = widget; } else if( XtParent(widget) != NULL && XmIsTabBox(XtParent(widget)) ) { tab_box = XtParent(widget); tab_stack = XtParent(tab_box); } else { _XmAppUnlock(app); return( NULL ); } _XmAppUnlock(app); return( XmTabStackIndexToWidget(tab_stack, XmTabBoxXYToIndex(tab_box, x, y)) ); } #define XiDeleteChild(c) \ { \ _XmProcessLock(); \ (*((CompositeWidgetClass)((c)->core.parent->core.widget_class))-> \ composite_class.delete_child)(c); \ _XmProcessUnlock(); \ } #define XiInsertChild(p,c) \ { \ (c)->core.parent = (p); \ _XmProcessLock(); \ (*((CompositeWidgetClass)(p)->core.widget_class)-> \ composite_class.insert_child)(c); \ _XmProcessUnlock(); \ } static void #ifndef _NO_PROTO XiMoveTabPanel(Widget panel, Widget to) #else XiMoveTabPanel(panel, to) Widget panel, to; #endif { Widget from = XtParent(panel); int width, height; /* * The object here is to move the panel from "from" to "to", so lets * start by removing the panel from "from". This is done by first * unmanaging the panel and then calling "from"s delete method. */ XmDropSiteStartUpdate(from); XmDropSiteStartUpdate(to); width = XmTabStackC_width(panel); height = XmTabStackC_height(panel); XtUnmanageChild(panel); XtVaSetValues(panel, XmNwidth, width, XmNheight, height, NULL); XiDeleteChild(panel); XtUnrealizeWidget(panel); /* * And now lets add that child to "to" by calling its insert method * and then managing the puppy. */ XiInsertChild(to, panel); XtManageChild(panel); XmDropSiteEndUpdate(from); XmDropSiteEndUpdate(to); } static void #ifndef _NO_PROTO DragCallback(Widget widget, XtPointer client, XtPointer cbdata) #else DragCallback(widget, client, cbdata) Widget widget; XtPointer client, cbdata; #endif { XmAnyCallbackStruct *info = (XmAnyCallbackStruct*)cbdata; XmTabStackWidget tab = (XmTabStackWidget) client; switch( info->reason ) { case XmCR_DRAG_DROP_FINISH: break; case XmCR_DRAG_MOTION: break; case XmCR_DROP_FINISH: break; case XmCR_DROP_SITE_ENTER: { XmDropSiteEnterCallback enter = (XmDropSiteEnterCallback)cbdata; switch( enter->dropSiteStatus ) { case XmINVALID_DROP_SITE: default: XtVaSetValues(widget, XmNstateCursorIcon, XmTabStack__invalid_icon(tab), NULL); break; case XmVALID_DROP_SITE: XtVaSetValues(widget, XmNstateCursorIcon, NULL, NULL); break; } } break; case XmCR_DROP_SITE_LEAVE: XtVaSetValues(widget, XmNstateCursorIcon, XmTabStack__invalid_icon(tab), NULL); break; case XmCR_DROP_START: { XmDropSiteEnterCallback enter = (XmDropSiteEnterCallback)cbdata; switch( enter->dropSiteStatus ) { case XmINVALID_DROP_SITE: default: XtVaSetValues(widget, XmNstateCursorIcon, XmTabStack__invalid_icon(tab), NULL); break; case XmVALID_DROP_SITE: XtVaSetValues(widget, XmNstateCursorIcon, NULL, NULL); break; } } break; case XmCR_OPERATION_CHANGED: { XmOperationChangedCallback change = (XmOperationChangedCallback) cbdata; switch( change->operation ) { case XmDROP_MOVE: XtVaSetValues(widget, XmNstateCursorIcon, NULL, NULL); break; default: XtVaSetValues(widget, XmNstateCursorIcon, XmTabStack__invalid_icon(tab), NULL); break; } } break; case XmCR_TOP_LEVEL_ENTER: break; case XmCR_TOP_LEVEL_LEAVE: break; default: break; } } static void #ifndef _NO_PROTO XmTabStackMenu(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabStackMenu(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { Widget parent = XtParent(widget), child; XmTabStackWidget tab = (XmTabStackWidget)XtParent(parent); /* * Lets start by finding out if we are popping this menu up from * a tab. */ child = XmTabStackXYToWidget((Widget) tab, event->xbutton.x, event->xbutton.y); /* * If we are not popping this menu up, and we are not in a tab * then we want to desensitise the tear off option. */ XtSetSensitive(XmTabStack__tear_off_button(tab), (child != NULL)); XtVaSetValues(XmTabStack__tear_off_button(tab), XmNuserData, child, NULL); XmMenuPosition(XmTabStack__menu(tab), (XButtonPressedEvent*)event); XtManageChild(XmTabStack__menu(tab)); } static void #ifndef _NO_PROTO XmTabBoxDragTab(Widget widget, XEvent *event, String *params, Cardinal *num_params) #else XmTabBoxDragTab(widget, event, params, num_params) Widget widget; XEvent *event; String *params; Cardinal *num_params; #endif { Widget parent = XtParent(widget), drag, child, source_icon, invalid_icon; XmTabStackWidget tab = (XmTabStackWidget)XtParent(parent); Arg args[10]; Cardinal n = 0; Atom target; int idx; Pixmap source_pixmap, source_mask, invalid_pixmap, invalid_mask; #ifdef TEAR_OFF_TABS if( !XmTabStack_allow_tear_offs(tab) || event == NULL || event->xany.type != ButtonPress || (child = IndexToTab(tab, XmTabBoxGetIndex(parent, event->xbutton.x, event->xbutton.y))) == NULL || !XmTabStackC_tear_off_enabled(child) ) { return; } #endif /* TEAR_OFF_TABS */ if( XmTabStack__source_icon(tab) == NULL ) { source_pixmap = XCreateBitmapFromData(XtDisplay(widget), XtWindow(widget), (char*)tab_pix_bits, tab_pix_width, tab_pix_height); source_mask = XCreateBitmapFromData(XtDisplay(widget), XtWindow(widget), (char*)tab_mask_bits, tab_pix_width, tab_pix_height); invalid_pixmap = XCreateBitmapFromData(XtDisplay(widget), XtWindow(widget), (char*)invalid_bits, tab_pix_width, tab_pix_height); invalid_mask = XCreateBitmapFromData(XtDisplay(widget), XtWindow(widget), (char*)invalid_mask_bits, tab_pix_width, tab_pix_height); XtSetArg(args[n], XmNdepth, 1); n++; XtSetArg(args[n], XmNwidth, tab_pix_width); n++; XtSetArg(args[n], XmNheight, tab_pix_height); n++; XtSetArg(args[n], XmNpixmap, source_pixmap); n++; XtSetArg(args[n], XmNmask, source_mask); n++; source_icon = XmCreateDragIcon(parent, "tabSourceIcon", args, n); n=0; XtSetArg(args[n], XmNdepth, 1); n++; XtSetArg(args[n], XmNwidth, tab_pix_width); n++; XtSetArg(args[n], XmNheight, tab_pix_height); n++; XtSetArg(args[n], XmNpixmap, invalid_pixmap); n++; XtSetArg(args[n], XmNmask, invalid_mask); n++; invalid_icon = XmCreateDragIcon(parent, "tabInvalidIcon", args, n);n=0; XmTabStack__source_pixmap(tab) = source_pixmap; XmTabStack__source_mask(tab) = source_mask; XmTabStack__invalid_pixmap(tab) = invalid_pixmap; XmTabStack__invalid_mask(tab) = invalid_mask; XmTabStack__source_icon(tab) = source_icon; XmTabStack__invalid_icon(tab) = invalid_icon; } else { source_icon = XmTabStack__source_icon(tab); invalid_icon = XmTabStack__invalid_icon(tab); } target = TabAtom(widget); XtSetArg(args[n], XmNblendModel, XmBLEND_ALL); ++n; XtSetArg(args[n], XmNsourceCursorIcon, source_icon); ++n; XtSetArg(args[n], XmNsourcePixmapIcon, source_icon); ++n; XtSetArg(args[n], XmNdragOperations, XmDROP_MOVE); ++n; XtSetArg(args[n], XmNexportTargets, &target); ++n; XtSetArg(args[n], XmNnumExportTargets, 1); ++n; XtSetArg(args[n], XmNconvertProc, TabConvertProc); ++n; XtSetArg(args[n], XmNclientData, child); ++n; drag = XmDragStart(parent, event, args, n); n = 0; XtAddCallback(drag, XmNdragDropFinishCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNdragMotionCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNdropFinishCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNdropSiteEnterCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNdropSiteLeaveCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNdropStartCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNoperationChangedCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNtopLevelEnterCallback, DragCallback, (XtPointer) tab); XtAddCallback(drag, XmNtopLevelLeaveCallback, DragCallback, (XtPointer) tab); } #endif motif-2.3.8/lib/Xm/GadgetP.h0000644000175000017500000001127513145162623012412 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmGadgetP_h #define _XmGadgetP_h #ifndef _XmNO_BC_INCL #define _XmNO_BC_INCL #endif #include #ifdef __cplusplus extern "C" { #endif /* Masks to define input the gadget is interested in */ #define XmNO_EVENT 0x000 #define XmENTER_EVENT 0x001 #define XmLEAVE_EVENT 0x002 #define XmFOCUS_IN_EVENT 0x004 #define XmFOCUS_OUT_EVENT 0x008 #define XmMOTION_EVENT 0x010 #define XmARM_EVENT 0x020 #define XmACTIVATE_EVENT 0x040 #define XmHELP_EVENT 0x080 #define XmKEY_EVENT 0x100 #define XmMULTI_ARM_EVENT 0x200 #define XmMULTI_ACTIVATE_EVENT 0x400 #define XmBDRAG_EVENT 0x800 #define XmALL_EVENT 0xFFF /* Gadget access Macros */ #define G_ShadowThickness(g) \ (((XmGadget)(g))->gadget.shadow_thickness) #define G_HighlightThickness(g) \ (((XmGadget)(g))->gadget.highlight_thickness) #define GCEPTR(wc) ((XmGadgetClassExt *)(&(((XmGadgetClass)(wc))->gadget_class.extension))) #define _XmGetGadgetClassExtPtr(wc, owner) \ ((*GCEPTR(wc) && (((*GCEPTR(wc))->record_type) == owner))\ ? GCEPTR(wc) \ :((XmGadgetClassExt *) _XmGetClassExtensionPtr(((XmGenericClassExt *)GCEPTR(wc)), owner))) #define XmGadgetClassExtVersion 2L /* Gadget cache header for each gadget's Cache Part */ typedef struct _XmGadgetCache { struct _XmGadgetCache *next; struct _XmGadgetCache *prev; int ref_count; } XmGadgetCache, *XmGadgetCachePtr; /* A cache entry for each class which desires gadget caching */ typedef struct _XmCacheClassPart { XmGadgetCache cache_head; XmCacheCopyProc cache_copy; XmGadgetCacheProc cache_delete; XmCacheCompareProc cache_compare; } XmCacheClassPart, *XmCacheClassPartPtr; /* A struct for properly aligning the data part of the cache entry. */ typedef struct _XmGadgetCacheRef { XmGadgetCache cache; XtArgVal data; } XmGadgetCacheRef, *XmGadgetCacheRefPtr; /* Gadget class structure */ typedef struct _XmGadgetClassExtRec{ XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; XmWidgetBaselineProc widget_baseline; XmWidgetDisplayRectProc widget_display_rect; XmWidgetMarginsProc widget_margins; }XmGadgetClassExtRec, *XmGadgetClassExt; typedef struct _XmGadgetClassPart { XtWidgetProc border_highlight; XtWidgetProc border_unhighlight; XtActionProc arm_and_activate; XmWidgetDispatchProc input_dispatch; XmVisualChangeProc visual_change; /* unused in Motif 2.0 */ XmSyntheticResource * syn_resources; int num_syn_resources; XmCacheClassPartPtr cache_part; XtPointer extension; } XmGadgetClassPart; /* Full class record declaration for Gadget class */ typedef struct _XmGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; } XmGadgetClassRec; externalref XmGadgetClassRec xmGadgetClassRec; /* The Gadget instance record */ typedef struct _XmGadgetPart { Dimension shadow_thickness; Dimension highlight_thickness; XtCallbackList help_callback; XtPointer user_data; Boolean traversal_on; Boolean highlight_on_enter; Boolean have_traversal; unsigned char unit_type; XmNavigationType navigation_type; Boolean highlight_drawn; Boolean highlighted; Boolean visible; Mask event_mask; XmDirection layout_direction; #ifdef OM22_COMPATIBILITY XmString tool_tip_string; #endif } XmGadgetPart; /* Full instance record declaration */ typedef struct _XmGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; } XmGadgetRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmGadgetP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ColObjFunc.c0000644000175000017500000000557012672140200013046 00000000000000/* $XConsortium: ColObjFunc.c /main/7 1995/10/25 19:56:10 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "ColorObjI.h" /**********************************************************************/ /** XmeUseColorObj() **/ /** Return False if color is not working for some reason. **/ /** **/ /** Could be due to useColorObj resource == False, or any **/ /** problem with the color server or color object. **/ /** **/ /**********************************************************************/ Boolean XmeUseColorObj( void ) { XmColorObj tmpColorObj = _XmDefaultColorObj; _XmProcessLock(); if (!tmpColorObj || !tmpColorObj->color_obj.colorIsRunning || !tmpColorObj->color_obj.useColorObj) { _XmProcessUnlock(); return False; } else { _XmProcessUnlock(); return True; } } /**********************************************************************/ /** Following entries kept for bc with CDE (they'll be moved to ** obsolete module later **/ /** **/ /**********************************************************************/ Boolean _XmGetPixelData( int screen, int *colorUse, XmPixelSet *pixelSet, short *a, short *i, short *p, short *s ) { return XmeGetPixelData( screen, colorUse, pixelSet, a, i, p, s ); } Boolean _XmGetIconControlInfo( Screen *screen, Boolean *useMaskRtn, Boolean *useMultiColorIconsRtn, Boolean *useIconFileCacheRtn) { return XmeGetIconControlInfo(screen, useMaskRtn, useMultiColorIconsRtn, useIconFileCacheRtn); } Boolean _XmUseColorObj( void ) { return XmeUseColorObj(); } motif-2.3.8/lib/Xm/RowColumnI.h0000644000175000017500000001546312672140200013127 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char *rcsidRowColumnIH = "$XConsortium: RowColumnI.h /main/6 1996/08/15 17:26:22 pascale $"; #endif #endif #ifndef _XmRowColumnI_h #define _XmRowColumnI_h #include #ifdef __cplusplus extern "C" { #endif #define UNDEFINED_TYPE -1 #define POST_TIME_OUT 3 /* sec */ * 1000 #define Double(x) ((x) << 1) #define Half(x) ((x) >> 1) #define IsSensitive(r) XtIsSensitive(r) #define IsManaged(w) XtIsManaged(w) #define IsNull(p) ((p) == NULL) #define PackTight(m) (RC_Packing (m) == XmPACK_TIGHT) #define PackColumn(m) (RC_Packing (m) == XmPACK_COLUMN) #define PackNone(m) (RC_Packing (m) == XmPACK_NONE) #define Asking(i) ((i) == 0) #define IsVertical(m) \ (((XmRowColumnWidget) (m))->row_column.orientation == XmVERTICAL) #define IsHorizontal(m) \ (((XmRowColumnWidget) (m))->row_column.orientation == XmHORIZONTAL) #define IsAligned(m) \ (((XmRowColumnWidget) (m))->row_column.do_alignment) #define IsPopup(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_POPUP) #define IsPulldown(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_PULLDOWN) #define IsOption(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_OPTION) #define IsBar(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmMENU_BAR) #define IsWorkArea(m) \ (((XmRowColumnWidget) (m))->row_column.type == XmWORK_AREA) #define IsRadio(m) \ ((((XmRowColumnWidget) (m))->row_column.type == XmWORK_AREA) && \ ((((XmRowColumnWidget) (m))->row_column.radio))) #define IsHelp(m,w) ((w) == RC_HelpPb (m)) #define WasManaged(w) \ (((XmRowColumnConstraintRec *) ((w)->core.constraints))-> \ row_column.was_managed) #define SavedMarginTop(w) \ (((XmRowColumnConstraintRec *) ((w)->core.constraints))-> \ row_column.margin_top) #define SavedMarginBottom(w) \ (((XmRowColumnConstraintRec *) ((w)->core.constraints))-> \ row_column.margin_bottom) #define SavedBaseline(w) \ (((XmRowColumnConstraintRec *) ((w)->core.constraints))-> \ row_column.baseline) #define BX(b) ((b)->x) #define BY(b) ((b)->y) #define BWidth(b) ((b)->width) #define BHeight(b) ((b)->height) #define BBorder(b) ((b)->border_width) #define SetPosition(b,x,y) { BX (b) = x; BY (b) = y; } #define ChangeMargin(margin,new_w,sum) { \ if ((margin) != new_w) \ { \ sum += new_w - (margin); \ (margin) = new_w; \ }\ } #define ChangeMarginDouble(margin,new_w,sum) { \ if ((margin) != new_w) \ { \ sum += 2* (new_w - (margin)); \ (margin) = new_w; \ }\ } #define ForAllChildren(m, i, q) \ for (i = 0, q = m->composite.children; \ i < m->composite.num_children; \ i++, q++) #define ForManagedChildren(m, i, q) \ for (i = 0, q = m->composite.children; \ i < m->composite.num_children; \ i++, q++) \ \ if (XtIsManaged(*q)) #define AlignmentBaselineTop(m) \ (((XmRowColumnWidget) (m))->row_column.entry_vertical_alignment == XmALIGNMENT_BASELINE_TOP) #define AlignmentBaselineBottom(m) \ (((XmRowColumnWidget) (m))->row_column.entry_vertical_alignment == XmALIGNMENT_BASELINE_BOTTOM) #define AlignmentCenter(m) \ (((XmRowColumnWidget) (m))->row_column.entry_vertical_alignment == XmALIGNMENT_CENTER) #define AlignmentTop(m) \ (((XmRowColumnWidget) (m))->row_column.entry_vertical_alignment == XmALIGNMENT_CONTENTS_TOP) #define AlignmentBottom(m) \ (((XmRowColumnWidget) (m))->row_column.entry_vertical_alignment == XmALIGNMENT_CONTENTS_BOTTOM) /* Warning Messages */ #define BadWidthSVMsg _XmMMsgRowColumn_0000 #define BadHeightSVMsg _XmMMsgRowColumn_0001 #define BadPopupHelpMsg _XmMMsgRowColumn_0002 #define BadPulldownHelpMsg _XmMMsgRowColumn_0003 #define BadOptionHelpMsg _XmMMsgRowColumn_0004 #define BadWorkAreaHelpMsg _XmMMsgRowColumn_0005 #define BadTypeParentMsg _XmMMsgRowColumn_0007 #define BadTypeSVMsg _XmMMsgRowColumn_0008 #define BadMenuBarHomogenousSVMsg _XmMMsgRowColumn_0015 #define BadMenuBarEntryClassSVMsg _XmMMsgRowColumn_0016 #define BadPulldownWhichButtonSVMsg _XmMMsgRowColumn_0017 #define BadPulldownMenuPostSVMsg _XmMMsgRowColumn_0018 #define BadMenuPostMsg _XmMMsgRowColumn_0019 #define BadShadowThicknessSVMsg _XmMMsgRowColumn_0020 #define WrongMenuChildMsg _XmMMsgRowColumn_0022 #define WrongChildMsg _XmMMsgRowColumn_0023 #define BadOptionIsHomogeneousSVMsg _XmMMsgRowColumn_0025 #define TearOffSharedMenupaneMsg _XmMMsgRowColumn_0026 #define BadMnemonicCharMsg _XmMMsgRowColumn_0027 #define RCIndex(w) (((XmRowColumnConstraintRec *)(w)->core.constraints)\ ->row_column.position_index) /******** Private Function Declarations ********/ extern void _XmRC_KeyboardInputHandler( Widget reportingWidget, XtPointer data, XEvent *event, Boolean *cont ); extern void _XmAllowAcceleratedInsensitiveUnmanagedMenuItems( Widget wid, #if NeedWidePrototypes int allowed); #else Boolean allowed); #endif /* NeedWidePrototypes */ extern void _XmPostPopupMenu( Widget wid, XEvent *event) ; extern void _XmCallRowColumnMapCallback( Widget wid, XEvent *event) ; extern void _XmCallRowColumnUnmapCallback( Widget wid, XEvent *event) ; extern void _XmRC_RemoveFromPostFromListOnDestroyCB ( Widget w, caddr_t clientData, caddr_t callData) ; extern void _XmRC_CheckAndSetOptionCascade(XmRowColumnWidget menu) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRowColumnI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStrDefs.ht0000644000175000017500000004746712672140200013145 00000000000000/* $TOG: XmStrDefs.ht /main/2 1997/06/18 17:50:15 samborn $ */ #ifndef _XmStrDefs_h_ #define _XmStrDefs_h_ #include #ifndef _XmConst #define _XmConst /**/ #endif #ifdef __cplusplus extern "C" { #endif <<>> #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #include #ifdef __cplusplus extern "C" { #endif #define XmSTRING_DEFAULT_CHARSET XmS #define XmSTRING_ISO8859_1 "ISO8859-1" #define XmFONTLIST_DEFAULT_TAG XmSFONTLIST_DEFAULT_TAG_STRING #define XmFONTLIST_DEFAULT_TAG_STRING XmSXmFONTLIST_DEFAULT_TAG_STRING #define XmVaCASCADEBUTTON "cascadeButton" #define XmVaCHECKBUTTON "checkButton" #define XmVaDOUBLE_SEPARATOR "doubleSeparator" #define XmVaPUSHBUTTON "pushButton" #define XmVaRADIOBUTTON "radioButton" #define XmVaSEPARATOR "separator" #define XmVaSINGLE_SEPARATOR "singleSeparator" #define XmVaTOGGLEBUTTON "checkButton" #ifndef XmVaTITLE #define XmVaTITLE XtNtitle #endif #ifndef XtCKeyboardFocusPolicy #define XtCKeyboardFocusPolicy XmCKeyboardFocusPolicy #endif #ifndef XtCShellUnitType #define XtCShellUnitType XmCShellUnitType #endif #ifndef XtNkeyboardFocusPolicy #define XtNkeyboardFocusPolicy XmNkeyboardFocusPolicy #endif #ifndef XtNshellUnitType #define XtNshellUnitType XmNshellUnitType #endif #ifndef XtRKeyboardFocusPolicy #define XtRKeyboardFocusPolicy XmRKeyboardFocusPolicy #endif #ifndef XmRPrimBottomShadowPixmap #define XmRPrimBottomShadowPixmap XmRBottomShadowPixmap #endif #ifndef XmRPrimHighlightPixmap #define XmRPrimHighlightPixmap XmRHighlightPixmap #endif #ifndef XmRPrimTopShadowPixmap #define XmRPrimTopShadowPixmap XmRTopShadowPixmap #endif #ifndef XmCAccelerators #define XmCAccelerators XtCAccelerators #endif #ifndef XmCAllowShellResize #define XmCAllowShellResize XtCAllowShellResize #endif #ifndef XmCArgc #define XmCArgc XtCArgc #endif #ifndef XmCArgv #define XmCArgv XtCArgv #endif #ifndef XmCBackground #define XmCBackground XtCBackground #endif #ifndef XmCBaseHeight #define XmCBaseHeight XtCBaseHeight #endif #ifndef XmCBaseHeight #define XmCBaseHeight XtCBaseHeight #endif #ifndef XmCBaseWidth #define XmCBaseWidth XtCBaseWidth #endif #ifndef XmCBaseWidth #define XmCBaseWidth XtCBaseWidth #endif #ifndef XmCBitmap #define XmCBitmap XtCBitmap #endif #ifndef XmCBoolean #define XmCBoolean XtCBoolean #endif #ifndef XmCBorderColor #define XmCBorderColor XtCBorderColor #endif #ifndef XmCBorderWidth #define XmCBorderWidth XtCBorderWidth #endif #ifndef XmCCallback #define XmCCallback XtCCallback #endif #ifndef XmCColor #define XmCColor XtCColor #endif #ifndef XmCColormap #define XmCColormap XtCColormap #endif #ifndef XmCCreatePopupChildProc #define XmCCreatePopupChildProc XtCCreatePopupChildProc #endif #ifndef XmCCursor #define XmCCursor XtCCursor #endif #ifndef XmCDepth #define XmCDepth XtCDepth #endif #ifndef XmCDimension #define XmCDimension XtRDimension #endif #ifndef XmCEditMode #define XmCEditMode XtREditMode #endif #ifndef XmCEditType #define XmCEditType XtCEditType #endif #ifndef XmCEventBindings #define XmCEventBindings XtCEventBindings #endif #ifndef XmCFile #define XmCFile XtCFile #endif #ifndef XmCFont #define XmCFont XtCFont #endif #ifndef XmCFontSet #define XmCFontSet XtCFontSet #endif #ifndef XmCForeground #define XmCForeground XtCForeground #endif #ifndef XmCFraction #define XmCFraction XtCFraction #endif #ifndef XmCFunction #define XmCFunction XtCFunction #endif #ifndef XmCGeometry #define XmCGeometry XtCGeometry #endif #ifndef XmCHSpace #define XmCHSpace XtCHSpace #endif #ifndef XmCHeight #define XmCHeight XtCHeight #endif #ifndef XmCHeightInc #define XmCHeightInc XtCHeightInc #endif #ifndef XmCIconMask #define XmCIconMask XtCIconMask #endif #ifndef XmCIconName #define XmCIconName XtCIconName #endif #ifndef XmCIconNameEncoding #define XmCIconNameEncoding XtCIconNameEncoding #endif #ifndef XmCIconPixmap #define XmCIconPixmap XtCIconPixmap #endif #ifndef XmCIconWindow #define XmCIconWindow XtCIconWindow #endif #ifndef XmCIconX #define XmCIconX XtCIconX #endif #ifndef XmCIconY #define XmCIconY XtCIconY #endif #ifndef XmCIconic #define XmCIconic XtCIconic #endif #ifndef XmCIndex #define XmCIndex XtCIndex #endif #ifndef XmCInitialResourcesPersistent #define XmCInitialResourcesPersistent XtCInitialResourcesPersistent #endif #ifndef XmCInitialState #define XmCInitialState XtCInitialState #endif #ifndef XmCInput #define XmCInput XtCInput #endif #ifndef XmCInsertPosition #define XmCInsertPosition XtCInsertPosition #endif #ifndef XmCInterval #define XmCInterval XtCInterval #endif #ifndef XmCJustify #define XmCJustify XtCJustify #endif #ifndef XmCLabel #define XmCLabel XtCLabel #endif #ifndef XmCLength #define XmCLength XtCLength #endif #ifndef XmCMappedWhenManaged #define XmCMappedWhenManaged XtCMappedWhenManaged #endif #ifndef XmCMargin #define XmCMargin XtCMargin #endif #ifndef XmCMaxAspectX #define XmCMaxAspectX XtCMaxAspectX #endif #ifndef XmCMaxAspectY #define XmCMaxAspectY XtCMaxAspectY #endif #ifndef XmCMaxHeight #define XmCMaxHeight XtCMaxHeight #endif #ifndef XmCMaxWidth #define XmCMaxWidth XtCMaxWidth #endif #ifndef XmCMenuEntry #define XmCMenuEntry XtCMenuEntry #endif #ifndef XmCMinAspectX #define XmCMinAspectX XtCMinAspectX #endif #ifndef XmCMinAspectY #define XmCMinAspectY XtCMinAspectY #endif #ifndef XmCMinHeight #define XmCMinHeight XtCMinHeight #endif #ifndef XmCMinWidth #define XmCMinWidth XtCMinWidth #endif #ifndef XmCNotify #define XmCNotify XtCNotify #endif #ifndef XmCOrientation #define XmCOrientation XtCOrientation #endif #ifndef XmCOverrideRedirect #define XmCOverrideRedirect XtCOverrideRedirect #endif #ifndef XmCParameter #define XmCParameter XtCParameter #endif #ifndef XmCPixmap #define XmCPixmap XtCPixmap #endif #ifndef XmCPosition #define XmCPosition XtCPosition #endif #ifndef XmCReadOnly #define XmCReadOnly XtCReadOnly #endif #ifndef XmCResize #define XmCResize XtCResize #endif #ifndef XmCReverseVideo #define XmCReverseVideo XtCReverseVideo #endif #ifndef XmCSaveUnder #define XmCSaveUnder XtCSaveUnder #endif #ifndef XmCScreen #define XmCScreen XtCScreen #endif #ifndef XmCScrollDCursor #define XmCScrollDCursor XtCScrollDCursor #endif #ifndef XmCScrollHCursor #define XmCScrollHCursor XtCScrollHCursor #endif #ifndef XmCScrollLCursor #define XmCScrollLCursor XtCScrollLCursor #endif #ifndef XmCScrollProc #define XmCScrollProc XtCScrollProc #endif #ifndef XmCScrollRCursor #define XmCScrollRCursor XtCScrollRCursor #endif #ifndef XmCScrollUCursor #define XmCScrollUCursor XtCScrollUCursor #endif #ifndef XmCScrollVCursor #define XmCScrollVCursor XtCScrollVCursor #endif #ifndef XmCSelection #define XmCSelection XtCSelection #endif #ifndef XmCSelectionArray #define XmCSelectionArray XtCSelectionArray #endif #ifndef XmCSensitive #define XmCSensitive XtCSensitive #endif #ifndef XmCSpace #define XmCSpace XtCSpace #endif #ifndef XmCString #define XmCString XtCString #endif #ifndef XmCTextOptions #define XmCTextOptions XtCTextOptions #endif #ifndef XmCTextPosition #define XmCTextPosition XtCTextPosition #endif #ifndef XmCTextSink #define XmCTextSink XtCTextSink #endif #ifndef XmCTextSource #define XmCTextSource XtCTextSource #endif #ifndef XmCThickness #define XmCThickness XtCThickness #endif #ifndef XmCThumb #define XmCThumb XtCThumb #endif #ifndef XmCTitle #define XmCTitle XtCTitle #endif #ifndef XmCTitleEncoding #define XmCTitleEncoding XtCTitleEncoding #endif #ifndef XmCTransient #define XmCTransient XtCTransient #endif #ifndef XmCTransientFor #define XmCTransientFor XtCTransientFor #endif #ifndef XmCTranslations #define XmCTranslations XtCTranslations #endif #ifndef XmCVSpace #define XmCVSpace XtCVSpace #endif #ifndef XmCValue #define XmCValue XtCValue #endif #ifndef XmCVisual #define XmCVisual XtCVisual #endif #ifndef XmCWaitForWm #define XmCWaitForWm XtCWaitForWm #endif #ifndef XmCWidget #define XmCWidget XtRWidget #endif #ifndef XmCWidth #define XmCWidth XtCWidth #endif #ifndef XmCWidthInc #define XmCWidthInc XtCWidthInc #endif #ifndef XmCWinGravity #define XmCWinGravity XtCWinGravity #endif #ifndef XmCWindow #define XmCWindow XtCWindow #endif #ifndef XmCWindowGroup #define XmCWindowGroup XtCWindowGroup #endif #ifndef XmCWmTimeout #define XmCWmTimeout XtCWmTimeout #endif #ifndef XmCX #define XmCX XtCX #endif #ifndef XmCY #define XmCY XtCY #endif #ifndef XmNaccelerators #define XmNaccelerators XtNaccelerators #endif #ifndef XmNallowShellResize #define XmNallowShellResize XtNallowShellResize #endif #ifndef XmNancestorSensitive #define XmNancestorSensitive XtNancestorSensitive #endif #ifndef XmNargc #define XmNargc XtNargc #endif #ifndef XmNargv #define XmNargv XtNargv #endif #ifndef XmNbackground #define XmNbackground XtNbackground #endif #ifndef XmNbackgroundPixmap #define XmNbackgroundPixmap XtNbackgroundPixmap #endif #ifndef XmNbaseHeight #define XmNbaseHeight XtNbaseHeight #endif #ifndef XmNbaseHeight #define XmNbaseHeight XtNbaseHeight #endif #ifndef XmNbaseWidth #define XmNbaseWidth XtNbaseWidth #endif #ifndef XmNbaseWidth #define XmNbaseWidth XtNbaseWidth #endif #ifndef XmNbitmap #define XmNbitmap XtNbitmap #endif #ifndef XmNborder #define XmNborder XtNborder #endif #ifndef XmNborderColor #define XmNborderColor XtNborderColor #endif #ifndef XmNborderPixmap #define XmNborderPixmap XtNborderPixmap #endif #ifndef XmNborderWidth #define XmNborderWidth XtNborderWidth #endif #ifndef XmNcallback #define XmNcallback XtNcallback #endif #ifndef XmNchildren #define XmNchildren XtNchildren #endif #ifndef XmNcolormap #define XmNcolormap XtNcolormap #endif #ifndef XmNcreatePopupChildProc #define XmNcreatePopupChildProc XtNcreatePopupChildProc #endif #ifndef XmNdepth #define XmNdepth XtNdepth #endif #ifndef XmNdestroyCallback #define XmNdestroyCallback XtNdestroyCallback #endif #ifndef XmNeditType #define XmNeditType XtNeditType #endif #ifndef XmNfile #define XmNfile XtNfile #endif #ifndef XmNfont #define XmNfont XtNfont #endif #ifndef XmNfontSet #define XmNfontSet XtNfontSet #endif #ifndef XmNforceBars #define XmNforceBars XtNforceBars #endif #ifndef XmNforeground #define XmNforeground XtNforeground #endif #ifndef XmNfunction #define XmNfunction XtNfunction #endif #ifndef XmNgeometry #define XmNgeometry XtNgeometry #endif #ifndef XmNheight #define XmNheight XtNheight #endif #ifndef XmNheightInc #define XmNheightInc XtNheightInc #endif #ifndef XmNhighlight #define XmNhighlight XtNhighlight #endif #ifndef XmNiconMask #define XmNiconMask XtNiconMask #endif #ifndef XmNiconName #define XmNiconName XtNiconName #endif #ifndef XmNiconNameEncoding #define XmNiconNameEncoding XtNiconNameEncoding #endif #ifndef XmNiconPixmap #define XmNiconPixmap XtNiconPixmap #endif #ifndef XmNiconWindow #define XmNiconWindow XtNiconWindow #endif #ifndef XmNiconX #define XmNiconX XtNiconX #endif #ifndef XmNiconY #define XmNiconY XtNiconY #endif #ifndef XmNiconic #define XmNiconic XtNiconic #endif #ifndef XmNindex #define XmNindex XtNindex #endif #ifndef XmNinitialResourcesPersistent #define XmNinitialResourcesPersistent XtNinitialResourcesPersistent #endif #ifndef XmNinitialState #define XmNinitialState XtNinitialState #endif #ifndef XmNinnerHeight #define XmNinnerHeight XtNinnerHeight #endif #ifndef XmNinnerWidth #define XmNinnerWidth XtNinnerWidth #endif #ifndef XmNinnerWindow #define XmNinnerWindow XtNinnerWindow #endif #ifndef XmNinput #define XmNinput XtNinput #endif #ifndef XmNinsertPosition #define XmNinsertPosition XtNinsertPosition #endif #ifndef XmNinternalHeight #define XmNinternalHeight XtNinternalHeight #endif #ifndef XmNinternalWidth #define XmNinternalWidth XtNinternalWidth #endif #ifndef XmNjumpProc #define XmNjumpProc XtNjumpProc #endif #ifndef XmNjustify #define XmNjustify XtNjustify #endif #ifndef XmNlength #define XmNlength XtNlength #endif #ifndef XmNlowerRight #define XmNlowerRight XtNlowerRight #endif #ifndef XmNmappedWhenManaged #define XmNmappedWhenManaged XtNmappedWhenManaged #endif #ifndef XmNmaxAspectX #define XmNmaxAspectX XtNmaxAspectX #endif #ifndef XmNmaxAspectY #define XmNmaxAspectY XtNmaxAspectY #endif #ifndef XmNmaxHeight #define XmNmaxHeight XtNmaxHeight #endif #ifndef XmNmaxWidth #define XmNmaxWidth XtNmaxWidth #endif #ifndef XmNmenuEntry #define XmNmenuEntry XtNmenuEntry #endif #ifndef XmNminAspectX #define XmNminAspectX XtNminAspectX #endif #ifndef XmNminAspectY #define XmNminAspectY XtNminAspectY #endif #ifndef XmNminHeight #define XmNminHeight XtNminHeight #endif #ifndef XmNminWidth #define XmNminWidth XtNminWidth #endif #ifndef XmNname #define XmNname XtNname #endif #ifndef XmNnotify #define XmNnotify XtNnotify #endif #ifndef XmNnumChildren #define XmNnumChildren XtNnumChildren #endif #ifndef XmNorientation #define XmNorientation XtNorientation #endif #ifndef XmNoverrideRedirect #define XmNoverrideRedirect XtNoverrideRedirect #endif #ifndef XmNparameter #define XmNparameter XtNparameter #endif #ifndef XmNpixmap #define XmNpixmap XtNpixmap #endif #ifndef XmNpopdownCallback #define XmNpopdownCallback XtNpopdownCallback #endif #ifndef XmNpopupCallback #define XmNpopupCallback XtNpopupCallback #endif #ifndef XmNresize #define XmNresize XtNresize #endif #ifndef XmNreverseVideo #define XmNreverseVideo XtNreverseVideo #endif #ifndef XmNsaveUnder #define XmNsaveUnder XtNsaveUnder #endif #ifndef XmNscreen #define XmNscreen XtNscreen #endif #ifndef XmNscrollDCursor #define XmNscrollDCursor XtNscrollDCursor #endif #ifndef XmNscrollHCursor #define XmNscrollHCursor XtNscrollHCursor #endif #ifndef XmNscrollLCursor #define XmNscrollLCursor XtNscrollLCursor #endif #ifndef XmNscrollProc #define XmNscrollProc XtNscrollProc #endif #ifndef XmNscrollRCursor #define XmNscrollRCursor XtNscrollRCursor #endif #ifndef XmNscrollUCursor #define XmNscrollUCursor XtNscrollUCursor #endif #ifndef XmNscrollVCursor #define XmNscrollVCursor XtNscrollVCursor #endif #ifndef XmNselection #define XmNselection XtNselection #endif #ifndef XmNselectionArray #define XmNselectionArray XtNselectionArray #endif #ifndef XmNsensitive #define XmNsensitive XtNsensitive #endif #ifndef XmNshown #define XmNshown XtNshown #endif #ifndef XmNspace #define XmNspace XtNspace #endif #ifndef XmNstring #define XmNstring XtNstring #endif #ifndef XmNtextOptions #define XmNtextOptions XtNtextOptions #endif #ifndef XmNtextSink #define XmNtextSink XtNtextSink #endif #ifndef XmNtextSource #define XmNtextSource XtNtextSource #endif #ifndef XmNthickness #define XmNthickness XtNthickness #endif #ifndef XmNthumb #define XmNthumb XtNthumb #endif #ifndef XmNthumbProc #define XmNthumbProc XtNthumbProc #endif #ifndef XmNtitle #define XmNtitle XtNtitle #endif #ifndef XmNtitleEncoding #define XmNtitleEncoding XtNtitleEncoding #endif #ifndef XmNtop #define XmNtop XtNtop #endif #ifndef XmNtransient #define XmNtransient XtNtransient #endif #ifndef XmNtransientFor #define XmNtransientFor XtNtransientFor #endif #ifndef XmNtransientFor #define XmNtransientFor XtNtransientFor #endif #ifndef XmNtranslations #define XmNtranslations XtNtranslations #endif #ifndef XmNupdate #define XmNupdate XtNupdate #endif #ifndef XmNuseBottom #define XmNuseBottom XtNuseBottom #endif #ifndef XmNuseRight #define XmNuseRight XtNuseRight #endif #ifndef XmNvalue #define XmNvalue XtNvalue #endif #ifndef XmNvisual #define XmNvisual XtNvisual #endif #ifndef XmNwaitForWm #define XmNwaitForWm XtNwaitForWm #endif #ifndef XmNwidth #define XmNwidth XtNwidth #endif #ifndef XmNwidthInc #define XmNwidthInc XtNwidthInc #endif #ifndef XmNwinGravity #define XmNwinGravity XtNwinGravity #endif #ifndef XmNwindow #define XmNwindow XtNwindow #endif #ifndef XmNwindowGroup #define XmNwindowGroup XtNwindowGroup #endif #ifndef XmNwmTimeout #define XmNwmTimeout XtNwmTimeout #endif #ifndef XmNx #define XmNx XtNx #endif #ifndef XmNy #define XmNy XtNy #endif #ifndef XmRAcceleratorTable #define XmRAcceleratorTable XtRAcceleratorTable #endif #ifndef XmRAtom #define XmRAtom XtRAtom #endif #ifndef XmRBitmap #define XmRBitmap XtRBitmap #endif #ifndef XmRBool #define XmRBool XtRBool #endif #ifndef XmRBoolean #define XmRBoolean XtRBoolean #endif #ifndef XmRCallProc #define XmRCallProc XtRCallProc #endif #ifndef XmRCallback #define XmRCallback XtRCallback #endif #ifndef XmRCardinal #define XmRCardinal XtRCardinal #endif #ifndef XmRColor #define XmRColor XtRColor #endif #ifndef XmRColormap #define XmRColormap XtRColormap #endif #ifndef XmRCursor #define XmRCursor XtRCursor #endif #ifndef XmRDimension #define XmRDimension XtRDimension #endif #ifndef XmRDisplay #define XmRDisplay XtRDisplay #endif #ifndef XmREditMode #define XmREditMode XtREditMode #endif #ifndef XmREnum #define XmREnum XtREnum #endif #ifndef XmRFile #define XmRFile XtRFile #endif #ifndef XmRFloat #define XmRFloat XtRFloat #endif #ifndef XmRFont #define XmRFont XtRFont #endif #ifndef XmRFontSet #define XmRFontSet XtRFontSet #endif #ifndef XmRFontStruct #define XmRFontStruct XtRFontStruct #endif #ifndef XmRFunction #define XmRFunction XtRFunction #endif #ifndef XmRGeometry #define XmRGeometry XtRGeometry #endif #ifndef XmRImmediate #define XmRImmediate XtRImmediate #endif #ifndef XmRInitialState #define XmRInitialState XtRInitialState #endif #ifndef XmRInt #define XmRInt XtRInt #endif #ifndef XmRJustify #define XmRJustify XtRJustify #endif #ifndef XmRLongBoolean #define XmRLongBoolean XtRLongBoolean #endif #ifndef XmROrientation #define XmROrientation XtROrientation #endif #ifndef XmRObject #define XmRObject XtRObject #endif #ifndef XmRPixel #define XmRPixel XtRPixel #endif #ifndef XmRPixmap #define XmRPixmap XtRPixmap #endif #ifndef XmRPointer #define XmRPointer XtRPointer #endif #ifndef XmRPosition #define XmRPosition XtRPosition #endif #ifndef XmRScreen #define XmRScreen XtRScreen #endif #ifndef XmRShort #define XmRShort XtRShort #endif #ifndef XmRString #define XmRString XtRString #endif #ifndef XmRStringArray #define XmRStringArray XtRStringArray #endif #ifndef XmRStringTable #define XmRStringTable XtRStringTable #endif #ifndef XmRTextPosition #define XmRTextPosition XtCTextPosition #endif #ifndef XmRTranslationTable #define XmRTranslationTable XtRTranslationTable #endif #ifndef XmRUnsignedChar #define XmRUnsignedChar XtRUnsignedChar #endif #ifndef XmRVisual #define XmRVisual XtRVisual #endif #ifndef XmRWidget #define XmRWidget XtRWidget #endif #ifndef XmRWidgetClass #define XmRWidgetClass XtRWidgetClass #endif #ifndef XmRWidgetList #define XmRWidgetList XtRWidgetList #endif #ifndef XmRWindow #define XmRWindow XtRWindow #endif #ifndef XmNtoolTipString #define XmNtoolTipString "toolTipString" #endif #ifndef XmCToolTipString #define XmCToolTipString "ToolTipString" #endif #ifndef XmNtoolTipPostDelay #define XmNtoolTipPostDelay "toolTipPostDelay" #endif #ifndef XmCToolTipPostDelay #define XmCToolTipPostDelay "ToolTipPostDelay" #endif #ifndef XmNtoolTipPostDuration #define XmNtoolTipPostDuration "toolTipPostDuration" #endif #ifndef XmCToolTipPostDuration #define XmCToolTipPostDuration "ToolTipPostDuration" #endif #ifndef XmNtoolTipEnable #define XmNtoolTipEnable "toolTipEnable" #endif #ifndef XmCToolTipEnable #define XmCToolTipEnable "ToolTipEnable" #endif #ifndef XmNanimate #define XmNanimate "animate" #endif #ifndef XmCAnimate #define XmCAnimate "Animate" #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs_h_ */ motif-2.3.8/lib/Xm/ColorObj.c0000644000175000017500000015124713145162623012607 00000000000000/* $TOG: ColorObj.c /main/19 1999/05/07 11:36:18 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #define FIX_1400 #define FIX_1181 #include "XmI.h" #include "ColorObjI.h" #include #include "CallbackI.h" #include "ColorI.h" #include "MessagesI.h" #ifdef FIX_1400 #include #endif #if defined(__cplusplus) || defined(c_plusplus) #define OBJ_CLASS(w) (((ApplicationShellWidget)(w))->application.c_class) #else #define OBJ_CLASS(w) (((ApplicationShellWidget)(w))->application.class) #endif #define WARNING1 _XmMMsgColObj_0001 #define WARNING2 _XmMMsgColObj_0002 #ifdef FIX_1400 static int trap_XCloseDisplay(Display *disp, XExtCodes *codes); #endif /** default should not be killed unless application is dying **/ externaldef (colorobj) XmColorObj _XmDefaultColorObj = NULL; externaldef (colorobj) XContext _XmColorObjCache = 0; externaldef (colorobj) Display *_XmColorObjCacheDisplay = NULL; /******** Static Function Declarations ********/ static void Destroy( Widget wid) ; static void DisplayDestroy( Widget wid, XtPointer clientData, XtPointer callData) ; static void Initialize( Widget rq, Widget nw, ArgList Args, Cardinal *numArgs) ; static void GetSelection( Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer val, unsigned long *length, int *format) ; static void UpdatePixelSet( XmPixelSet *toSet, XmPixelSet *fromSet) ; static void UpdateXrm( Colors colors, int screen, XmColorObj tmpColorObj); static void FetchPixelData(Widget w, char * value, int screen); static Boolean ColorCachePropertyExists( Display *dpy, Window SelOwner, Widget w, int screen) ; /******** End Static Function Declarations ********/ #define UNSPECIFIED_USE_MULTI_COLOR_ICONS 2 static XtResource resources[] = { { XmNprimaryColorSetId, XmCPrimaryColorSetId, XmRInt, sizeof(int), XtOffset (XmColorObj, color_obj.primary), XmRImmediate, (XtPointer) 5, }, { XmNsecondaryColorSetId, XmCSecondaryColorSetId, XmRInt, sizeof(int), XtOffset (XmColorObj, color_obj.secondary), XmRImmediate, (XtPointer) 6, }, { XmNtextColorSetId, XmCTextColorSetId, XmRInt, sizeof(int), XtOffset (XmColorObj, color_obj.text), XmRImmediate, (XtPointer) 4, }, { XmNuseTextColor, XmCUseTextColor, XmRBoolean, sizeof(Boolean), XtOffset (XmColorObj, color_obj.useText), XmRImmediate, (XtPointer) True, }, { XmNuseTextColorForList, XmCUseTextColorForList, XmRBoolean, sizeof(Boolean), XtOffset (XmColorObj, color_obj.useTextForList), XmRImmediate, (XtPointer) True, }, { XmNactiveColorSetId, XmCActiveColorSetId, XmRInt, sizeof(int), XtOffset (XmColorObj, color_obj.active), XmRImmediate, (XtPointer) 1, }, { XmNinactiveColorSetId, XmCInactiveColorSetId, XmRInt, sizeof(int), XtOffset (XmColorObj, color_obj.inactive), XmRImmediate, (XtPointer) 2, }, { XmNuseColorObj, XmCUseColorObj, XmRBoolean, sizeof(Boolean), XtOffset (XmColorObj, color_obj.useColorObj), XmRImmediate, (XtPointer) True, }, { XmNuseMask, XmCUseMask, XmRBoolean, sizeof(Boolean), XtOffset (XmColorObj, color_obj.useMask), XmRImmediate, (XtPointer) True, }, { XmNuseMultiColorIcons, XmCUseMultiColorIcons, XmRBoolean, sizeof(Boolean), XtOffset (XmColorObj, color_obj.useMultiColorIcons), XmRImmediate, (XtPointer) UNSPECIFIED_USE_MULTI_COLOR_ICONS, }, { XmNuseIconFileCache, XmCUseIconFileCache, XmRBoolean, sizeof(Boolean), XtOffset (XmColorObj, color_obj.useIconFileCache), XmRImmediate, (XtPointer) True, }, }; externaldef(xmcolorobjclassrec) XmColorObjClassRec xmColorObjClassRec = { { /* * make it a topLevelShell subclass in order to avoid * baseClass recursion. This is due to the posthook logic and * the nested created of ColorObj inside of the first appShell */ (WidgetClass)&wmShellClassRec, /* superclass */ "XmColorObj", /* class_name */ sizeof(XmColorObjRec), /* widget_size */ NULL, /* class_initialize */ NULL, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ NULL /* extension */ }, { /* composite class record */ NULL, /* geometry_manager */ NULL, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* from the shell */ NULL, /* extension record */ }, { /* shell class record */ NULL, /* extension record */ }, { /* wm shell class record */ NULL, /* extension record */ }, { /* colorObj class */ NULL, /* extension */ }, }; externaldef(xmcolorobjclass) WidgetClass xmColorObjClass = (WidgetClass)&xmColorObjClassRec; /**********************************************************************/ /** _XmColorObjCreate() - initialize_hook() from Display object... **/ /** Used to create a ColorObj. Updated to support one per **/ /** display. There will be a "default" display and ColorObj **/ /** for the client, and each new Display Object will have **/ /** a new ColorObj associated with it. This allows for **/ /** things like the dialog server (which hangs around and **/ /** runs clients as if they were seperate applications) to **/ /** utilize seperate resource databases for "pseudo-apps". **/ /** **/ /**********************************************************************/ /*ARGSUSED*/ void _XmColorObjCreate( Widget w, ArgList al, Cardinal *acPtr ) { String name, obj_class; /** don't create if in initialization of the color server **/ /** that's for dtsession itself being a motif app */ if (XtIsApplicationShell(w)) if ( strcmp(OBJ_CLASS(w), XmSCOLOR_SRV_NAME) == 0 ) { return; } /** this is really gross but it makes the resources work right **/ XtGetApplicationNameAndClass(XtDisplay(w), &name, &obj_class); _XmProcessLock(); xmColorObjClass->core_class.class_name = obj_class; _XmProcessUnlock(); XtAppCreateShell(name, obj_class, xmColorObjClass, XtDisplay(w), NULL, 0); /** set up destroy callback on display object for this ColorObj **/ XtAddCallback(w, XmNdestroyCallback, DisplayDestroy, NULL); } /**********************************************************************/ /** DisplayDestroy() **/ /** Display object is being destroyed... destroy associated **/ /** colorObj if there is one. **/ /** **/ /**********************************************************************/ /*ARGSUSED*/ static void DisplayDestroy( Widget wid, XtPointer clientData, XtPointer callData ) { XmColorObj tmpColorObj=NULL; XContext context; _XmProcessLock(); context = _XmColorObjCache; _XmProcessUnlock(); if (_XmColorObjCacheDisplay) if ( XFindContext(_XmColorObjCacheDisplay, (XID)XtDisplay(wid), context, (XPointer *)&tmpColorObj) == 0) { if (tmpColorObj) { XtDestroyWidget((Widget)tmpColorObj); } } } /**********************************************************************/ /** Destroy() **/ /** Free the data allocated for this ColorObj **/ /** **/ /**********************************************************************/ /*ARGSUSED*/ static void Destroy( Widget wid ) { XmColorObj tmpColorObj = (XmColorObj)wid; XContext context; _XmProcessLock(); context = _XmColorObjCache; _XmProcessUnlock(); if (tmpColorObj->color_obj.colors) XtFree ((char *) tmpColorObj->color_obj.colors); if (tmpColorObj->color_obj.atoms) XtFree ((char *) tmpColorObj->color_obj.atoms); if (tmpColorObj->color_obj.colorUse) XtFree ((char *) tmpColorObj->color_obj.colorUse); if (_XmColorObjCacheDisplay) XDeleteContext(_XmColorObjCacheDisplay, (XID)tmpColorObj->color_obj.display, context); _XmProcessLock(); /* we're destory the "default" color obj, which shouldn't be use anyway, set it to null. A better solution would be to look for a new default, but XmeGetPixelData is obsolete API anyway */ if (tmpColorObj == _XmDefaultColorObj) { _XmDefaultColorObj = NULL; _XmColorObjCacheDisplay = NULL; } _XmProcessUnlock(); } /**********************************************************************/ /** Initialize() **/ /** **/ /**********************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rq, /* unused */ Widget nw, ArgList Args, /* unused */ Cardinal *numArgs) /* unused */ { XmColorObj new_obj = (XmColorObj) nw ; int i, nscreens; #ifdef FIX_1181 Boolean init_first_time = False; #endif Atom tmpAtom = 0; unsigned long savetimeout = (unsigned long)-1 ; /* window id of the selection owner */ Window SelectionOwner ; int result, isNotNews ; #ifdef FIX_1400 XExtCodes *xExt; #endif /* Ideally, we'd like check if we have a visual (like TrueColor) or colormap (non default) that would invalidate the use of shared pixels.. but since the color obj is a wmShell with no parent, global to a display, there's no way to retrieve the app shell or the widget that could be using wrongly these pixels. The app with a TrueColor visual of a custom colormap must set useColorObj False in its resource file, or its GUI will go technicolor (it can also be specific about the pixel it uses) */ new_obj->color_obj.colorIsRunning = False; new_obj->color_obj.colors = NULL; new_obj->color_obj.atoms = NULL; new_obj->color_obj.colorUse = NULL; new_obj->color_obj.display = XtDisplay(new_obj); new_obj->color_obj.numScreens = nscreens = ScreenCount(new_obj->color_obj.display); /** initialize default colorObj and context if needed **/ _XmProcessLock(); if (!_XmColorObjCache) _XmColorObjCache = XUniqueContext(); #ifdef FIX_1400 if (_XmColorObjCacheDisplay == NULL) { _XmColorObjCacheDisplay = new_obj->color_obj.display; xExt = XAddExtension(_XmColorObjCacheDisplay); XESetCloseDisplay(_XmColorObjCacheDisplay, xExt->extension, trap_XCloseDisplay); } #else if (_XmColorObjCacheDisplay == NULL) _XmColorObjCacheDisplay = new_obj->color_obj.display; #endif if (_XmDefaultColorObj == NULL) _XmDefaultColorObj = new_obj; /** add new colorObj to the cache **/ XSaveContext(_XmColorObjCacheDisplay, (XID)new_obj->color_obj.display, _XmColorObjCache, (XPointer)new_obj); _XmProcessUnlock(); /** if useColorObj = False, don't initialize or allocate color data **/ if (new_obj->color_obj.useColorObj) { /** get screen info and allocate space for colors per screen **/ new_obj->color_obj.colors = (Colors *)XtCalloc(nscreens, sizeof(Colors)); new_obj->color_obj.atoms = (Atom *)XtCalloc(nscreens, sizeof(Atom)); new_obj->color_obj.colorUse = (int *)XtCalloc(nscreens, sizeof(int)); if ( !new_obj->color_obj.colors || !new_obj->color_obj.atoms || !new_obj->color_obj.colorUse ) { XmeWarning(nw, WARNING1); /* couldn't allocate memory */ new_obj->color_obj.colorIsRunning = False; return; } /** set screen and color info for this application **/ new_obj->color_obj.myScreen = XScreenNumberOfScreen(XtScreen(new_obj)); new_obj->color_obj.myColors = new_obj->color_obj.colors[new_obj->color_obj.myScreen]; /* check valid value, then -1 from colors, to index arrays */ if (new_obj->color_obj.primary < 1 || new_obj->color_obj.primary > XmCO_NUM_COLORS) new_obj->color_obj.primary = 1; if (new_obj->color_obj.secondary < 1 || new_obj->color_obj.secondary > XmCO_NUM_COLORS) new_obj->color_obj.secondary = 1; if (new_obj->color_obj.active < 1 || new_obj->color_obj.active > XmCO_NUM_COLORS) new_obj->color_obj.active = 1; if (new_obj->color_obj.inactive < 1 || new_obj->color_obj.inactive > XmCO_NUM_COLORS) new_obj->color_obj.inactive = 1; if (new_obj->color_obj.text < 1 || new_obj->color_obj.text > XmCO_NUM_COLORS) new_obj->color_obj.text = 1; new_obj->color_obj.primary = new_obj->color_obj.primary - 1; new_obj->color_obj.secondary = new_obj->color_obj.secondary - 1; new_obj->color_obj.active = new_obj->color_obj.active - 1; new_obj->color_obj.inactive = new_obj->color_obj.inactive - 1; new_obj->color_obj.text = new_obj->color_obj.text - 1; /* we're going to realize it */ new_obj->core.mapped_when_managed = False; new_obj->core.width = 1; new_obj->core.height = 1; /***** * Since dtsession's idea of the PIXEL_SET is pretty much constant * it makes more sense to have a permanent property in the * server that stored the information. This means that the * starting application can get the PIXEL_SET directly from * the server without ever waking up dtsession. * * Obviously you have to consider the case where you aren't * talking to a dtsession that knows to put the PIXEL_SET * in the server, so everything falls back to the old way * on failure. */ /* a bug in this server makes us do that - pretty lame... */ isNotNews = strcmp(ServerVendor(XtDisplay(nw)), "X11/NeWS - Sun Microsystems Inc."); /* Intern all the atoms in a single round-trip. */ if (nscreens > 0) { #define MAX_SCREENS 10 #define MAX_ATOM_LENGTH 24 char buf[MAX_SCREENS * MAX_ATOM_LENGTH]; char *name_buf[MAX_SCREENS]; char **names; names = (char**) XmStackAlloc(nscreens * sizeof(char *), name_buf); for (i = 0; i < nscreens; i++) { names[i] = ((nscreens <= MAX_SCREENS) ? &buf[i * MAX_ATOM_LENGTH] : XtMalloc(MAX_ATOM_LENGTH)); sprintf(names[i], "%s%d", XmSCUSTOMIZE_DATA, i); } XInternAtoms(new_obj->color_obj.display, names, nscreens, FALSE, new_obj->color_obj.atoms); if (nscreens > MAX_SCREENS) for (i = 0; i < nscreens; i++) XtFree(names[i]); XmStackFree((char*) names, name_buf); #undef MAX_SCREENS #undef MAX_ATOM_LENGTH } for (i = 0; i < nscreens; i++) { /* if noone has created this one, no need to continue */ if (new_obj->color_obj.atoms[i] == None) break ; /* Get XID of selection owner: dtsession most probably */ SelectionOwner = XGetSelectionOwner(XtDisplay(nw), new_obj->color_obj.atoms[i]) ; if (isNotNews || SelectionOwner) { /* check if color cache properties have been hung as property on selection owner window. If so, get them. */ result = ColorCachePropertyExists(XtDisplay(nw), SelectionOwner, nw, i); if ( ! result ) { /* * we have to fall back to the selection way. * * We need the window created in the server * so that dtsession can attach the pixel set * property to it for us. */ /* certain thing we have to do only once for all screens */ #ifdef FIX_1181 if (init_first_time == False) { init_first_time = True; #else if (i == 0) { #endif if(!XtIsRealized((Widget) new_obj)) XtRealizeWidget((Widget) new_obj); tmpAtom = XInternAtom(new_obj->color_obj.display, XmSPIXEL_SET, True); /* if noone has created this one, no need to go on */ if (tmpAtom == None) break ; /* Remember the original timeout */ savetimeout = XtAppGetSelectionTimeout( XtWidgetToApplicationContext(nw)); /** set the selection timeout to 900 seconds **/ XtAppSetSelectionTimeout( XtWidgetToApplicationContext(nw), (unsigned long)900000); } new_obj->color_obj.done = FALSE; XtGetSelectionValue((Widget) new_obj, new_obj->color_obj.atoms[i], tmpAtom, GetSelection, (XtPointer) 1, CurrentTime); /* wait for the reply : GetSelection will be called where color_obj.done is set */ while(new_obj->color_obj.done == FALSE) XtAppProcessEvent (XtWidgetToApplicationContext((Widget) new_obj), XtIMAll); if (!new_obj->color_obj.colorIsRunning) break; /* don't bother with rest of screen */ } } } if (savetimeout != -1) /* Restore the timeout if we had changed it */ XtAppSetSelectionTimeout(XtWidgetToApplicationContext(nw), savetimeout); } if (new_obj->color_obj.useMultiColorIcons == UNSPECIFIED_USE_MULTI_COLOR_ICONS) { if (new_obj->color_obj.colorUse) { if (new_obj->color_obj.colorUse[0] == XmCO_HIGH_COLOR || new_obj->color_obj.colorUse[0] == XmCO_MEDIUM_COLOR) { new_obj->color_obj.useMultiColorIcons = True; } else new_obj->color_obj.useMultiColorIcons = False; } else /* no color server ??? */ new_obj->color_obj.useMultiColorIcons = False; } } static void FetchPixelData(Widget w, char * value, int screen) { int i, count, colorUse; char tmp[256]; XmColorObj tmpColorObj = (XmColorObj)w; Colors colors; /* read color use */ count = 0; sscanf (&(value[count]), "%x_", &colorUse); sprintf(tmp, "%x_", colorUse); count += strlen(tmp); tmpColorObj->color_obj.colorUse[screen] = colorUse; for (i = 0; i < XmCO_NUM_COLORS; i++) { /* read data into PixelSet */ sscanf (&(value[count]), "%lx_%lx_%lx_%lx_%lx_", &(colors[i].bg), &(colors[i].fg), &(colors[i].ts), &(colors[i].bs), &(colors[i].sc)); sprintf(tmp,"%lx_%lx_%lx_%lx_%lx_", colors[i].bg, colors[i].fg, colors[i].ts, colors[i].bs, colors[i].sc); count += strlen(tmp); } UpdateXrm (colors, screen, tmpColorObj); tmpColorObj->color_obj.colorIsRunning = True; XFree (value); } static Boolean ColorCachePropertyExists( Display *dpy, Window SelOwner, Widget w, int screen) { Atom pixel_set_atom ; unsigned long bytesafter, length; char *value = NULL ; int format = 0 ; Atom target; int result = False ; Colors colors; if (!SelOwner) return False ; /* try to get the property if it exist only */ if ((pixel_set_atom = XInternAtom(dpy, XmSPIXEL_SET_PROP, TRUE)) == None) return False ; /* get the content of the property */ result = XGetWindowProperty(dpy, SelOwner, pixel_set_atom, 0L, 1000000, False, (Atom)AnyPropertyType, &target, &format, &length, &bytesafter, (unsigned char **) &value); if ((result != Success) || (format == 0) || (target == None)) return False ; if (value != NULL) { if (value[length - 1] != XmPIXEL_SET_PROP_VERSION) return False ; value[length - 1] = 0 ; /* extract version info */ FetchPixelData(w, value, screen); } return True ; } /**********************************************************************/ /** GetSelection() **/ /** colorIsRunning = False on entry, gets set to True if **/ /** color info successfully read in. **/ /** **/ /**********************************************************************/ /*ARGSUSED*/ static void GetSelection( Widget w, XtPointer client_data, /* unused */ Atom *selection, Atom *type, /* unused */ XtPointer val, unsigned long *length, /* unused */ int *format ) /* unused */ { XmColorObj tmpColorObj = (XmColorObj)w; char * value = (char*) val ; int i, screen; tmpColorObj->color_obj.done = TRUE; /** get screen number **/ screen = -1; for (i = 0; i < tmpColorObj->color_obj.numScreens; i++) { if (*selection == tmpColorObj->color_obj.atoms[i]) { screen = i; break; } } if (screen == -1) { XmeWarning( w, WARNING2); /* bad screen number */ return; } if (value != NULL) { FetchPixelData(w, value, screen); } } /**********************************************************************/ /** UpdatePixelSet() **/ /** just a convenience routine **/ /**********************************************************************/ static void UpdatePixelSet( XmPixelSet *toSet, XmPixelSet *fromSet ) { toSet->bg = fromSet->bg; toSet->fg = fromSet->fg; toSet->ts = fromSet->ts; toSet->bs = fromSet->bs; toSet->sc = fromSet->sc; } /**********************************************************************/ /** UpdateColorCache() **/ /** so that widget created in this process gets the correct pixels **/ /**********************************************************************/ static void UpdateColorCache (Screen * screen, Colormap colormap, XmPixelSet * pset) { XmColorData cacheRec; /** add this color to the Motif color cache **/ cacheRec.screen = screen; cacheRec.color_map = colormap; cacheRec.background.pixel = pset->bg; cacheRec.foreground.pixel = pset->fg; cacheRec.top_shadow.pixel = pset->ts; cacheRec.bottom_shadow.pixel = pset->bs; cacheRec.select.pixel = pset->sc; cacheRec.allocated = XmBACKGROUND | XmFOREGROUND | XmTOP_SHADOW | XmBOTTOM_SHADOW | XmSELECT; _XmAddToColorCache (&cacheRec); } /**********************************************************************/ /** UpdateXrm() **/ /** **/ /**********************************************************************/ static void UpdateXrm( Colors colors, int screen , XmColorObj tmpColorObj) { XrmDatabase db; XrmValue value; int i; int doList; /** update the internal color information **/ for (i = 0; i < XmCO_NUM_COLORS; i++) UpdatePixelSet (&(tmpColorObj->color_obj.colors[screen][i]),&colors[i]); /** if this is not the application screen, do not update the database **/ if (screen != tmpColorObj->color_obj.myScreen) return; /** update the color cache in motif with primary and secondary **/ UpdateColorCache (XtScreen(tmpColorObj), DefaultColormapOfScreen(XtScreen(tmpColorObj)), &(colors[tmpColorObj->color_obj.primary])); UpdateColorCache (XtScreen(tmpColorObj), DefaultColormapOfScreen(XtScreen(tmpColorObj)), &(colors[tmpColorObj->color_obj.secondary])); db = XtScreenDatabase(XtScreen(tmpColorObj)); /** update the clients database with new colors **/ value.size = sizeof(Pixel); /** update the highlight color information to use the active color - bg **/ value.addr = (char*) &(colors[tmpColorObj->color_obj.active].bg); XrmPutResource (&db, "*highlightColor", "Pixel", &value); /** update the primary color set information **/ i = tmpColorObj->color_obj.primary; value.addr = (char*) &(colors[i].bg); XrmPutResource (&db, "*background", "Pixel", &value); /* * keep foreground for athena widgets and 2.0 compatability. * DONT write out the other dependent colors in order to allow motif * to generate them. */ value.addr = (char*) &(colors[i].fg); XrmPutResource (&db, "*foreground", "Pixel", &value); if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, screen, &colors[i])) XrmPutStringResource (&db, "*topShadowPixmap", XmCO_DITHER); else XrmPutStringResource (&db, "*topShadowPixmap", XmCO_NO_DITHER); if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, screen, &colors[i])) XrmPutStringResource (&db, "*bottomShadowPixmap", XmCO_DITHER); /** update the secondary color set information **/ i = tmpColorObj->color_obj.secondary; value.addr = (char*) &(colors[i].bg); XrmPutResource (&db, "*XmDialogShell*background", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*background", "Pixel",&value); XrmPutResource (&db, "*XmCascadeButton*background", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*background", "Pixel", &value); /* * keep foreground for athena widgets and 2.0 compatability. * DONT write out the other dependent colors in order to allow motif * to generate them. */ value.addr = (char*) &(colors[i].fg); XrmPutResource (&db, "*XmDialogShell*foreground", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*foreground", "Pixel",&value); XrmPutResource (&db, "*XmCascadeButton*foreground", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*foreground", "Pixel", &value); if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, screen, &colors[i])) { XrmPutStringResource (&db, "*XmDialogShell*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db,"*XmCascadeButtonGadget*topShadowPixmap", XmCO_DITHER); } else if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, screen, &(colors[tmpColorObj->color_obj.primary]))) { XrmPutStringResource (&db, "*XmDialogShell*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db,"*XmCascadeButtonGadget*topShadowPixmap", XmCO_NO_DITHER); } if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, screen, &colors[i])) { XrmPutStringResource (&db, "*XmDialogShell*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*bottomShadowPixmap", XmCO_DITHER); } else if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, screen, &(colors[tmpColorObj->color_obj.primary]))) { XrmPutStringResource (&db, "*XmDialogShell*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*bottomShadowPixmap", XmCO_NO_DITHER); } /** set all of the text areas to the textColorSetId **/ /** continue to write fg for backward compatibility **/ if ( !tmpColorObj->color_obj.useText ) return; doList = tmpColorObj->color_obj.useTextForList; /** add this color to the Motif color cache **/ UpdateColorCache (XtScreen(tmpColorObj), DefaultColormapOfScreen(XtScreen(tmpColorObj)), &(colors[tmpColorObj->color_obj.text])); /** set for text color areas **/ i = tmpColorObj->color_obj.text; value.addr = (char*) &(colors[i].bg); XrmPutResource (&db, "*XmText*background", "Pixel", &value); XrmPutResource (&db, "*XmTextField*background", "Pixel", &value); XrmPutResource (&db, "*DtTerm*background", "Pixel", &value); if (doList) XrmPutResource (&db, "*XmList*background", "Pixel", &value); value.addr = (char*) &(colors[i].fg); XrmPutResource (&db, "*XmText*foreground", "Pixel", &value); XrmPutResource (&db, "*XmTextField*foreground", "Pixel", &value); XrmPutResource (&db, "*DtTerm*foreground", "Pixel", &value); if (doList) XrmPutResource (&db, "*XmList*foreground", "Pixel", &value); /** set for all secondary color areas **/ value.addr = (char*) &(colors[i].bg); /* do background first */ XrmPutResource (&db, "*XmDialogShell*XmText*background", "Pixel", &value); XrmPutResource (&db, "*XmDialogShell*XmTextField*background", "Pixel", &value); XrmPutResource (&db, "*XmDialogShell*DtTerm*background", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*XmText*background", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*XmTextField*background", "Pixel",&value); XrmPutResource (&db, "*XmMenuShell*DtTerm*background", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButton*XmText*background", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButton*XmTextField*background", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButton*DtTerm*background", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*XmText*background", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*XmTextField*background", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*DtTerm*background", "Pixel", &value); if (doList) { XrmPutResource (&db, "*XmDialogShell*XmList*background", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*XmList*background", "Pixel", &value); } value.addr = (char*) &(colors[i].fg); /* now do foreground */ XrmPutResource (&db, "*XmDialogShell*XmText*foreground", "Pixel", &value); XrmPutResource (&db, "*XmDialogShell*XmTextField*foreground", "Pixel", &value); XrmPutResource (&db, "*XmDialogShell*DtTerm*foreground", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*XmText*foreground", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*XmTextField*foreground", "Pixel",&value); XrmPutResource (&db, "*XmMenuShell*DtTerm*foreground", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButton*XmText*foreground", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButton*XmTextField*foreground", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButton*DtTerm*foreground", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*XmText*foreground", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*XmTextField*foreground", "Pixel", &value); XrmPutResource (&db, "*XmCascadeButtonGadget*DtTerm*foreground", "Pixel", &value); if (doList) { XrmPutResource (&db, "*XmDialogShell*XmList*foreground", "Pixel", &value); XrmPutResource (&db, "*XmMenuShell*XmList*foreground", "Pixel", &value); } /** dither (or "undither") top shadow if needed **/ if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, screen, &colors[i])) { XrmPutStringResource (&db, "*XmText*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmTextField*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*DtTerm*topShadowPixmap", XmCO_DITHER); if (doList) XrmPutStringResource (&db, "*XmList*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*XmText*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*XmTextField*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*DtTerm*topShadowPixmap", XmCO_DITHER); if (doList) XrmPutStringResource (&db, "*XmDialogShell*XmList*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*XmText*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*XmTextField*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*DtTerm*topShadowPixmap", XmCO_DITHER); if (doList) XrmPutStringResource (&db, "*XmMenuShell*XmList*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmText*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmTextField*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*DtTerm*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmText*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmTextField*topShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*DtTerm*topShadowPixmap", XmCO_DITHER); } else /** undo dithers set for primary and secondary if needed **/ { if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, screen, &(colors[tmpColorObj->color_obj.primary]))) { XrmPutStringResource (&db, "*XmText*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmTextField*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*DtTerm*topShadowPixmap", XmCO_NO_DITHER); if (doList) XrmPutStringResource (&db, "*XmList*topShadowPixmap", XmCO_NO_DITHER); } if (XmCO_DitherTopShadow(tmpColorObj->color_obj.display, screen, &(colors[tmpColorObj->color_obj.secondary]))) { XrmPutStringResource (&db, "*XmDialogShell*XmText*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*XmTextField*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*DtTerm*topShadowPixmap", XmCO_NO_DITHER); if (doList) XrmPutStringResource (&db, "*XmDialogShell*XmList*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*XmText*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*XmTextField*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*DtTerm*topShadowPixmap", XmCO_NO_DITHER); if (doList) XrmPutStringResource (&db, "*XmMenuShell*XmList*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmText*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmTextField*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*DtTerm*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmText*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmTextField*topShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*DtTerm*topShadowPixmap", XmCO_NO_DITHER); } } /** dither (or "undither") bottom shadow if needed **/ if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, screen, &colors[i])) { XrmPutStringResource (&db, "*XmText*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmTextField*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*DtTerm*bottomShadowPixmap", XmCO_DITHER); if (doList) XrmPutStringResource (&db, "*XmList*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*XmText*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*XmTextField*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*DtTerm*bottomShadowPixmap", XmCO_DITHER); if (doList) XrmPutStringResource (&db, "*XmDialogShell*XmList*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*XmText*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db,"*XmMenuShell*XmTextField*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*DtTerm*bottomShadowPixmap", XmCO_DITHER); if (doList) XrmPutStringResource (&db, "*XmMenuShell*XmList*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmText*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmTextField*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*DtTerm*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmText*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmTextField*bottomShadowPixmap", XmCO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*DtTerm*bottomShadowPixmap", XmCO_DITHER); } else /** undo dithers set for primary and secondary if needed **/ { if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, screen, &(colors[tmpColorObj->color_obj.primary]))) { XrmPutStringResource (&db, "*XmText*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmTextField*bottomShadowPixmap",XmCO_NO_DITHER); XrmPutStringResource (&db, "*DtTerm*bottomShadowPixmap", XmCO_NO_DITHER); if (doList) XrmPutStringResource (&db, "*XmList*bottomShadowPixmap", XmCO_NO_DITHER); } if (XmCO_DitherBottomShadow(tmpColorObj->color_obj.display, screen, &(colors[tmpColorObj->color_obj.secondary]))) { XrmPutStringResource (&db, "*XmDialogShell*XmText*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*XmTextField*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmDialogShell*DtTerm*bottomShadowPixmap", XmCO_NO_DITHER); if (doList) XrmPutStringResource (&db, "*XmDialogShell*XmList*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*XmText*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db,"*XmMenuShell*XmTextField*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmMenuShell*DtTerm*bottomShadowPixmap", XmCO_NO_DITHER); if (doList) XrmPutStringResource (&db, "*XmMenuShell*XmList*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmText*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*XmTextField*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButton*DtTerm*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmText*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*XmTextField*bottomShadowPixmap", XmCO_NO_DITHER); XrmPutStringResource (&db, "*XmCascadeButtonGadget*DtTerm*bottomShadowPixmap", XmCO_NO_DITHER); } } } /**********************************************************************/ /** XmeGetIconControlInfo **/ /** Get information needed for XmpGetIconFileName **/ /**********************************************************************/ /*ARGSUSED*/ Boolean XmeGetIconControlInfo( Screen *screen, /* unused */ Boolean *useMaskRtn, Boolean *useMultiColorIconsRtn, Boolean *useIconFileCacheRtn) { XmColorObj tmpColorObj = _XmDefaultColorObj; _XmProcessLock(); /* return False if color srv is not running, or color obj not used */ if (!tmpColorObj || !tmpColorObj->color_obj.colorIsRunning || !tmpColorObj->color_obj.useColorObj) { *useMaskRtn = *useMultiColorIconsRtn = *useIconFileCacheRtn = True ; _XmProcessUnlock(); return False; } *useMaskRtn = tmpColorObj->color_obj.useMask; *useMultiColorIconsRtn = tmpColorObj->color_obj.useMultiColorIcons; *useIconFileCacheRtn = tmpColorObj->color_obj.useIconFileCache; _XmProcessUnlock(); return True; } /**********************************************************************/ /** XmeGetColorObjData() **/ /** pixelSet should be an array of num_pixelSet entries **/ /** Contrary to XmeGetPixelData, use the correct display **/ /** **/ /** for instance, to access the primary background, use primary_background = pixelSet[primary_id].bg ; */ /**********************************************************************/ Boolean XmeGetColorObjData(Screen * screen, int *colorUse, XmPixelSet *pixelSet, unsigned short num_pixelSet, short *active_id, short *inactive_id, short *primary_id, short *secondary_id, short *text_id) { XmColorObj tmpColorObj ; int screen_num, k ; /* find the color obj for this screen's display */ if ((!_XmColorObjCacheDisplay) || (XFindContext(_XmColorObjCacheDisplay, (XID)XDisplayOfScreen(screen), _XmColorObjCache, (XPointer *)&tmpColorObj) != 0)) { /* no color obj for this display */ return False ; } /* return False if color srv is not running, or color obj not used */ _XmProcessLock(); if (!tmpColorObj || !tmpColorObj->color_obj.useColorObj || !tmpColorObj->color_obj.colorIsRunning) { _XmProcessUnlock(); return False; } screen_num = XScreenNumberOfScreen(screen) ; /* return False if screen invalid */ if (screen_num >= tmpColorObj->color_obj.numScreens) { _XmProcessUnlock(); return False; } if (colorUse) *colorUse = tmpColorObj->color_obj.colorUse[screen_num]; for (k = 0; k < num_pixelSet; k++) { pixelSet[k].fg = tmpColorObj->color_obj.colors[screen_num][k].fg; pixelSet[k].bg = tmpColorObj->color_obj.colors[screen_num][k].bg; pixelSet[k].ts = tmpColorObj->color_obj.colors[screen_num][k].ts; pixelSet[k].bs = tmpColorObj->color_obj.colors[screen_num][k].bs; pixelSet[k].sc = tmpColorObj->color_obj.colors[screen_num][k].sc; } if (active_id) *active_id = (short)tmpColorObj->color_obj.active; if (inactive_id) *inactive_id = (short)tmpColorObj->color_obj.inactive; if (primary_id) *primary_id = (short)tmpColorObj->color_obj.primary; if (secondary_id) *secondary_id = (short)tmpColorObj->color_obj.secondary; if (text_id) *text_id = (short)tmpColorObj->color_obj.text; _XmProcessUnlock(); return True; } /**********************************************************************/ /** XmeGetPixelData() **/ /** pixelSet should be an array of XmCO_NUM_COLORS **/ /** XmPixelSets, ie. XmPixelSet pixelSet[XmCO_NUM_COLORS]; **/ /** **/ /** Obsolete: doesn't always use the correct display in a multi display app... */ /**********************************************************************/ Boolean XmeGetPixelData( int screen_number, int *colorUse, XmPixelSet *pixelSet, short *a, short *i, short *p, short *s ) { Display * display ; _XmProcessLock(); if (_XmDefaultColorObj) display = XtDisplay(_XmDefaultColorObj) ; else return False ; _XmProcessUnlock(); return XmeGetColorObjData(XScreenOfDisplay(display, screen_number), colorUse, pixelSet, XmCO_NUM_COLORS, a, i, p, s, NULL); } static Boolean NotBW(Screen* screen, Pixel pixel) { return ((pixel != BlackPixel(DisplayOfScreen(screen), XScreenNumberOfScreen(screen))) && (pixel != WhitePixel(DisplayOfScreen(screen), XScreenNumberOfScreen(screen)))); } static Boolean DupPixel(Pixel pixel, XColor * colors, int up_to) { int i ; for (i=0; i < up_to; i++) if (colors[i].pixel == pixel) return True; return False ; } /* std CDE desktop icon colors */ static String IconColorNames[] = { "black", "white", "red", "green", "blue", "yellow", "cyan", "magenta", "#dededededede", "#bdbdbdbdbdbd", "#adadadadadad", "#949494949494", "#737373737373", "#636363636363", "#424242424242", "#212121212121" }; /**********************************************************************/ /** XmeGetDesktopColorCells **/ /** Get information needed for application using private colormap **/ /**********************************************************************/ Boolean XmeGetDesktopColorCells (Screen * screen, Colormap colormap, /* to update the color cache */ XColor * colors, /* allocated by the caller */ int n_colors, /* size available */ int * ncolors_returns) /* <= max_color */ { int colorUse ; XmPixelSet pixelSet[XmCO_NUM_COLORS] ; int i, k, num_icon_colors ; short primary, secondary, text, active, inactive; int reorder[XmCO_NUM_COLORS] ; if (!colors || !n_colors) return False ; /* get the pixel out of the color obj for this screen */ if (!(XmeGetColorObjData(screen, &colorUse, pixelSet, XmCO_NUM_COLORS, &active, &inactive, &primary, &secondary, &text))) return False ; /* now get the pixel in the XColor colors array, if any */ if (colorUse == XmCO_BLACK_WHITE) return False ; /* only report pixels if not black or white, which is what ts and bs are when usePixmap is On or fg is when dynamicForeground is off */ /* try also to be smart about not returning duplicate pixel id by comparing to what's already there each time, even if that's a little bit expensive */ #define OKPixel(pixel) (\ NotBW(screen, pixel) && !DupPixel(pixel, colors, i)) i = 0 ; /* start with foreground are background for all palettes. These are the most important pixels by far. let's even reorder them as we go to get more important palette first: primary, secondary, text, active, inactive, frontpanel, wsbuttons */ reorder[0] = primary ; reorder[1] = secondary; reorder[2] = text; reorder[3] = active; reorder[4] = inactive; reorder[5] = 7; reorder[6] = 2; reorder[7] = 6; for (k = 0; k < XmCO_NUM_COLORS; k++) { /* update the color cache for the pixels used in widgets */ if (reorder[k] == primary || reorder[k] == secondary || reorder[k] == text) { UpdateColorCache(screen, colormap, &(pixelSet[reorder[k]])); } if (OKPixel(pixelSet[reorder[k]].fg)) { colors[i++].pixel = pixelSet[reorder[k]].fg ; if (i == n_colors) break ; } if (OKPixel(pixelSet[reorder[k]].bg)) { colors[i++].pixel = pixelSet[reorder[k]].bg ; if (i == n_colors) break ; } } /* now the select color for primary and secondary: where select stuff can be */ if (OKPixel(pixelSet[primary].sc)) { if (i < n_colors) colors[i++].pixel = pixelSet[primary].sc ; } if (OKPixel(pixelSet[secondary].sc)) { if (i < n_colors) colors[i++].pixel = pixelSet[secondary].sc ; } /* here we insert the icon pixels: just black and white for low color mode, or the 16 colors for high and medium */ if (colorUse == XmCO_HIGH_COLOR || colorUse == XmCO_MEDIUM_COLOR) num_icon_colors = 16 ; else num_icon_colors = 2 ; for(k=0; k #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Manager.c /main/22 1999/01/27 16:07:30 mgreess $" #endif #endif #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CareVisualTI.h" #include "ColorI.h" #include "DisplayP.h" #include "GadgetI.h" #include "GadgetUtiI.h" #include "ImageCachI.h" #include "ManagerI.h" #include "MessagesI.h" #include "PixConvI.h" #include "RepTypeI.h" #include "ResConverI.h" #include "ResIndI.h" #include "SyntheticI.h" #include "TraitI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "XmI.h" #define MESSAGE1 _XmMMsgManager_0000 #define MESSAGE2 _XmMMsgManager_0001 /******** Static Function Declarations ********/ static void GetXFromShell( Widget wid, int resource_offset, XtArgVal *value) ; static void GetYFromShell( Widget wid, int resource_offset, XtArgVal *value) ; static void ClassInitialize( void ) ; static CompositeClassExtension FindCompClassExtension( WidgetClass widget_class) ; static void BuildManagerResources( WidgetClass c) ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) ; static void Destroy( Widget w) ; static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void InsertChild( Widget child) ; static void DeleteChild( Widget child) ; static void ManagerMotion( Widget wid, XtPointer closure, XEvent *event, Boolean *cont) ; static void ManagerEnter( Widget wid, XtPointer closure, XEvent *event, Boolean *cont) ; static void ManagerLeave( Widget wid, XtPointer closure, XEvent *event, Boolean *cont) ; static void AddMotionHandlers( XmManagerWidget mw) ; static void ConstraintInitialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void CheckRemoveMotionHandlers( XmManagerWidget mw) ; static void ConstraintDestroy( Widget w) ; static Boolean ConstraintSetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean ManagerParentProcess( Widget widget, XmParentProcessData data) ; static XmNavigability WidgetNavigable( Widget wid) ; static Widget ObjectAtPoint( Widget wid, Position x, Position y); static XmDirection GetDirection(Widget); static void GetColors(Widget widget, XmAccessColorData color_data); static unsigned char GetUnitType(Widget); /******** End Static Function Declarations ********/ /***********************************/ /* Default actions for XmManager */ static XtActionsRec actions[] = { { "ManagerGadgetTraverseCurrent", _XmGadgetTraverseCurrent }, { "ManagerEnter", _XmManagerEnter }, { "ManagerLeave", _XmManagerLeave }, { "ManagerFocusIn", _XmManagerFocusIn }, { "ManagerFocusOut", _XmManagerFocusOut }, { "ManagerGadgetPrevTabGroup", _XmGadgetTraversePrevTabGroup}, { "ManagerGadgetNextTabGroup", _XmGadgetTraverseNextTabGroup}, { "ManagerGadgetTraversePrev", _XmGadgetTraversePrev }, { "ManagerGadgetTraverseNext", _XmGadgetTraverseNext }, { "ManagerGadgetTraverseLeft", _XmGadgetTraverseLeft }, { "ManagerGadgetTraverseRight", _XmGadgetTraverseRight }, { "ManagerGadgetTraverseUp", _XmGadgetTraverseUp }, { "ManagerGadgetTraverseDown", _XmGadgetTraverseDown }, { "ManagerGadgetTraverseHome", _XmGadgetTraverseHome }, { "ManagerGadgetSelect", _XmGadgetSelect }, { "ManagerParentActivate", _XmManagerParentActivate }, { "ManagerParentCancel", _XmManagerParentCancel }, { "ManagerGadgetButtonMotion", _XmGadgetButtonMotion }, { "ManagerGadgetKeyInput", _XmGadgetKeyInput }, { "ManagerGadgetHelp", _XmManagerHelp }, { "ManagerGadgetArm", _XmGadgetArm }, { "ManagerGadgetDrag", _XmGadgetDrag }, { "ManagerGadgetActivate", _XmGadgetActivate }, { "ManagerGadgetMultiArm", _XmGadgetMultiArm }, { "ManagerGadgetMultiActivate", _XmGadgetMultiActivate }, { "Enter", _XmManagerEnter }, /* Motif 1.0 BC. */ { "FocusIn", _XmManagerFocusIn }, /* Motif 1.0 BC. */ { "Help", _XmManagerHelp }, /* Motif 1.0 BC. */ { "Arm", _XmGadgetArm }, /* Motif 1.0 BC. */ { "Activate", _XmGadgetActivate }, /* Motif 1.0 BC. */ }; /****************************************/ /* Resource definitions for XmManager */ static XtResource resources[] = { { XmNunitType, XmCUnitType, XmRUnitType, sizeof (unsigned char), XtOffsetOf(XmManagerRec, manager.unit_type), XmRCallProc, (XtPointer) _XmUnitTypeDefault }, { XmNx, XmCPosition, XmRHorizontalPosition, sizeof(Position), XtOffsetOf(WidgetRec, core.x), XmRImmediate, (XtPointer) 0 }, { XmNy, XmCPosition, XmRVerticalPosition, sizeof(Position), XtOffsetOf(WidgetRec, core.y), XmRImmediate, (XtPointer) 0 }, { XmNwidth, XmCDimension, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.width), XmRImmediate, (XtPointer) 0 }, { XmNheight, XmCDimension, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.height), XmRImmediate, (XtPointer) 0 }, { XmNborderWidth, XmCBorderWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.border_width), XmRImmediate, (XtPointer) 0 }, { XmNforeground, XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf(XmManagerRec, manager.foreground), XmRCallProc, (XtPointer) _XmForegroundColorDefault }, { XmNbackground, XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf(WidgetRec, core.background_pixel), XmRCallProc, (XtPointer) _XmBackgroundColorDefault }, { XmNbackgroundPixmap, XmCPixmap, XmRPixmap, sizeof (Pixmap), XtOffsetOf(WidgetRec, core.background_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNhighlightColor, XmCHighlightColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmManagerRec, manager.highlight_color), XmRCallProc, (XtPointer) _XmHighlightColorDefault }, { XmNhighlightPixmap, XmCHighlightPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(XmManagerRec, manager.highlight_pixmap), XmRCallProc, (XtPointer) _XmHighlightPixmapDefault }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf(XmManagerRec, manager.navigation_type), XmRImmediate, (XtPointer) XmTAB_GROUP, }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmManagerRec, manager.shadow_thickness), XmRImmediate, (XtPointer) 0 }, { XmNtopShadowColor, XmCTopShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmManagerRec, manager.top_shadow_color), XmRCallProc, (XtPointer) _XmTopShadowColorDefault }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(XmManagerRec, manager.top_shadow_pixmap), XmRCallProc, (XtPointer) _XmTopShadowPixmapDefault }, { XmNbottomShadowColor, XmCBottomShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(XmManagerRec, manager.bottom_shadow_color), XmRCallProc, (XtPointer) _XmBottomShadowColorDefault }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(XmManagerRec, manager.bottom_shadow_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNhelpCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmManagerRec, manager.help_callback), XmRPointer, (XtPointer) NULL }, #ifndef XM_PART_BC { XmNpopupHandlerCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmManagerRec, manager.popup_handler_callback), XmRPointer, (XtPointer) NULL }, #endif { XmNuserData, XmCUserData, XmRPointer, sizeof(XtPointer), XtOffsetOf(XmManagerRec, manager.user_data), XmRPointer, (XtPointer) NULL }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmManagerRec, manager.traversal_on), XmRImmediate, (XtPointer) TRUE }, { XmNstringDirection, XmCStringDirection, XmRStringDirection, sizeof(XmStringDirection), XtOffsetOf(XmManagerRec, manager.string_direction), XmRImmediate, (XtPointer) XmSTRING_DIRECTION_DEFAULT }, { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), XtOffsetOf(XmManagerRec, manager.string_direction), XmRCallProc, (XtPointer) _XmDirectionDefault }, { XmNinitialFocus, XmCInitialFocus, XmRWidget, sizeof(Widget), XtOffsetOf(XmManagerRec, manager.initial_focus), XmRImmediate, NULL } }; /***************************************/ /* Definition for synthetic resources */ static XmSyntheticResource syn_resources[] = { { XmNx, sizeof (Position), XtOffsetOf(WidgetRec, core.x), GetXFromShell, XmeToHorizontalPixels }, { XmNy, sizeof (Position), XtOffsetOf(WidgetRec, core.y), GetYFromShell, XmeToVerticalPixels }, { XmNwidth, sizeof (Dimension), XtOffsetOf(WidgetRec, core.width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNheight, sizeof (Dimension), XtOffsetOf(WidgetRec, core.height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNborderWidth, sizeof (Dimension), XtOffsetOf(WidgetRec, core.border_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNshadowThickness, sizeof (Dimension), XtOffsetOf(XmManagerRec, manager.shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNstringDirection, sizeof(XmStringDirection), XtOffsetOf(XmManagerRec, manager.string_direction), _XmFromLayoutDirection, _XmToLayoutDirection } }; /*******************************************/ /* Declaration of class extension records */ static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* getValuesPrehook */ NULL, /* getValuesPosthook */ NULL, /* ClassPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ NULL /* focusChange */ }; static CompositeClassExtensionRec compositeClassExtRec = { NULL, NULLQUARK, XtCompositeExtensionVersion, sizeof(CompositeClassExtensionRec), TRUE, /* accepts_objects */ }; static XmManagerClassExtRec managerClassExtRec = { NULL, NULLQUARK, XmManagerClassExtVersion, sizeof(XmManagerClassExtRec), NULL, /* traversal_children */ ObjectAtPoint /* object_at_point */ }; /******************************************/ /* The Manager class record definition. */ externaldef(xmmanagerclassrec) XmManagerClassRec xmManagerClassRec = { { (WidgetClass) &constraintClassRec, /* superclass */ "XmManager", /* class_name */ sizeof(XmManagerRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class part initialize */ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize hook */ Realize, /* realize */ actions, /* actions */ XtNumber(actions), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ True, /* compress enterleave */ False, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ _XmManagerGetValuesHook, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ _XmManager_defaultTranslations, /* tm_table */ NULL, /* query geometry */ NULL, /* display_accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite class */ NULL, /* Geometry Manager */ NULL, /* Change Managed */ InsertChild, /* Insert Child */ DeleteChild, /* Delete Child */ (XtPointer)&compositeClassExtRec, /* extension */ }, { /* constraint class */ NULL, /* resources */ 0, /* num resources */ sizeof (XmManagerConstraintRec), /* constraint record */ ConstraintInitialize, /* initialize */ ConstraintDestroy, /* destroy */ ConstraintSetValues, /* set values */ NULL, /* extension */ }, { /* manager class */ _XmManager_managerTraversalTranslations, /* default translations */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ ManagerParentProcess, /* parent_process */ (XtPointer)&managerClassExtRec, /* extension */ }, }; externaldef(xmmanagerwidgetclass) WidgetClass xmManagerWidgetClass = (WidgetClass) &xmManagerClassRec; static XmConst XmSpecifyLayoutDirectionTraitRec manLDT = { 0, /* version */ GetDirection }; /* Access Colors Trait record for Manager */ static XmConst XmAccessColorsTraitRec manACT = { 0, /* version */ GetColors }; /* Unit Type Trait record for Manager */ static XmConst XmSpecUnitTypeTraitRec manUTT = { 0, /* version */ GetUnitType }; /************************************************************************** ** ** Synthetic resource hooks function section ** **************************************************************************/ static void GetXFromShell( Widget wid, int resource_offset, XtArgVal *value ) { /* return the x in the child's unit type; for children of shell, return * the parent's x relative to the origin, in pixels */ Widget parent = XtParent(wid); if (XtIsShell(parent)) { /* at the moment menuShell doesn't reset x,y values to 0, so ** we'll have them counted twice if we use XtTranslateCoords */ *value = (XtArgVal) parent->core.x; } else { *value = (XtArgVal) wid->core.x ; XmeFromHorizontalPixels(wid, resource_offset, value); } } static void GetYFromShell( Widget wid, int resource_offset, XtArgVal *value ) { /* return the y in the child's unit type; for children of shell, return * the parent's y relative to the origin, in pixels */ Widget parent = XtParent(wid); if (XtIsShell(parent)) { /* at the moment menuShell doesn't reset x,y values to 0, so ** we'll have them counted twice if we use XtTranslateCoords */ *value = (XtArgVal) parent->core.y; } else { *value = (XtArgVal) wid->core.y ; XmeFromVerticalPixels(wid, resource_offset, value); } } /********************************************************************* * * ClassInitialize * *********************************************************************/ static void ClassInitialize( void ) { /* These routines are called for each base classes, they just returned if it has been done already */ _XmRegisterConverters(); _XmRegisterPixmapConverters(); _XmInitializeExtensions(); _XmInitializeTraits(); baseClassExtRec.record_type = XmQmotif; } static CompositeClassExtension FindCompClassExtension( WidgetClass widget_class ) { CompositeClassExtension ext; ext = (CompositeClassExtension)((CompositeWidgetClass)widget_class) ->composite_class.extension; while ((ext != NULL) && (ext->record_type != NULLQUARK)) ext = (CompositeClassExtension)ext->next_extension; if (ext != NULL) { /* fix for 9640: check for older version of the extension as well */ if ( ext->version <= XtCompositeExtensionVersion && ext->record_size <= sizeof(CompositeClassExtensionRec)) { /*EMPTY*/ /* continue */ } else { String params[1]; Cardinal num_params = 1; params[0] = widget_class->core_class.class_name; XtErrorMsg( "invalidExtension", "ManagerClassPartInitialize", "XmToolkitError", MESSAGE1, params, &num_params); } } return ext; } /********************************************************************** * * BuildManagerResources * Build up the manager's synthetic and constraint synthetic * resource processing list by combining the super classes with * this class. * **********************************************************************/ static void BuildManagerResources( WidgetClass c ) { XmManagerWidgetClass wc = (XmManagerWidgetClass) c ; XmManagerWidgetClass sc; sc = (XmManagerWidgetClass) wc->core_class.superclass; _XmInitializeSyntheticResources(wc->manager_class.syn_resources, wc->manager_class.num_syn_resources); _XmInitializeSyntheticResources( wc->manager_class.syn_constraint_resources, wc->manager_class.num_syn_constraint_resources); if (sc == (XmManagerWidgetClass) constraintWidgetClass) return; _XmBuildResources (&(wc->manager_class.syn_resources), &(wc->manager_class.num_syn_resources), sc->manager_class.syn_resources, sc->manager_class.num_syn_resources); _XmBuildResources (&(wc->manager_class.syn_constraint_resources), &(wc->manager_class.num_syn_constraint_resources), sc->manager_class.syn_constraint_resources, sc->manager_class.num_syn_constraint_resources); } /********************************************************************* * * ClassPartInitialize * *********************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { static Boolean first_time = TRUE; XmManagerWidgetClass mw = (XmManagerWidgetClass) wc; XmManagerWidgetClass super = (XmManagerWidgetClass) mw->core_class.superclass; XmManagerClassExt *mext = (XmManagerClassExt *) _XmGetClassExtensionPtr((XmGenericClassExt *) &(mw->manager_class.extension), NULLQUARK) ; _XmFastSubclassInit (wc, XmMANAGER_BIT); /*** start by doing the inheritance for Xt... */ if (FindCompClassExtension(wc) == NULL) { CompositeClassExtension comp_ext ; XtPointer *comp_extP = &((CompositeWidgetClass)wc)->composite_class.extension; comp_ext = XtNew(CompositeClassExtensionRec); memcpy(comp_ext, FindCompClassExtension(wc->core_class.superclass), sizeof(CompositeClassExtensionRec)); comp_ext->next_extension = *comp_extP; *comp_extP = (XtPointer)comp_ext; } /*** deal with inheritance for regular methods */ if (mw->manager_class.translations == XtInheritTranslations) mw->manager_class.translations = super->manager_class.translations; else if (mw->manager_class.translations) mw->manager_class.translations = (String) XtParseTranslationTable(mw->manager_class.translations); if (mw->manager_class.parent_process == XmInheritParentProcess) mw->manager_class.parent_process = super->manager_class.parent_process; /* synthetic resource management */ BuildManagerResources((WidgetClass) wc); /*** then deal with class extension inheritance. if it's NULL, create a new one with inherit everywhere, then do the inheritance*/ if (*mext == NULL) { *mext = (XmManagerClassExt) XtCalloc(1, sizeof(XmManagerClassExtRec)); (*mext)->record_type = NULLQUARK ; (*mext)->version = XmManagerClassExtVersion ; (*mext)->record_size = sizeof( XmManagerClassExtRec) ; (*mext)->traversal_children = XmInheritTraversalChildrenProc ; (*mext)->object_at_point = XmInheritObjectAtPointProc ; } if ((WidgetClass)mw != xmManagerWidgetClass) { XmManagerClassExt *smext = (XmManagerClassExt *) _XmGetClassExtensionPtr( (XmGenericClassExt *) &(super->manager_class.extension), NULLQUARK) ; if ((*mext)->traversal_children == XmInheritTraversalChildrenProc) { (*mext)->traversal_children = (*smext)->traversal_children ; } if ((*mext)->object_at_point == XmInheritObjectAtPointProc) { (*mext)->object_at_point = (*smext)->object_at_point ; } } /*** Carry this ugly non portable code that deal with Xt internals. first_time because we want to do that onlt once but after Object ClassPartInit has been called */ if (first_time) { _XmReOrderResourceList(xmManagerWidgetClass, XmNunitType, NULL); _XmReOrderResourceList(xmManagerWidgetClass, XmNforeground, XmNbackground); first_time = FALSE; } /*** setting up traits for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTspecifyLayoutDirection, (XtPointer)&manLDT); XmeTraitSet((XtPointer)wc, XmQTaccessColors, (XtPointer)&manACT); XmeTraitSet((XtPointer)wc, XmQTspecifyUnitType, (XtPointer)&manUTT); } /************************************************************************ * * Initialize * ************************************************************************/ static void Initialize( Widget request, Widget new_w, ArgList args, Cardinal *num_args ) { XmManagerWidget mw = (XmManagerWidget) new_w ; XtTranslations translations ; /* Initialize manager and composite instance data */ mw->manager.selected_gadget = NULL; mw->manager.highlighted_widget = NULL; mw->manager.event_handler_added = False; mw->manager.active_child = NULL; mw->manager.keyboard_list = NULL; mw->manager.num_keyboard_entries = 0; mw->manager.size_keyboard_list = 0; mw->manager.has_focus = False; _XmProcessLock(); translations = (XtTranslations) ((XmManagerClassRec *)XtClass( mw)) ->manager_class.translations ; _XmProcessUnlock(); if( mw->manager.traversal_on && translations && mw->core.tm.translations && !XmIsRowColumn( mw) ) { /* If this widget is requesting traversal then augment its * translation table with some additional events. * We will only augment translations for a widget which * already has some translations defined; this allows widgets * which want to set different translations (i.e. menus) to * it at a later point in time. * We do not override RowColumn and Label subclasses, these * are handled by those classes. */ XtOverrideTranslations( (Widget) mw, translations) ; } if( (mw->manager.navigation_type != XmDYNAMIC_DEFAULT_TAB_GROUP) && !XmRepTypeValidValue( XmRID_NAVIGATION_TYPE, mw->manager.navigation_type, (Widget) mw) ) { mw->manager.navigation_type = XmNONE ; } _XmNavigInitialize( request, new_w, args, num_args); /* Verify resource data */ if( !XmRepTypeValidValue( XmRID_UNIT_TYPE, mw->manager.unit_type, (Widget) mw) ) { mw->manager.unit_type = XmPIXELS; } /* Convert the fields from unit values to pixel values */ _XmManagerImportArgs( (Widget) mw, args, num_args); if (mw->manager.string_direction == XmSTRING_DIRECTION_DEFAULT) { /* This indicates that layoutDirection was set in the arglist, but stringDirection defaulting overwrote the value */ int i; for (i=0; i < *num_args; i++) if (strcmp(args[i].name, XmNlayoutDirection) == 0) mw->manager.string_direction = (XmDirection)args[i].value; } /* Get the shadow drawing GC's */ mw->manager.background_GC = _XmGetPixmapBasedGC (new_w, mw->core.background_pixel, mw->manager.foreground, mw->core.background_pixmap); mw->manager.highlight_GC = _XmGetPixmapBasedGC (new_w, mw->manager.highlight_color, mw->core.background_pixel, mw->manager.highlight_pixmap); mw->manager.top_shadow_GC = _XmGetPixmapBasedGC (new_w, mw->manager.top_shadow_color, mw->core.background_pixel, mw->manager.top_shadow_pixmap); mw->manager.bottom_shadow_GC = _XmGetPixmapBasedGC (new_w, mw->manager.bottom_shadow_color, mw->core.background_pixel, mw->manager.bottom_shadow_pixmap); /* Copy accelerator widget from parent or set to NULL. */ { XmManagerWidget p = (XmManagerWidget) XtParent(mw); if (XmIsManager(p) && p->manager.accelerator_widget) mw->manager.accelerator_widget = p->manager.accelerator_widget; else mw->manager.accelerator_widget = NULL; } } /************************************************************************* * * Realize * *************************************************************************/ static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { Mask valueMask = *p_valueMask; /* Make sure height and width are not zero. */ if (!XtWidth(w)) XtWidth(w) = 1 ; if (!XtHeight(w)) XtHeight(w) = 1 ; valueMask |= CWBitGravity | CWDontPropagate; attributes->bit_gravity = NorthWestGravity; attributes->do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | PointerMotionMask; XtCreateWindow (w, InputOutput, CopyFromParent, valueMask, attributes); } /************************************************************************ * * Destroy * ************************************************************************/ static void Destroy( Widget w ) { XmManagerWidget mw = (XmManagerWidget) w; _XmNavigDestroy(w); XtReleaseGC (w, mw->manager.background_GC); XtReleaseGC (w, mw->manager.top_shadow_GC); XtReleaseGC (w, mw->manager.bottom_shadow_GC); XtReleaseGC (w, mw->manager.highlight_GC); } /************************************************************************ * * SetValues * ************************************************************************/ static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args ) { Boolean returnFlag = False; Mask visualFlag = NoVisualChange; XmManagerWidget curmw = (XmManagerWidget) current; XmManagerWidget newmw = (XmManagerWidget) new_w; /* Process the change in values */ /* CR 7124: XmNlayoutDirection and XmNstringDirection are CG resources. */ if (curmw->manager.string_direction != newmw->manager.string_direction) { XmeWarning(new_w, MESSAGE2); newmw->manager.string_direction = curmw->manager.string_direction; } /* If traversal has been turned on, then augment the translations * of the new widget. */ if( newmw->manager.traversal_on && (newmw->manager.traversal_on != curmw->manager.traversal_on) && newmw->core.tm.translations) { XtTranslations translations; _XmProcessLock(); translations = (XtTranslations) ((XmManagerClassRec *) XtClass( newmw)) ->manager_class.translations; _XmProcessUnlock(); if (translations) XtOverrideTranslations( (Widget) newmw, translations); } if( newmw->manager.initial_focus != curmw->manager.initial_focus ) { _XmSetInitialOfTabGroup( (Widget) newmw, newmw->manager.initial_focus) ; } if( curmw->manager.navigation_type != newmw->manager.navigation_type ) { if( !XmRepTypeValidValue( XmRID_NAVIGATION_TYPE, newmw->manager.navigation_type, (Widget) newmw) ) { newmw->manager.navigation_type = curmw->manager.navigation_type ; } } returnFlag = _XmNavigSetValues(current, request, new_w, args, num_args); /* Validate changed data. */ if( !XmRepTypeValidValue( XmRID_UNIT_TYPE, newmw->manager.unit_type, (Widget) newmw) ) { newmw->manager.unit_type = curmw->manager.unit_type; } /* Convert the necessary fields from unit values to pixel values */ _XmManagerImportArgs( (Widget) newmw, args, num_args); /* Checking for valid Direction */ if( !XmRepTypeValidValue( XmRID_DIRECTION, newmw->manager.string_direction, (Widget) newmw) ) { newmw->manager.string_direction = curmw->manager.string_direction ; } /* If either of the background, shadow, or highlight colors or */ /* pixmaps have changed, destroy and recreate the gc's. */ if (curmw->core.background_pixel != newmw->core.background_pixel || curmw->core.background_pixmap != newmw->core.background_pixmap) { XtReleaseGC ( (Widget) newmw, newmw->manager.background_GC); newmw->manager.background_GC = _XmGetPixmapBasedGC (new_w, newmw->core.background_pixel, newmw->manager.foreground, newmw->core.background_pixmap); returnFlag = True; visualFlag |= (VisualBackgroundPixel|VisualBackgroundPixmap); } if (curmw->manager.top_shadow_color != newmw->manager.top_shadow_color || curmw->manager.top_shadow_pixmap != newmw->manager.top_shadow_pixmap) { XtReleaseGC ((Widget) newmw, newmw->manager.top_shadow_GC); newmw->manager.top_shadow_GC = _XmGetPixmapBasedGC (new_w, newmw->manager.top_shadow_color, newmw->core.background_pixel, newmw->manager.top_shadow_pixmap); returnFlag = True; visualFlag |= (VisualTopShadowColor|VisualTopShadowPixmap); } if (curmw->manager.bottom_shadow_color != newmw->manager.bottom_shadow_color || curmw->manager.bottom_shadow_pixmap != newmw->manager.bottom_shadow_pixmap) { XtReleaseGC ((Widget) newmw, newmw->manager.bottom_shadow_GC); newmw->manager.bottom_shadow_GC = _XmGetPixmapBasedGC (new_w, newmw->manager.bottom_shadow_color, newmw->core.background_pixel, newmw->manager.bottom_shadow_pixmap); returnFlag = True; visualFlag |= (VisualBottomShadowColor|VisualBottomShadowPixmap); } if (curmw->manager.highlight_color != newmw->manager.highlight_color || curmw->manager.highlight_pixmap != newmw->manager.highlight_pixmap) { XtReleaseGC ((Widget) newmw, newmw->manager.highlight_GC); newmw->manager.highlight_GC = _XmGetPixmapBasedGC (new_w, newmw->manager.highlight_color, newmw->core.background_pixel, newmw->manager.highlight_pixmap); returnFlag = True; visualFlag |= (VisualHighlightColor|VisualHighlightPixmap); } if (curmw->manager.foreground != newmw->manager.foreground) visualFlag |= VisualForeground ; /* Inform children of possible visual changes */ if (visualFlag) returnFlag |= _XmNotifyChildrenVisual (current, new_w, visualFlag); /* Return flag to indicate if redraw is needed. */ return (returnFlag); } /********************************************************************* * * InsertChild * *********************************************************************/ static void InsertChild( Widget child ) { CompositeClassRec *cc = (CompositeClassRec *) compositeWidgetClass; XtWidgetProc insert_child; if (!XtIsRectObj(child)) return; _XmProcessLock(); insert_child = cc->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(child); } /********************************************************************* * * DeleteChild * *********************************************************************/ static void DeleteChild( Widget child ) { XmManagerWidget mw = (XmManagerWidget) child->core.parent; Widget tab_group ; CompositeClassRec *cc = (CompositeClassRec *) compositeWidgetClass; XtWidgetProc delete_child; if (!XtIsRectObj(child)) return; if (mw->manager.selected_gadget == (XmGadget) child) mw->manager.selected_gadget = NULL; if( mw->manager.initial_focus == child ) { mw->manager.initial_focus = NULL ; } if( mw->manager.active_child == child ) { mw->manager.active_child = NULL; } if( (tab_group = XmGetTabGroup( child)) && (tab_group != (Widget) mw) && XmIsManager( tab_group) && (((XmManagerWidget) tab_group)->manager.active_child == child) ) { ((XmManagerWidget) tab_group)->manager.active_child = NULL ; } _XmProcessLock(); delete_child = cc->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child); } /************************************************************************ * * ManagerMotion * This function handles the generation of motion, enter, and leave * window events for gadgets and the dispatching of these events to * the gadgets. * ************************************************************************/ /*ARGSUSED*/ static void ManagerMotion( Widget wid, XtPointer closure, /* unused */ XEvent *event, Boolean *cont ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget gadget; XmGadget oldGadget; /* Event on the managers window and not propagated from a child */ /* Old comment from 1.1: * ManagerMotion() creates misleading Enter/Leave events. A race condition * exists such that it's possible that when ManagerMotion() is called, the * manager does not yet have the focus. Dropping the Enter on the floor * caused ManagerMotion() to translate the first subsequent motion event * into an enter to dispatch to the gadget. Subsequently button gadget * (un)highlighting on enter/leave was unreliable. This problem requires * additional investigation. * The quick fix, currently, is for ManagerEnter() * and ManagerLeave() to use the event whether or not the manager has the * focus. * In addition, in dispatching enter/leaves to gadgets here in this * routine, ManagerMotion(), bear in mind that we are passing a * XPointerMovedEvent and should probably be creating a synthethic * XCrossingEvent instead. * * if ((event->subwindow != 0) || !mw->manager.has_focus) */ /* CR 9362: * ManagerMotion() was not keeping track of Enter/Leave events. * Pointer motion on a gadget which extended beyond the manager's * geometry was not being tracked correctly. Thus we now use the * has_focus flag to toggle between enter/leave states. Use of this * flag prevents us from having to use _XmGetPointVisibility which is * expensive. * Prior to 1.1, xcrossing.focus was used, but this proved incorrect, * as the 1.1 comment above describes. */ if (event->xmotion.subwindow != 0 || !mw->manager.has_focus) return; gadget = _XmInputForGadget((Widget) mw, event->xmotion.x, event->xmotion.y); oldGadget = (XmGadget) mw->manager.highlighted_widget; /* Dispatch motion events to the child */ if (gadget != NULL) { if (gadget->gadget.event_mask & XmMOTION_EVENT) _XmDispatchGadgetInput((Widget) gadget, event, XmMOTION_EVENT); } /* Check for and process a leave window condition */ if (oldGadget != NULL && gadget != oldGadget) { if (oldGadget->gadget.event_mask & XmLEAVE_EVENT) _XmDispatchGadgetInput( (Widget) oldGadget, event, XmLEAVE_EVENT); mw->manager.highlighted_widget = NULL; } /* Check for and process an enter window condition */ if (gadget != NULL && gadget != oldGadget) { if (gadget->gadget.event_mask & XmENTER_EVENT) { _XmDispatchGadgetInput( (Widget) gadget, event, XmENTER_EVENT); mw->manager.highlighted_widget = (Widget) gadget; } else mw->manager.highlighted_widget = NULL; } } /************************************************************************ * * ManagerEnter * This function handles the generation of motion and enter window * events for gadgets and the dispatching of these events to the * gadgets. * ************************************************************************/ /*ARGSUSED*/ static void ManagerEnter( Widget wid, XtPointer closure, /* unused */ XEvent *event, Boolean *cont ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget gadget; /* Old comment from 1.1: * See ManagerMotion() * if (!(mw->manager.has_focus = (Boolean) event->xcrossing.focus)) * return; */ /* Toggle to entered state */ mw->manager.has_focus = True; /* * call the traversal action in order to synch things up. This * should be cleaned up into a single module ||| */ _XmManagerEnter((Widget) mw, event, NULL, NULL); gadget = _XmInputForGadget( (Widget) mw, event->xcrossing.x, event->xcrossing.y); /* Dispatch motion and enter events to the child */ if (gadget != NULL) { if (gadget->gadget.event_mask & XmMOTION_EVENT) _XmDispatchGadgetInput( (Widget) gadget, event, XmMOTION_EVENT); if (gadget->gadget.event_mask & XmENTER_EVENT) { _XmDispatchGadgetInput( (Widget) gadget, event, XmENTER_EVENT); mw->manager.highlighted_widget = (Widget) gadget; } else mw->manager.highlighted_widget = NULL; } } /************************************************************************ * * ManagerLeave * This function handles the generation of leave window events for * gadgets and the dispatching of these events to the gadgets. * ************************************************************************/ /*ARGSUSED*/ static void ManagerLeave( Widget wid, XtPointer closure, /* unused */ XEvent *event, Boolean *cont ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget oldGadget; /* See ManagerMotion() * if (!(mw->manager.has_focus = (Boolean) event->xcrossing.focus)) * return; */ /* Toggle to leave state */ mw->manager.has_focus = False; oldGadget = (XmGadget) mw->manager.highlighted_widget; if (oldGadget != NULL) { if (oldGadget->gadget.event_mask & XmLEAVE_EVENT) _XmDispatchGadgetInput( (Widget) oldGadget, event, XmLEAVE_EVENT); mw->manager.highlighted_widget = NULL; } /* * call the traversal action in order to synch things up. This * should be cleaned up into a single module ||| */ _XmManagerLeave( (Widget) mw, event, NULL, NULL); } /************************************************************************ * * AddMotionHandlers * Add the event handlers necessary to synthisize motion events * for gadgets. * ************************************************************************/ static void AddMotionHandlers( XmManagerWidget mw ) { mw->manager.event_handler_added = True; #if 1 /* for tool tips */ XtAddEventHandler ((Widget) mw, PointerMotionMask, False, ManagerMotion, NULL); #else /* The first version in this #ifdef is superior because it involves lower network traffic, but causes problems in VTS and automation (CR 8943). We can reexamine this later */ if( _XmGetFocusPolicy( (Widget) mw) != XmEXPLICIT ) { XtAddEventHandler ((Widget) mw, PointerMotionMask, False, ManagerMotion, NULL); } else { XtAddEventHandler ((Widget) mw, ButtonMotionMask, False, ManagerMotion, NULL); } #endif XtAddEventHandler ((Widget) mw, EnterWindowMask, False, ManagerEnter, NULL); XtAddEventHandler ((Widget) mw, LeaveWindowMask, False, ManagerLeave, NULL); } /************************************************************************ * * ConstraintInitialize * The constraint destroy procedure checks to see if a gadget * child is being destroyed. If so, the managers motion processing * event handlers are checked to see if they need to be removed. * ************************************************************************/ /*ARGSUSED*/ static void ConstraintInitialize( Widget request, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal * num_args ) /* unused */ { XmGadget g; XmManagerWidget parent; if (!XtIsRectObj(new_w)) return; parent = (XmManagerWidget) new_w->core.parent; if (XmIsGadget (new_w)) { g = (XmGadget) new_w; if ((g->gadget.event_mask & (XmENTER_EVENT | XmLEAVE_EVENT | XmMOTION_EVENT)) && parent->manager.event_handler_added == False) AddMotionHandlers (parent); } else if (XtIsWidget(new_w)) { if (parent->manager.accelerator_widget) { XtInstallAccelerators (new_w, parent->manager.accelerator_widget); } /* else was the DoMagicCompatibility */ } /* else non-widget non-gadget RectObj */ } /************************************************************************ * * CheckRemoveMotionHandlers * This function loops through the child set checking each gadget * to see if the need motion events or not. If no gadget's need * motion events and the motion event handlers have been added, * then remove the event handlers. * ************************************************************************/ static void CheckRemoveMotionHandlers( XmManagerWidget mw ) { register int i; register Widget child; /* If there are any gadgets which need motion events, return. */ if (!mw->core.being_destroyed) { for (i = 0; i < mw->composite.num_children; i++) { child = mw->composite.children[i]; if (XmIsGadget(child)) { if (((XmGadget) child)->gadget.event_mask & (XmENTER_EVENT | XmLEAVE_EVENT | XmMOTION_EVENT)) return; } } } /* Remove the motion event handlers */ mw->manager.event_handler_added = False; XtRemoveEventHandler ((Widget) mw, PointerMotionMask, False, ManagerMotion, NULL); XtRemoveEventHandler ((Widget) mw, EnterWindowMask, False, ManagerEnter, NULL); XtRemoveEventHandler ((Widget) mw, LeaveWindowMask, False, ManagerLeave, NULL); } /************************************************************************ * * ConstraintDestroy * The constraint destroy procedure checks to see if a gadget * child is being destroyed. If so, the managers motion processing * event handlers are checked to see if they need to be removed. * ************************************************************************/ static void ConstraintDestroy( Widget w ) { XmGadget g; XmManagerWidget parent; if (!XtIsRectObj(w)) return; if (XmIsGadget (w)) { g = (XmGadget) w; parent = (XmManagerWidget) w->core.parent; if (g->gadget.event_mask & (XmENTER_EVENT | XmLEAVE_EVENT | XmMOTION_EVENT)) CheckRemoveMotionHandlers (parent); if (parent->manager.highlighted_widget == w) parent->manager.highlighted_widget = NULL; if (parent->manager.selected_gadget == g) parent->manager.selected_gadget = NULL; } } /************************************************************************ * * ConstraintSetValues * Make sure the managers event handler is set appropriately for * gadget event handling. * ************************************************************************/ /*ARGSUSED*/ static Boolean ConstraintSetValues( Widget current, Widget request, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal * num_args ) /* unused */ { XmGadget currentg, newg; XmManagerWidget parent; unsigned int motion_events; if (!XtIsRectObj(new_w)) return(FALSE); /* If the child is a gadget and its event mask has changed with */ /* respect to the event types which need motion events on the */ /* parent. */ if (XmIsGadget (new_w)) { currentg = (XmGadget) current; newg = (XmGadget) new_w; parent = (XmManagerWidget) new_w->core.parent; motion_events = XmENTER_EVENT | XmLEAVE_EVENT | XmMOTION_EVENT; if ((newg->gadget.event_mask & motion_events) != (currentg->gadget.event_mask & motion_events)) { if ((newg->gadget.event_mask & motion_events) && parent->manager.event_handler_added == False) AddMotionHandlers (parent); if ((~(newg->gadget.event_mask & motion_events)) && parent->manager.event_handler_added == True) CheckRemoveMotionHandlers (parent); } } return (False); } /****************************************************************/ static Boolean ManagerParentProcess( Widget widget, XmParentProcessData data ) { return( _XmParentProcess( XtParent( widget), data)) ; } /************************************************************************ * * ObjectAtPoint method * Given a composite widget and an (x, y) coordinate, see if the * (x, y) lies within one of the gadgets contained within the * composite. Return the gadget if found, otherwise return NULL. * ************************************************************************/ static Widget ObjectAtPoint( Widget wid, Position x, Position y ) { CompositeWidget cw = (CompositeWidget) wid ; register int i; register Widget widget; /* For the case of overlapping gadgets, the last one in the * composite list will be the visible gadget (see order of * redisplay in XmeRedisplayGadgets). So, search the child * list from the tail to the head to get this visible gadget * as the one to get the input. */ i = cw->composite.num_children ; while( i-- ) { widget = cw->composite.children[i]; if (XmIsGadget(widget) && XtIsManaged (widget)) { if (x >= widget->core.x && y >= widget->core.y && x < widget->core.x + widget->core.width && y < widget->core.y + widget->core.height) return (widget); } } return (NULL); } static XmNavigability WidgetNavigable( Widget wid) { if( XtIsSensitive(wid) && ((XmManagerWidget) wid)->manager.traversal_on ) { XmNavigationType nav_type = ((XmManagerWidget) wid) ->manager.navigation_type ; if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmDESCENDANTS_TAB_NAVIGABLE ; } return XmDESCENDANTS_NAVIGABLE ; } return XmNOT_NAVIGABLE ; } /**************************************************************** **************************************************************** ** ** Trait methods ** **************************************************************** ****************************************************************/ static XmDirection GetDirection(Widget w) { return (XmDirection)((XmManagerWidget)(w))->manager.string_direction; } static unsigned char GetUnitType(Widget w) { return ((XmManagerWidget) w)->manager.unit_type ; } static void GetColors(Widget w, XmAccessColorData color_data) { XmManagerWidget mw = (XmManagerWidget) w ; color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor; color_data->background = w->core.background_pixel; color_data->foreground = mw->manager.foreground; color_data->highlight_color = mw->manager.highlight_color; color_data->top_shadow_color = mw->manager.top_shadow_color; color_data->bottom_shadow_color = mw->manager.bottom_shadow_color; } /**************************************************************** **************************************************************** ** ** External functions, both _Xm and Xm. ** First come the action procs and then the other external entry points. ** **************************************************************** ****************************************************************/ /*ARGSUSED*/ void _XmGadgetTraversePrevTabGroup( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; Boolean button_tab; XmDisplay xm_dpy; if (ref_wid == NULL) ref_wid = wid ; xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplayOfObject(ref_wid)); button_tab = xm_dpy->display.enable_button_tab; if (button_tab) _XmMgrTraversal(ref_wid, XmTRAVERSE_GLOBALLY_BACKWARD); else _XmMgrTraversal(ref_wid, XmTRAVERSE_PREV_TAB_GROUP); } /*ARGSUSED*/ void _XmGadgetTraverseNextTabGroup( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; Boolean button_tab; XmDisplay xm_dpy; if (ref_wid == NULL) ref_wid = wid ; xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplayOfObject(ref_wid)); button_tab = xm_dpy->display.enable_button_tab; if (button_tab) _XmMgrTraversal(ref_wid, XmTRAVERSE_GLOBALLY_FORWARD); else _XmMgrTraversal(ref_wid, XmTRAVERSE_NEXT_TAB_GROUP); } /*ARGSUSED*/ void _XmGadgetTraverseCurrent( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget child ; child = (Widget) _XmInputForGadget(wid, event->xbutton.x, event->xbutton.y); XmProcessTraversal(child, XmTRAVERSE_CURRENT) ; } /*ARGSUSED*/ void _XmGadgetTraverseLeft( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; if( ref_wid == NULL ) { ref_wid = wid ; } _XmMgrTraversal( ref_wid, XmTRAVERSE_LEFT) ; } /*ARGSUSED*/ void _XmGadgetTraverseRight( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; if( ref_wid == NULL ) { ref_wid = wid ; } _XmMgrTraversal( ref_wid, XmTRAVERSE_RIGHT) ; } /*ARGSUSED*/ void _XmGadgetTraverseUp( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; if( ref_wid == NULL ) { ref_wid = wid ; } _XmMgrTraversal( ref_wid, XmTRAVERSE_UP) ; } /*ARGSUSED*/ void _XmGadgetTraverseDown( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; if( ref_wid == NULL ) { ref_wid = wid ; } _XmMgrTraversal( ref_wid, XmTRAVERSE_DOWN) ; } /*ARGSUSED*/ void _XmGadgetTraverseNext( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; if( ref_wid == NULL ) { ref_wid = wid ; } _XmMgrTraversal( ref_wid, XmTRAVERSE_NEXT) ; } /*ARGSUSED*/ void _XmGadgetTraversePrev( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; if( ref_wid == NULL ) { ref_wid = wid ; } _XmMgrTraversal( ref_wid, XmTRAVERSE_PREV) ; } /*ARGSUSED*/ void _XmGadgetTraverseHome( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params ) /* unused */ { Widget ref_wid = ((XmManagerWidget) wid)->manager.active_child ; if( ref_wid == NULL ) { ref_wid = wid ; } _XmMgrTraversal( ref_wid, XmTRAVERSE_HOME) ; } /*ARGSUSED*/ void _XmGadgetSelect( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; Widget child ; if( _XmGetFocusPolicy( (Widget) mw) == XmEXPLICIT ) { child = mw->manager.active_child ; if( child && !XmIsGadget( child) ) { child = NULL ; } } else /* FocusPolicy == XmPOINTER */ { child = (Widget) _XmInputForGadget( (Widget) mw, event->xkey.x, event->xkey.y) ; } if( child && (((XmGadgetClass)XtClass( child))->gadget_class.arm_and_activate) ) { (*(((XmGadgetClass)XtClass( child))->gadget_class.arm_and_activate))( child, event, NULL, NULL) ; } return ; } void _XmManagerParentActivate( Widget mw, XEvent *event, String *params, Cardinal *num_params ) { XmParentInputActionRec pp_data ; pp_data.process_type = XmINPUT_ACTION ; pp_data.action = XmPARENT_ACTIVATE ; pp_data.event = event ; pp_data.params = params ; pp_data.num_params = num_params ; _XmParentProcess( mw, (XmParentProcessData) &pp_data); } void _XmManagerParentCancel( Widget mw, XEvent *event, String *params, Cardinal *num_params ) { XmParentInputActionRec pp_data ; pp_data.process_type = XmINPUT_ACTION ; pp_data.action = XmPARENT_CANCEL ; pp_data.event = event ; pp_data.params = params ; pp_data.num_params = num_params ; _XmParentProcess( mw, (XmParentProcessData) &pp_data) ; } /*ARGSUSED*/ void _XmGadgetButtonMotion( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; Widget child ; if( _XmGetFocusPolicy( (Widget) mw) == XmEXPLICIT ) { child = mw->manager.active_child ; if( child && !XmIsGadget( child) ) { child = NULL ; } } else /* FocusPolicy == XmPOINTER */ { child = (Widget) _XmInputForGadget( (Widget) mw, event->xmotion.x, event->xmotion.y) ; } if( child ) { _XmDispatchGadgetInput( child, event, XmMOTION_EVENT); } return ; } /*ARGSUSED*/ void _XmGadgetKeyInput( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; Widget child ; if( _XmGetFocusPolicy( (Widget) mw) == XmEXPLICIT ) { child = mw->manager.active_child ; if( child && !XmIsGadget( child) ) { child = NULL ; } } else /* FocusPolicy == XmPOINTER */ { child = (Widget) _XmInputForGadget( (Widget) mw, event->xkey.x, event->xkey.y) ; } if( child ) { _XmDispatchGadgetInput( child, event, XmKEY_EVENT); } return ; } /*ARGSUSED*/ void _XmGadgetArm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget gadget; if ((gadget = _XmInputForGadget( (Widget) mw, event->xbutton.x, event->xbutton.y)) != NULL) { XmProcessTraversal( (Widget) gadget, XmTRAVERSE_CURRENT); _XmDispatchGadgetInput( (Widget) gadget, event, XmARM_EVENT); mw->manager.selected_gadget = gadget; } else { if( _XmIsNavigable( wid) ) { XmProcessTraversal( wid, XmTRAVERSE_CURRENT) ; } } mw->manager.eligible_for_multi_button_event = NULL; } /*ARGSUSED*/ void _XmGadgetDrag( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget gadget; /* CR 5141: Don't let multi-button drags cause confusion. */ if ( !(event->xbutton.state & ~((Button1Mask >> 1) << event->xbutton.button) & (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)) && (gadget = _XmInputForGadget((Widget) mw, event->xbutton.x, event->xbutton.y)) != NULL) { _XmDispatchGadgetInput( (Widget) gadget, event, XmBDRAG_EVENT); mw->manager.selected_gadget = gadget; } mw->manager.eligible_for_multi_button_event = NULL; } /*ARGSUSED*/ void _XmGadgetActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget gadget; /* we emulate automatic grab with owner_events = false by sending * the button up to the button down gadget */ if ((gadget = mw->manager.selected_gadget) != NULL) { _XmDispatchGadgetInput( (Widget) gadget, event, XmACTIVATE_EVENT); mw->manager.selected_gadget = NULL; mw->manager.eligible_for_multi_button_event = gadget; } } /*ARGSUSED*/ void _XmManagerHelp( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmManagerWidget mw = (XmManagerWidget) wid ; Widget widget; if (!_XmIsEventUnique(event)) return; if (_XmGetFocusPolicy( (Widget) mw) == XmEXPLICIT) { if ((widget = mw->manager.active_child) != NULL) _XmDispatchGadgetInput(widget, event, XmHELP_EVENT); else _XmSocorro( (Widget) mw, event, NULL, NULL); } else { if ((widget = XmObjectAtPoint( (Widget) mw, event->xkey.x, event->xkey.y)) != NULL) _XmDispatchGadgetInput(widget, event, XmHELP_EVENT); else _XmSocorro( (Widget) mw, event, NULL, NULL); } _XmRecordEvent(event); } void _XmGadgetMultiArm( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget gadget; gadget = _XmInputForGadget( (Widget) mw, event->xbutton.x, event->xbutton.y); /* * If we're not set up for multi_button events, check to see if the * input gadget has changed from the active_child. This means that the * user is quickly clicking between gadgets of this manager widget. * If so, arm the gadget as if it were the first button press. */ if (mw->manager.eligible_for_multi_button_event && ((gadget = _XmInputForGadget( (Widget) mw, event->xbutton.x, event->xbutton.y)) == mw->manager.eligible_for_multi_button_event)) { _XmDispatchGadgetInput( (Widget) gadget, event, XmMULTI_ARM_EVENT); mw->manager.selected_gadget = gadget; } else if (gadget && (gadget != (XmGadget)mw->manager.active_child)) _XmGadgetArm( (Widget) mw, event, params, num_params); else mw->manager.eligible_for_multi_button_event = NULL; } void _XmGadgetMultiActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmManagerWidget mw = (XmManagerWidget) wid ; XmGadget gadget; /* * If we're not set up for multi_button events, call _XmGadgetActivate * in case we're quickly selecting a new gadget in which it should * be activated as if it were the first button press. */ if (mw->manager.eligible_for_multi_button_event && ((gadget = mw->manager.selected_gadget) == mw->manager.eligible_for_multi_button_event)) { _XmDispatchGadgetInput((Widget) gadget, event, XmMULTI_ACTIVATE_EVENT); } else _XmGadgetActivate( (Widget) mw, event, params, num_params); } motif-2.3.8/lib/Xm/ColorSP.h0000644000175000017500000001452412672140200012407 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmColorSelectorP_h #define _XmColorSelectorP_h #if defined(VMS) || defined(__VMS) #include #endif /************************************************************ * INCLUDE FILES *************************************************************/ #include #include /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #ifdef __cplusplus extern "C" { #endif #define XmColorSelector_COLOR_NAME_SIZE 100 #define XmColorSelector_NUM_TOGGLES 2 typedef struct _ColorSelStrings { XmString slider_labels[3]; XmString tog_labels[XmColorSelector_NUM_TOGGLES]; XmString no_cell_error, file_read_error; } ColorSelStrings; typedef struct _ColorInfo { char name[XmColorSelector_COLOR_NAME_SIZE], no_space_lower_name[XmColorSelector_COLOR_NAME_SIZE]; unsigned short red, green, blue; } ColorInfo; typedef struct _ColorSelectorClassPart { XtPointer extension; } ColorSelectorClassPart; typedef struct _XmColorSelectorClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; ColorSelectorClassPart color_selector_class; } XmColorSelectorClassRec; typedef struct _XmColorSelectorPart { /* resources */ XmColorMode color_mode; /* selector mode */ char *color_name; /* the colorname we select */ String rgb_file; /* where to look for */ Dimension margin_width; /* for geom management */ Dimension margin_height; /* for geom management */ ColorSelStrings strings; /* strings for I18N. */ /* private state */ int slider_red; /* slider values */ int slider_green; /* slider values */ int slider_blue; /* slider values */ Widget bb; /* area to hold all the sliders */ Widget sliders[3]; /* red,green,blue sliders(slider) */ Widget scrolled_list; /* list (scrolled window) */ Widget list; /* list (simple) */ Widget color_window; /* label to show selected color */ Widget chose_radio; /* selector type radio box */ Widget chose_mode[2]; /* selector type toggles */ Pixel color_pixel; /* pixel value for colors */ Boolean good_cell; /* does color_pixel contain * a good value? */ ColorInfo *colors; /* infomation about all color names */ short num_colors; /* The number of colors. */ } XmColorSelectorPart; typedef struct _XmColorSelectorRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmColorSelectorPart cs; } XmColorSelectorRec; typedef struct _XmColorSelectorConstraintPart { XtPointer extension; } XmColorSelectorConstraintPart; typedef struct _XmColorSelectorConstraintRec { XmManagerConstraintPart manager; XmColorSelectorConstraintPart cs; } XmColorSelectorConstraintRec; /************************************************************ * MACROS *************************************************************/ #define XmColorSelectorIndex (XmManagerIndex + 1) #define XmColorS_color_mode(w) (((XmColorSelectorWidget)(w))->cs.color_mode) #define XmColorS_color_name(w) (((XmColorSelectorWidget)(w))->cs.color_name) #define XmColorS_rgb_file(w) (((XmColorSelectorWidget)(w))->cs.rgb_file) #define XmColorS_margin_width(w) (((XmColorSelectorWidget)(w))->cs.margin_width) #define XmColorS_margin_height(w) (((XmColorSelectorWidget)(w))->cs.margin_height) #define XmColorS_strings(w) (((XmColorSelectorWidget)(w))->cs.strings) #define XmColorS_slider_red(w) (((XmColorSelectorWidget)(w))->cs.slider_red) #define XmColorS_slider_green(w) (((XmColorSelectorWidget)(w))->cs.slider_green) #define XmColorS_slider_blue(w) (((XmColorSelectorWidget)(w))->cs.slider_blue) #define XmColorS_bb(w) (((XmColorSelectorWidget)(w))->cs.bb) #define XmColorS_sliders(w) (((XmColorSelectorWidget)(w))->cs.sliders) #define XmColorS_scrolled_list(w) (((XmColorSelectorWidget)(w))->cs.scrolled_list) #define XmColorS_list(w) (((XmColorSelectorWidget)(w))->cs.list) #define XmColorS_color_window(w) (((XmColorSelectorWidget)(w))->cs.color_window) #define XmColorS_chose_radio(w) (((XmColorSelectorWidget)(w))->cs.chose_radio) #define XmColorS_chose_mode(w) (((XmColorSelectorWidget)(w))->cs.chose_mode) #define XmColorS_color_pixel(w) (((XmColorSelectorWidget)(w))->cs.color_pixel) #define XmColorS_good_cell(w) (((XmColorSelectorWidget)(w))->cs.good_cell) #define XmColorS_colors(w) (((XmColorSelectorWidget)(w))->cs.colors) #define XmColorS_num_colors(w) (((XmColorSelectorWidget)(w))->cs.num_colors) /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /************************************************************ * EXTERNAL DECLARATIONS ************************************************************/ extern XmColorSelectorClassRec xmColorSelectorClassRec; /************************************************************ * STATIC DECLARATIONS ************************************************************/ #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmColorSelectP_h DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/SlideC.c0000644000175000017500000002220313066310437012226 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "SlideCP.h" #include /* Widget methods, forward declarations */ static void class_initialize(void); static void class_part_initialize(WidgetClass widget_class); static void initialize(Widget request, Widget new_w, ArgList args, Cardinal *num_args); static void destroy(Widget w); static Boolean set_values(Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args); static void get_values_hook(Widget w, ArgList args, Cardinal *num_args); static void _XmSlideProc(Widget w); static void targetDestroy(Widget target, XtPointer client_data, XtPointer call_data); /* Widget default resources */ #define Offset(field) XtOffsetOf(XmSlideContextRec, slide.field) static XtResource resources[] = { { XmNslideFinishCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList), Offset(slideFinishCallback), XtRCallback, NULL }, { XmNslideMotionCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList), Offset(slideMotionCallback), XtRCallback, NULL }, { XmNslideWidget, XmCSlideWidget, XtRWidget, sizeof(Widget), Offset(slide_widget), XtRImmediate, NULL }, { XmNslideInterval, XmCSlideInterval, XtRInt, sizeof(int), Offset(interval), XtRImmediate, (XtPointer)5 }, { XmNslideDestWidth, XmCSlideDestWidth, XtRDimension, sizeof(Dimension), Offset(dest_width), XtRImmediate, (XtPointer)XmUNSPECIFIED }, { XmNslideDestHeight, XmCSlideDestHeight, XtRDimension, sizeof(Dimension), Offset(dest_height), XtRImmediate, (XtPointer)XmUNSPECIFIED }, { XmNslideDestX, XmCSlideDestX, XtRPosition, sizeof(Position), Offset(dest_x), XtRImmediate, (XtPointer)XmUNSPECIFIED_POSITION }, { XmNslideDestY, XmCSlideDestY, XtRPosition, sizeof(Position), Offset(dest_y), XtRImmediate, (XtPointer)XmUNSPECIFIED_POSITION }, }; #undef Offset /* Widget class record */ /* *INDENT-OFF* */ XmSlideContextClassRec xmSlideContextClassRec = { /* Object Class Part */ { /* pointer to superclass ClassRec WidgetClass */ (WidgetClass) &objectClassRec, /* widget resource class name String */ "XmSlideContext", /* size in bytes of widget record Cardinal */ sizeof(XmSlideContextRec), /* class initialization proc XtProc */ class_initialize, /* dynamic initialization XtWidgetClassProc */ class_part_initialize, /* has class been initialized? XtEnum */ False, /* initialize subclass fields XtInitProc */ initialize, /* notify that initialize called XtArgsProc */ NULL, /* NULL XtProc */ NULL, /* NULL XtPointer */ NULL, /* NULL Cardinal */ (Cardinal)NULL, /* resources for subclass fields XtResourceList */ resources, /* number of entries in resources Cardinal */ XtNumber(resources), /* resource class quarkified XrmClass */ NULLQUARK, /* NULL Boolean */ (Boolean)(unsigned)NULL, /* NULL XtEnum */ (XtEnum)(unsigned)NULL, /* NULL Boolean */ (Boolean)(unsigned)NULL, /* NULL Boolean */ (Boolean)(unsigned)NULL, /* free data for subclass pointers XtWidgetProc */ destroy, /* NULL XtProc */ NULL, /* NULL XtProc */ NULL, /* set subclass resource values XtSetValuesFunc */ set_values, /* notify that set_values called XtArgsFunc */ NULL, /* NULL XtProc */ NULL, /* notify that get_values called XtArgsProc */ get_values_hook, /* NULL XtProc */ NULL, /* version of intrinsics used XtVersionType */ XtVersion, /* list of callback offsets XtPointer */ NULL, /* NULL String */ NULL, /* NULL XtProc */ NULL, /* NULL XtProc */ NULL, /* pointer to extension record XtPointer */ NULL }, /* SlideContext Class Part */ { NULL } }; /* *INDENT-ON* */ WidgetClass xmSlideContextWidgetClass = (WidgetClass)&xmSlideContextClassRec; static void class_initialize(void) { } static void class_part_initialize(WidgetClass widget_class) { } static void initialize(Widget request, Widget new_w, ArgList args, Cardinal *num_args) { /* printf("%s:%s(%d) - %s %li\n", __FILE__, __FUNCTION__, __LINE__, XtName(new_w), Slide_Interval(new_w)); */ if (Slide_Widget(new_w) == NULL) { _XmWarningMsg(new_w, "Invalid parameter", XmNslideWidget " must be specified during creation", NULL, 0); } else { if (Slide_DestWidth(new_w) == (Dimension)XmUNSPECIFIED) { Slide_DestWidth(new_w) = XtWidth(Slide_Widget(new_w)); } if (Slide_DestHeight(new_w) == (Dimension)XmUNSPECIFIED) { Slide_DestHeight(new_w) = XtHeight(Slide_Widget(new_w)); } if (Slide_DestX(new_w) == XmUNSPECIFIED_POSITION) { Slide_DestX(new_w) = XtX(Slide_Widget(new_w)); } if (Slide_DestY(new_w) == XmUNSPECIFIED_POSITION) { Slide_DestY(new_w) = XtY(Slide_Widget(new_w)); } Slide_Id(new_w) = XtAppAddTimeOut(XtWidgetToApplicationContext(new_w), Slide_Interval(new_w), (XtTimerCallbackProc)_XmSlideProc, new_w); XtAddCallback(Slide_Widget(new_w), XmNdestroyCallback, (XtCallbackProc)targetDestroy, new_w); } } static void destroy(Widget w) { if (Slide_Id(w) != (XtIntervalId)NULL) { XtRemoveTimeOut(Slide_Id(w)); Slide_Id(w) = (XtIntervalId)NULL; } XtRemoveCallback(Slide_Widget(w), XmNdestroyCallback, (XtCallbackProc)targetDestroy, w); } static Boolean set_values(Widget old, Widget request, Widget new_w, ArgList args, Cardinal *num_args) { if (Slide_Widget(old) != Slide_Widget(new_w)) { XtRemoveCallback(Slide_Widget(old), XmNdestroyCallback, (XtCallbackProc)targetDestroy, old); XtAddCallback(Slide_Widget(new_w), XmNdestroyCallback, (XtCallbackProc)targetDestroy, new_w); } return(False); } static void get_values_hook(Widget w, ArgList args, Cardinal *num_args) { } static void targetDestroy(Widget target, XtPointer client_data, XtPointer call_data) { Widget w = (Widget)client_data; XtDestroyWidget(w); } static void _XmSlideProc(Widget w) { Dimension width, height; Position x, y; /* printf("%s:%s(%d) - %s %li\n", __FILE__, __FUNCTION__, __LINE__, XtName(w), Slide_Interval(w)); */ if (Slide_Interval(w) == 0) { width = Slide_DestWidth(w); height = Slide_DestHeight(w); x = Slide_DestX(w); y = Slide_DestY(w); } else { width = XtWidth(Slide_Widget(w)); height = XtHeight(Slide_Widget(w)); x = XtX(Slide_Widget(w)); y = XtY(Slide_Widget(w)); { height = height - (((height - Slide_DestHeight(w)) * 10) / 100); if (height < Slide_DestHeight(w)) { height++; } if (height > Slide_DestHeight(w)) { height--; } width = width - (((width - Slide_DestWidth(w)) * 10) / 100); if (width < Slide_DestWidth(w)) { width++; } if (width > Slide_DestWidth(w)) { width--; } } { y = y - ((((y - Slide_DestY(w)) * 10) / 100) + 0); if (y < Slide_DestY(w)) { y++; } if (y > Slide_DestY(w)) { y--; } x = x - ((((x - Slide_DestX(w)) * 10) / 100) + 0); if (x < Slide_DestX(w)) { x++; } if (x > Slide_DestX(w)) { x--; } } } /* XtCallCallbackList(w, Slide_MotionCallback(w), NULL); */ XtVaSetValues(Slide_Widget(w), XmNx, x, XmNy, y, XmNwidth, width, XmNheight, height, NULL); if (Slide_DestX(w) == XtX(Slide_Widget(w)) && Slide_DestY(w) == XtY(Slide_Widget(w)) && Slide_DestWidth(w) == XtWidth(Slide_Widget(w)) && Slide_DestHeight(w) == XtHeight(Slide_Widget(w))) { XtCallCallbackList(w, Slide_FinishCallback(w), NULL); XtRemoveCallback(Slide_Widget(w), XmNdestroyCallback, (XtCallbackProc)targetDestroy, w); XtDestroyWidget(w); } else { Slide_Id(w) = XtAppAddTimeOut(XtWidgetToApplicationContext(w), Slide_Interval(w), (XtTimerCallbackProc)_XmSlideProc, w); } } motif-2.3.8/lib/Xm/ExtObjectI.h0000644000175000017500000000276112672140200013066 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ExtObjectI.h /main/6 1995/07/14 10:32:34 drk $ */ #ifndef _XmExtObjectI_h #define _XmExtObjectI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern char * _XmExtObjAlloc(int size); extern void _XmExtObjFree(XtPointer element); extern void _XmBuildExtResources(WidgetClass c); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmExtObjectI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconBox.c0000644000175000017500000007316412672140200012427 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES *************************************************************/ #include #include "XmI.h" #include #include /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define SUPERCLASS ((WidgetClass) &xmManagerClassRec) /************************************************************ * MACROS *************************************************************/ #define GetIconInfo(w) ((IconInfo*) \ &(((XmIconBoxConstraintsRec*)((char*)((w)->core.constraints)))->icon)) /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /************************************************************ * STATIC FUNCTION DECLARATIONS *************************************************************/ static void ClassInitialize(); static void ClassPartInitialize(WidgetClass w_class); static void Realize(Widget, Mask *, XSetWindowAttributes *); static void Resize(Widget), ChangeManaged(Widget), InsertChild(Widget); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void ConstraintInitialize(Widget, Widget, ArgList, Cardinal *); static Boolean ConstraintSetValues(Widget, Widget, Widget, ArgList, Cardinal*); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); /************************ * Actions and callbacks. ************************/ /********************* * Internal Routines. *********************/ static void FindNearestCellLocation(Widget, Position *, Position *); static void GetMinCells(Widget, Cardinal *, Cardinal *); static void PlaceChildren(Widget, Widget); static void GetMaxCellSize(Widget, Widget, Dimension *, Dimension *); static void GetCellFromXY(Widget, Position, Position, Position *, Position *); static void GetXYFromCell(Widget, IconInfo *, Position *, Position *); static void CalcCellSizes(Widget, Widget, Boolean, Boolean, Dimension *, Dimension *); static Boolean SetToEmptyCell(Widget); /************************************************************ * STATIC DECLARATIONS *************************************************************/ static XtResource resources[] = { { XmNminimumVerticalCells, XmCDefaultCells, XmRDimension, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.min_v_cells), XmRImmediate, (XtPointer) 2 }, { XmNminimumHorizontalCells, XmCDefaultCells, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.min_h_cells), XmRImmediate, (XtPointer) 2 }, { XmNminimumCellWidth, XmCMinimumCellSize, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.min_cell_width), XmRImmediate, (XtPointer) 20 }, { XmNminimumCellHeight, XmCMinimumCellSize, XmRDimension, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.min_cell_height), XmRImmediate, (XtPointer) 10 }, { XmNverticalMargin, XmCMargin, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.v_margin), XmRImmediate, (XtPointer) 4 }, { XmNhorizontalMargin, XmCMargin, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.h_margin), XmRImmediate, (XtPointer) 4 } }; static XmSyntheticResource get_resources[] = { { XmNhorizontalMargin, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.h_margin), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNverticalMargin, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.v_margin), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNminimumCellWidth, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.min_cell_width), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNminimumCellHeight, sizeof(Dimension), XtOffsetOf(XmIconBoxRec, box.min_cell_height), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels } }; static short G_any_cell = XmIconBoxAnyCell; static XtResource constraints[] = { { XmNcellX, XmCCellX, XmRShort, sizeof(short), XtOffsetOf(XmIconBoxConstraintsRec, icon.cell_x), XmRShort, (XtPointer) &G_any_cell }, { XmNcellY, XmCCellY, XmRShort, sizeof(short), XtOffsetOf(XmIconBoxConstraintsRec, icon.cell_y), XmRShort, (XtPointer) &G_any_cell } }; XmIconBoxClassRec xmIconBoxClassRec = { { /* core fields */ /* superclass */ SUPERCLASS, /* class_name */ "XmIconBox", /* widget_size */ sizeof(XmIconBoxRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ Resize, /* expose */ NULL, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite_class fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ InsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ (XtResource*)constraints, /* num resources */ XtNumber(constraints), /* constraint size */ sizeof(XmIconBoxConstraintsRec), /* init proc */ ConstraintInitialize, /* destroy proc */ NULL, /* set values proc */ ConstraintSetValues, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ NULL, /* num_syn_cont_resources */ 0, /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* Icon Box fields */ NULL /* extension */ } }; WidgetClass xmIconBoxWidgetClass = (WidgetClass)&xmIconBoxClassRec; /************************************************************ * STATIC CODE *************************************************************/ /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ static void ClassInitialize() { /* do nothing */ } /*ARGSUSED*/ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmIconBoxWidget ibw = (XmIconBoxWidget) set; /* * This is needed so that the right thing happens if an icon box is * created w/o any children. */ CalcCellSizes(set, NULL, FALSE, FALSE, &(XmIconBox_cell_width(ibw)), &(XmIconBox_cell_height(ibw))); } /* Function Name: Realize * Description: Called to realize this widget. * Arguments: w - Widget to realize. * valueMask, attributes - attributes to use when creating * this widget's window. * Returns: none. * * This overrides the Manager's frobbing with various values. */ static void Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes) { XtCreateWindow (w, InputOutput, CopyFromParent, *valueMask, attributes); } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - the widget to resize. * Returns: none. */ static void Resize(Widget w) { XmIconBoxWidget ibw = (XmIconBoxWidget) w; CalcCellSizes(w, NULL, TRUE, FALSE, &(XmIconBox_cell_width(ibw)), &(XmIconBox_cell_height(ibw))); PlaceChildren(w, NULL); } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the set values. * args, num_args - the arguments in the list. * Returns: none */ /*ARGSUSED*/ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmIconBoxWidget old_ibw = (XmIconBoxWidget) current; XmIconBoxWidget set_ibw = (XmIconBoxWidget) set; if ((XmIconBox_min_v_cells(old_ibw) != XmIconBox_min_v_cells(set_ibw)) || (XmIconBox_min_h_cells(old_ibw) != XmIconBox_min_h_cells(set_ibw)) || (XmIconBox_min_cell_width(old_ibw) != XmIconBox_min_cell_width(set_ibw)) || (XmIconBox_min_cell_height(old_ibw) != XmIconBox_min_cell_height(set_ibw)) || (XmIconBox_v_margin(old_ibw) != XmIconBox_v_margin(set_ibw)) || (XmIconBox_h_margin(old_ibw) != XmIconBox_h_margin(set_ibw)) ) { CalcCellSizes(set, NULL, FALSE, FALSE, &(XmIconBox_cell_width(set_ibw)), &(XmIconBox_cell_height(set_ibw))); PlaceChildren(set, NULL); } return(FALSE); } /* Function Name: QueryGeometry * Description: Called when my parent wants to know what size * I would like to be. * Arguments: w - the widget to check. * indended - constriants imposed by the parent. * preferred - what I would like. * Returns: See Xt Manual. */ static XtGeometryResult QueryGeometry(Widget w,XtWidgetGeometry *intended, XtWidgetGeometry *preferred) { XmIconBoxWidget ibw = (XmIconBoxWidget) w; Cardinal min_x, min_y; Dimension max_w, max_h; GetMinCells(w, &min_x, &min_y); GetMaxCellSize(w, NULL, &max_w, &max_h); min_x++; min_y++; preferred->width = XmIconBox_h_margin(ibw) + min_x * (max_w + XmIconBox_h_margin(ibw)); preferred->height= XmIconBox_v_margin(ibw) + min_y * (max_h + XmIconBox_v_margin(ibw)); return(_XmHWQuery(w, intended, preferred)); } /************************************************************ * * Composite and Constraint Information. * ************************************************************/ /* Function Name: GeometryManager * Description: handles requests from children for a size change. * Arguments: child - the child to change. * request - the geometry that the child wants. * return - what we will allow if this is an almost. * Returns: status. */ /*ARGSUSED*/ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry * request, XtWidgetGeometry * result) { Dimension cwidth, cheight; XmIconBoxWidget ibw = (XmIconBoxWidget) XtParent(w); IconInfo * info = GetIconInfo(w); Boolean w_req = (request->request_mode & CWWidth); Boolean h_req = (request->request_mode & CWHeight); Boolean x_req = (request->request_mode & CWX); Boolean y_req = (request->request_mode & CWY); if (!(request->request_mode & (CWWidth | CWHeight | CWX | CWY))) return(XtGeometryNo); result->request_mode = 0; if (w_req || h_req) { CalcCellSizes((Widget) ibw, w, FALSE, TRUE, &cwidth, &cheight); if(w_req) ASSIGN_MAX(cwidth, request->width); else ASSIGN_MAX(cwidth, w->core.width); if(h_req) ASSIGN_MAX(cheight, request->height); else ASSIGN_MAX(cheight, w->core.height); /* * Do not allow an x, y width and height request at the same time. * since it is unclear what this would mean. I want to place the * widget in the cell the center of it is over. With a multiple * request like this is it tough to find out which cell to use * since there are two reasonable values for height and width. */ result->x = w->core.x; result->y = w->core.y; result->width = cwidth; result->height = cheight; result->request_mode |= CWX | CWY | CWHeight | CWWidth; } else if ( x_req || y_req ) { Position x, y; short cell_x, cell_y; if (x_req) x = request->x; else x = w->core.x; if (y_req) y = request->y; else y = w->core.y; FindNearestCellLocation((Widget) ibw, &x, &y); GetCellFromXY((Widget) ibw, x, y, &cell_x, &cell_y); if (XmIconBoxIsCellEmpty((Widget) ibw, cell_x, cell_y, w)) { result->x = x; result->y = y; result->request_mode |= CWX | CWY; } else /* Cell is full, return NO. */ return(XtGeometryNo); } if (((request->x == result->x) || !x_req) && ((request->y == result->y) || !y_req) && ((request->width == result->width) || !w_req) && ((request->height == result->height) || !h_req)) { if (request->request_mode & (CWBorderWidth | CWStackMode | CWSibling)) { return(XtGeometryAlmost); } if (request->request_mode & XtCWQueryOnly) return(XtGeometryYes); if (w_req || h_req) { if (w_req) info->pref_width = w->core.width = request->width; if (h_req) info->pref_height = w->core.height = request->height; } else { /* * NOTE: We are assuming here that the cell height/width * did not change. This is valid because this code is * only executed if w_req and h_req are false. */ GetCellFromXY((Widget) ibw, result->x, result->y, &(info->cell_x), &(info->cell_y)); } CalcCellSizes((Widget) ibw, NULL, FALSE, FALSE, &(XmIconBox_cell_width(ibw)), &(XmIconBox_cell_height(ibw))); PlaceChildren((Widget) ibw, w); return(XtGeometryYes); } info->pref_width = info->pref_height = 0; /* invalidate cache. */ if (((request->x == result->x) || !x_req) || ((request->y == result->y) || !y_req) || ((request->width == result->width) || !w_req) || ((request->height == result->height) || !h_req)) { return(XtGeometryAlmost); } else return(XtGeometryNo); } /* Function Name: InsertChild * Description: called when a new child is to be added. * Arguments: w - the new child. * Returns: none. * * This routine simply makes sure that no gadgets are added. */ static void InsertChild(Widget w) { if (_XmGadgetWarning(w)) return; { XtWidgetProc insert_child; _XmProcessLock(); insert_child = ( (CompositeWidgetClass) SUPERCLASS)->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(w); } } /* Function Name: ChangeManaged * Description: When a management change has occured... * Arguments: w - the icon box widget. * Returns: none. */ static void ChangeManaged(Widget w) { XmIconBoxWidget ibw = (XmIconBoxWidget) w; Widget * childp; CalcCellSizes(w, NULL, FALSE, TRUE, &(XmIconBox_cell_width(ibw)), &(XmIconBox_cell_height(ibw))); ForAllChildren(ibw, childp) { IconInfo * info = GetIconInfo(*childp); if ((info->cell_x != XmIconBoxAnyCell) && (info->cell_y != XmIconBoxAnyCell) && !XmIconBoxIsCellEmpty((Widget) ibw, info->cell_x, info->cell_y, *childp)) { static String params[1]; Cardinal num = 1; char buf[BUFSIZ]; params[0] = buf; snprintf(buf, BUFSIZ, "(%d, %d)", info->cell_x, info->cell_y); _XmWarningMsg(w, XmNcellNotEmpty, XmNcellNotEmptyMsg, params, num); /* * tell it to reset this to an empty cell. */ info->cell_y = XmIconBoxAnyCell; } if ((info->cell_x == XmIconBoxAnyCell) || (info->cell_y == XmIconBoxAnyCell)) { Position x = (*childp)->core.x; Position y = (*childp)->core.y; Position cell_x, cell_y; /* * If the cell location is not specified try to find the * cell nearest the X and Y coords specified. */ FindNearestCellLocation((Widget) ibw, &x, &y); GetCellFromXY((Widget) ibw, x, y, &cell_x, &cell_y); if (XmIconBoxIsCellEmpty((Widget) ibw, cell_x, cell_y, w)) { info->cell_x = cell_x; info->cell_y = cell_y; } /* * If this cell is full the just find any empty cell. */ else if (!SetToEmptyCell(*childp)) { XmeWarning(w, XmNnoEmptyCellsMsg); } } } CalcCellSizes(w, NULL, FALSE, FALSE, &(XmIconBox_cell_width(ibw)), &(XmIconBox_cell_height(ibw))); PlaceChildren(w, NULL); XmeNavigChangeManaged(w); /* For Motif navigation */ } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmICONBOX_BIT); } /* Function Name: ConstraintInitialize * Description: Called when a childs constriaints need initializing. * Arguments: req - the widget being requested. * set - what this will become. * args, num_args - the argument list. * Returns: none. */ /*ARGSUSED*/ static void ConstraintInitialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { IconInfo * info = GetIconInfo(set); info->pref_width = req->core.width; info->pref_height = req->core.height; } /* Function Name: ConstraintSetValues * Description: Called when some constraint data needs to be modified * on-the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /*ARGSUSED*/ static Boolean ConstraintSetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { IconInfo * set_info = GetIconInfo(set); IconInfo * old_info = GetIconInfo(current); if (set->core.width != set_info->pref_width) set_info->pref_width = 0; if (set->core.height != set_info->pref_height) set_info->pref_height = 0; if ((set_info->cell_x != old_info->cell_x) || (set_info->cell_y != old_info->cell_y)) { if ( XmIconBoxIsCellEmpty(XtParent(set), set_info->cell_x, set_info->cell_y, set)) { GetXYFromCell(XtParent(set), set_info, &(set->core.x), &(set->core.y)); } else { static String params[1]; Cardinal num = 1; char buf[BUFSIZ]; params[0] = buf; snprintf(buf, BUFSIZ, "(%d, %d)", set_info->cell_x, set_info->cell_y); _XmWarningMsg(set, XmNcellNotEmpty, XmNcellNotEmptyMsg, params, num); set_info->cell_x = old_info->cell_x; set_info->cell_y = old_info->cell_y; } } return(False); } /************************************************************ * * Actions and Callbacks. * ************************************************************/ /************************************************************ * * Internal routines. * ************************************************************/ /* Function Name: GetCellFromXY * Description: Gets the cell located at this location. * Arguments: w - the icon box. * x, y - the coordinates in X space. * RETURNED cell_x, cell_y - the corrdinates in cell space. * Returns: none. */ static void GetCellFromXY(Widget w, Position x, Position y, Position * cell_x, Position * cell_y) { XmIconBoxWidget ibw = (XmIconBoxWidget) w; *cell_x = (int)x / (int)(XmIconBox_cell_width(ibw) + XmIconBox_h_margin(ibw)); *cell_y = (int)y / (int)(XmIconBox_cell_height(ibw) + XmIconBox_v_margin(ibw)); } /* Function Name: Find Nearest Cell Location * Description: Finds the nearest cell * Arguments: ibw - the icon box widget. * IN/OUT x, y - Used as an input for the current location * is output with the new location. * Returns: none */ static void FindNearestCellLocation(Widget w, Position *x, Position *y) { IconInfo temp; Dimension width, height; XmIconBoxWidget ibw = (XmIconBoxWidget) w; width = XmIconBox_cell_width(ibw); height = XmIconBox_cell_height(ibw); GetCellFromXY(w, *x + width/2, *y + height/2, &(temp.cell_x), &(temp.cell_y)); GetXYFromCell(w, &temp, x, y); } /* Function Name: GetXYFromCell * Description: Gets the X and Y position for this cell. * Arguments: info - the cell info. * RETURNED x, y - the coordinates in X space. * Returns: none. */ static void GetXYFromCell(Widget w, IconInfo * info, Position * x, Position * y) { XmIconBoxWidget ibw = (XmIconBoxWidget) w; Position x_temp = (info->cell_x < 0) ? 0 : info->cell_x; Position y_temp = (info->cell_y < 0) ? 0 : info->cell_y; *x = XmIconBox_h_margin(ibw) + x_temp * (XmIconBox_cell_width(ibw) + XmIconBox_h_margin(ibw)); *y = XmIconBox_v_margin(ibw) + y_temp * (XmIconBox_cell_height(ibw) + XmIconBox_v_margin(ibw)); } /* Function Name: PlaceChildren * Description: Places all managed children correctly. * Arguments: w - the icon box widget. * child - set attributes rather than configure this child. * Returns: none. */ static void PlaceChildren(Widget w, Widget child) { Widget * childp; Position x, y; XmIconBoxWidget ibw = (XmIconBoxWidget) w; ForAllChildren(ibw, childp) { if (!XtIsManaged(*childp)) continue; GetXYFromCell(w, GetIconInfo(*childp), &x, &y); if (*childp == child) { child->core.x = x; child->core.y = y; child->core.width = XmIconBox_cell_width(ibw); child->core.height = XmIconBox_cell_height(ibw); } else { _XmConfigureWidget(*childp, x, y, XmIconBox_cell_width(ibw), XmIconBox_cell_height(ibw), (*childp)->core.border_width); } } } /* Function Name: CalcCellSizes * Description: Calculates the height and width of each cell. * Arguments: w - the icon box widget. * ignore - ignore this child when calculating cell sizes. * noresize - If true then never attempt a resize. * query_only - only ask, don't change anything. * cell_width, cell_height - new size of each cell. * Returns: none. */ static void CalcCellSizes(Widget w, Widget ignore, Boolean noresize, Boolean query_only, Dimension * cell_width, Dimension * cell_height) { XmIconBoxWidget ibw = (XmIconBoxWidget) w; Cardinal min_x, min_y; Dimension max_w, max_h, d_width, d_height, width, height; GetMinCells(w, &min_x, &min_y); GetMaxCellSize(w, ignore, &max_w, &max_h); min_x++; min_y++; d_width = XmIconBox_h_margin(ibw) + min_x * (max_w + XmIconBox_h_margin(ibw)); d_height = XmIconBox_v_margin(ibw) + min_y * (max_h + XmIconBox_v_margin(ibw)); if (noresize || (_XmRequestNewSize(w, query_only, d_width, d_height, &width, &height) != XtGeometryYes)) { if (noresize) { width = w->core.width; height = w->core.height; } /* * We may need to adjust the cell size. */ if (width < d_width) max_w = (width - XmIconBox_h_margin(ibw))/ min_x - XmIconBox_h_margin(ibw); if (height < d_height) max_h = (height - XmIconBox_v_margin(ibw))/ min_y - XmIconBox_v_margin(ibw); } *cell_width = max_w; *cell_height = max_h; } /* Function Name: GetMinCells * Description: Returns the minimum number of cells that should * be displayed in each direction. * Arguments: w - the Icon Box widget. * RETURN min_x, min_y - minimum number of cells needed * in each direction. * * Returns: */ static void GetMinCells(Widget w, Cardinal * min_x, Cardinal * min_y) { Widget * childp; XmIconBoxWidget ibw = (XmIconBoxWidget) w; *min_x = XmIconBox_min_h_cells(ibw) - 1; *min_y = XmIconBox_min_v_cells(ibw) - 1; ForAllChildren(ibw, childp) { Position x, y; IconInfo * info; if (!XtIsManaged(*childp)) continue; info = GetIconInfo(*childp); x = (info->cell_x < 0) ? 0 : info->cell_x; y = (info->cell_y < 0) ? 0 : info->cell_y; if (x > *min_x) *min_x = x; if (y > *min_y) *min_y = y; } } /* Function Name: GetMaxCellSize * Description: Gets the maximum size of each cell. * Arguments: w - the Icon Box widget. * ignore - ignore this child. * max_w, max_h - the maximum size of each cell. * Returns: none. */ static void GetMaxCellSize(Widget w, Widget ignore, Dimension * max_w, Dimension * max_h) { Widget * childp; XmIconBoxWidget ibw = (XmIconBoxWidget) w; XtWidgetGeometry preferred; register Dimension temp; *max_w = XmIconBox_min_cell_width(ibw); *max_h = XmIconBox_min_cell_height(ibw); ForAllChildren(ibw, childp) { IconInfo * info = GetIconInfo(*childp); if (!XtIsManaged(*childp) || (*childp == ignore)) continue; if ((info->pref_width != 0) && (info->pref_height != 0)) { preferred.width = info->pref_width; preferred.height = info->pref_height; preferred.border_width = (*childp)->core.border_width; } else { (void) XtQueryGeometry(*childp, NULL, &preferred); info->pref_width = preferred.width; info->pref_height = preferred.height; } temp = preferred.width + 2 * preferred.border_width; ASSIGN_MAX(*max_w, temp); temp = preferred.height + 2 * preferred.border_width; ASSIGN_MAX(*max_h, temp); } } /* Function Name: SetToEmptyCell * Description: Puts the widget passed into an empty node as * close to 0, 0 as possible. * Arguments: child - the child. * Returns: True if an empty cell was found. */ static Boolean SetToEmptyCell(Widget child) { XmIconBoxWidget ibw = (XmIconBoxWidget) XtParent(child); register Position x, y, cur_x, cur_y; register unsigned long square, cur_square; Cardinal max_x, max_y; GetMinCells((Widget) ibw, &max_x, &max_y); cur_x = cur_y = XmIconBoxAnyCell; cur_square = max_x * max_x + max_y * max_y; for (y = 0; y <= max_y; y++) for (x = 0; x <= max_x; x++) { square = x * x + y * y; if (square <= cur_square && XmIconBoxIsCellEmpty(XtParent(child), x, y, NULL)) { cur_square = square; cur_x = x; cur_y = y; break; } else if (square >= cur_square) continue; } if (cur_x == XmIconBoxAnyCell) { IconInfo * info = GetIconInfo(child); info->cell_x = 0; info->cell_y = max_y + 1; } else { IconInfo * info = GetIconInfo(child); info->cell_x = cur_x; info->cell_y = cur_y; } return(TRUE); } /************************************************************ * * Public Functions. * ************************************************************/ /* Function Name: XmIconBoxIsCellEmpty * Description: Returns true if this cell is unused. * Arguments: w - the icon box. * x, y - cell to check. * ignore - ignore this widget when checking. * Returns: Returns true if this cell is unused. */ Boolean XmIconBoxIsCellEmpty(Widget w, Position x, Position y, Widget ignore) { XmIconBoxWidget ibw = (XmIconBoxWidget) w; Widget * childp; _XmWidgetToAppContext(w); _XmAppLock(app); ForAllChildren(ibw, childp) { IconInfo * info; if (!XtIsManaged(*childp) || (*childp == ignore) || (*childp)->core.being_destroyed) { continue; } info = GetIconInfo(*childp); if ((x == info->cell_x) && (y == info->cell_y)) { _XmAppUnlock(app); return(False); } } _XmAppUnlock(app); return(True); } /* Function Name: XmCreateIconBox * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateIconBox(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmIconBoxWidgetClass, parent, args, num_args)); } motif-2.3.8/lib/Xm/Display.c0000644000175000017500000010347013145162623012476 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Display.c /main/23 1997/06/18 17:36:59 samborn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "XmI.h" #include "DisplayI.h" #include "DragBSI.h" #include "DragCI.h" #include "DragICCI.h" #include "MessagesI.h" #include "VirtKeysI.h" #include "ColorObjI.h" #define MESSAGE1 _XmMMsgDisplay_0001 #define MESSAGE2 _XmMMsgDisplay_0002 #define MESSAGE3 _XmMMsgDisplay_0003 #define TheDisplay(dd) (XtDisplayOfObject((Widget)dd)) #define TheScreen(dd) (XtScreen((Widget)dd)) #define Offset(x) (XtOffsetOf( struct _XmDisplayRec, x)) #define CHECK_TIME(dc, time) \ ((dc->drag.dragStartTime <= time) && \ ((dc->drag.dragFinishTime == 0) || (time <= dc->drag.dragFinishTime))) #define INVALID_PROTOCOL_VALUE 255 /******** Static Function Declarations ********/ static void DisplayClassPartInitialize( WidgetClass wc) ; static void DisplayClassInitialize( void ) ; static void SetDragReceiverInfo( Widget w, XtPointer client_data, XEvent *event, Boolean *dontSwallow) ; static void TreeUpdateHandler( Widget w, XtPointer client, XtPointer call) ; static void DisplayInitialize( Widget requested_widget, Widget new_widget, ArgList args, Cardinal *num_args) ; static void DisplayInsertChild( Widget w) ; static void DisplayDeleteChild( Widget w) ; static void DisplayDestroy( Widget w) ; static XmDragContext FindDC( XmDisplay xmDisplay, Time time, #if NeedWidePrototypes int sourceIsExternal) ; #else Boolean sourceIsExternal) ; #endif /* NeedWidePrototypes */ static int isMine( Display *dpy, register XEvent *event, char *arg) ; static void ReceiverShellExternalSourceHandler( Widget w, XtPointer client_data, XEvent *event, Boolean *dontSwallow) ; static Widget GetDisplay( Display *display) ; /******** End Static Function Declarations ********/ externaldef(displaymsg) String _Xm_MOTIF_DRAG_AND_DROP_MESSAGE = NULL; static XContext displayContext = 0; static WidgetClass curDisplayClass = NULL; static XtResource resources[] = { { XmNdropSiteManagerClass, XmCDropSiteManagerClass, XmRWidgetClass, sizeof(WidgetClass), Offset(display.dropSiteManagerClass), XmRImmediate, (XtPointer)&xmDropSiteManagerClassRec, }, { XmNdropTransferClass, XmCDropTransferClass, XmRWidgetClass, sizeof(WidgetClass), Offset(display.dropTransferClass), XmRImmediate, (XtPointer)&xmDropTransferClassRec, }, { XmNdragContextClass, XmCDragContextClass, XmRWidgetClass, sizeof(WidgetClass), Offset(display.dragContextClass), XmRImmediate, (XtPointer)&xmDragContextClassRec, }, { XmNdragInitiatorProtocolStyle, XmCDragInitiatorProtocolStyle, XmRDragInitiatorProtocolStyle, sizeof(unsigned char), Offset(display.dragInitiatorProtocolStyle), XmRImmediate, (XtPointer)XmDRAG_PREFER_RECEIVER, }, { XmNdragReceiverProtocolStyle, XmCDragReceiverProtocolStyle, XmRDragReceiverProtocolStyle, sizeof(unsigned char), Offset(display.dragReceiverProtocolStyle), XmRImmediate, (XtPointer) XmDRAG_PREFER_PREREGISTER, }, { XmNdefaultVirtualBindings, XmCDefaultVirtualBindings, XmRString, sizeof(String), Offset(display.bindingsString), XmRImmediate, (XtPointer)NULL, }, { XmNuserData, XmCUserData, XmRPointer, sizeof(XtPointer), Offset(display.user_data), XmRImmediate, (XtPointer) NULL }, { XmNmotifVersion, XmCMotifVersion, XmRInt, sizeof(int), Offset(display.motif_version), XmRImmediate, (XtPointer) XmVersion }, { XmNenableWarp, XmCEnableWarp, XmREnableWarp, sizeof(XtEnum), Offset(display.enable_warp), XmRImmediate, (XtPointer) True }, { XmNdragStartCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(display.dragStartCallback), XmRImmediate, (XtPointer)NULL, }, { XmNnoFontCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(display.noFontCallback), XmRImmediate, (XtPointer)NULL, }, { XmNnoRenditionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(display.noRenditionCallback), XmRImmediate, (XtPointer)NULL, }, { XmNenableBtn1Transfer, XmCEnableBtn1Transfer, XmREnableBtn1Transfer, sizeof(XtEnum), Offset(display.enable_btn1_transfer), XmRImmediate, (XtPointer) XmOFF }, { XmNenableButtonTab, XmCEnableButtonTab, XmRBoolean, sizeof(Boolean), Offset(display.enable_button_tab), XmRImmediate, (XtPointer) False }, { XmNenableEtchedInMenu, XmCEnableEtchedInMenu, XmRBoolean, sizeof(Boolean), Offset(display.enable_etched_in_menu), XmRImmediate, (XtPointer) False }, { XmNdefaultButtonEmphasis, XmCDefaultButtonEmphasis, XmRDefaultButtonEmphasis, sizeof(XtEnum), Offset(display.default_button_emphasis), XmRImmediate, (XtPointer) XmEXTERNAL_HIGHLIGHT }, { XmNenableToggleColor, XmCEnableToggleColor, XmRBoolean, sizeof(Boolean), Offset(display.enable_toggle_color), XmRImmediate, (XtPointer) False }, { XmNenableToggleVisual, XmCEnableToggleVisual, XmRBoolean, sizeof(Boolean), Offset(display.enable_toggle_visual), XmRImmediate, (XtPointer) False }, { XmNenableDragIcon, XmCEnableDragIcon, XmRBoolean, sizeof(Boolean), Offset(display.enable_drag_icon), XmRImmediate, (XtPointer) False }, { XmNenableUnselectableDrag, XmCEnableUnselectableDrag, XmRBoolean, sizeof(Boolean), Offset(display.enable_unselectable_drag), XmRImmediate, (XtPointer) True }, { XmNenableThinThickness, XmCEnableThinThickness, XmRBoolean, sizeof(Boolean), Offset(display.enable_thin_thickness), XmRImmediate, (XtPointer) False }, { XmNenableMultiKeyBindings, XmCEnableMultiKeyBindings, XmRBoolean, sizeof(Boolean), Offset(display.enable_multi_key_bindings), XmRImmediate, (XtPointer) False }, /* Force this resource to avoid loop in the pixmap conversion. XmDisplay is a VendorShell, so when iconPixmap is set in a resource file, the VendorShell converter is called, but since it needs an XmDisplay (via an XmScreen resource), it goes and create the XmDisplay, for which the iconPixmap is also converted: loop. By forcing it to Bitmap, the screen bitmapConversionModel is not needed and it works. This is a small limitation in XmDisplay */ { XmNiconPixmap, XmCIconPixmap, XmRBitmap, sizeof(Pixmap), XtOffsetOf(WMShellRec, wm.wm_hints.icon_pixmap), XmRImmediate, NULL }, }; #undef Offset static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), (XtInitProc)NULL, /* InitializePrehook */ (XtSetValuesFunc)NULL, /* SetValuesPrehook */ (XtInitProc)NULL, /* InitializePosthook */ (XtSetValuesFunc)NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ (XtInitProc)NULL, /* secondaryCreate */ (XmGetSecResDataFunc)NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ (XtArgsProc)NULL, /* getValuesPrehook */ (XtArgsProc)NULL, /* getValuesPosthook */ (XtWidgetClassProc)NULL, /* classPartInitPrehook */ (XtWidgetClassProc)NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ (XmWidgetNavigableProc)NULL, /* widgetNavigable */ (XmFocusChangeProc)NULL, /* focusChange */ (XmWrapperData)NULL /* wrapperData */ }; externaldef(xmdisplayclassrec) XmDisplayClassRec xmDisplayClassRec = { { (WidgetClass) &applicationShellClassRec, /* superclass */ "XmDisplay", /* class_name */ sizeof(XmDisplayRec), /* size */ DisplayClassInitialize, /* Class Initializer */ DisplayClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ DisplayInitialize, /* initialize */ _XmColorObjCreate, /* initialize_notify */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ DisplayDestroy, /* destroy */ (XtWidgetProc)NULL, /* resize */ (XtExposeProc)NULL, /* expose */ (XtSetValuesFunc)NULL, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ (XtAlmostProc)NULL, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ (XtGeometryHandler)NULL, /* query_geometry */ (XtStringProc)NULL, /* display_accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite class record */ (XtGeometryHandler)NULL, /* geometry_manager */ (XtWidgetProc)NULL, /* change_managed */ DisplayInsertChild, /* insert_child */ DisplayDeleteChild, /* from the shell */ NULL, /* extension record */ }, { /* shell class record */ NULL, /* extension record */ }, { /* wm shell class record */ NULL, /* extension record */ }, { /* vendor shell class record */ NULL, /* extension record */ }, { /* toplevelclass record */ NULL, /* extension record */ }, { /* appShell record */ NULL, /* extension record */ }, { /* Display class */ GetDisplay, /* GetDisplay */ NULL, /* extension */ }, }; externaldef(xmdisplayclass) WidgetClass xmDisplayClass = (WidgetClass) (&xmDisplayClassRec); static void DisplayClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit(wc, XmDISPLAY_BIT); } static void DisplayClassInitialize( void ) { baseClassExtRec.record_type = XmQmotif; _Xm_MOTIF_DRAG_AND_DROP_MESSAGE = XmMakeCanonicalString("_MOTIF_DRAG_AND_DROP_MESSAGE"); } /*ARGSUSED*/ static void SetDragReceiverInfo( Widget w, XtPointer client_data, XEvent *event, Boolean *dontSwallow ) { XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); if (XtIsRealized(w)) { _XmSetDragReceiverInfo(dd, (Widget)client_data); XtRemoveEventHandler(w, StructureNotifyMask, False, SetDragReceiverInfo, client_data); } } /* * this routine is registered on the XmNtreeUpdateProc resource of the * dropSiteManager. It is called whenever the tree is changed. */ /*ARGSUSED*/ static void TreeUpdateHandler( Widget w, XtPointer client, XtPointer call ) { XmAnyCallbackStruct *anyCB = (XmAnyCallbackStruct *)call; XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); if (dd->display.dragReceiverProtocolStyle == XmDRAG_NONE) return; switch(anyCB->reason) { case XmCR_DROP_SITE_TREE_ADD: { XmDropSiteTreeAddCallback cb = (XmDropSiteTreeAddCallback)anyCB; if (XtIsRealized(cb->rootShell)) { _XmSetDragReceiverInfo(dd, cb->rootShell); } else { XtAddEventHandler(cb->rootShell, StructureNotifyMask, False, SetDragReceiverInfo, (XtPointer)cb->rootShell); } /* * ClientMessages are not maskable so all we have to * do is indicate interest in non-maskable events. */ XtAddEventHandler(cb->rootShell, NoEventMask, True, ReceiverShellExternalSourceHandler, (XtPointer)dd); } break; case XmCR_DROP_SITE_TREE_REMOVE: { XmDropSiteTreeRemoveCallback cb = (XmDropSiteTreeRemoveCallback)anyCB; XtRemoveEventHandler(cb->rootShell, NoEventMask, True, ReceiverShellExternalSourceHandler, (XtPointer)dd); if (XtIsRealized(cb->rootShell)) _XmClearDragReceiverInfo(cb->rootShell); } break; default: break; } } /************************************************************************ * * DisplayInitialize * ************************************************************************/ /* ARGSUSED */ static void DisplayInitialize( Widget requested_widget, Widget new_widget, ArgList args, Cardinal *num_args ) { static char *atom_names[] = { "Customize Data:0", /* XmSCUSTOMIZE_DATA + "0" */ XmIATOM_PAIR, XmIAVERAGE_WIDTH, XmIPIXEL_SIZE, XmIRESOLUTION_Y, XmIWM_DELETE_WINDOW, XmI_MOTIF_DRAG_ATOMS, XmI_MOTIF_DRAG_INITIATOR_INFO, XmI_MOTIF_DRAG_PROXY_WINDOW, XmI_MOTIF_DRAG_RECEIVER_INFO, XmI_MOTIF_DRAG_TARGETS, XmI_MOTIF_DRAG_WINDOW, XmSCLIPBOARD, XmSCLIP_TEMPORARY, XmSCOMPOUND_TEXT, XmSDELETE, XmSINCR, XmSINSERT_SELECTION, XmSLENGTH, XmSLINK_SELECTION, XmSMULTIPLE, XmSNULL, XmSTARGETS, XmSTEXT, XmSTIMESTAMP, XmSTRANSFER_FAILURE, XmSTRANSFER_SUCCESS, XmSWM_STATE, XmS_MOTIF_ATOM_0, XmS_MOTIF_CLIP_DATA_DELETE, XmS_MOTIF_CLIP_DATA_REQUEST, XmS_MOTIF_CLIP_HEADER, XmS_MOTIF_CLIP_LOCK_ACCESS_VALID, XmS_MOTIF_CLIP_MESSAGE, XmS_MOTIF_CLIP_NEXT_ID, XmS_MOTIF_CLIP_TIME, XmS_MOTIF_CLIPBOARD_TARGETS, XmS_MOTIF_DESTINATION, XmS_MOTIF_DRAG_OFFSET, XmS_MOTIF_DEFERRED_CLIPBOARD_TARGETS, XmS_MOTIF_DROP, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_LOSE_SELECTION, _XA_MOTIF_BINDINGS, _XA_MOTIF_WM_HINTS, _XA_MOTIF_WM_INFO, _XA_MOTIF_WM_MENU, _XA_MOTIF_WM_MESSAGES, _XA_MOTIF_WM_OFFSET, "WM_PROTOCOLS" }; Atom atoms[XtNumber(atom_names)]; XmDisplay xmDisplay = (XmDisplay)new_widget; int dummy1, dummy2; XContext context; /* * Pre-load the Xlib atom cache with atoms we are likely to use, * similar to the way _XmInitAtomPairs() did in Motif 1.2.x. */ XInternAtoms(XtDisplay(xmDisplay), atom_names, XtNumber(atom_names), False, atoms); xmDisplay->display.shellCount = 0; xmDisplay->display.numModals = 0; xmDisplay->display.modals = NULL; xmDisplay->display.maxModals = 0; xmDisplay->display.userGrabbed = False; xmDisplay->display.activeDC = NULL; xmDisplay->display.dsm = (XmDropSiteManagerObject) NULL; xmDisplay->display.proxyWindow = _XmGetDragProxyWindow(XtDisplay(xmDisplay)); _XmInitByteOrderChar(); xmDisplay->display.xmim_info = NULL; xmDisplay->display.displayInfo = (XtPointer) XtNew(XmDisplayInfo); ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->SashCursor = 0L; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->TearOffCursor = 0L; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->UniqueStamp = 0L; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->destinationWidget= (Widget)NULL; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->excParentPane.pane = (Widget *)NULL; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->excParentPane.pane_list_size = 0; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->excParentPane.num_panes= 0; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->resetFocusFlag = 0; ((XmDisplayInfo *)(xmDisplay->display.displayInfo))->traversal_in_progress= FALSE; xmDisplay->display.displayHasShapeExtension = XShapeQueryExtension(XtDisplay(xmDisplay), &dummy1, &dummy2); /* Handle dynamic default of receiver protocol style */ if (xmDisplay->display.dragReceiverProtocolStyle == INVALID_PROTOCOL_VALUE) { if (xmDisplay->display.displayHasShapeExtension) xmDisplay->display.dragReceiverProtocolStyle = XmDRAG_PREFER_DYNAMIC; else xmDisplay->display.dragReceiverProtocolStyle = XmDRAG_PREFER_PREREGISTER; } _XmVirtKeysInitialize (new_widget); _XmProcessLock(); if (displayContext == 0) displayContext = XUniqueContext(); context = displayContext; _XmProcessUnlock(); if (! XFindContext(XtDisplay(xmDisplay), None, context, (char **) &xmDisplay)) { /* * There's one already created for this display. * What should we do? If we destroy the previous one, we may * wreak havoc with shell modality and screen objects. BUT, * Xt doesn't really give us a way to abort a create. We'll * just let the new one dangle. */ XmeWarning((Widget) xmDisplay, MESSAGE1); } else { XSaveContext(XtDisplayOfObject((Widget)xmDisplay), None, context, (char *)xmDisplay); } if (xmDisplay->display.enable_multi_key_bindings) { Display * display = XtDisplay(new_widget); int i, num_screens = ScreenCount(display); XrmDatabase new_db; for (i = 0; i < num_screens; i++) { Screen * screen = ScreenOfDisplay(display, i); XrmDatabase db = XtScreenDatabase(screen); new_db = XrmGetStringDatabase(_XmDisplay_baseTranslations); XrmCombineDatabase(new_db, &db, False); } } } /************************************************************************ * * DisplayInsertChild * ************************************************************************/ static void DisplayInsertChild( Widget w ) { if (XtIsRectObj(w)) { XtWidgetProc insert_child; _XmProcessLock(); insert_child = ((CompositeWidgetClass)compositeWidgetClass) ->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(w); } } /************************************************************************ * * DisplayDeleteChild * ************************************************************************/ static void DisplayDeleteChild( Widget w ) { if (XtIsRectObj(w)) { XtWidgetProc delete_child; _XmProcessLock(); delete_child = ((CompositeWidgetClass)compositeWidgetClass) ->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(w); } } /************************************************************************ * * DisplayDestroy * ************************************************************************/ /* ARGSUSED */ static void DisplayDestroy( Widget w ) { XmDisplay dd = (XmDisplay) w ; XContext context; _XmProcessLock(); context = displayContext; _XmProcessUnlock(); XtFree((char *) dd->display.modals); if (((XmDisplayInfo *)(dd->display.displayInfo)) ->excParentPane.pane != (Widget *)NULL) XtFree((char *) ((XmDisplayInfo *)(dd->display.displayInfo)) ->excParentPane.pane); XtFree((char *) dd->display.displayInfo); /* Destroy the DropSiteManager object. */ if (dd->display.dsm != NULL) XtDestroyWidget((Widget) dd->display.dsm); _XmClearDisplayTables(XtDisplay(w)); _XmVirtKeysDestroy (w); XDeleteContext( XtDisplay( w), None, context) ; } /*ARGSUSED*/ XmDropSiteManagerObject _XmGetDropSiteManagerObject( XmDisplay xmDisplay ) { /* Defer the creation of the XmDisplayObject's DropSiteManager until * it is referenced, since the converters of some DSM resources * (animationPixmap, for instance) depend on the presence of the * Display/Screen objects, and a circular recursive creation loop * results if the DSM is created during DisplayInitialize. */ if( xmDisplay->display.dsm == NULL ) { Arg lclArgs[1] ; XtSetArg( lclArgs[0], XmNtreeUpdateProc, TreeUpdateHandler) ; xmDisplay->display.dsm = (XmDropSiteManagerObject) XtCreateWidget( "dsm", xmDisplay->display.dropSiteManagerClass, (Widget) xmDisplay, lclArgs, 1) ; } return( xmDisplay->display.dsm); } unsigned char _XmGetDragProtocolStyle( Widget w ) { XmDisplay xmDisplay; unsigned char style; xmDisplay = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); switch(xmDisplay->display.dragReceiverProtocolStyle) { case XmDRAG_NONE: case XmDRAG_DROP_ONLY: style = XmDRAG_NONE; break; case XmDRAG_DYNAMIC: style = XmDRAG_DYNAMIC; break; case XmDRAG_PREFER_DYNAMIC: case XmDRAG_PREFER_PREREGISTER: case XmDRAG_PREREGISTER: style = XmDRAG_PREREGISTER; break; default: style = XmDRAG_NONE; break; } return style; } Widget XmGetDragContext( Widget w, Time time ) { XmDisplay xmDisplay; XmDragContext matchedDC = NULL, dc = NULL; Cardinal i; _XmWidgetToAppContext(w); _XmAppLock(app); xmDisplay = (XmDisplay)XmGetXmDisplay(XtDisplay(w)); for(i = 0; i < xmDisplay->composite.num_children; i++) { dc = (XmDragContext)(xmDisplay->composite.children[i]); if ((XmIsDragContext((Widget) dc)) && (CHECK_TIME(dc, time)) && ((!matchedDC) || (matchedDC->drag.dragStartTime < dc->drag.dragStartTime)) && !dc->core.being_destroyed) matchedDC = dc; } _XmAppUnlock(app); return((Widget)matchedDC); } Widget _XmGetDragContextFromHandle( Widget w, Atom iccHandle ) { XmDisplay xmDisplay; XmDragContext dc; Cardinal i; xmDisplay = (XmDisplay)XmGetXmDisplay(XtDisplay(w)); for(i = 0; i < xmDisplay->composite.num_children; i++) { dc = (XmDragContext)(xmDisplay->composite.children[i]); if ((XmIsDragContext((Widget) dc)) && (dc->drag.iccHandle == iccHandle) && !dc->core.being_destroyed) return((Widget)dc); } return(NULL); } static XmDragContext FindDC( XmDisplay xmDisplay, Time time, #if NeedWidePrototypes int sourceIsExternal ) #else Boolean sourceIsExternal ) #endif /* NeedWidePrototypes */ { XmDragContext dc = NULL; Cardinal i; for(i = 0; i < xmDisplay->composite.num_children; i++) { dc = (XmDragContext)(xmDisplay->composite.children[i]); if ((XmIsDragContext((Widget) dc)) && (CHECK_TIME(dc, time)) && (dc->drag.sourceIsExternal == sourceIsExternal) && !dc->core.being_destroyed) return(dc); } return(NULL); } /*ARGSUSED*/ static int isMine( Display *dpy, register XEvent *event, char *arg ) { XmDisplayEventQueryStruct *q = (XmDisplayEventQueryStruct *) arg; XmICCCallbackStruct callback, *cb = &callback; /* Once we have a drop start we must stop looking at the queue */ if (q->hasDropStart) return(False); if (!_XmICCEventToICCCallback((XClientMessageEvent *)event, cb, XmICC_INITIATOR_EVENT)) return(False); if ((cb->any.reason == XmCR_DROP_SITE_ENTER) || (cb->any.reason == XmCR_DROP_SITE_LEAVE)) { /* * We must assume this to be a dangling set of messages, so * we will quietly consume it in the interest of hygene. */ return(True); } if (!q->dc) q->dc = FindDC(q->dd, cb->any.timeStamp, True); /* * if we can find a dc then we have already processed * an enter for this shell. */ switch(cb->any.reason) { case XmCR_TOP_LEVEL_ENTER: q->hasLeave = False; if (q->dc == NULL) { *(q->enterCB) = *(XmTopLevelEnterCallbackStruct *)cb; q->hasEnter = True; } break; case XmCR_TOP_LEVEL_LEAVE: if (q->dc != NULL) { *(q->leaveCB) = *(XmTopLevelLeaveCallbackStruct *)cb; q->hasLeave = True; q->hasMotion = False; } else { /* * hasEnter is true if we are missing a * drag context because an enter got compressed. * In that case, all is OK, and no warning is * needed. ??? Is a warning ever needed ??? */ if (!q->hasEnter) XmeWarning((Widget) q->dd, MESSAGE2); } q->hasEnter = False; break; case XmCR_DRAG_MOTION: *(q->motionCB) = *(XmDragMotionCallbackStruct *)cb; q->hasMotion = True; break; case XmCR_DROP_START: *(q->dropStartCB) = *(XmDropStartCallbackStruct *)cb; q->hasDropStart = True; break; default: break; } return True; } /* * this handler is used to catch messages from external drag * contexts that want to map motion or drop events */ /*ARGSUSED*/ static void ReceiverShellExternalSourceHandler( Widget w, XtPointer client_data, XEvent *event, Boolean *dontSwallow ) { XmDragTopLevelClientDataStruct topClientData; XmTopLevelEnterCallbackStruct enterCB; XmTopLevelLeaveCallbackStruct leaveCB; XmDropStartCallbackStruct dropStartCB; XmDragMotionCallbackStruct motionCB; XmDisplayEventQueryStruct q; Widget shell = w; XmDisplay dd = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); XmDragContext dc; XmDropSiteManagerObject dsm = _XmGetDropSiteManagerObject( dd); /* * If dd has an active dc then we are the initiator. We shouldn't * do receiver processing as the initiator, so bail out. */ if (dd->display.activeDC != NULL) return; q.dd = dd; q.dc = (XmDragContext)NULL; q.enterCB = &enterCB; q.leaveCB = &leaveCB; q.motionCB = &motionCB; q.dropStartCB = &dropStartCB; q.hasEnter = q.hasDropStart = q.hasLeave = q.hasMotion = False; /* * Since this event handler gets called for all non-maskable events, * we want to bail out now with don't swallow if we don't want this * event. Otherwise we'll swallow it. */ /* * process the event that fired this event handler. * If it's not a Receiver DND event, bail out. */ if (!isMine(XtDisplayOfObject(w), event, (char*)&q)) return; /* * swallow all the pending messages inline except the last motion */ while (XCheckIfEvent( XtDisplayOfObject(w), event, isMine, (char*)&q)) /*EMPTY*/; dc = q.dc; if (q.hasEnter || q.hasMotion || q.hasDropStart || q.hasLeave) { /* * handle a dangling leave first */ if (q.hasLeave) { XmTopLevelLeaveCallback callback = &leaveCB; topClientData.destShell = shell; topClientData.xOrigin = shell->core.x; topClientData.yOrigin = shell->core.y; topClientData.sourceIsExternal = True; topClientData.iccInfo = NULL; topClientData.window = XtWindow(w); topClientData.dragOver = NULL; _XmDSMUpdate(dsm, (XtPointer)&topClientData, (XtPointer)callback); /* destroy it if no drop. otherwise done in dropTransfer */ if (!q.hasDropStart) { XtDestroyWidget((Widget)dc); q.dc = dc = NULL; } } /* * check for a dropStart from a preregister client or an enter * either of which require a dc to be alloced */ if (q.hasEnter || q.hasDropStart) { if (!q.dc) { Arg args[4]; Cardinal i = 0; Time timeStamp; Window window; Atom iccHandle; if (q.hasDropStart) { XmDropStartCallback dsCallback = &dropStartCB; timeStamp = dsCallback->timeStamp; window = dsCallback->window; iccHandle = dsCallback->iccHandle; } else { XmTopLevelEnterCallback teCallback = &enterCB; timeStamp = teCallback->timeStamp; window = teCallback->window; iccHandle = teCallback->iccHandle; } XtSetArg(args[i], XmNsourceWindow, window);i++; XtSetArg(args[i], XmNsourceIsExternal,True);i++; XtSetArg(args[i], XmNstartTime, timeStamp);i++; XtSetArg(args[i], XmNiccHandle, iccHandle);i++; dc = (XmDragContext) XtCreateWidget("dragContext", dd->display.dragContextClass, (Widget)dd, args, i); _XmReadInitiatorInfo((Widget)dc); /* * force in value for dropTransfer to use in selection * calls. */ dc->drag.currReceiverInfo = _XmAllocReceiverInfo(dc); dc->drag.currReceiverInfo->shell = shell; dc->drag.currReceiverInfo->dragProtocolStyle = dd->display.dragReceiverProtocolStyle; } topClientData.destShell = shell; topClientData.xOrigin = XtX(shell); topClientData.yOrigin = XtY(shell); topClientData.width = XtWidth(shell); topClientData.height = XtHeight(shell); topClientData.sourceIsExternal = True; topClientData.iccInfo = NULL; } if (!dc) return; if (q.hasDropStart) { dc->drag.dragFinishTime = dropStartCB.timeStamp; _XmDSMUpdate(dsm, (XtPointer)&topClientData, (XtPointer)&dropStartCB); } /* * we only see enters if they're not matched with a leave */ if (q.hasEnter) { _XmDSMUpdate(dsm, (XtPointer)&topClientData, (XtPointer)&enterCB); } if (q.hasMotion) { XmDragMotionCallback callback = &motionCB; XmDragMotionClientDataStruct motionData; motionData.window = XtWindow(w); motionData.dragOver = NULL; _XmDSMUpdate(dsm, (XtPointer)&motionData, (XtPointer)callback); } } } static Widget GetDisplay( Display *display ) { XmDisplay xmDisplay = NULL; XContext context; Arg args[3]; int n; _XmProcessLock(); context = displayContext; _XmProcessUnlock(); if ((context == 0) || (XFindContext(display, None, context, (char **) &xmDisplay))) { String name, w_class; XtGetApplicationNameAndClass(display, &name, &w_class); n = 0; XtSetArg(args[n], XmNmappedWhenManaged, False); n++; XtSetArg(args[n], XmNwidth, 1); n++; XtSetArg(args[n], XmNheight, 1); n++; xmDisplay = (XmDisplay) XtAppCreateShell(name, w_class, xmDisplayClass, display, args, n); } /* We need a window to be useful */ if (!XtIsRealized((Widget)xmDisplay)) { XtRealizeWidget((Widget)xmDisplay); /* * Got the resources - get rid of name-type properties. * Otherwise, clients (ie: xwd) may get the wrong window * using the -name option. */ XDeleteProperty(display, XtWindow(xmDisplay), XA_WM_NAME); XDeleteProperty(display, XtWindow(xmDisplay), XA_WM_ICON_NAME); XDeleteProperty(display, XtWindow(xmDisplay), XA_WM_CLASS); } return ((Widget)xmDisplay); } Widget XmGetXmDisplay( Display *display ) { XmDisplayClass dC; Widget w; _XmDisplayToAppContext(display); /* * We have a chicken and egg problem here; we'd like to get * the display via a class function, but we don't know which * class to use. Hence the magic functions _XmGetXmDisplayClass * and _XmSetXmDisplayClass. */ _XmAppLock(app); _XmProcessLock(); dC = (XmDisplayClass) _XmGetXmDisplayClass(); w = (*(dC->display_class.GetDisplay))(display); _XmProcessUnlock(); _XmAppUnlock(app); return w; } /* * It would be nice if the next two functions were methods, but * for obvious reasons they're not. */ WidgetClass _XmGetXmDisplayClass( void ) { WidgetClass class; _XmProcessLock(); if (curDisplayClass == NULL) curDisplayClass = xmDisplayClass; class = curDisplayClass; _XmProcessUnlock(); return class; } WidgetClass _XmSetXmDisplayClass( WidgetClass wc ) { WidgetClass oldDisplayClass; WidgetClass sc = wc; _XmProcessLock(); oldDisplayClass = curDisplayClass; /* * We aren't going to let folks just set any old class in as the * display class. They will have to use subclasses of xmDisplay. */ while ((sc != NULL) && (sc != xmDisplayClass)) sc = sc->core_class.superclass; if (sc != NULL) curDisplayClass = wc; else XmeWarning(NULL, MESSAGE3); _XmProcessUnlock(); return(oldDisplayClass); } /********************************************************************** * * _XmSetThickness * This procedure is called as the resource default XtRCallProc * to default the shadow and highlight thickness resources. If * enablethinThickness is true (CDE apps), the value is "1 pixel", * else defaults to "2". **********************************************************************/ void _XmSetThickness( Widget widget, int offset, XrmValue *value ) { XmDisplay xmDisplay; static Dimension thickness; xmDisplay = (XmDisplay)XmGetXmDisplay(XtDisplay(widget)); if (xmDisplay->display.enable_thin_thickness) { thickness = 1; } else { thickness = 2; } value->addr = (XPointer)&thickness; } /********************************************************************** * * _XmSetThicknessDefault0 * This procedure is called as the resource default XtRCallProc * to default the shadow and highlight thickness resources. If * enablethinThickness is true (CDE apps), the value is "1 pixel", * else defaults to "0". **********************************************************************/ void _XmSetThicknessDefault0( Widget widget, int offset, XrmValue *value ) { XmDisplay xmDisplay; static Dimension thickness; xmDisplay = (XmDisplay)XmGetXmDisplay(XtDisplay(widget)); if (xmDisplay->display.enable_thin_thickness) { thickness = 1; } else { thickness = 0; } value->addr = (XPointer)&thickness; } motif-2.3.8/lib/Xm/XmStrDefs.c0000644000175000017500000031210113211513004012724 00000000000000/* $TOG: XmStrDefs.ct /main/2 1997/06/18 17:49:37 samborn $ */ #ifndef _XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define _XmConst const #else #define _XmConst #endif /* __STDC__ */ #endif /* _XmConst */ #include /* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */ /* This file is automatically generated. */ /* Default ABI version -- Do not edit */ /* TOG: xmstring.list /main/5 1997/06/20 08:37:02 samborn */ externaldef(_xmstrings) _XmConst char _XmStrings[] = { '\0', 'A','c','c','e','l','e','r','a','t','o','r','\0', 'A','c','c','e','l','e','r','a','t','o','r','T','e','x','t','\0', 'A','d','j','u','s','t','L','a','s','t','\0', 'A','d','j','u','s','t','M','a','r','g','i','n','\0', 'A','l','i','g','n','m','e','n','t','\0', 'A','l','l','o','w','O','v','e','r','l','a','p','\0', 'A','l','l','o','w','U','n','u','s','e','d','S','p','a','c','e','\0', 'A','n','i','m','a','t','i','o','n','M','a','s','k','\0', 'A','n','i','m','a','t','i','o','n','P','i','x','m','a','p','\0', 'A','n','i','m','a','t','i','o','n','P','i','x','m','a','p','D','e','p','t','h','\0', 'A','n','i','m','a','t','i','o','n','S','t','y','l','e','\0', 'A','p','p','l','y','L','a','b','e','l','S','t','r','i','n','g','\0', 'A','r','m','C','a','l','l','b','a','c','k','\0', 'A','r','m','C','o','l','o','r','\0', 'A','r','m','P','i','x','m','a','p','\0', 'A','r','r','o','w','D','i','r','e','c','t','i','o','n','\0', 'A','t','t','a','c','h','m','e','n','t','\0', 'A','u','d','i','b','l','e','W','a','r','n','i','n','g','\0', 'A','u','t','o','S','h','o','w','C','u','r','s','o','r','P','o','s','i','t','i','o','n','\0', 'A','u','t','o','U','n','m','a','n','a','g','e','\0', 'A','u','t','o','m','a','t','i','c','S','e','l','e','c','t','i','o','n','\0', 'A','v','a','i','l','a','b','i','l','i','t','y','\0', 'B','a','c','k','g','r','o','u','n','d','P','i','x','m','a','p','\0', 'B','l','e','n','d','M','o','d','e','l','\0', 'B','l','i','n','k','R','a','t','e','\0', 'B','o','t','t','o','m','S','h','a','d','o','w','C','o','l','o','r','\0', 'B','o','t','t','o','m','S','h','a','d','o','w','P','i','x','m','a','p','\0', 'B','u','t','t','o','n','A','c','c','e','l','e','r','a','t','o','r','T','e','x','t','\0', 'B','u','t','t','o','n','A','c','c','e','l','e','r','a','t','o','r','s','\0', 'B','u','t','t','o','n','C','o','u','n','t','\0', 'B','u','t','t','o','n','F','o','n','t','L','i','s','t','\0', 'B','u','t','t','o','n','M','n','e','m','o','n','i','c','C','h','a','r','S','e','t','s','\0', 'B','u','t','t','o','n','M','n','e','m','o','n','i','c','s','\0', 'B','u','t','t','o','n','S','e','t','\0', 'B','u','t','t','o','n','T','y','p','e','\0', 'B','u','t','t','o','n','s','\0', 'C','a','n','c','e','l','L','a','b','e','l','S','t','r','i','n','g','\0', 'C','h','i','l','d','H','o','r','i','z','o','n','t','a','l','A','l','i','g','n','m','e','n','t','\0', 'C','h','i','l','d','H','o','r','i','z','o','n','t','a','l','S','p','a','c','i','n','g','\0', 'C','h','i','l','d','P','l','a','c','e','m','e','n','t','\0', 'C','h','i','l','d','T','y','p','e','\0', 'C','h','i','l','d','V','e','r','t','i','c','a','l','A','l','i','g','n','m','e','n','t','\0', 'C','h','i','l','d','r','e','n','\0', 'C','l','i','e','n','t','D','a','t','a','\0', 'C','l','i','p','W','i','n','d','o','w','\0', 'C','o','l','u','m','n','s','\0', 'C','o','m','m','a','n','d','W','i','n','d','o','w','\0', 'C','o','m','m','a','n','d','W','i','n','d','o','w','L','o','c','a','t','i','o','n','\0', 'C','o','n','v','e','r','t','P','r','o','c','\0', 'C','u','r','s','o','r','B','a','c','k','g','r','o','u','n','d','\0', 'C','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'C','u','r','s','o','r','P','o','s','i','t','i','o','n','\0', 'C','u','r','s','o','r','P','o','s','i','t','i','o','n','V','i','s','i','b','l','e','\0', 'D','a','r','k','T','h','r','e','s','h','o','l','d','\0', 'D','e','c','i','m','a','l','P','o','i','n','t','s','\0', 'D','e','f','a','u','l','t','B','u','t','t','o','n','S','h','a','d','o','w','T','h','i','c','k','n','e','s','s','\0', 'D','e','f','a','u','l','t','B','u','t','t','o','n','T','y','p','e','\0', 'D','e','f','a','u','l','t','C','o','p','y','C','u','r','s','o','r','I','c','o','n','\0', 'D','e','f','a','u','l','t','F','o','n','t','L','i','s','t','\0', 'D','e','f','a','u','l','t','I','n','v','a','l','i','d','C','u','r','s','o','r','I','c','o','n','\0', 'D','e','f','a','u','l','t','L','i','n','k','C','u','r','s','o','r','I','c','o','n','\0', 'D','e','f','a','u','l','t','M','o','v','e','C','u','r','s','o','r','I','c','o','n','\0', 'D','e','f','a','u','l','t','N','o','n','e','C','u','r','s','o','r','I','c','o','n','\0', 'D','e','f','a','u','l','t','P','o','s','i','t','i','o','n','\0', 'D','e','f','a','u','l','t','S','o','u','r','c','e','C','u','r','s','o','r','I','c','o','n','\0', 'D','e','f','a','u','l','t','V','a','l','i','d','C','u','r','s','o','r','I','c','o','n','\0', 'D','e','l','e','t','e','R','e','s','p','o','n','s','e','\0', 'D','e','s','k','t','o','p','P','a','r','e','n','t','\0', 'D','i','a','l','o','g','S','t','y','l','e','\0', 'D','i','a','l','o','g','T','i','t','l','e','\0', 'D','i','a','l','o','g','T','y','p','e','\0', 'D','i','r','L','i','s','t','I','t','e','m','C','o','u','n','t','\0', 'D','i','r','L','i','s','t','I','t','e','m','s','\0', 'D','i','r','L','i','s','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'D','i','r','M','a','s','k','\0', 'D','i','r','S','e','a','r','c','h','P','r','o','c','\0', 'D','i','r','S','p','e','c','\0', 'D','i','r','e','c','t','o','r','y','\0', 'D','i','r','e','c','t','o','r','y','V','a','l','i','d','\0', 'D','i','s','a','r','m','C','a','l','l','b','a','c','k','\0', 'D','o','u','b','l','e','C','l','i','c','k','I','n','t','e','r','v','a','l','\0', 'D','r','a','g','C','o','n','t','e','x','t','C','l','a','s','s','\0', 'D','r','a','g','D','r','o','p','F','i','n','i','s','h','C','a','l','l','b','a','c','k','\0', 'D','r','a','g','I','c','o','n','C','l','a','s','s','\0', 'D','r','a','g','I','n','i','t','i','a','t','o','r','P','r','o','t','o','c','o','l','S','t','y','l','e','\0', 'D','r','a','g','M','o','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'D','r','a','g','O','p','e','r','a','t','i','o','n','s','\0', 'D','r','a','g','O','v','e','r','M','o','d','e','\0', 'D','r','a','g','P','r','o','c','\0', 'D','r','a','g','R','e','c','e','i','v','e','r','P','r','o','t','o','c','o','l','S','t','y','l','e','\0', 'D','r','o','p','P','r','o','c','\0', 'D','r','o','p','R','e','c','t','a','n','g','l','e','s','\0', 'D','r','o','p','S','i','t','e','A','c','t','i','v','i','t','y','\0', 'D','r','o','p','S','i','t','e','E','n','t','e','r','C','a','l','l','b','a','c','k','\0', 'D','r','o','p','S','i','t','e','L','e','a','v','e','C','a','l','l','b','a','c','k','\0', 'D','r','o','p','S','i','t','e','M','a','n','a','g','e','r','C','l','a','s','s','\0', 'D','r','o','p','S','i','t','e','O','p','e','r','a','t','i','o','n','s','\0', 'D','r','o','p','S','i','t','e','T','y','p','e','\0', 'D','r','o','p','S','t','a','r','t','C','a','l','l','b','a','c','k','\0', 'D','r','o','p','T','r','a','n','s','f','e','r','C','l','a','s','s','\0', 'D','r','o','p','T','r','a','n','s','f','e','r','s','\0', 'E','d','i','t','a','b','l','e','\0', 'E','n','t','r','y','B','o','r','d','e','r','\0', 'E','n','t','r','y','C','l','a','s','s','\0', 'E','x','p','o','r','t','T','a','r','g','e','t','s','\0', 'E','x','p','o','s','e','C','a','l','l','b','a','c','k','\0', 'E','x','t','e','n','s','i','o','n','T','y','p','e','\0', 'F','i','l','e','L','i','s','t','I','t','e','m','C','o','u','n','t','\0', 'F','i','l','e','L','i','s','t','I','t','e','m','s','\0', 'F','i','l','e','L','i','s','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'F','i','l','e','S','e','a','r','c','h','P','r','o','c','\0', 'F','i','l','e','T','y','p','e','M','a','s','k','\0', 'F','i','l','l','O','n','A','r','m','\0', 'F','i','l','l','O','n','S','e','l','e','c','t','\0', 'F','i','l','t','e','r','L','a','b','e','l','S','t','r','i','n','g','\0', 'F','o','n','t','L','i','s','t','\0', 'F','o','r','e','g','r','o','u','n','d','T','h','r','e','s','h','o','l','d','\0', 'H','e','l','p','L','a','b','e','l','S','t','r','i','n','g','\0', 'H','i','g','h','l','i','g','h','t','C','o','l','o','r','\0', 'H','i','g','h','l','i','g','h','t','O','n','E','n','t','e','r','\0', 'H','i','g','h','l','i','g','h','t','P','i','x','m','a','p','\0', 'H','i','g','h','l','i','g','h','t','T','h','i','c','k','n','e','s','s','\0', 'H','o','r','i','z','o','n','t','a','l','F','o','n','t','U','n','i','t','\0', 'H','o','r','i','z','o','n','t','a','l','S','c','r','o','l','l','B','a','r','\0', 'H','o','t','\0', 'I','C','C','H','a','n','d','l','e','\0', 'I','m','p','o','r','t','T','a','r','g','e','t','s','\0', 'I','n','c','r','e','m','e','n','t','\0', 'I','n','c','r','e','m','e','n','t','a','l','\0', 'I','n','d','i','c','a','t','o','r','O','n','\0', 'I','n','d','i','c','a','t','o','r','S','i','z','e','\0', 'I','n','d','i','c','a','t','o','r','T','y','p','e','\0', 'I','n','i','t','i','a','l','D','e','l','a','y','\0', 'I','n','i','t','i','a','l','F','o','c','u','s','\0', 'I','n','p','u','t','C','r','e','a','t','e','\0', 'I','n','p','u','t','M','e','t','h','o','d','\0', 'I','n','v','a','l','i','d','C','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'I','s','A','l','i','g','n','e','d','\0', 'I','s','H','o','m','o','g','e','n','e','o','u','s','\0', 'I','t','e','m','C','o','u','n','t','\0', 'I','t','e','m','s','\0', 'K','e','y','b','o','a','r','d','F','o','c','u','s','P','o','l','i','c','y','\0', 'L','a','b','e','l','F','o','n','t','L','i','s','t','\0', 'L','a','b','e','l','I','n','s','e','n','s','i','t','i','v','e','P','i','x','m','a','p','\0', 'L','a','b','e','l','P','i','x','m','a','p','\0', 'L','a','b','e','l','S','t','r','i','n','g','\0', 'L','a','b','e','l','T','y','p','e','\0', 'L','i','g','h','t','T','h','r','e','s','h','o','l','d','\0', 'L','i','s','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'L','i','s','t','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'L','i','s','t','M','a','r','g','i','n','W','i','d','t','h','\0', 'L','i','s','t','S','i','z','e','P','o','l','i','c','y','\0', 'L','i','s','t','S','p','a','c','i','n','g','\0', 'L','i','s','t','U','p','d','a','t','e','d','\0', 'L','o','g','i','c','a','l','P','a','r','e','n','t','\0', 'M','a','i','n','W','i','n','d','o','w','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'M','a','i','n','W','i','n','d','o','w','M','a','r','g','i','n','W','i','d','t','h','\0', 'M','a','p','p','i','n','g','D','e','l','a','y','\0', 'M','a','r','g','i','n','B','o','t','t','o','m','\0', 'M','a','r','g','i','n','H','e','i','g','h','t','\0', 'M','a','r','g','i','n','L','e','f','t','\0', 'M','a','r','g','i','n','R','i','g','h','t','\0', 'M','a','r','g','i','n','T','o','p','\0', 'M','a','r','g','i','n','W','i','d','t','h','\0', 'M','a','s','k','\0', 'M','a','x','I','t','e','m','s','\0', 'M','a','x','L','e','n','g','t','h','\0', 'M','a','x','V','a','l','u','e','\0', 'M','a','x','i','m','u','m','\0', 'M','e','n','u','B','a','r','\0', 'M','e','n','u','P','o','s','t','\0', 'M','e','n','u','W','i','d','g','e','t','\0', 'M','e','s','s','a','g','e','P','r','o','c','\0', 'M','e','s','s','a','g','e','W','i','n','d','o','w','\0', 'M','i','n','i','m','i','z','e','B','u','t','t','o','n','s','\0', 'M','i','n','i','m','u','m','\0', 'M','n','e','m','o','n','i','c','\0', 'M','n','e','m','o','n','i','c','C','h','a','r','S','e','t','\0', 'M','o','v','e','O','p','a','q','u','e','\0', 'M','u','l','t','i','C','l','i','c','k','\0', 'M','u','s','t','M','a','t','c','h','\0', 'M','w','m','D','e','c','o','r','a','t','i','o','n','s','\0', 'M','w','m','F','u','n','c','t','i','o','n','s','\0', 'M','w','m','I','n','p','u','t','M','o','d','e','\0', 'M','w','m','M','e','n','u','\0', 'M','w','m','M','e','s','s','a','g','e','s','\0', 'N','a','v','i','g','a','t','i','o','n','T','y','p','e','\0', 'N','e','e','d','s','M','o','t','i','o','n','\0', 'N','o','M','a','t','c','h','S','t','r','i','n','g','\0', 'N','o','R','e','s','i','z','e','\0', 'N','o','n','e','C','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'N','o','t','i','f','y','P','r','o','c','\0', 'N','u','m','C','h','i','l','d','r','e','n','\0', 'N','u','m','C','o','l','u','m','n','s','\0', 'N','u','m','D','r','o','p','R','e','c','t','a','n','g','l','e','s','\0', 'N','u','m','D','r','o','p','T','r','a','n','s','f','e','r','s','\0', 'N','u','m','E','x','p','o','r','t','T','a','r','g','e','t','s','\0', 'N','u','m','I','m','p','o','r','t','T','a','r','g','e','t','s','\0', 'O','f','f','s','e','t','\0', 'O','k','L','a','b','e','l','S','t','r','i','n','g','\0', 'O','p','e','r','a','t','i','o','n','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'O','p','e','r','a','t','i','o','n','C','u','r','s','o','r','I','c','o','n','\0', 'O','p','t','i','o','n','L','a','b','e','l','\0', 'O','p','t','i','o','n','M','n','e','m','o','n','i','c','\0', 'O','u','t','p','u','t','C','r','e','a','t','e','\0', 'P','a','c','k','i','n','g','\0', 'P','a','g','e','I','n','c','r','e','m','e','n','t','\0', 'P','a','n','e','M','a','x','i','m','u','m','\0', 'P','a','n','e','M','i','n','i','m','u','m','\0', 'P','a','t','t','e','r','n','\0', 'P','e','n','d','i','n','g','D','e','l','e','t','e','\0', 'P','o','p','u','p','E','n','a','b','l','e','d','\0', 'P','o','s','i','t','i','o','n','I','n','d','e','x','\0', 'P','o','s','t','F','r','o','m','B','u','t','t','o','n','\0', 'P','o','s','t','F','r','o','m','C','o','u','n','t','\0', 'P','o','s','t','F','r','o','m','L','i','s','t','\0', 'P','r','e','e','d','i','t','T','y','p','e','\0', 'P','r','o','c','e','s','s','i','n','g','D','i','r','e','c','t','i','o','n','\0', 'P','r','o','m','p','t','S','t','r','i','n','g','\0', 'P','r','o','t','o','c','o','l','C','a','l','l','b','a','c','k','\0', 'P','u','s','h','B','u','t','t','o','n','E','n','a','b','l','e','d','\0', 'Q','u','a','l','i','f','y','S','e','a','r','c','h','D','a','t','a','P','r','o','c','\0', 'R','a','d','i','o','A','l','w','a','y','s','O','n','e','\0', 'R','a','d','i','o','B','e','h','a','v','i','o','r','\0', 'R','e','c','o','m','p','u','t','e','S','i','z','e','\0', 'R','e','c','t','a','n','g','l','e','s','\0', 'R','e','p','e','a','t','D','e','l','a','y','\0', 'R','e','s','i','z','e','C','a','l','l','b','a','c','k','\0', 'R','e','s','i','z','e','H','e','i','g','h','t','\0', 'R','e','s','i','z','e','P','o','l','i','c','y','\0', 'R','e','s','i','z','e','W','i','d','t','h','\0', 'R','o','w','C','o','l','u','m','n','T','y','p','e','\0', 'R','o','w','s','\0', 'R','u','b','b','e','r','P','o','s','i','t','i','o','n','i','n','g','\0', 'S','a','s','h','H','e','i','g','h','t','\0', 'S','a','s','h','I','n','d','e','n','t','\0', 'S','a','s','h','W','i','d','t','h','\0', 'S','c','a','l','e','H','e','i','g','h','t','\0', 'S','c','a','l','e','M','u','l','t','i','p','l','e','\0', 'S','c','a','l','e','W','i','d','t','h','\0', 'S','c','r','o','l','l','\0', 'S','c','r','o','l','l','B','a','r','D','i','s','p','l','a','y','P','o','l','i','c','y','\0', 'S','c','r','o','l','l','B','a','r','P','l','a','c','e','m','e','n','t','\0', 'S','c','r','o','l','l','S','i','d','e','\0', 'S','c','r','o','l','l','e','d','W','i','n','d','o','w','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'S','c','r','o','l','l','e','d','W','i','n','d','o','w','M','a','r','g','i','n','W','i','d','t','h','\0', 'S','c','r','o','l','l','i','n','g','P','o','l','i','c','y','\0', 'S','e','l','e','c','t','C','o','l','o','r','\0', 'S','e','l','e','c','t','I','n','s','e','n','s','i','t','i','v','e','P','i','x','m','a','p','\0', 'S','e','l','e','c','t','P','i','x','m','a','p','\0', 'S','e','l','e','c','t','T','h','r','e','s','h','o','l','d','\0', 'S','e','l','e','c','t','e','d','I','t','e','m','C','o','u','n','t','\0', 'S','e','l','e','c','t','e','d','I','t','e','m','s','\0', 'S','e','l','e','c','t','i','o','n','A','r','r','a','y','C','o','u','n','t','\0', 'S','e','l','e','c','t','i','o','n','L','a','b','e','l','S','t','r','i','n','g','\0', 'S','e','l','e','c','t','i','o','n','P','o','l','i','c','y','\0', 'S','e','p','a','r','a','t','o','r','O','n','\0', 'S','e','p','a','r','a','t','o','r','T','y','p','e','\0', 'S','e','t','\0', 'S','h','a','d','o','w','T','h','i','c','k','n','e','s','s','\0', 'S','h','a','d','o','w','T','y','p','e','\0', 'S','h','e','l','l','U','n','i','t','T','y','p','e','\0', 'S','h','o','w','A','r','r','o','w','s','\0', 'S','h','o','w','A','s','D','e','f','a','u','l','t','\0', 'S','h','o','w','S','e','p','a','r','a','t','o','r','\0', 'S','h','o','w','V','a','l','u','e','\0', 'S','i','m','p','l','e','C','h','e','c','k','B','o','x','\0', 'S','i','m','p','l','e','M','e','n','u','B','a','r','\0', 'S','i','m','p','l','e','O','p','t','i','o','n','M','e','n','u','\0', 'S','i','m','p','l','e','P','o','p','u','p','M','e','n','u','\0', 'S','i','m','p','l','e','P','u','l','l','d','o','w','n','M','e','n','u','\0', 'S','i','m','p','l','e','R','a','d','i','o','B','o','x','\0', 'S','i','z','e','P','o','l','i','c','y','\0', 'S','l','i','d','e','r','S','i','z','e','\0', 'S','o','u','r','c','e','\0', 'S','o','u','r','c','e','C','u','r','s','o','r','I','c','o','n','\0', 'S','o','u','r','c','e','I','s','E','x','t','e','r','n','a','l','\0', 'S','o','u','r','c','e','P','i','x','m','a','p','I','c','o','n','\0', 'S','o','u','r','c','e','W','i','d','g','e','t','\0', 'S','o','u','r','c','e','W','i','n','d','o','w','\0', 'S','p','a','c','i','n','g','\0', 'S','t','a','r','t','T','i','m','e','\0', 'S','t','a','t','e','C','u','r','s','o','r','I','c','o','n','\0', 'S','t','r','i','n','g','D','i','r','e','c','t','i','o','n','\0', 'T','e','a','r','O','f','f','M','o','d','e','l','\0', 'T','e','x','t','F','o','n','t','L','i','s','t','\0', 'T','e','x','t','S','t','r','i','n','g','\0', 'T','e','x','t','V','a','l','u','e','\0', 'T','i','t','l','e','S','t','r','i','n','g','\0', 'T','o','p','C','h','a','r','a','c','t','e','r','\0', 'T','o','p','I','t','e','m','P','o','s','i','t','i','o','n','\0', 'T','o','p','L','e','v','e','l','E','n','t','e','r','C','a','l','l','b','a','c','k','\0', 'T','o','p','L','e','v','e','l','L','e','a','v','e','C','a','l','l','b','a','c','k','\0', 'T','o','p','S','h','a','d','o','w','C','o','l','o','r','\0', 'T','o','p','S','h','a','d','o','w','P','i','x','m','a','p','\0', 'T','r','a','n','s','f','e','r','P','r','o','c','\0', 'T','r','a','n','s','f','e','r','S','t','a','t','u','s','\0', 'T','r','a','v','e','r','s','a','l','O','n','\0', 'T','r','a','v','e','r','s','a','l','T','y','p','e','\0', 'T','r','e','e','U','p','d','a','t','e','P','r','o','c','\0', 'T','r','o','u','g','h','C','o','l','o','r','\0', 'U','n','i','t','T','y','p','e','\0', 'U','n','p','o','s','t','B','e','h','a','v','i','o','r','\0', 'U','n','s','e','l','e','c','t','P','i','x','m','a','p','\0', 'U','p','d','a','t','e','S','l','i','d','e','r','S','i','z','e','\0', 'U','s','e','A','s','y','n','c','G','e','o','m','e','t','r','y','\0', 'U','s','e','r','D','a','t','a','\0', 'V','a','l','i','d','C','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'V','a','l','u','e','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'V','a','l','u','e','W','c','s','\0', 'V','e','r','i','f','y','B','e','l','l','\0', 'V','e','r','t','i','c','a','l','A','l','i','g','n','m','e','n','t','\0', 'V','e','r','t','i','c','a','l','F','o','n','t','U','n','i','t','\0', 'V','e','r','t','i','c','a','l','S','c','r','o','l','l','B','a','r','\0', 'V','i','s','i','b','l','e','I','t','e','m','C','o','u','n','t','\0', 'V','i','s','i','b','l','e','W','h','e','n','O','f','f','\0', 'V','i','s','u','a','l','P','o','l','i','c','y','\0', 'W','h','i','c','h','B','u','t','t','o','n','\0', 'W','o','r','d','W','r','a','p','\0', 'W','o','r','k','W','i','n','d','o','w','\0', 'X','m','S','t','r','i','n','g','\0', 'a','c','c','e','l','e','r','a','t','o','r','\0', 'a','c','c','e','l','e','r','a','t','o','r','T','e','x','t','\0', 'a','c','t','i','v','a','t','e','C','a','l','l','b','a','c','k','\0', 'a','d','j','u','s','t','L','a','s','t','\0', 'a','d','j','u','s','t','M','a','r','g','i','n','\0', 'a','l','i','g','n','m','e','n','t','\0', 'a','l','l','o','w','O','v','e','r','l','a','p','\0', 'a','l','l','o','w','R','e','s','i','z','e','\0', 'a','l','l','o','w','U','n','u','s','e','d','S','p','a','c','e','\0', 'a','n','i','m','a','t','i','o','n','M','a','s','k','\0', 'a','n','i','m','a','t','i','o','n','P','i','x','m','a','p','\0', 'a','n','i','m','a','t','i','o','n','P','i','x','m','a','p','D','e','p','t','h','\0', 'a','n','i','m','a','t','i','o','n','S','t','y','l','e','\0', 'a','p','p','l','y','C','a','l','l','b','a','c','k','\0', 'a','p','p','l','y','L','a','b','e','l','S','t','r','i','n','g','\0', 'a','r','m','C','a','l','l','b','a','c','k','\0', 'a','r','m','C','o','l','o','r','\0', 'a','r','m','P','i','x','m','a','p','\0', 'a','r','r','o','w','D','i','r','e','c','t','i','o','n','\0', 'a','t','t','a','c','h','m','e','n','t','\0', 'a','u','d','i','b','l','e','W','a','r','n','i','n','g','\0', 'a','u','t','o','S','h','o','w','C','u','r','s','o','r','P','o','s','i','t','i','o','n','\0', 'a','u','t','o','U','n','m','a','n','a','g','e','\0', 'a','u','t','o','m','a','t','i','c','S','e','l','e','c','t','i','o','n','\0', 'a','v','a','i','l','a','b','i','l','i','t','y','\0', 'b','l','e','n','d','M','o','d','e','l','\0', 'b','l','i','n','k','R','a','t','e','\0', 'b','o','t','t','o','m','A','t','t','a','c','h','m','e','n','t','\0', 'b','o','t','t','o','m','O','f','f','s','e','t','\0', 'b','o','t','t','o','m','P','o','s','i','t','i','o','n','\0', 'b','o','t','t','o','m','S','h','a','d','o','w','C','o','l','o','r','\0', 'b','o','t','t','o','m','S','h','a','d','o','w','P','i','x','m','a','p','\0', 'b','o','t','t','o','m','W','i','d','g','e','t','\0', 'b','r','o','w','s','e','S','e','l','e','c','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'b','u','t','t','o','n','A','c','c','e','l','e','r','a','t','o','r','T','e','x','t','\0', 'b','u','t','t','o','n','A','c','c','e','l','e','r','a','t','o','r','s','\0', 'b','u','t','t','o','n','C','o','u','n','t','\0', 'b','u','t','t','o','n','F','o','n','t','L','i','s','t','\0', 'b','u','t','t','o','n','M','n','e','m','o','n','i','c','C','h','a','r','S','e','t','s','\0', 'b','u','t','t','o','n','M','n','e','m','o','n','i','c','s','\0', 'b','u','t','t','o','n','S','e','t','\0', 'b','u','t','t','o','n','T','y','p','e','\0', 'b','u','t','t','o','n','s','\0', 'c','a','n','c','e','l','B','u','t','t','o','n','\0', 'c','a','n','c','e','l','C','a','l','l','b','a','c','k','\0', 'c','a','n','c','e','l','L','a','b','e','l','S','t','r','i','n','g','\0', 'c','a','s','c','a','d','e','P','i','x','m','a','p','\0', 'c','a','s','c','a','d','i','n','g','C','a','l','l','b','a','c','k','\0', 'c','h','i','l','d','H','o','r','i','z','o','n','t','a','l','A','l','i','g','n','m','e','n','t','\0', 'c','h','i','l','d','H','o','r','i','z','o','n','t','a','l','S','p','a','c','i','n','g','\0', 'c','h','i','l','d','P','l','a','c','e','m','e','n','t','\0', 'c','h','i','l','d','P','o','s','i','t','i','o','n','\0', 'c','h','i','l','d','T','y','p','e','\0', 'c','h','i','l','d','V','e','r','t','i','c','a','l','A','l','i','g','n','m','e','n','t','\0', 'c','l','i','e','n','t','D','a','t','a','\0', 'c','l','i','p','W','i','n','d','o','w','\0', 'c','o','l','u','m','n','s','\0', 'c','o','m','m','a','n','d','\0', 'c','o','m','m','a','n','d','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'c','o','m','m','a','n','d','E','n','t','e','r','e','d','C','a','l','l','b','a','c','k','\0', 'c','o','m','m','a','n','d','W','i','n','d','o','w','\0', 'c','o','m','m','a','n','d','W','i','n','d','o','w','L','o','c','a','t','i','o','n','\0', 'c','o','n','v','e','r','t','P','r','o','c','\0', 'c','u','r','s','o','r','B','a','c','k','g','r','o','u','n','d','\0', 'c','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'c','u','r','s','o','r','P','o','s','i','t','i','o','n','\0', 'c','u','r','s','o','r','P','o','s','i','t','i','o','n','V','i','s','i','b','l','e','\0', 'd','a','r','k','T','h','r','e','s','h','o','l','d','\0', 'd','e','c','i','m','a','l','P','o','i','n','t','s','\0', 'd','e','c','r','e','m','e','n','t','C','a','l','l','b','a','c','k','\0', 'd','e','f','a','u','l','t','A','c','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'd','e','f','a','u','l','t','B','u','t','t','o','n','\0', 'd','e','f','a','u','l','t','B','u','t','t','o','n','S','h','a','d','o','w','T','h','i','c','k','n','e','s','s','\0', 'd','e','f','a','u','l','t','B','u','t','t','o','n','T','y','p','e','\0', 'd','e','f','a','u','l','t','C','o','p','y','C','u','r','s','o','r','I','c','o','n','\0', 'd','e','f','a','u','l','t','F','o','n','t','L','i','s','t','\0', 'd','e','f','a','u','l','t','I','n','v','a','l','i','d','C','u','r','s','o','r','I','c','o','n','\0', 'd','e','f','a','u','l','t','L','i','n','k','C','u','r','s','o','r','I','c','o','n','\0', 'd','e','f','a','u','l','t','M','o','v','e','C','u','r','s','o','r','I','c','o','n','\0', 'd','e','f','a','u','l','t','N','o','n','e','C','u','r','s','o','r','I','c','o','n','\0', 'd','e','f','a','u','l','t','P','o','s','i','t','i','o','n','\0', 'd','e','f','a','u','l','t','S','o','u','r','c','e','C','u','r','s','o','r','I','c','o','n','\0', 'd','e','f','a','u','l','t','V','a','l','i','d','C','u','r','s','o','r','I','c','o','n','\0', 'd','e','l','e','t','e','R','e','s','p','o','n','s','e','\0', 'd','e','s','k','t','o','p','P','a','r','e','n','t','\0', 'd','i','a','l','o','g','S','t','y','l','e','\0', 'd','i','a','l','o','g','T','i','t','l','e','\0', 'd','i','a','l','o','g','T','y','p','e','\0', 'd','i','r','L','i','s','t','I','t','e','m','C','o','u','n','t','\0', 'd','i','r','L','i','s','t','I','t','e','m','s','\0', 'd','i','r','L','i','s','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'd','i','r','M','a','s','k','\0', 'd','i','r','S','e','a','r','c','h','P','r','o','c','\0', 'd','i','r','S','p','e','c','\0', 'd','i','r','e','c','t','o','r','y','\0', 'd','i','r','e','c','t','o','r','y','V','a','l','i','d','\0', 'd','i','s','a','r','m','C','a','l','l','b','a','c','k','\0', 'd','o','u','b','l','e','C','l','i','c','k','I','n','t','e','r','v','a','l','\0', 'd','r','a','g','C','a','l','l','b','a','c','k','\0', 'd','r','a','g','C','o','n','t','e','x','t','C','l','a','s','s','\0', 'd','r','a','g','D','r','o','p','F','i','n','i','s','h','C','a','l','l','b','a','c','k','\0', 'd','r','a','g','I','c','o','n','C','l','a','s','s','\0', 'd','r','a','g','I','n','i','t','i','a','t','o','r','P','r','o','t','o','c','o','l','S','t','y','l','e','\0', 'd','r','a','g','M','o','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'd','r','a','g','O','p','e','r','a','t','i','o','n','s','\0', 'd','r','a','g','O','v','e','r','M','o','d','e','\0', 'd','r','a','g','P','r','o','c','\0', 'd','r','a','g','R','e','c','e','i','v','e','r','P','r','o','t','o','c','o','l','S','t','y','l','e','\0', 'd','r','o','p','F','i','n','i','s','h','C','a','l','l','b','a','c','k','\0', 'd','r','o','p','P','r','o','c','\0', 'd','r','o','p','R','e','c','t','a','n','g','l','e','s','\0', 'd','r','o','p','S','i','t','e','A','c','t','i','v','i','t','y','\0', 'd','r','o','p','S','i','t','e','E','n','t','e','r','C','a','l','l','b','a','c','k','\0', 'd','r','o','p','S','i','t','e','L','e','a','v','e','C','a','l','l','b','a','c','k','\0', 'd','r','o','p','S','i','t','e','M','a','n','a','g','e','r','C','l','a','s','s','\0', 'd','r','o','p','S','i','t','e','O','p','e','r','a','t','i','o','n','s','\0', 'd','r','o','p','S','i','t','e','T','y','p','e','\0', 'd','r','o','p','S','t','a','r','t','C','a','l','l','b','a','c','k','\0', 'd','r','o','p','T','r','a','n','s','f','e','r','C','l','a','s','s','\0', 'd','r','o','p','T','r','a','n','s','f','e','r','s','\0', 'e','d','i','t','M','o','d','e','\0', 'e','d','i','t','a','b','l','e','\0', 'e','n','t','r','y','A','l','i','g','n','m','e','n','t','\0', 'e','n','t','r','y','B','o','r','d','e','r','\0', 'e','n','t','r','y','C','a','l','l','b','a','c','k','\0', 'e','n','t','r','y','C','l','a','s','s','\0', 'e','n','t','r','y','V','e','r','t','i','c','a','l','A','l','i','g','n','m','e','n','t','\0', 'e','x','p','o','r','t','T','a','r','g','e','t','s','\0', 'e','x','p','o','s','e','C','a','l','l','b','a','c','k','\0', 'e','x','t','e','n','d','e','d','S','e','l','e','c','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'e','x','t','e','n','s','i','o','n','T','y','p','e','\0', 'f','i','l','e','L','i','s','t','I','t','e','m','C','o','u','n','t','\0', 'f','i','l','e','L','i','s','t','I','t','e','m','s','\0', 'f','i','l','e','L','i','s','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'f','i','l','e','S','e','a','r','c','h','P','r','o','c','\0', 'f','i','l','e','T','y','p','e','M','a','s','k','\0', 'f','i','l','l','O','n','A','r','m','\0', 'f','i','l','l','O','n','S','e','l','e','c','t','\0', 'f','i','l','t','e','r','L','a','b','e','l','S','t','r','i','n','g','\0', 'f','o','c','u','s','C','a','l','l','b','a','c','k','\0', 'f','o','c','u','s','M','o','v','e','d','C','a','l','l','b','a','c','k','\0', 'f','o','c','u','s','P','o','l','i','c','y','C','h','a','n','g','e','d','\0', 'f','o','n','t','L','i','s','t','\0', 'f','o','r','e','g','r','o','u','n','d','T','h','r','e','s','h','o','l','d','\0', 'f','r','a','c','t','i','o','n','B','a','s','e','\0', 'g','a','i','n','P','r','i','m','a','r','y','C','a','l','l','b','a','c','k','\0', 'h','e','l','p','C','a','l','l','b','a','c','k','\0', 'h','e','l','p','L','a','b','e','l','S','t','r','i','n','g','\0', 'h','i','g','h','l','i','g','h','t','C','o','l','o','r','\0', 'h','i','g','h','l','i','g','h','t','O','n','E','n','t','e','r','\0', 'h','i','g','h','l','i','g','h','t','P','i','x','m','a','p','\0', 'h','i','g','h','l','i','g','h','t','T','h','i','c','k','n','e','s','s','\0', 'h','i','s','t','o','r','y','I','t','e','m','C','o','u','n','t','\0', 'h','i','s','t','o','r','y','I','t','e','m','s','\0', 'h','i','s','t','o','r','y','M','a','x','I','t','e','m','s','\0', 'h','i','s','t','o','r','y','V','i','s','i','b','l','e','I','t','e','m','C','o','u','n','t','\0', 'h','o','r','i','z','o','n','t','a','l','F','o','n','t','U','n','i','t','\0', 'h','o','r','i','z','o','n','t','a','l','S','c','r','o','l','l','B','a','r','\0', 'h','o','r','i','z','o','n','t','a','l','S','p','a','c','i','n','g','\0', 'h','o','t','X','\0', 'h','o','t','Y','\0', 'i','c','c','H','a','n','d','l','e','\0', 'i','m','p','o','r','t','T','a','r','g','e','t','s','\0', 'i','n','c','r','e','m','e','n','t','\0', 'i','n','c','r','e','m','e','n','t','C','a','l','l','b','a','c','k','\0', 'i','n','c','r','e','m','e','n','t','a','l','\0', 'i','n','d','i','c','a','t','o','r','O','n','\0', 'i','n','d','i','c','a','t','o','r','S','i','z','e','\0', 'i','n','d','i','c','a','t','o','r','T','y','p','e','\0', 'i','n','i','t','i','a','l','D','e','l','a','y','\0', 'i','n','i','t','i','a','l','F','o','c','u','s','\0', 'i','n','p','u','t','C','a','l','l','b','a','c','k','\0', 'i','n','p','u','t','C','r','e','a','t','e','\0', 'i','n','p','u','t','M','e','t','h','o','d','\0', 'i','n','v','a','l','i','d','C','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'i','s','A','l','i','g','n','e','d','\0', 'i','s','H','o','m','o','g','e','n','e','o','u','s','\0', 'i','t','e','m','C','o','u','n','t','\0', 'i','t','e','m','s','\0', 'k','e','y','b','o','a','r','d','F','o','c','u','s','P','o','l','i','c','y','\0', 'l','a','b','e','l','F','o','n','t','L','i','s','t','\0', 'l','a','b','e','l','I','n','s','e','n','s','i','t','i','v','e','P','i','x','m','a','p','\0', 'l','a','b','e','l','P','i','x','m','a','p','\0', 'l','a','b','e','l','S','t','r','i','n','g','\0', 'l','a','b','e','l','T','y','p','e','\0', 'l','e','f','t','A','t','t','a','c','h','m','e','n','t','\0', 'l','e','f','t','O','f','f','s','e','t','\0', 'l','e','f','t','P','o','s','i','t','i','o','n','\0', 'l','e','f','t','W','i','d','g','e','t','\0', 'l','i','g','h','t','T','h','r','e','s','h','o','l','d','\0', 'l','i','n','e','S','p','a','c','e','\0', 'l','i','s','t','I','t','e','m','C','o','u','n','t','\0', 'l','i','s','t','I','t','e','m','s','\0', 'l','i','s','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'l','i','s','t','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'l','i','s','t','M','a','r','g','i','n','W','i','d','t','h','\0', 'l','i','s','t','S','i','z','e','P','o','l','i','c','y','\0', 'l','i','s','t','S','p','a','c','i','n','g','\0', 'l','i','s','t','U','p','d','a','t','e','d','\0', 'l','i','s','t','V','i','s','i','b','l','e','I','t','e','m','C','o','u','n','t','\0', 'l','o','g','i','c','a','l','P','a','r','e','n','t','\0', 'l','o','s','e','P','r','i','m','a','r','y','C','a','l','l','b','a','c','k','\0', 'l','o','s','i','n','g','F','o','c','u','s','C','a','l','l','b','a','c','k','\0', 'm','a','i','n','W','i','n','d','o','w','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'm','a','i','n','W','i','n','d','o','w','M','a','r','g','i','n','W','i','d','t','h','\0', 'm','a','p','C','a','l','l','b','a','c','k','\0', 'm','a','p','p','i','n','g','D','e','l','a','y','\0', 'm','a','r','g','i','n','\0', 'm','a','r','g','i','n','B','o','t','t','o','m','\0', 'm','a','r','g','i','n','H','e','i','g','h','t','\0', 'm','a','r','g','i','n','L','e','f','t','\0', 'm','a','r','g','i','n','R','i','g','h','t','\0', 'm','a','r','g','i','n','T','o','p','\0', 'm','a','r','g','i','n','W','i','d','t','h','\0', 'm','a','s','k','\0', 'm','a','x','L','e','n','g','t','h','\0', 'm','a','x','i','m','u','m','\0', 'm','e','n','u','A','c','c','e','l','e','r','a','t','o','r','\0', 'm','e','n','u','B','a','r','\0', 'm','e','n','u','C','u','r','s','o','r','\0', 'm','e','n','u','H','e','l','p','W','i','d','g','e','t','\0', 'm','e','n','u','H','i','s','t','o','r','y','\0', 'm','e','n','u','P','o','s','t','\0', 'm','e','s','s','a','g','e','A','l','i','g','n','m','e','n','t','\0', 'm','e','s','s','a','g','e','P','r','o','c','\0', 'm','e','s','s','a','g','e','S','t','r','i','n','g','\0', 'm','e','s','s','a','g','e','W','i','n','d','o','w','\0', 'm','i','n','i','m','i','z','e','B','u','t','t','o','n','s','\0', 'm','i','n','i','m','u','m','\0', 'm','n','e','m','o','n','i','c','\0', 'm','n','e','m','o','n','i','c','C','h','a','r','S','e','t','\0', 'm','o','d','i','f','y','V','e','r','i','f','y','C','a','l','l','b','a','c','k','\0', 'm','o','d','i','f','y','V','e','r','i','f','y','C','a','l','l','b','a','c','k','W','c','s','\0', 'm','o','t','i','o','n','V','e','r','i','f','y','C','a','l','l','b','a','c','k','\0', 'm','o','v','e','O','p','a','q','u','e','\0', 'm','u','l','t','i','C','l','i','c','k','\0', 'm','u','l','t','i','p','l','e','S','e','l','e','c','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'm','u','s','t','M','a','t','c','h','\0', 'm','w','m','D','e','c','o','r','a','t','i','o','n','s','\0', 'm','w','m','F','u','n','c','t','i','o','n','s','\0', 'm','w','m','I','n','p','u','t','M','o','d','e','\0', 'm','w','m','M','e','n','u','\0', 'm','w','m','M','e','s','s','a','g','e','s','\0', 'n','a','v','i','g','a','t','i','o','n','T','y','p','e','\0', 'n','e','e','d','s','M','o','t','i','o','n','\0', 'n','o','M','a','t','c','h','C','a','l','l','b','a','c','k','\0', 'n','o','M','a','t','c','h','S','t','r','i','n','g','\0', 'n','o','R','e','s','i','z','e','\0', 'n','o','n','e','C','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'n','o','t','i','f','y','P','r','o','c','\0', 'n','u','m','C','o','l','u','m','n','s','\0', 'n','u','m','D','r','o','p','R','e','c','t','a','n','g','l','e','s','\0', 'n','u','m','D','r','o','p','T','r','a','n','s','f','e','r','s','\0', 'n','u','m','E','x','p','o','r','t','T','a','r','g','e','t','s','\0', 'n','u','m','I','m','p','o','r','t','T','a','r','g','e','t','s','\0', 'n','u','m','R','e','c','t','a','n','g','l','e','s','\0', 'o','f','f','s','e','t','X','\0', 'o','f','f','s','e','t','Y','\0', 'o','k','C','a','l','l','b','a','c','k','\0', 'o','k','L','a','b','e','l','S','t','r','i','n','g','\0', 'o','p','e','r','a','t','i','o','n','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'o','p','e','r','a','t','i','o','n','C','u','r','s','o','r','I','c','o','n','\0', 'o','p','t','i','o','n','L','a','b','e','l','\0', 'o','p','t','i','o','n','M','n','e','m','o','n','i','c','\0', 'o','u','t','p','u','t','C','r','e','a','t','e','\0', 'p','a','c','k','i','n','g','\0', 'p','a','g','e','D','e','c','r','e','m','e','n','t','C','a','l','l','b','a','c','k','\0', 'p','a','g','e','I','n','c','r','e','m','e','n','t','\0', 'p','a','g','e','I','n','c','r','e','m','e','n','t','C','a','l','l','b','a','c','k','\0', 'p','a','n','e','M','a','x','i','m','u','m','\0', 'p','a','n','e','M','i','n','i','m','u','m','\0', 'p','a','t','t','e','r','n','\0', 'p','e','n','d','i','n','g','D','e','l','e','t','e','\0', 'p','o','p','u','p','E','n','a','b','l','e','d','\0', 'p','o','s','i','t','i','o','n','I','n','d','e','x','\0', 'p','o','s','t','F','r','o','m','B','u','t','t','o','n','\0', 'p','o','s','t','F','r','o','m','C','o','u','n','t','\0', 'p','o','s','t','F','r','o','m','L','i','s','t','\0', 'p','r','e','e','d','i','t','T','y','p','e','\0', 'p','r','o','c','e','s','s','i','n','g','D','i','r','e','c','t','i','o','n','\0', 'p','r','o','m','p','t','S','t','r','i','n','g','\0', 'p','r','o','t','o','c','o','l','C','a','l','l','b','a','c','k','\0', 'p','u','s','h','B','u','t','t','o','n','E','n','a','b','l','e','d','\0', 'q','u','a','l','i','f','y','S','e','a','r','c','h','D','a','t','a','P','r','o','c','\0', 'r','a','d','i','o','A','l','w','a','y','s','O','n','e','\0', 'r','a','d','i','o','B','e','h','a','v','i','o','r','\0', 'r','e','a','l','i','z','e','C','a','l','l','b','a','c','k','\0', 'r','e','c','o','m','p','u','t','e','S','i','z','e','\0', 'r','e','c','t','a','n','g','l','e','s','\0', 'r','e','f','i','g','u','r','e','M','o','d','e','\0', 'r','e','p','e','a','t','D','e','l','a','y','\0', 'r','e','s','i','z','a','b','l','e','\0', 'r','e','s','i','z','e','C','a','l','l','b','a','c','k','\0', 'r','e','s','i','z','e','H','e','i','g','h','t','\0', 'r','e','s','i','z','e','P','o','l','i','c','y','\0', 'r','e','s','i','z','e','W','i','d','t','h','\0', 'r','i','g','h','t','A','t','t','a','c','h','m','e','n','t','\0', 'r','i','g','h','t','O','f','f','s','e','t','\0', 'r','i','g','h','t','P','o','s','i','t','i','o','n','\0', 'r','i','g','h','t','W','i','d','g','e','t','\0', 'r','o','w','C','o','l','u','m','n','T','y','p','e','\0', 'r','o','w','s','\0', 'r','u','b','b','e','r','P','o','s','i','t','i','o','n','i','n','g','\0', 's','a','s','h','H','e','i','g','h','t','\0', 's','a','s','h','I','n','d','e','n','t','\0', 's','a','s','h','S','h','a','d','o','w','T','h','i','c','k','n','e','s','s','\0', 's','a','s','h','W','i','d','t','h','\0', 's','c','a','l','e','H','e','i','g','h','t','\0', 's','c','a','l','e','M','u','l','t','i','p','l','e','\0', 's','c','a','l','e','W','i','d','t','h','\0', 's','c','r','o','l','l','B','a','r','D','i','s','p','l','a','y','P','o','l','i','c','y','\0', 's','c','r','o','l','l','B','a','r','P','l','a','c','e','m','e','n','t','\0', 's','c','r','o','l','l','H','o','r','i','z','o','n','t','a','l','\0', 's','c','r','o','l','l','L','e','f','t','S','i','d','e','\0', 's','c','r','o','l','l','T','o','p','S','i','d','e','\0', 's','c','r','o','l','l','V','e','r','t','i','c','a','l','\0', 's','c','r','o','l','l','e','d','W','i','n','d','o','w','M','a','r','g','i','n','H','e','i','g','h','t','\0', 's','c','r','o','l','l','e','d','W','i','n','d','o','w','M','a','r','g','i','n','W','i','d','t','h','\0', 's','c','r','o','l','l','i','n','g','P','o','l','i','c','y','\0', 's','e','l','e','c','t','C','o','l','o','r','\0', 's','e','l','e','c','t','I','n','s','e','n','s','i','t','i','v','e','P','i','x','m','a','p','\0', 's','e','l','e','c','t','P','i','x','m','a','p','\0', 's','e','l','e','c','t','T','h','r','e','s','h','o','l','d','\0', 's','e','l','e','c','t','e','d','I','t','e','m','C','o','u','n','t','\0', 's','e','l','e','c','t','e','d','I','t','e','m','s','\0', 's','e','l','e','c','t','i','o','n','A','r','r','a','y','C','o','u','n','t','\0', 's','e','l','e','c','t','i','o','n','L','a','b','e','l','S','t','r','i','n','g','\0', 's','e','l','e','c','t','i','o','n','P','o','l','i','c','y','\0', 's','e','p','a','r','a','t','o','r','O','n','\0', 's','e','p','a','r','a','t','o','r','T','y','p','e','\0', 's','e','t','\0', 's','h','a','d','o','w','\0', 's','h','a','d','o','w','T','h','i','c','k','n','e','s','s','\0', 's','h','a','d','o','w','T','y','p','e','\0', 's','h','e','l','l','U','n','i','t','T','y','p','e','\0', 's','h','o','w','A','r','r','o','w','s','\0', 's','h','o','w','A','s','D','e','f','a','u','l','t','\0', 's','h','o','w','S','e','p','a','r','a','t','o','r','\0', 's','h','o','w','V','a','l','u','e','\0', 's','i','m','p','l','e','C','a','l','l','b','a','c','k','\0', 's','i','n','g','l','e','S','e','l','e','c','t','i','o','n','C','a','l','l','b','a','c','k','\0', 's','i','z','e','P','o','l','i','c','y','\0', 's','k','i','p','A','d','j','u','s','t','\0', 's','l','i','d','e','r','S','i','z','e','\0', 's','o','u','r','c','e','\0', 's','o','u','r','c','e','C','u','r','s','o','r','I','c','o','n','\0', 's','o','u','r','c','e','I','s','E','x','t','e','r','n','a','l','\0', 's','o','u','r','c','e','P','i','x','m','a','p','I','c','o','n','\0', 's','o','u','r','c','e','W','i','d','g','e','t','\0', 's','o','u','r','c','e','W','i','n','d','o','w','\0', 's','p','a','c','i','n','g','\0', 's','p','o','t','L','o','c','a','t','i','o','n','\0', 's','t','a','r','t','T','i','m','e','\0', 's','t','a','t','e','C','u','r','s','o','r','I','c','o','n','\0', 's','t','r','i','n','g','D','i','r','e','c','t','i','o','n','\0', 's','u','b','M','e','n','u','I','d','\0', 's','y','m','b','o','l','P','i','x','m','a','p','\0', 't','e','a','r','O','f','f','M','e','n','u','A','c','t','i','v','a','t','e','C','a','l','l','b','a','c','k','\0', 't','e','a','r','O','f','f','M','e','n','u','D','e','a','c','t','i','v','a','t','e','C','a','l','l','b','a','c','k','\0', 't','e','a','r','O','f','f','M','o','d','e','l','\0', 't','e','x','t','A','c','c','e','l','e','r','a','t','o','r','s','\0', 't','e','x','t','C','o','l','u','m','n','s','\0', 't','e','x','t','F','o','n','t','L','i','s','t','\0', 't','e','x','t','S','t','r','i','n','g','\0', 't','e','x','t','T','r','a','n','s','l','a','t','i','o','n','s','\0', 't','e','x','t','V','a','l','u','e','\0', 't','i','t','l','e','S','t','r','i','n','g','\0', 't','o','B','o','t','t','o','m','C','a','l','l','b','a','c','k','\0', 't','o','P','o','s','i','t','i','o','n','C','a','l','l','b','a','c','k','\0', 't','o','T','o','p','C','a','l','l','b','a','c','k','\0', 't','o','p','A','t','t','a','c','h','m','e','n','t','\0', 't','o','p','C','h','a','r','a','c','t','e','r','\0', 't','o','p','I','t','e','m','P','o','s','i','t','i','o','n','\0', 't','o','p','L','e','v','e','l','E','n','t','e','r','C','a','l','l','b','a','c','k','\0', 't','o','p','L','e','v','e','l','L','e','a','v','e','C','a','l','l','b','a','c','k','\0', 't','o','p','O','f','f','s','e','t','\0', 't','o','p','P','o','s','i','t','i','o','n','\0', 't','o','p','S','h','a','d','o','w','C','o','l','o','r','\0', 't','o','p','S','h','a','d','o','w','P','i','x','m','a','p','\0', 't','o','p','W','i','d','g','e','t','\0', 't','r','a','n','s','f','e','r','P','r','o','c','\0', 't','r','a','n','s','f','e','r','S','t','a','t','u','s','\0', 't','r','a','v','e','r','s','a','l','C','a','l','l','b','a','c','k','\0', 't','r','a','v','e','r','s','a','l','O','n','\0', 't','r','a','v','e','r','s','a','l','T','y','p','e','\0', 't','r','a','v','e','r','s','e','O','b','s','c','u','r','e','d','C','a','l','l','b','a','c','k','\0', 't','r','e','e','U','p','d','a','t','e','P','r','o','c','\0', 't','r','o','u','g','h','C','o','l','o','r','\0', 'u','n','i','t','T','y','p','e','\0', 'u','n','m','a','p','C','a','l','l','b','a','c','k','\0', 'u','n','p','o','s','t','B','e','h','a','v','i','o','r','\0', 'u','n','s','e','l','e','c','t','P','i','x','m','a','p','\0', 'u','p','d','a','t','e','S','l','i','d','e','r','S','i','z','e','\0', 'u','s','e','A','s','y','n','c','G','e','o','m','e','t','r','y','\0', 'u','s','e','r','D','a','t','a','\0', 'v','a','l','i','d','C','u','r','s','o','r','F','o','r','e','g','r','o','u','n','d','\0', 'v','a','l','u','e','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'v','a','l','u','e','W','c','s','\0', 'v','e','r','i','f','y','B','e','l','l','\0', 'v','e','r','t','i','c','a','l','F','o','n','t','U','n','i','t','\0', 'v','e','r','t','i','c','a','l','S','c','r','o','l','l','B','a','r','\0', 'v','e','r','t','i','c','a','l','S','p','a','c','i','n','g','\0', 'v','i','s','i','b','l','e','I','t','e','m','C','o','u','n','t','\0', 'v','i','s','i','b','l','e','W','h','e','n','O','f','f','\0', 'v','i','s','u','a','l','P','o','l','i','c','y','\0', 'w','h','i','c','h','B','u','t','t','o','n','\0', 'w','o','r','d','W','r','a','p','\0', 'w','o','r','k','W','i','n','d','o','w','\0', 'A','l','i','g','n','m','e','n','t','\0', 'A','n','i','m','a','t','i','o','n','M','a','s','k','\0', 'A','n','i','m','a','t','i','o','n','P','i','x','m','a','p','\0', 'A','n','i','m','a','t','i','o','n','S','t','y','l','e','\0', 'A','r','r','o','w','D','i','r','e','c','t','i','o','n','\0', 'A','t','o','m','L','i','s','t','\0', 'A','t','t','a','c','h','m','e','n','t','\0', 'A','u','d','i','b','l','e','W','a','r','n','i','n','g','\0', 'A','v','a','i','l','a','b','i','l','i','t','y','\0', 'B','a','c','k','g','r','o','u','n','d','P','i','x','m','a','p','\0', 'B','l','e','n','d','M','o','d','e','l','\0', 'B','o','o','l','e','a','n','D','i','m','e','n','s','i','o','n','\0', 'B','o','t','t','o','m','S','h','a','d','o','w','P','i','x','m','a','p','\0', 'B','u','t','t','o','n','T','y','p','e','\0', 'C','a','l','l','b','a','c','k','P','r','o','c','\0', 'C','h','a','r','\0', 'C','h','a','r','S','e','t','T','a','b','l','e','\0', 'C','h','i','l','d','H','o','r','i','z','o','n','t','a','l','A','l','i','g','n','m','e','n','t','\0', 'C','h','i','l','d','P','l','a','c','e','m','e','n','t','\0', 'C','h','i','l','d','T','y','p','e','\0', 'C','h','i','l','d','V','e','r','t','i','c','a','l','A','l','i','g','n','m','e','n','t','\0', 'C','o','m','m','a','n','d','W','i','n','d','o','w','L','o','c','a','t','i','o','n','\0', 'C','o','m','p','o','u','n','d','T','e','x','t','\0', 'D','e','f','a','u','l','t','B','u','t','t','o','n','T','y','p','e','\0', 'D','e','l','e','t','e','R','e','s','p','o','n','s','e','\0', 'D','i','a','l','o','g','S','t','y','l','e','\0', 'D','i','a','l','o','g','T','y','p','e','\0', 'D','o','u','b','l','e','C','l','i','c','k','I','n','t','e','r','v','a','l','\0', 'D','r','a','g','I','n','i','t','i','a','t','o','r','P','r','o','t','o','c','o','l','S','t','y','l','e','\0', 'D','r','a','g','R','e','c','e','i','v','e','r','P','r','o','t','o','c','o','l','S','t','y','l','e','\0', 'D','r','o','p','S','i','t','e','A','c','t','i','v','i','t','y','\0', 'D','r','o','p','S','i','t','e','O','p','e','r','a','t','i','o','n','s','\0', 'D','r','o','p','S','i','t','e','T','y','p','e','\0', 'D','r','o','p','T','r','a','n','s','f','e','r','s','\0', 'E','x','t','e','n','s','i','o','n','T','y','p','e','\0', 'F','i','l','e','T','y','p','e','M','a','s','k','\0', 'F','o','n','t','L','i','s','t','\0', 'G','a','d','g','e','t','P','i','x','m','a','p','\0', 'H','i','g','h','l','i','g','h','t','P','i','x','m','a','p','\0', 'H','o','r','i','z','o','n','t','a','l','D','i','m','e','n','s','i','o','n','\0', 'H','o','r','i','z','o','n','t','a','l','I','n','t','\0', 'H','o','r','i','z','o','n','t','a','l','P','o','s','i','t','i','o','n','\0', 'I','c','o','n','A','t','t','a','c','h','m','e','n','t','\0', 'I','m','p','o','r','t','T','a','r','g','e','t','s','\0', 'I','n','d','i','c','a','t','o','r','T','y','p','e','\0', 'I','t','e','m','C','o','u','n','t','\0', 'I','t','e','m','s','\0', 'K','e','y','S','y','m','\0', 'K','e','y','S','y','m','T','a','b','l','e','\0', 'K','e','y','b','o','a','r','d','F','o','c','u','s','P','o','l','i','c','y','\0', 'L','a','b','e','l','T','y','p','e','\0', 'L','i','s','t','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'L','i','s','t','M','a','r','g','i','n','W','i','d','t','h','\0', 'L','i','s','t','S','i','z','e','P','o','l','i','c','y','\0', 'L','i','s','t','S','p','a','c','i','n','g','\0', 'M','a','n','B','o','t','t','o','m','S','h','a','d','o','w','P','i','x','m','a','p','\0', 'M','a','n','F','o','r','e','g','r','o','u','n','d','P','i','x','m','a','p','\0', 'M','a','n','H','i','g','h','l','i','g','h','t','P','i','x','m','a','p','\0', 'M','a','n','T','o','p','S','h','a','d','o','w','P','i','x','m','a','p','\0', 'M','e','n','u','W','i','d','g','e','t','\0', 'M','n','e','m','o','n','i','c','\0', 'M','u','l','t','i','C','l','i','c','k','\0', 'N','a','v','i','g','a','t','i','o','n','T','y','p','e','\0', 'P','a','c','k','i','n','g','\0', 'P','r','i','m','F','o','r','e','g','r','o','u','n','d','P','i','x','m','a','p','\0', 'P','r','o','c','\0', 'P','r','o','c','e','s','s','i','n','g','D','i','r','e','c','t','i','o','n','\0', 'R','e','c','t','a','n','g','l','e','L','i','s','t','\0', 'R','e','s','i','z','e','P','o','l','i','c','y','\0', 'R','o','w','C','o','l','u','m','n','T','y','p','e','\0', 'S','c','r','o','l','l','B','a','r','D','i','s','p','l','a','y','P','o','l','i','c','y','\0', 'S','c','r','o','l','l','B','a','r','P','l','a','c','e','m','e','n','t','\0', 'S','c','r','o','l','l','i','n','g','P','o','l','i','c','y','\0', 'S','e','l','e','c','t','e','d','I','t','e','m','C','o','u','n','t','\0', 'S','e','l','e','c','t','e','d','I','t','e','m','s','\0', 'S','e','l','e','c','t','i','o','n','P','o','l','i','c','y','\0', 'S','e','l','e','c','t','i','o','n','T','y','p','e','\0', 'S','e','p','a','r','a','t','o','r','T','y','p','e','\0', 'S','h','a','d','o','w','T','y','p','e','\0', 'S','h','e','l','l','H','o','r','i','z','D','i','m','\0', 'S','h','e','l','l','H','o','r','i','z','P','o','s','\0', 'S','h','e','l','l','U','n','i','t','T','y','p','e','\0', 'S','h','e','l','l','V','e','r','t','D','i','m','\0', 'S','h','e','l','l','V','e','r','t','P','o','s','\0', 'S','i','z','e','P','o','l','i','c','y','\0', 'S','t','r','i','n','g','D','i','r','e','c','t','i','o','n','\0', 'T','e','a','r','O','f','f','M','o','d','e','l','\0', 'T','o','p','S','h','a','d','o','w','P','i','x','m','a','p','\0', 'T','r','a','n','s','f','e','r','S','t','a','t','u','s','\0', 'T','r','a','v','e','r','s','a','l','T','y','p','e','\0', 'U','n','i','t','T','y','p','e','\0', 'U','n','p','o','s','t','B','e','h','a','v','i','o','r','\0', 'V','a','l','u','e','W','c','s','\0', 'V','e','r','t','i','c','a','l','A','l','i','g','n','m','e','n','t','\0', 'V','e','r','t','i','c','a','l','D','i','m','e','n','s','i','o','n','\0', 'V','e','r','t','i','c','a','l','I','n','t','\0', 'V','e','r','t','i','c','a','l','P','o','s','i','t','i','o','n','\0', 'V','i','r','t','u','a','l','B','i','n','d','i','n','g','\0', 'V','i','s','i','b','l','e','I','t','e','m','C','o','u','n','t','\0', 'V','i','s','u','a','l','P','o','l','i','c','y','\0', 'W','h','i','c','h','B','u','t','t','o','n','\0', 'X','m','B','a','c','k','g','r','o','u','n','d','P','i','x','m','a','p','\0', 'X','m','S','t','r','i','n','g','\0', 'X','m','S','t','r','i','n','g','C','h','a','r','S','e','t','\0', 'X','m','S','t','r','i','n','g','T','a','b','l','e','\0', 'o','s','f','A','c','t','i','v','a','t','e','\0', 'o','s','f','A','d','d','M','o','d','e','\0', 'o','s','f','B','a','c','k','S','p','a','c','e','\0', 'o','s','f','B','e','g','i','n','L','i','n','e','\0', 'o','s','f','C','a','n','c','e','l','\0', 'o','s','f','C','l','e','a','r','\0', 'o','s','f','C','o','p','y','\0', 'o','s','f','C','u','t','\0', 'o','s','f','D','e','l','e','t','e','\0', 'o','s','f','D','o','w','n','\0', 'o','s','f','E','n','d','L','i','n','e','\0', 'o','s','f','H','e','l','p','\0', 'o','s','f','I','n','s','e','r','t','\0', 'o','s','f','L','e','f','t','\0', 'o','s','f','M','e','n','u','\0', 'o','s','f','M','e','n','u','B','a','r','\0', 'o','s','f','P','a','g','e','D','o','w','n','\0', 'o','s','f','P','a','g','e','L','e','f','t','\0', 'o','s','f','P','a','g','e','R','i','g','h','t','\0', 'o','s','f','P','a','g','e','U','p','\0', 'o','s','f','P','a','s','t','e','\0', 'o','s','f','P','r','i','m','a','r','y','P','a','s','t','e','\0', 'o','s','f','Q','u','i','c','k','P','a','s','t','e','\0', 'o','s','f','R','i','g','h','t','\0', 'o','s','f','S','e','l','e','c','t','\0', 'o','s','f','U','n','d','o','\0', 'o','s','f','U','p','\0', 'F','O','N','T','L','I','S','T','_','D','E','F','A','U','L','T','_','T','A','G','_','S','T','R','I','N','G','\0', 'X','m','F','O','N','T','L','I','S','T','_','D','E','F','A','U','L','T','_','T','A','G','_','S','T','R','I','N','G','\0', 'T','o','p','I','t','e','m','P','o','s','i','t','i','o','n','\0', 't','e','a','r','O','f','f','T','i','t','l','e','\0', 'T','e','a','r','O','f','f','T','i','t','l','e','\0', 'p','o','p','u','p','H','a','n','d','l','e','r','C','a','l','l','b','a','c','k','\0', 'c','o','n','v','e','r','t','C','a','l','l','b','a','c','k','\0', 'd','e','s','t','i','n','a','t','i','o','n','C','a','l','l','b','a','c','k','\0', 's','e','l','e','c','t','e','d','I','t','e','m','\0', 'S','e','l','e','c','t','e','d','I','t','e','m','\0', 's','e','l','e','c','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'm','a','t','c','h','B','e','h','a','v','i','o','r','\0', 'M','a','t','c','h','B','e','h','a','v','i','o','r','\0', 'n','o','F','o','n','t','C','a','l','l','b','a','c','k','\0', 't','e','x','t','P','a','t','h','\0', 'e','d','i','t','i','n','g','P','a','t','h','\0', 'E','d','i','t','i','n','g','P','a','t','h','\0', 'b','i','d','i','r','e','c','t','i','o','n','a','l','C','u','r','s','o','r','\0', 'B','i','d','i','r','e','c','t','i','o','n','a','l','C','u','r','s','o','r','\0', 'c','o','l','l','a','p','s','e','d','S','t','a','t','e','P','i','x','m','a','p','\0', 'd','e','t','a','i','l','C','o','l','u','m','n','H','e','a','d','i','n','g','\0', 'd','e','t','a','i','l','C','o','u','n','t','\0', 'd','e','t','a','i','l','T','a','b','L','i','s','t','\0', 'e','x','p','a','n','d','e','d','S','t','a','t','e','P','i','x','m','a','p','\0', 'l','a','r','g','e','C','e','l','l','H','e','i','g','h','t','\0', 'l','a','r','g','e','C','e','l','l','W','i','d','t','h','\0', 'l','a','y','o','u','t','T','y','p','e','\0', 'o','u','t','l','i','n','e','I','n','d','e','n','t','a','t','i','o','n','\0', 'o','u','t','l','i','n','e','L','i','n','e','S','t','y','l','e','\0', 'p','r','i','m','a','r','y','O','w','n','e','r','s','h','i','p','\0', 's','e','l','e','c','t','i','o','n','T','e','c','h','n','i','q','u','e','\0', 's','m','a','l','l','C','e','l','l','H','e','i','g','h','t','\0', 's','m','a','l','l','C','e','l','l','W','i','d','t','h','\0', 's','p','a','t','i','a','l','S','t','y','l','e','\0', 'e','n','t','r','y','P','a','r','e','n','t','\0', 'l','a','r','g','e','I','c','o','n','X','\0', 'l','a','r','g','e','I','c','o','n','Y','\0', 's','m','a','l','l','I','c','o','n','X','\0', 's','m','a','l','l','I','c','o','n','Y','\0', 'C','o','l','l','a','p','s','e','d','S','t','a','t','e','P','i','x','m','a','p','\0', 'D','e','t','a','i','l','C','o','l','u','m','n','H','e','a','d','i','n','g','\0', 'D','e','t','a','i','l','C','o','u','n','t','\0', 'D','e','t','a','i','l','M','a','s','k','\0', 'E','n','t','r','y','V','i','e','w','T','y','p','e','\0', 'L','i','n','e','S','t','y','l','e','\0', 'D','e','t','a','i','l','T','a','b','L','i','s','t','\0', 'E','x','p','a','n','d','e','d','S','t','a','t','e','P','i','x','m','a','p','\0', 'I','n','c','l','u','d','e','M','o','d','e','l','\0', 'C','e','l','l','H','e','i','g','h','t','\0', 'C','e','l','l','W','i','d','t','h','\0', 'L','a','y','o','u','t','T','y','p','e','\0', 'O','u','t','l','i','n','e','I','n','d','e','n','t','a','t','i','o','n','\0', 'P','l','a','c','e','M','o','d','e','l','\0', 'P','r','i','m','a','r','y','O','w','n','e','r','s','h','i','p','\0', 'S','e','l','e','c','t','i','o','n','T','e','c','h','n','i','q','u','e','\0', 'S','p','a','t','i','a','l','S','t','y','l','e','\0', 'E','n','t','r','y','D','e','t','a','i','l','\0', 'E','x','p','a','n','d','S','t','a','t','e','\0', 'l','a','r','g','e','I','c','o','n','\0', 'l','a','r','g','e','I','c','o','n','M','a','s','k','\0', 'l','a','r','g','e','I','c','o','n','P','i','x','m','a','p','\0', 's','m','a','l','l','I','c','o','n','\0', 's','m','a','l','l','I','c','o','n','M','a','s','k','\0', 's','m','a','l','l','I','c','o','n','P','i','x','m','a','p','\0', 'I','c','o','n','\0', 'V','i','e','w','T','y','p','e','\0', 'V','i','s','u','a','l','E','m','p','h','a','s','i','s','\0', 'c','u','r','r','e','n','t','P','a','g','e','N','u','m','b','e','r','\0', 'f','i','r','s','t','P','a','g','e','N','u','m','b','e','r','\0', 'l','a','s','t','P','a','g','e','N','u','m','b','e','r','\0', 'b','a','c','k','P','a','g','e','P','l','a','c','e','m','e','n','t','\0', 'b','a','c','k','P','a','g','e','N','u','m','b','e','r','\0', 'b','a','c','k','P','a','g','e','S','i','z','e','\0', 'b','a','c','k','P','a','g','e','F','o','r','e','g','r','o','u','n','d','\0', 'b','a','c','k','P','a','g','e','B','a','c','k','g','r','o','u','n','d','\0', 'f','r','a','m','e','B','a','c','k','g','r','o','u','n','d','\0', 'b','i','n','d','i','n','g','T','y','p','e','\0', 'b','i','n','d','i','n','g','P','i','x','m','a','p','\0', 'b','i','n','d','i','n','g','W','i','d','t','h','\0', 'm','a','j','o','r','T','a','b','S','p','a','c','i','n','g','\0', 'm','i','n','o','r','T','a','b','S','p','a','c','i','n','g','\0', 'i','n','n','e','r','M','a','r','g','i','n','W','i','d','t','h','\0', 'i','n','n','e','r','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'f','r','a','m','e','S','h','a','d','o','w','T','h','i','c','k','n','e','s','s','\0', 'p','a','g','e','N','u','m','b','e','r','\0', 'C','u','r','r','e','n','t','P','a','g','e','N','u','m','b','e','r','\0', 'F','i','r','s','t','P','a','g','e','N','u','m','b','e','r','\0', 'L','a','s','t','P','a','g','e','N','u','m','b','e','r','\0', 'B','a','c','k','P','a','g','e','P','l','a','c','e','m','e','n','t','\0', 'B','a','c','k','P','a','g','e','N','u','m','b','e','r','\0', 'B','a','c','k','P','a','g','e','S','i','z','e','\0', 'B','a','c','k','P','a','g','e','F','o','r','e','g','r','o','u','n','d','\0', 'B','a','c','k','P','a','g','e','B','a','c','k','g','r','o','u','n','d','\0', 'F','r','a','m','e','B','a','c','k','g','r','o','u','n','d','\0', 'B','i','n','d','i','n','g','T','y','p','e','\0', 'B','i','n','d','i','n','g','P','i','x','m','a','p','\0', 'B','i','n','d','i','n','g','W','i','d','t','h','\0', 'M','a','j','o','r','T','a','b','S','p','a','c','i','n','g','\0', 'M','i','n','o','r','T','a','b','S','p','a','c','i','n','g','\0', 'I','n','n','e','r','M','a','r','g','i','n','W','i','d','t','h','\0', 'I','n','n','e','r','M','a','r','g','i','n','H','e','i','g','h','t','\0', 'P','a','g','e','C','h','a','n','g','e','C','a','l','l','b','a','c','k','\0', 'P','a','g','e','N','u','m','b','e','r','\0', 'A','r','r','o','w','L','a','y','o','u','t','\0', 'A','r','r','o','w','S','e','n','s','i','t','i','v','i','t','y','\0', 'S','p','i','n','B','o','x','C','h','i','l','d','T','y','p','e','\0', 'a','r','r','o','w','L','a','y','o','u','t','\0', 'A','r','r','o','w','L','a','y','o','u','t','\0', 'a','r','r','o','w','S','e','n','s','i','t','i','v','i','t','y','\0', 'A','r','r','o','w','S','e','n','s','i','t','i','v','i','t','y','\0', 'd','e','f','a','u','l','t','A','r','r','o','w','S','e','n','s','i','t','i','v','i','t','y','\0', 'D','e','f','a','u','l','t','A','r','r','o','w','S','e','n','s','i','t','i','v','i','t','y','\0', 'a','r','r','o','w','S','i','z','e','\0', 'A','r','r','o','w','S','i','z','e','\0', 's','p','i','n','B','o','x','C','h','i','l','d','T','y','p','e','\0', 'S','p','i','n','B','o','x','C','h','i','l','d','T','y','p','e','\0', 'p','o','s','i','t','i','o','n','\0', 'n','u','m','V','a','l','u','e','s','\0', 'N','u','m','V','a','l','u','e','s','\0', 'v','a','l','u','e','s','\0', 'V','a','l','u','e','s','\0', 'm','i','n','i','m','u','m','V','a','l','u','e','\0', 'M','i','n','i','m','u','m','V','a','l','u','e','\0', 'm','a','x','i','m','u','m','V','a','l','u','e','\0', 'M','a','x','i','m','u','m','V','a','l','u','e','\0', 'i','n','c','r','e','m','e','n','t','V','a','l','u','e','\0', 'I','n','c','r','e','m','e','n','t','V','a','l','u','e','\0', 'A','u','t','o','m','a','t','i','c','S','e','l','e','c','t','i','o','n','\0', 'L','i','n','e','S','t','y','l','e','\0', 'E','n','t','r','y','V','i','e','w','T','y','p','e','\0', 'D','i','r','e','c','t','i','o','n','\0', 'L','a','y','o','u','t','T','y','p','e','\0', 'P','r','i','m','a','r','y','O','w','n','e','r','s','h','i','p','\0', 'S','e','l','e','c','t','i','o','n','T','e','c','h','n','i','q','u','e','\0', 'S','p','a','t','i','a','l','S','t','y','l','e','\0', 'T','a','b','L','i','s','t','\0', 'V','i','e','w','T','y','p','e','\0', 'V','i','s','u','a','l','E','m','p','h','a','s','i','s','\0', 'B','i','n','d','i','n','g','T','y','p','e','\0', 'N','B','C','h','i','l','d','T','y','p','e','\0', 'e','n','t','r','y','V','i','e','w','T','y','p','e','\0', 'i','n','s','e','n','s','i','t','i','v','e','S','t','i','p','p','l','e','B','i','t','m','a','p','\0', 'l','a','y','o','u','t','D','i','r','e','c','t','i','o','n','\0', 'v','i','e','w','T','y','p','e','\0', 'v','i','s','u','a','l','E','m','p','h','a','s','i','s','\0', 'L','a','y','o','u','t','D','i','r','e','c','t','i','o','n','\0', 's','n','a','p','B','a','c','k','M','u','l','t','i','p','l','e','\0', 's','l','i','d','i','n','g','M','o','d','e','\0', 's','l','i','d','e','r','V','i','s','u','a','l','\0', 'a','u','t','o','D','r','a','g','M','o','d','e','l','\0', 'c','o','l','o','r','C','a','l','c','u','l','a','t','i','o','n','P','r','o','c','\0', 'b','i','t','m','a','p','C','o','n','v','e','r','s','i','o','n','M','o','d','e','l','\0', 'c','o','l','o','r','A','l','l','o','c','a','t','i','o','n','P','r','o','c','\0', 's','e','l','e','c','t','i','o','n','M','o','d','e','\0', 's','e','l','e','c','t','e','d','P','o','s','i','t','i','o','n','s','\0', 's','e','l','e','c','t','e','d','P','o','s','i','t','i','o','n','C','o','u','n','t','\0', 'S','n','a','p','B','a','c','k','M','u','l','t','i','p','l','e','\0', 'S','l','i','d','e','r','V','i','s','u','a','l','\0', 'S','l','i','d','i','n','g','M','o','d','e','\0', 'A','u','t','o','D','r','a','g','M','o','d','e','l','\0', 'C','o','l','o','r','C','a','l','c','u','l','a','t','i','o','n','P','r','o','c','\0', 'B','i','t','m','a','p','C','o','n','v','e','r','s','i','o','n','M','o','d','e','l','\0', 'C','o','l','o','r','A','l','l','o','c','a','t','i','o','n','P','r','o','c','\0', 'I','n','s','e','n','s','i','t','i','v','e','S','t','i','p','p','l','e','B','i','t','m','a','p','\0', 'S','e','l','e','c','t','i','o','n','M','o','d','e','\0', 'S','e','l','e','c','t','e','d','P','o','s','i','t','i','o','n','s','\0', 'S','e','l','e','c','t','e','d','P','o','s','i','t','i','o','n','C','o','u','n','t','\0', 'S','l','i','d','i','n','g','M','o','d','e','\0', 'S','h','o','w','A','r','r','o','w','s','\0', 'S','l','i','d','e','r','V','i','s','u','a','l','\0', 'S','h','o','w','V','a','l','u','e','\0', 'A','u','t','o','D','r','a','g','M','o','d','e','l','\0', 'S','W','C','h','i','l','d','T','y','p','e','\0', 'B','i','t','m','a','p','C','o','n','v','e','r','s','i','o','n','M','o','d','e','l','\0', 'S','e','l','e','c','t','i','o','n','M','o','d','e','\0', 'i','n','p','u','t','P','o','l','i','c','y','\0', 'I','n','p','u','t','P','o','l','i','c','y','\0', 'I','n','p','u','t','P','o','l','i','c','y','\0', 't','o','g','g','l','e','M','o','d','e','\0', 'T','o','g','g','l','e','M','o','d','e','\0', 'T','o','g','g','l','e','M','o','d','e','\0', 'I','n','d','i','c','a','t','o','r','O','n','\0', 'S','e','t','\0', 'i','n','d','e','t','e','r','m','i','n','a','t','e','P','i','x','m','a','p','\0', 'I','n','d','e','t','e','r','m','i','n','a','t','e','P','i','x','m','a','p','\0', 'u','n','s','e','l','e','c','t','C','o','l','o','r','\0', 'U','n','s','e','l','e','c','t','C','o','l','o','r','\0', 's','e','l','e','c','t','e','d','P','o','s','i','t','i','o','n','\0', 'a','r','r','o','w','S','p','a','c','i','n','g','\0', 'A','r','r','o','w','S','p','a','c','i','n','g','\0', 'M','a','t','c','h','B','e','h','a','v','i','o','r','\0', 'C','o','m','b','o','B','o','x','T','y','p','e','\0', 'S','e','l','e','c','t','e','d','P','o','s','i','t','i','o','n','\0', 'e','n','a','b','l','e','W','a','r','p','\0', 'E','n','a','b','l','e','W','a','r','p','\0', 'E','n','a','b','l','e','W','a','r','p','\0', 'm','o','t','i','f','V','e','r','s','i','o','n','\0', 'M','o','t','i','f','V','e','r','s','i','o','n','\0', 'd','e','f','a','u','l','t','G','l','y','p','h','P','i','x','m','a','p','\0', 'D','e','f','a','u','l','t','G','l','y','p','h','P','i','x','m','a','p','\0', 'R','e','n','d','i','t','i','o','n','\0', 't','a','g','\0', 'T','a','g','\0', 'f','o','n','t','N','a','m','e','\0', 'F','o','n','t','N','a','m','e','\0', 'f','o','n','t','T','y','p','e','\0', 'F','o','n','t','T','y','p','e','\0', 'F','o','n','t','T','y','p','e','\0', 'l','o','a','d','M','o','d','e','l','\0', 'L','o','a','d','M','o','d','e','l','\0', 'L','o','a','d','M','o','d','e','l','\0', 't','a','b','L','i','s','t','\0', 'T','a','b','L','i','s','t','\0', 'R','e','n','d','i','t','i','o','n','P','i','x','e','l','\0', 'u','n','d','e','r','l','i','n','e','T','y','p','e','\0', 'U','n','d','e','r','l','i','n','e','T','y','p','e','\0', 's','t','r','i','k','e','t','h','r','u','T','y','p','e','\0', 'S','t','r','i','k','e','t','h','r','u','T','y','p','e','\0', 'L','i','n','e','T','y','p','e','\0', 'r','e','n','d','e','r','T','a','b','l','e','\0', 'R','e','n','d','e','r','T','a','b','l','e','\0', 'R','e','n','d','e','r','T','a','b','l','e','\0', 'b','u','t','t','o','n','R','e','n','d','e','r','T','a','b','l','e','\0', 'B','u','t','t','o','n','R','e','n','d','e','r','T','a','b','l','e','\0', 'B','u','t','t','o','n','R','e','n','d','e','r','T','a','b','l','e','\0', 'l','a','b','e','l','R','e','n','d','e','r','T','a','b','l','e','\0', 'L','a','b','e','l','R','e','n','d','e','r','T','a','b','l','e','\0', 'L','a','b','e','l','R','e','n','d','e','r','T','a','b','l','e','\0', 't','e','x','t','R','e','n','d','e','r','T','a','b','l','e','\0', 'T','e','x','t','R','e','n','d','e','r','T','a','b','l','e','\0', 'T','e','x','t','R','e','n','d','e','r','T','a','b','l','e','\0', 'd','r','a','g','S','t','a','r','t','C','a','l','l','b','a','c','k','\0', 'n','o','R','e','n','d','i','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'X','m','A','S','_','I','S','\0', 'I','s','W','h','i','t','e','S','p','a','c','e','M','e','t','h','o','d','\0', 'I','s','S','c','a','n','B','r','e','a','k','M','e','t','h','o','d','\0', 'C','h','a','r','D','i','r','e','c','t','i','o','n','\0', 'I','n','i','t','i','a','l','C','h','a','r','s','D','i','r','e','c','t','i','o','n','\0', 'p','a','t','t','e','r','n','T','y','p','e','\0', 's','u','b','s','t','i','t','u','t','e','\0', 'i','n','v','o','k','e','P','a','r','s','e','P','r','o','c','\0', 'i','n','c','l','u','d','e','S','t','a','t','u','s','\0', 'o','s','f','B','a','c','k','T','a','b','\0', 'o','s','f','B','e','g','i','n','D','a','t','a','\0', 'o','s','f','D','e','s','e','l','e','c','t','A','l','l','\0', 'o','s','f','E','n','d','D','a','t','a','\0', 'o','s','f','E','s','c','a','p','e','\0', 'o','s','f','E','x','t','e','n','d','\0', 'o','s','f','L','e','f','t','L','i','n','e','\0', 'o','s','f','N','e','x','t','\0', 'o','s','f','N','e','x','t','F','i','e','l','d','\0', 'o','s','f','N','e','x','t','M','e','n','u','\0', 'o','s','f','N','e','x','t','M','i','n','o','r','\0', 'o','s','f','P','r','e','v','F','i','e','l','d','\0', 'o','s','f','P','r','e','v','M','e','n','u','\0', 'o','s','f','P','r','i','o','r','\0', 'o','s','f','P','r','i','o','r','M','i','n','o','r','\0', 'o','s','f','R','e','s','e','l','e','c','t','\0', 'o','s','f','R','e','s','t','o','r','e','\0', 'o','s','f','R','i','g','h','t','L','i','n','e','\0', 'o','s','f','S','e','l','e','c','t','A','l','l','\0', 'o','s','f','S','w','i','t','c','h','D','i','r','e','c','t','i','o','n','\0', 'n','o','t','e','b','o','o','k','C','h','i','l','d','T','y','p','e','\0', 'N','o','t','e','b','o','o','k','C','h','i','l','d','T','y','p','e','\0', 'N','o','t','e','b','o','o','k','C','h','i','l','d','T','y','p','e','\0', 's','c','r','o','l','l','e','d','W','i','n','d','o','w','C','h','i','l','d','T','y','p','e','\0', 'S','c','r','o','l','l','e','d','W','i','n','d','o','w','C','h','i','l','d','T','y','p','e','\0', 'S','c','r','o','l','l','e','d','W','i','n','d','o','w','C','h','i','l','d','T','y','p','e','\0', 's','e','l','e','c','t','e','d','O','b','j','e','c','t','s','\0', 'S','e','l','e','c','t','e','d','O','b','j','e','c','t','s','\0', 's','e','l','e','c','t','e','d','O','b','j','e','c','t','C','o','u','n','t','\0', 'S','e','l','e','c','t','e','d','O','b','j','e','c','t','C','o','u','n','t','\0', 'c','o','m','b','o','B','o','x','T','y','p','e','\0', 'C','o','m','b','o','B','o','x','T','y','p','e','\0', 't','a','b','V','a','l','u','e','\0', 'o','f','f','s','e','t','M','o','d','e','l','\0', 'd','e','c','i','m','a','l','\0', 'd','e','t','a','i','l','\0', 'D','e','t','a','i','l','\0', 'd','e','t','a','i','l','C','o','u','n','t','\0', 'D','e','t','a','i','l','C','o','u','n','t','\0', 'c','o','n','t','a','i','n','e','r','I','D','\0', 'C','o','n','t','a','i','n','e','r','I','D','\0', 'C','L','I','E','N','T','_','W','I','N','D','O','W','\0', 'C','L','I','P','_','T','E','M','P','O','R','A','R','Y','\0', 'C','L','I','P','B','O','A','R','D','\0', 'C','O','M','P','O','U','N','D','_','T','E','X','T','\0', 'D','E','L','E','T','E','\0', 'F','I','L','E','\0', 'F','I','L','E','_','N','A','M','E','\0', 'I','N','C','R','\0', 'I','N','S','E','R','T','_','P','R','O','P','E','R','T','Y','\0', 'I','N','S','E','R','T','_','S','E','L','E','C','T','I','O','N','\0', 'L','E','N','G','T','H','\0', 'L','I','N','K','_','S','E','L','E','C','T','I','O','N','\0', '_','M','O','T','I','F','_','A','T','O','M','_','0','\0', '_','M','O','T','I','F','_','B','I','N','D','I','N','G','S','\0', '_','M','O','T','I','F','_','D','E','F','A','U','L','T','_','B','I','N','D','I','N','G','S','\0', '_','M','O','T','I','F','_','C','A','N','C','E','L','_','D','R','O','P','_','E','F','F','E','C','T','\0', '_','M','O','T','I','F','_','C','L','I','P','_','H','E','A','D','E','R','\0', '_','M','O','T','I','F','_','C','L','I','P','_','D','A','T','A','_','R','E','Q','U','E','S','T','\0', '_','M','O','T','I','F','_','C','L','I','P','_','D','A','T','A','_','D','E','L','E','T','E','\0', '_','M','O','T','I','F','_','C','L','I','P','_','I','T','E','M','\0', '_','M','O','T','I','F','_','C','L','I','P','_','L','O','C','K','\0', '_','M','O','T','I','F','_','C','L','I','P','_','L','O','C','K','_','A','C','C','E','S','S','_','V','A','L','I','D','\0', '_','M','O','T','I','F','_','C','L','I','P','_','M','E','S','S','A','G','E','\0', '_','M','O','T','I','F','_','C','L','I','P','_','N','E','X','T','_','I','D','\0', '_','M','O','T','I','F','_','C','L','I','P','_','T','I','M','E','\0', '_','M','O','T','I','F','_','C','L','I','P','B','O','A','R','D','_','T','A','R','G','E','T','S','\0', '_','M','O','T','I','F','_','C','O','M','P','O','U','N','D','_','S','T','R','I','N','G','\0', '_','M','O','T','I','F','_','D','E','F','E','R','R','E','D','_','C','L','I','P','B','O','A','R','D','_','T','A','R','G','E','T','S','\0', '_','M','O','T','I','F','_','D','E','S','T','I','N','A','T','I','O','N','\0', '_','M','O','T','I','F','_','D','R','A','G','_','O','F','F','S','E','T','\0', '_','M','O','T','I','F','_','D','R','O','P','\0', '_','M','O','T','I','F','_','E','N','C','O','D','I','N','G','_','R','E','G','I','S','T','R','Y','\0', '_','M','O','T','I','F','_','E','X','P','O','R','T','_','T','A','R','G','E','T','S','\0', '_','M','O','T','I','F','_','L','O','S','E','_','S','E','L','E','C','T','I','O','N','\0', '_','M','O','T','I','F','_','R','E','N','D','E','R','_','T','A','B','L','E','\0', '_','M','O','T','I','F','_','W','M','_','Q','U','E','R','Y','\0', '_','M','O','T','I','F','_','W','M','_','A','L','L','_','C','L','I','E','N','T','S','\0', 'M','U','L','T','I','P','L','E','\0', 'N','U','L','L','\0', 'T','A','R','G','E','T','S','\0', 'T','E','X','T','\0', 'T','I','M','E','S','T','A','M','P','\0', 'W','M','_','S','T','A','T','E','\0', 'X','m','T','R','A','N','S','F','E','R','_','S','U','C','C','E','S','S','\0', 'X','m','T','R','A','N','S','F','E','R','_','F','A','I','L','U','R','E','\0', 'p','a','t','h','M','o','d','e','\0', 'P','a','t','h','M','o','d','e','\0', 'P','a','t','h','M','o','d','e','\0', 'f','i','l','e','F','i','l','t','e','r','S','t','y','l','e','\0', 'F','i','l','e','F','i','l','t','e','r','S','t','y','l','e','\0', 'F','i','l','e','F','i','l','t','e','r','S','t','y','l','e','\0', 'd','i','r','T','e','x','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'D','i','r','T','e','x','t','L','a','b','e','l','S','t','r','i','n','g','\0', 'e','n','a','b','l','e','B','t','n','1','T','r','a','n','s','f','e','r','\0', 'E','n','a','b','l','e','B','t','n','1','T','r','a','n','s','f','e','r','\0', 'e','n','a','b','l','e','B','u','t','t','o','n','T','a','b','\0', 'E','n','a','b','l','e','B','u','t','t','o','n','T','a','b','\0', 'e','n','a','b','l','e','E','t','c','h','e','d','I','n','M','e','n','u','\0', 'E','n','a','b','l','e','E','t','c','h','e','d','I','n','M','e','n','u','\0', 'd','e','f','a','u','l','t','B','u','t','t','o','n','E','m','p','h','a','s','i','s','\0', 'D','e','f','a','u','l','t','B','u','t','t','o','n','E','m','p','h','a','s','i','s','\0', 'D','e','f','a','u','l','t','B','u','t','t','o','n','E','m','p','h','a','s','i','s','\0', 'e','n','a','b','l','e','T','o','g','g','l','e','C','o','l','o','r','\0', 'E','n','a','b','l','e','T','o','g','g','l','e','C','o','l','o','r','\0', 'e','n','a','b','l','e','T','o','g','g','l','e','V','i','s','u','a','l','\0', 'E','n','a','b','l','e','T','o','g','g','l','e','V','i','s','u','a','l','\0', 'e','n','a','b','l','e','D','r','a','g','I','c','o','n','\0', 'E','n','a','b','l','e','D','r','a','g','I','c','o','n','\0', 'e','n','a','b','l','e','U','n','s','e','l','e','c','t','a','b','l','e','D','r','a','g','\0', 'E','n','a','b','l','e','U','n','s','e','l','e','c','t','a','b','l','e','D','r','a','g','\0', 'd','r','a','g','O','v','e','r','A','c','t','i','v','e','M','o','d','e','\0', 'D','r','a','g','O','v','e','r','A','c','t','i','v','e','M','o','d','e','\0', 'i','n','s','t','a','l','l','C','o','l','o','r','m','a','p','\0', 'I','n','s','t','a','l','l','C','o','l','o','r','m','a','p','\0', 'O','w','n','e','r','E','v','e','n','t','s','\0', 'o','w','n','e','r','E','v','e','n','t','s','\0', 'G','r','a','b','S','t','y','l','e','\0', 'g','r','a','b','S','t','y','l','e','\0', 'f','o','r','e','g','r','o','u','n','d','S','t','a','t','e','\0', 'b','a','c','k','g','r','o','u','n','d','S','t','a','t','e','\0', 'G','r','o','u','n','d','S','t','a','t','e','\0', 'G','r','o','u','n','d','S','t','a','t','e','\0', 'S','e','l','e','c','t','C','o','l','o','r','\0', 'L','a','r','g','e','I','c','o','n','P','i','x','m','a','p','\0', 'S','m','a','l','l','I','c','o','n','P','i','x','m','a','p','\0', 'o','u','t','l','i','n','e','S','t','a','t','e','\0', 'O','u','t','l','i','n','e','S','t','a','t','e','\0', 'O','u','t','l','i','n','e','S','t','a','t','e','\0', 's','p','a','t','i','a','l','I','n','c','l','u','d','e','M','o','d','e','l','\0', 'S','p','a','t','i','a','l','I','n','c','l','u','d','e','M','o','d','e','l','\0', 'S','p','a','t','i','a','l','I','n','c','l','u','d','e','M','o','d','e','l','\0', 's','p','a','t','i','a','l','R','e','s','i','z','e','M','o','d','e','l','\0', 'S','p','a','t','i','a','l','R','e','s','i','z','e','M','o','d','e','l','\0', 'S','p','a','t','i','a','l','R','e','s','i','z','e','M','o','d','e','l','\0', 's','p','a','t','i','a','l','S','n','a','p','M','o','d','e','l','\0', 'S','p','a','t','i','a','l','S','n','a','p','M','o','d','e','l','\0', 'S','p','a','t','i','a','l','S','n','a','p','M','o','d','e','l','\0', 'd','e','t','a','i','l','C','o','l','u','m','n','H','e','a','d','i','n','g','C','o','u','n','t','\0', 'D','e','t','a','i','l','C','o','l','u','m','n','H','e','a','d','i','n','g','C','o','u','n','t','\0', 'd','e','t','a','i','l','O','r','d','e','r','\0', 'D','e','t','a','i','l','O','r','d','e','r','\0', 'C','a','r','d','i','n','a','l','L','i','s','t','\0', 'd','e','t','a','i','l','O','r','d','e','r','C','o','u','n','t','\0', 'D','e','t','a','i','l','O','r','d','e','r','C','o','u','n','t','\0', 'o','u','t','l','i','n','e','C','o','l','u','m','n','W','i','d','t','h','\0', 'O','u','t','l','i','n','e','C','o','l','u','m','n','W','i','d','t','h','\0', 'o','u','t','l','i','n','e','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'O','u','t','l','i','n','e','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'o','u','t','l','i','n','e','B','u','t','t','o','n','P','o','l','i','c','y','\0', 'O','u','t','l','i','n','e','B','u','t','t','o','n','P','o','l','i','c','y','\0', 'O','u','t','l','i','n','e','B','u','t','t','o','n','P','o','l','i','c','y','\0', 'D','e','f','a','u','l','t','V','i','r','t','u','a','l','B','i','n','d','i','n','g','s','\0', 'd','e','f','a','u','l','t','V','i','r','t','u','a','l','B','i','n','d','i','n','g','s','\0', 'R','e','s','i','z','a','b','l','e','\0', 'D','y','n','a','m','i','c','P','i','x','m','a','p','\0', 'p','a','g','e','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'a','r','e','a','\0', 'd','e','t','a','i','l','S','h','a','d','o','w','T','h','i','c','k','n','e','s','s','\0', 's','l','i','d','e','r','M','a','r','k','\0', 'S','l','i','d','e','r','M','a','r','k','\0', 'S','l','i','d','e','r','M','a','r','k','\0', 'E','n','a','b','l','e','B','t','n','1','T','r','a','n','s','f','e','r','\0', 'r','e','n','d','i','t','i','o','n','B','a','c','k','g','r','o','u','n','d','\0', 'r','e','n','d','i','t','i','o','n','F','o','r','e','g','r','o','u','n','d','\0', 'R','e','n','d','i','t','i','o','n','B','a','c','k','g','r','o','u','n','d','\0', 'R','e','n','d','i','t','i','o','n','F','o','r','e','g','r','o','u','n','d','\0', 'i','n','d','e','t','e','r','m','i','n','a','t','e','I','n','s','e','n','s','i','t','i','v','e','P','i','x','m','a','p','\0', 'I','n','d','e','t','e','r','m','i','n','a','t','e','I','n','s','e','n','s','i','t','i','v','e','P','i','x','m','a','p','\0', 'f','r','a','m','e','C','h','i','l','d','T','y','p','e','\0', 'F','r','a','m','e','C','h','i','l','d','T','y','p','e','\0', 't','e','x','t','F','i','e','l','d','\0', 'T','e','x','t','F','i','e','l','d','\0', 'e','n','a','b','l','e','T','h','i','n','T','h','i','c','k','n','e','s','s','\0', 'E','n','a','b','l','e','T','h','i','n','T','h','i','c','k','n','e','s','s','\0', 'p','r','i','m','a','r','y','C','o','l','o','r','S','e','t','I','d','\0', 'P','r','i','m','a','r','y','C','o','l','o','r','S','e','t','I','d','\0', 's','e','c','o','n','d','a','r','y','C','o','l','o','r','S','e','t','I','d','\0', 'S','e','c','o','n','d','a','r','y','C','o','l','o','r','S','e','t','I','d','\0', 't','e','x','t','C','o','l','o','r','S','e','t','I','d','\0', 'T','e','x','t','C','o','l','o','r','S','e','t','I','d','\0', 'a','c','t','i','v','e','C','o','l','o','r','S','e','t','I','d','\0', 'A','c','t','i','v','e','C','o','l','o','r','S','e','t','I','d','\0', 'i','n','a','c','t','i','v','e','C','o','l','o','r','S','e','t','I','d','\0', 'I','n','a','c','t','i','v','e','C','o','l','o','r','S','e','t','I','d','\0', 'u','s','e','C','o','l','o','r','O','b','j','\0', 'U','s','e','C','o','l','o','r','O','b','j','\0', 'u','s','e','T','e','x','t','C','o','l','o','r','\0', 'U','s','e','T','e','x','t','C','o','l','o','r','\0', 'u','s','e','T','e','x','t','C','o','l','o','r','F','o','r','L','i','s','t','\0', 'U','s','e','T','e','x','t','C','o','l','o','r','F','o','r','L','i','s','t','\0', 'u','s','e','M','a','s','k','\0', 'U','s','e','M','a','s','k','\0', 'u','s','e','M','u','l','t','i','C','o','l','o','r','I','c','o','n','s','\0', 'U','s','e','M','u','l','t','i','C','o','l','o','r','I','c','o','n','s','\0', 'u','s','e','I','c','o','n','F','i','l','e','C','a','c','h','e','\0', 'U','s','e','I','c','o','n','F','i','l','e','C','a','c','h','e','\0', 'P','i','x','e','l',' ','S','e','t','s','\0', 'C','u','s','t','o','m','i','z','e',' ','D','a','t','a',':','\0', 'C','o','l','o','r','S','e','r','v','e','r','\0', 'l','i','s','t','\0', 'L','i','s','t','\0', 'a','r','r','o','w','O','r','i','e','n','t','a','t','i','o','n','\0', 'A','r','r','o','w','O','r','i','e','n','t','a','t','i','o','n','\0', 'A','r','r','o','w','O','r','i','e','n','t','a','t','i','o','n','\0', 'p','o','s','i','t','i','o','n','T','y','p','e','\0', 'P','o','s','i','t','i','o','n','T','y','p','e','\0', 'P','o','s','i','t','i','o','n','T','y','p','e','\0', 'w','r','a','p','\0', 'W','r','a','p','\0', 'p','o','s','i','t','i','o','n','M','o','d','e','\0', 'P','o','s','i','t','i','o','n','M','o','d','e','\0', 'P','o','s','i','t','i','o','n','M','o','d','e','\0', 'p','r','i','n','t','O','r','i','e','n','t','a','t','i','o','n','\0', 'P','r','i','n','t','O','r','i','e','n','t','a','t','i','o','n','\0', 'p','r','i','n','t','O','r','i','e','n','t','a','t','i','o','n','s','\0', 'P','r','i','n','t','O','r','i','e','n','t','a','t','i','o','n','s','\0', 'p','r','i','n','t','R','e','s','o','l','u','t','i','o','n','\0', 'P','r','i','n','t','R','e','s','o','l','u','t','i','o','n','\0', 'p','r','i','n','t','R','e','s','o','l','u','t','i','o','n','s','\0', 'P','r','i','n','t','R','e','s','o','l','u','t','i','o','n','s','\0', 'd','e','f','a','u','l','t','P','i','x','m','a','p','R','e','s','o','l','u','t','i','o','n','\0', 'D','e','f','a','u','l','t','P','i','x','m','a','p','R','e','s','o','l','u','t','i','o','n','\0', 's','t','a','r','t','J','o','b','C','a','l','l','b','a','c','k','\0', 'e','n','d','J','o','b','C','a','l','l','b','a','c','k','\0', 'p','a','g','e','S','e','t','u','p','C','a','l','l','b','a','c','k','\0', 'p','d','m','N','o','t','i','f','i','c','a','t','i','o','n','C','a','l','l','b','a','c','k','\0', 'm','i','n','X','\0', 'm','i','n','Y','\0', 'm','a','x','X','\0', 'm','a','x','Y','\0', 'M','i','n','X','\0', 'M','i','n','Y','\0', 'M','a','x','X','\0', 'M','a','x','Y','\0', 'p','r','e','e','d','i','t','S','t','a','r','t','C','a','l','l','b','a','c','k','\0', 'p','r','e','e','d','i','t','D','o','n','e','C','a','l','l','b','a','c','k','\0', 'p','r','e','e','d','i','t','D','r','a','w','C','a','l','l','b','a','c','k','\0', 'p','r','e','e','d','i','t','C','a','r','e','t','C','a','l','l','b','a','c','k','\0', 'v','e','r','i','f','y','P','r','e','e','d','i','t','\0', 'V','e','r','i','f','y','P','r','e','e','d','i','t','\0', 'e','n','a','b','l','e','M','u','l','t','i','K','e','y','B','i','n','d','i','n','g','s','\0', 'E','n','a','b','l','e','M','u','l','t','i','K','e','y','B','i','n','d','i','n','g','s','\0', 'B','u','t','t','o','n','F','o','n','t','L','i','s','t','\0', 'L','a','b','e','l','F','o','n','t','L','i','s','t','\0', 'T','e','x','t','F','o','n','t','L','i','s','t','\0', 'S','D','T',' ','P','i','x','e','l',' ','S','e','t','\0', '5','0','_','f','o','r','e','g','r','o','u','n','d','\0', 'u','n','s','p','e','c','i','f','i','e','d','_','p','i','x','m','a','p','\0' }; externaldef(_xmstrings) _XmConst char _XmStrings22[] = { 'i','t','e','m','F','o','u','n','d','C','a','l','l','b','a','c','k','\0', 'i','t','e','m','N','o','t','F','o','u','n','d','C','a','l','l','b','a','c','k','\0', 'X','m','T','a','b','S','i','d','e','\0', 'T','a','b','S','i','d','e','\0', 'X','m','P','i','x','m','a','p','P','l','a','c','e','m','e','n','t','\0', 'X','m','P','i','x','m','a','p','\0', 'X','m','P','i','x','e','l','\0', 'X','m','I','c','o','n','P','l','a','c','e','m','e','n','t','\0', 'X','m','H','i','e','r','a','r','c','h','y','N','o','d','e','S','t','a','t','e','\0', 'X','m','F','i','l','l','O','p','t','i','o','n','\0', 'X','m','C','o','n','n','e','c','t','S','t','y','l','e','\0', 'X','m','C','o','l','o','r','M','o','d','e','\0', 'X','m','A','l','i','g','n','m','e','n','t','\0', 'T','a','b','S','t','y','l','e','\0', 'T','a','b','O','r','i','e','n','t','a','t','i','o','n','\0', 'T','a','b','M','o','d','e','\0', 'T','a','b','L','i','s','t','\0', 'T','a','b','E','d','g','e','\0', 'T','a','b','A','r','r','o','w','P','l','a','c','e','m','e','n','t','\0', 'x','l','f','d','S','t','r','i','n','g','\0', 'v','e','r','t','i','c','a','l','N','o','d','e','S','p','a','c','e','\0', 'v','e','r','t','i','c','a','l','M','a','r','g','i','n','\0', 'v','e','r','i','f','y','T','e','x','t','F','a','i','l','e','d','C','a','l','l','b','a','c','k','\0', 'v','e','r','i','f','y','T','e','x','t','C','a','l','l','b','a','c','k','\0', 'v','e','r','i','f','y','\0', 'v','a','l','u','e','s','\0', 'u','s','e','T','e','x','t','F','i','e','l','d','\0', 'u','s','e','S','c','a','l','i','n','g','\0', 'u','s','e','I','m','a','g','e','C','a','c','h','e','\0', 'u','p','d','a','t','e','T','e','x','t','C','a','l','l','b','a','c','k','\0', 'u','p','d','a','t','e','S','h','e','l','l','C','a','l','l','b','a','c','k','\0', 'u','n','s','e','l','e','c','t','C','a','l','l','b','a','c','k','\0', 'u','n','i','f','o','r','m','T','a','b','S','i','z','e','\0', 't','r','a','v','e','r','s','a','l','I','n','d','e','x','\0', 't','i','t','l','e','S','t','r','i','n','g','\0', 't','e','x','t','S','t','r','i','n','g','\0', 't','e','x','t','R','o','w','s','\0', 't','e','a','r','O','f','f','L','a','b','e','l','S','t','r','i','n','g','\0', 't','a','b','T','e','a','r','O','f','f','E','n','a','b','l','e','d','\0', 't','a','b','S','t','y','l','e','\0', 't','a','b','S','t','r','i','n','g','D','i','r','e','c','t','i','o','n','\0', 't','a','b','S','i','d','e','\0', 't','a','b','S','e','l','e','c','t','e','d','C','a','l','l','b','a','c','k','\0', 't','a','b','S','e','l','e','c','t','P','i','x','m','a','p','\0', 't','a','b','S','e','l','e','c','t','C','o','l','o','r','\0', 't','a','b','P','i','x','m','a','p','P','l','a','c','e','m','e','n','t','\0', 't','a','b','O','r','i','e','n','t','a','t','i','o','n','\0', 't','a','b','O','f','f','s','e','t','\0', 't','a','b','M','o','d','e','\0', 't','a','b','M','a','r','g','i','n','W','i','d','t','h','\0', 't','a','b','M','a','r','g','i','n','H','e','i','g','h','t','\0', 't','a','b','L','i','s','t','\0', 't','a','b','L','a','b','e','l','S','t','r','i','n','g','\0', 't','a','b','L','a','b','e','l','S','p','a','c','i','n','g','\0', 't','a','b','L','a','b','e','l','P','i','x','m','a','p','\0', 't','a','b','F','o','r','e','g','r','o','u','n','d','\0', 't','a','b','E','d','g','e','\0', 't','a','b','C','o','r','n','e','r','P','e','r','c','e','n','t','\0', 't','a','b','B','o','x','W','i','d','g','e','t','\0', 't','a','b','B','a','c','k','g','r','o','u','n','d','P','i','x','m','a','p','\0', 't','a','b','B','a','c','k','g','r','o','u','n','d','\0', 't','a','b','A','u','t','o','S','e','l','e','c','t','\0', 't','a','b','A','r','r','o','w','P','l','a','c','e','m','e','n','t','\0', 't','a','b','A','l','i','g','n','m','e','n','t','\0', 's','t','a','c','k','e','d','E','f','f','e','c','t','\0', 's','o','r','t','F','u','n','c','t','i','o','n','s','\0', 's','l','i','d','e','r','T','o','g','L','a','b','e','l','\0', 's','i','z','e','S','t','r','i','n','g','\0', 's','h','o','w','V','a','l','u','e','\0', 's','h','o','w','S','a','s','h','\0', 's','h','o','w','N','a','m','e','S','t','r','i','n','g','\0', 's','h','o','w','L','a','b','e','l','\0', 's','h','o','w','F','o','n','t','N','a','m','e','\0', 's','h','o','w','F','i','n','d','\0', 's','e','l','e','c','t','e','d','I','n','d','e','x','\0', 's','e','l','e','c','t','e','d','C','o','l','u','m','n','\0', 's','e','l','e','c','t','C','a','l','l','b','a','c','k','\0', 's','c','a','l','i','n','g','S','t','r','i','n','g','\0', 's','a','s','h','T','r','a','n','s','l','a','t','i','o','n','s','\0', 's','a','m','p','l','e','T','e','x','t','\0', 'r','g','b','F','i','l','e','\0', 'r','e','s','i','z','e','T','o','P','r','e','f','e','r','r','e','d','\0', 'r','e','s','i','z','e','C','a','l','l','b','a','c','k','\0', 'r','e','d','S','l','i','d','e','r','L','a','b','e','l','\0', 'p','r','o','p','S','p','a','c','e','S','t','r','i','n','g','\0', 'p','r','e','f','e','r','r','e','d','P','a','n','e','S','i','z','e','\0', 'p','o','s','i','t','i','o','n','\0', 'p','o','p','u','p','S','h','e','l','l','W','i','d','g','e','t','\0', 'p','o','p','u','p','O','f','f','s','e','t','\0', 'p','o','p','u','p','C','u','r','s','o','r','\0', 'p','i','x','m','a','p','W','i','d','t','h','\0', 'p','i','x','m','a','p','H','e','i','g','h','t','\0', 'p','a','r','e','n','t','N','o','d','e','\0', 'o','t','h','e','r','S','t','r','i','n','g','\0', 'o','p','t','i','o','n','S','t','r','i','n','g','\0', 'o','p','e','n','F','o','l','d','e','r','P','i','x','m','a','p','\0', 'o','p','e','n','C','l','o','s','e','P','a','d','d','i','n','g','\0', 'n','u','m','V','a','l','u','e','s','\0', 'n','u','m','S','t','a','c','k','s','\0', 'n','u','m','R','o','w','s','\0', 'n','o','d','e','S','t','a','t','e','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'n','o','d','e','S','t','a','t','e','C','a','l','l','b','a','c','k','\0', 'n','o','d','e','S','t','a','t','e','B','e','g','E','n','d','C','a','l','l','b','a','c','k','\0', 'n','o','d','e','S','t','a','t','e','\0', 'n','o','C','e','l','l','E','r','r','o','r','\0', 'm','o','n','o','S','p','a','c','e','S','t','r','i','n','g','\0', 'm','i','n','i','m','u','m','V','e','r','t','i','c','a','l','C','e','l','l','s','\0', 'm','i','n','i','m','u','m','H','o','r','i','z','o','n','t','a','l','C','e','l','l','s','\0', 'm','i','n','i','m','u','m','C','e','l','l','W','i','d','t','h','\0', 'm','i','n','i','m','u','m','C','e','l','l','H','e','i','g','h','t','\0', 'm','a','r','g','i','n','\0', 'l','i','s','t','\0', 'l','i','n','e','W','i','d','t','h','\0', 'l','i','n','e','C','o','l','o','r','\0', 'l','a','b','e','l','\0', 'i','t','a','l','i','c','S','t','r','i','n','g','\0', 'i','n','s','e','r','t','B','e','f','o','r','e','\0', 'i','n','d','e','n','t','S','p','a','c','e','\0', 'i','c','o','n','T','e','x','t','P','a','d','d','i','n','g','\0', 'i','c','o','n','P','l','a','c','e','m','e','n','t','\0', 'h','o','r','i','z','o','n','t','a','l','N','o','d','e','S','p','a','c','e','\0', 'h','o','r','i','z','o','n','t','a','l','M','a','r','g','i','n','\0', 'g','r','e','e','n','S','l','i','d','e','r','L','a','b','e','l','\0', 'f','r','e','e','T','a','b','P','i','x','m','a','p','\0', 'f','i','r','s','t','R','o','w','\0', 'f','i','r','s','t','C','o','l','u','m','n','P','i','x','m','a','p','s','\0', 'f','i','r','s','t','C','o','l','u','m','n','\0', 'f','i','n','d','L','a','b','e','l','\0', 'f','i','l','l','O','p','t','i','o','n','\0', 'f','i','l','e','R','e','a','d','E','r','r','o','r','\0', 'f','a','m','i','l','y','S','t','r','i','n','g','\0', 'e','q','u','a','l','S','i','z','e','\0', 'e','n','t','r','y','L','a','b','e','l','S','t','r','i','n','g','\0', 'e','n','t','r','y','D','a','t','a','\0', 'e','n','c','o','d','i','n','g','S','t','r','i','n','g','\0', 'e','n','c','o','d','i','n','g','L','i','s','t','\0', 'd','o','u','b','l','e','C','l','i','c','k','C','a','l','l','b','a','c','k','\0', 'd','e','f','a','u','l','t','E','n','c','o','d','i','n','g','S','t','r','i','n','g','\0', 'd','F','i','e','l','d','P','r','e','f','W','i','d','t','h','\0', 'd','F','i','e','l','d','P','r','e','f','H','e','i','g','h','t','\0', 'd','F','i','e','l','d','M','i','n','W','i','d','t','h','\0', 'd','F','i','e','l','d','M','i','n','H','e','i','g','h','t','\0', 'd','F','i','e','l','d','M','a','x','W','i','d','t','h','\0', 'd','F','i','e','l','d','M','a','x','H','e','i','g','h','t','\0', 'c','u','s','t','o','m','i','z','e','d','C','o','m','b','i','n','a','t','i','o','n','B','o','x','\0', 'c','u','r','s','o','r','\0', 'c','u','r','r','e','n','t','F','o','n','t','\0', 'c','o','n','n','e','c','t','S','t','y','l','e','\0', 'c','o','m','b','o','T','r','a','n','s','l','a','t','i','o','n','s','\0', 'c','o','l','u','m','n','T','i','t','l','e','s','\0', 'c','o','l','o','r','N','a','m','e','\0', 'c','o','l','o','r','M','o','d','e','\0', 'c','o','l','o','r','L','i','s','t','T','o','g','L','a','b','e','l','\0', 'c','e','l','l','Y','\0', 'c','e','l','l','X','\0', 'b','o','t','h','S','t','r','i','n','g','\0', 'b','o','l','d','S','t','r','i','n','g','\0', 'b','l','u','e','S','l','i','d','e','r','L','a','b','e','l','\0', 'D','i','s','t','r','i','b','u','t','i','o','n','\0', 'F','i','l','l','S','t','y','l','e','\0', 'I','t','e','m','S','p','a','c','i','n','g','\0', 'L','a','b','e','l','S','p','a','c','i','n','g','\0', 'S','h','o','w','L','a','b','e','l','\0', 'S','t','r','e','t','c','h','a','b','l','e','\0', 'd','e','f','a','u','l','t','E','n','t','r','y','L','a','b','e','l','A','l','i','g','n','m','e','n','t','\0', 'd','e','f','a','u','l','t','E','n','t','r','y','L','a','b','e','l','F','o','n','t','L','i','s','t','\0', 'd','e','f','a','u','l','t','F','i','l','l','S','t','y','l','e','\0', 'd','i','s','t','r','i','b','u','t','i','o','n','\0', 'e','n','t','r','y','L','a','b','e','l','A','l','i','g','n','m','e','n','t','\0', 'e','n','t','r','y','L','a','b','e','l','F','o','n','t','L','i','s','t','\0', 'e','n','t','r','y','L','a','b','e','l','P','i','x','m','a','p','\0', 'e','n','t','r','y','L','a','b','e','l','T','y','p','e','\0', 'f','i','l','l','S','t','y','l','e','\0', 'i','t','e','m','S','p','a','c','i','n','g','\0', 'l','a','b','e','l','S','p','a','c','i','n','g','\0', 's','h','o','w','E','n','t','r','y','L','a','b','e','l','\0', 's','t','r','e','t','c','h','a','b','l','e','\0', 'D','i','s','t','r','i','b','u','t','i','o','n','\0', 'F','i','l','l','S','t','y','l','e','\0', 'E','q','u','a','l','S','i','z','e','\0', 'F','i','l','l','O','p','t','i','o','n','\0', 'C','o','l','o','r','M','o','d','e','\0', 'F','i','l','e','R','e','a','d','E','r','r','o','r','\0', 'N','o','C','e','l','l','E','r','r','o','r','\0', 'S','l','i','d','e','r','L','a','b','e','l','\0', 'T','o','g','L','a','b','e','l','\0', 'A','u','t','o','F','i','l','l','\0', 'P','i','c','t','u','r','e','\0', 'a','u','t','o','F','i','l','l','\0', 'p','i','c','t','u','r','e','\0', 'p','i','c','t','u','r','e','E','r','r','o','r','C','a','l','l','b','a','c','k','\0', 'v','a','l','i','d','a','t','e','C','a','l','l','b','a','c','k','\0', 'F','i','n','d','L','a','b','e','l','\0', 'S','h','o','w','F','i','n','d','\0', 'e','n','t','r','y','B','a','c','k','g','r','o','u','n','d','\0', 'C','o','l','u','m','n','T','i','t','l','e','s','\0', 'E','n','t','r','y','D','a','t','a','\0', 'F','i','r','s','t','C','o','l','u','m','n','P','i','x','m','a','p','s','\0', 'F','i','r','s','t','L','o','c','a','t','i','o','n','\0', 'N','e','w','V','i','s','u','a','l','S','t','y','l','e','\0', 'N','u','m','R','o','w','s','\0', 'S','c','r','o','l','l','B','a','r','\0', 'S','e','l','e','c','t','e','d','C','o','l','u','m','n','\0', 'n','e','w','V','i','s','u','a','l','S','t','y','l','e','\0', 'P','r','e','f','e','r','r','e','d','P','a','n','e','S','i','z','e','\0', 'S','h','o','w','S','a','s','h','\0', '1','0','0','D','P','I','S','t','r','i','n','g','\0', '7','5','D','P','I','S','t','r','i','n','g','\0', 'A','n','y','L','o','w','e','r','S','t','r','i','n','g','\0', 'A','n','y','S','t','r','i','n','g','\0', 'B','o','l','d','S','t','r','i','n','g','\0', 'B','o','t','h','S','t','r','i','n','g','\0', 'D','e','f','a','u','l','t','E','n','c','o','d','i','n','g','S','t','r','i','n','g','\0', 'E','n','c','o','d','i','n','g','L','i','s','t','\0', 'E','n','c','o','d','i','n','g','S','t','r','i','n','g','\0', 'F','a','m','i','l','y','S','t','r','i','n','g','\0', 'I','t','a','l','i','c','S','t','r','i','n','g','\0', 'M','o','n','o','S','p','a','c','e','S','t','r','i','n','g','\0', 'O','p','t','i','o','n','S','t','r','i','n','g','\0', 'O','t','h','e','r','S','t','r','i','n','g','\0', 'P','r','o','p','S','p','a','c','e','S','t','r','i','n','g','\0', 'S','a','m','p','l','e','T','e','x','t','\0', 'S','c','a','l','i','n','g','S','t','r','i','n','g','\0', 'S','h','o','w','N','a','m','e','S','t','r','i','n','g','\0', 'S','i','z','e','S','t','r','i','n','g','\0', 'T','e','x','t','R','o','w','s','\0', 'X','l','f','d','S','p','a','c','e','S','t','r','i','n','g','\0', '1','0','0','D','P','I','s','t','r','i','n','g','\0', '7','5','D','P','I','s','t','r','i','n','g','\0', 'a','n','y','L','o','w','e','r','S','t','r','i','n','g','\0', 'a','n','y','S','t','r','i','n','g','\0', 'C','e','l','l','X','\0', 'C','e','l','l','Y','\0', 'D','e','f','a','u','l','t','C','e','l','l','s','\0', 'M','i','n','i','m','u','m','C','e','l','l','S','i','z','e','\0', 'I','c','o','n','P','l','a','c','e','m','e','n','t','\0', 'p','i','x','m','a','p','D','e','p','t','h','\0', 'A','u','t','o','C','l','o','s','e','\0', 'I','n','s','e','r','t','B','e','f','o','r','e','\0', 'N','o','d','e','S','t','a','t','e','\0', 'N','o','d','e','S','t','a','t','e','C','a','l','l','b','a','c','k','\0', 'N','o','d','e','S','t','a','t','e','C','h','a','n','g','e','d','C','a','l','l','b','a','c','k','\0', 'P','a','r','e','n','t','N','o','d','e','\0', 'a','u','t','o','C','l','o','s','e','\0', 'c','l','o','s','e','F','o','l','d','e','r','P','i','x','m','a','p','\0', 'n','o','d','e','C','l','o','s','e','F','o','l','d','e','r','P','i','x','m','a','p','\0', 'n','o','d','e','O','p','e','n','F','o','l','d','e','r','P','i','x','m','a','p','\0', 'n','o','d','e','S','t','a','t','e','B','e','g','i','n','E','n','d','C','a','l','l','b','a','c','k','\0', 'C','o','n','s','t','r','a','i','n','W','i','d','t','h','\0', 'I','n','d','e','n','t','S','p','a','c','e','\0', 'c','o','n','n','e','c','t','N','o','d','e','s','\0', 'c','o','n','s','t','r','a','i','n','W','i','d','t','h','\0', 'N','u','m','S','t','a','c','k','s','\0', 'S','e','l','e','c','t','e','d','I','n','d','e','x','\0', 'S','t','a','c','k','e','d','E','f','f','e','c','t','\0', 'T','a','b','A','u','t','o','S','e','l','e','c','t','\0', 'T','a','b','C','o','r','n','e','r','P','e','r','c','e','n','t','\0', 'T','a','b','E','d','g','e','\0', 'T','a','b','L','a','b','e','l','S','p','a','c','i','n','g','\0', 'T','a','b','M','o','d','e','\0', 'T','a','b','O','f','f','s','e','t','\0', 'T','a','b','O','r','i','e','n','t','a','t','i','o','n','\0', 'T','a','b','S','e','l','e','c','t','C','o','l','o','r','\0', 'T','a','b','S','e','l','e','c','t','P','i','x','m','a','p','\0', 'T','a','b','S','t','y','l','e','\0', 'T','r','a','v','e','r','s','a','l','I','n','d','e','x','\0', 'U','n','i','f','o','r','m','T','a','b','S','i','z','e','\0', 'U','s','e','I','m','a','g','e','C','a','c','h','e','\0', 'F','r','e','e','T','a','b','P','i','x','m','a','p','\0', 'I','C','S','E','n','h','a','n','c','e','m','e','n','t','P','a','k','R','e','s','o','u','r','c','e','E','r','r','o','r','\0', 'T','a','b','L','a','b','e','l','P','i','x','m','a','p','\0', 'T','a','b','L','a','b','e','l','S','t','r','i','n','g','\0', 'T','a','b','P','i','x','m','a','p','P','l','a','c','e','m','e','n','t','\0', 'T','a','b','S','i','d','e','\0', 'i','l','l','e','g','a','l','R','e','s','o','u','r','c','e','V','a','l','u','e','\0', 'C','o','m','p','r','e','s','s','S','t','y','l','e','\0', 'C','o','n','n','e','c','t','S','t','y','l','e','\0', 'H','o','r','i','z','o','n','t','a','l','D','e','l','t','a','\0', 'L','i','n','e','W','i','d','t','h','\0', 'O','p','e','n','C','l','o','s','e','P','a','d','d','i','n','g','\0', 'V','e','r','t','i','c','a','l','D','e','l','t','a','\0', 'c','o','m','p','r','e','s','s','S','t','y','l','e','\0', 'h','o','r','i','z','o','n','t','a','l','D','e','l','t','a','\0', 'l','i','n','e','B','a','c','k','g','r','o','u','n','d','C','o','l','o','r','\0', 'l','i','n','e','S','t','y','l','e','\0', 'v','e','r','t','i','c','a','l','D','e','l','t','a','\0', 'X','m','C','o','m','p','r','e','s','s','S','t','y','l','e','\0', 'X','m','L','i','n','e','S','t','y','l','e','\0', 'P','o','p','u','p','O','f','f','s','e','t','\0', 'U','s','e','T','e','x','t','F','i','e','l','d','\0', 'V','e','r','i','f','y','\0' }; externaldef(_xmstrings) _XmConst char _XmStrings23[] = { 'd','e','f','a','u','l','t','E','n','t','r','y','L','a','b','e','l','R','e','n','d','e','r','T','a','b','l','e','\0', 'e','n','t','r','y','L','a','b','e','l','R','e','n','d','e','r','T','a','b','l','e','\0', 'p','i','x','m','a','p','P','l','a','c','e','m','e','n','t','\0', 'P','i','x','m','a','p','P','l','a','c','e','m','e','n','t','\0', 'P','i','x','m','a','p','P','l','a','c','e','m','e','n','t','\0', 'p','i','x','m','a','p','T','e','x','t','P','a','d','d','i','n','g','\0', 'f','o','n','t','S','t','y','l','e','\0', 'F','o','n','t','S','t','y','l','e','\0', 'f','o','n','t','S','i','z','e','\0', 'F','o','n','t','S','i','z','e','\0', 'f','o','n','t','F','o','u','n','d','r','y','\0', 'F','o','n','t','F','o','u','n','d','r','y','\0', 'f','o','n','t','E','n','c','o','d','i','n','g','\0', 'F','o','n','t','E','n','c','o','d','i','n','g','\0', 'x','f','t','F','o','n','t','\0', 'X','f','t','F','o','n','t','\0', 'U','T','F','8','_','S','T','R','I','N','G','\0' }; externaldef(_xmstrings) _XmConst char _XmStringsI[] = { 'A','T','O','M','_','P','A','I','R','\0', 'A','V','E','R','A','G','E','_','W','I','D','T','H','\0', 'B','A','C','K','G','R','O','U','N','D','\0', 'C','H','A','R','A','C','T','E','R','_','P','O','S','I','T','I','O','N','\0', 'C','L','A','S','S','\0', 'C','O','L','U','M','N','_','N','U','M','B','E','R','\0', 'D','O','N','E','\0', 'F','O','R','E','G','R','O','U','N','D','\0', 'H','O','S','T','_','N','A','M','E','\0', 'L','I','N','E','_','N','U','M','B','E','R','\0', 'L','I','S','T','_','L','E','N','G','T','H','\0', 'M','O','D','U','L','E','\0', 'N','A','M','E','\0', 'N','o','n','e','\0', 'O','D','I','F','\0', 'O','W','N','E','R','_','O','S','\0', 'P','D','M','_','E','X','I','T','_','C','A','N','C','E','L','\0', 'P','D','M','_','E','X','I','T','_','E','R','R','O','R','\0', 'P','D','M','_','E','X','I','T','_','O','K','\0', 'P','D','M','_','R','E','P','L','Y','\0', 'P','D','M','_','S','T','A','R','T','\0', 'P','D','M','_','S','T','A','R','T','_','E','R','R','O','R','\0', 'P','D','M','_','S','T','A','R','T','_','O','K','\0', 'P','D','M','_','S','T','A','R','T','_','P','X','A','U','T','H','\0', 'P','D','M','_','S','T','A','R','T','_','V','X','A','U','T','H','\0', 'P','I','X','E','L','\0', 'P','I','X','E','L','_','S','I','Z','E','\0', 'P','R','O','C','E','D','U','R','E','\0', 'P','R','O','C','E','S','S','\0', 'R','E','S','O','L','U','T','I','O','N','_','Y','\0', 'S','P','A','N','\0', 'T','A','S','K','\0', 'U','S','E','R','\0', 'W','M','_','D','E','L','E','T','E','_','W','I','N','D','O','W','\0', '_','M','O','T','I','F','_','C','U','R','R','E','N','T','_','T','I','M','E','\0', '_','M','O','T','I','F','_','D','R','A','G','_','A','T','O','M','S','\0', '_','M','O','T','I','F','_','D','R','A','G','_','I','N','I','T','I','A','T','O','R','_','I','N','F','O','\0', '_','M','O','T','I','F','_','D','R','A','G','_','P','R','O','X','Y','_','W','I','N','D','O','W','\0', '_','M','O','T','I','F','_','D','R','A','G','_','R','E','C','E','I','V','E','R','_','I','N','F','O','\0', '_','M','O','T','I','F','_','D','R','A','G','_','T','A','R','G','E','T','S','\0', '_','M','O','T','I','F','_','D','R','A','G','_','W','I','N','D','O','W','\0', '_','M','O','T','I','F','_','I','N','I','T','I','A','T','O','R','\0', '_','M','O','T','I','F','_','R','E','C','E','I','V','E','R','\0', '_','M','O','T','I','F','_','S','E','L','E','C','T','I','O','N','_','T','E','X','T','\0' }; motif-2.3.8/lib/Xm/TextIn.c0000644000175000017500000051277713145162623012322 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TextIn.c /main/36 1999/01/27 16:10:29 mgreess $" #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "XmI.h" #include "BaseClassI.h" #include "DestI.h" #include "DisplayI.h" #include "MessagesI.h" #include "PrimitiveI.h" #include "RepTypeI.h" #include "TextI.h" #include "TextInI.h" #include "TextOutI.h" #include "TextStrSoI.h" #include "TravActI.h" #include "TraversalI.h" #ifdef USE_XFT #include #endif #define MSG1 _XmMMsgTextIn_0000 #define GRABKBDERROR _XmMMsgRowColText_0024 /* For actions whose parameters are processed by reptype */ #define _RIGHT 0 #define _LEFT 1 #define _UP 0 #define _DOWN 1 #define TEXT_MAX_INSERT_SIZE 512 #define EraseInsertionPoint(tw)\ (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off) #define DisplayInsertionPoint(tw)\ (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on) typedef struct { Boolean has_destination; XmTextPosition position; long replace_length; Boolean quick_key; XmTextWidget widget; } TextDestDataRec, *TextDestData; /******** Static Function Declarations ********/ static TextDestData GetTextDestData(Widget tw); /* static void CheckSync(Widget, XtPointer, XEvent *, Boolean *); */ static void RingBell(Widget w, XEvent *event, String *params, Cardinal *num_params); static Boolean DeleteOrKill(XmTextWidget tw, XEvent *event, XmTextPosition from, XmTextPosition to, #if NeedWidePrototypes int kill, #else Boolean kill, #endif /* NeedWidePrototypes */ XmTextPosition *cursorPos); static void StuffFromBuffer(XmTextWidget tw, XEvent *event, int buffer); static void UnKill(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RemoveCurrentSelection(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill); #else Boolean kill); #endif /* NeedWidePrototypes */ static void DeleteCurrentSelection(Widget w, XEvent *event, String *params, Cardinal *num_params); static void KillCurrentSelection(Widget w, XEvent *event, String *params, Cardinal *num_params); static void CheckDisjointSelection(Widget w, XmTextPosition position, Time sel_time); static void SelfInsert(Widget w, XEvent *event, String *params, Cardinal *num_params); static void InsertString(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessVerticalParams(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessHorizontalParams(Widget w, XEvent *event, String *params, Cardinal *num_params, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position); static void ProcessSelectParams(Widget w, XEvent *event, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position); static XmTextPosition SelectOutLine(XmTextWidget tw, XmTextPosition position, XmTextScanDirection dir, int count); static void KeySelection(Widget w, XEvent *event, String *params, Cardinal *num_params); static void SetAnchorBalancing(XmTextWidget tw, XmTextPosition position); static void SetNavigationAnchor(XmTextWidget tw, XmTextPosition old_position, XmTextPosition new_position, Time time, #if NeedWidePrototypes int extend); #else Boolean extend); #endif /* NeedWidePrototypes */ static void CompleteNavigation(XmTextWidget tw, XmTextPosition position, Time time, #if NeedWidePrototypes int extend); #else Boolean extend); #endif /* NeedWidePrototypes */ static void SimpleMovement(Widget w, XEvent *event, String *params, Cardinal *num_params, XmTextScanDirection dir, XmTextScanType type, #if NeedWidePrototypes int include); #else Boolean include); #endif /* NeedWidePrototypes */ static void MoveForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveForwardParagraph(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveBackwardParagraph(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveToLineStart(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveToLineEnd(Widget w, XEvent *event, String *params, Cardinal *num_params); static void _MoveNextLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int pendingoff); #else Boolean pendingoff); #endif /* NeedWidePrototypes */ static void MoveNextLine(Widget w, XEvent *event, String *params, Cardinal *num_params); static void _MovePreviousLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int pendingoff); #else Boolean pendingoff); #endif /* NeedWidePrototypes */ static void MovePreviousLine(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveNextPage(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MovePreviousPage(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MovePageLeft(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MovePageRight(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MovePageUp(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MovePageDown(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveBeginningOfFile(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveEndOfFile(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ScrollOneLineUp(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ScrollOneLineDown(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ScrollCursorVertically(Widget w, XEvent *event, String *params, Cardinal *num_params); static void AddNewLine(Widget w, XEvent *event, #if NeedWidePrototypes int move_cursor); #else Boolean move_cursor); #endif /* NeedWidePrototypes */ static void InsertNewLine(Widget w, XEvent *event, String *params, Cardinal *num_params); static void InsertNewLineAndBackup(Widget w, XEvent *event, String *params, Cardinal *num_params); static void InsertNewLineAndIndent(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RedrawDisplay(Widget w, XEvent *event, String *params, Cardinal *num_params); static void Activate(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ToggleOverstrike(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ToggleAddMode(Widget w, XEvent *event, String *params, Cardinal *num_params); static void SetCursorPosition(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RemoveBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill); #else Boolean kill); #endif /* NeedWidePrototypes */ static void DeleteBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params); static void KillBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RemoveForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill); #else Boolean kill); #endif /* NeedWidePrototypes */ static void DeleteForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params); static void KillForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RemoveBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill); #else Boolean kill); #endif /* NeedWidePrototypes */ static void DeleteBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params); static void KillBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RemoveForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill); #else Boolean kill); #endif /* NeedWidePrototypes */ static void KillForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params); static void DeleteForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RemoveToEndOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill); #else Boolean kill); #endif /* NeedWidePrototypes */ static void RemoveToStartOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill); #else Boolean kill); #endif /* NeedWidePrototypes */ static void DeleteToStartOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params); static void KillToStartOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params); static void DeleteToEndOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params); static void KillToEndOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params); static void RestorePrimaryHighlight(InputData data, XmTextPosition prim_left, XmTextPosition prim_right); static void SetSelectionHint(Widget w, XEvent *event, String *params, Cardinal *num_params); static void a_Selection(XmTextWidget tw, #if NeedWidePrototypes int x, int y, #else Position x, Position y, #endif /* NeedWidePrototypes */ Time sel_time, int set_empty_selection); static void SetAnchor(Widget w, XEvent *event, String *params, Cardinal *num_params); static void DoSelection(Widget w, XEvent *event, String *params, Cardinal *num_params); static void SetScanType(Widget w, InputData data, XEvent *event); static void StartPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params); static void StartSecondary(Widget w, XEvent *event, String *params, Cardinal *num_params); static void StartDrag(Widget w, XEvent *event, String *params, Cardinal *num_params); static void DragStart(XtPointer data, XtIntervalId *id); static void ProcessBDrag(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessBDragEvent(Widget w, XEvent *event, char **params, Cardinal *num_params); static Boolean InSelection(Widget w, XEvent *event); static void ProcessBSelect(Widget w, XEvent *event, char **params, Cardinal *num_params); static void ProcessBSelectEvent(Widget w, XEvent *event, char **params, Cardinal *num_params); static Boolean dragged(SelectionHint selectionHint, XEvent *event, int threshold); static void DoExtendedSelection(Widget w, Time ev_time); static void DoSecondaryExtend(Widget w, Time ev_time); static void BrowseScroll(XtPointer closure, XtIntervalId *id); static Boolean CheckTimerScrolling(Widget w, XEvent *event); static void StartExtendSelection(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExtendSelection(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExtendSecondary(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExtendEnd(Widget w, XEvent *event, String *params, Cardinal *num_params); static void DoGrabFocus(Widget w, XEvent *event, String *params, Cardinal *num_params); static void MoveDestination(Widget w, XEvent *event, String *params, Cardinal *num_params); static void Stuff(Widget w, XEvent *event, String *params, Cardinal *num_params); static void SecondaryNotify(Widget w, XEvent *event, String *params, Cardinal *num_params); static void VoidAction(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExtendSecondaryEnd(Widget w, XEvent *event, String *params, Cardinal *num_params); static void SelectAll(Widget w, XEvent *event, String *params, Cardinal *num_params); static void DeselectAll(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ClearSelection(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessBDragRelease(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessCopy(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessLink(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessMove(Widget w, XEvent *event, String *params, Cardinal *num_params); static void CopyPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params); static void CutPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params); static void LinkPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params); static void CutClipboard(Widget w, XEvent *event, String *params, Cardinal *num_params); static void CopyClipboard(Widget w, XEvent *event, String *params, Cardinal *num_params); static void PasteClipboard(Widget w, XEvent *event, String *params, Cardinal *num_params); static Boolean VerifyLeave(Widget w, XEvent *event); static void TextLeave(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TextFocusIn(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TextFocusOut(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TraverseDown(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TraverseUp(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TraverseHome(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TraverseNextTabGroup(Widget w, XEvent *event, String *params, Cardinal *num_params); static void TraversePrevTabGroup(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessCancel(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessReturn(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessTab(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessUp(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessDown(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessShiftUp(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessShiftDown(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessLeft(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessRight(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessShiftLeft(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessShiftRight(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ProcessHome(Widget w, XEvent *event, String *params, Cardinal *num_params); static void Invalidate(XmTextWidget tw, XmTextPosition position, XmTextPosition topos, long delta); static void InputGetValues(Widget wid, ArgList args, Cardinal num_args); static void InputSetValues(Widget oldw, Widget reqw, Widget new_w, ArgList args, Cardinal *num_args); static void InputDestroy(Widget w); static XtPointer InputBaseProc(Widget widget, XtPointer client_data); static void DragProcCallback(Widget w, XtPointer client, XtPointer call); static void RegisterDropSite(Widget w); static XmTextPosition XtoPosInLine(XmTextWidget tw, #if NeedWidePrototypes int x, #else Position x, #endif /* NeedWidePrototypes */ LineNum line); static XmTextPosition YtoPosInLine(XmTextWidget tw, #if NeedWidePrototypes int y, #else Position y, #endif /* NeedWidePrototypes */ LineNum line); /******** End Static Function Declarations ********/ static XContext _XmTextDestContext = 0; static XmConst XmTextScanType sarray[] = { XmSELECT_POSITION, XmSELECT_WORD, XmSELECT_LINE, XmSELECT_ALL }; static XtResource input_resources[] = { { XmNselectionArray, XmCSelectionArray, XmRPointer, sizeof(XtPointer), XtOffsetOf(struct _InputDataRec, sarray), XmRImmediate, (XtPointer) sarray }, { XmNselectionArrayCount, XmCSelectionArrayCount, XmRInt, sizeof(int), XtOffsetOf(struct _InputDataRec, sarraycount), XmRImmediate, (XtPointer) XtNumber(sarray) }, { XmNpendingDelete, XmCPendingDelete, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _InputDataRec, pendingdelete), XmRImmediate, (XtPointer) True }, { XmNselectThreshold, XmCSelectThreshold, XmRInt, sizeof(int), XtOffsetOf(struct _InputDataRec, threshold), XmRImmediate, (XtPointer) 5 }, }; static TextDestData GetTextDestData(Widget tw) { TextDestData dest_data; Display *display = XtDisplay(tw); Screen *screen = XtScreen(tw); XContext loc_context; _XmProcessLock(); if (_XmTextDestContext == 0) _XmTextDestContext = XUniqueContext(); loc_context = _XmTextDestContext; _XmProcessUnlock(); if (XFindContext(display, (Window)screen, loc_context, (char **) &dest_data)) { XmTextContextData ctx_data; Widget xm_display = (Widget) XmGetXmDisplay(display); ctx_data = (XmTextContextData) XtMalloc(sizeof(XmTextContextDataRec)); ctx_data->screen = screen; ctx_data->context = loc_context; ctx_data->type = _XM_IS_DEST_CTX; dest_data = (TextDestData) XtCalloc(1, sizeof(TextDestDataRec)); XtAddCallback(xm_display, XmNdestroyCallback, (XtCallbackProc) _XmTextFreeContextData, (XtPointer) ctx_data); XSaveContext(display, (Window)screen, loc_context, (char *)dest_data); } return dest_data; } Boolean _XmTextNeedsPendingDeleteDis(XmTextWidget tw, XmTextPosition *left, XmTextPosition *right, int check_add_mode) { InputData data = tw->text.input->data; if (!(*tw->text.source->GetSelection)(tw->text.source, left, right)) { *left = *right = tw->text.cursor_position; return False; } else if (check_add_mode && !tw->text.add_mode) return (*left != *right); else return (data->pendingdelete && *left != *right && *left <= tw->text.cursor_position && *right >= tw->text.cursor_position); } /* ARGSUSED */ /* * static void * #ifdef _NO_PROTO * CheckSync(w, tmp, event, cont) * Widget w; * XtPointer tmp; * XEvent *event; * Boolean *cont; * #else * CheckSync(Widget w, * XtPointer tmp, * XEvent *event, * Boolean *cont) * #endif * { * XmTextWidget tw = (XmTextWidget) w; * InputData data = tw->text.input->data; * XEvent ev2; * Boolean onewaiting; * * if (XPending(XtDisplay(tw))) { * XPeekEvent(XtDisplay(tw), &ev2); * onewaiting = (ev2.xany.type == KeyPress && * ev2.xany.window == XtWindow(tw)); * } else onewaiting = FALSE; * if (data->syncing) { * if (!onewaiting) { * data->syncing = FALSE; * _XmTextEnableRedisplay(tw); * } * } else { * if (onewaiting) { * data->syncing = TRUE; * _XmTextDisableRedisplay(tw, FALSE); * } * } * } */ /* ARGSUSED */ static void RingBell(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (tw->text.verify_bell) XBell(XtDisplay(tw), 0); } Boolean _XmTextHasDestination(Widget w) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; return (data->has_destination); } Boolean _XmTextSetDestinationSelection(Widget w, XmTextPosition position, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time set_time) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; Boolean result = TRUE; Atom MOTIF_DESTINATION = XInternAtom(XtDisplay(w), XmS_MOTIF_DESTINATION, False); if (!XtIsRealized(w)) return False; EraseInsertionPoint(tw); if (!disown) { if (!data->has_destination) { if (!set_time) set_time = _XmValidTimestamp(w); XmeSecondarySink(w, set_time); data->dest_time = set_time; data->has_destination = result; if (result) _XmSetDestination(XtDisplay(w), w); } tw->text.dest_position = position; } else { if (data->has_destination) { if (!set_time) set_time = _XmValidTimestamp(w); XtDisownSelection(w, MOTIF_DESTINATION, set_time); /* Call XmGetDestination(dpy) to get widget that last had destination cursor. */ if (w == XmGetDestination(XtDisplay(w))) _XmSetDestination(XtDisplay(w), (Widget)NULL); data->has_destination = False; } } DisplayInsertionPoint(tw); return result; } static Boolean DeleteOrKill(XmTextWidget tw, XEvent *event, XmTextPosition from, XmTextPosition to, #if NeedWidePrototypes int kill, #else Boolean kill, #endif /* NeedWidePrototypes */ XmTextPosition *cursorPos) { XmTextBlockRec block, newblock; Boolean freeBlock; char *ptr; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextDisableRedisplay(tw,False); if (kill && from < to) { ptr = _XmStringSourceGetString(tw, from, to, False); XRotateBuffers(XtDisplay(tw), 1); XStoreBuffer(XtDisplay(tw), ptr, strlen(ptr), 0); XtFree(ptr); } block.ptr = ""; block.length = 0; block.format = XmFMT_8_BIT; if (_XmTextModifyVerify(tw, event, &from, &to, cursorPos, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, NULL, &from, &to, &newblock, False) != EditDone) { _XmTextEnableRedisplay(tw); RingBell((Widget)tw, (XEvent *) NULL, (String *) NULL, (Cardinal) 0); if (freeBlock && newblock.ptr) XtFree(newblock.ptr); return FALSE; } else { tw->text.needs_redisplay = tw->text.needs_refigure_lines = True; _XmTextEnableRedisplay(tw); _XmTextSetDestinationSelection((Widget)tw, tw->text.cursor_position, False, event_time); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { _XmTextEnableRedisplay(tw); RingBell((Widget)tw, (XEvent *) NULL, (String *) NULL, (Cardinal) 0); return FALSE; } return TRUE; } static void StuffFromBuffer(XmTextWidget tw, XEvent *event, int buffer) { XmTextPosition cursorPos; XmTextPosition from_pos, to_pos; XmTextBlockRec block, newblock; Boolean freeBlock; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); from_pos = to_pos = tw->text.cursor_position; block.ptr = XFetchBuffer(XtDisplay(tw), &(block.length), buffer); block.format = XmFMT_8_BIT; if (_XmTextModifyVerify(tw, event, &from_pos, &to_pos, &cursorPos, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, NULL, &from_pos, &to_pos, &newblock, False) != EditDone) { RingBell((Widget)tw, (XEvent *) NULL, (String *) NULL, (Cardinal) 0); } else { _XmTextSetCursorPosition((Widget)tw, cursorPos); _XmTextSetDestinationSelection((Widget)tw, tw->text.cursor_position, False, event_time); _XmTextValueChanged(tw, event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { RingBell((Widget)tw, (XEvent *) NULL, (String *) NULL, (Cardinal) 0); } if (block.ptr) XtFree(block.ptr); } /* ARGSUSED */ static void UnKill(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); StuffFromBuffer(tw, event, 0); } /* ARGSUSED */ static void RemoveCurrentSelection(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill) #else Boolean kill) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition newCursorPos, cursorPos, left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (!(*tw->text.source->GetSelection)(tw->text.source, &left, &right)) { XBell(XtDisplay(tw), 0); } else { if (!_XmStringSourceGetEditable(GetSrc(w))) { /* Why bother with any of the following? Nothing will happen! */ return; } if (left < right) { cursorPos = tw->text.cursor_position; (*tw->text.source->SetSelection)(tw->text.source, cursorPos, cursorPos, event_time); if (DeleteOrKill(tw, event, left, right, kill, &newCursorPos)) { if (cursorPos > left && cursorPos <= right) { _XmTextSetCursorPosition(w, newCursorPos); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, event_time); } _XmTextValueChanged(tw, event); } else (*tw->text.source->SetSelection)(tw->text.source, left, right, event_time); } } } static void DeleteCurrentSelection(Widget w, XEvent *event, String *params, Cardinal *num_params) { _XmTextResetIC(w); RemoveCurrentSelection(w, event, params, num_params, FALSE); } static void KillCurrentSelection(Widget w, XEvent *event, String *params, Cardinal *num_params) { _XmTextResetIC(w); RemoveCurrentSelection(w, event, params, num_params, TRUE); } static void CheckDisjointSelection(Widget w, XmTextPosition position, Time sel_time) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition left, right; InputData data = tw->text.input->data; left = right = position; if (tw->text.add_mode || ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && left != right && position >= left && position <= right)) tw->text.pendingoff = FALSE; else tw->text.pendingoff = TRUE; if (left == right) { _XmTextSetDestinationSelection(w, position, False, sel_time); data->anchor = position; } else { _XmTextSetDestinationSelection(w, position, False, sel_time); if (!tw->text.add_mode) data->anchor = position; } } static Boolean PrintableString(XmTextWidget tw, char* str, int n) { #ifdef SUPPORT_ZERO_WIDTH /* some locales (such as Thai) have characters that are * printable but non-spacing. These should be inserted, * even if they have zero width. */ if (tw->text.char_size == 1) { int i; for (i = 0; i < n; i++) { if (!isprint((unsigned char)str[i])) { return False; } } return True; } else { /* tw->text.char_size > 1 */ #ifdef HAS_WIDECHAR_FUNCTIONS int i, csize; wchar_t wc; #ifndef NO_MULTIBYTE for (i = 0, csize = mblen(str, tw->text.char_size); i < n; i += csize, csize=mblen(&(str[i]), tw->text.char_size)) #else for (i = 0, csize = *str ? 1 : 0; i < n; i += csize, csize = str[i] ? 1 : 0) #endif { if (csize < 0) return False; if (mbtowc(&wc, &(str[i]), tw->text.char_size) <= 0) return False; if (!iswprint(wc)) { return False; } } #else /* HAS_WIDECHAR_FUNCTIONS */ /* * This will only check if any single-byte characters are non- * printable. Better than nothing... */ int i, csize; #ifndef NO_MULTIBYTE for (i = 0, csize = mblen(str, tw->text.char_size); i < n; i += csize, csize=mblen(&(str[i]), tw->text.char_size)) #else for (i = 0, csize = *str ? 1 : 0; i < n; i += csize, csize = str[i] ? 1 : 0) #endif { if (csize < 0) return False; if (csize == 1 && !isprint((unsigned char)str[i])) { return False; } } #endif /* HAS_WIDECHAR_FUNCTIONS */ return True; } #else /* SUPPORT_ZERO_WIDTH */ OutputData o_data = tw->text.output->data; if (o_data->use_fontset) { return (XmbTextEscapement((XFontSet)o_data->font, str, n) != 0); #ifdef USE_XFT } else if (o_data->use_xft) { XGlyphInfo ext; XftTextExtentsUtf8(XtDisplay(tw), (XftFont*)o_data->font, (_Xconst FcChar8 *)str, n, &ext); return ext.xOff != 0; #endif } else { return (XTextWidth(o_data->font, str, n) != 0); } #endif /* SUPPORT_ZERO_WIDTH */ } static void SelfInsert(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; char str[TEXT_MAX_INSERT_SIZE+ 1]; /* NULL-terminated below */ int n, i; XmTextPosition cursorPos, beginPos, nextPos, lastPos; XmTextPosition left, right; XmTextBlockRec block, newblock; Status status_return; Boolean pending_delete = False; Boolean freeBlock; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); /* Determine what was pressed. */ n = XmImMbLookupString(w, (XKeyEvent *) event, str, TEXT_MAX_INSERT_SIZE, (KeySym *) NULL, &status_return); /* If the user has input more data than we can handle, bail out */ if (status_return == XBufferOverflow || n > TEXT_MAX_INSERT_SIZE) return; /* *LookupString in some cases can return the NULL as a character, such * as when the user types or <@>. Text widget * can't handle the NULL as a character, so we dump it here. */ for (i=0; i < n; i++) if (str[i] == 0) n = 0; /* just toss out the entire input string */ if (n > 0) { EraseInsertionPoint(tw); str[n]='\0'; if (!PrintableString(tw, str, n) && strchr(str, '\t') == NULL) { DisplayInsertionPoint(tw); return; } beginPos = nextPos = tw->text.cursor_position; if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, FALSE)) { beginPos = left; nextPos = right; pending_delete = True; } else if (data->overstrike) { nextPos += _XmTextCountCharacters(str, n); lastPos = (*(tw->text.source->Scan))(tw->text.source, beginPos, XmSELECT_LINE, XmsdRight, 1, TRUE); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { if (nextPos > lastPos) nextPos = lastPos; } else if (nextPos >= lastPos) { if (lastPos < tw->text.source->data->length) { nextPos = lastPos-1; } else { nextPos = lastPos; } } } block.ptr = str; block.length = n; block.format = XmFMT_8_BIT; if (_XmTextModifyVerify(tw, event, &beginPos, &nextPos, &cursorPos, &block, &newblock, &freeBlock)) { if (pending_delete) (*tw->text.source->SetSelection)(tw->text.source, cursorPos, cursorPos, event_time); if ((*tw->text.source->Replace)(tw, NULL, &beginPos, &nextPos, &newblock, False) != EditDone) { RingBell(w, event, params, num_params); } else { cursorPos = _XmTextSetPreeditPosition(w, cursorPos); _XmTextSetCursorPosition(w, cursorPos); CheckDisjointSelection(w, tw->text.cursor_position, event_time); _XmTextValueChanged(tw, event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { RingBell(w, event, params, num_params); } DisplayInsertionPoint(tw); } } static void InsertString(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, newCursorPos, beginPos, nextPos, left, right; char *str; int i; XmTextBlockRec block, newblock; Boolean value_changed = False; Boolean pending_delete = False; Boolean freeBlock; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextDisableRedisplay(tw, TRUE); cursorPos = beginPos = nextPos = tw->text.cursor_position; if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, FALSE)) { beginPos = left; nextPos = right; pending_delete = True; } for (i=0; i<*num_params; i++) { str = params[i]; block.ptr = str; block.length = strlen(str); block.format = XmFMT_8_BIT; if (_XmTextModifyVerify(tw, event, &beginPos, &nextPos, &newCursorPos, &block, &newblock, &freeBlock)) { if (pending_delete) { (*tw->text.source->SetSelection)(tw->text.source, cursorPos, cursorPos, event_time); pending_delete = False; } if ((*tw->text.source->Replace)(tw, NULL, &beginPos, &nextPos, &newblock, False) != EditDone) { RingBell(w, event, params, num_params); if (freeBlock && newblock.ptr) XtFree(newblock.ptr); break; } else { if (freeBlock && newblock.ptr) { XtFree(newblock.ptr); newblock.ptr = NULL; } cursorPos = newCursorPos; value_changed = True; } } else { RingBell(w, event, params, num_params); break; } } if (value_changed) { _XmTextSetCursorPosition(w, cursorPos); CheckDisjointSelection(w, tw->text.cursor_position, event_time); _XmTextValueChanged(tw, event); } _XmTextEnableRedisplay(tw); } static void ProcessVerticalParams(Widget w, XEvent *event, String *params, Cardinal *num_params) { char *dir; Cardinal num; int direction; XmTextWidget tw = (XmTextWidget) w; if (*num_params > 0) { if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_HORIZONTAL_DIRECTION_ACTION_PARAMS, params[0], False, &direction) == True) { if (direction == _RIGHT) { dir = "extend"; num = 1; _MovePreviousLine(w, event, &dir, &num, False); } else if (direction == _LEFT) { dir = "extend"; num = 1; _MoveNextLine(w, event, &dir, &num, False); } } } else { if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_VERTICAL_DIRECTION_ACTION_PARAMS, params[0], False, &direction) == True) { if (direction == _UP) { dir = "extend"; num = 1; _MovePreviousLine(w, event, &dir, &num, False); } else if (direction == _DOWN) { dir = "extend"; num = 1; _MoveNextLine(w, event, &dir, &num, False); } } } } } /* ARGSUSED */ static void ProcessHorizontalParams(Widget w, XEvent *event, String *params, Cardinal *num_params, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition old_cursorPos = tw->text.cursor_position; int direction; *position = (*tw->text.source->Scan)(tw->text.source, tw->text.cursor_position, XmSELECT_POSITION, XmsdRight, 1, False); if (!(*tw->text.source->GetSelection) (tw->text.source, left, right) || *left == *right) { data->origLeft = data->origRight = data->anchor; *left = *right = old_cursorPos; } /* move text cursor in direction of cursor key */ if (*num_params > 0) { if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_VERTICAL_DIRECTION_ACTION_PARAMS, params[0], False, &direction) == True) { if (direction == _UP) (*position)--; else if(direction == _DOWN) (*position)++; } } else { if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_HORIZONTAL_DIRECTION_ACTION_PARAMS, params[0], False, &direction) == True) { if (direction == _RIGHT) (*position)++; else if (direction == _LEFT) (*position)--; } } } } /* ARGSUSED */ static void ProcessSelectParams(Widget w, XEvent *event, XmTextPosition *left, XmTextPosition *right, XmTextPosition *position) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; if (!((*tw->text.source->GetSelection)(tw->text.source, left, right)) || *left == *right) { if (*position > data->anchor) { *left = data->anchor; *right = *position; } else { *left = *position; *right = data->anchor; } } } static XmTextPosition SelectOutLine(XmTextWidget tw, XmTextPosition position, XmTextScanDirection dir, int count) { unsigned int line; line = _XmTextGetTableIndex(tw, position); if (dir == XmsdLeft) { count--; line -= count; } else { line += count; } if ((int)line < 0) line = 0; if (line < tw->text.total_lines) return tw->text.line_table[line].start_pos; else { XmTextSource source = GetSrc(tw); line = tw->text.total_lines - 1; return (*source->Scan)(source, tw->text.line_table[line].start_pos, XmSELECT_ALL, XmsdRight, 1, TRUE); } } static void KeySelection(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextPosition position, left, right, cursorPos; XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextScanDirection cursorDir; /* PIR1858 */ XmTextPosition tempIndex; /* PIR1858 */ int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); /* reset origLeft and origRight */ (*tw->text.source->GetSelection)(tw->text.source, &(data->origLeft), &(data->origRight)); cursorPos = tw->text.cursor_position; data->selectionHint.x = data->selectionHint.y = 0; data->extending = TRUE; EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, FALSE); if (*num_params == 0) { position = cursorPos; ProcessSelectParams(w, event, &left, &right, &position); } else if (*num_params > 0) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_VERTICAL_DIRECTION_ACTION_PARAMS, params[0], False, &value) == True) { SetAnchorBalancing(tw, cursorPos); ProcessHorizontalParams(w, event, params, num_params, &left, &right, &position); } else if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_HORIZONTAL_DIRECTION_ACTION_PARAMS, params[0], False, &value) == True) { /* The only legal values for this reptype are "right" and "left". If the parameter is a valid reptype, then it must be one of those values. */ ProcessVerticalParams(w, event, params, num_params); _XmTextEnableRedisplay(tw); data->extending = FALSE; DisplayInsertionPoint(tw); return; } } else { if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_HORIZONTAL_DIRECTION_ACTION_PARAMS, params[0], False, &value) == True) { /* The only legal values for this reptype are "right" and "left". If the parameter is a valid reptype, then it must be one of those values. */ SetAnchorBalancing(tw, cursorPos); ProcessHorizontalParams(w, event, params, num_params, &left, &right, &position); } else if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_VERTICAL_DIRECTION_ACTION_PARAMS, params[0], False, &value) == True) { /* The only legal values for this reptype are "up" and "down". If the parameter is a valid reptype, then it must be one of those values. */ ProcessVerticalParams(w, event, params, num_params); _XmTextEnableRedisplay(tw); data->extending = FALSE; DisplayInsertionPoint(tw); return; } } } cursorPos = position; if (position < 0 || position > tw->text.last_position) { _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); return; } if (cursorPos < data->anchor) data->extendDir = XmsdLeft; else if (cursorPos > data->anchor) data->extendDir = XmsdRight; cursorDir = data->extendDir; /* PIR1858 */ if (data->extendDir == XmsdRight) { if (cursorPos < right) /* PIR1858: We are backtracking */ cursorDir = XmsdLeft; /* PIR1858 */ if (data->stype == XmSELECT_OUT_LINE) { right = cursorPos = SelectOutLine(tw, position, cursorDir, 1); } else { right = cursorPos = (*tw->text.source->Scan)(tw->text.source, position, data->stype, cursorDir, 1, FALSE); } left = data->anchor; } else { if (cursorPos > left) /* PIR1858: We are backtracking */ cursorDir = XmsdRight;/* PIR1858 */ if (data->stype == XmSELECT_OUT_LINE) { left = cursorPos = SelectOutLine(tw, position, cursorDir, 1); } else { left = cursorPos = (*tw->text.source->Scan)(tw->text.source, position, data->stype, cursorDir, 1, FALSE); } right = data->anchor; } if (left > right) { /* PIR1858: We are on other side of anchor */ tempIndex = left; left = right; right = tempIndex; } /* end PIR1858 */ (*tw->text.source->SetSelection)(tw->text.source, left, right, event_time); tw->text.pendingoff = FALSE; _XmTextSetCursorPosition(w, cursorPos); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, event_time); if (tw->text.auto_show_cursor_position && cursorPos == tw->text.bottom_position) (*tw->text.output->MakePositionVisible)(tw, cursorPos); _XmTextEnableRedisplay(tw); /* reset origLeft and origRight */ (*tw->text.source->GetSelection)(tw->text.source, &(data->origLeft), &(data->origRight)); data->extending = FALSE; DisplayInsertionPoint(tw); } static void SetAnchorBalancing(XmTextWidget tw, XmTextPosition position) { InputData data = tw->text.input->data; XmTextPosition left, right; float bal_point; if (!((*tw->text.source->GetSelection)(tw->text.source, &left, &right)) || left == right) { data->anchor = position; } else { bal_point = (float)(((float)(right - left) / 2.0) + (float)left); /* shift anchor and direction to opposite end of the selection */ if ((float)position < bal_point) { data->extendDir = XmsdLeft; data->anchor = data->origRight; } else if ((float)position > bal_point) { data->extendDir = XmsdRight; data->anchor = data->origLeft; } } } static void SetNavigationAnchor(XmTextWidget tw, XmTextPosition old_position, XmTextPosition new_position, Time time, #if NeedWidePrototypes int extend) #else Boolean extend) #endif /* NeedWidePrototypes */ { XmTextPosition left = old_position, right = old_position; InputData data = tw->text.input->data; Boolean has_selection; has_selection = ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && left != right); if (!tw->text.add_mode) { if (extend) { if (old_position < left || old_position > right) /* start outside selection - anchor at start position */ data->anchor = old_position; else if (!has_selection || ((left <= new_position) && (new_position <= right))) /* no selection, or moving into selection */ SetAnchorBalancing(tw, old_position); else /* moving to outside selection */ SetAnchorBalancing(tw, new_position); } else { if (has_selection) { (*tw->text.source->SetSelection)(tw->text.source, old_position, old_position, time); data->anchor = old_position; } } } else if (extend) { if (old_position < left || old_position > right) /* start outside selection - anchor at start position */ data->anchor = old_position; else if (!has_selection || ((left <= new_position) && (new_position <= right))) /* no selection, or moving into selection */ SetAnchorBalancing(tw, old_position); else /* moving to outside selection */ SetAnchorBalancing(tw, new_position); } } static void CompleteNavigation(XmTextWidget tw, XmTextPosition position, Time time, #if NeedWidePrototypes int extend) #else Boolean extend) #endif /* NeedWidePrototypes */ { XmTextPosition left, right; InputData data = tw->text.input->data; if ((tw->text.add_mode && (*tw->text.source->GetSelection) (tw->text.source, &left, &right) && position >= left && position <= right) || extend) tw->text.pendingoff = FALSE; else tw->text.pendingoff = TRUE; if (extend) { if (data->anchor > position) { left = position; right = data->anchor; } else { left = data->anchor; right = position; } (*tw->text.source->SetSelection)(tw->text.source, left, right, time); data->origLeft = left; data->origRight = right; } _XmTextSetCursorPosition((Widget)tw, position); } /* ARGSUSED */ static void SimpleMovement(Widget w, XEvent *event, String *params , Cardinal *num_params , XmTextScanDirection dir, XmTextScanType type, #if NeedWidePrototypes int include) #else Boolean include) #endif /* NeedWidePrototypes */ { XmTextPosition cursorPos, newPos; XmTextWidget tw = (XmTextWidget) w; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } newPos = (*tw->text.source->Scan)(tw->text.source, cursorPos, type, dir, 1, include); SetNavigationAnchor(tw, cursorPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; EraseInsertionPoint(tw); SimpleMovement(w, event, params, num_params, XmsdRight, XmSELECT_POSITION, TRUE); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; EraseInsertionPoint(tw); SimpleMovement(w, event, params, num_params, XmsdLeft, XmSELECT_POSITION, TRUE); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition position, cursorPos; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); cursorPos = tw->text.cursor_position; EraseInsertionPoint(tw); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } /* Add if We only want to select to the end of the word w/o spaces if (*num_params > 0) { There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { position = (*tw->text.source->Scan)(tw->text.source, cursorPos, XmSELECT_WORD, XmsdRight, 1, FALSE); if(position == cursorPos) { position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_WORD, XmsdRight, 1, TRUE); position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_WORD, XmsdRight, 1, FALSE); } } else */ position = (*tw->text.source->Scan)(tw->text.source, cursorPos, XmSELECT_WORD, XmsdRight, 1, TRUE); SetNavigationAnchor(tw, cursorPos, position, event_time, extend); CompleteNavigation(tw, position, event_time, extend); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition position, cursorPos; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); cursorPos = tw->text.cursor_position; EraseInsertionPoint(tw); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } position = (*tw->text.source->Scan)(tw->text.source, cursorPos, XmSELECT_WORD, XmsdLeft, 1, FALSE); if(position == cursorPos) { position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_WORD, XmsdLeft, 1, TRUE); position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_WORD, XmsdLeft, 1, FALSE); } SetNavigationAnchor(tw, cursorPos, position, event_time, extend); CompleteNavigation(tw, position, event_time, extend); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveForwardParagraph(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) return; EraseInsertionPoint(tw); SimpleMovement(w, event, params, num_params, XmsdRight, XmSELECT_PARAGRAPH, FALSE); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveBackwardParagraph(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) return; EraseInsertionPoint(tw); SimpleMovement(w, event, params, num_params, XmsdLeft, XmSELECT_PARAGRAPH, FALSE); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveToLineStart(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; LineNum line; XmTextPosition position, cursorPos; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } EraseInsertionPoint(tw); _XmTextShowPosition(w, cursorPos); line = _XmTextPosToLine(tw, cursorPos); if (line == NOLINE) { XBell(XtDisplay(tw), 0); } else { _XmTextLineInfo(tw, line, &position, (LineTableExtra *) NULL); SetNavigationAnchor(tw, cursorPos, position, event_time, extend); CompleteNavigation(tw, position, event_time, extend); } DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveToLineEnd(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; LineNum line; XmTextPosition position, cursorPos; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); cursorPos = tw->text.cursor_position; EraseInsertionPoint(tw); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } _XmTextShowPosition(w, cursorPos); line = _XmTextPosToLine(tw, cursorPos); if (line == NOLINE) { XBell(XtDisplay(tw), 0); } else { _XmTextLineInfo(tw, line+1, &position, (LineTableExtra *) NULL); if (position == PASTENDPOS) position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_ALL, XmsdRight, 1, TRUE); else position = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, TRUE); SetNavigationAnchor(tw, cursorPos, position, event_time, extend); CompleteNavigation(tw, position, event_time, extend); } DisplayInsertionPoint(tw); } /* ARGSUSED */ static void _MoveNextLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int pendingoff) #else Boolean pendingoff) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; LineNum line; XmTextPosition currentPos, newPos, start, start2; XmTextPosition next; Position savePosX = tw->text.cursor_position_x; Position cur_x = 0, cur_y = 0; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) return; currentPos = tw->text.cursor_position; (*tw->text.output->PosToXY)(tw, currentPos, &cur_x, &cur_y); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } _XmTextShowPosition(w, currentPos); line = _XmTextPosToLine(tw, currentPos); if (line == NOLINE) { XBell(XtDisplay(tw), 0); return; } _XmTextLineInfo(tw, line+1, &start, (LineTableExtra *) NULL); if (start == PASTENDPOS) { newPos = (*tw->text.source->Scan)(tw->text.source, currentPos, XmSELECT_ALL, XmsdRight, 1, TRUE); SetNavigationAnchor(tw, currentPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); tw->text.pendingoff = pendingoff; } else { /* If 16-bit characters are offset by half-width, need to handle it: * AABBCC... Now move cursor down from beginning of CC * cDDEEFF... Should be at beginning of either EE or FF, down again * GGHHII... Should now be at beginning of II */ /* Force Scroll to next line so that XtoPos.. won't fail */ if (line == tw->text.number_lines - 1) { _XmTextShowPosition(w, start); /* This may cause a multi-line scroll. We better reset line */ line = _XmTextPosToLine(tw, start); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) newPos = YtoPosInLine(tw, cur_y, line); else newPos = XtoPosInLine(tw, savePosX, line); } else { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) newPos = YtoPosInLine(tw, cur_y, line+1); else newPos = XtoPosInLine(tw, savePosX, line+1); } next = (*tw->text.source->Scan)(tw->text.source, newPos, XmSELECT_LINE, XmsdRight, 1, FALSE); SetNavigationAnchor(tw, currentPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); if (tw->text.cursor_position != next) tw->text.cursor_position_x = savePosX; } _XmTextShowPosition(w, tw->text.cursor_position); line = _XmTextPosToLine(tw, tw->text.cursor_position); if (line != NOLINE) { _XmTextLineInfo(tw, line, &start2, (LineTableExtra *) NULL); if (start2 != start && start != PASTENDPOS) { newPos = (*tw->text.source->Scan)(tw->text.source, start, XmSELECT_LINE, XmsdRight, 1, FALSE); SetNavigationAnchor(tw, currentPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); } } } static void MoveNextLine(Widget w, XEvent *event, String *params, Cardinal *num_params) { _XmTextResetIC(w); _MoveNextLine(w, event, params, num_params, True); } /* ARGSUSED */ static void _MovePreviousLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int pendingoff) #else Boolean pendingoff) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; LineNum line; XmTextPosition currentPos, newPos, origstart, start, start2; XmTextPosition next; Boolean changed = False; Position savePosX = tw->text.cursor_position_x; Position cur_x = 0, cur_y = 0; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) return; /* Recompute lines if necessary */ (void) XmTextGetTopCharacter(w); currentPos = tw->text.cursor_position; (*tw->text.output->PosToXY)(tw, currentPos, &cur_x, &cur_y); if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } _XmTextShowPosition(w, currentPos); line = _XmTextPosToLine(tw, currentPos); if (line == NOLINE) { XmeWarning(w, MSG1); newPos = currentPos; } else { _XmTextLineInfo(tw, line, &origstart, (LineTableExtra *) NULL); if (line == 0) { XmTextScroll(w, -1); line = _XmTextPosToLine(tw, currentPos); if (line == 0) { newPos = (*tw->text.source->Scan)(tw->text.source, currentPos, XmSELECT_ALL, XmsdLeft, 1, TRUE); changed = True; goto done; } if (line == NOLINE) line = 1; } _XmTextLineInfo(tw, line-1, &start, (LineTableExtra *) NULL); /* If 16-bit characters are offset by half-width, need to handle it: * AABBCC... Now move cursor up from beginning of II * cDDEEFF... Should be at beginning of either EE or FF; up again * GGHHII... Should now be at beginning of CC */ if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) newPos = YtoPosInLine(tw, cur_y, line-1); else newPos = XtoPosInLine(tw, tw->text.cursor_position_x, line-1); next = (*tw->text.source->Scan)(tw->text.source, newPos, XmSELECT_LINE, XmsdRight, 1, FALSE); if (newPos == next) changed = True; _XmTextShowPosition(w, newPos); line = _XmTextPosToLine(tw, newPos); if (line != NOLINE) { _XmTextLineInfo(tw, line, &start2, (LineTableExtra *) NULL); if (start2 != start) { newPos = (*tw->text.source->Scan)(tw->text.source, origstart, XmSELECT_POSITION, XmsdLeft, 1,TRUE); } } } done: SetNavigationAnchor(tw, currentPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); if (!changed) tw->text.cursor_position_x = savePosX; } static void MovePreviousLine(Widget w, XEvent *event, String *params, Cardinal *num_params) { _MovePreviousLine(w, event, params, num_params, True); } /* ARGSUSED */ static void MoveNextPage(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, newPos; Position x, y; int n, value; Boolean extend = False; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) return; EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, FALSE); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } (*tw->text.output->PosToXY)(tw, cursorPos, &x, &y); n = _XmTextNumLines(tw); if (n > 1) n--; XmTextScroll(w, n); /* When y = 0, improper scrolling results. This makes * sure no extra scroll results. */ if (y <= 0) { OutputData o_data = tw->text.output->data; y += o_data->topmargin; } else { y -= tw->text.output->data->font_ascent; } newPos = (*tw->text.output->XYToPos)(tw, x, y); SetNavigationAnchor(tw, cursorPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MovePreviousPage(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, newPos; Position x, y; int n, value; Boolean extend = False; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) return; EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, FALSE); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &x, &y); y -= tw->text.output->data->font_ascent; n = _XmTextNumLines(tw); if (n > 1) n--; XmTextScroll(w, -n); newPos = (*tw->text.output->XYToPos)(tw, x, y); SetNavigationAnchor(tw, cursorPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MovePageLeft(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, newPos; Position x, y; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, FALSE); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &x, &y); y -= tw->text.output->data->font_ascent; _XmTextChangeHOffset(tw, -tw->text.inner_widget->core.width); newPos = (*tw->text.output->XYToPos)(tw, x, y); SetNavigationAnchor(tw, cursorPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MovePageRight(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, newPos; Position x, y; Boolean extend = False; int value; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, FALSE); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &x, &y); y -= tw->text.output->data->font_ascent; _XmTextChangeHOffset(tw, tw->text.inner_widget->core.width); newPos = (*tw->text.output->XYToPos)(tw, x, y); SetNavigationAnchor(tw, cursorPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MovePageUp(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, newPos; Position x = 0, y = 0; Boolean extend = False; int value = 0; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, FALSE); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &x, &y); _XmTextChangeVOffset(tw, -tw->text.inner_widget->core.height); newPos = (*tw->text.output->XYToPos)(tw, x, y); SetNavigationAnchor(tw, cursorPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MovePageDown(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, newPos; Position x = 0, y = 0; Boolean extend = False; int value = 0; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, FALSE); cursorPos = tw->text.cursor_position; if (*num_params > 0) { /* There is only one valid reptype value for this reptype, i.e. "extend". A True return value means that parameter was "extend". */ if (_XmConvertActionParamToRepTypeId((Widget) w, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, params[0], False, &value) == True) { extend = True; } } (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &x, &y); _XmTextChangeVOffset(tw, tw->text.inner_widget->core.height); newPos = (*tw->text.output->XYToPos)(tw, x, y); SetNavigationAnchor(tw, cursorPos, newPos, event_time, extend); CompleteNavigation(tw, newPos, event_time, extend); _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveBeginningOfFile(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); SimpleMovement(w, event, params, num_params, XmsdLeft, XmSELECT_ALL, TRUE); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void MoveEndOfFile(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); SimpleMovement(w, event, params, num_params, XmsdRight, XmSELECT_ALL, TRUE); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void ScrollOneLineUp(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; EraseInsertionPoint(tw); XmTextScroll(w, 1); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void ScrollOneLineDown(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; EraseInsertionPoint(tw); XmTextScroll(w, -1); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void ScrollCursorVertically(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition pos; LineNum desired_line, cur_line; int percentage; OutputData data = tw->text.output->data; if (*num_params == 0) { if (event) pos = (*tw->text.output->XYToPos)(tw, event->xbutton.x, event->xbutton.y); else pos = tw->text.cursor_position; if (pos == tw->text.line[tw->text.number_lines].start) desired_line = tw->text.number_lines-1; else for(desired_line=0; desired_linetext.number_lines-1; desired_line++) if (tw->text.line[desired_line+1].start > pos) break; } else { tw->text.top_character = 0; tw->text.bottom_position = tw->text.last_position; sscanf(*params, "%d", &percentage); desired_line = ((data->number_lines - 1) * percentage) /100; } if (tw->text.cursor_position == tw->text.line[tw->text.number_lines].start) cur_line = tw->text.number_lines; else for (cur_line=0; cur_linetext.number_lines; cur_line++) if (tw->text.line[cur_line+1].start > tw->text.cursor_position) break; XmTextScroll(w, (int)(cur_line - desired_line)); } static void AddNewLine(Widget w, XEvent *event, #if NeedWidePrototypes int move_cursor) #else Boolean move_cursor) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition cursorPos, beginPos, nextPos, left, right; XmTextBlockRec block, newblock; Boolean pending_delete = False; Boolean freeBlock; char str[32]; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); str[0] = '\n'; str[1] = 0; block.length = 1; block.ptr = str; block.format = XmFMT_8_BIT; EraseInsertionPoint(tw); beginPos = nextPos = tw->text.cursor_position; if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, FALSE)) { beginPos = left; nextPos = right; pending_delete = True; } if (_XmTextModifyVerify(tw, event, &beginPos, &nextPos, &cursorPos, &block, &newblock, &freeBlock)) { if (pending_delete) { (*tw->text.source->SetSelection)(tw->text.source, cursorPos, cursorPos, event_time); } if ((*tw->text.source->Replace)(tw, NULL, &beginPos, &nextPos, &newblock, False) != EditDone) { if (tw->text.verify_bell) XBell(XtDisplay(tw), 0); } else { if (move_cursor) { _XmTextSetCursorPosition(w, cursorPos); } else { _XmTextSetCursorPosition(w, beginPos); } CheckDisjointSelection(w, tw->text.cursor_position, event_time); _XmTextValueChanged(tw, event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { if (tw->text.verify_bell) XBell(XtDisplay(tw), 0); } DisplayInsertionPoint(tw); } /* ARGSUSED */ static void InsertNewLine(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); AddNewLine(w, event, True); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void InsertNewLineAndBackup(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); AddNewLine(w, event, False); DisplayInsertionPoint(tw); } static void InsertNewLineAndIndent(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextBlockRec block, newblock; XmTextPosition pos, from_pos, to_pos, left, right, cursorPos, newCursorPos; Boolean freeBlock, value_changed = False; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); EraseInsertionPoint(tw); _XmTextDisableRedisplay(tw, TRUE); pos = tw->text.cursor_position; left = (*tw->text.source->Scan)(tw->text.source, pos, XmSELECT_LINE, XmsdLeft, 1, FALSE); if(left != (*tw->text.source->Scan)(tw->text.source, left, XmSELECT_WHITESPACE, XmsdRight, 1, FALSE)) { AddNewLine(w, event, True); } else { right = (*tw->text.source->Scan)(tw->text.source, left, XmSELECT_WHITESPACE, XmsdRight, 1, TRUE); if(right > pos) right = pos; AddNewLine(w, event, True); cursorPos = from_pos = to_pos = tw->text.cursor_position; while(left < right) { left=(*tw->text.source->ReadSource)(tw->text.source, left, right, &block); if (_XmTextModifyVerify(tw, event, &from_pos, &to_pos, &newCursorPos, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, NULL, &from_pos, &to_pos, &newblock, False) != EditDone) { RingBell(w, event, params, num_params); if (freeBlock && newblock.ptr) XtFree(newblock.ptr); break; } else { cursorPos = newCursorPos; if (freeBlock && newblock.ptr) XtFree(newblock.ptr); value_changed = True; } } else { RingBell(w, event, params, num_params); break; } } _XmTextSetCursorPosition(w, cursorPos); CheckDisjointSelection(w, tw->text.cursor_position, event_time); if (value_changed) _XmTextValueChanged(tw, event); } _XmTextEnableRedisplay(tw); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void RedrawDisplay(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition top = tw->text.top_character; _XmTextInvalidate(tw, top, top, NODELTA); } /* ARGSUSED */ static void Activate(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmAnyCallbackStruct cb; XmTextWidget tw = (XmTextWidget) w; XmParentInputActionRec p_event; p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_ACTIVATE; p_event.event = event; /* Pointer to XEvent. */ p_event.params = params; /* Or use what you have if */ p_event.num_params = num_params; /* input is from translation.*/ cb.reason = XmCR_ACTIVATE; cb.event = event; XtCallCallbackList(w, tw->text.activate_callback, (XtPointer) &cb); (void) _XmParentProcess(XtParent(tw), (XmParentProcessData) &p_event); } /* ARGSUSED */ static void ToggleOverstrike(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; OutputData o_data = tw->text.output->data; _XmTextResetIC(w); EraseInsertionPoint(tw); data->overstrike = !data->overstrike; o_data->refresh_ibeam_off = True; if (data->overstrike) o_data->cursorwidth = o_data->cursorheight >> 1; else { o_data->cursorwidth = 5; if (o_data->cursorheight > 19) o_data->cursorwidth++; } DisplayInsertionPoint(tw); } /* ARGSUSED */ static void ToggleAddMode(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition left, right; EraseInsertionPoint(tw); tw->text.add_mode = !tw->text.add_mode; DisplayInsertionPoint(tw); if (tw->text.add_mode && (!(*tw->text.source->GetSelection)(data->widget->text.source, &left, &right) || left == right)) { data->anchor = tw->text.dest_position; } } /* ARGSUSED */ static void SetCursorPosition(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (event) _XmTextSetCursorPosition(w, (*tw->text.output->XYToPos)(tw, event->xbutton.x, event->xbutton.y)); } static void RemoveBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill) #else Boolean kill) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition newCursorPos, cursorPos, nextPos, left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); cursorPos = nextPos = tw->text.cursor_position; EraseInsertionPoint(tw); if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, TRUE)) { RemoveCurrentSelection(w, event, params, num_params, kill); } else { nextPos = tw->text.cursor_position; cursorPos = (*tw->text.source->Scan)(tw->text.source, nextPos, XmSELECT_POSITION, XmsdLeft, 1, TRUE); if (DeleteOrKill(tw, event, cursorPos, nextPos, kill, &newCursorPos)) { _XmTextSetCursorPosition(w, newCursorPos); CheckDisjointSelection(w, tw->text.cursor_position, event_time); _XmTextValueChanged(tw, event); } } DisplayInsertionPoint(tw); } static void DeleteBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveBackwardChar(w, event, params, num_params, FALSE); DisplayInsertionPoint(tw); } static void KillBackwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveBackwardChar(w, event, params, num_params, TRUE); DisplayInsertionPoint(tw); } static void RemoveForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill) #else Boolean kill) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition newCursorPos, left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, TRUE)) { RemoveCurrentSelection(w, event, params, num_params, kill); } else { _XmTextDisableRedisplay(tw, TRUE); left = tw->text.cursor_position; right = (*tw->text.source->Scan)(tw->text.source, left, XmSELECT_WORD, XmsdRight, 1, TRUE); if (left < right) { if (DeleteOrKill(tw, event, left, right, kill, &newCursorPos)) { _XmTextSetCursorPosition(w, newCursorPos); CheckDisjointSelection(w, tw->text.cursor_position, event_time); _XmTextValueChanged(tw, event); } } _XmTextEnableRedisplay(tw); } DisplayInsertionPoint(tw); } static void DeleteForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveForwardWord(w, event, params, num_params, FALSE); DisplayInsertionPoint(tw); } static void KillForwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveForwardWord(w, event, params, num_params, TRUE); DisplayInsertionPoint(tw); } static void RemoveBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill) #else Boolean kill) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition newCursorPos, left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, TRUE)) { RemoveCurrentSelection(w, event, params, num_params, kill); } else { _XmTextDisableRedisplay(tw, TRUE); right = tw->text.cursor_position; left = (*tw->text.source->Scan)(tw->text.source, right, XmSELECT_WORD, XmsdLeft, 1, FALSE); if (left == right) { left = (*tw->text.source->Scan)(tw->text.source, left, XmSELECT_WORD, XmsdLeft, 1, TRUE); left = (*tw->text.source->Scan)(tw->text.source, left, XmSELECT_WORD, XmsdLeft, 1, FALSE); } if (left < right) { if (DeleteOrKill(tw, event, left, right, kill, &newCursorPos)) { _XmTextSetCursorPosition(w, newCursorPos); CheckDisjointSelection(w, tw->text.cursor_position, event_time); _XmTextValueChanged(tw, event); } } _XmTextEnableRedisplay(tw); } DisplayInsertionPoint(tw); } static void DeleteBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveBackwardWord(w, event, params, num_params, FALSE); DisplayInsertionPoint(tw); } static void KillBackwardWord(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveBackwardWord(w, event, params, num_params, TRUE); DisplayInsertionPoint(tw); } static void RemoveForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill) #else Boolean kill) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition newCursorPos, cursorPos, nextPos, left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, TRUE)) { RemoveCurrentSelection(w, event, params, num_params, kill); } else { cursorPos = tw->text.cursor_position; nextPos = (*tw->text.source->Scan)(tw->text.source, cursorPos, XmSELECT_POSITION, XmsdRight, 1, TRUE); if (DeleteOrKill(tw, event, cursorPos, nextPos, kill, &newCursorPos)) { _XmTextSetCursorPosition(w, newCursorPos); CheckDisjointSelection(w, tw->text.cursor_position,event_time); _XmTextValueChanged(tw, event); } } DisplayInsertionPoint(tw); } static void KillForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveForwardChar(w, event, params, num_params, TRUE); DisplayInsertionPoint(tw); } static void DeleteForwardChar(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveForwardChar(w, event, params, num_params, FALSE); DisplayInsertionPoint(tw); } static void RemoveToEndOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill) #else Boolean kill) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition newCursorPos, left, right; LineNum line; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, TRUE)) { RemoveCurrentSelection(w, event, params, num_params, kill); } else { _XmTextDisableRedisplay(tw, TRUE); left = tw->text.cursor_position; line = _XmTextPosToLine(tw, left); if (line == NOLINE) right = left; else { _XmTextLineInfo(tw, line+1, &right, (LineTableExtra *) NULL); if (right == PASTENDPOS) right = (*tw->text.source->Scan)(tw->text.source, right, XmSELECT_ALL, XmsdRight, 1, TRUE); else right = (*tw->text.source->Scan)(tw->text.source, right, XmSELECT_POSITION, XmsdLeft, 1, TRUE); } if (left < right) { if (DeleteOrKill(tw, event, left, right, kill, &newCursorPos)) { _XmTextSetCursorPosition(w, newCursorPos); CheckDisjointSelection(w, tw->text.cursor_position,event_time); _XmTextValueChanged(tw, event); } } else if (left == right) DeleteForwardChar(w, event, params, num_params); _XmTextEnableRedisplay(tw); } DisplayInsertionPoint(tw); } static void RemoveToStartOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params, #if NeedWidePrototypes int kill) #else Boolean kill) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) w; XmTextPosition newCursorPos, left, cursorPos, right; LineNum line; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, TRUE)) { RemoveCurrentSelection(w, event, params, num_params, kill); } else { _XmTextDisableRedisplay(tw, TRUE); cursorPos = tw->text.cursor_position; _XmTextShowPosition(w, cursorPos); line = _XmTextPosToLine(tw, cursorPos); if (line == NOLINE) { XBell(XtDisplay(tw), 0); } else { _XmTextLineInfo(tw, line, &left, (LineTableExtra *) NULL); if (left < cursorPos) { if (DeleteOrKill(tw, event, left, cursorPos, kill, &newCursorPos)) { _XmTextSetCursorPosition(w, newCursorPos); CheckDisjointSelection(w, tw->text.cursor_position, event_time); _XmTextValueChanged(tw, event); } } else if (left == cursorPos) DeleteBackwardChar(w, event, params, num_params); } _XmTextEnableRedisplay(tw); } DisplayInsertionPoint(tw); } static void DeleteToStartOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveToStartOfLine(w, event, params, num_params, FALSE); DisplayInsertionPoint(tw); } static void KillToStartOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveToStartOfLine(w, event, params, num_params, TRUE); DisplayInsertionPoint(tw); } static void DeleteToEndOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveToEndOfLine(w, event, params, num_params, FALSE); DisplayInsertionPoint(tw); } static void KillToEndOfLine(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); EraseInsertionPoint(tw); RemoveToEndOfLine(w, event, params, num_params, TRUE); DisplayInsertionPoint(tw); } static void RestorePrimaryHighlight(InputData data, XmTextPosition prim_left, XmTextPosition prim_right) { if (data->sel2Right >= prim_left && data->sel2Right <= prim_right) { /* secondary selection is totally inside primary selection */ if (data->sel2Left >= prim_left) { _XmTextSetHighlight((Widget)data->widget, prim_left, data->sel2Left, XmHIGHLIGHT_SELECTED); _XmTextSetHighlight((Widget)data->widget, data->sel2Left, data->sel2Right, XmHIGHLIGHT_NORMAL); _XmTextSetHighlight((Widget)data->widget, data->sel2Right, prim_right, XmHIGHLIGHT_SELECTED); /* right side of secondary selection is inside primary selection */ } else { _XmTextSetHighlight((Widget)data->widget, prim_left, data->sel2Right, XmHIGHLIGHT_SELECTED); _XmTextSetHighlight((Widget)data->widget, data->sel2Left, prim_left, XmHIGHLIGHT_NORMAL); } } else { /* left side of secondary selection is inside primary selection */ if (data->sel2Left <= prim_right && data->sel2Left >= prim_left) { _XmTextSetHighlight((Widget)data->widget, data->sel2Left, prim_right, XmHIGHLIGHT_SELECTED); _XmTextSetHighlight((Widget)data->widget, prim_right, data->sel2Right, XmHIGHLIGHT_NORMAL); } else { /* secondary selection encompasses the primary selection */ if (data->sel2Left <= prim_left && data->sel2Right >= prim_right) { _XmTextSetHighlight((Widget)data->widget, data->sel2Left, prim_left, XmHIGHLIGHT_NORMAL); _XmTextSetHighlight((Widget)data->widget, prim_left, prim_right, XmHIGHLIGHT_SELECTED); _XmTextSetHighlight((Widget)data->widget, prim_right, data->sel2Right, XmHIGHLIGHT_NORMAL); /* secondary selection is outside primary selection */ } else { _XmTextSetHighlight((Widget)data->widget, prim_left, prim_right, XmHIGHLIGHT_SELECTED); _XmTextSetHighlight((Widget)data->widget, data->sel2Left, data->sel2Right, XmHIGHLIGHT_NORMAL); } } } } Boolean _XmTextSetSel2(XmTextWidget tw, XmTextPosition left, XmTextPosition right, /* if right == -999, then we're in */ Time set_time) /* LoseSelection, so don't call */ { InputData data = tw->text.input->data; Boolean result = TRUE; _XmTextDisableRedisplay(data->widget, FALSE); if (data->hasSel2) { XmTextPosition prim_left, prim_right; /* If the tw has the primary selection, make sure the selection * highlight is restored appropriately. */ if ((*data->widget->text.source->GetSelection)(data->widget->text.source, &prim_left, &prim_right)) RestorePrimaryHighlight(data, prim_left, prim_right); else _XmTextSetHighlight((Widget) data->widget, data->sel2Left, data->sel2Right, XmHIGHLIGHT_NORMAL); } if (!set_time) set_time = _XmValidTimestamp((Widget)tw); if (left <= right) { if (!data->hasSel2) { result = XmeSecondarySource((Widget) data->widget, set_time); data->sec_time = set_time; data->hasSel2 = result; } else result = TRUE; if (result) { _XmTextSetHighlight((Widget) data->widget, left, right, XmHIGHLIGHT_SECONDARY_SELECTED); data->sel2Left = left; data->sel2Right = right; } } else { data->hasSel2 = FALSE; if (right != -999) XtDisownSelection((Widget) data->widget, XA_SECONDARY, set_time); } _XmTextEnableRedisplay(data->widget); return result; } Boolean _XmTextGetSel2(XmTextWidget tw, XmTextPosition *left, XmTextPosition *right) { InputData data = tw->text.input->data; if (data->hasSel2 && data->sel2Left <= data->sel2Right) { *left = data->sel2Left; *right = data->sel2Right; return TRUE; } else { data->hasSel2 = FALSE; return FALSE; } } /* ARGSUSED */ static void SetSelectionHint(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; if (event) { data->selectionHint.x = event->xbutton.x; data->selectionHint.y = event->xbutton.y; } } /* * This routine implements multi-click selection in a hardwired manner. * It supports multi-click entity cycling (char, word, line, file) and mouse * motion adjustment of the selected entities (i.e. select a word then, with * button still down, adjust which word you really meant by moving the mouse). * [Note: This routine is to be replaced by a set of procedures that * will allows clients to implements a wide class of draw through and * multi-click selection user interfaces.] */ static void a_Selection(XmTextWidget tw, #if NeedWidePrototypes int x, int y, #else Position x, Position y, #endif Time sel_time, int set_empty_selection) { InputData data = tw->text.input->data; XmTextPosition position, newLeft, newRight; _XmTextDisableRedisplay(tw, FALSE); position = (*tw->text.output->XYToPos)(tw, x, y); if (data->stype == XmSELECT_OUT_LINE) { newLeft = SelectOutLine(tw, position, XmsdLeft, 1); newRight = SelectOutLine(tw, position, XmsdRight, 1); } else { newLeft = (*tw->text.source->Scan)(tw->text.source, position, data->stype, XmsdLeft, 1, FALSE); newRight = (*tw->text.source->Scan)(tw->text.source, position, data->stype, XmsdRight, 1, data->stype == XmSELECT_LINE); } if (data->stype == XmSELECT_WORD && (int)tw->text.char_size > 1) { if (position == (*tw->text.source->Scan) (tw->text.source, newLeft, data->stype, XmsdRight, 1, FALSE)) newLeft = position; } if (set_empty_selection || newLeft != newRight) (*tw->text.source->SetSelection)(tw->text.source, newLeft, newRight, sel_time); tw->text.pendingoff = FALSE; if (position - newLeft < newRight - position) { _XmTextSetCursorPosition((Widget) tw, newLeft); data->extendDir = XmsdLeft; } else { _XmTextSetCursorPosition((Widget) tw, newRight); data->extendDir = XmsdRight; } _XmTextSetDestinationSelection((Widget)tw, tw->text.cursor_position, False, sel_time); _XmTextShowPosition((Widget) tw, (XmTextPosition) -1); _XmTextEnableRedisplay(tw); data->origLeft = newLeft; data->origRight = newRight; } /* ARGSUSED */ static void SetAnchor(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); data->anchor = tw->text.cursor_position; _XmTextSetDestinationSelection(w, data->anchor, False, event_time); if ((*tw->text.source->GetSelection) (tw->text.source, &left, &right)) { (*tw->text.source->SetSelection)(tw->text.source, data->anchor, data->anchor, event_time); } } /* ARGSUSED */ static void DoSelection(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (event) a_Selection(tw, event->xbutton.x, event->xbutton.y, event->xbutton.time, True); } static void SetScanType(Widget w, InputData data, XEvent *event) { int i; int multi_click_time; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay(w)); multi_click_time = XtGetMultiClickTime(XtDisplay(w)); if (event_time > data->lasttime && event_time - data->lasttime < multi_click_time) { i = 0; while (i < data->sarraycount && data->sarray[i] != data->stype) i++; if (++i >= data->sarraycount) i = 0; data->stype = data->sarray[i]; } else { /* single-click event */ data->stype = data->sarray[0]; } data->lasttime = event_time; } static void StartPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition left, right; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay(w)); _XmTextResetIC(w); EraseInsertionPoint(tw); if (event) data->anchor = (*tw->text.output->XYToPos)(tw, event->xbutton.x, event->xbutton.y); else data->anchor = tw->text.cursor_position; SetSelectionHint(w, event, params, num_params); SetScanType(w, data, event); if (data->stype != XmSELECT_POSITION || ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && left != right)) DoSelection(w, event, params, num_params); else _XmTextSetDestinationSelection(w, data->anchor, False, event_time); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void StartSecondary(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; int status; Position x, y; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay(w)); if (!event_time) event_time = _XmValidTimestamp(w); data->sel_start = True; XAllowEvents(XtDisplay(w), AsyncBoth, event_time); if (event) { data->Sel2Hint.x = event->xbutton.x; data->Sel2Hint.y = event->xbutton.y; } else { (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &x, &y); data->Sel2Hint.x = x; data->Sel2Hint.y = y; } data->selectionMove = FALSE; data->selectionLink = FALSE; data->cancel = False; status = XtGrabKeyboard(w, False, GrabModeAsync, GrabModeAsync, CurrentTime); if (status != GrabSuccess) XmeWarning(w, GRABKBDERROR); } /* ARGSUSED */ static void StartDrag(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; Widget drag_icon; Arg args[10]; int n = 0; drag_icon = XmeGetTextualDragIcon(w); n = 0; XtSetArg(args[n], XmNcursorBackground, tw->core.background_pixel); n++; XtSetArg(args[n], XmNcursorForeground, tw->primitive.foreground); n++; XtSetArg(args[n], XmNsourceCursorIcon, drag_icon); n++; if (_XmStringSourceGetEditable(GetSrc(w))) { XtSetArg(args[n], XmNdragOperations, (XmDROP_MOVE | XmDROP_COPY)); n++; } else { XtSetArg(args[n], XmNdragOperations, XmDROP_COPY); n++; } (void) XmeDragSource(w, NULL, event, args, n); } /*ARGSUSED*/ static void DragStart(XtPointer data, XtIntervalId *id) /* unused */ { XmTextWidget tw = (XmTextWidget)data; InputData indata = tw->text.input->data; indata->drag_id = 0; StartDrag((Widget)tw, indata->transfer_action->event, indata->transfer_action->params, indata->transfer_action->num_params); } /* ARGSUSED */ static void ProcessBDrag(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; if (data->extending) return; EraseInsertionPoint(tw); if (InSelection(w, event)) { data->sel_start = False; StartDrag(w, event, params, num_params); } else { StartSecondary(w, event, params, num_params); } DisplayInsertionPoint(tw); } static void ProcessBDragEvent(Widget w, XEvent *event, String *params, Cardinal *num_params) { XtEnum drag_on_btn1 = XmOFF; XmDisplay dpy; dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); drag_on_btn1 = dpy->display.enable_btn1_transfer; if (drag_on_btn1 == XmBUTTON2_ADJUST && *num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); else if (*num_params > 1) XtCallActionProc(w, params[1], event, NULL, 0); } /* ARGSUSED */ static Boolean InSelection(Widget w, XEvent *event) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition position, left, right; Position left_x, left_y, right_x, right_y; Position x, y; if (event) { position = (*tw->text.output->XYToPos)(tw, event->xbutton.x, event->xbutton.y); x = event->xbutton.x; } else { position = tw->text.cursor_position; (*tw->text.output->PosToXY)(tw, position, &x, &y); } return ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && (right != left) && ( (position > left && position < right) || ( position == left && (*tw->text.output->PosToXY)(tw, left, &left_x, &left_y) && x > left_x) || ( position == right && (*tw->text.output->PosToXY)(tw, right, &right_x, &right_y) && x < right_x))); } /* ARGSUSED */ static void ProcessBSelect(Widget w, XEvent *event, char **params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; Time event_time = event->xbutton.time; XtEnum drag_on_btn1 = XmOFF; XmDisplay dpy; dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); drag_on_btn1 = dpy->display.enable_btn1_transfer; if (!drag_on_btn1) { if (*num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); return; } if (*num_params == 0) { if (event->type == ButtonPress && InSelection(w, event)) StartDrag(w, event, params, num_params); } else { switch (event->type) { case ButtonPress: if (!InSelection(w, event) || (event_time > data->lasttime && event_time - data->lasttime < XtGetMultiClickTime(XtDisplay(w)))) { if (*num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); } else { if (data->drag_id) XtRemoveTimeOut(data->drag_id); if (data->transfer_action == NULL) { data->transfer_action = (_XmTextActionRec *) XtMalloc(sizeof(_XmTextActionRec)); data->transfer_action->event = (XEvent *)XtMalloc(sizeof(XEvent)); } memcpy((void *)data->transfer_action->event, (void *)event, sizeof(XEvent)); data->transfer_action->params = params; data->transfer_action->num_params = num_params; data->drag_id = XtAppAddTimeOut(XtWidgetToApplicationContext(w), XtGetMultiClickTime(XtDisplay(w)), DragStart, (XtPointer)w); SetSelectionHint(w, event, params, num_params); } break; case ButtonRelease: if (data->drag_id) { XtRemoveTimeOut(data->drag_id); data->drag_id = 0; data->selectionHint.x = data->selectionHint.y = 0; if (*data->transfer_action->num_params) { XtCallActionProc(w, data->transfer_action->params[0], data->transfer_action->event, NULL, 0); } } XtCallActionProc(w, params[0], event, NULL, 0); break; case MotionNotify: if (data->drag_id) { if (dragged(data->selectionHint, event, data->threshold)) { data->selectionHint.x = data->selectionHint.y = 0; XtRemoveTimeOut(data->drag_id); data->drag_id = 0; StartDrag(w, event, params, num_params); } } else if (*num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); break; } } } static void ProcessBSelectEvent(Widget w, XEvent *event, String *params, Cardinal *num_params) { XtEnum drag_on_btn1 = XmOFF; XmDisplay dpy; dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); drag_on_btn1 = dpy->display.enable_btn1_transfer; if (drag_on_btn1 == XmBUTTON2_TRANSFER && *num_params > 0) XtCallActionProc(w, params[0], event, NULL, 0); else if (*num_params > 1) XtCallActionProc(w, params[1], event, NULL, 0); } /* * This routine implements extension of the currently selected text in * the "current" mode (i.e. char word, line, etc.). It worries about * extending from either end of the selection and handles the case when you * cross through the "center" of the current selection (e.g. switch which * end you are extending!). * [NOTE: This routine will be replaced by a set of procedures that * will allows clients to implements a wide class of draw through and * multi-click selection user interfaces.] */ static Boolean dragged(SelectionHint selectionHint, XEvent *event, int threshold) { int xdiff, ydiff; xdiff = event ? abs(selectionHint.x - event->xbutton.x) : 0; ydiff = event ? abs(selectionHint.y - event->xbutton.y) : 0; if((xdiff > threshold) || (ydiff > threshold)) return TRUE; else return FALSE; } /* ARGSUSED */ static void DoExtendedSelection(Widget w, Time ev_time) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition position, left, right, cursorPos; float bal_point; if (data->cancel) { if (data->select_id) XtRemoveTimeOut(data->select_id); data->select_id = 0; return; } _XmTextDisableRedisplay(tw, FALSE); if (!((*tw->text.source->GetSelection) (tw->text.source, &left, &right)) || left == right) { data->anchor = tw->text.dest_position; left = right = tw->text.cursor_position; data->origLeft = data->origRight = data->anchor; bal_point = data->anchor; } else bal_point = (float)(((float)(data->origRight - data->origLeft) / 2.0) + (float)data->origLeft); position = (*tw->text.output->XYToPos)(tw, data->select_pos_x, data->select_pos_y); /* shift anchor and direction to opposite end of the selection */ if ((float)position <= bal_point) { data->anchor = data->origRight; if (!data->extending) data->extendDir = XmsdLeft; } else if ((float)position > bal_point) { data->anchor = data->origLeft; if (!data->extending) data->extendDir = XmsdRight; } data->extending = TRUE; /* check for change in extend direction */ if ((data->extendDir == XmsdRight && position < data->anchor) || (data->extendDir == XmsdLeft && position > data->anchor)) { data->extendDir = (data->extendDir == XmsdRight) ? XmsdLeft : XmsdRight; left = data->origLeft; right = data->origRight; } if (data->extendDir == XmsdRight) { if (data->stype == XmSELECT_OUT_LINE) { right = cursorPos = SelectOutLine(tw, position, XmsdRight, 1); } else { right = cursorPos = (*tw->text.source->Scan)(tw->text.source, position, data->stype, XmsdRight, 1, data->stype == XmSELECT_LINE); } left = data->anchor; } else { if (data->stype == XmSELECT_OUT_LINE) { left = cursorPos = SelectOutLine(tw, position, XmsdLeft, 1); } else { left = cursorPos = (*tw->text.source->Scan)(tw->text.source, position, data->stype, XmsdLeft, 1, FALSE); } if (data->stype == XmSELECT_WORD && (int)tw->text.char_size > 1) { if (position == (*tw->text.source->Scan) (tw->text.source, left, data->stype, XmsdRight, 1, FALSE)) left = cursorPos = position; } right = data->anchor; } (*tw->text.source->SetSelection)(tw->text.source, left, right, ev_time); tw->text.pendingoff = FALSE; _XmTextSetCursorPosition(w, cursorPos); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, ev_time); _XmTextEnableRedisplay(tw); } /* ARGSUSED */ static void DoSecondaryExtend(Widget w, Time ev_time) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition position, left, right; position = (*tw->text.output->XYToPos)(tw, data->select_pos_x, data->select_pos_y); _XmTextDisableRedisplay(tw, FALSE); _XmTextGetSel2(tw, &left, &right); /* check for change in extend direction */ if ((data->Sel2ExtendDir == XmsdRight && position < data->Sel2OrigLeft) || (data->Sel2ExtendDir == XmsdLeft && position > data->Sel2OrigRight)) { data->Sel2ExtendDir = (data->Sel2ExtendDir == XmsdRight) ? XmsdLeft : XmsdRight; left = data->Sel2OrigLeft; right = data->Sel2OrigRight; } if (data->Sel2ExtendDir == XmsdRight) right = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdRight,1, FALSE); else left = (*tw->text.source->Scan)(tw->text.source, position, XmSELECT_POSITION, XmsdLeft, 1, FALSE); (void) _XmTextSetSel2(tw, left, right, ev_time); _XmTextShowPosition(w, position); _XmTextEnableRedisplay(tw); } /************************************************************************ * * * BrowseScroll - timer proc that scrolls the list if the user has left * * the window with the button down. If the button has been * * released, call the standard click stuff. * * * ************************************************************************/ /* ARGSUSED */ static void BrowseScroll(XtPointer closure, XtIntervalId *id) { Widget w = (Widget) closure; XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; int interval = 100; if (data->cancel) { data->select_id = 0; return; } if (!data->select_id) return; if (data->Sel2Extending) DoSecondaryExtend(w, XtLastTimestampProcessed(XtDisplay(w))); else if (data->extending) DoExtendedSelection(w, XtLastTimestampProcessed(XtDisplay(w))); /* ask the vertical scroller its delay */ if (tw->text.output->data->vbar) XtVaGetValues((Widget)tw->text.output->data->vbar, XmNrepeatDelay, &interval, NULL); XSync (XtDisplay(w), False); data->select_id = XtAppAddTimeOut(XtWidgetToApplicationContext(w), (unsigned long)interval, BrowseScroll, (XtPointer) w); } /* ARGSUSED */ static Boolean CheckTimerScrolling(Widget w, XEvent *event) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; OutputData o_data = tw->text.output->data; int interval = 200; if (!event) return False; data->select_pos_x = event->xmotion.x; data->select_pos_y = event->xmotion.y; if ((event->xmotion.x > (int)o_data->leftmargin) && (event->xmotion.x < (int)(tw->core.width - o_data->rightmargin)) && (event->xmotion.y > (int)o_data->topmargin) && (event->xmotion.y < (int)(o_data->topmargin + (o_data->lineheight * o_data->number_lines)))) { if (data->select_id) { XtRemoveTimeOut(data->select_id); data->select_id = 0; } } else { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { /* to the above of the text */ if (event->xmotion.y <= (int) o_data->topmargin) data->select_pos_y = (Position) (o_data->topmargin - (o_data->font_ascent + o_data->font_descent + 1)); /* to the below of the text */ else if (event->xmotion.y >= (int) (tw->core.height - o_data->bottommargin)) data->select_pos_y = (Position) ((tw->core.height - o_data->bottommargin) + (o_data->font_ascent + o_data->font_descent + 1)); /* right the text */ if (event->xmotion.x >= (int) (tw->core.width - o_data->rightmargin)) { data->select_pos_x = (int) ((tw->core.width - o_data->rightmargin) + o_data->linewidth); if (tw->text.top_line == 0) data->select_pos_x = tw->core.width; /* left the text */ } else if (event->xmotion.x <= (int) ((tw->core.width - o_data->rightmargin) - (o_data->linewidth * (o_data->number_lines + 1)))) data->select_pos_y = (tw->core.width - o_data->rightmargin) - (o_data->linewidth * (o_data->number_lines + 1)); /* ask the vertical scroller its delay */ if (o_data->hbar) XtVaGetValues(o_data->hbar, XmNinitialDelay, &interval, NULL); } else { /* to the left of the text */ if (event->xmotion.x <= (int) o_data->leftmargin) data->select_pos_x = (Position) (o_data->leftmargin - (o_data->averagecharwidth + 1)); /* to the right of the text */ else if (event->xmotion.x >= (int) (tw->core.width - o_data->rightmargin)) data->select_pos_x = (Position) ((tw->core.width - o_data->rightmargin) + o_data->averagecharwidth + 1); /* above the text */ if (event->xmotion.y <= (int) o_data->topmargin) { data->select_pos_y = (int) (o_data->topmargin - o_data->lineheight); if (tw->text.top_line == 0) data->select_pos_x = 0; /* below the text */ } else if (event->xmotion.y >= (int) (o_data->topmargin + (o_data->lineheight * o_data->number_lines))) data->select_pos_y = o_data->topmargin + (o_data->lineheight * (o_data->number_lines + 1)); /* ask the vertical scroller its delay */ if (o_data->vbar) XtVaGetValues(o_data->vbar, XmNinitialDelay, &interval, NULL); } if (!data->select_id) data->select_id = XtAppAddTimeOut(XtWidgetToApplicationContext(w), interval, BrowseScroll, (XtPointer) w); return True; } return False; } /* ARGSUSED */ static void StartExtendSelection(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; _XmTextResetIC(w); data->cancel = False; data->stuffpos = tw->text.cursor_position; ExtendSelection(w, event, params, num_params); } /* ARGSUSED */ static void ExtendSelection(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; OutputData o_data = tw->text.output->data; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay(w)); if (data->cancel) return; _XmTextResetIC(w); EraseInsertionPoint(tw); if (!o_data->hasfocus && _XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); if (data->selectionHint.x || data->selectionHint.y) { if(!dragged(data->selectionHint, event, data->threshold)) { DisplayInsertionPoint(tw); return; } a_Selection(tw, data->selectionHint.x, data->selectionHint.y, event_time, False); data->selectionHint.x = data->selectionHint.y = 0; data->extending = True; } if (!CheckTimerScrolling(w, event)) DoExtendedSelection(w, event_time); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void ExtendSecondary(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition position, hintposition; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay(w)); if (data->cancel) return; _XmTextResetIC(w); EraseInsertionPoint(tw); if (event) position = (*tw->text.output->XYToPos)(tw, event->xbutton.x, event->xbutton.y); else position = tw->text.cursor_position; if(data->Sel2Hint.x || data->Sel2Hint.y) { if(!dragged(data->Sel2Hint, event, data->threshold)) { DisplayInsertionPoint(tw); return; } hintposition = (*tw->text.output->XYToPos)(tw, data->Sel2Hint.x, data->Sel2Hint.y); if(position < hintposition) { data->Sel2Extending = _XmTextSetSel2(tw, position, hintposition, event_time); data->Sel2OrigLeft = hintposition; /**/ data->Sel2OrigRight = hintposition; data->Sel2ExtendDir = XmsdLeft; } else { data->Sel2Extending = _XmTextSetSel2(tw, hintposition, position, event_time); data->Sel2OrigLeft = hintposition; data->Sel2OrigRight = hintposition; /**/ data->Sel2ExtendDir = XmsdRight; } data->Sel2Hint.x = data->Sel2Hint.y = 0; } if(!data->Sel2Extending) { DisplayInsertionPoint(tw); return; } if (!CheckTimerScrolling(w, event)) DoSecondaryExtend(w, event_time); DisplayInsertionPoint(tw); } static void ExtendEnd(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; _XmTextResetIC(w); if(data->extending || dragged(data->selectionHint, event, data->threshold)) { ExtendSelection(w, event, params, num_params); (*tw->text.source->GetSelection)(tw->text.source, &(data->origLeft), &(data->origRight)); } if (data->select_id) { XtRemoveTimeOut(data->select_id); data->select_id = 0; } data->select_pos_x = 0; data->select_pos_y = 0; data->extending = FALSE; data->selectionHint.x = data->selectionHint.y = 0; if (!data->sel_start) data->cancel = True; } /* ARGSUSED */ static void DoGrabFocus(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; OutputData o_data = tw->text.output->data; _XmTextResetIC(w); data->cancel = False; if (event) { if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { /* to the top of the text */ if (event->xbutton.y <= (int) o_data->topmargin) event->xbutton.y = (Position) (o_data->topmargin + 1); /* to the bottom of the text */ else if (event->xbutton.y >= (int) (tw->core.height - o_data->bottommargin)) event->xbutton.y = (Position)((tw->core.height - o_data->bottommargin)- 1); /* above the text */ if (event->xbutton.x >= (int) (tw->core.width - o_data->rightmargin)) event->xbutton.x = (int) (tw->core.width - o_data->rightmargin) - 1; /* below the text */ else if (event->xbutton.x <= (int)(tw->core.width - o_data->rightmargin - (o_data->linewidth * o_data->number_lines))) event->xbutton.x = ((int)(tw->core.width - o_data->rightmargin) - (o_data->linewidth * o_data->number_lines)) + 1; } else { /* to the left of the text */ if (event->xbutton.x <= (int) o_data->leftmargin) event->xbutton.x = (Position) (o_data->leftmargin + 1); /* to the right of the text */ else if (event->xbutton.x >= (int) (tw->core.width - o_data->rightmargin)) event->xbutton.x = (Position)((tw->core.width - o_data->rightmargin)- 1); /* above the text */ if (event->xbutton.y <= (int) o_data->topmargin) event->xbutton.y = (int) (o_data->topmargin + 1); /* below the text */ else if (event->xbutton.y >= (int)(o_data->topmargin + (o_data->lineheight * o_data->number_lines))) event->xbutton.y = (o_data->topmargin + (o_data->lineheight * o_data->number_lines)) - 1; } } /* CR 9058: "No-op" calls to traversal may generate focus events. */ if ((_XmGetFocusPolicy(w) == XmEXPLICIT) && (XmGetFocusWidget(w) != w)) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); StartPrimary(w, event, params, num_params); if (data->stype == XmSELECT_POSITION) SetCursorPosition(w, event, params, num_params); else if (tw->text.add_mode) { EraseInsertionPoint(tw); tw->text.add_mode = False; DisplayInsertionPoint(tw); } data->stuffpos = tw->text.cursor_position; } /* ARGSUSED */ static void MoveDestination(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition new_pos, left, right; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); _XmTextResetIC(w); EraseInsertionPoint(tw); if (event) new_pos = (*tw->text.output->XYToPos)(tw, event->xbutton.x, event->xbutton.y); else new_pos = tw->text.cursor_position; if ((*tw->text.source->GetSelection)(tw->text.source, &left, &right) && (right != left)) _XmTextSetDestinationSelection(w, new_pos, False, event_time); tw->text.pendingoff = False; if (_XmGetFocusPolicy(w) == XmEXPLICIT) (void) XmProcessTraversal(w, XmTRAVERSE_CURRENT); _XmTextSetCursorPosition(w, new_pos); if (tw->text.cursor_position < left || tw->text.cursor_position > right) tw->text.pendingoff = TRUE; DisplayInsertionPoint(tw); } /* This function make the request to do a primary paste */ /* ARGSUSED */ static void Stuff(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XPoint *point = NULL; InputData data = tw->text.input->data; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay(w)); _XmTextResetIC(w); /* Request targets from the selection owner so you can decide what to * request. The decision process and request for the selection is * taken care of in HandleTargets(). */ if (event && event->type == ButtonRelease) { /* WARNING: do not free the following memory in this module. * It will be freed in FreeLocationData, triggered at the end of * the data transfer operation. */ point = (XPoint *) XtMalloc(sizeof(XPoint)); point->x = event->xbutton.x; point->y = event->xbutton.y; } if (!event_time) event_time = _XmValidTimestamp(w); if (data->selectionLink) XmePrimarySink(w, XmLINK, (XtPointer) point, event_time); else if (data->selectionMove) XmePrimarySink(w, XmMOVE, (XtPointer) point, event_time); else XmePrimarySink(w, XmCOPY, (XtPointer) point, event_time); } /* ARGSUSED */ void _XmTextHandleSecondaryFinished(Widget w, XEvent *event) { XmTextWidget tw = (XmTextWidget) w; XmTextWidget dest_tw; InputData data = tw->text.input->data; TextDestData dest_data; long adjustment = 0; XmTextBlockRec block, newblock; XmTextPosition left, right; XmTextPosition cursorPos; Boolean freeBlock; Time time = XtLastTimestampProcessed(XtDisplay(w)); dest_data = GetTextDestData(w); dest_tw = dest_data->widget; if (dest_data->has_destination) { adjustment = data->sel2Right - data->sel2Left; if (dest_data->position <= data->sel2Left) { data->sel2Left -= dest_data->replace_length; data->sel2Right += adjustment - dest_data->replace_length; } else if (dest_data->position > data->sel2Left && dest_data->position < data->sel2Right) { data->sel2Left -= dest_data->replace_length; data->sel2Right += adjustment - dest_data->replace_length; } } left = data->sel2Left; right = data->sel2Right; (void) _XmTextSetSel2(tw, 1, 0, time); block.ptr = ""; block.length = 0; block.format = XmFMT_8_BIT; if (dest_data->position <= data->sel2Left) left += adjustment; if (_XmTextModifyVerify(tw, NULL, &left, &right, &cursorPos, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, NULL, &left, &right, &newblock, False) != EditDone) { RingBell(w, NULL, (String *) NULL, (Cardinal) 0); } else { int count; count = _XmTextCountCharacters(newblock.ptr, newblock.length); if (dest_data->has_destination && dest_data->position > right) { if (cursorPos == left + count) cursorPos = dest_data->position + count; if (!dest_data->quick_key) _XmTextSetCursorPosition((Widget)dest_tw, cursorPos); _XmTextSetDestinationSelection((Widget)dest_tw, dest_tw->text.cursor_position, False, time); } else if (count > 0 && dest_data->has_destination) { if (!dest_data->quick_key) _XmTextSetCursorPosition((Widget)dest_tw, cursorPos); _XmTextSetDestinationSelection((Widget)dest_tw, dest_tw->text.cursor_position, False, time); } if (!_XmStringSourceHasSelection(dest_tw->text.source)) { dest_tw->text.input->data->anchor = dest_data->position; } if (!dest_data->has_destination && tw->text.add_mode) { EraseInsertionPoint(tw); tw->text.add_mode = False; DisplayInsertionPoint(tw); } _XmTextValueChanged(tw, event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { RingBell(w, NULL, (String *) NULL, (Cardinal) 0); } } /* Send a client message to perform the quick cut/copy and paste */ /* ARGSUSED */ static void SecondaryNotify(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextWidget dest_tw; InputData data = tw->text.input->data; TextDestData dest_data; XmTextPosition left, right; Time event_time = event ? event->xbutton.time : XtLastTimestampProcessed(XtDisplay(w)); _XmTextResetIC(w); if (data->selectionMove == TRUE && data->has_destination && tw->text.dest_position >= data->sel2Left && tw->text.dest_position <= data->sel2Right) { (void)_XmTextSetSel2(tw, 1, 0, event_time); return; } dest_data = GetTextDestData(w); dest_data->replace_length = 0; dest_tw = tw; if (!dest_tw->text.input->data->has_destination && dest_tw->text.source->data->numwidgets > 1) { int i; for (i=0; itext.source->data->numwidgets; i++) { dest_tw = (XmTextWidget) tw->text.source->data->widgets[i]; if (dest_tw->text.input->data->has_destination) break; } if (i == tw->text.source->data->numwidgets) dest_tw = tw; } dest_data->has_destination = dest_tw->text.input->data->has_destination; dest_data->position = dest_tw->text.dest_position; dest_data->widget = dest_tw; if (*(num_params) == 1) dest_data->quick_key = True; else dest_data->quick_key = False; if ((*dest_tw->text.source->GetSelection) (dest_tw->text.source, &left, &right) && left != right) { if (dest_data->position >= left && dest_data->position <= right) dest_data->replace_length = right - left; } /* special fix for handling case of shared source with secondary select */ _XmTextSetHighlight((Widget) data->widget, data->sel2Left, data->sel2Right, XmHIGHLIGHT_NORMAL); /* * Make a request for the primary selection to convert to * type INSERT_SELECTION as per ICCCM. */ if (!event_time) event_time = _XmValidTimestamp(w); if (data->selectionLink) XmeSecondaryTransfer(w, XmeGetEncodingAtom(w), XmLINK, event_time); else if (data->selectionMove) XmeSecondaryTransfer(w, XmeGetEncodingAtom(w), XmMOVE, event_time); else XmeSecondaryTransfer(w, XmeGetEncodingAtom(w), XmCOPY, event_time); } /* ARGSUSED */ static void VoidAction(Widget w, XEvent *event, String *params, Cardinal *num_params) { /* Do Nothing */ } /* * This function set the final position of the secondary selection and * calls SecondaryNotify(). */ static void ExtendSecondaryEnd(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (!data->cancel) XtUngrabKeyboard(w, CurrentTime); /* if the pointer is inside the text area, do the secondary transfer */ if (event) if (event->xbutton.x > (int) tw->core.width || event->xbutton.x < 0 || event->xbutton.y > (int) tw->core.height || event->xbutton.y < 0) { if (data->hasSel2 && data->Sel2Extending) { data->cancel = True; _XmTextSetSel2(tw, 1, 0, event_time); } } if ((data->Sel2Extending || dragged(data->Sel2Hint, event, data->threshold)) && !data->cancel) { _XmTextGetSel2(tw, &(data->Sel2OrigLeft), &(data->Sel2OrigRight)); SecondaryNotify(w, event, params, num_params); } /* Re-initialize the secondary selection data */ data->select_pos_x = 0; data->select_pos_y = 0; data->Sel2Extending = FALSE; data->Sel2Hint.x = data->Sel2Hint.y = 0; data->sel_start = False; if (data->select_id) { XtRemoveTimeOut(data->select_id); data->select_id = 0; } data->cancel = True; } /* * This Action Proc selects all of the text. */ /* ARGSUSED */ static void SelectAll(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition last_position = (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdRight, 1, TRUE); Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); data->stype = XmSELECT_ALL; (*tw->text.source->SetSelection)(tw->text.source, 0, last_position, event_time); _XmTextMovingCursorPosition(tw, tw->text.cursor_position); data->anchor = 0; DisplayInsertionPoint(tw); } /* * This Action Proc deselects all of the text. */ /* ARGSUSED */ static void DeselectAll(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmTextPosition cursorPos = tw->text.cursor_position; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); _XmTextSetDestinationSelection(w, cursorPos, False, event_time); data->stype = XmSELECT_POSITION; (*tw->text.source->SetSelection)(tw->text.source, cursorPos, cursorPos, event_time); _XmTextMovingCursorPosition(tw, tw->text.cursor_position); data->anchor = cursorPos; DisplayInsertionPoint(tw); } /* * This Action Proc replaces the primary selection with spaces */ /* ARGSUSED */ static void ClearSelection(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextPosition left, right; Boolean freeBlock; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); EraseInsertionPoint(tw); if (!(*tw->text.source->GetSelection) (tw->text.source, &left, &right)) { XBell(XtDisplay(tw), 0); } else if (left != right) { char *select_string = _XmStringSourceGetString(tw, left, right, False); XmTextBlockRec block, newblock; int num_spaces = right - left; int i; for(i = 0; i < num_spaces; i++) { if (select_string[i] != '\012') select_string[i] = ' '; } block.ptr = select_string; block.length = num_spaces; block.format = XmFMT_8_BIT; if (_XmTextModifyVerify(tw, event, &left, &right, NULL, &block, &newblock, &freeBlock)) { if ((*tw->text.source->Replace)(tw, NULL, &left, &right, &newblock, False) != EditDone) { RingBell(w, event, params, num_params); } else { /* should we set cursor position? */ _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, event_time); _XmTextValueChanged(tw, event); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else { RingBell(w, event, params, num_params); } XtFree(select_string); } DisplayInsertionPoint(tw); } static void ProcessBDragRelease(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XButtonEvent *ev = (XButtonEvent *) event; if (data->extending) return; /* For Btn2up when Btn1 is down */ /* Work around for intrinsic bug. Remove once bug is fixed. */ XtUngrabPointer(w, ev->time); EraseInsertionPoint(tw); if (data->sel_start) { if (dragged(data->Sel2Hint, event, data->threshold)) { if (data->Sel2Extending) { /* * Secondary selection: * Causes the converter to perform a delete action of the * secondary selection when the Convert routine is called. */ ExtendSecondaryEnd(w, event, params, num_params); } else { /* Not a drag action, not secondary selection, not Quick transfer. * At least we have to ungrab the keyboard... */ if (!data->cancel) XtUngrabKeyboard(w, CurrentTime); } } else { /* * Quick transfer: Copy contents of primary selection to the * stuff position found above. */ Stuff(w, event, params, num_params); if (!data->cancel) XtUngrabKeyboard(w, CurrentTime); } data->sel_start = False; } DisplayInsertionPoint(tw); } /* * This function does a primary copy and paste on mouse button actions. * It copies the contents of the primary selection to the x and y * position of the button pressed event. */ static void ProcessCopy(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; _XmTextResetIC(w); EraseInsertionPoint(tw); data->selectionMove = False; data->selectionLink = False; ProcessBDragRelease(w, event, params, num_params); DisplayInsertionPoint(tw); data->cancel = True; } /* * This function does a primary link on mouse button actions. * It links the contents of the primary selection to the x and y * position of the button pressed event. */ static void ProcessLink(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; EraseInsertionPoint(tw); data->selectionMove = False; data->selectionLink = True; ProcessBDragRelease(w, event, params, num_params); DisplayInsertionPoint(tw); data->cancel = True; } /* This function does a primary cut and paste on mouse button actions. */ static void ProcessMove(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; _XmTextResetIC(w); EraseInsertionPoint(tw); data->selectionMove = True; data->selectionLink = False; ProcessBDragRelease(w, event, params, num_params); DisplayInsertionPoint(tw); data->cancel = True; } /* This function does a primary copy and paste on keyboard actions. */ static void CopyPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; _XmTextResetIC(w); EraseInsertionPoint(tw); data->selectionMove = False; data->selectionLink = FALSE; /* perform the primary paste action */ Stuff(w, event, params, num_params); DisplayInsertionPoint(tw); } /* This function does a primary cut and paste on keyboard actions. */ static void CutPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; _XmTextResetIC(w); EraseInsertionPoint(tw); data->selectionMove = True; data->selectionLink = FALSE; /* perform the primary paste action */ Stuff(w, event, params, num_params); DisplayInsertionPoint(tw); } /* This function does a primary link on keyboard actions. */ static void LinkPrimary(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; EraseInsertionPoint(tw); data->selectionMove = False; data->selectionLink = True; /* perform the primary paste action */ Stuff(w, event, params, num_params); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void CutClipboard(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextSource source = GetSrc(tw); XmTextPosition left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (!event_time) event_time = _XmValidTimestamp(w); EraseInsertionPoint(tw); if (_XmStringSourceGetEditable(GetSrc(w)) && (*source->GetSelection)(source, &left, &right) && right != left) XmeClipboardSource(w, XmMOVE, event_time); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void CopyClipboard(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; XmTextSource source = GetSrc(w); XmTextPosition left, right; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); if (!event_time) event_time = _XmValidTimestamp(w); EraseInsertionPoint(tw); if ((*source->GetSelection)(source, &left, &right) && right != left) XmeClipboardSource(w, XmCOPY, event_time); _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, event_time); DisplayInsertionPoint(tw); } /* ARGSUSED */ static void PasteClipboard(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; EraseInsertionPoint(tw); data->selectionMove = FALSE; data->selectionLink = FALSE; XmeClipboardSink(w, XmCOPY, NULL); DisplayInsertionPoint(tw); } static Boolean VerifyLeave(Widget w, XEvent *event) { XmTextWidget tw = (XmTextWidget) w; XmTextVerifyCallbackStruct cbdata; cbdata.reason = XmCR_LOSING_FOCUS; cbdata.event = event; cbdata.doit = True; cbdata.currInsert = tw->text.cursor_position; cbdata.newInsert = tw->text.cursor_position; cbdata.startPos = tw->text.cursor_position; cbdata.endPos = tw->text.cursor_position; cbdata.text = NULL; XtCallCallbackList(w, tw->text.losing_focus_callback, (XtPointer) &cbdata); tw->text.source->data->take_selection = True; return(cbdata.doit); } /* ARGSUSED */ static void TextLeave(Widget w, XEvent *event, String *params, Cardinal *num_params) { if (_XmGetFocusPolicy(w) == XmPOINTER) VerifyLeave(w, event); _XmPrimitiveLeave(w, event, params, num_params); } /* ARGSUSED */ static void TextFocusIn(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (!event || !event->xfocus.send_event) return; if (_XmGetFocusPolicy(w) == XmEXPLICIT && !_XmTextHasDestination(w) && !tw->text.input->data->sel_start) _XmTextSetDestinationSelection(w, tw->text.cursor_position, False, XtLastTimestampProcessed(XtDisplay(w))); _XmPrimitiveFocusIn(w, event, params, num_params); } /* ARGSUSED */ static void TextFocusOut(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; /* If traversal is on, then the leave verification callback is called in the traversal event handler */ if (event && event->xfocus.send_event && _XmGetFocusPolicy(w) == XmEXPLICIT && !tw->text.traversed) { (void) VerifyLeave(w, event); } else if (tw->text.traversed) tw->text.traversed = False; _XmPrimitiveFocusOut(w, event, params, num_params); } /* ARGSUSED */ static void TraverseDown(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; /* Find out if there is anything else to traverse to */ /* Allow the verification routine to control the traversal */ if (tw->primitive.navigation_type == XmNONE && VerifyLeave(w, event)) { tw->text.traversed = True; if (!_XmMgrTraversal(w, XmTRAVERSE_DOWN)) tw->text.traversed = False; } } /* ARGSUSED */ static void TraverseUp(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; /* Allow the verification routine to control the traversal */ if (tw->primitive.navigation_type == XmNONE && VerifyLeave(w, event)) { tw->text.traversed = True; if (!_XmMgrTraversal(w, XmTRAVERSE_UP)) tw->text.traversed = False; } } /* ARGSUSED */ static void TraverseHome(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; /* Allow the verification routine to control the traversal */ if (tw->primitive.navigation_type == XmNONE && VerifyLeave(w, event)) { tw->text.traversed = True; if (!_XmMgrTraversal(w, XmTRAVERSE_HOME)) tw->text.traversed = False; } } /* ARGSUSED */ static void TraverseNextTabGroup(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; /* Allow the verification routine to control the traversal */ if (VerifyLeave(w, event)) { XmTraversalDirection dir; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean enable_button_tab = xm_dpy->display.enable_button_tab; dir = (enable_button_tab ? XmTRAVERSE_GLOBALLY_FORWARD : XmTRAVERSE_NEXT_TAB_GROUP); tw->text.traversed = True; if (!_XmMgrTraversal(w, dir)) tw->text.traversed = False; } } /* ARGSUSED */ static void TraversePrevTabGroup(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; /* Allow the verification routine to control the traversal */ if (VerifyLeave(w, event)) { XmTraversalDirection dir; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean enable_button_tab = xm_dpy->display.enable_button_tab; dir = (enable_button_tab ? XmTRAVERSE_GLOBALLY_BACKWARD : XmTRAVERSE_PREV_TAB_GROUP); tw->text.traversed = True; if (!_XmMgrTraversal(w, dir)) tw->text.traversed = False; } } /*************************************************************************** * Functions to process text tw in multi-line edit mode versus single * * line edit mode. * ***************************************************************************/ /* ARGSUSED */ static void ProcessCancel(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; InputData data = tw->text.input->data; XmParentInputActionRec p_event; Time event_time = event ? event->xkey.time : XtLastTimestampProcessed(XtDisplay((Widget)tw)); data->cancel = False; p_event.process_type = XmINPUT_ACTION; p_event.action = XmPARENT_CANCEL; p_event.event = event; /* Pointer to XEvent. */ p_event.params = params; /* Or use what you have if */ p_event.num_params = num_params; /* input is from translation.*/ EraseInsertionPoint(tw); if (data->sel_start) { data->cancel = True; if (data->hasSel2 && data->Sel2Extending) _XmTextSetSel2(tw, 1, 0, event_time); XtUngrabKeyboard(w, CurrentTime); } if (_XmStringSourceHasSelection(tw->text.source) && data->extending) { data->cancel = True; /* restore cursor position */ _XmTextSetCursorPosition((Widget)tw, data->stuffpos); _XmTextSetDestinationSelection((Widget)tw, tw->text.cursor_position, False, event_time); /* reset origLeft and origRight */ (*tw->text.source->SetSelection)(tw->text.source, data->origLeft, data->origRight, event_time); } if (!data->cancel) (void) _XmParentProcess(XtParent(tw), (XmParentProcessData) &p_event); if (data->select_id) { XtRemoveTimeOut(data->select_id); data->select_id = 0; } DisplayInsertionPoint(tw); data->cancel = True; } static void ProcessReturn(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) Activate(w, event, params, num_params); else { EraseInsertionPoint(tw); InsertNewLine(w, event, params, num_params); DisplayInsertionPoint(tw); } } static void ProcessTab(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (tw->text.edit_mode == XmSINGLE_LINE_EDIT || !_XmStringSourceGetEditable(GetSrc(w))) if (*num_params == 0 || *(params[0]) == 'N') TraverseNextTabGroup(w, event, params, num_params); else TraversePrevTabGroup(w, event, params, num_params); else if (*num_params == 0 || *(params[0]) == 'N') SelfInsert(w, event, params, num_params); /* do nothing for shift+Tab in multiline mode */ } static void ProcessUp(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (tw->text.edit_mode == XmMULTI_LINE_EDIT) { EraseInsertionPoint(tw); MovePreviousLine(w, event, params, num_params); DisplayInsertionPoint(tw); } else if (w != XmGetTabGroup(w)) TraverseUp(w, event, params, num_params); } static void ProcessDown(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (tw->text.edit_mode == XmMULTI_LINE_EDIT) { EraseInsertionPoint(tw); MoveNextLine(w, event, params, num_params); DisplayInsertionPoint(tw); } else if (w != XmGetTabGroup(w)) TraverseDown(w, event, params, num_params); } static void ProcessLeft(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (tw->text.edit_mode == XmMULTI_LINE_EDIT) { EraseInsertionPoint(tw); MoveNextLine(w, event, params, num_params); DisplayInsertionPoint(tw); } else if (w != XmGetTabGroup(w)) TraverseDown(w, event, params, num_params); } static void ProcessRight(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (tw->text.edit_mode == XmMULTI_LINE_EDIT) { EraseInsertionPoint(tw); MovePreviousLine(w, event, params, num_params); DisplayInsertionPoint(tw); } else if (w != XmGetTabGroup(w)) TraverseUp(w, event, params, num_params); } static void ProcessShiftUp(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { TraverseUp(w, event, params, num_params); } else { char *dir = "extend"; Cardinal num = 1; EraseInsertionPoint(tw); _MovePreviousLine(w, event, &dir, &num, False); DisplayInsertionPoint(tw); } } static void ProcessShiftDown(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; _XmTextResetIC(w); if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { TraverseDown(w, event, params, num_params); } else { char *dir = "extend"; Cardinal num = 1; EraseInsertionPoint(tw); _MoveNextLine(w, event, &dir, &num, False); DisplayInsertionPoint(tw); } } static void ProcessShiftLeft(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { TraverseUp(w, event, params, num_params); } else { char *dir = "extend"; Cardinal num = 1; EraseInsertionPoint(tw); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) _MoveNextLine(w, event, &dir, &num, False); else _MovePreviousLine(w, event, &dir, &num, False); DisplayInsertionPoint(tw); } } static void ProcessShiftRight(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { TraverseDown(w, event, params, num_params); } else { char *dir = "extend"; Cardinal num = 1; EraseInsertionPoint(tw); if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) _MovePreviousLine(w, event, &dir, &num, False); else _MoveNextLine(w, event, &dir, &num, False); DisplayInsertionPoint(tw); } } static void ProcessHome(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmTextWidget tw = (XmTextWidget) w; EraseInsertionPoint(tw); MoveToLineStart(w, event, params, num_params); DisplayInsertionPoint(tw); } static XtActionsRec ZdefaultTextActionsTable[] = { /* Insert bindings */ {"self-insert", SelfInsert}, {"insert-string", InsertString}, /* Motion bindings */ {"grab-focus", DoGrabFocus}, {"set-insertion-point", SetCursorPosition}, {"forward-character", MoveForwardChar}, {"backward-character", MoveBackwardChar}, {"forward-word", MoveForwardWord}, {"backward-word", MoveBackwardWord}, {"forward-paragraph", MoveForwardParagraph}, {"backward-paragraph", MoveBackwardParagraph}, {"beginning-of-line", MoveToLineStart}, {"end-of-line", MoveToLineEnd}, {"next-line", MoveNextLine}, {"previous-line", MovePreviousLine}, {"next-page", MoveNextPage}, {"previous-page", MovePreviousPage}, {"page-left", MovePageLeft}, {"page-right", MovePageRight}, {"beginning-of-file", MoveBeginningOfFile}, {"end-of-file", MoveEndOfFile}, {"move-destination", MoveDestination}, {"scroll-one-line-up", ScrollOneLineUp}, {"scroll-one-line-down", ScrollOneLineDown}, {"scroll-cursor-vertically", ScrollCursorVertically}, /* Delete bindings */ {"delete-selection", DeleteCurrentSelection}, {"delete-next-character", DeleteForwardChar}, {"delete-previous-character", DeleteBackwardChar}, {"delete-next-word", DeleteForwardWord}, {"delete-previous-word", DeleteBackwardWord}, {"delete-to-end-of-line", DeleteToEndOfLine}, {"delete-to-start-of-line", DeleteToStartOfLine}, /* Kill bindings */ {"kill-selection", KillCurrentSelection}, {"kill-next-character", KillForwardChar}, {"kill-previous-character", KillBackwardChar}, {"kill-next-word", KillForwardWord}, {"kill-previous-word", KillBackwardWord}, {"kill-to-end-of-line", KillToEndOfLine}, {"kill-to-start-of-line", KillToStartOfLine}, /* Unkill bindings */ {"unkill", UnKill}, {"stuff", Stuff}, /* New line bindings */ {"newline-and-indent", InsertNewLineAndIndent}, {"newline-and-backup", InsertNewLineAndBackup}, {"newline", InsertNewLine}, /* Selection bindings */ {"select-all", SelectAll}, {"deselect-all", DeselectAll}, {"select-start", StartPrimary}, {"quick-cut-set", VoidAction}, {"quick-copy-set", VoidAction}, {"do-quick-action", VoidAction}, {"key-select", KeySelection}, {"set-anchor", SetAnchor}, {"select-adjust", DoSelection}, {"select-end", DoSelection}, {"extend-start", StartExtendSelection}, {"extend-adjust", ExtendSelection}, {"extend-end", ExtendEnd}, {"set-selection-hint", SetSelectionHint}, {"process-bdrag", ProcessBDrag}, {"process-bdrag-event", ProcessBDragEvent}, {"process-bselect", ProcessBSelect}, {"process-bselect-event", ProcessBSelectEvent}, {"secondary-start", StartSecondary}, {"secondary-drag", StartDrag}, {"secondary-adjust", ExtendSecondary}, {"secondary-notify", ExtendSecondaryEnd}, {"clear-selection", ClearSelection}, {"copy-to", ProcessCopy}, {"link-to", ProcessLink}, {"move-to", ProcessMove}, {"copy-primary", CopyPrimary}, {"cut-primary", CutPrimary}, {"link-primary", LinkPrimary}, /* Clipboard bindings */ {"copy-clipboard", CopyClipboard}, {"cut-clipboard", CutClipboard}, {"paste-clipboard", PasteClipboard}, /* Miscellaneous bindings */ {"beep", RingBell}, {"redraw-display", RedrawDisplay}, {"activate", Activate}, {"toggle-overstrike", ToggleOverstrike}, {"toggle-add-mode", ToggleAddMode}, {"Help", _XmPrimitiveHelp}, {"enter", _XmPrimitiveEnter}, {"leave", TextLeave}, {"focusIn", TextFocusIn}, {"focusOut", TextFocusOut}, {"unmap", _XmPrimitiveUnmap}, /* Process multi-line and single line bindings */ {"process-cancel", ProcessCancel}, {"process-return", ProcessReturn}, {"process-tab", ProcessTab}, {"process-up", ProcessUp}, {"process-down", ProcessDown}, {"process-shift-up", ProcessShiftUp}, {"process-shift-down", ProcessShiftDown}, {"process-home", ProcessHome}, /* Traversal bindings*/ {"traverse-next", TraverseDown}, {"traverse-prev", TraverseUp}, {"traverse-home", TraverseHome}, {"next-tab-group", TraverseNextTabGroup}, {"prev-tab-group", TraversePrevTabGroup}, {"page-up", MovePageUp}, {"page-down", MovePageDown}, {"process-left", ProcessLeft}, {"process-right", ProcessRight}, {"process-shift-left", ProcessShiftLeft}, {"process-shift-right", ProcessShiftRight}, }; externaldef(nonvisible) XtPointer _XmdefaultTextActionsTable = (XtPointer) ZdefaultTextActionsTable; externaldef(nonvisible) Cardinal _XmdefaultTextActionsTableSize = XtNumber(ZdefaultTextActionsTable); /* added event */ #define _XmTextEventBindings1 _XmTextIn_XmTextEventBindings1 #define _XmTextEventBindings2 _XmTextIn_XmTextEventBindings2 #define _XmTextEventBindings3 _XmTextIn_XmTextEventBindings3 #define _XmTextVEventBindings _XmTextIn_XmTextVEventBindings /* ARGSUSED */ static void Invalidate(XmTextWidget tw, XmTextPosition position, XmTextPosition topos, long delta) { InputData data = tw->text.input->data; if (delta == NODELTA) return; /* Just use what we have as best guess. */ if (data->origLeft > position) data->origLeft += delta; if (data->origRight >= position) data->origRight += delta; } static void InputGetValues(Widget wid, ArgList args, Cardinal num_args) { XmTextWidget tw = (XmTextWidget) wid; XtGetSubvalues((XtPointer) tw->text.input->data, input_resources, XtNumber(input_resources), args, num_args); } /* ARGSUSED */ static void InputSetValues(Widget oldw, Widget reqw, Widget new_w, ArgList args, Cardinal *num_args) { XmTextWidget tw = (XmTextWidget) new_w; InputData data = tw->text.input->data; XtPointer temp_ptr; temp_ptr = (XtPointer)data->sarray; XtSetSubvalues((XtPointer) data, input_resources, XtNumber(input_resources), args, *num_args); /* * Fix for HaL DTS 9841 - If the new selectionArray is different than the old * selectionArray, delete the old selectionArray and * then copy the new selectionArray. */ if ((XtPointer)data->sarray != temp_ptr) { XtFree((char *)temp_ptr); temp_ptr = (XtPointer)data->sarray; data->sarray = (XmTextScanType *)XtMalloc(data->sarraycount * sizeof(XmTextScanType)); memcpy((void *)data->sarray, (void *)temp_ptr, (data->sarraycount * sizeof(XmTextScanType))); } /* * End Fix for HaL DTS 9841 */ } static void InputDestroy(Widget w) { XmTextWidget tw = (XmTextWidget) w; Atom MOTIF_DESTINATION = XInternAtom(XtDisplay(tw), XmS_MOTIF_DESTINATION, False); Widget dest = XmGetDestination(XtDisplay(w)); if (dest == w) _XmSetDestination(XtDisplay(w), NULL); if (tw->core.window == XGetSelectionOwner(XtDisplay(tw), MOTIF_DESTINATION)) XtDisownSelection(w, MOTIF_DESTINATION, XtLastTimestampProcessed(XtDisplay(w))); if (tw->core.window == XGetSelectionOwner(XtDisplay(tw), XA_PRIMARY)) XtDisownSelection(w, XA_PRIMARY, XtLastTimestampProcessed(XtDisplay(w))); if (tw->core.window == XGetSelectionOwner(XtDisplay(tw), XA_SECONDARY)) XtDisownSelection(w, XA_SECONDARY, XtLastTimestampProcessed(XtDisplay(w))); if (tw->text.input->data->drag_id) XtRemoveTimeOut(tw->text.input->data->drag_id); if (tw->text.input->data->select_id) XtRemoveTimeOut(tw->text.input->data->select_id); if (tw->text.input->data->transfer_action) { XtFree((char *)tw->text.input->data->transfer_action->event); XtFree((char *)tw->text.input->data->transfer_action); } /* * Fix for HaL DTS 9841 - release the data for the selectionArray. */ XtFree((char *)tw->text.input->data->sarray); XtFree((char *)tw->text.input->data); XtFree((char *)tw->text.input); /* XmDropSiteUnregister(w); */ XmImUnregister(w); } /* ARGSUSED */ static XtPointer InputBaseProc(Widget widget, XtPointer client_data) { XtPointer ret_val; XmTextWidget tw = (XmTextWidget) widget; _XmProcessLock(); ret_val = (XtPointer) tw->text.input; _XmProcessUnlock(); return ret_val; } /* ARGSUSED */ void _XmTextInputGetSecResData(XmSecondaryResourceData *secResDataRtn) { XmSecondaryResourceData secResData; secResData = XtNew(XmSecondaryResourceDataRec); _XmTransformSubResources(input_resources, XtNumber(input_resources), &(secResData->resources), &(secResData->num_resources)); secResData->name = NULL; secResData->res_class = NULL; secResData->client_data = NULL; secResData->base_proc = InputBaseProc; *secResDataRtn = secResData; } /* ARGSUSED */ static void DragProcCallback(Widget w, XtPointer client, XtPointer call) { enum { XmACOMPOUND_TEXT, XmATEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSTEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; XmDragProcCallbackStruct *cb = (XmDragProcCallbackStruct *)call; Widget drag_cont; Atom targets[5]; Arg args[10]; Atom *exp_targets; Cardinal num_exp_targets, n; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); targets[0] = XmeGetEncodingAtom(w); targets[1] = atoms[XmACOMPOUND_TEXT]; targets[2] = XA_STRING; targets[3] = atoms[XmATEXT]; #ifdef UTF8_SUPPORTED targets[4] = atoms[XmAUTF8_STRING]; #endif drag_cont = cb->dragContext; n = 0; XtSetArg(args[n], XmNexportTargets, &exp_targets); n++; XtSetArg(args[n], XmNnumExportTargets, &num_exp_targets); n++; XtGetValues(drag_cont, args, n); switch(cb->reason) { case XmCR_DROP_SITE_ENTER_MESSAGE: #ifdef UTF8_SUPPORTED if (XmTargetsAreCompatible(XtDisplay(drag_cont), exp_targets, num_exp_targets, targets, 5)) #else if (XmTargetsAreCompatible(XtDisplay(drag_cont), exp_targets, num_exp_targets, targets, 4)) #endif cb->dropSiteStatus = XmVALID_DROP_SITE; else cb->dropSiteStatus = XmINVALID_DROP_SITE; break; case XmCR_DROP_SITE_LEAVE_MESSAGE: case XmCR_DROP_SITE_MOTION_MESSAGE: case XmCR_OPERATION_CHANGED: break; default: /* other messages we consider invalid */ cb->dropSiteStatus = XmINVALID_DROP_SITE; break; } if (cb->dropSiteStatus == XmVALID_DROP_SITE) { if (cb->operation != XmDROP_COPY && cb->operation != XmDROP_MOVE) cb->dropSiteStatus = XmINVALID_DROP_SITE; } } static void RegisterDropSite(Widget w) { enum { XmACOMPOUND_TEXT, XmATEXT, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmSCOMPOUND_TEXT, XmSTEXT, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; Atom targets[5]; Arg args[10]; int n; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); targets[0] = XmeGetEncodingAtom(w); targets[1] = atoms[XmACOMPOUND_TEXT]; targets[2] = XA_STRING; targets[3] = atoms[XmATEXT]; #ifdef UTF8_SUPPORTED targets[4] = atoms[XmAUTF8_STRING]; #endif n = 0; XtSetArg(args[n], XmNimportTargets, targets); n++; #ifdef UTF8_SUPPORTED XtSetArg(args[n], XmNnumImportTargets, 5); n++; #else XtSetArg(args[n], XmNnumImportTargets, 4); n++; #endif XtSetArg(args[n], XmNdragProc, DragProcCallback); n++; XmeDropSink(w, args, n); } void _XmTextInputCreate(Widget wid, ArgList args, Cardinal num_args) { Arg im_args[17]; /* To set initial values to input method */ Cardinal n = 0; XmTextWidget tw = (XmTextWidget) wid; Input input; InputData data; XtPointer temp_ptr; OutputData o_data = tw->text.output->data; XRectangle xmim_area; XPoint xmim_point; tw->text.input = input = (Input) XtMalloc((unsigned) sizeof(InputRec)); input->data = data = (InputData) XtMalloc((unsigned) sizeof(InputDataRec)); XtGetSubresources(wid, (XtPointer)data, NULL, NULL, input_resources, XtNumber(input_resources), args, num_args); data->widget = tw; if (data->sarray == NULL) data->sarray = (XmTextScanType *) sarray; if (data->sarraycount <= 0) data->sarraycount = XtNumber(sarray); /* * Fix for HaL DTS 9841 - copy the selectionArray into dedicated memory. */ temp_ptr = (XtPointer)data->sarray; data->sarray = (XmTextScanType *)XtMalloc(data->sarraycount * sizeof(XmTextScanType)); memcpy((void *)data->sarray, (void *)temp_ptr, (data->sarraycount * sizeof(XmTextScanType))); /* * End fix for HaL DTS 9841 */ data->lasttime = 0; data->cancel = True; data->stype = data->sarray[0]; data->extendDir = XmsdRight; data->extending = FALSE; data->sel_start = FALSE; data->origLeft = 0; data->origRight = 0; data->selectionHint.x = data->selectionHint.y = 0; data->anchor = 0; data->hasSel2 = FALSE; data->sel2Left = 0; data->sel2Right = 0; data->Sel2OrigLeft = 0; data->Sel2OrigRight = 0; data->Sel2ExtendDir = XmsdRight; data->Sel2Extending = FALSE; data->Sel2Hint.x = data->Sel2Hint.y = 0; data->select_pos_x = data->select_pos_y = 0; data->select_id = 0; data->sec_time = 0; data->dest_time = 0; data->syncing = FALSE; data->has_destination = FALSE; data->overstrike = FALSE; data->selectionMove = FALSE; data->selectionLink = FALSE; data->drag_id = 0; data->transfer_action = NULL; /* This EventHandler scans the event queue to see if there are more key events pending for this widget. If there are, it will disable redisplay until there are no more key event on the queue. This can have severe effects when using certain input methods: The event that was in the queue may not get passed to the eventhandler - it could be filtered out by the input method. If this was the last key event, the text may never be redrawn again. Put it in a comment for now. Also, this seems to get used only in rare cases. XtAddEventHandler((Widget) tw, KeyPressMask, FALSE, CheckSync, NULL); */ input->Invalidate = Invalidate; input->GetValues = InputGetValues; input->SetValues = InputSetValues; input->destroy = InputDestroy; if (tw->text.editable) { XmTextSetEditable((Widget)tw, False); XmTextSetEditable((Widget)tw, True); } RegisterDropSite(wid); } static XmTextPosition XtoPosInLine(XmTextWidget tw, #if NeedWidePrototypes int x, #else Position x, #endif /* NeedWidePrototypes */ LineNum line) { OutputData data = tw->text.output->data; Position x1 = 0, y1 = 0; XmTextPosition pos; pos = (*tw->text.output->XYToPos)(tw, x, line * data->lineheight + data->topmargin); (*tw->text.output->PosToXY)(tw, pos, &x1, &y1); if (pos > 0 && x1 > x) return pos-1; else return pos; } static XmTextPosition YtoPosInLine(XmTextWidget tw, #if NeedWidePrototypes int y, #else Position y, #endif /* NeedWidePrototypes */ LineNum line) { OutputData data = tw->text.output->data; Position x1 = 0, y1 = 0; XmTextPosition pos; pos = (*tw->text.output->XYToPos)(tw, tw->text.inner_widget->core.width - (line * data->linewidth) - data->rightmargin, y); (*tw->text.output->PosToXY)(tw, pos, &x1, &y1); if (pos > 0 && y1 > y) return pos-1; else return pos; } motif-2.3.8/lib/Xm/ToolTipI.h0000644000175000017500000000305512672140200012566 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmToolTip_h #define _XmToolTip_h #include #include "Xm.h" #include "XmI.h" #ifdef __cplusplus extern "C" { #endif void _XmToolTipEnter(Widget wid, XEvent *event, String *params, Cardinal *num_params); void _XmToolTipLeave(Widget wid, XEvent *event, String *params, Cardinal *num_params); #ifdef FIX_1388 void _XmToolTipRemove(Widget wid); #endif XmString XmGetToolTipString (Widget w); void XmSetToolTipString (Widget w, XmString s); #ifdef __cplusplus } #endif #endif motif-2.3.8/lib/Xm/IconH.c0000644000175000017500000001214712672140200012060 00000000000000/* $XConsortium: IconH.c /main/5 1995/07/15 20:52:17 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * IconH.c: The IconHeader widget methods. */ #ifdef HAVE_CONFIG_H #include #endif #include /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc); static Widget GetContainerParent(Widget); /******** End Static Function Declarations ********/ static XtResource resources[] = { { XmNcontainerID,XmCContainerID,XmRWidget, sizeof(Widget), XtOffset(XmIconHeader,iconh.container_ID), XmRImmediate,(XtPointer)NULL}, }; /* That should not be necessary, but inheriting extension is not very well understood yet */ static XmGadgetClassExtRec GadClassExtRec = { NULL, NULLQUARK, XmGadgetClassExtVersion, sizeof(XmGadgetClassExtRec), XmInheritBaselineProc, /* widget_baseline */ XmInheritDisplayRectProc, /* widget_display_rect */ XmInheritMarginsProc, /* widget_margins */ }; externaldef( xmiconheaderclassrec) XmIconHeaderClassRec xmIconHeaderClassRec = { /* RectObjClassPart */ { (WidgetClass) &xmIconGadgetClassRec, /* superclass */ "XmIconHeader", /* class_name */ sizeof (XmIconHeaderRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class_part_initialize*/ False, /* class_inited */ NULL, /* initialize */ NULL, /* initialize_hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber (resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ True, /* compress_exposure */ True, /* compress_enterleave */ False, /* visible_interest */ NULL, /* destroy */ NULL, /* resize */ XtInheritExpose, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* tm_table */ XtInheritQueryGeometry, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, /* XmGadget Class Part */ { XmInheritBorderHighlight, /* border_highlight */ XmInheritBorderUnhighlight, /* border_unhighlight */ NULL, /* arm_and_activate */ XmInheritInputDispatch, /* input_dispatch */ XmInheritVisualChange, /* visual_change */ NULL, /* get_resources */ 0, /* num_get_resources */ NULL, /* class_cache_part */ (XtPointer)&GadClassExtRec, /* extension */ }, /* XmIconGadget Class Part */ { GetContainerParent, /* get_container_parent */ NULL, /* extension */ }, /* XmIconHeader Class Part */ { NULL, /* extension */ }, }; externaldef(xmiconheaderclass) WidgetClass xmIconHeaderClass=(WidgetClass)&xmIconHeaderClassRec; /*---------------- | RectObj methods | ----------------*/ /************************************************************************ * ClassPartInitialize * Parms(IconGadgetClass) * returns void * * Set Motif Fast subclass initialize bit. ************************************************************************/ static void ClassPartInitialize( WidgetClass wc) { _XmFastSubclassInit(wc,XmICONHEADER_BIT); } /************************************************************************ * GetContainerParent class method * ************************************************************************/ static Widget GetContainerParent( Widget wid) { return (((XmIconHeader)(wid))->iconh.container_ID); } /*------------------- | External functions | -------------------*/ /************************************************************************ * XmCreateIconHeader * * Create an instance of a xmIconHeaderClass widget and * return it's id. ************************************************************************/ Widget XmCreateIconHeader( Widget parent, char *name, ArgList arglist, Cardinal argcount) { return(XtCreateWidget(name,xmIconHeaderClass,parent,arglist,argcount)); } motif-2.3.8/lib/Xm/DragOverSP.h0000644000175000017500000001007513145162623013050 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragOverSP_h #define _XmDragOverSP_h #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #define DOExpose(do) \ ((XtClass(do))->core_class.expose) ((Widget)(do), NULL, NULL) /* * DRAGOVER SHELL */ typedef struct { XtPointer extension; } XmDragOverShellClassPart; /* Full class record declaration */ typedef struct _XmDragOverShellClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; WMShellClassPart wm_shell_class; VendorShellClassPart vendor_shell_class; XmDragOverShellClassPart dragOver_shell_class; } XmDragOverShellClassRec; externalref XmDragOverShellClassRec xmDragOverShellClassRec; typedef struct _XmBackingRec{ Position x, y; Pixmap pixmap; }XmBackingRec, *XmBacking; typedef struct _XmDragOverBlendRec{ XmDragIconObject sourceIcon; /* source icon */ Position sourceX; /* source location in blend */ Position sourceY; /* source location in blend */ XmDragIconObject mixedIcon; /* blended icon */ GC gc; /* appropriate depth */ }XmDragOverBlendRec, *XmDragOverBlend; typedef struct _XmDragOverShellPart{ Position hotX; /* current hotX */ Position hotY; /* current hotY */ unsigned char cursorState; /* current cursor state */ unsigned char mode; unsigned char activeMode; Position initialX; /* initial hotX */ Position initialY; /* initial hotY */ XmDragIconObject stateIcon; /* current state icon */ XmDragIconObject opIcon; /* current operation icon */ XmDragOverBlendRec cursorBlend; /* cursor blending */ XmDragOverBlendRec rootBlend; /* pixmap or window blending */ Pixel cursorForeground; Pixel cursorBackground; Cursor ncCursor; /* noncached cursor */ Cursor activeCursor; /* the current cursor */ XmBackingRec backing; /* backing store for pixdrag */ Pixmap tmpPix; /* temp storage for pixdrag */ Pixmap tmpBit; /* temp storage for pixdrag */ Boolean isVisible; /* shell is visible */ /* Added for ShapedWindow dragging */ /* Resources */ Boolean installColormap;/* Install the colormap */ /* locals */ Boolean holePunched; /* true if hole is punched */ /* the following variables are used to make sure the correct colormap */ /* is installed. colormapWidget is initially the parent widget, but */ /* can be changed by calling DragShellColormapWidget. */ Widget colormapWidget; /* The widget I'm dragging from */ Widget colormapShell; /* It's shell, install colormap here */ Boolean colormapOverride; /* shell is override rediirect */ Colormap* savedColormaps; /* used with override redirect */ int numSavedColormaps; }XmDragOverShellPart; typedef struct _XmDragOverShellRec{ CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; VendorShellPart vendor; XmDragOverShellPart drag; } XmDragOverShellRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragOverSP_h */ motif-2.3.8/lib/Xm/Frame.c0000644000175000017500000012617613145162623012133 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Frame.c /main/18 1996/10/15 15:01:45 cde-osf $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "GMUtilsI.h" #include "RepTypeI.h" #include "XmI.h" #define GetFrameConstraint(w) \ (&((XmFrameConstraintPtr) (w)->core.constraints)->frame) /******** Static Function Declarations ********/ static void CheckSetChildType(Widget wid, int offset, XrmValue *value); static void DrawShadow( XmFrameWidget fw) ; static void ClearShadow( XmFrameWidget fw) ; static void ConfigureChildren( XmFrameWidget fw, Widget instigator, XtWidgetGeometry *inst_desired) ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Resize( Widget wid) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget wid) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *ret) ; static void CalcFrameSize( XmFrameWidget fw, #if NeedWidePrototypes int titleWidth, int titleHeight, int titleBorder, int workWidth, int workHeight, int workBorder, #else Dimension titleWidth, Dimension titleHeight, Dimension titleBorder, Dimension workWidth, Dimension workHeight, Dimension workBorder, #endif /* NeedWidePrototypes */ Dimension *fwWidth, Dimension *fwHeight) ; static void CalcWorkAreaSize( XmFrameWidget fw, Dimension *workWidth, Dimension *workHeight, #if NeedWidePrototypes int workBorder, int fwWidth, int fwHeight) ; #else Dimension workBorder, Dimension fwWidth, Dimension fwHeight) ; #endif /* NeedWidePrototypes */ static void CalcTitleExtent( XmFrameWidget fw, #if NeedWidePrototypes int titleHeight, int titleBorder, #else Dimension titleHeight, Dimension titleBorder, #endif /* NeedWidePrototypes */ Dimension *titleExtent, Position *titleY, Dimension *shadowWidth, Position *shadowY) ; static void ConstraintInitialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean ConstraintSetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void ConstraintDestroy( Widget w) ; /******** End Static Function Declarations ********/ static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof (Dimension), XtOffsetOf( struct _XmFrameRec, frame.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof (Dimension), XtOffsetOf( struct _XmFrameRec, frame.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels, } }; static XtResource resources[] = { { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmFrameRec, frame.margin_width), XmRImmediate, (XtPointer) 0 }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf( struct _XmFrameRec, frame.margin_height), XmRImmediate, (XtPointer) 0 }, { XmNshadowType, XmCShadowType, XmRShadowType, sizeof (unsigned char), XtOffsetOf( struct _XmFrameRec, frame.shadow_type), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmFrameRec, manager.shadow_thickness), XmRImmediate, (XtPointer) XmINVALID_DIMENSION } }; static XmSyntheticResource syn_constraints[] = { { XmNchildHorizontalSpacing, sizeof (Dimension), XtOffsetOf( struct _XmFrameConstraintRec, frame.child_h_spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels } }; static XtResource constraints[] = { { "pri.vate", "Pri.vate", XmRInt, sizeof (int), XtOffsetOf( struct _XmFrameConstraintRec, frame.unused), XmRImmediate, (XtPointer) 0 }, { XmNchildType, XmCChildType, XmRChildType, sizeof (unsigned char), XtOffsetOf( struct _XmFrameConstraintRec, frame.child_type), XmRCallProc, (XtPointer) CheckSetChildType }, /* add a dup in 2.0 with new local names */ { XmNframeChildType, XmCFrameChildType, XmRChildType, sizeof (unsigned char), XtOffsetOf( struct _XmFrameConstraintRec, frame.child_type), XmRCallProc, (XtPointer) CheckSetChildType }, { XmNchildHorizontalAlignment, XmCChildHorizontalAlignment, XmRChildHorizontalAlignment, sizeof (unsigned char), XtOffsetOf( struct _XmFrameConstraintRec, frame.child_h_alignment), XmRImmediate, (XtPointer) XmALIGNMENT_BEGINNING }, { XmNchildVerticalAlignment, XmCChildVerticalAlignment, XmRChildVerticalAlignment, sizeof (unsigned char), XtOffsetOf( struct _XmFrameConstraintRec, frame.child_v_alignment), XmRImmediate, (XtPointer) XmALIGNMENT_CENTER }, { XmNchildHorizontalSpacing, XmCChildHorizontalSpacing, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmFrameConstraintRec, frame.child_h_spacing), XmRImmediate, (XtPointer) XmINVALID_DIMENSION} }; /**************************************************************** * * Full class record constant * ****************************************************************/ externaldef(xmframeclassrec) XmFrameClassRec xmFrameClassRec = { { /* core_class fields */ (WidgetClass) &xmManagerClassRec, /* superclass */ "XmFrame", /* class_name */ sizeof(XmFrameRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class_part_init */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterlv */ FALSE, /* visible_interest */ NULL, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ XtInheritTranslations, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ constraints, /* resource list */ XtNumber(constraints), /* num resources */ sizeof (XmFrameConstraintRec), /* constraint size */ ConstraintInitialize, /* init proc */ ConstraintDestroy, /* destroy proc */ ConstraintSetValues, /* set values proc */ NULL, /* extension */ }, { /* manager class */ XtInheritTranslations, /* translations */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num syn_resources */ syn_constraints, /* get_cont_resources */ XtNumber(syn_constraints), /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* frame class */ NULL, /* extension */ } }; externaldef(xmframewidgetclass) WidgetClass xmFrameWidgetClass = (WidgetClass) &xmFrameClassRec; /************************************************************************ * * CheckSetChildType * default proc for the new childType resource. * if this is called and child_type is INVALID, childType was * not set, so default it, otherwise child_type was set and this * one is not, so don't change it. * ************************************************************************/ /*ARGSUSED*/ static void CheckSetChildType(Widget wid, int offset, XrmValue *value) { XmFrameConstraint fc = GetFrameConstraint(wid); static unsigned char child_type = XmFRAME_WORKAREA_CHILD ; if (fc->unused) /* Been here already, so default it .. */ value->addr = (XPointer) &child_type; else { value->addr = (XPointer) &(fc->child_type); fc->unused = 1; } } /************************************************************************ * * DrawShadow * Draw the Frame shadow * ************************************************************************/ static void DrawShadow( XmFrameWidget fw ) { if (XtIsRealized((Widget)fw)) { XmeDrawShadows(XtDisplay (fw), XtWindow (fw), fw->manager.top_shadow_GC, fw->manager.bottom_shadow_GC, fw->frame.old_shadow_x, fw->frame.old_shadow_y, fw->frame.old_width, fw->frame.old_height, fw->frame.old_shadow_thickness, fw->frame.shadow_type); } } /************************************************************************ * * ClearShadow * Erase the Frame shadow * ************************************************************************/ static void ClearShadow( XmFrameWidget fw ) { if (XtIsRealized((Widget)fw)) { XmeClearBorder (XtDisplay(fw), XtWindow(fw), fw->frame.old_shadow_x, fw->frame.old_shadow_y, fw->frame.old_width, fw->frame.old_height, fw->frame.old_shadow_thickness); } } /************************************************************************ * * ConfigureChildren * Configure the title and work area if they aren't instigaror * of the request (Yes policy). Compute the shadow location. * ************************************************************************/ static void ConfigureChildren( XmFrameWidget fw, Widget instigator, XtWidgetGeometry * inst_geometry) { Widget child; XmFrameConstraint fc; Position childX = 0; Position childY; Dimension childWidth; Dimension childHeight; Dimension childBW; Dimension shadowThickness = fw->manager.shadow_thickness; Dimension titleExtent = shadowThickness; Dimension shadowHeight = fw->core.height; Position shadowY = 0; XtWidgetGeometry title_reply; Dimension spacing; if (fw->frame.title_area && XtIsManaged(fw->frame.title_area)) { child = fw->frame.title_area; fc = GetFrameConstraint(child); spacing = shadowThickness + fc->child_h_spacing; /* asking the preferred geometry without constraint */ XtQueryGeometry (child, NULL, &title_reply); childWidth = (title_reply.request_mode & CWWidth) ? title_reply.width : child->core.width; childHeight = (title_reply.request_mode & CWHeight) ? title_reply.height : child->core.height; childBW = child->core.border_width; if (child == instigator) { childWidth = (inst_geometry->request_mode & CWWidth) ? inst_geometry->width : childWidth; childHeight = (inst_geometry->request_mode & CWHeight) ? inst_geometry->height : childHeight; childBW = (inst_geometry->request_mode & CWBorderWidth) ? inst_geometry->border_width : childBW; } if (childWidth + 2 * (spacing + childBW) > fw->core.width) { if (fw->core.width > 2 * (spacing + childBW)) childWidth = fw->core.width - 2 * (spacing + childBW); else childWidth = 1; } switch (fc->child_h_alignment) { case(XmALIGNMENT_BEGINNING): if (LayoutIsRtoLM(fw)) childX = fw->core.width - spacing - childWidth - 2 * childBW; else childX = spacing; break; case(XmALIGNMENT_CENTER): childX = fw->core.width/2 - childWidth/2 - childBW; break; case(XmALIGNMENT_END): default: if (LayoutIsRtoLM(fw)) childX = spacing; else childX = fw->core.width - spacing - childWidth - 2 * childBW; break; } CalcTitleExtent (fw, childHeight, childBW, &titleExtent, &childY, &shadowHeight, &shadowY); if (child != instigator) { XmeConfigureObject (child, childX, childY, childWidth, childHeight, childBW); } else { /* Do not resize the instigator, just return GeometryYes */ inst_geometry->request_mode = CWX | CWY | CWWidth | CWHeight | CWBorderWidth; child->core.x = childX; child->core.y = childY; child->core.width = childWidth; child->core.height = childHeight; child->core.border_width = childBW; } } if (fw->frame.work_area && XtIsManaged(fw->frame.work_area)) { child = fw -> frame.work_area; if (child != instigator) childBW = child->core.border_width; else childBW = (inst_geometry->request_mode & CWBorderWidth) ? inst_geometry->border_width : child->core.border_width; CalcWorkAreaSize (fw, &childWidth, &childHeight, childBW, fw->core.width, fw->core.height); childX = shadowThickness + fw->frame.margin_width; childY = titleExtent + fw->frame.margin_height; if (child != instigator) { XmeConfigureObject (child, childX, childY, childWidth, childHeight, childBW); } else { /* Do not resize the instigator, just return GeometryYes */ inst_geometry->request_mode = CWX | CWY | CWWidth | CWHeight | CWBorderWidth; child->core.x = childX; child->core.y = childY; child->core.width = childWidth; child->core.height = childHeight; child->core.border_width = childBW; } } fw->frame.old_shadow_x = 0; fw->frame.old_shadow_y = shadowY; fw->frame.old_width = fw->core.width; fw->frame.old_height = shadowHeight; fw->frame.old_shadow_thickness = shadowThickness; } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmFRAME_BIT); } /************************************************************************ * * Initialize * Ensure that the width and height are not 0. * *************************************<->***********************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmFrameWidget request = (XmFrameWidget) rw ; XmFrameWidget new_w = (XmFrameWidget) nw; new_w->frame.title_area = NULL; new_w->frame.work_area = NULL; new_w->frame.processing_constraints = False; if (new_w->frame.shadow_type == (unsigned char) XmINVALID_DIMENSION) { if (XtIsShell (XtParent(new_w))) { new_w->frame.shadow_type = XmSHADOW_OUT; } else { new_w->frame.shadow_type = XmSHADOW_ETCHED_IN; } } if (!XmRepTypeValidValue( XmRID_SHADOW_TYPE, new_w->frame.shadow_type, (Widget) new_w)) { new_w->frame.shadow_type = XmSHADOW_ETCHED_IN; } if (request->manager.shadow_thickness == XmINVALID_DIMENSION) { if (XtIsShell (XtParent(new_w))) { new_w->manager.shadow_thickness = 1; } else { new_w->manager.shadow_thickness = 2; } } new_w->frame.old_shadow_x = 0; new_w->frame.old_shadow_y = 0; new_w->frame.old_width = new_w->core.width; new_w->frame.old_height = new_w->core.height; new_w->frame.old_shadow_thickness = new_w->manager.shadow_thickness; } /************************************************************************ * * Resize * Calculate the size of the children and resize. * ************************************************************************/ static void Resize( Widget wid ) { XmFrameWidget fw = (XmFrameWidget) wid ; ClearShadow(fw); ConfigureChildren(fw, NULL, NULL); DrawShadow(fw); } /************************************************************************ * * Redisplay * General redisplay function called on exposure events. * ************************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmFrameWidget fw = (XmFrameWidget) wid; Widget title_area = fw->frame.title_area; DrawShadow(fw); /* since the shadow may have screw up the gadget title, while this one won't get refresh, we have to redraw it manually */ if (title_area && XmIsGadget(title_area) && XtIsManaged(title_area)) { XClearArea (XtDisplay(fw), XtWindow(fw), title_area->core.x, title_area->core.y, title_area->core.width, title_area->core.height, False); if (region && !XRectInRegion (region, title_area->core.x, title_area->core.y, title_area->core.width, title_area->core.height)) { XtExposeProc expose; _XmProcessLock(); expose = title_area->core.widget_class->core_class.expose; _XmProcessUnlock(); if (expose) (*expose)(title_area, event, NULL); } } XmeRedisplayGadgets( (Widget) fw, event, region); } /************************************************************************ * * Geometry Manager * Take the requested geometry, calculate the needed size for * the frame and make a request to the frames parent. * Requests to change x, y position are always denied. * ************************************************************************/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XmFrameWidget fw = (XmFrameWidget) XtParent(w); Widget title_area = fw->frame.title_area; Widget work_area = fw->frame.work_area; Dimension req_width, req_height, req_bw; Boolean query_only = False; Boolean almost = False; Dimension title_width = (title_area)?title_area->core.width:0; Dimension title_height = (title_area)?title_area->core.height:0; Dimension title_bw = (title_area)?title_area->core.border_width:0; Dimension work_width = (work_area)?work_area->core.width:0; Dimension work_height = (work_area)?work_area->core.height:0; Dimension work_bw = (work_area)?work_area->core.border_width:0; Dimension frame_width, frame_height; XtWidgetGeometry parent_request; XtWidgetGeometry parent_reply; Dimension almost_width; Dimension almost_height; if (fw->frame.processing_constraints) { fw->frame.processing_constraints = False; request -> border_width -= 1; } /* Set up the calculation variables according to the */ /* contents of the requested geometry. */ if (request -> request_mode & XtCWQueryOnly) query_only = True; if ((request -> request_mode & CWX) || (request -> request_mode & CWY)) almost = True; if (request -> request_mode & CWWidth) req_width = request -> width; else req_width = w -> core.width; if (request -> request_mode & CWHeight) req_height = request -> height; else req_height = w -> core.height; if (request -> request_mode & CWBorderWidth) req_bw = request -> border_width; else req_bw = w -> core.border_width; if (w == title_area) { title_width = req_width; title_height = req_height; title_bw = req_bw; } if (w == work_area) { work_width = req_width; work_height = req_height; work_bw = req_bw; } /* find the frame size based on the children preferred geometry */ CalcFrameSize (fw, title_width, title_height, title_bw, work_width, work_height, work_bw, &frame_width, &frame_height); parent_request.request_mode = CWWidth | CWHeight; if (almost || query_only) parent_request.request_mode |= XtCWQueryOnly; parent_request.width = frame_width; parent_request.height = frame_height; switch (XtMakeGeometryRequest ((Widget)fw, &parent_request, &parent_reply)) { case XtGeometryYes: if (!almost) { if (!query_only) { ClearShadow(fw); ConfigureChildren(fw, w, request); DrawShadow(fw); } return (XtGeometryYes); } else { almost_width = request->width; almost_height = request->height; } break; case XtGeometryNo: if (w == title_area) { /* we got a No, try to honor the title request anyway, by resizing the work_area child */ if (!almost) { if (!query_only) { ClearShadow(fw); ConfigureChildren(fw, w, request); DrawShadow(fw); } return (XtGeometryYes); } else { almost_width = request->width; almost_height = request->height; } } else return (XtGeometryNo); break; case XtGeometryAlmost: if (w == title_area) { /* we got an Almost, try to honor the title request anyway, by accepting the deal and resizing the work_area child */ if (!almost) { if (!query_only) { ClearShadow(fw); XtMakeResizeRequest((Widget)fw, parent_reply.width, parent_reply.height, NULL, NULL); ConfigureChildren(fw, w, request); } return (XtGeometryYes); } else { almost_width = request->width; almost_height = request->height; } } else { /* we got an Almost, accept the deal and compute the work_area size */ CalcWorkAreaSize (fw, &almost_width, &almost_height, req_bw, parent_reply.width, parent_reply.height); } break; default: return (XtGeometryNo); break; } /* Fallen through to an almost condition. Clear the x and y */ /* and set the width, height, and border. */ if (reply != NULL) { reply -> request_mode = request -> request_mode & ~(CWX | CWY); reply -> width = almost_width; reply -> height = almost_height; reply -> border_width = req_bw; if (request -> request_mode & CWSibling) reply -> sibling = request -> sibling; if (request -> request_mode & CWStackMode) reply -> stack_mode = request -> stack_mode; return (XtGeometryAlmost); } return (XtGeometryNo); } /************************************************************************ * * ChangeManaged * Process a changed in managed state of the child. If its * size is out of sync with the frame, make a resize request * to change the size of the frame. * Note: called before ConstraintDestroy. * ************************************************************************/ static void ChangeManaged( Widget wid ) { XmFrameWidget fw = (XmFrameWidget) wid ; Widget title_area = (fw->frame.title_area && XtIsManaged(fw->frame.title_area)) ? fw->frame.title_area : (Widget) NULL; Dimension t_w = 0; Dimension t_h = 0; Dimension t_bw = (title_area) ? title_area->core.border_width : 0; Widget work_area = (fw->frame.work_area && XtIsManaged(fw->frame.work_area)) ? fw->frame.work_area : (Widget) NULL; Dimension w_w = (work_area) ? work_area->core.width : 0; Dimension w_h = (work_area) ? work_area->core.height : 0; Dimension w_bw = (work_area) ? work_area->core.border_width : 0; Dimension fwWidth, fwHeight; if (title_area) { /* We don't want the current size of the title object -- width/height ** may have been set on it. Because we'll be forcing it to the size we ** want (see ConfigureChildren), we must use the "natural" size here, ** so query its value now. (Use current border_width.) */ XtWidgetGeometry title_reply; XtQueryGeometry (title_area, NULL, &title_reply); t_w = (title_reply.request_mode & CWWidth) ? title_reply.width : title_area->core.width; t_h = (title_reply.request_mode & CWHeight) ? title_reply.height : title_area->core.height; } /* need to check on initial sizing (not null) */ if (XtIsRealized((Widget)fw) || (XtWidth(fw) == 0) || (XtHeight(fw) == 0)) { CalcFrameSize (fw, t_w, t_h, t_bw, w_w, w_h, w_bw, &fwWidth, &fwHeight); while (XtMakeResizeRequest ((Widget) fw, fwWidth, fwHeight, &fwWidth, &fwHeight) == XtGeometryAlmost) /*EMPTY*/; ClearShadow(fw); } ConfigureChildren(fw, NULL, NULL); DrawShadow(fw); XmeNavigChangeManaged((Widget) fw); } /************************************************************************ * * Set Values * Adjust the size of the manager based on shadow thickness * changes. * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmFrameWidget current = (XmFrameWidget) cw ; XmFrameWidget new_w = (XmFrameWidget) nw ; Boolean redisplay = False; Widget title_area = (new_w->frame.title_area && XtIsManaged(new_w->frame.title_area)) ? new_w->frame.title_area : NULL; Dimension t_w = (title_area) ? title_area->core.width : 0; Dimension t_h = (title_area) ? title_area->core.height : 0; Dimension t_bw = (title_area) ? title_area->core.border_width : 0; Widget work_area = (new_w->frame.work_area && XtIsManaged(new_w->frame.work_area)) ? new_w->frame.work_area : (Widget) NULL; Dimension w_w = (work_area) ? work_area->core.width : 0; Dimension w_h = (work_area) ? work_area->core.height : 0; Dimension w_bw = (work_area) ? work_area->core.border_width : 0; if (!XmRepTypeValidValue( XmRID_SHADOW_TYPE, new_w->frame.shadow_type, (Widget) new_w)) { new_w->frame.shadow_type = current->frame.shadow_type; } if (!XtIsRealized((Widget)new_w)) return False ; if (new_w->frame.margin_width != current->frame.margin_width || new_w->frame.margin_height != current->frame.margin_height || new_w->manager.shadow_thickness != current->manager.shadow_thickness) { CalcFrameSize (new_w, t_w, t_h, t_bw, w_w, w_h, w_bw, &new_w->core.width, &new_w->core.height); } if (new_w -> frame.shadow_type != current -> frame.shadow_type || new_w->frame.margin_width != current->frame.margin_width || new_w->frame.margin_height != current->frame.margin_height || new_w->manager.shadow_thickness != current->manager.shadow_thickness) { redisplay = True; } return (redisplay); } /************************************************************************ * * QueryGeometry * return width X height based on the children preferred sizes * ************************************************************************/ static XtGeometryResult QueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) { Dimension work_width = 0, work_height = 0, work_bw = 0 ; Dimension title_width = 0, title_height = 0, title_bw = 0 ; XtWidgetGeometry child_pref ; XmFrameWidget fw = (XmFrameWidget) widget ; /* first determine what is the desired size, using the preferred sizes of the title and the work_area, or the current setting if no preference are given */ if (fw->frame.work_area) { XtQueryGeometry (fw->frame.work_area, NULL, &child_pref); if (IsWidth(&child_pref)) work_width = child_pref.width ; else work_width = XtWidth(fw->frame.work_area); if (IsHeight(&child_pref)) work_height = child_pref.height ; else work_height = XtHeight(fw->frame.work_area); if (IsBorder(&child_pref)) work_bw = child_pref.border_width ; else work_bw = XtBorderWidth(fw->frame.work_area); } if (fw->frame.title_area) { XtQueryGeometry (fw->frame.title_area, NULL, &child_pref); if (IsWidth(&child_pref)) title_width = child_pref.width ; else title_width = XtWidth(fw->frame.title_area); if (IsHeight(&child_pref)) title_height = child_pref.height ; else title_height = XtHeight(fw->frame.title_area); if (IsBorder(&child_pref)) title_bw = child_pref.border_width ; else title_bw = XtBorderWidth(fw->frame.title_area); } CalcFrameSize (fw, title_width, title_height, title_bw, work_width, work_height, work_bw, &desired->width, &desired->height); /* deal with user initial size setting */ if (!XtIsRealized(widget)) { if (XtWidth(widget) != 0) desired->width = XtWidth(widget) ; if (XtHeight(widget) != 0) desired->height = XtHeight(widget) ; } return XmeReplyToQueryGeometry(widget, intended, desired) ; } /************************************************************************ * * CalcFrameSize * Calculate the manager size based on the supplied width * and height. * Note: all of the dimensions passed in may be 0, in which case the return * value is based on the frame's own visuals. ************************************************************************/ static void CalcFrameSize( XmFrameWidget fw, #if NeedWidePrototypes int titleWidth, int titleHeight, int titleBorder, int workWidth, int workHeight, int workBorder, #else Dimension titleWidth, Dimension titleHeight, Dimension titleBorder, Dimension workWidth, Dimension workHeight, Dimension workBorder, #endif /* NeedWidePrototypes */ Dimension *fwWidth, Dimension *fwHeight ) { Dimension shadowThickness = fw->manager.shadow_thickness; Dimension titleExtent = shadowThickness; Dimension workMax = 0; Dimension titleMax = 0; if (fw->frame.title_area && XtIsManaged(fw->frame.title_area)) { XmFrameConstraint fc = GetFrameConstraint(fw->frame.title_area); CalcTitleExtent (fw, titleHeight, titleBorder, &titleExtent, NULL, NULL, NULL); titleMax = 2 * (shadowThickness + titleBorder + fc->child_h_spacing) + titleWidth; } workMax = 2 * (workBorder + shadowThickness + fw->frame.margin_width) + workWidth; *fwWidth = MAX (workMax, titleMax); if (*fwWidth == 0) *fwWidth = 1; *fwHeight = workHeight + 2 * (workBorder + fw->frame.margin_height) + shadowThickness + titleExtent; if (*fwHeight == 0) *fwHeight = 1; } /************************************************************************ * * CalcWorkAreaSize * Calculate the work area size based on the supplied width * and height. * ************************************************************************/ static void CalcWorkAreaSize( XmFrameWidget fw, Dimension *workWidth, Dimension *workHeight, #if NeedWidePrototypes int workBorder, int fwWidth, int fwHeight ) #else Dimension workBorder, Dimension fwWidth, Dimension fwHeight ) #endif /* NeedWidePrototypes */ { Widget title = fw->frame.title_area; Dimension shadowThickness = fw->manager.shadow_thickness; Dimension titleExtent = shadowThickness; int temp; if (title && XtIsManaged(title)) CalcTitleExtent (fw, title->core.height, title->core.border_width, &titleExtent, NULL, NULL, NULL); temp = (int) fwWidth - (int) (2 * (workBorder + shadowThickness + fw->frame.margin_width)); if (temp <= 0) *workWidth = 1; else *workWidth = (Dimension) temp; temp = (int) fwHeight - (int) (2 * (workBorder + fw->frame.margin_height) + shadowThickness + titleExtent); if (temp <= 0) *workHeight = 1; else *workHeight = (Dimension) temp; } /************************************************************************ * * CalcTitleExtent * Calculate layout parameters which depend on the title. * * titleExtent: vertical space above the work area. * titleY: y position of the title. * shadowHeight: vertical size of the shadow rectangle. * shadowY: y position of the shadow rectangle. * ************************************************************************/ static void CalcTitleExtent( XmFrameWidget fw, #if NeedWidePrototypes int titleHeight, int titleBorder, #else Dimension titleHeight, Dimension titleBorder, #endif /* NeedWidePrototypes */ Dimension *titleExtent, Position *titleY, Dimension *shadowHeight, Position *shadowY) { XmFrameConstraint fc = GetFrameConstraint(fw->frame.title_area); Dimension shadowThickness = fw->manager.shadow_thickness; Dimension extent; Position ty; Dimension sh; Position sy; Dimension base; Dimension *lines; int nlines; Dimension total = titleHeight + 2 * titleBorder; switch (fc->child_v_alignment) { case(XmALIGNMENT_BASELINE_TOP): case(XmALIGNMENT_BASELINE_BOTTOM): if (XmWidgetGetBaselines (fw->frame.title_area, &lines, &nlines)) { if (fc->child_v_alignment == XmALIGNMENT_BASELINE_TOP) base = lines[0]; else base = lines[nlines - 1]; XtFree((char *)lines); } else { base = total/2; } ty = (base + titleBorder > shadowThickness/2) ? 0 : shadowThickness/2 - (base + titleBorder); extent = ty + MAX(total, titleBorder + base + shadowThickness/2); sy = (base + titleBorder > shadowThickness/2) ? base + titleBorder - shadowThickness/2 : 0; sh = ((Dimension) sy >= fw->core.height) ? 1 : fw->core.height - sy; break; case(XmALIGNMENT_CENTER): ty = (total > shadowThickness) ? 0 : (shadowThickness - total)/2; extent = MAX(shadowThickness, total); sy = (shadowThickness > total) ? 0 : total/2 - shadowThickness/2; sh = ((Dimension) sy >= fw->core.height) ? 1 : fw->core.height - sy; break; case(XmALIGNMENT_WIDGET_TOP): ty = 0; extent = shadowThickness + total; sy = total; sh = ((Dimension) sy >= fw->core.height) ? 1 : fw->core.height - sy; break; case(XmALIGNMENT_WIDGET_BOTTOM): default: ty = shadowThickness; extent = shadowThickness + total; sy = 0; sh = fw->core.height; break; } if (titleExtent) *titleExtent = extent; if (titleY) *titleY = ty; if (shadowHeight) *shadowHeight = sh; if (shadowY) *shadowY = sy; } /************************************************************************ * * Constraint Initialize * *************************************<->***********************************/ /*ARGSUSED*/ static void ConstraintInitialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmFrameConstraint nc; XmFrameConstraint bc; XmFrameWidget fw; if (!XtIsRectObj (nw)) return; nc = GetFrameConstraint(nw); fw = (XmFrameWidget)XtParent(nw); if (!XmRepTypeValidValue( XmRID_CHILD_TYPE, nc->child_type, nw)) { nc->child_type = XmFRAME_GENERIC_CHILD; } else { switch (nc->child_type) { case (XmFRAME_TITLE_CHILD) : if (fw->frame.title_area != NULL) { bc = GetFrameConstraint(fw->frame.title_area); bc->child_type = XmFRAME_GENERIC_CHILD; } fw->frame.title_area = nw; if (nc->child_h_spacing == (Dimension) XmINVALID_DIMENSION) nc->child_h_spacing = MAX(10,fw->frame.margin_width); break; case (XmFRAME_WORKAREA_CHILD) : if (fw->frame.work_area != NULL) { bc = GetFrameConstraint(fw->frame.work_area); bc->child_type = XmFRAME_GENERIC_CHILD; } fw->frame.work_area = nw; break; case (XmFRAME_GENERIC_CHILD) : break; } } if (!XmRepTypeValidValue( XmRID_CHILD_HORIZONTAL_ALIGNMENT, nc->child_h_alignment, nw)) { nc->child_h_alignment = XmALIGNMENT_BEGINNING; } if (!XmRepTypeValidValue( XmRID_CHILD_VERTICAL_ALIGNMENT, nc->child_v_alignment, nw)) { nc->child_v_alignment = XmALIGNMENT_CENTER; } } /************************************************************************ * * Constraint SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean ConstraintSetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmFrameConstraint nc; XmFrameConstraint cc; XmFrameConstraint bc; XmFrameWidget fw; Boolean reconfigure = False; if (!XtIsRectObj (nw)) return (False); nc = GetFrameConstraint(nw); cc = GetFrameConstraint(cw); fw = (XmFrameWidget)XtParent(nw); if (nc->child_type != cc->child_type) { if( !XmRepTypeValidValue( XmRID_CHILD_TYPE, nc->child_type, nw) ) { nc->child_type = cc->child_type; } else { switch(nc->child_type) { case (XmFRAME_TITLE_CHILD) : if (fw->frame.title_area != NULL) { bc = GetFrameConstraint(fw->frame.title_area); bc->child_type = XmFRAME_GENERIC_CHILD; } fw->frame.title_area = nw; if (nc->child_h_spacing == (Dimension) XmINVALID_DIMENSION) nc->child_h_spacing = MAX(10,fw->frame.margin_width); break; case (XmFRAME_WORKAREA_CHILD) : if (fw->frame.work_area != NULL) { bc = GetFrameConstraint(fw->frame.work_area); bc->child_type = XmFRAME_GENERIC_CHILD; } fw->frame.work_area = nw; break; case (XmFRAME_GENERIC_CHILD) : if (nw == fw->frame.title_area) fw->frame.title_area = NULL; else if (nw == fw->frame.work_area) fw->frame.work_area = NULL; break; } } } if (nc->child_h_alignment != cc->child_h_alignment && !XmRepTypeValidValue( XmRID_CHILD_HORIZONTAL_ALIGNMENT, nc->child_h_alignment, nw)) { nc->child_h_alignment = cc->child_h_alignment; } if (nc->child_v_alignment != cc->child_v_alignment && !XmRepTypeValidValue( XmRID_CHILD_VERTICAL_ALIGNMENT, nc->child_v_alignment, nw)) { nc->child_v_alignment = cc->child_v_alignment; } if (nc->child_type == XmFRAME_TITLE_CHILD && (nc->child_h_alignment != cc->child_h_alignment || nc->child_h_spacing != cc->child_h_spacing || nc->child_v_alignment != cc->child_v_alignment)) { reconfigure = True; } if (nc->child_type != cc->child_type) { reconfigure = True; } if (reconfigure && XtIsManaged (nw) && XtIsRealized (nw)) { fw->frame.processing_constraints = True; nw->core.border_width+=1; /* force call to GM */ return (True); } return (False); } /************************************************************************ * * Constraint Destroy * *************************************<->***********************************/ static void ConstraintDestroy( Widget w ) { XmFrameWidget fw; if (!XtIsRectObj (w)) return; fw = (XmFrameWidget)XtParent(w); if (w == fw->frame.title_area) fw->frame.title_area = NULL; else if (w == fw->frame.work_area) fw->frame.work_area = NULL; } /************************************************************************ * * XmCreateFrame * Create an instance of a frame widget and return the widget id. * ************************************************************************/ Widget XmCreateFrame( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget (name, xmFrameWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateFrame( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmFrameWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedFrame( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmFrameWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/Xpmdata.c0000644000175000017500000002673312672140200012464 00000000000000/* $XConsortium: Xpmdata.c /main/6 1996/09/20 08:15:15 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * data.c: * * * * XPM library * * IO utilities * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* October 2004, source code review by Thomas Biege */ /* Official version number */ static char *RCS_Version = "$XpmVersion: 3.4i $"; /* Internal version number */ static char *RCS_Id = "$XpmId: xpm.shar,v 3.62 96/09/14 02:33:07 lehors Exp $"; #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" #include LFUNC(ParseComment, int, (xpmData * mdata)); static int ParseComment(mdata) xpmData *mdata; { if (mdata->type == XPMBUFFER) { register char c; register unsigned int n = 0; unsigned int notend; char *s, *s2; s = mdata->Comment; *s = mdata->Bcmt[0]; /* skip the string beginning comment */ s2 = mdata->Bcmt; do { c = *mdata->cptr++; *++s = c; n++; s2++; } while (c == *s2 && *s2 != '\0' && c); if (*s2 != '\0') { /* this wasn't the beginning of a comment */ mdata->cptr -= n; return 0; } /* store comment */ mdata->Comment[0] = *s; s = mdata->Comment; notend = 1; n = 0; while (notend) { s2 = mdata->Ecmt; while (*s != *s2 && c) { c = *mdata->cptr++; if (n == XPMMAXCMTLEN - 1) { /* forget it */ s = mdata->Comment; n = 0; } *++s = c; n++; } mdata->CommentLength = n; do { c = *mdata->cptr++; if (n == XPMMAXCMTLEN - 1) { /* forget it */ s = mdata->Comment; n = 0; } *++s = c; n++; s2++; } while (c == *s2 && *s2 != '\0' && c); if (*s2 == '\0') { /* this is the end of the comment */ notend = 0; mdata->cptr--; } } return 0; } else { FILE *file = mdata->stream.file; register int c; register unsigned int n = 0, a; unsigned int notend; char *s, *s2; s = mdata->Comment; *s = mdata->Bcmt[0]; /* skip the string beginning comment */ s2 = mdata->Bcmt; do { c = getc(file); *++s = c; n++; s2++; } while (c == *s2 && *s2 != '\0' && c != EOF); if (*s2 != '\0') { /* this wasn't the beginning of a comment */ /* put characters back in the order that we got them */ for (a = n; a > 0; a--, s--) ungetc(*s, file); return 0; } /* store comment */ mdata->Comment[0] = *s; s = mdata->Comment; notend = 1; n = 0; while (notend) { s2 = mdata->Ecmt; while (*s != *s2 && c != EOF) { c = getc(file); if (n == XPMMAXCMTLEN - 1) { /* forget it */ s = mdata->Comment; n = 0; } *++s = c; n++; } mdata->CommentLength = n; do { c = getc(file); if (n == XPMMAXCMTLEN - 1) { /* forget it */ s = mdata->Comment; n = 0; } *++s = c; n++; s2++; } while (c == *s2 && *s2 != '\0' && c != EOF); if (*s2 == '\0') { /* this is the end of the comment */ notend = 0; ungetc(*s, file); } } return 0; } } /* * skip to the end of the current string and the beginning of the next one */ int xpmNextString(mdata) xpmData *mdata; { if (!mdata->type) mdata->cptr = (mdata->stream.data)[++mdata->line]; else if (mdata->type == XPMBUFFER) { register char c; /* get to the end of the current string */ if (mdata->Eos) while ((c = *mdata->cptr++) && c != mdata->Eos); /* * then get to the beginning of the next string looking for possible * comment */ if (mdata->Bos) { while ((c = *mdata->cptr++) && c != mdata->Bos) if (mdata->Bcmt && c == mdata->Bcmt[0]) ParseComment(mdata); } else if (mdata->Bcmt) { /* XPM2 natural */ while ((c = *mdata->cptr++) == mdata->Bcmt[0]) ParseComment(mdata); mdata->cptr--; } } else { register int c; FILE *file = mdata->stream.file; /* get to the end of the current string */ if (mdata->Eos) while ((c = getc(file)) != mdata->Eos && c != EOF); /* * then get to the beginning of the next string looking for possible * comment */ if (mdata->Bos) { while ((c = getc(file)) != mdata->Bos && c != EOF) if (mdata->Bcmt && c == mdata->Bcmt[0]) ParseComment(mdata); } else if (mdata->Bcmt) { /* XPM2 natural */ while ((c = getc(file)) == mdata->Bcmt[0]) ParseComment(mdata); ungetc(c, file); } } return 0; } /* * skip whitespace and compute the following unsigned int, * returns 1 if one is found and 0 if not */ int xpmNextUI(mdata, ui_return) xpmData *mdata; unsigned int *ui_return; { char buf[BUFSIZ]; int l; l = xpmNextWord(mdata, buf, BUFSIZ); return xpmatoui(buf, l, ui_return); } /* * skip whitespace and return the following word */ unsigned int xpmNextWord(mdata, buf, buflen) xpmData *mdata; char *buf; unsigned int buflen; { register unsigned int n = 0; int c; if (!mdata->type || mdata->type == XPMBUFFER) { while (isspace(c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; do { c = *mdata->cptr++; *buf++ = c; n++; } while (!isspace(c) && c != mdata->Eos && n < buflen); n--; mdata->cptr--; } else { FILE *file = mdata->stream.file; while ((c = getc(file)) != EOF && isspace(c) && c != mdata->Eos); while (!isspace(c) && c != mdata->Eos && c != EOF && n < buflen) { *buf++ = c; n++; c = getc(file); } ungetc(c, file); } return (n); /* this returns bytes read + 1 */ } /* * return end of string - WARNING: malloc! */ int xpmGetString(mdata, sptr, l) xpmData *mdata; char **sptr; unsigned int *l; { unsigned int i, n = 0; int c; char *p = NULL, *q, buf[BUFSIZ]; if (!mdata->type || mdata->type == XPMBUFFER) { if (mdata->cptr) { char *start = mdata->cptr; while ((c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; n = mdata->cptr - start + 1; p = (char *) XpmMalloc(n); if (!p) return (XpmNoMemory); strncpy(p, start, n); if (mdata->type) /* XPMBUFFER */ p[n - 1] = '\0'; } } else { FILE *file = mdata->stream.file; if ((c = getc(file)) == EOF) return (XpmFileInvalid); i = 0; q = buf; p = (char *) XpmMalloc(1); while (c != mdata->Eos && c != EOF) { if (i == BUFSIZ) { /* get to the end of the buffer */ /* malloc needed memory */ q = (char *) XpmRealloc(p, n + i); if (!q) { XpmFree(p); return (XpmNoMemory); } p = q; q += n; /* and copy what we already have */ strncpy(q, buf, i); n += i; i = 0; q = buf; } *q++ = c; i++; c = getc(file); } if (c == EOF) { XpmFree(p); return (XpmFileInvalid); } if (n + i != 0) { /* malloc needed memory */ q = (char *) XpmRealloc(p, n + i + 1); if (!q) { XpmFree(p); return (XpmNoMemory); } p = q; q += n; /* and copy the buffer */ strncpy(q, buf, i); n += i; p[n++] = '\0'; } else { *p = '\0'; n = 1; } ungetc(c, file); } *sptr = p; *l = n; return (XpmSuccess); } /* * get the current comment line */ int xpmGetCmt(mdata, cmt) xpmData *mdata; char **cmt; { if (!mdata->type) *cmt = NULL; else if (mdata->CommentLength != 0 && mdata->CommentLength < UINT_MAX - 1) { if( (*cmt = (char *) XpmMalloc(mdata->CommentLength + 1)) == NULL) return XpmNoMemory; strncpy(*cmt, mdata->Comment, mdata->CommentLength); (*cmt)[mdata->CommentLength] = '\0'; mdata->CommentLength = 0; } else *cmt = NULL; return 0; } xpmDataType xpmDataTypes[] = { {"", "!", "\n", '\0', '\n', "", "", "", ""}, /* Natural type */ {"C", "/*", "*/", '"', '"', ",\n", "static char *", "[] = {\n", "};\n"}, {"Lisp", ";", "\n", '"', '"', "\n", "(setq ", " '(\n", "))\n"}, #ifdef VMS {NULL} #else {NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL} #endif }; /* * parse xpm header */ int xpmParseHeader(mdata) xpmData *mdata; { char buf[BUFSIZ+1] = {0}; int l, n = 0; if (mdata->type) { mdata->Bos = '\0'; mdata->Eos = '\n'; mdata->Bcmt = mdata->Ecmt = NULL; l = xpmNextWord(mdata, buf, BUFSIZ); if (l == 7 && !strncmp("#define", buf, 7)) { /* this maybe an XPM 1 file */ char *ptr; l = xpmNextWord(mdata, buf, BUFSIZ); if (!l) return (XpmFileInvalid); buf[l] = '\0'; ptr = rindex(buf, '_'); if (!ptr || strncmp("_format", ptr, l - (ptr - buf))) return XpmFileInvalid; /* this is definitely an XPM 1 file */ mdata->format = 1; n = 1; /* handle XPM1 as mainly XPM2 C */ } else { /* * skip the first word, get the second one, and see if this is * XPM 2 or 3 */ l = xpmNextWord(mdata, buf, BUFSIZ); if ((l == 3 && !strncmp("XPM", buf, 3)) || (l == 4 && !strncmp("XPM2", buf, 4))) { if (l == 3) n = 1; /* handle XPM as XPM2 C */ else { /* get the type key word */ l = xpmNextWord(mdata, buf, BUFSIZ); /* * get infos about this type */ while (xpmDataTypes[n].type && strncmp(xpmDataTypes[n].type, buf, l)) n++; } mdata->format = 0; } else /* nope this is not an XPM file */ return XpmFileInvalid; } if (xpmDataTypes[n].type) { if (n == 0) { /* natural type */ mdata->Bcmt = xpmDataTypes[n].Bcmt; mdata->Ecmt = xpmDataTypes[n].Ecmt; xpmNextString(mdata); /* skip the end of the headerline */ mdata->Bos = xpmDataTypes[n].Bos; mdata->Eos = xpmDataTypes[n].Eos; } else { mdata->Bcmt = xpmDataTypes[n].Bcmt; mdata->Ecmt = xpmDataTypes[n].Ecmt; if (!mdata->format) { /* XPM 2 or 3 */ mdata->Bos = xpmDataTypes[n].Bos; mdata->Eos = '\0'; /* get to the beginning of the first string */ xpmNextString(mdata); mdata->Eos = xpmDataTypes[n].Eos; } else /* XPM 1 skip end of line */ xpmNextString(mdata); } } else /* we don't know about that type of XPM file... */ return XpmFileInvalid; } return XpmSuccess; } motif-2.3.8/lib/Xm/TearOffP.h0000644000175000017500000000241613145162623012542 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTearOffP_h #define _XmTearOffP_h #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmExcludedParentPaneRec { short pane_list_size; Widget *pane; short num_panes; } XmExcludedParentPaneRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTearOffP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/ProtocolsI.h0000644000175000017500000000265712672140200013167 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ProtocolsI.h /main/5 1995/07/13 17:42:04 drk $ */ #ifndef _XmProtocolsI_h #define _XmProtocolsI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmInstallProtocols( Widget w) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmProtocolsI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MessagesI.h0000644000175000017500000003656013145162623012763 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMessagesI_h #define _XmMessagesI_h #include #ifdef __cplusplus extern "C" { #endif /* The symbol _XmConst is used for constant data that cannot be * declared const in the header file because of usage as arguments to * routines which have string arguments that are not declared const. * * So, _XmConst is always defined to be nothing in header files. * In the source file, however, _XmConst is defined to be const, * so as to allow shared data in a shared library environment. */ #ifndef _XmConst #define _XmConst #endif externalref _XmConst char *_XmMsgBaseClass_0000 ; externalref _XmConst char *_XmMsgBaseClass_0001 ; externalref _XmConst char *_XmMsgBaseClass_0002 ; externalref _XmConst char *_XmMsgBulletinB_0001 ; externalref _XmConst char *_XmMsgCascadeB_0000 ; externalref _XmConst char *_XmMsgCascadeB_0001 ; externalref _XmConst char *_XmMsgCascadeB_0002 ; externalref _XmConst char *_XmMsgCascadeB_0003 ; externalref _XmConst char *_XmMsgComboBox_0000 ; externalref _XmConst char *_XmMsgComboBox_0001 ; externalref _XmConst char *_XmMsgComboBox_0002 ; externalref _XmConst char *_XmMsgComboBox_0003 ; externalref _XmConst char *_XmMsgComboBox_0004 ; externalref _XmConst char *_XmMsgComboBox_0005 ; externalref _XmConst char *_XmMsgComboBox_0006 ; externalref _XmConst char *_XmMsgComboBox_0007 ; externalref _XmConst char *_XmMsgComboBox_0008 ; externalref _XmConst char *_XmMsgComboBox_0009 ; externalref _XmConst char *_XmMsgComboBox_0010 ; externalref _XmConst char *_XmMsgComboBox_0011 ; externalref _XmConst char *_XmMsgComboBox_0012 ; externalref _XmConst char *_XmMsgComboBox_0013 ; externalref _XmConst char *_XmMsgComboBox_0014 ; externalref _XmConst char *_XmMsgCommand_0000 ; externalref _XmConst char *_XmMsgCommand_0001 ; externalref _XmConst char *_XmMsgCommand_0002 ; externalref _XmConst char *_XmMsgCommand_0003 ; externalref _XmConst char *_XmMsgCommand_0004 ; externalref _XmConst char *_XmMsgCommand_0005 ; externalref _XmConst char *_XmMsgContainer_0000 ; externalref _XmConst char *_XmMsgContainer_0001 ; externalref _XmConst char *_XmMsgCutPaste_0000 ; externalref _XmConst char *_XmMsgCutPaste_0001 ; externalref _XmConst char *_XmMsgCutPaste_0002 ; externalref _XmConst char *_XmMsgCutPaste_0003 ; externalref _XmConst char *_XmMsgCutPaste_0004 ; externalref _XmConst char *_XmMsgCutPaste_0005 ; externalref _XmConst char *_XmMsgCutPaste_0006 ; externalref _XmConst char *_XmMsgCutPaste_0007 ; externalref _XmConst char *_XmMsgCutPaste_0008 ; externalref _XmConst char *_XmMsgCutPaste_0009 ; externalref _XmConst char *_XmMsgDialogS_0000 ; externalref _XmConst char *_XmMsgDragBS_0000 ; externalref _XmConst char *_XmMsgDragBS_0001 ; externalref _XmConst char *_XmMsgDragBS_0002 ; externalref _XmConst char *_XmMsgDragBS_0003 ; externalref _XmConst char *_XmMsgDragBS_0004 ; externalref _XmConst char *_XmMsgDragBS_0005 ; externalref _XmConst char *_XmMsgDragBS_0006 ; externalref _XmConst char *_XmMsgDragICC_0000 ; externalref _XmConst char *_XmMsgDragICC_0001 ; externalref _XmConst char *_XmMsgDragIcon_0000 ; externalref _XmConst char *_XmMsgDragIcon_0001 ; externalref _XmConst char *_XmMsgDragIcon_0002 ; externalref _XmConst char *_XmMsgDragOverS_0000 ; externalref _XmConst char *_XmMsgDragOverS_0001 ; externalref _XmConst char *_XmMsgDragOverS_0002 ; externalref _XmConst char *_XmMsgDragOverS_0003 ; externalref _XmConst char *_XmMsgDragUnder_0000 ; externalref _XmConst char *_XmMsgDragUnder_0001 ; externalref _XmConst char *_XmMsgForm_0000 ; externalref _XmConst char *_XmMsgForm_0002 ; externalref _XmConst char *_XmMsgForm_0003 ; externalref _XmConst char *_XmMsgForm_0004 ; externalref _XmConst char *_XmMsgGadget_0000 ; externalref _XmConst char *_XmMsgGetSecRes_0000 ; externalref _XmConst char *_XmMsgGrabS_0000 ; externalref _XmConst char *_XmMsgLabel_0003 ; externalref _XmConst char *_XmMsgLabel_0004 ; externalref _XmConst char *_XmMsgList_0000 ; externalref _XmConst char *_XmMsgList_0005 ; externalref _XmConst char *_XmMsgList_0006 ; externalref _XmConst char *_XmMsgList_0007 ; externalref _XmConst char *_XmMsgList_0008 ; externalref _XmConst char *_XmMsgList_0009 ; externalref _XmConst char *_XmMsgList_0010 ; externalref _XmConst char *_XmMsgList_0011 ; externalref _XmConst char *_XmMsgList_0012 ; externalref _XmConst char *_XmMsgList_0013 ; externalref _XmConst char *_XmMsgList_0014 ; externalref _XmConst char *_XmMsgList_0015 ; externalref _XmConst char *_XmMsgMainW_0000 ; externalref _XmConst char *_XmMsgMainW_0001 ; externalref _XmConst char *_XmMsgManager_0000 ; externalref _XmConst char *_XmMsgManager_0001 ; externalref _XmConst char *_XmMsgMenuShell_0000 ; externalref _XmConst char *_XmMsgMenuShell_0001 ; externalref _XmConst char *_XmMsgMenuShell_0002 ; externalref _XmConst char *_XmMsgMenuShell_0003 ; externalref _XmConst char *_XmMsgMenuShell_0004 ; externalref _XmConst char *_XmMsgMenuShell_0005 ; externalref _XmConst char *_XmMsgMenuShell_0006 ; externalref _XmConst char *_XmMsgMenuShell_0007 ; externalref _XmConst char *_XmMsgMenuShell_0008 ; externalref _XmConst char *_XmMsgMenuShell_0009 ; externalref _XmConst char *_XmMsgMessageB_0003 ; externalref _XmConst char *_XmMsgMessageB_0004 ; externalref _XmConst char *_XmMsgNavigMap_0000 ; externalref _XmConst char *_XmMsgNotebook_0000 ; externalref _XmConst char *_XmMsgPanedW_0000 ; externalref _XmConst char *_XmMsgPanedW_0001 ; externalref _XmConst char *_XmMsgPanedW_0002 ; externalref _XmConst char *_XmMsgPanedW_0003 ; externalref _XmConst char *_XmMsgPanedW_0004 ; externalref _XmConst char *_XmMsgPanedW_0005 ; externalref _XmConst char *_XmMsgPrimitive_0000 ; externalref _XmConst char *_XmMsgProtocols_0000 ; externalref _XmConst char *_XmMsgProtocols_0001 ; externalref _XmConst char *_XmMsgProtocols_0002 ; externalref _XmConst char *_XmMsgRegion_0000 ; externalref _XmConst char *_XmMsgResConvert_0000 ; externalref _XmConst char *_XmMsgResConvert_0001 ; externalref _XmConst char *_XmMsgResConvert_0002 ; externalref _XmConst char *_XmMsgResConvert_0003 ; externalref _XmConst char *_XmMsgResConvert_0004 ; externalref _XmConst char *_XmMsgResConvert_0005 ; externalref _XmConst char *_XmMsgResConvert_0006 ; externalref _XmConst char *_XmMsgResConvert_0007 ; externalref _XmConst char *_XmMsgResConvert_0008 ; externalref _XmConst char *_XmMsgResConvert_0009 ; externalref _XmConst char *_XmMsgResConvert_0010 ; externalref _XmConst char *_XmMsgResConvert_0011 ; externalref _XmConst char *_XmMsgResConvert_0012 ; externalref _XmConst char *_XmMsgResConvert_0013 ; externalref _XmConst char *_XmMsgResConvert_0014 ; externalref _XmConst char *_XmMsgResConvert_0015 ; externalref _XmConst char *_XmMsgResConvert_0016 ; externalref _XmConst char *_XmMsgRowColumn_0000 ; externalref _XmConst char *_XmMsgRowColumn_0001 ; externalref _XmConst char *_XmMsgRowColumn_0002 ; externalref _XmConst char *_XmMsgRowColumn_0003 ; externalref _XmConst char *_XmMsgRowColumn_0004 ; externalref _XmConst char *_XmMsgRowColumn_0005 ; externalref _XmConst char *_XmMsgRowColumn_0007 ; externalref _XmConst char *_XmMsgRowColumn_0008 ; externalref _XmConst char *_XmMsgRowColumn_0015 ; externalref _XmConst char *_XmMsgRowColumn_0016 ; externalref _XmConst char *_XmMsgRowColumn_0017 ; externalref _XmConst char *_XmMsgRowColumn_0018 ; externalref _XmConst char *_XmMsgRowColumn_0019 ; externalref _XmConst char *_XmMsgRowColumn_0020 ; externalref _XmConst char *_XmMsgRowColumn_0022 ; externalref _XmConst char *_XmMsgRowColumn_0023 ; externalref _XmConst char *_XmMsgRowColText_0024 ; externalref _XmConst char *_XmMsgRowColumn_0025 ; externalref _XmConst char *_XmMsgRowColumn_0026 ; externalref _XmConst char *_XmMsgRowColumn_0027 ; externalref _XmConst char *_XmMsgScale_0000 ; externalref _XmConst char *_XmMsgScale_0001 ; externalref _XmConst char *_XmMsgScale_0002 ; externalref _XmConst char *_XmMsgScaleScrBar_0004 ; externalref _XmConst char *_XmMsgScale_0005 ; externalref _XmConst char *_XmMsgScale_0006 ; externalref _XmConst char *_XmMsgScale_0007 ; externalref _XmConst char *_XmMsgScale_0008 ; externalref _XmConst char *_XmMsgScale_0009 ; externalref _XmConst char *_XmMsgScreen_0000 ; externalref _XmConst char *_XmMsgScreen_0001 ; externalref _XmConst char *_XmMsgColObj_0001 ; externalref _XmConst char *_XmMsgColObj_0002 ; externalref _XmConst char *_XmMsgScrollBar_0000 ; externalref _XmConst char *_XmMsgScrollBar_0001 ; externalref _XmConst char *_XmMsgScrollBar_0002 ; externalref _XmConst char *_XmMsgScrollBar_0003 ; externalref _XmConst char *_XmMsgScrollBar_0004 ; externalref _XmConst char *_XmMsgScrollBar_0005 ; externalref _XmConst char *_XmMsgScrollBar_0006 ; externalref _XmConst char *_XmMsgScrollBar_0007 ; externalref _XmConst char *_XmMsgScrollBar_0008 ; externalref _XmConst char *_XmMsgScrolledW_0004 ; externalref _XmConst char *_XmMsgScrolledW_0005 ; externalref _XmConst char *_XmMsgScrolledW_0006 ; externalref _XmConst char *_XmMsgScrolledW_0007 ; externalref _XmConst char *_XmMsgScrolledW_0008 ; externalref _XmConst char *_XmMsgScrolledW_0009 ; externalref _XmConst char *_XmMsgScrollVis_0000 ; externalref _XmConst char *_XmMsgSelectioB_0001 ; externalref _XmConst char *_XmMsgSelectioB_0002 ; externalref _XmConst char *_XmMsgSpinB_0001 ; externalref _XmConst char *_XmMsgSpinB_0002 ; externalref _XmConst char *_XmMsgSpinB_0003 ; externalref _XmConst char *_XmMsgSpinB_0004 ; externalref _XmConst char *_XmMsgSpinB_0005 ; externalref _XmConst char *_XmMsgSpinB_0006 ; externalref _XmConst char *_XmMsgSpinB_0007 ; externalref _XmConst char *_XmMsgSpinB_0008 ; externalref _XmConst char *_XmMsgSpinB_0009 ; externalref _XmConst char *_XmMsgText_0000 ; externalref _XmConst char *_XmMsgText_0002 ; externalref _XmConst char *_XmMsgTextF_0000 ; externalref _XmConst char *_XmMsgTextF_0001 ; externalref _XmConst char *_XmMsgTextF_0002 ; externalref _XmConst char *_XmMsgTextF_0003 ; externalref _XmConst char *_XmMsgTextF_0004 ; externalref _XmConst char *_XmMsgTextF_0005 ; externalref _XmConst char *_XmMsgTextF_0006 ; externalref _XmConst char *_XmMsgTextFWcs_0000 ; externalref _XmConst char *_XmMsgTextFWcs_0001 ; externalref _XmConst char *_XmMsgTextIn_0000 ; externalref _XmConst char *_XmMsgTextOut_0000 ; externalref _XmConst char *_XmMsgVendor_0000 ; externalref _XmConst char *_XmMsgVendor_0001 ; externalref _XmConst char *_XmMsgVendor_0002 ; externalref _XmConst char *_XmMsgVendor_0003 ; externalref _XmConst char *_XmMsgVendorE_0000 ; externalref _XmConst char *_XmMsgVendorE_0005 ; externalref _XmConst char *_XmMsgVisual_0000 ; externalref _XmConst char *_XmMsgVisual_0001 ; externalref _XmConst char *_XmMsgVisual_0002 ; externalref _XmConst char *_XmMsgXmIm_0000 ; externalref _XmConst char *_XmMsgResource_0001 ; externalref _XmConst char *_XmMsgResource_0002 ; externalref _XmConst char *_XmMsgResource_0003 ; externalref _XmConst char *_XmMsgResource_0004 ; externalref _XmConst char *_XmMsgResource_0005 ; externalref _XmConst char *_XmMsgResource_0006 ; externalref _XmConst char *_XmMsgResource_0007 ; externalref _XmConst char *_XmMsgResource_0008 ; externalref _XmConst char *_XmMsgResource_0009 ; externalref _XmConst char *_XmMsgResource_0010 ; externalref _XmConst char *_XmMsgResource_0011 ; externalref _XmConst char *_XmMsgResource_0012 ; externalref _XmConst char *_XmMsgResource_0013 ; externalref _XmConst char *_XmMsgGeoUtils_0000 ; externalref _XmConst char *_XmMsgGeoUtils_0001 ; externalref _XmConst char *_XmMsgGeoUtils_0002 ; externalref _XmConst char *_XmMsgDropSMgrI_0001 ; externalref _XmConst char *_XmMsgDropSMgrI_0002 ; externalref _XmConst char *_XmMsgDropSMgrI_0003 ; externalref _XmConst char *_XmMsgDragC_0001 ; externalref _XmConst char *_XmMsgDragC_0002 ; externalref _XmConst char *_XmMsgDragC_0003 ; externalref _XmConst char *_XmMsgDragC_0004 ; externalref _XmConst char *_XmMsgDragC_0005 ; externalref _XmConst char *_XmMsgDragC_0006 ; externalref _XmConst char *_XmMsgDropSMgr_0001 ; externalref _XmConst char *_XmMsgDropSMgr_0002 ; externalref _XmConst char *_XmMsgDropSMgr_0003 ; externalref _XmConst char *_XmMsgDropSMgr_0004 ; externalref _XmConst char *_XmMsgDropSMgr_0005 ; externalref _XmConst char *_XmMsgDropSMgr_0006 ; externalref _XmConst char *_XmMsgDropSMgr_0007 ; externalref _XmConst char *_XmMsgDropSMgr_0008 ; externalref _XmConst char *_XmMsgDropSMgr_0009 ; externalref _XmConst char *_XmMsgDropSMgr_0010 ; externalref _XmConst char *_XmMsgDisplay_0001 ; externalref _XmConst char *_XmMsgDisplay_0002 ; externalref _XmConst char *_XmMsgDisplay_0003 ; externalref _XmConst char *_XmMsgRepType_0000 ; externalref _XmConst char *_XmMsgRepType_0001 ; externalref _XmConst char *_XmMsgRepType_0002 ; externalref _XmConst char *_XmMsgMotif_0000 ; externalref _XmConst char *_XmMsgMotif_0001 ; externalref _XmConst char *_XmMsgXmRenderT_0000 ; externalref _XmConst char *_XmMsgXmRenderT_0001 ; externalref _XmConst char *_XmMsgXmRenderT_0002 ; externalref _XmConst char *_XmMsgXmRenderT_0003 ; externalref _XmConst char *_XmMsgXmRenderT_0004 ; externalref _XmConst char *_XmMsgXmRenderT_0005 ; externalref _XmConst char *_XmMsgXmString_0000 ; externalref _XmConst char *_XmMsgXmTabList_0000 ; externalref _XmConst char *_XmMsgScrollFrameT_0000 ; externalref _XmConst char *_XmMsgScrollFrameT_0001 ; externalref _XmConst char *_XmMsgTransfer_0000 ; externalref _XmConst char *_XmMsgTransfer_0001 ; externalref _XmConst char *_XmMsgTransfer_0002 ; externalref _XmConst char *_XmMsgTransfer_0003 ; externalref _XmConst char *_XmMsgTransfer_0004 ; externalref _XmConst char *_XmMsgTransfer_0005 ; externalref _XmConst char *_XmMsgTransfer_0006 ; externalref _XmConst char *_XmMsgTransfer_0007 ; externalref _XmConst char *_XmMsgVaSimple_0000 ; externalref _XmConst char *_XmMsgVaSimple_0001 ; externalref _XmConst char *_XmMsgVaSimple_0002 ; externalref _XmConst char *_XmMsgXmSelect_0000 ; externalref _XmConst char *_XmMsgXmSelect_0001 ; externalref _XmConst char *_XmMsgXmSelect_0002 ; externalref _XmConst char *_XmMsgPixConv_0000 ; externalref _XmConst char *_XmMsgSSpinB_0001 ; externalref _XmConst char *_XmMsgSSpinB_0002 ; externalref _XmConst char *_XmMsgSSpinB_0003 ; externalref _XmConst char *XME_WARNING; externalref _XmConst char *_XmMsgDataF_0000 ; externalref _XmConst char *_XmMsgDataF_0001 ; externalref _XmConst char *_XmMsgDataF_0002 ; externalref _XmConst char *_XmMsgDataF_0003 ; externalref _XmConst char *_XmMsgDataF_0004 ; externalref _XmConst char *_XmMsgDataF_0005 ; externalref _XmConst char *_XmMsgDataF_0006 ; externalref _XmConst char *_XmMsgDataFWcs_0000 ; externalref _XmConst char *_XmMsgDataFWcs_0001 ; #include "XmMsgI.h" #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMessagesI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragOverS.c0000644000175000017500000030050313145162623012721 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DragOverS.c /main/18 1999/08/11 15:53:11 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /************************************************************************ * * This module dynamically blends and manages the dragover visual using * the XmDragOverShell widget and the following API: * * _XmDragOverHide() * _XmDragOverShow() * _XmDragOverMove() * _XmDragOverChange() * _XmDragOverFinish() * _XmDragOverGetActiveCursor() * _XmDragOverSetInitialPosition() * * The XmDragOverShellPart structure has the following members: * * Position hotX, hotY -- the coordinates of the dragover visual's * hotspot. These are settable resources and are maintained * through the _XmDragOverMove() interface. * * Position initialX, initialY -- the initial coordinates of the * dragover visual's hotspot. These are set in the * XmDragOverShell's initialization and also through the * _XmDragOverSetInitialPosition() interface. These are * used as the zap-back position in the zap-back dropFinish * effect. * * unsigned char mode -- one of {XmPIXMAP, XmCURSOR, XmWINDOW}. * XmPIXMAP indicates the current drag protocol style is * pre-register and indicates that either a pixmap or a * cursor can be used for the dragover visual. XmCURSOR * indicates dynamic protocol style is in effect and that * a cursor must be used for the dragover visual. XmWINDOW * is used during dropFinish processing so that the dragover * visual can persist even without the server grabbed. * * unsigned char activeMode -- one of {XmPIXMAP, XmCURSOR, XmWINDOW}. * Determined by the value of mode and the capabilities of * the hardware. Indicates how the dragover visual is being * rendered. XmCURSOR indicates that the hardware cursor is * being used. XmPIXMAP indicates that a pixmap is being * dragged. XmWINDOW indicates that the XmDragOverShell's * window is popped up and is being dragged. * * Cursor activeCursor -- if activeMode == XmCURSOR, contains the * cursor being used to render the dragover visual. * Otherwise, contains a null cursor. * * unsigned char cursorState -- set within _XmDragOverChange(), * and one of {XmVALID_DROP_SITE, XmINVALID_DROP_SITE, * XmNO_DROP_SITE}, indicates the status of the current * dropsite. * * Pixel cursorForeground, cursorBackground -- indicates the current * foreground and background colors of the dragover visual. * Can depend on the cursorState and the screen's default * colormap. * * XmDragIconObject stateIcon, opIcon -- indicates, respectively, the * current state and operation icons being blended to the * source icon to form the dragover visual. If a state or * operation icon is not being blended, the corresponding * icon here is NULL. * * XmDragOverBlendRec cursorBlend, rootBlend -- cursorBlend contains * the blended icon data for XmCURSOR activeMode and rootBlend * contains the blended icon data for XmPIXMAP and XmWINDOW * activeMode. The blended icon data consists of * * XmDragIconObject sourceIcon -- the source icon. * Position sourceX, sourceY -- the source location * within the blended icon (dragover visual). * XmDragIconObject mixedIcon -- the blended icon. * GC gc -- the gc used to create the blended icon. * the rootBlend gc is also used to render * the blended icon to the display. * * Boolean isVisible -- indicates whether the dragover visual is * visible. Used to avoid unnecessary computation. * * XmBackingRec backing -- contains the backing store needed during * pixmap dragging (XmPIXMAP activeMode) and the dropFinish * effects. Consists of an (x,y) position in root coordinates * and a pixmap. * * Pixmap tmpPix, tmpBit -- scratch pixmap and bitmap used during * pixmap dragging (XmPIXMAP activeMode) to reduce screen * flashing. * * Cursor ncCursor -- the cursor id of the last noncached cursor * used. Needed so the cursor can be freed when it is no * longer needed. * * * * NOTE: This module directly accesses three members of the * XmDragContext structure: * * dc->drag.origDragOver * dc->drag.operation * dc->drag.lastChangeTime * ***********************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "DragCI.h" #include "DragICCI.h" #include "DragIconI.h" #include "DragOverSI.h" #include "MessagesI.h" #include "RegionI.h" #include "ScreenI.h" #include "XmI.h" #define MESSAGE1 _XmMMsgDragOverS_0000 #define MESSAGE2 _XmMMsgDragOverS_0001 #define MESSAGE3 _XmMMsgDragOverS_0002 #define MESSAGE4 _XmMMsgDragOverS_0003 #define PIXMAP_MAX_WIDTH 128 #define PIXMAP_MAX_HEIGHT 128 #define BackingPixmap(dos) (dos->drag.backing.pixmap) #define BackingX(dos) (dos->drag.backing.x) #define BackingY(dos) (dos->drag.backing.y) #define ZAP_TIME 50000L #define MELT_TIME 50000L /******** Static Function Declarations ********/ static void DoZapEffect( XtPointer clientData, XtIntervalId *id) ; static void DoMeltEffect( XtPointer clientData, XtIntervalId *id) ; static void GetIconPosition( XmDragOverShellWidget dos, XmDragIconObject icon, XmDragIconObject sourceIcon, Position *iconX, Position *iconY) ; static void BlendIcon( XmDragOverShellWidget dos, XmDragIconObject icon, XmDragIconObject mixedIcon, #if NeedWidePrototypes int iconX, int iconY, #else Position iconX, Position iconY, #endif /* NeedWidePrototypes */ GC maskGC, GC pixmapGC) ; static void MixedIconSize( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, Dimension *width, Dimension *height) ; static void DestroyMixedIcon( XmDragOverShellWidget dos, XmDragIconObject mixedIcon) ; static void MixIcons( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, XmDragOverBlendRec *blendPtr, #if NeedWidePrototypes int clip) ; #else Boolean clip) ; #endif /* NeedWidePrototypes */ static Boolean FitsInCursor( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon) ; static Boolean GetDragIconColors( XmDragOverShellWidget dos) ; static Cursor GetDragIconCursor( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, #if NeedWidePrototypes int clip, int dirty) ; #else Boolean clip, Boolean dirty) ; #endif /* NeedWidePrototypes */ static void Initialize( Widget req, Widget new_w, ArgList args, Cardinal *numArgs) ; static Boolean SetValues( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void DrawIcon( XmDragOverShellWidget dos, XmDragIconObject icon, Window window, #if NeedWidePrototypes int x, int y) ; #else Position x, Position y) ; #endif /* NeedWidePrototypes */ static void Redisplay( Widget wid, XEvent *event, Region region) ; static void Destroy( Widget w) ; static void ChangeActiveMode( XmDragOverShellWidget dos, #if NeedWidePrototypes unsigned int newActiveMode) ; #else unsigned char newActiveMode) ; #endif /* NeedWidePrototypes */ static void ChangeDragWindow( XmDragOverShellWidget dos) ; static void FindColormapShell(XmDragOverShellWidget dw) ; static void InstallColormap(XmDragOverShellWidget dw) ; static void UninstallColormap(XmDragOverShellWidget dw) ; static void DragOverShellPunchHole(Widget w) ; static void DragOverShellColormapWidget(Widget ds, Widget cw) ; /******** End Static Function Declarations ********/ #undef Offset #define Offset(x) (XtOffsetOf(XmDragOverShellRec, x)) static XtResource resources[]= { { XmNoverrideRedirect, XmCOverrideRedirect, XmRBoolean, sizeof(Boolean), Offset(shell.override_redirect), XtRImmediate, (XtPointer)True, }, { XmNsaveUnder, XmCSaveUnder, XmRBoolean, sizeof(Boolean), Offset(shell.save_under), XtRImmediate, (XtPointer)True, }, { XmNhotX, XmCHot, XmRPosition, sizeof(Position), Offset(drag.hotX), XmRImmediate, (XtPointer)0, }, { XmNhotY, XmCHot, XmRPosition, sizeof(Position), Offset(drag.hotY), XmRImmediate, (XtPointer)0, }, { XmNdragOverMode, XmCDragOverMode, XtRUnsignedChar, sizeof(unsigned char), Offset(drag.mode), XmRImmediate, (XtPointer)XmCURSOR, }, { XmNdragOverActiveMode, XmCDragOverActiveMode, XtRUnsignedChar, sizeof(unsigned char), Offset(drag.activeMode), XmRImmediate, (XtPointer)XmCURSOR, }, { XmNinstallColormap, XmCInstallColormap, XmRBoolean, sizeof(Boolean), Offset(drag.installColormap), XmRImmediate, (XtPointer)FALSE, }, }; #undef Offset /*************************************************************************** * * DragOverShell class record * ***************************************************************************/ externaldef(xmdragovershellclassrec) XmDragOverShellClassRec xmDragOverShellClassRec = { { /* core class record */ (WidgetClass) &vendorShellClassRec, /* superclass */ "XmDragOverShell", /* class_name */ sizeof(XmDragOverShellRec), /* widget_size */ (XtProc)NULL, /* class_initialize proc */ (XtWidgetClassProc)NULL, /* class_part_initialize proc */ FALSE, /* class_inited flag */ Initialize, /* instance initialize proc */ (XtArgsProc)NULL, /* init_hook proc */ XtInheritRealize, /* realize widget proc */ NULL, /* action table for class */ 0, /* num_actions */ resources, /* resource list of class */ XtNumber(resources), /* num_resources in list */ NULLQUARK, /* xrm_class ? */ FALSE, /* don't compress_motion */ XtExposeCompressSeries | /* compressed exposure */ XtExposeNoRegion, FALSE, /* do compress enter-leave */ FALSE, /* do have visible_interest */ Destroy, /* destroy widget proc */ XtInheritResize, /* resize widget proc */ Redisplay, /* expose proc */ SetValues, /* set_values proc */ (XtArgsFunc)NULL, /* set_values_hook proc */ XtInheritSetValuesAlmost, /* set_values_almost proc */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus proc */ XtVersion, /* current version */ NULL, /* callback offset */ NULL, /* default translation table */ XtInheritQueryGeometry, /* query geometry widget proc */ (XtStringProc)NULL, /* display accelerator */ NULL, /* extension record */ }, { /* composite class record */ XtInheritGeometryManager, /* geometry_manager */ XtInheritChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* from the shell */ NULL, /* extension record */ }, { /* shell class record */ NULL, /* extension record */ }, { /* wm shell class record */ NULL, /* extension record */ }, { /* vendor shell class record */ NULL, /* extension record */ }, { /* dragOver shell class record */ NULL, /* extension record */ }, }; externaldef(xmDragOvershellwidgetclass) WidgetClass xmDragOverShellWidgetClass = (WidgetClass) (&xmDragOverShellClassRec); typedef struct _MixedIconCache { Cardinal depth; Dimension width; Dimension height; Pixel cursorForeground; Pixel cursorBackground; Position sourceX; Position sourceY; Position stateX; Position stateY; Position opX; Position opY; Pixmap sourcePixmap; Pixmap statePixmap; Pixmap opPixmap; Pixmap sourceMask; Pixmap stateMask; Pixmap opMask; XmDragIconObject mixedIcon; struct _MixedIconCache *next; } MixedIconCache; static MixedIconCache * mixed_cache = NULL; static Boolean CacheMixedIcon( XmDragOverShellWidget dos, Cardinal depth, Dimension width, Dimension height, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, Position sourceX, Position sourceY, Position stateX, Position stateY, Position opX, Position opY, XmDragIconObject mixedIcon) { register MixedIconCache * cache_ptr; if (mixedIcon == NULL) return False; cache_ptr = XtNew (MixedIconCache); _XmProcessLock(); cache_ptr->next = mixed_cache; mixed_cache = cache_ptr; _XmProcessUnlock(); cache_ptr->depth = depth; cache_ptr->width = width; cache_ptr->height = height; cache_ptr->cursorForeground = dos->drag.cursorForeground; cache_ptr->cursorBackground = dos->drag.cursorBackground; cache_ptr->sourcePixmap = sourceIcon->drag.pixmap; cache_ptr->sourceMask = sourceIcon->drag.mask; cache_ptr->sourceX = sourceX; cache_ptr->sourceY = sourceY; if (stateIcon) { cache_ptr->statePixmap = stateIcon->drag.pixmap; cache_ptr->stateMask = stateIcon->drag.mask; cache_ptr->stateX = stateX; cache_ptr->stateY = stateY; } else { cache_ptr->statePixmap = 0; } if (opIcon) { cache_ptr->opPixmap = opIcon->drag.pixmap; cache_ptr->opMask = opIcon->drag.mask; cache_ptr->opX = opX; cache_ptr->opY = opY; } else { cache_ptr->opPixmap = 0; } cache_ptr->mixedIcon = mixedIcon; return True; } static XmDragIconObject GetMixedIcon( XmDragOverShellWidget dos, Cardinal depth, Dimension width, Dimension height, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, Position sourceX, Position sourceY, Position stateX, Position stateY, Position opX, Position opY) { register MixedIconCache * cache_ptr; for (cache_ptr = mixed_cache; cache_ptr; cache_ptr = cache_ptr->next) { if (cache_ptr->depth == depth && cache_ptr->width == width && cache_ptr->height == height && cache_ptr->cursorForeground == dos->drag.cursorForeground && cache_ptr->cursorBackground == dos->drag.cursorBackground && cache_ptr->sourcePixmap == sourceIcon->drag.pixmap && cache_ptr->sourceMask == sourceIcon->drag.mask && cache_ptr->sourceX == sourceX && cache_ptr->sourceY == sourceY && ((cache_ptr->statePixmap == 0 && !stateIcon) || (stateIcon && cache_ptr->statePixmap == stateIcon->drag.pixmap && cache_ptr->stateMask == stateIcon->drag.mask && cache_ptr->stateX == stateX && cache_ptr->stateY == stateY)) && ((cache_ptr->opPixmap == 0 && !opIcon) || (opIcon && cache_ptr->opPixmap == opIcon->drag.pixmap && cache_ptr->opMask == opIcon->drag.mask && cache_ptr->opX == opX && cache_ptr->opY == opY))) { return (cache_ptr->mixedIcon); } } return ((XmDragIconObject)NULL); } /************************************************************************ * * DoZapEffect() * ***********************************************************************/ /*ARGSUSED*/ static void DoZapEffect( XtPointer clientData, XtIntervalId *id) /* unused */ { XmDragOverShellWidget dos = (XmDragOverShellWidget)clientData; Display *display = XtDisplay((Widget) dos); XSegment segments[4]; int j; int i = 0; int rise, run; int centerX, centerY; GC draw_gc = dos->drag.rootBlend.gc; XGCValues v; unsigned long vmask; Window root = RootWindowOfScreen(XtScreen(dos)); for (j = 0; j < 4; j++) { segments[j].x1 = dos->drag.initialX; segments[j].y1 = dos->drag.initialY; } segments[0].x2 = dos->core.x; segments[0].y2 = dos->core.y; segments[1].x2 = dos->core.x; segments[1].y2 = dos->core.y + dos->core.height; segments[2].x2 = dos->core.x + dos->core.width; segments[2].y2 = dos->core.y + dos->core.height; segments[3].x2 = dos->core.x + dos->core.width; segments[3].y2 = dos->core.y; centerX = dos->core.x + dos->core.width/2; centerY = dos->core.y + dos->core.height/2; rise = (dos->drag.initialY - centerY) / 5; run = (dos->drag.initialX - centerX) / 5; /* * Draw the lines and add the timeout. */ v.foreground = dos->drag.cursorForeground; v.function = GXxor; v.clip_mask = None; vmask = GCForeground|GCFunction|GCClipMask; XChangeGC (display, draw_gc, vmask, &v); XDrawSegments (display, root, draw_gc, segments, 4); XFlush(display); /* * Do an abbreviated zap effect if the rise and run are both small. */ if (((rise <= 3) && (rise >= -3)) && ((run <= 3) && (run >= -3))) { i = 5; } for (; ; i++ ) { /* wait */ XmeMicroSleep (ZAP_TIME); /* * Erase the previously drawn lines and restore the root. */ XDrawSegments (display, root, draw_gc, segments, 4); if (dos->drag.activeMode != XmDRAG_WINDOW) { v.foreground = dos->drag.cursorForeground; v.function = GXcopy; vmask = GCForeground|GCFunction; XChangeGC (display, draw_gc, vmask, &v); XCopyArea (display, BackingPixmap(dos), root, draw_gc, 0, 0, dos->core.width, dos->core.height, segments[0].x2, segments[0].y2); } /* Here is where we always leave the loop */ if (i == 5) break; /* * Compute the new position. * Save the root. * Draw the pixmap (mixedIcon exists) and new lines. */ segments[0].x2 += run; segments[0].y2 += rise; segments[1].x2 += run; segments[1].y2 += rise; segments[2].x2 += run; segments[2].y2 += rise; segments[3].x2 += run; segments[3].y2 += rise; if (dos->drag.activeMode == XmDRAG_WINDOW) { XtMoveWidget((Widget) dos, segments[0].x2, segments[0].y2); } else { XCopyArea (display, root, BackingPixmap(dos), draw_gc, segments[0].x2, segments[0].y2, dos->core.width, dos->core.height, 0, 0); DrawIcon (dos, (dos->drag.rootBlend.mixedIcon ? dos->drag.rootBlend.mixedIcon : dos->drag.cursorBlend.mixedIcon), root, segments[0].x2, segments[0].y2); } v.foreground = 1; v.function = GXxor; vmask = GCForeground|GCFunction; XChangeGC (display, draw_gc, vmask, &v); XDrawSegments (display, root, draw_gc, segments, 4); XFlush (display); } XFlush (display); } /************************************************************************ * * DoMeltEffect() * * This function is responsible for restoring the display after a * drop has occurred in a receptive area. It uses a timeout to create * a venetian blind effect as it removes the drag pixmap, and restores * the original root window contents. ***********************************************************************/ /*ARGSUSED*/ static void DoMeltEffect( XtPointer clientData, XtIntervalId *id) /* unused */ { XmDragOverShellWidget dos = (XmDragOverShellWidget)clientData; int iterations; int i = 0; int xClipOffset; int yClipOffset; XRectangle rects[4]; if (dos->drag.activeMode == XmDRAG_WINDOW) { XRectangle rect; Dimension width = XtWidth(dos); Dimension height = XtHeight(dos); /* * Determine how much to shrink on each pass. */ if ((xClipOffset = (width / 16)) <= 0) { xClipOffset = 1; } if ((yClipOffset = (height / 16)) <= 0) { yClipOffset = 1; } iterations = MIN(width/(2*xClipOffset), height/(2*yClipOffset)); /* * Generate the clipping rectangles. * We converge on the center of the cursor. */ rect.x = 0; rect.y = 0; rect.width = width; rect.height = height; for (i = 0; i < iterations; i++) { XShapeCombineRectangles(XtDisplay(dos), XtWindow(dos), ShapeBounding, 0, 0, &rect, 1, ShapeSet, YXSorted); XFlush (XtDisplay((Widget) dos)); rect.x += xClipOffset; rect.width -= 2*xClipOffset; rect.y += yClipOffset; rect.height -= 2*yClipOffset; /* wait */ XmeMicroSleep (MELT_TIME); } } else { XmDragIconObject sourceIcon; XmDragOverBlend blend; GC draw_gc = dos->drag.rootBlend.gc; /* * Blend a new mixedIcon using only the source icon. * Place the new mixedIcon to preserve the source icon location. * The current mixedIcon data is valid. */ if (dos->drag.rootBlend.sourceIcon) { sourceIcon = dos->drag.rootBlend.sourceIcon; blend = &dos->drag.rootBlend; } else { sourceIcon = dos->drag.cursorBlend.sourceIcon; blend = &dos->drag.cursorBlend; } /* * Determine how much to shrink on each pass. */ if ((xClipOffset = (sourceIcon->drag.width / 16)) <= 0) { xClipOffset = 1; } if ((yClipOffset = (sourceIcon->drag.height / 16)) <= 0) { yClipOffset = 1; } iterations = MIN(sourceIcon->drag.width/(2*xClipOffset), sourceIcon->drag.height/(2*yClipOffset)); /* * Generate the clipping rectangles. * We converge on the center of the cursor. */ rects[0].x = dos->core.x; rects[0].y = dos->core.y; rects[0].width = dos->core.width; rects[0].height = blend->sourceY + yClipOffset; rects[1].x = rects[0].x + blend->sourceX + sourceIcon->drag.width - xClipOffset; rects[1].y = rects[0].y + yClipOffset + blend->sourceY; rects[1].width = dos->core.width - (rects[1].x - rects[0].x); rects[1].height = dos->core.height - ((yClipOffset * 2) + blend->sourceY); rects[2].x = rects[0].x; rects[2].y = rects[0].y + blend->sourceY + sourceIcon->drag.height - yClipOffset; rects[2].width = rects[0].width; rects[2].height = dos->core.height - (rects[2].y - rects[0].y); rects[3].x = rects[0].x; rects[3].y = rects[0].y + yClipOffset + blend->sourceY; rects[3].width = xClipOffset + blend->sourceX; rects[3].height = rects[1].height; for (i = 0; i < iterations; i++) { XSetClipRectangles (XtDisplay((Widget)dos), draw_gc, 0, 0, rects, 4, Unsorted); XCopyArea (XtDisplay((Widget)dos), BackingPixmap(dos), RootWindowOfScreen(XtScreen(dos)), draw_gc, 0, 0, dos->core.width, dos->core.height, dos->core.x, dos->core.y); XFlush (XtDisplay((Widget)dos)); rects[0].height += yClipOffset; rects[1].x -= xClipOffset; rects[1].width += xClipOffset; rects[2].y -= yClipOffset; rects[2].height += yClipOffset; rects[3].width += xClipOffset; /* wait */ XmeMicroSleep (MELT_TIME); } XSetClipMask (XtDisplay((Widget)dos), draw_gc, None); XCopyArea (XtDisplay((Widget)dos), BackingPixmap(dos), RootWindowOfScreen(XtScreen(dos)), draw_gc, 0, 0, dos->core.width, dos->core.height, dos->core.x, dos->core.y); XFlush (XtDisplay((Widget)dos)); } } /************************************************************************ * * GetIconPosition () * * Get the state or operation icon position, relative to the source. ***********************************************************************/ static void GetIconPosition( XmDragOverShellWidget dos, XmDragIconObject icon, XmDragIconObject sourceIcon, Position *iconX, Position *iconY) { switch ((int) icon->drag.attachment) { default: XmeWarning ((Widget) icon, MESSAGE2); /* cast ok here */ case XmATTACH_NORTH_WEST: *iconX = icon->drag.offset_x; *iconY = icon->drag.offset_y; break; case XmATTACH_NORTH: *iconX = ((Position) sourceIcon->drag.width/2) + icon->drag.offset_x; *iconY = icon->drag.offset_y; break; case XmATTACH_NORTH_EAST: *iconX = ((Position) sourceIcon->drag.width) + icon->drag.offset_x; *iconY = icon->drag.offset_y; break; case XmATTACH_EAST: *iconX = ((Position) sourceIcon->drag.width) + icon->drag.offset_x; *iconY = ((Position) sourceIcon->drag.height/2) + icon->drag.offset_y; break; case XmATTACH_SOUTH_EAST: *iconX = ((Position) sourceIcon->drag.width) + icon->drag.offset_x; *iconY = ((Position) sourceIcon->drag.height) + icon->drag.offset_y; break; case XmATTACH_SOUTH: *iconX = ((Position) sourceIcon->drag.width/2) + icon->drag.offset_x; *iconY = ((Position) sourceIcon->drag.height) + icon->drag.offset_y; break; case XmATTACH_SOUTH_WEST: *iconX = icon->drag.offset_x; *iconY = ((Position) sourceIcon->drag.height) + icon->drag.offset_y; break; case XmATTACH_WEST: *iconX = icon->drag.offset_x; *iconY = ((Position) sourceIcon->drag.height/2) + icon->drag.offset_y; break; case XmATTACH_CENTER: *iconX = ((Position) sourceIcon->drag.width/2) + icon->drag.offset_x; *iconY = ((Position) sourceIcon->drag.height/2) + icon->drag.offset_y; break; case XmATTACH_HOT: { XmDragContext dc = (XmDragContext)XtParent (dos); Window root, child; int rootX, rootY, winX, winY; unsigned int modMask; XmDragOverShellWidget ref; /* * This code is only applicable for the stateIcon. * If the opIcon is XmATTACH_HOT, its hotspot should * be placed at the stateIcon's hotspot. * * If this is the first time we are blending the * stateIcon, we will place its hotspot at the * same source icon position as the pointer's * position within the reference widget. * * Otherwise, we want to keep the icon fixed relative * to the source. To do this, we need the mixedIcon * data to be current. This means the cursorCache * must not be used with stateIcon XmATTACH_HOT. */ ref = (dc->drag.origDragOver != NULL) ? dc->drag.origDragOver : dos; if (ref->drag.rootBlend.mixedIcon) { *iconX = ref->drag.rootBlend.mixedIcon->drag.hot_x - ref->drag.rootBlend.sourceX - icon->drag.hot_x; *iconY = ref->drag.rootBlend.mixedIcon->drag.hot_y - ref->drag.rootBlend.sourceY - icon->drag.hot_y; } else if (ref->drag.cursorBlend.mixedIcon) { *iconX = ref->drag.cursorBlend.mixedIcon->drag.hot_x - ref->drag.cursorBlend.sourceX - icon->drag.hot_x; *iconY = ref->drag.cursorBlend.mixedIcon->drag.hot_y - ref->drag.cursorBlend.sourceY - icon->drag.hot_y; } else { Widget sourceWidget; Dimension borderW = 0; Dimension highlightT = 0; Dimension shadowT = 0; Cardinal ac; Arg al[3]; /* * First time: get position from pointer, * adjusting for sourceWidget's border, highlight, * and shadow. */ sourceWidget = dc->drag.sourceWidget; ac = 0; XtSetArg (al[ac], XmNborderWidth, &borderW); ac++; XtSetArg (al[ac], XmNhighlightThickness, &highlightT); ac++; XtSetArg (al[ac], XmNshadowThickness, &shadowT); ac++; XtGetValues (sourceWidget, al, ac); XQueryPointer (XtDisplay (dos), XtWindow (sourceWidget), &root, &child, &rootX, &rootY, &winX, &winY, &modMask); *iconX = winX - icon->drag.hot_x - borderW - highlightT - shadowT; *iconY = winY - icon->drag.hot_y - borderW - highlightT - shadowT; } } break; } } /************************************************************************ * BlendIcon () * * Blend the icon mask and pixmap into mixedIcon. ***********************************************************************/ static void BlendIcon( XmDragOverShellWidget dos, XmDragIconObject icon, XmDragIconObject mixedIcon, #if NeedWidePrototypes int iconX, int iconY, #else Position iconX, Position iconY, #endif /* NeedWidePrototypes */ GC maskGC, GC pixmapGC) { Display *display = XtDisplay(dos); Position sourceX = 0; Position sourceY = 0; Position destX = iconX; Position destY = iconY; Dimension destWidth = icon->drag.width; Dimension destHeight = icon->drag.height; XGCValues v; unsigned long vmask; if (icon->drag.pixmap != XmUNSPECIFIED_PIXMAP) { /* Clip to the destination drawable. */ if (destX < 0) { sourceX -= destX; /* > 0 */ destX = 0; if (destWidth <= (Dimension) sourceX) { return; } destWidth -= sourceX; } if (destX + destWidth > mixedIcon->drag.width) { if ((Dimension) destX >= mixedIcon->drag.width) { return; } destWidth = mixedIcon->drag.width - destX; } if (destY < 0) { sourceY -= destY; /* > 0 */ destY = 0; if (destHeight <= (Dimension) sourceY) { return; } destHeight -= sourceY; } if (destY + destHeight > mixedIcon->drag.height) { if ((Dimension) destY >= mixedIcon->drag.height) { return; } destHeight = mixedIcon->drag.height - destY; } v.clip_mask = None; vmask = GCClipMask; if (icon->drag.mask != XmUNSPECIFIED_PIXMAP) { /* Union the masks */ v.function = GXor; vmask |= GCFunction; XChangeGC(display, maskGC, vmask, &v); XCopyArea(display, icon->drag.mask, mixedIcon->drag.mask, maskGC, sourceX, sourceY, mixedIcon->drag.width, mixedIcon->drag.height, destX, destY); v.clip_mask = icon->drag.mask; v.clip_x_origin = destX; v.clip_y_origin = destY; vmask = GCClipMask|GCClipXOrigin|GCClipYOrigin; } else { /* Create empty mask if we're masking and the blend icon has no mask */ if (mixedIcon->drag.mask != XmUNSPECIFIED_PIXMAP){ v.function = GXset; vmask |= GCFunction; XChangeGC (display, maskGC, vmask, &v); XFillRectangle (display, mixedIcon->drag.mask, maskGC, destX, destY, destWidth, destHeight); } } /* Join the regions if they both have them, otherwise, remove the region */ if (icon->drag.region != NULL && mixedIcon->drag.region != NULL) { if (icon->drag.x_offset || icon->drag.y_offset) XOffsetRegion(icon->drag.region, -icon->drag.x_offset, -icon->drag.y_offset); XOffsetRegion(icon->drag.region, destX, destY); icon->drag.x_offset = destX; icon->drag.y_offset = destY; XUnionRegion(mixedIcon->drag.region, icon->drag.region, mixedIcon->drag.region); } else { if (mixedIcon->drag.region != NULL) XDestroyRegion(mixedIcon->drag.region); mixedIcon->drag.region = NULL; } /* * Copy the pixmap. */ if (mixedIcon->drag.depth > 1) { v.foreground = dos->drag.cursorForeground; v.background = dos->drag.cursorBackground; } else { /* Else B & W */ v.foreground = 1; v.background = 0; } v.function = GXcopy; vmask |= GCFunction|GCForeground|GCBackground; XChangeGC (display, pixmapGC, vmask, &v); if (icon->drag.depth == 1) { XCopyPlane (display, icon->drag.pixmap, mixedIcon->drag.pixmap, pixmapGC, sourceX, sourceY, icon->drag.width, icon->drag.height, destX, destY, 1L); } else if (icon->drag.depth == mixedIcon->drag.depth) { XCopyArea (display, icon->drag.pixmap, mixedIcon->drag.pixmap, pixmapGC, sourceX, sourceY, icon->drag.width, icon->drag.height, destX, destY); } else { XmeWarning ((Widget) icon, MESSAGE1); /* cast ok here */ } } } /************************************************************************ * * MixedIconSize () * * Determine the dimensions of the mixedIcon. ***********************************************************************/ static void MixedIconSize( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, Dimension *width, Dimension *height) { Position sourceX = 0, sourceY = 0; Position minX = 0, minY = 0; Position stateX = 0, stateY = 0; Position opX, opY; Position maxX, maxY; if (stateIcon) { GetIconPosition (dos, stateIcon, sourceIcon, &stateX, &stateY); minX = MIN(stateX, minX); minY = MIN(stateY, minY); } if (opIcon) { if (opIcon->drag.attachment == XmATTACH_HOT && stateIcon) { opX = stateX + stateIcon->drag.hot_x - opIcon->drag.hot_x; opY = stateY + stateIcon->drag.hot_y - opIcon->drag.hot_y; } else { GetIconPosition (dos, opIcon, sourceIcon, &opX, &opY); } minX = MIN(opX, minX); minY = MIN(opY, minY); } sourceX -= minX; /* >= 0 */ sourceY -= minY; /* >= 0 */ maxX = sourceX + sourceIcon->drag.width; maxY = sourceY + sourceIcon->drag.height; if (stateIcon) { stateX -= minX; stateY -= minY; maxX = MAX(stateX + ((Position) stateIcon->drag.width), maxX); maxY = MAX(stateY + ((Position) stateIcon->drag.height), maxY); } if (opIcon) { opX -= minX; opY -= minY; maxX = MAX(opX + ((Position) opIcon->drag.width), maxX); maxY = MAX(opY + ((Position) opIcon->drag.height), maxY); } *width = maxX; *height = maxY; } /************************************************************************ * * DestroyMixedIcon () * * The MixedIcon's pixmap and mask, if present, were scratch pixmaps, * and not from the Xm pixmap cache. Therefore, they need to be freed * separately and reset to XmUNSPECIFIED_PIXMAP. ***********************************************************************/ static void DestroyMixedIcon( XmDragOverShellWidget dos, XmDragIconObject mixedIcon) { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(dos)); MixedIconCache *cache_ptr; MixedIconCache *prev_cache_ptr = NULL; if (mixedIcon->drag.pixmap != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, mixedIcon->drag.pixmap); mixedIcon->drag.pixmap = XmUNSPECIFIED_PIXMAP; } if (mixedIcon->drag.mask != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, mixedIcon->drag.mask); mixedIcon->drag.mask = XmUNSPECIFIED_PIXMAP; } _XmProcessLock(); cache_ptr = mixed_cache; while(cache_ptr) { MixedIconCache *next_cache_ptr = cache_ptr -> next; if (cache_ptr->mixedIcon == mixedIcon) { if (cache_ptr == mixed_cache) { prev_cache_ptr = mixed_cache = cache_ptr->next; } else { prev_cache_ptr->next = cache_ptr->next; } XtFree((char *) cache_ptr); } else { prev_cache_ptr = cache_ptr; } cache_ptr = next_cache_ptr; } _XmProcessUnlock(); XtDestroyWidget ((Widget) mixedIcon); } /************************************************************************ * * MixIcons () * ***********************************************************************/ static void MixIcons( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, XmDragOverBlendRec *blendPtr, #if NeedWidePrototypes int clip) #else Boolean clip) #endif /* NeedWidePrototypes */ { Display *display = XtDisplay(dos); XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(dos)); XmDragIconObject mixedIcon = blendPtr->mixedIcon; XmDragOverBlendRec *cursorBlend = &dos->drag.cursorBlend; Arg al[8]; Cardinal ac; Pixmap pixmap, mask; Position sourceX = 0, sourceY = 0; Position stateX = 0, stateY = 0; Position opX = 0, opY = 0; Position minX = 0, minY = 0; Position maxX, maxY; Position hotX, hotY; Dimension width, height; Cardinal depth; Boolean need_mask = True; Boolean do_cache = True; XGCValues v; unsigned long vmask; dos->drag.holePunched = False; /* Force update */ /* * Determine the dimensions of the blended icon and the positions * of each component within it. */ if (stateIcon) { GetIconPosition (dos, stateIcon, sourceIcon, &stateX, &stateY); minX = MIN(stateX, minX); minY = MIN(stateY, minY); } /* * If the opIcon's attachment is XmATTACH_HOT, attach its hotspot * to the stateIcon's hotspot -- the blended icon's hotspot will be * there, and the blended icon will be positioned so that the blended * hotspot is placed at the cursor position. */ if (opIcon) { if (opIcon->drag.attachment == XmATTACH_HOT && stateIcon) { opX = stateX + stateIcon->drag.hot_x - opIcon->drag.hot_x; opY = stateY + stateIcon->drag.hot_y - opIcon->drag.hot_y; } else { GetIconPosition (dos, opIcon, sourceIcon, &opX, &opY); } minX = MIN(opX, minX); minY = MIN(opY, minY); } sourceX -= minX; /* >= 0 */ sourceY -= minY; /* >= 0 */ maxX = sourceX + sourceIcon->drag.width; maxY = sourceY + sourceIcon->drag.height; if (stateIcon) { stateX -= minX; stateY -= minY; maxX = MAX(stateX + ((Position) stateIcon->drag.width), maxX); maxY = MAX(stateY + ((Position) stateIcon->drag.height), maxY); hotX = stateX + stateIcon->drag.hot_x; hotY = stateY + stateIcon->drag.hot_y; } else { hotX = sourceX + sourceIcon->drag.hot_x; hotY = sourceY + sourceIcon->drag.hot_y; } if (opIcon) { opX -= minX; opY -= minY; maxX = MAX(opX + ((Position) opIcon->drag.width), maxX); maxY = MAX(opY + ((Position) opIcon->drag.height), maxY); } width = maxX; height = maxY; depth = ((blendPtr == cursorBlend) ? 1 : dos->core.depth); /* * If we are clipping the blended icon to fit within a cursor, * we clip it around the hotspot. */ if (clip) { Dimension maxWidth, maxHeight; XmeQueryBestCursorSize((Widget) dos, &maxWidth, &maxHeight); /* Pick new bounds to get the maximum icon possible while including the hotspot within the icon bounds */ if (width > maxWidth) { minX = MAX(0, hotX - ((Position) maxWidth) / 2); minX = MIN(minX, width - ((Position) maxWidth)); hotX -= minX; sourceX -= minX; stateX -= minX; opX -= minX; width = maxWidth; } if (height > maxHeight) { minY = MAX(0, hotY - ((Position) maxHeight) / 2); minY = MIN(minY, height - ((Position) maxHeight)); hotY -= minY; sourceY -= minY; stateY -= minY; opY -= minY; height = maxHeight; } } mixedIcon = GetMixedIcon(dos, depth, width, height, sourceIcon, stateIcon, opIcon, sourceX, sourceY, stateX, stateY, opX, opY); /* * Create the blended XmDragIcon object or use the current one * if it is the correct size and depth. */ if (mixedIcon != NULL) { blendPtr->mixedIcon = mixedIcon; do_cache = False; } /* * The blended icon needs a mask unless none of its component icons * has a mask and its component icons completely cover it. */ if ((sourceIcon->drag.mask == XmUNSPECIFIED_PIXMAP) && (!stateIcon || stateIcon->drag.mask == XmUNSPECIFIED_PIXMAP) && (!opIcon || opIcon->drag.mask == XmUNSPECIFIED_PIXMAP)) { XRectangle rect; Region source = XCreateRegion(); Region dest = XCreateRegion(); Region tmp; rect.x = (short) sourceX; rect.y = (short) sourceY; rect.width = (unsigned short) sourceIcon->drag.width; rect.height = (unsigned short) sourceIcon->drag.height; XUnionRectWithRegion (&rect, source, dest); if (stateIcon) { tmp = source; source = dest; dest = tmp; rect.x = (short) stateX; rect.y = (short) stateY; rect.width = (unsigned short) stateIcon->drag.width; rect.height = (unsigned short) stateIcon->drag.height; XUnionRectWithRegion (&rect, source, dest); } if (opIcon) { tmp = source; source = dest; dest = tmp; rect.x = (short) opX; rect.y = (short) opY; rect.width = (unsigned short) opIcon->drag.width; rect.height = (unsigned short) opIcon->drag.height; XUnionRectWithRegion (&rect, source, dest); } if (RectangleIn == XRectInRegion (dest, 0, 0, width, height)) { need_mask = False; } XDestroyRegion (source); XDestroyRegion (dest); } if (mixedIcon == NULL) { pixmap = _XmAllocScratchPixmap (xmScreen, depth, width, height); mask = XmUNSPECIFIED_PIXMAP; ac = 0; XtSetArg(al[ac], XmNpixmap, pixmap); ac++; XtSetArg(al[ac], XmNmask, mask); ac++; XtSetArg(al[ac], XmNdepth, depth); ac++; XtSetArg(al[ac], XmNwidth, width); ac++; XtSetArg(al[ac], XmNheight, height); ac++; XtSetArg(al[ac], XmNhotX, hotX); ac++; XtSetArg(al[ac], XmNhotY, hotY); ac++; mixedIcon = blendPtr->mixedIcon = (XmDragIconObject) XmCreateDragIcon ((Widget) xmScreen, "mixedIcon", al, ac); if (need_mask) { mask = mixedIcon->drag.mask = _XmAllocScratchPixmap (xmScreen, 1, width, height); } } else { pixmap = mixedIcon->drag.pixmap; mixedIcon->drag.hot_x = hotX; mixedIcon->drag.hot_y = hotY; if (need_mask && mixedIcon->drag.mask == XmUNSPECIFIED_PIXMAP) { mixedIcon->drag.mask = _XmAllocScratchPixmap (xmScreen, 1, width, height); } mask = mixedIcon->drag.mask; } if (sourceIcon->drag.region != NULL) { if (mixedIcon->drag.region != NULL) XDestroyRegion(mixedIcon->drag.region); mixedIcon->drag.region = XCreateRegion(); } /* * Get the cursorBlend GC if needed (the root GC already exists). * Set the pixmap to its background color. * Clear any mask. */ if (blendPtr->gc == NULL) { v.background = 0; v.foreground = 1; v.function = GXset; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; v.clip_mask = None; v.clip_x_origin = 0; /* pedantic */ v.clip_y_origin = 0; /* pedantic */ vmask = GCBackground|GCForeground|GCFunction| GCClipXOrigin|GCClipYOrigin|GCClipMask| GCGraphicsExposures|GCSubwindowMode; blendPtr->gc = XtAllocateGC((Widget) dos, mixedIcon -> drag.depth, vmask, &v, vmask, 0L); } else { v.clip_mask = None; v.function = GXset; vmask = GCClipMask|GCFunction; XChangeGC (display, blendPtr->gc, vmask, &v); } XFillRectangle (display, pixmap, blendPtr->gc, 0, 0, mixedIcon->drag.width, mixedIcon->drag.height); if (mask != XmUNSPECIFIED_PIXMAP) { if (cursorBlend->gc == NULL) { v.background = 0; v.foreground = 1; v.function = GXclear; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; v.clip_mask = None; v.clip_x_origin = 0; /* pedantic */ v.clip_y_origin = 0; /* pedantic */ vmask = GCBackground|GCForeground|GCFunction| GCClipXOrigin|GCClipYOrigin|GCClipMask| GCGraphicsExposures|GCSubwindowMode; cursorBlend->gc = XtAllocateGC((Widget) dos, 1, vmask, &v, vmask, 0L); } else { v.function = GXclear; vmask = GCFunction; if (cursorBlend->gc != blendPtr->gc) { v.clip_mask = None; vmask |= GCClipMask; } XChangeGC (display, cursorBlend->gc, vmask, &v); } XFillRectangle (display, mixedIcon->drag.mask, cursorBlend->gc, 0, 0, mixedIcon->drag.width, mixedIcon->drag.height); } /* * Blend the icons into mixedIcon. */ BlendIcon (dos, sourceIcon, mixedIcon, sourceX, sourceY, cursorBlend->gc, blendPtr->gc); blendPtr->sourceX = sourceX; blendPtr->sourceY = sourceY; if (stateIcon) { BlendIcon (dos, stateIcon, mixedIcon, stateX, stateY, cursorBlend->gc, blendPtr->gc); } if (opIcon) { BlendIcon (dos, opIcon, mixedIcon, opX, opY, cursorBlend->gc, blendPtr->gc); } if (mixedIcon->drag.region != NULL) { XRectangle rect; if (mixedIcon->drag.restore_region != NULL) XDestroyRegion(mixedIcon->drag.restore_region); mixedIcon->drag.restore_region = XCreateRegion(); rect.x = 0; rect.y = 0; rect.width = mixedIcon->drag.width; rect.height = mixedIcon->drag.height; XUnionRectWithRegion(&rect, mixedIcon->drag.restore_region, mixedIcon->drag.restore_region); XSubtractRegion(mixedIcon->drag.restore_region, mixedIcon->drag.region, mixedIcon->drag.restore_region); } if (do_cache) { CacheMixedIcon(dos, depth, width, height, sourceIcon, stateIcon, opIcon, sourceX, sourceY, stateX, stateY, opX, opY, mixedIcon); } /* do_cache */ } /************************************************************************ * * FitsInCursor () * ***********************************************************************/ static Boolean FitsInCursor( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon) { Dimension maxWidth, maxHeight; Dimension width, height; if (((sourceIcon->drag.depth != 1) || (sourceIcon->drag.pixmap == XmUNSPECIFIED_PIXMAP))) { return False; } MixedIconSize (dos, sourceIcon, stateIcon, opIcon, &width, &height); XmeQueryBestCursorSize((Widget)dos, &maxWidth, &maxHeight); if (width > maxWidth || height > maxHeight) { return False; } return True; } /************************************************************************ * * GetDragIconColors () * * Gets the cursor colors. Creates or recolors the root's gc. ***********************************************************************/ static Boolean GetDragIconColors( XmDragOverShellWidget dos ) { XmDragContext dc = (XmDragContext)XtParent(dos); Screen *screen = XtScreen(dos); Display *display = XtDisplay(dos); Boolean doChange = False; Pixel fg; Pixel bg; XGCValues v; unsigned long vmask; XColor colors[2]; Colormap colormap; colormap = dc->core.colormap; bg = dc->drag.cursorBackground; switch ((int) dos->drag.cursorState) { case XmVALID_DROP_SITE: fg = dc->drag.validCursorForeground; break; case XmINVALID_DROP_SITE: fg = dc->drag.invalidCursorForeground; break; default: XmeWarning ((Widget) dos, MESSAGE3); case XmNO_DROP_SITE: fg = dc->drag.noneCursorForeground; break; } /* * Find the best RGB fit for fg and bg on the current screen. * If XAllocColor() fails or if the fitted fg and bg are the same on the * current screen, use black and white respectively. */ colors[0].pixel = fg; colors[1].pixel = bg; XQueryColors(display, colormap, colors, 2); fg = BlackPixelOfScreen(screen); bg = WhitePixelOfScreen(screen); if (XAllocColor(display, DefaultColormapOfScreen(screen), &colors[0]) && XAllocColor(display, DefaultColormapOfScreen(screen), &colors[1])) { fg = colors[0].pixel; bg = colors[1].pixel; if (fg == bg) { fg = BlackPixelOfScreen(screen); bg = WhitePixelOfScreen(screen); } } /* * Create or recolor the root's gc. * The cursorForeground and cursorBackground are first set * when the root's gc is created. */ if (dos->drag.rootBlend.gc == NULL) { doChange = True; v.background = dos->drag.cursorBackground = bg; v.foreground = dos->drag.cursorForeground = fg; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; v.clip_mask = None; v.clip_x_origin = 0; /* pedantic */ v.clip_y_origin = 0; /* pedantic */ vmask = GCBackground|GCForeground| GCClipXOrigin|GCClipYOrigin|GCClipMask| GCGraphicsExposures|GCSubwindowMode; dos->drag.rootBlend.gc = XtAllocateGC ((Widget) dos, DefaultDepthOfScreen(screen), vmask, &v, vmask, 0L); } else if (dos->drag.cursorBackground != bg || dos->drag.cursorForeground != fg) { doChange = True; v.background = dos->drag.cursorBackground = bg; v.foreground = dos->drag.cursorForeground = fg; vmask = GCBackground|GCForeground; XChangeGC (display, dos->drag.rootBlend.gc, vmask, &v); } return (doChange); } /************************************************************************ * * GetDragIconCursor () * * Tries to create a pixmap cursor with correct colors. * Creates and/or colors the root's gc. ***********************************************************************/ static Cursor GetDragIconCursor( XmDragOverShellWidget dos, XmDragIconObject sourceIcon, XmDragIconObject stateIcon, XmDragIconObject opIcon, #if NeedWidePrototypes int clip, int dirty) #else Boolean clip, Boolean dirty) #endif /* NeedWidePrototypes */ { Screen *screen = XtScreen(dos); Display *display = XtDisplay(dos); XmDragCursorCache *cursorCachePtr= NULL; register XmDragCursorCache cursorCache = NULL; XColor colors[2]; Boolean useCache = True; Cursor cursor; XmDragIconObject dirtysourceIcon = NULL; XmDragIconObject dirtystateIcon = NULL; XmDragIconObject dirtyopIcon = NULL; /* * If the cursor doesn't fit and we cannot clip, return None. * Don't look in the cursorCache -- the cursor would only be there * if clipping were allowed. */ if (!clip && !FitsInCursor (dos, sourceIcon, stateIcon, opIcon)) { return None; } /* * Don't use the cursorCache with stateIcon attachment XmATTACH_HOT * (opIcon attachment XmATTACH_HOT is OK). */ colors[0].pixel = dos->drag.cursorForeground; colors[1].pixel = dos->drag.cursorBackground; XQueryColors(display, DefaultColormapOfScreen(screen), colors, 2); /* * Fix for CR 4817 - If one of the icons is dirty, check the cache to see * which cursors use the dirty icon. When found, mark * the cache as dirty. */ cursorCachePtr = _XmGetDragCursorCachePtr((XmScreen)XmGetXmScreen(screen)); if (dirty) { cursorCache = *cursorCachePtr; if (sourceIcon->drag.isDirty) dirtysourceIcon = sourceIcon; if (stateIcon && (stateIcon->drag.isDirty)) dirtystateIcon = stateIcon; if (opIcon && (opIcon->drag.isDirty)) dirtyopIcon = opIcon; while (cursorCache) { if ((dirtystateIcon && (cursorCache->stateIcon == dirtystateIcon)) || (dirtysourceIcon && (cursorCache->sourceIcon == dirtysourceIcon)) || (dirtyopIcon && (cursorCache->opIcon == dirtyopIcon))) cursorCache->dirty = True; cursorCache = cursorCache->next; } } /* * End Fix for CR 4817 */ if (stateIcon && stateIcon->drag.attachment == XmATTACH_HOT) { useCache = False; } else { cursorCachePtr = _XmGetDragCursorCachePtr((XmScreen)XmGetXmScreen(screen)); cursorCache = *cursorCachePtr; while (cursorCache) { if ((cursorCache->stateIcon == stateIcon) && (cursorCache->opIcon == opIcon) && (cursorCache->sourceIcon == sourceIcon)) { /* * Found a cursorCache match. * If any of the icons were dirty, replace this cursor. * Otherwise, use it. */ if (cursorCache -> dirty) { break; } /* recolor the cursor */ XRecolorCursor (display, cursorCache->cursor, &colors[0], /* foreground_color */ &colors[1] /* background_color */); return cursorCache->cursor; } else { cursorCache = cursorCache->next; } } } /* * We didn't find a valid match in the cursorCache. * Blend the icons and create a pixmap cursor. */ MixIcons (dos, sourceIcon, stateIcon, opIcon, &dos->drag.cursorBlend, clip); cursor = XCreatePixmapCursor (display, dos->drag.cursorBlend.mixedIcon->drag.pixmap, ((dos->drag.cursorBlend.mixedIcon->drag.mask == XmUNSPECIFIED_PIXMAP) ? None : dos->drag.cursorBlend.mixedIcon->drag.mask), &colors[0], /* foreground_color */ &colors[1], /* background_color */ dos->drag.cursorBlend.mixedIcon->drag.hot_x, dos->drag.cursorBlend.mixedIcon->drag.hot_y); /* * Cache the cursor if using the cursorCache. If the cached cursor * was dirty, replace it. Otherwise, create a new cursorCache entry * at the head of the cache. * Otherwise, save it and free any previously saved cursor. */ if (useCache) { if (cursorCache) { XFreeCursor (display, cursorCache->cursor); } else { cursorCache = XtNew(XmDragCursorRec); cursorCache->sourceIcon = sourceIcon; cursorCache->stateIcon = stateIcon; cursorCache->opIcon = opIcon; cursorCache->next = *cursorCachePtr; *cursorCachePtr = cursorCache; } cursorCache->dirty = False; cursorCache->cursor = cursor; } else { if (dos->drag.ncCursor != None) { XFreeCursor (display, dos->drag.ncCursor); } dos->drag.ncCursor = cursor; } return cursor; } /************************************************************************ * * Initialize () * ***********************************************************************/ /*ARGSUSED*/ static void Initialize( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *numArgs) /* unused */ { XmDragOverShellWidget dos = (XmDragOverShellWidget)new_w; /* Assure that *geometry will never affect this widget, CR 5778 */ dos->shell.geometry = NULL; dos->drag.opIcon = dos->drag.stateIcon = NULL; dos->drag.cursorBlend.gc = dos->drag.rootBlend.gc = NULL; dos->drag.cursorBlend.sourceIcon = dos->drag.cursorBlend.mixedIcon = dos->drag.rootBlend.sourceIcon = dos->drag.rootBlend.mixedIcon = NULL; dos->drag.backing.pixmap = dos->drag.tmpPix = dos->drag.tmpBit = XmUNSPECIFIED_PIXMAP; dos->drag.initialX = dos->drag.hotX; dos->drag.initialY = dos->drag.hotY; dos->drag.ncCursor = None; dos->drag.isVisible = False; dos->drag.activeCursor = None; /* * Width/height are valid only in XmPIXMAP and XmWINDOW active modes. */ dos->core.width = 0; dos->core.height = 0; dos->drag.activeMode = XmCURSOR; /* * Get the DragOverShell out of the business of adding and removing * grabs for shell modality. */ XtRemoveAllCallbacks( new_w, XmNpopupCallback) ; XtRemoveAllCallbacks( new_w, XmNpopdownCallback) ; /* Setup information for window dragging */ dos->drag.holePunched = FALSE; dos->drag.colormapShell = (Widget) NULL; dos->drag.colormapWidget = (Widget) NULL; DragOverShellColormapWidget(new_w, XtParent(new_w)); _XmDragOverChange (new_w, XmNO_DROP_SITE); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget current, Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmDragOverShellWidget dos = (XmDragOverShellWidget) new_w; XmDragOverShellWidget oldDos = (XmDragOverShellWidget) current; XmDragContext dc = (XmDragContext)XtParent(dos); /* If the hotspot or geometry changes we'll need to punch a new hole in the shaped window */ if (oldDos->drag.hotX != dos->drag.hotX || oldDos->drag.hotY != dos->drag.hotY || oldDos->core.width != dos->core.width || oldDos->core.height != dos->core.height) dos->drag.holePunched = FALSE; /* * A mode change handles a change in hotspot automatically. * If we are in XmPIXMAP mode and we haven't yet done a root blend, * try XmCURSOR active mode. */ if (oldDos->drag.mode != dos->drag.mode && dc->drag.blendModel != XmBLEND_NONE) { if ((dos->drag.mode == XmPIXMAP || dos->drag.mode == XmDRAG_WINDOW) && (dos->drag.rootBlend.sourceIcon == NULL)) { ChangeActiveMode(dos, XmCURSOR); } else { ChangeActiveMode(dos, dos->drag.mode); } } else if ((dos->drag.hotX != oldDos->drag.hotX) || (dos->drag.hotY != oldDos->drag.hotY)) { _XmDragOverMove (new_w, dos->drag.hotX, dos->drag.hotY); } return False; } /************************************************************************ * * DrawIcon () * ************************************************************************/ static void DrawIcon( XmDragOverShellWidget dos, XmDragIconObject icon, Window window, #if NeedWidePrototypes int x, int y) #else Position x, Position y) #endif /* NeedWidePrototypes */ { GC draw_gc = dos->drag.rootBlend.gc; Boolean clipped = False; XGCValues v; unsigned long vmask; Display * display = XtDisplay((Widget)dos); v.function = GXcopy; vmask = GCFunction; if (icon->drag.region == NULL && icon->drag.mask != XmUNSPECIFIED_PIXMAP) { v.clip_mask = icon->drag.mask; v.clip_x_origin = x; v.clip_y_origin = y; vmask |= GCClipMask|GCClipXOrigin|GCClipYOrigin; XChangeGC (display, draw_gc, vmask, &v); clipped = True; } else { if (icon->drag.region != NULL) { XSetRegion(display, draw_gc, icon->drag.region); v.clip_x_origin = x; v.clip_y_origin = y; vmask |= GCClipXOrigin|GCClipYOrigin; XChangeGC (display, draw_gc, vmask, &v); clipped = True; } else { v.clip_mask = None; vmask |= GCClipMask; XChangeGC (display, draw_gc, vmask, &v); } } /* * If the icon is from the cursorBlend, treat the icon as a bitmap * and use XCopyPlane. Otherwise, treat it as a pixmap and use * XCopyArea. The distinction is important -- the icon data are * treated differently by XCopyPlane and XCopyArea. */ if (icon == dos->drag.cursorBlend.mixedIcon) { XCopyPlane(display, icon->drag.pixmap, window, draw_gc, 0, 0, dos->core.width, dos->core.height, x, y, 1L); } else if (icon->drag.depth == dos->core.depth) { XCopyArea(display, icon->drag.pixmap, window, draw_gc, 0, 0, dos->core.width, dos->core.height, x, y); } else { XmeWarning ((Widget) icon, MESSAGE1); /* cast ok here */ } if (clipped) { XSetClipMask (display, draw_gc, None); } } /************************************************************************ * * Redisplay () * * Called in XmWINDOW mode only. ***********************************************************************/ /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, /* unused */ Region region) /* unused */ { XmDragOverShellWidget dos = (XmDragOverShellWidget)wid; DrawIcon (dos, (dos->drag.rootBlend.mixedIcon ? dos->drag.rootBlend.mixedIcon : dos->drag.cursorBlend.mixedIcon), XtWindow(dos), 0, 0); } /************************************************************************ * * _XmDragOverHide () * ***********************************************************************/ void _XmDragOverHide( Widget w, #if NeedWidePrototypes int clipOriginX, int clipOriginY, #else Position clipOriginX, Position clipOriginY, #endif /* NeedWidePrototypes */ XmRegion clipRegion ) { XmDragOverShellWidget dos = (XmDragOverShellWidget) w; XmDragContext dc = (XmDragContext)XtParent(dos); Boolean clipped = False; if (dos->drag.isVisible && dc->drag.blendModel != XmBLEND_NONE && dos->drag.activeMode != XmCURSOR) { if (dos->drag.activeMode == XmWINDOW || dos->drag.activeMode == XmDRAG_WINDOW) { XtPopdown(w); if (dos->drag.installColormap) UninstallColormap(dos); } if (dos->drag.activeMode != XmWINDOW) { if (clipRegion != None) { clipped = True; _XmRegionSetGCRegion (XtDisplay(w), dos->drag.rootBlend.gc, clipOriginX, clipOriginY, clipRegion); } else { XSetClipMask (XtDisplay(w), dos->drag.rootBlend.gc, None); } if (BackingPixmap(dos) != XmUNSPECIFIED_PIXMAP) { XCopyArea (XtDisplay(w), BackingPixmap(dos), RootWindowOfScreen(XtScreen(w)), dos->drag.rootBlend.gc, 0, 0, dos->core.width, dos->core.height, BackingX(dos), BackingY(dos)); } if (clipped) { XSetClipMask (XtDisplay(w), dos->drag.rootBlend.gc, None); } } dos->drag.isVisible = False; } } /************************************************************************ * * _XmDragOverShow () * ***********************************************************************/ void _XmDragOverShow( Widget w, #if NeedWidePrototypes int clipOriginX, int clipOriginY, #else Position clipOriginX, Position clipOriginY, #endif /* NeedWidePrototypes */ XmRegion clipRegion ) { XmDragOverShellWidget dos = (XmDragOverShellWidget) w; Display *display = XtDisplay(w); XmDragContext dc = (XmDragContext)XtParent(dos); Boolean clipped = False; if (!dos->drag.isVisible && dc->drag.blendModel != XmBLEND_NONE && dos->drag.activeMode != XmCURSOR) { if (dos->drag.activeMode != XmWINDOW && clipRegion != None) { clipped = True; _XmRegionSetGCRegion (display, dos->drag.rootBlend.gc, clipOriginX - BackingX(dos), clipOriginY - BackingY(dos), clipRegion); } else { XSetClipMask (display, dos->drag.rootBlend.gc, None); } if (dos->drag.activeMode == XmPIXMAP) { XCopyArea (display, RootWindowOfScreen(XtScreen(w)), BackingPixmap(dos), dos->drag.rootBlend.gc, BackingX(dos), BackingY(dos), dos->core.width, dos->core.height, 0, 0); } if (clipped) { XSetClipMask (display, dos->drag.rootBlend.gc, None); } if (dos->drag.activeMode == XmPIXMAP) { DrawIcon (dos, (dos->drag.rootBlend.mixedIcon ? dos->drag.rootBlend.mixedIcon : dos->drag.cursorBlend.mixedIcon), RootWindowOfScreen(XtScreen(w)), dos->core.x, dos->core.y); } else { XtPopup(w, XtGrabNone); /* * don't call thru class record since VendorS bug may be * causing override */ if (dos->drag.activeMode == XmDRAG_WINDOW) { Arg args[1]; if (!dos->drag.holePunched) DragOverShellPunchHole(w); if (dos->drag.installColormap) InstallColormap(dos); XtSetArg(args[0], XmNbackgroundPixmap, dos->drag.rootBlend.mixedIcon->drag.pixmap); XtSetValues((Widget) dos, args, 1); } else { Redisplay(w, NULL, NULL); } } dos->drag.isVisible = True; } } /************************************************************************ * * Destroy () * * Destroy method for the XmDragOverShellClass. * Hide the XmDragOverShell before destroying it. ***********************************************************************/ static void Destroy( Widget w) { XmDragOverShellWidget dos = (XmDragOverShellWidget)w; Display *display = XtDisplay((Widget)dos); XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(dos)); _XmDragOverHide (w, 0, 0, None); if (dos->drag.rootBlend.mixedIcon) { DestroyMixedIcon (dos, dos->drag.rootBlend.mixedIcon); } if (dos->drag.rootBlend.gc) { XtReleaseGC((Widget) dos, dos->drag.rootBlend.gc); } if (dos->drag.cursorBlend.mixedIcon) { DestroyMixedIcon (dos, dos->drag.cursorBlend.mixedIcon); } if (dos->drag.cursorBlend.gc) { XtReleaseGC ((Widget) dos, dos->drag.cursorBlend.gc); } if (BackingPixmap(dos) != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, BackingPixmap(dos)); } if (dos->drag.tmpPix != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, dos->drag.tmpPix); } if (dos->drag.tmpBit != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, dos->drag.tmpBit); } if (dos->drag.ncCursor != None) { XFreeCursor (display, dos->drag.ncCursor); } } /************************************************************************ * * ChangeActiveMode () * ***********************************************************************/ static void ChangeActiveMode( XmDragOverShellWidget dos, #if NeedWidePrototypes unsigned int newActiveMode) #else unsigned char newActiveMode) #endif /* NeedWidePrototypes */ { Display *display = XtDisplay((Widget)dos); XmDragContext dc = (XmDragContext)XtParent(dos); GC draw_gc = dos->drag.rootBlend.gc; /* * Remove the effects of the current active mode. */ if (dos->drag.activeMode == XmCURSOR) { if (newActiveMode != XmCURSOR) { dos->drag.activeCursor = XmeGetNullCursor((Widget)dos); XChangeActivePointerGrab (display, (unsigned int) _XmDRAG_EVENT_MASK(dc), dos->drag.activeCursor, dc->drag.lastChangeTime); } } else { /* * BackingPixmap was created and core.width/height were set * the first time we entered XmPIXMAP or XmWINDOW active mode. */ if (dos->drag.activeMode == XmWINDOW || dos->drag.activeMode == XmDRAG_WINDOW) { XtPopdown((Widget)dos); } XSetClipMask (display, draw_gc, None); if (BackingPixmap(dos) != XmUNSPECIFIED_PIXMAP) { XCopyArea (display, BackingPixmap(dos), RootWindowOfScreen(XtScreen(dos)), draw_gc, 0, 0, dos->core.width, dos->core.height, BackingX(dos), BackingY(dos)); } } dos->drag.isVisible = False; /* * Add the effects of the new active mode. */ if ((dos->drag.activeMode = newActiveMode) == XmCURSOR) { _XmDragOverChange ((Widget)dos, dos->drag.cursorState); } else { XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(dos)); XmDragIconObject sourceIcon; XmDragOverBlend blend; /* * (Re)generate a mixedIcon, in case we have a state * change, or we have used the cursor cache up to this * point. Place the new mixedIcon so as to preserve the * hotspot location. */ if (dos->drag.rootBlend.sourceIcon) { sourceIcon = dos->drag.rootBlend.sourceIcon; blend = &dos->drag.rootBlend; } else { sourceIcon = dos->drag.cursorBlend.sourceIcon; blend = &dos->drag.cursorBlend; } MixIcons (dos, sourceIcon, dos->drag.stateIcon, dos->drag.opIcon, blend, False); /* * Compute the new location and handle an icon size change. */ BackingX(dos) = dos->core.x = dos->drag.hotX - blend->mixedIcon->drag.hot_x; BackingY(dos) = dos->core.y = dos->drag.hotY - blend->mixedIcon->drag.hot_y; if (dos->core.width != blend->mixedIcon->drag.width || dos->core.height != blend->mixedIcon->drag.height) { dos->core.width = blend->mixedIcon->drag.width; dos->core.height = blend->mixedIcon->drag.height; if (BackingPixmap(dos) != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, BackingPixmap(dos)); BackingPixmap(dos) = XmUNSPECIFIED_PIXMAP; } if (dos->drag.tmpPix != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, dos->drag.tmpPix); dos->drag.tmpPix = XmUNSPECIFIED_PIXMAP; } if (dos->drag.tmpBit != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, dos->drag.tmpBit); dos->drag.tmpBit = XmUNSPECIFIED_PIXMAP; } } if (dos->drag.activeMode == XmDRAG_WINDOW && BackingPixmap(dos) != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, BackingPixmap(dos)); BackingPixmap(dos) = XmUNSPECIFIED_PIXMAP; } /* * Save the obscured root in backing. */ if (dos->drag.activeMode == XmPIXMAP) { if (BackingPixmap(dos) == XmUNSPECIFIED_PIXMAP) { BackingPixmap(dos) = _XmAllocScratchPixmap (xmScreen, dos->core.depth, dos->core.width, dos->core.height); } XSetClipMask (display, draw_gc, None); XCopyArea (display, RootWindowOfScreen(XtScreen(dos)), BackingPixmap(dos), draw_gc, BackingX(dos), BackingY(dos), dos->core.width, dos->core.height, 0, 0); DrawIcon (dos, blend->mixedIcon, RootWindowOfScreen(XtScreen(dos)), dos->core.x, dos->core.y); } else if (dos->drag.activeMode == XmWINDOW) { XSetWindowAttributes xswa; XtPopup((Widget)dos, XtGrabNone); xswa.cursor = XmeGetNullCursor((Widget)dos); xswa.do_not_propagate_mask = _XmDRAG_EVENT_MASK(dc); XChangeWindowAttributes (display, XtWindow(dos), CWCursor|CWDontPropagate, &xswa); /* * don't call thru class record since VendorS bug may be * causing override */ Redisplay((Widget)dos, NULL, NULL); } else { /* XmDRAG_WINDOW */ /* Reposition before popping up */ if (XtWindow(dos) != None) XMoveWindow(XtDisplay(dos), XtWindow(dos), dos->core.x, dos->core.y); XtPopup((Widget)dos, XtGrabNone); if (dos->drag.activeMode == XmDRAG_WINDOW) { Arg args[1]; if (!dos->drag.holePunched) DragOverShellPunchHole((Widget) dos); if (dos->drag.installColormap) InstallColormap(dos); XtSetArg(args[0], XmNbackgroundPixmap, dos->drag.rootBlend.mixedIcon->drag.pixmap); XtSetValues((Widget) dos, args, 1); } else { Redisplay((Widget) dos, NULL, NULL); } } dos->drag.isVisible = True; } } /************************************************************************ * * ChangeDragWindow () * ***********************************************************************/ static void ChangeDragWindow(XmDragOverShellWidget dos) { Display *display = XtDisplay((Widget)dos); Window win = XtWindow((Widget)dos); GC draw_gc = dos->drag.rootBlend.gc; XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(dos)); XmDragIconObject sourceIcon; XmDragOverBlend blend; XmDragIconObject mixedIcon; XmDragOverBlendRec *cursorBlend = &dos->drag.cursorBlend; XGCValues v; unsigned long vmask; /* * Blend a new mixedIcon using only the source icon. * Place the new mixedIcon to preserve the source icon location. * The current mixedIcon data is valid. */ if (dos->drag.rootBlend.sourceIcon) { sourceIcon = dos->drag.rootBlend.sourceIcon; blend = &dos->drag.rootBlend; } else { sourceIcon = dos->drag.cursorBlend.sourceIcon; blend = &dos->drag.cursorBlend; } mixedIcon = blend->mixedIcon; XSetFunction (display, blend->gc, GXset); XFillRectangle (display, mixedIcon->drag.pixmap, blend->gc, 0, 0, mixedIcon->drag.width, mixedIcon->drag.height); if (mixedIcon->drag.mask != XmUNSPECIFIED_PIXMAP) { if (cursorBlend->gc == NULL) { v.background = 0; v.foreground = 1; v.function = GXclear; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; v.clip_mask = None; v.clip_x_origin = 0; /* pedantic */ v.clip_y_origin = 0; /* pedantic */ vmask = GCBackground|GCForeground|GCFunction| GCClipXOrigin|GCClipYOrigin|GCClipMask| GCGraphicsExposures|GCSubwindowMode; cursorBlend->gc = XtAllocateGC((Widget) dos, 1, vmask, &v, vmask, 0L); } else { v.clip_mask = None; v.function = GXclear; vmask = GCClipMask|GCFunction; XChangeGC (display, cursorBlend->gc, vmask, &v); } XFillRectangle (display, mixedIcon->drag.mask, cursorBlend->gc, 0, 0, mixedIcon->drag.width, mixedIcon->drag.height); } BlendIcon (dos, sourceIcon, mixedIcon, blend->sourceX, blend->sourceY, cursorBlend->gc, blend->gc); /* * Remove the current drag window. */ XUnmapWindow(display, win); /* * Handle an icon size change. */ if (dos->core.width != blend->mixedIcon->drag.width || dos->core.height != blend->mixedIcon->drag.height) { if (BackingPixmap(dos) != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, BackingPixmap(dos)); BackingPixmap(dos) = XmUNSPECIFIED_PIXMAP; } if (dos->drag.tmpPix != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, dos->drag.tmpPix); dos->drag.tmpPix = XmUNSPECIFIED_PIXMAP; } if (dos->drag.tmpBit != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (xmScreen, dos->drag.tmpBit); dos->drag.tmpBit = XmUNSPECIFIED_PIXMAP; } } /* * Save the obscured root in backing. */ if (BackingPixmap(dos) == XmUNSPECIFIED_PIXMAP) { BackingPixmap(dos) = _XmAllocScratchPixmap (xmScreen, dos->core.depth, dos->core.width, dos->core.height); } BackingX(dos) = dos->core.x; BackingY(dos) = dos->core.y; XSetClipMask (display, draw_gc, None); XCopyArea (display, RootWindowOfScreen(XtScreen(dos)), BackingPixmap(dos), draw_gc, BackingX(dos), BackingY(dos), dos->core.width, dos->core.height, 0, 0); /* * Move, resize, and remap the drag window. * This is an override_redirect window. */ XMoveResizeWindow(display, win, dos->core.x, dos->core.y, dos->core.width, dos->core.height); XMapWindow(display, win); /* * don't call thru class record since VendorS bug may be * causing override */ Redisplay((Widget)dos, NULL, NULL); } /************************************************************************ * * _XmDragOverMove () * * This method is less efficient than the obvious method of copying the * backing to the root, saving the new icon destination in the backing, * and copying the icon to the root. However, it results in a smoother * appearance. ***********************************************************************/ void _XmDragOverMove( Widget w, #if NeedWidePrototypes int x, int y) #else Position x, Position y) #endif /* NeedWidePrototypes */ { XmDragOverShellWidget dos = (XmDragOverShellWidget) w; XmDragContext dc = (XmDragContext)XtParent(dos); Display *display = XtDisplay(w); XmScreen xmScreen = (XmScreen) XmGetXmScreen(XtScreen(w)); Window root = RootWindowOfScreen(XtScreen(w)); Pixmap old_backing = BackingPixmap(dos); Pixmap new_backing; GC draw_gc = dos->drag.rootBlend.gc; XmDragIconObject mixedIcon; XGCValues v; unsigned long vmask; dos->drag.hotX = x; dos->drag.hotY = y; if (!dos->drag.isVisible || dc->drag.blendModel == XmBLEND_NONE || dos->drag.activeMode == XmCURSOR) { return; } if (dos->drag.rootBlend.mixedIcon) { mixedIcon = dos->drag.rootBlend.mixedIcon; } else { /* exists */ mixedIcon = dos->drag.cursorBlend.mixedIcon; } dos -> core.x = x -= mixedIcon->drag.hot_x; dos -> core.y = y -= mixedIcon->drag.hot_y; if (dos->drag.activeMode == XmWINDOW || dos->drag.activeMode == XmDRAG_WINDOW) { /* this is an override_redirect window */ XMoveWindow(display, XtWindow (w), x, y); return; } /* * From here on, the active mode is XmPIXMAP. */ if (dos->drag.tmpPix == XmUNSPECIFIED_PIXMAP) { dos->drag.tmpPix = _XmAllocScratchPixmap (xmScreen, dos->core.depth, dos->core.width, dos->core.height); } new_backing = dos->drag.tmpPix; /* * Save the area where the new icon is to go. */ v.clip_mask = None; v.function = GXcopy; vmask = GCClipMask|GCFunction; XChangeGC (display, draw_gc, vmask, &v); XCopyArea (display, root, new_backing, draw_gc, x, y, dos->core.width, dos->core.height, 0, 0); if (x + ((Position) dos->core.width) > BackingX(dos) && x < BackingX(dos) + ((Position) dos->core.width) && y + ((Position) dos->core.height) > BackingY(dos) && y < BackingY(dos) + ((Position) dos->core.height)) { XRectangle rect, rect1, rect2; XPoint pt; /* * Have overlap: * * Calculate the intersection between the 2 areas and * copy the non-overlapping old area in the window. * * If the icon has a mask, create a mask through which we will * copy the old backing to the root. * Otherwise, use one or two rectangles. */ if (mixedIcon->drag.region == NULL && mixedIcon->drag.mask != XmUNSPECIFIED_PIXMAP) { Pixmap root_mask; GC mask_gc = dos->drag.cursorBlend.gc; if (dos->drag.tmpBit == XmUNSPECIFIED_PIXMAP) { dos->drag.tmpBit = _XmAllocScratchPixmap (xmScreen, 1, dos->core.width, dos->core.height); } root_mask = dos->drag.tmpBit; v.clip_mask = None; v.function = GXset; vmask = GCClipMask|GCFunction; XChangeGC (display, mask_gc, vmask, &v); XFillRectangle (display, root_mask, mask_gc, 0, 0, dos->core.width, dos->core.height); XSetFunction (display, mask_gc, GXandInverted); XCopyArea (display, mixedIcon->drag.mask, root_mask, mask_gc, 0, 0, mixedIcon->drag.width, mixedIcon->drag.height, x - BackingX(dos), y - BackingY(dos)); /* * Copy the icon into the new area and refresh the root. */ DrawIcon (dos, mixedIcon, root, x, y); v.clip_mask = root_mask; v.clip_x_origin = BackingX(dos); v.clip_y_origin = BackingY(dos); vmask = GCClipMask|GCClipXOrigin|GCClipYOrigin; XChangeGC (display, draw_gc, vmask, &v); XCopyArea (display, old_backing, root, draw_gc, 0, 0, dos->core.width, dos->core.height, BackingX(dos), BackingY(dos)); XSetClipMask (display, draw_gc, None); } else { /* * Copy the icon into the new area. */ DrawIcon (dos, mixedIcon, root, x, y); /* * Use rectangles to refresh exposed root. * The first rectangle (horizontal movement). */ if (x > BackingX(dos)) { rect1.x = 0; rect1.width = x - BackingX(dos); } else { rect1.width = BackingX(dos) - x; rect1.x = dos->core.width - rect1.width; } rect1.y = 0; rect1.height = dos->core.height; pt.x = BackingX(dos) + rect1.x; pt.y = BackingY(dos); if (rect1.width > 0) { XCopyArea (display, old_backing, root, draw_gc, rect1.x, rect1.y, rect1.width, rect1.height, pt.x, pt.y); } /* * The second rectangle (vertical movement). */ if (y > BackingY(dos)) { rect2.y = 0; rect2.height = y - BackingY(dos); } else { rect2.height = BackingY(dos) - y; rect2.y = dos->core.height - rect2.height; } rect2.x = 0; rect2.width = dos->core.width; pt.x = BackingX(dos); pt.y = BackingY(dos) + rect2.y; if (rect2.height > 0) { XCopyArea (display, old_backing, root, draw_gc, rect2.x, rect2.y, rect2.width, rect2.height, pt.x, pt.y); } } /* * Copy the overlapping area between old_backing and * new_backing into new_backing to be used for the * next cursor move. */ if (x > BackingX(dos)) { rect.x = x - BackingX(dos); pt.x = 0; rect.width = dos->core.width - rect.x; } else { rect.x = 0; pt.x = BackingX(dos) - x; rect.width = dos->core.width - pt.x; } if (y > BackingY(dos)) { rect.y = y - BackingY(dos); pt.y = 0; rect.height = dos->core.height - rect.y; } else { rect.y = 0; pt.y = BackingY(dos) - y; rect.height = dos->core.height - pt.y; } XCopyArea (display, old_backing, new_backing, draw_gc, rect.x, rect.y, rect.width, rect.height, pt.x, pt.y); if (mixedIcon->drag.restore_region) { XSetRegion(display, draw_gc, mixedIcon->drag.restore_region); XSetClipOrigin(display, draw_gc, x, y); XCopyArea (display, new_backing, root, draw_gc, 0, 0, dos->core.width, dos->core.height, x, y); XSetClipMask(display, draw_gc, None); } } else { /* * No overlap: refresh the root from old_backing. * new_backing is valid. */ XCopyArea (display, old_backing, root, draw_gc, 0, 0, dos->core.width, dos->core.height, BackingX(dos), BackingY(dos)); DrawIcon (dos, mixedIcon, root, x, y); } /* Update the variables needed for the next loop */ BackingX(dos) = x; BackingY(dos) = y; BackingPixmap(dos) = new_backing; dos->drag.tmpPix = old_backing; } /************************************************************************ * * _XmDragOverChange () * * Make dragover changes to track changes in component icons or colors. ***********************************************************************/ void _XmDragOverChange( Widget w, #if NeedWidePrototypes unsigned int dropSiteStatus) #else unsigned char dropSiteStatus) #endif /* NeedWidePrototypes */ { XmDragOverShellWidget dos = (XmDragOverShellWidget) w; XmDragContext dc = (XmDragContext)XtParent(dos); XmDragIconObject sourceIcon = NULL; XmDragIconObject opIcon = NULL; XmDragIconObject stateIcon = NULL; Boolean doChange, dirty = False; Boolean usedSrcPixIcon = True; dos->drag.cursorState = dropSiteStatus; if (dos->drag.mode == XmWINDOW) { return; } if (dc->drag.blendModel == XmBLEND_NONE) { return; } /* * Get the sourceIcon. * If we are in XmPIXMAP mode use the XmNsourcePixmapIcon if: * 1. it exists, * 2. it has the same screen as dos, and * 3. it has depth 1 or the same depth as dos. * Otherwise, use the XmNsourceCursorIcon if: * 1. it exists, * 2. it has the same screen as dos, and * 3. is a bitmap. * Otherwise, use the XmNdefaultSourceCursorIcon. */ if (dos->drag.mode == XmPIXMAP || dos->drag.mode == XmDRAG_WINDOW || dos->drag.mode == XmWINDOW) { sourceIcon = dc->drag.sourcePixmapIcon; } if (sourceIcon == NULL || XtScreenOfObject(XtParent(sourceIcon)) != XtScreen(w) || ((sourceIcon->drag.depth != dos->core.depth) && (sourceIcon->drag.depth != 1))) { usedSrcPixIcon = False; sourceIcon = dc->drag.sourceCursorIcon; if (sourceIcon == NULL || XtScreenOfObject(XtParent(sourceIcon)) != XtScreen(w) || sourceIcon->drag.depth != 1) { sourceIcon = _XmScreenGetSourceIcon (w); /* nonNULL */ } } /* * Get the state and operation icons, according to the blending model. */ switch ((int) dc->drag.blendModel) { default: XmeWarning( (Widget) dc, MESSAGE4); case XmBLEND_ALL: /* * Get the operation icon bitmap. */ opIcon = dc->drag.operationCursorIcon; if (opIcon == NULL || opIcon->drag.depth != 1 || XtScreenOfObject(XtParent(opIcon)) != XtScreen(w)) { opIcon = _XmScreenGetOperationIcon (w, dc->drag.operation); if (opIcon && opIcon->drag.depth != 1) { opIcon = NULL; } } /* fall through */ case XmBLEND_STATE_SOURCE: /* * Get the state icon bitmap. */ stateIcon = dc->drag.stateCursorIcon; if (stateIcon == NULL || stateIcon->drag.depth != 1 || XtScreenOfObject(XtParent(stateIcon)) != XtScreen(w)) { stateIcon = _XmScreenGetStateIcon (w, dropSiteStatus); if (stateIcon && stateIcon->drag.depth != 1) { stateIcon = NULL; } } break; case XmBLEND_JUST_SOURCE: break; } /* * Determine the cursor colors and create or recolor the root's gc. * Record that a change is necessary if the cursor colors or any * of the component icons have changed. */ dirty = (_XmDragIconIsDirty (sourceIcon) || (opIcon && _XmDragIconIsDirty (opIcon)) || (stateIcon && _XmDragIconIsDirty (stateIcon))); doChange = GetDragIconColors (dos) || dos->drag.opIcon != opIcon || dos->drag.stateIcon != stateIcon || dos->drag.rootBlend.sourceIcon != sourceIcon || dirty; /* * If we are not using the XmNsourcePixmapIcon, then try to create * a cursor from the specified icons. If we are successful, we will * use the cursor in both cursor and pixmap mode. * Remember: XmNsourcePixmapIcon is only used in XmPIXMAP mode. */ dos->drag.opIcon = opIcon; dos->drag.stateIcon = stateIcon; dos->drag.cursorBlend.sourceIcon = sourceIcon; if (!usedSrcPixIcon && (dos->drag.activeCursor = GetDragIconCursor (dos, sourceIcon, stateIcon, opIcon, False /* no clip */, dirty)) != None) { /* * We have created a new cursor: clean the icons. */ _XmDragIconClean (sourceIcon, stateIcon, opIcon); if (dos->drag.activeMode != XmCURSOR) { _XmDragOverHide (w, 0, 0, None); dos->drag.activeMode = XmCURSOR; } XChangeActivePointerGrab (XtDisplay(w), (unsigned int) _XmDRAG_EVENT_MASK(dc), dos->drag.activeCursor, dc->drag.lastChangeTime); /* * We will use XmCURSOR active mode: destroy any previously * used rootBlend icon. */ dos->drag.rootBlend.sourceIcon = NULL; if (dos->drag.rootBlend.mixedIcon) { DestroyMixedIcon (dos, dos->drag.rootBlend.mixedIcon); dos->drag.rootBlend.mixedIcon = NULL; } return; } /* * Am using XmNsourcePixmapIcon or the cursor was too big. * Save the sourceIcon for non-XmCURSOR active mode. */ dos->drag.rootBlend.sourceIcon = sourceIcon; if (dos->drag.mode == XmCURSOR) { /* * XmCURSOR mode: the cursor was too large for the hardware; clip * it to the maximum hardware cursor size. */ dos->drag.activeCursor = GetDragIconCursor (dos, sourceIcon, stateIcon, opIcon, True /* clip */, dirty); _XmDragIconClean (sourceIcon, stateIcon, opIcon); if (dos->drag.activeMode != XmCURSOR) { _XmDragOverHide (w, 0, 0, None); dos->drag.activeMode = XmCURSOR; } XChangeActivePointerGrab (XtDisplay(w), (unsigned int) _XmDRAG_EVENT_MASK(dc), dos->drag.activeCursor, dc->drag.lastChangeTime); } /* * Else unable to use XmCURSOR activeMode in XmPIXMAP mode. * Change activeMode to XmPIXMAP or XmDRAG_WINDOW. */ else if (dos->drag.mode == XmPIXMAP) { if (doChange || dos->drag.activeMode != XmPIXMAP) { _XmDragIconClean (sourceIcon, stateIcon, opIcon); ChangeActiveMode (dos, XmPIXMAP); } } else /* DRAG_WINDOW */ if (doChange || dos->drag.activeMode != XmDRAG_WINDOW) { _XmDragIconClean (sourceIcon, stateIcon, opIcon); ChangeActiveMode (dos, XmDRAG_WINDOW); } } /************************************************************************ * * _XmDragOverFinish () * ***********************************************************************/ void _XmDragOverFinish( Widget w, #if NeedWidePrototypes unsigned int completionStatus) #else unsigned char completionStatus) #endif /* NeedWidePrototypes */ { XmDragOverShellWidget dos = (XmDragOverShellWidget) w; XmDragContext dc = (XmDragContext)XtParent(dos); /* GC draw_gc = dos->drag.rootBlend.gc; */ if (dc->drag.blendModel != XmBLEND_NONE) { /* If there could be some way to only do this code when we know that * there is animation being done under the drag over effects. Maybe * add a XmDROP_ANIMATE completionStatus type? XmDROP_ANIMATE would * be the same as XmDROP_SUCCESS, but it would also indicate that * animation is being done. This code causes unecessary flashing * when animation is not being done. It also fixes a bug the make * the melt effects look correct when the area under the icons has * changed. XFlush (XtDisplay((Widget)dos)); XSetClipMask (XtDisplay((Widget)dos), draw_gc, None); XtPopdown(w); XCopyArea (XtDisplay((Widget)dos), RootWindowOfScreen(XtScreen(dos)), BackingPixmap(dos), draw_gc, BackingX(dos), BackingY(dos), dos->core.width, dos->core.height, 0, 0); XtPopup(w, XtGrabNone); */ XGrabServer(XtDisplay(w)); /* * Create and draw a source-only mixedIcon. * Do not recolor it, even though the state is no longer used. * Place the source-only mixedIcon so the source doesn't move. * * The current active mode is XmWINDOW, so the blend data is valid. * However, the backing may not be, since the server was ungrabbed. * We keep the active mode as XmWINDOW and delay XtPopDown until * the finish effects are finished to force the server to generate * an expose event at the initial mixedIcon location. */ ChangeDragWindow (dos); if (completionStatus == XmDROP_FAILURE) { /* generate zap back effects */ DoZapEffect((XtPointer)dos, (XtIntervalId *)NULL); } else { /* generate melt effects */ DoMeltEffect((XtPointer)dos, (XtIntervalId *)NULL); } XtPopdown(w); dos->drag.isVisible = False; XUngrabServer(XtDisplay(w)); } } /************************************************************************ * * _XmDragOverGetActiveCursor () * ***********************************************************************/ Cursor _XmDragOverGetActiveCursor( Widget w) { XmDragOverShellWidget dos = (XmDragOverShellWidget) w; return dos->drag.activeCursor; } /************************************************************************ * * _XmDragOverSetInitialPosition () * ***********************************************************************/ void _XmDragOverSetInitialPosition( Widget w, #if NeedWidePrototypes int initialX, int initialY) #else Position initialX, Position initialY) #endif /* NeedWidePrototypes */ { XmDragOverShellWidget dos = (XmDragOverShellWidget) w; dos->drag.initialX = initialX; dos->drag.initialY = initialY; } /* search up the tree to find the parent shell for whom colormapWidget * is a child widget. This is the shell on which the colormap is to be * installed. */ static void FindColormapShell(XmDragOverShellWidget dw) { Widget cw = dw->drag.colormapWidget; Arg args[1]; while (cw && !XtIsShell(cw)) cw = XtParent(cw); dw->drag.colormapShell = cw; /* find out if this shell is override redirect */ XtSetArg(args[0], XmNoverrideRedirect, &dw->drag.colormapOverride); XtGetValues(cw, args, 1); } /* set the WmColormapWindows property on the parent shell to include dw's * colormap */ static void InstallColormap(XmDragOverShellWidget dw) { Status status; Window *windowsReturn; int countReturn; if (!dw->drag.colormapShell) FindColormapShell(dw); if (dw->drag.colormapShell) { /* check to see if there is a property */ status = XGetWMColormapWindows(XtDisplay(dw), XtWindow(dw->drag.colormapShell), &windowsReturn, &countReturn); /* if no property, just create one */ if (!status) { Window windows[2]; windows[0] = XtWindow(dw); windows[1] = XtWindow(dw->drag.colormapShell); XSetWMColormapWindows(XtDisplay(dw), XtWindow(dw->drag.colormapShell), windows, 2); } /* there was a property, add myself to the beginning */ else { Window *windows = (Window *)XtMalloc((sizeof(Window))*(countReturn+1)); register int i; windows[0] = XtWindow(dw); for (i=0; idrag.colormapShell), windows, countReturn+1); XtFree((char*)windows); XtFree((char*)windowsReturn); } /* The window manager can't install colormaps for override redirect * windows. So we have to do it ourselves using XInstallColormap. * This can confuse the window manager, so we save the current * colormap and reinstall it when we're done. * * Note this code does not work with twm, who will kick us out * upon seeing that we have installed a colormap. But there * is nothing we can do about that until the consortium tells * us how to correctly install override redirect colormaps */ if (dw->drag.colormapOverride) { dw->drag.savedColormaps = XListInstalledColormaps( XtDisplay(dw), XtWindow(dw), &dw->drag.numSavedColormaps); XInstallColormap(XtDisplay(dw), dw->core.colormap); } } } /* set the WmColormapWindows property on the parent shell to exclude dw's * colormap */ static void UninstallColormap(XmDragOverShellWidget dos) { Status status; Window *windowsReturn; int countReturn; register int i; if (!dos->drag.colormapShell) FindColormapShell(dos); if (dos->drag.colormapShell) { /* check to see if there is a property */ status = XGetWMColormapWindows(XtDisplay(dos), XtWindow(dos->drag.colormapShell), &windowsReturn, &countReturn); /* if no property, just return. If there was a property, continue */ if (status) { /* search for a match */ for (i=0; idrag.colormapShell), windowsReturn, countReturn-1); break; /* from outer for */ } } XtFree((char*)windowsReturn); } /* if this was an override window, we installed our own colormaps. * put them back. (See comments in installColormap for more details */ if (dos->drag.colormapOverride) { register int i; for (i=0; idrag.numSavedColormaps; i++) XInstallColormap(XtDisplay(dos), dos->drag.savedColormaps[i]); XFree((char *)dos->drag.savedColormaps); } } } /* The following function relies on the shape extension. */ static void DragOverShellPunchHole(Widget w) { static XmConst XRectangle pixelPunch = { 0, 0, 1, 1 }; XmDragOverShellWidget dos = (XmDragOverShellWidget)w; XmDragIconObject icon = (dos->drag.rootBlend.mixedIcon ? dos->drag.rootBlend.mixedIcon : dos->drag.cursorBlend.mixedIcon); /* The following code requires an XtWindow, so we force the widget * to be realized if it isn't already */ XtRealizeWidget(w); /* clear effects of previous shaping */ XShapeCombineMask (XtDisplay(dos), XtWindow(dos), ShapeBounding, 0, 0, None, ShapeSet); /* shape the outside of the window */ if (icon && icon -> drag.mask) { if (icon -> drag.mask) XShapeCombineMask (XtDisplay(dos), XtWindow(dos), ShapeBounding, 0, 0, icon -> drag.mask, ShapeSet); /* punch a hole in the window */ XShapeCombineRectangles (XtDisplay(dos), XtWindow(dos), ShapeBounding, icon->drag.hot_x, icon->drag.hot_y, (XRectangle*)&pixelPunch, 1, ShapeSubtract, YXBanded); dos->drag.holePunched = TRUE; } } static void DragOverShellColormapWidget(Widget ds, Widget cw) { XmDragOverShellWidget dos = (XmDragOverShellWidget) ds; if (dos->drag.colormapWidget != cw) { dos->drag.colormapWidget = cw; dos->drag.colormapShell = NULL; FindColormapShell(dos); } } motif-2.3.8/lib/Xm/ScreenI.h0000644000175000017500000000701212672140200012410 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ScreenI.h /main/5 1995/07/13 17:53:44 drk $ */ #ifndef _XmScreenI_h #define _XmScreenI_h #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark _XmInvalidCursorIconQuark ; externalref XrmQuark _XmValidCursorIconQuark ; externalref XrmQuark _XmNoneCursorIconQuark ; externalref XrmQuark _XmDefaultDragIconQuark ; externalref XrmQuark _XmMoveCursorIconQuark ; externalref XrmQuark _XmCopyCursorIconQuark ; externalref XrmQuark _XmLinkCursorIconQuark ; /******** Private Function Declarations ********/ extern XmDragIconObject _XmScreenGetOperationIcon( Widget w, #if NeedWidePrototypes unsigned int operation) ; #else unsigned char operation) ; #endif /* NeedWidePrototypes */ extern XmDragIconObject _XmScreenGetStateIcon( Widget w, #if NeedWidePrototypes unsigned int state) ; #else unsigned char state) ; #endif /* NeedWidePrototypes */ extern XmDragIconObject _XmScreenGetSourceIcon( Widget w) ; extern Pixmap _XmAllocScratchPixmap( XmScreen xmScreen, #if NeedWidePrototypes unsigned int depth, int width, int height) ; #else Cardinal depth, Dimension width, Dimension height) ; #endif /* NeedWidePrototypes */ extern void _XmFreeScratchPixmap( XmScreen xmScreen, Pixmap pixmap) ; extern XmDragCursorCache * _XmGetDragCursorCachePtr( XmScreen xmScreen) ; extern Cursor _XmGetMenuCursorByScreen( Screen *screen) ; extern Boolean _XmGetMoveOpaqueByScreen( Screen *screen) ; extern unsigned char _XmGetUnpostBehavior( Widget wid) ; extern int _XmGetFontUnit( Screen *screen, int dimension) ; extern void _XmScreenRemoveFromCursorCache( XmDragIconObject icon) ; extern XmScreenColorProc _XmGetColorCalculationProc( Screen *screen) ; extern XmAllocColorProc _XmGetColorAllocationProc( Screen *screen) ; extern Pixmap _XmGetInsensitiveStippleBitmap( Widget w) ; extern XtEnum _XmGetBitmapConversionModel( Screen *screen) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScreenI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PrintS.c0000644000175000017500000010252713145162623012312 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include "ImageCachI.h" #include "SyntheticI.h" #include #include /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass wc) ; static void ClassInitialize( void ) ; static void Initialize( Widget requested_widget, Widget new_widget, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static void PrintNotifyHandler( Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch); static void ResourcesUpdate( Widget w, XPContext pcontext, Dimension * pwidth, Dimension * pheight); static void AttributesNotifyHandler( Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch); static void SelectXpEvents ( Widget widget, int *event_types, XtPointer *select_data, int count, XtPointer client_data); static void PrintToFileProc(Display * dpy, XPContext context, unsigned char *data, unsigned int data_len, XPointer client_data); static void FinishProc(Display *display, XPContext context, XPGetDocStatus status, XPointer client_data); static void PDMPhase2Handler(Widget w, XtPointer data, XEvent *event, Boolean *cont); static void PDMSelectionProc (Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format); static Boolean PrintDispatchEvent (XEvent *event); static void GetFromTable (Display* pdpy, XPContext context, Widget * widget); static void DeleteFromTable (XPContext context, Widget widget); static void AddToTable (XPContext context, Widget widget); #define Offset(x) (XtOffsetOf(XmPrintShellRec, print.x)) static XtResource resources[] = { { XmNallowShellResize, XmCAllowShellResize, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPrintShellRec, shell.allow_shell_resize), XtRImmediate, (XtPointer)False, }, { XmNminX, XmCMinX, XmRHorizontalDimension, sizeof (Dimension), Offset(min_x), XmRImmediate, (XtPointer) 0, }, { XmNminY, XmCMinY, XmRVerticalDimension, sizeof (Dimension), Offset(min_y), XmRImmediate, (XtPointer) 0, }, { XmNmaxX, XmCMaxX, XmRHorizontalDimension, sizeof (Dimension), Offset(max_x), XmRImmediate, (XtPointer) 0, }, { XmNmaxY, XmCMaxY, XmRVerticalDimension, sizeof (Dimension), Offset(max_y), XmRImmediate, (XtPointer) 0, }, { XmNdefaultPixmapResolution, XmCDefaultPixmapResolution, XmRShort, sizeof(unsigned short), Offset(default_pixmap_resolution), XmRImmediate, (XtPointer)100, }, { XmNstartJobCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(start_job_callback), XmRImmediate, (XtPointer)NULL, }, { XmNendJobCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(end_job_callback), XmRImmediate, (XtPointer)NULL, }, { XmNpageSetupCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(page_setup_callback), XmRImmediate, (XtPointer)NULL, }, { XmNpdmNotificationCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), Offset(pdm_notification_callback), XmRImmediate, (XtPointer)NULL, }, }; /** only getvalues is supported on these, not setvalues hook therefore */ static XmSyntheticResource syn_resources[] = { { XmNminX, sizeof(Dimension), Offset(min_x), XmeFromHorizontalPixels,NULL, }, { XmNminY, sizeof(Dimension), Offset(min_y), XmeFromVerticalPixels,NULL, }, { XmNmaxX, sizeof(Dimension), Offset(max_x), XmeFromHorizontalPixels,NULL, }, { XmNmaxY, sizeof(Dimension), Offset(max_y), XmeFromVerticalPixels,NULL, }, }; #undef Offset externaldef(xmprintshellclassrec) XmPrintShellClassRec xmPrintShellClassRec = { { (WidgetClass) &applicationShellClassRec, /* superclass */ "XmPrintShell", /* class_name */ sizeof(XmPrintShellRec), /* size */ ClassInitialize, /* Class Initializer */ ClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ Initialize, /* initialize */ NULL, /* initialize_notify */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ XtExposeCompressSeries, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ XtInheritResize, /* resize */ (XtExposeProc)NULL, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ _XmPrintShellGetValuesHook, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ XtInheritTranslations, /* tm_table */ XtInheritQueryGeometry, /* query_geometry */ (XtStringProc)NULL, /* display_accelerator */ (XtPointer)NULL, /* extension */ }, { /* composite class record */ XtInheritGeometryManager, /* geometry_manager */ XtInheritChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* from the shell */ NULL, /* extension record */ }, { /* shell class record */ NULL, /* extension record */ }, { /* wm shell class record */ NULL, /* extension record */ }, { /* vendor shell class record */ NULL, /* extension record */ }, { /* toplevelclass record */ NULL, /* extension record */ }, { /* appShell record */ NULL, /* extension record */ }, { /* PrintShell class */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* extension */ }, }; externaldef(xmprintshellclass) WidgetClass xmPrintShellWidgetClass = (WidgetClass) (&xmPrintShellClassRec); static XContext PrintContextToWidget = 0; /* global because used in ResInd.c to find out about resolution */ XContext _XmPrintScreenToShellContext = 0; Cardinal _XmPrintShellCounter = 0 ; /************************************************************************ * * ClassInitialize * ************************************************************************/ static void ClassInitialize( void ) { if (PrintContextToWidget == 0) PrintContextToWidget = XUniqueContext(); if (_XmPrintScreenToShellContext == 0) _XmPrintScreenToShellContext = XUniqueContext(); } /************************************************************************ * * ClassPartInitialize * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit(wc, XmPRINT_SHELL_BIT); } static void PrintNotifyHandler( Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch) { XPPrintEvent * xpev = (XPPrintEvent *) event ; XmPrintShellWidget print_shell = (XmPrintShellWidget) w ; XmPrintShellCallbackStruct pr_cbs ; /* don't interfere with the app if it hasn't set any callback. (since we set the handler all the time) It is probably using it's own handler doing start page, etc */ if (!print_shell->print.start_job_callback && !print_shell->print.page_setup_callback && !print_shell->print.end_job_callback) return ; pr_cbs.event = event; pr_cbs.context = xpev->context ; switch (xpev->detail) { case XPStartJobNotify : print_shell->print.last_page = False ; pr_cbs.reason = XmCR_START_JOB ; pr_cbs.last_page = False ; XtCallCallbackList (w, print_shell->print.start_job_callback, &pr_cbs); /* fall thru : call both callbacks if present */ case XPEndPageNotify : /* if last end page, no need to call pagesetup again */ if (!print_shell->print.last_page) { pr_cbs.reason = XmCR_PAGE_SETUP; pr_cbs.last_page = False ; XtCallCallbackList (w, print_shell->print.page_setup_callback, &pr_cbs); /* on return from pageSetup, save whether or not that was the last page set up by the app */ print_shell->print.last_page = pr_cbs.last_page; /* only start a page if a callback is there */ if (print_shell->print.page_setup_callback) { XpStartPage(XtDisplay(w), XtWindow(w)); } } break ; case XPStartPageNotify : if (print_shell->print.page_setup_callback) { XpEndPage(XtDisplay(w)); if (print_shell->print.last_page) XpEndJob(XtDisplay(w)); } break ; case XPEndJobNotify : pr_cbs.reason = XmCR_PAGE_SETUP; pr_cbs.last_page = True ; XtCallCallbackList (w, print_shell->print.page_setup_callback, &pr_cbs); pr_cbs.reason = XmCR_END_JOB ; XtCallCallbackList (w, print_shell->print.end_job_callback, &pr_cbs); break ; } } static void ResourcesUpdate(Widget w, XPContext pcontext, Dimension * pwidth, Dimension * pheight) { XmPrintShellWidget print_shell = (XmPrintShellWidget) w ; String string_resolution ; XRectangle imageable_area ; /*** Get the resolution so that unit Type conversion works */ string_resolution = XpGetOneAttribute(XtDisplay(w), pcontext, XPDocAttr, "default-printer-resolution") ; print_shell->print.print_resolution = atoi(string_resolution); XFree(string_resolution); if (!print_shell->print.print_resolution) /* compute from the X screen resolution */ print_shell->print.print_resolution = (254 * WidthOfScreen(XtScreen(w)) + 5 * WidthMMOfScreen(XtScreen(w))) / (10 * WidthMMOfScreen(XtScreen(w))) ; /* get our size from the print server now */ XpGetPageDimensions(XtDisplay(w), pcontext, pwidth, pheight, &imageable_area); print_shell->print.min_x = imageable_area.x ; print_shell->print.min_y = imageable_area.y ; print_shell->print.max_x = imageable_area.x + imageable_area.width ; print_shell->print.max_y = imageable_area.y + imageable_area.height ; } static void AttributesNotifyHandler( Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch) { XPAttributeEvent * xatrev = (XPAttributeEvent *) event ; XmPrintShellWidget print_shell = (XmPrintShellWidget) w ; Dimension width = w->core.width, height = w->core.height; /* For now, blindly update resolution and sizes */ ResourcesUpdate(w, xatrev->context, &width, &height); XtResizeWidget(w, width, height, w->core.border_width); } static void SelectXpEvents ( Widget widget, int *event_types, XtPointer *select_data, int count, XtPointer client_data) { XpSelectInput(XtDisplay(widget), XpGetContext(XtDisplay(widget)), XPPrintMask|XPAttributeMask); } /***************************** Maintain a XPContext to widget binding for use in event dispatch to print shell logic. Limitation is only one shell per XPContext in this implementation. Could improve to dispatch to all widget in this context later, but not sure if supported by Xp itself. ******************************/ static void GetFromTable (Display* pdpy, XPContext context, Widget * widget) { XFindContext(pdpy, (XID)context, PrintContextToWidget, (XPointer *) widget); } static void DeleteFromTable (XPContext context, Widget widget) { XDeleteContext(XtDisplay(widget), (XID)context, PrintContextToWidget); } static void AddToTable (XPContext context, Widget widget) { XSaveContext(XtDisplay(widget), (XID)context, PrintContextToWidget, (XPointer) widget); } /*****************************/ static Boolean PrintDispatchEvent (XEvent *event) { XPPrintEvent * xpev = (XPPrintEvent *) event ; Widget widget = NULL ; /* I only have a context, not a window, so I can't use XtWindowToWidget.. I have to maintain my own table widget/context. Limitation: one context to one widget for now */ GetFromTable(xpev->display, xpev->context, &widget); /* If ever supported, need to loop thru a list, if several print_shell have been created under the same XPContext, and dispatch the event to all of them */ if (!widget) return False ; /* spec says to call filter first, even though in my case, I shouldn't have any IM around... */ if (XFilterEvent(event, XtWindow(widget))) return True ; return XtDispatchEventToWidget(widget, event); } /************************************************************************ * * Initialize * ************************************************************************/ static void Initialize( Widget req_widget, Widget new_widget, ArgList args, Cardinal *num_args ) { int event_base_return, error_base_return ; XmPrintShellWidget print_shell = (XmPrintShellWidget) new_widget ; XPContext pcontext ; Screen * pscreen ; _XmProcessLock(); /* mark the screen of this print shell in this context */ XSaveContext(XtDisplay(new_widget), (XID)XtScreen(new_widget), _XmPrintScreenToShellContext, (XPointer) new_widget); /* also maintain a counter of all shell */ _XmPrintShellCounter ++ ; _XmProcessUnlock(); print_shell->print.xp_connected = False ; print_shell->print.print_resolution = 100 ; /*** first check if the Print extension is present at all */ if (!XpQueryExtension (XtDisplay(new_widget), &event_base_return, &error_base_return)) { return ; } /* need to check that the print context is set for the screen of this print shell (i.e. it's a print screen, not just a screen on a display that support printing and for which a context was establish on a different screen - which can be common in preview case */ pcontext = XpGetContext(XtDisplay(new_widget)); if (!pcontext || XpGetScreenOfContext(XtDisplay(new_widget),pcontext) != XtScreen(new_widget)) { return ; } print_shell->print.xp_connected = True ; /*** add an element to a widget/XPContext table, used in the event dispatch mechanism */ AddToTable(pcontext, new_widget); /*** add extension event Handler for Start/End Job/Page Notify */ XtInsertEventTypeHandler(new_widget, event_base_return + XPPrintNotify, (XtPointer)XPPrintMask, PrintNotifyHandler, NULL, XtListTail); /*** also add extension event Handler for tracking attributes change */ XtInsertEventTypeHandler(new_widget, event_base_return + XPAttributeNotify, (XtPointer)XPAttributeMask, AttributesNotifyHandler, NULL, XtListTail); /* always register the extension selector, and the event dispatcher, it will override itself accordingly and works ok for different display connection */ XtRegisterExtensionSelector(XtDisplay(new_widget), event_base_return + XPPrintNotify, event_base_return + XPAttributeNotify, SelectXpEvents, NULL); (void) XtSetEventDispatcher(XtDisplay(new_widget), event_base_return + XPPrintNotify, PrintDispatchEvent); (void) XtSetEventDispatcher(XtDisplay(new_widget), event_base_return + XPAttributeNotify, PrintDispatchEvent); /* go and get resolution and initial sizes */ ResourcesUpdate(new_widget, pcontext, &(new_widget->core.width), &(new_widget->core.height)); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget current, Widget request, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmPrintShellWidget cur_print_shell = (XmPrintShellWidget) current ; XmPrintShellWidget new_print_shell = (XmPrintShellWidget) new_w ; if (!new_print_shell->print.xp_connected) return False ; /* need to check for changes in getvalues only resources . need to put out a warning */ if (cur_print_shell->print.min_x != new_print_shell->print.min_x) new_print_shell->print.min_x = cur_print_shell->print.min_x ; if (cur_print_shell->print.min_y != new_print_shell->print.min_y) new_print_shell->print.min_y = cur_print_shell->print.min_y ; if (cur_print_shell->print.max_x != new_print_shell->print.max_x) new_print_shell->print.max_x = cur_print_shell->print.max_x ; if (cur_print_shell->print.max_y != new_print_shell->print.max_y) new_print_shell->print.max_y = cur_print_shell->print.max_y ; return False ; } /************************************************************************ * * Destroy * ************************************************************************/ /* ARGSUSED */ static void Destroy( Widget w ) { XmPrintShellWidget print_shell = (XmPrintShellWidget) w ; /* need to remove the pixmap from this shell: no sharing between diff shell and the same shell pointer id can come up next time */ _XmCleanPixmapCache (XtScreen(w), w); if (!print_shell->print.xp_connected) return ; /*** remove entry in the widget/XPContext table, used in the event dispatch mechanism */ DeleteFromTable(XpGetContext(XtDisplay(w)), w); _XmProcessLock(); /* unmark the screen of this print shell in this context */ XDeleteContext(XtDisplay(w), (XID)XtScreen(w), _XmPrintScreenToShellContext); /* also maintain a counter of all shells alive */ _XmPrintShellCounter -- ; _XmProcessUnlock(); } /************************************************************************ * * Public API * ************************************************************************/ /************************************************************************ * * XmPrintSetup * * add print display in app context and create the print shell * ************************************************************************/ Widget XmPrintSetup( Widget video_widget, Screen *print_screen, String print_shell_name, ArgList args, Cardinal num_args) { String video_name, video_class ; Widget pappshell ; Widget print_shell; Display *print_display = DisplayOfScreen(print_screen); /* get to the video app root shell */ while(!XtIsApplicationShell(video_widget)) video_widget = XtParent(video_widget); if (!video_widget) return NULL; XtGetApplicationNameAndClass(XtDisplay(video_widget), &video_name, &video_class); /* we want to be able to specify things like: dtpad.print*textFontList: somefont dtpad.print*background:white so we create a first shell unrealized and them a popup named "print". */ pappshell = XtVaAppCreateShell(video_name, video_class, applicationShellWidgetClass, print_display, XmNscreen, print_screen, NULL); /* then create the XmPrintShell */ print_shell = XtCreatePopupShell(print_shell_name, xmPrintShellWidgetClass, pappshell, args, num_args); /* Add callback to destroy application Shell parent. */ XtAddCallback(print_shell, XmNdestroyCallback, _XmDestroyParentCallback, (XtPointer) NULL) ; /* we're mapping/unmapping at start/end page time */ XtSetMappedWhenManaged(print_shell, False); /* realize the shell now, so that XmPrintPopupPDM works dy default */ XtRealizeWidget(print_shell); return print_shell ; } /************************************************************************ * * XmPrintToFile * ************************************************************************/ /* need to be able to remove the filename or write/close the file */ typedef struct { String file_name; FILE * file; int pipe; } FileDescRec ; typedef struct { Display *display; XPFinishProc finish_proc; XPointer client_data; int pipe; XtInputId input_id; } FileCallbackRec; static void PrintToFileProc(Display * dpy, XPContext context, unsigned char *data, unsigned int data_len, XPointer client_data) { FileDescRec * file_desc = (FileDescRec *) client_data ; /* write to the file */ fwrite(data, data_len, 1, file_desc->file); } static void FinishProc(Display *display, XPContext context, XPGetDocStatus status, XPointer client_data) { FileDescRec * file_desc = (FileDescRec *) client_data ; /* remove the file if not successfull */ if (status != XPGetDocFinished) remove(file_desc->file_name); else fclose(file_desc->file); /* write the status to the parent */ (void) write(file_desc->pipe, &status, sizeof(XPGetDocStatus)); /* we don't do any free's or close's, as we are just going to exit, in fact, get out without calling any C++ destructors, etc., as we don't want anything funny to happen to the parent */ _exit(0); } static void FilePipeCB(XtPointer client_data, int *source, XtInputId *id) { FileCallbackRec *cb = (FileCallbackRec *) client_data; XPGetDocStatus status; /* read the status from the child */ (void) read(cb->pipe, &status, sizeof(XPGetDocStatus)); XtRemoveInput(cb->input_id); close(cb->pipe); if (cb->finish_proc) { (*cb->finish_proc)(cb->display, XpGetContext(cb->display), status, cb->client_data); } XtFree((char*)cb); } static void ChildPrintToFile(String display_name, XPContext pcontext, FILE *file, char *file_name, int pipe, String application_name, String application_class) { FileDescRec *file_desc; XtAppContext app_context; int argc = 0; String argv[] = { NULL }; Display *display; file_desc = (FileDescRec *) XtMalloc(sizeof(FileDescRec)); file_desc->file_name = XtNewString(file_name); file_desc->file = file; file_desc->pipe = pipe; app_context = XtCreateApplicationContext(); if ((display = XtOpenDisplay(app_context, display_name, application_name, application_class, NULL, 0, &argc, argv)) == NULL) { _exit(1); } XpGetDocumentData(display, pcontext, PrintToFileProc, FinishProc, (XPointer) file_desc); XtAppMainLoop(app_context); _exit(0); } XtEnum XmPrintToFile(Display *pdpy, char *file_name, XPFinishProc finish_proc, XPointer client_data) { FileCallbackRec *callback; int pid; XPContext pcontext ; String application_name, application_class, display_name; FILE *file; int filedes[2]; /* make sure we can open the file for writing */ if ((file = fopen(file_name, "w")) == NULL) { return False; } if ((pipe(filedes)) == -1) { return False; } /* its important to flush before we fork, to make sure that the XpStartJob gets through first in the parent */ XFlush(pdpy); XtGetApplicationNameAndClass(pdpy, &application_name, &application_class); display_name = XDisplayString(pdpy) ; pcontext = XpGetContext(pdpy) ; pid = fork(); if (pid == 0) { ChildPrintToFile(display_name, pcontext, file, file_name, filedes[1], application_name, application_class); } else if (pid < 0) { return False; } /* we are in the parent */ fclose(file); close(filedes[1]); /* allocate the space for a callback */ callback = (FileCallbackRec *) XtMalloc(sizeof(FileCallbackRec)); callback->display = pdpy; callback->pipe = filedes[0]; callback->finish_proc = finish_proc; callback->client_data = client_data; /* notification that the child has completed */ callback->input_id = XtAppAddInput(XtDisplayToApplicationContext(pdpy), callback->pipe, (XtPointer)XtInputReadMask, FilePipeCB, callback); return True; } /************************************************************* ** XmPrintPopupPDM code *************************************************************/ static void PDMPhase2Handler(Widget w, XtPointer data, XEvent *event, Boolean *cont) { enum { XmAPDM_REPLY, XmAPDM_EXIT_OK, XmAPDM_EXIT_ERROR, XmAPDM_EXIT_CANCEL, NUM_ATOMS }; static char *atom_names[] = { XmIPDM_REPLY, XmIPDM_EXIT_OK, XmIPDM_EXIT_ERROR, XmIPDM_EXIT_CANCEL }; XmPrintShellWidget print_shell = (XmPrintShellWidget) w ; XmPrintShellCallbackStruct pr_cbs ; XClientMessageEvent * xevent = (XClientMessageEvent *) event; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(print_shell), atom_names, XtNumber(atom_names), False, atoms); if (xevent->type == ClientMessage && xevent->message_type == atoms[XmAPDM_REPLY]) { /* check for the exit status of the PDM */ if (xevent->data.l[0] == atoms[XmAPDM_EXIT_OK]) pr_cbs.reason = XmCR_PDM_OK ; else if (xevent->data.l[0] == atoms[XmAPDM_EXIT_CANCEL]) pr_cbs.reason = XmCR_PDM_CANCEL ; else if (xevent->data.l[0] == atoms[XmAPDM_EXIT_ERROR]) pr_cbs.reason = XmCR_PDM_EXIT_ERROR ; /* some error message might have been logged */ XtCallCallbackList (w, print_shell->print.pdm_notification_callback, &pr_cbs); } /* remove me */ XtAddEventHandler(w, (EventMask) 0, True, PDMPhase2Handler, NULL); } typedef struct { Atom pdm_selection ; XmPrintShellWidget print_shell ; Widget transient_for_video_shell ; Window transient_for_input_only_window; } PDMSelectData ; static void PDMSelectionProc (Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format) { enum { XmAPDM_START_OK, XmAPDM_START_ERROR, XmAPDM_START_VXAUTH, XmAPDM_START_PXAUTH, NUM_ATOMS }; static char *atom_names[] = { XmIPDM_START_OK, XmIPDM_START_ERROR, XmIPDM_START_VXAUTH, XmIPDM_START_PXAUTH }; XmPrintShellCallbackStruct pr_cbs ; PDMSelectData * pdm_select_data = (PDMSelectData *) client_data ; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(pdm_select_data->print_shell), atom_names, XtNumber(atom_names), False, atoms); /* set back the video shell widget usable */ XDestroyWindow(XtDisplay(pdm_select_data->transient_for_video_shell), pdm_select_data->transient_for_input_only_window); /* look at value and decide if success or failure */ if (!value) { pr_cbs.reason = XmCR_PDM_NONE ; pr_cbs.detail = (XtPointer) pdm_select_data->pdm_selection ; } else { /* look if value is PDM_START_OK, or PDM_START_VXAUTH, etc */ if (*(Atom *)value == atoms[XmAPDM_START_OK]) pr_cbs.reason = XmCR_PDM_UP ; else if (*(Atom *)value == atoms[XmAPDM_START_ERROR]) pr_cbs.reason = XmCR_PDM_START_ERROR ; else if (*(Atom *)value == atoms[XmAPDM_START_VXAUTH]) pr_cbs.reason = XmCR_PDM_START_VXAUTH ; else if (*(Atom *)value == atoms[XmAPDM_START_PXAUTH]) pr_cbs.reason = XmCR_PDM_START_PXAUTH ; /* if PDM is up, install a handler for phase 2 */ if (pr_cbs.reason == XmCR_PDM_UP) { XtAddEventHandler((Widget)pdm_select_data->print_shell, (EventMask) 0, True, /* ClientMessage are non maskable */ PDMPhase2Handler, NULL); } } XtCallCallbackList ((Widget)pdm_select_data->print_shell, pdm_select_data->print_shell ->print.pdm_notification_callback, &pr_cbs); XtFree((char*)pdm_select_data); } XtEnum XmPrintPopupPDM(Widget print_shell, Widget transient_for_video_shell) { Atom pdm_selection; Atom type; unsigned char * value; int length; int format; Atom PDM_START ; Display * display_used ; PDMSelectData * pdm_select_data ; Widget widget_for_selection ; XtAppContext app; unsigned long old_timeout; /* get parameter for PDM_START from libXp ask conversion using XtSetSelectionParameters, and then call XtGetSelectionValue, which registers a XtSelectionCallbackProc that will wait for failure (no pdm owner, or timeout) or success. Phase 2 of the pdm (clientmessage) will be handled by a event handler set up from the selection callback on success */ if (!XpGetPdmStartParams (XtDisplay(print_shell), XtWindow(print_shell), XpGetContext(XtDisplay(print_shell)), XtDisplay(transient_for_video_shell), XtWindow(transient_for_video_shell), &display_used, &pdm_selection, &type, &format, &value, &length)) return XmPDM_NOTIFY_FAIL; /* only support XPDMDISPLAY = "print" or "video" */ if (display_used == XtDisplay(print_shell)) widget_for_selection = print_shell ; else if (display_used == XtDisplay(transient_for_video_shell)) widget_for_selection = transient_for_video_shell ; else return XmPDM_NOTIFY_FAIL ; XtSetSelectionParameters(widget_for_selection, pdm_selection, type, (XtPointer)value, length, format); XFree(value); pdm_select_data = (PDMSelectData *) XtMalloc(sizeof(PDMSelectData)); pdm_select_data->pdm_selection = pdm_selection ; pdm_select_data->transient_for_video_shell = transient_for_video_shell ; pdm_select_data->print_shell = (XmPrintShellWidget) print_shell ; /* need this one in all cases */ PDM_START = XInternAtom(XtDisplay(widget_for_selection), XmIPDM_START, False); app = XtWidgetToApplicationContext(widget_for_selection); /* twenty minutes */ #define REALLY_LONG_TIMEOUT (2 * 60 * 1000) _XmAppLock(app); old_timeout = XtAppGetSelectionTimeout(app); XtAppSetSelectionTimeout(app, REALLY_LONG_TIMEOUT); XtGetSelectionValue(widget_for_selection, pdm_selection, PDM_START, PDMSelectionProc, (XtPointer)pdm_select_data, XtLastTimestampProcessed( XtDisplay(widget_for_selection))); XtAppSetSelectionTimeout(app, old_timeout); _XmAppUnlock(app); /* put up a InputOnly window on top of the dialog, so that the end-user cannot muck around with the print setup dialog hile the PDM is trying to come up. This is removed in PDMSelectionProc */ pdm_select_data->transient_for_input_only_window = XCreateWindow(XtDisplay(transient_for_video_shell), XtWindow(transient_for_video_shell), 0, 0, XtWidth(transient_for_video_shell), XtHeight(transient_for_video_shell), 0, CopyFromParent, InputOnly, CopyFromParent, 0, NULL); XMapRaised(XtDisplay(transient_for_video_shell), pdm_select_data->transient_for_input_only_window); return XmPDM_NOTIFY_SUCCESS ; } /************************************************************************ * * XmRedisplayWidget * * Call the expose method of the passed widget with a fake * event corresponding to its entire area. * ************************************************************************/ void XmRedisplayWidget(Widget widget) { XExposeEvent xev ; Region region ; xev.type = Expose ; /* is this better than 0 ? shouldn't make much difference unless the expose method is very tricky... */ xev.serial = LastKnownRequestProcessed(XtDisplay(widget)) ; xev.send_event = False ; xev.display = XtDisplay(widget); xev.window = XtWindowOfObject(widget); /* work with gadget too */ xev.x = 0 ; xev.y = 0 ; xev.width = widget->core.width ; xev.height = widget->core.height ; xev.count = 0 ; region = XCreateRegion(); XtAddExposureToRegion((XEvent*)&xev, region); if (widget->core.widget_class->core_class.expose) (*(widget->core.widget_class->core_class.expose)) (widget, (XEvent*)&xev, region); XDestroyRegion(region); } motif-2.3.8/lib/Xm/XpmAttrib.c0000644000175000017500000002121312672140200012764 00000000000000/* $XConsortium: XpmAttrib.c /main/3 1996/09/20 07:58:11 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * Attrib.c: * * * * XPM library * * Functions related to the XpmAttributes structure * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" /* 3.2 backward compatibility code */ LFUNC(CreateOldColorTable, int, (XpmColor *ct, unsigned int ncolors, XpmColor ***oldct)); LFUNC(FreeOldColorTable, void, (XpmColor **colorTable, unsigned int ncolors)); /* * Create a colortable compatible with the old style colortable */ static int CreateOldColorTable(ct, ncolors, oldct) XpmColor *ct; unsigned int ncolors; XpmColor ***oldct; { XpmColor **colorTable, **color; unsigned int a; if (ncolors >= UINT_MAX / sizeof(XpmColor *)) return XpmNoMemory; colorTable = (XpmColor **) XpmMalloc(ncolors * sizeof(XpmColor *)); if (!colorTable) { *oldct = NULL; return (XpmNoMemory); } for (a = 0, color = colorTable; a < ncolors; a++, color++, ct++) *color = ct; *oldct = colorTable; return (XpmSuccess); } static void FreeOldColorTable(colorTable, ncolors) XpmColor **colorTable; unsigned int ncolors; { unsigned int a, b; XpmColor **color; char **sptr; if (colorTable) { for (a = 0, color = colorTable; a < ncolors; a++, color++) { for (b = 0, sptr = (char **) *color; b <= NKEYS; b++, sptr++) if (*sptr) XpmFree(*sptr); } XpmFree(*colorTable); XpmFree(colorTable); } } /* end 3.2 bc */ /* * Free the computed color table */ void xpmFreeColorTable(colorTable, ncolors) XpmColor *colorTable; int ncolors; { int a, b; XpmColor *color; char **sptr; if (colorTable) { for (a = 0, color = colorTable; a < ncolors; a++, color++) { for (b = 0, sptr = (char **) color; b <= NKEYS; b++, sptr++) if (*sptr) XpmFree(*sptr); } XpmFree(colorTable); } } /* * Free array of extensions */ void XpmFreeExtensions(extensions, nextensions) XpmExtension *extensions; int nextensions; { unsigned int i, j, nlines; XpmExtension *ext; char **sptr; if (extensions && nextensions > 0) { for (i = 0, ext = extensions; i < nextensions; i++, ext++) { if (ext->name) XpmFree(ext->name); nlines = ext->nlines; for (j = 0, sptr = ext->lines; j < nlines; j++, sptr++) if (*sptr) XpmFree(*sptr); if (ext->lines) XpmFree(ext->lines); } XpmFree(extensions); } } /* * Return the XpmAttributes structure size */ int XpmAttributesSize() { return sizeof(XpmAttributes); } /* * Init returned data to free safely later on */ void xpmInitAttributes(attributes) XpmAttributes *attributes; { if (attributes) { attributes->pixels = NULL; attributes->npixels = 0; attributes->colorTable = NULL; attributes->ncolors = 0; /* 3.2 backward compatibility code */ attributes->hints_cmt = NULL; attributes->colors_cmt = NULL; attributes->pixels_cmt = NULL; /* end 3.2 bc */ if (attributes->valuemask & XpmReturnExtensions) { attributes->extensions = NULL; attributes->nextensions = 0; } if (attributes->valuemask & XpmReturnAllocPixels) { attributes->alloc_pixels = NULL; attributes->nalloc_pixels = 0; } } } /* * Fill in the XpmAttributes with the XpmImage and the XpmInfo */ void xpmSetAttributes(attributes, image, info) XpmAttributes *attributes; XpmImage *image; XpmInfo *info; { if (attributes->valuemask & XpmReturnColorTable) { attributes->colorTable = image->colorTable; attributes->ncolors = image->ncolors; /* avoid deletion of copied data */ image->ncolors = 0; image->colorTable = NULL; } /* 3.2 backward compatibility code */ else if (attributes->valuemask & XpmReturnInfos) { int ErrorStatus; ErrorStatus = CreateOldColorTable(image->colorTable, image->ncolors, (XpmColor ***) &attributes->colorTable); /* if error just say we can't return requested data */ if (ErrorStatus != XpmSuccess) { attributes->valuemask &= ~XpmReturnInfos; if (!(attributes->valuemask & XpmReturnPixels)) { XpmFree(attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } attributes->ncolors = 0; } else { attributes->ncolors = image->ncolors; attributes->hints_cmt = info->hints_cmt; attributes->colors_cmt = info->colors_cmt; attributes->pixels_cmt = info->pixels_cmt; /* avoid deletion of copied data */ image->ncolors = 0; image->colorTable = NULL; info->hints_cmt = NULL; info->colors_cmt = NULL; info->pixels_cmt = NULL; } } /* end 3.2 bc */ if (attributes->valuemask & XpmReturnExtensions) { attributes->extensions = info->extensions; attributes->nextensions = info->nextensions; /* avoid deletion of copied data */ info->extensions = NULL; info->nextensions = 0; } if (info->valuemask & XpmHotspot) { attributes->valuemask |= XpmHotspot; attributes->x_hotspot = info->x_hotspot; attributes->y_hotspot = info->y_hotspot; } attributes->valuemask |= XpmCharsPerPixel; attributes->cpp = image->cpp; attributes->valuemask |= XpmSize; attributes->width = image->width; attributes->height = image->height; } /* * Free the XpmAttributes structure members * but the structure itself */ void XpmFreeAttributes(attributes) XpmAttributes *attributes; { if (attributes->valuemask & XpmReturnPixels && attributes->npixels) { XpmFree(attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } if (attributes->valuemask & XpmReturnColorTable) { xpmFreeColorTable(attributes->colorTable, attributes->ncolors); attributes->colorTable = NULL; attributes->ncolors = 0; } /* 3.2 backward compatibility code */ else if (attributes->valuemask & XpmInfos) { if (attributes->colorTable) { FreeOldColorTable((XpmColor **) attributes->colorTable, attributes->ncolors); attributes->colorTable = NULL; attributes->ncolors = 0; } if (attributes->hints_cmt) { XpmFree(attributes->hints_cmt); attributes->hints_cmt = NULL; } if (attributes->colors_cmt) { XpmFree(attributes->colors_cmt); attributes->colors_cmt = NULL; } if (attributes->pixels_cmt) { XpmFree(attributes->pixels_cmt); attributes->pixels_cmt = NULL; } if (attributes->pixels) { XpmFree(attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } } /* end 3.2 bc */ if (attributes->valuemask & XpmReturnExtensions && attributes->nextensions) { XpmFreeExtensions(attributes->extensions, attributes->nextensions); attributes->extensions = NULL; attributes->nextensions = 0; } if (attributes->valuemask & XpmReturnAllocPixels && attributes->nalloc_pixels) { XpmFree(attributes->alloc_pixels); attributes->alloc_pixels = NULL; attributes->nalloc_pixels = 0; } attributes->valuemask = 0; } motif-2.3.8/lib/Xm/ToggleB.c0000644000175000017500000034026413145162623012420 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: ToggleB.c /main/43 1999/12/06 18:09:38 samborn $" #endif #endif #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "ColorI.h" #include "LabelI.h" #include "MenuProcI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "PrimitiveI.h" #include "RepTypeI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #define XmINVALID_TYPE 255 /* default flag for IndicatorType */ #define XmINVALID_BOOLEAN 85 /* default flag for VisibleWhenOff */ #define XmINVALID_PIXEL ((Pixel) -1) /* default flag for unselectColor */ #define MIN_GLYPH_SIZE 5 /* Threshold for rendering glyphs. */ #define PixmapOn(w) ((w)->toggle.on_pixmap) #define PixmapOff(w) ((w)->label.pixmap) #define PixmapInd(w) ((w)->toggle.indeterminate_pixmap) #define PixmapInsenOn(w) ((w)->toggle.insen_pixmap) #define PixmapInsenOff(w) ((w)->label.pixmap_insen) #define PixmapInsenInd(w) ((w)->toggle.indeterminate_insensitive_pixmap) #define IsNull(p) ((p) == XmUNSPECIFIED_PIXMAP) #define IsOn(w) ((w)->toggle.visual_set) #define IsOneOfMany(ind_type) (((ind_type) == XmONE_OF_MANY) || \ ((ind_type) == XmONE_OF_MANY_ROUND) || \ ((ind_type) == XmONE_OF_MANY_DIAMOND)) /* Constants used to decompose XmNindicatorOn values. */ #define XmINDICATOR_BOX_MASK 0x0f #define XmINDICATOR_GLYPH_MASK 0xf0 /* The indicator value should already have been normalized! */ #define DRAW3DBOX(ind_on) ((ind_on) & XmINDICATOR_3D_BOX) #define DRAWFLATBOX(ind_on) ((ind_on) & XmINDICATOR_FLAT_BOX) #define DRAWBOX(ind_on) ((ind_on) & XmINDICATOR_BOX_MASK) #define DRAWCHECK(ind_on) ((ind_on) & XmINDICATOR_CHECK_GLYPH) #define DRAWCROSS(ind_on) ((ind_on) & XmINDICATOR_CROSS_GLYPH) #define DRAWGLYPH(ind_on) ((ind_on) & XmINDICATOR_GLYPH_MASK) /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void SetAndDisplayPixmap( XmToggleButtonWidget tb, XEvent *event, Region region) ; static void Help( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ToggleButtonCallback( XmToggleButtonWidget data, unsigned int reason, unsigned int value, XEvent *event) ; static void Leave( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Enter( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Arm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Select( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Disarm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BtnDown( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BtnUp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void GetGC( XmToggleButtonWidget tw) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Destroy( Widget wid) ; static void DrawToggle( XmToggleButtonWidget w) ; static void BorderHighlight( Widget wid) ; static void BorderUnhighlight( Widget wid) ; static void KeySelect( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void ComputeSpace( XmToggleButtonWidget tb) ; static void Redisplay( Widget w, XEvent *event, Region region) ; static void Resize( Widget w) ; static Boolean SetValuesPrehook( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static void DrawToggleShadow( XmToggleButtonWidget tb) ; static void DrawToggleLabel( XmToggleButtonWidget tb) ; static void DrawEtchedInMenu( XmToggleButtonWidget tb) ; static void SetToggleSize( XmToggleButtonWidget newtb) ; static void NextState(unsigned char *state); static void DrawBox( XmToggleButtonWidget w, GC top_gc, GC bot_gc, GC fillgc, int x, int y, int edge, Dimension margin ); static void DefaultSelectColor(Widget widget, int offset, XrmValue *value); static unsigned char NormalizeIndOn(XmToggleButtonWidget tb); static unsigned char NormalizeIndType(XmToggleButtonWidget tb); static void TB_FixTearoff( XmToggleButtonWidget tb); /******** End Static Function Declarations ********/ /*************************************<->************************************* * * * Description: default translation table for class: ToggleButton * ----------- * * Matches events with string descriptors for internal routines. * *************************************<->***********************************/ static XtTranslations default_parsed; #define defaultTranslations _XmToggleB_defaultTranslations static XtTranslations menu_parsed; #define menuTranslations _XmToggleB_menuTranslations /*************************************<->************************************* * * * Description: action list for class: ToggleButton * ----------- * * Matches string descriptors with internal routines. * *************************************<->***********************************/ static XtActionsRec actionsList[] = { {"Arm", Arm }, {"ArmAndActivate", ArmAndActivate }, {"Disarm", Disarm }, {"Select", Select }, {"Enter", Enter }, {"Leave", Leave }, {"BtnDown", BtnDown }, {"BtnUp", BtnUp }, {"ButtonTakeFocus", _XmButtonTakeFocus }, {"MenuButtonTakeFocus", _XmMenuButtonTakeFocus }, {"MenuButtonTakeFocusUp", _XmMenuButtonTakeFocusUp }, {"KeySelect", KeySelect }, {"Help", Help}, }; /*************************************<->************************************* * * * Description: resource list for class: ToggleButton * ----------- * * Provides default resource settings for instances of this class. * To get full set of default settings, examine resouce list of super * classes of this class. * *************************************<->***********************************/ #define Offset(field) (XtOffsetOf(XmToggleButtonRec, field)) static XtResource resources[] = { { XmNindicatorSize, XmCIndicatorSize, XmRVerticalDimension, sizeof(Dimension), Offset(toggle.indicator_dim), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNindicatorType, XmCIndicatorType, XmRIndicatorType, sizeof(unsigned char), Offset(toggle.ind_type), XmRImmediate, (XtPointer) XmINVALID_TYPE }, { XmNvisibleWhenOff, XmCVisibleWhenOff, XmRBoolean, sizeof(Boolean), Offset(toggle.visible), XmRImmediate, (XtPointer) XmINVALID_BOOLEAN }, { XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), Offset(toggle.spacing), XmRImmediate, (XtPointer) 4 }, { XmNselectPixmap, XmCSelectPixmap, XmRDynamicPixmap, sizeof(Pixmap), Offset(toggle.on_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNselectInsensitivePixmap, XmCSelectInsensitivePixmap, XmRDynamicPixmap, sizeof(Pixmap), Offset(toggle.insen_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNset, XmCSet, XmRSet, sizeof(unsigned char), Offset(toggle.set), XmRImmediate, (XtPointer) XmUNSET }, { XmNindicatorOn, XmCIndicatorOn, XmRIndicatorOn, sizeof (unsigned char), Offset(toggle.ind_on), XmRImmediate, (XtPointer) XmINDICATOR_FILL }, { XmNfillOnSelect, XmCFillOnSelect, XmRBoolean, sizeof(Boolean), Offset(toggle.fill_on_select), XmRImmediate, (XtPointer) XmINVALID_BOOLEAN }, { XmNselectColor, XmCSelectColor, XmRSelectColor, sizeof(Pixel), Offset(toggle.select_color), XmRCallProc, (XtPointer) DefaultSelectColor }, { XmNvalueChangedCallback, XmCValueChangedCallback, XmRCallback, sizeof (XtCallbackList), Offset(toggle.value_changed_CB), XmRPointer, (XtPointer)NULL }, { XmNarmCallback, XmCArmCallback, XmRCallback, sizeof(XtCallbackList), Offset(toggle.arm_CB), XmRPointer, (XtPointer)NULL }, { XmNdisarmCallback, XmCDisarmCallback, XmRCallback, sizeof (XtCallbackList), Offset(toggle.disarm_CB), XmRPointer, (XtPointer)NULL }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), Offset(primitive.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof(Dimension), Offset(primitive.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNtoggleMode, XmCToggleMode, XmRToggleMode, sizeof(unsigned char), Offset(toggle.toggle_mode), XmRImmediate, (XtPointer) XmTOGGLE_BOOLEAN }, { XmNindeterminatePixmap, XmCIndeterminatePixmap, XmRDynamicPixmap, sizeof(Pixmap), Offset(toggle.indeterminate_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNindeterminateInsensitivePixmap, XmCIndeterminateInsensitivePixmap, XmRDynamicPixmap, sizeof(Pixmap), Offset(toggle.indeterminate_insensitive_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNunselectColor, XmCUnselectColor, XmRPixel, sizeof(Pixel), Offset(toggle.unselect_color), XmRImmediate, (XtPointer) XmINVALID_PIXEL }, { XmNdetailShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), Offset(toggle.detail_shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness } }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNspacing, sizeof(Dimension), Offset(toggle.spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNindicatorSize, sizeof(Dimension), Offset(toggle.indicator_dim), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNdetailShadowThickness, sizeof(Dimension), Offset(toggle.detail_shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels } }; #undef Offset /*************************************<->************************************* * * * Description: global class record for instances of class: ToggleButton * ----------- * * Defines default field settings for this class record. * *************************************<->***********************************/ static XmBaseClassExtRec toggleBBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ SetValuesPrehook, /* set_values prehook */ InitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ XmInheritGetSecResData, /* getSecResData */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ (XtWidgetClassProc)NULL, /* classPartInitPrehook */ (XtWidgetClassProc)NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; externaldef(xmtogglebuttonclassrec) XmToggleButtonClassRec xmToggleButtonClassRec = { { /* superclass */ (WidgetClass) &xmLabelClassRec, /* class_name */ "XmToggleButton", /* widget_size */ sizeof(XmToggleButtonRec), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ (XtArgsProc)NULL, /* realize */ XmInheritRealize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterlv */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ (XtArgsFunc)NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ (XtArgsProc)NULL, /* accept_focus */ (XtAcceptFocusProc)NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ NULL, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator*/ (XtStringProc)NULL, /* extension record */ (XtPointer)&toggleBBaseClassExtRec, }, { /* Primitive border_highlight */ BorderHighlight, /* Primitive border_unhighlight */ BorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ ArmAndActivate, /* syn resources */ syn_resources, /* num syn_resources */ XtNumber(syn_resources), /* extension */ NULL, }, { /* SetOverrideCallback */ XmInheritWidgetProc, /* menu procedures */ XmInheritMenuProc, /* menu traversal xlation */ XtInheritTranslations, /* extension */ NULL, }, { /* extension */ (XtPointer) NULL, } }; externaldef(xmtogglebuttonwidgetclass) WidgetClass xmToggleButtonWidgetClass = (WidgetClass)&xmToggleButtonClassRec; /* Menu Savvy trait record */ static XmMenuSavvyTraitRec MenuSavvyRecord = { /* version: */ -1, NULL, NULL, NULL, _XmCBNameValueChanged, }; /*************************************<->************************************* * * ClassInitialize * *************************************<->***********************************/ static void ClassInitialize( void ) { /* Parse the various translation tables. */ default_parsed = XtParseTranslationTable(defaultTranslations); menu_parsed = XtParseTranslationTable(menuTranslations); /* Set up base class extension quark */ toggleBBaseClassExtRec.record_type = XmQmotif; } /***************************************************************************** * * ClassPartInitialize * Set up fast subclassing for the widget. * ****************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmTOGGLE_BUTTON_BIT); /* Install the menu savvy trait record, copying fields from XmLabel */ _XmLabelCloneMenuSavvy (wc, &MenuSavvyRecord); } /************************************************************ * * InitializePrehook * * Put the proper translations in core_class tm_table so that * the data is massaged correctly * ************************************************************/ /*ARGSUSED*/ static void InitializePrehook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { unsigned char type; XmMenuSystemTrait menuSTrait; XmToggleButtonWidget bw = (XmToggleButtonWidget) new_w ; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(new_w)), XmQTmenuSystem); _XmSaveCoreClassTranslations (new_w); if (menuSTrait != NULL) type = menuSTrait->type(XtParent(new_w)); else type = XmWORK_AREA; _XmProcessLock(); if ((type == XmMENU_PULLDOWN) || (type == XmMENU_POPUP)) new_w->core.widget_class->core_class.tm_table = (String) menu_parsed; else new_w->core.widget_class->core_class.tm_table = (String) default_parsed; _XmProcessUnlock(); /* CR 2990: Use XmNbuttonFontList as the default font. */ if (bw->label.font == NULL) bw->label.font = XmeGetDefaultRenderTable (new_w, XmBUTTON_FONTLIST); } /************************************************************ * * InitializePosthook * * restore core class translations * ************************************************************/ /*ARGSUSED*/ static void InitializePosthook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { _XmRestoreCoreClassTranslations (new_w); } /********************************************************************* * * redisplayPixmap * does the apropriate calculations based on the toggle button's * current pixmap and calls label's Redisplay routine. * * This routine was added to fix CR 4839 and CR 4838 * D. Rand 7/6/92 * ***********************************************************************/ static void redisplayPixmap(XmToggleButtonWidget tb, XEvent *event, Region region) { Pixmap todo; unsigned int onH = 0, onW = 0; int w, h; int x, y, offset; short saveY; unsigned short saveWidth, saveHeight; offset = tb->primitive.highlight_thickness + tb->primitive.shadow_thickness; x = offset + tb->label.margin_width + tb->label.margin_left; y = offset + tb->label.margin_height + tb->label.margin_top; w = XtWidth(tb) - x - offset - tb->label.margin_right - tb->label.margin_width; ASSIGN_MAX(w, 0); h = XtHeight(tb) - y - offset - tb->label.margin_bottom - tb->label.margin_height; ASSIGN_MAX(h, 0); XClearArea(XtDisplay(tb), XtWindow(tb), x, y, w, h, False); todo = tb->label.pixmap; if ((! XtIsSensitive((Widget) tb)) && tb->label.pixmap_insen) todo = tb->label.pixmap_insen; if (! IsNull(todo)) XmeGetPixmapData(XtScreen(tb), todo, NULL, NULL, NULL, NULL, NULL, NULL, &onW, &onH); saveY = Lab_TextRect_y(tb); saveWidth = Lab_TextRect_width(tb); saveHeight = Lab_TextRect_height(tb); h = (XtHeight(tb) - onH) / 2; Lab_TextRect_y(tb) = MAX(h, 0); Lab_TextRect_height(tb) = onH; Lab_TextRect_width(tb) = onW; { XtExposeProc expose; _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (* expose) ((Widget) tb, event, region); } Lab_TextRect_y(tb) = saveY; Lab_TextRect_width(tb) = saveWidth; Lab_TextRect_height(tb) = saveHeight; } static void HandlePixmap(XmToggleButtonWidget tb, Pixmap pix, Pixmap insen_pix, XEvent * event, Region region) { if (XtIsSensitive((Widget) tb)) { if (! IsNull (pix)) { Pixmap tempPix = tb->label.pixmap; tb->label.pixmap = pix; redisplayPixmap(tb, event, region); tb->label.pixmap = tempPix; } else redisplayPixmap(tb, event, region); } else { if (! IsNull (insen_pix)) { Pixmap tempPix = tb->label.pixmap_insen; tb->label.pixmap_insen = insen_pix; redisplayPixmap(tb, event, region); tb->label.pixmap_insen = tempPix; } else redisplayPixmap(tb, event, region); } } /*********************************************************************** * * SetAndDisplayPixmap * Sets the appropriate on, off pixmap in label's pixmap field and * calls redisplayPixmap * ***********************************************************************/ static void SetAndDisplayPixmap( XmToggleButtonWidget tb, XEvent *event, Region region ) { if (tb->toggle.toggle_mode == XmTOGGLE_INDETERMINATE) { if (tb->toggle.visual_set == XmUNSET) HandlePixmap(tb, PixmapOff(tb), PixmapInsenOff(tb), event, region); else if (tb->toggle.visual_set == XmSET) HandlePixmap(tb, PixmapOn(tb), PixmapInsenOn(tb), event, region); else if (tb->toggle.visual_set == XmINDETERMINATE) HandlePixmap(tb, PixmapInd(tb), PixmapInsenInd(tb), event, region); } else { if (IsOn (tb) == XmSET) HandlePixmap(tb, PixmapOn(tb), PixmapInsenOn(tb), event, region); else redisplayPixmap(tb, event, region); } } /************************************************************************* * * Help * This routine is called if the user has made a help selection * on the widget. * ************************************************************************/ static void Help( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; Boolean is_menupane = Lab_IsMenupane(tb); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (is_menupane && menuSTrait != NULL) menuSTrait->buttonPopdown(XtParent(tb), event); _XmPrimitiveHelp( (Widget) tb, event, params, num_params); if (is_menupane && menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(tb), event); } /************************************************************************* * * ToggleButtonCallback * This is the widget's application callback routine * *************************************************************************/ static void ToggleButtonCallback( XmToggleButtonWidget data, unsigned int reason, unsigned int value, XEvent *event ) { XmToggleButtonCallbackStruct temp; temp.reason = reason; temp.set = value; temp.event = event; switch (reason) { case XmCR_VALUE_CHANGED: XtCallCallbackList ((Widget) data, data->toggle.value_changed_CB, &temp); break; case XmCR_ARM: XtCallCallbackList ((Widget) data, data->toggle.arm_CB, &temp); break; case XmCR_DISARM: XtCallCallbackList ((Widget) data, data->toggle.disarm_CB, &temp); break; } } /* Update the toggle after an Enter or Leave action. */ static void ActionDraw(XmToggleButtonWidget w, XEvent *event, Boolean leave) { if (w->toggle.Armed) { /* CR 7301: We may have armed while outside the toggle. */ if (leave) w->toggle.visual_set = w->toggle.set; else if (w->toggle.toggle_mode == XmTOGGLE_INDETERMINATE) NextState(&w->toggle.visual_set); else IsOn(w) = (w->toggle.set == XmSET)? XmUNSET : XmSET; if (w->toggle.ind_on) DrawToggle(w); else { if (w->primitive.shadow_thickness > 0) DrawToggleShadow(w); if (w->toggle.fill_on_select && !Lab_IsPixmap(w)) DrawToggleLabel(w); } if (Lab_IsPixmap(w) || Lab_IsPixmapAndText(w)) SetAndDisplayPixmap(w, event, NULL); } } /************************************************************************** * * Leave * This procedure is called when the mouse button is pressed and the * cursor moves out of the widget's window. This procedure is used * to change the visuals. * *************************************************************************/ static void Leave( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget w = (XmToggleButtonWidget) wid; if (Lab_IsMenupane(w)) { if (_XmGetInDragMode((Widget)w) && w->toggle.Armed && (/* !ActiveTearOff || */ event->xcrossing.mode == NotifyNormal)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; w->toggle.Armed = FALSE; ((XmManagerWidget) XtParent(wid))->manager.active_child = NULL; if ((etched_in) && ((w->toggle.ind_on) || (!(w->toggle.ind_on) && !(w->toggle.fill_on_select)))) { DrawEtchedInMenu(w); if (w->toggle.ind_on) DrawToggle(w); } XmeClearBorder(XtDisplay (w), XtWindow (w), w->primitive.highlight_thickness, w->primitive.highlight_thickness, w->core.width - 2 * w->primitive.highlight_thickness, w->core.height - 2 * w->primitive.highlight_thickness, w->primitive.shadow_thickness); if (w->toggle.disarm_CB) { XFlush (XtDisplay (w)); ToggleButtonCallback(w, XmCR_DISARM, w->toggle.set, event); } } } else { _XmPrimitiveLeave( (Widget) w, event, params, num_params); ActionDraw(w, event, TRUE); } } /************************************************************************** * * Enter * This procedure is called when the mouse button is pressed and the * cursor reenters the widget's window. This procedure changes the visuals * accordingly. * **************************************************************************/ static void Enter( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget w = (XmToggleButtonWidget) wid ; if (Lab_IsMenupane(w)) { if ((((ShellWidget) XtParent(XtParent(w)))->shell.popped_up) && _XmGetInDragMode((Widget)w)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (w->toggle.Armed) return; /* So KHelp event is delivered correctly */ _XmSetFocusFlag( XtParent(XtParent(w)), XmFOCUS_IGNORE, TRUE); XtSetKeyboardFocus(XtParent(XtParent(w)), (Widget)w); _XmSetFocusFlag( XtParent(XtParent(w)), XmFOCUS_IGNORE, FALSE); ((XmManagerWidget) XtParent(wid))->manager.active_child = wid; w->toggle.Armed = TRUE; if ((etched_in) && ((w->toggle.ind_on) || (!(w->toggle.ind_on) && !(w->toggle.fill_on_select)))) { DrawEtchedInMenu(w); if (w->toggle.ind_on) DrawToggle(w); } XmeDrawShadows (XtDisplay (w), XtWindow (w), w->primitive.top_shadow_GC, w->primitive.bottom_shadow_GC, w->primitive.highlight_thickness, w->primitive.highlight_thickness, w->core.width - 2 * w->primitive.highlight_thickness, w->core.height - 2 * w->primitive.highlight_thickness, w->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (w->toggle.arm_CB) { XFlush (XtDisplay (w)); ToggleButtonCallback(w, XmCR_ARM, w->toggle.set, event); } } } else { _XmPrimitiveEnter( (Widget) w, event, params, num_params); ActionDraw(w, event, FALSE); } } static void NextState( unsigned char *state) { switch(*state) { case XmUNSET: *state = XmSET; break; case XmSET: *state = XmINDETERMINATE; break; case XmINDETERMINATE: *state = XmUNSET; break; } } /**************************************************************************** * * Arm * This function processes button down occuring on the togglebutton. * Mark the togglebutton as armed and display it armed. * The callbacks for XmNarmCallback are called. * ***************************************************************************/ /* ARGSUSED */ static void Arm( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; (void)XmProcessTraversal( (Widget) tb, XmTRAVERSE_CURRENT); if (tb->toggle.toggle_mode == XmTOGGLE_INDETERMINATE) NextState(&tb->toggle.visual_set); else IsOn(tb) = (tb->toggle.set == XmSET)? XmUNSET : XmSET; tb->toggle.Armed = TRUE; if (tb->toggle.ind_on) DrawToggle(tb); else { if (tb->primitive.shadow_thickness > 0) DrawToggleShadow (tb); if (tb->toggle.fill_on_select && !Lab_IsPixmap(tb)) DrawToggleLabel(tb); } if (Lab_IsPixmap(tb) || Lab_IsPixmapAndText(tb)) SetAndDisplayPixmap(tb, event, NULL); if (tb->toggle.arm_CB) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_ARM, tb->toggle.set, event); } } /************************************************************************ * * Select * Mark the togglebutton as unarmed (i.e. inactive). * If the button release occurs inside of the ToggleButton, the * callbacks for XmNvalueChangedCallback are called. * ************************************************************************/ /* ARGSUSED */ static void Select( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; XmToggleButtonCallbackStruct call_value; Boolean hit; XmMenuSystemTrait menuSTrait; Boolean radio = TRUE, always = TRUE; if (tb->toggle.Armed == FALSE) return; tb->toggle.Armed = FALSE; if (XmIsRowColumn(XtParent(tb))) { XtVaGetValues(XtParent(tb), XmNradioBehavior, &radio, XmNradioAlwaysOne, &always, NULL); } /* CR 8068: Verify that this is in fact a button event. */ /* CR 9181: Consider clipping when testing visibility. */ /* Check to see if BtnUp is inside the widget */ hit = ((event->xany.type == ButtonPress || event->xany.type == ButtonRelease) && _XmGetPointVisibility(wid, event->xbutton.x_root, event->xbutton.y_root)); if (hit) { if (tb->toggle.toggle_mode == XmTOGGLE_INDETERMINATE) NextState(&tb->toggle.set); else tb->toggle.set = !tb->toggle.set; } /* CR 7803: Suppress redundant redraws. */ if (tb->toggle.set != tb->toggle.visual_set) { /* Redisplay after changing state. */ XtExposeProc expose; _XmProcessLock(); expose = ((WidgetClass)XtClass(tb))->core_class.expose; _XmProcessUnlock(); (* (expose)) (wid, event, NULL); } if (hit) { /* UNDOING this fix .... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait != NULL) { call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = tb->toggle.set; menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); } if ((! tb->label.skipCallback) && (tb->toggle.value_changed_CB)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, tb->toggle.set, event); } } } /********************************************************************** * * Disarm * The callbacks for XmNdisarmCallback are called.. * ************************************************************************/ /* ARGSUSED */ static void Disarm( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; if (tb->toggle.disarm_CB) ToggleButtonCallback(tb, XmCR_DISARM, tb->toggle.set, event); /* BEGIN OSF Fix pir 2826 */ /* CR 7803: Suppress redundant redraws. */ if (tb->toggle.set != tb->toggle.visual_set) Redisplay((Widget) tb, event, (Region) NULL); /* END OSF Fix pir 2826 */ } static void TB_FixTearoff( XmToggleButtonWidget tb) { if (XmMENU_PULLDOWN == tb->label.menu_type) { Widget mwid = XmGetPostedFromWidget(XtParent(tb)); if (mwid && XmIsRowColumn(mwid) && (XmMENU_OPTION == RC_Type(mwid)) && _XmIsActiveTearOff(XtParent(tb))) XmProcessTraversal((Widget) tb, XmTRAVERSE_CURRENT); } } /************************************************************************ * * ArmAndActivate * This routine arms and activates a ToggleButton. It is called on * Return and a Space, as well as when a mnemonic or * button accelerator has been activated. * ************************************************************************/ /* ARGSUSED */ static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; XmToggleButtonCallbackStruct call_value; Boolean already_armed = tb->toggle.Armed; Boolean is_menupane = Lab_IsMenupane(tb); Boolean torn_has_focus = FALSE; XmMenuSystemTrait menuSTrait; Boolean radio = TRUE, always = TRUE, no_change; if (XmIsRowColumn(XtParent(tb))) { XtVaGetValues(XtParent(tb), XmNradioBehavior, &radio, XmNradioAlwaysOne, &always, NULL); } no_change = False; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (is_menupane && !XmIsMenuShell(XtParent(XtParent(tb)))) { if (XmeFocusIsInShell((Widget)tb)) { /* In case allowAcceleratedInsensitiveUnmanagedMenuItems is True */ if (!XtIsSensitive((Widget)tb) || (!XtIsManaged((Widget)tb))) return; torn_has_focus = TRUE; } } tb->toggle.Armed = FALSE; if (!no_change) /* skip toggle for buttons already turned on */ { if (tb->toggle.toggle_mode == XmTOGGLE_INDETERMINATE) { NextState(&tb->toggle.visual_set); NextState(&tb->toggle.set); } else { tb->toggle.set = (tb->toggle.set == XmSET)? XmUNSET : XmSET; IsOn(tb) = tb->toggle.set; } } if (is_menupane && menuSTrait != NULL) { /* CR 7799: Torn off menus shouldn't be shared, so don't reparent. */ if (torn_has_focus) menuSTrait->popdown(XtParent(tb), event); else menuSTrait->buttonPopdown(XtParent(tb), event); if (torn_has_focus) XmProcessTraversal((Widget) tb, XmTRAVERSE_CURRENT); /* Draw the toggle indicator in case of tear off */ if (tb->toggle.ind_on) DrawToggle(tb); else if (tb->toggle.fill_on_select && !Lab_IsPixmap(tb)) DrawToggleLabel(tb); if (Lab_IsPixmap(tb) || Lab_IsPixmapAndText(tb)) SetAndDisplayPixmap( tb, event, NULL); } else { if (tb->toggle.ind_on) DrawToggle(tb); else { if (tb->primitive.shadow_thickness > 0) DrawToggleShadow (tb); if (tb->toggle.fill_on_select && !Lab_IsPixmap(tb)) DrawToggleLabel (tb); } if (Lab_IsPixmap(tb) || Lab_IsPixmapAndText(tb)) SetAndDisplayPixmap( tb, event, NULL); } /* If the parent is menu system able, set the lastSelectToplevel before * the arm. It's ok if this is recalled later. */ if (menuSTrait != NULL) menuSTrait->getLastSelectToplevel(XtParent(tb)); if (tb->toggle.arm_CB && !already_armed) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_ARM, tb->toggle.set, event); } if (!no_change) { /* UNDOING this fix .... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) { call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = tb->toggle.set; menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); } if ((! tb->label.skipCallback) && (tb->toggle.value_changed_CB)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, tb->toggle.set, event); } } if (tb->toggle.disarm_CB) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_DISARM, tb->toggle.set, event); } if (is_menupane) { if (torn_has_focus && XtIsSensitive(wid)) { tb->toggle.Armed = TRUE; if (tb->toggle.arm_CB) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_ARM, tb->toggle.set, event); } } else if (menuSTrait != NULL) { menuSTrait->reparentToTearOffShell(XtParent(tb), event); TB_FixTearoff(tb); } } } /************************************************************************ * * BtnDown * This function processes a button down occuring on the togglebutton * when it is in a popup, pulldown, or option menu. * Popdown the posted menu. * Turn parent's traversal off. * Mark the togglebutton as armed (i.e. active). * The callbacks for XmNarmCallback are called. * ************************************************************************/ /* ARGSUSED */ static void BtnDown( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; Boolean validButton = False; Boolean already_armed; ShellWidget popup; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait == NULL) return; /* Support menu replay, free server input queue until next button event */ XAllowEvents(XtDisplay(tb), SyncPointer, CurrentTime); already_armed = tb->toggle.Armed; tb->toggle.Armed = TRUE; if (event && (event->type == ButtonPress)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if ((etched_in) && ((tb->toggle.ind_on) || (!(tb->toggle.ind_on) && !(tb->toggle.fill_on_select)))) { DrawEtchedInMenu(tb); if (tb->toggle.ind_on) DrawToggle(tb); } validButton = menuSTrait->verifyButton(XtParent(tb), event); } if (!validButton) return; _XmSetInDragMode((Widget)tb, True); /* Popdown other popups that may be up */ if (!(popup = (ShellWidget)_XmGetRC_PopupPosted(XtParent(tb)))) { if (!XmIsMenuShell(XtParent(XtParent(tb)))) { /* In case tear off not armed and no grabs in place, do it now. * Ok if already armed and grabbed - nothing done. */ menuSTrait->tearOffArm(XtParent(tb)); } } if (popup) { /* Widget w; */ if (popup->shell.popped_up) menuSTrait->popdownEveryone((Widget) popup, event); /* If the active_child is a cascade (highlighted), then unhighlight it.*/ /* * w = ((XmManagerWidget)XtParent(tb))->manager.active_child; * if (w && (XmIsCascadeButton(w) || XmIsCascadeButtonGadget(w))) * XmCascadeButtonHighlight (w, FALSE); */ } /* Set focus to this button. This must follow the possible * unhighlighting of the CascadeButton else it'll screw up active_child. */ (void)XmProcessTraversal( (Widget) tb, XmTRAVERSE_CURRENT); /* get the location cursor - get consistent with Gadgets */ if (tb->toggle.arm_CB && !already_armed) { XFlush (XtDisplay (tb)); ToggleButtonCallback(tb, XmCR_ARM, tb->toggle.set, event); } _XmRecordEvent(event); } /************************************************************************ * * BtnUp * This function processes a button up occuring on the togglebutton * when it is in a popup, pulldown, or option menu. * Mark the togglebutton as unarmed (i.e. inactive). * The callbacks for XmNvalueChangedCallback are called. * The callbacks for XmNdisarmCallback are called. * ************************************************************************/ /* ARGSUSED */ static void BtnUp( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; XmToggleButtonCallbackStruct call_value; Boolean validButton = False; Boolean popped_up; Boolean is_menupane = Lab_IsMenupane(tb); Widget shell = XtParent(XtParent(tb)); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (event && (event->type == ButtonRelease)) validButton = menuSTrait->verifyButton(XtParent(tb), event); if (!validButton || (tb->toggle.Armed == FALSE)) return; tb->toggle.Armed = FALSE; if (is_menupane && !XmIsMenuShell(shell)) popped_up = menuSTrait->popdown((Widget) tb, event); else popped_up = menuSTrait->buttonPopdown((Widget) tb, event); _XmRecordEvent(event); if (popped_up) return; /* Check to see if BtnUp is inside the widget */ /* CR 9181: Consider clipping when testing visibility. */ if ((event->xany.type == ButtonPress || event->xany.type == ButtonRelease) && _XmGetPointVisibility(wid, event->xbutton.x_root, event->xbutton.y_root)) { if (tb->toggle.toggle_mode == XmTOGGLE_INDETERMINATE) { NextState(&tb->toggle.visual_set); NextState(&tb->toggle.set); } else { tb->toggle.set = (tb->toggle.set == XmSET)? XmUNSET : XmSET; IsOn(tb) = tb->toggle.set; } /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) { call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = tb->toggle.set; menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); } if ((! tb->label.skipCallback) && (tb->toggle.value_changed_CB)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, tb->toggle.set, event); } if (tb->toggle.disarm_CB) ToggleButtonCallback(tb, XmCR_DISARM, tb->toggle.set, event); if (is_menupane) { if (!XmIsMenuShell(shell)) { if (XtIsSensitive((Widget)tb)) { tb->toggle.Armed = TRUE; if (tb->toggle.ind_on) DrawToggle(tb); else if (tb->toggle.fill_on_select && !Lab_IsPixmap(tb)) DrawToggleLabel(tb); if (Lab_IsPixmap(tb) || Lab_IsPixmapAndText(tb)) SetAndDisplayPixmap( tb, event, NULL); if (tb->toggle.arm_CB) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_ARM, tb->toggle.set, event); } } } else menuSTrait->reparentToTearOffShell(XtParent(tb), event); } } _XmSetInDragMode((Widget)tb, False); /* For the benefit of tear off menus, we must set the focus item * to this button. In normal menus, this would not be a problem * because the focus is cleared when the menu is unposted. */ if (!XmIsMenuShell(shell)) XmProcessTraversal((Widget) tb, XmTRAVERSE_CURRENT); TB_FixTearoff(tb); } /************************************************************************ * * GetUnselectGC * Get the graphics context to be used to fill the interior of * a square or diamond when unselected. * ************************************************************************/ static void GetUnselectGC( XmToggleButtonWidget tw ) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground | GCFillStyle | GCGraphicsExposures; values.foreground = tw->toggle.unselect_color; values.background = tw->core.background_pixel; values.fill_style = FillSolid; values.graphics_exposures = FALSE; tw->toggle.unselect_GC = XtGetGC((Widget) tw, valueMask, &values); } /************************************************************************ * * GetGC * Get the graphics context to be used to fill the interior of * a square or diamond when selected, and the arm GC used in a * menu if enableEtchedInMenu is True. * ************************************************************************/ static void GetGC( XmToggleButtonWidget tw ) { XGCValues values; XtGCMask valueMask; XFontStruct *fs = (XFontStruct *) NULL; Pixel sel_color, select_pixel; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(tw)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* Differentiate background and select colors on monochrome displays or ** others on which we have indistinguishable colors. */ if ((DefaultDepthOfScreen(XtScreen(tw)) == 1) || (tw->core.background_pixel == tw->toggle.select_color)) sel_color = tw->primitive.foreground; else sel_color = tw->toggle.select_color; valueMask = 0; valueMask |= GCForeground, values.foreground = sel_color; valueMask |= GCBackground, values.background = tw->core.background_pixel; valueMask |= GCFillStyle, values.fill_style = FillSolid; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; tw->toggle.select_GC = XtAllocateGC((Widget)tw, 0, valueMask, &values, 0, 0); /* When foreground and select colors coincide, this GC is used * by XmLabel to draw the text. It requires a font to pacify * the XmString draw functions. */ valueMask = 0; if (XmeRenderTableGetDefaultFont(tw->label.font, &fs)) valueMask |= GCFont, values.font = fs->fid; valueMask |= GCForeground, values.foreground = tw->core.background_pixel; valueMask |= GCBackground, values.background = tw->primitive.foreground; valueMask |= GCFillStyle, values.fill_style = FillSolid; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; valueMask |= GCLineWidth, values.line_width = 1; tw->toggle.background_gc = XtGetGC((Widget) tw, valueMask, &values); valueMask = 0; valueMask |= GCFillStyle, values.fill_style = FillOpaqueStippled; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; valueMask |= GCStipple, values.stipple = XmGetPixmapByDepth(XtScreen((Widget)(tw)), XmS50_foreground, 1, 0, 1); valueMask |= GCLineWidth, values.line_width = 1; tw->toggle.indeterminate_GC = XtAllocateGC((Widget)tw, 0, valueMask, &values, GCForeground | GCBackground, 0); /* The valueMask and values are inherited from above. */ valueMask &= ~GCLineWidth; valueMask |= GCForeground, values.foreground = tw->core.background_pixel; valueMask |= GCBackground, values.background = tw->primitive.foreground; tw->toggle.indeterminate_box_GC = XtGetGC((Widget) tw, valueMask, &values); /* Create the ArmGC for filling in background if we are in a menu and enableEtchedInMenu is True. */ if ((Lab_IsMenupane(tw)) && etched_in) { XmGetColors(XtScreen(tw), tw->core.colormap, tw->core.background_pixel, NULL, NULL, NULL, &select_pixel); valueMask = 0; valueMask |= GCForeground, values.foreground = select_pixel; valueMask |= GCBackground, values.background = tw->primitive.foreground; if (fs != NULL) valueMask |= GCFont, values.font = fs->fid; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; tw->toggle.arm_GC = XtGetGC((Widget) tw, valueMask, &values); } } /*************************************<->************************************* * * Initialize * *************************************<->***********************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmToggleButtonWidget request = (XmToggleButtonWidget) rw ; XmToggleButtonWidget new_w = (XmToggleButtonWidget) nw ; XtWidgetProc resize; new_w->toggle.Armed = FALSE; /* if menuProcs is not set up yet, try again */ _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; if (xmLabelClassRec.label_class.menuProcs == (XmMenuProc)NULL) xmLabelClassRec.label_class.menuProcs = (XmMenuProc)_XmGetMenuProcContext(); _XmProcessUnlock(); if (Lab_IsMenupane(new_w)) { /* If the shadow thickness hasn't been set yet, inherit it from the menu parent, instead of a hard-coded 2, as before. The only draw back is that is the parent has also 0, then the toggle shadow is 0, which is not very good in a menu, but at least consistent with the other buttons */ if (new_w->primitive.shadow_thickness <= 0) { Dimension parent_st ; XtVaGetValues(XtParent(nw), XmNshadowThickness, &parent_st, NULL); new_w->primitive.shadow_thickness = parent_st; } if (new_w->toggle.visible == XmINVALID_BOOLEAN) new_w->toggle.visible = FALSE; new_w->primitive.traversal_on = TRUE; } else if (new_w->toggle.visible == XmINVALID_BOOLEAN) new_w->toggle.visible = TRUE; /* * If the indicatorType has not been set, then * find out if radio behavior is set for RowColumn parents and * then set indicatorType. If radio behavior is true, default to * one of many, else default to n of many. */ if ((new_w->toggle.ind_type == XmINVALID_TYPE) || !XmRepTypeValidValue (XmRID_INDICATOR_TYPE, new_w->toggle.ind_type, (Widget) new_w)) { Boolean radio = FALSE; if (XmIsRowColumn(XtParent(new_w))) { XtVaGetValues(XtParent(new_w), XmNradioBehavior, &radio, NULL); } if (radio) new_w->toggle.ind_type = XmONE_OF_MANY; else new_w->toggle.ind_type = XmN_OF_MANY; } /* * This resource defaults to true if an indicator box is drawn. */ if (new_w->toggle.fill_on_select == XmINVALID_BOOLEAN) { if (DRAWBOX(NormalizeIndOn(new_w))) new_w->toggle.fill_on_select = True; else if (IsOneOfMany(new_w->toggle.ind_type) && new_w->toggle.ind_on) new_w->toggle.fill_on_select = True; else new_w->toggle.fill_on_select = False; } /* Tristate buttons ain't allowed in one-of-many land. */ if (IsOneOfMany(new_w->toggle.ind_type)) new_w->toggle.toggle_mode = XmTOGGLE_BOOLEAN; /* If necessary use the On pixmaps in place of the Indeterminate ones. */ if (IsNull(PixmapInd(new_w)) && !IsNull(PixmapOn(new_w))) PixmapInd(new_w) = PixmapOn(new_w); if (IsNull(PixmapInsenInd(new_w)) && !IsNull(PixmapInsenOn(new_w))) PixmapInsenInd(new_w) = PixmapInsenOn(new_w); /* If necessary use PixmapOn in place of PixmapOff. */ if (IsNull(PixmapOff(new_w)) && !IsNull(PixmapOn(new_w))) { PixmapOff(new_w) = PixmapOn(new_w); if (request->core.width == 0) new_w->core.width = 0; if (request->core.height == 0) new_w->core.height = 0; _XmCalcLabelDimensions((Widget) new_w); (* resize)( (Widget) new_w); } /* If necessary use PixmapInsenOn in place of PixmapInsenOff. */ if (IsNull(PixmapInsenOff(new_w)) && !IsNull(PixmapInsenOn(new_w))) { PixmapInsenOff(new_w) = PixmapInsenOn(new_w); if (request->core.width == 0) new_w->core.width = 0; if (request->core.height == 0) new_w->core.height = 0; _XmCalcLabelDimensions((Widget) new_w); (* resize)( (Widget) new_w); } /* BEGIN OSF Fix pir 1778 */ if (Lab_IsPixmap(new_w) && (!IsNull(PixmapOff(new_w)) || !IsNull(PixmapInsenOff(new_w)) || !IsNull(PixmapOn(new_w)) || !IsNull(PixmapInsenOn(new_w)) || !IsNull(PixmapInd(new_w)) || !IsNull(PixmapInsenInd(new_w)))) { if (request->core.width == 0) new_w->core.width = 0; if (request->core.height == 0) new_w->core.height = 0; SetToggleSize(new_w); } /* END OSF Fix pir 1778 */ if (new_w->toggle.indicator_dim == XmINVALID_DIMENSION) { if (new_w->toggle.ind_on) { /* Determine how high the toggle indicator should be. */ if (Lab_IsPixmap(new_w) || Lab_IsPixmapAndText(new_w)) { /* Set indicator size proportional to size of pixmap. */ if ( !IsNull(PixmapOn(new_w)) || !IsNull(PixmapInsenOn(new_w)) || !IsNull(PixmapOff(new_w)) || !IsNull(PixmapInsenOff(new_w)) || !IsNull(PixmapInd(new_w)) || !IsNull(PixmapInsenInd(new_w))) if (new_w->label.TextRect.height < 13) new_w->toggle.indicator_dim = new_w->label.TextRect.height; else new_w->toggle.indicator_dim = 13 + (new_w->label.TextRect.height/13); else new_w->toggle.indicator_dim = XmDEFAULT_INDICATOR_DIM; } else { /* Set indicator size proportional to size of font. */ Dimension height; int line_count; height = XmStringHeight (new_w->label.font, new_w->label._label); if ((line_count = XmStringLineCount (new_w->label._label)) < 1) line_count = 1; /* Shiz recommends toggles in menus have smaller indicators */ if (Lab_IsMenupane(new_w)) new_w->toggle.indicator_dim = MAX(XmDEFAULT_INDICATOR_DIM, (height / ((Dimension)line_count))*2/3); else new_w->toggle.indicator_dim = MAX(XmDEFAULT_INDICATOR_DIM, height / ((Dimension)line_count)); } } else { new_w->toggle.indicator_dim = 0; } new_w->toggle.indicator_set = FALSE; } else { new_w->toggle.indicator_set = TRUE; } /* CR 2337: Maintain original margin values. */ new_w->toggle.ind_left_delta = 0; new_w->toggle.ind_right_delta = 0; new_w->toggle.ind_top_delta = 0; new_w->toggle.ind_bottom_delta = 0; if (new_w->toggle.ind_on) { /* * Enlarge the text rectangle if needed to accomodate the size of * indicator button. Adjust the dimensions of superclass Label-Gadget * so that the toggle-button may be accommodated in it. */ int maxIndicatorSize; int delta; int boxSize; /* BEGIN OSF Fix pir 2480 */ if (! Lab_IsMenupane(new_w)) maxIndicatorSize = new_w->toggle.indicator_dim + 2*Xm3D_ENHANCE_PIXEL; else maxIndicatorSize = new_w->toggle.indicator_dim; /* END OSF Fix pir 2480 */ boxSize = ((int) new_w->label.TextRect.height + (int) new_w->label.margin_top + (int) new_w->label.margin_bottom); if (maxIndicatorSize > boxSize) { delta = (maxIndicatorSize - boxSize) / 2; new_w->toggle.ind_top_delta = delta; new_w->label.margin_top += new_w->toggle.ind_top_delta; new_w->toggle.ind_bottom_delta = delta; new_w->label.margin_bottom += new_w->toggle.ind_bottom_delta; } /* CR 2337: Make room for toggle indicator and spacing */ if (LayoutIsRtoLP(new_w)) { delta = (new_w->toggle.indicator_dim + new_w->toggle.spacing - new_w->label.margin_right); if (delta > 0) { new_w->toggle.ind_right_delta = delta; new_w->label.margin_right += delta; } } else { delta = (new_w->toggle.indicator_dim + new_w->toggle.spacing - new_w->label.margin_left); if (delta > 0) { new_w->toggle.ind_left_delta = delta; new_w->label.margin_left += delta; } } } if (request->core.width == 0) { new_w->core.width = new_w->label.TextRect.width + 2 * new_w->label.margin_width + new_w->label.margin_right + new_w->label.margin_left + 2 * (new_w->primitive.highlight_thickness + new_w->primitive.shadow_thickness); if (new_w->core.width == 0) new_w->core.width = 1; if ((new_w->label._acc_text != NULL) && (new_w->toggle.ind_on)) { if (LayoutIsRtoLP(new_w)) { new_w->label.acc_TextRect.x = new_w->primitive.highlight_thickness + new_w->primitive.shadow_thickness + new_w->label.margin_width; } else { new_w->label.acc_TextRect.x = new_w->core.width - new_w->primitive.highlight_thickness - new_w->primitive.shadow_thickness - new_w->label.margin_width - new_w->label.margin_right + LABEL_ACC_PAD; } } } if (request->core.height == 0) new_w->core.height = MAX(new_w->toggle.indicator_dim, new_w->label.TextRect.height + 2 * new_w->label.margin_height + new_w->label.margin_top + new_w->label.margin_bottom) + 2 * (new_w->primitive.highlight_thickness + new_w->primitive.shadow_thickness); new_w->label.TextRect.y = (short) new_w->primitive.highlight_thickness + new_w->primitive.shadow_thickness + new_w->label.margin_height + new_w->label.margin_top + ((new_w->core.height - new_w->label.margin_top - new_w->label.margin_bottom - (2 * (new_w->label.margin_height + new_w->primitive.highlight_thickness + new_w->primitive.shadow_thickness)) - new_w->label.TextRect.height) / 2); if (new_w->core.height == 0) new_w->core.height = 1; new_w->toggle.visual_set = new_w->toggle.set; /* Display as set if XmNset is TRUE when the toggle first comes up. */ if (XmSET == new_w->toggle.set) IsOn(new_w) = XmSET; else IsOn(new_w) = XmUNSET; { XtWidgetProc resize; _XmProcessLock(); resize = new_w->core.widget_class->core_class.resize; _XmProcessUnlock(); (* (resize)) ((Widget) new_w); } /* unselect same as background unless set. */ if (new_w->toggle.unselect_color == XmINVALID_PIXEL) new_w->toggle.unselect_color = new_w->core.background_pixel; /* Deal with selectColor */ new_w->toggle.reversed_select = (new_w->toggle.select_color == XmREVERSED_GROUND_COLORS); if (new_w->toggle.select_color == XmDEFAULT_SELECT_COLOR) { /* CR 9923: Copy all bytes of the resulting pixel. */ XrmValue value; _XmSelectColorDefault((Widget)new_w, XtOffsetOf(XmToggleButtonRec, toggle.select_color), &value); assert(value.size == sizeof(Pixel)); new_w->toggle.select_color = *((Pixel*) value.addr); } else if (new_w->toggle.select_color == XmREVERSED_GROUND_COLORS) { new_w->toggle.select_color = new_w->primitive.foreground; } else if (new_w->toggle.select_color == XmHIGHLIGHT_COLOR) { new_w->toggle.select_color = new_w->primitive.highlight_color; } GetGC (new_w); GetUnselectGC(new_w); } /************************************************************************ * * Destroy * Free toggleButton's graphic context. * ************************************************************************/ static void Destroy( Widget wid ) { XmToggleButtonWidget tw = (XmToggleButtonWidget) wid ; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; XtReleaseGC ((Widget) tw, tw->toggle.select_GC); XtReleaseGC ((Widget) tw, tw->toggle.background_gc); XtReleaseGC ((Widget) tw, tw->toggle.unselect_GC); XtReleaseGC ((Widget) tw, tw->toggle.indeterminate_GC); XtReleaseGC ((Widget) tw, tw->toggle.indeterminate_box_GC); if (Lab_IsMenupane(tw) && etched_in) XtReleaseGC ((Widget) tw, tw->toggle.arm_GC); } static void DrawBox(XmToggleButtonWidget w, GC top_gc, GC bot_gc, GC fillgc, int x, int y, int edge, Dimension margin) { int shadow = w->toggle.detail_shadow_thickness; XmeDrawShadows(XtDisplay ((Widget) w), XtWindow ((Widget) w), top_gc, bot_gc, x, y, edge, edge, shadow, XmSHADOW_OUT); /* Don't fill the background on mono screens if we're going to */ /* draw a glyph */ if ((DefaultDepthOfScreen(XtScreen(w)) == 1) && DRAWGLYPH(NormalizeIndOn(w))) return; shadow += margin; if (edge > (shadow * 2)) XFillRectangle (XtDisplay ((Widget) w), XtWindow ((Widget) w), fillgc, x + shadow, y + shadow, edge - (shadow * 2), edge - (shadow * 2)); } /*************************************<->************************************* * * DrawToggle(w) * Depending on the state of this widget, draw the Toggle. * That is draw the True/False indicator next to the label. * *************************************<->***********************************/ static void DrawToggle (XmToggleButtonWidget w ) { int x, y, edge; Dimension margin; XGCValues values; Display *dpy = XtDisplay((Widget) w); Drawable drawable = XtWindow((Widget) w); XmDisplay dpyxm = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean etched_in = dpyxm->display.enable_etched_in_menu; /* Get size of indicator i.e. bounding box */ if (Lab_IsPixmap(w) || XmStringEmpty(w->label._label)) edge = w->toggle.indicator_dim; else edge = MIN((int)w->toggle.indicator_dim, MAX(0, ((int)w->core.height - 2*(w->primitive.highlight_thickness + w->primitive.shadow_thickness + (int)w->label.margin_height) + w->label.margin_top + w->label.margin_bottom))); /* Touch up the appearance of filled background. */ if ((DefaultDepthOfScreen(XtScreen(w)) > 1) && (w->primitive.top_shadow_color != w->toggle.select_color) && (w->primitive.bottom_shadow_color != w->toggle.select_color)) margin = 0; else margin = 1; if (LayoutIsRtoLP(w)) x = (int)w->core.width - w->primitive.highlight_thickness - w->primitive.shadow_thickness - w->label.margin_width - w->toggle.indicator_dim; else x = w->primitive.highlight_thickness + w->primitive.shadow_thickness + w->label.margin_width; if (Lab_IsPixmap(w) || XmStringEmpty(w->label._label)) y = (int)((w->core.height - w->toggle.indicator_dim))/2; else { /* Center indicator vertically next to the first line of text. */ int fudge = Xm3D_ENHANCE_PIXEL; Dimension text_height; int line_count, height_diff; text_height = XmStringHeight(w->label.font, w->label._label); if ((line_count = XmStringLineCount(w->label._label)) < 1) line_count = 1; height_diff = ((int)text_height / line_count) - (int)w->toggle.indicator_dim; if (height_diff < 0) height_diff = 0; y = w->label.TextRect.y + (height_diff / 2); /* CR 2337: Keep large indicators inside the toggle. */ /* Is this definition of fudge right??? */ if (w->toggle.ind_top_delta > fudge) y -= (w->toggle.ind_top_delta - fudge); } if (w->toggle.visible || (w->toggle.visual_set != XmUNSET)) { /* The toggle indicator should be visible. */ GC top_gc, bot_gc, fill_gc, glyph_gc; unsigned char normal_ind_on = NormalizeIndOn(w); switch (w->toggle.visual_set) { case XmUNSET: top_gc = w->primitive.top_shadow_GC; bot_gc = w->primitive.bottom_shadow_GC; /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ if (Lab_IsMenupane(w) && etched_in && w->toggle.Armed) fill_gc = (w->toggle.fill_on_select ? w->toggle.unselect_GC : w->toggle.arm_GC); else fill_gc = (w->toggle.fill_on_select ? w->toggle.unselect_GC : w->toggle.background_gc); glyph_gc = None; break; case XmSET: top_gc = w->primitive.bottom_shadow_GC; bot_gc = w->primitive.top_shadow_GC; /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ if (Lab_IsMenupane(w) && etched_in && w->toggle.Armed) fill_gc = (w->toggle.fill_on_select ? w->toggle.select_GC : w->toggle.arm_GC); else fill_gc = (w->toggle.fill_on_select ? w->toggle.select_GC : w->toggle.background_gc); glyph_gc = ((w->toggle.reversed_select && DRAWBOX(normal_ind_on)) ? w->toggle.background_gc : w->label.normal_GC); /* CR 9791: Label's normal_gc has a dynamic clip_mask. */ if (glyph_gc == w->label.normal_GC) XSetClipMask(dpy, glyph_gc, None); break; case XmINDETERMINATE: top_gc = bot_gc = w->toggle.indeterminate_box_GC; /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ if (Lab_IsMenupane(w) && etched_in && w->toggle.Armed) fill_gc = (w->toggle.fill_on_select ? w->toggle.indeterminate_GC : w->toggle.arm_GC); else fill_gc = (w->toggle.fill_on_select ? w->toggle.indeterminate_GC : w->toggle.background_gc); glyph_gc = w->toggle.indeterminate_GC; break; default: assert(False); return; } switch (NormalizeIndType(w)) { case XmN_OF_MANY: { /* If the toggle indicator is square shaped then adjust the * indicator width and height, so that it looks proportional * to a diamond shaped indicator of the same width and height */ int new_edge; Dimension box_margin = (DRAWBOX(normal_ind_on) ? w->toggle.detail_shadow_thickness : 0); /* Subtract 3 pixels + 10% from the width and height. */ new_edge = edge - 3 - ((edge - 10)/10); /* Adjust x,y to center the indicator relative to the label */ y = y + ((edge - new_edge) / 2); x = x + ((edge - new_edge) / 2); edge = new_edge; switch(w->toggle.visual_set) { case XmUNSET: if (DRAW3DBOX(normal_ind_on)) DrawBox(w, top_gc, bot_gc, fill_gc, x, y, edge, margin); else if (DRAWFLATBOX(normal_ind_on)) DrawBox(w, bot_gc, bot_gc, fill_gc, x, y, edge, margin); else if (edge > 0) XFillRectangle(dpy, drawable, fill_gc, x, y, edge, edge); break; case XmSET: if (DRAW3DBOX(normal_ind_on)) DrawBox(w, top_gc, bot_gc, fill_gc, x, y, edge, margin); else if (DRAWFLATBOX(normal_ind_on)) DrawBox(w, top_gc, top_gc, fill_gc, x, y, edge, margin); else if (edge > 0) XFillRectangle(dpy, drawable, fill_gc, x, y, edge, edge); if (!DRAWBOX(normal_ind_on) || ((edge - 2 * box_margin) >= MIN_GLYPH_SIZE)) { if (DRAWCHECK(normal_ind_on)) XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); else if (DRAWCROSS(normal_ind_on)) XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); } break; case XmINDETERMINATE: if (w->toggle.fill_on_select) { /* Fetch the select_color GetGC() actually used. */ XGetGCValues(dpy, w->toggle.select_GC, GCForeground, &values); values.background = values.foreground; values.foreground = w->toggle.unselect_color; XChangeGC(dpy, fill_gc, GCForeground|GCBackground, &values); } else if (DRAWBOX(normal_ind_on)) { /* This GC should have the right values already. */ fill_gc = w->toggle.indeterminate_box_GC; } if (DRAWBOX(normal_ind_on)) DrawBox(w, bot_gc, bot_gc, fill_gc, x, y, edge, margin); else if (edge > 0) XFillRectangle(dpy, drawable, fill_gc, x, y, edge, edge); if (w->toggle.reversed_select) { values.foreground = w->core.background_pixel; values.background = w->primitive.foreground; } else { values.foreground = w->primitive.foreground; values.background = w->core.background_pixel; } if (!DRAWBOX(normal_ind_on) || ((edge - 2 * box_margin) >= MIN_GLYPH_SIZE)) { if (DRAWCHECK(normal_ind_on)) { XChangeGC(dpy, glyph_gc, GCForeground|GCBackground, &values); XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); } else if (DRAWCROSS(normal_ind_on)) { XChangeGC(dpy, glyph_gc, GCForeground|GCBackground, &values); XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); } } break; } break; } case XmONE_OF_MANY: /* This value should have been normalized away! */ assert(FALSE); case XmONE_OF_MANY_DIAMOND: XmeDrawDiamond(dpy, drawable, top_gc, bot_gc, fill_gc, x, y, edge,edge, w->toggle.detail_shadow_thickness, margin); break; case XmONE_OF_MANY_ROUND: #ifdef FIX_1402 XmeDrawCircle(dpy, drawable, top_gc, bot_gc, fill_gc, x, y, edge, edge, w->toggle.detail_shadow_thickness, margin); #else XmeDrawCircle(dpy, drawable, top_gc, bot_gc, fill_gc, x, y, edge, edge, w->toggle.detail_shadow_thickness, 1); #endif break; } } else { /* The toggle indicator should be invisible. */ if (edge > 0) { /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ if (Lab_IsMenupane(w) && etched_in && w->toggle.Armed) XFillRectangle(dpy, drawable, w->toggle.arm_GC, x, y, edge + 4, edge + 2); else XFillRectangle(dpy, drawable, w->toggle.background_gc, x, y, edge + 4, edge + 2); } } } /*************************************<->************************************* * * BorderHighlight * *************************************<->***********************************/ static void BorderHighlight( Widget wid ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; XEvent * event = NULL; if (Lab_IsMenupane(tb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; Boolean already_armed = tb->toggle.Armed; tb->toggle.Armed = True; if ((etched_in) && ((tb->toggle.ind_on) || (!(tb->toggle.ind_on) && !(tb->toggle.fill_on_select)))) { DrawEtchedInMenu(tb); if (tb->toggle.ind_on) DrawToggle(tb); } XmeDrawShadows (XtDisplay (tb), XtWindow (tb), tb->primitive.top_shadow_GC, tb->primitive.bottom_shadow_GC, tb->primitive.highlight_thickness, tb->primitive.highlight_thickness, tb->core.width - 2 * tb->primitive.highlight_thickness, tb->core.height - 2 * tb->primitive.highlight_thickness, tb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (!already_armed && tb->toggle.arm_CB) { XFlush (XtDisplay (tb)); ToggleButtonCallback(tb, XmCR_ARM, tb->toggle.set, event); } } else { (*(xmLabelClassRec.primitive_class.border_highlight))((Widget) tb) ; } } /*************************************<->************************************* * * BorderUnhighlight * *************************************<->***********************************/ static void BorderUnhighlight( Widget wid ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; XEvent * event = NULL; if (Lab_IsMenupane(tb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; Boolean already_armed = tb->toggle.Armed; tb -> toggle.Armed = FALSE; if ((etched_in) && ((tb->toggle.ind_on) || (!(tb->toggle.ind_on) && !(tb->toggle.fill_on_select)))) { DrawEtchedInMenu(tb); if (tb->toggle.ind_on) DrawToggle(tb); } XmeClearBorder (XtDisplay (tb), XtWindow (tb), tb->primitive.highlight_thickness, tb->primitive.highlight_thickness, tb->core.width - 2 * tb->primitive.highlight_thickness, tb->core.height - 2 * tb->primitive.highlight_thickness, tb->primitive.shadow_thickness); if (tb->toggle.Armed && tb->toggle.disarm_CB) { XFlush (XtDisplay (tb)); ToggleButtonCallback(tb, XmCR_DISARM, tb->toggle.set, event); } } else { (*(xmLabelClassRec.primitive_class.border_unhighlight))((Widget) tb) ; } } /* spb This action does not seem to be used anywhere */ /* Tue Apr 27 17:31:48 1993 */ /*************************************<->************************************* * * KeySelect * If the menu system traversal is enabled, do an activate and disarm * *************************************<->***********************************/ /* ARGSUSED */ static void KeySelect( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmToggleButtonWidget tb = (XmToggleButtonWidget) wid ; XmToggleButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (!_XmIsEventUnique(event)) return; if (!_XmGetInDragMode((Widget)tb)) { if (tb->toggle.ind_on) DrawToggle(tb); else if (tb->toggle.fill_on_select && !Lab_IsPixmap(tb)) DrawToggleLabel(tb); if (Lab_IsPixmap(tb) || Lab_IsPixmapAndText(tb)) SetAndDisplayPixmap( tb, event, NULL); tb->toggle.Armed = FALSE; tb->toggle.set = (tb->toggle.set == TRUE) ? FALSE : TRUE; if (menuSTrait != NULL) menuSTrait->buttonPopdown(XtParent(tb), event); _XmRecordEvent(event); /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ /* If the parent is menu system able, notify it about the select. */ if (menuSTrait != NULL) { call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = tb->toggle.set; menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); } if (menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(tb), event); if ((! tb->label.skipCallback) && (tb->toggle.value_changed_CB)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, tb->toggle.set, event); } } } /************************************************************************ * * Compute Space * ***********************************************************************/ static void ComputeSpace( XmToggleButtonWidget tb ) { int needed_width; int needed_height; /* Compute space for drawing toggle. */ needed_width = tb->label.TextRect.width + tb->label.margin_left + tb->label.margin_right + (2 * (tb->primitive.shadow_thickness + tb->primitive.highlight_thickness + tb->label.margin_width)); needed_height = tb->label.TextRect.height + tb->label.margin_top + tb->label.margin_bottom + (2 * (tb->primitive.shadow_thickness + tb->primitive.highlight_thickness + tb->label.margin_height)); if (needed_height > tb->core.height) if (tb->toggle.ind_on) tb->label.TextRect.y = tb->primitive.shadow_thickness + tb->primitive.highlight_thickness + tb->label.margin_height + tb->label.margin_top + ((tb->core.height - tb->label.margin_top - tb->label.margin_bottom - (2 * (tb->label.margin_height + tb->primitive.highlight_thickness + tb->primitive.shadow_thickness)) - tb->label.TextRect.height) / 2); if (LayoutIsRtoLP(tb)) { if ((needed_width > tb->core.width) || ((tb->label.alignment == XmALIGNMENT_BEGINNING) && (needed_width < tb->core.width)) || ((tb->label.alignment == XmALIGNMENT_CENTER) && (needed_width < tb->core.width) && (tb->core.width - needed_width < tb->label.margin_right)) || (needed_width == tb->core.width)) { if (tb->toggle.ind_on) tb->label.TextRect.x = tb->core.width - (tb->primitive.shadow_thickness + tb->primitive.highlight_thickness + tb->label.margin_width + tb->label.margin_right + tb->label.TextRect.width); } } else { if ((needed_width > tb->core.width) || ((tb->label.alignment == XmALIGNMENT_BEGINNING) && (needed_width < tb->core.width)) || ((tb->label.alignment == XmALIGNMENT_CENTER) && (needed_width < tb->core.width) && (tb->core.width - needed_width < tb->label.margin_left)) || (needed_width == tb->core.width)) { if (tb->toggle.ind_on) tb->label.TextRect.x = tb->primitive.shadow_thickness + tb->primitive.highlight_thickness + tb->label.margin_width + tb->label.margin_left; } } } /*************************************<->************************************* * * Redisplay (w, event, region) * Cause the widget, identified by w, to be redisplayed. * *************************************<->***********************************/ /*ARGUSED*/ static void Redisplay( Widget w, XEvent *event, Region region ) { register XmToggleButtonWidget tb = (XmToggleButtonWidget) w; if (! XtIsRealized(w) ) return; /* Fix CR #4884, D. Rand 6/4/92 */ ComputeSpace (tb); if (Lab_IsPixmap(tb) || Lab_IsPixmapAndText(tb)) SetAndDisplayPixmap(tb, event, region); else if (!tb->toggle.ind_on && tb->toggle.fill_on_select) DrawToggleLabel (tb); else { XtExposeProc expose; _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (* expose) (w, event, region); } if (tb->toggle.ind_on) { if (!(tb->toggle.Armed)) IsOn(tb) = tb->toggle.set; DrawToggle(tb); } if (Lab_IsMenupane(tb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean etched_in = dpy -> display.enable_etched_in_menu; if ((tb->toggle.Armed) && (tb->primitive.shadow_thickness > 0)) XmeDrawShadows (XtDisplay (tb), XtWindow (tb), tb->primitive.top_shadow_GC, tb->primitive.bottom_shadow_GC, tb ->primitive.highlight_thickness, tb ->primitive.highlight_thickness, (int)tb->core.width-2*tb->primitive.highlight_thickness, (int)tb->core.height-2*tb->primitive.highlight_thickness, tb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } else { DrawToggleShadow (tb); } } /************************************************************************** * * Resize(w, event) * **************************************************************************/ static void Resize( Widget w ) { register XmToggleButtonWidget tb = (XmToggleButtonWidget) w; /* BEGIN OSF Fix pir 1778 */ if (Lab_IsPixmap(w)) SetToggleSize(tb); else { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize)( (Widget) tb); } /* END OSF Fix pir 1778 */ } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPrehook( Widget cw, /* unused */ Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmToggleButtonWidget new_w = (XmToggleButtonWidget) nw ; /* CR 2990: Use XmNbuttonFontList as the default font. */ if (new_w->label.font == NULL) new_w->label.font = XmeGetDefaultRenderTable (nw, XmBUTTON_FONTLIST); return False; } /*************************************************************************** * * SetValues(current, request, new_w) * This is the set values procedure for the ToggleButton class. It is * called last (the set values rtnes for its superclasses are called * first). * *************************************<->***********************************/ /* ARGSUSED */ static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args ) { XmToggleButtonWidget curcbox = (XmToggleButtonWidget) current; XmToggleButtonWidget reqcbox = (XmToggleButtonWidget) request; XmToggleButtonWidget newcbox = (XmToggleButtonWidget) new_w; Boolean flag = FALSE; /* our return value */ XtWidgetProc resize; /* CR 2337: Preserve the user's margins. */ if (curcbox->label.margin_right != reqcbox->label.margin_right) newcbox->toggle.ind_right_delta = 0; if (curcbox->label.margin_left != reqcbox->label.margin_left) newcbox->toggle.ind_left_delta = 0; if (curcbox->label.margin_top != reqcbox->label.margin_top) newcbox->toggle.ind_top_delta = 0; if (curcbox->label.margin_bottom != reqcbox->label.margin_bottom) newcbox->toggle.ind_bottom_delta = 0; /********************************************************************** * Calculate the window size: The assumption here is that if * the width and height are the same in the new and current instance * record that those fields were not changed with set values. Therefore * its okay to recompute the necessary width and height. However, if * the new and current do have different width/heights then leave them * alone because that's what the user wants. *********************************************************************/ _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); /* Use the On pixmaps if no Indeterminate pixmaps are found. */ if (IsNull(PixmapInd(newcbox)) && !IsNull(PixmapOn(newcbox))) PixmapInd(newcbox) = PixmapOn(newcbox); if (IsNull(PixmapInsenInd(newcbox)) && !IsNull(PixmapInsenOn(newcbox))) PixmapInsenInd(newcbox) = PixmapInsenOn(newcbox); /* Use the On pixmap if no Off pixmap is found. */ if (IsNull(PixmapOff(newcbox)) && !IsNull(PixmapOn(newcbox))) { PixmapOff(newcbox) = PixmapOn(newcbox); if ((newcbox->label.recompute_size) && (request->core.width == current->core.width)) new_w->core.width = 0; if ((newcbox->label.recompute_size) && (request->core.height == current->core.height)) new_w->core.height = 0; _XmCalcLabelDimensions(new_w); (* resize)( (Widget) new_w); } /* Use the insensitive On pixmap if no insensitive Off pixmap is found. */ if (IsNull(PixmapInsenOff(newcbox)) && !IsNull(PixmapInsenOn(newcbox))) { PixmapInsenOff(newcbox) = PixmapInsenOn(newcbox); if ((newcbox->label.recompute_size) && (request->core.width == current->core.width)) new_w->core.width = 0; if ((newcbox->label.recompute_size) && (request->core.height == current->core.height)) new_w->core.height = 0; _XmCalcLabelDimensions(new_w); (* resize)( (Widget) new_w); } /* BEGIN OSF Fix pir 1778 */ /* Have to reset the TextRect width because label's resize will have * mucked with it. */ if (Lab_IsPixmap(newcbox) && (!IsNull(PixmapOff(newcbox)) || !IsNull(PixmapInsenOff(newcbox)) || !IsNull(PixmapOn(newcbox)) || !IsNull(PixmapInsenOn(newcbox)) || !IsNull(PixmapInd(newcbox)) || !IsNull(PixmapInsenInd(newcbox)))) { if ((newcbox->label.recompute_size)) { if (request->core.width == current->core.width) new_w->core.width = 0; if (request->core.height == current->core.height) new_w->core.height = 0; } SetToggleSize(newcbox); } /* END OSF Fix pir 1778 */ /* CR 9922: Changing fillOnSelect requires a redraw. */ if (newcbox->toggle.fill_on_select != curcbox->toggle.fill_on_select) { flag = TRUE; } if ((newcbox->label._label != curcbox->label._label) || (PixmapOff(newcbox) != PixmapOff(curcbox)) || (newcbox->label.font != curcbox->label.font) || (newcbox->toggle.spacing != curcbox->toggle.spacing) || (PixmapOn(newcbox) != PixmapOn(curcbox)) || (PixmapInsenOn(newcbox) != PixmapInsenOn(curcbox)) || (PixmapInd(newcbox) != PixmapInd(curcbox)) || (PixmapInsenInd(newcbox) != PixmapInsenInd(curcbox)) || (newcbox->toggle.ind_on != curcbox->toggle.ind_on) || (newcbox->toggle.indicator_dim != curcbox->toggle.indicator_dim) || (Lab_IsPixmap(newcbox) != Lab_IsPixmap(curcbox)) || (Lab_IsPixmapAndText(newcbox) != Lab_IsPixmapAndText(curcbox))) { int right_delta = 0; /* Our desired margin adjustments. */ int left_delta = 0; int top_delta = 0; int bottom_delta = 0; if (newcbox->label.recompute_size) { if (request->core.width == current->core.width) new_w->core.width = 0; if (request->core.height == current->core.height) new_w->core.height = 0; } if (Lab_IsPixmap(newcbox) && ((PixmapOn(newcbox) != PixmapOn(curcbox)) || (PixmapInsenOn(newcbox) != PixmapInsenOn(curcbox)) || (PixmapInd(newcbox) != PixmapInd(curcbox)) || (PixmapInsenInd(newcbox) != PixmapInsenInd(curcbox))) ) { _XmCalcLabelDimensions(new_w); /* OSF Fix pir 1778 */ SetToggleSize(newcbox); } newcbox->toggle.indicator_set = curcbox->toggle.indicator_set; if (newcbox->toggle.indicator_dim != curcbox->toggle.indicator_dim) { newcbox->toggle.indicator_set = TRUE; } /* CR 8415: Honor explicit requests for XmNindicatorSize. */ if (!(newcbox->toggle.indicator_set) && (newcbox->toggle.indicator_dim == curcbox->toggle.indicator_dim)) { if ((Lab_IsPixmap(newcbox) != Lab_IsPixmap(curcbox)) || (Lab_IsPixmapAndText(newcbox) != Lab_IsPixmapAndText(curcbox)) || (newcbox->label._label != curcbox->label._label) || (PixmapOff(newcbox) != PixmapOff(curcbox)) || (newcbox->label.font != curcbox->label.font) || (newcbox->toggle.ind_on != curcbox->toggle.ind_on)) { if (Lab_IsPixmap(new_w) || Lab_IsPixmapAndText(new_w)) { if (!IsNull(PixmapOff(newcbox)) || !IsNull(PixmapInsenOff(newcbox)) || !IsNull(PixmapOn(newcbox)) || !IsNull(PixmapInsenOn(newcbox)) || !IsNull(PixmapInd(newcbox)) || !IsNull(PixmapInsenInd(newcbox))) if (newcbox->label.TextRect.height < 13) newcbox->toggle.indicator_dim = newcbox->label.TextRect.height; else newcbox->toggle.indicator_dim = 13 + (newcbox->label.TextRect.height/13); else newcbox->toggle.indicator_dim = XmDEFAULT_INDICATOR_DIM; } else { Dimension height; int line_count; height = XmStringHeight (newcbox->label.font, newcbox->label._label); line_count = XmStringLineCount (newcbox->label._label); /* * CR 5203 - Make the calculation for the * indicator_dim be the same as in the Initialize * procedure, i.e. Popup and Pulldown menus should * have smaller indicators. */ if (line_count < 1) line_count = 1; if (Lab_IsMenupane(newcbox)) newcbox->toggle.indicator_dim = MAX(XmDEFAULT_INDICATOR_DIM, (height / ((Dimension)line_count)) * 2/3); else newcbox->toggle.indicator_dim = MAX(XmDEFAULT_INDICATOR_DIM, height / ((Dimension)line_count)); /* End 5203 Fix */ } } } if (newcbox->toggle.ind_on) { /* * Fix CR 5568 - If the indicator is on and the user has changed the * indicator dimension, calculate the new top and bottom * margins in a place where they can effect the core width * and height. */ /* Recompute the Top and bottom margins and the height of the text * rectangle to accommodate the size of toggle indicator. * if (we are given a new toggleIndicator size) * { if (user has given new top or bottom margin) * { compute to accomodate new toggle button size; } * else (user has set new top/bottom margin) * { Recompute margin to accommodate new IndicatorSize; } * } */ if (newcbox->toggle.indicator_dim != curcbox->toggle.indicator_dim) { int maxIndicatorSize = (int) (newcbox->toggle.indicator_dim) + 2*Xm3D_ENHANCE_PIXEL; int boxSize = ((int) newcbox->label.TextRect.height + (int) newcbox->label.margin_top + (int) newcbox->label.margin_bottom); top_delta = bottom_delta = (maxIndicatorSize - boxSize) / 2; } /* End fix CR 5568 */ if (LayoutIsRtoLP(newcbox)) right_delta = (newcbox->toggle.indicator_dim + newcbox->toggle.spacing - newcbox->label.margin_right); else left_delta = (newcbox->toggle.indicator_dim + newcbox->toggle.spacing - newcbox->label.margin_left); } else if (curcbox->toggle.ind_on) { /* CR 2337: Redisplay when the indicator is turned off. */ flag = TRUE; top_delta = -newcbox->toggle.ind_top_delta; bottom_delta = -newcbox->toggle.ind_bottom_delta; if (LayoutIsRtoLP(newcbox)) right_delta = -newcbox->toggle.ind_right_delta; else left_delta = -newcbox->toggle.ind_left_delta; } /* CR 2337: Let the toggle button shrink if necessary. */ if (right_delta || left_delta || top_delta || bottom_delta) { flag = TRUE; /* Adjust vertical margins based on the indicator. */ if ((int)newcbox->toggle.ind_top_delta + top_delta > 0) { newcbox->label.margin_top += top_delta; newcbox->toggle.ind_top_delta += top_delta; } else { newcbox->label.margin_top -= newcbox->toggle.ind_top_delta; newcbox->toggle.ind_top_delta = 0; } if ((int)newcbox->toggle.ind_bottom_delta + bottom_delta > 0) { newcbox->label.margin_bottom += bottom_delta; newcbox->toggle.ind_bottom_delta += bottom_delta; } else { newcbox->label.margin_bottom -= newcbox->toggle.ind_bottom_delta; newcbox->toggle.ind_bottom_delta = 0; } /* Adjust horizontal margins based on the indicator. */ if (LayoutIsRtoLP(newcbox)) { if ((int)newcbox->toggle.ind_right_delta + right_delta > 0) { newcbox->label.margin_right += right_delta; newcbox->toggle.ind_right_delta += right_delta; } else { newcbox->label.margin_right -= newcbox->toggle.ind_right_delta; newcbox->toggle.ind_right_delta = 0; } } else { if ((int)newcbox->toggle.ind_left_delta + left_delta > 0) { newcbox->label.margin_left += left_delta; newcbox->toggle.ind_left_delta += left_delta; } else { newcbox->label.margin_left -= newcbox->toggle.ind_left_delta; newcbox->toggle.ind_left_delta = 0; } } /* Realign the label. */ if (!newcbox->label.recompute_size) (* resize) ((Widget) new_w); } if (newcbox->label.recompute_size) { if (request->core.width == current->core.width) new_w->core.width = 0; if (request->core.height == current->core.height) new_w->core.height = 0; } if (new_w->core.width == 0) { newcbox->core.width = newcbox->label.TextRect.width + newcbox->label.margin_left + newcbox->label.margin_right + 2 * (newcbox->primitive.highlight_thickness + newcbox->primitive.shadow_thickness + newcbox->label.margin_width); if (newcbox->core.width == 0) newcbox->core.width = 1; flag = TRUE; } if (new_w->core.height == 0) { newcbox->core.height = MAX(newcbox->toggle.indicator_dim, newcbox->label.TextRect.height + 2 * newcbox->label.margin_height + newcbox->label.margin_top + newcbox->label.margin_bottom) + 2 * (newcbox->primitive.highlight_thickness + newcbox->primitive.shadow_thickness); if (newcbox->core.height == 0) newcbox->core.height = 1; flag = TRUE; } } if ((newcbox->primitive.foreground != curcbox->primitive.foreground) || (newcbox->core.background_pixel != curcbox->core.background_pixel) || (newcbox->toggle.select_color != curcbox->toggle.select_color)) { XtReleaseGC( (Widget) curcbox, curcbox->toggle.select_GC); XtReleaseGC( (Widget) curcbox, curcbox->toggle.background_gc); XtReleaseGC( (Widget) curcbox, curcbox->toggle.indeterminate_GC); XtReleaseGC( (Widget) curcbox, curcbox->toggle.indeterminate_box_GC); newcbox->toggle.reversed_select = (newcbox->toggle.select_color == XmREVERSED_GROUND_COLORS); if (newcbox->toggle.select_color == XmDEFAULT_SELECT_COLOR) { /* CR 9923: Copy all bytes of the resulting pixel. */ XrmValue value; DefaultSelectColor((Widget)newcbox, XtOffsetOf(XmToggleButtonRec,toggle.select_color), &value); assert(value.size == sizeof(Pixel)); newcbox->toggle.select_color = *((Pixel*) value.addr); } else if (newcbox->toggle.select_color == XmREVERSED_GROUND_COLORS) { newcbox->toggle.select_color = newcbox->primitive.foreground; } else if (newcbox->toggle.select_color == XmHIGHLIGHT_COLOR) { newcbox->toggle.select_color = newcbox->primitive.highlight_color; } GetGC(newcbox); flag = TRUE; } if (newcbox->toggle.unselect_color != curcbox->toggle.unselect_color) { XtReleaseGC ((Widget) curcbox, curcbox->toggle.unselect_GC); GetUnselectGC(newcbox); flag = TRUE; } if ((curcbox->toggle.ind_type != newcbox->toggle.ind_type) && (!XmRepTypeValidValue(XmRID_INDICATOR_TYPE, newcbox->toggle.ind_type, (Widget) newcbox))) { newcbox->toggle.ind_type = curcbox->toggle.ind_type; } if (curcbox->toggle.set != newcbox->toggle.set) { if ((newcbox->toggle.toggle_mode == XmTOGGLE_BOOLEAN) && (newcbox->toggle.set == XmINDETERMINATE)) { newcbox->toggle.set = curcbox->toggle.set; } else { IsOn(newcbox) = newcbox->toggle.set; if (flag == False && XtIsRealized((Widget)newcbox)) { if (newcbox->toggle.ind_on) { DrawToggle (newcbox); if (Lab_IsPixmap(newcbox) || Lab_IsPixmapAndText(newcbox)) SetAndDisplayPixmap(newcbox, NULL, NULL); } else { /* Begin fixing OSF 5946 */ if (newcbox->primitive.shadow_thickness > 0) DrawToggleShadow (newcbox); if (newcbox->toggle.fill_on_select && !Lab_IsPixmap(newcbox)) DrawToggleLabel (newcbox); if (Lab_IsPixmap(newcbox) || Lab_IsPixmapAndText(newcbox)) { SetAndDisplayPixmap(newcbox, NULL, NULL); flag = True; } /* End fixing OSF 5946 */ } } } } if ((curcbox->toggle.ind_type != newcbox->toggle.ind_type) || ( (curcbox->toggle.visible != newcbox->toggle.visible) && (XmUNSET == newcbox->toggle.set)) ) { flag = True; } /* One-of-many forces boolean mode. */ if (IsOneOfMany(newcbox->toggle.ind_type) && (newcbox->toggle.toggle_mode == XmTOGGLE_INDETERMINATE)) { newcbox->toggle.toggle_mode = XmTOGGLE_BOOLEAN; } /* * Transition between True/False is easy. Transition from * indetermine is done by setting the toggle to False. */ if ((curcbox->toggle.toggle_mode != newcbox->toggle.toggle_mode) && (newcbox->toggle.toggle_mode == XmTOGGLE_BOOLEAN) && (newcbox->toggle.set == XmINDETERMINATE)) { newcbox->toggle.visual_set = newcbox->toggle.set = XmUNSET; flag = True; } return(flag); } /*************************************************************** * * XmToggleButtonGetState * This function gets the state of the toggle widget. * ***************************************************************/ Boolean XmToggleButtonGetState( Widget w ) { XmToggleButtonWidget tw = (XmToggleButtonWidget) w; Boolean ret_val; XtAppContext app = XtWidgetToApplicationContext(w); if (XmIsGadget(w)) return XmToggleButtonGadgetGetState(w); _XmAppLock(app); ret_val = tw->toggle.set; _XmAppUnlock(app); return (ret_val); } /**************************************************************** * * XmTogglebuttonSetState * This function sets the state of the toggle widget. * ****************************************************************/ void XmToggleButtonSetState( Widget w, #if NeedWidePrototypes int bnewstate, int notify ) #else Boolean bnewstate, Boolean notify ) #endif /* NeedWidePrototypes */ { XmToggleButtonWidget tw = (XmToggleButtonWidget) w; XmMenuSystemTrait menuSTrait; XtAppContext app = XtWidgetToApplicationContext(w); XmToggleButtonState newstate; if (XmIsGadget(w)) { XmToggleButtonGadgetSetState(w, bnewstate, notify); return; } _XmAppLock(app); /* toggel.set is enum type, not Boolean */ newstate = (bnewstate == XmSET)? XmSET : XmUNSET; if (tw->toggle.set != newstate) { tw->toggle.set = newstate; IsOn(tw) = newstate; if (XtIsRealized ((Widget)tw)) { if (tw->toggle.ind_on) DrawToggle(tw); else { if (tw->primitive.shadow_thickness > 0) DrawToggleShadow (tw); if (tw->toggle.fill_on_select && !Lab_IsPixmap(tw)) DrawToggleLabel (tw); } if (Lab_IsPixmap(tw) || Lab_IsPixmapAndText(tw)) SetAndDisplayPixmap( tw, NULL, NULL); } if (notify) { /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tw)), XmQTmenuSystem); if (menuSTrait != NULL) { XmToggleButtonCallbackStruct call_value; call_value.reason = XmCR_VALUE_CHANGED; call_value.event = NULL; call_value.set = tw->toggle.set; menuSTrait->entryCallback(XtParent(tw), (Widget)tw, &call_value); } if ((! tw->label.skipCallback) && (tw->toggle.value_changed_CB)) { XFlush(XtDisplay(tw)); ToggleButtonCallback(tw, XmCR_VALUE_CHANGED, tw->toggle.set, NULL); } } } _XmAppUnlock(app); } /**************************************************************** * * XmToggleButtonSetValue * This function sets the state of the toggle widget. * ****************************************************************/ Boolean XmToggleButtonSetValue( Widget w, #if NeedWidePrototypes int newstate, int notify ) #else XmToggleButtonState newstate, Boolean notify ) #endif /* NeedWidePrototypes */ { XmToggleButtonWidget tw = (XmToggleButtonWidget) w; XtAppContext app = XtWidgetToApplicationContext(w); if (XmIsGadget(w)) return XmToggleButtonGadgetSetValue(w, newstate, notify); _XmAppLock(app); /* Can't set third state if we aren't in three state mode. */ if ((newstate == XmINDETERMINATE) && (tw->toggle.toggle_mode != XmTOGGLE_INDETERMINATE)) { _XmAppUnlock(app); return False; } if (tw->toggle.set != newstate) { tw->toggle.set = tw->toggle.visual_set = newstate; if (XtIsRealized ((Widget)tw)) { if (tw->toggle.ind_on) DrawToggle(tw); else { if (tw->primitive.shadow_thickness > 0) DrawToggleShadow (tw); if (tw->toggle.fill_on_select && !Lab_IsPixmap(tw)) DrawToggleLabel (tw); } if (Lab_IsPixmap(tw) || Lab_IsPixmapAndText(tw)) SetAndDisplayPixmap( tw, NULL, NULL); } if (notify) { /* If the parent is a RowColumn, notify it about the select. */ if (XmIsRowColumn(XtParent(tw))) { XmToggleButtonCallbackStruct call_value; call_value.reason = XmCR_VALUE_CHANGED; call_value.event = NULL; call_value.set = tw->toggle.set; (* xmLabelClassRec.label_class.menuProcs) (XmMENU_CALLBACK, XtParent(tw), FALSE, tw, &call_value); } if ((! tw->label.skipCallback) && (tw->toggle.value_changed_CB)) { XFlush(XtDisplay(tw)); ToggleButtonCallback(tw, XmCR_VALUE_CHANGED, tw->toggle.set, NULL); } } } _XmAppUnlock(app); return True; } /*********************************************************************** * * XmCreateToggleButton * Creates an instance of a togglebutton and returns the widget id. * ************************************************************************/ Widget XmCreateToggleButton( Widget parent, char *name, Arg *arglist, Cardinal argCount ) { return XtCreateWidget(name, xmToggleButtonWidgetClass, parent, arglist, argCount); } Widget XmVaCreateToggleButton( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmToggleButtonWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedToggleButton( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmToggleButtonWidgetClass, parent, True, var, count); va_end(var); return w; } /* * DrawToggleShadow (tb) * - Should be called only if ToggleShadow are to be drawn ; * if the IndicatorOn resource is set to false top and bottom shadows * will be switched depending on whether the Toggle is selected or * unselected. * No need to call the routine if shadow_thickness is 0. */ static void DrawToggleShadow( XmToggleButtonWidget tb ) { GC top_gc, bot_gc; int width, height; int hilite_thickness; if (tb->toggle.ind_on || (IsOn(tb) == XmUNSET)) { top_gc = tb->primitive.top_shadow_GC; bot_gc = tb->primitive.bottom_shadow_GC; } else if (IsOn(tb) == XmINDETERMINATE) { top_gc = bot_gc = tb->toggle.indeterminate_box_GC; } else { top_gc = tb->primitive.bottom_shadow_GC; bot_gc = tb->primitive.top_shadow_GC; } hilite_thickness = tb->primitive.highlight_thickness; width = (int) (tb->core.width - (hilite_thickness << 1)); height = (int) (tb->core.height - (hilite_thickness << 1)); XmeDrawShadows (XtDisplay (tb), XtWindow (tb), top_gc, bot_gc, hilite_thickness, hilite_thickness, width, height, tb->primitive.shadow_thickness, XmSHADOW_OUT); } /* * DrawToggleLabel (tb) * Called when XmNindicatorOn is FALSE and XmNfillOnSelect is TRUE. * Fill toggle with selectColor or background depending on toggle * value, and draw label. */ static void DrawToggleLabel( XmToggleButtonWidget tb ) { Dimension margin = (tb->primitive.highlight_thickness + tb->primitive.shadow_thickness); Position fx = margin; Position fy = margin; int fw = tb->core.width - 2 * margin; int fh = tb->core.height - 2 * margin; Boolean restore_gc = False; GC tmp_gc = None, fill_gc; if (tb->primitive.top_shadow_color == tb->toggle.select_color || tb->primitive.bottom_shadow_color == tb->toggle.select_color) { fx += 1; fy += 1; fw -= 2; fh -= 2; } if (fw < 0 || fh < 0) return; switch (tb->toggle.visual_set) { case XmUNSET: fill_gc = tb->toggle.unselect_GC; break; case XmSET: fill_gc = tb->toggle.select_GC; break; case XmINDETERMINATE: { XGCValues values; /* Fetch the select_color GetGC() actually used. */ XGetGCValues(XtDisplay(tb), tb->toggle.select_GC, GCForeground, &values); values.background = tb->toggle.unselect_color; XChangeGC(XtDisplay((Widget)tb), tb->toggle.indeterminate_GC, GCForeground|GCBackground, &values); fill_gc = tb->toggle.indeterminate_GC; break; } default: assert(False); return; } XFillRectangle (XtDisplay(tb), XtWindow(tb), fill_gc, fx, fy, fw, fh); if ((tb->primitive.foreground == tb->toggle.select_color) && (IsOn(tb) == XmSET)) { tmp_gc = tb->label.normal_GC; tb->label.normal_GC = tb->toggle.background_gc; restore_gc = True; } { XtExposeProc expose; #ifdef FIX_1395 Pixel tmpc = tb->core.background_pixel; /* Save bg color */ /* Changing label background color if button toggled */ if (tb->toggle.visual_set == XmSET && !Lab_IsMenupane(tb)) XSetWindowBackground(XtDisplay(tb), XtWindow(tb), tb->toggle.select_color); #endif _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (* expose) ((Widget) tb, NULL, NULL); #ifdef FIX_1395 /* restore default bg color */ if (tb->toggle.visual_set == XmSET && !Lab_IsMenupane(tb) ) XSetWindowBackground(XtDisplay(tb), XtWindow(tb), tmpc); #endif } if (restore_gc) { /* CR 9791: Label's normal_gc has a dynamic clip_mask. */ XSetClipMask(XtDisplay(tb), tb->toggle.background_gc, None); tb->label.normal_GC = tmp_gc; } } /* * DrawEtchedInMenu (tb) * Called when in a Menu and EtchedInMenu is TRUE. * And when XmNindicatorOn is FALSE and XmNfillOnSelect is FALSE; * or when XmNindicatorOn is TRUE. * Fill background with the arm_gc and draw label. */ static void DrawEtchedInMenu( XmToggleButtonWidget tb ) { Dimension margin = (tb->primitive.highlight_thickness + tb->primitive.shadow_thickness); Position fx = margin; Position fy = margin; int fw = tb->core.width - 2 * margin; int fh = tb->core.height - 2 * margin; Boolean restore_gc = False; GC tmp_gc = None; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(tb)); Boolean etched_in = dpy->display.enable_etched_in_menu; Pixel select_pix, tmpc; if (tb->primitive.top_shadow_color == tb->toggle.select_color || tb->primitive.bottom_shadow_color == tb->toggle.select_color) { fx += 1; fy += 1; fw -= 2; fh -= 2; } if (fw < 0 || fh < 0) return; XFillRectangle (XtDisplay(tb), XtWindow(tb), tb->toggle.Armed ? tb->toggle.arm_GC : tb->toggle.background_gc, fx, fy, fw, fh); if (tb->toggle.Armed) { tmpc = tb->core.background_pixel; XmGetColors(XtScreen(tb), tb->core.colormap, tb->core.background_pixel, NULL, NULL, NULL, &select_pix); if (tb->primitive.foreground == select_pix) { tmp_gc = tb->label.normal_GC; tb->label.normal_GC = tb->toggle.background_gc; restore_gc = True; } } { XtExposeProc expose; #ifdef FIX_1395 if (tb->toggle.Armed) { XSetWindowBackground(XtDisplay(tb), XtWindow(tb), select_pix); } else { XSetWindowBackground(XtDisplay(tb), XtWindow(tb), tb->core.background_pixel); } #endif _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (* expose) ((Widget) tb, NULL, NULL); } if (restore_gc) { XSetClipMask(XtDisplay(tb), tb->toggle.background_gc, None); tb->label.normal_GC = tmp_gc; } } /* BEGIN OSF Fix pir 1778 */ /************************************************************************* * * SetToggleSize(newtb) * Set size properly when XmNselectPixmap or XmNselectInsensitivePixmaps * are set in addition to the corresponding labelPixmaps. Have to pick * the largest dimensions. * ************************************************************************/ static void SetToggleSize( XmToggleButtonWidget newtb) { unsigned int maxW, maxH; unsigned int tmpW, tmpH; maxW = maxH = tmpW = tmpH = 0; /* We know it's a pixmap so find out how how big it is */ if (XtIsSensitive((Widget) newtb)) { if (!IsNull(PixmapOn(newtb))) { XmeGetPixmapData(XtScreen(newtb), PixmapOn(newtb), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapOff(newtb))) { XmeGetPixmapData(XtScreen(newtb), PixmapOff(newtb), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapInd(newtb))) { XmeGetPixmapData(XtScreen(newtb), PixmapInd(newtb), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } } else { if (!IsNull(PixmapInsenOn(newtb))) { XmeGetPixmapData(XtScreen(newtb), PixmapInsenOn(newtb), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapInsenOff(newtb))) { XmeGetPixmapData(XtScreen(newtb), PixmapInsenOff(newtb), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapInsenInd(newtb))) { XmeGetPixmapData(XtScreen(newtb), PixmapInsenInd(newtb), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } } newtb->label.TextRect.width = (unsigned short) maxW; newtb->label.TextRect.height = (unsigned short) maxH; /* Invoke Label's SetSize procedure. */ { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize) ((Widget) newtb); } } /* END OSF Fix pir 1778 */ /* * DefaultSelectColor - an XtResourceDefaultProc for generating the * default select color. This may require examining the * XmNindicatorType and XmNhighlightColor resources, which will * happen to have real values only because they appear before * XmNselectColor in the resource list. */ static void DefaultSelectColor(Widget widget, int offset, XrmValue *value) { XmToggleButtonWidget tb = (XmToggleButtonWidget) widget; Boolean force_highlight = FALSE; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(widget)); Boolean enable_toggle_color = xm_dpy->display.enable_toggle_color; if (enable_toggle_color) { /* This code may misbehave for erroneous ind_type values. */ if (IsOneOfMany(tb->toggle.ind_type)) { force_highlight = TRUE; } else if ((tb->toggle.ind_type == XmINVALID_TYPE) && XmIsRowColumn(XtParent(widget))) { XtVaGetValues(XtParent(widget), XmNradioBehavior, &force_highlight, NULL); } } if (force_highlight) { value->size = sizeof(tb->primitive.highlight_color); value->addr = (char *) &tb->primitive.highlight_color; } else _XmSelectColorDefault(widget, offset, value); } /* * NormalizeIndOn - return the normalized value of XmNindicatorOn, * replacing XmINDICATOR_FILL and XmINDICATOR_BOX with the proper * absolute values. */ static unsigned char NormalizeIndOn(XmToggleButtonWidget tb) { unsigned char value = tb->toggle.ind_on; /* Convert XmINDICATOR_FILL to XmINDICATOR_CHECK_BOX? */ if (value == XmINDICATOR_FILL) { /* This routine may be called frequently, so reach directly into */ /* the XmDisplay rather than calling XtGetValues. */ XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) tb)); if (xm_dpy->display.enable_toggle_visual) value = XmINDICATOR_CHECK_BOX; } /* Convert XmINDICATOR_BOX to XmINDICATOR_3D_BOX (XmINDICATOR_FILL). */ else if (value == XmINDICATOR_BOX) { value = XmINDICATOR_3D_BOX; } return value; } /* * NormalizeIndType - return the normalized value of XmNindicatorType, * replacing XmONE_OF_MANY with the proper absolute value. */ static unsigned char NormalizeIndType(XmToggleButtonWidget tb) { unsigned char value = tb->toggle.ind_type; if (value == XmONE_OF_MANY) { /* This routine may be called frequently, so reach directly into */ /* the XmDisplay rather than calling XtGetValues. */ XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) tb)); if (xm_dpy->display.enable_toggle_visual) value = XmONE_OF_MANY_ROUND; else value = XmONE_OF_MANY_DIAMOND; } return value; } motif-2.3.8/lib/Xm/ClipWindow.c0000644000175000017500000005025412672140200013140 00000000000000/* $TOG: ClipWindow.c /main/12 1999/10/13 16:16:13 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* for XmeVirtualToActualKeysyms */ #include #include "RepTypeI.h" #include "ScrolledWI.h" #include "TraversalI.h" #include "XmI.h" #include "ClipWindTI.h" /******** Static Function Declarations ********/ static String GetRealTranslations( Display *dpy, XmConst _XmBuildVirtualKeyStruct *keys, int num_keys) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass w_class) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Resize( Widget w) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget wid) ; static void DeleteChild( Widget w) ; static XmNavigability WidgetNavigable( Widget wid) ; static void ActionGrab( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; /******** End Static Function Declarations ********/ /************** * * Translation tables management for ClipWindow: * --------------------------------------------- * We need 2 because of the grabactions stuff that requires a real * one up front and the event dispatch process that requires a virtual one. * The real one is derived from the virtual one in GetRealTranslation. * It is set in Initialize, before realize time. * The virtual one is set up once per widget in Redisplay. * One the Xt problem is fixed, setting the _XmClipWindowTranslationTable * directly should be enough (+ still registering the grab). The * override cuisine + the getreal will go away. **************/ /************** * * Only one action that takes as parameter the name of the action * to call in the scrolledwindow action list (where the paging is done) * dependency: the SW names in ActionGrab have to * match the action name in the ScrolledWindow. * **************/ static XtActionsRec actions[] = { {"ActionGrab", ActionGrab}, }; /**************************************************************** * * Full class record constant * ****************************************************************/ static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* InitializePrehook */ NULL, /* SetValuesPrehook */ NULL, /* InitializePosthook */ NULL, /* SetValuesPosthook */ NULL, /* secondaryObjectClass */ NULL, /* secondaryCreate */ NULL, /* getSecRes data */ { 0 }, /* fastSubclass flags */ NULL, /* getValuesPrehook */ NULL, /* getValuesPosthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ NULL /* focusChange */ }; externaldef( xmclipwindowclassrec) XmClipWindowClassRec xmClipWindowClassRec = { { /* core_class fields */ (WidgetClass) &xmDrawingAreaClassRec, /* superclass */ "XmClipWindow", /* class_name */ sizeof(XmClipWindowRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_init */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actions, /* actions */ XtNumber(actions), /* num_actions */ NULL, /* resources */ 0, /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ FALSE, /* compress_exposure */ TRUE, /* compress_enterlv */ FALSE, /* visible_interest */ NULL, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator*/ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ NULL, /* resource list */ 0, /* num resources */ sizeof(XmManagerConstraintRec), /* constraint size */ NULL, /* init proc */ NULL, /* destroy proc */ NULL, /* set values proc */ NULL, /* extension */ }, { /* manager_class fields */ NULL, /* translations */ NULL, /* syn_resources */ 0, /* num_get_resources */ NULL, /* syn_cont_resources */ 0, /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* DrawingArea class - none */ 0 /* mumble */ }, { /* ClipWindow class - none */ NULL /* extension */ } }; externaldef( xmclipwindowwidgetclass) WidgetClass xmClipWindowWidgetClass = (WidgetClass) &xmClipWindowClassRec ; /************************************************************************ * * * GetRealTranslations - Builds up a "real" translation table out of * * virtual keysyms. * * Well, not exactly out of a virtual translation table, but rather a * special struct, a _XmBuildVirtualKeyStruct that maches the * clipwindow virtual translation found in Transltns.c: ":c osfBeginLine:ActionGrab(SWTopLine)\n\ :osfBeginLine:ActionGrab(SWBeginLine)\n\ :c osfEndLine:ActionGrab(SWBottomLine)\n\ :osfEndLine:ActionGrab(SWEndLine)\n\ :osfPageLeft:ActionGrab(SWLeftPage)\n\ :c osfPageUp:ActionGrab(SWLeftPage)\n\ :osfPageRight:ActionGrab(SWRightPage)\n\ :c osfPageDown:ActionGrab(SWRightPage)\n\ :osfPageUp:ActionGrab(SWUpPage)\n\ :osfPageDown:ActionGrab(SWDownPage)"; * This is just because it is simpler that way, we don't have to * parse a translation table string from scratch. * * cons: anytime the above changes in Transltns.c, ClipWindowKeys, * defined below, has to be updated. * ************************************************************************/ /* _XmBuildVirtualKeyStruct is declared in XmP.h */ static XmConst _XmBuildVirtualKeyStruct ClipWindowKeys[] = { {ControlMask, XmVosfBeginLine, "ActionGrab(SWTopLine)\n"}, {0, XmVosfBeginLine, "ActionGrab(SWBeginLine)\n"}, {ControlMask, XmVosfEndLine, "ActionGrab(SWBottomLine)\n"}, {0, XmVosfEndLine, "ActionGrab(SWEndLine)\n"}, {0, XmVosfPageLeft, "ActionGrab(SWLeftPage)\n"}, {ControlMask, XmVosfPageUp, "ActionGrab(SWLeftPage)\n"}, {0, XmVosfPageRight, "ActionGrab(SWRightPage)\n"}, {ControlMask, XmVosfPageDown, "ActionGrab(SWRightPage)\n"}, {0, XmVosfPageUp, "ActionGrab(SWUpPage)\n"}, {0, XmVosfPageDown, "ActionGrab(SWDownPage)\n"} }; #define MAX_CLIPWINDOW_TM_SIZE 1000 /* roughly 10lines * 100chars */ static String GetRealTranslations( Display *dpy, XmConst _XmBuildVirtualKeyStruct *keys, int num_keys ) { static char buf[MAX_CLIPWINDOW_TM_SIZE]; /* memory used externally */ char *tmp = buf; char *keystring; Cardinal i; int num_vkeys; XmKeyBinding vkeys; KeySym keysym; Modifiers mods; *tmp = '\0'; for (i = 0; i < num_keys; i++) { keysym = XStringToKeysym(keys[i].key); if (keysym == NoSymbol) break; /* A virtual keysym may map to multiple real keysyms. */ num_vkeys = XmeVirtualToActualKeysyms(dpy, keysym, &vkeys); while (--num_vkeys >= 0) { keystring = XKeysymToString(vkeys[num_vkeys].keysym); if (!keystring) break; /* this is why the struct is simpler than a pure translation parser, we have to merge the modifiers */ mods = vkeys[num_vkeys].modifiers | keys[i].mod; if (mods & ControlMask) strcat(tmp, "Ctrl "); if (mods & ShiftMask) strcat(tmp, "Shift "); if (mods & Mod1Mask) strcat(tmp, "Mod1 "); /* "Alt" may not be always right */ strcat(tmp,""); strcat(tmp, keystring); strcat(tmp,": "); strcat(tmp, keys[i].action); /* actions contain line separators. */ tmp += strlen(tmp); assert((tmp - buf) < MAX_CLIPWINDOW_TM_SIZE); } XtFree((char*) vkeys); } return buf; } /****************************************************************/ static XtTranslations ClipWindowTranslations = NULL; static void ClassInitialize( void ) { /* can't do that static in the base extextion record */ baseClassExtRec.record_type = XmQmotif ; /* register the grab action related to the paging. at this point the widget has a real translation table */ XtRegisterGrabAction(ActionGrab, True, KeyPressMask | KeyReleaseMask, GrabModeAsync, GrabModeAsync); ClipWindowTranslations = XtParseTranslationTable(_XmClipWindowTranslationTable); } /****************************************************************/ static XmConst XmClipWindowTraitRec clipWindowData = { 0 /* version */ }; static void ClassPartInitialize( WidgetClass w_class ) { _XmFastSubclassInit(w_class, XmCLIP_WINDOW_BIT) ; /* Install the clipWindow trait for all subclasses as well. */ XmeTraitSet((XtPointer)w_class, _XmQTclipWindow, (XtPointer)&clipWindowData); } /************************************************************************ * * * Initialize * * * ************************************************************************/ /* ARGSUSED */ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmClipWindowWidget cw = (XmClipWindowWidget) nw ; static XtTranslations ClipWindowXlations = NULL; /* force some DA resources */ cw->manager.shadow_thickness = 0 ; cw->core.border_width = 0 ; cw->drawing_area.margin_width = 0 ; cw->drawing_area.margin_height = 0 ; /* I could leave this one for more bc support, but it will force me to special case the DA SetValues method ... cw->drawing_area.resize_policy = XmRESIZE_SWINDOW ; */ cw->clip_window.flags = 0 ; /* flags used in the ClipWindow to track that the widget hasn't gotten yet its real translation table. This will be changed in Redisplay, after realization, and the flag will be reset to 1 there */ /* Here we create the real translation table out of the virtual one, parse it and attach it to the clipwindow */ /* This has to be done in Initialize because we need the particular display of the widget, not a default display (which is available in ClassInitialize) */ /* do the parsing only once */ if (!ClipWindowXlations) { ClipWindowXlations = XtParseTranslationTable( GetRealTranslations( XtDisplay(nw), ClipWindowKeys, XtNumber(ClipWindowKeys))); } XtOverrideTranslations(nw, ClipWindowXlations); /* need for the RtoL win gravity resize support */ cw->clip_window.old_width = cw->core.width ; } /************************************************************************* * * Resize: implement north east win gravity for all kids. * I wish X would do it for me, but setting win_gravity * on a window only affect this window... * *************************************************************************/ static void Resize( Widget w ) { XtWidgetProc resize; /* When layout is rtol, implement win gravity north east for all kids */ if (LayoutIsRtoLM(w)) { XmClipWindowWidget cw = (XmClipWindowWidget) w ; Cardinal i ; for (i = 0; i < cw->composite.num_children; i++) { Widget child ; child = cw->composite.children[i] ; if (XtIsManaged(child)) { /* we want the distance from the x of the child to the width of the clipwindow to remain constant */ Dimension d ; d = cw->clip_window.old_width - child->core.x ; XmeConfigureObject(child, cw->core.width - d, child->core.y, child->core.width, child->core.height, child->core.border_width); } } cw->clip_window.old_width = cw->core.width ; } /* For compatibility invoke the drawing area's XmNresizeCallback. */ _XmProcessLock(); resize = ((CoreWidgetClass) xmClipWindowClassRec.core_class.superclass)-> core_class.resize; _XmProcessUnlock(); (* resize) (w); } /************************************************************************ * * * Redisplay - * * * ************************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmClipWindowWidget cw = (XmClipWindowWidget) wid ; XtExposeProc expose; /* Here we're doing something once for every instance of ClipWindow. if the clipwindow translation hasn't been override yet, do it: install the virtual translation */ /* There are other way to track that moment, like use an exposecallback that removes itself right away, or a map notify action, this one is clean and simple, no hackery of the translation table, not much additional code */ if (cw->clip_window.flags == 0) { cw->clip_window.flags = 1 ; XtOverrideTranslations (wid, ClipWindowTranslations); } /* envelop our superclass expose method */ _XmProcessLock(); expose = ((CoreWidgetClass) xmClipWindowClassRec.core_class.superclass)-> core_class.expose; _XmProcessUnlock(); (* expose) (wid, event, region); } /**************************************************************** * * GeometryManager: * Always accpet the change and notify the ScrollFrame parent * ****************************************************************/ /*ARGSUSED*/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) /* unused */ { /* notify the navigators of the change thru the appropriate Trait's methods */ Widget clip = XtParent(w); if (IsQueryOnly(request)) return XtGeometryYes; /* The clipwindow is making the change to the child geometry */ if (IsX(request)) w->core.x = request->x; if (IsY(request)) w->core.y = request->y; if (IsWidth(request)) w->core.width = request->width; if (IsHeight(request)) w->core.height = request->height; if (IsBorder(request)) w->core.border_width = request->border_width; /* notify the ScrolledWindow parent by using a direct call */ _XmSWNotifyGeoChange(XtParent(clip), w, request); return XtGeometryYes; } /**************************************************************** * * ChangeManaged * * ****************************************************************/ static void ChangeManaged( Widget wid ) { /* notify the ScrolledWindow */ _XmSWNotifyGeoChange(XtParent(wid), NULL, NULL); XmeNavigChangeManaged(wid) ; } /************************************************************************ * * * DeleteChild: track the workwindow death * * * ************************************************************************/ static void DeleteChild( Widget child ) { XtWidgetProc delete_child; /* looks like we need a Trait here as well, at least we don't need the 1.2 destroy callback stuff anymore */ XmScrolledWindowWidget sw; sw = (XmScrolledWindowWidget)child->core.parent->core.parent; if (child == sw->swindow.WorkWindow) sw->swindow.WorkWindow = NULL; /* remove it from the child list by enveloping */ _XmProcessLock(); delete_child = ((CompositeWidgetClass) xmClipWindowClassRec.core_class.superclass)-> composite_class.delete_child; _XmProcessUnlock(); (* delete_child) (child); } /**************************************************************** * Xm private class method ****************/ static XmNavigability WidgetNavigable( Widget wid) { /* do we really need this method ? */ if( XtIsSensitive(wid) && ((XmManagerWidget) wid)->manager.traversal_on ) { XmNavigationType nav_type = ((XmManagerWidget) wid) ->manager.navigation_type ; if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmDESCENDANTS_TAB_NAVIGABLE ; } return XmDESCENDANTS_NAVIGABLE ; } return XmNOT_NAVIGABLE ; } /************************************************************************ * * * Grab routine - The first param is the name of the action * * in the ScrolledWindow parent * * ************************************************************************/ static void ActionGrab( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XtCallActionProc(XtParent(wid), params[0], event, params, *num_params); } motif-2.3.8/lib/Xm/XpmRdFToDat.c0000644000175000017500000000521412672140200013151 00000000000000/* $XConsortium: XpmRdFToDat.c /main/2 1996/09/20 08:13:31 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * RdFToDat.c: * * * * XPM library * * Parse an XPM file and create an array of strings corresponding to it. * * * * Developed by Dan Greening dgreen@cs.ucla.edu / dgreen@sti.com * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmReadFileToData(filename, data_return) char *filename; char ***data_return; { XpmImage image; XpmInfo info; int ErrorStatus; info.valuemask = XpmReturnComments | XpmReturnExtensions; /* * initialize return value */ if (data_return) *data_return = NULL; ErrorStatus = XpmReadFileToXpmImage(filename, &image, &info); if (ErrorStatus != XpmSuccess) return (ErrorStatus); ErrorStatus = XpmCreateDataFromXpmImage(data_return, &image, &info); XpmFreeXpmImage(&image); XpmFreeXpmInfo(&info); return (ErrorStatus); } motif-2.3.8/lib/Xm/DrawP.h0000644000175000017500000002164713145162623012120 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDrawP_h #define _XmDrawP_h #include #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------*/ /* Functions used by Xm widgets for the Motif visual drawing */ /*---------------------------------------------------------------*/ /* All these functions have an Xlib draw like API: a Display*, a Drawable, then GCs, Positions and Dimensions and finally some specific paramaters */ /******** The Draw.c file has been split in several module for a better link profile *********/ /*--------------------------------------------------------------- XmeDrawShadows, use in place of the 1.1 _XmDrawShadow and _XmDrawShadowType with changes to the interface (widget vs window, offsets, new order) and in the implementation (uses XSegments instead of XRectangles). Both etched and regular shadows use now a single private routine xmDrawSimpleShadow. XmeDrawHighlight. Implementation using FillRectangles, for solid highlight only. _XmDrawHighlight. Highlight using wide lines, so that dash mode works. XmeClearBorder, new name for _XmEraseShadow (_XmClearShadowType, which clear half a shadow with a 'widget' API stays in Manager.c ) XmClearBorder is only usable on window, not on drawable. XmeDrawSeparator, use in place of the duplicate redisplay method of both separator and separatorgadget (highlight_thickness not used, must be incorporated in the function call parameters). use xmDrawSimpleShadow. Has 2 new separator types for dash shadowed lines. XmeDrawDiamond, new interface for _XmDrawDiamondButton (_XmDrawSquareButton is really a simple draw shadow and will be in the widget file as is). XmeDrawArrow, same algorithm as before but in one function that re-uses the malloced rects and does not store anything in the wigdet instance. XmeDrawPolygonShadow, new one that use the RegionDrawShadow API to implement an Xme call XmeDrawCircle, new one for toggle visual XmeDrawIndicator new one for toggle drawing ---------------------------------------------------------------------------*/ /******** Private Function Declarations ********/ extern void XmeDrawShadows( Display *display, Drawable d, GC top_gc, GC bottom_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shad_thick, #else Position x, Position y, Dimension width, Dimension height, Dimension shad_thick, #endif /* NeedWidePrototypes */ unsigned int shad_type); extern void XmeClearBorder( Display *display, Window w, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick); #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick); #endif /* NeedWidePrototypes */ extern void XmeDrawSeparator( Display *display, Drawable d, GC top_gc, GC bottom_gc, GC separator_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, int margin, unsigned int orientation, unsigned int separator_type); #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension margin, unsigned char orientation, unsigned char separator_type); #endif /* NeedWidePrototypes */ extern void XmeDrawDiamond( Display *display, Drawable d, GC top_gc, GC bottom_gc, GC center_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, int margin); #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension margin); #endif /* NeedWidePrototypes */ extern void XmeDrawCircle( Display *display, Drawable d, GC top_gc, GC bottom_gc, GC center_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, int margin); #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, Dimension margin); #endif /* NeedWidePrototypes */ extern void XmeDrawHighlight( Display *display, Drawable d, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int highlight_thick #else Position x, Position y, Dimension width, Dimension height, Dimension highlight_thick #endif /* NeedWidePrototypes */ ); extern void XmeDrawArrow( Display *display, Drawable d, GC top_gc, GC bot_gc, GC cent_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, unsigned int direction); #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, unsigned char direction); #endif /* NeedWidePrototypes */ extern void XmeDrawPolygonShadow( Display *dpy, Drawable d, GC topGC, GC bottomGC, XPoint *points, int n_points, #if NeedWidePrototypes int shadowThickness, unsigned int shadowType); #else Dimension shadowThickness, unsigned char shadowType); #endif /* NeedWidePrototypes */ extern void XmeDrawIndicator(Display *display, Drawable d, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int margin, int type); #else Position x, Position y, Dimension width, Dimension height, Dimension margin, XtEnum type); #endif /* NeedWidePrototypes */ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDrawP_h */ motif-2.3.8/lib/Xm/I18List.c0000644000175000017500000034730412672334535012303 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" #include #include #include #ifdef VMS #include #else #include #endif #include #include #include #include "TransferI.h" /* for _XmConvertComplete() */ #include #include #include "RepTypeI.h" /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define SUPERCLASS ((WidgetClass) &xmPrimitiveClassRec) #define NO_SELECTION -1 /* There is currently no anchor. */ #define IN_COLUMN_HEADER -2 /* The location is in the header. */ #define ENTIRE_ROW -3 /* perform operation on entire row. */ #define EXTEND (1 << 0) #define TOGGLE (1 << 1) #define OFF_TOP (1 << 2) #define OFF_BOTTOM (1 << 3) #define OFF_LEFT (1 << 4) /* UNUSED BUT RESERVED */ #define OFF_RIGHT (1 << 5) /* UNUSED BUT RESERVED */ #define OUTSIDE_WIDGET (OFF_TOP | OFF_BOTTOM | OFF_LEFT | OFF_RIGHT) #define DELAY_TIME(w) (XtGetMultiClickTime(XtDisplay(w))/3) #define LINE_HEIGHT 2 /* Height of the separator line */ #define HORIZONTAL_SPACE 8 /* horizontal Space between Text and Text. */ #define VERTICAL_SPACE 2 /* Vertical Space between Text and Text. */ #define NoTimeout ((XtIntervalId) 0) /* * DANGER: XmeRenderTableGetDefaultFont is an undocumented * internal MOTIF(tm) function. */ #define GetDefaultFont XmeRenderTableGetDefaultFont /************************************************************ * MACROS *************************************************************/ #define streq(a, b) (((a) != NULL) && ((b) != NULL) && (strcmp((a), (b)) == 0)) #define IsValidPixmap(p) (((p) != None) && ((p) != XmUNSPECIFIED_PIXMAP)) /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ extern Boolean XmeRenderTableGetDefaultFont (XmFontList, XFontStruct **); static Widget global_current_widget; /* static global to hold widget id for qsort. */ /************************************************************ * STATIC FUNCTION DECLARATIONS *************************************************************/ /****************************** * Exported Widget Functions ******************************/ Boolean XmI18ListDoSearch(Widget w, String str, Boolean reset); XmMultiListRowInfo *XmI18ListFindRow(Widget w, String str, int *found_column, Boolean reset, Boolean do_visual); static void ClassInitialize(); static void ClassPartInitialize(WidgetClass w_class); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void Realize(Widget, Mask *, XSetWindowAttributes *); static void Resize(Widget), Redisplay(Widget, XEvent *, Region); static void Destroy(Widget); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); /*********************************** * Internal routines. ***********************************/ static void AdjustFirstRowAndCol( XmI18ListWidget ); static void AdjustFirstCol(Widget); static void CalcLocations(Widget); static void CalcColumnInfo(Widget, Boolean); static void SetVisibleSize(Widget, Boolean); static void DisplayList(Widget, short, short, Boolean); static short GetListWidth(Widget); static void HScroll(Widget, short), VScroll(Widget, short); static short CvtPixelValToColNum(Widget, short); static short CvtColNumToPixelVal(Widget, short); static void CvtRowColumnToPosition(Widget, short, short, short *, short *); static void CvtPositionToRowColumn(Widget, short, short, short *, short *); static void ToggleRow(Widget, short), InvertArea(Widget, short, short); static void SelectHeader(Widget, short), DrawSeparator(Widget); static void CreateGCs(Widget), RedrawList(Widget), GetPixmapInfo(Widget); static void DestroyGCs(Widget), Notify(Widget, Boolean); static void ResizeSliders(Widget), SortList(Widget, Boolean); static void SingleClick(XmI18ListWidget); static void MoveListTimeout(XtPointer, XtIntervalId *); static Boolean MakePositionVisible(Widget, short, short, short, int); static void ExtendedSelect(Widget, short); static int IsRowVisible(Widget, short); static int QSortTest(const void *, const void *); static void UnselectRows(Widget, short); static Boolean Search(XmI18ListWidget ilist, XmString xms, int start_row, int start_column, int *found_row, int *found_column); static int FirstSelectedRow(Widget w); static void MakeCellVisible(Widget w, int row, int col); static void CopyColumnTitles(XmI18ListWidget); static void FreeColumnTitles(XmI18ListWidget); static void SelectRow(XmI18ListWidget, int, Boolean, Boolean); static void SelectItems(XmI18ListWidget, XmString, int, Boolean, Boolean); static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value); static void ListConvert(Widget, XtPointer, XmConvertCallbackStruct*); static void ListPreDestProc(Widget, XtPointer, XmDestinationCallbackStruct*); static void CopyToClipboard(Widget, XEvent*, String*, Cardinal*); static void DragDropFinished(Widget, XtPointer, XtPointer); static XmString GetConcatenatedRow(Widget, int); static void ProcessDrag(Widget, XEvent*, String*, Cardinal*); /*********************************** * Actions and Callback function defs. ***********************************/ static void HScrollCallback(Widget, XtPointer, XtPointer); static void VScrollCallback(Widget, XtPointer, XtPointer); static void HSlideLeftArrowCallback(Widget, XtPointer, XtPointer); static void HSlideRightArrowCallback(Widget, XtPointer, XtPointer); static void ButtonDownAction(Widget, XEvent *, String *, Cardinal *); static void ButtonUpOrLeaveAction(Widget, XEvent *, String *, Cardinal *); static void MotionAction(Widget, XEvent *, String *, Cardinal *); /************************************************************ * STATIC DECLARATIONS *************************************************************/ /* * The Translation table routines are getting in the way here. * Since the implicit removal of event disallows using both: * * (2) and button1 * * in the same translation table I have to do all the work myself. */ static char defaultTranslations[] = "~Ctrl ~Shift : ButtonDown()\n\ Ctrl ~Shift : ButtonDown(Toggle)\n\ ~Ctrl Shift : ButtonDown(Extend)\n\ Button1 : Motion()\n\ : ButtonUpOrLeave()\n\ : ProcessDrag()\n\ :c osfInsert: CopyToClipboard()\n\ :osfCopy: CopyToClipboard()"; static XtActionsRec actionsList[] = { {"ButtonDown", ButtonDownAction}, {"ButtonUpOrLeave", ButtonUpOrLeaveAction}, {"Motion", MotionAction}, {"ProcessDrag", ProcessDrag}, {"CopyToClipboard", CopyToClipboard}, }; /* ARGSUSED */ static void SetEntryBackground(Widget w, int offset, XrmValue *value) { XmI18ListWidget ilist = (XmI18ListWidget) w; /* not really used */ value->addr = (XtPointer) &ilist->core.background_pixel; /* * If this function is called, then the value of XmNentryBackground wasn't * set through a resource file specification, so override the current * value of True. If it was set, the value of True stays set in the widget * and the value of the pixel is set through the usual XtRPixel converter. */ XmI18List_entry_background_use(ilist) = False; } static XtResource resources[] = { { XmNnumColumns, XmCNumColumns, XmRShort, sizeof(short), XtOffsetOf(XmI18ListRec, ilist.num_columns), XmRImmediate, (XtPointer) 0 }, { XmNnumRows, XmCNumRows, XmRShort, sizeof(short), XtOffsetOf(XmI18ListRec, ilist.num_rows), XmRImmediate, (XtPointer) 0 }, { XmNselectedColumn, XmCSelectedColumn, XmRShort, sizeof(short), XtOffsetOf(XmI18ListRec, ilist.selected_header), XmRImmediate, (XtPointer) 0 }, { XmNcolumnTitles, XmCColumnTitles, XmRXmStringTable, sizeof(XmString *), XtOffsetOf(XmI18ListRec, ilist.column_titles), XmRImmediate, (XtPointer) NULL }, { XmNentryData, XmCEntryData, XmRPointer, sizeof(XtPointer), XtOffsetOf(XmI18ListRec, ilist.row_data), XmRImmediate, (XtPointer) NULL }, { XmNfirstColumnPixmaps, XmCFirstColumnPixmaps, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmI18ListRec, ilist.first_col_pixmaps), XmRImmediate, (XtPointer) False }, { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmI18ListRec, ilist.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmI18ListRec, ilist.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmI18ListRec, ilist.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNverticalScrollBar, XmCScrollBar, XmRWidget, sizeof(Widget), XtOffsetOf(XmI18ListRec, ilist.v_bar), XmRImmediate, (XtPointer) NULL }, { XmNhorizontalScrollBar, XmCScrollBar, XmRWidget, sizeof(Widget), XtOffsetOf(XmI18ListRec, ilist.h_bar), XmRImmediate, (XtPointer) NULL }, { XmNfirstRow, XmCFirstLocation, XmRShort, sizeof(short), XtOffsetOf(XmI18ListRec, ilist.first_row), XmRImmediate, (XtPointer) 0 }, { XmNfirstColumn, XmCFirstLocation, XmRShort, sizeof(short), XtOffsetOf(XmI18ListRec, ilist.first_col), XmRImmediate, (XtPointer) 0 }, { XmNdoubleClickCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmI18ListRec, ilist.double_click), XmRImmediate, (XtPointer) NULL }, { XmNsortFunctions, XmCFunction, XmRFunction, sizeof(Xm18SortFunction **), XtOffsetOf(XmI18ListRec, ilist.sort_functions), XmRImmediate, (XtPointer) NULL }, { XmNselectionPolicy, XmCSelectionPolicy, XmRSelectionPolicy, sizeof(unsigned char), XtOffsetOf(XmI18ListRec, ilist.selection_policy), XmRImmediate, (XtPointer) XmEXTENDED_SELECT }, { XmNsingleSelectionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmI18ListRec, ilist.single_select), XmRImmediate, (XtPointer) NULL }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf(XmI18ListRec, ilist.alignment), XmRImmediate, (XtPointer) XmALIGNMENT_BEGINNING }, { XmNstringDirection, XmCStringDirection, XmRStringDirection, sizeof(unsigned char), XtOffsetOf(XmI18ListRec, ilist.string_direction), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, { XmNvisibleItemCount, XmCVisibleItemCount, XmRInt, sizeof(int), XtOffsetOf(XmI18ListRec, ilist.visible_rows), XmRImmediate, (XtPointer) XmMultiList_DEFAULT_VISIBLE_COUNT }, { XmNnewVisualStyle, XmCNewVisualStyle, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmI18ListRec, ilist.new_visual_style), XmRImmediate, (XtPointer) True }, /* process this first; set the value to True */ { "is.entry.background.set", "I.Really.Wonder", XtRBoolean, sizeof(Boolean), XtOffsetOf(XmI18ListRec, ilist.entry_background_use), XmRImmediate, (XtPointer) True }, /* now see if this resource is set in the defaults file */ /* XmNentryBackground currently UNDOCUMENTED */ { XmNentryBackground, XmCBackground, XtRPixel, sizeof(Pixel), XtOffsetOf(XmI18ListRec, ilist.entry_background_pixel), XmRCallProc, (XtPointer) SetEntryBackground } }; XmI18ListClassRec xmI18ListClassRec = { { /* core fields */ /* superclass */ SUPERCLASS, /* class_name */ XM_I18LIST_CLASS_NAME, /* widget_size */ sizeof(XmI18ListRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMultiple, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* Xmprimitive fields */ NULL, /* border_highlight */ NULL, /* border_unhighlight */ XtInheritTranslations, /* translations */ NULL, /* arm_and_activate */ NULL, /* syn resources */ (Cardinal) 0, /* num syn_resources */ NULL /* extension */ }, { /* ICS List fields */ NULL /* extension */ } }; WidgetClass xmI18ListWidgetClass = (WidgetClass)&xmI18ListClassRec; /* Transfer trait record */ static XmConst XmTransferTraitRec ListTransfer = { 0, /* version */ (XmConvertCallbackProc) ListConvert, /* convertProc */ NULL, /* destinationProc */ (XmDestinationCallbackProc) ListPreDestProc, /* destinationPreHookProc */ }; /* * Comment on code structure. * * This code is separated into two separate coordinate spaces. * * The first is the default space defined by pixels and the X Server. * * The second is "input" space that contains all the information * to display in the actual list. This space runs from 0 -> (num_rows - 1) * in the y direction and 0 -> (num_cols - 1) in the x direction. The * input from the application is sent in this space. * * Chris D. Peterson - ICS, Inc. * 10/16/90 */ /************************************************************ * STATIC (EXPORTED) CODE *************************************************************/ /* Function Name: ClassInitialize * Description: Inits class-specific data (offsets) * Arguments: none * Returns: nothing */ static void ClassInitialize() { /* do nothing */ } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmI18LIST_BIT); /* Install transfer trait */ XmeTraitSet((XtPointer)w_class, XmQTtransfer, (XtPointer) &ListTransfer); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /*ARGSUSED*/ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmI18ListWidget ilist = (XmI18ListWidget) set; XmI18List_column_widths(ilist) = NULL; XmI18List_left_loc(ilist) = 0; XmI18List_state(ilist) = 0; XmI18List_timeout(ilist) = NoTimeout; XmI18List_working_row(ilist) = -1; XmI18List_end(ilist) = XmI18List_anchor(ilist) = NO_SELECTION; XmI18List_time(ilist) = 0L; XmI18List_search_column(ilist) = -1; if (XmI18List_font_list(ilist) == NULL) XmI18List_font_list(ilist) = XmeGetDefaultRenderTable(set, XmTEXT_FONTLIST); CopyColumnTitles(ilist); if (XmI18List_v_bar(ilist) != NULL) { XtAddCallback(XmI18List_v_bar(ilist), XmNvalueChangedCallback, VScrollCallback, (XtPointer) set); XtAddCallback(XmI18List_v_bar(ilist), XmNdragCallback, VScrollCallback, (XtPointer) set); } if (XmI18List_h_bar(ilist) != NULL) { XtAddCallback(XmI18List_h_bar(ilist), XmNvalueChangedCallback, HScrollCallback, (XtPointer) set); XtAddCallback(XmI18List_h_bar(ilist), XmNdragCallback, HScrollCallback, (XtPointer) set); } /* * Add the callbacks to handle left and right arrow selection */ if (XmI18List_h_bar(ilist) != NULL) XtAddCallback(XmI18List_h_bar(ilist), XmNdecrementCallback, HSlideLeftArrowCallback, (XtPointer) set); if (XmI18List_h_bar(ilist) != NULL) XtAddCallback(XmI18List_h_bar(ilist), XmNincrementCallback, HSlideRightArrowCallback, (XtPointer) set); if (XtHeight(req) == 0) { SetVisibleSize(set, (XtWidth(req) == 0)); } /* If layout_direction is set, it overrides string_direction. * If string_direction is set, but not layout_direction, use * string_direction value. * If neither is set, get from parent */ if (XmPrim_layout_direction(ilist) != XmDEFAULT_DIRECTION) { XmI18List_string_direction(ilist) = XmDirectionToStringDirection(XmPrim_layout_direction(ilist)); } else if (XmI18List_string_direction(ilist) != XmDEFAULT_DIRECTION) { XmPrim_layout_direction(ilist) = XmStringDirectionToDirection(XmI18List_string_direction(ilist)); } else { XmPrim_layout_direction(ilist) = _XmGetLayoutDirection(XtParent(set)); XmI18List_string_direction(ilist) = XmDirectionToStringDirection(XmPrim_layout_direction(ilist)); } if (!XmRepTypeValidValue(XmRID_STRING_DIRECTION, XmI18List_string_direction(ilist), set)) { XmI18List_string_direction(ilist) = XmSTRING_DIRECTION_L_TO_R; } } /* Function Name: Realize * Description: Called to realize this widget. * Arguments: w - Extended List Widget to realize. * valueMask, attributes - attributes to use when creating * this widget's window. * Returns: none. * * This overrides the Manager's frobbing with various values. */ static void Realize(Widget w, Mask *valueMask, XSetWindowAttributes * attributes) { XmI18ListWidget ilist = (XmI18ListWidget)w; attributes->bit_gravity = ForgetGravity; *valueMask |= CWBitGravity; CreateGCs(w); SortList(w, False); CalcColumnInfo(w, False); /* get initial left location based on first column resource */ /* have to calculate it because the columns are different widths */ AdjustFirstRowAndCol( ilist ); { XtRealizeProc realize; _XmProcessLock(); realize = xmI18ListWidgetClass->core_class.superclass->core_class.realize; _XmProcessUnlock(); (*realize) (w, valueMask, attributes); } { XtWidgetProc resize; _XmProcessLock(); resize = xmI18ListWidgetClass->core_class.resize; _XmProcessUnlock(); (*resize)(w); } } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none * * NOTE: No provision is made for SetValues on the mini-icons. * * Modified: 03/17/92 beth - converted to pixels */ /*ARGSUSED*/ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmI18ListWidget i_old = (XmI18ListWidget)current; XmI18ListWidget i_set = (XmI18ListWidget)set; register int i; Boolean redisplay = False; Boolean recalculate = False; Boolean resort = False; Boolean refreshGCs = False; Boolean readjust = False; Boolean check_pos = False; Boolean copyTitles = False; for (i = 0; i < *num_args; i++) { String name = args[i].name; if (streq(XmNcolumnTitles, name)) { copyTitles = True; redisplay = recalculate = XtIsRealized(set); } if (streq(XmNentryData, name)) { redisplay = recalculate = resort = XtIsRealized(set); } if (streq(XmNsortFunctions, name)) { redisplay = resort = XtIsRealized(set); } if (streq(XmNfirstRow, name) || streq(XmNfirstColumn,name)) { check_pos = True; } if (streq(XmNnumRows, name)) { check_pos = True; /* int num_rows = (XmI18List_num_rows(i_set) - XmI18List_visible_rows(i_set)); check_pos = (XmI18List_first_row(i_set) > ((num_rows < 0) ? 0 : num_rows)); */ } } if ((XmI18List_v_bar(i_set) != XmI18List_v_bar(i_old)) || (XmI18List_h_bar(i_set) != XmI18List_h_bar(i_old))) { XmI18List_v_bar(i_set) = XmI18List_v_bar(i_old); XmI18List_h_bar(i_set) = XmI18List_h_bar(i_old); XmeWarning(current, XmNstaticScrollbarsMsg); } if( XtIsSensitive(current) != XtIsSensitive(set) ) { redisplay = XtIsRealized(set); } if (XmI18List_font_list(i_set) != XmI18List_font_list(i_old)) { refreshGCs = recalculate = redisplay = XtIsRealized(set); } if ((i_set->primitive.foreground != i_old->primitive.foreground) || (i_set->core.background_pixel != i_old->core.background_pixel)) { refreshGCs = redisplay = XtIsRealized(set); } if (XmI18List_selected_header(i_set) != XmI18List_selected_header(i_old)) { resort = redisplay = XtIsRealized(set); } /* XmNvisibleItemCount has been changed... */ if (XmI18List_visible_rows(i_set) != XmI18List_visible_rows(i_old)) { if (XmI18List_visible_rows(i_set) < 1) { XmI18List_visible_rows(i_set) = 1; /* reset value to 1 */ XmeWarning(current, XmNforceGreaterThanZeroMsg); } /* Change height only... */ SetVisibleSize(set, False); } /* * Convert the user desired column to view to pixels * if and only if the entry Data has been specified */ if ( XmI18List_row_data(i_set) != NULL || XmI18List_row_data(i_old) != NULL ) { #ifdef UNUSED_CODE short column; if (XmI18List_first_col(i_set) > XmI18List_num_columns(i_set)) { column = XmI18List_num_columns(i_set) - 1; } else if (XmI18List_first_col(i_set) <= 0) { column = 0; } else { column = XmI18List_first_col(i_set) - 1; } #endif if ((XmI18List_num_rows(i_old) != XmI18List_num_rows(i_set)) || (XmI18List_num_columns(i_old) != XmI18List_num_columns(i_set)) || (XmI18List_row_data(i_set) != XmI18List_row_data(i_old))) { redisplay = recalculate = XtIsRealized(set); } if ((XmI18List_first_col(i_set) != XmI18List_first_col(i_old)) || (XmI18List_first_row(i_set) != XmI18List_first_row(i_old)) || check_pos) { redisplay = readjust = XtIsRealized(set); } } if (XmI18List_entry_background_pixel(i_set) != XmI18List_entry_background_pixel(i_old)) { /* it was explicitly set via XtSetValues, so the user knows about it */ XmI18List_entry_background_use(i_set) = True; redisplay = True; refreshGCs = True; } if (refreshGCs) { DestroyGCs(current); CreateGCs(set); } if (XmI18List_num_columns(i_old) != XmI18List_num_columns(i_set)) { /* CR03506 */ recalculate = redisplay = XtIsRealized(set); } if (copyTitles) { FreeColumnTitles(i_old); CopyColumnTitles(i_set); } if (readjust && !recalculate) { AdjustFirstRowAndCol(i_set); } else if (recalculate) { CalcColumnInfo(set, True); CalcLocations(set); if (!readjust) AdjustFirstCol(set); else AdjustFirstRowAndCol( i_set ); } if (resort) SortList(set, False); return(redisplay); } /* Function Name: Redisplay * Description: This function redraws the list contents. * Arguments: w - the Frame Widget widget. * event - event that caused the exposure. * region - the region containing all the exposures. * Returns: none * * Modified: 03/17/92 beth - converted to pixels */ /*ARGSUSED*/ static void Redisplay(Widget w, XEvent * event, Region region) { XmI18ListWidget ilist = (XmI18ListWidget) w; short num_rows; #ifdef notdef XExposeEvent * exp_event = (XExposeEvent *) &(event->xexpose); #endif num_rows = XmI18List_num_rows(ilist) - XmI18List_first_row(ilist); /* * Just refresh the entire window each time. */ DisplayList(w, XmI18List_first_row(ilist), num_rows, TRUE); ResizeSliders( w ); DrawSeparator(w); } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - Extended List Widget to realize. * Returns: none. */ static void Resize(Widget w) { if (!XtIsRealized(w)) return; CalcLocations(w); AdjustFirstCol(w); ResizeSliders(w); } /* Function Name: Destroy * Description: Cleans up after the widget. * Arguments: w - the widget. * Returns: none. */ static void Destroy(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; DestroyGCs(w); FreeColumnTitles(ilist); XtFree((XtPointer) XmI18List_column_widths(ilist)); } /************************************************************ * * Callbacks and Action Routines. * ************************************************************/ /************************************************************ * * This Selection code is pretty confusing, but here's the skinny. * * When the first button click comes in we call the single click * call back and remember when it happened. * * If a second click comes we see if multi click time has passed and if * not then we have a double click and should call the proper callback. * * If we move out of the current row then reset the stored time to zero since * we should not call the double click callback. * * The single click timeout takes care of initializing the extended * select code. We know it will be executed before the motion callback * ever does anything interesting because of the action defined in the * previous paragraph. * ************************************************************/ /* Function Name: ButtonDownAction * Description: Called when the user sends a button up to the ilist. * Arguments: w - the ilist widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ButtonDownAction(Widget w, XEvent *event, String *params, Cardinal *num_params) { short row, col; XmI18ListWidget ilist = (XmI18ListWidget) w; XButtonEvent * bevent = (XButtonEvent *) event; if (*num_params > 1) { XmeWarning(w, XmNbadMotionParamsMsg); return; } if (XmI18List_selection_policy(ilist) != XmSINGLE_SELECT) { XmI18List_state(ilist) &= ~(EXTEND | TOGGLE); /* remove these bits.*/ if (*num_params == 1) { switch (params[0][0]) { case 'e': case 'E': XmI18List_state(ilist) |= EXTEND; /* set extended mode. */ break; case 't': case 'T': XmI18List_state(ilist) |= TOGGLE; /* set extended mode. */ break; default: { _XmWarningMsg(w, XmNbadActionParameters, XmNbadActionParametersMsg, params, 1); } } } } if (event->type != ButtonPress) { static String params[] = { "BtnDown" }; _XmWarningMsg(w, XmNunexpectedEvent, XmNunexpectedEventMsg, params, 1); return; } CvtPositionToRowColumn(w, bevent->x, bevent->y, &row, &col); if (XmI18List_working_row(ilist) != row) { /* * This click not in the same row as the previous one, reset time to * zero so that double click will not fire. */ XmI18List_time(ilist) = 0; } XmI18List_working_row(ilist) = row; XmI18List_working_col(ilist) = col; /* * Invalid row. */ if ((col >= XmI18List_num_columns(ilist)) || (row >= XmI18List_num_rows(ilist))) { XBell(XtDisplay(w), 0); return; } /* * Click in the column headers. No need to deal with double clicks * or extended selections. */ if (XmI18List_working_row(ilist) == IN_COLUMN_HEADER) { SelectHeader((Widget) ilist, XmI18List_working_col(ilist)); return; } else /* reset search column since user selected a new row */ XmI18List_search_column(ilist) = -1; if ((event->xbutton.time - XmI18List_time(ilist)) > XtGetMultiClickTime(XtDisplay(w))) { SingleClick(ilist); } } /* Function Name: ButtonUpOrLeaveAction * Description: Called when the user sends a button up to the ilist. * Arguments: w - the ilist widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ButtonUpOrLeaveAction(Widget w, XEvent *event, String *params, Cardinal *num_params) { Boolean notify_type; XmI18ListWidget ilist = (XmI18ListWidget) w; if (event->type != ButtonRelease) { static String params[] = { "BtnUp or BtnLeave" }; _XmWarningMsg(w, XmNunexpectedEvent, XmNunexpectedEventMsg, params, 1); return; } /* * Invalid row started selection. */ if ((XmI18List_working_col(ilist) >= XmI18List_num_columns(ilist)) || (XmI18List_working_row(ilist) >= XmI18List_num_rows(ilist))) { return; } /* * Click in a row, need to handle double click. * notify_type == True specifies double click, False is a single click. */ notify_type = ((event->xbutton.time - XmI18List_time(ilist)) <= XtGetMultiClickTime(XtDisplay(w))); Notify(w, notify_type); XmI18List_time(ilist) = event->xbutton.time; /* * Reset all these flags. */ XmI18List_state(ilist) &= ~OUTSIDE_WIDGET; } /* Function Name: MotionAction * Description: Called when the user sends a button up to the ilist. * Arguments: w - the ilist widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void MotionAction(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmI18ListWidget ilist = (XmI18ListWidget) w; XButtonEvent * bevent = (XButtonEvent *) event; short row, col; short y = bevent->y; /* * Invalid row to start selection. */ if ((XmI18List_working_col(ilist) >= XmI18List_num_columns(ilist)) || (XmI18List_working_row(ilist) >= XmI18List_num_rows(ilist))) { return; } if (XmI18List_selection_policy(ilist) == XmSINGLE_SELECT) return; /* Do nothing here... */ CvtPositionToRowColumn(w, bevent->x, y, &row, &col); /* * We have not moved to a new row, or we started in the headers then * do nothing. */ if ((row == XmI18List_working_row(ilist)) || (XmI18List_working_row(ilist) == IN_COLUMN_HEADER)) { return; } /* * Begin reporting motion events. */ if (y < 0) { if (XmI18List_state(ilist) & OFF_TOP) return; /* We are already off the top. */ else XmI18List_state(ilist) |= OFF_TOP; } else XmI18List_state(ilist) &= ~OFF_TOP; /* remove this flag. */ if (y > ((short) w->core.height)) { if (XmI18List_state(ilist) & OFF_BOTTOM) return; /* We are already off the bottom. */ else XmI18List_state(ilist) |= OFF_BOTTOM; } else XmI18List_state(ilist) &= ~OFF_BOTTOM; /* remove this flag. */ if (!(XmI18List_state(ilist) & OUTSIDE_WIDGET)) { /* Not outside widget.*/ if (XmI18List_timeout(ilist) != NoTimeout) { (void) XtRemoveTimeOut(XmI18List_timeout(ilist)); XmI18List_timeout(ilist) = NoTimeout; /* CR03695 */ } ExtendedSelect(w, row); XmI18List_working_row(ilist) = NO_SELECTION; /* set to nothing... */ return; } XmI18List_timeout(ilist) = XtAppAddTimeOut(XtWidgetToApplicationContext(w), DELAY_TIME(w), MoveListTimeout, (XtPointer) w); } /* Function Name: SingleClick * Description: Called to process the single click. * Arguments: ilist - the ilist widget. * Returns: none. */ /*ARGSUSED*/ static void SingleClick(XmI18ListWidget ilist) { if (XmI18List_selection_policy(ilist) == XmSINGLE_SELECT) { /* * Unselect all rows except the working row. */ UnselectRows((Widget) ilist, XmI18List_working_row(ilist)); } else { register short i, last; XmMultiListRowInfo * ptr; last = XmI18List_num_rows(ilist); if (!(XmI18List_state(ilist) & EXTEND)) { XmI18List_end(ilist) = XmI18List_anchor(ilist) = XmI18List_working_row(ilist); if (XmI18List_state(ilist) & TOGGLE) ToggleRow((Widget) ilist, XmI18List_working_row(ilist)); else /* !EXTEND and !TOGGLE */ UnselectRows((Widget) ilist, XmI18List_working_row(ilist)); for (ptr = XmI18List_row_data(ilist), i = 0; i < last; i++, ptr++) ptr->old_sel_state = ptr->selected; } else { short l_first, l_last; if (XmI18List_anchor(ilist) == NO_SELECTION) return; if (XmI18List_end(ilist) < XmI18List_anchor(ilist)) { l_first = XmI18List_end(ilist); l_last = XmI18List_anchor(ilist); } else { l_first = XmI18List_anchor(ilist); l_last = XmI18List_end(ilist); } for (ptr = XmI18List_row_data(ilist), i = 0; i < last; i++, ptr++) { if ((i >= l_first) && (i <= l_last)) ptr->old_sel_state = FALSE; else ptr->old_sel_state = ptr->selected; } if (XmI18List_state(ilist) & EXTEND) ExtendedSelect((Widget) ilist, XmI18List_working_row(ilist)); } } } /* Function Name: MoveListTimeout * Description: Called when enough time passes so that we know it * is time to move the list. * Arguments: w_ptr - the ilist widget. * id - the interval id. * Returns: none. */ /*ARGSUSED*/ static void MoveListTimeout(XtPointer w_ptr, XtIntervalId *id) { short row; int v_inc = 0; Widget w = (Widget) w_ptr; XmI18ListWidget ilist = (XmI18ListWidget) w; if (XmI18List_state(ilist) & OFF_TOP) { /* * Scroll up if top row is not on screen. */ if ((IsRowVisible(w, 0)) != 0) v_inc = -1; } if (XmI18List_state(ilist) & OFF_BOTTOM) { /* * Scroll up if last row is not on screen. */ if ((IsRowVisible(w, XmI18List_num_rows(ilist) - 1)) != 0) v_inc = 1; } if (v_inc == 0) { XmI18List_timeout(ilist) = NoTimeout; /* CR03695 */ return; } VScroll(w, v_inc); ResizeSliders(w); /* Reset the sliders on my scrollbars. */ /* * Get new end point (first or last row on screen). */ if (v_inc < 0) row = XmI18List_first_row(ilist); else { register int i; register int row_height = XmI18List_row_height(ilist); register Dimension h, height = w->core.height; i = XmI18List_first_row(ilist); h = (XmI18List_sep_y(ilist) + VERTICAL_SPACE/2); if(XmI18List_new_visual_style(ilist)) h += ilist->primitive.shadow_thickness; else h += LINE_HEIGHT; /* * This used to be: * for (; h < height; h += row_height, i++) {} * * ... sigh ... */ while(h < height) { h += row_height; i++; } i--; if (i > (XmI18List_num_rows(ilist) - 1)) row = XmI18List_num_rows(ilist) - 1; else row = i; } ExtendedSelect(w, row); /* * And we can do it again... */ XmI18List_timeout(ilist) = XtAppAddTimeOut(XtWidgetToApplicationContext(w), DELAY_TIME(w), MoveListTimeout, (XtPointer) w); } /* Function Name: Notify * Description: Calls the callbacks when a notify should happen. * Arguments: w - the ilist widget. * dclick - is this a double click? * Returns: none. */ static void Notify(Widget w, Boolean dclick) { XmI18ListWidget ilist = (XmI18ListWidget) w; Boolean first = True; static XrmQuark elist_q; int row; if (first) { elist_q = XrmStringToQuark(XM_EXT_18_LIST_CLASS_NAME); first = False; } row = (int) XmI18List_working_row(ilist); /* * If we didn't click on a row, don't call the callbacks */ if(row == IN_COLUMN_HEADER) return; if( (row < XmI18List_num_rows(ilist)) && (XmI18List_working_col(ilist) < XmI18List_num_columns(ilist)) ) { Widget elist = XtParent(XtParent(w)); XtPointer cbdata; if(row >= 0) cbdata = (XtPointer) &(XmI18List_row_data(ilist)[row]); else cbdata = NULL; /* * If my parent is an extended list, then call all callbacks * on its callback list. * * This is a hack to get around a toolkit specification bug. * * Chris D. Peterson (11/25/90) */ if( dclick ) { if( _XmUtilIsSubclassByNameQ(elist, elist_q) ) { XtCallCallbacks(elist, XmNdoubleClickCallback, cbdata); } XtCallCallbackList(w, XmI18List_double_click(ilist), cbdata); } else /* Is Single notify */ { if( _XmUtilIsSubclassByNameQ(elist, elist_q) ) { XtCallCallbacks(elist, XmNsingleSelectionCallback, cbdata); } XtCallCallbackList( w, XmI18List_single_select(ilist), cbdata); } } } /************************************************************ * * Internal routines. * ************************************************************/ /* Function Name: GetListWidth * Description: determines total width of data in list * Arguments: w - Extended List Widget * Returns: total width of data in list */ static short GetListWidth(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; register int i, width; /* * Get maximum width of data to display */ width = HORIZONTAL_SPACE; for (i=0; i < XmI18List_num_columns(ilist); i++) width += XmI18List_column_widths(ilist)[i] + HORIZONTAL_SPACE; return((short) width); } /* Function Name: AdjustFirstCol * Description: Called when this widget has been resized. * Arguments: w - Extended List Widget to realize. * Returns: none. */ static void AdjustFirstCol(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; register int i, extra, width; /* * Determine if the first pixel position is negative or positive */ if ((0 - XmI18List_left_loc(ilist)) >= 0) i = 0 - XmI18List_left_loc(ilist); else i = XmI18List_left_loc(ilist); /* * If the current pixel position (signed positive) plus the core * width of the list is greater than the whole width of the data * being displayed, then we need to adjust the first pixel position */ width = GetListWidth((Widget) ilist); extra = width - (ilist->core.width + i); if (extra < 0) XmI18List_left_loc(ilist) = 0 - (i + extra); } /* Function Name: ExtendedSelect * Description: Handle the extended selection. * Arguments: w - the ilist widget. * row - current row. * extend - extend the selection. * Returns: none */ static void ExtendedSelect(Widget w, short row) { XmI18ListWidget ilist = (XmI18ListWidget) w; register short i, first, last, end, anchor, out_first, out_last; Boolean state; XmMultiListRowInfo * ptr; if (row >= XmI18List_num_rows(ilist)) row = XmI18List_num_rows(ilist) - 1; else if (row < 0) row = 0; end = XmI18List_end(ilist); /* The old non-anchor end point. */ anchor = XmI18List_anchor(ilist); XmI18List_end(ilist) = row; /* New non-anchor end point. */ state = (XmI18List_row_data(ilist) + anchor)->selected; if (XmI18List_anchor(ilist) < end) { out_first = anchor; out_last = end; } else { out_first = end; out_last = anchor; } if (row < out_first) { first = row; last = out_last; out_first = out_last + 1; /* nothing removed from list. */ } else if (row > out_last) { first = out_first; last = row; out_first = out_last + 1; /* nothing removed from list. */ } else { /* between first and last. */ if (out_first == anchor) { first = out_first; last = row; out_first = row + 1; } else { out_last = row - 1; first = row; last = out_last; } } /* * Handle the case of a jump from one side of the anchor to the other. */ if (((end > anchor) && (row < anchor)) || ((end < anchor) && (row > anchor))) { register short t_first, t_last; if ((end > anchor) && (row < anchor)) { t_first = anchor + 1; t_last = end; last = anchor; } else { /* (end < anchor) && (row > anchor) */ first = anchor; t_first = end; t_last = anchor - 1; } /* * Reset all these nodes to their previous state. */ ptr = XmI18List_row_data(ilist) + t_first; for (i = t_first; i <= t_last; i++, ptr++) if (ptr->old_sel_state != ptr->selected) ToggleRow(w, i); } /* * Set all these nodes to the same state as the anchor. */ for (ptr = XmI18List_row_data(ilist) + first,i = first; i <= last;i++, ptr++) if (ptr->selected != state) ToggleRow(w, i); /* * Reset all these nodes to their previous state. */ ptr = XmI18List_row_data(ilist) + out_first; for (i = out_first; i <= out_last;i++, ptr++) { if (ptr->old_sel_state != ptr->selected) ToggleRow(w, i); } } /* Function Name: VScrollCallback * Description: Called by the vert. scrollbar when it has been selected * by the user. * Arguments: w - the scrollbar widget. * client_data - the ilist widget. * call_data - information about where to scroll. * Returns: none */ /*ARGSUSED*/ static void VScrollCallback(Widget w, XtPointer client_data, XtPointer call_data) { XmI18ListWidget ilist = (XmI18ListWidget) client_data; XmScrollBarCallbackStruct * scroll_info; scroll_info = (XmScrollBarCallbackStruct *) call_data; VScroll((Widget) ilist, (short) (scroll_info->value - XmI18List_first_row(ilist))); } /* Function Name: HScrollCallback * Description: Called by the horiz. scrollbar when it * has been selected. * by the user. * Arguments: w - the scrollbar widget. * client_data - the ilist widget. * call_data - information about where to scroll. * Returns: none * * Modified: 03/17/92 beth - converted to pixels */ /*ARGSUSED*/ static void HScrollCallback(Widget w, XtPointer client_data, XtPointer call_data) { XmI18ListWidget ilist = (XmI18ListWidget) client_data; XmScrollBarCallbackStruct *scroll_info; scroll_info = (XmScrollBarCallbackStruct *) call_data; HScroll((Widget)ilist,(short) scroll_info->value); } /* Function Name: HSlideLeftArrowCallback * Description: handles repositioning of the window data according * to how long the user pressed on the left arrow * Arguments: w - the ilist widget. * client_data - the ilist widget. * junk - ***UNUSED*** * Returns: none * * Added: 03/19/92 beth - for conversion to pixels */ /*ARGSUSED*/ static void HSlideLeftArrowCallback(Widget w, XtPointer client_data, XtPointer junk) { XmI18ListWidget ilist = (XmI18ListWidget) client_data; /* * We are either going to left adjust the first visible column * so that the user is able to see the column beginning with the * first pixel or - if the first visible pixel is currently between * columns, then we will shift all columns once to the left, * thereby changing the first visible column. */ /* * Don't bother if we're already as far left as we can go */ if (XmI18List_left_loc(ilist) <= 0) { register int i, begin, end, before = 0; for (i=0; i < XmI18List_num_columns(ilist); i++) { if (i == 0) begin = before = XmI18List_left_loc(ilist); else begin = before + HORIZONTAL_SPACE; end = begin + XmI18List_column_widths(ilist)[i]; if (begin < 0 && end >= 0) { /* * Leftmost column column is partially visible * left adjust it including horizontal spacing */ XmI18List_left_loc(ilist) += 0 - before; break; } else if (begin >= 0 && i > 0) { /* * Shift Leftmost column to the right once */ XmI18List_left_loc(ilist) += 0 - before + HORIZONTAL_SPACE; XmI18List_left_loc(ilist) += XmI18List_column_widths(ilist)[i-1]; break; } before = end; } } else { XmI18List_left_loc(ilist) = 0; } XClearWindow(XtDisplay(ilist), XtWindow(ilist)); DisplayList((Widget) ilist, XmI18List_first_row(ilist), (XmI18List_num_rows(ilist) - XmI18List_first_row(ilist)), TRUE); DrawSeparator((Widget) ilist); ResizeSliders((Widget) ilist); } /* Function Name: HSlideRightArrowCallback * Description: handles repositioning of the window data according * to how long the user pressed on the right arrow * Arguments: w - the ilist widget. * client_data - the ilist widget. * junk - ***UNUSED*** * Returns: none * * Added: 03/19/92 beth - for conversion to pixels */ /*ARGSUSED*/ static void HSlideRightArrowCallback(Widget w, XtPointer client_data, XtPointer junk) { XmI18ListWidget ilist = (XmI18ListWidget) client_data; register int i, width; /* * We are either going to left adjust the last visible column * so that the user is able to see the column beginning with the * first pixel or the entire column - if the last visible pixel * is currently between columns, then we will shift all columns * once to the right, thereby changing the last visible column. */ if ((0 - XmI18List_left_loc(ilist)) >= 0) i = XmI18List_left_loc(ilist); else i = 0 - XmI18List_left_loc(ilist); /* * Don't bother if we're already as far right as we can go */ width = GetListWidth((Widget) ilist); if ((int)width > (int)(i + ilist->core.width)) { register int begin, end, before = 0; for (i=0; i < XmI18List_num_columns(ilist); i++) { if (i == 0) begin = before = XmI18List_left_loc(ilist); else begin = before + HORIZONTAL_SPACE; end = begin + XmI18List_column_widths(ilist)[i]; if ((begin < 0 && end > 0) || (begin >= 0 && i < XmI18List_num_columns(ilist))) { /* * Leftmost column is partially visible * make as much of it visible as possible */ if ((i + 1) == XmI18List_num_columns(ilist)) XmI18List_left_loc(ilist) = 0 - (width - ilist->core.width); else XmI18List_left_loc(ilist) -= end; break; } before = end; } } else { XmI18List_left_loc(ilist) = 0 - (width - ilist->core.width); } XClearWindow(XtDisplay(ilist), XtWindow(ilist)); DisplayList((Widget) ilist, XmI18List_first_row(ilist), (XmI18List_num_rows(ilist) - XmI18List_first_row(ilist)), TRUE); DrawSeparator((Widget) ilist); ResizeSliders((Widget) ilist); } /************************************************************ * * Local Code * ************************************************************/ /* Function Name: CalcLocations * Description: Calculates the locations of the text positions. * Arguments: w - the ext list widget. * Returns: none */ static void CalcLocations(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; if (XmI18List_num_columns(ilist) && XmI18List_column_titles(ilist)) /* CR03506 */ XmI18List_sep_y(ilist) = 2 * VERTICAL_SPACE + XmI18List_title_row_height(ilist); else XmI18List_sep_y(ilist) = 0; /* CR03506 */ if(XmI18List_new_visual_style(ilist)) XmI18List_sep_y(ilist) += ilist->primitive.shadow_thickness; } /* Function Name: DisplayList * Description: Displays the contents of the list. * Arguments: w - the extended list widget. * start_row - the first row to display * num_rows - the number of rows to display * redraw_headers - boolean flag for redrawing * Returns: none * * Modified: 03/17/92 beth - converted to pixels */ static void DisplayList(Widget w, short start_row, short num_rows, Boolean redraw_headers) { XmI18ListWidget ilist = (XmI18ListWidget) w; register int i, j, row_height, title_row_height, y_loc, x_loc; register Position cur_x=0, cur_y, start_y; register short *col_widths, tot_width; XmString ptr; GC gc; Dimension width_unused, text_height; Dimension height = ilist->core.height; Dimension width = ilist->core.width; register short end_row = start_row + num_rows - 1; /* * The start position is always first_col, which * should have been set to the correct value before * calling this routine */ if (XmI18List_left_loc(ilist) >= 0) XmI18List_left_loc(ilist) = HORIZONTAL_SPACE; if (LayoutIsRtoLP(w)) cur_x = width - XmI18List_left_loc(ilist); else cur_x = XmI18List_left_loc(ilist); col_widths = XmI18List_column_widths(ilist); tot_width = GetListWidth((Widget) ilist); /* * Find the row height. */ row_height = XmI18List_row_height(ilist) + VERTICAL_SPACE; title_row_height = XmI18List_title_row_height(ilist) + VERTICAL_SPACE; /* * Find the selected row, and draw in the select bar in the * background color. * * NOTE: this must draw exactly the same rectangle as InvertArea. */ cur_y = (XmI18List_sep_y(ilist) + VERTICAL_SPACE/2 + (start_row - XmI18List_first_row(ilist)) * row_height); if(XmI18List_new_visual_style(ilist)) { cur_y += ilist->primitive.shadow_thickness; } else { cur_y += LINE_HEIGHT; } if (XmI18List_entry_background_use(ilist)) { Dimension height = ilist->core.height; if(XmI18List_new_visual_style(ilist)) height -= ilist->primitive.shadow_thickness; else height -= LINE_HEIGHT; XFillRectangle(XtDisplay(w), XtWindow(w), XmI18List_entry_background_fill_gc(ilist), LayoutIsRtoLP(w) ? -tot_width + XtWidth(w) - XmI18List_left_loc(ilist) + HORIZONTAL_SPACE/2 : XmI18List_left_loc(ilist) - HORIZONTAL_SPACE/2, cur_y, #define MaX(a,b) (a>b?a:b) (unsigned int) MaX(w->core.width,tot_width), #undef MaX (unsigned int) height); } for (i = start_row ; i <= end_row ; i++) { if (XmI18List_row_data(ilist)[i].selected) { XFillRectangle(XtDisplay(w), XtWindow(w), XmI18List_gc(ilist), LayoutIsRtoLP(w) ? -tot_width + XtWidth(w) - XmI18List_left_loc(ilist) + HORIZONTAL_SPACE/2 : XmI18List_left_loc(ilist) - HORIZONTAL_SPACE/2, cur_y, (unsigned int) tot_width, (unsigned int) row_height); } cur_y += row_height; } start_y = ((XmI18List_sep_y(ilist) + VERTICAL_SPACE) + (start_row - XmI18List_first_row(ilist)) * row_height); if(XmI18List_new_visual_style(ilist)) { start_y += ilist->primitive.shadow_thickness; } else { start_y += LINE_HEIGHT; } /* * Draw in the Text and icons. */ for (i = 0; i < XmI18List_num_columns(ilist); i++) { GC entry_gc; if (LayoutIsRtoLP(w)) { if (cur_x < 0) return; else cur_x -= col_widths[i]; } else { if (cur_x > (int) width) return; } if (redraw_headers) { /* * Paint the Column Header */ if ((XmI18List_selected_header(ilist) == i) && (XmI18List_sort_functions(ilist) != NULL)) { if (XtIsSensitive(w)) gc = XmI18List_rev_gc(ilist); else gc = XmI18List_stippled_rev_gc(ilist); y_loc = VERTICAL_SPACE/2; x_loc = cur_x - HORIZONTAL_SPACE/2; XFillRectangle(XtDisplay(w), XtWindow(w), XmI18List_gc(ilist), x_loc, y_loc, (unsigned int) col_widths[i] + HORIZONTAL_SPACE, (unsigned int) title_row_height); } else { if (XtIsSensitive(w)) gc = XmI18List_gc(ilist); else gc = XmI18List_stippled_gc(ilist); } if (XmI18List_column_titles(ilist) != NULL) { ptr = XmI18List_column_titles(ilist)[i]; cur_y = VERTICAL_SPACE; if(XmI18List_new_visual_style(ilist)) cur_y += ilist->primitive.shadow_thickness; XmStringDraw(XtDisplay(w), XtWindow(w), XmI18List_font_list(ilist), ptr, gc, cur_x, cur_y, col_widths[i], XmI18List_alignment(ilist), XmPrim_layout_direction(ilist), NULL); } } /* * Put in the mini icons if this is column 0 and * first_col_pixmaps is true. */ if ( (XmI18List_first_col_pixmaps(ilist)) && (i == 0)) { int pix_y_offset; cur_y = XmI18List_sep_y(ilist) + VERTICAL_SPACE; if(XmI18List_new_visual_style(ilist)) cur_y += ilist->primitive.shadow_thickness; else cur_y += LINE_HEIGHT; for (j = start_row; j <= end_row; j++) { if (IsValidPixmap(XmI18List_row_data(ilist)[j].pixmap)) { if (XmI18List_row_data(ilist)[j].selected) entry_gc = XmI18List_entry_background_rev_gc(ilist); else entry_gc = XmI18List_entry_background_gc(ilist); /* * Copy it in. */ pix_y_offset = (row_height - XmI18List_row_data(ilist)[j].pix_height)/2; if (XmI18List_row_data(ilist)[j].pix_depth == 1 ){ XCopyPlane(XtDisplay(w), XmI18List_row_data(ilist)[j].pixmap, XtWindow(w), entry_gc, 0, 0, XmI18List_row_data(ilist)[j].pix_width, XmI18List_row_data(ilist)[j].pix_height, LayoutIsRtoLP(w) ? width - XmI18List_left_loc(ilist) - XmI18List_row_data(ilist)[j].pix_width : cur_x, cur_y+pix_y_offset, (unsigned long) 1); } else { XCopyArea(XtDisplay(w), XmI18List_row_data(ilist)[j].pixmap, XtWindow(w), entry_gc, 0, 0, XmI18List_row_data(ilist)[j].pix_width, XmI18List_row_data(ilist)[j].pix_height, LayoutIsRtoLP(w) ? width - XmI18List_left_loc(ilist) - XmI18List_row_data(ilist)[j].pix_width : cur_x, cur_y+pix_y_offset ); } } cur_y += row_height; if (cur_y > (int) height) break; } } else { /* * Draw in the row data. */ cur_y = start_y; for (j = start_row; j <= end_row; j++) { if (cur_y > (int) height) break; if (XtIsSensitive(w)) { if (XmI18List_row_data(ilist)[j].selected) entry_gc = XmI18List_entry_background_rev_gc(ilist); else entry_gc = XmI18List_entry_background_gc(ilist); } else { if (XmI18List_row_data(ilist)[j].selected) entry_gc = XmI18List_entry_background_stippled_rev_gc(ilist); else entry_gc = XmI18List_entry_background_stippled_gc(ilist); } ptr = XmI18List_row_data(ilist)[j].values[i]; XmStringExtent(XmI18List_font_list(ilist), ptr, &width_unused, &text_height); /* to center each string within its row */ cur_y += (int)(XmI18List_row_height(ilist) - VERTICAL_SPACE - text_height)/2; XmStringDraw(XtDisplay(w), XtWindow(w), XmI18List_font_list(ilist), ptr, entry_gc, cur_x, cur_y, col_widths[i], XmI18List_alignment(ilist), XmPrim_layout_direction(ilist), NULL); cur_y -= (int)(XmI18List_row_height(ilist) - VERTICAL_SPACE - text_height)/2; cur_y += XmI18List_row_height(ilist) + VERTICAL_SPACE; } } if (LayoutIsRtoLP(w)) cur_x -= HORIZONTAL_SPACE; else cur_x += HORIZONTAL_SPACE + col_widths[i]; } } /* Function Name: DrawSeparator * Description: Draws the line that separates the titles form the * list elements. * Arguments: w - the ilist widget. * Returns: none. */ static void DrawSeparator(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; unsigned int width = ilist->core.width; unsigned int height = XmI18List_sep_y(ilist); GC gc; if (!XmI18List_num_columns(ilist) || !XmI18List_column_titles(ilist)) return; /* CR03506 */ if(XmI18List_new_visual_style(ilist)) { XmeDrawShadows(XtDisplay(w), XtWindow(w), ilist->primitive.top_shadow_GC, ilist->primitive.bottom_shadow_GC, 0, 0, width, height + ilist->primitive.shadow_thickness, ilist->primitive.shadow_thickness, XmSHADOW_OUT); } else { if (XtIsSensitive(w)) gc = XmI18List_gc(ilist); else gc = XmI18List_stippled_gc(ilist); XFillRectangle(XtDisplay(w), XtWindow(w), gc, 0, XmI18List_sep_y(ilist), width, LINE_HEIGHT); } } /* Function Name: CreateGCs * Description: Creates the Graphics contexts. * Arguments: w - the ext list widget. * Returns: none. */ /* Always create the entry_background GCs and always use them, but their ** values may be different depending on whether or not to use the pixel ** (and may be identical to the regular GCs). We don't need new GCs for ** operations that don't use patterning or that don't use the background ** e.g. text/string draw operations. */ static void CreateGCs(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; XtGCMask mask, smask; XGCValues values; Arg args[2]; Cardinal num_args = 0; Pixel temp; Pixmap stipple; XFontStruct *font; stipple = XCreateBitmapFromData(XtDisplay(w), RootWindowOfScreen(XtScreen(w)), gray_bits, gray_width, gray_height); XtSetArg(args[num_args], XmNforeground, &(values.foreground)); num_args++; XtSetArg(args[num_args], XmNbackground, &(values.background)); num_args++; XtGetValues(w, args, num_args); XmeRenderTableGetDefaultFont (XmI18List_font_list(ilist), &font); values.font = font->fid; values.stipple = stipple; values.fill_style = FillStippled; values.graphics_exposures = False; mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; #ifdef FIX_1381 smask = mask | GCFillStyle; #else smask = mask | GCStipple | GCFillStyle; #endif XmI18List_gc(ilist) = XtGetGC(w, mask, &values); if (XmI18List_entry_background_use(ilist)) { Pixel cache_foreground = values.foreground; values.foreground = XmI18List_entry_background_pixel(ilist); XmI18List_entry_background_fill_gc(ilist) = XtGetGC(w, mask, &values); values.foreground = cache_foreground; } else { /* same as XmI18List_gc */ /* not really used in this case */ XmI18List_entry_background_fill_gc(ilist) = XtGetGC(w, mask, &values); } if (XmI18List_entry_background_use(ilist)) { Pixel cache_background = values.background; values.background = XmI18List_entry_background_pixel(ilist); XmI18List_entry_background_gc(ilist) = XtGetGC(w, mask, &values); values.background = cache_background; } else { /* same as XmI18List_gc */ XmI18List_entry_background_gc(ilist) = XtGetGC(w, mask, &values); } #ifdef FIX_1381 /*added for gray insensitive foreground (instead stipple)*/ temp = values.foreground; values.foreground=_XmAssignInsensitiveColor(w); #endif XmI18List_stippled_gc(ilist) = XtGetGC(w, smask, &values); if (XmI18List_entry_background_use(ilist)) { Pixel cache_background = values.background; values.background = XmI18List_entry_background_pixel(ilist); XmI18List_entry_background_stippled_gc(ilist) = XtGetGC(w, smask, &values); values.background = cache_background; } else { /* same as XmI18List_stippled_gc */ XmI18List_entry_background_stippled_gc(ilist) = XtGetGC(w, smask, &values); } #ifndef FIX_1381 temp = values.foreground; #endif values.foreground = values.background; values.background = temp; XmI18List_rev_gc(ilist) = XtGetGC(w, mask, &values); if (XmI18List_entry_background_use(ilist)) { Pixel cache_foreground = values.foreground; values.foreground = XmI18List_entry_background_pixel(ilist); XmI18List_entry_background_rev_gc(ilist) = XtGetGC(w, mask, &values); values.foreground = cache_foreground; } else { /* same as XmI18List_rev_gc */ XmI18List_entry_background_rev_gc(ilist) = XtGetGC(w, mask, &values); } XmI18List_stippled_rev_gc(ilist) = XtGetGC(w, smask, &values); if (XmI18List_entry_background_use(ilist)) { Pixel cache_background = values.background; values.background = XmI18List_entry_background_pixel(ilist); XmI18List_entry_background_stippled_rev_gc(ilist) = XtGetGC(w, smask, &values); values.background = cache_background; } else { /* same as XmI18List_stippled_rev_gc */ XmI18List_entry_background_stippled_rev_gc(ilist) = XtGetGC(w, smask, &values); } values.foreground ^= values.background; values.function = GXxor; mask = GCForeground | GCFunction; XmI18List_inv_gc(ilist) = XtGetGC(w, mask, &values); if (XmI18List_entry_background_use(ilist)) { /* last one; we can skip caching */ /* Pixel cache_foreground = values.foreground; */ /* Pixel cache_background = values.background; */ values.foreground = XmI18List_entry_background_pixel(ilist); values.foreground ^= values.background; XmI18List_entry_background_inv_gc(ilist) = XtGetGC(w, mask, &values); /* values.background = cache_background; */ /* values.foreground = cache_foreground; */ } else { /* same as XmI18List_inv_gc */ XmI18List_entry_background_inv_gc(ilist) = XtGetGC(w, mask, &values); } XFreePixmap(XtDisplay(w), stipple); } /* Function Name: DestroyGCs * Description: Destroys all GC's needed by the list. * Arguments: w - the ilist widget. * Returns: none. */ static void DestroyGCs(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; XtReleaseGC(w, XmI18List_gc(ilist)); XtReleaseGC(w, XmI18List_rev_gc(ilist)); XtReleaseGC(w, XmI18List_stippled_gc(ilist)); XtReleaseGC(w, XmI18List_stippled_rev_gc(ilist)); XtReleaseGC(w, XmI18List_inv_gc(ilist)); XtReleaseGC(w, XmI18List_entry_background_gc(ilist)); XtReleaseGC(w, XmI18List_entry_background_fill_gc(ilist)); XtReleaseGC(w, XmI18List_entry_background_stippled_gc(ilist)); XtReleaseGC(w, XmI18List_entry_background_stippled_rev_gc(ilist)); XtReleaseGC(w, XmI18List_entry_background_inv_gc(ilist)); XtReleaseGC(w, XmI18List_entry_background_rev_gc(ilist)); } /* Function Name: GetPixmapInfo * Description: Gets the information about each pixmap. * Arguments: w - the ilist widget. * Returns: none */ static void GetPixmapInfo(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; register int i, num_rows = XmI18List_num_rows(ilist); for (i = 0; i < num_rows; i++) { int x, y; unsigned int width, height, bw, depth; Window root; width = height = depth = 0; if (IsValidPixmap(XmI18List_row_data(ilist)[i].pixmap)) { XGetGeometry(XtDisplay(w), XmI18List_row_data(ilist)[i].pixmap, &root, &x, &y, &width, &height, &bw, &depth); } XmI18List_row_data(ilist)[i].pix_width = width; XmI18List_row_data(ilist)[i].pix_height = height; XmI18List_row_data(ilist)[i].pix_depth = depth; } } /* Function Name: SetVisibleSize * Description: Calculates and sets list height (& optionally width) * Arguments: w - the ilist widget. * set_width - if true, set width * Returns: none */ static void SetVisibleSize(Widget w, Boolean set_width) { XmI18ListWidget ilist = (XmI18ListWidget) w; Dimension title_height; int height; CalcColumnInfo(w, True); title_height = 2 * VERTICAL_SPACE + XmI18List_title_row_height(ilist); if(XmI18List_new_visual_style(ilist)) title_height += ilist->primitive.shadow_thickness; else title_height += LINE_HEIGHT; /* If we have no rows, guess at row size with font struct info... */ if (XmI18List_num_rows(ilist) == 0) { #if USE_XFT XmRenderTableGetDefaultFontExtents(XmI18List_font_list(ilist), &height, NULL, NULL); if (height == 0) height = VERTICAL_SPACE * XmI18List_visible_rows(ilist); #else XFontStruct *font = (XFontStruct *) NULL; XmeRenderTableGetDefaultFont(XmI18List_font_list(ilist), &font); if (font) height = (font->ascent + font->descent + VERTICAL_SPACE) * XmI18List_visible_rows(ilist); else height = VERTICAL_SPACE * XmI18List_visible_rows(ilist); #endif } else { height = (XmI18List_row_height(ilist) + VERTICAL_SPACE) * XmI18List_visible_rows(ilist); } /* Go ahead and set the widget's height resource... */ ilist->core.height = title_height + height + VERTICAL_SPACE; if (set_width) ilist->core.width = GetListWidth(w); } /* Function Name: CalcColumnInfo * Description: Calculates the layout info for the columns. * Arguments: w - the ilist widget. * Returns: none */ static void CalcColumnInfo(Widget w, Boolean force) { XmI18ListWidget ilist = (XmI18ListWidget) w; register int i, j; int max_width = 0, max_title_height = 0, max_height = 0; Dimension width, height; XmString ptr; register int num_cols = XmI18List_num_columns(ilist); register int num_rows = XmI18List_num_rows(ilist); if (XmI18List_first_col_pixmaps(ilist)) GetPixmapInfo(w); if (((XmI18List_column_widths(ilist) == NULL) || force) && (num_cols != 0)) { if (force) XtFree((XtPointer) XmI18List_column_widths(ilist)); XmI18List_column_widths(ilist) = (short *) XtMalloc(sizeof(short) * num_cols); } for (i = 0 ; i < num_cols; i++) { if (XmI18List_column_titles(ilist) != NULL) { ptr = XmI18List_column_titles(ilist)[i]; XmStringExtent(XmI18List_font_list(ilist), ptr, &width, &height); /* the max height for the title row */ if ((int) height > max_title_height) max_title_height = height; /* find the max width for just this column */ max_width = width; } if (XmI18List_first_col_pixmaps(ilist) && (i == 0)) { for (j = 0 ; j < num_rows; j++) { if( (int)(height =XmI18List_row_data(ilist)[j].pix_height) > (int)max_height ) max_height = height; if ( (int)(width = XmI18List_row_data(ilist)[j].pix_width) > (int)max_width ) max_width = width; } } else { for (j = 0 ; j < num_rows; j++) { ptr = XmI18List_row_data(ilist)[j].values[i]; XmStringExtent(XmI18List_font_list(ilist), ptr, &width, &height); if ((int)width > (int)max_width) max_width = width; if ((int)height > (int)max_height) max_height = height; } } XmI18List_column_widths(ilist)[i] = max_width; } XmI18List_row_height(ilist) = max_height; if (XmI18List_num_columns(ilist) && XmI18List_column_titles(ilist)) /* CR03506 */ XmI18List_title_row_height(ilist) = max_title_height; else XmI18List_title_row_height(ilist) = 0; /* CR03506 */ } /* Function Name: ResizeSliders * Description: Resizes the thumbs of the v and h scrollbars. * Arguments: w - the ilist widget. * Returns: none * * Modified: 03/17/92 beth - converted to pixels */ static void ResizeSliders(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; Arg args[5]; Cardinal num_args=0; register int i, height, max_width, rows_per_screen; register int slide_pos, slide_size, col_width=0, min=0; /* * Get maximum width of data to display */ max_width = HORIZONTAL_SPACE; for (i=0; i < XmI18List_num_columns(ilist); i++) { if (XmI18List_column_widths(ilist)[i] > col_width) col_width = XmI18List_column_widths(ilist)[i]; max_width += XmI18List_column_widths(ilist)[i] + HORIZONTAL_SPACE; } if (((col_width + HORIZONTAL_SPACE) != 0) && (XmI18List_h_bar(ilist) != NULL)) { /* * Adjust the slider size and page increment values * The size and position (returned and set) are relative to * the number of columns of data that we have - BUT, we * have to convert this information to pixels for correct * processing. */ slide_size = ilist->core.width; if (slide_size < 1) slide_size = 1; if (slide_size > max_width) slide_size = max_width; /* * Adjust slider position according to new size * and location of first pixel of display data */ if (XmI18List_left_loc(ilist) >= 0) slide_pos = 1; else { i = (0 - XmI18List_left_loc(ilist)) + ilist->core.width; if (i >= max_width) slide_pos = max_width - slide_size; else if (i < max_width) slide_pos = i - slide_size; } if (slide_pos < 1) slide_pos = 1; if (slide_pos > (max_width - slide_size)) slide_pos = max_width - slide_size; XtSetArg(args[num_args], XmNvalue, slide_pos); num_args++; XtSetArg(args[num_args], XmNmaximum, max_width); num_args++; XtSetArg(args[num_args], XmNsliderSize, slide_size); num_args++; XtSetArg(args[num_args], XmNpageIncrement, slide_size); num_args++; XtSetValues(XmI18List_h_bar(ilist), args, num_args); } height = ilist->core.height - (2 * VERTICAL_SPACE + XmI18List_title_row_height(ilist)); if(XmI18List_new_visual_style(ilist)) height -= ilist->primitive.shadow_thickness; else height -= LINE_HEIGHT; if ((height > 0) && (XmI18List_v_bar(ilist) != NULL)) { int max_first; rows_per_screen = height / (XmI18List_row_height(ilist) + VERTICAL_SPACE); max_first = XmI18List_num_rows(ilist) - rows_per_screen; if (max_first < XmI18List_first_row(ilist)) { if (max_first > 0) XmI18List_first_row(ilist) = max_first; else XmI18List_first_row(ilist) = 0; } /* * Set up the scroll bars resources * MUST BE very thorough, otherwise warnings are issued. */ slide_size = rows_per_screen; max_width = XmI18List_num_rows(ilist); slide_pos = XmI18List_first_row(ilist); if (max_width <= 1) max_width = 1; if (slide_size > max_width) slide_size = max_width; if (slide_pos > (max_width - slide_size)) slide_pos = (max_width - slide_size); if (slide_pos < min) slide_pos = min; num_args = 0; XtSetArg(args[num_args], XmNminimum, min); num_args++; XtSetArg(args[num_args], XmNvalue, slide_pos); num_args++; XtSetArg(args[num_args], XmNmaximum, max_width); num_args++; XtSetArg(args[num_args], XmNsliderSize, slide_size); num_args++; XtSetArg(args[num_args], XmNpageIncrement, slide_size); num_args++; XtSetValues(XmI18List_v_bar(ilist), args, num_args); } } /* Function Name: VScroll * Description: Scrolls the window a given number of * rows up or down (up is negative) * Arguments: w - the ICS list widget. * amount - the number of rows to scroll, negative * values scroll backward. * Returns: none */ static void VScroll(Widget w, short amount) { XmI18ListWidget ilist = (XmI18ListWidget) w; int y_start; short num_rows; XmI18List_first_row(ilist) += amount; if (XmI18List_first_row(ilist) < 0) XmI18List_first_row(ilist) = 0; y_start = XmI18List_sep_y(ilist); if(XmI18List_new_visual_style(ilist)) y_start += ilist->primitive.shadow_thickness; else y_start += LINE_HEIGHT; XClearArea(XtDisplay(w), XtWindow(w), 0, y_start, (unsigned int) 0, (unsigned int) 0, FALSE); num_rows = XmI18List_num_rows(ilist) - XmI18List_first_row(ilist); DisplayList(w, XmI18List_first_row(ilist), num_rows, TRUE); } /* Function Name: CvtColNumToPixelVal * Description: determines which is the first visible pixel * in the passed column number * Arguments: w - the ilist widget data to retrieve info from * col - the column number to search in * Returns: the pixel value * * Added: 03/17/92 beth */ static short CvtColNumToPixelVal(Widget w, short col) { XmI18ListWidget ilist = (XmI18ListWidget) w; register int i; short value=0; /* * Sum up the widest pixel values in each column * until we reach the passed in column */ for (i = 0; i < col && i < XmI18List_num_columns(ilist); i++) value += XmI18List_column_widths(ilist)[i] + HORIZONTAL_SPACE; return(value); } /* Function Name: CvtPixelValToColNum * Description: determines which is the visible column * corresponding to the passed pixel value * Arguments: w - the ilist widget data to retrieve info from * x - the x pixel value to look for * Returns: the column number * * Added: 03/17/92 beth */ static short CvtPixelValToColNum(Widget w, short x) { XmI18ListWidget ilist = (XmI18ListWidget) w; register int i=0; short cur_col; /* * Sum up the widest pixel values in each column * and see where the passed in x pixel value falls */ if (LayoutIsRtoLP(w)) cur_col = XtWidth(w) - XmI18List_left_loc(ilist); else cur_col = XmI18List_left_loc(ilist); for (; i < XmI18List_num_columns(ilist); i++) { if (LayoutIsRtoLP(w)) { cur_col -= XmI18List_column_widths(ilist)[i] + HORIZONTAL_SPACE; if (cur_col < x) break; } else { cur_col += XmI18List_column_widths(ilist)[i] + HORIZONTAL_SPACE; if (cur_col > x) break; } } return((short) i); } /* Function Name: HScroll * Description: Scrolls the window a given number of pixels/ * columns left or right (left is negative) * Arguments: w - the ICS list widget. * amount - the pixel amount to scroll. * Returns: none * * Modified: 03/17/92 beth - converted to pixels */ static void HScroll(Widget w, short amount) { XmI18ListWidget ilist = (XmI18ListWidget) w; int y_start; unsigned int title_height; short num_rows; if ((0 - amount) >= 0) XmI18List_left_loc(ilist) = amount; else XmI18List_left_loc(ilist) = 0 - amount; title_height = XmI18List_sep_y(ilist); y_start = XmI18List_sep_y(ilist); if(XmI18List_new_visual_style(ilist)) y_start += ilist->primitive.shadow_thickness; else y_start += LINE_HEIGHT; XClearArea(XtDisplay(w), XtWindow(w), 0, 0, (unsigned int) 0, title_height, FALSE); XClearArea(XtDisplay(w), XtWindow(w), 0, y_start, (unsigned int) 0, (unsigned int) 0, FALSE); num_rows = XmI18List_num_rows(ilist) - XmI18List_first_row(ilist); DisplayList(w, XmI18List_first_row(ilist), num_rows, TRUE); } /* Function Name: CvtPositionToRowColumn * Description: Converts an X location to a row and column. * Arguments: w - the ilist widget. * x, y - the location in the window in pixel space. * RETURNED row, column - the location of this point in list space. * Returns: none. * * NOTE: This functions can return cells the are off the end of * the current space. It is up to the caller to check * to be sure he does not run off then end of an array. * * Modified: 03/17/92 beth - converted to pixels */ static void CvtPositionToRowColumn(Widget w, short x, short y, short * row, short * column) { XmI18ListWidget ilist = (XmI18ListWidget) w; int title_extra; if(XmI18List_new_visual_style(ilist)) title_extra = ilist->primitive.shadow_thickness; else title_extra = LINE_HEIGHT; /* * See if the y pixel value passed is located in the header * or a row visible within the clip window or not visible at all */ if (y < 0) { *row = IN_COLUMN_HEADER + y/(XmI18List_row_height(ilist) + VERTICAL_SPACE); } else if (y < (XmI18List_sep_y(ilist) + title_extra)) { *row = IN_COLUMN_HEADER; } else { y -= XmI18List_sep_y(ilist) + title_extra + VERTICAL_SPACE/2; *row = XmI18List_first_row(ilist) + y/(XmI18List_row_height(ilist) + VERTICAL_SPACE); } *column = CvtPixelValToColNum((Widget) w, x); } /* Function Name: CvtRowColumnToPosition * Description: Converts a row and column to an X Window Position. * the coord's are of the upper left corner of the cell. * Arguments: w - the ilist widget. * row, column - the location of this point in list space. * RETURNED x, y - the location in the window in pixel space. * Returns: none. * * Modified: 03/17/92 beth - converted to pixels */ static void CvtRowColumnToPosition(Widget w, short row, short column, short * x, short * y) { XmI18ListWidget ilist = (XmI18ListWidget) w; int title_extra; if(XmI18List_new_visual_style(ilist)) title_extra = ilist->primitive.shadow_thickness; else title_extra = LINE_HEIGHT; if (row == IN_COLUMN_HEADER) *y = VERTICAL_SPACE/2; else { *y = (XmI18List_sep_y(ilist) + title_extra + (row - XmI18List_first_row(ilist)) * (XmI18List_row_height(ilist) + VERTICAL_SPACE) + VERTICAL_SPACE/2); } *x = CvtColNumToPixelVal((Widget) ilist, column); } /* Function Name: ToggleRow * Description: Toggles the state of the given row. * Arguments: w - the ilist widget. * row - the row to select. * Returns: none */ static void ToggleRow(Widget w, short row) { XmI18ListWidget ilist = (XmI18ListWidget) w; XmI18List_row_data(ilist)[row].selected = !XmI18List_row_data(ilist)[row].selected; if (IsRowVisible(w, row) >= 0) InvertArea(w, row, ENTIRE_ROW); } /* Function Name: UnselectRows * Description: Unselects some rows (see below) and returns the * row that was left selected. * Arguments: w - the ilist widget. * row - row to leave selected. * Returns: none. */ static void UnselectRows(Widget w, short sel_row) { XmI18ListWidget ilist = (XmI18ListWidget) w; register short row; XmMultiListRowInfo *ptr = XmI18List_row_data(ilist); XmI18List_end(ilist) = XmI18List_anchor(ilist) = sel_row; for (row = 0; row < XmI18List_num_rows(ilist); row++, ptr++) { /* * if the row is correct and it is unselected * or if the row incorrect and it is selected then toggle the row. */ if (ptr->selected != (row == sel_row)) ToggleRow(w, row); } } /* Function Name: SelectHeader * Description: Sets the header corrosponding to the column passed in. * Arguments: w - the ilist widget. * column - the column header to select. * Returns: none */ static void SelectHeader(Widget w, short column) { XmI18ListWidget ilist = (XmI18ListWidget) w; if ((XmI18List_selected_header(ilist) == column) || (XmI18List_sort_functions(ilist) == NULL)) { return; } XmI18List_selected_header(ilist) = column; SortList(w, True); /* Causes a rediplay. */ } /* Function Name: SortList * Description: Sorts the elements in the list. * Arguments: w - the ilist widget. * redisplay - redraw the ilist widget. * Returns: none. */ static void SortList(Widget w, Boolean redisplay) { XmI18ListWidget ilist = (XmI18ListWidget) w; if (XmI18List_sort_functions(ilist) != NULL) { global_current_widget = w; qsort(XmI18List_row_data(ilist), XmI18List_num_rows(ilist), sizeof(XmMultiListRowInfo), QSortTest); if (redisplay) RedrawList(w); } /* this is kind of unnecessary, instead should just update headers */ else RedrawList(w); } /* Function Name: QSortTest * Description: Takes the internal data, and the calls the * appropriate sort routine supplied by the client. * Arguments: str1, str2 - the two values to compare. * Returns: */ static int QSortTest(const void * row1, const void * row2) { XmI18ListWidget ilist = (XmI18ListWidget) global_current_widget; short col = XmI18List_selected_header(ilist); Xm18SortFunction sort_f = XmI18List_sort_functions(ilist)[(int)col]; return ((*sort_f) (col, (XmMultiListRowInfo*)row1, (XmMultiListRowInfo*)row2)); } /* Function Name: InvertArea * Description: Inverts the the area specified. * Arguments: w - the ilist widget. * row, column - row/column to invert. * Returns: none. * * NOTE: The value IN_COLUMN_HEADER for the row means the area * to be inverted is in the column header. * * The value ENTIRE_ROW for the column causes the entire row to * be inverted. * * Modified: 03/17/92 beth - converted to pixels */ static void InvertArea(Widget w, short row, short column) { XmI18ListWidget ilist = (XmI18ListWidget) w; unsigned int width, height; short x, y, pix_y_offset; GC gc_to_use; if (!XtIsRealized(w)) return; if ((row == NO_SELECTION) || (column == NO_SELECTION)) return; if (column == ENTIRE_ROW) { CvtRowColumnToPosition(w, row, 0, &x, &y); width = GetListWidth((Widget) ilist); if (LayoutIsRtoLP(w)) x = -width + XtWidth(w) - XmI18List_left_loc(ilist) + HORIZONTAL_SPACE/2; else x = XmI18List_left_loc(ilist) - HORIZONTAL_SPACE/2; } else { CvtRowColumnToPosition(w, row, column, &x, &y); width = HORIZONTAL_SPACE + XmI18List_column_widths(ilist)[column]; } if (row == IN_COLUMN_HEADER) { height = XmI18List_title_row_height(ilist) + VERTICAL_SPACE; gc_to_use = XmI18List_inv_gc(ilist); } else { height = XmI18List_row_height(ilist) + VERTICAL_SPACE; gc_to_use = XmI18List_entry_background_inv_gc(ilist); } XFillRectangle(XtDisplay(w), XtWindow(w), gc_to_use, (int) x, (int) y, width, height); if ( (XmI18List_first_col_pixmaps(ilist)) && (XmI18List_row_data(ilist)[row].pix_depth != 1 ) && IsValidPixmap(XmI18List_row_data(ilist)[row].pixmap) ) { pix_y_offset = (height - XmI18List_row_data(ilist)[row].pix_height)/2; XCopyArea(XtDisplay(w), XmI18List_row_data(ilist)[row].pixmap, XtWindow(w), XmI18List_entry_background_gc(ilist), 0, 0, XmI18List_row_data(ilist)[row].pix_width, XmI18List_row_data(ilist)[row].pix_height, LayoutIsRtoLP(w) ? XtWidth(ilist) - XmI18List_left_loc(ilist) - XmI18List_row_data(ilist)[row].pix_height : XmI18List_left_loc(ilist), y+pix_y_offset ); } } /* Function Name: RedrawList * Description: Redraws the current list contents. * Arguments: w - the ilist widget. * Returns: none. * * Modified: 03/17/92 beth - converted to pixels */ static void RedrawList(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; short num_rows; if (XtIsRealized(w)) { XClearWindow(XtDisplay(w), XtWindow(w)); num_rows = XmI18List_num_rows(ilist) - XmI18List_first_row(ilist); DisplayList(w, XmI18List_first_row(ilist), num_rows, TRUE); DrawSeparator(w); } } /* Function Name: IsRowVisible * Description: returns 0 if the row is visable. Otherwise returns * the number of rows down we have to scroll (- values for up) * to make the row visible. * Arguments: w - the ilist widget. * row - the row to check. * Returns: none. */ static int IsRowVisible(Widget w, short row) { XmI18ListWidget ilist = (XmI18ListWidget) w; short r_row, r_col; if (row < XmI18List_first_row(ilist)) return(row - XmI18List_first_row(ilist)); CvtPositionToRowColumn((Widget) w, 0, (short) (ilist->core.height + 1), &r_row, &r_col); if (row >= r_row) return(row - r_row + 1); return(0); } /* Function Name: AdjustVisiblePosition * Description: makes the string found by find, visible * Arguments: w - the ilist widget. * position - the new position for lef_loc * check - whether we should check the new position * to see if it's valid * value - the amount to check the position against * Returns: none * * Added: 03/17/92 beth - for conversion to pixels */ static void AdjustVisiblePosition(Widget w, short position, Boolean check, short value) { XmI18ListWidget ilist = (XmI18ListWidget) w; /* * Check to make sure that we can move the amount requested */ if (check && position > value) position = 0 - value; else position = 0 - position; XmI18List_left_loc(ilist) += position; HScroll(w, XmI18List_left_loc(ilist)); AdjustFirstCol(w); ResizeSliders(w); } static void AdjustFirstRowAndCol( XmI18ListWidget ilist ) { Dimension total_width, height; int rows_per_screen, new_left_loc; register int j; int title_extra; if(XmI18List_new_visual_style(ilist)) title_extra = ilist->primitive.shadow_thickness; else title_extra = LINE_HEIGHT; new_left_loc = 0; for (j=0; j < XmI18List_first_col(ilist); j++){ new_left_loc -= (XmI18List_column_widths(ilist)[j] + HORIZONTAL_SPACE); } total_width = GetListWidth((Widget)ilist); if (ilist->core.width > total_width ){ XmI18List_left_loc(ilist) = 0; } else if (new_left_loc < (int)((int)ilist->core.width- (int)total_width)){ XmI18List_left_loc(ilist) = (int)((int)ilist->core.width- (int)total_width); } else XmI18List_left_loc(ilist) = new_left_loc; height = ilist->core.height - (2 * VERTICAL_SPACE + XmI18List_title_row_height(ilist) + title_extra); rows_per_screen = (int)height/(int)(XmI18List_row_height(ilist)+ VERTICAL_SPACE); if (XmI18List_num_rows(ilist) < rows_per_screen) { XmI18List_first_row(ilist) = 0; } else if (XmI18List_first_row(ilist) > (XmI18List_num_rows(ilist) - rows_per_screen)) { XmI18List_first_row(ilist) = (XmI18List_num_rows(ilist) - rows_per_screen); } } /* Function Name: MakePositionVisible * Description: makes sure that the string found by the find * procedure, is as visible (length) as possible * Arguments: w - the ilist widget. * row - the row to make visible. * start - the start pixel of the string * last - the last pixel of the string * width - the width of the display data * Returns: status (True if search and move worked). * * Modified: 03/17/92 beth - converted to pixels */ static Boolean MakePositionVisible(Widget w, short row, short start, short last, int width) { XmI18ListWidget ilist = (XmI18ListWidget) w; short amount, before = 0; if ((amount = IsRowVisible(w, row)) != 0) VScroll(w, amount); /* * Adjust the start and last values for better viewing */ if (start >= HORIZONTAL_SPACE) start -= HORIZONTAL_SPACE; last += HORIZONTAL_SPACE; /* * Convert the start pixel we want to see to visible pixels. * This involves comparing the start pixel location within * the visible window and seeing if it's possible to move * the visible window to contain the pixels we wish to see. */ if (XmI18List_left_loc(ilist) < 0) before -= XmI18List_left_loc(ilist); if (XmI18List_left_loc(ilist) < 0 && before >= start) { /* * The start pixel is to the left of the visible window * pass a negative value - it will be converted to positive later */ AdjustVisiblePosition((Widget) ilist, (0 - (before - start)), False, 0); return(TRUE); } else if (start >= before && start <= width) { short move, begin, end; if ((int)start <= (int)(before + ilist->core.width)) { /* * The start pixel is inside the visible window */ begin = (before + ilist->core.width) - start; end = last - start; if (begin < end) move = end - begin; else move = 0; } else { /* * The start pixel is to the right of the visible window */ move = last - (before + ilist->core.width); } if (move != 0) AdjustVisiblePosition((Widget) ilist, move, True, (width - (before + ilist->core.width))); return(TRUE); } return(FALSE); } /************************************************************ * * Exported Functions. * ************************************************************/ /* -kat 1/18/91 * Function Name: XmI18ListGetSelectedRows * Description: Takes an IList and returns a NULL terminated array * of pointers to selected rows * Arguments: w - the ilist widget * Returns: A NULL terminated array of the row info structures. * NULL is returned if nothing is selected. */ XmMultiListRowInfo ** XmI18ListGetSelectedRows(Widget w) { register int i, j; register XmMultiListRowInfo *row_data, **ptr; XmMultiListRowInfo **ret_rows = NULL; XmI18ListWidget ilist = (XmI18ListWidget) w; row_data = XmI18List_row_data(ilist); for (i = j = 0; j < XmI18List_num_rows(ilist); j++, row_data++) { if (row_data->selected) i++; } if (i != 0) { ptr = ret_rows = (XmMultiListRowInfo **) XtMalloc( sizeof(XmMultiListRowInfo *) * (i + 1)); ret_rows[i] = NULL; row_data = XmI18List_row_data(ilist); for (j = 0; j < XmI18List_num_rows(ilist); j++, row_data++) { if (row_data->selected) *ptr++ = row_data; } } return(ret_rows); } /* Function Name: XmI18ListDoSearch. * Description: Performs a search for the specified string. * Arguments: w - the ilist widget. * str - the string to search for. * reset - indicates if we are searching for * something new * Returns: status (True if search worked). * * Rewritten: 11/17/93 dave - works for I18List now */ Boolean XmI18ListDoSearch(Widget w, String str, Boolean reset) { XmI18ListWidget ilist = (XmI18ListWidget) w; Boolean foundit; XmString xms = XmStringCreateLocalized(str); int found_row, found_column, search_column; int first_selected_row = FirstSelectedRow(w); if ( reset ) XmI18List_search_column(ilist) = -1; /* * If we've searched last, be sure to start at NEXT column. * Otherwise start at first (0th) column */ search_column = XmI18List_search_column(ilist) + 1; if ( first_selected_row == -1 ) first_selected_row = 0; foundit = Search(ilist, xms, first_selected_row, search_column, &found_row, &found_column); if ( foundit ) { XmI18List_search_column(ilist) = found_column; UnselectRows(w, found_row); MakeCellVisible(w, found_row, found_column); } else { XmI18List_search_column(ilist) = -1; } return (foundit); } /* Function Name: XmI18ListFindRow * Description: Performs a search for the specified string. * Arguments: w - the ilist widget. * str - the string to search for. * reset - indicates if we are searching for * something new * do_visual - whether or not to toggle selected rows... * Returns: XmMultiListRowInfo of matching row (or NULL if no match found) * */ XmMultiListRowInfo *XmI18ListFindRow(Widget w, String str, int *found_column, Boolean reset, Boolean do_visual) { XmI18ListWidget ilist = (XmI18ListWidget) w; XmMultiListRowInfo *ptr = XmI18List_row_data(ilist); Boolean foundit; XmString xms = XmStringCreateLocalized(str); int found_row, search_column; int first_selected_row = FirstSelectedRow(w); if (reset) XmI18List_search_column(ilist) = -1; /* * If we've searched last, be sure to start at NEXT column. * Otherwise start at first (0th) column */ search_column = XmI18List_search_column(ilist) + 1; if (first_selected_row == -1) first_selected_row = 0; foundit = Search(ilist, xms, first_selected_row, search_column, &found_row, found_column); if (do_visual) { if (foundit) { XmI18List_search_column(ilist) = *found_column; UnselectRows(w, found_row); MakeCellVisible(w, found_row, *found_column); } else XmI18List_search_column(ilist) = -1; } return (XmMultiListRowInfo *)(foundit ? &ptr[found_row] : NULL); } static int FirstSelectedRow(Widget w) { XmI18ListWidget ilist = (XmI18ListWidget) w; XmMultiListRowInfo *ptr = XmI18List_row_data(ilist); int i; for (i=0;i= XmI18List_num_columns(ilist)) end = width; else end = XmI18List_column_widths(ilist)[col] + start; (void) MakePositionVisible(w, row, start, end, width); ResizeSliders(w); } /* * * Public Convenience Routines * */ /* Function Name: Xm18IListUnselectAllItems * Description: Unselects all rows * Arguments: w - the ilist widget. * Returns: none */ void Xm18IListUnselectAllItems( Widget w ) { register int row; XmI18ListWidget ilist = (XmI18ListWidget) w; XmMultiListRowInfo *ptr = XmI18List_row_data(ilist); _XmWidgetToAppContext(w); _XmAppLock(app); for (row = 0; row < XmI18List_num_rows(ilist); row++, ptr++) { if (ptr->selected) ToggleRow(w, row); } _XmAppUnlock(app); } /* Function Name: Xm18IListUnselectItem * Description: Unselects the row passed in * Arguments: w - the ilist widget. * row_info - ptr to the row passed in * Returns: none */ void Xm18IListUnselectItem( Widget w, XmMultiListRowInfo *row_info ) { register int row=0; XmI18ListWidget ilist = (XmI18ListWidget) w; XmMultiListRowInfo *ptr = XmI18List_row_data(ilist); Boolean done=False; while (row < XmI18List_num_rows(ilist) && !done){ if (ptr == row_info){ if (ptr->selected) ToggleRow( w, row); done = True; } else { ptr++; row++; } } } /* Function Name: XmI18ListToggleRow * Description: Toggles the selection state of a specified row * Arguments: w - the ilist widget. * Returns: none */ void XmI18ListToggleRow(Widget w, short row) { ToggleRow(w, row); } /* * Function: * CopyColumnTitles(ilist) * Description: * This function copies the XmStringTable that is the column titles * into local (widget controled) memory. * Input: * ilist : XmI18ListWidget - the widget to copy titles * Output: * None. */ static void CopyColumnTitles(XmI18ListWidget ilist) { int i; XmStringTable copy; if( XmI18List_num_columns(ilist) == 0 || XmI18List_column_titles(ilist) == NULL ) { copy = (XmStringTable) NULL; } else { copy = (XmStringTable) XtMalloc(sizeof(XmString) * XmI18List_num_columns(ilist)); for( i = 0; i < XmI18List_num_columns(ilist); ++i ) { copy[i] = XmStringCopy(XmI18List_column_titles(ilist)[i]); } } XmI18List_column_titles(ilist) = copy; } /* * Function: * FreeColumnTitles(ilist) * Description: * This function frees the memory associated with the column titles * for the list. * Input: * ilist : XmI18ListWidget - the widget to copy titles * Output: * None. */ static void FreeColumnTitles(XmI18ListWidget ilist) { int i; if( XmI18List_num_columns(ilist) == 0 || XmI18List_column_titles(ilist) == NULL ) { return; } for( i = 0; i < XmI18List_num_columns(ilist); ++i ) { XmStringFree(XmI18List_column_titles(ilist)[i]); } XtFree((XtPointer) XmI18List_column_titles(ilist)); XmI18List_column_titles(ilist) = (XmStringTable) NULL; } /* Function Name: GetSelectedRows * Description: Creates an array of integers which are selected row #'s * Arguments: i18list - the extended list widget * rows - pointer to the array of selected row #'s * num_rows - pointer to the number of selected rows * Returns: rows */ static int * GetSelectedRows(XmI18ListWidget i18list, int *num_rows) { XmMultiListRowInfo *row_info = XmI18List_row_data(i18list); int *rows, i; rows = NULL; for (*num_rows = 0, i = 0; i < XmI18List_num_rows(i18list); i++) if (row_info[i].selected) (*num_rows)++; if (*num_rows > 0) { int j; rows = (int *) XtMalloc(*num_rows * sizeof(int)); for (i = 0, j = 0; i < XmI18List_num_rows(i18list); i++) if (row_info[i].selected) rows[j++] = i; } return rows; } /* Function Name: SelectRow * Description: Set selection state of row * Arguments: i18list - the extended list widget * row - the row to select/unselect * select - True/False * notify - if True, call XmNsingleSelectionCallback * Returns: none */ static void SelectRow(XmI18ListWidget i18list, int row, Boolean select, Boolean notify) { XmMultiListRowInfo *rows = XmI18List_row_data(i18list); if ((row >= 0) && (rows[row].selected != select)) { ToggleRow((Widget) i18list, row); } /* Call the appropriate notification callbacks... */ if (notify) Notify((Widget) i18list, False); } /* Function Name: SelectItems * Description: Set selection state by matching column entries to XmString * Arguments: i18list - the extended list widget * item - XmString to use as selection key (NULL matches all) * column - column number (0 - N) to match (or XmANY_COLUMN) * select - True/False whether or not to select matching rows * notify - if True, call XmNsingleSelectionCallback * Returns: none */ static void SelectItems(XmI18ListWidget i18list, XmString item, int column, Boolean select, Boolean notify) { XmMultiListRowInfo *rows = XmI18List_row_data(i18list); int i, j; int rowcount, colcount, colstart; _XmWidgetToAppContext((Widget)i18list); _XmAppLock(app); colstart = (XmI18List_first_col_pixmaps(i18list) ? 1 : 0); rowcount = XmI18List_num_rows(i18list); colcount = XmI18List_num_columns(i18list); for (i = 0; i < rowcount; i++) for (j = colstart; j < colcount; j++) /* Check indiviual column entries against XmString, item... * If XmString item matches column etnry (or item is NULL), then * set the selection state of the row */ if ((((column == XmANY_COLUMN) || (column == j)) && XmStringCompare(item, rows[i].values[j])) || !item) { if (rows[i].selected != select) { ToggleRow((Widget) i18list, i); } /* Call the appropriate notification callbacks... */ if (notify) Notify((Widget) i18list, False); break; } _XmAppUnlock(app); } /* * XmRCallProc routine for checking font_list before setting it to NULL * If "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmI18ListWidget il = (XmI18ListWidget)wid; /* Check if been here before */ if (il->ilist.check_set_render_table) value->addr = NULL; else { il->ilist.check_set_render_table = True; value->addr = (char*)&(il->ilist.font_list); } } /*************************************************************************** * * * ListConvert - Convert routine for dragNDrop. * * * ***************************************************************************/ /*ARGSUSED*/ static void ListConvert(Widget w, XtPointer client_data, XmConvertCallbackStruct *cs) { enum { XmA_MOTIF_COMPOUND_STRING, XmACOMPOUND_TEXT, XmATEXT, XmATARGETS, XmA_MOTIF_DROP, XmA_MOTIF_LOSE_SELECTION, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_COMPOUND_STRING, XmSCOMPOUND_TEXT, XmSTEXT, XmSTARGETS, XmS_MOTIF_DROP, XmS_MOTIF_LOSE_SELECTION, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSUTF8_STRING }; Atom atoms[XtNumber(atom_names)]; Atom C_ENCODING = XmeGetEncodingAtom(w); int target_count = 0; int i; Atom type = None; XtPointer value = NULL; unsigned long size = 0; int format = 8; XmI18ListWidget lw = (XmI18ListWidget) w; XmI18ListDragConvertStruct *ListDragConv = lw->ilist.drag_conv; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); if (cs->target == atoms[XmATARGETS]) { Atom *targs = XmeStandardTargets(w, 5, &target_count); value = (XtPointer) targs; targs[target_count++] = atoms[XmA_MOTIF_COMPOUND_STRING]; targs[target_count++] = atoms[XmACOMPOUND_TEXT]; targs[target_count++] = atoms[XmATEXT]; targs[target_count++] = atoms[XmAUTF8_STRING]; targs[target_count++] = C_ENCODING; if (XA_STRING != C_ENCODING) targs[target_count++] = XA_STRING; if (ListDragConv->pixmap != None) targs[target_count++] = XA_PIXMAP; type = XA_ATOM; size = target_count; format = 32; } else if ((cs->target == atoms[XmA_MOTIF_EXPORT_TARGETS]) || (cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS])) { Atom *targs = (Atom *) XtMalloc(sizeof(Atom) * 5); int n = 0; value = (XtPointer) targs; targs[n++] = atoms[XmA_MOTIF_COMPOUND_STRING]; targs[n++] = atoms[XmACOMPOUND_TEXT]; targs[n++] = atoms[XmATEXT]; targs[n++] = C_ENCODING; if (XA_STRING != C_ENCODING) targs[n++] = XA_STRING; if (ListDragConv->pixmap != None) targs[n++] = XA_PIXMAP; format = 32; size = n; type = XA_ATOM; cs->status = XmCONVERT_DONE; } else if (cs->target == atoms[XmACOMPOUND_TEXT] || cs->target == atoms[XmA_MOTIF_COMPOUND_STRING] || cs->target == XA_STRING || cs->target == C_ENCODING || cs->target == atoms[XmATEXT] || cs->target == atoms[XmAUTF8_STRING]) { XmString concat; XmString sep = XmStringSeparatorCreate(); format = 8; if (cs->selection == atoms[XmA_MOTIF_DROP]) { int itemcount = ListDragConv->num_items; XmString *items = ListDragConv->strings; concat = (itemcount ? XmStringCopy(items[0]) : NULL); for (i = 1; i < itemcount; i++) { concat = XmStringConcatAndFree(concat, XmStringCopy(sep)); concat = XmStringConcatAndFree(concat, XmStringCopy(items[i])); } } else { Cardinal row; int rowcount; int * rows = GetSelectedRows(lw, &rowcount); concat = NULL; for (row = 0; row < rowcount; row++) { if (concat) { concat = XmStringConcatAndFree(concat, XmStringCopy(GetConcatenatedRow(w, rows[row]))); } else { concat = GetConcatenatedRow(w, rows[row]); } if (row < rowcount-1) { concat = XmStringConcatAndFree(concat, XmStringCopy(sep)); } } XtFree((XtPointer)rows); } if (cs->target == atoms[XmACOMPOUND_TEXT] || cs->target == C_ENCODING || cs->target == XA_STRING || cs->target == atoms[XmATEXT]) { if (concat != NULL) value = XmCvtXmStringToCT(concat); else value = NULL; type = atoms[XmACOMPOUND_TEXT]; if (value != NULL) size = strlen((char*) value); else size = 0; if (cs->target == XA_STRING) { XTextProperty tmp_prop; int ret_status; /* convert value to 8859.1 */ ret_status = XmbTextListToTextProperty(XtDisplay(w), (char**) &value, 1, (XICCEncodingStyle) XStringStyle, &tmp_prop); XtFree((char*) value); if (ret_status == Success || ret_status > 0) { value = (XtPointer) tmp_prop.value; type = XA_STRING; size = tmp_prop.nitems; } else { value = NULL; size = 0; } /* If the target was TEXT then try and convert it. If * fully converted then we'll pass it back in locale * text. For locale text requests, always pass * back the converted text */ } else if ((cs->target == atoms[XmATEXT] || cs->target == C_ENCODING) && (value != NULL)) { char *cvt; Boolean success; cvt = _XmTextToLocaleText(w, value, type, format, size, &success); if ((cvt != NULL && success) || cs->target == C_ENCODING) { if (! success && cvt != NULL) cs->flags |= XmCONVERTING_PARTIAL; XtFree((char*) value); value = cvt; type = C_ENCODING; } } } #ifdef UTF8_SUPPORTED else if (cs->target == atoms[XmAUTF8_STRING]) { type = atoms[XmAUTF8_STRING]; value = XmCvtXmStringToUTF8String(concat); if (value != NULL) size = strlen((char*) value); else size = 0; } #endif else { size = XmCvtXmStringToByteStream(concat, (unsigned char**) &value); type = atoms[XmA_MOTIF_COMPOUND_STRING]; } XmStringFree(concat); XmStringFree(sep); } else if (cs->target == atoms[XmA_MOTIF_LOSE_SELECTION]) { /* Deselect everything in the list since we lost the primary selection. */ Xm18IListUnselectAllItems(w); } else if (cs->target == XA_PIXMAP) { /* Get row's pixmap */ Pixmap *pix; pix = (Pixmap *) XtMalloc(sizeof(Pixmap)); *pix = ListDragConv->pixmap; /* value, type, size, and format must be set */ value = (XtPointer) pix; type = XA_DRAWABLE; size = 1; format = 32; } _XmConvertComplete(w, value, size, format, type, cs); } /*ARGSUSED*/ static void ListPreDestProc(Widget w, XtPointer ignore, /* unused */ XmDestinationCallbackStruct *cs) { XmDropProcCallbackStruct *ds; Atom XA_MOTIF_DROP = XInternAtom(XtDisplay(w), XmS_MOTIF_DROP, False); int index; short row, col; if (cs->selection != XA_MOTIF_DROP) return; /* If this is the result of a drop, we can fill in location_data with * the apparent site */ ds = (XmDropProcCallbackStruct *) cs->destination_data; CvtPositionToRowColumn(w, ds->x, ds->y, &row, &col); cs->location_data = (XtPointer) (long) row; } /* * Function: * GetConcatenatedRow(ilist) * Description: * Helper fucntion for UTM operations. Returns joined collumns of a row, * with tabs between column values. * Input: * w : Widget - the widget to copy titles * row : XmMultiListRowInfo - the row to concatenate * Output: * XmString - the concatenated string. */ static XmString GetConcatenatedRow(Widget w, int row) { XmString result = NULL; XmString temp_string; XmString tab = XmStringComponentCreate(XmSTRING_COMPONENT_TAB, 0, NULL); XmI18ListWidget lw = (XmI18ListWidget)w; short i; for (i = 0; i < lw->ilist.num_columns; i++) { if (lw->ilist.row_data[row].values[i]) { if (result) { temp_string = XmStringConcat(tab, lw->ilist.row_data[row].values[i]); result = XmStringConcatAndFree(result, temp_string); } else { result = XmStringCopy(lw->ilist.row_data[row].values[i]); } } } XmStringFree(tab); return result; } /*************************************************************************** * * * ProcessDrag - drag the selected items * * * ***************************************************************************/ /*ARGSUSED*/ static void ProcessDrag(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmI18ListWidget lw = (XmI18ListWidget) wid; register int i; short row, col; Widget drag_icon, dc; Arg args[10]; int n, location_data; XmI18ListDragConvertStruct *ListDragConv; XmString temp_string = NULL; XmString temp_string2 = NULL; XmString tab; /* Don't allow multi-button drags. */ if (event->xbutton.state & ~((Button1Mask >> 1) << event->xbutton.button) & (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)) return; CvtPositionToRowColumn(wid, event->xbutton.x, event->xbutton.y, &row, &col); if (col < 0 || row >= lw->ilist.num_rows || col >= lw->ilist.num_columns) return; location_data = row; lw->ilist.drag_conv = ListDragConv = (XmI18ListDragConvertStruct *) XtMalloc(sizeof(XmI18ListDragConvertStruct)); ListDragConv->w = wid; ListDragConv->strings = NULL; ListDragConv->pixmap = None; ListDragConv->num_items = 0; if (col == 0 && lw->ilist.first_col_pixmaps && row >= 0) { ListDragConv->num_items = 1; ListDragConv->pixmap = lw->ilist.row_data[row].pixmap; } if (row >= 0) { if (lw->ilist.row_data[row].selected) { int rowcount; int * rows = GetSelectedRows(lw, &rowcount); ListDragConv->num_items = rowcount; ListDragConv->strings = (XmString *) XtMalloc(sizeof(XmString) * ListDragConv->num_items); for (i = 0; i < rowcount; i++) ListDragConv->strings[i] = GetConcatenatedRow(wid, rows[i]); XtFree((XtPointer)rows); } else { ListDragConv->strings = (XmString *) XtMalloc(sizeof(XmString)); ListDragConv->num_items = 1; ListDragConv->strings[0] = GetConcatenatedRow(wid, row); } } else if (row == -2 && lw->ilist.column_titles) { /* drag column header */ ListDragConv->strings = (XmString *) XtMalloc(sizeof(XmString)); ListDragConv->num_items = 1; ListDragConv->strings[0] = lw->ilist.column_titles[col]; } else { return; } /* OK, now start the drag... */ drag_icon = XmeGetTextualDragIcon(wid); n = 0; XtSetArg(args[n], XmNcursorForeground, lw->primitive.foreground), n++; XtSetArg(args[n], XmNcursorBackground, lw->core.background_pixel), n++; XtSetArg(args[n], XmNsourceCursorIcon, drag_icon), n++; XtSetArg(args[n], XmNdragOperations, XmDROP_COPY), n++; dc = XmeDragSource(wid, (XtPointer) (long) location_data, event, args, n); if (dc) XtAddCallback(dc, XmNdragDropFinishCallback, DragDropFinished, lw); else DragDropFinished(dc, lw, NULL); } /*************************************************************************** * * * CopyToClipboard - copy the current selected items to the clipboard. * * * * This is a *sloow* process... * * * ***************************************************************************/ /*ARGSUSED*/ static void CopyToClipboard(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmI18ListWidget lw = (XmI18ListWidget) w; int rowcount; /* text to the clipboard */ (void)GetSelectedRows(lw, &rowcount); if (rowcount > 0) (void) XmeClipboardSource(w, XmCOPY, 0); } /*ARGSUSED*/ static void DragDropFinished(Widget w, /* unused */ XtPointer closure, XtPointer call_data) /* unused */ { int i; XmI18ListWidget lw = (XmI18ListWidget)closure; XmI18ListDragConvertStruct *ListDragConv = lw->ilist.drag_conv; for (i = 0; i < ListDragConv->num_items; i++) XmStringFree(ListDragConv->strings[i]); XtFree((char *) ListDragConv->strings); XtFree((char *) ListDragConv); } /* Function Name: XmI18ListSelectItems * Description: Set selection state by matching column entries to XmString * Arguments: i18list - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * notify - if True, call XmNsingleSelectionCallback * Returns: none */ void XmI18ListSelectItems(XmI18ListWidget i18list, XmString item, int column, Boolean notify) { SelectItems(i18list, item, column, True, notify); } /* Function Name: XmI18ListDeselectItems * Description: Set selection state by matching column entries to XmString * Arguments: i18list - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * Returns: none */ void XmI18ListDeselectItems(XmI18ListWidget i18list, XmString item, int column) { SelectItems(i18list, item, column, False, False); } /* Function Name: XmI18ListSelectAllItems * Description: Set selection state by matching column entries to XmString * Arguments: i18list - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * notify - if True, call XmNsingleSelectionCallback * Returns: none */ void XmI18ListSelectAllItems(XmI18ListWidget i18list, Boolean notify) { SelectItems(i18list, NULL, XmANY_COLUMN, True, notify); } /* Function Name: XmI18SelectRow * Description: Set selection state of row * Arguments: i18list - the extended list widget * row - the row to select * notify - if True, call XmNsingleSelectionCallback * Returns: none */ void XmI18ListSelectRow(XmI18ListWidget i18list, int row, Boolean notify) { SelectRow(i18list, row, True, notify); } /* Function Name: XmI18DeselectRow * Description: Set selection state of row * Arguments: i18list - the extended list widget * row - the row to deselect * Returns: none */ void XmI18ListDeselectRow(XmI18ListWidget i18list, int row) { SelectRow(i18list, row, False, False); } /* Function Name: XmI18ListGetSelectedRowArray * Description: Creates an array of integers which are selected row #'s * Arguments: i18list - the extended list widget * rows - pointer to the array of selected row #'s * num_rows - pointer to the number of selected rows * Returns: selected rows array */ int * XmI18ListGetSelectedRowArray(XmI18ListWidget i18list, int *num_rows) { return GetSelectedRows(i18list, num_rows); } /* Function Name: XmI18ListMakeRowVisible * Description: Shifts the visible extended list rows as desired * Arguments: i18list - the extended list widget * row - the row number wished to be made visible * Returns: none */ void XmI18ListMakeRowVisible(XmI18ListWidget i18list, int row) { /* Use column zero as a rule when making a row visible... */ MakeCellVisible((Widget) i18list, row, 0); } motif-2.3.8/lib/Xm/DrawingA.h0000644000175000017500000000404113145162623012564 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDrawingArea_h #define _XmDrawingArea_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmDrawingAreaWidgetClass; typedef struct _XmDrawingAreaClassRec * XmDrawingAreaWidgetClass; typedef struct _XmDrawingAreaRec * XmDrawingAreaWidget; #ifndef XmIsDrawingArea #define XmIsDrawingArea(w) (XtIsSubclass (w, xmDrawingAreaWidgetClass)) #endif /******** Public Function Declarations ********/ extern Widget XmCreateDrawingArea( Widget p, String name, ArgList args, Cardinal n) ; extern Widget XmVaCreateDrawingArea( Widget parent, char *name, ...); extern Widget XmVaCreateManagedDrawingArea( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDrawingArea_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmStrDefs.h0000644000175000017500000057406413211513004012753 00000000000000/* $TOG: XmStrDefs.ht /main/2 1997/06/18 17:50:15 samborn $ */ #ifndef _XmStrDefs_h_ #define _XmStrDefs_h_ #include #ifndef _XmConst #define _XmConst /**/ #endif #ifdef __cplusplus extern "C" { #endif /* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */ /* This file is automatically generated. */ /* Default ABI version -- Do not edit */ /* TOG: xmstring.list /main/5 1997/06/20 08:37:02 samborn */ #ifdef XMSTRINGDEFINES #define XmS "" #define XmCAccelerator "Accelerator" #define XmCAcceleratorText "AcceleratorText" #define XmCAdjustLast "AdjustLast" #define XmCAdjustMargin "AdjustMargin" #define XmCAlignment "Alignment" #define XmCAllowOverlap "AllowOverlap" #define XmCAllowUnusedSpace "AllowUnusedSpace" #define XmCAnimationMask "AnimationMask" #define XmCAnimationPixmap "AnimationPixmap" #define XmCAnimationPixmapDepth "AnimationPixmapDepth" #define XmCAnimationStyle "AnimationStyle" #define XmCApplyLabelString "ApplyLabelString" #define XmCArmCallback "ArmCallback" #define XmCArmColor "ArmColor" #define XmCArmPixmap "ArmPixmap" #define XmCArrowDirection "ArrowDirection" #define XmCAttachment "Attachment" #define XmCAudibleWarning "AudibleWarning" #define XmCAutoShowCursorPosition "AutoShowCursorPosition" #define XmCAutoUnmanage "AutoUnmanage" #define XmCAutomaticSelection "AutomaticSelection" #define XmCAvailability "Availability" #define XmCBackgroundPixmap "BackgroundPixmap" #define XmCBlendModel "BlendModel" #define XmCBlinkRate "BlinkRate" #define XmCBottomShadowColor "BottomShadowColor" #define XmCBottomShadowPixmap "BottomShadowPixmap" #define XmCButtonAcceleratorText "ButtonAcceleratorText" #define XmCButtonAccelerators "ButtonAccelerators" #define XmCButtonCount "ButtonCount" #define XmCButtonFontList "ButtonFontList" #define XmCButtonMnemonicCharSets "ButtonMnemonicCharSets" #define XmCButtonMnemonics "ButtonMnemonics" #define XmCButtonSet "ButtonSet" #define XmCButtonType "ButtonType" #define XmCButtons "Buttons" #define XmCCancelLabelString "CancelLabelString" #define XmCChildHorizontalAlignment "ChildHorizontalAlignment" #define XmCChildHorizontalSpacing "ChildHorizontalSpacing" #define XmCChildPlacement "ChildPlacement" #define XmCChildType "ChildType" #define XmCChildVerticalAlignment "ChildVerticalAlignment" #define XmCChildren "Children" #define XmCClientData "ClientData" #define XmCClipWindow "ClipWindow" #define XmCColumns "Columns" #define XmCCommandWindow "CommandWindow" #define XmCCommandWindowLocation "CommandWindowLocation" #define XmCConvertProc "ConvertProc" #define XmCCursorBackground "CursorBackground" #define XmCCursorForeground "CursorForeground" #define XmCCursorPosition "CursorPosition" #define XmCCursorPositionVisible "CursorPositionVisible" #define XmCDarkThreshold "DarkThreshold" #define XmCDecimalPoints "DecimalPoints" #define XmCDefaultButtonShadowThickness "DefaultButtonShadowThickness" #define XmCDefaultButtonType "DefaultButtonType" #define XmCDefaultCopyCursorIcon "DefaultCopyCursorIcon" #define XmCDefaultFontList "DefaultFontList" #define XmCDefaultInvalidCursorIcon "DefaultInvalidCursorIcon" #define XmCDefaultLinkCursorIcon "DefaultLinkCursorIcon" #define XmCDefaultMoveCursorIcon "DefaultMoveCursorIcon" #define XmCDefaultNoneCursorIcon "DefaultNoneCursorIcon" #define XmCDefaultPosition "DefaultPosition" #define XmCDefaultSourceCursorIcon "DefaultSourceCursorIcon" #define XmCDefaultValidCursorIcon "DefaultValidCursorIcon" #define XmCDeleteResponse "DeleteResponse" #define XmCDesktopParent "DesktopParent" #define XmCDialogStyle "DialogStyle" #define XmCDialogTitle "DialogTitle" #define XmCDialogType "DialogType" #define XmCDirListItemCount "DirListItemCount" #define XmCDirListItems "DirListItems" #define XmCDirListLabelString "DirListLabelString" #define XmCDirMask "DirMask" #define XmCDirSearchProc "DirSearchProc" #define XmCDirSpec "DirSpec" #define XmCDirectory "Directory" #define XmCDirectoryValid "DirectoryValid" #define XmCDisarmCallback "DisarmCallback" #define XmCDoubleClickInterval "DoubleClickInterval" #define XmCDragContextClass "DragContextClass" #define XmCDragDropFinishCallback "DragDropFinishCallback" #define XmCDragIconClass "DragIconClass" #define XmCDragInitiatorProtocolStyle "DragInitiatorProtocolStyle" #define XmCDragMotionCallback "DragMotionCallback" #define XmCDragOperations "DragOperations" #define XmCDragOverMode "DragOverMode" #define XmCDragProc "DragProc" #define XmCDragReceiverProtocolStyle "DragReceiverProtocolStyle" #define XmCDropProc "DropProc" #define XmCDropRectangles "DropRectangles" #define XmCDropSiteActivity "DropSiteActivity" #define XmCDropSiteEnterCallback "DropSiteEnterCallback" #define XmCDropSiteLeaveCallback "DropSiteLeaveCallback" #define XmCDropSiteManagerClass "DropSiteManagerClass" #define XmCDropSiteOperations "DropSiteOperations" #define XmCDropSiteType "DropSiteType" #define XmCDropStartCallback "DropStartCallback" #define XmCDropTransferClass "DropTransferClass" #define XmCDropTransfers "DropTransfers" #define XmCEditable "Editable" #define XmCEntryBorder "EntryBorder" #define XmCEntryClass "EntryClass" #define XmCExportTargets "ExportTargets" #define XmCExposeCallback "ExposeCallback" #define XmCExtensionType "ExtensionType" #define XmCFileListItemCount "FileListItemCount" #define XmCFileListItems "FileListItems" #define XmCFileListLabelString "FileListLabelString" #define XmCFileSearchProc "FileSearchProc" #define XmCFileTypeMask "FileTypeMask" #define XmCFillOnArm "FillOnArm" #define XmCFillOnSelect "FillOnSelect" #define XmCFilterLabelString "FilterLabelString" #define XmCFontList "FontList" #define XmCForegroundThreshold "ForegroundThreshold" #define XmCHelpLabelString "HelpLabelString" #define XmCHighlightColor "HighlightColor" #define XmCHighlightOnEnter "HighlightOnEnter" #define XmCHighlightPixmap "HighlightPixmap" #define XmCHighlightThickness "HighlightThickness" #define XmCHorizontalFontUnit "HorizontalFontUnit" #define XmCHorizontalScrollBar "HorizontalScrollBar" #define XmCHot "Hot" #define XmCICCHandle "ICCHandle" #define XmCImportTargets "ImportTargets" #define XmCIncrement "Increment" #define XmCIncremental "Incremental" #define XmCIndicatorOn "IndicatorOn" #define XmCIndicatorSize "IndicatorSize" #define XmCIndicatorType "IndicatorType" #define XmCInitialDelay "InitialDelay" #define XmCInitialFocus "InitialFocus" #define XmCInputCreate "InputCreate" #define XmCInputMethod "InputMethod" #define XmCInvalidCursorForeground "InvalidCursorForeground" #define XmCIsAligned "IsAligned" #define XmCIsHomogeneous "IsHomogeneous" #define XmCItemCount "ItemCount" #define XmCItems "Items" #define XmCKeyboardFocusPolicy "KeyboardFocusPolicy" #define XmCLabelFontList "LabelFontList" #define XmCLabelInsensitivePixmap "LabelInsensitivePixmap" #define XmCLabelPixmap "LabelPixmap" #define XmCLabelString "LabelString" #define XmCLabelType "LabelType" #define XmCLightThreshold "LightThreshold" #define XmCListLabelString "ListLabelString" #define XmCListMarginHeight "ListMarginHeight" #define XmCListMarginWidth "ListMarginWidth" #define XmCListSizePolicy "ListSizePolicy" #define XmCListSpacing "ListSpacing" #define XmCListUpdated "ListUpdated" #define XmCLogicalParent "LogicalParent" #define XmCMainWindowMarginHeight "MainWindowMarginHeight" #define XmCMainWindowMarginWidth "MainWindowMarginWidth" #define XmCMappingDelay "MappingDelay" #define XmCMarginBottom "MarginBottom" #define XmCMarginHeight "MarginHeight" #define XmCMarginLeft "MarginLeft" #define XmCMarginRight "MarginRight" #define XmCMarginTop "MarginTop" #define XmCMarginWidth "MarginWidth" #define XmCMask "Mask" #define XmCMaxItems "MaxItems" #define XmCMaxLength "MaxLength" #define XmCMaxValue "MaxValue" #define XmCMaximum "Maximum" #define XmCMenuBar "MenuBar" #define XmCMenuPost "MenuPost" #define XmCMenuWidget "MenuWidget" #define XmCMessageProc "MessageProc" #define XmCMessageWindow "MessageWindow" #define XmCMinimizeButtons "MinimizeButtons" #define XmCMinimum "Minimum" #define XmCMnemonic "Mnemonic" #define XmCMnemonicCharSet "MnemonicCharSet" #define XmCMoveOpaque "MoveOpaque" #define XmCMultiClick "MultiClick" #define XmCMustMatch "MustMatch" #define XmCMwmDecorations "MwmDecorations" #define XmCMwmFunctions "MwmFunctions" #define XmCMwmInputMode "MwmInputMode" #define XmCMwmMenu "MwmMenu" #define XmCMwmMessages "MwmMessages" #define XmCNavigationType "NavigationType" #define XmCNeedsMotion "NeedsMotion" #define XmCNoMatchString "NoMatchString" #define XmCNoResize "NoResize" #define XmCNoneCursorForeground "NoneCursorForeground" #define XmCNotifyProc "NotifyProc" #define XmCNumChildren "NumChildren" #define XmCNumColumns "NumColumns" #define XmCNumDropRectangles "NumDropRectangles" #define XmCNumDropTransfers "NumDropTransfers" #define XmCNumExportTargets "NumExportTargets" #define XmCNumImportTargets "NumImportTargets" #define XmCOffset "Offset" #define XmCOkLabelString "OkLabelString" #define XmCOperationChangedCallback "OperationChangedCallback" #define XmCOperationCursorIcon "OperationCursorIcon" #define XmCOptionLabel "OptionLabel" #define XmCOptionMnemonic "OptionMnemonic" #define XmCOutputCreate "OutputCreate" #define XmCPacking "Packing" #define XmCPageIncrement "PageIncrement" #define XmCPaneMaximum "PaneMaximum" #define XmCPaneMinimum "PaneMinimum" #define XmCPattern "Pattern" #define XmCPendingDelete "PendingDelete" #define XmCPopupEnabled "PopupEnabled" #define XmCPositionIndex "PositionIndex" #define XmCPostFromButton "PostFromButton" #define XmCPostFromCount "PostFromCount" #define XmCPostFromList "PostFromList" #define XmCPreeditType "PreeditType" #define XmCProcessingDirection "ProcessingDirection" #define XmCPromptString "PromptString" #define XmCProtocolCallback "ProtocolCallback" #define XmCPushButtonEnabled "PushButtonEnabled" #define XmCQualifySearchDataProc "QualifySearchDataProc" #define XmCRadioAlwaysOne "RadioAlwaysOne" #define XmCRadioBehavior "RadioBehavior" #define XmCRecomputeSize "RecomputeSize" #define XmCRectangles "Rectangles" #define XmCRepeatDelay "RepeatDelay" #define XmCResizeCallback "ResizeCallback" #define XmCResizeHeight "ResizeHeight" #define XmCResizePolicy "ResizePolicy" #define XmCResizeWidth "ResizeWidth" #define XmCRowColumnType "RowColumnType" #define XmCRows "Rows" #define XmCRubberPositioning "RubberPositioning" #define XmCSashHeight "SashHeight" #define XmCSashIndent "SashIndent" #define XmCSashWidth "SashWidth" #define XmCScaleHeight "ScaleHeight" #define XmCScaleMultiple "ScaleMultiple" #define XmCScaleWidth "ScaleWidth" #define XmCScroll "Scroll" #define XmCScrollBarDisplayPolicy "ScrollBarDisplayPolicy" #define XmCScrollBarPlacement "ScrollBarPlacement" #define XmCScrollSide "ScrollSide" #define XmCScrolledWindowMarginHeight "ScrolledWindowMarginHeight" #define XmCScrolledWindowMarginWidth "ScrolledWindowMarginWidth" #define XmCScrollingPolicy "ScrollingPolicy" #define XmCSelectColor "SelectColor" #define XmCSelectInsensitivePixmap "SelectInsensitivePixmap" #define XmCSelectPixmap "SelectPixmap" #define XmCSelectThreshold "SelectThreshold" #define XmCSelectedItemCount "SelectedItemCount" #define XmCSelectedItems "SelectedItems" #define XmCSelectionArrayCount "SelectionArrayCount" #define XmCSelectionLabelString "SelectionLabelString" #define XmCSelectionPolicy "SelectionPolicy" #define XmCSeparatorOn "SeparatorOn" #define XmCSeparatorType "SeparatorType" #define XmCSet "Set" #define XmCShadowThickness "ShadowThickness" #define XmCShadowType "ShadowType" #define XmCShellUnitType "ShellUnitType" #define XmCShowArrows "ShowArrows" #define XmCShowAsDefault "ShowAsDefault" #define XmCShowSeparator "ShowSeparator" #define XmCShowValue "ShowValue" #define XmCSimpleCheckBox "SimpleCheckBox" #define XmCSimpleMenuBar "SimpleMenuBar" #define XmCSimpleOptionMenu "SimpleOptionMenu" #define XmCSimplePopupMenu "SimplePopupMenu" #define XmCSimplePulldownMenu "SimplePulldownMenu" #define XmCSimpleRadioBox "SimpleRadioBox" #define XmCSizePolicy "SizePolicy" #define XmCSliderSize "SliderSize" #define XmCSource "Source" #define XmCSourceCursorIcon "SourceCursorIcon" #define XmCSourceIsExternal "SourceIsExternal" #define XmCSourcePixmapIcon "SourcePixmapIcon" #define XmCSourceWidget "SourceWidget" #define XmCSourceWindow "SourceWindow" #define XmCSpacing "Spacing" #define XmCStartTime "StartTime" #define XmCStateCursorIcon "StateCursorIcon" #define XmCStringDirection "StringDirection" #define XmCTearOffModel "TearOffModel" #define XmCTextFontList "TextFontList" #define XmCTextString "TextString" #define XmCTextValue "TextValue" #define XmCTitleString "TitleString" #define XmCTopCharacter "TopCharacter" #define XmCTopItemPosition "TopItemPosition" #define XmCTopLevelEnterCallback "TopLevelEnterCallback" #define XmCTopLevelLeaveCallback "TopLevelLeaveCallback" #define XmCTopShadowColor "TopShadowColor" #define XmCTopShadowPixmap "TopShadowPixmap" #define XmCTransferProc "TransferProc" #define XmCTransferStatus "TransferStatus" #define XmCTraversalOn "TraversalOn" #define XmCTraversalType "TraversalType" #define XmCTreeUpdateProc "TreeUpdateProc" #define XmCTroughColor "TroughColor" #define XmCUnitType "UnitType" #define XmCUnpostBehavior "UnpostBehavior" #define XmCUnselectPixmap "UnselectPixmap" #define XmCUpdateSliderSize "UpdateSliderSize" #define XmCUseAsyncGeometry "UseAsyncGeometry" #define XmCUserData "UserData" #define XmCValidCursorForeground "ValidCursorForeground" #define XmCValueChangedCallback "ValueChangedCallback" #define XmCValueWcs "ValueWcs" #define XmCVerifyBell "VerifyBell" #define XmCVerticalAlignment "VerticalAlignment" #define XmCVerticalFontUnit "VerticalFontUnit" #define XmCVerticalScrollBar "VerticalScrollBar" #define XmCVisibleItemCount "VisibleItemCount" #define XmCVisibleWhenOff "VisibleWhenOff" #define XmCVisualPolicy "VisualPolicy" #define XmCWhichButton "WhichButton" #define XmCWordWrap "WordWrap" #define XmCWorkWindow "WorkWindow" #define XmCXmString "XmString" #define XmNaccelerator "accelerator" #define XmNacceleratorText "acceleratorText" #define XmNactivateCallback "activateCallback" #define XmNadjustLast "adjustLast" #define XmNadjustMargin "adjustMargin" #define XmNalignment "alignment" #define XmNallowOverlap "allowOverlap" #define XmNallowResize "allowResize" #define XmNallowUnusedSpace "allowUnusedSpace" #define XmNanimationMask "animationMask" #define XmNanimationPixmap "animationPixmap" #define XmNanimationPixmapDepth "animationPixmapDepth" #define XmNanimationStyle "animationStyle" #define XmNapplyCallback "applyCallback" #define XmNapplyLabelString "applyLabelString" #define XmNarmCallback "armCallback" #define XmNarmColor "armColor" #define XmNarmPixmap "armPixmap" #define XmNarrowDirection "arrowDirection" #define XmNattachment "attachment" #define XmNaudibleWarning "audibleWarning" #define XmNautoShowCursorPosition "autoShowCursorPosition" #define XmNautoUnmanage "autoUnmanage" #define XmNautomaticSelection "automaticSelection" #define XmNavailability "availability" #define XmNblendModel "blendModel" #define XmNblinkRate "blinkRate" #define XmNbottomAttachment "bottomAttachment" #define XmNbottomOffset "bottomOffset" #define XmNbottomPosition "bottomPosition" #define XmNbottomShadowColor "bottomShadowColor" #define XmNbottomShadowPixmap "bottomShadowPixmap" #define XmNbottomWidget "bottomWidget" #define XmNbrowseSelectionCallback "browseSelectionCallback" #define XmNbuttonAcceleratorText "buttonAcceleratorText" #define XmNbuttonAccelerators "buttonAccelerators" #define XmNbuttonCount "buttonCount" #define XmNbuttonFontList "buttonFontList" #define XmNbuttonMnemonicCharSets "buttonMnemonicCharSets" #define XmNbuttonMnemonics "buttonMnemonics" #define XmNbuttonSet "buttonSet" #define XmNbuttonType "buttonType" #define XmNbuttons "buttons" #define XmNcancelButton "cancelButton" #define XmNcancelCallback "cancelCallback" #define XmNcancelLabelString "cancelLabelString" #define XmNcascadePixmap "cascadePixmap" #define XmNcascadingCallback "cascadingCallback" #define XmNchildHorizontalAlignment "childHorizontalAlignment" #define XmNchildHorizontalSpacing "childHorizontalSpacing" #define XmNchildPlacement "childPlacement" #define XmNchildPosition "childPosition" #define XmNchildType "childType" #define XmNchildVerticalAlignment "childVerticalAlignment" #define XmNclientData "clientData" #define XmNclipWindow "clipWindow" #define XmNcolumns "columns" #define XmNcommand "command" #define XmNcommandChangedCallback "commandChangedCallback" #define XmNcommandEnteredCallback "commandEnteredCallback" #define XmNcommandWindow "commandWindow" #define XmNcommandWindowLocation "commandWindowLocation" #define XmNconvertProc "convertProc" #define XmNcursorBackground "cursorBackground" #define XmNcursorForeground "cursorForeground" #define XmNcursorPosition "cursorPosition" #define XmNcursorPositionVisible "cursorPositionVisible" #define XmNdarkThreshold "darkThreshold" #define XmNdecimalPoints "decimalPoints" #define XmNdecrementCallback "decrementCallback" #define XmNdefaultActionCallback "defaultActionCallback" #define XmNdefaultButton "defaultButton" #define XmNdefaultButtonShadowThickness "defaultButtonShadowThickness" #define XmNdefaultButtonType "defaultButtonType" #define XmNdefaultCopyCursorIcon "defaultCopyCursorIcon" #define XmNdefaultFontList "defaultFontList" #define XmNdefaultInvalidCursorIcon "defaultInvalidCursorIcon" #define XmNdefaultLinkCursorIcon "defaultLinkCursorIcon" #define XmNdefaultMoveCursorIcon "defaultMoveCursorIcon" #define XmNdefaultNoneCursorIcon "defaultNoneCursorIcon" #define XmNdefaultPosition "defaultPosition" #define XmNdefaultSourceCursorIcon "defaultSourceCursorIcon" #define XmNdefaultValidCursorIcon "defaultValidCursorIcon" #define XmNdeleteResponse "deleteResponse" #define XmNdesktopParent "desktopParent" #define XmNdialogStyle "dialogStyle" #define XmNdialogTitle "dialogTitle" #define XmNdialogType "dialogType" #define XmNdirListItemCount "dirListItemCount" #define XmNdirListItems "dirListItems" #define XmNdirListLabelString "dirListLabelString" #define XmNdirMask "dirMask" #define XmNdirSearchProc "dirSearchProc" #define XmNdirSpec "dirSpec" #define XmNdirectory "directory" #define XmNdirectoryValid "directoryValid" #define XmNdisarmCallback "disarmCallback" #define XmNdoubleClickInterval "doubleClickInterval" #define XmNdragCallback "dragCallback" #define XmNdragContextClass "dragContextClass" #define XmNdragDropFinishCallback "dragDropFinishCallback" #define XmNdragIconClass "dragIconClass" #define XmNdragInitiatorProtocolStyle "dragInitiatorProtocolStyle" #define XmNdragMotionCallback "dragMotionCallback" #define XmNdragOperations "dragOperations" #define XmNdragOverMode "dragOverMode" #define XmNdragProc "dragProc" #define XmNdragReceiverProtocolStyle "dragReceiverProtocolStyle" #define XmNdropFinishCallback "dropFinishCallback" #define XmNdropProc "dropProc" #define XmNdropRectangles "dropRectangles" #define XmNdropSiteActivity "dropSiteActivity" #define XmNdropSiteEnterCallback "dropSiteEnterCallback" #define XmNdropSiteLeaveCallback "dropSiteLeaveCallback" #define XmNdropSiteManagerClass "dropSiteManagerClass" #define XmNdropSiteOperations "dropSiteOperations" #define XmNdropSiteType "dropSiteType" #define XmNdropStartCallback "dropStartCallback" #define XmNdropTransferClass "dropTransferClass" #define XmNdropTransfers "dropTransfers" #define XmNeditMode "editMode" #define XmNeditable "editable" #define XmNentryAlignment "entryAlignment" #define XmNentryBorder "entryBorder" #define XmNentryCallback "entryCallback" #define XmNentryClass "entryClass" #define XmNentryVerticalAlignment "entryVerticalAlignment" #define XmNexportTargets "exportTargets" #define XmNexposeCallback "exposeCallback" #define XmNextendedSelectionCallback "extendedSelectionCallback" #define XmNextensionType "extensionType" #define XmNfileListItemCount "fileListItemCount" #define XmNfileListItems "fileListItems" #define XmNfileListLabelString "fileListLabelString" #define XmNfileSearchProc "fileSearchProc" #define XmNfileTypeMask "fileTypeMask" #define XmNfillOnArm "fillOnArm" #define XmNfillOnSelect "fillOnSelect" #define XmNfilterLabelString "filterLabelString" #define XmNfocusCallback "focusCallback" #define XmNfocusMovedCallback "focusMovedCallback" #define XmNfocusPolicyChanged "focusPolicyChanged" #define XmNfontList "fontList" #define XmNforegroundThreshold "foregroundThreshold" #define XmNfractionBase "fractionBase" #define XmNgainPrimaryCallback "gainPrimaryCallback" #define XmNhelpCallback "helpCallback" #define XmNhelpLabelString "helpLabelString" #define XmNhighlightColor "highlightColor" #define XmNhighlightOnEnter "highlightOnEnter" #define XmNhighlightPixmap "highlightPixmap" #define XmNhighlightThickness "highlightThickness" #define XmNhistoryItemCount "historyItemCount" #define XmNhistoryItems "historyItems" #define XmNhistoryMaxItems "historyMaxItems" #define XmNhistoryVisibleItemCount "historyVisibleItemCount" #define XmNhorizontalFontUnit "horizontalFontUnit" #define XmNhorizontalScrollBar "horizontalScrollBar" #define XmNhorizontalSpacing "horizontalSpacing" #define XmNhotX "hotX" #define XmNhotY "hotY" #define XmNiccHandle "iccHandle" #define XmNimportTargets "importTargets" #define XmNincrement "increment" #define XmNincrementCallback "incrementCallback" #define XmNincremental "incremental" #define XmNindicatorOn "indicatorOn" #define XmNindicatorSize "indicatorSize" #define XmNindicatorType "indicatorType" #define XmNinitialDelay "initialDelay" #define XmNinitialFocus "initialFocus" #define XmNinputCallback "inputCallback" #define XmNinputCreate "inputCreate" #define XmNinputMethod "inputMethod" #define XmNinvalidCursorForeground "invalidCursorForeground" #define XmNisAligned "isAligned" #define XmNisHomogeneous "isHomogeneous" #define XmNitemCount "itemCount" #define XmNitems "items" #define XmNkeyboardFocusPolicy "keyboardFocusPolicy" #define XmNlabelFontList "labelFontList" #define XmNlabelInsensitivePixmap "labelInsensitivePixmap" #define XmNlabelPixmap "labelPixmap" #define XmNlabelString "labelString" #define XmNlabelType "labelType" #define XmNleftAttachment "leftAttachment" #define XmNleftOffset "leftOffset" #define XmNleftPosition "leftPosition" #define XmNleftWidget "leftWidget" #define XmNlightThreshold "lightThreshold" #define XmNlineSpace "lineSpace" #define XmNlistItemCount "listItemCount" #define XmNlistItems "listItems" #define XmNlistLabelString "listLabelString" #define XmNlistMarginHeight "listMarginHeight" #define XmNlistMarginWidth "listMarginWidth" #define XmNlistSizePolicy "listSizePolicy" #define XmNlistSpacing "listSpacing" #define XmNlistUpdated "listUpdated" #define XmNlistVisibleItemCount "listVisibleItemCount" #define XmNlogicalParent "logicalParent" #define XmNlosePrimaryCallback "losePrimaryCallback" #define XmNlosingFocusCallback "losingFocusCallback" #define XmNmainWindowMarginHeight "mainWindowMarginHeight" #define XmNmainWindowMarginWidth "mainWindowMarginWidth" #define XmNmapCallback "mapCallback" #define XmNmappingDelay "mappingDelay" #define XmNmargin "margin" #define XmNmarginBottom "marginBottom" #define XmNmarginHeight "marginHeight" #define XmNmarginLeft "marginLeft" #define XmNmarginRight "marginRight" #define XmNmarginTop "marginTop" #define XmNmarginWidth "marginWidth" #define XmNmask "mask" #define XmNmaxLength "maxLength" #define XmNmaximum "maximum" #define XmNmenuAccelerator "menuAccelerator" #define XmNmenuBar "menuBar" #define XmNmenuCursor "menuCursor" #define XmNmenuHelpWidget "menuHelpWidget" #define XmNmenuHistory "menuHistory" #define XmNmenuPost "menuPost" #define XmNmessageAlignment "messageAlignment" #define XmNmessageProc "messageProc" #define XmNmessageString "messageString" #define XmNmessageWindow "messageWindow" #define XmNminimizeButtons "minimizeButtons" #define XmNminimum "minimum" #define XmNmnemonic "mnemonic" #define XmNmnemonicCharSet "mnemonicCharSet" #define XmNmodifyVerifyCallback "modifyVerifyCallback" #define XmNmodifyVerifyCallbackWcs "modifyVerifyCallbackWcs" #define XmNmotionVerifyCallback "motionVerifyCallback" #define XmNmoveOpaque "moveOpaque" #define XmNmultiClick "multiClick" #define XmNmultipleSelectionCallback "multipleSelectionCallback" #define XmNmustMatch "mustMatch" #define XmNmwmDecorations "mwmDecorations" #define XmNmwmFunctions "mwmFunctions" #define XmNmwmInputMode "mwmInputMode" #define XmNmwmMenu "mwmMenu" #define XmNmwmMessages "mwmMessages" #define XmNnavigationType "navigationType" #define XmNneedsMotion "needsMotion" #define XmNnoMatchCallback "noMatchCallback" #define XmNnoMatchString "noMatchString" #define XmNnoResize "noResize" #define XmNnoneCursorForeground "noneCursorForeground" #define XmNnotifyProc "notifyProc" #define XmNnumColumns "numColumns" #define XmNnumDropRectangles "numDropRectangles" #define XmNnumDropTransfers "numDropTransfers" #define XmNnumExportTargets "numExportTargets" #define XmNnumImportTargets "numImportTargets" #define XmNnumRectangles "numRectangles" #define XmNoffsetX "offsetX" #define XmNoffsetY "offsetY" #define XmNokCallback "okCallback" #define XmNokLabelString "okLabelString" #define XmNoperationChangedCallback "operationChangedCallback" #define XmNoperationCursorIcon "operationCursorIcon" #define XmNoptionLabel "optionLabel" #define XmNoptionMnemonic "optionMnemonic" #define XmNoutputCreate "outputCreate" #define XmNpacking "packing" #define XmNpageDecrementCallback "pageDecrementCallback" #define XmNpageIncrement "pageIncrement" #define XmNpageIncrementCallback "pageIncrementCallback" #define XmNpaneMaximum "paneMaximum" #define XmNpaneMinimum "paneMinimum" #define XmNpattern "pattern" #define XmNpendingDelete "pendingDelete" #define XmNpopupEnabled "popupEnabled" #define XmNpositionIndex "positionIndex" #define XmNpostFromButton "postFromButton" #define XmNpostFromCount "postFromCount" #define XmNpostFromList "postFromList" #define XmNpreeditType "preeditType" #define XmNprocessingDirection "processingDirection" #define XmNpromptString "promptString" #define XmNprotocolCallback "protocolCallback" #define XmNpushButtonEnabled "pushButtonEnabled" #define XmNqualifySearchDataProc "qualifySearchDataProc" #define XmNradioAlwaysOne "radioAlwaysOne" #define XmNradioBehavior "radioBehavior" #define XmNrealizeCallback "realizeCallback" #define XmNrecomputeSize "recomputeSize" #define XmNrectangles "rectangles" #define XmNrefigureMode "refigureMode" #define XmNrepeatDelay "repeatDelay" #define XmNresizable "resizable" #define XmNresizeCallback "resizeCallback" #define XmNresizeHeight "resizeHeight" #define XmNresizePolicy "resizePolicy" #define XmNresizeWidth "resizeWidth" #define XmNrightAttachment "rightAttachment" #define XmNrightOffset "rightOffset" #define XmNrightPosition "rightPosition" #define XmNrightWidget "rightWidget" #define XmNrowColumnType "rowColumnType" #define XmNrows "rows" #define XmNrubberPositioning "rubberPositioning" #define XmNsashHeight "sashHeight" #define XmNsashIndent "sashIndent" #define XmNsashShadowThickness "sashShadowThickness" #define XmNsashWidth "sashWidth" #define XmNscaleHeight "scaleHeight" #define XmNscaleMultiple "scaleMultiple" #define XmNscaleWidth "scaleWidth" #define XmNscrollBarDisplayPolicy "scrollBarDisplayPolicy" #define XmNscrollBarPlacement "scrollBarPlacement" #define XmNscrollHorizontal "scrollHorizontal" #define XmNscrollLeftSide "scrollLeftSide" #define XmNscrollTopSide "scrollTopSide" #define XmNscrollVertical "scrollVertical" #define XmNscrolledWindowMarginHeight "scrolledWindowMarginHeight" #define XmNscrolledWindowMarginWidth "scrolledWindowMarginWidth" #define XmNscrollingPolicy "scrollingPolicy" #define XmNselectColor "selectColor" #define XmNselectInsensitivePixmap "selectInsensitivePixmap" #define XmNselectPixmap "selectPixmap" #define XmNselectThreshold "selectThreshold" #define XmNselectedItemCount "selectedItemCount" #define XmNselectedItems "selectedItems" #define XmNselectionArrayCount "selectionArrayCount" #define XmNselectionLabelString "selectionLabelString" #define XmNselectionPolicy "selectionPolicy" #define XmNseparatorOn "separatorOn" #define XmNseparatorType "separatorType" #define XmNset "set" #define XmNshadow "shadow" #define XmNshadowThickness "shadowThickness" #define XmNshadowType "shadowType" #define XmNshellUnitType "shellUnitType" #define XmNshowArrows "showArrows" #define XmNshowAsDefault "showAsDefault" #define XmNshowSeparator "showSeparator" #define XmNshowValue "showValue" #define XmNsimpleCallback "simpleCallback" #define XmNsingleSelectionCallback "singleSelectionCallback" #define XmNsizePolicy "sizePolicy" #define XmNskipAdjust "skipAdjust" #define XmNsliderSize "sliderSize" #define XmNsource "source" #define XmNsourceCursorIcon "sourceCursorIcon" #define XmNsourceIsExternal "sourceIsExternal" #define XmNsourcePixmapIcon "sourcePixmapIcon" #define XmNsourceWidget "sourceWidget" #define XmNsourceWindow "sourceWindow" #define XmNspacing "spacing" #define XmNspotLocation "spotLocation" #define XmNstartTime "startTime" #define XmNstateCursorIcon "stateCursorIcon" #define XmNstringDirection "stringDirection" #define XmNsubMenuId "subMenuId" #define XmNsymbolPixmap "symbolPixmap" #define XmNtearOffMenuActivateCallback "tearOffMenuActivateCallback" #define XmNtearOffMenuDeactivateCallback "tearOffMenuDeactivateCallback" #define XmNtearOffModel "tearOffModel" #define XmNtextAccelerators "textAccelerators" #define XmNtextColumns "textColumns" #define XmNtextFontList "textFontList" #define XmNtextString "textString" #define XmNtextTranslations "textTranslations" #define XmNtextValue "textValue" #define XmNtitleString "titleString" #define XmNtoBottomCallback "toBottomCallback" #define XmNtoPositionCallback "toPositionCallback" #define XmNtoTopCallback "toTopCallback" #define XmNtopAttachment "topAttachment" #define XmNtopCharacter "topCharacter" #define XmNtopItemPosition "topItemPosition" #define XmNtopLevelEnterCallback "topLevelEnterCallback" #define XmNtopLevelLeaveCallback "topLevelLeaveCallback" #define XmNtopOffset "topOffset" #define XmNtopPosition "topPosition" #define XmNtopShadowColor "topShadowColor" #define XmNtopShadowPixmap "topShadowPixmap" #define XmNtopWidget "topWidget" #define XmNtransferProc "transferProc" #define XmNtransferStatus "transferStatus" #define XmNtraversalCallback "traversalCallback" #define XmNtraversalOn "traversalOn" #define XmNtraversalType "traversalType" #define XmNtraverseObscuredCallback "traverseObscuredCallback" #define XmNtreeUpdateProc "treeUpdateProc" #define XmNtroughColor "troughColor" #define XmNunitType "unitType" #define XmNunmapCallback "unmapCallback" #define XmNunpostBehavior "unpostBehavior" #define XmNunselectPixmap "unselectPixmap" #define XmNupdateSliderSize "updateSliderSize" #define XmNuseAsyncGeometry "useAsyncGeometry" #define XmNuserData "userData" #define XmNvalidCursorForeground "validCursorForeground" #define XmNvalueChangedCallback "valueChangedCallback" #define XmNvalueWcs "valueWcs" #define XmNverifyBell "verifyBell" #define XmNverticalFontUnit "verticalFontUnit" #define XmNverticalScrollBar "verticalScrollBar" #define XmNverticalSpacing "verticalSpacing" #define XmNvisibleItemCount "visibleItemCount" #define XmNvisibleWhenOff "visibleWhenOff" #define XmNvisualPolicy "visualPolicy" #define XmNwhichButton "whichButton" #define XmNwordWrap "wordWrap" #define XmNworkWindow "workWindow" #define XmRAlignment "Alignment" #define XmRAnimationMask "AnimationMask" #define XmRAnimationPixmap "AnimationPixmap" #define XmRAnimationStyle "AnimationStyle" #define XmRArrowDirection "ArrowDirection" #define XmRAtomList "AtomList" #define XmRAttachment "Attachment" #define XmRAudibleWarning "AudibleWarning" #define XmRAvailability "Availability" #define XmRBackgroundPixmap "BackgroundPixmap" #define XmRBlendModel "BlendModel" #define XmRBooleanDimension "BooleanDimension" #define XmRBottomShadowPixmap "BottomShadowPixmap" #define XmRButtonType "ButtonType" #define XmRCallbackProc "CallbackProc" #define XmRChar "Char" #define XmRCharSetTable "CharSetTable" #define XmRChildHorizontalAlignment "ChildHorizontalAlignment" #define XmRChildPlacement "ChildPlacement" #define XmRChildType "ChildType" #define XmRChildVerticalAlignment "ChildVerticalAlignment" #define XmRCommandWindowLocation "CommandWindowLocation" #define XmRCompoundText "CompoundText" #define XmRDefaultButtonType "DefaultButtonType" #define XmRDeleteResponse "DeleteResponse" #define XmRDialogStyle "DialogStyle" #define XmRDialogType "DialogType" #define XmRDoubleClickInterval "DoubleClickInterval" #define XmRDragInitiatorProtocolStyle "DragInitiatorProtocolStyle" #define XmRDragReceiverProtocolStyle "DragReceiverProtocolStyle" #define XmRDropSiteActivity "DropSiteActivity" #define XmRDropSiteOperations "DropSiteOperations" #define XmRDropSiteType "DropSiteType" #define XmRDropTransfers "DropTransfers" #define XmRExtensionType "ExtensionType" #define XmRFileTypeMask "FileTypeMask" #define XmRFontList "FontList" #define XmRGadgetPixmap "GadgetPixmap" #define XmRHighlightPixmap "HighlightPixmap" #define XmRHorizontalDimension "HorizontalDimension" #define XmRHorizontalInt "HorizontalInt" #define XmRHorizontalPosition "HorizontalPosition" #define XmRIconAttachment "IconAttachment" #define XmRImportTargets "ImportTargets" #define XmRIndicatorType "IndicatorType" #define XmRItemCount "ItemCount" #define XmRItems "Items" #define XmRKeySym "KeySym" #define XmRKeySymTable "KeySymTable" #define XmRKeyboardFocusPolicy "KeyboardFocusPolicy" #define XmRLabelType "LabelType" #define XmRListMarginHeight "ListMarginHeight" #define XmRListMarginWidth "ListMarginWidth" #define XmRListSizePolicy "ListSizePolicy" #define XmRListSpacing "ListSpacing" #define XmRManBottomShadowPixmap "ManBottomShadowPixmap" #define XmRManForegroundPixmap "ManForegroundPixmap" #define XmRManHighlightPixmap "ManHighlightPixmap" #define XmRManTopShadowPixmap "ManTopShadowPixmap" #define XmRMenuWidget "MenuWidget" #define XmRMnemonic "Mnemonic" #define XmRMultiClick "MultiClick" #define XmRNavigationType "NavigationType" #define XmRPacking "Packing" #define XmRPrimForegroundPixmap "PrimForegroundPixmap" #define XmRProc "Proc" #define XmRProcessingDirection "ProcessingDirection" #define XmRRectangleList "RectangleList" #define XmRResizePolicy "ResizePolicy" #define XmRRowColumnType "RowColumnType" #define XmRScrollBarDisplayPolicy "ScrollBarDisplayPolicy" #define XmRScrollBarPlacement "ScrollBarPlacement" #define XmRScrollingPolicy "ScrollingPolicy" #define XmRSelectedItemCount "SelectedItemCount" #define XmRSelectedItems "SelectedItems" #define XmRSelectionPolicy "SelectionPolicy" #define XmRSelectionType "SelectionType" #define XmRSeparatorType "SeparatorType" #define XmRShadowType "ShadowType" #define XmRShellHorizDim "ShellHorizDim" #define XmRShellHorizPos "ShellHorizPos" #define XmRShellUnitType "ShellUnitType" #define XmRShellVertDim "ShellVertDim" #define XmRShellVertPos "ShellVertPos" #define XmRSizePolicy "SizePolicy" #define XmRStringDirection "StringDirection" #define XmRTearOffModel "TearOffModel" #define XmRTopShadowPixmap "TopShadowPixmap" #define XmRTransferStatus "TransferStatus" #define XmRTraversalType "TraversalType" #define XmRUnitType "UnitType" #define XmRUnpostBehavior "UnpostBehavior" #define XmRValueWcs "ValueWcs" #define XmRVerticalAlignment "VerticalAlignment" #define XmRVerticalDimension "VerticalDimension" #define XmRVerticalInt "VerticalInt" #define XmRVerticalPosition "VerticalPosition" #define XmRVirtualBinding "VirtualBinding" #define XmRVisibleItemCount "VisibleItemCount" #define XmRVisualPolicy "VisualPolicy" #define XmRWhichButton "WhichButton" #define XmRXmBackgroundPixmap "XmBackgroundPixmap" #define XmRXmString "XmString" #define XmRXmStringCharSet "XmStringCharSet" #define XmRXmStringTable "XmStringTable" #define XmVosfActivate "osfActivate" #define XmVosfAddMode "osfAddMode" #define XmVosfBackSpace "osfBackSpace" #define XmVosfBeginLine "osfBeginLine" #define XmVosfCancel "osfCancel" #define XmVosfClear "osfClear" #define XmVosfCopy "osfCopy" #define XmVosfCut "osfCut" #define XmVosfDelete "osfDelete" #define XmVosfDown "osfDown" #define XmVosfEndLine "osfEndLine" #define XmVosfHelp "osfHelp" #define XmVosfInsert "osfInsert" #define XmVosfLeft "osfLeft" #define XmVosfMenu "osfMenu" #define XmVosfMenuBar "osfMenuBar" #define XmVosfPageDown "osfPageDown" #define XmVosfPageLeft "osfPageLeft" #define XmVosfPageRight "osfPageRight" #define XmVosfPageUp "osfPageUp" #define XmVosfPaste "osfPaste" #define XmVosfPrimaryPaste "osfPrimaryPaste" #define XmVosfQuickPaste "osfQuickPaste" #define XmVosfRight "osfRight" #define XmVosfSelect "osfSelect" #define XmVosfUndo "osfUndo" #define XmVosfUp "osfUp" #define XmSFONTLIST_DEFAULT_TAG_STRING "FONTLIST_DEFAULT_TAG_STRING" #define XmSXmFONTLIST_DEFAULT_TAG_STRING "XmFONTLIST_DEFAULT_TAG_STRING" #define XmRTopItemPosition "TopItemPosition" #define XmNtearOffTitle "tearOffTitle" #define XmCTearOffTitle "TearOffTitle" #define XmNpopupHandlerCallback "popupHandlerCallback" #define XmNconvertCallback "convertCallback" #define XmNdestinationCallback "destinationCallback" #define XmNselectedItem "selectedItem" #define XmCSelectedItem "SelectedItem" #define XmNselectionCallback "selectionCallback" #define XmNmatchBehavior "matchBehavior" #define XmCMatchBehavior "MatchBehavior" #define XmNnoFontCallback "noFontCallback" #define XmNtextPath "textPath" #define XmNeditingPath "editingPath" #define XmCEditingPath "EditingPath" #define XmNbidirectionalCursor "bidirectionalCursor" #define XmCBidirectionalCursor "BidirectionalCursor" #define XmNcollapsedStatePixmap "collapsedStatePixmap" #define XmNdetailColumnHeading "detailColumnHeading" #define XmNdetailCount "detailCount" #define XmNdetailTabList "detailTabList" #define XmNexpandedStatePixmap "expandedStatePixmap" #define XmNlargeCellHeight "largeCellHeight" #define XmNlargeCellWidth "largeCellWidth" #define XmNlayoutType "layoutType" #define XmNoutlineIndentation "outlineIndentation" #define XmNoutlineLineStyle "outlineLineStyle" #define XmNprimaryOwnership "primaryOwnership" #define XmNselectionTechnique "selectionTechnique" #define XmNsmallCellHeight "smallCellHeight" #define XmNsmallCellWidth "smallCellWidth" #define XmNspatialStyle "spatialStyle" #define XmNentryParent "entryParent" #define XmNlargeIconX "largeIconX" #define XmNlargeIconY "largeIconY" #define XmNsmallIconX "smallIconX" #define XmNsmallIconY "smallIconY" #define XmCCollapsedStatePixmap "CollapsedStatePixmap" #define XmCDetailColumnHeading "DetailColumnHeading" #define XmCDetailCount "DetailCount" #define XmCDetailMask "DetailMask" #define XmCEntryViewType "EntryViewType" #define XmCLineStyle "LineStyle" #define XmCDetailTabList "DetailTabList" #define XmCExpandedStatePixmap "ExpandedStatePixmap" #define XmCIncludeModel "IncludeModel" #define XmCCellHeight "CellHeight" #define XmCCellWidth "CellWidth" #define XmCLayoutType "LayoutType" #define XmCOutlineIndentation "OutlineIndentation" #define XmCPlaceModel "PlaceModel" #define XmCPrimaryOwnership "PrimaryOwnership" #define XmCSelectionTechnique "SelectionTechnique" #define XmCSpatialStyle "SpatialStyle" #define XmCEntryDetail "EntryDetail" #define XmCExpandState "ExpandState" #define XmNlargeIcon "largeIcon" #define XmNlargeIconMask "largeIconMask" #define XmNlargeIconPixmap "largeIconPixmap" #define XmNsmallIcon "smallIcon" #define XmNsmallIconMask "smallIconMask" #define XmNsmallIconPixmap "smallIconPixmap" #define XmCIcon "Icon" #define XmCViewType "ViewType" #define XmCVisualEmphasis "VisualEmphasis" #define XmNcurrentPageNumber "currentPageNumber" #define XmNfirstPageNumber "firstPageNumber" #define XmNlastPageNumber "lastPageNumber" #define XmNbackPagePlacement "backPagePlacement" #define XmNbackPageNumber "backPageNumber" #define XmNbackPageSize "backPageSize" #define XmNbackPageForeground "backPageForeground" #define XmNbackPageBackground "backPageBackground" #define XmNframeBackground "frameBackground" #define XmNbindingType "bindingType" #define XmNbindingPixmap "bindingPixmap" #define XmNbindingWidth "bindingWidth" #define XmNmajorTabSpacing "majorTabSpacing" #define XmNminorTabSpacing "minorTabSpacing" #define XmNinnerMarginWidth "innerMarginWidth" #define XmNinnerMarginHeight "innerMarginHeight" #define XmNframeShadowThickness "frameShadowThickness" #define XmNpageNumber "pageNumber" #define XmCCurrentPageNumber "CurrentPageNumber" #define XmCFirstPageNumber "FirstPageNumber" #define XmCLastPageNumber "LastPageNumber" #define XmCBackPagePlacement "BackPagePlacement" #define XmCBackPageNumber "BackPageNumber" #define XmCBackPageSize "BackPageSize" #define XmCBackPageForeground "BackPageForeground" #define XmCBackPageBackground "BackPageBackground" #define XmCFrameBackground "FrameBackground" #define XmCBindingType "BindingType" #define XmCBindingPixmap "BindingPixmap" #define XmCBindingWidth "BindingWidth" #define XmCMajorTabSpacing "MajorTabSpacing" #define XmCMinorTabSpacing "MinorTabSpacing" #define XmCInnerMarginWidth "InnerMarginWidth" #define XmCInnerMarginHeight "InnerMarginHeight" #define XmCPageChangeCallback "PageChangeCallback" #define XmCPageNumber "PageNumber" #define XmRArrowLayout "ArrowLayout" #define XmRArrowSensitivity "ArrowSensitivity" #define XmRSpinBoxChildType "SpinBoxChildType" #define XmNarrowLayout "arrowLayout" #define XmCArrowLayout "ArrowLayout" #define XmNarrowSensitivity "arrowSensitivity" #define XmCArrowSensitivity "ArrowSensitivity" #define XmNdefaultArrowSensitivity "defaultArrowSensitivity" #define XmCDefaultArrowSensitivity "DefaultArrowSensitivity" #define XmNarrowSize "arrowSize" #define XmCArrowSize "ArrowSize" #define XmNspinBoxChildType "spinBoxChildType" #define XmCSpinBoxChildType "SpinBoxChildType" #define XmNposition "position" #define XmNnumValues "numValues" #define XmCNumValues "NumValues" #define XmNvalues "values" #define XmCValues "Values" #define XmNminimumValue "minimumValue" #define XmCMinimumValue "MinimumValue" #define XmNmaximumValue "maximumValue" #define XmCMaximumValue "MaximumValue" #define XmNincrementValue "incrementValue" #define XmCIncrementValue "IncrementValue" #define XmRAutomaticSelection "AutomaticSelection" #define XmRLineStyle "LineStyle" #define XmREntryViewType "EntryViewType" #define XmRDirection "Direction" #define XmRLayoutType "LayoutType" #define XmRPrimaryOwnership "PrimaryOwnership" #define XmRSelectionTechnique "SelectionTechnique" #define XmRSpatialStyle "SpatialStyle" #define XmRTabList "TabList" #define XmRViewType "ViewType" #define XmRVisualEmphasis "VisualEmphasis" #define XmRBindingType "BindingType" #define XmRNBChildType "NBChildType" #define XmNentryViewType "entryViewType" #define XmNinsensitiveStippleBitmap "insensitiveStippleBitmap" #define XmNlayoutDirection "layoutDirection" #define XmNviewType "viewType" #define XmNvisualEmphasis "visualEmphasis" #define XmCLayoutDirection "LayoutDirection" #define XmNsnapBackMultiple "snapBackMultiple" #define XmNslidingMode "slidingMode" #define XmNsliderVisual "sliderVisual" #define XmNautoDragModel "autoDragModel" #define XmNcolorCalculationProc "colorCalculationProc" #define XmNbitmapConversionModel "bitmapConversionModel" #define XmNcolorAllocationProc "colorAllocationProc" #define XmNselectionMode "selectionMode" #define XmNselectedPositions "selectedPositions" #define XmNselectedPositionCount "selectedPositionCount" #define XmCSnapBackMultiple "SnapBackMultiple" #define XmCSliderVisual "SliderVisual" #define XmCSlidingMode "SlidingMode" #define XmCAutoDragModel "AutoDragModel" #define XmCColorCalculationProc "ColorCalculationProc" #define XmCBitmapConversionModel "BitmapConversionModel" #define XmCColorAllocationProc "ColorAllocationProc" #define XmCInsensitiveStippleBitmap "InsensitiveStippleBitmap" #define XmCSelectionMode "SelectionMode" #define XmCSelectedPositions "SelectedPositions" #define XmCSelectedPositionCount "SelectedPositionCount" #define XmRSlidingMode "SlidingMode" #define XmRShowArrows "ShowArrows" #define XmRSliderVisual "SliderVisual" #define XmRShowValue "ShowValue" #define XmRAutoDragModel "AutoDragModel" #define XmRSWChildType "SWChildType" #define XmRBitmapConversionModel "BitmapConversionModel" #define XmRSelectionMode "SelectionMode" #define XmNinputPolicy "inputPolicy" #define XmCInputPolicy "InputPolicy" #define XmRInputPolicy "InputPolicy" #define XmNtoggleMode "toggleMode" #define XmCToggleMode "ToggleMode" #define XmRToggleMode "ToggleMode" #define XmRIndicatorOn "IndicatorOn" #define XmRSet "Set" #define XmNindeterminatePixmap "indeterminatePixmap" #define XmCIndeterminatePixmap "IndeterminatePixmap" #define XmNunselectColor "unselectColor" #define XmCUnselectColor "UnselectColor" #define XmNselectedPosition "selectedPosition" #define XmNarrowSpacing "arrowSpacing" #define XmCArrowSpacing "ArrowSpacing" #define XmRMatchBehavior "MatchBehavior" #define XmRComboBoxType "ComboBoxType" #define XmCSelectedPosition "SelectedPosition" #define XmNenableWarp "enableWarp" #define XmCEnableWarp "EnableWarp" #define XmREnableWarp "EnableWarp" #define XmNmotifVersion "motifVersion" #define XmCMotifVersion "MotifVersion" #define XmNdefaultGlyphPixmap "defaultGlyphPixmap" #define XmCDefaultGlyphPixmap "DefaultGlyphPixmap" #define XmCRendition "Rendition" #define XmNtag "tag" #define XmCTag "Tag" #define XmNfontName "fontName" #define XmCFontName "FontName" #define XmNfontType "fontType" #define XmCFontType "FontType" #define XmRFontType "FontType" #define XmNloadModel "loadModel" #define XmCLoadModel "LoadModel" #define XmRLoadModel "LoadModel" #define XmNtabList "tabList" #define XmCTabList "TabList" #define XmRRenditionPixel "RenditionPixel" #define XmNunderlineType "underlineType" #define XmCUnderlineType "UnderlineType" #define XmNstrikethruType "strikethruType" #define XmCStrikethruType "StrikethruType" #define XmRLineType "LineType" #define XmNrenderTable "renderTable" #define XmCRenderTable "RenderTable" #define XmRRenderTable "RenderTable" #define XmNbuttonRenderTable "buttonRenderTable" #define XmCButtonRenderTable "ButtonRenderTable" #define XmRButtonRenderTable "ButtonRenderTable" #define XmNlabelRenderTable "labelRenderTable" #define XmCLabelRenderTable "LabelRenderTable" #define XmRLabelRenderTable "LabelRenderTable" #define XmNtextRenderTable "textRenderTable" #define XmCTextRenderTable "TextRenderTable" #define XmRTextRenderTable "TextRenderTable" #define XmNdragStartCallback "dragStartCallback" #define XmNnoRenditionCallback "noRenditionCallback" #define XmSXmAS_IS "XmAS_IS" #define XmMIsWhiteSpaceMethod "IsWhiteSpaceMethod" #define XmMIsScanBreakMethod "IsScanBreakMethod" #define XmMCharDirection "CharDirection" #define XmMInitialCharsDirection "InitialCharsDirection" #define XmNpatternType "patternType" #define XmNsubstitute "substitute" #define XmNinvokeParseProc "invokeParseProc" #define XmNincludeStatus "includeStatus" #define XmVosfBackTab "osfBackTab" #define XmVosfBeginData "osfBeginData" #define XmVosfDeselectAll "osfDeselectAll" #define XmVosfEndData "osfEndData" #define XmVosfEscape "osfEscape" #define XmVosfExtend "osfExtend" #define XmVosfLeftLine "osfLeftLine" #define XmVosfNext "osfNext" #define XmVosfNextField "osfNextField" #define XmVosfNextMenu "osfNextMenu" #define XmVosfNextMinor "osfNextMinor" #define XmVosfPrevField "osfPrevField" #define XmVosfPrevMenu "osfPrevMenu" #define XmVosfPrior "osfPrior" #define XmVosfPriorMinor "osfPriorMinor" #define XmVosfReselect "osfReselect" #define XmVosfRestore "osfRestore" #define XmVosfRightLine "osfRightLine" #define XmVosfSelectAll "osfSelectAll" #define XmVosfSwitchDirection "osfSwitchDirection" #define XmNnotebookChildType "notebookChildType" #define XmCNotebookChildType "NotebookChildType" #define XmRNotebookChildType "NotebookChildType" #define XmNscrolledWindowChildType "scrolledWindowChildType" #define XmCScrolledWindowChildType "ScrolledWindowChildType" #define XmRScrolledWindowChildType "ScrolledWindowChildType" #define XmNselectedObjects "selectedObjects" #define XmCSelectedObjects "SelectedObjects" #define XmNselectedObjectCount "selectedObjectCount" #define XmCSelectedObjectCount "SelectedObjectCount" #define XmNcomboBoxType "comboBoxType" #define XmCComboBoxType "ComboBoxType" #define XmNtabValue "tabValue" #define XmNoffsetModel "offsetModel" #define XmNdecimal "decimal" #define XmNdetail "detail" #define XmCDetail "Detail" #define XmNdetailCount "detailCount" #define XmCDetailCount "DetailCount" #define XmNcontainerID "containerID" #define XmCContainerID "ContainerID" #define XmSCLIENT_WINDOW "CLIENT_WINDOW" #define XmSCLIP_TEMPORARY "CLIP_TEMPORARY" #define XmSCLIPBOARD "CLIPBOARD" #define XmSCOMPOUND_TEXT "COMPOUND_TEXT" #define XmSDELETE "DELETE" #define XmSFILE "FILE" #define XmSFILE_NAME "FILE_NAME" #define XmSINCR "INCR" #define XmSINSERT_PROPERTY "INSERT_PROPERTY" #define XmSINSERT_SELECTION "INSERT_SELECTION" #define XmSLENGTH "LENGTH" #define XmSLINK_SELECTION "LINK_SELECTION" #define XmS_MOTIF_ATOM_0 "_MOTIF_ATOM_0" #define XmS_MOTIF_BINDINGS "_MOTIF_BINDINGS" #define XmS_MOTIF_DEFAULT_BINDINGS "_MOTIF_DEFAULT_BINDINGS" #define XmS_MOTIF_CANCEL_DROP_EFFECT "_MOTIF_CANCEL_DROP_EFFECT" #define XmS_MOTIF_CLIP_HEADER "_MOTIF_CLIP_HEADER" #define XmS_MOTIF_CLIP_DATA_REQUEST "_MOTIF_CLIP_DATA_REQUEST" #define XmS_MOTIF_CLIP_DATA_DELETE "_MOTIF_CLIP_DATA_DELETE" #define XmS_MOTIF_CLIP_ITEM "_MOTIF_CLIP_ITEM" #define XmS_MOTIF_CLIP_LOCK "_MOTIF_CLIP_LOCK" #define XmS_MOTIF_CLIP_LOCK_ACCESS_VALID "_MOTIF_CLIP_LOCK_ACCESS_VALID" #define XmS_MOTIF_CLIP_MESSAGE "_MOTIF_CLIP_MESSAGE" #define XmS_MOTIF_CLIP_NEXT_ID "_MOTIF_CLIP_NEXT_ID" #define XmS_MOTIF_CLIP_TIME "_MOTIF_CLIP_TIME" #define XmS_MOTIF_CLIPBOARD_TARGETS "_MOTIF_CLIPBOARD_TARGETS" #define XmS_MOTIF_COMPOUND_STRING "_MOTIF_COMPOUND_STRING" #define XmS_MOTIF_DEFERRED_CLIPBOARD_TARGETS "_MOTIF_DEFERRED_CLIPBOARD_TARGETS" #define XmS_MOTIF_DESTINATION "_MOTIF_DESTINATION" #define XmS_MOTIF_DRAG_OFFSET "_MOTIF_DRAG_OFFSET" #define XmS_MOTIF_DROP "_MOTIF_DROP" #define XmS_MOTIF_ENCODING_REGISTRY "_MOTIF_ENCODING_REGISTRY" #define XmS_MOTIF_EXPORT_TARGETS "_MOTIF_EXPORT_TARGETS" #define XmS_MOTIF_LOSE_SELECTION "_MOTIF_LOSE_SELECTION" #define XmS_MOTIF_RENDER_TABLE "_MOTIF_RENDER_TABLE" #define XmS_MOTIF_WM_QUERY "_MOTIF_WM_QUERY" #define XmS_MOTIF_WM_ALL_CLIENTS "_MOTIF_WM_ALL_CLIENTS" #define XmSMULTIPLE "MULTIPLE" #define XmSNULL "NULL" #define XmSTARGETS "TARGETS" #define XmSTEXT "TEXT" #define XmSTIMESTAMP "TIMESTAMP" #define XmSWM_STATE "WM_STATE" #define XmSTRANSFER_SUCCESS "XmTRANSFER_SUCCESS" #define XmSTRANSFER_FAILURE "XmTRANSFER_FAILURE" #define XmNpathMode "pathMode" #define XmRPathMode "PathMode" #define XmCPathMode "PathMode" #define XmNfileFilterStyle "fileFilterStyle" #define XmRFileFilterStyle "FileFilterStyle" #define XmCFileFilterStyle "FileFilterStyle" #define XmNdirTextLabelString "dirTextLabelString" #define XmCDirTextLabelString "DirTextLabelString" #define XmNenableBtn1Transfer "enableBtn1Transfer" #define XmCEnableBtn1Transfer "EnableBtn1Transfer" #define XmNenableButtonTab "enableButtonTab" #define XmCEnableButtonTab "EnableButtonTab" #define XmNenableEtchedInMenu "enableEtchedInMenu" #define XmCEnableEtchedInMenu "EnableEtchedInMenu" #define XmNdefaultButtonEmphasis "defaultButtonEmphasis" #define XmCDefaultButtonEmphasis "DefaultButtonEmphasis" #define XmRDefaultButtonEmphasis "DefaultButtonEmphasis" #define XmNenableToggleColor "enableToggleColor" #define XmCEnableToggleColor "EnableToggleColor" #define XmNenableToggleVisual "enableToggleVisual" #define XmCEnableToggleVisual "EnableToggleVisual" #define XmNenableDragIcon "enableDragIcon" #define XmCEnableDragIcon "EnableDragIcon" #define XmNenableUnselectableDrag "enableUnselectableDrag" #define XmCEnableUnselectableDrag "EnableUnselectableDrag" #define XmNdragOverActiveMode "dragOverActiveMode" #define XmCDragOverActiveMode "DragOverActiveMode" #define XmNinstallColormap "installColormap" #define XmCInstallColormap "InstallColormap" #define XmCOwnerEvents "OwnerEvents" #define XmNownerEvents "ownerEvents" #define XmCGrabStyle "GrabStyle" #define XmNgrabStyle "grabStyle" #define XmNforegroundState "foregroundState" #define XmNbackgroundState "backgroundState" #define XmCGroundState "GroundState" #define XmRGroundState "GroundState" #define XmRSelectColor "SelectColor" #define XmRLargeIconPixmap "LargeIconPixmap" #define XmRSmallIconPixmap "SmallIconPixmap" #define XmNoutlineState "outlineState" #define XmCOutlineState "OutlineState" #define XmROutlineState "OutlineState" #define XmNspatialIncludeModel "spatialIncludeModel" #define XmCSpatialIncludeModel "SpatialIncludeModel" #define XmRSpatialIncludeModel "SpatialIncludeModel" #define XmNspatialResizeModel "spatialResizeModel" #define XmCSpatialResizeModel "SpatialResizeModel" #define XmRSpatialResizeModel "SpatialResizeModel" #define XmNspatialSnapModel "spatialSnapModel" #define XmCSpatialSnapModel "SpatialSnapModel" #define XmRSpatialSnapModel "SpatialSnapModel" #define XmNdetailColumnHeadingCount "detailColumnHeadingCount" #define XmCDetailColumnHeadingCount "DetailColumnHeadingCount" #define XmNdetailOrder "detailOrder" #define XmCDetailOrder "DetailOrder" #define XmRCardinalList "CardinalList" #define XmNdetailOrderCount "detailOrderCount" #define XmCDetailOrderCount "DetailOrderCount" #define XmNoutlineColumnWidth "outlineColumnWidth" #define XmCOutlineColumnWidth "OutlineColumnWidth" #define XmNoutlineChangedCallback "outlineChangedCallback" #define XmCOutlineChangedCallback "OutlineChangedCallback" #define XmNoutlineButtonPolicy "outlineButtonPolicy" #define XmCOutlineButtonPolicy "OutlineButtonPolicy" #define XmROutlineButtonPolicy "OutlineButtonPolicy" #define XmCDefaultVirtualBindings "DefaultVirtualBindings" #define XmNdefaultVirtualBindings "defaultVirtualBindings" #define XmCResizable "Resizable" #define XmRDynamicPixmap "DynamicPixmap" #define XmNpageChangedCallback "pageChangedCallback" #define XmNarea "area" #define XmNdetailShadowThickness "detailShadowThickness" #define XmNsliderMark "sliderMark" #define XmCSliderMark "SliderMark" #define XmRSliderMark "SliderMark" #define XmREnableBtn1Transfer "EnableBtn1Transfer" #define XmNrenditionBackground "renditionBackground" #define XmNrenditionForeground "renditionForeground" #define XmCRenditionBackground "RenditionBackground" #define XmCRenditionForeground "RenditionForeground" #define XmNindeterminateInsensitivePixmap "indeterminateInsensitivePixmap" #define XmCIndeterminateInsensitivePixmap "IndeterminateInsensitivePixmap" #define XmNframeChildType "frameChildType" #define XmCFrameChildType "FrameChildType" #define XmNtextField "textField" #define XmCTextField "TextField" #define XmNenableThinThickness "enableThinThickness" #define XmCEnableThinThickness "EnableThinThickness" #define XmNprimaryColorSetId "primaryColorSetId" #define XmCPrimaryColorSetId "PrimaryColorSetId" #define XmNsecondaryColorSetId "secondaryColorSetId" #define XmCSecondaryColorSetId "SecondaryColorSetId" #define XmNtextColorSetId "textColorSetId" #define XmCTextColorSetId "TextColorSetId" #define XmNactiveColorSetId "activeColorSetId" #define XmCActiveColorSetId "ActiveColorSetId" #define XmNinactiveColorSetId "inactiveColorSetId" #define XmCInactiveColorSetId "InactiveColorSetId" #define XmNuseColorObj "useColorObj" #define XmCUseColorObj "UseColorObj" #define XmNuseTextColor "useTextColor" #define XmCUseTextColor "UseTextColor" #define XmNuseTextColorForList "useTextColorForList" #define XmCUseTextColorForList "UseTextColorForList" #define XmNuseMask "useMask" #define XmCUseMask "UseMask" #define XmNuseMultiColorIcons "useMultiColorIcons" #define XmCUseMultiColorIcons "UseMultiColorIcons" #define XmNuseIconFileCache "useIconFileCache" #define XmCUseIconFileCache "UseIconFileCache" #define XmSPIXEL_SET "Pixel Sets" #define XmSCUSTOMIZE_DATA "Customize Data:" #define XmSCOLOR_SRV_NAME "ColorServer" #define XmNlist "list" #define XmCList "List" #define XmNarrowOrientation "arrowOrientation" #define XmCArrowOrientation "ArrowOrientation" #define XmRArrowOrientation "ArrowOrientation" #define XmNpositionType "positionType" #define XmCPositionType "PositionType" #define XmRPositionType "PositionType" #define XmNwrap "wrap" #define XmCWrap "Wrap" #define XmNpositionMode "positionMode" #define XmCPositionMode "PositionMode" #define XmRPositionMode "PositionMode" #define XmNprintOrientation "printOrientation" #define XmCPrintOrientation "PrintOrientation" #define XmNprintOrientations "printOrientations" #define XmCPrintOrientations "PrintOrientations" #define XmNprintResolution "printResolution" #define XmCPrintResolution "PrintResolution" #define XmNprintResolutions "printResolutions" #define XmCPrintResolutions "PrintResolutions" #define XmNdefaultPixmapResolution "defaultPixmapResolution" #define XmCDefaultPixmapResolution "DefaultPixmapResolution" #define XmNstartJobCallback "startJobCallback" #define XmNendJobCallback "endJobCallback" #define XmNpageSetupCallback "pageSetupCallback" #define XmNpdmNotificationCallback "pdmNotificationCallback" #define XmNminX "minX" #define XmNminY "minY" #define XmNmaxX "maxX" #define XmNmaxY "maxY" #define XmCMinX "MinX" #define XmCMinY "MinY" #define XmCMaxX "MaxX" #define XmCMaxY "MaxY" #define XmNpreeditStartCallback "preeditStartCallback" #define XmNpreeditDoneCallback "preeditDoneCallback" #define XmNpreeditDrawCallback "preeditDrawCallback" #define XmNpreeditCaretCallback "preeditCaretCallback" #define XmNverifyPreedit "verifyPreedit" #define XmCVerifyPreedit "VerifyPreedit" #define XmNenableMultiKeyBindings "enableMultiKeyBindings" #define XmCEnableMultiKeyBindings "EnableMultiKeyBindings" #define XmRButtonFontList "ButtonFontList" #define XmRLabelFontList "LabelFontList" #define XmRTextFontList "TextFontList" #define XmSPIXEL_SET_PROP "SDT Pixel Set" #define XmS50_foreground "50_foreground" #define XmSunspecified_pixmap "unspecified_pixmap" #else externalref _XmConst char _XmStrings[]; #ifndef XmS #define XmS ((char*)&_XmStrings[0]) #endif #ifndef XmCAccelerator #define XmCAccelerator ((char*)&_XmStrings[1]) #endif #ifndef XmCAcceleratorText #define XmCAcceleratorText ((char*)&_XmStrings[13]) #endif #ifndef XmCAdjustLast #define XmCAdjustLast ((char*)&_XmStrings[29]) #endif #ifndef XmCAdjustMargin #define XmCAdjustMargin ((char*)&_XmStrings[40]) #endif #ifndef XmCAlignment #define XmCAlignment ((char*)&_XmStrings[53]) #endif #ifndef XmCAllowOverlap #define XmCAllowOverlap ((char*)&_XmStrings[63]) #endif #ifndef XmCAllowUnusedSpace #define XmCAllowUnusedSpace ((char*)&_XmStrings[76]) #endif #ifndef XmCAnimationMask #define XmCAnimationMask ((char*)&_XmStrings[93]) #endif #ifndef XmCAnimationPixmap #define XmCAnimationPixmap ((char*)&_XmStrings[107]) #endif #ifndef XmCAnimationPixmapDepth #define XmCAnimationPixmapDepth ((char*)&_XmStrings[123]) #endif #ifndef XmCAnimationStyle #define XmCAnimationStyle ((char*)&_XmStrings[144]) #endif #ifndef XmCApplyLabelString #define XmCApplyLabelString ((char*)&_XmStrings[159]) #endif #ifndef XmCArmCallback #define XmCArmCallback ((char*)&_XmStrings[176]) #endif #ifndef XmCArmColor #define XmCArmColor ((char*)&_XmStrings[188]) #endif #ifndef XmCArmPixmap #define XmCArmPixmap ((char*)&_XmStrings[197]) #endif #ifndef XmCArrowDirection #define XmCArrowDirection ((char*)&_XmStrings[207]) #endif #ifndef XmCAttachment #define XmCAttachment ((char*)&_XmStrings[222]) #endif #ifndef XmCAudibleWarning #define XmCAudibleWarning ((char*)&_XmStrings[233]) #endif #ifndef XmCAutoShowCursorPosition #define XmCAutoShowCursorPosition ((char*)&_XmStrings[248]) #endif #ifndef XmCAutoUnmanage #define XmCAutoUnmanage ((char*)&_XmStrings[271]) #endif #ifndef XmCAutomaticSelection #define XmCAutomaticSelection ((char*)&_XmStrings[284]) #endif #ifndef XmCAvailability #define XmCAvailability ((char*)&_XmStrings[303]) #endif #ifndef XmCBackgroundPixmap #define XmCBackgroundPixmap ((char*)&_XmStrings[316]) #endif #ifndef XmCBlendModel #define XmCBlendModel ((char*)&_XmStrings[333]) #endif #ifndef XmCBlinkRate #define XmCBlinkRate ((char*)&_XmStrings[344]) #endif #ifndef XmCBottomShadowColor #define XmCBottomShadowColor ((char*)&_XmStrings[354]) #endif #ifndef XmCBottomShadowPixmap #define XmCBottomShadowPixmap ((char*)&_XmStrings[372]) #endif #ifndef XmCButtonAcceleratorText #define XmCButtonAcceleratorText ((char*)&_XmStrings[391]) #endif #ifndef XmCButtonAccelerators #define XmCButtonAccelerators ((char*)&_XmStrings[413]) #endif #ifndef XmCButtonCount #define XmCButtonCount ((char*)&_XmStrings[432]) #endif #ifndef XmCButtonFontList #define XmCButtonFontList ((char*)&_XmStrings[444]) #endif #ifndef XmCButtonMnemonicCharSets #define XmCButtonMnemonicCharSets ((char*)&_XmStrings[459]) #endif #ifndef XmCButtonMnemonics #define XmCButtonMnemonics ((char*)&_XmStrings[482]) #endif #ifndef XmCButtonSet #define XmCButtonSet ((char*)&_XmStrings[498]) #endif #ifndef XmCButtonType #define XmCButtonType ((char*)&_XmStrings[508]) #endif #ifndef XmCButtons #define XmCButtons ((char*)&_XmStrings[519]) #endif #ifndef XmCCancelLabelString #define XmCCancelLabelString ((char*)&_XmStrings[527]) #endif #ifndef XmCChildHorizontalAlignment #define XmCChildHorizontalAlignment ((char*)&_XmStrings[545]) #endif #ifndef XmCChildHorizontalSpacing #define XmCChildHorizontalSpacing ((char*)&_XmStrings[570]) #endif #ifndef XmCChildPlacement #define XmCChildPlacement ((char*)&_XmStrings[593]) #endif #ifndef XmCChildType #define XmCChildType ((char*)&_XmStrings[608]) #endif #ifndef XmCChildVerticalAlignment #define XmCChildVerticalAlignment ((char*)&_XmStrings[618]) #endif #ifndef XmCChildren #define XmCChildren ((char*)&_XmStrings[641]) #endif #ifndef XmCClientData #define XmCClientData ((char*)&_XmStrings[650]) #endif #ifndef XmCClipWindow #define XmCClipWindow ((char*)&_XmStrings[661]) #endif #ifndef XmCColumns #define XmCColumns ((char*)&_XmStrings[672]) #endif #ifndef XmCCommandWindow #define XmCCommandWindow ((char*)&_XmStrings[680]) #endif #ifndef XmCCommandWindowLocation #define XmCCommandWindowLocation ((char*)&_XmStrings[694]) #endif #ifndef XmCConvertProc #define XmCConvertProc ((char*)&_XmStrings[716]) #endif #ifndef XmCCursorBackground #define XmCCursorBackground ((char*)&_XmStrings[728]) #endif #ifndef XmCCursorForeground #define XmCCursorForeground ((char*)&_XmStrings[745]) #endif #ifndef XmCCursorPosition #define XmCCursorPosition ((char*)&_XmStrings[762]) #endif #ifndef XmCCursorPositionVisible #define XmCCursorPositionVisible ((char*)&_XmStrings[777]) #endif #ifndef XmCDarkThreshold #define XmCDarkThreshold ((char*)&_XmStrings[799]) #endif #ifndef XmCDecimalPoints #define XmCDecimalPoints ((char*)&_XmStrings[813]) #endif #ifndef XmCDefaultButtonShadowThickness #define XmCDefaultButtonShadowThickness ((char*)&_XmStrings[827]) #endif #ifndef XmCDefaultButtonType #define XmCDefaultButtonType ((char*)&_XmStrings[856]) #endif #ifndef XmCDefaultCopyCursorIcon #define XmCDefaultCopyCursorIcon ((char*)&_XmStrings[874]) #endif #ifndef XmCDefaultFontList #define XmCDefaultFontList ((char*)&_XmStrings[896]) #endif #ifndef XmCDefaultInvalidCursorIcon #define XmCDefaultInvalidCursorIcon ((char*)&_XmStrings[912]) #endif #ifndef XmCDefaultLinkCursorIcon #define XmCDefaultLinkCursorIcon ((char*)&_XmStrings[937]) #endif #ifndef XmCDefaultMoveCursorIcon #define XmCDefaultMoveCursorIcon ((char*)&_XmStrings[959]) #endif #ifndef XmCDefaultNoneCursorIcon #define XmCDefaultNoneCursorIcon ((char*)&_XmStrings[981]) #endif #ifndef XmCDefaultPosition #define XmCDefaultPosition ((char*)&_XmStrings[1003]) #endif #ifndef XmCDefaultSourceCursorIcon #define XmCDefaultSourceCursorIcon ((char*)&_XmStrings[1019]) #endif #ifndef XmCDefaultValidCursorIcon #define XmCDefaultValidCursorIcon ((char*)&_XmStrings[1043]) #endif #ifndef XmCDeleteResponse #define XmCDeleteResponse ((char*)&_XmStrings[1066]) #endif #ifndef XmCDesktopParent #define XmCDesktopParent ((char*)&_XmStrings[1081]) #endif #ifndef XmCDialogStyle #define XmCDialogStyle ((char*)&_XmStrings[1095]) #endif #ifndef XmCDialogTitle #define XmCDialogTitle ((char*)&_XmStrings[1107]) #endif #ifndef XmCDialogType #define XmCDialogType ((char*)&_XmStrings[1119]) #endif #ifndef XmCDirListItemCount #define XmCDirListItemCount ((char*)&_XmStrings[1130]) #endif #ifndef XmCDirListItems #define XmCDirListItems ((char*)&_XmStrings[1147]) #endif #ifndef XmCDirListLabelString #define XmCDirListLabelString ((char*)&_XmStrings[1160]) #endif #ifndef XmCDirMask #define XmCDirMask ((char*)&_XmStrings[1179]) #endif #ifndef XmCDirSearchProc #define XmCDirSearchProc ((char*)&_XmStrings[1187]) #endif #ifndef XmCDirSpec #define XmCDirSpec ((char*)&_XmStrings[1201]) #endif #ifndef XmCDirectory #define XmCDirectory ((char*)&_XmStrings[1209]) #endif #ifndef XmCDirectoryValid #define XmCDirectoryValid ((char*)&_XmStrings[1219]) #endif #ifndef XmCDisarmCallback #define XmCDisarmCallback ((char*)&_XmStrings[1234]) #endif #ifndef XmCDoubleClickInterval #define XmCDoubleClickInterval ((char*)&_XmStrings[1249]) #endif #ifndef XmCDragContextClass #define XmCDragContextClass ((char*)&_XmStrings[1269]) #endif #ifndef XmCDragDropFinishCallback #define XmCDragDropFinishCallback ((char*)&_XmStrings[1286]) #endif #ifndef XmCDragIconClass #define XmCDragIconClass ((char*)&_XmStrings[1309]) #endif #ifndef XmCDragInitiatorProtocolStyle #define XmCDragInitiatorProtocolStyle ((char*)&_XmStrings[1323]) #endif #ifndef XmCDragMotionCallback #define XmCDragMotionCallback ((char*)&_XmStrings[1350]) #endif #ifndef XmCDragOperations #define XmCDragOperations ((char*)&_XmStrings[1369]) #endif #ifndef XmCDragOverMode #define XmCDragOverMode ((char*)&_XmStrings[1384]) #endif #ifndef XmCDragProc #define XmCDragProc ((char*)&_XmStrings[1397]) #endif #ifndef XmCDragReceiverProtocolStyle #define XmCDragReceiverProtocolStyle ((char*)&_XmStrings[1406]) #endif #ifndef XmCDropProc #define XmCDropProc ((char*)&_XmStrings[1432]) #endif #ifndef XmCDropRectangles #define XmCDropRectangles ((char*)&_XmStrings[1441]) #endif #ifndef XmCDropSiteActivity #define XmCDropSiteActivity ((char*)&_XmStrings[1456]) #endif #ifndef XmCDropSiteEnterCallback #define XmCDropSiteEnterCallback ((char*)&_XmStrings[1473]) #endif #ifndef XmCDropSiteLeaveCallback #define XmCDropSiteLeaveCallback ((char*)&_XmStrings[1495]) #endif #ifndef XmCDropSiteManagerClass #define XmCDropSiteManagerClass ((char*)&_XmStrings[1517]) #endif #ifndef XmCDropSiteOperations #define XmCDropSiteOperations ((char*)&_XmStrings[1538]) #endif #ifndef XmCDropSiteType #define XmCDropSiteType ((char*)&_XmStrings[1557]) #endif #ifndef XmCDropStartCallback #define XmCDropStartCallback ((char*)&_XmStrings[1570]) #endif #ifndef XmCDropTransferClass #define XmCDropTransferClass ((char*)&_XmStrings[1588]) #endif #ifndef XmCDropTransfers #define XmCDropTransfers ((char*)&_XmStrings[1606]) #endif #ifndef XmCEditable #define XmCEditable ((char*)&_XmStrings[1620]) #endif #ifndef XmCEntryBorder #define XmCEntryBorder ((char*)&_XmStrings[1629]) #endif #ifndef XmCEntryClass #define XmCEntryClass ((char*)&_XmStrings[1641]) #endif #ifndef XmCExportTargets #define XmCExportTargets ((char*)&_XmStrings[1652]) #endif #ifndef XmCExposeCallback #define XmCExposeCallback ((char*)&_XmStrings[1666]) #endif #ifndef XmCExtensionType #define XmCExtensionType ((char*)&_XmStrings[1681]) #endif #ifndef XmCFileListItemCount #define XmCFileListItemCount ((char*)&_XmStrings[1695]) #endif #ifndef XmCFileListItems #define XmCFileListItems ((char*)&_XmStrings[1713]) #endif #ifndef XmCFileListLabelString #define XmCFileListLabelString ((char*)&_XmStrings[1727]) #endif #ifndef XmCFileSearchProc #define XmCFileSearchProc ((char*)&_XmStrings[1747]) #endif #ifndef XmCFileTypeMask #define XmCFileTypeMask ((char*)&_XmStrings[1762]) #endif #ifndef XmCFillOnArm #define XmCFillOnArm ((char*)&_XmStrings[1775]) #endif #ifndef XmCFillOnSelect #define XmCFillOnSelect ((char*)&_XmStrings[1785]) #endif #ifndef XmCFilterLabelString #define XmCFilterLabelString ((char*)&_XmStrings[1798]) #endif #ifndef XmCFontList #define XmCFontList ((char*)&_XmStrings[1816]) #endif #ifndef XmCForegroundThreshold #define XmCForegroundThreshold ((char*)&_XmStrings[1825]) #endif #ifndef XmCHelpLabelString #define XmCHelpLabelString ((char*)&_XmStrings[1845]) #endif #ifndef XmCHighlightColor #define XmCHighlightColor ((char*)&_XmStrings[1861]) #endif #ifndef XmCHighlightOnEnter #define XmCHighlightOnEnter ((char*)&_XmStrings[1876]) #endif #ifndef XmCHighlightPixmap #define XmCHighlightPixmap ((char*)&_XmStrings[1893]) #endif #ifndef XmCHighlightThickness #define XmCHighlightThickness ((char*)&_XmStrings[1909]) #endif #ifndef XmCHorizontalFontUnit #define XmCHorizontalFontUnit ((char*)&_XmStrings[1928]) #endif #ifndef XmCHorizontalScrollBar #define XmCHorizontalScrollBar ((char*)&_XmStrings[1947]) #endif #ifndef XmCHot #define XmCHot ((char*)&_XmStrings[1967]) #endif #ifndef XmCICCHandle #define XmCICCHandle ((char*)&_XmStrings[1971]) #endif #ifndef XmCImportTargets #define XmCImportTargets ((char*)&_XmStrings[1981]) #endif #ifndef XmCIncrement #define XmCIncrement ((char*)&_XmStrings[1995]) #endif #ifndef XmCIncremental #define XmCIncremental ((char*)&_XmStrings[2005]) #endif #ifndef XmCIndicatorOn #define XmCIndicatorOn ((char*)&_XmStrings[2017]) #endif #ifndef XmCIndicatorSize #define XmCIndicatorSize ((char*)&_XmStrings[2029]) #endif #ifndef XmCIndicatorType #define XmCIndicatorType ((char*)&_XmStrings[2043]) #endif #ifndef XmCInitialDelay #define XmCInitialDelay ((char*)&_XmStrings[2057]) #endif #ifndef XmCInitialFocus #define XmCInitialFocus ((char*)&_XmStrings[2070]) #endif #ifndef XmCInputCreate #define XmCInputCreate ((char*)&_XmStrings[2083]) #endif #ifndef XmCInputMethod #define XmCInputMethod ((char*)&_XmStrings[2095]) #endif #ifndef XmCInvalidCursorForeground #define XmCInvalidCursorForeground ((char*)&_XmStrings[2107]) #endif #ifndef XmCIsAligned #define XmCIsAligned ((char*)&_XmStrings[2131]) #endif #ifndef XmCIsHomogeneous #define XmCIsHomogeneous ((char*)&_XmStrings[2141]) #endif #ifndef XmCItemCount #define XmCItemCount ((char*)&_XmStrings[2155]) #endif #ifndef XmCItems #define XmCItems ((char*)&_XmStrings[2165]) #endif #ifndef XmCKeyboardFocusPolicy #define XmCKeyboardFocusPolicy ((char*)&_XmStrings[2171]) #endif #ifndef XmCLabelFontList #define XmCLabelFontList ((char*)&_XmStrings[2191]) #endif #ifndef XmCLabelInsensitivePixmap #define XmCLabelInsensitivePixmap ((char*)&_XmStrings[2205]) #endif #ifndef XmCLabelPixmap #define XmCLabelPixmap ((char*)&_XmStrings[2228]) #endif #ifndef XmCLabelString #define XmCLabelString ((char*)&_XmStrings[2240]) #endif #ifndef XmCLabelType #define XmCLabelType ((char*)&_XmStrings[2252]) #endif #ifndef XmCLightThreshold #define XmCLightThreshold ((char*)&_XmStrings[2262]) #endif #ifndef XmCListLabelString #define XmCListLabelString ((char*)&_XmStrings[2277]) #endif #ifndef XmCListMarginHeight #define XmCListMarginHeight ((char*)&_XmStrings[2293]) #endif #ifndef XmCListMarginWidth #define XmCListMarginWidth ((char*)&_XmStrings[2310]) #endif #ifndef XmCListSizePolicy #define XmCListSizePolicy ((char*)&_XmStrings[2326]) #endif #ifndef XmCListSpacing #define XmCListSpacing ((char*)&_XmStrings[2341]) #endif #ifndef XmCListUpdated #define XmCListUpdated ((char*)&_XmStrings[2353]) #endif #ifndef XmCLogicalParent #define XmCLogicalParent ((char*)&_XmStrings[2365]) #endif #ifndef XmCMainWindowMarginHeight #define XmCMainWindowMarginHeight ((char*)&_XmStrings[2379]) #endif #ifndef XmCMainWindowMarginWidth #define XmCMainWindowMarginWidth ((char*)&_XmStrings[2402]) #endif #ifndef XmCMappingDelay #define XmCMappingDelay ((char*)&_XmStrings[2424]) #endif #ifndef XmCMarginBottom #define XmCMarginBottom ((char*)&_XmStrings[2437]) #endif #ifndef XmCMarginHeight #define XmCMarginHeight ((char*)&_XmStrings[2450]) #endif #ifndef XmCMarginLeft #define XmCMarginLeft ((char*)&_XmStrings[2463]) #endif #ifndef XmCMarginRight #define XmCMarginRight ((char*)&_XmStrings[2474]) #endif #ifndef XmCMarginTop #define XmCMarginTop ((char*)&_XmStrings[2486]) #endif #ifndef XmCMarginWidth #define XmCMarginWidth ((char*)&_XmStrings[2496]) #endif #ifndef XmCMask #define XmCMask ((char*)&_XmStrings[2508]) #endif #ifndef XmCMaxItems #define XmCMaxItems ((char*)&_XmStrings[2513]) #endif #ifndef XmCMaxLength #define XmCMaxLength ((char*)&_XmStrings[2522]) #endif #ifndef XmCMaxValue #define XmCMaxValue ((char*)&_XmStrings[2532]) #endif #ifndef XmCMaximum #define XmCMaximum ((char*)&_XmStrings[2541]) #endif #ifndef XmCMenuBar #define XmCMenuBar ((char*)&_XmStrings[2549]) #endif #ifndef XmCMenuPost #define XmCMenuPost ((char*)&_XmStrings[2557]) #endif #ifndef XmCMenuWidget #define XmCMenuWidget ((char*)&_XmStrings[2566]) #endif #ifndef XmCMessageProc #define XmCMessageProc ((char*)&_XmStrings[2577]) #endif #ifndef XmCMessageWindow #define XmCMessageWindow ((char*)&_XmStrings[2589]) #endif #ifndef XmCMinimizeButtons #define XmCMinimizeButtons ((char*)&_XmStrings[2603]) #endif #ifndef XmCMinimum #define XmCMinimum ((char*)&_XmStrings[2619]) #endif #ifndef XmCMnemonic #define XmCMnemonic ((char*)&_XmStrings[2627]) #endif #ifndef XmCMnemonicCharSet #define XmCMnemonicCharSet ((char*)&_XmStrings[2636]) #endif #ifndef XmCMoveOpaque #define XmCMoveOpaque ((char*)&_XmStrings[2652]) #endif #ifndef XmCMultiClick #define XmCMultiClick ((char*)&_XmStrings[2663]) #endif #ifndef XmCMustMatch #define XmCMustMatch ((char*)&_XmStrings[2674]) #endif #ifndef XmCMwmDecorations #define XmCMwmDecorations ((char*)&_XmStrings[2684]) #endif #ifndef XmCMwmFunctions #define XmCMwmFunctions ((char*)&_XmStrings[2699]) #endif #ifndef XmCMwmInputMode #define XmCMwmInputMode ((char*)&_XmStrings[2712]) #endif #ifndef XmCMwmMenu #define XmCMwmMenu ((char*)&_XmStrings[2725]) #endif #ifndef XmCMwmMessages #define XmCMwmMessages ((char*)&_XmStrings[2733]) #endif #ifndef XmCNavigationType #define XmCNavigationType ((char*)&_XmStrings[2745]) #endif #ifndef XmCNeedsMotion #define XmCNeedsMotion ((char*)&_XmStrings[2760]) #endif #ifndef XmCNoMatchString #define XmCNoMatchString ((char*)&_XmStrings[2772]) #endif #ifndef XmCNoResize #define XmCNoResize ((char*)&_XmStrings[2786]) #endif #ifndef XmCNoneCursorForeground #define XmCNoneCursorForeground ((char*)&_XmStrings[2795]) #endif #ifndef XmCNotifyProc #define XmCNotifyProc ((char*)&_XmStrings[2816]) #endif #ifndef XmCNumChildren #define XmCNumChildren ((char*)&_XmStrings[2827]) #endif #ifndef XmCNumColumns #define XmCNumColumns ((char*)&_XmStrings[2839]) #endif #ifndef XmCNumDropRectangles #define XmCNumDropRectangles ((char*)&_XmStrings[2850]) #endif #ifndef XmCNumDropTransfers #define XmCNumDropTransfers ((char*)&_XmStrings[2868]) #endif #ifndef XmCNumExportTargets #define XmCNumExportTargets ((char*)&_XmStrings[2885]) #endif #ifndef XmCNumImportTargets #define XmCNumImportTargets ((char*)&_XmStrings[2902]) #endif #ifndef XmCOffset #define XmCOffset ((char*)&_XmStrings[2919]) #endif #ifndef XmCOkLabelString #define XmCOkLabelString ((char*)&_XmStrings[2926]) #endif #ifndef XmCOperationChangedCallback #define XmCOperationChangedCallback ((char*)&_XmStrings[2940]) #endif #ifndef XmCOperationCursorIcon #define XmCOperationCursorIcon ((char*)&_XmStrings[2965]) #endif #ifndef XmCOptionLabel #define XmCOptionLabel ((char*)&_XmStrings[2985]) #endif #ifndef XmCOptionMnemonic #define XmCOptionMnemonic ((char*)&_XmStrings[2997]) #endif #ifndef XmCOutputCreate #define XmCOutputCreate ((char*)&_XmStrings[3012]) #endif #ifndef XmCPacking #define XmCPacking ((char*)&_XmStrings[3025]) #endif #ifndef XmCPageIncrement #define XmCPageIncrement ((char*)&_XmStrings[3033]) #endif #ifndef XmCPaneMaximum #define XmCPaneMaximum ((char*)&_XmStrings[3047]) #endif #ifndef XmCPaneMinimum #define XmCPaneMinimum ((char*)&_XmStrings[3059]) #endif #ifndef XmCPattern #define XmCPattern ((char*)&_XmStrings[3071]) #endif #ifndef XmCPendingDelete #define XmCPendingDelete ((char*)&_XmStrings[3079]) #endif #ifndef XmCPopupEnabled #define XmCPopupEnabled ((char*)&_XmStrings[3093]) #endif #ifndef XmCPositionIndex #define XmCPositionIndex ((char*)&_XmStrings[3106]) #endif #ifndef XmCPostFromButton #define XmCPostFromButton ((char*)&_XmStrings[3120]) #endif #ifndef XmCPostFromCount #define XmCPostFromCount ((char*)&_XmStrings[3135]) #endif #ifndef XmCPostFromList #define XmCPostFromList ((char*)&_XmStrings[3149]) #endif #ifndef XmCPreeditType #define XmCPreeditType ((char*)&_XmStrings[3162]) #endif #ifndef XmCProcessingDirection #define XmCProcessingDirection ((char*)&_XmStrings[3174]) #endif #ifndef XmCPromptString #define XmCPromptString ((char*)&_XmStrings[3194]) #endif #ifndef XmCProtocolCallback #define XmCProtocolCallback ((char*)&_XmStrings[3207]) #endif #ifndef XmCPushButtonEnabled #define XmCPushButtonEnabled ((char*)&_XmStrings[3224]) #endif #ifndef XmCQualifySearchDataProc #define XmCQualifySearchDataProc ((char*)&_XmStrings[3242]) #endif #ifndef XmCRadioAlwaysOne #define XmCRadioAlwaysOne ((char*)&_XmStrings[3264]) #endif #ifndef XmCRadioBehavior #define XmCRadioBehavior ((char*)&_XmStrings[3279]) #endif #ifndef XmCRecomputeSize #define XmCRecomputeSize ((char*)&_XmStrings[3293]) #endif #ifndef XmCRectangles #define XmCRectangles ((char*)&_XmStrings[3307]) #endif #ifndef XmCRepeatDelay #define XmCRepeatDelay ((char*)&_XmStrings[3318]) #endif #ifndef XmCResizeCallback #define XmCResizeCallback ((char*)&_XmStrings[3330]) #endif #ifndef XmCResizeHeight #define XmCResizeHeight ((char*)&_XmStrings[3345]) #endif #ifndef XmCResizePolicy #define XmCResizePolicy ((char*)&_XmStrings[3358]) #endif #ifndef XmCResizeWidth #define XmCResizeWidth ((char*)&_XmStrings[3371]) #endif #ifndef XmCRowColumnType #define XmCRowColumnType ((char*)&_XmStrings[3383]) #endif #ifndef XmCRows #define XmCRows ((char*)&_XmStrings[3397]) #endif #ifndef XmCRubberPositioning #define XmCRubberPositioning ((char*)&_XmStrings[3402]) #endif #ifndef XmCSashHeight #define XmCSashHeight ((char*)&_XmStrings[3420]) #endif #ifndef XmCSashIndent #define XmCSashIndent ((char*)&_XmStrings[3431]) #endif #ifndef XmCSashWidth #define XmCSashWidth ((char*)&_XmStrings[3442]) #endif #ifndef XmCScaleHeight #define XmCScaleHeight ((char*)&_XmStrings[3452]) #endif #ifndef XmCScaleMultiple #define XmCScaleMultiple ((char*)&_XmStrings[3464]) #endif #ifndef XmCScaleWidth #define XmCScaleWidth ((char*)&_XmStrings[3478]) #endif #ifndef XmCScroll #define XmCScroll ((char*)&_XmStrings[3489]) #endif #ifndef XmCScrollBarDisplayPolicy #define XmCScrollBarDisplayPolicy ((char*)&_XmStrings[3496]) #endif #ifndef XmCScrollBarPlacement #define XmCScrollBarPlacement ((char*)&_XmStrings[3519]) #endif #ifndef XmCScrollSide #define XmCScrollSide ((char*)&_XmStrings[3538]) #endif #ifndef XmCScrolledWindowMarginHeight #define XmCScrolledWindowMarginHeight ((char*)&_XmStrings[3549]) #endif #ifndef XmCScrolledWindowMarginWidth #define XmCScrolledWindowMarginWidth ((char*)&_XmStrings[3576]) #endif #ifndef XmCScrollingPolicy #define XmCScrollingPolicy ((char*)&_XmStrings[3602]) #endif #ifndef XmCSelectColor #define XmCSelectColor ((char*)&_XmStrings[3618]) #endif #ifndef XmCSelectInsensitivePixmap #define XmCSelectInsensitivePixmap ((char*)&_XmStrings[3630]) #endif #ifndef XmCSelectPixmap #define XmCSelectPixmap ((char*)&_XmStrings[3654]) #endif #ifndef XmCSelectThreshold #define XmCSelectThreshold ((char*)&_XmStrings[3667]) #endif #ifndef XmCSelectedItemCount #define XmCSelectedItemCount ((char*)&_XmStrings[3683]) #endif #ifndef XmCSelectedItems #define XmCSelectedItems ((char*)&_XmStrings[3701]) #endif #ifndef XmCSelectionArrayCount #define XmCSelectionArrayCount ((char*)&_XmStrings[3715]) #endif #ifndef XmCSelectionLabelString #define XmCSelectionLabelString ((char*)&_XmStrings[3735]) #endif #ifndef XmCSelectionPolicy #define XmCSelectionPolicy ((char*)&_XmStrings[3756]) #endif #ifndef XmCSeparatorOn #define XmCSeparatorOn ((char*)&_XmStrings[3772]) #endif #ifndef XmCSeparatorType #define XmCSeparatorType ((char*)&_XmStrings[3784]) #endif #ifndef XmCSet #define XmCSet ((char*)&_XmStrings[3798]) #endif #ifndef XmCShadowThickness #define XmCShadowThickness ((char*)&_XmStrings[3802]) #endif #ifndef XmCShadowType #define XmCShadowType ((char*)&_XmStrings[3818]) #endif #ifndef XmCShellUnitType #define XmCShellUnitType ((char*)&_XmStrings[3829]) #endif #ifndef XmCShowArrows #define XmCShowArrows ((char*)&_XmStrings[3843]) #endif #ifndef XmCShowAsDefault #define XmCShowAsDefault ((char*)&_XmStrings[3854]) #endif #ifndef XmCShowSeparator #define XmCShowSeparator ((char*)&_XmStrings[3868]) #endif #ifndef XmCShowValue #define XmCShowValue ((char*)&_XmStrings[3882]) #endif #ifndef XmCSimpleCheckBox #define XmCSimpleCheckBox ((char*)&_XmStrings[3892]) #endif #ifndef XmCSimpleMenuBar #define XmCSimpleMenuBar ((char*)&_XmStrings[3907]) #endif #ifndef XmCSimpleOptionMenu #define XmCSimpleOptionMenu ((char*)&_XmStrings[3921]) #endif #ifndef XmCSimplePopupMenu #define XmCSimplePopupMenu ((char*)&_XmStrings[3938]) #endif #ifndef XmCSimplePulldownMenu #define XmCSimplePulldownMenu ((char*)&_XmStrings[3954]) #endif #ifndef XmCSimpleRadioBox #define XmCSimpleRadioBox ((char*)&_XmStrings[3973]) #endif #ifndef XmCSizePolicy #define XmCSizePolicy ((char*)&_XmStrings[3988]) #endif #ifndef XmCSliderSize #define XmCSliderSize ((char*)&_XmStrings[3999]) #endif #ifndef XmCSource #define XmCSource ((char*)&_XmStrings[4010]) #endif #ifndef XmCSourceCursorIcon #define XmCSourceCursorIcon ((char*)&_XmStrings[4017]) #endif #ifndef XmCSourceIsExternal #define XmCSourceIsExternal ((char*)&_XmStrings[4034]) #endif #ifndef XmCSourcePixmapIcon #define XmCSourcePixmapIcon ((char*)&_XmStrings[4051]) #endif #ifndef XmCSourceWidget #define XmCSourceWidget ((char*)&_XmStrings[4068]) #endif #ifndef XmCSourceWindow #define XmCSourceWindow ((char*)&_XmStrings[4081]) #endif #ifndef XmCSpacing #define XmCSpacing ((char*)&_XmStrings[4094]) #endif #ifndef XmCStartTime #define XmCStartTime ((char*)&_XmStrings[4102]) #endif #ifndef XmCStateCursorIcon #define XmCStateCursorIcon ((char*)&_XmStrings[4112]) #endif #ifndef XmCStringDirection #define XmCStringDirection ((char*)&_XmStrings[4128]) #endif #ifndef XmCTearOffModel #define XmCTearOffModel ((char*)&_XmStrings[4144]) #endif #ifndef XmCTextFontList #define XmCTextFontList ((char*)&_XmStrings[4157]) #endif #ifndef XmCTextString #define XmCTextString ((char*)&_XmStrings[4170]) #endif #ifndef XmCTextValue #define XmCTextValue ((char*)&_XmStrings[4181]) #endif #ifndef XmCTitleString #define XmCTitleString ((char*)&_XmStrings[4191]) #endif #ifndef XmCTopCharacter #define XmCTopCharacter ((char*)&_XmStrings[4203]) #endif #ifndef XmCTopItemPosition #define XmCTopItemPosition ((char*)&_XmStrings[4216]) #endif #ifndef XmCTopLevelEnterCallback #define XmCTopLevelEnterCallback ((char*)&_XmStrings[4232]) #endif #ifndef XmCTopLevelLeaveCallback #define XmCTopLevelLeaveCallback ((char*)&_XmStrings[4254]) #endif #ifndef XmCTopShadowColor #define XmCTopShadowColor ((char*)&_XmStrings[4276]) #endif #ifndef XmCTopShadowPixmap #define XmCTopShadowPixmap ((char*)&_XmStrings[4291]) #endif #ifndef XmCTransferProc #define XmCTransferProc ((char*)&_XmStrings[4307]) #endif #ifndef XmCTransferStatus #define XmCTransferStatus ((char*)&_XmStrings[4320]) #endif #ifndef XmCTraversalOn #define XmCTraversalOn ((char*)&_XmStrings[4335]) #endif #ifndef XmCTraversalType #define XmCTraversalType ((char*)&_XmStrings[4347]) #endif #ifndef XmCTreeUpdateProc #define XmCTreeUpdateProc ((char*)&_XmStrings[4361]) #endif #ifndef XmCTroughColor #define XmCTroughColor ((char*)&_XmStrings[4376]) #endif #ifndef XmCUnitType #define XmCUnitType ((char*)&_XmStrings[4388]) #endif #ifndef XmCUnpostBehavior #define XmCUnpostBehavior ((char*)&_XmStrings[4397]) #endif #ifndef XmCUnselectPixmap #define XmCUnselectPixmap ((char*)&_XmStrings[4412]) #endif #ifndef XmCUpdateSliderSize #define XmCUpdateSliderSize ((char*)&_XmStrings[4427]) #endif #ifndef XmCUseAsyncGeometry #define XmCUseAsyncGeometry ((char*)&_XmStrings[4444]) #endif #ifndef XmCUserData #define XmCUserData ((char*)&_XmStrings[4461]) #endif #ifndef XmCValidCursorForeground #define XmCValidCursorForeground ((char*)&_XmStrings[4470]) #endif #ifndef XmCValueChangedCallback #define XmCValueChangedCallback ((char*)&_XmStrings[4492]) #endif #ifndef XmCValueWcs #define XmCValueWcs ((char*)&_XmStrings[4513]) #endif #ifndef XmCVerifyBell #define XmCVerifyBell ((char*)&_XmStrings[4522]) #endif #ifndef XmCVerticalAlignment #define XmCVerticalAlignment ((char*)&_XmStrings[4533]) #endif #ifndef XmCVerticalFontUnit #define XmCVerticalFontUnit ((char*)&_XmStrings[4551]) #endif #ifndef XmCVerticalScrollBar #define XmCVerticalScrollBar ((char*)&_XmStrings[4568]) #endif #ifndef XmCVisibleItemCount #define XmCVisibleItemCount ((char*)&_XmStrings[4586]) #endif #ifndef XmCVisibleWhenOff #define XmCVisibleWhenOff ((char*)&_XmStrings[4603]) #endif #ifndef XmCVisualPolicy #define XmCVisualPolicy ((char*)&_XmStrings[4618]) #endif #ifndef XmCWhichButton #define XmCWhichButton ((char*)&_XmStrings[4631]) #endif #ifndef XmCWordWrap #define XmCWordWrap ((char*)&_XmStrings[4643]) #endif #ifndef XmCWorkWindow #define XmCWorkWindow ((char*)&_XmStrings[4652]) #endif #ifndef XmCXmString #define XmCXmString ((char*)&_XmStrings[4663]) #endif #ifndef XmNaccelerator #define XmNaccelerator ((char*)&_XmStrings[4672]) #endif #ifndef XmNacceleratorText #define XmNacceleratorText ((char*)&_XmStrings[4684]) #endif #ifndef XmNactivateCallback #define XmNactivateCallback ((char*)&_XmStrings[4700]) #endif #ifndef XmNadjustLast #define XmNadjustLast ((char*)&_XmStrings[4717]) #endif #ifndef XmNadjustMargin #define XmNadjustMargin ((char*)&_XmStrings[4728]) #endif #ifndef XmNalignment #define XmNalignment ((char*)&_XmStrings[4741]) #endif #ifndef XmNallowOverlap #define XmNallowOverlap ((char*)&_XmStrings[4751]) #endif #ifndef XmNallowResize #define XmNallowResize ((char*)&_XmStrings[4764]) #endif #ifndef XmNallowUnusedSpace #define XmNallowUnusedSpace ((char*)&_XmStrings[4776]) #endif #ifndef XmNanimationMask #define XmNanimationMask ((char*)&_XmStrings[4793]) #endif #ifndef XmNanimationPixmap #define XmNanimationPixmap ((char*)&_XmStrings[4807]) #endif #ifndef XmNanimationPixmapDepth #define XmNanimationPixmapDepth ((char*)&_XmStrings[4823]) #endif #ifndef XmNanimationStyle #define XmNanimationStyle ((char*)&_XmStrings[4844]) #endif #ifndef XmNapplyCallback #define XmNapplyCallback ((char*)&_XmStrings[4859]) #endif #ifndef XmNapplyLabelString #define XmNapplyLabelString ((char*)&_XmStrings[4873]) #endif #ifndef XmNarmCallback #define XmNarmCallback ((char*)&_XmStrings[4890]) #endif #ifndef XmNarmColor #define XmNarmColor ((char*)&_XmStrings[4902]) #endif #ifndef XmNarmPixmap #define XmNarmPixmap ((char*)&_XmStrings[4911]) #endif #ifndef XmNarrowDirection #define XmNarrowDirection ((char*)&_XmStrings[4921]) #endif #ifndef XmNattachment #define XmNattachment ((char*)&_XmStrings[4936]) #endif #ifndef XmNaudibleWarning #define XmNaudibleWarning ((char*)&_XmStrings[4947]) #endif #ifndef XmNautoShowCursorPosition #define XmNautoShowCursorPosition ((char*)&_XmStrings[4962]) #endif #ifndef XmNautoUnmanage #define XmNautoUnmanage ((char*)&_XmStrings[4985]) #endif #ifndef XmNautomaticSelection #define XmNautomaticSelection ((char*)&_XmStrings[4998]) #endif #ifndef XmNavailability #define XmNavailability ((char*)&_XmStrings[5017]) #endif #ifndef XmNblendModel #define XmNblendModel ((char*)&_XmStrings[5030]) #endif #ifndef XmNblinkRate #define XmNblinkRate ((char*)&_XmStrings[5041]) #endif #ifndef XmNbottomAttachment #define XmNbottomAttachment ((char*)&_XmStrings[5051]) #endif #ifndef XmNbottomOffset #define XmNbottomOffset ((char*)&_XmStrings[5068]) #endif #ifndef XmNbottomPosition #define XmNbottomPosition ((char*)&_XmStrings[5081]) #endif #ifndef XmNbottomShadowColor #define XmNbottomShadowColor ((char*)&_XmStrings[5096]) #endif #ifndef XmNbottomShadowPixmap #define XmNbottomShadowPixmap ((char*)&_XmStrings[5114]) #endif #ifndef XmNbottomWidget #define XmNbottomWidget ((char*)&_XmStrings[5133]) #endif #ifndef XmNbrowseSelectionCallback #define XmNbrowseSelectionCallback ((char*)&_XmStrings[5146]) #endif #ifndef XmNbuttonAcceleratorText #define XmNbuttonAcceleratorText ((char*)&_XmStrings[5170]) #endif #ifndef XmNbuttonAccelerators #define XmNbuttonAccelerators ((char*)&_XmStrings[5192]) #endif #ifndef XmNbuttonCount #define XmNbuttonCount ((char*)&_XmStrings[5211]) #endif #ifndef XmNbuttonFontList #define XmNbuttonFontList ((char*)&_XmStrings[5223]) #endif #ifndef XmNbuttonMnemonicCharSets #define XmNbuttonMnemonicCharSets ((char*)&_XmStrings[5238]) #endif #ifndef XmNbuttonMnemonics #define XmNbuttonMnemonics ((char*)&_XmStrings[5261]) #endif #ifndef XmNbuttonSet #define XmNbuttonSet ((char*)&_XmStrings[5277]) #endif #ifndef XmNbuttonType #define XmNbuttonType ((char*)&_XmStrings[5287]) #endif #ifndef XmNbuttons #define XmNbuttons ((char*)&_XmStrings[5298]) #endif #ifndef XmNcancelButton #define XmNcancelButton ((char*)&_XmStrings[5306]) #endif #ifndef XmNcancelCallback #define XmNcancelCallback ((char*)&_XmStrings[5319]) #endif #ifndef XmNcancelLabelString #define XmNcancelLabelString ((char*)&_XmStrings[5334]) #endif #ifndef XmNcascadePixmap #define XmNcascadePixmap ((char*)&_XmStrings[5352]) #endif #ifndef XmNcascadingCallback #define XmNcascadingCallback ((char*)&_XmStrings[5366]) #endif #ifndef XmNchildHorizontalAlignment #define XmNchildHorizontalAlignment ((char*)&_XmStrings[5384]) #endif #ifndef XmNchildHorizontalSpacing #define XmNchildHorizontalSpacing ((char*)&_XmStrings[5409]) #endif #ifndef XmNchildPlacement #define XmNchildPlacement ((char*)&_XmStrings[5432]) #endif #ifndef XmNchildPosition #define XmNchildPosition ((char*)&_XmStrings[5447]) #endif #ifndef XmNchildType #define XmNchildType ((char*)&_XmStrings[5461]) #endif #ifndef XmNchildVerticalAlignment #define XmNchildVerticalAlignment ((char*)&_XmStrings[5471]) #endif #ifndef XmNclientData #define XmNclientData ((char*)&_XmStrings[5494]) #endif #ifndef XmNclipWindow #define XmNclipWindow ((char*)&_XmStrings[5505]) #endif #ifndef XmNcolumns #define XmNcolumns ((char*)&_XmStrings[5516]) #endif #ifndef XmNcommand #define XmNcommand ((char*)&_XmStrings[5524]) #endif #ifndef XmNcommandChangedCallback #define XmNcommandChangedCallback ((char*)&_XmStrings[5532]) #endif #ifndef XmNcommandEnteredCallback #define XmNcommandEnteredCallback ((char*)&_XmStrings[5555]) #endif #ifndef XmNcommandWindow #define XmNcommandWindow ((char*)&_XmStrings[5578]) #endif #ifndef XmNcommandWindowLocation #define XmNcommandWindowLocation ((char*)&_XmStrings[5592]) #endif #ifndef XmNconvertProc #define XmNconvertProc ((char*)&_XmStrings[5614]) #endif #ifndef XmNcursorBackground #define XmNcursorBackground ((char*)&_XmStrings[5626]) #endif #ifndef XmNcursorForeground #define XmNcursorForeground ((char*)&_XmStrings[5643]) #endif #ifndef XmNcursorPosition #define XmNcursorPosition ((char*)&_XmStrings[5660]) #endif #ifndef XmNcursorPositionVisible #define XmNcursorPositionVisible ((char*)&_XmStrings[5675]) #endif #ifndef XmNdarkThreshold #define XmNdarkThreshold ((char*)&_XmStrings[5697]) #endif #ifndef XmNdecimalPoints #define XmNdecimalPoints ((char*)&_XmStrings[5711]) #endif #ifndef XmNdecrementCallback #define XmNdecrementCallback ((char*)&_XmStrings[5725]) #endif #ifndef XmNdefaultActionCallback #define XmNdefaultActionCallback ((char*)&_XmStrings[5743]) #endif #ifndef XmNdefaultButton #define XmNdefaultButton ((char*)&_XmStrings[5765]) #endif #ifndef XmNdefaultButtonShadowThickness #define XmNdefaultButtonShadowThickness ((char*)&_XmStrings[5779]) #endif #ifndef XmNdefaultButtonType #define XmNdefaultButtonType ((char*)&_XmStrings[5808]) #endif #ifndef XmNdefaultCopyCursorIcon #define XmNdefaultCopyCursorIcon ((char*)&_XmStrings[5826]) #endif #ifndef XmNdefaultFontList #define XmNdefaultFontList ((char*)&_XmStrings[5848]) #endif #ifndef XmNdefaultInvalidCursorIcon #define XmNdefaultInvalidCursorIcon ((char*)&_XmStrings[5864]) #endif #ifndef XmNdefaultLinkCursorIcon #define XmNdefaultLinkCursorIcon ((char*)&_XmStrings[5889]) #endif #ifndef XmNdefaultMoveCursorIcon #define XmNdefaultMoveCursorIcon ((char*)&_XmStrings[5911]) #endif #ifndef XmNdefaultNoneCursorIcon #define XmNdefaultNoneCursorIcon ((char*)&_XmStrings[5933]) #endif #ifndef XmNdefaultPosition #define XmNdefaultPosition ((char*)&_XmStrings[5955]) #endif #ifndef XmNdefaultSourceCursorIcon #define XmNdefaultSourceCursorIcon ((char*)&_XmStrings[5971]) #endif #ifndef XmNdefaultValidCursorIcon #define XmNdefaultValidCursorIcon ((char*)&_XmStrings[5995]) #endif #ifndef XmNdeleteResponse #define XmNdeleteResponse ((char*)&_XmStrings[6018]) #endif #ifndef XmNdesktopParent #define XmNdesktopParent ((char*)&_XmStrings[6033]) #endif #ifndef XmNdialogStyle #define XmNdialogStyle ((char*)&_XmStrings[6047]) #endif #ifndef XmNdialogTitle #define XmNdialogTitle ((char*)&_XmStrings[6059]) #endif #ifndef XmNdialogType #define XmNdialogType ((char*)&_XmStrings[6071]) #endif #ifndef XmNdirListItemCount #define XmNdirListItemCount ((char*)&_XmStrings[6082]) #endif #ifndef XmNdirListItems #define XmNdirListItems ((char*)&_XmStrings[6099]) #endif #ifndef XmNdirListLabelString #define XmNdirListLabelString ((char*)&_XmStrings[6112]) #endif #ifndef XmNdirMask #define XmNdirMask ((char*)&_XmStrings[6131]) #endif #ifndef XmNdirSearchProc #define XmNdirSearchProc ((char*)&_XmStrings[6139]) #endif #ifndef XmNdirSpec #define XmNdirSpec ((char*)&_XmStrings[6153]) #endif #ifndef XmNdirectory #define XmNdirectory ((char*)&_XmStrings[6161]) #endif #ifndef XmNdirectoryValid #define XmNdirectoryValid ((char*)&_XmStrings[6171]) #endif #ifndef XmNdisarmCallback #define XmNdisarmCallback ((char*)&_XmStrings[6186]) #endif #ifndef XmNdoubleClickInterval #define XmNdoubleClickInterval ((char*)&_XmStrings[6201]) #endif #ifndef XmNdragCallback #define XmNdragCallback ((char*)&_XmStrings[6221]) #endif #ifndef XmNdragContextClass #define XmNdragContextClass ((char*)&_XmStrings[6234]) #endif #ifndef XmNdragDropFinishCallback #define XmNdragDropFinishCallback ((char*)&_XmStrings[6251]) #endif #ifndef XmNdragIconClass #define XmNdragIconClass ((char*)&_XmStrings[6274]) #endif #ifndef XmNdragInitiatorProtocolStyle #define XmNdragInitiatorProtocolStyle ((char*)&_XmStrings[6288]) #endif #ifndef XmNdragMotionCallback #define XmNdragMotionCallback ((char*)&_XmStrings[6315]) #endif #ifndef XmNdragOperations #define XmNdragOperations ((char*)&_XmStrings[6334]) #endif #ifndef XmNdragOverMode #define XmNdragOverMode ((char*)&_XmStrings[6349]) #endif #ifndef XmNdragProc #define XmNdragProc ((char*)&_XmStrings[6362]) #endif #ifndef XmNdragReceiverProtocolStyle #define XmNdragReceiverProtocolStyle ((char*)&_XmStrings[6371]) #endif #ifndef XmNdropFinishCallback #define XmNdropFinishCallback ((char*)&_XmStrings[6397]) #endif #ifndef XmNdropProc #define XmNdropProc ((char*)&_XmStrings[6416]) #endif #ifndef XmNdropRectangles #define XmNdropRectangles ((char*)&_XmStrings[6425]) #endif #ifndef XmNdropSiteActivity #define XmNdropSiteActivity ((char*)&_XmStrings[6440]) #endif #ifndef XmNdropSiteEnterCallback #define XmNdropSiteEnterCallback ((char*)&_XmStrings[6457]) #endif #ifndef XmNdropSiteLeaveCallback #define XmNdropSiteLeaveCallback ((char*)&_XmStrings[6479]) #endif #ifndef XmNdropSiteManagerClass #define XmNdropSiteManagerClass ((char*)&_XmStrings[6501]) #endif #ifndef XmNdropSiteOperations #define XmNdropSiteOperations ((char*)&_XmStrings[6522]) #endif #ifndef XmNdropSiteType #define XmNdropSiteType ((char*)&_XmStrings[6541]) #endif #ifndef XmNdropStartCallback #define XmNdropStartCallback ((char*)&_XmStrings[6554]) #endif #ifndef XmNdropTransferClass #define XmNdropTransferClass ((char*)&_XmStrings[6572]) #endif #ifndef XmNdropTransfers #define XmNdropTransfers ((char*)&_XmStrings[6590]) #endif #ifndef XmNeditMode #define XmNeditMode ((char*)&_XmStrings[6604]) #endif #ifndef XmNeditable #define XmNeditable ((char*)&_XmStrings[6613]) #endif #ifndef XmNentryAlignment #define XmNentryAlignment ((char*)&_XmStrings[6622]) #endif #ifndef XmNentryBorder #define XmNentryBorder ((char*)&_XmStrings[6637]) #endif #ifndef XmNentryCallback #define XmNentryCallback ((char*)&_XmStrings[6649]) #endif #ifndef XmNentryClass #define XmNentryClass ((char*)&_XmStrings[6663]) #endif #ifndef XmNentryVerticalAlignment #define XmNentryVerticalAlignment ((char*)&_XmStrings[6674]) #endif #ifndef XmNexportTargets #define XmNexportTargets ((char*)&_XmStrings[6697]) #endif #ifndef XmNexposeCallback #define XmNexposeCallback ((char*)&_XmStrings[6711]) #endif #ifndef XmNextendedSelectionCallback #define XmNextendedSelectionCallback ((char*)&_XmStrings[6726]) #endif #ifndef XmNextensionType #define XmNextensionType ((char*)&_XmStrings[6752]) #endif #ifndef XmNfileListItemCount #define XmNfileListItemCount ((char*)&_XmStrings[6766]) #endif #ifndef XmNfileListItems #define XmNfileListItems ((char*)&_XmStrings[6784]) #endif #ifndef XmNfileListLabelString #define XmNfileListLabelString ((char*)&_XmStrings[6798]) #endif #ifndef XmNfileSearchProc #define XmNfileSearchProc ((char*)&_XmStrings[6818]) #endif #ifndef XmNfileTypeMask #define XmNfileTypeMask ((char*)&_XmStrings[6833]) #endif #ifndef XmNfillOnArm #define XmNfillOnArm ((char*)&_XmStrings[6846]) #endif #ifndef XmNfillOnSelect #define XmNfillOnSelect ((char*)&_XmStrings[6856]) #endif #ifndef XmNfilterLabelString #define XmNfilterLabelString ((char*)&_XmStrings[6869]) #endif #ifndef XmNfocusCallback #define XmNfocusCallback ((char*)&_XmStrings[6887]) #endif #ifndef XmNfocusMovedCallback #define XmNfocusMovedCallback ((char*)&_XmStrings[6901]) #endif #ifndef XmNfocusPolicyChanged #define XmNfocusPolicyChanged ((char*)&_XmStrings[6920]) #endif #ifndef XmNfontList #define XmNfontList ((char*)&_XmStrings[6939]) #endif #ifndef XmNforegroundThreshold #define XmNforegroundThreshold ((char*)&_XmStrings[6948]) #endif #ifndef XmNfractionBase #define XmNfractionBase ((char*)&_XmStrings[6968]) #endif #ifndef XmNgainPrimaryCallback #define XmNgainPrimaryCallback ((char*)&_XmStrings[6981]) #endif #ifndef XmNhelpCallback #define XmNhelpCallback ((char*)&_XmStrings[7001]) #endif #ifndef XmNhelpLabelString #define XmNhelpLabelString ((char*)&_XmStrings[7014]) #endif #ifndef XmNhighlightColor #define XmNhighlightColor ((char*)&_XmStrings[7030]) #endif #ifndef XmNhighlightOnEnter #define XmNhighlightOnEnter ((char*)&_XmStrings[7045]) #endif #ifndef XmNhighlightPixmap #define XmNhighlightPixmap ((char*)&_XmStrings[7062]) #endif #ifndef XmNhighlightThickness #define XmNhighlightThickness ((char*)&_XmStrings[7078]) #endif #ifndef XmNhistoryItemCount #define XmNhistoryItemCount ((char*)&_XmStrings[7097]) #endif #ifndef XmNhistoryItems #define XmNhistoryItems ((char*)&_XmStrings[7114]) #endif #ifndef XmNhistoryMaxItems #define XmNhistoryMaxItems ((char*)&_XmStrings[7127]) #endif #ifndef XmNhistoryVisibleItemCount #define XmNhistoryVisibleItemCount ((char*)&_XmStrings[7143]) #endif #ifndef XmNhorizontalFontUnit #define XmNhorizontalFontUnit ((char*)&_XmStrings[7167]) #endif #ifndef XmNhorizontalScrollBar #define XmNhorizontalScrollBar ((char*)&_XmStrings[7186]) #endif #ifndef XmNhorizontalSpacing #define XmNhorizontalSpacing ((char*)&_XmStrings[7206]) #endif #ifndef XmNhotX #define XmNhotX ((char*)&_XmStrings[7224]) #endif #ifndef XmNhotY #define XmNhotY ((char*)&_XmStrings[7229]) #endif #ifndef XmNiccHandle #define XmNiccHandle ((char*)&_XmStrings[7234]) #endif #ifndef XmNimportTargets #define XmNimportTargets ((char*)&_XmStrings[7244]) #endif #ifndef XmNincrement #define XmNincrement ((char*)&_XmStrings[7258]) #endif #ifndef XmNincrementCallback #define XmNincrementCallback ((char*)&_XmStrings[7268]) #endif #ifndef XmNincremental #define XmNincremental ((char*)&_XmStrings[7286]) #endif #ifndef XmNindicatorOn #define XmNindicatorOn ((char*)&_XmStrings[7298]) #endif #ifndef XmNindicatorSize #define XmNindicatorSize ((char*)&_XmStrings[7310]) #endif #ifndef XmNindicatorType #define XmNindicatorType ((char*)&_XmStrings[7324]) #endif #ifndef XmNinitialDelay #define XmNinitialDelay ((char*)&_XmStrings[7338]) #endif #ifndef XmNinitialFocus #define XmNinitialFocus ((char*)&_XmStrings[7351]) #endif #ifndef XmNinputCallback #define XmNinputCallback ((char*)&_XmStrings[7364]) #endif #ifndef XmNinputCreate #define XmNinputCreate ((char*)&_XmStrings[7378]) #endif #ifndef XmNinputMethod #define XmNinputMethod ((char*)&_XmStrings[7390]) #endif #ifndef XmNinvalidCursorForeground #define XmNinvalidCursorForeground ((char*)&_XmStrings[7402]) #endif #ifndef XmNisAligned #define XmNisAligned ((char*)&_XmStrings[7426]) #endif #ifndef XmNisHomogeneous #define XmNisHomogeneous ((char*)&_XmStrings[7436]) #endif #ifndef XmNitemCount #define XmNitemCount ((char*)&_XmStrings[7450]) #endif #ifndef XmNitems #define XmNitems ((char*)&_XmStrings[7460]) #endif #ifndef XmNkeyboardFocusPolicy #define XmNkeyboardFocusPolicy ((char*)&_XmStrings[7466]) #endif #ifndef XmNlabelFontList #define XmNlabelFontList ((char*)&_XmStrings[7486]) #endif #ifndef XmNlabelInsensitivePixmap #define XmNlabelInsensitivePixmap ((char*)&_XmStrings[7500]) #endif #ifndef XmNlabelPixmap #define XmNlabelPixmap ((char*)&_XmStrings[7523]) #endif #ifndef XmNlabelString #define XmNlabelString ((char*)&_XmStrings[7535]) #endif #ifndef XmNlabelType #define XmNlabelType ((char*)&_XmStrings[7547]) #endif #ifndef XmNleftAttachment #define XmNleftAttachment ((char*)&_XmStrings[7557]) #endif #ifndef XmNleftOffset #define XmNleftOffset ((char*)&_XmStrings[7572]) #endif #ifndef XmNleftPosition #define XmNleftPosition ((char*)&_XmStrings[7583]) #endif #ifndef XmNleftWidget #define XmNleftWidget ((char*)&_XmStrings[7596]) #endif #ifndef XmNlightThreshold #define XmNlightThreshold ((char*)&_XmStrings[7607]) #endif #ifndef XmNlineSpace #define XmNlineSpace ((char*)&_XmStrings[7622]) #endif #ifndef XmNlistItemCount #define XmNlistItemCount ((char*)&_XmStrings[7632]) #endif #ifndef XmNlistItems #define XmNlistItems ((char*)&_XmStrings[7646]) #endif #ifndef XmNlistLabelString #define XmNlistLabelString ((char*)&_XmStrings[7656]) #endif #ifndef XmNlistMarginHeight #define XmNlistMarginHeight ((char*)&_XmStrings[7672]) #endif #ifndef XmNlistMarginWidth #define XmNlistMarginWidth ((char*)&_XmStrings[7689]) #endif #ifndef XmNlistSizePolicy #define XmNlistSizePolicy ((char*)&_XmStrings[7705]) #endif #ifndef XmNlistSpacing #define XmNlistSpacing ((char*)&_XmStrings[7720]) #endif #ifndef XmNlistUpdated #define XmNlistUpdated ((char*)&_XmStrings[7732]) #endif #ifndef XmNlistVisibleItemCount #define XmNlistVisibleItemCount ((char*)&_XmStrings[7744]) #endif #ifndef XmNlogicalParent #define XmNlogicalParent ((char*)&_XmStrings[7765]) #endif #ifndef XmNlosePrimaryCallback #define XmNlosePrimaryCallback ((char*)&_XmStrings[7779]) #endif #ifndef XmNlosingFocusCallback #define XmNlosingFocusCallback ((char*)&_XmStrings[7799]) #endif #ifndef XmNmainWindowMarginHeight #define XmNmainWindowMarginHeight ((char*)&_XmStrings[7819]) #endif #ifndef XmNmainWindowMarginWidth #define XmNmainWindowMarginWidth ((char*)&_XmStrings[7842]) #endif #ifndef XmNmapCallback #define XmNmapCallback ((char*)&_XmStrings[7864]) #endif #ifndef XmNmappingDelay #define XmNmappingDelay ((char*)&_XmStrings[7876]) #endif #ifndef XmNmargin #define XmNmargin ((char*)&_XmStrings[7889]) #endif #ifndef XmNmarginBottom #define XmNmarginBottom ((char*)&_XmStrings[7896]) #endif #ifndef XmNmarginHeight #define XmNmarginHeight ((char*)&_XmStrings[7909]) #endif #ifndef XmNmarginLeft #define XmNmarginLeft ((char*)&_XmStrings[7922]) #endif #ifndef XmNmarginRight #define XmNmarginRight ((char*)&_XmStrings[7933]) #endif #ifndef XmNmarginTop #define XmNmarginTop ((char*)&_XmStrings[7945]) #endif #ifndef XmNmarginWidth #define XmNmarginWidth ((char*)&_XmStrings[7955]) #endif #ifndef XmNmask #define XmNmask ((char*)&_XmStrings[7967]) #endif #ifndef XmNmaxLength #define XmNmaxLength ((char*)&_XmStrings[7972]) #endif #ifndef XmNmaximum #define XmNmaximum ((char*)&_XmStrings[7982]) #endif #ifndef XmNmenuAccelerator #define XmNmenuAccelerator ((char*)&_XmStrings[7990]) #endif #ifndef XmNmenuBar #define XmNmenuBar ((char*)&_XmStrings[8006]) #endif #ifndef XmNmenuCursor #define XmNmenuCursor ((char*)&_XmStrings[8014]) #endif #ifndef XmNmenuHelpWidget #define XmNmenuHelpWidget ((char*)&_XmStrings[8025]) #endif #ifndef XmNmenuHistory #define XmNmenuHistory ((char*)&_XmStrings[8040]) #endif #ifndef XmNmenuPost #define XmNmenuPost ((char*)&_XmStrings[8052]) #endif #ifndef XmNmessageAlignment #define XmNmessageAlignment ((char*)&_XmStrings[8061]) #endif #ifndef XmNmessageProc #define XmNmessageProc ((char*)&_XmStrings[8078]) #endif #ifndef XmNmessageString #define XmNmessageString ((char*)&_XmStrings[8090]) #endif #ifndef XmNmessageWindow #define XmNmessageWindow ((char*)&_XmStrings[8104]) #endif #ifndef XmNminimizeButtons #define XmNminimizeButtons ((char*)&_XmStrings[8118]) #endif #ifndef XmNminimum #define XmNminimum ((char*)&_XmStrings[8134]) #endif #ifndef XmNmnemonic #define XmNmnemonic ((char*)&_XmStrings[8142]) #endif #ifndef XmNmnemonicCharSet #define XmNmnemonicCharSet ((char*)&_XmStrings[8151]) #endif #ifndef XmNmodifyVerifyCallback #define XmNmodifyVerifyCallback ((char*)&_XmStrings[8167]) #endif #ifndef XmNmodifyVerifyCallbackWcs #define XmNmodifyVerifyCallbackWcs ((char*)&_XmStrings[8188]) #endif #ifndef XmNmotionVerifyCallback #define XmNmotionVerifyCallback ((char*)&_XmStrings[8212]) #endif #ifndef XmNmoveOpaque #define XmNmoveOpaque ((char*)&_XmStrings[8233]) #endif #ifndef XmNmultiClick #define XmNmultiClick ((char*)&_XmStrings[8244]) #endif #ifndef XmNmultipleSelectionCallback #define XmNmultipleSelectionCallback ((char*)&_XmStrings[8255]) #endif #ifndef XmNmustMatch #define XmNmustMatch ((char*)&_XmStrings[8281]) #endif #ifndef XmNmwmDecorations #define XmNmwmDecorations ((char*)&_XmStrings[8291]) #endif #ifndef XmNmwmFunctions #define XmNmwmFunctions ((char*)&_XmStrings[8306]) #endif #ifndef XmNmwmInputMode #define XmNmwmInputMode ((char*)&_XmStrings[8319]) #endif #ifndef XmNmwmMenu #define XmNmwmMenu ((char*)&_XmStrings[8332]) #endif #ifndef XmNmwmMessages #define XmNmwmMessages ((char*)&_XmStrings[8340]) #endif #ifndef XmNnavigationType #define XmNnavigationType ((char*)&_XmStrings[8352]) #endif #ifndef XmNneedsMotion #define XmNneedsMotion ((char*)&_XmStrings[8367]) #endif #ifndef XmNnoMatchCallback #define XmNnoMatchCallback ((char*)&_XmStrings[8379]) #endif #ifndef XmNnoMatchString #define XmNnoMatchString ((char*)&_XmStrings[8395]) #endif #ifndef XmNnoResize #define XmNnoResize ((char*)&_XmStrings[8409]) #endif #ifndef XmNnoneCursorForeground #define XmNnoneCursorForeground ((char*)&_XmStrings[8418]) #endif #ifndef XmNnotifyProc #define XmNnotifyProc ((char*)&_XmStrings[8439]) #endif #ifndef XmNnumColumns #define XmNnumColumns ((char*)&_XmStrings[8450]) #endif #ifndef XmNnumDropRectangles #define XmNnumDropRectangles ((char*)&_XmStrings[8461]) #endif #ifndef XmNnumDropTransfers #define XmNnumDropTransfers ((char*)&_XmStrings[8479]) #endif #ifndef XmNnumExportTargets #define XmNnumExportTargets ((char*)&_XmStrings[8496]) #endif #ifndef XmNnumImportTargets #define XmNnumImportTargets ((char*)&_XmStrings[8513]) #endif #ifndef XmNnumRectangles #define XmNnumRectangles ((char*)&_XmStrings[8530]) #endif #ifndef XmNoffsetX #define XmNoffsetX ((char*)&_XmStrings[8544]) #endif #ifndef XmNoffsetY #define XmNoffsetY ((char*)&_XmStrings[8552]) #endif #ifndef XmNokCallback #define XmNokCallback ((char*)&_XmStrings[8560]) #endif #ifndef XmNokLabelString #define XmNokLabelString ((char*)&_XmStrings[8571]) #endif #ifndef XmNoperationChangedCallback #define XmNoperationChangedCallback ((char*)&_XmStrings[8585]) #endif #ifndef XmNoperationCursorIcon #define XmNoperationCursorIcon ((char*)&_XmStrings[8610]) #endif #ifndef XmNoptionLabel #define XmNoptionLabel ((char*)&_XmStrings[8630]) #endif #ifndef XmNoptionMnemonic #define XmNoptionMnemonic ((char*)&_XmStrings[8642]) #endif #ifndef XmNoutputCreate #define XmNoutputCreate ((char*)&_XmStrings[8657]) #endif #ifndef XmNpacking #define XmNpacking ((char*)&_XmStrings[8670]) #endif #ifndef XmNpageDecrementCallback #define XmNpageDecrementCallback ((char*)&_XmStrings[8678]) #endif #ifndef XmNpageIncrement #define XmNpageIncrement ((char*)&_XmStrings[8700]) #endif #ifndef XmNpageIncrementCallback #define XmNpageIncrementCallback ((char*)&_XmStrings[8714]) #endif #ifndef XmNpaneMaximum #define XmNpaneMaximum ((char*)&_XmStrings[8736]) #endif #ifndef XmNpaneMinimum #define XmNpaneMinimum ((char*)&_XmStrings[8748]) #endif #ifndef XmNpattern #define XmNpattern ((char*)&_XmStrings[8760]) #endif #ifndef XmNpendingDelete #define XmNpendingDelete ((char*)&_XmStrings[8768]) #endif #ifndef XmNpopupEnabled #define XmNpopupEnabled ((char*)&_XmStrings[8782]) #endif #ifndef XmNpositionIndex #define XmNpositionIndex ((char*)&_XmStrings[8795]) #endif #ifndef XmNpostFromButton #define XmNpostFromButton ((char*)&_XmStrings[8809]) #endif #ifndef XmNpostFromCount #define XmNpostFromCount ((char*)&_XmStrings[8824]) #endif #ifndef XmNpostFromList #define XmNpostFromList ((char*)&_XmStrings[8838]) #endif #ifndef XmNpreeditType #define XmNpreeditType ((char*)&_XmStrings[8851]) #endif #ifndef XmNprocessingDirection #define XmNprocessingDirection ((char*)&_XmStrings[8863]) #endif #ifndef XmNpromptString #define XmNpromptString ((char*)&_XmStrings[8883]) #endif #ifndef XmNprotocolCallback #define XmNprotocolCallback ((char*)&_XmStrings[8896]) #endif #ifndef XmNpushButtonEnabled #define XmNpushButtonEnabled ((char*)&_XmStrings[8913]) #endif #ifndef XmNqualifySearchDataProc #define XmNqualifySearchDataProc ((char*)&_XmStrings[8931]) #endif #ifndef XmNradioAlwaysOne #define XmNradioAlwaysOne ((char*)&_XmStrings[8953]) #endif #ifndef XmNradioBehavior #define XmNradioBehavior ((char*)&_XmStrings[8968]) #endif #ifndef XmNrealizeCallback #define XmNrealizeCallback ((char*)&_XmStrings[8982]) #endif #ifndef XmNrecomputeSize #define XmNrecomputeSize ((char*)&_XmStrings[8998]) #endif #ifndef XmNrectangles #define XmNrectangles ((char*)&_XmStrings[9012]) #endif #ifndef XmNrefigureMode #define XmNrefigureMode ((char*)&_XmStrings[9023]) #endif #ifndef XmNrepeatDelay #define XmNrepeatDelay ((char*)&_XmStrings[9036]) #endif #ifndef XmNresizable #define XmNresizable ((char*)&_XmStrings[9048]) #endif #ifndef XmNresizeCallback #define XmNresizeCallback ((char*)&_XmStrings[9058]) #endif #ifndef XmNresizeHeight #define XmNresizeHeight ((char*)&_XmStrings[9073]) #endif #ifndef XmNresizePolicy #define XmNresizePolicy ((char*)&_XmStrings[9086]) #endif #ifndef XmNresizeWidth #define XmNresizeWidth ((char*)&_XmStrings[9099]) #endif #ifndef XmNrightAttachment #define XmNrightAttachment ((char*)&_XmStrings[9111]) #endif #ifndef XmNrightOffset #define XmNrightOffset ((char*)&_XmStrings[9127]) #endif #ifndef XmNrightPosition #define XmNrightPosition ((char*)&_XmStrings[9139]) #endif #ifndef XmNrightWidget #define XmNrightWidget ((char*)&_XmStrings[9153]) #endif #ifndef XmNrowColumnType #define XmNrowColumnType ((char*)&_XmStrings[9165]) #endif #ifndef XmNrows #define XmNrows ((char*)&_XmStrings[9179]) #endif #ifndef XmNrubberPositioning #define XmNrubberPositioning ((char*)&_XmStrings[9184]) #endif #ifndef XmNsashHeight #define XmNsashHeight ((char*)&_XmStrings[9202]) #endif #ifndef XmNsashIndent #define XmNsashIndent ((char*)&_XmStrings[9213]) #endif #ifndef XmNsashShadowThickness #define XmNsashShadowThickness ((char*)&_XmStrings[9224]) #endif #ifndef XmNsashWidth #define XmNsashWidth ((char*)&_XmStrings[9244]) #endif #ifndef XmNscaleHeight #define XmNscaleHeight ((char*)&_XmStrings[9254]) #endif #ifndef XmNscaleMultiple #define XmNscaleMultiple ((char*)&_XmStrings[9266]) #endif #ifndef XmNscaleWidth #define XmNscaleWidth ((char*)&_XmStrings[9280]) #endif #ifndef XmNscrollBarDisplayPolicy #define XmNscrollBarDisplayPolicy ((char*)&_XmStrings[9291]) #endif #ifndef XmNscrollBarPlacement #define XmNscrollBarPlacement ((char*)&_XmStrings[9314]) #endif #ifndef XmNscrollHorizontal #define XmNscrollHorizontal ((char*)&_XmStrings[9333]) #endif #ifndef XmNscrollLeftSide #define XmNscrollLeftSide ((char*)&_XmStrings[9350]) #endif #ifndef XmNscrollTopSide #define XmNscrollTopSide ((char*)&_XmStrings[9365]) #endif #ifndef XmNscrollVertical #define XmNscrollVertical ((char*)&_XmStrings[9379]) #endif #ifndef XmNscrolledWindowMarginHeight #define XmNscrolledWindowMarginHeight ((char*)&_XmStrings[9394]) #endif #ifndef XmNscrolledWindowMarginWidth #define XmNscrolledWindowMarginWidth ((char*)&_XmStrings[9421]) #endif #ifndef XmNscrollingPolicy #define XmNscrollingPolicy ((char*)&_XmStrings[9447]) #endif #ifndef XmNselectColor #define XmNselectColor ((char*)&_XmStrings[9463]) #endif #ifndef XmNselectInsensitivePixmap #define XmNselectInsensitivePixmap ((char*)&_XmStrings[9475]) #endif #ifndef XmNselectPixmap #define XmNselectPixmap ((char*)&_XmStrings[9499]) #endif #ifndef XmNselectThreshold #define XmNselectThreshold ((char*)&_XmStrings[9512]) #endif #ifndef XmNselectedItemCount #define XmNselectedItemCount ((char*)&_XmStrings[9528]) #endif #ifndef XmNselectedItems #define XmNselectedItems ((char*)&_XmStrings[9546]) #endif #ifndef XmNselectionArrayCount #define XmNselectionArrayCount ((char*)&_XmStrings[9560]) #endif #ifndef XmNselectionLabelString #define XmNselectionLabelString ((char*)&_XmStrings[9580]) #endif #ifndef XmNselectionPolicy #define XmNselectionPolicy ((char*)&_XmStrings[9601]) #endif #ifndef XmNseparatorOn #define XmNseparatorOn ((char*)&_XmStrings[9617]) #endif #ifndef XmNseparatorType #define XmNseparatorType ((char*)&_XmStrings[9629]) #endif #ifndef XmNset #define XmNset ((char*)&_XmStrings[9643]) #endif #ifndef XmNshadow #define XmNshadow ((char*)&_XmStrings[9647]) #endif #ifndef XmNshadowThickness #define XmNshadowThickness ((char*)&_XmStrings[9654]) #endif #ifndef XmNshadowType #define XmNshadowType ((char*)&_XmStrings[9670]) #endif #ifndef XmNshellUnitType #define XmNshellUnitType ((char*)&_XmStrings[9681]) #endif #ifndef XmNshowArrows #define XmNshowArrows ((char*)&_XmStrings[9695]) #endif #ifndef XmNshowAsDefault #define XmNshowAsDefault ((char*)&_XmStrings[9706]) #endif #ifndef XmNshowSeparator #define XmNshowSeparator ((char*)&_XmStrings[9720]) #endif #ifndef XmNshowValue #define XmNshowValue ((char*)&_XmStrings[9734]) #endif #ifndef XmNsimpleCallback #define XmNsimpleCallback ((char*)&_XmStrings[9744]) #endif #ifndef XmNsingleSelectionCallback #define XmNsingleSelectionCallback ((char*)&_XmStrings[9759]) #endif #ifndef XmNsizePolicy #define XmNsizePolicy ((char*)&_XmStrings[9783]) #endif #ifndef XmNskipAdjust #define XmNskipAdjust ((char*)&_XmStrings[9794]) #endif #ifndef XmNsliderSize #define XmNsliderSize ((char*)&_XmStrings[9805]) #endif #ifndef XmNsource #define XmNsource ((char*)&_XmStrings[9816]) #endif #ifndef XmNsourceCursorIcon #define XmNsourceCursorIcon ((char*)&_XmStrings[9823]) #endif #ifndef XmNsourceIsExternal #define XmNsourceIsExternal ((char*)&_XmStrings[9840]) #endif #ifndef XmNsourcePixmapIcon #define XmNsourcePixmapIcon ((char*)&_XmStrings[9857]) #endif #ifndef XmNsourceWidget #define XmNsourceWidget ((char*)&_XmStrings[9874]) #endif #ifndef XmNsourceWindow #define XmNsourceWindow ((char*)&_XmStrings[9887]) #endif #ifndef XmNspacing #define XmNspacing ((char*)&_XmStrings[9900]) #endif #ifndef XmNspotLocation #define XmNspotLocation ((char*)&_XmStrings[9908]) #endif #ifndef XmNstartTime #define XmNstartTime ((char*)&_XmStrings[9921]) #endif #ifndef XmNstateCursorIcon #define XmNstateCursorIcon ((char*)&_XmStrings[9931]) #endif #ifndef XmNstringDirection #define XmNstringDirection ((char*)&_XmStrings[9947]) #endif #ifndef XmNsubMenuId #define XmNsubMenuId ((char*)&_XmStrings[9963]) #endif #ifndef XmNsymbolPixmap #define XmNsymbolPixmap ((char*)&_XmStrings[9973]) #endif #ifndef XmNtearOffMenuActivateCallback #define XmNtearOffMenuActivateCallback ((char*)&_XmStrings[9986]) #endif #ifndef XmNtearOffMenuDeactivateCallback #define XmNtearOffMenuDeactivateCallback ((char*)&_XmStrings[10014]) #endif #ifndef XmNtearOffModel #define XmNtearOffModel ((char*)&_XmStrings[10044]) #endif #ifndef XmNtextAccelerators #define XmNtextAccelerators ((char*)&_XmStrings[10057]) #endif #ifndef XmNtextColumns #define XmNtextColumns ((char*)&_XmStrings[10074]) #endif #ifndef XmNtextFontList #define XmNtextFontList ((char*)&_XmStrings[10086]) #endif #ifndef XmNtextString #define XmNtextString ((char*)&_XmStrings[10099]) #endif #ifndef XmNtextTranslations #define XmNtextTranslations ((char*)&_XmStrings[10110]) #endif #ifndef XmNtextValue #define XmNtextValue ((char*)&_XmStrings[10127]) #endif #ifndef XmNtitleString #define XmNtitleString ((char*)&_XmStrings[10137]) #endif #ifndef XmNtoBottomCallback #define XmNtoBottomCallback ((char*)&_XmStrings[10149]) #endif #ifndef XmNtoPositionCallback #define XmNtoPositionCallback ((char*)&_XmStrings[10166]) #endif #ifndef XmNtoTopCallback #define XmNtoTopCallback ((char*)&_XmStrings[10185]) #endif #ifndef XmNtopAttachment #define XmNtopAttachment ((char*)&_XmStrings[10199]) #endif #ifndef XmNtopCharacter #define XmNtopCharacter ((char*)&_XmStrings[10213]) #endif #ifndef XmNtopItemPosition #define XmNtopItemPosition ((char*)&_XmStrings[10226]) #endif #ifndef XmNtopLevelEnterCallback #define XmNtopLevelEnterCallback ((char*)&_XmStrings[10242]) #endif #ifndef XmNtopLevelLeaveCallback #define XmNtopLevelLeaveCallback ((char*)&_XmStrings[10264]) #endif #ifndef XmNtopOffset #define XmNtopOffset ((char*)&_XmStrings[10286]) #endif #ifndef XmNtopPosition #define XmNtopPosition ((char*)&_XmStrings[10296]) #endif #ifndef XmNtopShadowColor #define XmNtopShadowColor ((char*)&_XmStrings[10308]) #endif #ifndef XmNtopShadowPixmap #define XmNtopShadowPixmap ((char*)&_XmStrings[10323]) #endif #ifndef XmNtopWidget #define XmNtopWidget ((char*)&_XmStrings[10339]) #endif #ifndef XmNtransferProc #define XmNtransferProc ((char*)&_XmStrings[10349]) #endif #ifndef XmNtransferStatus #define XmNtransferStatus ((char*)&_XmStrings[10362]) #endif #ifndef XmNtraversalCallback #define XmNtraversalCallback ((char*)&_XmStrings[10377]) #endif #ifndef XmNtraversalOn #define XmNtraversalOn ((char*)&_XmStrings[10395]) #endif #ifndef XmNtraversalType #define XmNtraversalType ((char*)&_XmStrings[10407]) #endif #ifndef XmNtraverseObscuredCallback #define XmNtraverseObscuredCallback ((char*)&_XmStrings[10421]) #endif #ifndef XmNtreeUpdateProc #define XmNtreeUpdateProc ((char*)&_XmStrings[10446]) #endif #ifndef XmNtroughColor #define XmNtroughColor ((char*)&_XmStrings[10461]) #endif #ifndef XmNunitType #define XmNunitType ((char*)&_XmStrings[10473]) #endif #ifndef XmNunmapCallback #define XmNunmapCallback ((char*)&_XmStrings[10482]) #endif #ifndef XmNunpostBehavior #define XmNunpostBehavior ((char*)&_XmStrings[10496]) #endif #ifndef XmNunselectPixmap #define XmNunselectPixmap ((char*)&_XmStrings[10511]) #endif #ifndef XmNupdateSliderSize #define XmNupdateSliderSize ((char*)&_XmStrings[10526]) #endif #ifndef XmNuseAsyncGeometry #define XmNuseAsyncGeometry ((char*)&_XmStrings[10543]) #endif #ifndef XmNuserData #define XmNuserData ((char*)&_XmStrings[10560]) #endif #ifndef XmNvalidCursorForeground #define XmNvalidCursorForeground ((char*)&_XmStrings[10569]) #endif #ifndef XmNvalueChangedCallback #define XmNvalueChangedCallback ((char*)&_XmStrings[10591]) #endif #ifndef XmNvalueWcs #define XmNvalueWcs ((char*)&_XmStrings[10612]) #endif #ifndef XmNverifyBell #define XmNverifyBell ((char*)&_XmStrings[10621]) #endif #ifndef XmNverticalFontUnit #define XmNverticalFontUnit ((char*)&_XmStrings[10632]) #endif #ifndef XmNverticalScrollBar #define XmNverticalScrollBar ((char*)&_XmStrings[10649]) #endif #ifndef XmNverticalSpacing #define XmNverticalSpacing ((char*)&_XmStrings[10667]) #endif #ifndef XmNvisibleItemCount #define XmNvisibleItemCount ((char*)&_XmStrings[10683]) #endif #ifndef XmNvisibleWhenOff #define XmNvisibleWhenOff ((char*)&_XmStrings[10700]) #endif #ifndef XmNvisualPolicy #define XmNvisualPolicy ((char*)&_XmStrings[10715]) #endif #ifndef XmNwhichButton #define XmNwhichButton ((char*)&_XmStrings[10728]) #endif #ifndef XmNwordWrap #define XmNwordWrap ((char*)&_XmStrings[10740]) #endif #ifndef XmNworkWindow #define XmNworkWindow ((char*)&_XmStrings[10749]) #endif #ifndef XmRAlignment #define XmRAlignment ((char*)&_XmStrings[10760]) #endif #ifndef XmRAnimationMask #define XmRAnimationMask ((char*)&_XmStrings[10770]) #endif #ifndef XmRAnimationPixmap #define XmRAnimationPixmap ((char*)&_XmStrings[10784]) #endif #ifndef XmRAnimationStyle #define XmRAnimationStyle ((char*)&_XmStrings[10800]) #endif #ifndef XmRArrowDirection #define XmRArrowDirection ((char*)&_XmStrings[10815]) #endif #ifndef XmRAtomList #define XmRAtomList ((char*)&_XmStrings[10830]) #endif #ifndef XmRAttachment #define XmRAttachment ((char*)&_XmStrings[10839]) #endif #ifndef XmRAudibleWarning #define XmRAudibleWarning ((char*)&_XmStrings[10850]) #endif #ifndef XmRAvailability #define XmRAvailability ((char*)&_XmStrings[10865]) #endif #ifndef XmRBackgroundPixmap #define XmRBackgroundPixmap ((char*)&_XmStrings[10878]) #endif #ifndef XmRBlendModel #define XmRBlendModel ((char*)&_XmStrings[10895]) #endif #ifndef XmRBooleanDimension #define XmRBooleanDimension ((char*)&_XmStrings[10906]) #endif #ifndef XmRBottomShadowPixmap #define XmRBottomShadowPixmap ((char*)&_XmStrings[10923]) #endif #ifndef XmRButtonType #define XmRButtonType ((char*)&_XmStrings[10942]) #endif #ifndef XmRCallbackProc #define XmRCallbackProc ((char*)&_XmStrings[10953]) #endif #ifndef XmRChar #define XmRChar ((char*)&_XmStrings[10966]) #endif #ifndef XmRCharSetTable #define XmRCharSetTable ((char*)&_XmStrings[10971]) #endif #ifndef XmRChildHorizontalAlignment #define XmRChildHorizontalAlignment ((char*)&_XmStrings[10984]) #endif #ifndef XmRChildPlacement #define XmRChildPlacement ((char*)&_XmStrings[11009]) #endif #ifndef XmRChildType #define XmRChildType ((char*)&_XmStrings[11024]) #endif #ifndef XmRChildVerticalAlignment #define XmRChildVerticalAlignment ((char*)&_XmStrings[11034]) #endif #ifndef XmRCommandWindowLocation #define XmRCommandWindowLocation ((char*)&_XmStrings[11057]) #endif #ifndef XmRCompoundText #define XmRCompoundText ((char*)&_XmStrings[11079]) #endif #ifndef XmRDefaultButtonType #define XmRDefaultButtonType ((char*)&_XmStrings[11092]) #endif #ifndef XmRDeleteResponse #define XmRDeleteResponse ((char*)&_XmStrings[11110]) #endif #ifndef XmRDialogStyle #define XmRDialogStyle ((char*)&_XmStrings[11125]) #endif #ifndef XmRDialogType #define XmRDialogType ((char*)&_XmStrings[11137]) #endif #ifndef XmRDoubleClickInterval #define XmRDoubleClickInterval ((char*)&_XmStrings[11148]) #endif #ifndef XmRDragInitiatorProtocolStyle #define XmRDragInitiatorProtocolStyle ((char*)&_XmStrings[11168]) #endif #ifndef XmRDragReceiverProtocolStyle #define XmRDragReceiverProtocolStyle ((char*)&_XmStrings[11195]) #endif #ifndef XmRDropSiteActivity #define XmRDropSiteActivity ((char*)&_XmStrings[11221]) #endif #ifndef XmRDropSiteOperations #define XmRDropSiteOperations ((char*)&_XmStrings[11238]) #endif #ifndef XmRDropSiteType #define XmRDropSiteType ((char*)&_XmStrings[11257]) #endif #ifndef XmRDropTransfers #define XmRDropTransfers ((char*)&_XmStrings[11270]) #endif #ifndef XmRExtensionType #define XmRExtensionType ((char*)&_XmStrings[11284]) #endif #ifndef XmRFileTypeMask #define XmRFileTypeMask ((char*)&_XmStrings[11298]) #endif #ifndef XmRFontList #define XmRFontList ((char*)&_XmStrings[11311]) #endif #ifndef XmRGadgetPixmap #define XmRGadgetPixmap ((char*)&_XmStrings[11320]) #endif #ifndef XmRHighlightPixmap #define XmRHighlightPixmap ((char*)&_XmStrings[11333]) #endif #ifndef XmRHorizontalDimension #define XmRHorizontalDimension ((char*)&_XmStrings[11349]) #endif #ifndef XmRHorizontalInt #define XmRHorizontalInt ((char*)&_XmStrings[11369]) #endif #ifndef XmRHorizontalPosition #define XmRHorizontalPosition ((char*)&_XmStrings[11383]) #endif #ifndef XmRIconAttachment #define XmRIconAttachment ((char*)&_XmStrings[11402]) #endif #ifndef XmRImportTargets #define XmRImportTargets ((char*)&_XmStrings[11417]) #endif #ifndef XmRIndicatorType #define XmRIndicatorType ((char*)&_XmStrings[11431]) #endif #ifndef XmRItemCount #define XmRItemCount ((char*)&_XmStrings[11445]) #endif #ifndef XmRItems #define XmRItems ((char*)&_XmStrings[11455]) #endif #ifndef XmRKeySym #define XmRKeySym ((char*)&_XmStrings[11461]) #endif #ifndef XmRKeySymTable #define XmRKeySymTable ((char*)&_XmStrings[11468]) #endif #ifndef XmRKeyboardFocusPolicy #define XmRKeyboardFocusPolicy ((char*)&_XmStrings[11480]) #endif #ifndef XmRLabelType #define XmRLabelType ((char*)&_XmStrings[11500]) #endif #ifndef XmRListMarginHeight #define XmRListMarginHeight ((char*)&_XmStrings[11510]) #endif #ifndef XmRListMarginWidth #define XmRListMarginWidth ((char*)&_XmStrings[11527]) #endif #ifndef XmRListSizePolicy #define XmRListSizePolicy ((char*)&_XmStrings[11543]) #endif #ifndef XmRListSpacing #define XmRListSpacing ((char*)&_XmStrings[11558]) #endif #ifndef XmRManBottomShadowPixmap #define XmRManBottomShadowPixmap ((char*)&_XmStrings[11570]) #endif #ifndef XmRManForegroundPixmap #define XmRManForegroundPixmap ((char*)&_XmStrings[11592]) #endif #ifndef XmRManHighlightPixmap #define XmRManHighlightPixmap ((char*)&_XmStrings[11612]) #endif #ifndef XmRManTopShadowPixmap #define XmRManTopShadowPixmap ((char*)&_XmStrings[11631]) #endif #ifndef XmRMenuWidget #define XmRMenuWidget ((char*)&_XmStrings[11650]) #endif #ifndef XmRMnemonic #define XmRMnemonic ((char*)&_XmStrings[11661]) #endif #ifndef XmRMultiClick #define XmRMultiClick ((char*)&_XmStrings[11670]) #endif #ifndef XmRNavigationType #define XmRNavigationType ((char*)&_XmStrings[11681]) #endif #ifndef XmRPacking #define XmRPacking ((char*)&_XmStrings[11696]) #endif #ifndef XmRPrimForegroundPixmap #define XmRPrimForegroundPixmap ((char*)&_XmStrings[11704]) #endif #ifndef XmRProc #define XmRProc ((char*)&_XmStrings[11725]) #endif #ifndef XmRProcessingDirection #define XmRProcessingDirection ((char*)&_XmStrings[11730]) #endif #ifndef XmRRectangleList #define XmRRectangleList ((char*)&_XmStrings[11750]) #endif #ifndef XmRResizePolicy #define XmRResizePolicy ((char*)&_XmStrings[11764]) #endif #ifndef XmRRowColumnType #define XmRRowColumnType ((char*)&_XmStrings[11777]) #endif #ifndef XmRScrollBarDisplayPolicy #define XmRScrollBarDisplayPolicy ((char*)&_XmStrings[11791]) #endif #ifndef XmRScrollBarPlacement #define XmRScrollBarPlacement ((char*)&_XmStrings[11814]) #endif #ifndef XmRScrollingPolicy #define XmRScrollingPolicy ((char*)&_XmStrings[11833]) #endif #ifndef XmRSelectedItemCount #define XmRSelectedItemCount ((char*)&_XmStrings[11849]) #endif #ifndef XmRSelectedItems #define XmRSelectedItems ((char*)&_XmStrings[11867]) #endif #ifndef XmRSelectionPolicy #define XmRSelectionPolicy ((char*)&_XmStrings[11881]) #endif #ifndef XmRSelectionType #define XmRSelectionType ((char*)&_XmStrings[11897]) #endif #ifndef XmRSeparatorType #define XmRSeparatorType ((char*)&_XmStrings[11911]) #endif #ifndef XmRShadowType #define XmRShadowType ((char*)&_XmStrings[11925]) #endif #ifndef XmRShellHorizDim #define XmRShellHorizDim ((char*)&_XmStrings[11936]) #endif #ifndef XmRShellHorizPos #define XmRShellHorizPos ((char*)&_XmStrings[11950]) #endif #ifndef XmRShellUnitType #define XmRShellUnitType ((char*)&_XmStrings[11964]) #endif #ifndef XmRShellVertDim #define XmRShellVertDim ((char*)&_XmStrings[11978]) #endif #ifndef XmRShellVertPos #define XmRShellVertPos ((char*)&_XmStrings[11991]) #endif #ifndef XmRSizePolicy #define XmRSizePolicy ((char*)&_XmStrings[12004]) #endif #ifndef XmRStringDirection #define XmRStringDirection ((char*)&_XmStrings[12015]) #endif #ifndef XmRTearOffModel #define XmRTearOffModel ((char*)&_XmStrings[12031]) #endif #ifndef XmRTopShadowPixmap #define XmRTopShadowPixmap ((char*)&_XmStrings[12044]) #endif #ifndef XmRTransferStatus #define XmRTransferStatus ((char*)&_XmStrings[12060]) #endif #ifndef XmRTraversalType #define XmRTraversalType ((char*)&_XmStrings[12075]) #endif #ifndef XmRUnitType #define XmRUnitType ((char*)&_XmStrings[12089]) #endif #ifndef XmRUnpostBehavior #define XmRUnpostBehavior ((char*)&_XmStrings[12098]) #endif #ifndef XmRValueWcs #define XmRValueWcs ((char*)&_XmStrings[12113]) #endif #ifndef XmRVerticalAlignment #define XmRVerticalAlignment ((char*)&_XmStrings[12122]) #endif #ifndef XmRVerticalDimension #define XmRVerticalDimension ((char*)&_XmStrings[12140]) #endif #ifndef XmRVerticalInt #define XmRVerticalInt ((char*)&_XmStrings[12158]) #endif #ifndef XmRVerticalPosition #define XmRVerticalPosition ((char*)&_XmStrings[12170]) #endif #ifndef XmRVirtualBinding #define XmRVirtualBinding ((char*)&_XmStrings[12187]) #endif #ifndef XmRVisibleItemCount #define XmRVisibleItemCount ((char*)&_XmStrings[12202]) #endif #ifndef XmRVisualPolicy #define XmRVisualPolicy ((char*)&_XmStrings[12219]) #endif #ifndef XmRWhichButton #define XmRWhichButton ((char*)&_XmStrings[12232]) #endif #ifndef XmRXmBackgroundPixmap #define XmRXmBackgroundPixmap ((char*)&_XmStrings[12244]) #endif #ifndef XmRXmString #define XmRXmString ((char*)&_XmStrings[12263]) #endif #ifndef XmRXmStringCharSet #define XmRXmStringCharSet ((char*)&_XmStrings[12272]) #endif #ifndef XmRXmStringTable #define XmRXmStringTable ((char*)&_XmStrings[12288]) #endif #ifndef XmVosfActivate #define XmVosfActivate ((char*)&_XmStrings[12302]) #endif #ifndef XmVosfAddMode #define XmVosfAddMode ((char*)&_XmStrings[12314]) #endif #ifndef XmVosfBackSpace #define XmVosfBackSpace ((char*)&_XmStrings[12325]) #endif #ifndef XmVosfBeginLine #define XmVosfBeginLine ((char*)&_XmStrings[12338]) #endif #ifndef XmVosfCancel #define XmVosfCancel ((char*)&_XmStrings[12351]) #endif #ifndef XmVosfClear #define XmVosfClear ((char*)&_XmStrings[12361]) #endif #ifndef XmVosfCopy #define XmVosfCopy ((char*)&_XmStrings[12370]) #endif #ifndef XmVosfCut #define XmVosfCut ((char*)&_XmStrings[12378]) #endif #ifndef XmVosfDelete #define XmVosfDelete ((char*)&_XmStrings[12385]) #endif #ifndef XmVosfDown #define XmVosfDown ((char*)&_XmStrings[12395]) #endif #ifndef XmVosfEndLine #define XmVosfEndLine ((char*)&_XmStrings[12403]) #endif #ifndef XmVosfHelp #define XmVosfHelp ((char*)&_XmStrings[12414]) #endif #ifndef XmVosfInsert #define XmVosfInsert ((char*)&_XmStrings[12422]) #endif #ifndef XmVosfLeft #define XmVosfLeft ((char*)&_XmStrings[12432]) #endif #ifndef XmVosfMenu #define XmVosfMenu ((char*)&_XmStrings[12440]) #endif #ifndef XmVosfMenuBar #define XmVosfMenuBar ((char*)&_XmStrings[12448]) #endif #ifndef XmVosfPageDown #define XmVosfPageDown ((char*)&_XmStrings[12459]) #endif #ifndef XmVosfPageLeft #define XmVosfPageLeft ((char*)&_XmStrings[12471]) #endif #ifndef XmVosfPageRight #define XmVosfPageRight ((char*)&_XmStrings[12483]) #endif #ifndef XmVosfPageUp #define XmVosfPageUp ((char*)&_XmStrings[12496]) #endif #ifndef XmVosfPaste #define XmVosfPaste ((char*)&_XmStrings[12506]) #endif #ifndef XmVosfPrimaryPaste #define XmVosfPrimaryPaste ((char*)&_XmStrings[12515]) #endif #ifndef XmVosfQuickPaste #define XmVosfQuickPaste ((char*)&_XmStrings[12531]) #endif #ifndef XmVosfRight #define XmVosfRight ((char*)&_XmStrings[12545]) #endif #ifndef XmVosfSelect #define XmVosfSelect ((char*)&_XmStrings[12554]) #endif #ifndef XmVosfUndo #define XmVosfUndo ((char*)&_XmStrings[12564]) #endif #ifndef XmVosfUp #define XmVosfUp ((char*)&_XmStrings[12572]) #endif #ifndef XmSFONTLIST_DEFAULT_TAG_STRING #define XmSFONTLIST_DEFAULT_TAG_STRING ((char*)&_XmStrings[12578]) #endif #ifndef XmSXmFONTLIST_DEFAULT_TAG_STRING #define XmSXmFONTLIST_DEFAULT_TAG_STRING ((char*)&_XmStrings[12606]) #endif #ifndef XmRTopItemPosition #define XmRTopItemPosition ((char*)&_XmStrings[12636]) #endif #ifndef XmNtearOffTitle #define XmNtearOffTitle ((char*)&_XmStrings[12652]) #endif #ifndef XmCTearOffTitle #define XmCTearOffTitle ((char*)&_XmStrings[12665]) #endif #ifndef XmNpopupHandlerCallback #define XmNpopupHandlerCallback ((char*)&_XmStrings[12678]) #endif #ifndef XmNconvertCallback #define XmNconvertCallback ((char*)&_XmStrings[12699]) #endif #ifndef XmNdestinationCallback #define XmNdestinationCallback ((char*)&_XmStrings[12715]) #endif #ifndef XmNselectedItem #define XmNselectedItem ((char*)&_XmStrings[12735]) #endif #ifndef XmCSelectedItem #define XmCSelectedItem ((char*)&_XmStrings[12748]) #endif #ifndef XmNselectionCallback #define XmNselectionCallback ((char*)&_XmStrings[12761]) #endif #ifndef XmNmatchBehavior #define XmNmatchBehavior ((char*)&_XmStrings[12779]) #endif #ifndef XmCMatchBehavior #define XmCMatchBehavior ((char*)&_XmStrings[12793]) #endif #ifndef XmNnoFontCallback #define XmNnoFontCallback ((char*)&_XmStrings[12807]) #endif #ifndef XmNtextPath #define XmNtextPath ((char*)&_XmStrings[12822]) #endif #ifndef XmNeditingPath #define XmNeditingPath ((char*)&_XmStrings[12831]) #endif #ifndef XmCEditingPath #define XmCEditingPath ((char*)&_XmStrings[12843]) #endif #ifndef XmNbidirectionalCursor #define XmNbidirectionalCursor ((char*)&_XmStrings[12855]) #endif #ifndef XmCBidirectionalCursor #define XmCBidirectionalCursor ((char*)&_XmStrings[12875]) #endif #ifndef XmNcollapsedStatePixmap #define XmNcollapsedStatePixmap ((char*)&_XmStrings[12895]) #endif #ifndef XmNdetailColumnHeading #define XmNdetailColumnHeading ((char*)&_XmStrings[12916]) #endif #ifndef XmNdetailCount #define XmNdetailCount ((char*)&_XmStrings[12936]) #endif #ifndef XmNdetailTabList #define XmNdetailTabList ((char*)&_XmStrings[12948]) #endif #ifndef XmNexpandedStatePixmap #define XmNexpandedStatePixmap ((char*)&_XmStrings[12962]) #endif #ifndef XmNlargeCellHeight #define XmNlargeCellHeight ((char*)&_XmStrings[12982]) #endif #ifndef XmNlargeCellWidth #define XmNlargeCellWidth ((char*)&_XmStrings[12998]) #endif #ifndef XmNlayoutType #define XmNlayoutType ((char*)&_XmStrings[13013]) #endif #ifndef XmNoutlineIndentation #define XmNoutlineIndentation ((char*)&_XmStrings[13024]) #endif #ifndef XmNoutlineLineStyle #define XmNoutlineLineStyle ((char*)&_XmStrings[13043]) #endif #ifndef XmNprimaryOwnership #define XmNprimaryOwnership ((char*)&_XmStrings[13060]) #endif #ifndef XmNselectionTechnique #define XmNselectionTechnique ((char*)&_XmStrings[13077]) #endif #ifndef XmNsmallCellHeight #define XmNsmallCellHeight ((char*)&_XmStrings[13096]) #endif #ifndef XmNsmallCellWidth #define XmNsmallCellWidth ((char*)&_XmStrings[13112]) #endif #ifndef XmNspatialStyle #define XmNspatialStyle ((char*)&_XmStrings[13127]) #endif #ifndef XmNentryParent #define XmNentryParent ((char*)&_XmStrings[13140]) #endif #ifndef XmNlargeIconX #define XmNlargeIconX ((char*)&_XmStrings[13152]) #endif #ifndef XmNlargeIconY #define XmNlargeIconY ((char*)&_XmStrings[13163]) #endif #ifndef XmNsmallIconX #define XmNsmallIconX ((char*)&_XmStrings[13174]) #endif #ifndef XmNsmallIconY #define XmNsmallIconY ((char*)&_XmStrings[13185]) #endif #ifndef XmCCollapsedStatePixmap #define XmCCollapsedStatePixmap ((char*)&_XmStrings[13196]) #endif #ifndef XmCDetailColumnHeading #define XmCDetailColumnHeading ((char*)&_XmStrings[13217]) #endif #ifndef XmCDetailCount #define XmCDetailCount ((char*)&_XmStrings[13237]) #endif #ifndef XmCDetailMask #define XmCDetailMask ((char*)&_XmStrings[13249]) #endif #ifndef XmCEntryViewType #define XmCEntryViewType ((char*)&_XmStrings[13260]) #endif #ifndef XmCLineStyle #define XmCLineStyle ((char*)&_XmStrings[13274]) #endif #ifndef XmCDetailTabList #define XmCDetailTabList ((char*)&_XmStrings[13284]) #endif #ifndef XmCExpandedStatePixmap #define XmCExpandedStatePixmap ((char*)&_XmStrings[13298]) #endif #ifndef XmCIncludeModel #define XmCIncludeModel ((char*)&_XmStrings[13318]) #endif #ifndef XmCCellHeight #define XmCCellHeight ((char*)&_XmStrings[13331]) #endif #ifndef XmCCellWidth #define XmCCellWidth ((char*)&_XmStrings[13342]) #endif #ifndef XmCLayoutType #define XmCLayoutType ((char*)&_XmStrings[13352]) #endif #ifndef XmCOutlineIndentation #define XmCOutlineIndentation ((char*)&_XmStrings[13363]) #endif #ifndef XmCPlaceModel #define XmCPlaceModel ((char*)&_XmStrings[13382]) #endif #ifndef XmCPrimaryOwnership #define XmCPrimaryOwnership ((char*)&_XmStrings[13393]) #endif #ifndef XmCSelectionTechnique #define XmCSelectionTechnique ((char*)&_XmStrings[13410]) #endif #ifndef XmCSpatialStyle #define XmCSpatialStyle ((char*)&_XmStrings[13429]) #endif #ifndef XmCEntryDetail #define XmCEntryDetail ((char*)&_XmStrings[13442]) #endif #ifndef XmCExpandState #define XmCExpandState ((char*)&_XmStrings[13454]) #endif #ifndef XmNlargeIcon #define XmNlargeIcon ((char*)&_XmStrings[13466]) #endif #ifndef XmNlargeIconMask #define XmNlargeIconMask ((char*)&_XmStrings[13476]) #endif #ifndef XmNlargeIconPixmap #define XmNlargeIconPixmap ((char*)&_XmStrings[13490]) #endif #ifndef XmNsmallIcon #define XmNsmallIcon ((char*)&_XmStrings[13506]) #endif #ifndef XmNsmallIconMask #define XmNsmallIconMask ((char*)&_XmStrings[13516]) #endif #ifndef XmNsmallIconPixmap #define XmNsmallIconPixmap ((char*)&_XmStrings[13530]) #endif #ifndef XmCIcon #define XmCIcon ((char*)&_XmStrings[13546]) #endif #ifndef XmCViewType #define XmCViewType ((char*)&_XmStrings[13551]) #endif #ifndef XmCVisualEmphasis #define XmCVisualEmphasis ((char*)&_XmStrings[13560]) #endif #ifndef XmNcurrentPageNumber #define XmNcurrentPageNumber ((char*)&_XmStrings[13575]) #endif #ifndef XmNfirstPageNumber #define XmNfirstPageNumber ((char*)&_XmStrings[13593]) #endif #ifndef XmNlastPageNumber #define XmNlastPageNumber ((char*)&_XmStrings[13609]) #endif #ifndef XmNbackPagePlacement #define XmNbackPagePlacement ((char*)&_XmStrings[13624]) #endif #ifndef XmNbackPageNumber #define XmNbackPageNumber ((char*)&_XmStrings[13642]) #endif #ifndef XmNbackPageSize #define XmNbackPageSize ((char*)&_XmStrings[13657]) #endif #ifndef XmNbackPageForeground #define XmNbackPageForeground ((char*)&_XmStrings[13670]) #endif #ifndef XmNbackPageBackground #define XmNbackPageBackground ((char*)&_XmStrings[13689]) #endif #ifndef XmNframeBackground #define XmNframeBackground ((char*)&_XmStrings[13708]) #endif #ifndef XmNbindingType #define XmNbindingType ((char*)&_XmStrings[13724]) #endif #ifndef XmNbindingPixmap #define XmNbindingPixmap ((char*)&_XmStrings[13736]) #endif #ifndef XmNbindingWidth #define XmNbindingWidth ((char*)&_XmStrings[13750]) #endif #ifndef XmNmajorTabSpacing #define XmNmajorTabSpacing ((char*)&_XmStrings[13763]) #endif #ifndef XmNminorTabSpacing #define XmNminorTabSpacing ((char*)&_XmStrings[13779]) #endif #ifndef XmNinnerMarginWidth #define XmNinnerMarginWidth ((char*)&_XmStrings[13795]) #endif #ifndef XmNinnerMarginHeight #define XmNinnerMarginHeight ((char*)&_XmStrings[13812]) #endif #ifndef XmNframeShadowThickness #define XmNframeShadowThickness ((char*)&_XmStrings[13830]) #endif #ifndef XmNpageNumber #define XmNpageNumber ((char*)&_XmStrings[13851]) #endif #ifndef XmCCurrentPageNumber #define XmCCurrentPageNumber ((char*)&_XmStrings[13862]) #endif #ifndef XmCFirstPageNumber #define XmCFirstPageNumber ((char*)&_XmStrings[13880]) #endif #ifndef XmCLastPageNumber #define XmCLastPageNumber ((char*)&_XmStrings[13896]) #endif #ifndef XmCBackPagePlacement #define XmCBackPagePlacement ((char*)&_XmStrings[13911]) #endif #ifndef XmCBackPageNumber #define XmCBackPageNumber ((char*)&_XmStrings[13929]) #endif #ifndef XmCBackPageSize #define XmCBackPageSize ((char*)&_XmStrings[13944]) #endif #ifndef XmCBackPageForeground #define XmCBackPageForeground ((char*)&_XmStrings[13957]) #endif #ifndef XmCBackPageBackground #define XmCBackPageBackground ((char*)&_XmStrings[13976]) #endif #ifndef XmCFrameBackground #define XmCFrameBackground ((char*)&_XmStrings[13995]) #endif #ifndef XmCBindingType #define XmCBindingType ((char*)&_XmStrings[14011]) #endif #ifndef XmCBindingPixmap #define XmCBindingPixmap ((char*)&_XmStrings[14023]) #endif #ifndef XmCBindingWidth #define XmCBindingWidth ((char*)&_XmStrings[14037]) #endif #ifndef XmCMajorTabSpacing #define XmCMajorTabSpacing ((char*)&_XmStrings[14050]) #endif #ifndef XmCMinorTabSpacing #define XmCMinorTabSpacing ((char*)&_XmStrings[14066]) #endif #ifndef XmCInnerMarginWidth #define XmCInnerMarginWidth ((char*)&_XmStrings[14082]) #endif #ifndef XmCInnerMarginHeight #define XmCInnerMarginHeight ((char*)&_XmStrings[14099]) #endif #ifndef XmCPageChangeCallback #define XmCPageChangeCallback ((char*)&_XmStrings[14117]) #endif #ifndef XmCPageNumber #define XmCPageNumber ((char*)&_XmStrings[14136]) #endif #ifndef XmRArrowLayout #define XmRArrowLayout ((char*)&_XmStrings[14147]) #endif #ifndef XmRArrowSensitivity #define XmRArrowSensitivity ((char*)&_XmStrings[14159]) #endif #ifndef XmRSpinBoxChildType #define XmRSpinBoxChildType ((char*)&_XmStrings[14176]) #endif #ifndef XmNarrowLayout #define XmNarrowLayout ((char*)&_XmStrings[14193]) #endif #ifndef XmCArrowLayout #define XmCArrowLayout ((char*)&_XmStrings[14205]) #endif #ifndef XmNarrowSensitivity #define XmNarrowSensitivity ((char*)&_XmStrings[14217]) #endif #ifndef XmCArrowSensitivity #define XmCArrowSensitivity ((char*)&_XmStrings[14234]) #endif #ifndef XmNdefaultArrowSensitivity #define XmNdefaultArrowSensitivity ((char*)&_XmStrings[14251]) #endif #ifndef XmCDefaultArrowSensitivity #define XmCDefaultArrowSensitivity ((char*)&_XmStrings[14275]) #endif #ifndef XmNarrowSize #define XmNarrowSize ((char*)&_XmStrings[14299]) #endif #ifndef XmCArrowSize #define XmCArrowSize ((char*)&_XmStrings[14309]) #endif #ifndef XmNspinBoxChildType #define XmNspinBoxChildType ((char*)&_XmStrings[14319]) #endif #ifndef XmCSpinBoxChildType #define XmCSpinBoxChildType ((char*)&_XmStrings[14336]) #endif #ifndef XmNposition #define XmNposition ((char*)&_XmStrings[14353]) #endif #ifndef XmNnumValues #define XmNnumValues ((char*)&_XmStrings[14362]) #endif #ifndef XmCNumValues #define XmCNumValues ((char*)&_XmStrings[14372]) #endif #ifndef XmNvalues #define XmNvalues ((char*)&_XmStrings[14382]) #endif #ifndef XmCValues #define XmCValues ((char*)&_XmStrings[14389]) #endif #ifndef XmNminimumValue #define XmNminimumValue ((char*)&_XmStrings[14396]) #endif #ifndef XmCMinimumValue #define XmCMinimumValue ((char*)&_XmStrings[14409]) #endif #ifndef XmNmaximumValue #define XmNmaximumValue ((char*)&_XmStrings[14422]) #endif #ifndef XmCMaximumValue #define XmCMaximumValue ((char*)&_XmStrings[14435]) #endif #ifndef XmNincrementValue #define XmNincrementValue ((char*)&_XmStrings[14448]) #endif #ifndef XmCIncrementValue #define XmCIncrementValue ((char*)&_XmStrings[14463]) #endif #ifndef XmRAutomaticSelection #define XmRAutomaticSelection ((char*)&_XmStrings[14478]) #endif #ifndef XmRLineStyle #define XmRLineStyle ((char*)&_XmStrings[14497]) #endif #ifndef XmREntryViewType #define XmREntryViewType ((char*)&_XmStrings[14507]) #endif #ifndef XmRDirection #define XmRDirection ((char*)&_XmStrings[14521]) #endif #ifndef XmRLayoutType #define XmRLayoutType ((char*)&_XmStrings[14531]) #endif #ifndef XmRPrimaryOwnership #define XmRPrimaryOwnership ((char*)&_XmStrings[14542]) #endif #ifndef XmRSelectionTechnique #define XmRSelectionTechnique ((char*)&_XmStrings[14559]) #endif #ifndef XmRSpatialStyle #define XmRSpatialStyle ((char*)&_XmStrings[14578]) #endif #ifndef XmRTabList #define XmRTabList ((char*)&_XmStrings[14591]) #endif #ifndef XmRViewType #define XmRViewType ((char*)&_XmStrings[14599]) #endif #ifndef XmRVisualEmphasis #define XmRVisualEmphasis ((char*)&_XmStrings[14608]) #endif #ifndef XmRBindingType #define XmRBindingType ((char*)&_XmStrings[14623]) #endif #ifndef XmRNBChildType #define XmRNBChildType ((char*)&_XmStrings[14635]) #endif #ifndef XmNentryViewType #define XmNentryViewType ((char*)&_XmStrings[14647]) #endif #ifndef XmNinsensitiveStippleBitmap #define XmNinsensitiveStippleBitmap ((char*)&_XmStrings[14661]) #endif #ifndef XmNlayoutDirection #define XmNlayoutDirection ((char*)&_XmStrings[14686]) #endif #ifndef XmNviewType #define XmNviewType ((char*)&_XmStrings[14702]) #endif #ifndef XmNvisualEmphasis #define XmNvisualEmphasis ((char*)&_XmStrings[14711]) #endif #ifndef XmCLayoutDirection #define XmCLayoutDirection ((char*)&_XmStrings[14726]) #endif #ifndef XmNsnapBackMultiple #define XmNsnapBackMultiple ((char*)&_XmStrings[14742]) #endif #ifndef XmNslidingMode #define XmNslidingMode ((char*)&_XmStrings[14759]) #endif #ifndef XmNsliderVisual #define XmNsliderVisual ((char*)&_XmStrings[14771]) #endif #ifndef XmNautoDragModel #define XmNautoDragModel ((char*)&_XmStrings[14784]) #endif #ifndef XmNcolorCalculationProc #define XmNcolorCalculationProc ((char*)&_XmStrings[14798]) #endif #ifndef XmNbitmapConversionModel #define XmNbitmapConversionModel ((char*)&_XmStrings[14819]) #endif #ifndef XmNcolorAllocationProc #define XmNcolorAllocationProc ((char*)&_XmStrings[14841]) #endif #ifndef XmNselectionMode #define XmNselectionMode ((char*)&_XmStrings[14861]) #endif #ifndef XmNselectedPositions #define XmNselectedPositions ((char*)&_XmStrings[14875]) #endif #ifndef XmNselectedPositionCount #define XmNselectedPositionCount ((char*)&_XmStrings[14893]) #endif #ifndef XmCSnapBackMultiple #define XmCSnapBackMultiple ((char*)&_XmStrings[14915]) #endif #ifndef XmCSliderVisual #define XmCSliderVisual ((char*)&_XmStrings[14932]) #endif #ifndef XmCSlidingMode #define XmCSlidingMode ((char*)&_XmStrings[14945]) #endif #ifndef XmCAutoDragModel #define XmCAutoDragModel ((char*)&_XmStrings[14957]) #endif #ifndef XmCColorCalculationProc #define XmCColorCalculationProc ((char*)&_XmStrings[14971]) #endif #ifndef XmCBitmapConversionModel #define XmCBitmapConversionModel ((char*)&_XmStrings[14992]) #endif #ifndef XmCColorAllocationProc #define XmCColorAllocationProc ((char*)&_XmStrings[15014]) #endif #ifndef XmCInsensitiveStippleBitmap #define XmCInsensitiveStippleBitmap ((char*)&_XmStrings[15034]) #endif #ifndef XmCSelectionMode #define XmCSelectionMode ((char*)&_XmStrings[15059]) #endif #ifndef XmCSelectedPositions #define XmCSelectedPositions ((char*)&_XmStrings[15073]) #endif #ifndef XmCSelectedPositionCount #define XmCSelectedPositionCount ((char*)&_XmStrings[15091]) #endif #ifndef XmRSlidingMode #define XmRSlidingMode ((char*)&_XmStrings[15113]) #endif #ifndef XmRShowArrows #define XmRShowArrows ((char*)&_XmStrings[15125]) #endif #ifndef XmRSliderVisual #define XmRSliderVisual ((char*)&_XmStrings[15136]) #endif #ifndef XmRShowValue #define XmRShowValue ((char*)&_XmStrings[15149]) #endif #ifndef XmRAutoDragModel #define XmRAutoDragModel ((char*)&_XmStrings[15159]) #endif #ifndef XmRSWChildType #define XmRSWChildType ((char*)&_XmStrings[15173]) #endif #ifndef XmRBitmapConversionModel #define XmRBitmapConversionModel ((char*)&_XmStrings[15185]) #endif #ifndef XmRSelectionMode #define XmRSelectionMode ((char*)&_XmStrings[15207]) #endif #ifndef XmNinputPolicy #define XmNinputPolicy ((char*)&_XmStrings[15221]) #endif #ifndef XmCInputPolicy #define XmCInputPolicy ((char*)&_XmStrings[15233]) #endif #ifndef XmRInputPolicy #define XmRInputPolicy ((char*)&_XmStrings[15245]) #endif #ifndef XmNtoggleMode #define XmNtoggleMode ((char*)&_XmStrings[15257]) #endif #ifndef XmCToggleMode #define XmCToggleMode ((char*)&_XmStrings[15268]) #endif #ifndef XmRToggleMode #define XmRToggleMode ((char*)&_XmStrings[15279]) #endif #ifndef XmRIndicatorOn #define XmRIndicatorOn ((char*)&_XmStrings[15290]) #endif #ifndef XmRSet #define XmRSet ((char*)&_XmStrings[15302]) #endif #ifndef XmNindeterminatePixmap #define XmNindeterminatePixmap ((char*)&_XmStrings[15306]) #endif #ifndef XmCIndeterminatePixmap #define XmCIndeterminatePixmap ((char*)&_XmStrings[15326]) #endif #ifndef XmNunselectColor #define XmNunselectColor ((char*)&_XmStrings[15346]) #endif #ifndef XmCUnselectColor #define XmCUnselectColor ((char*)&_XmStrings[15360]) #endif #ifndef XmNselectedPosition #define XmNselectedPosition ((char*)&_XmStrings[15374]) #endif #ifndef XmNarrowSpacing #define XmNarrowSpacing ((char*)&_XmStrings[15391]) #endif #ifndef XmCArrowSpacing #define XmCArrowSpacing ((char*)&_XmStrings[15404]) #endif #ifndef XmRMatchBehavior #define XmRMatchBehavior ((char*)&_XmStrings[15417]) #endif #ifndef XmRComboBoxType #define XmRComboBoxType ((char*)&_XmStrings[15431]) #endif #ifndef XmCSelectedPosition #define XmCSelectedPosition ((char*)&_XmStrings[15444]) #endif #ifndef XmNenableWarp #define XmNenableWarp ((char*)&_XmStrings[15461]) #endif #ifndef XmCEnableWarp #define XmCEnableWarp ((char*)&_XmStrings[15472]) #endif #ifndef XmREnableWarp #define XmREnableWarp ((char*)&_XmStrings[15483]) #endif #ifndef XmNmotifVersion #define XmNmotifVersion ((char*)&_XmStrings[15494]) #endif #ifndef XmCMotifVersion #define XmCMotifVersion ((char*)&_XmStrings[15507]) #endif #ifndef XmNdefaultGlyphPixmap #define XmNdefaultGlyphPixmap ((char*)&_XmStrings[15520]) #endif #ifndef XmCDefaultGlyphPixmap #define XmCDefaultGlyphPixmap ((char*)&_XmStrings[15539]) #endif #ifndef XmCRendition #define XmCRendition ((char*)&_XmStrings[15558]) #endif #ifndef XmNtag #define XmNtag ((char*)&_XmStrings[15568]) #endif #ifndef XmCTag #define XmCTag ((char*)&_XmStrings[15572]) #endif #ifndef XmNfontName #define XmNfontName ((char*)&_XmStrings[15576]) #endif #ifndef XmCFontName #define XmCFontName ((char*)&_XmStrings[15585]) #endif #ifndef XmNfontType #define XmNfontType ((char*)&_XmStrings[15594]) #endif #ifndef XmCFontType #define XmCFontType ((char*)&_XmStrings[15603]) #endif #ifndef XmRFontType #define XmRFontType ((char*)&_XmStrings[15612]) #endif #ifndef XmNloadModel #define XmNloadModel ((char*)&_XmStrings[15621]) #endif #ifndef XmCLoadModel #define XmCLoadModel ((char*)&_XmStrings[15631]) #endif #ifndef XmRLoadModel #define XmRLoadModel ((char*)&_XmStrings[15641]) #endif #ifndef XmNtabList #define XmNtabList ((char*)&_XmStrings[15651]) #endif #ifndef XmCTabList #define XmCTabList ((char*)&_XmStrings[15659]) #endif #ifndef XmRRenditionPixel #define XmRRenditionPixel ((char*)&_XmStrings[15667]) #endif #ifndef XmNunderlineType #define XmNunderlineType ((char*)&_XmStrings[15682]) #endif #ifndef XmCUnderlineType #define XmCUnderlineType ((char*)&_XmStrings[15696]) #endif #ifndef XmNstrikethruType #define XmNstrikethruType ((char*)&_XmStrings[15710]) #endif #ifndef XmCStrikethruType #define XmCStrikethruType ((char*)&_XmStrings[15725]) #endif #ifndef XmRLineType #define XmRLineType ((char*)&_XmStrings[15740]) #endif #ifndef XmNrenderTable #define XmNrenderTable ((char*)&_XmStrings[15749]) #endif #ifndef XmCRenderTable #define XmCRenderTable ((char*)&_XmStrings[15761]) #endif #ifndef XmRRenderTable #define XmRRenderTable ((char*)&_XmStrings[15773]) #endif #ifndef XmNbuttonRenderTable #define XmNbuttonRenderTable ((char*)&_XmStrings[15785]) #endif #ifndef XmCButtonRenderTable #define XmCButtonRenderTable ((char*)&_XmStrings[15803]) #endif #ifndef XmRButtonRenderTable #define XmRButtonRenderTable ((char*)&_XmStrings[15821]) #endif #ifndef XmNlabelRenderTable #define XmNlabelRenderTable ((char*)&_XmStrings[15839]) #endif #ifndef XmCLabelRenderTable #define XmCLabelRenderTable ((char*)&_XmStrings[15856]) #endif #ifndef XmRLabelRenderTable #define XmRLabelRenderTable ((char*)&_XmStrings[15873]) #endif #ifndef XmNtextRenderTable #define XmNtextRenderTable ((char*)&_XmStrings[15890]) #endif #ifndef XmCTextRenderTable #define XmCTextRenderTable ((char*)&_XmStrings[15906]) #endif #ifndef XmRTextRenderTable #define XmRTextRenderTable ((char*)&_XmStrings[15922]) #endif #ifndef XmNdragStartCallback #define XmNdragStartCallback ((char*)&_XmStrings[15938]) #endif #ifndef XmNnoRenditionCallback #define XmNnoRenditionCallback ((char*)&_XmStrings[15956]) #endif #ifndef XmSXmAS_IS #define XmSXmAS_IS ((char*)&_XmStrings[15976]) #endif #ifndef XmMIsWhiteSpaceMethod #define XmMIsWhiteSpaceMethod ((char*)&_XmStrings[15984]) #endif #ifndef XmMIsScanBreakMethod #define XmMIsScanBreakMethod ((char*)&_XmStrings[16003]) #endif #ifndef XmMCharDirection #define XmMCharDirection ((char*)&_XmStrings[16021]) #endif #ifndef XmMInitialCharsDirection #define XmMInitialCharsDirection ((char*)&_XmStrings[16035]) #endif #ifndef XmNpatternType #define XmNpatternType ((char*)&_XmStrings[16057]) #endif #ifndef XmNsubstitute #define XmNsubstitute ((char*)&_XmStrings[16069]) #endif #ifndef XmNinvokeParseProc #define XmNinvokeParseProc ((char*)&_XmStrings[16080]) #endif #ifndef XmNincludeStatus #define XmNincludeStatus ((char*)&_XmStrings[16096]) #endif #ifndef XmVosfBackTab #define XmVosfBackTab ((char*)&_XmStrings[16110]) #endif #ifndef XmVosfBeginData #define XmVosfBeginData ((char*)&_XmStrings[16121]) #endif #ifndef XmVosfDeselectAll #define XmVosfDeselectAll ((char*)&_XmStrings[16134]) #endif #ifndef XmVosfEndData #define XmVosfEndData ((char*)&_XmStrings[16149]) #endif #ifndef XmVosfEscape #define XmVosfEscape ((char*)&_XmStrings[16160]) #endif #ifndef XmVosfExtend #define XmVosfExtend ((char*)&_XmStrings[16170]) #endif #ifndef XmVosfLeftLine #define XmVosfLeftLine ((char*)&_XmStrings[16180]) #endif #ifndef XmVosfNext #define XmVosfNext ((char*)&_XmStrings[16192]) #endif #ifndef XmVosfNextField #define XmVosfNextField ((char*)&_XmStrings[16200]) #endif #ifndef XmVosfNextMenu #define XmVosfNextMenu ((char*)&_XmStrings[16213]) #endif #ifndef XmVosfNextMinor #define XmVosfNextMinor ((char*)&_XmStrings[16225]) #endif #ifndef XmVosfPrevField #define XmVosfPrevField ((char*)&_XmStrings[16238]) #endif #ifndef XmVosfPrevMenu #define XmVosfPrevMenu ((char*)&_XmStrings[16251]) #endif #ifndef XmVosfPrior #define XmVosfPrior ((char*)&_XmStrings[16263]) #endif #ifndef XmVosfPriorMinor #define XmVosfPriorMinor ((char*)&_XmStrings[16272]) #endif #ifndef XmVosfReselect #define XmVosfReselect ((char*)&_XmStrings[16286]) #endif #ifndef XmVosfRestore #define XmVosfRestore ((char*)&_XmStrings[16298]) #endif #ifndef XmVosfRightLine #define XmVosfRightLine ((char*)&_XmStrings[16309]) #endif #ifndef XmVosfSelectAll #define XmVosfSelectAll ((char*)&_XmStrings[16322]) #endif #ifndef XmVosfSwitchDirection #define XmVosfSwitchDirection ((char*)&_XmStrings[16335]) #endif #ifndef XmNnotebookChildType #define XmNnotebookChildType ((char*)&_XmStrings[16354]) #endif #ifndef XmCNotebookChildType #define XmCNotebookChildType ((char*)&_XmStrings[16372]) #endif #ifndef XmRNotebookChildType #define XmRNotebookChildType ((char*)&_XmStrings[16390]) #endif #ifndef XmNscrolledWindowChildType #define XmNscrolledWindowChildType ((char*)&_XmStrings[16408]) #endif #ifndef XmCScrolledWindowChildType #define XmCScrolledWindowChildType ((char*)&_XmStrings[16432]) #endif #ifndef XmRScrolledWindowChildType #define XmRScrolledWindowChildType ((char*)&_XmStrings[16456]) #endif #ifndef XmNselectedObjects #define XmNselectedObjects ((char*)&_XmStrings[16480]) #endif #ifndef XmCSelectedObjects #define XmCSelectedObjects ((char*)&_XmStrings[16496]) #endif #ifndef XmNselectedObjectCount #define XmNselectedObjectCount ((char*)&_XmStrings[16512]) #endif #ifndef XmCSelectedObjectCount #define XmCSelectedObjectCount ((char*)&_XmStrings[16532]) #endif #ifndef XmNcomboBoxType #define XmNcomboBoxType ((char*)&_XmStrings[16552]) #endif #ifndef XmCComboBoxType #define XmCComboBoxType ((char*)&_XmStrings[16565]) #endif #ifndef XmNtabValue #define XmNtabValue ((char*)&_XmStrings[16578]) #endif #ifndef XmNoffsetModel #define XmNoffsetModel ((char*)&_XmStrings[16587]) #endif #ifndef XmNdecimal #define XmNdecimal ((char*)&_XmStrings[16599]) #endif #ifndef XmNdetail #define XmNdetail ((char*)&_XmStrings[16607]) #endif #ifndef XmCDetail #define XmCDetail ((char*)&_XmStrings[16614]) #endif #ifndef XmNdetailCount #define XmNdetailCount ((char*)&_XmStrings[16621]) #endif #ifndef XmCDetailCount #define XmCDetailCount ((char*)&_XmStrings[16633]) #endif #ifndef XmNcontainerID #define XmNcontainerID ((char*)&_XmStrings[16645]) #endif #ifndef XmCContainerID #define XmCContainerID ((char*)&_XmStrings[16657]) #endif #ifndef XmSCLIENT_WINDOW #define XmSCLIENT_WINDOW ((char*)&_XmStrings[16669]) #endif #ifndef XmSCLIP_TEMPORARY #define XmSCLIP_TEMPORARY ((char*)&_XmStrings[16683]) #endif #ifndef XmSCLIPBOARD #define XmSCLIPBOARD ((char*)&_XmStrings[16698]) #endif #ifndef XmSCOMPOUND_TEXT #define XmSCOMPOUND_TEXT ((char*)&_XmStrings[16708]) #endif #ifndef XmSDELETE #define XmSDELETE ((char*)&_XmStrings[16722]) #endif #ifndef XmSFILE #define XmSFILE ((char*)&_XmStrings[16729]) #endif #ifndef XmSFILE_NAME #define XmSFILE_NAME ((char*)&_XmStrings[16734]) #endif #ifndef XmSINCR #define XmSINCR ((char*)&_XmStrings[16744]) #endif #ifndef XmSINSERT_PROPERTY #define XmSINSERT_PROPERTY ((char*)&_XmStrings[16749]) #endif #ifndef XmSINSERT_SELECTION #define XmSINSERT_SELECTION ((char*)&_XmStrings[16765]) #endif #ifndef XmSLENGTH #define XmSLENGTH ((char*)&_XmStrings[16782]) #endif #ifndef XmSLINK_SELECTION #define XmSLINK_SELECTION ((char*)&_XmStrings[16789]) #endif #ifndef XmS_MOTIF_ATOM_0 #define XmS_MOTIF_ATOM_0 ((char*)&_XmStrings[16804]) #endif #ifndef XmS_MOTIF_BINDINGS #define XmS_MOTIF_BINDINGS ((char*)&_XmStrings[16818]) #endif #ifndef XmS_MOTIF_DEFAULT_BINDINGS #define XmS_MOTIF_DEFAULT_BINDINGS ((char*)&_XmStrings[16834]) #endif #ifndef XmS_MOTIF_CANCEL_DROP_EFFECT #define XmS_MOTIF_CANCEL_DROP_EFFECT ((char*)&_XmStrings[16858]) #endif #ifndef XmS_MOTIF_CLIP_HEADER #define XmS_MOTIF_CLIP_HEADER ((char*)&_XmStrings[16884]) #endif #ifndef XmS_MOTIF_CLIP_DATA_REQUEST #define XmS_MOTIF_CLIP_DATA_REQUEST ((char*)&_XmStrings[16903]) #endif #ifndef XmS_MOTIF_CLIP_DATA_DELETE #define XmS_MOTIF_CLIP_DATA_DELETE ((char*)&_XmStrings[16928]) #endif #ifndef XmS_MOTIF_CLIP_ITEM #define XmS_MOTIF_CLIP_ITEM ((char*)&_XmStrings[16952]) #endif #ifndef XmS_MOTIF_CLIP_LOCK #define XmS_MOTIF_CLIP_LOCK ((char*)&_XmStrings[16969]) #endif #ifndef XmS_MOTIF_CLIP_LOCK_ACCESS_VALID #define XmS_MOTIF_CLIP_LOCK_ACCESS_VALID ((char*)&_XmStrings[16986]) #endif #ifndef XmS_MOTIF_CLIP_MESSAGE #define XmS_MOTIF_CLIP_MESSAGE ((char*)&_XmStrings[17016]) #endif #ifndef XmS_MOTIF_CLIP_NEXT_ID #define XmS_MOTIF_CLIP_NEXT_ID ((char*)&_XmStrings[17036]) #endif #ifndef XmS_MOTIF_CLIP_TIME #define XmS_MOTIF_CLIP_TIME ((char*)&_XmStrings[17056]) #endif #ifndef XmS_MOTIF_CLIPBOARD_TARGETS #define XmS_MOTIF_CLIPBOARD_TARGETS ((char*)&_XmStrings[17073]) #endif #ifndef XmS_MOTIF_COMPOUND_STRING #define XmS_MOTIF_COMPOUND_STRING ((char*)&_XmStrings[17098]) #endif #ifndef XmS_MOTIF_DEFERRED_CLIPBOARD_TARGETS #define XmS_MOTIF_DEFERRED_CLIPBOARD_TARGETS ((char*)&_XmStrings[17121]) #endif #ifndef XmS_MOTIF_DESTINATION #define XmS_MOTIF_DESTINATION ((char*)&_XmStrings[17155]) #endif #ifndef XmS_MOTIF_DRAG_OFFSET #define XmS_MOTIF_DRAG_OFFSET ((char*)&_XmStrings[17174]) #endif #ifndef XmS_MOTIF_DROP #define XmS_MOTIF_DROP ((char*)&_XmStrings[17193]) #endif #ifndef XmS_MOTIF_ENCODING_REGISTRY #define XmS_MOTIF_ENCODING_REGISTRY ((char*)&_XmStrings[17205]) #endif #ifndef XmS_MOTIF_EXPORT_TARGETS #define XmS_MOTIF_EXPORT_TARGETS ((char*)&_XmStrings[17230]) #endif #ifndef XmS_MOTIF_LOSE_SELECTION #define XmS_MOTIF_LOSE_SELECTION ((char*)&_XmStrings[17252]) #endif #ifndef XmS_MOTIF_RENDER_TABLE #define XmS_MOTIF_RENDER_TABLE ((char*)&_XmStrings[17274]) #endif #ifndef XmS_MOTIF_WM_QUERY #define XmS_MOTIF_WM_QUERY ((char*)&_XmStrings[17294]) #endif #ifndef XmS_MOTIF_WM_ALL_CLIENTS #define XmS_MOTIF_WM_ALL_CLIENTS ((char*)&_XmStrings[17310]) #endif #ifndef XmSMULTIPLE #define XmSMULTIPLE ((char*)&_XmStrings[17332]) #endif #ifndef XmSNULL #define XmSNULL ((char*)&_XmStrings[17341]) #endif #ifndef XmSTARGETS #define XmSTARGETS ((char*)&_XmStrings[17346]) #endif #ifndef XmSTEXT #define XmSTEXT ((char*)&_XmStrings[17354]) #endif #ifndef XmSTIMESTAMP #define XmSTIMESTAMP ((char*)&_XmStrings[17359]) #endif #ifndef XmSWM_STATE #define XmSWM_STATE ((char*)&_XmStrings[17369]) #endif #ifndef XmSTRANSFER_SUCCESS #define XmSTRANSFER_SUCCESS ((char*)&_XmStrings[17378]) #endif #ifndef XmSTRANSFER_FAILURE #define XmSTRANSFER_FAILURE ((char*)&_XmStrings[17397]) #endif #ifndef XmNpathMode #define XmNpathMode ((char*)&_XmStrings[17416]) #endif #ifndef XmRPathMode #define XmRPathMode ((char*)&_XmStrings[17425]) #endif #ifndef XmCPathMode #define XmCPathMode ((char*)&_XmStrings[17434]) #endif #ifndef XmNfileFilterStyle #define XmNfileFilterStyle ((char*)&_XmStrings[17443]) #endif #ifndef XmRFileFilterStyle #define XmRFileFilterStyle ((char*)&_XmStrings[17459]) #endif #ifndef XmCFileFilterStyle #define XmCFileFilterStyle ((char*)&_XmStrings[17475]) #endif #ifndef XmNdirTextLabelString #define XmNdirTextLabelString ((char*)&_XmStrings[17491]) #endif #ifndef XmCDirTextLabelString #define XmCDirTextLabelString ((char*)&_XmStrings[17510]) #endif #ifndef XmNenableBtn1Transfer #define XmNenableBtn1Transfer ((char*)&_XmStrings[17529]) #endif #ifndef XmCEnableBtn1Transfer #define XmCEnableBtn1Transfer ((char*)&_XmStrings[17548]) #endif #ifndef XmNenableButtonTab #define XmNenableButtonTab ((char*)&_XmStrings[17567]) #endif #ifndef XmCEnableButtonTab #define XmCEnableButtonTab ((char*)&_XmStrings[17583]) #endif #ifndef XmNenableEtchedInMenu #define XmNenableEtchedInMenu ((char*)&_XmStrings[17599]) #endif #ifndef XmCEnableEtchedInMenu #define XmCEnableEtchedInMenu ((char*)&_XmStrings[17618]) #endif #ifndef XmNdefaultButtonEmphasis #define XmNdefaultButtonEmphasis ((char*)&_XmStrings[17637]) #endif #ifndef XmCDefaultButtonEmphasis #define XmCDefaultButtonEmphasis ((char*)&_XmStrings[17659]) #endif #ifndef XmRDefaultButtonEmphasis #define XmRDefaultButtonEmphasis ((char*)&_XmStrings[17681]) #endif #ifndef XmNenableToggleColor #define XmNenableToggleColor ((char*)&_XmStrings[17703]) #endif #ifndef XmCEnableToggleColor #define XmCEnableToggleColor ((char*)&_XmStrings[17721]) #endif #ifndef XmNenableToggleVisual #define XmNenableToggleVisual ((char*)&_XmStrings[17739]) #endif #ifndef XmCEnableToggleVisual #define XmCEnableToggleVisual ((char*)&_XmStrings[17758]) #endif #ifndef XmNenableDragIcon #define XmNenableDragIcon ((char*)&_XmStrings[17777]) #endif #ifndef XmCEnableDragIcon #define XmCEnableDragIcon ((char*)&_XmStrings[17792]) #endif #ifndef XmNenableUnselectableDrag #define XmNenableUnselectableDrag ((char*)&_XmStrings[17807]) #endif #ifndef XmCEnableUnselectableDrag #define XmCEnableUnselectableDrag ((char*)&_XmStrings[17830]) #endif #ifndef XmNdragOverActiveMode #define XmNdragOverActiveMode ((char*)&_XmStrings[17853]) #endif #ifndef XmCDragOverActiveMode #define XmCDragOverActiveMode ((char*)&_XmStrings[17872]) #endif #ifndef XmNinstallColormap #define XmNinstallColormap ((char*)&_XmStrings[17891]) #endif #ifndef XmCInstallColormap #define XmCInstallColormap ((char*)&_XmStrings[17907]) #endif #ifndef XmCOwnerEvents #define XmCOwnerEvents ((char*)&_XmStrings[17923]) #endif #ifndef XmNownerEvents #define XmNownerEvents ((char*)&_XmStrings[17935]) #endif #ifndef XmCGrabStyle #define XmCGrabStyle ((char*)&_XmStrings[17947]) #endif #ifndef XmNgrabStyle #define XmNgrabStyle ((char*)&_XmStrings[17957]) #endif #ifndef XmNforegroundState #define XmNforegroundState ((char*)&_XmStrings[17967]) #endif #ifndef XmNbackgroundState #define XmNbackgroundState ((char*)&_XmStrings[17983]) #endif #ifndef XmCGroundState #define XmCGroundState ((char*)&_XmStrings[17999]) #endif #ifndef XmRGroundState #define XmRGroundState ((char*)&_XmStrings[18011]) #endif #ifndef XmRSelectColor #define XmRSelectColor ((char*)&_XmStrings[18023]) #endif #ifndef XmRLargeIconPixmap #define XmRLargeIconPixmap ((char*)&_XmStrings[18035]) #endif #ifndef XmRSmallIconPixmap #define XmRSmallIconPixmap ((char*)&_XmStrings[18051]) #endif #ifndef XmNoutlineState #define XmNoutlineState ((char*)&_XmStrings[18067]) #endif #ifndef XmCOutlineState #define XmCOutlineState ((char*)&_XmStrings[18080]) #endif #ifndef XmROutlineState #define XmROutlineState ((char*)&_XmStrings[18093]) #endif #ifndef XmNspatialIncludeModel #define XmNspatialIncludeModel ((char*)&_XmStrings[18106]) #endif #ifndef XmCSpatialIncludeModel #define XmCSpatialIncludeModel ((char*)&_XmStrings[18126]) #endif #ifndef XmRSpatialIncludeModel #define XmRSpatialIncludeModel ((char*)&_XmStrings[18146]) #endif #ifndef XmNspatialResizeModel #define XmNspatialResizeModel ((char*)&_XmStrings[18166]) #endif #ifndef XmCSpatialResizeModel #define XmCSpatialResizeModel ((char*)&_XmStrings[18185]) #endif #ifndef XmRSpatialResizeModel #define XmRSpatialResizeModel ((char*)&_XmStrings[18204]) #endif #ifndef XmNspatialSnapModel #define XmNspatialSnapModel ((char*)&_XmStrings[18223]) #endif #ifndef XmCSpatialSnapModel #define XmCSpatialSnapModel ((char*)&_XmStrings[18240]) #endif #ifndef XmRSpatialSnapModel #define XmRSpatialSnapModel ((char*)&_XmStrings[18257]) #endif #ifndef XmNdetailColumnHeadingCount #define XmNdetailColumnHeadingCount ((char*)&_XmStrings[18274]) #endif #ifndef XmCDetailColumnHeadingCount #define XmCDetailColumnHeadingCount ((char*)&_XmStrings[18299]) #endif #ifndef XmNdetailOrder #define XmNdetailOrder ((char*)&_XmStrings[18324]) #endif #ifndef XmCDetailOrder #define XmCDetailOrder ((char*)&_XmStrings[18336]) #endif #ifndef XmRCardinalList #define XmRCardinalList ((char*)&_XmStrings[18348]) #endif #ifndef XmNdetailOrderCount #define XmNdetailOrderCount ((char*)&_XmStrings[18361]) #endif #ifndef XmCDetailOrderCount #define XmCDetailOrderCount ((char*)&_XmStrings[18378]) #endif #ifndef XmNoutlineColumnWidth #define XmNoutlineColumnWidth ((char*)&_XmStrings[18395]) #endif #ifndef XmCOutlineColumnWidth #define XmCOutlineColumnWidth ((char*)&_XmStrings[18414]) #endif #ifndef XmNoutlineChangedCallback #define XmNoutlineChangedCallback ((char*)&_XmStrings[18433]) #endif #ifndef XmCOutlineChangedCallback #define XmCOutlineChangedCallback ((char*)&_XmStrings[18456]) #endif #ifndef XmNoutlineButtonPolicy #define XmNoutlineButtonPolicy ((char*)&_XmStrings[18479]) #endif #ifndef XmCOutlineButtonPolicy #define XmCOutlineButtonPolicy ((char*)&_XmStrings[18499]) #endif #ifndef XmROutlineButtonPolicy #define XmROutlineButtonPolicy ((char*)&_XmStrings[18519]) #endif #ifndef XmCDefaultVirtualBindings #define XmCDefaultVirtualBindings ((char*)&_XmStrings[18539]) #endif #ifndef XmNdefaultVirtualBindings #define XmNdefaultVirtualBindings ((char*)&_XmStrings[18562]) #endif #ifndef XmCResizable #define XmCResizable ((char*)&_XmStrings[18585]) #endif #ifndef XmRDynamicPixmap #define XmRDynamicPixmap ((char*)&_XmStrings[18595]) #endif #ifndef XmNpageChangedCallback #define XmNpageChangedCallback ((char*)&_XmStrings[18609]) #endif #ifndef XmNarea #define XmNarea ((char*)&_XmStrings[18629]) #endif #ifndef XmNdetailShadowThickness #define XmNdetailShadowThickness ((char*)&_XmStrings[18634]) #endif #ifndef XmNsliderMark #define XmNsliderMark ((char*)&_XmStrings[18656]) #endif #ifndef XmCSliderMark #define XmCSliderMark ((char*)&_XmStrings[18667]) #endif #ifndef XmRSliderMark #define XmRSliderMark ((char*)&_XmStrings[18678]) #endif #ifndef XmREnableBtn1Transfer #define XmREnableBtn1Transfer ((char*)&_XmStrings[18689]) #endif #ifndef XmNrenditionBackground #define XmNrenditionBackground ((char*)&_XmStrings[18708]) #endif #ifndef XmNrenditionForeground #define XmNrenditionForeground ((char*)&_XmStrings[18728]) #endif #ifndef XmCRenditionBackground #define XmCRenditionBackground ((char*)&_XmStrings[18748]) #endif #ifndef XmCRenditionForeground #define XmCRenditionForeground ((char*)&_XmStrings[18768]) #endif #ifndef XmNindeterminateInsensitivePixmap #define XmNindeterminateInsensitivePixmap ((char*)&_XmStrings[18788]) #endif #ifndef XmCIndeterminateInsensitivePixmap #define XmCIndeterminateInsensitivePixmap ((char*)&_XmStrings[18819]) #endif #ifndef XmNframeChildType #define XmNframeChildType ((char*)&_XmStrings[18850]) #endif #ifndef XmCFrameChildType #define XmCFrameChildType ((char*)&_XmStrings[18865]) #endif #ifndef XmNtextField #define XmNtextField ((char*)&_XmStrings[18880]) #endif #ifndef XmCTextField #define XmCTextField ((char*)&_XmStrings[18890]) #endif #ifndef XmNenableThinThickness #define XmNenableThinThickness ((char*)&_XmStrings[18900]) #endif #ifndef XmCEnableThinThickness #define XmCEnableThinThickness ((char*)&_XmStrings[18920]) #endif #ifndef XmNprimaryColorSetId #define XmNprimaryColorSetId ((char*)&_XmStrings[18940]) #endif #ifndef XmCPrimaryColorSetId #define XmCPrimaryColorSetId ((char*)&_XmStrings[18958]) #endif #ifndef XmNsecondaryColorSetId #define XmNsecondaryColorSetId ((char*)&_XmStrings[18976]) #endif #ifndef XmCSecondaryColorSetId #define XmCSecondaryColorSetId ((char*)&_XmStrings[18996]) #endif #ifndef XmNtextColorSetId #define XmNtextColorSetId ((char*)&_XmStrings[19016]) #endif #ifndef XmCTextColorSetId #define XmCTextColorSetId ((char*)&_XmStrings[19031]) #endif #ifndef XmNactiveColorSetId #define XmNactiveColorSetId ((char*)&_XmStrings[19046]) #endif #ifndef XmCActiveColorSetId #define XmCActiveColorSetId ((char*)&_XmStrings[19063]) #endif #ifndef XmNinactiveColorSetId #define XmNinactiveColorSetId ((char*)&_XmStrings[19080]) #endif #ifndef XmCInactiveColorSetId #define XmCInactiveColorSetId ((char*)&_XmStrings[19099]) #endif #ifndef XmNuseColorObj #define XmNuseColorObj ((char*)&_XmStrings[19118]) #endif #ifndef XmCUseColorObj #define XmCUseColorObj ((char*)&_XmStrings[19130]) #endif #ifndef XmNuseTextColor #define XmNuseTextColor ((char*)&_XmStrings[19142]) #endif #ifndef XmCUseTextColor #define XmCUseTextColor ((char*)&_XmStrings[19155]) #endif #ifndef XmNuseTextColorForList #define XmNuseTextColorForList ((char*)&_XmStrings[19168]) #endif #ifndef XmCUseTextColorForList #define XmCUseTextColorForList ((char*)&_XmStrings[19188]) #endif #ifndef XmNuseMask #define XmNuseMask ((char*)&_XmStrings[19208]) #endif #ifndef XmCUseMask #define XmCUseMask ((char*)&_XmStrings[19216]) #endif #ifndef XmNuseMultiColorIcons #define XmNuseMultiColorIcons ((char*)&_XmStrings[19224]) #endif #ifndef XmCUseMultiColorIcons #define XmCUseMultiColorIcons ((char*)&_XmStrings[19243]) #endif #ifndef XmNuseIconFileCache #define XmNuseIconFileCache ((char*)&_XmStrings[19262]) #endif #ifndef XmCUseIconFileCache #define XmCUseIconFileCache ((char*)&_XmStrings[19279]) #endif #ifndef XmSPIXEL_SET #define XmSPIXEL_SET ((char*)&_XmStrings[19296]) #endif #ifndef XmSCUSTOMIZE_DATA #define XmSCUSTOMIZE_DATA ((char*)&_XmStrings[19307]) #endif #ifndef XmSCOLOR_SRV_NAME #define XmSCOLOR_SRV_NAME ((char*)&_XmStrings[19323]) #endif #ifndef XmNlist #define XmNlist ((char*)&_XmStrings[19335]) #endif #ifndef XmCList #define XmCList ((char*)&_XmStrings[19340]) #endif #ifndef XmNarrowOrientation #define XmNarrowOrientation ((char*)&_XmStrings[19345]) #endif #ifndef XmCArrowOrientation #define XmCArrowOrientation ((char*)&_XmStrings[19362]) #endif #ifndef XmRArrowOrientation #define XmRArrowOrientation ((char*)&_XmStrings[19379]) #endif #ifndef XmNpositionType #define XmNpositionType ((char*)&_XmStrings[19396]) #endif #ifndef XmCPositionType #define XmCPositionType ((char*)&_XmStrings[19409]) #endif #ifndef XmRPositionType #define XmRPositionType ((char*)&_XmStrings[19422]) #endif #ifndef XmNwrap #define XmNwrap ((char*)&_XmStrings[19435]) #endif #ifndef XmCWrap #define XmCWrap ((char*)&_XmStrings[19440]) #endif #ifndef XmNpositionMode #define XmNpositionMode ((char*)&_XmStrings[19445]) #endif #ifndef XmCPositionMode #define XmCPositionMode ((char*)&_XmStrings[19458]) #endif #ifndef XmRPositionMode #define XmRPositionMode ((char*)&_XmStrings[19471]) #endif #ifndef XmNprintOrientation #define XmNprintOrientation ((char*)&_XmStrings[19484]) #endif #ifndef XmCPrintOrientation #define XmCPrintOrientation ((char*)&_XmStrings[19501]) #endif #ifndef XmNprintOrientations #define XmNprintOrientations ((char*)&_XmStrings[19518]) #endif #ifndef XmCPrintOrientations #define XmCPrintOrientations ((char*)&_XmStrings[19536]) #endif #ifndef XmNprintResolution #define XmNprintResolution ((char*)&_XmStrings[19554]) #endif #ifndef XmCPrintResolution #define XmCPrintResolution ((char*)&_XmStrings[19570]) #endif #ifndef XmNprintResolutions #define XmNprintResolutions ((char*)&_XmStrings[19586]) #endif #ifndef XmCPrintResolutions #define XmCPrintResolutions ((char*)&_XmStrings[19603]) #endif #ifndef XmNdefaultPixmapResolution #define XmNdefaultPixmapResolution ((char*)&_XmStrings[19620]) #endif #ifndef XmCDefaultPixmapResolution #define XmCDefaultPixmapResolution ((char*)&_XmStrings[19644]) #endif #ifndef XmNstartJobCallback #define XmNstartJobCallback ((char*)&_XmStrings[19668]) #endif #ifndef XmNendJobCallback #define XmNendJobCallback ((char*)&_XmStrings[19685]) #endif #ifndef XmNpageSetupCallback #define XmNpageSetupCallback ((char*)&_XmStrings[19700]) #endif #ifndef XmNpdmNotificationCallback #define XmNpdmNotificationCallback ((char*)&_XmStrings[19718]) #endif #ifndef XmNminX #define XmNminX ((char*)&_XmStrings[19742]) #endif #ifndef XmNminY #define XmNminY ((char*)&_XmStrings[19747]) #endif #ifndef XmNmaxX #define XmNmaxX ((char*)&_XmStrings[19752]) #endif #ifndef XmNmaxY #define XmNmaxY ((char*)&_XmStrings[19757]) #endif #ifndef XmCMinX #define XmCMinX ((char*)&_XmStrings[19762]) #endif #ifndef XmCMinY #define XmCMinY ((char*)&_XmStrings[19767]) #endif #ifndef XmCMaxX #define XmCMaxX ((char*)&_XmStrings[19772]) #endif #ifndef XmCMaxY #define XmCMaxY ((char*)&_XmStrings[19777]) #endif #ifndef XmNpreeditStartCallback #define XmNpreeditStartCallback ((char*)&_XmStrings[19782]) #endif #ifndef XmNpreeditDoneCallback #define XmNpreeditDoneCallback ((char*)&_XmStrings[19803]) #endif #ifndef XmNpreeditDrawCallback #define XmNpreeditDrawCallback ((char*)&_XmStrings[19823]) #endif #ifndef XmNpreeditCaretCallback #define XmNpreeditCaretCallback ((char*)&_XmStrings[19843]) #endif #ifndef XmNverifyPreedit #define XmNverifyPreedit ((char*)&_XmStrings[19864]) #endif #ifndef XmCVerifyPreedit #define XmCVerifyPreedit ((char*)&_XmStrings[19878]) #endif #ifndef XmNenableMultiKeyBindings #define XmNenableMultiKeyBindings ((char*)&_XmStrings[19892]) #endif #ifndef XmCEnableMultiKeyBindings #define XmCEnableMultiKeyBindings ((char*)&_XmStrings[19915]) #endif #ifndef XmRButtonFontList #define XmRButtonFontList ((char*)&_XmStrings[19938]) #endif #ifndef XmRLabelFontList #define XmRLabelFontList ((char*)&_XmStrings[19953]) #endif #ifndef XmRTextFontList #define XmRTextFontList ((char*)&_XmStrings[19967]) #endif #ifndef XmSPIXEL_SET_PROP #define XmSPIXEL_SET_PROP ((char*)&_XmStrings[19980]) #endif #ifndef XmS50_foreground #define XmS50_foreground ((char*)&_XmStrings[19994]) #endif #ifndef XmSunspecified_pixmap #define XmSunspecified_pixmap ((char*)&_XmStrings[20008]) #endif #endif /* XMSTRINGDEFINES */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #include #ifdef __cplusplus extern "C" { #endif #define XmSTRING_DEFAULT_CHARSET XmS #define XmSTRING_ISO8859_1 "ISO8859-1" #define XmFONTLIST_DEFAULT_TAG XmSFONTLIST_DEFAULT_TAG_STRING #define XmFONTLIST_DEFAULT_TAG_STRING XmSXmFONTLIST_DEFAULT_TAG_STRING #define XmVaCASCADEBUTTON "cascadeButton" #define XmVaCHECKBUTTON "checkButton" #define XmVaDOUBLE_SEPARATOR "doubleSeparator" #define XmVaPUSHBUTTON "pushButton" #define XmVaRADIOBUTTON "radioButton" #define XmVaSEPARATOR "separator" #define XmVaSINGLE_SEPARATOR "singleSeparator" #define XmVaTOGGLEBUTTON "checkButton" #ifndef XmVaTITLE #define XmVaTITLE XtNtitle #endif #ifndef XtCKeyboardFocusPolicy #define XtCKeyboardFocusPolicy XmCKeyboardFocusPolicy #endif #ifndef XtCShellUnitType #define XtCShellUnitType XmCShellUnitType #endif #ifndef XtNkeyboardFocusPolicy #define XtNkeyboardFocusPolicy XmNkeyboardFocusPolicy #endif #ifndef XtNshellUnitType #define XtNshellUnitType XmNshellUnitType #endif #ifndef XtRKeyboardFocusPolicy #define XtRKeyboardFocusPolicy XmRKeyboardFocusPolicy #endif #ifndef XmRPrimBottomShadowPixmap #define XmRPrimBottomShadowPixmap XmRBottomShadowPixmap #endif #ifndef XmRPrimHighlightPixmap #define XmRPrimHighlightPixmap XmRHighlightPixmap #endif #ifndef XmRPrimTopShadowPixmap #define XmRPrimTopShadowPixmap XmRTopShadowPixmap #endif #ifndef XmCAccelerators #define XmCAccelerators XtCAccelerators #endif #ifndef XmCAllowShellResize #define XmCAllowShellResize XtCAllowShellResize #endif #ifndef XmCArgc #define XmCArgc XtCArgc #endif #ifndef XmCArgv #define XmCArgv XtCArgv #endif #ifndef XmCBackground #define XmCBackground XtCBackground #endif #ifndef XmCBaseHeight #define XmCBaseHeight XtCBaseHeight #endif #ifndef XmCBaseHeight #define XmCBaseHeight XtCBaseHeight #endif #ifndef XmCBaseWidth #define XmCBaseWidth XtCBaseWidth #endif #ifndef XmCBaseWidth #define XmCBaseWidth XtCBaseWidth #endif #ifndef XmCBitmap #define XmCBitmap XtCBitmap #endif #ifndef XmCBoolean #define XmCBoolean XtCBoolean #endif #ifndef XmCBorderColor #define XmCBorderColor XtCBorderColor #endif #ifndef XmCBorderWidth #define XmCBorderWidth XtCBorderWidth #endif #ifndef XmCCallback #define XmCCallback XtCCallback #endif #ifndef XmCColor #define XmCColor XtCColor #endif #ifndef XmCColormap #define XmCColormap XtCColormap #endif #ifndef XmCCreatePopupChildProc #define XmCCreatePopupChildProc XtCCreatePopupChildProc #endif #ifndef XmCCursor #define XmCCursor XtCCursor #endif #ifndef XmCDepth #define XmCDepth XtCDepth #endif #ifndef XmCDimension #define XmCDimension XtRDimension #endif #ifndef XmCEditMode #define XmCEditMode XtREditMode #endif #ifndef XmCEditType #define XmCEditType XtCEditType #endif #ifndef XmCEventBindings #define XmCEventBindings XtCEventBindings #endif #ifndef XmCFile #define XmCFile XtCFile #endif #ifndef XmCFont #define XmCFont XtCFont #endif #ifndef XmCFontSet #define XmCFontSet XtCFontSet #endif #ifndef XmCForeground #define XmCForeground XtCForeground #endif #ifndef XmCFraction #define XmCFraction XtCFraction #endif #ifndef XmCFunction #define XmCFunction XtCFunction #endif #ifndef XmCGeometry #define XmCGeometry XtCGeometry #endif #ifndef XmCHSpace #define XmCHSpace XtCHSpace #endif #ifndef XmCHeight #define XmCHeight XtCHeight #endif #ifndef XmCHeightInc #define XmCHeightInc XtCHeightInc #endif #ifndef XmCIconMask #define XmCIconMask XtCIconMask #endif #ifndef XmCIconName #define XmCIconName XtCIconName #endif #ifndef XmCIconNameEncoding #define XmCIconNameEncoding XtCIconNameEncoding #endif #ifndef XmCIconPixmap #define XmCIconPixmap XtCIconPixmap #endif #ifndef XmCIconWindow #define XmCIconWindow XtCIconWindow #endif #ifndef XmCIconX #define XmCIconX XtCIconX #endif #ifndef XmCIconY #define XmCIconY XtCIconY #endif #ifndef XmCIconic #define XmCIconic XtCIconic #endif #ifndef XmCIndex #define XmCIndex XtCIndex #endif #ifndef XmCInitialResourcesPersistent #define XmCInitialResourcesPersistent XtCInitialResourcesPersistent #endif #ifndef XmCInitialState #define XmCInitialState XtCInitialState #endif #ifndef XmCInput #define XmCInput XtCInput #endif #ifndef XmCInsertPosition #define XmCInsertPosition XtCInsertPosition #endif #ifndef XmCInterval #define XmCInterval XtCInterval #endif #ifndef XmCJustify #define XmCJustify XtCJustify #endif #ifndef XmCLabel #define XmCLabel XtCLabel #endif #ifndef XmCLength #define XmCLength XtCLength #endif #ifndef XmCMappedWhenManaged #define XmCMappedWhenManaged XtCMappedWhenManaged #endif #ifndef XmCMargin #define XmCMargin XtCMargin #endif #ifndef XmCMaxAspectX #define XmCMaxAspectX XtCMaxAspectX #endif #ifndef XmCMaxAspectY #define XmCMaxAspectY XtCMaxAspectY #endif #ifndef XmCMaxHeight #define XmCMaxHeight XtCMaxHeight #endif #ifndef XmCMaxWidth #define XmCMaxWidth XtCMaxWidth #endif #ifndef XmCMenuEntry #define XmCMenuEntry XtCMenuEntry #endif #ifndef XmCMinAspectX #define XmCMinAspectX XtCMinAspectX #endif #ifndef XmCMinAspectY #define XmCMinAspectY XtCMinAspectY #endif #ifndef XmCMinHeight #define XmCMinHeight XtCMinHeight #endif #ifndef XmCMinWidth #define XmCMinWidth XtCMinWidth #endif #ifndef XmCNotify #define XmCNotify XtCNotify #endif #ifndef XmCOrientation #define XmCOrientation XtCOrientation #endif #ifndef XmCOverrideRedirect #define XmCOverrideRedirect XtCOverrideRedirect #endif #ifndef XmCParameter #define XmCParameter XtCParameter #endif #ifndef XmCPixmap #define XmCPixmap XtCPixmap #endif #ifndef XmCPosition #define XmCPosition XtCPosition #endif #ifndef XmCReadOnly #define XmCReadOnly XtCReadOnly #endif #ifndef XmCResize #define XmCResize XtCResize #endif #ifndef XmCReverseVideo #define XmCReverseVideo XtCReverseVideo #endif #ifndef XmCSaveUnder #define XmCSaveUnder XtCSaveUnder #endif #ifndef XmCScreen #define XmCScreen XtCScreen #endif #ifndef XmCScrollDCursor #define XmCScrollDCursor XtCScrollDCursor #endif #ifndef XmCScrollHCursor #define XmCScrollHCursor XtCScrollHCursor #endif #ifndef XmCScrollLCursor #define XmCScrollLCursor XtCScrollLCursor #endif #ifndef XmCScrollProc #define XmCScrollProc XtCScrollProc #endif #ifndef XmCScrollRCursor #define XmCScrollRCursor XtCScrollRCursor #endif #ifndef XmCScrollUCursor #define XmCScrollUCursor XtCScrollUCursor #endif #ifndef XmCScrollVCursor #define XmCScrollVCursor XtCScrollVCursor #endif #ifndef XmCSelection #define XmCSelection XtCSelection #endif #ifndef XmCSelectionArray #define XmCSelectionArray XtCSelectionArray #endif #ifndef XmCSensitive #define XmCSensitive XtCSensitive #endif #ifndef XmCSpace #define XmCSpace XtCSpace #endif #ifndef XmCString #define XmCString XtCString #endif #ifndef XmCTextOptions #define XmCTextOptions XtCTextOptions #endif #ifndef XmCTextPosition #define XmCTextPosition XtCTextPosition #endif #ifndef XmCTextSink #define XmCTextSink XtCTextSink #endif #ifndef XmCTextSource #define XmCTextSource XtCTextSource #endif #ifndef XmCThickness #define XmCThickness XtCThickness #endif #ifndef XmCThumb #define XmCThumb XtCThumb #endif #ifndef XmCTitle #define XmCTitle XtCTitle #endif #ifndef XmCTitleEncoding #define XmCTitleEncoding XtCTitleEncoding #endif #ifndef XmCTransient #define XmCTransient XtCTransient #endif #ifndef XmCTransientFor #define XmCTransientFor XtCTransientFor #endif #ifndef XmCTranslations #define XmCTranslations XtCTranslations #endif #ifndef XmCVSpace #define XmCVSpace XtCVSpace #endif #ifndef XmCValue #define XmCValue XtCValue #endif #ifndef XmCVisual #define XmCVisual XtCVisual #endif #ifndef XmCWaitForWm #define XmCWaitForWm XtCWaitForWm #endif #ifndef XmCWidget #define XmCWidget XtRWidget #endif #ifndef XmCWidth #define XmCWidth XtCWidth #endif #ifndef XmCWidthInc #define XmCWidthInc XtCWidthInc #endif #ifndef XmCWinGravity #define XmCWinGravity XtCWinGravity #endif #ifndef XmCWindow #define XmCWindow XtCWindow #endif #ifndef XmCWindowGroup #define XmCWindowGroup XtCWindowGroup #endif #ifndef XmCWmTimeout #define XmCWmTimeout XtCWmTimeout #endif #ifndef XmCX #define XmCX XtCX #endif #ifndef XmCY #define XmCY XtCY #endif #ifndef XmNaccelerators #define XmNaccelerators XtNaccelerators #endif #ifndef XmNallowShellResize #define XmNallowShellResize XtNallowShellResize #endif #ifndef XmNancestorSensitive #define XmNancestorSensitive XtNancestorSensitive #endif #ifndef XmNargc #define XmNargc XtNargc #endif #ifndef XmNargv #define XmNargv XtNargv #endif #ifndef XmNbackground #define XmNbackground XtNbackground #endif #ifndef XmNbackgroundPixmap #define XmNbackgroundPixmap XtNbackgroundPixmap #endif #ifndef XmNbaseHeight #define XmNbaseHeight XtNbaseHeight #endif #ifndef XmNbaseHeight #define XmNbaseHeight XtNbaseHeight #endif #ifndef XmNbaseWidth #define XmNbaseWidth XtNbaseWidth #endif #ifndef XmNbaseWidth #define XmNbaseWidth XtNbaseWidth #endif #ifndef XmNbitmap #define XmNbitmap XtNbitmap #endif #ifndef XmNborder #define XmNborder XtNborder #endif #ifndef XmNborderColor #define XmNborderColor XtNborderColor #endif #ifndef XmNborderPixmap #define XmNborderPixmap XtNborderPixmap #endif #ifndef XmNborderWidth #define XmNborderWidth XtNborderWidth #endif #ifndef XmNcallback #define XmNcallback XtNcallback #endif #ifndef XmNchildren #define XmNchildren XtNchildren #endif #ifndef XmNcolormap #define XmNcolormap XtNcolormap #endif #ifndef XmNcreatePopupChildProc #define XmNcreatePopupChildProc XtNcreatePopupChildProc #endif #ifndef XmNdepth #define XmNdepth XtNdepth #endif #ifndef XmNdestroyCallback #define XmNdestroyCallback XtNdestroyCallback #endif #ifndef XmNeditType #define XmNeditType XtNeditType #endif #ifndef XmNfile #define XmNfile XtNfile #endif #ifndef XmNfont #define XmNfont XtNfont #endif #ifndef XmNfontSet #define XmNfontSet XtNfontSet #endif #ifndef XmNforceBars #define XmNforceBars XtNforceBars #endif #ifndef XmNforeground #define XmNforeground XtNforeground #endif #ifndef XmNfunction #define XmNfunction XtNfunction #endif #ifndef XmNgeometry #define XmNgeometry XtNgeometry #endif #ifndef XmNheight #define XmNheight XtNheight #endif #ifndef XmNheightInc #define XmNheightInc XtNheightInc #endif #ifndef XmNhighlight #define XmNhighlight XtNhighlight #endif #ifndef XmNiconMask #define XmNiconMask XtNiconMask #endif #ifndef XmNiconName #define XmNiconName XtNiconName #endif #ifndef XmNiconNameEncoding #define XmNiconNameEncoding XtNiconNameEncoding #endif #ifndef XmNiconPixmap #define XmNiconPixmap XtNiconPixmap #endif #ifndef XmNiconWindow #define XmNiconWindow XtNiconWindow #endif #ifndef XmNiconX #define XmNiconX XtNiconX #endif #ifndef XmNiconY #define XmNiconY XtNiconY #endif #ifndef XmNiconic #define XmNiconic XtNiconic #endif #ifndef XmNindex #define XmNindex XtNindex #endif #ifndef XmNinitialResourcesPersistent #define XmNinitialResourcesPersistent XtNinitialResourcesPersistent #endif #ifndef XmNinitialState #define XmNinitialState XtNinitialState #endif #ifndef XmNinnerHeight #define XmNinnerHeight XtNinnerHeight #endif #ifndef XmNinnerWidth #define XmNinnerWidth XtNinnerWidth #endif #ifndef XmNinnerWindow #define XmNinnerWindow XtNinnerWindow #endif #ifndef XmNinput #define XmNinput XtNinput #endif #ifndef XmNinsertPosition #define XmNinsertPosition XtNinsertPosition #endif #ifndef XmNinternalHeight #define XmNinternalHeight XtNinternalHeight #endif #ifndef XmNinternalWidth #define XmNinternalWidth XtNinternalWidth #endif #ifndef XmNjumpProc #define XmNjumpProc XtNjumpProc #endif #ifndef XmNjustify #define XmNjustify XtNjustify #endif #ifndef XmNlength #define XmNlength XtNlength #endif #ifndef XmNlowerRight #define XmNlowerRight XtNlowerRight #endif #ifndef XmNmappedWhenManaged #define XmNmappedWhenManaged XtNmappedWhenManaged #endif #ifndef XmNmaxAspectX #define XmNmaxAspectX XtNmaxAspectX #endif #ifndef XmNmaxAspectY #define XmNmaxAspectY XtNmaxAspectY #endif #ifndef XmNmaxHeight #define XmNmaxHeight XtNmaxHeight #endif #ifndef XmNmaxWidth #define XmNmaxWidth XtNmaxWidth #endif #ifndef XmNmenuEntry #define XmNmenuEntry XtNmenuEntry #endif #ifndef XmNminAspectX #define XmNminAspectX XtNminAspectX #endif #ifndef XmNminAspectY #define XmNminAspectY XtNminAspectY #endif #ifndef XmNminHeight #define XmNminHeight XtNminHeight #endif #ifndef XmNminWidth #define XmNminWidth XtNminWidth #endif #ifndef XmNname #define XmNname XtNname #endif #ifndef XmNnotify #define XmNnotify XtNnotify #endif #ifndef XmNnumChildren #define XmNnumChildren XtNnumChildren #endif #ifndef XmNorientation #define XmNorientation XtNorientation #endif #ifndef XmNoverrideRedirect #define XmNoverrideRedirect XtNoverrideRedirect #endif #ifndef XmNparameter #define XmNparameter XtNparameter #endif #ifndef XmNpixmap #define XmNpixmap XtNpixmap #endif #ifndef XmNpopdownCallback #define XmNpopdownCallback XtNpopdownCallback #endif #ifndef XmNpopupCallback #define XmNpopupCallback XtNpopupCallback #endif #ifndef XmNresize #define XmNresize XtNresize #endif #ifndef XmNreverseVideo #define XmNreverseVideo XtNreverseVideo #endif #ifndef XmNsaveUnder #define XmNsaveUnder XtNsaveUnder #endif #ifndef XmNscreen #define XmNscreen XtNscreen #endif #ifndef XmNscrollDCursor #define XmNscrollDCursor XtNscrollDCursor #endif #ifndef XmNscrollHCursor #define XmNscrollHCursor XtNscrollHCursor #endif #ifndef XmNscrollLCursor #define XmNscrollLCursor XtNscrollLCursor #endif #ifndef XmNscrollProc #define XmNscrollProc XtNscrollProc #endif #ifndef XmNscrollRCursor #define XmNscrollRCursor XtNscrollRCursor #endif #ifndef XmNscrollUCursor #define XmNscrollUCursor XtNscrollUCursor #endif #ifndef XmNscrollVCursor #define XmNscrollVCursor XtNscrollVCursor #endif #ifndef XmNselection #define XmNselection XtNselection #endif #ifndef XmNselectionArray #define XmNselectionArray XtNselectionArray #endif #ifndef XmNsensitive #define XmNsensitive XtNsensitive #endif #ifndef XmNshown #define XmNshown XtNshown #endif #ifndef XmNspace #define XmNspace XtNspace #endif #ifndef XmNstring #define XmNstring XtNstring #endif #ifndef XmNtextOptions #define XmNtextOptions XtNtextOptions #endif #ifndef XmNtextSink #define XmNtextSink XtNtextSink #endif #ifndef XmNtextSource #define XmNtextSource XtNtextSource #endif #ifndef XmNthickness #define XmNthickness XtNthickness #endif #ifndef XmNthumb #define XmNthumb XtNthumb #endif #ifndef XmNthumbProc #define XmNthumbProc XtNthumbProc #endif #ifndef XmNtitle #define XmNtitle XtNtitle #endif #ifndef XmNtitleEncoding #define XmNtitleEncoding XtNtitleEncoding #endif #ifndef XmNtop #define XmNtop XtNtop #endif #ifndef XmNtransient #define XmNtransient XtNtransient #endif #ifndef XmNtransientFor #define XmNtransientFor XtNtransientFor #endif #ifndef XmNtransientFor #define XmNtransientFor XtNtransientFor #endif #ifndef XmNtranslations #define XmNtranslations XtNtranslations #endif #ifndef XmNupdate #define XmNupdate XtNupdate #endif #ifndef XmNuseBottom #define XmNuseBottom XtNuseBottom #endif #ifndef XmNuseRight #define XmNuseRight XtNuseRight #endif #ifndef XmNvalue #define XmNvalue XtNvalue #endif #ifndef XmNvisual #define XmNvisual XtNvisual #endif #ifndef XmNwaitForWm #define XmNwaitForWm XtNwaitForWm #endif #ifndef XmNwidth #define XmNwidth XtNwidth #endif #ifndef XmNwidthInc #define XmNwidthInc XtNwidthInc #endif #ifndef XmNwinGravity #define XmNwinGravity XtNwinGravity #endif #ifndef XmNwindow #define XmNwindow XtNwindow #endif #ifndef XmNwindowGroup #define XmNwindowGroup XtNwindowGroup #endif #ifndef XmNwmTimeout #define XmNwmTimeout XtNwmTimeout #endif #ifndef XmNx #define XmNx XtNx #endif #ifndef XmNy #define XmNy XtNy #endif #ifndef XmRAcceleratorTable #define XmRAcceleratorTable XtRAcceleratorTable #endif #ifndef XmRAtom #define XmRAtom XtRAtom #endif #ifndef XmRBitmap #define XmRBitmap XtRBitmap #endif #ifndef XmRBool #define XmRBool XtRBool #endif #ifndef XmRBoolean #define XmRBoolean XtRBoolean #endif #ifndef XmRCallProc #define XmRCallProc XtRCallProc #endif #ifndef XmRCallback #define XmRCallback XtRCallback #endif #ifndef XmRCardinal #define XmRCardinal XtRCardinal #endif #ifndef XmRColor #define XmRColor XtRColor #endif #ifndef XmRColormap #define XmRColormap XtRColormap #endif #ifndef XmRCursor #define XmRCursor XtRCursor #endif #ifndef XmRDimension #define XmRDimension XtRDimension #endif #ifndef XmRDisplay #define XmRDisplay XtRDisplay #endif #ifndef XmREditMode #define XmREditMode XtREditMode #endif #ifndef XmREnum #define XmREnum XtREnum #endif #ifndef XmRFile #define XmRFile XtRFile #endif #ifndef XmRFloat #define XmRFloat XtRFloat #endif #ifndef XmRFont #define XmRFont XtRFont #endif #ifndef XmRFontSet #define XmRFontSet XtRFontSet #endif #ifndef XmRFontStruct #define XmRFontStruct XtRFontStruct #endif #ifndef XmRFunction #define XmRFunction XtRFunction #endif #ifndef XmRGeometry #define XmRGeometry XtRGeometry #endif #ifndef XmRImmediate #define XmRImmediate XtRImmediate #endif #ifndef XmRInitialState #define XmRInitialState XtRInitialState #endif #ifndef XmRInt #define XmRInt XtRInt #endif #ifndef XmRJustify #define XmRJustify XtRJustify #endif #ifndef XmRLongBoolean #define XmRLongBoolean XtRLongBoolean #endif #ifndef XmROrientation #define XmROrientation XtROrientation #endif #ifndef XmRObject #define XmRObject XtRObject #endif #ifndef XmRPixel #define XmRPixel XtRPixel #endif #ifndef XmRPixmap #define XmRPixmap XtRPixmap #endif #ifndef XmRPointer #define XmRPointer XtRPointer #endif #ifndef XmRPosition #define XmRPosition XtRPosition #endif #ifndef XmRScreen #define XmRScreen XtRScreen #endif #ifndef XmRShort #define XmRShort XtRShort #endif #ifndef XmRString #define XmRString XtRString #endif #ifndef XmRStringArray #define XmRStringArray XtRStringArray #endif #ifndef XmRStringTable #define XmRStringTable XtRStringTable #endif #ifndef XmRTextPosition #define XmRTextPosition XtCTextPosition #endif #ifndef XmRTranslationTable #define XmRTranslationTable XtRTranslationTable #endif #ifndef XmRUnsignedChar #define XmRUnsignedChar XtRUnsignedChar #endif #ifndef XmRVisual #define XmRVisual XtRVisual #endif #ifndef XmRWidget #define XmRWidget XtRWidget #endif #ifndef XmRWidgetClass #define XmRWidgetClass XtRWidgetClass #endif #ifndef XmRWidgetList #define XmRWidgetList XtRWidgetList #endif #ifndef XmRWindow #define XmRWindow XtRWindow #endif #ifndef XmNtoolTipString #define XmNtoolTipString "toolTipString" #endif #ifndef XmCToolTipString #define XmCToolTipString "ToolTipString" #endif #ifndef XmNtoolTipPostDelay #define XmNtoolTipPostDelay "toolTipPostDelay" #endif #ifndef XmCToolTipPostDelay #define XmCToolTipPostDelay "ToolTipPostDelay" #endif #ifndef XmNtoolTipPostDuration #define XmNtoolTipPostDuration "toolTipPostDuration" #endif #ifndef XmCToolTipPostDuration #define XmCToolTipPostDuration "ToolTipPostDuration" #endif #ifndef XmNtoolTipEnable #define XmNtoolTipEnable "toolTipEnable" #endif #ifndef XmCToolTipEnable #define XmCToolTipEnable "ToolTipEnable" #endif #ifndef XmNanimate #define XmNanimate "animate" #endif #ifndef XmCAnimate #define XmCAnimate "Animate" #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs_h_ */ motif-2.3.8/lib/Xm/DragUnderI.h0000644000175000017500000000503013145162623013053 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragUnderI_h #define _XmDragUnderI_h #include #include /* for XmScreen */ #ifdef __cplusplus extern "C" { #endif /* Structure describing a pixmap */ typedef struct _DragPixmapData { Pixmap pixmap; int x, y; unsigned int width, height; } DragPixmapData; typedef struct _XmAnimationSaveData { Display *display; XmScreen xmScreen; Window window; Position windowX; Position windowY; unsigned int windowDepth; XmRegion clipRegion; XmRegion dropSiteRegion; Dimension shadowThickness; Dimension highlightThickness; Pixel background; Pixel foreground; Pixel highlightColor; Pixmap highlightPixmap; Pixel topShadowColor; Pixmap topShadowPixmap; Pixel bottomShadowColor; Pixmap bottomShadowPixmap; Dimension borderWidth; Pixmap animationMask; Pixmap animationPixmap; unsigned int animationPixmapDepth; unsigned char animationStyle; Widget dragOver; GC highlightGC; GC topShadowGC; GC bottomShadowGC; GC drawGC; DragPixmapData *savedPixmaps; Cardinal numSavedPixmaps; Widget dragUnder; unsigned char activeMode; } XmAnimationSaveDataRec, *XmAnimationSaveData; /******** Private Function Declarations for DragUnder.c ********/ extern void _XmDragUnderAnimation( Widget w, XtPointer clientData, XtPointer callData) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragUnderI_h */ motif-2.3.8/lib/Xm/DragCI.h0000644000175000017500000001061613145162623012166 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragCI_h #define _XmDragCI_h #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #define _XmDragStart(dc, srcW, event) \ ((*((XmDragContextClass)XtClass(dc))->drag_class.start) (dc, srcW, event)) #define _XmDragCancel(dc) \ ((*((XmDragContextClass)XtClass(dc))->drag_class.cancel) (dc)) #define _XmDCtoDD(dc) ((XmDisplay)XtParent(dc)) #define _XmDRAG_MASK_BASE \ (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask) #ifdef DRAG_USE_MOTION_HINTS #define _XmDRAG_GRAB_MASK \ (_XmDRAG_MASK_BASE PointerMotionHintMask) #else #define _XmDRAG_GRAB_MASK _XmDRAG_MASK_BASE #endif /* _XmDRAG_USE_MOTION_HINTS */ #define _XmDRAG_EVENT_MASK(dc) \ ((((XmDragContext)dc)->drag.trackingMode == XmDRAG_TRACK_WM_QUERY) \ ? (_XmDRAG_GRAB_MASK | EnterWindowMask | LeaveWindowMask) \ : (_XmDRAG_GRAB_MASK)) enum{ XmCR_DROP_SITE_TREE_ADD = _XmNUMBER_DND_CB_REASONS, XmCR_DROP_SITE_TREE_REMOVE } ; /* * values for dragTrackingMode */ enum { XmDRAG_TRACK_WM_QUERY, XmDRAG_TRACK_MOTION, XmDRAG_TRACK_WM_QUERY_PENDING }; /* Strings to use for the intern atoms */ typedef String XmCanonicalString; #define XmMakeCanonicalString( s) \ (XmCanonicalString) XrmQuarkToString(XrmStringToQuark(s)) #define _XmAllocAndCopy( data, len) \ memcpy((XtPointer) XtMalloc(len), (XtPointer)(data), (len)) typedef struct _XmDragTopLevelClientDataStruct{ Widget destShell; Position xOrigin, yOrigin; Dimension width, height; XtPointer iccInfo; Boolean sourceIsExternal; Window window; Widget dragOver; } XmDragTopLevelClientDataStruct, *XmDragTopLevelClientData; typedef struct _XmDragMotionClientDataStruct{ Window window; Widget dragOver; } XmDragMotionClientDataStruct, *XmDragMotionClientData; /* * dsm to dragDisplay comm */ /* Move to DropSMgrI.h */ typedef struct _XmDropSiteTreeAddCallbackStruct{ int reason; XEvent *event; Widget rootShell; Cardinal numDropSites; Cardinal numArgsPerDSHint; } XmDropSiteTreeAddCallbackStruct, *XmDropSiteTreeAddCallback; /* Move to DropSMgrI.h */ typedef struct _XmDropSiteTreeRemoveCallbackStruct{ int reason; XEvent *event; Widget rootShell; } XmDropSiteTreeRemoveCallbackStruct, *XmDropSiteTreeRemoveCallback; /* Move to DropSMgrI.h */ typedef struct _XmDropSiteTreeUpdateCallbackStruct{ int reason; XEvent *event; Widget rootShell; Cardinal numDropSites; Cardinal numArgsPerDSHint; } XmDropSiteTreeUpdateCallbackStruct, *XmDropSiteTreeUpdateCallback; typedef struct _XmDropSiteEnterPendingCallbackStruct{ int reason; XEvent *event; Time timeStamp; Boolean enter_pending; } XmDropSiteEnterPendingCallbackStruct, *XmDropSiteEnterPendingCallback; /* Move to DropSMgrI.h */ typedef struct _XmAnimationData { Widget dragOver; Window window; Position windowX, windowY; Screen *screen; XmRegion clipRegion; XmRegion dropSiteRegion; XtPointer saveAddr; } XmAnimationDataRec, *XmAnimationData; /******** Private Function Declarations ********/ extern XmDragReceiverInfo _XmAllocReceiverInfo( XmDragContext dc) ; extern unsigned char _XmGetActiveProtocolStyle( Widget w) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragCI_h */ motif-2.3.8/lib/Xm/PrimitiveP.h0000644000175000017500000000764113145162623013171 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmPrimitiveP_h #define _XmPrimitiveP_h #ifndef _XmNO_BC_INCL #define _XmNO_BC_INCL #endif #include #ifdef __cplusplus extern "C" { #endif /* Access Macros */ #define Prim_ShadowThickness(w) (((XmPrimitiveWidget)(w))->primitive.shadow_thickness) #define Prim_HaveTraversal(w) (((XmPrimitiveWidget)(w))->primitive.have_traversal) #define PCEPTR(wc) ((XmPrimitiveClassExt *)(&(((XmPrimitiveWidgetClass)(wc))->primitive_class.extension))) #define _XmGetPrimitiveClassExtPtr(wc, owner) \ ((*PCEPTR(wc) && (((*PCEPTR(wc))->record_type) == owner))\ ? PCEPTR(wc) \ :((XmPrimitiveClassExt *) _XmGetClassExtensionPtr(((XmGenericClassExt *)PCEPTR(wc)), owner))) #define XmPrimitiveClassExtVersion 1L typedef struct _XmPrimitiveClassExtRec{ XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; XmWidgetBaselineProc widget_baseline; XmWidgetDisplayRectProc widget_display_rect; XmWidgetMarginsProc widget_margins; } XmPrimitiveClassExtRec, *XmPrimitiveClassExt; typedef struct _XmPrimitiveClassPart { XtWidgetProc border_highlight; XtWidgetProc border_unhighlight; String translations; XtActionProc arm_and_activate; XmSyntheticResource * syn_resources; int num_syn_resources; XtPointer extension; } XmPrimitiveClassPart; typedef struct _XmPrimitiveClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; } XmPrimitiveClassRec; externalref XmPrimitiveClassRec xmPrimitiveClassRec; /* The Primitive instance record */ typedef struct _XmPrimitivePart { Pixel foreground; Dimension shadow_thickness; Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; Dimension highlight_thickness; Pixel highlight_color; Pixmap highlight_pixmap; XtCallbackList help_callback; XtPointer user_data; Boolean traversal_on; Boolean highlight_on_enter; Boolean have_traversal; unsigned char unit_type; XmNavigationType navigation_type; Boolean highlight_drawn; Boolean highlighted; GC highlight_GC; GC top_shadow_GC; GC bottom_shadow_GC; /* New fields in Motif 2.0 */ #ifndef XM_PART_BC XtCallbackList convert_callback; /* Selection convert callback */ XtCallbackList popup_handler_callback; XmDirection layout_direction; #endif #ifdef OM22_COMPATIBILITY XmString tool_tip_string; #endif } XmPrimitivePart; #ifdef XM_PART_BC extern XmDirection XmPrimLayoutDir ; #define XmPrim_layout_direction(w) (XmPrimLayoutDir) #else #define XmPrim_layout_direction(w) ((w)->primitive.layout_direction) #endif typedef struct _XmPrimitiveRec { CorePart core; XmPrimitivePart primitive; } XmPrimitiveRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPrimitiveP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CascadeB.h0000644000175000017500000000450713145162623012524 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCascadeB_h #define _XmCascadeB_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmCascadeButtonWidgetClass; typedef struct _XmCascadeButtonRec * XmCascadeButtonWidget; typedef struct _XmCascadeButtonClassRec * XmCascadeButtonWidgetClass; /* fast subclass define */ #ifndef XmIsCascadeButton #define XmIsCascadeButton(w) XtIsSubclass(w, xmCascadeButtonWidgetClass) #endif /* XmIsCascadeButton */ /******** Public Function Declarations ********/ extern Widget XmCreateCascadeButton( Widget parent, char *name, ArgList al, Cardinal ac) ; extern void XmCascadeButtonHighlight( Widget cb, #if NeedWidePrototypes int highlight) ; #else Boolean highlight) ; #endif /* NeedWidePrototypes */ /* * Variable argument list functions */ extern Widget XmVaCreateCascadeButton( Widget parent, char *name, ...); extern Widget XmVaCreateManagedCascadeButton( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCascadeB_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/CutPaste.c0000644000175000017500000036254613145162623012634 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: CutPaste.c /main/27 1999/05/26 17:42:48 samborn $" #endif #endif #define CUTPASTE #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" /* for MAX */ #include #include "MessagesI.h" #include "CutPasteI.h" #include #include #include #define FIX_1529 #ifdef FIX_1529 #include /* for CARD32 */ #endif #define XMERROR(key, message) \ XtErrorMsg (key, "xmClipboardError", "XmToolkitError", message, NULL, NULL) #define XMRETRY 3 #define XM_APPEND 0 #define XM_REPLACE 1 #define XM_PREPEND 2 #define XM_HEADER_ID 0 #define XM_NEXT_ID 1 #define XM_LOCK_ID 2 #define XM_FIRST_FREE_ID 1000 /* First Item Id allocated */ #define XM_ITEM_ID_INC 1000 /* Increase in Item Id between each copy */ #define XM_ITEM_ID_MAX 5000 /* 'Safe' threshold for resetting Item Id */ #define XM_FORMAT_HEADER_TYPE 1 #define XM_DATA_ITEM_RECORD_TYPE 2 #define XM_HEADER_RECORD_TYPE 3 #define XM_UNDELETE 0 #define XM_DELETE 1 #define XM_DATA_REQUEST_MESSAGE 0 #define XM_DATA_DELETE_MESSAGE 1 #define XM_CLIPBOARD_MESSAGE1 _XmMMsgCutPaste_0000 #define XM_CLIPBOARD_MESSAGE2 _XmMMsgCutPaste_0001 #define XM_CLIPBOARD_MESSAGE3 _XmMMsgCutPaste_0002 #define CLIPBOARD_BAD_DATA_TYPE _XmMMsgCutPaste_0003 #define BAD_DATA_TYPE _XmMMsgCutPaste_0004 #define CLIPBOARD_CORRUPT _XmMMsgCutPaste_0005 #define CORRUPT_DATA_STRUCTURE _XmMMsgCutPaste_0006 /* #define CLIPBOARD_BAD_FORMAT _XmMMsgCutPaste_0007 */ /* unused */ #define BAD_FORMAT _XmMMsgCutPaste_0008 #define BAD_FORMAT_NON_NULL _XmMMsgCutPaste_0009 #define XM_STRING 8 #define XM_COMPOUND_TEXT 8 #define XM_UTF8_STRING 8 #define XM_ATOM 32 #define XM_ATOM_PAIR 32 #define XM_BITMAP 32 #define XM_PIXMAP 32 #define XM_DRAWABLE 32 #define XM_SPAN 32 #define XM_INTEGER 32 #define XM_WINDOW 32 #define XM_PIXEL 32 #define XM_COLORMAP 32 #define XM_TEXT 8 #define MAX_SELECTION_INCR(dpy) (((65536 < XMaxRequestSize(dpy)) ? \ (65536 << 2) : (XMaxRequestSize(dpy) << 2))-100) #define BYTELENGTH( length, format ) \ ((format == 8) ? length : \ ((format == 16) ? length * sizeof(short) : \ (length * sizeof(long)))) #define CONVERT_32_FACTOR (sizeof(unsigned long) / 4) typedef long itemId; typedef unsigned long timeStamp; /*-----------------------------------------------------*/ /* Define the clipboard selection information record */ /*-----------------------------------------------------*/ typedef struct _ClipboardSelectionInfo { long format; unsigned long count; char *data; Atom type; Boolean received; Boolean success; } ClipboardSelectionInfoRec, *ClipboardSelectionInfo; /*------------------------------------------------------------*/ /* Define the clipboard property destroy information record */ /*------------------------------------------------------------*/ typedef struct _ClipboardDestroyInfo { Display *display; Window window; Atom property; } ClipboardDestroyInfoRec, *ClipboardDestroyInfo; /*-------------------------------------------------------*/ /* Define the clipboard cut by name information record */ /*-------------------------------------------------------*/ typedef struct _ClipboardCutByNameInfo { Window window; itemId formatitemid; } ClipboardCutByNameInfoRec, *ClipboardCutByNameInfo; /*---------------------------------------------------*/ /* Define the clipboard format registration record */ /*---------------------------------------------------*/ typedef struct _ClipboardFormatRegRec { long formatLength; } ClipboardFormatRegRec, *ClipboardFormatRegPtr; /*-------------------------------------------*/ /* Define the clipboard lock record */ /*-------------------------------------------*/ typedef struct _ClipboardLockRec { Window windowId; long lockLevel; } ClipboardLockRec, *ClipboardLockPtr; /*---------------------------------------------------*/ /* Define the clipboard format item record */ /*---------------------------------------------------*/ typedef struct _ClipboardFormatItemRec { long recordType; itemId parentItemId;/* this is the data item that owns the format */ Display *displayId; /* display id of application owning data */ Window windowId; /* window id for cut by name */ Widget cutByNameWidget; /* window id for cut by name */ Window cutByNameWindow; /* window id for cut by name */ long cutByNameCBIndex; /* address of callback routine for */ /* cut by name data */ long itemLength; /* length of this format item data */ itemId formatDataId; /* id for format item data, */ /* 0 if passed by name */ Atom formatNameAtom; /* format name atom */ unsigned long formatNameLength; unsigned long cancelledFlag; /* format was cancelled by poster */ unsigned long cutByNameFlag; /* data has not yet been provided */ itemId thisFormatId; /* id given application for identifying format item */ itemId itemPrivateId; /* id provide by application for identifying item */ unsigned long copiedLength; /* amount already copied incrementally */ } ClipboardFormatItemRec, *ClipboardFormatItem; /*-------------------------------------------------*/ /* Define the clipboard data item record */ /*-------------------------------------------------*/ typedef struct _ClipboardDataItemRec { long recordType; itemId adjunctData; /* for future compatibility */ Display *displayId; /* display id of application owning data */ Window windowId; /* window id for cut by name */ itemId thisItemId; /* item id of this data item */ unsigned long dataItemLabelId; /* id of label (comp) string */ unsigned long formatIdList; /* offset of beginning of format id list */ long formatCount; /* number of formats stored for this item */ long cancelledFormatCount; /* number of cut by name formats cancelled */ unsigned long cutByNameFlag; /* data has not yet been provided */ unsigned long deletePendingFlag; /* is item marked for deletion? */ unsigned long permanentItemFlag; /* is item permanent or temporary? */ long cutByNameCBIndex; /* address of callback routine for */ /* cut by name data */ Widget cutByNameWidget; /* widget receiving messages concerning */ /* cut by name */ Window cutByNameWindow; } ClipboardDataItemRec, *ClipboardDataItem; /*----------------------------------------------*/ /* Define the clipboard header record */ /*----------------------------------------------*/ typedef struct _ClipboardHeaderRec { long recordType; itemId adjunctHeader; /* for future compatibility */ unsigned long maxItems; /* maximum number of clipboard items */ /* including those marked for delete */ unsigned long dataItemList; /* offset of data item id list */ itemId nextPasteItemId; /* data id of next item id to paste */ itemId oldNextPasteItemId; /* data id of old next paste item id */ itemId deletedByCopyId; /* item marked deleted by last copy, if any */ itemId lastCopyItemId; /* item id of last item put on clipboard */ itemId recopyId; /* item id of item requested for recopy */ unsigned long currItems; /* current number of clipboard items */ /* including those marked for delete */ timeStamp selectionTimestamp; /* for ICCCM clipboard selection compatability */ timeStamp copyFromTimestamp; /* time of event causing inquire or copy from */ unsigned long foreignCopiedLength; /* amount copied so far in incr copy from */ /* selection */ Window ownSelection; unsigned long incrementalCopyFrom; /* requested in increments */ unsigned long startCopyCalled; /* to ensure that start copy is called before copy or endcopy */ } ClipboardHeaderRec, *ClipboardHeader; /*---------------------------------------------*/ typedef union { ClipboardFormatItemRec format; ClipboardDataItemRec item; ClipboardHeaderRec header; } ClipboardUnionRec, *ClipboardPointer; /*---------------------------------------------*/ /******** Static Function Declarations ********/ static Time ClipboardGetCurrentTime( Display *dpy) ; static void ClipboardSetNextItemId( Display *display, long itemid) ; static Boolean WeOwnSelection( Display*, ClipboardHeader header ); static void AssertClipboardSelection( Display *display, Window window, ClipboardHeader header, Time time) ; static Boolean ClipboardConvertProc(Widget, Atom *, Atom *, Atom *, XtPointer *, unsigned long *, int *); static Atom GetTypeFromTarget(Display*, Atom); static Window InitializeSelection( Display *display, ClipboardHeader header, Window window, Time time) ; static int RegIfMatch( Display *display, char *format_name, char *match_name, int format_length) ; static int RegisterFormat( Display *display, char *format_name, int format_length) ; static void ClipboardError( char *key, char *message) ; static void ClipboardEventHandler( Widget widget, XtPointer closure, XEvent *event, Boolean *cont) ; static int ClipboardFindItem( Display *display, itemId itemid, XtPointer *outpointer, unsigned long *outlength, Atom *outtype, int *format, int rec_type) ; static int GetWindowProperty( Display *display, Window window, Atom property_atom, XtPointer *outpointer, unsigned long *outlength, Atom *type, int *format, #if NeedWidePrototypes int delete_flag) ; #else Boolean delete_flag) ; #endif /* NeedWidePrototypes */ static int ClipboardRetrieveItem( Display *display, itemId itemid, int add_length, int def_length, XtPointer *outpointer, unsigned long *outlength, Atom *type, int *format, int rec_type, unsigned long discard) ; static void ClipboardReplaceItem( Display *display, itemId itemid, XtPointer pointer, unsigned long length, int mode, int format, #if NeedWidePrototypes int free_flag, #else Boolean free_flag, #endif /* NeedWidePrototypes */ Atom type); static Atom ClipboardGetAtomFromId( Display *display, itemId itemid) ; static Atom ClipboardGetAtomFromFormat( Display *display, char *format_name) ; static int ClipboardGetLenFromFormat( Display *display, char *format_name, int *format_length) ; static ClipboardHeader ClipboardOpen( Display *display, int add_length) ; static void ClipboardClose( Display *display, ClipboardHeader root_clipboard_header) ; static void ClipboardDeleteId( Display *display, itemId itemid) ; static ClipboardFormatItem ClipboardFindFormat( Display *display, ClipboardHeader header, char *format, itemId itemid, int n, unsigned long *maxnamelength, int *count, unsigned long *matchlength) ; static void ClipboardDeleteFormat( Display *display, itemId formatitemid) ; static void ClipboardDeleteFormats( Display *display, Window window, itemId dataitemid) ; static void ClipboardDeleteItemLabel( Display *display, Window window, itemId dataitemid) ; static unsigned long ClipboardIsMarkedForDelete( Display *display, ClipboardHeader header, itemId itemid) ; static void ClipboardDeleteItem( Display *display, Window window, ClipboardHeader header, itemId deleteid) ; static void ClipboardDeleteMarked( Display *display, Window window, ClipboardHeader header) ; static void ClipboardMarkItem( Display *display, ClipboardHeader header, itemId dataitemid, unsigned long state) ; static int ClipboardSendMessage( Display *display, Window window, ClipboardFormatItem formatptr, int messagetype) ; static int ClipboardDataIsReady( Display *display, XEvent *event, char *private_info) ; #if 0 static int ClipboardRequestorIsReady( Display *display, XEvent *event, char *private_info) ; #endif static int ClipboardGetSelection( Display *display, Window window, Atom target, XtPointer *value, Atom *type, unsigned long *size, int *format) ; static int ClipboardRequestDataAndWait( Display *display, Window window, ClipboardFormatItem formatptr) ; static itemId ClipboardGetNewItemId( Display *display) ; static void ClipboardSetAccess( Display *display, Window window) ; static int ClipboardLock( Display *display, Window window) ; static int ClipboardUnlock( Display *display, Window window, #if NeedWidePrototypes int all_levels) ; #else Boolean all_levels) ; #endif /* NeedWidePrototypes */ static int ClipboardSearchForWindow( Display *display, Window parentwindow, Window window) ; static int ClipboardWindowExists( Display *display, Window window) ; static void ClipboardReceiveData(Widget, XtPointer, Atom*, Atom*, XtPointer, unsigned long *, int *) ; static int ClipboardRetrieve(Display *display, Window window, char *format, XtPointer buffer, unsigned long length, unsigned long *outlength, long *private_id, Atom *outtype); static Boolean ClipboardGetByNameItem(Display* dpy, Window win, ClipboardHeader header, char* format); static void ClipboardTimeout(XtPointer, XtIntervalId*); /******** End Static Function Declarations ********/ /*---------------------------------------------*/ /* static data */ /*---------------------------------------------*/ static XmCutPasteProc *cbProcTable = NULL; static long *cbIdTable = NULL; static int maxCbProcs = 0; /*---------------------------------------------*/ /* internal routines */ /*---------------------------------------------*/ static Time ClipboardGetCurrentTime( Display *dpy ) { XEvent event; Atom XmA_MOTIF_CLIP_TIME = XInternAtom(dpy, XmS_MOTIF_CLIP_TIME, False); XSelectInput(dpy, RootWindow(dpy, 0), PropertyChangeMask); XChangeProperty(dpy, RootWindow(dpy, 0), XmA_MOTIF_CLIP_TIME, XmA_MOTIF_CLIP_TIME, 8,PropModeAppend,NULL,0); XWindowEvent(dpy, RootWindow(dpy, 0), PropertyChangeMask,&event); return(event.xproperty.time); } static void ClipboardSetNextItemId( Display *display, long itemid ) { itemId base; itemId nextItem; XtPointer int_ptr; unsigned long length; ClipboardHeader header; Atom type; itemId current_item; itemId last_item; header = ClipboardOpen( display, 0 ); current_item = header->nextPasteItemId; last_item = header->oldNextPasteItemId; ClipboardClose( display, header ); nextItem = itemid; do { base = nextItem - (nextItem % XM_ITEM_ID_INC); if (base >= XM_ITEM_ID_MAX) { nextItem = XM_FIRST_FREE_ID; } else { nextItem = base + XM_ITEM_ID_INC; } } while (nextItem == current_item - 1 || nextItem == last_item - 1); ClipboardFindItem( display, XM_NEXT_ID, &int_ptr, &length, &type, 0, 0 ); *(long *) int_ptr = nextItem; ClipboardReplaceItem( display, XM_NEXT_ID, int_ptr, length, PropModeReplace, 32, True, XA_INTEGER); } /*********************************************************************** * WeOwnSelection * * Check to see if the Motif clipboard owns the clipboard selection. * This enables us to shortcut and not use ICCCM data transfer to get * the clipboard data. * * Note that this is necessary for clipboard locking to work correctly. * ***********************************************************************/ static Boolean WeOwnSelection( Display *display, ClipboardHeader header ) { Window selectionwindow; Atom XmA_CLIPBOARD = XInternAtom( display, XmSCLIPBOARD, False ); selectionwindow = XGetSelectionOwner( display, XmA_CLIPBOARD ); return ( selectionwindow == header->ownSelection ); } static void AssertClipboardSelection( Display *display, Window window, ClipboardHeader header, Time time ) { Widget widget; Atom XmA_CLIPBOARD; header->ownSelection = None; header->selectionTimestamp = 0; widget = XtWindowToWidget (display, window); /* Need a valid Widget to add an event handler. */ if (widget == NULL) { return; } /* Assert ownership of CLIPBOARD selection only if there is valid data. */ if (header->nextPasteItemId == 0) { return; } header->ownSelection = window; header->selectionTimestamp = time; XmA_CLIPBOARD = XInternAtom( display, XmSCLIPBOARD, False ); XtOwnSelection(widget, XmA_CLIPBOARD, time, ClipboardConvertProc, NULL, NULL); return; } /* This function ensures that if the data item was copied by name, it will be retrieved for the convert proc. It returns true if the data was not copied by name or if the retrieval is sucessful */ static Boolean ClipboardGetByNameItem(Display* dpy, Window win, ClipboardHeader header, char* format) { short dataok; ClipboardFormatItem matchformat; unsigned long matchformatlength, maxname; int count; /* find the matching format for the next paste item */ matchformat = ClipboardFindFormat(dpy, header, format, (itemId) NULL, 0, &maxname, &count, &matchformatlength ); if (matchformat != 0) { dataok = 1; if ( matchformat->cutByNameFlag == 1 ) { /* passed by name */ dataok = ClipboardRequestDataAndWait(dpy, win, matchformat); } } else { dataok = 0; } return(dataok != 0); } /*ARGSUSED*/ static Boolean ClipboardConvertProc(Widget wid, Atom *selection, /* unused */ Atom *target, Atom *type, XtPointer *value, unsigned long *size, int *format) { enum { XmA_TARGETS, XmA_TIMESTAMP, NUM_ATOMS }; static char *atom_names[] = { XmSTARGETS, XmSTIMESTAMP }; Display *display = XtDisplay(wid); Window window = XtWindow(wid); ClipboardHeader header; Boolean rval = True; char *format_name = NULL; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms( display, atom_names, XtNumber(atom_names), False, atoms ); *value = NULL; *type = XA_INTEGER; *size = 0; *format = 8; if ( ClipboardLock( display, window ) != ClipboardSuccess ) { /* We can't lock the clipboard, something's wrong */ return(False); } /* get the clipboard header */ header = ClipboardOpen( display, 0 ); if ( !WeOwnSelection( display, header ) ) { /* we don't own the selection, something's wrong */ rval = False; goto done; } if ( *target == atoms[XmA_TARGETS] ) { Atom *ptr, *save_ptr; ClipboardFormatItem nextitem; int n, count; unsigned long dummy; *size = 0; *format = 32; *type = XA_ATOM; /* find the first format for the next paste item, if any remain */ nextitem = ClipboardFindFormat( display, header, 0, (itemId) NULL, 1, &dummy, &count, &dummy ); /* allocate storage for list of target atoms, plus the necessary */ ptr = (Atom *)XtMalloc( sizeof(Atom) * (count + 2)); save_ptr = ptr; /* Put required ICCCM targets which are supported */ *ptr = atoms[XmA_TARGETS]; ptr++; *ptr = atoms[XmA_TIMESTAMP]; ptr++; n = 0; /* two targets right now */ while ( nextitem != NULL && n < count ) { int ret_count; /* add format to list */ *ptr = nextitem->formatNameAtom; n = n + 1; XtFree( (char *) nextitem ); /* find the nth format for the next paste item */ nextitem = ClipboardFindFormat( display, header, 0, (itemId) NULL, n + 1, &dummy, &ret_count, &dummy ); if (nextitem != NULL) ptr++; } *value = (char *) save_ptr; /* n is number of targets from the clipboard, plus 2 builtin targets */ *size = n + 2; } else if ( *target == atoms[XmA_TIMESTAMP] ) { timeStamp *timestamp; timestamp = (timeStamp *)XtMalloc(sizeof(timeStamp)); *timestamp = header->selectionTimestamp; *value = (char *) timestamp; *size = 1; *format = XM_INTEGER; *type = XA_INTEGER; } else { long private_id; unsigned long outlength; /* convert atom to format name */ format_name = XGetAtomName( display, *target ); ClipboardGetLenFromFormat( display, format_name, format) ; /* Make sure a byname item is first retrieved */ ClipboardGetByNameItem(display, window, header, format_name); if (XmClipboardInquireLength( display, window, format_name, size) != ClipboardSuccess) { rval = False; goto done; } if ( *size == 0 ) { rval = False; goto done; } *value = XtMalloc( (int) *size ); if (ClipboardRetrieve(display, window, format_name, (XtPointer) *value, *size, &outlength, &private_id, type) != ClipboardSuccess ) { rval = False; goto done; } /* Fix size to be in format units */ if (*format == 32) *size = *size / sizeof(long); else if (*format == 16) *size = *size / sizeof(short); } done: if (format_name != NULL) XFree(format_name); ClipboardClose( display, header ); ClipboardUnlock( display, window, False ); return(rval); } static Window InitializeSelection( Display *display, ClipboardHeader header, Window window, Time time ) { Window selectionwindow; Atom XmA_CLIPBOARD = XInternAtom( display, XmSCLIPBOARD, False ); /* If there is no CLIPBOARD owner, and we have clipboard data, then assert ownership, and use that data. */ selectionwindow = XGetSelectionOwner (display, XmA_CLIPBOARD); /* if the header is corrupted, give up. */ if (selectionwindow == window && header->ownSelection == None) { selectionwindow = None; XSetSelectionOwner (display, XmA_CLIPBOARD, None, time); } if (selectionwindow != None) /* someone owns CLIPBOARD already */ { return selectionwindow; } /* assert ownership of the clipboard selection */ AssertClipboardSelection (display, window, header, time); selectionwindow = XGetSelectionOwner (display, XmA_CLIPBOARD); return (selectionwindow); } static int RegIfMatch( Display *display, char *format_name, char *match_name, int format_length ) { if ( strcmp( format_name, match_name ) == 0 ) { RegisterFormat( display, format_name, format_length ); return 1; } return 0; } static int RegisterFormat( Display *display, /* Display id of application passing data */ char *format_name, /* Name string for data format */ int format_length ) /* Format length 8-16-32 */ { Window rootwindow; Atom formatatom; int stored_len; /* if format is 32 in XChangeProperty, data must be long array */ long long_format_length = format_length; /* get the atom for the format_name */ formatatom = ClipboardGetAtomFromFormat( display, format_name ); rootwindow = RootWindow( display, 0 ); if ( ClipboardGetLenFromFormat( display, format_name, &stored_len ) == ClipboardSuccess ) { if ( stored_len == format_length ) return ClipboardSuccess; /* it is already registered, don't allow override */ return ClipboardFail; } XChangeProperty( display, rootwindow, formatatom, XA_INTEGER, 32, PropModeReplace, (unsigned char*)&long_format_length, 1 ); return ClipboardSuccess; } /*---------------------------------------------*/ static void CleanupHeader( Display * display ) { XDeleteProperty (display, RootWindow (display, 0), XInternAtom (display, XmS_MOTIF_CLIP_HEADER, False)); XFlush(display); } /*---------------------------------------------*/ static void ClipboardError( char *key, char *message ) { XMERROR(key, message ); exit(1); } /*---------------------------------------------*/ /* ARGSUSED */ static void ClipboardEventHandler( Widget widget, XtPointer closure, XEvent *event, Boolean *cont ) { enum { XmA_MOTIF_CLIP_MESSAGE, XmA_MOTIF_CLIP_DATA_REQUEST, XmA_MOTIF_CLIP_DATA_DELETE, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_CLIP_MESSAGE, XmS_MOTIF_CLIP_DATA_REQUEST, XmS_MOTIF_CLIP_DATA_DELETE }; XClientMessageEvent *event_rcvd; Display *display; itemId formatitemid; ClipboardFormatItem formatitem; unsigned long formatlength; Atom formattype, htype; long privateitemid; XmCutPasteProc callbackroutine = NULL; int reason, ret_value; Atom atoms[XtNumber(atom_names)]; event_rcvd = (XClientMessageEvent*)event; if ( (event_rcvd->type & 127) != ClientMessage ) return ; display = XtDisplay(widget); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms( display, atom_names, XtNumber(atom_names), False, atoms ); if (event_rcvd->message_type != atoms[XmA_MOTIF_CLIP_MESSAGE]) return ; formatitemid = event_rcvd->data.l[1]; privateitemid = event_rcvd->data.l[2]; /* get the callback routine */ ret_value = ClipboardFindItem( display, formatitemid, (XtPointer *) &formatitem, &formatlength, &formattype, 0, XM_FORMAT_HEADER_TYPE ); if ( ret_value != ClipboardSuccess ) return ; if (cbProcTable == NULL) return; if (formatitem->cutByNameCBIndex >= 0) { _XmProcessLock(); callbackroutine = cbProcTable[formatitem->cutByNameCBIndex]; _XmProcessUnlock(); } XtFree( (char *) formatitem ); if ( callbackroutine == NULL ) return ; reason = 0; if ( event_rcvd->data.l[0] == atoms[XmA_MOTIF_CLIP_DATA_REQUEST] ) reason = XmCR_CLIPBOARD_DATA_REQUEST; if ( event_rcvd->data.l[0] == atoms[XmA_MOTIF_CLIP_DATA_DELETE] ) reason = XmCR_CLIPBOARD_DATA_DELETE; if ( reason == 0 ) return ; /* call the callback routine */ (*callbackroutine)( widget, (long *) &formatitemid, &privateitemid, &reason ); /* if this was a data request, reset the recopy id */ if (reason == XmCR_CLIPBOARD_DATA_REQUEST) { unsigned long hlength; ClipboardHeader header; ClipboardFindItem (display, XM_HEADER_ID, (XtPointer *)&header, &hlength, &htype, 0, 0); header->recopyId = 0; ClipboardReplaceItem (display, XM_HEADER_ID, header, hlength, PropModeReplace, 32, True, XA_INTEGER); } return ; } /*---------------------------------------------*/ static int ClipboardFindItem( Display *display, itemId itemid, XtPointer *outpointer, unsigned long *outlength, Atom *outtype, int *format, int rec_type ) { Window rootwindow; int ret_value; Atom itematom; int dummy; ClipboardPointer ptr; if (format == NULL) format = &dummy; rootwindow = RootWindow( display, 0 ); /* convert the id into an atom */ itematom = ClipboardGetAtomFromId( display, itemid ); ret_value = GetWindowProperty(display, rootwindow, itematom, outpointer, outlength, outtype, format, FALSE ); if ( ret_value != ClipboardSuccess ) return ret_value; ptr = (ClipboardPointer)(*outpointer); if ( rec_type != 0 && ptr && ptr->header.recordType != rec_type ) { XtFree( (char *) *outpointer ); CleanupHeader (display); ClipboardError( CLIPBOARD_BAD_DATA_TYPE, BAD_DATA_TYPE ); return ClipboardFail; } #ifdef FIX_1529 if( itemid == XM_HEADER_ID && ptr ) { ptr->header.selectionTimestamp = (CARD32)ptr->header.selectionTimestamp; } #endif return ClipboardSuccess; } /*---------------------------------------------*/ static int GetWindowProperty( Display *display, Window window, Atom property_atom, XtPointer *outpointer, unsigned long *outlength, Atom *type, int *format, #if NeedWidePrototypes int delete_flag ) #else Boolean delete_flag ) #endif /* NeedWidePrototypes */ { int ret_value; Atom loc_type; unsigned long bytes_left; unsigned long cur_length; unsigned char *loc_pointer; unsigned long this_length; char *cur_pointer; int loc_format; long request_size; long offset; int byte_length; loc_pointer = NULL; bytes_left = 1; offset = 0; cur_length = 0; cur_pointer = NULL; *outpointer = 0; *outlength = 0; request_size = MAX_SELECTION_INCR( display ); while ( bytes_left > 0 ) { /* retrieve the item from the root */ ret_value = XGetWindowProperty( display, window, property_atom, offset, /*offset*/ request_size, /*length*/ FALSE, AnyPropertyType, &loc_type, &loc_format, &this_length, &bytes_left, &loc_pointer ); if ( ret_value != 0 ) return ClipboardFail; if ( loc_pointer == 0 || this_length == 0 ) { if ( delete_flag ) { XDeleteProperty( display, window, property_atom ); } if (loc_pointer != NULL) XFree ((char *)loc_pointer); return ClipboardFail; } /* convert length according to format */ byte_length = BYTELENGTH( this_length, loc_format ); if ( cur_length == 0 ) { cur_pointer = XtMalloc((size_t)(byte_length + bytes_left)); /* Size arg. is truncated if sizeof( long) > sizeof( size_t) */ *outpointer = cur_pointer; } memcpy(cur_pointer, loc_pointer, (size_t) byte_length ); cur_pointer = cur_pointer + byte_length; cur_length = cur_length + byte_length; offset += loc_format * this_length / 32; if (loc_pointer != NULL) XFree ((char *)loc_pointer); } if ( delete_flag ) { XDeleteProperty( display, window, property_atom ); } if ( format != NULL ) { *format = loc_format; } if ( type != NULL ) { char *temp; char *match = XmS_MOTIF_CLIP_ITEM; int i, len; Boolean equal = True; len = strlen(match); temp = XGetAtomName(display, loc_type); for(i = 0; i < len; i++) { if (temp[i] == 0 || temp[i] != match[i]) { equal = False; break; } } if (equal) /* Bogus type left by old Clipboard */ *type = None; /* Signal bad type */ else *type = loc_type; XFree(temp); } *outlength = cur_length; return ClipboardSuccess; } /*---------------------------------------------*/ static int ClipboardRetrieveItem( Display *display, itemId itemid, int add_length, /* allocate this add'l */ int def_length, /* if item non-exist */ XtPointer *outpointer, unsigned long *outlength, Atom *outtype, int *format, int rec_type, unsigned long discard ) /* ignore old data */ { int ret_value; int loc_format; unsigned long loclength; ClipboardPointer clipboard_pointer; Atom loctype; XtPointer pointer; /* retrieve the item from the root */ ret_value = ClipboardFindItem(display, itemid, &pointer, &loclength, &loctype, &loc_format, rec_type ); if (loclength == 0 || ret_value != ClipboardSuccess) { *outlength = def_length; }else{ if ( discard == 1 ) loclength = 0; *outlength = loclength + add_length; } /* get local memory for the item */ clipboard_pointer = (ClipboardPointer)XtMalloc( (size_t) *outlength ); /* Size arg. is truncated if sizeof( long) > sizeof( size_t) */ if (ret_value == ClipboardSuccess) { /* copy the item into the local memory */ memcpy(clipboard_pointer, pointer, (size_t) loclength ); } *outpointer = (char*)clipboard_pointer; if (outtype != NULL) *outtype = loctype; /* free memory pointed to by pointer */ XtFree( (char *) pointer ); if ( format != 0 ) { *format = loc_format; } /* return a pointer to the item */ return ret_value; } /*---------------------------------------------*/ static void ClipboardReplaceItem( Display *display, itemId itemid, XtPointer pointer, unsigned long length, int mode, int format, #if NeedWidePrototypes int free_flag, #else Boolean free_flag, #endif /* NeedWidePrototypes */ Atom type) { Window rootwindow; Atom itematom; XtPointer loc_pointer; unsigned long loc_length; int loc_mode; unsigned int max_req_size; loc_pointer = pointer; loc_mode = mode; rootwindow = RootWindow( display, 0 ); /* convert the id into an atom */ itematom = ClipboardGetAtomFromId( display, itemid ); /* lengths are passed in bytes, but need to specify in format units */ /* for ChangeProperty */ loc_length = length / BYTELENGTH(1,format); max_req_size = ( MAX_SELECTION_INCR( display ) ) * 8 / format; do { unsigned long next_length; if ( loc_length > max_req_size ) { next_length = max_req_size; }else{ next_length = loc_length; } if (type == 0 || type == None) type = itematom; /* put the new values in the root */ XChangeProperty( display, rootwindow, itematom, type, format, loc_mode, (unsigned char*)loc_pointer, (int) next_length ); /* Truncation of next_length.*/ loc_mode = PropModeAppend; loc_length = loc_length - next_length; loc_pointer = (char *) loc_pointer + BYTELENGTH(next_length,format); } while( loc_length > 0 ); if ( free_flag == True ) { /* note: you have to depend on the free flag, even if the length */ /* is zero, the pointer may point to non-zero-length allocated data */ XtFree( (char *) pointer ); } } /*---------------------------------------------*/ static Atom ClipboardGetAtomFromId( Display *display, itemId itemid ) { char *item; char atomname[ 100 ]; switch ( (int)itemid ) { case 0: item = XmS_MOTIF_CLIP_HEADER; break; case 1: item = XmS_MOTIF_CLIP_NEXT_ID; break; default: sprintf( atomname, "_MOTIF_CLIP_ITEM_%ld", itemid ); item = atomname; break; } return XInternAtom( display, item, False ); } /*---------------------------------------------*/ static Atom ClipboardGetAtomFromFormat( Display *display, char *format_name ) { char *atomname_format = "_MOTIF_CLIP_FORMAT_%s"; char *item; Atom ret_value; item = XtMalloc( strlen( format_name ) + strlen( atomname_format ) + 1 ); sprintf( item, atomname_format, format_name ); ret_value = XInternAtom( display, item, False ); XtFree( (char *) item ); return ret_value; } /*---------------------------------------------*/ static int ClipboardGetLenFromFormat( Display *display, char *format_name, int *format_length ) { Atom format_atom; int ret_value; Window rootwindow; unsigned long outlength; unsigned char *outpointer; Atom type; int format; unsigned long bytes_left; outpointer = NULL; format_atom = ClipboardGetAtomFromFormat( display, format_name ); rootwindow = RootWindow( display, 0 ); /* get the format record */ ret_value = XGetWindowProperty( display, rootwindow, format_atom, 0, /*offset*/ 10000000, /*length*/ False, AnyPropertyType, &type, &format, &outlength, &bytes_left, &outpointer ); if ( outpointer == 0 || outlength == 0 || ret_value !=0 ) { /* if not successful, return warning that format is not registered */ ret_value = ClipboardFail; *format_length = 8; }else{ ret_value = ClipboardSuccess; /* return the length of the format */ *format_length = *((long *)outpointer); } if (outpointer != NULL) XFree((char*)outpointer); return ret_value; } /*---------------------------------------------*/ static ClipboardHeader ClipboardOpen( Display *display, int add_length ) { int ret_value; unsigned long headerlength; ClipboardHeader root_clipboard_header; Atom headertype, type; long number ; unsigned long length; XtPointer int_ptr; ret_value = ClipboardSuccess; if ( add_length == 0 ) { /* get the clipboard header */ ret_value = ClipboardFindItem(display, XM_HEADER_ID, (XtPointer *) &root_clipboard_header, &headerlength, &headertype, 0, 0 ); } if ( add_length != 0 || ret_value != ClipboardSuccess ) { /* get the clipboard header (this will allocate memory if doesn't exist) */ ret_value = ClipboardRetrieveItem(display, XM_HEADER_ID, add_length, sizeof( ClipboardHeaderRec ), (XtPointer *) &root_clipboard_header, &headerlength, NULL, 0, 0, 0 ); /* don't discard old data */ } /* means clipboard header had not been initialized */ if ( ret_value != ClipboardSuccess ) { root_clipboard_header->recordType = XM_HEADER_RECORD_TYPE; root_clipboard_header->adjunctHeader = 0; root_clipboard_header->maxItems = 1; root_clipboard_header->currItems = 0; root_clipboard_header->dataItemList = sizeof( ClipboardHeaderRec ) / CONVERT_32_FACTOR; root_clipboard_header->nextPasteItemId = 0; root_clipboard_header->lastCopyItemId = 0; root_clipboard_header->recopyId = 0; root_clipboard_header->oldNextPasteItemId = 0; root_clipboard_header->deletedByCopyId = 0; root_clipboard_header->ownSelection = 0; root_clipboard_header->selectionTimestamp = CurrentTime; root_clipboard_header->copyFromTimestamp = CurrentTime; root_clipboard_header->foreignCopiedLength = 0; root_clipboard_header->incrementalCopyFrom = 0; root_clipboard_header->startCopyCalled = (unsigned long) False; } /* make sure "next free id" property has been initialized */ ret_value = ClipboardFindItem(display, XM_NEXT_ID, &int_ptr, &length, &type, 0, 0 ); if ( ret_value != ClipboardSuccess ) { number = XM_FIRST_FREE_ID; int_ptr = (XtPointer) &number; /* initialize the next id property */ ClipboardReplaceItem(display, XM_NEXT_ID, int_ptr, sizeof(long), PropModeReplace, 32, False, XA_INTEGER ); } else { XtFree( (char*)int_ptr ); } return root_clipboard_header; } /*---------------------------------------------*/ static void ClipboardClose( Display *display, ClipboardHeader root_clipboard_header ) { unsigned long headerlength; headerlength = sizeof( ClipboardHeaderRec ) + (root_clipboard_header -> currItems) * sizeof( itemId ); /* replace the clipboard header */ ClipboardReplaceItem(display, XM_HEADER_ID, (XtPointer)root_clipboard_header, headerlength, PropModeReplace, 32, True, XA_INTEGER ); } /*---------------------------------------------*/ static void ClipboardDeleteId( Display *display, itemId itemid ) { Window rootwindow; Atom itematom; rootwindow = RootWindow( display, 0 ); itematom = ClipboardGetAtomFromId( display, itemid ); XDeleteProperty( display, rootwindow, itematom ); } /*---------------------------------------------*/ static ClipboardFormatItem ClipboardFindFormat( Display *display, /* Display id of application wanting data */ ClipboardHeader header, char *format, itemId itemid, int n, /* if looking for nth format */ unsigned long *maxnamelength,/* receives max format name length */ int *count, /* receives next paste format count */ unsigned long *matchlength ) /* receives length of matching format */ { ClipboardDataItem queryitem; ClipboardFormatItem currformat, matchformat; unsigned long reclength ; int i, free_flag, index; itemId currformatid, queryitemid, *idptr; Atom formatatom; Atom rectype; *count = 0; *maxnamelength = 0; if ( itemid < 0 ) return 0; /* if passed an item id then use that, otherwise use next paste item */ if ( itemid != 0 ) { queryitemid = itemid; }else{ if ( header->currItems == 0 ) return 0; queryitemid = header->nextPasteItemId; } if ( queryitemid == 0 ) return 0; /* get the query item */ if (ClipboardFindItem(display, queryitemid, (XtPointer *) &queryitem, &reclength, &rectype, 0, XM_DATA_ITEM_RECORD_TYPE ) == ClipboardFail ) return 0; if ( queryitem == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return 0; } *count = queryitem->formatCount - queryitem->cancelledFormatCount; if ( *count < 0 ) *count = 0; /* point to the first format id in the list */ idptr = (itemId*)((char*)queryitem + queryitem->formatIdList * CONVERT_32_FACTOR); matchformat = 0; *matchlength = 0; index = 1; formatatom = XInternAtom( display, format, False ); /* run through all the formats for the query item looking */ /* for a name match with the input format name */ for ( i = 0; i < queryitem->formatCount; i++ ) { currformatid = *idptr; /* free the allocation unless it is the matching format */ free_flag = 1; /* get the next format */ ClipboardFindItem(display, currformatid, (XtPointer *) &currformat, &reclength, &rectype, 0, XM_FORMAT_HEADER_TYPE ); if ( currformat == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return 0; } if ( currformat->cancelledFlag == 0 ) { /* format has not been cancelled */ *maxnamelength = MAX( *maxnamelength, currformat->formatNameLength ); if (format != NULL) { if ( currformat->formatNameAtom == formatatom ) { matchformat = currformat; free_flag = 0; *matchlength = reclength; } }else{ /* we're looking for the n'th format */ if ( index == n ) { matchformat = currformat; free_flag = 0; *matchlength = reclength; } index = index + 1; } } if (free_flag == 1 ) { XtFree( (char *) currformat ); } idptr = idptr + 1; } XtFree( (char *) queryitem ); return matchformat; } /*---------------------------------------------*/ static void ClipboardDeleteFormat( Display *display, itemId formatitemid ) { itemId dataitemid; ClipboardDataItem dataitem; ClipboardFormatItem formatitem; unsigned long length ; unsigned long formatlength; Atom formattype, type; /* first get the format item out of the root */ ClipboardFindItem( display, formatitemid, (XtPointer *) &formatitem, &formatlength, &formattype, 0, XM_FORMAT_HEADER_TYPE ); if ( formatitem == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return; } if ( ( formatitem->cutByNameFlag == 0 ) || ( formatitem->cancelledFlag != 0 ) ) { /* nothing to do, data not passed by name or already cancelled */ XtFree( (char *) formatitem ); return; } dataitemid = formatitem->parentItemId; /* now get the data item out of the root */ ClipboardFindItem(display, dataitemid, (XtPointer *) &dataitem, &length, &type, 0, XM_DATA_ITEM_RECORD_TYPE ); if ( dataitem == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return; } dataitem->cancelledFormatCount = dataitem->cancelledFormatCount + 1; if ( dataitem->cancelledFormatCount == dataitem->formatCount ) { /* no formats left, mark the item for delete */ dataitem->deletePendingFlag = 1; } /* set the cancel flag on */ formatitem->cancelledFlag = 1; /* return the property on the root window for the item */ ClipboardReplaceItem(display, formatitemid, (XtPointer)formatitem, formatlength, PropModeReplace, 32, True, XA_INTEGER ); ClipboardReplaceItem(display, dataitemid, (XtPointer)dataitem, length, PropModeReplace, 32, True, XA_INTEGER); } /*---------------------------------------------*/ static void ClipboardDeleteFormats( Display *display, Window window, itemId dataitemid ) { itemId *deleteptr; ClipboardDataItem datalist; ClipboardFormatItem formatdata; unsigned long length ; Atom type; int i; /* first get the data item out of the root */ ClipboardFindItem( display, dataitemid, (XtPointer *) &datalist, &length, &type, 0, XM_DATA_ITEM_RECORD_TYPE ); if ( datalist == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return; } deleteptr = (itemId*)((char*) datalist + datalist->formatIdList * CONVERT_32_FACTOR ); for ( i = 0; i < datalist->formatCount; i++ ) { /* first delete the format data */ ClipboardFindItem( display, *deleteptr, (XtPointer *) &formatdata, &length, &type, 0, XM_FORMAT_HEADER_TYPE ); if ( formatdata == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return; } if ( formatdata->cutByNameFlag == 1 ) { /* format was cut by name */ ClipboardSendMessage( display, window, formatdata, XM_DATA_DELETE_MESSAGE ); } ClipboardDeleteId( display, formatdata->formatDataId ); XtFree( (char *) formatdata ); /* then delete the format header */ ClipboardDeleteId( display, *deleteptr ); *deleteptr = 0; deleteptr = deleteptr + 1; } XtFree( (char *) datalist ); } /*---------------------------------------------*/ /* ARGSUSED */ static void ClipboardDeleteItemLabel( Display *display, Window window, itemId dataitemid ) { ClipboardDataItem datalist; unsigned long length; Atom type; /* first get the data item out of the root */ ClipboardFindItem( display, dataitemid, (XtPointer *) &datalist, &length, &type, 0, XM_DATA_ITEM_RECORD_TYPE ); if ( datalist == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return; } /* delete item label */ ClipboardDeleteId (display, datalist->dataItemLabelId); XtFree( (char *) datalist ); } /*---------------------------------------------*/ /* ARGSUSED */ static unsigned long ClipboardIsMarkedForDelete( Display *display, ClipboardHeader header, itemId itemid ) { ClipboardDataItem curritem; unsigned long return_value, reclength; Atom rectype; if ( itemid == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return 0; } /* get the next format */ ClipboardFindItem( display, itemid, (XtPointer *) &curritem, &reclength, &rectype, 0, XM_DATA_ITEM_RECORD_TYPE ); if ( curritem == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return 0; } return_value = curritem->deletePendingFlag; XtFree( (char *) curritem ); return return_value; } /*---------------------------------------------*/ static void ClipboardDeleteItem( Display *display, Window window, ClipboardHeader header, itemId deleteid ) { int i; itemId *listptr,*thisid, *nextid, nextpasteid; int nextpasteindex; int lastflag = 0; /* find the delete id in the header item list */ listptr = (itemId*)((char*) header + header->dataItemList * CONVERT_32_FACTOR ); i = 0; nextpasteindex = 0; nextpasteid = 0; nextid = listptr; thisid = nextid; /* redo the item list */ if( !header->currItems ) { return ; } while ( i < header->currItems ) { i++ ; if (*nextid == deleteid ) { nextid++; nextpasteindex = i - 2; /* if this flag doesn't get reset, then delete item was last item */ lastflag = 1; continue; } lastflag = 0; *thisid = *nextid; thisid = thisid + 1; nextid = nextid + 1; } *thisid = 0; header->currItems = header->currItems - 1; /* if we are deleting the next paste item, then we need to find a new one */ if ( header->nextPasteItemId == deleteid ) { if ( lastflag == 1 ) { nextpasteindex = nextpasteindex - 1; } /* store this value temporarily */ i = nextpasteindex; /* now find the next paste candidate first try to find next older item to make next paste */ while ( nextpasteindex >= 0 ) { thisid = listptr + nextpasteindex; if ( !ClipboardIsMarkedForDelete( display, header, *thisid ) ) { nextpasteid = *thisid; break; } nextpasteindex = nextpasteindex - 1; } /* if didn't find a next older item, find next newer item */ if ( nextpasteid == 0 ) { /* restore this value */ nextpasteindex = i; while ( nextpasteindex < header->currItems ) { thisid = listptr + nextpasteindex; if ( !ClipboardIsMarkedForDelete( display, header, *thisid ) ) { nextpasteid = *thisid; break; } nextpasteindex = nextpasteindex + 1; } } header->nextPasteItemId = nextpasteid; header->oldNextPasteItemId = 0; } /* delete the item label */ ClipboardDeleteItemLabel( display, window, deleteid); /* delete all the formats belonging to the data item */ ClipboardDeleteFormats( display, window, deleteid ); /* now delete the item itself */ ClipboardDeleteId( display, deleteid ); /* Cleanup any callback information for ByName */ { int i; Boolean found = False; _XmProcessLock(); for(i = 0; i < maxCbProcs; i++) { found = (cbIdTable[i] == deleteid); if (found) break; } if (found) { cbProcTable[i] = NULL; cbIdTable[i] = 0; } _XmProcessUnlock(); } } /*---------------------------------------------*/ static void ClipboardDeleteMarked( Display *display, Window window, ClipboardHeader header ) { itemId *nextIdPtr; unsigned long endi, i; /* find the header item list */ nextIdPtr = (itemId*)((char*) header + header->dataItemList * CONVERT_32_FACTOR); i = 0; endi = header->currItems; /* run through the item list looking for things to delete */ while( 1 ) { if ( i >= endi ) break; i = i + 1; if ( ClipboardIsMarkedForDelete( display, header, *nextIdPtr ) ) { ClipboardDeleteItem( display, window, header, *nextIdPtr ); }else{ nextIdPtr = nextIdPtr + 1; } } } /*---------------------------------------------*/ /* ARGSUSED */ static void ClipboardMarkItem( Display *display, ClipboardHeader header, itemId dataitemid, unsigned long state ) { ClipboardDataItem itemheader; unsigned long itemlength; Atom itemtype; if ( dataitemid == 0 ) return; /* get a pointer to the item */ ClipboardFindItem(display, dataitemid, (XtPointer *) &itemheader, &itemlength, &itemtype, 0, XM_DATA_ITEM_RECORD_TYPE ); if ( itemheader == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return; } /* mark the delete pending flag */ itemheader->deletePendingFlag = state; /* return the item to the root window */ ClipboardReplaceItem(display, dataitemid, (XtPointer)itemheader, itemlength, PropModeReplace, 32, True, XA_INTEGER ); } /*---------------------------------------------*/ static int ClipboardSendMessage( Display *display, Window window, ClipboardFormatItem formatptr, int messagetype ) { enum { XmA_MOTIF_CLIP_MESSAGE, XmA_MOTIF_CLIP_DATA_REQUEST, XmA_MOTIF_CLIP_DATA_DELETE, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_CLIP_MESSAGE, XmS_MOTIF_CLIP_DATA_REQUEST, XmS_MOTIF_CLIP_DATA_DELETE }; Window widgetwindow; XClientMessageEvent event_sent; long event_mask = 0; unsigned long headerlength; ClipboardHeader root_clipboard_header; Boolean dummy; Atom headertype; Atom atoms[XtNumber(atom_names)]; widgetwindow = formatptr->cutByNameWindow; if ( widgetwindow == 0 ) return 0; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms( display, atom_names, XtNumber(atom_names), False, atoms ); event_sent.type = ClientMessage; event_sent.window = widgetwindow; event_sent.message_type = atoms[XmA_MOTIF_CLIP_MESSAGE]; event_sent.format = 32; switch ( messagetype ) { case XM_DATA_REQUEST_MESSAGE: /* get the clipboard header */ ClipboardFindItem( display, XM_HEADER_ID, (XtPointer *) &root_clipboard_header, &headerlength, &headertype, 0, 0 ); /* set the recopy item id in the header (so locking can be circumvented) */ root_clipboard_header->recopyId = formatptr->thisFormatId; /* replace the clipboard header */ ClipboardReplaceItem(display, XM_HEADER_ID, (XtPointer)root_clipboard_header, headerlength, PropModeReplace, 32, True, XA_INTEGER ); event_sent.data.l[0] = atoms[XmA_MOTIF_CLIP_DATA_REQUEST]; break; case XM_DATA_DELETE_MESSAGE: event_sent.data.l[0] = atoms[XmA_MOTIF_CLIP_DATA_DELETE]; break; } event_sent.data.l[1] = formatptr->thisFormatId; event_sent.data.l[2] = formatptr->itemPrivateId; /* is this the same application that stored the data? */ if ( formatptr->windowId == window ) { /* call the event handler directly to avoid blocking */ ClipboardEventHandler( XtWindowToWidget(display, formatptr->cutByNameWindow), 0, (XEvent *) &event_sent, &dummy ); }else{ /* if we aren't in same application that stored the data, then make sure the window still exists */ if ( !ClipboardWindowExists( display, widgetwindow )) return 0; /* send a client message to the window supplied by the user */ XSendEvent( display, widgetwindow, True, event_mask, (XEvent*)&event_sent ); } return 1; } /*---------------------------------------------*/ static int ClipboardDataIsReady( Display *display, XEvent *event, char *private_info ) { XDestroyWindowEvent *destroy_event; ClipboardCutByNameInfo cutbynameinfo; ClipboardFormatItem formatitem; unsigned long formatlength; Atom formattype; int okay; cutbynameinfo = ( ClipboardCutByNameInfo )private_info; if ( (event->type & 127) == DestroyNotify ) { destroy_event = (XDestroyWindowEvent*)event; if ( destroy_event->window == cutbynameinfo->window ) { cutbynameinfo->window = 0; return 1; } } if ( (event->type & 127) != PropertyNotify ) return 0; /* get the format item */ ClipboardFindItem( display, cutbynameinfo->formatitemid, (XtPointer *) &formatitem, &formatlength, &formattype, 0, XM_FORMAT_HEADER_TYPE ); if ( formatitem == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return 0; } okay = (int)( formatitem->cutByNameFlag == 0 ); /* release the allocation */ XtFree( (char *) formatitem ); return okay; } #if 0 /* This function is currently unused. */ /*---------------------------------------------*/ /* ARGSUSED */ static int ClipboardRequestorIsReady( Display *display, XEvent *event, char *private_info ) { XPropertyEvent *property_event; XDestroyWindowEvent *destroy_event; ClipboardDestroyInfo info; info = ( ClipboardDestroyInfo )private_info; if ( (event->type & 127) == DestroyNotify ) { destroy_event = (XDestroyWindowEvent*)event; if ( destroy_event->window == info->window ) { info->window = 0; return 1; } } if ( (event->type & 127) == PropertyNotify ) { property_event = (XPropertyEvent*)event; /* make sure we have right property and are ready */ if ( property_event->atom == info->property && property_event->state == PropertyDelete ) { return 1; } } return 0; } #endif /*---------------------------------------------*/ static int ClipboardGetSelection(Display *display, Window window, Atom target, XtPointer *value, Atom *type, unsigned long *size, int *format) { ClipboardSelectionInfoRec info; Widget dest; XtAppContext app; Atom XmA_CLIPBOARD; dest = XtWindowToWidget(display, window); if (dest == (Widget) NULL) { return(FALSE); } app = XtWidgetToApplicationContext(dest); /* initialize the fields in the info record passed to the */ /* predicate function */ info.success = FALSE; info.received = FALSE; info.data = NULL; info.count = 0; info.format = 8; info.type = None; /* ask for the data in the specified format */ XmA_CLIPBOARD = XInternAtom( display, XmSCLIPBOARD, False ); XtGetSelectionValue(dest, XmA_CLIPBOARD, target, ClipboardReceiveData, &info, XtLastTimestampProcessed(display)); #ifdef XTHREADS while (XtAppGetExitFlag(app) == False) { #else for(;;) { #endif XEvent event; XtInputMask mask; if (info.received) break; #ifndef XTHREADS XtAppNextEvent(app, &event); XtDispatchEvent(&event); #else while (!(mask = XtAppPending(app))) ; /* Busy waiting - so that we don't lose our lock */ if (mask & XtIMXEvent) { /* We have an XEvent */ /* Get the event since we know its there. * Note that XtAppNextEvent would also process * timers/alternate inputs. */ XtAppNextEvent(app, &event); /* no blocking */ XtDispatchEvent(&event); /* Process it */ } else /* not an XEvent, process it */ XtAppProcessEvent(app, mask); /* non blocking */ #endif } *value = info.data; *size = info.count; *type = info.type; *format = info.format; if (*value == NULL || *size == 0) return FALSE; return TRUE; } /*ARGSUSED*/ static void ClipboardReceiveData(Widget dest, /* unused */ XtPointer client_data, Atom *selection, /* unused */ Atom *type, XtPointer value, unsigned long *length, int *format) { ClipboardSelectionInfo info; info = ( ClipboardSelectionInfo ) client_data; info->received = TRUE; if ( *type != XT_CONVERT_FAIL ) { info -> format = *format; info -> count = BYTELENGTH(*length, *format); info -> type = *type; info -> data = (char*) value; info -> success = TRUE; } else { info -> format = 8; info -> count = 0; info -> type = None; info -> data = NULL; info -> success = FALSE; } } static int ClipboardRequestDataAndWait( Display *display, Window window, ClipboardFormatItem formatptr ) { XEvent event_return; int dataisready; unsigned long maxtime; XWindowAttributes rootattributes; Window rootwindow; ClipboardCutByNameInfoRec cutbynameinfo; Boolean timer_expired; XtAppContext app_context = NULL; XtIntervalId timerid; Widget wid; rootwindow = RootWindow( display, 0 ); /* get the current root window event mask */ XGetWindowAttributes( display, rootwindow, &rootattributes ); /* select for property notify as well as current mask */ XSelectInput( display, rootwindow, PropertyChangeMask | StructureNotifyMask | rootattributes.your_event_mask ); if ( ClipboardSendMessage( display, window, formatptr, XM_DATA_REQUEST_MESSAGE ) == 0 ) { /* put mask back the way it was */ XSelectInput( display, rootwindow, rootattributes.your_event_mask ); return 0; } cutbynameinfo.formatitemid = formatptr->thisFormatId; cutbynameinfo.window = window; dataisready = XCheckIfEvent( display, &event_return, ClipboardDataIsReady, (char*)&cutbynameinfo ); if ( cutbynameinfo.window == 0 ) { /* this means the cut by name window had been destroyed */ return 0; } /* We quit after the timeout to prevent deadlock */ wid = XtWindowToWidget(display, window); if (wid != (Widget) NULL) { app_context = XtWidgetToApplicationContext(wid); maxtime = XtAppGetSelectionTimeout(app_context); } else { maxtime = 5000; } timer_expired = False; timerid = XtAppAddTimeOut(app_context, maxtime, ClipboardTimeout, &timer_expired); #ifdef XTHREADS while( !dataisready && !timer_expired && (XtAppGetExitFlag(app_context) == False)) { #else while( !dataisready && !timer_expired) { #endif XtInputMask mask; #ifndef XTHREADS XtAppNextEvent(app_context, &event_return); dataisready = ClipboardDataIsReady(display, &event_return, (char*)&cutbynameinfo); XtDispatchEvent(&event_return); #else while (!(mask = XtAppPending(app_context))) ; /* busy waiting - don't lose lock */ if (mask & XtIMXEvent) { XtAppNextEvent(app_context, &event_return); dataisready = ClipboardDataIsReady(display, &event_return, (char*)&cutbynameinfo); XtDispatchEvent(&event_return); } else XtAppProcessEvent(app_context, mask); #endif } if (! timer_expired) XtRemoveTimeOut(timerid); if (! dataisready) return 0; /* Fail, no response */ if ( cutbynameinfo.window == 0 ) { /* this means the cut by name window had been destroyed */ return 0; } /* put mask back the way it was */ XSelectInput( display, rootwindow, rootattributes.your_event_mask ); return 1; } /*ARGSUSED*/ static void ClipboardTimeout(XtPointer client_data, XtIntervalId* timer) /* unused */ { Boolean *flag = (Boolean *) client_data; *flag = True; } /*---------------------------------------------*/ static itemId ClipboardGetNewItemId( Display *display ) { XtPointer propertynumber; unsigned long length; itemId loc_id; Atom type; ClipboardFindItem(display, XM_NEXT_ID, &propertynumber, &length, &type, 0, 0 ); loc_id = ++*((itemId*)propertynumber); ClipboardReplaceItem(display, XM_NEXT_ID, propertynumber, length, PropModeReplace, 32, True, XA_INTEGER); return loc_id; } /*---------------------------------------------*/ static void ClipboardSetAccess( Display *display, Window window ) { Atom itematom; itematom = XInternAtom( display, XmS_MOTIF_CLIP_LOCK_ACCESS_VALID, False ); /* put the clipboard lock access valid property on window */ XChangeProperty( display, window, itematom, itematom, 8, PropModeReplace, (unsigned char*)"yes", 3 ); } /*---------------------------------------------*/ static int ClipboardLock( Display *display, Window window ) { enum { XmA_MOTIF_CLIP_LOCK, XmA_CLIPBOARD, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_CLIP_LOCK, XmSCLIPBOARD }; ClipboardLockPtr lockptr; unsigned long length; Window lock_owner; Boolean take_lock = False; Atom ignoretype; Atom atoms[XtNumber(atom_names)]; _XmDisplayToAppContext(display); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms); _XmAppLock(app); lock_owner = XGetSelectionOwner (display, atoms[XmA_MOTIF_CLIP_LOCK]); if (lock_owner != window && lock_owner != None) { _XmAppUnlock(app); return (ClipboardLocked); } ClipboardFindItem (display, XM_LOCK_ID, (XtPointer *)&lockptr, &length, &ignoretype, 0, 0); if (length == 0) /* create new lock property */ { lockptr = (ClipboardLockPtr)XtMalloc(sizeof(ClipboardLockRec)); lockptr->lockLevel = 0; } if (lockptr->lockLevel == 0) /* new or invalid V1.0 lock. Take the lock */ { lockptr->windowId = window; lockptr->lockLevel = 1; take_lock = True; } else if (lockptr->windowId == window) /* already have the lock */ { lockptr->lockLevel += 1; } else /* another client has the lock */ { if (ClipboardWindowExists (display, lockptr->windowId)) { XtFree ((char *)lockptr); _XmAppUnlock(app); return (ClipboardLocked); } else /* locking client has gone away, clipboard may be corrupted */ { ClipboardHeader header; Window owner = XGetSelectionOwner (display, atoms[XmA_CLIPBOARD]); Time timestamp = ClipboardGetCurrentTime(display); /* Drop the selection if a Motif client owns it */ header = ClipboardOpen (display, 0); if (header->ownSelection == owner) { XSetSelectionOwner (display, XmA_CLIPBOARD, None, timestamp); } ClipboardClose (display, header); /* Reset the header property */ CleanupHeader (display); header = ClipboardOpen (display, 0); ClipboardClose (display, header); /* Take the lock */ lockptr->windowId = window; lockptr->lockLevel = 1; take_lock = True; } } if (take_lock == True) { if (XGetSelectionOwner (display, atoms[XmA_MOTIF_CLIP_LOCK]) == None) { XSetSelectionOwner (display, atoms[XmA_MOTIF_CLIP_LOCK], window, ClipboardGetCurrentTime(display)); if (XGetSelectionOwner (display, atoms[XmA_MOTIF_CLIP_LOCK]) != window) { XtFree ((char *)lockptr); _XmAppUnlock(app); return (ClipboardLocked); } } else { XtFree ((char *)lockptr); _XmAppUnlock(app); return (ClipboardLocked); } } ClipboardReplaceItem (display, XM_LOCK_ID, (XtPointer)lockptr, sizeof(ClipboardLockRec), PropModeReplace, 32, False, XA_INTEGER ); ClipboardSetAccess (display, window); XtFree ((char *)lockptr); _XmAppUnlock(app); return (ClipboardSuccess); } /*---------------------------------------------*/ static int ClipboardUnlock( Display *display, Window window, #if NeedWidePrototypes int all_levels ) #else Boolean all_levels ) #endif /* NeedWidePrototypes */ { unsigned long length; ClipboardLockPtr lockptr; Atom _MOTIF_CLIP_LOCK = XInternAtom (display, XmS_MOTIF_CLIP_LOCK, False); Window lock_owner = XGetSelectionOwner (display, _MOTIF_CLIP_LOCK); Boolean release_lock = False; Atom ignoretype; if (lock_owner != window && lock_owner != None) return (ClipboardFail); ClipboardFindItem (display, XM_LOCK_ID, (XtPointer *)&lockptr, &length, &ignoretype, 0, 0); if (length == 0) /* There is no lock property */ { return (ClipboardFail); } if ( lockptr->windowId != window ) /* Someone else has the lock */ { XtFree ((char *)lockptr); return (ClipboardFail); } /* do the unlock */ if (all_levels == 0) { lockptr->lockLevel -= 1; }else{ lockptr->lockLevel = 0; } if (lockptr->lockLevel <= 0) { length = 0; release_lock = True; }else{ length = sizeof(ClipboardLockRec); } ClipboardReplaceItem (display, XM_LOCK_ID, (XtPointer)lockptr, length, PropModeReplace, 32, False, XA_INTEGER); XtFree ((char *)lockptr); if (release_lock == True) { XSetSelectionOwner (display, _MOTIF_CLIP_LOCK, None, ClipboardGetCurrentTime(display)); } return (ClipboardSuccess); } /*---------------------------------------------*/ static int ClipboardSearchForWindow( Display *display, Window parentwindow, Window window ) { /* recursively search the roots descendant tree for the given window */ Window rootwindow, p_window, *children; unsigned int numchildren; int found, i; Window *windowptr; if (XQueryTree( display, parentwindow, &rootwindow, &p_window, &children, &numchildren ) == 0) { return (0); } found = 0; windowptr = children; /* now search through the list for the window */ for ( i = 0; i < numchildren; i++ ) { if ( *windowptr == window ) { found = 1; }else{ found = ClipboardSearchForWindow( display, *windowptr, window); } if ( found == 1 ) break; windowptr = windowptr + 1; } XtFree( (char*)children ); return found; } /*---------------------------------------------*/ static int ClipboardWindowExists( Display *display, Window window ) { Window rootwindow; Atom itematom; int exists; unsigned long outlength; unsigned char *outpointer; Atom type; int format; unsigned long bytes_left; outpointer = NULL; rootwindow = RootWindow( display, 0 ); exists = ClipboardSearchForWindow( display, rootwindow, window ); if ( exists == 1 ) { /* see if the window has the lock activity property, for if it doesn't then this is a new assignment of the window id and the lock is bogus due to a crash of the application with the original locking window */ itematom = XInternAtom(display, XmS_MOTIF_CLIP_LOCK_ACCESS_VALID, False); XGetWindowProperty( display, window, itematom, 0, /*offset*/ 10000000, /*length*/ False, AnyPropertyType, &type, &format, &outlength, &bytes_left, &outpointer ); if ( outpointer == 0 || outlength == 0 ) { /* not the same window that locked the clipboard */ exists = 0; } if(outpointer != NULL) XFree((char*)outpointer); } return exists; } /*---------------------------------------------*/ /* external routines */ /*---------------------------------------------*/ /*---------------------------------------------*/ int XmClipboardBeginCopy( Display *display, /* display id for application passing data */ Window window, /* window to receive request for cut by name data */ XmString label, /* label to be associated with data item */ Widget widget, /* only for cut by name */ VoidProc callback,/* addr of callback routine for cut by name */ long *itemid ) /* received id to identify this data item */ { return(XmClipboardStartCopy( display, window, label, CurrentTime, widget, (XmCutPasteProc)callback, itemid )); } /*---------------------------------------------*/ int XmClipboardStartCopy( Display *display, /* display id for application passing data */ Window window, /* window to receive request for cut by name data */ XmString label, /* label to be associated with data item */ Time timestamp, /* timestamp of event triggering copy to clipboard */ Widget widget, /* only for cut by name */ XmCutPasteProc callback,/* addr of callback routine for cut by name */ long *itemid ) /* received id to identify this data item */ { ClipboardHeader header; ClipboardDataItem itemheader; unsigned long itemlength; itemId loc_itemid; int status; char *asn1string; int asn1strlen; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } /* get the clipboard header, make sure clipboard is initialized */ header = ClipboardOpen( display, 0 ); header->selectionTimestamp = timestamp; header->startCopyCalled = (unsigned long) True; /* allocate storage for the data item */ itemlength = sizeof( ClipboardDataItemRec ); itemheader = (ClipboardDataItem)XtMalloc( (size_t) itemlength ); loc_itemid = ClipboardGetNewItemId( display ); /* initialize fields in the data item */ itemheader->thisItemId = loc_itemid; itemheader->adjunctData = 0; itemheader->recordType = XM_DATA_ITEM_RECORD_TYPE; itemheader->displayId = display; itemheader->windowId = window; itemheader->dataItemLabelId = ClipboardGetNewItemId( display ); itemheader->formatIdList = itemlength / CONVERT_32_FACTOR; /* offset */ itemheader->formatCount = 0; itemheader->cancelledFormatCount = 0; itemheader->deletePendingFlag = 0; itemheader->permanentItemFlag = 0; itemheader->cutByNameFlag = 0; itemheader->cutByNameCBIndex = -1; itemheader->cutByNameWidget = 0; itemheader->cutByNameWindow = 0; if ( callback != 0 && widget != 0 ) { int i = 0; Boolean found = False; _XmProcessLock(); while(i < maxCbProcs && ! found) { if (cbProcTable[i] == NULL) found = True; else i++; } if (! found) { int oldLimit = maxCbProcs; maxCbProcs += 20; /* Need to extend tables */ cbProcTable = (XmCutPasteProc *) XtRealloc((char*) cbProcTable, sizeof(XmCutPasteProc) * maxCbProcs); cbIdTable = (long *) XtRealloc((char*) cbIdTable, sizeof(long) * maxCbProcs); for(i = oldLimit; i < maxCbProcs; i++) { cbProcTable[i] = NULL; cbIdTable[i] = 0; } i = oldLimit; } cbProcTable[i] = callback; cbIdTable[i] = itemheader->thisItemId; _XmProcessUnlock(); /* set up client message handling if widget passed */ itemheader->cutByNameCBIndex = i; itemheader->cutByNameWidget = widget; itemheader->cutByNameWindow = XtWindow( widget ); ClipboardSetAccess( display, itemheader->cutByNameWindow ); } if (label != NULL) { asn1strlen = XmCvtXmStringToByteStream(label, (unsigned char **) &asn1string); /* store the label */ ClipboardReplaceItem(display, itemheader->dataItemLabelId, (XtPointer) asn1string, asn1strlen, PropModeReplace, 8, False, XInternAtom(display, XmS_MOTIF_COMPOUND_STRING, False)); XtFree(asn1string); } /* return the item to the root window */ ClipboardReplaceItem(display, loc_itemid, (XtPointer)itemheader, itemlength, PropModeReplace, 32, True, XA_INTEGER ); if ( itemid != 0 ) { *itemid = (long)loc_itemid; } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /* The following code is a workaround for UTM to pass in the type of the to be copied data. It is a bug in the clipboard interface that the type information cannot be passed in. Note that when Motif goes to multithread safety, anything calling _XmClipboardPassType will need to have a critical section around that call and the call to XmClipboardCopy or XmClipboardCopyByName */ static Atom _passed_type = None; void _XmClipboardPassType(Atom type) { _XmProcessLock(); _passed_type = type; _XmProcessUnlock(); } int XmClipboardCopy( Display *display, /* Display id of application passing data */ Window window, long itemid, /* id returned from begin copy */ char *format, /* Name string for data format */ XtPointer buffer, /* Address of buffer holding data in this format */ unsigned long length, /* Length of the data */ long private_id, /* Private id provide by application */ long *dataid ) /* Data id returned by clipboard */ { ClipboardDataItem itemheader; ClipboardHeader header; ClipboardFormatItem formatptr; char *formatdataptr; itemId formatid, formatdataid, *idptr; char *to_ptr; int status, count, format_len ; unsigned long maxname, formatlength, itemlength, formatdatalength; Atom type; _XmDisplayToAppContext(display); _XmAppLock(app); _XmProcessLock(); if (_passed_type != None) { type = _passed_type; _passed_type = None; } else { type = GetTypeFromTarget(display, XInternAtom(display, format, False)); } _XmProcessUnlock(); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } /* get the clipboard header */ header = ClipboardOpen( display, 0 ); if (!header->startCopyCalled) { XmeWarning(NULL, XM_CLIPBOARD_MESSAGE1); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardFail; } /* first check to see if the format already exists for this item */ formatptr = ClipboardFindFormat(display, header, format, (itemId) itemid, 0, &maxname, &count, &formatlength ); /* if format doesn't exist, then have to access the data item record */ if ( formatptr == 0 ) { /* get a pointer to the item */ status = ClipboardRetrieveItem(display, (itemId)itemid, sizeof( itemId ), 0, (XtPointer *) &itemheader, &itemlength, NULL, 0, XM_DATA_ITEM_RECORD_TYPE, 0 ); if (status != ClipboardSuccess) { ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return (status); } itemheader->formatCount = itemheader->formatCount + 1; if ((itemheader->formatCount * 2 + 2) >= XM_ITEM_ID_INC) { XmeWarning(NULL, XM_CLIPBOARD_MESSAGE3); XtFree( (char *)itemheader); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardFail; } formatlength = sizeof( ClipboardFormatItemRec ); /* allocate local storage for the data format record */ formatptr = (ClipboardFormatItem)XtMalloc( (size_t) formatlength ); formatid = ClipboardGetNewItemId( display ); formatdataid = ClipboardGetNewItemId( display ); /* put format record id in data item's format id list */ idptr = (itemId*)( (char *)itemheader + (itemlength - sizeof(itemId)) ); *idptr = formatid; /* initialize the fields in the format record */ formatptr->recordType = XM_FORMAT_HEADER_TYPE; formatptr->formatNameAtom = XInternAtom( display, format, False ); formatptr->itemLength = 0; formatptr->formatNameLength = strlen( format ); formatptr->formatDataId = formatdataid; formatptr->thisFormatId = formatid; formatptr->itemPrivateId = private_id; formatptr->cancelledFlag = 0; formatptr->copiedLength = 0; formatptr->parentItemId = itemid; formatptr->cutByNameWidget = itemheader->cutByNameWidget; formatptr->cutByNameWindow = itemheader->cutByNameWindow; formatptr->cutByNameCBIndex = itemheader->cutByNameCBIndex; formatptr->windowId = itemheader->windowId; formatptr->displayId = itemheader->displayId; /* if buffer is null then it is a pass by name */ if ( buffer != 0 ) { formatptr->cutByNameFlag = 0; formatdatalength = length; }else{ itemheader->cutByNameFlag = 1; formatptr->cutByNameFlag = 1; formatdatalength = sizeof(Atom); /* we want a property stored regardless */ } if( ClipboardGetLenFromFormat( display, format, &format_len ) == ClipboardFail) { /* if it's one of the predefined formats, register it for second try */ XmClipboardRegisterFormat(display, format, 0); ClipboardGetLenFromFormat( display, format, &format_len ); } /* return the property on the root window for the item */ ClipboardReplaceItem(display, itemid, (XtPointer)itemheader, itemlength, PropModeReplace, 32, True, XA_INTEGER ); formatdataptr = XtMalloc( (size_t) formatdatalength ); to_ptr = formatdataptr; }else{ formatid = formatptr->thisFormatId; formatdataid = formatptr->formatDataId; /* the format already existed so get the data and append */ ClipboardRetrieveItem(display, formatdataid, (int) length, /* BAD NEWS: truncation here.*/ 0, (XtPointer *) &formatdataptr, &formatdatalength, NULL, &format_len, 0, 0 ); to_ptr = (char *)formatdataptr + (formatdatalength - length); } if ( buffer != 0 ) { /* copy the format data over to acquired storage */ memcpy( to_ptr, buffer, (size_t) length ); } formatptr->itemLength += length/((format_len==32)?CONVERT_32_FACTOR:1); /* replace the property on the root window for the format data */ ClipboardReplaceItem(display, formatdataid, formatdataptr, formatdatalength, PropModeReplace, format_len, /* 8, 16, or 32 */ True, type ); /* replace the property on the root window for the format */ ClipboardReplaceItem(display, formatid, (XtPointer)formatptr, formatlength, PropModeReplace, 32, True, XA_INTEGER); if ( dataid != 0 ) { *dataid = formatid; } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardEndCopy( Display *display, Window window, long itemid ) { ClipboardDataItem itemheader; ClipboardHeader header; itemId *itemlist; unsigned long itemlength ; long newitemoffset; itemId *newitemaddr; int status; Atom itemtype; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } /* get the clipboard header */ header = ClipboardOpen( display, sizeof( itemId ) ); if (!header->startCopyCalled) { XmeWarning(NULL, XM_CLIPBOARD_MESSAGE2); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardFail; } ClipboardDeleteMarked( display, window, header ); if (header->currItems >= header->maxItems) { itemlist = (itemId*)((char *) header + header->dataItemList * CONVERT_32_FACTOR); /* mark least recent item for deletion and delete previously mark */ ClipboardMarkItem( display, header, *itemlist, XM_DELETE ); header->deletedByCopyId = *itemlist; } else { header->deletedByCopyId = 0; } newitemoffset = header->dataItemList + (header->currItems * sizeof( itemId ) / CONVERT_32_FACTOR); /* stick new item at the bottom of the list */ newitemaddr = (itemId*)((char *) header + newitemoffset * CONVERT_32_FACTOR); *newitemaddr = (itemId)itemid; /* new items always become next paste item */ header->oldNextPasteItemId = header->nextPasteItemId; header->nextPasteItemId = (itemId)itemid; header->lastCopyItemId = (itemId)itemid; header->currItems = header->currItems + 1; header->startCopyCalled = False; /* if there was a cut by name format, then set up event handling */ ClipboardFindItem(display, itemid, (XtPointer *) &itemheader, &itemlength, &itemtype, 0, XM_DATA_ITEM_RECORD_TYPE ); if ( itemheader == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return ClipboardFail; } if ( itemheader->cutByNameWindow != 0 ) { EventMask event_mask = 0; XtAddEventHandler( XtWindowToWidget(display, itemheader->cutByNameWindow), event_mask, TRUE, ClipboardEventHandler, 0 ); } XtFree( (char *) itemheader ); AssertClipboardSelection(display, window, header, header->selectionTimestamp ); ClipboardSetNextItemId(display, itemid); ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardCancelCopy( Display *display, Window window, long itemid ) /* id returned by begin copy */ { itemId deleteitemid; itemId previous; XtPointer int_ptr; unsigned long length; ClipboardHeader header; Atom type; _XmDisplayToAppContext(display); _XmAppLock(app); if ( ClipboardLock( display, window) == ClipboardLocked ) { _XmAppUnlock(app); return(ClipboardLocked); } deleteitemid = (itemId)itemid; /* first, free up the properties set by the StartCopy and Copy calls */ /* delete the item label */ ClipboardDeleteItemLabel( display, window, deleteitemid); /* delete all the formats belonging to the data item */ ClipboardDeleteFormats( display, window, deleteitemid ); /* now delete the item itself */ ClipboardDeleteId( display, deleteitemid ); /******************************************************************* * reset the startCopyCalled flag and reset the XM_NEXT_ID property * it's value prior to StartCopy. *******************************************************************/ ClipboardFindItem( display, XM_NEXT_ID, &int_ptr, &length, &type, 0, 0 ); previous = itemid - 1; *(long *) int_ptr = previous; ClipboardReplaceItem( display, XM_NEXT_ID, int_ptr, sizeof(long), PropModeReplace, 32, True, XA_INTEGER ); header = ClipboardOpen( display, 0); header->startCopyCalled = False; ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return(ClipboardSuccess); } /*---------------------------------------------*/ int XmClipboardWithdrawFormat( Display *display, Window window, long data ) /* data id of format no longer provided by application */ { int status; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } ClipboardDeleteFormat( display, data ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardCopyByName( Display *display, /* Display id of application passing data */ Window window, long data, /* Data id returned previously by clipboard */ XtPointer buffer, /* Address of buffer holding data in this format */ unsigned long length, /* Length of the data */ long private_id ) /* Private id provide by application */ { ClipboardFormatItem formatheader; int format; char *formatdataptr; unsigned long formatlength, formatdatalength; char *to_ptr; int status, locked; unsigned long headerlength; ClipboardHeader root_clipboard_header; Atom headertype, formattype; Atom type; _XmDisplayToAppContext(display); _XmAppLock(app); /* get the clipboard header */ ClipboardFindItem( display, XM_HEADER_ID, (XtPointer *) &root_clipboard_header, &headerlength, &headertype, 0, 0 ); locked = 0; /* if this is a recopy as the result of a callback, then circumvent */ /* any existing lock */ if ( root_clipboard_header->recopyId != data ) { status = ClipboardLock( display, window ); if ( status == ClipboardLocked ){ _XmAppUnlock(app); return ClipboardLocked; } locked = 1; }else{ root_clipboard_header->recopyId = 0; /* replace the clipboard header */ ClipboardReplaceItem(display, XM_HEADER_ID, (XtPointer)root_clipboard_header, headerlength, PropModeReplace, 32, False, XA_INTEGER ); } /* get a pointer to the format */ if ( ClipboardFindItem(display, data, (XtPointer *) &formatheader, &formatlength, &formattype, 0, XM_FORMAT_HEADER_TYPE ) == ClipboardSuccess ) { formatheader->itemPrivateId = private_id; ClipboardRetrieveItem(display, formatheader->formatDataId, (int) length,/* BAD NEWS: truncation here.*/ 0, (XtPointer *) &formatdataptr, &formatdatalength, &formattype, &format, 0, formatheader->cutByNameFlag ); if (formatheader->cutByNameFlag) formatheader->itemLength = length/((format==32)?CONVERT_32_FACTOR:1); else formatheader->itemLength += length/((format==32)?CONVERT_32_FACTOR:1); /* if cut by name, discard any old data */ formatheader->cutByNameFlag = 0; to_ptr = (char *) formatdataptr + (formatdatalength - length); /* copy the format data over to acquired storage */ memcpy( to_ptr, buffer, (size_t) length ); /* If we've passed in a new type from UTM, use it, otherwise we'll use the type on the clipboard (for compatibility with old mechanism) */ _XmProcessLock(); if (_passed_type != None) { type = _passed_type; _passed_type = None; } else { type = formattype; } _XmProcessUnlock(); /* create the property on the root window for the format data */ ClipboardReplaceItem(display, formatheader->formatDataId, formatdataptr, formatdatalength, PropModeReplace, format, True, type ); /* change the property on the root window for the format item */ ClipboardReplaceItem(display, data, (XtPointer)formatheader, formatlength, PropModeReplace, 32, True, XA_INTEGER); } else { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return ClipboardFail; } if ( locked ) { ClipboardUnlock( display, window, 0 ); } XtFree( (char *) root_clipboard_header ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardUndoCopy( Display *display, Window window ) { ClipboardHeader header; ClipboardDataItem itemheader; unsigned long itemlength; itemId itemid; int status, undo_okay; Atom itemtype; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } /* note: second call to undo, undoes the first call */ /* get the clipboard header */ header = ClipboardOpen( display, 0 ); itemid = header->lastCopyItemId; undo_okay = 0; if ( itemid == 0 ) { undo_okay = 1; } else { /* get the item */ ClipboardFindItem( display, itemid, (XtPointer *) &itemheader, &itemlength, &itemtype, 0, XM_DATA_ITEM_RECORD_TYPE ); if ( itemheader == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return ClipboardFail; } /* if no last copy item or if the item's window or display don't match, then can't undo */ if ( itemheader->windowId == window ) { undo_okay = 1; /* mark last item for delete */ ClipboardMarkItem( display, header, itemid, XM_DELETE ); } XtFree( (char*)itemheader ); } if ( undo_okay ) { /* fetch the item marked deleted by the last copy, if any */ itemid = header->deletedByCopyId; /* mark it undeleted */ ClipboardMarkItem( display, header, itemid, XM_UNDELETE ); /* switch item marked deleted */ header->deletedByCopyId = header->lastCopyItemId; header->lastCopyItemId = itemid; /* switch next paste and old next paste */ itemid = header->oldNextPasteItemId; header->oldNextPasteItemId = header->nextPasteItemId; header->nextPasteItemId = itemid; } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardLock( Display *display, Window window ) /* identifies application owning lock */ { int ret_val; _XmDisplayToAppContext(display); _XmAppLock(app); ret_val = ClipboardLock( display, window ); _XmAppUnlock(app); return ret_val; } /*---------------------------------------------*/ int XmClipboardUnlock( Display *display, Window window, /* specifies window owning lock, must match window */ #if NeedWidePrototypes /* passed to clipboardlock */ int all_levels ) #else Boolean all_levels ) #endif /* NeedWidePrototypes */ { int ret_val; _XmDisplayToAppContext(display); _XmAppLock(app); ret_val = ClipboardUnlock( display, window, all_levels ); _XmAppUnlock(app); return ret_val; } /*---------------------------------------------*/ int XmClipboardStartRetrieve( Display *display, /* Display id of application wanting data */ Window window, Time timestamp ) { ClipboardHeader header; int status; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } header = ClipboardOpen( display, 0 ); header->incrementalCopyFrom = True; header->copyFromTimestamp = timestamp; header->foreignCopiedLength = 0; ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardEndRetrieve( Display *display, /* Display id of application wanting data */ Window window ) { ClipboardHeader header; _XmDisplayToAppContext(display); _XmAppLock(app); header = ClipboardOpen( display, 0 ); header->incrementalCopyFrom = False; header->copyFromTimestamp = CurrentTime; ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardRetrieve( Display *display, /* Display id of application wanting data */ Window window, char *format, /* Name string for data format */ XtPointer buffer, /* Address of buffer to receive data in this format */ unsigned long length, /* Length of the data buffer */ unsigned long *outlength,/* Length of the data transferred to buffer */ long *private_id ) /* Private id provide by application */ { Atom ignoretype; int ret_val; _XmDisplayToAppContext(display); _XmAppLock(app); ret_val = ClipboardRetrieve(display, window, format, buffer, length, outlength, private_id, &ignoretype); _XmAppUnlock(app); return ret_val; } static int ClipboardRetrieve(Display *display, Window window, char *format, XtPointer buffer, unsigned long length, unsigned long *outlength, long *private_id, Atom *outtype) { ClipboardHeader header; ClipboardFormatItem matchformat; char *formatdata; unsigned long formatdatalength ; unsigned long matchformatlength; Atom matchformattype; int truncate, count; unsigned long maxname ; itemId matchid; char *ptr; int status, dataok, outformatsize; unsigned long loc_outlength; itemId loc_private; unsigned long copiedlength, remaininglength; Time timestamp; status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) return ClipboardLocked; /* get the clipboard header */ header = ClipboardOpen( display, 0 ); timestamp = header->copyFromTimestamp; loc_outlength = 0; loc_private = 0; truncate = 0; dataok = 0; ptr = NULL; /* check to see if we need to reclaim the selection */ InitializeSelection( display, header, window, timestamp ); /* get the data from clipboard or selection owner */ if ( WeOwnSelection( display, header ) ) { /* we own the selection */ /* find the matching format for the next paste item */ matchformat = ClipboardFindFormat(display, header, format, (itemId) NULL, 0, &maxname, &count, &matchformatlength ); if (matchformat != 0) { dataok = 1; matchid = matchformat->thisFormatId; if ( matchformat->cutByNameFlag == 1 ) { /* passed by name */ /* Note: This code is now partially copied into another function, ClipboardGetByNameItem, so updates in this section should be reflected there */ dataok = ClipboardRequestDataAndWait(display, window, matchformat); if ( dataok ) { /* re-check out matchformat since it may have changed */ XtFree( (char *) matchformat ); ClipboardFindItem(display, matchid, (XtPointer *) &matchformat, &matchformatlength, &matchformattype, 0, XM_FORMAT_HEADER_TYPE ); if ( matchformat == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return ClipboardFail; } } } if ( dataok ) { ClipboardFindItem(display, matchformat->formatDataId, (XtPointer *) &formatdata, &formatdatalength, outtype, 0, 0 ); if ( formatdata == 0 ) { CleanupHeader (display); ClipboardError( CLIPBOARD_CORRUPT, CORRUPT_DATA_STRUCTURE ); return ClipboardFail; } copiedlength = matchformat->copiedLength; ptr = formatdata + copiedlength; remaininglength = formatdatalength - copiedlength; if ( length < remaininglength ) { loc_outlength = length; truncate = 1; }else{ loc_outlength = remaininglength; } if ( header->incrementalCopyFrom ) { /* update the copied length */ if ( loc_outlength == remaininglength ) { /* we've copied everything, so reset */ matchformat->copiedLength = 0; }else{ matchformat->copiedLength = matchformat->copiedLength + loc_outlength; } } loc_private = matchformat->itemPrivateId; } ClipboardReplaceItem(display, matchid, (XtPointer)matchformat, matchformatlength, PropModeReplace, 32, True, XA_INTEGER ); } /* Unfortunately the clipboard routines don't have a type interface. Go ask for a type if type is bogus */ if (*outtype == None) *outtype = GetTypeFromTarget(display, XInternAtom(display, format, False)); }else{ /* we don't own the selection, get the data from selection owner */ if ( ClipboardGetSelection(display, window, XInternAtom(display, format, False), (XtPointer *) &formatdata, outtype, &loc_outlength, &outformatsize ) ) { /* we're okay */ dataok = 1; /* copiedlength = header->foreignCopiedLength; */ copiedlength = 0; /* No incr. for now. Fix after beta */ ptr = formatdata + copiedlength; remaininglength = loc_outlength - copiedlength; if ( length < remaininglength ) { loc_outlength = length; truncate = 1; }else{ loc_outlength = remaininglength; } if ( header->incrementalCopyFrom ) { /* update the copied length */ if ( loc_outlength == remaininglength ) { /* we've copied everything, so reset */ header->foreignCopiedLength = 0; }else{ header->foreignCopiedLength = header->foreignCopiedLength + loc_outlength; } } } } if ( dataok ) { /* copy the data to the user buffer */ memcpy( buffer, ptr, (size_t) loc_outlength ); XtFree( (char *) formatdata ); } /* try to prevent access violation even if outlength is mandatory */ if ( outlength != 0 ) { *outlength = loc_outlength; } if ( private_id != 0 ) { *private_id = loc_private; } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); if (truncate == 1) return ClipboardTruncate; if (dataok == 0) return ClipboardNoData; return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardInquireCount( Display *display, Window window, int *count, /* receives number of formats in next paste item */ unsigned long *maxlength )/* receives max length of format names */ { ClipboardHeader header; char *alloc_to_free; unsigned long loc_maxlength, loc_matchlength; unsigned long loc_count_len ; int status; int loc_count ; Atom ignoretype; int ignoreformat; Time timestamp; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } /* get the clipboard header */ header = ClipboardOpen( display, 0 ); /* If StartRetrieve wasn't called use latest Timestamp from server */ if ( header->copyFromTimestamp == CurrentTime ) { timestamp = ClipboardGetCurrentTime(display); }else{ timestamp = header->copyFromTimestamp; } /* check to see if we need to reclaim the selection */ InitializeSelection( display, header, window, timestamp ); loc_maxlength = 0; loc_count = 0; /* do we own the selection? */ if ( WeOwnSelection( display, header ) ) { /* yes, find the next paste item, only looking for maxlength and count */ alloc_to_free = (char*)ClipboardFindFormat( display, header, 0, (itemId) NULL, 0, &loc_maxlength, &loc_count, &loc_matchlength ); }else{ /* we don't own the selection, get the data from selection owner */ if ( !ClipboardGetSelection(display, window, XInternAtom(display, XmSTARGETS, False), (XtPointer *) &alloc_to_free, &ignoretype, &loc_count_len, &ignoreformat ) ) { _XmAppUnlock(app); return ClipboardNoData; }else{ /* we obtained a TARGETS type selection conversion */ Atom *atomptr; int i; atomptr = (Atom*)alloc_to_free; /* returned count is in bytes, targets are atoms of length sizeof(long) */ loc_count = (int) loc_count_len / sizeof(Atom); /* max the lengths of all the atom names */ for( i = 0; i < loc_count; i++ ) { int temp; if ((*atomptr) != (Atom)0) { char *str; str = XGetAtomName( display, *atomptr ); temp = strlen(str); XFree(str); if ( temp > loc_maxlength) { loc_maxlength = temp; } } atomptr++; } } } if ( maxlength != 0 ) { /* user asked for max length of available format names */ *maxlength = loc_maxlength; } if ( count != 0 ) { *count = loc_count; } if ( alloc_to_free != 0 ) { XtFree( (char *) alloc_to_free ); } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } /*---------------------------------------------*/ int XmClipboardInquireFormat( Display *display, /* Display id of application inquiring */ Window window, int n, /* Which format for this data item? */ XtPointer buffer, /* Address of buffer to receive format name */ unsigned long bufferlength, /* Length of the buffer */ unsigned long *outlength ) /* Receives length copied to name buffer */ { ClipboardHeader header; ClipboardFormatItem matchformat; char *alloc_to_free; char *ptr; int count; unsigned long loc_matchlength, maxname, loc_outlength ; int status; Atom ignoretype; int ignoreformat; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } status = ClipboardSuccess; /* get the clipboard header */ header = ClipboardOpen( display, 0 ); /* check to see if we need to reclaim the selection */ InitializeSelection( display, header, window, header->copyFromTimestamp ); ptr = NULL; loc_outlength = 0; /* do we own the selection? */ if ( WeOwnSelection( display, header ) ) { /* retrieve the matching format */ matchformat = ClipboardFindFormat(display, header, 0, (itemId) NULL, n, &maxname, &count, &loc_matchlength ); if ( matchformat != 0 ) { ptr = XGetAtomName( display, matchformat->formatNameAtom ); XtFree( (char *) matchformat ); } else { status = ClipboardNoData; } }else{ /* we don't own the selection, get the data from selection owner */ if ( !ClipboardGetSelection(display, window, XInternAtom(display, XmSTARGETS, False), (XtPointer *) &alloc_to_free, &ignoretype, &loc_matchlength, &ignoreformat ) ) { *outlength = 0; _XmAppUnlock(app); return ClipboardNoData; } else { /* we obtained a TARGETS type selection conversion */ Atom *nth_atom; nth_atom = (Atom*)alloc_to_free; /* returned count is in bytes, targets are atoms of length sizeof(long) */ loc_matchlength = loc_matchlength / sizeof(Atom); if ( loc_matchlength >= n ) { nth_atom = nth_atom + n - 1; ptr = XGetAtomName( display, *nth_atom ); XtFree( (char *) alloc_to_free ); } } } if ( ptr != 0 ) { loc_outlength = strlen( ptr ); if ( loc_outlength > bufferlength ) { status = ClipboardTruncate; loc_outlength = bufferlength; } strncpy( (char *) buffer, ptr, (unsigned) loc_outlength ); /* loc_outlenght is truncated above.*/ XtFree( (char *) ptr ); } if ( outlength != 0 ) { *outlength = loc_outlength; } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return status; } /*---------------------------------------------*/ int XmClipboardInquireLength( Display *display, /* Display id of application inquiring */ Window window, char *format, /* Name string for data format */ unsigned long *length )/* Receives length of the data in that format */ { ClipboardHeader header; ClipboardFormatItem matchformat; char *alloc_to_free; int count ; unsigned long loc_length, maxname, loc_matchlength; Atom ignoretype; int ignoreformat; int status; int format_len; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } /* get the clipboard header */ header = ClipboardOpen( display, 0 ); /* check to see if we need to reclaim the selection */ InitializeSelection( display, header, window, header->copyFromTimestamp ); loc_length = 0; /* do we own the selection? */ if ( WeOwnSelection( display, header ) ) { /* retrieve the next paste item */ matchformat = ClipboardFindFormat(display, header, format, (itemId) NULL, 0, &maxname, &count, &loc_matchlength); /* return the length */ if ( matchformat != 0 ) { if ( CONVERT_32_FACTOR != 1 ) { ClipboardGetLenFromFormat( display, format, &format_len ); loc_length = matchformat->itemLength * ((format_len==32)?CONVERT_32_FACTOR:1); } else { loc_length = matchformat->itemLength; } XtFree( (char *) matchformat ); } else { status = ClipboardNoData; } }else{ /* we don't own the selection, get the data from selection owner */ if ( !ClipboardGetSelection(display, window, XInternAtom(display, format, False), (XtPointer *) &alloc_to_free, &ignoretype, &loc_length, &ignoreformat ) ) { _XmAppUnlock(app); return ClipboardNoData; }else{ XtFree( (char *) alloc_to_free ); } } if ( length != 0 ) { *length = loc_length; } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return status; } /*---------------------------------------------*/ int XmClipboardInquirePendingItems( Display *display, /* Display id of application passing data */ Window window, char *format, /* Name string for data format */ XmClipboardPendingList *list, unsigned long *count ) /* Number of items in returned list */ { ClipboardHeader header; ClipboardFormatItem matchformat; XmClipboardPendingList itemlist, nextlistptr; itemId *id_ptr; int loc_count, i; unsigned long maxname, loc_matchlength; int status; _XmDisplayToAppContext(display); _XmAppLock(app); status = ClipboardLock( display, window ); if ( status == ClipboardLocked ) { _XmAppUnlock(app); return ClipboardLocked; } if ( list == 0 ) { /* just get out to avoid access violation */ ClipboardUnlock( display, window, 0 ); _XmAppUnlock(app); return ClipboardSuccess; } *list = 0; loc_count = 0; /* get the clipboard header */ header = ClipboardOpen( display, 0 ); id_ptr = (itemId*)((char *) header + header->dataItemList * CONVERT_32_FACTOR); itemlist = (XmClipboardPendingList)XtMalloc( (size_t) (header->currItems * sizeof( XmClipboardPendingRec))); nextlistptr = itemlist; /* run through all the items in the clipboard looking for matching formats */ for ( i = 0; i < header->currItems; i++ ) { /* if it is marked for delete, skip it */ if ( ClipboardIsMarkedForDelete( display, header, *id_ptr ) ) { matchformat = 0; }else{ int dummy; /* see if there is a matching format */ matchformat = ClipboardFindFormat( display, header, format, *id_ptr, 0, &maxname, &dummy, &loc_matchlength ); } if ( matchformat != 0 ) { /* found matching format */ if ( matchformat->cutByNameFlag == 1 ) { /* it was passed by name so is pending */ nextlistptr->DataId = matchformat->thisFormatId; nextlistptr->PrivateId = matchformat->itemPrivateId; nextlistptr = nextlistptr + 1; loc_count = loc_count + 1; } XtFree( (char *) matchformat ); } id_ptr = id_ptr + 1; } ClipboardClose( display, header ); ClipboardUnlock( display, window, 0 ); if ( count != 0 ) { *count = loc_count; } *list = itemlist; _XmAppUnlock(app); return status; } /*---------------------------------------------*/ int XmClipboardRegisterFormat( Display *display, /* Display id of application passing data */ char *format_name, /* Name string for data format */ int format_length ) /* Format length 8-16-32 */ { int ret_val; _XmDisplayToAppContext(display); _XmAppLock(app); if ( format_length != 0 && format_length != 8 && format_length != 16 && format_length != 32 ) { XmeWarning ( NULL, BAD_FORMAT ); _XmAppUnlock(app); return ClipboardBadFormat; } if ( format_name == 0 || strlen( format_name ) == 0 ) { XmeWarning ( NULL, BAD_FORMAT_NON_NULL ); } else { /* make sure predefined formats are registered */ /* use dummy format as a test, if not found then register the rest */ if ( format_length != 0 ) { ret_val = RegisterFormat( display, format_name, format_length ); _XmAppUnlock(app); return ret_val; } else { /* caller asking to look through predefines for format name */ if ( RegIfMatch(display, format_name, XmSTARGETS, XM_ATOM) || RegIfMatch(display, format_name, XmSMULTIPLE, XM_ATOM_PAIR) || RegIfMatch(display, format_name, XmSTIMESTAMP, XM_INTEGER) || RegIfMatch(display, format_name, "STRING", XM_STRING) || RegIfMatch(display, format_name, XmSCOMPOUND_TEXT, XM_COMPOUND_TEXT) || RegIfMatch(display, format_name, XmILIST_LENGTH, XM_INTEGER) || RegIfMatch(display, format_name, "PIXMAP", XM_DRAWABLE) || RegIfMatch(display, format_name, "DRAWABLE", XM_DRAWABLE) || RegIfMatch(display, format_name, "BITMAP", XM_BITMAP) || RegIfMatch(display, format_name, XmIFOREGROUND, XM_PIXEL) || RegIfMatch(display, format_name, XmIBACKGROUND, XM_PIXEL) || RegIfMatch(display, format_name, "COLORMAP", XM_COLORMAP) || RegIfMatch(display, format_name, XmIODIF, XM_TEXT) || RegIfMatch(display, format_name, XmIOWNER_OS, XM_TEXT) || RegIfMatch(display, format_name, XmSFILE_NAME, XM_TEXT) || RegIfMatch(display, format_name, XmIHOST_NAME, XM_TEXT) || RegIfMatch(display, format_name, XmICHARACTER_POSITION, XM_SPAN) || RegIfMatch(display, format_name, XmILINE_NUMBER, XM_SPAN) || RegIfMatch(display, format_name, XmICOLUMN_NUMBER, XM_SPAN) || RegIfMatch(display, format_name, XmSLENGTH, XM_INTEGER) || RegIfMatch(display, format_name, XmIUSER, XM_TEXT) || RegIfMatch(display, format_name, XmIPROCEDURE, XM_TEXT) || RegIfMatch(display, format_name, XmIMODULE, XM_TEXT) || RegIfMatch(display, format_name, XmIPROCESS, XM_INTEGER) || RegIfMatch(display, format_name, XmITASK, XM_INTEGER) || RegIfMatch(display, format_name, XmICLASS, XM_TEXT) || RegIfMatch(display, format_name, XmINAME, XM_TEXT) || RegIfMatch(display, format_name, XmSCLIENT_WINDOW, XM_WINDOW) #ifdef UTF8_SUPPORTED || RegIfMatch(display, format_name, XmSUTF8_STRING, XM_UTF8_STRING) #endif ) { _XmAppUnlock(app); return ClipboardSuccess; } } } _XmAppUnlock(app); return ClipboardFail; } /********************************************************************* * GetTypeFromTarget * * This function makes an attempt to get a suitable type for a * particular target. This isn't perfect, but much better than * the old clipboard method which simply used the target as the * type. Most requestors won't care, and they definitely won't * via the clipboard routines, as these have no type parameter. * But UTM and other ICCCM clients care *********************************************************************/ static Atom GetTypeFromTarget(Display *display, Atom target) { enum { XmAATOM_PAIR, XmABACKGROUND, XmACHARACTER_POSITION, XmACLASS, XmACOLUMN_NUMBER, XmAFOREGROUND, XmAHOST_NAME, XmALINE_NUMBER, XmALIST_LENGTH, XmAMODULE, XmANAME, XmANone, XmAODIF, XmAOWNER_OS, XmAPIXEL, XmAPROCEDURE, XmAPROCESS, XmASPAN, XmATASK, XmAUSER, XmACLIENT_WINDOW, XmADELETE, XmAFILE, XmAFILE_NAME, XmAINSERT_PROPERTY, XmAINSERT_SELECTION, XmALENGTH, XmALINK_SELECTION, XmAMULTIPLE, XmATARGETS, XmATEXT, XmATIMESTAMP, XmA_MOTIF_CLIPBOARD_TARGETS, XmA_MOTIF_DEFERRED_CLIPBOARD_TARGETS, XmA_MOTIF_ENCODING_REGISTRY, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_RENDER_TABLE, #ifdef UTF8_SUPPORTED XmAUTF8_STRING, #endif NUM_ATOMS }; static char *atom_names[] = { XmIATOM_PAIR, XmIBACKGROUND, XmICHARACTER_POSITION, XmICLASS, XmICOLUMN_NUMBER, XmIFOREGROUND, XmIHOST_NAME, XmILINE_NUMBER, XmILIST_LENGTH, XmIMODULE, XmINAME, XmINone, XmIODIF, XmIOWNER_OS, XmIPIXEL, XmIPROCEDURE, XmIPROCESS, XmISPAN, XmITASK, XmIUSER, XmSCLIENT_WINDOW, XmSDELETE, XmSFILE, XmSFILE_NAME, XmSINSERT_PROPERTY, XmSINSERT_SELECTION, XmSLENGTH, XmSLINK_SELECTION, XmSMULTIPLE, XmSTARGETS, XmSTEXT, XmSTIMESTAMP, XmS_MOTIF_CLIPBOARD_TARGETS, XmS_MOTIF_DEFERRED_CLIPBOARD_TARGETS, XmS_MOTIF_ENCODING_REGISTRY, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_RENDER_TABLE, #ifdef UTF8_SUPPORTED XmSUTF8_STRING #endif }; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms); if (target == atoms[XmATARGETS] || target == atoms[XmA_MOTIF_EXPORT_TARGETS] || target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS] || target == atoms[XmA_MOTIF_DEFERRED_CLIPBOARD_TARGETS]) return(XA_ATOM); if (target == atoms[XmAMULTIPLE]) return(atoms[XmAATOM_PAIR]); if (target == atoms[XmATIMESTAMP] || target == atoms[XmALIST_LENGTH] || target == atoms[XmAPROCESS] || target == atoms[XmATASK] || target == atoms[XmALENGTH]) return(XA_INTEGER); if (target == atoms[XmATEXT] || target == atoms[XmAODIF] || target == atoms[XmAOWNER_OS] || target == atoms[XmAFILE_NAME] || target == atoms[XmAFILE] || target == atoms[XmAHOST_NAME] || target == atoms[XmAUSER] || target == atoms[XmAPROCEDURE] || target == atoms[XmAMODULE] || target == atoms[XmACLASS] || target == atoms[XmANAME]) { int ret_status = 0; XTextProperty tmp_prop; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ Atom encoding; tmp_prop.value = NULL; ret_status = XmbTextListToTextProperty(display, &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (ret_status == Success) encoding = tmp_prop.encoding; else encoding = None; /* XmbTextList... should always be able * to convert XPCS characters; but in * case its broken, this prevents a core * dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); return(encoding); } if (target == XA_PIXMAP) return(XA_DRAWABLE); if (target == atoms[XmAFOREGROUND] || target == atoms[XmABACKGROUND]) return(atoms[XmAPIXEL]); if (target == atoms[XmACHARACTER_POSITION] || target == atoms[XmALINE_NUMBER] || target == atoms[XmACOLUMN_NUMBER]) return(atoms[XmASPAN]); if (target == atoms[XmACLIENT_WINDOW]) return(XA_WINDOW); if (target == atoms[XmADELETE] || target == atoms[XmAINSERT_SELECTION] || target == atoms[XmALINK_SELECTION] || target == atoms[XmAINSERT_PROPERTY]) return(atoms[XmANone]); if (target == atoms[XmA_MOTIF_ENCODING_REGISTRY] || target == atoms[XmA_MOTIF_RENDER_TABLE]) return(XA_STRING); return(target); /* by default */ } motif-2.3.8/lib/Xm/CacheP.h0000644000175000017500000000271413145162623012220 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCacheP_h #define _XmCacheP_h #include #ifdef __cplusplus extern "C" { #endif /* A few convenience macros */ #define ClassCacheHead(cp) ((cp)->cache_head) #define ClassCacheCopy(cp) ((cp)->cache_copy) #define ClassCacheCompare(cp) ((cp)->cache_compare) #define CacheDataPtr(p) ((XtPointer)&((XmGadgetCacheRef*)p)->data) #define DataToGadgetCache(p) ((char*)p - XtOffsetOf(XmGadgetCacheRef,data)) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCacheP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ComboBox2P.h0000644000175000017500000001153612672140200013000 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCombinationBox2P_h_ #define _XmCombinationBox2P_h_ #include #include #ifdef __cplusplus extern "C" { #endif #define XmCombinationBox2_UP XmDropDown_UP #define XmCombinationBox2_UNPOSTED XmDropDown_UNPOSTED #define XmCombinationBox2_DOWN XmDropDown_DOWN #define XmCombinationBox2_POSTED XmDropDown_POSTED #define XmCombinationBox2_IN_PROGRESS XmDropDown_IN_PROGRESS #define XmCombinationBox2_BEGIN_POPUP_FROM_TEXT \ XmDropDown_BEGIN_POPUP_FROM_TEXT #define XmComboBox2_h_space(w) (((XmCombinationBox2Widget)(w))->combo.h_space) #define XmComboBox2_v_space(w) (((XmCombinationBox2Widget)(w))->combo.v_space) #define XmComboBox2_popup_offset(w) (((XmCombinationBox2Widget)(w))->combo.popup_offset) #define XmComboBox2_verify(w) (((XmCombinationBox2Widget)(w))->combo.verify) #define XmComboBox2_editable(w) (((XmCombinationBox2Widget)(w))->combo.editable) #define XmComboBox2_show_label(w) (((XmCombinationBox2Widget)(w))->combo.show_label) #define XmComboBox2_customized_combo_box(w) (((XmCombinationBox2Widget)(w))->combo.customized_combo_box) #define XmComboBox2_use_text_field(w) (((XmCombinationBox2Widget)(w))->combo.use_text_field) #define XmComboBox2_popup_shell(w) (((XmCombinationBox2Widget)(w))->combo.popup_shell) #define XmComboBox2_popup_cursor(w) (((XmCombinationBox2Widget)(w))->combo.popup_cursor) #define XmComboBox2_translations(w) (((XmCombinationBox2Widget)(w))->combo.translations) #define XmComboBox2_verify_text_callback(w) (((XmCombinationBox2Widget)(w))->combo.verify_text_callback) #define XmComboBox2_verify_text_failed_callback(w) (((XmCombinationBox2Widget)(w))->combo.verify_text_failed_callback) #define XmComboBox2_update_text_callback(w) (((XmCombinationBox2Widget)(w))->combo.update_text_callback) #define XmComboBox2_update_shell_callback(w) (((XmCombinationBox2Widget)(w))->combo.update_shell_callback) #define XmComboBox2_visible_items(w) (((XmCombinationBox2Widget)(w))->combo.visible_items) #define XmComboBox2_new_visual_style(w) (((XmCombinationBox2Widget)(w))->combo.new_visual_style) #define XmComboBox2_old_text(w) (((XmCombinationBox2Widget)(w))->combo.old_text) #define XmComboBox2_focus_owner(w) (((XmCombinationBox2Widget)(w))->combo.focus_owner) #define XmComboBox2_focus_state(w) (((XmCombinationBox2Widget)(w))->combo.focus_state) #define XmComboBox2_list_state(w) (((XmCombinationBox2Widget)(w))->combo.list_state) #define XmComboBox2_text_x(w) (((XmCombinationBox2Widget)(w))->combo.text_x) #define XmComboBox2_list(w) (((XmCombinationBox2Widget)(w))->combo.list) #define XmComboBox2_label(w) (((XmCombinationBox2Widget)(w))->combo.label) #define XmComboBox2_text(w) (((XmCombinationBox2Widget)(w))->combo.text) #define XmComboBox2_arrow(w) (((XmCombinationBox2Widget)(w))->combo.arrow) #define XmComboBox2_autoTraversal(w) (((XmCombinationBox2Widget)(w))->combo.autoTraversal) #define XmComboBox2_activateOnFill(w) (((XmCombinationBox2Widget)(w))->combo.activateOnFill) #define XmComboBox2_doActivate(w) (((XmCombinationBox2Widget)(w))->combo.doActivate) #define XmComboBox2_inValueChanged(w) (((XmCombinationBox2Widget)(w))->combo.inValueChanged) /* Should return True to ignore invalid entry warning. Combination Box * does not currently use this. Presumes do it in subclasses */ typedef Boolean (*XmCombinationBox2TextProc)( Widget, char *text ); typedef Boolean (*XmCombinationBox2TextListMapProc)( Widget, /* combo box */ Widget, /* text */ Widget /* list */ ); /* Version number for the first Revision */ #define XmCombinationBox2ExtensionVersion 2 typedef XmDropDownClassPart XmCombinationBox2ClassPartExtension; typedef XmDropDownClassPart XmCombinationBox2ClassPart; typedef XmDropDownClassRec XmCombinationBox2ClassRec; typedef XmDropDownPart XmCombinationBox2Part; typedef XmDropDownRec XmCombinationBox2Rec; extern XmCombinationBox2ClassRec xmCombinationBox2ClassRec XM_DEPRECATED; #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #endif /* _XmCombinationBox2P_h_ */ motif-2.3.8/lib/Xm/DrArrow.c0000644000175000017500000002262112672140200012436 00000000000000/* $XConsortium: DrArrow.c /main/6 1995/10/25 19:59:56 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include /****************************XmeDrawArrow**********************************/ void XmeDrawArrow(Display *display, Drawable d, GC top_gc, GC bot_gc, GC cent_gc, #if NeedWidePrototypes int x, int y, int width, int height, int shadow_thick, unsigned int direction) #else Position x, Position y, Dimension width, Dimension height, Dimension shadow_thick, unsigned char direction) #endif /* NeedWidePrototypes */ { /* cent_gc might be NULL, which means don't draw anything on the center, but if shadow_thick is 1, then center is not NULL, see in ArrowB */ /* in the current implementation, on shadow_thick = 2, 1 or 0 supported */ static unsigned int allocated = 0; static XRectangle * top = NULL; static XRectangle * cent = NULL; static XRectangle * bot = NULL; XRectangle * rect_tmp; int size, xOffset = 0, yOffset = 0, wwidth, start; register int temp, yy, i, h, w; short t = 0 , b = 0 , c = 0 ; XtAppContext app; if (!d) return ; app = XtDisplayToApplicationContext(display); _XmAppLock(app); /* Get the size and the position and allocate the rectangle lists */ if (width > height) { size = height - 2; xOffset = (width - height) / 2; } else { size = width - 2 ; yOffset = (height - width) / 2; } if (size < 1) { _XmAppUnlock(app); return; } if (allocated < size) { _XmProcessLock(); top = (XRectangle *) XtRealloc ((char*)top, sizeof (XRectangle) * (size/2+6)); cent = (XRectangle *) XtRealloc ((char*)cent, sizeof (XRectangle) * (size/2+6)); bot = (XRectangle *) XtRealloc ((char*)bot, sizeof (XRectangle) * (size/2+6)); allocated = size; _XmProcessUnlock(); } #define SWAP(x,y) temp = x ; x = y; y = temp if (direction == XmARROW_RIGHT || direction == XmARROW_LEFT) { SWAP(xOffset,yOffset) ; } /* Set up a loop to generate the segments. */ wwidth = size; yy = size - 1 + yOffset; start = 1 + xOffset; _XmProcessLock(); while (wwidth > 0) { if (wwidth == 1) { top[t].x = start; top[t].y = yy + 1; top[t].width = 1; top[t].height = 1; t++; } else if (wwidth == 2) { if (size == 2 || (direction == XmARROW_UP || direction == XmARROW_LEFT)) { top[t].x = start; top[t].y = yy; top[t].width = 2; top[t].height = 1; t++; top[t].x = start; top[t].y = yy + 1; top[t].width = 1; top[t].height = 1; t++; bot[b].x = start + 1; bot[b].y = yy + 1; bot[b].width = 1; bot[b].height = 1; b++; } } else { if (start == 1 + xOffset) { if (direction == XmARROW_UP || direction == XmARROW_LEFT) { top[t].x = start; top[t].y = yy; top[t].width = 2; top[t].height = 1; t++; top[t].x = start; top[t].y = yy + 1; top[t].width = 1; top[t].height = 1; t++; bot[b].x = start + 1; bot[b].y = yy + 1; bot[b].width = 1; bot[b].height = 1; b++; bot[b].x = start + 2; bot[b].y = yy; bot[b].width = wwidth - 2; bot[b].height = 2; b++; } else { top[t].x = start; top[t].y = yy; top[t].width = 2; top[t].height = 1; t++; bot[b].x = start; bot[b].y = yy + 1; bot[b].width = 2; bot[b].height = 1; b++; bot[b].x = start + 2; bot[b].y = yy; bot[b].width = wwidth - 2; bot[b].height = 2; b++; } } else { top[t].x = start; top[t].y = yy; top[t].width = 2; top[t].height = 2; t++; bot[b].x = start + wwidth - 2; bot[b].y = yy; bot[b].width = 2; bot[b].height = 2; if (wwidth == 3) { bot[b].width = 1; bot[b].x += 1; } b++; if (wwidth > 4) { cent[c].x = start + 2; cent[c].y = yy; cent[c].width = wwidth - 4; cent[c].height = 2; c++; } } } start++; wwidth -= 2; yy -= 2; } if (direction == XmARROW_DOWN || direction == XmARROW_RIGHT) { rect_tmp = top; top = bot; bot = rect_tmp; SWAP(t, b); } /* Transform the "up" pointing arrow to the correct direction */ switch (direction) { case XmARROW_LEFT: i = -1; do { i++; if (i < t) { SWAP(top[i].y, top[i].x); SWAP(top[i].width, top[i].height); } if (i < b) { SWAP(bot[i].y, bot[i].x); SWAP(bot[i].width, bot[i].height); } if (i < c) { SWAP(cent[i].y, cent[i].x); SWAP(cent[i].width, cent[i].height); } } while (i < t || i < b || i < c); break; case XmARROW_RIGHT: h = height - 2; w = width - 2; i = -1; do { i++; if (i < t) { SWAP(top[i].y, top[i].x); SWAP(top[i].width, top[i].height); top[i].x = w - top[i].x - top[i].width + 2; top[i].y = h - top[i].y - top[i].height + 2; } if (i < b) { SWAP(bot[i].y, bot[i].x); SWAP(bot[i].width, bot[i].height); bot[i].x = w - bot[i].x - bot[i].width + 2; bot[i].y = h - bot[i].y - bot[i].height + 2; } if (i < c) { SWAP(cent[i].y, cent[i].x); SWAP(cent[i].width, cent[i].height); cent[i].x = w - cent[i].x - cent[i].width + 2; cent[i].y = h - cent[i].y - cent[i].height + 2; } } while (i < t || i < b || i < c); break; case XmARROW_DOWN: w = width - 2; h = height - 2; i = -1; do { i++; if (i < t) { top[i].x = w - top[i].x - top[i].width + 2; top[i].y = h - top[i].y - top[i].height + 2; } if (i < b) { bot[i].x = w - bot[i].x - bot[i].width + 2; bot[i].y = h - bot[i].y - bot[i].height + 2; } if (i < c) { cent[i].x = w - cent[i].x - cent[i].width + 2; cent[i].y = h - cent[i].y - cent[i].height + 2; } } while (i < t || i < b || i < c); break; } if (x != 0 || y != 0) { for (i = 0; i < t; i++) { top[i].x += x; top[i].y += y; } for (i = 0; i < c; i++) { cent[i].x += x; cent[i].y += y; } for (i = 0; i < b; i++) { bot[i].x += x; bot[i].y += y; } } if (shadow_thick) { /* 1 or 2 shadow thickness: always draw 2 thickness at that point, we'll correct it later */ XFillRectangles (display, d, top_gc, top, t); XFillRectangles (display, d, bot_gc, bot, b); } else { /* handle the case where arrow shadow_thickness = 0, which give a flat arrow: draw the shadow area with the center color */ if (cent_gc) { XFillRectangles (display, d, cent_gc, top, t); XFillRectangles (display, d, cent_gc, bot, b); } } if (shadow_thick == 1) { /* we already drawn the shadow of 2, now let's draw a bigger center area: ask for a smaller arrow with flat look */ XmeDrawArrow(display, d, top_gc, bot_gc, cent_gc, x+1, y+1, width-2, height-2, 0, direction) ; } else if (cent_gc) XFillRectangles (display, d, cent_gc, cent, c); _XmProcessUnlock(); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/ListP.h0000644000175000017500000001472513145162623012135 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmListP_h #define _XmListP_h #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* List struct passed to Convert proc for drag and drop */ typedef struct _XmListDragConvertStruct { Widget w; XmString *strings; int num_strings; } XmListDragConvertStruct; /* List class structure */ typedef struct _XmListClassPart { XtPointer extension; /* Pointer to extension record */ } XmListClassPart; /* Full class record declaration for List class */ typedef struct _XmListClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmListClassPart list_class; } XmListClassRec; externalref XmListClassRec xmListClassRec; /* Internal form of the list elements. */ typedef struct { Dimension height; Dimension width; Boolean selected; Boolean last_selected; Boolean LastTimeDrawn; int length; wchar_t first_char; } Element, *ElementPtr; /* The List instance record */ typedef struct _XmListPart { Dimension spacing; short ItemSpacing; Dimension margin_width; Dimension margin_height; XmFontList font; XmString *items; int itemCount; XmString *selectedItems; int *selectedPositions; /* "selectedIndices" in Motif 1.2 */ int selectedItemCount; int visibleItemCount; int LastSetVizCount; unsigned char SelectionPolicy; unsigned char ScrollBarDisplayPolicy; unsigned char SizePolicy; XmStringDirection StrDir; XtEnum AutoSelect; Boolean DidSelection; Boolean FromSetSB; Boolean FromSetNewSize; unsigned char SelectionMode; /* "Boolean AddMode" in Motif 1.2 */ unsigned char LeaveDir; unsigned char HighlightThickness; int ClickInterval; XtIntervalId DragID; XtCallbackList SingleCallback; XtCallbackList MultipleCallback; XtCallbackList ExtendCallback; XtCallbackList BrowseCallback; XtCallbackList DefaultCallback; GC NormalGC; GC InverseGC; GC HighlightGC; Pixmap DashTile; /* unused in Motif 1.2 */ ElementPtr *InternalList; int LastItem; /* position of last item in list */ int FontHeight; /* unused in Motif 1.2 */ int top_position; char Event; int LastHLItem; /* These fields specify the boundaries of the selection (i.e. * the current selection) as specified by the "selected" field * of the InternalList elements and the boundaries of the * last_selected selection (i.e. the previous selection) as * specified by the "last_selected" field of the InternalList * elements. */ int StartItem; int OldStartItem; int EndItem; int OldEndItem; Position BaseX; Position BaseY; /* MouseMoved: unused resource from Motif1.2, used now in the * CheckSetRenderTable default proc (see List.c). */ Boolean MouseMoved; Boolean AppendInProgress; Boolean Traversing; Boolean KbdSelection; short DownCount; Time DownTime; int CurrentKbdItem; /* position of location cursor */ unsigned char SelectionType; GC InsensitiveGC; int vmin; /* unused in Motif 1.2 */ int vmax; /* unused in Motif 2.0 */ int vOrigin; /* unused in Motif 2.0 */ int vExtent; /* unused in Motif 2.0 */ int hmin; /* slider minimum coordiate position */ int hmax; /* slider maximum coordiate position */ int hOrigin; /* slider edge location */ int hExtent; /* slider size */ Dimension MaxWidth; Dimension CharWidth; /* unused in Motif 1.2 */ Position XOrigin; XmScrollBarWidget hScrollBar; XmScrollBarWidget vScrollBar; XmScrolledWindowWidget Mom; Dimension MaxItemHeight; /*--- New fields in Motif 2.0. ---*/ int selectedPositionCount; unsigned char matchBehavior; /* The AutoSelectionType is used to designate where in the selection * process the user currently is when auto select is enabled. For * instance, during an extended select, there is a beginning to * the selection, possible mouse motions and finally a button release * resulting in either a selection identical to what was selected * before the beginning or to a selection that is different. */ unsigned char AutoSelectionType; /* PrimaryOwnership is used to describe how the list show take * ownership of the primary selection when the user selects list * items, with a possible value of NEVER. */ unsigned char PrimaryOwnership; XtCallbackList DestinationCallback; /* Selection rendition fields */ XmRendition scratchRend; Pixel selectColor; /* This field is used to house the top position of the list before a * scrolling action begins. If the scrolling action is cancelled, then * we restore the list top position by using this field. When scrolling * by directly using the scroll bar, we don't need this field since the * scroll frame trait handles the reset. When scrolling by selecting * items and dragging off the edge of the list, we need to use this * field to reset the list position when a user presses the cancel key. */ int previous_top_position; XtIntervalId drag_start_timer; char * drag_abort_action; XEvent drag_event; XmListDragConvertStruct *drag_conv; } XmListPart; /* Full instance record declaration */ typedef struct _XmListRec { CorePart core; XmPrimitivePart primitive; XmListPart list; } XmListRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmListP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Ext18List.h0000644000175000017500000001362312672140200012632 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmExt18List_h_ #define _XmExt18List_h_ #if defined(__cplusplus) extern "C" { #endif #include #include externalref WidgetClass xmExt18ListWidgetClass XM_DEPRECATED; enum { XmEXT18LIST_FOUND = XmMULTILIST_FOUND, XmEXT18LIST_NOT_FOUND = XmMULTILIST_NOT_FOUND }; typedef XmMultiListWidgetClass *XmExt18ListWidgetClass; typedef XmMultiListWidget *XmExt18ListWidget; typedef XmMultiListRowInfo Xm18RowInfo; typedef XmMultiListCallbackStruct XmExt18ListCallbackStruct; /* * Function Name: XmExt18ListGetSelectedRows * Description: Takes an Extended List and returns a NULL terminated array * of pointers to selected rows from the internal list * Arguments: w - the extended list widget * Returns: Xm18RowInfo ** */ Xm18RowInfo ** XmExt18ListGetSelectedRows(Widget w) XM_DEPRECATED; /* Function Name: XmCreateExtended18List * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ extern Widget XmCreateExtended18List(Widget, String, ArgList, Cardinal) XM_DEPRECATED; extern Widget XmCreateExt18List(Widget, String, ArgList, Cardinal) XM_DEPRECATED; extern Widget XmVaCreateExt18List( Widget parent, char *name, ...) XM_DEPRECATED; extern Widget XmVaCreateManagedExt18List( Widget parent, char *name, ...) XM_DEPRECATED; /* Function Name: XmExt18ListUnselectAllItems * Description: Unselects all rows * Arguments: w - the ilist widget. * Returns: none */ extern void XmExt18ListUnselectAllItems(Widget w) XM_DEPRECATED; /* Function Name: XmExt18ListUnselectItem * Description: Unselects the row passed in * Arguments: w - the ilist widget. * row_info - ptr to the row passed in * Returns: none */ extern void XmExt18ListUnselectItem(Widget, Xm18RowInfo *) XM_DEPRECATED; /* Function Name: XmExt18ListToggleRow * Description: Toggles the selection state of a specified row * Arguments: w - the extended list widget * Returns: none */ extern void XmExt18ListToggleRow(Widget, short) XM_DEPRECATED; /* Function Name: XmExt18ListSelectItems * Description: Set selection state by matching column entries to XmString * Arguments: w - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * notify - if True, call XmNsingleSelectionCallback * Returns: none */ extern void XmExt18ListSelectItems(Widget, XmString, int, Boolean) XM_DEPRECATED; /* Function Name: XmExt18ListDeselectItems * Description: Set selection state by matching column entries to XmString * Arguments: w - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * Returns: none */ extern void XmExt18ListDeselectItems(Widget, XmString, int) XM_DEPRECATED; /* Function Name: XmExt18ListSelectAllItems * Description: Set selection state on all rows * Arguments: w - the extended list widget * notify - if True, call XmNsingleSelectionCallback for each * Returns: none */ extern void XmExt18ListSelectAllItems(Widget, Boolean) XM_DEPRECATED; /* Function Name: XmExt18ListSelectRow * Description: Set selection state on all rows * Arguments: w - the extended list widget * row - the row to select * notify - if True, call XmNsingleSelectionCallback * Returns: none */ extern void XmExt18ListSelectRow(Widget, int, Boolean) XM_DEPRECATED; /* Function Name: XmExt18ListDeselectRow * Description: Set selection state on all rows * Arguments: w - the extended list widget * row - the row to select * Returns: none */ extern void XmExt18ListDeselectRow(Widget, int) XM_DEPRECATED; /* * Function Name: XmExt18ListGetSelectedRowArray * Description: Takes an Extended List and returns a NULL terminated array * of pointers to selected rows from the internal list * Arguments: w - the extended list widget * num_rows - pointer to the number of rows * Returns: array of integer (selected) row numbers */ extern int *XmExt18ListGetSelectedRowArray(Widget, int *) XM_DEPRECATED; /* Function Name: XmExt18ListMakeRowVisible * Description: Shifts the visible extended list rows as desired * Arguments: w - the extended list widget * row - the row number wished to be made visible * Returns: none */ void XmExt18ListMakeRowVisible(Widget, int) XM_DEPRECATED; #if defined(__cplusplus) } #endif #endif /* _XmExt18List_h_ */ motif-2.3.8/lib/Xm/BaseClassP.h0000644000175000017500000001264713145162623013063 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmBaseClassP_h #define _XmBaseClassP_h #ifndef _XmNO_BC_INCL #define _XmNO_BC_INCL #endif #include #ifdef __cplusplus extern "C" { #endif #define _XmBCEPTR(wc) ((XmBaseClassExt *)(&(((WidgetClass)(wc))\ ->core_class.extension))) #define _XmBCE(wc) ((XmBaseClassExt)(((WidgetClass)(wc))\ ->core_class.extension)) #define _XmGetBaseClassExtPtr(wc, owner) \ ((_XmBCE(wc) && (((_XmBCE(wc))->record_type) == owner)) ? \ _XmBCEPTR(wc) : \ ((XmBaseClassExt *) _XmGetClassExtensionPtr( \ ((XmGenericClassExt *) \ _XmBCEPTR( wc)), \ owner))) /* defines for 256 bit (at least) bit field */ #define _XmGetFlagsBit(field, bit) \ (field[ (bit >> 3) ]) & (1 << (bit & 0x07)) #define _XmSetFlagsBit(field, bit) \ (field[ (bit >> 3) ] |= (1 << (bit & 0x07))) #ifndef XTHREADS #define _XmFastSubclassInit(wc, bit_field) { \ if((_Xm_fastPtr = _XmGetBaseClassExtPtr( wc, XmQmotif)) && \ (*_Xm_fastPtr)) \ _XmSetFlagsBit((*_Xm_fastPtr)->flags, bit_field) ; \ } /* _XmGetBaseClassExtPtr can return NULL or a pointer to a NULL extension, * for non Motif classes in particular, so we check that up front. * We use the global _Xm_fastPtr for that purpose, this variable exists * already in BaseClass.c for apparently no other use. */ #define _XmIsFastSubclass(wc, bit) \ ((_Xm_fastPtr = _XmGetBaseClassExtPtr((wc),XmQmotif)) && \ (*_Xm_fastPtr)) ? \ (_XmGetFlagsBit(((*_Xm_fastPtr)->flags), bit) ? TRUE : FALSE) \ : FALSE #else extern void _XmFastSubclassInit(WidgetClass, unsigned int); extern Boolean _XmIsFastSubclass(WidgetClass, unsigned int); #endif /* XTHREADS */ #define XmBaseClassExtVersion 2L #define XmBaseClassExtVersion 2L typedef Cardinal (*XmGetSecResDataFunc)( WidgetClass, XmSecondaryResourceData **); typedef struct _XmObjectClassExtRec{ XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; } XmObjectClassExtRec, *XmObjectClassExt; typedef struct _XmGenericClassExtRec{ XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; } XmGenericClassExtRec, *XmGenericClassExt; typedef struct _XmWrapperDataRec{ struct _XmWrapperDataRec *next; WidgetClass widgetClass; XtInitProc initializeLeaf; XtSetValuesFunc setValuesLeaf; XtArgsProc getValuesLeaf; XtRealizeProc realize; XtWidgetClassProc classPartInitLeaf; XtWidgetProc resize; XtGeometryHandler geometry_manager; /* init_depth is obselete now .. */ Cardinal init_depth; int initializeLeafCount; int setValuesLeafCount; int getValuesLeafCount; XtInitProc constraintInitializeLeaf; XtSetValuesFunc constraintSetValuesLeaf; int constraintInitializeLeafCount; int constraintSetValuesLeafCount; } XmWrapperDataRec, *XmWrapperData; typedef struct _XmBaseClassExtRec{ XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; XtInitProc initializePrehook; XtSetValuesFunc setValuesPrehook; XtInitProc initializePosthook; XtSetValuesFunc setValuesPosthook; WidgetClass secondaryObjectClass; XtInitProc secondaryObjectCreate; XmGetSecResDataFunc getSecResData; unsigned char flags[32]; XtArgsProc getValuesPrehook; XtArgsProc getValuesPosthook; XtWidgetClassProc classPartInitPrehook; XtWidgetClassProc classPartInitPosthook; XtResourceList ext_resources; XtResourceList compiled_ext_resources; Cardinal num_ext_resources; Boolean use_sub_resources; XmWidgetNavigableProc widgetNavigable; XmFocusChangeProc focusChange; XmWrapperData wrapperData; } XmBaseClassExtRec, *XmBaseClassExt; typedef struct _XmWidgetExtDataRec{ Widget widget; Widget reqWidget; Widget oldWidget; } XmWidgetExtDataRec, *XmWidgetExtData; externalref XrmQuark XmQmotif; externalref int _XmInheritClass; externalref XmBaseClassExt * _Xm_fastPtr; /******** Private Function Declarations ********/ extern XmGenericClassExt * _XmGetClassExtensionPtr( XmGenericClassExt *listHeadPtr, XrmQuark owner) ; extern Boolean _XmIsSubclassOf(WidgetClass wc, WidgetClass sc); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmBaseClassP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ToggleBG.h0000644000175000017500000000550713145162623012532 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /*********************************************************************** * * Toggle Gadget * ***********************************************************************/ #ifndef _XmToggleG_h #define _XmToggleG_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmToggleButtonGadgetClass; typedef struct _XmToggleButtonGadgetClassRec *XmToggleButtonGadgetClass; typedef struct _XmToggleButtonGadgetRec *XmToggleButtonGadget; typedef struct _XmToggleButtonGCacheObjRec *XmToggleButtonGCacheObject; /*fast subclass define */ #ifndef XmIsToggleButtonGadget #define XmIsToggleButtonGadget(w) XtIsSubclass(w, xmToggleButtonGadgetClass) #endif /* XmIsToggleButtonGadget */ /******** Public Function Declarations ********/ Boolean XmToggleButtonGadgetGetState( Widget w); void XmToggleButtonGadgetSetState( Widget w, #if NeedWidePrototypes int newstate, int notify) ; #else Boolean newstate, Boolean notify); #endif /* NeedWidePrototypes */ Boolean XmToggleButtonGadgetSetValue( Widget w, #if NeedWidePrototypes int newstate, int notify); #else XmToggleButtonState newstate, Boolean notify); #endif /* NeedWidePrototypes */ Widget XmCreateToggleButtonGadget( Widget parent, char *name, Arg *arglist, Cardinal argCount); Widget XmVaCreateToggleButtonGadget( Widget parent, char *name, ...); Widget XmVaCreateManagedToggleButtonGadget( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmToggleG_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Xm.msg0000644000175000017500000011652713145162623012030 00000000000000$ $XConsortium: Xm.msg /main/17 1996/08/15 17:27:48 pascale $ $ $ Motif $ $ Copyright (c) 1987-2012, The Open Group. All rights reserved. $ $ These libraries and programs are free software; you can $ redistribute them and/or modify them under the terms of the GNU $ Lesser General Public License as published by the Free Software $ Foundation; either version 2 of the License, or (at your option) $ any later version. $ $ These libraries and programs are distributed in the hope that $ they will be useful, but WITHOUT ANY WARRANTY; without even the $ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR $ PURPOSE. See the GNU Lesser General Public License for more $ details. $ $ You should have received a copy of the GNU Lesser General Public $ License along with these librararies and programs; if not, write $ to the Free Software Foundation, Inc., 51 Franklin Street, Fifth $ Floor, Boston, MA 02110-1301 USA $ $ This file is automatically generated. $ Do not edit. $ This message catalog contains messages issued by Motif toolkit library. $ Consult X-Window systems, OSF/MOTIF Programmer's Guide and OSF/MOTIF $ Programmer's Reference Manual for technical terms if you have any $ doubts about their meanings. $ Do not translate variables such as %s, %d %s ... etc. $ Do not translate Motif resource name, such as XmNlabelType. $ Special terms with capital letter(s) should not be translated. $ "False" and "True" are keywords. Do not translate. $set MS_ArrowButton MSG_ArrowButton_1000 The arrow direction is not correct. $ MSG_ArrowButton_1000 message is obsolete - DO NOT localize this message. $set MS_BulletinB MSG_BulletinB_1000 Incorrect resize policy. $ MSG_BulletinB_1000 message is obsolete - DO NOT localize this message. MSG_BulletinB_0001 Dialog style must be XmDIALOG_MODELESS. MSG_BulletinB_1001 Incorrect shadow type. $ MSG_BulletinB_1001 message is obsolete - DO NOT localize this message. MSG_BulletinB_1002 Null font list (no VendorShell default) $ MSG_BulletinB_1002 message is obsolete - DO NOT localize this message. $set MS_CascadeB MSG_CascadeB_1000 XmCascadeButton must have correct type of \n\ XmRowColumnWidgetClass parent. $ MSG_CascadeB_1000 message is obsolete - DO NOT localize this message. MSG_CascadeB_0001 Only XmRowColumn widgets of type XmMENU_PULLDOWN can be submenus. $ please do not translate submenus. MSG_CascadeB_0002 XmNmappingDelay must be greater than or equal to 0. MSG_CascadeB_0000 XmCascadeButton[Gadget] must have XmRowColumn parent with \n\ XmNrowColumnType XmMENU_PULLDOWN, XmMENU_POPUP, XmMENU_BAR or XmMENU_OPTION. MSG_CascadeB_0003 XtGrabPointer failed. MSG_RowColText_0024 XtGrabKeyboard failed. $set MS_Command MSG_Command_0000 The dialog type must be XmDIALOG_COMMAND. MSG_Command_0001 Invalid child type; Command widget does not have this child. $ please do not translate Command. MSG_Command_0002 NULL or empty XmString. MSG_Command_0003 NULL or empty XmString passed to XmCommandAppendValue. MSG_Command_0004 XmNmustMatch is always False for a Command widget. $ please do not translate False or Command. MSG_Command_0005 XmNhistoryMaxItems must be a positive integer greater than zero. $set MS_CutPaste MSG_CutPaste_0000 Must call XmClipboardStartCopy() before XmClipboardCopy() MSG_CutPaste_0001 Must call XmClipboardStartCopy() before XmClipboardEndCopy() MSG_CutPaste_0002 Too many formats in XmClipboardCopy() MSG_CutPaste_0003 ClipboardBadDataType $ please do not translate ClipboardBadDataType. MSG_CutPaste_0004 incorrect data type MSG_CutPaste_0005 ClipboardCorrupt $ please do not translate ClipboardCorrupt. MSG_CutPaste_0006 internal error - corrupt data structure MSG_CutPaste_0007 ClipboardBadFormat $ please do not translate ClipboardBadFormat. MSG_CutPaste_0008 Error - registered format length must be 8, 16, or 32 MSG_CutPaste_0009 Error - registered format name must not be null $set MS_DialogS MSG_DialogS_0000 DialogShell widget supports only one RectObj child $ please do not translate DialogShell and RectObj. MSG_DialogS_1000 gadgets aren't allowed in Shell $ MSG_DialogS_1000 message is obsolete - DO NOT localize this message. $set MS_DrawingA MSG_DrawingA_1001 Margin width or height cannot be negative. $ MSG_DrawingA_1001 message is obsolete - DO NOT localize this message. MSG_DrawingA_1002 Incorrect resize policy. $ MSG_DrawingA_1002 message is obsolete - DO NOT localize this message. $set MS_Form MSG_Form_0000 Fraction base cannot be zero. MSG_Form_1000 Incorrect Form attachment type. $ MSG_Form_1000 message is obsolete - DO NOT localize this message. MSG_Form_1001 Cannot set constraints for non-resizable widget. $ MSG_Form_1001 message is obsolete - DO NOT localize this message. MSG_Form_1002 Attachment widget must not be null. $ MSG_Form_1002 message is obsolete - DO NOT localize this message. $ please do not translate Attachment. MSG_Form_0002 Circular dependency in the children of the Form widget.\n\ Check for circular attachments between the children. $ please do not translate Form. MSG_Form_1006 Edge attached to a widget but no widget specified. $ MSG_Form_1006 message is obsolete - DO NOT localize this message. MSG_Form_0003 Abandoned edge synchronization after 10000 iterations.\n\ Check for contradictory constraints on the children of this Form widget. $ please do not translate Form. MSG_Form_0004 Attachment widget must have same parent as widget. $ MSG_Form_0004 message is obsolete - DO NOT localize this message. $ please do not translate Attachment. $set MS_Frame MSG_Frame_1000 Only one child should be inserted in a Frame. $ MSG_Frame_1000 message is obsolete - DO NOT localize this message. $ please do not translate Frame. MSG_Frame_1001 Invalid margin width. $ MSG_Frame_1001 message is obsolete - DO NOT localize this message. MSG_Frame_1002 Invalid margin height. $ MSG_Frame_1002 message is obsolete - DO NOT localize this message. $set MS_Gadget MSG_Gadget_1000 Invalid highlight thickness. $ MSG_Gadget_1000 message is obsolete - DO NOT localize this message. MSG_Gadget_1001 The unit type is incorrect. $ MSG_Gadget_1001 message is obsolete - DO NOT localize this message. MSG_Gadget_1002 Invalid shadow thickness. $ MSG_Gadget_1002 message is obsolete - DO NOT localize this message. MSG_Gadget_1003 Cannot set pixmap resource to unspecified. $ MSG_Gadget_1003 message is obsolete - DO NOT localize this message. MSG_Gadget_0000 Cannot change XmNlayoutDirection after initialization. $set MS_Label MSG_Label_1001 Invalid XmNlabelType $ MSG_Label_1001 message is obsolete - DO NOT localize this message. MSG_Label_1002 Invalid value in XmNalignment $ MSG_Label_1002 message is obsolete - DO NOT localize this message. MSG_Label_1003 Invalid value in XmNstringDirection $ MSG_Label_1003 message is obsolete - DO NOT localize this message. MSG_Label_0003 XmNlabelString must be a Compound String. $ please do not translate Compound String. MSG_Label_0004 XmNacceleratorText must be a Compound String. $ please do not translate Compound String. $set MS_List MSG_List_0000 When changed, XmNvisibleItemCount must be at least 1. MSG_List_1001 Invalid Selection Policy. $ MSG_List_1001 message is obsolete - DO NOT localize this message. MSG_List_1002 Invalid Size Policy. $ MSG_List_1002 message is obsolete - DO NOT localize this message. MSG_List_1003 Invalid ScrollBar Display Policy. $ MSG_List_1003 message is obsolete - DO NOT localize this message. MSG_List_1004 Invalid String Direction. $ MSG_List_1004 message is obsolete - DO NOT localize this message. MSG_List_0005 Cannot change XmNlistSizePolicy after initialization. MSG_List_0006 When changed, XmNitemCount must be non-negative. $ non-negative means zero or positive. MSG_List_1007 NULL font in SetValues ignored. $ MSG_List_1007 message is obsolete - DO NOT localize this message. $ please do not translate SetValues MSG_List_0007 Item(s) to be deleted are not present in the list. MSG_List_1009 No Horizontal Scrollbar to set. $ MSG_List_1009 message is obsolete - DO NOT localize this message. MSG_List_1010 Invalid Margin setting. $ MSG_List_1010 message is obsolete - DO NOT localize this message. MSG_List_0008 XmNlistSpacing must be non-negative. MSG_List_0009 Cannot set XmNitems to NULL when XmNitemCount is positive. MSG_List_0010 XmNselectedItemCount must not be negative. MSG_List_0011 Cannot set XmNselectedItems to NULL when XmNselectedItemCount \ is positive. MSG_List_0012 XmNtopItemPosition must be non-negative. MSG_List_0013 XmNitems and XmNitemCount mismatch! MSG_List_1017 Cannot leave add mode in multiple selection. $ MSG_List_1017 message is obsolete - DO NOT localize this message. MSG_List_0014 XmNselectedPositionCount must not be negative. MSG_List_0015 Cannot set XmNselectedPositions to NULL when XmNselectedPositionCount \ is positive. $set MS_MainW MSG_MainW_0000 The MenuBar cannot be changed to NULL. $ please do not translate MenuBar. MSG_MainW_0001 The CommandWindow cannot be changed to NULL. $ please do not translate CommandWindow. MSG_MainW_1003 Negative margin value ignored. $ MSG_MainW_1003 message is obsolete - DO NOT localize this message. $set MS_MenuShell MSG_MenuShell_0000 MenuShell widgets accept only XmRowColumn children. $ please do not translate MenuShell. MSG_MenuShell_0001 Attempting to manage a pulldown menu that is not attached \n\ to a Cascade button. MSG_MenuShell_0002 XmPopup requires a subclass of shellWidgetClass. $ please do not translate shellWidgetClass. MSG_MenuShell_0003 XmPopdown requires a subclass of shellWidgetClass. $ please do not translate shellWidgetClass. MSG_MenuShell_0004 XtMenuPopup requires exactly one argument. MSG_MenuShell_0005 XtMenuPopup only supports ButtonPress, KeyPress or EnterNotify events. $ please do not translate ButtonPress, KeyPress or EnterNotify. MSG_MenuShell_0006 Cannot find popup widget \"%s\" in XtMenuPopup. MSG_MenuShell_0007 Cannot find popup widget \"%s\" in XtMenuPopdown. MSG_MenuShell_0008 XtMenuPopdown called with more than one argument. MSG_MenuShell_0009 Cannot change XmNlayoutDirection after initialization. $set MS_MessageB MSG_MessageB_1001 Invalid Dialog Type. $ MSG_MessageB_1001 message is obsolete - DO NOT localize this message. MSG_MessageB_1002 Invalid Default Button Type. $ MSG_MessageB_1002 message is obsolete - DO NOT localize this message. MSG_MessageB_1003 Invalid Alignment Type. $ MSG_MessageB_1003 message is obsolete - DO NOT localize this message. MSG_MessageB_0003 Invalid child type; widget does not have this child MSG_MessageB_0004 Cancel button cannot be changed. MSG_MessageB_1006 Use XmNdefaultButtonType to set MessageBox default button. $ MSG_MessageB_1006 message is obsolete - DO NOT localize this message. $set MS_PanedW MSG_PanedW_0000 Minimum value must be greater than 0. MSG_PanedW_0001 Maximum value must be greater than 0. MSG_PanedW_0002 Minimum value must be less than maximum value. MSG_PanedW_0003 Constraints do not allow appropriate sizing. $ MSG_PanedW_0003 message is obsolete - DO NOT localize this message. MSG_PanedW_0004 Too few parameters in sash callback. MSG_PanedW_0005 Invalid first parameter in sash callback. $set MS_PWidget MSG_PWI_1001 fontList is not defined $ MSG_PWI_1001 message is obsolete - DO NOT localize this message. $ please do not translate fontList. $set MS_Protocols MSG_Protocols_0000 Widget must be a VendorShell. $ please do not translate VendorShell. MSG_Protocols_0001 Protocol manager already exists. MSG_Protocols_0002 There are more protocols than widget can handle; 32 is the limit. $set MS_PushB MSG_PushB_1001 Not enough memory $ MSG_PushB_1001 message is obsolete - DO NOT localize this message. $set MS_RowColumn $ In this set, please do not translate the word that starts with "XmN" or "Xm". MSG_RowColumn_1001 Attempt to set width to zero.\n\ Set to default value 16. $ MSG_RowColumn_1001 message is obsolete - DO NOT localize this message. MSG_RowColumn_0000 Attempt to set width to zero ignored MSG_RowColumn_1003 Attempt to set height to zero.\n\ Set to default value 16. $ MSG_RowColumn_1003 message is obsolete - DO NOT localize this message. MSG_RowColumn_0001 Attempt to set height to zero ignored MSG_RowColumn_0002 XmNhelpWidget forced to NULL since it is not used by popup menus. MSG_RowColumn_0003 XmNhelpWidget forced to NULL since it is not used by pulldown menus. MSG_RowColumn_0004 XmNhelpWidget forced to NULL since it is not used by option menus. MSG_RowColumn_0005 XmNhelpWidget forced to NULL since it is not used by Work Areas. MSG_RowColumn_1009 Unknown value of XmNrowColumnType.\n\ It is set to WorkArea. $ MSG_RowColumn_1009 message is obsolete - DO NOT localize this message. MSG_RowColumn_0007 Widget hierarchy not appropriate for this XmNrowColumnType:\n\ defaulting to XmWORK_AREA. MSG_RowColumn_0008 Attempt to change XmNrowColumnType after initialization ignored MSG_RowColumn_1012 Unknown value of XmNorientation.\n\ The default value is used. $ MSG_RowColumn_1012 message is obsolete - DO NOT localize this message. MSG_RowColumn_1013 Attempt to set XmNorientation to unknown value.\n\ The value is ignored. $ MSG_RowColumn_1013 message is obsolete - DO NOT localize this message. MSG_RowColumn_1014 Unknown value of XmNpacking.\n\ The default value is used. $ MSG_RowColumn_1014 message is obsolete - DO NOT localize this message. MSG_RowColumn_1015 Attempt to set XmNpacking to unknown value.\n\ The value is ignored. $ MSG_RowColumn_1015 message is obsolete - DO NOT localize this message. MSG_RowColumn_1016 Unknown value of XmNentryAlignment.\n\ The default value is used. $ MSG_RowColumn_1016 message is obsolete - DO NOT localize this message. MSG_RowColumn_1017 Attempt to set XmNentryAlignment to unknown value.\n\ The value is ignored. $ MSG_RowColumn_1017 message is obsolete - DO NOT localize this message. MSG_RowColumn_0015 Attempt to set XmNisHomogenous to FALSE for a RowColumn widget of type \ XmMENU_BAR ignored. $ please do not translate FALSE and RowColumn. MSG_RowColumn_0016 Attempt to change XmNentryClass for a RowColumn widget of type \ XmMENU_BAR ignored. $ please do not translate RowColumn. MSG_RowColumn_0017 Attempt to change XmNwhichButton via XtSetValues for a RowColumn widget \ of type XmMENU_PULLDOWN ignored. $ please do not translate RowColumn. MSG_RowColumn_0018 Attempt to change XmNmenuPost via XtSetValues for a RowColumn widget \ of type XmMENU_PULLDOWN ignored. $ please do not translate RowColumn. MSG_RowColumn_0019 Attempt to set XmNmenuPost to an illegal value ignored. MSG_RowColumn_0020 Attempt to change XmNshadowThickness for a RowColumn widget not of type \ XmMENU_PULLDOWN or XmMENU_POPUP ignored. $ please do not translate RowColumn. MSG_RowColumn_1024 Attempt to change XmNorientation for a RowColumn \n\ widget of type XmMENU_OPTION.\n\ The value is ignored. $ MSG_RowColumn_1024 message is obsolete - DO NOT localize this message. MSG_RowColumn_0022 Attempt to add wrong child type to a menu (that is, XmRowColumn) widget $ please do not translate RowColumn. MSG_RowColumn_0023 Attempt to add wrong child type to a homogeneous RowColumn widget $ please do not translate RowColumn. MSG_RowColumn_0025 Attempt to change XmNisHomogeneous for a RowColumn widget of type \ XmMENU_OPTION ignored $ please do not translate RowColumn. MSG_RowColumn_0026 Enabling tear off on a shared menupane is not recommended MSG_RowColumn_0027 Illegal mnemonic character; Could not convert X KEYSYM to a keycode $ please do not translate X KEYSYM. $set MS_Scale MSG_Scale_0000 The minumum scale value is greater than or equal to the maximum scale \ value. MSG_Scale_0001 The specified scale value is less than the minimum scale value. MSG_Scale_0002 The specified scale value is greater than the maximum scale value. MSG_Scale_1004 Incorrect orientation. $ MSG_Scale_1004 message is obsolete - DO NOT localize this message. MSG_ScaleScrBar_0004 Incorrect processing direction. MSG_Scale_0005 = Invalid highlight thickness. $ MSG_Scale_0005 message is obsolete - DO NOT localize this message. MSG_Scale_0006 Invalid XmNscaleMultiple; greater than (max - min) MSG_Scale_0007 Invalid XmNscaleMultiple; less than zero MSG_Scale_0008 (Maximum - minimum) cannot be greater than INT_MAX / 2;\n\ minimum has been set to zero, maximum may have been set to (INT_MAX/2). MSG_Scale_0009 XmNshowValue has an incorrect value $set MS_ScrollBar MSG_ScrollBar_0000 The minimum scrollbar value is greater than or equal to\n\ the maximum scrollbar value. MSG_ScrollBar_0001 The specified slider size is less than 1. MSG_ScrollBar_0002 The specified scrollbar value is less than the minimum\n\ scrollbar value. MSG_ScrollBar_0003 The specified scrollbar value is greater than the maximum\n\ scrollbar value minus the scrollbar slider size. MSG_ScrollBar_1005 Incorrect orientation. $ MSG_ScrollBar_1005 message is obsolete - DO NOT localize this message. MSG_ScrollBar_1006 Incorrect processing direction. $ MSG_ScrollBar_1006 message is obsolete - DO NOT localize this message. MSG_ScrollBar_0004 The scrollbar increment is less than 1. MSG_ScrollBar_0005 The scrollbar page increment is less than 1. MSG_ScrollBar_0006 The scrollbar initial delay is less than 1. MSG_ScrollBar_0007 The scrollbar repeat delay is less than 1. MSG_ScrollBar_1011 Error in context manager; scrollbar backgrounds\n\ cannot be set correctly $ MSG_ScrollBar_1011 message is obsolete - DO NOT localize this message. MSG_ScrollBar_1012 Error in context manager; scrollbar foregrounds\n\ cannot be set correctly $ MSG_ScrollBar_1012 message is obsolete - DO NOT localize this message. MSG_ScrollBar_0008 Specified slider size is greater than the maximum scrollbar\n\ value minus the minimum scrollbar value. $set MS_ScrolledW MSG_ScrolledW_1001 Invalid ScrollBar Display policy. $ MSG_ScrolledW_1001 message is obsolete - DO NOT localize this message. MSG_ScrolledW_1002 Invalid Scrolling Policy. $ MSG_ScrolledW_1002 message is obsolete - DO NOT localize this message. MSG_ScrolledW_1003 Invalid Visual Policy. $ MSG_ScrolledW_1003 message is obsolete - DO NOT localize this message. MSG_ScrolledW_1004 Invalid placement policy. $ MSG_ScrolledW_1004 message is obsolete - DO NOT localize this message. MSG_ScrolledW_0004 Cannot change scrolling policy after initialization. MSG_ScrolledW_0005 Cannot change visual policy after initialization. MSG_ScrolledW_0006 Cannot set AS_NEEDED scrollbar policy with a\n\ visual policy of VARIABLE. $ please do not translate AS_NEEDED or VARIABLE. MSG_ScrolledW_0007 Cannot change scrollbar widget in AUTOMATIC mode. $ please do not translate AUTOMATIC. MSG_ScrolledW_0008 Cannot change clip window MSG_ScrolledW_0009 Cannot set visual policy of CONSTANT in APPLICATION_DEFINED mode. $ please do not translate CONSTANT or APPLICATION_DEFINED. MSG_ScrollVis_0000 Wrong parameters passed to the XmScrollVisible function. $set MS_SelectioB MSG_SelectioB_1001 Incorrect dialog type. $ MSG_SelectioB_1001 message is obsolete - DO NOT localize this message. MSG_SelectioB_0001 Dialog type cannot be modified. $ please do not translate Dialog. MSG_SelectioB_1003 Only one work area child allowed. $ MSG_SelectioB_1003 message is obsolete - DO NOT localize this message. MSG_SelectioB_0002 Widget does not support this child type. $set MS_Separator MSG_Separator_1001 Invalid separator type. $ MSG_Separator_1001 message is obsolete - DO NOT localize this message. MSG_Separator_1002 Invalid orientation. $ MSG_Separator_1002 message is obsolete - DO NOT localize this message. $set MS_Text MSG_Text_0000 Incorrect source text is ignored. MSG_Text_1003 Invalid edit mode. $ MSG_Text_1003 message is obsolete - DO NOT localize this message. MSG_Text_0002 Text widget is editable; XmNtraversalOn must be True. $ MSG_Text_0002 message is obsolete - DO NOT localize this message. $ please do not translate XmNtraversalOn and True. MSG_TextIn_0000 Cannot find position while attempting to move to previous line. MSG_TextOut_0000 Number of rows must be greater than 0. MSG_TextF_0002 XmFontListInitFontContext failed. $ please do not translate XmFontListInitFontContext. MSG_TextF_0003 XmFontListGetNextFont failed. $ please do not translate XmFontListGetNextFont. MSG_TextF_0004 Character '%s' not supported in font. Discarded. MSG_TextFWcs_0000 Character '%s' not supported in font. Discarded. MSG_TextFWcs_0001 Cannot use multibyte locale without a fontset. Value discarded. $ MSG_TextFWcs_0001 message is obsolete - DO NOT localize this message. $set MS_TextF MSG_TextF_0000 Cursor position must be greater than or equal to 0. MSG_TextF_0001 Number of columns must be greater than 0. MSG_TextF_0005 XmNtraversalOn must always be True. $ please do not translate XmNtraversalOn and True. $ MSG_TextF_0005 message is obsolete - DO NOT localize this message. MSG_TextF_0006 Number of columns must be greater than or equal to 0. $set MS_ToggleB MSG_ToggleB_1001 Indicator type should be either XmONE_OF_MANY or XmN_OF_MANY $ MSG_ToggleB_1001 message is obsolete - DO NOT localize this message. $set MS_Traversal MSG_Traversal_1001 Invalid value for navigation_type $ MSG_Traversal_1001 message is obsolete - DO NOT localize this message. MSG_Traversal_1002 Wrong value in old for navigation_type!! $ MSG_Traversal_1002 message is obsolete - DO NOT localize this message. MSG_Traversal_1003 Traversal bootstrap situation with bad parameters $ MSG_Traversal_1003 message is obsolete - DO NOT localize this message. MSG_Traversal_1004 Attempt to traverse to new tab using bad parameters $ MSG_Traversal_1004 message is obsolete - DO NOT localize this message. MSG_Traversal_1005 startWidget is not in child list $ MSG_Traversal_1005 message is obsolete - DO NOT localize this message. $ please do not translate startWidget MSG_Traversal_1006 Bad parameters to TraverseToChild $ MSG_Traversal_1006 message is obsolete - DO NOT localize this message. $ please do not translate TraverseToChild. $set MS_Vendor MSG_Vendor_0000 Invalid value for XmNdeleteResponse MSG_Vendor_1002 Invalid XmNpreeditType, default to OverTheSpot $ MSG_Vendor_1002 message is obsolete - DO NOT localize this message. MSG_Vendor_0001 Invalid value for XmNinputPolicy MSG_Vendor_0002 XmNlayoutDirection cannot be changed. MSG_Vendor_0003 Fatal Error: \n\ _XmGetDefaultDisplay cannot be used prior to VendorS.Initialize, returns NULL $ please do not translate VendorS.Initialize. $set MS_VendorE MSG_VendorE_1001 FetchUnitType: bad widget class $ MSG_VendorE_1001 message is obsolete - DO NOT localize this message. MSG_VendorE_0000 String to no-op conversion needs no extra arguments. $ MSG_VendorE_0000 message is obsolete - DO NOT localize this message. MSG_VendorE_0005 FetchUnitType called without a widget to reference. $ please do not translate FetchUnitType. $ MSG_VendorE_0005 message is obsolete - DO NOT localize this message. $set MS_VirtKeys MSG_VirtKey_1001 Virtual bindings Initialize hasn't been called $ MSG_VirtKey_1001 message is obsolete - DO NOT localize this message. $set MS_Visual MSG_Visual_0000 Invalid color requested from _XmAccessColorData. MSG_Visual_0001 Cannot allocate colormap entry for default background. MSG_Visual_0002 Cannot parse default background color specification. $set MS_XmIm MSG_XmIm_0000 Cannot open input method - using XLookupString. MSG_XmIm_1002 Cannot create the Input Method Object $ MSG_XmIm_1002 message is obsolete - DO NOT localize this message. MSG_XmIm_1003 XmIMFocus invoked with NULL widget. $ MSG_XmIm_1003 message is obsolete - DO NOT localize this message. MSG_XmIm_1004 XmIMMove invoked without the Input Method focus. $ MSG_XmIm_1004 message is obsolete - DO NOT localize this message. $set MS_Resources MSG_Resource_0001 OK $ "OK" as in "Go ahead"/"Confirmed to proceed as instructed"/"Fine" MSG_Resource_0002 Cancel $ ... as in "Never mind"/"abort this operation"/"Stop current request" MSG_Resource_0003 Selection $ ... as in "choosing from a list of items" MSG_Resource_0004 Apply $ ... as in "To do something with the things selected" MSG_Resource_0005 Help $ ... as in "Need more guidance on how to deal with this dialog box" MSG_Resource_0006 Filter $ ... the noun "Filter", as in "a sifter/a filter/a qualifier to screen out" $ files with MSG_Resource_0007 Files $ ... as in "a list of the files" MSG_Resource_0008 Directories $ ... as in "a list of the directories" MSG_Resource_0009 Items $ ... as in "a list of things to choose from" MSG_Resource_0010 Filter $ ... the verb "Filter", as in "To screen out some files" $ Note this has a slightly different semantics from MSG_Res_1006. $ In English, it is the same word, but MSG_Res_1006 means "a sifter", and $ MSG_Res_1010 means "Push this button to filter out some files" $ MSG_Res_1006 is a label indicating "entry below is qualifier to filter out" $ files with MSG_Resource_0011 Directory MSG_Resource_0012 > $ command-line prompt in the Command widget. MSG_Resource_0013 Find $set MS_BaseClass MSG_BaseClass_0000 No context found for extension MSG_BaseClass_0001 _XmPopWidgetExtData; no extension found with XFindContext MSG_BaseClass_0002 XmFreeWidgetExtData is an unsupported routine $ MSG_BaseClass_0002 message is obsolete - DO NOT localize this message. MSG_GetSecRes_0000 getLabelSecResData: Not enough memory $ please do not translate getLabelSecResData. $ MSG_GetSecRes_0000 message is obsolete - DO NOT localize this message. $set MS_Display MSG_Display_0001 Creating multiple XmDisplays for the same X display. Only the\n\ first XmDisplay created for a particular X display can be referenced\n\ by calls to XmGetXmDisplay $ please do not translate XmDisplay or XmGetXmDisplay MSG_Display_0002 Received TOP_LEVEL_LEAVE with no active DragContext $ please do not translate TOP_LEVEL_LEAVE or DragContext MSG_Display_0003 Cannot set XmDisplay class to a non-subclass of XmDisplay $ please do not translate XmDisplay $set MS_DragBS MSG_DragBS_0000 _MOTIF_DRAG_WINDOW property has been destroyed $ please do not translate _MOTIF_DRAG_WINDOW MSG_DragBS_0001 The protocol version levels do not match. MSG_DragBS_0002 Unable to open display. MSG_DragBS_0003 The atom table is empty. MSG_DragBS_0004 The target table is empty. MSG_DragBS_0005 The target table has an inconsistent property. MSG_DragBS_0006 Invalid target table index. $set MS_DragC MSG_DragC_0001 GenerateCallback does not expect XmCR_DROP_SITE_ENTER as a reason. $ please do not translate GenerateCallback or XmCR_DROP_SITE_ENTER MSG_DragC_0002 Invalid selection in DropConvertCallback $ please do not translate DropConvertCallback MSG_DragC_0003 The drop selection was lost. MSG_DragC_0004 XGrabPointer failed. MSG_DragC_0005 ExternalNotifyHandler: the callback reason is not acceptable. $ please do not translate ExternalNotifyHandler MSG_DragC_0006 XmDragStart must be called as a result of a button press or motion event. $ please do not translate XmDragStart $set MS_DragICC MSG_DragICC_0000 Unknown drag and drop message type. MSG_DragICC_0001 The protocol version levels do not match. $set MS_DragIcon MSG_DragIcon_0000 No geometry specified for dragIcon pixmap $ please do not translate dragIcon MSG_DragIcon_0001 A dragIcon created with no pixmap $ please do not translate dragIcon MSG_DragIcon_0002 String to Bitmap converter needs Screen argument. $ MSG_DragIcon_0002 message is obsolete - DO NOT localize this message. $set MS_DragOverS MSG_DragOverS_0000 Depth mismatch. MSG_DragOverS_0001 Unknown icon attachment. MSG_DragOverS_0002 Unknown drag state. MSG_DragOverS_0003 Unknown XmNblendModel. $ please do not translate XmNblendModel $set MS_DragUnder MSG_DragUnder_0000 Unable to get drop site window geometry. MSG_DragUnder_0001 Invalid animationPixmapDepth. $ please do not translate animationPixmapDepth $set MS_DropSMgr MSG_DropSMgr_0001 Cannot create drop sites that are children of a simple drop site. MSG_DropSMgr_0002 Receiving motion events without an active drag context MSG_DropSMgr_0003 Receiving operation changed without an active drag context. MSG_DropSMgr_0004 Creating an active drop site with no drop procedure. MSG_DropSMgr_0005 Cannot set rectangles or number of rectangles of composite drop sites. MSG_DropSMgr_0006 Registering a widget as a drop site out of sequence.\n\ Ancestors must be registered before any of their \n\ descendants are registered. MSG_DropSMgr_0007 Cannot register widget as a drop site more than once. MSG_DropSMgr_0008 Drop site type may only be set at creation time. $ please do not translate DropSite MSG_DropSMgr_0009 Cannot change rectangles of non-simple drop site. MSG_DropSMgr_0010 Cannot register a Shell as a drop site. MSG_DropSMgrI_0001 Cannot register a drop site that is a descendent of a simple drop site MSG_DropSMgrI_0002 Cannot create a discontiguous child list for a composite drop site. MSG_DropSMgrI_0003 %s is not a drop site child of %s $set MS_GeoUtils MSG_GeoUtils_0000 Failure of geometry request to \"almost\" reply". $ please do not translate "almost" $ MSG_GeoUtils_0000 message is obsolete - DO NOT localize this message. MSG_GeoUtils_0001 Invalid layout of children found. $ MSG_GeoUtils_0001 message is obsolete - DO NOT localize this message. MSG_GeoUtils_0002 Invalid order found in XmSelectionBox. $ MSG_GeoUtils_0002 message is obsolete - DO NOT localize this message. $set MS_Region MSG_Region_0000 Memory error $set MS_RepType MSG_RepType_0001 Illegal representation type id MSG_RepType_0002 Illegal value (%d) for rep type XmR%s $ please do not translate XmR%s MSG_RepType_0000 Reverse Conversion of $set MS_ResConvert MSG_ResConvert_0000 FetchUnitType: bad widget class. $ please do not translate FetchUnitType. $ MSG_ResConvert_0000 message is obsolete - DO NOT localize this message. MSG_ResConvert_0001 Improperly defined default list! Exiting... MSG_ResConvert_0002 Missing colon in font string \"%s\"; any remaining fonts in list unparsed MSG_ResConvert_0003 Invalid delimiter in tag \"%s\"; any remaining fonts in list unparsed MSG_ResConvert_0004 Unmatched quotation marks in string \"%s\"; any remaining fonts in list unparsed" $ MSG_ResConvert_0004 message is obsolete - DO NOT localize this message. MSG_ResConvert_0005 Unmatched quotation marks in tag \"%s\"; any remaining fonts in list unparsed MSG_ResConvert_0006 Null tag found when converting to type %s; any remaining fonts in list unparsed MSG_ResConvert_0007 Cannot convert XmString to Compound Text MSG_ResConvert_0008 Insufficient memory for XmbTextListToTextProperty MSG_ResConvert_0009 Locale not supported for XmbTextListToTextProperty MSG_ResConvert_0010 XmbTextListToTextProperty failed MSG_ResConvert_0011 Cannot convert widget name to Widget. $ please do not translate Widget. MSG_ResConvert_0012 Cannot convert compound text to XmString MSG_ResConvert_0013 Cannot convert XmString to compound text MSG_ResConvert_0014 FetchUnitType called without a widget to reference. $ please do not translate FetchUnitType. $ MSG_ResConvert_0014 message is obsolete - DO NOT localize this message. MSG_ResConvert_0015 FetchDisplayArg called without a widget to reference. $ please do not translate FetchDisplayArg. $ MSG_ResConvert_0015 message is obsolete - DO NOT localize this message. MSG_ResConvert_0016 FetchWidgetArg called without a widget to reference. $ please do not translate FetchWidgetArg. $ MSG_ResConvert_0016 message is obsolete - DO NOT localize this message. $set MS_Screen MSG_Screen_0000 Icon screen mismatch MSG_Screen_0001 Cannot get XmScreen because XmDisplay was not found. $set MS_ColObj MSG_ColObj_0001 Could not allocate memory for color object data. MSG_ColObj_0002 Bad screen number from color server selection. $set MS_IG MSG_IG_1 Incorrect alignment. $ MSG_IG_1 message is obsolete - DO NOT localize this message. MSG_IG_2 Incorrect behavior. $ MSG_IG_2 message is obsolete - DO NOT localize this message. MSG_IG_3 Incorrect fill mode. $ MSG_IG_3 message is obsolete - DO NOT localize this message. MSG_IG_4 Incorrect string or pixmap position. $ MSG_IG_4 message is obsolete - DO NOT localize this message. MSG_IG_5 Incorrect margin width or height. $ MSG_IG_5 message is obsolete - DO NOT localize this message. MSG_IG_6 Incorrect shadow type. $ MSG_IG_6 message is obsolete - DO NOT localize this message. $set MS_ComboBox MSG_ComboBox_0000 Applications cannot add children to XmComboBox widgets. MSG_ComboBox_0001 XmNcomboBoxType resource cannot be changed by XtSetValues. MSG_ComboBox_0002 XmFontListGetNextFont failed. $ MSG_ComboBox_0002 message is obsolete - DO NOT localize this message. MSG_ComboBox_0003 XmFontListInitFontContext failed. $ MSG_ComboBox_0003 message is obsolete - DO NOT localize this message. MSG_ComboBox_0004 Internal widget has been destroyed. Behavior is undefined. MSG_ComboBox_0005 Internal widget has been unmanaged. Behavior is undefined. MSG_ComboBox_0006 XmQUICK_NAVIGATE is only valid for ComboBoxes of XmNcomboBoxType XmDROP_DOWN_LIST MSG_ComboBox_0007 Action invoked with the wrong number of parameters. MSG_ComboBox_0008 Action routine called from a widget that is not a descendant of ComboBox MSG_ComboBox_0009 XmComboBoxSelectItem called with an item not present in the ComboBox. MSG_ComboBox_0010 XmComboBoxSetItem called with an item not present in the ComboBox. MSG_ComboBox_0011 XmComboBoxDeletePos called with an invalid position. MSG_ComboBox_0012 XmComboBox utility routine called with an invalid widget. MSG_ComboBox_0013 Applications may not set the automatic XmComboBox widget children. MSG_ComboBox_0014 XmComboBox positionMode cannot be changed after creation. $ please do not translate positionMode. $set MS_Container MSG_Container_0000 Action invoked with the wrong number of parameters. MSG_Container_0001 XmNdetailColumnHeading and XmNdetailColumnHeadingCount do not match! $set MS_CSText MSG_CSText_0000 Invalid margin height; must be greater than or equal to 0. $ MSG_CSText_0000 message is obsolete - DO NOT localize this message. MSG_CSText_0001 Invalid margin width; must be greater than or equal to 0. $ MSG_CSText_0001 message is obsolete - DO NOT localize this message. MSG_CSText_0002 Invalid edit mode. $ MSG_CSText_0002 message is obsolete - DO NOT localize this message. MSG_CSText_0003 XmNtraversalOn must always be true. $ MSG_CSText_0003 message is obsolete - DO NOT localize this message. MSG_CSText_0004 Cannot change XmNscrollHorizontal after initialization. $ MSG_CSText_0004 message is obsolete - DO NOT localize this message. MSG_CSText_0005 Cannot change XmNscrollVertical after initialization. $ MSG_CSText_0005 message is obsolete - DO NOT localize this message. MSG_CSText_0006 Cannot change XmNscrollTopSide after initialization. $ MSG_CSText_0006 message is obsolete - DO NOT localize this message. MSG_CSText_0007 Cannot change XmNscrollLeftSide after initialization. $ MSG_CSText_0007 message is obsolete - DO NOT localize this message. $set MS_GrabShell MSG_GrabS_0000 XmPopup requires a subclass of shellWidgetClass. $ please do not translate shellWidgetClass. $ MSG_GrabS_0000 message is obsolete - DO NOT localize this message. $set MS_Manager MSG_Manager_0000 Widget class %s has invalid CompositeClassExtension record. $ please do not translate CompositeClassExtension. MSG_Manager_0001 Cannot change XmNlayoutDirection or XmNstringDirection after initialization. $set MS_NavigMap MSG_NavigMap_0000 _XmNavigate called with invalid direction. $ MSG_NavigMap_0000 message is obsolete - DO NOT localize this message. $set MS_Notebook MSG_Notebook_0000 XmNnotebookChildType resource cannot be set by XtSetValues. $set MS_PixConv MSG_PixConv_0000 Wrong number of parameters for CvtStringToPixmap $ please do not translate CvtStringToPixmap. $set MS_Primitive MSG_Primitive_0000 Cannot change XmNlayoutDirection after initialization. $set MS_ScrollFrameT MSG_ScrollFrameT_0000 AssocNavigator requires a navigator trait $ please do not translate AssocNavigator. MSG_ScrollFrameT_0001 DeAssocNavigator requires a navigator trait $ please do not translate DeAssocNavigator. $set MS_SpinB MSG_SpinB_0001 Invalid value for XmNarrowLayout. $ MSG_SpinB_0001 message is obsolete - DO NOT localize this message. MSG_SpinB_0002 XmNminimumValue equals XmNmaximumValue. $ MSG_SpinB_0002 message is obsolete - DO NOT localize this message. MSG_SpinB_0003 No items supplied for XmSTRING child. MSG_SpinB_0004 XmNincrementValue cannot be 0. A value of 1 will be used. MSG_SpinB_0005 Spin direction specified by XmNincrementValue\n\ has been reversed to match the specified\n\ XmNminimumValue and XmNmaximumValue. MSG_SpinB_0006 XmNposition out of range; minimum XmNposition used. MSG_SpinB_0007 XmNposition out of range; maximum XmNposition used. MSG_SpinB_0008 Invalid value for XmNpositionType. Using default value. MSG_SpinB_0009 XmNpositionType resource can only be set at creation time. $ MSG_SpinB_0009 message is obsolete - DO NOT localize this message. $set MS_Transfer MSG_Transfer_0000 Calling SelectionCallbackWrapper when transfers should be finished $ please do not translate SelectionCallbackWrapper. MSG_Transfer_0001 Cannot lock the clipboard; aborting transfer. $ MSG_Transfer_0001 message is obsolete - DO NOT localize this message. MSG_Transfer_0002 The format and type of the callback supplied data does not match the data being merged. MSG_Transfer_0003 The status in the XmConvertCallbackStruct is not XmCONVERT_MERGE. MSG_Transfer_0004 CONVERT_MORE is not yet supported. $ please do not translate CONVERT_MORE. MSG_Transfer_0005 Bad atom value found. MSG_Transfer_0006 Warning: Attempt to start a MULTIPLE transfer when one is in progress. $ please do not translate MULTIPLE. MSG_Transfer_0007 Warning: Attempt to send a MULTIPLE transfer when one is not in progress. $ please do not translate MULTIPLE. $set MS_VaSimple MSG_VaSimple_0000 XtVaTypedArg conversion needs non-null widget handle. MSG_VaSimple_0001 Unable to find type of resource for conversion. MSG_VaSimple_0002 Type conversion failed. $set MS_Xm MSG_Motif_0000 \nName: %s\nClass: %s\n MSG_Motif_0001 Action invoked with the wrong number of parameters. $set MS_XmRenderT MSG_XmRenderT_0000 XmNtag cannot be NULL. Setting to empty string. MSG_XmRenderT_0001 Display is NULL. Cannot load font. MSG_XmRenderT_0002 XmNfontType invalid. Cannot load font. MSG_XmRenderT_0003 Conversion failed. Cannot load font. MSG_XmRenderT_0004 XmNfontType set to XmAS_IS. Cannot load font. MSG_XmRenderT_0005 XmNloadModel is XmLOAD_IMMEDIATE but XmNfont and XmNfontName not specified.\n\ Cannot load font. $set MS_XmSelect MSG_XmSelect_0000 Internal error: no selection property context for display. $ MSG_XmSelect_0000 message is obsolete - DO NOT localize this message. MSG_XmSelect_0001 Selection owner returned type INCR property with format != 32. $ please do not translate INCR. $ MSG_XmSelect_0001 message is obsolete - DO NOT localize this message. MSG_XmSelect_0002 XtGetSelectionRequest called for widget \"%s\" outside of ConvertSelection proc. $ please do not translate ConvertSelection. $ MSG_XmSelect_0002 message is obsolete - DO NOT localize this message. $set MS_XmString MSG_XmString_0000 No font found. $set MS_XmTabList MSG_XmTabList_0000 Tab value cannot be negative. $set MS_SSpinB MSG_SSpinB_0001 XmNtextField resource cannot be set. MSG_SSpinB_0002 XmNpositionType resource can only be set at creation time. MSG_SSpinB_0003 Item does not exist. XmNposition is unchanged. $set MS_DataF MSG_DataF_0000 Invalid cursor position, must be >= 0. MSG_DataF_0001 Invalid columns, must be > 0. MSG_DataF_0002 XmFontListInitFontContext Failed. MSG_DataF_0003 XmFontListGetNextFont Failed. MSG_DataF_0004 Character '%c', not supported in font. Discarded. MSG_DataF_0005 Traversal_on must always be true. MSG_DataF_0006 Invalid columns, must be >= 0. $set MS_DataFWcs MSG_DatFWcs_0000 Character '%s', not supported in font. Discarded. MSG_DatFWcs_0001 Cannot use multibyte locale without a fontset. Value discarded. $set MS_ColorSB MSG_ColorSB_0001 Basic color MSG_ColorSB_0002 Custom color MSG_ColorSB_0003 Hue: MSG_ColorSB_0004 Sat: MSG_ColorSB_0005 Val: MSG_ColorSB_0006 Red: MSG_ColorSB_0007 Green: MSG_ColorSB_0008 Blue: MSG_ColorSB_0009 Add to Custom Colors MSG_ColorSB_0010 Selected Color: motif-2.3.8/lib/Xm/TextFSelI.h0000644000175000017500000000367312672140200012700 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: TextFSelI.h /main/5 1995/07/13 18:06:08 drk $ */ #ifndef _XmTextFSelI_h #define _XmTextFSelI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern Boolean _XmTextFieldConvert( Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format, Widget drag_context, XEvent *event) ; extern void _XmTextFieldLoseSelection( Widget w, Atom *selection) ; extern Widget _XmTextFieldGetDropReciever( Widget w) ; extern void _XmTextFieldInstallTransferTrait(void); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextFSelI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CareVisualT.c0000644000175000017500000000410012672140200013230 00000000000000/* $TOG: CareVisualT.c /main/7 1999/01/20 18:20:55 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include "CareVisualTI.h" /************************************************************************ * * _XmNotifyChildrenVisual * Loop through the child set of new and for any widget/gadget that has * a CareParentVisual trait, call the redraw proc. * The redraw proc will return True if the widget needs to have the * parent redrawn as well. * ************************************************************************/ Boolean _XmNotifyChildrenVisual( Widget cur, Widget new_w, Mask visual_flag) { register int i; Widget child; Boolean redisplay = False; XmCareVisualTrait care_visual ; CompositeWidget cw = (CompositeWidget) new_w ; for (i = 0; i < cw->composite.num_children; i++) { child = cw->composite.children[i]; if ((care_visual = (XmCareVisualTrait) XmeTraitGet((XtPointer) XtClass(child), XmQTcareParentVisual)) != NULL) redisplay |= care_visual->redraw(child, cur, new_w, visual_flag) ; } return (redisplay); } motif-2.3.8/lib/Xm/LabelI.h0000644000175000017500000000314012672140200012206 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: LabelI.h /main/5 1995/07/13 17:31:52 drk $ */ #ifndef _XmLabelI_h #define _XmLabelI_h #include #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmCalcLabelDimensions(Widget wid) ; extern void _XmLabelCloneMenuSavvy(WidgetClass, XmMenuSavvyTrait); extern char* _XmCBNameActivate(void); extern char* _XmCBNameValueChanged(void); extern void _XmLabelCalcTextRect(Widget wid) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmLabelI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconButton.h0000644000175000017500000000516712672140200013155 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmIconButton_h #define _XmIconButton_h #if defined(VMS) || defined(__VMS) #include #endif #include /************************************************************ * INCLUDE FILES *************************************************************/ /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #if defined(__cplusplus) extern "C" { #endif typedef struct _XmIconButtonClassRec *XmIconButtonWidgetClass; typedef struct _XmIconButtonRec *XmIconButtonWidget; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ typedef struct _XmIconButtonCallbackInfo { Boolean state; /* The current state of the icon button. */ XEvent * event; /* The event that caused this action. */ } XmIconButtonCallbackInfo; /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ /* Function Name: XmCreateIconButton * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateIconButton( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); extern WidgetClass xmIconButtonWidgetClass; #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmIconButton_h */ motif-2.3.8/lib/Xm/BulletinB.c0000644000175000017500000022336113145162623012753 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: BulletinB.c /main/22 1999/10/13 16:15:40 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "BulletinBI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "XmI.h" #include "BaseClassI.h" #include "CallbackI.h" #include "GeoUtilsI.h" #include "GMUtilsI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "TraversalI.h" /****************************************************************/ /* Local defines: */ #define STRING_CHARSET "ISO8859-1" #define MARGIN_DEFAULT 10 #define DONT_CARE -1L #define COMMON_FUNCS (MWM_FUNC_CLOSE | MWM_FUNC_MOVE | MWM_FUNC_RESIZE) #define DIALOG_FUNCS COMMON_FUNCS #define CLIENT_FUNCS (COMMON_FUNCS | MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE) #define WARN_DIALOG_STYLE _XmMMsgBulletinB_0001 /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass w_class) ; static void Initialize( Widget wid_req, Widget wid_new, ArgList args, Cardinal *numArgs) ; static void Destroy( Widget wid) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean SetValuesHook( Widget wid, ArgList args, Cardinal *num_args) ; static void HandleChangeManaged( XmBulletinBoardWidget bbWid, XmGeoCreateProc geoMatrixCreate) ; static void HandleResize( XmBulletinBoardWidget bbWid, XmGeoCreateProc geoMatrixCreate) ; static XtGeometryResult HandleGeometryManager( Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *allowed, XmGeoCreateProc geoMatrixCreate) ; static void ChangeManaged( Widget wid) ; static void UnmanageCallback( Widget w, XtPointer client_data, XtPointer call_data) ; static void InsertChild( Widget child) ; static void DeleteChild( Widget child) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired) ; static void Resize( Widget wid) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static Boolean BulletinBoardParentProcess( Widget wid, XmParentProcessData event) ; static void GetDialogTitle( Widget bb, int resource, XtArgVal *value) ; static Widget GetBBWithDB( Widget wid) ; static XmFontList GetTable(Widget wid, XtEnum type); static void CallMapUnmap(Widget wid, Boolean map_unmap) ; static void BulletinBoardSetDefaultShadow( Widget button) ; static void BBUpdateDynDefaultButton( Widget bb) ; static void CheckSetRenderTables(Widget wid, int offset, XrmValue *value); /******** End Static Function Declarations ********/ /* default translation table and action list */ #define defaultTranslations _XmBulletinB_defaultTranslations static XtActionsRec actionsList[] = { { "Return", _XmBulletinBoardReturn }, /*Motif 1.0 BC. */ { "BulletinBoardReturn", _XmBulletinBoardReturn }, { "BulletinBoardCancel", _XmBulletinBoardCancel }, { "BulletinBoardMap", _XmBulletinBoardMap }, }; /* Resource definitions for BulletinBoard */ static XmSyntheticResource syn_resources[] = { { XmNdialogTitle, sizeof (XmString), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.dialog_title), GetDialogTitle, NULL }, { XmNmarginWidth, sizeof (Dimension), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof (Dimension), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, }; static XtResource resources[] = { { XmNshadowType, XmCShadowType, XmRShadowType, sizeof (unsigned char), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.shadow_type), XmRImmediate, (XtPointer) XmSHADOW_OUT }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmBulletinBoardRec, manager.shadow_thickness), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.margin_width), XmRImmediate, (XtPointer) MARGIN_DEFAULT }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.margin_height), XmRImmediate, (XtPointer) MARGIN_DEFAULT }, { XmNdefaultButton, XmCWidget, XmRWidget, sizeof (Widget), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.default_button), XmRImmediate, (XtPointer) NULL }, { XmNcancelButton, XmCWidget, XmRWidget, sizeof (Widget), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.cancel_button), XmRImmediate, (XtPointer) NULL }, { XmNfocusCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.focus_callback), XmRImmediate, (XtPointer) NULL }, { XmNmapCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.map_callback), XmRImmediate, (XtPointer) NULL }, { XmNunmapCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.unmap_callback), XmRImmediate, (XtPointer) NULL }, { "pri.vate", "Pri.vate", XmRUnsignedChar, sizeof (unsigned char), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.check_set), XmRImmediate, 0 }, { XmNbuttonFontList, XmCButtonFontList, XmRButtonFontList, sizeof (XmFontList), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.button_font_list), XmRCallProc, (XtPointer) CheckSetRenderTables }, { XmNlabelFontList, XmCLabelFontList, XmRLabelFontList, sizeof (XmFontList), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.label_font_list), XmRCallProc, (XtPointer) CheckSetRenderTables }, { XmNtextFontList, XmCTextFontList, XmRTextFontList, sizeof (XmFontList), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.text_font_list), XmRCallProc, (XtPointer) CheckSetRenderTables }, { XmNbuttonRenderTable, XmCButtonRenderTable, XmRButtonRenderTable, sizeof (XmRenderTable), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.button_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables }, { XmNlabelRenderTable, XmCLabelRenderTable, XmRLabelRenderTable, sizeof (XmRenderTable), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.label_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables }, { XmNtextRenderTable, XmCTextRenderTable, XmRTextRenderTable, sizeof (XmRenderTable), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.text_font_list), XmRCallProc, (XtPointer)CheckSetRenderTables }, { XmNtextTranslations, XmCTranslations, XmRTranslationTable, sizeof (XtTranslations), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.text_translations), XmRImmediate, (XtPointer) NULL }, { XmNallowOverlap, XmCAllowOverlap, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.allow_overlap), XmRImmediate, (XtPointer) True }, { XmNautoUnmanage, XmCAutoUnmanage, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.auto_unmanage), XmRImmediate, (XtPointer) True }, { XmNdefaultPosition, XmCDefaultPosition, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.default_position), XmRImmediate, (XtPointer) True }, { XmNresizePolicy, XmCResizePolicy, XmRResizePolicy, sizeof (unsigned char), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.resize_policy), XmRImmediate, (XtPointer) XmRESIZE_ANY }, { XmNnoResize, XmCNoResize, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.no_resize), XmRImmediate, (XtPointer) False }, { XmNdialogStyle, XmCDialogStyle, XmRDialogStyle, sizeof (unsigned char), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.dialog_style), XmRImmediate, (XtPointer) XmDIALOG_MODELESS }, { XmNdialogTitle, XmCDialogTitle, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmBulletinBoardRec, bulletin_board.dialog_title), XmRImmediate, (XtPointer) NULL }, }; /**************************************************************** * * BulletinBoard class record * ****************************************************************/ externaldef( xmbulletinboardclassrec) XmBulletinBoardClassRec xmBulletinBoardClassRec = { { /* core_class fields */ (WidgetClass) &xmManagerClassRec, /* superclass */ "XmBulletinBoard", /* class_name */ sizeof(XmBulletinBoardRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class_part_init */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterlv */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ SetValuesHook, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ defaultTranslations, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator*/ NULL, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ InsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ NULL, /* resource list */ 0, /* num resources */ sizeof(XmManagerConstraintRec), /* constraint size */ NULL, /* init proc */ NULL, /* destroy proc */ NULL, /* set values proc */ NULL, /* extension */ }, { /* manager_class fields */ XtInheritTranslations, /* default translations */ syn_resources, /* syn_resources */ XtNumber (syn_resources), /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ BulletinBoardParentProcess, /* parent_process */ NULL, /* extension */ }, { /* bulletinBoard class fields */ FALSE, /*always_install_accelerators*/ NULL, /* geo_matrix_create */ _XmBulletinBoardFocusMoved, /* focus_moved_proc */ NULL /* extension */ } }; externaldef( xmbulletinboardwidgetclass) WidgetClass xmBulletinBoardWidgetClass = (WidgetClass) &xmBulletinBoardClassRec ; /* Trait record for BulletinB specify render table */ static XmConst XmSpecRenderTraitRec bulletinbSRT = { 0, /* version */ GetTable, }; /* Trait record for BulletinB dialog shell savvy */ static XmConst XmDialogSavvyTraitRec bulletinbDST = { 0, /* version */ CallMapUnmap, }; /* * Copy the XmString in XmNdialogTitle before returning it to the user. */ /*ARGSUSED*/ static void GetDialogTitle( Widget bb, int resource, /* unused */ XtArgVal *value) { XmString data ; /****************/ data = XmStringCopy((XmString) ((XmBulletinBoardWidget) bb) ->bulletin_board.dialog_title); *value = (XtArgVal) data ; return ; } /****************************************************************/ static void ClassPartInitialize( WidgetClass w_class ) { XmBulletinBoardWidgetClass bbClass = (XmBulletinBoardWidgetClass) w_class ; XmBulletinBoardWidgetClass bbSuper = (XmBulletinBoardWidgetClass) w_class->core_class.superclass ; _XmFastSubclassInit (w_class, XmBULLETIN_BOARD_BIT); if (bbClass->bulletin_board_class.geo_matrix_create == XmInheritGeoMatrixCreate ) { bbClass->bulletin_board_class.geo_matrix_create = bbSuper->bulletin_board_class.geo_matrix_create ; } if (bbClass->bulletin_board_class.focus_moved_proc == XmInheritFocusMovedProc ) { bbClass->bulletin_board_class.focus_moved_proc = bbSuper->bulletin_board_class.focus_moved_proc ; } /* Install the specifyrendertable trait for all subclasses */ XmeTraitSet((XtPointer)w_class, XmQTspecifyRenderTable, (XtPointer) &bulletinbSRT); /* Install the dialogShellsavyy trait for all subclasses */ XmeTraitSet((XtPointer)w_class, XmQTdialogShellSavvy, (XtPointer) &bulletinbDST); return ; } /**************************************************************** * Initialize a BulletinBoard instance. ****************/ /*ARGSUSED*/ static void Initialize( Widget wid_req, Widget wid_new, ArgList args, /* unused */ Cardinal *numArgs ) /* unused */ { XmBulletinBoardWidget request = (XmBulletinBoardWidget) wid_req ; XmBulletinBoardWidget new_w = (XmBulletinBoardWidget) wid_new ; Arg al[5] ; register Cardinal ac ; int mwm_functions ; char * text_value ; XmFontList defaultFL ; int mwmStyle ; Widget ancestor ; XmWidgetExtData extData ; XmBulletinBoardWidgetClass bbClass ; XmVendorShellExtObject vendorExt; /****************/ new_w->bulletin_board.in_set_values = False ; new_w->bulletin_board.geo_cache = (XmGeoMatrix) NULL ; new_w->bulletin_board.initial_focus = TRUE ; /* Copy font list data. */ defaultFL = BB_ButtonFontList( new_w) ; if( !defaultFL ) { defaultFL = XmeGetDefaultRenderTable( (Widget) new_w, XmBUTTON_FONTLIST) ; } BB_ButtonFontList( new_w) = XmFontListCopy( defaultFL) ; defaultFL = BB_LabelFontList( new_w) ; if( !defaultFL ) { defaultFL = XmeGetDefaultRenderTable( (Widget) new_w, XmLABEL_FONTLIST) ; } BB_LabelFontList( new_w) = XmFontListCopy( defaultFL) ; defaultFL = BB_TextFontList( new_w) ; if( !defaultFL ) { defaultFL = XmeGetDefaultRenderTable( (Widget) new_w, XmTEXT_FONTLIST) ; } BB_TextFontList( new_w) = XmFontListCopy( defaultFL) ; if( (request->manager.shadow_thickness == XmINVALID_DIMENSION) && XtIsShell( XtParent( request)) ){ new_w->manager.shadow_thickness = 1 ; } if(new_w->manager.shadow_thickness == XmINVALID_DIMENSION) new_w->manager.shadow_thickness = 0 ; /* Default and Cancel buttons are Set/Get resources only. The * DefaultButton field is used as a marker for the state of buttons * in the child list. As such, it is essential that it is NULL at * the end of Initialize. */ BB_DefaultButton( new_w) = NULL ; BB_CancelButton( new_w) = NULL ; /* The DynamicButton fields are managed and will be set appropriately * in the focus moved callback routine. */ BB_DynamicDefaultButton( new_w) = NULL ; BB_DynamicCancelButton( new_w) = NULL ; new_w->bulletin_board.old_shadow_thickness = 0 ; if( request->bulletin_board.dialog_title ) { new_w->bulletin_board.dialog_title = XmStringCopy( request->bulletin_board.dialog_title) ; XmeSetWMShellTitle(new_w->bulletin_board.dialog_title, XtParent(new_w)) ; } /* Set parent attributes. */ ac = 0 ; text_value = NULL ; /* Turn off window manager resize. */ if( request->bulletin_board.no_resize && XmIsVendorShell( XtParent( new_w)) ) { int old_mwm_functions ; XtSetArg( al[0], XmNmwmFunctions, &old_mwm_functions) ; XtGetValues( XtParent( new_w), al, 1) ; mwm_functions = (int) (XmIsDialogShell(XtParent(new_w)) ? DIALOG_FUNCS : CLIENT_FUNCS); if( old_mwm_functions != DONT_CARE ) { mwm_functions |= old_mwm_functions ; } mwm_functions &= ~MWM_FUNC_RESIZE ; XtSetArg( al[ac], XmNmwmFunctions, mwm_functions) ; ac++ ; } /* If parent is DialogShell, set dialog attributes and realize. */ if( XmIsDialogShell (XtParent (request)) ) { new_w->bulletin_board.shell = XtParent( request) ; switch( request->bulletin_board.dialog_style ) { case XmDIALOG_PRIMARY_APPLICATION_MODAL: { mwmStyle = MWM_INPUT_PRIMARY_APPLICATION_MODAL ; break ; } case XmDIALOG_FULL_APPLICATION_MODAL: { mwmStyle = MWM_INPUT_FULL_APPLICATION_MODAL ; break; } case XmDIALOG_SYSTEM_MODAL: { mwmStyle = MWM_INPUT_SYSTEM_MODAL ; break ; } case XmDIALOG_MODELESS: default: { mwmStyle = MWM_INPUT_MODELESS ; break ; } } XtSetArg( al[ac], XmNmwmInputMode, mwmStyle) ; ac++ ; XtSetValues( new_w->bulletin_board.shell, al, ac) ; XtRealizeWidget( new_w->bulletin_board.shell) ; } else { new_w->bulletin_board.shell = NULL ; if( ac ) { XtSetValues( XtParent (request), al, (Cardinal) ac) ; } } XtFree( text_value) ; if( !XmRepTypeValidValue( XmRID_SHADOW_TYPE, new_w->bulletin_board.shadow_type, (Widget) new_w) ) { new_w->bulletin_board.shadow_type = XmSHADOW_OUT ; } if( !XmRepTypeValidValue( XmRID_RESIZE_POLICY, new_w->bulletin_board.resize_policy, (Widget) new_w) ) { new_w->bulletin_board.resize_policy = XmRESIZE_ANY ; } if( new_w->bulletin_board.shell ) { if( !XmRepTypeValidValue( XmRID_DIALOG_STYLE, new_w->bulletin_board.dialog_style, (Widget) new_w) ) { new_w->bulletin_board.dialog_style = XmDIALOG_MODELESS ; } } else { if( new_w->bulletin_board.dialog_style != XmDIALOG_MODELESS ) { XmeWarning( (Widget) new_w, WARN_DIALOG_STYLE) ; new_w->bulletin_board.dialog_style = XmDIALOG_MODELESS ; } } /* Set source widget for accelerators used * by Manager in ConstraintInitialize. */ if( new_w->core.accelerators ) { new_w->manager.accelerator_widget = (Widget) new_w ; } bbClass = (XmBulletinBoardWidgetClass) new_w->core.widget_class ; if( bbClass->bulletin_board_class.focus_moved_proc ) { /* Walk up hierarchy to find vendor shell. Then setup moved focus * callback so default button can be maintained. */ ancestor = XtParent( new_w) ; while( ancestor && !XmIsVendorShell( ancestor) ) { ancestor = XtParent( ancestor) ; } if( ancestor && (extData = _XmGetWidgetExtData( ancestor, XmSHELL_EXTENSION)) && (extData->widget) ) { vendorExt = (XmVendorShellExtObject) extData->widget; _XmAddCallback((InternalCallbackList *) &(vendorExt->vendor.focus_moved_callback), (XtCallbackProc) bbClass->bulletin_board_class.focus_moved_proc, (XtPointer) new_w) ; } } new_w->bulletin_board.old_width = new_w->core.width; /* may be 0 */ new_w->bulletin_board.old_height = new_w->core.height; /* may be 0 */ return ; } /**************************************************************** * Free fontlists, etc. ****************/ static void Destroy( Widget wid ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; Widget ancestor ; XmWidgetExtData extData ; XmBulletinBoardWidgetClass bbClass ; XmVendorShellExtObject vendorExt; int num_children, i; Widget *childList; /* * Fix for 5209 - Check all ancestors to see if they are also bulletin * boards. If they are, check the values in the ancestor's * default_button, cancel_button, and dynamic buttons to * see if they match those of the bb being destroyed. If * they do, set those fields on the ancestor to NULL to * avoid accessing freed memory in the future. */ ancestor = XtParent( bb) ; while( ancestor && !XmIsVendorShell( ancestor) ) { if (XmIsBulletinBoard(ancestor)) { num_children = bb->composite.num_children; childList = bb->composite.children; for (i = 0; i < num_children; i++) { if (BB_CancelButton(ancestor) == childList[i]) BB_CancelButton(ancestor) = NULL; if (BB_DynamicCancelButton(ancestor) == childList[i]) BB_DynamicCancelButton(ancestor) = NULL; if (BB_DefaultButton(ancestor) == childList[i]) BB_DefaultButton(ancestor) = NULL; if (BB_DynamicDefaultButton(ancestor) == childList[i]) BB_DynamicDefaultButton(ancestor) = NULL; } } ancestor = XtParent( ancestor) ; } /* End 5209 */ XmStringFree( bb->bulletin_board.dialog_title) ; /* Free geometry cache. */ if( bb->bulletin_board.geo_cache ) { _XmGeoMatrixFree( bb->bulletin_board.geo_cache) ; } /* Free fontlists. */ if( bb->bulletin_board.button_font_list ) { XmFontListFree( bb->bulletin_board.button_font_list) ; } if( bb->bulletin_board.label_font_list ) { XmFontListFree( bb->bulletin_board.label_font_list) ; } if( bb->bulletin_board.text_font_list ) { XmFontListFree( bb->bulletin_board.text_font_list) ; } bbClass = (XmBulletinBoardWidgetClass) bb->core.widget_class ; if( bbClass->bulletin_board_class.focus_moved_proc ) { /* Walk up hierarchy to find vendor shell. Then remove focus moved * callback. */ ancestor = XtParent( bb) ; while( ancestor && !XmIsVendorShell( ancestor) ) { ancestor = XtParent( ancestor) ; } if( ancestor && !ancestor->core.being_destroyed && (extData = _XmGetWidgetExtData( ancestor, XmSHELL_EXTENSION)) ) { vendorExt = (XmVendorShellExtObject) extData->widget; _XmRemoveCallback((InternalCallbackList *) &(vendorExt->vendor.focus_moved_callback), (XtCallbackProc) bbClass->bulletin_board_class.focus_moved_proc, (XtPointer) bb) ; } } } /**************************************************************** * Modify attributes of a BulletinBoard instance. ****************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmBulletinBoardWidget current = (XmBulletinBoardWidget) cw ; XmBulletinBoardWidget request = (XmBulletinBoardWidget) rw ; XmBulletinBoardWidget new_w = (XmBulletinBoardWidget) nw ; Arg al[10] ; register Cardinal ac ; int mwm_functions ; int mwmStyle ; unsigned int numChildren ; unsigned int childIndex ; Widget * childList ; Boolean flag = False ; /****************/ current->bulletin_board.in_set_values = True ; if(new_w->bulletin_board.shadow_type != current->bulletin_board.shadow_type) { if (XmRepTypeValidValue( XmRID_SHADOW_TYPE, new_w->bulletin_board.shadow_type, (Widget) new_w) ) flag = True ; else new_w->bulletin_board.shadow_type = current->bulletin_board.shadow_type ; } if( (new_w->bulletin_board.resize_policy != current->bulletin_board.resize_policy) && !XmRepTypeValidValue( XmRID_RESIZE_POLICY, new_w->bulletin_board.resize_policy, (Widget) new_w) ) { new_w->bulletin_board.resize_policy = current->bulletin_board.resize_policy ; } if( new_w->bulletin_board.dialog_style != current->bulletin_board.dialog_style ) { if( new_w->bulletin_board.shell ) { if( !XmRepTypeValidValue( XmRID_DIALOG_STYLE, new_w->bulletin_board.dialog_style, (Widget) new_w) ) { new_w->bulletin_board.dialog_style = current->bulletin_board.dialog_style ; } } else { if( new_w->bulletin_board.dialog_style != XmDIALOG_MODELESS ) { XmeWarning( (Widget) new_w, WARN_DIALOG_STYLE) ; new_w->bulletin_board.dialog_style = current->bulletin_board.dialog_style ; } } } /* Update shell attributes. */ if( new_w->bulletin_board.dialog_title != current->bulletin_board.dialog_title ) { /* Update window manager title. */ XmStringFree( current->bulletin_board.dialog_title) ; new_w->bulletin_board.dialog_title = XmStringCopy( request->bulletin_board.dialog_title) ; XmeSetWMShellTitle(new_w->bulletin_board.dialog_title, XtParent(new_w)) ; } /* * Fix for 2940 - If the parent of the BulletinBoard is a VendorShell or * related to VendorShell, check the no_resize and * change it if necessary */ if (XmIsVendorShell(XtParent(new_w))) { ac = 0 ; /* Turn window manager resize on or off. */ if( new_w->bulletin_board.no_resize != current->bulletin_board.no_resize ) { XtSetArg( al[0], XmNmwmFunctions, &mwm_functions) ; XtGetValues( XtParent( new_w), al, 1) ; if( mwm_functions == DONT_CARE ) { mwm_functions = (int) (XmIsDialogShell(XtParent(new_w)) ? DIALOG_FUNCS : CLIENT_FUNCS); } if( new_w->bulletin_board.no_resize ) { mwm_functions &= ~MWM_FUNC_RESIZE ; } else { mwm_functions |= MWM_FUNC_RESIZE ; } XtSetArg( al[ac], XmNmwmFunctions, mwm_functions) ; ac++ ; } if( new_w->bulletin_board.shell ) { if( new_w->bulletin_board.dialog_style != current->bulletin_board.dialog_style ) { if( !XmRepTypeValidValue( XmRID_DIALOG_STYLE, new_w->bulletin_board.dialog_style, (Widget) new_w) ) { new_w->bulletin_board.dialog_style = current->bulletin_board.dialog_style ; } else { switch( new_w->bulletin_board.dialog_style ) { case XmDIALOG_PRIMARY_APPLICATION_MODAL: { mwmStyle = MWM_INPUT_PRIMARY_APPLICATION_MODAL ; break ; } case XmDIALOG_FULL_APPLICATION_MODAL: { mwmStyle = MWM_INPUT_FULL_APPLICATION_MODAL ; break ; } case XmDIALOG_SYSTEM_MODAL: { mwmStyle = MWM_INPUT_SYSTEM_MODAL ; break ; } case XmDIALOG_MODELESS: default: { mwmStyle = MWM_INPUT_MODELESS ; break ; } } XtSetArg( al[ac], XmNmwmInputMode, mwmStyle) ; ac++ ; } } } if( ac ) { XtSetValues( XtParent (new_w), al, ac) ; } } /* Copy new font list data, free previous. */ if( request->bulletin_board.button_font_list != current->bulletin_board.button_font_list ) { if( current->bulletin_board.button_font_list ) { XmFontListFree( current->bulletin_board.button_font_list) ; } if( new_w->bulletin_board.button_font_list ) { new_w->bulletin_board.button_font_list = XmFontListCopy( request->bulletin_board.button_font_list) ; } if( !new_w->bulletin_board.button_font_list ) { new_w->bulletin_board.button_font_list = XmFontListCopy( XmeGetDefaultRenderTable( (Widget) new_w, XmBUTTON_FONTLIST)) ; } } if( request->bulletin_board.label_font_list != current->bulletin_board.label_font_list ) { if( current->bulletin_board.label_font_list ) { XmFontListFree( current->bulletin_board.label_font_list) ; } if( new_w->bulletin_board.label_font_list ) { new_w->bulletin_board.label_font_list = XmFontListCopy( request->bulletin_board.label_font_list) ; } if( !new_w->bulletin_board.label_font_list ) { new_w->bulletin_board.label_font_list = XmFontListCopy( XmeGetDefaultRenderTable( (Widget) new_w, XmLABEL_FONTLIST)) ; } } if( request->bulletin_board.text_font_list != current->bulletin_board.text_font_list ) { if( current->bulletin_board.text_font_list ) { XmFontListFree( current->bulletin_board.text_font_list) ; } if( new_w->bulletin_board.text_font_list ) { new_w->bulletin_board.text_font_list = XmFontListCopy( request->bulletin_board.text_font_list) ; } if( !new_w->bulletin_board.text_font_list ) { new_w->bulletin_board.text_font_list = XmFontListCopy( XmeGetDefaultRenderTable( (Widget) new_w, XmTEXT_FONTLIST)) ; } } if( BB_DefaultButton( new_w) != BB_DefaultButton( current) ) { if( !BB_DefaultButton( current) ) { /* This is the a new default button. Notify all potential default button that they might turn default on sooner */ numChildren = new_w->composite.num_children ; childList = new_w->composite.children ; childIndex = 0 ; while(childIndex < numChildren ) { BulletinBoardSetDefaultShadow( childList[childIndex]) ; ++childIndex ; } } BBUpdateDynDefaultButton( (Widget) new_w) ; } if( !(new_w->manager.initial_focus) && BB_DefaultButton( new_w) ) { _XmSetInitialOfTabGroup( (Widget) new_w, BB_DefaultButton( new_w)) ; } if(new_w->manager.shadow_thickness != current->manager.shadow_thickness) { flag = True ; new_w->bulletin_board.old_shadow_thickness = new_w->manager.shadow_thickness ; } if( XtClass( new_w) == xmBulletinBoardWidgetClass ) { /* do the margin enforcement only for pure BB, not subclasses, which have their own layout */ if (((new_w->bulletin_board.margin_width != current->bulletin_board.margin_width) || (new_w->bulletin_board.margin_height != current->bulletin_board.margin_height))) { /* Do not change size if not realized; otherwise, ChangeManaged will assume that the user set a size resource, and will not resize to fit children added after this call, but before realizing. ChangeManaged will perform layout at realize-time. */ if (XtIsRealized((Widget)new_w)) { /* move the child around if necessary */ _XmGMEnforceMargin((XmManagerWidget)new_w, new_w->bulletin_board.margin_width, new_w->bulletin_board.margin_height, False); /* use movewidget, no request */ _XmGMCalcSize ((XmManagerWidget)new_w, new_w->bulletin_board.margin_width, new_w->bulletin_board.margin_height, &new_w->core.width, &new_w->core.height); } } } current->bulletin_board.in_set_values = False ; return( flag) ; } /****************************************************************/ static Boolean SetValuesHook( Widget wid, ArgList args, Cardinal *num_args ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; int i; Widget shell = bb->bulletin_board.shell; /****************/ /* look the comments on MAGIC in DialogSavvyT.h */ if (!shell) return (False); for (i=0; i<*num_args; i++) { if (strcmp (args[i].name, XmNx) == 0) { if ((args[i].value == 0) && (XtX (bb) == 0)) { XtX (bb) = XmDIALOG_SAVVY_FORCE_ORIGIN; } } if (strcmp (args[i].name, XmNy) == 0) { if ((args[i].value == 0) && (XtY (bb) == 0)) { XtY (bb) = XmDIALOG_SAVVY_FORCE_ORIGIN; } } } return (False); } /**************************************************************** * Arrange widgets and make geometry request if necessary. ****************/ static void HandleChangeManaged( XmBulletinBoardWidget bbWid, XmGeoCreateProc geoMatrixCreate) { Dimension desired_w = 0 ; Dimension desired_h = 0 ; Dimension allowed_w ; Dimension allowed_h ; XmGeoMatrix geoSpec ; /****************/ /* honor initial sizes if given and resize_none sizes */ if (!XtIsRealized((Widget)bbWid)) { if (XtWidth(bbWid)) desired_w = XtWidth(bbWid) ; if (XtHeight(bbWid)) desired_h = XtHeight(bbWid) ; } else { if(BB_ResizePolicy(bbWid) == XmRESIZE_NONE) { desired_w = XtWidth(bbWid) ; desired_h = XtHeight(bbWid) ; } } geoSpec = (*geoMatrixCreate)( (Widget) bbWid, NULL, NULL) ; _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &desired_w, &desired_h) ; /* Adjust desired width and height if resize_grow. */ if( BB_ResizePolicy( bbWid) == XmRESIZE_GROW ) { Boolean reset_w = False ; Boolean reset_h = False ; if( desired_w < XtWidth( bbWid) ) { desired_w = XtWidth( bbWid) ; reset_w = True ; } if( desired_h < XtHeight( bbWid) ) { desired_h = XtHeight( bbWid) ; reset_h = True ; } if( reset_w || reset_h ) { _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &desired_w, &desired_h) ; } } /* Request new geometry from parent. */ if( (desired_h != XtHeight( bbWid)) || (desired_w != XtWidth( bbWid)) ) { switch( XtMakeResizeRequest( (Widget) bbWid, desired_w, desired_h, &allowed_w, &allowed_h) ) { case XtGeometryYes: { break ; } case XtGeometryAlmost: { XtMakeResizeRequest( (Widget) bbWid, allowed_w, allowed_h, NULL, NULL) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &allowed_w, &allowed_h) ; break ; } case XtGeometryNo: default: { allowed_w = XtWidth( bbWid) ; allowed_h = XtHeight( bbWid) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &allowed_w, &allowed_h) ; break ; } } /* Clear shadow if necessary. */ if( bbWid->bulletin_board.old_shadow_thickness && ( (allowed_w > bbWid->bulletin_board.old_width) || (allowed_h > bbWid->bulletin_board.old_height)) ) { _XmClearShadowType( (Widget) bbWid, bbWid->bulletin_board.old_width, bbWid->bulletin_board.old_height, bbWid->bulletin_board.old_shadow_thickness, (Dimension) 0) ; bbWid->bulletin_board.old_shadow_thickness = 0 ; } } /* Update children. */ _XmGeoMatrixSet( geoSpec) ; _XmGeoMatrixFree( geoSpec) ; if( bbWid->manager.shadow_thickness && (XtWidth( bbWid) <= bbWid->bulletin_board.old_width) && (XtHeight( bbWid) <= bbWid->bulletin_board.old_height) ) { XmeDrawShadows(XtDisplay((Widget) bbWid), XtWindow((Widget) bbWid), bbWid->manager.top_shadow_GC, bbWid->manager.bottom_shadow_GC, 0, 0, bbWid->core.width, bbWid->core.height, bbWid->manager.shadow_thickness, bbWid->bulletin_board.shadow_type) ; bbWid->bulletin_board.old_shadow_thickness = bbWid->manager.shadow_thickness ; } bbWid->bulletin_board.old_width = bbWid->core.width ; bbWid->bulletin_board.old_height = bbWid->core.height ; XmeNavigChangeManaged( (Widget) bbWid) ; return ; } /**************************************************************** * Arrange widgets based on new size. ****************/ static void HandleResize( XmBulletinBoardWidget bbWid, XmGeoCreateProc geoMatrixCreate) { Dimension new_w = XtWidth( bbWid) ; Dimension new_h = XtHeight( bbWid) ; XmGeoMatrix geoSpec ; /*********** draw_shadow is not used ************** Boolean draw_shadow = False ; ****************/ /* Clear shadow. */ if( bbWid->bulletin_board.old_shadow_thickness && ( (bbWid->bulletin_board.old_width != bbWid->core.width) || (bbWid->bulletin_board.old_height != bbWid->core.height)) ) { _XmClearShadowType( (Widget) bbWid, bbWid->bulletin_board.old_width, bbWid->bulletin_board.old_height, bbWid->bulletin_board.old_shadow_thickness, (Dimension) 0) ; bbWid->bulletin_board.old_shadow_thickness = 0 ; } geoSpec = (*geoMatrixCreate)( (Widget) bbWid, NULL, NULL) ; _XmGeoMatrixGet( geoSpec, XmGET_PREFERRED_SIZE) ; _XmGeoArrangeBoxes( geoSpec, (Position) 0, (Position) 0, &new_w, &new_h) ; _XmGeoMatrixSet( geoSpec) ; if( bbWid->manager.shadow_thickness && (XtWidth( bbWid) <= bbWid->bulletin_board.old_width) && (XtHeight( bbWid) <= bbWid->bulletin_board.old_height) ) { XmeDrawShadows(XtDisplay((Widget) bbWid), XtWindow((Widget) bbWid), bbWid->manager.top_shadow_GC, bbWid->manager.bottom_shadow_GC, 0, 0, bbWid->core.width, bbWid->core.height, bbWid->manager.shadow_thickness, bbWid->bulletin_board.shadow_type) ; bbWid->bulletin_board.old_shadow_thickness = bbWid->manager.shadow_thickness ; } bbWid->bulletin_board.old_width = bbWid->core.width ; bbWid->bulletin_board.old_height = bbWid->core.height ; _XmGeoMatrixFree( geoSpec) ; return ; } /**************************************************************** * Handle geometry requests from children. ****************/ static XtGeometryResult HandleGeometryManager( Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *allowed, XmGeoCreateProc geoMatrixCreate) { XmBulletinBoardWidget bbWid ; XtGeometryResult result ; /****************/ bbWid = (XmBulletinBoardWidget) XtParent( instigator) ; if( !(desired->request_mode & (CWWidth | CWHeight)) ) { return (XtGeometryYes) ; } /* Clear shadow if necessary. */ if( bbWid->bulletin_board.old_shadow_thickness && (BB_ResizePolicy( bbWid) != XmRESIZE_NONE) ) { _XmClearShadowType( (Widget) bbWid, bbWid->bulletin_board.old_width, bbWid->bulletin_board.old_height, bbWid->bulletin_board.old_shadow_thickness, 0) ; bbWid->bulletin_board.old_shadow_thickness = 0 ; } result = _XmHandleGeometryManager( (Widget) bbWid, instigator, desired, allowed, BB_ResizePolicy( bbWid), &bbWid->bulletin_board.geo_cache, geoMatrixCreate) ; if( !bbWid->bulletin_board.in_set_values && bbWid->manager.shadow_thickness && (XtWidth( bbWid) <= bbWid->bulletin_board.old_width) && (XtHeight( bbWid) <= bbWid->bulletin_board.old_height) ) { XmeDrawShadows(XtDisplay((Widget) bbWid), XtWindow((Widget) bbWid), bbWid->manager.top_shadow_GC, bbWid->manager.bottom_shadow_GC, 0, 0, bbWid->core.width, bbWid->core.height, bbWid->manager.shadow_thickness, bbWid->bulletin_board.shadow_type) ; bbWid->bulletin_board.old_shadow_thickness = bbWid->manager.shadow_thickness ; } bbWid->bulletin_board.old_width = bbWid->core.width ; bbWid->bulletin_board.old_height = bbWid->core.height ; return( result) ; } /****************************************************************/ void _XmBulletinBoardSizeUpdate( Widget wid ) { XmBulletinBoardWidget bbWid = (XmBulletinBoardWidget) wid ; XmBulletinBoardWidgetClass classPtr = (XmBulletinBoardWidgetClass) bbWid->core.widget_class ; /****************/ if( !XtIsRealized((Widget)bbWid) ) { return ; } if( classPtr->bulletin_board_class.geo_matrix_create ) { /* Clear shadow if necessary. */ if( bbWid->bulletin_board.old_shadow_thickness && (BB_ResizePolicy( bbWid) != XmRESIZE_NONE) ) { _XmClearShadowType( (Widget) bbWid, bbWid->bulletin_board.old_width, bbWid->bulletin_board.old_height, bbWid->bulletin_board.old_shadow_thickness, 0) ; bbWid->bulletin_board.old_shadow_thickness = 0 ; } _XmHandleSizeUpdate( (Widget) bbWid, BB_ResizePolicy( bbWid), classPtr->bulletin_board_class.geo_matrix_create) ; if( bbWid->manager.shadow_thickness && (XtWidth( bbWid) <= bbWid->bulletin_board.old_width) && (XtHeight( bbWid) <= bbWid->bulletin_board.old_height) ) { XmeDrawShadows(XtDisplay((Widget) bbWid), XtWindow((Widget) bbWid), bbWid->manager.top_shadow_GC, bbWid->manager.bottom_shadow_GC, 0, 0, bbWid->core.width, bbWid->core.height, bbWid->manager.shadow_thickness, bbWid->bulletin_board.shadow_type) ; bbWid->bulletin_board.old_shadow_thickness = bbWid->manager.shadow_thickness ; } } bbWid->bulletin_board.old_width = bbWid->core.width ; bbWid->bulletin_board.old_height = bbWid->core.height ; return ; } /**************************************************************** * Layout children of the BulletinBoard. ****************/ static void ChangeManaged( Widget wid ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; XmBulletinBoardWidgetClass classPtr = (XmBulletinBoardWidgetClass) bb->core.widget_class ; /****************/ if( classPtr->bulletin_board_class.geo_matrix_create ) { HandleChangeManaged( bb, classPtr->bulletin_board_class.geo_matrix_create) ; return ; } /* function shared with Bulletin Board */ _XmGMEnforceMargin((XmManagerWidget)bb, bb->bulletin_board.margin_width, bb->bulletin_board.margin_height, False); /* use movewidget, not setvalue */ /* Clear shadow if necessary. */ if( bb->bulletin_board.old_shadow_thickness ) { _XmClearShadowType( (Widget) bb, bb->bulletin_board.old_width, bb->bulletin_board.old_height, bb->bulletin_board.old_shadow_thickness, 0) ; bb->bulletin_board.old_shadow_thickness = 0 ; } /* The first time, reconfigure only if explicit size were not given */ if (XtIsRealized((Widget)bb) || (!XtWidth(bb)) || (!XtHeight(bb))) { /* function shared with DrawingArea */ (void)_XmGMDoLayout((XmManagerWidget)bb, bb->bulletin_board.margin_width, bb->bulletin_board.margin_height, bb->bulletin_board.resize_policy, False); /* queryonly not specified */ } if( bb->manager.shadow_thickness && (XtWidth( bb) <= bb->bulletin_board.old_width) && (XtHeight( bb) <= bb->bulletin_board.old_height) ) { XmeDrawShadows(XtDisplay((Widget) bb), XtWindow((Widget) bb), bb->manager.top_shadow_GC, bb->manager.bottom_shadow_GC, 0, 0, bb->core.width, bb->core.height, bb->manager.shadow_thickness, bb->bulletin_board.shadow_type) ; bb->bulletin_board.old_shadow_thickness = bb->manager.shadow_thickness ; } bb->bulletin_board.old_width = bb->core.width ; bb->bulletin_board.old_height = bb->core.height ; XmeNavigChangeManaged( (Widget) bb) ; return ; } /**************************************************************** * Unmanage BulletinBoard after button is activated. ****************/ /*ARGSUSED*/ static void UnmanageCallback( Widget w, /* unused */ XtPointer client_data, XtPointer call_data ) /* unused */ { Widget bb = (Widget) client_data ; /****************/ XtUnmanageChild( bb) ; return ; } /**************************************************************** * Add a child to the BulletinBoard. ****************/ static void InsertChild( Widget child ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) XtParent( child) ; Boolean is_button = False ; XtWidgetProc insert_child; _XmProcessLock(); insert_child = ((XmManagerWidgetClass) xmManagerWidgetClass) ->composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(child); if( !XtIsRectObj( child) ) { return ; } if(XmeTraitGet((XtPointer)XtClass(child), XmQTtakesDefault)) { is_button = TRUE ; if( BB_DefaultButton( bb) ) { /* Notify child that it has to be ready for default visual */ BulletinBoardSetDefaultShadow( child) ; } } if( XmIsDrawnButton( child) ) { is_button = True ; } /* Now, here I could use the activatable trait to add the auto_unmanage callback but I'm afraid that by covering the Arrow button I introduce behavior compatibility problem, so I keep the DrawnButton check for now */ if( is_button && bb->bulletin_board.shell && bb->bulletin_board.auto_unmanage ) { XtAddCallback( child, XmNactivateCallback, UnmanageCallback, (XtPointer) bb) ; } if( XmIsText (child) || XmIsTextField (child) ) { if( bb->bulletin_board.text_translations ) { XtOverrideTranslations( child, bb->bulletin_board.text_translations) ; } } return ; } /**************************************************************** * Clear widget id in instance record ****************/ static void DeleteChild( Widget child ) { XmBulletinBoardWidget bb ; XtWidgetProc delete_child; /****************/ if( XtIsRectObj( child) ) { bb = (XmBulletinBoardWidget) XtParent( child) ; /* To fix CR #4882, unnest the following to allow for one button to be more than one of the defined buttons */ if( child == BB_DefaultButton( bb) ) BB_DefaultButton( bb) = NULL ; if( child == BB_DynamicDefaultButton( bb) ) BB_DynamicDefaultButton( bb) = NULL ; if( child == BB_CancelButton( bb) ) BB_CancelButton( bb) = NULL ; if( child == BB_DynamicCancelButton( bb) ) BB_DynamicCancelButton( bb) = NULL ; } _XmProcessLock(); delete_child = ((XmManagerWidgetClass) xmManagerWidgetClass) ->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child); return ; } /****************************************************************/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XmBulletinBoardWidget bb ; XmBulletinBoardWidgetClass classPtr ; /****************/ bb = (XmBulletinBoardWidget) w->core.parent ; classPtr = (XmBulletinBoardWidgetClass) bb->core.widget_class ; if( classPtr->bulletin_board_class.geo_matrix_create ) { return( HandleGeometryManager( w, request, reply, classPtr->bulletin_board_class.geo_matrix_create)) ; } /* function shared with DrawingArea */ return(_XmGMHandleGeometryManager((Widget)bb, w, request, reply, bb->bulletin_board.margin_width, bb->bulletin_board.margin_height, bb->bulletin_board.resize_policy, bb->bulletin_board.allow_overlap)); } /**************************************************************** * Handle query geometry requests ****************/ static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; XmBulletinBoardWidgetClass classPtr = (XmBulletinBoardWidgetClass) bb->core.widget_class ; /****************/ if( classPtr->bulletin_board_class.geo_matrix_create ) { return( _XmHandleQueryGeometry( (Widget) bb, intended, desired, BB_ResizePolicy( bb), classPtr->bulletin_board_class.geo_matrix_create)) ; } /* function shared with DrawingArea */ return(_XmGMHandleQueryGeometry(wid, intended, desired, bb->bulletin_board.margin_width, bb->bulletin_board.margin_height, bb->bulletin_board.resize_policy)); } /**************************************************************** * Conform to new size. ****************/ static void Resize( Widget wid ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; XmBulletinBoardWidgetClass classPtr = (XmBulletinBoardWidgetClass) bb->core.widget_class ; /****************/ if( classPtr->bulletin_board_class.geo_matrix_create ) { HandleResize( bb, classPtr->bulletin_board_class.geo_matrix_create) ; return ; } /* Clear shadow. */ if( bb->bulletin_board.old_shadow_thickness ) { _XmClearShadowType( (Widget) bb, bb->bulletin_board.old_width, bb->bulletin_board.old_height, bb->bulletin_board.old_shadow_thickness, 0) ; bb->bulletin_board.old_shadow_thickness = 0 ; } if( bb->manager.shadow_thickness && (XtWidth( bb) <= bb->bulletin_board.old_width) && (XtHeight( bb) <= bb->bulletin_board.old_height) ) { XmeDrawShadows(XtDisplay((Widget) bb), XtWindow((Widget) bb), bb->manager.top_shadow_GC, bb->manager.bottom_shadow_GC, 0, 0, bb->core.width, bb->core.height, bb->manager.shadow_thickness, bb->bulletin_board.shadow_type) ; bb->bulletin_board.old_shadow_thickness = bb->manager.shadow_thickness ; } bb->bulletin_board.old_width = bb->core.width ; bb->bulletin_board.old_height = bb->core.height ; return ; } /**************************************************************** * Redisplay gadgets and draw shadow. ****************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; /****************/ /* Redisplay gadgets. */ XmeRedisplayGadgets( wid, event, region) ; /* Draw shadow. */ if( bb->manager.shadow_thickness ) { XmeDrawShadows(XtDisplay((Widget) bb), XtWindow((Widget) bb), bb->manager.top_shadow_GC, bb->manager.bottom_shadow_GC, 0, 0, bb->core.width, bb->core.height, bb->manager.shadow_thickness, bb->bulletin_board.shadow_type) ; bb->bulletin_board.old_shadow_thickness = bb->manager.shadow_thickness ; } bb->bulletin_board.old_width = bb->core.width ; bb->bulletin_board.old_height = bb->core.height ; return ; } /****************************************************************/ /*ARGSUSED*/ void _XmBulletinBoardFocusMoved( Widget wid, /* unused */ XtPointer client_data, XtPointer data ) { XmFocusMovedCallbackStruct * call_data = (XmFocusMovedCallbackStruct *) data ; Widget ancestor ; XmBulletinBoardWidget bb = (XmBulletinBoardWidget) client_data ; XmAnyCallbackStruct cb ; Boolean BBHasFocus = FALSE ; Boolean BBHadFocus = FALSE ; Widget dbutton = NULL ; Widget cbutton = NULL ; /****************/ if( !call_data->cont ) { /* Preceding callback routine wants focus-moved processing * to be discontinued. */ return ; } /* Walk the heirarchy above the widget that is getting the focus to * determine the correct default and cancel buttons for the current * context. * Note that no changes are made to the Bulletin Board instance record * until after the possibility of a forced traversal is evaluated. */ ancestor = call_data->new_focus ; while( ancestor && !XtIsShell( ancestor) ) { if( ancestor == (Widget) bb ) { BBHasFocus = TRUE ; break ; } if( XmIsBulletinBoard( ancestor) ) { if( !dbutton ) { dbutton = BB_DefaultButton( ancestor) ; } if( !cbutton ) { cbutton = BB_CancelButton( ancestor) ; } } ancestor = XtParent( ancestor) ; } ancestor = call_data->old_focus ; while( ancestor && !XtIsShell( ancestor) ) { if( ancestor == (Widget) bb ) { BBHadFocus = TRUE ; break ; } ancestor = XtParent( ancestor) ; } if( BBHasFocus ) { /* The widget getting the input focus is a descendent of * or is this Bulletin Board. * If there were no descendent Bulletin Boards with default or cancel * buttons, use our own. */ if( !dbutton ) dbutton = BB_DefaultButton( bb) ; if( !cbutton ) cbutton = BB_CancelButton( bb) ; if( !dbutton ) { /* No descendant has active default button, so be sure * that the dynamic_default_button field for this * ancestor is NULL. */ BB_DynamicDefaultButton( bb) = NULL ; } else { if(XmeTraitGet((XtPointer)XtClass(call_data->new_focus), XmQTtakesDefault)) { /* Any defaultable which gets the focus * gets the default visuals and behavior. */ _XmBulletinBoardSetDynDefaultButton( (Widget) bb, call_data->new_focus) ; } else /* call_data->new_focus is not a push button */ { if( (call_data->focus_policy == XmEXPLICIT) || !XmIsManager( call_data->new_focus) || !call_data->old_focus || (!XmeTraitGet((XtPointer)XtClass(call_data->old_focus), XmQTtakesDefault))) { /* Avoid setting the default button when in pointer mode, * leaving a button, and entering the background area. * The appropriate default button will be set when the * next focus moved event occurs. * This will avoid unnecessary flashing of default * button shadow when moving pointer between buttons. */ if( XtIsManaged( dbutton) ) { _XmBulletinBoardSetDynDefaultButton((Widget) bb, dbutton) ; } } } } BB_DynamicCancelButton( bb) = cbutton ; if( !BBHadFocus ) { cb.reason = XmCR_FOCUS ; cb.event = NULL ; XtCallCallbackList( (Widget) bb, bb->bulletin_board.focus_callback, &cb) ; } } else /* Bulletin Board does not have focus */ { if( BBHadFocus ) { if( call_data->new_focus != NULL ) { _XmBulletinBoardSetDynDefaultButton( (Widget) bb, NULL) ; } } } BB_InitialFocus( bb) = FALSE ; return ; } /****************************************************************/ static Boolean BulletinBoardParentProcess( Widget wid, XmParentProcessData event ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; /****************/ if( (event->any.process_type == XmINPUT_ACTION) && ( ( (event->input_action.action == XmPARENT_ACTIVATE) && BB_DynamicDefaultButton( bb)) || ( (event->input_action.action == XmPARENT_CANCEL) && BB_DynamicCancelButton( bb))) ) { if( event->input_action.action == XmPARENT_ACTIVATE ) { _XmBulletinBoardReturn( (Widget)bb, event->input_action.event, event->input_action.params, event->input_action.num_params) ; } else { _XmBulletinBoardCancel( (Widget)bb, event->input_action.event, event->input_action.params, event->input_action.num_params) ; } return( TRUE) ; } return( _XmParentProcess( XtParent( bb), event)) ; } /**************************************************************** * Process Return and Enter key events in the BulletinBoard. * If there is a default button, call its Activate callbacks. ****************/ void _XmBulletinBoardReturn(Widget wid, XEvent *event, String *params, Cardinal *numParams ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; XmGadgetClass gadget_class ; XmPrimitiveWidgetClass primitive_class ; Widget dbutton = BB_DynamicDefaultButton( bb) ; if (!dbutton) { XmParentInputActionRec parentEvent ; parentEvent.process_type = XmINPUT_ACTION ; parentEvent.action = XmPARENT_ACTIVATE ; parentEvent.event = event ; parentEvent.params = params ; parentEvent.num_params = numParams ; _XmParentProcess( XtParent( bb), (XmParentProcessData) &parentEvent) ; } else if (XmIsGadget( dbutton) && XtIsManaged( dbutton)) { gadget_class = (XmGadgetClass) XtClass( dbutton) ; if (gadget_class->gadget_class.arm_and_activate && XtIsSensitive(dbutton)) { (*(gadget_class->gadget_class.arm_and_activate)) (dbutton, event, params, numParams) ; } } else if (XmIsPrimitive( dbutton) && XtIsManaged( dbutton)) { primitive_class = (XmPrimitiveWidgetClass) XtClass( dbutton) ; if (primitive_class->primitive_class.arm_and_activate && XtIsSensitive(dbutton)) { (*(primitive_class->primitive_class.arm_and_activate)) (dbutton, event, params, numParams); } } else { if (XtIsSensitive(dbutton)) { XmAnyCallbackStruct cb ; cb.reason = XmCR_ACTIVATE ; cb.event = event ; XtCallCallbacks(dbutton, XmNactivateCallback, (XtPointer) &cb) ; } } } /**************************************************************** * Process Cancel key events in the BulletinBoard. * If there is a cancel button, call its Activate callbacks. ****************/ void _XmBulletinBoardCancel(Widget wid, XEvent *event, String *params, Cardinal *numParams ) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; XmGadgetClass gadget_class ; XmPrimitiveWidgetClass primitive_class ; Widget cbutton = BB_DynamicCancelButton( bb) ; if (!cbutton) { XmParentInputActionRec parentEvent ; parentEvent.process_type = XmINPUT_ACTION ; parentEvent.action = XmPARENT_CANCEL ; parentEvent.event = event ; parentEvent.params = params ; parentEvent.num_params = numParams ; _XmParentProcess( XtParent( bb), (XmParentProcessData) &parentEvent) ; } else if (XmIsGadget(cbutton) && XtIsManaged(cbutton)) { gadget_class = (XmGadgetClass) XtClass( cbutton) ; if (gadget_class->gadget_class.arm_and_activate && XtIsSensitive( cbutton)) { (*(gadget_class->gadget_class.arm_and_activate)) (cbutton, event, params, numParams) ; } } else if (XmIsPrimitive( cbutton) && XtIsManaged( cbutton)) { primitive_class = (XmPrimitiveWidgetClass) XtClass( cbutton) ; if (primitive_class->primitive_class.arm_and_activate && XtIsSensitive(cbutton)) { (*(primitive_class->primitive_class.arm_and_activate)) (cbutton, event, params, numParams) ; } } else { if (XtIsSensitive(cbutton)) { XmAnyCallbackStruct cb ; cb.reason = XmCR_ACTIVATE ; cb.event = event ; XtCallCallbacks( cbutton, XmNactivateCallback, (XtPointer) &cb) ; } } } /*ARGSUSED*/ void _XmBulletinBoardMap( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *numParams ) /* unused */ { if( BB_DefaultButton( wid) ) { Widget focus_hier = _XmGetFirstFocus( wid) ; while( focus_hier && !XtIsShell( focus_hier) ) { if( focus_hier == wid ) { _XmBulletinBoardSetDynDefaultButton( wid, BB_DefaultButton( wid)) ; break ; } if( XmIsBulletinBoard( focus_hier) && BB_DefaultButton( focus_hier) ) { break ; } focus_hier = XtParent( focus_hier) ; } } } /****************************************************************/ static void BulletinBoardSetDefaultShadow( Widget button ) { XmTakesDefaultTrait trait_default ; trait_default = (XmTakesDefaultTrait) XmeTraitGet((XtPointer) XtClass(button), XmQTtakesDefault) ; if (trait_default) trait_default->showAsDefault (button, XmDEFAULT_READY); } /**************************************************************** * If the default button of the bulletin board widget (wid) is not equal to * the specified default button (newDefaultButton), then the trait is used * to turn off/on the appropriate default borders and the default button * field of the bulletin board instance record is updated appropriately. ****************/ void _XmBulletinBoardSetDynDefaultButton( Widget wid, Widget newDefaultButton ) { XmBulletinBoardWidget bbWid = (XmBulletinBoardWidget) wid ; XmTakesDefaultTrait trait_default ; if (newDefaultButton != BB_DynamicDefaultButton( bbWid)) { if (BB_DynamicDefaultButton(bbWid)) { trait_default = (XmTakesDefaultTrait) XmeTraitGet((XtPointer) XtClass(BB_DynamicDefaultButton(bbWid)), XmQTtakesDefault) ; if (trait_default) trait_default->showAsDefault ((Widget) BB_DynamicDefaultButton(bbWid), XmDEFAULT_OFF); } BB_DynamicDefaultButton( bbWid) = newDefaultButton ; if (newDefaultButton) { trait_default = (XmTakesDefaultTrait) XmeTraitGet((XtPointer) XtClass(BB_DynamicDefaultButton(bbWid)), XmQTtakesDefault) ; if (trait_default) trait_default->showAsDefault ((Widget) BB_DynamicDefaultButton(bbWid), XmDEFAULT_ON); } } return ; } static void BBUpdateDynDefaultButton( Widget bb) { Widget bbwdb = GetBBWithDB( bb) ; if( bbwdb == NULL ) { if( ((XmBulletinBoardWidget) bb) ->bulletin_board.dynamic_default_button ) { _XmBulletinBoardSetDynDefaultButton( bb, NULL) ; } } else { if( bbwdb == bb ) { _XmBulletinBoardSetDynDefaultButton( bb, BB_DefaultButton( bb)) ; } } } static Widget GetBBWithDB( Widget wid) { Widget focus ; if( (_XmGetFocusPolicy( wid) == XmEXPLICIT) && ( (focus = XmGetFocusWidget( wid)) || (focus = _XmGetFirstFocus( wid))) ) { while( focus && !XtIsShell( focus) ) { if( XmIsBulletinBoard( focus) && BB_DefaultButton( focus) ) { return focus ; } focus = XtParent( focus) ; } } return NULL ; } /* * XmRCallProc routine for checking font before setting it to NULL * if no value is specified for both XmNrenderTable and XmNfontList. * If the appropriate bit in "check_state" is True, this function has * been called twice on same widget for that resource, thus * the resource needs to be set NULL, otherwise leave it alone. */ /* ARGSUSED */ static void CheckSetRenderTables(Widget wid, int offset, XrmValue *value ) { #define SET_BFL(state) (state |= 0x01) #define IS_SET_BFL(state) (state & 0x01) #define SET_LFL(state) (state |= 0x02) #define IS_SET_LFL(state) (state & 0x02) #define SET_TFL(state) (state |= 0x04) #define IS_SET_TFL(state) (state & 0x04) XmBulletinBoardWidget bbw = (XmBulletinBoardWidget)wid; if (((char*)bbw + offset) == (char*) &(bbw->bulletin_board.button_font_list)) { if (IS_SET_BFL(bbw->bulletin_board.check_set)) value->addr = NULL; else { SET_BFL(bbw->bulletin_board.check_set); value->addr = ((char *)bbw + offset); } } else if (((char*)bbw + offset) == (char*) &(bbw->bulletin_board.label_font_list)) { if (IS_SET_LFL(bbw->bulletin_board.check_set)) value->addr = NULL; else { SET_LFL(bbw->bulletin_board.check_set); value->addr = ((char *)bbw + offset); } } else if (((char*)bbw + offset) == (char*) &(bbw->bulletin_board.text_font_list)) { if (IS_SET_TFL(bbw->bulletin_board.check_set)) value->addr = NULL; else { SET_TFL(bbw->bulletin_board.check_set); value->addr = ((char *)bbw + offset); } } } /**************************************************************** * * Trait method for specify render table * **************************************************************/ static XmFontList GetTable( Widget wid, XtEnum type) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; switch(type) { case XmLABEL_RENDER_TABLE : return bb->bulletin_board.label_font_list ; case XmBUTTON_RENDER_TABLE : return bb->bulletin_board.button_font_list ; case XmTEXT_RENDER_TABLE : return bb->bulletin_board.text_font_list ; } return NULL ; } /**************************************************************** * * Trait method for dialog shell savvy * **************************************************************/ static void CallMapUnmap( Widget wid, Boolean map_unmap) { XmBulletinBoardWidget bb = (XmBulletinBoardWidget) wid ; XmAnyCallbackStruct call_data; call_data.reason = (map_unmap)? XmCR_MAP : XmCR_UNMAP; call_data.event = NULL; if (map_unmap) { XtCallCallbackList (wid, bb->bulletin_board.map_callback, &call_data); } else { XtCallCallbackList (wid, bb->bulletin_board.unmap_callback, &call_data); } } /**************************************************************** * This function creates and returns a BulletinBoard widget. ****************/ Widget XmCreateBulletinBoard( Widget p, String name, ArgList args, Cardinal n ) { return( XtCreateWidget( name, xmBulletinBoardWidgetClass, p, args, n)) ; } /**************************************************************** * This convenience function creates a DialogShell and a BulletinBoard * child of the shell; returns the BulletinBoard widget. ****************/ Widget XmCreateBulletinBoardDialog( Widget ds_p, String name, ArgList bb_args, Cardinal bb_n ) { return XmeCreateClassDialog (xmBulletinBoardWidgetClass, ds_p, name, bb_args, bb_n) ; } Widget XmVaCreateBulletinBoard( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmBulletinBoardWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedBulletinBoard( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmBulletinBoardWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/TransltnsP.h0000644000175000017500000001330213145162623013200 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTransltnsP_h #define _XmTransltnsP_h #include /* for externalref */ #ifdef __cplusplus extern "C" { #endif #ifndef _XmConst #define _XmConst #endif externalref _XmConst char _XmArrowB_defaultTranslations[]; externalref _XmConst char _XmBulletinB_defaultTranslations[]; externalref _XmConst char _XmCascadeB_menubar_events[]; externalref _XmConst char _XmCascadeB_p_events[]; externalref _XmConst char _XmComboBox_defaultTranslations[]; externalref _XmConst char _XmComboBox_defaultAccelerators[]; externalref _XmConst char _XmComboBox_dropDownComboBoxAccelerators[]; externalref _XmConst char _XmComboBox_dropDownListTranslations[]; externalref _XmConst char _XmComboBox_textFocusTranslations[]; externalref _XmConst char _XmContainer_defaultTranslations[]; externalref _XmConst char _XmContainer_traversalTranslations[]; externalref _XmConst char _XmDisplay_baseTranslations[]; externalref _XmConst char _XmDragC_defaultTranslations[]; externalref _XmConst char _XmDrawingA_defaultTranslations[]; externalref _XmConst char _XmDrawingA_traversalTranslations[]; externalref _XmConst char _XmDrawnB_defaultTranslations[]; externalref _XmConst char _XmDrawnB_menuTranslations[]; externalref _XmConst char _XmFrame_defaultTranslations[]; externalref _XmConst char _XmGrabShell_translations []; externalref _XmConst char _XmLabel_defaultTranslations[]; externalref _XmConst char _XmLabel_menuTranslations[]; externalref _XmConst char _XmLabel_menu_traversal_events[]; externalref _XmConst char _XmList_ListXlations1[]; externalref _XmConst char _XmList_ListXlations2[]; externalref _XmConst char _XmManager_managerTraversalTranslations[]; externalref _XmConst char _XmManager_defaultTranslations[]; externalref _XmConst char _XmNotebook_manager_translations[]; externalref _XmConst char _XmNotebook_TabAccelerators[]; externalref _XmConst char _XmMenuShell_translations []; externalref _XmConst char _XmPrimitive_defaultTranslations[]; externalref _XmConst char _XmPushB_defaultTranslations[]; externalref _XmConst char _XmPushB_menuTranslations[]; externalref _XmConst char _XmRowColumn_menu_traversal_table[]; externalref _XmConst char _XmRowColumn_bar_table[]; externalref _XmConst char _XmRowColumn_option_table[]; externalref _XmConst char _XmRowColumn_menu_table[]; externalref _XmConst char _XmSash_defTranslations[]; externalref _XmConst char _XmScrollBar_defaultTranslations[]; externalref _XmConst char _XmScrolledW_ScrolledWindowXlations[]; externalref _XmConst char _XmClipWindowTranslationTable[]; externalref _XmConst char _XmScrolledW_WorkWindowTranslationTable[]; externalref _XmConst char _XmSelectioB_defaultTextAccelerators[]; externalref _XmConst char _XmSpinB_defaultTranslations[]; externalref _XmConst char _XmSpinB_defaultAccelerators[]; externalref _XmConst char _XmTearOffB_overrideTranslations[]; externalref _XmConst char _XmTextF_EventBindings1[]; externalref _XmConst char _XmTextF_EventBindings2[]; externalref _XmConst char _XmTextF_EventBindings3[]; externalref _XmConst char _XmDataF_EventBindings1[]; externalref _XmConst char _XmDataF_EventBindings2[]; externalref _XmConst char _XmDataF_EventBindings3[]; externalref _XmConst char _XmDataF_EventBindings4[]; externalref _XmConst char _XmTextIn_XmTextEventBindings1[]; externalref _XmConst char _XmTextIn_XmTextEventBindings2[]; externalref _XmConst char _XmTextIn_XmTextEventBindings3[]; externalref _XmConst char _XmTextIn_XmTextVEventBindings[]; externalref _XmConst char _XmToggleB_defaultTranslations[]; externalref _XmConst char _XmToggleB_menuTranslations[]; externalref _XmConst char _XmVirtKeys_fallbackBindingString[]; /* * The following keybindings have been "grandfathered" * for backward compatablility. */ externalref _XmConst char _XmVirtKeys_acornFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_apolloFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_dgFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_decFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_dblclkFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_hpFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_ibmFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_ingrFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_megatekFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_motorolaFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_sgiFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_siemensWx200FallbackBindingString[]; externalref _XmConst char _XmVirtKeys_siemens9733FallbackBindingString[]; externalref _XmConst char _XmVirtKeys_sunFallbackBindingString[]; externalref _XmConst char _XmVirtKeys_tekFallbackBindingString[]; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTransltnsP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Print.h0000644000175000017500000000413513145162623012170 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmPrintShell_h #define _XmPrintShell_h #include #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmPrintShellWidgetClass; typedef struct _XmPrintShellClassRec * XmPrintShellWidgetClass; typedef struct _XmPrintShellRec * XmPrintShellWidget; #ifndef XmIsPrintShell #define XmIsPrintShell(w) (XtIsSubclass (w, xmPrintShellWidgetClass)) #endif /******** Public Function Declarations ********/ extern Widget XmPrintSetup( Widget video_widget, Screen *print_screen, String print_shell_name, ArgList args, Cardinal num_args); extern void XmRedisplayWidget(Widget widget) ; extern XtEnum XmPrintToFile(Display *dpy, char *file_name, XPFinishProc finish_proc, XPointer client_data) ; extern XtEnum XmPrintPopupPDM(Widget print_shell, Widget transient_for); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPrintShell_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconFileP.h0000644000175000017500000000267212672140200012677 00000000000000/* $XConsortium: IconFileP.h /main/5 1995/07/15 20:51:48 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmIconFileP_h #define _XmIconFileP_h #include #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for IconFile.c ********/ extern void XmeFlushIconFileCache(String path); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIconFile_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PrintSP.h0000644000175000017500000000515613145162623012437 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmPrintShellP_h #define _XmPrintShellP_h #include #include #include #ifdef __cplusplus extern "C" { #endif /* * we make it a appShell subclass so it can have it's own instance * hierarchy */ typedef struct { XmSyntheticResource * syn_resources; int num_syn_resources; XtPointer extension; } XmPrintShellClassPart; typedef struct _XmPrintShellClassRec{ CoreClassPart core_class; CompositeClassPart composite_class; ShellClassPart shell_class; WMShellClassPart wm_shell_class; VendorShellClassPart vendor_shell_class; TopLevelShellClassPart top_level_shell_class; ApplicationShellClassPart application_shell_class; XmPrintShellClassPart print_shell_class; } XmPrintShellClassRec; typedef struct { Boolean xp_connected ; Boolean last_page ; unsigned short print_resolution ; Position min_x, min_y, max_x, max_y ; unsigned short default_pixmap_resolution ; XtCallbackList start_job_callback; XtCallbackList end_job_callback; XtCallbackList page_setup_callback; XtCallbackList pdm_notification_callback ; } XmPrintShellPart, *XmPrintShellPartPtr; typedef struct _XmPrintShellRec{ CorePart core; CompositePart composite; ShellPart shell; WMShellPart wm; VendorShellPart vendor; TopLevelShellPart topLevel; ApplicationShellPart application; XmPrintShellPart print; } XmPrintShellRec; externalref XmPrintShellClassRec xmPrintShellClassRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPrintShellP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/ImageCache.c0000644000175000017500000020530513147152760013042 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: ImageCache.c /main/44 1998/10/06 17:26:25 samborn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "XmosI.h" /* for mask name API and stuff */ #include "BitmapsI.h" /* for built-in images */ #include "ColorI.h" /* for _XmSearchColorCache() */ #include "HashI.h" /* for hash table routines. */ #include "ImageCachI.h" /* for DIRECT_PIXMAP_CACHED */ #include "ReadImageI.h" /* for read xbm stuff */ #include /* for new _XmGetColoredPixmap API */ #include /* for Xme Color Obj access API */ #include /* XmGetIconFileName */ #ifdef PRINTING_SUPPORTED #include /* for pixmap resolution */ #endif #include #include #ifdef JPEG_SUPPORTED #include "JpegI.h" #endif #ifdef PNG_SUPPORTED #include "PngI.h" #endif /* additional value for GetImage return, FALSE, TRUE and */ #define NOT_CACHED 2 /* index and max size of the override_colorsarray */ #define NUM_SYMBOLIC_COLORS 7 #define SYMB_BACKGROUND 0 #define SYMB_FOREGROUND 1 #define TRANSPARENT_COLOR 2 #define SYMB_TOP_SHADOW_COLOR 3 #define SYMB_BOTTOM_SHADOW_COLOR 4 #define SYMB_SELECT_COLOR 5 #define SYMB_HIGHLIGHT_COLOR 6 /* Image set handling defines, structure, and global statics */ typedef struct _ImageData { int hot_x, hot_y; XImage *image; char *image_name; unsigned char *builtin_data; } ImageData; static XmHashTable image_set = NULL; /* Pixmap caching structure and global statics */ typedef struct _PixmapData { Screen * screen; char * image_name; XmAccessColorData acc_color ; Pixmap pixmap; int depth; Dimension width ; Dimension height ; int reference_count; unsigned short print_resolution ; Widget print_shell ; double scaling_ratio ; Pixel * pixels; int npixels; } PixmapData; static XmHashTable pixmap_set = NULL; static XmHashTable pixmap_data_set = NULL; /* Color caching structure and global statics */ typedef struct _CachedColorStruct { Display *display; Colormap colormap; XrmQuark colorname; unsigned short red, green, blue; Pixel pixel; unsigned int num_cached; /* reference count */ } CachedColor; typedef struct _CachedColorListStruct { int numEntries; int maxEntries; CachedColor *cache; } CachedColorList; static CachedColorList colorCacheList; /* GC caching structure and global statics */ typedef struct _GCData { GC gc; Screen *screen; Widget print_shell; int depth; int image_depth; Pixel foreground; Pixel background; } GCData; static XmHashTable gc_set = NULL; typedef struct _CleanKey { Screen * screen ; Widget shell ; } CleanKey ; /******** Static Function Declarations ********/ static Boolean ComparePixmaps (XmHashKey key_1, XmHashKey key_2); static Boolean ComparePixmapDatas (XmHashKey key_1, XmHashKey key_2); static Boolean CompareStrings (XmHashKey key_1, XmHashKey key_2); static Boolean CompareGCDatas (XmHashKey key_1, XmHashKey key_2); static XmHashValue HashPixmap (XmHashKey key); static XmHashValue HashPixmapData (XmHashKey key); static XmHashValue HashString (XmHashKey key); static XmHashValue HashGCData (XmHashKey key); static void InitializeImageSet( void ) ; static void InitializePixmapSets( void ) ; static Boolean UninstallImageMapProc (XmHashKey key, XtPointer value, XtPointer image); static Boolean SymbolicColorUsed(String color_name, XpmColor * xpm_colors, unsigned int ncolors); static void CompleteUnspecColors( Screen *screen, XpmColorSymbol *override_colors); static int GetOverrideColors( Screen *screen, XmAccessColorData acc_color, XpmColorSymbol *override_colors); static XtEnum GetXpmImage(Screen *screen, char *image_name, char *file_name, XmAccessColorData acc_color, XImage **image, unsigned short *pixmap_resolution, Pixel **pixels, int *npixels); static XtEnum GetImage(Screen *screen, char *image_name, XmAccessColorData acc_color, XImage **image, unsigned short * pixmap_resolution, Pixel **pixels, /* allocated pixels */ int *npixels); static GC GetGCForPutImage(Screen *screen, Widget print_shell, XImage * image, Pixmap pixmap, int depth, Pixel foreground, Pixel background); static int GetCacheColor(Display *display, Colormap colormap, char *colorname, XColor *color, void *data); static int FreeCacheColors(Display *display, Colormap colormap, Pixel *pixels, int npixels, void *data); /******** End Static Function Declarations ********/ /*** IMAGE CACHE PART FIRST ***/ /* Compare two strings. */ static Boolean CompareStrings (XmHashKey key_1, XmHashKey key_2) { char *data_1 = (char *) key_1; char *data_2 = (char *) key_2; return ((data_1 == data_2) || (strcmp(data_1, data_2) == 0)); } /* Hash a string. */ static XmHashValue HashString (XmHashKey key) { char *data = (char *) key; unsigned int len = strlen(data); return (((len << 8) | data[0]) << 8) | data[len]; } /************************************************************************ * * InitializeImageSet * Initialize the image set. * ************************************************************************/ static void InitializeImageSet( void ) { register int i; /* Allocate the hash table. */ assert (image_set == NULL); _XmProcessLock(); image_set = _XmAllocHashTable (MAX_BUILTIN_IMAGES + 100, CompareStrings, HashString); /* Load the built-in image data. Builtins have a non NULL builtin data. Their image field is setdynamically at GetImage time */ for (i = 0; i < MAX_BUILTIN_IMAGES ; i++) { ImageData *entry = XtNew(ImageData); entry->hot_x = 0; entry->hot_y = 0; entry->image = NULL; entry->image_name = (char*) bitmap_name_set[i]; entry->builtin_data = (unsigned char *) bitmaps[i]; _XmAddHashEntry(image_set, entry->image_name, entry); } _XmProcessUnlock(); } /************************************************************************ * * _XmInstallImage * * Allow a hot_spot to be specified * ************************************************************************/ Boolean _XmInstallImage( XImage *image, char *image_name, int hot_x, int hot_y) { ImageData *entry; /* Error checking */ if (image == NULL || image_name == NULL) return (False); /* Check for the initial allocation of the image set array */ if (image_set == NULL) InitializeImageSet(); /* Verify that the image_name is not already in the image set. */ _XmProcessLock(); if (_XmGetHashEntry(image_set, image_name) != NULL) { _XmProcessUnlock(); return (False); } /* Initialize the image element for the new image and return True. */ entry = XtNew(ImageData); entry->hot_x = hot_x; entry->hot_y = hot_y; entry->image = image; entry->image_name = XtNewString(image_name); entry->builtin_data = NULL; _XmAddHashEntry(image_set, entry->image_name, entry); _XmProcessUnlock(); return (True); } /************************************************************************ * * XmInstallImage * Add the provided image for the image set and return an * id to be used for further referencing. * ************************************************************************/ Boolean XmInstallImage( XImage *image, char *image_name ) { Boolean ret_val; _XmProcessLock(); ret_val = _XmInstallImage(image, image_name, 0, 0); _XmProcessUnlock(); return ret_val; } /* A hash table map procedure to uninstall an image. */ /*ARGSUSED*/ static Boolean UninstallImageMapProc (XmHashKey key, /* unused */ XtPointer value, XtPointer image) { ImageData *entry = (ImageData *) value; if (entry->image == (XImage*) image) { /* Can't free built-in data. */ if (entry->builtin_data == NULL) { _XmProcessLock(); _XmRemoveHashEntry (image_set, entry->image_name); _XmProcessUnlock(); XtFree(entry->image_name); /* uninstall do not free the XImage itself */ XtFree((char*) entry); } return True; } return False; } /************************************************************************ * * XmUninstallImage * Remove an image from the image set. * Return a boolean (True) if the uninstall succeeded. Return * a boolean (False) if an error condition occurs. * ************************************************************************/ Boolean XmUninstallImage( XImage *image ) { Cardinal old_count; Boolean ret_val; /* Check for invalid conditions */ if ((image == NULL) || (image_set == NULL)) return (False); _XmProcessLock(); /* Since we can't index based on the image, search the hash table */ /* until the desired entry is found and then remove it. */ old_count = _XmHashTableCount(image_set); _XmMapHashTable(image_set, UninstallImageMapProc, image); ret_val = (old_count > _XmHashTableCount(image_set)); _XmProcessUnlock(); return ret_val; } /************************************************************************ * * SymbolicColorUsed * Used to determine if a given color string is defined as a symbolic * color in an Xpm image. This is used for caching policy where we * don't want to cache based on irrelevant colors. * Note that we don't look if the color is actually used because it * is too expensive. * ************************************************************************/ static Boolean SymbolicColorUsed(String color_name, XpmColor * xpm_colors, unsigned int ncolors) { Cardinal i, j, data_size ; /* first look if the color is present as a symbolic in the colorTable */ for (i = 0; i < ncolors; i++, xpm_colors++) { if (xpm_colors->symbolic && !strcmp(xpm_colors->symbolic, color_name)) break ; } if (i == ncolors) return False ; return False ; } /************************************************************************ * * CompleteUnspecColors * Complete the unspecified_pixel values of an override_colors array * based on the values coming from the ColorObj or the color cache. * Does not handle highlight. * The logic here comes directly from CDE. * * The above description does not fit with the actual logic of CDE where * not only the unspecified colors are set here but the whole set of * symbols! See defect CDExc17529. * ************************************************************************/ static void CompleteUnspecColors( Screen *screen, XpmColorSymbol *override_colors) { XmPixelSet pixelSets[XmCO_NUM_COLORS]; int colorUse ; Boolean bgFound = False, fgFound = False, result = False; Pixel *pixelPtr; Cardinal i, j ; XmAccessColorDataRec loc_acc_color; /* Ask the color obj */ if (!(result = XmeGetColorObjData(screen, &colorUse, pixelSets, XmCO_NUM_COLORS, NULL, NULL, NULL, NULL, NULL))) i = XmCO_NUM_COLORS; else i = 0; /* Look for a pixels set containing the given fg and bg, * no matter whether they are actually the fg and bg of the set... */ for ( ; i < XmCO_NUM_COLORS; i++) { bgFound = False; fgFound = False; pixelPtr = (Pixel *)&(pixelSets[i].fg); for (j = 0; j < 5; j++, pixelPtr++) { if (*pixelPtr == override_colors[SYMB_BACKGROUND].pixel) bgFound = True; else if (*pixelPtr == override_colors[SYMB_FOREGROUND].pixel) fgFound = True; } if (bgFound && fgFound) break; } if (i == XmCO_NUM_COLORS) { /* * We didn't find the bg/fg tuple in any of the Dt colorsets * or if the color server is not running, we will now try * the color cache. */ XmColorData *old_colors; XmColorData new_colors; loc_acc_color.background = override_colors[SYMB_BACKGROUND].pixel ; new_colors.screen = screen; new_colors.color_map = DefaultColormapOfScreen(screen); new_colors.background.pixel = loc_acc_color.background ; /* Use motif color set only if already allocated. */ if (!result && _XmSearchColorCache( (XmLOOK_AT_SCREEN | XmLOOK_AT_CMAP | XmLOOK_AT_BACKGROUND), &new_colors, &old_colors)) { XmGetColors(screen, DefaultColormapOfScreen(screen), loc_acc_color.background, &loc_acc_color.foreground, &loc_acc_color.top_shadow_color, &loc_acc_color.bottom_shadow_color, &loc_acc_color.select_color); } else { /* Cannot generate missing colors */ return ; } } else { loc_acc_color.background = pixelSets[i].bg; loc_acc_color.foreground = pixelSets[i].fg; loc_acc_color.top_shadow_color = pixelSets[i].ts; loc_acc_color.bottom_shadow_color = pixelSets[i].bs; loc_acc_color.select_color = pixelSets[i].sc; } /* Now process the setting for unspecified pixel values. If we're here, all the colors but highlight are available */ override_colors[SYMB_BACKGROUND].pixel = loc_acc_color.background ; override_colors[SYMB_FOREGROUND].pixel = loc_acc_color.foreground ; override_colors[SYMB_TOP_SHADOW_COLOR].pixel = loc_acc_color.top_shadow_color ; override_colors[SYMB_BOTTOM_SHADOW_COLOR].pixel = loc_acc_color.bottom_shadow_color ; override_colors[SYMB_SELECT_COLOR].pixel = loc_acc_color.select_color ; } /************************************************************************ * * GetOverrideColors * Given a set of colors in acc_color with values specified or not * this function fills up an XpmColorSymbol override_colors array to * be used by the Xpm reader. * It then calls the ColorObject aware filling proc to find values * for the still unspecified ones. * It returns the number of entries to consider in override_colors, * which can be 2 (background and foreground are always valid), * NUM_SYMBOLIC_COLORS - 1 (if everything but the highlight could * be generated), or NUM_SYMBOLIC_COLOR. * ************************************************************************/ static int GetOverrideColors( Screen *screen, XmAccessColorData acc_color, XpmColorSymbol *override_colors) { Cardinal i, n ; /* init the value fields */ for (i=0; ibackground ; override_colors[SYMB_FOREGROUND].name = XmNforeground ; override_colors[SYMB_FOREGROUND].pixel = acc_color->foreground ; /* Set "none" color to background in case the mask is not used. */ override_colors[TRANSPARENT_COLOR].name = NULL ; override_colors[TRANSPARENT_COLOR].value = "None" ; override_colors[TRANSPARENT_COLOR].pixel = acc_color->background ; override_colors[SYMB_TOP_SHADOW_COLOR].name = XmNtopShadowColor ; override_colors[SYMB_TOP_SHADOW_COLOR].pixel = acc_color->top_shadow_color ; override_colors[SYMB_BOTTOM_SHADOW_COLOR].name = XmNbottomShadowColor ; override_colors[SYMB_BOTTOM_SHADOW_COLOR].pixel = acc_color->bottom_shadow_color ; override_colors[SYMB_SELECT_COLOR].name = XmNselectColor ; override_colors[SYMB_SELECT_COLOR].pixel = acc_color->select_color ; /* need to hack around selectColor which might be still unspecified while highlight is not (and that woudl break our ordering rule - see below). Use top_shadow color so that select follows its set/unset semantics regarding overriding */ if (override_colors[SYMB_SELECT_COLOR].pixel == XmUNSPECIFIED_PIXEL) override_colors[SYMB_SELECT_COLOR].pixel = override_colors[SYMB_TOP_SHADOW_COLOR].pixel ; override_colors[SYMB_HIGHLIGHT_COLOR].name = XmNhighlightColor ; override_colors[SYMB_HIGHLIGHT_COLOR].pixel = acc_color->highlight_color ; /* now call ColorObject aware routine to give it a chance to fill the remaining unspecified pixel field in override_colors */ CompleteUnspecColors (screen, override_colors) ; /* Just count the number of valid pixel. This makes a strong assumption on the ordering: if we find 5 valid pixels, the 5 first one will be used. This is ok since _XmGetColoredPixmap is only used internally in such a way that this happens to be true: background/foreground are always here, and highlight color is the only one that might be missing after CompleteUnspecColors call. The day XmGetColoredPixmap is promoted public, this simple logic will have to be reviewed */ n = 0 ; for (i=0; idepth == 1) { /* we've loaded an xbm file, just forget about the 'other' symbolic colors, for they are not going to be used during pixmap generation for depth 1 => pixmap putimage */ acc_color->top_shadow_color = XmUNSPECIFIED_PIXEL; acc_color->bottom_shadow_color= XmUNSPECIFIED_PIXEL; acc_color->select_color = XmUNSPECIFIED_PIXEL; acc_color->highlight_color = XmUNSPECIFIED_PIXEL; if (acc_color->foreground == XmUNSPECIFIED_PIXEL && acc_color->background == XmUNSPECIFIED_PIXEL) { acc_color->foreground = 1; acc_color->background = 0; } } else { /* we've loaded a xpm, check which symbolics colors were actually used during the read, we don't want to remember the unused one for the pixmap caching */ if (!SymbolicColorUsed(XmNbackground, attrib.colorTable, attrib.ncolors)) acc_color->background = XmUNSPECIFIED_PIXEL; if (!SymbolicColorUsed(XmNforeground, attrib.colorTable, attrib.ncolors)) acc_color->foreground = XmUNSPECIFIED_PIXEL; if (!SymbolicColorUsed(XmNtopShadowColor, attrib.colorTable, attrib.ncolors)) acc_color->top_shadow_color = XmUNSPECIFIED_PIXEL; if (!SymbolicColorUsed(XmNbottomShadowColor, attrib.colorTable, attrib.ncolors)) acc_color->bottom_shadow_color = XmUNSPECIFIED_PIXEL; if (!SymbolicColorUsed(XmNselectColor, attrib.colorTable, attrib.ncolors)) acc_color->select_color = XmUNSPECIFIED_PIXEL; if (!SymbolicColorUsed(XmNhighlightColor, attrib.colorTable, attrib.ncolors)) acc_color->highlight_color = XmUNSPECIFIED_PIXEL; } } /* install the XImage with that name. We do not cache the non-depth 1 ones for we don't want to keep them in the image cache, since they need color lookup, which is done one level up in the pixmap cache */ if (((*image)->depth == 1) && acc_color && (acc_color->foreground == 1) && (acc_color->background == 0) ) { _XmInstallImage (*image, image_name, hot_x, hot_y); return TRUE ; } else { if (xpmStatus >= 0) XmeXpmFreeAttributes(&attrib); return NOT_CACHED ; /* mean the image can be destroyed after it is used */ } } if (xpmStatus >= 0) XmeXpmFreeAttributes(&attrib); return FALSE; } /************************************************************************ * * GetImage * Main routine of the image cache part. * ************************************************************************/ static XtEnum GetImage( Screen *screen, char *image_name, XmAccessColorData acc_color, XImage **image, unsigned short * pixmap_resolution, Pixel **pixels, /* allocated pixels */ int *npixels) { static XImage * built_in_image = NULL; register Display *display = DisplayOfScreen(screen); ImageData *entry; char *file_name; XtEnum return_value; #if defined (PNG_SUPPORTED) || defined (JPEG_SUPPORTED) FILE *infile; int rc; #endif /* init for when we go thru the image cache first */ if (pixmap_resolution) *pixmap_resolution = 0 ; if (pixels) *pixels = NULL; if (npixels) *npixels = 0; /*** Check for the initial allocation of the image set array */ if (image_set == NULL) InitializeImageSet(); if (!image_name) return FALSE ; /*** look in the XImage cache first */ _XmProcessLock(); entry = (ImageData*) _XmGetHashEntry(image_set, image_name); _XmProcessUnlock(); if (entry) { /* If the image is a builtin image then get it. */ if (entry->builtin_data) { /* there is one builtin XImage shared by all builtins, only the data part change every time a query is made */ _XmProcessLock(); if (!built_in_image) { /* update that with new R6 init image stuff when out */ _XmCreateImage(built_in_image, display, NULL, 16, 16, MSBFirst); } built_in_image->data = (char *) entry->builtin_data; _XmProcessUnlock(); *image = built_in_image; } else { /* other entry found are just fine, set the image and return */ *image = entry->image ; } return TRUE; } /*** if no entry, try to read a new file and cache it only if it is a bitmap */ #ifdef _ORIG_GET_ICON_FILE file_name = GetIconFileName(screen, image_name); #else file_name = XmGetIconFileName(screen, NULL, image_name, NULL, XmUNSPECIFIED_ICON_SIZE); #endif if (!file_name) { return FALSE; } #if defined (JPEG_SUPPORTED) || defined (PNG_SUPPORTED) if (!(infile = fopen(file_name, "rb"))) { return FALSE; } #ifdef JPEG_SUPPORTED rc = _XmJpegGetImage(screen, infile, image); #endif #if defined (JPEG_SUPPORTED) && defined (PNG_SUPPORTED) if (rc == 1) { /* not a jpeg file */ #endif #ifdef PNG_SUPPORTED Pixel background; if (acc_color) background = acc_color->background; else background = 0; if (background == XmUNSPECIFIED_PIXEL) background = 0; /* XXX is if OK? */ #endif #if defined (JPEG_SUPPORTED) && defined (PNG_SUPPORTED) rewind(infile); #endif #ifdef PNG_SUPPORTED rc = _XmPngGetImage(screen, infile, background, image); #endif #if defined (JPEG_SUPPORTED) && defined (PNG_SUPPORTED) } #endif fclose(infile); if (rc > 1) { return_value = FALSE; } else if (rc == 0) { return_value = NOT_CACHED; } else { #endif return_value = GetXpmImage(screen, image_name, file_name, acc_color, image, pixmap_resolution, pixels, npixels); #if defined (JPEG_SUPPORTED) || defined (PNG_SUPPORTED) } #endif XtFree(file_name); return return_value; } /*** Keep this one in here, this is the only entry point to the Image cache. It can be used to duplicate them, etc */ Boolean _XmGetImage( Screen *screen, char *image_name, XImage **image ) { return GetImage(screen, image_name, NULL, image, NULL, NULL, NULL) ; } /************************************************************************ * * _XmInImageCache * Used by IconFile.c * ************************************************************************/ Boolean _XmInImageCache( String image_name) { XtPointer ret_val; if (!image_set) return False ; _XmProcessLock(); ret_val = _XmGetHashEntry(image_set, image_name); _XmProcessUnlock(); return (ret_val != NULL) ; } /*** PIXMAP CACHE NOW ***/ /** static dependencies with Image part: * GetImage(), ImageData&image_set, HashString **/ /** static dependencies with Color part: * FreeCacheColors() **/ static Boolean ComparePixmaps (XmHashKey key_1, XmHashKey key_2) { PixmapData *data_1 = (PixmapData *) key_1; PixmapData *data_2 = (PixmapData *) key_2; /* Check for a matching pixmap using screen and pixmap */ return (data_1->screen == data_2->screen && data_1->pixmap == data_2->pixmap) ; } static Boolean ComparePixmapDatas (XmHashKey key_1, XmHashKey key_2) { PixmapData *data_1 = (PixmapData *) key_1; PixmapData *data_2 = (PixmapData *) key_2; /* Check for a matching pixmap using depth, screen, name and colors info + print_resolution/scaling_ratio and print_shell */ /* if a negative depth is given, we must look for a matching pixmap of -depth or 1 */ return ((data_2->pixmap == XmUNSPECIFIED_PIXMAP || data_1->pixmap == data_2->pixmap) && data_1->image_name != NULL && data_2->image_name != NULL && strcmp (data_1->image_name, data_2->image_name) == 0 && (data_1->screen == data_2->screen) && ( /* ratio == 0 means print resolution is used */ (data_1->scaling_ratio == data_2->scaling_ratio && data_1->scaling_ratio) || (data_1->print_resolution == data_2->print_resolution && !data_1->scaling_ratio)) && (data_1->print_shell == data_2->print_shell) && ((data_1->depth == data_2->depth) || (data_2->depth < 0 && data_1->depth == -data_2->depth) || (data_2->depth < 0 && data_1->depth == 1)) && ((data_1->acc_color->foreground == data_2->acc_color->foreground) || (data_2->depth < 0 && data_1->acc_color->foreground == 1) || (data_1->acc_color->foreground == XmUNSPECIFIED_PIXEL) || (data_2->acc_color->foreground == XmUNSPECIFIED_PIXEL)) && ((data_1->acc_color->background == data_2->acc_color->background) || (data_2->depth < 0 && data_1->acc_color->background == 0) || (data_1->acc_color->background == XmUNSPECIFIED_PIXEL)|| (data_2->acc_color->background == XmUNSPECIFIED_PIXEL)) && ((data_1->acc_color->top_shadow_color == data_2->acc_color->top_shadow_color) || (data_1->acc_color->top_shadow_color == XmUNSPECIFIED_PIXEL)|| (data_2->acc_color->top_shadow_color == XmUNSPECIFIED_PIXEL)) && ((data_1->acc_color->bottom_shadow_color == data_2->acc_color->bottom_shadow_color)|| (data_1->acc_color->bottom_shadow_color == XmUNSPECIFIED_PIXEL)|| (data_2->acc_color->bottom_shadow_color == XmUNSPECIFIED_PIXEL)) && ((data_1->acc_color->select_color == data_2->acc_color->select_color) || (data_1->acc_color->select_color == XmUNSPECIFIED_PIXEL)|| (data_2->acc_color->select_color == XmUNSPECIFIED_PIXEL)) && ((data_1->acc_color->highlight_color == data_2->acc_color->highlight_color) || (data_1->acc_color->highlight_color == XmUNSPECIFIED_PIXEL) || (data_2->acc_color->highlight_color == XmUNSPECIFIED_PIXEL))) ; } /* Hash a Pixmap entry. */ static XmHashValue HashPixmap (XmHashKey key) { PixmapData *data = (PixmapData *) key; return ((long)data->screen + data->pixmap); } /* Hash a PixmapData entry. Reuse the string hash function */ static XmHashValue HashPixmapData (XmHashKey key) { PixmapData *data = (PixmapData *) key; return ((long)data->screen + HashString ((XmHashKey)data->image_name)); } /************************************************************************ * * InitializePixmapSets * Initialize the pixmap sets. * ************************************************************************/ static void InitializePixmapSets( void ) { /* Allocate the pixmap hash tables. One for the regular XmGetPixmap lookup, one for the XmeGetPixmapData lookup */ assert (pixmap_data_set == NULL && pixmap_set == NULL); _XmProcessLock(); pixmap_data_set = _XmAllocHashTable (100, ComparePixmapDatas, HashPixmapData); pixmap_set = _XmAllocHashTable (100, ComparePixmaps, HashPixmap); _XmProcessUnlock(); } /************************************************************************ * * _XmCachePixmap * Install a pixmap into the pixmap cache. This is used to add * cached pixmaps which have no XImage associated with them. * This one you can pass depth and size info, if you don't, * the X server will be queried: very expensive. * ************************************************************************/ Boolean _XmCachePixmap( Pixmap pixmap, Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth, Dimension width, Dimension height) { PixmapData * pix_entry; Window root; int x,y; unsigned int loc_width, loc_height, border_width, loc_depth; /* Error checking */ if (image_name == NULL) return (False); if (!pixmap_data_set) InitializePixmapSets() ; /* if no information was given, get it from the server */ if (!(width && height && depth)) XGetGeometry(DisplayOfScreen(screen), pixmap, &root, &x, &y, &loc_width, &loc_height, &border_width, &loc_depth); else { loc_width = width ; loc_height = height ; loc_depth = depth ; } /* Allocate the cache structure and put it into the list */ pix_entry = XtNew (PixmapData); pix_entry->screen = screen; pix_entry->acc_color = XtNew(XmAccessColorDataRec); pix_entry->acc_color->foreground = foreground; pix_entry->acc_color->background = background; pix_entry->acc_color->top_shadow_color = XmUNSPECIFIED_PIXEL; pix_entry->acc_color->bottom_shadow_color = XmUNSPECIFIED_PIXEL; pix_entry->acc_color->select_color = XmUNSPECIFIED_PIXEL; pix_entry->acc_color->highlight_color = XmUNSPECIFIED_PIXEL; pix_entry->depth = loc_depth; pix_entry->width = loc_width; pix_entry->height = loc_height; pix_entry->image_name = XtNewString(image_name); pix_entry->pixmap = pixmap; pix_entry->reference_count = 1; pix_entry->print_resolution = 100 ; pix_entry->print_shell = NULL ; pix_entry->scaling_ratio = 1 ; pix_entry->pixels = NULL; pix_entry->npixels = 0; _XmProcessLock(); _XmAddHashEntry(pixmap_set, (XmHashKey)pix_entry, (XtPointer)pix_entry); /* Only add pixmaps not issued from XmeGetPixmapData to the "real" table */ if (0 != strcmp(image_name, DIRECT_PIXMAP_CACHED)) _XmAddHashEntry(pixmap_data_set, (XmHashKey)pix_entry, (XtPointer)pix_entry); _XmProcessUnlock(); return (True); } /********************************************************************/ Boolean _XmGetPixmapData( Screen *screen, Pixmap pixmap, char **image_name, int *depth, Pixel *foreground, Pixel *background, int *hot_x, int *hot_y, unsigned int *width, unsigned int *height) /* no pixmap_resolution returned... */ { PixmapData pix_data, *pix_entry; ImageData * entry; if (!pixmap_data_set) InitializePixmapSets() ; /* checks for a matching screen and pixmap. */ pix_data.screen = screen ; pix_data.pixmap = pixmap ; _XmProcessLock(); if ((pix_entry = (PixmapData*) _XmGetHashEntry(pixmap_set, (XmHashKey)&pix_data)) != NULL) { *foreground = pix_entry->acc_color->foreground; *background = pix_entry->acc_color->background; *depth = pix_entry->depth; *image_name = pix_entry->image_name; *width = pix_entry->width; *height = pix_entry->height; /* try to get the hot spot data from the image cache */ if (image_set) { entry = (ImageData *) _XmGetHashEntry(image_set, *image_name); if (entry) { *hot_x = entry->hot_x; *hot_y = entry->hot_y; } } _XmProcessUnlock(); return True; } _XmProcessUnlock(); return False ; } /*******************************************************************/ /* the real one, used by PixConv and locally too */ Pixmap _XmGetScaledPixmap( Screen *screen, Widget widget, char *image_name, XmAccessColorData acc_color, int depth, #if NeedWidePrototypes int only_if_exists, #else Boolean only_if_exists, #endif /* NeedWidePrototypes */ double scaling_ratio) { Display * display = DisplayOfScreen(screen); XImage * image; Pixmap pixmap; GC gc ; XtEnum ret ; PixmapData pix_data, *pix_entry ; unsigned short pixmap_resolution ; Pixel *pixels; /* allocated colors */ int npixels; int old_image_format; char *old_image_data = NULL; /* Error checking */ if (image_name == NULL) return (XmUNSPECIFIED_PIXMAP); if (!pixmap_data_set) InitializePixmapSets() ; /* if screen not provided, widget has to be! */ if (!screen) screen = XtScreen(widget); /* since more than one printers can attach to one screen, we need to use the print shell in the caching */ /* since resolution can be dynamic for a printer, we need to use the resolution too, when scaling is 0 */ pix_data.screen = screen ; pix_data.image_name = image_name ; pix_data.depth = depth ; pix_data.acc_color = acc_color ; pix_data.print_resolution = 100 ; /* default */ pix_data.scaling_ratio = scaling_ratio ; pix_data.pixmap = XmUNSPECIFIED_PIXMAP; /* find out the print shell ancestor */ pix_data.print_shell = widget ; while(pix_data.print_shell && !XmIsPrintShell(pix_data.print_shell)) pix_data.print_shell = XtParent(pix_data.print_shell); /* pix_data.print_shell might be NULL here */ #ifdef PRINTING_SUPPORTED /* scaling_ratio == 0 means use print_resolution and pixmap_resolution in scaling - so first find out the print_resolution, since it is used in caching */ if (!scaling_ratio && pix_data.print_shell) pix_data.print_resolution = ((XmPrintShellWidget)pix_data.print_shell)->print.print_resolution ; #endif /* if scaling_ratio a real number, like 1 or 1.2 print_resolution still 100 and will not be used */ /* look if we have a match and return it */ _XmProcessLock(); if ((pix_entry = (PixmapData*) _XmGetHashEntry(pixmap_data_set, (XmHashKey)&pix_data)) != NULL) { pix_entry->reference_count++; _XmProcessUnlock(); return pix_entry->pixmap ; } _XmProcessUnlock(); /* The desired pixmap is not already cached. Quit now or create it. */ if (only_if_exists) return (XmUNSPECIFIED_PIXMAP); /* no pixmap found, look for an XImage. generate a new one if needed. GetImage can return a bitmap or a pixmap XImage */ /* GetImage modify the acc_color struct to update the colors that are not used during reading: - for xbm, everything but foreground and background. - for xpm, on a case by case basis, depending if the corresponding symbolic color was used. */ if (!(ret = GetImage(screen, image_name, acc_color, &image, &pixmap_resolution, &pixels, &npixels))) return (XmUNSPECIFIED_PIXMAP); /* now find how much we need to scale this baby */ /* compute the real ratio to be used in PutImage */ if (!pix_data.scaling_ratio) { /* if scaling ratio is real, like 1.2, the pixmap resolution is not used, neither is the print_resolution */ if (!pixmap_resolution) { /* GetImage returns the resolution for which the image was designed. if none was provided in the file, it's 0, in which case, the print shell default resolution for pixmap is used */ #ifdef PRINTING_SUPPORTED if (pix_data.print_shell) pixmap_resolution = ((XmPrintShellWidget)pix_data.print_shell) ->print.default_pixmap_resolution ; else #endif /* PRINTING_SUPPORTED */ pixmap_resolution = 100 ; } pix_data.scaling_ratio = (double)pix_data.print_resolution / (double)pixmap_resolution ; } /* now we treat the -depth case: if a negative depth was given then xbm file should map into bitmap and xpm into pixmap */ if (depth < 0) { if (image->depth == 1) depth = 1 ; else depth = -depth ; } /* now check the validity of the image depth. XPutImage can only handle unequal depths for bitmaps. */ if ((image->depth != depth) && (image->depth != 1)) return (XmUNSPECIFIED_PIXMAP); /* force the foreground/background if a Bitmap is returned. These values are going to go in the cache too, so we will have to remember this forcing for the case -depth: you ask for -depth and some foreground/background, that should match a depth 1 with 1/0. Look at ComparePixmapDatas above for details */ if (depth == 1) { acc_color->foreground = 1; acc_color->background = 0; } /* XPutImage will only deepen bitmaps -- fake it with pixmaps. */ old_image_format = image->format; if (image->depth == 1) { switch(image->format) { case XYBitmap: /* XPutImage will do the right thing. */ break; case XYPixmap: /* We're going to muck with the shared image... */ if (ret != NOT_CACHED) _XmProcessLock(); /* Assume black == fg in the image. */ if ((BlackPixelOfScreen(screen) == 0) || (WhitePixelOfScreen(screen) == 1)) { /* Flip the bits so fg == 1 in the image. */ register int nbytes = image->height * image->bytes_per_line; register int byte; /* Image data may be constant, so we must copy it. */ old_image_data = image->data; image->data = XtMalloc(nbytes); for (byte = 0; byte < nbytes; byte++) image->data[byte] = ~old_image_data[byte]; } /* In this depth-1 case the image formats are equivalent. */ image->format = XYBitmap; break; case ZPixmap: /* Assume the application really wants BadMatch if (depth != 1). */ break; default: assert(FALSE); } } /* * Create a pixmap to hold the image, allocate a new pixmap * cache entry, put the cache entry in the tables. */ pix_entry = XtNew (PixmapData); pix_entry->screen = screen; pix_entry->acc_color = XtNew(XmAccessColorDataRec); memcpy((void*)pix_entry->acc_color, (void*)acc_color, sizeof(XmAccessColorDataRec)); pix_entry->depth = depth; pix_entry->image_name = XtNewString(image_name); pix_entry->print_shell = pix_data.print_shell; pix_entry->print_resolution = pix_data.print_resolution ; pix_entry->pixels = pixels; pix_entry->npixels = npixels; /* use scaling_ratio for caching: as 0, in which case the print resolution will be used, or 1, no scaling, or a real ratio. That's because when we enter this function, we don't have pixmap_resolution to cache against, and also because print_resolution might change for the same print shell */ pix_entry->scaling_ratio = scaling_ratio ; /* use the pixmap scaling ratio for printing */ pix_entry->width = image->width * pix_data.scaling_ratio ; pix_entry->height = image->height * pix_data.scaling_ratio ; pixmap = XCreatePixmap (display, RootWindowOfScreen(screen), pix_entry->width, pix_entry->height, depth); pix_entry->pixmap = pixmap; pix_entry->reference_count = 1; /* put the new entry in both tables: the table used for this routine and the table used in XmeGetPixmapData */ _XmProcessLock(); _XmAddHashEntry(pixmap_set, (XmHashKey)pix_entry, (XtPointer)pix_entry); _XmAddHashEntry(pixmap_data_set, (XmHashKey)pix_entry, (XtPointer)pix_entry); _XmProcessUnlock(); /* Set up a gc for the image to pixmap copy, store the image */ /* into the pixmap and return the pixmap. */ gc = GetGCForPutImage(screen, pix_entry->print_shell, image, pixmap, depth, acc_color->foreground, acc_color->background); /* transfer and scale the image */ _XmPutScaledImage (display, pixmap, gc, image, 0, 0, 0, 0, image->width, image->height, pix_entry->width, pix_entry->height); /* Destroy non-cached XImage now that we've cached the pixmap. */ if (ret == NOT_CACHED) { XDestroyImage(image) ; if (old_image_data) XtFree(image->data); } else if (image->format != old_image_format) { /* Undo the XYPixmap to XYBitmap conversion done earlier. */ image->format = old_image_format; assert(old_image_format == XYPixmap); if (old_image_data) { XtFree(image->data); image->data = old_image_data; } /* We're done mangling the image. */ _XmProcessUnlock(); } return (pixmap); } /******************************************************************* * * _XmGetColoredPixmap * a improved version of XmGetPixmapByDepth that lets the caller * specify more color information usable during the loading * of the pixmap file to override symbolic colors. * * It also supports the negative depth convention where if a -depth * is given, xbm file give Bitmap and xpm file give Pixmap, while * with positive depth, all files give Pixmap result. * * Now a wrapper, but still used by IconG, MessageB, and Text directly. * *******************************************************************/ Pixmap _XmGetColoredPixmap(Screen *screen, char *image_name, XmAccessColorData acc_color, int depth, #if NeedWidePrototypes int only_if_exists) #else Boolean only_if_exists) #endif /* NeedWidePrototypes */ { return _XmGetScaledPixmap (screen, NULL, image_name, acc_color, depth, only_if_exists, 1); /* no scaling */ } Pixmap XmGetScaledPixmap( Widget widget, char *image_name, Pixel foreground, Pixel background, int depth, double scaling_ratio) { XmAccessColorDataRec acc_color_rec; Pixmap ret_val; XtAppContext app = XtWidgetToApplicationContext(widget); _XmAppLock(app); _XmProcessLock(); acc_color_rec.foreground = foreground ; acc_color_rec.background = background ; acc_color_rec.top_shadow_color = XmUNSPECIFIED_PIXEL ; acc_color_rec.bottom_shadow_color = XmUNSPECIFIED_PIXEL ; acc_color_rec.select_color = XmUNSPECIFIED_PIXEL ; acc_color_rec.highlight_color = XmUNSPECIFIED_PIXEL ; ret_val = _XmGetScaledPixmap(XtScreen(widget), widget, image_name, &acc_color_rec, depth, False, scaling_ratio); _XmProcessUnlock(); _XmAppUnlock(app); return ret_val; } /******************************************************************* * * XmGetPixmapByDepth. * create a pixmap from the image_name. foreground and background * must be valid values. For depth 1 they should be 1 and 0 * respectively. * *******************************************************************/ Pixmap XmGetPixmapByDepth( Screen *screen, char *image_name, Pixel foreground, Pixel background, int depth) { XmAccessColorDataRec acc_color_rec; Pixmap ret_val; XtAppContext app = XtDisplayToApplicationContext( DisplayOfScreen(screen)); _XmAppLock(app); _XmProcessLock(); acc_color_rec.foreground = foreground ; acc_color_rec.background = background ; acc_color_rec.top_shadow_color = XmUNSPECIFIED_PIXEL ; acc_color_rec.bottom_shadow_color = XmUNSPECIFIED_PIXEL ; acc_color_rec.select_color = XmUNSPECIFIED_PIXEL ; acc_color_rec.highlight_color = XmUNSPECIFIED_PIXEL ; ret_val = _XmGetScaledPixmap(screen, NULL, image_name, &acc_color_rec, depth, False, 1); _XmProcessUnlock(); _XmAppUnlock(app); return ret_val; } /************************************************************************ * * This one is deprecated, but keep it in here, it was public. * ************************************************************************/ Pixmap XmGetPixmap( Screen *screen, char *image_name, Pixel foreground, Pixel background ) { Pixmap ret_val; XtAppContext app = XtDisplayToApplicationContext( DisplayOfScreen(screen)); _XmAppLock(app); ret_val = XmGetPixmapByDepth(screen, image_name, foreground, background, DefaultDepthOfScreen(screen)); _XmAppUnlock(app); return (ret_val); } /************************************************************************ * * XmeGetMask * ************************************************************************/ Pixmap XmeGetMask( Screen *screen, char *image_name) { char mask_name[256]; Pixmap ret_val; XtAppContext app = XtDisplayToApplicationContext( DisplayOfScreen(screen)); _XmAppLock(app); _XmProcessLock(); _XmOSGenerateMaskName(image_name, mask_name); _XmProcessUnlock(); ret_val = XmGetPixmapByDepth(screen, mask_name, 1, 0, 1); _XmAppUnlock(app); return ret_val; } /************************************************************************ * * XmDestroyPixmap * Use the pixmap table (pixmap/screen) to find the pixmap, * then remove it from both pixmap and pixmap_data tables. * ************************************************************************/ Boolean XmDestroyPixmap( Screen *screen, Pixmap pixmap ) { PixmapData pix_data, *pix_entry ; XtAppContext app; /* Check for invalid conditions */ if (screen == NULL || pixmap == 0 || pixmap_set == NULL) return (False); app = XtDisplayToApplicationContext( DisplayOfScreen(screen)); _XmAppLock(app); _XmProcessLock(); pix_data.screen = screen ; pix_data.pixmap = pixmap ; if ((pix_entry = (PixmapData*) _XmGetHashEntry(pixmap_set, (XmHashKey)&pix_data)) != NULL) { pix_entry->reference_count--; if (pix_entry->reference_count == 0) { _XmRemoveHashEntry (pixmap_data_set, pix_entry); _XmRemoveHashEntry (pixmap_set, pix_entry); if (0 != strcmp(pix_entry->image_name, DIRECT_PIXMAP_CACHED)) XFreePixmap(DisplayOfScreen(pix_entry->screen), pix_entry->pixmap); XtFree(pix_entry->image_name); XtFree((char*)pix_entry->acc_color); if (pix_entry->pixels) { FreeCacheColors(DisplayOfScreen(pix_entry->screen), DefaultColormapOfScreen(pix_entry->screen), pix_entry->pixels, pix_entry->npixels, NULL); XmeXpmFree(pix_entry->pixels); } XtFree((char*)pix_entry); } _XmProcessUnlock(); _XmAppUnlock(app); return True; } _XmProcessUnlock(); _XmAppUnlock(app); return False; } /* Compare two gc entry. Only care about the colors for depth 1 */ static Boolean CompareGCDatas (XmHashKey key_1, XmHashKey key_2) { GCData *data_1 = (GCData *) key_1; GCData *data_2 = (GCData *) key_2; return ((data_1->screen == data_2->screen) && (data_1->print_shell == data_2->print_shell) && (data_1->depth == data_2->depth) && ((data_1->image_depth != 1) || ((data_1->image_depth == 1) && (data_1->foreground == data_2->foreground) && (data_1->background == data_2->background)))) ; } /* Hash a GC entry. Only care about the colors for depth 1 */ static XmHashValue HashGCData (XmHashKey key) { GCData *data = (GCData *) key; XmHashValue hv = 0 ; if (data->image_depth == 1) hv = data->foreground + data->background ; return (hv + (long)data->screen + (long)data->print_shell + data->depth + data->image_depth); } /*** * GetGCForPutImage * Maintain a cache of GC to use for transfering the XImage to * a Pixmap depending on the screen, depth, colors. ***/ static GC GetGCForPutImage(Screen *screen, Widget print_shell, XImage * image, Pixmap pixmap, int depth, Pixel foreground, Pixel background) { XGCValues gcValues; GCData gc_data, *gc_entry ; /* There is a problem here: we cannot simply use the xmScreen object * to store the GCs, for the pixmap conversion can be called * at a time the xmScreen is not yet available: a conversion * for the first VendorShell on this screen, or a conversion for * the xmScreen or xmDisplay. * We can either arrange for delaying the conversion for those cases, * or not use the xmScreen here. Since we need to cache per depth * in addition to per screen, and since the Xt routine cannot be used * since there is no widget available, let's forget about using the * xmScreen object, do our own specialized caching. */ /* There shouldn't be a lot of different GCs, one for * depth 1 to depth 1, foreground 1, back 0, one for * depth N to N, fore/back don't matter and some for depth 1 to * depth N, where colors matter, for backgroundPixmap resources * and regular use * of XmGetPixmapByDepth (with no -depth) issued from XBM file. */ _XmProcessLock(); if (gc_set == NULL) gc_set = _XmAllocHashTable (20, CompareGCDatas, HashGCData); _XmProcessUnlock(); /* set up an entry for search. We only care about the colors for image_depth 1 to pixmap depth (N or 1), since otherwise, N to N, the transfer is a plain copy */ gc_data.screen = screen ; gc_data.print_shell = print_shell ; gc_data.depth = depth ; gc_data.image_depth = image->depth ; gc_data.foreground = foreground ; gc_data.background = background ; /* look if we have a match and return it */ _XmProcessLock(); if ((gc_entry = (GCData*) _XmGetHashEntry(gc_set, (XmHashKey)&gc_data)) != NULL) { _XmProcessUnlock(); return gc_entry->gc ; } _XmProcessUnlock(); /* create a new GC, cache it and return it */ gc_entry = XtNew(GCData); gc_entry->screen = screen ; gc_entry->print_shell = print_shell ; gc_entry->depth = depth ; gc_entry->image_depth = image->depth ; gc_entry->foreground = foreground ; gc_entry->background = background ; _XmProcessLock(); _XmAddHashEntry(gc_set, (XmHashKey)gc_entry, (XtPointer)gc_entry); _XmProcessUnlock(); gcValues.foreground = foreground; gcValues.background = background; gc_entry->gc = XCreateGC (DisplayOfScreen(screen), pixmap, GCForeground | GCBackground, &gcValues); return gc_entry->gc ; } /************ When a Screen is closed, or a PrintShell, we need to clean up the respective cache . *****/ static Boolean CleanGCMapProc (XmHashKey key, /* unused */ XtPointer value, XtPointer data) { GCData *entry = (GCData *) value; CleanKey * ck = (CleanKey*) data ; /* shell should be NULL for non printing screen */ if (entry->print_shell == ck->shell && entry->screen == ck->screen) { _XmProcessLock(); _XmRemoveHashEntry (gc_set, entry); _XmProcessUnlock(); XFreeGC(DisplayOfScreen(entry->screen), entry->gc); XtFree((char*) entry); } /* never return True: remove all gc keyed on this print shell */ return False; } static Boolean CleanPixmapMapProc (XmHashKey key, /* unused */ XtPointer value, XtPointer data) { PixmapData *entry = (PixmapData *) value; CleanKey * ck = (CleanKey*) data ; /* shell should be NULL for non printing screen */ if (entry->print_shell == ck->shell && entry->screen == ck->screen) { /* this should take care of everything */ XmDestroyPixmap(entry->screen, entry->pixmap); } /* never return True: remove all pixmap keyed on this print shell */ return False; } #ifdef XP_DEBUG static Boolean PrintPixmapMapProc (XmHashKey key, /* unused */ XtPointer value, XtPointer data) { PixmapData *entry = (PixmapData *) value; CleanKey * ck = (CleanKey*) data ; printf("entry->screen %d\n", entry->screen); printf("entry->print_shell %d\n", entry->print_shell); printf("entry->image_name %s\n", entry->image_name); printf("entry->pixmap %d\n\n", entry->pixmap); return False; } static Boolean PrintGCMapProc (XmHashKey key, /* unused */ XtPointer value, XtPointer data) { GCData *entry = (GCData *) value; CleanKey * ck = (CleanKey*) data ; printf("entry->screen %d\n", entry->screen); printf("entry->print_shell %d\n", entry->print_shell); printf("entry->gc %d\n\n", entry->gc); return False; } #endif /****** This is called from PrintShell.Destroy to invalidate the GCs and Pixmap used for a given print shell and from Screen.destroy, with a NULL shell, to remove the GCs and Pixmap used for a given screen. So in the case of PrintShell, this is call twice in a row, where the second time (from Screen) takes care of the Screen (non print shell) specific pixmaps abd GCs. *******/ void _XmCleanPixmapCache(Screen * screen, Widget shell) { CleanKey ck ; ck.screen = screen; ck.shell = shell ; _XmMapHashTable(gc_set, CleanGCMapProc, &ck); _XmMapHashTable(pixmap_set, CleanPixmapMapProc, &ck); } /************************************************************************ *******************************************************************------ Design notes: There is really two different caches here, an XImage cache and a Pixmap cache (+ a GC cache). The XImage cache is name based (hash key is image_name). No colors are supported, and therefore, it is only useful with depth 1 XImage. Program can directly install non-depth 1 XImage in this cache using the public API (XmInstallImage), but that's not advised, for the non-depth 1 XImage resulting from XPM file have color variations for the same image_name. If you ask for image_name Foo, foreground red and background blue, and a Foo has been installed in the image cache using different foreground & background, you don't want to get back this Foo, but a new instance of Foo, one that uses the red and blue colors. Also, the only access to the XImage reader (GetImage) is via the pixmap API, so if a XPM with no colors sensitivity (no pertinent Motif symbolic colors) is read once, it will be found by the pixmap cache first, no need to cache it in the image cache. The Pixmap cache is name/depth/colors or pixmap based, depending which API is looking up. The old XmGetPixmapByDepth() is equivalent to asking for valid foreground/background and unspecified others, which means these additional colors (shadows, select) will not be used during Xpm reading for overriding symbolic colors. Motifnext adds printing support and clean cache support. ***/ #define roundint(x) MAX(1, (int)((x) + 0.5)) typedef struct { Position *x, *y; Dimension *width, *height; } Table; void _XmPutScaledImage ( Display* display, Drawable d, GC gc, XImage* src_image, int src_x, int src_y, int dest_x, int dest_y, unsigned int src_width, unsigned int src_height, unsigned int dest_width, unsigned int dest_height) { XImage *dest_image; Position x, y, min_y, max_y, src_max_x; Dimension w, h, strip_height; Table table; Pixel pixel; double ratio_x, ratio_y; Bool fast8; int xp_event, xp_error; if (dest_width == src_width && dest_height == src_height) { /* same for x and y, just send it out */ XPutImage(display, d, gc, src_image, src_x, src_y, dest_x, dest_y, dest_width, dest_height); return; } ratio_x = (double)dest_width / (double)src_width; ratio_y = (double)dest_height / (double)src_height; #ifdef PRINTING_SUPPORTED /* * Check that we have uniform scaling, and that the print extension * exists. We can't call XpGetContext first, because if the print * extension doesn't exist we'll get a warning to stderr. * It would be better if the print context was passed in directly, so * that we didn't spend a round trip when scaling for the video screen, * but it's just one round trip on just the first call per display, so * it's not that bad. */ h = (double)src_height * ratio_x + 0.5; if (dest_height <= h + 1 && h <= dest_height + 1 && XpQueryExtension(display, &xp_event, &xp_error)) { /* * We could be clever and try to get the print context first from * the _XmPrintScreenToShellContext and then get the resolution from * the print shell, but we don't have a Screen* to do the lookup. */ XPContext pcontext = XpGetContext(display); if (pcontext) { int media_res; media_res = atoi(XpGetOneAttribute(display, pcontext, XPDocAttr, "default-printer-resolution")); if (media_res) { int image_res = (double)media_res / ratio_x + 0.5; int prev_res; if (XpSetImageResolution(display, pcontext, image_res, &prev_res)) { XPutImage(display, d, gc, src_image, src_x, src_y, dest_x, dest_y, src_width, src_height); XpSetImageResolution(display, pcontext, prev_res, NULL); return; } } } } #endif /* PRINTING_SUPPORTED */ src_max_x = src_x + src_width; strip_height = 65536 / roundint(ratio_x * src_image->bytes_per_line); if (strip_height == 0) strip_height = 1; if (strip_height > dest_height) strip_height = dest_height; h = strip_height + roundint(ratio_y); dest_image = XCreateImage(display, DefaultVisualOfScreen( DefaultScreenOfDisplay(display)), src_image->depth, src_image->format, 0, NULL, dest_width, h, src_image->bitmap_pad, 0); dest_image->data = XtMalloc(dest_image->bytes_per_line * h); fast8 = (src_image->depth == 8 && src_image->bits_per_pixel == 8 && dest_image->bits_per_pixel == 8 && src_image->format == ZPixmap); table.x = (Position *) XtMalloc(sizeof(Position) * (src_image->width + 1)); table.y = (Position *) XtMalloc(sizeof(Position) * (src_image->height + 1)); table.width = (Dimension *) XtMalloc(sizeof(Dimension) * src_image->width); table.height = (Dimension *) XtMalloc(sizeof(Dimension)*src_image->height); table.x[0] = 0; for (x = 1; x <= src_image->width; x++) { table.x[x] = roundint(ratio_x * x); table.width[x - 1] = table.x[x] - table.x[x - 1]; } table.y[0] = 0; for (y = 1; y <= src_image->height; y++) { table.y[y] = roundint(ratio_y * y); table.height[y - 1] = table.y[y] - table.y[y - 1]; } for (min_y = table.y[src_y]; min_y < dest_height; min_y = table.y[y]) { max_y = min_y + strip_height; if (max_y > dest_height) { strip_height = dest_height - min_y; max_y = dest_height; } for (y = src_y; table.y[y] < max_y; y++) { if (table.y[y] < min_y) continue; if (fast8) { for (x = src_x; x < src_max_x; x++) { pixel = ((unsigned char *)src_image->data) [y * src_image->bytes_per_line + x]; for (h = 0; h < table.height[y]; h++) { memset(dest_image->data + (table.y[y] + h - min_y) * dest_image->bytes_per_line + table.x[x], pixel, table.width[x]); } } } else { for (x = src_x; x < src_max_x; x++) { pixel = XGetPixel(src_image, x, y); for (h = 0; h < table.height[y]; h++) { for (w = 0; w < table.width[x]; w++) XPutPixel(dest_image, table.x[x] + w, table.y[y] + h - min_y, pixel); } } } } XPutImage(display, d, gc, dest_image, dest_x, 0, dest_x, dest_y + min_y, dest_width, table.y[y] - min_y); if (y >= src_image->height) break; } XtFree((char *)table.x); XtFree((char *)table.y); XtFree((char *)table.width); XtFree((char *)table.height); XDestroyImage(dest_image); } /*** COLOR CACHE NOW ***/ static Boolean GetCacheColorByName( Display *display, Colormap colormap, char *colorname, XColor *xcolor) { static Boolean firstTime = True; XrmQuark colorname_q; int i; CachedColor *color; if (!colorname) return False; if ( firstTime ) { colorCacheList.numEntries = colorCacheList.maxEntries = 0; colorCacheList.cache = NULL; firstTime = False; return False; } colorname_q = XrmStringToQuark(colorname); for (i = 0, color = colorCacheList.cache; i < colorCacheList.numEntries; i++, color++) { if (color->colorname == colorname_q && color->colormap == colormap && color->display == display) { xcolor->pixel = color->pixel; color->num_cached++; return True; } } return False; } static Boolean GetCacheColorByRGB( Display *display, Colormap colormap, XColor *xcolor) { int i; CachedColor *color; for (i = 0, color = colorCacheList.cache; i < colorCacheList.numEntries; i++, color++) { if (color->colormap == colormap && color->display == display && color->red == xcolor->red && color->green == xcolor->green && color->blue == xcolor->blue) { xcolor->pixel = color->pixel; color->num_cached++; return True; } } return False; } static Boolean FreeCacheColor( Display *display, Colormap colormap, Pixel pixel) { int i; CachedColor *color; for (i = 0, color = colorCacheList.cache; i < colorCacheList.numEntries; i++, color++) { if (color->colormap == colormap && color->display == display && color->pixel == pixel) { color->num_cached--; if (color->num_cached == 0) { int j; for (j = i + 1; j < colorCacheList.numEntries; i++, j++) colorCacheList.cache[i] = colorCacheList.cache[j]; colorCacheList.numEntries--; XFreeColors(display, colormap, &pixel, 1, 0); return True; } } } return False; } static void CacheColorPixel( Display *display, Colormap colormap, char *colorname, XColor *xcolor) { int numEntries = colorCacheList.numEntries; if (numEntries == colorCacheList.maxEntries) { colorCacheList.maxEntries += 25; colorCacheList.cache = (CachedColor *) XtRealloc((char *)colorCacheList.cache, colorCacheList.maxEntries * sizeof(CachedColor)); } colorCacheList.cache[numEntries].display = display; colorCacheList.cache[numEntries].colormap = colormap; colorCacheList.cache[numEntries].colorname = colorname ? XrmStringToQuark(colorname) : NULLQUARK; colorCacheList.cache[numEntries].red = xcolor->red; colorCacheList.cache[numEntries].green = xcolor->green; colorCacheList.cache[numEntries].blue = xcolor->blue; colorCacheList.cache[numEntries].pixel = xcolor->pixel; colorCacheList.cache[numEntries].num_cached = 1; colorCacheList.numEntries++; } static int GetCacheColor(Display *display, Colormap colormap, char *colorname, XColor *xcolor, void *closure) { int status; if (colorname) { /* look for the colorname in the cache */ if (!GetCacheColorByName(display, colormap, colorname, xcolor)) { /* when not found parse and alloc color */ if (!XParseColor(display, colormap, colorname, xcolor)) return -1; if (!GetCacheColorByRGB(display, colormap, xcolor)) { status = XAllocColor(display, colormap, xcolor); if (status) /* if allocation succeeded, store color */ CacheColorPixel(display, colormap, colorname, xcolor); } else status = 1; } else status = 1; } else { if (!GetCacheColorByRGB(display, colormap, xcolor)) { status = XAllocColor(display, colormap, xcolor); if (status) /* if allocation succeeded, store color */ CacheColorPixel(display, colormap, colorname, xcolor); } else status = 1; } return status != 0 ? 1 : 0; } static int FreeCacheColors(Display *display, Colormap colormap, Pixel *pixels, int n, void *closure) { int i, status; for (i = 0; i < n; i++, pixels++) status = FreeCacheColor(display, colormap, *pixels); return 0; } motif-2.3.8/lib/Xm/TakesDefT.h0000644000175000017500000000317512672140200012700 00000000000000/* $XConsortium: TakesDefT.h /main/5 1995/07/15 20:55:59 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmTakesDefaultT_H #define _XmTakesDefaultT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTtakesDefault; /* Trait structures and typedefs, place typedefs first */ typedef void (*XmTakesDefaultNotifyProc)(Widget w, XtEnum state); /* Version 0: initial release. */ typedef struct _XmTakesDefaultTraitRec { int version; /* 0 */ XmTakesDefaultNotifyProc showAsDefault; } XmTakesDefaultTraitRec, *XmTakesDefaultTrait; enum {XmDEFAULT_READY, XmDEFAULT_ON, XmDEFAULT_OFF, XmDEFAULT_FORGET} ; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTakesDefaultT_H */ motif-2.3.8/lib/Xm/Dest.c0000644000175000017500000000442513145162623011770 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Dest.c /main/12 1995/09/19 23:00:44 cde-sun $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" #include "DestI.h" /* This function is used for setting the "last editable widget on which a select, edit, insert, or paste operation was performed and is a destination for quick paste and certain clipboard functions" (for this display connection) and is not necessarily a text widget. Under current usage by Motif internals: This function is for squirreling away the widget that has the destination cursor so that it can be retrieved when pasting from a menu. Called by _XmTextSetDestinationSelection. */ void _XmSetDestination (Display *dpy, Widget w) { XmDisplay dd = (XmDisplay) XmGetXmDisplay(dpy); /* w may be NULL */ if ((XmDisplay)NULL != dd) ((XmDisplayInfo *)(dd->display.displayInfo))->destinationWidget = w; } /* This public function retrieves the widget saved by _XmSetDestination. */ Widget XmGetDestination (Display *display) { XmDisplay dd = (XmDisplay) XmGetXmDisplay(display); Widget w = (Widget)NULL; _XmDisplayToAppContext(display); _XmAppLock(app); if ((XmDisplay)NULL != dd) w = ((XmDisplayInfo *)(dd->display.displayInfo))->destinationWidget; _XmAppUnlock(app); return w; } motif-2.3.8/lib/Xm/Paned.h0000644000175000017500000000453012672140200012111 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmPaned_h #define _XmPaned_h #if defined(VMS) || defined(__VMS) #include #endif #include #if defined(__cplusplus) extern "C" { #endif #define XmPanedAskChild 0 typedef struct _XmPanedClassRec *XmPanedWidgetClass; typedef struct _XmPanedRec *XmPanedWidget; /************************************************************ * * Public Procedures * ************************************************************/ /* Function Name: XmPanedGetPanes * Description: Returns the number of panes in the paned widget. * Arguments: w - the paned widget. * panes - the list of all panes contained in this widget. * num - the number of panes. * Returns: the number of panes in the paned widget. */ extern int XmPanedGetPanes( #ifndef _NO_PROTO Widget /* w */, WidgetList * /* panes */, int * /* num */ #endif ); /* Function Name: XmCreatePaned * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreatePaned( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); /* Class record constant */ extern WidgetClass xmPanedWidgetClass; #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmPaned_h -- DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/TravConT.h0000644000175000017500000000324312672140200012562 00000000000000/* $XConsortium: TravConT.h /main/5 1995/07/15 20:56:44 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmTravConT_h #define _XmTravConT_h #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTtraversalControl; typedef Widget (*XmTraversalRedirectionProc)(Widget old_focus, Widget new_focus, unsigned int focus_policy, XmTraversalDirection direction, unsigned int pass); /* Version 0: initial release. */ typedef struct _XmTraversalControlTraitRec { int version; /* 0 */ XmTraversalRedirectionProc redirect; } XmTraversalControlTraitRec, *XmTraversalControlTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* XmTravConT_h */ motif-2.3.8/lib/Xm/RCMenu.c0000644000175000017500000033076213145162623012230 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* Old comments from RowColumn.c changes carried forward: * Revision 1.10.8.2 92/09/18 19:22:07 drand * CR #5050: Changed the focus code so that an internal routine * SetInputFocus is called in place of XSetInputFocus. This allows us to * setup our own error handler and ignore the errors if the window has * been unmapped. XSetInputFocus does the correct thing in this case and * ignoring the error appears to be the correct course of action. * [1992/09/18 19:19:50 drand] * * * Revision 1.10.4.13 1992/08/10 13:12:32 deblois * Added fix to handle focus problem CRs 4896 and 4912. * [1992/08/10 13:11:14 deblois] */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char *rcsid = "$TOG: RCMenu.c /main/25 1999/05/24 18:06:57 samborn $"; #endif #endif #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "GadgetUtiI.h" #include "ManagerI.h" #include "MapEventsI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "MessagesI.h" #include "RCMenuI.h" #include "RowColumnI.h" #include "ScreenI.h" #include "TearOffI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "VendorSI.h" #define FIX_1535 static void SwallowEventHandler( Widget widget, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch); static void LocatePulldown( XmRowColumnWidget root, XmCascadeButtonWidget p, XmRowColumnWidget m, XEvent *event) ; static int OnPostFromList( XmRowColumnWidget menu, Widget widget) ; static XmRowColumnWidget FindMenu( Widget w) ; static void LotaMagic( XmRowColumnWidget m, RectObj child, XmRowColumnWidget *parent_m, Widget *w) ; static int InMenu( XmRowColumnWidget search_m, XmRowColumnWidget *parent_m, RectObj child, Widget *w) ; static Boolean SearchMenu( XmRowColumnWidget search_m, XmRowColumnWidget *parent_m, RectObj child, Widget *w, #if NeedWidePrototypes int setHistory) ; #else Boolean setHistory) ; #endif /* NeedWidePrototypes */ static void PrepareToCascade( XmRowColumnWidget submenu, Widget cb, XEvent *event) ; static void GetLastSelectToplevel( XmRowColumnWidget submenu) ; static Boolean ShouldDispatchFocusOut( Widget widget) ; static int MenuStatus( Widget wid ); static int MenuType( Widget ) ; static void PositionMenu( register XmRowColumnWidget m, XButtonPressedEvent *event) ; static void ButtonMenuPopDown( Widget w, XEvent *event, Boolean *popped_up) ; static void MenuArm( Widget w) ; static void MenuDisarm( Widget w) ; static void TearOffArm( Widget w) ; static void MenuBarCleanup( XmRowColumnWidget rc) ; static void InvalidateOldFocus( Widget oldWidget, Window **poldFocus, XEvent *event) ; static void ProcessMenuTree( XmRowColumnWidget w, int mode) ; static void AddToKeyboardList( Widget w, char *kbdEventStr, #if NeedWidePrototypes int needGrab, int isMnemonic) ; #else Boolean needGrab, Boolean isMnemonic) ; #endif /* NeedWidePrototypes */ static void _AddToKeyboardList( Widget w, unsigned int eventType, KeySym keysym, unsigned int modifiers, #if NeedWidePrototypes int needGrab, int isMnemonic) ; #else Boolean needGrab, Boolean isMnemonic) ; #endif /* NeedWidePrototypes */ static void AddKeycodeToKeyboardList( Widget w, unsigned int eventType, KeyCode keycode, KeySym keysym, unsigned int modifiers, Boolean needGrab, Boolean isMnemonic) ; static void RemoveFromKeyboardList( Widget w) ; static void GrabKeyOnAssocWidgets( XmRowColumnWidget rowcol, #if NeedWidePrototypes int detail, #else KeyCode detail, #endif /* NeedWidePrototypes */ unsigned int modifiers) ; static void UngrabKeyOnAssocWidgets( XmRowColumnWidget rowcol, #if NeedWidePrototypes int detail, #else KeyCode detail, #endif /* NeedWidePrototypes */ unsigned int modifiers) ; static Boolean InSharedMenupaneHierarchy( XmRowColumnWidget m) ; static void SetCascadeField( XmRowColumnWidget m, Widget cascadeBtn, #if NeedWidePrototypes int attach) ; #else Boolean attach) ; #endif /* NeedWidePrototypes */ static void BtnDownInRowColumn( Widget rc, XEvent *event, #if NeedWidePrototypes int x_root, int y_root) ; #else Position x_root, Position y_root) ; #endif /* NeedWidePrototypes */ static void CheckUnpostAndReplay( Widget rc, XEvent *event) ; static Boolean VerifyMenuButton( Widget w, XEvent *event ); static Boolean UpdateMenuHistory( XmRowColumnWidget menu, Widget child, #if NeedWidePrototypes int updateOnMemWidgetMatch) ; #else Boolean updateOnMemWidgetMatch) ; #endif /* NeedWidePrototypes */ static void RadioBehaviorAndMenuHistory( XmRowColumnWidget m, Widget w) ; static void ChildsActivateCallback( XmRowColumnWidget rowcol, Widget child, XtPointer call_value) ; static void EntryFired( Widget w, XtPointer client_data, XmAnyCallbackStruct *callback) ; static int NoTogglesOn( XmRowColumnWidget m) ; static int IsInWidgetList( register XmRowColumnWidget m, RectObj w) ; static void AllOffExcept( XmRowColumnWidget m, Widget w) ; static void MenuShellPopdown( Widget w, XEvent *e) ; static Boolean MenuSystemPopdown( Widget w, XEvent *e ) ; static Boolean MenuSystemButtonPopdown( Widget w, XEvent *e ) ; static void MenuChildFocus(Widget w) ; static Widget MenuPopupPosted(Widget w) ; static void DismissTearOffSubMenu(XmRowColumnWidget menu); /* * Define trait records */ XmMenuSystemTraitRec _XmRC_menuSystemRecord = { 0, /* version */ MenuType, MenuStatus, (XmMenuSystemCascadeProc) PrepareToCascade, (XmMenuSystemVerifyProc) VerifyMenuButton, (XmMenuSystemControlTraversalProc) _XmSetMenuTraversal, (XmMenuSystemMenuBarCleanupProc) MenuBarCleanup, (XmMenuSystemPopdownProc) MenuSystemPopdown, (XmMenuSystemPopdownProc) MenuSystemButtonPopdown, _XmRestoreExcludedTearOffToToplevelShell, _XmRestoreTearOffToMenuShell, MenuArm, MenuDisarm, TearOffArm, (XmMenuSystemEntryCallbackProc) ChildsActivateCallback, (XmMenuSystemUpdateHistoryProc) UpdateMenuHistory, (XmMenuSystemGetPostedFromWidgetProc) GetLastSelectToplevel, (XmMenuSystemPositionProc) PositionMenu, (XmMenuSystemUpdateBindingsProc) _XmRC_DoProcessMenuTree, (XmMenuSystemRecordPostFromWidgetProc) SetCascadeField, MenuShellPopdown, MenuChildFocus, MenuPopupPosted }; /* * this entry is set in label and label gadget's class field so that * all communication from the buttons to the RowColumn are done through * this entry and then revectored to the appropriate routine. */ void _XmRCMenuProcedureEntry( int proc, Widget widget, ... ) { int flag ; XtPointer data ; XtPointer data2 ; va_list ap ; va_start( ap, widget) ; /* note! in general, the "flag" argument is rarely used (but is needed for ** backward compatibility) */ switch (proc) { case XmMENU_CASCADING: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; data2 = va_arg( ap, XtPointer) ; PrepareToCascade((XmRowColumnWidget) data, widget, (XEvent *) data2); break; case XmMENU_POPDOWN: flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; data2 = va_arg( ap, XtPointer) ; _XmMenuPopDown (widget, (XEvent *) data, (Boolean *) data2); break; case XmMENU_SHELL_POPDOWN: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; MenuShellPopdown(widget, (XEvent *) data); break; case XmMENU_BUTTON: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; data2 = va_arg( ap, XtPointer) ; * ((Boolean *) data2) = VerifyMenuButton (widget, (XEvent *) data); break; case XmMENU_CALLBACK: flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; data2 = va_arg( ap, XtPointer) ; /* data points to the widget which was activated */ ChildsActivateCallback ((XmRowColumnWidget) widget, (Widget) data, (XtPointer) data2); break; case XmMENU_TRAVERSAL: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; /* data points to a boolean */ _XmSetMenuTraversal(widget, (Boolean) flag); break; case XmMENU_SUBMENU: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; SetCascadeField ((XmRowColumnWidget) widget, (Widget) data, (Boolean) flag); break; case XmMENU_PROCESS_TREE: /* appears to be obsolete within Xm */ _XmRC_DoProcessMenuTree (widget, XmREPLACE); flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; data2 = va_arg( ap, XtPointer) ; break; case XmMENU_ARM: /* appears to be obsolete within Xm */ MenuArm (widget); flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; break; case XmMENU_DISARM: MenuDisarm (widget); break; case XmMENU_BAR_CLEANUP: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; MenuBarCleanup ((XmRowColumnWidget) widget); break; case XmMENU_STATUS: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; * ((int *) data) = MenuStatus(widget); break; case XmMENU_MEMWIDGET_UPDATE: /* appears to be obsolete within Xm */ if (UpdateMenuHistory((XmRowColumnWidget)XtParent(widget), widget, True)) RC_MemWidget(XtParent(widget)) = widget; flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; break; case XmMENU_BUTTON_POPDOWN: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; data2 = va_arg( ap, XtPointer) ; ButtonMenuPopDown (widget, (XEvent *) data, (Boolean *) data2); break; case XmMENU_RESTORE_EXCLUDED_TEAROFF_TO_TOPLEVEL_SHELL: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; _XmRestoreExcludedTearOffToToplevelShell(widget, (XEvent *) data); break; case XmMENU_RESTORE_TEAROFF_TO_TOPLEVEL_SHELL: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; _XmRestoreTearOffToToplevelShell(widget, (XEvent *) data); break; case XmMENU_RESTORE_TEAROFF_TO_MENUSHELL: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; _XmRestoreTearOffToMenuShell(widget, (XEvent *) data); break; case XmMENU_GET_LAST_SELECT_TOPLEVEL: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; data2 = va_arg( ap, XtPointer) ; GetLastSelectToplevel((XmRowColumnWidget) widget); break; case XmMENU_TEAR_OFF_ARM: /* appears to be obsolete within Xm */ flag = va_arg( ap, int) ; data = va_arg( ap, XtPointer) ; TearOffArm(widget); break; default: break; } va_end( ap) ; } static void MenuShellPopdown( Widget w, XEvent *e) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))(w, e, NULL, NULL); } /* * Called by PrepareToCascade() and ChildsActivateCallback(). * This will allow XmGetPostedFromWidget() to be called from map and activate * or entrycallback callbacks. */ static void GetLastSelectToplevel( XmRowColumnWidget submenu ) { XmRowColumnWidget topLevel; XmMenuState mst = _XmGetMenuState((Widget)submenu); /* "_XmLastSelectToplevel" only set for accelerators via * KeyboardInputHandler(). */ if (IsPopup(submenu)) { /* A popup's lastSelectToplevel is always itself! The cascadeBtn * indicates the postedFromWidget. */ if (mst->RC_LastSelectToplevel) RC_CascadeBtn(submenu) = mst->RC_LastSelectToplevel; } else { if (mst->RC_LastSelectToplevel) topLevel = (XmRowColumnWidget)mst->RC_LastSelectToplevel; else { _XmGetActiveTopLevelMenu ((Widget) submenu, (Widget *) &topLevel); /* If the active topLevel menu is torn, then use it's saved away * lastSelectTopLevel from tear-time. */ if (RC_TearOffActive(topLevel)) topLevel = (XmRowColumnWidget) topLevel->row_column.tear_off_lastSelectToplevel; } submenu->row_column.lastSelectToplevel = (Widget) topLevel; } } /* * called by cascadebutton (or CBG) before cascading a menu. The interface * is through the menuProcs handle. */ static void PrepareToCascade( XmRowColumnWidget submenu, Widget cb, XEvent *event ) { RC_CascadeBtn(submenu) = cb; RC_PostButton(submenu) = RC_PostButton(XtParent(cb)); RC_PostModifiers(submenu) = RC_PostModifiers(XtParent(cb)); RC_PostEventType(submenu) = RC_PostEventType(XtParent(cb)); RC_PopupPosted(XtParent(cb)) = XtParent(submenu); if (IsOption(XtParent(cb))) RC_MemWidget(submenu) = RC_MemWidget(XtParent(cb)); PositionMenu (submenu, (XButtonPressedEvent *) event); /* * Set submenu's lastselectToplevel in case map callback needs info */ GetLastSelectToplevel(submenu); } /* ARGSUSED */ static void LocatePulldown( XmRowColumnWidget root, XmCascadeButtonWidget p, XmRowColumnWidget m, XEvent *event ) { Position x, y, x1, y1; if (root == NULL) return; x = y = 0; /* punt, don't know */ if (IsOption (root)) /* near hot spot */ { /* of option button (p) */ if (! XtIsRealized( (Widget) m)) XtRealizeWidget( (Widget) m); if (LayoutIsRtoLG(p)) x = RC_MemWidget(m) ? (XtWidth(p) - (XtWidth(RC_MemWidget(m)) + G_HighlightThickness(p) + 2*MGR_ShadowThickness(m))) : XtWidth(p) - G_HighlightThickness(p); else x = RC_MemWidget(m) ? (G_HighlightThickness(p) + MGR_ShadowThickness(m) - XtX(RC_MemWidget(m))) : G_HighlightThickness(p); y = RC_MemWidget(m) ? (Half (XtHeight (p)) - (XtY(RC_MemWidget(m)) + Half(XtHeight(RC_MemWidget(m))))) : XtY(p); } else if (IsBar (root)) { /* aligned with left edge of cascade button, below cascade button. If it is a vertical menu bar, in which case position off the left or right edge (depending on RtoL) */ if (LayoutIsRtoLM(m)) { /* aligned with right edge of cascade button */ if (! XtIsRealized ((Widget)m)) XtRealizeWidget ((Widget) m); x = XtWidth(p) - XtWidth(m); /* Vertical bar, move it back */ if (! IsHorizontal(root)) x -= XtWidth(p); } else { if (IsHorizontal(root)) x = 0; else x = XtWidth(p); } if (IsHorizontal(root)) y = XtHeight (p); else y = 0; } else if (XmIsCascadeButtonGadget(p) && CBG_HasCascade(p)) { /* gadget; have to use parent as base for coordinates */ if (LayoutIsRtoLM(m)) x = XtX(p) + CBG_Cascade_x(p) - XtWidth(m); else x = XtX(p) + CBG_Cascade_x(p) + CBG_Cascade_width(p); y = XtY(p) + CBG_Cascade_y(p); /* cast only to eliminate warning */ p = (XmCascadeButtonWidget)XtParent(p); } else if (XmIsCascadeButton(p) && CB_HasCascade(p)) { if (LayoutIsRtoLM(m)) x = CB_Cascade_x(p) - XtWidth(m); else x = CB_Cascade_x(p) + CB_Cascade_width(p); y = CB_Cascade_y(p); } /* * Take these co-ords which are in the cascade button * widget's co-ord system and convert them to the root * window co-ords. */ XtTranslateCoords( (Widget) p, x, y, &x1, &y1); /* Oh no! we're going off screen. Let's try and do something reasonable. We're only doing the cascade off a menu case for now. (CR 6421) */ if ((x1 + XtWidth(m)) > WidthOfScreen(XtScreen(m))) { if (!IsOption(root) && (XmIsCascadeButton(p) || XmIsCascadeButtonGadget(p))) { x1 -= XtWidth(m) + x - XtX(p); } } else if (x1 < 0) { /* R to L case */ if (!IsOption(root) && (XmIsCascadeButton(p) || XmIsCascadeButtonGadget(p))) { x1 += XtWidth(m) + x - XtX(p); } } XtX (m) = x1; XtY (m) = y1; } /* These next two routines are provided to change and get the way popup and * option menus react to a posting ButtonClick. The default (True) is for * the menupane to remain posted when a button release is received within * XtMultiClickTime of the posting button press. Setting popupMenuClick to * False will cause these types of menus to always unpost on Button Release. * Note that these are _Xm functions for 1.2 only and will be replaced with * resource access in Motif 1.3! Be forewarned! */ void _XmSetPopupMenuClick( Widget wid, #if NeedWidePrototypes int popupMenuClick) #else Boolean popupMenuClick) #endif /* NeedWidePrototypes */ { if (wid && XmIsRowColumn(wid)) RC_popupMenuClick(wid) = popupMenuClick; } Boolean _XmGetPopupMenuClick( Widget wid ) { if (wid && XmIsRowColumn(wid)) return((Boolean)RC_popupMenuClick(wid)); return(True); /* If undefined, always return CUA */ } /*************************************************************************** * * * next section is action routines, these are called by the row column event * handler in response to events. The handler parses its way through * the actions table calling these routines as directed. It is these * routines which will typically decide the application should be * called via a callback. This is where callback reasons are produced. * */ static XmRowColumnWidget FindMenu( Widget w ) { if (XmIsRowColumn(w)) return ((XmRowColumnWidget) w); /* row column itself */ else return ((XmRowColumnWidget) XtParent (w)); /* subwidget */ } /* * popdown anything that should go away */ void _XmMenuPopDown( Widget w, XEvent *event, Boolean *popped_up ) { XmRowColumnWidget rc = FindMenu(w); XmRowColumnWidget toplevel_menu; XmMenuShellWidget ms; Boolean posted; Time _time; _time = _XmGetDefaultTime(w, event); _XmGetActiveTopLevelMenu ((Widget) rc, (Widget *) &toplevel_menu); /* MenuShell's PopdownDone expects the leaf node submenu so that it can * determine if BSelect might have occured in one of its gadgets. It * will popdown everything from the active top down. Use RC_PopupPosted * for menubar to PopdownDone can get to a menushell. */ if (IsBar(rc)) { if (RC_PopupPosted(rc)) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownDone))((Widget) RC_PopupPosted(rc), event, NULL, NULL); } else /* in PM mode - requires special attention */ { /* No submenus posted; must clean up ourselves */ _XmMenuFocus( (Widget) rc, XmMENU_END, _time); XtUngrabPointer( (Widget) rc, _time); MenuBarCleanup(rc); _XmSetInDragMode((Widget) rc, False); MenuDisarm((Widget)rc); } } else if (!XmIsMenuShell(XtParent(rc))) /* torn! */ { /* if popupPosted pop it down. * else restore state to inactive as if the menu was active... in case * the menu was really not active, _XmMenuFocus(), MenuDisarm(), and * XtUngrabPointer() hopefully return w/o doing anything. */ if (RC_PopupPosted(rc)) /* if no popupPosted, nothing to do! */ { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownDone))((Widget) RC_PopupPosted(rc), event, NULL, NULL); } else { _XmMenuFocus(XtParent(rc), XmMENU_END, _time); MenuDisarm ((Widget) toplevel_menu); XtUngrabPointer(XtParent(rc), _time); } } else if (IsOption(toplevel_menu) && !XmIsRowColumn(w) && (w != RC_MemWidget(rc))) { _XmMenuFocus(XtParent(rc), XmMENU_END, _time); (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))((Widget) XtParent(rc), event, NULL, NULL); MenuDisarm ((Widget) toplevel_menu); XtUngrabPointer(XtParent(rc), _time); } else (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownDone))((Widget) rc, event, NULL, NULL); if (IsPulldown(rc)) ms = (XmMenuShellWidget)XtParent(rc); else if (IsPulldown(toplevel_menu) || IsPopup(toplevel_menu)) ms = (XmMenuShellWidget)XtParent(toplevel_menu); else if (IsOption(toplevel_menu)) ms = (XmMenuShellWidget)XtParent(RC_OptionSubMenu(toplevel_menu)); else ms = NULL; if (ms && XmIsMenuShell(ms)) /* && !torn */ { if ((posted = ms->shell.popped_up) != False) MenuDisarm((Widget) rc); } else posted = False; if (popped_up) *popped_up = posted; } /* * Swallow focus and crossing events while the menubar is active. This * allows traversal to work in menubar while its submenus have the "real" * focus. */ /*ARGSUSED*/ static void SwallowEventHandler( Widget widget, /* unused */ XtPointer client_data, /* unused */ XEvent *event, Boolean *continue_to_dispatch) { /* while the Menubar is active don't allow any focus type events to the * shell */ switch (event->type) { case EnterNotify: case LeaveNotify: case FocusOut: /* Allow FocusIn so when we XmProcessTraversal(menupane), the first item * gets the focus and highlight. case FocusIn: */ *continue_to_dispatch = False; } } void _XmSetSwallowEventHandler( Widget widget, #if NeedWidePrototypes int add_handler ) #else Boolean add_handler ) #endif { EventMask eventMask; eventMask = EnterWindowMask | LeaveWindowMask | FocusChangeMask; if (add_handler) XtInsertEventHandler( _XmFindTopMostShell(widget), eventMask, False, SwallowEventHandler, NULL, XtListHead); else XtRemoveEventHandler(_XmFindTopMostShell(widget), eventMask, False, SwallowEventHandler, NULL); } /* * Action routines specific to traversal. */ /* ARGSUSED */ void _XmMenuUnmap( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; /* * Typically, when a cascade button is in a transient menupane, we just * want to ignore unmap requests. However, when it is in a menubar, we * want it handled normally. */ if (RC_Type(XtParent(cb)) == XmMENU_BAR) _XmPrimitiveUnmap( (Widget) cb, event, NULL, NULL); } /* ARGSUSED */ void _XmMenuFocusOut( Widget cb, XEvent *event, String *param, Cardinal *num_param ) { /* * This ugly piece of code has once again reared its head. This is to * take care of a focus out on the cascade of a tear off menupane. */ if (!ShouldDispatchFocusOut(cb)) return; /* Forward the event for normal processing */ _XmPrimitiveFocusOut( cb, event, NULL, NULL); } /* * The normal primitive FocusIn procedure does nothing if a transient * operation is happening. Since we are part of the transient operation, * and we still want focus to work, we need to use the internal function. */ /* ARGSUSED */ void _XmMenuFocusIn( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; /* Forward the event for normal processing */ _XmPrimitiveFocusInInternal( (Widget) cb, event, NULL, NULL); } /* * Class function which is used to clean up the menubar when it is leaving * the mode where the user has pressed F10 to start traversal in the * menubar. */ static void MenuBarCleanup( XmRowColumnWidget rc ) { _XmMenuSetInPMMode ((Widget)rc, False); } /*ARGSUSED*/ static int SIF_ErrorHandler(Display *display, /* unused */ XErrorEvent* event) { return 0; } static void SetInputFocus(Display *display, Window focus, int revert_to, Time time) { XErrorHandler old_Handler; /* Setup error proc and reset error flag */ old_Handler = XSetErrorHandler((XErrorHandler) SIF_ErrorHandler); /* Set the input focus */ XSetInputFocus(display, focus, revert_to, time); XSync(display, False); XSetErrorHandler(old_Handler); } /* ARGSUSED */ void _XmMenuFocus( Widget w, int operation, Time _time ) { XmMenuState mst = _XmGetMenuState((Widget)w); Window tmpWindow; int tmpRevert; if (_time == CurrentTime) _time = XtLastTimestampProcessed(XtDisplay(w)); switch (operation) { case XmMENU_END: if (mst->RC_menuFocus.oldFocus != (Window) NULL) { /* Reset the focus when there's a valid window: * - the old focus window/widget is a shell and it's popped up * - the old focus window/widget is viewable (mapped) * And the destroy callback hasn't invalidated oldFocus */ if (mst->RC_menuFocus.oldWidget != 0) { XtRemoveCallback(mst->RC_menuFocus.oldWidget, XtNdestroyCallback, (XtCallbackProc)InvalidateOldFocus, (XtPointer) &mst->RC_menuFocus.oldFocus); /* oldWidget is not destroyed so the window is valid. */ if (XtIsRealized(mst->RC_menuFocus.oldWidget)) { XWindowAttributes xwa ; /* 99.9% of the time, oldWidget is a shell. So we'll * funnel everything through XGetWindowAttributes. For * non-shells we could just call _XmIsViewable(). */ XGetWindowAttributes( XtDisplay(mst->RC_menuFocus. oldWidget), mst->RC_menuFocus.oldFocus, &xwa); if (xwa.map_state == IsViewable) /** old code with fix for 5715 if (!XtIsShell(mst->RC_menuFocus.oldWidget) || XtIsApplicationShell(mst->RC_menuFocus.oldWidget) || (((ShellWidget)mst->RC_menuFocus.oldWidget)-> shell.popped_up)) **/ { SetInputFocus(XtDisplay(w), mst->RC_menuFocus.oldFocus, mst->RC_menuFocus.oldRevert, mst->RC_menuFocus.oldTime); } } } /* * Since the focus may have been taken from a window and not a widget, * set the focus back to that window if there is not associated widget. * This was added to correct focus problems in CR 4896 and 4912. */ else { SetInputFocus(XtDisplay(w), mst->RC_menuFocus.oldFocus, mst->RC_menuFocus.oldRevert, mst->RC_menuFocus.oldTime); } mst->RC_menuFocus.oldFocus = 0; mst->RC_menuFocus.oldRevert = 0; mst->RC_menuFocus.oldWidget = (Widget) NULL; } XtUngrabKeyboard(w, _time); break; case XmMENU_BEGIN: XGetInputFocus(XtDisplay(w), &mst->RC_menuFocus.oldFocus, &mst-> RC_menuFocus.oldRevert); mst->RC_menuFocus.oldWidget = XtWindowToWidget(XtDisplay(w), mst-> RC_menuFocus.oldFocus); mst->RC_menuFocus.oldTime = _time - 1; SetInputFocus(XtDisplay(w), XtWindow(w), mst->RC_menuFocus.oldRevert, mst->RC_menuFocus.oldTime); /* * If unable to set focus, it means that some other application * (hopefully the WM) has set the focus more recently; try to * set focus with _time instead of _time - 1. Otherwise, * it's possible some other application (hopefully the WM) * will set the focus soon - see XmMENU_MIDDLE comments. */ XGetInputFocus(XtDisplay(w), &tmpWindow, &tmpRevert); if (tmpWindow != XtWindow(w)) { SetInputFocus(XtDisplay(w), XtWindow(w), tmpRevert, _time); mst->RC_menuFocus.oldRevert = tmpRevert; mst->RC_menuFocus.oldTime = _time; if (tmpWindow != mst->RC_menuFocus.oldFocus) { mst->RC_menuFocus.oldFocus = tmpWindow; mst->RC_menuFocus.oldWidget = XtWindowToWidget(XtDisplay(w), tmpWindow); } } if (mst->RC_menuFocus.oldWidget != NULL) XtAddCallback(mst->RC_menuFocus.oldWidget, XtNdestroyCallback, (XtCallbackProc) InvalidateOldFocus, (XtPointer) &mst-> RC_menuFocus.oldFocus); XFlush(XtDisplay(w)); break; case XmMENU_MIDDLE: SetInputFocus(XtDisplay(w), XtWindow(w), mst->RC_menuFocus.oldRevert, mst->RC_menuFocus.oldTime); /* * If unable to set focus, some other application has set * focus more recently than time saved by our last success. * Try _time (if later than oldTime), and update menuFocus * structure appropriately. */ XGetInputFocus(XtDisplay(w), &tmpWindow, &tmpRevert); if ((tmpWindow != XtWindow(w)) && (_time > mst->RC_menuFocus.oldTime)) { SetInputFocus(XtDisplay(w), XtWindow(w), tmpRevert, _time); mst->RC_menuFocus.oldRevert = tmpRevert; mst->RC_menuFocus.oldTime = _time; if (tmpWindow != mst->RC_menuFocus.oldFocus) { #ifdef FIX_1535 if (mst->RC_menuFocus.oldFocus != (Window) NULL && mst->RC_menuFocus.oldWidget != NULL) #else if (mst->RC_menuFocus.oldWidget != NULL) #endif XtRemoveCallback(mst->RC_menuFocus.oldWidget, XtNdestroyCallback, (XtCallbackProc)InvalidateOldFocus, (XtPointer) &mst->RC_menuFocus.oldFocus); mst->RC_menuFocus.oldFocus = tmpWindow; mst->RC_menuFocus.oldWidget = XtWindowToWidget(XtDisplay(w), tmpWindow); if (mst->RC_menuFocus.oldWidget != NULL) XtAddCallback(mst->RC_menuFocus.oldWidget, XtNdestroyCallback, (XtCallbackProc) InvalidateOldFocus, (XtPointer) &mst->RC_menuFocus.oldFocus); } } break; } } /* * Class function which is invoked when the post accelerator is received * for a popup menu or the menubar, or the post mnemonic is received for * an option menu. */ void _XmRCArmAndActivate( Widget w, XEvent *event, String *parms, Cardinal *num_parms ) { XmRowColumnWidget m = (XmRowColumnWidget) w ; int i; XmCascadeButtonWidget child = NULL; XmMenuState mst = _XmGetMenuState((Widget)w); Time _time; _time = _XmGetDefaultTime(w, event); if (IsPopup(m)) { if (RC_TornOff(m) && !XmIsMenuShell(XtParent(m))) _XmRestoreTearOffToMenuShell((Widget)m, event); if (!XtIsManaged((Widget)m)) { Position x, y; /* the posted from widget is saved in RC_CascadeBtn */ if (mst->RC_LastSelectToplevel) RC_CascadeBtn(m) = mst->RC_LastSelectToplevel; else RC_CascadeBtn(m) = XtParent(XtParent(m)); /* help! help! */ /* Position & post menupane; then enable traversal */ RC_SetWidgetMoved(m, True); /*_XmLastSelectToplevel */ /* Position the pane off of the last selected toplevel, or if there * isn't one, off of its parent (help!). * Place it in the upper left corner. */ if (mst->RC_LastSelectToplevel) XtTranslateCoords(mst->RC_LastSelectToplevel, 0, 0, &x, &y); else XtTranslateCoords(XtParent(XtParent(m)), 0, 0, &x, &y); XtX(m) = x; XtY(m) = y; /* Verify popup for MenuShell's manage_set_changed() */ mst->RC_ButtonEventStatus.time = event->xkey.time; mst->RC_ButtonEventStatus.verified = True; mst->RC_ButtonEventStatus.event = *((XButtonEvent *)event); XtManageChild( (Widget) m); _XmSetInDragMode((Widget) m, False); XmProcessTraversal((Widget) m, XmTRAVERSE_CURRENT); } else { /* Let the menushell widget clean things up */ (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownDone))(XtParent(m), event, NULL, NULL); } } else if (IsOption(m)) { XmGadget g = (XmGadget) XmOptionButtonGadget( (Widget) m); /* Let the cascade button gadget do the work */ (*(((XmGadgetClassRec *)XtClass(g))->gadget_class. arm_and_activate)) ((Widget) g, event, parms, num_parms); } else if (IsBar(m)) { if (RC_IsArmed(m)) { _XmMenuPopDown((Widget) m, event, NULL); } else { _XmMenuSetInPMMode ((Widget)m, True); /* traversal must be on for children to be traversable */ m->manager.traversal_on = True; /* First look for a non-Help menu child. If this fails we'll use the help menu */ for (i = 0; i < m->composite.num_children; i++) { child = (XmCascadeButtonWidget)m->composite.children[i]; if (!IsHelp(m, (Widget)child) && XmIsTraversable( (Widget) child)) break; } /* See if we found one */ if (i >= m->composite.num_children) { /* If we haven't, and there's no help menu, then fail */ if (!(RC_HelpPb (m) && XmIsTraversable( (Widget) RC_HelpPb (m)))) { m->manager.traversal_on = False; return; } else /* But use the help menu if it exists */ child = (XmCascadeButtonWidget) RC_HelpPb(m); } /* Don't post the menu if the menu cannot control grabs! */ if (_XmMenuGrabKeyboardAndPointer((Widget)m, _time) != GrabSuccess) { return; } _XmMenuFocus( (Widget) m, XmMENU_BEGIN, _time); MenuArm((Widget) child); RC_SetBeingArmed(m, False); /* To support menu replay, keep the pointer in sync mode. * The grab freezes the pointer queue, unfreeze for this * instance where a keyevent has caused the grab. */ XAllowEvents(XtDisplay(m), SyncPointer, CurrentTime); _XmSetInDragMode((Widget) m, False); } } else if (IsPulldown(m)) /* Catch the Escape in a cascading menu! */ { /* Let the menushell widget clean things up */ (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownOne))(XtParent(m), event, NULL, NULL); } } /* * The following functions are used to manipulate lists of keyboard events * which are of interest to the menu system; i.e. accelerators and mnemonics. * The top level component within a menu system (the menubar, or the popup * menupane, or the option menu, or the work area menu) keeps a list of * the events it cares about. Items are only added to the list when the * associated menu component has a complete path to the top level component. * Items are removed when the complete path is broken. * * The times at which a complete path may be formed is 1) When a button * in a menupane becomes managed, when a pulldown menupane is attached * to a cascading button, when the application sets the popupEnabled * resource to True, or when an option menu is created. A complete path * may be broken when 1) a button in a menupane is unmanaged, a pulldown * menupane is detached from a cascading button, when the application clears * the popupEnabled resource or an option menu is destroyed. * * The event handler for catching keyboard events is added by the row column * widget during its initialize process, and removed when the row column * widget is destroyed. Keyboard grabs, which are needed to make accelerators * work, are added either when the accelerator is registered, or when the * associated widget is realized; grabs cannot be added to a widget which * does not have a window! */ /* * This function is used both by the row column widget, and components which * are contained within a menu (toggle, pushbutton and cascadebutton). The * row column widget uses it to process a tree of menu components; when a * menupane is linked to a cascade button, the new menupane, along with any * submenus cascading from it, will be processed. The row column widget * will use the XmADD or XmDELETE mode to to this. When a menu component * needs to change its accelerator or mnemonics, it will use the XmREPLACE * mode. * * When this function is used to delete a tree of keyboard actions, the * link between the menupane at the root (parameter 'w') and the cascade * button it is attached to must not yet have been broken. This allows * the function to trace up the hierarchy and find the top level widget. */ void _XmRC_DoProcessMenuTree( Widget w, int mode ) /* Add, Replace or Delete */ { /* * Depending upon the type of widget 'w' is, we may end up adding/deleting * keyboard actions for no widgets, the specified widget only, or the * specified widget and all others which cascade from it. */ if (XmIsCascadeButton(w) || XmIsCascadeButtonGadget(w)) { /* If our parent is not a row column, then abort */ if (XmIsRowColumn(XtParent(w))) { if (IsOption(XtParent(w))) { if (mode == XmREPLACE) return; /* * A cascade button in an option menu does not have an * accelerator or a mnemonic associated with it. However, * its submenu may, so we need to process it. */ if (XmIsCascadeButtonGadget(w)) w = (Widget)CBG_Submenu(w); } else if (IsWorkArea(XtParent(w))) { /* * Since work area menus do not support cascade buttons * with submenus, we will treat this like a pushbutton. */ if (mode == XmREPLACE) { /* Remove old one, if it exists */ _XmRC_ProcessSingleWidget(w, XmDELETE); mode = XmADD; } _XmRC_ProcessSingleWidget(w, mode); return; } else if (IsBar(XtParent(w)) || IsPopup(XtParent(w)) || IsPulldown(XtParent(w))) { if (mode == XmREPLACE) { /* When replacing, don't worry about submenus */ _XmRC_ProcessSingleWidget(w, XmDELETE); _XmRC_ProcessSingleWidget(w, XmADD); return; } /* * If we are in a menubar, a popup menupane or a pulldown * menupane, then we need to not only modify our keyboard * event, but also any which are defined in our submenu. */ _XmRC_ProcessSingleWidget(w, mode); if (XmIsCascadeButtonGadget(w)) w = (Widget)CBG_Submenu(w); else w = (Widget)CB_Submenu(w); } } } else if (XmeTraitGet((XtPointer) XtClass(w), XmQTmenuSavvy) != NULL && XtClass(w) != xmLabelWidgetClass && XtClass(w) != xmLabelGadgetClass) { if (mode == XmREPLACE) { /* Remove old one */ _XmRC_ProcessSingleWidget(w, XmDELETE); mode = XmADD; } /* * In both of these cases, we need only modify the keyboard * event associated with this widget. */ _XmRC_ProcessSingleWidget(w, mode); return; } else if (XmIsRowColumn(w)) { /* * When the popupEnabled resource is enabled for a popup menupane, * we need to add the accelerator associated with the menu, followed * by all keyboard events associated with submenus. The reverse * happens when the resource is disabled. * * When an option menu is created, we will add its posting mnemonic; * its submenu is taken care of when it is attached to the cascading * button. */ if (IsPopup(w)) { if (mode == XmREPLACE) { /* Don't worry about submenus during a replace operation */ _XmRC_ProcessSingleWidget(w, XmDELETE); _XmRC_ProcessSingleWidget(w, XmADD); return; } _XmRC_ProcessSingleWidget(w, mode); } else if (IsOption(w) || IsBar(w)) { if (mode == XmREPLACE) { _XmRC_ProcessSingleWidget(w, XmDELETE); mode = XmADD; } _XmRC_ProcessSingleWidget(w, mode); return; } } else { /* Unknown widget type; do nothing */ return; } /* Process any submenus. * Don't call this if the widget is in the process of being destroyed * since its children are already gone. * Don't process if mode is DELETE and it's in a sharedmenupanehierarchy * to preverve accelerators and mnemonics. If we allow check to slip * through to RemoveFromKeyboardList, the mnemonics disappear. */ if (w && !(w->core.being_destroyed) && !((mode == XmDELETE) && InSharedMenupaneHierarchy((XmRowColumnWidget)w))) { ProcessMenuTree((XmRowColumnWidget)w, mode); } } /* * Given a row column widget, all keyboard events are processed * for the items within the row column widget, and then recursively * for any submenus cascading from this row column widget. */ static void ProcessMenuTree( XmRowColumnWidget w, int mode ) { int i; Widget child; if (w == NULL) return; for (i = 0; i < w->composite.num_children; i++) { if (XtIsManaged((child = w->composite.children[i]))) { _XmRC_ProcessSingleWidget(child, mode); if (XmIsCascadeButtonGadget(child)) { ProcessMenuTree((XmRowColumnWidget) CBG_Submenu(child), mode); } else if (XmIsCascadeButton(child)) { ProcessMenuTree((XmRowColumnWidget) CB_Submenu( (XmCascadeButtonWidget) child), mode); } } } } /* * This function adds/deletes the mnemonic and/or accelerator associated * with the specified widget. The work that is done is dependent both * on the widget in question, and sometimes the parent of the widget. * * When adding a keyboard event, we first check the component to see if * it has any keyboard events defined; if not, then nothing is done. However, * when removing a keyboard event, we simply attempt to remove the entry for * the specified widget; we can't check to see if the widget had one defined, * because the instance structure may no longer contain the information. */ void _XmRC_ProcessSingleWidget( Widget w, int mode ) { Arg args[2]; Widget child; XmMenuSavvyTrait menuSavvy; menuSavvy = (XmMenuSavvyTrait) XmeTraitGet((XtPointer) XtClass(w), XmQTmenuSavvy); if (menuSavvy != NULL) { if (mode == XmADD) { char *accelerator = NULL; KeySym mnemonic = XK_VoidSymbol; if (menuSavvy -> getAccelerator != NULL) accelerator = menuSavvy -> getAccelerator(w); if (menuSavvy -> getMnemonic != NULL) mnemonic = menuSavvy -> getMnemonic(w); /* These can have both an accelerator and a mnemonic */ if (mnemonic != XK_VoidSymbol && mnemonic != (KeySym) NULL) /* CR 5255 */ { if ((XmIsCascadeButton(w) || XmIsCascadeButtonGadget(w)) && XmIsRowColumn(XtParent(w)) && IsBar(XtParent(w))) { /* Add Alt-mnemonic for cascade buttons in menu bars only */ _AddToKeyboardList (w, KeyRelease, mnemonic, Mod1Mask, True, False); } _AddToKeyboardList (w, KeyRelease, mnemonic, 0, False, True); } if (accelerator && (strlen(accelerator) > 0)) { AddToKeyboardList(w, accelerator, True, False); } } else RemoveFromKeyboardList(w); } else if (XmIsRowColumn(w)) { XmRowColumnWidget m = (XmRowColumnWidget) w; if (IsPopup(m) || IsBar(m)) { /* * Popup Menus and the menubar may have an accelerator associated * with them */ if (mode == XmADD) { if (RC_MenuAccelerator(m) && (strlen(RC_MenuAccelerator(m)) > 0)) { AddToKeyboardList(w, RC_MenuAccelerator(m), True, False); } } else RemoveFromKeyboardList(w); } else if (IsOption(m)) { child = XmOptionLabelGadget( (Widget) m); /* Option menus may have a mnemonics associated with them */ if (mode == XmADD) { if (RC_Mnemonic(m) != XK_VoidSymbol) { _AddToKeyboardList (w, KeyRelease, RC_Mnemonic(m), Mod1Mask, True, True); if (child) { XtSetArg(args[0], XmNmnemonic, RC_Mnemonic(m)); XtSetValues(child, args, 1); } } } else { RemoveFromKeyboardList(w); /* Tell the label gadget */ if (child && !child->core.being_destroyed) { XtSetArg(args[0], XmNmnemonic, '\0'); XtSetValues(child, args, 1); } } } } } /* * This function actually does the work of converting the accelerator * or mnemonic string into a workable format, and registering the keyboard * grab, if possible. */ static void AddToKeyboardList( Widget w, char *kbdEventStr, #if NeedWidePrototypes int needGrab, int isMnemonic ) #else Boolean needGrab, Boolean isMnemonic ) #endif /* NeedWidePrototypes */ { int *eventTypes; KeySym *keysyms; unsigned int *modifiers; int num_keys = 0; int count, i; XmKeyBinding keys; if (kbdEventStr == NULL) return; count = _XmMapKeyEvents(kbdEventStr, &eventTypes, &keysyms, &modifiers); for (i = 0; i < count; i++) { /* If it is a virtual key, get the physical keys and modifiers */ num_keys = XmeVirtualToActualKeysyms(XtDisplay(w), keysyms[i], &keys); while (--num_keys >= 0) if (keys[num_keys].keysym != NoSymbol) { /* Grab any modifiers in the virtual key binding too. */ _AddToKeyboardList(w, eventTypes[i], keys[num_keys].keysym, modifiers[i] | keys[num_keys].modifiers, needGrab, isMnemonic); keysyms[i] = NoSymbol; } XtFree((char*) keys); /* If not a virtual key process normally. */ if (keysyms[i] != NoSymbol) _AddToKeyboardList (w, eventTypes[i], keysyms[i], modifiers[i], needGrab, isMnemonic); } XtFree((char *) eventTypes); XtFree((char *) keysyms); XtFree((char *) modifiers); } /* * This is a lower level interface to AddToKeyboardList which avoids the * overhead of passing in a string. */ static void _AddToKeyboardList( Widget w, unsigned int eventType, KeySym keysym, unsigned int modifiers, #if NeedWidePrototypes int needGrab, int isMnemonic ) #else Boolean needGrab, Boolean isMnemonic ) #endif /* NeedWidePrototypes */ { KeyCode keycode = 1; /* Keycodes lie in the range 8 - 255 */ int i; /* * if needGrab is FALSE, delay the call to XKeysymToKeycode until the * first time the value of the keycode is needed. */ if (needGrab) { /* Convert keysym to keycode; needed by X grab call */ if ((keycode = XKeysymToKeycode(XtDisplay(w), keysym)) == 0) { XmeWarning( (Widget)w, BadMnemonicCharMsg); return; } } if( !isMnemonic ) { AddKeycodeToKeyboardList(w, eventType, keycode, keysym, modifiers, needGrab, isMnemonic); } else { Display *display = XtDisplay(w); KeySym *ks_tbl; KeyCode min_kc_rtn; int syms_per; int min_kc, max_kc, num_kc, num_ks; KeySym uc, lc; XDisplayKeycodes(display, &min_kc, &max_kc); num_kc = (max_kc - min_kc) + 1; ks_tbl = XtGetKeysymTable(display, &min_kc_rtn, &syms_per); num_ks = num_kc * syms_per; for (i = 0; i < num_ks; i+=syms_per) { XtConvertCase( display, ks_tbl[i], &lc, &uc) ; if ((ks_tbl[i+1] == NoSymbol) || (ks_tbl[i+1] == uc)) { if (keysym == lc || keysym == uc) AddKeycodeToKeyboardList(w, eventType, (KeyCode)(min_kc_rtn+(i/syms_per)), keysym, modifiers, needGrab, isMnemonic); } else { if (keysym == ks_tbl[i]) AddKeycodeToKeyboardList(w, eventType, (KeyCode)(min_kc_rtn+(i/syms_per)), keysym, modifiers, needGrab, isMnemonic); } } } } /* * This is a lower level interface to AddToKeyboardList which avoids the * overhead of passing in a string. */ static void AddKeycodeToKeyboardList( Widget w, unsigned int eventType, KeyCode keycode, KeySym keysym, unsigned int modifiers, Boolean needGrab, Boolean isMnemonic ) { Widget rowcol; XmKeyboardData * list; int i; if (XmIsRowColumn(w)) rowcol = w; else rowcol = XtParent(w); /* Add to the list of keyboard entries */ if (MGR_NumKeyboardEntries(rowcol) >= MGR_SizeKeyboardList(rowcol)) { /* Grow list */ MGR_SizeKeyboardList(rowcol) += 10; MGR_KeyboardList(rowcol) = (XmKeyboardData *)XtRealloc( (char *) MGR_KeyboardList(rowcol), (MGR_SizeKeyboardList(rowcol) * sizeof(XmKeyboardData))); } list = MGR_KeyboardList(rowcol); i = MGR_NumKeyboardEntries(rowcol); list[i].eventType = eventType; list[i].keysym = keysym; list[i].key = keycode; list[i].modifiers = isMnemonic ? (modifiers & ~(ShiftMask | LockMask)) : modifiers; list[i].component = w; list[i].needGrab = needGrab; list[i].isMnemonic = isMnemonic; MGR_NumKeyboardEntries(rowcol)++; if (needGrab) { GrabKeyOnAssocWidgets ((XmRowColumnWidget) rowcol, keycode, modifiers); } } /* * This function removes all keyboard entries associated with a particular * component within a row column widget. * If the component is a push or toggle button, the keyboard_list entry * must be removed so that CheckKey() doesn't catch the old key events * if this is a replacement! If the menu-item has a grab installed, * then we can only ungrab if the parent pane is not shared. The same * applies for (shareable) Popups. Menubar and Option accelerators aren't * shared and can always be ungrabbed. */ static void RemoveFromKeyboardList( Widget w ) { XmRowColumnWidget rowcol; XmKeyboardData * klist; int count; int i, j; Boolean notInSharedMenupaneHierarchy; if (XmIsRowColumn(w)) rowcol = (XmRowColumnWidget)w; else rowcol = (XmRowColumnWidget)XtParent(w); if (IsWorkArea(rowcol)) return; notInSharedMenupaneHierarchy = !InSharedMenupaneHierarchy(rowcol); klist = MGR_KeyboardList(rowcol); count = MGR_NumKeyboardEntries(rowcol); for (i = 0; i < count; ) { if (klist[i].component == w) { /* NOTE that the ungrabs on shared menupane associate widgets are not * done and thus causes extra event deliveries and possible memory * leaks. The problem is that it is difficult to tell whether an * item should really be ungrabbed since the sharing of menupanes * could mean that this item exists somewhere else on this hierarchy. */ if (klist[i].needGrab && (w->core.being_destroyed || notInSharedMenupaneHierarchy)) { Boolean another = False; int k; /* CR 7259, don't ungrab if another entry requires the grab on the same key/modifier */ for(k = 0; k < count; k++) { if (k != i && klist[k].needGrab && klist[k].key == klist[i].key && klist[k].modifiers == klist[i].modifiers) { another = True; break; } } if (! another) UngrabKeyOnAssocWidgets(rowcol, klist[i].key, klist[i].modifiers); } /* Move the rest of the entries up 1 slot */ for (j = i; j < count -1; j++) klist[j] = klist[j+1]; MGR_NumKeyboardEntries(rowcol) = MGR_NumKeyboardEntries(rowcol)-1; count--; } else i++; } } /* * search the postFromList and return the index of the found widget. If it * is not found, return -1 */ static int OnPostFromList( XmRowColumnWidget menu, Widget widget ) { int i; for (i = 0; i < menu->row_column.postFromCount; i++) { if (menu->row_column.postFromList[i] == widget) return (i); } return (-1); } /* * Useful for MenuBars and Option Menus to determine where to set up the * event handlers and grabs. */ void _XmRCGetTopManager( Widget w, Widget *topManager ) { while (XmIsManager(XtParent(w))) w = XtParent(w); * topManager = w; } /* * Returns the toplevel menu widget in an acive menu hierarchy. * * This function is only useful when the menu system is active. That is * the only time that the CascadeBtn field in the RowColumn in guaranteed * to be valid. */ void _XmGetActiveTopLevelMenu( Widget wid, Widget *rwid ) { XmRowColumnWidget w = (XmRowColumnWidget) wid ; XmRowColumnWidget *topLevel = (XmRowColumnWidget *) rwid ; /* * find toplevel by following up the chain. Popups use CascadeBtn to * keep the active widget in the postFromList. Stop at tear off! */ while (RC_CascadeBtn(w) && (!IsPopup(w)) && XmIsMenuShell(XtParent(w))) w = (XmRowColumnWidget) XtParent(RC_CascadeBtn(w)); * topLevel = w; } #ifdef FIX_345 static void GrabKeyWithLockMask ( Widget widget, KeyCode keycode, Modifiers modifiers, Boolean owner_events, int pointer_mode, int keyboard_mode ) { /* Make sure the modifiers mask is known */ _XmCheckInitModifiers(); /* And grab all the key with all combinations of modifiers */ XtGrabKey(widget, keycode, modifiers, owner_events, pointer_mode, keyboard_mode ); XtGrabKey(widget, keycode, modifiers|LockMask, owner_events, pointer_mode, keyboard_mode ); XtGrabKey(widget, keycode, modifiers|ScrollLockMask, owner_events, pointer_mode, keyboard_mode ); XtGrabKey(widget, keycode, modifiers|NumLockMask, owner_events, pointer_mode, keyboard_mode ); XtGrabKey(widget, keycode, modifiers|LockMask|ScrollLockMask, owner_events, pointer_mode, keyboard_mode ); XtGrabKey(widget, keycode, modifiers|LockMask|NumLockMask, owner_events, pointer_mode, keyboard_mode ); XtGrabKey(widget, keycode, modifiers|ScrollLockMask|NumLockMask, owner_events, pointer_mode, keyboard_mode ); XtGrabKey(widget, keycode, modifiers|LockMask|ScrollLockMask|NumLockMask, owner_events, pointer_mode, keyboard_mode ); } static void UngrabKeyWithLockMask ( Widget widget, KeyCode keycode, Modifiers modifiers) { /* Make sure the modifiers are known */ _XmCheckInitModifiers(); /* And ungrab all combinations of known modifiers */ XtUngrabKey(widget, keycode, modifiers); XtUngrabKey(widget, keycode, modifiers|LockMask); XtUngrabKey(widget, keycode, modifiers|ScrollLockMask); XtUngrabKey(widget, keycode, modifiers|NumLockMask); XtUngrabKey(widget, keycode, modifiers|LockMask|ScrollLockMask); XtUngrabKey(widget, keycode, modifiers|LockMask|NumLockMask); XtUngrabKey(widget, keycode, modifiers|ScrollLockMask|NumLockMask); XtUngrabKey(widget, keycode, modifiers|LockMask|ScrollLockMask|NumLockMask); } #endif /* * set up the grabs on the appropriate assoc widgets. For a popup, this * is all of the widgets on the postFromList. For a menubar and option * menu, this is the top manager widget in their hierarchy. For a * pulldown, the assoc widgets can only be determined by following the * chain up the postFromList. */ static void GrabKeyOnAssocWidgets( XmRowColumnWidget rowcol, #if NeedWidePrototypes int detail, #else KeyCode detail, #endif /* NeedWidePrototypes */ unsigned int modifiers ) { Widget topManager; int i; if (IsPopup(rowcol)) { for (i=0; i < rowcol->row_column.postFromCount; i++) #ifdef FIX_345 GrabKeyWithLockMask (rowcol->row_column.postFromList[i], detail, modifiers, False, GrabModeAsync, GrabModeAsync); #else XtGrabKey(rowcol->row_column.postFromList[i], detail, modifiers, False, GrabModeAsync, GrabModeAsync); #endif } else if (IsBar(rowcol) || IsOption(rowcol)) { _XmRCGetTopManager ((Widget) rowcol, &topManager); #ifdef FIX_345 GrabKeyWithLockMask (topManager, detail, modifiers, False, GrabModeAsync, GrabModeAsync); #else XtGrabKey(topManager, detail, modifiers, False, GrabModeAsync, GrabModeAsync); #endif } else if (IsPulldown(rowcol)) { for (i=0; irow_column.postFromCount; i++) GrabKeyOnAssocWidgets ((XmRowColumnWidget) XtParent(rowcol->row_column.postFromList[i]), detail, modifiers); } } /* */ static void UngrabKeyOnAssocWidgets( XmRowColumnWidget rowcol, #if NeedWidePrototypes int detail, #else KeyCode detail, #endif /* NeedWidePrototypes */ unsigned int modifiers ) { Widget assocWidget; int i; if (IsPopup(rowcol)) { for (i=0; i < rowcol->row_column.postFromCount; i++) { assocWidget = rowcol->row_column.postFromList[i]; if (!assocWidget->core.being_destroyed) #ifdef FIX_345 UngrabKeyWithLockMask (assocWidget, detail, modifiers); #else XtUngrabKey(assocWidget, detail, modifiers); #endif } } else if (IsBar(rowcol) || IsOption(rowcol)) { _XmRCGetTopManager ((Widget) rowcol, &assocWidget); if (!assocWidget->core.being_destroyed) #ifdef FIX_345 UngrabKeyWithLockMask (assocWidget, detail, modifiers); #else XtUngrabKey(assocWidget, detail, modifiers); #endif } else if (IsPulldown(rowcol)) { for (i=0; irow_column.postFromCount; i++) UngrabKeyOnAssocWidgets ((XmRowColumnWidget) XtParent(rowcol->row_column.postFromList[i]), detail, modifiers); } } void _XmRC_AddToPostFromList( XmRowColumnWidget m, Widget widget ) { if (m->row_column.postFromListSize == m->row_column.postFromCount) { /* increase the size to fit the new one and one more */ m->row_column.postFromListSize += 2; m->row_column.postFromList = (Widget *) XtRealloc ( (char *) m->row_column.postFromList, m->row_column.postFromListSize * sizeof(Widget)); } m->row_column.postFromList[m->row_column.postFromCount++] = widget; /* If the popup's attach widget mysteriously is destroyed, remove the * attach widget from the popup's postFromList. (Note the cascade * button already does this from its Destroy method). */ if (IsPopup(m)) XtAddCallback(widget, XtNdestroyCallback, (XtCallbackProc)_XmRC_RemoveFromPostFromListOnDestroyCB, (XtPointer)m); } /*ARGSUSED*/ void _XmRC_RemoveFromPostFromListOnDestroyCB ( Widget w, caddr_t clientData, caddr_t callData ) /* unused */ { /* The attach_widget has been destroyed. Remove it from the Popup's * postFromList. */ _XmRC_RemoveFromPostFromList((XmRowColumnWidget)clientData, w); } void _XmRC_RemoveFromPostFromList( XmRowColumnWidget m, Widget widget ) { int i; Boolean found = False; for (i=0; i < m->row_column.postFromCount; i++) { if (!found) { if (widget == m->row_column.postFromList[i]) { /* remove this entry */ found = True; } } else m->row_column.postFromList[i-1] = m->row_column.postFromList[i]; } if (found) { m->row_column.postFromCount--; if (IsPopup(m)) XtRemoveCallback(widget, XtNdestroyCallback, (XtCallbackProc)_XmRC_RemoveFromPostFromListOnDestroyCB, (XtPointer)m); } } static Boolean InSharedMenupaneHierarchy( XmRowColumnWidget m) { while (m && XmIsRowColumn(m) && (IsPulldown(m) || IsPopup(m))) { if (m->row_column.postFromCount == 1) m = (XmRowColumnWidget)XtParent(m->row_column.postFromList[0]); else return(True); } return(False); } /* helper function for SetCascadeField; take down the tear-off menu [possibly ** shared], on the grounds that the application wishes the menu to be removed, ** which we deduce from the disconnection made */ static void DismissTearOffSubMenu (XmRowColumnWidget menu) { int i; if ( (menu == NULL) || !XmIsRowColumn(menu) || !IsPulldown(menu) || (menu->core.being_destroyed) ) return; for (i = 0; i < menu->composite.num_children; i++) { Widget child = menu->composite.children[i]; if (XmIsCascadeButtonGadget(child)) { if ( CBG_Submenu(child) ) DismissTearOffSubMenu((XmRowColumnWidget) CBG_Submenu(child)); } else if (XmIsCascadeButton(child)) { if ( CB_Submenu(child) ) DismissTearOffSubMenu((XmRowColumnWidget) CB_Submenu(child)); } } if (RC_TornOff(menu) && RC_TearOffActive(menu)) _XmDismissTearOff(XtParent(menu), NULL, NULL); } /* * This is a class function exported by the RowColumn widget. It is used * by the CascadeButton widget to signal that a menupane has either been * attached to a cascade button widget, or detached from a cascade button * widget. */ static void SetCascadeField( XmRowColumnWidget m, Widget cascadeBtn, #if NeedWidePrototypes int attach ) #else Boolean attach ) #endif /* NeedWidePrototypes */ { int mode; if (attach) { mode = XmADD; /* if being attached to an option menu, set the option menus submenu */ if (RC_Type(XtParent(cascadeBtn)) == XmMENU_OPTION) RC_OptionSubMenu(XtParent(cascadeBtn)) = (Widget) m; if (XmIsMenuShell(XtParent(m))) { XtX(XtParent(m)) = XtY(XtParent(m)) = 0; } if (m->row_column.postFromCount && (RC_TearOffModel(m) == XmTEAR_OFF_ENABLED)) XmeWarning( (Widget)m, TearOffSharedMenupaneMsg); if (OnPostFromList (m, cascadeBtn) != -1) /* already in the list, this means no work to do */ return; _XmRC_AddToPostFromList (m, cascadeBtn); } else { Boolean wasShared = InSharedMenupaneHierarchy(m); mode = XmDELETE; DismissTearOffSubMenu(m); _XmRC_RemoveFromPostFromList (m, cascadeBtn); /* if being removed from an option menu, set the option menus submenu */ if (RC_Type(XtParent(cascadeBtn)) == XmMENU_OPTION) RC_OptionSubMenu(XtParent(cascadeBtn)) = (Widget) NULL; /* CR 5550 fix begin */ if ( ( m != NULL ) && ( RC_CascadeBtn(m) == (Widget)cascadeBtn ) ) { RC_CascadeBtn(m) = (Widget) NULL; } /* CR 5550 fix end */ /* if we're in a shared menupane hierarchy, don't process (delete) the * accelerators and mnemonics! */ if (wasShared) return; } /* process the accelerators and mnemonics */ _XmRC_DoProcessMenuTree( (Widget) m, mode); } /* * _XmMatchBSelectEvent() is intended to be used to check if the event is * a valid BSelect. It will only validate the event if the menu hierarchy * is posted (so BSelect doesn't override whichButton to post a menu). */ Boolean _XmMatchBSelectEvent( Widget wid, XEvent *event ) { XmRowColumnWidget rc; /* First make sure the menu hierarchy is posted */ /* But if it's torn off then don't worry about posted */ if (XmIsMenuShell(XtParent(wid))) { _XmGetActiveTopLevelMenu(wid, (Widget *)&rc); if ( (IsPopup(rc) && !((XmMenuShellWidget)XtParent(rc))->shell.popped_up) || (!IsPopup(rc) && !RC_PopupPosted(rc)) ) return(False); } rc = (XmRowColumnWidget)wid; if ( !event ) return (False); if ( !_XmMatchBtnEvent( event, XmIGNORE_EVENTTYPE, /*BSelect.button, BSelect.modifiers*/ Button1, AnyModifier )) return(False); return(True); } Boolean _XmMatchBDragEvent( Widget wid, XEvent *event ) { XmRowColumnWidget rc; /* First make sure the menu hierarchy is posted */ /* But if it's torn off then don't worry about posted */ if (XmIsMenuShell(XtParent(wid))) { _XmGetActiveTopLevelMenu(wid, (Widget *)&rc); if ( (IsPopup(rc) && !((XmMenuShellWidget)XtParent(rc))->shell.popped_up) || (!IsPopup(rc) && !RC_PopupPosted(rc)) ) return(False); } rc = (XmRowColumnWidget)wid; if ( !event ) return (False); if ( !_XmMatchBtnEvent( event, XmIGNORE_EVENTTYPE, /*BDrag.button, BDrag.modifiers*/ Button2, 0 )) return(False); return(True); } static void BtnDownInRowColumn( Widget rc, XEvent *event, #if NeedWidePrototypes int x_root, int y_root) #else Position x_root, Position y_root ) #endif /* NeedWidePrototypes */ { XmGadget gadget; Position relativeX = event->xbutton.x_root - x_root; Position relativeY = event->xbutton.y_root - y_root; _XmSetMenuTraversal (rc, False); if ((gadget = (XmGadget) XmObjectAtPoint( rc, relativeX, relativeY)) != NULL) { /* event occured in a gadget w/i the rowcol */ _XmDispatchGadgetInput( (Widget) gadget, event, XmARM_EVENT); } else if (!XmIsMenuShell(XtParent(rc))) { TearOffArm((Widget)rc); } /* For style guide conformance and consistency with Popup's and pulldown- * buttons, popdown cascading submenus below this point on button press * where individual buttons wouldn't be taking care of this. */ if ((!gadget || !XtIsSensitive((Widget)gadget) || !(XmIsCascadeButtonGadget(gadget))) && /* !cbg kludge */ (RC_PopupPosted(rc))) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))(RC_PopupPosted(rc),NULL, NULL, NULL); } /* BtnDown in the menu(bar) but outside of any cascade button or cascade * gadget must install grabs so events continue to be processed by the * menubar and are not erroneously passed to other widgets. */ if (IsBar(rc) && !RC_IsArmed(rc) && !gadget) { Time _time = _XmGetDefaultTime(rc, event); Widget top_shell; /* Don't post the menu if the menu cannot control grabs! */ if (_XmMenuGrabKeyboardAndPointer(rc, _time) != GrabSuccess) { _XmRecordEvent (event); return; } _XmMenuFocus((Widget) rc, XmMENU_BEGIN, _time); /* This nasty section of code is mostly to handle focus and highlighting. * The call to MenuArm() calls XmProcessTraversal() to move the focus to * the menubar. We don't want the first cascade button to highlight. So, * the menubar manage flag is turned off to circumvent the call to * XmProcessTraversal. (This might be better served by sending in a flag * to MenuArm() that avoids the call completely - hint, hint). Then we * do some focus hocus pocus to turn off focus so that the current focus * item becomes unhighlighted and NOT move the focus/highlight to the * menubar yet (See Traversal.c _XmMgrTraversal() for precedence). The * next cascade button enter event will take care of that. */ rc->core.managed = False; MenuArm((Widget) rc); rc->core.managed = True; top_shell = _XmFindTopMostShell(rc); _XmSetFocusFlag( top_shell, XmFOCUS_RESET, TRUE) ; XtSetKeyboardFocus( top_shell, None) ; _XmSetFocusFlag( top_shell, XmFOCUS_RESET, FALSE) ; _XmSetInDragMode((Widget) rc, True); RC_SetBeingArmed(rc, False); } _XmRecordEvent(event); XAllowEvents(XtDisplay(rc), SyncPointer, CurrentTime); } static void CheckUnpostAndReplay( Widget rc, XEvent *event ) { XmMenuState mst = _XmGetMenuState((Widget)rc); if (_XmGetUnpostBehavior(rc) == XmUNPOST_AND_REPLAY) { _XmGetActiveTopLevelMenu(rc, &mst->RC_ReplayInfo.toplevel_menu); mst->RC_ReplayInfo.time = event->xbutton.time; /* do this before popdown since ptr is ungrabed there */ XAllowEvents(XtDisplay(rc), ReplayPointer, CurrentTime); _XmMenuPopDown(rc, event, NULL); } else { _XmSetMenuTraversal (rc, False); _XmRecordEvent(event); XAllowEvents(XtDisplay(rc), SyncPointer, CurrentTime); } } void _XmHandleMenuButtonPress( Widget wid, XEvent *event ) { Position x_root, y_root; XtTranslateCoords (wid, 0, 0, &x_root, &y_root); if ((event->xbutton.x_root >= x_root) && (event->xbutton.x_root < x_root + wid->core.width) && (event->xbutton.y_root >= y_root) && (event->xbutton.y_root < y_root + wid->core.height)) { /* happened in this rowcolumn */ BtnDownInRowColumn (wid, event, x_root, y_root); } else if (RC_PopupPosted(wid)) { /* follow down menu heierarchy */ _XmHandleMenuButtonPress (((CompositeWidget) RC_PopupPosted(wid))-> composite.children[0], event); } else { /* nothing else posted */ CheckUnpostAndReplay (wid, event); return; } } /* * Button Action Procs */ /*ARGSUSED*/ void _XmMenuBtnDown( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; Position x_root, y_root; Widget topLevel; XmMenuState mst = _XmGetMenuState((Widget)wid); Time _time = _XmGetDefaultTime((Widget) wid, event); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(wid), XmQTmenuSystem); if (!_XmIsEventUnique(event)) return; /* This code no longer checks the button for a match. Any button outside the RowColumn will take down the menu */ /* Overload _XmButtonEventStatus's time for MenuShell's * managed_set_changed routine to determine if an option menu is * trying to post using BSelect Click. _XmButtonEventStatus's * verified is irrelevant. */ if (IsOption(rc)) { mst->RC_ButtonEventStatus.time = event->xbutton.time; } XtTranslateCoords ((Widget) rc, 0, 0, &x_root, &y_root); if (menuSTrait -> verifyButton((Widget) rc, event) && (event->xbutton.x_root >= x_root) && (event->xbutton.x_root < x_root + rc->core.width) && (event->xbutton.y_root >= y_root) && (event->xbutton.y_root < y_root + rc->core.height)) { if (!XmIsMenuShell(XtParent(rc)) && RC_Type(rc) != XmMENU_BAR && RC_Type(rc) != XmMENU_OPTION) XChangeActivePointerGrab(XtDisplay(rc), ((unsigned int) (ButtonReleaseMask | PointerMotionMask | PointerMotionHintMask | EnterWindowMask | LeaveWindowMask)), _XmGetMenuCursorByScreen(XtScreen(rc)), _time); /* happened in this rowcolumn */ BtnDownInRowColumn ((Widget) rc, event, x_root, y_root); } else { _XmGetActiveTopLevelMenu( (Widget) rc, &topLevel ); if ((Widget) rc == topLevel) { /* already looked in the toplevel, move to a pulldown */ if (RC_PopupPosted(rc)) { topLevel = ((CompositeWidget) RC_PopupPosted(rc))-> composite.children[0]; } else { /* nothing else posted */ CheckUnpostAndReplay ((Widget) rc, event); return; } } /* travel down menu to see if in another menu widget */ _XmHandleMenuButtonPress (topLevel, event); } } /*ARGSUSED*/ void _XmMenuBtnUp( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmRowColumnWidget w = (XmRowColumnWidget) wid ; XmGadget gadget; Time _time = _XmGetDefaultTime(wid, event); XmMenuSystemTrait menuSTrait; Boolean nonButton; /* that is, make a good guess about whether the widget ** or gadget under the mouse-button release will do ** anything itself to pop the menu down and to restore ** the cursor to its correct shape -- buttons do, other ** widgets we don't know about, but assume that labels ** and separators are the most likely candidates */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(wid), XmQTmenuSystem); /* Support menu replay, free server input queue until next button event */ XAllowEvents(XtDisplay(w), SyncPointer, CurrentTime); if (! _XmIsEventUnique(event) || ! menuSTrait -> verifyButton(wid, event) || (IsBar(w) && ! RC_IsArmed(w))) return; if (w->core.window == event->xbutton.window) gadget = (XmGadget) XmObjectAtPoint( (Widget) w, event->xbutton.x, event->xbutton.y); else gadget = NULL; nonButton = ((IsPulldown(w) || IsPopup(w)) && !XmIsMenuShell(XtParent(w)) && (!gadget || (XtClass(gadget) == xmLabelGadgetClass) || (XtClass(gadget) == xmSeparatorGadgetClass))); if ((gadget != NULL) && XtIsSensitive((Widget)gadget)) { _XmDispatchGadgetInput( (Widget) gadget, event, XmACTIVATE_EVENT); if (nonButton) _XmMenuPopDown( (Widget) w, event, NULL ); } else if (IsBar(w) || _XmIsTearOffShellDescendant((Widget)w)) { /* Only drop in here when no other widget took the event */ _XmMenuPopDown((Widget) w, event, NULL); if (IsBar(w)) /* Only necessary for truth and beauty */ MenuBarCleanup(w); MenuDisarm((Widget) w); _XmMenuFocus( (Widget) w, XmMENU_END, _time); XtUngrabPointer( (Widget) w, _time); } _XmSetInDragMode((Widget) w, False); /* In a tear off, if the button up occured over a label or separator or * not in a button child, unhighlight it and reset the focus to the first * qualified item. */ if (nonButton) { if (w->manager.active_child && XmIsGadget(w->manager.active_child)) { if ( ((XmGadgetClass) XtClass(w->manager.active_child))->gadget_class.border_unhighlight) (*(((XmGadgetClass) XtClass(w->manager.active_child))->gadget_class.border_unhighlight)) (w->manager.active_child); } _XmClearFocusPath((Widget)w); XmProcessTraversal((Widget)w, XmTRAVERSE_CURRENT); } } /****************************************************************** * _XmMenuGadgetDrag encapsulates ManagerGadgetDrag and * makes sure that the queue is unblocked and the menu is unposted * on btn2 events when the menu system is active. If the menu * system is active, then it unposts the menu before continuing. ******************************************************************/ void _XmMenuGadgetDrag(Widget wid, XEvent *event, String *params, Cardinal *num_params) { /* We need to make sure and ignore the replay if we are unposting the menu. This can have bad timing effects in the drag & drop code */ if (! _XmIsEventUnique(event)) return; /* If the menu is up then we take it down, otherwise we start a drag */ if (RC_IsArmed(wid)) { _XmMenuBtnDown( wid, event, params, num_params ); } else { _XmRecordEvent(event); /* Call Manager action routine */ _XmGadgetDrag( wid, event, params, num_params ); } } void _XmRC_UpdateOptionMenuCBG( Widget cbg, Widget memWidget ) { XmString xmstr = NULL; Pixmap pix, ipix; Arg al[5]; int ac = 0; /* If one of these is NULL then something is wrong. */ if (cbg == (Widget) NULL || memWidget == (Widget) NULL) return; if (XmIsLabelGadget(memWidget)) { XmLabelGadget lg = (XmLabelGadget) memWidget; if (LabG_IsText (lg)) { XtSetArg (al[ac], XmNlabelType, XmSTRING); ac++; xmstr = XmStringCopy(LabG__label(lg)); XtSetArg (al[ac], XmNlabelString, xmstr); ac++; if (LabG_Font(lg) != LabG_Font(cbg)) { XtSetArg (al[ac], XmNfontList, LabG_Font(lg)); ac++; } } else if (LabG_IsPixmap (lg)) { XtSetArg (al[ac], XmNlabelType, XmPIXMAP); ac++; pix = LabG_Pixmap(lg); XtSetArg (al[ac], XmNlabelPixmap, pix); ac++; ipix = LabG_PixmapInsensitive(lg); XtSetArg (al[ac], XmNlabelInsensitivePixmap, ipix); ac++; } else { XtSetArg (al[ac], XmNlabelType, XmPIXMAP_AND_STRING); ac++; xmstr = XmStringCopy(LabG__label(lg)); XtSetArg (al[ac], XmNlabelString, xmstr); ac++; if (LabG_Font(lg) != LabG_Font(cbg)) { XtSetArg (al[ac], XmNfontList, LabG_Font(lg)); ac++; } pix = LabG_Pixmap(lg); XtSetArg (al[ac], XmNlabelPixmap, pix); ac++; ipix = LabG_PixmapInsensitive(lg); XtSetArg (al[ac], XmNlabelInsensitivePixmap, ipix); ac++; } XtSetValues (cbg, al, ac); } else if (XmIsLabel(memWidget)) { XmLabelWidget lw = (XmLabelWidget) memWidget; if (Lab_IsText (lw)) { XtSetArg (al[ac], XmNlabelType, XmSTRING); ac++; xmstr = XmStringCopy(lw->label._label); XtSetArg (al[ac], XmNlabelString, xmstr); ac++; if (lw->label.font != LabG_Font(cbg)) { XtSetArg (al[ac], XmNfontList, lw->label.font); ac++; } } else if (Lab_IsPixmap (lw)) { XtSetArg (al[ac], XmNlabelType, XmPIXMAP); ac++; pix = lw->label.pixmap; XtSetArg (al[ac], XmNlabelPixmap, pix); ac++; ipix = lw->label.pixmap_insen; XtSetArg (al[ac], XmNlabelInsensitivePixmap, ipix); ac++; } else { XtSetArg (al[ac], XmNlabelType, XmPIXMAP_AND_STRING); ac++; xmstr = XmStringCopy(lw->label._label); XtSetArg (al[ac], XmNlabelString, xmstr); ac++; if (lw->label.font != LabG_Font(cbg)) { XtSetArg (al[ac], XmNfontList, lw->label.font); ac++; } pix = lw->label.pixmap; XtSetArg (al[ac], XmNlabelPixmap, pix); ac++; ipix = lw->label.pixmap_insen; XtSetArg (al[ac], XmNlabelInsensitivePixmap, ipix); ac++; } XtSetValues (cbg, al, ac); } if (xmstr) XmStringFree(xmstr); } /* * At one time this code was tossed out, but it's is once again needed to * disregard a focus out event to a cascade in a torn menupane when focus is * moved to its newly posted submenu. */ static Boolean ShouldDispatchFocusOut( Widget widget ) { /* skip focus out for CBs in Torn off panes with cascading submenus * unless the cascaded submenu is another torn off */ if (XmIsCascadeButton(widget) && RC_Type(XtParent(widget)) != XmMENU_BAR && !XmIsMenuShell(XtParent(XtParent(widget))) && CB_Submenu(widget) && ((XmMenuShellWidget) XtParent(CB_Submenu(widget)))->shell.popped_up && XmIsMenuShell(XtParent(CB_Submenu(widget)))) { return (False); } return (True); } /* ARGSUSED */ void _XmMenuBarGadgetSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid ; Widget child; /* Only dispatch the event to the cascade gadget when the menubar is * armed (which infers in explicit mode for menubars - see MenuArm()) */ if (RC_IsArmed(rc)/* && _XmGetFocusPolicy( (Widget) mw) == XmEXPLICIT*/) { child = rc->manager.active_child ; if(child && XmIsGadget(child) && XtIsSensitive(child)) _XmDispatchGadgetInput(child, event, XmACTIVATE_EVENT); } } /* ARGSUSED */ void _XmMenuGadgetTraverseCurrent( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { Widget child ; if (!_XmIsEventUnique(event)) return; child = (Widget) _XmInputForGadget(wid, event->xbutton.x, event->xbutton.y); if (child == NULL) /* * Button press happened outside of any gadgets. Call * the normal BtnDown action so menu panes can be popped * down if necessary. */ XtCallActionProc(wid, "MenuBtnDown", event, params, *num_params); else { XmProcessTraversal(child, XmTRAVERSE_CURRENT) ; XAllowEvents(XtDisplay(wid), SyncPointer, CurrentTime); _XmRecordEvent(event); } } /* ARGSUSED */ void _XmMenuGadgetTraverseCurrentUp( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { Widget child ; if (!_XmIsEventUnique(event)) return; child = (Widget) _XmInputForGadget(wid, event->xbutton.x, event->xbutton.y); if (child == NULL) /* * Button release happened outside of any gadgets. Call * the normal BtnUp action so menu panes can be popped * down if necessary. */ XtCallActionProc(wid, "MenuBtnUp", event, params, *num_params); else { XAllowEvents(XtDisplay(wid), SyncPointer, CurrentTime); _XmRecordEvent(event); } } static int MenuStatus( Widget wid ) { XmRowColumnWidget rc = (XmRowColumnWidget) wid; int menu_status = 0; /* We'll steal the RC_SetBit macro - it should still work for ints as well * as bytes. */ RC_SetBit(menu_status, XmMENU_TORN_BIT, RC_TornOff(rc)); RC_SetBit(menu_status, XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT, _XmIsTearOffShellDescendant((Widget)rc)); RC_SetBit(menu_status, XmMENU_POPUP_POSTED_BIT, RC_PopupPosted(rc)); RC_SetBit(menu_status, XmMENU_IN_DRAG_MODE_BIT, _XmGetInDragMode(wid)); return(menu_status); } /* Return menu type from type field */ static int MenuType( Widget wid ) { return(RC_Type(wid)); } /* * position the row column widget where it wants to be; normally, this * is used only for popup or pulldown menupanes. */ static void PositionMenu( register XmRowColumnWidget m, XButtonPressedEvent *event ) { XmRowColumnWidget root; XmCascadeButtonWidget p; if (m == NULL) return; switch (m->row_column.type) { case XmMENU_OPTION: case XmMENU_BAR: case XmWORK_AREA: break; /* * remaining cases take advantage of the fact that positioning of * a popup shells' only child is not normal. Just change the widget * itself, when popped up the shell will put itself at this location * and move the child to 0,0. Saves a bunch of thrashing about. */ case XmMENU_POPUP: /* position near mouse */ if (LayoutIsRtoLM(m)) XtX (m) = event->x_root - XtWidth (m); else XtX (m) = event->x_root; XtY (m) = event->y_root; RC_SetWidgetMoved (m, TRUE); break; case XmMENU_PULLDOWN: p = (XmCascadeButtonWidget) m->row_column.cascadeBtn; if (p != NULL) root = (XmRowColumnWidget) XtParent (p); else return; if (! XmIsRowColumn(root)) root = NULL; LocatePulldown( root, /* menu above */ p, /* pulldown linking the two */ m, /* menu to position */ (XEvent *) event); /* event causing pulldown */ RC_SetWidgetMoved (m, TRUE); break; } } /* * - popdown anything that should go away (Calls _XmMenuPopDown) * * Called whenever a button is activated so that potential tear off restores * on the parent menupane don't occur. */ static void ButtonMenuPopDown( Widget w, XEvent *event, Boolean *popped_up ) { XmRowColumnWidget rc = FindMenu(w); XmRowColumnWidget pane = (XmRowColumnWidget) NULL; short depth; Boolean posted; XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(w)); XmExcludedParentPaneRec *excPP = &(((XmDisplayInfo *)(dd->display.displayInfo))->excParentPane); /* - Don't restore any torn panes in the active menu hierarchy. * "lastSelectToplevel" must be preserved for possible callback usage. */ for (pane=rc, depth=0; XmIsRowColumn(pane) && ((IsPulldown(pane) || IsPopup(pane)) && XmIsMenuShell(XtParent(pane))); depth++) { if ((depth+1) > excPP->pane_list_size) { excPP->pane_list_size += 4; excPP->pane = (Widget *) XtRealloc((char *)excPP->pane, sizeof(Widget) * excPP->pane_list_size); } (excPP->pane)[depth] = (Widget)pane; /* Someone (mwm?) has posted a popup in an unorthodox manner. Either * the posting event was not verified or the postFromWidget is not * a Motif widget. Try to save the situation. */ if (RC_CascadeBtn(pane) && ! XtIsShell(pane)) pane = (XmRowColumnWidget) XtParent(RC_CascadeBtn(pane)); else break; /* If the parent isn't a rowcolumn widget then stop walking up the parents */ if (pane == (XmRowColumnWidget) NULL || ! XmIsRowColumn(pane)) break; } excPP->num_panes = depth; _XmMenuPopDown((Widget)rc, event, &posted); /* _XmExcludedParentPane structure is used to delay the restoration to * preserve menu state until after PushB and ToggleB have a chance to * call their arm, activate, and disarm callbacks. If the menu (e.g. * option menu) was posted as a result of click (remain posted), the * button up may be caught by the menu-item's activate callback but * dropped on the floor. In this case, _XmExcludedParentPane should * be reset. */ if (posted) excPP->num_panes = 0; if (popped_up) *popped_up = posted; } static int InMenu( XmRowColumnWidget search_m, XmRowColumnWidget *parent_m, RectObj child, Widget *w ) { if (IsInWidgetList (search_m, child)) { *parent_m = search_m; *w = (Widget) child; return (TRUE); } return (FALSE); } static Boolean SearchMenu( XmRowColumnWidget search_m, XmRowColumnWidget *parent_m, RectObj child, Widget *w, #if NeedWidePrototypes int setHistory ) #else Boolean setHistory ) #endif /* NeedWidePrototypes */ { register Widget *q; register int i; if ( ! InMenu (search_m, parent_m, child, w)) { for (i = 0, q = search_m->composite.children; i < search_m->composite.num_children; i++, q++) { if (XtIsManaged(*q)) { if (XmIsCascadeButtonGadget(*q)) { XmCascadeButtonGadget p = (XmCascadeButtonGadget) *q; if (CBG_Submenu(p) && SearchMenu ((XmRowColumnWidget) CBG_Submenu(p), (XmRowColumnWidget *) parent_m, (RectObj) child, w, setHistory)) { if (setHistory) RC_MemWidget(search_m) = (Widget) child; return (TRUE); } } else if (XmIsCascadeButton(*q)) { XmCascadeButtonWidget p = (XmCascadeButtonWidget) *q; if (CB_Submenu(p) && SearchMenu ((XmRowColumnWidget) CB_Submenu(p), (XmRowColumnWidget *) parent_m, (RectObj) child, w, setHistory)) { if (setHistory) RC_MemWidget(search_m) = (Widget) child; return (TRUE); } } } } return (FALSE); } if (setHistory) RC_MemWidget(search_m) = (Widget) child; return (TRUE); } static void LotaMagic( XmRowColumnWidget m, RectObj child, XmRowColumnWidget *parent_m, Widget *w ) { *parent_m = NULL; *w = NULL; SearchMenu (m, parent_m, child, w, False); } static int NoTogglesOn( XmRowColumnWidget m ) { register Widget *q; register int i; ForManagedChildren (m, i, q) { if (XmIsToggleButtonGadget(*q)) { if (XmToggleButtonGadgetGetState (*q)) return (FALSE); } else if (XmIsToggleButton(*q)) { if (XmToggleButtonGetState (*q)) return (FALSE); } } return (TRUE); } static int IsInWidgetList( register XmRowColumnWidget m, RectObj w ) { register Widget *q; register int i; if ((m == NULL) || (w == NULL)) return (FALSE); for (i = 0, q = m->composite.children; i < m->composite.num_children; i++, q++) if ((*q == (Widget) w) && IsManaged (*q)) return (TRUE); return (FALSE); } static void AllOffExcept( XmRowColumnWidget m, Widget w ) { register Widget *q; register int i; if (w) /* then all widgets except this one go off */ { ForManagedChildren (m, i, q) { if (*q != w) { if (XmIsToggleButtonGadget(*q)) { if (XmToggleButtonGadgetGetState (*q)) XmToggleButtonGadgetSetState (*q, FALSE, TRUE); } else if (XmIsToggleButton(*q)) { if (XmToggleButtonGetState (*q)) XmToggleButtonSetState (*q, FALSE, TRUE); } } } } } /* * called by the buttons to verify that the passed in event is one that * should be acted upon. This is called through the menuProcs handle */ static Boolean VerifyMenuButton( Widget w, XEvent *event) { Boolean valid; if (IsPopup(w)) { valid = event && (_XmMatchBtnEvent( event, XmIGNORE_EVENTTYPE, RC_PostButton(w), RC_PostModifiers(w)) || _XmMatchBSelectEvent( w, event)) ; } else { /* CDE modification allows any button to activate a cascade button to show a menu */ valid = event && (event -> type == ButtonPress || event -> type == ButtonRelease); } return(valid); } /* * This routine is called at Initialize or SetValues time. It updates * the memory widget in the current rowcolumn and up to the top level(s) * menus. If there is a postFromList on the pulldown, it goes up each * branch. If an option menu is found at the top, then its cascadebutton * is updated with the latest stuff. */ static Boolean UpdateMenuHistory( XmRowColumnWidget menu, Widget child, #if NeedWidePrototypes int updateOnMemWidgetMatch) #else Boolean updateOnMemWidgetMatch) #endif /* NeedWidePrototypes */ { int i; Widget cb; Boolean retval = False; if (IsOption(menu)) { if (updateOnMemWidgetMatch && (RC_MemWidget(menu) != child)) return(False); if ((cb = XmOptionButtonGadget( (Widget) menu)) != NULL) { _XmRC_UpdateOptionMenuCBG (cb, child); retval = True; } } else if (IsPulldown(menu)) { for (i=0; i < menu->row_column.postFromCount; i++) { Widget parent_menu = XtParent(menu->row_column.postFromList[i]); if (UpdateMenuHistory ((XmRowColumnWidget) parent_menu, child, updateOnMemWidgetMatch)) { RC_MemWidget(parent_menu) = child; /* Don't return immediately - allow next postFromWidget to * update menuHistory as well. */ retval = True; } } } return(retval); } /* * this is a mess... the menu spec'd is the menu to set the history for; * the child spec'd is the child who we are pretending fired-off. The * problem is the child may be in any sub-menu of this cascade. This is * called by Initialize or SetValues. */ void _XmRC_SetMenuHistory( XmRowColumnWidget m, RectObj child ) { XmRowColumnWidget parent_m; Widget w; if (IsNull (child)) return; /* make sure that the child is in the menu hierarchy */ LotaMagic (m, child, &parent_m, &w); if (w) if (UpdateMenuHistory (parent_m, w, False)) RC_MemWidget(parent_m) = w; } /* * This routine is similar to the one above, except it only sets the * memory widget for the submenus down the cascade. This is called during * option menus setvalues and initialize routines. */ void _XmRC_SetOptionMenuHistory( XmRowColumnWidget m, RectObj child ) { XmRowColumnWidget parent_m = NULL; Widget w = NULL; if (IsNull (child)) return; SearchMenu (m, &parent_m, child, &w, True); } /* * note that this is potentially recursive, setting the state of a * toggle in this row column widget may re-enter this routine... */ static void RadioBehaviorAndMenuHistory( XmRowColumnWidget m, Widget w ) { XmRowColumnWidget menu; Widget cb; Boolean done = FALSE; if (! IsManaged(w)) return; if (RC_RadioBehavior(m)) { if (XmIsToggleButtonGadget(w)) { /* turned on */ if (XmToggleButtonGadgetGetState (w)) AllOffExcept (m, w); /* he turned off */ else { if (RC_RadioAlwaysOne(m)) if (NoTogglesOn (m)) /* can't allow that */ XmToggleButtonGadgetSetState (w, TRUE, TRUE); } } else if (XmIsToggleButton (w)) { /* turned on */ if (XmToggleButtonGetState (w)) AllOffExcept (m, w); /* turned off */ else { if (RC_RadioAlwaysOne(m)) if (NoTogglesOn (m)) /* can't allow that */ XmToggleButtonSetState (w, TRUE, TRUE); } } /* record for posterity */ RC_MemWidget (m) = w; } /* record the mouse memory and history widget all the way up the cascade */ menu = m; cb = 0; while ( ! done) { RC_MemWidget (menu) = w; if (! IsPopup(menu) && RC_CascadeBtn(menu)) { cb = RC_CascadeBtn(menu); menu = (XmRowColumnWidget) XtParent (cb); } else done = TRUE; } /* option menu cascade button gadget must be updated */ if (IsOption(menu)) _XmRC_UpdateOptionMenuCBG (cb, w); } /* * This routine is used to emulate the override callback functionality that * was available in the R3 library used by Xm and to do the radio behavior * and menu history functionality for RowColumns. The buttons call this * function through the MenuProcs interface. */ static void ChildsActivateCallback( XmRowColumnWidget rowcol, Widget child, XtPointer call_value ) { Arg arg[1]; int i; XtCallbackList callbacks; char *c = NULL; XmMenuSavvyTrait menuSavvyRec; menuSavvyRec = (XmMenuSavvyTrait) XmeTraitGet((XtPointer) XtClass(child), XmQTmenuSavvy); if (menuSavvyRec != NULL && menuSavvyRec -> getActivateCBName != NULL) c = menuSavvyRec -> getActivateCBName(); /* * Set up info before the entry callback is called */ GetLastSelectToplevel(rowcol); if (rowcol->row_column.entry_callback != NULL) { XtSetArg (arg[0], c, &callbacks); XtGetValues (child, arg, 1); /* make sure the all of the drawing has been done before the callback */ XFlush (XtDisplay (rowcol)); /* * cycle through the list and call the entry fired routine for each * entry in this callback list, sending in the data for each entry. * If the list is NULL, or empty, call the entry fired function once. */ if ((callbacks == NULL) || (callbacks[0].callback == (XtCallbackProc) NULL)) /* CR 5256 */ EntryFired (child, NULL, (XmAnyCallbackStruct *) call_value); else { int count; XtPointer * callbackClosure; /* * Note: We must make a copy of the callback data returned since * the information may be lost on the next Xt call. * We are only interested in the closure data for the entry callback. */ count = 0; while (callbacks[count].callback != NULL) count++; callbackClosure = (XtPointer *) XtMalloc(sizeof(XtPointer) * count); for (i=0; i < count; i++) callbackClosure[i] = callbacks[i].closure; for (i=0; i < count; i++) EntryFired (child, callbackClosure[i], (XmAnyCallbackStruct *) call_value); XtFree ((char *)callbackClosure); } } else /* no entry callback, but must do radio behavior & menu history */ EntryFired (child, NULL, (XmAnyCallbackStruct *) call_value); } /* * This is the callback for widgets which are composited into row column * widgets. It notifies the menu that some individual widget fired off; * this allows * the row column widget to tell the application if it wants * to know. also to do various other automagical things */ static void EntryFired( Widget w, XtPointer client_data, XmAnyCallbackStruct *callback ) { XmRowColumnWidget m = (XmRowColumnWidget) XtParent (w); XmRowColumnCallbackStruct mr; mr.reason = XmCR_ACTIVATE; /* menu activated */ mr.widget = w; mr.data = (char *) client_data; mr.callbackstruct = (char *) callback; /* subwidget structure */ mr.event = callback->event; RadioBehaviorAndMenuHistory (m, w); /* fire callback when done, so that it has correct (current) information */ XtCallCallbackList ((Widget) m, m->row_column.entry_callback, &mr); } static void MenuArm( Widget w ) { XmRowColumnWidget m = FindMenu(w); XmMenuState mst = _XmGetMenuState((Widget)w); if (!RC_IsArmed(m)) { /* * indicate that the display is grabbed so that drag & drop will not * interfere with the menu interaction. */ XmDisplay disp = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); disp->display.userGrabbed = True; if (IsBar(m)) { Widget topmostShell = _XmFindTopMostShell( (Widget) m); Arg args[1]; /* * save the current highlighted item so that it can be restored after * the menubar traversal mode is finished. This only makes sense * if the menubar itself is not the current tabgroup. */ mst->RC_activeItem = _XmGetActiveItem( (Widget) m); if (mst->RC_activeItem && XtParent(mst->RC_activeItem) == (Widget)m) mst->RC_activeItem = NULL; /* Make sure focus policy is explicit during active menubar */ if ((RC_OldFocusPolicy(m) = _XmGetFocusPolicy( (Widget) m)) != XmEXPLICIT) { /* Generate a synthetic crossing event from current focus widget * to menubar so the current focus widget can unhighlight itself. * This is necessary in case the leave routine checks for XmPOINTER * focus policy (as in _XmLeaveGadget). */ XCrossingEvent xcrossing; /* If activeItem is NULL, then there's no possible widget/gadget to * unhighlight. */ if (mst->RC_activeItem) { xcrossing.type = LeaveNotify; xcrossing.serial = LastKnownRequestProcessed(XtDisplay(mst->RC_activeItem)); xcrossing.send_event = False; xcrossing.display = XtDisplay(mst->RC_activeItem); xcrossing.window = XtWindow(mst->RC_activeItem); xcrossing.subwindow = 0; /* CR 5257 */ xcrossing.time = XtLastTimestampProcessed(XtDisplay(mst->RC_activeItem)); xcrossing.mode = 1; xcrossing.detail = NotifyNonlinear; xcrossing.same_screen = True; xcrossing.focus = True; xcrossing.state = 0; XtDispatchEvent((XEvent *) &xcrossing); } XtSetArg (args[0], XmNkeyboardFocusPolicy, XmEXPLICIT); XtSetValues (topmostShell, args, 1); } /* * _XmMenuFocus(XmMENU_BEGIN) already called; switch tab group. * 'widget' is cascade button for menubar case. */ m->manager.traversal_on = True; XmProcessTraversal(w, XmTRAVERSE_CURRENT); /* * Menubars need their own exclusive/SL grab, so that they will * still get input even when a cascade button without a submenu * has the focus. */ _XmAddGrab( (Widget) m, XtGrabNonexclusive, True); RC_SetBeingArmed(m, True); /* Swallow focus & crossing events to menubar (only) */ _XmSetSwallowEventHandler((Widget) m, True); } RC_SetArmed (m, True); } } static void MenuDisarm( Widget w ) { XmRowColumnWidget m = FindMenu(w); XmMenuState mst = _XmGetMenuState((Widget)w); if (RC_IsArmed(m)) { /* * indicate that the display is ungrabbed so that drag & drop * is enabled if this is the toplevel menu */ if (IsBar(m) || IsPopup(m) || IsOption(m) || (IsPulldown(m) && !(XmIsMenuShell(XtParent(m))))) { XmDisplay disp = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); disp->display.userGrabbed = False; } if (IsBar(m)) { Widget topmostShell = _XmFindTopMostShell( (Widget) m); Arg args[1]; _XmRemoveGrab( (Widget) m); RC_SetBeingArmed(m, False); m->manager.traversal_on = False; /* restore focus policy */ if (RC_OldFocusPolicy(m) == XmEXPLICIT) { /* * restore the activeItem that had the focus BEFORE the * menubar mode was entered. */ if (mst->RC_activeItem && !mst->RC_activeItem->core.being_destroyed) { XmProcessTraversal (mst->RC_activeItem, XmTRAVERSE_CURRENT); mst->RC_activeItem = NULL; } else { XmProcessTraversal (topmostShell, XmTRAVERSE_NEXT_TAB_GROUP); } } else /* XmPOINTER */ { if (m->manager.active_child) { XmCascadeButtonHighlight(m->manager.active_child, False); _XmClearFocusPath((Widget) m); } /* Clear internal focus structures so key events will be * dispatched correctly. */ XtSetKeyboardFocus(topmostShell, None); XtSetArg (args[0], XmNkeyboardFocusPolicy, XmPOINTER); XtSetValues (topmostShell, args, 1); } _XmSetSwallowEventHandler((Widget) m, False); } /* tear off shell */ else if ((IsPulldown(m) || IsPopup(m)) && !XmIsMenuShell(XtParent(m))) { /* this needs to be done for XmPOINTER focus, because there is no event for the focus out translation. There doesn't seem to be any way of detecting that we are in pointer, though. */ if (m->manager.active_child) { XmCascadeButtonHighlight(m->manager.active_child, False); } _XmRemoveGrab((Widget) m); RC_SetBeingArmed(m, False); } RC_SetArmed (m, FALSE); } } static void TearOffArm( Widget w ) { XmRowColumnWidget m = FindMenu(w); Display *dpy = XtDisplay(w); XmMenuSystemTrait menuSTrait; Time _time = XtLastTimestampProcessed(XtDisplay(w)); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) m), XmQTmenuSystem); /* If the parent is torn and active, AND this is an initial selection * (e.g. ButtonPress), place the menu system into an active state by * arming and setting up grabs. */ if ((IsPulldown(m) || IsPopup(m)) && !XmIsMenuShell(XtParent(m)) && !RC_IsArmed(m)) { /* Don't post the menu if the menu cannot control grabs! */ if (_XmMenuGrabKeyboardAndPointer((Widget)m, _time) != GrabSuccess) { return; } _XmMenuFocus((Widget)m, XmMENU_BEGIN, _time); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(dpy, SyncPointer, CurrentTime); menuSTrait -> arm((Widget) m); /* A submenu is posted! Set up modal grab */ /* Make it act like a pseudo popup and give it spring loaded * characteristics. */ _XmAddGrab( (Widget) m, XtGrabNonexclusive, True); XFlush(dpy); } } /*ARGSUSED*/ static void InvalidateOldFocus( Widget oldWidget, /* unused */ Window **poldFocus, XEvent *event) /* unused */ { *poldFocus = NULL; } /* * Return the widget which the menu was posted from. * - If this is in a popup, it is the widget which initiated the post * (via positioning & managing or via armAndActivate). * - If it is in a pulldown from a menubar or option menu, then the * returned widget is the menubar or option menu. * - If it is a tear off popup or pulldown, the postedFromWidget was * determined at tear time and stored away. */ Widget XmGetPostedFromWidget( Widget menu ) { XmRowColumnWidget toplevel; Widget wid = NULL; _XmWidgetToAppContext(menu); _XmAppLock(app); if (menu && XmIsRowColumn(menu)) { toplevel = (XmRowColumnWidget) ((XmRowColumnWidget)menu)->row_column.lastSelectToplevel; if (toplevel && IsPopup(toplevel)) { /* active widget is kept in cascadeBtn field for popups */ wid = RC_CascadeBtn(toplevel); } else wid = (Widget)toplevel; } _XmAppUnlock(app); return wid; } Widget XmGetTearOffControl( Widget menu ) { Widget wid = NULL; _XmWidgetToAppContext(menu); _XmAppLock(app); if (menu && XmIsRowColumn(menu)) wid = RC_TearOffControl(menu); _XmAppUnlock(app); return wid; } void XmMenuPosition( Widget p, XButtonPressedEvent *event ) { _XmWidgetToAppContext(p); _XmAppLock(app); PositionMenu ((XmRowColumnWidget) p, event); _XmAppUnlock(app); } static Boolean MenuSystemPopdown( Widget w, XEvent *e ) { Boolean popped_up; _XmMenuPopDown(w, e, &popped_up); return(popped_up); } static Boolean MenuSystemButtonPopdown( Widget w, XEvent *e ) { Boolean popped_up; ButtonMenuPopDown(w, e, &popped_up); return(popped_up); } static void MenuChildFocus(Widget w) { /* So KHelp event is delivered correctly */ _XmSetFocusFlag( XtParent(XtParent(w)), XmFOCUS_IGNORE, TRUE); XtSetKeyboardFocus(XtParent(XtParent(w)), (Widget) w); _XmSetFocusFlag( XtParent(XtParent(w)), XmFOCUS_IGNORE, FALSE); } static Widget MenuPopupPosted(Widget w) { return(RC_PopupPosted(w)); } motif-2.3.8/lib/Xm/DrawnB.c0000644000175000017500000013640413145162623012251 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DrawnB.c /main/20 1999/04/29 13:05:14 samborn $" #endif #endif /* * Include files & Static Routine Definitions */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "XmI.h" #include "RepTypeI.h" #include "LabelI.h" #include "MenuUtilI.h" #include "MenuProcI.h" #include "MenuStateI.h" #include "PrimitiveI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #define DELAY_DEFAULT 100 /******** Static Function Declarations ********/ static void Arm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void MultiArm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Activate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params) ; static void MultiActivate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params) ; static void ActivateCommon( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ArmTimeout ( XtPointer closure, XtIntervalId *id ) ; static void Disarm( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BtnDown( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BtnUp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Enter( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Leave( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BorderHighlight( Widget wid) ; static void BorderUnhighlight( Widget wid) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void InitializePrehook( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Resize( Widget wid) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void DrawPushButton( XmDrawnButtonWidget db, #if NeedWidePrototypes int armed) ; #else Boolean armed) ; #endif /* NeedWidePrototypes */ static Boolean SetValuesPrehook( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes) ; static void Destroy( Widget wid) ; static void ChangeCB(Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) ; static void DB_FixTearoff(XmDrawnButtonWidget db); /******** End Static Function Declarations ********/ /*************************************<->************************************* * * * Description: translation tables for class: DrawnButton * ----------- * * Matches events with string descriptors for internal routines. * *************************************<->***********************************/ static XtTranslations default_parsed; #define defaultTranslations _XmDrawnB_defaultTranslations static XtTranslations menu_parsed; #define menuTranslations _XmDrawnB_menuTranslations /*************************************<->************************************* * * * Description: action list for class: DrawnButton * ----------- * * Matches string descriptors with internal routines. * Note that Primitive will register additional event handlers * for traversal. * *************************************<->***********************************/ static XtActionsRec actionsList[] = { {"Arm", Arm }, {"Activate", Activate }, {"MultiActivate", MultiActivate }, {"MultiArm", MultiArm }, {"ArmAndActivate", ArmAndActivate }, {"Disarm", Disarm }, {"BtnDown", BtnDown }, {"BtnUp", BtnUp }, {"Enter", Enter }, {"Leave", Leave }, {"ButtonTakeFocus", _XmButtonTakeFocus }, {"MenuButtonTakeFocus", _XmMenuButtonTakeFocus }, {"MenuButtonTakeFocusUp", _XmMenuButtonTakeFocusUp } }; /* The resource list for Drawn Button */ static XtResource resources[] = { { XmNmultiClick, XmCMultiClick, XmRMultiClick, sizeof (unsigned char), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.multiClick), XmRImmediate, (XtPointer) XmMULTICLICK_KEEP }, { XmNpushButtonEnabled, XmCPushButtonEnabled, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.pushbutton_enabled), XmRImmediate, (XtPointer) False }, { XmNshadowType, XmCShadowType, XmRShadowType, sizeof(unsigned char), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.shadow_type), XmRImmediate, (XtPointer) XmSHADOW_ETCHED_IN }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.activate_callback), XmRPointer, (XtPointer) NULL }, { XmNarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.arm_callback), XmRPointer, (XtPointer) NULL }, { XmNdisarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.disarm_callback), XmRPointer, (XtPointer) NULL }, { XmNexposeCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.expose_callback), XmRPointer, (XtPointer) NULL }, { XmNresizeCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmDrawnButtonRec, drawnbutton.resize_callback), XmRPointer, (XtPointer) NULL }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _XmDrawnButtonRec, primitive.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNlabelString, XmCXmString, XmRXmString, sizeof(XmString), XtOffsetOf( struct _XmDrawnButtonRec, label._label), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmPrimitiveRec, primitive.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness } }; static XmBaseClassExtRec drawnBBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ SetValuesPrehook, /* set_values prehook */ InitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ XmInheritGetSecResData, /* getSecResData */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ XmInheritClassPartInitPrehook, /* classPartInitPrehook */ XmInheritClassPartInitPosthook, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; /*************************************<->************************************* * * * Description: global class record for instances of class: DrawnButton * ----------- * * Defines default field settings for this class record. * *************************************<->***********************************/ externaldef(xmdrawnbuttonclassrec) XmDrawnButtonClassRec xmDrawnButtonClassRec ={ { /* core_class record */ /* superclass */ (WidgetClass) &xmLabelClassRec, /* class_name */ "XmDrawnButton", /* widget_size */ sizeof(XmDrawnButtonRec), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeNoCompress, /* compress_enterlv */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ (XtPointer) &drawnBBaseClassExtRec, }, { /* primitive_class record */ /* Primitive border_highlight */ BorderHighlight, /* Primitive border_unhighlight */ BorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ ArmAndActivate, /* get resources */ NULL, /* num get_resources */ 0, /* extension */ NULL, }, { /* label_class record */ /* setOverrideCallback*/ XmInheritWidgetProc, /* Menu procedures */ XmInheritMenuProc, /* menu trav xlations */ XtInheritTranslations, /* extension */ NULL, }, { /* drawnbutton_class record */ /* extension */ NULL, } }; externaldef(xmdrawnbuttonwidgetclass) WidgetClass xmDrawnButtonWidgetClass = (WidgetClass)&xmDrawnButtonClassRec; /* Trait record for drawnButton */ static XmConst XmActivatableTraitRec drawnButtonAT = { 0, /* version */ ChangeCB, }; /* Menu Savvy trait record */ static XmMenuSavvyTraitRec MenuSavvyRecord = { /* version: */ -1, NULL, NULL, NULL, _XmCBNameActivate, }; /************************************************************************ * * Arm * * This function processes button 1 down occuring on the drawnbutton. * Mark the drawnbutton as armed if XmNpushButtonEnabled is TRUE. * The callbacks for XmNarmCallback are called. * ************************************************************************/ /*ARGSUSED*/ static void Arm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XButtonEvent *buttonEvent = (XButtonEvent *) event; XmDrawnButtonCallbackStruct call_value; (void) XmProcessTraversal((Widget) db, XmTRAVERSE_CURRENT); db -> drawnbutton.armed = TRUE; if (event && (event->type == ButtonPress)) db -> drawnbutton.armTimeStamp = buttonEvent->time; if (db->drawnbutton.pushbutton_enabled) DrawPushButton(db, db->drawnbutton.armed); if (db->drawnbutton.arm_callback) { XFlush(XtDisplay (db)); call_value.reason = XmCR_ARM; call_value.event = event; call_value.window = XtWindow (db); XtCallCallbackList ((Widget) db, db->drawnbutton.arm_callback, &call_value); } } /*ARGSUSED*/ static void MultiArm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { if (((XmDrawnButtonWidget) wid)->drawnbutton.multiClick == XmMULTICLICK_KEEP) Arm (wid, event, NULL, NULL); } /************************************************************************ * * Activate * * Mark the drawnbutton as unarmed (i.e. inactive). * The foreground and background colors will revert to the * unarmed state if XmNinvertOnArm is set to TRUE. * If the button release occurs inside of the DrawnButton, the * callbacks for XmNactivateCallback are called. * ************************************************************************/ static void Activate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; if (db -> drawnbutton.armed == FALSE) return; db->drawnbutton.click_count = 1; ActivateCommon ((Widget) db, buttonEvent, params, num_params); } static void MultiActivate( Widget wid, XEvent *buttonEvent, String *params, Cardinal *num_params ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; /* When a multi click sequence occurs and the user Button Presses and * holds for a length of time, the final release should look like a * new/separate activate. */ if (db->drawnbutton.multiClick == XmMULTICLICK_KEEP) { if ((buttonEvent->xbutton.time - db->drawnbutton.armTimeStamp) > XtGetMultiClickTime(XtDisplay(db))) db->drawnbutton.click_count = 1; else db->drawnbutton.click_count++; ActivateCommon ((Widget) db, buttonEvent, params, num_params) ; Disarm ((Widget) db, buttonEvent, params, num_params) ; } } /*ARGSUSED*/ static void ActivateCommon( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (event && (event->xbutton.type != ButtonRelease)) return; db -> drawnbutton.armed = FALSE; if (db->drawnbutton.pushbutton_enabled) DrawPushButton(db, db->drawnbutton.armed); /* CR 9181: Consider clipping when testing visibility. */ if ((db->drawnbutton.activate_callback) && ((event->xany.type == ButtonPress) || (event->xany.type == ButtonRelease)) && _XmGetPointVisibility(wid, event->xbutton.x_root, event->xbutton.y_root)) { XFlush(XtDisplay (db)); call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.window = XtWindow (db); call_value.click_count = db->drawnbutton.click_count; if ((db->drawnbutton.multiClick == XmMULTICLICK_DISCARD) && (call_value.click_count > 1)) { return; } if (menuSTrait != NULL) { menuSTrait->entryCallback(XtParent(db), (Widget) db, &call_value); } if ((! db->label.skipCallback) && (db->drawnbutton.activate_callback)) { XtCallCallbackList ((Widget) db, db->drawnbutton.activate_callback, &call_value); } } } static void DB_FixTearoff( XmDrawnButtonWidget db) { if (XmMENU_PULLDOWN == db->label.menu_type) { Widget mwid = XmGetPostedFromWidget(XtParent(db)); if (mwid && XmIsRowColumn(mwid) && (XmMENU_OPTION == RC_Type(mwid)) && _XmIsActiveTearOff(XtParent(db))) XmProcessTraversal((Widget) db, XmTRAVERSE_CURRENT); } } /************************************************************************ * * ArmAndActivate * ************************************************************************/ /*ARGSUSED*/ static void ArmAndActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); db -> drawnbutton.armed = TRUE; if (db->drawnbutton.pushbutton_enabled) DrawPushButton(db, db->drawnbutton.armed); XFlush(XtDisplay (db)); if (db->drawnbutton.arm_callback) { call_value.reason = XmCR_ARM; call_value.event = event; call_value.window = XtWindow (db); XtCallCallbackList ((Widget) db, db->drawnbutton.arm_callback, &call_value); } call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.window = XtWindow (db); call_value.click_count = 1; /* always 1 in kselect */ if (menuSTrait != NULL) { menuSTrait->entryCallback(XtParent(db), (Widget) db, &call_value); } if ((! db->label.skipCallback) && (db->drawnbutton.activate_callback)) { XtCallCallbackList ((Widget) db, db->drawnbutton.activate_callback, &call_value); } db->drawnbutton.armed = FALSE; if (db->drawnbutton.disarm_callback) { call_value.reason = XmCR_DISARM; XtCallCallbackList ((Widget) db, db->drawnbutton.disarm_callback, &call_value); } /* If the button is still around, show it released, after a short delay */ if (!db->core.being_destroyed && db->drawnbutton.pushbutton_enabled) { db->drawnbutton.timer = XtAppAddTimeOut( XtWidgetToApplicationContext((Widget)db), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)db); } } /*ARGSUSED*/ static void ArmTimeout ( XtPointer closure, XtIntervalId *id ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) closure ; db -> drawnbutton.timer = 0; if (db->drawnbutton.pushbutton_enabled && XtIsRealized((Widget)db) && XtIsManaged((Widget)db)) { DrawPushButton(db, db->drawnbutton.armed); XFlush (XtDisplay (db)); } } /************************************************************************ * * Disarm * * Mark the drawnbutton as unarmed (i.e. active). * The foreground and background colors will revert to the * unarmed state if XmNinvertOnSelect is set to TRUE and the * drawnbutton is not in a menu. * The callbacks for XmNdisarmCallback are called.. * ************************************************************************/ /*ARGSUSED*/ static void Disarm( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; db -> drawnbutton.armed = FALSE; if (db->drawnbutton.disarm_callback) { XFlush(XtDisplay (db)); call_value.reason = XmCR_DISARM; call_value.event = event; call_value.window = XtWindow (db); XtCallCallbackList ((Widget) db, db->drawnbutton.disarm_callback, &call_value); } } /************************************************************************ * * BtnDown * * This function processes a button down occuring on the drawnbutton * when it is in a popup, pulldown, or option menu. * Popdown the posted menu. * Turn parent's traversal off. * Mark the drawnbutton as armed (i.e. active). * The callbacks for XmNarmCallback are called. * ************************************************************************/ /*ARGSUSED*/ static void BtnDown( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; Boolean validButton = False; Boolean already_armed; ShellWidget popup; XmMenuSystemTrait menuSTrait; /* Support menu replay, free server input queue until next button event */ XAllowEvents(XtDisplay(db), SyncPointer, CurrentTime); /* If no menu system trait then parent isn't a menu as it should be. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(db)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (event && (event->type == ButtonPress)) validButton = menuSTrait->verifyButton(XtParent(db), event); if (!validButton) return; _XmSetInDragMode((Widget)db, True); /* Popdown other popus that may be up */ if (!(popup = (ShellWidget)_XmGetRC_PopupPosted(XtParent(db)))) { if (!XmIsMenuShell(XtParent(XtParent(db)))) { /* In case tear off not armed and no grabs in place, do it now. * Ok if already armed and grabbed - nothing done. */ menuSTrait->tearOffArm(XtParent(db)); } } if (popup) { if (popup->shell.popped_up) menuSTrait->popdownEveryone((Widget) popup, event); } /* Set focus to this drawnbutton. This must follow the possible * unhighlighting of the CascadeButton else it'll screw up active_child. */ (void)XmProcessTraversal ((Widget) db, XmTRAVERSE_CURRENT); /* get the location cursor - get consistent with Gadgets */ already_armed = db->drawnbutton.armed; db->drawnbutton.armed = TRUE; if (db->drawnbutton.arm_callback && !already_armed) { XFlush (XtDisplay (db)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget) db, db->drawnbutton.arm_callback, &call_value); } _XmRecordEvent (event); } /************************************************************************ * * BtnUp * * This function processes a button up occuring on the drawnbutton * when it is in a popup, pulldown, or option menu. * Mark the drawnbutton as unarmed (i.e. inactive). * The callbacks for XmNactivateCallback are called. * The callbacks for XmNdisarmCallback are called. * ************************************************************************/ /*ARGSUSED*/ static void BtnUp( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; Widget parent = XtParent(db); XmDrawnButtonCallbackStruct call_value; Boolean flushDone = False; Boolean validButton = False; Boolean popped_up; Boolean is_menupane = Lab_IsMenupane(db); Widget shell = XtParent(XtParent(db)); XmMenuSystemTrait menuSTrait; /* If no menu system trait then parent isn't a menu as it should be. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(db)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (event && (event->type == ButtonRelease)) validButton = menuSTrait->verifyButton(parent, event); if (!validButton || (db->drawnbutton.armed == FALSE)) return; db->drawnbutton.armed = FALSE; if (is_menupane && !XmIsMenuShell(shell)) popped_up = menuSTrait->popdown((Widget) db, event); else popped_up = menuSTrait->buttonPopdown((Widget) db, event); _XmRecordEvent(event); /* XmMENU_POPDOWN left the menu posted on button click - don't activate! */ if (popped_up) return; call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = 1; /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) { menuSTrait->entryCallback(parent, (Widget) db, &call_value); flushDone = True; } if ((! db->label.skipCallback) && (db->drawnbutton.activate_callback)) { XFlush (XtDisplay (db)); flushDone = True; XtCallCallbackList ((Widget) db, db->drawnbutton.activate_callback, &call_value); } if (db->drawnbutton.disarm_callback) { if (!flushDone) XFlush (XtDisplay (db)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) db, db->drawnbutton.disarm_callback, &call_value); } /* If the original shell does not indicate an active menu, but rather a * tear off pane, leave the button in an armed state. Also, briefly * display the button as depressed to give the user some feedback of * the selection. */ if (is_menupane) /* necessary check? */ { if (!XmIsMenuShell(shell)) { if (XtIsSensitive((Widget)db)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(db)); Boolean etched_in = dpy->display.enable_etched_in_menu; if ((db->core.width > 2 * db->primitive.highlight_thickness) && (db->core.height > 2 * db->primitive.highlight_thickness)) XmeDrawShadows (XtDisplay (db), XtWindow (db), db->primitive.bottom_shadow_GC, db->primitive.top_shadow_GC, db->primitive.highlight_thickness, db->primitive.highlight_thickness, db->core.width - 2 * db->primitive.highlight_thickness, db->core.height - 2 * db->primitive.highlight_thickness, db->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); XFlush (XtDisplay (db)); flushDone = True; if (db->core.being_destroyed == False) { if (!db->drawnbutton.timer) db->drawnbutton.timer = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)db), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)(db)); } db->drawnbutton.armed = TRUE; if (db->drawnbutton.arm_callback) { if (!flushDone) XFlush (XtDisplay (db)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) db, db->drawnbutton.arm_callback, &call_value); } } } else menuSTrait->reparentToTearOffShell(XtParent(db), event); } _XmSetInDragMode((Widget)db, False); /* For the benefit of tear off menus, we must set the focus item * to this button. In normal menus, this would not be a problem * because the focus is cleared when the menu is unposted. */ if (!XmIsMenuShell(shell)) XmProcessTraversal((Widget) db, XmTRAVERSE_CURRENT); DB_FixTearoff(db); } /************************************************************************ * * Enter * ************************************************************************/ static void Enter( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; if (Lab_IsMenupane(db)) { if ((((ShellWidget) XtParent(XtParent(db)))->shell.popped_up) && _XmGetInDragMode((Widget)db)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); if (db->drawnbutton.armed) return; /* So KHelp event is delivered correctly */ _XmSetFocusFlag (XtParent(XtParent(db)), XmFOCUS_IGNORE, TRUE); XtSetKeyboardFocus(XtParent(XtParent(db)), (Widget)db); _XmSetFocusFlag (XtParent(XtParent(db)), XmFOCUS_IGNORE, FALSE); db -> drawnbutton.armed = TRUE; ((XmManagerWidget) XtParent(wid))->manager.active_child = wid; if (db->drawnbutton.pushbutton_enabled) DrawPushButton(db, db->drawnbutton.armed); if (db->drawnbutton.arm_callback) { XFlush (XtDisplay (db)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) db, db->drawnbutton.arm_callback, &call_value); } } } else { _XmPrimitiveEnter (wid, event, params, num_params); if (db -> drawnbutton.pushbutton_enabled && db -> drawnbutton.armed == TRUE) DrawPushButton(db, TRUE); } } /************************************************************************ * * Leave * ************************************************************************/ static void Leave( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; if (Lab_IsMenupane(db)) { if (_XmGetInDragMode((Widget)db) && db->drawnbutton.armed && (/* !ActiveTearOff || */ event->xcrossing.mode == NotifyNormal)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); db->drawnbutton.armed = FALSE; ((XmManagerWidget) XtParent(wid))->manager.active_child = NULL; if (db->drawnbutton.pushbutton_enabled) { XmeClearBorder (XtDisplay (db), XtWindow (db), db->primitive.highlight_thickness, db->primitive.highlight_thickness, db->core.width - 2 * db->primitive.highlight_thickness, db->core.height - 2 * db->primitive.highlight_thickness, db->primitive.shadow_thickness); } if (db->drawnbutton.disarm_callback) { XFlush (XtDisplay (db)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) db, db->drawnbutton.disarm_callback, &call_value); } } } else { _XmPrimitiveLeave (wid, event, params, num_params); if (db -> drawnbutton.pushbutton_enabled && db -> drawnbutton.armed == TRUE) DrawPushButton(db, FALSE); } } /*************************************<->************************************* * * BorderHighlight * *************************************<->***********************************/ static void BorderHighlight( Widget wid ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; XEvent * event = NULL; if (Lab_IsMenupane(db)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean already_armed = db->drawnbutton.armed; db->drawnbutton.armed = TRUE; if (db->drawnbutton.pushbutton_enabled) DrawPushButton(db, db->drawnbutton.armed); if (!already_armed && db->drawnbutton.arm_callback) { XFlush (XtDisplay (db)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) db, db->drawnbutton.arm_callback, &call_value); } } else { XtWidgetProc border_highlight; _XmProcessLock(); border_highlight = xmLabelClassRec.primitive_class.border_highlight; _XmProcessUnlock(); (*border_highlight)(wid); } } /*************************************<->************************************* * * BorderUnhighlight * *************************************<->***********************************/ static void BorderUnhighlight( Widget wid ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; XEvent * event = NULL; if (Lab_IsMenupane(db)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean already_armed = db->drawnbutton.armed; db->drawnbutton.armed = FALSE; if (db->drawnbutton.pushbutton_enabled) { XmeClearBorder (XtDisplay (db), XtWindow (db), db->primitive.highlight_thickness, db->primitive.highlight_thickness, db->core.width - 2 * db->primitive.highlight_thickness, db->core.height - 2 * db->primitive.highlight_thickness, db->primitive.shadow_thickness); } if (already_armed && db->drawnbutton.disarm_callback) { XFlush (XtDisplay (db)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) db, db->drawnbutton.disarm_callback, &call_value); } } else { XtWidgetProc border_unhighlight; _XmProcessLock(); border_unhighlight = xmLabelClassRec.primitive_class.border_unhighlight; _XmProcessUnlock(); (*border_unhighlight)(wid); } } /************************************************************************ * * ClassInitialize * Set up the base class extension record. * ************************************************************************/ static void ClassInitialize( void ) { /* parse the various translation tables */ menu_parsed = XtParseTranslationTable(menuTranslations); default_parsed = XtParseTranslationTable(defaultTranslations); /* set up base class extension quark */ drawnBBaseClassExtRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmDRAWN_BUTTON_BIT); /* Install the menu savvy trait record, copying fields from XmLabel */ _XmLabelCloneMenuSavvy (wc, &MenuSavvyRecord); /* Install the activatable trait for all subclasses */ XmeTraitSet((XtPointer)wc, XmQTactivatable, (XtPointer) &drawnButtonAT); } /************************************************************ * * InitializePrehook * * Put the proper translations in core_class tm_table so that * the data is massaged correctly * ************************************************************/ /*ARGSUSED*/ static void InitializePrehook( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmDrawnButtonWidget bw = (XmDrawnButtonWidget) nw ; unsigned char type; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(nw)), XmQTmenuSystem); _XmSaveCoreClassTranslations (nw); if (menuSTrait != NULL) type = menuSTrait->type(XtParent(nw)); else type = XmWORK_AREA; _XmProcessLock(); if (type == XmMENU_PULLDOWN || type == XmMENU_POPUP) nw->core.widget_class->core_class.tm_table = (String) menu_parsed; else nw->core.widget_class->core_class.tm_table = (String) default_parsed; /* CR 2990: Use XmNbuttonFontList as the default font. */ if (bw->label.font == NULL) bw->label.font = XmeGetDefaultRenderTable (nw, XmBUTTON_FONTLIST); _XmProcessUnlock(); } /************************************************************ * * InitializePosthook * * restore core class translations * ************************************************************/ /*ARGSUSED*/ static void InitializePosthook( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { _XmRestoreCoreClassTranslations (nw); } /*************************************<->************************************* * * Initialize * *************************************<->***********************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmDrawnButtonWidget new_w = (XmDrawnButtonWidget) nw ; XmDrawnButtonWidget req_w = (XmDrawnButtonWidget) rw ; /* CR 2990: Use XmNbuttonFontList as the default font. */ if (req_w->label.font == NULL) { XmFontListFree (new_w->label.font); new_w->label.font = XmFontListCopy (XmeGetDefaultRenderTable (nw, XmBUTTON_FONTLIST)); } new_w->drawnbutton.armed = FALSE; new_w->drawnbutton.timer = 0; /* if menuProcs is not set up yet, try again */ if (xmLabelClassRec.label_class.menuProcs == (XmMenuProc)NULL) xmLabelClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); if( !XmRepTypeValidValue( XmRID_SHADOW_TYPE, new_w->drawnbutton.shadow_type, (Widget) new_w) ) { new_w -> drawnbutton.shadow_type = XmSHADOW_ETCHED_IN; } } /*************************************<->************************************* * * Resize (db) * *************************************<->***********************************/ static void Resize( Widget wid ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; XtWidgetProc resize; _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize) ((Widget) db); /* CR 5419: Suppress redundant calls to the resize callbacks. */ if (db->drawnbutton.resize_callback && !Lab_ComputingSize(db)) { XFlush(XtDisplay (db)); call_value.reason = XmCR_RESIZE; call_value.event = NULL; call_value.window = XtWindow (db); XtCallCallbackList ((Widget) db, db->drawnbutton.resize_callback, &call_value); } } /*************************************<->************************************* * * Redisplay (db, event, region) * *************************************<->***********************************/ /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; XmDrawnButtonCallbackStruct call_value; if (XtIsRealized((Widget)db)) { if (event) { XtExposeProc expose; _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (* expose) ((Widget) db, event, region); } if (db->drawnbutton.pushbutton_enabled) DrawPushButton(db, db->drawnbutton.armed); else XmeDrawShadows(XtDisplay((Widget) db), XtWindow((Widget) db), db -> primitive.top_shadow_GC, db -> primitive.bottom_shadow_GC, db -> primitive.highlight_thickness, db -> primitive.highlight_thickness, db -> core.width - 2 * db -> primitive.highlight_thickness, db -> core.height - 2 * db -> primitive.highlight_thickness, db -> primitive.shadow_thickness, db->drawnbutton.shadow_type); if (db->drawnbutton.expose_callback) { XFlush(XtDisplay (db)); call_value.reason = XmCR_EXPOSE; call_value.event = event; call_value.window = XtWindow (db); XtCallCallbackList ((Widget) db, db->drawnbutton.expose_callback, &call_value); } } } static void DrawPushButton( XmDrawnButtonWidget db, #if NeedWidePrototypes int armed ) #else Boolean armed ) #endif /* NeedWidePrototypes */ { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) db)); Boolean etched_in = dpy -> display.enable_etched_in_menu; Boolean in_menu = Lab_IsMenupane((Widget) db); Boolean do_draw; unsigned int type; do_draw = (! in_menu) || (in_menu && armed); if (in_menu) type = etched_in ? XmSHADOW_IN : XmSHADOW_OUT; else type = armed ? XmSHADOW_IN : XmSHADOW_OUT; if (do_draw) XmeDrawShadows (XtDisplay (db), XtWindow (db), db -> primitive.top_shadow_GC, db -> primitive.bottom_shadow_GC, db -> primitive.highlight_thickness, db -> primitive.highlight_thickness, db -> core.width - 2 * db->primitive.highlight_thickness, db -> core.height - 2 * db->primitive.highlight_thickness, db -> primitive.shadow_thickness, type); } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPrehook( Widget cw, /* unused */ Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmDrawnButtonWidget bw = (XmDrawnButtonWidget) nw ; /* CR 2990: Use XmNbuttonFontList as the default font. */ if (bw->label.font == NULL) bw->label.font = XmeGetDefaultRenderTable (nw, XmBUTTON_FONTLIST); return False; } /*************************************<->************************************* * * SetValues(current, request, new_w) * * Description: * ----------- * This is the set values procedure for the drawnbutton class. It is * called last (the set values rtnes for its superclasses are called * first). * * * Inputs: * ------ * current = original widget; * request = original copy of request; * new_w = copy of request which reflects changes made to it by * set values procedures of its superclasses; * last = TRUE if this is the last set values procedure to be called. * * Outputs: * ------- * * Procedures Called * ----------------- * *************************************<->***********************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmDrawnButtonWidget current = (XmDrawnButtonWidget) cw ; XmDrawnButtonWidget new_w = (XmDrawnButtonWidget) nw ; Boolean flag = FALSE; /* our return value */ /* Check the data put into the new widget. */ if( !XmRepTypeValidValue( XmRID_SHADOW_TYPE, new_w->drawnbutton.shadow_type, (Widget) new_w) ) { new_w->drawnbutton.shadow_type = current->drawnbutton.shadow_type ; } if (new_w -> drawnbutton.shadow_type != current-> drawnbutton.shadow_type || new_w -> primitive.foreground != current -> primitive.foreground || new_w -> core.background_pixel != current -> core.background_pixel || new_w -> primitive.highlight_thickness != current -> primitive.highlight_thickness || new_w -> primitive.shadow_thickness != current -> primitive.shadow_thickness) { flag = TRUE; } return(flag); } /************************************************************************* * * Realize * This function sets the bit gravity to forget. * *************************************************************************/ static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { Mask valueMask = *p_valueMask; valueMask |= CWBitGravity | CWDontPropagate; attributes->bit_gravity = ForgetGravity; attributes->do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | PointerMotionMask; XtCreateWindow (w, InputOutput, CopyFromParent, valueMask, attributes); } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget wid ) { XmDrawnButtonWidget db = (XmDrawnButtonWidget) wid ; if (db->drawnbutton.timer) XtRemoveTimeOut (db->drawnbutton.timer); } /************************************************************************ * * ChangeCB * add or remove the activate callback list. * ************************************************************************/ static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) { if (setunset) { XtAddCallback (w, XmNactivateCallback, activCB, closure); } else { XtRemoveCallback (w, XmNactivateCallback, activCB, closure); } } /************************************************************************ * * Application Accessible External Functions * ************************************************************************/ /************************************************************************ * * XmCreateDrawnButton * Create an instance of a drawnbutton and return the widget id. * ************************************************************************/ Widget XmCreateDrawnButton( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget (name, xmDrawnButtonWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateDrawnButton( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDrawnButtonWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedDrawnButton( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDrawnButtonWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/ResIndI.h0000644000175000017500000000442112672140200012356 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ResIndI.h /main/5 1995/07/13 17:50:09 drk $ */ #ifndef _XmResIndI_h #define _XmResIndI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for ResInd.c ********/ extern int _XmConvertUnits( Screen *screen, int dimension, register int from_type, register int from_val, register int to_type) ; extern void _XmUnitTypeDefault( Widget widget, int offset, XrmValue *value) ; extern unsigned char _XmGetUnitType( Widget widget) ; extern int _XmConvertFloatUnitsToIntUnits( int unitType, float unitValue, int *intUnitType, float *intUnitValue, int default_from_type) ; extern int _XmConvertStringToUnits( Screen *screen, String spec, int default_from_type, int orientation, int to_type, XtEnum *parse_error); extern void _XmStringDirectionDefault(Widget widget, int offset, XrmValue *value ); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmResIndI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ToggleBG.c0000644000175000017500000041006713145162623012526 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: ToggleBG.c /main/46 1999/12/06 18:10:15 samborn $" #endif #endif #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CacheI.h" #include "ColorI.h" #include "ExtObjectI.h" #include "LabelGI.h" #include "LabelI.h" #include "MenuProcI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "RepTypeI.h" #include "SyntheticI.h" #include "ToggleBGI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #define XmINVALID_TYPE 255 /* special flag for IndicatorType */ #define XmINVALID_BOOLEAN 85 /* special flag for VisibleWhenOff */ #define MIN_GLYPH_SIZE 5 /* Threshold for rendering glyphs. */ #define PixmapOn(w) (TBG_OnPixmap(w)) #define PixmapOff(w) (LabG_Pixmap(w)) #define PixmapInd(w) (TBG_IndeterminatePixmap(w)) #define PixmapInsenOn(w) (TBG_InsenPixmap(w)) #define PixmapInsenOff(w) (LabG_PixmapInsensitive(w)) #define PixmapInsenInd(w) (TBG_IndeterminateInsensitivePixmap(w)) #define IsNull(p) ((p) == XmUNSPECIFIED_PIXMAP) #define IsOn(w) (TBG_VisualSet(w)) #define IsOneOfMany(ind_type) (((ind_type) == XmONE_OF_MANY) || \ ((ind_type) == XmONE_OF_MANY_ROUND) || \ ((ind_type) == XmONE_OF_MANY_DIAMOND)) /* Constants used to decompose XmNindicatorOn values. */ #define XmINDICATOR_BOX_MASK 0x0f #define XmINDICATOR_GLYPH_MASK 0xf0 /* The indicator value should already have been normalized! */ #define DRAW3DBOX(ind_on) ((ind_on) & XmINDICATOR_3D_BOX) #define DRAWFLATBOX(ind_on) ((ind_on) & XmINDICATOR_FLAT_BOX) #define DRAWBOX(ind_on) ((ind_on) & XmINDICATOR_BOX_MASK) #define DRAWCHECK(ind_on) ((ind_on) & XmINDICATOR_CHECK_GLYPH) #define DRAWCROSS(ind_on) ((ind_on) & XmINDICATOR_CROSS_GLYPH) #define DRAWGLYPH(ind_on) ((ind_on) & XmINDICATOR_GLYPH_MASK) /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; int _XmToggleBCacheCompare( XtPointer A, XtPointer B ); static void InputDispatch( Widget wid, XEvent *event, Mask event_mask) ; static void SetAndDisplayPixmap( XmToggleButtonGadget w, XEvent *event, Region region) ; static void Help( XmToggleButtonGadget tb, XEvent *event) ; static void ToggleButtonCallback( XmToggleButtonGadget data, unsigned int reason, unsigned int value, XEvent *event) ; static void Leave( XmToggleButtonGadget w, XEvent *event) ; static void Enter( XmToggleButtonGadget w, XEvent *event) ; static void Arm( Widget w, XEvent *event) ; static void Select( XmToggleButtonGadget tb, XEvent *event) ; static void Disarm( XmToggleButtonGadget tb, XEvent *event) ; static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BtnDown( XmToggleButtonGadget tb, XEvent *event) ; static void BtnUp( XmToggleButtonGadget tb, XEvent *event) ; static void GetGC( XmToggleButtonGadget tw) ; static void GetUnselectGC( XmToggleButtonGadget tw) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static void DrawToggle( XmToggleButtonGadget w) ; static void BorderHighlight( Widget wid) ; static void BorderUnhighlight( Widget wid) ; static void KeySelect( XmToggleButtonGadget tb, XEvent *event) ; static void ComputeSpace( XmToggleButtonGadget tb) ; static void Redisplay( Widget w, XEvent *event, Region region) ; static void Resize( Widget w) ; static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, Cardinal *num_args) ; static Cardinal GetToggleBGClassSecResData( WidgetClass w_class, XmSecondaryResourceData **data_rtn) ; static XtPointer GetToggleBGClassSecResBase( Widget widget, XtPointer client_data) ; static void DrawToggleLabel( XmToggleButtonGadget tb) ; static void DrawEtchedInMenu( XmToggleButtonGadget tb) ; static void DrawToggleShadow( XmToggleButtonGadget tb) ; static void SetToggleSize( XmToggleButtonGadget newtbg) ; static void NextState(unsigned char *state); static void DrawBox( XmToggleButtonGadget w, GC top_gc, GC bot_gc, GC fillgc, int x, int y, int edge, Dimension margin); static Boolean HandleRedraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static Boolean ToggleBGCVTRedraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static void DefaultSelectColor(Widget widget, int offset, XrmValue *value); static void TBG_FixTearoff( XmToggleButtonGadget tb); static unsigned char NormalizeIndOn(XmToggleButtonGadget tb); static unsigned char NormalizeIndType(XmToggleButtonGadget tb); /******** End Static Function Declarations ********/ /*************************************<->************************************* * * * Description: resource list for class: ToggleButton * ----------- * * Provides default resource settings for instances of this class. * To get full set of default settings, examine resouce list of super * classes of this class. * *************************************<->***********************************/ #define Offset(field) XtOffsetOf(XmToggleButtonGadgetRec, field) #define CacheOffset(field) XtOffsetOf(XmToggleButtonGCacheObjRec, field) static XtResource cache_resources[] = { { XmNindicatorSize, XmCIndicatorSize, XmRVerticalDimension, sizeof(Dimension), CacheOffset(toggle_cache.indicator_dim), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNindicatorType, XmCIndicatorType, XmRIndicatorType, sizeof(unsigned char), CacheOffset(toggle_cache.ind_type), XmRImmediate, (XtPointer) XmINVALID_TYPE }, { XmNvisibleWhenOff, XmCVisibleWhenOff, XmRBoolean, sizeof(Boolean), CacheOffset(toggle_cache.visible), XmRImmediate, (XtPointer) XmINVALID_BOOLEAN }, { XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), CacheOffset(toggle_cache.spacing), XmRImmediate, (XtPointer) 4 }, { XmNselectPixmap, XmCSelectPixmap, XmRDynamicPixmap, sizeof(Pixmap), CacheOffset(toggle_cache.on_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNselectInsensitivePixmap, XmCSelectInsensitivePixmap, XmRDynamicPixmap, sizeof(Pixmap), CacheOffset(toggle_cache.insen_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNindicatorOn, XmCIndicatorOn, XmRIndicatorOn, sizeof(unsigned char), CacheOffset(toggle_cache.ind_on), XmRImmediate, (XtPointer) XmINDICATOR_FILL }, { XmNfillOnSelect, XmCFillOnSelect, XmRBoolean, sizeof(Boolean), CacheOffset(toggle_cache.fill_on_select), XmRImmediate, (XtPointer) XmINVALID_BOOLEAN }, { XmNselectColor, XmCSelectColor, XmRSelectColor, sizeof(Pixel), CacheOffset(toggle_cache.select_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNtoggleMode, XmCToggleMode, XmRToggleMode, sizeof(unsigned char), CacheOffset(toggle_cache.toggle_mode), XmRImmediate, (XtPointer) XmTOGGLE_BOOLEAN }, { XmNindeterminatePixmap, XmCIndeterminatePixmap, XmRDynamicPixmap, sizeof(Pixmap), CacheOffset(toggle_cache.indeterminate_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNindeterminateInsensitivePixmap, XmCIndeterminateInsensitivePixmap, XmRDynamicPixmap, sizeof(Pixmap), CacheOffset(toggle_cache.indeterminate_insensitive_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNunselectColor, XmCUnselectColor, XmRPixel, sizeof(Pixel), CacheOffset(toggle_cache.unselect_color), XmRImmediate, (XtPointer) INVALID_PIXEL } }; /************************************************ * The uncached resources for ToggleButton ************************************************/ static XtResource resources[] = { { XmNset, XmCSet, XmRSet, sizeof(unsigned char), Offset(toggle.set), XmRImmediate, (XtPointer) XmUNSET }, { XmNvalueChangedCallback, XmCValueChangedCallback, XmRCallback, sizeof(XtCallbackList), Offset(toggle.value_changed_CB), XmRPointer, (XtPointer)NULL }, { XmNarmCallback, XmCArmCallback, XmRCallback, sizeof(XtCallbackList), Offset(toggle.arm_CB), XmRPointer, (XtPointer)NULL }, { XmNdisarmCallback, XmCDisarmCallback, XmRCallback, sizeof(XtCallbackList), Offset(toggle.disarm_CB), XmRPointer, (XtPointer)NULL }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmGadgetRec, gadget.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(struct _XmGadgetRec, gadget.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNdetailShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), Offset(toggle.detail_shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness } }; /* Resources that need special processing in get/set values. */ static XmSyntheticResource cache_syn_resources[] = { { XmNspacing, sizeof(Dimension), CacheOffset(toggle_cache.spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNindicatorSize, sizeof(Dimension), CacheOffset(toggle_cache.indicator_dim), XmeFromVerticalPixels, XmeToVerticalPixels } }; static XmSyntheticResource syn_resources[] = { { XmNdetailShadowThickness, sizeof(Dimension), XtOffsetOf(XmToggleButtonGadgetRec, toggle.detail_shadow_thickness), XmeFromHorizontalPixels,XmeToHorizontalPixels } }; #undef CacheOffset #undef Offset /***************************************************************** * * Class Record definitions * ****************************************************************/ static XmCacheClassPart ToggleButtonClassCachePart = { { NULL, 0, 0 }, /* head of class cache list */ _XmCacheCopy, /* Copy routine */ _XmCacheDelete, /* Delete routine */ _XmToggleBCacheCompare, /* Comparison routine */ }; static XmBaseClassExtRec ToggleBGClassExtensionRec = { NULL, /* next_extension */ NULLQUARK, /* record_type */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* record_size */ InitializePrehook, /* initializePrehook */ SetValuesPrehook, /* setValuesPrehook */ InitializePosthook, /* initializePosthook */ SetValuesPosthook, /* setValuesPosthook */ (WidgetClass)&xmToggleButtonGCacheObjClassRec, /* secondaryObjectClass */ SecondaryObjectCreate, /* secondaryObjectCreate */ GetToggleBGClassSecResData, /* getSecResData */ { 0 }, /* Other Flags */ GetValuesPrehook, /* getValuesPrehook */ GetValuesPosthook, /* getValuesPosthook */ (XtWidgetClassProc)NULL, /* classPartInitPrehook */ (XtWidgetClassProc)NULL, /* classPartInitPosthook */ NULL, /* ext_resources */ NULL, /* compiled_ext_resources */ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ (XmWrapperData)NULL, /* wrapperData */ }; /* ext rec static initialization */ externaldef(xmtogglebuttongcacheobjclassrec) XmToggleButtonGCacheObjClassRec xmToggleButtonGCacheObjClassRec = { { /* superclass */ (WidgetClass) &xmLabelGCacheObjClassRec, /* class_name */ "XmToggleButtonGadget", /* widget_size */ sizeof(XmToggleButtonGCacheObjRec), /* class_initialize */ (XtProc)NULL, /* chained class init */ (XtWidgetClassProc)NULL, /* class_inited */ False, /* initialize */ (XtInitProc)NULL, /* initialize hook */ (XtArgsProc)NULL, /* realize */ NULL, /* actions */ NULL, /* num_actions */ 0, /* resources */ cache_resources, /* num_resources */ XtNumber(cache_resources), /* xrm_class */ NULLQUARK, /* compress_motion */ False, /* compress_exposure */ False, /* compress enter/exit*/ False, /* visible_interest */ False, /* destroy */ (XtWidgetProc)NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ (XtSetValuesFunc)NULL, /* set values hook */ (XtArgsFunc)NULL, /* set values almost */ NULL, /* get values hook */ (XtArgsProc)NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ NULL, /* query geo proc */ NULL, /* display accelerator*/ NULL, /* extension record */ NULL, }, { /* synthetic resources */ cache_syn_resources, /* num_syn_resources */ XtNumber(cache_syn_resources), /* extension */ NULL, } }; /*************************************<->************************************* * * * Description: global class record for instances of class: ToggleButton * ----------- * * Defines default field settings for this class record. * *************************************<->***********************************/ static XmGadgetClassExtRec _XmToggleBGadClassExtRec = { NULL, /* next_extension */ NULLQUARK, /* record_type */ XmGadgetClassExtVersion, /* version */ sizeof(XmGadgetClassExtRec), /* record_size */ XmInheritBaselineProc, /* widget_baseline */ XmInheritDisplayRectProc, /* widget_display_rect */ XmInheritMarginsProc, /* widget_margins */ }; externaldef(xmtogglebuttongadgetclassrec) XmToggleButtonGadgetClassRec xmToggleButtonGadgetClassRec = { { /* superclass */ (WidgetClass) &xmLabelGadgetClassRec, /* class_name */ "XmToggleButtonGadget", /* widget_size */ sizeof(XmToggleButtonGadgetRec), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ (XtArgsProc)NULL, /* realize */ NULL, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterlv */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ (XtArgsFunc)NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ (XtArgsProc)NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ NULL, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ NULL, /* extension */ (XtPointer)&ToggleBGClassExtensionRec }, { /* gadget class record */ /* border_highlight */ BorderHighlight, /* border_unhighlight */ BorderUnhighlight, /* arm_and_activate */ ArmAndActivate, /* input_dispatch */ InputDispatch, /* visual_change */ XmInheritVisualChange, /* syn resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* extension */ &ToggleButtonClassCachePart, /* extension */ (XtPointer)&_XmToggleBGadClassExtRec }, { /* label class record */ /* SetOverrideCallback */ XmInheritWidgetProc, /* menu proc entry */ XmInheritMenuProc, /* extension */ NULL }, { /* toggle class record */ /* extension */ NULL } }; externaldef(xmtogglebuttongadgetclass) WidgetClass xmToggleButtonGadgetClass = (WidgetClass)&xmToggleButtonGadgetClassRec; /* Menu Savvy trait record */ static XmMenuSavvyTraitRec MenuSavvyRecord = { -1, /* version */ NULL, /* disableCallback */ NULL, /* getAccelerator */ NULL, /* getMnemonic */ _XmCBNameValueChanged /* getActivateCBName */ }; /* Care about parent Visual trait record. */ static XmConst XmCareVisualTraitRec ToggleBGCVT = { 0, /* version */ HandleRedraw /* redraw */ }; /*********************************************************** * * ClassInitialize * ************************************************************/ static void ClassInitialize( void ) { Cardinal wc_num_res, sc_num_res; XtResource *merged_list; int i, j; XtResourceList uncompiled; Cardinal num; /* * Label's and Togglebutton's resource lists are being merged into one * and assigned to xmToggleButtonGCacheObjClassRec. This is for performance * reasons, since, instead of two calls to XtGetSubResources XtGetSubvaluse * and XtSetSubvalues for both the superclass and the widget class, now * we have just one call with a merged resource list. * NOTE: At this point the resource lists for Label and Togglebutton do * have unique entries, but if there are resources in the superclass * that are being overwritten by the subclass then the merged_lists * need to be created differently. */ wc_num_res = xmToggleButtonGCacheObjClassRec.object_class.num_resources; sc_num_res = xmLabelGCacheObjClassRec.object_class.num_resources; merged_list = (XtResource *) XtMalloc((sizeof(XtResource) * (wc_num_res + sc_num_res))); _XmTransformSubResources(xmLabelGCacheObjClassRec.object_class.resources, sc_num_res, &uncompiled, &num); for (i = 0; i < num; i++) merged_list[i] = uncompiled[i]; XtFree((char *)uncompiled); for (i = 0, j = num; i < wc_num_res; i++, j++) merged_list[j] = xmToggleButtonGCacheObjClassRec.object_class.resources[i]; xmToggleButtonGCacheObjClassRec.object_class.resources = merged_list; xmToggleButtonGCacheObjClassRec.object_class.num_resources = wc_num_res + sc_num_res ; ToggleBGClassExtensionRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInitialize * Set up fast subclassing for the gadget. * ***********************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmTOGGLE_BUTTON_GADGET_BIT); /* Install the menu savvy trait record, copying fields from XmLabelG */ _XmLabelGCloneMenuSavvy (wc, &MenuSavvyRecord); /* Install the careParentVisual trait for all subclasses as well. */ XmeTraitSet((XtPointer)(WidgetClass) wc, XmQTcareParentVisual, (XtPointer)&ToggleBGCVT); } /******************************************************************* * * _XmToggleBCacheCompare * *******************************************************************/ int _XmToggleBCacheCompare( XtPointer A, XtPointer B ) { XmToggleButtonGCacheObjPart *toggleB_inst = (XmToggleButtonGCacheObjPart *) A ; XmToggleButtonGCacheObjPart *toggleB_cache_inst = (XmToggleButtonGCacheObjPart *) B ; if ((toggleB_inst->ind_type == toggleB_cache_inst->ind_type) && (toggleB_inst->visible == toggleB_cache_inst->visible) && (toggleB_inst->spacing == toggleB_cache_inst->spacing) && (toggleB_inst->indicator_dim == toggleB_cache_inst->indicator_dim) && (toggleB_inst->on_pixmap == toggleB_cache_inst->on_pixmap) && (toggleB_inst->insen_pixmap == toggleB_cache_inst->insen_pixmap) && (toggleB_inst->ind_on == toggleB_cache_inst->ind_on) && (toggleB_inst->fill_on_select == toggleB_cache_inst->fill_on_select) && (toggleB_inst->select_color == toggleB_cache_inst->select_color) && (toggleB_inst->select_GC == toggleB_cache_inst->select_GC) && (toggleB_inst->unselect_GC == toggleB_cache_inst->unselect_GC) && (toggleB_inst->unselect_color == toggleB_cache_inst->unselect_color) && (toggleB_inst->indeterminate_pixmap == toggleB_cache_inst->indeterminate_pixmap) && (toggleB_inst->indeterminate_insensitive_pixmap == toggleB_cache_inst->indeterminate_insensitive_pixmap) && (toggleB_inst->indeterminate_GC == toggleB_cache_inst->indeterminate_GC) && (toggleB_inst->indeterminate_box_GC == toggleB_cache_inst->indeterminate_box_GC) && (toggleB_inst->toggle_mode == toggleB_cache_inst->toggle_mode) && (toggleB_inst->reversed_select == toggleB_cache_inst->reversed_select) && (toggleB_inst->background_gc == toggleB_cache_inst->background_gc) && (toggleB_inst->ind_left_delta == toggleB_cache_inst->ind_left_delta) && (toggleB_inst->ind_right_delta == toggleB_cache_inst->ind_right_delta) && (toggleB_inst->ind_top_delta == toggleB_cache_inst->ind_top_delta) && (toggleB_inst->ind_bottom_delta == toggleB_cache_inst->ind_bottom_delta)) return 1; else return 0; } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /* ARGSUSED */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *cePtr; XmWidgetExtData extData; WidgetClass wc; Cardinal size; XtPointer newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); wc = (*cePtr)->secondaryObjectClass; size = wc->core_class.widget_size; newSec = _XmExtObjAlloc(size); reqSec = _XmExtObjAlloc(size); _XmProcessUnlock(); /* * Update pointers in instance records now so references to resources * in the cache record will be valid for use in CallProcs. * CallProcs are invoked by XtGetSubresources(). */ LabG_Cache(new_w) = &(((XmLabelGCacheObject)newSec)->label_cache); LabG_Cache(req) = &(((XmLabelGCacheObject)reqSec)->label_cache); TBG_Cache(new_w) = &(((XmToggleButtonGCacheObject)newSec)->toggle_cache); TBG_Cache(req) = &(((XmToggleButtonGCacheObject)reqSec)->toggle_cache); /* * Since the resource lists for label and togglebutton were merged at * ClassInitialize time we need to make only one call to * XtGetSubresources() */ XtGetSubresources(new_w, newSec, NULL, NULL, wc->core_class.resources, wc->core_class.num_resources, args, *num_args ); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; ((XmToggleButtonGCacheObject)newSec)->ext.extensionType = XmCACHE_EXTENSION; ((XmToggleButtonGCacheObject)newSec)->ext.logicalParent = new_w; _XmPushWidgetExtData(new_w, extData, ((XmToggleButtonGCacheObject)newSec)->ext.extensionType); memcpy(reqSec, newSec, size); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /* ARGSUSED */ static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { /* CR 2990: Use XmNbuttonFontList as the default. */ if (LabG_Font(new_w) == NULL) LabG_Font(new_w) = XmeGetDefaultRenderTable (new_w, XmBUTTON_FONTLIST); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /* ARGSUSED */ static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; XmToggleButtonGadget tbw = (XmToggleButtonGadget)new_w; /* * - register parts in cache. * - update cache pointers * - and free req */ _XmProcessLock(); LabG_Cache(tbw) = (XmLabelGCacheObjPart *) _XmCachePart( LabG_ClassCachePart(tbw), (XtPointer) LabG_Cache(tbw), sizeof(XmLabelGCacheObjPart)); TBG_Cache(tbw) = (XmToggleButtonGCacheObjPart *) _XmCachePart( TBG_ClassCachePart(tbw), (XtPointer) TBG_Cache(tbw), sizeof(XmToggleButtonGCacheObjPart)); /* * might want to break up into per-class work that gets explicitly * chained. For right now, each class has to replicate all * superclass logic in hook routine */ /* * free the req subobject used for comparisons */ _XmPopWidgetExtData((Widget) tbw, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); _XmProcessUnlock(); XtFree( (char *) ext); } static Boolean HandleRedraw ( Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag) { Boolean redraw = False; redraw = _XmLabelGCVTRedraw (kid, cur_parent, new_parent, visual_flag); redraw = ToggleBGCVTRedraw (kid, cur_parent, new_parent, visual_flag) || redraw; if (redraw) { XtExposeProc expose; _XmProcessLock(); expose = ((XmToggleButtonGadgetClassRec *) (XtClass(kid)))->rect_class.expose; _XmProcessUnlock(); if (! XtIsRealized(kid)) return redraw; else (* (expose)) ((Widget)kid, NULL, (Region) NULL); } return False; } static Boolean ToggleBGCVTRedraw ( Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag) { XmToggleButtonGadget tw = (XmToggleButtonGadget) kid ; XmManagerWidget mw = (XmManagerWidget) new_parent; XmManagerWidget curmw = (XmManagerWidget) cur_parent; Boolean redraw = False; XmToggleButtonGCacheObjPart oldCopy; /* * For the purposes of backward compatibility the existance of * UnselectColor is obscured here. That is it is made to follow * background. * * Unless of course someone sets it. */ /* Deal with the Evil gadget cache */ _XmProcessLock(); _XmCacheCopy((XtPointer) TBG_Cache(tw), (XtPointer) &oldCopy, sizeof(XmToggleButtonGCacheObjPart)); _XmCacheDelete ((XtPointer) TBG_Cache(tw)); _XmProcessUnlock(); TBG_Cache(tw) = &oldCopy; if ((visual_flag & VisualBackgroundPixel) && (TBG_UnselectColor(tw) == curmw->core.background_pixel)) { XtReleaseGC (XtParent(tw), TBG_UnselectGC(tw)); TBG_UnselectColor(tw) = mw->core.background_pixel; GetUnselectGC(tw); redraw = True; } _XmProcessLock(); TBG_Cache(tw) = (XmToggleButtonGCacheObjPart *) _XmCachePart(TBG_ClassCachePart(tw), (XtPointer) TBG_Cache(tw), sizeof(XmToggleButtonGCacheObjPart)); _XmProcessUnlock(); return redraw ; } /************************************************************************ * * InputDispatch * This function catches input sent by a manager and dispatches it * to the individual routines. * ************************************************************************/ static void InputDispatch( Widget wid, XEvent *event, Mask event_mask ) { XmToggleButtonGadget tb = (XmToggleButtonGadget) wid ; if (event_mask & XmARM_EVENT) { if (LabG_IsMenupane(tb)) BtnDown(tb, event); else Arm ((Widget) tb, event); } /* BEGIN OSF Fix pir 2097 */ else if (event_mask & XmMULTI_ARM_EVENT) { if (! LabG_IsMenupane(tb)) { Arm ((Widget) tb, event); } } /* END OSF Fix pir 2097 */ else if (event_mask & XmACTIVATE_EVENT) { if (LabG_IsMenupane(tb)) { if (event->type == ButtonRelease) BtnUp(tb, event); else /* Assume KeyPress or KeyRelease */ KeySelect (tb, event); } else { Select(tb, event); Disarm (tb, event); } } /* BEGIN OSF Fix pir 2097 */ else if (event_mask & XmMULTI_ACTIVATE_EVENT) { if (! LabG_IsMenupane(tb)) { Select(tb, event); Disarm (tb, event); } } /* END OSF Fix pir 2097 */ else if (event_mask & XmHELP_EVENT) Help (tb, event); else if (event_mask & XmENTER_EVENT) Enter (tb, event); else if (event_mask & XmLEAVE_EVENT) Leave (tb, event); else if (event_mask & XmFOCUS_IN_EVENT) (*(((XmToggleButtonGadgetClass) XtClass( tb)) ->gadget_class.border_highlight))( (Widget) tb) ; else if (event_mask & XmFOCUS_OUT_EVENT) (*(((XmToggleButtonGadgetClass) XtClass( tb)) ->gadget_class.border_unhighlight)) ( (Widget) tb) ; else if (event_mask & XmBDRAG_EVENT) _XmProcessDrag ((Widget) tb, event, NULL, NULL); } /********************************************************************* * * redisplayPixmap * does the apropriate calculations based on the toggle button's * current pixmap and calls label's Redisplay routine. * * This routine was added to fix CR 4839 and CR 4838 * D. Rand 7/6/92 * ***********************************************************************/ static void redisplayPixmap(XmToggleButtonGadget tb, XEvent *event, Region region) { Pixmap todo; unsigned int onH = 0, onW = 0; int w, h; int x, y, offset; XRectangle saved_Text; LRectangle background_box; memcpy(&saved_Text, &LabG_TextRect(tb), sizeof(XRectangle)); offset = tb->gadget.highlight_thickness + tb->gadget.shadow_thickness; x = offset + LabG_MarginWidth(tb) + LabG_MarginLeft(tb); y = offset + LabG_MarginHeight(tb) + LabG_MarginTop(tb); w = tb->rectangle.width - x - offset - LabG_MarginRight(tb) - LabG_MarginWidth(tb); ASSIGN_MAX(w, 0); h = tb->rectangle.height - y - offset - LabG_MarginBottom(tb) - LabG_MarginHeight(tb); ASSIGN_MAX(h, 0); x += tb->rectangle.x; y += tb->rectangle.y; /* CR 6023: As of release 2.0 the LabelG will clear it's own background. */ background_box.x = x; background_box.y = y; background_box.width = w; background_box.height = h; /* CR 7041: ... but not when label.fill_bg_box is False! */ if (!tb->label.fill_bg_box) XClearArea(XtDisplay(tb), XtWindow(tb), x, y, w, h, False); todo = tb->label.pixmap; if ((! XtIsSensitive((Widget) tb)) && tb->label.pixmap_insen) todo = tb->label.pixmap_insen; if (! IsNull(todo)) XmeGetPixmapData(XtScreen(tb), todo, NULL, NULL, NULL, NULL, NULL, NULL, &onW, &onH); h = (tb->rectangle.height - onH) / 2 ; LabG_TextRect_y(tb) = MAX(h, 0); LabG_TextRect_height(tb) = onH; LabG_TextRect_width(tb) = onW; _XmRedisplayLabG ((Widget) tb, event, region, &background_box); memcpy(&LabG_TextRect(tb), &saved_Text, sizeof(XRectangle)); } static void HandlePixmap(XmToggleButtonGadget tb, Pixmap pix, Pixmap insen_pix, XEvent * event, Region region) { if (XtIsSensitive((Widget) tb)) { if (! IsNull (pix)) { Pixmap tempPix = LabG_Pixmap(tb); LabG_Pixmap(tb) = pix; redisplayPixmap(tb, event, region); LabG_Pixmap(tb) = tempPix; } else redisplayPixmap(tb, event, region); } else { if (! IsNull (insen_pix)) { Pixmap tempPix = LabG_PixmapInsensitive(tb); LabG_PixmapInsensitive(tb) = insen_pix; redisplayPixmap(tb, event, region); LabG_PixmapInsensitive(tb) = tempPix; } else redisplayPixmap(tb, event, region); } } /*********************************************************************** * * SetAndDisplayPixmap * Sets the appropriate on, off pixmap in label's pixmap field and * calls label's Redisplay routine. * ***********************************************************************/ static void SetAndDisplayPixmap( XmToggleButtonGadget w, XEvent *event, Region region ) { XmToggleButtonGadget tb = (XmToggleButtonGadget) w ; if (TBG_ToggleMode(tb) == XmTOGGLE_INDETERMINATE) { if (TBG_VisualSet(tb) == XmUNSET) HandlePixmap(tb, PixmapOff(tb), PixmapInsenOff(tb), event, region); else if (TBG_VisualSet(tb) == XmSET) HandlePixmap(tb, PixmapOn(tb), PixmapInsenOn(tb), event, region); else if (TBG_VisualSet(tb) == XmINDETERMINATE) HandlePixmap(tb, PixmapInd(tb), PixmapInsenInd(tb), event, region); } else { if (IsOn (tb) == XmSET) HandlePixmap(tb, PixmapOn(tb), PixmapInsenOn(tb), event, region); else redisplayPixmap(tb, event, region); } } /************************************************************************* * * Help * This routine is called if the user has made a help selection * on the gadget. * ************************************************************************/ static void Help( XmToggleButtonGadget tb, XEvent *event ) { Boolean is_menupane = LabG_IsMenupane(tb); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (is_menupane && menuSTrait != NULL) menuSTrait->buttonPopdown(XtParent(tb), event); ToggleButtonCallback(tb, XmCR_HELP, TBG_Set(tb), event); if (is_menupane && menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(tb), event); } /************************************************************************* * * ToggleButtonCallback * This is the widget's application callback routine * *************************************************************************/ static void ToggleButtonCallback( XmToggleButtonGadget data, unsigned int reason, unsigned int value, XEvent *event ) { XmToggleButtonCallbackStruct temp; temp.reason = reason; temp.set = value; temp.event = event; switch (reason) { case XmCR_VALUE_CHANGED: XtCallCallbackList ((Widget) data, TBG_ValueChangedCB(data), &temp); break; case XmCR_ARM: XtCallCallbackList ((Widget) data, TBG_ArmCB(data), &temp); break; case XmCR_DISARM: XtCallCallbackList ((Widget) data, TBG_DisarmCB(data), &temp); break; case XmCR_HELP: _XmSocorro( (Widget) data, event, NULL, NULL); break; } } static void NextState( unsigned char *state) { switch(*state) { case XmUNSET: *state = XmSET; break; case XmSET: *state = XmINDETERMINATE; break; case XmINDETERMINATE: *state = XmUNSET; break; } } /* Update the toggle after an Enter or Leave action. */ static void ActionDraw(XmToggleButtonGadget w, XEvent *event, Boolean leave) { if (TBG_Armed(w)) { /* CR 7301: We may have armed while outside the toggle. */ if (leave) TBG_VisualSet(w) = TBG_Set(w); else if (TBG_ToggleMode(w) == XmTOGGLE_INDETERMINATE) NextState(&TBG_VisualSet(w)); else IsOn(w) = !TBG_Set(w); if (TBG_IndOn(w)) DrawToggle(w); else { if (w->gadget.shadow_thickness > 0) DrawToggleShadow(w); if (TBG_FillOnSelect(w) && !LabG_IsPixmap(w)) DrawToggleLabel(w); } if (LabG_IsPixmap(w) || LabG_IsPixmapAndText(w)) SetAndDisplayPixmap(w, event, NULL); } } /************************************************************************** * * Leave * This procedure is called when the mouse button is pressed and the * cursor moves out of the widget's window. This procedure is used * to change the visuals. * *************************************************************************/ static void Leave( XmToggleButtonGadget w, XEvent *event ) { if (LabG_IsMenupane(w)) { if (_XmGetInDragMode((Widget)w) && TBG_Armed(w)) { XmDisplay dpy; Boolean etched_in; dpy = (XmDisplay) XmGetXmDisplay(XtDisplayOfObject((Widget) w)); etched_in = dpy->display.enable_etched_in_menu; ((XmManagerWidget) XtParent(w))->manager.active_child = NULL; TBG_Armed(w) = FALSE; if ((etched_in) && (TBG_IndOn(w) || (!(TBG_IndOn(w)) && !(TBG_FillOnSelect(w))))) { DrawEtchedInMenu(w); if (TBG_IndOn(w)) DrawToggle(w); } XmeDrawHighlight(XtDisplay(w), XtWindow(w), LabG_BackgroundGC(w), w->rectangle.x + w->gadget.highlight_thickness, w->rectangle .y + w->gadget.highlight_thickness, w->rectangle.width - 2 * w->gadget.highlight_thickness, w->rectangle.height - 2 * w->gadget.highlight_thickness, w->gadget.shadow_thickness); if (TBG_DisarmCB(w)) { XFlush (XtDisplay (w)); ToggleButtonCallback(w, XmCR_DISARM, TBG_Set(w), event); } } } else { _XmLeaveGadget( (Widget) w, event, NULL, NULL); ActionDraw(w, event, TRUE); } } /************************************************************************** * * Enter * This procedure is called when the mouse button is pressed and the * cursor reenters the widget's window. This procedure changes the visuals * accordingly. * **************************************************************************/ static void Enter( XmToggleButtonGadget w, XEvent *event ) { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) w)); Boolean etched_in = xm_dpy->display.enable_etched_in_menu; if (LabG_IsMenupane(w)) { if ((((ShellWidget) XtParent(XtParent(w)))->shell.popped_up) && _XmGetInDragMode((Widget)w)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) w)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (TBG_Armed(w)) return; /* So KHelp event is delivered correctly */ _XmSetFocusFlag( XtParent(XtParent(w)), XmFOCUS_IGNORE, TRUE); XtSetKeyboardFocus(XtParent(XtParent(w)), (Widget)w); _XmSetFocusFlag( XtParent(XtParent(w)), XmFOCUS_IGNORE, FALSE); ((XmManagerWidget) XtParent(w))->manager.active_child = (Widget) w; TBG_Armed(w) = TRUE; if ((etched_in) && (TBG_IndOn(w) || (!(TBG_IndOn(w)) && !(TBG_FillOnSelect(w))))) { DrawEtchedInMenu(w); if (TBG_IndOn(w)) DrawToggle(w); } XmeDrawShadows (XtDisplay (w), XtWindow (w), LabG_TopShadowGC(w), LabG_BottomShadowGC(w), w->rectangle.x + w->gadget.highlight_thickness, w->rectangle.y + w->gadget.highlight_thickness, w->rectangle.width - 2 * w->gadget.highlight_thickness, w->rectangle.height - 2 * w->gadget.highlight_thickness, w->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (TBG_ArmCB(w)) { XFlush (XtDisplay (w)); ToggleButtonCallback(w, XmCR_ARM, TBG_Set(w), event); } } } else { _XmEnterGadget( (Widget) w, event, NULL, NULL); ActionDraw(w, event, FALSE); } } /************************************************************************ * * Arm * This function processes button 1 down occuring on the togglebutton. * Mark the togglebutton as armed and display it armed. * The callbacks for XmNarmCallback are called. * ************************************************************************/ static void Arm( Widget w, XEvent *event ) { XmToggleButtonGadget tb = (XmToggleButtonGadget)w; if (TBG_ToggleMode(tb) == XmTOGGLE_INDETERMINATE) { NextState(&TBG_VisualSet(tb)); TBG_Armed(tb) = TRUE; } else { IsOn(tb) = (TBG_Set(tb) == XmSET) ? XmUNSET : XmSET; TBG_Armed(tb) = TRUE; } if (TBG_IndOn(tb)) DrawToggle((XmToggleButtonGadget) w); else { if (tb->gadget.shadow_thickness> 0) DrawToggleShadow (tb); if (TBG_FillOnSelect(w) && !LabG_IsPixmap(w)) DrawToggleLabel (tb); } if (LabG_IsPixmap(tb) || LabG_IsPixmapAndText(tb)) SetAndDisplayPixmap(tb, event, NULL); if (TBG_ArmCB(tb)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_ARM, TBG_Set(tb), event); } } /************************************************************************ * * Select * Mark the togglebutton as unarmed (i.e. inactive). * If the button release occurs inside of the ToggleButton, the * callbacks for XmNvalueChangedCallback are called. * ************************************************************************/ static void Select( XmToggleButtonGadget tb, XEvent *event ) { XmToggleButtonCallbackStruct call_value; Boolean hit; XmMenuSystemTrait menuSTrait; Boolean radio = TRUE, always = TRUE; if ( TBG_Armed(tb) == FALSE) return; TBG_Armed(tb) = FALSE; if (XmIsRowColumn(XtParent(tb))) { XtVaGetValues(XtParent(tb), XmNradioBehavior, &radio, XmNradioAlwaysOne, &always, NULL); } /* CR 8068: Verify that this is in fact a button event. */ /* CR 9181: Consider clipping when testing visibility. */ hit = (((event->xany.type == ButtonPress) || (event->xany.type == ButtonRelease)) && _XmGetPointVisibility((Widget) tb, event->xbutton.x_root, event->xbutton.y_root)); if (hit) { if (TBG_ToggleMode(tb) == XmTOGGLE_INDETERMINATE) NextState(&TBG_Set(tb)); else TBG_Set(tb) = !TBG_Set(tb); } /* CR 7803: Suppress redundant redraws. */ if (tb->toggle.set != tb->toggle.visual_set) { XtExposeProc expose; _XmProcessLock(); expose = ((XmToggleButtonGadgetClassRec *)(tb->object.widget_class))-> rect_class.expose; _XmProcessUnlock(); /* Redisplay after changing state. */ (* (expose)) ((Widget) tb, event, (Region) NULL); } if (hit) { /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait != NULL) { call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = TBG_Set(tb); menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); } if ((! LabG_SkipCallback(tb)) && (TBG_ValueChangedCB(tb))) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, TBG_Set(tb), event); } } } /********************************************************************** * * Disarm * The callbacks for XmNdisarmCallback are called.. * ************************************************************************/ static void Disarm( XmToggleButtonGadget tb, XEvent *event ) { if (TBG_DisarmCB(tb)) ToggleButtonCallback(tb, XmCR_DISARM, TBG_Set(tb), event); if (tb->toggle.set != tb->toggle.visual_set) { tb->toggle.visual_set = tb->toggle.set; Redisplay((Widget) tb, event, (Region) NULL); } } static void TBG_FixTearoff( XmToggleButtonGadget tb) { if (XmMENU_PULLDOWN == LabG_MenuType(tb)) { Widget mwid = XmGetPostedFromWidget(XtParent(tb)); if (mwid && XmIsRowColumn(mwid) && (XmMENU_OPTION == RC_Type(mwid)) && _XmIsActiveTearOff(XtParent(tb))) XmProcessTraversal((Widget) tb, XmTRAVERSE_CURRENT); } } /************************************************************************ * * ArmAndActivate * This routine arms and activates a ToggleButton. It is called on * Return and a Space, as well as when a mnemonic or * button accelerator has been activated. * Modify: Current implementation does care to draw shadows if indicator * is set to false; This is being modified. ************************************************************************/ /*ARGSUSED*/ static void ArmAndActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmToggleButtonGadget tb = (XmToggleButtonGadget) wid ; XmToggleButtonCallbackStruct call_value; Boolean already_armed = TBG_Armed(tb); Boolean is_menupane = LabG_IsMenupane(tb); Boolean torn_has_focus = FALSE; XmMenuSystemTrait menuSTrait; Boolean radio = TRUE, always = TRUE, no_change; if (XmIsRowColumn(XtParent(tb))) { XtVaGetValues(XtParent(tb), XmNradioBehavior, &radio, XmNradioAlwaysOne, &always, NULL); } no_change = False; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (is_menupane && !XmIsMenuShell(XtParent(XtParent(tb))) && menuSTrait != NULL) { if (XmeFocusIsInShell((Widget)tb)) { /* In case allowAcceleratedInsensitiveUnmanagedMenuItems is True */ if (!XtIsSensitive((Widget)tb) || (!XtIsManaged((Widget)tb))) return; torn_has_focus = TRUE; } } TBG_Armed(tb) = FALSE; if (!no_change) { if (TBG_ToggleMode(tb) == XmTOGGLE_INDETERMINATE) { NextState(&TBG_VisualSet(tb)); NextState(&TBG_Set(tb)); } else { TBG_Set(tb) = (TBG_Set(tb) == TRUE) ? FALSE : TRUE; IsOn(tb) = TBG_Set(tb); } } if (is_menupane && menuSTrait != NULL) { /* CR 7799: Torn off menus shouldn't be shared, so don't reparent. */ if (torn_has_focus) menuSTrait->popdown(XtParent(tb), event); else menuSTrait->buttonPopdown(XtParent(tb), event); if (torn_has_focus) XmProcessTraversal((Widget) tb, XmTRAVERSE_CURRENT); /* Draw the toggle indicator in case of tear off */ if (TBG_IndOn(tb)) DrawToggle(tb); else if (TBG_FillOnSelect(tb) && !LabG_IsPixmap(tb)) DrawToggleLabel (tb); if (LabG_IsPixmap(tb) || LabG_IsPixmapAndText(tb)) SetAndDisplayPixmap(tb, NULL, NULL); } else { if (TBG_IndOn(tb)) DrawToggle(tb); else { if (tb->gadget.shadow_thickness> 0) DrawToggleShadow (tb); if (TBG_FillOnSelect(tb) && !LabG_IsPixmap(tb)) DrawToggleLabel (tb); } if (LabG_IsPixmap(tb) || LabG_IsPixmapAndText(tb)) SetAndDisplayPixmap(tb, event, NULL); } /* If the parent is menu system able, set the lastSelectToplevel before * the arm. It's ok if this is recalled later. */ if (menuSTrait != NULL) menuSTrait->getLastSelectToplevel(XtParent(tb)); if (TBG_ArmCB(tb) && !already_armed) ToggleButtonCallback(tb, XmCR_ARM, TBG_Set(tb), event); if (!no_change) { /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) { call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = TBG_Set(tb); menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); } if ((! LabG_SkipCallback(tb)) && (TBG_ValueChangedCB(tb))) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, TBG_Set(tb), event); } } if (TBG_DisarmCB(tb)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_DISARM, TBG_Set(tb), event); } if (is_menupane && menuSTrait != NULL) { if (torn_has_focus && XtIsSensitive(wid)) { TBG_Armed(tb) = TRUE; if (TBG_ArmCB(tb)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_ARM, TBG_Set(tb), event); } } else { menuSTrait->reparentToTearOffShell(XtParent(tb), event); TBG_FixTearoff(tb); } } } /************************************************************************ * * BtnDown * This function processes a button down occuring on the togglebutton * when it is in a popup, pulldown, or option menu. * Popdown the posted menu. * Turn parent's traversal off. * Mark the togglebutton as armed (i.e. active). * The callbacks for XmNarmCallback are called. * ************************************************************************/ static void BtnDown( XmToggleButtonGadget tb, XEvent *event ) { Boolean already_armed; ShellWidget popup; XmMenuSystemTrait menuSTrait; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(tb)); Boolean etched_in = dpy->display.enable_etched_in_menu; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait == NULL) return; _XmSetInDragMode((Widget)tb, True); /* Popdown other popups that may be up */ if (!(popup = (ShellWidget)_XmGetRC_PopupPosted(XtParent(tb)))) { if (!XmIsMenuShell(XtParent(XtParent(tb)))) { /* In case tear off not armed and no grabs in place, do it now. * Ok if already armed and grabbed - nothing done. */ menuSTrait->tearOffArm(XtParent(tb)); } } if (popup) { if (popup->shell.popped_up) menuSTrait->popdownEveryone((Widget) popup, event); } /* Set focus to this button. This must follow the possible * unhighlighting of the CascadeButton else it'll screw up active_child. */ (void)XmProcessTraversal( (Widget) tb, XmTRAVERSE_CURRENT); /* get the location cursor - get consistent with Gadgets */ already_armed = TBG_Armed(tb); TBG_Armed(tb) = TRUE; if ((etched_in) && (TBG_IndOn(tb) || (!(TBG_IndOn(tb)) && !(TBG_FillOnSelect(tb))))) { DrawEtchedInMenu(tb); if (TBG_IndOn(tb)) DrawToggle(tb); } XmeDrawShadows (XtDisplay (tb), XtWindow (tb), LabG_TopShadowGC(tb), LabG_BottomShadowGC(tb), tb->rectangle.x + tb->gadget.highlight_thickness, tb->rectangle.y + tb->gadget.highlight_thickness, tb->rectangle.width - 2 * tb->gadget.highlight_thickness, tb->rectangle.height - 2 * tb->gadget.highlight_thickness, tb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (TBG_ArmCB(tb) && !already_armed) { XFlush (XtDisplay (tb)); ToggleButtonCallback(tb, XmCR_ARM, TBG_Set(tb), event); } _XmRecordEvent (event); } /************************************************************************ * * BtnUp * This function processes a button up occuring on the togglebutton * when it is in a popup, pulldown, or option menu. * Mark the togglebutton as unarmed (i.e. inactive). * The callbacks for XmNvalueChangedCallback are called. * The callbacks for XmNdisarmCallback are called. * ************************************************************************/ static void BtnUp( XmToggleButtonGadget tb, XEvent *event ) { XmToggleButtonCallbackStruct call_value; Boolean popped_up; Boolean valid_event; Boolean is_menupane = LabG_IsMenupane(tb); Widget shell = XtParent(XtParent(tb)); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait == NULL) return; TBG_Armed(tb) = FALSE; /* We need to validate the event in case the XmMENU_POPDOWN restores the * submenu to the transient shell. The tear off control becomes unmanaged * and the submenu's (and menu item children) layout/geometry changes. */ /* CR 9181: Consider clipping when testing visibility. */ valid_event = (((event->xany.type == ButtonPress) || (event->xany.type == ButtonRelease)) && _XmGetPointVisibility((Widget)tb, event->xbutton.x_root, event->xbutton.y_root)); if (is_menupane && !XmIsMenuShell(shell)) popped_up = menuSTrait->popdown((Widget) tb, event); else popped_up = menuSTrait->buttonPopdown((Widget) tb, event); _XmRecordEvent(event); if (popped_up) return; if (valid_event) { if (TBG_ToggleMode(tb) == XmTOGGLE_INDETERMINATE) { NextState(&TBG_VisualSet(tb)); NextState(&TBG_Set(tb)); } else { TBG_Set(tb) = (TBG_Set(tb) == TRUE) ? FALSE : TRUE; IsOn(tb) = TBG_Set(tb); } /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ /* notify the parent about the select */ call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = TBG_Set(tb); menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); if ((! LabG_SkipCallback(tb)) && (TBG_ValueChangedCB(tb))) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, TBG_Set(tb), event); } if (TBG_DisarmCB(tb)) ToggleButtonCallback(tb, XmCR_DISARM, TBG_Set(tb), event); /* If the original shell does not indicate an active menu, but rather a * tear off pane, leave the button in an armed state. */ if (!XmIsMenuShell(shell)) { if (XtIsSensitive((Widget)tb)) { TBG_Armed(tb) = TRUE; if (TBG_IndOn(tb)) DrawToggle(tb); else if (TBG_FillOnSelect(tb) && !LabG_IsPixmap(tb)) DrawToggleLabel (tb); if (LabG_IsPixmap(tb) || LabG_IsPixmapAndText(tb)) SetAndDisplayPixmap( tb, event, NULL); if (TBG_ArmCB(tb)) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_ARM, TBG_Set(tb), event); } } } else menuSTrait->reparentToTearOffShell(XtParent(tb), event); } _XmSetInDragMode((Widget)tb, False); /* For the benefit of tear off menus, we must set the focus item * to this button. In normal menus, this would not be a problem * because the focus is cleared when the menu is unposted. */ if (!XmIsMenuShell(shell)) XmProcessTraversal((Widget) tb, XmTRAVERSE_CURRENT); TBG_FixTearoff(tb); } /************************************************************************ * * GetUnselectGC * Get the graphics context to be used to fill the interior of * a square or diamond when unselected. * ************************************************************************/ static void GetUnselectGC( XmToggleButtonGadget tw ) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground | GCFillStyle | GCGraphicsExposures; values.foreground = TBG_UnselectColor(tw); values.background = LabG_Background(tw); values.fill_style = FillSolid; values.graphics_exposures = FALSE; TBG_UnselectGC(tw) = XtGetGC((Widget) tw, valueMask, &values); } /************************************************************************ * * GetGC * Get the graphics context to be used to fill the interior of * a square or diamond when selected, and the arm GC used in a * menu if enableEtchedInMenu is True. * ************************************************************************/ static void GetGC( XmToggleButtonGadget tw ) { XmManagerWidget mw = (XmManagerWidget) XtParent(tw); XGCValues values; XtGCMask valueMask; XFontStruct *fs = (XFontStruct *) NULL; Pixel sel_color, select_pixel; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) tw)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* Differentiate background and select colors on monochrome displays or ** others on which we have indistinguishable colors. */ if ((DefaultDepthOfScreen (XtScreen (tw)) == 1) || (LabG_Background(tw) == TBG_SelectColor(tw))) sel_color = LabG_Foreground(tw); else sel_color = TBG_SelectColor(tw); valueMask = 0; valueMask |= GCForeground, values.foreground = sel_color; valueMask |= GCBackground, values.background = LabG_Background(tw); valueMask |= GCFillStyle, values.fill_style = FillSolid; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; TBG_SelectGC(tw) = XtAllocateGC((Widget) mw, 0, valueMask, &values, 0, 0); /* When foreground and select colors coincide, this GC is used * by XmLabel to draw the text. It requires a font to pacify * the XmString draw functions. */ valueMask = 0; if (XmeRenderTableGetDefaultFont(LabG_Font(tw), &fs)) valueMask |= GCFont, values.font = fs->fid; valueMask |= GCForeground, values.foreground = LabG_Background(tw); valueMask |= GCBackground, values.background = LabG_Foreground(tw); valueMask |= GCFillStyle, values.fill_style = FillSolid; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; valueMask |= GCLineWidth, values.line_width = 1; TBG_BackgroundGC(tw) = XtGetGC((Widget) mw, valueMask, &values); valueMask = 0; valueMask |= GCFillStyle, values.fill_style = FillOpaqueStippled; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; valueMask |= GCStipple, values.stipple = XmGetPixmapByDepth(XtScreen((Widget)(tw)), XmS50_foreground, 1, 0, 1); valueMask |= GCLineWidth, values.line_width = 1; TBG_IndeterminateGC(tw) = XtAllocateGC((Widget) tw, 0, valueMask, &values, GCForeground | GCBackground, 0); /* The valueMask and values are inherited from above. */ valueMask &= ~GCLineWidth; valueMask |= GCForeground, values.foreground = LabG_Background(tw); valueMask |= GCBackground, values.background = LabG_Foreground(tw); TBG_IndeterminateBoxGC(tw) = XtGetGC((Widget) tw, valueMask, &values); /* Create the ArmGC for filling in background if we are in a menu and enableEtchedInMenu is True. */ if ((LabG_IsMenupane(tw)) && etched_in) { Widget wid = (Widget) XtParent(tw); XmGetColors(XtScreen(wid), wid->core.colormap, wid->core.background_pixel, NULL, NULL, NULL, &select_pixel); valueMask = 0; valueMask |= GCForeground, values.foreground = select_pixel; valueMask |= GCBackground, values.background = LabG_Foreground(tw); if (fs != NULL) valueMask |= GCFont, values.font = fs->fid; valueMask |= GCGraphicsExposures, values.graphics_exposures = FALSE; TBG_ArmGC(tw) = XtGetGC((Widget) tw, valueMask, &values); } } /*************************************<->************************************* * * Initialize * If the rectangle height and width fields are set to 0, treat that as a * flag, and compute the optimum size for this button. Then using what ever * the rectangle fields are set to, compute the text placement fields. *************************************<->***********************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmToggleButtonGadget request = (XmToggleButtonGadget) rw ; XmToggleButtonGadget new_w = (XmToggleButtonGadget) nw ; XtWidgetProc resize; TBG_Armed(new_w) = FALSE; /* if menuProcs is not set up yet, try again */ _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; if (xmLabelGadgetClassRec.label_class.menuProcs == (XmMenuProc)NULL) xmLabelGadgetClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); _XmProcessUnlock(); if (LabG_IsMenupane(new_w)) { /* If the shadow thickness hasn't been set yet, inherit it from the menu parent, instead of a hard-coded 2, as before. The only draw back is that is the parent has also 0, then the toggle shadow is 0, which is not very good in a menu, but at least consistent with the other buttons */ if (new_w->gadget.shadow_thickness <= 0) { Dimension parent_st ; XtVaGetValues(XtParent(nw), XmNshadowThickness, &parent_st, NULL); new_w->gadget.shadow_thickness = parent_st; } if (TBG_Visible(new_w) == XmINVALID_BOOLEAN) TBG_Visible(new_w) = FALSE; new_w->gadget.traversal_on = TRUE; } else { if (TBG_Visible(new_w) == XmINVALID_BOOLEAN) TBG_Visible(new_w) = TRUE; } /* * if the indicatorType has not been set, then * find out if radio behavior is set for RowColumn parents and * then set indicatorType. If radio behavior is true, default to * one of many, else default to n of many. */ if ((TBG_IndType( new_w) == XmINVALID_TYPE) || !XmRepTypeValidValue(XmRID_INDICATOR_TYPE, TBG_IndType( new_w), (Widget) new_w)) { Boolean radio = FALSE; if (XmIsRowColumn(XtParent(new_w))) { XtVaGetValues(XtParent(new_w), XmNradioBehavior, &radio, NULL); } if (radio) TBG_IndType(new_w) = XmONE_OF_MANY; else TBG_IndType(new_w) = XmN_OF_MANY; } /* * This resource defaults to true if an indicator box is drawn. */ if (TBG_FillOnSelect(new_w) == XmINVALID_BOOLEAN) { if (DRAWBOX(NormalizeIndOn(new_w))) TBG_FillOnSelect(new_w) = True; else if (IsOneOfMany(TBG_IndType(new_w)) && TBG_IndOn(new_w)) TBG_FillOnSelect(new_w) = True; else TBG_FillOnSelect(new_w) = False; } /* Tristate buttons ain't allowed in one-of-many land. */ if (IsOneOfMany(TBG_IndType(new_w))) TBG_ToggleMode(new_w) = XmTOGGLE_BOOLEAN; /* Use the On pixmaps if there are no indeterminate pixmaps. */ if (IsNull(PixmapInd(new_w)) && !IsNull(PixmapOn(new_w))) PixmapInd(new_w) = PixmapOn(new_w); if (IsNull(PixmapInsenInd(new_w)) && !IsNull(PixmapInsenOn(new_w))) PixmapInsenInd(new_w) = PixmapInsenOn(new_w); /* Use the On pixmap if no Off pixmap is available. */ if (IsNull(PixmapOff(new_w)) && !IsNull(PixmapOn(new_w))) { PixmapOff(new_w) = PixmapOn(new_w); if (request->rectangle.width == 0) new_w->rectangle.width = 0; if (request->rectangle.height == 0) new_w->rectangle.height = 0; _XmCalcLabelGDimensions(nw); (* resize)( (Widget) new_w); } /* Use the insensitive On pixmap if there is no insensitive Off pixmap. */ if (IsNull(PixmapInsenOff(new_w)) && !IsNull(PixmapInsenOn(new_w))) { PixmapInsenOff(new_w) = PixmapInsenOn(new_w); if (request->rectangle.width == 0) new_w->rectangle.width = 0; if (request->rectangle.height == 0) new_w->rectangle.height = 0; _XmCalcLabelGDimensions(nw); (* resize)( (Widget) new_w); } /* BEGIN OSF Fix pir 1778 */ if (LabG_IsPixmap(new_w) && (!IsNull(PixmapOff(new_w)) || !IsNull(PixmapInsenOff(new_w)) || !IsNull(PixmapOn(new_w)) || !IsNull(PixmapInsenOn(new_w)) || !IsNull(PixmapInd(new_w)) || !IsNull(PixmapInsenInd(new_w)))) { if (request->rectangle.width == 0) new_w->rectangle.width = 0; if (request->rectangle.height == 0) new_w->rectangle.height = 0; SetToggleSize(new_w); } /* END OSF Fix pir 1778 */ if (TBG_IndicatorDim(new_w) == XmINVALID_DIMENSION) { if (TBG_IndOn(new_w)) { /* Determine how high the toggle indicator should be. */ if (LabG_IsPixmap(new_w) || LabG_IsPixmapAndText(new_w)) { /* Set indicatorSize proportional to size of pixmap. */ if (!IsNull(PixmapOff(new_w)) || !IsNull(PixmapInsenOff(new_w)) || !IsNull(PixmapOn(new_w)) || !IsNull(PixmapInsenOn(new_w)) || !IsNull(PixmapInd(new_w)) || !IsNull(PixmapInsenInd(new_w))) if (LabG_TextRect(new_w).height < 13) TBG_IndicatorDim(new_w) = LabG_TextRect(new_w).height; else TBG_IndicatorDim(new_w) = 13 + (LabG_TextRect(new_w).height/13); else TBG_IndicatorDim(new_w) = XmDEFAULT_INDICATOR_DIM; } else /* Set indicatorSize proportional to size of font. */ { Dimension height; int line_count; height = XmStringHeight (LabG_Font(new_w), LabG__label(new_w)); if ((line_count = XmStringLineCount (LabG__label(new_w))) < 1) line_count = 1; /* Shiz recommends toggles in menus have smaller indicators */ if (LabG_IsMenupane(new_w)) TBG_IndicatorDim(new_w) = MAX(XmDEFAULT_INDICATOR_DIM, (height / ((Dimension)line_count)) * 2/3); else TBG_IndicatorDim(new_w) = MAX(XmDEFAULT_INDICATOR_DIM, height / ((Dimension)line_count)); } } else { TBG_IndicatorDim(new_w) = 0; } TBG_IndicatorSet(new_w) = FALSE; } else { TBG_IndicatorSet(new_w) = TRUE; } /* CR 2337: Maintain original margin values. */ TBG_IndLeftDelta(new_w) = 0; TBG_IndRightDelta(new_w) = 0; TBG_IndTopDelta(new_w) = 0; TBG_IndBottomDelta(new_w) = 0; if (TBG_IndOn(new_w)) { /* * Enlarge the text rectangle if needed to accomodate the size of * indicator button. Adjust the dimensions of superclass Label-Gadget * so that the toggle-button may be accommodated in it. */ int maxIndicatorSize; /* Max Indicator size permissible */ int delta; int boxSize; /* BEGIN OSF Fix pir 2480 */ if (! LabG_IsMenupane(new_w)) maxIndicatorSize = TBG_IndicatorDim(new_w) + 2 * Xm3D_ENHANCE_PIXEL; else maxIndicatorSize = TBG_IndicatorDim(new_w); /* END OSF Fix pir 2480 */ boxSize = ((int) LabG_TextRect(new_w).height + (int) LabG_MarginTop (new_w) + (int) LabG_MarginBottom (new_w)); if (maxIndicatorSize > boxSize) { delta = (maxIndicatorSize - boxSize) / 2; TBG_IndTopDelta(new_w) = delta; LabG_MarginTop(new_w) += delta; TBG_IndBottomDelta(new_w) = delta; LabG_MarginBottom(new_w) += delta; } /* CR 2337: Make room for toggle indicator and spacing */ if (LayoutIsRtoLG(new_w)) { delta = (TBG_IndicatorDim(new_w) + TBG_Spacing(new_w) - LabG_MarginRight(new_w)); if (delta > 0) { TBG_IndRightDelta(new_w) = delta; LabG_MarginRight(new_w) += delta; } } else { delta = (TBG_IndicatorDim(new_w) + TBG_Spacing(new_w) - LabG_MarginLeft(new_w)); if (delta > 0) { TBG_IndLeftDelta(new_w) = delta; LabG_MarginLeft(new_w) += delta; } } } if (request->rectangle.width == 0) { new_w->rectangle.width = LabG_TextRect(new_w).width + 2 * LabG_MarginHeight(new_w) + LabG_MarginRight(new_w) + LabG_MarginLeft(new_w) + 2 * (new_w->gadget.highlight_thickness + new_w->gadget.shadow_thickness); if (new_w->rectangle.width == 0) new_w->rectangle.width = 1; if ((LabG__acceleratorText(new_w) != NULL) && (TBG_IndOn(new_w))) { if (LayoutIsRtoLG(new_w)) { LabG_AccTextRect(new_w).x = new_w->gadget.highlight_thickness + new_w->gadget.shadow_thickness + LabG_MarginHeight(new_w); } else { LabG_AccTextRect(new_w).x = new_w->rectangle.width - new_w->gadget.highlight_thickness - new_w->gadget.shadow_thickness - LabG_MarginHeight(new_w) - LabG_MarginRight(new_w) + LABELG_ACC_PAD; } } } if (request->rectangle.height == 0) new_w->rectangle.height = MAX(TBG_IndicatorDim(new_w), LabG_TextRect(new_w).height + 2 * LabG_MarginHeight(new_w) + LabG_MarginTop(new_w) + LabG_MarginBottom(new_w)) + 2 * (new_w->gadget.highlight_thickness + new_w->gadget.shadow_thickness); LabG_TextRect(new_w).y = new_w->gadget.highlight_thickness + new_w->gadget.shadow_thickness + LabG_MarginHeight(new_w) + LabG_MarginTop(new_w) + ((new_w->rectangle.height - LabG_MarginTop(new_w) - LabG_MarginBottom(new_w) - (2 * (LabG_MarginHeight(new_w) + new_w->gadget.highlight_thickness + new_w->gadget.shadow_thickness)) - LabG_TextRect(new_w).height) / 2); if (new_w->rectangle.height == 0) new_w->rectangle.height = 1; /* Display toggles as set if XmNset is True initially. */ IsOn(new_w) = TBG_Set(new_w); /* BEGIN OSF Fix pir 2097 */ new_w->gadget.event_mask = XmARM_EVENT | XmACTIVATE_EVENT | XmMULTI_ARM_EVENT | XmMULTI_ACTIVATE_EVENT | XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmBDRAG_EVENT; /* END OSF Fix pir 2097 */ (* (resize)) ((Widget) new_w); /* Unselect same as background unless set. */ if (TBG_UnselectColor(new_w) == INVALID_PIXEL) TBG_UnselectColor(new_w) = LabG_Background(new_w); TBG_ReversedSelect(new_w) = (TBG_SelectColor(new_w) == XmREVERSED_GROUND_COLORS); if ((TBG_SelectColor(new_w) == INVALID_PIXEL) || (TBG_SelectColor(new_w) == XmDEFAULT_SELECT_COLOR)) { XrmValue value; value.size = sizeof(Pixel); DefaultSelectColor((Widget) new_w, XtOffsetOf(XmToggleButtonGCacheObjRec, toggle_cache.select_color), &value); memcpy((char*) &TBG_SelectColor(new_w), value.addr, value.size); } else if (TBG_SelectColor(new_w) == XmREVERSED_GROUND_COLORS) { TBG_SelectColor(new_w) = LabG_Foreground(new_w); } else if (TBG_SelectColor(new_w) == XmHIGHLIGHT_COLOR) { TBG_SelectColor(new_w) = LabG_HighlightColor(new_w); } GetGC (new_w); GetUnselectGC(new_w); } /************************************************************************ * * Destroy * Free toggleButton's graphic context. * ************************************************************************/ static void Destroy( Widget w ) { XmToggleButtonGadget tw = (XmToggleButtonGadget) w; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean etched_in = dpy->display.enable_etched_in_menu; XtReleaseGC (XtParent(tw), TBG_SelectGC(tw)); XtReleaseGC (XtParent(tw), TBG_BackgroundGC(tw)); XtReleaseGC (XtParent(tw), TBG_UnselectGC(tw)); XtReleaseGC (XtParent(tw), TBG_IndeterminateGC(tw)); XtReleaseGC (XtParent(tw), TBG_IndeterminateBoxGC(tw)); if (LabG_IsMenupane(tw) && etched_in) XtReleaseGC ((Widget) tw, TBG_ArmGC(tw)); _XmProcessLock(); _XmCacheDelete( (XtPointer) TBG_Cache(tw)); _XmProcessUnlock(); } static void DrawBox(XmToggleButtonGadget w, GC top_gc, GC bot_gc, GC fillgc, int x, int y, int edge, Dimension margin) { int shadow = w->toggle.detail_shadow_thickness; XmeDrawShadows(XtDisplay ((Widget) w), XtWindow ((Widget) w), top_gc, bot_gc, x, y, edge, edge, shadow, XmSHADOW_OUT); /* Don't fill the background on mono screens if we're going to */ /* draw a glyph */ if (DefaultDepthOfScreen(XtScreen(w)) == 1 && DRAWGLYPH(NormalizeIndOn(w))) return; shadow += margin; if (edge > (shadow * 2)) XFillRectangle (XtDisplay ((Widget) w), XtWindow ((Widget) w), fillgc, x + shadow, y + shadow, edge - (shadow * 2), edge - (shadow * 2)); } /*************************************<->************************************* * * DrawToggle * Depending on the state of this widget, draw the ToggleButton. * *************************************<->***********************************/ static void DrawToggle( XmToggleButtonGadget w ) { int x, y, edge; Dimension margin; XGCValues values; Display *dpy = XtDisplay((Widget) w); Drawable drawable = XtWindow(XtParent((Widget) w)); XmDisplay dpyxm = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean etched_in = dpyxm->display.enable_etched_in_menu; if (LabG_IsPixmap(w) || XmStringEmpty(LabG__label(w))) edge = TBG_IndicatorDim(w); else edge = MIN((int)TBG_IndicatorDim(w), MAX(0, (int)w->rectangle.height - 2 * (w->gadget.highlight_thickness + w->gadget.shadow_thickness + (int)LabG_MarginHeight(w)) + LabG_MarginTop(w) + LabG_MarginBottom(w))); if ((DefaultDepthOfScreen(XtScreen(w)) > 1) && (LabG_TopShadowColor(w) != TBG_SelectColor(w)) && (LabG_BottomShadowColor (w)!= TBG_SelectColor(w))) margin = 0; else margin = 1; if (LayoutIsRtoLG(w)) x = w->rectangle.x + w->rectangle.width - w->gadget.highlight_thickness - w->gadget.shadow_thickness - LabG_MarginHeight(w) - TBG_IndicatorDim(w); else x = w->rectangle.x + w->gadget.highlight_thickness + w->gadget.shadow_thickness + LabG_MarginHeight(w); if (LabG_IsPixmap(w) || XmStringEmpty(LabG__label(w))) y = w->rectangle.y + (int)((w->rectangle.height - TBG_IndicatorDim(w)))/2; else { /* Center indicator vertically next to the first line of text. */ int fudge = Xm3D_ENHANCE_PIXEL; Dimension text_height; int line_count, height_diff; text_height = XmStringHeight(LabG_Font(w), LabG__label(w)); if ((line_count = XmStringLineCount(LabG__label(w))) < 1) line_count = 1; height_diff = ((int)text_height / line_count) - (int)TBG_IndicatorDim(w); if (height_diff < 0) height_diff = 0; y = w->rectangle.y + LabG_TextRect(w).y + (height_diff / 2); /* CR 2337: Keep large indicators inside the toggle. */ /* Is this definition of fudge right??? */ if (TBG_IndTopDelta(w) > fudge) y -= (TBG_IndTopDelta(w) - fudge); } if (TBG_Visible(w) || (IsOn(w) == XmSET)) { /* The toggle indicator should be visible. */ GC top_gc, bot_gc, fill_gc, glyph_gc; unsigned char normal_ind_on = NormalizeIndOn(w); switch (TBG_VisualSet(w)) { case XmUNSET: top_gc = LabG_TopShadowGC(w); bot_gc = LabG_BottomShadowGC(w); /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ if (LabG_IsMenupane(w) && etched_in && TBG_Armed(w)) fill_gc = (TBG_FillOnSelect(w) ? TBG_UnselectGC(w) : TBG_ArmGC(w)); else fill_gc = (TBG_FillOnSelect(w) ? TBG_UnselectGC(w) : LabG_BackgroundGC(w)); glyph_gc = None; break; case XmSET: top_gc = LabG_BottomShadowGC(w); bot_gc = LabG_TopShadowGC(w); /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ if (LabG_IsMenupane(w) && etched_in && TBG_Armed(w)) fill_gc = (TBG_FillOnSelect(w) ? TBG_SelectGC(w) : TBG_ArmGC(w)); else fill_gc = (TBG_FillOnSelect(w) ? TBG_SelectGC(w) : LabG_BackgroundGC(w)); glyph_gc = ((TBG_ReversedSelect(w) && DRAWBOX(normal_ind_on)) ? LabG_BackgroundGC(w) : LabG_NormalGC(w)); /* CR 9791: Label's normal_gc has a dynamic clip_mask. */ if (glyph_gc == LabG_NormalGC(w)) XSetClipMask(dpy, glyph_gc, None); break; case XmINDETERMINATE: top_gc = bot_gc = TBG_IndeterminateBoxGC(w); /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ if (LabG_IsMenupane(w) && etched_in && TBG_Armed(w)) fill_gc = (TBG_FillOnSelect(w) ? TBG_IndeterminateGC(w) : TBG_ArmGC(w)); else fill_gc = (TBG_FillOnSelect(w) ? TBG_IndeterminateGC(w) : LabG_BackgroundGC(w)); glyph_gc = TBG_IndeterminateGC(w); break; default: assert(False); return; } switch (NormalizeIndType(w)) { case XmN_OF_MANY: { /* If the toggle indicator is square shaped then adjust the * indicator width and height, so that it looks proportional * to a diamond shaped indicator of the same width and height */ int new_edge; Dimension box_margin = (DRAWBOX(normal_ind_on) ? w->toggle.detail_shadow_thickness : 0); /* Subtract 3 pixels + 10% from the width and height. */ new_edge = edge - 3 - ((edge - 10)/10); /* Adjust x,y to center the indicator relative to the label. */ y = y + ((edge - new_edge) / 2); x = x + ((edge - new_edge) / 2); edge = new_edge; switch(TBG_VisualSet(w)) { case XmUNSET: if (edge > 0) { if (w->label.fill_bg_box || TBG_FillOnSelect(w)) XFillRectangle(dpy, drawable, fill_gc, x, y, edge, edge); else XClearArea(dpy, drawable, x, y, edge, edge, False); } if (DRAW3DBOX(normal_ind_on)) DrawBox(w, top_gc, bot_gc, fill_gc, x, y, edge, margin); else if (DRAWFLATBOX(normal_ind_on)) DrawBox(w, bot_gc, bot_gc, fill_gc, x, y, edge, margin); break; case XmSET: if (DRAW3DBOX(normal_ind_on)) DrawBox(w, top_gc, bot_gc, fill_gc, x, y, edge, margin); else if (DRAWFLATBOX(normal_ind_on)) DrawBox(w, top_gc, top_gc, fill_gc, x, y, edge, margin); else if (edge > 0) { if (w->label.fill_bg_box || TBG_FillOnSelect(w)) XFillRectangle(dpy, drawable, fill_gc, x, y, edge, edge); else XClearArea(dpy, drawable, x, y, edge, edge, False); } if (!DRAWBOX(normal_ind_on) || ((edge - 2 * box_margin) >= MIN_GLYPH_SIZE)) { if (DRAWCHECK(normal_ind_on)) XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); else if (DRAWCROSS(normal_ind_on)) XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); } break; case XmINDETERMINATE: if (TBG_FillOnSelect(w)) { /* Fetch the select_color GetGC() actually used. */ XGetGCValues(dpy, TBG_SelectGC(w), GCForeground, &values); values.background = values.foreground; values.foreground = TBG_UnselectColor(w); XChangeGC(dpy, fill_gc, GCForeground|GCBackground, &values); } else { /* This GC should have the right values already. */ fill_gc = TBG_IndeterminateBoxGC(w); } if (DRAWBOX(normal_ind_on)) DrawBox(w, bot_gc, bot_gc, fill_gc, x, y, edge, margin); else if (edge > 0) { if (w->label.fill_bg_box || TBG_FillOnSelect(w)) XFillRectangle(dpy, drawable, fill_gc, x, y, edge, edge); else XClearArea(dpy, drawable, x, y, edge, edge, False); } if (TBG_ReversedSelect(w)) { values.foreground = LabG_Background(w); values.background = LabG_Foreground(w); } else { values.foreground = LabG_Foreground(w); values.background = LabG_Background(w); } if (!DRAWBOX(normal_ind_on) || ((edge - 2 * box_margin) >= MIN_GLYPH_SIZE)) { if (DRAWCHECK(normal_ind_on)) { XChangeGC(dpy, glyph_gc, GCForeground|GCBackground, &values); XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); } else if (DRAWCROSS(normal_ind_on)) { XChangeGC(dpy, glyph_gc, GCForeground|GCBackground, &values); XmeDrawIndicator(dpy, drawable, glyph_gc, x, y, edge, edge, box_margin, normal_ind_on); } } break; } break; } case XmONE_OF_MANY: /* This value should have been normalized away! */ assert(FALSE); case XmONE_OF_MANY_DIAMOND: XmeDrawDiamond(dpy, drawable, top_gc, bot_gc, fill_gc, x, y, edge, edge, w->toggle.detail_shadow_thickness,margin); break; case XmONE_OF_MANY_ROUND: #ifdef FIX_1402 XmeDrawCircle(dpy, drawable, top_gc, bot_gc, fill_gc, x, y, edge, edge, w->toggle.detail_shadow_thickness, margin); #else XmeDrawCircle(dpy, drawable, top_gc, bot_gc, fill_gc, x, y, edge, edge, w->toggle.detail_shadow_thickness, 1); #endif break; } } else { /* The toggle indicator should be invisibile. */ if (edge > 0) { if (LabG_IsMenupane(w) && etched_in) { if (w->toggle.Armed) /* use the arm GC in a menu if armed and enableEtchedInMenu is set */ XFillRectangle(dpy, drawable, TBG_ArmGC(w), x, y, edge, edge); else XFillRectangle(dpy, drawable, TBG_BackgroundGC(w), x, y, edge, edge); } else if (w->label.fill_bg_box) XFillRectangle(dpy, drawable, TBG_BackgroundGC(w), x, y, edge, edge); else XClearArea(dpy, drawable, x, y, edge, edge, False); } } } /*************************************<->************************************* * * BorderHighlight * *************************************<->***********************************/ static void BorderHighlight( Widget wid ) { XmToggleButtonGadget tb = (XmToggleButtonGadget) wid ; XEvent * event = NULL; if (LabG_IsMenupane(tb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; TBG_Armed(tb) = TRUE; if ((etched_in) && (TBG_IndOn(tb) || (!(TBG_IndOn(tb)) && !(TBG_FillOnSelect(tb))))) { DrawEtchedInMenu(tb); if (TBG_IndOn(tb)) DrawToggle(tb); } XmeDrawShadows (XtDisplay (tb), XtWindow (tb), LabG_TopShadowGC(tb), LabG_BottomShadowGC(tb), tb->rectangle.x + tb->gadget.highlight_thickness, tb->rectangle.y + tb->gadget.highlight_thickness, tb->rectangle.width - 2 * tb->gadget.highlight_thickness, tb->rectangle.height - 2 * tb->gadget.highlight_thickness, tb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (TBG_ArmCB(tb)) { XFlush (XtDisplay (tb)); ToggleButtonCallback(tb, XmCR_ARM, TBG_Set(tb), event); } } else { (*(xmLabelGadgetClassRec.gadget_class.border_highlight))((Widget) tb) ; } } /*************************************<->************************************* * * BorderUnhighlight * *************************************<->***********************************/ static void BorderUnhighlight( Widget wid ) { XmToggleButtonGadget tb = (XmToggleButtonGadget) wid ; XEvent * event = NULL; if (LabG_IsMenupane(tb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (!TBG_Armed(tb)) return; TBG_Armed(tb) = FALSE; if ((etched_in) && (TBG_IndOn(tb) || (!(TBG_IndOn(tb)) && !(TBG_FillOnSelect(tb))))) { DrawEtchedInMenu(tb); if (TBG_IndOn(tb)) DrawToggle(tb); } XmeClearBorder (XtDisplay (tb), XtWindow (tb), tb->rectangle.x + tb->gadget.highlight_thickness, tb->rectangle.y + tb->gadget.highlight_thickness, tb->rectangle.width - 2 * tb->gadget.highlight_thickness, tb->rectangle.height - 2 * tb->gadget.highlight_thickness, tb->gadget.shadow_thickness); if (TBG_DisarmCB(tb)) { XFlush (XtDisplay (tb)); ToggleButtonCallback(tb, XmCR_DISARM, TBG_Set(tb), event); } } else { (*(xmLabelGadgetClassRec.gadget_class.border_unhighlight)) ((Widget) tb) ; } } /*************************************<->************************************* * * KeySelect * If the menu system traversal is enabled, do an activate and disarm * *************************************<->***********************************/ static void KeySelect( XmToggleButtonGadget tb, XEvent *event ) { XmToggleButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (!_XmIsEventUnique(event)) return; if (!_XmGetInDragMode((Widget)tb)) { if (TBG_IndOn(tb)) DrawToggle(tb); else if (TBG_FillOnSelect(tb) && !LabG_IsPixmap(tb)) DrawToggleLabel (tb); if (LabG_IsPixmap(tb) || LabG_IsPixmapAndText(tb)) SetAndDisplayPixmap( tb, NULL, NULL); TBG_Armed(tb) = FALSE; TBG_Set(tb) = (TBG_Set(tb) == TRUE) ? FALSE : TRUE; menuSTrait->buttonPopdown(XtParent(tb), event); _XmRecordEvent(event); /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ /* Notify parent about the select. */ call_value.reason = XmCR_VALUE_CHANGED; call_value.event = event; call_value.set = TBG_Set(tb); menuSTrait->entryCallback(XtParent(tb), (Widget) tb, &call_value); menuSTrait->reparentToTearOffShell(XtParent(tb), event); if ((! LabG_SkipCallback(tb)) && (TBG_ValueChangedCB(tb))) { XFlush(XtDisplay(tb)); ToggleButtonCallback(tb, XmCR_VALUE_CHANGED, TBG_Set(tb), event); } } } /************************************************************************ * * Compute Space * ***********************************************************************/ static void ComputeSpace( XmToggleButtonGadget tb ) { int needed_width; int needed_height; /* Compute space for drawing toggle. */ needed_width = LabG_TextRect(tb).width + LabG_MarginLeft(tb) + LabG_MarginRight(tb) + (2 * (tb->gadget.shadow_thickness + tb->gadget.highlight_thickness + LabG_MarginWidth(tb))); needed_height = LabG_TextRect(tb).height + LabG_MarginTop(tb) + LabG_MarginBottom(tb) + (2 * (tb->gadget.shadow_thickness + tb->gadget.highlight_thickness + LabG_MarginHeight(tb))); if (needed_height > tb->rectangle.height) if (TBG_IndOn(tb)) LabG_TextRect(tb).y = tb->gadget.shadow_thickness + tb->gadget.highlight_thickness + LabG_MarginHeight(tb) + LabG_MarginTop(tb) + ((tb->rectangle.height - LabG_MarginTop(tb) - LabG_MarginBottom(tb) - (2 * (LabG_MarginHeight(tb) + tb->gadget.highlight_thickness + tb->gadget.shadow_thickness)) - LabG_TextRect(tb).height) / 2); if (LayoutIsRtoLG(tb)) { if ((needed_width > tb->rectangle.width) || ((LabG_Alignment(tb) == XmALIGNMENT_BEGINNING) && (needed_width < tb->rectangle.width)) || ((LabG_Alignment(tb) == XmALIGNMENT_CENTER) && (needed_width < tb->rectangle.width) && (tb->rectangle.width - needed_width < LabG_MarginRight(tb))) || (needed_width == tb->rectangle.width)) { if (TBG_IndOn(tb)) LabG_TextRect(tb).x = tb->rectangle.x + tb->rectangle.width - (tb->gadget.shadow_thickness + tb->gadget.highlight_thickness + LabG_MarginHeight(tb) + LabG_MarginRight(tb) + LabG_TextRect(tb).width); } } else { if ((needed_width > tb->rectangle.width) || ((LabG_Alignment(tb) == XmALIGNMENT_BEGINNING) && (needed_width < tb->rectangle.width)) || ((LabG_Alignment(tb) == XmALIGNMENT_CENTER) && (needed_width < tb->rectangle.width) && (tb->rectangle.width - needed_width < LabG_MarginLeft(tb))) || (needed_width == tb->rectangle.width)) { if (TBG_IndOn(tb)) LabG_TextRect(tb).x = tb->gadget.shadow_thickness + tb->gadget.highlight_thickness + LabG_MarginHeight(tb) + LabG_MarginLeft(tb); } } } /*************************************<->************************************* * * Redisplay(w, event, region) * Cause the widget, identified by w, to be redisplayed. * *************************************<->***********************************/ static void Redisplay( Widget w, XEvent *event, Region region ) { register XmToggleButtonGadget tb = (XmToggleButtonGadget) w; /* Fix CR #4884, D. Rand 6/4/92 */ if (! XtIsRealized(w) ) return; /* End Fix */ if (LabG_IsMenupane(tb)) { ShellWidget mshell = (ShellWidget) XtParent(XtParent(tb)); if (! mshell->shell.popped_up) return; } ComputeSpace(tb); if (LabG_IsPixmap (tb) || LabG_IsPixmapAndText(tb)) SetAndDisplayPixmap(tb, event, region); else { if (!TBG_IndOn(tb) && TBG_FillOnSelect(tb)) DrawToggleLabel (tb); else { XtExposeProc expose; _XmProcessLock(); expose = xmLabelGadgetClassRec.rect_class.expose; _XmProcessUnlock(); (* expose) ((Widget)tb, event, region); } } if (TBG_IndOn(tb)) { if (! TBG_Armed(tb)) IsOn(tb) = TBG_Set(tb); DrawToggle(tb); } if (LabG_IsMenupane(tb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(w)); Boolean etched_in = dpy -> display.enable_etched_in_menu; if (TBG_Armed(tb)) XmeDrawShadows(XtDisplay (tb), XtWindow (tb), LabG_TopShadowGC(tb), LabG_BottomShadowGC(tb), tb->rectangle.x + tb->gadget.highlight_thickness, tb->rectangle.y + tb->gadget.highlight_thickness, tb->rectangle.width - 2*tb->gadget.highlight_thickness, tb->rectangle.height - 2*tb->gadget.highlight_thickness, tb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } else { DrawToggleShadow (tb); } } /************************************************************************** * Resize(w, event) **************************************************************************/ static void Resize( Widget w ) { register XmToggleButtonGadget tb = (XmToggleButtonGadget) w; if (LabG_IsPixmap(w)) SetToggleSize(tb); else { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); (* resize)( (Widget) tb); } } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; Cardinal size; XmToggleButtonGCacheObject newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmToggleButtonGCacheObject)_XmExtObjAlloc(size); reqSec = (XmToggleButtonGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy (&(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); memcpy(&(newSec->toggle_cache), TBG_Cache(newParent), sizeof(XmToggleButtonGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); /* * Since the resource lists for label and togglebutton were merged at * ClassInitialize time we need to make only one call to * XtSetSubvalues() */ XtSetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); memcpy((XtPointer)reqSec, (XtPointer)newSec, size); LabG_Cache(newParent) = &(((XmLabelGCacheObject)newSec)->label_cache); LabG_Cache(refParent) = &(((XmLabelGCacheObject) extData->reqWidget)->label_cache); TBG_Cache(newParent) = &(((XmToggleButtonGCacheObject)newSec)->toggle_cache); TBG_Cache(refParent) = &(((XmToggleButtonGCacheObject)extData->reqWidget)->toggle_cache); _XmExtImportArgs((Widget)newSec, args, num_args); /* CR 2990: Use XmNbuttonFontList as the default font. */ if (LabG_Font(newParent) == NULL) LabG_Font(newParent) = XmeGetDefaultRenderTable (newParent, XmBUTTON_FONTLIST); return FALSE; } /************************************************************************ * * GetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; Cardinal size; XmToggleButtonGCacheObject newSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmToggleButtonGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy (&(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); memcpy (&(newSec->toggle_cache), TBG_Cache(newParent), sizeof(XmToggleButtonGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); /* * Note that if a resource is defined in the superclass's as well as a * subclass's resource list and if a NULL is passed in as the third * argument to XtSetArg, then when a GetSubValues() is done by the * superclass the NULL is replaced by a value. Now when the subclass * gets the arglist it doesn't see a NULL and thinks it's an address * it needs to stuff a value into and sure enough it breaks. * This means that we have to pass the same arglist with the NULL to * both the superclass and subclass and propagate the values up once * the XtGetSubValues() are done. */ /* * Since the resource lists for label and togglebutton were merged at * ClassInitialize time we need to make only one call to * XtGetSubvalues() */ XtGetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmExtGetValuesHook((Widget)newSec, args, num_args); } /************************************************************************ * * GetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static void GetValuesPosthook( Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmWidgetExtData ext; _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmProcessLock(); _XmExtObjFree((XtPointer) ext->widget); _XmProcessUnlock(); XtFree( (char *) ext); } /************************************************************************ * * SetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPosthook( Widget current, Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmWidgetExtData ext; /* * - register parts in cache. * - update cache pointers * - and free req */ /* assign if changed! */ _XmProcessLock(); if (!_XmLabelCacheCompare((XtPointer)LabG_Cache(new_w), (XtPointer)LabG_Cache(current))) { /* delete the old one */ _XmCacheDelete( (XtPointer) LabG_Cache(current)); LabG_Cache(new_w) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(new_w), (XtPointer) LabG_Cache(new_w), sizeof(XmLabelGCacheObjPart)); } else LabG_Cache(new_w) = LabG_Cache(current); /* assign if changed! */ if (!_XmToggleBCacheCompare((XtPointer)TBG_Cache(new_w), (XtPointer)TBG_Cache(current))) { /* delete the old one */ _XmCacheDelete( (XtPointer) TBG_Cache(current)); TBG_Cache(new_w) = (XmToggleButtonGCacheObjPart *) _XmCachePart(TBG_ClassCachePart(new_w), (XtPointer) TBG_Cache(new_w), sizeof(XmToggleButtonGCacheObjPart)); } else TBG_Cache(new_w) = TBG_Cache(current); _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); _XmProcessUnlock(); XtFree( (char *) ext); return FALSE; } /*************************************************************************** * * SetValues(current, request, new_w) * This is the set values procedure for the ToggleButton class. It is * called last (the set values rtnes for its superclasses are called * first). * *************************************<->***********************************/ /*ARGSUSED*/ static Boolean SetValues( Widget current, Widget request, Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmToggleButtonGadget curcbox = (XmToggleButtonGadget) current; XmToggleButtonGadget reqcbox = (XmToggleButtonGadget) request; XmToggleButtonGadget newcbox = (XmToggleButtonGadget) new_w; Boolean flag = FALSE; /* our return value */ XtWidgetProc resize; /* CR 2337: Preserve the user's margins. */ if (LabG_MarginRight(curcbox) != LabG_MarginRight(reqcbox)) TBG_IndRightDelta(newcbox) = 0; if (LabG_MarginLeft(curcbox) != LabG_MarginLeft(reqcbox)) TBG_IndLeftDelta(newcbox) = 0; if (LabG_MarginTop(curcbox) != LabG_MarginTop(reqcbox)) TBG_IndTopDelta(newcbox) = 0; if (LabG_MarginBottom(curcbox) != LabG_MarginBottom(reqcbox)) TBG_IndBottomDelta(newcbox) = 0; /********************************************************************** * Calculate the window size: The assumption here is that if * the width and height are the same in the new and current instance * record that those fields were not changed with set values. Therefore * its okay to recompute the necessary width and height. However, if * the new and current do have different width/heights then leave them * alone because that's what the user wants. *********************************************************************/ _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); /* Use the On pixmaps if no Indeterminate pixmaps are found. */ if (IsNull(PixmapInd(newcbox)) && !IsNull(PixmapOn(newcbox))) PixmapInd(newcbox) = PixmapOn(newcbox); if (IsNull(PixmapInsenInd(newcbox)) && !IsNull(PixmapInsenOn(newcbox))) PixmapInsenInd(newcbox) = PixmapInsenOn(newcbox); /* Use the On pixmap if no Off pixmap is found. */ if (IsNull(PixmapOff(newcbox)) && !IsNull(PixmapOn(newcbox))) { PixmapOff(newcbox) = PixmapOn(newcbox); if ((LabG_RecomputeSize(newcbox)) && (request->core.width == current->core.width)) new_w->core.width = 0; if ((LabG_RecomputeSize(newcbox)) && (request->core.height == current->core.height)) new_w->core.height = 0; _XmCalcLabelGDimensions(new_w); (* resize)( (Widget) newcbox); } /* Use the insensitive On pixmap if no insensitive Off pixmap is found. */ if (IsNull(PixmapInsenOff(newcbox)) && !IsNull(PixmapInsenOn(newcbox))) { PixmapInsenOff(newcbox) = PixmapInsenOn(newcbox); if ((LabG_RecomputeSize(newcbox)) && (request->core.width == current->core.width)) new_w->core.width = 0; if ((LabG_RecomputeSize(newcbox)) && (request->core.height == current->core.height)) new_w->core.height = 0; _XmCalcLabelGDimensions(new_w); (* resize)( (Widget) newcbox); } /* BEGIN OSF Fix pir 1778 */ /* Have to reset the TextRect width because label's resize will have mucked with it. */ if (LabG_IsPixmap(newcbox) && (!IsNull(PixmapOff(newcbox)) || !IsNull(PixmapInsenOff(newcbox)) || !IsNull(PixmapOn(newcbox)) || !IsNull(PixmapInsenOn(newcbox)) || !IsNull(PixmapInd(newcbox)) || !IsNull(PixmapInsenInd(newcbox)))) { if (LabG_RecomputeSize(newcbox)) { if (request->core.width == current->core.width) new_w->core.width = 0; if (request->core.height == current->core.height) new_w->core.height = 0; } SetToggleSize(newcbox); } /* END OSF Fix pir 1778 */ /* CR 9922: Changing fillOnSelect requires a redraw. */ if (TBG_FillOnSelect(newcbox) != TBG_FillOnSelect(curcbox)) { flag = TRUE; } if ((LabG__label(newcbox) != LabG__label(curcbox)) || (PixmapOff(newcbox) != PixmapOff(curcbox)) || (LabG_Font(newcbox) != LabG_Font(curcbox)) || (TBG_Spacing(newcbox) != TBG_Spacing(curcbox)) || (PixmapOn(newcbox) != PixmapOn(curcbox)) || (PixmapInsenOn(newcbox) != PixmapInsenOn(curcbox)) || (PixmapInd(newcbox) != PixmapInd(curcbox)) || (PixmapInsenInd(newcbox) != PixmapInsenInd(curcbox)) || (TBG_IndOn(newcbox) != TBG_IndOn(curcbox)) || (TBG_IndicatorDim(newcbox) != TBG_IndicatorDim(curcbox)) || (LabG_IsPixmap(newcbox) != LabG_IsPixmap(curcbox)) || (LabG_IsPixmapAndText(newcbox) != LabG_IsPixmapAndText(curcbox))) { int right_delta = 0; /* Our desired margin adjustments. */ int left_delta = 0; int top_delta = 0; int bottom_delta = 0; if (LabG_RecomputeSize(newcbox)) { if (reqcbox->rectangle.width == curcbox->rectangle.width) newcbox->rectangle.width = 0; if (reqcbox->rectangle.height == curcbox->rectangle.height) newcbox->rectangle.height = 0; } if (LabG_IsPixmap(newcbox) && ((PixmapOn(newcbox) != PixmapOn(curcbox)) || (PixmapInsenOn(newcbox) != PixmapInsenOn(curcbox)) || (PixmapInd(newcbox) != PixmapInd(curcbox)) || (PixmapInsenInd(newcbox) != PixmapInsenInd(curcbox))) ) { _XmCalcLabelGDimensions(new_w); /* OSF Fix 1778 */ SetToggleSize(newcbox); } TBG_IndicatorSet(newcbox) = TBG_IndicatorSet(curcbox); if ( TBG_IndicatorDim(newcbox) != TBG_IndicatorDim(curcbox)) TBG_IndicatorSet(newcbox) = TRUE; /* CR 8415: Honor explicit requests for XmNindicatorSize. */ if (!TBG_IndicatorSet(newcbox) && (TBG_IndicatorDim(newcbox) == TBG_IndicatorDim(curcbox))) { if ((LabG_IsPixmap(newcbox) != LabG_IsPixmap(curcbox)) || (LabG_IsPixmapAndText(newcbox) != LabG_IsPixmapAndText(curcbox)) || (LabG__label(newcbox) != LabG__label(curcbox)) || (PixmapOff(newcbox) != PixmapOff(curcbox)) || (LabG_Font(newcbox) != LabG_Font(curcbox)) || (TBG_IndOn(newcbox) != TBG_IndOn(curcbox))) { if (LabG_IsPixmap(newcbox) || LabG_IsPixmapAndText(newcbox)) { if (!IsNull(PixmapOff(newcbox)) || !IsNull(PixmapInsenOff(newcbox)) || !IsNull(PixmapOn(newcbox)) || !IsNull(PixmapInsenOn(newcbox)) || !IsNull(PixmapInd(newcbox)) || !IsNull(PixmapInsenInd(newcbox))) if (LabG_TextRect(newcbox).height < 13) TBG_IndicatorDim(newcbox) = LabG_TextRect(newcbox).height; else TBG_IndicatorDim(newcbox) = 13 + (LabG_TextRect(newcbox).height/13); else TBG_IndicatorDim(newcbox) = XmDEFAULT_INDICATOR_DIM; } else { Dimension height; int line_count; height = XmStringHeight(LabG_Font(newcbox), LabG__label(newcbox)); line_count = XmStringLineCount (LabG__label(newcbox)); if (line_count < 1) line_count = 1; /* * CR 5203 - Make the calculation for the * indicator_dim be the same as in the Initialize * procedure, i.e. Popup and Pulldown menus should * have smaller indicators */ if (LabG_IsMenupane(new_w)) TBG_IndicatorDim(newcbox) = MAX(XmDEFAULT_INDICATOR_DIM, (height / ((Dimension)line_count))*2/3); else TBG_IndicatorDim(newcbox) = MAX(XmDEFAULT_INDICATOR_DIM, height / ((Dimension)line_count)); } /* End 5203 Fix */ } } if (TBG_IndOn(newcbox)) { /* * Fix CR 5568 - If the indicator is on and the user has changed the * indicator dimension, calculate the new top and bottom * margins in a place where they can effect the core width * and height. */ /* Recompute the Top and bottom margins and the height of the text * rectangle to accommodate the size of toggle indicator. * if (we are given a new toggleIndicator size) * { if (user has given new top or bottom margin) * { compute to accomodate new toggle button size; } * else (user has set new top/bottom margin) * { Recompute margin to accommodate new IndicatorSize } * } */ if (TBG_IndicatorDim(newcbox) != TBG_IndicatorDim(curcbox)) { int maxIndicatorSize = (int) (TBG_IndicatorDim(newcbox)) + 2*Xm3D_ENHANCE_PIXEL; int boxSize = ((int) LabG_TextRect(newcbox).height + (int) LabG_MarginTop(newcbox) + (int) LabG_MarginBottom(newcbox)); top_delta = bottom_delta = (maxIndicatorSize - boxSize) / 2; } if (LayoutIsRtoLG(newcbox)) right_delta = (TBG_IndicatorDim(newcbox) + TBG_Spacing(newcbox) - LabG_MarginRight(newcbox)); else left_delta = (TBG_IndicatorDim(newcbox) + TBG_Spacing(newcbox) - LabG_MarginLeft(newcbox)); } else if (TBG_IndOn(curcbox)) { /* CR 2337: Redisplay when the indicator is turned off. */ flag = TRUE; top_delta = -TBG_IndTopDelta(newcbox); bottom_delta = -TBG_IndBottomDelta(newcbox); if (LayoutIsRtoLG(newcbox)) right_delta = -TBG_IndRightDelta(newcbox); else left_delta = -TBG_IndLeftDelta(newcbox); } /* CR 2337: Let the toggle button shrink if necessary. */ if (right_delta || left_delta || top_delta || bottom_delta) { flag = TRUE; /* Adjust vertical margins based on the indicator. */ if ((int)TBG_IndTopDelta(newcbox) + top_delta > 0) { LabG_MarginTop(newcbox) += top_delta; TBG_IndTopDelta(newcbox) += top_delta; } else { LabG_MarginTop(newcbox) -= TBG_IndTopDelta(newcbox); TBG_IndTopDelta(newcbox) = 0; } if ((int)TBG_IndBottomDelta(newcbox) + bottom_delta > 0) { LabG_MarginBottom(newcbox) += bottom_delta; TBG_IndBottomDelta(newcbox) += bottom_delta; } else { LabG_MarginBottom(newcbox) -= TBG_IndBottomDelta(newcbox); TBG_IndBottomDelta(newcbox) = 0; } /* Adjust horizontal margins based on the indicator. */ if (LayoutIsRtoLG(newcbox)) { if ((int)TBG_IndRightDelta(newcbox) + right_delta > 0) { LabG_MarginRight(newcbox) += right_delta; TBG_IndRightDelta(newcbox) += right_delta; } else { LabG_MarginRight(newcbox) -= TBG_IndRightDelta(newcbox); TBG_IndRightDelta(newcbox) = 0; } } else { if ((int)TBG_IndLeftDelta(newcbox) + left_delta > 0) { LabG_MarginLeft(newcbox) += left_delta; TBG_IndLeftDelta(newcbox) += left_delta; } else { LabG_MarginLeft(newcbox) -= TBG_IndLeftDelta(newcbox); TBG_IndLeftDelta(newcbox) = 0; } } /* Realign the label. */ if (! LabG_RecomputeSize(newcbox)) (* resize) ((Widget) new_w); } if (LabG_RecomputeSize(newcbox)) { if (reqcbox->rectangle.width == curcbox->rectangle.width) newcbox->rectangle.width = 0; if (reqcbox->rectangle.height == curcbox->rectangle.height) newcbox->rectangle.height = 0; } if (newcbox->rectangle.width == 0) { newcbox->rectangle.width = LabG_TextRect(newcbox).width + LabG_MarginLeft(newcbox) + LabG_MarginRight(newcbox) + 2 * (newcbox->gadget.highlight_thickness + newcbox->gadget.shadow_thickness + LabG_MarginHeight(newcbox)); if (newcbox->rectangle.width == 0) newcbox->rectangle.width = 1; flag = TRUE; } if (newcbox->rectangle.height == 0) { newcbox->rectangle.height = MAX(TBG_IndicatorDim(newcbox), LabG_TextRect(newcbox).height + 2*LabG_MarginHeight(newcbox) + LabG_MarginTop(newcbox) + LabG_MarginBottom(newcbox)) + 2 * (newcbox->gadget.highlight_thickness + newcbox->gadget.shadow_thickness); if (newcbox->rectangle.height == 0) newcbox->rectangle.height = 1; flag = TRUE; } } if ((TBG_IndType(curcbox) != TBG_IndType(newcbox)) && (!XmRepTypeValidValue(XmRID_INDICATOR_TYPE, TBG_IndType( newcbox), (Widget) newcbox))) { TBG_IndType(newcbox) = TBG_IndType(curcbox); } if ((LabG_Foreground(newcbox) != LabG_Foreground(curcbox)) || (LabG_Background(newcbox) != LabG_Background(curcbox)) || (TBG_SelectColor(newcbox) != TBG_SelectColor(curcbox))) { XtReleaseGC (XtParent(newcbox), TBG_SelectGC(newcbox)); XtReleaseGC (XtParent(newcbox), TBG_BackgroundGC(newcbox)); XtReleaseGC (XtParent(newcbox), TBG_IndeterminateGC(newcbox)); XtReleaseGC (XtParent(newcbox), TBG_IndeterminateBoxGC(newcbox)); TBG_ReversedSelect(newcbox) = (TBG_SelectColor(newcbox) == XmREVERSED_GROUND_COLORS); if ((TBG_SelectColor(newcbox) == INVALID_PIXEL) || (TBG_SelectColor(newcbox) == XmDEFAULT_SELECT_COLOR)) { XrmValue value; value.size = sizeof(Pixel); DefaultSelectColor((Widget) newcbox, XtOffsetOf(XmToggleButtonGCacheObjRec, toggle_cache.select_color), &value); memcpy((char*) &TBG_SelectColor(newcbox), value.addr, value.size); } else if (TBG_SelectColor(newcbox) == XmREVERSED_GROUND_COLORS) { TBG_SelectColor(newcbox) = LabG_Foreground(newcbox); } else if (TBG_SelectColor(newcbox) == XmHIGHLIGHT_COLOR) { TBG_SelectColor(newcbox) = LabG_HighlightColor(newcbox); } GetGC(newcbox); flag = TRUE; } if (TBG_UnselectColor(newcbox) != TBG_UnselectColor(curcbox)) { XtReleaseGC (XtParent(curcbox), TBG_UnselectGC(curcbox)); GetUnselectGC(newcbox); flag = TRUE; } if (TBG_Set(curcbox) != TBG_Set(newcbox)) { if (TBG_ToggleMode(newcbox) == XmTOGGLE_BOOLEAN && TBG_Set(newcbox) == XmINDETERMINATE) TBG_Set(newcbox) = TBG_Set(curcbox); else { IsOn(newcbox) = TBG_Set(newcbox); if (flag == False && XtIsRealized((Widget)newcbox)) { if (TBG_IndOn(newcbox)) DrawToggle (newcbox); else { if (newcbox->gadget.shadow_thickness > 0) DrawToggleShadow (newcbox); if (TBG_FillOnSelect(newcbox)&& !LabG_IsPixmap(newcbox)) DrawToggleLabel (newcbox); if ((LabG_IsPixmap(newcbox)) || LabG_IsPixmapAndText(newcbox)) { SetAndDisplayPixmap(newcbox, NULL, NULL); flag = True; } } } } } if ((TBG_IndType(curcbox) != TBG_IndType(newcbox)) || ( (TBG_Visible(curcbox) != TBG_Visible(newcbox)) && (XmUNSET == TBG_Set(newcbox)))) { flag = True; } /* One-of-many forces boolean mode. */ if (IsOneOfMany(TBG_IndType(newcbox)) && (TBG_ToggleMode(newcbox) == XmTOGGLE_INDETERMINATE)) { TBG_ToggleMode(newcbox) = XmTOGGLE_BOOLEAN; } if (TBG_ToggleMode(curcbox) != TBG_ToggleMode(newcbox)) { if ((TBG_ToggleMode(newcbox) == XmTOGGLE_BOOLEAN) && (TBG_Set(newcbox) == XmINDETERMINATE)) { TBG_VisualSet(newcbox) = TBG_Set(newcbox) = False; flag = True; } } /* Fix br 1211: we need to compare and set label cache of new_w if differs from current.*/ if(!_XmLabelCacheCompare(LabG_Cache(new_w), LabG_Cache(current))) { _XmCacheCopy((XtPointer)LabG_Cache(new_w), (XtPointer)LabG_Cache(current), sizeof(XmLabelGCacheObjPart)); } /* End of fix br 1251 */ /* BEGIN OSF Fix pir 2097 */ newcbox->gadget.event_mask = XmARM_EVENT | XmACTIVATE_EVENT | XmMULTI_ARM_EVENT | XmMULTI_ACTIVATE_EVENT | XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmBDRAG_EVENT; /* END OSF Fix pir 2097 */ return(flag); } /*************************************************************** * * XmToggleButtonGadgetGetState * This function gets the state of the toggle gadget. * ***************************************************************/ Boolean XmToggleButtonGadgetGetState( Widget w ) { XmToggleButtonGadget tg = (XmToggleButtonGadget) w; Boolean ret_val; XtAppContext app = XtWidgetToApplicationContext(w); _XmAppLock(app); ret_val = TBG_Set(tg); _XmAppUnlock(app); return (ret_val); } /**************************************************************** * * XmToggleButtonGadgetSetState * This function sets the state of the toggle gadget. * ****************************************************************/ void XmToggleButtonGadgetSetState( Widget w, #if NeedWidePrototypes int bnewstate, int notify ) #else Boolean bnewstate, Boolean notify ) #endif /* NeedWidePrototypes */ { XmToggleButtonGadget tg = (XmToggleButtonGadget) w; XmMenuSystemTrait menuSTrait; XmToggleButtonState newstate; XtAppContext app = XtWidgetToApplicationContext(w); _XmAppLock(app); newstate = (bnewstate == XmSET)? XmSET : XmUNSET; if (TBG_Set(tg) != newstate) { TBG_Set(tg) = newstate; IsOn(tg) = newstate; if (XtIsRealized ((Widget)tg)) { if (TBG_IndOn(tg)) DrawToggle(tg); else { if (tg->gadget.shadow_thickness> 0) DrawToggleShadow (tg); if (TBG_FillOnSelect(tg) && !LabG_IsPixmap(tg)) DrawToggleLabel (tg); } if (LabG_IsPixmap(tg) || LabG_IsPixmapAndText(tg)) SetAndDisplayPixmap(tg, NULL, NULL); } if (notify) { /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tg)), XmQTmenuSystem); if (menuSTrait != NULL) { XmToggleButtonCallbackStruct call_value; call_value.reason = XmCR_VALUE_CHANGED; call_value.event = NULL; call_value.set = TBG_Set(tg); menuSTrait->entryCallback(XtParent(tg), (Widget)tg, &call_value); } if ((! LabG_SkipCallback(tg)) && (TBG_ValueChangedCB(tg))) { if (XtIsRealized ((Widget)tg)) XFlush (XtDisplay (tg)); ToggleButtonCallback(tg, XmCR_VALUE_CHANGED, TBG_Set(tg), NULL); } } } _XmAppUnlock(app); } /**************************************************************** * * XmToggleButtonGadgetSetValue * This function sets the state of the toggle gadget. * ****************************************************************/ Boolean XmToggleButtonGadgetSetValue( Widget w, #if NeedWidePrototypes int newstate, int notify ) #else XmToggleButtonState newstate, Boolean notify ) #endif /* NeedWidePrototypes */ { XmToggleButtonGadget tg = (XmToggleButtonGadget) w; XmMenuSystemTrait menuSTrait; XtAppContext app = XtWidgetToApplicationContext(w); _XmAppLock(app); /* Can't set third state if we aren't in three state mode */ if ((newstate == XmINDETERMINATE) && (TBG_ToggleMode(tg) != XmTOGGLE_INDETERMINATE)) { _XmAppUnlock(app); return False; } if (TBG_Set(tg) != newstate) { TBG_Set(tg) = newstate; IsOn(tg) = newstate; if (XtIsRealized ((Widget)tg)) { if (TBG_IndOn(tg)) DrawToggle(tg); else { if (tg->gadget.shadow_thickness> 0) DrawToggleShadow (tg); if (TBG_FillOnSelect(tg) && !LabG_IsPixmap(tg)) DrawToggleLabel (tg); } if (LabG_IsPixmap(tg) || LabG_IsPixmapAndText(tg)) SetAndDisplayPixmap(tg, NULL, NULL); } if (notify) { /* UNDOING this fix ... */ /* CR 8904: Notify value_changed before entry so that state is */ /* reported correctly even if the entry callback resets it. */ menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(tg)), XmQTmenuSystem); if (menuSTrait != NULL) { XmToggleButtonCallbackStruct call_value; call_value.reason = XmCR_VALUE_CHANGED; call_value.event = NULL; call_value.set = TBG_Set(tg); menuSTrait->entryCallback(XtParent(tg), (Widget)tg, &call_value); } if ((! LabG_SkipCallback(tg)) && (TBG_ValueChangedCB(tg))) { if (XtIsRealized ((Widget)tg)) XFlush (XtDisplay (tg)); ToggleButtonCallback(tg, XmCR_VALUE_CHANGED, TBG_Set(tg), NULL); } } } _XmAppUnlock(app); return True; } /*********************************************************************** * * XmCreateToggleButtonGadget * Creates an instance of a togglebutton and returns the widget id. * ***********************************************************************/ Widget XmCreateToggleButtonGadget( Widget parent, char *name, Arg *arglist, Cardinal argCount ) { return XtCreateWidget(name,xmToggleButtonGadgetClass,parent,arglist,argCount); } Widget XmVaCreateToggleButtonGadget( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmToggleButtonGadgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedToggleButtonGadget( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmToggleButtonGadgetClass, parent, True, var, count); va_end(var); return w; } /********************************************************* * Functions for manipulating Secondary Resources. *********************************************************/ /* * GetPushBGSecResData() * Create a XmSecondaryResourceDataRec for each secondary resource; * Put the pointers to these records in an array of pointers; * Return the pointer to the array of pointers. */ /*ARGSUSED*/ static Cardinal GetToggleBGClassSecResData( WidgetClass w_class, /* unused */ XmSecondaryResourceData **data_rtn ) { int arrayCount = 0; XmBaseClassExt bcePtr; String resource_class, resource_name; XtPointer client_data; _XmProcessLock(); bcePtr = &( ToggleBGClassExtensionRec ); client_data = NULL; resource_class = NULL; resource_name = NULL; arrayCount = _XmSecondaryResourceData ( bcePtr, data_rtn, client_data, resource_name, resource_class, GetToggleBGClassSecResBase) ; _XmProcessUnlock(); return (arrayCount); } /* * GetToggleBGClassResBase () * return the address of the base of resources. */ /*ARGSUSED*/ static XtPointer GetToggleBGClassSecResBase( Widget widget, XtPointer client_data ) /* unused */ { XtPointer widgetSecdataPtr; int labg_cache_size = sizeof (XmLabelGCacheObjPart); int togglebg_cache_size = sizeof (XmToggleButtonGCacheObjPart); char *cp; widgetSecdataPtr = (XtPointer) (XtMalloc ( labg_cache_size + togglebg_cache_size + 1)); _XmProcessLock(); if (widgetSecdataPtr) { cp = (char *) widgetSecdataPtr; memcpy (cp, LabG_Cache(widget), labg_cache_size); cp += labg_cache_size; memcpy (cp, TBG_Cache(widget), togglebg_cache_size); } /* else Warning: error cannot allocate Memory */ _XmProcessUnlock(); return ( widgetSecdataPtr); } /* * DrawToggleLabel (tb) * Called when XmNindicatorOn is TRUE and XmNfillOnSelect is FALSE. * Fill toggle with selectColor or background depending on toggle * value, and draw label. */ static void DrawToggleLabel( XmToggleButtonGadget tb ) { Dimension margin = tb->gadget.highlight_thickness + tb->gadget.shadow_thickness; Position fx = tb->rectangle.x + margin; Position fy = tb->rectangle.y + margin; int fw = tb->rectangle.width - 2 * margin; int fh = tb->rectangle.height - 2 * margin; Boolean restore_gc = False; GC tmp_gc = NULL, fill_gc; if ((LabG_TopShadowColor(tb) == TBG_SelectColor(tb)) || (LabG_BottomShadowColor(tb) == TBG_SelectColor(tb))) { fx += 1; fy += 1; fw -= 2; fh -= 2; } if (fw < 0 || fh < 0) return; switch (tb->toggle.visual_set) { case XmUNSET: fill_gc = TBG_UnselectGC(tb); break; case XmSET: fill_gc = TBG_SelectGC(tb); break; case XmINDETERMINATE: { XGCValues values; /* Fetch the select_color GetGC() actually used. */ XGetGCValues(XtDisplay(tb), TBG_SelectGC(tb), GCForeground, &values); values.background = TBG_UnselectColor(tb); XChangeGC(XtDisplay((Widget)tb), TBG_IndeterminateGC(tb), GCForeground|GCBackground, &values); fill_gc = TBG_IndeterminateGC(tb); break; } default: assert(False); return; } XFillRectangle (XtDisplay(tb), XtWindow(tb), fill_gc, fx, fy, fw, fh); if (LabG_Foreground(tb) == TBG_SelectColor(tb) && (IsOn(tb) == XmSET)) { tmp_gc = LabG_NormalGC(tb); LabG_NormalGC(tb) = TBG_BackgroundGC(tb); restore_gc = True; } { XtExposeProc expose; _XmProcessLock(); expose = xmLabelGadgetClassRec.rect_class.expose; _XmProcessUnlock(); (* expose) ((Widget)tb, NULL, NULL); } if (restore_gc) { /* CR 9791: Label's normal_gc has a dynamic clip_mask. */ XSetClipMask(XtDisplay(tb), TBG_BackgroundGC(tb), None); LabG_NormalGC(tb) = tmp_gc; } } /* * DrawEtchedInMenu (tb) * Called when in a Menu and EtchedInMenu is TRUE. * And when XmNindicatorOn is FALSE and XmNfillOnSelect is FALSE; * or when XmNindicatorOn is TRUE. * Fill background with the arm_gc and draw label. */ static void DrawEtchedInMenu( XmToggleButtonGadget tb ) { Dimension margin = tb->gadget.highlight_thickness + tb->gadget.shadow_thickness; Position fx = tb->rectangle.x + margin; Position fy = tb->rectangle.y + margin; int fw = tb->rectangle.width - 2 * margin; int fh = tb->rectangle.height - 2 * margin; Boolean restore_gc = False; GC tmp_gc = NULL; #ifdef FIX_1395 Boolean restore_bgc = False; GC tmp_bgc = NULL; #endif XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) tb)); Boolean etched_in = dpy->display.enable_etched_in_menu; if ((LabG_TopShadowColor(tb) == TBG_SelectColor(tb)) || (LabG_BottomShadowColor(tb) == TBG_SelectColor(tb))) { fx += 1; fy += 1; fw -= 2; fh -= 2; } if (fw < 0 || fh < 0) return; XFillRectangle (XtDisplay(tb), XtWindow(tb), TBG_Armed(tb) ? TBG_ArmGC(tb) : TBG_BackgroundGC(tb), fx, fy, fw, fh); if (TBG_Armed(tb)) { Pixel select_pix; Widget wid = XtParent(tb); XmGetColors(XtScreen(wid), wid->core.colormap, wid->core.background_pixel, NULL, NULL, NULL, &select_pix); if (LabG_Foreground(tb) == select_pix) { tmp_gc = LabG_NormalGC(tb); LabG_NormalGC(tb) = TBG_BackgroundGC(tb); restore_gc = True; } #ifdef FIX_1395 { XGCValues values; /* Fetch the select_color GetGC() actually used. */ XGetGCValues(XtDisplay(tb), TBG_SelectGC(tb), GCBackground, &values); /* Before label expose call we should change bgc to correct color and then restore it. */ if (values.background != select_pix) { XChangeGC(XtDisplay((Widget)tb), TBG_SelectGC(tb), GCBackground, &values); tmp_bgc = LabG_BackgroundGC(tb); LabG_BackgroundGC(tb) = TBG_SelectGC(tb); restore_bgc = True; } } #endif } { XtExposeProc expose; _XmProcessLock(); expose = xmLabelGadgetClassRec.rect_class.expose; _XmProcessUnlock(); (* expose) ((Widget)tb, NULL, NULL); } if (restore_gc) { /* CR 9791: Label's normal_gc has a dynamic clip_mask. */ XSetClipMask(XtDisplay(tb), TBG_BackgroundGC(tb), None); LabG_NormalGC(tb) = tmp_gc; } #ifdef FIX_1395 if (restore_bgc) { LabG_BackgroundGC(tb) = tmp_bgc; } #endif } /* * DrawToggleShadow (tb) * - Should be called only if ToggleShadow are to be drawn ; * if the IndicatorOn resource is set to false top and bottom shadows * will be switched depending on whether the Toggle is selected or * unselected. */ static void DrawToggleShadow( XmToggleButtonGadget tb ) { GC top_gc, bot_gc; int dx, dy, width, height; int hilite_thickness; if (TBG_IndOn(tb) || (IsOn(tb) == XmUNSET)) { top_gc = LabG_TopShadowGC(tb); bot_gc = LabG_BottomShadowGC(tb); } else if (IsOn(tb) == XmINDETERMINATE) { top_gc = bot_gc = TBG_IndeterminateBoxGC(tb); } else { top_gc = LabG_BottomShadowGC(tb); bot_gc = LabG_TopShadowGC(tb); } hilite_thickness = tb->gadget.highlight_thickness; dx = (int)(tb->rectangle.x + hilite_thickness); dy = (int)(tb->rectangle.y + hilite_thickness); width = (int) ( tb->rectangle.width - (hilite_thickness << 1)); height = (int) ( tb->rectangle.height - (hilite_thickness << 1)); XmeDrawShadows (XtDisplay (tb), XtWindow (tb), top_gc, bot_gc, dx, dy, width, height, tb->gadget.shadow_thickness, XmSHADOW_OUT); } /* BEGIN OSF Fix pir 1778 */ /************************************************************************ * * SetToggleSize(newtbg) * Set size properly when XmNselectPixmap or XmNselectInsensitivePixmaps * are set in addition to the corresponding labelPixmaps. Have to pick * the largest dimensions. * ************************************************************************/ static void SetToggleSize( XmToggleButtonGadget newtbg) { unsigned int maxW, maxH, tmpW, tmpH; maxW = maxH = tmpW = tmpH = 0; /* We know it's a pixmap so find out how how big it is */ if (XtIsSensitive ((Widget) newtbg)) { if (!IsNull(PixmapOn(newtbg))) { XmeGetPixmapData(XtScreen(newtbg), PixmapOn(newtbg), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapOff(newtbg))) { XmeGetPixmapData(XtScreen(newtbg), PixmapOff(newtbg), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapInd(newtbg))) { XmeGetPixmapData(XtScreen(newtbg), PixmapInd(newtbg), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } } else { if (!IsNull(PixmapInsenOn(newtbg))) { XmeGetPixmapData(XtScreen(newtbg), PixmapInsenOn(newtbg), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapInsenOff(newtbg))) { XmeGetPixmapData(XtScreen(newtbg), PixmapInsenOff(newtbg), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } if (!IsNull(PixmapInsenInd(newtbg))) { XmeGetPixmapData(XtScreen(newtbg), PixmapInsenInd(newtbg), NULL, NULL, NULL, NULL, NULL, NULL, &tmpW, &tmpH); ASSIGN_MAX(maxW, tmpW); ASSIGN_MAX(maxH, tmpH); } } LabG_TextRect(newtbg).width = (unsigned short) maxW; LabG_TextRect(newtbg).height = (unsigned short) maxH; /* Invoke Label's SetSize procedure. */ { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); (* resize) ((Widget) newtbg); } } /* END OSF Fix pir 1778 */ /* * DefaultSelectColor - an XtResourceDefaultProc for generating the * default select color. This may require examining the * XmNindicatorType and XmNhighlightColor resources, which will * happen to have real values only because they appear before * XmNselectColor in the resource list. */ static void DefaultSelectColor(Widget widget, int offset, XrmValue *value) { XmToggleButtonGadget tb = (XmToggleButtonGadget) widget; Boolean force_highlight = FALSE; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(widget)); Boolean enable_toggle_color = xm_dpy->display.enable_toggle_color; if (enable_toggle_color) { /* This code may misbehave for erroneous ind_type values. */ if (IsOneOfMany(TBG_IndType(tb))) { force_highlight = TRUE; } else if ((TBG_IndType(tb) == XmINVALID_TYPE) && XmIsRowColumn(XtParent(widget))) { XtVaGetValues(XtParent(widget), XmNradioBehavior, &force_highlight, NULL); } } if (force_highlight) { value->size = sizeof(LabG_HighlightColor(tb)); value->addr = (char *) &LabG_HighlightColor(tb); } else _XmSelectColorDefault(widget, offset, value); } /* * NormalizeIndOn - return the normalized value of XmNindicatorOn, * replacing XmINDICATOR_FILL and XmINDICATOR_BOX with the proper * absolute values. */ static unsigned char NormalizeIndOn(XmToggleButtonGadget tb) { unsigned char value = TBG_IndOn(tb); /* Convert XmINDICATOR_FILL to XmINDICATOR_CHECK_BOX? */ if (value == XmINDICATOR_FILL) { /* This routine may be called frequently, so reach directly into */ /* the XmDisplay rather than calling XtGetValues. */ XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) tb)); if (xm_dpy->display.enable_toggle_visual) value = XmINDICATOR_CHECK_BOX; } /* Convert XmINDICATOR_BOX to XmINDICATOR_3D_BOX (XmINDICATOR_FILL). */ else if (value == XmINDICATOR_BOX) { value = XmINDICATOR_3D_BOX; } return value; } /* * NormalizeIndType - return the normalized value of XmNindicatorType, * replacing XmONE_OF_MANY with the proper absolute value. */ static unsigned char NormalizeIndType(XmToggleButtonGadget tb) { unsigned char value = TBG_IndType(tb); if (value == XmONE_OF_MANY) { /* This routine may be called frequently, so reach directly into */ /* the XmDisplay rather than calling XtGetValues. */ XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) tb)); if (xm_dpy->display.enable_toggle_visual) value = XmONE_OF_MANY_ROUND; else value = XmONE_OF_MANY_DIAMOND; } return value; } motif-2.3.8/lib/Xm/DropSMgrI.h0000644000175000017500000004277413145162623012715 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDropSMgrI_h #define _XmDropSMgrI_h #include #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for DropSMgr.c ********/ extern void _XmDSMUpdate( XmDropSiteManagerObject dsm, XtPointer clientData, XtPointer callData) ; extern int _XmDSMGetTreeFromDSM( XmDropSiteManagerObject dsm, Widget shell, XtPointer dataPtr) ; extern Boolean _XmDropSiteShell( Widget widget) ; extern Boolean _XmDropSiteWrapperCandidate( Widget widget) ; extern Widget _XmGetActiveDropSite( Widget widget) ; extern void _XmSyncDropSiteTree( Widget shell) ; extern void _XmIEndUpdate(XtPointer client_data, XtIntervalId *interval_id); /******** End Private Function Declarations ********/ /* This is used for maintenance of the Pre-Register drop site tree */ #define XmDROP_SITE_LEFT_EDGE (1<<0) #define XmDROP_SITE_RIGHT_EDGE (1<<1) #define XmDROP_SITE_TOP_EDGE (1<<2) #define XmDROP_SITE_BOTTOM_EDGE (1<<3) #define XmDSM_DS_LEAF (1<<0) #define XmDSM_DS_INTERNAL (1<<1) #define XmDSM_DS_HAS_REGION (1<<2) #define XmDSM_T_CLOSE (1<<0) /* * Notice that the top of the record is the samy layout as * an XRectangle. This is important when it is passed to * IntersectWithAncestors by DetectAndInsertAllClippers. */ typedef struct _XmDSClipRect { Position x; Position y; Dimension width; Dimension height; unsigned char detected; } XmDSClipRect; #define CHILDREN_INCREMENT 10 typedef struct _XmDSStatusRec { unsigned int remote:1; unsigned int leaf:1; unsigned int shell:1; unsigned int type:1; unsigned int animation_style:3; unsigned int internal:1; unsigned int has_region:1; unsigned int activity:1; unsigned int registered:1; } XmDSStatusRec, * XmDSStatus; typedef struct _XmDSFullInfoRec { XmDSStatusRec status; XtPointer parent; unsigned short import_targets_ID; unsigned char operations; XmRegion region; XtCallbackProc drag_proc; XtCallbackProc drop_proc; Widget widget; unsigned short num_children; unsigned short max_children; XtPointer *children; /* Support for subresource magic; needed ONLY in Full structure */ unsigned char type; unsigned char animation_style; unsigned char activity; Atom *import_targets; Cardinal num_import_targets; XRectangle *rectangles; Cardinal num_rectangles; /* A complete laundry list of animation fields */ Pixmap animation_pixmap; Cardinal animation_pixmap_depth; Pixmap animation_mask; Pixel background; Pixel foreground; Pixel highlight_color; Pixmap highlight_pixmap; Dimension highlight_thickness; Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; Dimension shadow_thickness; Dimension border_width; XtPointer client_data; } XmDSFullInfoRec, * XmDSFullInfo; /* One gazillion typedefs to allow for dataspace efficiency */ typedef struct _XmDSLocalLeafRec { XtPointer parent; unsigned short import_targets_ID; unsigned char operations; XmRegion region; XtCallbackProc drag_proc; XtCallbackProc drop_proc; Widget widget; XtPointer client_data; } XmDSLocalLeafRec, * XmDSLocalLeaf; typedef struct _XmDSLocalNodeRec { XtPointer parent; unsigned short import_targets_ID; unsigned char operations; XmRegion region; unsigned short num_children; unsigned short max_children; XtPointer *children; XtCallbackProc drag_proc; XtCallbackProc drop_proc; Widget widget; XtPointer client_data; } XmDSLocalNodeRec, * XmDSLocalNode; typedef struct _XmDSLocalPixmapStyleRec { Pixmap animation_pixmap; Cardinal animation_pixmap_depth; Pixmap animation_mask; } XmDSLocalPixmapStyleRec, *XmDSLocalPixmapStyle; typedef struct _XmDSRemoteLeafRec { XtPointer parent; unsigned short import_targets_ID; unsigned char operations; XmRegion region; } XmDSRemoteLeafRec, * XmDSRemoteLeaf; typedef struct _XmDSRemoteNodeRec { XtPointer parent; unsigned short import_targets_ID; unsigned char operations; XmRegion region; unsigned short num_children; unsigned short max_children; XtPointer *children; } XmDSRemoteNodeRec, * XmDSRemoteNode; /* These style records are only used for remote trees */ typedef struct _XmDSRemoteNoneStyleRec { Dimension border_width; } XmDSRemoteNoneStyleRec, * XmDSRemoteNoneStyle; typedef struct _XmDSRemoteHighlightStyleRec { Pixel highlight_color; Pixmap highlight_pixmap; Pixel background; /* in case of highlight pixmaps */ Dimension highlight_thickness; Dimension border_width; } XmDSRemoteHighlightStyleRec, * XmDSRemoteHighlightStyle; typedef struct _XmDSRemoteShadowStyleRec { Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; Pixel foreground; /* in case of shadow pixmaps */ Dimension shadow_thickness; Dimension highlight_thickness; Dimension border_width; } XmDSRemoteShadowStyleRec, * XmDSRemoteShadowStyle; typedef struct _XmDSRemotePixmapStyleRec { Pixmap animation_pixmap; Cardinal animation_pixmap_depth; Pixmap animation_mask; Pixel background; Pixel foreground; Dimension shadow_thickness; Dimension highlight_thickness; Dimension border_width; } XmDSRemotePixmapStyleRec, * XmDSRemotePixmapStyle; /* Now we permute the preceding types */ typedef struct _XmDSLocalNoneLeafRec { XmDSStatusRec status; XmDSLocalLeafRec info; } XmDSLocalNoneLeafRec, * XmDSLocalNoneLeaf; typedef struct _XmDSLocalNoneNodeRec { XmDSStatusRec status; XmDSLocalNodeRec info; } XmDSLocalNoneNodeRec, * XmDSLocalNoneNode; typedef struct _XmDSLocalHighlightLeafRec { XmDSStatusRec status; XmDSLocalLeafRec info; } XmDSLocalHighlightLeafRec, * XmDSLocalHighlightLeaf; typedef struct _XmDSLocalHighlightNodeRec { XmDSStatusRec status; XmDSLocalNodeRec info; } XmDSLocalHighlightNodeRec, * XmDSLocalHighlightNode; typedef struct _XmDSLocalShadowLeafRec { XmDSStatusRec status; XmDSLocalLeafRec info; } XmDSLocalShadowLeafRec, * XmDSLocalShadowLeaf; typedef struct _XmDSLocalShadowNodeRec { XmDSStatusRec status; XmDSLocalNodeRec info; } XmDSLocalShadowNodeRec, * XmDSLocalShadowNode; typedef struct _XmDSLocalPixmapLeafRec { XmDSStatusRec status; XmDSLocalLeafRec info; XmDSLocalPixmapStyleRec animation_data; } XmDSLocalPixmapLeafRec, * XmDSLocalPixmapLeaf; typedef struct _XmDSLocalPixmapNodeRec { XmDSStatusRec status; XmDSLocalNodeRec info; XmDSLocalPixmapStyleRec animation_data; } XmDSLocalPixmapNodeRec, * XmDSLocalPixmapNode; typedef struct _XmDSRemoteNoneLeafRec { XmDSStatusRec status; XmDSRemoteLeafRec info; XmDSRemoteNoneStyleRec animation_data; } XmDSRemoteNoneLeafRec, * XmDSRemoteNoneLeaf; typedef struct _XmDSRemoteNoneNodeRec { XmDSStatusRec status; XmDSRemoteNodeRec info; XmDSRemoteNoneStyleRec animation_data; } XmDSRemoteNoneNodeRec, * XmDSRemoteNoneNode; typedef struct _XmDSRemoteHighlightLeafRec { XmDSStatusRec status; XmDSRemoteLeafRec info; XmDSRemoteHighlightStyleRec animation_data; } XmDSRemoteHighlightLeafRec, * XmDSRemoteHighlightLeaf; typedef struct _XmDSRemoteHighlightNodeRec { XmDSStatusRec status; XmDSRemoteNodeRec info; XmDSRemoteHighlightStyleRec animation_data; } XmDSRemoteHighlightNodeRec, * XmDSRemoteHighlightNode; typedef struct _XmDSRemoteShadowLeafRec { XmDSStatusRec status; XmDSRemoteLeafRec info; XmDSRemoteShadowStyleRec animation_data; } XmDSRemoteShadowLeafRec, * XmDSRemoteShadowLeaf; typedef struct _XmDSRemoteShadowNodeRec { XmDSStatusRec status; XmDSRemoteNodeRec info; XmDSRemoteShadowStyleRec animation_data; } XmDSRemoteShadowNodeRec, * XmDSRemoteShadowNode; typedef struct _XmDSRemotePixmapLeafRec { XmDSStatusRec status; XmDSRemoteLeafRec info; XmDSRemotePixmapStyleRec animation_data; } XmDSRemotePixmapLeafRec, * XmDSRemotePixmapLeaf; typedef struct _XmDSRemotePixmapNodeRec { XmDSStatusRec status; XmDSRemoteNodeRec info; XmDSRemotePixmapStyleRec animation_data; } XmDSRemotePixmapNodeRec, * XmDSRemotePixmapNode; typedef union _XmDSInfoRec { XmDSStatusRec status; XmDSLocalNoneLeafRec local_none_leaf; XmDSLocalNoneNodeRec local_none_node; XmDSLocalHighlightLeafRec local_highlight_leaf; XmDSLocalHighlightNodeRec local_highlight_node; XmDSLocalShadowLeafRec local_shadow_leaf; XmDSLocalShadowNodeRec local_shadow_node; XmDSLocalPixmapLeafRec local_pixmap_leaf; XmDSLocalPixmapNodeRec local_pixmap_node; XmDSRemoteNoneLeafRec remote_none_leaf; XmDSRemoteNoneNodeRec remote_none_node; XmDSRemoteHighlightLeafRec remote_highlight_leaf; XmDSRemoteHighlightNodeRec remote_highlight_node; XmDSRemoteShadowLeafRec remote_shadow_leaf; XmDSRemoteShadowNodeRec remote_shadow_node; XmDSRemotePixmapLeafRec remote_pixmap_leaf; XmDSRemotePixmapNodeRec remote_pixmap_node; } XmDSInfoRec, * XmDSInfo; /* A few macros to deal with the typedefs */ #define GetDSRemote(ds) (((XmDSStatus)(ds))->remote) #define GetDSLeaf(ds) (((XmDSStatus)(ds))->leaf) #define GetDSShell(ds) (((XmDSStatus)(ds))->shell) #define GetDSAnimationStyle(ds) (((XmDSStatus)(ds))->animation_style) #define GetDSType(ds) \ ((((XmDSStatus)(ds))->type) ? \ XmDROP_SITE_COMPOSITE \ : \ XmDROP_SITE_SIMPLE) #define GetDSRegistered(ds) (((XmDSStatus)(ds))->registered) #define GetDSInternal(ds) (((XmDSStatus)(ds))->internal) #define GetDSHasRegion(ds) (((XmDSStatus)(ds))->has_region) #define GetDSActivity(ds) \ ((((XmDSStatus)(ds))->activity) ? \ XmDROP_SITE_ACTIVE \ : \ XmDROP_SITE_INACTIVE) #define GetDSImportTargetsID(ds) \ (((XmDSLocalNoneLeaf)(ds))->info.import_targets_ID) #define GetDSOperations(ds) \ (((XmDSLocalNoneLeaf)(ds))->info.operations) #define GetDSRegion(ds) (((XmDSLocalNoneLeaf)(ds))->info.region) #define GetDSParent(ds) \ ((GetDSShell(ds)) ? \ NULL \ : \ (((XmDSLocalNoneLeaf)(ds))->info.parent)) #define GetDSUpdateLevel(ds) \ ((GetDSShell(ds)) ? \ ((long)(((XmDSLocalNoneNode)(ds))->info.parent)) \ : \ -1) #define GetDSDragProc(ds) \ ((GetDSRemote(ds)) ? \ (XtCallbackProc)NULL \ : \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.drag_proc) \ : \ (((XmDSLocalNoneLeaf)(ds))->info.drag_proc))) #define GetDSDropProc(ds) \ ((GetDSRemote(ds)) ? \ (XtCallbackProc)NULL \ : \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.drop_proc) \ : \ (((XmDSLocalNoneLeaf)(ds))->info.drop_proc))) #define GetDSClientData(ds) \ ((GetDSRemote(ds)) ? \ NULL \ : \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.client_data) \ : \ (((XmDSLocalNoneLeaf)(ds))->info.client_data))) #define GetDSWidget(ds) \ ((GetDSRemote(ds)) ? \ (Widget)NULL \ : \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.widget) \ : \ (((XmDSLocalNoneLeaf)(ds))->info.widget))) #define GetDSNumChildren(ds) \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.num_children) \ : \ 0) #define GetDSMaxChildren(ds) \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.max_children) \ : \ 0) #define GetDSChildren(ds) \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.children) \ : \ (XtPointer*)NULL) #define GetDSChild(ds, position) \ ((GetDSType(ds)) ? \ (((XmDSLocalNoneNode)(ds))->info.children[position]) \ : \ NULL) #define GetDSLocalAnimationPart(ds) \ ((GetDSType(ds)) ? \ ((GetDSAnimationStyle(ds) == XmDRAG_UNDER_PIXMAP) ? \ &(((XmDSLocalPixmapNode)(ds))->animation_data) \ : \ NULL) \ : \ ((GetDSAnimationStyle(ds) == XmDRAG_UNDER_PIXMAP) ? \ &(((XmDSLocalPixmapLeaf)(ds))->animation_data) \ : \ NULL)) \ #define GetDSRemoteAnimationPart(ds) \ ((GetDSType(ds)) ? \ &(((XmDSRemoteNoneNode)(ds))->animation_data) \ : \ &(((XmDSRemoteNoneLeaf)(ds))->animation_data)) #define SetDSRemote(ds, newRemote) \ (((XmDSStatus)(ds))->remote) = (unsigned int)(newRemote) #define SetDSLeaf(ds, newLeaf) \ (((XmDSStatus)(ds))->leaf) = (unsigned int)(newLeaf) #define SetDSShell(ds, newShell) \ (((XmDSStatus)(ds))->shell) = (unsigned int)(newShell) #define SetDSAnimationStyle(ds, newAnimationStyle) \ (((XmDSStatus)(ds))->animation_style) = \ (unsigned int)(newAnimationStyle) #define SetDSType(ds, newType) \ (((XmDSStatus)(ds))->type) = \ ( ((newType) == XmDROP_SITE_COMPOSITE) ? \ 1 \ : \ 0) #define SetDSRegistered(ds,newRegistered) \ (((XmDSStatus)(ds))->registered) = \ (unsigned int)(newRegistered) #define SetDSInternal(ds, newInternal) \ (((XmDSStatus)(ds))->internal) = (unsigned int)(newInternal) #define SetDSHasRegion(ds, newHasRegion) \ (((XmDSStatus)(ds))->has_region) = (unsigned int)(newHasRegion) #define SetDSActivity(ds, newActivity) \ (((XmDSStatus)(ds))->activity) = \ ( ((newActivity) == XmDROP_SITE_ACTIVE) ? \ 1 \ : \ 0) #define SetDSImportTargetsID(ds, newImportTargetsID) \ (((XmDSLocalNoneLeaf)(ds))->info.import_targets_ID) = \ (unsigned short)(newImportTargetsID) #define SetDSOperations(ds, newOperations) \ (((XmDSLocalNoneLeaf)(ds))->info.operations) = \ (unsigned char)(newOperations) #define SetDSRegion(ds, newRegion) \ (((XmDSLocalNoneLeaf)(ds))->info.region) = \ (XmRegion)(newRegion) #define SetDSParent(ds, newParent) \ ((GetDSShell(ds)) ? \ NULL \ : \ ((((XmDSLocalNoneLeaf)(ds))->info.parent) = \ (XtPointer)(newParent))) #define SetDSUpdateLevel(ds, newUpdateLevel) \ ((GetDSShell(ds)) ? \ ((((XmDSLocalNoneNode)(ds))->info.parent) = \ (XtPointer)(newUpdateLevel)) \ : \ 0) #define SetDSDragProc(ds, newDragProc) \ ((GetDSRemote(ds)) ? \ (XtCallbackProc)NULL \ : \ ((GetDSType(ds)) ? \ ((((XmDSLocalNoneNode)(ds))->info.drag_proc) = \ (XtCallbackProc)(newDragProc)) \ : \ ((((XmDSLocalNoneLeaf)(ds))->info.drag_proc) = \ (XtCallbackProc)(newDragProc)))) #define SetDSDropProc(ds, newDropProc) \ ((GetDSRemote(ds)) ? \ (XtCallbackProc)NULL \ : \ ((GetDSType(ds)) ? \ ((((XmDSLocalNoneNode)(ds))->info.drop_proc) = \ (XtCallbackProc)(newDropProc)) \ : \ ((((XmDSLocalNoneLeaf)(ds))->info.drop_proc) = \ (XtCallbackProc)(newDropProc)))) #define SetDSClientData(ds, clientData) \ ((GetDSRemote(ds)) ? \ NULL \ : \ ((GetDSType(ds)) ? \ ((((XmDSLocalNoneNode)(ds))->info.client_data) = \ (XtPointer)(clientData)) \ : \ ((((XmDSLocalNoneLeaf)(ds))->info.client_data) = \ (XtPointer)(clientData)))) #define SetDSWidget(ds, newWidget) \ ((GetDSRemote(ds)) ? \ (Widget)NULL \ : \ ((GetDSType(ds)) ? \ (((((XmDSLocalNoneNode)(ds))->info.widget) = \ (Widget)(newWidget))) \ : \ (((((XmDSLocalNoneLeaf)(ds))->info.widget) = \ (Widget)(newWidget))))) #define SetDSNumChildren(ds, newNumChildren) \ ((GetDSType(ds)) ? \ ((((XmDSLocalNoneNode)(ds))->info.num_children) = \ (unsigned short)(newNumChildren)) \ : \ 0) #define SetDSMaxChildren(ds, newMaxChildren) \ ((GetDSType(ds)) ? \ ((((XmDSLocalNoneNode)(ds))->info.max_children) = \ (unsigned short)(newMaxChildren)) \ : \ 0) #define SetDSChildren(ds, newChildren) \ ((GetDSType(ds)) ? \ ((((XmDSLocalNoneNode)(ds))->info.children) = \ (XtPointer *)(newChildren)) \ : \ (XtPointer *)NULL) /******** Private Function Declarations ********/ extern void _XmDSIAddChild( XmDSInfo parentInfo, XmDSInfo childInfo, Cardinal childPosition) ; extern void _XmDSIRemoveChild( XmDSInfo parentInfo, XmDSInfo childInfo) ; extern Cardinal _XmDSIGetChildPosition( XmDSInfo parentInfo, XmDSInfo childInfo) ; extern void _XmDSIReplaceChild( XmDSInfo oldChildInfo, XmDSInfo newChildInfo) ; extern void _XmDSISwapChildren( XmDSInfo parentInfo, Cardinal position1, Cardinal position2) ; extern void _XmDSIDestroy( XmDSInfo info, #if NeedWidePrototypes int substructures) ; #else Boolean substructures) ; #endif /* NeedWidePrototypes */ extern Dimension _XmDSIGetBorderWidth( XmDSInfo info) ; /******** End Private Function Declarations ********/ #define AddDSChild _XmDSIAddChild #define RemoveDSChild _XmDSIRemoveChild #define SwapDSChildren _XmDSISwapChildren #define ReplaceDSChild _XmDSIReplaceChild #define GetDSChildPosition _XmDSIGetChildPosition #define DestroyDS _XmDSIDestroy #define GetDSBorderWidth _XmDSIGetBorderWidth externalref XtResource _XmDSResources[]; externalref Cardinal _XmNumDSResources; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDropSMgrI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MenuProcP.h0000644000175000017500000000250212672140200012727 00000000000000/* $XConsortium: MenuProcP.h /main/4 1995/07/15 20:52:51 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmMenuProcP_h #define _XmMenuProcP_h #include #ifdef __cplusplus extern "C" { #endif struct _XmTranslRec { XtTranslations translations; struct _XmTranslRec * next; }; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuProcP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/TearOffB.c0000644000175000017500000003703713145162623012526 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: TearOffB.c /main/12 1996/03/06 17:09:22 pascale $" #endif #endif /* * Include files & Static Routine Definitions */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "MapEventsI.h" #include "MessagesI.h" #include "RCMenuI.h" #include "RepTypeI.h" #include "TearOffI.h" #include "XmI.h" /******** Static Function Declarations ********/ static void HeightDefault( Widget widget, int offset, XrmValue *value) ; static void GetSeparatorGC( XmTearOffButtonWidget tob) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void BDrag( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void BActivate( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void KActivate( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void ClassInitialize( void ); static void ClassPartInitialize( WidgetClass wc) ; /******** End Static Function Declarations ********/ #define DEFAULT_HEIGHT 10 /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNmargin, sizeof (Dimension), XtOffsetOf( struct _XmTearOffButtonRec, tear_off_button.margin), XmeFromHorizontalPixels, XmeToHorizontalPixels }, }; /* Resource list for Separator */ static XtResource resources[] = { { XmNseparatorType, XmCSeparatorType, XmRSeparatorType, sizeof (unsigned char), XtOffsetOf( struct _XmTearOffButtonRec, tear_off_button.separator_type), XmRImmediate, (XtPointer) XmSHADOW_ETCHED_OUT_DASH }, { XmNmargin, XmCMargin, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmTearOffButtonRec, tear_off_button.margin), XmRImmediate, (XtPointer) 0 }, /* The magic value will signal recomputeSize setting */ { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmTearOffButtonRec, tear_off_button.set_recompute_size), XmRImmediate, (XtPointer) False }, { XmNheight, XmCDimension, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf( struct _WidgetRec, core.height), XmRCallProc, (XtPointer) HeightDefault }, }; /*************************************<->************************************* * * * Description: translation tables for class: PushButton * ----------- * * Matches events with string descriptors for internal routines. * *************************************<->***********************************/ #define overrideTranslations _XmTearOffB_overrideTranslations /*************************************<->************************************* * * * Description: action list for class: TearOffButton * ----------- * * Matches string descriptors with internal routines. * Note that Primitive will register additional event handlers * for traversal. * *************************************<->***********************************/ static XtActionsRec actionsList[] = { {"BDrag", BDrag }, {"BActivate", BActivate }, {"KActivate", KActivate }, }; externaldef(xmtearoffbuttonclassrec) XmTearOffButtonClassRec xmTearOffButtonClassRec = { { /* core_class record */ /* superclass */ (WidgetClass) &xmPushButtonClassRec, /* class_name */ "XmTearOffButton", /* widget_size */ sizeof(XmTearOffButtonRec), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterlv */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ XtInheritResize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ NULL, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* primitive_class record */ /* Primitive border_highlight */ XmInheritBorderHighlight, /* Primitive border_unhighlight */ XmInheritBorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ XmInheritArmAndActivate, /* get resources */ syn_resources, /* num get_resources */ XtNumber(syn_resources), /* extension */ NULL, }, { /* label_class record */ /* setOverrideCallback */ XmInheritWidgetProc, /* menu procedures */ XmInheritMenuProc, /* menu traversal xlation */ XtInheritTranslations, /* extension */ (XtPointer) NULL, }, { /* pushbutton_class record */ /* extension */ (XtPointer) NULL, }, { /* tearoffbutton_class record */ /* Button override xlation */ XtInheritTranslations, } }; externaldef(xmtearoffbuttonwidgetclass) WidgetClass xmTearOffButtonWidgetClass = (WidgetClass)&xmTearOffButtonClassRec; /********************************************************************* * * HeightDefault * This procedure provides the dynamic default behavior for * the height. It the height is not explicitly set by the user * then, a default is given and recomputeSize will be set True in * Initialize, which will have RC probably change it to suit it needs. * If this is not called, recomputeSize will be False * *********************************************************************/ /*ARGSUSED*/ static void HeightDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { static Dimension default_height = DEFAULT_HEIGHT ; XmTearOffButtonWidget tob = (XmTearOffButtonWidget)widget; value->addr = (XPointer) &default_height; tob->tear_off_button.set_recompute_size = True; } /************************************************************************ * * GetSeparatorGC * Get the graphics context used for drawing the separator. * ************************************************************************/ static void GetSeparatorGC( XmTearOffButtonWidget tob ) { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground; values.foreground = tob->primitive.foreground; values.background = tob->core.background_pixel; if (tob -> tear_off_button.separator_type == XmSINGLE_DASHED_LINE || tob -> tear_off_button.separator_type == XmDOUBLE_DASHED_LINE) { valueMask = valueMask | GCLineStyle; values.line_style = LineDoubleDash; } tob->tear_off_button.separator_GC = XtGetGC ((Widget) tob, valueMask, &values); } /************************************************************************ * * ClassInitialize * ************************************************************************/ static void ClassInitialize( void ) { xmTearOffButtonClassRec.tearoffbutton_class.translations = (String)XtParseTranslationTable(overrideTranslations); } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmTEAROFF_BUTTON_BIT); } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmTearOffButtonWidget new_w = (XmTearOffButtonWidget) nw ; XtTranslations trans; GetSeparatorGC((XmTearOffButtonWidget)nw); _XmProcessLock(); trans = (XtTranslations) ((XmTearOffButtonClassRec *) XtClass(nw))->tearoffbutton_class.translations; _XmProcessUnlock(); XtOverrideTranslations(nw, trans); if(!XmRepTypeValidValue(XmRID_SEPARATOR_TYPE, new_w->tear_off_button.separator_type, (Widget) new_w)) { new_w -> tear_off_button.separator_type = XmSHADOW_ETCHED_OUT_DASH; } /* force the orientation */ new_w->tear_off_button.orientation = XmHORIZONTAL ; /* if set_recompute_size is True, this widget didn't have a specific height, so set its recompute_size to True, so that RCLayout can override it. if set_recompute_size is False, a specific height was given, so force recompute_size to False */ if (new_w->tear_off_button.set_recompute_size) { new_w->label.recompute_size = True; new_w->tear_off_button.set_recompute_size = False ; } else new_w->label.recompute_size = False; } /************************************************************************ * * Redisplay (tob, event, region) * Description: * ----------- * Cause the widget, identified by tob, to be redisplayed. * ************************************************************************/ /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmTearOffButtonWidget tob = (XmTearOffButtonWidget) wid ; /* * Where do we check for dependency on MenyType ?? */ if (XtIsRealized((Widget)tob)) { XtExposeProc expose; XmeDrawSeparator(XtDisplay(tob), XtWindow(tob), tob->primitive.top_shadow_GC, tob->primitive.bottom_shadow_GC, tob->tear_off_button.separator_GC, tob->primitive.highlight_thickness, tob->primitive.highlight_thickness, tob->core.width - 2*tob->primitive.highlight_thickness, tob->core.height - 2*tob->primitive.highlight_thickness, tob->primitive.shadow_thickness, tob->tear_off_button.margin, tob->tear_off_button.orientation, tob->tear_off_button.separator_type); /* envelop primitive expose method for highlight */ _XmProcessLock(); expose = xmPrimitiveClassRec.core_class.expose; _XmProcessUnlock(); (*expose)(wid,event, region) ; } } /************************************************************************ * * Destroy * Remove the callback lists. * ************************************************************************/ static void Destroy( Widget wid ) { XtReleaseGC (wid, ((XmTearOffButtonWidget) wid)->tear_off_button.separator_GC); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmTearOffButtonWidget current = (XmTearOffButtonWidget) cw ; XmTearOffButtonWidget new_w = (XmTearOffButtonWidget) nw ; Boolean flag = FALSE; if(!XmRepTypeValidValue(XmRID_SEPARATOR_TYPE, new_w->tear_off_button.separator_type, (Widget) new_w)) { new_w -> tear_off_button.separator_type = XmSHADOW_ETCHED_OUT_DASH; } /* force the orientation */ new_w -> tear_off_button.orientation = XmHORIZONTAL; if ((new_w->core.background_pixel != current->core.background_pixel) || (new_w->tear_off_button.separator_type != current->tear_off_button.separator_type) || (new_w->primitive.foreground != current->primitive.foreground)) { XtReleaseGC ((Widget) new_w, new_w->tear_off_button.separator_GC); GetSeparatorGC (new_w); flag = TRUE; } if ((new_w->tear_off_button.margin != current->tear_off_button.margin) || (new_w->primitive.shadow_thickness != current->primitive.shadow_thickness)) { flag = TRUE; } return (flag); } /************************************************************************ * * BDrag * On button 2 down, tear off the menu * ************************************************************************/ /*ARGSUSED*/ static void BDrag( Widget wid, XEvent *event, String *param, /* unused */ Cardinal *num_param ) /* unused */ { _XmTearOffInitiate(XtParent(wid), event); } /************************************************************************ * * BActivate * On either a button down or a button up, tear off the menu * ************************************************************************/ /*ARGSUSED*/ static void BActivate( Widget wid, XEvent *event, String *param, /* unused */ Cardinal *num_param ) /* unused */ { Widget parent = XtParent(wid); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (menuSTrait -> verifyButton(XtParent(wid), event)) { _XmTearOffInitiate(parent, event); } } /************************************************************************ * * KActivate * Initiate Tear Off on a keypress ************************************************************************/ /*ARGSUSED*/ static void KActivate( Widget wid, XEvent *event, String *param, /* unused */ Cardinal *num_param ) /* unused */ { XButtonEvent xb_ev ; Widget parent = XtParent(wid); Position x, y; /* stick the tear off at the same location as the submenu */ XtTranslateCoords(parent, XtX(parent), XtY(parent), &x, &y); xb_ev = event->xbutton; xb_ev.x_root = x; xb_ev.y_root = y; _XmTearOffInitiate(parent, (XEvent *) &xb_ev); } motif-2.3.8/lib/Xm/DragICCI.h0000644000175000017500000003645513145162623012413 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDragICCI_h #define _XmDragICCI_h #include #include #include #include "DragCI.h" #include "DropSMgrI.h" #ifdef __cplusplus extern "C" { #endif /* * Xm ICC internal definitions * */ #define MAXSHORT 32767 #define MINSHORT -MAXSHORT /* * Swap the byte order of 4- and 2- byte quantities. * These macros work for bitfields. */ #define swap4bytes(l) {\ struct {\ unsigned t :32;\ } bit32;\ char n, *tp = (char *) &bit32;\ bit32.t = l;\ n = tp[0]; tp[0] = tp[3]; tp[3] = n;\ n = tp[1]; tp[1] = tp[2]; tp[2] = n;\ l = bit32.t;\ } #define swap2bytes(s) {\ struct {\ unsigned t :16;\ } bit16;\ char n, *tp = (char *) &bit16;\ bit16.t = s;\ n = tp[0]; tp[0] = tp[1]; tp[1] = n;\ s = bit16.t;\ } typedef struct { /* the message type field contains the following: * * 80 originator * 7F message_type */ BYTE message_type; BYTE byte_order; /* * the flags field contains the following: * * 000F operation * 00F0 dropSiteStatus * 0F00 operations * F000 completionStatus */ CARD16 flags B16; CARD32 time B32; }xmICCAnyMessageStruct, *xmICCAnyMessage; typedef struct { BYTE message_type; BYTE byte_order; CARD16 flags B16; CARD32 time B32; CARD32 src_window B32; CARD32 icc_handle B32; }xmICCTopLevelEnterMessageStruct; typedef struct { BYTE message_type; BYTE byte_order; CARD16 flags B16; CARD32 time B32; CARD32 src_window B32; }xmICCTopLevelLeaveMessageStruct; typedef struct { BYTE message_type; BYTE byte_order; CARD16 flags B16; CARD32 time B32; INT16 x B16; INT16 y B16; }xmICCDragMotionMessageStruct; typedef struct { BYTE message_type; BYTE byte_order; CARD16 flags B16; CARD32 time B32; }xmICCOperationChangedMessageStruct; typedef struct { BYTE message_type; BYTE byte_order; CARD16 flags B16; CARD32 time B32; INT16 x B16; INT16 y B16; }xmICCDropSiteEnterMessageStruct; typedef struct { BYTE message_type; BYTE byte_order; CARD16 flags B16; CARD32 time B32; }xmICCDropSiteLeaveMessageStruct; typedef struct { BYTE message_type; BYTE byte_order; CARD16 flags B16; CARD32 time B32; INT16 x B16; INT16 y B16; CARD32 icc_handle B32; CARD32 src_window B32; }xmICCDropMessageStruct; typedef union _xmICCMessageStruct{ xmICCAnyMessageStruct any; xmICCTopLevelEnterMessageStruct topLevelEnter; xmICCTopLevelLeaveMessageStruct topLevelLeave; xmICCDragMotionMessageStruct dragMotion; xmICCOperationChangedMessageStruct operationChanged; xmICCDropSiteEnterMessageStruct dropSiteEnter; xmICCDropSiteLeaveMessageStruct dropSiteLeave; xmICCDropMessageStruct drop; }xmICCMessageStruct, *xmICCMessage; typedef union _XmICCCallbackStruct{ XmAnyICCCallbackStruct any; XmTopLevelEnterCallbackStruct topLevelEnter; XmTopLevelLeaveCallbackStruct topLevelLeave; XmDragMotionCallbackStruct dragMotion; XmOperationChangedCallbackStruct operationChanged; XmDropSiteEnterCallbackStruct dropSiteEnter; XmDropSiteLeaveCallbackStruct dropSiteLeave; XmDropSiteTreeAddCallbackStruct dropSiteTreeAdd; XmDropSiteTreeRemoveCallbackStruct dropSiteTreeRemove; XmDropSiteTreeUpdateCallbackStruct dropSiteTreeUpdate; }XmICCCallbackStruct, *XmICCCallback; typedef struct _xmByteBufRec{ BYTE *bytes; BYTE *stack; BYTE *curr; size_t size; Cardinal max; }xmByteBufRec; typedef struct _xmPropertyBufferRec{ xmByteBufRec data; xmByteBufRec heap; }xmPropertyBufferRec, *xmPropertyBuffer; /* for argument passing between DropSite and ICC routines */ typedef struct _XmICCDropSiteHeaderRec { unsigned char dropType; unsigned char dropActivity; unsigned char traversalType; unsigned char operations; unsigned char animationStyle; unsigned short importTargetsID; XmRegion region; } XmICCDropSiteHeaderRec, *XmICCDropSiteHeader; typedef struct _XmICCDropSiteNoneDataRec { Dimension borderWidth; } XmICCDropSiteNoneDataRec, *XmICCDropSiteNoneData; typedef struct _XmICCDropSiteHighlightDataRec { Dimension borderWidth; Dimension highlightThickness; Pixel background; Pixel highlightColor; Pixmap highlightPixmap; } XmICCDropSiteHighlightDataRec, *XmICCDropSiteHighlightData; typedef struct _XmICCDropSiteShadowDataRec { Dimension borderWidth; Dimension highlightThickness; Dimension shadowThickness; Pixel foreground; Pixel topShadowColor; Pixmap topShadowPixmap; Pixel bottomShadowColor; Pixmap bottomShadowPixmap; } XmICCDropSiteShadowDataRec, *XmICCDropSiteShadowData; typedef struct _XmICCDropSitePixmapDataRec { Dimension borderWidth; Dimension highlightThickness; Dimension shadowThickness; Pixel foreground; Pixel background; Pixmap animationPixmap; Cardinal animationPixmapDepth; Pixmap animationMask; } XmICCDropSitePixmapDataRec, *XmICCDropSitePixmapData; typedef struct _XmICCDropSiteNoneRec { XmICCDropSiteHeaderRec header; XmICCDropSiteNoneDataRec animation_data; } XmICCDropSiteNoneRec, *XmICCDropSiteNone; typedef struct _XmICCDropSiteHighlightRec { XmICCDropSiteHeaderRec header; XmICCDropSiteHighlightDataRec animation_data; } XmICCDropSiteHighlightRec, *XmICCDropSiteHighlight; typedef struct _XmICCDropSiteShadowRec { XmICCDropSiteHeaderRec header; XmICCDropSiteShadowDataRec animation_data; } XmICCDropSiteShadowRec, *XmICCDropSiteShadow; typedef struct _XmICCDropSitePixmapRec { XmICCDropSiteHeaderRec header; XmICCDropSitePixmapDataRec animation_data; } XmICCDropSitePixmapRec, *XmICCDropSitePixmap; typedef union _XmICCDropSiteInfoStruct { XmICCDropSiteHeaderRec header; XmICCDropSiteHighlightRec highlightDS; XmICCDropSiteShadowRec shadowDS; XmICCDropSitePixmapRec pixmapDS; } XmICCDropSiteInfoStruct, *XmICCDropSiteInfo; typedef struct _XmReceiverDSTreeStruct{ xmPropertyBufferRec propBufRec; unsigned char byteOrder; Cardinal numDropSites; Cardinal currDropSite; }XmReceiverDSTreeStruct, *XmReceiverDSTree; /* * The following structures are for property access. * They must have 64-bit multiple lengths to support 64-bit architectures. */ typedef struct _xmDragInitiatorInfoStruct{ BYTE byte_order; BYTE protocol_version; CARD16 targets_index B16; CARD32 icc_handle B32; }xmDragInitiatorInfoStruct; typedef struct _xmDragReceiverInfoStruct{ BYTE byte_order; BYTE protocol_version; BYTE drag_protocol_style; BYTE pad1; CARD32 proxy_window B32; CARD16 num_drop_sites B16; CARD16 pad2 B16; CARD32 heap_offset B32; }xmDragReceiverInfoStruct; typedef struct { INT16 x1 B16; INT16 x2 B16; INT16 y1 B16; INT16 y2 B16; }xmICCRegBoxRec; typedef struct _xmDSHeaderStruct{ /* * the flags field contains the following: * * 0003 traversalType * 000C dropActivity * 00F0 dropType * 0F00 operations * F000 animationStyle */ CARD16 flags B16; CARD16 import_targets_id B16; CARD32 dsRegionNumBoxes B32; }xmDSHeaderStruct, *xmDSHeader; typedef struct _xmDSNoneDataStruct{ CARD16 borderWidth B16; CARD16 pad1 B16; CARD32 pad2 B32; }xmDSNoneDataStruct, *xmDSNoneData; typedef struct _xmDSHighlightDataStruct{ CARD16 borderWidth B16; CARD16 highlightThickness B16; CARD32 background B32; CARD32 highlightColor B32; CARD32 highlightPixmap B32; }xmDSHighlightDataStruct, *xmDSHighlightData; typedef struct _xmDSShadowDataStruct{ CARD16 borderWidth B16; CARD16 highlightThickness B16; CARD16 shadowThickness B16; CARD16 pad1 B16; CARD32 foreground B32; CARD32 topShadowColor B32; CARD32 bottomShadowColor B32; CARD32 topShadowPixmap B32; CARD32 bottomShadowPixmap B32; CARD32 pad2 B32; }xmDSShadowDataStruct, *xmDSShadowData; typedef struct _xmDSPixmapDataStruct{ CARD16 borderWidth B16; CARD16 highlightThickness B16; CARD16 shadowThickness B16; CARD16 animationPixmapDepth B16; CARD32 foreground B32; CARD32 background B32; CARD32 animationPixmap B32; CARD32 animationMask B32; }xmDSPixmapDataStruct, *xmDSPixmapData; /* Macros for the manipulation of ICCmessages and xmDSData */ #define _XM_TRAVERSAL_TYPE_MASK ((CARD16) 0x0003) #define _XM_TRAVERSAL_TYPE_SHIFT 0 #define _XM_DS_ACTIVITY_MASK ((CARD16) 0x000C) #define _XM_DS_ACTIVITY_SHIFT 2 #define _XM_DND_OPERATION_MASK ((CARD16) 0x000F) #define _XM_DND_OPERATION_SHIFT 0 #define _XM_DND_SITE_STATUS_MASK ((CARD16) 0x00F0) #define _XM_DND_SITE_STATUS_SHIFT 4 #define _XM_DS_TYPE_MASK ((CARD16) 0x00F0) #define _XM_DS_TYPE_SHIFT 4 #define _XM_DND_MULTIOPS_MASK ((CARD16) 0x0F00) #define _XM_DND_MULTIOPS_SHIFT 8 #define _XM_DND_COMPLETION_MASK ((CARD16) 0xF000) #define _XM_DND_COMPLETION_SHIFT 12 #define _XM_ANIMATION_STYLE_MASK ((CARD16) 0xF000) #define _XM_ANIMATION_STYLE_SHIFT 12 #define GET_OPERATION(flags) \ ((unsigned char) \ ((int)((flags) & _XM_DND_OPERATION_MASK) >> _XM_DND_OPERATION_SHIFT)) #define PUT_OPERATION(operation) \ (((CARD16)(operation) << _XM_DND_OPERATION_SHIFT)\ & _XM_DND_OPERATION_MASK) #define GET_SITE_STATUS(flags) \ ((unsigned char) \ ((int)((flags) & _XM_DND_SITE_STATUS_MASK) >> _XM_DND_SITE_STATUS_SHIFT)) #define PUT_SITE_STATUS(site_status) \ (((CARD16)(site_status) << _XM_DND_SITE_STATUS_SHIFT)\ & _XM_DND_SITE_STATUS_MASK) #define GET_MULTIOPS(flags) \ ((unsigned char) \ ((int)((flags) & _XM_DND_MULTIOPS_MASK) >> _XM_DND_MULTIOPS_SHIFT)) #define PUT_MULTIOPS(operation) \ (((CARD16)(operation) << _XM_DND_MULTIOPS_SHIFT)\ & _XM_DND_MULTIOPS_MASK) #define GET_COMPLETION(flags) \ ((unsigned char) \ ((int)((flags) & _XM_DND_COMPLETION_MASK) >> _XM_DND_COMPLETION_SHIFT)) #define PUT_COMPLETION(completion) \ (((CARD16)(completion) << _XM_DND_COMPLETION_SHIFT)\ & _XM_DND_COMPLETION_MASK) #define GET_TRAVERSAL_TYPE(flags) \ ((unsigned char) \ ((int)((flags) & _XM_TRAVERSAL_TYPE_MASK) >> _XM_TRAVERSAL_TYPE_SHIFT)) #define PUT_TRAVERSAL_TYPE(traversal_type) \ (((CARD16)(traversal_type) << _XM_TRAVERSAL_TYPE_SHIFT)\ & _XM_TRAVERSAL_TYPE_MASK) #define GET_DS_TYPE(flags) \ ((unsigned char) \ ((int)((flags) & _XM_DS_TYPE_MASK) >> _XM_DS_TYPE_SHIFT)) #define PUT_DS_TYPE(ds_type) \ (((CARD16)(ds_type) << _XM_DS_TYPE_SHIFT)\ & _XM_DS_TYPE_MASK) #define GET_DS_ACTIVITY(flags) \ ((unsigned char) \ ((int)((flags) & _XM_DS_ACTIVITY_MASK) >> _XM_DS_ACTIVITY_SHIFT)) #define PUT_DS_ACTIVITY(ds_activity) \ (((CARD16)(ds_activity) << _XM_DS_ACTIVITY_SHIFT)\ & _XM_DS_ACTIVITY_MASK) #define GET_ANIMATION_STYLE(flags) \ ((unsigned char) \ ((int)((flags) & _XM_ANIMATION_STYLE_MASK) >> _XM_ANIMATION_STYLE_SHIFT)) #define PUT_ANIMATION_STYLE(animation_style) \ (((CARD16)(animation_style) << _XM_ANIMATION_STYLE_SHIFT)\ & _XM_ANIMATION_STYLE_MASK) /* * We consume the high order bit of the messageType in order * to indicate whether this is an initiator generated event * or a receiver generated event. * * This is all wrapped in macros in case we want to use more bits * later. */ typedef enum { XmICC_INITIATOR_EVENT, XmICC_RECEIVER_EVENT } XmICCEventType; #define _XM_ICC_EVENT_TYPE_MASK ((BYTE)0x80) #define _XM_ICC_EVENT_TYPE_SHIFT 7 #define GET_ICC_EVENT_TYPE(type) \ ((XmICCEventType) \ ((int)((type) & _XM_ICC_EVENT_TYPE_MASK) >> _XM_ICC_EVENT_TYPE_SHIFT)) #define PUT_ICC_EVENT_TYPE(type) \ (((BYTE)(type) << _XM_ICC_EVENT_TYPE_SHIFT) \ & _XM_ICC_EVENT_TYPE_MASK) #define CLEAR_ICC_EVENT_TYPE ((BYTE)0x7F) #define _MOTIF_DRAG_PROTOCOL_VERSION (BYTE)0 externalref unsigned char _XmByteOrderChar; /******** Private Function Declarations ********/ extern unsigned char _XmReasonToMessageType( int reason) ; extern unsigned int _XmMessageTypeToReason( #if NeedWidePrototypes unsigned int messageType) ; #else unsigned char messageType) ; #endif /* NeedWidePrototypes */ extern void _XmICCCallbackToICCEvent( Display *display, Window window, XmICCCallback callback, XClientMessageEvent *cmev, XmICCEventType type) ; extern void _XmSendICCCallback( Display *display, Window window, XmICCCallback callback, XmICCEventType type) ; extern Boolean _XmICCEventToICCCallback( XClientMessageEvent *msgEv, XmICCCallback callback, XmICCEventType type) ; extern CARD16 _XmReadDragBuffer( xmPropertyBuffer propBuf, #if NeedWidePrototypes int which, #else BYTE which, #endif /* NeedWidePrototypes */ BYTE *ptr, CARD32 size) ; extern CARD16 _XmWriteDragBuffer( xmPropertyBuffer propBuf, #if NeedWidePrototypes int which, #else BYTE which, #endif /* NeedWidePrototypes */ BYTE *ptr, CARD32 size) ; extern void _XmWriteInitiatorInfo( Widget dc) ; extern void _XmReadInitiatorInfo( Widget dc) ; extern Boolean _XmGetDragReceiverInfo( Display *display, Window window, XmDragReceiverInfoStruct *receiverInfoRtn) ; extern Boolean _XmReadDSFromStream( XmDropSiteManagerObject dsm, XtPointer iccInfo, XmICCDropSiteInfo dropSiteInfoRtn) ; extern void _XmWriteDSToStream( XmDropSiteManagerObject dsm, XtPointer stream, XmICCDropSiteInfo dropSiteInfo) ; extern void _XmFreeDragReceiverInfo( XtPointer info) ; extern void _XmClearDragReceiverInfo( Widget shell) ; extern void _XmSetDragReceiverInfo( XmDisplay dd, Widget shell) ; extern void _XmInitByteOrderChar( void ) ; /******** End Private Function Declarations ********/ #define _XmInitDragICC(dd) _XmInitByteOrderChar() #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragICCI_h */ motif-2.3.8/lib/Xm/XmFontList.c0000644000175000017500000004602212672140200013126 00000000000000/* $XConsortium: XmFontList.c /main/16 1996/11/20 15:15:34 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #ifndef X_NOT_STDC_ENV #include #endif #include #include #ifdef __cplusplus extern "C" { /* some 'locale.h' do not have prototypes (sun) */ #endif #include #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif /* __cplusplus */ #include #include #include "XmI.h" #include "XmRenderTI.h" #include "XmStringI.h" #define FIX_1252 /* * Data structure macros for fontlist access */ #define FLContextIndex(context) (((XmFontListContextRec *)(context))->index) #define FLContextTable(context) (((XmFontListContextRec *)(context))->table) #define FLContextError(context) (((XmFontListContextRec *)(context))->error) #define FLDisplay(fl) ((*fl)->display) /******** Static Function Declarations ********/ /******** End Static Function Declarations ********/ /* NOTE - this function XmFontListEntryCreate is NOT MT-safe if the application is using threads with multiple application contexts to use Font lists in threaded code with multiple application contexts it is necessary to use the new API XmFontListEntryCreate_r function which passes in an additional widget parameter ... this widget MUST be for the display that font will be used in Font should not be shared between displays in an MT environment */ XmFontListEntry XmFontListEntryCreate( char *tag, XmFontType type , XtPointer font ) { char *derived_tag; Cardinal n; Arg args[4]; XmFontListEntry ret_val; _XmProcessLock(); if ((font == NULL) || (tag == NULL) || ((type != XmFONT_IS_FONTSET) && (type != XmFONT_IS_FONT))) { _XmProcessUnlock(); return (NULL); } if ((tag != XmFONTLIST_DEFAULT_TAG) && (strcmp(tag, XmSTRING_DEFAULT_CHARSET) == 0)) derived_tag = _XmStringGetCurrentCharset(); else derived_tag = tag; n = 0; XtSetArg(args[n], XmNfontType, type); n++; XtSetArg(args[n], XmNloadModel, XmLOAD_IMMEDIATE); n++; XtSetArg(args[n], XmNfont, font); n++; ret_val = XmRenditionCreate(NULL, _XmStringCacheTag(derived_tag, XmSTRING_TAG_STRLEN), args, n); _XmProcessUnlock(); return ret_val; } /* * MT safe version of XmFontList - requires widget parameter * * A display variable is necessary to create a render table in an * MT safe environment * * the widget passed in DOES NOT need to be the widget which uses the * font however it MUST be on the same display * * Fonts can not be shared among displays in an MT environment */ XmFontListEntry XmFontListEntryCreate_r(char *tag, XmFontType type, XtPointer font, Widget wid ) { char *derived_tag; Cardinal n; Arg args[4]; XmFontListEntry ret_val; _XmWidgetToAppContext(wid); _XmAppLock(app); if ((font == NULL) || (tag == NULL) || ((type != XmFONT_IS_FONTSET) && (type != XmFONT_IS_FONT))) { _XmAppUnlock(app); return (NULL); } if ((tag != XmFONTLIST_DEFAULT_TAG) && (strcmp(tag, XmSTRING_DEFAULT_CHARSET) == 0)) derived_tag = _XmStringGetCurrentCharset(); else derived_tag = tag; n = 0; XtSetArg(args[n], XmNfontType, type); n++; XtSetArg(args[n], XmNloadModel, XmLOAD_IMMEDIATE); n++; XtSetArg(args[n], XmNfont, font); n++; ret_val = XmRenditionCreate(wid, _XmStringCacheTag(derived_tag, XmSTRING_TAG_STRLEN), args, n); _XmAppUnlock(app); return ret_val; } void XmFontListEntryFree( XmFontListEntry *entry ) { if (entry != NULL) XmRenditionFree(*entry); } XtPointer XmFontListEntryGetFont( XmFontListEntry entry , XmFontType *typeReturn ) { XtPointer ret_val; #ifdef USE_XFT XtPointer ret_val2; #endif Arg args[3]; Cardinal n; XtAppContext app=NULL; if (entry == NULL) return (NULL); #ifdef XTHREADS if ( _XmRendDisplay((XmRendition)entry) ) app = XtDisplayToApplicationContext(_XmRendDisplay((XmRendition)entry)); if (app) _XmAppLock(app); else _XmProcessLock(); #endif n = 0; XtSetArg(args[n], XmNfontType, typeReturn); n++; XtSetArg(args[n], XmNfont, &ret_val); n++; #ifdef USE_XFT XtSetArg(args[n], XmNxftFont, &ret_val2); n++; #endif XmRenditionRetrieve(entry, args, n); #ifdef USE_XFT if (*typeReturn == XmFONT_IS_XFT) ret_val = ret_val2; #endif if (*typeReturn == XmAS_IS) *typeReturn = XmFONT_IS_FONT; if (ret_val == (char *)XmAS_IS) { #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif return(NULL); } else { #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif return(ret_val); } } char * XmFontListEntryGetTag( XmFontListEntry entry ) { Cardinal n; Arg args[1]; char *tag; char *ret_val; #ifdef XTHREADS XtAppContext app=NULL; #endif if (entry == NULL) return (NULL); #ifdef XTHREADS if ( _XmRendDisplay((XmRendition)entry) ) app = XtDisplayToApplicationContext(_XmRendDisplay((XmRendition)entry)); if (app) _XmAppLock(app); else _XmProcessLock(); #endif n = 0; XtSetArg(args[n], XmNtag, &tag); n++; XmRenditionRetrieve(entry, args, n); ret_val = XtNewString(tag); #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif return ret_val; } XmFontList XmFontListAppendEntry( XmFontList old , XmFontListEntry entry ) { XmRendition rends[1]; XmFontList ret_val; #ifdef XTHREADS XtAppContext app=NULL; #endif if (!entry) { return (old); } #ifdef XTHREADS if (_XmRendDisplay((XmRendition)entry)) app = XtDisplayToApplicationContext(_XmRendDisplay((XmRendition)entry)); if (app) _XmAppLock(app); else _XmProcessLock(); #endif rends[0] = entry; ret_val = XmRenderTableAddRenditions(old, rends, 1, XmDUPLICATE); #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif return ret_val; } XmFontListEntry XmFontListNextEntry( XmFontContext context ) { XmRendition entry; _XmProcessLock(); if ((context == NULL) || (FLContextError(context))) { _XmProcessUnlock(); return (NULL); } if (FLContextIndex(context) >= _XmRTCount(FLContextTable(context))) { FLContextError(context) = TRUE; _XmProcessUnlock(); return (NULL); } entry = _XmRTRenditions(FLContextTable(context))[FLContextIndex(context)]; FLContextIndex(context)++; _XmProcessUnlock(); return((XmFontListEntry)entry); } XmFontList XmFontListRemoveEntry( XmFontList old , XmFontListEntry entry ) { Cardinal n; Arg args[3]; XmStringTag tags[1]; XmFontType type1; XtPointer font1; #ifdef XTHREADS XtAppContext app=NULL; #endif if ((old == NULL) || (entry == NULL)) return (old); #ifdef XTHREADS if ( _XmRendDisplay((XmRendition)entry) ) app = XtDisplayToApplicationContext(_XmRendDisplay((XmRendition)entry)); if (app) _XmAppLock(app); else _XmProcessLock(); #endif n = 0; XtSetArg(args[n], XmNtag, &tags[0]); n++; XtSetArg(args[n], XmNfontType, &type1); n++; XtSetArg(args[n], XmNfont, &font1); n++; XmRenditionRetrieve(entry, args, n); old = _XmRenderTableRemoveRenditions(old, tags, 1, TRUE, type1, font1); #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif return(old); } XmFontListEntry XmFontListEntryLoad( Display *display , char *fontName , XmFontType type , char *tag ) { Cardinal n; Arg args[4]; XmFontListEntry ret_val; _XmDisplayToAppContext(display); _XmAppLock(app); n = 0; XtSetArg(args[n], XmNfontName, fontName); n++; XtSetArg(args[n], XmNfontType, type); n++; XtSetArg(args[n], XmNloadModel, XmLOAD_IMMEDIATE); n++; ret_val = _XmRenditionCreate(display, NULL, XmS, XmCFontList, _XmStringCacheTag(tag, XmSTRING_TAG_STRLEN), args, n, NULL); _XmAppUnlock(app); return ret_val; } /* NOTE - this function XmFontListCreate is NOT MT-safe if the application is using threads with multiple application contexts to use Font lists in threaded code with multiple application contexts it is necessary to use the new API XmFontListCreate_r function which passes in an additional widget parameter ... this widget MUST be for the display that font will be used in Font should not be shared between displays in an MT environment */ XmFontList XmFontListCreate( XFontStruct *font, XmStringCharSet charset ) { Cardinal n; Arg args[4]; XmRendition rends[1]; XmStringCharSet curcharset; XmRenderTable ret_val; _XmProcessLock(); if ((font == NULL) || (charset == NULL)) { _XmProcessUnlock(); return (NULL); } if ((charset != XmFONTLIST_DEFAULT_TAG) && (strcmp(charset, XmSTRING_DEFAULT_CHARSET) == 0)) curcharset = _XmStringGetCurrentCharset(); else curcharset = charset; n = 0; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; XtSetArg(args[n], XmNfont, (XtPointer)font); n++; XtSetArg(args[n], XmNloadModel, XmLOAD_IMMEDIATE); n++; rends[0] = XmRenditionCreate(NULL, _XmStringCacheTag(curcharset, XmSTRING_TAG_STRLEN), args, n); _XmProcessUnlock(); ret_val = XmRenderTableAddRenditions(NULL, rends, 1, XmDUPLICATE); XmRenditionFree(rends[0]); return(ret_val); } /* MT safe version of XmFontListCreate - requires widget parameter A display variable is necessary to create a render table in an MT safe environment the widget passed in DOES NOT need to be the widget which uses the font however it MUST be on the same display Fonts can not be shared among displays in an MT environment */ XmFontList XmFontListCreate_r( XFontStruct *font, XmStringCharSet charset, Widget wid ) { Cardinal n; Arg args[4]; XmRendition rends[1]; XmStringCharSet curcharset; XmRenderTable ret_val; _XmWidgetToAppContext(wid); _XmAppLock(app); if ((font == NULL) || (charset == NULL)) { _XmAppUnlock(app); return (NULL); } if ((charset != XmFONTLIST_DEFAULT_TAG) && (strcmp(charset, XmSTRING_DEFAULT_CHARSET) == 0)) curcharset = _XmStringGetCurrentCharset(); else curcharset = charset; n = 0; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; XtSetArg(args[n], XmNfont, (XtPointer)font); n++; XtSetArg(args[n], XmNloadModel, XmLOAD_IMMEDIATE); n++; rends[0] = XmRenditionCreate(wid, _XmStringCacheTag(curcharset, XmSTRING_TAG_STRLEN), args, n); ret_val = XmRenderTableAddRenditions(NULL, rends, 1, XmDUPLICATE); XmRenditionFree(rends[0]); _XmAppUnlock(app); return(ret_val); } /* NOTE - this function XmStringCreateFontList is NOT MT-safe if the application is using threads with multiple application contexts to use Font lists in threaded code with multiple application contexts it is necessary to use the new API XmFontListCreate_r function which passes in an additional widget parameter ... this widget MUST be for the display that font will be used in Font should not be shared between displays in an MT environment */ XmFontList XmStringCreateFontList( XFontStruct *font, XmStringCharSet charset ) { return (XmFontListCreate(font,charset)); } /* MT safe version of XmStringCreateFontList - requires widget parameter A display variable is necessary to create a render table in an MT safe environment the widget passed in DOES NOT need to be the widget which uses the font however it MUST be on the same display Fonts can not be shared among displays in an MT environment */ XmFontList XmStringCreateFontList_r( XFontStruct *font, XmStringCharSet charset, Widget wid ) { /* we dont need to lock since this is just a wrapper */ return (XmFontListCreate_r(font,charset, wid)); } /* * dump a font list */ void XmFontListFree ( XmFontList fontlist) { XmRenderTableFree(fontlist); } /* * extent a font list by one element, the old font list is gone */ XmFontList XmFontListAdd( XmFontList old, XFontStruct *font, XmStringCharSet charset ) { XmStringCharSet curcharset; Cardinal n; Arg args[4]; XmRendition rends[1]; XmFontList ret_val; #ifdef XTHREADS XtAppContext app=NULL; #endif if (!old) return((XmFontList) NULL); if (!charset || !font) return ((XmFontList) old); #ifdef XTHREADS if ( _XmRTDisplay((XmRenderTable)old) ) app = XtDisplayToApplicationContext(_XmRTDisplay((XmRenderTable)old)); if (app) _XmAppLock(app); else _XmProcessLock(); #endif if ((charset != XmFONTLIST_DEFAULT_TAG) && (strcmp(charset, XmSTRING_DEFAULT_CHARSET) == 0)) curcharset = _XmStringGetCurrentCharset(); else curcharset = charset; n = 0; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; XtSetArg(args[n], XmNfont, (XtPointer)font); n++; XtSetArg(args[n], XmNloadModel, XmLOAD_IMMEDIATE); n++; rends[0] = XmRenditionCreate(NULL, _XmStringCacheTag(curcharset, XmSTRING_TAG_STRLEN), args, n); ret_val = XmRenderTableAddRenditions(old, rends, 1, XmDUPLICATE); #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif return ret_val; } /* * replicate a font list */ XmFontList XmFontListCopy( XmFontList fontlist ) { return(XmRenderTableCopy(fontlist, NULL, 0)); } XFontStruct * _XmGetFirstFont( XmFontListEntry entry) { XFontStruct *font_struct; Cardinal n; Arg args[2]; XmFontType type; XtPointer font; n = 0; XtSetArg(args[n], XmNfontType, &type); n++; XtSetArg(args[n], XmNfont, &font); n++; XmRenditionRetrieve(entry, args, n); if (font == (XtPointer)XmAS_IS) { font_struct = NULL; } else if (type == XmFONT_IS_FONTSET) { XFontStruct **font_struct_list; char **font_name_list; #ifdef FIX_1252 if (XFontsOfFontSet((XFontSet)font, &font_struct_list, &font_name_list) && font_struct_list[0]->fid != 0) #else if (XFontsOfFontSet((XFontSet)font, &font_struct_list, &font_name_list)) #endif font_struct = font_struct_list[0]; else font_struct = NULL; } else font_struct = (XFontStruct *)font; return (font_struct); } /* * Find an entry in the fontlist which matches the current charset or * return the first font if none match. */ Boolean XmeRenderTableGetDefaultFont( XmFontList fontlist, XFontStruct **font_struct ) { XmStringTag tag = XmFONTLIST_DEFAULT_TAG; short indx = -1; Boolean retval; #ifdef XTHREADS XtAppContext app=NULL; if ( _XmRTDisplay((XmRenderTable)fontlist) ) app = XtDisplayToApplicationContext(_XmRTDisplay((XmRenderTable)fontlist)); if (app) _XmAppLock(app); else _XmProcessLock(); #endif retval = _XmFontListSearch (fontlist, tag, &indx, font_struct); #ifdef XTHREADS if (app) _XmAppUnlock(app); else _XmProcessUnlock(); #endif return(retval); } /* * find an entry in the font list which matches, return index (or -1) and * font stuct ptr (or first in list). */ Boolean _XmFontListSearch( XmFontList fontlist, XmStringCharSet charset, short *indx, XFontStruct **font_struct ) { XmFontListEntry entry; Boolean success; success = _XmRenderTableFindFallback(fontlist, charset, FALSE, indx, &entry); /* For backward compatibility we must try to return something for */ /* any non-null charset, not just XmFONTLIST_DEFAULT_TAG. */ if (fontlist && charset && !success) success = _XmRenderTableFindFirstFont(fontlist, indx, &entry); if (success) *font_struct = _XmGetFirstFont(entry); else *font_struct = NULL; return success && (*font_struct != NULL); } /* * Fontlist access routines */ Boolean XmFontListInitFontContext( XmFontContext *context, XmFontList fontlist ) { XmFontContext p; _XmProcessLock(); if ((!fontlist) || (!context)) { _XmProcessUnlock(); return(FALSE); } p = (XmFontContext) XtMalloc (sizeof (XmFontListContextRec)); FLContextIndex(p) = 0; FLContextTable(p) = fontlist; FLContextError(p) = FALSE; *context = p; _XmProcessUnlock(); return (TRUE); } Boolean XmFontListGetNextFont( XmFontContext context, XmStringCharSet *charset, XFontStruct **font ) { XmRenderTable table; XmRendition rend; Cardinal n; Arg args[1]; XmStringTag tag; _XmProcessLock(); if ((context == NULL) || FLContextError(context) || (charset == NULL) || (font == NULL)) { _XmProcessUnlock(); return (FALSE); } table = FLContextTable(context); if (FLContextIndex(context) >= _XmRTCount(table)) { FLContextError(context) = TRUE; _XmProcessUnlock(); return(FALSE); } rend = _XmRTRenditions(table)[FLContextIndex(context)]; *font = _XmGetFirstFont(rend); _XmProcessUnlock(); n = 0; XtSetArg(args[n], XmNtag, &tag); n++; XmRenditionRetrieve(rend, args, n); *charset = XtNewString(tag); FLContextIndex(context)++; return (TRUE); } void XmFontListFreeFontContext( XmFontContext context ) { _XmProcessLock(); if (context != NULL) XtFree((char *)context); _XmProcessUnlock(); } #ifdef _XmDEBUG_XMSTRING void _Xm_dump_fontlist( XmFontList f ) { int i = 0; for ( ; FontListFont(f) != NULL; f++, i++) { printf ("fontlist[%3d] of 0x%p\n", i, f); printf ("\ttype = %d\n", FontListType(f)); printf ("\tfont = %p\n", FontListFont(f)); printf ("\ttag = <%s>\n", FontListTag(f)); } } void _Xm_dump_fontlist_cache( void ) { FontlistEntry *cache; if (_fontlist_cache == NULL) { printf("fontlist cache is empty\n"); return; } for (cache = _fontlist_cache; cache; cache = FontCacheNext(cache)) { printf("cache pointer: %p\n", cache); _Xm_dump_fontlist(FontCacheFontList(cache)); printf("refcount: %d\n", FontCacheRefCount(cache)); printf("next: %p\n\n", FontCacheNext(cache)); } } #endif /* _XmDEBUG_XMSTRING */ motif-2.3.8/lib/Xm/CascadeBG.c0000644000175000017500000025550713201272475012636 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: CascadeBG.c /main/28 1999/02/01 18:47:11 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CacheI.h" #include "CascadeBI.h" #include "CascadeBGI.h" #include "ExtObjectI.h" #include "GadgetUtiI.h" #include "LabelI.h" #include "LabelGI.h" #include "MessagesI.h" #include "MenuProcI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "RCMenuI.h" #include "SyntheticI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #define CASCADE_PIX_SPACE 4 /* pixels between label and bit map */ #define MAP_DELAY_DEFAULT 180 #define EVENTS ((unsigned int) (ButtonPressMask | \ ButtonReleaseMask | EnterWindowMask | \ LeaveWindowMask)) #define WRONGPARENT _XmMMsgCascadeB_0000 #define WRONGSUBMENU _XmMMsgCascadeB_0001 #define WRONGMAPDELAY _XmMMsgCascadeB_0002 #define FIX_1665 /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static int _XmCascadeBCacheCompare( XtPointer A, XtPointer B) ; static void BorderHighlight( Widget wid) ; static void BorderUnhighlight( Widget wid) ; static void DrawShadow( XmCascadeButtonGadget cb) ; static void DrawCascade( register XmCascadeButtonGadget cb) ; static void position_cascade( XmCascadeButtonGadget cascadebtn) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void InputDispatch( Widget wid, XEvent *event, Mask event_mask) ; static void Arm( XmCascadeButtonGadget cb) ; static void ArmAndPost( XmCascadeButtonGadget cb, XEvent *event) ; static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Disarm( XmCascadeButtonGadget cb, #if NeedWidePrototypes int unpost) ; #else Boolean unpost) ; #endif /* NeedWidePrototypes */ static void PostTimeout( XtPointer closure, XtIntervalId *id) ; static void DelayedArm( XmCascadeButtonGadget cb, XEvent *event) ; static void CheckDisarm( XmCascadeButtonGadget cb, XEvent *event) ; static void StartDrag( XmCascadeButtonGadget cb, XEvent *event) ; static void Select( XmCascadeButtonGadget cb, XEvent *event, #if NeedWidePrototypes int doCascade) ; #else Boolean doCascade) ; #endif /* NeedWidePrototypes */ static void DoSelect( XmCascadeButtonGadget cb, XEvent *event) ; static void KeySelect( XmCascadeButtonGadget cb, XEvent *event) ; static void MenuBarSelect( Widget wid, XEvent *event) ; static void MenuBarEnter( Widget wid, XEvent *event) ; static void MenuBarLeave( Widget wid) ; static void size_cascade( XmCascadeButtonGadget cascadebtn) ; static void setup_cascade( XmCascadeButtonGadget cascadebtn, #if NeedWidePrototypes int adjustWidth, int adjustHeight) ; #else Boolean adjustWidth, Boolean adjustHeight) ; #endif /* NeedWidePrototypes */ static void Destroy( Widget wid) ; static void Resize( Widget wid) ; static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetArmGC( XmCascadeButtonGadget cb) ; static void GetBackgroundGC( XmCascadeButtonGadget cb) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Cardinal GetCascadeBGClassSecResData( WidgetClass w_class, XmSecondaryResourceData **data_rtn) ; static XtPointer GetCascadeBGClassSecResBase( Widget widget, XtPointer client_data) ; /******** End Static Function Declarations ********/ static XtResource resources[] = { { XmNactivateCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmCascadeButtonGadgetRec, cascade_button.activate_callback), XmRCallback, NULL }, { XmNcascadingCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmCascadeButtonGadgetRec, cascade_button.cascade_callback), XmRCallback, NULL }, { XmNsubMenuId, XmCMenuWidget, /* submenu */ XmRMenuWidget, sizeof (Widget), XtOffsetOf( struct _XmCascadeButtonGadgetRec, cascade_button.submenu), XmRMenuWidget, (XtPointer) 0 }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmCascadeButtonGadgetRec, gadget.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmGadgetRec, gadget.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmGadgetRec, gadget.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, }; static XtResource cache_resources[] = { { XmNcascadePixmap, XmCPixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf( struct _XmCascadeButtonGCacheObjRec, cascade_button_cache.cascade_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNmappingDelay, XmCMappingDelay, XmRInt, sizeof (int), XtOffsetOf( struct _XmCascadeButtonGCacheObjRec, cascade_button_cache.map_delay), XmRImmediate, (XtPointer) MAP_DELAY_DEFAULT }, }; static XmCacheClassPart CascadeButtonClassCachePart = { {NULL, 0, 0}, /* head of class cache list */ _XmCacheCopy, /* Copy routine */ _XmCacheDelete, /* Delete routine */ _XmCascadeBCacheCompare, /* Comparison routine */ }; static XmBaseClassExtRec CascadeBGClassExtensionRec = { NULL, /* next_extension */ NULLQUARK, /* record_typ */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* record_size */ InitializePrehook, /* initializePrehook */ SetValuesPrehook, /* setValuesPrehook */ InitializePosthook, /* initializePosthook */ SetValuesPosthook, /* setValuesPosthook */ (WidgetClass)&xmCascadeButtonGCacheObjClassRec, /* secondaryObjectClass */ SecondaryObjectCreate, /* secondaryObjectCreate */ GetCascadeBGClassSecResData, /* getSecResData */ {0}, /* fast subclass */ GetValuesPrehook, /* getValuesPrehook */ GetValuesPosthook, /* getValuesPosthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; /* ext rec static initialization */ externaldef(xmcascadebuttongcacheobjclassrec) XmCascadeButtonGCacheObjClassRec xmCascadeButtonGCacheObjClassRec = { { /* superclass */ (WidgetClass) &xmLabelGCacheObjClassRec, /* class_name */ "XmCascadeButtonGadget", /* widget_size */ sizeof(XmCascadeButtonGCacheObjRec), /* class_initialize */ NULL, /* chained class init */ NULL, /* class_inited */ False, /* initialize */ NULL, /* initialize hook */ NULL, /* realize */ NULL, /* actions */ NULL, /* num_actions */ 0, /* resources */ cache_resources, /* num_resources */ XtNumber(cache_resources), /* xrm_class */ NULLQUARK, /* compress_motion */ False, /* compress_exposure */ False, /* compress enter/exit*/ False, /* visible_interest */ False, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set values hook */ NULL, /* set values almost */ NULL, /* get values hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ NULL, /* query geo proc */ NULL, /* display accelerator*/ NULL, /* extension record */ NULL, }, { /* synthetic resources */ NULL, /* num_syn_resources */ 0, /* extension */ NULL, }, }; /* * static initialization of the cascade button widget class record, * must do each field */ static XmGadgetClassExtRec _XmCascadeBGadClassExtRec = { NULL, NULLQUARK, XmGadgetClassExtVersion, sizeof(XmGadgetClassExtRec), XmInheritBaselineProc, /* widget_baseline */ XmInheritDisplayRectProc, /* widget_display_rect */ XmInheritMarginsProc, /* widget_margins */ }; externaldef(xmcascadebuttongadgetclassrec) XmCascadeButtonGadgetClassRec xmCascadeButtonGadgetClassRec = { { (WidgetClass) &xmLabelGadgetClassRec, /* superclass ptr */ "XmCascadeButtonGadget", /* class_name */ sizeof (XmCascadeButtonGadgetRec), /* size of Pulldown widget */ ClassInitialize, /* class init proc */ ClassPartInitialize, /* chained class init */ FALSE, /* class is not init'ed */ Initialize, /* widget init proc */ NULL, /* init_hook proc */ NULL, /* widget realize proc */ NULL, /* class action table */ 0, resources, /* this class's resource list */ XtNumber (resources), /* " " resource_count */ NULLQUARK, /* xrm_class */ TRUE, /* do compress motion */ XtExposeCompressMaximal, /* do compress exposure */ TRUE, /* don't compress enter-leave */ FALSE, /* no VisibilityNotify */ Destroy, /* class destroy proc */ Resize, /* class resize proc */ Redisplay, /* expose proc */ SetValues, /* set_value proc */ NULL, /* set_value_hook proc */ XtInheritSetValuesAlmost, /* set_value_almost proc */ NULL, /* get_values_hook */ NULL, /* class accept focus proc */ XtVersion, /* current version */ NULL, /* callback offset list */ NULL, /* default translation table */ XtInheritQueryGeometry, /* query geo proc */ NULL, /* display accelerator*/ (XtPointer)&CascadeBGClassExtensionRec, /* extension */ }, { /* Gadget Class record */ BorderHighlight, /* border_highlight */ BorderUnhighlight, /* border_uhighlight */ ArmAndActivate, /* arm_and_activate */ InputDispatch, /* input_dispatch routine */ XmInheritVisualChange, /* visual_change routine */ NULL, /* syn_resources */ 0, /* num_syn_resources */ &CascadeButtonClassCachePart, /* class cache_part */ (XtPointer)&_XmCascadeBGadClassExtRec, /* extension */ }, { /* Label Class record */ XmInheritWidgetProc, /* set override callback */ XmInheritMenuProc, /* menu procedures */ NULL, /* extension */ }, { /* cascade_button class record */ NULL, /* extension */ } }; /* * now make a public symbol that points to this class record */ externaldef(xmcascadebuttongadgetclass) WidgetClass xmCascadeButtonGadgetClass = (WidgetClass) &xmCascadeButtonGadgetClassRec; /* * use caching to share arrow data */ static XmCacheClassPart ArrowPixmapCache = { {NULL, 0, 0}, /* head of class cache list */ _XmCacheCopy, /* Copy routine */ _XmArrowPixmapCacheDelete, /* Delete routine */ _XmArrowPixmapCacheCompare, /* Comparison routine */ }; /* Menu Savvy trait record */ static XmMenuSavvyTraitRec MenuSavvyRecord = { /* version: */ -1, NULL, NULL, NULL, _XmCBNameActivate, }; static void ClassInitialize( void ) { Cardinal wc_num_res, sc_num_res; XtResource *merged_list; int i, j; XtResourceList uncompiled; Cardinal num; /************************************************************************** Label's and Cascadebutton's resource lists are being merged into one and assigned to xmCascadeButtonGCacheObjClassRec. This is for performance reasons, since, instead of two calls to XtGetSubResources() XtGetSubvaluse() and XtSetSubvalues() for both the superclass and the widget class, now we have just one call with a merged resource list. NOTE: At this point the resource lists for Label and Cascadebutton do have unique entries, but if there are resources in the superclass that are being overwritten by the subclass then the merged_lists need to be created differently. ****************************************************************************/ wc_num_res = xmCascadeButtonGCacheObjClassRec.object_class.num_resources; sc_num_res = xmLabelGCacheObjClassRec.object_class.num_resources; merged_list = (XtResource *)XtMalloc((sizeof(XtResource) * (wc_num_res + sc_num_res))); _XmTransformSubResources(xmLabelGCacheObjClassRec.object_class.resources, sc_num_res, &uncompiled, &num); for (i = 0; i < num; i++) { merged_list[i] = uncompiled[i]; } XtFree((char *)uncompiled); for (i = 0, j = num; i < wc_num_res; i++, j++) { merged_list[j] = xmCascadeButtonGCacheObjClassRec.object_class.resources[i]; } _XmProcessLock(); xmCascadeButtonGCacheObjClassRec.object_class.resources = merged_list; xmCascadeButtonGCacheObjClassRec.object_class.num_resources = wc_num_res + sc_num_res ; _XmProcessUnlock(); CascadeBGClassExtensionRec.record_type = XmQmotif; } /* * set up fast subclassing */ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmCASCADE_BUTTON_GADGET_BIT); _XmLabelGCloneMenuSavvy (wc, &MenuSavvyRecord); } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /* ARGSUSED */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *cePtr; XmWidgetExtData extData; WidgetClass wc; Cardinal size; XtPointer newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); wc = (*cePtr)->secondaryObjectClass; size = wc->core_class.widget_size; newSec = _XmExtObjAlloc(size); reqSec = _XmExtObjAlloc(size); _XmProcessUnlock(); /* * Since the resource lists for label and cascadebutton were merged at * ClassInitialize time we need to make only one call to * XtGetSubresources() */ /* * Update pointers in instance records now so references to resources * in the cache record will be valid for use in CallProcs. * CallProcs are invoked by XtGetSubresources(). */ LabG_Cache(new_w) = &(((XmLabelGCacheObject)newSec)->label_cache); LabG_Cache(req) = &(((XmLabelGCacheObject)reqSec)->label_cache); CBG_Cache(new_w) = &(((XmCascadeButtonGCacheObject)newSec)-> cascade_button_cache); CBG_Cache(req) = &(((XmCascadeButtonGCacheObject)reqSec)-> cascade_button_cache); XtGetSubresources(new_w, newSec, NULL, NULL, wc->core_class.resources, wc->core_class.num_resources, args, *num_args ); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; ((XmCascadeButtonGCacheObject)newSec)->ext.extensionType = XmCACHE_EXTENSION; ((XmCascadeButtonGCacheObject)newSec)->ext.logicalParent = new_w; _XmPushWidgetExtData(new_w, extData, ((XmCascadeButtonGCacheObject)newSec)-> ext.extensionType); memcpy(reqSec, newSec, size); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /* ARGSUSED */ static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { /* CR 2990: Use XmNbuttonFontList as the default. */ if (LabG_Font(new_w) == NULL) LabG_Font(new_w) = XmeGetDefaultRenderTable (new_w, XmBUTTON_FONTLIST); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /* ARGSUSED */ static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; XmCascadeButtonGadget cbw = (XmCascadeButtonGadget)new_w; /* * - register parts in cache. * - update cache pointers * - and free req */ _XmProcessLock(); LabG_Cache(cbw) = (XmLabelGCacheObjPart *) _XmCachePart( LabG_ClassCachePart(cbw), (XtPointer) LabG_Cache(cbw), sizeof(XmLabelGCacheObjPart)); CBG_Cache(cbw) = (XmCascadeButtonGCacheObjPart *) _XmCachePart( CBG_ClassCachePart(cbw), (XtPointer) CBG_Cache(cbw), sizeof(XmCascadeButtonGCacheObjPart)); /* * might want to break up into per-class work that gets explicitly * chained. For right now, each class has to replicate all * superclass logic in hook routine */ /* * free the req subobject used for comparisons */ _XmPopWidgetExtData((Widget) cbw, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); XtFree( (char *) ext); _XmProcessUnlock(); } /******************************************************************* * * _XmCascadeBCacheCompare * *******************************************************************/ static int _XmCascadeBCacheCompare( XtPointer A, XtPointer B ) { XmCascadeButtonGCacheObjPart *cascadeB_inst = (XmCascadeButtonGCacheObjPart *) A ; XmCascadeButtonGCacheObjPart *cascadeB_cache_inst = (XmCascadeButtonGCacheObjPart *) B ; if((cascadeB_inst->cascade_pixmap == cascadeB_cache_inst->cascade_pixmap) && (cascadeB_inst->map_delay == cascadeB_cache_inst->map_delay) && (cascadeB_inst->armed_pixmap == cascadeB_cache_inst->armed_pixmap) && (cascadeB_inst->arm_gc == cascadeB_cache_inst->arm_gc) && (cascadeB_inst->background_gc == cascadeB_cache_inst->background_gc)) return 1; else return 0; } /******************************************************************* * _XmArrowPixmapCacheCompare() *******************************************************************/ int _XmArrowPixmapCacheCompare( XtPointer A, XtPointer B ) { XmArrowPixmap *arrowpix_rec = (XmArrowPixmap *) A ; XmArrowPixmap *arrowpix_cache_rec = (XmArrowPixmap *) B ; if ((arrowpix_rec->height == arrowpix_cache_rec->height) && (arrowpix_rec->width == arrowpix_cache_rec->width) && (arrowpix_rec->screen == arrowpix_cache_rec->screen) && (arrowpix_rec->depth == arrowpix_cache_rec->depth) && (arrowpix_rec->direction == arrowpix_cache_rec->direction) && (arrowpix_rec->top_shadow_color == arrowpix_cache_rec->top_shadow_color) && (arrowpix_rec->bottom_shadow_color == arrowpix_cache_rec->bottom_shadow_color) && (arrowpix_rec->foreground_color == arrowpix_cache_rec->foreground_color)) return 1; else return 0; } /******************************************************************* * _XmArrowPixmapCacheDelete() *******************************************************************/ void _XmArrowPixmapCacheDelete( XtPointer data ) { Pixmap pixmap = (Pixmap) data ; XmGadgetCachePtr ptr; XmArrowPixmap *arrowpix_rec; ptr = (XmGadgetCachePtr)(ClassCacheHead(&ArrowPixmapCache)).next; while (ptr) { arrowpix_rec = (XmArrowPixmap *)(CacheDataPtr(ptr)); if (pixmap == arrowpix_rec->pixmap) { if (--ptr->ref_count <= 0) { (ptr->prev)->next = ptr->next; if (ptr->next) /* not the last record */ (ptr->next)->prev = ptr->prev; XmDestroyPixmap(arrowpix_rec->screen, arrowpix_rec->pixmap); XtFree( (char *) ptr); } return; } else ptr = (XmGadgetCachePtr)ptr->next; } } /* * Border highlighting is only allowed for option menus. Otherwise * the button is armed (does not pop up submenus). */ static void BorderHighlight( Widget wid ) { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid ; if (LabG_MenuType(cb) == XmMENU_OPTION) (* ((XmGadgetClass) xmGadgetClass)-> gadget_class.border_highlight) ((Widget) cb); else Arm (cb); } /* * Border unhighlighting only done in option menus. Otherwise the button * is disarmed (does not pop down submenus). */ static void BorderUnhighlight( Widget wid ) { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid ; if (LabG_MenuType(cb) == XmMENU_OPTION) (* ((XmGadgetClass) xmGadgetClass)-> gadget_class.border_unhighlight) ((Widget) cb); else Disarm (cb, False); } /* * Draw the 3D shadow around the widget if its in an option menu or if the * widget is armed. */ static void DrawShadow( XmCascadeButtonGadget cb ) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) cb)); Boolean etched_in; etched_in = dpy -> display.enable_etched_in_menu && (! (LabG_MenuType(cb) == XmMENU_OPTION)) ; if (CBG_IsArmed(cb) || (LabG_MenuType(cb) == XmMENU_OPTION)) { if (XtIsRealized(XtParent(cb))) { XmeDrawShadows (XtDisplay (cb), XtWindow (XtParent(cb)), LabG_TopShadowGC(cb), LabG_BottomShadowGC(cb), cb->gadget.highlight_thickness + cb->rectangle.x, cb->gadget.highlight_thickness + cb->rectangle.y, cb->rectangle.width - 2 * cb->gadget.highlight_thickness, cb->rectangle.height - 2 * cb->gadget.highlight_thickness, cb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } } } static void DrawCascade( register XmCascadeButtonGadget cb ) { if ((CBG_HasCascade(cb)) && (CBG_Cascade_width(cb) != 0)) { /* draw the casacade */ if ((LabG_MenuType(cb) == XmMENU_OPTION) && (CBG_CascadePixmap(cb) == XmUNSPECIFIED_PIXMAP)) { Dimension height, width; Dimension offset_y; Dimension offset_x; switch(CBG_Cascade_height(cb) - 2*G_ShadowThickness(cb)) { case 5: case 6: height = 1; width = CBG_Cascade_width(cb) - 3; break; case 7: case 8: case 9: height = 2; width = CBG_Cascade_width(cb) - 4; break; case 10: case 11: case 12: case 13: height = 3; width = CBG_Cascade_width(cb) - 5; break; default: height = 4; width = CBG_Cascade_width(cb) - 6; break; } width -= 2*G_ShadowThickness(cb); offset_y = (CBG_Cascade_height(cb)- height)/2; if (LayoutIsRtoLG(cb)) { offset_x = (CBG_Cascade_width(cb) - width - G_ShadowThickness(cb)); XFillRectangle(XtDisplay(cb), XtWindow(XtParent(cb)), LabG_BackgroundGC(cb), cb->rectangle.x + CBG_Cascade_x(cb) + offset_x, cb->rectangle.y + CBG_Cascade_y(cb) + offset_y, width, height); XmeDrawShadows(XtDisplay(cb), XtWindow(XtParent(cb)), LabG_TopShadowGC(cb), LabG_BottomShadowGC(cb), cb->rectangle.x + CBG_Cascade_x(cb) + offset_x - G_ShadowThickness(cb), cb->rectangle.y + CBG_Cascade_y(cb) + offset_y - G_ShadowThickness(cb), width + (2* G_ShadowThickness(cb)), height + (2* G_ShadowThickness(cb)), G_ShadowThickness(cb), XmSHADOW_OUT); } else { XFillRectangle(XtDisplay(cb), XtWindow(XtParent(cb)), LabG_BackgroundGC(cb), cb->rectangle.x + CBG_Cascade_x(cb) + G_ShadowThickness(cb), cb->rectangle.y + CBG_Cascade_y(cb) + offset_y, width, height); XmeDrawShadows(XtDisplay(cb), XtWindow(XtParent(cb)), LabG_TopShadowGC(cb), LabG_BottomShadowGC(cb), cb->rectangle.x + CBG_Cascade_x(cb), cb->rectangle.y + CBG_Cascade_y(cb) + offset_y - G_ShadowThickness(cb), width + (2* G_ShadowThickness(cb)), height + (2* G_ShadowThickness(cb)), G_ShadowThickness(cb), XmSHADOW_OUT); } } else { Pixmap pixmap ; int depth ; pixmap = CBG_IsArmed(cb) && (CBG_ArmedPixmap(cb) != XmUNSPECIFIED_PIXMAP) ? CBG_ArmedPixmap(cb) : CBG_CascadePixmap(cb) ; XmeGetPixmapData(XtScreen(cb), pixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == XtParent(cb)->core.depth) XCopyArea (XtDisplay(cb), pixmap, XtWindow(XtParent(cb)), LabG_NormalGC(cb), 0, 0, CBG_Cascade_width(cb), CBG_Cascade_height(cb), cb->rectangle.x + CBG_Cascade_x(cb), cb->rectangle.y + CBG_Cascade_y(cb)); else if (depth == 1) XCopyPlane (XtDisplay(cb), pixmap, XtWindow(XtParent(cb)), LabG_NormalGC(cb), 0, 0, CBG_Cascade_width(cb), CBG_Cascade_height(cb), cb->rectangle.x + CBG_Cascade_x(cb), cb->rectangle.y + CBG_Cascade_y(cb), 1); } } } /* * set up the cascade position. */ static void position_cascade( XmCascadeButtonGadget cascadebtn ) { Dimension buffer; if (CBG_HasCascade(cascadebtn)) { if (LayoutIsRtoLG(cascadebtn)) CBG_Cascade_x(cascadebtn) = cascadebtn->gadget.highlight_thickness + cascadebtn->gadget.shadow_thickness + LabG_MarginWidth(cascadebtn); else CBG_Cascade_x(cascadebtn) = cascadebtn->rectangle.width - cascadebtn->gadget.highlight_thickness - cascadebtn->gadget.shadow_thickness - LabG_MarginWidth(cascadebtn) - CBG_Cascade_width(cascadebtn); buffer = cascadebtn->gadget.highlight_thickness + cascadebtn->gadget.shadow_thickness + LabG_MarginHeight(cascadebtn); CBG_Cascade_y(cascadebtn) = buffer + ((cascadebtn->rectangle.height - 2*buffer) - CBG_Cascade_height(cascadebtn)) / 2; } else { CBG_Cascade_y(cascadebtn) = 0; CBG_Cascade_x(cascadebtn) = 0; } } /* * redisplay the widget */ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid ; XtExposeProc expose; if (XtIsRealized ((Widget)cb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Boolean etched_in = dpy->display.enable_etched_in_menu; GC tmpGC = NULL; if (LabG_IsMenupane(cb)) { XmMenuShellWidget mshell = (XmMenuShellWidget)XtParent(XtParent(cb)); if (!mshell->shell.popped_up) return; } /* * This might be necessary in an option menu to keep the glyph from * moving when it's items vary in size. */ if (LabG_MenuType(cb) == XmMENU_OPTION) position_cascade(cb); if (etched_in) { XFillRectangle (XtDisplay(cb), XtWindow(XtParent(cb)), CBG_IsArmed(cb) ? CBG_ArmGC(cb) : CBG_BackgroundGC(cb), cb->rectangle.x, cb->rectangle.y, cb->rectangle.width, cb->rectangle.height); } if (etched_in && CBG_IsArmed(cb)) { Pixel junk, select_pix; XmManagerWidget mw = (XmManagerWidget) XtParent(cb); Boolean replaceGC = False; #ifdef FIX_1395 XGCValues values; GC tmp_bgc = NULL; #endif XmGetColors(XtScreen(mw), mw->core.colormap, mw->core.background_pixel, &junk, &junk, &junk, &select_pix); if (select_pix == mw->manager.foreground) { /* mw->core.background_pixel */ replaceGC = True; tmpGC = LabG_NormalGC(cb); LabG_NormalGC(cb) = CBG_BackgroundGC(cb); } #ifdef FIX_1395 /* Fetch the select_color GetGC() actually used. */ XGetGCValues(XtDisplay(cb), LabG_BackgroundGC(cb), GCBackground, &values); if (values.background != select_pix) { values.background = select_pix; XChangeGC(XtDisplay((Widget)cb), LabG_BackgroundGC(cb), GCBackground, &values); } tmp_bgc = LabG_BackgroundGC(cb); LabG_BackgroundGC(cb) = CBG_ArmGC(cb); #endif _XmProcessLock(); expose = xmLabelGadgetClassRec.rect_class.expose; _XmProcessUnlock(); (* expose)((Widget)cb, event, region); #ifdef FIX_1395 /* Restore default bg GC*/ LabG_BackgroundGC(cb) = tmp_bgc; #endif if (replaceGC) LabG_NormalGC(cb) = tmpGC; } else { /* Label class does most of the work */ _XmProcessLock(); expose = xmLabelGadgetClassRec.rect_class.expose; _XmProcessUnlock(); (* expose)((Widget)cb, event, region); } DrawCascade(cb); DrawShadow (cb); } } /* * Input sent by a manager is dispatched here. The gadget handles Arm, * Activate, Enter, Leave, FocusIn, FocusOut and Help events. */ static void InputDispatch( Widget wid, XEvent *event, Mask event_mask ) { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid ; if (event_mask & XmARM_EVENT) { if (LabG_MenuType(cb) == XmMENU_OPTION) ArmAndPost (cb, event); else if (LabG_MenuType(cb) == XmMENU_BAR) MenuBarSelect ((Widget) cb, event); else StartDrag (cb, event); } else if (event_mask & XmBDRAG_EVENT) { _XmProcessDrag ((Widget) cb, event, NULL, NULL); } else if (event_mask & XmACTIVATE_EVENT) { if ((LabG_MenuType(cb) == XmMENU_PULLDOWN) || (LabG_MenuType(cb) == XmMENU_POPUP) || (LabG_MenuType(cb) == XmMENU_BAR)) { if (event->type == ButtonRelease) DoSelect (cb, event); else if (event->type == KeyPress) KeySelect (cb, event); #ifdef FIX_1665 CBG_SetWasPosted(cb, FALSE); #endif } /* else option menu - do nothing if menu was not posted on btndown */ } else if (event_mask & XmENTER_EVENT) { if (LabG_MenuType(cb) == XmMENU_BAR) MenuBarEnter ((Widget) cb, event); else if (LabG_MenuType(cb) == XmMENU_OPTION) _XmEnterGadget ((Widget) cb, event, NULL, NULL); else DelayedArm (cb, event); } else if (event_mask & XmLEAVE_EVENT) { if (LabG_MenuType(cb) == XmMENU_BAR) MenuBarLeave ((Widget) cb); else if (LabG_MenuType(cb) == XmMENU_OPTION) _XmLeaveGadget( (Widget) cb, event, NULL, NULL); else CheckDisarm (cb, event); } else if (event_mask & XmFOCUS_IN_EVENT) (* (((XmCascadeButtonGadgetClassRec *)(cb->object.widget_class))-> gadget_class.border_highlight)) ((Widget) cb); else if (event_mask & XmFOCUS_OUT_EVENT) { if (LabG_IsMenupane(cb) && (((XmManagerWidget)XtParent(cb))->manager.active_child == wid) && CBG_Submenu(cb)) { XmMenuShellWidget mshell = (XmMenuShellWidget) XtParent(CBG_Submenu(cb)); if ((mshell->composite.children[0] == CBG_Submenu(cb)) && (XmIsMenuShell(mshell)) && (mshell->shell.popped_up)) { return; } } (* (((XmCascadeButtonGadgetClassRec *)(cb->object.widget_class))-> gadget_class.border_unhighlight)) ((Widget) cb); } else if (event_mask & XmHELP_EVENT) _XmCBHelp((Widget) cb, event, NULL, NULL); } /* * Arming the CascadeButtonGadget consists of setting the armed bit * and drawing the 3D shadow. CascadeButtonGadgets in * option menus are never armed since they will never get the event * to cause it to unarm. */ static void Arm( XmCascadeButtonGadget cb ) { if ((LabG_MenuType(cb) != XmMENU_OPTION) && (! CBG_IsArmed(cb))) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Boolean etched_in = dpy->display.enable_etched_in_menu; CBG_SetArmed(cb, TRUE); if (etched_in) Redisplay((Widget) cb, NULL, NULL); else { DrawCascade(cb); DrawShadow (cb); } } XmProcessTraversal((Widget) cb, XmTRAVERSE_CURRENT); } /* * Post any submenus and then arm the gadget. The order is important for * performance. */ static void ArmAndPost( XmCascadeButtonGadget cb, XEvent *event ) { XmMenuState mst = _XmGetMenuState((Widget)cb); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(cb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (!CBG_IsArmed(cb)) { if ((LabG_MenuType(cb) == XmMENU_OPTION) && (XtParent(cb) == mst->RC_ReplayInfo.toplevel_menu) && (event->xbutton.time == mst->RC_ReplayInfo.time)) return; _XmCascadingPopup ((Widget) cb, event, TRUE); Arm(cb); /* * Option menus must be armed since the post just arms the * submenu */ if (LabG_MenuType(cb) == XmMENU_OPTION) { menuSTrait -> arm((Widget) cb); } /* * Record so spring loaded DispatchEvent() doesn't handle this event */ if (event) _XmRecordEvent(event); } } /* * class function to cause the cascade button to be armed and selected */ /*ARGSUSED*/ static void ArmAndActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid ; XmAnyCallbackStruct cback; XmRowColumnWidget parent = (XmRowColumnWidget) XtParent(cb); Time _time = _XmGetDefaultTime(wid, event); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); /* check if event has been processed */ if (event && !_XmIsEventUnique(event)) return; if (menuSTrait == NULL) return; switch (LabG_MenuType(cb)) { case XmMENU_OPTION: { ArmAndPost (cb, event); if (CBG_Submenu(cb)) { /* * if XmProcessTraversal() fails, it's possible that the pane * has no traversable children, so reset the focus to the pane. */ if (!XmProcessTraversal(CBG_Submenu(cb), XmTRAVERSE_CURRENT)) { /* Must clear focus path first for shared menushells. * Otherwise, moving the focus back will have old stale * (old) focus_item. */ _XmClearFocusPath(CBG_Submenu(cb)); XtSetKeyboardFocus(XtParent(CBG_Submenu(cb)), CBG_Submenu(cb)); } } break; } case XmMENU_PULLDOWN: case XmMENU_POPUP: { /* In case the tear off is active but not armed or grabbed */ menuSTrait -> tearOffArm((Widget) parent); Select (cb, event, TRUE); if (CBG_Submenu(cb)) { /* * if XmProcessTraversal() fails, it's possible that the pane * has no traversable children, so reset the focus to the pane. */ if (!XmProcessTraversal(CBG_Submenu(cb), XmTRAVERSE_CURRENT)) { /* Must clear focus path first for shared menushells. * Otherwise, moving the focus back will have old stale * (old) focus_item. */ _XmClearFocusPath(CBG_Submenu(cb)); XtSetKeyboardFocus(XtParent(CBG_Submenu(cb)), CBG_Submenu(cb)); } } break; } case XmMENU_BAR: { ShellWidget myShell = NULL; /* Shared menupanes require some additional checks */ if (CBG_Submenu(cb)) myShell = (ShellWidget)XtParent(CBG_Submenu(cb)); if (myShell && XmIsMenuShell(myShell) && /* not torn ?! */ (myShell->shell.popped_up) && (myShell->composite.children[0] == CBG_Submenu(cb)) && (cb == (XmCascadeButtonGadget)RC_CascadeBtn(CBG_Submenu(cb)))) { menuSTrait -> popdown((Widget) parent, event); Disarm (cb, FALSE); } else { /* call the cascading callbacks first thing */ cback.reason = XmCR_CASCADING; cback.event = event; XtCallCallbackList ((Widget) cb, CBG_CascadeCall(cb), &cback); /* * check if the traversing flag is set true. This indicates * that we are in a traverse and don't want to activate if * there is no submenu attached. Set during KDown in menubar. */ if (CBG_Traversing(cb) && !CBG_Submenu(cb)) return; if (! RC_IsArmed (parent)) { _XmMenuFocus((Widget) parent, XmMENU_BEGIN, _time); if (CBG_Submenu (cb) && menuSTrait != NULL) menuSTrait -> arm((Widget) cb); } else menuSTrait -> menuBarCleanup((Widget) parent); /* do the select without calling the cascading callbacks again */ Select (cb, event, FALSE); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); if (CBG_Submenu(cb)) { /* * if XmProcessTraversal() fails, it's possible that the pane * has no traversable children, so reset the focus to the pane. */ if (!XmProcessTraversal(CBG_Submenu(cb), XmTRAVERSE_CURRENT)) { /* Must clear focus path first for shared menushells. * Otherwise, moving the focus back will have old stale * (old) focus_item. */ _XmClearFocusPath(CBG_Submenu(cb)); XtSetKeyboardFocus(XtParent(CBG_Submenu(cb)), CBG_Submenu(cb)); } } else { menuSTrait -> disarm((Widget) parent); _XmMenuFocus(XtParent(cb), XmMENU_END, _time); XtUngrabPointer(XtParent(cb), _time); } } break; } } /* Record so spring loaded DispatchEvent() doesn't recall this routine. */ if (event) _XmRecordEvent(event); } /* * Disarm the menu. This may include popping down any submenu that is up * and removing the timeout to post a submenu. */ static void Disarm( XmCascadeButtonGadget cb, #if NeedWidePrototypes int unpost ) #else Boolean unpost ) #endif /* NeedWidePrototypes */ { Widget rowcol = XtParent(cb); if (CBG_IsArmed(cb)) { CBG_SetArmed(cb,FALSE); /* popdown any posted submenus */ if ((unpost) && (RC_PopupPosted(rowcol))) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone)) (RC_PopupPosted(rowcol),NULL, NULL, NULL); } /* if a delayed arm is pending, remove it */ if (CBG_Timer(cb)) { XtRemoveTimeOut (CBG_Timer(cb)); CBG_Timer(cb) = 0; } /* if the shadow is drawn and the menupane is not going down, erase it */ if ((! RC_PoppingDown(rowcol)) || RC_TornOff(rowcol)) { if (XtIsRealized(rowcol)) { /* etched in menu button */ XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (etched_in) Redisplay((Widget) cb, NULL, NULL); else XmeDrawHighlight(XtDisplay(cb), XtWindow(cb), LabG_BackgroundGC(cb), cb->gadget.highlight_thickness + cb->rectangle.x, cb->gadget.highlight_thickness + cb->rectangle.y, cb->rectangle.width - 2 * cb->gadget.highlight_thickness, cb->rectangle.height - 2 * cb->gadget.highlight_thickness, cb->gadget.shadow_thickness); } } DrawCascade(cb); } } /* * called when the post delay timeout occurs. */ /*ARGSUSED*/ static void PostTimeout( XtPointer closure, XtIntervalId *id) /* unused */ { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) closure ; if (CBG_Timer(cb)) { CBG_Timer(cb) = 0; _XmCascadingPopup ((Widget) cb, NULL, TRUE); } } /* * set the timer to post the submenu if a leave event does * not occur first. */ static void DelayedArm( XmCascadeButtonGadget cb, XEvent *event ) { if ((! CBG_IsArmed(cb)) && (((XmMenuShellWidget) XtParent(XtParent(cb)))->shell.popped_up) && _XmGetInDragMode((Widget) cb)) { if (CBG_MapDelay(cb) <= 0) { /* don't delay, just do it */ ArmAndPost (cb, event); } else { /* To fix CR 8172, the following two lines were reversed. Because calling Arm seems to cause a focus change (temporary) out of the widget, the timer was incorrectly removed and the menu wouldn't post. */ Arm(cb); /* NOTE!! XtAppAddTimeOut returns XtIntervalId (unsigned long) * but the timer field was declared as an int in this gadget. * */ CBG_Timer(cb) = XtAppAddTimeOut(XtWidgetToApplicationContext( (Widget) cb), (unsigned long) CBG_MapDelay(cb), PostTimeout, (XtPointer) cb) ; } } } /* * if traversal is not on and the mouse * has not entered its cascading submenu, disarm the * CascadeButtonGadget. */ static void CheckDisarm( XmCascadeButtonGadget cb, XEvent *event ) { XmMenuShellWidget submenushell; XMotionEvent * entEvent = (XMotionEvent *) event; if (_XmGetInDragMode((Widget) cb)) { if ((CBG_IsArmed(cb)) && (CBG_Submenu(cb))) { submenushell = (XmMenuShellWidget) XtParent (CBG_Submenu(cb)); if (submenushell->shell.popped_up) { if ((entEvent->x_root >= submenushell->core.x) && (entEvent->x_root < submenushell->core.x + submenushell->core.width + (submenushell->core.border_width << 1)) && (entEvent->y_root >= submenushell->core.y) && (entEvent->y_root < submenushell->core.y + submenushell->core.height + (submenushell->core.border_width << 1))) /* then we are in the cascading submenu, don't disarm */ return; } } Disarm (cb, TRUE); } } /* * post submenu and disable traversal. These functions must be called * in this order. */ static void StartDrag( XmCascadeButtonGadget cb, XEvent *event ) { XmRowColumnWidget parent = (XmRowColumnWidget) XtParent(cb); XmMenuShellWidget mshell = (XmMenuShellWidget) XtParent(parent); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(cb)), XmQTmenuSystem); /* Start with posted submenu bit reset */ CBG_SetWasPosted(cb, FALSE); if (CBG_Submenu(cb) && RC_IsArmed ((XmRowColumnWidget) CBG_Submenu(cb))) { CBG_SetWasPosted(cb, TRUE); } if (LabG_IsMenupane(cb) && ! mshell->shell.popped_up) { return; } /* In case the tear off is active but not armed or grabbed */ if (menuSTrait != NULL) menuSTrait -> tearOffArm((Widget) parent); _XmSetInDragMode((Widget) cb, True); _XmCascadingPopup ((Widget) cb, event, TRUE); Arm (cb); /* record event so MenuShell does not process it */ _XmRecordEvent (event); } /* * do the popup and if there is not a submenu, bring down the menu system. */ static void Select( XmCascadeButtonGadget cb, XEvent *event, #if NeedWidePrototypes int doCascade ) #else Boolean doCascade ) #endif /* NeedWidePrototypes */ { XmAnyCallbackStruct cback; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(cb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (CBG_WasPosted(cb)) { Disarm(cb, TRUE); if ((CBG_Submenu(cb) != NULL) && (LabG_MenuType(cb) == XmMENU_BAR)) _XmMenuPopDown(XtParent((Widget) cb), event, NULL); return; } _XmCascadingPopup ((Widget) cb, event, doCascade); /* * check if there is a submenu here in case this changed during * the cascadeing callbacks */ if (CBG_Submenu(cb) == NULL) { if (menuSTrait != NULL) menuSTrait -> popdown(XtParent(cb), event); Disarm (cb, FALSE); if (menuSTrait != NULL) menuSTrait -> disarm(XtParent(cb)); cback.event = event; cback.reason = XmCR_ACTIVATE; if (menuSTrait != NULL) menuSTrait -> entryCallback(XtParent(cb), (Widget) cb, &cback); if ((! LabG_SkipCallback(cb)) && (CBG_ActivateCall(cb))) { XtCallCallbackList ((Widget) cb, CBG_ActivateCall(cb), &cback); } } else { Arm (cb); } } /* * if there is a submenu, enable traversal. * call select to do the work */ static void DoSelect( XmCascadeButtonGadget cb, XEvent *event ) { Time _time = _XmGetDefaultTime((Widget) cb, event); if ((LabG_MenuType(cb) == XmMENU_BAR) && ! RC_IsArmed(XtParent(cb))) return; /* * make sure the shell is popped up, this takes care of a corner case * that can occur with rapid pressing of the mouse button */ if (LabG_IsMenupane(cb) && (!((XmMenuShellWidget) XtParent(XtParent(cb)))->shell.popped_up)) { return; } Select(cb, event, (Boolean)(CBG_Submenu(cb) != NULL)); /* * don't let the menu shell widget process this event */ _XmRecordEvent (event); _XmSetInDragMode((Widget) cb, False); if (CBG_Submenu(cb)) { /* * if XmProcessTraversal() fails, it's possible that the pane has * no traversable children, so reset the focus to the pane. */ if (!XmProcessTraversal(CBG_Submenu(cb), XmTRAVERSE_CURRENT)) { /* Must clear focus path first for shared menushells. * Otherwise, moving the focus back will have old stale * (old) focus_item. */ _XmClearFocusPath(CBG_Submenu(cb)); XtSetKeyboardFocus(XtParent(CBG_Submenu(cb)), CBG_Submenu(cb)); } } else { /* *** Move this call to Select() *** * * (* xmLabelGadgetClassRec.label_class.menuProcs) * (XmMENU_DISARM, XtParent(cb)); */ if (LabG_MenuType(cb) == XmMENU_BAR) { _XmMenuFocus(XtParent(cb), XmMENU_END, _time); XtUngrabPointer(XtParent(cb), _time); } } } /* * if the menu system traversal is enabled, do a select */ static void KeySelect( XmCascadeButtonGadget cb, XEvent *event ) { XmRowColumnWidget parent = (XmRowColumnWidget) XtParent(cb); XmMenuSystemTrait menuSTrait; /* check if event has been processed */ if (!_XmIsEventUnique(event)) return; if (!_XmGetInDragMode((Widget) cb) && RC_IsArmed(parent)) { if (LabG_MenuType(cb) == XmMENU_BAR) { menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(cb)), XmQTmenuSystem); if (menuSTrait != NULL) menuSTrait -> menuBarCleanup((Widget) parent); } Select(cb, event, TRUE); if (CBG_Submenu(cb)) { XmProcessTraversal(CBG_Submenu(cb), XmTRAVERSE_CURRENT); } } /* record so that menuShell does not process this event */ _XmRecordEvent(event); } /* * If the menu system is not active, arm it and arm this cascadebutton * else start the drag mode */ static void MenuBarSelect( Widget wid, XEvent *event ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; Boolean validButton; Time _time = _XmGetDefaultTime(wid, event); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (menuSTrait == NULL) return; CBG_SetWasPosted(cb, FALSE); if (RC_IsArmed ((XmRowColumnWidget) XtParent(cb))) { /* Cleanup the PM menubar mode, if enabled */ menuSTrait -> menuBarCleanup(XtParent(cb)); if (!CBG_Submenu(cb)) { _XmMenuFocus(XtParent(cb), XmMENU_MIDDLE, _time); } StartDrag ((XmCascadeButtonGadget) cb, event); } else { validButton = menuSTrait -> verifyButton(XtParent(cb), event); if (validButton) { /* Don't post the menu if the menu cannot control grabs! */ if (_XmMenuGrabKeyboardAndPointer(XtParent(cb), _time) != GrabSuccess) { _XmRecordEvent (event); return; } _XmMenuFocus(XtParent(cb), XmMENU_BEGIN, _time); menuSTrait -> arm((Widget) cb); _XmSetInDragMode((Widget) cb, True); _XmCascadingPopup ((Widget) cb, event, TRUE); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); if (!CBG_Submenu(cb)) { /* * since no submenu is posted, check if the grab has occured * and if not, do the pointer grab now. */ if (RC_BeingArmed(XtParent(cb))) { Cursor cursor; cursor = XmGetMenuCursor(XtDisplay(cb)); _XmGrabPointer(XtParent(cb), True, EVENTS, GrabModeAsync, GrabModeAsync, None, cursor, _time); RC_SetBeingArmed(XtParent(cb), False); } } /* record so that menuShell doesn't process this event */ _XmRecordEvent (event); } } } /* * If the menu is active, post submenu and arm. */ static void MenuBarEnter( Widget wid, XEvent *event ) { register XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmRowColumnWidget rc = (XmRowColumnWidget)XtParent(cb); if ((RC_IsArmed (rc)) && (! CBG_IsArmed(cb)) && _XmGetInDragMode((Widget) cb)) { if (!CBG_Submenu(cb)) { _XmMenuFocus( (Widget) rc, XmMENU_MIDDLE, _XmGetDefaultTime(wid, event)); } _XmCascadingPopup ((Widget) cb, event, TRUE); Arm((XmCascadeButtonGadget) cb); } } /* * unless our submenu is posted or traversal is on, disarm */ static void MenuBarLeave( Widget wid ) { register XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmMenuShellWidget submenuShell; if (RC_IsArmed (XtParent (cb))) { /* Reset this bit so that we don't unpost if the user reenters the cascade button */ CBG_SetWasPosted(cb, FALSE); if (CBG_Submenu(cb)) { submenuShell = (XmMenuShellWidget) XtParent(CBG_Submenu(cb)); if (submenuShell->shell.popped_up) return; } if (_XmGetInDragMode((Widget) cb)) Disarm ((XmCascadeButtonGadget) cb, TRUE); } } /* * Create the CB and CBG 3d arrows. * The Pixmaps must be unspecified going into this routine. This helps to * make sure arrow cache is sync'd up as well as not accidentally overwriting * application's pixmap arrow if set. */ void _XmCreateArrowPixmaps( Widget wid ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmArrowPixmap cpart; XmArrowPixmap *armed_arrow, *unarmed_arrow; GC gc, tsGC, bsGC; XGCValues values; Pixmap pixmap; int ht, st; Pixel tsc, bsc, bg; Dimension side; Screen *screen; int depth; unsigned char arrow_direction; unsigned short text_height; GC armGC = NULL; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Boolean etched_in = dpy->display.enable_etched_in_menu; screen = XtScreen(cb); if (XmIsGadget(cb)) { if ((CBG_CascadePixmap(cb) != XmUNSPECIFIED_PIXMAP) && (CBG_ArmedPixmap(cb) != XmUNSPECIFIED_PIXMAP)) return; ht = G_HighlightThickness(cb); st = G_ShadowThickness(cb); tsc = LabG_TopShadowColor(cb); bsc = LabG_BottomShadowColor(cb); bg = LabG_Background(cb); tsGC = LabG_TopShadowGC(cb); bsGC = LabG_BottomShadowGC(cb); arrow_direction = (LayoutIsRtoLP(cb)) ? XmARROW_LEFT : XmARROW_RIGHT; text_height = LabG_TextRect_height(cb); depth = XtParent(cb)->core.depth; if (etched_in) armGC = CBG_ArmGC(wid); } else { Pixel select_pixel; if ((CB_CascadePixmap(cb) != XmUNSPECIFIED_PIXMAP) && (CB_ArmedPixmap(cb) != XmUNSPECIFIED_PIXMAP)) return; XmGetColors(XtScreen(wid), wid->core.colormap, wid -> core.background_pixel, NULL, NULL, NULL, &select_pixel); if (etched_in) { values.foreground = values.background = select_pixel; values.graphics_exposures = False; armGC = XtGetGC ((Widget) wid, GCForeground | GCBackground | GCGraphicsExposures, &values); } ht = cb->primitive.highlight_thickness; st = cb->primitive.shadow_thickness; tsc = cb->primitive.top_shadow_color; bsc = cb->primitive.bottom_shadow_color; bg = cb->core.background_pixel; tsGC = cb->primitive.top_shadow_GC; bsGC = cb->primitive.bottom_shadow_GC; arrow_direction = (LayoutIsRtoLP(cb)) ? XmARROW_LEFT : XmARROW_RIGHT; text_height = Lab_TextRect_height(cb); depth = cb->core.depth; } side = MAX( (text_height * 2 / 3) + 2 * (ht + st), (2*(ht + (st-1) +1)) +1 ); /* see _XmGetArrowDrawRects() */ cpart.height = cpart.width = side; cpart.depth = depth; cpart.direction = arrow_direction; cpart.top_shadow_color = tsc; cpart.bottom_shadow_color = bsc; cpart.foreground_color = bg; cpart.display = XtDisplay(cb); cpart.screen = screen; cpart.pixmap = XmUNSPECIFIED_PIXMAP; /* * Create or get an existing arrow cache record for the unarmed arrow */ _XmProcessLock(); unarmed_arrow = (XmArrowPixmap *) _XmCachePart(&ArrowPixmapCache, (XtPointer) &cpart, sizeof(XmArrowPixmap)); /* * Create or get an existing arrow cache record for the armed arrow */ cpart.top_shadow_color = bsc; cpart.bottom_shadow_color = tsc; armed_arrow = (XmArrowPixmap *) _XmCachePart(&ArrowPixmapCache, (XtPointer) &cpart, sizeof(XmArrowPixmap)); _XmProcessUnlock(); if ((unarmed_arrow->pixmap == XmUNSPECIFIED_PIXMAP) || (armed_arrow->pixmap == XmUNSPECIFIED_PIXMAP)) { values.foreground = values.background = bg; values.graphics_exposures = False; gc = XtGetGC ((Widget) cb, GCForeground | GCBackground | GCGraphicsExposures, &values); /* armed arrow */ if (armed_arrow->pixmap == XmUNSPECIFIED_PIXMAP) { pixmap = XCreatePixmap(XtDisplay(cb), RootWindowOfScreen(screen), side, side, depth); armed_arrow->pixmap = pixmap; XFillRectangle(XtDisplay(cb), pixmap, etched_in? armGC : gc, 0, 0, side, side); XmeDrawArrow(XtDisplay((Widget)cb), pixmap, bsGC, tsGC, gc, ht + st - 1, ht + st - 1, side - 2*(ht + st - 1), side - 2*(ht + st - 1), st, arrow_direction); } /* standard (unarmed) pixmap */ if (unarmed_arrow->pixmap == XmUNSPECIFIED_PIXMAP) { pixmap = XCreatePixmap(XtDisplay(cb), RootWindowOfScreen(screen), side, side, depth); unarmed_arrow->pixmap = pixmap; XFillRectangle(XtDisplay(cb), pixmap, gc, 0, 0, side, side); XmeDrawArrow(XtDisplay((Widget)cb), pixmap, tsGC, bsGC, gc, ht + st - 1, ht + st - 1, side - 2*(ht + st - 1), side - 2*(ht + st - 1), st, arrow_direction); } XtReleaseGC( (Widget) cb, gc); } if (XmIsGadget(cb)) { CBG_ArmedPixmap(cb) = armed_arrow->pixmap; CBG_CascadePixmap(cb) = unarmed_arrow->pixmap; } else { CB_ArmedPixmap(cb) = armed_arrow->pixmap; CB_CascadePixmap(cb) = unarmed_arrow->pixmap; } } /* * get the cascade size set up */ static void size_cascade( XmCascadeButtonGadget cascadebtn ) { Window rootwin; int x,y; /* must be int */ unsigned int width, height, border, depth; /* must be unsigned int */ if (CBG_CascadePixmap(cascadebtn) != XmUNSPECIFIED_PIXMAP) { XGetGeometry(XtDisplay(cascadebtn), CBG_CascadePixmap(cascadebtn), &rootwin, &x, &y, &width, &height, &border, &depth); CBG_Cascade_width(cascadebtn) = (Dimension) width; CBG_Cascade_height(cascadebtn) = (Dimension) height; } else { if (LabG_MenuType(cascadebtn) == XmMENU_OPTION) { CBG_Cascade_width(cascadebtn) = CBG_Cascade_height(cascadebtn) = MAX(LabG_TextRect(cascadebtn).height, LabG_AccTextRect(cascadebtn).height) + 2 * cascadebtn->gadget.shadow_thickness; /* glyph shadow */ } else { CBG_Cascade_width(cascadebtn) = 0; CBG_Cascade_height(cascadebtn) = 0; } } } /* * set up the cascade size and location */ static void setup_cascade( XmCascadeButtonGadget cascadebtn, #if NeedWidePrototypes int adjustWidth, int adjustHeight ) #else Boolean adjustWidth, Boolean adjustHeight ) #endif /* NeedWidePrototypes */ { Dimension delta; if (CBG_HasCascade(cascadebtn)) { /* * modify the size of the CascadeButtonGadget to acommadate the * cascade, if needed. The cascade should fit inside MarginRight. */ if (LayoutIsRtoLG(cascadebtn)) { if ((CBG_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE) > LabG_MarginLeft(cascadebtn)) { delta = CBG_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE - LabG_MarginLeft(cascadebtn); LabG_MarginLeft(cascadebtn) += delta; if (adjustWidth) cascadebtn->rectangle.width += delta; else { if (LabG_Alignment(cascadebtn) == XmALIGNMENT_BEGINNING) LabG_TextRect_x(cascadebtn) += delta; else if (LabG_Alignment(cascadebtn) == XmALIGNMENT_CENTER) LabG_TextRect_x(cascadebtn) += delta/2; } } } else { if ((CBG_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE) > LabG_MarginRight(cascadebtn)) { delta = CBG_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE - LabG_MarginRight(cascadebtn); LabG_MarginRight(cascadebtn) = LabG_MarginRight(cascadebtn) + delta; if (adjustWidth) cascadebtn->rectangle.width += delta; else { if (LabG_Alignment(cascadebtn) == XmALIGNMENT_END) LabG_TextRect_x(cascadebtn) -= delta; else if (LabG_Alignment(cascadebtn) == XmALIGNMENT_CENTER) LabG_TextRect_x(cascadebtn) -= delta/2; } } } /* * the cascade height should fit inside of * TextRect + marginTop + marginBottom */ delta = CBG_Cascade_height(cascadebtn) + 2 * (LabG_MarginHeight(cascadebtn) + cascadebtn->gadget.shadow_thickness + cascadebtn->gadget.highlight_thickness); if (delta > cascadebtn->rectangle.height) { delta -= cascadebtn->rectangle.height; LabG_MarginTop(cascadebtn) = LabG_MarginTop(cascadebtn) + (delta/2); LabG_TextRect_y(cascadebtn) += delta/2; LabG_MarginBottom(cascadebtn) = LabG_MarginBottom(cascadebtn) + delta - (delta/2); if (adjustHeight) cascadebtn->rectangle.height += delta; } } position_cascade(cascadebtn); } /* * Destroy the widget */ static void Destroy( Widget wid ) { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid ; XmRowColumnWidget submenu = (XmRowColumnWidget) CBG_Submenu(cb); XmMenuSystemTrait menuSTrait; XmManagerWidget mw = (XmManagerWidget) XtParent(cb); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); /* * break the submenu link */ if (submenu != NULL && menuSTrait != NULL) menuSTrait -> recordPostFromWidget((Widget) submenu, (Widget) cb, FALSE); if (CBG_Timer(cb)) XtRemoveTimeOut (CBG_Timer(cb)); _XmProcessLock(); if (CBG_ArmedPixmap(cb) != XmUNSPECIFIED_PIXMAP) { _XmArrowPixmapCacheDelete((XtPointer) CBG_ArmedPixmap(cb)); _XmArrowPixmapCacheDelete((XtPointer) CBG_CascadePixmap(cb)); } /* Release the GCs */ XtReleaseGC ((Widget) mw, CBG_ArmGC(cb)); XtReleaseGC ((Widget) mw, CBG_BackgroundGC(cb)); _XmCacheDelete((XtPointer) CBG_Cache(cb)); _XmProcessUnlock(); } /* * routine to resize a cascade button, called by the parent * geometery manager */ static void Resize( Widget wid ) { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid; XtWidgetProc resize; if (cb) { /* Label class does it's work */ _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); (* resize) ((Widget) cb); /* move the cascade too */ position_cascade (cb); } } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; Cardinal size; XmCascadeButtonGCacheObject newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmCascadeButtonGCacheObject)_XmExtObjAlloc(size); reqSec = (XmCascadeButtonGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy( &(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); memcpy( &(newSec->cascade_button_cache), CBG_Cache(newParent), sizeof(XmCascadeButtonGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); /* * Since the resource lists for label and cascadebutton were merged at * ClassInitialize time we need to make only one call to * XtSetSubvalues() */ XtSetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); memcpy((XtPointer)reqSec, (XtPointer)newSec, size); LabG_Cache(newParent) = &(((XmLabelGCacheObject)newSec)->label_cache); LabG_Cache(refParent) = &(((XmLabelGCacheObject)extData->reqWidget)-> label_cache); CBG_Cache(newParent) = &(((XmCascadeButtonGCacheObject)newSec)->cascade_button_cache); CBG_Cache(refParent) = &(((XmCascadeButtonGCacheObject)extData->reqWidget)-> cascade_button_cache); _XmExtImportArgs((Widget)newSec, args, num_args); /* CR 2990: Use XmNbuttonFontList as the default font. */ if (LabG_Font(newParent) == NULL) LabG_Font(newParent) = XmeGetDefaultRenderTable (newParent, XmBUTTON_FONTLIST); return FALSE; } /************************************************************************ * * GetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; Cardinal size; XmCascadeButtonGCacheObject newSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmCascadeButtonGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy( &(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); memcpy( &(newSec->cascade_button_cache), CBG_Cache(newParent), sizeof(XmCascadeButtonGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); /* Note that if a resource is defined in the superclass's as well as a subclass's resource list and if a NULL is passed in as the third argument to XtSetArg, then when a GetSubValues() is done by the superclass the NULL is replaced by a value. Now when the subclass gets the arglist it doesn't see a NULL and thinks it's an address it needs to stuff a value into and sure enough it breaks. This means that we have to pass the same arglist with the NULL to both the superclass and subclass and propagate the values up once the XtGetSubValues() are done.*/ /* * Since the resource lists for label and cascadebutton were merged at * ClassInitialize time we need to make only one call to * XtGetSubvalues() */ XtGetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmExtGetValuesHook((Widget)newSec, args, num_args); } /************************************************************************ * * GetValuesPosthook * ************************************************************************/ /* ARGSUSED */ static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmProcessLock(); _XmExtObjFree((XtPointer) ext->widget); _XmProcessUnlock(); XtFree( (char *) ext); } /************************************************************************ * * SetValuesPosthook * ************************************************************************/ /* ARGSUSED */ static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; /* * - register parts in cache. * - update cache pointers * - and free req */ /* assign if changed! */ _XmProcessLock(); if (!_XmLabelCacheCompare((XtPointer)LabG_Cache(new_w), (XtPointer)LabG_Cache(current))) { _XmCacheDelete((XtPointer) LabG_Cache(current)); /* delete the old one */ LabG_Cache(new_w) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(new_w), (XtPointer) LabG_Cache(new_w), sizeof(XmLabelGCacheObjPart)); } else LabG_Cache(new_w) = LabG_Cache(current); /* assign if changed! */ if (!_XmCascadeBCacheCompare((XtPointer)CBG_Cache(new_w), (XtPointer)CBG_Cache(current))) { _XmCacheDelete((XtPointer) CBG_Cache(current)); /* delete the old one */ CBG_Cache(new_w) = (XmCascadeButtonGCacheObjPart *) _XmCachePart(CBG_ClassCachePart(new_w), (XtPointer) CBG_Cache(new_w), sizeof(XmCascadeButtonGCacheObjPart)); } else CBG_Cache(new_w) = CBG_Cache(current); _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); _XmProcessUnlock(); XtFree( (char *) ext); return FALSE; } /* * Set Values */ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmCascadeButtonGadget old = (XmCascadeButtonGadget) cw ; XmCascadeButtonGadget requested = (XmCascadeButtonGadget) rw ; XmCascadeButtonGadget new_w = (XmCascadeButtonGadget) nw ; Boolean flag = FALSE; Boolean adjustWidth = FALSE; Boolean adjustHeight = FALSE; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(cw)), XmQTmenuSystem); if ((CBG_Submenu(new_w)) && ((! XmIsRowColumn(CBG_Submenu(new_w))) || (RC_Type(CBG_Submenu(new_w)) != XmMENU_PULLDOWN))) { CBG_Submenu(new_w) = NULL; XmeWarning( (Widget) new_w, WRONGSUBMENU); } if (CBG_MapDelay(new_w) < 0) { CBG_MapDelay(new_w) = CBG_MapDelay(old); XmeWarning( (Widget) new_w, WRONGMAPDELAY); } /* if there is a change to submenu, notify menu system */ if (CBG_Submenu(old) != CBG_Submenu(new_w)) { /* We must pass nw as the parameter to recordPostFromWidget * because old is a copy! The call to recordPostFromWidget() does * a widget ID comparison and we must pass the real widget (nw). */ if (CBG_Submenu(old) && menuSTrait != NULL) menuSTrait -> recordPostFromWidget(CBG_Submenu(old), nw, FALSE); if (CBG_Submenu(new_w) && menuSTrait != NULL) menuSTrait -> recordPostFromWidget(CBG_Submenu(new_w), nw, TRUE); } if (LabG_MenuType(new_w) == XmMENU_BAR) new_w->gadget.traversal_on = TRUE; /* handle the cascade pixmap indicator */ else if (LabG_MenuType(new_w) == XmMENU_PULLDOWN || LabG_MenuType(new_w) == XmMENU_POPUP || LabG_MenuType(new_w) == XmMENU_OPTION) { /* don't let traversal change */ if (LabG_MenuType(new_w) != XmMENU_OPTION) new_w->gadget.traversal_on = TRUE; if (LabG_RecomputeSize(new_w) || (requested->rectangle.width <= 0)) adjustWidth = TRUE; if (LabG_RecomputeSize(new_w) || (requested->rectangle.height <= 0)) adjustHeight = TRUE; /* get new pixmap size */ if (CBG_CascadePixmap (old) != CBG_CascadePixmap (new_w)) { if (CBG_ArmedPixmap(old) != XmUNSPECIFIED_PIXMAP) { _XmProcessLock(); _XmArrowPixmapCacheDelete((XtPointer) CBG_ArmedPixmap(old)); _XmArrowPixmapCacheDelete((XtPointer) CBG_CascadePixmap(old)); _XmProcessUnlock(); } CBG_ArmedPixmap(new_w) = XmUNSPECIFIED_PIXMAP; size_cascade (new_w); } else if ( (LabG_MenuType(new_w) != XmMENU_OPTION) && (((CBG_CascadePixmap(new_w) == XmUNSPECIFIED_PIXMAP) && (!CBG_Submenu(old) && CBG_Submenu(new_w))) || ((CBG_ArmedPixmap(old) != XmUNSPECIFIED_PIXMAP) && (LabG_TextRect_height(old) != LabG_TextRect_height(new_w))))) { _XmProcessLock(); _XmArrowPixmapCacheDelete((XtPointer) CBG_ArmedPixmap(old)); _XmArrowPixmapCacheDelete((XtPointer) CBG_CascadePixmap(old)); CBG_ArmedPixmap(new_w) = XmUNSPECIFIED_PIXMAP; CBG_CascadePixmap(new_w) = XmUNSPECIFIED_PIXMAP; _XmCreateArrowPixmaps((Widget) new_w); _XmProcessUnlock(); size_cascade (new_w); } /* * resize gadget if cascade appeared or disappeared, or if the * cascade pixmap changed size. */ if ((CBG_CascadePixmap (old) != CBG_CascadePixmap (new_w)) || (LabG_LabelType(old) != LabG_LabelType(new_w)) || (CBG_Submenu(old) != CBG_Submenu(new_w))) { setup_cascade (new_w, adjustWidth, adjustHeight); /* if there wasn't a cascade, and still isn't, don't redraw */ if (CBG_Submenu(old) || CBG_Submenu(new_w)) flag = TRUE; } /* make sure that other changes did not scrunch our pixmap */ else if (CBG_Submenu(new_w)) { if ((new_w->gadget.highlight_thickness != old->gadget.highlight_thickness) || (new_w->gadget.shadow_thickness != old->gadget.shadow_thickness) || (LabG_MarginRight (new_w) != LabG_MarginRight (old)) || (LabG_MarginHeight (new_w) != LabG_MarginHeight (old)) || (LabG_MarginTop (new_w) != LabG_MarginTop (old)) || (LabG_MarginBottom (new_w) != LabG_MarginBottom (old))) { setup_cascade (new_w, adjustWidth, adjustHeight); flag = TRUE; } else if ((LabG_MarginWidth(new_w) != LabG_MarginWidth(old)) || (new_w->rectangle.width != old->rectangle.width) || (new_w->rectangle.height != old->rectangle.height)) { position_cascade (new_w); flag = TRUE; } } } /* don't allow this to change */ new_w->gadget.event_mask = XmARM_EVENT | XmACTIVATE_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmHELP_EVENT | XmBDRAG_EVENT ; return (flag); } /************************************************************************ * * GetArmGC * Get the graphics context used for filling in background of the * cascade button when armed. * ************************************************************************/ static void GetArmGC( XmCascadeButtonGadget cb ) { XGCValues values; XtGCMask valueMask; Pixel junk, select_pixel; XmManagerWidget mw = (XmManagerWidget) XtParent(cb); XmGetColors(XtScreen(mw), mw->core.colormap, mw->core.background_pixel, &junk, &junk, &junk, &select_pixel); valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = select_pixel; values.background = select_pixel; values.graphics_exposures = False; CBG_ArmGC(cb) = XtGetGC ((Widget) mw, valueMask, &values); } /************************************************************************ * * GetBackgroundGC * Get the graphics context used for filling in background of the * cascade button when not armed. * ************************************************************************/ static void GetBackgroundGC( XmCascadeButtonGadget cb ) { XGCValues values; XtGCMask valueMask; XFontStruct *fs; XmManagerWidget mw = (XmManagerWidget) XtParent(cb); valueMask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; values.foreground = mw -> core.background_pixel; values.background = mw -> core.background_pixel; values.graphics_exposures = False; if (XmeRenderTableGetDefaultFont(LabG_Font(cb), &fs)) values.font = fs->fid; else valueMask &= ~GCFont; CBG_BackgroundGC(cb) = XtGetGC( (Widget) mw, valueMask, &values); } /* * Initialize */ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmCascadeButtonGadget req = (XmCascadeButtonGadget) rw ; XmCascadeButtonGadget new_w = (XmCascadeButtonGadget) nw ; Boolean adjustWidth = FALSE; Boolean adjustHeight = FALSE; XmMenuSystemTrait menuSTrait; XmRowColumnWidget submenu = (XmRowColumnWidget) CBG_Submenu (new_w); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(nw)), XmQTmenuSystem); if (! (LabG_MenuType(new_w) == XmMENU_BAR || LabG_MenuType(new_w) == XmMENU_PULLDOWN || LabG_MenuType(new_w) == XmMENU_POPUP || LabG_MenuType(new_w) == XmMENU_OPTION)) { XmeWarning( (Widget) new_w, WRONGPARENT); } /* Initialize GCs for armed button select and background only */ GetArmGC (new_w); GetBackgroundGC (new_w); /* if menuProcs is not set up yet, try again */ _XmProcessLock(); if (xmLabelGadgetClassRec.label_class.menuProcs == NULL) xmLabelGadgetClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); _XmProcessUnlock(); CBG_ArmedPixmap(new_w) = XmUNSPECIFIED_PIXMAP; /* * if the user did not specify a margin width, and we are * in a menuBar, set up the default. First, find out what was the * request value (not in request since this is in the cached data) */ if (LabG_MenuType(new_w) == XmMENU_BAR) { Dimension requestedMarginWidth; XtResource request_resources; request_resources.resource_name = XmNmarginWidth; request_resources.resource_class = XmCMarginWidth; request_resources.resource_type = XmRHorizontalDimension; request_resources.resource_size = sizeof (Dimension); request_resources.default_type = XmRImmediate; request_resources.resource_offset = 0; request_resources.default_addr = (XtPointer) XmINVALID_DIMENSION; XtGetSubresources(XtParent(new_w), &requestedMarginWidth, XtName((Widget)new_w), new_w->object.widget_class->core_class.class_name, &request_resources, 1, args, *num_args); if (requestedMarginWidth == XmINVALID_DIMENSION) { LabG_MarginWidth(new_w) = 6; } } /* for other menu types, we may need to initialize the cascade pixmap */ else if ((LabG_MenuType(new_w) != XmMENU_OPTION)) { if (submenu && CBG_CascadePixmap(new_w) == XmUNSPECIFIED_PIXMAP) { _XmProcessLock(); _XmCreateArrowPixmaps((Widget) new_w); _XmProcessUnlock(); } } /* Clear before setting */ CBG_Armed(new_w) = 0; CBG_SetArmed(new_w, FALSE); CBG_SetTraverse (new_w, FALSE); CBG_SetWasPosted (new_w, FALSE); CBG_Timer(new_w) = 0; if ((submenu) && ((! XmIsRowColumn(submenu)) || (RC_Type(submenu) != XmMENU_PULLDOWN))) { submenu = NULL; XmeWarning( (Widget) new_w, WRONGSUBMENU); } if (CBG_MapDelay(new_w) < 0) { CBG_MapDelay(new_w) = MAP_DELAY_DEFAULT; XmeWarning( (Widget) new_w, WRONGMAPDELAY); } /* call submenu's class function to set the link */ if (submenu != NULL && menuSTrait != NULL) menuSTrait -> recordPostFromWidget(CBG_Submenu(new_w), (Widget) new_w, TRUE); if (LabG_MenuType(new_w) == XmMENU_PULLDOWN || LabG_MenuType(new_w) == XmMENU_POPUP || LabG_MenuType(new_w) == XmMENU_OPTION) { if (req->rectangle.width <= 0) adjustWidth = TRUE; if (req->rectangle.height <= 0) adjustHeight = TRUE; /* get pixmap size and set up gadget to allow room for it */ size_cascade (new_w); setup_cascade (new_w, adjustWidth, adjustHeight); } if (LabG_MenuType(new_w) == XmMENU_BAR || LabG_MenuType(new_w) == XmMENU_PULLDOWN || LabG_MenuType(new_w) == XmMENU_POPUP) { new_w->gadget.traversal_on = TRUE; } /* * initialize the input types */ new_w->gadget.event_mask = XmARM_EVENT | XmACTIVATE_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmHELP_EVENT; } /* ************************************************************************* * * Public Routines * ************************************************************************* */ Widget XmCreateCascadeButtonGadget( Widget parent, char *name, ArgList al, Cardinal ac ) { Widget cb; cb = XtCreateWidget(name, xmCascadeButtonGadgetClass, parent, al, ac); return (cb); } Widget XmVaCreateCascadeButtonGadget( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmCascadeButtonGadgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedCascadeButtonGadget( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmCascadeButtonGadgetClass, parent, True, var, count); va_end(var); return w; } /* * Arm or disarm the gadget. This routine does not pop up or down submenus */ void XmCascadeButtonGadgetHighlight( Widget wid, #if NeedWidePrototypes int highlight ) #else Boolean highlight ) #endif /* NeedWidePrototypes */ { XmCascadeButtonGadget cb = (XmCascadeButtonGadget) wid; _XmWidgetToAppContext(wid); _XmAppLock(app); if ((cb) && XmIsCascadeButtonGadget(cb)) { if (highlight) Arm (cb); else Disarm (cb, FALSE); } _XmAppUnlock(app); } /**************************************************** * Functions for manipulating Secondary Resources. *********************************************************/ /* * GetCascadeBGSecResData() * Create a XmSecondaryResourceDataRec for each secondary resource; * Put the pointers to these records in an array of pointers; * Return the pointer to the array of pointers. */ /*ARGSUSED*/ static Cardinal GetCascadeBGClassSecResData( WidgetClass w_class, XmSecondaryResourceData **data_rtn ) { int arrayCount /* = 0 */; XmBaseClassExt bcePtr; String resource_class, resource_name; XtPointer client_data; _XmProcessLock(); bcePtr = &(CascadeBGClassExtensionRec ); client_data = NULL; resource_class = NULL; resource_name = NULL; arrayCount = _XmSecondaryResourceData ( bcePtr, data_rtn, client_data, resource_name, resource_class, GetCascadeBGClassSecResBase) ; _XmProcessUnlock(); return (arrayCount); } /* * GetCascadeBGClassResBase () * retrun the address of the base of resources. */ /*ARGSUSED*/ static XtPointer GetCascadeBGClassSecResBase( Widget widget, XtPointer client_data ) /* unused */ { XtPointer widgetSecdataPtr; XtPointer ret_val; size_t labg_cache_size = sizeof (XmLabelGCacheObjPart); size_t cascadebg_cache_size = sizeof (XmCascadeButtonGCacheObjPart); char *cp; _XmProcessLock(); widgetSecdataPtr = (XtPointer) (XtMalloc ( labg_cache_size + cascadebg_cache_size + 1)); if (widgetSecdataPtr) { cp = (char *) widgetSecdataPtr; memcpy( cp, LabG_Cache(widget), labg_cache_size); cp += labg_cache_size; memcpy( cp, CBG_Cache(widget), cascadebg_cache_size); } /* else Warning: error cannot allocate Memory */ /* widgetSecdataPtr = (XtPointer) ( LabG_Cache(widget)); */ ret_val = widgetSecdataPtr; _XmProcessUnlock(); return (widgetSecdataPtr); } motif-2.3.8/lib/Xm/DrHiDash.c0000644000175000017500000000570612672140200012511 00000000000000/* $XConsortium: DrHiDash.c /main/5 1995/07/15 20:50:42 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "DrawI.h" /****************************_XmDrawHighlight*************************** * * This function modifies the given gc, which therefore needs to be created * using XCreateGC or XtAllocateGC. * ***************************************************************************/ void _XmDrawHighlight(Display *display, Drawable d, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int highlight_thickness, #else Position x, Position y, Dimension width, Dimension height, Dimension highlight_thickness, #endif /* NeedWidePrototypes */ int line_style) { XSegment seg[4]; register Dimension half_hl = highlight_thickness/2 ; register Dimension cor = highlight_thickness % 2 ; XGCValues gcvalues; if (!d || !highlight_thickness || !width || !height) return ; /* the XmList dash case relies on this particular order of X segments */ seg[0].x1 = seg[2].x1 = x ; seg[0].y1 = seg[0].y2 = y + half_hl ; seg[0].x2 = x + width - highlight_thickness ; seg[1].x1 = seg[1].x2 = x + width - half_hl - cor; seg[1].y1 = seg[3].y1 = y ; seg[3].y2 = y + height - half_hl; seg[2].y1 = seg[2].y2 = y + height - half_hl - cor; seg[3].x1 = seg[3].x2 = x + half_hl ; seg[2].x2 = x + width ; seg[1].y2 = y + height ; /* first save the current values we want to change */ XGetGCValues(display, gc, GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, &gcvalues); /* change them and draw the lines */ XSetLineAttributes(display, gc, highlight_thickness, line_style, CapButt, JoinMiter); XDrawSegments (display, d, gc, seg, 4); /* put them back */ XSetLineAttributes(display, gc, gcvalues.line_width, gcvalues.line_style, gcvalues.cap_style, gcvalues.join_style); /** note that the above is a hack, a read-only GC shoudl not be modified, period */ } motif-2.3.8/lib/Xm/XpmCrPFrBuf.c0000644000175000017500000000613712672140200013160 00000000000000/* $XConsortium: XpmCrPFrBuf.c /main/2 1996/09/20 08:03:52 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrPFrBuf.c: * * * * XPM library * * Parse an Xpm buffer and create the pixmap and possibly its mask * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmCreatePixmapFromBuffer(display, d, buffer, pixmap_return, shapemask_return, attributes) Display *display; Drawable d; char *buffer; Pixmap *pixmap_return; Pixmap *shapemask_return; XpmAttributes *attributes; { XImage *ximage, *shapeimage; int ErrorStatus; /* initialize return values */ if (pixmap_return) *pixmap_return = 0; if (shapemask_return) *shapemask_return = 0; /* create the images */ ErrorStatus = XpmCreateImageFromBuffer(display, buffer, (pixmap_return ? &ximage : NULL), (shapemask_return ? &shapeimage : NULL), attributes); if (ErrorStatus < 0) /* fatal error */ return (ErrorStatus); /* create the pixmaps and destroy images */ if (pixmap_return && ximage) { xpmCreatePixmapFromImage(display, d, ximage, pixmap_return); XDestroyImage(ximage); } if (shapemask_return && shapeimage) { xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return); XDestroyImage(shapeimage); } return (ErrorStatus); } motif-2.3.8/lib/Xm/ResConverI.h0000644000175000017500000000337112672140200013103 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ResConverI.h /main/5 1995/07/13 17:48:35 drk $ */ #ifndef _XmResConvertI_h #define _XmResConvertI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for ResConvert.c ********/ extern void _XmRegisterConverters( void ) ; extern char * _XmConvertCSToString( XmString cs) ; extern Boolean _XmCvtXmStringToCT( XrmValue *from, XrmValue *to) ; #ifdef UTF8_SUPPORTED extern Boolean _XmCvtXmStringToUTF8String( XrmValue *from, XrmValue *to) ; #endif /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmResConvertI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconFile.c0000644000175000017500000004701012672140200012545 00000000000000/* $TOG: IconFile.c /main/13 1997/07/18 17:14:37 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* This module references: XmeGetHomeDirName, _XmOSFindPathParts, _XmOSAbsolutePathName (new in Xmos) _XmOSInitPath (new version that uses absolutepath) _XmInImageCache (in ImageCache) XmeGetIconControlInfo (in ColorObj) _XmHash API and it exports: XmeFlushIconFileCache (used by CDE) XmGetIconFileName (used by ImageCache) It is still Dt centric for the PATH variables and the local variables. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #define X_INCLUDE_DIRENT_H #define XOS_USE_XT_LOCKING #ifndef NEED_XOS_R_H #include /* Must precede XmI.h to avoid possible redefinitions of MIN() and MAX(). Xos_r.h includes Xos.h */ #else #include #endif #include "XmosI.h" #include #include #include "XmI.h" #include "HashI.h" #include "ImageCachI.h" #define FIX_1427 /**************** vendor dependant defaults ********/ /* All this stuff (cached dir) should be moved and possibly merged in Xmos.c, where it belongs */ #ifndef X_NOT_STDC_ENV #include #include #endif #include #include #include #ifdef USE_GETWD #include #define MAX_DIR_PATH_LEN MAXPATHLEN #define getcwd(buf, len) ((char *) getwd(buf)) #else #define MAX_DIR_PATH_LEN 1024 #endif #define MAX_USER_NAME_LEN 256 #ifndef S_ISDIR #define S_ISDIR(m) ((m & S_IFMT)==S_IFDIR) #endif /**************** end of vendor dependant defaults ********/ /**************** Icon PATH defines ********/ static XmConst char ABSOLUTE_IPATH[] = "%H%B"; static XmConst char ABSOLUTE_PATH[] = "\ %P\ %S"; /******------------------------------------------********/ typedef union _DtCachedDirStruct *DtCachedDir; typedef struct _DtCommonCachedDirStruct{ int cachedDirType; int dirNameLen; String dirName; }DtCommonCachedDirStruct, *DtCommonCachedDir; typedef struct _DtValidCachedDirStruct{ int cachedDirType; int dirNameLen; String dirName; int numFiles; /* * we allocate both the offsets array and the names themselves in * a heap hanging off the end of this struct */ unsigned short nameOffsets[1]; /* String names */ }DtValidCachedDirStruct, *DtValidCachedDir; #define DtVALID_CACHED_DIR 0 #define DtINVALID_CACHED_DIR 1 #define DtUNCACHED_DIR 2 #define MAX_CACHE_DIR_SIZE (1L << 16) typedef union _DtCachedDirStruct{ DtCommonCachedDirStruct common; DtValidCachedDirStruct valid_dir; }DtCachedDirStruct; typedef struct _DtCachedDirListStruct{ int numDirs; int maxDirs; DtCachedDir *dirs; }DtCachedDirListStruct; /******** Static Function Declarations ********/ static DtCachedDir MakeCachedDirEntry( String dirName) ; static int CheckDirCache( String path); static Boolean TestIconFile( String path) ; static Boolean CompareIconNames (XmHashKey key_1, XmHashKey key_2); static XmHashValue HashIconName (XmHashKey key); /******** End Static Function Declarations ********/ static DtCachedDir MakeCachedDirEntry(String dirName) { DIR * fileDesc = NULL; struct dirent *currDirect; DtCachedDir cachedDir = NULL; int cachedDirType; if ((fileDesc = opendir (dirName)) == NULL) { /* invalid directory */ cachedDirType = DtINVALID_CACHED_DIR; } else { int bufLen, oldBufLen = 0; char stackBuf[MAX_CACHE_DIR_SIZE]; char *p; int numFiles = 0; int nameHeapSize = 0; _Xreaddirparams dirEntryBuf; /* * Original code was caching each struct direct in stackBuf. * Instead, just cache currDirect->d_name, null-terminated. */ cachedDirType = DtVALID_CACHED_DIR; while ((currDirect = _XReaddir(fileDesc, dirEntryBuf)) != NULL) { bufLen = strlen(currDirect->d_name); if (bufLen + oldBufLen + 1 >= MAX_CACHE_DIR_SIZE) { /* * don't cache this one */ cachedDirType = DtUNCACHED_DIR; break; } else { (void) memcpy(&(stackBuf[oldBufLen]), currDirect->d_name, bufLen); oldBufLen += bufLen; stackBuf[oldBufLen++] = '\0'; } } if (oldBufLen == 0) { /* invalid entry */ cachedDirType = DtINVALID_CACHED_DIR; } if( cachedDirType == DtVALID_CACHED_DIR) { DtValidCachedDir validDir; String nameHeap; Cardinal i; /* * Go through stackBuf and count the length of all * the names. Don't count the nulls. */ for (p = stackBuf ; p - stackBuf < oldBufLen; p = p + strlen(p) + 1) { numFiles++; nameHeapSize += strlen(p); } /* * we allocate an extra nameOffset to track the length of * the last name */ validDir = (DtValidCachedDir) XtMalloc((sizeof(DtValidCachedDirStruct)) + (sizeof(validDir->nameOffsets[0]) * numFiles) + (nameHeapSize)); validDir->dirNameLen = strlen(dirName); validDir->dirName = dirName; validDir->numFiles = numFiles; cachedDirType = validDir->cachedDirType = DtVALID_CACHED_DIR; validDir->nameOffsets[0] = 0; nameHeap = (String) &(validDir->nameOffsets[numFiles + 1]); /* Copy the strings from stackBuf to nameHeap. Omit the nulls. */ for (i = 0, p = stackBuf; i < validDir->numFiles; i++, p = p + strlen(p) + 1) { validDir->nameOffsets[i + 1] = validDir->nameOffsets[i] + strlen(p); memcpy(&(nameHeap[validDir->nameOffsets[i]]), p, strlen(p)); } cachedDir = (DtCachedDir)validDir ; } } switch (cachedDirType) { case DtINVALID_CACHED_DIR: case DtUNCACHED_DIR: cachedDir = (DtCachedDir) XtMalloc(sizeof(DtCommonCachedDirStruct)); cachedDir->common.cachedDirType = cachedDirType; cachedDir->common.dirNameLen = strlen(dirName); cachedDir->common.dirName = dirName; break; case DtVALID_CACHED_DIR: break; } if (fileDesc != NULL) closedir(fileDesc); return cachedDir; } static DtCachedDirListStruct cacheList; void XmeFlushIconFileCache(String path) { Cardinal dirNameLen; Cardinal i; _XmProcessLock(); /* * loop thru the dir list. if no path was specified then flush the * entire cache. */ if (path) dirNameLen = strlen(path); else dirNameLen = 0; for (i = 0; i < cacheList.numDirs; i++) { DtValidCachedDir currDir; currDir = (DtValidCachedDir)cacheList.dirs[i]; if (!path || ((currDir->dirNameLen == dirNameLen) && (strncmp(currDir->dirName, path, dirNameLen) == 0))) { XtFree(currDir->dirName); XtFree((char *)currDir); if (path) { /* ripple down the dir array */ for (; i < cacheList.numDirs - 1; i++) cacheList.dirs[i] = cacheList.dirs[i+1]; cacheList.numDirs--; _XmProcessUnlock(); return; } } } if (path && (i == cacheList.numDirs)) { _XmProcessUnlock(); return; } cacheList.numDirs = 0; /* don't free the dirList itself */ _XmProcessUnlock(); } #ifndef XTHREADS static String GdirName; static String GleafName; #endif static int CheckDirCache(String path) { String dirName; String filePtr; String suffixPtr; int numDirs, dirNameLen, fileNameLen; Cardinal i, j; char stackString[MAX_DIR_PATH_LEN]; (void) _XmOSAbsolutePathName(path, &path, stackString); _XmOSFindPathParts(path, &filePtr, &suffixPtr); if (path == filePtr) { dirNameLen = 0; fileNameLen = strlen(path); } else { /* take the slash into account */ dirNameLen = filePtr - path - 1; fileNameLen = strlen(path) - dirNameLen - 1; } /* * set global variable for later use */ #ifndef XTHREADS GleafName = filePtr; #endif if (dirNameLen == 0) { return DtINVALID_CACHED_DIR; } /* * loop thru the dir list. on the last pass create the new cached * dir and process it. */ _XmProcessLock(); numDirs = cacheList.numDirs; for (i = 0; i <= numDirs; i++) { String currName; int currNameLen; String nameHeap; DtValidCachedDir currDir; if (i == cacheList.numDirs) { /* * we didn't get a hit on the directory list so create a new one */ if (cacheList.numDirs == cacheList.maxDirs) { cacheList.maxDirs += 16; cacheList.dirs = (DtCachedDir *) XtRealloc((char *)cacheList.dirs, cacheList.maxDirs * sizeof (DtCachedDir)); } dirName = strncpy(XtMalloc(dirNameLen+1), path, dirNameLen); dirName[dirNameLen] = '\0'; cacheList.dirs[cacheList.numDirs++] = MakeCachedDirEntry(dirName); } currDir = (DtValidCachedDir)cacheList.dirs[i]; /* * set global variable */ #ifndef XTHREADS GdirName = currDir->dirName; #endif if ((currDir->dirNameLen == dirNameLen) && (strncmp(currDir->dirName, path, dirNameLen) == 0)) { switch(currDir->cachedDirType) { case DtINVALID_CACHED_DIR: case DtUNCACHED_DIR: _XmProcessUnlock(); return currDir->cachedDirType; break; case DtVALID_CACHED_DIR: nameHeap = (String) &(currDir->nameOffsets[currDir->numFiles + 1]); for (j = 0; j < currDir->numFiles; j++) { /* * nameOffsets has an extra offset to indicate the * end of the last name (to handle border condition */ currNameLen = (currDir->nameOffsets[j + 1] - currDir->nameOffsets[j]); if (currNameLen == fileNameLen) { currName = &(nameHeap[currDir->nameOffsets[j]]); if (strncmp(currName, filePtr, currNameLen) == 0) { _XmProcessUnlock(); return DtVALID_CACHED_DIR; } } } _XmProcessUnlock(); return DtINVALID_CACHED_DIR; } } } _XmProcessUnlock(); return DtINVALID_CACHED_DIR; } static String find_slash(String str) { int n; if (MB_CUR_MAX == 1) { return strchr(str, '/'); } else { #ifndef NO_MULTIBYTE while ((n = mblen(str, MB_CUR_MAX)) >0) { #else if (!str) return NULL; while ((n = *str ? 1 : 0) > 0) { #endif #ifndef NO_MULTIBYTE if (n == 1 && *str == '/') return str; str += n; #else if (*str == '/') return str; str++; #endif } return NULL; } } static Boolean TestIconFile(String path) { struct stat status; int dirCacheType; if (!path || !*path) return False; /* if there is no directory information in the name, it's a local file, check here or CheckDirCache will fail */ if (!find_slash(path)) { dirCacheType = DtUNCACHED_DIR ; #ifndef XTHREADS GleafName = path ; GdirName = "." ; #endif } else dirCacheType = CheckDirCache(path); switch(dirCacheType) { case DtVALID_CACHED_DIR: return True; case DtINVALID_CACHED_DIR: return False; case DtUNCACHED_DIR: return (access(path, R_OK) == 0 && /* exists and is readable */ stat(path, &status) == 0 && /* get the status */ S_ISDIR(status.st_mode) == 0 /* not a directory */ ); } return False ; } /*********** Hash table stuff */ typedef struct _DtIconNameEntryRec{ String dirName; String leafName; String key_name; }DtIconNameEntryRec, *DtIconNameEntry; /* Compare two icon names from icon entry rec */ static Boolean CompareIconNames (XmHashKey key_1, XmHashKey key_2) { DtIconNameEntry data_1 = (DtIconNameEntry) key_1; DtIconNameEntry data_2 = (DtIconNameEntry) key_2; return ((data_1->key_name == data_2->key_name) || (strcmp(data_1->key_name, data_2->key_name) == 0)); } /* Hash an icon name . */ static XmHashValue HashIconName (XmHashKey key) { DtIconNameEntry data = (DtIconNameEntry) key; unsigned int len = strlen(data->key_name); return (((len << 8) | data->key_name[0]) << 8) | data->key_name[len]; } String XmGetIconFileName( Screen *screen, String imageInstanceName, String imageClassName, String hostPrefix, unsigned int size) { Display *display = DisplayOfScreen(screen); String fileName = NULL; String names[2]; String names_w_size[2]; XmConst char *bPath, *iPath; Cardinal i; Boolean useColor; Boolean useMask; Boolean useIconFileCache; Boolean absolute = 0; XtFilePredicate testFileFunc; String homedir = NULL ; static String iconPath = NULL; static String bmPath = NULL; static XmHashTable iconNameCache = NULL; char stackString[MAX_DIR_PATH_LEN]; #define B_SUB 0 #define P_SUB 1 #define M_SUB 2 #define H_SUB 3 SubstitutionRec iconSubs[] = { {'B', NULL}, /* bitmap name */ {'P', NULL}, /* alternate bitmap name BC */ {'M', NULL}, /* magnitude */ {'H', NULL}, /* host prefix */ }; XtAppContext app; app = XtDisplayToApplicationContext(display); _XmAppLock(app); /* start by asking some screen state */ (void)XmeGetIconControlInfo(screen, &useMask, /* not used here */ &useColor, &useIconFileCache); _XmProcessLock(); /* generate the icon paths once per application: iconPath and bmPath */ if (!iconNameCache) { Boolean junkBoolean; iconNameCache = _XmAllocHashTable(100, CompareIconNames, HashIconName); cacheList.numDirs = cacheList.maxDirs = 0; cacheList.dirs = NULL; homedir = XmeGetHomeDirName(); strcpy(stackString, homedir) ; if (useColor) { iconPath = _XmOSInitPath(NULL, "XMICONSEARCHPATH", &junkBoolean); } else { iconPath = _XmOSInitPath(NULL, "XMICONBMSEARCHPATH", &junkBoolean); } /* 1.2 path as a fallback */ bmPath = _XmOSInitPath(NULL, "XBMLANGPATH", &junkBoolean); } switch (size) { case XmTINY_ICON_SIZE: iconSubs[M_SUB].substitution = ".t"; break; case XmSMALL_ICON_SIZE: iconSubs[M_SUB].substitution = ".s"; break; case XmMEDIUM_ICON_SIZE: iconSubs[M_SUB].substitution = ".m"; break; case XmLARGE_ICON_SIZE: iconSubs[M_SUB].substitution = ".l"; break; case XmUNSPECIFIED_ICON_SIZE: iconSubs[M_SUB].substitution = NULL; break; } iconSubs[H_SUB].substitution = hostPrefix; if (useIconFileCache) testFileFunc = TestIconFile; else testFileFunc = NULL; names[0] = imageInstanceName; names[1] = imageClassName; names_w_size[0] = names_w_size[1] = (String)NULL; /** loop over the two names */ for (i = 0; i < 2; i++) { if (names[i] == NULL) continue; if ((absolute = _XmOSAbsolutePathName(names[i], &names[i], stackString)) != FALSE) { iPath = ABSOLUTE_IPATH; bPath = ABSOLUTE_PATH; } else { iPath = iconPath; bPath = bmPath; } iconSubs[B_SUB].substitution = names[i]; iconSubs[P_SUB].substitution = names[i]; /* need to add size suffix if size is specified */ if (size != XmUNSPECIFIED_ICON_SIZE) { int basenameLen = strlen(names[i]); int sizeLen = strlen(iconSubs[M_SUB].substitution); char * ext_name = XtMalloc(basenameLen + sizeLen + 1); /* XmosP.h takes care of bcopy translation */ memmove(&ext_name[0], names[i], basenameLen); memmove(&ext_name[basenameLen], iconSubs[M_SUB].substitution, sizeLen); ext_name[basenameLen + sizeLen] = '\0'; names_w_size[i] = ext_name; } else names_w_size[i] = NULL; /* * try to see if its already in the image cache */ if (_XmInImageCache(names[i])) fileName = XtNewString(names[i]); /* * optimization to check all expansions in cache */ if (!fileName) { DtIconNameEntry iNameEntry; DtIconNameEntryRec iNameData ; iNameData.key_name = (names_w_size[i])?names_w_size[i]:names[i]; iNameEntry = (DtIconNameEntry) _XmGetHashEntry(iconNameCache, (XmHashKey)&iNameData); if (iNameEntry) { int dirLen, leafLen; dirLen = strlen(iNameEntry->dirName); leafLen = strlen(iNameEntry->leafName); fileName = XtMalloc(dirLen + leafLen + 2); memmove(&fileName[0], iNameEntry->dirName, dirLen); #ifdef FIX_1427 if (dirLen == 0) { memmove(&fileName[dirLen], iNameEntry->leafName, leafLen); fileName[dirLen + leafLen] = '\0'; } else { #endif fileName[dirLen] = '/'; memmove(&fileName[dirLen + 1], iNameEntry->leafName, leafLen); fileName[dirLen + leafLen + 1] = '\0'; #ifdef FIX_1427 } #endif } } if (fileName) { /* * CDExc20823 (memory leak): free names_w_size[i] * if it is not NULL. * NOTE: This code could be reorganized to do * _XmInImageCache() at the top of this loop * so we could avoid unnecessary malloc's for * names_w_size, but I wanted to minimize the * code impact of this defect for now. */ for (i = 0; i < 2; i++) { if (names_w_size[i] != (String)NULL) XtFree(names_w_size[i]); } _XmProcessUnlock(); _XmAppUnlock(app); return fileName; } /******************************* * first try XPM and then XBM ******************************/ fileName = XtResolvePathname(display, "icons", NULL, NULL, iPath, iconSubs, XtNumber(iconSubs), (XtFilePredicate) testFileFunc); if (fileName == NULL) { fileName = XtResolvePathname(display, "bitmaps", NULL, NULL, bPath, iconSubs, XtNumber(iconSubs), (XtFilePredicate) testFileFunc); } if (fileName) break; } _XmProcessUnlock(); if (fileName && !absolute) { /* register it in name cache */ DtIconNameEntry iNameEntry; String name_used = (names_w_size[i])? names_w_size[i] : names[i] ; /** alloc a icon cache entry **/ iNameEntry = (DtIconNameEntry) XtMalloc(sizeof(DtIconNameEntryRec)); iNameEntry->key_name = XtNewString(name_used); #ifndef XTHREADS if (useIconFileCache) { iNameEntry->dirName = XtNewString(GdirName); iNameEntry->leafName = XtNewString(GleafName); } else #endif { String dirName; String filePtr; String suffixPtr; int dirNameLen; _XmOSFindPathParts(fileName, &filePtr, &suffixPtr); if (fileName == filePtr) dirNameLen = 0; else { /* take the slash into account */ dirNameLen = filePtr - fileName - 1; } dirName = (String)XtMalloc(dirNameLen + 1); strncpy(dirName, fileName, dirNameLen); dirName[dirNameLen] = '\0'; iNameEntry->dirName = dirName; iNameEntry->leafName = XtNewString(filePtr); } _XmProcessLock(); _XmAddHashEntry(iconNameCache, (XmHashKey)iNameEntry, (XtPointer)iNameEntry); _XmProcessUnlock(); } /* * CDExc20823 (memory leak): free names_w_size[i] if not NULL. */ for (i = 0; i < 2; i++) { if (names_w_size[i] != (String)NULL) XtFree(names_w_size[i]); } _XmAppUnlock(app); return fileName; } motif-2.3.8/lib/Xm/Text.h0000644000175000017500000002142413145162623012020 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmText_h #define _XmText_h #include #include #ifdef __cplusplus extern "C" { #endif /* -------------- * * type defines * * -------------- */ typedef struct _XmTextSourceRec *XmTextSource; typedef struct _XmTextClassRec *XmTextWidgetClass; typedef struct _XmTextRec *XmTextWidget; /* -------------- * * extern class * * -------------- */ externalref WidgetClass xmTextWidgetClass; /* --------------------------------------- * * text widget fast subclassing fallback * * --------------------------------------- */ #ifndef XmIsText #define XmIsText(w) XtIsSubclass(w, xmTextWidgetClass) #endif /* XmIsText */ /* ----------------------------------- * * text widget public functions * * ----------------------------------- */ /******** Public Function Declarations ********/ extern void XmTextSetHighlight( Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode); extern Widget XmCreateScrolledText( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern Widget XmCreateText( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern Widget XmVaCreateText( Widget parent, char *name, ...); extern Widget XmVaCreateManagedText( Widget parent, char *name, ...); extern int XmTextGetSubstring( Widget widget, XmTextPosition start, int num_chars, int buf_size, char *buffer); extern int XmTextGetSubstringWcs( Widget widget, XmTextPosition start, int num_chars, int buf_size, wchar_t *buffer); extern char * XmTextGetString( Widget widget); extern wchar_t * XmTextGetStringWcs( Widget widget); extern XmTextPosition XmTextGetLastPosition( Widget widget); extern void XmTextSetString( Widget widget, char *value); extern void XmTextSetStringWcs( Widget widget, wchar_t *wc_value); extern void XmTextReplace( Widget widget, XmTextPosition frompos, XmTextPosition topos, char *value); extern void XmTextReplaceWcs( Widget widget, XmTextPosition frompos, XmTextPosition topos, wchar_t *value); extern void XmTextInsert( Widget widget, XmTextPosition position, char *value); extern void XmTextInsertWcs( Widget widget, XmTextPosition position, wchar_t *wc_value); extern void XmTextSetAddMode( Widget widget, #if NeedWidePrototypes int state); #else Boolean state); #endif /* NeedWidePrototypes */ extern Boolean XmTextGetAddMode( Widget widget); extern Boolean XmTextGetEditable( Widget widget); extern void XmTextSetEditable( Widget widget, #if NeedWidePrototypes int editable); #else Boolean editable); #endif /* NeedWidePrototypes */ extern int XmTextGetMaxLength( Widget widget); extern void XmTextSetMaxLength( Widget widget, int max_length); extern XmTextPosition XmTextGetTopCharacter( Widget widget); extern void XmTextSetTopCharacter( Widget widget, XmTextPosition top_character); extern XmTextPosition XmTextGetCursorPosition( Widget widget); extern XmTextPosition XmTextGetInsertionPosition( Widget widget); extern void XmTextSetInsertionPosition( Widget widget, XmTextPosition position); extern void XmTextSetCursorPosition( Widget widget, XmTextPosition position); extern Boolean XmTextRemove( Widget widget); extern Boolean XmTextCopy( Widget widget, Time copy_time); extern Boolean XmTextCopyLink( Widget widget, Time copy_time); extern Boolean XmTextCut( Widget widget, Time cut_time); extern Boolean XmTextPaste( Widget widget); extern Boolean XmTextPasteLink( Widget widget); extern char * XmTextGetSelection( Widget widget); extern wchar_t * XmTextGetSelectionWcs( Widget widget); extern void XmTextSetSelection( Widget widget, XmTextPosition first, XmTextPosition last, Time set_time); extern void XmTextClearSelection( Widget widget, Time clear_time); extern Boolean XmTextGetSelectionPosition( Widget widget, XmTextPosition *left, XmTextPosition *right); extern XmTextPosition XmTextXYToPos( Widget widget, #if NeedWidePrototypes int x, int y); #else Position x, Position y); #endif /* NeedWidePrototypes */ extern Boolean XmTextPosToXY( Widget widget, XmTextPosition position, Position *x, Position *y); extern XmTextSource XmTextGetSource( Widget widget); extern void XmTextSetSource( Widget widget, XmTextSource source, XmTextPosition top_character, XmTextPosition cursor_position); extern void XmTextShowPosition( Widget widget, XmTextPosition position); extern void XmTextScroll( Widget widget, int n); extern int XmTextGetBaseline( Widget widget); extern int XmTextGetCenterline( Widget widget); extern void XmTextDisableRedisplay( Widget widget); extern void XmTextEnableRedisplay( Widget widget); extern Boolean XmTextFindString( Widget w, XmTextPosition start, char *search_string, XmTextDirection direction, XmTextPosition *position); extern Boolean XmTextFindStringWcs( Widget w, XmTextPosition start, wchar_t *wc_string, XmTextDirection direction, XmTextPosition *position); /******** End Public Function Declarations ********/ /* tmp: go to XmStrDefs */ #define XmNtotalLines "totalLines" #define XmCTotalLines "TotalLines" #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmText_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/GadgetUtil.c0000644000175000017500000001712413145162623013122 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: GadgetUtil.c /main/16 1996/10/23 15:00:52 cde-osf $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "GadgetUtiI.h" #include "XmI.h" /******** Static Function Declarations ********/ /******** End Static Function Declarations ********/ /************************************************************************ * * _XmInputForGadget * This routine is a front-end for XmObjectAtPoint which returns a * gadget or NULL if XmbjectAtPoint is not sensitive. * ************************************************************************/ XmGadget _XmInputForGadget( Widget wid, int x, int y ) { Widget widget; widget = XmObjectAtPoint (wid, x, y); if (!widget || !XtIsSensitive (widget)) return ((XmGadget) NULL); return ((XmGadget) widget); } /************************************************************************ * * XmConfigureObject * Wrapper around Xt equivalent + DropSite update. * ************************************************************************/ void XmeConfigureObject( Widget wid, #if NeedWidePrototypes int x, int y, int width, int height, int border_width ) #else Position x, Position y, Dimension width, Dimension height, Dimension border_width ) #endif /* NeedWidePrototypes */ { _XmWidgetToAppContext(wid); XmDropSiteStartUpdate(wid); _XmAppLock(app); if (!width && !height) { XtWidgetGeometry desired, preferred ; desired.request_mode = 0; XtQueryGeometry(wid, &desired, &preferred); width = preferred.width; height = preferred.height; } if (!width) width++; if (!height) height++; XtConfigureWidget(wid, x, y, width, height, border_width); XmDropSiteEndUpdate(wid); _XmAppUnlock(app); } /************************************************************************ * * XmeRedisplayGadgets * Redisplay any gadgets contained within the manager mw which * are intersected by the region. * ************************************************************************/ void XmeRedisplayGadgets( Widget w, register XEvent *event, Region region ) { CompositeWidget mw = (CompositeWidget) w ; register int i; register Widget child; XtExposeProc expose; _XmWidgetToAppContext(w); _XmAppLock(app); for (i = 0; i < mw->composite.num_children; i++) { child = mw->composite.children[i]; if (XmIsGadget(child) && XtIsManaged(child)) { if (region == NULL) { if (child->core.x < event->xexpose.x + event->xexpose.width && child->core.x + child->core.width > event->xexpose.x && child->core.y < event->xexpose.y + event->xexpose.height && child->core.y + child->core.height > event->xexpose.y) { _XmProcessLock(); expose = child->core.widget_class->core_class.expose; _XmProcessUnlock(); if (expose) (*(expose)) (child, event, region); } } else { if (XRectInRegion (region, child->core.x, child->core.y, child->core.width, child->core.height)) { _XmProcessLock(); expose = child->core.widget_class->core_class.expose; _XmProcessUnlock(); if (expose) (*(expose)) (child, event, region); } } } } _XmAppUnlock(app); } /************************************************************************ * * _XmDispatchGadgetInput * Call the gadgets class function and send the desired data to it. * ************************************************************************/ void _XmDispatchGadgetInput( Widget wid, XEvent *event, Mask mask ) { XmGadget g = (XmGadget) wid ; if ((g->gadget.event_mask & mask) && XtIsSensitive ((Widget)g) && XtIsManaged ((Widget)g)) { if (event != NULL) { XEvent synth_event; #define CopyEvent(source, dest, type) \ source.type = dest->type switch(mask) { case XmENTER_EVENT: CopyEvent(synth_event, event, xcrossing); if (event->type != EnterNotify) { synth_event.type = EnterNotify; } break; case XmLEAVE_EVENT: CopyEvent(synth_event, event, xcrossing); if (event->type != LeaveNotify) { synth_event.type = LeaveNotify; } break; case XmFOCUS_IN_EVENT: CopyEvent(synth_event, event, xfocus); if (event->type != FocusIn) { synth_event.type = FocusIn; } break; case XmFOCUS_OUT_EVENT: CopyEvent(synth_event, event, xfocus); if (event->type != FocusIn) { synth_event.type = FocusOut; } break; case XmMOTION_EVENT: CopyEvent(synth_event, event, xmotion); if (event->type != MotionNotify) { event->type = MotionNotify; } break; case XmARM_EVENT: CopyEvent(synth_event, event, xkey); if (event->type != ButtonPress && event->type != KeyPress) { synth_event.type = ButtonPress; } break; case XmACTIVATE_EVENT: CopyEvent(synth_event, event, xkey); if (event->type != ButtonRelease && event->type != KeyPress) { synth_event.type = ButtonRelease; } break; case XmKEY_EVENT: CopyEvent(synth_event, event, xkey); if (event->type != KeyPress && event->type != ButtonPress) { synth_event.type = KeyPress; } break; case XmHELP_EVENT: CopyEvent(synth_event, event, xkey); if (event->type != KeyPress) { synth_event.type = KeyPress; } break; default: memcpy((char*)&synth_event, (char*)event, (size_t)sizeof(synth_event)); break; } (*(((XmGadgetClass) (g->object.widget_class))-> gadget_class.input_dispatch)) ((Widget) g, (XEvent *) &synth_event, mask) ; } else { (*(((XmGadgetClass) (g->object.widget_class))-> gadget_class.input_dispatch)) ((Widget) g, (XEvent *) event, mask) ; } } } motif-2.3.8/lib/Xm/VirtKeysP.h0000644000175000017500000000313113145162623012767 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmVirtKeysP_h #define _XmVirtKeysP_h #include #include #ifdef __cplusplus extern "C" { #endif #define XmKEYCODE_TAG_SIZE 32 typedef struct _XmDefaultBindingStringRec { String vendorName; String defaults; } XmDefaultBindingStringRec, *XmDefaultBindingString; typedef struct _XmVirtualKeysymRec { String name; KeySym keysym; } XmVirtualKeysymRec, *XmVirtualKeysym; /* For converting a Virtual keysym to a real keysym. */ typedef struct _XmVKeyBindingRec { KeySym keysym; Modifiers modifiers; KeySym virtkey; } XmVKeyBindingRec, *XmVKeyBinding; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVirtKeysP_h */ motif-2.3.8/lib/Xm/ContainerT.h0000644000175000017500000000421712672140200013132 00000000000000/* $XConsortium: ContainerT.h /main/6 1996/02/09 15:05:04 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmContainerT_H #define _XmContainerT_H #ifdef __cplusplus extern "C" { #endif #include externalref XrmQuark XmQTcontainer; /* Trait structures and typedefs, place typedefs first */ /* this one can be expanded in the future */ typedef struct _XmContainerDataRec { Mask valueMask ; Cardinal * detail_order ; Cardinal detail_order_count ; XmTabList detail_tablist ; Dimension first_column_width ; XtEnum selection_mode ; /* XmNORMAL_MODE, XmADD_MODE */ Pixel select_color ; } XmContainerDataRec, *XmContainerData; #define ContAllValid (0xFFFF) #define ContDetailOrder (1L<<0) #define ContDetailTabList (1L<<1) #define ContFirstColumnWidth (1L<<2) #define ContSelectionMode (1L<<3) #define ContSelectColor (1L<<4) typedef void (*XmContainerGetValuesProc)(Widget w, XmContainerData contData); /* Version 0: initial release. */ typedef struct _XmContainerTraitRec { int version; /* 0 */ XmContainerGetValuesProc getValues; } XmContainerTraitRec, *XmContainerTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmContainerT_H */ motif-2.3.8/lib/Xm/DropDownP.h0000644000175000017500000001533012672140200012736 00000000000000#ifndef _XmDropDown_h_ #define _XmDropDown_h_ #if defined(VMS) || defined(__VMS) #include #endif #include #include #ifdef __cplusplus extern "C" { #endif #define FIX_1446 #define XmDropDown_UP ((unsigned char) 0) #define XmDropDown_UNPOSTED XmDropDown_UP #define XmDropDown_DOWN ((unsigned char) 1) #define XmDropDown_POSTED XmDropDown_DOWN #define XmDropDown_IN_PROGRESS ((unsigned char) 2) #define XmDropDown_BEGIN_POPUP_FROM_TEXT ((unsigned char) 3) #ifdef FIX_1446 #define XmDropDown_AFTER_UNPOST ((unsigned char) 4) #endif #define XmDropDown_h_space(w) (((XmDropDownWidget)(w))->combo.h_space) #define XmDropDown_v_space(w) (((XmDropDownWidget)(w))->combo.v_space) #define XmDropDown_popup_offset(w) \ (((XmDropDownWidget)(w))->combo.popup_offset) #define XmDropDown_verify(w) (((XmDropDownWidget)(w))->combo.verify) #define XmDropDown_editable(w) (((XmDropDownWidget)(w))->combo.editable) #define XmDropDown_show_label(w) \ (((XmDropDownWidget)(w))->combo.show_label) #define XmDropDown_customized_combo_box(w) \ (((XmDropDownWidget)(w))->combo.customized_combo_box) #define XmDropDown_use_text_field(w) \ (((XmDropDownWidget)(w))->combo.use_text_field) #define XmDropDown_popup_shell(w) (((XmDropDownWidget)(w))->combo.popup_shell) #define XmDropDown_popup_cursor(w) \ (((XmDropDownWidget)(w))->combo.popup_cursor) #define XmDropDown_translations(w) \ (((XmDropDownWidget)(w))->combo.translations) #define XmDropDown_verify_text_callback(w) \ (((XmDropDownWidget)(w))->combo.verify_text_callback) #define XmDropDown_verify_text_failed_callback(w) \ (((XmDropDownWidget)(w))->combo.verify_text_failed_callback) #define XmDropDown_update_text_callback(w) \ (((XmDropDownWidget)(w))->combo.update_text_callback) #define XmDropDown_update_shell_callback(w) \ (((XmDropDownWidget)(w))->combo.update_shell_callback) #define XmDropDown_visible_items(w) \ (((XmDropDownWidget)(w))->combo.visible_items) #define XmDropDown_new_visual_style(w) \ (((XmDropDownWidget)(w))->combo.new_visual_style) #define XmDropDown_old_text(w) (((XmDropDownWidget)(w))->combo.old_text) #define XmDropDown_focus_owner(w) (((XmDropDownWidget)(w))->combo.focus_owner) #define XmDropDown_focus_state(w) (((XmDropDownWidget)(w))->combo.focus_state) #define XmDropDown_list_state(w) (((XmDropDownWidget)(w))->combo.list_state) #define XmDropDown_text_x(w) (((XmDropDownWidget)(w))->combo.text_x) #define XmDropDown_list(w) (((XmDropDownWidget)(w))->combo.list) #define XmDropDown_label(w) (((XmDropDownWidget)(w))->combo.label) #define XmDropDown_text(w) (((XmDropDownWidget)(w))->combo.text) #define XmDropDown_arrow(w) (((XmDropDownWidget)(w))->combo.arrow) #define XmDropDown_autoTraversal(w) (((XmDropDownWidget)(w))->combo.autoTraversal) #define XmDropDown_activateOnFill(w) \ (((XmDropDownWidget)(w))->combo.activateOnFill) #define XmDropDown_doActivate(w) (((XmDropDownWidget)(w))->combo.doActivate) #define XmDropDown_inValueChanged(w) \ (((XmDropDownWidget)(w))->combo.inValueChanged) /* Should return True to ignore invalid entry warning. Combination Box * does not currently use this. Presumes do it in subclasses */ typedef Boolean (*XmDropDownTextProc)(Widget w, char *text); typedef Boolean (*XmDropDownTextListMapProc)( Widget w, /* combo box */ Widget text, /* text */ Widget list /* list */ ); /* Version number for the first Revision */ #define XmDropDownExtensionVersion 2 typedef struct { /* standard extension fields */ XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; /* extra fields */ XmDropDownTextProc verify; XmDropDownTextProc update; XmDropDownTextListMapProc setTextFromList; XmDropDownTextListMapProc setListFromText; } XmDropDownClassPartExtension; typedef struct { XtPointer extension; /* Just in case we need it later. */ } XmDropDownClassPart; typedef struct _XmDropDownClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmDropDownClassPart combo_class; } XmDropDownClassRec; typedef struct { /* resources */ Dimension h_space; /* The amount of space to leave between */ Dimension v_space; /* widgets and the box edges. */ int popup_offset; /* The offset of the popup offset from the left edge of the text widget. */ Boolean verify; /* Verify the contents of the Text widget on leave or CR when this is True. */ Boolean editable; /* Allow the text field to be edited? */ Boolean show_label; /* Whether or not to show the label. */ Boolean customized_combo_box; /* Is this a customized combo box. */ Boolean use_text_field; /* Use XmTextField of XmText for textual input */ Widget popup_shell; /* The id of the popup shell. */ Cursor popup_cursor; /* Cursor for the Popup Window. */ XtTranslations translations; /* The translation table for all children. */ /* * Callbacks to verify, and update the text and shell widgets. */ XtCallbackList verify_text_callback; XtCallbackList verify_text_failed_callback; XtCallbackList update_text_callback; XtCallbackList update_shell_callback; /* private state */ String old_text; /* The old text value. */ Window focus_owner; /* Previous owner and state of the focus. */ int focus_state; unsigned char list_state; /* XmDropDown_UP, XmDropDown_DOWN or XmDropDown_IN_PROGRESS. */ Position text_x; /* X location of the text widget. */ Widget list; /* List contained in the popup shell. */ Widget label; /* The three children of the combo box. */ Widget text; Widget arrow; int visible_items; /* only to set/get XmNvisibleItemCount, which is ** a sop for non-customized combobox users */ Boolean new_visual_style; Boolean autoTraversal; /* traverse next on return */ int activateOnFill; /* activate when we fill this many chars */ Boolean doActivate; /* do activate on next value changed */ Boolean inValueChanged; /* recursion prevention */ Widget vsb; Widget hsb; Boolean scrolling; } XmDropDownPart; typedef struct _XmDropDownRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmDropDownPart combo; } XmDropDownRec; extern XmDropDownClassRec xmDropDownClassRec; #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmDropDownP_h_ */ motif-2.3.8/lib/Xm/TextStrSoI.h0000644000175000017500000000743013145162623013125 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmTextStrSoI_h #define _XmTextStrSoI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern char * _XmStringSourceGetString(XmTextWidget tw, XmTextPosition from, XmTextPosition to, #if NeedWidePrototypes int want_wchar); #else Boolean want_wchar); #endif /* NeedWidePrototypes */ extern Boolean _XmTextFindStringBackwards(Widget w, XmTextPosition start, char *search_string, XmTextPosition *position); extern Boolean _XmTextFindStringForwards(Widget w, XmTextPosition start, char *search_string, XmTextPosition *position); extern void _XmStringSourceSetGappedBuffer(XmSourceData data, XmTextPosition position); extern Boolean _XmTextModifyVerify(XmTextWidget initiator, XEvent *event, XmTextPosition *start, XmTextPosition *end, XmTextPosition *cursorPos, XmTextBlock block, XmTextBlock newblock, Boolean *freeBlock); extern XmTextSource _XmStringSourceCreate(char *value, #if NeedWidePrototypes int is_wchar); #else Boolean is_wchar); #endif /* NeedWidePrototypes */ extern void _XmStringSourceDestroy(XmTextSource source); extern char * _XmStringSourceGetValue(XmTextSource source, #if NeedWidePrototypes int want_wchar); #else Boolean want_wchar); #endif /* NeedWidePrototypes */ extern void _XmStringSourceSetValue(XmTextWidget widget, char *value); extern Boolean _XmStringSourceHasSelection(XmTextSource source); extern Boolean _XmStringSourceGetEditable(XmTextSource source); extern void _XmStringSourceSetEditable(XmTextSource source, #if NeedWidePrototypes int editable); #else Boolean editable); #endif /* NeedWidePrototypes */ extern int _XmStringSourceGetMaxLength(XmTextSource source); extern void _XmStringSourceSetMaxLength(XmTextSource source, int max); extern int _XmTextBytesToCharacters(char *characters, char *bytes, int num_chars, #if NeedWidePrototypes int add_null_terminator, #else Boolean add_null_terminator, #endif /* NeedWidePrototypes */ int max_char_size); extern int _XmTextCharactersToBytes(char *bytes, char *characters, int num_chars, int max_char_size); extern void _XmTextValueChanged(XmTextWidget initiator, XEvent *event); extern Boolean *_XmStringSourceGetPending(XmTextWidget widget); extern void _XmStringSourceSetPending(XmTextWidget widget, Boolean *pending); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextStrSoI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ActivatableT.h0000644000175000017500000000315412672140200013426 00000000000000/* $XConsortium: ActivatableT.h /main/5 1995/07/15 20:48:08 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmActivatableT_H #define _XmActivatableT_H #ifdef __cplusplus extern "C" { #endif #include externalref XrmQuark XmQTactivatable; /* Trait structures and typedefs, place typedefs first */ typedef void (*XmActivatableCallBackProc)(Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset); /* Version 0: initial release. */ typedef struct _XmActivatableTraitRec { int version; /* 0 */ XmActivatableCallBackProc changeCB; } XmActivatableTraitRec, *XmActivatableTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmActivatableT_H */ motif-2.3.8/lib/Xm/TraitP.h0000644000175000017500000000427212672140200012270 00000000000000/* $XConsortium: TraitP.h /main/5 1995/07/15 20:56:18 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmTraitP_H #define _XmTraitP_H 1 #include #ifdef __cplusplus extern "C" { #endif /* Macros */ #define XmeTraitRemove(w, t) XmeTraitSet((XtPointer) w, t, NULL) /******** Private Function Declarations ********/ /* * XmeTraitGet(object, trait) returns a pointer to the trait_record * from looking up the trait on this object. If the trait * is not found then NULL is returned. This can therefore be used * in the following cliche' * * if (trait_rec = XmeTraitGet(XtClass(w), XmQTactivate)) { * trait_rec -> activate(); * trait_rec -> disarm(); * } */ extern XtPointer XmeTraitGet(XtPointer, XrmQuark); /* * Boolean XmeTraitSet(object, traitname, traitrecord) * * Installs the trait on the object. Boolean will indicate * success of the installation. * * Install will use the direct pointer to traitrecord given. The * implementation is therefore not allowed to use automatic * storage for traitrecord, but can use malloc or static initialization * */ extern Boolean XmeTraitSet(XtPointer, XrmQuark, XtPointer); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTraitP_H */ motif-2.3.8/lib/Xm/Color.c0000644000175000017500000010435013066310437012145 00000000000000/* $TOG: Color.c /main/13 1998/09/23 19:36:49 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include /* for bzero */ #include "ColorI.h" #include "ImageCachI.h" #include "MessagesI.h" #include "ScreenI.h" #include "XmI.h" #ifdef FIX_1381 #include #endif #define FIX_1500 /* Warning and Error messages */ #define MESSAGE0 _XmMMsgVisual_0000 #define MESSAGE1 _XmMMsgVisual_0001 #define MESSAGE2 _XmMMsgVisual_0002 /******** Static Function Declarations ********/ static void GetDefaultThresholdsForScreen( Screen *screen) ; static XmColorData * GetDefaultColors( Screen *screen, Colormap color_map) ; static Pixel GetBlackPixel( Screen *screen, Colormap colormap, XColor blackcolor) ; static Pixel GetWhitePixel( Screen *screen, Colormap colormap, XColor whitecolor) ; static void SetMonochromeColors( XmColorData *colors) ; static int Brightness( XColor *color) ; static void CalculateColorsForLightBackground( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color) ; static void CalculateColorsForDarkBackground( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color) ; static void CalculateColorsForMediumBackground( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color) ; static void CalculateColorsRGB( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color) ; static Pixel AccessColorData( XmColorData *cd, unsigned char which) ; static XmColorData * GetColors( Screen *screen, Colormap color_map, Pixel background) ; #ifdef FIX_1381 static unsigned int FromColorToBlackAndWhite( char *col) ; #endif /******** End Static Function Declarations ********/ /* * GLOBAL VARIABLES * * These variables define the color cache. */ static int Set_Count=0, Set_Size=0; static XmColorData *Color_Set=NULL; /* Thresholds for brightness above LITE threshold, LITE color model is used below DARK threshold, DARK color model is be used use STD color model in between */ static int XmCOLOR_LITE_THRESHOLD; static int XmCOLOR_DARK_THRESHOLD; static int XmFOREGROUND_THRESHOLD; static Boolean XmTHRESHOLDS_INITD = FALSE; /* DEPRECATED : use XmScreen resource now */ static XmColorProc ColorRGBCalcProc = CalculateColorsRGB; static void GetDefaultThresholdsForScreen( Screen *screen ) { XmScreen xmScreen; int default_light_threshold_spec; int default_dark_threshold_spec; int default_foreground_threshold_spec; _XmProcessLock(); XmTHRESHOLDS_INITD = True; _XmProcessUnlock(); xmScreen = (XmScreen) XmGetXmScreen(screen); /* Get resources from the XmScreen */ default_light_threshold_spec = xmScreen->screen.lightThreshold; default_dark_threshold_spec = xmScreen->screen.darkThreshold; default_foreground_threshold_spec = xmScreen->screen.foregroundThreshold; if ((default_light_threshold_spec <= 0) || (default_light_threshold_spec > 100)) default_light_threshold_spec = XmDEFAULT_LIGHT_THRESHOLD; if ((default_dark_threshold_spec <= 0) || (default_dark_threshold_spec > 100)) default_dark_threshold_spec = XmDEFAULT_DARK_THRESHOLD; if ((default_foreground_threshold_spec <= 0) || (default_foreground_threshold_spec > 100)) default_foreground_threshold_spec = XmDEFAULT_FOREGROUND_THRESHOLD; _XmProcessLock(); XmCOLOR_LITE_THRESHOLD = default_light_threshold_spec * XmCOLOR_PERCENTILE; XmCOLOR_DARK_THRESHOLD = default_dark_threshold_spec * XmCOLOR_PERCENTILE; XmFOREGROUND_THRESHOLD = default_foreground_threshold_spec * XmCOLOR_PERCENTILE; _XmProcessUnlock(); } static XColor *GetDefaultBackgroundColor(Screen *screen, Colormap color_map) { XrmName names[2]; XrmClass classes[2]; XrmRepresentation rep; XrmValue db_value; static XColor color; names[0] = XrmPermStringToQuark(XmNbackground); names[1] = NULLQUARK; classes[0] = XrmPermStringToQuark(XmCBackground); classes[1] = NULLQUARK; if (XrmQGetResource(XtScreenDatabase(screen), names, classes, &rep, &db_value)) { if (rep == XrmPermStringToQuark(XmRString)) { if (!XParseColor(DisplayOfScreen(screen), color_map, db_value.addr, &color)) return NULL; } else if (rep == XrmPermStringToQuark(XmRPixel)) { color.pixel = *(Pixel *) db_value.addr; XQueryColor(DisplayOfScreen(screen), color_map, &color); } } else { if (!XParseColor(DisplayOfScreen(screen), color_map, XmDEFAULT_BACKGROUND, &color)) return NULL; } return &color; } static XmColorData * GetDefaultColors( Screen *screen, Colormap color_map ) { static XmColorData * default_set = NULL; static int default_set_count = 0; static int default_set_size = 0; register int i; XColor *color_def; static Pixel background; XrmValue fromVal; XrmValue toVal; XrmValue args[2]; Cardinal num_args; String default_string = XtDefaultBackground; XmColorData *result; _XmProcessLock(); /* Look through a set of screen / background pairs to see */ /* if the default is already in the table. */ for (i = 0; i < default_set_count; i++) { if ((default_set[i].screen == screen) && (default_set[i].color_map == color_map)) { result = default_set + i; _XmProcessUnlock(); return result; } } /* See if more space is needed in the array */ if (default_set == NULL) { default_set_size = 10; default_set = (XmColorData *) XtRealloc((char *) default_set, (sizeof(XmColorData) * default_set_size)); } else if (default_set_count == default_set_size) { default_set_size += 10; default_set = (XmColorData *) XtRealloc((char *) default_set, sizeof(XmColorData) * default_set_size); } /* Find the background based on the depth of the screen */ if (DefaultDepthOfScreen(screen) == 1) { /* * Fix for 4603 - Convert the string XtDefaultBackground into a Pixel * value using the XToolkit converter. This converter * will set this value to WhitePixelOfScreen if reverse * video is not on, and to BlackPixelOfScreen if reverse * video is on. */ args[0].addr = (XPointer) &screen; args[0].size = sizeof(Screen*); args[1].addr = (XPointer) &color_map; args[1].size = sizeof(Colormap); num_args = 2; fromVal.addr = default_string; fromVal.size = strlen(default_string); toVal.addr = (XPointer) &background; toVal.size = sizeof(Pixel); if(!XtCallConverter(DisplayOfScreen(screen),XtCvtStringToPixel, args, num_args, &fromVal, &toVal, NULL)) background = WhitePixelOfScreen(screen); } else { /* Parse out a color for the default background */ if ((color_def = GetDefaultBackgroundColor(screen, color_map)) != NULL) { XmAllocColorProc aproc = _XmGetColorAllocationProc(screen); if (aproc == NULL) aproc = DEFAULT_ALLOCCOLOR_PROC; if ((*aproc)(DisplayOfScreen(screen), color_map, color_def)) { background = color_def->pixel; } else { XtWarning(MESSAGE1); background = WhitePixelOfScreen(screen); } } else { XtWarning(MESSAGE2); background = WhitePixelOfScreen(screen); } } /* * Get the color data generated and save it in the next open * slot in the default set array. default_set points to a subset * of the data pointed to by color_set (defined in GetColors). */ default_set[default_set_count] = *GetColors(screen, color_map, background); default_set_count++; result = default_set + (default_set_count - 1); _XmProcessUnlock(); return result; } Boolean _XmSearchColorCache( unsigned int which, XmColorData *values, XmColorData **ret ) { register int i; /* * Look through a set of screen, color_map, background triplets * to see if these colors have already been generated. */ _XmProcessLock(); for (i = 0; i < Set_Count; i++) { if ( (!(which & XmLOOK_AT_SCREEN) || ((Color_Set + i)->screen == values->screen)) && (!(which & XmLOOK_AT_CMAP) || ((Color_Set + i)->color_map == values->color_map)) && (!(which & XmLOOK_AT_BACKGROUND) || (((Color_Set + i)->allocated & XmBACKGROUND) && ((Color_Set + i)->background.pixel == values->background.pixel))) && (!(which & XmLOOK_AT_FOREGROUND) || (((Color_Set + i)->allocated & XmFOREGROUND) && ((Color_Set + i)->foreground.pixel == values->foreground.pixel))) && (!(which & XmLOOK_AT_TOP_SHADOW) || (((Color_Set + i)->allocated & XmTOP_SHADOW) && ((Color_Set + i)->top_shadow.pixel == values->top_shadow.pixel))) && (!(which & XmLOOK_AT_BOTTOM_SHADOW) || (((Color_Set + i)->allocated & XmBOTTOM_SHADOW) && ((Color_Set+ i)->bottom_shadow.pixel == values->bottom_shadow.pixel))) && (!(which & XmLOOK_AT_SELECT) || (((Color_Set + i)->allocated & XmSELECT) && ((Color_Set + i)->select.pixel == values->select.pixel)))) { *ret = (Color_Set + i); _XmProcessUnlock(); return (TRUE); } } *ret = NULL; _XmProcessUnlock(); return (FALSE); } XmColorData * _XmAddToColorCache( XmColorData *new_rec ) { XmColorData *result; /* See if more space is needed */ _XmProcessLock(); if (Set_Count == Set_Size) { Set_Size += 10; Color_Set = (XmColorData *)XtRealloc((char *) Color_Set, sizeof(XmColorData) * Set_Size); } *(Color_Set + Set_Count) = *new_rec; Set_Count++; result = Color_Set + (Set_Count - 1); _XmProcessUnlock(); return result; } static Pixel GetBlackPixel( Screen *screen, Colormap colormap, XColor blackcolor ) { Pixel p; XmAllocColorProc aproc = _XmGetColorAllocationProc(screen); if (aproc == NULL) aproc = DEFAULT_ALLOCCOLOR_PROC; blackcolor.red = 0; blackcolor.green = 0; blackcolor.blue = 0; if (colormap == DefaultColormapOfScreen(screen)) p = blackcolor.pixel = BlackPixelOfScreen(screen); else if ((*aproc)(screen->display, colormap, &blackcolor)) p = blackcolor.pixel; else p = blackcolor.pixel = BlackPixelOfScreen(screen); /* fallback pixel */ return (p); } static Pixel GetWhitePixel( Screen *screen, Colormap colormap, XColor whitecolor ) { Pixel p; XmAllocColorProc aproc = _XmGetColorAllocationProc(screen); if (aproc == NULL) aproc = DEFAULT_ALLOCCOLOR_PROC; whitecolor.red = XmMAX_SHORT; whitecolor.green = XmMAX_SHORT; whitecolor.blue = XmMAX_SHORT; if (colormap == DefaultColormapOfScreen(screen)) p = whitecolor.pixel = WhitePixelOfScreen(screen); else if ((*aproc)(screen->display, colormap, &whitecolor)) p = whitecolor.pixel; else p = whitecolor.pixel = WhitePixelOfScreen(screen); /* fallback pixel */ return (p); } static Pixel AccessColorData( XmColorData *cd, unsigned char which ) { Pixel p; XmAllocColorProc aproc = _XmGetColorAllocationProc(cd->screen); if (aproc == NULL) aproc = DEFAULT_ALLOCCOLOR_PROC; switch(which) { case XmBACKGROUND: if (!(cd->allocated & which) && ((*aproc)(cd->screen->display, cd->color_map, &(cd->background)) == 0)) { if (Brightness(&(cd->background)) < XmFOREGROUND_THRESHOLD ) cd->background.pixel = GetBlackPixel(cd->screen, cd->color_map, cd->background); else cd->background.pixel = GetWhitePixel(cd->screen, cd->color_map, cd->background); XQueryColor(cd->screen->display, cd->color_map, &(cd->background)); } p = cd->background.pixel; cd->allocated |= which; break; case XmFOREGROUND: if (!(cd->allocated & which) && ((*aproc)(cd->screen->display, cd->color_map, &(cd->foreground)) == 0 )) { if (Brightness(&(cd->background)) < XmFOREGROUND_THRESHOLD ) cd->foreground.pixel = GetWhitePixel(cd->screen, cd->color_map, cd->foreground); else cd->foreground.pixel = GetBlackPixel(cd->screen, cd->color_map, cd->foreground); XQueryColor(cd->screen->display, cd->color_map, &(cd->foreground)); } p = cd->foreground.pixel; cd->allocated |= which; break; case XmTOP_SHADOW: if (!(cd->allocated & which) && ((*aproc)(cd->screen->display, cd->color_map, &(cd->top_shadow)) == 0)) { if (Brightness(&(cd->background)) > XmCOLOR_LITE_THRESHOLD) cd->top_shadow.pixel = GetBlackPixel(cd->screen, cd->color_map, cd->top_shadow); else cd->top_shadow.pixel = GetWhitePixel(cd->screen, cd->color_map, cd->top_shadow); XQueryColor(cd->screen->display, cd->color_map, &(cd->top_shadow)); } p = cd->top_shadow.pixel; cd->allocated |= which; break; case XmBOTTOM_SHADOW: if (!(cd->allocated & which) && ((*aproc)(cd->screen->display, cd->color_map, &(cd->bottom_shadow)) == 0)) { if (Brightness(&(cd->background)) < XmCOLOR_DARK_THRESHOLD) cd->bottom_shadow.pixel = GetWhitePixel(cd->screen, cd->color_map, cd->bottom_shadow); else cd->bottom_shadow.pixel = GetBlackPixel(cd->screen, cd->color_map, cd->bottom_shadow); XQueryColor(cd->screen->display, cd->color_map, &(cd->bottom_shadow)); } p = cd->bottom_shadow.pixel; cd->allocated |= which; break; case XmSELECT: if (!(cd->allocated & which) && ((*aproc)(cd->screen->display, cd->color_map, &(cd->select)) == 0)) { if (Brightness(&(cd->background)) < XmFOREGROUND_THRESHOLD) cd->select.pixel = GetWhitePixel(cd->screen, cd->color_map, cd->select); else cd->select.pixel = GetBlackPixel(cd->screen, cd->color_map, cd->select); XQueryColor(cd->screen->display, cd->color_map, &(cd->select)); } p = cd->select.pixel; cd->allocated |= which; break; default: XtWarning(MESSAGE0); p = GetBlackPixel(cd->screen, cd->color_map, cd->background); break; } return(p); } static void SetMonochromeColors( XmColorData *colors ) { Screen *screen = colors->screen; Pixel background = colors->background.pixel; if (background == BlackPixelOfScreen(screen)) { colors->foreground.pixel = WhitePixelOfScreen (screen); colors->foreground.red = colors->foreground.green = colors->foreground.blue = XmMAX_SHORT; colors->bottom_shadow.pixel = WhitePixelOfScreen(screen); colors->bottom_shadow.red = colors->bottom_shadow.green = colors->bottom_shadow.blue = XmMAX_SHORT; colors->select.pixel = WhitePixelOfScreen(screen); colors->select.red = colors->select.green = colors->select.blue = XmMAX_SHORT; colors->top_shadow.pixel = BlackPixelOfScreen(screen); colors->top_shadow.red = colors->top_shadow.green = colors->top_shadow.blue = 0; } else if (background == WhitePixelOfScreen(screen)) { colors->foreground.pixel = BlackPixelOfScreen(screen); colors->foreground.red = colors->foreground.green = colors->foreground.blue = 0; colors->top_shadow.pixel = WhitePixelOfScreen(screen); colors->top_shadow.red = colors->top_shadow.green = colors->top_shadow.blue = XmMAX_SHORT; colors->bottom_shadow.pixel = BlackPixelOfScreen(screen); colors->bottom_shadow.red = colors->bottom_shadow.green = colors->bottom_shadow.blue = 0; colors->select.pixel = BlackPixelOfScreen(screen); colors->select.red = colors->select.green = colors->select.blue = 0; } colors->allocated |= (XmFOREGROUND | XmTOP_SHADOW | XmBOTTOM_SHADOW | XmSELECT); } static int Brightness( XColor *color ) { int brightness; int intensity; int light; int luminosity, maxprimary, minprimary; int red = color->red; int green = color->green; int blue = color->blue; intensity = (red + green + blue) / 3; /* * The casting nonsense below is to try to control the point at * the truncation occurs. */ luminosity = (int) ((XmRED_LUMINOSITY * (float) red) + (XmGREEN_LUMINOSITY * (float) green) + (XmBLUE_LUMINOSITY * (float) blue)); maxprimary = ( (red > green) ? ( (red > blue) ? red : blue ) : ( (green > blue) ? green : blue ) ); minprimary = ( (red < green) ? ( (red < blue) ? red : blue ) : ( (green < blue) ? green : blue ) ); light = (minprimary + maxprimary) / 2; brightness = ( (intensity * XmINTENSITY_FACTOR) + (light * XmLIGHT_FACTOR) + (luminosity * XmLUMINOSITY_FACTOR) ) / 100; return(brightness); } static void CalculateColorsForLightBackground( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color ) { int brightness = Brightness(bg_color); int color_value; if (fg_color) { /* * Fix for 4602 - Compare the brightness with the foreground threshold. * If its larger, make the foreground color black. * Otherwise, make it white. */ if (brightness > XmFOREGROUND_THRESHOLD) { fg_color->red = 0; fg_color->green = 0; fg_color->blue = 0; } else { fg_color->red = XmMAX_SHORT; fg_color->green = XmMAX_SHORT; fg_color->blue = XmMAX_SHORT; } /* * End Fix 4602 */ } if (sel_color) { color_value = bg_color->red; color_value -= (color_value * XmCOLOR_LITE_SEL_FACTOR) / 100; sel_color->red = color_value; color_value = bg_color->green; color_value -= (color_value * XmCOLOR_LITE_SEL_FACTOR) / 100; sel_color->green = color_value; color_value = bg_color->blue; color_value -= (color_value * XmCOLOR_LITE_SEL_FACTOR) / 100; sel_color->blue = color_value; } if (bs_color) { color_value = bg_color->red; color_value -= (color_value * XmCOLOR_LITE_BS_FACTOR) / 100; bs_color->red = color_value; color_value = bg_color->green; color_value -= (color_value * XmCOLOR_LITE_BS_FACTOR) / 100; bs_color->green = color_value; color_value = bg_color->blue; color_value -= (color_value * XmCOLOR_LITE_BS_FACTOR) / 100; bs_color->blue = color_value; } if (ts_color) { color_value = bg_color->red; color_value -= (color_value * XmCOLOR_LITE_TS_FACTOR) / 100; ts_color->red = color_value; color_value = bg_color->green; color_value -= (color_value * XmCOLOR_LITE_TS_FACTOR) / 100; ts_color->green = color_value; color_value = bg_color->blue; color_value -= (color_value * XmCOLOR_LITE_TS_FACTOR) / 100; ts_color->blue = color_value; } } static void CalculateColorsForDarkBackground( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color ) { int brightness = Brightness(bg_color); int color_value; if (fg_color) { /* * Fix for 4602 - Compare the brightness with the foreground threshold. * If its larger, make the foreground color black. * Otherwise, make it white. */ if (brightness > XmFOREGROUND_THRESHOLD) { fg_color->red = 0; fg_color->green = 0; fg_color->blue = 0; } else { fg_color->red = XmMAX_SHORT; fg_color->green = XmMAX_SHORT; fg_color->blue = XmMAX_SHORT; } /* * End Fix 4602 */ } if (sel_color) { color_value = bg_color->red; color_value += XmCOLOR_DARK_SEL_FACTOR * (XmMAX_SHORT - color_value) / 100; sel_color->red = color_value; color_value = bg_color->green; color_value += XmCOLOR_DARK_SEL_FACTOR * (XmMAX_SHORT - color_value) / 100; sel_color->green = color_value; color_value = bg_color->blue; color_value += XmCOLOR_DARK_SEL_FACTOR * (XmMAX_SHORT - color_value) / 100; sel_color->blue = color_value; } if (bs_color) { color_value = bg_color->red; color_value += XmCOLOR_DARK_BS_FACTOR * (XmMAX_SHORT - color_value) / 100; bs_color->red = color_value; color_value = bg_color->green; color_value += XmCOLOR_DARK_BS_FACTOR * (XmMAX_SHORT - color_value) / 100; bs_color->green = color_value; color_value = bg_color->blue; color_value += XmCOLOR_DARK_BS_FACTOR * (XmMAX_SHORT - color_value) / 100; bs_color->blue = color_value; } if (ts_color) { color_value = bg_color->red; color_value += XmCOLOR_DARK_TS_FACTOR * (XmMAX_SHORT - color_value) / 100; ts_color->red = color_value; color_value = bg_color->green; color_value += XmCOLOR_DARK_TS_FACTOR * (XmMAX_SHORT - color_value) / 100; ts_color->green = color_value; color_value = bg_color->blue; color_value += XmCOLOR_DARK_TS_FACTOR * (XmMAX_SHORT - color_value) / 100; ts_color->blue = color_value; } } static void CalculateColorsForMediumBackground( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color ) { int brightness = Brightness(bg_color); int color_value, f; if (brightness > XmFOREGROUND_THRESHOLD) { fg_color->red = 0; fg_color->green = 0; fg_color->blue = 0; } else { fg_color->red = XmMAX_SHORT; fg_color->green = XmMAX_SHORT; fg_color->blue = XmMAX_SHORT; } if (sel_color) { f = XmCOLOR_LO_SEL_FACTOR + (brightness * ( XmCOLOR_HI_SEL_FACTOR - XmCOLOR_LO_SEL_FACTOR ) / XmMAX_SHORT ); color_value = bg_color->red; color_value -= (color_value * f) / 100; sel_color->red = color_value; color_value = bg_color->green; color_value -= (color_value * f) / 100; sel_color->green = color_value; color_value = bg_color->blue; color_value -= (color_value * f) / 100; sel_color->blue = color_value; } if (bs_color) { f = XmCOLOR_LO_BS_FACTOR + (brightness * ( XmCOLOR_HI_BS_FACTOR - XmCOLOR_LO_BS_FACTOR ) / XmMAX_SHORT); color_value = bg_color->red; color_value -= (color_value * f) / 100; bs_color->red = color_value; color_value = bg_color->green; color_value -= (color_value * f) / 100; bs_color->green = color_value; color_value = bg_color->blue; color_value -= (color_value * f) / 100; bs_color->blue = color_value; } if (ts_color) { f = XmCOLOR_LO_TS_FACTOR + (brightness * ( XmCOLOR_HI_TS_FACTOR - XmCOLOR_LO_TS_FACTOR ) / XmMAX_SHORT); color_value = bg_color->red; color_value += f * ( XmMAX_SHORT - color_value ) / 100; ts_color->red = color_value; color_value = bg_color->green; color_value += f * ( XmMAX_SHORT - color_value ) / 100; ts_color->green = color_value; color_value = bg_color->blue; color_value += f * ( XmMAX_SHORT - color_value ) / 100; ts_color->blue = color_value; } } static void CalculateColorsRGB( XColor *bg_color, XColor *fg_color, XColor *sel_color, XColor *ts_color, XColor *bs_color ) { int brightness = Brightness(bg_color); /* make sure DefaultThresholds are inited */ if (!XmTHRESHOLDS_INITD) GetDefaultThresholdsForScreen( DefaultScreenOfDisplay(_XmGetDefaultDisplay())); if (brightness < XmCOLOR_DARK_THRESHOLD) CalculateColorsForDarkBackground(bg_color, fg_color, sel_color, ts_color, bs_color); else if (brightness > XmCOLOR_LITE_THRESHOLD) CalculateColorsForLightBackground(bg_color, fg_color, sel_color, ts_color, bs_color); else CalculateColorsForMediumBackground(bg_color, fg_color, sel_color, ts_color, bs_color); } /********************************************************************* * * GetColors * *********************************************************************/ static XmColorData * GetColors( Screen *screen, Colormap color_map, Pixel background ) { Display * display = DisplayOfScreen (screen); XmColorData *old_colors; XmColorData new_colors; new_colors.screen = screen; new_colors.color_map = color_map; new_colors.background.pixel = background; if (_XmSearchColorCache( (XmLOOK_AT_SCREEN | XmLOOK_AT_CMAP | XmLOOK_AT_BACKGROUND), &new_colors, &old_colors)) { /* * initialize the thresholds if the current color scheme * already matched what is in the cache and the thresholds * haven't already been initialized. */ if (!XmTHRESHOLDS_INITD) GetDefaultThresholdsForScreen(screen); return(old_colors); } XQueryColor (display, color_map, &(new_colors.background)); new_colors.allocated = XmBACKGROUND; /* * Just in case somebody looks at these before they're ready, * initialize them to a value that is always valid (for most * implementations of X). */ new_colors.foreground.pixel = 0; new_colors.top_shadow.pixel = 0; new_colors.top_shadow.pixel = 0; new_colors.select.pixel = 0; /* Generate the foreground, top_shadow, and bottom_shadow based */ /* on the background */ if (DefaultDepthOfScreen(screen) == 1) SetMonochromeColors(&new_colors); else { XmScreenColorProc screen_color_proc ; GetDefaultThresholdsForScreen(screen); /* look for the new per-Screen resource */ screen_color_proc = _XmGetColorCalculationProc(screen); if (!screen_color_proc) { /* no new color proc set, use the old one */ (*ColorRGBCalcProc)(&(new_colors.background), &(new_colors.foreground), &(new_colors.select), &(new_colors.top_shadow), &(new_colors.bottom_shadow)); } else { /* call the application */ (*screen_color_proc)(screen, &(new_colors.background), &(new_colors.foreground), &(new_colors.select), &(new_colors.top_shadow), &(new_colors.bottom_shadow)); } } return (_XmAddToColorCache(&new_colors)); } /********************************************************************* Global API ********************************************************************/ /* DEPRECATED in favor of the Screen resource XmNcolorcalculationProc that takes a Screen in argument (while colorProc doesn't) */ XmColorProc XmSetColorCalculation( XmColorProc proc ) { XmColorProc a = ColorRGBCalcProc; _XmProcessLock(); if (proc != NULL) ColorRGBCalcProc = proc; else ColorRGBCalcProc = CalculateColorsRGB; _XmProcessUnlock(); return(a); } /* DEPRECATED */ XmColorProc XmGetColorCalculation( void ) { return(ColorRGBCalcProc); } void XmGetColors( Screen *screen, Colormap color_map, Pixel background, Pixel *foreground_ret, Pixel *top_shadow_ret, Pixel *bottom_shadow_ret, Pixel *select_ret ) { XmColorData *cd; _XmDisplayToAppContext(DisplayOfScreen(screen)); _XmAppLock(app); _XmProcessLock(); cd = GetColors(screen, color_map, background); if (foreground_ret) *foreground_ret = AccessColorData(cd, XmFOREGROUND); if (top_shadow_ret) *top_shadow_ret = AccessColorData(cd, XmTOP_SHADOW); if (bottom_shadow_ret) *bottom_shadow_ret = AccessColorData(cd, XmBOTTOM_SHADOW); if (select_ret) *select_ret = AccessColorData(cd, XmSELECT); _XmProcessUnlock(); _XmAppUnlock(app); } /********************************************************************* * * XmeGetDefaultPixel * Given the widget and the requested type of default, generate the * default and store it in the value structure to be returned. * *********************************************************************/ /*ARGSUSED*/ void XmeGetDefaultPixel( Widget widget, int type, int offset, XrmValue *value ) { Screen *screen; Colormap color_map; static Pixel new_value; XmColorData *color_data; Pixel background = 0 ; Widget parent; _XmWidgetToAppContext(widget); _XmAppLock(app); value->size = sizeof(new_value); value->addr = (char *) &new_value; if (!XtIsWidget(widget)) { parent = widget->core.parent; color_map = parent->core.colormap; /* * Skip this for the background case. The background * field hasn't been inited yet but for the background * case it isn't needed. */ if (type != XmBACKGROUND) { if ((XmIsLabelGadget(widget)) || (XmIsArrowButtonGadget(widget)) || (XmIsSeparatorGadget(widget))) XtVaGetValues(widget, XmNbackground, &background, NULL); else { /* This line should not be executed but this case does need to be handled. */ background = parent->core.background_pixel; } } } else { color_map = widget->core.colormap; if(type != XmBACKGROUND) background = widget->core.background_pixel; } screen = XtScreen(widget); if (type == XmBACKGROUND) { color_data = GetDefaultColors(screen, color_map); } else { color_data = GetColors(screen, color_map, background); } new_value = AccessColorData(color_data, type); _XmAppUnlock(app); } /************************************************************************ * * Dynamic defaulting color functions * ************************************************************************/ void _XmForegroundColorDefault( Widget widget, int offset, XrmValue *value ) { XmeGetDefaultPixel (widget, XmFOREGROUND, offset, value); } void _XmHighlightColorDefault( Widget widget, int offset, XrmValue *value ) { XmeGetDefaultPixel (widget, XmFOREGROUND, offset, value); } void _XmBackgroundColorDefault( Widget widget, int offset, XrmValue *value ) { XmeGetDefaultPixel (widget, XmBACKGROUND, offset, value); } void _XmTopShadowColorDefault( Widget widget, int offset, XrmValue *value ) { XmeGetDefaultPixel (widget, XmTOP_SHADOW, offset, value); } void _XmBottomShadowColorDefault( Widget widget, int offset, XrmValue *value ) { XmeGetDefaultPixel (widget, XmBOTTOM_SHADOW, offset, value); } void _XmSelectColorDefault( Widget widget, int offset, XrmValue *value ) { XmeGetDefaultPixel (widget, XmSELECT, offset, value); } #ifdef FIX_1381 static unsigned int FromColorToBlackAndWhite(char *col) { unsigned long r, g, b, bw; char k[5]; k[4] = '\0'; memcpy(k, col, 4); r = strtoul(k, NULL, 16); memcpy(k, col + 4, 4); g = strtoul(k, NULL, 16); b = strtoul(col + 8, NULL, 16); bw = (0.3 * r + 0.59 * g + 0.11 * b); return (bw); } Pixmap _XmConvertToBW(Widget w, Pixmap pm) { XpmImage im; int i = 0; unsigned int bw = 0, bw2 = 0; char *col = NULL, *col2 = NULL; Pixmap bw_pixmap = XmUNSPECIFIED_PIXMAP; #ifdef FIX_1500 char *data_before = NULL, *data_after = NULL; #endif if (pm == XmUNSPECIFIED_PIXMAP) return bw_pixmap; #ifdef FIX_1500 XpmCreateBufferFromPixmap(XtDisplay(w), &data_before, pm, 0, NULL); #endif XpmCreateXpmImageFromPixmap(XtDisplay(w), pm, 0, &im, NULL); if (im.ncolors > 0) { if (im.ncolors <= 2) { if (im.ncolors == 1) { col = strdup(im.colorTable[0].c_color); if (col[0] == '#') { bw = (FromColorToBlackAndWhite(col + 1) * 0.65); sprintf(im.colorTable[0].c_color, "#%04x%04x%04x", bw, bw, bw); } if (col) free(col); } else { col = im.colorTable[0].c_color; col2 = im.colorTable[1].c_color; if ((col[0] == '#') && (col2[0] == '#')) { bw = FromColorToBlackAndWhite(col + 1); bw2 = FromColorToBlackAndWhite(col2 + 1); if (bw >= bw2) { bw2 = bw2 + ((bw - bw2) * 0.65); sprintf(im.colorTable[1].c_color, "#%04x%04x%04x", bw2, bw2, bw2); } else { bw = bw + ((bw2 - bw) * 0.65); sprintf (im.colorTable[0].c_color, "#%04x%04x%04x", bw, bw, bw); } } } } else { char e[5]; for (i = 0; i < im.ncolors; i++) { col = im.colorTable[i].c_color; if (col[0] == '#') { bw = FromColorToBlackAndWhite(col + 1); /* could be sprintf(im.colorTable[i].c_color, "#%04x%04x%04x", bw, bw, bw); Four lower lines is sprintf optimized version */ sprintf(e, "%04x", bw); memcpy(col + 1, e, 4); memcpy(col + 5, e, 4); memcpy(col + 9, e, 4); } } } } XpmCreatePixmapFromXpmImage(XtDisplay(w), pm, &im, &bw_pixmap, 0, NULL); #ifdef FIX_1500 if (bw_pixmap) XpmCreateBufferFromPixmap(XtDisplay(w), &data_after, bw_pixmap, 0, NULL); if (data_before && data_after && !strcmp(data_before, data_after)) bw_pixmap = 0; if (data_before) XpmFree(data_before); if (data_after) XpmFree(data_after); #endif XpmFreeXpmImage(&im); #ifdef FIX_1505 return (bw_pixmap) ? bw_pixmap : pm; #else return bw_pixmap; #endif } #endif motif-2.3.8/lib/Xm/Outline.h0000644000175000017500000000442612672140200012505 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmOutline_h #define _XmOutline_h #if defined(VMS) || defined(__VMS) #include #endif #include #include /************************************************************ * INCLUDE FILES *************************************************************/ /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #if defined(__cplusplus) extern "C" { #endif typedef struct _XmOutlineClassRec *XmOutlineWidgetClass; typedef struct _XmOutlineRec *XmOutlineWidget; /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL FUNCTION DECLARATIONS *************************************************************/ /* Function Name: XmCreateOutline * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateOutline( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); extern WidgetClass xmOutlineWidgetClass; #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _Outline_h */ motif-2.3.8/lib/Xm/MenuState.c0000644000175000017500000000766312672140200012774 00000000000000/* $XConsortium: MenuState.c /main/5 1995/07/15 20:52:55 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "MenuStateI.h" /******** Static Function Declarations ********/ static void ScreenDestroyCallback ( Widget w, XtPointer client_data, XtPointer call_data ); /******** End Static Function Declarations ********/ Widget _XmGetRC_PopupPosted ( Widget wid) { if (XmIsRowColumn(wid)) return (RC_PopupPosted(wid)); else return NULL; } /* * The following two functions are used by menu and menu-item widgets to keep * track of whether we're in drag (button down) or traversal mode. */ Boolean _XmGetInDragMode ( Widget widget) { return((_XmGetMenuState(widget))->MU_InDragMode); } void _XmSetInDragMode( Widget widget, #if NeedWidePrototypes int mode ) #else Boolean mode ) #endif { (_XmGetMenuState(widget))->MU_InDragMode = mode; } /************************************************************************ * * _XmGetMenuState(wid) * ************************************************************************/ XmMenuState _XmGetMenuState( Widget wid) { XmScreen scrn = (XmScreen) XmGetXmScreen(XtScreen(wid)); XmMenuState menu_state = (XmMenuState)NULL; if ((XmScreen)NULL != scrn) { menu_state = (XmMenuState)((XmScreenInfo *)(scrn->screen.screenInfo))->menu_state; if ((XmMenuState)NULL == menu_state) { menu_state = (XmMenuState)XtMalloc(sizeof(XmMenuStateRec)); ((XmScreenInfo *)(scrn->screen.screenInfo))->menu_state = (XtPointer)menu_state; XtAddCallback((Widget)scrn, XtNdestroyCallback, ScreenDestroyCallback, (XtPointer) NULL); menu_state->RC_LastSelectToplevel = NULL; menu_state->RC_ButtonEventStatus.time = (unsigned) -1; menu_state->RC_ButtonEventStatus.verified = FALSE; menu_state->RC_ButtonEventStatus.waiting_to_be_managed = TRUE; /*menu_state->RC_ButtonEventStatus.event = (XButtonEvent)NULL;*/ menu_state->RC_ReplayInfo.time = 0; menu_state->RC_ReplayInfo.toplevel_menu = NULL; menu_state->RC_activeItem = NULL; menu_state->RC_allowAcceleratedInsensitiveUnmanagedMenuItems = False; menu_state->RC_menuFocus.oldFocus = (Window)NULL; menu_state->RC_menuFocus.oldRevert = 0; menu_state->RC_menuFocus.oldWidget = NULL; menu_state->MS_LastManagedMenuTime = (Time)0L; menu_state->MU_InDragMode = False; menu_state->MU_CurrentMenuChild = NULL; menu_state->MU_InPMMode = False; } } return menu_state; } /*ARGSUSED*/ static void ScreenDestroyCallback ( Widget w, XtPointer client_data, XtPointer call_data ) /* unused */ { XmScreen scrn = (XmScreen) XmGetXmScreen(XtScreen(w)); if ((XmScreen)NULL != scrn) { XmMenuState menu_state = (XmMenuState)((XmScreenInfo *) (scrn->screen.screenInfo))->menu_state; if ((XmMenuState)NULL != menu_state) { XtFree((char*)menu_state); } } } motif-2.3.8/lib/Xm/Xpmcreate.c0000644000175000017500000020056112672140200013007 00000000000000/* $XConsortium: Xpmcreate.c /main/8 1996/09/20 08:15:02 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * create.c: * * * * XPM library * * Create an X image and possibly its related shape mask * * from the given XpmImage. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* * The code related to FOR_MSW has been added by * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" #include LFUNC(xpmVisualType, int, (Visual *visual)); LFUNC(AllocColor, int, (Display *display, Colormap colormap, char *colorname, XColor *xcolor, void *closure)); LFUNC(FreeColors, int, (Display *display, Colormap colormap, Pixel *pixels, int n, void *closure)); #ifndef FOR_MSW LFUNC(SetCloseColor, int, (Display *display, Colormap colormap, Visual *visual, XColor *col, Pixel *image_pixel, Pixel *mask_pixel, Pixel *alloc_pixels, unsigned int *nalloc_pixels, XpmAttributes *attributes, XColor *cols, int ncols, XpmAllocColorFunc allocColor, void *closure)); #else /* let the window system take care of close colors */ #endif LFUNC(SetColor, int, (Display *display, Colormap colormap, Visual *visual, char *colorname, unsigned int color_index, Pixel *image_pixel, Pixel *mask_pixel, unsigned int *mask_pixel_index, Pixel *alloc_pixels, unsigned int *nalloc_pixels, Pixel *used_pixels, unsigned int *nused_pixels, XpmAttributes *attributes, XColor *cols, int ncols, XpmAllocColorFunc allocColor, void *closure)); LFUNC(CreateXImage, int, (Display *display, Visual *visual, unsigned int depth, int format, unsigned int width, unsigned int height, XImage **image_return)); LFUNC(CreateColors, int, (Display *display, XpmAttributes *attributes, XpmColor *colors, unsigned int ncolors, Pixel *image_pixels, Pixel *mask_pixels, unsigned int *mask_pixel_index, Pixel *alloc_pixels, unsigned int *nalloc_pixels, Pixel *used_pixels, unsigned int *nused_pixels)); #ifndef FOR_MSW LFUNC(ParseAndPutPixels, int, (xpmData *data, unsigned int width, unsigned int height, unsigned int ncolors, unsigned int cpp, XpmColor *colorTable, xpmHashTable *hashtable, XImage *image, Pixel *image_pixels, XImage *mask, Pixel *mask_pixels)); #else /* FOR_MSW */ LFUNC(ParseAndPutPixels, int, (Display *dc, xpmData *data, unsigned int width, unsigned int height, unsigned int ncolors, unsigned int cpp, XpmColor *colorTable, xpmHashTable *hashtable, XImage *image, Pixel *image_pixels, XImage *mask, Pixel *mask_pixels)); #endif #ifndef FOR_MSW /* XImage pixel routines */ LFUNC(PutImagePixels, void, (XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels)); LFUNC(PutImagePixels32, void, (XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels)); LFUNC(PutImagePixels16, void, (XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels)); LFUNC(PutImagePixels8, void, (XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels)); LFUNC(PutImagePixels1, void, (XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels)); LFUNC(PutPixel1, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel32, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel32MSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel32LSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel16MSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel16LSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel8, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel1MSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel1LSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); #else /* ndef FOR_MSW */ /* FOR_MSW pixel routine */ LFUNC(MSWPutImagePixels, void, (Display *dc, XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels)); #endif /* ndef FOR_MSW */ #ifdef NEED_STRCASECMP FUNC(xpmstrcasecmp, int, (char *s1, char *s2)); /* * in case strcasecmp is not provided by the system here is one * which does the trick */ int xpmstrcasecmp(s1, s2) register char *s1, *s2; { register int c1, c2; while (*s1 && *s2) { c1 = tolower(*s1); c2 = tolower(*s2); if (c1 != c2) return (c1 - c2); s1++; s2++; } return (int) (*s1 - *s2); } #endif /* * return the default color key related to the given visual */ static int xpmVisualType(visual) Visual *visual; { #ifndef FOR_MSW switch (visual->class) { case StaticGray: case GrayScale: switch (visual->map_entries) { case 2: return (XPM_MONO); case 4: return (XPM_GRAY4); default: return (XPM_GRAY); } default: return (XPM_COLOR); } #else /* there should be a similar switch for MSW */ return (XPM_COLOR); #endif } typedef struct { int cols_index; long closeness; } CloseColor; static int closeness_cmp(a, b) Const void *a, *b; { CloseColor *x = (CloseColor *) a, *y = (CloseColor *) b; /* cast to int as qsort requires */ return (int) (x->closeness - y->closeness); } /* default AllocColor function: * call XParseColor if colorname is given, return negative value if failure * call XAllocColor and return 0 if failure, positive otherwise */ static int AllocColor(display, colormap, colorname, xcolor, closure) Display *display; Colormap colormap; char *colorname; XColor *xcolor; void *closure; /* not used */ { int status; if (colorname) if (!XParseColor(display, colormap, colorname, xcolor)) return -1; status = XAllocColor(display, colormap, xcolor); return status != 0 ? 1 : 0; } #ifndef FOR_MSW /* * set a close color in case the exact one can't be set * return 0 if success, 1 otherwise. */ static int SetCloseColor(display, colormap, visual, col, image_pixel, mask_pixel, alloc_pixels, nalloc_pixels, attributes, cols, ncols, allocColor, closure) Display *display; Colormap colormap; Visual *visual; XColor *col; Pixel *image_pixel, *mask_pixel; Pixel *alloc_pixels; unsigned int *nalloc_pixels; XpmAttributes *attributes; XColor *cols; int ncols; XpmAllocColorFunc allocColor; void *closure; { /* * Allocation failed, so try close colors. To get here the visual must * be GreyScale, PseudoColor or DirectColor (or perhaps StaticColor? * What about sharing systems like QDSS?). Beware: we have to treat * DirectColor differently. */ long int red_closeness, green_closeness, blue_closeness; int n; Bool alloc_color; if (attributes && (attributes->valuemask & XpmCloseness)) red_closeness = green_closeness = blue_closeness = attributes->closeness; else { red_closeness = attributes->red_closeness; green_closeness = attributes->green_closeness; blue_closeness = attributes->blue_closeness; } if (attributes && (attributes->valuemask & XpmAllocCloseColors)) alloc_color = attributes->alloc_close_colors; else alloc_color = True; /* * We sort the colormap by closeness and try to allocate the color * closest to the target. If the allocation of this close color fails, * which almost never happens, then one of two scenarios is possible. * Either the colormap must have changed (since the last close color * allocation or possibly while we were sorting the colormap), or the * color is allocated as Read/Write by some other client. (Note: X * _should_ allow clients to check if a particular color is Read/Write, * but it doesn't! :-( ). We cannot determine which of these scenarios * occurred, so we try the next closest color, and so on, until no more * colors are within closeness of the target. If we knew that the * colormap had changed, we could skip this sequence. * * If _none_ of the colors within closeness of the target can be allocated, * then we can finally be pretty sure that the colormap has actually * changed. In this case we try to allocate the original color (again), * then try the closecolor stuff (again)... * * In theory it would be possible for an infinite loop to occur if another * process kept changing the colormap every time we sorted it, so we set * a maximum on the number of iterations. After this many tries, we use * XGrabServer() to ensure that the colormap remains unchanged. * * This approach gives particularly bad worst case performance - as many as * colormap reads and sorts may be needed, and as * many as * attempted allocations * may fail. On an 8-bit system, this means as many as 3 colormap reads, * 3 sorts and 768 failed allocations per execution of this code! * Luckily, my experiments show that in general use in a typical 8-bit * color environment only about 1 in every 10000 allocations fails to * succeed in the fastest possible time. So virtually every time what * actually happens is a single sort followed by a successful allocate. * The very first allocation also costs a colormap read, but no further * reads are usually necessary. */ #define ITERATIONS 2 /* more than one is almost never * necessary */ for (n = 0; n <= ITERATIONS; ++n) { CloseColor *closenesses = (CloseColor *) XpmCalloc(ncols, sizeof(CloseColor)); int i, c; for (i = 0; i < ncols; ++i) { /* build & sort closenesses table */ #define COLOR_FACTOR 3 #define BRIGHTNESS_FACTOR 1 closenesses[i].cols_index = i; closenesses[i].closeness = COLOR_FACTOR * (abs((long) col->red - (long) cols[i].red) + abs((long) col->green - (long) cols[i].green) + abs((long) col->blue - (long) cols[i].blue)) + BRIGHTNESS_FACTOR * abs(((long) col->red + (long) col->green + (long) col->blue) - ((long) cols[i].red + (long) cols[i].green + (long) cols[i].blue)); } qsort(closenesses, ncols, sizeof(CloseColor), closeness_cmp); i = 0; c = closenesses[i].cols_index; while ((long) cols[c].red >= (long) col->red - red_closeness && (long) cols[c].red <= (long) col->red + red_closeness && (long) cols[c].green >= (long) col->green - green_closeness && (long) cols[c].green <= (long) col->green + green_closeness && (long) cols[c].blue >= (long) col->blue - blue_closeness && (long) cols[c].blue <= (long) col->blue + blue_closeness) { if (alloc_color) { if ((*allocColor)(display, colormap, NULL, &cols[c], closure)){ if (n == ITERATIONS) XUngrabServer(display); XpmFree(closenesses); *image_pixel = cols[c].pixel; *mask_pixel = 1; alloc_pixels[(*nalloc_pixels)++] = cols[c].pixel; return (0); } else { ++i; if (i == ncols) break; c = closenesses[i].cols_index; } } else { if (n == ITERATIONS) XUngrabServer(display); XpmFree(closenesses); *image_pixel = cols[c].pixel; *mask_pixel = 1; return (0); } } /* Couldn't allocate _any_ of the close colors! */ if (n == ITERATIONS) XUngrabServer(display); XpmFree(closenesses); if (i == 0 || i == ncols) /* no color close enough or cannot */ return (1); /* alloc any color (full of r/w's) */ if ((*allocColor)(display, colormap, NULL, col, closure)) { *image_pixel = col->pixel; *mask_pixel = 1; alloc_pixels[(*nalloc_pixels)++] = col->pixel; return (0); } else { /* colormap has probably changed, so * re-read... */ if (n == ITERATIONS - 1) XGrabServer(display); #if 0 if (visual->class == DirectColor) { /* TODO */ } else #endif XQueryColors(display, colormap, cols, ncols); } } return (1); } #define USE_CLOSECOLOR attributes && \ (((attributes->valuemask & XpmCloseness) && attributes->closeness != 0) \ || ((attributes->valuemask & XpmRGBCloseness) && \ (attributes->red_closeness != 0 \ || attributes->green_closeness != 0 \ || attributes->blue_closeness != 0))) #else /* FOR_MSW part */ /* nothing to do here, the window system does it */ #endif /* * set the color pixel related to the given colorname, * return 0 if success, 1 otherwise. */ static int SetColor(display, colormap, visual, colorname, color_index, image_pixel, mask_pixel, mask_pixel_index, alloc_pixels, nalloc_pixels, used_pixels, nused_pixels, attributes, cols, ncols, allocColor, closure) Display *display; Colormap colormap; Visual *visual; char *colorname; unsigned int color_index; Pixel *image_pixel, *mask_pixel; unsigned int *mask_pixel_index; Pixel *alloc_pixels; unsigned int *nalloc_pixels; Pixel *used_pixels; unsigned int *nused_pixels; XpmAttributes *attributes; XColor *cols; int ncols; XpmAllocColorFunc allocColor; void *closure; { XColor xcolor; int status; if (xpmstrcasecmp(colorname, TRANSPARENT_COLOR)) { status = (*allocColor)(display, colormap, colorname, &xcolor, closure); if (status < 0) /* parse color failed */ return (1); if (status == 0) { #ifndef FOR_MSW if (USE_CLOSECOLOR) return (SetCloseColor(display, colormap, visual, &xcolor, image_pixel, mask_pixel, alloc_pixels, nalloc_pixels, attributes, cols, ncols, allocColor, closure)); else #endif /* ndef FOR_MSW */ return (1); } else alloc_pixels[(*nalloc_pixels)++] = xcolor.pixel; *image_pixel = xcolor.pixel; *mask_pixel = 1; used_pixels[(*nused_pixels)++] = xcolor.pixel; } else { *image_pixel = 0; *mask_pixel = 0; /* store the color table index */ *mask_pixel_index = color_index; } return (0); } static int CreateColors(display, attributes, colors, ncolors, image_pixels, mask_pixels, mask_pixel_index, alloc_pixels, nalloc_pixels, used_pixels, nused_pixels) Display *display; XpmAttributes *attributes; XpmColor *colors; unsigned int ncolors; Pixel *image_pixels; Pixel *mask_pixels; unsigned int *mask_pixel_index; Pixel *alloc_pixels; unsigned int *nalloc_pixels; Pixel *used_pixels; unsigned int *nused_pixels; { /* variables stored in the XpmAttributes structure */ Visual *visual; Colormap colormap; XpmColorSymbol *colorsymbols = NULL; unsigned int numsymbols; XpmAllocColorFunc allocColor; void *closure; char *colorname; unsigned int color, key; Bool pixel_defined; XpmColorSymbol *symbol = NULL; char **defaults; int ErrorStatus = XpmSuccess; char *s; int default_index; XColor *cols = NULL; unsigned int ncols = 0; /* * retrieve information from the XpmAttributes */ if (attributes && attributes->valuemask & XpmColorSymbols) { colorsymbols = attributes->colorsymbols; numsymbols = attributes->numsymbols; } else numsymbols = 0; if (attributes && attributes->valuemask & XpmVisual) visual = attributes->visual; else visual = XDefaultVisual(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmColormap)) colormap = attributes->colormap; else colormap = XDefaultColormap(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmColorKey)) key = attributes->color_key; else key = xpmVisualType(visual); if (attributes && (attributes->valuemask & XpmAllocColor)) allocColor = attributes->alloc_color; else allocColor = AllocColor; if (attributes && (attributes->valuemask & XpmColorClosure)) closure = attributes->color_closure; else closure = NULL; #ifndef FOR_MSW if (USE_CLOSECOLOR) { /* originally from SetCloseColor */ #if 0 if (visual->class == DirectColor) { /* * TODO: Implement close colors for DirectColor visuals. This is * difficult situation. Chances are that we will never get here, * because any machine that supports DirectColor will probably * also support TrueColor (and probably PseudoColor). Also, * DirectColor colormaps can be very large, so looking for close * colors may be too slow. */ } else { #endif unsigned int i; ncols = visual->map_entries; cols = (XColor *) XpmCalloc(ncols, sizeof(XColor)); for (i = 0; i < ncols; ++i) cols[i].pixel = i; XQueryColors(display, colormap, cols, ncols); #if 0 } #endif } #endif /* ndef FOR_MSW */ switch (key) { case XPM_MONO: default_index = 2; break; case XPM_GRAY4: default_index = 3; break; case XPM_GRAY: default_index = 4; break; case XPM_COLOR: default: default_index = 5; break; } for (color = 0; color < ncolors; color++, colors++, image_pixels++, mask_pixels++) { colorname = NULL; pixel_defined = False; defaults = (char **) colors; /* * look for a defined symbol */ if (numsymbols) { unsigned int n; s = defaults[1]; for (n = 0, symbol = colorsymbols; n < numsymbols; n++, symbol++) { if (symbol->name && s && !strcmp(symbol->name, s)) /* override name */ break; if (!symbol->name && symbol->value) { /* override value */ int def_index = default_index; while (defaults[def_index] == NULL) /* find defined * colorname */ --def_index; if (def_index < 2) {/* nothing towards mono, so try * towards color */ def_index = default_index + 1; while (def_index <= 5 && defaults[def_index] == NULL) ++def_index; } if (def_index >= 2 && defaults[def_index] != NULL && !xpmstrcasecmp(symbol->value, defaults[def_index])) break; } } if (n != numsymbols) { if (symbol->name && symbol->value) colorname = symbol->value; else pixel_defined = True; } } if (!pixel_defined) { /* pixel not given as symbol value */ unsigned int k; if (colorname) { /* colorname given as symbol value */ if (!SetColor(display, colormap, visual, colorname, color, image_pixels, mask_pixels, mask_pixel_index, alloc_pixels, nalloc_pixels, used_pixels, nused_pixels, attributes, cols, ncols, allocColor, closure)) pixel_defined = True; else ErrorStatus = XpmColorError; } k = key; while (!pixel_defined && k > 1) { if (defaults[k]) { if (!SetColor(display, colormap, visual, defaults[k], color, image_pixels, mask_pixels, mask_pixel_index, alloc_pixels, nalloc_pixels, used_pixels, nused_pixels, attributes, cols, ncols, allocColor, closure)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } k--; } k = key + 1; while (!pixel_defined && k < NKEYS + 1) { if (defaults[k]) { if (!SetColor(display, colormap, visual, defaults[k], color, image_pixels, mask_pixels, mask_pixel_index, alloc_pixels, nalloc_pixels, used_pixels, nused_pixels, attributes, cols, ncols, allocColor, closure)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } k++; } if (!pixel_defined) { if (cols) XpmFree(cols); return (XpmColorFailed); } } else { /* simply use the given pixel */ *image_pixels = symbol->pixel; /* the following makes the mask to be built even if none is given a particular pixel */ if (symbol->value && !xpmstrcasecmp(symbol->value, TRANSPARENT_COLOR)) { *mask_pixels = 0; *mask_pixel_index = color; } else *mask_pixels = 1; used_pixels[(*nused_pixels)++] = *image_pixels; } } if (cols) XpmFree(cols); return (ErrorStatus); } /* default FreeColors function, simply call XFreeColors */ static int FreeColors(display, colormap, pixels, n, closure) Display *display; Colormap colormap; Pixel *pixels; int n; void *closure; /* not used */ { return XFreeColors(display, colormap, pixels, n, 0); } /* function call in case of error, frees only locally allocated variables */ #undef RETURN #define RETURN(status) \ do { \ if (ximage) XDestroyImage(ximage); \ if (shapeimage) XDestroyImage(shapeimage); \ if (image_pixels) XpmFree(image_pixels); \ if (mask_pixels) XpmFree(mask_pixels); \ if (nalloc_pixels) \ (*freeColors)(display, colormap, alloc_pixels, nalloc_pixels, NULL); \ if (alloc_pixels) XpmFree(alloc_pixels); \ if (used_pixels) XpmFree(used_pixels); \ return (status); \ } while(0) int XpmCreateImageFromXpmImage(display, image, image_return, shapeimage_return, attributes) Display *display; XpmImage *image; XImage **image_return; XImage **shapeimage_return; XpmAttributes *attributes; { /* variables stored in the XpmAttributes structure */ Visual *visual; Colormap colormap; unsigned int depth; int bitmap_format; XpmFreeColorsFunc freeColors; void *closure; /* variables to return */ XImage *ximage = NULL; XImage *shapeimage = NULL; unsigned int mask_pixel_index = XpmUndefPixel; int ErrorStatus; /* calculation variables */ Pixel *image_pixels = NULL; Pixel *mask_pixels = NULL; Pixel *alloc_pixels = NULL; Pixel *used_pixels = NULL; unsigned int nalloc_pixels = 0; unsigned int nused_pixels = 0; /* initialize return values */ if (image_return) *image_return = NULL; if (shapeimage_return) *shapeimage_return = NULL; /* retrieve information from the XpmAttributes */ if (attributes && (attributes->valuemask & XpmVisual)) visual = attributes->visual; else visual = XDefaultVisual(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmColormap)) colormap = attributes->colormap; else colormap = XDefaultColormap(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmDepth)) depth = attributes->depth; else depth = XDefaultDepth(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmBitmapFormat)) bitmap_format = attributes->bitmap_format; else bitmap_format = ZPixmap; if (attributes && (attributes->valuemask & XpmFreeColors)) freeColors = attributes->free_colors; else freeColors = FreeColors; if (attributes && (attributes->valuemask & XpmColorClosure)) closure = attributes->color_closure; else closure = NULL; ErrorStatus = XpmSuccess; if (image->ncolors >= UINT_MAX / sizeof(Pixel)) return (XpmNoMemory); /* malloc pixels index tables */ image_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * image->ncolors); if (!image_pixels) return (XpmNoMemory); mask_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * image->ncolors); if (!mask_pixels) RETURN(XpmNoMemory); /* maximum of allocated pixels will be the number of colors */ alloc_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * image->ncolors); if (!alloc_pixels) RETURN(XpmNoMemory); /* maximum of allocated pixels will be the number of colors */ used_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * image->ncolors); if (!used_pixels) RETURN(XpmNoMemory); /* get pixel colors, store them in index tables */ ErrorStatus = CreateColors(display, attributes, image->colorTable, image->ncolors, image_pixels, mask_pixels, &mask_pixel_index, alloc_pixels, &nalloc_pixels, used_pixels, &nused_pixels); if (ErrorStatus != XpmSuccess && (ErrorStatus < 0 || (attributes && (attributes->valuemask & XpmExactColors) && attributes->exactColors))) RETURN(ErrorStatus); /* create the ximage */ if (image_return) { ErrorStatus = CreateXImage(display, visual, depth, (depth == 1 ? bitmap_format : ZPixmap), image->width, image->height, &ximage); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); #ifndef FOR_MSW /* * set the ximage data using optimized functions for ZPixmap */ if (ximage->bits_per_pixel == 8) PutImagePixels8(ximage, image->width, image->height, image->data, image_pixels); else if (((ximage->bits_per_pixel | ximage->depth) == 1) && (ximage->byte_order == ximage->bitmap_bit_order)) PutImagePixels1(ximage, image->width, image->height, image->data, image_pixels); else if (ximage->bits_per_pixel == 16) PutImagePixels16(ximage, image->width, image->height, image->data, image_pixels); else if (ximage->bits_per_pixel == 32) PutImagePixels32(ximage, image->width, image->height, image->data, image_pixels); else PutImagePixels(ximage, image->width, image->height, image->data, image_pixels); #else /* FOR_MSW */ MSWPutImagePixels(display, ximage, image->width, image->height, image->data, image_pixels); #endif } /* create the shape mask image */ if (mask_pixel_index != XpmUndefPixel && shapeimage_return) { ErrorStatus = CreateXImage(display, visual, 1, bitmap_format, image->width, image->height, &shapeimage); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); #ifndef FOR_MSW PutImagePixels1(shapeimage, image->width, image->height, image->data, mask_pixels); #else MSWPutImagePixels(display, shapeimage, image->width, image->height, image->data, mask_pixels); #endif } XpmFree(image_pixels); XpmFree(mask_pixels); /* if requested return used pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnPixels || /* 3.2 backward compatibility code */ attributes->valuemask & XpmReturnInfos)) { /* end 3.2 bc */ attributes->pixels = used_pixels; attributes->npixels = nused_pixels; attributes->mask_pixel = mask_pixel_index; } else XpmFree(used_pixels); /* if requested return alloc'ed pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnAllocPixels)) { attributes->alloc_pixels = alloc_pixels; attributes->nalloc_pixels = nalloc_pixels; } else XpmFree(alloc_pixels); /* return created images */ if (image_return) *image_return = ximage; if (shapeimage_return) *shapeimage_return = shapeimage; return (ErrorStatus); } /* * Create an XImage with its data */ static int CreateXImage(display, visual, depth, format, width, height, image_return) Display *display; Visual *visual; unsigned int depth; int format; unsigned int width; unsigned int height; XImage **image_return; { int bitmap_pad; /* first get bitmap_pad */ if (depth > 16) bitmap_pad = 32; else if (depth > 8) bitmap_pad = 16; else bitmap_pad = 8; /* then create the XImage with data = NULL and bytes_per_line = 0 */ *image_return = XCreateImage(display, visual, depth, format, 0, 0, width, height, bitmap_pad, 0); if (!*image_return) return (XpmNoMemory); #ifndef FOR_MSW if (height != 0 && (*image_return)->bytes_per_line >= INT_MAX / height) { XDestroyImage(*image_return); return (XpmNoMemory); } if((*image_return)->bytes_per_line == 0 || height == 0) return XpmNoMemory; /* now that bytes_per_line must have been set properly alloc data */ (*image_return)->data = (char *) XpmMalloc((*image_return)->bytes_per_line * height); if (!(*image_return)->data) { XDestroyImage(*image_return); *image_return = NULL; return (XpmNoMemory); } #else /* under FOR_MSW XCreateImage has done it all */ #endif return (XpmSuccess); } #ifndef FOR_MSW /* * The functions below are written from X11R5 MIT's code (XImUtil.c) * * The idea is to have faster functions than the standard XPutPixel function * to build the image data. Indeed we can speed up things by suppressing tests * performed for each pixel. We do the same tests but at the image level. * We also assume that we use only ZPixmap images with null offsets. */ LFUNC(_putbits, void, (register char *src, int dstoffset, register int numbits, register char *dst)); LFUNC(_XReverse_Bytes, int, (register unsigned char *bpt, register unsigned int nb)); static unsigned char Const _reverse_byte[0x100] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static int _XReverse_Bytes(bpt, nb) register unsigned char *bpt; register unsigned int nb; { do { *bpt = _reverse_byte[*bpt]; bpt++; } while (--nb > 0); /* is nb user-controled? */ return 0; } void xpm_xynormalizeimagebits(bp, img) register unsigned char *bp; register XImage *img; { register unsigned char c; if (img->byte_order != img->bitmap_bit_order) { switch (img->bitmap_unit) { case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } if (img->bitmap_bit_order == MSBFirst) _XReverse_Bytes(bp, img->bitmap_unit >> 3); } void xpm_znormalizeimagebits(bp, img) register unsigned char *bp; register XImage *img; { register unsigned char c; switch (img->bits_per_pixel) { case 2: _XReverse_Bytes(bp, 1); break; case 4: *bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF); break; case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 24: c = *(bp + 2); *(bp + 2) = *bp; *bp = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } static unsigned char Const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; static unsigned char Const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static void _putbits(src, dstoffset, numbits, dst) register char *src; /* address of source bit string */ int dstoffset; /* bit offset into destination; * range is 0-31 */ register int numbits; /* number of bits to copy to * destination */ register char *dst; /* address of destination bit string */ { register unsigned char chlo, chhi; int hibits; dst = dst + (dstoffset >> 3); dstoffset = dstoffset & 7; hibits = 8 - dstoffset; chlo = *dst & _lomask[dstoffset]; for (;;) { chhi = (*src << dstoffset) & _himask[dstoffset]; if (numbits <= hibits) { chhi = chhi & _lomask[dstoffset + numbits]; *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi; break; } *dst = chhi | chlo; dst++; numbits = numbits - hibits; chlo = (unsigned char) (*src & _himask[hibits]) >> hibits; src++; if (numbits <= dstoffset) { chlo = chlo & _lomask[numbits]; *dst = (*dst & _himask[numbits]) | chlo; break; } numbits = numbits - dstoffset; } } /* * Default method to write pixels into a Z image data structure. * The algorithm used is: * * copy the destination bitmap_unit or Zpixel to temp * normalize temp if needed * copy the pixel bits into the temp * renormalize temp if needed * copy the temp back into the destination image data */ static void PutImagePixels(image, width, height, pixelindex, pixels) XImage *image; unsigned int width; unsigned int height; unsigned int *pixelindex; Pixel *pixels; { register char *src; register char *dst; register unsigned int *iptr; register unsigned int x, y; register char *data; Pixel pixel, px; int nbytes, depth, ibu, ibpp, i; data = image->data; iptr = pixelindex; depth = image->depth; if (depth == 1) { ibu = image->bitmap_unit; for (y = 0; y < height; y++) /* how can we trust height */ for (x = 0; x < width; x++, iptr++) { /* how can we trust width */ pixel = pixels[*iptr]; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = px; src = &data[XYINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = ibu >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; XYNORMALIZE(&px, image); _putbits((char *) &pixel, (x % ibu), 1, (char *) &px); XYNORMALIZE(&px, image); src = (char *) &px; dst = &data[XYINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } else { ibpp = image->bits_per_pixel; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; if (depth == 4) pixel &= 0xf; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = px; src = &data[ZINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = (ibpp + 7) >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; ZNORMALIZE(&px, image); _putbits((char *) &pixel, (x * ibpp) & 7, ibpp, (char *) &px); ZNORMALIZE(&px, image); src = (char *) &px; dst = &data[ZINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } } /* * write pixels into a 32-bits Z image data structure */ #if !defined(WORD64) && !defined(LONG64) /* this item is static but deterministic so let it slide; doesn't * hurt re-entrancy of this library. Note if it is actually const then would * be OK under rules of ANSI-C but probably not C++ which may not * want to allocate space for it. */ static unsigned long byteorderpixel = MSBFirst << 24; #endif /* WITHOUT_SPEEDUPS is a flag to be turned on if you wish to use the original 3.2e code - by default you get the speeded-up version. */ static void PutImagePixels32(image, width, height, pixelindex, pixels) XImage *image; unsigned int width; unsigned int height; unsigned int *pixelindex; Pixel *pixels; { unsigned char *data; unsigned int *iptr; unsigned int y; Pixel pixel; #ifdef WITHOUT_SPEEDUPS unsigned int x; unsigned char *addr; data = (unsigned char *) image->data; iptr = pixelindex; #if !defined(WORD64) && !defined(LONG64) if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX32(x, y, image)]; *((unsigned long *) addr) = pixels[*iptr]; } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX32(x, y, image)]; pixel = pixels[*iptr]; addr[0] = pixel >> 24; addr[1] = pixel >> 16; addr[2] = pixel >> 8; addr[3] = pixel; } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX32(x, y, image)]; pixel = pixels[*iptr]; addr[0] = pixel; addr[1] = pixel >> 8; addr[2] = pixel >> 16; addr[3] = pixel >> 24; } #else /* WITHOUT_SPEEDUPS */ unsigned int bpl = image->bytes_per_line; unsigned char *data_ptr, *max_data; data = (unsigned char *) image->data; iptr = pixelindex; #if !defined(WORD64) && !defined(LONG64) if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + (width << 2); while (data_ptr < max_data) { *((unsigned long *) data_ptr) = pixels[*(iptr++)]; data_ptr += (1 << 2); } data += bpl; } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + (width << 2); while (data_ptr < max_data) { pixel = pixels[*(iptr++)]; *data_ptr++ = pixel >> 24; *data_ptr++ = pixel >> 16; *data_ptr++ = pixel >> 8; *data_ptr++ = pixel; } data += bpl; } else for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + (width << 2); while (data_ptr < max_data) { pixel = pixels[*(iptr++)]; *data_ptr++ = pixel; *data_ptr++ = pixel >> 8; *data_ptr++ = pixel >> 16; *data_ptr++ = pixel >> 24; } data += bpl; } #endif /* WITHOUT_SPEEDUPS */ } /* * write pixels into a 16-bits Z image data structure */ static void PutImagePixels16(image, width, height, pixelindex, pixels) XImage *image; unsigned int width; unsigned int height; unsigned int *pixelindex; Pixel *pixels; { unsigned char *data; unsigned int *iptr; unsigned int y; #ifdef WITHOUT_SPEEDUPS unsigned int x; unsigned char *addr; data = (unsigned char *) image->data; iptr = pixelindex; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX16(x, y, image)]; addr[0] = pixels[*iptr] >> 8; addr[1] = pixels[*iptr]; } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX16(x, y, image)]; addr[0] = pixels[*iptr]; addr[1] = pixels[*iptr] >> 8; } #else /* WITHOUT_SPEEDUPS */ Pixel pixel; unsigned int bpl = image->bytes_per_line; unsigned char *data_ptr, *max_data; data = (unsigned char *) image->data; iptr = pixelindex; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + (width << 1); while (data_ptr < max_data) { pixel = pixels[*(iptr++)]; data_ptr[0] = pixel >> 8; data_ptr[1] = pixel; data_ptr += (1 << 1); } data += bpl; } else for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + (width << 1); while (data_ptr < max_data) { pixel = pixels[*(iptr++)]; data_ptr[0] = pixel; data_ptr[1] = pixel >> 8; data_ptr += (1 << 1); } data += bpl; } #endif /* WITHOUT_SPEEDUPS */ } /* * write pixels into a 8-bits Z image data structure */ static void PutImagePixels8(image, width, height, pixelindex, pixels) XImage *image; unsigned int width; unsigned int height; unsigned int *pixelindex; Pixel *pixels; { char *data; unsigned int *iptr; unsigned int y; #ifdef WITHOUT_SPEEDUPS unsigned int x; data = image->data; iptr = pixelindex; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) data[ZINDEX8(x, y, image)] = pixels[*iptr]; #else /* WITHOUT_SPEEDUPS */ unsigned int bpl = image->bytes_per_line; char *data_ptr, *max_data; data = image->data; iptr = pixelindex; for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + width; while (data_ptr < max_data) *(data_ptr++) = pixels[*(iptr++)]; data += bpl; } #endif /* WITHOUT_SPEEDUPS */ } /* * write pixels into a 1-bit depth image data structure and **offset null** */ static void PutImagePixels1(image, width, height, pixelindex, pixels) XImage *image; unsigned int width; unsigned int height; unsigned int *pixelindex; Pixel *pixels; { if (image->byte_order != image->bitmap_bit_order) PutImagePixels(image, width, height, pixelindex, pixels); else { unsigned int *iptr; unsigned int y; char *data; #ifdef WITHOUT_SPEEDUPS unsigned int x; data = image->data; iptr = pixelindex; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { if (pixels[*iptr] & 1) data[ZINDEX1(x, y, image)] |= 0x80 >> (x & 7); else data[ZINDEX1(x, y, image)] &= ~(0x80 >> (x & 7)); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { if (pixels[*iptr] & 1) data[ZINDEX1(x, y, image)] |= 1 << (x & 7); else data[ZINDEX1(x, y, image)] &= ~(1 << (x & 7)); } #else /* WITHOUT_SPEEDUPS */ char value; char *data_ptr, *max_data; int bpl = image->bytes_per_line; int diff, count; data = image->data; iptr = pixelindex; diff = width & 7; width >>= 3; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + width; while (data_ptr < max_data) { value = 0; value = (value << 1) | (pixels[*(iptr++)] & 1); value = (value << 1) | (pixels[*(iptr++)] & 1); value = (value << 1) | (pixels[*(iptr++)] & 1); value = (value << 1) | (pixels[*(iptr++)] & 1); value = (value << 1) | (pixels[*(iptr++)] & 1); value = (value << 1) | (pixels[*(iptr++)] & 1); value = (value << 1) | (pixels[*(iptr++)] & 1); value = (value << 1) | (pixels[*(iptr++)] & 1); *(data_ptr++) = value; } if (diff) { value = 0; for (count = 0; count < diff; count++) { if (pixels[*(iptr++)] & 1) value |= (0x80 >> count); } *(data_ptr) = value; } data += bpl; } else for (y = 0; y < height; y++) { data_ptr = data; max_data = data_ptr + width; while (data_ptr < max_data) { value = 0; iptr += 8; value = (value << 1) | (pixels[*(--iptr)] & 1); value = (value << 1) | (pixels[*(--iptr)] & 1); value = (value << 1) | (pixels[*(--iptr)] & 1); value = (value << 1) | (pixels[*(--iptr)] & 1); value = (value << 1) | (pixels[*(--iptr)] & 1); value = (value << 1) | (pixels[*(--iptr)] & 1); value = (value << 1) | (pixels[*(--iptr)] & 1); value = (value << 1) | (pixels[*(--iptr)] & 1); iptr += 8; *(data_ptr++) = value; } if (diff) { value = 0; for (count = 0; count < diff; count++) { if (pixels[*(iptr++)] & 1) value |= (1 << count); } *(data_ptr) = value; } data += bpl; } #endif /* WITHOUT_SPEEDUPS */ } } int XpmCreatePixmapFromXpmImage(display, d, image, pixmap_return, shapemask_return, attributes) Display *display; Drawable d; XpmImage *image; Pixmap *pixmap_return; Pixmap *shapemask_return; XpmAttributes *attributes; { XImage *ximage, *shapeimage; int ErrorStatus; /* initialize return values */ if (pixmap_return) *pixmap_return = 0; if (shapemask_return) *shapemask_return = 0; /* create the ximages */ ErrorStatus = XpmCreateImageFromXpmImage(display, image, (pixmap_return ? &ximage : NULL), (shapemask_return ? &shapeimage : NULL), attributes); if (ErrorStatus < 0) return (ErrorStatus); /* create the pixmaps and destroy images */ if (pixmap_return && ximage) { xpmCreatePixmapFromImage(display, d, ximage, pixmap_return); XDestroyImage(ximage); } if (shapemask_return && shapeimage) { xpmCreatePixmapFromImage(display, d, shapeimage, shapemask_return); XDestroyImage(shapeimage); } return (ErrorStatus); } #else /* FOR_MSW part follows */ static void MSWPutImagePixels(dc, image, width, height, pixelindex, pixels) Display *dc; XImage *image; unsigned int width; unsigned int height; unsigned int *pixelindex; Pixel *pixels; { unsigned int *data = pixelindex; unsigned int x, y; SelectObject(*dc, image->bitmap); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { SetPixel(*dc, x, y, pixels[*(data++)]); /* data is [x+y*width] */ } } } #endif /* FOR_MSW */ #ifndef FOR_MSW static int PutPixel1(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { register char *src; register char *dst; register int i; register char *data; Pixel px; int nbytes; if(x < 0 || y < 0) return 0; for (i=0, px=pixel; i>=8) ((unsigned char *)&pixel)[i] = px; src = &ximage->data[XYINDEX(x, y, ximage)]; dst = (char *)&px; px = 0; nbytes = ximage->bitmap_unit >> 3; for (i = nbytes; --i >= 0; ) *dst++ = *src++; XYNORMALIZE(&px, ximage); i = ((x + ximage->xoffset) % ximage->bitmap_unit); _putbits ((char *)&pixel, i, 1, (char *)&px); XYNORMALIZE(&px, ximage); src = (char *) &px; dst = &ximage->data[XYINDEX(x, y, ximage)]; for (i = nbytes; --i >= 0; ) *dst++ = *src++; return 1; } static int PutPixel(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { register char *src; register char *dst; register int i; register char *data; Pixel px; unsigned int nbytes, ibpp; if(x < 0 || y < 0) return 0; ibpp = ximage->bits_per_pixel; if (ximage->depth == 4) pixel &= 0xf; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = px; src = &ximage->data[ZINDEX(x, y, ximage)]; dst = (char *) &px; px = 0; nbytes = (ibpp + 7) >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; ZNORMALIZE(&px, ximage); _putbits((char *) &pixel, (x * ibpp) & 7, ibpp, (char *) &px); ZNORMALIZE(&px, ximage); src = (char *) &px; dst = &ximage->data[ZINDEX(x, y, ximage)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; return 1; } static int PutPixel32(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { unsigned char *addr; if(x < 0 || y < 0) return 0; addr = &((unsigned char *)ximage->data) [ZINDEX32(x, y, ximage)]; *((unsigned long *)addr) = pixel; return 1; } static int PutPixel32MSB(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { unsigned char *addr; if(x < 0 || y < 0) return 0; addr = &((unsigned char *)ximage->data) [ZINDEX32(x, y, ximage)]; addr[0] = pixel >> 24; addr[1] = pixel >> 16; addr[2] = pixel >> 8; addr[3] = pixel; return 1; } static int PutPixel32LSB(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { unsigned char *addr; if(x < 0 || y < 0) return 0; addr = &((unsigned char *)ximage->data) [ZINDEX32(x, y, ximage)]; addr[3] = pixel >> 24; addr[2] = pixel >> 16; addr[1] = pixel >> 8; addr[0] = pixel; return 1; } static int PutPixel16MSB(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { unsigned char *addr; if(x < 0 || y < 0) return 0; addr = &((unsigned char *)ximage->data) [ZINDEX16(x, y, ximage)]; addr[0] = pixel >> 8; addr[1] = pixel; return 1; } static int PutPixel16LSB(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { unsigned char *addr; if(x < 0 || y < 0) return 0; addr = &((unsigned char *)ximage->data) [ZINDEX16(x, y, ximage)]; addr[1] = pixel >> 8; addr[0] = pixel; return 1; } static int PutPixel8(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { if(x < 0 || y < 0) return 0; ximage->data[ZINDEX8(x, y, ximage)] = pixel; return 1; } static int PutPixel1MSB(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { if(x < 0 || y < 0) return 0; if (pixel & 1) ximage->data[ZINDEX1(x, y, ximage)] |= 0x80 >> (x & 7); else ximage->data[ZINDEX1(x, y, ximage)] &= ~(0x80 >> (x & 7)); return 1; } static int PutPixel1LSB(ximage, x, y, pixel) register XImage *ximage; int x; int y; unsigned long pixel; { if(x < 0 || y < 0) return 0; if (pixel & 1) ximage->data[ZINDEX1(x, y, ximage)] |= 1 << (x & 7); else ximage->data[ZINDEX1(x, y, ximage)] &= ~(1 << (x & 7)); return 1; } #endif /* FOR_MSW */ /* function call in case of error, frees only locally allocated variables */ #undef RETURN #define RETURN(status) \ { \ if (USE_HASHTABLE) xpmHashTableFree(&hashtable); \ if (colorTable) xpmFreeColorTable(colorTable, ncolors); \ if (hints_cmt) XpmFree(hints_cmt); \ if (colors_cmt) XpmFree(colors_cmt); \ if (pixels_cmt) XpmFree(pixels_cmt); \ if (ximage) XDestroyImage(ximage); \ if (shapeimage) XDestroyImage(shapeimage); \ if (image_pixels) XpmFree(image_pixels); \ if (mask_pixels) XpmFree(mask_pixels); \ if (nalloc_pixels) \ (*freeColors)(display, colormap, alloc_pixels, nalloc_pixels, NULL); \ if (alloc_pixels) XpmFree(alloc_pixels); \ if (used_pixels) XpmFree(used_pixels); \ return(status); \ } /* * This function parses an Xpm file or data and directly create an XImage */ int xpmParseDataAndCreate(display, data, image_return, shapeimage_return, image, info, attributes) Display *display; xpmData *data; XImage **image_return; XImage **shapeimage_return; XpmImage *image; XpmInfo *info; XpmAttributes *attributes; { /* variables stored in the XpmAttributes structure */ Visual *visual; Colormap colormap; unsigned int depth; int bitmap_format; XpmFreeColorsFunc freeColors; void *closure; /* variables to return */ XImage *ximage = NULL; XImage *shapeimage = NULL; unsigned int mask_pixel_index = XpmUndefPixel; /* calculation variables */ Pixel *image_pixels = NULL; Pixel *mask_pixels = NULL; Pixel *alloc_pixels = NULL; Pixel *used_pixels = NULL; unsigned int nalloc_pixels = 0; unsigned int nused_pixels = 0; unsigned int width, height, ncolors, cpp; unsigned int x_hotspot, y_hotspot, hotspot = 0, extensions = 0; XpmColor *colorTable = NULL; char *hints_cmt = NULL; char *colors_cmt = NULL; char *pixels_cmt = NULL; unsigned int cmts; int ErrorStatus; xpmHashTable hashtable; /* initialize return values */ if (image_return) *image_return = NULL; if (shapeimage_return) *shapeimage_return = NULL; /* retrieve information from the XpmAttributes */ if (attributes && (attributes->valuemask & XpmVisual)) visual = attributes->visual; else visual = XDefaultVisual(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmColormap)) colormap = attributes->colormap; else colormap = XDefaultColormap(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmDepth)) depth = attributes->depth; else depth = XDefaultDepth(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmBitmapFormat)) bitmap_format = attributes->bitmap_format; else bitmap_format = ZPixmap; if (attributes && (attributes->valuemask & XpmFreeColors)) freeColors = attributes->free_colors; else freeColors = FreeColors; if (attributes && (attributes->valuemask & XpmColorClosure)) closure = attributes->color_closure; else closure = NULL; cmts = info && (info->valuemask & XpmReturnComments); /* * parse the header */ ErrorStatus = xpmParseHeader(data); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* * read values */ ErrorStatus = xpmParseValues(data, &width, &height, &ncolors, &cpp, &x_hotspot, &y_hotspot, &hotspot, &extensions); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* * store the hints comment line */ if (cmts) xpmGetCmt(data, &hints_cmt); /* * init the hastable */ if (USE_HASHTABLE) { ErrorStatus = xpmHashTableInit(&hashtable); if (ErrorStatus != XpmSuccess) return (ErrorStatus); } /* * read colors */ ErrorStatus = xpmParseColors(data, ncolors, cpp, &colorTable, &hashtable); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); /* * store the colors comment line */ if (cmts) xpmGetCmt(data, &colors_cmt); /* malloc pixels index tables */ if (ncolors >= UINT_MAX / sizeof(Pixel)) RETURN (XpmNoMemory); image_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * ncolors); if (!image_pixels) RETURN(XpmNoMemory); mask_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * ncolors); if (!mask_pixels) RETURN(XpmNoMemory); /* maximum of allocated pixels will be the number of colors */ alloc_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * ncolors); if (!alloc_pixels) RETURN(XpmNoMemory); /* maximum of allocated pixels will be the number of colors */ used_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * ncolors); if (!used_pixels) RETURN(XpmNoMemory); /* get pixel colors, store them in index tables */ ErrorStatus = CreateColors(display, attributes, colorTable, ncolors, image_pixels, mask_pixels, &mask_pixel_index, alloc_pixels, &nalloc_pixels, used_pixels, &nused_pixels); if (ErrorStatus != XpmSuccess && (ErrorStatus < 0 || (attributes && (attributes->valuemask & XpmExactColors) && attributes->exactColors))) RETURN(ErrorStatus); /* now create the ximage */ if (image_return) { ErrorStatus = CreateXImage(display, visual, depth, (depth == 1 ? bitmap_format : ZPixmap), width, height, &ximage); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); #ifndef FOR_MSW /* * set the XImage pointer function, to be used with XPutPixel, * to an internal optimized function */ if (ximage->bits_per_pixel == 8) ximage->f.put_pixel = PutPixel8; else if (((ximage->bits_per_pixel | ximage->depth) == 1) && (ximage->byte_order == ximage->bitmap_bit_order)) if (ximage->bitmap_bit_order == MSBFirst) ximage->f.put_pixel = PutPixel1MSB; else ximage->f.put_pixel = PutPixel1LSB; else if (ximage->bits_per_pixel == 16) if (ximage->bitmap_bit_order == MSBFirst) ximage->f.put_pixel = PutPixel16MSB; else ximage->f.put_pixel = PutPixel16LSB; else if (ximage->bits_per_pixel == 32) #if !defined(WORD64) && !defined(LONG64) if (*((char *)&byteorderpixel) == ximage->byte_order) ximage->f.put_pixel = PutPixel32; else #endif if (ximage->bitmap_bit_order == MSBFirst) ximage->f.put_pixel = PutPixel32MSB; else ximage->f.put_pixel = PutPixel32LSB; else if ((ximage->bits_per_pixel | ximage->depth) == 1) ximage->f.put_pixel = PutPixel1; else ximage->f.put_pixel = PutPixel; #endif } /* create the shape mask image */ if (mask_pixel_index != XpmUndefPixel && shapeimage_return) { ErrorStatus = CreateXImage(display, visual, 1, bitmap_format, width, height, &shapeimage); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); #ifndef FOR_MSW if (shapeimage->bitmap_bit_order == MSBFirst) shapeimage->f.put_pixel = PutPixel1MSB; else shapeimage->f.put_pixel = PutPixel1LSB; #endif } /* * read pixels and put them in the XImage */ #ifndef FOR_MSW ErrorStatus = ParseAndPutPixels(data, width, height, ncolors, cpp, #else ErrorStatus = ParseAndPutPixels(display, data, width, height, ncolors, cpp, #endif colorTable, &hashtable, ximage, image_pixels, shapeimage, mask_pixels); XpmFree(image_pixels); image_pixels = NULL; XpmFree(mask_pixels); mask_pixels = NULL; /* * free the hastable */ if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus) else if (USE_HASHTABLE) xpmHashTableFree(&hashtable); /* * store the pixels comment line */ if (cmts) xpmGetCmt(data, &pixels_cmt); /* * parse extensions */ if (info && (info->valuemask & XpmReturnExtensions)) { if (extensions) { ErrorStatus = xpmParseExtensions(data, &info->extensions, &info->nextensions); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); } else { info->extensions = NULL; info->nextensions = 0; } } /* * store found informations in the XpmImage structure */ image->width = width; image->height = height; image->cpp = cpp; image->ncolors = ncolors; image->colorTable = colorTable; image->data = NULL; if (info) { if (cmts) { info->hints_cmt = hints_cmt; info->colors_cmt = colors_cmt; info->pixels_cmt = pixels_cmt; } if (hotspot) { info->x_hotspot = x_hotspot; info->y_hotspot = y_hotspot; info->valuemask |= XpmHotspot; } } /* if requested return used pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnPixels || /* 3.2 backward compatibility code */ attributes->valuemask & XpmReturnInfos)) { /* end 3.2 bc */ attributes->pixels = used_pixels; attributes->npixels = nused_pixels; attributes->mask_pixel = mask_pixel_index; } else XpmFree(used_pixels); /* if requested return alloc'ed pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnAllocPixels)) { attributes->alloc_pixels = alloc_pixels; attributes->nalloc_pixels = nalloc_pixels; } else XpmFree(alloc_pixels); /* return created images */ if (image_return) *image_return = ximage; if (shapeimage_return) *shapeimage_return = shapeimage; return (XpmSuccess); } #ifndef FOR_MSW static int ParseAndPutPixels(data, width, height, ncolors, cpp, colorTable, hashtable, image, image_pixels, shapeimage, shape_pixels) #else /* FOR_MSW */ static int ParseAndPutPixels(dc, data, width, height, ncolors, cpp, colorTable, hashtable, image, image_pixels, shapeimage, shape_pixels) Display *dc; #endif xpmData *data; unsigned int width; unsigned int height; unsigned int ncolors; unsigned int cpp; XpmColor *colorTable; xpmHashTable *hashtable; XImage *image; Pixel *image_pixels; XImage *shapeimage; Pixel *shape_pixels; { unsigned int a, x, y; switch (cpp) { case (1): /* Optimize for single character * colors */ { unsigned short colidx[256]; if (ncolors > 256) return (XpmFileInvalid); bzero((char *)colidx, 256 * sizeof(short)); for (a = 0; a < ncolors; a++) colidx[(unsigned char)colorTable[a].string[0]] = a + 1; for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++) { int c = xpmGetC(data); if (c > 0 && c < 256 && colidx[c] != 0) { #ifndef FOR_MSW XPutPixel(image, x, y, image_pixels[colidx[c] - 1]); if (shapeimage) XPutPixel(shapeimage, x, y, shape_pixels[colidx[c] - 1]); #else SelectObject(*dc, image->bitmap); SetPixel(*dc, x, y, image_pixels[colidx[c] - 1]); if (shapeimage) { SelectObject(*dc, shapeimage->bitmap); SetPixel(*dc, x, y, shape_pixels[colidx[c] - 1]); } #endif } else return (XpmFileInvalid); } } } break; case (2): /* Optimize for double character * colors */ { /* free all allocated pointers at all exits */ #define FREE_CIDX {int f; for (f = 0; f < 256; f++) \ if (cidx[f]) XpmFree(cidx[f]);} /* array of pointers malloced by need */ unsigned short *cidx[256]; unsigned int char1; bzero((char *)cidx, 256 * sizeof(unsigned short *)); /* init */ for (a = 0; a < ncolors; a++) { char1 = (unsigned char) colorTable[a].string[0]; if (cidx[char1] == NULL) { /* get new memory */ cidx[char1] = (unsigned short *) XpmCalloc(256, sizeof(unsigned short)); if (cidx[char1] == NULL) { /* new block failed */ FREE_CIDX; return (XpmNoMemory); } } cidx[char1][(unsigned char)colorTable[a].string[1]] = a + 1; } for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++) { int cc1 = xpmGetC(data); if (cc1 > 0 && cc1 < 256) { int cc2 = xpmGetC(data); if (cc2 > 0 && cc2 < 256 && cidx[cc1][cc2] != 0) { #ifndef FOR_MSW XPutPixel(image, x, y, image_pixels[cidx[cc1][cc2] - 1]); if (shapeimage) XPutPixel(shapeimage, x, y, shape_pixels[cidx[cc1][cc2] - 1]); #else SelectObject(*dc, image->bitmap); SetPixel(*dc, x, y, image_pixels[cidx[cc1][cc2] - 1]); if (shapeimage) { SelectObject(*dc, shapeimage->bitmap); SetPixel(*dc, x, y, shape_pixels[cidx[cc1][cc2] - 1]); } #endif } else { FREE_CIDX; return (XpmFileInvalid); } } else { FREE_CIDX; return (XpmFileInvalid); } } } FREE_CIDX; } break; default: /* Non-optimized case of long color * names */ { char *s; char buf[BUFSIZ]; if (cpp >= sizeof(buf)) return (XpmFileInvalid); buf[cpp] = '\0'; if (USE_HASHTABLE) { xpmHashAtom *slot; for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++) { for (a = 0, s = buf; a < cpp; a++, s++) *s = xpmGetC(data); slot = xpmHashSlot(hashtable, buf); if (!*slot) /* no color matches */ return (XpmFileInvalid); #ifndef FOR_MSW XPutPixel(image, x, y, image_pixels[HashColorIndex(slot)]); if (shapeimage) XPutPixel(shapeimage, x, y, shape_pixels[HashColorIndex(slot)]); #else SelectObject(*dc, image->bitmap); SetPixel(*dc, x, y, image_pixels[HashColorIndex(slot)]); if (shapeimage) { SelectObject(*dc, shapeimage->bitmap); SetPixel(*dc, x, y, shape_pixels[HashColorIndex(slot)]); } #endif } } } else { for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++) { for (a = 0, s = buf; a < cpp; a++, s++) *s = xpmGetC(data); for (a = 0; a < ncolors; a++) if (!strcmp(colorTable[a].string, buf)) break; if (a == ncolors) /* no color matches */ return (XpmFileInvalid); #ifndef FOR_MSW XPutPixel(image, x, y, image_pixels[a]); if (shapeimage) XPutPixel(shapeimage, x, y, shape_pixels[a]); #else SelectObject(*dc, image->bitmap); SetPixel(*dc, x, y, image_pixels[a]); if (shapeimage) { SelectObject(*dc, shapeimage->bitmap); SetPixel(*dc, x, y, shape_pixels[a]); } #endif } } } } break; } return (XpmSuccess); } motif-2.3.8/lib/Xm/VendorS.c0000644000175000017500000026355713151677246012477 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: VendorS.c /main/21 1999/08/09 10:49:41 mgreess $" #endif #endif /* Make sure all wm properties can make it out of the resource manager */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* for bzero */ #include #if defined(__APPLE__) #include #include #endif #include "BaseClassI.h" #include "CallbackI.h" #include "ExtObjectI.h" #include "MenuShellI.h" #include "MessagesI.h" #include "PixConvI.h" #include "ProtocolsI.h" #include "ResConverI.h" #include "SyntheticI.h" #include "TraitI.h" #include "TravActI.h" #include "TraversalI.h" #include "XmImI.h" #include "VendorSI.h" #include "EditresComI.h" #include "XmI.h" #ifndef NO_MESSAGE_CATALOG #if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 #endif #endif /* #define DEBUG_GRABS */ #define MSG1 _XmMMsgVendor_0000 #define MSG2 _XmMMsgVendor_0001 #define MSG3 _XmMMsgVendor_0002 #define MSG4 _XmMMsgVendor_0003 #define DONT_CARE -1 typedef struct { XmVendorShellExtObject ve ; Widget shell ; } XmDestroyGrabRec, *XmDestroyGrabList ; /******** Static Function Declarations ********/ static XtPointer BaseProc( Widget widget, XtPointer client_data) ; static Cardinal GetSecResData( WidgetClass w_class, XmSecondaryResourceData **secResDataRtn) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void SetMwmStuff( XmVendorShellExtObject ove, XmVendorShellExtObject nve) ; static void AddGrab( XmVendorShellExtObject ve, Widget shell, #if NeedWidePrototypes int exclusive, int springLoaded, #else Boolean exclusive, Boolean springLoaded, #endif /* NeedWidePrototypes */ XmVendorShellExtObject origKid) ; static void RemoveGrab( XmVendorShellExtObject ve, #if NeedWidePrototypes int being_destroyed, #else Boolean being_destroyed, #endif /* NeedWidePrototypes */ Widget shell) ; static void RemoveGrabCallback( Widget w, XtPointer client_data, XtPointer call_data) ; static void AddToGrabList( Widget parent, Widget excludedKid, Widget origKid) ; static void AddCousinsToGrabList( Widget parent, Widget excludedKid, Widget origKid) ; static Boolean IsPopupShell( Widget shell) ; static void PopupCallback( Widget shellParent, XtPointer closure, XtPointer callData) ; static void PopdownCallback( Widget shellParent, XtPointer closure, XtPointer callData) ; static Widget GetNextShell( Widget vw) ; static XmDesktopObject GetShellDesktopParent( VendorShellWidget vw, ArgList args, Cardinal *num_args) ; static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void VendorExtInitialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void MotifWarningHandler ( String name, String type, String s_class, String message, String * params, Cardinal* num_params); static void Initialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPrehook( Widget old, Widget ref, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean VendorExtSetValues( Widget old, Widget ref, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void GetValuesPrehook( Widget w, ArgList args, Cardinal *num_args) ; static void GetValuesHook( Widget w, ArgList args, Cardinal *num_args) ; static void GetValuesPosthook( Widget w, ArgList args, Cardinal *num_args) ; static void PendingTransientDestroyed( Widget vw, XtPointer cl_data, XtPointer ca_data) ; static void SetTransientFor( Widget w, XtPointer closure, XtPointer call_data) ; static void Resize( Widget w) ; static void ChangeManaged( Widget wid) ; static void UpdateCoreGeometry( VendorShellWidget vw, XmVendorShellExtObject vendorExt) ; static void Realize( Widget wid, XtValueMask *vmask, XSetWindowAttributes *attr) ; static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static XtGeometryResult RootGeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void SetMwmHints( XmVendorShellExtObject ve) ; static void SetMwmMenu( XmVendorShellExtObject ve) ; static void VendorExtRealize( Widget w, XtPointer closure, XtPointer call_data) ; static void AddDLEntry( XmVendorShellExtObject ve, Widget shell) ; static void RemoveDLEntry( unsigned pos) ; static void Destroy( Widget wid) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static XmFontList GetTable(Widget wid, XtEnum type); static XmDirection GetDirection(Widget); static void GetColors(Widget widget, XmAccessColorData color_data); static unsigned char GetUnitType(Widget); /******** End Static Function Declarations ********/ #ifdef DEBUG_GRABS static void PrintModal( XmModalData modal) ; static void PrintXmGrabs( Widget wid) ; #endif /* DEBUG_GRABS */ char _XmVersionString[] = XmVERSION_STRING ; static XmDestroyGrabList destroy_list ; static unsigned short destroy_list_size ; static unsigned short destroy_list_cnt ; static Display * _XmDisplayHandle = NULL ; static XtErrorMsgHandler previousWarningHandler = NULL; #if defined(__APPLE__) /* Hack necessary to handle Apple two-level namespaces */ extern WidgetClass vendorShellWidgetClass; /* from Xt/Vendor.c */ extern VendorShellClassRec xmVendorShellClassRec; #define vendorShellClassRec xmVendorShellClassRec __attribute__((constructor)) static void __VendorShellHack(void) { vendorShellWidgetClass = (WidgetClass)(&xmVendorShellClassRec); transientShellWidgetClass->core_class.superclass = vendorShellWidgetClass; topLevelShellWidgetClass->core_class.superclass = vendorShellWidgetClass; xmGrabShellWidgetClass->core_class.superclass = vendorShellWidgetClass; xmDragOverShellWidgetClass->core_class.superclass = vendorShellWidgetClass; } #endif /*************************************************************************** * * Vendor shell class record * ***************************************************************************/ #define Offset(field) (XtOffsetOf(WMShellRec, field)) static int default_unspecified_shell_int = XtUnspecifiedShellInt; /* * Warning, casting XtUnspecifiedShellInt (which is -1) to an (XtPointer) * can result is loss of bits on some machines (i.e. crays) */ static XtResource resources[] = { { XmNx, XmCPosition, XmRHorizontalPosition, sizeof(Position), XtOffsetOf(WidgetRec, core.x), XmRImmediate, (XtPointer) 0, }, { XmNy, XmCPosition, XmRVerticalPosition, sizeof(Position), XtOffsetOf(WidgetRec, core.y), XmRImmediate, (XtPointer) 0, }, { XmNwidth, XmCDimension, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.width), XmRImmediate, (XtPointer) 0, }, { XmNheight, XmCDimension, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.height), XmRImmediate, (XtPointer) 0, }, { XmNborderWidth, XmCBorderWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(WidgetRec, core.border_width), XmRImmediate, (XtPointer) 0, }, /* size_hints minus things stored in core */ { XmNbaseWidth, XmCBaseWidth, XmRHorizontalInt, sizeof(int), Offset(wm.base_width), XmRHorizontalInt, (XtPointer) &default_unspecified_shell_int}, { XmNbaseHeight, XmCBaseHeight, XmRVerticalInt, sizeof(int), Offset(wm.base_height), XmRVerticalInt, (XtPointer) &default_unspecified_shell_int}, { XmNminWidth, XmCMinWidth, XmRHorizontalInt, sizeof(int), Offset(wm.size_hints.min_width), XmRHorizontalInt, (XtPointer) &default_unspecified_shell_int}, { XmNminHeight, XmCMinHeight, XmRVerticalInt, sizeof(int), Offset(wm.size_hints.min_height), XmRVerticalInt, (XtPointer) &default_unspecified_shell_int}, { XmNmaxWidth, XmCMaxWidth, XmRHorizontalInt, sizeof(int), Offset(wm.size_hints.max_width), XmRHorizontalInt, (XtPointer) &default_unspecified_shell_int}, { XmNmaxHeight, XmCMaxHeight, XmRVerticalInt, sizeof(int), Offset(wm.size_hints.max_height), XmRVerticalInt, (XtPointer) &default_unspecified_shell_int}, { XmNwidthInc, XmCWidthInc, XmRHorizontalInt, sizeof(int), Offset(wm.size_hints.width_inc), XmRHorizontalInt, (XtPointer) &default_unspecified_shell_int}, { XmNheightInc, XmCHeightInc, XmRVerticalInt, sizeof(int), Offset(wm.size_hints.height_inc), XmRVerticalInt, (XtPointer) &default_unspecified_shell_int}, { XmNminAspectX, XmCMinAspectX, XmRHorizontalInt, sizeof(int), Offset(wm.size_hints.min_aspect.x), XmRHorizontalInt, (XtPointer) &default_unspecified_shell_int}, { XmNminAspectY, XmCMinAspectY, XmRVerticalInt, sizeof(int), Offset(wm.size_hints.min_aspect.y), XmRVerticalInt, (XtPointer) &default_unspecified_shell_int}, { XmNmaxAspectX, XmCMaxAspectX, XmRHorizontalInt, sizeof(int), Offset(wm.size_hints.max_aspect.x), XmRHorizontalInt, (XtPointer) &default_unspecified_shell_int}, { XmNmaxAspectY, XmCMaxAspectY, XmRVerticalInt, sizeof(int), Offset(wm.size_hints.max_aspect.y), XmRVerticalInt, (XtPointer) &default_unspecified_shell_int}, /* wm_hints */ { XmNiconPixmap, XmCIconPixmap, XmRDynamicPixmap, sizeof(Pixmap), Offset(wm.wm_hints.icon_pixmap), XmRPixmap, NULL}, { XmNiconX, XmCIconX, XmRHorizontalInt, sizeof(int), Offset(wm.wm_hints.icon_x), XmRHorizontalInt, (XtPointer) &default_unspecified_shell_int}, { XmNiconY, XmCIconY, XmRVerticalInt, sizeof(int), Offset(wm.wm_hints.icon_y), XmRVerticalInt, (XtPointer) &default_unspecified_shell_int}, { /* override dec default */ XmNinput, XmCInput, XmRBool, sizeof(Bool), Offset(wm.wm_hints.input), XmRImmediate, (XtPointer) TRUE, }, { /* override incorrect default in Shell.c */ XmNwindowGroup, XmCWindowGroup, XmRWindow, sizeof(Window), Offset(wm.wm_hints.window_group), XmRImmediate, (XtPointer)XtUnspecifiedWindowGroup, }, { /* default visual dynamically, see _XmDefaultVisualResources */ XtNvisual, XtCVisual, XtRVisual, sizeof(Visual*), XtOffsetOf(ShellRec, shell.visual), XtRImmediate, (XtPointer)INVALID_VISUAL }, }; #undef Offset static XtResource subresources[] = { { XmNtoolTipPostDelay, XmCToolTipPostDelay, XmRInt, sizeof(unsigned int), XtOffsetOf(XmToolTipConfigTraitRec, post_delay), XmRImmediate, (XtPointer) 5000, }, { XmNtoolTipPostDuration, XmCToolTipPostDuration, XmRInt, sizeof(unsigned int), XtOffsetOf(XmToolTipConfigTraitRec, post_duration), XmRImmediate, (XtPointer) 5000, }, { XmNtoolTipEnable, XmCToolTipEnable, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmToolTipConfigTraitRec, enable), XmRImmediate, (XtPointer) False, }, }; static CompositeClassExtensionRec compositeClassExtRec = { NULL, NULLQUARK, XtCompositeExtensionVersion, sizeof(CompositeClassExtensionRec), TRUE, }; static ShellClassExtensionRec shellClassExtRec = { NULL, NULLQUARK, XtShellExtensionVersion, sizeof(ShellClassExtensionRec), RootGeometryManager, }; static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), InitializePrehook, /* init prehook */ SetValuesPrehook, /* setval prehook */ InitializePosthook, /* init posthook */ SetValuesPosthook, /* setval posthook */ (WidgetClass)&xmVendorShellExtClassRec, /* secondary class */ SecondaryObjectCreate, /* secondary create */ GetSecResData, /* getSecRes data */ {0}, /* class flags */ GetValuesPrehook, /* get_values_prehook */ GetValuesPosthook, /* get_values_posthook */ }; externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = { { (WidgetClass) &wmShellClassRec, /* superclass */ "VendorShell", /* class_name */ sizeof(VendorShellRec), /* size */ ClassInitialize, /* Class Initializer */ ClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ Initialize, /* initialize */ NULL, /* initialize_hook */ Realize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ XtExposeCompressSeries, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ NULL, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ GetValuesHook, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { /* composite_class */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ (XtPointer)&compositeClassExtRec,/* extension */ }, { /* shell class */ (XtPointer)&shellClassExtRec, /* extension */ }, { /* wmshell class */ NULL, /* extension */ }, { /* vendorshell class */ NULL, /* extension */ } }; externaldef(vendorshellwidgetclass) WidgetClass vendorShellWidgetClass = (WidgetClass) (&vendorShellClassRec); /* Trait record for VendorS specify render table */ static XmConst XmSpecRenderTraitRec vsSRT = { 0, /* version */ GetTable, }; /* Trait record for VendorS specify layout direction */ static XmConst XmSpecifyLayoutDirectionTraitRec vsLDT = { 0, /* version */ GetDirection }; /* Access Colors Trait record for vendor shell */ static XmConst XmAccessColorsTraitRec vsACT = { 0, /* version */ GetColors }; /* Unit Type Trait record for VendorShell */ static XmConst XmSpecUnitTypeTraitRec vsUTT = { 0, /* version */ GetUnitType }; /************************************************************************ * * BaseProc * This function can be used to check if the widget has actually * been initialize (vs in the process of creation, like a conversion) * ************************************************************************/ /*ARGSUSED*/ static XtPointer BaseProc( Widget widget, XtPointer client_data ) /* unused */ { XmWidgetExtData extData; Widget secObj = NULL; _XmWidgetToAppContext(widget); _XmAppLock(app); if ((extData = _XmGetWidgetExtData(widget, XmSHELL_EXTENSION))) { secObj = extData->widget; } _XmAppUnlock(app); return secObj; } /************************************************************************ * * GetSecResData * ************************************************************************/ static Cardinal GetSecResData( WidgetClass w_class, XmSecondaryResourceData **secResDataRtn ) { XmBaseClassExt *bcePtr; int arrayCount = 0; String resource_class, resource_name; XtPointer client_data; _XmProcessLock(); if ((bcePtr = _XmGetBaseClassExtPtr(w_class, XmQmotif)) && (bcePtr) && (*bcePtr) && ((*bcePtr)->secondaryObjectClass)) { client_data = NULL; resource_class = NULL; resource_name = NULL; arrayCount = _XmSecondaryResourceData ( *bcePtr, secResDataRtn, client_data, resource_name, resource_class, BaseProc) ; } _XmProcessUnlock(); return arrayCount; } /************************************************************************ * * ClassInitialize * Initialize the vendorShell class structure. This is called only * the first time a vendorShell widget is created. It registers the * resource type converters unique to this class. * ************************************************************************/ static void ClassInitialize( void ) { Cardinal wc_num_res, sc_num_res; XtResource *merged_list; int i, j; XtResourceList uncompiled; Cardinal num; /************************************************************************** ShellExt's and VendorShellExt's resource lists are being merged into one and assigned to xmVendorShellExtObjectClassRec. This is for performance reasons, since, instead of two calls to XtGetSubResources() XtGetSubvaluse() and XtSetSubvalues() for both the superclass and the widget class, now we have just one call with a merged resource list. NOTE: At this point the resource lists for ShellExt and VendorShellExt do have unique entries, but if there are resources in the superclass that are being overwritten by the subclass then the merged_lists need to be created differently. ****************************************************************************/ _XmProcessLock(); wc_num_res = xmVendorShellExtClassRec.object_class.num_resources; sc_num_res = xmShellExtClassRec.object_class.num_resources; merged_list = (XtResource *)XtMalloc((sizeof(XtResource) * (wc_num_res + sc_num_res))); _XmTransformSubResources(xmShellExtClassRec.object_class.resources, sc_num_res, &uncompiled, &num); for (i = 0; i < num; i++) { merged_list[i] = uncompiled[i]; } _XmProcessUnlock(); _XmProcessLock(); for (i = 0, j = num; i < wc_num_res; i++, j++) { merged_list[j] = xmVendorShellExtClassRec.object_class.resources[i]; } _XmProcessUnlock(); _XmProcessLock(); xmVendorShellExtClassRec.object_class.resources = merged_list; xmVendorShellExtClassRec.object_class.num_resources = wc_num_res + sc_num_res ; _XmProcessUnlock(); _XmRegisterConverters(); _XmRegisterPixmapConverters(); _XmInitializeExtensions(); _XmInitializeTraits(); { XtProc class_initialize; _XmProcessLock(); class_initialize = xmVendorShellExtObjectClass->core_class.class_initialize; _XmProcessUnlock(); (*class_initialize) (); } baseClassExtRec.record_type = XmQmotif; _XmBuildExtResources((WidgetClass) baseClassExtRec.secondaryObjectClass); _XmProcessLock(); if (((XmShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->desktop_class.insert_child == XtInheritInsertChild) ((XmShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->desktop_class.insert_child = ((XmShellExtObjectClass) xmDesktopClass)->desktop_class.insert_child; if (((XmShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->desktop_class.delete_child == XtInheritDeleteChild) ((XmShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->desktop_class.delete_child = ((XmShellExtObjectClass) xmDesktopClass)->desktop_class.delete_child; if (((XmShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->shell_class.structureNotifyHandler == XmInheritEventHandler) ((XmShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->shell_class.structureNotifyHandler = ((XmShellExtObjectClass) xmShellExtObjectClass)->shell_class.structureNotifyHandler; if (((XmVendorShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->vendor_class.offset_handler == XmInheritProtocolHandler) ((XmVendorShellExtObjectClass)baseClassExtRec.secondaryObjectClass)->vendor_class.offset_handler = ((XmVendorShellExtObjectClass) xmVendorShellExtObjectClass)->vendor_class.offset_handler; _XmProcessUnlock(); XtFree((char *)uncompiled); #ifndef NO_MESSAGE_CATALOG Xm_catd = catopen("Xm", NL_CAT_LOCALE); #endif } /************************************************************************ * * ClassPartInitialize * Set up the inheritance mechanism for the routines exported by * vendorShells class part. * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { CompositeWidgetClass compWc = (CompositeWidgetClass)wc; CompositeClassExtensionRec **compExtPtr; XmBaseClassExt *wcePtr, *scePtr; XmVendorShellWidgetClass vc = (XmVendorShellWidgetClass) wc; CompositeWidgetClass superWc; _XmProcessLock(); superWc = (CompositeWidgetClass)wc->core_class.superclass; _XmProcessUnlock(); wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); _XmProcessLock(); scePtr = _XmGetBaseClassExtPtr(wc->core_class.superclass, XmQmotif); if ( (vc != (XmVendorShellWidgetClass)vendorShellWidgetClass) && scePtr && *scePtr && (*wcePtr)->secondaryObjectClass != NULL && ((*scePtr)->secondaryObjectClass != (*wcePtr)->secondaryObjectClass)){ XmVendorShellExtObjectClass wceClass, sceClass; wceClass = (XmVendorShellExtObjectClass)(*wcePtr)-> secondaryObjectClass; sceClass = (XmVendorShellExtObjectClass)(*scePtr)-> secondaryObjectClass; _XmBuildExtResources((WidgetClass) (*wcePtr)->secondaryObjectClass); if (wceClass->desktop_class.insert_child == XtInheritInsertChild) wceClass->desktop_class.insert_child = sceClass->desktop_class.insert_child; if (wceClass->desktop_class.delete_child == XtInheritDeleteChild) wceClass->desktop_class.delete_child = sceClass->desktop_class.delete_child; if (wceClass->shell_class.structureNotifyHandler == XmInheritEventHandler) wceClass->shell_class.structureNotifyHandler = sceClass->shell_class.structureNotifyHandler; if (wceClass->vendor_class.offset_handler == XmInheritProtocolHandler) wceClass->vendor_class.offset_handler = sceClass->vendor_class.offset_handler; } compExtPtr = (CompositeClassExtensionRec **) &(compWc->composite_class.extension); _XmProcessUnlock(); compExtPtr = (CompositeClassExtensionRec **) _XmGetClassExtensionPtr( (XmGenericClassExt *) compExtPtr, NULLQUARK); if (*compExtPtr == NULL) { CompositeClassExtensionRec **superExtPtr; _XmProcessLock(); superExtPtr = (CompositeClassExtensionRec **) &(superWc->composite_class.extension); _XmProcessUnlock(); superExtPtr = (CompositeClassExtensionRec **) _XmGetClassExtensionPtr( (XmGenericClassExt *) superExtPtr, NULLQUARK); *compExtPtr = XtNew(CompositeClassExtensionRec); memcpy((char*)*compExtPtr, (char*)*superExtPtr, sizeof(CompositeClassExtensionRec)); } /* Do this here because of bug in Xt */ _XmProcessLock(); wc->core_class.expose = Redisplay; _XmProcessUnlock(); /* Install the render table trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTspecifyRenderTable, (XtPointer)&vsSRT); /* Install the direction trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTspecifyLayoutDirection, (XtPointer)&vsLDT); /* Install the accessColors trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTaccessColors, (XtPointer)&vsACT); /* Install the unit type trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTspecifyUnitType, (XtPointer)&vsUTT); } /************************************************************************ * * SetMwmStuff * ov will be null when called from Initialize * ************************************************************************/ static void SetMwmStuff( XmVendorShellExtObject ove, XmVendorShellExtObject nve ) { Boolean changed = FALSE; Widget extParent = nve->ext.logicalParent; if (!ove || (ove->vendor.mwm_menu != nve->vendor.mwm_menu)) { /* make mwm_menu local */ if (ove && ove->vendor.mwm_menu) XtFree(ove->vendor.mwm_menu); if (nve->vendor.mwm_menu) nve->vendor.mwm_menu = XtNewString(nve->vendor.mwm_menu); if (XtIsRealized(extParent)) SetMwmMenu(nve); } if (!ove || (ove->vendor.mwm_hints.functions != nve->vendor.mwm_hints.functions)) { if (nve->vendor.mwm_hints.functions == DONT_CARE) nve->vendor.mwm_hints.flags &= ~MWM_HINTS_FUNCTIONS; else nve->vendor.mwm_hints.flags |= MWM_HINTS_FUNCTIONS; changed |= TRUE; } if (!ove || (ove->vendor.mwm_hints.decorations != nve->vendor.mwm_hints.decorations)) { if (nve->vendor.mwm_hints.decorations == DONT_CARE) nve->vendor.mwm_hints.flags &= ~MWM_HINTS_DECORATIONS; else nve->vendor.mwm_hints.flags |= MWM_HINTS_DECORATIONS; changed |= TRUE; } if (!ove || (ove->vendor.mwm_hints.input_mode != nve->vendor.mwm_hints.input_mode)) { if (nve->vendor.mwm_hints.input_mode == DONT_CARE) nve->vendor.mwm_hints.flags &= ~MWM_HINTS_INPUT_MODE; else nve->vendor.mwm_hints.flags |= MWM_HINTS_INPUT_MODE; changed |= TRUE; } if (changed && XtIsRealized(extParent)) SetMwmHints(nve); } /* The AddGrab and RemoveGrab routines manage a virtual Xt modal * cascade that allows us to remove entries in the list without * flushing out the grabs of all following entries. */ void _XmAddGrab( Widget wid, #if NeedWidePrototypes int exclusive, int spring_loaded) #else Boolean exclusive, Boolean spring_loaded) #endif /* NeedWidePrototypes */ { AddGrab( NULL, wid, exclusive, spring_loaded, NULL) ; } void _XmRemoveGrab( Widget wid) { RemoveGrab( NULL, FALSE, wid) ; } static void AddGrab( XmVendorShellExtObject ve, Widget shell, #if NeedWidePrototypes int exclusive, int springLoaded, #else Boolean exclusive, Boolean springLoaded, #endif /* NeedWidePrototypes */ XmVendorShellExtObject origKid ) { Cardinal position; XmModalData modals; XmDisplay xmDisplay; if( shell == NULL ) { shell = ve->ext.logicalParent ; } xmDisplay = (XmDisplay) XmGetXmDisplay(XtDisplay(shell)); modals = xmDisplay->display.modals; position = xmDisplay->display.numModals; if (xmDisplay->display.numModals == xmDisplay->display.maxModals) { /* Allocate more space */ xmDisplay->display.maxModals += (xmDisplay->display.maxModals / 2) + 2; xmDisplay->display.modals = modals = (XmModalData) XtRealloc((char *) modals, (unsigned) ((xmDisplay->display.maxModals) * sizeof(XmModalDataRec))); } modals[position].wid = shell; modals[position].ve = ve; modals[position].grabber = origKid; modals[position].exclusive = exclusive; modals[position].springLoaded = springLoaded; xmDisplay->display.numModals++; XtAddGrab((Widget) shell, exclusive, springLoaded); #ifdef DEBUG_GRABS printf( "AddGrab: XtAddGrab( %s, excl: %d, spring: %d); grabber: %s\n", shell->core.name, exclusive, springLoaded, origKid ? origKid->ext.logicalParent->core.name : "NULL") ; #endif /* If the shell gets destroyed, we don't have to worry about removing * the Xt grab, but we do have to remove the ve from the list of modals. * Should the client_data be ve or origKid? */ XtAddCallback((Widget) shell, XmNdestroyCallback, RemoveGrabCallback,(XtPointer)ve); } /* * we add a new argument here, being_destroyed. If true, it means that * we are being called from a callback triggered by the destruction of a * shell. If it is true, we should remove shells from the list of modals, * but we should not call XtRemoveGrab on them, because the intrinsics * already handle that. */ static void RemoveGrab( XmVendorShellExtObject ve, #if NeedWidePrototypes int being_destroyed, #else Boolean being_destroyed, #endif /* NeedWidePrototypes */ Widget shell) { XmDisplay xmDisplay; Cardinal incr, i, numRemoves, numModals; XmModalData modals; if( !being_destroyed ) { /* The "shell" argument of this routine is required when the * "being_destroyed" argument is TRUE, since the vendor * extension record may be already de-allocated before the * RemoveGrabCallback is called, and thus cannot be de-referenced * to get the shell logical parent. We will assume that the * shell argument is ignored by callers when the "being_destroyed" * argument is FALSE. */ if( shell == NULL ) { shell = ve->ext.logicalParent ; } XtRemoveCallback( shell, XmNdestroyCallback, RemoveGrabCallback, (XtPointer) ve) ; } #ifdef DEBUG_GRABS printf( "\n**** Entering RemoveGrab on %s (0x%x) ****\n", shell->core.name, ve) ; PrintXmGrabs( (Widget) shell) ; #endif xmDisplay = (XmDisplay) XmGetXmDisplay(XtDisplay(shell)); modals = xmDisplay->display.modals; numModals = xmDisplay->display.numModals; for (i = 0, numRemoves = 0; i < numModals; i++) { if( (modals[i].wid == shell) && (modals[i].ve == ve) ) numRemoves++; } #ifdef DEBUG_GRABS printf( "RemoveGrab: numRemoves: %d\n", numRemoves) ; #endif if (numRemoves == 0) return; if (!being_destroyed) for (i = 0; i < numRemoves; i++) { XtRemoveGrab((Widget) shell); #ifdef DEBUG_GRABS printf( "RemoveGrab: XtRemoveGrab( %s)\n", ((Widget)shell)->core.name) ; #endif } /* Add back all the grabs that were flushed by the removes */ /* ** What this piece of code is trying to do is to iterate over the list, ** and for each item to be removed, skip ahead and find a good one to ** replace it with. "incr" being set below indicates that a replacement ** in fact was found. ** However, the code is not obviously replacing items that are to be ** discarded; rather, it's simply letting them fall off the end via ** the magic of the combination of i, incr, numRemoves, and numModals ** incr should probably be absolute w.r.t. the front of the list and ** should not double as a marker. ** It's easy to know where the first removed item was, and ** to add the grabs back in to later widgets. ** As is, it's not obvious when modals[i] is to be overwritten. */ for (i = 0, incr = 0; (i + numRemoves) < numModals; i++) { /* We remove both the shell that's being pulled off the * cascade and any raw mode shells that we've added. These * should only be the app shells ?! */ for (/*EMPTY*/; ((i + incr) < numModals); incr++) { Widget incrWid = modals[i+incr].wid; /* if it's not the shell, or it is the shell but some other entry for another grab */ if ( (incrWid != shell) || (modals[i+incr].ve != ve) ) { if ((ve != NULL) && (modals[i+incr].grabber == ve)) { /* Avoid re-adding to the grab list widgets * that were non-exclusives associated with * the shell grab being removed. */ numRemoves++; } else break; } } if (incr && ((i+incr) < numModals)) { modals[i] = modals[i+incr]; if (!(modals[i].wid->core.being_destroyed)) { XtAddGrab( modals[i].wid, modals[i].exclusive, modals[i].springLoaded) ; #ifdef DEBUG_GRABS printf( "RemoveGrab: XtAddGrab( %s, excl: %d, spring: %d)\n", modals[i].wid->core.name, modals[i].exclusive, modals[i].springLoaded) ; #endif } } } xmDisplay->display.numModals -= numRemoves ; #ifdef DEBUG_GRABS printf( "\n**** Leaving RemoveGrab on %s (0x%x) ****\n", shell->core.name, ve) ; PrintXmGrabs( (Widget) shell) ; #endif } /* ARGSUSED */ static void RemoveGrabCallback( Widget w, XtPointer client_data, XtPointer call_data ) { if( XmIsVendorShell( w) ) { /* For VendorShells, defer the removal of the grab until after * all destroy callbacks are completed, since the order of * these callbacks can result in a situation where an * Xt-invoked grab removal can strip "new" grabs which are * installed in the RemoveGrab routine. */ AddDLEntry( (XmVendorShellExtObject) client_data, w) ; } else { /* Nested calls to _XmAddGrab of non-VendorShell widgets * are problematic, since the use of the Destroy method * to ensure that the XtRemoveGrabs are completed before * the Xm RemoveGrabs, cannot be employed for these widgets. */ RemoveGrab( (XmVendorShellExtObject) client_data, TRUE, w) ; } } static void AddToGrabList( Widget parent, Widget excludedKid, Widget origKid ) { Widget *currKid; Widget *children; Cardinal numChildren; Cardinal i; if (!parent) return; else if (XmIsScreen(parent)) { XmScreen xmScreen = (XmScreen)parent; children = xmScreen->desktop.children; numChildren = xmScreen->desktop.num_children; } else if (XmIsDisplay(parent)) { XmDisplay xmDisplay = (XmDisplay)parent; children = (Widget *)xmDisplay->composite.children; numChildren = xmDisplay->composite.num_children; } else { XmDesktopObject deskObj = (XmDesktopObject)parent; children = (Widget *)deskObj->desktop.children; numChildren = deskObj->desktop.num_children; } for (i = 0, currKid = children; i < numChildren; currKid++, i++) { if (*currKid != excludedKid) { if (!XmIsDisplay(parent)) { ShellWidget shell; shell = (ShellWidget) ((XmDesktopObject)(*currKid))->ext.logicalParent; if( shell->shell.popped_up || ( XtIsRealized((Widget)shell) && !IsPopupShell( (Widget) shell)) ) AddGrab((XmVendorShellExtObject)*currKid, NULL, (Boolean)False, (Boolean)False, (XmVendorShellExtObject)origKid); } else if (!XmIsScreen(*currKid)) /* * Don't traverse down non-Screen children of * XmDisplay widgets. */ continue; AddToGrabList(*currKid, NULL, origKid); } } } static void AddCousinsToGrabList( Widget parent, Widget excludedKid, Widget origKid ) { Widget grandParent; if (!parent) return; else if (XmIsScreen(parent)) { XmScreen xmScreen = (XmScreen)parent; grandParent = XtParent(xmScreen); } else if (XmIsDisplay(parent)) { grandParent = NULL; } else { XmDesktopObject deskObj = (XmDesktopObject)parent; grandParent = deskObj->desktop.parent; } AddToGrabList(parent, excludedKid, origKid); AddCousinsToGrabList(grandParent, parent, origKid); } static Boolean IsPopupShell( Widget shell) { Widget parent = XtParent( shell) ; if( parent != NULL ) { Widget *ps_list = parent->core.popup_list ; unsigned n_psl = parent->core.num_popups ; while( n_psl-- ) { if( ps_list[n_psl] == shell ) { return TRUE ; } } } return FALSE ; } /************************************************************************ * * PopupCallback * ************************************************************************/ /*ARGSUSED*/ static void PopupCallback( Widget shellParent, XtPointer closure, XtPointer callData ) /* unused */ { XmVendorShellExtObject ve = (XmVendorShellExtObject)closure; XtGrabKind grab_kind = XtGrabNone; Boolean grabCousins = False; XmScreen xmScreen; xmScreen = (XmScreen) XmGetXmScreen(XtScreen(shellParent)); ve->vendor.xAtMap = shellParent->core.x; ve->vendor.yAtMap = shellParent->core.y; /* * work around broken Xt spec ordering for realize and popup callback */ if (!XtIsRealized(shellParent)) XtRealizeWidget(shellParent); /* * get the request num + 1 Since it's a map raised. This will * only work when the hierarchy is already realized, i.e. after * first time */ ve->vendor.lastMapRequest = NextRequest(XtDisplay(shellParent)) + 1; switch (ve->vendor.mwm_hints.input_mode) { case DONT_CARE: case MWM_INPUT_MODELESS: grab_kind = XtGrabNonexclusive; break ; case MWM_INPUT_PRIMARY_APPLICATION_MODAL: /* * if we're not running mwm then this becomes full app modal */ if (xmScreen->screen.mwmPresent) grabCousins = True; grab_kind = XtGrabExclusive; break; case MWM_INPUT_SYSTEM_MODAL: case MWM_INPUT_FULL_APPLICATION_MODAL: grab_kind = XtGrabExclusive; break; default: break; } if (grab_kind == XtGrabExclusive) { Cardinal numModals; XmModalData modals; XmDisplay xmDisplay; int i; xmDisplay = (XmDisplay) XmGetXmDisplay(XtDisplay(shellParent)); modals = xmDisplay->display.modals; numModals = xmDisplay->display.numModals; for (i=0; i menu_shell_class.popdownOne))(modals[i].wid, NULL, NULL, NULL); else if (xmDragContextClass == XtClass((Widget) modals[i].wid)) XmDragCancel((Widget) modals[i].wid); } } if (grab_kind != XtGrabNone) AddGrab(ve, NULL, (grab_kind == XtGrabExclusive), False, ve); ve->vendor.grab_kind = grab_kind; if (grabCousins) AddCousinsToGrabList((Widget)ve->desktop.parent, (Widget)ve, (Widget)ve); #ifdef DEBUG_GRABS printf( "\n**** After popup: ****\n") ; PrintXmGrabs( shellParent) ; #endif } /************************************************************************ * * PopdownCallback * ************************************************************************/ /*ARGSUSED*/ static void PopdownCallback( Widget shellParent, /* unused */ XtPointer closure, XtPointer callData ) /* unused */ { XmVendorShellExtObject ve = (XmVendorShellExtObject)closure; if (ve->vendor.grab_kind != XtGrabNone) RemoveGrab(ve, False, NULL); #ifdef DEBUG_GRABS printf( "\n**** After popdown: ****\n" ) ; PrintXmGrabs( shellParent) ; #endif } static Widget GetNextShell( Widget vw ) { Widget parent; parent = XtParent(vw); while (parent && !XmIsVendorShell(parent)) parent = XtParent(parent); return parent; } /*ARGSUSED*/ static XmDesktopObject GetShellDesktopParent( VendorShellWidget vw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { Widget transientParent = NULL; XmDesktopObject desktopParent = NULL; if (vw->wm.transient) { if (XtIsSubclass((Widget) vw, transientShellWidgetClass)) { TransientShellWidget tw = (TransientShellWidget)vw; if (!(transientParent = tw->transient.transient_for)) { tw->transient.transient_for = transientParent = GetNextShell( (Widget) vw); } } else { transientParent = GetNextShell((Widget) vw); } } if (transientParent) { XmWidgetExtData extData; if (XmIsVendorShell(transientParent)) { extData = _XmGetWidgetExtData(transientParent, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return desktopParent; } else { desktopParent = (XmDesktopObject)extData->widget; } } } else if (!XmIsDisplay((Widget)vw)) { desktopParent = (XmDesktopObject) XmGetXmScreen(XtScreen((Widget)vw)); } return desktopParent; } /************************************************************************ * * DisplayClosedCallback * ************************************************************************/ /*ARGSUSED*/ static void DisplayClosedCallback( Widget shellParent, /* unused */ XtPointer closure, XtPointer callData ) /* unused */ { _XmProcessLock(); _XmDisplayHandle = NULL; _XmProcessUnlock(); } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /* ARGSUSED */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *pePtr; WidgetClass vec; XmDesktopObject desktopParent; Cardinal size; XtPointer newSec, reqSec; XmWidgetExtData extData; _XmProcessLock(); if (!_XmDisplayHandle) { XmDisplay xmDisplay; if ((xmDisplay = (XmDisplay)XmGetXmDisplay(XtDisplay(new_w))) != NULL) XtAddCallback((Widget)xmDisplay, XmNdestroyCallback, DisplayClosedCallback, NULL); } _XmDisplayHandle = XtDisplay(new_w); _XmProcessUnlock(); desktopParent = GetShellDesktopParent( (VendorShellWidget) new_w, args, num_args) ; if (desktopParent) { /* * if the secondary object is using sub_resources then * create it as a child of the shell. Otherwise try to * create it as a sibling in order to fake out resource path */ _XmProcessLock(); pePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); vec = (*pePtr)->secondaryObjectClass; _XmProcessLock(); size = vec->core_class.widget_size; _XmProcessUnlock(); newSec = XtMalloc(size); reqSec = _XmExtObjAlloc(size); _XmProcessUnlock(); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; ((XmVendorShellExtObject)newSec)->ext.extensionType = XmSHELL_EXTENSION; ((XmVendorShellExtObject)newSec)->ext.logicalParent = new_w; ((XmVendorShellExtObject)newSec)->desktop.parent = (Widget) desktopParent; _XmProcessLock(); ((XmVendorShellExtObject)newSec)->object.widget_class = vec; _XmProcessUnlock(); ((XmVendorShellExtObject)newSec)->object.parent = new_w; _XmPushWidgetExtData(new_w, extData, ((XmVendorShellExtObject)newSec)->ext.extensionType); /* * fetch the resources in superclass to subclass order */ _XmProcessLock(); XtGetSubresources(new_w, newSec, NULL, NULL, vec->core_class.resources, vec->core_class.num_resources, args, *num_args ); _XmProcessUnlock(); memcpy(reqSec, newSec, size); _XmExtImportArgs((Widget)newSec, args, num_args); { XtInitProc initialize; _XmProcessLock(); initialize = xmDesktopClass->core_class.initialize; _XmProcessUnlock(); (*initialize)((Widget)reqSec, (Widget)newSec, args, num_args); } } } /************************************************************************ * * InitializePrehook * ************************************************************************/ /* ARGSUSED */ static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *cePtr; XtInitProc secondaryCreate; XmToolTipConfigTrait ttp; /* ToolTip pointer */ XmToolTipConfigTraitRec base; ttp = (XmToolTipConfigTrait) XmeTraitGet (new_w, XmQTtoolTipConfig); if (ttp == NULL) { ttp = (XmToolTipConfigTrait) XtMalloc (sizeof (XmToolTipConfigTraitRec)); ttp->post_delay = 5000; ttp->post_duration = 5000; ttp->enable = False; ttp->timer = (int) NULL; ttp->duration_timer = (int) NULL; ttp->leave_time = 0; ttp->slider = ttp->label = NULL; XtGetSubresources(new_w, &base, NULL, NULL, subresources, XtNumber(subresources), args, *num_args); ttp->post_delay = base.post_delay; ttp->post_duration = base.post_duration; ttp->enable = base.enable; XmeTraitSet ((XtPointer) new_w, XmQTtoolTipConfig, (XtPointer) ttp); } cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); if ((secondaryCreate = (*cePtr)->secondaryObjectCreate) != NULL) (*secondaryCreate)(req, new_w, args, num_args); } /************************************************************************ * * VendorExtInitialize * ************************************************************************/ /*ARGSUSED*/ static void VendorExtInitialize( Widget req, Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { enum { XmA_MOTIF_WM_OFFSET, XmA_MOTIF_WM_MESSAGES, XmAWM_DELETE_WINDOW, NUM_ATOMS }; static char *atom_names[] = { _XA_MOTIF_WM_OFFSET, _XA_MOTIF_WM_MESSAGES, XmIWM_DELETE_WINDOW }; XmFontList defaultFont; XmVendorShellExtObject ve; XmVendorShellExtObject req_ve; XmVendorShellExtObjectClass vec = (XmVendorShellExtObjectClass) XtClass(new_w); Atom atoms[XtNumber(atom_names)]; XtCallbackProc delete_window_handler; Widget extParent; XmShellExtObjectClass sec = (XmShellExtObjectClass) XtClass(new_w); XtEventHandler handler; ve = (XmVendorShellExtObject) new_w; req_ve = (XmVendorShellExtObject) req; ve->shell.lastConfigureRequest = 0; extParent = ve->ext.logicalParent; /* add the handler for tracking whether the hierarchy has focus */ XtInsertEventHandler(extParent, (EventMask)FocusChangeMask | EnterWindowMask | LeaveWindowMask, FALSE, _XmTrackShellFocus, (XtPointer)new_w, XtListHead); _XmProcessLock(); handler = sec->shell_class.structureNotifyHandler; _XmProcessUnlock(); if (handler) { XtInsertEventHandler(extParent, (EventMask) StructureNotifyMask, TRUE, handler, (XtPointer)new_w, XtListHead); } #ifdef DEBUG else XtError("No structure notify handler for shell"); #endif /* DEBUG */ ve->vendor.lastOffsetSerial = ve->vendor.lastMapRequest = 0; ve->vendor.xAtMap = ve->vendor.yAtMap = ve->vendor.xOffset = ve->vendor.yOffset = 0; _XmAddCallback((InternalCallbackList *) &(ve->vendor.realize_callback), VendorExtRealize, NULL); ve->vendor.externalReposition = False; extParent = ve->ext.logicalParent; ve->vendor.focus_data = (XmFocusData) _XmCreateFocusData(); switch (ve->vendor.delete_response){ case XmUNMAP: case XmDESTROY: case XmDO_NOTHING: break; default: XmeWarning(new_w, MSG1); ve->vendor.delete_response = XmDESTROY; } XtAddCallback(extParent, XmNpopupCallback, PopupCallback,(XtPointer)new_w); XtAddCallback(extParent, XmNpopdownCallback, PopdownCallback,(XtPointer)new_w); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(extParent), atom_names, XtNumber(atom_names), FALSE, atoms); XmAddWMProtocols(extParent, &atoms[XmA_MOTIF_WM_MESSAGES], 1); XmAddProtocols(extParent, atoms[XmA_MOTIF_WM_MESSAGES], &atoms[XmA_MOTIF_WM_OFFSET], 1); _XmProcessLock(); XmAddProtocolCallback( extParent, atoms[XmA_MOTIF_WM_MESSAGES], atoms[XmA_MOTIF_WM_OFFSET], vec->vendor_class.offset_handler, (XtPointer) ve); _XmProcessUnlock(); /* * add deleteWindow stuff */ XmAddWMProtocols(extParent, &atoms[XmAWM_DELETE_WINDOW], 1); /* add a post hook for delete response */ _XmProcessLock(); delete_window_handler = vec->vendor_class.delete_window_handler; _XmProcessUnlock(); XmSetWMProtocolHooks( extParent, atoms[XmAWM_DELETE_WINDOW], NULL, NULL, delete_window_handler, (XtPointer) ve); /* initialize the old_managed field for focus change tracking */ ve->vendor.old_managed = NULL; /* initialize the mwm_hints flags */ ve->vendor.mwm_hints.flags = 0; SetMwmStuff( NULL, (XmVendorShellExtObject) new_w); if ((ve->vendor.focus_policy != XmEXPLICIT) && (ve->vendor.focus_policy != XmPOINTER)) { ve->vendor.focus_policy = XmEXPLICIT; } /* initialize input manager resources */ ve->vendor.input_method_string = XtNewString(req_ve->vendor.input_method_string); ve->vendor.preedit_type_string = XtNewString(req_ve->vendor.preedit_type_string); defaultFont = ve->vendor.button_font_list; if ( !defaultFont ) { defaultFont = ve->vendor.default_font_list; /* backward compatibility */ if ( !defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) extParent, XmBUTTON_FONTLIST); } ve->vendor.button_font_list = XmFontListCopy (defaultFont); defaultFont = ve->vendor.label_font_list; if ( !defaultFont ) { defaultFont = ve->vendor.default_font_list; /* backward compatibility */ if ( !defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) extParent, XmLABEL_FONTLIST); } ve->vendor.label_font_list = XmFontListCopy (defaultFont); defaultFont = ve->vendor.text_font_list; if ( !defaultFont ) { defaultFont = ve->vendor.default_font_list; /* backward compatibility */ if ( !defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) extParent, XmTEXT_FONTLIST); } ve->vendor.text_font_list = XmFontListCopy (defaultFont); ve->vendor.im_height = 0; ve->vendor.im_vs_height_set = False; ve->vendor.im_info = NULL; ve->vendor.label = NULL; ve->vendor.slider = NULL; ve->vendor.timer = (XtIntervalId)0; ve->vendor.duration_timer = (XtIntervalId)0; ve->vendor.leave_time = (Time)0; } /************************************************************************ * MotifWarningHandler * Build up a warning message and print it * Code which used to be directly in _XmWarning. * ************************************************************************/ static void MotifWarningHandler (String name, String type, String s_class, String message, String * params, Cardinal* num_params) { char buf[1024], buf2[1024], header[200], *bp, *newline_pos; int pos; if (!(params && num_params && (*num_params > 0) && (params[*num_params-1] == XME_WARNING)) && previousWarningHandler) { /* We assume it is not coming from our XmeWarning function */ /* call the previous Warning handler */ (*previousWarningHandler) (name, type, s_class, message, params, num_params); return; } XtGetErrorDatabaseText(name, type, s_class, message, buf2, 1024); XtGetErrorDatabaseText("motif", "header", "Motif", _XmMMsgMotif_0000, header, 200); sprintf(buf, header, name, s_class); if (num_params && *num_params > 1) { int i = *num_params-1; char *par[10]; if (i > 10) i = 10; memcpy((char*)par, (char*)params, i * sizeof(String)); bzero((char *)&par[i], (10-i) * sizeof(String)); (void) sprintf(&buf[strlen(buf)], buf2, par[0], par[1], par[2], par[3], par[4], par[5], par[6], par[7], par[8], par[9]); } else strcat(buf, buf2); pos = 0; bp = buf; do { newline_pos = strchr (bp, '\n'); if (newline_pos == NULL) { strcpy (&buf2[pos], bp); pos += strlen (bp); } else { strncpy (&buf2[pos], bp, (int) (newline_pos - bp + 1)); pos += (int) (newline_pos - bp + 1); bp += (int) (newline_pos - bp + 1); strcpy (&buf2[pos], " "); pos += 4; } } while (newline_pos != NULL); buf2[pos] = '\n'; buf2[++pos] = '\0'; XtWarning(buf2); } /************************************************************************ * * Initialize * ************************************************************************/ /* ARGSUSED */ static void Initialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { VendorShellWidget vw = (VendorShellWidget)new_w; XmWidgetExtData extData; if ((extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION)) != NULL) { VendorExtInitialize(extData->reqWidget, extData->widget, args, num_args); } /* get reasonable defaults for visual, depth and colormap */ _XmDefaultVisualResources(new_w); /* Keep count of the number of VendorShells. When it reaches zero * we will destroy the XmDisplay object in Destroy() */ if (!XmIsDisplay(new_w)) { XmDisplay xmDisplay = (XmDisplay) XmGetXmDisplay (XtDisplay(new_w)); xmDisplay->display.shellCount += 1; #ifdef HAVE_LIBXMU XtAddEventHandler(new_w, (EventMask)0, True, (XtEventHandler)_XmEditResCheckMessages, NULL); #endif } /* install the Motif warning handler that works with XmeWarning */ _XmProcessLock(); if (!previousWarningHandler) previousWarningHandler = XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(new_w), MotifWarningHandler); _XmProcessUnlock(); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /* ARGSUSED */ static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; if ((ext = _XmGetWidgetExtData(new_w, XmSHELL_EXTENSION)) != NULL) { _XmProcessLock(); _XmExtObjFree((XtPointer) ext->reqWidget); ext->reqWidget = NULL; _XmProcessUnlock(); /* extData gets freed at destroy */ } } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static Boolean SetValuesPrehook( Widget old, Widget ref, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData oldExtData, newExtData; XmBaseClassExt *cePtr; WidgetClass ec; Cardinal extSize; cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); ec = (*cePtr)->secondaryObjectClass; _XmProcessLock(); extSize = ec->core_class.widget_size; _XmProcessUnlock(); oldExtData = _XmGetWidgetExtData(new_w, XmSHELL_EXTENSION); newExtData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); if (oldExtData && newExtData) { _XmPushWidgetExtData(new_w, newExtData, XmSHELL_EXTENSION); newExtData->widget = oldExtData->widget; _XmProcessLock(); newExtData->oldWidget = (Widget) _XmExtObjAlloc(extSize); memcpy((char *)newExtData->oldWidget, (char *)oldExtData->widget, extSize); _XmProcessUnlock(); _XmProcessLock(); XtSetSubvalues(oldExtData->widget, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmProcessUnlock(); _XmProcessLock(); newExtData->reqWidget = (Widget) _XmExtObjAlloc(extSize); memcpy((char *)newExtData->reqWidget, (char *)oldExtData->widget, extSize); _XmProcessUnlock(); /* Convert the necessary fields from unit values to pixel values */ _XmProcessLock(); oldExtData->widget->core.widget_class = ec; _XmProcessUnlock(); _XmExtImportArgs(oldExtData->widget, args, num_args); } return FALSE; } /************************************************************************ * * SetValues * ************************************************************************/ /* ARGSUSED */ static Boolean VendorExtSetValues( Widget old, Widget ref, Widget new_w, ArgList args, Cardinal *num_args ) { XmVendorShellExtPartPtr ove, nve; XmVendorShellExtObject ov = (XmVendorShellExtObject) old; XmVendorShellExtObject nv = (XmVendorShellExtObject) new_w; XmFontList defaultFont; ove = (XmVendorShellExtPartPtr) &(ov->vendor); nve = (XmVendorShellExtPartPtr) &(nv->vendor); switch (nve->delete_response) { case XmUNMAP: case XmDESTROY: case XmDO_NOTHING: break; default: XmeWarning(new_w, MSG1); nve->delete_response = XmDESTROY; } if ((nve->focus_policy != XmEXPLICIT) && (nve->focus_policy != XmPOINTER)) { nve->focus_policy = ove->focus_policy; } if (nve->focus_policy != ove->focus_policy) { _XmFocusModelChanged( nv->ext.logicalParent, NULL, (XtPointer)(unsigned long)nve->focus_policy ); } SetMwmStuff(ov, nv); if (nve->input_method_string != ove->input_method_string) { XtFree(ove->input_method_string); nve->input_method_string = XtNewString(nve->input_method_string); } if (nve->preedit_type_string != ove->preedit_type_string) { XtFree(ove->preedit_type_string); nve->preedit_type_string = XtNewString(nve->preedit_type_string); } if (nve->button_font_list != ove->button_font_list) { XmFontListFree(ove->button_font_list); defaultFont = nve->button_font_list; if (!defaultFont) { defaultFont = nve->default_font_list; if (!defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) new_w, XmBUTTON_FONTLIST); } nve->button_font_list = XmFontListCopy (defaultFont); } if (nve->label_font_list != ove->label_font_list) { XmFontListFree(ove->label_font_list); defaultFont = nve->label_font_list; if (!defaultFont) { defaultFont = nve->default_font_list; if (!defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) new_w, XmLABEL_FONTLIST); } nve->label_font_list = XmFontListCopy (defaultFont); } if (nve->text_font_list != ove->text_font_list) { XmFontListFree(ove->text_font_list); defaultFont = nve->text_font_list; if (!defaultFont) { defaultFont = nve->default_font_list; if (!defaultFont ) defaultFont = XmeGetDefaultRenderTable( (Widget) new_w, XmTEXT_FONTLIST); } nve->text_font_list = XmFontListCopy (defaultFont); } if (nve->input_policy != ove->input_policy) { switch (nve->input_policy) { case XmPER_SHELL: case XmPER_WIDGET: break; default: XmeWarning(new_w, MSG2); nve->input_policy = ove->input_policy; } } if (nve->layout_direction != ove->layout_direction) { XmeWarning(new_w, MSG3); nve->layout_direction = ove->layout_direction; } return FALSE; } /************************************************************************ * * SetValues * ************************************************************************/ static Boolean SetValues( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { VendorShellWidget vw = (VendorShellWidget)new_w; XmWidgetExtData extData; XmVendorShellExtObject vse; int i; XmToolTipConfigTrait ttp; ttp = (XmToolTipConfigTrait) XmeTraitGet (new_w, XmQTtoolTipConfig); if (ttp != NULL) { _XmProcessLock (); for (i = 0; i < *num_args; i++) { if (strcmp (args[i].name, XmNtoolTipPostDelay) == 0) { ttp->post_delay = args[i].value; } else if (strcmp (args[i].name, XmNtoolTipPostDuration) == 0) { ttp->post_duration = args[i].value; } else if (strcmp (args[i].name, XmNtoolTipEnable) == 0) { ttp->enable = (Boolean) args[i].value; } } _XmProcessUnlock (); } if ((extData = _XmGetWidgetExtData( (Widget) vw, XmSHELL_EXTENSION)) && (vse = (XmVendorShellExtObject) extData->widget)) { VendorExtSetValues(extData->oldWidget, extData->reqWidget, extData->widget, args, num_args); vse = (XmVendorShellExtObject) extData->widget; if (req->core.height != current->core.height) vse->vendor.im_vs_height_set = True; } return(FALSE); } /************************************************************************ * * SetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPosthook( Widget current, /* unused */ Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmWidgetExtData ext; _XmPopWidgetExtData(new_w, &ext, XmSHELL_EXTENSION); if (ext) { _XmProcessLock(); _XmExtObjFree( (XtPointer) ext->reqWidget); _XmExtObjFree( (XtPointer) ext->oldWidget); _XmProcessUnlock(); XtFree((char *) ext); } return(FALSE); } /************************************************************************ * * GetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static void GetValuesPrehook( Widget w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmWidgetExtData oldExtData, newExtData; if ((oldExtData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION)) != NULL) { newExtData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); newExtData->widget = oldExtData->widget; _XmPushWidgetExtData(w, newExtData, XmSHELL_EXTENSION); } } static void GetValuesHook( Widget w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; XmBaseClassExt *cePtr; WidgetClass ec; int i; int *ip; Boolean *bp; XmToolTipConfigTrait ttp; ttp = (XmToolTipConfigTrait) XmeTraitGet (w, XmQTtoolTipConfig); if (ttp != NULL) { _XmProcessLock (); for (i = 0; i < *num_args; i++) { if (strcmp (args[i].name, XmNtoolTipPostDelay) == 0) { ip = (int *) args[i].value; *ip = ttp->post_delay; } else if (strcmp (args[i].name, XmNtoolTipPostDuration) == 0) { ip = (int *) args[i].value; *ip = ttp->post_duration; } else if (strcmp (args[i].name, XmNtoolTipEnable) == 0) { bp = (Boolean *) args[i].value; *bp = ttp->enable; } } _XmProcessUnlock (); } cePtr = _XmGetBaseClassExtPtr(XtClass(w), XmQmotif); ec = (*cePtr)->secondaryObjectClass; if ((ext = _XmGetWidgetExtData(w, XmSHELL_EXTENSION)) != NULL) { _XmProcessLock(); XtGetSubvalues(ext->widget, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmProcessUnlock(); _XmExtGetValuesHook( ext->widget, args, num_args ); } } /*ARGSUSED*/ static void GetValuesPosthook( Widget w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmWidgetExtData ext = NULL; _XmPopWidgetExtData(w, &ext, XmSHELL_EXTENSION); if (ext) XtFree((char *) ext); } /* * This handles the case where the secondary shells is waiting for the * primary to get mapped and is destroyed in the interim. */ /*ARGSUSED*/ static void PendingTransientDestroyed( Widget vw, XtPointer cl_data, XtPointer ca_data ) /* unused */ { XmExtObject ancestorExtObj = (XmExtObject) cl_data ; Widget ancestor = ancestorExtObj->ext.logicalParent ; if( !ancestor->core.being_destroyed ) { /* XtRemoveCallback( (Widget) ancestorExtObj, XmNrealizeCallback, SetTransientFor, (XtPointer) vw) ; */ _XmRemoveCallback((InternalCallbackList *) &(((XmVendorShellExtObject)ancestorExtObj)->vendor.realize_callback), SetTransientFor, (XtPointer) vw) ; } return ; } /* * Handle having the application shell realized after the secondary shells */ /*ARGSUSED*/ static void SetTransientFor( Widget w, XtPointer closure, XtPointer call_data) /* unused */ { VendorShellWidget vw = (VendorShellWidget) closure ; Widget ancestor = ((XmExtObject) w)->ext.logicalParent ; Arg args[2] ; Cardinal i = 0 ; if( !XtIsRealized( ancestor) ) { XtRealizeWidget( ancestor) ; } XtSetArg( args[i], XtNwindowGroup, XtWindow( ancestor)) ; i++ ; if( XtIsTransientShell( (Widget) vw) ) { /* because Shell.c is broken force the code */ ((TransientShellWidget) vw)->transient.transient_for = NULL ; XtSetArg( args[i], XtNtransientFor, ancestor) ; i++ ; } XtSetValues( (Widget) vw, args, i) ; /* XtRemoveCallback( w, XmNrealizeCallback, SetTransientFor, (XtPointer) vw) ; */ _XmRemoveCallback((InternalCallbackList *) &(((XmVendorShellExtObject)w)->vendor.realize_callback), SetTransientFor, (XtPointer) vw) ; XtRemoveCallback( (Widget) vw, XmNdestroyCallback, PendingTransientDestroyed, (XtPointer) w) ; return ; } /************************************************************************ * * Resize * ************************************************************************/ static void Resize( Widget w ) { register ShellWidget sw = (ShellWidget)w; Widget childwid; int i; int y; XmVendorShellExtObject vendorExt; XmWidgetExtData extData; extData = _XmGetWidgetExtData((Widget)sw, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif } vendorExt = (XmVendorShellExtObject) extData->widget; _XmImResize((Widget)sw); y = sw->core.height - vendorExt->vendor.im_height; for(i = 0; i < sw->composite.num_children; i++) { if(XtIsManaged(sw->composite.children[i])) { childwid = sw->composite.children[i]; XmeConfigureObject(childwid, childwid->core.x, childwid->core.y, sw->core.width, y, childwid->core.border_width); } } } /************************************************************************ * * ChangeManaged * ************************************************************************/ static void ChangeManaged( Widget wid ) { VendorShellWidget vw = (VendorShellWidget) wid ; WMShellWidgetClass super = (WMShellWidgetClass)wmShellWidgetClass; Widget firstManaged = NULL; Cardinal i; XmVendorShellExtObject vendorExt; XmWidgetExtData extData; XtWidgetProc change_managed; extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif } vendorExt = (XmVendorShellExtObject) extData->widget; for (i= 0; i < vw->composite.num_children; i++) if (XtIsManaged(vw->composite.children[i])) firstManaged = vw->composite.children[i]; /* Danger! Danger! Ugly Code Warning! Since the shell's * change Managed routine in the intrinsics will always * configure the child to be the size of the parent, if * there is any im_height we must subtract it here and * add it back in after this call. */ vw->core.height -= vendorExt->vendor.im_height; _XmProcessLock(); change_managed = super->composite_class.change_managed; _XmProcessUnlock(); (*change_managed) ((Widget) vw); vw->core.height += vendorExt->vendor.im_height; /* * make sure that there is a reasonable initial focus path. This * is especially important for making sure the event handler is * there. */ XtSetKeyboardFocus((Widget)vw, (Widget)firstManaged); XmeNavigChangeManaged((Widget)vw); } static void UpdateCoreGeometry( VendorShellWidget vw, XmVendorShellExtObject vendorExt ) { /* ||| check if geometry was user specified and convert if it was */ if (vw->shell.geometry && vendorExt) { if (vendorExt->vendor.unit_type != XmPIXELS) { if (vw->wm.size_hints.flags & USPosition) { vw->core.x = (Position) XmCvtToHorizontalPixels( vw->core.screen, (int) vw->core.x, vendorExt->vendor.unit_type); vw->core.y = (Position) XmCvtToVerticalPixels( vw->core.screen, (int) vw->core.y, vendorExt->vendor.unit_type); } if (vw->wm.size_hints.flags & USSize) { vw->core.width = (Dimension) XmCvtToHorizontalPixels( vw->core.screen, (int) vw->core.width, vendorExt->vendor.unit_type); vw->core.height = (Dimension) XmCvtToVerticalPixels( vw->core.screen, (int) vw->core.height, vendorExt->vendor.unit_type); } } } } /************************************************************************ * * Realize * ************************************************************************/ static void Realize( Widget wid, XtValueMask *vmask, XSetWindowAttributes *attr ) { VendorShellWidget vw = (VendorShellWidget) wid ; WMShellWidgetClass super = (WMShellWidgetClass)wmShellWidgetClass; XmVendorShellExtObject vendorExt; XmWidgetExtData extData; if ((extData = _XmGetWidgetExtData((Widget)vw, XmSHELL_EXTENSION)) != NULL) { vendorExt = (XmVendorShellExtObject) extData->widget; _XmImChangeManaged((Widget)vw); } else vendorExt = NULL; UpdateCoreGeometry(vw, vendorExt); /* * Set nearest shell as transientFor so Mwm will be able to build tree. */ if (vendorExt && XmIsShellExt(vendorExt->desktop.parent)) { Widget ancestor = ((XmExtObject)(vendorExt->desktop.parent)) ->ext.logicalParent ; /* try to have WMShell do the work */ if (XtIsRealized(ancestor)) vw->wm.wm_hints.window_group = XtWindow(ancestor); else { XmWidgetExtData ancestorExtData = _XmGetWidgetExtData( ancestor, XmSHELL_EXTENSION) ; if( ancestorExtData && ancestorExtData->widget ) { _XmAddCallback((InternalCallbackList *) &(((XmVendorShellExtObject)ancestorExtData->widget)->vendor.realize_callback), SetTransientFor, (XtPointer) vw); XtAddCallback( (Widget) vw, XmNdestroyCallback, PendingTransientDestroyed, (XtPointer) ancestorExtData->widget) ; } } } /* Make sure height and width are not zero, without warning, since we change the internal behavior of BB and DA and we don't want to change the external one. */ if (!XtWidth(wid)) XtWidth(wid) = 1 ; if (!XtHeight(wid)) XtHeight(wid) = 1 ; /* Make my superclass do all the dirty work */ { XtRealizeProc realize; _XmProcessLock(); realize = super->core_class.realize; _XmProcessUnlock(); (*realize)((Widget) vw, vmask, attr); } if (vendorExt) _XmImRealize((Widget)vw); } /************************************************************************ * * GeometryManager * ************************************************************************/ /*ARGSUSED*/ static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply ) /* unused */ { ShellWidget shell = (ShellWidget)(wid->core.parent); XtWidgetGeometry my_request; XmVendorShellExtObject ve; XmWidgetExtData extData; XtGeometryResult res ; if (!(extData = _XmGetWidgetExtData((Widget)shell, XmSHELL_EXTENSION))) return XtGeometryNo; ve = (XmVendorShellExtObject) extData->widget; if(!(shell->shell.allow_shell_resize) && XtIsRealized(wid) && (request->request_mode & (CWWidth | CWHeight | CWBorderWidth))) return(XtGeometryNo); my_request.request_mode = 0; /* %%% worry about XtCWQueryOnly */ if (request->request_mode & XtCWQueryOnly) my_request.request_mode |= XtCWQueryOnly; if (request->request_mode & CWWidth) { my_request.width = request->width; my_request.request_mode |= CWWidth; } if (request->request_mode & CWHeight) { my_request.height = request->height + ve->vendor.im_height; my_request.request_mode |= CWHeight; } if (request->request_mode & CWBorderWidth) { my_request.border_width = request->border_width; my_request.request_mode |= CWBorderWidth; } if (request->request_mode & CWX) { my_request.x = request->x; my_request.request_mode |= CWX; } if (request->request_mode & CWY) { my_request.y = request->y; my_request.request_mode |= CWY; } res = XtMakeGeometryRequest((Widget)shell, &my_request, NULL) ; if (res == XtGeometryYes) { _XmImResize((Widget)shell); if (!(request->request_mode & XtCWQueryOnly)) { if (request->request_mode & CWWidth) wid->core.width = shell->core.width; if (request->request_mode & CWHeight) wid->core.height = shell->core.height - ve->vendor.im_height; if (request->request_mode & CWX) wid->core.x = 0; if (request->request_mode & CWY) wid->core.y = 0; } return XtGeometryYes; } else return XtGeometryNo; } /************************************************************************ * * RootGeometryManager * ************************************************************************/ /*ARGSUSED*/ static XtGeometryResult RootGeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XtGeometryHandler wmGeoHandler; ShellWidgetClass swc = (ShellWidgetClass)wmShellWidgetClass; ShellClassExtensionRec **scExtPtr; XtGeometryResult returnVal = XtGeometryNo; WMShellWidget wmShell = (WMShellWidget)w; XmShellExtObject se; XmWidgetExtData extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return XtGeometryNo; } se = (XmShellExtObject)extData->widget; if (se) { se->shell.lastConfigureRequest = NextRequest(XtDisplay(w)); } #ifdef DEBUG else XtError("no extension object"); #endif /* DEBUG */ _XmProcessLock(); scExtPtr = (ShellClassExtensionRec **) _XmGetClassExtensionPtr( (XmGenericClassExt *) &(swc->shell_class.extension), NULLQUARK); _XmProcessUnlock(); if (request->request_mode & XtCWQueryOnly) { if (!(wmShell->shell.allow_shell_resize) && (request->request_mode & (CWWidth | CWHeight | CWBorderWidth))) return XtGeometryNo; /* * we should switch on useAsyncGeometry but we won't ||| */ else return XtGeometryYes; } if (se->shell.useAsyncGeometry) { /* make wait_for_wm = FALSE to force desired behaviour */ wmShell->wm.wait_for_wm = FALSE; /* FIX for 1684: remove the timeout = 0 line, not needed and introduced a bug if not saved/restore together with useAsync change - wait_for_wm will be later reset by Shell in Xt */ } _XmProcessLock(); wmGeoHandler = (*scExtPtr)->root_geometry_manager; _XmProcessUnlock(); if (wmGeoHandler != NULL) { returnVal = (*wmGeoHandler)(w, request, reply); if (se->shell.useAsyncGeometry) { /* X configure was sent to the server, while this is happening, let's everybody think it's a success (which is true most of the time): set the shell size to what it wants to be and return Yes */ if (request->request_mode & CWWidth) w->core.width = request->width; if (request->request_mode & CWHeight) w->core.height = request->height ; if (request->request_mode & CWBorderWidth) w->core.border_width = request->border_width ; if (request->request_mode & CWX) w->core.x = request->x; if (request->request_mode & CWY) w->core.y = request->y; returnVal = XtGeometryYes; } } return returnVal; } /************************************************************************ * * SetMwmHints * ************************************************************************/ static void SetMwmHints( XmVendorShellExtObject ve ) { PropMwmHints prop; Atom mwm_hints_atom; Widget shell = ve->ext.logicalParent; mwm_hints_atom = XInternAtom(XtDisplay(shell), _XA_MWM_HINTS, FALSE); #define SET(field) prop.field = ve->vendor.mwm_hints.field SET(flags); SET(functions); SET(decorations); prop.inputMode = ve->vendor.mwm_hints.input_mode; SET(status); #undef SET XChangeProperty (XtDisplay(shell), XtWindow(shell), mwm_hints_atom,mwm_hints_atom, 32, PropModeReplace, (unsigned char *) &prop, PROP_MWM_HINTS_ELEMENTS); } /************************************************************************ * * SetMwmMenu * ************************************************************************/ static void SetMwmMenu( XmVendorShellExtObject ve ) { Widget shell = ve->ext.logicalParent; Atom mwm_menu_atom; XTextProperty text_prop; int status; mwm_menu_atom = XInternAtom(XtDisplay(shell), _XA_MWM_MENU, FALSE); text_prop.value = NULL; status = XmbTextListToTextProperty(XtDisplay(shell), &ve->vendor.mwm_menu, 1, XStdICCTextStyle, &text_prop); if (status == Success || status > 0) { XSetTextProperty(XtDisplay(shell), XtWindow(shell), &text_prop, mwm_menu_atom); if (text_prop.value != NULL) XFree((char*)text_prop.value); } } /*ARGSUSED*/ static void VendorExtRealize( Widget w, XtPointer closure, /* unused */ XtPointer call_data ) /* unused */ { XmVendorShellExtObject ve = (XmVendorShellExtObject)w; VendorShellWidget vw; vw = (VendorShellWidget)ve->ext.logicalParent; if (ve->vendor.mwm_hints.flags) SetMwmHints(ve); if (ve->vendor.mwm_menu) SetMwmMenu(ve); _XmInstallProtocols(ve->ext.logicalParent); if( !IsPopupShell( (Widget) vw) ) { /* Non-popup shells are allowed input as soon as * they are realized, since they don't use XtPopup. */ AddGrab(ve, NULL, FALSE, FALSE, ve); } } static void AddDLEntry( XmVendorShellExtObject ve, Widget shell) { unsigned short i = 0 ; _XmProcessLock(); while( i < destroy_list_cnt ) { if( destroy_list[i].shell == shell ) { /* Already on list; once is enough. */ _XmProcessUnlock(); return ; } ++i ; } if( destroy_list_cnt == destroy_list_size ) { destroy_list_size += 2 ; destroy_list = (XmDestroyGrabList) XtRealloc( (char *) destroy_list, destroy_list_size * sizeof( XmDestroyGrabRec)) ; } destroy_list[i].shell = shell ; destroy_list[i].ve = ve ; ++destroy_list_cnt ; _XmProcessUnlock(); } static void RemoveDLEntry( unsigned pos) { _XmProcessLock(); while( ++pos < destroy_list_cnt ) { destroy_list[pos-1].shell = destroy_list[pos].shell ; destroy_list[pos-1].ve = destroy_list[pos].ve ; } --destroy_list_cnt ; _XmProcessUnlock(); } static void Destroy( Widget wid) { XmWidgetExtData ext; XmVendorShellExtObject ve; unsigned short n = 0 ; _XmProcessLock(); while( n < destroy_list_cnt ) { if( destroy_list[n].shell == wid ) { RemoveGrab( destroy_list[n].ve, TRUE, destroy_list[n].shell) ; RemoveDLEntry( n) ; break ; } ++n ; } _XmProcessUnlock(); _XmPopWidgetExtData(wid, &ext, XmSHELL_EXTENSION); if (ext != NULL) { if ((ve = (XmVendorShellExtObject) ext->widget) != NULL) { if (ve->vendor.mwm_menu) XtFree(ve->vendor.mwm_menu); if (ve->vendor.input_method_string) XtFree(ve->vendor.input_method_string); if (ve->vendor.preedit_type_string) XtFree(ve->vendor.preedit_type_string); if (ve->vendor.button_font_list) XmFontListFree(ve->vendor.button_font_list); if (ve->vendor.label_font_list) XmFontListFree(ve->vendor.label_font_list); if (ve->vendor.text_font_list) XmFontListFree(ve->vendor.text_font_list); if (ve->vendor.im_info) _XmImFreeShellData(wid, &ve->vendor.im_info); _XmDestroyFocusData(ve->vendor.focus_data); _XmRemoveAllCallbacks((InternalCallbackList *) &(ve->vendor.realize_callback)); _XmRemoveAllCallbacks((InternalCallbackList *) &(ve->vendor.focus_moved_callback)); { XtWidgetProc destroy; _XmProcessLock(); destroy = xmDesktopClass->core_class.destroy; _XmProcessUnlock(); (*destroy) ((Widget) ve); } XtFree((char *) ve); } XtFree((char *) ext); } #ifdef FIX_1388 { XmToolTipConfigTrait ttp; /* ToolTip pointer */ if ((ttp = XmeTraitGet((XtPointer) wid, XmQTtoolTipConfig)) != NULL) { XmeTraitSet((XtPointer) wid, XmQTtoolTipConfig, (XtPointer) NULL); XtFree((char *)ttp); } } #endif /* * If all VendorShells have been destroyed, destroy the XmDisplay object * in order to reset any per-display and per-screen data. This is * necessary, since the application may be about to call XtCloseDisplay. */ if (!XmIsDisplay (wid)) { XmDisplay xmDisplay = (XmDisplay) XmGetXmDisplay (XtDisplay(wid)); xmDisplay->display.shellCount -= 1; if (xmDisplay->display.shellCount == 0) { XmImCloseXIM (wid); XtDestroyWidget ((Widget)xmDisplay); } } } /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, /* unused */ Region region ) /* unused */ { _XmImRedisplay(wid); } /**************************************************************** * * Trait method for specify render table * **************************************************************/ static XmFontList GetTable( Widget wid, XtEnum type) { XmWidgetExtData extData; XmVendorShellExtObject ve; if ((extData = _XmGetWidgetExtData(wid, XmSHELL_EXTENSION)) && (ve = (XmVendorShellExtObject) extData->widget)) { switch(type) { case XmLABEL_RENDER_TABLE : return ve->vendor.label_font_list ; case XmBUTTON_RENDER_TABLE : return ve->vendor.button_font_list ; case XmTEXT_RENDER_TABLE : return ve->vendor.text_font_list ; } } return NULL ; } /**************************************************************** * * Trait method for specify layout direction * **************************************************************/ static XmDirection GetDirection(Widget w) { XmWidgetExtData extData; XmVendorShellExtObject vendorExt; extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION); if(extData == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return XmRIGHT_TO_LEFT; } vendorExt = (XmVendorShellExtObject) extData->widget; return vendorExt->vendor.layout_direction; } static unsigned char GetUnitType(Widget w) { XmWidgetExtData extData; XmVendorShellExtObject vendorExt; if ((extData = _XmGetWidgetExtData(w, XmSHELL_EXTENSION)) && (vendorExt = (XmVendorShellExtObject) extData->widget)) return vendorExt->vendor.unit_type ; else /* cannot fetch unit type yet, the VendorShell is being created, so force pixel... */ return XmPIXELS ; } static void GetColors(Widget w, XmAccessColorData color_data) { /* cannot use XmGetColors to generate the other for it ends up in a loop since XmGetColors creates a XmScreen, which needs an XmDisplay, which is a VendorS. */ color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor ; color_data->background = w->core.background_pixel; color_data->foreground = BlackPixelOfScreen(XtScreen(w)) ; color_data->highlight_color = color_data->top_shadow_color = color_data->bottom_shadow_color = XmUNSPECIFIED_PIXEL ; } /************************************************************************ * * _XmGetDefaultDisplay * ************************************************************************/ Display * _XmGetDefaultDisplay(void) { Display *theDisplay = NULL; _XmProcessLock(); if (_XmDisplayHandle) theDisplay = _XmDisplayHandle ; else { XtWarning(MSG4); } _XmProcessUnlock(); return theDisplay; } /************************************************************************ * * _XmDefaultVisualResources * ************************************************************************/ void _XmDefaultVisualResources( Widget widget ) { /* Default the Shell visual resources (visual, depth and colormap) from the nearest shell. See CR 5459 */ ShellWidget next_shell, this_shell = (ShellWidget)widget; /* go find the next shell ancestor, which might be widget itself in the case of a root shell. Looking for the next widget with a "visual" resource is too expensive, remember this is going to be done 99.999999% of the time */ next_shell = (ShellWidget) this_shell; if (XtParent((Widget)next_shell)) do { next_shell = (ShellWidget) XtParent((Widget)next_shell); } while (!XtIsShell((Widget)next_shell)); /* now default the 3 visual resources */ if (this_shell->shell.visual == INVALID_VISUAL) { /* next_shell might be self, still invalid, but in this case, we know it is a root shell: take regular Xt default */ if (this_shell == next_shell) { this_shell->shell.visual = CopyFromParent ; this_shell->core.depth = DefaultDepthOfScreen(XtScreen(widget)); this_shell->core.colormap = DefaultColormapOfScreen(XtScreen(widget)); } else { this_shell->shell.visual = next_shell->shell.visual; this_shell->core.depth = next_shell->core.depth; this_shell->core.colormap = next_shell->core.colormap; } } } #ifdef DEBUG_GRABS static void PrintModal( XmModalData modal) { printf( "log_p: %s, grabber: %s, excl: %d, spring: %d, ve: 0x%x\n", modal->wid->core.name, (modal->grabber ? modal->grabber->ext.logicalParent->core.name : "NULL"), modal->exclusive, modal->springLoaded, modal->ve) ; } static void PrintXmGrabs( Widget wid) { XmDisplay disp = (XmDisplay) XmGetXmDisplay( XtDisplay( wid)); XmModalData modals = disp->display.modals ; Cardinal nmodals = disp->display.numModals ; Cardinal cnt = 0 ; while( cnt < nmodals ) { PrintModal( &(modals[cnt])) ; ++cnt ; } } #endif /* DEBUG_GRABS */ motif-2.3.8/lib/Xm/PushBG.c0000644000175000017500000031407613145162623012227 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: PushBG.c /main/29 1999/05/27 14:18:33 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CacheI.h" #include "ColorI.h" #include "ExtObjectI.h" #include "GadgetUtiI.h" #include "LabelI.h" #include "LabelGI.h" #include "MenuProcI.h" #include "MenuStateI.h" #include "MenuUtilI.h" #include "SyntheticI.h" #include "TravActI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #include "XmI.h" #define DELAY_DEFAULT 100 #define XmINVALID_MULTICLICK 255 struct PBTimeOutEvent { XmPushButtonGadget pushbutton; XEvent *xevent; }; /******** Static Function Declarations ********/ static int _XmPushBCacheCompare( XtPointer A, XtPointer B); static void InputDispatch( Widget wid, XEvent *event, Mask event_mask); static void Arm( XmPushButtonGadget pb, XEvent *event); static void Activate( XmPushButtonGadget pb, XEvent *event); static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ArmTimeout( XtPointer data, XtIntervalId *id); static void Disarm( XmPushButtonGadget pb, XEvent *event); static void BtnDown( XmPushButtonGadget pb, XEvent *event); static void BtnUp( Widget wid, XEvent *event); static void Enter( Widget wid, XEvent *event); static void Leave( Widget wid, XEvent *event); static void BorderHighlight( Widget wid); static void DrawBorderHighlight( Widget wid); static void BorderUnhighlight( Widget wid); static void KeySelect( Widget wid, XEvent *event); static void ClassInitialize( void ); static void ClassPartInitialize( WidgetClass wc); static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void GetFillGC( XmPushButtonGadget pb); static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args); static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args); static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void Help( XmPushButtonGadget pb, XEvent *event); static void Destroy( Widget wid); static void Resize( Widget wid); static void ActivateCommonG( XmPushButtonGadget pb, XEvent *event, Mask event_mask); static Cardinal GetPushBGClassSecResData( WidgetClass w_class, XmSecondaryResourceData **data_rtn); static XtPointer GetPushBGClassSecResBase( Widget widget, XtPointer client_data); static void EraseDefaultButtonShadow( XmPushButtonGadget pb); static void DrawDefaultButtonShadow( XmPushButtonGadget pb); static int AdjustHighLightThickness( XmPushButtonGadget new_w, XmPushButtonGadget current); static void Redisplay( Widget wid, XEvent *event, Region region); static void DrawPushButtonLabelGadget( XmPushButtonGadget pb, XEvent *event, Region region); static void DrawLabelGadget( XmPushButtonGadget pb, XEvent *event, Region region) ; static void DrawPushButtonGadgetShadows( XmPushButtonGadget pb); static void DrawPBGadgetShadows( XmPushButtonGadget pb); static void EraseDefaultButtonShadows( XmPushButtonGadget pb); static void DrawDefaultButtonShadows( XmPushButtonGadget pb); static XmImportOperator ShowAsDef_ToHorizPix( Widget widget, int offset, XtArgVal *value); static Boolean ComputePBLabelArea( XmPushButtonGadget pb, LRectangle *box); static void ExportHighlightThickness( Widget widget, int offset, XtArgVal *value); static void SetPushButtonSize( XmPushButtonGadget newpb); static void ChangeCB(Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset); static void ShowAsDefault(Widget w, XtEnum state); static void PBG_FixTearoff( XmPushButtonGadget pb); /******** End Static Function Declarations ********/ /************************************************ The uncached resources for Push Button ************************************************/ static XtResource resources[] = { { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf (struct _XmPushButtonGadgetRec, pushbutton.activate_callback), XmRPointer, (XtPointer) NULL }, { XmNarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf (struct _XmPushButtonGadgetRec, pushbutton.arm_callback), XmRPointer, (XtPointer) NULL }, { XmNdisarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf (struct _XmPushButtonGadgetRec, pushbutton.disarm_callback), XmRPointer, (XtPointer) NULL }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf (struct _XmPushButtonGadgetRec, gadget.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf (struct _XmGadgetRec, gadget.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf (struct _XmGadgetRec, gadget.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNshowAsDefault, XmCShowAsDefault, XmRBooleanDimension, sizeof (Dimension), XtOffsetOf (struct _XmPushButtonGadgetRec, pushbutton.show_as_default), XmRImmediate, (XtPointer) 0 }, }; static XmSyntheticResource syn_resources[] = { { XmNshowAsDefault, sizeof (Dimension), XtOffsetOf (struct _XmPushButtonGadgetRec, pushbutton.show_as_default), XmeFromHorizontalPixels, ShowAsDef_ToHorizPix }, { XmNhighlightThickness, sizeof (Dimension), XtOffsetOf (struct _XmGadgetRec, gadget.highlight_thickness), ExportHighlightThickness, XmeToHorizontalPixels }, }; /********************************************** Cached resources for PushButton Gadget **********************************************/ static XtResource cache_resources[] = { { XmNmultiClick, XmCMultiClick, XmRMultiClick, sizeof (unsigned char), XtOffsetOf (struct _XmPushButtonGCacheObjRec, pushbutton_cache.multiClick), XmRImmediate, (XtPointer) XmINVALID_MULTICLICK }, { XmNdefaultButtonShadowThickness, XmCDefaultButtonShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(struct _XmPushButtonGCacheObjRec, pushbutton_cache.default_button_shadow_thickness), XmRImmediate, (XtPointer) 0 }, { XmNfillOnArm, XmCFillOnArm, XmRBoolean, sizeof (Boolean), XtOffsetOf(struct _XmPushButtonGCacheObjRec, pushbutton_cache.fill_on_arm), XmRImmediate, (XtPointer) True }, { XmNarmColor, XmCArmColor, XmRPixel, sizeof (Pixel), XtOffsetOf(struct _XmPushButtonGCacheObjRec, pushbutton_cache.arm_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNarmPixmap, XmCArmPixmap, XmRDynamicPixmap, sizeof (Pixmap), XtOffsetOf(struct _XmPushButtonGCacheObjRec, pushbutton_cache.arm_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource cache_syn_resources[] = { { XmNdefaultButtonShadowThickness, sizeof (Dimension), XtOffsetOf(struct _XmPushButtonGCacheObjRec, pushbutton_cache.default_button_shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, }; /*************************************<->************************************* * * * Description: global class record for instances of class: PushButton * ----------- * * Defines default field settings for this class record. * *************************************<->***********************************/ static XmCacheClassPart PushButtonClassCachePart = { {NULL, 0, 0}, /* head of class cache list */ _XmCacheCopy, /* Copy routine */ _XmCacheDelete, /* Delete routine */ _XmPushBCacheCompare, /* Comparison routine */ }; static XmBaseClassExtRec PushBGClassExtensionRec = { NULL, /* next_extension */ NULLQUARK, /* record_typ */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* record_size */ InitializePrehook, /* initializePrehook */ SetValuesPrehook, /* setValuesPrehook */ InitializePosthook, /* initializePosthook */ SetValuesPosthook, /* setValuesPosthook */ (WidgetClass)&xmPushButtonGCacheObjClassRec,/* secondaryObjectClass */ SecondaryObjectCreate, /* secondaryObjectCreate */ GetPushBGClassSecResData, /* getSecResData */ {0}, /* fast subclass */ GetValuesPrehook, /* getValuesPrehook */ GetValuesPosthook, /* getValuesPosthook */ (XtWidgetClassProc)NULL, /* classPartInitPrehook */ (XtWidgetClassProc)NULL, /* classPartInitPosthook */ (XtResourceList)NULL, /* ext_resources */ (XtResourceList)NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; /* ext rec static initialization */ externaldef(xmpushbuttongcacheobjclassrec) XmPushButtonGCacheObjClassRec xmPushButtonGCacheObjClassRec = { { /* superclass */ (WidgetClass) &xmLabelGCacheObjClassRec, /* class_name */ "XmPushButtonGadget", /* widget_size */ sizeof(XmPushButtonGCacheObjRec), /* class_initialize */ (XtProc)NULL, /* chained class init */ (XtWidgetClassProc)NULL, /* class_inited */ False, /* initialize */ (XtInitProc)NULL, /* initialize hook */ (XtArgsProc)NULL, /* realize */ NULL, /* actions */ NULL, /* num_actions */ 0, /* resources */ cache_resources, /* num_resources */ XtNumber(cache_resources), /* xrm_class */ NULLQUARK, /* compress_motion */ False, /* compress_exposure */ False, /* compress enter/exit*/ False, /* visible_interest */ False, /* destroy */ (XtWidgetProc)NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ (XtSetValuesFunc)NULL, /* set values hook */ (XtArgsFunc)NULL, /* set values almost */ NULL, /* get values hook */ (XtArgsProc)NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ NULL, /* query geo proc */ NULL, /* display accelerator*/ NULL, /* extension record */ NULL, }, { /* synthetic resources */ cache_syn_resources, /* num_syn_resources */ XtNumber(cache_syn_resources), /* extension */ NULL, } }; /* The PushButton class record definition */ static XmGadgetClassExtRec _XmPushBGadClassExtRec = { NULL, NULLQUARK, XmGadgetClassExtVersion, sizeof(XmGadgetClassExtRec), XmInheritBaselineProc, /* widget_baseline */ XmInheritDisplayRectProc, /* widget_display_rect */ XmInheritMarginsProc, /* widget_margins */ }; externaldef(xmpushbuttongadgetclassrec) XmPushButtonGadgetClassRec xmPushButtonGadgetClassRec = { { (WidgetClass) &xmLabelGadgetClassRec, /* superclass */ "XmPushButtonGadget", /* class_name */ sizeof(XmPushButtonGadgetRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* tm_table */ XtInheritQueryGeometry, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&PushBGClassExtensionRec, /* extension */ }, { /* gadget class record */ BorderHighlight, /* border highlight */ BorderUnhighlight, /* border_unhighlight */ ArmAndActivate, /* arm_and_activate */ InputDispatch, /* input dispatch */ XmInheritVisualChange, /* visual_change */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num syn_resources */ &PushButtonClassCachePart, /* class cache part */ (XtPointer)&_XmPushBGadClassExtRec, /* extension */ }, { /* label_class record */ XmInheritWidgetProc, /* setOverrideCallback */ XmInheritMenuProc, /* menu proc's entry */ NULL, /* extension */ }, { /* pushbutton class record */ NULL, /* extension */ } }; externaldef(xmpushbuttongadgetclass) WidgetClass xmPushButtonGadgetClass = (WidgetClass) &xmPushButtonGadgetClassRec; /* Trait record for pushButtonG */ static XmConst XmActivatableTraitRec pushButtonGAT = { 0, /* version */ ChangeCB, }; /* TakesDefault Trait record for pushButtonG */ static XmConst XmTakesDefaultTraitRec pushButtonGTDT = { 0, /* version */ ShowAsDefault, }; /* Menu Savvy trait record */ static XmMenuSavvyTraitRec MenuSavvyRecord = { /* version: */ -1, NULL, NULL, NULL, _XmCBNameActivate, }; /***************************************************************** * SPECIAL PROPERTIES OF PUSHBUTTON GADGET INSIDE A MENU: * When a PushButton (widget/gadget) is incorporated in a Menu * (Pulldownor Popup) - its properties get modified in these ways: * (1) The redisplay routine should not draw its background nor draw * its shadows. It should draw only the label. To comply with * this means that the arm-color and background color are not * of any use. As a result the values in the FillGC and BackgroundGC * are not initialized and are likely to be bogus. This causes * special casing of Initialize and SetValues routines. * (2) PushButton does not show its depressed appearance in the * menu. This will cause Arm(), DisArm(), ArmAndActivate routines * to have special cases. * In short the properties of Pushbutton in a menu are so different * that practically all major routines in this widget will have to * special-cased to accommodate this difference as if two different * classes are being glued to one class. *******************************************************************/ /******************************************************************* * * _XmPushBCacheCompare * *******************************************************************/ static int _XmPushBCacheCompare( XtPointer A, XtPointer B ) { XmPushButtonGCacheObjPart *a_inst = (XmPushButtonGCacheObjPart *) A; XmPushButtonGCacheObjPart *b_inst = (XmPushButtonGCacheObjPart *) B; if ((a_inst->fill_on_arm == b_inst->fill_on_arm) && (a_inst->arm_color == b_inst->arm_color) && (a_inst->arm_pixmap == b_inst->arm_pixmap) && (a_inst->unarm_pixmap == b_inst->unarm_pixmap) && (a_inst->fill_gc == b_inst->fill_gc) && (a_inst->background_gc == b_inst->background_gc) && (a_inst->multiClick == b_inst->multiClick) && (a_inst->default_button_shadow_thickness == b_inst->default_button_shadow_thickness) && (a_inst->timer == b_inst->timer) && (a_inst->timer_widget == b_inst->timer_widget) ) return 1; else return 0; } /************************************************************************ * * InputDispatch * This function catches input sent by a manager and dispatches it * to the individual routines. * ************************************************************************/ static void InputDispatch( Widget wid, XEvent *event, Mask event_mask ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; if ((event_mask & XmARM_EVENT) || ((PBG_MultiClick(pb) == XmMULTICLICK_KEEP) && (event_mask & XmMULTI_ARM_EVENT))) { if (LabG_IsMenupane(pb)) BtnDown (pb, event); else Arm (pb, event); } else if (event_mask & XmACTIVATE_EVENT) { PBG_ClickCount (pb) = 1; /* pb->pushbutton.click_count = 1; */ ActivateCommonG (pb, event, event_mask); } else if (event_mask & XmMULTI_ACTIVATE_EVENT) { /* If XmNMultiClick resource is set to DISCARD - do nothing * else increment clickCount and call ActivateCommonG. */ if (PBG_MultiClick(pb) == XmMULTICLICK_KEEP) { (PBG_ClickCount (pb))++; ActivateCommonG (pb, event, event_mask); } } else if (event_mask & XmHELP_EVENT) Help (pb, event); else if (event_mask & XmENTER_EVENT) Enter ((Widget) pb, event); else if (event_mask & XmLEAVE_EVENT) Leave ((Widget) pb, event); else if (event_mask & XmFOCUS_IN_EVENT) _XmFocusInGadget((Widget) pb, event, NULL, NULL); else if (event_mask & XmFOCUS_OUT_EVENT) _XmFocusOutGadget((Widget) pb, event, NULL, NULL); else if (event_mask & XmBDRAG_EVENT) _XmProcessDrag ((Widget) pb, event, NULL, NULL); } /************************************************************************ * * Arm * * This function processes button 1 down occuring on the pushbutton. * Mark the pushbutton as armed (i.e. active). * The callbacks for XmNarmCallback are called. * ************************************************************************/ static void Arm( XmPushButtonGadget pb, XEvent *event ) { XmPushButtonCallbackStruct call_value; XtExposeProc expose; PBG_Armed(pb) = TRUE; _XmProcessLock(); expose = ((XmPushButtonGadgetClassRec *)(pb->object.widget_class))-> rect_class.expose; _XmProcessUnlock(); (* (expose)) ((Widget) pb, event, (Region) NULL); if (PBG_ArmCallback(pb)) { XFlush(XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) pb, PBG_ArmCallback(pb), &call_value); } } /************************************************************************ * * Activate * * Mark the pushbutton as unarmed (i.e. inactive). * If the button release occurs inside of the PushButton, the * callbacks for XmNactivateCallback are called. * ************************************************************************/ static void Activate( XmPushButtonGadget pb, XEvent *event ) { XmPushButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; XtExposeProc expose; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(pb)), XmQTmenuSystem); PBG_Armed(pb) = FALSE; _XmProcessLock(); expose = ((XmPushButtonGadgetClassRec *)(pb->object.widget_class))-> rect_class.expose; _XmProcessUnlock(); (* (expose)) ((Widget) pb, event, (Region) NULL); /* CR 9181: Consider clipping when testing visibility. */ if ((event->xany.type == ButtonPress || event->xany.type == ButtonRelease) && _XmGetPointVisibility((Widget)pb, event->xbutton.x_root, event->xbutton.y_root)) { call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = PBG_ClickCount(pb); /* _XmRecordEvent(event); */ /* Fix CR 3407 DRand 6/16/92 */ /* If the parent is menu system able, notify it about the select. */ if (menuSTrait != NULL) menuSTrait->entryCallback (XtParent(pb), (Widget) pb, &call_value); if ((! LabG_SkipCallback(pb)) && (PBG_ActivateCallback(pb))) { XFlush (XtDisplay (pb)); XtCallCallbackList ((Widget) pb, PBG_ActivateCallback(pb), &call_value); } } } static void PBG_FixTearoff( XmPushButtonGadget pb) { if (XmMENU_PULLDOWN == LabG_MenuType(pb)) { Widget mwid = XmGetPostedFromWidget(XtParent(pb)); if (mwid && XmIsRowColumn(mwid) && (XmMENU_OPTION == RC_Type(mwid)) && _XmIsActiveTearOff(XtParent(pb))) XmProcessTraversal((Widget) pb, XmTRAVERSE_CURRENT); } } /************************************************************************ * * ArmAndActivate * * - Called if the PushButtonGadget is being selected via keyboard * i.e. by pressing or . * - Called by SelectionBox and FileSelectionBox code when they receive * a default-action callback on their embedded XmList widgets. ************************************************************************/ /*ARGSUSED*/ static void ArmAndActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmPushButtonCallbackStruct call_value; Boolean already_armed = PBG_Armed(pb); Boolean is_menupane = LabG_IsMenupane(pb); Boolean torn_has_focus = FALSE; /* must be torn! */ XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (is_menupane && !XmIsMenuShell(XtParent(XtParent(pb)))) { /* Because the pane is torn and the parent is a transient shell, * the shell's focal point from _XmGetFocusData should be valid * (as opposed to getting it from a MenuShell). */ if (XmeFocusIsInShell((Widget)pb)) { /* In case allowAcceleratedInsensitiveUnmanagedMenuItems is True */ if (!XtIsSensitive((Widget)pb) || (!XtIsManaged((Widget)pb))) return; torn_has_focus = TRUE; } } if (is_menupane && menuSTrait != NULL) { PBG_Armed(pb) = FALSE; /* CR 7799: Torn off menus shouldn't be shared, so don't reparent. */ if (torn_has_focus) menuSTrait->popdown(XtParent(pb), event); else menuSTrait->buttonPopdown(XtParent(pb), event); /* If its in a torn off menu pane, show depressed button briefly. */ if (torn_has_focus) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* Set the focus here. */ XmProcessTraversal((Widget) pb, XmTRAVERSE_CURRENT); if ((pb->rectangle.width > 2 * pb->gadget.highlight_thickness) && (pb->rectangle.height > 2 * pb->gadget.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), LabG_BottomShadowGC(pb), LabG_TopShadowGC(pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } } else { XtExposeProc expose; /* We have no idea what the event is, so don't pass it through, * in case some future subclass is smarter about reexposure. */ PBG_Armed(pb) = TRUE; _XmProcessLock(); expose = ((XmPushButtonGadgetClassRec *)(pb->object.widget_class))-> rect_class.expose; _XmProcessUnlock(); (* (expose)) ((Widget) pb, (XEvent *)NULL, (Region) NULL); } XFlush (XtDisplay (pb)); if (event) { if (event->type == KeyPress) PBG_ClickCount (pb) = 1; } /* If the parent is menu system able, set the lastSelectToplevel before * the arm. It's ok if this is recalled later. */ if (menuSTrait != NULL) menuSTrait->getLastSelectToplevel (XtParent(pb)); if (PBG_ArmCallback(pb) && !already_armed) { call_value.reason = XmCR_ARM; call_value.event = event; call_value.click_count = PBG_ClickCount (pb); XtCallCallbackList ((Widget) pb, PBG_ArmCallback(pb), &call_value); } call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = PBG_ClickCount (pb); /* If the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) menuSTrait->entryCallback (XtParent(pb), (Widget) pb, &call_value); #ifdef FIX_1375 LabG_Pixmap(pb) = PBG_UnarmPixmap(pb); /*Added for fix bug 1375*/ #endif if ((! LabG_SkipCallback(pb)) && (PBG_ActivateCallback(pb))) { XFlush (XtDisplay (pb)); XtCallCallbackList ((Widget) pb, PBG_ActivateCallback(pb), &call_value); } PBG_Armed(pb) = FALSE; if (PBG_DisarmCallback(pb)) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; XtCallCallbackList ((Widget) pb, PBG_DisarmCallback(pb), &call_value); } if (is_menupane) { if (torn_has_focus && XtIsSensitive(wid)) { /* Leave the focus widget in an armed state */ PBG_Armed(pb) = TRUE; if (PBG_ArmCallback(pb)) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; XtCallCallbackList((Widget) pb, PBG_ArmCallback(pb), &call_value); } } else if (menuSTrait != NULL) { menuSTrait->reparentToTearOffShell(XtParent(pb), event); PBG_FixTearoff(pb); } } /* * If the button is still around, show it released, after a short delay. * This is done if the button is outside of a menus, or if in a torn * off menupane. */ if (!is_menupane || torn_has_focus) { if ((pb->object.being_destroyed == False) && (!(PBG_Timer(pb)))) { PBG_Timer(pb) = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)pb), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)(pb)); ((XmPushButtonGadget)(pb))->pushbutton.cache->timer_widget = wid; } } } /*ARGSUSED*/ static void ArmTimeout( XtPointer data, XtIntervalId *id ) { XmPushButtonGadget pb = (XmPushButtonGadget) data; PBG_Timer(pb) = 0; if (XtIsRealized ((Widget)pb) && XtIsManaged ((Widget)pb)) { if (LabG_IsMenupane(pb)) { /* When rapidly clicking, the focus may have moved away from this * widget, so check before changing the shadow. */ if (XmeFocusIsInShell((Widget)pb) && (XmGetFocusWidget((Widget)pb) == (Widget)pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* in a torn off menu, redraw shadows */ if ((pb->rectangle.width > 2 * pb->gadget.highlight_thickness) && (pb->rectangle.height > 2 * pb->gadget.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), LabG_TopShadowGC(pb), LabG_BottomShadowGC(pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } } else { XtExposeProc expose; _XmProcessLock(); expose = ((XmPushButtonGadgetClassRec *)(pb->object.widget_class))-> rect_class.expose; _XmProcessUnlock(); (* expose) ((Widget) pb, NULL, (Region) NULL); } XFlush (XtDisplay (pb)); } } /************************************************************************ * * Disarm * * Mark the pushbutton as unarmed (i.e. active). * The callbacks for XmNdisarmCallback are called.. * ************************************************************************/ static void Disarm( XmPushButtonGadget pb, XEvent *event ) { XmPushButtonCallbackStruct call_value; PBG_Armed(pb) = FALSE; if (PBG_DisarmCallback(pb)) { call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) pb, PBG_DisarmCallback(pb), &call_value); } } /************************************************************************ * * BtnDown * * This function processes a button down occuring on the pushbutton * when it is in a popup, pulldown, or option menu. * Popdown the posted menu. * Turn parent's traversal off. * Mark the pushbutton as armed (i.e. active). * The callbacks for XmNarmCallback are called. * ************************************************************************/ static void BtnDown( XmPushButtonGadget pb, XEvent *event ) { XmPushButtonCallbackStruct call_value; Boolean already_armed; ShellWidget popup; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(pb)), XmQTmenuSystem); /* Popdown other popus that may be up */ if (!(popup = (ShellWidget)_XmGetRC_PopupPosted(XtParent(pb)))) { if (!XmIsMenuShell(XtParent(XtParent(pb))) && menuSTrait != NULL) { /* In case tear off not armed and no grabs in place, do it now. * Ok if already armed and grabbed - nothing done. */ menuSTrait->tearOffArm(XtParent(pb)); } } if (popup) { if (popup->shell.popped_up && menuSTrait != NULL) menuSTrait->popdownEveryone((Widget) popup, event); } /* Set focus to this button. This must follow the possible * unhighlighting of the CascadeButton else it'll screw up active_child. */ (void)XmProcessTraversal((Widget) pb, XmTRAVERSE_CURRENT); /* get the location cursor - get consistent with Gadgets */ already_armed = PBG_Armed(pb); PBG_Armed(pb) = TRUE; if (etched_in) { Redisplay((Widget) pb, NULL, NULL); } else if ((pb->rectangle.width > 2 * pb->gadget.highlight_thickness) && (pb->rectangle.height > 2 * pb->gadget.highlight_thickness)) XmeDrawShadows ( XtDisplay (pb), XtWindow (pb), LabG_TopShadowGC(pb), LabG_BottomShadowGC(pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness, XmSHADOW_OUT); if (PBG_ArmCallback(pb) && !already_armed) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) pb, PBG_ArmCallback(pb), &call_value); } _XmRecordEvent (event); } /************************************************************************ * * BtnUp * * This function processes a button up occuring on the pushbutton * when it is in a popup, pulldown, or option menu. * Mark the pushbutton as unarmed (i.e. inactive). * The callbacks for XmNactivateCallback are called. * The callbacks for XmNdisarmCallback are called. * ************************************************************************/ static void BtnUp( Widget wid, XEvent *event ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmPushButtonCallbackStruct call_value; Boolean flushDone = False; Boolean popped_up = False; Boolean is_menupane = LabG_IsMenupane(pb); Widget shell = XtParent(XtParent(pb)); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); PBG_Armed(pb) = FALSE; if (menuSTrait != NULL) { if (is_menupane && !XmIsMenuShell(shell)) popped_up = menuSTrait->popdown((Widget) pb, event); else popped_up = menuSTrait->buttonPopdown((Widget) pb, event); } _XmRecordEvent(event); if (popped_up) return; call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = 1; /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) { menuSTrait->entryCallback(XtParent(pb), (Widget) pb, &call_value); flushDone = True; } if ((! LabG_SkipCallback(pb)) && (PBG_ActivateCallback(pb))) { XFlush (XtDisplay (pb)); flushDone = True; XtCallCallbackList ((Widget) pb, PBG_ActivateCallback(pb), &call_value); } if (PBG_DisarmCallback(pb)) { if (!flushDone) XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) pb, PBG_DisarmCallback(pb), &call_value); } /* If the original shell does not indicate an active menu, but rather a * tear off pane, leave the button in an armed state. Also, briefly * display the button as depressed to give the user some feedback of * the selection. */ if (is_menupane) { if (!XmIsMenuShell(shell)) { if (XtIsSensitive((Widget)pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; if ((pb->rectangle.width > 2 * pb->gadget.highlight_thickness) && (pb->rectangle.height > 2 * pb->gadget.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), LabG_BottomShadowGC(pb), LabG_TopShadowGC(pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); XFlush (XtDisplay (pb)); flushDone = True; /* set timer to redraw the shadow out again */ if (pb->object.being_destroyed == False) { if (!(PBG_Timer(pb))) { PBG_Timer(pb) = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)pb), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)(pb)); ((XmPushButtonGadget)(pb))->pushbutton.cache->timer_widget = wid; } } PBG_Armed(pb) = TRUE; if (PBG_ArmCallback(pb)) { if (!flushDone) XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget)pb, PBG_ArmCallback(pb), &call_value); } } } else if (menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(pb), event); } _XmSetInDragMode((Widget) pb, False); /* For the benefit of tear off menus, we must set the focus item * to this button. In normal menus, this would not be a problem * because the focus is cleared when the menu is unposted. */ if (!XmIsMenuShell(shell)) XmProcessTraversal((Widget) pb, XmTRAVERSE_CURRENT); PBG_FixTearoff(pb); } /************************************************************************ * * Enter * ************************************************************************/ static void Enter( Widget wid, XEvent *event ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmPushButtonCallbackStruct call_value; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (LabG_IsMenupane(pb)) { if ((((ShellWidget) XtParent(XtParent(pb)))->shell.popped_up) && _XmGetInDragMode((Widget) pb)) { if (PBG_Armed(pb)) return; /* So KHelp event is delivered correctly */ _XmSetFocusFlag(XtParent(XtParent(pb)), XmFOCUS_IGNORE, TRUE); XtSetKeyboardFocus(XtParent(XtParent(pb)), (Widget)pb); _XmSetFocusFlag(XtParent(XtParent(pb)), XmFOCUS_IGNORE, FALSE); PBG_Armed(pb) = TRUE; ((XmManagerWidget) XtParent(wid))->manager.active_child = wid; if (etched_in) { Redisplay((Widget) pb, NULL, NULL); } else if ((pb->rectangle.width > 2 * pb->gadget.highlight_thickness) && (pb->rectangle.height > 2 * pb->gadget.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), LabG_TopShadowGC(pb), LabG_BottomShadowGC(pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (PBG_ArmCallback(pb)) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList((Widget) pb, PBG_ArmCallback(pb), &call_value); } } } else { XtExposeProc expose; _XmEnterGadget((Widget) pb, event, NULL, NULL); if (PBG_Armed(pb) == TRUE) { _XmProcessLock(); expose = ((XmPushButtonGadgetClassRec *)(pb->object.widget_class))-> rect_class.expose; _XmProcessUnlock(); (* (expose)) ((Widget) pb, event, (Region) NULL); } } } /************************************************************************ * * Leave * ************************************************************************/ static void Leave( Widget wid, XEvent *event ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmPushButtonCallbackStruct call_value; if (LabG_IsMenupane(pb)) { if (_XmGetInDragMode((Widget) pb) && PBG_Armed(pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; PBG_Armed(pb) = FALSE; ((XmManagerWidget) XtParent(wid))->manager.active_child = NULL; if (etched_in) { Redisplay((Widget) pb, NULL, NULL); } XmeDrawHighlight (XtDisplay(pb), XtWindow(pb), LabG_BackgroundGC(pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness); if (PBG_DisarmCallback(pb)) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) pb, PBG_DisarmCallback(pb), &call_value); } } } else { _XmLeaveGadget((Widget) pb, event, NULL, NULL); if (PBG_Armed(pb) == TRUE) { XtExposeProc expose; PBG_Armed(pb) = FALSE; _XmProcessLock(); expose = ((XmPushButtonGadgetClassRec *)(pb->object.widget_class))-> rect_class.expose; _XmProcessUnlock(); (* (expose)) ((Widget) pb, event, (Region) NULL); PBG_Armed(pb) = TRUE; } } } /*************************************<->************************************* * * BorderHighlight * *************************************<->***********************************/ static void BorderHighlight( Widget wid ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmPushButtonCallbackStruct call_value; XEvent * event = NULL; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; Boolean already_armed = PBG_Armed(pb); if (LabG_IsMenupane(pb)) { PBG_Armed(pb) = TRUE; if (etched_in) { Redisplay((Widget) pb, NULL, NULL); } else if ((pb->rectangle.width > 2 * pb->gadget.highlight_thickness) && (pb->rectangle.height > 2 * pb->gadget.highlight_thickness)) XmeDrawShadows (XtDisplay (pb), XtWindow (pb), LabG_TopShadowGC(pb), LabG_BottomShadowGC(pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); if (!already_armed && PBG_ArmCallback(pb)) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) pb, PBG_ArmCallback(pb), &call_value); } } else { DrawBorderHighlight((Widget) pb); } } static void DrawBorderHighlight( Widget wid) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; int x, y, width, height, delta; Dimension highlight_width; XtEnum default_button_emphasis; if (!pb->rectangle.width || !pb->rectangle.height) return; pb->gadget.highlighted = True; pb->gadget.highlight_drawn = True; if ((PBG_DefaultButtonShadowThickness(pb) > 0)) highlight_width = pb->gadget.highlight_thickness - Xm3D_ENHANCE_PIXEL; else highlight_width = pb->gadget.highlight_thickness; if (highlight_width > 0) { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmEXTERNAL_HIGHLIGHT: delta = 0; break; case XmINTERNAL_HIGHLIGHT: if (PBG_DefaultButtonShadowThickness(pb)) delta = Xm3D_ENHANCE_PIXEL + 2 * (PBG_Compatible(pb) ? PBG_ShowAsDefault(pb) : PBG_DefaultButtonShadowThickness(pb)); else delta = 0; break; default: assert(FALSE); return; } x = pb->rectangle.x + delta; y = pb->rectangle.y + delta; width = pb->rectangle.width - 2 * delta; height = pb->rectangle.height - 2 * delta; XmeDrawHighlight(XtDisplay(pb), XtWindow(pb), LabG_HighlightGC(pb), x, y, width, height, highlight_width); } } /*************************************<->************************************* * * BorderUnhighlight * *************************************<->***********************************/ static void BorderUnhighlight( Widget wid ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmPushButtonCallbackStruct call_value; XEvent * event = NULL; if (LabG_IsMenupane(pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (!PBG_Armed(pb)) return; PBG_Armed(pb) = FALSE; if (etched_in) { Redisplay((Widget) pb, NULL, NULL); } XmeClearBorder(XtDisplay (pb), XtWindow (pb), pb->rectangle.x + pb->gadget.highlight_thickness, pb->rectangle.y + pb->gadget.highlight_thickness, pb->rectangle.width - 2 * pb->gadget.highlight_thickness, pb->rectangle.height - 2 * pb->gadget.highlight_thickness, pb->gadget.shadow_thickness); if (PBG_DisarmCallback(pb)) { XFlush (XtDisplay (pb)); call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList((Widget) pb, PBG_DisarmCallback(pb), &call_value); } } else { int border = pb->gadget.highlight_thickness - Xm3D_ENHANCE_PIXEL; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); XtEnum default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmINTERNAL_HIGHLIGHT: if (PBG_DefaultButtonShadowThickness(pb) && (border > 0)) { int x, y, width, height, delta; pb->gadget.highlighted = False; pb->gadget.highlight_drawn = False; delta = Xm3D_ENHANCE_PIXEL + 2 * (PBG_Compatible(pb) ? PBG_ShowAsDefault(pb) : PBG_DefaultButtonShadowThickness(pb)); x = pb->rectangle.x + delta; y = pb->rectangle.y + delta; width = pb->rectangle.width - 2 * delta; height = pb->rectangle.height - 2 * delta; XmeClearBorder(XtDisplay(pb), XtWindow(pb), x, y, width, height, border); break; } /* else fall through to XmEXTERNAL_HIGHLIGHT. */ case XmEXTERNAL_HIGHLIGHT: (*(xmGadgetClassRec.gadget_class.border_unhighlight)) (wid); break; default: assert(FALSE); return; } } } /*************************************<->************************************* * * KeySelect * * If the menu system traversal is enabled, do an activate and disarm * *************************************<->***********************************/ static void KeySelect( Widget wid, XEvent *event ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmPushButtonCallbackStruct call_value; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (!_XmIsEventUnique(event)) return; if (!_XmGetInDragMode((Widget) pb)) { PBG_Armed(pb) = FALSE; if (menuSTrait != NULL) menuSTrait->buttonPopdown(XtParent(pb), event); _XmRecordEvent(event); call_value.reason = XmCR_ACTIVATE; call_value.event = event; /* if the parent is menu system able, notify it about the select */ if (menuSTrait != NULL) { menuSTrait->entryCallback(XtParent(pb), (Widget) pb, &call_value); } if ((! LabG_SkipCallback(pb)) && (PBG_ActivateCallback(pb))) { XFlush (XtDisplay (pb)); XtCallCallbackList ((Widget) pb, PBG_ActivateCallback(pb), &call_value); } if (menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(pb), event); } } /*********************************************************** * * ClassInitialize * ************************************************************/ static void ClassInitialize( void ) { Cardinal wc_num_res, sc_num_res; XtResource *merged_list; int i, j; XtResourceList uncompiled; Cardinal num; /* * Label's and Pushbutton's resource lists are being merged into one * and assigned to xmPushButtonGCacheObjClassRec. This is for performance * reasons, since instead of two calls to XtGetSubResources(), * XtGetSubvaluse() and XtSetSubvalues() for both the superclass and * the widget class, now we have just one call with a merged resource list. * NOTE: At this point the resource lists for Label and Pushbutton do * have unique entries, but if there are resources in the superclass * that are being overwritten by the subclass then the merged_lists * need to be created differently. */ wc_num_res = xmPushButtonGCacheObjClassRec.object_class.num_resources; sc_num_res = xmLabelGCacheObjClassRec.object_class.num_resources; merged_list = (XtResource *) XtMalloc((sizeof(XtResource) * (wc_num_res + sc_num_res))); _XmTransformSubResources(xmLabelGCacheObjClassRec.object_class.resources, sc_num_res, &uncompiled, &num); for (i = 0; i < num; i++) merged_list[i] = uncompiled[i]; XtFree((char *)uncompiled); for (i = 0, j = num; i < wc_num_res; i++, j++) merged_list[j] = xmPushButtonGCacheObjClassRec.object_class.resources[i]; xmPushButtonGCacheObjClassRec.object_class.resources = merged_list; xmPushButtonGCacheObjClassRec.object_class.num_resources = wc_num_res + sc_num_res; PushBGClassExtensionRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmPUSH_BUTTON_GADGET_BIT); /* Install the menu savvy trait record, copying fields from XmLabelG */ _XmLabelGCloneMenuSavvy (wc, &MenuSavvyRecord); /* Install the activatable trait for all subclasses */ XmeTraitSet((XtPointer) wc, XmQTactivatable, (XtPointer) &pushButtonGAT); /* Install the takesDefault trait for all subclasses */ XmeTraitSet((XtPointer) wc, XmQTtakesDefault, (XtPointer) &pushButtonGTDT); } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /* ARGSUSED */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *cePtr; XmWidgetExtData extData; WidgetClass wc; Cardinal size; XtPointer newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); wc = (*cePtr)->secondaryObjectClass; size = wc->core_class.widget_size; newSec = _XmExtObjAlloc(size); reqSec = _XmExtObjAlloc(size); _XmProcessUnlock(); /* * Update pointers in instance records now so references to resources * in the cache record will be valid for use in CallProcs. * CallProcs are invoked by XtGetSubresources(). */ LabG_Cache(new_w) = &(((XmLabelGCacheObject)newSec)->label_cache); LabG_Cache(req) = &(((XmLabelGCacheObject)reqSec)->label_cache); PBG_Cache(new_w) = &(((XmPushButtonGCacheObject)newSec)->pushbutton_cache); PBG_Cache(req) = &(((XmPushButtonGCacheObject)reqSec)->pushbutton_cache); /* * Since the resource lists for label and pushbutton were merged at * ClassInitialize time we need to make only one call to * XtGetSubresources() */ XtGetSubresources (new_w, newSec, NULL, NULL, wc->core_class.resources, wc->core_class.num_resources, args, *num_args); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; ((XmPushButtonGCacheObject)newSec)->ext.extensionType = XmCACHE_EXTENSION; ((XmPushButtonGCacheObject)newSec)->ext.logicalParent = new_w; _XmPushWidgetExtData(new_w, extData, ((XmPushButtonGCacheObject)newSec)->ext.extensionType); memcpy(reqSec, newSec, size); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /*ARGSUSED*/ static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { /* CR 2990: Use XmNbuttonFontList as the default. */ if (LabG_Font(new_w) == NULL) LabG_Font(new_w) = XmeGetDefaultRenderTable (new_w, XmBUTTON_FONTLIST); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /*ARGSUSED*/ static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; XmPushButtonGadget pbw = (XmPushButtonGadget)new_w; /* * - register parts in cache. * - update cache pointers * - and free req */ _XmProcessLock(); LabG_Cache(pbw) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(pbw), (XtPointer) LabG_Cache(pbw), sizeof(XmLabelGCacheObjPart)); PBG_Cache(pbw) = (XmPushButtonGCacheObjPart *) _XmCachePart(PBG_ClassCachePart(pbw), (XtPointer) PBG_Cache(pbw), sizeof(XmPushButtonGCacheObjPart)); /* * We might want to break up into per-class work that gets explicitly * chained. For right now, each class has to replicate all * superclass logic in hook routine. */ /* * free the req subobject used for comparisons */ _XmPopWidgetExtData ((Widget) pbw, &ext, XmCACHE_EXTENSION); _XmExtObjFree ((XtPointer)ext->widget); _XmExtObjFree ((XtPointer)ext->reqWidget); _XmProcessUnlock(); XtFree((char *) ext); } /*************************************<->************************************* * * Initialize * *************************************<->***********************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmPushButtonGadget request = (XmPushButtonGadget) rw; XmPushButtonGadget new_w = (XmPushButtonGadget) nw; XmGadgetPart *pbgadget; int increase; int adjustment = 0; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(new_w)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (PBG_MultiClick(new_w) == XmINVALID_MULTICLICK) { if (LabG_IsMenupane(new_w)) PBG_MultiClick(new_w) = XmMULTICLICK_DISCARD; else PBG_MultiClick(new_w) = XmMULTICLICK_KEEP; } /* If menuProcs is not set up yet, try again. */ _XmProcessLock(); if (xmLabelGadgetClassRec.label_class.menuProcs == (XmMenuProc)NULL) xmLabelGadgetClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); _XmProcessUnlock(); PBG_Armed(new_w) = FALSE; PBG_Timer(new_w) = 0; ((XmPushButtonGadget)(new_w))->pushbutton.cache->timer_widget = (Widget)NULL; /* * Fix to introduce Resource XmNdefaultBorderWidth and compatibility * variable. * if defaultBorderWidth > 0, the program knows about this resource * and is therefore a Motif 1.1 program; otherwise it is a Motif 1.0 * program and old semantics of XmNshowAsDefault prevails. * - Sankar 2/1/90. */ if (PBG_DefaultButtonShadowThickness(new_w) > 0) PBG_Compatible (new_w) = False; else PBG_Compatible (new_w) = True; if (PBG_Compatible (new_w)) PBG_DefaultButtonShadowThickness(new_w) = PBG_ShowAsDefault(new_w); #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen(nw),NULL,NULL) != XmUNSPECIFIED_PIXMAP) { PBG_Compatible (new_w) = False; PBG_DefaultButtonShadowThickness(new_w) = 0; } #endif /* No unarm_pixmap but do have an arm_pixmap, use that. */ if ((LabG_Pixmap(new_w) == XmUNSPECIFIED_PIXMAP) && (PBG_ArmPixmap(new_w) != XmUNSPECIFIED_PIXMAP)) { XtWidgetProc resize; LabG_Pixmap(new_w) = PBG_ArmPixmap(new_w); if (request->rectangle.width == 0) new_w->rectangle.width = 0; if (request->rectangle.height == 0) new_w->rectangle.height = 0; _XmCalcLabelGDimensions((Widget) new_w); _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); (* resize) ((Widget) new_w); } if ((LabG_LabelType(new_w) == XmPIXMAP) && (PBG_ArmPixmap(new_w) != XmUNSPECIFIED_PIXMAP)) { if (request->rectangle.width == 0) new_w->rectangle.width = 0; if (request->rectangle.height == 0) new_w->rectangle.height = 0; SetPushButtonSize(new_w); } PBG_UnarmPixmap(new_w) = LabG_Pixmap(new_w); if (PBG_DefaultButtonShadowThickness(new_w)) { /* * Special hack for 3d enhancement of location cursor highlight. * - Make the box bigger. During drawing of location cursor * make it smaller. See in Primitive.c * May be we should use the macro: G_HighLightThickness(pbgadget); */ pbgadget = (XmGadgetPart *) (&(new_w->gadget)); pbgadget->highlight_thickness += Xm3D_ENHANCE_PIXEL; adjustment += Xm3D_ENHANCE_PIXEL; increase = 2 * PBG_DefaultButtonShadowThickness(new_w) + new_w->gadget.shadow_thickness + adjustment; /* Add the increase to the rectangle to compensate for extra space */ if (increase != 0) { LabG_MarginLeft(new_w) += increase; LabG_MarginRight(new_w) += increase; LabG_TextRect_x(new_w) += increase; new_w->rectangle.width += (increase << 1); LabG_MarginTop(new_w) += increase; LabG_MarginBottom(new_w) += increase; LabG_TextRect_y(new_w) += increase; new_w->rectangle.height += (increase << 1); } } if (LabG_IsMenupane(new_w)) { new_w->gadget.traversal_on = TRUE; } if (PBG_ArmColor(new_w) == INVALID_PIXEL) { XrmValue value; value.size = sizeof(Pixel); _XmSelectColorDefault ((Widget)new_w, XtOffsetOf(struct _XmPushButtonGCacheObjRec, pushbutton_cache.arm_color), &value); memcpy((char*) &PBG_ArmColor(new_w), value.addr, value.size); } /* Get the background fill GC */ if (! LabG_IsMenupane(new_w) || etched_in) { GetFillGC (new_w); new_w->label.fill_bg_box = _XmALWAYS_FILL_BG_BOX; if (LabG_BackgroundGC(new_w)) XtReleaseGC (XtParent (new_w), LabG_BackgroundGC(new_w)); _XmLabelSetBackgroundGC((XmLabelGadget) new_w); } else PBG_FillGc(new_w) = 0; /* Set to zero so _XmPushBCacheCompare will behave correctly. */ PBG_BackgroundGc(new_w) = 0; /* Initialize the interesting input types. */ new_w->gadget.event_mask = XmARM_EVENT | XmACTIVATE_EVENT | XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmMULTI_ARM_EVENT | XmMULTI_ACTIVATE_EVENT | XmBDRAG_EVENT; } /************************************************************************ * * GetFillGC * Get the graphics context used for filling in background of button. * ************************************************************************/ static void GetFillGC( XmPushButtonGadget pb ) { XGCValues values; XtGCMask valueMask; XmManagerWidget mw = (XmManagerWidget) XtParent(pb); valueMask = GCForeground | GCBackground | GCFillStyle; values.foreground = PBG_ArmColor(pb); values.background = LabG_Background(pb); values.fill_style = FillSolid; PBG_FillGc(pb) = XtGetGC ((Widget) mw, valueMask, &values); } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; Cardinal size; XmPushButtonGCacheObject newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmPushButtonGCacheObject)_XmExtObjAlloc(size); reqSec = (XmPushButtonGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy(&(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); memcpy(&(newSec->pushbutton_cache), PBG_Cache(newParent), sizeof(XmPushButtonGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); /* * Since the resource lists for label and pushbutton were merged at * ClassInitialize time we need to make only one call to * XtSetSubvalues() */ XtSetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); memcpy((XtPointer)reqSec, (XtPointer)newSec, size); LabG_Cache(newParent) = &(((XmLabelGCacheObject)newSec)->label_cache); LabG_Cache(refParent) = &(((XmLabelGCacheObject)extData->reqWidget)->label_cache); PBG_Cache(newParent) = &(((XmPushButtonGCacheObject)newSec)->pushbutton_cache); PBG_Cache(refParent) = &(((XmPushButtonGCacheObject)extData->reqWidget)->pushbutton_cache); _XmExtImportArgs((Widget)newSec, args, num_args); /* CR 2990: Use XmNbuttonFontList as the default. */ if (LabG_Font(newParent) == NULL) LabG_Font(newParent) = XmeGetDefaultRenderTable (newParent, XmBUTTON_FONTLIST); return FALSE; } /************************************************************************ * * GetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; XmPushButtonGCacheObject newSec; Cardinal size; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmPushButtonGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy(&(newSec->label_cache), LabG_Cache(newParent), sizeof(XmLabelGCacheObjPart)); memcpy(&(newSec->pushbutton_cache), PBG_Cache(newParent), sizeof(XmPushButtonGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); /* Note that if a resource is defined in the superclass's as well as a * subclass's resource list and if a NULL is passed in as the third * argument to XtSetArg, then when a GetSubValues() is done by the * superclass the NULL is replaced by a value. Now when the subclass * gets the arglist it doesn't see a NULL and thinks it's an address * it needs to stuff a value into and sure enough it breaks. * This means that we have to pass the same arglist with the NULL to * both the superclass and subclass and propagate the values up once * the XtGetSubValues() are done. */ /* * Since the resource lists for label and pushbutton were merged at * ClassInitialize time we need to make only one call to * XtGetSubvalues() */ XtGetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmExtGetValuesHook((Widget)newSec, args, num_args); } /************************************************************************ * * GetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmProcessLock(); _XmExtObjFree((XtPointer)ext->widget); _XmProcessUnlock(); XtFree((char *) ext); } /************************************************************************ * * SetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; /* * - register parts in cache. * - update cache pointers * - and free req */ /* assign if changed! */ _XmProcessLock(); if (!_XmLabelCacheCompare((XtPointer)LabG_Cache(new_w), (XtPointer)LabG_Cache(current))) { _XmCacheDelete((XtPointer) LabG_Cache(current)); LabG_Cache(new_w) = (XmLabelGCacheObjPart *) _XmCachePart(LabG_ClassCachePart(new_w), (XtPointer) LabG_Cache(new_w), sizeof(XmLabelGCacheObjPart)); } else LabG_Cache(new_w) = LabG_Cache(current); /* assign if changed! */ if (!_XmPushBCacheCompare((XtPointer)PBG_Cache(new_w), (XtPointer)PBG_Cache(current))) { _XmCacheDelete((XtPointer) PBG_Cache(current)); PBG_Cache(new_w) = (XmPushButtonGCacheObjPart *) _XmCachePart(PBG_ClassCachePart(new_w), (XtPointer) PBG_Cache(new_w), sizeof(XmPushButtonGCacheObjPart)); } else PBG_Cache(new_w) = PBG_Cache(current); _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer)ext->widget); _XmExtObjFree((XtPointer)ext->reqWidget); _XmProcessUnlock(); XtFree((char *) ext); return FALSE; } /*************************************<->************************************* * * SetValues(current, request, new_w) * * Description: * ----------- * This is the set values procedure for the pushbutton class. It is * called last (the set values rtnes for its superclasses are called * first). * * * Inputs: * ------ * current = original widget; * request = original copy of request; * new_w = copy of request which reflects changes made to it by * set values procedures of its superclasses; * last = TRUE if this is the last set values procedure to be called. * * Outputs: * ------- * * Procedures Called * ----------------- * *************************************<->***********************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmPushButtonGadget current = (XmPushButtonGadget) cw; XmPushButtonGadget request = (XmPushButtonGadget) rw; XmPushButtonGadget new_w = (XmPushButtonGadget) nw; int increase; Boolean flag = FALSE; /* our return value */ XmManagerWidget newmw = (XmManagerWidget) XtParent(new_w); int adjustment; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(new_w)); Boolean etched_in = dpy->display.enable_etched_in_menu; /* * Fix to introduce Resource XmNdefaultBorderWidth and compatibility * variable. * if defaultBorderWidth of the current and new are different, then * the programmer is setting the resource XmNdefaultBorderWidth; i.e. it * defaultBorderWidth > 0, the program knows about this resource * a Motif 1.1 program; otherwise it is a Motif 1.0 * program and old semantics of XmNshowAsDefault prevails. * Note if (PBG_ShowAsDefault(gadget) == 0) then we are NOT currently * drawing defaultBorderWidth; if it is > 0, we should be drawing * the shadow in defaultorderWidth; * - Sankar 2/1/90. */ if (PBG_DefaultButtonShadowThickness(new_w) != PBG_DefaultButtonShadowThickness(current)) PBG_Compatible (new_w) = False; if (PBG_Compatible (new_w)) PBG_DefaultButtonShadowThickness(new_w) = PBG_ShowAsDefault(new_w); adjustment = AdjustHighLightThickness (new_w, current); if (PBG_DefaultButtonShadowThickness(new_w) != PBG_DefaultButtonShadowThickness(current)) { if (PBG_DefaultButtonShadowThickness(new_w) > PBG_DefaultButtonShadowThickness(current)) { if (PBG_DefaultButtonShadowThickness(current) > 0) increase = (2 * PBG_DefaultButtonShadowThickness(new_w) + new_w->gadget.shadow_thickness) - (2 * PBG_DefaultButtonShadowThickness(current) + current->gadget.shadow_thickness); else increase = (2 * PBG_DefaultButtonShadowThickness(new_w) + new_w->gadget.shadow_thickness); } else { if (PBG_DefaultButtonShadowThickness(new_w) > 0) increase = - ((2 * PBG_DefaultButtonShadowThickness(current) + current->gadget.shadow_thickness) - (2 * PBG_DefaultButtonShadowThickness(new_w) + new_w->gadget.shadow_thickness)); else increase = - (2 * PBG_DefaultButtonShadowThickness(current) + current->gadget.shadow_thickness); } increase += adjustment; if (LabG_RecomputeSize(new_w) || request->rectangle.width == 0) { LabG_MarginLeft(new_w) += increase; LabG_MarginRight(new_w) += increase; new_w->rectangle.width += (increase << 1); flag = TRUE; } else if (increase != 0) { /* add the change to the rectangle */ LabG_MarginLeft(new_w) += increase; LabG_MarginRight(new_w) += increase; new_w->rectangle.width += (increase << 1); flag = TRUE; } if (LabG_RecomputeSize(new_w) || request->rectangle.height == 0) { LabG_MarginTop(new_w) += increase; LabG_MarginBottom(new_w) += increase; new_w->rectangle.height += (increase << 1); flag = TRUE; } else if (increase != 0) { /* add the change to the rectangle */ LabG_MarginTop(new_w) += increase; LabG_MarginBottom(new_w) += increase; new_w->rectangle.height += (increase << 1); flag = TRUE; } #ifndef XTHREADS _XmReCacheLabG((Widget) new_w); #endif } if ((PBG_ArmPixmap(new_w) != PBG_ArmPixmap(current)) && (LabG_LabelType(new_w) == XmPIXMAP) && (PBG_Armed(new_w))) flag = TRUE; /* No unarm_pixmap but do have an arm_pixmap, use that. */ if ((LabG_Pixmap(new_w) == XmUNSPECIFIED_PIXMAP) && (PBG_ArmPixmap(new_w) != XmUNSPECIFIED_PIXMAP)) { LabG_Pixmap(new_w) = PBG_ArmPixmap(new_w); if (LabG_RecomputeSize(new_w) && request->rectangle.width == current->rectangle.width) new_w->rectangle.width = 0; if (LabG_RecomputeSize(new_w) && request->rectangle.height == current->rectangle.height) new_w->rectangle.width = 0; _XmCalcLabelGDimensions((Widget) new_w); { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); (* resize) ((Widget) new_w); } } if (LabG_Pixmap(new_w) != LabG_Pixmap(current)) { PBG_UnarmPixmap(new_w) = LabG_Pixmap(new_w); if ((LabG_LabelType(new_w) == XmPIXMAP) && (!PBG_Armed(new_w))) flag = TRUE; } if ((LabG_LabelType(new_w) == XmPIXMAP) && (PBG_ArmPixmap(new_w) != PBG_ArmPixmap(current))) { if ((LabG_RecomputeSize(new_w))) { if (request->rectangle.width == current->rectangle.width) new_w->rectangle.width = 0; if (request->rectangle.height == current->rectangle.height) new_w->rectangle.height = 0; } SetPushButtonSize(new_w); flag = TRUE; } if ((PBG_FillOnArm(new_w) != PBG_FillOnArm(current)) && (PBG_Armed(new_w) == TRUE)) flag = TRUE; if (! LabG_IsMenupane(new_w) || etched_in) { /* See if the GC need to be regenerated and widget redrawn. */ if (PBG_ArmColor(new_w) != PBG_ArmColor(current)) { if (PBG_Armed(new_w)) flag = TRUE; /* see PIR 5091 */ XtReleaseGC ((Widget) newmw, PBG_FillGc(new_w)); GetFillGC (new_w); } /* Sun Apr 18 17:50:27 1993 * Currently not using PBG_BackgroundGc(). */ } /* Initialize the interesting input types. */ new_w->gadget.event_mask = XmARM_EVENT | XmACTIVATE_EVENT | XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmMULTI_ARM_EVENT | XmMULTI_ACTIVATE_EVENT | XmBDRAG_EVENT; /* OSF Fix pir 3469 */ if ((flag == False) && XtIsRealized((Widget) new_w)) { /* No size change has taken place. */ if ((PBG_ShowAsDefault(current) != 0) && (PBG_ShowAsDefault(new_w) == 0)) EraseDefaultButtonShadow (new_w); if ((PBG_ShowAsDefault(current) == 0) && (PBG_ShowAsDefault(new_w) != 0)) DrawDefaultButtonShadow (new_w); } return flag; } /************************************************************************ * * Help * This function processes Function Key 1 press occuring on the PushButton. * ************************************************************************/ static void Help( XmPushButtonGadget pb, XEvent *event ) { Boolean is_menupane = LabG_IsMenupane(pb); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(pb)), XmQTmenuSystem); if (is_menupane && menuSTrait != NULL) menuSTrait->buttonPopdown(XtParent(pb), event); _XmSocorro((Widget) pb, event, NULL, NULL); if (is_menupane && menuSTrait != NULL) menuSTrait->reparentToTearOffShell(XtParent(pb), event); } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget wid ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; XmManagerWidget mw = (XmManagerWidget) XtParent(pb); XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (PBG_Timer(pb) && ((XmPushButtonGadget)(pb))->pushbutton.cache->timer_widget == wid) { XtRemoveTimeOut (PBG_Timer(pb)); PBG_Timer(pb) = (XtIntervalId)0; } /* BEGIN OSF Fix pir 2746 */ if (!LabG_IsMenupane(pb) || etched_in) { XtReleaseGC ((Widget) mw, PBG_FillGc(pb)); /* * Sun Apr 18 17:51:25 1993 * Currently not using PBG_BackgroundGc */ /* END OSF Fix pir 2746 */ } _XmProcessLock(); _XmCacheDelete((XtPointer) PBG_Cache(pb)); _XmProcessUnlock(); } /************************************************************************** * * Resize(w) * **************************************************************************/ static void Resize( Widget w ) { register XmPushButtonGadget pb = (XmPushButtonGadget) w; if (LabG_IsPixmap(w)) SetPushButtonSize(pb); else { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); (* resize) ((Widget) pb); } } /*ARGSUSED*/ static void ActivateCommonG( XmPushButtonGadget pb, XEvent *event, Mask event_mask ) { if (LabG_IsMenupane(pb)) { if (event->type == ButtonRelease) BtnUp ((Widget) pb, event); else /* assume KeyRelease */ KeySelect ((Widget) pb, event); } else { if (event->type == ButtonRelease) { Activate (pb, event); Disarm (pb, event); } else /* assume KeyPress or KeyRelease */ (* (((XmPushButtonGadgetClassRec *)(pb->object.widget_class))-> gadget_class.arm_and_activate)) ((Widget) pb, event, NULL, NULL); } } /********************************************************* * Functions for manipulating Secondary Resources. *********************************************************/ /* * GetPushBGSecResData() * Create a XmSecondaryResourceDataRec for each secondary resource; * Put the pointers to these records in an array of pointers; * Return the pointer to the array of pointers. */ /*ARGSUSED*/ static Cardinal GetPushBGClassSecResData( WidgetClass w_class, XmSecondaryResourceData **data_rtn ) { int arrayCount; XmBaseClassExt bcePtr; _XmProcessLock(); bcePtr = &(PushBGClassExtensionRec); arrayCount = _XmSecondaryResourceData (bcePtr, data_rtn, NULL, NULL, NULL, GetPushBGClassSecResBase); _XmProcessUnlock(); return (arrayCount); } /* * GetPushBGClassResBase () * retrun the address of the base of resources. */ /*ARGSUSED*/ static XtPointer GetPushBGClassSecResBase( Widget widget, XtPointer client_data ) /* unused */ { XtPointer widgetSecdataPtr; size_t labg_cache_size = sizeof (XmLabelGCacheObjPart); size_t pushbg_cache_size = sizeof (XmPushButtonGCacheObjPart); char *cp; widgetSecdataPtr = (XtPointer) XtMalloc(labg_cache_size + pushbg_cache_size + 1); _XmProcessLock(); if (widgetSecdataPtr) { cp = (char *) widgetSecdataPtr; memcpy(cp, LabG_Cache(widget), labg_cache_size); cp += labg_cache_size; memcpy(cp, PBG_Cache(widget), pushbg_cache_size); } /* else Warning: error cannot allocate Memory */ /* widgetSecdataPtr = (XtPointer) (LabG_Cache(widget)); */ _XmProcessUnlock(); return (widgetSecdataPtr); } #ifdef DEFAULT_GLYPH_PIXMAP /* * DrawDefaultGlyphPixmap (pb) */ static void DrawDefaultGlyphPixmap( XmPushButtonGadget pb ) { int dx, dy, width, height; Pixmap def_pixmap; unsigned int def_pixmap_width, def_pixmap_height; def_pixmap = _XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), &def_pixmap_width, &def_pixmap_height); /* We draw in the margin right area here. */ dx = pb->rectangle.x + pb->rectangle.width - (LabG_MarginRight(pb) + LabG_MarginWidth(pb) + pb->gadget.highlight_thickness + pb->gadget.shadow_thickness); dy = pb->rectangle.y + pb->gadget.highlight_thickness + pb->gadget.shadow_thickness + LabG_MarginTop(pb) + LabG_MarginHeight(pb) + (MAX(LabG_TextRect(pb).height, LabG_AccTextRect(pb).height) - def_pixmap_height)/2; width = MIN(def_pixmap_width, LabG_MarginRight(pb)); height = MIN(def_pixmap_height, MAX(LabG_TextRect(pb).height, LabG_AccTextRect(pb).height)); XCopyPlane (XtDisplay (pb), def_pixmap, XtWindow (XtParent(pb)), LabG_NormalGC(pb), 0, 0, width, height, dx, dy, 1); } #endif /* DEFAULT_GLYPH_PIXMAP */ #ifdef DEFAULT_GLYPH_PIXMAP /* * EraseDefaultGlyphPixmap (pb) */ static void EraseDefaultGlyphPixmap( XmPushButtonGadget pb ) { int dx, dy, width, height; /* we clear the margin right area here */ dx = pb->rectangle.x + pb->rectangle.width - (LabG_MarginRight(pb) + LabG_MarginWidth(pb) + pb->gadget.highlight_thickness + pb->gadget.shadow_thickness); dy = pb->rectangle.y + pb->gadget.highlight_thickness + pb->gadget.shadow_thickness + LabG_MarginTop(pb) + LabG_MarginHeight(pb); width = LabG_MarginRight(pb); height = MAX(LabG_TextRect(pb).height, LabG_AccTextRect(pb).height); XClearArea (XtDisplay (pb), XtWindow (XtParent(pb)), dx, dy, width, height, False); } #endif /* DEFAULT_GLYPH_PIXMAP */ /* * EraseDefaultButtonShadow (pb) * - Called from SetValues() - effort to optimize shadow drawing. */ static void EraseDefaultButtonShadow( XmPushButtonGadget pb ) { int size, x, y, width, height, delta; XtEnum default_button_emphasis; if (!XtIsRealized((Widget)pb) || !XtIsManaged((Widget)pb)) return; if (LabG_IsMenupane(pb)) { ShellWidget mshell = (ShellWidget) XtParent(XtParent(pb)); if (!mshell->shell.popped_up) return; } #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) { EraseDefaultGlyphPixmap(pb); return; } #endif size = PBG_DefaultButtonShadowThickness(pb); if (size > 0) { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmEXTERNAL_HIGHLIGHT: delta = pb->gadget.highlight_thickness; break; case XmINTERNAL_HIGHLIGHT: delta = Xm3D_ENHANCE_PIXEL; break; default: assert(FALSE); return; } size += Xm3D_ENHANCE_PIXEL; x = pb->rectangle.x + delta; y = pb->rectangle.y + delta; width = pb->rectangle.width - (2 * delta); height = pb->rectangle.height - (2 * delta); XmeClearBorder(XtDisplay(pb), XtWindow(pb), x, y, width, height, size); } } /* * DrawDefaultButtonShadow (pb) * - Called from SetValues() - effort to optimize shadow drawing. */ static void DrawDefaultButtonShadow( XmPushButtonGadget pb ) { if (!(XtIsRealized((Widget)pb))) return; if (LabG_IsMenupane(pb)) { ShellWidget mshell = (ShellWidget)XtParent(XtParent(pb)); if (!mshell->shell.popped_up) return; } DrawDefaultButtonShadows(pb); } /* * AdjustHighLightThickness () * HighlightThickness has a dependency on default_button-shadow-thickness; * This routine (called from SetValues) adjust for that dependency. * Applications should be aware that * if a pushbutton gadget has with (default_button-shadow-thickness == 0) * - then if through a XtSetValue it sets (default_button-shadow-thickness > 0) * the application-specified highlight-thickness is internally increased by * Xm3D_ENHANCE_PIXEL to enhance the 3D-appearance of the defaultButton * Shadow. Similarly if a pushbutton gadget has (default_button-shadow_ * thickness > 0), and it resets the (default_button-shadow-thickness = 0) * through a XtSetValue , then the existing highlight-thickness is decreased * by Xm3D_ENHANCE_PIXEL. * The border-highlight when drawn is however is always of the same * thickness as specified by the application since compensation is done * in the drawing routine (see BorderHighlight). */ static int AdjustHighLightThickness( XmPushButtonGadget new_w, XmPushButtonGadget current ) { XmGadgetPart *pbnew, *pbcurrent; int adjustment = 0; pbnew = (XmGadgetPart *) (&(new_w->gadget)); pbcurrent = (XmGadgetPart *) (&(current->gadget)); if (PBG_DefaultButtonShadowThickness(new_w)) { if (!(PBG_DefaultButtonShadowThickness(current))) { pbnew->highlight_thickness += Xm3D_ENHANCE_PIXEL; adjustment += Xm3D_ENHANCE_PIXEL; } else if (pbnew->highlight_thickness != pbcurrent->highlight_thickness) { pbnew->highlight_thickness += Xm3D_ENHANCE_PIXEL; adjustment += Xm3D_ENHANCE_PIXEL; } } else { if (PBG_DefaultButtonShadowThickness(current)) { /* The default_button_shadow_thickness was > 0 and is now * being set to 0, so take away the adjustment for enhancement. */ if (pbnew->highlight_thickness == pbcurrent->highlight_thickness) { pbnew->highlight_thickness -= Xm3D_ENHANCE_PIXEL; adjustment -= Xm3D_ENHANCE_PIXEL; } } /* * This will have a bug if in a XtSetValues the application * removes the default_button_shadow_thickness and also * sets the high-light-thickness to a value of * (old-high-light-thickness (from previous XtSetValue) + * Xm3D_ENHANCE_PIXEL). * This will be documented. */ } return (adjustment); } /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmPushButtonGadget pb = (XmPushButtonGadget) wid; if (XtIsRealized((Widget)pb)) { if (LabG_IsMenupane(pb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); Boolean etched_in = dpy->display.enable_etched_in_menu; ShellWidget mshell = (ShellWidget)XtParent(XtParent(pb)); if (!mshell->shell.popped_up) return; DrawPushButtonLabelGadget (pb, event, region); /* Refresh border highlight too. */ if (PBG_Armed(pb)) DrawPushButtonGadgetShadows (pb); } else { DrawPushButtonLabelGadget (pb, event, region); DrawPushButtonGadgetShadows (pb); if (pb->gadget.highlighted) DrawBorderHighlight((Widget) pb); } } } /* * DrawPushButtonLabelGadget() */ static void DrawPushButtonLabelGadget( XmPushButtonGadget pb, XEvent *event, Region region ) { GC tmp_gc = NULL; GC fill_tmp_gc = NULL; Boolean replace_for_fill_tmpGC = False; Boolean replaceGC = False; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (PBG_Armed(pb) && ((! LabG_IsMenupane(pb) && PBG_FillOnArm(pb)) || (LabG_IsMenupane(pb) && etched_in))) { if ((LabG_LabelType(pb) == XmSTRING || LabG_LabelType(pb) == XmPIXMAP_AND_STRING) && (PBG_ArmColor(pb) == LabG_Foreground(pb))) { tmp_gc = LabG_NormalGC(pb); LabG_NormalGC(pb) = LabG_BackgroundGC(pb); replaceGC = True; } fill_tmp_gc = LabG_BackgroundGC(pb); LabG_BackgroundGC(pb) = PBG_FillGc(pb); replace_for_fill_tmpGC = True; } DrawLabelGadget(pb, event, region); if (replaceGC) LabG_NormalGC(pb) = tmp_gc; if (replace_for_fill_tmpGC) LabG_BackgroundGC(pb) = fill_tmp_gc; } /* * DrawLabelGadget() */ static void DrawLabelGadget( XmPushButtonGadget pb, XEvent *event, Region region ) { Boolean deadjusted = False; LRectangle background_box; if (LabG_LabelType(pb) == XmPIXMAP || LabG_LabelType(pb) == XmPIXMAP_AND_STRING) { if (PBG_Armed(pb)) { if (PBG_ArmPixmap(pb) != XmUNSPECIFIED_PIXMAP) LabG_Pixmap(pb) = PBG_ArmPixmap(pb); else LabG_Pixmap(pb) = PBG_UnarmPixmap(pb); } else /* pushbutton is unarmed */ LabG_Pixmap(pb) = PBG_UnarmPixmap(pb); } /* * This doesn't need to be done here every time. But it does do * the right thing. */ ComputePBLabelArea(pb, &background_box); /* * Temporarily remove the Xm3D_ENHANCE_PIXEL hack ("adjustment") * from the margin values, so we don't confuse LabelG. The * original code did the same thing, but in a round-about way. */ _XmProcessLock(); if (PBG_DefaultButtonShadowThickness(pb) > 0) { deadjusted = True; LabG_MarginLeft(pb) -= Xm3D_ENHANCE_PIXEL; LabG_MarginRight(pb) -= Xm3D_ENHANCE_PIXEL; LabG_MarginTop(pb) -= Xm3D_ENHANCE_PIXEL; LabG_MarginBottom(pb) -= Xm3D_ENHANCE_PIXEL; } _XmRedisplayLabG((Widget) pb, event, region, &background_box); if (deadjusted) { LabG_MarginLeft(pb) += Xm3D_ENHANCE_PIXEL; LabG_MarginRight(pb) += Xm3D_ENHANCE_PIXEL; LabG_MarginTop(pb) += Xm3D_ENHANCE_PIXEL; LabG_MarginBottom(pb) += Xm3D_ENHANCE_PIXEL; } _XmProcessUnlock(); } /* * DrawPushButtonGadgetShadows() * * Note: PushButton has two types of shadows: primitive-shadow and * default-button-shadow. * If pushbutton is in a menu only primitive shadows are drawn. */ static void DrawPushButtonGadgetShadows( XmPushButtonGadget pb ) { if (PBG_DefaultButtonShadowThickness(pb) #ifdef DEFAULT_GLYPH_PIXMAP || (_XmGetDefaultGlyphPixmap (XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) #endif ) { EraseDefaultButtonShadows (pb); if (PBG_ShowAsDefault(pb)) DrawDefaultButtonShadows (pb); } if (pb->gadget.shadow_thickness > 0) DrawPBGadgetShadows(pb); } /* * DrawPBGadgetShadows (pb) * - Should be called only if PrimitiveShadowThickness > 0 */ static void DrawPBGadgetShadows( XmPushButtonGadget pb ) { GC top_gc, bottom_gc; int dx, adjust, shadow_thickness; if (PBG_Armed(pb)) { bottom_gc = LabG_TopShadowGC(pb); top_gc = LabG_BottomShadowGC(pb); } else { bottom_gc = LabG_BottomShadowGC(pb); top_gc = LabG_TopShadowGC(pb); } shadow_thickness = pb->gadget.shadow_thickness; if ((shadow_thickness > 0) && (top_gc) && (bottom_gc)) { if (PBG_Compatible(pb)) adjust = PBG_ShowAsDefault(pb); else adjust = PBG_DefaultButtonShadowThickness(pb); if (adjust > 0) { adjust = (adjust << 1); dx = pb->gadget.highlight_thickness + adjust + pb->gadget.shadow_thickness; } else dx = pb->gadget.highlight_thickness; if ((pb->rectangle.width > 2 * dx) && (pb->rectangle.height > 2 * dx)) { XmeDrawShadows (XtDisplay (pb), XtWindow (pb), top_gc, bottom_gc, dx + pb->rectangle.x, dx + pb->rectangle.y, pb->rectangle.width - 2 * dx, pb->rectangle.height - 2 * dx, shadow_thickness, XmSHADOW_OUT); } } } static void EraseDefaultButtonShadows( XmPushButtonGadget pb ) { int x, y, width, height, delta; int default_button_shadow; XtEnum default_button_emphasis; if (PBG_Compatible(pb)) default_button_shadow = (int) (PBG_ShowAsDefault(pb)); else default_button_shadow = (int) (PBG_DefaultButtonShadowThickness(pb)); if (default_button_shadow > 0) { XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmINTERNAL_HIGHLIGHT: delta = Xm3D_ENHANCE_PIXEL; break; case XmEXTERNAL_HIGHLIGHT: delta = pb->gadget.highlight_thickness; break; default: assert(FALSE); return; } x = pb->rectangle.x + delta; y = pb->rectangle.y + delta; width = pb->rectangle.width - 2 * delta; height = pb->rectangle.height - 2 * delta; if ((width > 0) && (height > 0)) XmeClearBorder(XtDisplay (pb), XtWindow (XtParent(pb)), x, y, width, height, default_button_shadow); } #ifdef DEFAULT_GLYPH_PIXMAP else if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) EraseDefaultGlyphPixmap(pb); #endif } /* * DrawDefaultButtonShadows() * - get the topShadowColor and bottomShadowColor from the parent; * use those colors to construct top and bottom gc; use these * GCs to draw the shadows of the button. * - Should not be called if pushbutton is in a row column or in a menu. * - Should be called only if a defaultbuttonshadow is to be drawn. */ static void DrawDefaultButtonShadows( XmPushButtonGadget pb ) { GC top_gc, bottom_gc; int default_button_shadow_thickness; #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) { DrawDefaultGlyphPixmap(pb); return; } #endif top_gc = XmParentBottomShadowGC(pb); bottom_gc = XmParentTopShadowGC(pb); if ((bottom_gc == None) || (top_gc == None)) return; if (PBG_Compatible(pb)) default_button_shadow_thickness = PBG_ShowAsDefault(pb); else default_button_shadow_thickness = PBG_DefaultButtonShadowThickness(pb); /* * Compute location of bounding box to contain the defaultButtonShadow. */ if ((default_button_shadow_thickness > 0) && (pb->rectangle.width > 2 * pb->gadget.highlight_thickness) && (pb->rectangle.height > 2 * pb->gadget.highlight_thickness)) { int x, y, width, height, delta; XmDisplay xm_dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(pb)); XtEnum default_button_emphasis = xm_dpy->display.default_button_emphasis; switch (default_button_emphasis) { case XmEXTERNAL_HIGHLIGHT: delta = pb->gadget.highlight_thickness; break; case XmINTERNAL_HIGHLIGHT: delta = Xm3D_ENHANCE_PIXEL; break; default: assert(FALSE); return; } x = pb->rectangle.x + delta; y = pb->rectangle.y + delta; width = pb->rectangle.width - 2 * delta; height = pb->rectangle.height - 2 * delta; XmeDrawShadows(XtDisplay(pb), XtWindow(pb), top_gc, bottom_gc, x, y, width, height, default_button_shadow_thickness, XmSHADOW_OUT); } } static XmImportOperator ShowAsDef_ToHorizPix( Widget widget, int offset, XtArgVal *value ) { XtArgVal oldValue; XmImportOperator returnVal; oldValue = *value; returnVal = XmeToHorizontalPixels(widget, offset, value); if (oldValue && !*value) *value = (XtArgVal) 1; return(returnVal); } static Boolean ComputePBLabelArea( XmPushButtonGadget pb, LRectangle *box ) { Boolean result = True; int dx, adjust; short fill = 0; if ((PBG_ArmColor(pb) == LabG_TopShadowColor(pb)) || (PBG_ArmColor(pb) == LabG_BottomShadowColor(pb))) fill = 1; if (pb == NULL) result = False; else { if (PBG_DefaultButtonShadowThickness(pb) > 0) { adjust = PBG_DefaultButtonShadowThickness(pb); if (! LabG_IsMenupane(pb)) adjust += pb->gadget.shadow_thickness; adjust = (adjust << 1); dx = pb->gadget.highlight_thickness + adjust + fill; } else { dx = pb->gadget.highlight_thickness; if (! LabG_IsMenupane(pb)) dx += pb->gadget.shadow_thickness + fill; } box->x = dx + pb->rectangle.x; box->y = dx + pb->rectangle.y; adjust = (dx << 1); box->width = pb->rectangle.width - adjust; box->height= pb->rectangle.height - adjust; } return (result); } static void ExportHighlightThickness( Widget widget, int offset, XtArgVal *value ) { if (PBG_DefaultButtonShadowThickness(widget) || PBG_ShowAsDefault(widget)) { if ((int)*value >= Xm3D_ENHANCE_PIXEL) *value -= Xm3D_ENHANCE_PIXEL; } XmeFromHorizontalPixels (widget, offset, value); } /************************************************************************* * * SetPushButtonSize(newpb) * Picks the larger dimension when the armPixmap is a * different size than the label pixmap(i.e the unarm pixmap). * ************************************************************************/ static void SetPushButtonSize( XmPushButtonGadget newpb) { unsigned int onW = 0, onH = 0, onW2 = 0, onH2 = 0; if (PBG_ArmPixmap(newpb) != XmUNSPECIFIED_PIXMAP) { XmeGetPixmapData(XtScreen(newpb), LabG_Pixmap(newpb), NULL, NULL, NULL, NULL, NULL, NULL, &onW, &onH); XmeGetPixmapData(XtScreen(newpb), PBG_ArmPixmap(newpb), NULL, NULL, NULL, NULL, NULL, NULL, &onW2, &onH2); newpb->label.PixmapRect.width = MAX(onW2, onW); newpb->label.PixmapRect.height = MAX(onH2, onH); _XmLabelGCalcTextRect((Widget)newpb); } /* Let LabelG do the rest. */ { XtWidgetProc resize; _XmProcessLock(); resize = xmLabelGadgetClassRec.rect_class.resize; _XmProcessUnlock(); (* resize) ((Widget) newpb); } } /************************************************************************ * * ChangeCB * add or remove the activate callback list. * ************************************************************************/ static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) { if (setunset) XtAddCallback (w, XmNactivateCallback, activCB, closure); else XtRemoveCallback (w, XmNactivateCallback, activCB, closure); } /************************************************************************ * * ShowAsDefault * set up the default visual * ************************************************************************/ static void ShowAsDefault(Widget w, XtEnum state) { XmPushButtonGadget pb = (XmPushButtonGadget) w; Dimension dbShadowTh; switch (state) { case XmDEFAULT_READY: { /* We have pixels, but the button unit type might not be * pixel, so save it and restore it after the setvalues. */ unsigned char saved_unit_type = ((XmGadget)w)->gadget.unit_type; #ifdef DEFAULT_GLYPH_PIXMAP unsigned int def_pixmap_width; if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), &def_pixmap_width, NULL) != XmUNSPECIFIED_PIXMAP) { /* we will use the margin right area, so increase it */ PBG_Compatible(pb) = False; ((XmGadget)w)->gadget.unit_type = XmPIXELS; XtVaSetValues(w, XmNmarginRight, def_pixmap_width, NULL); ((XmGadget)w)->gadget.unit_type = saved_unit_type; } else #endif if (!PBG_DefaultButtonShadowThickness(pb)) { if (pb->gadget.shadow_thickness > 1) dbShadowTh = pb->gadget.shadow_thickness >> 1; else dbShadowTh = pb->gadget.shadow_thickness; /* CR 7474: Disable pushbutton compatibility mode. */ PBG_Compatible(pb) = False; ((XmGadget)w)->gadget.unit_type = XmPIXELS; XtVaSetValues(w, XmNdefaultButtonShadowThickness, dbShadowTh, NULL); ((XmGadget)w)->gadget.unit_type = saved_unit_type; } } break; case XmDEFAULT_ON : /* CR 7474: Disable pushbutton compatibility mode. */ PBG_Compatible(pb) = False; XtVaSetValues(w, XmNshowAsDefault, True, NULL); break; case XmDEFAULT_OFF : XtVaSetValues(w, XmNshowAsDefault, False, NULL); break; case XmDEFAULT_FORGET : default: #ifdef DEFAULT_GLYPH_PIXMAP if (_XmGetDefaultGlyphPixmap(XtScreen((Widget)(pb)), NULL, NULL) != XmUNSPECIFIED_PIXMAP) XtVaSetValues(w, XmNmarginRight, 0, NULL); else #endif if (!PBG_DefaultButtonShadowThickness(pb)) XtVaSetValues(w, XmNdefaultButtonShadowThickness, 0, NULL); } } /************************************************************************ * * Application Accessible External Functions * ************************************************************************/ /************************************************************************ * * XmCreatePushButton * Create an instance of a pushbutton and return the widget id. * ************************************************************************/ Widget XmCreatePushButtonGadget( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return XtCreateWidget (name, xmPushButtonGadgetClass, parent, arglist, argcount); } Widget XmVaCreatePushButtonGadget(Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmPushButtonGadgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedPushButtonGadget(Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmPushButtonGadgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/DrawingAI.h0000644000175000017500000000305212672140200012665 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: DrawingAI.h /main/6 1995/07/14 10:28:32 drk $ */ #ifndef _XmDrawingAI_h #define _XmDrawingAI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmDrawingAreaInput( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDrawingAI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PanedP.h0000644000175000017500000002615312672140200012236 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmPanedP_h #define _XmPanedP_h #if defined(VMS) || defined(__VMS) #include #endif #include #include #ifdef __cplusplus extern "C" { #endif /********************************************************************* * * Paned Widget Private Data * *********************************************************************/ /* New fields for the Paned widget class record */ typedef struct _XmPanedClassPart { XtPointer extension; } XmPanedClassPart; /* Full Class record declaration */ typedef struct _XmPanedClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmPanedClassPart paned_class; } XmPanedClassRec; extern XmPanedClassRec xmPanedClassRec; /* Paned constraint record */ typedef struct _XmPanedConstraintsPart { /* Resources. */ Dimension min; /* Minimum height */ Dimension max; /* Maximum height */ Boolean allow_resize; /* TRUE iff child resize requests are ok */ Boolean show_sash; /* TRUE iff child will have sash below it, when it is not the bottom pane. */ Boolean skip_adjust; /* TRUE iff child's height should not be */ /* changed without explicit user action. */ int position; /* position location in Paned (relative to other children) ** NIY ** */ Dimension preferred_size; /* The Preferred size of the pane. Iff this is zero then ask child for size.*/ Boolean resize_to_pref; /* resize this pane to its preferred size on a resize or change managed after realize. */ Boolean is_a_pane; /* INTERNAL INFO */ /* Private state. */ Position delta; /* Desired Location */ Position olddelta; /* The last value of delta. */ Dimension wp_size; /* widget's preferred on size */ Dimension wp_off_size; /* widget's preferred off size */ int size; /* the size the widget will actually get. */ Widget sash; /* The sash for this child */ Widget separator; /* The separator for this child */ Boolean prefs_inited; /* Preferences have been inited... */ } XmPanedConstraintsPart, *Pane; typedef struct _XmPanedConstraintsRec { XmManagerConstraintPart manager; XmPanedConstraintsPart paned; } XmPanedConstraintsRec, *XmPanedConstraints; /* * Ugliness: the XmOffset macros require this naming convention, yet * epak already depends on the pluralized name ;( */ typedef XmPanedConstraintsPart XmPanedConstraintPart; /* * The Pane Stack Structure. */ typedef struct _PaneStack { struct _PaneStack * next; /* The next element on the stack. */ Pane pane; /* The pane in this element on the stack. */ int start_size; /* The size of this element when it was pushed onto the stack. */ } PaneStack; #define NO_ADJUST ((char) 0) #define BEGAN_ADJUST ((char) 1) /* New Fields for the XmPaned widget record */ typedef struct { /* resources */ Position sash_indent; /* Location of sashs (per motif) */ Boolean refiguremode; /* Whether to refigure changes right now */ XtTranslations sash_translations; /* sash translation table */ Dimension internal_bw; /* internal border width. */ unsigned char orientation; /* Orientation of paned widget. */ Cursor cursor; /* Cursor for paned window */ /* Things from Motif behaviour */ Boolean separator_on; /* make separator visible */ Dimension margin_width; /* space between right and left edges of Paned window and it's children */ Dimension margin_height; /* space between top and bottom edges of Paned window and it's children */ /* sash modifying resources */ Dimension sash_width; /* Modify sash width */ Dimension sash_height; /* Modify sash height */ Dimension sash_shadow_thickness; /* Modify sash shadow_thickness */ /* Private */ Boolean recursively_called; /* for ChangeManaged */ Boolean resize_children_to_pref; /* override constraint resources and resize all children to preferred size. */ short increment_count; /* Sash increment count */ char repane_status; /* current adjust state. */ Position start_loc; /* mouse origin when adjusting */ GC flipgc; /* GC to use when animating borders */ short num_panes; /* count of managed panes */ short num_slots; /*number of avail. slots for kids */ PaneStack * stack; /* The pane stack for this widget.*/ WidgetList managed_children; /* keep track of managed children */ Boolean allow_unused_space; /* should the paned widget allow * a pane to be shrunk to the point * that there is unused space at * the bottom/right of the widget */ } XmPanedPart; /************************************************************************** * * Full instance record declaration * **************************************************************************/ typedef struct _XmPanedRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmPanedPart paned; } XmPanedRec; /************************************************************ * * Functions * ************************************************************/ void _XmFromPanedPixels(Widget, int, XtArgVal *); XmImportOperator _XmToPanedPixels(Widget, int, XtArgVal *); /************************************************************ * * Macros * ************************************************************/ /* * XmResolvePartOffsets stuff follows */ #define XmPaned_sash_indent(w) (((XmPanedWidget)(w))->paned.sash_indent) #define XmPaned_refiguremode(w) (((XmPanedWidget)(w))->paned.refiguremode) #define XmPaned_sash_translations(w) (((XmPanedWidget)(w))->paned.sash_translations) #define XmPaned_internal_bw(w) (((XmPanedWidget)(w))->paned.internal_bw) #define XmPaned_orientation(w) (((XmPanedWidget)(w))->paned.orientation) #define XmPaned_cursor(w) (((XmPanedWidget)(w))->paned.cursor) #define XmPaned_separator_on(w) (((XmPanedWidget)(w))->paned.separator_on) #define XmPaned_margin_width(w) (((XmPanedWidget)(w))->paned.margin_width) #define XmPaned_margin_height(w) (((XmPanedWidget)(w))->paned.margin_height) #define XmPaned_sash_width(w) (((XmPanedWidget)(w))->paned.sash_width) #define XmPaned_sash_height(w) (((XmPanedWidget)(w))->paned.sash_height) #define XmPaned_sash_shadow_thickness(w) (((XmPanedWidget)(w))->paned.sash_shadow_thickness) #define XmPaned_recursively_called(w) (((XmPanedWidget)(w))->paned.recursively_called) #define XmPaned_resize_children_to_pref(w) (((XmPanedWidget)(w))->paned.resize_children_to_pref) #define XmPaned_increment_count(w) (((XmPanedWidget)(w))->paned.increment_count) #define XmPaned_repane_status(w) (((XmPanedWidget)(w))->paned.repane_status) #define XmPaned_start_loc(w) (((XmPanedWidget)(w))->paned.start_loc) #define XmPaned_flipgc(w) (((XmPanedWidget)(w))->paned.flipgc) #define XmPaned_num_panes(w) (((XmPanedWidget)(w))->paned.num_panes) #define XmPaned_num_slots(w) (((XmPanedWidget)(w))->paned.num_slots) #define XmPaned_stack(w) (((XmPanedWidget)(w))->paned.stack) #define XmPaned_managed_children(w) (((XmPanedWidget)(w))->paned.managed_children) #define XmPaned_allow_unused_space(w) (((XmPanedWidget)(w))->paned.allow_unused_space) #define XmPanedC_min(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.min) #define XmPanedC_max(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.max) #define XmPanedC_allow_resize(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.allow_resize) #define XmPanedC_show_sash(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.show_sash) #define XmPanedC_skip_adjust(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.skip_adjust) #define XmPanedC_position(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.position) #define XmPanedC_preferred_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.preferred_size) #define XmPanedC_resize_to_pref(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.resize_to_pref) #define XmPanedC_is_a_pane(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.is_a_pane) #define XmPanedC_delta(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.delta) #define XmPanedC_olddelta(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.olddelta) #define XmPanedC_wp_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.wp_size) #define XmPanedC_wp_off_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.wp_off_size) #define XmPanedC_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.size) #define XmPanedC_sash(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.sash) #define XmPanedC_separator(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.separator) #define XmPanedC_prefs_inited(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.prefs_inited) #define ForceSashOff(pane) ((pane)->min == (pane)->max) #define PaneConsRec(w) ((XmPanedConstraints)(w)->core.constraints) #define PaneInfo(w) (&(((XmPanedConstraintsRec*)((w)->core.constraints))->paned)) #define HasSash(w) (XmPanedC_sash(w) != NULL) #define HasSep(w) (XmPanedC_separator(w) != NULL) #define PaneIndex(w) (XmPanedC_position(w)) #define IsVert(w) (XmPaned_orientation(w) == XmVERTICAL) #define IsLastPane(pw, childP) ((XmPaned_managed_children((pw)) + \ XmPaned_num_panes((pw)) - 1) == childP) #define ForAllPaned(pw, childP) \ for ( ((childP) = (XmPaned_managed_children((pw)))) ; \ ((childP) < ((XmPaned_managed_children((pw))) \ + (XmPaned_num_panes((pw))))) ; \ (childP)++ ) #define NthPane(pw, paneIndex) (XmPaned_managed_children((pw)) + (paneIndex)) #ifdef _cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmPanedP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/LayoutT.h0000644000175000017500000000302512672140200012461 00000000000000/* $XConsortium: LayoutT.h /main/5 1995/07/15 20:52:38 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmLayoutT_H #define _XmLayoutT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTspecifyLayoutDirection; /* Trait structures and typedefs, place typedefs first */ typedef XmDirection (*XmGetLayoutDirectionProc)(Widget); /* Version 0: initial release. */ typedef struct { int version; /* 0 */ XmGetLayoutDirectionProc get_direction; } XmSpecifyLayoutDirectionTraitRec, *XmSpecifyLayoutDirectionTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmLayoutT_H */ motif-2.3.8/lib/Xm/Form.h0000644000175000017500000000427513145162623012004 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmForm_h #define _XmForm_h #include #ifdef __cplusplus extern "C" { #endif /* Form Widget */ externalref WidgetClass xmFormWidgetClass; typedef struct _XmFormClassRec * XmFormWidgetClass; typedef struct _XmFormRec * XmFormWidget; /* ifndef for Fast Subclassing */ #ifndef XmIsForm #define XmIsForm(w) XtIsSubclass(w, xmFormWidgetClass) #endif /* XmIsForm */ /******** Public Function Declarations ********/ extern Widget XmCreateForm( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern Widget XmCreateFormDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern Widget XmVaCreateForm( Widget parent, char *name, ...); extern Widget XmVaCreateManagedForm( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmForm_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ColorS.c0000644000175000017500000015303612672140200012264 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES ************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "ColorSP.h" #include #include #include #include #include #include #include #include #include #include #include #include "XmI.h" /************************************************************ * TYPEDEFS AND DEFINES ************************************************************/ #define SUPERCLASS ((WidgetClass) &xmManagerClassRec) /************************************************************ * MACROS ************************************************************/ /************************************************************ * GLOBAL DECLARATIONS ************************************************************/ extern void XmeNavigChangeManaged(Widget); /************************************************************ * STATIC FUNCTION DECLARATIONS ************************************************************/ static void ChangeManaged(Widget w); static void ClassInitialize(void), Destroy(Widget), Resize(Widget); static void ClassPartInitialize(WidgetClass w_class); static void Initialize(Widget, Widget, ArgList, Cardinal *); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static XtGeometryResult GeometryHandler(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static Boolean UpdateColorWindow(XmColorSelectorWidget, Boolean); static Boolean color_name_changed(XmColorSelectorWidget, char *); static Boolean FindColor(XmColorSelectorWidget, int *); static Boolean CvtStringToColorMode(Display *, XrmValuePtr, Cardinal, XrmValuePtr, XrmValuePtr, XtPointer *); static Boolean DefaultVisualDisplay(XmColorSelectorWidget, Pixel, XColor, char *); static void CalcPreferredSize(XmColorSelectorWidget, Dimension *, Dimension *); static void SelectColor(XmColorSelectorWidget); static void slider_changed(Widget, XtPointer, XtPointer); static void list_selected(Widget, XtPointer, XtPointer); static void change_mode(Widget, XtPointer, XtPointer); static void new_mode(XmColorSelectorWidget, XmColorMode); static void compute_size(XmColorSelectorWidget); static void read_rgb_file(XmColorSelectorWidget, ArgList, Cardinal, Boolean); static void SetSliders(XmColorSelectorWidget); static void CreateColorSliders(XmColorSelectorWidget, ArgList, Cardinal); static void CreateSelectorRadio(XmColorSelectorWidget, ArgList, Cardinal); static void CreateColorWindow(XmColorSelectorWidget, ArgList, Cardinal); static void NoPrivateColormaps(XmColorSelectorWidget, Pixel, XColor, char *); static void PrivateColormaps(XmColorSelectorWidget, Pixel, XColor, char *); #ifdef notdef static void CreateTypes(XmColorSelectorWidget, Widget, ArgList, Cardinal); #endif static int CmpColors(const void *, const void *); static char *find_name(char *); static int GetVisual(XmColorSelectorWidget); static void GetValues_XmNredSliderLabel ( Widget w, int n, XtArgVal *value) ; static void GetValues_XmNgreenSliderLabel( Widget w, int n, XtArgVal *value) ; static void GetValues_XmNblueSliderLabel( Widget w, int n, XtArgVal *value) ; static void GetValues_XmNcolorListTogLabel( Widget w, int n, XtArgVal *value) ; static void GetValues_XmNsliderTogLabel( Widget w, int n, XtArgVal *value) ; static void GetValues_XmNnoCellError( Widget w, int n, XtArgVal *value) ; static void GetValues_XmNfileReadError( Widget w, int n, XtArgVal *value) ; /************************************************************ * STATIC DECLARATIONS ************************************************************/ static XtResource resources[] = { { XmNcolorMode, XmCColorMode, XmRXmColorMode, sizeof(XmColorMode), XtOffsetOf(XmColorSelectorRec, cs.color_mode), XmRImmediate, (XtPointer) XmScaleMode }, { XmNcolorName, XmCString, XmRString, sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.color_name), XmRString, "White" }, #ifdef VMS { XmNrgbFile, XmCString, XmRString, sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file), XmRString, (XtPointer) "sys$manager:decw$rgb.dat" }, #else { XmNrgbFile, XmCString, XmRString, sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file), XmRString, (XtPointer) "/usr/lib/X11/rgb.txt" }, #endif { XmNmarginWidth, XmCMargin, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmColorSelectorRec, cs.margin_width), XmRImmediate, (XtPointer) 2 }, { XmNmarginHeight, XmCMargin, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmColorSelectorRec, cs.margin_height), XmRImmediate, (XtPointer) 2 }, { XmNredSliderLabel, XmCSliderLabel, XmRXmString, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.slider_labels[0]), XmRString, (XtPointer) "Red" }, { XmNgreenSliderLabel, XmCSliderLabel, XmRXmString, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.slider_labels[1]), XmRString, (XtPointer) "Green" }, { XmNblueSliderLabel, XmCSliderLabel, XmRXmString, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.slider_labels[2]), XmRString, (XtPointer) "Blue" }, { XmNcolorListTogLabel, XmCTogLabel, XmRXmString, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.tog_labels[0]), XmRString, (XtPointer) "Color List" }, { XmNsliderTogLabel, XmCTogLabel, XmRXmString, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.tog_labels[1]), XmRString,(XtPointer)"Color Sliders" }, { XmNnoCellError, XmCNoCellError, XmRXmString, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.no_cell_error), XmRString, (XtPointer)"\n\nNo Color Cell Available!" }, { XmNfileReadError, XmCFileReadError, XmRXmString, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.file_read_error), XmRString, (XtPointer)"Could not read rgb.txt file:" } }; static XmSyntheticResource get_resources[] = { { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(XmColorSelectorRec, cs.margin_width), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmColorSelectorRec, cs.margin_height), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNredSliderLabel, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.slider_labels[0]), GetValues_XmNredSliderLabel, NULL }, { XmNgreenSliderLabel, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.slider_labels[1]), GetValues_XmNgreenSliderLabel, NULL }, { XmNblueSliderLabel, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.slider_labels[2]), GetValues_XmNblueSliderLabel, NULL }, { XmNcolorListTogLabel, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.tog_labels[0]), GetValues_XmNcolorListTogLabel, NULL }, { XmNsliderTogLabel, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.tog_labels[1]), GetValues_XmNsliderTogLabel, NULL }, { XmNnoCellError, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.no_cell_error), GetValues_XmNnoCellError, NULL }, { XmNfileReadError, sizeof(XmString), XtOffsetOf(XmColorSelectorRec, cs.strings.file_read_error), GetValues_XmNfileReadError, NULL } }; XmColorSelectorClassRec xmColorSelectorClassRec = { { /* core fields */ /* superclass */ SUPERCLASS, /* class_name */ "XmColorSelector", /* widget_size */ sizeof(XmColorSelectorRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ False, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ (Cardinal)0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ True, /* compress_exposure */ True, /* compress_enterleave */ True, /* visible_interest */ False, /* destroy */ Destroy, /* resize */ Resize, /* expose */ NULL, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL, }, { /* composite_class fields */ /* geometry_manager */ GeometryHandler, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ NULL, /* num resources */ 0, /* constraint size */ sizeof(XmColorSelectorConstraintRec), /* destroy proc */ NULL, /* init proc */ NULL, /* set values proc */ NULL, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ NULL, /* num_syn_cont_resources */ 0, /* parent_process */ NULL, /* extension */ NULL, }, { /* color_selector_class fields */ /* mumble */ NULL, } }; WidgetClass xmColorSelectorWidgetClass = (WidgetClass)&xmColorSelectorClassRec; /************************************************************ * STATIC CODE ************************************************************/ /* Function Name: ClassInitialize * Description: Called to initialize class specific information. * Arguments: widget_class - the widget class. * Returns: none. */ static void ClassInitialize(void) { XmColorSelectorClassRec *wc = &xmColorSelectorClassRec; XtSetTypeConverter(XmRString, XmRXmColorMode, (XtTypeConverter) CvtStringToColorMode, NULL, (Cardinal) 0, XtCacheAll, NULL); } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmCOLORSELECTOR_BIT); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: request - what was originally requested. * set - what will be created (our superclasses have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /* ARGSUSED */ static void Initialize(Widget request, Widget set, ArgList args, Cardinal *num_args) { XmColorSelectorWidget csw = (XmColorSelectorWidget)set; Dimension width, height; String temp; char message_buffer[BUFSIZ]; ArgList f_args; Cardinal f_num_args; Widget button; _XmFilterArgs(args, *num_args, xm_std_filter, &f_args, &f_num_args); /* * Initialize important values. */ XmColorS_good_cell(csw) = False; temp = XmColorS_color_name(csw); XmColorS_color_name(csw) = NULL; XmColorS_list(csw) = NULL; CreateColorSliders(csw, f_args, f_num_args); CreateSelectorRadio(csw, f_args, f_num_args); CreateColorWindow(csw, f_args, f_num_args); XmColorS_rgb_file(csw) = XtNewString(XmColorS_rgb_file(csw)); XmColorS_colors(csw) = NULL; read_rgb_file(csw, f_args, f_num_args, True); if (!color_name_changed(csw, temp)) { snprintf(message_buffer, BUFSIZ, XmNunparsableColorMsg, temp); XmeWarning((Widget)set, message_buffer); (void) color_name_changed(csw, "White"); } slider_changed(NULL, (XtPointer) csw, NULL); CalcPreferredSize(csw, &width, &height); if ( csw->core.width < 1 ) csw->core.width = width; if ( csw->core.height < 1 ) csw->core.height = height; new_mode(csw, XmColorS_color_mode(csw)); button = XmColorS_chose_mode(csw)[XmColorS_color_mode(csw)]; XmToggleButtonSetState(button, True, False); XtFree((XtPointer) f_args); { int i; for( i = 0; i < 3; i++ ) XmColorS_strings(csw).slider_labels[i] = XmStringCopy(XmColorS_strings(csw).slider_labels[i]); for (i = 0; i< XmColorSelector_NUM_TOGGLES; i++) XmColorS_strings(csw).tog_labels[i] = XmStringCopy(XmColorS_strings(csw).tog_labels[i]); XmColorS_strings(csw).file_read_error = XmStringCopy(XmColorS_strings(csw).file_read_error); XmColorS_strings(csw).no_cell_error = XmStringCopy(XmColorS_strings(csw).no_cell_error); } } /* Function Name: Destroy * Description: Called to destroy this widget. * Arguments: w - Color Selector Widget to destroy. * Returns: none. */ /* ARGSUSED */ static void Destroy(Widget w) { XmColorSelectorWidget csw = (XmColorSelectorWidget)w; if (XmColorS_good_cell(csw)) { XFreeColors(XtDisplay(csw), csw->core.colormap, &XmColorS_color_pixel(csw), 1, 0); } XtFree((char*) XmColorS_colors(csw)); XtFree((char*) XmColorS_color_name(csw)); XtFree((char*) XmColorS_rgb_file(csw)); { int i; for( i = 0; i < 3; i++ ) XmStringFree(XmColorS_strings(csw).slider_labels[i]); for (i = 0; i< XmColorSelector_NUM_TOGGLES; i++) XmStringFree(XmColorS_strings(csw).tog_labels[i]); XmStringFree(XmColorS_strings(csw).file_read_error); XmStringFree(XmColorS_strings(csw).no_cell_error); } } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - Color Selector Widget to realize. * Returns: none. */ /* ARGSUSED */ static void Resize(Widget w) { compute_size((XmColorSelectorWidget)w); } static Boolean AreDiff(char *s1, char *s2) { if (s1 && !s2) return True; if (s2 && !s1) return True; if (!s1 && !s2) return False; /* they exist; now safe to do strcmp */ return strcmp(s1, s2); } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /* ARGSUSED */ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal *num_args) { XmColorSelectorWidget csw = (XmColorSelectorWidget)set; XmColorSelectorWidget curr = (XmColorSelectorWidget)current; /* * Pass argument list through to all children. */ { ArgList f_args; Cardinal f_num_args; _XmFilterArgs(args, *num_args, xm_std_filter, &f_args, &f_num_args); _XmSetValuesOnChildren(set, f_args, f_num_args); XtFree((XtPointer) f_args); } if (XmColorS_color_mode(curr) != XmColorS_color_mode(csw)) { new_mode(csw, XmColorS_color_mode(csw)); XmToggleButtonSetState(XmColorS_chose_mode(csw)[XmColorS_color_mode(csw)], True, True); } /* ** Don't compare pointers; they are allocated, so passing the same file ** in twice will trip this expensive function unless we compare the ** values of the strings (when they exist) */ if (AreDiff(XmColorS_rgb_file(curr), XmColorS_rgb_file(csw))) { read_rgb_file(csw, NULL, 0, False); } if (XmColorS_rgb_file(curr) != XmColorS_rgb_file(csw)) { XtFree((char*) XmColorS_rgb_file(curr)); XmColorS_rgb_file(csw) = XtNewString(XmColorS_rgb_file(csw)); } if ((XmColorS_margin_height(curr) != XmColorS_margin_height(csw)) || (XmColorS_margin_width(curr) != XmColorS_margin_width(csw))) { compute_size(csw); } if (XmColorS_color_name(curr) != XmColorS_color_name(csw)) { String oldValue; /* old color name, will free. */ String newValue; /* new color name, allocate */ char string_buffer[BUFSIZ]; oldValue = XmColorS_color_name(curr); newValue = XmColorS_color_name(csw); if (!streq(newValue, oldValue)) { /* * Color name changed will automatically free the old * value on success... */ XmColorS_color_name(csw) = oldValue; /* so it free's the right thing. */ if (!color_name_changed(csw, newValue)) { snprintf(string_buffer, BUFSIZ, XmNunparsableColorMsg, newValue); XmeWarning(set, string_buffer); XmColorS_color_name(csw) = oldValue; } } else { XtFree(oldValue); XmColorS_color_name(csw) = XtNewString(newValue); } } { int i; for( i = 0; i < 3; i++ ) { if (XmColorS_strings(curr).slider_labels[i] != XmColorS_strings(csw).slider_labels[i]) { XmStringFree(XmColorS_strings(curr).slider_labels[i]); XmColorS_strings(csw).slider_labels[i] = XmStringCopy(XmColorS_strings(csw).slider_labels[i]); XtVaSetValues(XmColorS_sliders(csw)[i], XmNtitleString, XmColorS_strings(csw).slider_labels[i], NULL); } } for (i = 0; i< XmColorSelector_NUM_TOGGLES; i++) { if (XmColorS_strings(curr).tog_labels[i] != XmColorS_strings(csw).tog_labels[i]) { XmStringFree(XmColorS_strings(curr).tog_labels[i]); XmColorS_strings(csw).tog_labels[i] = XmStringCopy(XmColorS_strings(csw).tog_labels[i]); XtVaSetValues(XmColorS_chose_mode(csw)[i], XmNlabelString, XmColorS_strings(csw).tog_labels[i], NULL); } } if (XmColorS_strings(curr).file_read_error != XmColorS_strings(csw).file_read_error) { XmStringFree(XmColorS_strings(curr).file_read_error); XmColorS_strings(csw).file_read_error = XmStringCopy(XmColorS_strings(csw).file_read_error); } if (XmColorS_strings(curr).no_cell_error != XmColorS_strings(csw).no_cell_error) { XmStringFree(XmColorS_strings(curr).no_cell_error); XmColorS_strings(csw).no_cell_error = XmStringCopy(XmColorS_strings(csw).no_cell_error); } } return FALSE; } /* Function Name: GeometryHandler * Description: handles request from children for size changes. * Arguments: child - the child to change. * request - desired geometry of child. * result - what will be allowed if almost. * Returns: status. */ /* ARGSUSED */ static XtGeometryResult GeometryHandler(Widget w, XtWidgetGeometry *request, XtWidgetGeometry *result) { return(XtGeometryNo); } /* Function Name: QueryGeometry * Description: Called when my parent wants to know what size * I would like to be. * Arguments: w - the widget to check. * indended - constriants imposed by the parent. * preferred - what I would like. * Returns: See Xt Manual. */ static XtGeometryResult QueryGeometry(Widget w,XtWidgetGeometry *intended, XtWidgetGeometry *preferred) { CalcPreferredSize((XmColorSelectorWidget) w, &(preferred->width), &(preferred->height)); return(_XmHWQuery(w, intended, preferred)); } /* Function Name: ChangeManaged * Description: Called when a management change happens. * Arguments: w - the csw widget. * Returns: none */ static void ChangeManaged(Widget w) { compute_size((XmColorSelectorWidget) w); XmeNavigChangeManaged(w); } /************************************************************ * Type Converters. ************************************************************/ /* Function Name: CvtStringToColorMode * Description: Converts a string to a ColorMode * Arguments: dpy - the X Display. * args, num_args - *** NOT USED *** * from - contains the string to convert. * to - contains the converted node state. * junk - *** NOT USED *** . * Returns: */ /* ARGSUSED */ static Boolean CvtStringToColorMode(Display *dpy, XrmValuePtr args, Cardinal num_args, XrmValuePtr from, XrmValuePtr to, XtPointer * junk) { static XmColorMode mode; char lowerName[BUFSIZ]; XmCopyISOLatin1Lowered(lowerName, (char *)from->addr); if (streq(lowerName, "listmode")) mode = XmListMode; else if (streq(lowerName, "scalemode")) mode = XmScaleMode; else { XtDisplayStringConversionWarning(dpy, from->addr, XmRXmColorMode); return(False); /* Conversion failed. */ } to->size = sizeof(XmColorMode); if ( to->addr == NULL ) { to->addr = (XtPointer)&mode; return(True); } else if ( to->size >= sizeof(XmColorMode) ) { XmColorMode *state = (XmColorMode *) to->addr; *state = mode; return(True); } return(False); } /************************************************************ * LOCAL CODE ************************************************************/ /* Function Name: CalcPreferredSize * Description: Calculates the size this widget would prefer to be. * Arguments: csw - the color selector widget. * RETURNED width, height - preferred size of the color selector. * Returns: none. */ static void CalcPreferredSize(XmColorSelectorWidget csw, Dimension *width, Dimension *height) { XtWidgetGeometry geo; Widget *childP; *height = *width = 0; ForAllChildren(csw, childP) { if (*childP == XmColorS_bb(csw)) continue; (void)XtQueryGeometry(*childP, NULL, &geo); ASSIGN_MAX(*width, (geo.width + (2 * geo.border_width))); geo.height += 2 * geo.border_width; if ( *childP == XtParent(XmColorS_color_window(csw)) ) continue; else if ( *childP == XmColorS_scrolled_list(csw) ) *height += (int)(4 * geo.height)/3; else *height += geo.height; *height += XmColorS_margin_height(csw); } *width += 2 * XmColorS_margin_width(csw); *height += 2 * XmColorS_margin_height(csw); } /* Function Name: color_name_changed * Description: Change in the color name string. * Arguments: csw - the color selector widget. * name - the color name. * Returns: True if successful */ /* ARGSUSED */ static Boolean color_name_changed(XmColorSelectorWidget csw, char *name) { String old_val = XmColorS_color_name(csw); if ( name == NULL ) { XmColorS_color_name(csw) = NULL; XtFree((XtPointer) old_val); return(True); } XmColorS_color_name(csw) = XtNewString(name); if (!UpdateColorWindow(csw, True)) { XtFree((XtPointer) XmColorS_color_name(csw)); XmColorS_color_name(csw) = old_val; return(False); } SetSliders(csw); SelectColor(csw); XtFree((XtPointer) old_val); return(True); } /* Function Name: SetSliders * Description: Sets the values in the color sliders. * Arguments: csw - the color selector widget. * Returns: none */ static void SetSliders(XmColorSelectorWidget csw) { static Arg args[] = { { XmNvalue, (XtArgVal) NULL }, }; args[0].value = (XtArgVal) XmColorS_slider_red(csw); XtSetValues(XmColorS_sliders(csw)[0], args, XtNumber(args)); args[0].value = (XtArgVal) XmColorS_slider_green(csw); XtSetValues(XmColorS_sliders(csw)[1], args, XtNumber(args)); args[0].value = (XtArgVal) XmColorS_slider_blue(csw); XtSetValues(XmColorS_sliders(csw)[2], args, XtNumber(args)); } /* Function Name: SelectColor * Description: Selects the color in the list that corrosponds * to the current values of the RGB sliders. * Arguments: csw - the color selector widget. * Returns: none. */ static void SelectColor(XmColorSelectorWidget csw) { int color_num; if (FindColor(csw, &color_num)) { XmListSelectPos(XmColorS_list(csw), color_num + 1, False); XmListSetBottomPos(XmColorS_list(csw), color_num + 1); } else XmListDeselectAllItems(XmColorS_list(csw)); } /* Function Name: EndsInDigits * Description: Determines if a string ends in a digit * Returns: True if it does */ static int EndsInDigits(char *str) { register char *c = str; while(*c != '\0') c++; /* advance to end of string marker */ c--; /* back to the last character */ if(c >= str && isascii(*c) && isdigit(*c)) return True; return False; } /* Function Name: FindColor * Description: Finds the index into the colors array associated with * the current slider values. Attempts to find the slot * with a the best matching name. * Arguments: csw - The color selector widget. * RETURNED color_num - The color index that was found. * Returns: True if color was found, false otherwise. * * NOTE: if False is returned then color_num has an undefined value. */ static Boolean FindColor(XmColorSelectorWidget csw, int *color_num) { register ColorInfo *ptr; register int i, red, green, blue; /* * Obtain the color settings from the ColorSelector * data structure */ red = XmColorS_slider_red(csw); green = XmColorS_slider_green(csw); blue = XmColorS_slider_blue(csw); ptr = XmColorS_colors(csw); /* * Flag for finding color value */ *color_num = -1; /* * Find color within the exisiting colormap assigned to * ColorSelector */ for (i = 0; i < XmColorS_num_colors(csw); i++, ptr++) { if ((ptr->red == red) && (ptr->green == green) && (ptr->blue == blue)) { if( *color_num < 0 ) *color_num = i; /* Only change the selected color if it is better in some way */ if(XmColorS_color_name(csw)) { if(XmColorS_color_name(csw)[0] == '#') *color_num = i; if(streq(XmColorS_color_name(csw), ptr->name) || streq(XmColorS_color_name(csw), ptr->no_space_lower_name)) { *color_num = i; return(True); } } if(! EndsInDigits(ptr->name)) { *color_num = i; return(True); } } } return(*color_num >= 0); } /* Function Name: slider_changed * Description: One of the sliders was pressed * Arguments: w - the slider widget. * csw - the color selector. * scale - the scale widget callback struct. * Returns: none. */ /* ARGSUSED */ static void slider_changed(Widget w, XtPointer csw_ptr, XtPointer scale_ptr) { XmColorSelectorWidget csw = (XmColorSelectorWidget) csw_ptr; XmScaleCallbackStruct *scale = (XmScaleCallbackStruct *) scale_ptr; if (scale_ptr != NULL) { /* Set a new value. */ if (w == XmColorS_sliders(csw)[0]) XmColorS_slider_red(csw) = scale->value; else if(w == XmColorS_sliders(csw)[1]) XmColorS_slider_green(csw) = scale->value; else if(w == XmColorS_sliders(csw)[2]) XmColorS_slider_blue(csw) = scale->value; } UpdateColorWindow(csw, False); } /* Function Name: UpdateColorWindow * Description: Updates the color window display. * Arguments: csw - the color selector widget. * use_name - if TRUE then use the color name to update. * if FALSE then use the color sliders to update. * Returns: True if successful */ static Boolean UpdateColorWindow(XmColorSelectorWidget csw, Boolean use_name) { int index; XColor color; Pixel foreground; char buf[XmColorSelector_COLOR_NAME_SIZE], new_label[BUFSIZ]; if (!use_name) /* Update color names */ { char *freeMe; freeMe = XmColorS_color_name(csw); sprintf(buf, "#%02x%02x%02x", XmColorS_slider_red(csw), XmColorS_slider_green(csw), XmColorS_slider_blue(csw)); if (FindColor(csw, &index)) { XmColorS_color_name(csw) = XtNewString(XmColorS_colors(csw)[index].name); sprintf(new_label, "%s (%s)", XmColorS_color_name(csw), buf); } else { XmColorS_color_name(csw) = XtNewString(buf); sprintf(new_label, "%s", buf); } XtFree((XtPointer)freeMe ); color.red = XmColorS_slider_red(csw) * 256; color.green = XmColorS_slider_green(csw) * 256; color.blue = XmColorS_slider_blue(csw) * 256; } else /* Update color slider */ { if(XParseColor(XtDisplay(csw), csw->core.colormap, XmColorS_color_name(csw), &color) == 0) { return(False); } XmColorS_slider_red(csw) = color.red / 256; XmColorS_slider_green(csw) = color.green / 256; XmColorS_slider_blue(csw) = color.blue / 256; /* * Attempt to replace a name that begins with a # with a real color * name. */ if ((XmColorS_color_name(csw)[0] == '#') && FindColor(csw, &index)) { XtFree(XmColorS_color_name(csw)); XmColorS_color_name(csw) = XtNewString(XmColorS_colors(csw)[index].name); } sprintf(buf, "#%02x%02x%02x", color.red/256, color.green/256, color.blue/256); sprintf(new_label, "%s (%s)", XmColorS_color_name(csw), buf); } { long test = (long) color.red; test += (long) color.green; test += (long) color.blue; if (test/3 > 0x7000) { foreground = BlackPixelOfScreen(XtScreen((Widget) csw)); } else { foreground = WhitePixelOfScreen(XtScreen((Widget) csw)); } } /* * Check on the default visual */ if (DefaultVisualDisplay(csw, foreground, color, (char *)new_label)) { return True; } else { return False; } } /* Function Name: list_selected * Description: One of the list widgets was selected. * Arguments: w - the slider widget. * csw - the color selector. * list - the list widget callback struct. * Returns: none. */ /* ARGSUSED */ static void list_selected(Widget w, XtPointer csw_ptr, XtPointer list_ptr) { XmColorSelectorWidget csw = (XmColorSelectorWidget) csw_ptr; XmListCallbackStruct *list = (XmListCallbackStruct *) list_ptr; XtFree(XmColorS_color_name(csw)); XmColorS_color_name(csw) = XmStringUnparse(list->item, NULL, XmCHARSET_TEXT, XmCHARSET_TEXT, NULL, 0, XmOUTPUT_ALL); /* deprecated XmStringGetLtoR(list->item, XmFONTLIST_DEFAULT_TAG, &(XmColorS_color_name(csw))); */ UpdateColorWindow(csw, True); } /* Function Name: change_mode * Description: One of the change mode buttons was pressed. * Arguments: w - the slider widget. * csw_ptr - the color selector. * tp - the toggle widget callback struct. * Returns: none. */ /* ARGSUSED */ static void change_mode(Widget w, XtPointer csw_ptr, XtPointer tp) { XmColorSelectorWidget csw = (XmColorSelectorWidget) csw_ptr; XmToggleButtonCallbackStruct *toggle = (XmToggleButtonCallbackStruct *) tp; /* * Ignore unsets. */ if (toggle->reason == XmCR_VALUE_CHANGED && toggle->set) { /* * Change the mode if it is different. */ if ((w == XmColorS_chose_mode(csw)[XmListMode]) && (XmColorS_color_mode(csw) != XmListMode)) { new_mode(csw, XmListMode); } else if ((w == XmColorS_chose_mode(csw)[XmScaleMode]) && (XmColorS_color_mode(csw) != XmScaleMode)) { new_mode(csw, XmScaleMode); } } } /* Function Name: new_mode * Description: mode has changed * Arguments: csw - the color selector. * mode - the new mode. * Returns: none. */ /* ARGSUSED */ static void new_mode(XmColorSelectorWidget csw, XmColorMode mode) { XmColorS_color_mode(csw) = mode; if (mode == XmScaleMode) { SetSliders(csw); XtUnmanageChild(XmColorS_scrolled_list(csw)); XtManageChild(XmColorS_bb(csw)); } else { SelectColor(csw); /* Select the current color in the list. */ XtUnmanageChild(XmColorS_bb(csw)); XtManageChild(XmColorS_scrolled_list(csw)); } } /* Function Name: compute_size * Description: Do all the size and position computing. * Arguments: csw - the color selector. * Returns: none. */ /* ARGSUSED */ static void compute_size(XmColorSelectorWidget csw) { XtWidgetGeometry input, radio_geom, color_geom; Dimension width, height; Position x,y; /* positions */ /* * First size and place the button box and scrolled list. */ y = XmColorS_margin_height(csw); x = XmColorS_margin_width(csw); width = csw->core.width - (2 * XmColorS_margin_width(csw)); input.width = width; input.request_mode = CWWidth; (void) XtQueryGeometry(XmColorS_chose_radio(csw), NULL, &radio_geom); (void) XtQueryGeometry(XmColorS_color_window(csw), &input, &color_geom); height = (csw->core.height - 4 * XmColorS_margin_height(csw) - (radio_geom.height + 2 * radio_geom.border_width)); /* * Leave space for the margins and make the color area 1/3 the height * of the scrolled list and button box. */ color_geom.height = height / 4; height -= color_geom.height; color_geom.height -= 2 * color_geom.border_width; _XmConfigureWidget(XmColorS_bb(csw), x, y, width, height, 0); _XmConfigureWidget(XmColorS_scrolled_list(csw), x, y, width, height, 0); y += height + XmColorS_margin_height(csw); /* * Place the radio box. */ if ( radio_geom.width < csw->core.width ) x = (int)(csw->core.width - radio_geom.width) / 2; else x = XmColorS_margin_width(csw); _XmConfigureWidget(XmColorS_chose_radio(csw), x, y, radio_geom.width, radio_geom.height, radio_geom.border_width); y += radio_geom.height + XmColorS_margin_height(csw); /* * Lastly, place the color window */ _XmConfigureWidget(XtParent(XmColorS_color_window(csw)), XmColorS_margin_width(csw), y, width, color_geom.height, color_geom.border_width); } /* Function Name: read_rgb_file * Description: Read in all the color names and add them to the list. * Arguments: csw - the color selector. * cargs, cnum_args - a filtered arg list that was * passed to create the color selector. * Returns: none. */ /* ARGSUSED */ static void read_rgb_file(XmColorSelectorWidget csw, ArgList cargs, Cardinal cnum_args, Boolean initial) { FILE *file; char buf[BUFSIZ]; char string_buffer[BUFSIZ]; char *color_name; ColorInfo * color_info = NULL; register int i; Arg *margs, args[20]; /* * Create new list if needed, or delete any old list items. */ if (XmColorS_list(csw) == NULL) { i = 0; XtSetArg(args[i], XmNlistSizePolicy, XmCONSTANT); i++; XtSetArg(args[i], XmNvisibleItemCount, 15); i++; margs = XtMergeArgLists(args, i, cargs, cnum_args); XmColorS_list(csw) = XmCreateScrolledList((Widget) csw, "list", margs, i + cnum_args); XtManageChild(XmColorS_list(csw)); XmColorS_scrolled_list(csw) = XtParent(XmColorS_list(csw)); if (XmColorS_color_mode(csw) != XmListMode) { /* Hide the scrolled list until it need be visible... */ XtUnmanageChild(XmColorS_scrolled_list(csw)); } XtFree((XtPointer) margs); } else { XmListDeleteAllItems(XmColorS_list(csw)); } /* ** Because of the internal functioning of the XmList, it is better to ** zero out the selected item list rather than to let the item currently ** selected be re-selected by the XmList when the new list of colors is ** assigned. As is, the XmList iteratively searches through the list of ** selected items for each item added. Resetting the selectedItem list to ** NULL/0 ensures that we don't have O(n*m) XmStringCompare operations ** done when setting the new list below. ** Also, resetting the list saves us in the case in which the rgb_file ** is invalid or doesn't contain this selected string. */ XtVaSetValues(XmColorS_list(csw), XmNselectedItems, NULL, XmNselectedItemCount, 0, NULL); /* * Read in all the colornames. */ if ((file = fopen(XmColorS_rgb_file(csw), "r")) != NULL) { register int alloc, count, len; register char *name; alloc = count = 0; while(fgets(buf, BUFSIZ, file)) { /* * Skip any comment lines in the file */ if ( buf[0] == '!' ) continue; if (count >= alloc) { if (0 == alloc) alloc = 755; /* rather than stat the file and determine a good value to use, just use enough for X11R5, X11R6, and OpenWindows3 */ else { #define ALLOC_INC 20 alloc += ALLOC_INC; } color_info = (ColorInfo *)XtRealloc((XtPointer) color_info, sizeof(ColorInfo) * alloc); } sscanf(buf, "%hu %hu %hu", &(color_info[count].red), &(color_info[count].green), &(color_info[count].blue)); if ((color_name = find_name(buf)) == NULL) continue; len = strlen(color_name); if (len > XmColorSelector_COLOR_NAME_SIZE) { color_name[XmColorSelector_COLOR_NAME_SIZE - 1] = '\0'; snprintf(string_buffer, BUFSIZ, XmNcolorNameTooLongMsg, buf, color_name); XmeWarning((Widget)csw, string_buffer); } name = color_info[count].no_space_lower_name; for (i = 0; i < len; i++) { register char c = color_name[i]; /* * Copy in all characters that are ascii and non-spaces. */ if (!isascii(c)) continue; if (!isspace(c)) *name++ = tolower(c); } *name = '\0'; name = color_info[count].name; color_name[0] = toupper(color_name[0]); for (i = 0; i < len; i++) { register char c = color_name[i]; /* * Capitalize all characters after a space. */ if (!isascii(c)) continue; if (isspace(c) && ((i + 1) < len)) { color_name[i + 1] = toupper(color_name[i + 1]); } *name++ = c; } *name = '\0'; count++; } fclose(file); qsort(color_info, count, sizeof(ColorInfo), CmpColors); /* * Remove duplicates. */ i = 0; while (i < (count - 1)) { if (streq(color_info[i].no_space_lower_name, color_info[i + 1].no_space_lower_name)) { register int j; register ColorInfo *ptr; ptr = color_info + i; j = i; /* * This makes sure that the one with the space is * left in place in favor of the one without. */ if (strchr(ptr->name, ' ') != NULL) { j++; ptr++; } while ( ++j < count) { ptr[0] = ptr[1]; ptr++; } count--; /*Something has been removed, decrement count*/ } else i++; } { XmString *strs = (XmString*)XtMalloc(sizeof(XmString)*count); for (i = 0; i < count; i++) strs[i] = XmStringCreateLocalized(color_info[i].name); XtVaSetValues(XmColorS_list(csw), XmNitems, strs, XmNitemCount, count, NULL); for (i = 0; i < count; i++) XmStringFree(strs[i]); XtFree((char*)strs); } XtFree((char*)XmColorS_colors(csw)); XmColorS_colors(csw) = color_info; XmColorS_num_colors(csw) = count; /* It would be better if we had cached the current index number so ** we could just reset the list to the string corresponding to that ** value, but instead wind up going through FindColor to reestablish ** the selected string */ if (!initial) SelectColor(csw); } else { XmString str; XmListAddItem(XmColorS_list(csw), XmColorS_strings(csw).file_read_error, 0); str = XmStringCreateLocalized(XmColorS_rgb_file(csw)); XmListAddItem(XmColorS_list(csw), str, 0); XmStringFree(str); XtFree((char*)XmColorS_colors(csw)); XmColorS_colors(csw) = NULL; XmColorS_num_colors(csw) = 0; } XtAddCallback(XmColorS_list(csw), XmNsingleSelectionCallback, list_selected, csw); XtAddCallback(XmColorS_list(csw), XmNbrowseSelectionCallback, list_selected, csw); } /* Function Name: CmpColors * Description: Compares two colors. * Arguments: ptr_1, ptr_2 - two colors too compare. * Returns: none */ static int CmpColors(const void * ptr_1, const void * ptr_2) { ColorInfo *color1, *color2; color1 = (ColorInfo *) ptr_1; color2 = (ColorInfo *) ptr_2; return(strcmp(color1->no_space_lower_name, color2->no_space_lower_name)); } /* Function Name: find_name * Description: Go through the buffer for looking for the name * of a color string. * Arguments: buffer - list of color names. * Returns: pointer in the buffer where the string begins. */ static char* find_name(char *buffer) { register char *curr, *temp; /* current pointer */ for (curr = buffer; curr != NULL && *curr != '\0'; curr++) { /* * Look for first non number, non space or tab. */ if (isascii(*curr) && (isdigit(*curr) || isspace(*curr))) continue; temp = (char *) strchr(curr, '\n'); *temp = '\0'; return(curr); } return(NULL); } /* Function Name: CreateColorSliders * Description: creates a button with three sliders (Red, Green, Blue). * Arguments: csw - the color selector widget. * cargs, cnum_args - a filtered arg list that was * passed to create the color selector. * Returns: none. */ /* ARGSUSED */ static void CreateColorSliders(XmColorSelectorWidget csw, ArgList cargs, Cardinal cnum_args) { register int i; Cardinal num_args, title; Arg *margs, args[10]; num_args = 0; XtSetArg(args[num_args], XmNborderWidth, 0); num_args++; XtSetArg(args[num_args], XmNorientation, XmVERTICAL); num_args++; XtSetArg(args[num_args], XmNfillOption, XmFillMinor); num_args++; margs = XtMergeArgLists(args, num_args, cargs, cnum_args); XmColorS_bb(csw) = XtCreateManagedWidget("buttonBox", xmButtonBoxWidgetClass, (Widget) csw, margs, cnum_args + num_args); XtFree((XtPointer) margs); num_args = 0; XtSetArg(args[num_args], XmNmaximum, 255); num_args++; XtSetArg(args[num_args], XmNorientation, XmHORIZONTAL); num_args++; XtSetArg(args[num_args], XmNshowValue, True); num_args++; XtSetArg(args[num_args], XmNprocessingDirection, XmMAX_ON_RIGHT); num_args++; XtSetArg(args[num_args], XmNtitleString, NULL); title = num_args++; margs = XtMergeArgLists(args, num_args, cargs, cnum_args); for( i = 0; i < 3; i++ ) { margs[title].value = (XtArgVal) XmColorS_strings(csw).slider_labels[i]; XmColorS_sliders(csw)[i] = XtCreateManagedWidget("scale", xmScaleWidgetClass, XmColorS_bb(csw), margs, num_args + cnum_args); XtAddCallback(XmColorS_sliders(csw)[i], XmNdragCallback, slider_changed, csw); XtAddCallback(XmColorS_sliders(csw)[i], XmNvalueChangedCallback, slider_changed, csw); } XtFree((XtPointer) margs); } /* Function Name: CreateSelectorRadio * Description: creates a radio box with two toggles for selector * type. * Arguments: csw - the color selector widget. * cargs, cnum_args - a filtered arg list that was * passed to create the color selector. * Returns: none. */ /* ARGSUSED */ static void CreateSelectorRadio(XmColorSelectorWidget csw, ArgList cargs, Cardinal cnum_args) { Widget w; Cardinal i, label; Arg *margs, args[5]; int count; static String names[] = { "colorListToggle", "colorSlidersToggle" }; i = 0; XtSetArg(args[i], XmNradioBehavior, True); i++; XtSetArg(args[i], XmNpacking, XmPACK_COLUMN); i++; XtSetArg(args[i], XmNnumColumns, 2); i++; margs = XtMergeArgLists(args, i, cargs, cnum_args); w = XtCreateManagedWidget("radioBox", xmRowColumnWidgetClass, (Widget) csw, margs, i + cnum_args); XmColorS_chose_radio(csw) = w; XtFree((XtPointer) margs); i = 0; XtSetArg(args[i], XmNlabelString, NULL); label = i++; margs = XtMergeArgLists(args, i, cargs, cnum_args); for (count = 0; count < XmColorSelector_NUM_TOGGLES; count++) { margs[label].value = (XtArgVal) XmColorS_strings(csw).tog_labels[count]; w = XtCreateManagedWidget(names[count], xmToggleButtonWidgetClass, XmColorS_chose_radio(csw), margs, i + cnum_args); XmColorS_chose_mode(csw)[count] = w; XtAddCallback(w, XmNvalueChangedCallback, change_mode, csw); } XtFree((XtPointer) margs); } /* Function Name: CreateColorWindow * Description: creates a label in a frame to display the * currently selected color. * Arguments: csw - the color selector widget. * cargs, cnum_args - a filtered arg list that was * passed to create the color selector. * Returns: none. */ /* ARGSUSED */ static void CreateColorWindow(XmColorSelectorWidget csw,ArgList cargs, Cardinal cnum_args) { Widget fr; Arg *margs, args[10]; Cardinal n; fr = XtCreateManagedWidget("colorFrame", xmFrameWidgetClass, (Widget) csw, cargs, cnum_args); n = 0; XtSetArg(args[n], XmNrecomputeSize, False); n++; margs = XtMergeArgLists(args, n, cargs, cnum_args); XmColorS_color_window(csw) = XtCreateManagedWidget("colorWindow", xmLabelWidgetClass, fr, margs, n + cnum_args); XtFree((XtPointer) margs); } /* ARGSUSED */ static void GetValues_XmNredSliderLabel ( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmColorS_strings(w).slider_labels[0]); } /* ARGSUSED */ static void GetValues_XmNgreenSliderLabel( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmColorS_strings(w).slider_labels[1]); } /* ARGSUSED */ static void GetValues_XmNblueSliderLabel( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmColorS_strings(w).slider_labels[2]); } /* ARGSUSED */ static void GetValues_XmNcolorListTogLabel( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmColorS_strings(w).tog_labels[0]); } /* ARGSUSED */ static void GetValues_XmNsliderTogLabel( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmColorS_strings(w).tog_labels[1]); } /* ARGSUSED */ static void GetValues_XmNnoCellError( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmColorS_strings(w).no_cell_error); } /* ARGSUSED */ static void GetValues_XmNfileReadError( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmColorS_strings(w).file_read_error); } /* Function Name: GetVisual * Description: Gets the defaults visual of the screen * Arguments: csw - the color selector widget. * Returns: Visual id. */ /* ARGSUSED */ static int GetVisual(XmColorSelectorWidget csw) { Visual * vis; int visual; vis = DefaultVisual(XtDisplay(csw), XDefaultScreen(XtDisplay(csw))); visual = vis->class; return visual; } /* Function Name: NoPrivateColormaps * Description: Determines the color to be used. * Arguments: csw - the color selector widget. * foreground - default color for the ColorSelector. * color - Current color attributes. * str - label for the ColorSelector. * Returns: None. */ /* ARGSUSED */ static void NoPrivateColormaps(XmColorSelectorWidget csw, Pixel foreground, XColor color, char *str) { Arg args[5]; XmString xm_str; Cardinal num_args; xm_str = XmStringCreateLocalized(str); num_args = 0; if (!XmColorS_good_cell(csw)) { if(XAllocColor(XtDisplay(csw), csw->core.colormap, &color) ) { XmColorS_color_pixel(csw) = color.pixel; XmColorS_good_cell(csw) = True; } } else { if (XAllocColor(XtDisplay(csw), csw->core.colormap, &color) ) { XmColorS_color_pixel(csw) = color.pixel; XmColorS_good_cell(csw) = True; } else { XmString out; out = XmStringConcatAndFree(xm_str, XmColorS_strings(csw).no_cell_error); xm_str = out; } } if (XmColorS_good_cell(csw)) { color.flags = DoRed | DoGreen | DoBlue; color.pixel = XmColorS_color_pixel(csw); XtSetArg(args[num_args], XmNforeground, foreground); num_args++; XtSetArg(args[num_args], XmNbackground, XmColorS_color_pixel(csw)); num_args++; XtSetValues(XmColorS_color_window(csw), args, num_args); } XtSetArg(args[num_args], XmNlabelString, xm_str); num_args++; XtSetValues(XmColorS_color_window(csw), args, num_args); XmStringFree(xm_str); } /* Function Name: DoPrivateColormaps * Description: Determines the color to be used. * Arguments: csw - the color selector widget. * foreground - default color for the ColorSelector. * color - Current color attributes. * str - label for the ColorSelector. * Returns: None. */ /* ARGSUSED */ static void PrivateColormaps(XmColorSelectorWidget csw, Pixel foreground, XColor color, char *str) { Arg args[5]; XmString xm_str; Cardinal num_args; xm_str = XmStringCreateLocalized(str); num_args = 0; if (!XmColorS_good_cell(csw)) { if(XAllocColorCells(XtDisplay(csw), csw->core.colormap, 0, 0, 0, &(XmColorS_color_pixel(csw)), 1)) { XmColorS_good_cell(csw) = True; } else { XmString out; out = XmStringConcatAndFree(xm_str, XmColorS_strings(csw).no_cell_error); xm_str = out; } } if (XmColorS_good_cell(csw)) { color.flags = DoRed | DoGreen | DoBlue; color.pixel = XmColorS_color_pixel(csw); XStoreColor(XtDisplay((Widget) csw), csw->core.colormap, &color); XtSetArg(args[num_args], XmNforeground, foreground); num_args++; XtSetArg(args[num_args], XmNbackground, XmColorS_color_pixel(csw)); num_args++; } XtSetArg(args[num_args], XmNlabelString, xm_str); num_args++; XtSetValues(XmColorS_color_window(csw), args, num_args); XmStringFree(xm_str); } /* * Function Name: DefaultVisualDisplay * Description: Determines the default visual and allocates * the color depending upon the visual classes * Arguments: csw - the color selector widget. * foreground - default color for the ColorSelector. * color - Current color attributes. * str - label for the ColorSelector. * Returns: Returns true on a valid visual class. * False otherwise. */ /* ARGSUSED */ static Boolean DefaultVisualDisplay(XmColorSelectorWidget csw, Pixel foreground, XColor color, char *str) { int visual = 0; visual = GetVisual(csw); /* * Obtain a valid color cell. In case, if one not available */ if ( visual == StaticColor || visual == TrueColor || \ visual == StaticGray ) { NoPrivateColormaps(csw, foreground, color, str); return True; } else if ( visual == PseudoColor || visual == DirectColor || \ visual == GrayScale ) { PrivateColormaps(csw, foreground, color, str); return True; } else { return False; } } /************************************************************ * * Public functions. * ************************************************************/ /* Function Name: XmCreateColorSelector * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateColorSelector(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmColorSelectorWidgetClass, parent, args, num_args)); } Widget XmVaCreateColorSelector( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmColorSelectorWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedColorSelector( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmColorSelectorWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/Xpmscan.c0000644000175000017500000006203312672140200012470 00000000000000/* $XConsortium: Xpmscan.c /main/6 1996/09/20 08:16:12 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * scan.c: * * * * XPM library * * Scanning utility for XPM file format * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* * The code related to FOR_MSW has been added by * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" #define MAXPRINTABLE 92 /* number of printable ascii chars * minus \ and " for string compat * and ? to avoid ANSI trigraphs. */ static char *printable = " .XoO+@#$%&*=-;:>,<1234567890qwertyuipasdfghjklzxcvbnmMNBVCZ\ ASDFGHJKLPIUYTREWQ!~^/()_`'][{}|"; /* * printable begin with a space, so in most case, due to my algorithm, when * the number of different colors is less than MAXPRINTABLE, it will give a * char follow by "nothing" (a space) in the readable xpm file */ typedef struct { Pixel *pixels; unsigned int *pixelindex; unsigned int size; unsigned int ncolors; unsigned int mask_pixel; /* whether there is or not */ } PixelsMap; LFUNC(storePixel, int, (Pixel pixel, PixelsMap *pmap, unsigned int *index_return)); LFUNC(storeMaskPixel, int, (Pixel pixel, PixelsMap *pmap, unsigned int *index_return)); #ifndef FOR_MSW LFUNC(GetImagePixels, int, (XImage *image, unsigned int width, unsigned int height, PixelsMap *pmap)); LFUNC(GetImagePixels32, int, (XImage *image, unsigned int width, unsigned int height, PixelsMap *pmap)); LFUNC(GetImagePixels16, int, (XImage *image, unsigned int width, unsigned int height, PixelsMap *pmap)); LFUNC(GetImagePixels8, int, (XImage *image, unsigned int width, unsigned int height, PixelsMap *pmap)); LFUNC(GetImagePixels1, int, (XImage *image, unsigned int width, unsigned int height, PixelsMap *pmap, int (*storeFunc) ())); #else /* ndef FOR_MSW */ LFUNC(MSWGetImagePixels, int, (Display *d, XImage *image, unsigned int width, unsigned int height, PixelsMap *pmap, int (*storeFunc) ())); #endif LFUNC(ScanTransparentColor, int, (XpmColor *color, unsigned int cpp, XpmAttributes *attributes)); LFUNC(ScanOtherColors, int, (Display *display, XpmColor *colors, unsigned int ncolors, Pixel *pixels, unsigned int mask, unsigned int cpp, XpmAttributes *attributes)); /* * This function stores the given pixel in the given arrays which are grown * if not large enough. */ static int storePixel(pixel, pmap, index_return) Pixel pixel; PixelsMap *pmap; unsigned int *index_return; { unsigned int i; Pixel *p; unsigned int ncolors; if (*index_return) { /* this is a transparent pixel! */ *index_return = 0; return 0; } ncolors = pmap->ncolors; p = pmap->pixels + pmap->mask_pixel; for (i = pmap->mask_pixel; i < ncolors; i++, p++) if (*p == pixel) break; if (i == ncolors) { if (ncolors >= pmap->size) { pmap->size *= 2; p = (Pixel *) XpmRealloc(pmap->pixels, sizeof(Pixel) * pmap->size); if (!p) return (1); pmap->pixels = p; } (pmap->pixels)[ncolors] = pixel; pmap->ncolors++; } *index_return = i; return 0; } static int storeMaskPixel(pixel, pmap, index_return) Pixel pixel; PixelsMap *pmap; unsigned int *index_return; { if (!pixel) { if (!pmap->ncolors) { pmap->ncolors = 1; (pmap->pixels)[0] = 0; pmap->mask_pixel = 1; } *index_return = 1; } else *index_return = 0; return 0; } /* function call in case of error, frees only locally allocated variables */ #undef RETURN #define RETURN(status) \ do { \ if (pmap.pixelindex) XpmFree(pmap.pixelindex); \ if (pmap.pixels) XpmFree(pmap.pixels); \ if (colorTable) xpmFreeColorTable(colorTable, pmap.ncolors); \ return(status); \ } while(0) /* * This function scans the given image and stores the found informations in * the given XpmImage structure. */ int XpmCreateXpmImageFromImage(display, image, shapeimage, xpmimage, attributes) Display *display; XImage *image; XImage *shapeimage; XpmImage *xpmimage; XpmAttributes *attributes; { /* variables stored in the XpmAttributes structure */ unsigned int cpp; /* variables to return */ PixelsMap pmap; XpmColor *colorTable = NULL; int ErrorStatus = 0; /* calculation variables */ unsigned int width = 0; unsigned int height = 0; unsigned int cppm; /* minimum chars per pixel */ unsigned int c; /* initialize pmap */ pmap.pixels = NULL; pmap.pixelindex = NULL; pmap.size = 256; /* should be enough most of the time */ pmap.ncolors = 0; pmap.mask_pixel = 0; /* * get geometry */ if (image) { width = image->width; height = image->height; } else if (shapeimage) { width = shapeimage->width; height = shapeimage->height; } /* * retrieve information from the XpmAttributes */ if (attributes && (attributes->valuemask & XpmCharsPerPixel /* 3.2 backward compatibility code */ || attributes->valuemask & XpmInfos)) /* end 3.2 bc */ cpp = attributes->cpp; else cpp = 0; if ((height > 0 && width >= UINT_MAX / height) || width * height >= UINT_MAX / sizeof(unsigned int)) RETURN(XpmNoMemory); pmap.pixelindex = (unsigned int *) XpmCalloc(width * height, sizeof(unsigned int)); if (!pmap.pixelindex) RETURN(XpmNoMemory); if (pmap.size >= UINT_MAX / sizeof(Pixel)) RETURN(XpmNoMemory); pmap.pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * pmap.size); if (!pmap.pixels) RETURN(XpmNoMemory); /* * scan shape mask if any */ if (shapeimage) { #ifndef FOR_MSW ErrorStatus = GetImagePixels1(shapeimage, width, height, &pmap, storeMaskPixel); #else ErrorStatus = MSWGetImagePixels(display, shapeimage, width, height, &pmap, storeMaskPixel); #endif if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); } /* * scan the image data * * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use optimized * functions, otherwise use slower but sure general one. * */ if (image) { #ifndef FOR_MSW if (((image->bits_per_pixel | image->depth) == 1) && (image->byte_order == image->bitmap_bit_order)) ErrorStatus = GetImagePixels1(image, width, height, &pmap, storePixel); else if (image->format == ZPixmap) { if (image->bits_per_pixel == 8) ErrorStatus = GetImagePixels8(image, width, height, &pmap); else if (image->bits_per_pixel == 16) ErrorStatus = GetImagePixels16(image, width, height, &pmap); else if (image->bits_per_pixel == 32) ErrorStatus = GetImagePixels32(image, width, height, &pmap); } else ErrorStatus = GetImagePixels(image, width, height, &pmap); #else /* FOR_MSW */ ErrorStatus = MSWGetImagePixels(display, image, width, height, &pmap, storePixel); #endif if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); } /* * get rgb values and a string of char, and possibly a name for each * color */ if (pmap.ncolors >= UINT_MAX / sizeof(XpmColor)) RETURN(XpmNoMemory); colorTable = (XpmColor *) XpmCalloc(pmap.ncolors, sizeof(XpmColor)); if (!colorTable) RETURN(XpmNoMemory); /* compute the minimal cpp */ for (cppm = 1, c = MAXPRINTABLE; pmap.ncolors > c; cppm++) c *= MAXPRINTABLE; if (cpp < cppm) cpp = cppm; if (pmap.mask_pixel) { ErrorStatus = ScanTransparentColor(colorTable, cpp, attributes); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); } ErrorStatus = ScanOtherColors(display, colorTable, pmap.ncolors, pmap.pixels, pmap.mask_pixel, cpp, attributes); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); /* * store found informations in the XpmImage structure */ xpmimage->width = width; xpmimage->height = height; xpmimage->cpp = cpp; xpmimage->ncolors = pmap.ncolors; xpmimage->colorTable = colorTable; xpmimage->data = pmap.pixelindex; XpmFree(pmap.pixels); return (XpmSuccess); } static int ScanTransparentColor(color, cpp, attributes) XpmColor *color; unsigned int cpp; XpmAttributes *attributes; { char *s; unsigned int a, b, c; /* first get a character string */ a = 0; if (cpp >= UINT_MAX - 1) return (XpmNoMemory); if (!(s = color->string = (char *) XpmMalloc(cpp + 1))) return (XpmNoMemory); *s++ = printable[c = a % MAXPRINTABLE]; for (b = 1; b < cpp; b++, s++) *s = printable[c = ((a - c) / MAXPRINTABLE) % MAXPRINTABLE]; *s = '\0'; /* then retreive related info from the attributes if any */ if (attributes && (attributes->valuemask & XpmColorTable /* 3.2 backward compatibility code */ || attributes->valuemask & XpmInfos) /* end 3.2 bc */ && attributes->mask_pixel != XpmUndefPixel) { unsigned int key; char **defaults = (char **) color; char **mask_defaults; /* 3.2 backward compatibility code */ if (attributes->valuemask & XpmColorTable) /* end 3.2 bc */ mask_defaults = (char **) ( attributes->colorTable + attributes->mask_pixel); /* 3.2 backward compatibility code */ else mask_defaults = (char **) ((XpmColor **) attributes->colorTable)[attributes->mask_pixel]; /* end 3.2 bc */ for (key = 1; key <= NKEYS; key++) { if ((s = mask_defaults[key])) { defaults[key] = (char *) xpmstrdup(s); if (!defaults[key]) return (XpmNoMemory); } } } else { color->c_color = (char *) xpmstrdup(TRANSPARENT_COLOR); if (!color->c_color) return (XpmNoMemory); } return (XpmSuccess); } static int ScanOtherColors(display, colors, ncolors, pixels, mask, cpp, attributes) Display *display; XpmColor *colors; unsigned int ncolors; Pixel *pixels; unsigned int mask; unsigned int cpp; XpmAttributes *attributes; { /* variables stored in the XpmAttributes structure */ Colormap colormap; char *rgb_fname; #ifndef FOR_MSW xpmRgbName rgbn[MAX_RGBNAMES]; #else xpmRgbName *rgbn = NULL; #endif int rgbn_max = 0; unsigned int i, j, c, i2; XpmColor *color; XColor *xcolors = NULL, *xcolor; char *colorname, *s; XpmColor *colorTable = NULL, **oldColorTable = NULL; unsigned int ancolors = 0; Pixel *apixels = NULL; unsigned int mask_pixel = 0; Bool found; /* retrieve information from the XpmAttributes */ if (attributes && (attributes->valuemask & XpmColormap)) colormap = attributes->colormap; else colormap = XDefaultColormap(display, XDefaultScreen(display)); if (attributes && (attributes->valuemask & XpmRgbFilename)) rgb_fname = attributes->rgb_fname; else rgb_fname = NULL; /* start from the right element */ if (mask) { colors++; ncolors--; pixels++; } /* first get character strings and rgb values */ if (ncolors >= UINT_MAX / sizeof(XColor) || cpp >= UINT_MAX - 1) return (XpmNoMemory); xcolors = (XColor *) XpmMalloc(sizeof(XColor) * ncolors); if (!xcolors) return (XpmNoMemory); for (i = 0, i2 = mask, color = colors, xcolor = xcolors; i < ncolors; i++, i2++, color++, xcolor++, pixels++) { if (!(s = color->string = (char *) XpmMalloc(cpp + 1))) { XpmFree(xcolors); return (XpmNoMemory); } *s++ = printable[c = i2 % MAXPRINTABLE]; for (j = 1; j < cpp; j++, s++) *s = printable[c = ((i2 - c) / MAXPRINTABLE) % MAXPRINTABLE]; *s = '\0'; xcolor->pixel = *pixels; } XQueryColors(display, colormap, xcolors, ncolors); #ifndef FOR_MSW /* read the rgb file if any was specified */ if (rgb_fname) rgbn_max = xpmReadRgbNames(attributes->rgb_fname, rgbn); #else /* FOR_MSW: rgb names and values are hardcoded in rgbtab.h */ rgbn_max = xpmReadRgbNames(NULL, NULL); #endif if (attributes && attributes->valuemask & XpmColorTable) { colorTable = attributes->colorTable; ancolors = attributes->ncolors; apixels = attributes->pixels; mask_pixel = attributes->mask_pixel; } /* 3.2 backward compatibility code */ else if (attributes && attributes->valuemask & XpmInfos) { oldColorTable = (XpmColor **) attributes->colorTable; ancolors = attributes->ncolors; apixels = attributes->pixels; mask_pixel = attributes->mask_pixel; } /* end 3.2 bc */ for (i = 0, color = colors, xcolor = xcolors; i < ncolors; i++, color++, xcolor++) { /* look for related info from the attributes if any */ found = False; if (ancolors) { unsigned int offset = 0; for (j = 0; j < ancolors; j++) { if (j == mask_pixel) { offset = 1; continue; } if (apixels[j - offset] == xcolor->pixel) break; } if (j != ancolors) { unsigned int key; char **defaults = (char **) color; char **adefaults; /* 3.2 backward compatibility code */ if (oldColorTable) adefaults = (char **) oldColorTable[j]; else /* end 3.2 bc */ adefaults = (char **) (colorTable + j); found = True; for (key = 1; key <= NKEYS; key++) { if ((s = adefaults[key])) defaults[key] = (char *) xpmstrdup(s); } } } if (!found) { /* if nothing found look for a color name */ colorname = NULL; if (rgbn_max) colorname = xpmGetRgbName(rgbn, rgbn_max, xcolor->red, xcolor->green, xcolor->blue); if (colorname) color->c_color = (char *) xpmstrdup(colorname); else { /* at last store the rgb value */ char buf[BUFSIZ]; #ifndef FOR_MSW sprintf(buf, "#%04X%04X%04X", xcolor->red, xcolor->green, xcolor->blue); #else sprintf(buf, "#%02x%02x%02x", xcolor->red, xcolor->green, xcolor->blue); #endif color->c_color = (char *) xpmstrdup(buf); } if (!color->c_color) { XpmFree(xcolors); xpmFreeRgbNames(rgbn, rgbn_max); return (XpmNoMemory); } } } XpmFree(xcolors); xpmFreeRgbNames(rgbn, rgbn_max); return (XpmSuccess); } #ifndef FOR_MSW /* * The functions below are written from X11R5 MIT's code (XImUtil.c) * * The idea is to have faster functions than the standard XGetPixel function * to scan the image data. Indeed we can speed up things by suppressing tests * performed for each pixel. We do exactly the same tests but at the image * level. */ static unsigned long Const low_bits_table[] = { 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff, 0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff, 0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff }; /* * Default method to scan pixels of an image data structure. * The algorithm used is: * * copy the source bitmap_unit or Zpixel into temp * normalize temp if needed * extract the pixel bits into return value * */ static int GetImagePixels(image, width, height, pmap) XImage *image; unsigned int width; unsigned int height; PixelsMap *pmap; { char *src; char *dst; unsigned int *iptr; char *data; unsigned int x, y; int bits, depth, ibu, ibpp, offset, i; unsigned long lbt; Pixel pixel, px; data = image->data; iptr = pmap->pixelindex; depth = image->depth; lbt = low_bits_table[depth]; ibpp = image->bits_per_pixel; offset = image->xoffset; if (image->bitmap_unit < 0) return (XpmNoMemory); if ((image->bits_per_pixel | image->depth) == 1) { ibu = image->bitmap_unit; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { src = &data[XYINDEX(x, y, image)]; dst = (char *) &pixel; pixel = 0; for (i = ibu >> 3; --i >= 0;) *dst++ = *src++; XYNORMALIZE(&pixel, image); bits = (x + offset) % ibu; pixel = ((((char *) &pixel)[bits >> 3]) >> (bits & 7)) & 1; if (ibpp != depth) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } } else if (image->format == XYPixmap) { int nbytes, bpl, j; long plane = 0; ibu = image->bitmap_unit; nbytes = ibu >> 3; bpl = image->bytes_per_line; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = 0; plane = 0; for (i = depth; --i >= 0;) { src = &data[XYINDEX(x, y, image) + plane]; dst = (char *) &px; px = 0; for (j = nbytes; --j >= 0;) *dst++ = *src++; XYNORMALIZE(&px, image); bits = (x + offset) % ibu; pixel = (pixel << 1) | (((((char *) &px)[bits >> 3]) >> (bits & 7)) & 1); plane = plane + (bpl * height); } if (ibpp != depth) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } } else if (image->format == ZPixmap) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { src = &data[ZINDEX(x, y, image)]; dst = (char *) &px; px = 0; for (i = (ibpp + 7) >> 3; --i >= 0;) *dst++ = *src++; ZNORMALIZE(&px, image); pixel = 0; for (i = sizeof(unsigned long); --i >= 0;) pixel = (pixel << 8) | ((unsigned char *) &px)[i]; if (ibpp == 4) { if (x & 1) pixel >>= 4; else pixel &= 0xf; } if (ibpp != depth) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } } else return (XpmColorError); /* actually a bad image */ return (XpmSuccess); } /* * scan pixels of a 32-bits Z image data structure */ #if !defined(WORD64) && !defined(LONG64) static unsigned long byteorderpixel = MSBFirst << 24; #endif static int GetImagePixels32(image, width, height, pmap) XImage *image; unsigned int width; unsigned int height; PixelsMap *pmap; { unsigned char *addr; unsigned char *data; unsigned int *iptr; unsigned int x, y; unsigned long lbt; Pixel pixel; int depth; data = (unsigned char *) image->data; iptr = pmap->pixelindex; depth = image->depth; lbt = low_bits_table[depth]; #if !defined(WORD64) && !defined(LONG64) if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX32(x, y, image)]; pixel = *((unsigned long *) addr); if (depth != 32) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX32(x, y, image)]; pixel = ((unsigned long) addr[0] << 24 | (unsigned long) addr[1] << 16 | (unsigned long) addr[2] << 8 | addr[4]); if (depth != 32) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX32(x, y, image)]; pixel = (addr[0] | (unsigned long) addr[1] << 8 | (unsigned long) addr[2] << 16 | (unsigned long) addr[3] << 24); if (depth != 32) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } return (XpmSuccess); } /* * scan pixels of a 16-bits Z image data structure */ static int GetImagePixels16(image, width, height, pmap) XImage *image; unsigned int width; unsigned int height; PixelsMap *pmap; { unsigned char *addr; unsigned char *data; unsigned int *iptr; unsigned int x, y; unsigned long lbt; Pixel pixel; int depth; data = (unsigned char *) image->data; iptr = pmap->pixelindex; depth = image->depth; lbt = low_bits_table[depth]; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX16(x, y, image)]; pixel = addr[0] << 8 | addr[1]; if (depth != 16) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &data[ZINDEX16(x, y, image)]; pixel = addr[0] | addr[1] << 8; if (depth != 16) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } return (XpmSuccess); } /* * scan pixels of a 8-bits Z image data structure */ static int GetImagePixels8(image, width, height, pmap) XImage *image; unsigned int width; unsigned int height; PixelsMap *pmap; { unsigned int *iptr; unsigned char *data; unsigned int x, y; unsigned long lbt; Pixel pixel; int depth; data = (unsigned char *) image->data; iptr = pmap->pixelindex; depth = image->depth; lbt = low_bits_table[depth]; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = data[ZINDEX8(x, y, image)]; if (depth != 8) pixel &= lbt; if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } return (XpmSuccess); } /* * scan pixels of a 1-bit depth Z image data structure */ static int GetImagePixels1(image, width, height, pmap, storeFunc) XImage *image; unsigned int width; unsigned int height; PixelsMap *pmap; int (*storeFunc) (); { unsigned int *iptr; unsigned int x, y; char *data; Pixel pixel; int xoff, yoff, offset, bpl; data = image->data; iptr = pmap->pixelindex; offset = image->xoffset; bpl = image->bytes_per_line; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { xoff = x + offset; yoff = y * bpl + (xoff >> 3); xoff &= 7; pixel = (data[yoff] & (0x80 >> xoff)) ? 1 : 0; if ((*storeFunc) (pixel, pmap, iptr)) return (XpmNoMemory); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { xoff = x + offset; yoff = y * bpl + (xoff >> 3); xoff &= 7; pixel = (data[yoff] & (1 << xoff)) ? 1 : 0; if ((*storeFunc) (pixel, pmap, iptr)) return (XpmNoMemory); } return (XpmSuccess); } #else /* ndef FOR_MSW */ static int MSWGetImagePixels(display, image, width, height, pmap, storeFunc) Display *display; XImage *image; unsigned int width; unsigned int height; PixelsMap *pmap; int (*storeFunc) (); { unsigned int *iptr; unsigned int x, y; Pixel pixel; iptr = pmap->pixelindex; SelectObject(*display, image->bitmap); for (y = 0; y < height; y++) { for (x = 0; x < width; x++, iptr++) { pixel = GetPixel(*display, x, y); if ((*storeFunc) (pixel, pmap, iptr)) return (XpmNoMemory); } } return (XpmSuccess); } #endif #ifndef FOR_MSW int XpmCreateXpmImageFromPixmap(display, pixmap, shapemask, xpmimage, attributes) Display *display; Pixmap pixmap; Pixmap shapemask; XpmImage *xpmimage; XpmAttributes *attributes; { XImage *ximage = NULL; XImage *shapeimage = NULL; unsigned int width = 0; unsigned int height = 0; int ErrorStatus; /* get geometry */ if (attributes && attributes->valuemask & XpmSize) { width = attributes->width; height = attributes->height; } /* get the ximages */ if (pixmap) xpmCreateImageFromPixmap(display, pixmap, &ximage, &width, &height); if (shapemask) xpmCreateImageFromPixmap(display, shapemask, &shapeimage, &width, &height); /* create the related XpmImage */ ErrorStatus = XpmCreateXpmImageFromImage(display, ximage, shapeimage, xpmimage, attributes); /* destroy the ximages */ if (ximage) XDestroyImage(ximage); if (shapeimage) XDestroyImage(shapeimage); return (ErrorStatus); } #endif /* ndef FOR_MSW */ motif-2.3.8/lib/Xm/Ext.h0000644000175000017500000001237612672140200011631 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmExt_h_ #define _XmExt_h_ /************************************************************ * INCLUDE FILES *************************************************************/ #include #if defined(__cplusplus) extern "C" { #endif typedef Widget (*XmWidgetFunc)(Widget); /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ /* * General name definitions. */ #define XmNbadActionParameters "badActionParameters" #define XmNbadActionParametersMsg \ "Bad parameters passed to an action routine of widget '%s'." #define XmNbadMotionParams "badMotionParams" #define XmNbadMotionParamsMsg \ "%s - Motion Action : must have exactly 1 parameter, either '%s' or '%s'." #define XmNbadRowPixmap "badRowPixmap" #define XmNbadRowPixmapMsg "Extended List: Row pixmaps must have depth of 1." #define XmNbadXlfdFont "badXlfdFont" #define XmNbadXlfdFontMsg \ "%s: All Xlfd fonts must contain 14 hyphens\n'%s' is not valid." #define XmNcellNotEmpty "cellNotEmpty" #define XmNcellNotEmptyMsg "XmIconBox: Cell %s is not empty" #define XmNcolorNameTooLong "colorNameTooLong" #define XmNcolorNameTooLongMsg \ "Color name '%s' is too long, truncated to '%s'." #define XmNcontextSaveFailed "contextSaveFailed" #define XmNcontextSaveFailedMsg "Internal Error: Could not save context data." #define XmNconversionFailure "conversionFailure" #define XmNconversionFailureMsg \ "%s: Unable to perform string to %s conversion." #define XmNcouldNotFindFamilyData "couldNotFindFamilyData" #define XmNcouldNotFindFamilyDataMsg \ "Could not find family data for family '%s'." #define XmNforceGreaterThanZero "forceGreaterThanZero" #define XmNforceGreaterThanZeroMsg \ "XmNvisibleItemCount must be greater than zero being reset to one (1)." #define XmNinsertBeforeNotSibling "insertBeforeNotSibling" #define XmNinsertBeforeNotSiblingMsg "XmHierarchy: InsertBefore Widget\ is not a sibling of '%s'.\nInserting child at end of list." #define XmNnoComboShell "noComboShell" #define XmNnoComboShellMsg \ "Combination Box: When using a custom combo box a shell must be provided." #define XmNnoEmptyCells "noEmptyCells" #define XmNnoEmptyCellsMsg "XmIconBox: Could not find any empty cells." #define XmNnoGadgetSupport "noGadgetSupport" #define XmNnoGadgetSupportMsg "Widget does not support gadget children." #define XmNpixEditBadImageCreate "pixEditBadImageCreate" #define XmNpixEditBadImageCreateMsg "Pixmap Editor: Can't allocate image data" #define XmNsameAsImageOrPix "sameAsImageOrPix" #define XmNsameAsImageOrPixMsg \ "%s : The bitmapMode resource can only be changed at the same time as the pixmap or image" #define XmNselfOrOutsideOfApplicationDrop "selfOrOutsideOfApplicationDrop" #define XmNselfOrOutsideOfApplicationDropMsg \ "Attempt to drop into illegal object." #define XmNstaticTranslationsMsg \ "Cannot change translation table after initialization." #define XmNstaticScrollbarsMsg \ "Cannot change scrollbars after initialization." #define XmNtextVerifyFailed "textVerifyFailed" #define XmNtextVerifyFailedMsg "Combination Box: Text item validation failed." #define XmNunexpectedEvent "unexpectedEvent" #define XmNunexpectedEventMsg "Unexpected Event Type %s.\n" #define XmNunparsableColor "unparsableColor" #define XmNunparsableColorMsg \ "Could not parse the color name '%s'." #define XmNnodeParentIsSelf "nodeParentIsSelf" #define XmNnodeParentIsSelfMsg \ "The node parent cannot be self referential." #define XmNstringGetFailed "stringGetFailed" #define XmNstringGetFailedMsg "Unable to get MB string from XmString." /************************************************************ * MACROS *************************************************************/ /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ /************************************************************ * EXTERNAL DECLARATIONS *************************************************************/ void XmCopyISOLatin1Lowered(char *, char *); int XmCompareISOLatin1(char*, char*); Boolean XmCompareXtWidgetGeometryToWidget(XtWidgetGeometry*, Widget); Boolean XmCompareXtWidgetGeometry(XtWidgetGeometry*, XtWidgetGeometry*); #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* __Ext_h__ */ motif-2.3.8/lib/Xm/ScalTics.c0000644000175000017500000000756512672140200012575 00000000000000/* $XConsortium: ScalTics.c /main/7 1995/12/06 21:39:58 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include /* for allocate local */ #include #include #include "XmI.h" /************************************************************************ * * XmScaleSetTicks * ************************************************************************/ void XmScaleSetTicks( Widget scale, int big_every, Cardinal num_med, Cardinal num_small, Dimension size_big, Dimension size_med, Dimension size_small) { Widget *sep ; Cardinal n, i, j, k, sep_num; int real_num_big, real_num_med, real_num_small; Arg args[5]; int max, min ; unsigned char orient ; char * dim_res ; _XmWidgetToAppContext(scale); _XmAppLock(app); /* Some checking first */ if (size_big == 0) { _XmAppUnlock(app); return ; } if (size_med == 0) num_med = 0 ; if (size_small == 0) num_small = 0 ; /* big_every is the number of values between big tics, while num_med and num_small are the number of tics between resp. big and med values */ /* compute num_big first */ n = 0 ; XtSetArg(args[n], XmNmaximum, &max); n++; XtSetArg(args[n], XmNminimum, &min); n++; XtSetArg(args[n], XmNorientation, &orient); n++; XtGetValues(scale, args, n); real_num_big = ((max - min) / big_every) + 1 ; if (real_num_big < 2) { _XmAppUnlock(app); return ; } real_num_med = (real_num_big - 1) * num_med; real_num_small = (real_num_big + real_num_med - 1) * num_small; sep_num = real_num_big + real_num_med + real_num_small; sep = (Widget*) ALLOCATE_LOCAL(sep_num * sizeof(Widget)); if (orient == XmHORIZONTAL) { dim_res = XmNheight; orient = XmVERTICAL; } else { dim_res = XmNwidth ; orient = XmHORIZONTAL; } XtSetArg(args[0], XmNmargin, 0); XtSetArg(args[1], XmNorientation, orient); sep_num = 0 ; for (i=0; i < real_num_big; i++) { n = 2 ; XtSetArg(args[n], dim_res, size_big); n++ ; sep[sep_num] = XmCreateSeparatorGadget(scale, "BigTic", args, n); sep_num++; if (i == real_num_big - 1) break ; for (k=0; k < num_small; k++) { n = 2 ; XtSetArg(args[n], dim_res, size_small); n++; XtSetArg(args[n], XmNseparatorType, XmSINGLE_LINE); n++; sep[sep_num] = XmCreateSeparatorGadget(scale, "SmallTic", args, n); sep_num++; } for (j=0; j < num_med; j++) { n = 2 ; XtSetArg(args[n], dim_res, size_med); n++; sep[sep_num] = XmCreateSeparatorGadget(scale, "MedTic", args, n); sep_num++; for (k=0; k < num_small; k++) { n = 2 ; XtSetArg(args[n], dim_res, size_small); n++; XtSetArg(args[n], XmNseparatorType, XmSINGLE_LINE); n++; sep[sep_num] = XmCreateSeparatorGadget(scale, "SmallTic", args, n); sep_num++; } } } XtManageChildren(sep, sep_num); DEALLOCATE_LOCAL((char*)sep); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/ColumnP.h0000644000175000017500000001152112672140200012435 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef __Xmcolumnp_h__ #define __Xmcolumnp_h__ #ifdef __cplusplus extern "C" { #endif #include #include #include typedef struct _XmColumnClassPart { XtPointer extension; } XmColumnClassPart; typedef struct _XmColumnClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmColumnClassPart column_class; } XmColumnClassRec; externalref XmColumnClassRec xmColumnClassRec; typedef struct _XmColumnConstraintPart { /* Public */ unsigned char label_alignment; unsigned char label_type; unsigned char fill_style; Boolean show_label; Boolean stretchable; Pixmap label_pixmap; XmString label_string; XmFontList label_font_list; /* Private */ Widget label_widget; Dimension request_width; Dimension request_height; XRectangle position; Boolean check_set_render_table; /* used by CheckSetEntryLabelRenderTable */ } XmColumnConstraintPart, * XmColumnConstraint; typedef struct _XmColumnConstraintRec { XmManagerConstraintPart manager; XmBulletinBoardConstraintPart bboard; XmColumnConstraintPart column; } XmColumnConstraintRec, * XmColumnConstraintPtr; typedef struct _XmColumnPart { /* Public */ unsigned char default_label_alignment; unsigned char default_fill_style; unsigned char orientation; unsigned char distribution; Dimension item_spacing; Dimension label_spacing; /* Private */ Boolean resize_done; Boolean check_set_render_table; /* used by CheckSetDefaultEntryLabelRenderTable */ } XmColumnPart; typedef struct _XmColumnRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmColumnPart column; } XmColumnRec; #define XmColumnIndex (XmBulletinBoardIndex + 1) #define XmColumnC_label_alignment(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.label_alignment) #define XmColumnC_label_type(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.label_type) #define XmColumnC_fill_style(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.fill_style) #define XmColumnC_show_label(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.show_label) #define XmColumnC_stretchable(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.stretchable) #define XmColumnC_label_pixmap(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.label_pixmap) #define XmColumnC_label_string(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.label_string) #define XmColumnC_label_font_list(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.label_font_list) #define XmColumnC_label_widget(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.label_widget) #define XmColumnC_request_width(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.request_width) #define XmColumnC_request_height(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.request_height) #define XmColumnC_position(w) (((XmColumnConstraintPtr)((w)->core.constraints))->column.position) #define XmColumn_default_label_alignment(w) (((XmColumnWidget)(w))->column.default_label_alignment) #define XmColumn_default_fill_style(w) (((XmColumnWidget)(w))->column.default_fill_style) #define XmColumn_orientation(w) (((XmColumnWidget)(w))->column.orientation) #define XmColumn_distribution(w) (((XmColumnWidget)(w))->column.distribution) #define XmColumn_item_spacing(w) (((XmColumnWidget)(w))->column.item_spacing) #define XmColumn_label_spacing(w) (((XmColumnWidget)(w))->column.label_spacing) #define XmColumn_resize_done(w) (((XmColumnWidget)(w))->column.resize_done) #ifdef __cplusplus } #endif #endif /* __columnp_h__ */ motif-2.3.8/lib/Xm/Messages.c0000644000175000017500000017744213145162623012652 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Messages.c /main/23 1997/03/19 11:49:58 dbl $" #endif #endif /* Define _XmConst before including MessagesI.h, so that the * declarations will be in agreement with the definitions. */ #ifndef _XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define _XmConst const #else #define _XmConst #endif /* __STDC__ */ #endif /* _XmConst */ #include #include "MessagesI.h" #if 0 /* Comments below contain nested comments. */ /*===========================================================================*/ /* IMPORTANT NOTICE!! Please READ before editing this file! */ /* */ /* This file is also used to generate the XPG4 type message catalog. */ /* NO MESSAGES CAN BE REMOVED! If a message is no longer used, it can */ /* be removed from the object module by adding an #if 0 or /* above the */ /* line(s) containing the message, and the corresponding #endif or */ /* end-of-comment after the line(s). */ /* */ /* When ADDING messages to existing "sets" - a set is found inside /**** *****/ /* always add the new "externaldef(messages)" definition after everything */ /* else in the set. Example: */ /* */ /* /**************** First.c ****************/ /* */ /* externaldef(messages) _XmConst char *_XmMsgFirst_0000 = */ /* "Memory error"; */ /* */ /* /* Needed for message catalog BC. Do not remove */ /* /***+MSG_First_1000 "Fake message."*/ /* /***+$ MSG_First_1000 message is obsolete - DO NOT localize this message.*/ /* */ /* */ /* /**************** Second.c ****************/ /* */ /* Messages added to the set "First" should be added after the line */ /* /****+MSG_First_1000 "Fake message."*/ /* not after "Memory error". */ /* */ /* If you need to add another message "set", do so right before the */ /* XME_WARNING definition. */ /* */ /*===========================================================================*/ #endif /* * Text for message catalog header */ /***+$ This message catalog contains messages issued by Motif toolkit library.*/ /***+$ Consult X-Window systems, OSF/MOTIF Programmer's Guide and OSF/MOTIF*/ /***+$ Programmer's Reference Manual for technical terms if you have any*/ /***+$ doubts about their meanings.*/ /***+$ Do not translate variables such as %s, %d %s ... etc.*/ /***+$ Do not translate Motif resource name, such as XmNlabelType.*/ /***+$ Special terms with capital letter(s) should not be translated.*/ /***+$ "False" and "True" are keywords. Do not translate.*/ /***+ */ /***+ */ /**************** ArrowButton.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ArrowButton_1000 The arrow direction is not correct.*/ /***+$ MSG_ArrowButton_1000 message is obsolete - DO NOT localize this message.*/ /**************** BulletinB.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_BulletinB_1000 Incorrect resize policy.*/ /***+$ MSG_BulletinB_1000 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgBulletinB_0001 = "Dialog style must be XmDIALOG_MODELESS."; /* Needed for message catalog BC. Do not remove */ /***+MSG_BulletinB_1001 Incorrect shadow type.*/ /***+$ MSG_BulletinB_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_BulletinB_1002 Null font list (no VendorShell default)*/ /***+$ MSG_BulletinB_1002 message is obsolete - DO NOT localize this message.*/ /**************** CascadeB.c / CascadeBG.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_CascadeB_1000 XmCascadeButton must have correct type of \n\*/ /***+XmRowColumnWidgetClass parent.*/ /***+$ MSG_CascadeB_1000 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgCascadeB_0001 = "Only XmRowColumn widgets of type XmMENU_PULLDOWN can be submenus."; /***+$ please do not translate submenus. */ externaldef(messages) _XmConst char *_XmMsgCascadeB_0002 = "XmNmappingDelay must be greater than or equal to 0."; externaldef(messages) _XmConst char *_XmMsgCascadeB_0000 = "XmCascadeButton[Gadget] must have XmRowColumn parent with \n\ XmNrowColumnType XmMENU_PULLDOWN, XmMENU_POPUP, XmMENU_BAR or XmMENU_OPTION."; externaldef(messages) _XmConst char *_XmMsgCascadeB_0003 = "XtGrabPointer failed."; externaldef(messages) _XmConst char *_XmMsgRowColText_0024 = "XtGrabKeyboard failed."; /**************** Command.c ****************/ externaldef(messages) _XmConst char *_XmMsgCommand_0000 = "The dialog type must be XmDIALOG_COMMAND."; externaldef(messages) _XmConst char *_XmMsgCommand_0001 = "Invalid child type; Command widget does not have this child."; /***+$ please do not translate Command.*/ externaldef(messages) _XmConst char *_XmMsgCommand_0002 = "NULL or empty XmString."; externaldef(messages) _XmConst char *_XmMsgCommand_0003 = "NULL or empty XmString passed to XmCommandAppendValue."; externaldef(messages) _XmConst char *_XmMsgCommand_0004 = "XmNmustMatch is always False for a Command widget."; /***+$ please do not translate False or Command. */ externaldef(messages) _XmConst char *_XmMsgCommand_0005 = "XmNhistoryMaxItems must be a positive integer greater than zero."; /**************** CutPaste.c ****************/ externaldef(messages) _XmConst char *_XmMsgCutPaste_0000 = "Must call XmClipboardStartCopy() before XmClipboardCopy()"; externaldef(messages) _XmConst char *_XmMsgCutPaste_0001 = "Must call XmClipboardStartCopy() before XmClipboardEndCopy()"; externaldef(messages) _XmConst char *_XmMsgCutPaste_0002 = "Too many formats in XmClipboardCopy()"; externaldef(messages) _XmConst char *_XmMsgCutPaste_0003 = "ClipboardBadDataType"; /***+$ please do not translate ClipboardBadDataType.*/ externaldef(messages) _XmConst char *_XmMsgCutPaste_0004 = "incorrect data type"; externaldef(messages) _XmConst char *_XmMsgCutPaste_0005 = "ClipboardCorrupt"; /***+$ please do not translate ClipboardCorrupt.*/ externaldef(messages) _XmConst char *_XmMsgCutPaste_0006 = "internal error - corrupt data structure"; externaldef(messages) _XmConst char *_XmMsgCutPaste_0007 = "ClipboardBadFormat"; /***+$ please do not translate ClipboardBadFormat.*/ externaldef(messages) _XmConst char *_XmMsgCutPaste_0008 = "Registered format length must be 8, 16, or 32"; externaldef(messages) _XmConst char *_XmMsgCutPaste_0009 = "Registered format name must not be null"; /**************** DialogS.c ****************/ externaldef(messages) _XmConst char *_XmMsgDialogS_0000 = "DialogShell widget supports only one RectObj child"; /***+$ please do not translate DialogShell and RectObj.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_DialogS_1000 gadgets aren't allowed in Shell*/ /***+$ MSG_DialogS_1000 message is obsolete - DO NOT localize this message.*/ /**************** DrawingA.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_DrawingA_1001 Margin width or height cannot be negative.*/ /***+$ MSG_DrawingA_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_DrawingA_1002 Incorrect resize policy.*/ /***+$ MSG_DrawingA_1002 message is obsolete - DO NOT localize this message.*/ /**************** Form.c ****************/ externaldef(messages) _XmConst char *_XmMsgForm_0000 = "Fraction base cannot be zero."; /* Needed for message catalog BC. Do not remove */ /***+MSG_Form_1000 Incorrect Form attachment type.*/ /***+$ MSG_Form_1000 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Form_1001 Cannot set constraints for non-resizable widget.*/ /***+$ MSG_Form_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Form_1002 Attachment widget must not be null.*/ /***+$ MSG_Form_1002 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate Attachment.*/ externaldef(messages) _XmConst char *_XmMsgForm_0002 = "Circular dependency in the children of the Form widget.\n\ Check for circular attachments between the children."; /***+$ please do not translate Form.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Form_1006 Edge attached to a widget but no widget specified.*/ /***+$ MSG_Form_1006 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgForm_0003 = "Abandoned edge synchronization after 10000 iterations.\n\ Check for contradictory constraints on the children of this Form widget."; /***+$ please do not translate Form.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Form_0004 Attachment widget must have same parent as widget.*/ /***+$ MSG_Form_0004 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate Attachment.*/ /**************** Frame.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Frame_1000 Only one child should be inserted in a Frame.*/ /***+$ MSG_Frame_1000 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate Frame.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Frame_1001 Invalid margin width.*/ /***+$ MSG_Frame_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Frame_1002 Invalid margin height.*/ /***+$ MSG_Frame_1002 message is obsolete - DO NOT localize this message.*/ /**************** Gadget.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Gadget_1000 Invalid highlight thickness.*/ /***+$ MSG_Gadget_1000 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Gadget_1001 The unit type is incorrect.*/ /***+$ MSG_Gadget_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Gadget_1002 Invalid shadow thickness.*/ /***+$ MSG_Gadget_1002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Gadget_1003 Cannot set pixmap resource to unspecified.*/ /***+$ MSG_Gadget_1003 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgGadget_0000 = "Cannot change XmNlayoutDirection after initialization."; /**************** Label.c / LabelG.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Label_1001 Invalid XmNlabelType*/ /***+$ MSG_Label_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Label_1002 Invalid value in XmNalignment*/ /***+$ MSG_Label_1002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Label_1003 Invalid value in XmNstringDirection*/ /***+$ MSG_Label_1003 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgLabel_0003 = "XmNlabelString must be a Compound String."; /***+$ please do not translate Compound String.*/ externaldef(messages) _XmConst char *_XmMsgLabel_0004 = "XmNacceleratorText must be a Compound String."; /***+$ please do not translate Compound String.*/ /**************** List.c ****************/ externaldef(messages) _XmConst char *_XmMsgList_0000 = "When changed, XmNvisibleItemCount must be at least 1."; /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1001 Invalid Selection Policy.*/ /***+$ MSG_List_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1002 Invalid Size Policy.*/ /***+$ MSG_List_1002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1003 Invalid ScrollBar Display Policy.*/ /***+$ MSG_List_1003 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1004 Invalid String Direction.*/ /***+$ MSG_List_1004 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgList_0005 = "Cannot change XmNlistSizePolicy after initialization."; externaldef(messages) _XmConst char *_XmMsgList_0006 = "When changed, XmNitemCount must be non-negative."; /***+$ non-negative means zero or positive.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1007 NULL font in SetValues ignored.*/ /***+$ MSG_List_1007 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate SetValues*/ externaldef(messages) _XmConst char *_XmMsgList_0007 = "Item(s) to be deleted are not present in the list."; /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1009 No Horizontal Scrollbar to set.*/ /***+$ MSG_List_1009 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1010 Invalid Margin setting.*/ /***+$ MSG_List_1010 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgList_0008 = "XmNlistSpacing must be non-negative."; externaldef(messages) _XmConst char *_XmMsgList_0009 = "Cannot set XmNitems to NULL when XmNitemCount is positive."; externaldef(messages) _XmConst char *_XmMsgList_0010 = "XmNselectedItemCount must not be negative."; externaldef(messages) _XmConst char *_XmMsgList_0011 = "Cannot set XmNselectedItems to NULL when XmNselectedItemCount \ is positive."; externaldef(messages) _XmConst char *_XmMsgList_0012 = "XmNtopItemPosition must be non-negative."; externaldef(messages) _XmConst char *_XmMsgList_0013 = "XmNitems and XmNitemCount mismatch!"; /* Needed for message catalog BC. Do not remove */ /***+MSG_List_1017 Cannot leave add mode in multiple selection.*/ /***+$ MSG_List_1017 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgList_0014 = "XmNselectedPositionCount must not be negative."; externaldef(messages) _XmConst char *_XmMsgList_0015 = "Cannot set XmNselectedPositions to NULL when XmNselectedPositionCount \ is positive."; /**************** MainW.c ****************/ externaldef(messages) _XmConst char *_XmMsgMainW_0000 = "The MenuBar cannot be changed to NULL."; /***+$ please do not translate MenuBar.*/ externaldef(messages) _XmConst char *_XmMsgMainW_0001 = "The CommandWindow cannot be changed to NULL."; /***+$ please do not translate CommandWindow.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_MainW_1003 Negative margin value ignored.*/ /***+$ MSG_MainW_1003 message is obsolete - DO NOT localize this message.*/ /**************** MenuShell.c ****************/ externaldef(messages) _XmConst char *_XmMsgMenuShell_0000 = "MenuShell widgets accept only XmRowColumn children."; /***+$ please do not translate MenuShell.*/ externaldef(messages) _XmConst char *_XmMsgMenuShell_0001 = "Attempting to manage a pulldown menu that is not attached \n\ to a Cascade button."; externaldef(messages) _XmConst char *_XmMsgMenuShell_0002 = "XmPopup requires a subclass of shellWidgetClass."; /***+$ please do not translate shellWidgetClass.*/ externaldef(messages) _XmConst char *_XmMsgMenuShell_0003 = "XmPopdown requires a subclass of shellWidgetClass."; /***+$ please do not translate shellWidgetClass.*/ externaldef(messages) _XmConst char *_XmMsgMenuShell_0004 = "XtMenuPopup requires exactly one argument."; externaldef(messages) _XmConst char *_XmMsgMenuShell_0005 = "XtMenuPopup only supports ButtonPress, KeyPress or EnterNotify events."; /***+$ please do not translate ButtonPress, KeyPress or EnterNotify.*/ externaldef(messages) _XmConst char *_XmMsgMenuShell_0006 = "Cannot find popup widget \"%s\" in XtMenuPopup."; externaldef(messages) _XmConst char *_XmMsgMenuShell_0007 = "Cannot find popup widget \"%s\" in XtMenuPopdown."; externaldef(messages) _XmConst char *_XmMsgMenuShell_0008 = "XtMenuPopdown called with more than one argument."; externaldef(messages) _XmConst char *_XmMsgMenuShell_0009 = "Cannot change XmNlayoutDirection after initialization."; /**************** MessageB.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_MessageB_1001 Invalid Dialog Type.*/ /***+$ MSG_MessageB_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_MessageB_1002 Invalid Default Button Type.*/ /***+$ MSG_MessageB_1002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_MessageB_1003 Invalid Alignment Type.*/ /***+$ MSG_MessageB_1003 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgMessageB_0003 = "Invalid child type; widget does not have this child"; externaldef(messages) _XmConst char *_XmMsgMessageB_0004 = "Cancel button cannot be changed."; /* Needed for message catalog BC. Do not remove */ /***+MSG_MessageB_1006 Use XmNdefaultButtonType to set MessageBox default button.*/ /***+$ MSG_MessageB_1006 message is obsolete - DO NOT localize this message.*/ /**************** PanedW.c ****************/ externaldef(messages) _XmConst char *_XmMsgPanedW_0000 = "Minimum value must be greater than 0."; externaldef(messages) _XmConst char *_XmMsgPanedW_0001 = "Maximum value must be greater than 0."; externaldef(messages) _XmConst char *_XmMsgPanedW_0002 = "Minimum value must be less than maximum value."; /* Needed for message catalog BC. Do not remove */ /***+MSG_PanedW_0003 Constraints do not allow appropriate sizing.*/ /***+$ MSG_PanedW_0003 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgPanedW_0004 = "Too few parameters in sash callback."; externaldef(messages) _XmConst char *_XmMsgPanedW_0005 = "Invalid first parameter in sash callback."; /**************** PWidget.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_PWI_1001 fontList is not defined*/ /***+$ MSG_PWI_1001 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate fontList.*/ /**************** Protocols.c ****************/ externaldef(messages) _XmConst char *_XmMsgProtocols_0000 = "Widget must be a VendorShell."; /***+$ please do not translate VendorShell.*/ externaldef(messages) _XmConst char *_XmMsgProtocols_0001 = "Protocol manager already exists."; externaldef(messages) _XmConst char *_XmMsgProtocols_0002 = "There are more protocols than widget can handle; 32 is the limit."; /**************** PushB.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_PushB_1001 Not enough memory*/ /***+$ MSG_PushB_1001 message is obsolete - DO NOT localize this message.*/ /**************** RowColumn.c ****************/ /***+$ In this set, please do not translate the word that starts with "XmN" or "Xm". */ /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1001 Attempt to set width to zero.\n\*/ /***+Set to default value 16.*/ /***+$ MSG_RowColumn_1001 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0000 = "Attempt to set width to zero ignored"; /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1003 Attempt to set height to zero.\n\*/ /***+Set to default value 16.*/ /***+$ MSG_RowColumn_1003 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0001 = "Attempt to set height to zero ignored"; externaldef(messages) _XmConst char *_XmMsgRowColumn_0002 = "XmNhelpWidget forced to NULL since it is not used by popup menus."; externaldef(messages) _XmConst char *_XmMsgRowColumn_0003 = "XmNhelpWidget forced to NULL since it is not used by pulldown menus."; externaldef(messages) _XmConst char *_XmMsgRowColumn_0004 = "XmNhelpWidget forced to NULL since it is not used by option menus."; externaldef(messages) _XmConst char *_XmMsgRowColumn_0005 = "XmNhelpWidget forced to NULL since it is not used by Work Areas."; /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1009 Unknown value of XmNrowColumnType.\n\*/ /***+It is set to WorkArea.*/ /***+$ MSG_RowColumn_1009 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0007 = "Widget hierarchy not appropriate for this XmNrowColumnType:\n\ defaulting to XmWORK_AREA."; externaldef(messages) _XmConst char *_XmMsgRowColumn_0008 = "Attempt to change XmNrowColumnType after initialization ignored"; /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1012 Unknown value of XmNorientation.\n\*/ /***+The default value is used.*/ /***+$ MSG_RowColumn_1012 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1013 Attempt to set XmNorientation to unknown value.\n\*/ /***+The value is ignored.*/ /***+$ MSG_RowColumn_1013 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1014 Unknown value of XmNpacking.\n\*/ /***+The default value is used.*/ /***+$ MSG_RowColumn_1014 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1015 Attempt to set XmNpacking to unknown value.\n\*/ /***+The value is ignored.*/ /***+$ MSG_RowColumn_1015 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1016 Unknown value of XmNentryAlignment.\n\*/ /***+The default value is used.*/ /***+$ MSG_RowColumn_1016 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1017 Attempt to set XmNentryAlignment to unknown value.\n\*/ /***+The value is ignored.*/ /***+$ MSG_RowColumn_1017 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0015 = "Attempt to set XmNisHomogenous to FALSE for a RowColumn widget of type \ XmMENU_BAR ignored."; /***+$ please do not translate FALSE and RowColumn.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0016 = "Attempt to change XmNentryClass for a RowColumn widget of type \ XmMENU_BAR ignored."; /***+$ please do not translate RowColumn.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0017 = "Attempt to change XmNwhichButton via XtSetValues for a RowColumn widget \ of type XmMENU_PULLDOWN ignored."; /***+$ please do not translate RowColumn.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0018 = "Attempt to change XmNmenuPost via XtSetValues for a RowColumn widget \ of type XmMENU_PULLDOWN ignored."; /***+$ please do not translate RowColumn.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0019 = "Attempt to set XmNmenuPost to an illegal value ignored."; externaldef(messages) _XmConst char *_XmMsgRowColumn_0020 = "Attempt to change XmNshadowThickness for a RowColumn widget not of type \ XmMENU_PULLDOWN or XmMENU_POPUP ignored."; /***+$ please do not translate RowColumn.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_RowColumn_1024 Attempt to change XmNorientation for a RowColumn \n\*/ /***+widget of type XmMENU_OPTION.\n\*/ /***+The value is ignored.*/ /***+$ MSG_RowColumn_1024 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0022 = "Attempt to add wrong child type to a menu (that is, XmRowColumn) widget"; /***+$ please do not translate RowColumn.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0023 = "Attempt to add wrong child type to a homogeneous RowColumn widget"; /***+$ please do not translate RowColumn.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0025 = "Attempt to change XmNisHomogeneous for a RowColumn widget of type \ XmMENU_OPTION ignored"; /***+$ please do not translate RowColumn.*/ externaldef(messages) _XmConst char *_XmMsgRowColumn_0026 = "Enabling tear off on a shared menupane is not recommended"; externaldef(messages) _XmConst char *_XmMsgRowColumn_0027 = "Illegal mnemonic character; Could not convert X KEYSYM to a keycode"; /***+$ please do not translate X KEYSYM.*/ /**************** Scale.c ****************/ externaldef(messages) _XmConst char *_XmMsgScale_0000 = "The minumum scale value is greater than or equal to the maximum scale \ value."; externaldef(messages) _XmConst char *_XmMsgScale_0001 = "The specified scale value is less than the minimum scale value."; externaldef(messages) _XmConst char *_XmMsgScale_0002 = "The specified scale value is greater than the maximum scale value."; /* Needed for message catalog BC. Do not remove */ /***+MSG_Scale_1004 Incorrect orientation.*/ /***+$ MSG_Scale_1004 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgScaleScrBar_0004 = "Incorrect processing direction."; /* Needed for message catalog BC. Do not remove */ /***+MSG_Scale_0005 = Invalid highlight thickness.*/ /***+$ MSG_Scale_0005 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgScale_0006 = "Invalid XmNscaleMultiple; greater than (max - min)"; externaldef(messages) _XmConst char *_XmMsgScale_0007 = "Invalid XmNscaleMultiple; less than zero"; externaldef(messages) _XmConst char *_XmMsgScale_0008 = "(Maximum - minimum) cannot be greater than INT_MAX / 2;\n\ minimum has been set to zero, maximum may have been set to (INT_MAX/2)."; externaldef(messages) _XmConst char *_XmMsgScale_0009 = "XmNshowValue has an incorrect value"; /**************** ScrollBar.c ****************/ externaldef(messages) _XmConst char *_XmMsgScrollBar_0000 = "The minimum scrollbar value is greater than or equal to\n\ the maximum scrollbar value."; externaldef(messages) _XmConst char *_XmMsgScrollBar_0001 = "The specified slider size is less than 1."; externaldef(messages) _XmConst char *_XmMsgScrollBar_0002 = "The specified scrollbar value is less than the minimum\n\ scrollbar value."; externaldef(messages) _XmConst char *_XmMsgScrollBar_0003 = "The specified scrollbar value is greater than the maximum\n\ scrollbar value minus the scrollbar slider size."; /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrollBar_1005 Incorrect orientation.*/ /***+$ MSG_ScrollBar_1005 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrollBar_1006 Incorrect processing direction.*/ /***+$ MSG_ScrollBar_1006 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgScrollBar_0004 = "The scrollbar increment is less than 1."; externaldef(messages) _XmConst char *_XmMsgScrollBar_0005 = "The scrollbar page increment is less than 1."; externaldef(messages) _XmConst char *_XmMsgScrollBar_0006 = "The scrollbar initial delay is less than 1."; externaldef(messages) _XmConst char *_XmMsgScrollBar_0007 = "The scrollbar repeat delay is less than 1."; /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrollBar_1011 Error in context manager; scrollbar backgrounds\n\*/ /***+cannot be set correctly*/ /***+$ MSG_ScrollBar_1011 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrollBar_1012 Error in context manager; scrollbar foregrounds\n\*/ /***+cannot be set correctly*/ /***+$ MSG_ScrollBar_1012 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgScrollBar_0008 = "Specified slider size is greater than the maximum scrollbar\n\ value minus the minimum scrollbar value."; /**************** ScrolledW.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrolledW_1001 Invalid ScrollBar Display policy.*/ /***+$ MSG_ScrolledW_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrolledW_1002 Invalid Scrolling Policy.*/ /***+$ MSG_ScrolledW_1002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrolledW_1003 Invalid Visual Policy.*/ /***+$ MSG_ScrolledW_1003 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ScrolledW_1004 Invalid placement policy.*/ /***+$ MSG_ScrolledW_1004 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgScrolledW_0004 = "Cannot change scrolling policy after initialization."; externaldef(messages) _XmConst char *_XmMsgScrolledW_0005 = "Cannot change visual policy after initialization."; externaldef(messages) _XmConst char *_XmMsgScrolledW_0006 = "Cannot set AS_NEEDED scrollbar policy with a\n\ visual policy of VARIABLE."; /***+$ please do not translate AS_NEEDED or VARIABLE.*/ externaldef(messages) _XmConst char *_XmMsgScrolledW_0007 = "Cannot change scrollbar widget in AUTOMATIC mode."; /***+$ please do not translate AUTOMATIC.*/ externaldef(messages) _XmConst char *_XmMsgScrolledW_0008 = "Cannot change clip window"; externaldef(messages) _XmConst char *_XmMsgScrolledW_0009 = "Cannot set visual policy of CONSTANT in APPLICATION_DEFINED mode."; /***+$ please do not translate CONSTANT or APPLICATION_DEFINED.*/ externaldef(messages) _XmConst char *_XmMsgScrollVis_0000 = "Wrong parameters passed to the XmScrollVisible function."; /**************** SelectioB.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_SelectioB_1001 Incorrect dialog type.*/ /***+$ MSG_SelectioB_1001 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgSelectioB_0001 = "Dialog type cannot be modified."; /***+$ please do not translate Dialog.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_SelectioB_1003 Only one work area child allowed.*/ /***+$ MSG_SelectioB_1003 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgSelectioB_0002 = "Widget does not support this child type."; /**************** Separator.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Separator_1001 Invalid separator type.*/ /***+$ MSG_Separator_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Separator_1002 Invalid orientation.*/ /***+$ MSG_Separator_1002 message is obsolete - DO NOT localize this message.*/ /**************** Text.c ****************/ externaldef(messages) _XmConst char *_XmMsgText_0000 = "Incorrect source text is ignored."; /* Needed for message catalog BC. Do not remove */ /***+MSG_Text_1003 Invalid edit mode.*/ /***+$ MSG_Text_1003 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Text_0002 Text widget is editable; XmNtraversalOn must be True.*/ /***+$ MSG_Text_0002 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate XmNtraversalOn and True.*/ externaldef(messages) _XmConst char *_XmMsgTextIn_0000 = "Cannot find position while attempting to move to previous line."; externaldef(messages) _XmConst char *_XmMsgTextOut_0000 = "Number of rows must be greater than 0."; externaldef(messages) _XmConst char *_XmMsgTextF_0002 = "XmFontListInitFontContext failed."; /***+$ please do not translate XmFontListInitFontContext.*/ externaldef(messages) _XmConst char *_XmMsgTextF_0003 = "XmFontListGetNextFont failed."; /***+$ please do not translate XmFontListGetNextFont.*/ externaldef(messages) _XmConst char *_XmMsgTextF_0004 = "Character '%s' not supported in font. Discarded."; externaldef(messages) _XmConst char *_XmMsgTextFWcs_0000 = "Character '%s' not supported in font. Discarded."; /* Needed for message catalog BC. Do not remove */ /***+MSG_TextFWcs_0001 Cannot use multibyte locale without a fontset. Value discarded.*/ /***+$ MSG_TextFWcs_0001 message is obsolete - DO NOT localize this message.*/ /**************** TextF.c ****************/ externaldef(messages) _XmConst char *_XmMsgTextF_0000 = "Cursor position must be greater than or equal to 0."; externaldef(messages) _XmConst char *_XmMsgTextF_0001 = "Number of columns must be greater than 0."; /* Needed for message catalog BC. Do not remove */ /***+MSG_TextF_0005 XmNtraversalOn must always be True.*/ /***+$ please do not translate XmNtraversalOn and True.*/ /***+$ MSG_TextF_0005 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgTextF_0006 = "Number of columns must be greater than or equal to 0."; /**************** ToggleB.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ToggleB_1001 Indicator type should be either XmONE_OF_MANY or XmN_OF_MANY*/ /***+$ MSG_ToggleB_1001 message is obsolete - DO NOT localize this message.*/ /**************** Traversal.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Traversal_1001 Invalid value for navigation_type*/ /***+$ MSG_Traversal_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Traversal_1002 Wrong value in old for navigation_type!!*/ /***+$ MSG_Traversal_1002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Traversal_1003 Traversal bootstrap situation with bad parameters*/ /***+$ MSG_Traversal_1003 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Traversal_1004 Attempt to traverse to new tab using bad parameters*/ /***+$ MSG_Traversal_1004 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Traversal_1005 startWidget is not in child list*/ /***+$ MSG_Traversal_1005 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate startWidget*/ /***+MSG_Traversal_1006 Bad parameters to TraverseToChild*/ /***+$ MSG_Traversal_1006 message is obsolete - DO NOT localize this message.*/ /***+$ please do not translate TraverseToChild.*/ /**************** Vendor.c ****************/ externaldef(messages) _XmConst char *_XmMsgVendor_0000 = "Invalid value for XmNdeleteResponse"; /* Needed for message catalog BC. Do not remove */ /***+MSG_Vendor_1002 Invalid XmNpreeditType, default to OverTheSpot*/ /***+$ MSG_Vendor_1002 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgVendor_0001 = "Invalid value for XmNinputPolicy"; externaldef(messages) _XmConst char *_XmMsgVendor_0002 = "XmNlayoutDirection cannot be changed."; externaldef(messages) _XmConst char *_XmMsgVendor_0003 = "Fatal Error: \n\ _XmGetDefaultDisplay cannot be used prior to VendorS.Initialize, returns NULL"; /***+$ please do not translate VendorS.Initialize.*/ /**************** VendorE.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_VendorE_1001 FetchUnitType: bad widget class*/ /***+$ MSG_VendorE_1001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_VendorE_0000 String to no-op conversion needs no extra arguments.*/ /***+$ MSG_VendorE_0000 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_VendorE_0005 FetchUnitType called without a widget to reference.*/ /***+$ please do not translate FetchUnitType.*/ /***+$ MSG_VendorE_0005 message is obsolete - DO NOT localize this message.*/ /**************** VirtKeys.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_VirtKey_1001 Virtual bindings Initialize hasn't been called*/ /***+$ MSG_VirtKey_1001 message is obsolete - DO NOT localize this message.*/ /**************** Visual.c ****************/ externaldef(messages) _XmConst char *_XmMsgVisual_0000 = "Invalid color requested from _XmAccessColorData."; externaldef(messages) _XmConst char *_XmMsgVisual_0001 = "Cannot allocate colormap entry for default background."; externaldef(messages) _XmConst char *_XmMsgVisual_0002 = "Cannot parse default background color specification."; /**************** XmIm.c *******************/ externaldef(messages) _XmConst char *_XmMsgXmIm_0000 = "Cannot open input method - using XLookupString."; /* Needed for message catalog BC. Do not remove */ /***+MSG_XmIm_1002 Cannot create the Input Method Object*/ /***+$ MSG_XmIm_1002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_XmIm_1003 XmIMFocus invoked with NULL widget.*/ /***+$ MSG_XmIm_1003 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_XmIm_1004 XmIMMove invoked without the Input Method focus.*/ /***+$ MSG_XmIm_1004 message is obsolete - DO NOT localize this message.*/ /**************** Resources ************************/ externaldef(messages) _XmConst char *_XmMsgResource_0001 = "OK"; /***+$ "OK" as in "Go ahead"/"Confirmed to proceed as instructed"/"Fine"*/ externaldef(messages) _XmConst char *_XmMsgResource_0002 = "Cancel"; /***+$ ... as in "Never mind"/"abort this operation"/"Stop current request"*/ externaldef(messages) _XmConst char *_XmMsgResource_0003 = "Selection"; /***+$ ... as in "choosing from a list of items"*/ externaldef(messages) _XmConst char *_XmMsgResource_0004 = "Apply"; /***+$ ... as in "To do something with the things selected"*/ externaldef(messages) _XmConst char *_XmMsgResource_0005 = "Help"; /***+$ ... as in "Need more guidance on how to deal with this dialog box"*/ externaldef(messages) _XmConst char *_XmMsgResource_0006 = "Filter"; /***+$ ... the noun "Filter", as in "a sifter/a filter/a qualifier to screen out"*/ /***+$ files with*/ externaldef(messages) _XmConst char *_XmMsgResource_0007 = "Files"; /***+$ ... as in "a list of the files"*/ externaldef(messages) _XmConst char *_XmMsgResource_0008 = "Directories"; /***+$ ... as in "a list of the directories" */ externaldef(messages) _XmConst char *_XmMsgResource_0009 = "Items"; /***+$ ... as in "a list of things to choose from"*/ externaldef(messages) _XmConst char *_XmMsgResource_0010 = "Filter"; /***+$ ... the verb "Filter", as in "To screen out some files"*/ /***+$ Note this has a slightly different semantics from MSG_Res_1006.*/ /***+$ In English, it is the same word, but MSG_Res_1006 means "a sifter", and*/ /***+$ MSG_Res_1010 means "Push this button to filter out some files"*/ /***+$ MSG_Res_1006 is a label indicating "entry below is qualifier to filter out" */ /***+$ files with*/ externaldef(messages) _XmConst char *_XmMsgResource_0011 = "Directory"; externaldef(messages) _XmConst char *_XmMsgResource_0012 = ">"; /***+$ command-line prompt in the Command widget. */ externaldef(messages) _XmConst char *_XmMsgResource_0013 = "Find"; /*=========================================================================== * New for 1.2 *===========================================================================*/ /**************** BaseClass.c ****************/ externaldef(messages) _XmConst char *_XmMsgBaseClass_0000 = "No context found for extension"; externaldef(messages) _XmConst char *_XmMsgBaseClass_0001 = "_XmPopWidgetExtData; no extension found with XFindContext"; /* Needed for message catalog BC. Do not remove */ /***+MSG_BaseClass_0002 XmFreeWidgetExtData is an unsupported routine*/ /***+$ MSG_BaseClass_0002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_GetSecRes_0000 getLabelSecResData: Not enough memory*/ /***+$ please do not translate getLabelSecResData.*/ /***+$ MSG_GetSecRes_0000 message is obsolete - DO NOT localize this message.*/ /*************** Display.c ***************/ externaldef(messages) _XmConst char *_XmMsgDisplay_0001 = "Creating multiple XmDisplays for the same X display. Only the\n\ first XmDisplay created for a particular X display can be referenced\n\ by calls to XmGetXmDisplay"; /***+$ please do not translate XmDisplay or XmGetXmDisplay*/ externaldef(messages) _XmConst char *_XmMsgDisplay_0002 = "Received TOP_LEVEL_LEAVE with no active DragContext"; /***+$ please do not translate TOP_LEVEL_LEAVE or DragContext*/ externaldef(messages) _XmConst char *_XmMsgDisplay_0003 = "Cannot set XmDisplay class to a non-subclass of XmDisplay"; /***+$ please do not translate XmDisplay*/ /**************** DragBS.c ****************/ externaldef(messages) _XmConst char *_XmMsgDragBS_0000 = "_MOTIF_DRAG_WINDOW property has been destroyed"; /***+$ please do not translate _MOTIF_DRAG_WINDOW*/ externaldef(messages) _XmConst char *_XmMsgDragBS_0001 = "The protocol version levels do not match."; externaldef(messages) _XmConst char *_XmMsgDragBS_0002 = "Unable to open display."; externaldef(messages) _XmConst char *_XmMsgDragBS_0003 = "The atom table is empty."; externaldef(messages) _XmConst char *_XmMsgDragBS_0004 = "The target table is empty."; externaldef(messages) _XmConst char *_XmMsgDragBS_0005 = "The target table has an inconsistent property."; externaldef(messages) _XmConst char *_XmMsgDragBS_0006 = "Invalid target table index."; /*************** DragC.c *******************/ externaldef(messages) _XmConst char *_XmMsgDragC_0001 = "GenerateCallback does not expect XmCR_DROP_SITE_ENTER as a reason."; /***+$ please do not translate GenerateCallback or XmCR_DROP_SITE_ENTER*/ externaldef(messages) _XmConst char *_XmMsgDragC_0002 = "Invalid selection in DropConvertCallback"; /***+$ please do not translate DropConvertCallback*/ externaldef(messages) _XmConst char *_XmMsgDragC_0003 = "The drop selection was lost."; externaldef(messages) _XmConst char *_XmMsgDragC_0004 = "XGrabPointer failed."; externaldef(messages) _XmConst char *_XmMsgDragC_0005 = "ExternalNotifyHandler: the callback reason is not acceptable."; /***+$ please do not translate ExternalNotifyHandler*/ externaldef(messages) _XmConst char *_XmMsgDragC_0006 = "XmDragStart must be called as a result of a button press or motion event."; /***+$ please do not translate XmDragStart*/ /**************** DragICC.c ****************/ externaldef(messages) _XmConst char *_XmMsgDragICC_0000 = "Unknown drag and drop message type."; externaldef(messages) _XmConst char *_XmMsgDragICC_0001 = "The protocol version levels do not match."; /**************** DragIcon.c ****************/ externaldef(messages) _XmConst char *_XmMsgDragIcon_0000 = "No geometry specified for dragIcon pixmap"; /***+$ please do not translate dragIcon*/ externaldef(messages) _XmConst char *_XmMsgDragIcon_0001 = "A dragIcon created with no pixmap"; /***+$ please do not translate dragIcon*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_DragIcon_0002 String to Bitmap converter needs Screen argument.*/ /***+$ MSG_DragIcon_0002 message is obsolete - DO NOT localize this message.*/ /**************** DragOverS.c ****************/ externaldef(messages) _XmConst char *_XmMsgDragOverS_0000 = "Depth mismatch."; externaldef(messages) _XmConst char *_XmMsgDragOverS_0001 = "Unknown icon attachment."; externaldef(messages) _XmConst char *_XmMsgDragOverS_0002 = "Unknown drag state."; externaldef(messages) _XmConst char *_XmMsgDragOverS_0003 = "Unknown XmNblendModel."; /***+$ please do not translate XmNblendModel */ /**************** DragUnder.c ****************/ externaldef(messages) _XmConst char *_XmMsgDragUnder_0000 = "Unable to get drop site window geometry."; externaldef(messages) _XmConst char *_XmMsgDragUnder_0001 = "Invalid animationPixmapDepth."; /***+$ please do not translate animationPixmapDepth*/ /*************** DropSMgr.c *******************/ externaldef(messages) _XmConst char *_XmMsgDropSMgr_0001 = "Cannot create drop sites that are children of a simple drop site."; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0002 = "Receiving motion events without an active drag context"; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0003 = "Receiving operation changed without an active drag context."; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0004 = "Creating an active drop site with no drop procedure."; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0005 = "Cannot set rectangles or number of rectangles of composite drop sites."; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0006 = "Registering a widget as a drop site out of sequence.\n\ Ancestors must be registered before any of their \n\ descendants are registered."; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0007 = "Cannot register widget as a drop site more than once."; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0008 = "Drop site type may only be set at creation time."; /***+$ please do not translate DropSite*/ externaldef(messages) _XmConst char *_XmMsgDropSMgr_0009 = "Cannot change rectangles of non-simple drop site."; externaldef(messages) _XmConst char *_XmMsgDropSMgr_0010 = "Cannot register a Shell as a drop site."; externaldef(messages) _XmConst char *_XmMsgDropSMgrI_0001 = "Cannot register a drop site that is a descendent of a simple drop site"; externaldef(messages) _XmConst char *_XmMsgDropSMgrI_0002 = "Cannot create a discontiguous child list for a composite drop site."; externaldef(messages) _XmConst char *_XmMsgDropSMgrI_0003 = "%s is not a drop site child of %s"; /*************** GeoUtils.c *******************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_GeoUtils_0000 Failure of geometry request to \"almost\" reply".*/ /***+$ please do not translate "almost"*/ /***+$ MSG_GeoUtils_0000 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_GeoUtils_0001 Invalid layout of children found.*/ /***+$ MSG_GeoUtils_0001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_GeoUtils_0002 Invalid order found in XmSelectionBox.*/ /***+$ MSG_GeoUtils_0002 message is obsolete - DO NOT localize this message.*/ /**************** Region.c ****************/ externaldef(messages) _XmConst char *_XmMsgRegion_0000 = "Memory error"; /*************** RepType.c ***************/ externaldef(messages) _XmConst char *_XmMsgRepType_0001 = "Illegal representation type id"; externaldef(messages) _XmConst char *_XmMsgRepType_0002 = "Illegal value (%d) for rep type XmR%s"; /***+$ please do not translate XmR%s*/ externaldef(messages) _XmConst char *_XmMsgRepType_0000 = "Reverse Conversion of "; /**************** ResConvert.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ResConvert_0000 FetchUnitType: bad widget class.*/ /***+$ please do not translate FetchUnitType.*/ /***+$ MSG_ResConvert_0000 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgResConvert_0001 = "Improperly defined default list! Exiting..."; externaldef(messages) _XmConst char *_XmMsgResConvert_0002 = "Missing colon in font string \"%s\"; any remaining fonts in list unparsed"; externaldef(messages) _XmConst char *_XmMsgResConvert_0003 = "Invalid delimiter in tag \"%s\"; any remaining fonts in list unparsed"; /* Needed for message catalog BC. Do not remove */ /***+MSG_ResConvert_0004 Unmatched quotation marks in string \"%s\"; any remaining fonts in list unparsed"*/ /***+$ MSG_ResConvert_0004 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgResConvert_0005 = "Unmatched quotation marks in tag \"%s\"; any remaining fonts in list unparsed"; externaldef(messages) _XmConst char *_XmMsgResConvert_0006 = "Null tag found when converting to type %s; any remaining fonts in list unparsed"; externaldef(messages) _XmConst char *_XmMsgResConvert_0007 = "Cannot convert XmString to Compound Text"; externaldef(messages) _XmConst char *_XmMsgResConvert_0008 = "Insufficient memory for XmbTextListToTextProperty"; externaldef(messages) _XmConst char *_XmMsgResConvert_0009 = "Locale not supported for XmbTextListToTextProperty"; externaldef(messages) _XmConst char *_XmMsgResConvert_0010 = "XmbTextListToTextProperty failed"; externaldef(messages) _XmConst char *_XmMsgResConvert_0011 = "Cannot convert widget name to Widget."; /***+$ please do not translate Widget.*/ externaldef(messages) _XmConst char *_XmMsgResConvert_0012 = "Cannot convert compound text to XmString"; externaldef(messages) _XmConst char *_XmMsgResConvert_0013 = "Cannot convert XmString to compound text"; /* Needed for message catalog BC. Do not remove */ /***+MSG_ResConvert_0014 FetchUnitType called without a widget to reference.*/ /***+$ please do not translate FetchUnitType.*/ /***+$ MSG_ResConvert_0014 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ResConvert_0015 FetchDisplayArg called without a widget to reference.*/ /***+$ please do not translate FetchDisplayArg.*/ /***+$ MSG_ResConvert_0015 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ResConvert_0016 FetchWidgetArg called without a widget to reference.*/ /***+$ please do not translate FetchWidgetArg.*/ /***+$ MSG_ResConvert_0016 message is obsolete - DO NOT localize this message.*/ /**************** Screen.c ****************/ externaldef(messages) _XmConst char *_XmMsgScreen_0000 = "Icon screen mismatch"; externaldef(messages) _XmConst char *_XmMsgScreen_0001 = "Cannot get XmScreen because XmDisplay was not found."; /*=========================================================================== * New for CDE *===========================================================================*/ /**************** ColObj.c ****************/ /* This is really for ColorObj.c, but CDE 1.0 established the message */ /* set name. We use their set name for backward compatibility. */ externaldef(messages) _XmConst char *_XmMsgColObj_0001 = "Could not allocate memory for color object data."; externaldef(messages) _XmConst char *_XmMsgColObj_0002 = "Bad screen number from color server selection."; /***+ */ /***+$set MS_IG*/ /***+ */ /***+MSG_IG_1 Incorrect alignment.*/ /***+$ MSG_IG_1 message is obsolete - DO NOT localize this message.*/ /***+MSG_IG_2 Incorrect behavior.*/ /***+$ MSG_IG_2 message is obsolete - DO NOT localize this message.*/ /***+MSG_IG_3 Incorrect fill mode.*/ /***+$ MSG_IG_3 message is obsolete - DO NOT localize this message.*/ /***+MSG_IG_4 Incorrect string or pixmap position.*/ /***+$ MSG_IG_4 message is obsolete - DO NOT localize this message.*/ /***+MSG_IG_5 Incorrect margin width or height.*/ /***+$ MSG_IG_5 message is obsolete - DO NOT localize this message.*/ /***+MSG_IG_6 Incorrect shadow type.*/ /***+$ MSG_IG_6 message is obsolete - DO NOT localize this message.*/ /*=========================================================================== * New for 2.0 *===========================================================================*/ /**************** ComboBox.c ****************/ externaldef(messages) _XmConst char *_XmMsgComboBox_0000 = "Applications cannot add children to XmComboBox widgets."; externaldef(messages) _XmConst char *_XmMsgComboBox_0001 = "XmNcomboBoxType resource cannot be changed by XtSetValues."; /* Needed for message catalog BC. Do not remove */ /***+MSG_ComboBox_0002 XmFontListGetNextFont failed.*/ /***+$ MSG_ComboBox_0002 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_ComboBox_0003 XmFontListInitFontContext failed.*/ /***+$ MSG_ComboBox_0003 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgComboBox_0004 = "Internal widget has been destroyed. Behavior is undefined."; externaldef(messages) _XmConst char *_XmMsgComboBox_0005 = "Internal widget has been unmanaged. Behavior is undefined."; externaldef(messages) _XmConst char *_XmMsgComboBox_0006 = "XmQUICK_NAVIGATE is only valid for ComboBoxes of XmNcomboBoxType XmDROP_DOWN_LIST"; externaldef(messages) _XmConst char *_XmMsgComboBox_0007 = "Action invoked with the wrong number of parameters."; externaldef(messages) _XmConst char *_XmMsgComboBox_0008 = "Action routine called from a widget that is not a descendant of ComboBox"; externaldef(messages) _XmConst char *_XmMsgComboBox_0009 = "XmComboBoxSelectItem called with an item not present in the ComboBox."; externaldef(messages) _XmConst char *_XmMsgComboBox_0010 = "XmComboBoxSetItem called with an item not present in the ComboBox."; externaldef(messages) _XmConst char *_XmMsgComboBox_0011 = "XmComboBoxDeletePos called with an invalid position."; externaldef(messages) _XmConst char *_XmMsgComboBox_0012 = "XmComboBox utility routine called with an invalid widget."; externaldef(messages) _XmConst char *_XmMsgComboBox_0013 = "Applications may not set the automatic XmComboBox widget children."; externaldef(messages) _XmConst char *_XmMsgComboBox_0014 = "XmComboBox positionMode cannot be changed after creation."; /***+$ please do not translate positionMode. */ /**************** Container.c ****************/ externaldef(messages) _XmConst char *_XmMsgContainer_0000 = "Action invoked with the wrong number of parameters."; externaldef(messages) _XmConst char *_XmMsgContainer_0001 = "XmNdetailColumnHeading and XmNdetailColumnHeadingCount do not match!"; /**************** CSText.c ***************/ /***+MSG_CSText_0000 Invalid margin height; must be greater than or equal to 0.*/ /***+$ MSG_CSText_0000 message is obsolete - DO NOT localize this message.*/ /***+MSG_CSText_0001 Invalid margin width; must be greater than or equal to 0.*/ /***+$ MSG_CSText_0001 message is obsolete - DO NOT localize this message.*/ /***+MSG_CSText_0002 Invalid edit mode.*/ /***+$ MSG_CSText_0002 message is obsolete - DO NOT localize this message.*/ /***+MSG_CSText_0003 XmNtraversalOn must always be true.*/ /***+$ MSG_CSText_0003 message is obsolete - DO NOT localize this message.*/ /***+MSG_CSText_0004 Cannot change XmNscrollHorizontal after initialization.*/ /***+$ MSG_CSText_0004 message is obsolete - DO NOT localize this message.*/ /***+MSG_CSText_0005 Cannot change XmNscrollVertical after initialization.*/ /***+$ MSG_CSText_0005 message is obsolete - DO NOT localize this message.*/ /***+MSG_CSText_0006 Cannot change XmNscrollTopSide after initialization.*/ /***+$ MSG_CSText_0006 message is obsolete - DO NOT localize this message.*/ /***+MSG_CSText_0007 Cannot change XmNscrollLeftSide after initialization.*/ /***+$ MSG_CSText_0007 message is obsolete - DO NOT localize this message.*/ /**************** GrabShell.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_GrabS_0000 XmPopup requires a subclass of shellWidgetClass.*/ /***+$ please do not translate shellWidgetClass.*/ /***+$ MSG_GrabS_0000 message is obsolete - DO NOT localize this message.*/ /**************** Manager.c ****************/ externaldef(messages) _XmConst char *_XmMsgManager_0000 = "Widget class %s has invalid CompositeClassExtension record."; /***+$ please do not translate CompositeClassExtension.*/ externaldef(messages) _XmConst char *_XmMsgManager_0001 = "Cannot change XmNlayoutDirection or XmNstringDirection after initialization."; /**************** NavigMap.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_NavigMap_0000 _XmNavigate called with invalid direction.*/ /***+$ MSG_NavigMap_0000 message is obsolete - DO NOT localize this message.*/ /**************** Notebook.c ****************/ externaldef(messages) _XmConst char *_XmMsgNotebook_0000 = "XmNnotebookChildType resource cannot be set by XtSetValues."; /**************** PixConv.c ****************/ externaldef(messages) _XmConst char *_XmMsgPixConv_0000 = "Wrong number of parameters for CvtStringToPixmap"; /***+$ please do not translate CvtStringToPixmap.*/ /**************** Primitive.c ****************/ externaldef(messages) _XmConst char *_XmMsgPrimitive_0000 = "Cannot change XmNlayoutDirection after initialization."; /**************** ScrollFrameT.c ****************/ externaldef(messages) _XmConst char *_XmMsgScrollFrameT_0000 = "AssocNavigator requires a navigator trait"; /***+$ please do not translate AssocNavigator.*/ externaldef(messages) _XmConst char *_XmMsgScrollFrameT_0001 = "DeAssocNavigator requires a navigator trait"; /***+$ please do not translate DeAssocNavigator.*/ /**************** SpinB.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_SpinB_0001 Invalid value for XmNarrowLayout.*/ /***+$ MSG_SpinB_0001 message is obsolete - DO NOT localize this message.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_SpinB_0002 XmNminimumValue equals XmNmaximumValue.*/ /***+$ MSG_SpinB_0002 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgSpinB_0003 = "No items supplied for XmSTRING child."; externaldef(messages) _XmConst char *_XmMsgSpinB_0004 = "XmNincrementValue cannot be 0. A value of 1 will be used."; externaldef(messages) _XmConst char *_XmMsgSpinB_0005 = "Spin direction specified by XmNincrementValue\n\ has been reversed to match the specified\n\ XmNminimumValue and XmNmaximumValue."; externaldef(messages) _XmConst char *_XmMsgSpinB_0006 = "XmNposition out of range; minimum XmNposition used."; externaldef(messages) _XmConst char *_XmMsgSpinB_0007 = "XmNposition out of range; maximum XmNposition used."; externaldef(messages) _XmConst char *_XmMsgSpinB_0008 = "Invalid value for XmNpositionType. Using default value."; /* Needed for message catalog BC. Do not remove */ /***+MSG_SpinB_0009 XmNpositionType resource can only be set at creation time.*/ /***+$ MSG_SpinB_0009 message is obsolete - DO NOT localize this message.*/ /**************** Transfer.c ****************/ externaldef(messages) _XmConst char *_XmMsgTransfer_0000 = "Calling SelectionCallbackWrapper when transfers should be finished"; /***+$ please do not translate SelectionCallbackWrapper.*/ /* Needed for message catalog BC. Do not remove */ /***+MSG_Transfer_0001 Cannot lock the clipboard; aborting transfer.*/ /***+$ MSG_Transfer_0001 message is obsolete - DO NOT localize this message.*/ externaldef(messages) _XmConst char *_XmMsgTransfer_0002 = "The format and type of the callback supplied data does not match the data being merged."; externaldef(messages) _XmConst char *_XmMsgTransfer_0003 = "The status in the XmConvertCallbackStruct is not XmCONVERT_MERGE."; externaldef(messages) _XmConst char *_XmMsgTransfer_0004 = "CONVERT_MORE is not yet supported."; /***+$ please do not translate CONVERT_MORE.*/ externaldef(messages) _XmConst char *_XmMsgTransfer_0005 = "Bad atom value found."; externaldef(messages) _XmConst char *_XmMsgTransfer_0006 = "Warning: Attempt to start a MULTIPLE transfer when one is in progress."; /***+$ please do not translate MULTIPLE.*/ externaldef(messages) _XmConst char *_XmMsgTransfer_0007 = "Warning: Attempt to send a MULTIPLE transfer when one is not in progress."; /***+$ please do not translate MULTIPLE.*/ /**************** VaSimple.c ****************/ externaldef(messages) _XmConst char *_XmMsgVaSimple_0000 = "XtVaTypedArg conversion needs non-null widget handle."; externaldef(messages) _XmConst char *_XmMsgVaSimple_0001 = "Unable to find type of resource for conversion."; externaldef(messages) _XmConst char *_XmMsgVaSimple_0002 = "Type conversion failed."; /*************** Xm.c *******************/ externaldef(messages) _XmConst char *_XmMsgMotif_0000 = "\nName: %s\nClass: %s\n"; externaldef(messages) _XmConst char *_XmMsgMotif_0001 = "Action invoked with the wrong number of parameters."; /*************** XmRenderT.c ************/ externaldef(messages) _XmConst char *_XmMsgXmRenderT_0000 = "XmNtag cannot be NULL. Setting to empty string."; externaldef(messages) _XmConst char *_XmMsgXmRenderT_0001 = "Display is NULL. Cannot load font."; externaldef(messages) _XmConst char *_XmMsgXmRenderT_0002 = "XmNfontType invalid. Cannot load font."; externaldef(messages) _XmConst char *_XmMsgXmRenderT_0003 = "Conversion failed. Cannot load font."; externaldef(messages) _XmConst char *_XmMsgXmRenderT_0004 = "XmNfontType set to XmAS_IS. Cannot load font."; externaldef(messages) _XmConst char *_XmMsgXmRenderT_0005 = "XmNloadModel is XmLOAD_IMMEDIATE but XmNfont and XmNfontName not specified.\n\ Cannot load font."; /**************** XmSelect.c ****************/ /* Needed for message catalog BC. Do not remove */ /***+MSG_XmSelect_0000 Internal error: no selection property context for display.*/ /***+$ MSG_XmSelect_0000 message is obsolete - DO NOT localize this message.*/ /***+MSG_XmSelect_0001 Selection owner returned type INCR property with format != 32.*/ /***+$ please do not translate INCR.*/ /***+$ MSG_XmSelect_0001 message is obsolete - DO NOT localize this message.*/ /***+MSG_XmSelect_0002 XtGetSelectionRequest called for widget \"%s\" outside of ConvertSelection proc.*/ /***+$ please do not translate ConvertSelection.*/ /***+$ MSG_XmSelect_0002 message is obsolete - DO NOT localize this message.*/ /*************** XmString.c ************/ externaldef(messages) _XmConst char *_XmMsgXmString_0000 = "No font found."; /*************** XmTabList.c ************/ externaldef(messages) _XmConst char *_XmMsgXmTabList_0000 = "Tab value cannot be negative."; /**************** SSpinB.c ****************/ externaldef(messages) _XmConst char *_XmMsgSSpinB_0001 = "XmNtextField resource cannot be set."; externaldef(messages) _XmConst char *_XmMsgSSpinB_0002 = "XmNpositionType resource can only be set at creation time."; externaldef(messages) _XmConst char *_XmMsgSSpinB_0003 = "Item does not exist. XmNposition is unchanged."; /**************** DataF.c ****************/ externaldef(messages) _XmConst char *_XmMsgDataF_0000 = "Invalid cursor position, must be >= 0."; externaldef(messages) _XmConst char *_XmMsgDataF_0001 = "Invalid columns, must be > 0."; externaldef(messages) _XmConst char *_XmMsgDataF_0002 = "XmFontListInitFontContext Failed."; externaldef(messages) _XmConst char *_XmMsgDataF_0003 = "XmFontListGetNextFont Failed."; externaldef(messages) _XmConst char *_XmMsgDataF_0004 = "Character '%c', not supported in font. Discarded."; externaldef(messages) _XmConst char *_XmMsgDataF_0005 = "Traversal_on must always be true."; externaldef(messages) _XmConst char *_XmMsgDataF_0006 = "Invalid columns, must be >= 0."; externaldef(messages) _XmConst char *_XmMsgDataFWcs_0000 = "Character '%s', not supported in font. Discarded."; externaldef(messages) _XmConst char *_XmMsgDataFWcs_0001 = "Cannot use multibyte locale without a fontset. Value discarded."; /* * This one is not part of the message catalog */ externaldef(messages) _XmConst char *XME_WARNING="XmeWarning"; #ifndef NO_MESSAGE_CATALOG externaldef(messages) nl_catd Xm_catd = NULL; #endif motif-2.3.8/lib/Xm/Xpmparse.c0000644000175000017500000005164413066310437012675 00000000000000/* $XConsortium: Xpmparse.c /main/6 1996/09/20 08:15:49 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * parse.c: * * * * XPM library * * Parse an XPM file or array and store the found informations * * in the given XpmImage structure. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* * The code related to FOR_MSW has been added by * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" #include #include #ifdef HAS_STRLCAT # define STRLCAT(dst, src, dstsize) do { \ if (strlcat(dst, src, dstsize) >= (dstsize)) \ return (XpmFileInvalid); } while(0) # define STRLCPY(dst, src, dstsize) do { \ if (strlcpy(dst, src, dstsize) >= (dstsize)) \ return (XpmFileInvalid); } while(0) #else # define STRLCAT(dst, src, dstsize) do { \ if ((strlen(dst) + strlen(src)) < (dstsize)) \ strcat(dst, src); \ else return (XpmFileInvalid); } while(0) # define STRLCPY(dst, src, dstsize) do { \ if (strlen(src) < (dstsize)) \ strcpy(dst, src); \ else return (XpmFileInvalid); } while(0) #endif LFUNC(ParsePixels, int, (xpmData *data, unsigned int width, unsigned int height, unsigned int ncolors, unsigned int cpp, XpmColor *colorTable, xpmHashTable *hashtable, unsigned int **pixels)); char *xpmColorKeys[] = { "s", /* key #1: symbol */ "m", /* key #2: mono visual */ "g4", /* key #3: 4 grays visual */ "g", /* key #4: gray visual */ "c", /* key #5: color visual */ }; /* function call in case of error, frees only locally allocated variables */ #undef RETURN #define RETURN(status) \ do { \ if (colorTable) xpmFreeColorTable(colorTable, ncolors); \ if (pixelindex) XpmFree(pixelindex); \ if (hints_cmt) XpmFree(hints_cmt); \ if (colors_cmt) XpmFree(colors_cmt); \ if (pixels_cmt) XpmFree(pixels_cmt); \ return(status); \ } while(0) /* * This function parses an Xpm file or data and store the found informations * in an an XpmImage structure which is returned. */ int xpmParseData(data, image, info) xpmData *data; XpmImage *image; XpmInfo *info; { /* variables to return */ unsigned int width, height, ncolors, cpp; unsigned int x_hotspot, y_hotspot, hotspot = 0, extensions = 0; XpmColor *colorTable = NULL; unsigned int *pixelindex = NULL; char *hints_cmt = NULL; char *colors_cmt = NULL; char *pixels_cmt = NULL; unsigned int cmts; int ErrorStatus; xpmHashTable hashtable; cmts = info && (info->valuemask & XpmReturnComments); /* * parse the header */ ErrorStatus = xpmParseHeader(data); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* * read values */ ErrorStatus = xpmParseValues(data, &width, &height, &ncolors, &cpp, &x_hotspot, &y_hotspot, &hotspot, &extensions); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* * store the hints comment line */ if (cmts) xpmGetCmt(data, &hints_cmt); /* * init the hastable */ if (USE_HASHTABLE) { ErrorStatus = xpmHashTableInit(&hashtable); if (ErrorStatus != XpmSuccess) return (ErrorStatus); } /* * read colors */ ErrorStatus = xpmParseColors(data, ncolors, cpp, &colorTable, &hashtable); if (ErrorStatus != XpmSuccess) { if (USE_HASHTABLE) xpmHashTableFree(&hashtable); RETURN(ErrorStatus); } /* * store the colors comment line */ if (cmts) xpmGetCmt(data, &colors_cmt); /* * read pixels and index them on color number */ ErrorStatus = ParsePixels(data, width, height, ncolors, cpp, colorTable, &hashtable, &pixelindex); /* * free the hastable */ if (USE_HASHTABLE) xpmHashTableFree(&hashtable); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); /* * store the pixels comment line */ if (cmts) xpmGetCmt(data, &pixels_cmt); /* * parse extensions */ if (info && (info->valuemask & XpmReturnExtensions)) { if (extensions) { ErrorStatus = xpmParseExtensions(data, &info->extensions, &info->nextensions); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); } else { info->extensions = NULL; info->nextensions = 0; } } /* * store found informations in the XpmImage structure */ image->width = width; image->height = height; image->cpp = cpp; image->ncolors = ncolors; image->colorTable = colorTable; image->data = pixelindex; if (info) { if (cmts) { info->hints_cmt = hints_cmt; info->colors_cmt = colors_cmt; info->pixels_cmt = pixels_cmt; } if (hotspot) { info->x_hotspot = x_hotspot; info->y_hotspot = y_hotspot; info->valuemask |= XpmHotspot; } } return (XpmSuccess); } int xpmParseValues(data, width, height, ncolors, cpp, x_hotspot, y_hotspot, hotspot, extensions) xpmData *data; unsigned int *width, *height, *ncolors, *cpp; unsigned int *x_hotspot, *y_hotspot, *hotspot; unsigned int *extensions; { unsigned int l; char buf[BUFSIZ + 1]; if (!data->format) { /* XPM 2 or 3 */ /* * read values: width, height, ncolors, chars_per_pixel */ if (!(xpmNextUI(data, width) && xpmNextUI(data, height) && xpmNextUI(data, ncolors) && xpmNextUI(data, cpp))) return (XpmFileInvalid); /* * read optional information (hotspot and/or XPMEXT) if any */ l = xpmNextWord(data, buf, BUFSIZ); if (l) { *extensions = (l == 6 && !strncmp("XPMEXT", buf, 6)); if (*extensions) *hotspot = (xpmNextUI(data, x_hotspot) && xpmNextUI(data, y_hotspot)); else { *hotspot = (xpmatoui(buf, l, x_hotspot) && xpmNextUI(data, y_hotspot)); l = xpmNextWord(data, buf, BUFSIZ); *extensions = (l == 6 && !strncmp("XPMEXT", buf, 6)); } } } else { /* * XPM 1 file read values: width, height, ncolors, chars_per_pixel */ int i; char *ptr; Bool got_one, saw_width = False, saw_height = False; Bool saw_ncolors = False, saw_chars_per_pixel = False; for (i = 0; i < 4; i++) { l = xpmNextWord(data, buf, BUFSIZ); if (l != 7 || strncmp("#define", buf, 7)) return (XpmFileInvalid); l = xpmNextWord(data, buf, BUFSIZ); if (!l) return (XpmFileInvalid); buf[l] = '\0'; ptr = buf; got_one = False; while (!got_one) { ptr = index(ptr, '_'); if (!ptr) return (XpmFileInvalid); switch (l - (ptr - buf)) { case 6: if (saw_width || strncmp("_width", ptr, 6) || !xpmNextUI(data, width)) return (XpmFileInvalid); else saw_width = True; got_one = True; break; case 7: if (saw_height || strncmp("_height", ptr, 7) || !xpmNextUI(data, height)) return (XpmFileInvalid); else saw_height = True; got_one = True; break; case 8: if (saw_ncolors || strncmp("_ncolors", ptr, 8) || !xpmNextUI(data, ncolors)) return (XpmFileInvalid); else saw_ncolors = True; got_one = True; break; case 16: if (saw_chars_per_pixel || strncmp("_chars_per_pixel", ptr, 16) || !xpmNextUI(data, cpp)) return (XpmFileInvalid); else saw_chars_per_pixel = True; got_one = True; break; default: ptr++; } } /* skip the end of line */ xpmNextString(data); } if (!saw_width || !saw_height || !saw_ncolors || !saw_chars_per_pixel) return (XpmFileInvalid); *hotspot = 0; *extensions = 0; } return (XpmSuccess); } int xpmParseColors(data, ncolors, cpp, colorTablePtr, hashtable) xpmData *data; unsigned int ncolors; unsigned int cpp; XpmColor **colorTablePtr; xpmHashTable *hashtable; { unsigned int key = 0, l, a, b, len; unsigned int curkey; /* current color key */ unsigned int lastwaskey; /* key read */ char buf[BUFSIZ + 1]; char curbuf[BUFSIZ]; /* current buffer */ char **sptr, *s; XpmColor *color; XpmColor *colorTable; char **defaults; int ErrorStatus; if (ncolors >= UINT_MAX / sizeof(XpmColor)) return (XpmNoMemory); colorTable = (XpmColor *) XpmCalloc(ncolors, sizeof(XpmColor)); if (!colorTable) return (XpmNoMemory); if (!data->format) { /* XPM 2 or 3 */ for (a = 0, color = colorTable; a < ncolors; a++, color++) { xpmNextString(data); /* skip the line */ /* * read pixel value */ if (cpp >= UINT_MAX - 1) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } color->string = (char *) XpmMalloc(cpp + 1); if (!color->string) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } for (b = 0, s = color->string; b < cpp; b++, s++) *s = xpmGetC(data); *s = '\0'; /* * store the string in the hashtable with its color index number */ if (USE_HASHTABLE) { ErrorStatus = xpmHashIntern(hashtable, color->string, HashAtomData(a)); if (ErrorStatus != XpmSuccess) { xpmFreeColorTable(colorTable, ncolors); return (ErrorStatus); } } /* * read color keys and values */ defaults = (char **) color; curkey = 0; lastwaskey = 0; *curbuf = '\0'; /* init curbuf */ while ((l = xpmNextWord(data, buf, BUFSIZ))) { if (!lastwaskey) { for (key = 0, sptr = xpmColorKeys; key < NKEYS; key++, sptr++) if ((strlen(*sptr) == l) && (!strncmp(*sptr, buf, l))) break; } if (!lastwaskey && key < NKEYS) { /* open new key */ if (curkey) { /* flush string */ len = strlen(curbuf) + 1; s = (char *) XpmMalloc(len); if (!s) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } defaults[curkey] = s; memcpy(s, curbuf, len); } curkey = key + 1; /* set new key */ *curbuf = '\0'; /* reset curbuf */ lastwaskey = 1; } else { if (!curkey) { /* key without value */ xpmFreeColorTable(colorTable, ncolors); return (XpmFileInvalid); } if (!lastwaskey) STRLCAT(curbuf, " ", sizeof(curbuf));/* append space */ buf[l] = '\0'; STRLCAT(curbuf, buf, sizeof(curbuf)); /* append buf */ lastwaskey = 0; } } if (!curkey) { /* key without value */ xpmFreeColorTable(colorTable, ncolors); return (XpmFileInvalid); } len = strlen(curbuf) + 1; /* integer overflow just theoretically possible */ s = defaults[curkey] = (char *) XpmMalloc(len); if (!s) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } memcpy(s, curbuf, len); } } else { /* XPM 1 */ /* get to the beginning of the first string */ data->Bos = '"'; data->Eos = '\0'; xpmNextString(data); data->Eos = '"'; for (a = 0, color = colorTable; a < ncolors; a++, color++) { /* * read pixel value */ if (cpp >= UINT_MAX - 1) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } color->string = (char *) XpmMalloc(cpp + 1); if (!color->string) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } for (b = 0, s = color->string; b < cpp; b++, s++) *s = xpmGetC(data); *s = '\0'; /* * store the string in the hashtable with its color index number */ if (USE_HASHTABLE) { ErrorStatus = xpmHashIntern(hashtable, color->string, HashAtomData(a)); if (ErrorStatus != XpmSuccess) { xpmFreeColorTable(colorTable, ncolors); return (ErrorStatus); } } /* * read color values */ xpmNextString(data); /* get to the next string */ *curbuf = '\0'; /* init curbuf */ while ((l = xpmNextWord(data, buf, BUFSIZ))) { if (*curbuf != '\0') STRLCAT(curbuf, " ", sizeof(curbuf));/* append space */ buf[l] = '\0'; STRLCAT(curbuf, buf, sizeof(curbuf)); /* append buf */ } len = strlen(curbuf) + 1; s = (char *) XpmMalloc(len); if (!s) { xpmFreeColorTable(colorTable, ncolors); return (XpmNoMemory); } memcpy(s, curbuf, len); color->c_color = s; *curbuf = '\0'; /* reset curbuf */ if (a < ncolors - 1) /* can we trust ncolors -> leave data's bounds */ xpmNextString(data); /* get to the next string */ } } *colorTablePtr = colorTable; return (XpmSuccess); } static int ParsePixels(data, width, height, ncolors, cpp, colorTable, hashtable, pixels) xpmData *data; unsigned int width; unsigned int height; unsigned int ncolors; unsigned int cpp; XpmColor *colorTable; xpmHashTable *hashtable; unsigned int **pixels; { unsigned int *iptr, *iptr2 = NULL; /* found by Egbert Eich */ unsigned int a, x, y; if ((height > 0 && width >= UINT_MAX / height) || width * height >= UINT_MAX / sizeof(unsigned int)) return XpmNoMemory; #ifndef FOR_MSW iptr2 = (unsigned int *) XpmMalloc(sizeof(unsigned int) * width * height); #else /* * special treatment to trick DOS malloc(size_t) where size_t is 16 bit!! * XpmMalloc is defined to longMalloc(long) and checks the 16 bit boundary */ iptr2 = (unsigned int *) XpmMalloc((long) sizeof(unsigned int) * (long) width * (long) height); #endif if (!iptr2) return (XpmNoMemory); iptr = iptr2; switch (cpp) { case (1): /* Optimize for single character * colors */ { unsigned short colidx[256]; if (ncolors > 256) { XpmFree(iptr2); /* found by Egbert Eich */ return (XpmFileInvalid); } bzero((char *)colidx, 256 * sizeof(short)); for (a = 0; a < ncolors; a++) colidx[(unsigned char)colorTable[a].string[0]] = a + 1; for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { int c = xpmGetC(data); if (c > 0 && c < 256 && colidx[c] != 0) *iptr = colidx[c] - 1; else { XpmFree(iptr2); return (XpmFileInvalid); } } } } break; case (2): /* Optimize for double character * colors */ { /* free all allocated pointers at all exits */ #define FREE_CIDX \ do \ { \ int f; for (f = 0; f < 256; f++) \ if (cidx[f]) XpmFree(cidx[f]); \ } while(0) /* array of pointers malloced by need */ unsigned short *cidx[256]; unsigned int char1; bzero((char *)cidx, 256 * sizeof(unsigned short *)); /* init */ for (a = 0; a < ncolors; a++) { char1 = (unsigned char) colorTable[a].string[0]; if (cidx[char1] == NULL) { /* get new memory */ cidx[char1] = (unsigned short *) XpmCalloc(256, sizeof(unsigned short)); if (cidx[char1] == NULL) { /* new block failed */ FREE_CIDX; XpmFree(iptr2); return (XpmNoMemory); } } cidx[char1][(unsigned char)colorTable[a].string[1]] = a + 1; } for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { int cc1 = xpmGetC(data); if (cc1 > 0 && cc1 < 256) { int cc2 = xpmGetC(data); if (cc2 > 0 && cc2 < 256 && cidx[cc1][cc2] != 0) *iptr = cidx[cc1][cc2] - 1; else { FREE_CIDX; XpmFree(iptr2); return (XpmFileInvalid); } } else { FREE_CIDX; XpmFree(iptr2); return (XpmFileInvalid); } } } FREE_CIDX; } break; default: /* Non-optimized case of long color * names */ { char *s; char buf[BUFSIZ]; if (cpp >= sizeof(buf)) { XpmFree(iptr2); /* found by Egbert Eich */ return (XpmFileInvalid); } buf[cpp] = '\0'; if (USE_HASHTABLE) { xpmHashAtom *slot; for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { for (a = 0, s = buf; a < cpp; a++, s++) *s = xpmGetC(data); /* int assigned to char, not a problem here */ slot = xpmHashSlot(hashtable, buf); if (!*slot) { /* no color matches */ XpmFree(iptr2); return (XpmFileInvalid); } *iptr = HashColorIndex(slot); } } } else { for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { for (a = 0, s = buf; a < cpp; a++, s++) *s = xpmGetC(data); /* int assigned to char, not a problem here */ for (a = 0; a < ncolors; a++) if (!strcmp(colorTable[a].string, buf)) break; if (a == ncolors) { /* no color matches */ XpmFree(iptr2); return (XpmFileInvalid); } *iptr = a; } } } } break; } *pixels = iptr2; return (XpmSuccess); } int xpmParseExtensions(data, extensions, nextensions) xpmData *data; XpmExtension **extensions; unsigned int *nextensions; { XpmExtension *exts = NULL, *ext; unsigned int num = 0; unsigned int nlines, a, l, notstart, notend = 0; int status; char *string, *s, *s2, **sp; xpmNextString(data); exts = (XpmExtension *) XpmMalloc(sizeof(XpmExtension)); /* get the whole string */ status = xpmGetString(data, &string, &l); if (status != XpmSuccess) { XpmFree(exts); return (status); } /* look for the key word XPMEXT, skip lines before this */ while ((notstart = strncmp("XPMEXT", string, 6)) && (notend = strncmp("XPMENDEXT", string, 9))) { XpmFree(string); xpmNextString(data); status = xpmGetString(data, &string, &l); if (status != XpmSuccess) { XpmFree(exts); return (status); } } if (!notstart) notend = strncmp("XPMENDEXT", string, 9); while (!notstart && notend) { /* there starts an extension */ ext = (XpmExtension *) XpmRealloc(exts, (num + 1) * sizeof(XpmExtension)); /* can the loop be forced to iterate often enough to make "(num + 1) * sizeof(XpmExtension)" wrapping? */ if (!ext) { XpmFree(string); XpmFreeExtensions(exts, num); return (XpmNoMemory); } exts = ext; ext += num; /* skip whitespace and store its name */ s2 = s = string + 6; while (isspace(*s2)) s2++; a = s2 - s; ext->name = (char *) XpmMalloc(l - a - 6); if (!ext->name) { XpmFree(string); ext->lines = NULL; ext->nlines = 0; XpmFreeExtensions(exts, num + 1); return (XpmNoMemory); } strncpy(ext->name, s + a, l - a - 6); XpmFree(string); /* now store the related lines */ xpmNextString(data); status = xpmGetString(data, &string, &l); if (status != XpmSuccess) { ext->lines = NULL; ext->nlines = 0; XpmFreeExtensions(exts, num + 1); return (status); } ext->lines = (char **) XpmMalloc(sizeof(char *)); nlines = 0; while ((notstart = strncmp("XPMEXT", string, 6)) && (notend = strncmp("XPMENDEXT", string, 9))) { sp = (char **) XpmRealloc(ext->lines, (nlines + 1) * sizeof(char *)); /* can we iterate enough for a wrapping? */ if (!sp) { XpmFree(string); ext->nlines = nlines; XpmFreeExtensions(exts, num + 1); return (XpmNoMemory); } ext->lines = sp; ext->lines[nlines] = string; nlines++; xpmNextString(data); status = xpmGetString(data, &string, &l); if (status != XpmSuccess) { ext->nlines = nlines; XpmFreeExtensions(exts, num + 1); return (status); } } if (!nlines) { XpmFree(ext->lines); ext->lines = NULL; } ext->nlines = nlines; num++; } if (!num) { XpmFree(string); XpmFree(exts); exts = NULL; } else if (!notend) XpmFree(string); *nextensions = num; *extensions = exts; return (XpmSuccess); } motif-2.3.8/lib/Xm/Form.c0000644000175000017500000026755513145162623012013 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Form.c /main/19 1998/03/25 12:24:56 csn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #ifndef X_NOT_STDC_ENV #include /* for abs, float operation... */ #endif #include #include #include #include #include "XmI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "GeoUtilsI.h" #include "GMUtilsI.h" #define FIX_1299 #define FIX_1612 #define MESSAGE1 _XmMMsgForm_0000 #define MESSAGE5 _XmMMsgForm_0002 #define MESSAGE7 _XmMMsgForm_0003 /* Useful macros */ #define Value(a) (really ? (a)->value : (a)->tempValue) #define AssignValue(a, v) (really ? (a->value = (int) (v))\ : (a->tempValue = (int) (v))) #define GetFormConstraint(w) \ (&((XmFormConstraintPtr) (w)->core.constraints)->form) #define NE(x) (oldc->x != newc->x) #define ANY(x) (NE(att[LEFT].x) || NE(att[RIGHT].x) || \ NE(att[TOP].x) || NE(att[BOTTOM].x)) #define SIBLINGS(w,s) (((w != NULL) && (s != NULL)) &&\ (XtParent(w) == XtParent(s))) #ifdef FIX_1299 #define ATTACHED_WIDGET(cons, j) \ (cons->att[j].w) #define IS_ATTACHED_WIDGET(cons, j) \ ((cons->att[j].type == XmATTACH_WIDGET || cons->att[j].type == XmATTACH_OPPOSITE_WIDGET) \ && cons->att[j].w != (Widget) NULL) #endif /* FIX_1299 */ /* convenient magic numbers */ #define MAX_LOOP 10000 #define LEFT _XmFORM_LEFT #define RIGHT _XmFORM_RIGHT #define TOP _XmFORM_TOP #define BOTTOM _XmFORM_BOTTOM #define FIRST_ATTACHMENT LEFT #define LAST_ATTACHMENT BOTTOM /******** Static Function Declarations ********/ static void FromTopOffset( Widget w, int offset, XtArgVal *value) ; static void FromBottomOffset( Widget w, int offset, XtArgVal *value) ; static void FromLeftOffset( Widget w, int offset, XtArgVal *value) ; static void FromRightOffset( Widget w, int offset, XtArgVal *value) ; static void MarginWidthOut( Widget wid, int offset, XtArgVal *value) ; static void MarginHeightOut( Widget wid, int offset, XtArgVal *value) ; static void ClassPartInitialize( WidgetClass wc) ; static Boolean SyncEdges( XmFormWidget fw, Widget last_child, Dimension *form_width, Dimension *form_height, Widget instigator, XtWidgetGeometry *geometry) ; static Boolean CalcFormSizeWithChange( XmFormWidget fw, Dimension *w, Dimension *h, Widget c, XtWidgetGeometry *g) ; static void CalcFormSize( XmFormWidget fw, Dimension *w, Dimension *h) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed) ; static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *req, XtWidgetGeometry *ret) ; static void Resize( Widget wid) ; static void Redisplay( Widget fw, XEvent *event, Region region) ; #ifdef FIX_1299 static void UpdateAttachments( XmFormWidget fw, Widget wid, Widget instigator, XtWidgetGeometry* inst_geometry); static void PlaceChild( XmFormWidget fw, Widget child, Widget instigator, XtWidgetGeometry* inst_geometry); #endif /* FIX_1299 */ static void PlaceChildren( XmFormWidget fw, Widget instigator, XtWidgetGeometry *inst_geometry) ; static void ChangeManaged( Widget wid) ; static void GetSize( XmFormWidget fw, XtWidgetGeometry *g, Widget w, XtWidgetGeometry *desired) ; static void ChangeIfNeeded( XmFormWidget fw, Widget w, XtWidgetGeometry *desired) ; static void DeleteChild( Widget child) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void SetValuesAlmost( Widget cw, Widget nw, XtWidgetGeometry *req, XtWidgetGeometry *rep) ; static Boolean ConstraintSetValues( register Widget old, register Widget ref, register Widget new_w, ArgList args, Cardinal *num_args) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void ConstraintInitialize( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void CheckConstraints( Widget w) ; static void SortChildren( register XmFormWidget fw) ; static void CalcEdgeValues( Widget w, #if NeedWidePrototypes int really, #else Boolean really, #endif /* NeedWidePrototypes */ Widget instigator, XtWidgetGeometry *inst_geometry, Dimension *form_width, Dimension *form_height) ; static float CheckBottomBase( Widget sibling, #if NeedWidePrototypes int opposite) ; #else Boolean opposite) ; #endif /* NeedWidePrototypes */ static float CheckRightBase( Widget sibling, #if NeedWidePrototypes int opposite) ; #else Boolean opposite) ; #endif /* NeedWidePrototypes */ static float CheckLeftBase( Widget sibling, #if NeedWidePrototypes int opposite) ; #else Boolean opposite) ; #endif /* NeedWidePrototypes */ static void CalcEdgeValue( XmFormWidget fw, Widget w, #if NeedWidePrototypes int size, int border_width, #else Dimension size, Dimension border_width, #endif /* NeedWidePrototypes */ int which, #if NeedWidePrototypes int really, #else Boolean really, #endif /* NeedWidePrototypes */ Dimension *fwidth, Dimension *fheight) ; static void ComputeAttachment( XmFormWidget fw, Widget w, #if NeedWidePrototypes int size, int border_width, #else Dimension size, Dimension border_width, #endif /* NeedWidePrototypes */ int which, #if NeedWidePrototypes int really, #else Boolean really, #endif /* NeedWidePrototypes */ Dimension *fwidth, Dimension *fheight) ; static int GetFormOffset( XmFormWidget fw, int which, XmFormAttachment a) ; #ifdef FIX_1612 static Boolean IsWidgetAttachedOneHorizontalSide( Widget w); static Boolean IsWidgetAttachedOneVerticalSide( Widget w); #endif /******** End Static Function Declarations ********/ static XtResource resources[] = { { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _XmFormRec, bulletin_board.margin_width), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf( struct _XmFormRec, bulletin_board.margin_height), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNhorizontalSpacing, XmCSpacing, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _XmFormRec, form.horizontal_spacing), XmRImmediate, (XtPointer) 0 }, { XmNverticalSpacing, XmCSpacing, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf( struct _XmFormRec, form.vertical_spacing), XmRImmediate, (XtPointer) 0 }, { XmNfractionBase, XmCMaxValue, XmRInt, sizeof(int), XtOffsetOf( struct _XmFormRec, form.fraction_base), XmRImmediate, (XtPointer) 100 }, { XmNrubberPositioning, XmCRubberPositioning, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmFormRec, form.rubber_positioning), XmRImmediate, (XtPointer) False }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof (Dimension), XtOffsetOf( struct _XmFormRec, bulletin_board.margin_width), MarginWidthOut, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof (Dimension), XtOffsetOf( struct _XmFormRec, bulletin_board.margin_height), MarginHeightOut, XmeToVerticalPixels }, { XmNhorizontalSpacing, sizeof (Dimension), XtOffsetOf( struct _XmFormRec, form.horizontal_spacing), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNverticalSpacing, sizeof (Dimension), XtOffsetOf( struct _XmFormRec, form.vertical_spacing), XmeFromVerticalPixels, XmeToVerticalPixels }, }; /* The constraint resource list */ static XtResource constraints[] = { { XmNtopAttachment, XmCAttachment, XmRAttachment, sizeof(unsigned char), XtOffsetOf( struct _XmFormConstraintRec, form.att[TOP].type), XmRImmediate, (XtPointer) XmATTACH_NONE }, { XmNbottomAttachment, XmCAttachment, XmRAttachment, sizeof(unsigned char), XtOffsetOf( struct _XmFormConstraintRec, form.att[BOTTOM].type), XmRImmediate, (XtPointer) XmATTACH_NONE }, { XmNleftAttachment, XmCAttachment, XmRAttachment, sizeof(unsigned char), XtOffsetOf( struct _XmFormConstraintRec, form.att[LEFT].type), XmRImmediate, (XtPointer) XmATTACH_NONE }, { XmNrightAttachment, XmCAttachment, XmRAttachment, sizeof(unsigned char), XtOffsetOf( struct _XmFormConstraintRec, form.att[RIGHT].type), XmRImmediate, (XtPointer) XmATTACH_NONE }, { XmNtopWidget, XmCWidget, XmRWidget, sizeof(Widget), XtOffsetOf( struct _XmFormConstraintRec, form.att[TOP].w), XmRImmediate, (XtPointer) NULL }, { XmNbottomWidget, XmCWidget, XmRWidget, sizeof(Widget), XtOffsetOf( struct _XmFormConstraintRec, form.att[BOTTOM].w), XmRImmediate, (XtPointer) NULL }, { XmNleftWidget, XmCWidget, XmRWidget, sizeof(Widget), XtOffsetOf( struct _XmFormConstraintRec, form.att[LEFT].w), XmRImmediate, (XtPointer) NULL }, { XmNrightWidget, XmCWidget, XmRWidget, sizeof(Widget), XtOffsetOf( struct _XmFormConstraintRec, form.att[RIGHT].w), XmRImmediate, (XtPointer) NULL }, { XmNtopPosition, XmCPosition, XmRInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[TOP].percent), XmRImmediate, (XtPointer) 0 }, { XmNbottomPosition, XmCPosition, XmRInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[BOTTOM].percent), XmRImmediate, (XtPointer) 0 }, { XmNleftPosition, XmCPosition, XmRInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[LEFT].percent), XmRImmediate, (XtPointer) 0 }, { XmNrightPosition, XmCPosition, XmRInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[RIGHT].percent), XmRImmediate, (XtPointer) 0 }, { XmNtopOffset, XmCOffset, XmRVerticalInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[TOP].offset), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNbottomOffset, XmCOffset, XmRVerticalInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[BOTTOM].offset), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNleftOffset, XmCOffset, XmRHorizontalInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[LEFT].offset), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNrightOffset, XmCOffset, XmRHorizontalInt, sizeof(int), XtOffsetOf( struct _XmFormConstraintRec, form.att[RIGHT].offset), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, { XmNresizable, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmFormConstraintRec, form.resizable), XmRImmediate, (XtPointer) True } }; /* Definition for constraint resources that need special */ /* processing in get values */ static XmSyntheticResource syn_constraint_resources[] = { { XmNtopOffset, sizeof (int), XtOffsetOf( struct _XmFormConstraintRec, form.att[TOP].offset), FromTopOffset, XmeToVerticalPixels }, { XmNbottomOffset, sizeof (int), XtOffsetOf( struct _XmFormConstraintRec, form.att[BOTTOM].offset), FromBottomOffset, XmeToVerticalPixels }, { XmNleftOffset, sizeof (int), XtOffsetOf( struct _XmFormConstraintRec, form.att[LEFT].offset), FromLeftOffset, XmeToHorizontalPixels }, { XmNrightOffset, sizeof (int), XtOffsetOf( struct _XmFormConstraintRec, form.att[RIGHT].offset), FromRightOffset, XmeToHorizontalPixels }, }; /* Static initialization of the attached dialog box widget class record. */ externaldef(xmformclassrec) XmFormClassRec xmFormClassRec = { { /* core_class fields */ (WidgetClass) &xmBulletinBoardClassRec, /* superclass */ "XmForm", /* class_name */ sizeof(XmFormRec), /* widget_size */ (XtProc)NULL, /* class_initialize */ ClassPartInitialize, /* class init part proc */ False, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_notify */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ False, /* compress_enterleave */ False, /* visible_interest */ (XtWidgetProc)NULL, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ SetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ XtInheritTranslations, /* tm_table */ QueryGeometry, /* Query Geometry proc */ (XtStringProc)NULL, /* disp accelerator */ NULL, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ constraints, /* constraint resource */ XtNumber(constraints), /* number of constraints */ sizeof(XmFormConstraintRec), /* size of constraint */ ConstraintInitialize, /* initialization */ (XtWidgetProc)NULL, /* destroy proc */ ConstraintSetValues, /* set_values proc */ NULL, /* extension */ }, { /* manager_class fields */ XtInheritTranslations, /* translations */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ syn_constraint_resources, /* syn_cont_resources */ XtNumber(syn_constraint_resources), /* num_syn_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* bulletin_board_class fields */ FALSE, /* always_install_accelerators */ (XmGeoCreateProc)NULL, /* geo_matrix_create */ XmInheritFocusMovedProc, /* focus_moved_proc */ NULL, /* extension */ }, { /* form_class fields */ (XtPointer) NULL, /* extension */ } }; externaldef(xmformwidgetclass) WidgetClass xmFormWidgetClass = (WidgetClass) &xmFormClassRec; static void FromTopOffset( Widget w, int offset, XtArgVal *value) { XmFormWidget fw = (XmFormWidget) w->core.parent; XmFormConstraint fc = GetFormConstraint(w); *value = (XtArgVal) GetFormOffset(fw, TOP, fc->att); XmeFromVerticalPixels(w, offset, value); } static void FromBottomOffset( Widget w, int offset, XtArgVal *value) { XmFormWidget fw = (XmFormWidget) w->core.parent; XmFormConstraint fc = GetFormConstraint(w); *value = (XtArgVal) GetFormOffset(fw, BOTTOM, fc->att); XmeFromVerticalPixels(w, offset, value); } static void FromLeftOffset( Widget w, int offset, XtArgVal *value) { XmFormWidget fw = (XmFormWidget) w->core.parent; XmFormConstraint fc = GetFormConstraint(w); *value = (XtArgVal) GetFormOffset(fw, LEFT, fc->att); XmeFromHorizontalPixels(w, offset, value); } static void FromRightOffset( Widget w, int offset, XtArgVal *value) { XmFormWidget fw = (XmFormWidget) w->core.parent; XmFormConstraint fc = GetFormConstraint(w); *value = (XtArgVal) GetFormOffset(fw, RIGHT, fc->att); XmeFromHorizontalPixels(w, offset, value); } static void MarginWidthOut( Widget wid, int offset, XtArgVal *value ) { XmFormWidget fw = (XmFormWidget) wid ; if (fw->bulletin_board.margin_width == XmINVALID_DIMENSION) *value = 0; else XmeFromHorizontalPixels((Widget) fw, offset, value); } static void MarginHeightOut( Widget wid, int offset, XtArgVal *value ) { XmFormWidget fw = (XmFormWidget) wid ; if (fw->bulletin_board.margin_height == XmINVALID_DIMENSION) *value = 0; else XmeFromVerticalPixels((Widget) fw, offset, value); } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing. * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmFORM_BIT); } /************************************************************************ * * CalcFormSizeWithChange * Find size of a bounding box which will include all of the * children, including the child which may change * ************************************************************************/ static Boolean SyncEdges( XmFormWidget fw, Widget last_child, Dimension *form_width, Dimension *form_height, Widget instigator, XtWidgetGeometry *geometry ) { register Widget child; register XmFormConstraint c; long int loop_count; Dimension tmp_w = *form_width, tmp_h = *form_height; Dimension sav_w, sav_h; Boolean settled = FALSE; Boolean finished = TRUE; sav_w = tmp_w; sav_h = tmp_h; loop_count = 0; while (!settled) { /* * Contradictory constraints can cause the constraint * processing to go into endless oscillation. This means that * proper exit condition for this loop is never satisfied. * But, infinite loops are a bad thing, even if is the result * of a careless user. We therefore have added a loop counter * to ensure that this loop will terminate. * * There are problems with this however. In the worst case * this procedure could need to loop fw->composite.num_children! * times. Unfortunately, numbers like 100! don't fit integer * space well; neither will current architectures complete that * many loops before the sun burns out. * * Soooo, we will wait for an arbitrarily large number of * iterations to go by before we give up. This allows us to * claim that the procedure will always complete, and the number * is large enough to accomodate all but the very large and * very pathological Form widget configurations. * * This is gross, but it's either do this or risk truly * infinite loops. */ if (loop_count++ > MAX_LOOP) break; for (child = fw->form.first_child; child != NULL; child = c->next_sibling) { if (!XtIsManaged (child)) break; c = GetFormConstraint(child); CalcEdgeValues(child, FALSE, instigator, geometry, &tmp_w, &tmp_h); if (child == last_child) break; } if ((sav_w == tmp_w) && (sav_h == tmp_h)) settled = TRUE; else { sav_w = tmp_w; sav_h = tmp_h; } } if (loop_count > MAX_LOOP) { XmeWarning( (Widget) fw, MESSAGE7); finished = FALSE; } *form_width = sav_w; *form_height = sav_h; return(finished); } static Boolean CalcFormSizeWithChange( XmFormWidget fw, Dimension *w, Dimension *h, Widget c, XtWidgetGeometry *g ) { Dimension junkh = fw->core.height; Dimension junkw = fw->core.width; Widget child; XmFormConstraint fc; int tmp; if (h == NULL) h = &junkh; if (w == NULL) w = &junkw; /* Place children, but don't do it for real--just get new size */ for(child = fw->form.first_child; child != NULL; child = fc->next_sibling) { if (!XtIsManaged (child)) break; fc = GetFormConstraint(child); CalcEdgeValues(child, False, c, g, w, h); if (!SyncEdges(fw, child, w, h, c, g)) return(False); } for(child = fw->form.first_child; child != NULL; child = fc->next_sibling) { if (!XtIsManaged (child)) break; fc = GetFormConstraint(child); tmp = fc->att[RIGHT].tempValue; if (fc->att[RIGHT].type == XmATTACH_FORM) tmp += GetFormOffset(fw, RIGHT, fc->att); if (tmp > 0) ASSIGN_MAX(*w, tmp); tmp = fc->att[BOTTOM].tempValue ; if (fc->att[BOTTOM].type == XmATTACH_FORM) tmp += GetFormOffset(fw, BOTTOM, fc->att); if (tmp > 0) ASSIGN_MAX (*h, tmp); } if (!(*w)) *w = 1; if (!(*h)) *h = 1; if (*w != XtWidth(fw) || *h != XtHeight(fw)) return True; else return False; } /************************************************************************ * * CalcFormSize * Find size of a bounding box which will include all of the children. * ************************************************************************/ static void CalcFormSize( XmFormWidget fw, Dimension *w, Dimension *h ) { Widget child; Dimension junkh = fw->core.height; Dimension junkw = fw->core.width; XmFormConstraint fc; int tmp; if (h == NULL) h = &junkh; if (w == NULL) w = &junkw; for (child = fw->form.first_child; child != NULL; child = fc->next_sibling) { if (!XtIsManaged (child)) break; fc = GetFormConstraint(child); CalcEdgeValues(child, False, NULL, NULL, w, h); if (!SyncEdges(fw, child, w, h, NULL, NULL)) break; } for(child = fw->form.first_child; child != NULL; child = fc->next_sibling) { if (!XtIsManaged (child)) break; fc = GetFormConstraint(child); tmp = fc->att[RIGHT].tempValue; if (fc->att[RIGHT].type == XmATTACH_FORM) tmp += GetFormOffset(fw, RIGHT, fc->att); if (tmp > 0) ASSIGN_MAX(*w, tmp); tmp = fc->att[BOTTOM].tempValue ; if (fc->att[BOTTOM].type == XmATTACH_FORM) tmp += GetFormOffset(fw, BOTTOM, fc->att); if (tmp > 0) ASSIGN_MAX(*h, tmp); } if (!(*w)) *w = 1; if (!(*h)) *h = 1; } /************************************************************************ * * GeometryManager * ************************************************************************/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *desired, XtWidgetGeometry *allowed ) { int size_req ; XtWidgetGeometry original; XtGeometryResult reply = XtGeometryNo; XmFormWidget fw = (XmFormWidget) XtParent(w); XmFormConstraint c = GetFormConstraint(w); /* sooo confusing... */ if (fw->form.processing_constraints) { fw->form.processing_constraints = FALSE; PlaceChildren (fw, NULL, NULL); return(XtGeometryNo); } /* * Fix for 4854 - If the widget is not resizable, do not set the * preferred_width or the preferred_height. */ if ((desired->request_mode & CWWidth) && !(desired->request_mode & XtCWQueryOnly) && c->resizable) c->preferred_width = desired->width; if ((desired->request_mode & CWHeight) && !(desired->request_mode & XtCWQueryOnly) && c->resizable) c->preferred_height = desired->height; if (desired->request_mode == (CWX | CWY)) return(XtGeometryNo); original.x = w->core.x; original.y = w->core.y; original.width = w->core.width; original.height = w->core.height; original.border_width = w->core.border_width; original.request_mode = (CWX | CWY | CWWidth | CWHeight | CWBorderWidth); size_req = desired->request_mode & (CWX | CWY | CWWidth | CWHeight | CWBorderWidth); if (size_req && c->resizable) { XtWidgetGeometry g, r; XtGeometryResult res ; /* get the size the Form wants to be */ GetSize(fw, &g, w, desired); /* GetSize takes care of the resizePolicy resource as well and returns the desired change in g if any. g.request_mode might be 0 at this point, which means the Form doesn't want to change, but we still want to see if the child request can be accomodated into the current Form size, so we move forward with the 0 in request mode. */ /* if the child requesed query only, propagate */ if (desired->request_mode & XtCWQueryOnly) g.request_mode |= XtCWQueryOnly; /* Let's make a request to the parent. At this point, we do not want to accept any compromise because we're not sure our kid will accept it in turn. So use the Xt API, no _XmMakeGeometryRequest. If g.request_mode is 0, nothing will happen, yes will be returned */ res = XtMakeGeometryRequest((Widget)fw, &g, &r); /* check that a real request has failed or that if request_mode was 0, consider that a No */ if (!g.request_mode || (res != XtGeometryYes)) { Dimension orig_form_width, orig_form_height ; /* let's save the original form size first */ orig_form_width = fw->core.width ; orig_form_height = fw->core.height ; if (res == XtGeometryAlmost) { /* let's try the proposal. Stuff the Form with it so that PlaceChildren does the layout base on it */ if (r.request_mode | CWWidth) fw->core.width = r.width ; if (r.request_mode | CWHeight) fw->core.height = r.height ; } /* else it's No and we keep the same size */ /* let's see if there is a chance that the child request be honored: the needed form overall size is smaller than the current or proposed size (now in the core field) */ if ((g.width <= fw->core.width) && (g.height <= fw->core.height)) { /* ok, now we'are going to try to place the kid using the new Form size for the layout */ PlaceChildren (fw, w, desired); /* now, we check if the requestor has gotten what it asked for. The logic is that: width = req_width iff req_width height = req_height iff req_height */ if (((desired->request_mode & CWWidth && desired->width == w->core.width) || ! (desired->request_mode & CWWidth)) && ((desired->request_mode & CWHeight && desired->height == w->core.height) || ! (desired->request_mode & CWHeight))) { /* ok, the kid request has been honored, although the Form couldn't change its own size, let's return Yes to the kid and ask the Form's parent the needed size if Almost was returned */ if (res == XtGeometryAlmost) { /* let's backup the original Form size first */ fw->core.width = orig_form_width ; fw->core.height = orig_form_height; /* success guaranteed */ XtMakeGeometryRequest((Widget)fw, &r, NULL); /* no need to do the layout PlaceCHildren, it has already been done using the correct size */ } /* simply return Yes, since PlaceChildren already change the kid core fields */ reply = XtGeometryYes ; } else { /* the kid hasn't gotten what it asked for in the current Form geometry, we have to backup everything and return either No or Almost to the kid */ if ((w->core.width != original.width) || (w->core.height != original.height)) { allowed->request_mode = desired->request_mode; allowed->sibling = desired->sibling; allowed->stack_mode = desired->stack_mode; allowed->x = w->core.x; allowed->y = w->core.y; allowed->width = w->core.width; allowed->height = w->core.height; allowed->border_width = w->core.border_width; reply = XtGeometryAlmost; } else reply = XtGeometryNo; /* backup the kid geometry */ w->core.x = original.x; w->core.y = original.y; w->core.width = original.width; w->core.height = original.height; w->core.border_width = original.border_width; /* backup the Form and the layout too */ fw->core.width = orig_form_width ; fw->core.height = orig_form_height; PlaceChildren (fw, w, &original); } } else { /* the size the Form wants for the kid request is bigger than its current or proposed size, return No to the kid */ /* backup the original Form size first */ fw->core.width = orig_form_width ; fw->core.height = orig_form_height; /* we haden't changed anything else, just return No */ reply = XtGeometryNo; #ifdef FIX_1612 if (((IsWidgetAttachedOneHorizontalSide(w)) && (desired->request_mode & CWWidth)) || ((IsWidgetAttachedOneVerticalSide(w)) && (desired->request_mode & CWHeight))) { PlaceChildren (fw, w, desired); reply = XtGeometryYes; } #endif } } else { /* ok, we got a Yes form the Form's parent, let's relayout using the new size, except if query only was specified */ if (!(desired->request_mode & XtCWQueryOnly)) { /* Reposition the widget only if not QueryOnly */ PlaceChildren (fw, w, desired); } reply = XtGeometryYes; } } /* let's deal with stacking order */ if (desired->request_mode & (CWSibling | CWStackMode)) { /* always honor stand alone stack requests */ if (!size_req) reply = XtGeometryYes; else /* the request concerned size as well, see if it was denied. if so, propose the stack request alone */ if (reply != XtGeometryYes) { allowed->request_mode = desired->request_mode; allowed->sibling = desired->sibling; allowed->stack_mode = desired->stack_mode; allowed->x = w->core.x; allowed->y = w->core.y; allowed->width = w->core.width; allowed->height = w->core.height; allowed->border_width = w->core.border_width; reply = XtGeometryAlmost; } } /* deal with the shadow resize without Expose */ if ( fw->bulletin_board.old_shadow_thickness && (fw->bulletin_board.old_width != fw->core.width || fw->bulletin_board.old_height != fw->core.height) ) { _XmClearShadowType ((Widget) fw, fw->bulletin_board.old_width, fw->bulletin_board.old_height, fw->bulletin_board.old_shadow_thickness, 0); } fw->bulletin_board.old_width = fw->core.width; fw->bulletin_board.old_height = fw->core.height; fw->bulletin_board.old_shadow_thickness = fw->manager.shadow_thickness; return (reply); } /************************************************************************ * * QueryGeometry * ************************************************************************/ static XtGeometryResult QueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) { Dimension width = 0, height = 0 ; XmFormWidget fw = (XmFormWidget) widget ; /* first determine what is the desired size, using the resize_policy. */ if (fw->bulletin_board.resize_policy == XmRESIZE_NONE) { desired->width = XtWidth(widget) ; desired->height = XtHeight(widget) ; } else { SortChildren(fw); if (GMode( intended) & CWWidth) width = intended->width; if (GMode( intended) & CWHeight) height = intended->height; if (!XtIsRealized((Widget)fw)) { int i; Widget child; XmFormConstraint c; for (i = 0; i < fw->composite.num_children; i++) { child = fw->composite.children[i]; c = GetFormConstraint(child); c->preferred_width = XtWidth(child); c->preferred_height = XtHeight(child); } } CalcFormSize(fw, &width, &height); if ((fw->bulletin_board.resize_policy == XmRESIZE_GROW) && ((width < XtWidth(widget)) || (height < XtHeight(widget)))) { desired->width = XtWidth(widget) ; desired->height = XtHeight(widget) ; } else { desired->width = width ; desired->height = height ; } } /* deal with user initial size setting */ if (!XtIsRealized(widget)) { if (XtWidth(widget) != 0) desired->width = XtWidth(widget) ; if (XtHeight(widget) != 0) desired->height = XtHeight(widget) ; } return XmeReplyToQueryGeometry(widget, intended, desired) ; } /************************************************************************ * * Resize * This routine is called by the parent's geometry manager after it * has ok'd the resize request AND resized the form window. This * routine is responsible for implementing the size given. * ************************************************************************/ static void Resize( Widget wid ) { XmFormWidget fw = (XmFormWidget) wid ; Boolean draw_shadow = False; /* clear the shadow if its needed (will check if its now larger) */ _XmClearShadowType ((Widget )fw, fw->bulletin_board.old_width, fw->bulletin_board.old_height, fw->bulletin_board.old_shadow_thickness, 0); /* * if it is now smaller, redraw the shadow since there may not be a * redisplay */ if ((fw->bulletin_board.old_height > fw->core.height) || (fw->bulletin_board.old_width > fw->core.width)) draw_shadow = True; fw->bulletin_board.old_width = fw->core.width; fw->bulletin_board.old_height = fw->core.height; fw->bulletin_board.old_shadow_thickness = fw->manager.shadow_thickness; PlaceChildren (fw, NULL, NULL) ; if ((draw_shadow) && (XtIsRealized((Widget)fw))) XmeDrawShadows (XtDisplay (fw), XtWindow (fw), fw->manager.top_shadow_GC, fw->manager.bottom_shadow_GC, 0, 0, fw->core.width, fw->core.height, fw->manager.shadow_thickness, fw->bulletin_board.shadow_type); } static void Redisplay( Widget fw, XEvent *event, Region region ) { XmeRedisplayGadgets( fw, event, region); XmeDrawShadows (XtDisplay((Widget)fw), XtWindow((Widget)fw), ((XmFormWidget) fw)->manager.top_shadow_GC, ((XmFormWidget) fw)->manager.bottom_shadow_GC, 0, 0, XtWidth(fw), XtHeight(fw), ((XmFormWidget) fw)->manager.shadow_thickness, ((XmFormWidget) fw)->bulletin_board.shadow_type); } /************************************************************************ * * PlaceChildren * Position all children according to their constraints. * Return desired width and height. * ************************************************************************/ static void PlaceChildren( XmFormWidget fw, Widget instigator, XtWidgetGeometry *inst_geometry ) { Widget child; #ifdef FIX_1299 for (child = fw->form.first_child; child != NULL; child = (GetFormConstraint(child))->next_sibling) { /* Place child itself */ PlaceChild(fw, child, instigator, inst_geometry); /* Update all attached widgets * according to the placement of a child */ UpdateAttachments(fw, child, instigator, inst_geometry); } #else register XmFormConstraint c; int height, width; Dimension border_width; int near_edge; for (child = fw->form.first_child; child != NULL; child = c->next_sibling) { if (!XtIsManaged(child)) break; c = GetFormConstraint(child); CalcEdgeValues(child, TRUE, instigator, inst_geometry, NULL, NULL); if ((child == instigator) && (inst_geometry->request_mode & CWBorderWidth)) border_width = inst_geometry->border_width; else border_width = ((RectObj) child)->rectangle.border_width; if (LayoutIsRtoLM(fw)) { /* switch the meanings of left and right attachements */ width = c->att[LEFT].value - c->att[RIGHT].value - (2 * border_width); near_edge = RIGHT; } else { width = c->att[RIGHT].value - c->att[LEFT].value - (2 * border_width); near_edge = LEFT; } height = c->att[BOTTOM].value - c->att[TOP].value - (2 * border_width); if (width <= 0) width = 1; if (height <= 0) height = 1; if ((c->att[near_edge].value != ((RectObj) child)->rectangle.x) || (c->att[TOP].value != ((RectObj) child)->rectangle.y) || (width != ((RectObj) child)->rectangle.width) || (height != ((RectObj) child)->rectangle.height) || (border_width != ((RectObj) child)->rectangle.border_width)) { /* Yes policy everywhere, so don't resize the instigator */ if (child != instigator) { XmeConfigureObject(child, c->att[near_edge].value, c->att[TOP].value, width, height, border_width); } else { XmeConfigureObject(child, c->att[near_edge].value, c->att[TOP].value, child->core.width, child->core.height, child->core.border_width); child->core.width = width ; child->core.height = height ; child->core.border_width = border_width ; } } } #endif /* FIX_1299 */ } #ifdef FIX_1299 static void UpdateAttachments( XmFormWidget fw, Widget wid, Widget instigator, XtWidgetGeometry* inst_geometry) { register XmFormConstraint c; c = GetFormConstraint(wid); if (IS_ATTACHED_WIDGET(c, LEFT)) PlaceChild(fw, ATTACHED_WIDGET(c, LEFT), instigator, inst_geometry); if (IS_ATTACHED_WIDGET(c, RIGHT)) PlaceChild(fw, ATTACHED_WIDGET(c, RIGHT), instigator, inst_geometry); if (IS_ATTACHED_WIDGET(c, TOP)) PlaceChild(fw, ATTACHED_WIDGET(c, TOP), instigator, inst_geometry); if (IS_ATTACHED_WIDGET(c, BOTTOM)) PlaceChild(fw, ATTACHED_WIDGET(c, BOTTOM), instigator, inst_geometry); } static void PlaceChild( XmFormWidget fw, Widget child, Widget instigator, XtWidgetGeometry* inst_geometry) { register XmFormConstraint c; int height, width; Dimension border_width; int near_edge; if (!XtIsManaged(child)) return; c = GetFormConstraint(child); CalcEdgeValues(child, TRUE, instigator, inst_geometry, NULL, NULL); if ((child == instigator) && (inst_geometry->request_mode & CWBorderWidth)) border_width = inst_geometry->border_width; else border_width = ((RectObj) child)->rectangle.border_width; if (LayoutIsRtoLM(fw)) { /* switch the meanings of left and right attachements */ width = c->att[LEFT].value - c->att[RIGHT].value - (2 * border_width); near_edge = RIGHT; } else { width = c->att[RIGHT].value - c->att[LEFT].value - (2 * border_width); near_edge = LEFT; } height = c->att[BOTTOM].value - c->att[TOP].value - (2 * border_width); if (width <= 0) width = 1; if (height <= 0) height = 1; if ((c->att[near_edge].value != ((RectObj) child)->rectangle.x) || (c->att[TOP].value != ((RectObj) child)->rectangle.y) || (width != ((RectObj) child)->rectangle.width) || (height != ((RectObj) child)->rectangle.height) || (border_width != ((RectObj) child)->rectangle.border_width)) { /* Yes policy everywhere, so don't resize the instigator */ if (child != instigator) { XmeConfigureObject(child, c->att[near_edge].value, c->att[TOP].value, width, height, border_width); } else { XmeConfigureObject(child, c->att[near_edge].value, c->att[TOP].value, child->core.width, child->core.height, child->core.border_width); child->core.width = width ; child->core.height = height ; child->core.border_width = border_width ; } } } #endif /* FIX_1299 */ /************************************************************************ * * ChangeManaged * Something changed in the set of managed children, so place * the children and change the form widget size to reflect new size, * if possible. * ************************************************************************/ static void ChangeManaged( Widget wid ) { XmFormWidget fw = (XmFormWidget) wid ; XtWidgetGeometry g; int i, j, k; register XmFormConstraint c; register Widget w, child; /* * The following code works around a bug in the intrinsics * destroy processing. The child is unmanaged before anything * else (destroy callbacks) so we have to handle the destroy * inside of changemanaged instead of in a destroy callback */ for (k = 0; k < fw->composite.num_children; k++) { child = fw->composite.children[k]; if (child->core.being_destroyed) { /* If anyone depends on this child, make into a dependency on form */ for (i = 0; i < fw->composite.num_children; i++) { w = fw->composite.children[i]; c = GetFormConstraint(w); for (j = FIRST_ATTACHMENT; j < (LAST_ATTACHMENT + 1); j++) { if (((c->att[j].type == XmATTACH_WIDGET) && (c->att[j].w == child)) || ((c->att[j].type == XmATTACH_OPPOSITE_WIDGET) && (c->att[j].w == child))) { switch (j) { case LEFT: c->att[j].type = XmATTACH_FORM; c->att[j].offset = w->core.x; break; case TOP: c->att[j].type = XmATTACH_FORM; c->att[j].offset = w->core.y; break; default: c->att[j].type = XmATTACH_NONE; break; } c->att[j].w = NULL; } } } } } SortChildren (fw); /* Don't use XtRealizedWidget(form) as a test to initialize the preferred geometry, since when you realize the form before its kid, everything goes to the ground. Here we initialize a field if it hasn't been done already, the XmINVALID_DIMENSION has been set in ConstraintInitialize */ for (i = 0; i < fw->composite.num_children; i++) { child = fw->composite.children[i]; c = GetFormConstraint(child); if (c->preferred_width == XmINVALID_DIMENSION) c->preferred_width = XtWidth(child); if (c->preferred_height == XmINVALID_DIMENSION) c->preferred_height = XtHeight(child); } if (!XtIsRealized((Widget)fw)) { /* First time through */ Dimension w = 0, h = 0; g.request_mode = 0; g.width = (fw->core.width ? fw->core.width : 1); g.height = (fw->core.height ? fw->core.height : 1); if (!XtWidth(fw) && XtHeight(fw)) { CalcFormSize(fw, &w, NULL); g.width = w; g.request_mode |= CWWidth; } else if (XtWidth(fw) && !XtHeight(fw)) { CalcFormSize(fw, NULL, &h); g.height = h; g.request_mode |= CWHeight; } else if (!XtWidth(fw) && !XtHeight(fw)) { CalcFormSize(fw, &w, &h); g.width = w; g.height = h; g.request_mode |= (CWWidth | CWHeight); } if (g.request_mode != 0) _XmMakeGeometryRequest((Widget) fw, &g); PlaceChildren (fw, NULL, NULL); } else { ChangeIfNeeded(fw, NULL, NULL); PlaceChildren (fw, NULL, NULL); } fw->bulletin_board.old_width = fw->core.width; fw->bulletin_board.old_height = fw->core.height; fw->bulletin_board.old_shadow_thickness = fw->manager.shadow_thickness; XmeNavigChangeManaged((Widget) fw); } /************************************************************************ * * GetSize * * ************************************************************************/ static void GetSize( XmFormWidget fw, XtWidgetGeometry * g, Widget w, XtWidgetGeometry *desired ) { Boolean grow_ok = fw->bulletin_board.resize_policy != XmRESIZE_NONE, shrink_ok = fw->bulletin_board.resize_policy == XmRESIZE_ANY; g->request_mode = 0; g->width = 0; g->height = 0; /* Compute the desired size of the form */ if (CalcFormSizeWithChange(fw, &g->width, &g->height, w, desired)) { /* there is a change - check resize policy first */ if ((g->width > fw->core.width && !grow_ok) || (g->width < fw->core.width && !shrink_ok) || (g->height > fw->core.height && !grow_ok) || (g->height < fw->core.height && !shrink_ok)) return ; /* exit with request_mode = 0 */ if (g->width != fw->core.width) g->request_mode |= CWWidth; if (g->height != fw->core.height) g->request_mode |= CWHeight; } } /************************************************************************ * * ChangeIfNeeded * Returns whether to honor widget w's resize request; only returns * False if resize would require form to change size but it cannot. * Form changes size as a side effect. * ************************************************************************/ static void ChangeIfNeeded( XmFormWidget fw, Widget w, XtWidgetGeometry *desired ) { XtWidgetGeometry g; /* find out the desired size of the form, using the children attachment and the resizePolicy */ GetSize(fw, &g, w, desired); _XmMakeGeometryRequest((Widget)fw, &g) ; if ( fw->bulletin_board.old_shadow_thickness && (fw->bulletin_board.old_width != fw->core.width || fw->bulletin_board.old_height != fw->core.height) ) { _XmClearShadowType ((Widget) fw, fw->bulletin_board.old_width, fw->bulletin_board.old_height, fw->bulletin_board.old_shadow_thickness, 0); } fw->bulletin_board.old_width = fw->core.width; fw->bulletin_board.old_height = fw->core.height; fw->bulletin_board.old_shadow_thickness = fw->manager.shadow_thickness; } /************************************************************************ * * DeleteChild * Delete a single widget from a parent widget * ************************************************************************/ static void DeleteChild( Widget child ) { XtWidgetProc delete_child; if (!XtIsRectObj(child)) return; _XmProcessLock(); delete_child = ((CompositeWidgetClass) xmFormClassRec.core_class.superclass)-> composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child); SortChildren((XmFormWidget) XtParent(child)); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal * num_args ) /* unused */ { XmFormWidget old = (XmFormWidget) cw ; XmFormWidget new_w = (XmFormWidget) nw ; Boolean returnFlag = FALSE; Dimension w = 0; Dimension h = 0; /* Check for invalid fraction base */ if (new_w->form.fraction_base == 0) { XmeWarning( (Widget) new_w, MESSAGE1); new_w->form.fraction_base = old->form.fraction_base; } if (XtIsRealized((Widget)new_w)) { /* SetValues of width and/or height = 0, signals the form to */ /* recompute its bounding box and grow if it needs. */ if ((XtWidth(new_w) != XtWidth(old)) || (XtHeight(new_w) != XtHeight(old))) { if ((XtWidth(new_w) == 0) || (XtHeight(new_w) == 0)) { CalcFormSize (new_w, &w, &h); if (XtWidth(new_w) == 0) XtWidth(new_w) = w; if (XtHeight(new_w) == 0) XtHeight(new_w) = h; } else { w = XtWidth(new_w); h = XtHeight(new_w); } } /* If default distance has changed, or the fraction base has changed, recalculate size. */ if ((new_w->form.horizontal_spacing != old->form.horizontal_spacing) || (new_w->bulletin_board.margin_width != old->bulletin_board.margin_width) || (new_w->form.vertical_spacing != old->form.vertical_spacing) || (new_w->bulletin_board.margin_height != old->bulletin_board.margin_height) || (new_w->form.fraction_base != old->form.fraction_base)) { CalcFormSize(new_w, &w, &h); XtWidth(new_w) = w; XtHeight(new_w) = h; } } return(returnFlag); } /*ARGSUSED*/ static void SetValuesAlmost( Widget cw, /* unused */ Widget nw, XtWidgetGeometry *req, XtWidgetGeometry *rep ) { XmFormWidget new_w = (XmFormWidget) nw ; if (!rep->request_mode) PlaceChildren(new_w, NULL, NULL); *req = *rep; } /************************************************************************ * * ConstraintSetValues * If any values change, what we do is place everything again. * ************************************************************************/ /*ARGSUSED*/ static Boolean ConstraintSetValues( register Widget old, register Widget ref, /* unused */ register Widget new_w, ArgList args, /* unused */ Cardinal * num_args ) /* unused */ { XmFormWidget fw = (XmFormWidget) XtParent(new_w); register XmFormConstraint oldc, newc; register int i; if (!XtIsRectObj(new_w)) return(FALSE); oldc = GetFormConstraint(old), newc = GetFormConstraint(new_w); /* This fragment has been removed in order to fix bug #1298 if (XtWidth(new_w) != XtWidth(old)) newc->preferred_width = XtWidth(new_w); if (XtHeight(new_w) != XtHeight(old)) newc->preferred_height = XtHeight(new_w); */ /* Validate the attachement type. */ for (i = FIRST_ATTACHMENT; i < (LAST_ATTACHMENT + 1); i++) { if (newc->att[i].type != oldc->att[i].type) { if( !XmRepTypeValidValue( XmRID_ATTACHMENT, newc->att[i].type, new_w) ) { newc->att[i].type = oldc->att[i].type; } } if ((newc->att[i].type == XmATTACH_WIDGET) || (newc->att[i].type == XmATTACH_OPPOSITE_WIDGET)) { while ((newc->att[i].w) && !SIBLINGS(newc->att[i].w, new_w)) { newc->att[i].w = XtParent(newc->att[i].w); } } } /* Re do the layout only if we have to */ if ((XtIsRealized((Widget)fw)) && (XtIsManaged(new_w)) && (ANY(type) || ANY(w) || ANY(percent) || ANY(offset))) { XtWidgetGeometry g; g.request_mode = 0; if (XtWidth(new_w) != XtWidth(old)) { g.request_mode |= CWWidth; g.width = XtWidth(new_w); } if (XtHeight(new_w) != XtHeight(old)) { g.request_mode |= CWHeight; g.height = XtHeight(new_w); } if (XtBorderWidth(new_w) != XtBorderWidth(old)) { g.request_mode |= CWBorderWidth; g.border_width = XtBorderWidth(new_w); } fw->form.processing_constraints = TRUE; SortChildren(fw); ChangeIfNeeded(fw, new_w, &g); PlaceChildren(fw, new_w, &g); new_w->core.x ++ ; /* Force a call to the GeometryManager. There are cases where a change in constraints does not result in a change in the geometry of new_w. As a result, processing_constraint stays True and everything is screwed up... Note that this change in x is only temporary since Xt will reset it to its old value before calling the GM */ } return (False); } /************************************************************************ * * Initialize * The form widget specific initialization. * ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal * num_args ) /* unused */ { XmFormWidget new_w = (XmFormWidget) nw ; new_w->form.first_child = NULL; if (new_w->form.fraction_base == 0) { new_w->form.fraction_base = 100; XmeWarning( (Widget) new_w, MESSAGE1); } new_w->form.processing_constraints = FALSE; /* Set up for shadow drawing */ new_w->bulletin_board.old_width = XtWidth(new_w); new_w->bulletin_board.old_height = XtHeight(new_w); new_w->bulletin_board.old_shadow_thickness = new_w->manager.shadow_thickness; } /************************************************************************ * * ConstraintInitialize * ************************************************************************/ /*ARGSUSED*/ static void ConstraintInitialize( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal * num_args ) /* unused */ { XmFormConstraint nc; register int i; if (!XtIsRectObj(new_w)) return; nc = GetFormConstraint(new_w); /* Validate the attachement type. */ for (i = FIRST_ATTACHMENT; i < (LAST_ATTACHMENT + 1); i++){ if(!XmRepTypeValidValue( XmRID_ATTACHMENT, nc->att[i].type, new_w)) { nc->att[i].type = XmATTACH_NONE; } if ((nc->att[i].type == XmATTACH_WIDGET) || (nc->att[i].type == XmATTACH_OPPOSITE_WIDGET)) { while ((nc->att[i].w) && !SIBLINGS(nc->att[i].w, new_w)) { nc->att[i].w = XtParent(nc->att[i].w); } } nc->att[i].value = nc->att[i].tempValue = 0 ; } /* set the preferred geometry to some magic value that will help us find in ChangeManaged that it's the first time this kid is going thru layout */ /* this code used to set the current geometry as preferred, I don't see why it was needed, since the preferred field are always used after the changemanaged is called */ nc->preferred_width = XmINVALID_DIMENSION; nc->preferred_height = XmINVALID_DIMENSION; } /************************************************************************ * * CheckConstraints * ************************************************************************/ static void CheckConstraints( Widget w ) { XmFormConstraint c = GetFormConstraint(w); XmFormWidget fw = (XmFormWidget) XtParent(w); XmFormAttachment left = &c->att[LEFT], right = &c->att[RIGHT], top = &c->att[TOP], bottom = &c->att[BOTTOM] ; XmFormAttachment a; int which; int wid, ht; if (left->type == XmATTACH_NONE && right->type == XmATTACH_NONE) { if (fw->form.rubber_positioning) left->type = right->type = XmATTACH_SELF; else { left->type = XmATTACH_FORM; left->offset = w->core.x; } } if (top->type == XmATTACH_NONE && bottom->type == XmATTACH_NONE) { if (fw->form.rubber_positioning) top->type = bottom->type = XmATTACH_SELF; else { top->type = XmATTACH_FORM; top->offset = w->core.y; } } for (which = FIRST_ATTACHMENT; which < (LAST_ATTACHMENT + 1); which++) { a = &c->att[which]; switch (a->type) { case XmATTACH_NONE: case XmATTACH_FORM: case XmATTACH_OPPOSITE_FORM: a->w = NULL; a->percent = 0; break; case XmATTACH_SELF: a->offset = 0; a->w = NULL; a->type = XmATTACH_POSITION; a->percent = 0; /* default in case wid or ht are 0, although behavior in that case is poorly defined */ wid = w->core.x + w->core.width + (2 * w->core.border_width); ht = w->core.y + w->core.height + (2 * w->core.border_width); if (wid < fw->core.width) wid = fw->core.width; if (ht < fw->core.height) ht = fw->core.height; switch (which) { case LEFT: if (wid != 0) a->percent = (w->core.x * fw->form.fraction_base) / wid; break; case TOP: if (ht != 0) a->percent = (w->core.y * fw->form.fraction_base) / ht; break; case RIGHT: if (wid != 0) a->percent = ((w->core.x + w->core.width + 2 * w->core.border_width) * fw->form.fraction_base) / wid; break; case BOTTOM: if (ht != 0) a->percent = ((w->core.y + w->core.height + 2 * w->core.border_width) * fw->form.fraction_base) / ht; break; } break; case XmATTACH_POSITION: a->w = NULL; break; case XmATTACH_WIDGET: case XmATTACH_OPPOSITE_WIDGET: a->percent = 0; break; } } } /************************************************************************ * * SortChildren * ************************************************************************/ static void SortChildren( register XmFormWidget fw ) { int i, j; Widget child = NULL; register XmFormConstraint c = NULL, c1 = NULL; int sortedCount = 0; Widget last_child, att_widget; Boolean sortable; fw->form.first_child = NULL; for (i = 0; i < fw->composite.num_children; i++) { child = fw->composite.children[i]; if (!XtIsRectObj(child)) continue; c = GetFormConstraint(child); if (XtIsManaged(child)) { c->sorted = False; c->next_sibling = NULL; } else { c->next_sibling = fw->form.first_child; fw->form.first_child = child; c->sorted = True; sortedCount++; } CheckConstraints(child); } /* THIS IS PROBABLY WRONG AND SHOULD BE FIXED SOMEDAY */ /* WHY SHOULD UNMANAGED CHILDREN BE ALLOWED AS ATTACHMENT POINTS */ /* FOR MANAGED CHILDREN??? */ /* While there are unsorted children, find one with only sorted */ /* predecessors and put it in the list. This algorithm works */ /* particularly well if the order is already correct */ last_child = NULL; for ( ; sortedCount != fw->composite.num_children; sortedCount++) { sortable = False; for (i = 0; !sortable && i < fw->composite.num_children; i++) { child = fw->composite.children[i]; if (!XtIsRectObj(child)) continue; c = GetFormConstraint(child); if (c->sorted) continue; sortable = True; for (j = FIRST_ATTACHMENT; j < (LAST_ATTACHMENT + 1); j++) { if ((c->att[j].type == XmATTACH_WIDGET) || (c->att[j].type == XmATTACH_OPPOSITE_WIDGET)) { att_widget = c->att[j].w; if ((SIBLINGS(att_widget, child)) && (XtIsRectObj(att_widget))) { c1 = GetFormConstraint (att_widget); if (!c1->sorted) sortable = False; } } } } if (sortable) { /* We have found a sortable child...add to sorted list. */ if (last_child == NULL) { c->next_sibling = fw->form.first_child; fw->form.first_child = child; } else { c1 = GetFormConstraint(last_child); c->next_sibling = c1->next_sibling; c1->next_sibling = child; } last_child = child; c->sorted = True; } #ifndef FIX_1299 else { /* We failed to find a sortable child, there must be */ /* a circular dependency. */ XmeWarning( (Widget) fw, MESSAGE5); return; } #endif } #ifdef FIX_1299 /*Add other children that haven't been sorted*/ for (i = 0; i < fw->composite.num_children; i++) { child = fw->composite.children[i]; c = GetFormConstraint(child); if (!XtIsRectObj(child) || c->sorted) continue; if(!c->sorted) { if (last_child == NULL) { c->next_sibling = fw->form.first_child; fw->form.first_child = child; } else { c1 = GetFormConstraint(last_child); c->next_sibling = c1->next_sibling; c1->next_sibling = child; } last_child = child; c->sorted = True; } } #endif } /************************************************************************ * * CalcEdgeValues * ************************************************************************/ static void CalcEdgeValues( Widget w, #if NeedWidePrototypes int really, #else Boolean really, #endif /* NeedWidePrototypes */ Widget instigator, XtWidgetGeometry *inst_geometry, Dimension *form_width, Dimension *form_height ) { XmFormConstraint c = GetFormConstraint (w); XmFormWidget fw = (XmFormWidget) XtParent (w); XmFormAttachment left = &c->att[LEFT], right = &c->att[RIGHT], top = &c->att[TOP], bottom = &c->att[BOTTOM] ; Dimension width, height, border_width; if (w == instigator) { if (inst_geometry->request_mode & CWWidth) width = inst_geometry->width; else width = w->core.width; if (inst_geometry->request_mode & CWHeight) height = inst_geometry->height; else height = w->core.height; if (inst_geometry->request_mode & CWBorderWidth) border_width = inst_geometry->border_width; else border_width = w->core.border_width; } else if (!fw->form.processing_constraints) { /* * If we just use the widget's current geometry we will * effectively be grow only. That would not be correct. * * Instead we will use our idea of the child's preferred * size. */ width = c->preferred_width; height = c->preferred_height; border_width = w->core.border_width; } else { width = w->core.width; height = w->core.height; border_width = w->core.border_width; } width += border_width * 2; height += border_width * 2; if (width <= 0) width = 1; if (height <= 0) height = 1; if (left->type != XmATTACH_NONE) { if (right->type != XmATTACH_NONE) /* LEFT and right are attached */ { CalcEdgeValue(fw, w, width, border_width, LEFT, really, form_width, form_height); CalcEdgeValue(fw, w, width, border_width, RIGHT, really, form_width, form_height); } else /* LEFT attached, compute right */ { CalcEdgeValue(fw, w, width, border_width, LEFT, really, form_width, form_height); ComputeAttachment(fw, w, width, border_width, RIGHT, really, form_width, form_height); } } else { if (right->type != XmATTACH_NONE) /* RIGHT attached, compute left */ { CalcEdgeValue(fw, w, width, border_width, RIGHT, really, form_width, form_height); ComputeAttachment(fw, w, width, border_width, LEFT, really, form_width, form_height); } } if (top->type != XmATTACH_NONE) { if (bottom->type != XmATTACH_NONE) /* TOP and bottom are attached */ { CalcEdgeValue(fw, w, height, border_width, TOP, really, form_width, form_height); CalcEdgeValue(fw, w, height, border_width, BOTTOM, really, form_width, form_height); } else /* TOP attached, compute bottom */ { CalcEdgeValue(fw, w, height, border_width, TOP, really, form_width, form_height); ComputeAttachment(fw, w, height, border_width, BOTTOM, really, form_width, form_height); } } else { if (bottom->type != XmATTACH_NONE) /* BOTTOM attached, compute top */ { CalcEdgeValue(fw, w, height, border_width, BOTTOM, really, form_width, form_height); ComputeAttachment(fw, w, height, border_width, TOP, really, form_width, form_height); } } } /********************************************************************* * * CheckBottomBase * *********************************************************************/ static float CheckBottomBase( Widget sibling, #if NeedWidePrototypes int opposite ) #else Boolean opposite ) #endif /* NeedWidePrototypes */ { XmFormWidget fw = (XmFormWidget) sibling->core.parent; XmFormConstraint c = GetFormConstraint(sibling); Boolean flag = FALSE; float return_val; if (!opposite) { switch (c->att[TOP].type) { case XmATTACH_POSITION: return_val = (float) c->att[TOP].percent / (float) fw->form.fraction_base ; break; case XmATTACH_NONE: switch (c->att[BOTTOM].type) { case XmATTACH_FORM: return_val = 1.0; break; case XmATTACH_POSITION: return_val = (float) c->att[BOTTOM].percent / (float) fw->form.fraction_base ; break; case XmATTACH_OPPOSITE_WIDGET: flag = TRUE; case XmATTACH_WIDGET: if (SIBLINGS(c->att[BOTTOM].w, sibling)) return_val = CheckBottomBase(c->att[BOTTOM].w, flag); else { if (flag) return_val = 0.0; else return_val = 1.0; } break; default: return_val = 0.0; break; } break; case XmATTACH_OPPOSITE_FORM: return_val = 1.0; break; default: return_val = 0.0; break; } } else { switch(c->att[BOTTOM].type) { case XmATTACH_NONE: if (c->att[TOP].type == XmATTACH_POSITION) return_val = (float) c->att[TOP].percent / (float) fw->form.fraction_base; else return_val = 0.0; break; case XmATTACH_POSITION: return_val = (float) c->att[BOTTOM].percent / (float) fw->form.fraction_base; break; case XmATTACH_OPPOSITE_WIDGET: flag = TRUE; case XmATTACH_WIDGET: if (SIBLINGS(c->att[BOTTOM].w, sibling)) return_val = CheckBottomBase(c->att[BOTTOM].w, flag); else { if (flag) return_val = 0.0; else return_val = 1.0; } break; case XmATTACH_FORM: return_val = 1.0; break; default: return_val = 0.0; break; } } return(return_val); } /********************************************************************* * * CheckRightBase * *********************************************************************/ static float CheckRightBase( Widget sibling, #if NeedWidePrototypes int opposite ) #else Boolean opposite ) #endif /* NeedWidePrototypes */ { XmFormWidget fw = (XmFormWidget) sibling->core.parent; XmFormConstraint c = GetFormConstraint(sibling); Boolean flag = FALSE; float return_val; if (!opposite) { switch (c->att[LEFT].type) { case XmATTACH_POSITION: return_val = (float) c->att[LEFT].percent / (float) fw->form.fraction_base; break; case XmATTACH_NONE: switch (c->att[RIGHT].type) { case XmATTACH_FORM: return_val = 1.0; break; case XmATTACH_POSITION: return_val = (float) c->att[RIGHT].percent / (float) fw->form.fraction_base ; break; case XmATTACH_OPPOSITE_WIDGET: flag = TRUE; case XmATTACH_WIDGET: if (SIBLINGS(c->att[RIGHT].w, sibling)) return_val = CheckRightBase(c->att[RIGHT].w, flag); else { if (flag) return_val = 0.0; else return_val = 1.0; } break; default: return_val = 0.0; break; } break; case XmATTACH_OPPOSITE_FORM: return_val = 1.0; break; default: return_val = 0.0; break; } } else { switch(c->att[RIGHT].type) { case XmATTACH_NONE: if (c->att[LEFT].type == XmATTACH_POSITION) return_val = (float) c->att[LEFT].percent / (float) fw->form.fraction_base ; else return_val = 0.0; break; case XmATTACH_POSITION: return_val = (float) c->att[RIGHT].percent / (float) fw->form.fraction_base; break; case XmATTACH_OPPOSITE_WIDGET: flag = TRUE; case XmATTACH_WIDGET: if (SIBLINGS(c->att[RIGHT].w, sibling)) return_val = CheckRightBase(c->att[RIGHT].w, flag); else { if (flag) return_val = 0.0; else return_val = 1.0; } break; case XmATTACH_FORM: return_val = 1.0; break; default: return_val = 0.0; break; } } return(return_val); } /********************************************************************* * * CheckLeftBase * *********************************************************************/ static float CheckLeftBase( Widget sibling, #if NeedWidePrototypes int opposite ) #else Boolean opposite ) #endif /* NeedWidePrototypes */ { XmFormWidget fw = (XmFormWidget) sibling->core.parent; XmFormConstraint c = GetFormConstraint(sibling); Boolean flag = FALSE; float return_val; if (!opposite) { switch (c->att[RIGHT].type) { case XmATTACH_POSITION: return_val = (float) c->att[RIGHT].percent / (float) fw->form.fraction_base; break; case XmATTACH_NONE: switch (c->att[LEFT].type) { case XmATTACH_FORM: return_val = 1.0; break; case XmATTACH_POSITION: return_val = (float) c->att[LEFT].percent / (float) fw->form.fraction_base ; break; case XmATTACH_OPPOSITE_WIDGET: flag = TRUE; case XmATTACH_WIDGET: if (SIBLINGS(c->att[LEFT].w, sibling)) return_val = CheckLeftBase(c->att[LEFT].w, flag); else { if (flag) return_val = 0.0; else return_val = 1.0; } break; default: return_val = 0.0; break; } break; case XmATTACH_OPPOSITE_FORM: return_val = 1.0; break; default: return_val = 0.0; break; } } else { switch(c->att[LEFT].type) { case XmATTACH_NONE: if (c->att[RIGHT].type == XmATTACH_POSITION) return_val = (float) c->att[RIGHT].percent / (float) fw->form.fraction_base ; else return_val = 0.0; break; case XmATTACH_POSITION: return_val = (float) c->att[LEFT].percent / (float) fw->form.fraction_base; break; case XmATTACH_OPPOSITE_WIDGET: flag = TRUE; case XmATTACH_WIDGET: if (SIBLINGS(c->att[LEFT].w, sibling)) return_val = CheckLeftBase(c->att[LEFT].w, flag); else { if (flag) return_val = 0.0; else return_val = 1.0; } break; case XmATTACH_FORM: return_val = 1.0; break; default: return_val = 0.0; break; } } return(return_val); } /********************************************************************* * * CalcEdgeValue * Note that Left attachment apply to the right side in a * Right-to-Left environment. Slightly confusing, but it is more a * matter of switching right and left in the computing. * *********************************************************************/ /*ARGSUSED*/ static void CalcEdgeValue( XmFormWidget fw, Widget w, #if NeedWidePrototypes int size, int border_width, /* unused */ #else Dimension size, Dimension border_width, /* unused */ #endif /* NeedWidePrototypes */ int which, #if NeedWidePrototypes int really, #else Boolean really, #endif /* NeedWidePrototypes */ Dimension *fwidth, Dimension *fheight ) { float scale; XmFormAttachment att = GetFormConstraint(w)->att; XmFormAttachment a = att + which; XmFormConstraint c; XmFormAttachment ref; float factor; int temp1, temp2, temp3; int ctype; ctype = a->type; if ((ctype == XmATTACH_WIDGET) && !(SIBLINGS(a->w, w))) ctype = XmATTACH_FORM; if ((ctype == XmATTACH_OPPOSITE_WIDGET) && !(SIBLINGS(a->w, w))) ctype = XmATTACH_OPPOSITE_FORM; if (LayoutIsRtoLM(fw)) switch (ctype) { case XmATTACH_FORM: a->w = NULL; a->percent = 0; switch (which) { case RIGHT: case TOP: AssignValue(a, GetFormOffset(fw, which, att)); break; case LEFT: if (fwidth != NULL) { if ((att + RIGHT)->type == XmATTACH_NONE) { temp1 = *fwidth - (GetFormOffset(fw, which, att)); temp2 = temp1 - size; if (temp2 < 0) { *fwidth += abs(temp2); AssignValue(a, (temp1 + abs(temp2))); } else AssignValue(a, temp1); } else { temp1 = *fwidth - (GetFormOffset(fw, which, att)); temp2 = Value(att + RIGHT); temp3 = temp1 - temp2 - size; if (temp3 < 0) { *fwidth += abs(temp3); AssignValue(a, (*fwidth - size - GetFormOffset(fw, which, att))); } else AssignValue(a, temp1); } } else AssignValue(a, fw->core.width - GetFormOffset(fw,which,att)); break; case BOTTOM: if (fheight != NULL) { if ((att + TOP)->type == XmATTACH_NONE) { temp1 = *fheight - GetFormOffset(fw, which, att); temp2 = temp1 - size; if (temp2 < 0) { *fheight += abs(temp2); AssignValue(a, (temp1 + abs(temp2))); } else AssignValue(a, temp1); } else { temp1 = *fheight - GetFormOffset(fw, which, att); temp2 = Value(att + TOP); temp3 = temp1 - temp2 - size; if (temp3 < 0) { *fheight += abs(temp3); AssignValue(a, (*fheight - size - GetFormOffset(fw, which, att))); } else AssignValue(a, temp1); } } else AssignValue(a, fw->core.height - GetFormOffset(fw,which,att)); break; } return; case XmATTACH_OPPOSITE_FORM: a->w = NULL; a->percent = 0; switch (which) { case RIGHT: if (fwidth) { temp1 = *fwidth + GetFormOffset(fw, which, att); if (temp1 < 0) { *fwidth += abs(temp1); temp1 = 0; } AssignValue(a, temp1); } else AssignValue(a, fw->core.width + GetFormOffset(fw, which, att)); break; case TOP: if (fheight) { temp1 = *fheight + GetFormOffset(fw, which, att); if (temp1 < 0) { *fheight += abs(temp1); temp1 = 0; } AssignValue(a, temp1); } else AssignValue(a, fw->core.height + GetFormOffset(fw, which, att)); break; case LEFT: case BOTTOM: AssignValue(a, -(GetFormOffset(fw, which, att))); break; } return; case XmATTACH_POSITION: scale = ((float) a->percent) / fw->form.fraction_base; a->w = 0; switch (which) { case RIGHT: scale = 1.0 - scale; if (fwidth != NULL) AssignValue(a, (*fwidth * scale + 0.5) + GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.width * scale + 0.5) + GetFormOffset(fw, which, att)); break; case TOP: if (fheight != NULL) AssignValue(a, (*fheight * scale + 0.5) + GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.height * scale + 0.5) + GetFormOffset(fw, which, att)); break; case LEFT: scale = 1.0 - scale; if (fwidth != NULL) if ((att + RIGHT)->type != XmATTACH_NONE) { temp1 = (int) (((*fwidth * scale) + 0.5) - GetFormOffset(fw, which, att)); temp2 = Value(att + RIGHT); temp3 = temp1 - temp2 - size; if (temp3 < 0) { if (!scale) scale = 1.0; *fwidth += (Dimension) (((1.0 / scale) * abs(temp3)) + 0.5); } AssignValue(a, (temp2 + size)); } else AssignValue(a, (*fwidth * scale + 0.5) - GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.width * scale + 0.5) - GetFormOffset(fw, which, att)); break; case BOTTOM: if (fheight != NULL) if ((att + TOP)->type != XmATTACH_NONE) { temp1 = (int) (((*fheight * scale) + 0.5) - GetFormOffset(fw, which, att)); temp2 = Value(att + TOP); temp3 = temp1 - temp2 - size; if (temp3 < 0) { if (!scale) scale = 1.0; *fheight += (Dimension) (((1.0 / scale) * abs(temp3)) + 0.5); } AssignValue(a, (temp2 + size)); } else AssignValue(a, (*fheight * scale + 0.5) - GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.height * scale + 0.5) - GetFormOffset(fw, which, att)); } return; case XmATTACH_WIDGET: a->percent = 0; c = GetFormConstraint(a->w); switch (which) { case RIGHT: ref = &c->att[LEFT]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case TOP: ref = &c->att[BOTTOM]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case LEFT: ref = &c->att[RIGHT]; if (att[RIGHT].type != XmATTACH_NONE) { temp1 = Value(ref) - GetFormOffset(fw, which, att); temp2 = temp1 - Value(&(att[RIGHT])); temp3 = temp2 - size; if ((fwidth) && (temp3 < 0)) { factor = CheckLeftBase(a->w, FALSE); *fwidth += (Dimension) ((factor * abs(temp3)) + 0.5); temp1 = Value(&(att[RIGHT])) + size; } AssignValue(a, temp1); } else { temp1 = Value(ref) - GetFormOffset(fw, which, att); AssignValue(a, temp1); } break; case BOTTOM: ref = &c->att[TOP]; if (att[TOP].type != XmATTACH_NONE) { temp1 = Value(ref) - GetFormOffset(fw, which, att); temp2 = temp1 - Value((&att[TOP])); temp3 = temp2 - size; if ((fheight) && (temp3 < 0)) { factor = CheckBottomBase(a->w, FALSE); *fheight += (Dimension) ((factor * abs(temp3)) + 0.5); temp1 = Value((&att[TOP])) + size; } AssignValue(a, temp1); } else { temp1 = Value(ref) - GetFormOffset(fw, which, att); AssignValue(a, temp1); } break; } return; case XmATTACH_OPPOSITE_WIDGET: a->percent = 0; c = GetFormConstraint(a->w); switch (which) { case RIGHT: ref = &c->att[RIGHT]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case TOP: ref = &c->att[TOP]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case LEFT: ref = &c->att[LEFT]; AssignValue(a, Value(ref) - GetFormOffset(fw, which, att)); break; case BOTTOM: ref = &c->att[BOTTOM]; AssignValue(a, Value(ref) - GetFormOffset(fw, which, att)); break; } return; } else /* Left to Right environment */ switch (ctype) { case XmATTACH_FORM: a->w = NULL; a->percent = 0; switch (which) { case LEFT: case TOP: AssignValue(a, GetFormOffset(fw, which, att)); break; case RIGHT: if (fwidth != NULL) { if ((att + LEFT)->type == XmATTACH_NONE) { temp1 = *fwidth - (GetFormOffset(fw, which, att)); temp2 = temp1 - size; if (temp2 < 0) { *fwidth += abs(temp2); AssignValue(a, (temp1 + abs(temp2))); } else AssignValue(a, temp1); } else { temp1 = *fwidth - (GetFormOffset(fw, which, att)); temp2 = Value(att + LEFT); temp3 = temp1 - temp2 - size; if (temp3 < 0) { *fwidth += abs(temp3); AssignValue(a, (*fwidth - size - GetFormOffset(fw, which, att))); } else AssignValue(a, temp1); } } else AssignValue(a, fw->core.width - GetFormOffset(fw,which,att)); break; case BOTTOM: if (fheight != NULL) { if ((att + TOP)->type == XmATTACH_NONE) { temp1 = *fheight - GetFormOffset(fw, which, att); temp2 = temp1 - size; if (temp2 < 0) { *fheight += abs(temp2); AssignValue(a, (temp1 + abs(temp2))); } else AssignValue(a, temp1); } else { temp1 = *fheight - GetFormOffset(fw, which, att); temp2 = Value(att + TOP); temp3 = temp1 - temp2 - size; if (temp3 < 0) { *fheight += abs(temp3); AssignValue(a, (*fheight - size - GetFormOffset(fw, which, att))); } else AssignValue(a, temp1); } } else AssignValue(a, fw->core.height - GetFormOffset(fw,which,att)); break; } return; case XmATTACH_OPPOSITE_FORM: a->w = NULL; a->percent = 0; switch (which) { case LEFT: if (fwidth) { temp1 = *fwidth + GetFormOffset(fw, which, att); if (temp1 < 0) { *fwidth += abs(temp1); temp1 = 0; } AssignValue(a, temp1); } else AssignValue(a, fw->core.width + GetFormOffset(fw, which, att)); break; case TOP: if (fheight) { temp1 = *fheight + GetFormOffset(fw, which, att); if (temp1 < 0) { *fheight += abs(temp1); temp1 = 0; } AssignValue(a, temp1); } else AssignValue(a, fw->core.height + GetFormOffset(fw, which, att)); break; case RIGHT: case BOTTOM: AssignValue(a, -(GetFormOffset(fw, which, att))); break; } return; case XmATTACH_POSITION: scale = ((float) a->percent) / fw->form.fraction_base; a->w = 0; switch (which) { case LEFT: if (fwidth != NULL) AssignValue(a, (*fwidth * scale + 0.5) + GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.width * scale + 0.5) + GetFormOffset(fw, which, att)); break; case TOP: if (fheight != NULL) AssignValue(a, (*fheight * scale + 0.5) + GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.height * scale + 0.5) + GetFormOffset(fw, which, att)); break; case RIGHT: if (fwidth != NULL) if ((att + LEFT)->type != XmATTACH_NONE) { temp1 = (int) (((*fwidth * scale) + 0.5) - GetFormOffset(fw, which, att)); temp2 = Value(att + LEFT); temp3 = temp1 - temp2 - size; if (temp3 < 0) { if (!scale) scale = 1.0; *fwidth += (Dimension) (((1.0 / scale) * abs(temp3)) + 0.5); } AssignValue(a, (temp2 + size)); } else AssignValue(a, (*fwidth * scale + 0.5) - GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.width * scale + 0.5) - GetFormOffset(fw, which, att)); break; case BOTTOM: if (fheight != NULL) if ((att + TOP)->type != XmATTACH_NONE) { temp1 = (int) (((*fheight * scale) + 0.5) - GetFormOffset(fw, which, att)); temp2 = Value(att + TOP); temp3 = temp1 - temp2 - size; if (temp3 < 0) { if (!scale) scale = 1.0; *fheight += (Dimension) (((1.0 / scale) * abs(temp3)) + 0.5); } AssignValue(a, (temp2 + size)); } else AssignValue(a, (*fheight * scale + 0.5) - GetFormOffset(fw, which, att)); else AssignValue(a, (fw->core.height * scale + 0.5) - GetFormOffset(fw, which, att)); } return; case XmATTACH_WIDGET: a->percent = 0; c = GetFormConstraint(a->w); switch (which) { case LEFT: ref = &c->att[RIGHT]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case TOP: ref = &c->att[BOTTOM]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case RIGHT: ref = &c->att[LEFT]; if (att[LEFT].type != XmATTACH_NONE) { temp1 = Value(ref) - GetFormOffset(fw, which, att); temp2 = temp1 - Value(&(att[LEFT])); temp3 = temp2 - size; if ((fwidth) && (temp3 < 0)) { factor = CheckRightBase(a->w, FALSE); *fwidth += (Dimension) ((factor * abs(temp3)) + 0.5); temp1 = Value(&(att[LEFT])) + size; } AssignValue(a, temp1); } else { temp1 = Value(ref) - GetFormOffset(fw, which, att); AssignValue(a, temp1); } break; case BOTTOM: ref = &c->att[TOP]; if (att[TOP].type != XmATTACH_NONE) { temp1 = Value(ref) - GetFormOffset(fw, which, att); temp2 = temp1 - Value((&att[TOP])); temp3 = temp2 - size; if ((fheight) && (temp3 < 0)) { factor = CheckBottomBase(a->w, FALSE); *fheight += (Dimension) ((factor * abs(temp3)) + 0.5); temp1 = Value((&att[TOP])) + size; } AssignValue(a, temp1); } else { temp1 = Value(ref) - GetFormOffset(fw, which, att); AssignValue(a, temp1); } break; } return; case XmATTACH_OPPOSITE_WIDGET: a->percent = 0; c = GetFormConstraint(a->w); switch (which) { case LEFT: ref = &c->att[LEFT]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case TOP: ref = &c->att[TOP]; AssignValue(a, Value(ref) + GetFormOffset(fw, which, att)); break; case RIGHT: ref = &c->att[RIGHT]; AssignValue(a, Value(ref) - GetFormOffset(fw, which, att)); break; case BOTTOM: ref = &c->att[BOTTOM]; AssignValue(a, Value(ref) - GetFormOffset(fw, which, att)); break; } return; } } /************************************************************************ * * ComputeAttachment * Note that Left attachment apply to the right side in a * Right-to-Left environment. Slightly confusing, but it is more a * matter of switching right and left in the computing. * ************************************************************************/ /*ARGSUSED*/ static void ComputeAttachment( XmFormWidget fw, Widget w, #if NeedWidePrototypes int size, int border_width, /* unused */ #else Dimension size, Dimension border_width, /* unused */ #endif /* NeedWidePrototypes */ int which, #if NeedWidePrototypes int really, #else Boolean really, #endif /* NeedWidePrototypes */ Dimension *fwidth, Dimension *fheight ) { XmFormConstraint c = GetFormConstraint(w); XmFormAttachment a = &c->att[which]; int temp; if (LayoutIsRtoLM(fw)) switch (which) { case RIGHT: temp = Value(&c->att[LEFT]) - size; if ((fwidth != NULL) && (temp < 0)) { *fwidth += abs(temp); temp = 0; } AssignValue(a,temp); break; case LEFT: temp = Value(&c->att[RIGHT]) + size; if ((fwidth != NULL) && (temp > 0) && (temp > *fwidth)) *fwidth += (temp - *fwidth); AssignValue(a,temp); break; case TOP: temp = Value(&c->att[BOTTOM]) - size; if ((fheight != NULL) && (temp < 0)) { *fheight += abs(temp); temp = 0; } AssignValue(a, temp); break; case BOTTOM: temp = Value(&c->att[TOP]) + size; if ((fheight != NULL) && (temp > 0) && (temp > *fheight)) *fheight += (temp - *fheight); AssignValue(a, temp); break; } else /* Left to right */ switch (which) { case LEFT: temp = Value(&c->att[RIGHT]) - size; if ((fwidth != NULL) && (temp < 0)) { *fwidth += abs(temp); temp = 0; } AssignValue(a,temp); break; case RIGHT: temp = Value(&c->att[LEFT]) + size; if ((fwidth != NULL) && (temp > 0) && (temp > *fwidth)) *fwidth += (temp - *fwidth); AssignValue(a,temp); break; case TOP: temp = Value(&c->att[BOTTOM]) - size; if ((fheight != NULL) && (temp < 0)) { *fheight += abs(temp); temp = 0; } AssignValue(a, temp); break; case BOTTOM: temp = Value(&c->att[TOP]) + size; if ((fheight != NULL) && (temp > 0) && (temp > *fheight)) *fheight += (temp - *fheight); AssignValue(a, temp); break; } } /************************************************************************ * * GetFormOffset * ************************************************************************/ static int GetFormOffset( XmFormWidget fw, int which, XmFormAttachment att ) { int o; o = att[which].offset; if (o == XmINVALID_DIMENSION) { switch (att[which].type) { case XmATTACH_NONE: case XmATTACH_SELF: case XmATTACH_POSITION: o = 0; break; case XmATTACH_FORM: case XmATTACH_OPPOSITE_FORM: if ((which == LEFT) || (which == RIGHT)) { if (fw->bulletin_board.margin_width == XmINVALID_DIMENSION) o = fw->form.horizontal_spacing; else o = fw->bulletin_board.margin_width; } else { if (fw->bulletin_board.margin_height == XmINVALID_DIMENSION) o = fw->form.vertical_spacing; else o = fw->bulletin_board.margin_height; } break; case XmATTACH_WIDGET: case XmATTACH_OPPOSITE_WIDGET: if ((which == LEFT) || (which == RIGHT)) o = fw->form.horizontal_spacing; else o = fw->form.vertical_spacing; break; } } return o; } /************************************************************************ * * Application Accessible External Functions * ************************************************************************/ /************************************************************************ * * XmCreateForm * Create an instance of a form and return the widget id. * ************************************************************************/ Widget XmCreateForm( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return(XtCreateWidget(name, xmFormWidgetClass, parent, arglist, argcount)); } Widget XmVaCreateForm( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmFormWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedForm( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmFormWidgetClass, parent, True, var, count); va_end(var); return w; } /************************************************************************ * * XmCreateFormDialog * Create an instance of a form dialog and return the widget id. * ************************************************************************/ Widget XmCreateFormDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return XmeCreateClassDialog (xmFormWidgetClass, parent, name, arglist, argcount) ; } #ifdef FIX_1612 /************************************************************************ * * IsWidgetAttachedOneHorizontalSide * Checking the attachments of widget in horizontal direction. * Returns True if only one (left or right) side of widget is attached * ************************************************************************/ static Boolean IsWidgetAttachedOneHorizontalSide(Widget w) { if (w != NULL) { XmFormConstraint c = GetFormConstraint(w); if (((c->att[LEFT].type == XmATTACH_NONE) && (c->att[RIGHT].type != XmATTACH_NONE)) || ((c->att[LEFT].type != XmATTACH_NONE) && (c->att[RIGHT].type == XmATTACH_NONE))) return True; } return False; } static Boolean IsWidgetAttachedOneVerticalSide(Widget w) { if (w != NULL) { XmFormConstraint c = GetFormConstraint(w); if (((c->att[TOP].type == XmATTACH_NONE) && (c->att[BOTTOM].type != XmATTACH_NONE)) || ((c->att[TOP].type != XmATTACH_NONE) && (c->att[BOTTOM].type == XmATTACH_NONE))) return True; } return False; } #endif motif-2.3.8/lib/Xm/TextFI.h0000644000175000017500000000760112672140200012227 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: TextFI.h /main/5 1995/07/13 18:05:32 drk $ */ #ifndef _XmTextFI_h #define _XmTextFI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern int _XmTextFieldCountBytes( XmTextFieldWidget tf, wchar_t *wc_value, int num_chars) ; extern void _XmTextFToggleCursorGC( Widget widget) ; extern void _XmTextFieldDrawInsertionPoint( XmTextFieldWidget tf, #if NeedWidePrototypes int turn_on) ; #else Boolean turn_on) ; #endif /* NeedWidePrototypes */ extern void _XmTextFieldSetClipRect( XmTextFieldWidget tf) ; extern void _XmTextFieldSetCursorPosition( XmTextFieldWidget tf, XEvent *event, XmTextPosition position, #if NeedWidePrototypes int adjust_flag, int call_cb) ; #else Boolean adjust_flag, Boolean call_cb) ; #endif /* NeedWidePrototypes */ extern Boolean _XmTextFieldReplaceText( XmTextFieldWidget tf, XEvent *event, XmTextPosition replace_prev, XmTextPosition replace_next, char *insert, int insert_length, #if NeedWidePrototypes int move_cursor) ; #else Boolean move_cursor) ; #endif /* NeedWidePrototypes */ extern void _XmTextFieldDeselectSelection( Widget w, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time sel_time) ; extern Boolean _XmTextFieldSetDestination( Widget w, XmTextPosition position, Time set_time) ; extern void _XmTextFieldStartSelection( XmTextFieldWidget tf, XmTextPosition left, XmTextPosition right, Time sel_time) ; extern void _XmTextFieldSetSel2( Widget w, XmTextPosition left, XmTextPosition right, #if NeedWidePrototypes int disown, #else Boolean disown, #endif /* NeedWidePrototypes */ Time sel_time) ; extern void _XmTextFieldHandleSecondaryFinished(Widget w, XEvent *event); extern int _XmTextFieldCountCharacters(XmTextFieldWidget tf, char *ptr, int n_bytes); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextFI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmRdFToBuf.c0000644000175000017500000001023112672140200013150 00000000000000/* $XConsortium: XpmRdFToBuf.c /main/2 1996/09/20 08:13:12 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * RdFToBuf.c: * * * * XPM library * * Copy a file to a malloc'ed buffer, provided as a convenience. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* * The code related to FOR_MSW has been added by * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" #include #if !defined(FOR_MSW) && !defined(WIN32) #include #endif #ifndef VAX11C #include #endif #if defined(FOR_MSW) || defined(WIN32) #include #define stat _stat #define fstat _fstat #define fdopen _fdopen #define O_RDONLY _O_RDONLY #endif int XpmReadFileToBuffer(filename, buffer_return) char *filename; char **buffer_return; { int fd, fcheck; off_t len; char *ptr; struct stat stats; FILE *fp; *buffer_return = NULL; #ifndef VAX11C fd = open(filename, O_RDONLY); #else fd = open(filename, O_RDONLY, NULL); #endif if (fd < 0) return XpmOpenFailed; if (fstat(fd, &stats)) { close(fd); return XpmOpenFailed; } fp = fdopen(fd, "r"); if (!fp) { close(fd); return XpmOpenFailed; } len = stats.st_size; ptr = (char *) XpmMalloc(len + 1); if (!ptr) { fclose(fp); return XpmNoMemory; } fcheck = fread(ptr, 1, len, fp); fclose(fp); #ifdef VMS /* VMS often stores text files in a variable-length record format, where there are two bytes of size followed by the record. fread converts this so it looks like a record followed by a newline. Unfortunately, the size reported by fstat() (and fseek/ftell) counts the two bytes for the record terminator, while fread() counts only one. So, fread() sees fewer bytes in the file (size minus # of records) and thus when asked to read the amount returned by stat(), it fails. The best solution, suggested by DEC, seems to consider the length returned from fstat() as an upper bound and call fread() with a record length of 1. Then don't check the return value. We'll check for 0 for gross error that's all. */ len = fcheck; if (fcheck == 0) { #else if (fcheck != len) { #endif XpmFree(ptr); return XpmOpenFailed; } ptr[len] = '\0'; *buffer_return = ptr; return XpmSuccess; } motif-2.3.8/lib/Xm/XmTabListI.h0000644000175000017500000000562512672140200013050 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: XmTabListI.h /main/5 1995/07/13 18:28:19 drk $ */ #ifndef _XmTabListI_h #define _XmTabListI_h #include #ifdef __cplusplus extern "C" { #endif #define TAB_OPTIMIZED_BITS 1 #define TAB_MARK_BITS TAB_OPTIMIZED_BITS #define TAB_REFCOUNT_BITS (16 - TAB_OPTIMIZED_BITS) typedef struct __XmTabRec { unsigned int mark : TAB_MARK_BITS; unsigned int ref_count : TAB_REFCOUNT_BITS; float value; unsigned char units; XmOffsetModel offsetModel; unsigned char alignment; char *decimal; XmTab next, prev; } _XmTabRec, *_XmTab; typedef struct __XmTabListRec { unsigned int count; XmTab start; } _XmTabListRec, *_XmTabList; /* * Macros for tab data structure access */ #define _XmTabMark(tab) ((_XmTab)(tab))->mark #define _XmTabValue(tab) ((_XmTab)(tab))->value #define _XmTabUnits(tab) ((_XmTab)(tab))->units #define _XmTabPrev(tab) ((_XmTab)(tab))->prev #define _XmTabNext(tab) ((_XmTab)(tab))->next #define _XmTabModel(tab) ((_XmTab)(tab))->offsetModel #define _XmTabAlign(tab) ((_XmTab)(tab))->alignment #define _XmTabDecimal(tab) ((_XmTab)(tab))->decimal #define _XmTabLStart(tl) ((_XmTabList)(tl))->start #define _XmTabLCount(tl) ((_XmTabList)(tl))->count /******** Private Function Declarations for XmTabList.c ********/ extern XmTab _XmTabCopy(XmTab tab); extern Widget _XmCreateTabList(Widget parent, String name, ArgList arglist, Cardinal argcount); extern Widget _XmCreateTab(Widget parent, String name, ArgList arglist, Cardinal argcount); extern Position _XmTabListGetPosition( Screen * screen, XmTabList tab_list, unsigned char unit_type, Cardinal tab_position); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTabListI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MenuUtilI.h0000644000175000017500000001121112672140200012727 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: MenuUtilI.h /main/6 1996/07/23 16:45:49 pascale $ */ #ifndef _XmMenuUtilI_h #define _XmMenuUtilI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmMenuHelp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern Boolean _XmIsActiveTearOff ( Widget w) ; extern int _XmGrabPointer( Widget widget, int owner_events, unsigned int event_mask, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor, Time time) ; extern int _XmGrabKeyboard( Widget widget, int owner_events, int pointer_mode, int keyboard_mode, Time time) ; extern int _XmMenuGrabKeyboardAndPointer( Widget widget, Time time) ; extern void _XmMenuSetInPMMode( Widget wid, #if NeedWidePrototypes int flag) ; #else Boolean flag) ; #endif /* NeedWidePrototypes */ extern void _XmSetMenuTraversal( Widget wid, #if NeedWidePrototypes int traversalOn) ; #else Boolean traversalOn) ; #endif /* NeedWidePrototypes */ extern void _XmLeafPaneFocusOut( Widget wid) ; extern void _XmMenuTraverseLeft( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmMenuTraverseRight( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmMenuTraverseUp( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmMenuTraverseDown( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmMenuEscape( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmRC_GadgetTraverseDown( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmRC_GadgetTraverseUp( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmRC_GadgetTraverseLeft( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmRC_GadgetTraverseRight( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmMenuTraversalHandler( Widget w, Widget pw, XmTraversalDirection direction) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuUtilI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Manager.h0000644000175000017500000000313212672140200012431 00000000000000/* $XConsortium: Manager.h /main/5 1995/07/15 20:52:43 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmManager_h #define _XmManager_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsManager #define XmIsManager(w) XtIsSubclass(w, xmManagerWidgetClass) #endif /* XmIsManager */ externalref WidgetClass xmManagerWidgetClass; typedef struct _XmManagerClassRec * XmManagerWidgetClass; typedef struct _XmManagerRec * XmManagerWidget; /******** Public Function Declarations ********/ /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmManager_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ScrollFrameT.c0000644000175000017500000001174512672140200013420 00000000000000/* $XConsortium: ScrollFrameT.c /main/5 1995/07/15 20:55:20 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include #include "MessagesI.h" #include "ScrollFramTI.h" #define SWMessage3 _XmMMsgScrollFrameT_0000 #define SWMessage4 _XmMMsgScrollFrameT_0001 /************************************************************************ * * _XmSFAddNavigator convenience function * Entering here, sf is an initialized scrollframe, and * scroll_frame_data is always valid (but the move_cb field can be * NULL, for pure APP_DEFINED case support). * *************************************<->***********************************/ void _XmSFAddNavigator( Widget sf, Widget nav, Mask dimMask, XmScrollFrameData scroll_frame_data) { XmNavigatorTrait nav_trait ; XmNavigatorDataRec nav_data ; if ((nav_trait = (XmNavigatorTrait) XmeTraitGet((XtPointer) XtClass(nav), XmQTnavigator)) != NULL) { /* check for NULL move_cb */ if (scroll_frame_data->move_cb) nav_trait -> changeMoveCB(nav, scroll_frame_data->move_cb, (XtPointer) scroll_frame_data->scrollable, True) ; nav_data.valueMask = NavDimMask ; nav_data.dimMask = dimMask ; nav_trait -> setValue(nav, &nav_data, False); if (scroll_frame_data->num_nav_list == scroll_frame_data->num_nav_slots) { /* Allocate more space */ scroll_frame_data->num_nav_slots += 2; scroll_frame_data->nav_list = (WidgetList) XtRealloc((char*)scroll_frame_data->nav_list, scroll_frame_data->num_nav_slots * sizeof(Widget)); } scroll_frame_data->nav_list[scroll_frame_data->num_nav_list] = nav; scroll_frame_data->num_nav_list++; } else { XmeWarning(sf, SWMessage3); } } /************************************************************************ * * _XmSFRemoveNavigator convenience function * *************************************<->***********************************/ void _XmSFRemoveNavigator( Widget sf, Widget nav, XmScrollFrameData scroll_frame_data) { Cardinal position, i; XmNavigatorTrait nav_trait ; if ((nav_trait = (XmNavigatorTrait) XmeTraitGet((XtPointer) XtClass(nav), XmQTnavigator)) != NULL) { /* remove the move callback */ if (scroll_frame_data->move_cb) nav_trait -> changeMoveCB(nav, scroll_frame_data->move_cb, (XtPointer) scroll_frame_data->scrollable, False) ; } else { XmeWarning(sf, SWMessage4); return ; } for (position = 0; positionnum_nav_list; position++) { if (scroll_frame_data->nav_list[position] == nav) { break; } } if (position == scroll_frame_data->num_nav_list) return; scroll_frame_data->num_nav_list--; for (i = position; i < scroll_frame_data->num_nav_list; i++) { scroll_frame_data->nav_list[i] = scroll_frame_data->nav_list[i+1]; } } /************************************************************************ * * _XmSFUpdateNavigatorsValues convenience function * *************************************<->***********************************/ void _XmSFUpdateNavigatorsValue( Widget sf, XmNavigatorData nav_data, Boolean notify) { Cardinal i, num_nav_list ; Widget * nav_list ; Boolean inited ; /* there is a possibility that the SW was not inited for navigation business: APP_DEFINED where no scrollbar have been added yet */ inited = ((XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass(sf), XmQTscrollFrame)) ->getInfo(sf, NULL, &nav_list, &num_nav_list); if (!inited) return ; /* loop over the associated navigator list and call the change value method for each navigator */ /* Updating the first navigator only if notify is True is not enough, since the dimension is pertinent */ for (i=0; i < num_nav_list; i++) { Widget nav = nav_list[i] ; XmNavigatorSetValueProc nav_setValue = ((XmNavigatorTrait) XmeTraitGet((XtPointer) XtClass(nav), XmQTnavigator))->setValue; nav_setValue(nav, nav_data, notify); } } motif-2.3.8/lib/Xm/Xmos.c0000644000175000017500000011450713145162623012022 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Xmos.c /main/33 1998/01/21 11:07:25 csn $" #endif #endif #include #ifdef __cplusplus extern "C" { /* some 'locale.h' do not have prototypes (sun) */ #endif #include #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif /* __cplusplus */ #include #ifndef NEED_XPOLL_H #include #else #include #endif #ifndef X_NOT_STDC_ENV #include #include #endif #include /* for isspace() */ #include /* For declaration of select(). */ #if defined(NO_REGCOMP) && !defined(NO_REGEX) # ifdef __sgi extern char *regcmp(); extern int regex(); # elif defined(SVR4) # include # elif defined(SYSV) extern char *regcmp(); extern int regex(); # endif #endif /* NO_REGEX */ #ifndef NO_REGCOMP # include #endif /* NO_REGCOMP */ #include #define X_INCLUDE_PWD_H #define X_INCLUDE_DIRENT_H #define XOS_USE_XT_LOCKING #ifndef NEED_XOS_R_H #include #else #include #endif #include "XmosI.h" #include "XmI.h" #ifdef USE_GETWD # include # define MAX_DIR_PATH_LEN MAXPATHLEN # define getcwd(buf, len) ((char *) getwd(buf)) #else # define MAX_DIR_PATH_LEN 1024 #endif #define MAX_USER_NAME_LEN 256 #ifndef S_ISDIR # define S_ISDIR(m) ((m & S_IFMT)==S_IFDIR) #endif #ifndef S_ISREG # define S_ISREG(m) ((m & S_IFMT)==S_IFREG) #endif #define FILE_LIST_BLOCK 64 typedef struct { unsigned char type ; char file_name[1] ; /* Must be last entry in structure. */ } XmDirCacheRec, **XmDirCache ; /******** * Set defaults for resources that are implementation dependant * and may be modified. ********/ externaldef(xmos) char _XmSDEFAULT_FONT[] = "fixed"; externaldef(xmos) char _XmSDEFAULT_BACKGROUND[] = "#c4c4c4"; /**************** end of vendor dependant defaults ********/ /******** Static Function Declarations ********/ static String GetCurrentDir(String buf); static String GetQualifiedDir(String dirSpec); static String GetFixedMatchPattern(String pattern); static void FreeDirCache(void); static void ResetCache(char *qDirName); static unsigned char AddEntryToCache(char *entryName, unsigned entryNameLen); static int Wcslen(wchar_t *wcs); /******** End Static Function Declarations ********/ static char *dirCacheName; static unsigned dirCacheNameLen; static XmDirCache dirCache; static unsigned numCacheAlloc; static unsigned numCacheEntries; static void FreeDirCache(void) { if (dirCacheName != NULL) { XtFree(dirCacheName); dirCacheName = NULL; dirCacheNameLen = 0; while (numCacheEntries) XtFree((char *) dirCache[--numCacheEntries]); } } static void ResetCache(char *qDirName) { FreeDirCache(); dirCacheNameLen = strlen(qDirName); dirCacheName = XtMalloc(dirCacheNameLen + MAX_USER_NAME_LEN + 1); strcpy(dirCacheName, qDirName); } static unsigned char AddEntryToCache(char *entryName, unsigned entryNameLen) { struct stat statBuf; unsigned char result = 0; if (numCacheEntries == numCacheAlloc) { numCacheAlloc += FILE_LIST_BLOCK; dirCache = (XmDirCache) XtRealloc((char *) dirCache, numCacheAlloc * sizeof(XmDirCacheRec *)); } dirCache[numCacheEntries] = (XmDirCacheRec *) XtMalloc(sizeof(XmDirCacheRec) + entryNameLen); strcpy(dirCache[numCacheEntries]->file_name, entryName); /* Use dirCacheName character array as temporary buffer for full file name.*/ strcpy(&dirCacheName[dirCacheNameLen], entryName); if (!stat(dirCacheName, &statBuf)) { if (S_ISREG(statBuf.st_mode)) result = XmFILE_REGULAR; else if (S_ISDIR(statBuf.st_mode)) result = XmFILE_DIRECTORY; } /* Restore to dir path only. */ dirCacheName[dirCacheNameLen] = '\0'; dirCache[numCacheEntries++]->type = result; return result; } /****************************************************************/ static String GetQualifiedDir(String dirSpec) /*************GENERAL: * dirSpec is a directory name, that can contain relative * as well as logical reference. This routine resolves all these * references, so that dirSpec is now suitable for open(). * The routine allocates memory for the result, which is guaranteed to be * of length >= 1. This memory should eventually be freed using XtFree(). ****************/ /*************UNIX: * Builds directory name showing descriptive path components. The result * is a directory path beginning at the root directory and terminated * with a '/'. The path will not contain ".", "..", or "~" components. ****************/ { int dirSpecLen; _Xgetpwparams pwd_buf; struct passwd * pwd_value; char * userDir; int userDirLen; int userNameLen; char * outputBuf; char * destPtr; char * srcPtr; char * scanPtr; char nameBuf[MAX_USER_NAME_LEN]; char dirbuf[MAX_DIR_PATH_LEN]; dirSpecLen = strlen(dirSpec); outputBuf = NULL; switch (*dirSpec) { case '~': if (!(dirSpec[1]) || (dirSpec[1] == '/')) { userDir = XmeGetHomeDirName(); if (*userDir) { userDirLen = strlen(userDir); outputBuf = XtMalloc(userDirLen + dirSpecLen + 2); strcpy(outputBuf, userDir); strcpy(&outputBuf[userDirLen], (dirSpec + 1)); } } else { destPtr = nameBuf; userNameLen = 0; srcPtr = dirSpec + 1; while (*srcPtr && (*srcPtr != '/') && (++userNameLen < MAX_USER_NAME_LEN)) { *destPtr++ = *srcPtr++; } *destPtr = '\0'; pwd_value = _XGetpwnam(nameBuf, pwd_buf); if (pwd_value != NULL) { userDirLen = strlen(pwd_value->pw_dir); dirSpecLen = strlen(srcPtr); outputBuf = XtMalloc(userDirLen + dirSpecLen + 2); strcpy(outputBuf, pwd_value->pw_dir); strcpy(&outputBuf[userDirLen], srcPtr); } } break; case '/': outputBuf = XtMalloc(dirSpecLen + 2); strcpy(outputBuf, dirSpec); break; default: if ((destPtr = GetCurrentDir(dirbuf)) != NULL) { userDirLen = strlen(destPtr); outputBuf = XtMalloc(userDirLen + dirSpecLen + 3); strcpy(outputBuf, destPtr); outputBuf[userDirLen++] = '/'; strcpy(&outputBuf[userDirLen], dirSpec); } break; } if (!outputBuf) { outputBuf = XtMalloc(2); outputBuf[0] = '/'; outputBuf[1] = '\0'; } else { userDirLen = strlen(outputBuf); if (outputBuf[userDirLen - 1] != '/') { outputBuf[userDirLen] = '/'; outputBuf[++userDirLen] = '\0'; } /* The string in outputBuf is assumed to begin and end with a '/'. */ scanPtr = outputBuf; while (*++scanPtr) /* Skip past '/'. */ { /* scanPtr now points to non-NULL character following '/'. */ if (scanPtr[0] == '.') { if (scanPtr[1] == '/') { /* Have "./", so just erase (overwrite with shift). */ destPtr = scanPtr; srcPtr = &scanPtr[2]; while ((*destPtr++ = *srcPtr++) != '\0') /*EMPTY*/; --scanPtr; /* Leave scanPtr at preceding '/'. */ continue; } else { if ((scanPtr[1] == '.') && (scanPtr[2] == '/')) { /* Have "../", so back up one directory. */ srcPtr = &scanPtr[2]; --scanPtr; /* Move scanPtr to preceding '/'.*/ if (scanPtr != outputBuf) { while ((*--scanPtr != '/')) /*EMPTY*/; /* Now move to previous '/'.*/ } destPtr = scanPtr; while ((*++destPtr = *++srcPtr) != '\0') /*EMPTY*/; /* Overwrite "../" with shift.*/ continue; } } } else { /* Check for embedded "//". Posix allows a leading double * slash (and Apollos require it). */ if (*scanPtr == '/') { if ((scanPtr > (outputBuf + 1)) || (scanPtr[1] == '/')) { /* Have embedded "//" (other than root specification), * so erase with shift and reset scanPtr. */ srcPtr = scanPtr; --scanPtr; destPtr = scanPtr; while ((*++destPtr = *++srcPtr) != '\0') /*EMPTY*/; } continue; } } while (*++scanPtr != '/') /*EMPTY*/; } } return outputBuf; } /****************************************************************/ String _XmOSFindPatternPart(String fileSpec) /****************GENERAL: * fileSpec is made of a directory part and a pattern part. * Returns the pointer to the first character of the pattern part ****************/ /****************UNIX: * Returns the pointer to the character following the '/' of the name segment * which contains a wildcard or which is not followed by a '/'. ****************/ { char * lookAheadPtr = fileSpec; char * maskPtr; Boolean hasWildcards; char prevChar; char prev2Char ; /* Stop at final name segment or if wildcards were found. */ do { maskPtr = lookAheadPtr; hasWildcards = FALSE; prevChar = '\0'; prev2Char = '\0'; while ((*lookAheadPtr != '/') && !hasWildcards && *lookAheadPtr) { switch (*lookAheadPtr) { case '*': case '?': case '[': if ((prevChar != '\\') || (prev2Char == '\\')) { hasWildcards = TRUE; break; } } prev2Char = prevChar; prevChar = *lookAheadPtr; #ifndef NO_MULTIBYTE lookAheadPtr += ((MB_CUR_MAX > 1) ? abs(mblen(lookAheadPtr, MB_CUR_MAX)) : 1); #else lookAheadPtr++; #endif } } while (!hasWildcards && *lookAheadPtr++); if (*maskPtr == '/') ++maskPtr; return(maskPtr); } /****************************************************************/ void _XmOSQualifyFileSpec(String dirSpec, String filterSpec, String *pQualifiedDir, /* Cannot be NULL.*/ String *pQualifiedPattern) /* Cannot be NULL.*/ /************GENERAL: * dirSpec, filterSpec can contain relative or logical reference. * dirSpec cannot contain pattern characters. * if filterSpec does not specify all for its last segment, a pattern * for 'all' is added. * Use GetQualifiedDir() for dirSpec. ****************/ /************UNIX: * 'all' is '*' and '/' is the delimiter. ****************/ { int filterLen; int dirLen; char *fSpec; char *remFSpec; char *maskPtr; char *dSpec; char *dPtr; if (!dirSpec) dirSpec = ""; if (!filterSpec) filterSpec = ""; filterLen = strlen(filterSpec); /* Allocate extra for NULL character and for the appended '*' (as needed). */ fSpec = XtMalloc(filterLen + 2); strcpy(fSpec, filterSpec); /* If fSpec ends with a '/' or is a null string, add '*' since this is * the interpretation. */ if (!filterLen || (fSpec[filterLen - 1] == '/')) { fSpec[filterLen] = '*'; fSpec[filterLen + 1] = '\0'; } /* Some parts of fSpec may be copied to dSpec, so allocate "filterLen" * extra, plus some for added literals. */ dirLen = strlen(dirSpec); dSpec = XtMalloc(filterLen + dirLen + 4); strcpy(dSpec, dirSpec); dPtr = dSpec + dirLen; /* Check for cases when the specified filter overrides anything * in the dirSpec. */ remFSpec = fSpec; switch(*fSpec) { case '/': dSpec[0] = '/'; dSpec[1] = '\0'; dPtr = dSpec + 1; ++remFSpec; break; case '~': dPtr = dSpec; while ((*dPtr = *remFSpec) && (*remFSpec++ != '/')) ++dPtr; *dPtr = '\0'; break; } /* If directory spec. is not null, then make sure that it has a * trailing '/', to be prepared for appending from filter spec. */ if (*dSpec && (*(dPtr - 1) != '/')) { *dPtr++ = '/'; *dPtr = '\0'; } maskPtr = _XmOSFindPatternPart(remFSpec); if (maskPtr != remFSpec) { do { *dPtr++ = *remFSpec++; } while (remFSpec != maskPtr); *dPtr = '\0'; } if (remFSpec != fSpec) { /* Shift remaining filter spec. to the beginning of the buffer. */ remFSpec = fSpec; while ((*remFSpec++ = *maskPtr++) != '\0') /*EMPTY*/; } *pQualifiedDir = GetQualifiedDir(dSpec); *pQualifiedPattern = fSpec; XtFree(dSpec); } /****************************************************************/ static String GetFixedMatchPattern(String pattern) /**********GENERAL: * The pattern parameter is converted to the format required of the * the regular expression library routines. * Memory is allocated and returned with the result. This memory * should eventually be freed by a call to XtFree(). ****************/ /**********UNIX: * '/' is used as a delimiter for the pattern. ****************/ { register char *bufPtr; char *outputBuf; char lastchar = '\0'; int len; outputBuf = XtCalloc(2, strlen(pattern) + 4); bufPtr = outputBuf; *bufPtr++ = '^'; #ifndef NO_MULTIBYTE while ((len = mblen(pattern, MB_CUR_MAX)) > 0) #else while ((len = *pattern ? 1 : 0)) #endif { if (len <= 1) { if (*pattern == '/') break; if (lastchar == '\\') *bufPtr++ = *pattern; else { switch(*pattern) { case '.': *bufPtr++ = '\\'; *bufPtr++ = '.'; break; case '?': *bufPtr++ = '.'; break; case '*': *bufPtr++ = '.'; *bufPtr++ = '*'; break; default: *bufPtr++ = *pattern; break; } } lastchar = *pattern; ++pattern; } else { strncpy(bufPtr, pattern, len); bufPtr += len; pattern += len; lastchar = '\0'; } } *bufPtr++ = '$'; *bufPtr = '\0'; return outputBuf; } /****************************************************************/ void _XmOSGetDirEntries(String qualifiedDir, String matchPattern, #if NeedWidePrototypes unsigned int fileType, int matchDotsLiterally, int listWithFullPath, #else unsigned char fileType, Boolean matchDotsLiterally, Boolean listWithFullPath, #endif /* NeedWidePrototypes */ String * * pEntries, /* Cannot be NULL. */ unsigned int * pNumEntries, /* Cannot be NULL. */ unsigned int * pNumAlloc) /* Cannot be NULL. */ /***********GENERAL: * This routine opens the specified directory and builds a buffer containing * a series of strings containing the full path of each file in the directory * The memory allocated should eventually be freed using XtFree. * The 'qualifiedDir' parameter must be a fully qualified directory path * The matchPattern parameter must be in the proper form for a regular * expression parsing. * If the location pointed to by pEntries is NULL, this routine allocates * and returns a list to *pEntries, though the list may have no entries. * pEntries, pEndIndex, pNumAlloc are updated as required for memory * management. ****************/ /***********UNIX: * Fully qualified directory means begins with '/', does not have * embedded "." or "..", but does not need trailing '/'. * Regular expression parsing is regcmp or re_comp. * Directory entries are also Unix dependent. ****************/ { char * fixedMatchPattern; String entryPtr; DIR * dirStream = NULL; struct stat statBuf; Boolean entryTypeOK; unsigned int dirLen = strlen(qualifiedDir); Boolean useCache = FALSE; Boolean loadCache = FALSE; unsigned readCacheIndex = 0; unsigned char dirFileType = 0; #ifndef NO_REGCOMP regex_t preg; int comp_status = 0; #elif !defined(NO_REGEX) char * compiledRE = NULL; #endif /* NO_REGCOMP */ /****************/ _XmProcessLock(); if (!*pEntries) { *pNumEntries = 0; *pNumAlloc = FILE_LIST_BLOCK; *pEntries = (String *) XtMalloc(FILE_LIST_BLOCK * sizeof(char *)); } fixedMatchPattern = GetFixedMatchPattern(matchPattern); if (fixedMatchPattern) { if (!*fixedMatchPattern) { XtFree(fixedMatchPattern); fixedMatchPattern = NULL; } else { #ifndef NO_REGCOMP comp_status = regcomp(&preg, fixedMatchPattern, REG_NOSUB); if (comp_status) #elif !defined(NO_REGEX) compiledRE = (char *)regcmp(fixedMatchPattern, (char *) NULL); if (!compiledRE) #else if (re_comp(fixedMatchPattern)) #endif { XtFree(fixedMatchPattern); fixedMatchPattern = NULL; } } } if ((dirCacheName != NULL) && !strcmp(qualifiedDir, dirCacheName)) { useCache = TRUE; readCacheIndex = 0; } else { if (!strcmp(matchPattern, "*") && (fileType == XmFILE_DIRECTORY) && !matchDotsLiterally) { /* This test is a incestual way of knowing that we are searching * a directory to fill the directory list. We can thereby conclude * that a subsequent call will be made to search the same directory * to fill the file list. Since a "stat" of every file is very * performance-expensive, we will cache the directory used for * a directory list search and subsequently use the results for * the file list search. */ loadCache = TRUE; } dirStream = opendir(qualifiedDir); } if (dirStream || useCache) { unsigned loopCount = 0; _Xreaddirparams dirEntryBuf; if (loadCache) ResetCache(qualifiedDir); /* The POSIX specification for the "readdir" routine makes * it OPTIONAL to return the "." and ".." entries in a * directory. The algorithm used here depends on these * entries being included in the directory list. So, we * will first handle "." and ".." explicitly, then ignore * them later if they happen to be returned by "readdir". */ while (TRUE) { char *dirName; unsigned dirNameLen = 0; if (loopCount < 2) { if (loopCount == 0) { /* Do current directory the first time through. */ dirName = "."; dirNameLen = 1; } else { /* Do parent directory the second time through. */ dirName = ".."; dirNameLen = 2; } ++loopCount; if (useCache || loadCache) dirFileType = XmFILE_DIRECTORY; } else { struct dirent * dirEntry; do { if (useCache) { if (readCacheIndex == numCacheEntries) { dirName = NULL; break; } else { dirFileType = dirCache[readCacheIndex]->type; dirName = dirCache[readCacheIndex++]->file_name; dirNameLen = strlen(dirName); } } else { if ((dirEntry = _XReaddir(dirStream, dirEntryBuf)) == NULL) { dirName = NULL; break; } dirName = dirEntry->d_name; dirNameLen = strlen(dirName); if (loadCache) dirFileType = AddEntryToCache(dirName, dirNameLen); } /* Check to see if directory entry is "." or "..", * since these have already been processed. * So if/when readdir returns these directories, * we just ignore them. */ } while (((dirNameLen == 1) && (dirName[0] == '.')) || ((dirNameLen == 2) && (dirName[0] == '.') && (dirName[1] == '.'))); if (dirName == NULL) break; /* Exit from outer loop. */ } if (fixedMatchPattern) { #ifndef NO_REGCOMP if (regexec(&preg, dirName, 0, NULL, 0)) #else /* NO_REGCOMP */ # ifndef NO_REGEX if (!regex(compiledRE, dirName)) # else if (!re_exec(dirName)) # endif #endif /* NO_REGCOMP */ continue; } if (matchDotsLiterally && (dirName[0] == '.') && (*matchPattern != '.')) continue; if (*pNumEntries == *pNumAlloc) { *pNumAlloc += FILE_LIST_BLOCK; *pEntries = (String *) XtRealloc((char*) *pEntries, (*pNumAlloc* sizeof(char *))); } entryPtr = XtMalloc(dirNameLen + dirLen + 1); strcpy(entryPtr, qualifiedDir); strcpy(&entryPtr[dirLen], dirName); /* Now screen entry according to type. */ entryTypeOK = FALSE; if (fileType == XmFILE_ANY_TYPE) { entryTypeOK = TRUE; } else if (useCache || loadCache) { if (dirFileType == fileType) entryTypeOK = TRUE; } else { if (!stat(entryPtr, &statBuf)) { switch (fileType) { case XmFILE_REGULAR: if (S_ISREG(statBuf.st_mode)) entryTypeOK = TRUE; break; case XmFILE_DIRECTORY: if (S_ISDIR(statBuf.st_mode)) entryTypeOK = TRUE; break; } } } if (entryTypeOK) { if (listWithFullPath) { (*pEntries)[(*pNumEntries)++] = entryPtr; } else { /* This is ONLY for BC in a (apparently unused) API, (w/o * full path) so don't worry too much about efficiency. */ XtFree(entryPtr); entryPtr = XtMalloc(dirNameLen + 1); strcpy(entryPtr, dirName); (*pEntries)[(*pNumEntries)++] = entryPtr; } } else XtFree(entryPtr); } if (!useCache) closedir(dirStream); } #ifndef NO_REGCOMP if (!comp_status) regfree(&preg); #else /* NO_REGCOMP */ # ifndef NO_REGEX if (compiledRE) { /* Use free instead of XtFree since malloc is inside of regex(). */ free(compiledRE); } # endif #endif /* NO_REGCOMP */ XtFree(fixedMatchPattern); if (!loadCache) FreeDirCache(); _XmProcessUnlock(); } /**************************************************************** * _XmOSBuildFileList: * * GENERAL: * The 'dirPath' parameter must be a qualified directory path. * The 'pattern' parameter must be valid as a suffix to dirPath. * typeMask is an Xm constant coming from Xm.h. * * UNIX: * Qualified directory path means no match characters, with '/' * at end. ****************************************************************/ void _XmOSBuildFileList(String dirPath, String pattern, #if NeedWidePrototypes unsigned int typeMask, #else unsigned char typeMask, #endif /* NeedWidePrototypes */ String * * pEntries, /* Cannot be NULL. */ unsigned int * pNumEntries, /* Cannot be NULL. */ unsigned int * pNumAlloc) /* Cannot be NULL. */ { String qualifiedDir; String nextPatternPtr; String * localEntries; unsigned int localNumEntries; unsigned int localNumAlloc; unsigned int entryIndex; qualifiedDir = GetQualifiedDir(dirPath); nextPatternPtr = pattern; while (*nextPatternPtr && (*nextPatternPtr != '/')) ++nextPatternPtr; if (!*nextPatternPtr) { /* At lowest level directory, so simply return matching entries.*/ _XmOSGetDirEntries(qualifiedDir, pattern, typeMask, FALSE, TRUE, pEntries, pNumEntries, pNumAlloc); } else { ++nextPatternPtr; /* Move past '/' character.*/ localEntries = NULL; _XmOSGetDirEntries(qualifiedDir, pattern, XmFILE_DIRECTORY, TRUE, TRUE, &localEntries, &localNumEntries, &localNumAlloc); entryIndex = 0; while (entryIndex < localNumEntries) { _XmOSBuildFileList(localEntries[entryIndex], nextPatternPtr, typeMask, pEntries, pNumEntries, pNumAlloc); XtFree(localEntries[entryIndex]); ++entryIndex; } XtFree((char*)localEntries); } XtFree(qualifiedDir); } /**************************************************************** * GENERAL: * The routine must return an integer less than, equal to, or * greater than 0 according as the first argument is to be * considered less than, equal to, or greater than the second. ****************************************************************/ int _XmOSFileCompare(XmConst void *sp1, XmConst void *sp2) { return strcmp(*((XmConst String *) sp1), *((XmConst String *) sp2)); } /************************************************************************* * * Path code, used in Mwm and Xm. * Returned pointer should not be freed! * *************************************************************************/ String XmeGetHomeDirName(void) { uid_t uid; _Xgetpwparams pwd_buf; struct passwd * pwd_value; char *ptr = NULL; static char empty = '\0'; static char *homeDir = NULL; _XmProcessLock(); if (homeDir == NULL) { if ((ptr = (char *)getenv("HOME")) == NULL) { if ((ptr = (char *)getenv(USER_VAR)) != NULL) pwd_value = _XGetpwnam(ptr, pwd_buf); else { uid = getuid(); pwd_value = _XGetpwuid(uid, pwd_buf); } if (pwd_value != NULL) ptr = pwd_value->pw_dir; else ptr = NULL; } if (ptr != NULL) { homeDir = XtMalloc (strlen(ptr) + 1); strcpy (homeDir, ptr); } else { homeDir = ∅ } } _XmProcessUnlock(); return homeDir; } #ifndef LIBDIR #define LIBDIR "/usr/lib/X11" #endif #ifndef INCDIR #define INCDIR "/usr/include/X11" #endif static XmConst char libdir[] = LIBDIR; static XmConst char incdir[] = INCDIR; /************************************************************************* * * When the locale contains a codeset, the Toolkit's default path fail * to search for the directory with only language and territory. * * For example, when locale is "zh_TW.dechanyu", directories searched * should be : * * 1. zh_TW.dechanyu (%L) * 2. zh_TW (%l_%t) * 3. zh (%l) * *************************************************************************/ static XmConst char XAPPLRES_DEFAULT[] = "\ %%P\ %%S:\ %s/%%L/%%T/%%N/%%P\ %%S:\ %s/%%l_%%t/%%T/%%N/%%P\ %%S:\ %s/%%l/%%T/%%N/%%P\ %%S:\ %s/%%T/%%N/%%P\ %%S:\ %s/%%L/%%T/%%P\ %%S:\ %s/%%l_%%t/%%T/%%P\ %%S:\ %s/%%l/%%T/%%P\ %%S:\ %s/%%T/%%P\ %%S:\ %s/%%T/%%P\ %%S:\ %s/%%P\ %%S:\ %s/%%L/%%T/%%N/%%P\ %%S:\ %s/%%l_%%t/%%T/%%N/%%P\ %%S:\ %s/%%l/%%T/%%N/%%P\ %%S:\ %s/%%T/%%N/%%P\ %%S:\ %s/%%L/%%T/%%P\ %%S:\ %s/%%l_%%t/%%T/%%P\ %%S:\ %s/%%l/%%T/%%P\ %%S:\ %s/%%T/%%P\ %%S:\ %s/%%T/%%P\ %%S"; static XmConst char PATH_DEFAULT[] = "\ %%P\ %%S:\ %s/%%L/%%T/%%N/%%P\ %%S:\ %s/%%l_%%t/%%T/%%N/%%P\ %%S:\ %s/%%l/%%T/%%N/%%P\ %%S:\ %s/%%T/%%N/%%P\ %%S:\ %s/%%L/%%T/%%P\ %%S:\ %s/%%l_%%t/%%T/%%P\ %%S:\ %s/%%l/%%T/%%P\ %%S:\ %s/%%T/%%P\ %%S:\ %s/%%P\ %%S:\ %s/%%L/%%T/%%N/%%P\ %%S:\ %s/%%l_%%t/%%T/%%N/%%P\ %%S:\ %s/%%l/%%T/%%N/%%P\ %%S:\ %s/%%T/%%N/%%P\ %%S:\ %s/%%L/%%T/%%P\ %%S:\ %s/%%l_%%t/%%T/%%P\ %%S:\ %s/%%l/%%T/%%P\ %%S:\ %s/%%T/%%P\ %%S:\ %s/%%T/%%P\ %%S"; static XmConst char ABSOLUTE_PATH[] = "\ %P\ %S"; /* * buf must be of length MAX_DIR_PATH_LEN */ static String GetCurrentDir(String buf) { String pwd = getenv ("PWD"); struct stat stat1, stat2; if (pwd && stat (pwd, &stat1) == 0 && stat (".", &stat2) == 0 && stat1.st_dev == stat2.st_dev && stat1.st_ino == stat2.st_ino) { /* Use PWD environment variable */ strcpy(buf, pwd); return pwd ; } return getcwd(buf, MAX_DIR_PATH_LEN) ; } #ifdef notdef /* old way */ String pwd = NULL; if ((pwd = getenv("PWD")) != NULL) strcpy(buf, pwd); if (!pwd) pwd = getcwd(buf, MAX_DIR_PATH_LEN) return pwd ; #endif /* * buf must be of length MAX_DIR_PATH_LEN */ Boolean _XmOSAbsolutePathName(String path, String *pathRtn, String buf) { Boolean doubleDot = False; *pathRtn = path; if (path[0] == '/') return True; if (path[0] == '.') { if (path[1] == '/') doubleDot = False; else if ((path[1] == '.') && (path[2] == '/')) doubleDot = True; if (GetCurrentDir(buf) != NULL) { if (doubleDot) { String filePart, suffixPart; _XmOSFindPathParts(buf, &filePart, &suffixPart); (void) strcpy(filePart, &path[2]); } else { (void) strcat(buf, &path[1]); } *pathRtn = buf; return True; } else { XmeWarning(NULL, "Cannot find current dir"); return True; } } return False; } String _XmOSInitPath(String file_name, String env_pathname, Boolean *user_path) { String path; String old_path; char stackString[MAX_DIR_PATH_LEN]; String homedir = stackString ; String local_path; *user_path = False; if (file_name && _XmOSAbsolutePathName(file_name, &file_name, homedir)) { path = XtNewString(ABSOLUTE_PATH); } else { local_path = (char *)getenv (env_pathname); if (local_path == NULL) { homedir = XmeGetHomeDirName(); old_path = (char *)getenv ("XAPPLRESDIR"); if (old_path == NULL) { path = XtCalloc(1, (9*strlen(homedir) + strlen(PATH_DEFAULT) + 8*strlen(libdir) + strlen(incdir) + 1)); sprintf(path, PATH_DEFAULT, homedir, homedir, homedir, homedir, homedir, homedir, homedir, homedir, homedir, libdir, libdir, libdir, libdir, libdir, libdir, libdir, libdir, incdir); } else { path = XtCalloc(1, (8*strlen(old_path) + 2*strlen(homedir) + strlen(XAPPLRES_DEFAULT) + 8*strlen(libdir) + strlen(incdir) + 1)); sprintf(path, XAPPLRES_DEFAULT, old_path, old_path, old_path, old_path, old_path, old_path, old_path, old_path, homedir, homedir, libdir, libdir, libdir, libdir, libdir, libdir, libdir, libdir, incdir); } } else { path = XtMalloc(strlen(local_path) + 1); strcpy (path, local_path); *user_path = True; } } return path; } int XmeMicroSleep(long usecs) { struct timeval timeoutVal; /* split the micro seconds in seconds and remainder */ timeoutVal.tv_sec = usecs/1000000; timeoutVal.tv_usec = usecs - timeoutVal.tv_sec*1000000; return Select(0, NULL, NULL, NULL, &timeoutVal); } /************************************************************************ * * XmeGetLocalizedString Map an X11 R5 XPCS string in a locale * sensitive XmString. * * reserved Reserved for future use. * widget The widget id. * resource The resource name. * string The input 8859-1 value. * ************************************************************************/ /*ARGSUSED*/ XmString XmeGetLocalizedString(char *reserved, /* unused */ Widget widget, /* unused */ char *resource, /* unused */ String string) { return XmStringCreateLocalized(string); } /************************************************************************ * * * _XmOSBuildFileName * * * * Build an absolute file name from a directory and file. * * Handle case where 'file' is already absolute. * * Return value should be freed by XtFree() * * * ************************************************************************/ String _XmOSBuildFileName(String path, String file) { String fileName; if (file[0] == '/') { fileName = XtMalloc (strlen (file) + 1); strcpy (fileName, file); } else { fileName = XtMalloc (strlen(path) + strlen (file) + 2); strcpy (fileName, path); strcat (fileName, "/"); strcat (fileName, file); } return fileName; } /************************************************************ * * return poiinter to the file and the suffix * /usr/foo/bar.xpm returns &"bar.xpm" and &"xpm" * ************************************************************/ void _XmOSFindPathParts(String path, String *filenameRtn, String *suffixRtn) { String filename = path, suffix = NULL; String s; /* * maybe a problem for I18N - probably: filenames may be multibyte!!! */ #define FILESEP '/' #define SUFFIXSEP '.' s = path; while (*s) { if (*s == FILESEP) { filename = s++; } else if (*s == SUFFIXSEP) { suffix = s++; } else s++; } if (suffix < filename) suffix = NULL; if ((*filenameRtn = filename) != NULL) { if (filename != path) (*filenameRtn)++; } if ((*suffixRtn = suffix) != NULL) (*suffixRtn)++; } /************************************************************ * * Add _m to the imageName: * transform /usr/foo/bar.xpm in /usr/foo/bar_m.xpm * or joe in joe_m * ************************************************************/ void _XmOSGenerateMaskName( String imageName, String maskNameBuf) { String file, suffix; int len; _XmOSFindPathParts(imageName, &file, &suffix); if (suffix) { len = (int)(suffix - imageName) - 1; /* point before the '.' */ suffix--; } else len = strlen(imageName); strncpy(maskNameBuf, imageName, len); maskNameBuf += len; strcpy(maskNameBuf, "_m"); if (suffix) strcpy(maskNameBuf+2, suffix); else maskNameBuf[2] = '\0'; } /*ARGSUSED*/ Status _XmOSGetInitialCharsDirection(XtPointer characters, XmTextType type, XmStringTag locale, /* unused */ unsigned int *num_bytes, XmDirection *direction) { /* ??? This is a temporary stub implementation. */ switch (type) { case XmWIDECHAR_TEXT: *num_bytes = Wcslen((wchar_t*) characters) * sizeof(wchar_t); *direction = XmLEFT_TO_RIGHT; return Success; case XmCHARSET_TEXT: case XmMULTIBYTE_TEXT: *num_bytes = strlen((char*) characters); *direction = XmLEFT_TO_RIGHT; return Success; default: *num_bytes = 0; *direction = XmDEFAULT_DIRECTION; return ~Success; } } /*ARGSUSED*/ XmDirection _XmOSGetCharDirection(XtPointer character, /* unused */ XmTextType type, XmStringTag locale) /* unused */ { /* ??? This is a temporary stub implementation. */ switch (type) { case XmWIDECHAR_TEXT: case XmCHARSET_TEXT: case XmMULTIBYTE_TEXT: return XmLEFT_TO_RIGHT; default: return XmDEFAULT_DIRECTION; } } static int Wcslen(wchar_t *wcs) { /* Count characters, not bytes. */ wchar_t *ptr = wcs; if (ptr != NULL) while (*ptr++) /*EMPTY*/; return (ptr - wcs); } typedef struct XmOSMethodEntryRec { String method_id; XtPointer method; XtPointer os_data; XtPointer reserved; /* for future use - fonts & such?*/ } XmOSMethodEntry; static XmOSMethodEntry method_table[] = { { XmMCharDirection, (XtPointer)_XmOSGetCharDirection, NULL, NULL }, { XmMInitialCharsDirection, (XtPointer)_XmOSGetInitialCharsDirection, NULL, NULL }, { NULL, NULL, NULL, NULL} }; /**************************************************************** * XmOSGetMethod: * get the function that implements the requested method. ****************************************************************/ /*ARGSUSED*/ XmOSMethodStatus XmOSGetMethod(Widget w, /* unused */ String method_id, XtPointer *method, XtPointer *os_data) { int i; if (method == NULL) return XmOS_METHOD_NULL; for (i = 0; method_table[i].method_id; i++) if (method_id == method_table[i].method_id) { if (*method == NULL || (method_table[i].method != NULL && *method != method_table[i].method)) { *method = method_table[i].method; if (os_data) *os_data = method_table[i].os_data; return XmOS_METHOD_REPLACED; } else { if (os_data) *os_data = method_table[i].os_data; return XmOS_METHOD_DEFAULTED; } } for (i = 0; method_table[i].method_id; i++) if (strcmp(method_id, method_table[i].method_id) == 0) { if (*method == NULL || (method_table[i].method != NULL && *method != method_table[i].method)) { *method = method_table[i].method; if (os_data) *os_data = method_table[i].os_data; return XmOS_METHOD_REPLACED; } else { if (os_data) *os_data = method_table[i].os_data; return XmOS_METHOD_DEFAULTED; } } return XmOS_METHOD_DEFAULTED; } /* * This routine is used by Label (and LabelG) to determine which * character in the label string matches the Mnemonic keysym, and * thus should be underlined. * * Parameters: * keysym - Specifies the keysym to be converted. * locale - Specifies the locale to convert into. NULL => current locale. * buffer - A buffer allocated by the caller to hold the (at most one) * multibyte character that corresponds to the keysym. * * Return value: * The number of bytes written into the buffer. */ /*ARGSUSED*/ int _XmOSKeySymToCharacter(KeySym keysym, char *locale, char *buffer) { /* * This implementation is exceptionally stupid, but works in the * common case of ISO8859-1 locales and keysyms. * * Vendors who use more exotic encodings (e.g. roman8) should * replace this code with something appropriate. */ /* Maybe we should generate a warning for non-Latin 1 encodings */ /* outside the range 0..127? */ *buffer = (keysym & 0xFF); return 1; } /* ****************************************************** ** ** Threading stuff. Stuck here to allow easier debugging. ** ****************************************************** */ /* static unsigned int _lockCounter = 0; static unsigned int _unlockCounter = 0; static int _outstandingLockCounter = 0; int _debugProcessLocking = 0; void _XmProcessLock() { _lockCounter++; _outstandingLockCounter++; #if defined(XTHREADS) && defined(XUSE_MTSAFE_API) XtProcessLock(); #endif if(_debugProcessLocking) { fprintf(stderr, "File: %s, line: %d - _XmProcessLock() - _lockCounter = %d, _outstandingLockCounter = %d\n", __FILE__, __LINE__, _lockCounter, _outstandingLockCounter); } } void _XmProcessUnlock() { _unlockCounter++; _outstandingLockCounter--; #if defined(XTHREADS) && defined(XUSE_MTSAFE_API) XtProcessUnlock(); #endif if(_debugProcessLocking) { fprintf(stderr, "File: %s, line: %d - _XmProcessUnlock() - _unlockCounter = %d, _outstandingLockCounter = %d\n", __FILE__, __LINE__, _unlockCounter, _outstandingLockCounter); } } */ motif-2.3.8/lib/Xm/MapEvents.c0000644000175000017500000005414213145162623012774 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MapEvents.c /main/12 1995/09/19 23:05:22 cde-sun $" #endif #endif #include #include #include #include #include #include "XmI.h" #include "MapEventsI.h" typedef String (*XmEventParseProc)(String str, unsigned int closure, unsigned long *detail, Boolean *status); typedef struct { XmConst char *event; XrmQuark signature; int eventType; XmEventParseProc parseProc; unsigned int closure; } EventKey; /******** Static Function Declarations ********/ static int StrToHex( String str) ; static int StrToOct( String str) ; static int StrToNum( String str) ; static void FillInQuarks( EventKey *table) ; static Boolean LookupModifier( String name, Modifiers *valueP) ; static String ScanAlphanumeric( register String str) ; static String ScanWhitespace( register String str) ; static String ParseImmed( String str, unsigned int closure, unsigned long *detail, Boolean *status) ; static String ParseKeySym( String str, unsigned int closure, unsigned long *detail, Boolean *status) ; static String ParseModifiers( register String str, Modifiers *modifiers, Boolean *status) ; static String ParseEventType( register String str, EventKey *table, int *eventType, Cardinal *_index, Boolean *status) ; static String _MapEvent( register String str, EventKey *table, int *eventType, unsigned long *detail, Modifiers *modifiers, Boolean *status) ; /******** End Static Function Declarations ********/ static EventKey modifierStrings[] = { /* Modifier, Quark, Mask */ {"None", NULLQUARK, 0, NULL, None}, {"Shift", NULLQUARK, 0, NULL, ShiftMask}, {"Lock", NULLQUARK, 0, NULL, LockMask}, {"Ctrl", NULLQUARK, 0, NULL, ControlMask}, {"Meta", NULLQUARK, 0, NULL, Mod1Mask}, {"Alt", NULLQUARK, 0, NULL, Mod1Mask}, {"Mod1", NULLQUARK, 0, NULL, Mod1Mask}, {"Mod2", NULLQUARK, 0, NULL, Mod2Mask}, {"Mod3", NULLQUARK, 0, NULL, Mod3Mask}, {"Mod4", NULLQUARK, 0, NULL, Mod4Mask}, {"Mod5", NULLQUARK, 0, NULL, Mod5Mask}, {NULL, NULLQUARK, 0, NULL, 0}}; static EventKey buttonEvents[] = { /* Event Name, Quark, Event Type, DetailProc, Closure */ {"Btn1Down", NULLQUARK, ButtonPress, ParseImmed, Button1}, {"Button1", NULLQUARK, ButtonPress, ParseImmed, Button1}, {"Btn1", NULLQUARK, ButtonPress, ParseImmed, Button1}, {"Btn2Down", NULLQUARK, ButtonPress, ParseImmed, Button2}, {"Button2", NULLQUARK, ButtonPress, ParseImmed, Button2}, {"Btn2", NULLQUARK, ButtonPress, ParseImmed, Button2}, {"Btn3Down", NULLQUARK, ButtonPress, ParseImmed, Button3}, {"Button3", NULLQUARK, ButtonPress, ParseImmed, Button3}, {"Btn3", NULLQUARK, ButtonPress, ParseImmed, Button3}, {"Btn4Down", NULLQUARK, ButtonPress, ParseImmed, Button4}, {"Button4", NULLQUARK, ButtonPress, ParseImmed, Button4}, {"Btn4", NULLQUARK, ButtonPress, ParseImmed, Button4}, {"Btn5Down", NULLQUARK, ButtonPress, ParseImmed, Button5}, {"Button5", NULLQUARK, ButtonPress, ParseImmed, Button5}, {"Btn5", NULLQUARK, ButtonPress, ParseImmed, Button5}, {NULL, NULLQUARK, 0, NULL, 0}}; static EventKey keyEvents[] = { /* Event Name, Quark, Event Type, DetailProc Closure */ {"KeyPress", NULLQUARK, KeyPress, ParseKeySym, 0}, {"Key", NULLQUARK, KeyPress, ParseKeySym, 0}, {"KeyDown", NULLQUARK, KeyPress, ParseKeySym, 0}, {"KeyUp", NULLQUARK, KeyRelease, ParseKeySym, 0}, {"KeyRelease", NULLQUARK, KeyRelease, ParseKeySym, 0}, {NULL, NULLQUARK, 0, NULL, 0}}; static XmConst Modifiers buttonModifierMasks[] = { 0, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask }; static Boolean initialized = FALSE; /*************************************<->************************************* * * Numeric convertion routines * * Description: * ----------- * StrToHex = Parse an ASCII string as a hexadecimal integer. * StrToOct = Parse an ASCII string as an octal integer. * StrToNum = Parse an ASCII string as a hex, octal or decimal integer * based on leading "0", "0x", or "0X" characters. * * * Inputs: * ------ * str = A null-terminated span of digits. * StrToNum handles C prefix conventions (0d = octal, 0xd = hex), * but no other non-digits are allowed. * * Outputs: * ------- * Returns -1 if conversion fails, otherwise the numeric value. * Empty strings convert to 0. * * Procedures Called * ----------------- * None. * *************************************<->***********************************/ static int StrToHex( String str ) { register char c; register int val = 0; while ((c = *str) != '\0') { if ('0' <= c && c <= '9') val = val*16+c-'0'; else if ('a' <= c && c <= 'f') val = val*16+c-'a'+10; else if ('A' <= c && c <= 'F') val = val*16+c-'A'+10; else return -1; str++; } return val; } static int StrToOct( String str ) { register char c; register int val = 0; while ((c = *str) != '\0') { if ('0' <= c && c <= '7') val = val*8+c-'0'; else return -1; str++; } return val; } static int StrToNum( String str ) { register char c; register int val = 0; if (*str == '0') { str++; if (*str == 'x' || *str == 'X') return StrToHex(++str); else return StrToOct(str); } while ((c = *str) != '\0') { if ('0' <= c && c <= '9') val = val*10+c-'0'; else return -1; str++; } return val; } /*************************************<->************************************* * * FillInQuarks (EventKey *table) * * Description: * ----------- * Converts each string entry in the modifier/event tables to a * quark, thus facilitating faster comparisons. * * * Inputs: * ------ * table[*].event = strings to be converted (NULL at end of table). * * Outputs: * ------- * table[*].signature = quarks for each string. * * Procedures Called * ----------------- * XrmStringToQuark. * *************************************<->***********************************/ static void FillInQuarks( EventKey *table ) { register int i; for (i=0; table[i].event; i++) table[i].signature = XrmPermStringToQuark(table[i].event); } /*************************************<->************************************* * * LookupModifier (name, *valueP) * * Description: * ----------- * Compare the passed in string to the list of valid modifiers. * * * Inputs: * ------ * name = string to be located in the global modiferStrings table. * (modiferStrings = global table of valid modifiers). * * Outputs: * ------- * *valueP = closure of modifierString with a matching signature. * Return value indicates whether a match was found. * * Procedures Called * ----------------- * XrmStringToQuark. * *************************************<->***********************************/ static Boolean LookupModifier( String name, Modifiers *valueP ) { register int i; register XrmQuark signature = XrmStringToQuark(name); for (i=0; modifierStrings[i].event != NULL; i++) if (modifierStrings[i].signature == signature) { *valueP = modifierStrings[i].closure; return TRUE; } return FALSE; } /*************************************<->************************************* * * ScanAlphanumeric (String str) * * Description: * ----------- * Scan string until a non-alphanumeric character is encountered. * * * Inputs: * ------ * str = string to be scanned. * * Outputs: * ------- * Return value points to the first non-alphanumeric character in str. * * Procedures Called * ----------------- * *************************************<->***********************************/ static String ScanAlphanumeric( register String str ) { while ( ('A' <= *str && *str <= 'Z') || ('a' <= *str && *str <= 'z') || ('0' <= *str && *str <= '9')) str++; return str; } /*************************************<->************************************* * * ScanWhitespace (String str) * * Description: * ----------- * Scan the string, skipping over all white space characters. * Whitespace is defined as tab or space. * * * Inputs: * ------ * str = the string to be scanned. * * Outputs: * ------- * Return value points to the first non-whitespace character in str. * * Procedures Called * ----------------- * *************************************<->***********************************/ static String ScanWhitespace( register String str ) { while (*str == ' ' || *str == '\t') str++; return str; } /*************************************<->************************************* * * ParseImmed * * Description: * ----------- * An XmEventParseProc. Copy closure into detail. * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ /* ARGSUSED */ static String ParseImmed( String str, unsigned int closure, unsigned long *detail, Boolean *status) { *detail = closure; *status = TRUE; return str; } /*************************************<->************************************* * * ParseKeySym (parameters) * * Description: * ----------- * An XmeventParseProc. * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ /* ARGSUSED */ static String ParseKeySym( String str, unsigned int closure, unsigned long *detail, Boolean *status) { char keySymName[100]; char *start = str; /* Initialize the return values. */ *detail = NoSymbol; *status = FALSE; str = ScanWhitespace(str); if (*str == '\\') { /* "\x"; interpret "x" as a Keysym. */ str++; keySymName[0] = *str++; keySymName[1] = '\0'; *detail = XStringToKeysym(keySymName); } else if (*str == ',' || *str == ':') { /* No detail; return a failure */ return str; } else { while (*str != ',' && *str != ':' && *str != ' ' && *str != '\t' && *str != '\n' && *str != '\0') str++; (void) strncpy(keySymName, start, str-start); keySymName[str-start] = '\0'; *detail = XStringToKeysym(keySymName); } if (*detail == NoSymbol) { if (( '0' <= keySymName[0]) && (keySymName[0] <= '9')) { int retval = StrToNum(keySymName); if (-1 == retval) { *detail = 0; return str; } else { *detail = retval; *status = TRUE; return str; } } return str; } else { *status = TRUE; return str; } } /*************************************<->************************************* * * ParseModifiers (parameters) * * Description: * ----------- * Parse the string, extracting all modifier specifications. * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ static String ParseModifiers( register String str, Modifiers *modifiers, Boolean *status ) { register String start; char modStr[100]; Boolean notFlag; Modifiers maskBit; /* Initially assume all is going to go well */ *status = TRUE; *modifiers = 0; /* Attempt to parse the first button modifier */ str = ScanWhitespace(str); start = str; str = ScanAlphanumeric(str); if (start != str) { (void) strncpy(modStr, start, str-start); modStr[str-start] = '\0'; if (LookupModifier(modStr, &maskBit)) { if (maskBit== None) { *modifiers = 0; str = ScanWhitespace(str); return str; } } str = start; } /* Keep parsing modifiers, until the event specifier is encountered */ while ((*str != '<') && (*str != '\0')) { if (*str == '~') { notFlag = TRUE; str++; } else notFlag = FALSE; start = str; str = ScanAlphanumeric(str); if (start == str) { /* ERROR: Modifier or '<' missing */ *status = FALSE; return str; } (void) strncpy(modStr, start, str-start); modStr[str-start] = '\0'; if (!LookupModifier(modStr, &maskBit)) { /* Unknown modifier name */ *status = FALSE; return str; } if (notFlag) *modifiers &= ~maskBit; else *modifiers |= maskBit; str = ScanWhitespace(str); } return str; } /*************************************<->************************************* * * ParseEventType (parameters) * * Description: * ----------- * xxxxxxxxxxxxxxxxxxxxxxx * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ static String ParseEventType( register String str, EventKey *table, int *eventType, Cardinal *_index, Boolean *status ) { String start = str; char eventTypeStr[100]; register Cardinal i; register XrmQuark signature; /* Parse out the event string */ str = ScanAlphanumeric(str); (void) strncpy(eventTypeStr, start, str-start); eventTypeStr[str-start] = '\0'; /* Attempt to match the parsed event against our supported event set */ signature = XrmStringToQuark(eventTypeStr); for (i = 0; table[i].signature != NULLQUARK; i++) if (table[i].signature == signature) { *_index = i; *eventType = table[*_index].eventType; *status = TRUE; return str; } /* Unknown event specified */ *status = FALSE; return (str); } /*************************************<->************************************* * * _MapEvent (parameters) * * Description: * ----------- * xxxxxxxxxxxxxxxxxxxxxxx * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ static String _MapEvent( register String str, EventKey *table, int *eventType, unsigned long *detail, Modifiers *modifiers, Boolean *status) { Cardinal index=0; /* Initialize, if first time called */ _XmProcessLock(); if (!initialized) { initialized = TRUE; FillInQuarks (buttonEvents); FillInQuarks (modifierStrings); FillInQuarks (keyEvents); } _XmProcessUnlock(); /* Parse the modifiers and the '<' */ str = ParseModifiers(str, modifiers, status); if (*str != '<') *status = FALSE; if (*status == FALSE) return str; str++; /* Parse the event type and detail and the '>' */ str = ParseEventType(str, table, eventType, &index, status); if (*str != '>') *status = FALSE; if (*status == FALSE) return str; str++; /* Save the detail */ return ((*(table[index].parseProc))(str, table[index].closure, detail, status)); } /*************************************<->************************************* * * _MapBtnEvent (parameters) * * Description: * ----------- * xxxxxxxxxxxxxxxxxxxxxxx * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ Boolean _XmMapBtnEvent( register String str, int *eventType, unsigned int *button, Modifiers *modifiers ) { Boolean status; unsigned long detail; _MapEvent (str, buttonEvents, eventType, &detail, modifiers, &status); *button = detail; if (status == FALSE) return (FALSE); /* * The following is a fix for an X11 deficiency in regards to * modifiers in grabs. */ if (*eventType == ButtonRelease) { /* the button that is going up will always be in the modifiers... */ *modifiers |= buttonModifierMasks[*button]; } return (TRUE); } /*************************************<->************************************* * * _XmMapKeyEvents (parameters) * * Description: * ----------- * Parse a comma-separated list of key events. * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ int _XmMapKeyEvents(String str, int **eventTypes, KeySym **keysyms, Modifiers **modifiers) { Boolean status = TRUE; int count = 0; char *ptr = str; *eventTypes = NULL; *keysyms = NULL; *modifiers = NULL; while (status) { int tmp_type; unsigned long tmp_sym; Modifiers tmp_mods; /* Parse a single event. */ ptr = _MapEvent(ptr, keyEvents, &tmp_type, &tmp_sym, &tmp_mods, &status); if (!status) break; /* Save this event. */ *eventTypes = (int *) XtRealloc((char*) *eventTypes, (count + 1) * sizeof(int)); (*eventTypes)[count] = tmp_type; *keysyms = (KeySym *) XtRealloc((char*) *keysyms, (count + 1) * sizeof(KeySym)); (*keysyms)[count] = (KeySym)tmp_sym; *modifiers = (Modifiers *) XtRealloc((char*) *modifiers, (count + 1) * sizeof(Modifiers)); (*modifiers)[count] = tmp_mods; count++; /* Skip the separator. */ ptr = ScanWhitespace(ptr); if (*ptr == '\0') break; else if (*ptr == ',') ptr++; else status = FALSE; } /* Discard partial results if something fails. */ if (!status) { count = 0; XtFree((char*) *eventTypes); *eventTypes = NULL; XtFree((char*) *keysyms); *keysyms = NULL; XtFree((char*) *modifiers); *modifiers = NULL; } return count; } /*************************************<->************************************* * * _XmMatchBtnEvent (parameters) * * Description: * ----------- * Compare the passed in event to the event described by the parameter * list. * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ Boolean _XmMatchBtnEvent( XEvent *event, int eventType, unsigned int button, Modifiers modifiers ) { register Modifiers state = event->xbutton.state & (ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask); if (((eventType == XmIGNORE_EVENTTYPE)||(event->type == eventType)) && (event->xbutton.button == button) && ((modifiers == AnyModifier)||(state == modifiers)) ) return (TRUE); else return (FALSE); } /*************************************<->************************************* * * _XmMatchKeyEvent (parameters) * * Description: * ----------- * Compare the passed in event to the event described by the parameter * list. * * * Inputs: * ------ * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Outputs: * ------- * xxxxxxxxxxxx = xxxxxxxxxxxxx * * Procedures Called * ----------------- * *************************************<->***********************************/ Boolean _XmMatchKeyEvent( XEvent *event, int eventType, unsigned int key, Modifiers modifiers ) { #ifdef FIX_345 register Modifiers state, mods; _XmCheckInitModifiers(); state = event->xkey.state & ~(LockMask|ScrollLockMask|NumLockMask); mods = modifiers & ~(LockMask|ScrollLockMask|NumLockMask); #endif if ((event->type == eventType) && (event->xkey.keycode == key) && #ifdef FIX_345 (state == mods)) #else (event->xkey.state == modifiers)) #endif return (TRUE); else return (FALSE); } motif-2.3.8/lib/Xm/Xmpoll.h0000644000175000017500000001637312672140200012345 00000000000000/* $Xorg: Xpoll.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */ /* Copyright 1994, 1998 The Open Group All Rights Reserved. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* $XFree86: xc/include/Xpoll.h,v 3.7 2000/09/19 12:46:05 eich Exp $ */ #ifndef _XPOLL_H_ #define _XPOLL_H_ #ifndef WIN32 #ifndef USE_POLL #include #if !defined(DGUX) #if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) #include #ifdef luna #include #endif #endif #else /* DGUX -- No sys/select in Intel DG/ux */ #include #include #include #endif #ifdef __QNX__ /* Make sure we get 256 bit select masks */ #define FD_SETSIZE 256 #include #endif /* AIX 4.2 fubar-ed , so go to heroic measures to get it */ #if defined(AIXV4) && !defined(NFDBITS) #include #endif #include #ifdef CSRG_BASED #include # if BSD < 199103 typedef long fd_mask; # endif #endif #define XFD_SETSIZE 256 #ifndef FD_SETSIZE #define FD_SETSIZE XFD_SETSIZE #endif #ifndef NBBY #define NBBY 8 /* number of bits in a byte */ #endif #ifndef NFDBITS #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ #endif #ifndef howmany #define howmany(x,y) (((x)+((y)-1))/(y)) #endif #ifdef BSD # if BSD < 198911 /* 198911 == OSF/1, 199103 == CSRG_BASED */ # ifndef luna /* and even though on LUNA BSD == 43, it has it */ typedef struct fd_set { fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; } fd_set; # endif # endif #endif #ifndef hpux /* and perhaps old BSD ??? */ # define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) #else # ifndef _XPG4_EXTENDED /* HPUX 9.x and earlier */ # define Select(n,r,w,e,t) select(n,(int*)r,(int*)w,(int*)e,(struct timeval*)t) # else # define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) # endif #endif #ifndef FD_SET #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= ((fd_mask)1 << ((n) % NFDBITS))) #endif #ifndef FD_CLR #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~((fd_mask)1 << ((n) % NFDBITS))) #endif #ifndef FD_ISSET #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & ((fd_mask)1 << ((n) % NFDBITS))) #endif #ifndef FD_ZERO #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) #endif /* * The following macros are used by the servers only. There is an * explicit assumption that the bit array in the fd_set is at least * 256 bits long (8 32-bit words). This is true on most modern POSIX * systems. Note that this is merely an optimization for the servers * based on assumptions about the way that file descripters are * allocated on POSIX systems. * * When porting X to new systems it is important to adjust these * macros if the system has fewer than 256 bits in the fd_set bit * array. */ #define XFD_ANYSET(p) \ ((p)->fds_bits[0] || (p)->fds_bits[1] || \ (p)->fds_bits[2] || (p)->fds_bits[3] || \ (p)->fds_bits[4] || (p)->fds_bits[5] || \ (p)->fds_bits[6] || (p)->fds_bits[7]) #define XFD_COPYSET(src,dst) \ (dst)->fds_bits[0] = (src)->fds_bits[0]; \ (dst)->fds_bits[1] = (src)->fds_bits[1]; \ (dst)->fds_bits[2] = (src)->fds_bits[2]; \ (dst)->fds_bits[3] = (src)->fds_bits[3]; \ (dst)->fds_bits[4] = (src)->fds_bits[4]; \ (dst)->fds_bits[5] = (src)->fds_bits[5]; \ (dst)->fds_bits[6] = (src)->fds_bits[6]; \ (dst)->fds_bits[7] = (src)->fds_bits[7]; #define XFD_ANDSET(dst,b1,b2) \ (dst)->fds_bits[0] = ((b1)->fds_bits[0] & (b2)->fds_bits[0]); \ (dst)->fds_bits[1] = ((b1)->fds_bits[1] & (b2)->fds_bits[1]); \ (dst)->fds_bits[2] = ((b1)->fds_bits[2] & (b2)->fds_bits[2]); \ (dst)->fds_bits[3] = ((b1)->fds_bits[3] & (b2)->fds_bits[3]); \ (dst)->fds_bits[4] = ((b1)->fds_bits[4] & (b2)->fds_bits[4]); \ (dst)->fds_bits[5] = ((b1)->fds_bits[5] & (b2)->fds_bits[5]); \ (dst)->fds_bits[6] = ((b1)->fds_bits[6] & (b2)->fds_bits[6]); \ (dst)->fds_bits[7] = ((b1)->fds_bits[7] & (b2)->fds_bits[7]); #define XFD_ORSET(dst,b1,b2) \ (dst)->fds_bits[0] = ((b1)->fds_bits[0] | (b2)->fds_bits[0]); \ (dst)->fds_bits[1] = ((b1)->fds_bits[1] | (b2)->fds_bits[1]); \ (dst)->fds_bits[2] = ((b1)->fds_bits[2] | (b2)->fds_bits[2]); \ (dst)->fds_bits[3] = ((b1)->fds_bits[3] | (b2)->fds_bits[3]); \ (dst)->fds_bits[4] = ((b1)->fds_bits[4] | (b2)->fds_bits[4]); \ (dst)->fds_bits[5] = ((b1)->fds_bits[5] | (b2)->fds_bits[5]); \ (dst)->fds_bits[6] = ((b1)->fds_bits[6] | (b2)->fds_bits[6]); \ (dst)->fds_bits[7] = ((b1)->fds_bits[7] | (b2)->fds_bits[7]); #define XFD_UNSET(dst,b1) \ (dst)->fds_bits[0] &= ~((b1)->fds_bits[0]); \ (dst)->fds_bits[1] &= ~((b1)->fds_bits[1]); \ (dst)->fds_bits[2] &= ~((b1)->fds_bits[2]); \ (dst)->fds_bits[3] &= ~((b1)->fds_bits[3]); \ (dst)->fds_bits[4] &= ~((b1)->fds_bits[4]); \ (dst)->fds_bits[5] &= ~((b1)->fds_bits[5]); \ (dst)->fds_bits[6] &= ~((b1)->fds_bits[6]); \ (dst)->fds_bits[7] &= ~((b1)->fds_bits[7]); #else /* USE_POLL */ #include #endif /* USE_POLL */ #else /* WIN32 */ #define XFD_SETSIZE 256 #ifndef FD_SETSIZE #define FD_SETSIZE XFD_SETSIZE #endif #include #define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) #define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count) #define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i]) #define XFD_ANYSET(p) XFD_SETCOUNT(p) #define XFD_COPYSET(src,dst) { \ u_int __i; \ FD_ZERO(dst); \ for (__i = 0; __i < XFD_SETCOUNT(src) ; __i++) { \ XFD_FD(dst,__i) = XFD_FD(src,__i); \ } \ XFD_SETCOUNT(dst) = XFD_SETCOUNT(src); \ } #define XFD_ANDSET(dst,b1,b2) { \ u_int __i; \ FD_ZERO(dst); \ for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ if (FD_ISSET(XFD_FD(b1,__i), b2)) \ FD_SET(XFD_FD(b1,__i), dst); \ } \ } #define XFD_ORSET(dst,b1,b2) { \ u_int __i; \ XFD_COPYSET(b1,dst); \ for (__i = 0; __i < XFD_SETCOUNT(b2) ; __i++) { \ if (!FD_ISSET(XFD_FD(b2,__i), dst)) \ FD_SET(XFD_FD(b2,__i), dst); \ } \ } /* this one is really sub-optimal */ #define XFD_UNSET(dst,b1) { \ u_int __i; \ for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ FD_CLR(XFD_FD(b1,__i), dst); \ } \ } /* we have to pay the price of having an array here, unlike with bitmasks calling twice FD_SET with the same fd is not transparent, so be careful */ #undef FD_SET #define FD_SET(fd,set) do { \ if (XFD_SETCOUNT(set) < FD_SETSIZE && !FD_ISSET(fd,set)) \ XFD_FD(set,XFD_SETCOUNT(set)++)=(fd); \ } while(0) #define getdtablesize() FD_SETSIZE #endif /* WIN32 */ #endif /* _XPOLL_H_ */ motif-2.3.8/lib/Xm/TextInP.h0000644000175000017500000001104013145162623012420 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextInP_h #define _XmTextInP_h #include #include #ifdef __cplusplus extern "C" { #endif /**************************************************************** * * Definitions for modules implementing text input modules. * ****************************************************************/ typedef struct { int x; int y; } SelectionHint; typedef struct _InputDataRec { XmTextWidget widget; /* Back-pointer to widget record. */ XmTextScanType *sarray; /* Description of what to cycle through on */ /* selections. */ int sarraycount; /* Number of elements in above. */ int new_sel_length; /* New selection length for selection moves. */ int threshold; /* number of pixels crossed -> drag */ SelectionHint selectionHint; /* saved coords of button down */ SelectionHint Sel2Hint; /* saved the coords of button down */ XtIntervalId select_id; XmTextScanType stype; /* Current selection type. */ XmTextScanDirection extendDir; XmTextScanDirection Sel2ExtendDir; XmTextPosition origLeft, origRight; XmTextPosition Sel2OrigLeft, Sel2OrigRight; XmTextPosition stuffpos; XmTextPosition sel2Left, sel2Right; /* secondary selection */ XmTextPosition anchor; /* anchor point of the primary selection */ Position select_pos_x; /* x position for timer-based scrolling */ Position select_pos_y; /* y position for timer-based scrolling */ Boolean pendingdelete; /* TRUE if we're implementing pending delete */ Boolean syncing; /* If TRUE, then we've multiple keystrokes */ Boolean extending; /* true if we are extending */ Boolean Sel2Extending; /* true if we are extending */ Boolean hasSel2; /* has secondary selection */ Boolean has_destination; /* has destination selection */ Boolean selectionMove; /* delete selection after stuff */ Boolean cancel; /* indicates that cancel was pressed */ Boolean overstrike; /* overstrike */ Boolean sel_start; /* indicates that a btn2 was pressed */ Time dest_time; /* time of destination selection ownership */ Time sec_time; /* time of secondary selection ownership */ Time lasttime; /* Time of last event. */ Boolean selectionLink; /* This is a link vs. a copy operation */ XtIntervalId drag_id; /* timer to start btn1 drag */ _XmTextActionRec *transfer_action; /* to keep track of delayed action */ } InputDataRec, *InputData; /* * Create a new instance of an input object. By the time this is called, * the widget context has been saved. */ typedef void (*InputCreateProc)( Widget, ArgList, Cardinal) ; /* * Get values out of the input object. */ typedef void (*InputGetValuesProc)( Widget, ArgList, Cardinal) ; /* * Set values in the input object. */ typedef void (*InputSetValuesProc)( Widget, Widget, Widget, ArgList, Cardinal *) ; /* * Inform input of invalidated positions. */ typedef void (*InputInvalidateProc)( XmTextWidget, XmTextPosition, XmTextPosition, long) ; /* * Get secondary resources. */ typedef void (*InputGetSecResProc)( XmSecondaryResourceData *) ; typedef struct _InputRec { struct _InputDataRec *data; /* Input-specific data; opaque type. */ InputInvalidateProc Invalidate; InputGetValuesProc GetValues; InputSetValuesProc SetValues; XtWidgetProc destroy; InputGetSecResProc GetSecResData; } InputRec; externalref XtPointer _XmdefaultTextActionsTable; externalref Cardinal _XmdefaultTextActionsTableSize; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextInP_h */ /*DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ExtObject.c0000644000175000017500000003536413145162623012766 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: ExtObject.c /main/13 1995/10/25 20:03:50 cde-sun $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include "BaseClassI.h" #include "ExtObjectI.h" #include "SyntheticI.h" #include "XmI.h" /******** Static Function Declarations ********/ static void ClassInitialize(void); static void ClassPartInitPrehook(WidgetClass c); static void ClassPartInitPosthook(WidgetClass c); static void ClassPartInitialize(WidgetClass c); static void InitializePrehook(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static void Initialize(Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValuesPrehook(Widget req, Widget curr, Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesPrehook(Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValues(Widget old, Widget ref, Widget new_w, ArgList args, Cardinal *num_args); static void GetValuesHook(Widget new_w, ArgList args, Cardinal *num_args); static void Destroy(Widget wid); static void UseParent(Widget w, int offset, XrmValue *value); /******** End Static Function Declarations ********/ /*************************************************************************** * * ExtObject Resources * ***************************************************************************/ #define Offset(field) XtOffsetOf(struct _XmExtRec, ext.field) static XtResource extResources[] = { { XmNlogicalParent, XmCLogicalParent, XmRWidget, sizeof (Widget), Offset (logicalParent), XmRCallProc, (XtPointer)UseParent }, { XmNextensionType, XmCExtensionType, XmRExtensionType, sizeof (unsigned char), Offset (extensionType), XmRImmediate, (XtPointer)XmDEFAULT_EXTENSION } }; #undef Offset #define XmNUM_ELEMENTS 4 #define XmNUM_BYTES 255 typedef struct _XmExtCache { char data[XmNUM_BYTES]; Boolean inuse; } XmExtCache; typedef union { XmExtCache cache; double force_alignment; } Aligned_XmExtCache; static Aligned_XmExtCache extarray[XmNUM_ELEMENTS]; static XmBaseClassExtRec myBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ SetValuesPrehook, /* set_values prehook */ NULL, /* initialize posthook */ NULL, /* set_values posthook */ NULL, /* secondary class */ NULL, /* creation proc */ NULL, /* getSecRes data */ { 0 }, /* fast subclass */ GetValuesPrehook, /* get_values prehook */ NULL, /* get_values posthook */ ClassPartInitPrehook, /* class_part_prehook */ ClassPartInitPosthook, /* class_part_posthook */ NULL, /* compiled_ext_resources */ NULL, /* ext_resources */ 0, /* resource_count */ FALSE /* use_sub_resources */ }; externaldef(xmextclassrec) XmExtClassRec xmExtClassRec = { { (WidgetClass) &objectClassRec,/* superclass */ "dynamic", /* class_name */ sizeof(XmExtRec), /* size */ ClassInitialize, /* Class Initializer */ ClassPartInitialize, /* class_part_init */ FALSE, /* Class init'ed ? */ Initialize, /* initialize */ NULL, /* initialize_notify */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ extResources, /* resources */ XtNumber(extResources), /* resource_count */ NULLQUARK, /* xrm_class */ FALSE, /* compress_motion */ FALSE, /* compress_exposure */ FALSE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ GetValuesHook, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* intrinsics version */ NULL, /* callback offsets */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&myBaseClassExtRec /* extension */ }, { NULL, /* synthetic resources */ 0 /* num syn resources */ } }; externaldef(xmextobjectclass) WidgetClass xmExtObjectClass = (WidgetClass) (&xmExtClassRec); /*ARGSUSED*/ static void UseParent(Widget w, int offset, /* unused */ XrmValue *value) { value->addr = (XPointer) &(w->core.parent); } /************************************************************************ * * ClassInitialize * ************************************************************************/ static void ClassInitialize(void) { myBaseClassExtRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInitPrehook * ************************************************************************/ static void ClassPartInitPrehook(WidgetClass c) { XmExtObjectClass wc = (XmExtObjectClass) c; if ((WidgetClass)wc != xmExtObjectClass) { XmExtObjectClass sc = (XmExtObjectClass) c->core_class.superclass; XmBaseClassExt *scePtr = _XmGetBaseClassExtPtr(sc, XmQmotif); /* * If our superclass uses subresources, then we need to * temporarily fill it's core resource fields so that objectClass * classPartInit will be able to find them for merging. We * assume that we only need to set things up for the * superclass and not any deeper ancestors. */ if ((*scePtr)->use_sub_resources) { sc->object_class.resources = (*scePtr)->compiled_ext_resources; sc->object_class.num_resources = (*scePtr)->num_ext_resources; } } } /************************************************************************ * * ClassPartInitPosthook * ************************************************************************/ static void ClassPartInitPosthook(WidgetClass c) { XmExtObjectClass wc = (XmExtObjectClass) c; XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(wc, XmQmotif); if ((*wcePtr) && (*wcePtr)->use_sub_resources) { /* * Put our compiled resources back and zero out oject class so * it's invisible to object class create processing. */ (*wcePtr)->compiled_ext_resources = wc->object_class.resources; (*wcePtr)->num_ext_resources = wc->object_class.num_resources; } } /************************************************************************ * * ClassPartInitialize * Set up the inheritance mechanism for the routines exported by * vendorShells class part. * ************************************************************************/ static void ClassPartInitialize(WidgetClass c) { XmExtObjectClass wc = (XmExtObjectClass) c; if (wc == (XmExtObjectClass)xmExtObjectClass) return; _XmBuildExtResources(c); } /*ARGSUSED*/ static void InitializePrehook(Widget req, /* unused */ Widget new_w, ArgList args, Cardinal *num_args) { XmExtObjectClass ec = (XmExtObjectClass) XtClass(new_w); XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(ec, XmQmotif); if ((*wcePtr)->use_sub_resources) { /* * Get a uncompiled resource list to use with XtGetSubresources. * We can't do this in ClassPartInitPosthook because Xt doesn't * set class_inited at the right place and thereby mishandles * the XtGetResourceList call. */ _XmProcessLock(); if ((*wcePtr)->ext_resources == NULL) { ec->object_class.resources = (*wcePtr)->compiled_ext_resources; ec->object_class.num_resources = (*wcePtr)->num_ext_resources; XtGetResourceList((WidgetClass) ec, &((*wcePtr)->ext_resources), &((*wcePtr)->num_ext_resources)); } XtGetSubresources(XtParent(new_w), (XtPointer)new_w, NULL, NULL, (*wcePtr)->ext_resources, (*wcePtr)->num_ext_resources, args, *num_args); _XmProcessUnlock(); } } static void Initialize(Widget req, Widget new_w, ArgList args, Cardinal *num_args) { XmExtObject ne = (XmExtObject) new_w; XmExtObjectClass ec = (XmExtObjectClass) XtClass(new_w); Widget resParent = ne->ext.logicalParent; XmWidgetExtData extData; XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(ec, XmQmotif); if (!(*wcePtr)->use_sub_resources) { if (resParent) { extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); _XmPushWidgetExtData(resParent, extData, ne->ext.extensionType); extData->widget = new_w; _XmProcessLock(); extData->reqWidget = (Widget) _XmExtObjAlloc(XtClass(new_w)->core_class.widget_size); memcpy((char *)extData->reqWidget, (char *)req, XtClass(new_w)->core_class.widget_size); _XmProcessUnlock(); /* Convert the fields from unit values to pixel values */ _XmExtImportArgs(new_w, args, num_args); } } } /*ARGSUSED*/ static Boolean SetValuesPrehook(Widget req, /* unused */ Widget curr, /* unused */ Widget new_w, ArgList args, Cardinal *num_args) { XmExtObjectClass ec = (XmExtObjectClass) XtClass(new_w); XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(ec, XmQmotif); if ((*wcePtr)->use_sub_resources) { _XmProcessLock(); XtSetSubvalues((XtPointer)new_w, (*wcePtr)->ext_resources, (*wcePtr)->num_ext_resources, args, *num_args); _XmProcessUnlock(); } return False; } static void GetValuesPrehook(Widget new_w, ArgList args, Cardinal *num_args) { XmExtObjectClass ec = (XmExtObjectClass) XtClass(new_w); XmBaseClassExt *wcePtr = _XmGetBaseClassExtPtr(ec, XmQmotif); if ((*wcePtr)->use_sub_resources) { _XmProcessLock(); XtGetSubvalues((XtPointer)new_w, (*wcePtr)->ext_resources, (*wcePtr)->num_ext_resources, args, *num_args); _XmProcessUnlock(); } } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues(Widget old, Widget ref, Widget new_w, ArgList args, Cardinal *num_args) { XmExtObject ne = (XmExtObject) new_w; Widget resParent = ne->ext.logicalParent; XmWidgetExtData ext = _XmGetWidgetExtData(resParent, ne->ext.extensionType); Cardinal extSize; if(ext == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return FALSE; } if (resParent) { _XmProcessLock(); extSize = XtClass(new_w)->core_class.widget_size; ext->widget = new_w; ext->oldWidget = (Widget) _XmExtObjAlloc(extSize); memcpy((char *)ext->oldWidget, (char *)old, extSize); ext->reqWidget = (Widget) _XmExtObjAlloc(extSize); memcpy((char *)ext->reqWidget, (char *)ref, extSize); _XmProcessUnlock(); /* Convert the necessary fields from unit values to pixel values. */ _XmExtImportArgs(new_w, args, num_args); } return FALSE; } /************************************************************************ * * GetValuesHook * ************************************************************************/ static void GetValuesHook(Widget new_w, ArgList args, Cardinal *num_args) { XmExtObject ne = (XmExtObject) new_w; Widget resParent = ne->ext.logicalParent; XmWidgetExtData ext; if (resParent) { ext = _XmGetWidgetExtData(resParent, ne->ext.extensionType); if(ext == NULL) { #ifdef DEBUG XmeWarning(NULL, "_XmGetWidgetExtData() returned NULL pointer."); #endif return; } ext->widget = new_w; _XmExtGetValuesHook(new_w, args, num_args); } } /************************************************************************ * * Destroy * ************************************************************************/ static void Destroy(Widget wid) { XmExtObject extObj = (XmExtObject) wid; Widget resParent = extObj->ext.logicalParent; if (resParent) { XmWidgetExtData extData; _XmPopWidgetExtData(resParent, &extData, extObj->ext.extensionType); XtFree((char *) extData); } } char * _XmExtObjAlloc(int size) { register int i; if (size <= XmNUM_BYTES) { for (i = 0; i < XmNUM_ELEMENTS; i++) if (! extarray[i].cache.inuse) { extarray[i].cache.inuse = TRUE; return extarray[i].cache.data; } } return XtMalloc(size); } void _XmExtObjFree(XtPointer element) { register int i; for (i = 0; i < XmNUM_ELEMENTS; i++) if (extarray[i].cache.data == (char*)element) { extarray[i].cache.inuse = FALSE; return; } XtFree((char *) element); } /********************************************************************** * * _XmBuildExtResources * Build up the ext's synthetic * resource processing list by combining the super classes with * this class. * **********************************************************************/ void _XmBuildExtResources(WidgetClass c) { XmExtObjectClass wc = (XmExtObjectClass) c; XmExtObjectClass sc; _XmProcessLock(); _XmInitializeSyntheticResources(wc->ext_class.syn_resources, wc->ext_class.num_syn_resources); if (wc != (XmExtObjectClass) xmExtObjectClass) { sc = (XmExtObjectClass) wc->object_class.superclass; _XmBuildResources (&(wc->ext_class.syn_resources), &(wc->ext_class.num_syn_resources), sc->ext_class.syn_resources, sc->ext_class.num_syn_resources); } _XmProcessUnlock(); } motif-2.3.8/lib/Xm/IconFile.h0000644000175000017500000000344212672140200012553 00000000000000/* $XConsortium: IconFile.h /main/5 1995/07/15 20:51:44 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmIconFile_h #define _XmIconFile_h #include #ifdef __cplusplus extern "C" { #endif /* * values for icon magnitude */ #define XmUNSPECIFIED_ICON_SIZE 0 #define XmLARGE_ICON_SIZE 1 #define XmMEDIUM_ICON_SIZE 2 #define XmSMALL_ICON_SIZE 3 #define XmTINY_ICON_SIZE 4 /******** Public Function Declarations for IconFile.c ********/ extern String XmGetIconFileName( Screen *screen, String imageInstanceName, String imageClassName, String hostPrefix, unsigned int size) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIconFile_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ButtonBox.c0000644000175000017500000010367612672140200013014 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES ************************************************************/ #include #include #include #include #include #include #include #include "XmI.h" /************************************************************ * TYPEDEFS AND DEFINES ************************************************************/ #define SUPERCLASS ((ConstraintWidgetClass) &xmManagerClassRec) /************************************************************ * MACROS ************************************************************/ #define IsHorizontal(x) (XmButtonBox_orientation((x)) == XmHORIZONTAL) #define MarginH(x) (XmButtonBox_margin_height((x))) #define MarginW(x) (XmButtonBox_margin_width((x))) #define FillOption(x) (XmButtonBox_fill_option((x))) #define EqualSize(x) (XmButtonBox_equal_size((x))) /************************************************************ * EXTERNAL DECLARATIONS ************************************************************/ /************************************************************ * STATIC FUNCTION DECLARATIONS ************************************************************/ static void Initialize(Widget, Widget, ArgList, Cardinal *); static void ClassInitialize(void); static void ClassPartInitialize(WidgetClass w_class) ; static void InsertChild(Widget); static void Resize(Widget), ChangeManaged(Widget); static void ConstraintInitialize(Widget, Widget, ArgList, Cardinal *); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static Boolean ConstraintSetValues(Widget, Widget, Widget, ArgList, Cardinal *); static Boolean CvtStringToFillOption(Display *, XrmValuePtr, Cardinal *, XrmValuePtr, XrmValuePtr); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static XtGeometryResult TryNewLayout(Widget, Mask *, Boolean); static Cardinal CalcChildrenPrefSizes(XmButtonBoxWidget, Dimension *, Dimension *, Dimension *); static void LayoutChildren(Widget, Widget); static void CalcChildSize(XmButtonBoxWidget, Widget, Dimension, Dimension, Dimension, Cardinal, Dimension *, Dimension *); static void ButtonBoxSetDefaultShadow(Widget button) ; /************************************************************ * STATIC DECLARATIONS ************************************************************/ static XtResource resources[] = { { XmNequalSize, XmCEqualSize, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmButtonBoxRec, button_box.equal_size), XmRImmediate, (XtPointer) False }, { XmNfillOption, XmCFillOption, XmRXmFillOption, sizeof(XmFillOption), XtOffsetOf(XmButtonBoxRec, button_box.fill_option), XmRImmediate, (XtPointer) XmFillNone }, { XmNmarginHeight, XmCMargin, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmButtonBoxRec, button_box.margin_height), XmRImmediate, (XtPointer) 0 }, { XmNmarginWidth, XmCMargin, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmButtonBoxRec, button_box.margin_width), XmRImmediate, (XtPointer) 0 }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf(XmButtonBoxRec, button_box.orientation), XmRImmediate, (XtPointer)XmHORIZONTAL }, { XmNdefaultButton, XmCWidget, XmRWidget, sizeof(Widget), XtOffsetOf(XmButtonBoxRec, button_box.default_button), XmRImmediate, (XtPointer) NULL } }; static XmSyntheticResource get_resources[] = { { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmButtonBoxRec, button_box.margin_height), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(XmButtonBoxRec, button_box.margin_width), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels } }; static XtResource constraints[] = { { "pri.vate1", "Pri.vate1", XmRDimension, sizeof(Dimension), XtOffsetOf(XmBBoxConstraintsRec, bbox.pref_width), XmRImmediate, (XtPointer) 0 }, { "pri.vate2", "Pri.vate2", XmRAttachment, sizeof(Dimension), XtOffsetOf(XmBBoxConstraintsRec, bbox.pref_height), XmRImmediate, (XtPointer) 0 } }; XmButtonBoxClassRec xmButtonBoxClassRec = { { /* core_class members */ /* superclass */ (WidgetClass)SUPERCLASS, /* class_name */ "XmButtonBox", /* widget_size */ sizeof(XmButtonBoxRec), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ False, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ True, /* compress_exposure */ True, /* compress_enterleave*/ True, /* visible_interest */ False, /* destroy */ NULL, /* resize */ Resize, /* expose */ NULL, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator*/ NULL, /* extension */ NULL, }, { /* composite_class members */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ InsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ constraints, /* num resources */ XtNumber(constraints), /* constraint size */ sizeof(XmBBoxConstraintsRec), /* init proc */ ConstraintInitialize, /* destroy proc */ NULL, /* set values proc */ ConstraintSetValues, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ NULL, /* num_syn_cont_resources */ 0, /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* Row class members */ /* extension */ NULL, } }; WidgetClass xmButtonBoxWidgetClass = (WidgetClass)&xmButtonBoxClassRec; /************************************************************ * STATIC CODE ************************************************************/ /* Function Name: ClassInitialize * Description: Called to initialize information specific * to this widget class. * Arguments: none. * Returns: none. */ /* ARGSUSED */ static void ClassInitialize() { XmButtonBoxClassRec *wc = &xmButtonBoxClassRec; XtSetTypeConverter(XmRString, XmRXmFillOption, (XtTypeConverter) CvtStringToFillOption, NULL, (Cardinal)0, XtCacheAll, (XtDestructor)NULL); } /****************************************************************/ static void ClassPartInitialize(WidgetClass w_class ) { XmButtonBoxWidgetClass bbClass = (XmButtonBoxWidgetClass) w_class ; /* this seems to do nothing.... why is it here? -rh XmButtonBoxWidgetClass bbSuper = (XmButtonBoxWidgetClass) w_class->core_class.superclass ; */ _XmFastSubclassInit (w_class, XmBUTTONBOX_BIT); /* Install the specifyrendertable trait for all subclasses */ /* XmeTraitSet((XtPointer)w_class, XmQTspecifyRenderTable, (XtPointer) &bulletinbSRT); */ return ; } /****************************************************************/ /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * new - what will be created (our superclasses have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /* ARGSUSED */ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { /* * This is here just in case no children are added before the * widget is realized. */ if (req->core.width == 0) set->core.width = 1; if (req->core.height == 0) set->core.height = 1; } /* Function Name: ConstraintInitialize * Description: Called to initialize information specific * to this child widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /* ARGSUSED */ static void ConstraintInitialize(Widget request, Widget set, ArgList args, Cardinal *num_args) { XmButtonBoxC_pref_width(set) = XmButtonBoxC_pref_height(set) = 0; } /* Function Name: ConstraintSetValues * Description: Called when child widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /* ARGSUSED */ static Boolean ConstraintSetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { if ((XmButtonBoxC_pref_width(set) != set->core.width) || (XmButtonBoxC_pref_height(set) != set->core.height)) { /* * The desired height or width changed, this will * tell the icon box to perform a new XtQueryGeom. */ XmButtonBoxC_pref_width(set) = XmButtonBoxC_pref_height(set) = 0; } return(False); } /* * Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - Button Box Widget to resize. * Returns: none. */ /*ARGSUSED */ static void Resize(Widget w) { LayoutChildren(w, NULL); } /* Function Name: QueryGeometry * Description: Called when my parent wants to know my * preferred size. * Arguments: w - the widget to check. * intended - parent imposed geometry. * preferred - what I would like. * Returns: status. */ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, XtWidgetGeometry *preferred) { XmButtonBoxWidget bbox = (XmButtonBoxWidget)w; Dimension max_major, max_minor, child_major_total; /* * Calculate our desired size. */ (void) CalcChildrenPrefSizes(bbox, &max_major, &max_minor, &child_major_total); if (IsHorizontal(bbox)) { preferred->width = child_major_total + (2 * MarginW(bbox)); preferred->height = max_minor + (2 * MarginH(bbox)); } else { preferred->width = max_minor + (2 * MarginW(bbox)); preferred->height = child_major_total + (2 * MarginH(bbox)); } return(_XmHWQuery(w, request, preferred)); } /* Function Name: GeometryManager * Description: handles request from children for size changes. * Arguments: child - the child to change. * request - desired geometry of child. * result - what will be allowed if almost. * Returns: status. */ /* ARGSUSED */ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) { XmButtonBoxWidget bbox = (XmButtonBoxWidget)w->core.parent; Mask mask = 0; XtGeometryResult result; /* * Say no to any change in position. */ if ( (request->request_mode & (CWX | CWY | CWBorderWidth)) && !(request->request_mode & (CWWidth | CWHeight)) ) { return (XtGeometryNo); } if ( request->request_mode & (CWWidth | CWHeight) ) { Dimension max_major, max_minor; Dimension child_major, child_minor; Dimension child_width, child_height; Dimension child_major_total; Cardinal num_managed; /* * Save the old size, and set the corresponding * widget fields to the requested sizes. */ Dimension old_width = XmButtonBoxC_pref_width(w); Dimension old_height = XmButtonBoxC_pref_height(w); if ( request->request_mode & CWWidth ) XmButtonBoxC_pref_width(w) = request->width; if ( request->request_mode & CWHeight ) XmButtonBoxC_pref_height(w) = request->height; /* * See if everything fits with the new size. */ (void) TryNewLayout((Widget)bbox, &mask, (request->request_mode & XtCWQueryOnly)); num_managed = CalcChildrenPrefSizes(bbox, &max_major, &max_minor, &child_major_total); CalcChildSize(bbox, w, max_major, max_minor, child_major_total, num_managed, &child_major, &child_minor); if (IsHorizontal(bbox)) { child_height = child_minor; child_width = child_major; } else { child_height = child_major; child_width = child_minor; } if ( (int)child_width >= (int)(2 * w->core.border_width) ) child_width -= (2 * w->core.border_width); if ( (int)child_height >= (int)(2 * w->core.border_width) ) child_height -= (2 * w->core.border_width); if (((child_width == XmButtonBoxC_pref_width(w)) || !(request->request_mode & CWWidth)) && ((child_height == XmButtonBoxC_pref_height(w)) || !(request->request_mode & CWHeight))) { result = XtGeometryYes; } else if ((child_width != w->core.width) || (child_height != w->core.height)) { reply->request_mode = CWHeight | CWWidth; reply->height = child_height; reply->width = child_width; result = XtGeometryAlmost; } else { result = XtGeometryNo; } if ((request->request_mode & XtCWQueryOnly) || (result != XtGeometryYes)) { XmButtonBoxC_pref_width(w) = old_width; XmButtonBoxC_pref_height(w) = old_height; } else LayoutChildren((Widget)bbox, w); /* * We didn't get what we wanted, our preferred * size should be recomputed the next time we have * a chance to ask it, given that we're rejecting * its current geometry and that it may not agree * with our Almost reply. */ if (result != XtGeometryYes) { if ( request->request_mode & CWWidth ) XmButtonBoxC_pref_width(w) = 0; if ( request->request_mode & CWHeight ) XmButtonBoxC_pref_height(w) = 0; } return(result); } /* * Stacking request only. */ return (XtGeometryYes); } /* Function Name: ChangeManaged * Description: when a management change has occurred. * Arguments: w - the ButtonBox widget. * Returns: none. */ /* ARGSUSED */ static void ChangeManaged(Widget w) { Mask mask = 0; /* CR03420 mask should be set accordingly */ if (w->core.width == 1) mask |= CWWidth; if (w->core.height == 1) mask |= CWHeight; if (mask) (void)TryNewLayout(w, &mask, False); LayoutChildren(w, NULL); /* * for Motif navigation */ XmeNavigChangeManaged(w); } /* Function Name: InsertChild * Description: when a child widget is added. * Arguments: w - the child widget * Returns: none. */ /* ARGSUSED */ static void InsertChild(register Widget child) { Boolean is_button = False ; XmButtonBoxWidget bb = (XmButtonBoxWidget) XtParent( child) ; /* * Check for non-widgets - ButtonBox doesn't support gadgets, for now ... */ if (_XmGadgetWarning(child)) { return; } /* * Insert the child widget in the composite children list with the * superclass insert_child routine. */ /* (*SUPERCLASS->composite_class.insert_child)(w); */ /* Another process may be updating the superclass's data */ /* (This was missed for some reason... - scorch) * use composite class insert proc to do all the dirty work */ { XtWidgetProc insert_child; _XmProcessLock(); insert_child = ((XmManagerWidgetClass)xmManagerWidgetClass)-> composite_class.insert_child; _XmProcessUnlock(); (*insert_child)(child); } if(XmeTraitGet((XtPointer)XtClass(child), XmQTtakesDefault)) { is_button = TRUE ; if( XmButtonBox_default_button( bb) ) { /* Notify child that it has to be ready for default visual */ ButtonBoxSetDefaultShadow( child) ; } } } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /* ARGSUSED */ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmButtonBoxWidget b_old = (XmButtonBoxWidget) current; XmButtonBoxWidget b_set = (XmButtonBoxWidget) set; Boolean newLayout = False; Mask mask = 0; /* CR03420 */ if ( XmButtonBox_equal_size(b_set) != XmButtonBox_equal_size(b_old) || XmButtonBox_fill_option(b_set) != XmButtonBox_fill_option(b_old) || XmButtonBox_margin_height(b_set) != XmButtonBox_margin_height(b_old) || XmButtonBox_margin_width(b_set) != XmButtonBox_margin_width(b_old) || XmButtonBox_orientation(b_set) != XmButtonBox_orientation(b_old) ) { newLayout = True; } if (set->core.width == 0) { /* CR03420 */ set->core.width = 1; /* setting to 1 to prevent zero width */ mask |= CWWidth; } if (set->core.height == 0) { /* CR03420 */ set->core.height = 1; /* setting to 1 to prevent zero height */ mask |= CWHeight; } if (mask) TryNewLayout((Widget)b_set, &mask, False); if ( newLayout == True ) LayoutChildren((Widget)b_set, NULL); return(False); } /************************************************************ * Type Converters. ************************************************************/ /* Function Name: CvtStringToFillOption * Description: Converts a string to a FillOption * Arguments: dpy - the X Display. * args, num_args - *** NOT USED *** * fromVal - contains the string to convert. * toVal - contains the converted node state. * Returns: */ /* ARGSUSED */ static Boolean CvtStringToFillOption(Display * dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal) { static XmFillOption option; char lowerName[BUFSIZ]; XmCopyISOLatin1Lowered(lowerName, (char *)fromVal->addr); if ( streq(lowerName, "none") || streq(lowerName,"fillnone") ) option = XmFillNone; else if ( streq(lowerName, "major") || streq(lowerName, "fillmajor") ) option = XmFillMajor; else if ( streq(lowerName, "minor") || streq(lowerName, "fillminor") ) option = XmFillMinor; else if ( streq(lowerName, "all") || streq(lowerName, "fillall") ) option = XmFillAll; else { XtDisplayStringConversionWarning(dpy, fromVal->addr, XmRXmFillOption); return(False); /* Conversion failed. */ } if ( toVal->addr == NULL ) { toVal->size = sizeof(XmFillOption); toVal->addr = (XtPointer)&option; return(True); } else { toVal->size = sizeof(XmFillOption); if ( toVal->size >= sizeof(XmFillOption) ) { XmFillOption *state = (XmFillOption *)toVal->addr; *state = option; return(True); } else { return(False); } } } /************************************************************ * LOCAL CODE ************************************************************/ /* Function Name: TryNewLayout * Description: tries to do a layout within the current width * and height. If that fails, it tries to resize and * do it within the geometry given in preferred_size. * Arguments: parent - the ButtonBox * mask - request mask * queryOnly - should this only query * Returns: status. */ /* ARGSUSED */ static XtGeometryResult TryNewLayout(Widget parent, Mask *mask, Boolean queryOnly) { XmButtonBoxWidget bbox = (XmButtonBoxWidget)parent; Dimension new_width, new_height; Dimension max_major, max_minor, child_major_total; /* * Get the bounding width and height of all children. */ (void) CalcChildrenPrefSizes(bbox, &max_major, &max_minor, &child_major_total); if (IsHorizontal(bbox)) { new_width = child_major_total + 2 * MarginW(bbox); new_height = max_minor + 2 * MarginH(bbox); } else { new_width = max_minor + 2 * MarginW(bbox); new_height = child_major_total + 2 * MarginH(bbox); } /* * Be sure that we are always at least one pixel high. */ if (new_width == 0) new_width = 1; if (new_height == 0) new_height = 1; if ( new_width != parent->core.width || new_height != parent->core.height ) { XtWidgetGeometry request, reply; XtGeometryResult result; request.width = new_width; request.height = new_height; reply.width = 0; reply.height = 0; request.request_mode = *mask; /* CR03420 */ if ( queryOnly ) { request.request_mode |= XtCWQueryOnly; } result = XtMakeGeometryRequest(parent, &request, &reply); if ( request.width == reply.width ) { *mask |= CWWidth; } if ( request.height == reply.height ) { *mask |= CWHeight; } if ( result == XtGeometryAlmost && !queryOnly ) { result = XtMakeGeometryRequest(parent, &reply, &reply); } return(result); } *mask = CWWidth | CWHeight; return(XtGeometryYes); } /* Function Name: LayoutChildren * Description: Lays out the "child" widgets in the ButtonBox widget. * Arguments: w - the ButtonBox widget. * special_child - Treat this child special, actually * set the new width and height instead * of calling the Xt routine. This helps * the geom mgr implement XtGeometryYes * policy. * Returns: none. */ /* ARGSUSED */ static void LayoutChildren(Widget w, Widget special_child) { XmButtonBoxWidget bbox = (XmButtonBoxWidget)w; Widget *childp; Dimension margin_major, margin_minor; Dimension max_major, max_minor; Dimension box_major, box_minor; Dimension child_major, child_minor; Dimension child_width, child_height; Dimension child_major_total; Position pos_minor; Position pos_x, pos_y; float pad = 0, pos_major; Cardinal num_managed; child_major = 0; child_minor = 0; if ( IsHorizontal(bbox) ) { margin_major = MarginW(bbox); margin_minor = MarginH(bbox); box_major = bbox->core.width; box_minor = bbox->core.height; } else { margin_major = MarginH(bbox); margin_minor = MarginW(bbox); box_major = bbox->core.height; box_minor = bbox->core.width; } if ((int)box_major > (int)(2 * margin_major)) box_major -= 2 * margin_major; else box_major = 1; if ((int)box_minor > (int)(2 * margin_minor)) box_minor -= 2 * margin_minor; else box_minor = 1; num_managed = CalcChildrenPrefSizes(bbox, &max_major, &max_minor, &child_major_total); pad = 0.0; pos_major = (float) margin_major; if ((FillOption(bbox) == XmFillNone) || (FillOption(bbox) == XmFillMinor)) { if ( box_major >= child_major_total ) { pad = ((float) box_major - (float) child_major_total) / ((float) num_managed + 1.0); pos_major += pad; } } ForAllChildren(bbox, childp) { if ( !XtIsManaged(*childp) ) continue; CalcChildSize(bbox, *childp, max_major, max_minor, child_major_total, num_managed, &child_major, &child_minor); if ((FillOption(bbox) == XmFillNone) || (FillOption(bbox) == XmFillMajor)) { pos_minor = (((int)(box_minor - child_minor)) /2) + margin_minor; } else pos_minor = margin_minor; if ( IsHorizontal(bbox) ) { child_width = child_major; child_height = child_minor; if (LayoutIsRtoLM(bbox)) pos_x = box_major - (int) pos_major - child_width; else pos_x = (int) pos_major; pos_y = pos_minor; } else { pos_x = pos_minor; pos_y = (int) pos_major; child_width = child_minor; child_height = child_major; } if ( (int)child_width >= (int)(2 * (*childp)->core.border_width) ) child_width -= (2 * (*childp)->core.border_width); if ( (int)child_height >= (int)(2 * (*childp)->core.border_width) ) child_height -= (2 * (*childp)->core.border_width); child_width = (child_width == 0) ? 1 : child_width; child_height = (child_height == 0) ? 1 : child_height; if (*childp == special_child) { special_child->core.x = pos_x; special_child->core.y = pos_y; special_child->core.width = child_width; special_child->core.height = child_height; } else { _XmConfigureWidget(*childp, pos_x, pos_y, child_width, child_height, (*childp)->core.border_width); } pos_major += (float) child_major + pad; } } /* Function Name: CalcChildrenPrefSizes * Description: Determines the total size in the major direction * of all children of the ButtonBox, as well as the * maximum value in both major and minor directions. * Arguments: bbox - the ButtonBox parent. * max_major - the maximum size of all the children * in the major dimension. * total - return location for the total size in the * major direction. * Returns: number of managed children. */ /* ARGSUSED */ static Cardinal CalcChildrenPrefSizes(XmButtonBoxWidget bbox, Dimension *max_major, Dimension *max_minor, Dimension *total) { Cardinal num_managed = 0; Widget *childp; XtWidgetGeometry geo; Dimension *maj_dim, *minor_dim; Boolean is_equal = EqualSize(bbox); if ( IsHorizontal(bbox) ) { maj_dim = &geo.width; minor_dim = &geo.height; } else { maj_dim = &geo.height; minor_dim = &geo.width; } *total = *max_major = *max_minor = 1; ForAllChildren(bbox, childp) { if ( !XtIsManaged(*childp) ) continue; num_managed++; if ((XmButtonBoxC_pref_width(*childp) == 0) || (XmButtonBoxC_pref_height(*childp) == 0)) { XtQueryGeometry(*childp, NULL, &geo); } else geo.border_width = (*childp)->core.border_width; if (XmButtonBoxC_pref_width(*childp) == 0) XmButtonBoxC_pref_width(*childp) = geo.width; else geo.width = XmButtonBoxC_pref_width(*childp); if (XmButtonBoxC_pref_height(*childp) == 0) XmButtonBoxC_pref_height(*childp) = geo.height; else geo.height = XmButtonBoxC_pref_height(*childp); ASSIGN_MAX(*max_major, *maj_dim + (2 * geo.border_width)); ASSIGN_MAX(*max_minor, *minor_dim + (2 * geo.border_width)); if (!is_equal) *total += (*maj_dim + (2 * geo.border_width)); } if ( is_equal ) *total = num_managed * (*max_major); return(num_managed); } /* Function Name: CalcChildSize * Description: Determines the size of a child * Arguments: bbox - the ButtonBox parent. * w - the child of interest. * max_major - the largest size allowed in the * major direction. * max_minor - the largest size allowed in the * minor direction. * child_major_total - total size of all children in the * major direction. * num_managed - number of managed children. * child_major - return location for child's base * major size. * child_minor - return location for child's base * minor size. * Returns: none. */ /* ARGSUSED */ static void CalcChildSize(XmButtonBoxWidget bbox, Widget w, Dimension max_major, Dimension max_minor, Dimension child_major_total, Cardinal num_managed, Dimension *child_major, Dimension *child_minor) { XtWidgetGeometry geo; Dimension box_minor, box_major; Dimension margin_major, margin_minor; if ((XmButtonBoxC_pref_width(w) == 0)||(XmButtonBoxC_pref_height(w) == 0)) XtQueryGeometry(w, NULL, &geo); else geo.border_width = w->core.border_width; if (XmButtonBoxC_pref_width(w) != 0) geo.width = XmButtonBoxC_pref_width(w); if (XmButtonBoxC_pref_height(w) != 0) geo.height = XmButtonBoxC_pref_height(w); if ( IsHorizontal(bbox) ) { margin_major = MarginW(bbox); margin_minor = MarginH(bbox); box_major = bbox->core.width; box_minor = bbox->core.height; *child_major = geo.width; *child_minor = geo.height; } else { margin_major = MarginH(bbox); margin_minor = MarginW(bbox); box_major = bbox->core.height; box_minor = bbox->core.width; *child_major = geo.height; *child_minor = geo.width; } *child_major += (2 * geo.border_width); *child_minor += (2 * geo.border_width); if ((int)box_major > (int)(2 * margin_major)) box_major -= (2 * margin_major); else box_major = 1; if ((int)box_minor > (int)(2 * margin_minor)) box_minor -= (2 * margin_minor); else box_minor = 1; if ( EqualSize(bbox) ) { *child_major = max_major; *child_minor = max_minor; } if ( FillOption(bbox) == XmFillMajor || FillOption(bbox) == XmFillAll || child_major_total > box_major ) { *child_major = (Dimension) (((float)*child_major/(float)child_major_total) * box_major); } if ( FillOption(bbox) == XmFillMinor || FillOption(bbox) == XmFillAll || *child_minor > box_minor ) { *child_minor = box_minor; } } /************************************************************ * * Public functions * ************************************************************/ /* Function Name: XmCreateButtonBox * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateButtonBox(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmButtonBoxWidgetClass, parent, args, num_args)); } Widget XmVaCreateButtonBox( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmButtonBoxWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedButtonBox( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmButtonBoxWidgetClass, parent, True, var, count); va_end(var); return w; } /****************************************************************/ static void ButtonBoxSetDefaultShadow(Widget button) { XmTakesDefaultTrait trait_default ; trait_default = (XmTakesDefaultTrait) XmeTraitGet((XtPointer) XtClass(button), XmQTtakesDefault) ; if (trait_default) trait_default->showAsDefault (button, XmDEFAULT_READY); } motif-2.3.8/lib/Xm/XpmI.h0000644000175000017500000003233313145162623011752 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XpmI_h #define _XpmI_h #ifdef __cplusplus extern "C" { #endif /* Xpm internal symbols are prefixed with _Xm */ #define xpmParseData _XmxpmParseData #define xpmParseDataAndCreate _XmxpmParseDataAndCreate #define xpmFreeColorTable _XmxpmFreeColorTable #define xpmInitAttributes _XmxpmInitAttributes #define xpmInitXpmImage _XmxpmInitXpmImage #define xpmInitXpmInfo _XmxpmInitXpmInfo #define xpmSetInfoMask _XmxpmSetInfoMask #define xpmSetInfo _XmxpmSetInfo #define xpmSetAttributes _XmxpmSetAttributes #define xpmCreatePixmapFromImage _XmxpmCreatePixmapFromImage #define xpmCreateImageFromPixmap _XmxpmCreateImageFromPixmap #define xpmHashTableInit _XmxpmHashTableInit #define xpmHashTableFree _XmxpmHashTableFree #define xpmHashSlot _XmxpmHashSlot #define xpmHashIntern _XmxpmHashIntern #define xpmNextString _XmxpmNextString #define xpmNextUI _XmxpmNextUI #define xpmGetString _XmxpmGetString #define xpmNextWord _XmxpmNextWord #define xpmGetCmt _XmxpmGetCmt #define xpmParseHeader _XmxpmParseHeader #define xpmParseValues _XmxpmParseValues #define xpmParseColors _XmxpmParseColors #define xpmParseExtensions _XmxpmParseExtensions #define xpmReadRgbNames _XmxpmReadRgbNames #define xpmGetRgbName _XmxpmGetRgbName #define xpmFreeRgbNames _XmxpmFreeRgbNames #define xpmGetRGBfromName _XmxpmGetRGBfromName #define xpm_xynormalizeimagebits _Xmxpm_xynormalizeimagebits #define xpm_znormalizeimagebits _Xmxpm_znormalizeimagebits #define xpmstrdup _Xmxpmstrdup #define xpmstrcasecmp _Xmxpmstrcasecmp #define xpmatoui _Xmxpmatoui #define xpmDataTypes _XmxpmDataTypes #define xpmColorKeys _XmxpmColorKeys /* The following is the original XpmI.h header file, except that it includes XpmP.h instead of xpm.h */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * XpmI.h: * * * * XPM library * * Internal Include file * * * * ** Everything defined here is subject to changes any time. ** * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ /* * The code related to FOR_MSW has been added by * HeDu (hedu@cul-ipn.uni-kiel.de) 4/94 */ #ifndef XPMI_h #define XPMI_h #include "XpmP.h" /* * lets try to solve include files */ #include #include #include #include #include /* stdio.h doesn't declare popen on a Sequent DYNIX OS */ #ifdef sequent extern FILE *popen(); #endif #if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE) #include #ifndef index #define index strchr #endif #ifndef rindex #define rindex strrchr #endif #else /* defined(SYSV) || defined(SVR4) || defined(VMS) */ #include #endif #if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) #ifndef bcopy #define bcopy(source, dest, count) memcpy(dest, source, count) #endif #ifndef bzero #define bzero(b, len) memset(b, 0, len) #endif #endif /* the following is defined in X11R6 but not in previous versions */ #ifdef __alpha #ifndef LONG64 #define LONG64 #endif #endif #ifdef VMS #include #include #endif /* The following should help people wanting to use their own memory allocation * functions. To avoid the overhead of a function call when the standard * functions are used these are all macros, even the XpmFree function which * needs to be a real function for the outside world though. * So if change these be sure to change the XpmFree function in misc.c * accordingly. */ #ifndef NO_XPMFREE_MACRO #ifdef XpmFree #undef XpmFree #endif #define XpmFree(ptr) free(ptr) #endif #ifndef FOR_MSW #define XpmMalloc(size) malloc((size)) #define XpmRealloc(ptr, size) realloc((ptr), (size)) #define XpmCalloc(nelem, elsize) calloc((nelem), (elsize)) #else /* checks for mallocs bigger than 64K */ #define XpmMalloc(size) boundCheckingMalloc((long)(size))/* in simx.[ch] */ #define XpmRealloc(ptr, size) boundCheckingRealloc((ptr),(long)(size)) #define XpmCalloc(nelem, elsize) \ boundCheckingCalloc((long)(nelem),(long) (elsize)) #endif #define XPMMAXCMTLEN BUFSIZ typedef struct { unsigned int type; union { FILE *file; char **data; } stream; char *cptr; unsigned int line; int CommentLength; char Comment[XPMMAXCMTLEN]; char *Bcmt, *Ecmt, Bos, Eos; int format; /* 1 if XPM1, 0 otherwise */ } xpmData; #define XPMARRAY 0 #define XPMFILE 1 #define XPMPIPE 2 #define XPMBUFFER 3 #define EOL '\n' #define TAB '\t' #define SPC ' ' typedef struct { char *type; /* key word */ char *Bcmt; /* string beginning comments */ char *Ecmt; /* string ending comments */ char Bos; /* character beginning strings */ char Eos; /* character ending strings */ char *Strs; /* strings separator */ char *Dec; /* data declaration string */ char *Boa; /* string beginning assignment */ char *Eoa; /* string ending assignment */ } xpmDataType; extern xpmDataType xpmDataTypes[]; /* * rgb values and ascii names (from rgb text file) rgb values, * range of 0 -> 65535 color mnemonic of rgb value */ typedef struct { int r, g, b; char *name; } xpmRgbName; /* Maximum number of rgb mnemonics allowed in rgb text file. */ #define MAX_RGBNAMES 1024 extern char *xpmColorKeys[]; #define TRANSPARENT_COLOR "None" /* this must be a string! */ /* number of xpmColorKeys */ #define NKEYS 5 /* XPM internal routines */ FUNC(xpmParseData, int, (xpmData *data, XpmImage *image, XpmInfo *info)); FUNC(xpmParseDataAndCreate, int, (Display *display, xpmData *data, XImage **image_return, XImage **shapeimage_return, XpmImage *image, XpmInfo *info, XpmAttributes *attributes)); FUNC(xpmFreeColorTable, void, (XpmColor *colorTable, int ncolors)); FUNC(xpmInitAttributes, void, (XpmAttributes *attributes)); FUNC(xpmInitXpmImage, void, (XpmImage *image)); FUNC(xpmInitXpmInfo, void, (XpmInfo *info)); FUNC(xpmSetInfoMask, void, (XpmInfo *info, XpmAttributes *attributes)); FUNC(xpmSetInfo, void, (XpmInfo *info, XpmAttributes *attributes)); FUNC(xpmSetAttributes, void, (XpmAttributes *attributes, XpmImage *image, XpmInfo *info)); #ifndef FOR_MSW FUNC(xpmCreatePixmapFromImage, void, (Display *display, Drawable d, XImage *ximage, Pixmap *pixmap_return)); FUNC(xpmCreateImageFromPixmap, void, (Display *display, Pixmap pixmap, XImage **ximage_return, unsigned int *width, unsigned int *height)); #endif /* structures and functions related to hastable code */ typedef struct _xpmHashAtom { char *name; void *data; } *xpmHashAtom; typedef struct { unsigned int size; unsigned int limit; unsigned int used; xpmHashAtom *atomTable; } xpmHashTable; FUNC(xpmHashTableInit, int, (xpmHashTable *table)); FUNC(xpmHashTableFree, void, (xpmHashTable *table)); FUNC(xpmHashSlot, xpmHashAtom *, (xpmHashTable *table, char *s)); FUNC(xpmHashIntern, int, (xpmHashTable *table, char *tag, void *data)); #define HashAtomData(i) ((void *)i) #define HashColorIndex(slot) ((unsigned int)((*slot)->data)) #define USE_HASHTABLE (cpp > 2 && ncolors > 4) /* I/O utility */ FUNC(xpmNextString, int, (xpmData *mdata)); FUNC(xpmNextUI, int, (xpmData *mdata, unsigned int *ui_return)); FUNC(xpmGetString, int, (xpmData *mdata, char **sptr, unsigned int *l)); #define xpmGetC(mdata) \ ((!mdata->type || mdata->type == XPMBUFFER) ? \ (*mdata->cptr++) : (getc(mdata->stream.file))) FUNC(xpmNextWord, unsigned int, (xpmData *mdata, char *buf, unsigned int buflen)); FUNC(xpmGetCmt, int, (xpmData *mdata, char **cmt)); FUNC(xpmParseHeader, int, (xpmData *mdata)); FUNC(xpmParseValues, int, (xpmData *data, unsigned int *width, unsigned int *height, unsigned int *ncolors, unsigned int *cpp, unsigned int *x_hotspot, unsigned int *y_hotspot, unsigned int *hotspot, unsigned int *extensions)); FUNC(xpmParseColors, int, (xpmData *data, unsigned int ncolors, unsigned int cpp, XpmColor **colorTablePtr, xpmHashTable *hashtable)); FUNC(xpmParseExtensions, int, (xpmData *data, XpmExtension **extensions, unsigned int *nextensions)); /* RGB utility */ FUNC(xpmReadRgbNames, int, (char *rgb_fname, xpmRgbName *rgbn)); FUNC(xpmGetRgbName, char *, (xpmRgbName *rgbn, int rgbn_max, int red, int green, int blue)); FUNC(xpmFreeRgbNames, void, (xpmRgbName *rgbn, int rgbn_max)); #ifdef FOR_MSW FUNC(xpmGetRGBfromName,int, (char *name, int *r, int *g, int *b)); #endif FUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp, register XImage *img)); FUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp, register XImage *img)); /* * Macros * * The XYNORMALIZE macro determines whether XY format data requires * normalization and calls a routine to do so if needed. The logic in * this module is designed for LSBFirst byte and bit order, so * normalization is done as required to present the data in this order. * * The ZNORMALIZE macro performs byte and nibble order normalization if * required for Z format data. * * The XYINDEX macro computes the index to the starting byte (char) boundary * for a bitmap_unit containing a pixel with coordinates x and y for image * data in XY format. * * The ZINDEX* macros compute the index to the starting byte (char) boundary * for a pixel with coordinates x and y for image data in ZPixmap format. * */ #define XYNORMALIZE(bp, img) \ if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \ xpm_xynormalizeimagebits((unsigned char *)(bp), img) #define ZNORMALIZE(bp, img) \ if (img->byte_order == MSBFirst) \ xpm_znormalizeimagebits((unsigned char *)(bp), img) #define XYINDEX(x, y, img) \ ((y) * img->bytes_per_line) + \ (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3) #define ZINDEX(x, y, img) ((y) * img->bytes_per_line) + \ (((x) * img->bits_per_pixel) >> 3) #define ZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2) #define ZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1) #define ZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x) #define ZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3) #ifdef __STDC__ #define Const const #else #define Const /**/ #endif #ifdef NEED_STRDUP FUNC(xpmstrdup, char *, (char *s1)); #else #undef xpmstrdup #define xpmstrdup strdup #endif #ifdef NEED_STRCASECMP FUNC(xpmstrcasecmp, int, (char *s1, char *s2)); #else #undef xpmstrcasecmp #define xpmstrcasecmp strcasecmp #endif FUNC(xpmatoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XpmI_h */ motif-2.3.8/lib/Xm/FontS.c0000644000175000017500000035327113146706173012135 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #define dbg() fprintf(stderr, "file: %s - XtWidgetToApplicationContext() on line: %d\n", __FILE__, __LINE__); #include #include #include #include /* May have to be strings.h on some systems. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "Xm/XmI.h" #define NUM_XLFD_DASHES 14 /* max number of fonts that can be returned (CARD16) */ #define TRY_FONTS (unsigned int) 65535 #define NUM_BUTTONS 30 /* The MAX number of encoding buttons. */ #define ANY_FAMILY 0 /* Don't change this, without fixing */ /* ProcessXldfFontData */ #define GET_FONT_SIZE BUFSIZ #define ALLOC_INC 100 #define FAMILY_INC 10 #define WIDGET_LIST_INC 10 #define POINT_DIVIDE 10 #define DEFAULT_WEIGHT ("medium") #define BOLD_WEIGHT ("bold") #define DEFAULT_SLANT ("r") #define ITALIC_SLANT ("i") #define DEFAULT_FIXED_SPACING ("c") #define OTHER_FIXED_SPACING ("m") #define PROPORTIONAL_SPACING ("p") #define STAR_STRING ("*") #define ANY_ENCODING ("*-*") #define FAMILY_COLUMNS 20 #define VISIBILE_FAMILIES 11 static short GValidSizes[] = { 2, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,26,28,36,48,72 }; /* * A font may only be scaled in one resolution, not all resolutions. */ #define IsScaled(fsw, fam) (XmFontS_use_scaling((fsw)) && \ ((CheckFlag(XmFontS_user_state((fsw)), DPI_75) && \ CheckFlag((fam)->state, SCALED_75)) || \ (CheckFlag(XmFontS_user_state((fsw)), DPI_100)&& \ CheckFlag((fam)->state, SCALED_100)))) /************************************************************ * GLOBAL DECLARATIONS ************************************************************/ /************************************************************ * Private functions - for creating children widgets. ************************************************************/ static void CreateChildren(XmFontSelectorWidget, ArgList, Cardinal); static void CreateTopWidgets(XmFontSelectorWidget, Widget, ArgList, Cardinal); static void CreateMiddleArea(XmFontSelectorWidget, ArgList, Cardinal); static void CreateSpacingBox(XmFontSelectorWidget, Widget, ArgList, Cardinal); static void CreateFontChoiceBox(XmFontSelectorWidget, Widget,ArgList,Cardinal); static void CreateResolutionBox(XmFontSelectorWidget, Widget,ArgList,Cardinal); static void CreateFamilyBox(XmFontSelectorWidget, Widget, ArgList, Cardinal); static void CreateSizesBox(XmFontSelectorWidget, Widget, ArgList, Cardinal); static void CreateBoldItalicBox(XmFontSelectorWidget,Widget,ArgList, Cardinal); static void CreateOtherChoiceBox(XmFontSelectorWidget, Widget, ArgList, Cardinal); /************************************************************ * Private functions. ************************************************************/ static void LoadFontData(Widget, FontData **, int *, String **, int *); static void ProcessXlfdFontData(XmFontSelectorWidget, FontInfo *, FontData *, int); static void SortOtherFontData(FontInfo *, String *, int); static void AddToOtherList(char *, String **, int *, int *); static void SetNonStringData(FontData *), SetFlag(Flag *, Flag, Boolean); static void StoreString(register String, register String, register int); static void SetLongFlag(LongFlag *, LongFlag, Boolean); static void UpdateExistingFamily(FamilyInfo *, FontData *); static void FillNewFamily(FamilyInfo *, FontData *); static void SetResolution(XmFontSelectorWidget, FontData *); static void DisplayCurrentFont(XmFontSelectorWidget, String); static void UpdateBoldItalic(XmFontSelectorWidget); static void UpdateFixedProportional(XmFontSelectorWidget); static void UpdateFamilies(XmFontSelectorWidget); static void UpdateSizes(XmFontSelectorWidget); static void SetComboValue(Widget, String), UnsetSiblings(Widget); static void DisplayUserError(XmFontSelectorWidget, String); static void SetDisplayedFont(XmFontSelectorWidget, String); static void AddToXlfdOnlyList(XmFontSelectorWidget, Widget); static void AddToXlfdSensitiveList(XmFontSelectorWidget, Widget); static void ChangeMode(XmFontSelectorWidget, Boolean, Boolean); static void SetOtherList(XmFontSelectorWidget, Boolean); static void AddToXlfdList(XmFontSelectorWidget, char *, FontData **, int *, int *); static Widget CreateEncodingMenu(XmFontSelectorWidget, Widget, ArgList, Cardinal); static FontInfo * LoadFontInfo(XmFontSelectorWidget); static int FindResolution(Widget), CmpStrings(const void *, const void *); static Boolean CheckFlag(Flag, Flag), CheckLongFlag(LongFlag, LongFlag); static Boolean FillData(XmFontSelectorWidget, FontData *, char *); static Boolean IsXlfdFont(register char *); static Boolean CheckEncoding(XmFontSelectorWidget, FamilyInfo *); static FamilyInfo *FindFamily(register XrmQuark, FamilyInfo *, int); static String BuildFontString(XmFontSelectorWidget, FontData *, String, int); static LongFlag SizeMapping(short); /************************************************************ * Callbacks ************************************************************/ static void ToggleMiddlePane(Widget, XtPointer, XtPointer); static void ToggleNameWindow(Widget, XtPointer, XtPointer); static void FamilyChanged(Widget, XtPointer, XtPointer); static void SizeChanged(Widget, XtPointer, XtPointer); static void ChangeEncoding(Widget, XtPointer, XtPointer); static void ToggleScaling(Widget, XtPointer, XtPointer); static void ToggleBold(Widget, XtPointer, XtPointer); static void ToggleItalic(Widget, XtPointer, XtPointer); static void Toggle75DPI(Widget, XtPointer, XtPointer); static void Toggle100DPI(Widget, XtPointer, XtPointer); static void ToggleBothDPI(Widget, XtPointer, XtPointer); static void ToggleProportional(Widget, XtPointer, XtPointer); static void ToggleFixed(Widget, XtPointer, XtPointer); static void ToggleBothSpacing(Widget, XtPointer, XtPointer); static void XlfdMode(Widget, XtPointer, XtPointer); static void OtherMode(Widget, XtPointer, XtPointer); static void RemoveUserError(Widget, XtPointer, XtPointer); /************************************************************ * Semi-Public functions ************************************************************/ static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static void GetValuesHook(Widget, ArgList, Cardinal *); static void Destroy(Widget); static void Initialize(Widget, Widget, ArgList, Cardinal*); static void ClassPartInitialize(WidgetClass w_class); static void ClassInitialize(); /* Resource definitions for Subclasses of Primitive */ #define SAMPLE \ ("abcdefghijklmonpqrstuvwxyz\n\ ABCDEFGHIJKLMONPQRSTUVWXYZ\n\ 1234567890\n!@#$%^&*()") /************************************************************ * STATIC DECLARATIONS ************************************************************/ /* * This table is the list of resolutions of fonts that are supported. * most machines have only 75 and 100 dpi fonts, so we only find which * of those we are closest to with FindResolution(). */ static int resolutions[] = { 75, 100 }; static XtResource resources[] = { { XmNspacing, XmCSpacing, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.internal_bw), XmRImmediate, (XtPointer) 2 }, { XmNseparatorOn, XmCSeparatorOn, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedRec, paned.separator_on), XmRImmediate, (XtPointer) True }, { XmNmarginHeight, XmCMargin, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.margin_height), XmRImmediate, (XtPointer) 0 }, { XmNcurrentFont, XmCString, XmRString, sizeof(String), XtOffsetOf(XmFontSelectorRec, fs.current_font), XmRImmediate, (XtPointer)NULL }, { XmNshowFontName, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmFontSelectorRec, fs.show_font_name), XmRImmediate, (XtPointer) False }, { XmNuseScaling, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmFontSelectorRec, fs.use_scaling), XmRImmediate, (XtPointer) True }, { XmNtextRows, XmCTextRows, XmRDimension, sizeof(Dimension), XtOffsetOf(XmFontSelectorRec, fs.text_rows), XmRImmediate, (XtPointer) 8 }, { XmNvalueChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmFontSelectorRec, fs.font_changed_callback), XmRImmediate, (XtPointer) NULL }, { XmNsampleText, XmCSampleText, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.sample_text), XmRString, (XtPointer) SAMPLE }, { XmNanyString, XmCAnyString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.any), XmRString, (XtPointer) "Any" }, { XmNanyLowerString, XmCAnyLowerString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.lower_any), XmRString, (XtPointer) "any" }, { XmNfamilyString, XmCFamilyString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.family), XmRString, (XtPointer) "Family" }, { XmNsizeString, XmCSizeString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.size), XmRString, (XtPointer) "Size" }, { XmNboldString, XmCBoldString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.bold), XmRString, (XtPointer) "Bold" }, { XmNitalicString, XmCItalicString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.italic), XmRString, (XtPointer) "Italic" }, { XmNoptionString, XmCOptionString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.option), XmRString, (XtPointer) "Options..." }, { XmNbothString, XmCBothString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.both), XmRString, (XtPointer) "Both" }, { XmNmonoSpaceString, XmCMonoSpaceString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.mono_space), XmRString, (XtPointer) "Fixed Width Fonts" }, { XmNpropSpaceString, XmCPropSpaceString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.prop_space), XmRString, (XtPointer) "Proportional Fonts" }, { XmNotherString, XmCOtherString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.other_font), XmRString, (XtPointer) "Other Fonts" }, { XmNxlfdString, XmCXlfdSpaceString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.xlfd), XmRString, (XtPointer) "Xlfd Fonts" }, { XmN75DPIstring, XmC75DPIString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.dpi_75), XmRString, (XtPointer) "75 dpi" }, { XmN100DPIstring, XmC100DPIString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.dpi_100), XmRString, (XtPointer) "100 dpi" }, { XmNscalingString, XmCScalingString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.scaling), XmRString, (XtPointer) "Use Font Scaling" }, { XmNshowNameString, XmCShowNameString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.show_name), XmRString, (XtPointer) "Show Font Name" }, /* * Stuff to set the valid charset/encoding pairs. */ { XmNencodingString, XmCEncodingString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFontSelectorRec, fs.strings.encoding_only), XmRString, (XtPointer) "Encoding" }, /* * NOTE: This resource value must end in a comma because the resource * converter is broken in Motif1.1.4. */ { XmNencodingList, XmCEncodingList, XmRStringTable, sizeof(String *), XtOffsetOf(XmFontSelectorRec, fs.strings.encoding_list), XmRString, (XtPointer) "iso8859-1," }, { XmNdefaultEncodingString, XmCDefaultEncodingString, XmRString, sizeof(String), XtOffsetOf(XmFontSelectorRec, fs.encoding), XmRString, (XtPointer) "iso8859-1" } }; static XmSyntheticResource syn_resources[] = { { XmNspacing, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.internal_bw), _XmFromPanedPixels, (XmImportProc) _XmToPanedPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(XmPanedRec, paned.margin_height), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels } }; static XtResource subresources[] = { { XmNshowSash, XmCShowSash, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmPanedConstraintsRec, paned.show_sash), XmRImmediate, (XtPointer) False } }; #define SuperClass ((ConstraintWidgetClass) &xmPanedClassRec) XmFontSelectorClassRec xmFontSelectorClassRec = { { /* core class fields */ /* superclass */ (WidgetClass) SuperClass, /* class name */ "XmFontSelector", /* size */ sizeof(XmFontSelectorRec), /* class_initialize */ ClassInitialize, /* class_part init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResourceList)resources, /* resource_count */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave*/ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ XtInheritResize, /* expose */ NULL, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ GetValuesHook, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator*/ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite class fields */ /* geometry_manager */ XtInheritGeometryManager, /* change_managed */ XtInheritChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL }, { /* constraint class fields */ /* subresources */ subresources, /* subresource_count */ XtNumber(subresources), /* constraint_size */ sizeof(XmFontSelectorConstraintsRec), /* initialize */ NULL, /* destroy */ NULL, /* set_values */ NULL, /* extension */ NULL }, { /* manager_class fields */ XtInheritTranslations, /* translations */ syn_resources, /* get resources */ XtNumber(syn_resources), /* num get_resources */ NULL, /* get_cont_resources */ 0, /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* paned_class fields */ NULL, /* extension */ }, { /* font selector class fields */ NULL, /* extension */ } }; WidgetClass xmFontSelectorWidgetClass = (WidgetClass) &xmFontSelectorClassRec; /*********************************************************** * * Private Functions. * ************************************************************/ /* Function Name: LoadFontInfo * Description: Loads the font information from the current screen. * Arguments: fsw - the font selector widget. * Returns: the font information. */ static FontInfo * LoadFontInfo(XmFontSelectorWidget fsw) { FontInfo *font_info = (FontInfo *) XtMalloc(sizeof(FontInfo)); FontData *xlfd_font_data; String *other_fonts; int xlfd_num_fonts, other_num_fonts; font_info->resolution = FindResolution((Widget) fsw); LoadFontData((Widget) fsw, &xlfd_font_data, &xlfd_num_fonts, &other_fonts, &other_num_fonts); ProcessXlfdFontData(fsw, font_info, xlfd_font_data, xlfd_num_fonts); SortOtherFontData(font_info, other_fonts, other_num_fonts); return(font_info); } /* Function Name: LoadFontData * Description: Loads the font data from the X Server, sorts it into * xlfd and non xlfd fonts, and sorts out the xlfd info. * Arguments: w - any widget on the screen. * RETURNED xlfd_data, num_xlfd - The xlfd font data. * RETURNED other_fonts, num_other - The list of non xlfd fonts. * Returns: none. */ static void LoadFontData(Widget w, FontData **xlfd_data, int *num_xlfd, String **other_fonts, int *num_other) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) w; char ** fonts, **ptr; int i, num, xlfd_alloc, other_alloc; *xlfd_data = NULL; *other_fonts = NULL; *num_xlfd = *num_other = xlfd_alloc = other_alloc = 0; fonts = XListFonts(XtDisplay(w), "*", TRY_FONTS, &num); /* * Loop the all the fonts and add each one to the proper list. */ if (fonts != NULL) { for (ptr = fonts, i = 0; i < num; i++, ptr++) { if (IsXlfdFont(*ptr)) AddToXlfdList(fsw, *ptr, xlfd_data, num_xlfd, &xlfd_alloc); else AddToOtherList(*ptr, other_fonts, num_other, &other_alloc); } XFreeFontNames(fonts); } } /* Function Name: ProcessXlfdFontData * Description: Processes the Xlfd data, to come up with lists * of various attributes. * Arguments: fsw - The Font Selector Widget. * font_info - the font information structure. * data, num - the xlfd data. * Returns: none. * * This takes the raw XLFD data and builds lists of families and * sizes, and stores all the information in the font_info structure. */ static void ProcessXlfdFontData(XmFontSelectorWidget fsw, FontInfo *font_info, FontData *data, int num_data) { int num, alloc, i; FamilyInfo *any_fam, *fam = NULL; FontData *top = data; String temp; /* * Leave space for the any family, filled in at the end of the function. * * NOTE: This assumes that (ANY_FAMILY == 0) */ num = 1; alloc = FAMILY_INC; fam = (FamilyInfo *) XtMalloc(sizeof(FamilyInfo) * alloc); fam->nameq = NULLQUARK; /* Don't use this family yet. */ /* * Set up the "Any" family. */ for (i = 0; i < num_data; i++, data++) { register FamilyInfo *cur_family = FindFamily(data->familyq, fam, num); if (cur_family == NULL) { if ( num >= alloc ) { alloc += FAMILY_INC; fam = (FamilyInfo *) XtRealloc((XtPointer) fam, sizeof(FamilyInfo) * alloc); } FillNewFamily(fam + num, data); num++; } else { UpdateExistingFamily(cur_family, data); } } font_info->family_info = fam; font_info->num_families = num; any_fam = fam + ANY_FAMILY; temp = _XmGetMBStringFromXmString(ANY_STRING(fsw)); any_fam->nameq = XrmStringToQuark(temp); XtFree(temp); any_fam->bold_nameq = XrmStringToQuark(BOLD_WEIGHT); any_fam->medium_nameq = XrmStringToQuark(DEFAULT_WEIGHT); any_fam->upright_nameq = XrmStringToQuark(DEFAULT_SLANT); any_fam->italic_nameq = XrmStringToQuark(ITALIC_SLANT); strcpy(any_fam->fixed_spacing, DEFAULT_FIXED_SPACING); any_fam->state = (Flag) 0; any_fam->sizes_75 = any_fam->sizes_100 = (LongFlag) 0; for (i = 1, fam++; i < num; i++, fam++) { any_fam->sizes_75 |= fam->sizes_75; any_fam->sizes_100 |= fam->sizes_100; any_fam->state |= fam->state; } any_fam->encodings = NULL; any_fam->encoding_alloc = 0; XtFree((XtPointer) top); } /* Function Name: SortOtherFonts * Description: Sorts the list of other fonts alphabetically * and stuffs them into the font data structure. * Arguments: font_info - the font information. * list, num - the list of fonts. * Returns: none */ static void SortOtherFontData(FontInfo *font_info, String *list, int num) { register int i = 0; qsort((void *) list, num, sizeof(String), CmpStrings); /* * Remove duplicates. */ while (i < (num - 1)) { if (streq(list[i], list[i+1])) { register int j; register String *ptr; XtFree((char*)list[i]); ptr = list + i; j = i; while ( ++j < num) { ptr[0] = ptr[1]; ptr++; } num--; /*Something has been removed, decrement count*/ } else i++; } font_info->others = list; font_info->num_others = num; } /* Function Name: CmpStrings * Description: Compares two strings. * Arguments: p1, p2 - two string pointers. * Returns: none */ static int CmpStrings(const void * p1, const void *p2) { String *s1 = (String *) p1; String *s2 = (String *) p2; return(strcmp(*s1, *s2)); } /* Function Name: FindResolution * Description: Finds the closest resolution * Arguments: w - any widget on the proper screen. * Returns: the closest allowable resolution to the real resolution. */ static int FindResolution(Widget w) { Screen *screen = XtScreen(w); register int i, xres, yres, min, pref; /* * there are 2.54 centimeters to an inch; so there are 25.4 millimeters. * * dpi = N pixels / (M millimeters / (25.4 millimeters / 1 inch)) * = N pixels / (M inch / 25.4) * = N * 25.4 pixels / M inch * * Or in integer arithmitic * * = (254 * N pixels / M inch + 5) / 10 */ /* This will get us the true pixels / inch. That is probably not what we want */ xres = (254 * WidthOfScreen(screen) / WidthMMOfScreen(screen) + 5) / 10; yres = (254 * HeightOfScreen(screen) / HeightMMOfScreen(screen) + 5) / 10; xres *= xres; yres *= yres; /* * Find the closest resolution by using a difference of squares. */ min = 32000; pref = resolutions[0]; /* We have to have some default. */ for (i = 0; i < XtNumber(resolutions); i++) { int diffx = (xres - resolutions[i] * resolutions[i]); int diffy = (yres - resolutions[i] * resolutions[i]); int tdiff; /* the total difference. */ /* * Square 'em. */ tdiff = (diffx * diffx) + (diffy * diffy); if (min > tdiff) { pref = resolutions[i]; min = tdiff; } } return(pref); } /* Function Name: IsXlfdFont * Description: Returns True if this is an LXFD font. * Arguments: str - the font name to check. * Returns: none. */ static Boolean IsXlfdFont(register char * str) { register int num_dashes = 0; register char c; for ( ; (c = *str) != '\0'; str++) { if (c == '-') num_dashes++; } return(num_dashes == NUM_XLFD_DASHES); } /* Function Name: AddToXlfdList * Description: Adds a font to the list of xlfd fonts. * Arguments: name - name of the font. * list, num - the list of xlfd fonts to add it to. * alloc - the number of allocated slots. * Returns: none. */ static void AddToXlfdList(XmFontSelectorWidget fsw, char *name, FontData **list, int *num, int *alloc) { FontData *current; if (*num >= *alloc) { *alloc += ALLOC_INC; *list = (FontData *) XtRealloc((XtPointer) *list, sizeof(FontData) * *alloc); } current = (*list) + *num; /* * If filling the data succeeded, then accept this name, otherwise * just ignore it. */ if (FillData(fsw, current, name)) (*num)++; } /* Function Name: AddToOtherList * Description: Adds a font to the list of other fonts. * Arguments: name - name of the font. * list, num - the list of other fonts to add it to. * alloc - the number of allocated slots. * Returns: none. */ static void AddToOtherList(char *name, String **list, int *num, int *alloc) { if (*num >= *alloc) { *alloc += ALLOC_INC; *list = (String *) XtRealloc((XtPointer) *list, sizeof(String) * *alloc); } (*list)[(*num)++] = XtNewString(name); } /* Function Name: FillData(fsw, current, name); * Description: Fills the current font data from an xlfd name. * Arguments: fsw - The font selector widget. * current - the font data structure to fill. * name - an xlfd name of a font. * Returns: False on failure. * * This name may have NOT *'s in it. */ #define GET_NEXT_FIELD(ptr) \ if (((ptr) = (char *) strchr((ptr), '-')) == NULL) \ return(False); \ (ptr)++ /* skip hyphen */ \ static Boolean FillData(XmFontSelectorWidget fsw, FontData *current, char *name) { char *ptr = name; char temp[BUFSIZ]; current->state = 0; /* Initialize value. */ GET_NEXT_FIELD(ptr); /* ptr == Foundry */ GET_NEXT_FIELD(ptr); /* ptr == Family */ StoreString(ptr, temp, BUFSIZ - 1); if (streq(temp, STAR_STRING)) { String str = _XmGetMBStringFromXmString(ANY_STRING(fsw)); strcpy(temp, str); XtFree((XtPointer) str); } current->familyq = XrmStringToQuark(temp); GET_NEXT_FIELD(ptr); /* ptr == Weight */ StoreString(ptr, temp, BUFSIZ - 1); current->weightq = XrmStringToQuark(temp); GET_NEXT_FIELD(ptr); /* ptr == Slant */ StoreString(ptr, current->slant, SLANT_LEN); GET_NEXT_FIELD(ptr); /* ptr == SetWidth_Name */ GET_NEXT_FIELD(ptr); /* ptr == Add_Style_Name */ GET_NEXT_FIELD(ptr); /* ptr == Pixel Size */ GET_NEXT_FIELD(ptr); /* ptr == Point Size */ StoreString(ptr, temp, BUFSIZ - 1); /* * the string '*' will default to 0 which is exactly what I want. */ current->point_size = (short) atoi(temp); GET_NEXT_FIELD(ptr); /* ptr == Resolution X */ StoreString(ptr, temp, BUFSIZ - 1); /* * the string '*' will default to 0 which is exactly what I want. */ current->resolution_x = (short) atoi(temp); GET_NEXT_FIELD(ptr); /* ptr == Resolution Y */ StoreString(ptr, temp, BUFSIZ - 1); /* * the string '*' will default to 0 which is exactly what I want. */ current->resolution_y = (short) atoi(temp); GET_NEXT_FIELD(ptr); /* ptr == Spacing */ StoreString(ptr, current->spacing, SPACING_LEN); GET_NEXT_FIELD(ptr); /* ptr == Average Width */ GET_NEXT_FIELD(ptr); /* ptr == Registry and Encoding */ current->encoding = XrmStringToQuark(ptr); SetNonStringData(current); return(True); /* success! */ } #undef GET_NEXT_FIELD /* Function Name: SetNonStringData * Description: Sets the non string part of the Font Data. * Arguments: current - the font data we are working with. * Returns: none. */ static void SetNonStringData(FontData *current) { char lower[BUFSIZ]; /* * Now fill in the non string fields. */ /* * If the weight_name field contains the words "bold" or "demi" * then this is a bold font. */ XmCopyISOLatin1Lowered(lower, XrmQuarkToString(current->weightq)); if ((strstr(lower, "bold") != NULL) || (strstr(lower, "demi") != NULL)) SetFlag(&(current->state), BOLD, True); /* * If the spacing is "p" then proportional, otherwize monospaced. */ XmCopyISOLatin1Lowered(lower, current->spacing); if (strstr(lower, PROPORTIONAL_SPACING) != NULL) SetFlag(&(current->state), PROPORTIONAL, True); /* * If the slant it "i" or "o" then this is an italic font. */ XmCopyISOLatin1Lowered(lower, current->slant); if ((strchr(lower, 'i') != NULL) || (strchr(lower, 'o') != NULL)) SetFlag(&(current->state), ITALIC, True); /* * If the point_size is 0 then this is a scalable font. */ if (current->point_size == 0) { if ((current->resolution_x == 75) && (current->resolution_y == 75)) SetFlag(&(current->state), SCALED_75, True); else if((current->resolution_x == 100)&&(current->resolution_y == 100)) SetFlag(&(current->state), SCALED_100, True); else if ((current->resolution_x == 0)&& (current->resolution_y == 0)) { /* * Sun sets all scaled fonts to have a resolution of 0x0 */ SetFlag(&(current->state), SCALED_75 | SCALED_100, True); } } /* * Check to see if resolution matches 75 or 100 dpi. */ if ((current->resolution_x == 75) && (current->resolution_y == 75)) SetFlag(&(current->state), DPI_75, True); else if ((current->resolution_x == 100) && (current->resolution_y == 100)) SetFlag(&(current->state), DPI_100, True); else if ((current->resolution_x == 0) && (current->resolution_y == 0)) { /* * Sun sets all scaled fonts to have a resolution of 0x0 */ SetFlag(&(current->state), DPI_75 | DPI_100, True); } } /* Function Name: StoreString * Description: Stores a portion of an xlfd name into the * string varaible passed. * Arguments: str - the portion of the string to store. * store - the string to store it in. * max_len - maximum length of the value. * Returns: none. */ static void StoreString(register String str, register String store, register int max_len) { register int i; register int c; for (i = 0; i < max_len; i++, str++, store++) { if (((c = *str) == '-') || (c == '\0')) break; *store = c; } *store = '\0'; } /* Function Name: CheckFlag * Description: Checks to see if a flag value is set * Arguments: state - the state variable containing the flag. * flag - the location of the flag. * Returns: True if flag set, False otherwise */ static Boolean CheckFlag(Flag state, Flag flag) { return((state & flag) == flag); } /* Function Name: CheckLongFlag * Description: Checks to see if a long flag value is set * Arguments: state - the state variable containing the flag. * flag - the location of the flag. * Returns: True if flag set, False otherwise */ static Boolean CheckLongFlag(LongFlag state, LongFlag flag) { return((state & flag) == flag); } /* Function Name: SetFlag * Description: Sets a flag value * Arguments: state - the state variable containing the flag. * flag - the location of the flag. * value - the value of the flag. * Returns: none. */ static void SetFlag(Flag *state, Flag flag, Boolean value) { if (value) *state |= flag; else *state &= ~flag; } /* Function Name: SetLongFlag * Description: Sets a flag value that is stored in a long * Arguments: state - the state variable containing the flag. * flag - the location of the flag. * value - the value of the flag. * Returns: none. */ static void SetLongFlag(LongFlag *state, LongFlag flag, Boolean value) { if (value) *state |= flag; else *state &= ~flag; } /* Function Name: FindFamily * Description: Finds family associated with the font passed. * Arguments: font - the font data. * list - the list of all families * num - the number of families. * Returns: a pointer to the family this font is in or NULL. * */ static FamilyInfo * FindFamily(register XrmQuark nameq, FamilyInfo *list, int num) { register int i; for (i = 0; i < num; i++, list++) { if (list->nameq == nameq) return(list); } return(NULL); } /* Function Name: UpdateExistingFamily * Description: Updates data, by adding another font to an * existion family. * Arguments: fam - the family to update. * font - the font to add. * Returns: none. */ static void UpdateExistingFamily(FamilyInfo *fam, FontData *font) { int i; if (CheckFlag(font->state, BOLD)) fam->bold_nameq = font->weightq; else fam->medium_nameq = font->weightq; if (CheckFlag(font->state, ITALIC)) fam->italic_nameq = XrmStringToQuark(font->slant); else fam->upright_nameq = XrmStringToQuark(font->slant); if (!streq(font->spacing, PROPORTIONAL_SPACING)) strcpy(fam->fixed_spacing, font->spacing); if (font->point_size != 0) { if ((font->resolution_x == 75) && (font->resolution_y == 75)) SetLongFlag(&(fam->sizes_75), SizeMapping(font->point_size), True); else if ((font->resolution_x == 100) && (font->resolution_y == 100)) SetLongFlag(&(fam->sizes_100),SizeMapping(font->point_size), True); } fam->state |= font->state; /* or in all bits. */ for (i = 0; TRUE; i++) { if (i == fam->encoding_alloc) { fam->encoding_alloc += NUM_BUTTONS; fam->encodings = (XrmQuark *) XtRealloc((char *) fam->encodings, sizeof(XrmQuark) * fam->encoding_alloc); memset((char *) (fam->encodings + i), 0, sizeof(XrmQuark) * NUM_BUTTONS); } if (fam->encodings[i] == font->encoding) return; if (fam->encodings[i] == 0) { fam->encodings[i] = font->encoding; return; } } } /* Function Name: FillNewFamily * Description: Fills in the information for a new font family. * Arguments: fam - the family data. * font - the first font we found. * Returns: none. */ static void FillNewFamily(FamilyInfo *fam, FontData *font) { fam->nameq = font->familyq; if (CheckFlag(font->state, BOLD)) { fam->bold_nameq = font->weightq; fam->medium_nameq = NULLQUARK; } else { fam->bold_nameq = NULLQUARK; fam->medium_nameq = font->weightq; } if (streq(font->spacing, PROPORTIONAL_SPACING)) strcpy(fam->fixed_spacing, DEFAULT_FIXED_SPACING); else strcpy(fam->fixed_spacing, font->spacing); if (CheckFlag(font->state, ITALIC)) { fam->italic_nameq = XrmStringToQuark(font->slant); fam->upright_nameq = NULLQUARK; } else { fam->italic_nameq = NULLQUARK; fam->upright_nameq = XrmStringToQuark(font->slant); } fam->sizes_75 = fam->sizes_100 = 0; fam->state = font->state; if (font->point_size != 0) { if ((font->resolution_x == 75) && (font->resolution_y == 75)) SetLongFlag(&(fam->sizes_75), SizeMapping(font->point_size), True); else if ((font->resolution_x == 100) && (font->resolution_y == 100)) SetLongFlag(&(fam->sizes_100),SizeMapping(font->point_size), True); } fam->encoding_alloc = NUM_BUTTONS; fam->encodings = (XrmQuark *) XtCalloc(fam->encoding_alloc, sizeof(XrmQuark)); fam->encodings[0] = fam->encoding_alloc; } /* Function Name: SizeMapping * Description: Maps the actual size to the sizes bit field * Arguments: size - the point size to map. * Returns: 0 if the size does not map, otherwise the bit it maps to. */ static LongFlag SizeMapping(short size) { register int count; size /= POINT_DIVIDE; for (count = 0; count < XtNumber(GValidSizes); count++) { if (GValidSizes[count] == size) return (((LongFlag) 1) << count); } return((LongFlag) 0); } /* Function Name: DisplayCurrentFont * Description: Displays the current font to the user. * Arguments: fsw - the font selector widget. * font - the current font name. * Returns: none. */ static void DisplayCurrentFont(XmFontSelectorWidget fsw, String font) { Arg largs[10]; Cardinal num_largs; XmFontList fl; XFontStruct *fontdata; char buf[BUFSIZ * 2]; Boolean err = False; if ((fontdata = XLoadQueryFont(XtDisplay((Widget) fsw), font)) == NULL) { sprintf(buf, "Font '%s'\nis not availiable on this machine", font); DisplayUserError(fsw, buf); err = True; } else { /* * Always clear out old errors */ RemoveUserError(NULL, (XtPointer)fsw, (XtPointer)0); /* * This is a hack to work around problems with Sun scaled fonts * and the Motif Text widget. It turns out that some sun fonts * when a size of * is specified will return a font of height 0 * this causes the ascent + descent to be zero and really confuses * the XmTextField widget. */ if ((fontdata->ascent + fontdata->descent) == 0) { if (IsXlfdFont(font)) { char *ptr, left_buf[BUFSIZ], right_buf[BUFSIZ], fbuf[BUFSIZ]; register int i, count; /* * This is a poorly formatted Sun Scaled font, * * Find where the size is and change it from a * to 140. */ for (ptr = font, i = count = 0; *ptr != 0; i++, ptr++) { if (*ptr != '-') continue; count++; if (count == 8) break; } ptr = (char *) strchr(ptr + 1, '-'); strcpy(right_buf, ptr); strcpy(left_buf, font); left_buf[i] = '\0'; sprintf(fbuf, "%s-140%s", left_buf, right_buf); if ((fontdata = XLoadQueryFont(XtDisplay((Widget) fsw), fbuf)) == NULL) { sprintf(buf, "Font '%s'\nis not availiable on this machine", font); DisplayUserError(fsw, buf); err = True; } } else { sprintf(buf, "Font '%s'\n%s", font, "is is zero pixels high and cannot be displayed."); DisplayUserError(fsw, buf); err = True; } } } if (!err) { fl = XmFontListCreate(fontdata, XmFONTLIST_DEFAULT_TAG); num_largs = 0; XtSetArg(largs[num_largs], XmNfontList, fl); num_largs++; XtSetValues(XmFontS_text(fsw), largs, num_largs); if (XmFontS_old_fontdata(fsw) != NULL) { XFreeFont(XtDisplay((Widget) fsw), XmFontS_old_fontdata(fsw)); XmFontListFree(XmFontS_old_fontlist(fsw)); } XmFontS_old_fontdata(fsw) = fontdata; XmFontS_old_fontlist(fsw) = fl; } if (XtIsManaged(XmFontS_name_label(fsw))) { XmString xmstr = XmStringCreateLocalized(font); num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, xmstr); num_largs++; XtSetValues(XmFontS_name_label(fsw), largs, num_largs); XmStringFree(xmstr); } /* * Fire off the callback for the user. */ { FontData *cf = XmFontS_font_info(fsw)->current_font; String str_ptr; if (XmFontS_xlfd_mode(fsw)) { BuildFontString(fsw, cf, XmFontS_get_font(fsw), GET_FONT_SIZE); str_ptr = XmFontS_get_font(fsw); } else str_ptr = XrmQuarkToString(cf->familyq); XtCallCallbackList((Widget) fsw, XmFontS_font_changed_callback(fsw), (XtPointer)str_ptr); } } /* Function Name: BuildFontString * Description: Builds a font string from the current font. * Arguments: fsw - the font selector widget. * cf - the font data to use. * buf - where to stuff the font name. * size - the size not to exceed. * Returns: the font string (same as buf). */ /* ARGSUSED */ static String BuildFontString(XmFontSelectorWidget fsw, FontData *cf, String buf, int size) { static XrmQuark anyquark2, anyquark = NULLQUARK; String family, encoding; char res_x[BUFSIZ], res_y[BUFSIZ], point_size[BUFSIZ]; if (anyquark == NULLQUARK) { String temp1 = _XmGetMBStringFromXmString(ANY_STRING(fsw)); String temp2 = _XmGetMBStringFromXmString(LOWER_ANY_STRING(fsw)); anyquark = XrmStringToQuark(temp1); anyquark2 = XrmStringToQuark(temp2); XtFree(temp1); XtFree(temp2); } if ((anyquark == cf->familyq) || (anyquark2 == cf->familyq)) family = STAR_STRING; else family = XrmQuarkToString(cf->familyq); if (cf->point_size == 0) strcpy(point_size, STAR_STRING); else sprintf(point_size, "%d", cf->point_size); if (cf->resolution_x == 0) strcpy(res_x, STAR_STRING); else sprintf(res_x, "%d", (int) cf->resolution_x); if (cf->resolution_y == 0) strcpy(res_y, STAR_STRING); else sprintf(res_y, "%d", (int) cf->resolution_y); encoding = ENCODING_STRING(fsw); /* * I should really check to see that the string fits, but * What would I do it I failed? */ sprintf(buf, "-*-%s-%s-%s-*-*-*-%s-%s-%s-%s-*-%s", family, XrmQuarkToString(cf->weightq), cf->slant, point_size, res_x, res_y, cf->spacing, encoding); return(buf); } /* Function Name: UpdateBoldItalic * Description: Updates the bold and italic buttons * Arguments: fsw - the font selector widget. * Returns: none. */ static void UpdateBoldItalic(XmFontSelectorWidget fsw) { Boolean set; FontData *cf = XmFontS_font_info(fsw)->current_font; FamilyInfo *fam; if ((fam = FindFamily(cf->familyq, XmFontS_font_info(fsw)->family_info, XmFontS_font_info(fsw)->num_families)) == NULL) { String params[1]; Cardinal num = 1; params[0] = XrmQuarkToString(cf->familyq); dbg(); _XmWarningMsg((Widget) fsw, XmNcouldNotFindFamilyData, XmNcouldNotFindFamilyDataMsg, params, num); return; } if ((fam->medium_nameq == NULLQUARK) || (fam->bold_nameq == NULLQUARK)) { set = (fam->medium_nameq == NULLQUARK); XmToggleButtonSetState(XmFontS_bold_toggle(fsw), set, False); SetFlag(&(XmFontS_user_state(fsw)), BOLD, set); XtSetSensitive(XmFontS_bold_toggle(fsw), False); } else { XtSetSensitive(XmFontS_bold_toggle(fsw), True); } if (CheckFlag(XmFontS_user_state(fsw), BOLD)) cf->weightq = fam->bold_nameq; else cf->weightq = fam->medium_nameq; if ((fam->upright_nameq == NULLQUARK)|| (fam->italic_nameq == NULLQUARK)) { set = (fam->upright_nameq == NULLQUARK); XmToggleButtonSetState(XmFontS_italic_toggle(fsw), set, False); SetFlag(&(XmFontS_user_state(fsw)), ITALIC, set); XtSetSensitive(XmFontS_italic_toggle(fsw), False); } else { XtSetSensitive(XmFontS_italic_toggle(fsw), True); } if (CheckFlag(XmFontS_user_state(fsw), ITALIC)) strcpy(cf->slant, XrmQuarkToString(fam->italic_nameq)); else strcpy(cf->slant, XrmQuarkToString(fam->upright_nameq)); } /* Function Name: UpdateFixedProportional * Description: Updates the string stored in the fixed/proportional * part of the current font data. * Arguments: fsw - the font selector widget. * Returns: none. */ static void UpdateFixedProportional(XmFontSelectorWidget fsw) { FontData *cf = XmFontS_font_info(fsw)->current_font; FamilyInfo *fam; Boolean setMono, setProp, setAny; if ((fam = FindFamily(cf->familyq, XmFontS_font_info(fsw)->family_info, XmFontS_font_info(fsw)->num_families)) == NULL) { String params[1]; Cardinal num = 1; params[0] = XrmQuarkToString(cf->familyq); dbg(); _XmWarningMsg((Widget) fsw, XmNcouldNotFindFamilyData, XmNcouldNotFindFamilyDataMsg, params, num); return; } if (CheckFlag(XmFontS_user_state(fsw), USER_PROPORTIONAL)) { if (CheckFlag(XmFontS_user_state(fsw), USER_FIXED)) { strcpy(cf->spacing, STAR_STRING); setMono = False; setProp = False; setAny = True; } else { strcpy(cf->spacing, PROPORTIONAL_SPACING); setMono = False; setProp = True; setAny = False; } } else if (CheckFlag(XmFontS_user_state(fsw), USER_FIXED)) { strcpy(cf->spacing, fam->fixed_spacing); setMono = True; setProp = False; setAny = False; } else { strcpy(cf->spacing, STAR_STRING); setMono = False; setProp = False; setAny = True; } if ( XmFontS_monospace(fsw) != NULL ) XmToggleButtonSetState(XmFontS_monospace(fsw), setMono, False); if ( XmFontS_proportional(fsw) != NULL ) XmToggleButtonSetState(XmFontS_proportional(fsw), setProp, False); if ( XmFontS_any_spacing(fsw) != NULL ) XmToggleButtonSetState(XmFontS_any_spacing(fsw), setAny, False); } /* Function Name: UpdateFamilies * Description: Updates the displayed families. * Arguments: fsw - the file selector widget. * Returns: none */ static void UpdateFamilies(XmFontSelectorWidget fsw) { Arg largs[10]; Cardinal num_largs; register int count; register int i, num; XmString *strs; LongFlag size_flag; FamilyInfo *fam = XmFontS_font_info(fsw)->family_info; FontData *cf = XmFontS_font_info(fsw)->current_font; Boolean str_match = False; String temp; num = XmFontS_font_info(fsw)->num_families; strs = (XmString *) XtMalloc(sizeof(XmString) * num); size_flag = SizeMapping(cf->point_size); for (i = count = 0; i < num; i++, fam++) { Boolean ok_75, ok_100, spacing_match, resolution_ok, has_sizes; /* * Only add this family if: * * The size is 0 (ANY SIZE) and there is a font of the current * right DPI, or * This is a scaled font and scaling is turned on, or * This font has current point size in 75 dpi and 75 or any selectd, or * This font has current point size in 100 dpi and 100 or any selectd. * * And * The Charset/Encodings match or any is selected. * The type of spacing matches. * This is a scaled font or there are some valid sizes * in the current point size. */ ok_75 = ((size_flag != 0) && CheckFlag(XmFontS_user_state(fsw), DPI_75) && CheckLongFlag(fam->sizes_75, size_flag)); ok_100 = ((size_flag != 0) && CheckFlag(XmFontS_user_state(fsw), DPI_100) && CheckLongFlag(fam->sizes_100, size_flag)); resolution_ok = (cf->resolution_x == 0) && (cf->resolution_y == 0); resolution_ok |= (CheckFlag(XmFontS_user_state(fsw), DPI_75) && CheckFlag(fam->state, DPI_75)); resolution_ok |= (CheckFlag(XmFontS_user_state(fsw), DPI_100) && CheckFlag(fam->state, DPI_100)); if (!(has_sizes = IsScaled(fsw, fam))) { has_sizes |= ((fam->sizes_75 != 0) && CheckFlag(XmFontS_user_state(fsw), DPI_75)); has_sizes |= ((fam->sizes_100 != 0) && CheckFlag(XmFontS_user_state(fsw), DPI_100)); } /* * The Any Family will match all spacings. */ spacing_match = (i == ANY_FAMILY); spacing_match |= (CheckFlag(XmFontS_user_state(fsw), USER_PROPORTIONAL) && CheckFlag(fam->state, PROPORTIONAL)); spacing_match |= (CheckFlag(XmFontS_user_state(fsw), USER_FIXED) && !CheckFlag(fam->state, PROPORTIONAL)); if (((cf->point_size == 0) || IsScaled(fsw, fam) || ok_75 || ok_100) && CheckEncoding(fsw, fam) && spacing_match && resolution_ok && has_sizes) { strs[count++] = XmStringCreateLocalized(XrmQuarkToString(fam->nameq)); str_match |= (fam->nameq == cf->familyq); } } num_largs = 0; /* * This font is no longer in the list, reset the list to ANY_STRING */ if (!str_match) { temp = _XmGetMBStringFromXmString(ANY_STRING(fsw)); XtSetArg(largs[num_largs], XmNvalue, temp); num_largs++; } else temp = NULL; XtSetArg(largs[num_largs], XmNitems, strs); num_largs++; XtSetArg(largs[num_largs], XmNitemCount, count); num_largs++; XtSetValues(XmFontS_family_box(fsw), largs, num_largs); if (!str_match) FamilyChanged(XmFontS_family_box(fsw), (XtPointer) fsw, NULL); for (count--; count >= 0; count--) XmStringFree(strs[count]); XtFree((XtPointer) strs); XtFree((XtPointer) temp); } /* Function Name: UpdateSizes * Description: Updates the list of sizes. * Arguments: fsw - the font selector widget. * Returns: none. */ static void UpdateSizes(XmFontSelectorWidget fsw) { FontData * cf = XmFontS_font_info(fsw)->current_font; Arg largs[10]; Cardinal num_largs = 0; register int count = 0; register int i, size; XmString *strs; LongFlag size_flag; FamilyInfo *family; Boolean editable, match = False; String temp = NULL; if ((family = FindFamily(XmFontS_font_info(fsw)->current_font->familyq, XmFontS_font_info(fsw)->family_info, XmFontS_font_info(fsw)->num_families)) == NULL) { String params[1]; Cardinal num = 1; params[0] = XrmQuarkToString(cf->familyq); dbg(); _XmWarningMsg((Widget) fsw, XmNcouldNotFindFamilyData, XmNcouldNotFindFamilyDataMsg, params, num); return; } if (IsScaled(fsw, family)) { family = XmFontS_font_info(fsw)->family_info + ANY_FAMILY; editable = True; } else { editable = False; } size_flag = 0; if (CheckFlag(XmFontS_user_state(fsw), DPI_75)) size_flag |= family->sizes_75; if (CheckFlag(XmFontS_user_state(fsw), DPI_100)) size_flag |= family->sizes_100; size = sizeof(LongFlag) * 8; /* There are 8 bits in a BYTE */ strs = (XmString *) XtMalloc(sizeof(XmString) * (size + 1)); /* * DMS - fix to work around apparent Motif 1.2.4 bug concerning * XmStrings containing as the empty string */ if (XmStringEmpty(ANY_STRING(fsw))) strs[count++] = XmStringCreateLocalized(" "); else strs[count++] = XmStringCopy(ANY_STRING(fsw)); for (i = 0; i < XtNumber(GValidSizes); i++) { char buf[10]; LongFlag flag = ((LongFlag) 1) << i; if (!CheckLongFlag(size_flag, flag) && !IsScaled(fsw, family)) continue; sprintf(buf, "%d", GValidSizes[i]); strs[count++] = XmStringCreateLocalized(buf); match |= (SizeMapping(cf->point_size) == flag); } if (!match) { temp = _XmGetMBStringFromXmString(ANY_STRING(fsw)); XtSetArg(largs[num_largs], XmNvalue, temp); num_largs++; } XtSetArg(largs[num_largs], XmNitems, strs); num_largs++; XtSetArg(largs[num_largs], XmNitemCount, count); num_largs++; XtSetArg(largs[num_largs], XmNeditable, editable); num_largs++; XtSetValues(XmFontS_size_box(fsw), largs, num_largs); if (!match) SizeChanged(XmFontS_size_box(fsw), (XtPointer) fsw, NULL); for (count--; count >= 0; count--) XmStringFree(strs[count]); XtFree((XtPointer) strs); XtFree((XtPointer) temp); } /* Function Name: SetComboValue * Description: Sets the value field of a Combination box. * Arguments: box - the combo box. * value - the value to set. * Returns: none. */ static void SetComboValue(Widget box, String value) { Arg largs[10]; Cardinal num_largs = 0; XtSetArg(largs[num_largs], XmNvalue, value); num_largs++; XtSetValues(box, largs, num_largs); } /* Function Name: UnsetSiblings * Description: Unsets all sibling toggles of this toggle. * Arguments: w - the toggle who's siblings we are unsetting. * Returns: none. */ static void UnsetSiblings(Widget w) { WidgetList children; Cardinal num_children; Arg largs[10]; Cardinal i, num_largs = 0; XtSetArg(largs[num_largs], XmNchildren, &children); num_largs++; XtSetArg(largs[num_largs], XmNnumChildren, &num_children); num_largs++; XtGetValues(XtParent(w), largs, num_largs); for (i = 0; i < num_children; i++) XmToggleButtonSetState(children[i], (children[i] == w), False); } /* Function Name: DisplayUserError * Description: Displays an error message to the user. * Arguments: fsw - the font selector widget. * msg - the message to display. * Returns: none * * NOTE: If (msg == NULL) then the value of current_text will be placed * in the text widget. */ static void DisplayUserError(XmFontSelectorWidget fsw, String msg) { String temp; if (msg != NULL) { /* * If the real text is already in current_text then do not * attempt to get it out of the widget, just use what we have * saved already, this hackery is necessary because of the * wierd state machine that is in this code. * * The problem being solved is that this should work if we call * DisplayUserError if a user error is already being displayed. */ if (XmFontS_current_text(fsw) != NULL) { temp = XmFontS_current_text(fsw); XmFontS_current_text(fsw) = NULL; } else temp = XmTextGetString(XmFontS_text(fsw)); XmTextSetString(XmFontS_text(fsw), msg); XmFontS_current_text(fsw) = temp; XmProcessTraversal(XmFontS_text(fsw), XmTRAVERSE_CURRENT); } else { if (XmFontS_current_text(fsw) == NULL) return; /* noting to do. */ temp = XmFontS_current_text(fsw); XmFontS_current_text(fsw) = NULL; XmTextSetString(XmFontS_text(fsw), temp); XtFree((XtPointer) temp); } } /* Function Name: SetResolution * Description: Sets the DPI toggles based on the FontData passed. * Arguments: fsw - the font selector widget. * cf - the font data to use. * Returns: none. */ static void SetResolution(XmFontSelectorWidget fsw, FontData *cf) { Boolean set75, set100, setAny; if ( cf->resolution_x != cf->resolution_y ) { set75 = False; set100 = False; setAny = True; } else if ( XmFontS_font_info(fsw)->current_font->resolution_x == 75 ) { set75 = True; set100 = False; setAny = False; } else if ( XmFontS_font_info(fsw)->current_font->resolution_x == 100 ) { set75 = False; set100 = True; setAny = False; } else { set75 = False; set100 = False; setAny = True; } XmToggleButtonSetState(XmFontS_dpi75(fsw), set75, False); XmToggleButtonSetState(XmFontS_dpi100(fsw), set100, False); XmToggleButtonSetState(XmFontS_dpiAny(fsw), setAny, False); } /* Function Name: SetDisplayedFont * Description: Sets the font to be displayed. * Arguments: fsw - the font selector widget. * font - the font to be displayed. * Returns: none. */ static void SetDisplayedFont(XmFontSelectorWidget fsw, String new_font) { Boolean set; Arg largs[10]; Cardinal num_largs; FontData *cf = XmFontS_font_info(fsw)->current_font; char buf[BUFSIZ]; sprintf(buf, "--%s-%s-%s----0-%d-%d-*--%s", STAR_STRING, DEFAULT_WEIGHT, DEFAULT_SLANT, XmFontS_font_info(fsw)->resolution, XmFontS_font_info(fsw)->resolution, ENCODING_STRING(fsw)); FillData(fsw, cf, buf); /* Put in default data. */ if (new_font != NULL) { if (IsXlfdFont(new_font)) FillData(fsw, cf, new_font); else { if (strchr(new_font, '-')) { String params[1]; Cardinal num = 1; params[0] = new_font; dbg(); _XmWarningMsg((Widget) fsw, XmNbadXlfdFont, XmNbadXlfdFontMsg, params, num); } else { ChangeMode(fsw, False, False); SetComboValue(XmFontS_family_box(fsw), new_font); /* * For optomization of FamilyChanged Only. */ cf->familyq = XrmStringToQuark(new_font); return; } } } num_largs = 0; set = CheckFlag(cf->state, ITALIC); SetFlag(&(XmFontS_user_state(fsw)), ITALIC, set); XtSetArg(largs[num_largs], XmNset, set); num_largs++; XtSetValues(XmFontS_italic_toggle(fsw), largs, num_largs); num_largs = 0; set = CheckFlag(cf->state, BOLD); SetFlag(&(XmFontS_user_state(fsw)), BOLD, set); XtSetArg(largs[num_largs], XmNset, set); num_largs++; XtSetValues(XmFontS_bold_toggle(fsw), largs, num_largs); SetComboValue(XmFontS_family_box(fsw), XrmQuarkToString(cf->familyq)); sprintf(buf, "%d", cf->point_size / POINT_DIVIDE); SetComboValue(XmFontS_size_box(fsw), buf); SetResolution(fsw, cf); XmCopyISOLatin1Lowered(buf, cf->spacing); if ( strstr(buf, STAR_STRING) != NULL ) { SetFlag(&(XmFontS_user_state(fsw)), USER_PROPORTIONAL | USER_FIXED, True); } else if ( strstr(buf, DEFAULT_FIXED_SPACING) != NULL || strstr(buf, OTHER_FIXED_SPACING) != NULL ) { SetFlag(&(XmFontS_user_state(fsw)), USER_FIXED, True); SetFlag(&(XmFontS_user_state(fsw)), USER_PROPORTIONAL, False); } else if ( strstr(buf, PROPORTIONAL_SPACING) != NULL ) { SetFlag(&(XmFontS_user_state(fsw)), USER_PROPORTIONAL, True); SetFlag(&(XmFontS_user_state(fsw)), USER_FIXED, False); } else { SetFlag(&(XmFontS_user_state(fsw)), USER_PROPORTIONAL | USER_FIXED, True); } UpdateFixedProportional(fsw); cf->familyq = NULLQUARK; /* work around FamilyChanged Optomization. */ FamilyChanged(XmFontS_family_box(fsw), (XtPointer) fsw, NULL); UpdateFamilies(fsw); } /************************************************************ * * Routines for handling when the change from other <--> xlfd mode * ************************************************************/ /* Function Name: AddToXlfdOnlyList * Description: Adds a widget to the xlfd only list. * Arguments: fsw - the font selector. * w - the widget to add. * Returns: none. */ static void AddToXlfdOnlyList(XmFontSelectorWidget fsw, Widget w) { int num = (int) XmFontS_num_xlfd_only(fsw); int alloc = (int) XmFontS_alloc_xlfd_only(fsw); if (num >= alloc) { alloc += WIDGET_LIST_INC; XmFontS_xlfd_only(fsw) = (WidgetList) XtRealloc((XtPointer) XmFontS_xlfd_only(fsw), sizeof(Widget) * alloc); XmFontS_alloc_xlfd_only(fsw) = alloc; } XmFontS_xlfd_only(fsw)[num] = w; (XmFontS_num_xlfd_only(fsw))++; } /* Function Name: AddToXlfdSensitiveList * Description: Adds a widget to the xlfd sensitive list. * Arguments: fsw - the font selector. * w - the widget to add. * Returns: none. */ static void AddToXlfdSensitiveList(XmFontSelectorWidget fsw, Widget w) { int num = (int) XmFontS_num_xlfd_sensitive(fsw); int alloc = (int) XmFontS_alloc_xlfd_sensitive(fsw); if (num >= alloc) { alloc += WIDGET_LIST_INC; XmFontS_xlfd_sensitive(fsw) = (WidgetList) XtRealloc((XtPointer) XmFontS_xlfd_sensitive(fsw), sizeof(Widget)* alloc); XmFontS_alloc_xlfd_sensitive(fsw) = alloc; } XmFontS_xlfd_sensitive(fsw)[num] = w; (XmFontS_num_xlfd_sensitive(fsw))++; } /* Function Name: ChangeMode * Description: Changes the mode of the font selector. * Arguments: fsw - the file selector widget. * xlfd_mode - If True then change to xlfd mode, * otherwize change to other mode. * force - For other mode - True if we're changing modes * false if we're displaying a font * * Returns: none. */ static void ChangeMode(XmFontSelectorWidget fsw, Boolean xlfd_mode, Boolean force) { Arg largs[10]; Cardinal num_largs; register WidgetList widgets; register int i, num; XmString family_label; XmFontS_xlfd_mode(fsw) = xlfd_mode; /* remember our current mode. */ num = (int) XmFontS_num_xlfd_sensitive(fsw); widgets = XmFontS_xlfd_sensitive(fsw); for (i = 0; i < num; i++, widgets++) XtSetSensitive(*widgets, xlfd_mode); num = (int) XmFontS_num_xlfd_only(fsw); widgets = XmFontS_xlfd_only(fsw); for (i = 0; i < num; i++, widgets++) { if (xlfd_mode) XtManageChild(*widgets); else XtUnmanageChild(*widgets); } if (xlfd_mode) { char buf[BUFSIZ]; FontData * cf = XmFontS_font_info(fsw)->current_font; String temp = _XmGetMBStringFromXmString(ANY_STRING(fsw)); family_label = FAMILY_STRING(fsw); /* * Reset the values in the family and size boxes to "any" */ SetComboValue(XmFontS_family_box(fsw), temp); SetComboValue(XmFontS_size_box(fsw), temp); cf->familyq = XrmStringToQuark(temp); cf->point_size = 0; UpdateFamilies(fsw); UpdateSizes(fsw); UpdateBoldItalic(fsw); UpdateFixedProportional(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); XtFree((XtPointer) temp); } else { family_label = OTHER_FONT_STRING(fsw); SetOtherList(fsw, force); } /* * Set the proper toggle buttons. */ UnsetSiblings((xlfd_mode) ? XmFontS_xlfd_toggle(fsw) : XmFontS_other_toggle(fsw)); num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, family_label); num_largs++; XtSetArg(largs[num_largs], XmNeditable, !xlfd_mode); num_largs++; XtSetValues(XmFontS_family_box(fsw), largs, num_largs); } /* Function Name: SetOtherList * Description: Fills the other list with a complete list of * all other fonts. * Arguments: fsw - the font selector widget. * force - True if toggled by user, False if user * is setting the current font * Returns: none */ static void SetOtherList(XmFontSelectorWidget fsw, Boolean force) { Arg largs[10]; Cardinal num_largs = 0; register int count; XmString *strs; String *others = XmFontS_font_info(fsw)->others; FontData * cf = XmFontS_font_info(fsw)->current_font; register int i, num = XmFontS_font_info(fsw)->num_others; String curFont = XmFontS_current_font(fsw); /* * Set the current font to the first one on the list. */ if (num > 0) { if (force) { XtSetArg(largs[num_largs], XmNvalue, *others); num_largs++; /* * This only to allow FamilyChanged to be more efficient. */ cf->familyq = XrmStringToQuark(*others); DisplayCurrentFont(fsw, *others); } else { XtSetArg(largs[num_largs], XmNvalue, curFont); num_largs++; cf->familyq = XrmStringToQuark(curFont); DisplayCurrentFont(fsw, curFont); } } else { XtSetArg(largs[num_largs], XmNvalue, " "); num_largs++; } strs = (XmString *) XtMalloc(sizeof(XmString) * num); for (i = count = 0; i < num; i++, others++) strs[count++] = XmStringCreateLocalized(*others); XtSetArg(largs[num_largs], XmNitems, strs); num_largs++; XtSetArg(largs[num_largs], XmNitemCount, count); num_largs++; XtSetValues(XmFontS_family_box(fsw), largs, num_largs); for (count--; count >= 0; count--) XmStringFree(strs[count]); XtFree((XtPointer) strs); } /************************************************************ * * These routines actually create the children of the font * selector. * ************************************************************/ /* Function Name: CreateChildren * Description: Creates all children of the font selector. * Arguments: fsw - the font selector. * args, num_args - the argument list. * Returns: none. */ static void CreateChildren(XmFontSelectorWidget fsw, ArgList args, Cardinal num_args) { Arg *margs, largs[10]; Cardinal num_largs; Widget temp, box; String temp_txt; CreateTopWidgets(fsw, (Widget) fsw, args, num_args); CreateMiddleArea(fsw, args, num_args); num_largs = 0; XtSetArg(largs[num_largs], XmNfillOption, XmFillAll); num_largs++; XtSetArg(largs[num_largs], XmNmarginHeight, 2); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); box = XtCreateManagedWidget("box", xmButtonBoxWidgetClass, (Widget) fsw, margs, num_args + num_largs); XtFree((XtPointer) margs); num_largs = 0; temp_txt = _XmGetMBStringFromXmString(SAMPLE_TEXT(fsw)); XtSetArg(largs[num_largs], XmNvalue, temp_txt); num_largs++; XtSetArg(largs[num_largs], XmNeditMode, XmMULTI_LINE_EDIT); num_largs++; XtSetArg(largs[num_largs], XmNwordWrap, True); num_largs++; XtSetArg(largs[num_largs], XmNscrollHorizontal, False); num_largs++; XtSetArg(largs[num_largs], XmNrows, XmFontS_text_rows(fsw)); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); temp = XmCreateScrolledText(box, "text", margs, num_args + num_largs); XtManageChild(XmFontS_text(fsw) = temp); XtFree((XtPointer) margs); XtFree((XtPointer) temp_txt); XtAddCallback(temp, XmNlosingFocusCallback, RemoveUserError, (XtPointer) fsw); XtAddCallback(temp, XmNmodifyVerifyCallback, RemoveUserError, (XtPointer) fsw); num_largs = 0; XtSetArg(largs[num_largs], XmNskipAdjust, True); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); temp = XtCreateWidget("nameLabel", xmLabelWidgetClass, (Widget) fsw, margs, num_args + num_largs); if (XmFontS_show_font_name(fsw)) XtManageChild(temp); XmFontS_name_label(fsw) = temp; XtFree((XtPointer) margs); } /* Function Name: CreateTopWidgets * Description: Creates the children in the middle area where * fonts are selected. * Arguments: fsw - the font selector. * parent - the parent of the created widgets. * args, num_args - the argument list. * Returns: none. */ static void CreateTopWidgets(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Arg *margs, largs[10]; Cardinal num_largs; Widget pane, button; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); num_largs++; XtSetArg(largs[num_largs], XmNspacing, 2); num_largs++; XtSetArg(largs[num_largs], XmNmarginWidth, 0); num_largs++; XtSetArg(largs[num_largs], XmNmarginHeight, 0); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); pane = XtCreateManagedWidget("topPane", xmPanedWidgetClass, parent, margs, num_args + num_largs); XtFree((XtPointer) margs); CreateFamilyBox(fsw, pane, args, num_args); CreateSizesBox(fsw, pane, args, num_args); CreateBoldItalicBox(fsw, pane, args, num_args); num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, OPTION_STRING(fsw));num_largs++; XtSetArg(largs[num_largs], XmNshadowThickness, 2); num_largs++; XtSetArg(largs[num_largs], XmNindicatorOn, False); num_largs++; XtSetArg(largs[num_largs], XmNskipAdjust, True); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); button = XtCreateManagedWidget("optionButton", xmToggleButtonWidgetClass, pane, margs, num_args + num_largs); XtFree((XtPointer) margs); XtAddCallback(button, XmNvalueChangedCallback, ToggleMiddlePane, (XtPointer) fsw); } /* Function Name: CreateMiddleArea * Description: Creates the widgets in the top left area. * These are the family, size, bold/italic and proportional * boxes. * Arguments: fsw - the file selection widget. * args, num_args - arguments to the font selector (filtered). * Returns: none. */ static void CreateMiddleArea(XmFontSelectorWidget fsw, ArgList args, Cardinal num_args) { Arg *margs, largs[10]; Cardinal num_largs; Widget pane, top_pane; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmVERTICAL); num_largs++; XtSetArg(largs[num_largs], XmNspacing, 2); num_largs++; XtSetArg(largs[num_largs], XmNmarginWidth, 0); num_largs++; XtSetArg(largs[num_largs], XmNmarginHeight, 0); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); pane = XtCreateWidget("middlePane", xmPanedWidgetClass, (Widget) fsw, margs, num_args + num_largs); XtFree((XtPointer) margs); XmFontS_middle_pane(fsw) = pane; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); num_largs++; XtSetArg(largs[num_largs], XmNspacing, 2); num_largs++; XtSetArg(largs[num_largs], XmNmarginWidth, 0); num_largs++; XtSetArg(largs[num_largs], XmNmarginHeight, 0); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); top_pane = XtCreateManagedWidget("leftPane", xmPanedWidgetClass, pane, margs, num_args + num_largs); XtFree((XtPointer) margs); CreateFontChoiceBox(fsw, top_pane, args, num_args); CreateResolutionBox(fsw, top_pane, args, num_args); CreateSpacingBox(fsw, pane, args, num_args); CreateOtherChoiceBox(fsw, pane, args, num_args); } /* Function Name: CreateFamilyBox * Description: Creates the family Family box. * Arguments: fsw - the file selection widget. * parent - the parent of this area. * args, num_args - arguments to the font selector (filtered). * Returns: none. */ static void CreateFamilyBox(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Widget c_box; Cardinal num_largs; Arg *margs, largs[15]; String temp = _XmGetMBStringFromXmString(ANY_STRING(fsw)); num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString,FAMILY_STRING(fsw)); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; XtSetArg(largs[num_largs], XmNcolumns, FAMILY_COLUMNS); num_largs++; XtSetArg(largs[num_largs], XmNpopupOffset, 0); num_largs++; XtSetArg(largs[num_largs], XmNverticalMargin, 0); num_largs++; XtSetArg(largs[num_largs], XmNhorizontalMargin, 0); num_largs++; XtSetArg(largs[num_largs], XmNverify, False); num_largs++; XtSetArg(largs[num_largs], XmNeditable, False); num_largs++; XtSetArg(largs[num_largs], XmNvisibleItemCount, VISIBILE_FAMILIES); num_largs++; /* * This may cause a problem in Motif I18N applications with 1.2 */ XtSetArg(largs[num_largs], XmNvalue, temp); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); c_box = XtCreateManagedWidget("families", xmDropDownWidgetClass, parent, margs, num_args + num_largs); XtAddCallback(c_box, XmNverifyTextCallback, FamilyChanged, (XtPointer)fsw); XtAddCallback(c_box, XmNupdateTextCallback, FamilyChanged, (XtPointer)fsw); XtFree((XtPointer) margs); XtFree((XtPointer) temp); XmFontS_family_box(fsw) = c_box; } /* Function Name: CreateSizesBox * Description: Creates the box for the sizes * Arguments: fsw - the file selection widget. * parent - the parent of this area. * args, num_args - arguments to the font selector (filtered). * Returns: none. * * NOTE: List is constructed later in UpdateSizes. */ static void CreateSizesBox(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Widget c_box; Cardinal num_largs; Arg *margs, largs[15]; String temp; num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, SIZE_STRING(fsw)); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; XtSetArg(largs[num_largs], XmNcolumns, 4); num_largs++; XtSetArg(largs[num_largs], XmNmaxLength, 3); num_largs++; XtSetArg(largs[num_largs], XmNpopupOffset, 0); num_largs++; XtSetArg(largs[num_largs], XmNverticalMargin, 0); num_largs++; XtSetArg(largs[num_largs], XmNhorizontalMargin, 0); num_largs++; XtSetArg(largs[num_largs], XmNverify, False); num_largs++; XtSetArg(largs[num_largs], XmNskipAdjust, True); num_largs++; XtSetArg(largs[num_largs], XmNvisibleItemCount, VISIBILE_FAMILIES); num_largs++; temp = _XmGetMBStringFromXmString(ANY_STRING(fsw)); XtSetArg(largs[num_largs], XmNvalue, temp); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); c_box = XtCreateManagedWidget("sizes", xmDropDownWidgetClass, parent, margs, num_args + num_largs); XtFree(temp); AddToXlfdOnlyList(fsw, c_box); XtAddCallback(c_box, XmNverifyTextCallback, SizeChanged, (XtPointer)fsw); XtAddCallback(c_box, XmNupdateTextCallback, SizeChanged, (XtPointer)fsw); XtFree((XtPointer) margs); XmFontS_size_box(fsw) = c_box; } /* Function Name: CreateBoldItalicBox * Description: Creates the bold and italic choice box. * Arguments: fsw - the file selection widget. * parent - the parent of this area. * args, num_args - arguments to the font selector (filtered). * Returns: none. */ static void CreateBoldItalicBox(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Widget box, button; Cardinal num_largs, num_str; Arg *margs, largs[10]; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; XtSetArg(largs[num_largs], XmNskipAdjust, True); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); box = XtCreateManagedWidget("boldItalicBox", xmButtonBoxWidgetClass, parent, margs, num_args + num_largs); AddToXlfdOnlyList(fsw, box); XtFree((XtPointer) margs); num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, BOLD_STRING(fsw)); num_str = num_largs++; XtSetArg(largs[num_largs], XmNindicatorType, XmN_OF_MANY); num_largs++; XtSetArg(largs[num_largs], XmNalignment, XmALIGNMENT_BEGINNING); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); button = XtCreateManagedWidget("boldButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XmFontS_bold_toggle(fsw) = button; XtAddCallback(button, XmNvalueChangedCallback, ToggleBold, (XtPointer)fsw); margs[num_str].value = (XtArgVal) ITALIC_STRING(fsw); button = XtCreateManagedWidget("italicButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XmFontS_italic_toggle(fsw) = button; XtAddCallback(button, XmNvalueChangedCallback, ToggleItalic, (XtPointer) fsw); XtFree((XtPointer) margs); } /* Function Name: CreateSpacingBox * Description: Creates the spacing choice box. * Arguments: fsw - the file selection widget. * parent - the parent of this area. * args, num_args - arguments to the font selector (filtered). * Returns: none. */ static void CreateSpacingBox(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Widget box, button; Cardinal num_largs, num_str, num_set; Arg *margs, largs[10]; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; XtSetArg(largs[num_largs], XmNfillOption, XmFillMajor); num_largs++; XtSetArg(largs[num_largs], XmNequalSize, True); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); box = XtCreateManagedWidget("spacingBox", xmButtonBoxWidgetClass, parent, margs, num_args + num_largs); AddToXlfdSensitiveList(fsw, box); XtFree((XtPointer) margs); num_largs = 0; XtSetArg(largs[num_largs], XmNset, False); num_set = num_largs++; XtSetArg(largs[num_largs], XmNlabelString, PROPORTIONAL_STRING(fsw)); num_str = num_largs++; XtSetArg(largs[num_largs], XmNindicatorType, XmONE_OF_MANY); num_largs++; XtSetArg(largs[num_largs], XmNalignment, XmALIGNMENT_BEGINNING); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); button = XtCreateManagedWidget("proportionalButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XtAddCallback(button, XmNvalueChangedCallback, ToggleProportional, (XtPointer) fsw); XmFontS_proportional(fsw) = button; margs[num_str].value = (XtArgVal) MONO_SPACE_STRING(fsw); button = XtCreateManagedWidget("monoButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XtAddCallback(button, XmNvalueChangedCallback, ToggleFixed, (XtPointer) fsw); XmFontS_monospace(fsw) = button; margs[num_str].value = (XtArgVal) BOTH_STRING(fsw); margs[num_set].value = (XtArgVal) True; button = XtCreateManagedWidget("bothButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XtAddCallback(button, XmNvalueChangedCallback, ToggleBothSpacing, (XtPointer) fsw); XmFontS_any_spacing(fsw) = button; SetFlag(&(XmFontS_user_state(fsw)), USER_FIXED | USER_PROPORTIONAL, True); XtFree((XtPointer) margs); } /* Function Name: CreateFontChoiceBox * Description: Create a box to choose between xlfd fonts and others. * Arguments: fsw - the file selection widget. * parent - the parent of this area. * args, num_args - arguments to the font selector (filtered). * Returns: none. */ static void CreateFontChoiceBox(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Widget box, button; Cardinal num_largs, num_str, num_set; Arg *margs, largs[10]; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; XtSetArg(largs[num_largs], XmNfillOption, XmFillMajor); num_largs++; XtSetArg(largs[num_largs], XmNequalSize, True); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); box = XtCreateManagedWidget("choiceBox", xmButtonBoxWidgetClass, parent, margs, num_args + num_largs); XtFree((XtPointer) margs); num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, XLFD_STRING(fsw)); num_str = num_largs++; XtSetArg(largs[num_largs], XmNset, True); num_set = num_largs++; XtSetArg(largs[num_largs], XmNindicatorType, XmONE_OF_MANY); num_largs++; XtSetArg(largs[num_largs], XmNalignment, XmALIGNMENT_BEGINNING); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); button = XtCreateManagedWidget("xlfdButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XmFontS_xlfd_toggle(fsw) = button; XtAddCallback(button, XmNvalueChangedCallback, XlfdMode, (XtPointer) fsw); margs[num_str].value = (XtArgVal) OTHER_FONT_STRING(fsw); margs[num_set].value = (XtArgVal) False; button = XtCreateManagedWidget("otherButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XtAddCallback(button, XmNvalueChangedCallback, OtherMode, (XtPointer) fsw); XmFontS_other_toggle(fsw) = button; XtFree((XtPointer) margs); } /* Function Name: CreateResolution Box * Description: Create the box to allow resolution choice(s). * Arguments: fsw - the file selection widget. * parent - the parent of this area. * args, num_args - arguments to the font selector (filtered). * Returns: none. */ static void CreateResolutionBox(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Widget box, button; Cardinal num_largs, num_str, num_set; Arg *margs, largs[10]; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; XtSetArg(largs[num_largs], XmNfillOption, XmFillMajor); num_largs++; XtSetArg(largs[num_largs], XmNequalSize, True); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); box = XtCreateManagedWidget("resolutionBox", xmButtonBoxWidgetClass, parent, margs, num_args + num_largs); AddToXlfdSensitiveList(fsw, box); XtFree((XtPointer) margs); num_largs = 0; XtSetArg(largs[num_largs], XmNset, False); num_set = num_largs++; XtSetArg(largs[num_largs], XmNlabelString, DPI75_STRING(fsw)); num_str = num_largs++; XtSetArg(largs[num_largs], XmNindicatorType, XmONE_OF_MANY); num_largs++; XtSetArg(largs[num_largs], XmNalignment, XmALIGNMENT_BEGINNING); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); margs[num_set].value = (XtArgVal) (XmFontS_font_info(fsw)->resolution == 75); button = XtCreateManagedWidget("dpi75Button", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XtAddCallback(button, XmNvalueChangedCallback, Toggle75DPI, fsw); XmFontS_dpi75(fsw) = button; margs[num_str].value = (XtArgVal) DPI100_STRING(fsw); margs[num_set].value = (XtArgVal) (XmFontS_font_info(fsw)->resolution == 100); button = XtCreateManagedWidget("dpi100Button", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XtAddCallback(button, XmNvalueChangedCallback, Toggle100DPI, fsw); XmFontS_dpi100(fsw) = button; margs[num_str].value = (XtArgVal) BOTH_STRING(fsw); margs[num_set].value = (XtArgVal) False; button = XtCreateManagedWidget("anyButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XtAddCallback(button, XmNvalueChangedCallback, ToggleBothDPI, fsw); XmFontS_dpiAny(fsw) = button; XtFree((XtPointer) margs); } /* Function Name: CreateOtherChoiceBox * Description: Creates the box to allow other choices to be made. * Arguments: fsw - the file selection widget. * parent - the parent of this area. * args, num_args - arguments to the font selector (filtered). * Returns: none. */ static void CreateOtherChoiceBox(XmFontSelectorWidget fsw, Widget parent, ArgList args, Cardinal num_args) { Widget box, button; Cardinal num_largs, num_str, num_set; Arg *margs, largs[10]; num_largs = 0; XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); num_largs++; XtSetArg(largs[num_largs], XmNfillOption, XmFillMajor); num_largs++; XtSetArg(largs[num_largs], XmNequalSize, True); num_largs++; XtSetArg(largs[num_largs], XmNshowSash, False); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); box = XtCreateManagedWidget("otherChoiceBox", xmButtonBoxWidgetClass, parent, margs, num_args + num_largs); XtFree((XtPointer) margs); num_largs = 0; XtSetArg(largs[num_largs], XmNset, False); num_set = num_largs++; XtSetArg(largs[num_largs], XmNlabelString, SCALING_STRING(fsw)); num_str = num_largs++; XtSetArg(largs[num_largs], XmNindicatorType, XmN_OF_MANY); num_largs++; XtSetArg(largs[num_largs], XmNalignment, XmALIGNMENT_BEGINNING); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); margs[num_set].value = (XtArgVal) XmFontS_use_scaling(fsw); button = XtCreateManagedWidget("scalingButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XmFontS_use_scaling_toggle(fsw) = button; AddToXlfdSensitiveList(fsw, button); XtAddCallback(button, XmNvalueChangedCallback, ToggleScaling, (XtPointer) fsw); margs[num_str].value = (XtArgVal) SHOW_NAME_STRING(fsw); margs[num_set].value = (XtArgVal) XmFontS_show_font_name(fsw); button = XtCreateManagedWidget("showNameButton", xmToggleButtonWidgetClass, box, margs, num_args + num_largs); XmFontS_show_font_toggle(fsw) = button; XtAddCallback(button, XmNvalueChangedCallback, ToggleNameWindow, (XtPointer) fsw); XmFontS_option_menu(fsw) = CreateEncodingMenu(fsw, box, args, num_args); AddToXlfdSensitiveList(fsw, XmFontS_option_menu(fsw)); XtFree((XtPointer) margs); } /* Function Name: CreateEncodingMenu * Description: Creates the encoding option menu. * Arguments: fsw - The font selector widget. * parent - The parent of the option menu. * args - Args used to create the font selector. * Returns: The Id of the menu created. */ static Widget CreateEncodingMenu(XmFontSelectorWidget fsw, Widget box, ArgList args, Cardinal num_args) { Widget omenu, history = NULL, pulldownMenu, button, menuShell, destroy_old_menu; Cardinal num_largs, button_label; int current, i; Arg *margs, largs[10]; String *encodings; /* * Create the option menu only the first time through, otherwise * simply blow away the encoding_menu_shell and recreate that. */ destroy_old_menu = XmFontS_encoding_menu_shell(fsw); if (destroy_old_menu == NULL) { num_largs = 0; XtSetArg(largs[num_largs], XmNrowColumnType, XmMENU_OPTION); num_largs++; XtSetArg(largs[num_largs], XmNlabelString, ENCODING_ONLY_STRING(fsw)); num_largs++; XtSetArg(largs[num_largs], XmNoptionLabel, ENCODING_ONLY_STRING(fsw)); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); omenu = XtCreateWidget("encodingOptionMenu", xmRowColumnWidgetClass, box, margs, num_args + num_largs); XtFree((XtPointer) margs); } else { omenu = XmFontS_option_menu(fsw); } num_largs = 0; XtSetArg(largs[num_largs], XmNwidth, 1); num_largs++; XtSetArg(largs[num_largs], XmNheight, 1); num_largs++; XtSetArg(largs[num_largs], XmNancestorSensitive, True); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); menuShell = XtCreatePopupShell("menuShell", xmMenuShellWidgetClass, box, margs, num_args + num_largs); XtFree((XtPointer) margs); XmFontS_encoding_menu_shell(fsw) = menuShell; num_largs = 0; XtSetArg(largs[num_largs], XmNrowColumnType, XmMENU_PULLDOWN); num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); pulldownMenu = XtCreateWidget("pulldownMenu", xmRowColumnWidgetClass, menuShell, margs, num_args + num_largs); XtFree((XtPointer) margs); num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, ANY_STRING(fsw)); button_label = num_largs++; margs = XtMergeArgLists(largs, num_largs, args, num_args); button = XtCreateManagedWidget("button_0", xmPushButtonWidgetClass, pulldownMenu, margs, num_args + num_largs); XtAddCallback(button, XmNactivateCallback, ChangeEncoding, (XtPointer) 0); current = 0; for (i = 1, encodings = ENCODING_LIST(fsw) ; *encodings != NULL; i++, encodings++) { char name[BUFSIZ]; XmString label = XmStringCreateLocalized(*encodings); margs[button_label].value = (XtArgVal) label; sprintf(name, "button_%d", i); button = XtCreateManagedWidget(name, xmPushButtonWidgetClass, pulldownMenu, margs, num_args + num_largs); XmStringFree(label); XtAddCallback(button, XmNactivateCallback, ChangeEncoding, (XtPointer) i); if (streq(*encodings, ENCODING_STRING(fsw))) { current = i; history = button; } } XtFree((XtPointer) margs); num_largs = 0; XtSetArg(largs[num_largs], XmNsubMenuId, pulldownMenu); num_largs++; /* * DMS - Fix 2/27/96 */ if (history) { XtSetArg(largs[num_largs], XmNmenuHistory, history); num_largs++; } XtSetValues(omenu, largs, num_largs); if (destroy_old_menu != NULL) { XtDestroyWidget(destroy_old_menu); } XtManageChild(omenu); XtFree(ENCODING_STRING(fsw)); if (current == 0) ENCODING_STRING(fsw) = XtNewString(ANY_ENCODING); else ENCODING_STRING(fsw) = XtNewString(ENCODING_LIST(fsw)[current - 1]); return(omenu); } /* Function Name: CheckEncoding * Description: Checks the encoding of a font to see if it matches * the currently selected one, and returns true on a match. * Arguments: fsw - The font selector widget. * fam - The family that we are checking. * Returns: True if the encodings matchd, or any is selected. */ static Boolean CheckEncoding(XmFontSelectorWidget fsw, FamilyInfo *fam) { int i; XrmQuark curr; if (streq(ENCODING_STRING(fsw), ANY_ENCODING) || fam->encodings == NULL) return(TRUE); curr = XrmStringToQuark(ENCODING_STRING(fsw)); for (i = 0; TRUE; i++) { if (fam->encodings[i] == curr) return(True); if (fam->encodings[i] == 0 || i == fam->encoding_alloc) return(False); } } /************************************************************ * * Callbacks. * ************************************************************/ /* Function Name: FamilyChanged * Description: Called when the user changes the family * Arguments: w - *** UNUSED ***. * fsw_ptr - pointer to the font selector widget. * junk - *** UNUSED ***. * Returns: none */ /* ARGSUSED */ static void FamilyChanged(Widget w, XtPointer fsw_ptr, XtPointer junk) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; String str = XmDropDownGetValue(w); char buf[BUFSIZ]; XrmQuark familyq = XrmStringToQuark(str); if (cf->familyq == familyq) return; /* no change. */ cf->familyq = familyq; if (XmFontS_xlfd_mode(fsw)) { UpdateBoldItalic(fsw); UpdateFixedProportional(fsw); UpdateSizes(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } else { DisplayCurrentFont(fsw, str); } XtFree((XtPointer) str); } /* Function Name: SizeChanged * Description: Called when the user changes the Size * Arguments: w - *** UNUSED ***. * fsw_ptr - pointer to the font selector widget. * junk - *** UNUSED ***. * Returns: none */ /* ARGSUSED */ static void SizeChanged(Widget w, XtPointer fsw_ptr, XtPointer junk) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; String str = XmDropDownGetValue(w); char buf[BUFSIZ]; short size; if (cf->point_size == (size = atoi(str) * 10)) { XtFree((char*)str); return; /* no change. */ } cf->point_size = size; UpdateFamilies(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); XtFree((XtPointer) str); } /* Function Name: ChangeEncoding * Description: Called when the user changes the encoding. * Arguments: w - a widget child of the font sel. * data - pointer to index of the option button. * junk - ***unused * Returns: none */ /* ARGSUSED */ static void ChangeEncoding(Widget w, XtPointer data, XtPointer junk) { XmFontSelectorWidget fsw; FontData *cf; char buf[BUFSIZ]; for ( ; !XtIsSubclass(w, xmFontSelectorWidgetClass); w = XtParent(w)) {} fsw = (XmFontSelectorWidget) w; cf = XmFontS_font_info(fsw)->current_font; if ((int) data == 0) { XtFree(ENCODING_STRING(fsw)); ENCODING_STRING(fsw) = XtNewString(ANY_ENCODING); } else { XtFree(ENCODING_STRING(fsw)); ENCODING_STRING(fsw) = XtNewString(ENCODING_LIST(fsw)[(int) data - 1]); } UpdateFamilies(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleScaling * Description: Called when the user toggles the Font Scaling button. * Arguments: w - *** UNUSED ***. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ /* ARGSUSED */ static void ToggleScaling(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; FamilyInfo *family; XmToggleButtonCallbackStruct *info; LongFlag map; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; if ((family = FindFamily(cf->familyq, XmFontS_font_info(fsw)->family_info, XmFontS_font_info(fsw)->num_families)) == NULL) { String params[1]; Cardinal num = 1; params[0] = XrmQuarkToString(cf->familyq); dbg(); _XmWarningMsg((Widget) fsw, XmNcouldNotFindFamilyData, XmNcouldNotFindFamilyDataMsg, params, num); return; } XmFontS_use_scaling(fsw) = info->set; if (!info->set) { Boolean map_bad = (map = SizeMapping(cf->point_size)) == 0; Boolean bad_75 = (CheckFlag(XmFontS_user_state(fsw), DPI_75) && !CheckLongFlag(family->sizes_75, map)); Boolean bad_100 = (CheckFlag(XmFontS_user_state(fsw), DPI_100) && !CheckLongFlag(family->sizes_100, map)); if (map_bad || bad_75 || (bad_100 && (cf->point_size != 0))) { String temp = _XmGetMBStringFromXmString(ANY_STRING(fsw)); cf->point_size = 0; /* Reset to Any. */ SetComboValue(XmFontS_size_box(fsw), temp); XtFree((XtPointer) temp); } } UpdateSizes(fsw); UpdateFamilies(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleBold * Description: Called when the user toggles the bold button. * Arguments: w - *** UNUSED ***. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ /* ARGSUSED */ static void ToggleBold(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; FamilyInfo *family; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; if ((family = FindFamily(cf->familyq, XmFontS_font_info(fsw)->family_info, XmFontS_font_info(fsw)->num_families)) == NULL) { String params[1]; Cardinal num = 1; params[0] = XrmQuarkToString(cf->familyq); dbg(); _XmWarningMsg((Widget) fsw, XmNcouldNotFindFamilyData, XmNcouldNotFindFamilyDataMsg, params, num); return; } if (info->set) cf->weightq = family->bold_nameq; else cf->weightq = family->medium_nameq; SetFlag(&(cf->state), BOLD, info->set); SetFlag(&(XmFontS_user_state(fsw)), BOLD, info->set); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleItalic * Description: Called when the user toggles the italic button. * Arguments: w - *** UNUSED ***. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ /* ARGSUSED */ static void ToggleItalic(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; FamilyInfo *family; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; if ((family = FindFamily(cf->familyq, XmFontS_font_info(fsw)->family_info, XmFontS_font_info(fsw)->num_families)) == NULL) { String params[1]; Cardinal num = 1; params[0] = XrmQuarkToString(cf->familyq); dbg(); _XmWarningMsg((Widget) fsw, XmNcouldNotFindFamilyData, XmNcouldNotFindFamilyDataMsg, params, num); return; } if (info->set) strcpy(cf->slant, XrmQuarkToString(family->italic_nameq)); else strcpy(cf->slant, XrmQuarkToString(family->upright_nameq)); SetFlag(&(cf->state), ITALIC, info->set); SetFlag(&(XmFontS_user_state(fsw)), ITALIC, info->set); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleMiddlePane * Description: toggles whether or not the middle pane is shown * Arguments: w - *** UNUSED ***. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ /* ARGSUSED */ static void ToggleMiddlePane(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; XmToggleButtonCallbackStruct *info; info = (XmToggleButtonCallbackStruct *) data; if (info->set) XtManageChild(XmFontS_middle_pane(fsw)); else XtUnmanageChild(XmFontS_middle_pane(fsw)); } /* Function Name: ToggleNameWindow * Description: toggles whether or not the middle pane is shown * Arguments: w - *** UNUSED ***. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ /* ARGSUSED */ static void ToggleNameWindow(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; XmFontS_show_font_name(fsw) = info->set; if (info->set) { XtManageChild(XmFontS_name_label(fsw)); if (XmFontS_xlfd_mode(fsw)) { DisplayCurrentFont(fsw, BuildFontString(fsw, XmFontS_font_info(fsw)->current_font, buf, BUFSIZ)); } else { String str = XmDropDownGetValue(XmFontS_family_box(fsw)); DisplayCurrentFont(fsw, str); XtFree((XtPointer) str); } } else XtUnmanageChild(XmFontS_name_label(fsw)); } /* Function Name: Toggle75DPI * Description: Activated when the 75DPI button is toggled. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void Toggle75DPI(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ SetFlag(&(XmFontS_user_state(fsw)), DPI_75, True); SetFlag(&(XmFontS_user_state(fsw)), DPI_100, False); cf->resolution_x = cf->resolution_y = 75; UpdateFamilies(fsw); UpdateSizes(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: Toggle100DPI * Description: Activated when the 100DPI button is toggled. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void Toggle100DPI(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ SetFlag(&(XmFontS_user_state(fsw)), DPI_75, False); SetFlag(&(XmFontS_user_state(fsw)), DPI_100, True); cf->resolution_x = cf->resolution_y = 100; UpdateFamilies(fsw); UpdateSizes(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleBothDPI * Description: Activated when the Both DPI button is toggled. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void ToggleBothDPI(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ SetFlag(&(XmFontS_user_state(fsw)), DPI_75 | DPI_100, True); cf->resolution_x = cf->resolution_y = 0; /* 0 means any */ UpdateFamilies(fsw); UpdateSizes(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleProportional * Description: Activated when the Proportional button is toggled. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void ToggleProportional(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ SetFlag(&(XmFontS_user_state(fsw)), USER_PROPORTIONAL, True); SetFlag(&(XmFontS_user_state(fsw)), USER_FIXED, False); UpdateFixedProportional(fsw); UpdateFamilies(fsw); UpdateSizes(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleFixed * Description: Activated when the Fixed button is toggled. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void ToggleFixed(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ SetFlag(&(XmFontS_user_state(fsw)), USER_FIXED, True); SetFlag(&(XmFontS_user_state(fsw)), USER_PROPORTIONAL, False); UpdateFixedProportional(fsw); UpdateFamilies(fsw); UpdateSizes(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: ToggleBothSpacing * Description: Activated when the Both (any) Spacing button is toggled. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void ToggleBothSpacing(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; FontData * cf = XmFontS_font_info(fsw)->current_font; XmToggleButtonCallbackStruct *info; char buf[BUFSIZ]; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ SetFlag(&(XmFontS_user_state(fsw)), USER_FIXED | USER_PROPORTIONAL, True); UpdateFixedProportional(fsw); UpdateFamilies(fsw); UpdateSizes(fsw); DisplayCurrentFont(fsw, BuildFontString(fsw, cf, buf, BUFSIZ)); } /* Function Name: XlfdMode * Description: Called when the Xlfd Toggle is selected. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void XlfdMode(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; XmToggleButtonCallbackStruct *info; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ ChangeMode(fsw, True, True); /* Set to Xlfd Mode. */ } /* Function Name: OtherMode * Description: Called when the Other Toggle is selected. * w - the toggle button widget selected. * fsw_ptr - pointer to the font selector widget. * data - the toggle button data. * Returns: none */ static void OtherMode(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; XmToggleButtonCallbackStruct *info; info = (XmToggleButtonCallbackStruct *) data; UnsetSiblings(w); if (!info->set) return; /* Do nothing on an unset. */ ChangeMode(fsw, False, True); /* Set to other Mode */ } /* Function Name: RemoveUserError * Description: Removes a user error from the text widget. * w - the text widget. * fsw_ptr - pointer to the font selector widget. * data - *** UNUSED ***. * Returns: none */ /* ARGSUSED */ static void RemoveUserError(Widget w, XtPointer fsw_ptr, XtPointer data) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) fsw_ptr; if (XmFontS_current_text(fsw) == NULL) return; DisplayUserError(fsw, NULL); } /************************************************************ * * Semi-public routines. * ************************************************************/ /* Function Name: Class Initlialize * Description: Initializes class-specific data (offsets) * Arguments: none * Returns: nothing */ static void ClassInitialize() { /* do nothing */ } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmFONTSELECTOR_BIT); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /* ARGSUSED */ static void Initialize(Widget request, Widget set, ArgList args, Cardinal * num_args) { XmFontSelectorWidget fsw = (XmFontSelectorWidget)set; ArgList f_args; Cardinal f_num_args; XmFontS_user_state(fsw) = 0; /* Initialize user state to 0. */ XmFontS_xlfd_mode(fsw) = True; /* We start in Xlfd Mode. */ XmFontS_font_info(fsw) = LoadFontInfo(fsw); XmFontS_current_text(fsw) = NULL; XmFontS_old_fontdata(fsw) = NULL; XmFontS_old_fontlist(fsw) = NULL; XmFontS_encoding_menu_shell(fsw) = NULL; XmFontS_xlfd_only(fsw) = XmFontS_xlfd_sensitive(fsw) = NULL; XmFontS_num_xlfd_only(fsw) = XmFontS_alloc_xlfd_only(fsw) = 0; XmFontS_num_xlfd_sensitive(fsw) = XmFontS_alloc_xlfd_sensitive(fsw) = 0; XmFontS_get_font(fsw) = (String) XtMalloc(sizeof(char) * GET_FONT_SIZE); /* duplicate strings so that user can query them later */ ANY_STRING(fsw) = XmStringCopy(ANY_STRING(fsw)); BOLD_STRING(fsw) = XmStringCopy(BOLD_STRING(fsw)); BOTH_STRING(fsw) = XmStringCopy(BOTH_STRING(fsw)); DPI100_STRING(fsw) = XmStringCopy(DPI100_STRING(fsw)); DPI75_STRING(fsw) = XmStringCopy(DPI75_STRING(fsw)); ENCODING_ONLY_STRING(fsw) = XmStringCopy(ENCODING_ONLY_STRING(fsw)); FAMILY_STRING(fsw) = XmStringCopy(FAMILY_STRING(fsw)); ITALIC_STRING(fsw) = XmStringCopy(ITALIC_STRING(fsw)); LOWER_ANY_STRING(fsw) = XmStringCopy(LOWER_ANY_STRING(fsw)); MONO_SPACE_STRING(fsw) = XmStringCopy(MONO_SPACE_STRING(fsw)); OPTION_STRING(fsw) = XmStringCopy(OPTION_STRING(fsw)); OTHER_FONT_STRING(fsw) = XmStringCopy(OTHER_FONT_STRING(fsw)); PROPORTIONAL_STRING(fsw) = XmStringCopy(PROPORTIONAL_STRING(fsw)); SAMPLE_TEXT(fsw) = XmStringCopy(SAMPLE_TEXT(fsw)); SCALING_STRING(fsw) = XmStringCopy(SCALING_STRING(fsw)); SHOW_NAME_STRING(fsw) = XmStringCopy(SHOW_NAME_STRING(fsw)); SIZE_STRING(fsw) = XmStringCopy(SIZE_STRING(fsw)); XLFD_STRING(fsw) = XmStringCopy(XLFD_STRING(fsw)); ENCODING_STRING(fsw) = XtNewString(ENCODING_STRING(fsw)); /* XmFontS_current_font(fsw) handled internally */ { int i; String *encodings = ENCODING_LIST(fsw); String *newList; for (i=0, encodings = ENCODING_LIST(fsw); *encodings != NULL; i++, encodings++) i++; i++; newList = (String*)XtMalloc(sizeof(String) * i); for (i=0, encodings = ENCODING_LIST(fsw); *encodings != NULL; i++, encodings++) newList[i] = XtNewString(*encodings); newList[i] = NULL; ENCODING_LIST(fsw) = newList; } _XmFilterArgs(args, *num_args, xm_std_constraint_filter, &f_args, &f_num_args); CreateChildren(fsw, f_args, f_num_args); XtFree((XtPointer) f_args); SetFlag(&(XmFontS_user_state(fsw)), DPI_75, (XmFontS_font_info(fsw)->resolution == 75)); SetFlag(&(XmFontS_user_state(fsw)), DPI_100, (XmFontS_font_info(fsw)->resolution == 100)); /* * Load default information into the current font. */ XmFontS_font_info(fsw)->current_font = (FontData *) XtMalloc(sizeof(FontData)); SetDisplayedFont(fsw, XmFontS_current_font(fsw)); } /* Function Name: Destroy * Description: Called when the widget is destroyed, cleans up. * Arguments: w - the widget. * Returns: none. */ static void Destroy(Widget w) { register int i, num; register String *ptr; XmFontSelectorWidget fsw = (XmFontSelectorWidget)w; if (XmFontS_old_fontdata(fsw) != NULL) { XFreeFont(XtDisplay(w), XmFontS_old_fontdata(fsw)); XmFontListFree(XmFontS_old_fontlist(fsw)); } num = XmFontS_font_info(fsw)->num_others; ptr = XmFontS_font_info(fsw)->others; for (i = 0; i < num; i++, ptr++) XtFree(*ptr); for (i = 0; i < XmFontS_font_info(fsw)->num_families; i++) XtFree((char*)XmFontS_font_info(fsw)->family_info[i].encodings); XtFree((XtPointer) XmFontS_get_font(fsw)); XtFree((XtPointer) XmFontS_xlfd_only(fsw)); XtFree((XtPointer) XmFontS_xlfd_sensitive(fsw)); XtFree((XtPointer) XmFontS_font_info(fsw)->others); XtFree((XtPointer) XmFontS_font_info(fsw)->family_info); XtFree((XtPointer) XmFontS_font_info(fsw)->current_font); XtFree((XtPointer) XmFontS_font_info(fsw)); XmStringFree(ANY_STRING(fsw)); XmStringFree(BOLD_STRING(fsw)); XmStringFree(BOTH_STRING(fsw)); XmStringFree(DPI100_STRING(fsw)); XmStringFree(DPI75_STRING(fsw)); XmStringFree(ENCODING_ONLY_STRING(fsw)); XmStringFree(FAMILY_STRING(fsw)); XmStringFree(ITALIC_STRING(fsw)); XmStringFree(LOWER_ANY_STRING(fsw)); XmStringFree(MONO_SPACE_STRING(fsw)); XmStringFree(OPTION_STRING(fsw)); XmStringFree(OTHER_FONT_STRING(fsw)); XmStringFree(PROPORTIONAL_STRING(fsw)); XmStringFree(SAMPLE_TEXT(fsw)); XmStringFree(SCALING_STRING(fsw)); XmStringFree(SHOW_NAME_STRING(fsw)); XmStringFree(SIZE_STRING(fsw)); XmStringFree(XLFD_STRING(fsw)); XtFree(ENCODING_STRING(fsw)); /* current font handled internally */ { String *encodings; for (encodings = ENCODING_LIST(fsw); *encodings != NULL; i++, encodings++) XtFree(*encodings); XtFree((char*)ENCODING_LIST(fsw)); } } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: old - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - The arguments passed to the set * values call. * Returns: none */ /* ARGSUSED */ static Boolean SetValues(Widget old, Widget request, Widget set, ArgList args, Cardinal * num_args) { Arg largs[10]; Cardinal num_largs, i; XmFontSelectorWidget old_fsw = (XmFontSelectorWidget) old; XmFontSelectorWidget set_fsw = (XmFontSelectorWidget) set; Boolean new_encoding_list = False; /* * Pass argument list through to all children. */ { ArgList f_args; Cardinal f_num_args; _XmFilterArgs(args, *num_args, xm_std_constraint_filter, &f_args, &f_num_args); _XmSetValuesOnChildren(set, f_args, f_num_args); XtFree((XtPointer) f_args); } for (i = 0; i < *num_args; i++) { if (streq(args[i].name, XmNencodingList)) new_encoding_list = True; } /* * ||| Protect against any of the strings being changed. */ if (XmFontS_current_font(old_fsw) != XmFontS_current_font(set_fsw)) { SetDisplayedFont(set_fsw, XmFontS_current_font(set_fsw)); } if (XmFontS_show_font_name(old_fsw) != XmFontS_show_font_name(set_fsw)) { XmToggleButtonSetState(XmFontS_show_font_toggle(set_fsw), XmFontS_show_font_name(set_fsw), True); } if (XmFontS_use_scaling(old_fsw) != XmFontS_use_scaling(set_fsw)) { XmToggleButtonSetState(XmFontS_use_scaling_toggle(set_fsw), XmFontS_use_scaling(set_fsw), True); } if (new_encoding_list) { Widget parent = XtParent(XmFontS_option_menu(set_fsw)); XmFontS_option_menu(set_fsw) = CreateEncodingMenu(set_fsw, parent, NULL, 0); } /* if new_encoding_list is true, then CreateEncodingMenu has already ** freed and recreated the ENCODING_STRING, so avoid redoing it */ if (new_encoding_list || (((ENCODING_STRING(old_fsw) != NULL) && (ENCODING_STRING(set_fsw) != NULL)) && !streq(ENCODING_STRING(old_fsw), ENCODING_STRING(set_fsw))) ) { char buf[BUFSIZ]; int current, i; String *encodings = ENCODING_LIST(set_fsw); Widget button; if (!new_encoding_list) { XtFree(ENCODING_STRING(old_fsw)); ENCODING_STRING(set_fsw) = XtNewString(ENCODING_STRING(set_fsw)); } /* some of this code is probably a duplicate of CreateEncodingMenu */ for (current = 0, i = 1 ; *encodings != NULL; i++, encodings++) { /* * If the default encoding matches this one then make this * the current item in the option menu. */ if (strcmp(*encodings, ENCODING_STRING(set_fsw)) == 0) current = i; } sprintf(buf, "*button_%d", current); if ((button = XtNameToWidget(XtParent(XmFontS_option_menu(set_fsw)), buf)) != NULL) { num_largs = 0; XtSetArg(largs[num_largs], XmNmenuHistory, button); num_largs++; XtSetValues(XmFontS_option_menu(set_fsw), largs, num_largs); ChangeEncoding((Widget) set_fsw, (XtPointer) current, NULL); } else { /* ||| ERROR. */ } } if (XmFontS_text_rows(old_fsw) != XmFontS_text_rows(set_fsw)) { num_largs = 0; XtSetArg(largs[num_largs], XmNrows, XmFontS_text_rows(set_fsw));num_largs++; XtSetValues(XmFontS_text(set_fsw), largs, num_largs); } { Boolean reset = False; #define DoCheck(old_one,new_one) { reset = False; if (old_one != new_one) { XmStringFree(old_one); new_one = XmStringCopy(new_one); reset = True; } } DoCheck( ANY_STRING(old_fsw), ANY_STRING(set_fsw)); /* PUNT! or else we need to check if on-screen right now */ DoCheck( BOLD_STRING(old_fsw), BOLD_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_bold_toggle(set_fsw), XmNlabelString, BOLD_STRING(set_fsw), NULL); DoCheck( BOTH_STRING(old_fsw), BOTH_STRING(set_fsw)); if (reset) { XtVaSetValues( XmFontS_dpiAny(set_fsw), XmNlabelString, BOTH_STRING(set_fsw), NULL); XtVaSetValues( XmFontS_any_spacing(set_fsw), XmNlabelString, BOTH_STRING(set_fsw), NULL); } DoCheck( DPI100_STRING(old_fsw), DPI100_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_dpi100(set_fsw), XmNlabelString, DPI100_STRING(set_fsw), NULL); DoCheck( DPI75_STRING(old_fsw), DPI75_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_dpi75(set_fsw), XmNlabelString, DPI75_STRING(set_fsw), NULL); DoCheck( ENCODING_ONLY_STRING(old_fsw), ENCODING_ONLY_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_option_menu(set_fsw), XmNlabelString, ENCODING_ONLY_STRING(set_fsw), NULL); DoCheck( FAMILY_STRING(old_fsw), FAMILY_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_family_box(set_fsw), XmNlabelString, FAMILY_STRING(set_fsw), NULL); DoCheck( ITALIC_STRING(old_fsw), ITALIC_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_italic_toggle(set_fsw), XmNlabelString, ITALIC_STRING(set_fsw), NULL); DoCheck( LOWER_ANY_STRING(old_fsw), LOWER_ANY_STRING(set_fsw)); /* PUNT! or else we need to check if on-screen right now */ DoCheck( MONO_SPACE_STRING(old_fsw), MONO_SPACE_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_monospace(set_fsw), XmNlabelString, MONO_SPACE_STRING(set_fsw), NULL); DoCheck( OPTION_STRING(old_fsw), OPTION_STRING(set_fsw)); if (reset) XtVaSetValues( XtNameToWidget((Widget)set_fsw, "*optionButton"), XmNlabelString, OPTION_STRING(set_fsw), NULL); DoCheck( OTHER_FONT_STRING(old_fsw), OTHER_FONT_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_other_toggle(set_fsw), XmNlabelString, OTHER_FONT_STRING(set_fsw), NULL); DoCheck( PROPORTIONAL_STRING(old_fsw), PROPORTIONAL_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_proportional(set_fsw), XmNlabelString, PROPORTIONAL_STRING(set_fsw), NULL); DoCheck( SAMPLE_TEXT(old_fsw), SAMPLE_TEXT(set_fsw)); if (reset) { char * temp_txt = _XmGetMBStringFromXmString(SAMPLE_TEXT(set_fsw)); XtVaSetValues( XmFontS_text(set_fsw), XmNlabelString, temp_txt, NULL); XtFree(temp_txt); } DoCheck( SCALING_STRING(old_fsw), SCALING_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_use_scaling_toggle(set_fsw), XmNlabelString, SCALING_STRING(set_fsw), NULL); DoCheck( SHOW_NAME_STRING(old_fsw), SHOW_NAME_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_show_font_toggle(set_fsw), XmNlabelString, SHOW_NAME_STRING(set_fsw), NULL); DoCheck( SIZE_STRING(old_fsw), SIZE_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_size_box(set_fsw), XmNlabelString, SIZE_STRING(set_fsw), NULL); DoCheck( XLFD_STRING(old_fsw), XLFD_STRING(set_fsw)); if (reset) XtVaSetValues( XmFontS_xlfd_toggle(set_fsw), XmNlabelString, XLFD_STRING(set_fsw), NULL); #undef DoCheck } return (False); } /* SetValues */ /* Function Name: GetValuesHook * Description: Packages up the value of the current font. * Arguments: w - The widget. * args, num_args - The arguments passed to the get * values call. * Returns: none */ /* ARGSUSED */ static void GetValuesHook(Widget w, ArgList args, Cardinal * num_args) { XmFontSelectorWidget fsw = (XmFontSelectorWidget) w; FontData * cf; String *str_ptr; register int i; for (i = 0; i < *num_args; i++) { if (streq(args[i].name, XmNcurrentFont)) { cf = XmFontS_font_info(fsw)->current_font; str_ptr = (String *) args[i].value; if (XmFontS_xlfd_mode(fsw)) { BuildFontString(fsw, cf, XmFontS_get_font(fsw), GET_FONT_SIZE); *str_ptr = XmFontS_get_font(fsw); } else { *str_ptr = XrmQuarkToString(cf->familyq); } } else if (streq(args[i].name, XmNanyString)) *(XmString*)args[i].value = XmStringCopy(ANY_STRING(fsw)); else if (streq(args[i].name, XmNbothString)) *(XmString*)args[i].value = XmStringCopy(BOLD_STRING(fsw)); else if (streq(args[i].name, XmNboldString)) *(XmString*)args[i].value = XmStringCopy(BOTH_STRING(fsw)); else if (streq(args[i].name, XmN100DPIstring)) *(XmString*)args[i].value = XmStringCopy(DPI100_STRING(fsw)); else if (streq(args[i].name, XmN75DPIstring)) *(XmString*)args[i].value = XmStringCopy(DPI75_STRING(fsw)); else if (streq(args[i].name, XmNencodingString)) *(XmString*)args[i].value = XmStringCopy(ENCODING_ONLY_STRING(fsw)); else if (streq(args[i].name, XmNfamilyString)) *(XmString*)args[i].value = XmStringCopy(FAMILY_STRING(fsw)); else if (streq(args[i].name, XmNitalicString)) *(XmString*)args[i].value = XmStringCopy(ITALIC_STRING(fsw)); else if (streq(args[i].name, XmNanyLowerString)) *(XmString*)args[i].value = XmStringCopy(LOWER_ANY_STRING(fsw)); else if (streq(args[i].name, XmNmonoSpaceString)) *(XmString*)args[i].value = XmStringCopy(MONO_SPACE_STRING(fsw)); else if (streq(args[i].name, XmNoptionString)) *(XmString*)args[i].value = XmStringCopy(OPTION_STRING(fsw)); else if (streq(args[i].name, XmNotherString)) *(XmString*)args[i].value = XmStringCopy(OTHER_FONT_STRING(fsw)); else if (streq(args[i].name, XmNpropSpaceString)) *(XmString*)args[i].value = XmStringCopy(PROPORTIONAL_STRING(fsw)); else if (streq(args[i].name, XmNsampleText)) *(XmString*)args[i].value = XmStringCopy(SAMPLE_TEXT(fsw)); else if (streq(args[i].name, XmNscalingString)) *(XmString*)args[i].value = XmStringCopy(SCALING_STRING(fsw)); else if (streq(args[i].name, XmNshowNameString)) *(XmString*)args[i].value = XmStringCopy(SHOW_NAME_STRING(fsw)); else if (streq(args[i].name, XmNsizeString)) *(XmString*)args[i].value = XmStringCopy(SIZE_STRING(fsw)); else if (streq(args[i].name, XmNxlfdString)) *(XmString*)args[i].value = XmStringCopy(XLFD_STRING(fsw)); } } /************************************************************ * * Public routines. * ************************************************************/ /* Function Name: XmCreateFontSelector * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateFontSelector(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmFontSelectorWidgetClass, parent, args, num_args)); } motif-2.3.8/lib/Xm/XmStrDefsI.h0000644000175000017500000001341213211513004013045 00000000000000/* $TOG: XmStrDefsI.ht /main/1 1997/06/18 17:50:36 samborn $ */ #ifndef _XmStrDefsI_h_ #define _XmStrDefsI_h_ #include #ifdef __cplusplus extern "C" { #endif /* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */ /* This file is automatically generated. */ /* Default ABI version -- Do not edit */ /* TOG: xmstring.list /main/5 1997/06/20 08:37:02 samborn */ #ifdef XMSTRINGDEFINES #define XmIATOM_PAIR "ATOM_PAIR" #define XmIAVERAGE_WIDTH "AVERAGE_WIDTH" #define XmIBACKGROUND "BACKGROUND" #define XmICHARACTER_POSITION "CHARACTER_POSITION" #define XmICLASS "CLASS" #define XmICOLUMN_NUMBER "COLUMN_NUMBER" #define XmIDONE "DONE" #define XmIFOREGROUND "FOREGROUND" #define XmIHOST_NAME "HOST_NAME" #define XmILINE_NUMBER "LINE_NUMBER" #define XmILIST_LENGTH "LIST_LENGTH" #define XmIMODULE "MODULE" #define XmINAME "NAME" #define XmINone "None" #define XmIODIF "ODIF" #define XmIOWNER_OS "OWNER_OS" #define XmIPDM_EXIT_CANCEL "PDM_EXIT_CANCEL" #define XmIPDM_EXIT_ERROR "PDM_EXIT_ERROR" #define XmIPDM_EXIT_OK "PDM_EXIT_OK" #define XmIPDM_REPLY "PDM_REPLY" #define XmIPDM_START "PDM_START" #define XmIPDM_START_ERROR "PDM_START_ERROR" #define XmIPDM_START_OK "PDM_START_OK" #define XmIPDM_START_PXAUTH "PDM_START_PXAUTH" #define XmIPDM_START_VXAUTH "PDM_START_VXAUTH" #define XmIPIXEL "PIXEL" #define XmIPIXEL_SIZE "PIXEL_SIZE" #define XmIPROCEDURE "PROCEDURE" #define XmIPROCESS "PROCESS" #define XmIRESOLUTION_Y "RESOLUTION_Y" #define XmISPAN "SPAN" #define XmITASK "TASK" #define XmIUSER "USER" #define XmIWM_DELETE_WINDOW "WM_DELETE_WINDOW" #define XmI_MOTIF_CURRENT_TIME "_MOTIF_CURRENT_TIME" #define XmI_MOTIF_DRAG_ATOMS "_MOTIF_DRAG_ATOMS" #define XmI_MOTIF_DRAG_INITIATOR_INFO "_MOTIF_DRAG_INITIATOR_INFO" #define XmI_MOTIF_DRAG_PROXY_WINDOW "_MOTIF_DRAG_PROXY_WINDOW" #define XmI_MOTIF_DRAG_RECEIVER_INFO "_MOTIF_DRAG_RECEIVER_INFO" #define XmI_MOTIF_DRAG_TARGETS "_MOTIF_DRAG_TARGETS" #define XmI_MOTIF_DRAG_WINDOW "_MOTIF_DRAG_WINDOW" #define XmI_MOTIF_INITIATOR "_MOTIF_INITIATOR" #define XmI_MOTIF_RECEIVER "_MOTIF_RECEIVER" #define XmI_MOTIF_SELECTION_TEXT "_MOTIF_SELECTION_TEXT" #else externalref _XmConst char _XmStringsI[]; #ifndef XmIATOM_PAIR #define XmIATOM_PAIR ((char*)&_XmStringsI[0]) #endif #ifndef XmIAVERAGE_WIDTH #define XmIAVERAGE_WIDTH ((char*)&_XmStringsI[10]) #endif #ifndef XmIBACKGROUND #define XmIBACKGROUND ((char*)&_XmStringsI[24]) #endif #ifndef XmICHARACTER_POSITION #define XmICHARACTER_POSITION ((char*)&_XmStringsI[35]) #endif #ifndef XmICLASS #define XmICLASS ((char*)&_XmStringsI[54]) #endif #ifndef XmICOLUMN_NUMBER #define XmICOLUMN_NUMBER ((char*)&_XmStringsI[60]) #endif #ifndef XmIDONE #define XmIDONE ((char*)&_XmStringsI[74]) #endif #ifndef XmIFOREGROUND #define XmIFOREGROUND ((char*)&_XmStringsI[79]) #endif #ifndef XmIHOST_NAME #define XmIHOST_NAME ((char*)&_XmStringsI[90]) #endif #ifndef XmILINE_NUMBER #define XmILINE_NUMBER ((char*)&_XmStringsI[100]) #endif #ifndef XmILIST_LENGTH #define XmILIST_LENGTH ((char*)&_XmStringsI[112]) #endif #ifndef XmIMODULE #define XmIMODULE ((char*)&_XmStringsI[124]) #endif #ifndef XmINAME #define XmINAME ((char*)&_XmStringsI[131]) #endif #ifndef XmINone #define XmINone ((char*)&_XmStringsI[136]) #endif #ifndef XmIODIF #define XmIODIF ((char*)&_XmStringsI[141]) #endif #ifndef XmIOWNER_OS #define XmIOWNER_OS ((char*)&_XmStringsI[146]) #endif #ifndef XmIPDM_EXIT_CANCEL #define XmIPDM_EXIT_CANCEL ((char*)&_XmStringsI[155]) #endif #ifndef XmIPDM_EXIT_ERROR #define XmIPDM_EXIT_ERROR ((char*)&_XmStringsI[171]) #endif #ifndef XmIPDM_EXIT_OK #define XmIPDM_EXIT_OK ((char*)&_XmStringsI[186]) #endif #ifndef XmIPDM_REPLY #define XmIPDM_REPLY ((char*)&_XmStringsI[198]) #endif #ifndef XmIPDM_START #define XmIPDM_START ((char*)&_XmStringsI[208]) #endif #ifndef XmIPDM_START_ERROR #define XmIPDM_START_ERROR ((char*)&_XmStringsI[218]) #endif #ifndef XmIPDM_START_OK #define XmIPDM_START_OK ((char*)&_XmStringsI[234]) #endif #ifndef XmIPDM_START_PXAUTH #define XmIPDM_START_PXAUTH ((char*)&_XmStringsI[247]) #endif #ifndef XmIPDM_START_VXAUTH #define XmIPDM_START_VXAUTH ((char*)&_XmStringsI[264]) #endif #ifndef XmIPIXEL #define XmIPIXEL ((char*)&_XmStringsI[281]) #endif #ifndef XmIPIXEL_SIZE #define XmIPIXEL_SIZE ((char*)&_XmStringsI[287]) #endif #ifndef XmIPROCEDURE #define XmIPROCEDURE ((char*)&_XmStringsI[298]) #endif #ifndef XmIPROCESS #define XmIPROCESS ((char*)&_XmStringsI[308]) #endif #ifndef XmIRESOLUTION_Y #define XmIRESOLUTION_Y ((char*)&_XmStringsI[316]) #endif #ifndef XmISPAN #define XmISPAN ((char*)&_XmStringsI[329]) #endif #ifndef XmITASK #define XmITASK ((char*)&_XmStringsI[334]) #endif #ifndef XmIUSER #define XmIUSER ((char*)&_XmStringsI[339]) #endif #ifndef XmIWM_DELETE_WINDOW #define XmIWM_DELETE_WINDOW ((char*)&_XmStringsI[344]) #endif #ifndef XmI_MOTIF_CURRENT_TIME #define XmI_MOTIF_CURRENT_TIME ((char*)&_XmStringsI[361]) #endif #ifndef XmI_MOTIF_DRAG_ATOMS #define XmI_MOTIF_DRAG_ATOMS ((char*)&_XmStringsI[381]) #endif #ifndef XmI_MOTIF_DRAG_INITIATOR_INFO #define XmI_MOTIF_DRAG_INITIATOR_INFO ((char*)&_XmStringsI[399]) #endif #ifndef XmI_MOTIF_DRAG_PROXY_WINDOW #define XmI_MOTIF_DRAG_PROXY_WINDOW ((char*)&_XmStringsI[426]) #endif #ifndef XmI_MOTIF_DRAG_RECEIVER_INFO #define XmI_MOTIF_DRAG_RECEIVER_INFO ((char*)&_XmStringsI[451]) #endif #ifndef XmI_MOTIF_DRAG_TARGETS #define XmI_MOTIF_DRAG_TARGETS ((char*)&_XmStringsI[477]) #endif #ifndef XmI_MOTIF_DRAG_WINDOW #define XmI_MOTIF_DRAG_WINDOW ((char*)&_XmStringsI[497]) #endif #ifndef XmI_MOTIF_INITIATOR #define XmI_MOTIF_INITIATOR ((char*)&_XmStringsI[516]) #endif #ifndef XmI_MOTIF_RECEIVER #define XmI_MOTIF_RECEIVER ((char*)&_XmStringsI[533]) #endif #ifndef XmI_MOTIF_SELECTION_TEXT #define XmI_MOTIF_SELECTION_TEXT ((char*)&_XmStringsI[549]) #endif #endif /* XMSTRINGDEFINES */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs_h_ */ motif-2.3.8/lib/Xm/MenuShell.h0000644000175000017500000000334213145162623012767 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMenuShell_h #define _XmMenuShell_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmMenuShellWidgetClass; typedef struct _XmMenuShellClassRec * XmMenuShellWidgetClass; typedef struct _XmMenuShellWidgetRec * XmMenuShellWidget; #ifndef XmIsMenuShell #define XmIsMenuShell(w) XtIsSubclass(w, xmMenuShellWidgetClass) #endif /* XmIsMenuShell */ /******** Public Function Declarations ********/ extern Widget XmCreateMenuShell( Widget parent, char *name, ArgList al, Cardinal ac) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuShell_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/ScrolledW.c0000644000175000017500000036246413146717100012776 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: ScrolledW.c /main/16 1997/07/25 16:49:57 samborn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #ifndef X_NOT_STDC_ENV #include /* for abs, float operation... */ #endif #include #include #include #include #include /* might be worth getting rid of this one */ #include #include #include #include "GeoUtilsI.h" #include "MessagesI.h" #include "RepTypeI.h" #include "ScrolledWI.h" #include "ScrollFramTI.h" #include "TraversalI.h" #include "XmI.h" #define MAXPOS ((1 << 15)-1) #define SB_BORDER_WIDTH 0 #define DEFAULT_SPACING 4 #define DEFAULT_SIZE 100 #define ExistManaged( wid) (wid && XtIsManaged( wid)) #define defaultTranslations _XmScrolledW_ScrolledWindowXlations /* Auto drag private ********/ #define FORWARD 0 #define BACKWARD 1 typedef struct _AutoDragClosure { Widget widget; unsigned char direction ; } AutoDragClosure; typedef struct _AutoDragRects { XRectangle up; XRectangle left; } AutoDragRectsRec, *AutoDragRects; #define POINT_IN_RECT(X, Y, rect) \ (((X) >= rect.x) && ((Y) >= rect.y) && \ ((X) <= rect.x + rect.width) && ((Y) <= rect.y + rect.height)) /*********/ #define SWMessage6 _XmMMsgScrolledW_0004 #define SWMessage7 _XmMMsgScrolledW_0005 #define SWMessage8 _XmMMsgScrolledW_0006 #define SWMessage9 _XmMMsgScrolledW_0007 #define SWMessage10 _XmMMsgScrolledW_0008 #define SWMessage11 _XmMMsgScrolledW_0009 /******** Static Function Declarations ********/ static void ScrollBarPlacementDefault ( Widget w, int offset, XrmValue *value); static void VisualPolicyDefault( Widget widget, int offset, XrmValue *value) ; static void SliderMove( Widget w, XtPointer closure, XtPointer cd) ; static void MoveWindow( XmScrolledWindowWidget sw, int value, unsigned char direction) ; static void LeftEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void RightEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void TopEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void BottomEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void PageLeft( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void PageRight( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void PageUp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void PageDown( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void ComputeLocations( XmScrolledWindowWidget sw, Dimension HSBht, Dimension VSBht, Boolean HasHSB, Boolean HasVSB, Position * newx, Position * newy, Position * hsbX, Position * hsbY, Position * vsbX, Position * vsbY); static void VariableLayout( XmScrolledWindowWidget sw) ; static void ConstantLayout( XmScrolledWindowWidget sw) ; static void Resize( Widget wid) ; static void Destroy( Widget wid) ; static void GetVariableSize( XmScrolledWindowWidget sw, Dimension *pwidth, Dimension *pheight) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget wid) ; static void InsertChild( Widget w) ; static void DeleteChild( Widget w) ; static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *ret) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void ConstraintInitialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetHorRects( Widget sw, XRectangle ** hrect, Cardinal * num_hrect); static void GetVertRects( Widget sw, XRectangle ** vrect, Cardinal * num_vrect); static void HandleDrop( Widget w, XtPointer client_data, XtPointer call_data); static void HandleDrag( Widget w, XtPointer client_data, XtPointer call_data); static void ScrollFrameInit ( Widget sf, XtCallbackProc moveCB, Widget scrollable); static Boolean GetInfo( Widget sf, Cardinal * dimension, Widget ** nav_list, Cardinal * num_nav_list) ; static void AddNavigator( Widget sf, Widget nav, Mask dimMask); static void RemoveNavigator( Widget sf, Widget nav); static void UpdateOrigGeom(Widget sf, Widget child, XtWidgetGeometry *geom); static void CheckKids( XmScrolledWindowWidget sw); /******** End Static Function Declarations ********/ /************************************************************************ * * * Scrolled Window Resources * * * ************************************************************************/ static XtResource resources[] = { { XmNhorizontalScrollBar, XmCHorizontalScrollBar, XmRWidget, sizeof(Widget), XtOffsetOf(XmScrolledWindowRec, swindow.hScrollBar), XmRImmediate, NULL }, { XmNverticalScrollBar, XmCVerticalScrollBar, XmRWidget, sizeof(Widget), XtOffsetOf(XmScrolledWindowRec, swindow.vScrollBar), XmRImmediate, NULL }, { XmNworkWindow, XmCWorkWindow, XmRWidget, sizeof(Widget), XtOffsetOf(XmScrolledWindowRec, swindow.WorkWindow), XmRImmediate, NULL }, { XmNclipWindow, XmCClipWindow, XmRWidget, sizeof(Widget), XtOffsetOf(XmScrolledWindowRec, swindow.ClipWindow), XmRImmediate, NULL }, { XmNscrollingPolicy, XmCScrollingPolicy, XmRScrollingPolicy, sizeof(unsigned char), XtOffsetOf(XmScrolledWindowRec, swindow.ScrollPolicy), XmRImmediate, (XtPointer) XmAPPLICATION_DEFINED }, { /* Obsolete resource */ XmNvisualPolicy, XmCVisualPolicy, XmRVisualPolicy, sizeof (unsigned char), XtOffsetOf(XmScrolledWindowRec, swindow.VisualPolicy), XmRCallProc, (XtPointer) VisualPolicyDefault }, { XmNscrollBarDisplayPolicy, XmCScrollBarDisplayPolicy, XmRScrollBarDisplayPolicy, sizeof (char), XtOffsetOf(XmScrolledWindowRec, swindow.ScrollBarPolicy), XmRImmediate, (XtPointer) RESOURCE_DEFAULT }, { XmNscrollBarPlacement, XmCScrollBarPlacement, XmRScrollBarPlacement, sizeof (unsigned char), XtOffsetOf(XmScrolledWindowRec, swindow.Placement), XmRCallProc, (XtPointer) ScrollBarPlacementDefault }, { XmNscrolledWindowMarginWidth, XmCScrolledWindowMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmScrolledWindowRec, swindow.WidthPad), XmRImmediate, (XtPointer) 0 }, { XmNscrolledWindowMarginHeight, XmCScrolledWindowMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf(XmScrolledWindowRec, swindow.HeightPad), XmRImmediate, (XtPointer) 0 }, { XmNspacing, XmCSpacing, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmScrolledWindowRec, swindow.pad), XmRImmediate, (XtPointer) RESOURCE_DEFAULT }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmScrolledWindowRec, manager.shadow_thickness), XmRImmediate, (XtPointer) RESOURCE_DEFAULT }, { XmNtraverseObscuredCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmScrolledWindowRec, swindow.traverseObscuredCallback), XmRImmediate, NULL }, { XmNautoDragModel, XmCAutoDragModel, XmRAutoDragModel, sizeof(XtEnum), XtOffsetOf(XmScrolledWindowRec, swindow.auto_drag_model), XmRImmediate, (XtPointer) XmAUTO_DRAG_ENABLED } }; static XtResource constraints[] = { { XmNscrolledWindowChildType, XmCScrolledWindowChildType, XmRScrolledWindowChildType, sizeof (unsigned char), XtOffsetOf(XmScrolledWindowConstraintRec, swindow.child_type), XmRImmediate, (XtPointer) RESOURCE_DEFAULT }, }; /**************** * * Resolution independent resources * ****************/ static XmSyntheticResource syn_resources[] = { { XmNscrolledWindowMarginWidth, sizeof (Dimension), XtOffsetOf(XmScrolledWindowRec, swindow.WidthPad), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNscrolledWindowMarginHeight, sizeof (short), XtOffsetOf(XmScrolledWindowRec, swindow.HeightPad), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNspacing, sizeof (Dimension), XtOffsetOf(XmScrolledWindowRec, swindow.pad), XmeFromHorizontalPixels , XmeToHorizontalPixels }, }; /**************** * Actions for the ScrolledWindow. * Those actions are called by the ClipWindow when it receives * the grabbed events. They might also be called in the context of the * SW directly (in the margins). ****************/ static XtActionsRec actions[] = { {"SWBeginLine", LeftEdge}, {"SWEndLine", RightEdge}, {"SWTopLine", TopEdge}, {"SWBottomLine", BottomEdge}, {"SWLeftPage", PageLeft}, {"SWRightPage", PageRight}, {"SWUpPage", PageUp}, {"SWDownPage", PageDown}, }; /*******************************************/ /* Declaration of class extension records */ /*******************************************/ static XmScrolledWindowClassExtRec scrolled_windowClassExtRec = { NULL, NULLQUARK, XmScrolledWindowClassExtVersion, sizeof(XmScrolledWindowClassExtRec), GetHorRects, /* auto drag get_hor_rects */ GetVertRects, /* auto drag get_vert_rects */ }; /**************************************************************** * * Full class record constant * ****************************************************************/ externaldef(xmscrolledwindowclassrec) XmScrolledWindowClassRec xmScrolledWindowClassRec = { { /* core_class fields */ (WidgetClass) &xmManagerClassRec, /* superclass */ "XmScrolledWindow", /* class_name */ sizeof(XmScrolledWindowRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class_partinit */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* Init hook */ XtInheritRealize, /* realize */ actions, /* actions */ XtNumber(actions), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave*/ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set values hook */ XtInheritSetValuesAlmost, /* set values almost */ NULL, /* get values hook */ NULL, /* accept_focus */ XtVersion, /* Version */ NULL, /* PRIVATE cb list */ XtInheritTranslations, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator*/ NULL, /* extension */ }, { /* composite_class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ InsertChild, /* insert_child */ DeleteChild, /* delete_child */ NULL, /* Extension */ } , { /* Constraint class Init */ constraints, /* resource list */ XtNumber(constraints), /* num resources */ sizeof (XmScrolledWindowConstraintRec), /* constraint size */ ConstraintInitialize, /* init proc */ NULL, /* destroy proc */ NULL, /* set values proc */ NULL, }, /* Manager Class */ { defaultTranslations, /* translations */ syn_resources, /* get resources */ XtNumber(syn_resources), /* num syn_resources */ NULL, /* get_cont_resources */ 0, /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* Scrolled Window class */ (XtPointer) &scrolled_windowClassExtRec, /* auto drag extension */ } }; externaldef(xmscrolledwindowwidgetclass) WidgetClass xmScrolledWindowWidgetClass = (WidgetClass)&xmScrolledWindowClassRec; /* Trait record for ScrolledWindow */ static XmConst XmScrollFrameTraitRec scrolledWindowSFT = { 1, /* version */ ScrollFrameInit, /* init */ GetInfo, /* getInfo */ AddNavigator, /* addNavigation */ RemoveNavigator, /* removeNavigator */ UpdateOrigGeom, /* updateOrigGeom */ }; /********************************************************************* * * ScrollBarPlacementDefault * This procedure provides the dynamic default behavior for * the scrollbar placement. * *********************************************************************/ /*ARGSUSED*/ static void ScrollBarPlacementDefault (Widget widget, int offset, /* unused */ XrmValue *value) { static unsigned char placement; value->addr = (char*) &placement; if (LayoutIsRtoLM(((XmScrolledWindowWidget)widget))) placement = XmBOTTOM_LEFT; else placement = XmBOTTOM_RIGHT; } /********************************************************************* * * VisualPolicyDefault * This procedure provides the dynamic default behavior for * the visualPolicy. VisualPolicy is obsolete, the default set it * to whatever is correct (depending on scrollpolicy) and Initialize * checks that this default hasn't changed. * *********************************************************************/ /*ARGSUSED*/ static void VisualPolicyDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) widget; static unsigned char visual_policy ; value->addr = (XPointer) &visual_policy; if (sw->swindow.ScrollPolicy == XmAUTOMATIC) visual_policy = XmCONSTANT ; else visual_policy = XmVARIABLE ; } /************************************************************************ * * * SliderMove * * Callback for the value changes of navigators. * * That's the only place where AUTO scrolledWindow directly moves * * the clipped kids. Everywhere it uses the navigator API to move it. * This function loops the clip window child list and applies a * move depending on the child_type resource. * ************************************************************************/ /* ARGSUSED */ static void SliderMove( Widget w, XtPointer closure, XtPointer cd ) { /* w is a navigator widget */ XmClipWindowWidget clip = (XmClipWindowWidget) closure; XmScrolledWindowWidget sw = (XmScrolledWindowWidget) clip->core.parent; Cardinal i ; XmScrolledWindowConstraint swc; Widget child ; XmNavigatorDataRec nav_data ; /* get the navigator information using the trait getValue since I cannot use a callback struct */ nav_data.valueMask = NavValue ; ((XmNavigatorTrait)XmeTraitGet((XtPointer) XtClass(w), XmQTnavigator)) ->getValue(w, &nav_data) ; /* look at the kind of navigator and make the appropriate move */ if (nav_data.dimMask & NavigDimensionX) { sw->swindow.hOrigin = nav_data.value.x; for (i = 0; i < clip->composite.num_children; i++) { child = clip->composite.children[i]; if (XtIsManaged(child) && !child->core.being_destroyed) { swc = GetSWConstraint(child); /* only regular work_area and scroll_hor kids can move in this direction */ if ((swc->child_type == XmWORK_AREA) || (swc->child_type == XmSCROLL_HOR)) { Position real_orig_x ; if (LayoutIsRtoL((Widget)sw)) real_orig_x = clip->core.width - swc->orig_x - child->core.width; else real_orig_x = swc->orig_x ; if (LayoutIsRtoLM(sw)) XmeConfigureObject(child, real_orig_x + nav_data.value.x, child->core.y, child->core.width, child->core.height, child->core.border_width); else XmeConfigureObject(child, swc->orig_x - nav_data.value.x, child->core.y, child->core.width, child->core.height, child->core.border_width); } } } } if (nav_data.dimMask & NavigDimensionY) { sw->swindow.vOrigin = nav_data.value.y; for (i = 0; i < clip->composite.num_children; i++) { child = clip->composite.children[i]; if (XtIsManaged(child) && !child->core.being_destroyed) { swc = GetSWConstraint(child); /* only regular work_area and scroll_vert kids can move in this direction */ if ((swc->child_type == XmWORK_AREA) || (swc->child_type == XmSCROLL_VERT)) { XmeConfigureObject(child, child->core.x, swc->orig_y - nav_data.value.y, child->core.width, child->core.height, child->core.border_width); } } } } /* now update the other navigator value */ _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, False); } /************************************************************************ * * * MoveWindow : called for paging only * * Set the scrollbar (h or v) value and move the workwindow * * using the sb callback and deal with traversal * * * ************************************************************************/ static void MoveWindow( XmScrolledWindowWidget sw, int value, unsigned char orientation) { Widget focus ; XtCallbackList tmp ; XmNavigatorDataRec nav_data ; if (sw->swindow.ScrollPolicy == XmAUTOMATIC) { /* Save the focus before pagin.bg */ focus = XmGetFocusWidget((Widget) sw); /* possible value for orientation: horizontal or vertical */ if (orientation == XmHORIZONTAL) { nav_data.value.x = value ; nav_data.dimMask = NavigDimensionX ; } else { nav_data.value.y = value ; nav_data.dimMask = NavigDimensionY ; } nav_data.valueMask = NavValue ; _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, True); /* CR 7095: Don't move focus unless we must. */ /* Call XmProcessTraversal after having removed the * traverseObscuredCallback, so that it isn't called and * result in the paging operation going back to origin. */ tmp = sw->swindow.traverseObscuredCallback ; sw->swindow.traverseObscuredCallback = NULL ; if (focus && XmIsTraversable(focus)) XmProcessTraversal(focus, XmTRAVERSE_CURRENT); else XmProcessTraversal(sw->swindow.WorkWindow, XmTRAVERSE_CURRENT); sw->swindow.traverseObscuredCallback = tmp ; } } /************************************************************************ * * * LeftEdge - move the view to the left edge * * * ************************************************************************/ /* ARGSUSED */ static void LeftEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; if (!sw->swindow.hScrollBar) return ; MoveWindow (sw, sw->swindow.hmin, sw->swindow.hScrollBar->scrollBar.orientation); } /************************************************************************ * * * RightEdge - move the view to the Right edge * * * ************************************************************************/ /* ARGSUSED */ static void RightEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; if (!sw->swindow.hScrollBar) return ; MoveWindow (sw, sw->swindow.hmax - sw->swindow.hExtent, sw->swindow.hScrollBar->scrollBar.orientation); } /************************************************************************ * * * TopEdge - move the view to the Top edge * * * ************************************************************************/ /* ARGSUSED */ static void TopEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; if (!sw->swindow.vScrollBar) return ; MoveWindow (sw, sw->swindow.vmin, sw->swindow.vScrollBar->scrollBar.orientation); } /************************************************************************ * * * BottomEdge - move the view to the Bottom edge * * * ************************************************************************/ /* ARGSUSED */ static void BottomEdge( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; if (!sw->swindow.vScrollBar) return ; MoveWindow (sw, sw->swindow.vmax - sw->swindow.vExtent, sw->swindow.vScrollBar->scrollBar.orientation); } /************************************************************************ * * * PageLeft - Scroll left a page * * * ************************************************************************/ /* ARGSUSED */ static void PageLeft( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; int value ; if (sw->swindow.hScrollBar) value = sw->swindow.hOrigin - (sw->swindow.hScrollBar)->scrollBar.page_increment; else { if (sw->swindow.WorkWindow) value = sw->swindow.hOrigin - sw->swindow.WorkWindow->core.width; else return; } MoveWindow (sw, MAX(value, sw->swindow.hmin), XmHORIZONTAL); } /************************************************************************ * * * PageRight - Scroll Right a page * * * ************************************************************************/ /* ARGSUSED */ static void PageRight( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; int value ; if (sw->swindow.hScrollBar) value = sw->swindow.hOrigin + (sw->swindow.hScrollBar)->scrollBar.page_increment; else { if (sw->swindow.WorkWindow) value = sw->swindow.hOrigin + sw->swindow.WorkWindow->core.width; else return; } MoveWindow (sw, MIN(value, (sw->swindow.hmax - sw->swindow.hExtent)), XmHORIZONTAL); } /************************************************************************ * * * PageUp - Scroll up a page * * * ************************************************************************/ /* ARGSUSED */ static void PageUp( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; int value ; if (sw->swindow.vScrollBar) value = sw->swindow.vOrigin - (sw->swindow.vScrollBar)->scrollBar.page_increment; else { if (sw->swindow.WorkWindow) value = sw->swindow.vOrigin - sw->swindow.WorkWindow->core.height; else return; } MoveWindow (sw, MAX(value, sw->swindow.vmin), XmVERTICAL); } /************************************************************************ * * * PageDown - Scroll Down a page * * * ************************************************************************/ /* ARGSUSED */ static void PageDown( Widget wid, XEvent *event, String *params, Cardinal *num_params ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; int value ; if (sw->swindow.vScrollBar) value = sw->swindow.vOrigin + (sw->swindow.vScrollBar)->scrollBar.page_increment; else { if (sw->swindow.WorkWindow) value = sw->swindow.vOrigin + sw->swindow.WorkWindow->core.height; else return; } MoveWindow (sw, MIN(value, (sw->swindow.vmax - sw->swindow.vExtent)), XmVERTICAL); } /************************************************************************ * * * ClassPartInitialize - Set up the fast subclassing. * * * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { XmScrolledWindowWidgetClass swc = (XmScrolledWindowWidgetClass) wc; XmScrolledWindowWidgetClass super = (XmScrolledWindowWidgetClass) wc->core_class.superclass; XmScrolledWindowClassExt *wcePtr, *scePtr; /* Inheritance of the auto drag drop site rectangles */ wcePtr = _XmGetScrolledWindowClassExtPtr(swc, NULLQUARK); if (((WidgetClass)swc != xmScrolledWindowWidgetClass) && (*wcePtr)) { scePtr = _XmGetScrolledWindowClassExtPtr(super, NULLQUARK); if ((*wcePtr)->get_hor_rects == XmInheritGetAutoDragRectsProc) (*wcePtr)->get_hor_rects = (*scePtr)->get_hor_rects; if ((*wcePtr)->get_vert_rects == XmInheritGetAutoDragRectsProc) (*wcePtr)->get_vert_rects = (*scePtr)->get_vert_rects; } _XmFastSubclassInit (wc, XmSCROLLED_WINDOW_BIT); /* Install the scrollFrame trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTscrollFrame, (XtPointer)&scrolledWindowSFT); } /************************************************************************ * * * Initialize * * * ************************************************************************/ /* ARGSUSED */ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmScrolledWindowWidget request = (XmScrolledWindowWidget) rw ; XmScrolledWindowWidget new_w = (XmScrolledWindowWidget) nw ; Cardinal n; Arg loc_args[5] ; /**************** * * Check validity * ****************/ if(!XmRepTypeValidValue( XmRID_SCROLLING_POLICY, new_w->swindow.ScrollPolicy, (Widget) new_w) ) { new_w->swindow.ScrollPolicy = XmAPPLICATION_DEFINED; } /* VisualPolicy has already been set using ScrollPolicy in the default proc, check that no one changed it */ if(!XmRepTypeValidValue( XmRID_VISUAL_POLICY, new_w->swindow.VisualPolicy, (Widget) new_w) ) { if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) new_w->swindow.VisualPolicy = XmCONSTANT; else new_w->swindow.VisualPolicy = XmVARIABLE; } if ((new_w->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) && (new_w->swindow.VisualPolicy != XmVARIABLE)) { XmeWarning( (Widget) new_w, SWMessage11); new_w->swindow.VisualPolicy = XmVARIABLE; } /* force constant & automatic */ if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) new_w->swindow.VisualPolicy = XmCONSTANT; if (new_w->swindow.ScrollBarPolicy == (unsigned char)RESOURCE_DEFAULT) { if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) new_w->swindow.ScrollBarPolicy = XmAS_NEEDED; else new_w->swindow.ScrollBarPolicy = XmSTATIC; } if(!XmRepTypeValidValue(XmRID_SCROLL_BAR_DISPLAY_POLICY, new_w->swindow.ScrollBarPolicy, (Widget) new_w) ) { if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) new_w->swindow.ScrollBarPolicy = XmAS_NEEDED; else new_w->swindow.ScrollBarPolicy = XmSTATIC; } if ((new_w->swindow.VisualPolicy == XmVARIABLE) && (request->swindow.ScrollBarPolicy == XmAS_NEEDED)) { XmeWarning( (Widget) new_w, SWMessage8); new_w->swindow.ScrollBarPolicy = XmSTATIC; } if(!XmRepTypeValidValue( XmRID_SCROLL_BAR_PLACEMENT, new_w->swindow.Placement, (Widget) new_w) ) { new_w->swindow.Placement = XmBOTTOM_RIGHT; } if (new_w->swindow.pad == (Dimension)RESOURCE_DEFAULT) new_w->swindow.pad = DEFAULT_SPACING; if (request->manager.shadow_thickness == (Dimension)RESOURCE_DEFAULT) { if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) { new_w->manager.shadow_thickness = 2; } else { new_w->manager.shadow_thickness = 0; } } /**************** * * Init internal fields now * ****************/ new_w->swindow.FromResize = FALSE; /* the mins actually never change, the others, max, extent, etc, get update the first time the SW is resized */ new_w->swindow.hmin = 0 ; new_w->swindow.vmin = 0 ; /**************** * * We will set the X and Y offsets to the pad values. That lets us use * the four variables as a "margin" to the user, but MainWindow can still * dink around with them if it wants. * ****************/ new_w->swindow.XOffset = new_w->swindow.WidthPad; new_w->swindow.YOffset = new_w->swindow.HeightPad; /* these fields are used to find out if the object need to be reposition according to the scrollbars minima. */ /* that happens the first time and when the scrollbars disappears too */ new_w->swindow.sw_prev_x = MAXPOS; new_w->swindow.sw_prev_y = MAXPOS; /**************** * * Add our class translation table * ****************/ XtAugmentTranslations((Widget) new_w, (XtTranslations) ((XmManagerClassRec *)XtClass(new_w))-> manager_class.translations); /*********************** Initialize the auto_drag timer */ new_w->swindow.auto_drag_timer = 0 ; /*********************** Initialize the auto_drag rectangles */ if (new_w->swindow.auto_drag_model == XmAUTO_DRAG_ENABLED) new_w->swindow.auto_drag_rects = XtCalloc(1, sizeof(AutoDragRectsRec)); else new_w->swindow.auto_drag_rects = NULL; /*********************** Initialize the scroll_frame flag */ new_w->swindow.scroll_frame_inited = False; /**************** * * APPLICATION_DEFINED : we're almost done. * ****************/ if (new_w->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) { Dimension future_width, future_height ; /* without kids */ new_w->swindow.InInit = False; /* Need to default AreaWidth&Height to something that makes sense, since they might be used in Redisplay before layout if no kid is present in the SW. They will be changed if the SW gets a child. If the SW doesn't get a child, its size will be DEFAULT_SIZE if it hasn't one already (if it is null). */ if (new_w->core.width == 0) future_width = DEFAULT_SIZE ; else future_width = new_w->core.width ; if (new_w->core.height == 0) future_height = DEFAULT_SIZE ; else future_height = new_w->core.height ; if (future_width > new_w->manager.shadow_thickness*2) new_w->swindow.AreaWidth = future_width - (new_w->manager.shadow_thickness * 2); else new_w->swindow.AreaWidth = 2 ; if (future_height > new_w->manager.shadow_thickness*2) new_w->swindow.AreaHeight = future_height - (new_w->manager.shadow_thickness * 2); else new_w->swindow.AreaHeight = 2 ; /* In app defined, we do not initialize the scrollframe, so that List and Text could check that it hasn't been done yet and do it */ return; } /***************--------------------------*********************** * * Else we're in AUTOMATIC, and we are about to create private * children, so set up a flag for use in InsertChild * *****************/ new_w->swindow.InInit = True; /* Default dimension here, not in ChangeManaged because auto mode isn't based on children size */ if (new_w->core.width == 0) new_w->core.width = DEFAULT_SIZE ; if (new_w->core.height == 0) new_w->core.height = DEFAULT_SIZE ; /* default Area fields too, see above comments */ if (new_w->core.width > new_w->manager.shadow_thickness*2) new_w->swindow.AreaWidth = new_w->core.width - (new_w->manager.shadow_thickness * 2); else new_w->swindow.AreaWidth = 2 ; if (new_w->core.height > new_w->manager.shadow_thickness*2) new_w->swindow.AreaHeight = new_w->core.height - (new_w->manager.shadow_thickness * 2); else new_w->swindow.AreaHeight = 2 ; /**************** * * create a clip window. * ****************/ n = 0 ; XtSetArg (loc_args[n], XmNscrolledWindowChildType, XmCLIP_WINDOW); n++ ; /* give an initial size to the clipwindow, since when layoutDirection is reversed, the clipwindow size is used from ConstraintInitialize (before the first layout, which resizes the clipwindow) */ XtSetArg (loc_args[n], XmNwidth, new_w->swindow.AreaWidth); n++ ; XtSetArg (loc_args[n], XmNheight, new_w->swindow.AreaHeight); n++ ; new_w->swindow.ClipWindow = (XmDrawingAreaWidget) XtCreateManagedWidget("ClipWindow", xmClipWindowWidgetClass, (Widget) new_w, loc_args, n); /*********************** Initialize the scrollFrame with move callback for Automatic */ ((XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass(nw), XmQTscrollFrame))-> init(nw, SliderMove, (Widget) new_w->swindow.ClipWindow); /**************** * * create the scroll bars. * location and size don't matter right now - * we'll figure them out for real at changemanaged time. * * The trait AddNavigator method will be set up in * InsertChild so that APP_DEFINED (ScrolledList, Text, etc) * get it for their scrollbars as well. * ****************/ /********************** * vertical scrollbar */ n = 0 ; XtSetArg (loc_args[n], XmNorientation, XmVERTICAL); n++; new_w->swindow.vScrollBar = (XmScrollBarWidget) XtCreateManagedWidget("VertScrollBar", xmScrollBarWidgetClass, (Widget) new_w, loc_args, n); /************************ * horizontal scrollbar */ n = 0 ; XtSetArg (loc_args[n], XmNorientation, XmHORIZONTAL); n++; new_w->swindow.hScrollBar = (XmScrollBarWidget) XtCreateManagedWidget("HorScrollBar", xmScrollBarWidgetClass, (Widget) new_w, loc_args, n); /* could set childType for the scrollbar here too, but it's more convenient to do that in InsertChild, since app defined scrollbar are only available down there */ /* turn off the InsertChild flag */ new_w->swindow.InInit = FALSE; } /************************************************************************ * * * Redisplay - General redisplay function called on exposure events. * * * ************************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; Dimension st, bw; if (!XtIsRealized (wid)) return ; /* get rid of that when GM redone*/ st = sw->manager.shadow_thickness; if (sw->swindow.ScrollPolicy == XmAUTOMATIC) { XmeDrawShadows (XtDisplay (sw), XtWindow (sw), sw -> manager.bottom_shadow_GC, sw -> manager.top_shadow_GC, sw->swindow.ClipWindow->core.x - st, sw->swindow.ClipWindow->core.y - st, sw -> swindow.AreaWidth + (st * 2), sw -> swindow.AreaHeight + (st * 2), sw->manager.shadow_thickness, XmSHADOW_OUT); } else { if (sw->swindow.WorkWindow) { bw = sw->swindow.WorkWindow->core.border_width; XmeDrawShadows (XtDisplay (sw), XtWindow (sw), sw -> manager.bottom_shadow_GC, sw -> manager.top_shadow_GC, sw->swindow.WorkWindow->core.x - st, sw->swindow.WorkWindow->core.y - st, sw -> swindow.AreaWidth + ((bw + st) * 2), sw -> swindow.AreaHeight + ((bw + st) * 2), sw->manager.shadow_thickness, XmSHADOW_OUT); } else XmeDrawShadows (XtDisplay (sw), XtWindow (sw), sw -> manager.bottom_shadow_GC, sw -> manager.top_shadow_GC, 0, 0, sw -> swindow.AreaWidth + (st * 2), sw -> swindow.AreaHeight + (st * 2), sw->manager.shadow_thickness, XmSHADOW_OUT); } XmeRedisplayGadgets(wid, event, region); } /************************************************************************ * * * InsertChild: set internal pointers * * * ************************************************************************/ static void InsertChild( Widget w ) { XmManagerWidgetClass superclass = (XmManagerWidgetClass) xmManagerWidgetClass; XmScrolledWindowWidget sw = (XmScrolledWindowWidget)w->core.parent ; XmScrolledWindowConstraint swc = GetSWConstraint(w); Arg args[5] ; Cardinal n ; XtWidgetProc insert_child; if (!XtIsRectObj(w)) return; _XmProcessLock(); insert_child = superclass->composite_class.insert_child; _XmProcessUnlock(); /**************** * Manage the child type defaulting first - * for auto created children (clip/scrollbars/sep) as well * ****************/ if (swc->child_type == (unsigned char) RESOURCE_DEFAULT) { if (XmIsScrollBar(w)) { if (((XmScrollBarWidget) w)->scrollBar.orientation == XmHORIZONTAL) { swc->child_type = XmHOR_SCROLLBAR ; } else { swc->child_type = XmVERT_SCROLLBAR ; } } else { swc->child_type = XmWORK_AREA ; } } if ((swc->child_type == XmHOR_SCROLLBAR) || (swc->child_type == XmVERT_SCROLLBAR)) { /************************/ /* Deal with the Scrollbar auto drag drop site register here, */ /* create the dropsite only if resource says so */ /* The model is: the scrollbars are used as drop site, with 2 rectangles around the workarea, defined upon resize using XmDropSiteUpdate in UpdateAutoDrag */ /* this is done for both AUTO and APP_DEFINED scrollbars */ if (sw->swindow.auto_drag_model == XmAUTO_DRAG_ENABLED) { n = 0 ; XtSetArg(args[n], XmNdropProc, HandleDrop); n++ ; XtSetArg(args[n], XmNdragProc, HandleDrag); n++ ; XtSetArg(args[n], XmNnumImportTargets, 1); n++ ; XtSetArg(args[n], XmNimportTargets, w); n++ ; XmDropSiteRegister(w, args, n); } } /************************ Do the navigator association now. ************************/ if (swc->child_type == XmHOR_SCROLLBAR) ((XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass((Widget)(sw)), XmQTscrollFrame))-> addNavigator((Widget)sw, w, NavigDimensionX); else if (swc->child_type == XmVERT_SCROLLBAR) ((XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass((Widget)(sw)), XmQTscrollFrame))-> addNavigator((Widget)sw, w, NavigDimensionY); /************************ Check if auto created child (Clipwindow, Scrollbars) if yes, insert using superclass method */ if (sw->swindow.InInit) { (*insert_child)(w); } else { /**************** * * APP_DEFINED, handle scrollbars case, set the workwindow if not * already set. * ****************/ if (sw->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) { if (swc->child_type == XmHOR_SCROLLBAR) sw->swindow.hScrollBar = (XmScrollBarWidget) w; else if (swc->child_type == XmVERT_SCROLLBAR) sw->swindow.vScrollBar = (XmScrollBarWidget) w; else if (swc->child_type == XmWORK_AREA) { if (!sw->swindow.WorkWindow) sw->swindow.WorkWindow = w; } } /**************** * * AUTOMATIC: set the workwindow and reparent it to the clipwindow . * ****************/ else { /* maintain the old workwindow semantics */ if (swc->child_type == XmWORK_AREA) sw->swindow.WorkWindow = w; /* reparent all the clipped type children */ if ((swc->child_type == XmWORK_AREA) || (swc->child_type == XmSCROLL_HOR) || (swc->child_type == XmSCROLL_VERT) || (swc->child_type == XmNO_SCROLL)) { w->core.parent = (Widget )sw->swindow.ClipWindow; } } /* call insert child now. For the reparented workarea, that will insert it in the clipwindow child list */ (*insert_child)(w); /* Widgets already there might still be hanging around, it is the responsability of the application to destroy or unmanage or unmap them */ } } /************************************************************************ * * * DeleteChild: reset internal pointers to NULL * * * ************************************************************************/ static void DeleteChild( Widget child ) { Widget swWid = XtParent(child); XmScrolledWindowWidget sw = (XmScrolledWindowWidget) swWid; XtWidgetProc delete_child; if (child == sw->swindow.WorkWindow) sw->swindow.WorkWindow = NULL; /* auto drag will stop by itself when destroying these */ if (child == (Widget) sw->swindow.hScrollBar) sw->swindow.hScrollBar = NULL; if (child == (Widget) sw->swindow.vScrollBar) sw->swindow.vScrollBar = NULL; /* Clean up the Navigator. Metro Link fix, suggested by * Kevin B. Hendricks of Java-Linux project. */ if (XmeTraitGet((XtPointer) XtClass(child), XmQTnavigator) != NULL) RemoveNavigator(swWid, child); _XmProcessLock(); delete_child = ((CompositeWidgetClass)xmScrolledWindowClassRec.core_class.superclass) ->composite_class.delete_child; _XmProcessUnlock(); (*delete_child)(child); } /************************************************************************ * * * ComputeLocations - position the scrollbars and the workarea * * using the scrollbar placement resource * * Used in both Variable and Constant layout * * * ************************************************************************/ static void ComputeLocations( XmScrolledWindowWidget sw, Dimension HSBht, Dimension VSBht, Boolean HasHSB, Boolean HasVSB, Position * newx, Position * newy, Position * hsbX, Position * hsbY, Position * vsbX, Position * vsbY) { Dimension shad = sw->manager.shadow_thickness, pad = sw->swindow.pad, vsb_width, hsb_height; vsb_width = (HasVSB) ? (sw->swindow.vScrollBar->core.width) : 0; hsb_height = (HasHSB) ? (sw->swindow.hScrollBar->core.height) : 0; /**************** * * Initialize the placement variables - these are correct for * bottom-right placement of the scrollbars. * ****************/ *newx = sw->swindow.XOffset + shad + HSBht; *newy = sw->swindow.YOffset + shad + VSBht; *hsbX = sw->swindow.XOffset; *vsbY = sw->swindow.YOffset; *vsbX = (HasVSB) ? (sw->core.width - sw->swindow.WidthPad - vsb_width) : sw->core.width; *hsbY = (HasHSB) ? (sw->core.height - sw->swindow.HeightPad - hsb_height): sw->core.height; /**************** * * Check out the scrollbar placement policy and hack the locations * accordingly. * ****************/ switch (sw->swindow.Placement) { case XmTOP_LEFT: *newx = (HasVSB) ? (vsb_width + sw->swindow.XOffset + pad + shad + HSBht) : (sw->swindow.XOffset + shad + HSBht); *newy = (HasHSB) ? (hsb_height + sw->swindow.YOffset + pad + shad + VSBht) : (sw->swindow.YOffset + shad + VSBht); *hsbX = *newx - HSBht - shad; *hsbY = sw->swindow.YOffset; *vsbX = sw->swindow.XOffset; *vsbY = *newy - VSBht - shad; break; case XmTOP_RIGHT: *newy = (HasHSB) ? (hsb_height + sw->swindow.YOffset + pad + shad + VSBht) : (sw->swindow.YOffset + shad + VSBht); *vsbY = *newy - shad - VSBht; *hsbY = sw->swindow.YOffset; break; case XmBOTTOM_LEFT: *newx = (HasVSB) ? (vsb_width + sw->swindow.XOffset + pad + shad + HSBht) : (sw->swindow.XOffset + shad + HSBht); *hsbX = *newx - HSBht - shad; *vsbX = sw->swindow.XOffset; break; default: break; } } static void CheckKids( XmScrolledWindowWidget sw ) { /* do a sanity check */ if( sw->swindow.WorkWindow != NULL && sw->swindow.WorkWindow->core.being_destroyed ) { sw->swindow.WorkWindow = NULL; } if( sw->swindow.hScrollBar != NULL && sw->swindow.hScrollBar->core.being_destroyed ) { sw->swindow.hScrollBar = NULL; } if( sw->swindow.vScrollBar != NULL && sw->swindow.vScrollBar->core.being_destroyed ) { sw->swindow.vScrollBar = NULL; } } /************************************************************************ * * * VariableLayout - Layout the workarea and the scrollbars for * * APPLICATION_DEFINED. ScrolledWindow has a size already. * * APP_DEFINED SW still use sw->swindow.WorkWindow * ************************************************************************/ static void VariableLayout( XmScrolledWindowWidget sw ) { Position newx, newy, vsbX, vsbY, hsbX, hsbY; Dimension HSBht = 0, VSBht = 0, VSBwidth = 0, HSBheight = 0; Dimension MyWidth, MyHeight, childWidth, childHeight; Dimension shad = sw->manager.shadow_thickness, pad = sw->swindow.pad, bw; int tmp; Boolean HasHSB, HasVSB, HSBTrav = True, VSBTrav = True; XtWidgetGeometry desired, preferred; CheckKids(sw); /* no Workwindow, make scrollbars invisible -- Doesn't seem right to do that given app_defined policy... */ if (!ExistManaged(sw->swindow.WorkWindow)) { if (sw->swindow.vScrollBar) XmeConfigureObject((Widget) sw->swindow.vScrollBar, sw->core.width, 0, (sw->swindow.vScrollBar)->core.width, (sw->swindow.vScrollBar)->core.height, (sw->swindow.vScrollBar)->core.border_width); if (sw->swindow.hScrollBar) XmeConfigureObject((Widget) sw->swindow.hScrollBar, 0, sw->core.height, (sw->swindow.hScrollBar)->core.width, (sw->swindow.hScrollBar)->core.height, (sw->swindow.hScrollBar)->core.border_width); return; } bw = sw->swindow.WorkWindow->core.border_width ; /* Compute the available size after a subclass, like mainwindow, has taken its share of layout. */ /* worry about going negative */ tmp = (int) sw->core.width - sw->swindow.XOffset - sw->swindow.WidthPad; if (tmp <= 0) MyWidth = 10; else MyWidth = (Dimension )tmp; tmp = (int) sw->core.height - sw->swindow.YOffset - sw->swindow.HeightPad; if (tmp <= 0) MyHeight = 10; else MyHeight = (Dimension )tmp; /* CR 5319 begin */ if (sw->core.width > sw->swindow.WidthPad + shad*2) sw->swindow.AreaWidth = sw->core.width - sw->swindow.WidthPad - ((shad * 2) ); else sw->swindow.AreaWidth = 0; if (sw->core.height > sw->swindow.HeightPad + shad*2) sw->swindow.AreaHeight = sw->core.height - sw->swindow.HeightPad - ((shad * 2) ); else sw->swindow.AreaHeight = 0; /* CR 5319 end */ tmp = (int) MyWidth - (((int )shad+(int )bw) * 2); if (tmp <= 0) childWidth = 2; else childWidth = (Dimension )tmp; tmp = (int )MyHeight - (((int )shad+(int )bw) * 2); if (tmp <= 0) childHeight = 2; else childHeight = (Dimension )tmp; /**************** * * OK, we just figured out the maximum size for the child (with no * scrollbars (it's in childWidth, childHeight). Now query the * kid geometry - tell him that we are going to resize him to childWidth, * childHeight and give him a chance to muck with the scrollbars or whatever. * Then, we re-layout according to the current scrollbar config. * ****************/ desired.x = shad + sw->swindow.XOffset; desired.y = shad + sw->swindow.YOffset; desired.border_width = bw; desired.height = childHeight; desired.width = childWidth; desired.request_mode = (CWWidth | CWHeight); /* child may manage or unmanage the scrollbars, set a flag up and check for it in ChangeManaged */ sw->swindow.FromResize = TRUE; XtQueryGeometry(sw->swindow.WorkWindow, &desired, &preferred); sw->swindow.FromResize = FALSE; bw = preferred.border_width; HasHSB = ExistManaged((Widget) sw->swindow.hScrollBar); HasVSB = ExistManaged((Widget) sw->swindow.vScrollBar); if (HasHSB) { HSBht = sw->swindow.hScrollBar->primitive.highlight_thickness ; HSBTrav = sw->swindow.hScrollBar->primitive.traversal_on ; HSBheight = sw->swindow.hScrollBar->core.height ; } if (HasVSB) { VSBht = sw->swindow.vScrollBar->primitive.highlight_thickness ; VSBTrav = sw->swindow.vScrollBar->primitive.traversal_on ; VSBwidth = sw->swindow.vScrollBar->core.width ; } /**************** * * Here's a cool undocumented feature. If the scrollbar is not * traversable,but has a highlight thickness, we assume it's something * that wants to draw the highlight around the workwindow, and wants to * have the scrollbars line up properly. Something like Scrolled Text, * for instance :-) * ****************/ if (ExistManaged(sw->swindow.WorkWindow) && XmIsPrimitive(sw->swindow.WorkWindow)) { if (HSBht && !HSBTrav) HSBht = 0; if (VSBht && !VSBTrav) VSBht = 0; } /**************** * * Get the position for scrollbars and workarea * ****************/ ComputeLocations(sw, HSBht, VSBht, HasHSB, HasVSB, &newx, &newy, &hsbX, &hsbY, &vsbX, &vsbY); /* reset the child sizes */ childWidth = (HasVSB) ? MyWidth - (VSBwidth + (2 * VSBht) + SB_BORDER_WIDTH + ((HSBht + bw + shad)*2) + pad ) : MyWidth - ((HSBht + shad+bw) * 2); childHeight = (HasHSB) ? MyHeight - (HSBheight + (2 * HSBht) + SB_BORDER_WIDTH + ((VSBht + shad + bw)*2) + pad ) : MyHeight - ((VSBht + shad+bw) * 2); if (childWidth > MyWidth) childWidth = 2; if (childHeight > MyHeight) childHeight = 2; XmeConfigureObject(sw->swindow.WorkWindow, newx, newy, childWidth, childHeight, bw); /* not needed here, because never auto, but we leave it for now */ if (sw->swindow.ClipWindow) XmeConfigureObject((Widget) sw->swindow.ClipWindow, newx, newy, childWidth, childHeight, 0); sw->swindow.AreaWidth = childWidth; sw->swindow.AreaHeight = childHeight; /* always forces one scrollbar dimension */ sw->swindow.hsbWidth = childWidth + ((HSBht + shad + bw) * 2); sw->swindow.vsbHeight = childHeight + ((VSBht + shad + bw) * 2); if (HasVSB) XmeConfigureObject((Widget) sw->swindow.vScrollBar, vsbX, vsbY, VSBwidth, sw->swindow.vsbHeight, SB_BORDER_WIDTH); if (HasHSB) XmeConfigureObject((Widget) sw->swindow.hScrollBar, hsbX, hsbY, sw->swindow.hsbWidth, HSBheight, SB_BORDER_WIDTH); } /************************************************************************ * * * ConstantLayout - Layout the scrolled window for AUTOMATIC * * * ************************************************************************/ static void ConstantLayout( XmScrolledWindowWidget sw ) { XmDrawingAreaWidget clip = (XmDrawingAreaWidget) sw->swindow.ClipWindow ; int i, hinc, hpage_inc, vinc, vpage_inc; Position newx, newy; Position hsbX, hsbY, vsbX, vsbY, clipX, clipY; int clipWidth, clipHeight; int MyWidth, MyHeight; Dimension HSBht, VSBht, shad = sw->manager.shadow_thickness, pad = sw->swindow.pad; Boolean HasHSB, HasVSB, HSBExists, VSBExists, no_scroll_present = False; XmScrolledWindowConstraint swc; Widget child ; XmNavigatorDataRec nav_data ; /* Compute the available size after a subclass, like mainwindow, has taken its share of layout. */ MyWidth = sw->core.width - sw->swindow.XOffset - sw->swindow.WidthPad; MyHeight = sw->core.height - sw->swindow.YOffset - sw->swindow.HeightPad; HSBExists = ExistManaged((Widget) sw->swindow.hScrollBar); VSBExists = ExistManaged((Widget) sw->swindow.vScrollBar); /* If there's no kid to clip, keep the scrollbars invisible by moving them out of the frame */ for (i = 0; i < clip->composite.num_children; i++) { if (XtIsManaged(clip->composite.children[i])) break ; } /* ran thru the entire list: no managed child in the clipwindow */ if (i == clip->composite.num_children) { if (VSBExists) { XmeConfigureObject((Widget) sw->swindow.vScrollBar, sw->core.width, sw->swindow.vScrollBar->core.y, (sw->swindow.vScrollBar)->core.width, (sw->swindow.vScrollBar)->core.height, (sw->swindow.vScrollBar)->core.border_width); sw->swindow.vsbX = sw->swindow.vScrollBar->core.x; } if (HSBExists) { XmeConfigureObject((Widget) sw->swindow.hScrollBar, sw->swindow.hScrollBar->core.x, sw->core.height, (sw->swindow.hScrollBar)->core.width, (sw->swindow.hScrollBar)->core.height, (sw->swindow.hScrollBar)->core.border_width); sw->swindow.hsbY = sw->swindow.hScrollBar->core.y; } /* looks bogus, but who care of this extreme case */ sw->swindow.AreaWidth = sw->core.width - sw->swindow.WidthPad - ((shad * 2) ); sw->swindow.AreaHeight = sw->core.height - sw->swindow.HeightPad - ((shad * 2) ); XmeConfigureObject((Widget) clip, shad + sw->swindow.XOffset, shad + sw->swindow.YOffset, sw->swindow.AreaWidth, sw->swindow.AreaHeight, 0); return; } HSBht = (HSBExists) ? sw->swindow.hScrollBar->primitive.highlight_thickness : 0; VSBht = (VSBExists) ? sw->swindow.vScrollBar->primitive.highlight_thickness : 0; /* find the new min x and y children orig position and the new max width and height (position+dimension) stuff as well */ newx = MAXPOS; newy = MAXPOS; sw->swindow.hmax = 0; sw->swindow.vmax = 0; for (i = 0; i < clip->composite.num_children; i++) { child = clip->composite.children[i]; if (ExistManaged(child)) { swc = GetSWConstraint(child); /* only regular work_area and scroll_vert kids count for the vmax calculation */ if ((swc->child_type == XmWORK_AREA) || (swc->child_type == XmSCROLL_VERT)) { newy = MIN(newy, swc->orig_y); sw->swindow.vmax = MAX(sw->swindow.vmax, swc->orig_y + child->core.height + 2*child->core.border_width); } /* only regular work_area and scroll_hor kids count for the hmax calculation */ if ((swc->child_type == XmWORK_AREA) || (swc->child_type == XmSCROLL_HOR)) { newx = MIN(newx, swc->orig_x); sw->swindow.hmax = MAX(sw->swindow.hmax, swc->orig_x + child->core.width + 2*child->core.border_width); } if (swc->child_type == XmNO_SCROLL) no_scroll_present = True ; } } /* here we have to have an additional check for the case there is no WORKAREA but only HOR or VERT SCROLL. We want to get a h/vmax not null in this case. */ if (sw->swindow.hmax && !sw->swindow.vmax) { sw->swindow.vmax = MyHeight - (shad*2) ; newy = 0 ; } if (!sw->swindow.hmax && sw->swindow.vmax) { sw->swindow.hmax = MyWidth - (shad*2) ; newx = 0 ; } if (!sw->swindow.hmax && !sw->swindow.vmax) { /* check if there is only a NO_SCROLL... */ if (no_scroll_present) { sw->swindow.vmax = MyHeight - (shad*2) ; sw->swindow.hmax = MyWidth - (shad*2) ; newx = 0 ; newy = 0 ; } else { return ; } } /**************** * * Look at my size and set the clip dimensions accordingly. If the kid * fits easily into the space, and we can ditch the scrollbars, set * the clip dimension to the size of the window and flag the scrollbars * as false. If the kid won't fit in either direction, or if the * scrollbars are constantly in the way, set the clip dimensions to the * minimum area and flag both scrollbars as true. Otherwise, look at * the dimensions, and see if either one needs a scrollbar. * ****************/ if (((MyHeight - (shad*2)) >= sw->swindow.vmax) && ((MyWidth - (shad*2)) >= sw->swindow.hmax) && (sw->swindow.ScrollBarPolicy == XmAS_NEEDED)) { clipWidth = MyWidth - (shad * 2); clipHeight = MyHeight - (shad * 2); HasVSB = HasHSB = FALSE; /* no visible scrollbar anymore, move the objects to their origin */ sw->swindow.sw_prev_x = MAXPOS ; sw->swindow.sw_prev_y = MAXPOS ; } else { clipHeight = (HSBExists) ? MyHeight - (sw->swindow.hScrollBar->core.height + SB_BORDER_WIDTH + ((HSBht + shad) * 2 + pad)) : MyHeight - ((VSBht + shad) * 2 ); clipWidth = (VSBExists) ? MyWidth - (sw->swindow.vScrollBar->core.width + SB_BORDER_WIDTH + ((VSBht + shad) * 2 + pad)) : MyWidth - ((HSBht + shad) * 2 ); if ((((MyHeight - (shad*2)) < sw->swindow.vmax) && ((MyWidth - (shad*2)) < sw->swindow.hmax)) || (sw->swindow.ScrollBarPolicy == XmSTATIC)) { HasVSB = HasHSB = TRUE; } else { HasVSB = HasHSB = TRUE; if ((sw->swindow.vmax <= clipHeight) || (!VSBExists)) { clipWidth = MyWidth - ((HSBht + shad) * 2); clipHeight += VSBht; sw->swindow.sw_prev_y = MAXPOS ; HasVSB = FALSE; } if ((sw->swindow.hmax <= clipWidth) || (!HSBExists)) { clipHeight = MyHeight - ((VSBht + shad) * 2); clipWidth += HSBht; sw->swindow.sw_prev_x = MAXPOS ; HasHSB = FALSE; } } } HasVSB = (HasVSB && VSBExists); HasHSB = (HasHSB && HSBExists); /* safe check */ if (clipHeight < 2) clipHeight = 2 ; if (clipWidth < 2) clipWidth = 2 ; /**************** * * Now set characteristics for every navigators. * we update the navigators even unmanaged, so that an application can * unamanaged them and still use them as "movers". * If the new minimum position has changed (in either x or y direction) * we set the value to 0. otherwise, it stays what it was. * ****************/ nav_data.valueMask = NavValue; /* slider size = extent */ if ((sw->swindow.vmax - sw->swindow.vmin) < clipHeight) sw->swindow.vExtent = sw->swindow.vmax - sw->swindow.vmin; else sw->swindow.vExtent = clipHeight; /* always true the first time */ if (newy != sw->swindow.sw_prev_y) { /* move all the navigators to 0, which doesn't mean move the scrolled object to 0, since they can have offset now */ sw->swindow.vOrigin = 0; nav_data.value.y = sw->swindow.vOrigin ; nav_data.dimMask = NavigDimensionY ; _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, True); sw->swindow.sw_prev_y = newy ; } if (sw->swindow.vOrigin > (sw->swindow.vmax - sw->swindow.vExtent)) { sw->swindow.vOrigin = sw->swindow.vmax - sw->swindow.vExtent; nav_data.value.y = sw->swindow.vOrigin ; nav_data.dimMask = NavigDimensionY; _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, True); } if ((vinc = (sw->swindow.vmax / 10)) < 1) vinc = 1; if ((vpage_inc = (clipHeight - (clipHeight / 10))) < 1) vpage_inc = clipHeight; if ((sw->swindow.hmax - sw->swindow.hmin) < clipWidth) sw->swindow.hExtent = sw->swindow.hmax - sw->swindow.hmin; else sw->swindow.hExtent = clipWidth; if (newx != sw->swindow.sw_prev_x) { sw->swindow.hOrigin = 0; nav_data.value.x = sw->swindow.hOrigin ; nav_data.dimMask = NavigDimensionX ; _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, True); /* when reversed, the moving proc has to be called manually, for the reverse configure to happen. I might not get called by the navigator API when the value already matches */ if (LayoutIsRtoLM((Widget)sw)) SliderMove((Widget)sw->swindow.hScrollBar, clip, NULL); sw->swindow.sw_prev_x = newx ; } if (sw->swindow.hOrigin > (sw->swindow.hmax - sw->swindow.hExtent)) { sw->swindow.hOrigin = sw->swindow.hmax - sw->swindow.hExtent; nav_data.value.x = sw->swindow.hOrigin ; nav_data.dimMask = NavigDimensionX ; _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, True); } if ((hinc = (sw->swindow.hmax / 10)) < 1) hinc = 1; if ((hpage_inc = (clipWidth - (clipWidth / 10))) < 1) hpage_inc = clipWidth; nav_data.value.x = sw->swindow.hOrigin ; nav_data.value.y = sw->swindow.vOrigin ; nav_data.minimum.x = sw->swindow.hmin ; nav_data.minimum.y = sw->swindow.vmin ; nav_data.maximum.x = sw->swindow.hmax ; nav_data.maximum.y = sw->swindow.vmax ; nav_data.slider_size.x = sw->swindow.hExtent ; nav_data.slider_size.y = sw->swindow.vExtent ; nav_data.increment.x = hinc ; nav_data.increment.y = vinc ; nav_data.page_increment.x = hpage_inc ; nav_data.page_increment.y = vpage_inc ; nav_data.dimMask = NavigDimensionX|NavigDimensionY ; nav_data.valueMask = NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement; _XmSFUpdateNavigatorsValue((Widget)sw, &nav_data, False); /**************** * * Now the layout. * ****************/ if (HasHSB) if (!HasVSB) sw->swindow.hsbWidth = MyWidth; else sw->swindow.hsbWidth = clipWidth + ((HSBht + shad) * 2); else sw->swindow.hsbWidth = MyWidth; if (HasVSB) if (!HasHSB) sw->swindow.vsbHeight = MyHeight; else sw->swindow.vsbHeight = clipHeight + ((VSBht + shad) * 2); else sw->swindow.vsbHeight = MyHeight; HSBht = (HasHSB) ? sw->swindow.hScrollBar->primitive.highlight_thickness : 0; VSBht = (HasVSB) ? sw->swindow.vScrollBar->primitive.highlight_thickness : 0; /**************** * * Get the position for scrollbars and workarea * ****************/ ComputeLocations(sw, HSBht, VSBht, HasHSB, HasVSB, &clipX, &clipY, &hsbX, &hsbY, &vsbX, &vsbY); /**************** * * Finally - move the widgets. * ****************/ XmeConfigureObject((Widget) sw->swindow.ClipWindow, clipX, clipY, clipWidth, clipHeight, 0); sw->swindow.AreaWidth = clipWidth; sw->swindow.AreaHeight = clipHeight; if (HasVSB) XmeConfigureObject( (Widget) sw->swindow.vScrollBar, vsbX, vsbY, sw->swindow.vScrollBar->core.width, sw->swindow.vsbHeight, SB_BORDER_WIDTH); else if (VSBExists) { XmeConfigureObject((Widget) sw->swindow.vScrollBar, sw->core.width, sw->swindow.YOffset, sw->swindow.vScrollBar->core.width, sw->swindow.vsbHeight, SB_BORDER_WIDTH); if (_XmFocusIsHere( (Widget) sw->swindow.vScrollBar)) XmProcessTraversal( (Widget) sw, XmTRAVERSE_NEXT_TAB_GROUP); } if (HasHSB) XmeConfigureObject( (Widget) sw->swindow.hScrollBar, hsbX, hsbY, sw->swindow.hsbWidth, sw->swindow.hScrollBar->core.height, SB_BORDER_WIDTH); else if (HSBExists) { XmeConfigureObject( (Widget) sw->swindow.hScrollBar, sw->swindow.XOffset, sw->core.height, sw->swindow.hsbWidth, sw->swindow.hScrollBar->core.height, SB_BORDER_WIDTH); if (_XmFocusIsHere( (Widget) sw->swindow.hScrollBar)) XmProcessTraversal( (Widget) sw, XmTRAVERSE_NEXT_TAB_GROUP); } if (VSBExists) sw->swindow.vsbX = sw->swindow.vScrollBar->core.x; if (HSBExists) sw->swindow.hsbY = sw->swindow.hScrollBar->core.y; } /************************************************************************ * * * HandleDrop: does nothing special * * * ************************************************************************/ /*ARGSUSED*/ static void HandleDrop( Widget w, /* unused */ XtPointer client_data, /* unused */ XtPointer call_data) { XmDropProcCallback DropProc; Widget dc; Arg args[1] ; DropProc = (XmDropProcCallback)call_data; dc = DropProc->dragContext; XtSetArg(args[0], XmNtransferStatus, XmTRANSFER_FAILURE); XmDropTransferStart(dc, args, 1); } /*ARGSUSED*/ static void TimerEvent( XtPointer closure, XtIntervalId *id) /* unused */ { AutoDragClosure * auto_clos = (AutoDragClosure *) closure ; XmScrollBarWidget scrb = (XmScrollBarWidget) auto_clos->widget ; XmScrolledWindowWidget sw = (XmScrolledWindowWidget) XtParent(scrb) ; unsigned char direction = auto_clos->direction; Boolean hit = False ; int value ; XmNavigatorDataRec nav_data ; int repeat_delay = 100 ; /* for now, I don't have the get_range for all navigators, so special case the scrollbar which I know */ if (!XmIsScrollBar(auto_clos->widget)) return ; /* use XmScrollBar: value, increment, maximum, slider_size, minimum */ if (direction == FORWARD) { if ((scrb->scrollBar.value + scrb->scrollBar.increment) <= (scrb->scrollBar.maximum - scrb->scrollBar.slider_size)) value = scrb->scrollBar.value + scrb->scrollBar.increment ; else { value = scrb->scrollBar.maximum - scrb->scrollBar.slider_size ; hit = True ; } } else { if ((scrb->scrollBar.value - scrb->scrollBar.increment) >= scrb->scrollBar.minimum) value = scrb->scrollBar.value - scrb->scrollBar.increment ; else { value = scrb->scrollBar.minimum ; hit = True ; } } nav_data.valueMask = NavValue ; /* possible value for direction: horizontal or vertical */ if (scrb->scrollBar.orientation == XmHORIZONTAL) { nav_data.value.x = value ; nav_data.dimMask = NavigDimensionX ; } else { nav_data.value.y = value ; nav_data.dimMask = NavigDimensionY ; } _XmSFUpdateNavigatorsValue ((Widget)sw, &nav_data, True); XSync (XtDisplay (scrb), False); /* needed ? */ /* reactivate the timer with the same closure if not hit */ if (!hit) { XtVaGetValues(auto_clos->widget, XmNrepeatDelay, &repeat_delay, NULL); sw->swindow.auto_drag_timer = XtAppAddTimeOut ( XtWidgetToApplicationContext((Widget) scrb), repeat_delay, TimerEvent, closure); } else { /* free the closure and mark the timer as non existent */ XtFree((char*) closure); sw->swindow.auto_drag_timer = 0 ; } } /*ARGSUSED*/ static void HandleDrag( Widget w, XtPointer client_data, /* unused */ XtPointer call_data) { XmDragProcCallback dragProc = (XmDragProcCallback)call_data; int initial_delay = 250; AutoDragClosure * auto_clos; XmScrolledWindowWidget sw = (XmScrolledWindowWidget) XtParent(w) ; AutoDragRects rects = (AutoDragRects) sw -> swindow.auto_drag_rects; /* w is one of the scrollbar */ if (dragProc->reason == XmCR_DROP_SITE_ENTER_MESSAGE) { /* add a start update so that scrollbar moves generating widget configurations be bracketed for dropsite update. */ XmDropSiteStartUpdate(w); /* if that fails, initial_delay will stay 250 */ XtVaGetValues(w, XmNinitialDelay, &initial_delay, NULL); if (sw->swindow.auto_drag_timer == 0) { sw->swindow.auto_drag_closure = auto_clos = (AutoDragClosure *) XtMalloc(sizeof(AutoDragClosure)) ; auto_clos->widget = w ; /* Here we need to find in which direction to move. This is done using a private protocol between the GetAutoDragRects procs and this function: each scrollbar is a drop site with potentially multiple rectangles, the first half of them define the backward scroll and the second half the forward scroll. For now we only handle 2 rectangles, one top or left and one bottom or right of the corresp. scrollbar */ /* see if the current location is in the first rectangle*/ /* don't bother checking num_rect */ if (POINT_IN_RECT(dragProc->x, dragProc->y, rects -> up) || POINT_IN_RECT(dragProc->x, dragProc->y, rects -> left)) auto_clos->direction = BACKWARD ; else auto_clos->direction = FORWARD ; sw->swindow.auto_drag_timer = XtAppAddTimeOut (XtWidgetToApplicationContext(w), initial_delay, TimerEvent, (XtPointer) auto_clos); } } else if (dragProc->reason == XmCR_DROP_SITE_LEAVE_MESSAGE) { /* end the update when leaving the dropsite, which means when all move have been completed */ XmDropSiteEndUpdate(w); if (sw->swindow.auto_drag_timer) { XtRemoveTimeOut (sw->swindow.auto_drag_timer); XtFree(sw->swindow.auto_drag_closure); sw->swindow.auto_drag_timer = 0 ; } } } /************************************************************************ * * * GetAutoDragRects class methods * * * ************************************************************************/ static void GetHorRects( Widget sw, XRectangle ** hrect, Cardinal * num_hrect) { Widget w ; XmScrolledWindowWidget scw = (XmScrolledWindowWidget) sw ; *num_hrect = 2 ; *hrect = (XRectangle *) XtMalloc(sizeof(XRectangle) * (*num_hrect)) ; /* The hor rectangles are the ones that horizontally auto scroll, they are defined by areas on the left and right of the workarea, e.g. the margins, the spacing, the scrollbars and the shadows */ /* Both rects are computed using only the relative work_area or clipwindow (in AUTO) location within the scrolled window: this is the area between the widget and its parent frame. Then they need to be translated into the scrollbar coord system. */ /* what id to use for the sw child frame */ if (scw->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) { w = scw->swindow.WorkWindow; if (!w) w = sw ; /* fallback */ } else w = (Widget) scw->swindow.ClipWindow; /* The first rectangle is the one that makes the scrollbar goes left */ (*hrect)[0].x = 0 - scw->swindow.hScrollBar->core.x ; (*hrect)[0].y = w->core.y - scw->swindow.hScrollBar->core.y ; (*hrect)[0].width = MAX(2, w->core.x) ; (*hrect)[0].height = w->core.height ; /* The second rectangle is the one that makes the scrollbar goes right */ (*hrect)[1].x = w->core.x + w->core.width - scw->swindow.hScrollBar->core.x ; (*hrect)[1].y = (*hrect)[0].y ; (*hrect)[1].width = sw->core.width - (*hrect)[1].x ; /* if width too small, set it to 2 *inside* the SW frame */ if ((*hrect)[1].width <= 2) { (*hrect)[1].width = 2 ; (*hrect)[1].x -= 2 ; } (*hrect)[1].height = (*hrect)[0].height ; } static void GetVertRects( Widget sw, XRectangle ** vrect, Cardinal * num_vrect) { Widget w ; XmScrolledWindowWidget scw = (XmScrolledWindowWidget) sw ; *num_vrect = 2 ; *vrect = (XRectangle *) XtMalloc(sizeof(XRectangle) * (*num_vrect)) ; /* The vertical rectangles are the ones that vertically auto scroll, they are defined by areas on the top and bottom of the workarea, e.g. the margins, the spacing, the scrollbars and the shadows */ /* Both rects are computed using only the relative work_area or clipwindow (in AUTO) location within the scrolled window: this is the area between the widget and its parent frame. Then they need to be translated into the scrollbar coord system. */ /* what id to use for the sw child frame */ if (scw->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) { w = scw->swindow.WorkWindow; if (!w) w = sw ; /* fallback */ } else w = (Widget) scw->swindow.ClipWindow; /* The first rectangle is the one that makes the scrollbar goes up */ (*vrect)[0].x = w->core.x - scw->swindow.vScrollBar->core.x ; (*vrect)[0].y = 0 - scw->swindow.vScrollBar->core.y ; (*vrect)[0].width = w->core.width ; (*vrect)[0].height = MAX(2, w->core.y) ; /* The second rectangle is the one that makes the scrollbar goes down */ (*vrect)[1].x = (*vrect)[0].x ; (*vrect)[1].y = w->core.y + w->core.height - scw->swindow.vScrollBar->core.y ; (*vrect)[1].width = (*vrect)[0].width ; (*vrect)[1].height = sw->core.height - (*vrect)[1].y ; /* if height too small, set it to 2 *inside* the SW frame */ if ((*vrect)[1].height <= 2) { (*vrect)[1].height = 2 ; (*vrect)[1].y -= 2 ; } } /************************************************************************ * * * UpdateAutoDrag * * update the dropsite size or create them the first time * * * ************************************************************************/ static void UpdateAutoDrag( XmScrolledWindowWidget sw) { Widget hsb = (Widget) sw->swindow.hScrollBar, vsb = (Widget) sw->swindow.vScrollBar; Arg args[10] ; Cardinal n ; XRectangle *hrect, *vrect; Cardinal num_hrect, num_vrect ; AutoDragRects rects = (AutoDragRects) sw -> swindow.auto_drag_rects; /* Entering here we know we have valid dropsites, we now update their size */ /* Each drop site is associated with a scrollbar, it has 2 rectangles corresponding to the areas (on both side of the workarea) that autoscrolls this scrollbar */ if (hsb) { /* Get the 2 horizontal rectangles defining the drop site for horizontal autoscroll using a class method, so that subclasses can override them */ XmScrolledWindowClassExt *wcePtr; WidgetClass wc = XtClass((Widget) sw); wcePtr = _XmGetScrolledWindowClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->get_hor_rects) { (*((*wcePtr)->get_hor_rects)) ((Widget) sw, &hrect, &num_hrect) ; } else { /* no extension found or an extension with NULL proc, so use the standard one */ GetHorRects ((Widget) sw, &hrect, &num_hrect) ; } n = 0 ; XtSetArg(args[n], XmNdropRectangles, hrect); n++ ; XtSetArg(args[n], XmNnumDropRectangles, num_hrect); n++ ; XmDropSiteUpdate(hsb, args, n); /* Assign drop data in auto_drag_rects */ rects -> left = hrect[0]; #ifdef AUTODRAG_DEBUG printf("hrect %d %d %d %d / %d %d %d %d \n", hrect[0].x, hrect[0].y, hrect[0].width, hrect[0].height, hrect[1].x, hrect[1].y, hrect[1].width, hrect[1].height); #endif XtFree((char *)hrect); } if (vsb) { /* Get the 2 vertical rectangles defining the drop site for vertical autoscroll using a class method, so that subclasses can override them */ XmScrolledWindowClassExt *wcePtr; WidgetClass wc = XtClass((Widget) sw); wcePtr = _XmGetScrolledWindowClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->get_vert_rects) { (*((*wcePtr)->get_vert_rects)) ((Widget) sw, &vrect, &num_vrect) ; } else { /* no extension found or an extension with NULL proc, so use the standard one */ GetVertRects ((Widget) sw, &vrect, &num_vrect) ; } n = 0 ; XtSetArg(args[n], XmNdropRectangles, vrect); n++ ; XtSetArg(args[n], XmNnumDropRectangles, num_vrect); n++ ; XmDropSiteUpdate(vsb, args, n); /* Assign drop data in auto_drag_rects */ rects -> up = vrect[0]; #ifdef AUTODRAG_DEBUG printf("vrect %d %d %d %d / %d %d %d %d \n", vrect[0].x, vrect[0].y, vrect[0].width, vrect[0].height, vrect[1].x, vrect[1].y, vrect[1].width, vrect[1].height); #endif XtFree((char *)vrect); } } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget wid ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; if (sw->swindow.scroll_frame_inited) { if (sw->swindow.scroll_frame_data->nav_list) XtFree((char*)sw->swindow.scroll_frame_data->nav_list); XtFree((char*)sw->swindow.scroll_frame_data); } if (sw->swindow.auto_drag_rects) XtFree((char*) sw->swindow.auto_drag_rects); } /************************************************************************ * * * Resize * * Recompute the size of the scrolled window. * * Also update the auto Drag drop site rectangles * * This function also clears the window and reexpose, so SetValues * * doesn't have to return True if it is going to resize. * * * ************************************************************************/ static void Resize( Widget wid ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; if (sw->swindow.VisualPolicy == XmVARIABLE) VariableLayout(sw); else ConstantLayout(sw); /* very expensive, redo that asap */ if (XtIsRealized (wid)) { XClearArea(XtDisplay(wid), XtWindow(wid), 0, 0, XtWidth(wid),XtHeight(wid), True); } if (sw->swindow.auto_drag_model == XmAUTO_DRAG_ENABLED) { UpdateAutoDrag(sw); } } /************************************************************************ * * * GetVariableSize - Figure out the size of the scrolledwindow based * * on the current scrollbar + workwindow sizes. * * non zero value for passed argument mean don't touch * * * ************************************************************************/ static void GetVariableSize( XmScrolledWindowWidget sw, Dimension *pwidth, Dimension *pheight) { XmScrollBarWidget hsb = sw->swindow.hScrollBar, vsb = sw->swindow.vScrollBar; Widget w = sw->swindow.WorkWindow; Dimension hsheight,vswidth; Dimension hsbht = 0, vsbht = 0, shads = sw->manager.shadow_thickness * 2; if (ExistManaged(w)) { if (ExistManaged((Widget) vsb)) { vsbht = 2 * vsb->primitive.highlight_thickness; vswidth = vsb->core.width + sw->swindow.pad + vsbht; } else vswidth = 0; if (ExistManaged((Widget) hsb)) { hsbht = 2 * hsb->primitive.highlight_thickness; hsheight = hsb->core.height + sw->swindow.pad + hsbht; } else hsheight = 0; if (!*pwidth) *pwidth = w->core.width + (2 * w->core.border_width) + vswidth + shads + hsbht + sw->swindow.XOffset + sw->swindow.WidthPad; if (!*pheight) *pheight = w->core.height + (2*w->core.border_width) + hsheight + shads + vsbht + sw->swindow.YOffset + sw->swindow.HeightPad; } else { if (!*pwidth) *pwidth = sw->core.width; if (!*pheight) *pheight = sw->core.height; } /* might still be null */ if (!*pwidth) *pwidth = DEFAULT_SIZE ; if (!*pheight) *pheight = DEFAULT_SIZE ; } /************************************************************************ * * * GeometryManager * * * ************************************************************************/ static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget ) w->core.parent; XmScrollBarWidget hsb, vsb; XtGeometryResult retval = XtGeometryNo; Dimension newWidth,newHeight; Dimension hsheight,vswidth; Dimension hsbht, vsbht, bw, ht; XtWidgetGeometry parent_request ; XmScrolledWindowConstraint swc = GetSWConstraint(w); CheckKids(sw); hsbht = vsbht = 0; reply->request_mode = 0; ht = sw->manager.shadow_thickness * 2; hsb = sw->swindow.hScrollBar; vsb = sw->swindow.vScrollBar; /**************** * * Check the generic child: allow any position and size. * Application is responsible for proper geometry related to * scrollbars, clipwindow, etc. Application knows the layout * rules with margins, spacing, etc. * App also need to track the resize because generic children are * just ignored byt he SW. * Scrollbar requests that move or resize the sb in their allocated * area are treated as always yes, it's the appli responsabily * to not screw up the layout. * this doesn't handle multiple requests: both width and height for instance. ****************/ if ((swc->child_type == XmGENERIC_CHILD) || ((w == (Widget) vsb) && (request->request_mode & CWY)) || ((w == (Widget) vsb) && (request->request_mode & CWHeight)) || ((w == (Widget) hsb) && (request->request_mode & CWX)) || ((w == (Widget) hsb) && (request->request_mode & CWWidth))) { if (!IsQueryOnly(request)) { if (IsX(request)) w->core.x = request->x; if (IsY(request)) w->core.y = request->y; if (IsWidth(request)) w->core.width = request->width; if (IsHeight(request)) w->core.height = request->height; if (IsBorder(request)) w->core.border_width = request->border_width; } return XtGeometryYes; } /**************** * * Carry forward that ugly wart for scrolled primitives... * ****************/ if (ExistManaged((Widget) vsb)) { vsbht = 2 * vsb->primitive.highlight_thickness; if (ExistManaged(sw->swindow.WorkWindow) && XmIsPrimitive(sw->swindow.WorkWindow) && !(XmIsTraversable((Widget)sw->swindow.vScrollBar))) vsbht = 0; vswidth = vsb->core.width + sw->swindow.pad + vsbht; } else vswidth = 0; if (ExistManaged((Widget) hsb)) { hsbht = 2 * hsb->primitive.highlight_thickness; if (ExistManaged(sw->swindow.WorkWindow) && XmIsPrimitive(sw->swindow.WorkWindow) && !(XmIsTraversable((Widget)sw->swindow.hScrollBar))) hsbht = 0; hsheight = hsb->core.height + sw->swindow.pad + hsbht; } else hsheight = 0; /**************** * * Scrollbars ****************/ /* we've allowed the other case before, deny this one */ if ((w == (Widget) vsb) && (request->request_mode & CWX)) return( XtGeometryNo); if ((w == (Widget) hsb) && (request->request_mode & CWY)) return(XtGeometryNo); /* always deny borderwidth changes, too much work for nothing */ if (((w == (Widget) hsb) || (w == (Widget) vsb)) && (request->request_mode & CWBorderWidth)) return(XtGeometryNo); /* border apply to both dimensions */ if (((w == (Widget) hsb) && ((Dimension)w->core.y < sw->core.height)) || ((w == (Widget) vsb) && ((Dimension)w->core.x < sw->core.width))) { /* Visible scrollbar request */ /* we already eliminated the bad case */ if(request->request_mode & CWWidth) newWidth = sw->core.width - w->core.width + request->width; else newWidth = sw->core.width ; if(request->request_mode & CWHeight) newHeight = sw->core.height - w->core.height + request->height; else newHeight = sw->core.height ; parent_request.request_mode = CWWidth | CWHeight; parent_request.width = newWidth ; parent_request.height = newHeight ; /* Stop here in the QueryOnly case */ if (request->request_mode & XtCWQueryOnly) { parent_request.request_mode |= XtCWQueryOnly; return XtMakeGeometryRequest((Widget) sw, &parent_request, NULL); } /* else it's for real */ retval = _XmMakeGeometryRequest((Widget) sw, &parent_request); if (retval == XtGeometryYes) { XtWidgetProc resize; /* update the child geometry fields */ if (request->request_mode & CWBorderWidth) w->core.border_width = request->border_width; if (request->request_mode & CWWidth) w->core.width = request->width; if (request->request_mode & CWHeight) w->core.height = request->height; /* relayout moi - maybe need an instigator param here? */ _XmProcessLock(); resize = XtCoreProc(sw, resize); _XmProcessUnlock(); (*resize) ((Widget) sw) ; } return(retval); } else if ((w == (Widget) hsb) || (w == (Widget) vsb)) { /* Invisible scrollbar ok request */ if (!(request->request_mode & XtCWQueryOnly)) { if (request->request_mode & CWBorderWidth) w->core.border_width = request->border_width; if (request->request_mode & CWWidth) w->core.width = request->width; if (request->request_mode & CWHeight) w->core.height = request->height; if (request->request_mode & CWX) w->core.x = request->x; if (request->request_mode & CWY) w->core.y = request->y; } return XtGeometryYes; } /********************** * ELSE IT COMES FROM THE WORKWINDOW **********************/ /* APPLICATION_DEFINED: try to grow the SW */ if (sw->swindow.VisualPolicy == XmVARIABLE) { if (request->request_mode & CWBorderWidth) bw = (request->border_width * 2); else bw = (w->core.border_width * 2); if(request->request_mode & CWWidth) newWidth = request->width + vswidth + ht + bw + hsbht + sw->swindow.XOffset + sw->swindow.WidthPad ; else newWidth = w->core.width + vswidth + ht + bw + hsbht + sw->swindow.XOffset + sw->swindow.WidthPad ; if(request->request_mode & CWHeight) newHeight = request->height + hsheight + ht + bw + vsbht + sw->swindow.YOffset + sw->swindow.HeightPad ; else newHeight = w->core.height + hsheight + ht + bw + vsbht + sw->swindow.YOffset + sw->swindow.HeightPad; parent_request.request_mode = CWWidth | CWHeight; parent_request.width = newWidth ; parent_request.height = newHeight ; /* Stop here in the QueryOnly case */ if (request->request_mode & XtCWQueryOnly) { parent_request.request_mode |= XtCWQueryOnly; return XtMakeGeometryRequest((Widget) sw, &parent_request, NULL); } /* else it's for real */ retval = _XmMakeGeometryRequest((Widget) sw, &parent_request); #ifdef FIX_1474 if (retval == XtGeometryNo && !(request->request_mode & CWWidth)) { parent_request.request_mode = CWHeight; retval = _XmMakeGeometryRequest((Widget) sw, &parent_request); } #endif if (retval == XtGeometryYes) { XtWidgetProc resize; /* update the child geometry fields */ if (request->request_mode & CWBorderWidth) w->core.border_width = request->border_width; if (request->request_mode & CWWidth) w->core.width = request->width; if (request->request_mode & CWHeight) w->core.height = request->height; /* relayout moi - maybe need an instigator param here ? */ if (!XmIsMainWindow(sw)) { _XmProcessLock(); resize = XtCoreProc(sw, resize); _XmProcessUnlock(); (*resize) ((Widget) sw); } } return(retval); } /* AUTOMATIC doesn't go thru here anymore, but use a trait */ return XtGeometryNo; } /************************************************************************ * * UpdateOrigGeom trait method * *************************************<->***********************************/ static void UpdateOrigGeom(Widget sf, Widget child, XtWidgetGeometry *geom) { _XmSWNotifyGeoChange(sf, child, geom); } /************************************************************************ * * * _XmSWNotifyGeoChange * * Used by the ClipWindow geometry manager. * * could spare a trait method here, but that would add to the * * scrollFrame set, which has enough. * * * ************************************************************************/ void _XmSWNotifyGeoChange( Widget sw, Widget child, XtWidgetGeometry *request) { /* called from ClipW GM and ChangeManage */ XtWidgetProc resize; if (child) { XmScrolledWindowConstraint swc = GetSWConstraint(child); /* child is the ClipWindow child */ /* reset original/set child position */ if (request->request_mode & CWX) { swc->orig_x = request->x ; } if (request->request_mode & CWY) { swc->orig_y = request->y ; } } /* Just call Layout, which does all the scrollbars management */ if (XtIsRealized(sw)) { _XmProcessLock(); resize = XtCoreProc(sw, resize); _XmProcessUnlock(); (*resize)(sw) ; } } /************************************************************************ * * * ChangeManaged - called whenever there is a change in the managed * * set. * * * ************************************************************************/ static void ChangeManaged( Widget wid ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; XtWidgetGeometry desired ; XtWidgetProc resize; if (sw->swindow.FromResize) return; CheckKids(sw); if (sw->swindow.VisualPolicy == XmVARIABLE) { /* the first time, only attemps to change non specified sizes */ if (!XtIsRealized(wid)) { desired.width = XtWidth(wid) ; /* might be 0 */ desired.height = XtHeight(wid) ; /* might be 0 */ } else { desired.width = 0 ; desired.height = 0 ; } #ifdef FIX_1474 GetVariableSize(sw, &desired.width, &desired.height); desired.request_mode = CWWidth; (void) _XmMakeGeometryRequest(wid, &desired); desired.request_mode = CWHeight; (void) _XmMakeGeometryRequest(wid, &desired); #else GetVariableSize(sw, &desired.width, &desired.height); desired.request_mode = (CWWidth | CWHeight); (void) _XmMakeGeometryRequest(wid, &desired); #endif } _XmProcessLock(); resize = XtCoreProc(sw, resize); _XmProcessUnlock(); (*resize) (wid) ; XmeNavigChangeManaged(wid); } /************************************************************************ * * * QueryGeometry - Query proc for the scrolled window. * * * * This routine will examine the geometry passed in an recalculate our * * width/height as follows: if either the width or height is set, we * * take that as our new size, and figure out the other dimension to be * * the minimum size we need to be to display the entire child. Note * * that this will only happen in auto mode, with as_needed display * * policy. * * * ************************************************************************/ static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *ret ) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) wid ; Dimension MyWidth, MyHeight, KidHeight, KidWidth; Widget w; XmScrollBarWidget hsb, vsb; Dimension hsheight,vswidth; Dimension hsbht, vsbht, ht; XtWidgetGeometry desired, preferred; XtGeometryResult retval = XtGeometryYes; ret -> request_mode = 0; w = sw->swindow.WorkWindow; hsb = sw->swindow.hScrollBar; vsb = sw->swindow.vScrollBar; /**************** * * If the request mode is zero, fill out out default height & width. * ****************/ if (request->request_mode == 0) { if ((sw->swindow.VisualPolicy == XmCONSTANT) || (!sw->swindow.WorkWindow)) { ret->width = sw->core.width; ret->height = sw->core.height; ret->request_mode = (CWWidth | CWHeight); return (XtGeometryAlmost); } hsbht = vsbht = 0; ht = sw->manager.shadow_thickness * 2; desired.request_mode = 0; XtQueryGeometry(sw->swindow.WorkWindow, &desired, &preferred); KidWidth = preferred.width; KidHeight = preferred.height; if (ExistManaged((Widget) vsb)) { vsbht = 2 * vsb->primitive.highlight_thickness; vswidth = vsb->core.width + sw->swindow.pad + vsbht; } else vswidth = 0; if (ExistManaged((Widget) hsb)) { hsbht = 2 * hsb->primitive.highlight_thickness; hsheight = hsb->core.height + sw->swindow.pad + hsbht; } else hsheight = 0; if (ExistManaged(w)) { ret->width = KidWidth + (2 * w->core.border_width) + vswidth + ht + hsbht + sw->swindow.XOffset + sw->swindow.WidthPad; ret->height = KidHeight + (2 * w->core.border_width) + hsheight + ht + vsbht + sw->swindow.YOffset + sw->swindow.HeightPad; } else { ret->width = sw->core.width; ret->height = sw->core.height; } ret->request_mode = (CWWidth | CWHeight); return (XtGeometryAlmost); } /**************** * * If app mode, or static scrollbars, or no visible kid, * accept the new size, and return our current size for any * missing dimension. * ****************/ if ((sw->swindow.ScrollPolicy == XmAPPLICATION_DEFINED) || (!ExistManaged(w))) { if (!(request -> request_mode & CWWidth)) { ret->request_mode |= CWWidth; ret->width = sw->core.width; retval = XtGeometryAlmost; } if (!(request -> request_mode & CWHeight)) { ret->request_mode |= CWHeight; ret->height = sw->core.height; retval = XtGeometryAlmost; } return(retval); } /**************** * * Else look for the specified dimension, and set the other size so that we * just enclose the child. * If the new size would cause us to lose the scrollbar, figure * out the other dimension as well and return that, too. * ****************/ hsbht = vsbht = 0; ht = sw->manager.shadow_thickness * 2; hsb = sw->swindow.hScrollBar; vsb = sw->swindow.vScrollBar; if ((request -> request_mode & CWWidth) && (request -> request_mode & CWHeight)&& (sw->swindow.ScrollBarPolicy == XmAS_NEEDED)) { ret->height = w->core.height + (2 * w->core.border_width) + ht + sw->swindow.YOffset + sw->swindow.HeightPad; ret->width = w->core.width + (2 * w->core.border_width) + ht + sw->swindow.XOffset + sw->swindow.WidthPad; ret->request_mode |= (CWWidth | CWHeight); return(XtGeometryAlmost); } if (request -> request_mode & CWHeight) { MyHeight = request->height - sw->swindow.YOffset - sw->swindow.HeightPad - ht; if (((w->core.height + (2 * w->core.border_width)) > MyHeight) || (sw->swindow.ScrollBarPolicy == XmSTATIC)) { vsbht = 2 * vsb->primitive.highlight_thickness; vswidth = vsb->core.width + sw->swindow.pad; } else { vswidth = 0; ret->request_mode |= CWHeight; ret->height = w->core.height + (2 * w->core.border_width) + ht + sw->swindow.YOffset + sw->swindow.HeightPad; } ret->request_mode |= CWWidth; ret->width = w->core.width + (2 * w->core.border_width) + vswidth + ht + vsbht + sw->swindow.XOffset + sw->swindow.WidthPad; retval = XtGeometryAlmost; } if (request -> request_mode & CWWidth) { MyWidth = request->width - sw->swindow.XOffset - sw->swindow.WidthPad - ht; if (((w->core.width + (2 * w->core.border_width)) > MyWidth) || (sw->swindow.ScrollBarPolicy == XmSTATIC)) { hsbht = 2 * hsb->primitive.highlight_thickness; hsheight = hsb->core.height + sw->swindow.pad; } else { hsheight = 0; ret->request_mode |= CWWidth; ret->width = w->core.width + (2 * w->core.border_width) + ht + sw->swindow.XOffset + sw->swindow.WidthPad; } ret->request_mode |= CWHeight; ret->height = w->core.height + (2 * w->core.border_width) + hsheight + ht + hsbht + sw->swindow.YOffset + sw->swindow.HeightPad; retval = XtGeometryAlmost; } return(retval); } /************************************************************************ * * * SetValues * * * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmScrolledWindowWidget current = (XmScrolledWindowWidget) cw ; XmScrolledWindowWidget request = (XmScrolledWindowWidget) rw ; XmScrolledWindowWidget new_w = (XmScrolledWindowWidget) nw ; Boolean Flag = FALSE; /******************* * check validity first *******************/ CheckKids(new_w); if(!XmRepTypeValidValue( XmRID_SCROLL_BAR_DISPLAY_POLICY, new_w->swindow.ScrollBarPolicy, (Widget) new_w)) { new_w->swindow.ScrollBarPolicy = current->swindow.ScrollBarPolicy; } if (request->swindow.ScrollPolicy != current->swindow.ScrollPolicy) { XmeWarning( (Widget) new_w, SWMessage6); new_w->swindow.ScrollPolicy = current->swindow.ScrollPolicy; } if (request->swindow.VisualPolicy != current->swindow.VisualPolicy) { XmeWarning( (Widget) new_w, SWMessage7); new_w->swindow.VisualPolicy = current->swindow.VisualPolicy; } if ((new_w->swindow.VisualPolicy == XmVARIABLE) && (request->swindow.ScrollBarPolicy == XmAS_NEEDED)) { XmeWarning( (Widget) new_w, SWMessage8); new_w->swindow.ScrollBarPolicy = XmSTATIC; } if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) { if (new_w->swindow.hScrollBar != current->swindow.hScrollBar) { XmeWarning( (Widget) new_w, SWMessage9); new_w->swindow.hScrollBar = current->swindow.hScrollBar; } if (new_w->swindow.vScrollBar != current->swindow.vScrollBar) { XmeWarning( (Widget) new_w, SWMessage9); new_w->swindow.vScrollBar = current->swindow.vScrollBar; } } if (new_w->swindow.ClipWindow != current->swindow.ClipWindow) { XmeWarning( (Widget) new_w, SWMessage10); new_w->swindow.ClipWindow = current->swindow.ClipWindow; } if(!XmRepTypeValidValue( XmRID_SCROLL_BAR_PLACEMENT, new_w->swindow.Placement, (Widget) new_w)) { new_w->swindow.Placement = current->swindow.Placement; } /* In AUTOMATIC, we explicitly forbid changing the workArea, because the clipWindow reparenting can't be undone or done at this point. The only way to swicth between workArea is to destroy the current one, which would set it to NULL internally, and recreate it so that InsertChild takes it if (new_w->swindow.ScrollPolicy == XmAUTOMATIC) { if (new_w->swindow.WorkWindow != current->swindow.WorkWindow) { XmeWarning((Widget) new_w, SWMessage2); new_w->swindow.WorkWindow = current->swindow.WorkWindow; } }*/ /******************* * then check if there needs to be a relayout of the internals * Here we choose not to grow or shrink the SW if one of those * change, we just relayout everything in the current boundaries. ********************/ if ((new_w->swindow.WidthPad != current->swindow.WidthPad) || (new_w->swindow.HeightPad != current->swindow.HeightPad) || (new_w->manager.shadow_thickness!=current->manager.shadow_thickness)|| (new_w->swindow.pad != current->swindow.pad) || (new_w->swindow.Placement != current->swindow.Placement) || (new_w->swindow.ScrollBarPolicy != current->swindow.ScrollBarPolicy)) { XtWidgetProc resize; new_w->swindow.XOffset = new_w->swindow.WidthPad; new_w->swindow.YOffset = new_w->swindow.HeightPad; /* relayout moi, resize will rexpose as well */ _XmProcessLock(); resize = XtCoreProc(new_w, resize); _XmProcessUnlock(); (*resize)(nw) ; } /* the following can only happen in APP_DEFINED mode */ if ((new_w->swindow.hScrollBar != current->swindow.hScrollBar)|| (new_w->swindow.vScrollBar != current->swindow.vScrollBar)|| (new_w->swindow.WorkWindow != current->swindow.WorkWindow)) { /* set our core geometry to the needed size - no resizePolicy here... See comment in MainW.c for this realized check */ if (XtIsRealized((Widget)new_w)) { new_w->core.width = 0 ; new_w->core.height = 0 ; GetVariableSize(new_w, &new_w->core.width, &new_w->core.height); } } if (new_w->swindow.auto_drag_model != current->swindow.auto_drag_model) { if (new_w->swindow.auto_drag_model == XmAUTO_DRAG_ENABLED) { Arg s_args[5]; Cardinal n ; /* moving from disable to enable, allocate the rects the first time thru */ if (new_w->swindow.auto_drag_rects == NULL) new_w->swindow.auto_drag_rects = XtCalloc(1, sizeof(AutoDragRectsRec)); /* reinstall the D&D callback on the potential scrollbars */ n = 0 ; XtSetArg(s_args[n], XmNdropProc, HandleDrop), n++ ; XtSetArg(s_args[n], XmNdragProc, HandleDrag), n++ ; XtSetArg(s_args[n], XmNnumImportTargets, 1), n++ ; XtSetArg(s_args[n], XmNimportTargets, new_w), n++ ; assert(n <= XtNumber(s_args)); if (new_w->swindow.hScrollBar) XmDropSiteRegister((Widget)new_w->swindow.hScrollBar, s_args, n); if (new_w->swindow.vScrollBar) XmDropSiteRegister((Widget)new_w->swindow.vScrollBar, s_args, n); } else { /* moving from enable to disable, unregister the d&d site but leave the drag_rect around */ if (new_w->swindow.hScrollBar) XmDropSiteUnregister((Widget)new_w->swindow.hScrollBar); if (new_w->swindow.vScrollBar) XmDropSiteUnregister((Widget)new_w->swindow.vScrollBar); } } return (Flag); } /************************************************************************ * * Constraint Initialize * *************************************<->***********************************/ /*ARGSUSED*/ static void ConstraintInitialize( Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmScrolledWindowConstraint swc; if (!XtIsRectObj (nw)) return; swc = GetSWConstraint(nw); if ((swc->child_type != (unsigned char) RESOURCE_DEFAULT) && (!XmRepTypeValidValue(XmRID_SCROLLED_WINDOW_CHILD_TYPE, swc->child_type, nw))) { swc->child_type = (unsigned char) RESOURCE_DEFAULT; } /* for all children, get their original position. It actually only matter for clipped children, but quicker this way */ swc->orig_x = nw->core.x ; swc->orig_y = nw->core.y ; } /*************************************** No ConstraintSetValues. Because of the reparenting to the clipwindow, it won't be called in all cases anyway. ClipWindow could get one, and here one as well, with the only benefit to reject wrong childType setting, not worth it IHMO. The tracking od the set position is done in the ClipWindow geometry manager for the clipped kid, which calls the notifygeochange API ***************************************/ /************************************************************************ * * ScrollFrame Init trait method * *************************************<->***********************************/ static void ScrollFrameInit ( Widget sf, XtCallbackProc moveCB, Widget scrollable) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) sf ; if (sw->swindow.scroll_frame_inited) return ; sw->swindow.scroll_frame_inited = True ; sw->swindow.scroll_frame_data = (XmScrollFrameData) XtMalloc(sizeof(XmScrollFrameDataRec)); sw->swindow.scroll_frame_data->num_nav_list = 0 ; sw->swindow.scroll_frame_data->nav_list = NULL ; sw->swindow.scroll_frame_data->num_nav_slots = 0 ; sw->swindow.scroll_frame_data->move_cb = moveCB ; sw->swindow.scroll_frame_data->scrollable = scrollable ; } /************************************************************************ * * GetInfo * scrolledwindow is a 2 dimensional frame. * ************************************************************************/ static Boolean GetInfo( Widget sf, Cardinal * dimension, Widget ** nav_list, Cardinal * num_nav_list) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) sf ; if (dimension) *dimension = 2 ; /* two dimensional frame */ if (sw->swindow.scroll_frame_inited) { if (nav_list) *nav_list = sw->swindow.scroll_frame_data->nav_list ; if (num_nav_list) *num_nav_list = sw->swindow.scroll_frame_data->num_nav_list ; } return sw->swindow.scroll_frame_inited ; } /************************************************************************ * * AddNavigator trait method * *************************************<->***********************************/ static void AddNavigator( Widget sf, Widget nav, Mask dimMask) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) sf ; /* check if already initialized scrollFrame */ if (!sw->swindow.scroll_frame_inited) { XmScrollFrameTrait sf_trait = (XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass(sf), XmQTscrollFrame); /* not inited yet: it's a non ScrolledList/Text APP_DEFINED or AUTOMATIC scrolled window. Initialize now, when the first navigator is added. We cannot give any good move callback to install on the other navigators, so use NULL. In this case, we rely on the navigators to have their own callback prior to be added to the navigator list */ sf_trait->init(sf, (XtCallbackProc) NULL, (Widget) NULL); } /* now scroll_frame_data is always valid */ _XmSFAddNavigator(sf, nav, dimMask, sw->swindow.scroll_frame_data); } /************************************************************************ * * RemoveNavigator trait method * *************************************<->***********************************/ static void RemoveNavigator( Widget sf, Widget nav) { XmScrolledWindowWidget sw = (XmScrolledWindowWidget) sf ; if (sw->swindow.scroll_frame_inited) _XmSFRemoveNavigator(sf, nav, sw->swindow.scroll_frame_data); } /************************************************************************ * * * _XmSWGetClipArea * Used by the Traversal code. * - widget specifies a child of the clipwindow. * - rect returns the area of the clip window (in root window * coordinates) where that child can appear. * - returns True is successful, otherwise False. * (For a clip window with only one work window this will * degenerate to the root bounds of the clip window itself) * ************************************************************************/ Boolean _XmSWGetClipArea(Widget widget, XRectangle *rect) { XmClipWindowWidget clip = (XmClipWindowWidget) XtParent(widget); XmScrolledWindowWidget sw; Cardinal i ; Widget child ; XmScrolledWindowConstraint swc; Position root_x, root_y ; /* reality check */ if (!clip || !XmIsClipWindow(clip)) return False ; sw = (XmScrolledWindowWidget) XtParent(clip); if (!sw) return False ; /* init with the clipwindow frame */ rect->x = 0 ; rect->y = 0 ; rect->width = clip->core.width ; rect->height = clip->core.height ; /* loop thru the clip children, and for each partially scrollable babie, modify the returned rect. This assumes a WORK_AREA (all scrollable) kid is the target, some SCROLL_HOR or VERT sibling are obscuring it, and since we only return ONE rectangle, we special case the header (y=0) or the first column (x=0) child */ for (i = 0; i < clip->composite.num_children; i++) { child = clip->composite.children[i]; if (ExistManaged(child)) { swc = GetSWConstraint(child); if (swc->child_type == XmSCROLL_HOR) { /* this one doesn't move vertically. If its y is 0 takes its height as the new y of our rectangle, if its y is not 0, it becomes our rect height (everything below its y is considered unaccessible) */ if (child->core.y == 0) { rect->y = child->core.height ; rect->height -= child->core.height ; } else rect->height = child->core.y ; } else if (swc->child_type == XmSCROLL_HOR) { /* same thing for x */ if (child->core.x == 0) { rect->x = child->core.width ; rect->width -= child->core.width ; } else rect->width = child->core.x ; } } } /* root coordinates is wanted. (Xt doesn't seem to allow for rect to be passed in and out at the same time) */ XtTranslateCoords((Widget)clip, rect->x, rect->y, &root_x, &root_y); rect->x = root_x ; rect->y = root_y ; return True; } /************************************************************************ * * * Public API Functions * * * ************************************************************************/ /************************************************************************ * * * XmScrolledWindowSetAreas - set a new widget set. * * a NULL means: don't change the parameter * * - deprecated in favor of SetValues, which it uses * ************************************************************************/ void XmScrolledWindowSetAreas( Widget w, Widget hscroll, Widget vscroll, Widget wregion ) { Arg args[5] ; Cardinal n; n = 0; if (hscroll) { XtSetArg (args[n], XmNhorizontalScrollBar, hscroll); n++; } if (vscroll) { XtSetArg (args[n], XmNverticalScrollBar, vscroll); n++; } if (wregion) { XtSetArg (args[n], XmNworkWindow, wregion); n++; } XtSetValues(w, args, n); } /************************************************************************ * * * XmCreateScrolledWindow - hokey interface to XtCreateWidget. * * * ************************************************************************/ Widget XmCreateScrolledWindow( Widget parent, char *name, ArgList args, Cardinal argCount ) { return (XtCreateWidget(name, xmScrolledWindowWidgetClass, parent, args, argCount )); } Widget XmVaCreateScrolledWindow( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmScrolledWindowWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedScrolledWindow( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmScrolledWindowWidgetClass, parent, True, var, count); va_end(var); return w; } /*************************************************************************** DESIGN NOTES: InsertChild takes care of setting the internal scrollbar or workarea fields to the last inserted child. The previous kid might still be hanging around in the managed child list if the application hasn't done something about it. In the regular case, one creates a SW, add kids and everything is fine. (and SetAreas or SetValues is a NoOp). If the appli creates another kid as the workarea for instance (same problem for another scrollbar in APP_DEFINED), it becomes the current workarea and it is on top by default - no problem. Now if the application switches the 2 workareas and reset the first one as the current workarea using XtSetValues, who is responsible for raising it on top (or lowering, or unmapping - the other) ? I'd say SetValues deals with that situation using RaiseWidget. When a child is deleted, if it is a current resource, the internal field is NULLed, otherwise, it is just deleted from the child list. (ChangeManaged is called for the relayout). ***************************************************************************/ motif-2.3.8/lib/Xm/XmStrDefs23.h0000644000175000017500000000547113211513004013107 00000000000000/* $TOG: XmStrDefs23.ht /main/2 1997/06/18 17:50:15 samborn $ */ #ifndef _XmStrDefs23_h_ #define _XmStrDefs23_h_ #include #ifndef _XmConst #define _XmConst /**/ #endif #ifdef __cplusplus extern "C" { #endif /* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */ /* This file is automatically generated. */ /* Default ABI version -- Do not edit */ /* TOG: xmstring.list /main/5 1997/06/20 08:37:02 samborn */ #ifdef XMSTRINGDEFINES #define XmNdefaultEntryLabelRenderTable "defaultEntryLabelRenderTable" #define XmNentryLabelRenderTable "entryLabelRenderTable" #define XmNpixmapPlacement "pixmapPlacement" #define XmCPixmapPlacement "PixmapPlacement" #define XmRPixmapPlacement "PixmapPlacement" #define XmNpixmapTextPadding "pixmapTextPadding" #define XmNfontStyle "fontStyle" #define XmCFontStyle "FontStyle" #define XmNfontSize "fontSize" #define XmCFontSize "FontSize" #define XmNfontFoundry "fontFoundry" #define XmCFontFoundry "FontFoundry" #define XmNfontEncoding "fontEncoding" #define XmCFontEncoding "FontEncoding" #define XmNxftFont "xftFont" #define XmCXftFont "XftFont" #define XmSUTF8_STRING "UTF8_STRING" #else externalref _XmConst char _XmStrings23[]; #ifndef XmNdefaultEntryLabelRenderTable #define XmNdefaultEntryLabelRenderTable ((char*)&_XmStrings23[0]) #endif #ifndef XmNentryLabelRenderTable #define XmNentryLabelRenderTable ((char*)&_XmStrings23[29]) #endif #ifndef XmNpixmapPlacement #define XmNpixmapPlacement ((char*)&_XmStrings23[51]) #endif #ifndef XmCPixmapPlacement #define XmCPixmapPlacement ((char*)&_XmStrings23[67]) #endif #ifndef XmRPixmapPlacement #define XmRPixmapPlacement ((char*)&_XmStrings23[83]) #endif #ifndef XmNpixmapTextPadding #define XmNpixmapTextPadding ((char*)&_XmStrings23[99]) #endif #ifndef XmNfontStyle #define XmNfontStyle ((char*)&_XmStrings23[117]) #endif #ifndef XmCFontStyle #define XmCFontStyle ((char*)&_XmStrings23[127]) #endif #ifndef XmNfontSize #define XmNfontSize ((char*)&_XmStrings23[137]) #endif #ifndef XmCFontSize #define XmCFontSize ((char*)&_XmStrings23[146]) #endif #ifndef XmNfontFoundry #define XmNfontFoundry ((char*)&_XmStrings23[155]) #endif #ifndef XmCFontFoundry #define XmCFontFoundry ((char*)&_XmStrings23[167]) #endif #ifndef XmNfontEncoding #define XmNfontEncoding ((char*)&_XmStrings23[179]) #endif #ifndef XmCFontEncoding #define XmCFontEncoding ((char*)&_XmStrings23[192]) #endif #ifndef XmNxftFont #define XmNxftFont ((char*)&_XmStrings23[205]) #endif #ifndef XmCXftFont #define XmCXftFont ((char*)&_XmStrings23[213]) #endif #ifndef XmSUTF8_STRING #define XmSUTF8_STRING ((char*)&_XmStrings23[221]) #endif #endif /* XMSTRINGDEFINES */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif #endif /* _XmStrDefs23_h_ */ motif-2.3.8/lib/Xm/TabList.c0000644000175000017500000006166312672140200012431 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #include #include #include typedef struct _XmTabbedStackListRec { int allocated; int used; XmTabAttributes tabs; } XmTabbedStackListRec; #define XmLIST_GROWTH_FACTOR 10 #define XiXmStringCopy(s) (((s) == (XmString)NULL) ? NULL : XmStringCopy(s)) #define XiXmStringCompare(s1,s2) (((s1) == (s2)) ? True \ : ((s1) != NULL && (s2) != NULL) \ ? XmStringCompare(s1,s2) : False) #define XiXmStringFree(s) if((s)!=(XmString)NULL)XmStringFree(s);else(s)=NULL /* * Function: * TabListCreate(void) * Description: * Allocates and initializes an empty XmTabbedStackList structure and returns * a pointer to the structure. * Input: * None. * Output: * XmTabbedStackList - an empty allocated XiTablist */ XmTabbedStackList #ifndef _NO_PROTO XmTabbedStackListCreate(void) #else XmTabbedStackListCreate() #endif { XmTabbedStackList tabList; /* * Allocate the structure and zero it. Then give it back to the * caller. */ tabList = (XmTabbedStackList) XtMalloc(sizeof(XmTabbedStackListRec)); tabList->allocated = tabList->used = 0; tabList->tabs = (XmTabAttributes) NULL; return( tabList ); } /* * Function: * XmTabbedStackListCopy(tab_list) * Description: * This makes a copy of the given XmTabbedStackList and returns the * copy. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to copy * Output: * XmTabbedStackList - the copy of the given list */ XmTabbedStackList #ifndef _NO_PROTO XmTabbedStackListCopy(XmTabbedStackList tab_list) #else XmTabbedStackListCopy(tab_list) XmTabbedStackList tab_list; #endif { XmTabbedStackList newList; int i; /* * First if they gave us nothing, then lets return nothing to * them. */ if( tab_list == NULL ) return( NULL ); /* * Now allocate the new structure and set its allocated and used * to the number of items we need. */ newList = (XmTabbedStackList) XtMalloc(sizeof(XmTabbedStackListRec)); newList->allocated = newList->used = tab_list->used; /* * Now check if we have any items and if not just zero the * data, else we will have to copy item by item. */ if( newList->used == 0 ) { newList->tabs = (XmTabAttributes) NULL; } else { /* * First allocate the memory for all the entries. and then copy * item by item the list. */ newList->tabs = (XmTabAttributes) XtMalloc(sizeof(XmTabAttributeRec) * newList->used); for( i = 0; i < newList->used; ++i ) { newList->tabs[i].label_string = XiXmStringCopy(tab_list->tabs[i].label_string); newList->tabs[i].label_pixmap = tab_list->tabs[i].label_pixmap; newList->tabs[i].string_direction = tab_list->tabs[i].string_direction; newList->tabs[i].pixmap_placement = tab_list->tabs[i].pixmap_placement; newList->tabs[i].label_alignment = tab_list->tabs[i].label_alignment; newList->tabs[i].foreground = tab_list->tabs[i].foreground; newList->tabs[i].background = tab_list->tabs[i].background; newList->tabs[i].background_pixmap = tab_list->tabs[i].background_pixmap; newList->tabs[i].sensitive = tab_list->tabs[i].sensitive; newList->tabs[i].value_mode = XmTAB_VALUE_COPY; } } return( newList ); } /* * Function: * XmTabbedStackListFree(tab_list) * Description: * Deallocates the memory associated with the given tab list. * Input: * tab_list : XiTablist - the XmTabbedStackList to deallocate * Output: * None. */ void #ifndef _NO_PROTO XmTabbedStackListFree(XmTabbedStackList tab_list) #else XmTabbedStackListFree(tab_list) XmTabbedStackList tab_list; #endif { int i; /* * If we do not have anything to deallocate the lets just * get out of here. */ if( tab_list == NULL ) return; /* * If we have used items then lets walk through the list and * deallocate anything we have to. */ if( tab_list->used != 0 ) { for( i = 0; i < tab_list->used; ++i ) { if( tab_list->tabs[i].value_mode == XmTAB_VALUE_SHARE ) continue; XiXmStringFree(tab_list->tabs[i].label_string); } } /* * If we have any allocated slots lets deallocate them and finally * deallocate the parent structure. */ if( tab_list->allocated != 0 ) { XtFree((XtPointer) tab_list->tabs); } XtFree((XtPointer) tab_list); } /* * Function: * XmTabbedStackListRemove(tab_list, position) * Description: * Remove and deallocate the tab at the specified position in * the list. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to work with * position : int - the position of the tab to remove * Output: * None. */ void #ifndef _NO_PROTO XmTabbedStackListRemove(XmTabbedStackList tab_list, int position) #else XmTabbedStackListRemove(tab_list, position) XmTabbedStackList tab_list; int position; #endif { XmTabAttributes to, from; int count; if( tab_list == NULL || position < 0 || (position > 0 && position >= tab_list->used) ) { return; } to = &(tab_list->tabs[position]); /* * Now deallocate the data associated with this tab, if needed. */ if( to->value_mode == XmTAB_VALUE_COPY ) { XmStringFree(to->label_string); } /* * Now decrement the number of used slots and shift down any slots * above the one that is being deleted. */ tab_list->used--; if( position != tab_list->used ) { from = &(tab_list->tabs[position+1]); count = tab_list->used - position; memmove((XtPointer) to, (XtPointer) from, sizeof(XmTabAttributeRec) * count); } } /* * Function: * XmTabbedStackListInsert(tab_list, position, mask, attributes) * Description: * Adds a tab with the specified attributes to the given * XmTabbedStackList. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to add the new tab to * position : int - the position to place the new tab at * mask : XtValueMask - the mask of attributes to set on the * new tab * attributes : XmTabAttributes - the list of attributes to set on the * new tab * Output: * int - the position of the new tab in the list */ int #ifndef _NO_PROTO XmTabbedStackListInsert(XmTabbedStackList tab_list, int position, XtValueMask mask, XmTabAttributes attributes) #else XmTabbedStackListInsert(tab_list, position, mask, attributes) XmTabbedStackList tab_list; int position; XtValueMask mask; XmTabAttributes attributes; #endif { XmTabAttributes newTab; /* * First let's see if they gave us a valid XmTabbedStackList and position * and if not let's just leave. */ if( tab_list == NULL || position < XmTAB_LAST_POSITION || (position > 0 && position >= tab_list->used) ) return XmTAB_NOT_FOUND; /* * Now lets add our new tab to the list in the correct position. * If the list is not large enough to hold our new tab we will * grow the list. */ if( tab_list->allocated == tab_list->used ) { /* * Our list is not large enough to take another tab, so lets * grow the list by XmLIST_GROWTH_FACTOR. */ tab_list->allocated += XmLIST_GROWTH_FACTOR; tab_list->tabs = (XmTabAttributes) XtRealloc((XtPointer) tab_list->tabs, sizeof(XmTabAttributeRec) * tab_list->allocated); } /* * Once here we know that the list is large enough to hold our new * item so now lets move any existing items up to make room for our * new kiddie. */ if( position == XmTAB_LAST_POSITION ) { newTab = &(tab_list->tabs[tab_list->used]); position = tab_list->used; } else { XmTabAttributes to, from; int count; from = &(tab_list->tabs[position]); to = &(tab_list->tabs[position+1]); count = tab_list->used - position; memmove(to, from, sizeof(XmTabAttributeRec) * count); newTab = &(tab_list->tabs[position]); } tab_list->used++; /* * Now lets initialize the new tab. After that we will take a look * at the mask and see what attributes were customized. */ newTab->label_string = (XmString) NULL; newTab->string_direction = XmSTRING_DIRECTION_L_TO_R; newTab->label_pixmap = XmUNSPECIFIED_PIXMAP; newTab->label_alignment = XmALIGNMENT_CENTER; newTab->pixmap_placement = XmPIXMAP_RIGHT; newTab->foreground = XmCOLOR_DYNAMIC; newTab->background = XmCOLOR_DYNAMIC; newTab->background_pixmap = XmPIXMAP_DYNAMIC; newTab->sensitive = True; newTab->value_mode = XmTAB_VALUE_COPY; if( mask & XmTAB_VALUE_MODE ) { newTab->value_mode = attributes->value_mode; } if( mask & XmTAB_LABEL_STRING ) { if( newTab->value_mode == XmTAB_VALUE_COPY ) { newTab->label_string = XiXmStringCopy(attributes->label_string); } else { newTab->label_string = attributes->label_string; } } if( mask & XmTAB_STRING_DIRECTION ) { newTab->string_direction = attributes->string_direction; } if( mask & XmTAB_LABEL_PIXMAP ) { newTab->label_pixmap = attributes->label_pixmap; } if( mask & XmTAB_PIXMAP_PLACEMENT ) { newTab->pixmap_placement = attributes->pixmap_placement; } if( mask & XmTAB_BACKGROUND ) { newTab->background = attributes->background; } if( mask & XmTAB_BACKGROUND_PIXMAP ) { newTab->background_pixmap = attributes->background_pixmap; } if( mask * XmTAB_SENSITIVE ) { newTab->sensitive = attributes->sensitive; } if( mask & XmTAB_FOREGROUND ) { newTab->foreground = attributes->foreground; } if( mask & XmTAB_LABEL_ALIGNMENT ) { newTab->label_alignment = attributes->label_alignment; } return( position ); } /* * Function: * XmTabbedStackListAppend(tab_list, mask, attributes) * Description: * Appends a new tab with the given attributes. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to append a tab to * mask : XtValueMask - the mask of attributes to set on the * new tab * attributes : XmTabAttributes - the list of attributes to set on the * new tab * Output: * int - the position of the new tab */ int #ifndef _NO_PROTO XmTabbedStackListAppend(XmTabbedStackList tab_list, XtValueMask mask, XmTabAttributes attributes) #else XmTabbedStackListAppend(tab_list, mask, attributes) XmTabbedStackList tab_list; XtValueMask mask; XmTabAttributes attributes; #endif { /* * So we cheat a little here. All we need to do is call insert and * lets that function know that we want it at the end of the list. */ return( XmTabbedStackListInsert(tab_list, XmTAB_LAST_POSITION, mask, attributes) ); } /* * Function: * XmTabbedStackListModify(tab_list, position, mask, attributes) * Description: * Change the specified attributes for the tab at the given position * in the given XmTabbedStackList. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList that contains the * tab to modify. * position : int - the index of the tab to modify * mask : XtValueMask - the mask of attributes to modify * attributes : XmTabAttributes - the list of attributes to modify * Output: * None. */ void #ifndef _NO_PROTO XmTabbedStackListModify(XmTabbedStackList tab_list, int position, XtValueMask mask, XmTabAttributes attributes) #else XmTabbedStackListModify(tab_list, position, mask, attributes) XmTabbedStackList tab_list; int position; XtValueMask mask; XmTabAttributes attributes; #endif { XmTabAttributes tab; /* * First lets see if they gave us anything valid to work with and * if they did not lets vacate the premises. */ if( tab_list == NULL || position < 0 || position >= tab_list->used ) { return; } tab = &(tab_list->tabs[position]); /* * Now lets check the various flags and see what we need to * change. */ if( mask & XmTAB_VALUE_MODE && tab->value_mode != attributes->value_mode && attributes->value_mode == XmTAB_VALUE_COPY ) { /* * Can only change this mode from share to copy, NOT from copy * to share. */ tab->value_mode = attributes->value_mode; tab->label_string = XiXmStringCopy(attributes->label_string); } if( mask & XmTAB_LABEL_STRING ) { if( tab->value_mode == XmTAB_VALUE_COPY ) { XiXmStringFree(tab->label_string); tab->label_string = XiXmStringCopy(attributes->label_string); } else { tab->label_string = attributes->label_string; } } if( mask & XmTAB_STRING_DIRECTION ) { tab->string_direction = attributes->string_direction; } if( mask & XmTAB_LABEL_PIXMAP ) { tab->label_pixmap = attributes->label_pixmap; } if( mask & XmTAB_PIXMAP_PLACEMENT ) { tab->pixmap_placement = attributes->pixmap_placement; } if( mask & XmTAB_BACKGROUND ) { tab->background = attributes->background; } if( mask & XmTAB_BACKGROUND_PIXMAP ) { tab->background_pixmap = attributes->background_pixmap; } if( mask & XmTAB_SENSITIVE ) { tab->sensitive = attributes->sensitive; } if( mask & XmTAB_FOREGROUND ) { tab->foreground = attributes->foreground; } if( mask & XmTAB_LABEL_ALIGNMENT ) { tab->label_alignment = attributes->label_alignment; } } /* * Function: * XmTabbedStackListQuery(tab_list, position, mask, attributes) * Description: * Retrieve attributes from the specified tab. (NOTE: This may be * a copy out, depends on value_mode, so be sure to free * this when done.) * Input: * tab_list : XmTabbedStackList - the tab list that contains the tab * position : int - the tab index to query * attributes : XmTabAttributes - the attributes returned. * Output: * None. */ void #ifndef _NO_PROTO XmTabbedStackListQuery(XmTabbedStackList tab_list, int position, XmTabAttributes attributes) #else XmTabbedStackListQuery(tab_list, position, attributes) XmTabbedStackList tab_list; int position; XmTabAttributes attributes; #endif { XmTabAttributes tab; /* * Make sure that we have valid data and if not "asta la vesta, baby" * I have NO idea how to spell that. */ if( tab_list == NULL || position < 0 || position >= tab_list->used ) { return; } tab = &(tab_list->tabs[position]); if( tab->value_mode == XmTAB_VALUE_COPY ) { attributes->label_string = XiXmStringCopy(tab->label_string); } else { attributes->label_string = tab->label_string; } attributes->label_pixmap = tab->label_pixmap; attributes->string_direction = tab->string_direction; attributes->label_alignment = tab->label_alignment; attributes->pixmap_placement = tab->pixmap_placement; attributes->background = tab->background; attributes->background_pixmap = tab->background_pixmap; attributes->sensitive = tab->sensitive; attributes->foreground = tab->foreground; attributes->value_mode = tab->value_mode; } /* * Function: * XmTabbedStackListFind(tab_list, label_string) * Description: * Finds the first tab whose label_string matches the given * and returns its index. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to search * label_string : XmString - the label_string to search for * Output: * int - the index of the tab found, or XmTAB_NOT_FOUND if * a match is not found. */ int #ifndef _NO_PROTO XmTabbedStackListFind(XmTabbedStackList tab_list, XmString label_string) #else XmTabbedStackListFind(tab_list, label_string) XmTabbedStackList tab_list; XmString label_string; #endif { int i; if( tab_list == NULL ) return( XmTAB_NOT_FOUND ); for( i = 0; i < tab_list->used; ++i ) { if( XiXmStringCompare(tab_list->tabs[i].label_string, label_string) ) { return( i ); } } return( XmTAB_NOT_FOUND ); } /* * Function: * XmTabbedStackListSimpleRemove(tab_list, label_string) * Description: * Removes the first tab from the given XmTabbedStackList that matches the * given label string. * Input: * tab_list : XmTabbedStackList - tab list to remove the item from * label_string : XmString - the label string to match * Output: * None. */ void #ifndef _NO_PROTO XmTabbedStackListSimpleRemove(XmTabbedStackList tab_list, XmString label_string) #else XmTabbedStackListSimpleRemove(tab_list, label_string) XmTabbedStackList tab_list; XmString label_string; #endif { int position = XmTabbedStackListFind(tab_list, label_string); if( position != XmTAB_NOT_FOUND ) XmTabbedStackListRemove(tab_list, position); } /* * Function: * XmTabbedStackListSimpleInsert(tab_list, position, label_string) * Description: * Inserts a new tab with the specified label string at the * specified position. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to add a tab to * position : int - the position to put the tab at * label_string : XmString - the label for the new tab * Output: * int - the position of the new tab */ int #ifndef _NO_PROTO XmTabbedStackListSimpleInsert(XmTabbedStackList tab_list, int position, XmString label_string) #else XmTabbedStackListSimpleInsert(tab_list, position, label_string) XmTabbedStackList tab_list; int position; XmString label_string; #endif { XmTabAttributeRec attributes; attributes.label_string = label_string; return( XmTabbedStackListInsert(tab_list, position, XmTAB_LABEL_STRING, &attributes) ); } /* * Function: * XmTabbedStackListSimpleAppend(tab_list, label_string) * Description: * Append a new tab to the given tab list with the specified label * string. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to append a tab to * label_string : XmString - the label for the new tab * Output: * int - the position of the new tab */ int #ifndef _NO_PROTO XmTabbedStackListSimpleAppend(XmTabbedStackList tab_list, XmString label_string) #else XmTabbedStackListSimpleAppend(tab_list, label_string) XmTabbedStackList tab_list; XmString label_string; #endif { XmTabAttributeRec attributes; attributes.label_string = label_string; return( XmTabbedStackListAppend(tab_list, XmTAB_LABEL_STRING, &attributes) ); } /* * Function: * XmTabbedStackListsimpleModify(tab_list, position, label_string) * Description: * Changes the label string for the specified tab. * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList that contains the tab to * change * position : int - the tab to change * label_string : XmString - the new value of the label string * Output: * None. */ /* ARGSUSED */ void #ifndef _NO_PROTO XmTabbedStackListSimpleModify(XmTabbedStackList tab_list, int position, XmString label_string) #else XmTabbedStackListSimpleModify(tab_list, position, label_string) XmTabbedStackList tab_list; int position; XmString label_string; #endif { XmTabAttributeRec attributes; XmTabbedStackListModify(tab_list, position, XmTAB_LABEL_STRING, &attributes); } /* * Function: * XmTabbedStackListSimpleQuery(tab_list, position) * Description: * Query the label string from the specified tab * Input: * tab_list : XmTabbedStackList - the XmTabbedStackList to query * position : int - the tab to query * Output: * XmString - the label for the given tab (NOTE: this is a copy * so please free when you are done) */ XmString #ifndef _NO_PROTO XmTabbedStackListSimpleQuery(XmTabbedStackList tab_list, int position) #else XmTabbedStackListSimpleQuery(tab_list, position) XmTabbedStackList tab_list; int position; #endif { XmTabAttributeRec attributes; XmTabbedStackListQuery(tab_list, position, &attributes); if( attributes.value_mode != XmTAB_VALUE_COPY ) { attributes.label_string = XiXmStringCopy(attributes.label_string); } return( attributes.label_string ); } /* * Function: * XmTabAttributesFree(attributes) * Description: * This deallocates any memory that the attribute structure is * using. This does not free the attribute structure. * Input: * attributes : XiAttributes - the structure whose contants should be * deallocated. * Output: * None. */ void #ifndef _NO_PROTO XmTabAttributesFree(XmTabAttributes attributes) #else XmTabAttributesFree(attributes) XmTabAttributes attributes; #endif { if( attributes->value_mode == XmTAB_VALUE_COPY ) { XiXmStringFree(attributes->label_string); } } /* * Function: * _XmTabbedStackListCount(tab_list) * Description: * Returns the number of entries in the given XmTabbedStackList. * Input: * tab_list : XmTabbedStackList - the tab list whose entries to count * Output: * int - the number of items in the given XmTabbedStackList */ int #ifndef _NO_PROTO _XmTabbedStackListCount(XmTabbedStackList tab_list) #else _XmTabbedStackListCount(tab_list) XmTabbedStackList tab_list; #endif { if( tab_list == NULL ) return( 0 ); return( tab_list->used ); } /* * Function: * _XmTabbedStackListGet(tab_list, position) * Description: * Returns a pointer to the given element in the XmTabbedStackList. Use * with caution as it returns a pointer to live memory. * Input: * tab_list : XmTabbedStackList - the tab list to index into * int : Position - the index of the tab you want * Output: * XmTabAttributes - a pointer to the specified tab */ XmTabAttributes #ifndef _NO_PROTO _XmTabbedStackListGet(XmTabbedStackList tab_list, int position) #else _XmTabbedStackListGet(tab_list, position) XmTabbedStackList tab_list; int position; #endif { XmTabAttributes tab; /* * Make sure that we have valid data and if not "asta la vesta, baby" * I have NO idea how to spell that. */ if( tab_list == NULL || position < 0 || position >= tab_list->used ) { return( NULL ); } tab = &(tab_list->tabs[position]); return( tab ); } XmTabAttributes #ifndef _NO_PROTO _XmTabbedStackListArray(XmTabbedStackList tab_list) #else _XmTabbedStackListArray(tab_list) XmTabbedStackList tab_list; #endif { /* * Make sure that we have valid data and if not "asta la vesta, baby" * I have NO idea how to spell that. */ if( tab_list == NULL ) { return( NULL ); } return( tab_list->tabs ); } /* * Function: * XmTabbedStackListCompare(XmTabbedStackList list1, XmTabbedStackList list2) * Description: * Compares to tab lists to see if they are logically * equivalent. * Input: * list1 : XmTabbedStackList - tab list to compare * list2 : XmTabbedStackList - tab list to compare * Output: * XmTabResult - indicates the differences it any */ XmTabResult #ifndef _NO_PROTO XmTabbedStackListCompare(XmTabbedStackList list1, XmTabbedStackList list2) #else XmTabbedStackListCompare(list1, list2) XmTabbedStackList list1, list2; #endif { XmTabResult result = XmTAB_CMP_EQUAL; int i; if( (list1 == NULL && list2 != NULL) || (list1 != NULL && list2 == NULL) || list1->used != list2->used ) return( XmTAB_CMP_SIZE ); for( i = 0; i < list1->used; ++i ) { if( list1->tabs[i].label_pixmap != list2->tabs[i].label_pixmap || !XiXmStringCompare(list1->tabs[i].label_string, list2->tabs[i].label_string) || list1->tabs[i].pixmap_placement != list2->tabs[i].pixmap_placement ) { return( XmTAB_CMP_SIZE ); } if( list1->tabs[i].string_direction != list2->tabs[i].string_direction || list1->tabs[i].label_alignment != list2->tabs[i].label_alignment || list1->tabs[i].foreground != list2->tabs[i].foreground || list1->tabs[i].background != list2->tabs[i].background || list1->tabs[i].sensitive != list2->tabs[i].sensitive || list1->tabs[i].background_pixmap != list2->tabs[i].background_pixmap ) { result = XmTAB_CMP_VISUAL; } } return( result ); } motif-2.3.8/lib/Xm/ManagerP.h0000644000175000017500000001156513145162623012573 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmManagerP_h #define _XmManagerP_h #ifndef _XmNO_BC_INCL #define _XmNO_BC_INCL #endif #include #ifdef __cplusplus extern "C" { #endif /* Access Macros */ #define XmParentTopShadowGC(w) \ (((XmManagerWidget) XtParent(w))->manager.top_shadow_GC) #define XmParentBottomShadowGC(w) \ (((XmManagerWidget) XtParent(w))->manager.bottom_shadow_GC) #define XmParentHighlightGC(w) \ (((XmManagerWidget) XtParent(w))->manager.highlight_GC) #define XmParentBackgroundGC(w) \ (((XmManagerWidget) XtParent(w))->manager.background_GC) #define MGR_KeyboardList(m) \ (((XmManagerRec *) (m))->manager.keyboard_list) #define MGR_NumKeyboardEntries(m) \ (((XmManagerRec *) (m))->manager.num_keyboard_entries) #define MGR_SizeKeyboardList(m) \ (((XmManagerRec *) (m))->manager.size_keyboard_list) #define MGR_ShadowThickness(m) \ (((XmManagerRec *) (m))->manager.shadow_thickness) #define XmInheritTraversalChildrenProc ((XmTraversalChildrenProc) _XtInherit) #define XmInheritObjectAtPointProc ((XmObjectAtPointProc) _XtInherit) typedef Boolean (*XmTraversalChildrenProc)( Widget, Widget **, Cardinal *) ; typedef Widget (*XmObjectAtPointProc)(Widget, Position, Position) ; /* Structure used for storing accelerator and mnemonic information. */ typedef struct { unsigned int eventType; KeySym keysym; KeyCode key; unsigned int modifiers; Widget component; Boolean needGrab; Boolean isMnemonic; } XmKeyboardData; /* The class definition */ typedef struct { XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; XmTraversalChildrenProc traversal_children ; XmObjectAtPointProc object_at_point ; } XmManagerClassExtRec, *XmManagerClassExt ; #define XmManagerClassExtVersion 1L typedef struct _XmManagerClassPart { String translations; XmSyntheticResource * syn_resources; int num_syn_resources; XmSyntheticResource * syn_constraint_resources; int num_syn_constraint_resources; XmParentProcessProc parent_process; XtPointer extension; } XmManagerClassPart; typedef struct _XmManagerClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; } XmManagerClassRec; externalref XmManagerClassRec xmManagerClassRec; /* The instance definition */ typedef struct _XmManagerPart { Pixel foreground; Dimension shadow_thickness; Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; Pixel highlight_color; Pixmap highlight_pixmap; XtCallbackList help_callback; XtPointer user_data; Boolean traversal_on; unsigned char unit_type; XmNavigationType navigation_type; Boolean event_handler_added; Widget active_child; Widget highlighted_widget; Widget accelerator_widget; Boolean has_focus; XmStringDirection string_direction; XmKeyboardData * keyboard_list; short num_keyboard_entries; short size_keyboard_list; XmGadget selected_gadget; XmGadget eligible_for_multi_button_event; GC background_GC; GC highlight_GC; GC top_shadow_GC; GC bottom_shadow_GC; Widget initial_focus; #ifndef XM_PART_BC XtCallbackList popup_handler_callback; #endif } XmManagerPart; typedef struct _XmManagerRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; } XmManagerRec; /* The constraint definition */ typedef struct _XmManagerConstraintPart { int unused; } XmManagerConstraintPart; typedef struct _XmManagerConstraintRec { XmManagerConstraintPart manager; } XmManagerConstraintRec, * XmManagerConstraintPtr; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmManagerP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/SSpinB.h0000644000175000017500000000470413145162623012234 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /****************************************************************************** * * File: SSpinB.h * Date: June 1, 1995 * Author: Mitchell Greess * * Contents: * Public header file for the XmSimpleSpinBox widget. * Implements the XmSimpleSpinBox. * ******************************************************************************/ #ifndef _XmSSpinB_h #define _XmSSpinB_h #include #ifdef __cplusplus extern "C" { #endif /* XmSimpleSpinBox Widget */ externalref WidgetClass xmSimpleSpinBoxWidgetClass; typedef struct _XmSimpleSpinBoxClassRec *XmSimpleSpinBoxWidgetClass; typedef struct _XmSimpleSpinBoxRec *XmSimpleSpinBoxWidget; /* Spin externs for application accessible functions */ extern Widget XmCreateSimpleSpinBox( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern void XmSimpleSpinBoxAddItem( Widget widget, XmString item, int pos); extern void XmSimpleSpinBoxDeletePos( Widget widget, int pos); extern void XmSimpleSpinBoxSetItem( Widget widget, XmString item); /* * Variable argument list functions */ extern Widget XmVaCreateSimpleSpinBox( Widget parent, char *name, ...); extern Widget XmVaCreateManagedSimpleSpinBox( Widget parent, char *name, ...); #ifdef __cplusplus } #endif #endif /* _SSpinB_h */ motif-2.3.8/lib/Xm/NotebookP.h0000644000175000017500000001754212672140200012771 00000000000000/* $XConsortium: NotebookP.h /main/4 1995/07/15 20:53:46 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmNotebookP_h #define _XmNotebookP_h #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* Notebook's constraint info. fields */ typedef struct _XmNotebookConstraintPart { /* resources */ int page_number; /* page number */ unsigned char child_type; /* notebook child type */ Boolean resizable; /* is this child resizable? */ /* private variables */ Boolean active; /* True if the child is active */ } XmNotebookConstraintPart, *XmNotebookConstraint; typedef struct _XmNotebookConstraintRec { XmManagerConstraintPart manager; XmNotebookConstraintPart notebook; } XmNotebookConstraintRec, *XmNotebookConstraintPtr; /* New fields for the Notebook widget class record */ typedef struct _XmNotebookClassPart { XtPointer extension; } XmNotebookClassPart; /* Full class record declaration */ typedef struct _NotebookClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmNotebookClassPart notebook_class; } XmNotebookClassRec; externalref XmNotebookClassRec xmNotebookClassRec; /* New fields for the Notebook widget instance record */ typedef struct _XmNotebookPart { /* resources */ int current_page_number; /* the current page number */ int first_page_number; /* the first page number */ int last_page_number; /* the last page number */ unsigned char orientation; /* notebook orientation */ unsigned char back_page_pos; /* position of back pages */ Cardinal back_page_number; /* the of back page lines */ Dimension back_page_size; /* the thickness of back pages */ Pixel back_page_foreground; /* foreground color for bk pgs */ Pixel back_page_background; /* background color for bk pgs */ Pixel frame_background; /* background color for frame */ unsigned char binding_type; /* binding type */ Pixmap binding_pixmap; /* pixmap for the binding */ Pixmap spiral_pixmap; /* pixmap for the spiral binding */ Dimension binding_width; /* the width of the binding */ Dimension margin_width; /* horizontal margin between widgets */ Dimension margin_height; /* vertical margin between widgets */ Dimension major_spacing; /* gap between major tabs */ Dimension minor_spacing; /* gap between minor tabs */ Dimension shadow_thickness; /* notebook frame shadow thickness */ XtCallbackList page_change_callback;/* the page change callback */ /* child widgets */ Widget scroller; /* the page scroller widget */ Widget scroller_child; /* TextF child of def page scroller */ Widget next_major; /* next major tab scroll button */ Widget prev_major; /* prev major tab scroll button */ Widget next_minor; /* next minor tab scroll button */ Widget prev_minor; /* prev minor tab scroll button */ /* preferred children sizes */ Dimension real_binding_width; /* real binding width */ Dimension real_back_page_number; /* real back page number */ Dimension page_width; /* width of page widgets */ Dimension page_height; /* height of page widgets */ Dimension status_width; /* width of the status areas */ Dimension status_height; /* height of the status areas */ Dimension major_width; /* width of major tabs */ Dimension major_height; /* height of major tabs */ Dimension minor_width; /* width of minor tabs */ Dimension minor_height; /* height of minor tabs */ Dimension scroller_width; /* width of the page scroller */ Dimension scroller_height; /* height of the page scroller */ Dimension major_scroller_width; /* width of major scrollers */ Dimension major_scroller_height; /* height of major scroller */ Dimension minor_scroller_width; /* width of minor scrollers */ Dimension minor_scroller_height; /* height of minor scrollers */ Dimension frame_width; /* width of the frame */ Dimension frame_height; /* height of the frame */ /* for layouting tabs */ Widget first_major; /* the first major tab */ Widget old_top_major; /* the old top major tab */ Widget top_major; /* the top major tab */ Widget last_major; /* the last major tab */ Widget first_minor; /* the first minor tab */ Widget old_top_minor; /* the old top minor tab */ Widget top_minor; /* the top minor tab */ Widget last_minor; /* the last minor tab */ Widget constraint_child; /* changing geom during ConstraintSV */ /* shadow thickness state for current page major and minor tab */ Dimension major_shadow_thickness; /* joined major tab shadow thickness */ Dimension minor_shadow_thickness; /* joined minor tab shadow thickness */ Widget major_shadow_child; /* saved shadow thickness tab */ Widget minor_shadow_child; /* saved shadow thickness tab */ Boolean in_setshadow; /* setting tab shadow thickness */ /* extra position information */ unsigned char major_pos; /* position of major tabs */ unsigned char minor_pos; /* position of minor tabs */ unsigned char binding_pos; /* binding position */ /* other misc. variables */ unsigned char which_tab; /* currently active tab type */ int last_alloc_num; /* lastly allocated page number */ unsigned char scroller_status; /* status of the page scroller */ unsigned short need_scroller; /* need for tab scrollers */ Boolean dynamic_last_page_num; /* True if using dynamic last page# */ Boolean in_callback; /* True if processing a callback */ GC back_page_gc; /* GC for drawing backpages */ GC frame_gc; /* GC for drawing frame */ GC binding_gc; /* GC for drawing binding */ GC foreground_gc; /* GC for drawing foreground */ GC background_gc; /* GC for drawing background */ Boolean first_change_managed; /* flags 1st call to ChangeManaged */ XmScrollFrameData scroll_frame_data; /* data for ScrollFrame trait */ } XmNotebookPart; /* Full instance record declaration */ typedef struct _XmNotebookRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmNotebookPart notebook; } XmNotebookRec; /****************************************************************************** * * * constants & useful macros * * * ******************************************************************************/ /* internal child types, must not conflict with XmRNBChildType enum */ #define XmMAJOR_TAB_SCROLLER 12 #define XmMINOR_TAB_SCROLLER 13 #define XmTAB_SCROLLER 14 #ifdef __cplusplus } #endif #endif /* _XmNotebookP_h */ motif-2.3.8/lib/Xm/ExtObjectP.h0000644000175000017500000000412713145162623013104 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmExtObjectP_h #define _XmExtObjectP_h #include #ifdef __cplusplus extern "C" { #endif enum { XmCACHE_EXTENSION = 1, XmDESKTOP_EXTENSION, XmSHELL_EXTENSION, XmPROTOCOL_EXTENSION, XmDEFAULT_EXTENSION }; #ifndef XmIsExtObject #define XmIsExtObject(w) XtIsSubclass(w, xmExtObjectClass) #endif /* XmIsExtObject */ #define XmLOGICAL_PARENT_RESOURCE (0x80 << sizeof(Cardinal)) /* Class record constants */ typedef struct _XmExtRec *XmExtObject; typedef struct _XmExtClassRec *XmExtObjectClass; externalref WidgetClass xmExtObjectClass; /* Class Extension definitions */ typedef struct _XmExtClassPart { XmSyntheticResource *syn_resources; int num_syn_resources; XtPointer extension; } XmExtClassPart, *XmExtClassPartPtr; typedef struct _XmExtClassRec { ObjectClassPart object_class; XmExtClassPart ext_class; } XmExtClassRec; typedef struct { Widget logicalParent; unsigned char extensionType; } XmExtPart, *XmExtPartPtr; externalref XmExtClassRec xmExtClassRec; typedef struct _XmExtRec { ObjectPart object; XmExtPart ext; } XmExtRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmExtObjectP_h */ motif-2.3.8/lib/Xm/DropSMgrI.c0000644000175000017500000002251213145162623012674 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: DropSMgrI.c /main/11 1995/07/14 10:30:45 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" #include "DropSMgrI.h" #include "MessagesI.h" #include "RegionI.h" #define MESSAGE1 _XmMMsgDropSMgrI_0001 #define MESSAGE2 _XmMMsgDropSMgrI_0002 #define MESSAGE3 _XmMMsgDropSMgrI_0003 /******** Static Function Declarations ********/ /******** End Static Function Declarations ********/ externaldef(xmdsresources) XtResource _XmDSResources[] = { { XmNdropSiteType, XmCDropSiteType, XmRDropSiteType, sizeof(unsigned char), XtOffsetOf( struct _XmDSFullInfoRec, type), XmRImmediate, (XtPointer) XmDROP_SITE_SIMPLE }, { XmNdropSiteActivity, XmCDropSiteActivity, XmRDropSiteActivity, sizeof(unsigned char), XtOffsetOf( struct _XmDSFullInfoRec, activity), XmRImmediate, (XtPointer) XmDROP_SITE_ACTIVE }, { XmNimportTargets, XmCImportTargets, XmRAtomList, sizeof(Atom *), XtOffsetOf( struct _XmDSFullInfoRec, import_targets), XmRImmediate, (XtPointer) NULL }, { XmNnumImportTargets, XmCNumImportTargets, XmRCardinal, sizeof(Cardinal), XtOffsetOf( struct _XmDSFullInfoRec, num_import_targets), XmRImmediate, (XtPointer) 0 }, { XmNdropSiteOperations, XmCDropSiteOperations, XmRDropSiteOperations, sizeof(unsigned char), XtOffsetOf( struct _XmDSFullInfoRec, operations), XmRImmediate, (XtPointer) (XmDROP_MOVE | XmDROP_COPY), }, { XmNdropRectangles, XmCDropRectangles, XmRRectangleList, sizeof(XRectangle *), XtOffsetOf( struct _XmDSFullInfoRec, rectangles), XmRImmediate, (XtPointer) NULL }, { XmNnumDropRectangles, XmCNumDropRectangles, XmRCardinal, sizeof(Cardinal), XtOffsetOf( struct _XmDSFullInfoRec, num_rectangles), XmRImmediate, (XtPointer) 1 }, { XmNdragProc, XmCDragProc, XmRProc, sizeof(XtPointer), XtOffsetOf( struct _XmDSFullInfoRec, drag_proc), XmRImmediate, (XtPointer) NULL }, { XmNdropProc, XmCDropProc, XmRProc, sizeof(XtPointer), XtOffsetOf( struct _XmDSFullInfoRec, drop_proc), XmRImmediate, (XtPointer) NULL }, { XmNanimationStyle, XmCAnimationStyle, XmRAnimationStyle, sizeof(unsigned char), XtOffsetOf( struct _XmDSFullInfoRec, animation_style), XmRImmediate, (XtPointer) XmDRAG_UNDER_HIGHLIGHT }, { XmNanimationPixmap, XmCAnimationPixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf( struct _XmDSFullInfoRec, animation_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNanimationMask, XmCAnimationMask, XmRBitmap, sizeof(Pixmap), XtOffsetOf( struct _XmDSFullInfoRec, animation_mask), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNanimationPixmapDepth, XmCAnimationPixmapDepth, XmRCardinal, sizeof(int), XtOffsetOf( struct _XmDSFullInfoRec, animation_pixmap_depth), XmRImmediate, (XtPointer) 0 }, { XmNclientData, XmCClientData, XmRPointer, sizeof(XtPointer), XtOffsetOf( struct _XmDSFullInfoRec, client_data), XmRImmediate, NULL }, }; externaldef(xmnumdsresources) Cardinal _XmNumDSResources = XtNumber(_XmDSResources); void _XmDSIAddChild( XmDSInfo parentInfo, XmDSInfo childInfo, Cardinal childPosition ) { unsigned short i; unsigned short num_children; if ((parentInfo == NULL) || (childInfo == NULL)) return; num_children = GetDSNumChildren(parentInfo); if (GetDSType(parentInfo) != XmDROP_SITE_COMPOSITE) { XmeWarning(GetDSWidget(childInfo), MESSAGE1 ); } if (childPosition > num_children) { XmeWarning(GetDSWidget(parentInfo), MESSAGE2); childPosition = num_children; } if (num_children == GetDSMaxChildren(parentInfo)) { SetDSMaxChildren(parentInfo, num_children + CHILDREN_INCREMENT); SetDSChildren(parentInfo, (XtPointer *) XtRealloc( (char *) GetDSChildren(parentInfo), sizeof(XmDSInfo) * GetDSMaxChildren(parentInfo))); } for (i = num_children; i > childPosition; i--) GetDSChildren(parentInfo)[i] = GetDSChildren(parentInfo)[i-1]; GetDSChildren(parentInfo)[childPosition] = (XtPointer) childInfo; SetDSNumChildren(parentInfo, (num_children + 1)); SetDSParent(childInfo, (XtPointer) parentInfo); SetDSLeaf(parentInfo, False); } void _XmDSIRemoveChild( XmDSInfo parentInfo, XmDSInfo childInfo ) { int i; unsigned short num_children; Cardinal position; if ((parentInfo == NULL) || (childInfo == NULL)) return; num_children = GetDSNumChildren(parentInfo); /* Find the child to be Removed */ position = _XmDSIGetChildPosition(parentInfo, childInfo); /* * Take it out of the list by writing over its location and * reducing the child count. */ for (i = position + 1; i < num_children; i++) GetDSChildren(parentInfo)[i - 1] = GetDSChildren(parentInfo)[i]; SetDSNumChildren(parentInfo, --num_children); if (!num_children) SetDSLeaf(parentInfo, True); } Cardinal _XmDSIGetChildPosition( XmDSInfo parentInfo, XmDSInfo childInfo ) { int i; unsigned short num_children; if ((parentInfo == NULL) || (childInfo == NULL)) return(0); num_children = GetDSNumChildren(parentInfo); if (GetDSParent(childInfo) != (XtPointer) parentInfo) { char buf[256]; sprintf(buf, MESSAGE3, XrmQuarkToString(GetDSWidget(childInfo)->core.xrm_name), XrmQuarkToString(GetDSWidget(parentInfo)->core.xrm_name)); XmeWarning(GetDSWidget(parentInfo), buf); return(num_children); } for (i = 0; i < num_children; i++) if (GetDSChildren(parentInfo)[i] == (XtPointer) childInfo) break; if (i == num_children) { char buf[256]; sprintf(buf, MESSAGE3, XrmQuarkToString(GetDSWidget(childInfo)->core.xrm_name), XrmQuarkToString(GetDSWidget(parentInfo)->core.xrm_name)); XmeWarning(GetDSWidget(parentInfo), buf); } return(i); } void _XmDSIReplaceChild( XmDSInfo oldChildInfo, XmDSInfo newChildInfo ) { int i; unsigned short num_children; XmDSInfo parentInfo; if ((oldChildInfo == NULL) || (newChildInfo == NULL)) return; if ((parentInfo = (XmDSInfo) GetDSParent(oldChildInfo)) == NULL) return; num_children = GetDSNumChildren(parentInfo); for (i=0; i < num_children; i++) { if (GetDSChildren(parentInfo)[i] == (XtPointer) oldChildInfo) GetDSChildren(parentInfo)[i] = (XtPointer) newChildInfo; } SetDSParent(oldChildInfo, NULL); if ((GetDSParent(newChildInfo)) && (GetDSParent(newChildInfo) != (XtPointer) parentInfo)) _XmDSIRemoveChild(parentInfo, newChildInfo); else SetDSParent(newChildInfo, parentInfo); } void _XmDSISwapChildren( XmDSInfo parentInfo, Cardinal position1, Cardinal position2 ) { XmDSInfo tmp_info; unsigned short num_children; if (parentInfo == NULL) return; num_children = GetDSNumChildren(parentInfo); if ((position1 > num_children) || (position2 > num_children)) return; tmp_info = (XmDSInfo) GetDSChildren(parentInfo)[position1]; GetDSChildren(parentInfo)[position1] = GetDSChildren(parentInfo)[position2]; GetDSChildren(parentInfo)[position2] = (XtPointer) tmp_info; } void _XmDSIDestroy( XmDSInfo info, #if NeedWidePrototypes int substructures ) #else Boolean substructures ) #endif /* NeedWidePrototypes */ { if (info != NULL) { if ((GetDSType(info) == XmDROP_SITE_COMPOSITE) && (GetDSChildren(info) != NULL) && (substructures)) XtFree( (char *) GetDSChildren(info)); if (GetDSRegion(info) && (substructures)) _XmRegionDestroy(GetDSRegion(info)); XtFree( (char *) info); } } Dimension _XmDSIGetBorderWidth( XmDSInfo info) { if (info == NULL) return(0); if (GetDSRemote(info)) { switch (GetDSAnimationStyle(info)) { case XmDRAG_UNDER_NONE: { XmDSRemoteNoneStyleRec *sr = (XmDSRemoteNoneStyleRec *) GetDSRemoteAnimationPart(info); return(sr->border_width); } case XmDRAG_UNDER_HIGHLIGHT: { XmDSRemoteHighlightStyleRec *sr = (XmDSRemoteHighlightStyleRec *) GetDSRemoteAnimationPart(info); return(sr->border_width); } case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmDSRemoteShadowStyleRec *sr = (XmDSRemoteShadowStyleRec *) GetDSRemoteAnimationPart(info); return(sr->border_width); } case XmDRAG_UNDER_PIXMAP: { XmDSRemotePixmapStyleRec *sr = (XmDSRemotePixmapStyleRec *) GetDSRemoteAnimationPart(info); return(sr->border_width); } default: /* Shouldn't be here */ return 0; /*NOTREACHED*/ break; } } else { Widget w = GetDSWidget(info); return(XtBorderWidth(w)); } } motif-2.3.8/lib/Xm/RepTypeI.h0000644000175000017500000001303013145162623012567 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmRepTypeI_h #define _XmRepTypeI_h #include #include "XmI.h" #ifdef __cplusplus extern "C" { #endif /* We need a name to refer to the original unit type converter. This name is used as a to_type when installing a duplicate of the unit type converter in RepType.c and it is used again as a to_type when calling XtConvertAndStore in ResConvert.c when implementing XmCvtStringToUnitType (call to the original converter) */ #define REAL_UNIT_TYPE_NAME "RealUnitType" /* The following enumerations of representation type identification * numbers have a one-to-one positional mapping to the corresponding * representation type record in the static rep type lists. * The two static lists are in alphabetical order, as required by * the coding of the XmRepTypeGetId routine. ('_' is the exception in * this enum, the XmR names gives the order, really) */ enum { XmRID_ALIGNMENT, XmRID_ANIMATION_STYLE, XmRID_ARROW_DIRECTION, XmRID_ARROW_LAYOUT, XmRID_ARROW_ORIENTATION, XmRID_ARROW_SENSITIVITY, XmRID_ATTACHMENT, XmRID_AUDIBLE_WARNING, XmRID_AUTO_DRAG_MODEL, XmRID_AUTOMATIC_SELECTION, XmRID_BINDING_TYPE, XmRID_BITMAP_CONVERSION_MODEL, XmRID_BLEND_MODEL, XmRID_CHILD_HORIZONTAL_ALIGNMENT, XmRID_CHILD_PLACEMENT, XmRID_CHILD_TYPE, XmRID_CHILD_VERTICAL_ALIGNMENT, XmRID_COMBO_BOX_LIST_ACTION_ACTION_PARAMS, XmRID_COMBO_BOX_TYPE, XmRID_COMMAND_SELECTION_BOX_UP_OR_DOWN_ACTION_PARAMS, XmRID_COMMAND_WINDOW_LOCATION, XmRID_CONTAINER_CURSOR_ACTION_PARAMS, XmRID_CONTAINER_EXPAND_OR_COLLAPSE_ACTION_PARAMS, XmRID_CONTAINER_START_TRANSFER_ACTION_PARAMS, XmRID_DEFAULT_BUTTON_EMPHASIS, XmRID_DEFAULT_BUTTON_TYPE, XmRID_DELETE_RESPONSE, XmRID_DIALOG_STYLE, XmRID_DIALOG_TYPE, XmRID_DIRECTION, XmRID_DRAG_INITIATOR_PROTOCOL_STYLE, XmRID_DRAG_RECEIVER_PROTOCOL_STYLE, XmRID_DROP_SITE_ACTIVITY, XmRID_DROP_SITE_TYPE, XmRID_EDIT_MODE, XmRID_ENABLE_BTN1_TRANSFER, XmRID_ENABLE_WARP, XmRID_ENTRY_VIEW_TYPE, XmRID_FILE_FILTER_STYLE, XmRID_FILE_SELECTION_BOX_UP_OR_DOWN_ACTION_PARAMS, XmRID_FILE_TYPE_MASK, XmRID_FONT_TYPE, XmRID_ICON_ATTACHMENT, XmRID_INDICATOR_ON, XmRID_INDICATOR_TYPE, XmRID_INPUT_POLICY, XmRID_KEYBOARD_FOCUS_POLICY, XmRID_LABEL_TYPE, XmRID_LAYOUT_TYPE, XmRID_LINE_STYLE, XmRID_LINE_TYPE, XmRID_LIST_SIZE_POLICY, XmRID_LOAD_MODEL, XmRID_MATCH_BEHAVIOR, XmRID_MULTI_CLICK, XmRID_NAVIGATION_TYPE, XmRID_NB_CHILD_TYPE, XmRID_NOTEBOOK_TRAVERSE_TAB_ACTION_PARAMS, XmRID_ORIENTATION, XmRID_OUTLINE_BUTTON_POLICY, XmRID_OUTLINE_STATE, XmRID_PACKING, XmRID_PANED_WINDOW_SASH_ACTION_PARAMS, XmRID_PANED_WINDOW_SASH_DIRECTION_ACTION_PARAMS, XmRID_PANED_WINDOW_SASH_INCREMENT_ACTION_PARAMS, XmRID_PATH_MODE, XmRID_POSITION_MODE, XmRID_POSITION_TYPE, XmRID_PRIMARY_OWNERSHIP, XmRID_PROCESSING_DIRECTION, XmRID_RESIZE_POLICY, XmRID_ROW_COLUMN_TYPE, XmRID_SCROLL_BAR_DISPLAY_POLICY, XmRID_SCROLL_BAR_INCREMENT_DOWN_OR_RIGHT_ACTION_PARAMS, XmRID_SCROLL_BAR_INCREMENT_UP_OR_LEFT_ACTION_PARAMS, XmRID_SCROLL_BAR_PAGE_DOWN_OR_RIGHT_ACTION_PARAMS, XmRID_SCROLL_BAR_PAGE_UP_OR_LEFT_ACTION_PARAMS, XmRID_SCROLL_BAR_PLACEMENT, XmRID_SCROLLED_WINDOW_CHILD_TYPE, XmRID_SCROLLING_POLICY, XmRID_SELECTION_BOX_UP_OR_DOWN_ACTION_PARAMS, XmRID_SELECTION_MODE, XmRID_SELECTION_POLICY, XmRID_SELECTION_TECHNIQUE, XmRID_SELECTION_TYPE, XmRID_SEPARATOR_TYPE, XmRID_SET, XmRID_SHADOW_TYPE, XmRID_SHOW_ARROWS, XmRID_SHOW_VALUE, XmRID_SLIDER_MARK, XmRID_SLIDER_VISUAL, XmRID_SLIDING_MODE, XmRID_SPATIAL_INCLUDE_MODEL, XmRID_SPATIAL_RESIZE_MODEL, XmRID_SPATIAL_SNAP_MODEL, XmRID_SPATIAL_STYLE, XmRID_SPINBOX_CHILD_TYPE, XmRID_STRING_DIRECTION, XmRID_TEAR_OFF_MODEL, XmRID_TEXT_EXTEND_MOVEMENT_ACTION_PARAMS, XmRID_TEXTFIELD_DIRECTION_ACTION_PARAMS, XmRID_TEXTFIELD_EXTEND_MOVEMENT_ACTION_PARAMS, XmRID_TEXT_HORIZONTAL_DIRECTION_ACTION_PARAMS, XmRID_TEXT_VERTICAL_DIRECTION_ACTION_PARAMS, XmRID_TOGGLE_MODE, XmRID_UNIT_TYPE, XmRID_UNPOST_BEHAVIOR, XmRID_VERTICAL_ALIGNMENT, XmRID_VIEW_TYPE, XmRID_VISUAL_EMPHASIS, XmRID_VISUAL_POLICY, XmRID_WHICH_BUTTON, XmRID_PIXMAP_PLACEMENT } ; /******** Private Function Declarations ********/ extern void _XmRepTypeInstallConverters( void ) ; extern Boolean _XmConvertActionParamToRepTypeId(Widget widget, XmRepTypeId rep_type_id, char *parameter, Boolean can_be_numeric, int *result) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRepTypeI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextFP.h0000644000175000017500000003347113145162623012253 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextFP_h #define _XmTextFP_h #include #include #ifdef USE_XFT #include #endif #ifdef __cplusplus extern "C" { #endif /* * Defines for different cursors */ #define IBEAM_WIDTH 3 #define CARET_WIDTH 9 #define CARET_HEIGHT 5 /* * Here is the Text Field Widget class structure. */ typedef struct _XmTextFieldClassPart { XtPointer extension; /* Pointer to extension record. */ } XmTextFieldClassPart; typedef struct _XmTextFieldClassRec { CoreClassPart core_class; /* Not RectObjClassPart so I can reference core_class s */ XmPrimitiveClassPart primitive_class; XmTextFieldClassPart text_class; } XmTextFieldClassRec; externalref XmTextFieldClassRec xmTextFieldClassRec; /* * On the spot support. */ typedef struct _OnTheSpotData { XmTextPosition start; XmTextPosition end; XmTextPosition cursor; int over_len; int over_maxlen; char *over_str; int under_preedit; Boolean under_verify_preedit; Boolean verify_commit; int pad; } OnTheSpotDataRec, *OnTheSpotData; /* * Here is the Text Field Widget instance structures. */ typedef struct _XmTextFieldPart { XtCallbackList activate_callback; /* Command activate callback */ XtCallbackList focus_callback; /* Verify gain focus callback */ XtCallbackList losing_focus_callback; /* Verify losing focus callback */ XtCallbackList modify_verify_callback; /* Verify value to change callback */ XtCallbackList wcs_modify_verify_callback; /* Verify value to change callback */ XtCallbackList motion_verify_callback; /* Verify insert cursor position to change callback */ XtCallbackList gain_primary_callback; /* Gained ownership of Primary Selection */ XtCallbackList lose_primary_callback; /* Lost ownership of Primary Selection */ XtCallbackList value_changed_callback; /* Notify that value has changed callback */ char * value; /* pointer to widget value stored as char * */ wchar_t * wc_value; /* pointer to widget value stored as wchar_t * */ XmFontList font_list; /* Uses only the font portion of fontlist */ #if USE_XFT XtPointer font; /* font retrieved from the fontlist */ #else XFontStruct *font; /* font retrieved from the fontlist */ #endif XmTextScanType *selection_array; /* Description of what to cycle through on selections */ _XmHighlightData highlight; /* Info on the highlighting regions. */ GC gc; /* Normal GC for drawing text and cursor */ GC image_gc; /* Image GC for drawing text cursor*/ GC save_gc; /* GC for saving/restoring under IBeam */ Pixmap ibeam_off; /* pixmap for area under the IBeam */ Pixmap add_mode_cursor; /* The add mode cursor pixmap */ Pixmap cursor; /* The ibeam cursor stencil */ Pixmap putback; /* AVAILABLE: was in 1.1 but not really used */ Pixmap stipple_tile; /* The tile pattern for the stippled I-beam */ Pixmap image_clip; /* AVAILABLE: was in 1.2 but not used now */ XmTextPosition cursor_position; /* Character location of the insert cursor */ XmTextPosition new_h_offset; /* AVAILABLE: was in 1.1 but not used */ XmTextPosition h_offset; /* The x position of the first character (relative to left edge of widget) */ XmTextPosition orig_left; /* Left primary selection prior to extend */ XmTextPosition orig_right; /* Right primary selection prior to extend */ XmTextPosition prim_pos_left; /* Left primary selection position */ XmTextPosition prim_pos_right; /* Right primary selection position */ XmTextPosition prim_anchor; /* Primary selection pivot point */ XmTextPosition sec_pos_left; /* Left secondary selection position */ XmTextPosition sec_pos_right; /* Right secondary selection position */ XmTextPosition sec_anchor; /* Secondary selection pivot point */ XmTextPosition stuff_pos; /* Position to stuff the primary selection */ Position select_pos_x; /* x position for timer-based scrolling */ Time prim_time; /* Timestamp of primary selection */ Time dest_time; /* Timestamp of destination selection */ Time sec_time; /* Timestamp of secondary selection */ Time last_time; /* Time of last selection event */ XtIntervalId timer_id; /* Blinking cursor timer */ XtIntervalId select_id; /* Timer based scrolling identifier */ int blink_rate; /* Rate of blinking text cursor in msec */ int selection_array_count; /* Selection array count */ int threshold; /* Selection threshold */ int size_allocd; /* Size allocated for value string */ int string_length; /* The number of characters in the string (including the trailing NULL) */ int cursor_height; /* Save cursor dimensions */ int cursor_width; /* Save cursor dimensions */ int sarray_index; /* Index into selection array */ int max_length; /* Maximum number of character that can be inserted into the text field widget */ int max_char_size; /* Max bytes per character in cur locale */ short columns; /* The number of characters in the width */ Dimension margin_width; /* Height between text borders and text */ Dimension margin_height; /* Width between text borders and text */ Dimension average_char_width; /* Average character width based on font */ Dimension margin_top; /* Height between text borders and top of text */ Dimension margin_bottom; /* Height between text borders and bottom of text */ Dimension font_ascent; /* Ascent of font or fontset used by widget */ Dimension font_descent; /* Descent of font or fontset used by widget */ Boolean resize_width; /* Allows the widget to grow horizontally when borders are reached */ Boolean pending_delete; /* Delete primary selection on insert when set to True */ Boolean editable; /* Sets editablility of text */ Boolean verify_bell; /* Determines if bell is sounded when verify callback returns doit - False */ Boolean cursor_position_visible; /* Sets visibility of insert cursor */ Boolean traversed; /* Flag used with losing focus verification to indicate a traversal key pressed event */ Boolean add_mode; /* Add mode for cursor movement */ Boolean has_focus; /* Flag that indicates whether the widget has input focus */ Boolean blink_on; /* State of Blinking insert cursor */ short int cursor_on; /* Indicates whether the cursor is visible */ Boolean refresh_ibeam_off; /* Indicates whether the area under IBeam needs to be re-captured */ Boolean have_inverted_image_gc; /* fg/bg of image gc have been swapped */ Boolean has_primary; /* Indicates that is has the primary selection */ Boolean has_secondary; /* Indicates that is has the secondary selection */ Boolean has_destination; /* Indicates that is has the destination selection */ Boolean sec_drag; /* Indicates a secondary drag was made */ Boolean selection_move; /* Indicates that the action requires a secondary move (i.e. copy & cut) */ Boolean pending_off; /* indicates pending delete state */ Boolean fontlist_created; /* Indicates that the text field widget created it's own fontlist */ Boolean has_rect; /* currently has clipping rectangle */ Boolean do_drop; /* Indicates that the widget the recieved the button release, did not have a previous button press, so it is o.k. to request the MOTIF_DROP selection. */ Boolean cancel; /* Cancels selection actions when true */ Boolean extending; /* Indicates extending primary selection */ Boolean sec_extending; /* Indicates extending secondary selection */ Boolean changed_visible; /* Indicates whether the dest_visible flag is in a temporary changed state */ Boolean have_fontset; /* The widgets font is a fontset, not a fontstruct... use R5 draw routines */ Boolean in_setvalues; /* used to disable unnecessary redisplays */ Boolean do_resize; /* used to prevent inappropriate resizes */ Boolean redisplay; /* used to set redisplay flag in setvalues */ Boolean overstrike; /* overstrike mode for character input */ Boolean sel_start; /* overstrike mode for character input */ XtPointer extension; /* Pointer to extension record. */ XtCallbackList destination_callback; /* Selection destination cb */ Boolean selection_link; /* Indicates that the action requires a link */ /* New for 2.0 */ Boolean take_primary; /* Indicates that is has to take the primary selection */ GC cursor_gc; /* 1-bit depth GC for creating the I-beam stipples (normal & add mode) */ XtIntervalId drag_id; /* timer to start btn1 drag */ _XmTextActionRec *transfer_action; /* to keep track of delayed action */ /* Boolean rt_save; */ /* used for MT work */ OnTheSpotData onthespot; /* data for on-the-spot im support */ Boolean check_set_render_table; /* used for MT safe work */ Boolean programmatic_highlights; /* XmTextFieldSetHighlight called */ #ifdef USE_XFT Boolean use_xft; #endif } XmTextFieldPart; typedef struct _XmTextFieldRec { CorePart core; XmPrimitivePart primitive; XmTextFieldPart text; } XmTextFieldRec; /**************** * * Macros for the uncached data * ****************/ #define TextF_ActivateCallback(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.activate_callback) #define TextF_LosingFocusCallback(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.losing_focus_callback) #define TextF_FocusCallback(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.focus_callback) #define TextF_ModifyVerifyCallback(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.modify_verify_callback) #define TextF_ModifyVerifyCallbackWcs(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.wcs_modify_verify_callback) #define TextF_MotionVerifyCallback(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.motion_verify_callback) #define TextF_ValueChangedCallback(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.value_changed_callback) #define TextF_Value(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.value) #define TextF_WcValue(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.wc_value) #define TextF_MarginHeight(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.margin_height) #define TextF_MarginWidth(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.margin_width) #define TextF_CursorPosition(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.cursor_position) #define TextF_Columns(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.columns) #define TextF_MaxLength(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.max_length) #define TextF_BlinkRate(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.blink_rate) #define TextF_FontList(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.font_list) #define TextF_Font(tfg) \ ((XFontStruct*)(((XmTextFieldWidget)(tfg)) -> text.font)) #define TextF_FontAscent(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.font_ascent) #define TextF_FontDescent(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.font_descent) #define TextF_SelectionArray(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.selection_array) #define TextF_SelectionArrayCount(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.selection_array_count) #define TextF_ResizeWidth(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.resize_width) #define TextF_PendingDelete(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.pending_delete) #define TextF_Editable(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.editable) #define TextF_CursorPositionVisible(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.cursor_position_visible) #define TextF_Threshold(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.threshold) #define TextF_UseFontSet(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.have_fontset) #ifdef USE_XFT #define TextF_UseXft(tfg) \ (((XmTextFieldWidget)(tfg)) -> text.use_xft) #define TextF_XftFont(tfg) \ ((XftFont*)(((XmTextFieldWidget)(tfg)) -> text.font)) #endif /* * On the spot support. */ #define PreStart(tfg) (((XmTextFieldWidget)(tfg)) -> \ text.onthespot->start) #define PreEnd(tfg) (((XmTextFieldWidget)(tfg)) -> \ text.onthespot->end) #define PreCursor(tfg) (((XmTextFieldWidget)(tfg)) -> \ text.onthespot->cursor) #define FUnderVerifyPreedit(tfg) (((XmTextFieldWidget)(tfg)) -> \ text.onthespot->under_verify_preedit) #define FVerifyCommitNeeded(tfg) (((XmTextFieldWidget)(tfg)) -> \ text.onthespot->verify_commit) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextFieldWidgetP_h */ motif-2.3.8/lib/Xm/ButtonBoxP.h0000644000175000017500000001037012672140200013125 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef XmButtonBoxP_h #define XmButtonBoxP_h #if defined(VMS) || defined(__VMS) #include #endif /************************************************************ * INCLUDE FILES ************************************************************/ #include #include /************************************************************ * TYPEDEFS AND DEFINES ************************************************************/ /************************************************************ * MACROS ************************************************************/ #define XmButtonBoxIndex (XmManagerIndex + 1) #define XmButtonBox_equal_size(w) (((XmButtonBoxWidget)(w))->button_box.equal_size) #define XmButtonBox_fill_option(w) (((XmButtonBoxWidget)(w))->button_box.fill_option) #define XmButtonBox_margin_width(w) (((XmButtonBoxWidget)(w))->button_box.margin_width) #define XmButtonBox_margin_height(w) (((XmButtonBoxWidget)(w))->button_box.margin_height) #define XmButtonBox_spacing(w) (((XmButtonBoxWidget)(w))->button_box.spacing) #define XmButtonBox_orientation(w) (((XmButtonBoxWidget)(w))->button_box.orientation) #define XmButtonBox_default_button(w) (((XmButtonBoxWidget)(w))->button_box.default_button) #define XmButtonBoxC_pref_width(w) (((XmBBoxConstraints)((Widget)(w))->core.constraints)->bbox.pref_width) #define XmButtonBoxC_pref_height(w) (((XmBBoxConstraints)((Widget)(w))->core.constraints)->bbox.pref_height) /************************************************************ * GLOBAL DECLARATIONS ************************************************************/ #ifdef __cplusplus extern "C" { #endif typedef struct _XmButtonBoxClassPart { XtPointer extension; /* In case its needed later */ } XmButtonBoxClassPart; typedef struct _XmButtonBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmButtonBoxClassPart buttonbox_class; } XmButtonBoxClassRec; typedef struct _XmBBoxConstraintsPart { Dimension pref_width, pref_height; } XmBBoxConstraintsPart; typedef struct _XmBBoxConstraintsRec { XmManagerConstraintPart manager; XmBBoxConstraintsPart bbox; } XmBBoxConstraintsRec, *XmBBoxConstraints; /* * Match XmOffset nomenclature */ typedef XmBBoxConstraintsPart XmButtonBoxConstraintPart; typedef struct { /* resources */ Boolean equal_size; XmFillOption fill_option; Dimension margin_width, margin_height; Dimension spacing; unsigned char orientation; Widget default_button; } XmButtonBoxPart; typedef struct _XmButtonBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmButtonBoxPart button_box; } XmButtonBoxRec; /************************************************************ * EXTERNAL DECLARATIONS ************************************************************/ extern XmButtonBoxClassRec xmButtonBoxClassRec; /************************************************************ * STATIC DECLARATIONS ************************************************************/ #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmButtonBoxP_h */ motif-2.3.8/lib/Xm/Display.h0000644000175000017500000000366713145162623012512 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDisplay_h #define _XmDisplay_h #include #include #include #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsDisplay #define XmIsDisplay(w) (XtIsSubclass(w, xmDisplayClass)) #endif /* XmIsXmDisplay */ enum { XmDRAG_NONE, XmDRAG_DROP_ONLY, XmDRAG_PREFER_PREREGISTER, XmDRAG_PREREGISTER, XmDRAG_PREFER_DYNAMIC, XmDRAG_DYNAMIC, XmDRAG_PREFER_RECEIVER }; /* Class record constants */ typedef struct _XmDisplayRec *XmDisplay; typedef struct _XmDisplayClassRec *XmDisplayClass; externalref WidgetClass xmDisplayClass; #define XmGetDisplay(w) XmGetXmDisplay(XtDisplayOfObject(w)) /******** Public Function Declarations ********/ extern Widget XmGetDragContext( Widget w, Time time) ; extern Widget XmGetXmDisplay( Display *display) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDisplay_h */ motif-2.3.8/lib/Xm/DataFSel.c0000644000175000017500000006614713145162623012525 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$RCSfile: DataFSel.c,v $ $Revision: 1.6 $ $Date: 2003/10/06 10:10:23 $" #endif #endif #include #include #include #include #include #include #include #include /******** Static Function Declarations ********/ #ifdef _NO_PROTO static void InsertSelection() ; static Boolean ConvertInsertSelection() ; static void HandleInsertTargets() ; #else static void InsertSelection( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format) ; static Boolean ConvertInsertSelection( Widget w, Atom *selection, Atom *type, XtPointer *value, unsigned long *length, int *format, Atom locale_atom) ; static void HandleInsertTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format ); #endif /* _NO_PROTO */ /******** End Static Function Declarations ********/ #ifdef _NO_PROTO extern void _XmDataFieldDeselectSelection(); extern void _XmDataFieldStartSelection(); extern int _XmDataFieldCountBytes(); extern Boolean _XmDataFielddf_SetDestination(); extern void _XmDataFielddf_SetCursorPosition(); #else #if NeedWidePrototypes #define WIDE_PROTOTYPE int #else #define WIDE_PROTOTYPE Boolean #endif extern void _XmDataFieldDeselectSelection(Widget, int, WIDE_PROTOTYPE, Time); extern void _XmDataFieldStartSelection(XmDataFieldWidget, XmTextPosition, XmTextPosition, Time); extern int _XmDataFieldCountBytes(XmDataFieldWidget, wchar_t *, int); extern Boolean _XmDataFielddf_SetDestination(Widget, XmTextPosition, Time); extern void _XmDataFielddf_SetCursorPosition(XmDataFieldWidget, XEvent *, XmTextPosition, WIDE_PROTOTYPE, WIDE_PROTOTYPE); #undef WIDE_PROTOTYPE #endif /* _NO_PROTO */ /* ARGSUSED */ static void #ifdef _NO_PROTO InsertSelection( w, closure, seltype, type, value, length, format ) Widget w ; XtPointer closure ; Atom *seltype ; Atom *type ; XtPointer value ; unsigned long *length ; int *format ; #else InsertSelection( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format ) #endif /* _NO_PROTO */ { _XmInsertSelect *insert_select = (_XmInsertSelect *) closure; XmDataFieldWidget tf = (XmDataFieldWidget) w; XmTextPosition left = 0; XmTextPosition right = 0; Boolean replace_res = False; Boolean dest_disjoint = False; wchar_t * wc_value; char * temp; int num_chars = 0; Atom COMPOUND_TEXT = XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); char * total_tmp_value = NULL; XTextProperty tmp_prop; char **tmp_value; int num_vals; int malloc_size = 0; int i, status = 0; XmAnyCallbackStruct cb; if (!value) { insert_select->done_status = True; return; } /* Don't do replace if there is not text to add */ if (*(char *) value == (char)'\0' || *length == 0){ XtFree((char *)value); insert_select->done_status = True; return; } if (insert_select->select_type == XmPRIM_SELECT) { if (!XmDataFieldGetSelectionPosition (w, &left, &right) || left == right) { XBell(XtDisplay(w), 0); XtFree((char *)value); insert_select->done_status = True; insert_select->success_status = False; return; } } else if (insert_select->select_type == XmDEST_SELECT) { if (XmDataFieldGetSelectionPosition (w, &left, &right) && left != right) { if ( TextF_CursorPosition(tf) < left || TextF_CursorPosition(tf) > right || !XmTextF_pending_delete(tf)) { left = right = TextF_CursorPosition(tf); dest_disjoint = True; } } else left = right = TextF_CursorPosition(tf); } if (*type == COMPOUND_TEXT || *type == XA_STRING) { tmp_prop.value = (unsigned char *) value; tmp_prop.encoding = *type; tmp_prop.format = *format; tmp_prop.nitems = *length; num_vals = 0; status = XmbTextPropertyToTextList(XtDisplay(w), &tmp_prop, &tmp_value, &num_vals); /* if no conversion, num_vals won't change */ /* status >0 if some characters can't be converted; continue anyway */ if (num_vals && (status == Success || status > 0)) { for (i = 0; i < num_vals ; i++) malloc_size += strlen(tmp_value[i]); total_tmp_value = XtMalloc ((unsigned) malloc_size + 1); total_tmp_value[0] = '\0'; for (i = 0; i < num_vals ; i++) strcat(total_tmp_value, tmp_value[i]); XFreeStringList(tmp_value); } if (XmTextF_max_char_size(tf) == 1) { replace_res = _XmDataFieldReplaceText(tf, (XEvent *) insert_select->event, left, right, total_tmp_value, malloc_size, True); } else { /* must convert to wchar_t before passing to Replace */ wc_value = (wchar_t *)XtMalloc((unsigned) (1 + malloc_size) * sizeof(wchar_t)); num_chars = mbstowcs(wc_value, total_tmp_value, 1 + malloc_size); replace_res = _XmDataFieldReplaceText(tf, (XEvent *) insert_select->event, left, right, (char*) wc_value, num_chars, True); XtFree((char *)wc_value); } XtFree(total_tmp_value); } else { /* it must be either TEXT or codeset of the locale */ if (XmTextF_max_char_size(tf) == 1) { /* NOTE: casting *length could result in a truncated long. */ replace_res = _XmDataFieldReplaceText(tf, (XEvent *)insert_select->event, left, right, (char *)value, (unsigned)*length, True); } else { temp = XtMalloc((unsigned) *length + 1); /* NOTE: casting *length could result in a truncated long. */ (void)memcpy((void*)temp, (void*)value, (unsigned)*length); temp[*length] = '\0'; wc_value = (wchar_t*)XtMalloc((unsigned) (*length + 1) * sizeof(wchar_t)); /* NOTE: casting *length could result in a truncated long. */ num_chars = mbstowcs(wc_value, temp, (unsigned)*length + 1); replace_res = _XmDataFieldReplaceText(tf, (XEvent *) insert_select->event, left, right, (char*) wc_value, num_chars, True); XtFree(temp); XtFree((char *)wc_value); } } if (!replace_res) { insert_select->success_status = False; } else { insert_select->success_status = True; if (!XmTextF_add_mode(tf)) XmTextF_prim_anchor(tf) = left; XmTextF_pending_off(tf) = True; if (XmTextF_max_char_size(tf) == 1) { _XmDataFielddf_SetCursorPosition(tf, NULL, (XmTextPosition)(left + *length), False, True); } else { _XmDataFielddf_SetCursorPosition(tf, NULL, left + num_chars, False, True); } (void) _XmDataFielddf_SetDestination(w, TextF_CursorPosition(tf), insert_select->event->time); if (insert_select->select_type == XmDEST_SELECT) { if (left != right) { if (!dest_disjoint) { _XmDataFieldStartSelection(tf, TextF_CursorPosition(tf), TextF_CursorPosition(tf), insert_select->event->time); } else { if (!XmTextF_add_mode(tf)) { _XmDataFieldStartSelection(tf, TextF_CursorPosition(tf), TextF_CursorPosition(tf), insert_select->event->time); } } } } cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *)insert_select->event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); } XtFree((char *)value); value = NULL; insert_select->done_status = True; } /* ARGSUSED */ static void #ifdef _NO_PROTO HandleInsertTargets( w, closure, seltype, type, value, length, format ) Widget w ; XtPointer closure ; Atom *seltype ; Atom *type ; XtPointer value ; unsigned long *length ; int *format ; #else HandleInsertTargets( Widget w, XtPointer closure, Atom *seltype, Atom *type, XtPointer value, unsigned long *length, int *format ) #endif /* _NO_PROTO */ { _XmInsertSelect *insert_select = (_XmInsertSelect *) closure; Atom TEXT = XmInternAtom(XtDisplay(w), "TEXT", False); Atom COMPOUND_TEXT = XmInternAtom(XtDisplay(w),"COMPOUND_TEXT", False); Atom target = TEXT; Atom *atom_ptr; int i; if (!length) { XtFree((char *)value); insert_select->done_status = True; return; /* Supports no targets, so don't bother sending anything */ } atom_ptr = (Atom *)value; for (i = 0; i < *length; i++, atom_ptr++) { if (*atom_ptr == COMPOUND_TEXT) { target = *atom_ptr; break; } else if (*atom_ptr == XA_STRING) target = *atom_ptr; } XtGetSelectionValue(w, *seltype, target, InsertSelection, (XtPointer) insert_select, insert_select->event->time); } /* * Converts requested target of insert selection. */ /*--------------------------------------------------------------------------+*/ static Boolean #ifdef _NO_PROTO ConvertInsertSelection( w, selection, type, value, length, format, locale_atom ) Widget w ; Atom *selection ; Atom *type ; XtPointer *value ; unsigned long *length ; int *format ; Atom locale_atom; #else ConvertInsertSelection( Widget w, Atom *selection, Atom *type, XtPointer *value, unsigned long *length, int *format, Atom locale_atom) #endif /* _NO_PROTO */ { XtAppContext app = XtWidgetToApplicationContext(w); XSelectionRequestEvent * req_event; static unsigned long old_serial = 0; Atom TARGETS = XmInternAtom(XtDisplay(w), "TARGETS", False); Atom MOTIF_DESTINATION = XmInternAtom(XtDisplay(w), "MOTIF_DESTINATION", False); Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes; unsigned char *prop = NULL; _XmInsertSelect insert_select; _XmTextInsertPair *pair; insert_select.done_status = False; insert_select.success_status = False; if (*selection == MOTIF_DESTINATION) { insert_select.select_type = XmDEST_SELECT; } else if (*selection == XA_PRIMARY) { insert_select.select_type = XmPRIM_SELECT; } req_event = XtGetSelectionRequest(w, *selection, NULL); insert_select.event = req_event; /* Work around for intrinsics selection bug */ if (old_serial != req_event->serial) old_serial = req_event->serial; else return False; if (XGetWindowProperty(req_event->display, req_event->requestor, req_event->property, 0L, 10000000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes, &prop) != Success) return FALSE; pair = (_XmTextInsertPair *)prop; if (pair->target != locale_atom) { /* * Make selection request to find out which targets * the selection can provide. */ XtGetSelectionValue(w, pair->selection, TARGETS, HandleInsertTargets, (XtPointer) &insert_select, req_event->time); } else { /* * Make selection request to replace the selection * with the insert selection. */ XtGetSelectionValue(w, pair->selection, pair->target, InsertSelection, (XtPointer) &insert_select, req_event->time); } /* * Make sure the above selection request is completed * before returning from the convert proc. */ for (;;) { XEvent event; if (insert_select.done_status) break; XtAppNextEvent(app, &event); XtDispatchEvent(&event); } *type = XmInternAtom(XtDisplay(w), "NULL", False); *format = 8; *value = NULL; *length = 0; if( prop != NULL ) { XFree((void *)prop); } return (insert_select.success_status); } /* ARGSUSED */ Boolean #ifdef _NO_PROTO _XmDataFieldConvert( w, selection, target, type, value, length, format ) Widget w ; Atom *selection ; Atom *target ; Atom *type ; XtPointer *value ; unsigned long *length ; int *format ; #else _XmDataFieldConvert( Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf; Atom MOTIF_DESTINATION = XmInternAtom(XtDisplay(w), "MOTIF_DESTINATION", False); Atom INSERT_SELECTION = XmInternAtom(XtDisplay(w), "INSERT_SELECTION", False); Atom DELETE = XmInternAtom(XtDisplay(w), "DELETE", False); Atom CLIPBOARD = XmInternAtom(XtDisplay(w), "CLIPBOARD", False); Atom LENGTH = XmInternAtom(XtDisplay(w), "LENGTH", False); Atom TARGETS = XmInternAtom(XtDisplay(w), "TARGETS", False); Atom MULTIPLE = XmInternAtom(XtDisplay(w), "MULTIPLE", False); Atom TEXT = XmInternAtom(XtDisplay(w), "TEXT", False); Atom COMPOUND_TEXT = XmInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); Atom TIMESTAMP = XmInternAtom(XtDisplay(w), "TIMESTAMP", False); Atom MOTIF_DROP = XmInternAtom(XtDisplay(w), "_MOTIF_DROP", False); Atom CS_OF_LOCALE; /* to be initialized by XmbTextListToTextProperty */ XSelectionRequestEvent * req_event; Boolean has_selection = False; XmTextPosition left = 0; XmTextPosition right = 0; Boolean is_primary; Boolean is_secondary; Boolean is_destination; Boolean is_drop; int target_count = 0; XTextProperty tmp_prop; int ret_status = 0; int MAX_TARGS = 20; char * tmp_value; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ XtPointer c_ptr; Arg args[1]; XmAnyCallbackStruct cb; if (*selection == MOTIF_DROP) { XtSetArg (args[0], XmNclientData, &c_ptr); XtGetValues (w, args, 1); tf = (XmDataFieldWidget) c_ptr; } else tf = (XmDataFieldWidget) w; if (tf == NULL) return False; ret_status = XmbTextListToTextProperty(XtDisplay(w), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (ret_status == Success) CS_OF_LOCALE = tmp_prop.encoding; else CS_OF_LOCALE = (Atom) 9999; /* XmbTextList... should always be able * to convert XPCS characters; but in * case its broken, this prevents a core * dump. */ if ((*selection == XA_PRIMARY) || (*selection == CLIPBOARD)) { has_selection = XmTextF_has_primary(tf); left = XmTextF_prim_pos_left(tf); right = XmTextF_prim_pos_right(tf); is_primary = True; is_secondary = is_destination = is_drop = False; } else if (*selection == MOTIF_DESTINATION) { has_selection = XmTextF_has_destination(tf); is_destination = True; is_secondary = is_primary = is_drop = False; } else if (*selection == XA_SECONDARY) { has_selection = XmTextF_has_secondary(tf); left = XmTextF_sec_pos_left(tf); right = XmTextF_sec_pos_right(tf); is_secondary = True; is_destination = is_primary = is_drop = False; } else if (*selection == MOTIF_DROP) { has_selection = XmTextF_has_primary(tf); left = XmTextF_prim_pos_left(tf); right = XmTextF_prim_pos_right(tf); is_drop = True; is_destination = is_primary = is_secondary = False; } else return False; /* * TARGETS identifies what targets the textfield widget can * provide data for. */ if (*target == TARGETS) { Atom *targs = (Atom *)XtMalloc((unsigned) (MAX_TARGS * sizeof(Atom))); *value = (XtPointer) targs; *targs++ = CS_OF_LOCALE; target_count++; *targs++ = TARGETS; target_count++; *targs++ = LENGTH; target_count++; *targs++ = MULTIPLE; target_count++; *targs++ = TIMESTAMP; target_count++; if (is_primary || is_destination) *targs++ = INSERT_SELECTION; target_count++; if (is_primary || is_secondary || is_drop) { *targs++ = COMPOUND_TEXT; target_count++; *targs++ = TEXT; target_count++; *targs++ = XA_STRING; target_count++; } if (is_primary || is_drop) { *targs++ = DELETE; target_count++; } *type = XA_ATOM; *length = (target_count*sizeof(Atom)) >> 2; /*convert to work count */ *format = 32; } else if (*target == TIMESTAMP) { Time *timestamp; timestamp = (Time *) XtMalloc(sizeof(Time)); if (is_primary) *timestamp = XmTextF_prim_time(tf); else if (is_destination) *timestamp = XmTextF_dest_time(tf); else if (is_secondary) *timestamp = XmTextF_sec_time(tf); else if (is_drop) *timestamp = XmTextF_prim_time(tf); *value = (XtPointer) timestamp; *type = XA_INTEGER; *length = sizeof(Time); *format = 32; } else if (*target == XA_STRING) { *type = (Atom) XA_STRING; *format = 8; if (is_destination || !has_selection) return False; /* put a char* value into tmp_value, then convert to 8859.1 */ if (XmTextF_max_char_size(tf) != 1) { int stat ; /* NOTE: casting (right - left) could result in a truncated long. */ *length = _XmDataFieldCountBytes(tf, TextF_WcValue(tf) + left, (int)(right - left)); tmp_value = XtMalloc((unsigned) *length + 1); stat = wcstombs(tmp_value, TextF_WcValue(tf) + left, (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ if (stat < 0) /* wcstombs will return neg value on conv failure */ *length = 0; else *length = (unsigned long) stat ; } else { *length = right - left; tmp_value = XtMalloc((unsigned) *length + 1); /* get the selection value */ (void)memcpy((void*)tmp_value, (void*)(TextF_Value(tf) + left), (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ } tmp_value[*length] = '\0'; /* convert tmp_value to 8859.1 */ ret_status = XmbTextListToTextProperty(XtDisplay(w), &tmp_value, 1, (XICCEncodingStyle)XStringStyle, &tmp_prop); XtFree(tmp_value); if (ret_status == Success || ret_status > 0){ *value = (XtPointer) tmp_prop.value; *length = tmp_prop.nitems; } else { *value = NULL; *length = 0; return False; } } else if (*target == TEXT || *target == CS_OF_LOCALE) { *type = CS_OF_LOCALE; *format = 8; if (is_destination || !has_selection) return False; if (XmTextF_max_char_size(tf) != 1) { int stat ; /* NOTE: casting (right - left) could result in a truncated long. */ *length = _XmDataFieldCountBytes(tf, TextF_WcValue(tf) + left, (int)(right - left)); *value = XtMalloc((unsigned) *length + 1); stat = wcstombs((char *)*value, TextF_WcValue(tf) + left, (unsigned)*length); /* NOTE: casting *length could result in a truncated long */ if (stat < 0) /* wcstombs return neg value on conv failure */ *length = 0; else *length = (unsigned long) stat ; } else { *length = right - left; *value = XtMalloc((unsigned) *length + 1); /* get the selection value */ (void)memcpy((void*)*value, (void*)(TextF_Value(tf) + left), (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ } (*(char **)value)[*length]='\0'; } else if (*target == COMPOUND_TEXT) { *type = COMPOUND_TEXT; *format = 8; if (is_destination || !has_selection) return False; if (XmTextF_max_char_size(tf) != 1) { int stat ; /* convert to char* before converting to CT. NOTE: casting * (right - left) could result in a truncated long. */ *length = _XmDataFieldCountBytes(tf, TextF_WcValue(tf) + left, (int)(right - left)); tmp_value = XtMalloc((unsigned) *length + 1); stat = wcstombs(tmp_value, TextF_WcValue(tf) + left, (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ if (stat < 0) /* wcstombs will return neg value on conv failure */ *length = 0; else *length = (unsigned long) stat ; } else { /* malloc the space and copy the data to be converted */ *length = right - left; tmp_value = XtMalloc((unsigned) *length + 1); /* get the selection value */ (void)memcpy((void*)tmp_value, (void*)(TextF_Value(tf) + left), (unsigned)*length); /* NOTE: casting *length could result in a truncated long. */ } tmp_value[*length] = '\0'; /* Convert to compound text */ ret_status = XmbTextListToTextProperty(XtDisplay(w), &tmp_value, 1, (XICCEncodingStyle)XCompoundTextStyle, &tmp_prop); XtFree(tmp_value); if (ret_status == Success || ret_status > 0){ *length = tmp_prop.nitems; *value = (XtPointer)tmp_prop.value; } else { *value = NULL; *length = 0; return False; } /* * Provide data for INSERT_SELECTION requests, used in * swaping selections. */ } else if (*target == INSERT_SELECTION) { if (is_secondary) return False; return (ConvertInsertSelection((Widget) tf, selection, type, value, length, format, CS_OF_LOCALE)); /* Delete the selection */ } else if (*target == DELETE) { XmTextPosition left, right; Boolean move_cursor = True; if (!(is_primary || is_drop)) return False; if (is_drop) { Atom real_selection_atom; /* DND hides the selection atom from us */ XtSetArg(args[0], XmNiccHandle, &real_selection_atom); XtGetValues(w, args, 1); /* 'w' is the drag context */ req_event = XtGetSelectionRequest(w, real_selection_atom, NULL); } else { req_event = XtGetSelectionRequest((Widget) tf, *selection, NULL); } left = XmTextF_prim_pos_left(tf); right = XmTextF_prim_pos_right(tf); if (is_drop) { if (_XmDataFieldGetDropReciever((Widget)tf) == (Widget) tf) move_cursor = False; } else { if (req_event->requestor == XtWindow((Widget)tf)) move_cursor = False; } _XmDataFieldStartSelection(tf, XmTextF_prim_anchor(tf), XmTextF_prim_anchor(tf), req_event->time); if (!_XmDataFieldReplaceText(tf, (XEvent *) req_event, left, right, NULL, 0, move_cursor)) { XmTextF_has_primary(tf) = True; return False; } cb.reason = XmCR_VALUE_CHANGED; cb.event = (XEvent *) req_event; XtCallCallbackList((Widget) tf, TextF_ValueChangedCallback(tf), (XtPointer) &cb); XmTextF_has_primary(tf) = True; if (XmTextF_has_destination(tf)) XmTextF_prim_anchor(tf) = TextF_CursorPosition(tf); *type = XmInternAtom(XtDisplay(w), "NULL", False); *value = NULL; *length = 0; *format = 8; } else if (*target == LENGTH) { long *len = (long*)XtMalloc(sizeof(long)); if (right > left) *len = right - left; else *len = left - right; *value = (XtPointer)len; *type = XA_INTEGER; *length = 1L; *format = 32; } else /* unknown selection type */ return FALSE; return TRUE; } /* ARGSUSED */ void #ifdef _NO_PROTO _XmDataFieldLoseSelection( w, selection ) Widget w ; Atom *selection ; #else _XmDataFieldLoseSelection( Widget w, Atom *selection ) #endif /* _NO_PROTO */ { XmDataFieldWidget tf = (XmDataFieldWidget) w; Atom MOTIF_DESTINATION = XmInternAtom(XtDisplay(w), "MOTIF_DESTINATION", False); /* Losing Primary Selection */ if (*selection == XA_PRIMARY && XmTextF_has_primary(tf)) { XmAnyCallbackStruct cb; _XmDataFieldDeselectSelection(w, False, 0, XtLastTimestampProcessed(XtDisplay(w))); cb.reason = XmCR_LOSE_PRIMARY; cb.event = NULL; XtCallCallbackList(w, XmTextF_lose_primary_callback(tf), (XtPointer) &cb); /* Losing Destination Selection */ } else if (*selection == MOTIF_DESTINATION) { XmTextF_has_destination(tf) = False; if (XmTextF_has_rect(tf)) _XmDataFieldSetClipRect(tf); /* if we have focus, we have a valid putback area. If we don't have * focus, don't want to update the putback with the destination cursor * image. */ XmTextF_refresh_ibeam_off(tf) = False; _XmDataFieldDrawInsertionPoint(tf, False); XmTextF_blink_on(tf) = True; _XmDataFieldDrawInsertionPoint(tf, True); /* Losing Secondary Selection */ } else if (*selection == XA_SECONDARY && XmTextF_has_secondary(tf)){ _XmDataFieldSetSel2(w, 0, 0, True, XtLastTimestampProcessed(XtDisplay(w))); } } motif-2.3.8/lib/Xm/FileSB.c0000644000175000017500000035311013145162623012173 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: FileSB.c /main/21 1997/09/26 13:38:52 bill $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include "XmI.h" #ifndef X_NOT_STDC_ENV #include #endif #include "RepTypeI.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "BulletinBI.h" #include "GeoUtilsI.h" #include "ManagerI.h" #include "MessagesI.h" #include "SelectioBI.h" #include "TraversalI.h" #include "VendorSEI.h" #include "XmosI.h" #include "XmStringI.h" #include #define MESSAGE0 _XmMMsgMotif_0001 #define FILES_STRING _XmMMsgResource_0007 #define FILTER_APPLY_STRING _XmMMsgResource_0010 #define IsButton(w) \ (((XtPointer) XmeTraitGet((XtPointer) XtClass((w)), XmQTactivatable) != NULL)) #define IsAutoButton(fsb, w) ( \ w == SB_OkButton(fsb) || \ w == SB_ApplyButton(fsb) || \ w == SB_CancelButton(fsb) || \ w == SB_HelpButton(fsb)) #define SetupWorkArea(fsb) \ if (_XmGeoSetupKid (boxPtr, SB_WorkArea(fsb))) \ { \ layoutPtr->space_above = vspace; \ vspace = BB_MarginHeight(fsb); \ boxPtr += 2 ; \ ++layoutPtr ; \ } typedef struct { XmKidGeometry filter_label ; XmKidGeometry filter_text ; XmKidGeometry dir_list_label ; XmKidGeometry file_list_label ; Dimension prefer_width ; Dimension delta_width ; } FS_GeoExtensionRec, *FS_GeoExtension ; /******** Static Function Declarations ********/ static void ClassPartInitialize( WidgetClass fsc) ; static void Initialize( Widget rw, Widget nw, ArgList args_in, Cardinal *num_args) ; static void Destroy( Widget fsb) ; static void DeleteChild( Widget w) ; static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) ; static void ChangeManaged( Widget wid) ; static void FSBCreateFilterLabel( XmFileSelectionBoxWidget fsb) ; static void FSBCreateDirListLabel( XmFileSelectionBoxWidget fsb) ; static void FSBCreateDirList( XmFileSelectionBoxWidget fsb) ; static void FSBCreateFilterText( XmFileSelectionBoxWidget fs) ; static void FSBCreateDirText( XmFileSelectionBoxWidget fs) ; static void FSBCreateDirTextLabel( XmFileSelectionBoxWidget fs) ; static XmGeoMatrix FileSBGeoMatrixCreate( Widget wid, Widget instigator, XtWidgetGeometry *desired) ; static Boolean FileSelectionBoxNoGeoRequest( XmGeoMatrix geoSpec) ; static void ListLabelFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, XmKidGeometry rowPtr) ; static void ListFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, XmKidGeometry rowPtr) ; static void UpdateHorizPos( Widget wid) ; static void FileSearchProc( Widget w, XtPointer sd) ; static void QualifySearchDataProc( Widget w, XtPointer sd, XtPointer qsd) ; static void FileSelectionBoxUpdate( XmFileSelectionBoxWidget fs, XmFileSelectionBoxCallbackStruct *searchData) ; static void DirSearchProc( Widget w, XtPointer sd) ; static void ListCallback( Widget wid, XtPointer client_data, XtPointer call_data) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args_in, Cardinal *num_args) ; static void FSBGetDirectory( Widget fs, int resource, XtArgVal *value) ; static void FSBGetDirSpec( Widget fs, int resource, XtArgVal *value) ; static void FSBGetNoMatchString( Widget fs, int resource, XtArgVal *value) ; static void FSBGetPattern( Widget fs, int resource, XtArgVal *value) ; static void FSBGetFilterLabelString( Widget fs, int resource_offset, XtArgVal *value) ; static void FSBGetDirListLabelString( Widget fs, int resource_offset, XtArgVal *value) ; static void FSBGetDirListItems( Widget fs, int resource_offset, XtArgVal *value) ; static void FSBGetDirListItemCount( Widget fs, int resource_offset, XtArgVal *value) ; static void FSBGetListItems( Widget fs, int resource_offset, XtArgVal *value) ; static void FSBGetListItemCount( Widget fs, int resource_offset, XtArgVal *value) ; static void FSBGetDirMask( Widget fs, int resource_offset, XtArgVal *value) ; static Widget GetActiveText( XmFileSelectionBoxWidget fsb, XEvent *event) ; static void FileSelectionBoxUpOrDown( Widget wid, XEvent *event, String *argv, Cardinal *argc) ; static void FileSelectionBoxRestore( Widget wid, XEvent *event, String *argv, Cardinal *argc) ; static void FileSelectionBoxFocusMoved( Widget wid, XtPointer client_data, XtPointer data) ; static void FileSelectionPB( Widget wid, XtPointer which_button, XtPointer call_data) ; static void FSBConvert( Widget wid, XtPointer client_data, XtPointer cb_struct); static void FilterFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, XmKidGeometry rowPtr) ; /******** End Static Function Declarations ********/ /* * transfer vector from translation manager action names to * address of routines */ static XtActionsRec ActionsTable[] = { { "UpOrDown", FileSelectionBoxUpOrDown }, /* Motif 1.0 */ { "SelectionBoxUpOrDown", FileSelectionBoxUpOrDown }, { "SelectionBoxRestore", FileSelectionBoxRestore }, }; /*---------------------------------------------------*/ /* widget resources */ /*---------------------------------------------------*/ static XtResource resources[] = { /* fileselection specific resources */ { XmNdirectory, XmCDirectory, XmRXmString, sizeof( XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.directory), XmRXmString, (XtPointer) NULL /* This will initialize to the current */ }, /* directory, because of XmNdirMask. */ { XmNpattern, XmCPattern, XmRXmString, sizeof( XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.pattern), XmRImmediate, (XtPointer) NULL /* This really initializes to "*", because */ }, /* of interaction with "XmNdirMask". */ { XmNdirListLabelString, XmCDirListLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_list_label_string), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNdirListItems, XmCDirListItems, XmRXmStringTable, sizeof( XmStringTable), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_list_items), XmRImmediate, (XtPointer) NULL }, { XmNdirListItemCount, XmCDirListItemCount, XmRInt, sizeof( int), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_list_item_count), XmRImmediate, (XtPointer) XmUNSPECIFIED_COUNT }, { XmNfilterLabelString, XmCFilterLabelString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.filter_label_string), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNdirMask, XmCDirMask, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_mask), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNnoMatchString, XmCNoMatchString, XmRXmString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.no_match_string), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNqualifySearchDataProc, XmCQualifySearchDataProc, XmRProc, sizeof(XtProc), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.qualify_search_data_proc), XmRImmediate, (XtPointer) QualifySearchDataProc }, { XmNdirSearchProc, XmCDirSearchProc, XmRProc, sizeof(XtProc), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_search_proc), XmRImmediate, (XtPointer) DirSearchProc }, { XmNfileSearchProc, XmCFileSearchProc, XmRProc, sizeof(XtProc), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.file_search_proc), XmRImmediate, (XtPointer) FileSearchProc }, { XmNfileTypeMask, XmCFileTypeMask, XmRFileTypeMask, sizeof( unsigned char), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.file_type_mask), XmRImmediate, (XtPointer) XmFILE_REGULAR }, { XmNlistUpdated, XmCListUpdated, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.list_updated), XmRImmediate, (XtPointer) TRUE }, { XmNdirectoryValid, XmCDirectoryValid, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.directory_valid), XmRImmediate, (XtPointer) TRUE }, /* superclass resource default overrides */ { XmNdirSpec, XmCDirSpec, XmRXmString, sizeof( XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, selection_box.text_string), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNautoUnmanage, XmCAutoUnmanage, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmFileSelectionBoxRec, bulletin_board.auto_unmanage), XmRImmediate, (XtPointer) FALSE }, { XmNfileListLabelString, XmCFileListLabelString, XmRXmString, sizeof(XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, selection_box.list_label_string), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNapplyLabelString, XmCApplyLabelString, XmRXmString, sizeof(XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, selection_box.apply_label_string), XmRImmediate, (XtPointer) XmUNSPECIFIED }, { XmNdialogType, XmCDialogType, XmRSelectionType, sizeof(unsigned char), XtOffsetOf( struct _XmFileSelectionBoxRec, selection_box.dialog_type), XmRImmediate, (XtPointer) XmDIALOG_FILE_SELECTION }, { XmNfileListItems, XmCItems, XmRXmStringTable, sizeof (XmString *), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_items), XmRImmediate, NULL }, { XmNfileListItemCount, XmCItemCount, XmRInt, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_item_count), XmRImmediate, (XtPointer) XmUNSPECIFIED_COUNT }, { XmNpathMode, XmCPathMode, XmRPathMode, sizeof(XtEnum), XtOffsetOf(XmFileSelectionBoxRec, file_selection_box.path_mode), XmRImmediate, (XtPointer) XmPATH_MODE_FULL }, { XmNfileFilterStyle, XmCFileFilterStyle, XmRFileFilterStyle, sizeof(XtEnum), XtOffsetOf(XmFileSelectionBoxRec, file_selection_box.file_filter_style), XmRImmediate, (XtPointer) XmFILTER_NONE }, { XmNdirTextLabelString, XmCDirTextLabelString, XmRXmString, sizeof(XmString), XtOffsetOf(XmFileSelectionBoxRec, file_selection_box.dir_text_label_string), XmRImmediate, (XtPointer) NULL }, }; static XmSyntheticResource syn_resources[] = { { XmNdirectory, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.directory), FSBGetDirectory, (XmImportProc)NULL }, { XmNdirListLabelString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_list_label_string), FSBGetDirListLabelString, (XmImportProc)NULL }, { XmNdirListItems, sizeof( XmString *), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_list_items), FSBGetDirListItems, (XmImportProc)NULL }, { XmNdirListItemCount, sizeof( int), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_list_item_count), FSBGetDirListItemCount, (XmImportProc)NULL }, { XmNfilterLabelString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.filter_label_string), FSBGetFilterLabelString, (XmImportProc)NULL }, { XmNdirMask, sizeof( XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.dir_mask), FSBGetDirMask, (XmImportProc)NULL }, { XmNdirSpec, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, selection_box.text_string), FSBGetDirSpec, (XmImportProc)NULL }, { XmNfileListLabelString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, selection_box.list_label_string), _XmSelectionBoxGetListLabelString, (XmImportProc)NULL }, { XmNfileListItems, sizeof (XmString *), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_items), FSBGetListItems, (XmImportProc)NULL }, { XmNfileListItemCount, sizeof(int), XtOffsetOf( struct _XmSelectionBoxRec, selection_box.list_item_count), FSBGetListItemCount, (XmImportProc)NULL }, { XmNnoMatchString, sizeof (XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.no_match_string), FSBGetNoMatchString, (XmImportProc)NULL }, { XmNpattern, sizeof( XmString), XtOffsetOf( struct _XmFileSelectionBoxRec, file_selection_box.pattern), FSBGetPattern, (XmImportProc)NULL }, }; externaldef( xmfileselectionboxclassrec) XmFileSelectionBoxClassRec xmFileSelectionBoxClassRec = { { /* core class record */ /* superclass */ (WidgetClass) &xmSelectionBoxClassRec, /* class_name */ "XmFileSelectionBox", /* widget_size */ sizeof(XmFileSelectionBoxRec), /* class_initialize */ (XtProc)NULL, /* class part init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize hook */ (XtArgsProc)NULL, /* realize */ XtInheritRealize, /* actions */ ActionsTable, /* num_actions */ XtNumber(ActionsTable), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress crossing */ FALSE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ XtInheritResize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ (XtArgsFunc)NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ (XtArgsProc)NULL, /* accept_focus */ (XtAcceptFocusProc)NULL, /* version */ XtVersion, /* callback_private */ (XtPointer)NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ (XtStringProc)NULL, /* extension */ (XtPointer)NULL, }, { /* composite class record */ /* geometry manager */ GeometryManager, /* set changed proc */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ DeleteChild, /* extension */ (XtPointer)NULL, }, { /* constraint class record */ /* no additional resources */ (XtResourceList)NULL, /* num additional resources */ 0, /* size of constraint rec */ 0, /* constraint_initialize */ (XtInitProc)NULL, /* constraint_destroy */ (XtWidgetProc)NULL, /* constraint_setvalue */ (XtSetValuesFunc)NULL, /* extension */ (XtPointer)NULL, }, { /* manager class record */ /* translations */ XtInheritTranslations, /* get_resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* constraint_syn_resources */ (XmSyntheticResource *)NULL, /* num_constraint_syn_resources*/ 0, /* parent_process< */ XmInheritParentProcess, /* extension */ (XtPointer)NULL, }, { /* bulletinBoard class record*/ /* always_install_accelerators*/TRUE, /* geo_matrix_create */ FileSBGeoMatrixCreate, /* focus_moved_proc */ FileSelectionBoxFocusMoved, /* extension */ (XtPointer)NULL, }, { /*selectionbox class record */ /* list_callback */ ListCallback, /* extension */ (XtPointer)NULL, }, { /* fileselection class record*/ /* extension */ (XtPointer)NULL, } }; externaldef( xmfileselectionboxwidgetclass) WidgetClass xmFileSelectionBoxWidgetClass = (WidgetClass)&xmFileSelectionBoxClassRec ; /**************************************************************** * Class Initialization. Sets up accelerators and fast subclassing. ****************/ static void ClassPartInitialize( WidgetClass fsc ) { /****************/ _XmFastSubclassInit( fsc, XmFILE_SELECTION_BOX_BIT) ; return ; } /**************************************************************** * This routine initializes an instance of the file selection widget. * Instance record fields which are shadow resources for child widgets and * which are of an allocated type are set to NULL after they are used, since * the memory identified by them is not owned by the File Selection Box. ****************/ /*ARGSUSED*/ static void Initialize( Widget rw, /* unused */ Widget nw, ArgList args_in, /* unused */ Cardinal *num_args ) /* unused */ { XmFileSelectionBoxWidget new_w = (XmFileSelectionBoxWidget) nw ; Arg args[16] ; int numArgs ; XmFileSelectionBoxCallbackStruct searchData ; XmString local_xmstring ; /****************/ FS_StateFlags( new_w) = 0 ; FS_PrevDirModTime( new_w) = 0; /* Here we have now to take care of XmUNSPECIFIED (CR 4856). */ if (new_w->selection_box.list_label_string == (XmString) XmUNSPECIFIED) { local_xmstring = XmStringCreate(FILES_STRING, XmFONTLIST_DEFAULT_TAG); numArgs = 0 ; XtSetArg( args[numArgs], XmNlabelString, local_xmstring) ; ++numArgs ; XtSetValues( SB_ListLabel( new_w), args, numArgs) ; XmStringFree(local_xmstring); new_w->selection_box.list_label_string = NULL ; } if (new_w->selection_box.apply_label_string == (XmString) XmUNSPECIFIED) { local_xmstring = XmStringCreate(FILTER_APPLY_STRING, XmFONTLIST_DEFAULT_TAG); numArgs = 0 ; XtSetArg( args[numArgs], XmNlabelString, local_xmstring) ; ++numArgs ; XtSetValues( SB_ApplyButton( new_w), args, numArgs) ; XmStringFree(local_xmstring); new_w->selection_box.list_label_string = NULL ; } /* must set adding_sel_widgets to avoid adding these widgets to * selection work area */ SB_AddingSelWidgets( new_w) = TRUE ; if( !(SB_ListLabel( new_w)) ) { _XmSelectionBoxCreateListLabel( (XmSelectionBoxWidget) new_w) ; } if( !(SB_List( new_w)) ) { _XmSelectionBoxCreateList( (XmSelectionBoxWidget) new_w) ; } if( !(SB_SelectionLabel( new_w)) ) { _XmSelectionBoxCreateSelectionLabel( (XmSelectionBoxWidget) new_w) ; } if( !(SB_Text( new_w)) ) { _XmSelectionBoxCreateText( (XmSelectionBoxWidget) new_w) ; } if( !(SB_ApplyButton( new_w)) ) { _XmSelectionBoxCreateApplyButton( (XmSelectionBoxWidget) new_w) ; } if( !(SB_OkButton( new_w)) ) { _XmSelectionBoxCreateOkButton( (XmSelectionBoxWidget) new_w) ; } if( !(SB_CancelButton( new_w)) ) { _XmSelectionBoxCreateCancelButton( (XmSelectionBoxWidget) new_w) ; } if( !(SB_HelpButton( new_w)) ) { _XmSelectionBoxCreateHelpButton( (XmSelectionBoxWidget) new_w) ; } FSBCreateFilterLabel( new_w) ; FS_FilterLabelString( new_w) = NULL ; FSBCreateDirListLabel( new_w) ; FS_DirListLabelString( new_w) = NULL ; FSBCreateFilterText( new_w); FSBCreateDirList( new_w) ; if( FS_PathMode( new_w) == XmPATH_MODE_RELATIVE ) { FSBCreateDirTextLabel( new_w) ; FSBCreateDirText( new_w) ; } else { FS_DirTextLabel( new_w) = NULL ; FS_DirText( new_w) = NULL; } /* Since the DirSearchProc is going to be run during initialize, * and since it has the responsibility to manage the directory list and * the filter text, any initial values of the following resources can * be ignored, since they will be immediately over-written. */ FS_DirListItems( new_w) = NULL ; /* Set/Get Values only.*/ FS_DirListItemCount( new_w) = XmUNSPECIFIED_COUNT ; /* Set/Get Values only.*/ SB_AddingSelWidgets( new_w) = FALSE; /* Remove the activate callbacks that our superclass * may have attached to these buttons */ XtRemoveAllCallbacks( SB_ApplyButton( new_w), XmNactivateCallback) ; XtRemoveAllCallbacks( SB_OkButton( new_w), XmNactivateCallback) ; XtRemoveAllCallbacks( SB_CancelButton( new_w), XmNactivateCallback) ; XtRemoveAllCallbacks( SB_HelpButton( new_w), XmNactivateCallback) ; XtAddCallback( SB_ApplyButton( new_w), XmNactivateCallback, FileSelectionPB, (XtPointer) XmDIALOG_APPLY_BUTTON) ; XtAddCallback( SB_OkButton( new_w), XmNactivateCallback, FileSelectionPB, (XtPointer) XmDIALOG_OK_BUTTON) ; XtAddCallback( SB_CancelButton( new_w), XmNactivateCallback, FileSelectionPB, (XtPointer) XmDIALOG_CANCEL_BUTTON) ; XtAddCallback( SB_HelpButton( new_w), XmNactivateCallback, FileSelectionPB, (XtPointer) XmDIALOG_HELP_BUTTON) ; if( FS_NoMatchString( new_w) == (XmString) XmUNSPECIFIED) { FS_NoMatchString( new_w) = XmStringConcatAndFree (XmStringDirectionCreate(XmSTRING_DIRECTION_L_TO_R), XmStringCreate(" [ ] ", XmFONTLIST_DEFAULT_TAG)); } else { FS_NoMatchString( new_w) = XmStringCopy( FS_NoMatchString( new_w)) ; } searchData.reason = XmCR_NONE ; searchData.event = NULL ; searchData.value = NULL ; searchData.length = 0 ; searchData.mask = NULL ; searchData.mask_length = 0 ; searchData.dir = NULL ; searchData.dir_length = 0 ; searchData.pattern = NULL ; searchData.pattern_length = 0 ; /* The XmNdirSpec resource will be loaded into the Text widget by * the Selection Box (superclass) Initialize routine. It will be * picked-up there by the XmNqualifySearchDataProc routine to fill * in the value field of the search data. */ if(FS_DirMask( new_w) != (XmString) XmUNSPECIFIED ) { searchData.mask = XmStringCopy(FS_DirMask( new_w)) ; } else { searchData.mask = XmStringCreate("*", XmFONTLIST_DEFAULT_TAG); } searchData.mask_length = XmStringLength( searchData.mask) ; /* The DirMask field will be set after subsequent call to * the DirSearchProc. Set field to NULL to prevent freeing of * memory owned by request. */ FS_DirMask( new_w) = (XmString) XmUNSPECIFIED ; if( FS_Directory( new_w) ) { searchData.dir = XmStringCopy( FS_Directory( new_w)) ; searchData.dir_length = XmStringLength( searchData.dir) ; /* The Directory field will be set after subsequent call to * the DirSearchProc. Set field to NULL to prevent freeing of * memory owned by request. */ FS_Directory( new_w) = NULL ; } if( FS_Pattern( new_w) ) { searchData.pattern = XmStringCopy( FS_Pattern( new_w)) ; searchData.pattern_length = XmStringLength( searchData.pattern) ; /* The Pattern field will be set after subsequent call to * the DirSearchProc. Set field to NULL to prevent freeing of * memory owned by request. */ FS_Pattern( new_w) = NULL ; } if( !FS_QualifySearchDataProc( new_w) ) { FS_QualifySearchDataProc( new_w) = QualifySearchDataProc ; } if( !FS_DirSearchProc( new_w) ) { FS_DirSearchProc( new_w) = DirSearchProc ; } if( !FS_FileSearchProc( new_w) ) { FS_FileSearchProc( new_w) = FileSearchProc ; } FileSelectionBoxUpdate( new_w, &searchData) ; XmStringFree( searchData.mask) ; XmStringFree( searchData.pattern) ; XmStringFree( searchData.dir) ; /* Add Convert callbacks to handle the FILE and FILENAME targets */ XtAddCallback(FS_DirList(new_w), XmNconvertCallback, FSBConvert, (XtPointer) new_w); XtAddCallback(SB_List(new_w), XmNconvertCallback, FSBConvert, (XtPointer) new_w); /* Mark everybody as managed because no one else will. * Only need to do this if we are the instantiated class. */ if( XtClass( new_w) == xmFileSelectionBoxWidgetClass ) { XtManageChildren( new_w->composite.children, new_w->composite.num_children) ; } return ; } /****************************************************************/ static void Destroy( Widget fsb ) { /****************/ XmStringFree( FS_NoMatchString( fsb)) ; XmStringFree( FS_Pattern( fsb)) ; XmStringFree( FS_Directory( fsb)) ; return ; } /**************************************************************** * This procedure is called to remove the child from * the child list, and to allow the parent to do any * neccessary clean up. ****************/ static void DeleteChild( Widget w ) { XmFileSelectionBoxWidget fs ; XtWidgetProc delete_child; /****************/ if( XtIsRectObj( w) ) { fs = (XmFileSelectionBoxWidget) XtParent( w) ; if( w == FS_FilterLabel( fs) ) { FS_FilterLabel( fs) = NULL ; } else { if( w == FS_FilterText( fs) ) { FS_FilterText( fs) = NULL ; } else { if( FS_DirList( fs) && (w == XtParent( FS_DirList( fs))) ) { FS_DirList( fs) = NULL ; } else { if( w == FS_DirListLabel( fs) ) { FS_DirListLabel( fs) = NULL ; } } } } } _XmProcessLock(); delete_child = ((XmSelectionBoxWidgetClass) xmSelectionBoxWidgetClass) -> composite_class.delete_child; _XmProcessUnlock(); (*delete_child)( w) ; return ; } static XtGeometryResult GeometryManager( Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply ) { XtGeometryResult rtnVal ; XtGeometryHandler geometry_manager; _XmProcessLock(); geometry_manager = xmSelectionBoxClassRec.composite_class.geometry_manager; _XmProcessUnlock(); rtnVal = (*geometry_manager)( w, req, reply) ; UpdateHorizPos( XtParent( w)) ; return rtnVal ; } static void ChangeManaged( Widget wid ) { XtWidgetProc change_managed; _XmProcessLock(); change_managed = xmSelectionBoxClassRec.composite_class.change_managed; _XmProcessUnlock(); (*change_managed)( wid) ; UpdateHorizPos( wid) ; } /****************************************************************/ static void FSBCreateFilterLabel( XmFileSelectionBoxWidget fsb ) { /****************/ if (FS_FilterLabelString( fsb) == (XmString) XmUNSPECIFIED) FS_FilterLabelString( fsb) = NULL; FS_FilterLabel( fsb) = _XmBB_CreateLabelG( (Widget) fsb, FS_FilterLabelString( fsb), "FilterLabel", XmFilterStringLoc) ; return ; } /****************************************************************/ static void FSBCreateDirListLabel( XmFileSelectionBoxWidget fsb ) { /****************/ if (FS_DirListLabelString( fsb) == (XmString) XmUNSPECIFIED) FS_DirListLabelString( fsb) = NULL; FS_DirListLabel( fsb) = _XmBB_CreateLabelG( (Widget) fsb, FS_DirListLabelString( fsb), "Dir", XmDirListStringLoc) ; return ; } /**************************************************************** * Create the directory List widget. ****************/ static void FSBCreateDirList( XmFileSelectionBoxWidget fsb ) { Arg al[20]; register int ac = 0; XtCallbackProc callbackProc ; /****************/ FS_DirListSelectedItemPosition( fsb) = 0 ; XtSetArg( al[ac], XmNvisibleItemCount, SB_ListVisibleItemCount( fsb)) ; ac++ ; XtSetArg( al[ac], XmNstringDirection, SB_StringDirection( fsb)); ac++; XtSetArg( al[ac], XmNselectionPolicy, XmBROWSE_SELECT); ac++; XtSetArg( al[ac], XmNlistSizePolicy, XmCONSTANT); ac++; XtSetArg( al[ac], XmNnavigationType, XmSTICKY_TAB_GROUP) ; ++ac ; FS_DirList( fsb) = XmCreateScrolledList( (Widget) fsb, "DirList", al, ac); callbackProc = ((XmSelectionBoxWidgetClass) fsb->core.widget_class) ->selection_box_class.list_callback ; if( callbackProc ) { XtAddCallback( FS_DirList( fsb), XmNsingleSelectionCallback, callbackProc, (XtPointer) fsb) ; XtAddCallback( FS_DirList( fsb), XmNbrowseSelectionCallback, callbackProc, (XtPointer) fsb) ; XtAddCallback( FS_DirList( fsb), XmNdefaultActionCallback, callbackProc, (XtPointer) fsb) ; } XtManageChild( FS_DirList( fsb)) ; return ; } /**************************************************************** * Creates fs dir search filter text entry field. ****************/ static void FSBCreateFilterText( XmFileSelectionBoxWidget fs ) { Arg arglist[10] ; int argCount ; char * stext_value ; XtAccelerators temp_accelerators ; /****************/ /* Get text portion from Compound String, and set * fs_stext_charset and fs_stext_direction bits... */ /* Should do this stuff entirely with XmStrings when the text * widget supports it. */ if( !(stext_value = _XmStringGetTextConcat( FS_Pattern( fs))) ) { stext_value = (char *) XtMalloc( 1) ; stext_value[0] = '\0' ; } argCount = 0 ; XtSetArg( arglist[argCount], XmNcolumns, SB_TextColumns( fs)) ; argCount++ ; XtSetArg( arglist[argCount], XmNresizeWidth, FALSE) ; argCount++ ; XtSetArg( arglist[argCount], XmNvalue, stext_value) ; argCount++ ; XtSetArg( arglist[argCount], XmNnavigationType, XmSTICKY_TAB_GROUP) ; argCount++ ; FS_FilterText( fs) = XmCreateTextField( (Widget) fs, "FilterText", arglist, argCount) ; /* Install text accelerators. */ temp_accelerators = fs->core.accelerators ; fs->core.accelerators = SB_TextAccelerators( fs) ; XtInstallAccelerators( FS_FilterText( fs), (Widget) fs) ; fs->core.accelerators = temp_accelerators ; XtFree( stext_value) ; return ; } static void FSBCreateDirText( XmFileSelectionBoxWidget fs) { Arg arglist[10] ; int argCount ; char * stext_value ; XtAccelerators temp_accelerators ; /****************/ /* Get text portion from Compound String, and set * fs_stext_charset and fs_stext_direction bits... */ /* Should do this stuff entirely with XmStrings when the text * widget supports it. */ if( !(stext_value = _XmStringGetTextConcat( FS_Directory( fs))) ) { stext_value = (char *) XtMalloc( 1) ; stext_value[0] = '\0' ; } argCount = 0 ; XtSetArg( arglist[argCount], XmNcolumns, SB_TextColumns( fs)) ; argCount++ ; XtSetArg( arglist[argCount], XmNresizeWidth, FALSE) ; argCount++ ; XtSetArg( arglist[argCount], XmNvalue, stext_value) ; argCount++ ; XtSetArg( arglist[argCount], XmNnavigationType, XmSTICKY_TAB_GROUP) ; argCount++ ; FS_DirText( fs) = XmCreateTextField( (Widget) fs, "DirText", arglist, argCount) ; /* Install text accelerators. */ temp_accelerators = fs->core.accelerators ; fs->core.accelerators = SB_TextAccelerators( fs) ; XtInstallAccelerators(FS_DirText( fs), (Widget) fs) ; fs->core.accelerators = temp_accelerators ; XtFree( stext_value) ; return ; } static void FSBCreateDirTextLabel( XmFileSelectionBoxWidget fs) { FS_DirTextLabel(fs) = _XmBB_CreateLabelG( (Widget) fs, FS_DirTextLabelString(fs), "DirL", XmDirTextStringLoc) ; } /****************************************************************/ /*ARGSUSED*/ static void FilterFix( XmGeoMatrix geoSpec, int action, /* unused */ XmGeoMajorLayout layoutPtr, /* unused */ XmKidGeometry rowPtr ) { FS_GeoExtension extension ; /****************/ extension = (FS_GeoExtension) geoSpec->extension ; extension->filter_label = rowPtr ; rowPtr += 2 ; extension->filter_text = rowPtr ; } /**************************************************************** * Get Geo matrix filled with kid widgets. ****************/ static XmGeoMatrix FileSBGeoMatrixCreate( Widget wid, Widget instigator, XtWidgetGeometry *desired ) { XmFileSelectionBoxWidget fsb = (XmFileSelectionBoxWidget) wid ; XmGeoMatrix geoSpec ; register XmGeoRowLayout layoutPtr ; register XmKidGeometry boxPtr ; XmKidGeometry firstButtonBox ; Boolean dirListLabelBox ; Boolean listLabelBox ; Boolean dirListBox ; Boolean listBox ; Boolean selLabelBox ; Boolean filterLabelBox ; Dimension vspace = BB_MarginHeight(fsb); int i; /* * Layout FileSelectionBox XmGeoMatrix. * Each row is terminated by leaving an empty XmKidGeometry and * moving to the next XmGeoRowLayout. */ geoSpec = _XmGeoMatrixAlloc( XmFSB_MAX_WIDGETS_VERT, fsb->composite.num_children, sizeof( FS_GeoExtensionRec)) ; geoSpec->composite = (Widget) fsb ; geoSpec->instigator = (Widget) instigator ; if( desired ) { geoSpec->instig_request = *desired ; } geoSpec->margin_w = BB_MarginWidth( fsb) + fsb->manager.shadow_thickness ; geoSpec->margin_h = BB_MarginHeight( fsb) + fsb->manager.shadow_thickness ; geoSpec->no_geo_request = FileSelectionBoxNoGeoRequest ; layoutPtr = &(geoSpec->layouts->row) ; boxPtr = geoSpec->boxes ; /* menu bar */ for (i = 0; i < fsb->composite.num_children; i++) { Widget w = fsb->composite.children[i]; if( XmIsRowColumn(w) && ((XmRowColumnWidget)w)->row_column.type == XmMENU_BAR && w != SB_WorkArea(fsb) && _XmGeoSetupKid( boxPtr, w) ) { layoutPtr->fix_up = _XmMenuBarFix ; boxPtr += 2; ++layoutPtr; vspace = 0; /* fixup space_above of next row. */ break; } } /* work area, XmPLACE_TOP */ if (fsb->selection_box.child_placement == XmPLACE_TOP) SetupWorkArea(fsb); if( _XmGeoSetupKid( boxPtr, FS_DirTextLabel( fsb)) ) { layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); boxPtr += 2 ; ++layoutPtr ; } if( _XmGeoSetupKid( boxPtr, FS_DirText( fsb)) ) { boxPtr += 2 ; ++layoutPtr ; } /* filter label */ filterLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, FS_FilterLabel( fsb)) ) { filterLabelBox = TRUE ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); if( FS_PathMode( fsb) == XmPATH_MODE_RELATIVE ) { layoutPtr->fix_up = FilterFix ; } boxPtr += 2 ; ++layoutPtr ; } /* filter text */ if( _XmGeoSetupKid( boxPtr, FS_FilterText( fsb)) ) { if( !filterLabelBox ) { layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); } boxPtr += 2 ; ++layoutPtr ; } /* dir list and file list labels */ if (LayoutIsRtoLM(fsb)) { listLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, SB_ListLabel( fsb)) ) { listLabelBox = TRUE ; ++boxPtr ; } dirListLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, FS_DirListLabel( fsb)) ) { dirListLabelBox = TRUE ; ++boxPtr ; } } else { dirListLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, FS_DirListLabel( fsb)) ) { dirListLabelBox = TRUE ; ++boxPtr ; } listLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, SB_ListLabel( fsb)) ) { listLabelBox = TRUE ; ++boxPtr ; } } if( dirListLabelBox || listLabelBox ) { layoutPtr->fix_up = ListLabelFix ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); layoutPtr->space_between = BB_MarginWidth( fsb) ; if( dirListLabelBox && listLabelBox ) { layoutPtr->sticky_end = TRUE ; } layoutPtr->fill_mode = XmGEO_PACK ; ++boxPtr ; ++layoutPtr ; } if (LayoutIsRtoLM(fsb)) { listBox = FALSE ; if( SB_List( fsb) && XtIsManaged( SB_List( fsb)) && _XmGeoSetupKid( boxPtr, XtParent( SB_List( fsb))) ) { listBox = TRUE ; ++boxPtr ; } dirListBox = FALSE ; if( FS_DirList( fsb) && XtIsManaged( FS_DirList(fsb)) && _XmGeoSetupKid( boxPtr, XtParent( FS_DirList( fsb))) ) { dirListBox = TRUE ; ++boxPtr ; } } else { /* dir list and file list */ dirListBox = FALSE ; if( FS_DirList( fsb) && XtIsManaged( FS_DirList( fsb)) && _XmGeoSetupKid( boxPtr, XtParent( FS_DirList( fsb))) ) { dirListBox = TRUE ; ++boxPtr ; } listBox = FALSE ; if( SB_List( fsb) && XtIsManaged( SB_List( fsb)) && _XmGeoSetupKid( boxPtr, XtParent( SB_List( fsb))) ) { listBox = TRUE ; ++boxPtr ; } } if( dirListBox || listBox ) { layoutPtr->fix_up = ListFix ; layoutPtr->fit_mode = XmGEO_AVERAGING ; layoutPtr->space_between = BB_MarginWidth( fsb) ; layoutPtr->stretch_height = TRUE ; layoutPtr->min_height = 70 ; layoutPtr->even_height = 1 ; if( !listLabelBox && !dirListLabelBox ) { layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); } ++boxPtr ; ++layoutPtr ; } /* work area, XmPLACE_ABOVE_SELECTION */ if (fsb->selection_box.child_placement == XmPLACE_ABOVE_SELECTION) SetupWorkArea(fsb) /* selection label */ selLabelBox = FALSE ; if( _XmGeoSetupKid( boxPtr, SB_SelectionLabel( fsb)) ) { selLabelBox = TRUE ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); boxPtr += 2 ; ++layoutPtr ; } /* selection text */ if( _XmGeoSetupKid( boxPtr, SB_Text( fsb)) ) { if( !selLabelBox ) { layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); } boxPtr += 2 ; ++layoutPtr ; } /* work area, XmPLACE_BELOW_SELECTION */ if (fsb->selection_box.child_placement == XmPLACE_BELOW_SELECTION) SetupWorkArea(fsb) /* separator */ if( _XmGeoSetupKid( boxPtr, SB_Separator( fsb)) ) { layoutPtr->fix_up = _XmSeparatorFix ; layoutPtr->space_above = vspace; vspace = BB_MarginHeight(fsb); boxPtr += 2 ; ++layoutPtr ; } /* button row */ firstButtonBox = boxPtr ; if (LayoutIsRtoLM(fsb)) { if( _XmGeoSetupKid( boxPtr, SB_HelpButton( fsb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_CancelButton( fsb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_ApplyButton( fsb)) ) { ++boxPtr ; } for (i = 0; i < fsb->composite.num_children; i++) { Widget w = fsb->composite.children[fsb->composite.num_children-i-1]; if (IsButton(w) && !IsAutoButton(fsb,w) && w != SB_WorkArea(fsb)) { if (_XmGeoSetupKid( boxPtr, w)) { ++boxPtr ; } } } if( _XmGeoSetupKid( boxPtr, SB_OkButton( fsb)) ) { ++boxPtr ; } } else { if( _XmGeoSetupKid( boxPtr, SB_OkButton( fsb)) ) { ++boxPtr ; } for (i = 0; i < fsb->composite.num_children; i++) { Widget w = fsb->composite.children[i]; if (IsButton(w) && !IsAutoButton(fsb,w) && w != SB_WorkArea(fsb)) { if (_XmGeoSetupKid( boxPtr, w)) { ++boxPtr ; } } } if( _XmGeoSetupKid( boxPtr, SB_ApplyButton( fsb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_CancelButton( fsb)) ) { ++boxPtr ; } if( _XmGeoSetupKid( boxPtr, SB_HelpButton( fsb)) ) { ++boxPtr ; } } if( boxPtr != firstButtonBox ) { layoutPtr->fill_mode = XmGEO_CENTER ; layoutPtr->fit_mode = XmGEO_WRAP ; if( !(SB_MinimizeButtons( fsb)) ) { layoutPtr->even_width = 1 ; } layoutPtr->space_above = vspace ; vspace = BB_MarginHeight(fsb) ; layoutPtr->even_height = 1 ; ++layoutPtr ; } /* the end. */ layoutPtr->space_above = vspace ; layoutPtr->end = TRUE ; return( geoSpec) ; } /****************************************************************/ static Boolean FileSelectionBoxNoGeoRequest( XmGeoMatrix geoSpec ) { /****************/ if( BB_InSetValues( geoSpec->composite) && (XtClass( geoSpec->composite) == xmFileSelectionBoxWidgetClass) ) { return( TRUE) ; } return( FALSE) ; } /**************************************************************** * This routine saves the geometry pointers of the list labels so that they * can be altered as appropriate by the ListFix routine. ****************/ /*ARGSUSED*/ static void ListLabelFix( XmGeoMatrix geoSpec, int action, /* unused */ XmGeoMajorLayout layoutPtr, /* unused */ XmKidGeometry rowPtr ) { FS_GeoExtension extension ; /****************/ extension = (FS_GeoExtension) geoSpec->extension ; if (LayoutIsRtoLM(geoSpec->composite)) { extension->file_list_label = rowPtr++ ; extension->dir_list_label = rowPtr ; } else { extension->dir_list_label = rowPtr++ ; extension->file_list_label = rowPtr ; } return ; } /**************************************************************** * Geometry layout fixup routine for the directory and file lists. This * routine reduces the preferred width of the file list widget according * to the length of the directory path. * This algorithm assumes that each row has at least one box. ****************/ static void ListFix( XmGeoMatrix geoSpec, int action, XmGeoMajorLayout layoutPtr, XmKidGeometry rowPtr ) { Dimension listPathWidth ; XmListWidget fileList ; XmKidGeometry fileListGeo ; XmKidGeometry dirListGeo ; Arg argv[2] ; Cardinal argc ; XmFontList listFonts ; FS_GeoExtension extension ; int listLabelsOffset ; /****************/ if (LayoutIsRtoLM(geoSpec->composite)) { fileListGeo = rowPtr++; dirListGeo = rowPtr ; } else { dirListGeo = rowPtr++ ; fileListGeo = rowPtr ; } if( !fileListGeo->kid ) { /* Only one list widget in this row, so do nothing. */ return ; } extension = (FS_GeoExtension) geoSpec->extension ; fileList = (XmListWidget) SB_List( geoSpec->composite) ; switch( action ) { case XmGET_PREFERRED_SIZE: { if( FS_PathMode( geoSpec->composite) == XmPATH_MODE_FULL ) { argc = 0 ; XtSetArg( argv[argc], XmNfontList, &listFonts) ; ++argc ; XtGetValues( (Widget) fileList, argv, argc) ; listPathWidth = XmStringWidth( listFonts, FS_Directory( geoSpec->composite)) ; if( !(FS_StateFlags( geoSpec->composite) & XmFS_NO_MATCH) ) { if( listPathWidth < fileListGeo->box.width ) { fileListGeo->box.width -= listPathWidth ; } } if( listPathWidth < dirListGeo->box.width ) { dirListGeo->box.width -= listPathWidth ; } if( extension->dir_list_label && (extension->dir_list_label->box.width < dirListGeo->box.width) ) { extension->dir_list_label->box.width = dirListGeo->box.width ; } /* Drop through to pick up extension record field for either * type of geometry request. */ } else { if( extension->dir_list_label && (extension->dir_list_label->box.width > dirListGeo->box.width) ) { dirListGeo->box.width = extension->dir_list_label->box.width ; } if( extension->filter_label && (extension->filter_label->box.width > dirListGeo->box.width) ) { dirListGeo->box.width = extension->filter_label->box.width ; } if( extension->file_list_label && (extension->file_list_label->box.width > fileListGeo->box.width) ) { fileListGeo->box.width = extension->file_list_label->box.width ; } if( extension->filter_label && extension->filter_text && (fileListGeo->box.height >= ((extension->filter_label->box.height + extension->filter_text->box.height) << 1)) ) { dirListGeo->box.height = (fileListGeo->box.height -= (extension->filter_label->box.height + extension->filter_text->box.height + (layoutPtr - 1)->row.space_above + layoutPtr->row.space_above)) ; } break ; } } case XmGET_ACTUAL_SIZE: { if( FS_PathMode( geoSpec->composite) == XmPATH_MODE_FULL ) { extension->prefer_width = fileListGeo->box.width ; } break ; } case XmGEO_PRE_SET: { if( FS_PathMode( geoSpec->composite) == XmPATH_MODE_FULL ) { if( fileListGeo->box.width > extension->prefer_width ) { /* Add extra space designated for file list to dir list * instead, assuring that file list only shows the file name * and not a segment of the path. */ extension->delta_width = fileListGeo->box.width - extension->prefer_width ; fileListGeo->box.width -= extension->delta_width ; if (LayoutIsRtoLM(geoSpec->composite)) dirListGeo->box.x -= extension->delta_width ; else fileListGeo->box.x += extension->delta_width ; dirListGeo->box.width += extension->delta_width ; } else { extension->delta_width = 0 ; } /* Set label boxes to be the same width and x dimension as the * lists below them. */ if( extension->file_list_label ) { if( extension->file_list_label->box.width < fileListGeo->box.width ) { extension->file_list_label->box.width = fileListGeo->box.width ; extension->file_list_label->box.x = fileListGeo->box.x ; } else if (LayoutIsRtoLM(geoSpec->composite) && extension->file_list_label->box.width > fileListGeo->box.width) { extension->file_list_label->box.width = fileListGeo->box.width ; } if( extension->dir_list_label ) { if (LayoutIsRtoLM(geoSpec->composite)) { extension->dir_list_label->box.x = dirListGeo->box.x; extension->dir_list_label->box.width = dirListGeo->box.width; } else { listLabelsOffset = extension->file_list_label->box.x - extension->dir_list_label->box.x ; if( listLabelsOffset > (int) layoutPtr->row.space_between ) { extension->dir_list_label->box.width = (Dimension) listLabelsOffset - layoutPtr->row.space_between ; } } } } } else { /* Set label boxes to be the same width and x dimension as the * lists below them. */ if( extension->file_list_label ) { extension->file_list_label->box.width = fileListGeo->box.width ; extension->file_list_label->box.x = fileListGeo->box.x ; } if( extension->dir_list_label ) { extension->dir_list_label->box.width = dirListGeo->box.width ; extension->dir_list_label->box.x = dirListGeo->box.x ; } if( extension->filter_label && extension->filter_text && extension->file_list_label && extension->dir_list_label ) { Position dirListDelta = fileListGeo->box.y - extension->filter_text->box.y ; extension->filter_label->box.width = extension->filter_text->box.width = extension->dir_list_label->box.width ; extension->filter_label->box.x = extension->filter_text->box.x = extension->dir_list_label->box.x; extension->file_list_label->box.y = extension->filter_label->box.y ; fileListGeo->box.y -= dirListDelta ; fileListGeo->box.height += dirListDelta ; } } break ; } case XmGEO_POST_SET: { if( FS_PathMode( geoSpec->composite) == XmPATH_MODE_FULL ) { if( extension->delta_width ) { /* Undo the changes of PRE_SET, so subsequent re-layout * attempts will yield correct results. */ fileListGeo->box.width += extension->delta_width ; if (LayoutIsRtoLM(geoSpec->composite)) dirListGeo->box.x += extension->delta_width ; else fileListGeo->box.x -= extension->delta_width ; dirListGeo->box.width -= extension->delta_width ; } } break ; } } return ; } static void UpdateHorizPos( Widget wid) { Dimension listPathWidth ; Arg argv[2] ; Cardinal argc ; XmFontList listFonts ; XmString dirString = FS_Directory( wid) ; if( FS_PathMode( wid) == XmPATH_MODE_RELATIVE ) { return ; } if( !(FS_StateFlags( wid) & XmFS_NO_MATCH) ) { /* Move horizontal position so path does not show in file list. */ argc = 0 ; XtSetArg( argv[argc], XmNfontList, &listFonts) ; ++argc ; XtGetValues( SB_List( wid), argv, argc) ; listPathWidth = XmStringWidth( listFonts, dirString) ; XmListSetHorizPos( SB_List( wid), listPathWidth) ; } /* Move horizontal scroll position of directory list as far to the * right as it will go, so that the right end of the list is * never hidden. */ argc = 0 ; XtSetArg( argv[argc], XmNfontList, &listFonts) ; ++argc ; XtGetValues( FS_DirList( wid), argv, argc) ; listPathWidth = XmStringWidth( listFonts, dirString) ; XmListSetHorizPos( FS_DirList( wid), listPathWidth) ; return ; } /****************************************************************/ static void FileSearchProc( Widget w, XtPointer sd ) { XmFileSelectionBoxWidget fs = (XmFileSelectionBoxWidget) w ; XmFileSelectionBoxCallbackStruct * searchData = (XmFileSelectionBoxCallbackStruct *) sd ; String dir ; String pattern ; Arg args[3] ; int Index ; String * fileList ; unsigned int numFiles ; unsigned int numItems = 0 ; unsigned int numAlloc ; XmString * XmStringFileList ; unsigned dirLen ; /****************/ if( !(dir = _XmStringGetTextConcat( searchData->dir)) ) { return ; } if( !(pattern = _XmStringGetTextConcat( searchData->pattern)) ) { XtFree( dir) ; return ; } fileList = NULL ; _XmOSBuildFileList( dir, pattern, FS_FileTypeMask( fs), &fileList, &numFiles, &numAlloc) ; if( fileList && numFiles ) { Boolean showDotFiles = (FS_FileFilterStyle( fs) == XmFILTER_NONE) ; if( numFiles > 1 ) qsort( (void *)fileList, numFiles, sizeof( char *), _XmOSFileCompare) ; XmStringFileList = (XmString *) XtMalloc(numFiles * sizeof( XmString)) ; Index = 0 ; dirLen = strlen( dir) ; while( Index < numFiles ) { if( showDotFiles || ((fileList[Index])[dirLen] != '.') ) { if( FS_PathMode( fs) == XmPATH_MODE_FULL ) XmStringFileList[numItems++] = XmStringGenerate(fileList[Index], XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); else XmStringFileList[numItems++] = XmStringGenerate(&(fileList[Index])[dirLen], XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; } ++Index ; } /* Update the list. */ Index = 0 ; XtSetArg( args[Index], XmNitems, XmStringFileList) ; Index++ ; XtSetArg( args[Index], XmNitemCount, numItems) ; Index++ ; XtSetValues( SB_List( fs), args, Index) ; Index = numFiles ; while( Index-- ) { XtFree( fileList[Index]) ; } while( numItems-- ) { XmStringFree( XmStringFileList[numItems]) ; } XtFree( (char *) XmStringFileList) ; } else { XtSetArg( args[0], XmNitemCount, 0) ; XtSetValues( SB_List( fs), args, 1) ; } FS_ListUpdated( fs) = TRUE ; XtFree( (char *) fileList) ; XtFree( pattern) ; XtFree( dir) ; return ; } /**************************************************************** * This routine validates and allocates new copies of all searchData * fields that are required by the DirSearchProc and the FileSearchProc * routines. The default routines require only the "dir" and "pattern" * fields to be filled with appropriate qualified non-null XmStrings. * Any of the fields of the searchData passed into this routine may be NULL. * Generally, only those fields which signify changes due to a user action * will be passed into this routine. This data should always override * data derived from other sources. * The caller is responsible to free the XmStrings of all (non-null) fields * of the qualifiedSearchData record. ****************/ static void QualifySearchDataProc( Widget w, XtPointer sd, XtPointer qsd ) { XmFileSelectionBoxWidget fs = (XmFileSelectionBoxWidget) w ; XmFileSelectionBoxCallbackStruct * searchData = (XmFileSelectionBoxCallbackStruct *) sd ; XmFileSelectionBoxCallbackStruct * qualifiedSearchData = (XmFileSelectionBoxCallbackStruct *) qsd ; String valueString ; String patternString ; String dirString ; String maskString ; String qualifiedDir ; String qualifiedPattern ; String qualifiedMask ; char * dirPartPtr ; char * patternPartPtr ; unsigned int qDirLen ; /****************/ maskString = _XmStringGetTextConcat( searchData->mask) ; dirString = _XmStringGetTextConcat( searchData->dir) ; patternString = _XmStringGetTextConcat( searchData->pattern) ; if( !maskString || (dirString && patternString) || (dirString && maskString && (maskString[0] != '/')) ) { if( !dirString ) { dirString = _XmStringGetTextConcat( FS_Directory( fs)) ; } if( !patternString ) { if( maskString && (maskString[0] != '/') ) { patternString = maskString ; maskString = NULL ; } else { patternString = _XmStringGetTextConcat( FS_Pattern( fs)) ; } } _XmOSQualifyFileSpec( dirString, patternString, &qualifiedDir, &qualifiedPattern) ; } else { patternPartPtr = _XmOSFindPatternPart( maskString) ; if( patternPartPtr != maskString ) { /*** This need to be re-think with Xmos.c in mind. dd */ /* To avoid allocating memory and copying part of the mask string, * just stuff '\0' at the '/' which is between the directory part * and the pattern part. The QualifyFileSpec below does not * require the trailing '/', and it will assure that the resulting * qualifiedDir will have the required trailing '/'. * Must check to see if the directory part of the mask * string is "//", so that this information is not lost when * deleting the '/' before the pattern part. Embedded "//" * sequences are not protected, but root specifications are. */ *(patternPartPtr - 1) = '\0' ; if( !*maskString || ((*maskString == '/') && !maskString[1]) ) { if( !*maskString ) { /* The '/' that was replaced with '\0' above was the only * character in the directory specification (root * directory "/"), so simply restore it. */ dirPartPtr = "/" ; } else { /* The directory specification was "//" before the * trailing '/' was deleted, so restore original. */ dirPartPtr = "//" ; } } else { /* Is non-root directory specification, so its ok to have * deleted the '/', since we are not protecting embedded * "//" path specifications from reduction to a single slash. */ dirPartPtr = maskString ; } } else { dirPartPtr = NULL ; } if( dirString ) { dirPartPtr = dirString ; } if( patternString ) { patternPartPtr = patternString ; } _XmOSQualifyFileSpec( dirPartPtr, patternPartPtr, &qualifiedDir, &qualifiedPattern) ; } qDirLen = strlen( qualifiedDir) ; qualifiedMask = XtMalloc( 1 + qDirLen + strlen( qualifiedPattern)) ; strcpy( qualifiedMask, qualifiedDir) ; strcpy( &qualifiedMask[qDirLen], qualifiedPattern) ; qualifiedSearchData->reason = searchData->reason ; qualifiedSearchData->event = searchData->event ; if( searchData->value ) { qualifiedSearchData->value = XmStringCopy( searchData->value) ; valueString = NULL ; } else { if( FS_PathMode( fs) == XmPATH_MODE_FULL ) { valueString = XmTextFieldGetString( SB_Text( fs)) ; }else { String fileStr = XmTextFieldGetString( SB_Text( fs)) ; if( (fileStr == NULL) || (*fileStr == '\0') || (*fileStr == '/') || (FS_Directory( fs) == NULL) ) { valueString = fileStr ; } else { String dirStr = _XmStringGetTextConcat( FS_Directory( fs)) ; unsigned dirLen = strlen( dirStr) ; valueString = XtMalloc( dirLen + strlen( fileStr) + 1) ; strcpy( valueString, dirStr) ; strcpy( &valueString[dirLen], fileStr) ; XtFree( fileStr) ; XtFree( dirStr) ; } } qualifiedSearchData->value = XmStringGenerate(valueString, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); } qualifiedSearchData->length = XmStringLength( qualifiedSearchData->value) ; qualifiedSearchData->mask = XmStringGenerate(qualifiedMask, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; qualifiedSearchData->mask_length = XmStringLength( qualifiedSearchData->mask) ; qualifiedSearchData->dir = XmStringGenerate(qualifiedDir, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; qualifiedSearchData->dir_length = XmStringLength( qualifiedSearchData->dir) ; qualifiedSearchData->pattern = XmStringGenerate(qualifiedPattern, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; qualifiedSearchData->pattern_length = XmStringLength( qualifiedSearchData->pattern) ; XtFree( valueString) ; XtFree( qualifiedMask) ; XtFree( qualifiedPattern) ; XtFree( qualifiedDir) ; XtFree( patternString) ; XtFree( dirString) ; XtFree( maskString) ; return ; } /****************************************************************/ static void FileSelectionBoxUpdate( XmFileSelectionBoxWidget fs, XmFileSelectionBoxCallbackStruct *searchData ) { Arg ac[5] ; Cardinal al ; int itemCount ; XmString item ; String textValue ; String dirString ; String maskString ; String patternString ; int len ; XmFileSelectionBoxCallbackStruct qualifiedSearchData ; /****************/ /* Unmap file list, so if it takes a long time to generate the * list items, the user doesn't wonder what is going on. */ XtSetMappedWhenManaged( SB_List( fs), FALSE) ; XFlush( XtDisplay( fs)) ; if( FS_StateFlags( fs) & XmFS_NO_MATCH ) { XmListDeleteAllItems( SB_List( fs)) ; } FS_StateFlags( fs) |= XmFS_IN_FILE_SEARCH ; (*FS_QualifySearchDataProc( fs))( (Widget) fs, (XtPointer) searchData, (XtPointer) &qualifiedSearchData) ; FS_ListUpdated( fs) = FALSE ; FS_DirectoryValid( fs) = FALSE ; (*FS_DirSearchProc( fs))( (Widget) fs, (XtPointer) &qualifiedSearchData) ; if( FS_DirectoryValid( fs) ) { (*FS_FileSearchProc( fs))( (Widget) fs, (XtPointer) &qualifiedSearchData) ; /* Now update the Directory and Pattern resources. */ if( !XmStringCompare( qualifiedSearchData.dir, FS_Directory( fs)) ) { if( FS_Directory( fs) ) { XmStringFree( FS_Directory( fs)) ; } FS_Directory( fs) = XmStringCopy( qualifiedSearchData.dir) ; } if( !XmStringCompare( qualifiedSearchData.pattern, FS_Pattern( fs)) ) { if( FS_Pattern( fs) ) { XmStringFree( FS_Pattern( fs)) ; } FS_Pattern( fs) = XmStringCopy( qualifiedSearchData.pattern) ; } /* Also update the filter text. */ if( FS_PathMode( fs) == XmPATH_MODE_FULL ) { if ((dirString = _XmStringGetTextConcat( FS_Directory(fs))) != NULL) { if((patternString=_XmStringGetTextConcat(FS_Pattern(fs)))!=NULL) { len = strlen( dirString) ; maskString = XtMalloc( len + strlen( patternString) + 1) ; strcpy( maskString, dirString) ; strcpy( &maskString[len], patternString) ; XmTextFieldSetString( FS_FilterText( fs), maskString) ; XmTextFieldSetInsertionPosition( FS_FilterText( fs), XmTextFieldGetLastPosition( FS_FilterText( fs))) ; XtFree( maskString) ; XtFree( patternString) ; } XtFree( dirString) ; } } else { if ((dirString = _XmStringGetTextConcat( FS_Directory(fs))) != NULL) { XmTextFieldSetString( FS_DirText( fs), dirString) ; XmTextFieldSetInsertionPosition( FS_DirText( fs), XmTextFieldGetLastPosition( FS_DirText( fs))) ; XtFree( dirString) ; } if((patternString=_XmStringGetTextConcat(FS_Pattern(fs)))!=NULL) { XmTextFieldSetString( FS_FilterText( fs), patternString) ; XmTextFieldSetInsertionPosition( FS_FilterText( fs), XmTextFieldGetLastPosition( FS_FilterText( fs))) ; XtFree( patternString) ; } } } FS_StateFlags( fs) &= ~XmFS_IN_FILE_SEARCH ; al = 0 ; XtSetArg( ac[al], XmNitemCount, &itemCount) ; ++al ; XtGetValues( SB_List( fs), ac, al) ; if( itemCount ) { FS_StateFlags( fs) &= ~XmFS_NO_MATCH ; } else { FS_StateFlags( fs) |= XmFS_NO_MATCH ; if( (item = FS_NoMatchString( fs)) != NULL ) { al = 0 ; XtSetArg( ac[al], XmNitems, &item) ; ++al ; XtSetArg( ac[al], XmNitemCount, 1) ; ++al ; XtSetValues( SB_List( fs), ac, al) ; } } if( FS_ListUpdated( fs) ) { if( FS_PathMode( fs) == XmPATH_MODE_FULL ) { if ((textValue = _XmStringGetTextConcat(FS_Directory(fs))) != NULL) { XmTextFieldSetString( SB_Text( fs), textValue) ; XmTextFieldSetInsertionPosition( SB_Text( fs), XmTextFieldGetLastPosition( SB_Text( fs))) ; XtFree( textValue) ; } } else { XmTextFieldSetString( SB_Text( fs), NULL) ; } _XmBulletinBoardSizeUpdate( (Widget) fs) ; UpdateHorizPos( (Widget) fs) ; } XtSetMappedWhenManaged( SB_List( fs), TRUE) ; XmStringFree( qualifiedSearchData.value) ; XmStringFree( qualifiedSearchData.mask) ; XmStringFree( qualifiedSearchData.dir) ; XmStringFree( qualifiedSearchData.pattern) ; return ; } /**************************************************************** * This loads the list widget with a directory list based * on the directory specification. ****************/ static void DirSearchProc( Widget w, XtPointer sd ) { XmFileSelectionBoxWidget fs = (XmFileSelectionBoxWidget) w ; XmFileSelectionBoxCallbackStruct * searchData = (XmFileSelectionBoxCallbackStruct *) sd ; String qualifiedDir ; Arg args[10] ; int Index ; String * dirList ; unsigned int numDirs ; unsigned int numAlloc ; XmString * XmStringDirList ; struct stat curDirStats ; time_t curDirModTime = 0 ; unsigned numItems = 0 ; unsigned dirLen ; Boolean showDotFiles = (FS_FileFilterStyle( fs) == XmFILTER_NONE) ; /****************/ /* Sometimes a directory has changed contents even though * the FileSB has not navigated to a different directory; * the directory list needs to be updated in this case. * A simple "one level cache" saves the modification time of the * most recently accessed FileSB directory. This is used to * avoid completely re-creating the directory list when the * directory contents haven't changed. * While not perfect, this simple implementation will improve * performance for 99 percent of the cases when only the filter * is being changed and the directory list need not be touched. * An interface for the "stat" functionality used here should * re-implemented in Xmos.c. */ if( (qualifiedDir = _XmStringGetTextConcat( searchData->dir)) == NULL ) { if( _XmGetAudibleWarning((Widget) fs) == XmBELL ) { XBell( XtDisplay( fs), 0) ; } return ; } if( !stat( qualifiedDir, &curDirStats) ) { curDirModTime = curDirStats.st_mtime ; } if( (FS_StateFlags( fs) & XmFS_DIR_SEARCH_PROC) || (curDirModTime != FS_PrevDirModTime(fs)) || !XmStringCompare( searchData->dir, FS_Directory( fs)) ) { FS_StateFlags( fs) &= ~XmFS_DIR_SEARCH_PROC ; /* Directory is different than current, so update dir list. */ dirList = NULL ; _XmOSGetDirEntries( qualifiedDir, "*", XmFILE_DIRECTORY, FALSE, TRUE, &dirList, &numDirs, &numAlloc) ; if( !numDirs ) { /* Directory list is empty, so have attempted to go * into a directory without permissions. Don't do it! */ if( _XmGetAudibleWarning((Widget) fs) == XmBELL ) { XBell( XtDisplay( fs), 0) ; } XtFree( (char *) qualifiedDir) ; XtFree((char *) dirList) ; return ; } if( numDirs > 1 ) { qsort( (void *)dirList, numDirs, sizeof( char *), _XmOSFileCompare) ; } XmStringDirList = (XmString *) XtMalloc( numDirs * sizeof( XmString)) ; Index = 0 ; dirLen = strlen( qualifiedDir) ; while( Index < numDirs ) { /* Assume first entry is "." and second is "..". */ if( showDotFiles || (Index == 1) || ((dirList[Index])[dirLen] != '.')) { if( FS_PathMode( fs) == XmPATH_MODE_FULL ) XmStringDirList[numItems++] = XmStringGenerate(dirList[Index], XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; else XmStringDirList[numItems++] = XmStringGenerate(&(dirList[Index])[dirLen], XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; } ++Index ; } /* Update the list. */ Index = 0; XtSetArg( args[Index], XmNitems, XmStringDirList) ; Index++ ; XtSetArg( args[Index], XmNitemCount, numItems) ; Index++ ; XtSetArg( args[Index], XmNtopItemPosition, 1) ; Index++ ; XtSetValues( FS_DirList( fs), args, Index); XmListSelectPos( FS_DirList( fs), 1, FALSE) ; FS_DirListSelectedItemPosition( fs) = 1 ; Index = numDirs ; while( Index-- ) { XtFree( dirList[Index]) ; } XtFree( (char *) dirList) ; while( numItems-- ) { XmStringFree( XmStringDirList[numItems]) ; } XtFree( (char *) XmStringDirList) ; FS_ListUpdated( fs) = TRUE ; FS_PrevDirModTime( fs) = curDirModTime ; } XtFree( (char *) qualifiedDir) ; FS_DirectoryValid( fs) = TRUE ; return ; } /**************************************************************** * Process callback from either List of the File Selection Box. ****************/ static void ListCallback( Widget wid, XtPointer client_data, XtPointer call_data ) { XmListCallbackStruct * callback ; XmFileSelectionBoxWidget fsb ; XmGadgetClass gadget_class ; XmGadget dbutton ; XmFileSelectionBoxCallbackStruct change_data ; XmFileSelectionBoxCallbackStruct qualified_change_data ; String textValue ; String dirString ; String maskString ; String patternString ; int len ; /****************/ callback = (XmListCallbackStruct *) call_data ; fsb = (XmFileSelectionBoxWidget) client_data ; switch( callback->reason ) { case XmCR_BROWSE_SELECT: case XmCR_SINGLE_SELECT: { if( wid == FS_DirList( fsb) ) { FS_DirListSelectedItemPosition( fsb) = callback->item_position ; change_data.event = NULL ; change_data.reason = XmCR_NONE ; change_data.value = NULL ; change_data.length = 0 ; textValue = XmTextFieldGetString( FS_FilterText( fsb)) ; change_data.mask = XmStringGenerate(textValue, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; change_data.mask_length = XmStringLength( change_data.mask) ; if( FS_PathMode( fsb) == XmPATH_MODE_FULL ) { change_data.dir = XmStringCopy( callback->item) ; } else { change_data.dir = XmStringConcat( FS_Directory( fsb), callback->item) ; } change_data.dir_length = XmStringLength( change_data.dir) ; change_data.pattern = NULL ; change_data.pattern_length = 0 ; /* Qualify and then update the filter text. */ (*FS_QualifySearchDataProc( fsb))( (Widget) fsb, (XtPointer) &change_data, (XtPointer) &qualified_change_data) ; if( FS_PathMode( fsb) == XmPATH_MODE_FULL ) { if ((dirString = _XmStringGetTextConcat(qualified_change_data.dir)) != NULL) { if ((patternString = _XmStringGetTextConcat(qualified_change_data.pattern)) != NULL) { len = strlen( dirString) ; maskString = XtMalloc( len + strlen( patternString) + 1) ; strcpy( maskString, dirString) ; strcpy( &maskString[len], patternString) ; XmTextFieldSetString( FS_FilterText( fsb), maskString) ; XmTextFieldSetInsertionPosition( FS_FilterText( fsb), XmTextFieldGetLastPosition( FS_FilterText( fsb))) ; XtFree( maskString) ; XtFree( patternString) ; } XtFree( dirString) ; } } else { if ((dirString = _XmStringGetTextConcat(qualified_change_data.dir)) != NULL) { XmTextFieldSetString( FS_DirText( fsb), dirString) ; XmTextFieldSetInsertionPosition( FS_DirText( fsb), XmTextFieldGetLastPosition( FS_DirText( fsb))) ; XtFree( dirString) ; } if ((patternString = _XmStringGetTextConcat(qualified_change_data.pattern)) != NULL) { XmTextFieldSetString( FS_FilterText( fsb), patternString) ; XmTextFieldSetInsertionPosition( FS_FilterText( fsb), XmTextFieldGetLastPosition( FS_FilterText( fsb))) ; XtFree( patternString) ; } } XmStringFree( qualified_change_data.pattern) ; XmStringFree( qualified_change_data.dir) ; XmStringFree( qualified_change_data.mask) ; XmStringFree( qualified_change_data.value) ; XmStringFree( change_data.mask) ; XmStringFree( change_data.dir) ; XtFree( textValue) ; } else /* wid is File List. */ { if( FS_StateFlags( fsb) & XmFS_NO_MATCH ) { XmListDeselectPos( SB_List( fsb), 1) ; break ; } SB_ListSelectedItemPosition( fsb) = callback->item_position ; if ((textValue = _XmStringGetTextConcat(callback->item)) != NULL) { XmTextFieldSetString( SB_Text( fsb), textValue) ; XmTextFieldSetInsertionPosition( SB_Text( fsb), XmTextFieldGetLastPosition( SB_Text( fsb))) ; XtFree(textValue); } } break ; } case XmCR_DEFAULT_ACTION: { dbutton = (XmGadget) BB_DynamicDefaultButton( fsb) ; /* Catch only double-click default action here. * Key press events are handled through the ParentProcess routine. */ if( (callback->event->type != KeyPress) && dbutton && XtIsManaged((Widget)dbutton) && XtIsSensitive((Widget)dbutton) && XmIsGadget( dbutton) && ( !(FS_StateFlags(fsb) & XmFS_NO_MATCH) || (wid == FS_DirList( fsb))) ) { gadget_class = (XmGadgetClass) dbutton->object.widget_class ; if (gadget_class->gadget_class.arm_and_activate) { /* pass the event so that the button can pass it on to its ** callbacks, even though the event isn't within the button */ (*(gadget_class->gadget_class.arm_and_activate)) ((Widget) dbutton, callback->event, NULL, NULL) ; } } break ; } default: { break ; } } return ; } /**************************************************************** * This routine detects differences in two versions * of a widget, when a difference is found the * appropriate action is taken. ****************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args_in, /* unused */ Cardinal *num_args ) /* unused */ { XmFileSelectionBoxWidget current = (XmFileSelectionBoxWidget) cw ; XmFileSelectionBoxWidget request = (XmFileSelectionBoxWidget) rw ; XmFileSelectionBoxWidget new_w = (XmFileSelectionBoxWidget) nw ; Arg args[10] ; int n ; String newString ; Boolean doSearch = FALSE ; XmFileSelectionBoxCallbackStruct searchData ; /****************/ BB_InSetValues( new_w) = TRUE ; if( FS_DirListLabelString( current) != FS_DirListLabelString( new_w) ) { n = 0 ; XtSetArg( args[n], XmNlabelString, FS_DirListLabelString( new_w)) ; n++ ; XtSetArg( args[n], XmNlabelType, XmSTRING) ; n++ ; XtSetValues( FS_DirListLabel( new_w), args, n) ; FS_DirListLabelString( new_w) = NULL ; } if( FS_FilterLabelString( current) != FS_FilterLabelString( new_w) ) { n = 0 ; XtSetArg( args[n], XmNlabelString, FS_FilterLabelString( new_w)) ; n++ ; XtSetArg( args[n], XmNlabelType, XmSTRING) ; n++ ; XtSetValues( FS_FilterLabel( new_w), args, n) ; FS_FilterLabelString( new_w) = NULL ; } n = 0 ; if( SB_ListVisibleItemCount( current) != SB_ListVisibleItemCount( new_w) ) { XtSetArg( args[n], XmNvisibleItemCount, SB_ListVisibleItemCount( new_w)) ; ++n ; } if( FS_DirListItems( new_w) ) { XtSetArg( args[n], XmNitems, FS_DirListItems( new_w)) ; ++n ; FS_DirListItems( new_w) = NULL ; } if( FS_DirListItemCount( new_w) != XmUNSPECIFIED_COUNT ) { XtSetArg( args[n], XmNitemCount, FS_DirListItemCount( new_w)) ; ++n ; FS_DirListItemCount( new_w) = XmUNSPECIFIED_COUNT ; } if( n ) { XtSetValues( FS_DirList( new_w), args, n) ; } if( (SB_TextColumns( new_w) != SB_TextColumns( current)) && FS_FilterText( new_w) ) { n = 0 ; XtSetArg( args[n], XmNcolumns, SB_TextColumns( new_w)) ; ++n ; XtSetValues( FS_FilterText( new_w), args, n) ; } if( FS_NoMatchString( new_w) != FS_NoMatchString( current) ) { XmStringFree( FS_NoMatchString( current)) ; FS_NoMatchString( new_w) = XmStringCopy( FS_NoMatchString( new_w)) ; } if( !FS_QualifySearchDataProc( new_w) ) { FS_QualifySearchDataProc( new_w) = QualifySearchDataProc ; } if( FS_DirSearchProc( new_w) != FS_DirSearchProc( current) || FS_FileFilterStyle( new_w) != FS_FileFilterStyle( current) ) { doSearch = TRUE ; FS_StateFlags(new_w) |= XmFS_DIR_SEARCH_PROC ; /* in order to track the case where the directory does not change but the dirsearch proc does so we have to regenerate the dir list from scratch */ } if( !FS_DirSearchProc( new_w) ) { FS_DirSearchProc( new_w) = DirSearchProc ; } if( !FS_FileSearchProc( new_w) ) { FS_FileSearchProc( new_w) = FileSearchProc ; } /* The XmNdirSpec resource will be loaded into the Text widget by * the Selection Box (superclass) SetValues routine. It will be * picked-up there by the XmNqualifySearchDataProc routine to fill * in the value field of the search data. */ bzero( (char*)&searchData, sizeof( XmFileSelectionBoxCallbackStruct)) ; if( FS_DirMask( new_w) != FS_DirMask( current) ) { if( FS_StateFlags( new_w) & XmFS_IN_FILE_SEARCH ) { if( FS_FilterText( new_w) ) { newString = _XmStringGetTextConcat( FS_DirMask( new_w)) ; /* Should do this stuff entirely with XmStrings when the text * widget supports it. */ XmTextFieldSetString( FS_FilterText( new_w), newString) ; if( newString ) { XmTextFieldSetInsertionPosition( FS_FilterText( new_w), XmTextFieldGetLastPosition( FS_FilterText( new_w))) ; } XtFree( newString) ; } } else { doSearch = TRUE ; searchData.mask = XmStringCopy( FS_DirMask( request)) ; searchData.mask_length = XmStringLength( searchData.mask) ; } FS_DirMask( new_w) = (XmString) XmUNSPECIFIED ; } if( FS_Directory( current) != FS_Directory( new_w) ) { if( FS_StateFlags( new_w) & XmFS_IN_FILE_SEARCH ) { FS_Directory( new_w) = XmStringCopy( FS_Directory( request)) ; XmStringFree( FS_Directory( current)) ; } else { doSearch = TRUE ; searchData.dir = XmStringCopy( FS_Directory( request)) ; searchData.dir_length = XmStringLength( searchData.dir) ; /* The resource will be set to the new value after the Search * routines have been called for validation. */ FS_Directory( new_w) = FS_Directory( current) ; } } if( FS_Pattern( current) != FS_Pattern( new_w) ) { if( FS_StateFlags( new_w) & XmFS_IN_FILE_SEARCH ) { FS_Pattern( new_w) = XmStringCopy( FS_Pattern( request)) ; XmStringFree( FS_Pattern( current)) ; } else { doSearch = TRUE ; searchData.pattern = XmStringCopy( FS_Pattern( request)) ; searchData.pattern_length = XmStringLength( searchData.pattern) ; /* The resource will be set to the new value after the Search * routines have been called for validation. */ FS_Pattern( new_w) = FS_Pattern( current) ; } } if( FS_FileTypeMask( new_w) != FS_FileTypeMask( current) ) { if( !(FS_StateFlags( new_w) & XmFS_IN_FILE_SEARCH) ) { doSearch = TRUE ; } } if( doSearch ) { FileSelectionBoxUpdate( new_w, &searchData) ; XmStringFree( searchData.value) ; XmStringFree( searchData.mask) ; XmStringFree( searchData.dir) ; XmStringFree( searchData.pattern) ; } BB_InSetValues( new_w) = FALSE ; if( XtClass( new_w) == xmFileSelectionBoxWidgetClass ) { _XmBulletinBoardSizeUpdate( (Widget) new_w) ; UpdateHorizPos( (Widget) new_w) ; } return( FALSE) ; } /****************************************************************/ /*ARGSUSED*/ static void FSBGetDirSpec( Widget fs, int resource, XtArgVal *value) { if (FS_PathMode(fs) == XmPATH_MODE_RELATIVE) { XtArgVal filename; _XmSelectionBoxGetTextString(fs, resource, &filename); *value = (XtArgVal)XmStringConcat(FS_Directory(fs), (XmString)filename); XmStringFree((XmString)filename); } else { _XmSelectionBoxGetTextString(fs, resource, value); } return; } /****************************************************************/ /*ARGSUSED*/ static void FSBGetDirectory( Widget fs, int resource, /* unused */ XtArgVal *value) /**************** ARGSUSED * This does get values hook magic to keep the * user happy. ****************/ { XmString data ; /****************/ data = XmStringCopy(FS_Directory(fs)); *value = (XtArgVal) data ; return ; } /****************************************************************/ /*ARGSUSED*/ static void FSBGetNoMatchString( Widget fs, int resource, /* unused */ XtArgVal *value) /**************** ARGSUSED * This does get values hook magic to keep the * user happy. ****************/ { XmString data ; /****************/ data = XmStringCopy(FS_NoMatchString(fs)); *value = (XtArgVal) data ; return ; } /****************************************************************/ /*ARGSUSED*/ static void FSBGetPattern( Widget fs, int resource, /* unused */ XtArgVal *value) /**************** ARGSUSED * This does get values hook magic to keep the * user happy. ****************/ { XmString data ; /****************/ data = XmStringCopy(FS_Pattern(fs)); *value = (XtArgVal) data ; return ; } /**************************************************************** * This does get values hook magic to keep the user happy. ****************/ /*ARGSUSED*/ static void FSBGetFilterLabelString( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; /****************/ XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( FS_FilterLabel( fs), al, 1) ; *value = (XtArgVal) data ; return ; } /**************************************************************** * This does get values hook magic to keep the user happy. ****************/ /*ARGSUSED*/ static void FSBGetDirListLabelString( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmString data ; Arg al[1] ; /****************/ XtSetArg( al[0], XmNlabelString, &data) ; XtGetValues( FS_DirListLabel( fs), al, 1) ; *value = (XtArgVal) data ; return ; } /**************************************************************** * This does get values hook magic to keep the user happy. ****************/ /*ARGSUSED*/ static void FSBGetDirListItems( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmStringTable data ; Arg al[1] ; /****************/ XtSetArg( al[0], XmNitems, &data) ; XtGetValues( FS_DirList( fs), al, 1) ; *value = (XtArgVal) data ; return ; } /**************************************************************** * This does get values hook magic to keep the user happy. ****************/ /*ARGSUSED*/ static void FSBGetDirListItemCount( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { int data ; Arg al[1] ; /****************/ XtSetArg( al[0], XmNitemCount, &data) ; XtGetValues( FS_DirList( fs), al, 1) ; *value = (XtArgVal) data ; return ; } /**************************************************************** * This does get values hook magic to keep the user happy. ****************/ /*ARGSUSED*/ static void FSBGetListItems( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { XmStringTable data ; Arg al[1] ; /****************/ if( FS_StateFlags( fs) & XmFS_NO_MATCH ) { *value = (XtArgVal) NULL ; } else { XtSetArg( al[0], XmNitems, &data) ; XtGetValues( SB_List( fs), al, 1) ; *value = (XtArgVal) data ; } return ; } /**************************************************************** * This does get values hook magic to keep the user happy. ****************/ /*ARGSUSED*/ static void FSBGetListItemCount( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { int data ; Arg al[1] ; /****************/ if( FS_StateFlags( fs) & XmFS_NO_MATCH ) { *value = (XtArgVal) 0 ; } else { XtSetArg( al[0], XmNitemCount, &data) ; XtGetValues( SB_List( fs), al, 1) ; *value = (XtArgVal) data ; } return ; } /**************************************************************** * This does get values hook magic to keep the * user happy. ****************/ /*ARGSUSED*/ static void FSBGetDirMask( Widget fs, int resource_offset, /* unused */ XtArgVal *value ) { String filterText ; XmString data ; /****************/ filterText = XmTextFieldGetString( FS_FilterText(fs)) ; data = XmStringGenerate(filterText, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); *value = (XtArgVal) data ; XtFree( filterText) ; return ; } /****************************************************************/ static Widget GetActiveText( XmFileSelectionBoxWidget fsb, XEvent *event ) { Widget activeChild = NULL ; /****************/ if( _XmGetFocusPolicy( (Widget) fsb) == XmEXPLICIT ) { if( (fsb->manager.active_child == SB_Text( fsb)) || (fsb->manager.active_child == FS_FilterText( fsb)) || (fsb->manager.active_child == FS_DirText( fsb)) ) { activeChild = fsb->manager.active_child ; } } else { if( SB_Text( fsb) && (XtWindow( SB_Text( fsb)) == ((XKeyPressedEvent *) event)->window) ) { activeChild = SB_Text( fsb) ; } else { if( FS_FilterText( fsb) && (XtWindow( FS_FilterText( fsb)) == ((XKeyPressedEvent *) event)->window) ) { activeChild = FS_FilterText( fsb) ; } else { if( FS_DirText( fsb) && (XtWindow( FS_DirText( fsb)) == ((XKeyPressedEvent *) event)->window) ) { activeChild = FS_DirText( fsb) ; } } } } return( activeChild) ; } /****************************************************************/ /*ARGSUSED*/ static void FileSelectionBoxUpOrDown( Widget wid, XEvent *event, String *argv, Cardinal *argc ) { XmFileSelectionBoxWidget fsb = (XmFileSelectionBoxWidget) wid ; int visible ; int top ; int key_pressed ; Widget list ; int * position ; int count ; Widget activeChild ; Arg av[5] ; Cardinal ac ; /****************/ if (!argc || (*argc != 1) || !argv) { XmeWarning(wid, MESSAGE0); return; } if( !(activeChild = GetActiveText( fsb, event)) ) { return ; } if( activeChild == SB_Text( fsb) ) { if( FS_StateFlags( fsb) & XmFS_NO_MATCH ) { return ; } list = SB_List( fsb) ; position = &SB_ListSelectedItemPosition( fsb) ; } else /* activeChild == FS_FilterText( fsb) */ { list = fsb->file_selection_box.dir_list ; position = &FS_DirListSelectedItemPosition( fsb) ; } if( !list ) { return ; } ac = 0 ; XtSetArg( av[ac], XmNitemCount, &count) ; ++ac ; XtSetArg( av[ac], XmNtopItemPosition, &top) ; ++ac ; XtSetArg( av[ac], XmNvisibleItemCount, &visible) ; ++ac ; XtGetValues( (Widget) list, av, ac) ; if( !count ) { return ; } if (_XmConvertActionParamToRepTypeId((Widget) fsb, XmRID_FILE_SELECTION_BOX_UP_OR_DOWN_ACTION_PARAMS, argv[0], True, &key_pressed) == False) { /* We couldn't convert the value. Just assume a value of 0. */ key_pressed = 0; } if( *position == 0 ) { /* No selection, so select first item. */ XmListSelectPos( list, ++*position, True) ; } else { if( !key_pressed && (*position > 1) ) { /* up */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, --*position, True) ; } else { if( (key_pressed == 1) && (*position < count) ) { /* down */ XmListDeselectPos( list, *position) ; XmListSelectPos( list, ++*position, True) ; } else { if( key_pressed == 2 ) { /* home */ XmListDeselectPos( list, *position) ; *position = 1 ; XmListSelectPos( list, *position, True) ; } else { if( key_pressed == 3 ) { /* end */ XmListDeselectPos( list, *position) ; *position = count ; XmListSelectPos( list, *position, True) ; } } } } } if( top > *position ) { XmListSetPos( list, *position) ; } else { if( (top + visible) <= *position ) { XmListSetBottomPos( list, *position) ; } } return ; } /****************************************************************/ static void FileSelectionBoxRestore( Widget wid, XEvent *event, String *argv, Cardinal *argc ) { XmFileSelectionBoxWidget fsb = (XmFileSelectionBoxWidget) wid ; String itemString ; String dir ; String mask ; int dirLen ; int maskLen ; Widget activeChild ; /****************/ if( !(activeChild = GetActiveText( fsb, event)) ) { return ; } if( activeChild == SB_Text( fsb) ) { _XmSelectionBoxRestore( (Widget) fsb, event, argv, argc) ; } else { if( FS_PathMode( fsb) == XmPATH_MODE_FULL ) { if ((dir = _XmStringGetTextConcat( FS_Directory( fsb))) != NULL) { dirLen = strlen( dir) ; if ((mask = _XmStringGetTextConcat( FS_Pattern( fsb))) != NULL) { maskLen = strlen( mask) ; itemString = XtMalloc( dirLen + maskLen + 1) ; strcpy( itemString, dir) ; strcpy( &itemString[dirLen], mask) ; XmTextFieldSetString( FS_FilterText( fsb), itemString) ; XmTextFieldSetInsertionPosition( FS_FilterText( fsb), XmTextFieldGetLastPosition( FS_FilterText( fsb))) ; XtFree( itemString) ; XtFree( mask) ; } XtFree( dir) ; } } else { if( activeChild == FS_FilterText( fsb) ) { if ((mask = _XmStringGetTextConcat(FS_Pattern(fsb))) != NULL) { XmTextFieldSetString( FS_FilterText( fsb), mask) ; XmTextFieldSetInsertionPosition( FS_FilterText( fsb), XmTextFieldGetLastPosition( FS_FilterText( fsb))) ; XtFree( mask) ; } } else /* activeChild == FS_DirText( fsb) */ { if ((dir = _XmStringGetTextConcat(FS_Directory(fsb))) != NULL) { XmTextFieldSetString( FS_DirText( fsb), dir) ; XmTextFieldSetInsertionPosition( FS_DirText( fsb), XmTextFieldGetLastPosition( FS_DirText( fsb))) ; XtFree( dir) ; } } } } return ; } /****************************************************************/ static void FileSelectionBoxFocusMoved( Widget wid, XtPointer client_data, XtPointer data ) { XmFocusMovedCallbackStruct * call_data = (XmFocusMovedCallbackStruct *) data ; Widget ancestor ; /****************/ if( !call_data->cont ) { /* Preceding callback routine wants focus-moved processing * to be discontinued. */ return ; } if( call_data->new_focus && ( (call_data->new_focus == FS_FilterText( client_data)) || (call_data->new_focus == FS_DirText( client_data)) || (call_data->new_focus == FS_DirList( client_data))) && XtIsManaged( SB_ApplyButton( client_data)) ) { BB_DefaultButton( client_data) = SB_ApplyButton( client_data) ; } /* * Fix for 4110 - Check to see if the new_focus is NULL. If it is, check * to see if the default button has been set. If not, set * it to the OkButton. Then, check if the new_focus is * either the File list or the File name text field. If * they are, set the default button to the OkButton. * Otherwise, leave the default button alone. */ else if (!call_data->new_focus && (BB_DefaultButton(client_data)) == NULL) { BB_DefaultButton( client_data) = SB_OkButton( client_data) ; } else if (call_data->new_focus && ((call_data->new_focus == SB_Text(client_data)) || (call_data->new_focus == SB_List(client_data)))) { BB_DefaultButton( client_data) = SB_OkButton( client_data) ; } /* * End Fix 4110 */ else { BB_DefaultButton( client_data) = SB_OkButton( client_data) ; } _XmBulletinBoardFocusMoved( wid, client_data, (XtPointer) call_data) ; /* Since the focus-moved callback of an ancestor bulletin board may * have already been called, we must make sure that it knows that * we have changed our default button. So, walk the hierarchy and * synchronize the dynamic default button of all ancestor bulletin * board widgets. */ if( call_data->cont ) { ancestor = XtParent( (Widget) client_data) ; while( ancestor && !XtIsShell( ancestor) ) { if( XmIsBulletinBoard( ancestor) ) { if( BB_DynamicDefaultButton( ancestor) && BB_DynamicDefaultButton( client_data) ) { _XmBulletinBoardSetDynDefaultButton( ancestor, BB_DynamicDefaultButton( client_data)) ; } } ancestor = XtParent( ancestor) ; } } return ; } /**************************************************************** * This is the procedure which does all of the button * callback magic. ****************/ static void FileSelectionPB( Widget wid, XtPointer which_button, XtPointer call_data ) { XmAnyCallbackStruct * callback = (XmAnyCallbackStruct *) call_data; XmFileSelectionBoxWidget fs ; XmFileSelectionBoxCallbackStruct searchData ; XmFileSelectionBoxCallbackStruct qualifiedSearchData ; Boolean match = True ; String text_value ; Boolean allowUnmanage = FALSE ; /****************/ fs = (XmFileSelectionBoxWidget) XtParent( wid) ; searchData.reason = XmCR_NONE ; searchData.event = callback->event ; searchData.value = NULL ; searchData.length = 0 ; searchData.mask = NULL ; searchData.mask_length = 0 ; searchData.dir = NULL ; searchData.dir_length = 0 ; searchData.pattern = NULL ; searchData.pattern_length = 0 ; if( ((long) which_button) == XmDIALOG_APPLY_BUTTON ) { if( FS_FilterText( fs) && (text_value = XmTextFieldGetString( FS_FilterText( fs))) ) { searchData.mask = XmStringGenerate(text_value, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; searchData.mask_length = XmStringLength( searchData.mask) ; XtFree( text_value) ; } if( FS_DirText( fs) && (text_value = XmTextFieldGetString( FS_DirText( fs))) ) { searchData.dir = XmStringGenerate(text_value, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; searchData.dir_length = XmStringLength( searchData.dir) ; XtFree( text_value) ; } searchData.reason = XmCR_NONE ; FileSelectionBoxUpdate( fs, &searchData) ; XmStringFree( searchData.mask) ; searchData.mask = NULL ; searchData.mask_length = 0 ; XmStringFree( searchData.dir) ; searchData.dir = NULL ; searchData.dir_length = 0 ; } /* Use the XmNqualifySearchDataProc routine to fill in all fields of the * callback data record. */ (*FS_QualifySearchDataProc( fs))( (Widget) fs, (XtPointer) &searchData, (XtPointer) &qualifiedSearchData) ; switch( (long) which_button ) { case XmDIALOG_OK_BUTTON: { if( SB_MustMatch( fs) ) { match = XmListItemExists( SB_List( fs), qualifiedSearchData.value) ; } if( !match ) { qualifiedSearchData.reason = XmCR_NO_MATCH ; XtCallCallbackList( ((Widget) fs), fs->selection_box.no_match_callback, &qualifiedSearchData) ; } else { qualifiedSearchData.reason = XmCR_OK ; XtCallCallbackList( ((Widget) fs), fs->selection_box.ok_callback, &qualifiedSearchData) ; } allowUnmanage = TRUE ; break ; } case XmDIALOG_APPLY_BUTTON: { qualifiedSearchData.reason = XmCR_APPLY ; XtCallCallbackList( ((Widget) fs), fs->selection_box.apply_callback, &qualifiedSearchData) ; break ; } case XmDIALOG_CANCEL_BUTTON: { qualifiedSearchData.reason = XmCR_CANCEL ; XtCallCallbackList( ((Widget) fs), fs->selection_box.cancel_callback, &qualifiedSearchData) ; allowUnmanage = TRUE ; break ; } case XmDIALOG_HELP_BUTTON: { if( fs->manager.help_callback ) { qualifiedSearchData.reason = XmCR_HELP ; XtCallCallbackList( ((Widget) fs), fs->manager.help_callback, &qualifiedSearchData) ; } else { _XmManagerHelp((Widget) fs, callback->event, NULL, NULL) ; } break ; } } XmStringFree( qualifiedSearchData.pattern) ; XmStringFree( qualifiedSearchData.dir) ; XmStringFree( qualifiedSearchData.mask) ; XmStringFree( qualifiedSearchData.value) ; if( allowUnmanage && fs->bulletin_board.shell && fs->bulletin_board.auto_unmanage ) { XtUnmanageChild( (Widget) fs) ; } return ; } /**************************************************************** * This function returns the widget id of the * specified SelectionBox child widget. ****************/ Widget XmFileSelectionBoxGetChild( Widget fs, #if NeedWidePrototypes unsigned int which ) #else unsigned char which ) #endif /* NeedWidePrototypes */ { Widget child ; /****************/ _XmWidgetToAppContext(fs); _XmAppLock(app); switch( which ) { case XmDIALOG_DIR_LIST: { child = FS_DirList( fs) ; break ; } case XmDIALOG_DIR_LIST_LABEL: { child = FS_DirListLabel( fs) ; break ; } case XmDIALOG_FILTER_LABEL: { child = FS_FilterLabel( fs) ; break ; } case XmDIALOG_FILTER_TEXT: { child = FS_FilterText( fs) ; break ; } default: { child = XmSelectionBoxGetChild( fs, which) ; break ; } } _XmAppUnlock(app); return( child) ; } /****************************************************************/ void XmFileSelectionDoSearch( Widget fs, XmString dirmask ) { XmFileSelectionBoxCallbackStruct searchData ; String textString ; /****************/ _XmWidgetToAppContext(fs); _XmAppLock(app); searchData.reason = XmCR_NONE ; searchData.event = 0 ; searchData.value = NULL ; searchData.length = 0 ; searchData.dir = NULL ; searchData.dir_length = 0 ; searchData.pattern = NULL ; searchData.pattern_length = 0 ; if( dirmask ) { searchData.mask = XmStringCopy( dirmask) ; searchData.mask_length = XmStringLength( searchData.mask) ; } else { if( FS_FilterText( fs) ) { textString = XmTextFieldGetString( FS_FilterText( fs)) ; } else { textString = NULL ; } if( textString ) { searchData.mask = XmStringGenerate(textString, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL) ; searchData.mask_length = XmStringLength( searchData.mask) ; XtFree( textString) ; } else { searchData.mask = NULL ; searchData.mask_length = 0 ; } if( FS_DirText( fs) && (textString = XmTextFieldGetString( FS_DirText( fs))) ) { searchData.dir = XmStringGenerate(textString, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); searchData.dir_length = XmStringLength( searchData.dir) ; XtFree( textString) ; } } FileSelectionBoxUpdate( (XmFileSelectionBoxWidget) fs, &searchData) ; XmStringFree( searchData.mask) ; XmStringFree( searchData.dir) ; _XmAppUnlock(app); return ; } /****************************************************************/ Widget XmCreateFileSelectionBox( Widget p, String name, ArgList args, Cardinal n ) { /****************/ return( XtCreateWidget( name, xmFileSelectionBoxWidgetClass, p, args, n)); } Widget XmVaCreateFileSelectionBox( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmFileSelectionBoxWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedFileSelectionBox( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmFileSelectionBoxWidgetClass, parent, True, var, count); va_end(var); return w; } /**************************************************************** * This convenience function creates a DialogShell * and a FileSelectionBox child of the shell; * returns the FileSelectionBox widget. ****************/ Widget XmCreateFileSelectionDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return XmeCreateClassDialog (xmFileSelectionBoxWidgetClass, parent, name, arglist, argcount) ; } static void FSBConvert(Widget wid, XtPointer client_data, XtPointer cb_struct) { enum { XmATARGETS, XmAFILE, XmAFILE_NAME, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmATEXT, NUM_ATOMS }; static char *atom_names[] = { XmSTARGETS, XmSFILE, XmSFILE_NAME, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSTEXT }; XmConvertCallbackStruct *cs = (XmConvertCallbackStruct *) cb_struct; Widget fsb = (Widget) client_data; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(wid), atom_names, XtNumber(atom_names), False, atoms); if (FS_DirSearchProc(fsb) == DirSearchProc && FS_FileSearchProc(fsb) == FileSearchProc) { if ((cs -> target == atoms[XmATARGETS] || cs -> target == atoms[XmA_MOTIF_EXPORT_TARGETS] || cs -> target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS])) { Atom *targs; targs = (Atom *) XtMalloc(sizeof(Atom) * 2); targs[0] = atoms[XmAFILE]; targs[1] = atoms[XmAFILE_NAME]; cs -> value = (XtPointer) targs; cs -> length = 2; cs -> type = XA_ATOM; cs -> format = 32; cs -> status = XmCONVERT_MERGE; } else if (cs -> target == atoms[XmAFILE] || cs -> target == atoms[XmAFILE_NAME]) { cs -> target = atoms[XmATEXT]; cs -> status = XmCONVERT_DEFAULT; } } else { cs -> status = XmCONVERT_REFUSE; } } motif-2.3.8/lib/Xm/DataFSelP.h0000644000175000017500000000401312672140200012621 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmDataFSelP_h #define _XmDataFSelP_h #include #ifdef __cplusplus extern "C" { #endif /******** External (DataF.c) function declaration *******/ #ifdef _NO_PROTO extern Widget _XmDataFieldGetDropReciever() ; #else extern Widget _XmDataFieldGetDropReciever( Widget w ) ; #endif /* _NO_PROTO */ /******** Private Function Declarations ********/ #ifdef _NO_PROTO extern Boolean _XmDataFieldConvert() ; extern void _XmDataFieldLoseSelection() ; #else extern Boolean _XmDataFieldConvert( Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format) ; extern void _XmDataFieldLoseSelection( Widget w, Atom *selection) ; #endif /* _NO_PROTO */ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDataFSelP_h */ /* DON't ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DrPoly.c0000644000175000017500000000355412672140200012273 00000000000000/* $XConsortium: DrPoly.c /main/6 1995/10/25 20:00:09 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include "RegionI.h" #include "XmI.h" /****************************XmeDrawPolygonShadow***************************/ void XmeDrawPolygonShadow ( Display *dpy, Drawable d, GC topGC, GC bottomGC, XPoint *points, int n_points, #if NeedWidePrototypes int shadowThickness, unsigned int shadowType) #else Dimension shadowThickness, unsigned char shadowType) #endif /* NeedWidePrototypes */ { Region xregion; XtAppContext app; app = XtDisplayToApplicationContext(dpy); _XmAppLock(app); xregion = XPolygonRegion(points, n_points, /* FillRule */ WindingRule); _XmRegionDrawShadow (dpy, d, topGC, bottomGC, (XmRegion)xregion, /* border_width */ 0, shadowThickness, shadowType); XDestroyRegion(xregion); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/ClipWindowP.h0000644000175000017500000000521512672140200013262 00000000000000/* $XConsortium: ClipWindowP.h /main/5 1995/07/15 20:48:39 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmClipWindowP_h #define _XmClipWindowP_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmClipWindowWidgetClass; typedef struct _XmClipWindowClassRec * XmClipWindowWidgetClass; typedef struct _XmClipWindowRec * XmClipWindowWidget; #ifndef XmIsClipWindow #define XmIsClipWindow(w) (XtIsSubclass (w, xmClipWindowWidgetClass)) #endif /* New fields for the ClipWindow widget class record */ typedef struct { XtPointer extension; } XmClipWindowClassPart; /* Full class record declaration */ typedef struct _XmClipWindowClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmDrawingAreaClassPart drawing_area_class; XmClipWindowClassPart clip_window_class; } XmClipWindowClassRec; externalref XmClipWindowClassRec xmClipWindowClassRec; /* New fields for the ClipWindow widget record */ typedef struct { unsigned char flags; Dimension old_width ; } XmClipWindowPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmClipWindowRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmDrawingAreaPart drawing_area; XmClipWindowPart clip_window; } XmClipWindowRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmClipWindowP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragOverSI.h0000644000175000017500000000602412672140200013027 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: DragOverSI.h /main/6 1995/07/14 10:26:24 drk $ */ #ifndef _XmDragOverSI_h #define _XmDragOverSI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for DragOverS.c ********/ extern void _XmDragOverHide( Widget w, #if NeedWidePrototypes int clipOriginX, int clipOriginY, #else Position clipOriginX, Position clipOriginY, #endif /* NeedWidePrototypes */ XmRegion clipRegion) ; extern void _XmDragOverShow( Widget w, #if NeedWidePrototypes int clipOriginX, int clipOriginY, #else Position clipOriginX, Position clipOriginY, #endif /* NeedWidePrototypes */ XmRegion clipRegion) ; extern void _XmDragOverMove( Widget w, #if NeedWidePrototypes int x, int y) ; #else Position x, Position y) ; #endif /* NeedWidePrototypes */ extern void _XmDragOverChange( Widget w, #if NeedWidePrototypes unsigned int dropSiteStatus) ; #else unsigned char dropSiteStatus) ; #endif /* NeedWidePrototypes */ extern void _XmDragOverFinish( Widget w, #if NeedWidePrototypes unsigned int completionStatus) ; #else unsigned char completionStatus) ; #endif /* NeedWidePrototypes */ extern Cursor _XmDragOverGetActiveCursor( Widget w) ; extern void _XmDragOverSetInitialPosition( Widget w, #if NeedWidePrototypes int initialX, int initialY) ; #else Position initialX, Position initialY) ; #endif /* NeedWidePrototypes */ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragOverSI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MessageBI.h0000644000175000017500000000316312672140200012662 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: MessageBI.h /main/5 1995/07/13 17:37:52 drk $ */ #ifndef _XmMessageBI_h #define _XmMessageBI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern XmGeoMatrix _XmMessageBoxGeoMatrixCreate( Widget wid, Widget instigator, XtWidgetGeometry *desired) ; extern Boolean _XmMessageBoxNoGeoRequest( XmGeoMatrix geoSpec) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMessageBI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/VirtKeys.h0000644000175000017500000000630413145162623012654 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmVirtKeys_h #define _XmVirtKeys_h #include #ifdef __cplusplus extern "C" { #endif #ifndef _OSF_Keysyms #define _OSF_Keysyms #define osfXK_Activate 0x1004FF44 #define osfXK_AddMode 0x1004FF31 #define osfXK_BackSpace 0x1004FF08 #define osfXK_BackTab 0x1004FF07 #define osfXK_BeginData 0x1004FF5A #define osfXK_BeginLine 0x1004FF58 #define osfXK_Cancel 0x1004FF69 #define osfXK_Clear 0x1004FF0B #define osfXK_Copy 0x1004FF02 #define osfXK_Cut 0x1004FF03 #define osfXK_Delete 0x1004FFFF #define osfXK_DeselectAll 0x1004FF72 #define osfXK_Down 0x1004FF54 #define osfXK_EndData 0x1004FF59 #define osfXK_EndLine 0x1004FF57 #define osfXK_Escape 0x1004FF1B #define osfXK_Extend 0x1004FF74 #define osfXK_Help 0x1004FF6A #define osfXK_Insert 0x1004FF63 #define osfXK_Left 0x1004FF51 #define osfXK_LeftLine 0x1004FFF8 #define osfXK_Menu 0x1004FF67 #define osfXK_MenuBar 0x1004FF45 #define osfXK_Next 0x1004FF56 #define osfXK_NextField 0x1004FF5E #define osfXK_NextMenu 0x1004FF5C #define osfXK_NextMinor 0x1004FFF5 #define osfXK_PageDown 0x1004FF42 #define osfXK_PageLeft 0x1004FF40 #define osfXK_PageRight 0x1004FF43 #define osfXK_PageUp 0x1004FF41 #define osfXK_Paste 0x1004FF04 #define osfXK_PrevField 0x1004FF5D #define osfXK_PrevMenu 0x1004FF5B #define osfXK_PrimaryPaste 0x1004FF32 #define osfXK_Prior 0x1004FF55 #define osfXK_PriorMinor 0x1004FFF6 #define osfXK_QuickPaste 0x1004FF33 #define osfXK_Reselect 0x1004FF73 #define osfXK_Restore 0x1004FF78 #define osfXK_Right 0x1004FF53 #define osfXK_RightLine 0x1004FFF7 #define osfXK_Select 0x1004FF60 #define osfXK_SelectAll 0x1004FF71 #define osfXK_SwitchDirection 0x1004FF7E #define osfXK_Undo 0x1004FF65 #define osfXK_Up 0x1004FF52 #endif /* OSF_Keysyms */ /******** Public Function Declarations ********/ extern void XmTranslateKey( Display *dpy, #if NeedWidePrototypes unsigned int keycode, #else KeyCode keycode, #endif /* NeedWidePrototypes */ Modifiers modifiers, Modifiers *modifiers_return, KeySym *keysym_return) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVirtKeys_h */ motif-2.3.8/lib/Xm/AccColorT.h0000644000175000017500000000471712672140200012702 00000000000000/* $XConsortium: AccColorT.h /main/5 1995/07/15 20:47:59 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmAccessColorsT_H #define _XmAccessColorsT_H #include #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTaccessColors; /* this one can be expanded in the future */ typedef struct _XmAccessColorDataRec { Mask valueMask ; Pixel foreground ; Pixel background ; Pixel highlight_color ; Pixel top_shadow_color ; Pixel bottom_shadow_color ; Pixel select_color ; } XmAccessColorDataRec, *XmAccessColorData; typedef void (*XmAccessColorsGetProc)(Widget widget, XmAccessColorData color_data); typedef void (*XmAccessColorsSetProc)(Widget widget, XmAccessColorData color_data); /* Trait structures and typedefs, place typedefs first */ /* Version 0: initial release. */ typedef struct _XmAccessColorsTraitRec { int version; /* 0 */ XmAccessColorsGetProc getColors; XmAccessColorsGetProc setColors; } XmAccessColorsTraitRec, *XmAccessColorsTrait; #define AccessColorInvalid 0L #define AccessForeground (1L<<0) #define AccessBackgroundPixel (1L<<1) #define AccessHighlightColor (1L<<2) #define AccessTopShadowColor (1L<<3) #define AccessBottomShadowColor (1L<<4) #define AccessSelectColor (1L<<5) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* to do: add it to PushB/G and ToggleB/G so that they can report their select color implement the setValues ? */ #endif /* _XmAccessColorsT_H */ motif-2.3.8/lib/Xm/CascadeB.c0000644000175000017500000021641113145162623012516 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: CascadeB.c /main/27 1999/08/11 14:26:35 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" /* ShellP.h doesn't define externalref. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "CascadeBI.h" #include "CascadeBGI.h" #include "LabelI.h" #include "GadgetUtiI.h" #include "MenuStateI.h" #include "MenuProcI.h" #include "MenuUtilI.h" #include "MessagesI.h" #include "PrimitiveI.h" #include "RCMenuI.h" #include "TearOffI.h" #include "TraversalI.h" #include "UniqueEvnI.h" #define FIX_1509 #define CASCADE_PIX_SPACE 4 /* pixels between label and bit map */ #define MAP_DELAY_DEFAULT 180 #define EVENTS ((unsigned int) (ButtonPressMask | \ ButtonReleaseMask | EnterWindowMask | \ LeaveWindowMask)) #define WRONGPARENT _XmMMsgCascadeB_0000 #define WRONGSUBMENU _XmMMsgCascadeB_0001 #define WRONGMAPDELAY _XmMMsgCascadeB_0002 /******** Static Function Declarations ********/ static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void BorderHighlight( Widget wid) ; static void BorderUnhighlight( Widget wid) ; static void DrawShadow( register XmCascadeButtonWidget cb) ; static void DrawCascade( register XmCascadeButtonWidget cb) ; static void Redisplay( register Widget cb, XEvent *event, Region region) ; static void Arm( register XmCascadeButtonWidget cb) ; static void ArmAndPost( XmCascadeButtonWidget cb, XEvent *event) ; static void ArmAndActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; static void Disarm( register XmCascadeButtonWidget cb, #if NeedWidePrototypes int unpost) ; #else Boolean unpost) ; #endif /* NeedWidePrototypes */ static void PostTimeout( XtPointer closure, XtIntervalId *id) ; static void DelayedArm( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void CheckDisarm( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void StartDrag( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void Select( register XmCascadeButtonWidget cb, XEvent *event, #if NeedWidePrototypes int doCascade) ; #else Boolean doCascade) ; #endif /* NeedWidePrototypes */ static void DoSelect( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void KeySelect( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void MenuBarSelect( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void MenuBarEnter( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void MenuBarLeave( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void CleanupMenuBar( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; static void PopdownGrandChildren( XmRowColumnWidget rowcol) ; static void Cascading( Widget w, XEvent *event) ; static void Popup( Widget cb, XEvent *event) ; static void size_cascade( XmCascadeButtonWidget cascadebtn) ; static void position_cascade( XmCascadeButtonWidget cascadebtn) ; static void setup_cascade( XmCascadeButtonWidget cascadebtn, #if NeedWidePrototypes int adjustWidth, int adjustHeight) ; #else Boolean adjustWidth, Boolean adjustHeight) ; #endif /* NeedWidePrototypes */ static void Destroy( Widget wid) ; static void Resize( Widget cb) ; static Boolean SetValuesPrehook( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void InitializePrehook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void GetArmGC( XmCascadeButtonWidget cb) ; static void GetBackgroundGC( XmCascadeButtonWidget cb) ; static void Initialize( Widget w_req, Widget w_new, ArgList args, Cardinal *num_args) ; /******** End Static Function Declarations ********/ /* * event translation tables for cascadebutton. There are different * ones for the different menus a cascadebutton widget can appear in */ static XtTranslations menubar_events_parsed; #define menubar_events _XmCascadeB_menubar_events static XtTranslations p_events_parsed; #define p_events _XmCascadeB_p_events static XtActionsRec action_table [] = { {"DelayedArm", DelayedArm}, {"CheckDisarm", CheckDisarm}, {"StartDrag", StartDrag}, {"DoSelect", DoSelect}, {"KeySelect", KeySelect}, {"MenuBarSelect", MenuBarSelect}, {"MenuBarEnter", MenuBarEnter}, {"MenuBarLeave", MenuBarLeave}, {"MenuButtonTakeFocus", _XmMenuButtonTakeFocus }, {"MenuButtonTakeFocusUp", _XmMenuButtonTakeFocusUp }, {"CleanupMenuBar", CleanupMenuBar}, {"Help", _XmCBHelp}, }; static XtResource resources[] = { { XmNactivateCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmCascadeButtonRec, cascade_button.activate_callback), XmRCallback, NULL }, { XmNcascadingCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf( struct _XmCascadeButtonRec, cascade_button.cascade_callback), XmRCallback, NULL }, { XmNsubMenuId, XmCMenuWidget, /* submenu */ XmRMenuWidget, sizeof (Widget), XtOffsetOf( struct _XmCascadeButtonRec, cascade_button.submenu), XmRMenuWidget, (XtPointer) NULL }, { XmNcascadePixmap, XmCPixmap, XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf( struct _XmCascadeButtonRec, cascade_button.cascade_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNmappingDelay, XmCMappingDelay, XmRInt, sizeof (int), XtOffsetOf( struct _XmCascadeButtonRec, cascade_button.map_delay), XmRImmediate, (XtPointer) MAP_DELAY_DEFAULT }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmCascadeButtonRec, primitive.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean), XtOffsetOf( struct _XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmPrimitiveRec, primitive.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmLabelRec, label.margin_width), XmRImmediate, (XtPointer) XmINVALID_DIMENSION }, }; /* * static initialization of the cascade button widget class record, * must do each field */ static XmBaseClassExtRec cascadeBBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ InitializePrehook, /* initialize prehook */ SetValuesPrehook, /* set_values prehook */ InitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ XmInheritGetSecResData, /* getSecResData */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ }; externaldef(xmcascadebuttonclassrec) XmCascadeButtonClassRec xmCascadeButtonClassRec = { { /* core class record */ (WidgetClass) &xmLabelClassRec, /* superclass ptr */ "XmCascadeButton", /* class_name */ sizeof (XmCascadeButtonWidgetRec), /* size of Pulldown widget */ ClassInitialize, /* class init proc */ ClassPartInitialize, /* chained class init */ FALSE, /* class is not init'ed */ Initialize, /* widget init proc */ NULL, /* init_hook proc */ XtInheritRealize, /* widget realize proc */ action_table, /* class action table */ XtNumber (action_table), resources, /* this class's resource list*/ XtNumber (resources), /* " " resource_count */ NULLQUARK, /* xrm_class */ TRUE, /* compress motion */ XtExposeCompressMaximal, /* compress exposure */ TRUE, /* compress enter-leave */ FALSE, /* no VisibilityNotify */ Destroy, /* class destroy proc */ Resize, /* class resize proc */ Redisplay, /* expose proc */ SetValues, /* set_value proc */ NULL, /* set_value_hook proc */ XtInheritSetValuesAlmost, /* set_value_almost proc */ NULL, /* get_values_hook */ NULL, /* class accept focus proc */ XtVersion, /* current version */ NULL, /* callback offset list */ NULL, /* default translation table */ /* this is manually set */ XtInheritQueryGeometry, /* query geo proc */ NULL, /* display accelerator*/ (XtPointer)&cascadeBBaseClassExtRec, /* extension */ }, { /* Primitive Class record */ BorderHighlight, /* border_highlight */ BorderUnhighlight, /* border_uhighlight */ XtInheritTranslations, /* translations */ ArmAndActivate, /* arm & activate */ NULL, /* get resources */ 0, /* num get_resources */ NULL, /* extension */ }, { /* Label Class record */ XmInheritWidgetProc, /* set override callback */ XmInheritMenuProc, /* menu procedures */ XtInheritTranslations, /* menu traversal xlation */ NULL, /* extension */ }, { /* cascade_button class record */ NULL, /* extension */ } }; /* * now make a public symbol that points to this class record */ externaldef(xmcascadebuttonwidgetclass) WidgetClass xmCascadeButtonWidgetClass = (WidgetClass) &xmCascadeButtonClassRec; /* Menu Savvy trait record */ static XmMenuSavvyTraitRec MenuSavvyRecord = { /* version: */ -1, NULL, NULL, NULL, _XmCBNameActivate, }; /* * parse the translation tables for the different menutypes */ static void ClassInitialize( void ) { menubar_events_parsed = XtParseTranslationTable (menubar_events); p_events_parsed = XtParseTranslationTable (p_events); /* set up base class extension quark */ cascadeBBaseClassExtRec.record_type = XmQmotif; } /* * set up fast subclassing */ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmCASCADE_BUTTON_BIT); /* Install the menu savvy trait record, copying fields from XmLabel */ _XmLabelCloneMenuSavvy (wc, &MenuSavvyRecord); } /* * The button is armed (does not pop up submenus). */ static void BorderHighlight( Widget wid ) { Arm ((XmCascadeButtonWidget) wid); } /* * The button is disarmed (does not pop down submenus). */ static void BorderUnhighlight( Widget wid ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid; Boolean popdown; if (Lab_IsMenupane(cb) && (((XmManagerWidget)XtParent(cb))->manager.active_child == wid) && CB_Submenu(cb)) { XmMenuShellWidget mshell = (XmMenuShellWidget) XtParent(CB_Submenu(cb)); if ((mshell->composite.children[0] == CB_Submenu(cb)) && (XmIsMenuShell(mshell)) && (mshell->shell.popped_up)) { popdown = True; } else popdown = False; } else popdown = False; Disarm ((XmCascadeButtonWidget) wid, popdown); } /* * Draw the 3D shadow around the widget if its is armed. */ static void DrawShadow( register XmCascadeButtonWidget cb ) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay((Widget) cb)); Boolean etched_in = dpy -> display.enable_etched_in_menu; if (CB_IsArmed(cb)) { if (XtIsRealized((Widget)cb)) { XmeDrawShadows (XtDisplay (cb), XtWindow (cb), cb->primitive.top_shadow_GC, cb->primitive.bottom_shadow_GC, cb->primitive.highlight_thickness, cb->primitive.highlight_thickness, cb->core.width - 2 * cb->primitive.highlight_thickness, cb->core.height - 2 * cb->primitive.highlight_thickness, cb->primitive.shadow_thickness, etched_in ? XmSHADOW_IN : XmSHADOW_OUT); } } } static void DrawCascade( register XmCascadeButtonWidget cb ) { if ((CB_HasCascade(cb)) && (CB_Cascade_width(cb) != 0)) { Pixmap pixmap ; int depth ; pixmap = CB_IsArmed(cb) && (CB_ArmedPixmap(cb) != XmUNSPECIFIED_PIXMAP) ? CB_ArmedPixmap(cb) : CB_CascadePixmap(cb) ; XmeGetPixmapData(XtScreen(cb), pixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == cb->core.depth) XCopyArea (XtDisplay(cb), pixmap, XtWindow(cb), cb->label.normal_GC, 0, 0, CB_Cascade_width(cb), CB_Cascade_height(cb), CB_Cascade_x(cb), CB_Cascade_y(cb)); else if (depth == 1) XCopyPlane (XtDisplay(cb), pixmap, XtWindow(cb), cb->label.normal_GC, 0, 0, CB_Cascade_width(cb), CB_Cascade_height(cb), CB_Cascade_x(cb), CB_Cascade_y(cb), 1); } } /* * redisplay the widget */ static void Redisplay( register Widget cb, XEvent *event, Region region ) { #ifdef FIX_1395 Pixel tmpc; #endif if (XtIsRealized (cb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Boolean etched_in = dpy->display.enable_etched_in_menu; GC tmpGC = NULL; XtExposeProc expose; if (etched_in) { #ifdef FIX_1509 if (CB_IsArmed(cb)) XFillRectangle(XtDisplay(cb), XtWindow(cb), CB_ArmGC(cb), 0, 0, cb->core.width, cb->core.height); else XClearArea(XtDisplay(cb), XtWindow(cb), 0, 0, cb->core.width, cb->core.height, False); #else XFillRectangle(XtDisplay(cb), XtWindow(cb), CB_IsArmed(cb) ? CB_ArmGC(cb) : CB_BackgroundGC(cb), 0, 0, cb->core.width, cb->core.height); #endif #ifdef USE_XFT } else if (Lab_MenuType(cb) != XmWORK_AREA) { /* adeed with XFT support */ XClearArea(XtDisplay(cb), XtWindow(cb), 0, 0, cb->core.width, cb->core.height, False); #endif } if (etched_in && CB_IsArmed(cb)) { Pixel junk, select_pix; Boolean replaceGC = False; XmGetColors(XtScreen(cb), cb->core.colormap, cb->core.background_pixel, &junk, &junk, &junk, &select_pix); if (select_pix == ((XmCascadeButtonWidget)cb)->primitive.foreground) { replaceGC = True; tmpGC = ((XmCascadeButtonWidget)cb)->label.normal_GC; ((XmCascadeButtonWidget)cb)->label.normal_GC = CB_BackgroundGC(cb); } #ifdef FIX_1395 /* 1395: By default (if not etched and not armed) window (widget) have background color that used to draw widget bg. When widget is etched, background selected correctly (as selected color), but label exposr method will use default background color to fill area bellow lable text. Result is ugly menus. We should replace colors before expose from label and change it back after repainting. */ tmpc = cb->core.background_pixel; XSetWindowBackground(XtDisplay(cb), XtWindow(cb), select_pix); #endif _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (*expose)((Widget) cb, event, region); #ifdef FIX_1395 /* Set correct window background (label is repainted, role back) */ XSetWindowBackground(XtDisplay(cb), XtWindow(cb), tmpc); if (cb->core.background_pixmap != XmUNSPECIFIED_PIXMAP) XSetWindowBackgroundPixmap(XtDisplay(cb), XtWindow(cb), cb->core.background_pixmap); #endif if (replaceGC) ((XmCascadeButtonWidget)cb)->label.normal_GC = tmpGC; } else { /* Label class does most of the work */ _XmProcessLock(); expose = xmLabelClassRec.core_class.expose; _XmProcessUnlock(); (*expose)(cb, event, region); } DrawCascade((XmCascadeButtonWidget) cb); DrawShadow ((XmCascadeButtonWidget) cb); } } /* * Arming the cascadebutton consists of setting the armed bit * and drawing the 3D shadow. */ static void Arm( register XmCascadeButtonWidget cb ) { if (!CB_IsArmed(cb)) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Boolean etched_in = dpy->display.enable_etched_in_menu; CB_SetArmed(cb, TRUE); if (etched_in) Redisplay((Widget) cb, NULL, NULL); else { DrawCascade(cb); DrawShadow (cb); } } XmProcessTraversal((Widget) cb, XmTRAVERSE_CURRENT); } /* * Post the submenu and then arm the button. The arming is done * second so that the post can be quickly as possible. */ static void ArmAndPost( XmCascadeButtonWidget cb, XEvent *event ) { if (!CB_IsArmed(cb)) { _XmCascadingPopup ((Widget) cb, event, TRUE); Arm (cb); } } /* * class function to cause the cascade button to be armed and selected */ /*ARGSUSED*/ static void ArmAndActivate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params ) /* unused */ { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmRowColumnWidget parent = (XmRowColumnWidget) XtParent(cb); XmMenuSystemTrait menuSTrait; Time _time; /* check if event has been processed - if it's NULL, override processing */ if (event && !_XmIsEventUnique(event)) return; _time = _XmGetDefaultTime(wid, event); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (menuSTrait == NULL) { /* We're in trouble. This isn't a valid menu that we're in and Arm and Activate has been called. Abort ! */ return; } switch (Lab_MenuType (cb)) { case XmMENU_BAR: { ShellWidget myShell = NULL; /* Shared menupanes require some additional checks */ if (CB_Submenu(cb)) myShell = (ShellWidget)XtParent(CB_Submenu(cb)); if (myShell && XmIsMenuShell(myShell) && /* not torn ?! */ (myShell->shell.popped_up) && (myShell->composite.children[0] == CB_Submenu(cb)) && (cb == (XmCascadeButtonWidget)RC_CascadeBtn(CB_Submenu(cb)))) { menuSTrait -> popdown((Widget) parent, event); Disarm (cb, FALSE); } else { /* call the cascading callbacks first thing */ Cascading ((Widget) cb, event); /* * check if the traversing flag is set true. This indicates * that we are in a traverse and don't want to activate if * there is no submenu attached. Set during KDown in menubar. */ if (CB_Traversing(cb) && !CB_Submenu(cb)) return; if (! RC_IsArmed (parent)) { _XmMenuFocus((Widget) parent, XmMENU_BEGIN, _time); menuSTrait -> arm((Widget) cb); } else menuSTrait -> menuBarCleanup((Widget) parent); /* do the select without calling the cascading callbacks again */ Select (cb, event, FALSE); /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); if (CB_Submenu(cb)) { /* * if XmProcessTraversal() fails, it's possible that the pane * has no traversable children, so reset the focus to the pane. */ if (!XmProcessTraversal(CB_Submenu(cb), XmTRAVERSE_CURRENT)) { /* Must clear focus path first for shared menushells. * Otherwise, moving the focus back will have old stale * (old) focus_item. */ _XmClearFocusPath(CB_Submenu(cb)); XtSetKeyboardFocus(XtParent(CB_Submenu(cb)), CB_Submenu(cb)); } } else { menuSTrait -> disarm((Widget) parent); _XmMenuFocus(XtParent(cb), XmMENU_END, _time); XtUngrabPointer( (Widget) cb, _time); } } break; } case XmMENU_PULLDOWN: case XmMENU_POPUP: { /* In case the tear off is active but not armed or grabbed */ menuSTrait -> tearOffArm((Widget) parent); Select (cb, event, TRUE); if (CB_Submenu(cb)) { /* * if XmProcessTraversal() fails, it's possible that the pane * has no traversable children, so reset the focus to the pane. */ if (!XmProcessTraversal(CB_Submenu(cb), XmTRAVERSE_CURRENT)) { /* Must clear focus path first for shared menushells. * Otherwise, moving the focus back will have old stale * (old) focus_item. */ _XmClearFocusPath(CB_Submenu(cb)); XtSetKeyboardFocus(XtParent(CB_Submenu(cb)), CB_Submenu(cb)); } } break; } } /* Record so spring loaded DispatchEvent() doesn't recall this routine. */ if (event) _XmRecordEvent(event); } /* * disarm the menu. This may include popping down any submenu that is up or * removing the timeout to post a submenu */ static void Disarm( register XmCascadeButtonWidget cb, #if NeedWidePrototypes int unpost ) #else Boolean unpost ) #endif /* NeedWidePrototypes */ { Widget rowcol = XtParent (cb); if (CB_IsArmed(cb)) { CB_SetArmed(cb, FALSE); /* popdown any posted submenus */ if (unpost && RC_PopupPosted(rowcol)) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))(RC_PopupPosted(rowcol),NULL, NULL, NULL); } /* if a delayed arm is pending, remove it */ if (cb->cascade_button.timer) { XtRemoveTimeOut (cb->cascade_button.timer); cb->cascade_button.timer = 0; } /* if the shadow is drawn and the menupane is not going down, erase it */ if ((! RC_PoppingDown(rowcol)) || RC_TornOff(rowcol)) { if (XtIsRealized ((Widget)cb)) { /* etched in menu button */ XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(cb)); Boolean etched_in = dpy->display.enable_etched_in_menu; if (etched_in) Redisplay((Widget) cb, NULL, NULL); else XmeClearBorder (XtDisplay (cb), XtWindow (cb), cb->primitive.highlight_thickness, cb->primitive.highlight_thickness, cb->core.width - 2 * cb->primitive.highlight_thickness, cb->core.height - 2 * cb->primitive.highlight_thickness, cb->primitive.shadow_thickness); } } DrawCascade(cb); } } /* * called when the post delay timeout occurs. */ /*ARGSUSED*/ static void PostTimeout( XtPointer closure, XtIntervalId *id) /* unused */ { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) closure ; if (cb->cascade_button.timer) { cb->cascade_button.timer = 0; _XmCascadingPopup ((Widget) cb, NULL, TRUE); } } /* * set the timer to post the submenu if a leave event does * not occur first. */ /*ARGSUSED*/ static void DelayedArm( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; if ((! CB_IsArmed(cb)) && (((XmMenuShellWidget) XtParent(XtParent(cb)))->shell.popped_up) && _XmGetInDragMode((Widget) cb)) { if (cb->cascade_button.map_delay <= 0) ArmAndPost (cb, event); else { /* To fix CR 8172, the following two lines were reversed. Because calling Arm seems to cause a focus change (temporary) out of the widget, the timer was incorrectly removed and the menu wouldn't post. */ Arm(cb); cb->cascade_button.timer = XtAppAddTimeOut(XtWidgetToApplicationContext( (Widget) cb), (unsigned long) cb->cascade_button.map_delay, PostTimeout, (XtPointer) cb) ; } } } /* * if traversal is not on and the mouse * has not entered its cascading submenu, disarm the * cascadebutton. */ /*ARGSUSED*/ static void CheckDisarm( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; register XmMenuShellWidget submenushell; XEnterWindowEvent * entEvent = (XEnterWindowEvent *) event; if (_XmGetInDragMode((Widget) cb) && (/* !ActiveTearOff || */ event->xcrossing.mode == NotifyNormal)) { if ((CB_IsArmed(cb)) && (CB_Submenu(cb))) { submenushell = (XmMenuShellWidget) XtParent (CB_Submenu(cb)); if (submenushell->shell.popped_up) { if ((entEvent->x_root >= submenushell->core.x) && (entEvent->x_root < submenushell->core.x + submenushell->core.width + (submenushell->core.border_width << 1)) && (entEvent->y_root >= submenushell->core.y) && (entEvent->y_root < submenushell->core.y + submenushell->core.height + (submenushell->core.border_width << 1))) /* then we are in the cascading submenu, don't disarm */ return; /* * When kick-starting a cascading menu from a tear off, we grab * the pointer to the parent rc when the cascade has the focus * (In StartDrag(). A leave window event is generated (with * mode = NotifyGrab) which we don't wish to recognize. */ if ((entEvent->mode == NotifyGrab) && !XmIsMenuShell(XtParent(XtParent(cb)))) return; } } Disarm (cb, TRUE); } } /* * post submenu and disable menu's traversal. The order of these * function calls is critical. */ /*ARGSUSED*/ static void StartDrag( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; Boolean validButton; XmRowColumnWidget parent = (XmRowColumnWidget)XtParent(cb); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) parent), XmQTmenuSystem); /* If no menu system trait then parent isn't a menu as it should be */ if (menuSTrait == NULL) return; /* Start with posted submenu bit reset */ CB_SetWasPosted(cb, FALSE); if (CB_Submenu(cb) && RC_IsArmed ((XmRowColumnWidget) CB_Submenu(cb))) { CB_SetWasPosted(cb, TRUE); } /* * make sure the shell is popped up, this takes care of a corner case * that can occur with rapid pressing of the mouse button */ if (Lab_IsMenupane(cb) && (!((XmMenuShellWidget) XtParent(parent))->shell.popped_up)) { /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); return; } validButton = menuSTrait -> verifyButton((Widget) parent, event); if (validButton) { /* In case the tear off is active but not armed or grabbed */ menuSTrait -> tearOffArm((Widget) parent); _XmSetInDragMode((Widget) cb, True); _XmCascadingPopup ((Widget) cb, event, TRUE); Arm (cb); /* record event so MenuShell does not process it */ _XmRecordEvent (event); } /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); } /* * do the popup (either w/ or w/o the cascade callbacks). * If there is not a submenu, bring down the menu system. */ static void Select( register XmCascadeButtonWidget cb, XEvent *event, #if NeedWidePrototypes int doCascade ) #else Boolean doCascade ) #endif /* NeedWidePrototypes */ { XmAnyCallbackStruct cback; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(cb)), XmQTmenuSystem); if (menuSTrait == NULL) return; if (CB_WasPosted(cb)) { Disarm(cb, TRUE); if ((CB_Submenu(cb) != NULL) && (Lab_MenuType(cb) == XmMENU_BAR)) _XmMenuPopDown(XtParent((Widget) cb), event, NULL); return; } _XmCascadingPopup ((Widget) cb, event, doCascade); /* * check if there is a submenu here in case this changed during * the cascading callbacks */ if (CB_Submenu(cb) == NULL) { menuSTrait -> popdown(XtParent(cb), event); Disarm (cb, FALSE); menuSTrait -> disarm(XtParent(cb)); cback.event = event; cback.reason = XmCR_ACTIVATE; if (menuSTrait != NULL) { menuSTrait -> entryCallback(XtParent(cb), (Widget) cb, &cback); } if ((! cb->label.skipCallback) && (cb->cascade_button.activate_callback)) { XtCallCallbackList ((Widget) cb, cb->cascade_button.activate_callback, &cback); } } else { Arm(cb); } } /* * if there is a submenu, enable traversal. * call select to do the work */ /*ARGSUSED*/ static void DoSelect( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { register XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; Boolean validButton; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (menuSTrait == NULL) return; /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); if (event && event -> type == ButtonRelease && event -> xbutton.button == 2) return; if (!CB_IsArmed(cb)) return; if ((Lab_MenuType(cb) == XmMENU_BAR) && !RC_IsArmed (XtParent(cb))) return; /* * make sure the shell is popped up, this takes care of a corner case * that can occur with rapid pressing of the mouse button */ if (Lab_IsMenupane(cb) && (!((XmMenuShellWidget) XtParent(XtParent(cb)))->shell.popped_up)) { return; } validButton = menuSTrait -> verifyButton(XtParent(cb), event); if (validButton) { Select (cb, event, (Boolean)(CB_Submenu(cb) != NULL)); /* don't let the menu shell widget process this event */ _XmRecordEvent (event); _XmSetInDragMode((Widget) cb, False); if (CB_Submenu(cb)) { /* * if XmProcessTraversal() fails, it's possible that the pane * has no traversable children, so reset the focus to the pane. */ if (!XmProcessTraversal(CB_Submenu(cb), XmTRAVERSE_CURRENT)) { /* Must clear focus path first for shared menushells. * Otherwise, moving the focus back will have old stale * (old) focus_item. */ _XmClearFocusPath(CB_Submenu(cb)); XtSetKeyboardFocus(XtParent(CB_Submenu(cb)), CB_Submenu(cb)); } } else { /* Move this call into Select(). * * (* xmLabelClassRec.label_class.menuProcs) (XmMENU_DISARM, * XtParent(cb)); */ if (Lab_MenuType(cb) == XmMENU_BAR) { _XmMenuFocus(XtParent(cb), XmMENU_END, CurrentTime); XtUngrabPointer( (Widget) cb, CurrentTime); } } } } /* * if the menu system traversal is enabled, do a select */ /*ARGSUSED*/ static void KeySelect( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; if (!_XmGetInDragMode((Widget) cb) && (RC_IsArmed(XtParent(cb)) || (RC_Type(XtParent(cb)) != XmMENU_BAR && !XmIsMenuShell(XtParent(XtParent(cb)))))) (* (((XmCascadeButtonClassRec *)(cb->core.widget_class))-> primitive_class.arm_and_activate)) ((Widget) cb, event, NULL, NULL); } /* * If the menu system is not active, arm it and arm this cascadebutton * else start the drag mode */ static void MenuBarSelect( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; Boolean validButton; Time _time = _XmGetDefaultTime(wid, event); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); if (menuSTrait == NULL) return; CB_SetWasPosted(cb, FALSE); if (RC_IsArmed ((XmRowColumnWidget) XtParent(cb))) { /* Cleanup the PM menubar mode, if enabled */ menuSTrait -> menuBarCleanup(XtParent(cb)); if (!CB_Submenu(cb)) { _XmMenuFocus(XtParent(cb), XmMENU_MIDDLE, _time); } StartDrag ((Widget) cb, event, param, num_param); } else { /* XAllowEvents() is called here because StartDrag also calls it */ /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); validButton = menuSTrait -> verifyButton(XtParent(cb), event); if (validButton) { /* * Don't post the menu if the menu cannot control grabs! */ if (_XmMenuGrabKeyboardAndPointer(XtParent(cb), _time) != GrabSuccess) { _XmRecordEvent (event); return; } _XmMenuFocus(XtParent(cb), XmMENU_BEGIN, _time); menuSTrait -> arm((Widget) cb); _XmSetInDragMode((Widget) cb, True); _XmCascadingPopup ((Widget) cb, event, TRUE); if (!CB_Submenu(cb)) { /* * since no submenu is posted, check if the grab has occured * and if not, do the pointer grab now. */ if (RC_BeingArmed(XtParent(cb))) { _XmGrabPointer(XtParent(cb), True, EVENTS, GrabModeAsync, GrabModeAsync, None, XmGetMenuCursor(XtDisplay(cb)), _time); RC_SetBeingArmed(XtParent(cb), False); } } /* To support menu replay, keep the pointer in sync mode */ XAllowEvents(XtDisplay(cb), SyncPointer, CurrentTime); /* record so that menuShell doesn't process this event */ _XmRecordEvent (event); } } } /* * If the menu is active, post submenu and arm. */ /*ARGSUSED*/ static void MenuBarEnter( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { register XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmRowColumnWidget rc = (XmRowColumnWidget)XtParent(cb); if (RC_IsArmed(rc) && !CB_IsArmed(cb) && _XmGetInDragMode((Widget) cb)) { if (!CB_Submenu(cb)) { _XmMenuFocus((Widget) rc, XmMENU_MIDDLE, _XmGetDefaultTime(wid, event)); } _XmCascadingPopup ((Widget) cb, event, TRUE); Arm(cb); } } /* * unless our submenu is posted or traversal is on, disarm */ /*ARGSUSED*/ static void MenuBarLeave( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { register XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmMenuShellWidget submenuShell; if (RC_IsArmed (XtParent (cb))) { /* Reset this bit so that we don't unpost if the user reenters the cascade button */ CB_SetWasPosted(cb, FALSE); if (CB_Submenu(cb)) { submenuShell = (XmMenuShellWidget) XtParent(CB_Submenu(cb)); if (submenuShell->shell.popped_up) return; } if (_XmGetInDragMode((Widget) cb)) Disarm (cb, TRUE); } } /* * Cleanup the menubar, if its in the PM traversal mode */ /*ARGSUSED*/ static void CleanupMenuBar( Widget wid, XEvent *event, String *param, Cardinal *num_param ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmRowColumnWidget parent = (XmRowColumnWidget)XtParent(cb); if (RC_IsArmed(parent)) { (* ((XmRowColumnWidgetClass) XtClass(parent))-> row_column_class.armAndActivate) ( (Widget) parent, (XEvent *) NULL, (String *) NULL, (Cardinal *) NULL); _XmRecordEvent(event); } } /* * CascadeButton Widget and Gadget help routine - first bring down the * menu and then do the help callback. */ void _XmCBHelp( Widget w, XEvent *event, String *params, Cardinal *num_params ) { XmRowColumnWidget parent = (XmRowColumnWidget) XtParent(w); if (RC_Type(parent) == XmMENU_BAR) { /* Cannot call CleanupMenubar() 'cause it calls _XmRecordEvent */ if (RC_IsArmed(parent)) { (* ((XmRowColumnWidgetClass) XtClass(parent))-> row_column_class.armAndActivate) ( (Widget) parent, (XEvent *) NULL, (String *) NULL, (Cardinal *) NULL); } } else if ((RC_Type(parent) == XmMENU_PULLDOWN) || (RC_Type(parent) == XmMENU_POPUP)) { (*(((XmMenuShellClassRec *) xmMenuShellWidgetClass)-> menu_shell_class.popdownDone)) (XtParent(parent), event, params, num_params); } if (XmIsGadget(w)) _XmSocorro(w, event, params, num_params); else _XmPrimitiveHelp( w, event, params, num_params) ; } /* * When moving between a shared menupane, we only want to unpost the * descendant panes, not the shared one. * We only need to check the first popup child, since the menushell * has always forced the popped up shell to be the first child. */ static void PopdownGrandChildren( XmRowColumnWidget rowcol ) { CompositeWidget menuShell; if ((menuShell = (CompositeWidget) RC_PopupPosted(rowcol)) == NULL) return; if ((menuShell = (CompositeWidget) RC_PopupPosted (menuShell->composite.children[0])) != NULL) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone))( (Widget) menuShell, NULL, NULL, NULL); } } /* * call the cascading callbacks. The cb parameter can be either a * cascadebutton widget or gadget. */ static void Cascading( Widget w, XEvent *event ) { XmAnyCallbackStruct cback; cback.reason = XmCR_CASCADING; cback.event = event; if (XmIsCascadeButton(w)) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget)w; XmRowColumnWidget submenu = (XmRowColumnWidget) CB_Submenu(cb); /* if the submenu is already up, just return */ /* In case of shared menupanes, check the cascade button attachment */ if (submenu) { XmMenuShellWidget ms = (XmMenuShellWidget) XtParent(submenu); if (XmIsMenuShell(ms) && ms->shell.popped_up && ms->composite.children[0] == (Widget) submenu && submenu->row_column.cascadeBtn == (Widget) cb) { return; } } XtCallCallbackList ((Widget) cb, cb->cascade_button.cascade_callback, &cback); } else { XmCascadeButtonGadget cb = (XmCascadeButtonGadget)w; XmRowColumnWidget submenu = (XmRowColumnWidget) CBG_Submenu(cb); /* if the submenu is already up, just return */ if (submenu) { XmMenuShellWidget ms = (XmMenuShellWidget) XtParent(submenu); if (XmIsMenuShell(ms) && ms->shell.popped_up && ms->composite.children[0] == (Widget) submenu && submenu->row_column.cascadeBtn == (Widget) cb) { return; } } XtCallCallbackList ((Widget) cb, cb->cascade_button.cascade_callback, &cback); } } /* * call the cascading callbacks and the popup any submenu. This is called * by both the cascadebutton widget and gadget. */ void _XmCascadingPopup( Widget cb, XEvent *event, #if NeedWidePrototypes int doCascade ) #else Boolean doCascade ) #endif /* NeedWidePrototypes */ { /* We must make sure the tear off to menushell restoration/callbacks are * called before the cascading callback. Exclude the pane in case Popup() * tries to restore it back to a transient if shared and already posted. */ XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(cb)); XmExcludedParentPaneRec *excPP = &(((XmDisplayInfo *)(dd->display.displayInfo))->excParentPane); if (!excPP->pane) { excPP->pane_list_size = 4; excPP->pane = (Widget *)XtMalloc(sizeof(Widget) * excPP->pane_list_size); } if (XmIsCascadeButtonGadget(cb)) *(excPP->pane) = CBG_Submenu(cb); else *(excPP->pane) = CB_Submenu(cb); if (*(excPP->pane)) { excPP->num_panes = 1; if (RC_TornOff(*(excPP->pane)) && !XmIsMenuShell(XtParent(*(excPP->pane)))) { /* If a subpane is already posted and it is not the pane that * will be posted from cb. Then it must be lowered so that * its tear off can be repainted. */ if (RC_PopupPosted(XtParent(cb))) { XmRowColumnWidget postedPane = (XmRowColumnWidget) ((CompositeWidget)RC_PopupPosted(XtParent(cb)))-> composite.children[0]; if ((Widget)postedPane != *(excPP->pane)) { _XmLowerTearOffObscuringPoppingDownPanes( (Widget)postedPane, *(excPP->pane)); } } _XmRestoreTearOffToMenuShell(*(excPP->pane), event); } } if (doCascade) Cascading (cb, event); Popup (cb, event); } /* * pop up the pulldown menu associated with this cascadebutton */ static void Popup( Widget cb, XEvent *event ) { Widget oldActiveChild; Boolean popped_up = False; register XmRowColumnWidget submenu; XmMenuShellWidget shell = NULL; register XmRowColumnWidget parent = (XmRowColumnWidget) XtParent (cb); XmMenuSystemTrait menuSTrait; XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(cb)); XmExcludedParentPaneRec *excPP = &(((XmDisplayInfo *)(dd->display.displayInfo))->excParentPane); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) parent), XmQTmenuSystem); if (menuSTrait == NULL) return; if (XmIsCascadeButtonGadget(cb)) submenu = (XmRowColumnWidget) CBG_Submenu(cb); else submenu = (XmRowColumnWidget) CB_Submenu(cb); /* if its already up, popdown submenus and then return */ if (submenu && (shell = (XmMenuShellWidget)XtParent(submenu)) && XmIsMenuShell(shell) && (popped_up = shell->shell.popped_up)) { /* Just in case the menu shell is being shared. * Shell's 0th child is currently posted submenu. In case of shared * menupanes we must check to make sure that it is not posted from * the same cascade button before popping down. * Also this is as good a time as any to clear have_traversal field * of submenu's active child. Updating this internal state allows * this gadget to highlight next time the submenu is posted. */ if ((XmRowColumnWidget)shell->composite.children[0] == submenu) { if (cb == RC_CascadeBtn(submenu)) { if (RC_PopupPosted(submenu)) (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone)) (RC_PopupPosted(submenu),NULL,NULL, NULL); if (submenu->manager.active_child) { /* update visible focus/highlighting */ if (XmIsPrimitive(submenu->manager.active_child)) { (*(((XmPrimitiveClassRec *)XtClass(submenu->manager. active_child))->primitive_class.border_unhighlight)) (submenu->manager.active_child); } else if (XmIsGadget(submenu->manager.active_child)) { (*(((XmGadgetClassRec *)XtClass(submenu->manager. active_child))->gadget_class.border_unhighlight)) (submenu->manager.active_child); } /* update internal focus state */ _XmClearFocusPath((Widget) submenu); } *(excPP->pane) = NULL; excPP->num_panes = 0; return; } else { oldActiveChild = submenu->manager.active_child; if (oldActiveChild && XmIsGadget(oldActiveChild)) ((XmGadget)oldActiveChild)->gadget.have_traversal = False; } } } if (XtIsManaged ((Widget)parent)) { if ((RC_Type(parent) == XmMENU_BAR) && !RC_IsArmed (parent)) return; /* * If the old active child for the menupane was a cascadeB gadget, * and it did not have its submenu posted, then * we need to manually send it FocusOut notification, since * when we managed our submenu, the active_child field for * our parent was set to us, and the parent now no longer knows * who previously had the focus. */ oldActiveChild = parent->manager.active_child; if (oldActiveChild && (oldActiveChild != (Widget)cb) && XmIsCascadeButtonGadget(oldActiveChild) && CBG_Submenu(oldActiveChild) && (((XmMenuShellWidget)XtParent(CBG_Submenu(oldActiveChild)))-> shell.popped_up == False)) { parent->manager.active_child = NULL; _XmDispatchGadgetInput((Widget) oldActiveChild, NULL, XmFOCUS_OUT_EVENT); ((XmGadget)oldActiveChild)->gadget.have_traversal = False; } else /* * Fix for CR 5683 - If the RC_CascadeBtn == cb, then the menupane * should not be popped down (it probably already * is popped down), so do not pop down the * menupane (it messes up the traversal) */ if (!submenu || !popped_up || (RC_PopupPosted(parent) != (Widget)shell) || (submenu && RC_CascadeBtn(submenu) && (RC_CascadeBtn(submenu) != cb) && ((Widget)parent == XtParent(RC_CascadeBtn(submenu)))) ) { /* popdown all visible subpanes of this parent when: * - moving to a button without a submenu * - between non-shared menushells * = then menushell will not be popped_up * = the old shell is different than the new shell * (old shell nonshared, new shell shared) * - special case when same pane attached to > 1 cb in same parent */ if (RC_PopupPosted(parent)) { (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popdownEveryone)) (RC_PopupPosted(parent),NULL,NULL, NULL); } /* Focus is not being handled perfectly for tear offs whose parent * is a top level shell. So force cascade unhighlighting here. */ if (NULL != oldActiveChild && oldActiveChild != cb && ((parent->row_column.type == XmMENU_PULLDOWN) || (parent->row_column.type == XmMENU_POPUP)) && !XmIsMenuShell(XtParent(parent))) XmCascadeButtonHighlight(oldActiveChild, FALSE); } else { /* * Handle shared menupanes */ PopdownGrandChildren (parent); } /* We don't allow the possibility of the submenu to be restored * from the menushell back to the transient shell during the * previous popdown code. This occurs when the tear off is shared * and previously posted. */ *(excPP->pane) = NULL; excPP->num_panes = 0; if (submenu) { if (((ShellWidget)XtParent(submenu))->composite.num_children == 1) { menuSTrait -> cascade((Widget) submenu, cb, event); /* Map the window first to sync up the server in case the * menushell was previously shared */ XMapWindow(XtDisplay(submenu), XtWindow(submenu)); XtManageChild( (Widget) submenu); } else { /* We will call menuprocs XmMENU_CASCADING from * popupSharedMenuShell routine so that it occurs between * shared menupane window configurations. */ (*(((XmMenuShellClassRec *)xmMenuShellWidgetClass)-> menu_shell_class.popupSharedMenupane))(cb, (Widget) submenu, event); } /* So help is delivered correctly when in drag mode */ if (_XmGetInDragMode((Widget)cb)) XtSetKeyboardFocus((Widget)submenu, None); } } } /* * get the cascade size set up */ static void size_cascade( XmCascadeButtonWidget cascadebtn ) { Window rootwin; int x,y; /* must be int */ unsigned int width, height, border, depth; /* must be int */ if (CB_CascadePixmap(cascadebtn) != XmUNSPECIFIED_PIXMAP) { XGetGeometry(XtDisplay(cascadebtn), CB_CascadePixmap(cascadebtn), &rootwin, &x, &y, &width, &height, &border, &depth); CB_Cascade_width(cascadebtn) = (Dimension) width; CB_Cascade_height(cascadebtn) = (Dimension) height; } else { CB_Cascade_width(cascadebtn) = 0; CB_Cascade_height(cascadebtn) = 0; } } /* * set up the cascade position. */ static void position_cascade( XmCascadeButtonWidget cascadebtn ) { Dimension buffer; if (CB_HasCascade(cascadebtn)) { if (LayoutIsRtoLP(cascadebtn)) CB_Cascade_x(cascadebtn) = cascadebtn->primitive.highlight_thickness + cascadebtn->primitive.shadow_thickness + Lab_MarginWidth(cascadebtn); else CB_Cascade_x(cascadebtn) = XtWidth (cascadebtn) - cascadebtn->primitive.highlight_thickness - cascadebtn->primitive.shadow_thickness - Lab_MarginWidth(cascadebtn) - CB_Cascade_width(cascadebtn); buffer = cascadebtn->primitive.highlight_thickness + cascadebtn->primitive.shadow_thickness + Lab_MarginHeight(cascadebtn); CB_Cascade_y(cascadebtn) = buffer + ((XtHeight(cascadebtn) - 2*buffer) - CB_Cascade_height(cascadebtn)) / 2; } else { CB_Cascade_y(cascadebtn) = 0; CB_Cascade_x(cascadebtn) = 0; } } /* * set up the cascade size and location */ static void setup_cascade( XmCascadeButtonWidget cascadebtn, #if NeedWidePrototypes int adjustWidth, int adjustHeight ) #else Boolean adjustWidth, Boolean adjustHeight ) #endif /* NeedWidePrototypes */ { Dimension delta; if (CB_HasCascade(cascadebtn)) { /* * modify the size of the cascadebutton to acommadate the cascade, if * needed. The cascade should fit inside MarginRight. */ if (LayoutIsRtoLP(cascadebtn)) { if ((CB_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE) > Lab_MarginLeft(cascadebtn)) { delta = CB_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE - Lab_MarginLeft(cascadebtn); Lab_MarginLeft(cascadebtn) += delta; if (adjustWidth) XtWidth(cascadebtn) += delta; else { if (cascadebtn->label.alignment == XmALIGNMENT_BEGINNING) Lab_TextRect_x(cascadebtn) += delta; else if (cascadebtn->label.alignment == XmALIGNMENT_CENTER) Lab_TextRect_x(cascadebtn) += delta/2; } } } else { if ((CB_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE) > Lab_MarginRight(cascadebtn)) { delta = CB_Cascade_width(cascadebtn) + CASCADE_PIX_SPACE - Lab_MarginRight(cascadebtn); Lab_MarginRight(cascadebtn) += delta; if (adjustWidth) XtWidth(cascadebtn) += delta; else { if (cascadebtn->label.alignment == XmALIGNMENT_END) Lab_TextRect_x(cascadebtn) -= delta; else if (cascadebtn->label.alignment == XmALIGNMENT_CENTER) Lab_TextRect_x(cascadebtn) -= delta/2; } } } /* * the cascade height should fit inside of * TextRect + marginTop + marginBottom */ delta = CB_Cascade_height(cascadebtn) + 2 * (Lab_MarginHeight(cascadebtn) + cascadebtn->primitive.shadow_thickness + cascadebtn->primitive.highlight_thickness); if (delta > XtHeight(cascadebtn)) { delta -= XtHeight(cascadebtn); Lab_MarginTop(cascadebtn) += delta/2; Lab_TextRect_y(cascadebtn) += delta/2; Lab_MarginBottom(cascadebtn) += delta - (delta/2); if (adjustHeight) XtHeight(cascadebtn) += delta; } } position_cascade(cascadebtn); } /* * Destroy the widget */ static void Destroy( Widget wid ) { XmCascadeButtonWidget cb = (XmCascadeButtonWidget) wid ; XmRowColumnWidget submenu = (XmRowColumnWidget) CB_Submenu(cb); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTmenuSystem); /* * If the armed pixmap exists, both pixmaps must be cached arrows */ if (CB_ArmedPixmap(cb)) { _XmProcessLock(); _XmArrowPixmapCacheDelete((XtPointer) CB_ArmedPixmap(cb)); _XmArrowPixmapCacheDelete((XtPointer) CB_CascadePixmap(cb)); _XmProcessUnlock(); } /* * break the submenu link */ if (submenu != NULL && menuSTrait != NULL) menuSTrait -> recordPostFromWidget((Widget) submenu, (Widget) cb, FALSE); if (cb->cascade_button.timer) XtRemoveTimeOut (cb->cascade_button.timer); /* Release the GCs */ XtReleaseGC (wid, CB_ArmGC(wid)); XtReleaseGC (wid, CB_BackgroundGC(wid)); } /* * routine to resize a cascade button, called by the parent * geometery manager */ static void Resize( Widget cb ) { /* */ if (cb) { XtWidgetProc resize; /* Label class does it's work */ _XmProcessLock(); resize = xmLabelClassRec.core_class.resize; _XmProcessUnlock(); (* resize) (cb); /* move the cascade too */ position_cascade ((XmCascadeButtonWidget) cb); } } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPrehook( Widget cw, /* unused */ Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmCascadeButtonWidget new_w = (XmCascadeButtonWidget) nw ; /* CR 2990: Use XmNbuttonFontList as the default font. */ if (new_w->label.font == NULL) new_w->label.font = XmeGetDefaultRenderTable (nw, XmBUTTON_FONTLIST); return False; } /* * Set Values */ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmCascadeButtonWidget old = (XmCascadeButtonWidget) cw ; XmCascadeButtonWidget requested = (XmCascadeButtonWidget) rw ; XmCascadeButtonWidget new_w = (XmCascadeButtonWidget) nw ; Boolean flag = FALSE; Boolean adjustWidth = FALSE; Boolean adjustHeight = FALSE; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(cw)), XmQTmenuSystem); if (old->primitive.foreground != new_w->primitive.foreground || old->core.background_pixel != new_w->core.background_pixel) { GetBackgroundGC(new_w); } if ((CB_Submenu(new_w)) && ((! XmIsRowColumn(CB_Submenu(new_w))) || (RC_Type(CB_Submenu(new_w)) != XmMENU_PULLDOWN))) { CB_Submenu(new_w) = NULL; XmeWarning( (Widget)new_w, WRONGSUBMENU); } if (new_w->cascade_button.map_delay < 0) { new_w->cascade_button.map_delay = old->cascade_button.map_delay; XmeWarning( (Widget)new_w, WRONGMAPDELAY); } /* if there is a change to submenu, notify menu system */ if (CB_Submenu(old) != CB_Submenu(new_w)) { /* We must pass nw as the parameter to recordPostFromWidget * because old is a copy! The call to recordPostFromWidget() does * a widget ID comparison and we must pass the real widget (nw). */ if (CB_Submenu(old) && menuSTrait) menuSTrait -> recordPostFromWidget(CB_Submenu(old), nw, FALSE); if (CB_Submenu(new_w) && menuSTrait) menuSTrait -> recordPostFromWidget(CB_Submenu(new_w), nw, TRUE); } /* don't let traversal be changed */ if (Lab_MenuType(new_w) == XmMENU_BAR) new_w->primitive.traversal_on = TRUE; /* handle the cascade pixmap indicator */ else if (Lab_IsMenupane(new_w)) { /* don't let traversal be changed */ new_w->primitive.traversal_on = TRUE; if ((new_w->label.recompute_size) || (requested->core.width <= 0)) adjustWidth = TRUE; if ((new_w->label.recompute_size) || (requested->core.height <= 0)) adjustHeight = TRUE; /* get new pixmap size */ if (CB_CascadePixmap(old) != CB_CascadePixmap (new_w)) { if (CB_ArmedPixmap(old) != XmUNSPECIFIED_PIXMAP) { _XmProcessLock(); _XmArrowPixmapCacheDelete((XtPointer) CB_ArmedPixmap(old)); _XmArrowPixmapCacheDelete((XtPointer) CB_CascadePixmap(old)); _XmProcessUnlock(); } CB_ArmedPixmap(new_w) = XmUNSPECIFIED_PIXMAP; size_cascade (new_w); } else if ( ((CB_CascadePixmap(new_w) == XmUNSPECIFIED_PIXMAP) && (!CB_Submenu(old) && CB_Submenu(new_w))) || ((CB_ArmedPixmap(old) != XmUNSPECIFIED_PIXMAP) && ((Lab_TextRect_height(old) != Lab_TextRect_height(new_w)) || (old->primitive.foreground != new_w->primitive.foreground) || (old->core.background_pixel != new_w->core.background_pixel)))) { _XmProcessLock(); _XmArrowPixmapCacheDelete((XtPointer) CB_ArmedPixmap(old)); _XmArrowPixmapCacheDelete((XtPointer) CB_CascadePixmap(old)); CB_ArmedPixmap(new_w) = XmUNSPECIFIED_PIXMAP; CB_CascadePixmap(new_w) = XmUNSPECIFIED_PIXMAP; _XmCreateArrowPixmaps((Widget) new_w); _XmProcessUnlock(); size_cascade (new_w); } /* * resize widget if cascade appeared or disappeared, or if the * cascade pixmap changed size. */ if ((CB_CascadePixmap (old) != CB_CascadePixmap (new_w)) || (old->label.label_type != new_w->label.label_type) || (old->cascade_button.submenu != new_w->cascade_button.submenu)) { setup_cascade (new_w, adjustWidth, adjustHeight); /* if there wasn't a cascade, and still isn't, don't redraw */ if (old->cascade_button.submenu || new_w->cascade_button.submenu) flag = TRUE; } /* make sure that other changes did not scrunch our pixmap */ else if (new_w->cascade_button.submenu) { if ((new_w->primitive.highlight_thickness != old->primitive.highlight_thickness) || (new_w->primitive.shadow_thickness != old->primitive.shadow_thickness) || (Lab_MarginRight (new_w) != Lab_MarginRight (old)) || (Lab_MarginHeight (new_w) != Lab_MarginHeight (old)) || (Lab_MarginTop (new_w) != Lab_MarginTop (old)) || (Lab_MarginBottom (new_w) != Lab_MarginBottom (old))) { setup_cascade (new_w,adjustWidth, adjustHeight); flag = TRUE; } else if ((Lab_MarginWidth(new_w) != Lab_MarginWidth(old)) || (new_w->core.width != old->core.width) || (new_w->core.height != old->core.height)) { position_cascade (new_w); flag = TRUE; } } } return (flag); } /************************************************************ * * InitializePrehook * * Put the proper translations in core_class tm_table so that * the data is massaged correctly * ************************************************************/ /*ARGSUSED*/ static void InitializePrehook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { unsigned char type; XmMenuSystemTrait menuSTrait; XmCascadeButtonWidget bw = (XmCascadeButtonWidget) new_w ; _XmSaveCoreClassTranslations (new_w); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) XtParent(new_w)), XmQTmenuSystem); if (menuSTrait != NULL) type = menuSTrait->type(XtParent(new_w)); else type = XmWORK_AREA; _XmProcessLock(); if (type == XmMENU_PULLDOWN || type == XmMENU_POPUP) new_w->core.widget_class->core_class.tm_table = (String) p_events_parsed; else new_w->core.widget_class->core_class.tm_table =(String)menubar_events_parsed; _XmProcessUnlock(); /* CR 2990: Use XmNbuttonFontList as the default font. */ if (bw->label.font == NULL) bw->label.font = XmeGetDefaultRenderTable (new_w, XmBUTTON_FONTLIST); } /************************************************************ * * InitializePosthook * * restore core class translations * ************************************************************/ /*ARGSUSED*/ static void InitializePosthook( Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { _XmRestoreCoreClassTranslations (new_w); } /************************************************************************ * * GetArmGC * Get the graphics context used for filling in background of the * cascade button when armed. * ************************************************************************/ static void GetArmGC( XmCascadeButtonWidget cb ) { XGCValues values; XtGCMask valueMask; Pixel junk, select_pixel; XmGetColors(XtScreen(cb), cb->core.colormap, cb->core.background_pixel, &junk, &junk, &junk, &select_pixel); valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = select_pixel; values.background = cb->primitive.foreground; values.graphics_exposures = False; CB_ArmGC(cb) = XtGetGC ((Widget) cb, valueMask, &values); } /************************************************************************ * * GetBackgroundGC * Get the graphics context used for filling in background of * the cascade button when not armed. * ************************************************************************/ static void GetBackgroundGC( XmCascadeButtonWidget cb ) { XGCValues values; XtGCMask valueMask; XFontStruct *fs; valueMask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; values.foreground = cb->core.background_pixel; values.background = cb->primitive.foreground; values.graphics_exposures = False; if (XmeRenderTableGetDefaultFont(cb->label.font, &fs)) values.font = fs->fid; else valueMask &= ~GCFont; CB_BackgroundGC(cb) = XtGetGC ((Widget) cb, valueMask, &values); } /* * Initialize */ /*ARGSUSED*/ static void Initialize( Widget w_req, Widget w_new, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmCascadeButtonWidget req = (XmCascadeButtonWidget) w_req ; XmCascadeButtonWidget new_w = (XmCascadeButtonWidget) w_new ; Boolean adjustWidth = FALSE; Boolean adjustHeight = FALSE; XmMenuSystemTrait menuSTrait; XmRowColumnWidget submenu = (XmRowColumnWidget) CB_Submenu(new_w); XmRowColumnWidget parent = (XmRowColumnWidget) XtParent(new_w); menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass((Widget) parent), XmQTmenuSystem); if ((! XmIsRowColumn (parent)) && ((Lab_MenuType(new_w) == XmMENU_PULLDOWN) || (Lab_MenuType(new_w) == XmMENU_POPUP) || (Lab_MenuType(new_w) == XmMENU_BAR))) { XmeWarning( (Widget)new_w, WRONGPARENT); } /* if menuProcs is not set up yet, try again */ _XmProcessLock(); if (xmLabelClassRec.label_class.menuProcs == NULL) xmLabelClassRec.label_class.menuProcs = (XmMenuProc) _XmGetMenuProcContext(); _XmProcessUnlock(); /* CR 7651: Clear before setting. */ new_w->cascade_button.armed = 0; CB_SetArmed(new_w, FALSE); new_w->cascade_button.timer = 0; CB_SetTraverse (new_w, FALSE); CB_SetWasPosted (new_w, FALSE); CB_ArmedPixmap(new_w) = XmUNSPECIFIED_PIXMAP; /* * if the user did not specify a margin width, set the default. * The menubar cbs have a larger margin. */ if (Lab_MarginWidth(req) == XmINVALID_DIMENSION) { if (Lab_MenuType(new_w) == XmMENU_BAR) Lab_MarginWidth(new_w) = 6; else Lab_MarginWidth(new_w) = 2; } if (submenu && (! XmIsRowColumn(submenu) || (RC_Type(submenu) != XmMENU_PULLDOWN))) { submenu = NULL; XmeWarning( (Widget)new_w, WRONGSUBMENU); } if (new_w->cascade_button.map_delay < 0) { new_w->cascade_button.map_delay = MAP_DELAY_DEFAULT; XmeWarning( (Widget)new_w, WRONGMAPDELAY); } /* call submenu's class function to set the link */ if (submenu != NULL && menuSTrait != NULL) menuSTrait -> recordPostFromWidget((Widget) submenu, (Widget) new_w, TRUE); if (submenu && (CB_CascadePixmap(new_w) == XmUNSPECIFIED_PIXMAP)) { _XmProcessLock(); _XmCreateArrowPixmaps((Widget) new_w); _XmProcessUnlock(); } if (Lab_IsMenupane(new_w)) { if (req->core.width <= 0) adjustWidth = TRUE; if (req->core.height <= 0) adjustHeight = TRUE; /* get pixmap size and set up widget to allow room for it */ size_cascade (new_w); setup_cascade (new_w, adjustWidth, adjustHeight); } new_w->primitive.traversal_on = TRUE; /* Initialize GCs for armed button select and background only */ GetArmGC (new_w); GetBackgroundGC (new_w); } /* ************************************************************************* * * Public Routines * ************************************************************************* */ Widget XmCreateCascadeButton( Widget parent, char *name, ArgList al, Cardinal ac ) { Widget cb; cb = XtCreateWidget(name, xmCascadeButtonWidgetClass, parent, al, ac); return (cb); } Widget XmVaCreateCascadeButton( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmCascadeButtonWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedCascadeButton( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmCascadeButtonWidgetClass, parent, True, var, count); va_end(var); return w; } /* * This routine is called for both cascadebutton gadgets and widgets. * The button is armed or disarmed but it does not pop up or down submenus. */ void XmCascadeButtonHighlight( Widget cb, #if NeedWidePrototypes int highlight ) #else Boolean highlight ) #endif /* NeedWidePrototypes */ { XtAppContext app; if (NULL == cb) return; app = XtWidgetToApplicationContext(cb); _XmAppLock(app); if ((cb) && XmIsCascadeButton(cb)) { if (highlight) Arm ((XmCascadeButtonWidget) cb); else Disarm ((XmCascadeButtonWidget) cb, FALSE); } else if ((cb) && XmIsCascadeButtonGadget(cb)) XmCascadeButtonGadgetHighlight ((Widget) cb, highlight); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/DesktopP.h0000644000175000017500000000435313145162623012627 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDesktopP_h #define _XmDesktopP_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsDesktopObject #define XmIsDesktopObject(w) XtIsSubclass(w, xmDesktopClass) #endif /* XmIsDesktopObject */ typedef struct _XmDesktopRec *XmDesktopObject; typedef struct _XmDesktopClassRec *XmDesktopObjectClass; externalref WidgetClass xmDesktopClass; typedef struct _XmDesktopClassPart{ WidgetClass child_class; XtWidgetProc insert_child; /* physically add child to parent */ XtWidgetProc delete_child; /* physically remove child */ XtPointer extension; }XmDesktopClassPart, *XmDesktopClassPartPtr; typedef struct _XmDesktopClassRec{ ObjectClassPart object_class; XmExtClassPart ext_class; XmDesktopClassPart desktop_class; }XmDesktopClassRec; typedef struct { Widget parent; Widget *children; Cardinal num_children; Cardinal num_slots; } XmDesktopPart, *XmDesktopPartPtr; externalref XmDesktopClassRec xmDesktopClassRec; typedef struct _XmDesktopRec{ ObjectPart object; XmExtPart ext; XmDesktopPart desktop; }XmDesktopRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDesktopP_h */ motif-2.3.8/lib/Xm/TrackLoc.c0000644000175000017500000001603613145162623012574 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: TrackLoc.c /main/12 1995/10/25 20:24:41 cde-sun $" #endif #endif #include #include "XmI.h" #include "MessagesI.h" #define GRABPTRERROR _XmMMsgCascadeB_0003 /******** Static Function Declarations ********/ static Widget _XmInputInWidget( Widget w, #if NeedWidePrototypes int x, int y) ; #else Position x, Position y) ; #endif /* NeedWidePrototypes */ /******** End Static Function Declarations ********/ /******************************************************/ /* copy from XmeGadgetAtPoint, buts works for widget too, only used in this module so far, so let it static */ static Widget _XmInputInWidget( Widget w, #if NeedWidePrototypes int x, int y) #else Position x, Position y) #endif /* NeedWidePrototypes */ { int i; Widget child; CompositeWidget cw = (CompositeWidget) w; /* loop over the child list to find if there is one at x,y */ /* well, overlapping won't really work, since I have no standard way to check visibility */ for (i = 0; i < cw->composite.num_children; i++) { child = cw->composite.children[i]; if (XtIsManaged (child)) { if (x >= child->core.x && y >= child->core.y && x < child->core.x + child->core.width && y < child->core.y + child->core.height) return (child); } } return (NULL); } /* new tracking locate function that returns the event that trigerred the return + this function uses XNextEvent instead of just XMaskEvent which was only eating some events and thus causing problem when back to the application */ Widget XmTrackingEvent( Widget widget, Cursor cursor, #if NeedWidePrototypes int confineTo, #else Boolean confineTo, #endif /* NeedWidePrototypes */ XEvent * pev) { Window w, confine_to = None; Time lastTime; Widget child; Boolean key_has_been_pressed= False; Widget target ; Position x, y ; XtAppContext app; if (widget == NULL) return(NULL); app = XtWidgetToApplicationContext(widget); _XmAppLock(app); w = XtWindowOfObject(widget); if (confineTo) confine_to = w; lastTime = XtLastTimestampProcessed(XtDisplay(widget)); XmUpdateDisplay(widget); if (XtGrabPointer(widget, True, /* The following truncation of masks is due to a bug in the Xt API.*/ (unsigned int) (ButtonPressMask | ButtonReleaseMask), GrabModeAsync, GrabModeAsync, confine_to, cursor, lastTime) != GrabSuccess) { XmeWarning(widget, GRABPTRERROR); _XmAppUnlock(app); return NULL ; } while (True) { /* eat all events, not just button's */ XNextEvent(XtDisplay(widget), pev); /* track only button1release and non first keyrelease */ if (((pev->type == ButtonRelease) && (pev->xbutton.button & Button1)) || ((pev->type == KeyRelease) && key_has_been_pressed)) { if ((!confineTo) && (pev->xbutton.window == w)) { /* this is the case where we are not confine, so the user can click outside the window, but we want to return NULL */ if ((pev->xbutton.x < 0) || (pev->xbutton.y < 0) || (pev->xbutton.x > widget->core.width) || (pev->xbutton.y > widget->core.height)) { XtUngrabPointer(widget, lastTime); _XmAppUnlock(app); return(NULL); } } target = XtWindowToWidget(pev->xbutton.display, pev->xbutton.window); /* New algorithm that solves the problem of mouse insensitive widgets: ( i.e you can't get help on Label.) When we get the Btn1Up event with the window in which the event ocurred, and convert it to a widget. If that widget is a primitive, return it. Otherwise, it is a composite or a shell, and we do the following: Walk down the child list (for gadgets AND WIDGETS), looking for one which contains the x,y. If none is found, return the manager itself, If a primitive or gadget is found, return the object found. If a manager is found, execute the above algorithm recursively with that manager. */ if (target) { /* do not change the original pev coordinates */ x = pev->xbutton.x ; y = pev->xbutton.y ; /* do not enter the loop for primitive */ while (XtIsComposite(target) || XtIsShell(target)) { if ((child = _XmInputInWidget(target, x,y)) != NULL) { target = child; /* if a gadget or a primitive is found, return */ if (!XtIsComposite(child)) break ; /* otherwise, loop */ x = x - XtX(child) ; y = y - XtY(child) ; } else break ; /* no child found at this place: return the manager */ } } break ; } else if (pev->type == KeyPress) key_has_been_pressed = True ; /* to avoid exiting on the first keyreleased coming from the keypress activatation of the function itself */ } XtUngrabPointer(widget, lastTime); _XmAppUnlock(app); return(target); } /* reimplementation of the old function using the new one and a dummy event */ Widget XmTrackingLocate( Widget widget, Cursor cursor, #if NeedWidePrototypes int confineTo ) #else Boolean confineTo ) #endif /* NeedWidePrototypes */ { XEvent ev ; return XmTrackingEvent(widget, cursor, confineTo, &ev); } /*********************************************************************** * Certain widgets, such as those in a menu, would like the application * to look non-scraged (i.e. all exposure events have been processed) * before invoking a callback which takes a long time to do its thing. * This function grabs all exposure events off the queue, and processes * them. ***********************************************************************/ void XmUpdateDisplay( Widget w ) { XEvent event; Display * display = XtDisplay(w); _XmWidgetToAppContext(w); _XmAppLock(app); XSync (display, 0); while (XCheckMaskEvent(display, ExposureMask, &event)) XtDispatchEvent(&event); _XmAppUnlock(app); } motif-2.3.8/lib/Xm/XpmCrBufFrI.c0000644000175000017500000002746112672140200013154 00000000000000/* $XConsortium: XpmCrBufFrI.c /main/2 1996/09/20 08:01:31 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrBufFrI.c: * * * * XPM library * * Scan an image and possibly its mask and create an XPM buffer * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" LFUNC(WriteColors, int, (char **dataptr, unsigned int *data_size, unsigned int *used_size, XpmColor *colors, unsigned int ncolors, unsigned int cpp)); LFUNC(WritePixels, void, (char *dataptr, unsigned int data_size, unsigned int *used_size, unsigned int width, unsigned int height, unsigned int cpp, unsigned int *pixels, XpmColor *colors)); LFUNC(WriteExtensions, void, (char *dataptr, unsigned int data_size, unsigned int *used_size, XpmExtension *ext, unsigned int num)); LFUNC(ExtensionsSize, unsigned int, (XpmExtension *ext, unsigned int num)); LFUNC(CommentsSize, int, (XpmInfo *info)); int XpmCreateBufferFromImage(display, buffer_return, image, shapeimage, attributes) Display *display; char **buffer_return; XImage *image; XImage *shapeimage; XpmAttributes *attributes; { XpmImage xpmimage; XpmInfo info; int ErrorStatus; /* initialize return value */ if (buffer_return) *buffer_return = NULL; /* create an XpmImage from the image */ ErrorStatus = XpmCreateXpmImageFromImage(display, image, shapeimage, &xpmimage, attributes); if (ErrorStatus != XpmSuccess) return (ErrorStatus); /* create the buffer from the XpmImage */ if (attributes) { xpmSetInfo(&info, attributes); ErrorStatus = XpmCreateBufferFromXpmImage(buffer_return, &xpmimage, &info); } else ErrorStatus = XpmCreateBufferFromXpmImage(buffer_return, &xpmimage, NULL); /* free the XpmImage */ XpmFreeXpmImage(&xpmimage); return (ErrorStatus); } #undef RETURN #define RETURN(status) \ do { \ if (ptr) \ XpmFree(ptr); \ return(status); \ } while(0) int XpmCreateBufferFromXpmImage(buffer_return, image, info) char **buffer_return; XpmImage *image; XpmInfo *info; { /* calculation variables */ int ErrorStatus; char buf[BUFSIZ]; unsigned int cmts, extensions, ext_size = 0; unsigned int l, cmt_size = 0; char *ptr = NULL, *p; unsigned int ptr_size, used_size, tmp; *buffer_return = NULL; cmts = info && (info->valuemask & XpmComments); extensions = info && (info->valuemask & XpmExtensions) && info->nextensions; /* compute the extensions and comments size */ if (extensions) ext_size = ExtensionsSize(info->extensions, info->nextensions); if (cmts) cmt_size = CommentsSize(info); /* write the header line */ #ifndef VOID_SPRINTF used_size = #endif sprintf(buf, "/* XPM */\nstatic char * image_name[] = {\n"); #ifdef VOID_SPRINTF used_size = strlen(buf); #endif ptr_size = used_size + ext_size + cmt_size + 1; /* ptr_size can't be 0 */ if(ptr_size <= used_size || ptr_size <= ext_size || ptr_size <= cmt_size) { return XpmNoMemory; } ptr = (char *) XpmMalloc(ptr_size); if (!ptr) return XpmNoMemory; strcpy(ptr, buf); /* write the values line */ if (cmts && info->hints_cmt) { #ifndef VOID_SPRINTF used_size += #endif snprintf(ptr + used_size, ptr_size-used_size, "/*%s*/\n", info->hints_cmt); #ifdef VOID_SPRINTF used_size += strlen(info->hints_cmt) + 5; #endif } #ifndef VOID_SPRINTF l = #endif sprintf(buf, "\"%d %d %d %d", image->width, image->height, image->ncolors, image->cpp); #ifdef VOID_SPRINTF l = strlen(buf); #endif if (info && (info->valuemask & XpmHotspot)) { #ifndef VOID_SPRINTF l += #endif snprintf(buf + l, sizeof(buf)-l, " %d %d", info->x_hotspot, info->y_hotspot); #ifdef VOID_SPRINTF l = strlen(buf); #endif } if (extensions) { #ifndef VOID_SPRINTF l += #endif sprintf(buf + l, " XPMEXT"); #ifdef VOID_SPRINTF l = strlen(buf); #endif } #ifndef VOID_SPRINTF l += #endif sprintf(buf + l, "\",\n"); #ifdef VOID_SPRINTF l = strlen(buf); #endif ptr_size += l; if(ptr_size <= l) RETURN(XpmNoMemory); p = (char *) XpmRealloc(ptr, ptr_size); if (!p) RETURN(XpmNoMemory); ptr = p; strcpy(ptr + used_size, buf); used_size += l; /* write colors */ if (cmts && info->colors_cmt) { #ifndef VOID_SPRINTF used_size += #endif snprintf(ptr + used_size, ptr_size-used_size, "/*%s*/\n", info->colors_cmt); #ifdef VOID_SPRINTF used_size += strlen(info->colors_cmt) + 5; #endif } ErrorStatus = WriteColors(&ptr, &ptr_size, &used_size, image->colorTable, image->ncolors, image->cpp); if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); /* * now we know the exact size we need, realloc the data * 4 = 1 (for '"') + 3 (for '",\n') * 1 = - 2 (because the last line does not end with ',\n') + 3 (for '};\n') */ if(image->width > UINT_MAX / image->cpp || (tmp = image->width * image->cpp + 4) <= 4 || image->height > UINT_MAX / tmp || (tmp = image->height * tmp + 1) <= 1 || (ptr_size += tmp) <= tmp) RETURN(XpmNoMemory); p = (char *) XpmRealloc(ptr, ptr_size); if (!p) RETURN(XpmNoMemory); ptr = p; /* print pixels */ if (cmts && info->pixels_cmt) { #ifndef VOID_SPRINTF used_size += #endif snprintf(ptr + used_size, ptr_size-used_size, "/*%s*/\n", info->pixels_cmt); #ifdef VOID_SPRINTF used_size += strlen(info->pixels_cmt) + 5; #endif } WritePixels(ptr + used_size, ptr_size - used_size, &used_size, image->width, image->height, image->cpp, image->data, image->colorTable); /* print extensions */ if (extensions) WriteExtensions(ptr + used_size, ptr_size-used_size, &used_size, info->extensions, info->nextensions); /* close the array */ strcpy(ptr + used_size, "};\n"); *buffer_return = ptr; return (XpmSuccess); } static int WriteColors(dataptr, data_size, used_size, colors, ncolors, cpp) char **dataptr; unsigned int *data_size; unsigned int *used_size; XpmColor *colors; unsigned int ncolors; unsigned int cpp; { char buf[BUFSIZ] = {0}; unsigned int a, key, l; char *s, *s2; char **defaults; *buf = '"'; for (a = 0; a < ncolors; a++, colors++) { defaults = (char **) colors; s = buf + 1; if(cpp > (sizeof(buf) - (s-buf))) return(XpmNoMemory); strncpy(s, *defaults++, cpp); s += cpp; for (key = 1; key <= NKEYS; key++, defaults++) { if ((s2 = *defaults)) { #ifndef VOID_SPRINTF s += #endif /* assume C99 compliance */ snprintf(s, sizeof(buf) - (s-buf), "\t%s %s", xpmColorKeys[key - 1], s2); #ifdef VOID_SPRINTF s += strlen(s); #endif /* now let's check if s points out-of-bounds */ if((s-buf) > sizeof(buf)) return(XpmNoMemory); } } if(sizeof(buf) - (s-buf) < 4) return(XpmNoMemory); strcpy(s, "\",\n"); l = s + 3 - buf; if( *data_size >= UINT_MAX-l || *data_size + l <= *used_size || (*data_size + l - *used_size) <= strlen(buf)) return(XpmNoMemory); s = (char *) XpmRealloc(*dataptr, *data_size + l); if (!s) return (XpmNoMemory); *data_size += l; strcpy(s + *used_size, buf); *used_size += l; *dataptr = s; } return (XpmSuccess); } static void WritePixels(dataptr, data_size, used_size, width, height, cpp, pixels, colors) char *dataptr; unsigned int data_size; unsigned int *used_size; unsigned int width; unsigned int height; unsigned int cpp; unsigned int *pixels; XpmColor *colors; { char *s = dataptr; unsigned int x, y, h; if(height <= 1) return; h = height - 1; for (y = 0; y < h; y++) { *s++ = '"'; for (x = 0; x < width; x++, pixels++) { if(cpp >= (data_size - (s-dataptr))) return; strncpy(s, colors[*pixels].string, cpp); /* how can we trust *pixels? :-\ */ s += cpp; } if((data_size - (s-dataptr)) < 4) return; strcpy(s, "\",\n"); s += 3; } /* duplicate some code to avoid a test in the loop */ *s++ = '"'; for (x = 0; x < width; x++, pixels++) { if(cpp >= (data_size - (s-dataptr))) return; strncpy(s, colors[*pixels].string, cpp); /* how can we trust *pixels? */ s += cpp; } *s++ = '"'; *used_size += s - dataptr; } static unsigned int ExtensionsSize(ext, num) XpmExtension *ext; unsigned int num; { unsigned int x, y, a, size; char **line; size = 0; if(num == 0) return(0); /* ok? */ for (x = 0; x < num; x++, ext++) { /* 11 = 10 (for ',\n"XPMEXT ') + 1 (for '"') */ size += strlen(ext->name) + 11; a = ext->nlines; /* how can we trust ext->nlines to be not out-of-bounds? */ for (y = 0, line = ext->lines; y < a; y++, line++) /* 4 = 3 (for ',\n"') + 1 (for '"') */ size += strlen(*line) + 4; } /* 13 is for ',\n"XPMENDEXT"' */ if(size > UINT_MAX - 13) /* unlikely */ return(0); return size + 13; } static void WriteExtensions(dataptr, data_size, used_size, ext, num) char *dataptr; unsigned int data_size; unsigned int *used_size; XpmExtension *ext; unsigned int num; { unsigned int x, y, a; char **line; char *s = dataptr; for (x = 0; x < num; x++, ext++) { #ifndef VOID_SPRINTF s += 11 + #endif snprintf(s, data_size - (s-dataptr), ",\n\"XPMEXT %s\"", ext->name); #ifdef VOID_SPRINTF s += strlen(ext->name) + 11; #endif a = ext->nlines; for (y = 0, line = ext->lines; y < a; y++, line++) { #ifndef VOID_SPRINTF s += 4 + #endif snprintf(s, data_size - (s-dataptr), ",\n\"%s\"", *line); #ifdef VOID_SPRINTF s += strlen(*line) + 4; #endif } } strncpy(s, ",\n\"XPMENDEXT\"", data_size - (s-dataptr)-1); *used_size += s - dataptr + 13; } static int CommentsSize(info) XpmInfo *info; { int size = 0; /* 5 = 2 (for "/_*") + 3 (for "*_/\n") */ /* wrap possible but *very* unlikely */ if (info->hints_cmt) size += 5 + strlen(info->hints_cmt); if (info->colors_cmt) size += 5 + strlen(info->colors_cmt); if (info->pixels_cmt) size += 5 + strlen(info->pixels_cmt); return size; } motif-2.3.8/lib/Xm/RepType.h0000644000175000017500000000616213145162623012466 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmRepType_h #define _XmRepType_h #include #ifdef __cplusplus extern "C" { #endif #define XmREP_TYPE_INVALID 0x1FFF typedef unsigned short XmRepTypeId ; typedef struct { String rep_type_name ; String *value_names ; unsigned char *values ; unsigned char num_values ; Boolean reverse_installed ; XmRepTypeId rep_type_id ; }XmRepTypeEntryRec, *XmRepTypeEntry, XmRepTypeListRec, *XmRepTypeList ; /******** Public Function Declarations ********/ extern XmRepTypeId XmRepTypeRegister( String rep_type, String *value_names, unsigned char *values, #if NeedWidePrototypes unsigned int num_values) ; #else unsigned char num_values) ; #endif /* NeedWidePrototypes */ extern void XmRepTypeAddReverse( #if NeedWidePrototypes int rep_type_id) ; #else XmRepTypeId rep_type_id) ; #endif /* NeedWidePrototypes */ extern Boolean XmRepTypeValidValue( #if NeedWidePrototypes int rep_type_id, unsigned int test_value, #else XmRepTypeId rep_type_id, unsigned char test_value, #endif /* NeedWidePrototypes */ Widget enable_default_warning) ; extern XmRepTypeList XmRepTypeGetRegistered( void ) ; extern XmRepTypeEntry XmRepTypeGetRecord( #if NeedWidePrototypes int rep_type_id) ; #else XmRepTypeId rep_type_id) ; #endif /* NeedWidePrototypes */ extern XmRepTypeId XmRepTypeGetId( String rep_type) ; extern String * XmRepTypeGetNameList( #if NeedWidePrototypes int rep_type_id, int use_uppercase_format) ; #else XmRepTypeId rep_type_id, Boolean use_uppercase_format) ; #endif /* NeedWidePrototypes */ extern void XmRepTypeInstallTearOffModelConverter( void ) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRepType_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MwmUtil.h0000644000175000017500000001411213145162623012466 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMwmUtil_h #define _XmMwmUtil_h #include /* for Window typedefs */ #include /* for protocol typedefs */ #ifdef __cplusplus extern "C" { #endif /* * Contents of the _MWM_HINTS property. */ typedef struct { /* These correspond to XmRInt resources. (VendorSE.c) */ int flags; int functions; int decorations; int input_mode; int status; } MotifWmHints; typedef MotifWmHints MwmHints; /* bit definitions for MwmHints.flags */ #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) /* bit definitions for MwmHints.functions */ #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) /* bit definitions for MwmHints.decorations */ #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) /* definitions for running automated tests */ #define WINDOW_MINIMIZE_INFO 0 #define WINDOW_MAXIMIZE_INFO 1 #define WINDOW_MOVE_INFO 2 #define WINDOW_RAISE_INFO 3 #define WINDOW_RESIZE_NORTH_INFO 4 #define WINDOW_RESIZE_SOUTH_INFO 5 #define WINDOW_RESIZE_EAST_INFO 6 #define WINDOW_RESIZE_WEST_INFO 7 #define WINDOW_RESIZE_NORTHEAST_INFO 8 #define WINDOW_RESIZE_NORTHWEST_INFO 9 #define WINDOW_RESIZE_SOUTHEAST_INFO 10 #define WINDOW_RESIZE_SOUTHWEST_INFO 11 #define WINDOW_MENU_ITEM_SELECT_INFO 12 #define WINDOW_DEICONIFY_INFO 13 #define WINDOW_MENU_POST_INFO 14 #define WINDOW_FOCUS_INFO 15 #define WINDOW_MENU_UNPOST_INFO 16 #define WINDOW_MENU_ITEM_CHECK_INFO 17 #define ICON_MOVE_INFO 18 #define ICON_MENU_POST_INFO 19 #define ICON_MENU_UNPOST_INFO 20 #define ICON_MENU_ITEM_SELECT_INFO 21 #define WM_NORTHWEST 0 #define WM_NORTH 1 #define WM_NORTHEAST 2 #define WM_WEST 3 #define WM_EAST 4 #define WM_SOUTHWEST 5 #define WM_SOUTH 6 #define WM_SOUTHEAST 7 #define INVALID -1 #define MAX_MENU_ITEMS 20 #define MAX_NAME_LEN 95 /* values for MwmHints.input_mode */ #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 /* bit definitions for MwmHints.status */ #define MWM_TEAROFF_WINDOW (1L << 0) /* * The following is for compatibility only. It use is deprecated. */ #define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL /* * Contents of the _MWM_INFO property. */ typedef struct { long flags; Window wm_window; } MotifWmInfo; typedef MotifWmInfo MwmInfo; /* bit definitions for MotifWmInfo .flags */ #define MWM_INFO_STARTUP_STANDARD (1L << 0) #define MWM_INFO_STARTUP_CUSTOM (1L << 1) /* * Definitions for the _MWM_HINTS property. */ typedef struct { /* 32-bit property items are stored as long on the client (whether * that means 32 bits or 64). XChangeProperty handles the conversion * to the actual 32-bit quantities sent to the server. */ unsigned long flags; unsigned long functions; unsigned long decorations; long inputMode; unsigned long status; } PropMotifWmHints; typedef PropMotifWmHints PropMwmHints; /* number of elements of size 32 in _MWM_HINTS */ #define PROP_MOTIF_WM_HINTS_ELEMENTS 5 #define PROP_MWM_HINTS_ELEMENTS PROP_MOTIF_WM_HINTS_ELEMENTS /* atom name for _MWM_HINTS property */ #define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS" #define _XA_MWM_HINTS _XA_MOTIF_WM_HINTS /* * Definitions for the _MWM_MESSAGES property. */ #define _XA_MOTIF_WM_MESSAGES "_MOTIF_WM_MESSAGES" #define _XA_MWM_MESSAGES _XA_MOTIF_WM_MESSAGES /* atom that enables client frame offset messages */ #define _XA_MOTIF_WM_OFFSET "_MOTIF_WM_OFFSET" /* * Definitions for the _MWM_MENU property. */ /* atom name for _MWM_MENU property */ #define _XA_MOTIF_WM_MENU "_MOTIF_WM_MENU" #define _XA_MWM_MENU _XA_MOTIF_WM_MENU /* * Definitions for the _MWM_INFO property. */ typedef struct { /* 32-bit property items are stored as long on the client (whether * that means 32 bits or 64). XChangeProperty handles the conversion * to the actual 32-bit quantities sent to the server. */ long flags; Window wmWindow; } PropMotifWmInfo; typedef PropMotifWmInfo PropMwmInfo; /* number of elements of size 32 in _MWM_INFO */ #define PROP_MOTIF_WM_INFO_ELEMENTS 2 #define PROP_MWM_INFO_ELEMENTS PROP_MOTIF_WM_INFO_ELEMENTS /* atom name for _MWM_INFO property */ #define _XA_MOTIF_WM_INFO "_MOTIF_WM_INFO" #define _XA_MWM_INFO _XA_MOTIF_WM_INFO /* * Miscellaneous atom definitions */ /* atom for motif input bindings */ #define _XA_MOTIF_BINDINGS "_MOTIF_BINDINGS" #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMwmUtil_h */ motif-2.3.8/lib/Xm/MessageBP.h0000644000175000017500000000623513145162623012705 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmessageP_h #define _XmessageP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Constraint part record for MessageBox widget */ typedef struct _XmMessageBoxConstraintPart { char unused; } XmMessageBoxConstraintPart, * XmMessageBoxConstraint; /* New fields for the MessageBox widget class record */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmMessageBoxClassPart; /* Full class record declaration */ typedef struct _XmMessageBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmMessageBoxClassPart message_box_class; } XmMessageBoxClassRec; externalref XmMessageBoxClassRec xmMessageBoxClassRec; /* New fields for the MessageBox widget record */ typedef struct { unsigned char dialog_type; unsigned char default_type; Boolean internal_pixmap; Boolean minimize_buttons; unsigned char message_alignment; XmString message_string; Widget message_wid; Pixmap symbol_pixmap; Widget symbol_wid; XmString ok_label_string; XtCallbackList ok_callback; Widget ok_button; XmString cancel_label_string; XtCallbackList cancel_callback; XmString help_label_string; Widget help_button; Widget separator; } XmMessageBoxPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmMessageBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmMessageBoxPart message_box; } XmMessageBoxRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMessage_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Region.c0000644000175000017500000017534713145162623012330 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Region.c /main/10 1995/07/13 17:46:45 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * The functions in this file implement the XmRegion abstraction * An XmRegion is simply an area, as the name * implies, and is implemented as a "y-x-banded" array of rectangles. To * explain: Each XmRegion is made up of a certain number of rectangles sorted * by y coordinate first, and then by x coordinate. * * Furthermore, the rectangles are banded such that every rectangle with a * given upper-left y coordinate (y1) will have the same lower-right y * coordinate (y2) and vice versa. If a rectangle has scanlines in a band, it * will span the entire vertical distance of the band. This means that some * areas that could be merged into a taller rectangle will be represented as * several shorter rectangles to account for shorter rectangles to its left * or right but within its "vertical scope". * * An added constraint on the rectangles is that they must cover as much * horizontal area as possible. E.g. no two rectangles in a band are allowed * to touch. * * Whenever possible, bands will be merged together to cover a greater vertical * distance (and thus reduce the number of rectangles). Two bands can be merged * only if the bottom of one touches the top of the other and they have * rectangles in the same places (of the same width, of course). This maintains * the y-x-banding that's so nice to have... */ #include /* for memmove */ #include "XmI.h" #include "RegionI.h" #include "MessagesI.h" #define MESSAGE1 _XmMMsgRegion_0000 typedef void (*XmOverlapProc)( XmRegion, XmRegionBox *, XmRegionBox *, XmRegionBox *, XmRegionBox *, #if NeedWidePrototypes int, int) ; #else short, short) ; #endif /* NeedWidePrototypes */ typedef void (*XmNonOverlapProc)( XmRegion, XmRegionBox *, XmRegionBox *, #if NeedWidePrototypes int, int) ; #else short, short) ; #endif /* NeedWidePrototypes */ /******** Static Function Declarations ********/ static void miSetExtents( XmRegion pReg) ; static void Compress( XmRegion r, XmRegion s, XmRegion t, unsigned dx, int xdir, int grow) ; static void miIntersectO( register XmRegion pReg, register XmRegionBox *r1, XmRegionBox *r1End, register XmRegionBox *r2, XmRegionBox *r2End, #if NeedWidePrototypes int y1, int y2) ; #else short y1, short y2) ; #endif /* NeedWidePrototypes */ static void miRegionCopy( register XmRegion dstrgn, register XmRegion rgn) ; static long miCoalesce( register XmRegion pReg, long prevStart, long curStart) ; static void miRegionOp( register XmRegion newReg, XmRegion reg1, XmRegion reg2, XmOverlapProc overlapFunc, XmNonOverlapProc nonOverlap1Func, XmNonOverlapProc nonOverlap2Func) ; static void miUnionNonO( register XmRegion pReg, register XmRegionBox *r, XmRegionBox *rEnd, #if NeedWidePrototypes register int y1, register int y2) ; #else register short y1, register short y2) ; #endif /* NeedWidePrototypes */ static void miUnionO( register XmRegion pReg, register XmRegionBox *r1, XmRegionBox *r1End, register XmRegionBox *r2, XmRegionBox *r2End, #if NeedWidePrototypes register int y1, register int y2) ; #else register short y1, register short y2) ; #endif /* NeedWidePrototypes */ static void miSubtractNonO1( register XmRegion pReg, register XmRegionBox *r, XmRegionBox *rEnd, #if NeedWidePrototypes register int y1, register int y2) ; #else register short y1, register short y2) ; #endif /* NeedWidePrototypes */ static void miSubtractO( register XmRegion pReg, register XmRegionBox *r1, XmRegionBox *r1End, register XmRegionBox *r2, XmRegionBox *r2End, #if NeedWidePrototypes register int y1, register int y2) ; #else register short y1, register short y2) ; #endif /* NeedWidePrototypes */ static void CreateLeftShadow( XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi) ; static void CreateRightShadow( XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi) ; static void CreateTopShadow( #if NeedWidePrototypes int start_x, int end_x, #else Position start_x, Position end_x, #endif /* NeedWidePrototypes */ XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi) ; static void CreateBottomShadow( #if NeedWidePrototypes int start_x, int end_x, #else Position start_x, Position end_x, #endif /* NeedWidePrototypes */ XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi) ; static void ShrinkRegion( XmRegion r, XmRegion s, XmRegion t, int dx, int dy) ; /******** End Static Function Declarations ********/ /************************************************************************ * * _XmRegionCreateSize() * * Creates a new, empty, XmRegion of specified size. ***********************************************************************/ XmRegion _XmRegionCreateSize( long size ) { XmRegion temp; if (!(temp = ( XmRegion )XtMalloc(sizeof (XmRegionRec)))) return (XmRegion) NULL; if (!(temp->rects = (XmRegionBox *) XtMalloc((Cardinal) (sizeof(XmRegionBox)*size)))) { XtFree((char *) temp); return (XmRegion) NULL; } temp->numRects = 0; temp->extents.x1 = 0; temp->extents.y1 = 0; temp->extents.x2 = 0; temp->extents.y2 = 0; temp->size = size; return( temp ); } /************************************************************************ * * _XmRegionCreate() * * Creates a new, empty, XmRegion. ***********************************************************************/ XmRegion _XmRegionCreate( void ) { return (_XmRegionCreateSize(1L)); } /************************************************************************ * * _XmRegionDestroy () * * Frees the memory associated with an XmRegion. ***********************************************************************/ void _XmRegionDestroy( XmRegion r ) { XtFree( (char *) r->rects ); XtFree( (char *) r ); } /************************************************************************ * * _XmRegionClear () * * Empties an XmRegion. ***********************************************************************/ void _XmRegionClear( XmRegion r ) { r->numRects = 0; r->extents.x1 = 0; r->extents.y1 = 0; r->extents.x2 = 0; r->extents.y2 = 0; } /************************************************************************ * * _XmRegionIsEmpty () * * Check to see if an XmRegion is empty. ***********************************************************************/ Boolean _XmRegionIsEmpty( XmRegion r ) { return ISEMPTY(r); } /************************************************************************ * * _XmRegionEqual () * * Check to see if two XmRegions are equal. ***********************************************************************/ Boolean _XmRegionEqual( register XmRegion r1, register XmRegion r2 ) { register int i; if (r1->numRects != r2->numRects) { return( False ); } else if (ISEMPTY(r1)) { return( True ); } /* * R1 and r2 have the same nonzero number of rectangles. * Check the extents. */ else if (r1->extents.x1 != r2->extents.x1 || r1->extents.x2 != r2->extents.x2 || r1->extents.y1 != r2->extents.y1 || r1->extents.y2 != r2->extents.y2) { return( False ); } /* * The extents match. Check each rectangle. */ else { for (i=0; i < r1->numRects; i++) { if (r1->rects[i].x1 != r2->rects[i].x1 || r1->rects[i].x2 != r2->rects[i].x2 || r1->rects[i].y1 != r2->rects[i].y1 || r1->rects[i].y2 != r2->rects[i].y2) { return( False ); } } } return( True ); } /************************************************************************ * * _XmRegionPointInRegion () * * Check to see if a point is in a XmRegion. ***********************************************************************/ Boolean _XmRegionPointInRegion( XmRegion r, int x, int y ) { register int i; if (ISEMPTY(r)) { return(False); } if (!INBOX(r->extents, x, y)) { return(False); } for (i = 0; i < r->numRects; i++) { if (INBOX (r->rects[i], x, y)) return(True); } return(False); } /************************************************************************ * * _XmRegionOffset () * * Adds an (x, y) offset to an XmRegion. ***********************************************************************/ void _XmRegionOffset( XmRegion r, int x, int y ) { register long nbox; register XmRegionBox *pbox; pbox = r->rects; nbox = r->numRects; while(nbox--) { pbox->x1 += x; pbox->x2 += x; pbox->y1 += y; pbox->y2 += y; pbox++; } r->extents.x1 += x; r->extents.x2 += x; r->extents.y1 += y; r->extents.y2 += y; } /************************************************************************ * * _XmRegionGetExtents () * * Returns an XmRegion's extents in an XRectangle provided by the caller. * Assumes the extents are current. ***********************************************************************/ void _XmRegionGetExtents( XmRegion r, XRectangle *rect ) { rect->x = r->extents.x1; rect->y = r->extents.y1; rect->width = r->extents.x2 - r->extents.x1; rect->height = r->extents.y2 - r->extents.y1; } /************************************************************************ * * _XmRegionGetNumRectangles () * * Returns the number of rectangles used by an XmRegion. ***********************************************************************/ long _XmRegionGetNumRectangles( XmRegion r ) { return (r->numRects); } /************************************************************************ * * _XmRegionGetRectangles () * * Allocates and returns a list and count of XRectangles representing * an XmRegion. ***********************************************************************/ void _XmRegionGetRectangles( XmRegion r, XRectangle **rects, long *nrects ) { register XmRegionBox *pBox = r->rects; register XRectangle *pRect; register long count = r->numRects; if (!(*nrects = count)) { *rects = NULL; return; } pRect = *rects = (XRectangle *) XtMalloc ((Cardinal) (sizeof (XRectangle) * count)); if (pRect) { for (; count; pBox++, pRect++, count--) { pRect->x = pBox->x1; pRect->y = pBox->y1; pRect->width = (unsigned short) pBox->x2 - pBox->x1; pRect->height = (unsigned short) pBox->y2 - pBox->y1; } } } /************************************************************************ * * _XmRegionSetGCRegion () * * Sets the clip-mask of a given GC to an XmRegion. * Graphics output is disabled if the XmRegion is empty. ***********************************************************************/ void _XmRegionSetGCRegion( Display *dpy, GC gc, int x_origin, int y_origin, XmRegion r) { XRectangle *rects; long nrects; _XmRegionGetRectangles (r, &rects, &nrects); if (rects || !nrects) { /* not if XtMalloc failed */ XSetClipRectangles(dpy, gc, x_origin, y_origin, rects, (int) nrects, YXBanded); } XtFree ((char *) rects); } /************************************************************************ * * miSetExtents() * * Computes and resets the extents of an XmRegion. Called by * miSubtract and miIntersect b/c they can't figure it out along the * way or do so easily, as miUnion can. * * Results: * None. * * Side Effects: * The region's 'extents' structure is overwritten. * ***********************************************************************/ static void miSetExtents( XmRegion pReg ) { register XmRegionBox *pBox; register XmRegionBox *pBoxEnd; register XmRegionBox *pExtents; if (ISEMPTY(pReg)) { pReg->extents.x1 = 0; pReg->extents.y1 = 0; pReg->extents.x2 = 0; pReg->extents.y2 = 0; return; } pExtents = &pReg->extents; pBox = pReg->rects; pBoxEnd = &pBox[pReg->numRects - 1]; /* * Since pBox is the first rectangle in the region, it must have the * smallest y1 and since pBoxEnd is the last rectangle in the region, * it must have the largest y2, because of banding. Initialize x1 and * x2 from pBox and pBoxEnd, resp., as good things to initialize them * to... */ pExtents->x1 = pBox->x1; pExtents->y1 = pBox->y1; pExtents->x2 = pBoxEnd->x2; pExtents->y2 = pBoxEnd->y2; assert(pExtents->y1 < pExtents->y2); while (pBox <= pBoxEnd) { if (pBox->x1 < pExtents->x1) { pExtents->x1 = pBox->x1; } if (pBox->x2 > pExtents->x2) { pExtents->x2 = pBox->x2; } pBox++; } assert(pExtents->x1 < pExtents->x2); } /************************************************************************ * * _XmRegionComputeExtents () * * Compute and set the extents of an XmRegion. ***********************************************************************/ void _XmRegionComputeExtents( XmRegion r ) { miSetExtents (r); } /************************************************************************ * * miRegionCopy() * ***********************************************************************/ static void miRegionCopy( register XmRegion dstrgn, register XmRegion rgn ) { if (dstrgn != rgn) /* don't want to copy to itself */ { if (dstrgn->size < rgn->numRects) { if (dstrgn->rects) { if (! (dstrgn->rects = (XmRegionBox *) XtRealloc((char *) dstrgn->rects, (Cardinal) rgn->numRects * (sizeof(XmRegionBox))))) return; } dstrgn->size = rgn->numRects; } dstrgn->numRects = rgn->numRects; dstrgn->extents.x1 = rgn->extents.x1; dstrgn->extents.y1 = rgn->extents.y1; dstrgn->extents.x2 = rgn->extents.x2; dstrgn->extents.y2 = rgn->extents.y2; memmove((char *) dstrgn->rects, (char *) rgn->rects, (int) (rgn->numRects * sizeof(XmRegionBox))); } } /*====================================================================== * Generic Region Operator *====================================================================*/ /*- *----------------------------------------------------------------------- * miCoalesce -- * Attempt to merge the boxes in the current band with those in the * previous one. Used only by miRegionOp. * * Results: * The new index for the previous band. * * Side Effects: * If coalescing takes place: * - rectangles in the previous band will have their y2 fields * altered. * - pReg->numRects will be decreased. * *----------------------------------------------------------------------- */ static long miCoalesce( XmRegion pReg, long prevStart, long curStart ) { register XmRegionBox *pPrevBox; /* Current box in previous band */ register XmRegionBox *pCurBox; /* Current box in current band */ register XmRegionBox *pRegEnd; /* End of region */ register long curNumRects; /* Number of rectangles in current band */ long prevNumRects; /* Number of rectangles in previous band */ long bandY1; /* Y1 coordinate for current band */ pRegEnd = &pReg->rects[pReg->numRects]; pPrevBox = &pReg->rects[prevStart]; prevNumRects = curStart - prevStart; /* * Figure out how many rectangles are in the current band. Have to do * this because multiple bands could have been added in miRegionOp * at the end when one region has been exhausted. */ pCurBox = &pReg->rects[curStart]; bandY1 = pCurBox->y1; for (curNumRects = 0; (pCurBox != pRegEnd) && (pCurBox->y1 == bandY1); curNumRects++) { pCurBox++; } if (pCurBox != pRegEnd) { /* * If more than one band was added, we have to find the start * of the last band added so the next coalescing job can start * at the right place... (given when multiple bands are added, * this may be pointless -- see above). */ pRegEnd--; while (pRegEnd[-1].y1 == pRegEnd->y1) { pRegEnd--; } curStart = pRegEnd - pReg->rects; pRegEnd = pReg->rects + pReg->numRects; } if ((curNumRects == prevNumRects) && (curNumRects != 0)) { pCurBox -= curNumRects; /* * The bands may only be coalesced if the bottom of the previous * matches the top scanline of the current. */ if (pPrevBox->y2 == pCurBox->y1) { /* * Make sure the bands have boxes in the same places. This * assumes that boxes have been added in such a way that they * cover the most area possible. I.e. two boxes in a band must * have some horizontal space between them. */ do { if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) { /* * The bands don't line up so they can't be coalesced. */ return (curStart); } pPrevBox++; pCurBox++; prevNumRects -= 1; } while (prevNumRects != 0); pReg->numRects -= curNumRects; pCurBox -= curNumRects; pPrevBox -= curNumRects; /* * The bands may be merged, so set the bottom y of each box * in the previous band to that of the corresponding box in * the current band. */ do { pPrevBox->y2 = pCurBox->y2; pPrevBox++; pCurBox++; curNumRects -= 1; } while (curNumRects != 0); /* * If only one band was added to the region, we have to backup * curStart to the start of the previous band. * * If more than one band was added to the region, copy the * other bands down. The assumption here is that the other bands * came from the same region as the current one and no further * coalescing can be done on them since it's all been done * already... curStart is already in the right place. */ if (pCurBox == pRegEnd) { curStart = prevStart; } else { do { *pPrevBox++ = *pCurBox++; } while (pCurBox != pRegEnd); } } } return (curStart); } /*- *----------------------------------------------------------------------- * miRegionOp -- * Apply an operation to two regions. Called by miUnion, miInverse, * miSubtract, miIntersect... * * Results: * None. * * Side Effects: * THE NEW REGION IS OVERWRITTEN. * * Notes: * The idea behind this function is to view the two regions as sets. * Together they cover a rectangle of area that this function divides * into horizontal bands where points are covered only by one region * or by both. For the first case, the nonOverlapFunc is called with * each the band and the band's upper and lower extents. For the * second, the overlapFunc is called to process the entire band. It * is responsible for clipping the rectangles in the band, though * this function provides the boundaries. * At the end of each band, the new region is coalesced, if possible, * to reduce the number of rectangles in the region. * *----------------------------------------------------------------------- */ static void miRegionOp( register XmRegion newReg, XmRegion reg1, XmRegion reg2, XmOverlapProc overlapFunc, XmNonOverlapProc nonOverlap1Func, XmNonOverlapProc nonOverlap2Func) { register XmRegionBox *r1; /* Pointer into first region */ register XmRegionBox *r2; /* Pointer into 2d region */ XmRegionBox *r1End; /* End of 1st region */ XmRegionBox *r2End; /* End of 2d region */ register short ybot; /* Bottom of intersection */ register short ytop; /* Top of intersection */ XmRegionBox *oldRects; /* Old rects for newReg */ long prevBand; /* Index of start of * previous band in newReg */ long curBand; /* Index of start of current * band in newReg */ register XmRegionBox *r1BandEnd; /* End of current band in r1 */ register XmRegionBox *r2BandEnd; /* End of current band in r2 */ short top; /* Top of non-overlapping * band */ short bot; /* Bottom of non-overlapping * band */ /* * Initialization: * set r1, r2, r1End and r2End appropriately, preserve the important * parts of the destination region until the end in case it's one of * the two source regions. */ r1 = reg1->rects; r2 = reg2->rects; r1End = r1 + reg1->numRects; r2End = r2 + reg2->numRects; oldRects = newReg->rects; /* * Mark the "new" region empty and * allocate a reasonable number of rectangles for it. The idea * is to allocate enough so the individual functions don't need to * reallocate and copy the array, which is time consuming, yet we don't * have to worry about using too much memory. I hope to be able to * nuke the XtRealloc() at the end of this function eventually. */ newReg->numRects = 0; newReg->size = MAX(reg1->numRects,reg2->numRects) * 2; if (! (newReg->rects = (XmRegionBox *) XtMalloc ((Cardinal) (sizeof(XmRegionBox) * newReg->size)))) { newReg->size = 0; return; } /* * Initialize ybot and ytop. * In the upcoming loop, ybot and ytop serve different functions depending * on whether the band being handled is an overlapping or non-overlapping * band. * In the case of a non-overlapping band (only one of the regions * has points in the band), ybot is the bottom of the most recent * intersection and thus clips the top of the rectangles in that band. * ytop is the top of the next intersection between the two regions and * serves to clip the bottom of the rectangles in the current band. * For an overlapping band (where the two regions intersect), ytop clips * the top of the rectangles of both regions and ybot clips the bottoms. */ if (reg1->extents.y1 < reg2->extents.y1) ybot = reg1->extents.y1; else ybot = reg2->extents.y1; /* * prevBand serves to mark the start of the previous band so rectangles * can be coalesced into larger rectangles. qv. miCoalesce, above. * In the beginning, there is no previous band, so prevBand == curBand * (curBand is set later on, of course, but the first band will always * start at index 0). prevBand and curBand must be indices because of * the possible expansion, and resultant moving, of the new region's * array of rectangles. */ prevBand = 0; do { curBand = newReg->numRects; /* * This algorithm proceeds one source-band (as opposed to a * destination band, which is determined by where the two regions * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the * rectangle after the last one in the current band for their * respective regions. */ r1BandEnd = r1; while ((r1BandEnd != r1End) && (r1BandEnd->y1 == r1->y1)) { r1BandEnd++; } r2BandEnd = r2; while ((r2BandEnd != r2End) && (r2BandEnd->y1 == r2->y1)) { r2BandEnd++; } /* * First handle the band that doesn't intersect, if any. * * Note that attention is restricted to one band in the * non-intersecting region at once, so if a region has n * bands between the current position and the next place it overlaps * the other, this entire loop will be passed through n times. */ if (r1->y1 < r2->y1) { top = MAX(r1->y1,ybot); bot = MIN(r1->y2,r2->y1); if ((top != bot) && nonOverlap1Func) { (* nonOverlap1Func) (newReg, r1, r1BandEnd, top, bot); } ytop = r2->y1; } else if (r2->y1 < r1->y1) { top = MAX(r2->y1,ybot); bot = MIN(r2->y2,r1->y1); if ((top != bot) && nonOverlap2Func) { (* nonOverlap2Func) (newReg, r2, r2BandEnd, top, bot); } ytop = r1->y1; } else { ytop = r1->y1; } /* * If any rectangles got added to the region, try and coalesce them * with rectangles from the previous band. Note we could just do * this test in miCoalesce, but some machines incur a not * inconsiderable cost for function calls, so... */ if (newReg->numRects != curBand) { prevBand = miCoalesce (newReg, prevBand, curBand); } /* * Now see if we've hit an intersecting band. The two bands only * intersect if ybot > ytop */ ybot = MIN(r1->y2, r2->y2); curBand = newReg->numRects; if (ybot > ytop) { (* overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot); } if (newReg->numRects != curBand) { prevBand = miCoalesce (newReg, prevBand, curBand); } /* * If we've finished with a band (y2 == ybot) we skip forward * in the region to the next band. */ if (r1->y2 == ybot) { r1 = r1BandEnd; } if (r2->y2 == ybot) { r2 = r2BandEnd; } } while ((r1 != r1End) && (r2 != r2End)); /* * Deal with whichever region still has rectangles left. */ curBand = newReg->numRects; if (r1 != r1End) { if (nonOverlap1Func) { do { r1BandEnd = r1; while ((r1BandEnd < r1End) && (r1BandEnd->y1 == r1->y1)) { r1BandEnd++; } (* nonOverlap1Func) (newReg, r1, r1BandEnd, MAX(r1->y1,ybot), r1->y2); r1 = r1BandEnd; } while (r1 != r1End); } } else if ((r2 != r2End) && nonOverlap2Func) { do { r2BandEnd = r2; while ((r2BandEnd < r2End) && (r2BandEnd->y1 == r2->y1)) { r2BandEnd++; } (* nonOverlap2Func) (newReg, r2, r2BandEnd, MAX(r2->y1,ybot), r2->y2); r2 = r2BandEnd; } while (r2 != r2End); } if (newReg->numRects != curBand) { (void) miCoalesce (newReg, prevBand, curBand); } /* * A bit of cleanup. To keep regions from growing without bound, * we shrink the array of rectangles to match the new number of * rectangles in the region. This never goes to 0, however... * * Only do this stuff if the number of rectangles allocated is more than * twice the number of rectangles in the region (a simple optimization...). */ if (newReg->numRects < (newReg->size >> 1)) { if (newReg->numRects) { XmRegionBox *prev_rects = newReg->rects; newReg->size = newReg->numRects; newReg->rects = (XmRegionBox *) XtRealloc ((char *) newReg->rects, (Cardinal) (sizeof(XmRegionBox) * newReg->size)); if (! newReg->rects) newReg->rects = prev_rects; } else { /* * No point in doing the extra work involved in an XtRealloc if * the region is empty */ newReg->size = 1; XtFree((char *) newReg->rects); newReg->rects = (XmRegionBox *) XtMalloc(sizeof(XmRegionBox)); } } XtFree ((char *) oldRects); } /*====================================================================== * Region Intersection *====================================================================*/ /*- *----------------------------------------------------------------------- * miIntersectO -- * Handle an overlapping band for miIntersect. * * Results: * None. * * Side Effects: * Rectangles may be added to the region. * *----------------------------------------------------------------------- */ static void miIntersectO( XmRegion pReg, register XmRegionBox *r1, XmRegionBox *r1End, register XmRegionBox *r2, XmRegionBox *r2End, #if NeedWidePrototypes int y1, int y2 ) #else short y1, short y2 ) #endif /* NeedWidePrototypes */ { register short x1; register short x2; register XmRegionBox *pNextRect; pNextRect = &pReg->rects[pReg->numRects]; while ((r1 != r1End) && (r2 != r2End)) { x1 = MAX(r1->x1,r2->x1); x2 = MIN(r1->x2,r2->x2); /* * If there's any overlap between the two rectangles, add that * overlap to the new region. * There's no need to check for subsumption because the only way * such a need could arise is if some region has two rectangles * right next to each other. Since that should never happen... */ if (x1 < x2) { assert(y1rects); pNextRect->x1 = x1; pNextRect->y1 = y1; pNextRect->x2 = x2; pNextRect->y2 = y2; pReg->numRects += 1; pNextRect++; assert(pReg->numRects <= pReg->size); } /* * Need to advance the pointers. Shift the one that extends * to the right the least, since the other still has a chance to * overlap with that region's next rectangle, if you see what I mean. */ if (r1->x2 < r2->x2) { r1++; } else if (r2->x2 < r1->x2) { r2++; } else { r1++; r2++; } } } /************************************************************************ * * _XmRegionIntersect () * * Intersect two regions and place the result into a new region. * The new region is overwritten. ***********************************************************************/ void _XmRegionIntersect( XmRegion reg1, XmRegion reg2, XmRegion newReg ) { /* * Check for trivial reject. */ if ( ISEMPTY(reg1) || ISEMPTY(reg2) || (!EXTENTCHECK(®1->extents, ®2->extents))) newReg->numRects = 0; else miRegionOp (newReg, reg1, reg2, miIntersectO, NULL, NULL); /* * Can't alter newReg's extents before we call miRegionOp because * it might be one of the source regions and miRegionOp depends * on the extents of those regions being the same. Besides, this * way there's no checking against rectangles that will be nuked * due to coalescing, so we have to examine fewer rectangles. */ miSetExtents(newReg); } /************************************************************************ * * _XmRegionIntersectRectWithRegion () * * Intersect a rectangle with a region and place the result into a new * region. The new region is overwritten. ***********************************************************************/ void _XmRegionIntersectRectWithRegion( XRectangle *rect, XmRegion source, XmRegion dest ) { XmRegionRec region; region.rects = ®ion.extents; region.numRects = 1; region.extents.x1 = rect->x; region.extents.y1 = rect->y; region.extents.x2 = rect->x + rect->width; region.extents.y2 = rect->y + rect->height; region.size = 1; _XmRegionIntersect(®ion, source, dest); } /*====================================================================== * Region Union *====================================================================*/ /*- *----------------------------------------------------------------------- * miUnionNonO -- * Handle a non-overlapping band for the union operation. Just * Adds the rectangles into the region. Doesn't have to check for * subsumption or anything. * * Results: * None. * * Side Effects: * pReg->numRects is incremented and the final rectangles overwritten * with the rectangles we're passed. * *----------------------------------------------------------------------- */ static void miUnionNonO( XmRegion pReg, register XmRegionBox *r, XmRegionBox *rEnd, #if NeedWidePrototypes register int y1, register int y2 ) #else register short y1, register short y2 ) #endif /* NeedWidePrototypes */ { register XmRegionBox *pNextRect; pNextRect = &pReg->rects[pReg->numRects]; assert(y1 <= y2); while (r != rEnd) { assert(r->x1 < r->x2); MEMCHECK(pReg, pNextRect, pReg->rects); pNextRect->x1 = r->x1; pNextRect->y1 = y1; pNextRect->x2 = r->x2; pNextRect->y2 = y2; pReg->numRects += 1; pNextRect++; assert(pReg->numRects<=pReg->size); r++; } } /*- *----------------------------------------------------------------------- * miUnionO -- * Handle an overlapping band for the union operation. Picks the * left-most rectangle each time and merges it into the region. * * Results: * None. * * Side Effects: * Rectangles are overwritten in pReg->rects and pReg->numRects will * be changed. * *----------------------------------------------------------------------- */ static void miUnionO( XmRegion pReg, register XmRegionBox *r1, XmRegionBox *r1End, register XmRegionBox *r2, XmRegionBox *r2End, #if NeedWidePrototypes register int y1, register int y2 ) #else register short y1, register short y2 ) #endif /* NeedWidePrototypes */ { register XmRegionBox *pNextRect; pNextRect = &pReg->rects[pReg->numRects]; #define MERGERECT(r) \ if ((pReg->numRects != 0) && \ (pNextRect[-1].y1 == y1) && \ (pNextRect[-1].y2 == y2) && \ (pNextRect[-1].x2 >= r->x1)) \ { \ if (pNextRect[-1].x2 < r->x2) \ { \ pNextRect[-1].x2 = r->x2; \ assert(pNextRect[-1].x1rects); \ pNextRect->y1 = y1; \ pNextRect->y2 = y2; \ pNextRect->x1 = r->x1; \ pNextRect->x2 = r->x2; \ pReg->numRects += 1; \ pNextRect += 1; \ } \ assert(pReg->numRects<=pReg->size);\ r++; assert (y1x1 < r2->x1) { MERGERECT(r1); } else { MERGERECT(r2); } } if (r1 != r1End) { do { MERGERECT(r1); } while (r1 != r1End); } else while (r2 != r2End) { MERGERECT(r2); } } /************************************************************************ * * _XmRegionUnion () * * Union two regions and place the result into a new region. * The new region is overwritten. ***********************************************************************/ void _XmRegionUnion( XmRegion reg1, XmRegion reg2, XmRegion newReg ) { /* checks all the simple cases */ /* * XmRegion 1 and 2 are the same or region 1 is empty */ if ( reg1 == reg2 || ISEMPTY(reg1) ) { miRegionCopy(newReg, reg2); return; } /* * if nothing to union (region 2 empty) */ if (ISEMPTY(reg2)) { miRegionCopy(newReg, reg1); return; } /* * Region 1 completely subsumes region 2 */ if ((reg1->numRects == 1) && (reg1->extents.x1 <= reg2->extents.x1) && (reg1->extents.y1 <= reg2->extents.y1) && (reg1->extents.x2 >= reg2->extents.x2) && (reg1->extents.y2 >= reg2->extents.y2)) { miRegionCopy(newReg, reg1); return; } /* * Region 2 completely subsumes region 1 */ if ((reg2->numRects == 1) && (reg2->extents.x1 <= reg1->extents.x1) && (reg2->extents.y1 <= reg1->extents.y1) && (reg2->extents.x2 >= reg1->extents.x2) && (reg2->extents.y2 >= reg1->extents.y2)) { miRegionCopy(newReg, reg2); return; } miRegionOp (newReg, reg1, reg2, miUnionO, miUnionNonO, miUnionNonO); newReg->extents.x1 = MIN(reg1->extents.x1, reg2->extents.x1); newReg->extents.y1 = MIN(reg1->extents.y1, reg2->extents.y1); newReg->extents.x2 = MAX(reg1->extents.x2, reg2->extents.x2); newReg->extents.y2 = MAX(reg1->extents.y2, reg2->extents.y2); } /************************************************************************ * * _XmRegionUnionRectWithRegion () * * Union a rectangle with a region and place the result into a new * region. The new region is overwritten. ***********************************************************************/ void _XmRegionUnionRectWithRegion( XRectangle *rect, XmRegion source, XmRegion dest ) { XmRegionRec region; XmRegionBox box[1]; /* region.rects = ®ion.extents; */ region.rects = box; region.numRects = 1; region.rects->x1 = region.extents.x1 = rect->x; region.rects->y1 = region.extents.y1 = rect->y; region.rects->x2 = region.extents.x2 = rect->x + rect->width; region.rects->y2 = region.extents.y2 = rect->y + rect->height; region.size = 1; _XmRegionUnion(®ion, source, dest); } /*====================================================================== * Region Subtraction *====================================================================*/ /*- *----------------------------------------------------------------------- * miSubtractNonO -- * Deal with non-overlapping band for subtraction. Any parts from * region 2 we discard. Anything from region 1 we add to the region. * * Results: * None. * * Side Effects: * pReg may be affected. * *----------------------------------------------------------------------- */ static void miSubtractNonO1( XmRegion pReg, register XmRegionBox *r, XmRegionBox *rEnd, #if NeedWidePrototypes register int y1, register int y2 ) #else register short y1, register short y2 ) #endif /* NeedWidePrototypes */ { register XmRegionBox *pNextRect; pNextRect = &pReg->rects[pReg->numRects]; assert(y1x1x2); MEMCHECK(pReg, pNextRect, pReg->rects); pNextRect->x1 = r->x1; pNextRect->y1 = y1; pNextRect->x2 = r->x2; pNextRect->y2 = y2; pReg->numRects += 1; pNextRect++; assert(pReg->numRects <= pReg->size); r++; } } /*- *----------------------------------------------------------------------- * miSubtractO -- * Overlapping band subtraction. x1 is the left-most point not yet * checked. * * Results: * None. * * Side Effects: * pReg may have rectangles added to it. * *----------------------------------------------------------------------- */ static void miSubtractO( XmRegion pReg, register XmRegionBox *r1, XmRegionBox *r1End, register XmRegionBox *r2, XmRegionBox *r2End, #if NeedWidePrototypes register int y1, register int y2 ) #else register short y1, register short y2 ) #endif /* NeedWidePrototypes */ { register XmRegionBox *pNextRect; register int x1; x1 = r1->x1; assert(y1rects[pReg->numRects]; while ((r1 != r1End) && (r2 != r2End)) { if (r2->x2 <= x1) { /* * Subtrahend missed the boat: go to next subtrahend. */ r2++; } else if (r2->x1 <= x1) { /* * Subtrahend preceeds minuend: nuke left edge of minuend. */ x1 = r2->x2; if (x1 >= r1->x2) { /* * Minuend completely covered: advance to next minuend and * reset left fence to edge of new minuend. */ if (++r1 != r1End) { x1 = r1->x1; } } else { /* * Subtrahend now used up since it doesn't extend beyond * minuend */ r2++; } } else if (r2->x1 < r1->x2) { /* * Left part of subtrahend covers part of minuend: add uncovered * part of minuend to region and skip to next subtrahend. */ assert(x1x1); MEMCHECK(pReg, pNextRect, pReg->rects); pNextRect->x1 = x1; pNextRect->y1 = y1; pNextRect->x2 = r2->x1; pNextRect->y2 = y2; pReg->numRects += 1; pNextRect++; assert(pReg->numRects<=pReg->size); x1 = r2->x2; if (x1 >= r1->x2) { /* * Minuend used up: advance to new... */ if (++r1 != r1End) { x1 = r1->x1; } } else { /* * Subtrahend used up */ r2++; } } else { /* * Minuend used up: add any remaining piece before advancing. */ if (r1->x2 > x1) { MEMCHECK(pReg, pNextRect, pReg->rects); pNextRect->x1 = x1; pNextRect->y1 = y1; pNextRect->x2 = r1->x2; pNextRect->y2 = y2; pReg->numRects += 1; pNextRect++; assert(pReg->numRects<=pReg->size); } if (++r1 != r1End) { x1 = r1->x1; } } } /* * Add remaining minuend rectangles to region. */ while (r1 != r1End) { assert(x1x2); MEMCHECK(pReg, pNextRect, pReg->rects); pNextRect->x1 = x1; pNextRect->y1 = y1; pNextRect->x2 = r1->x2; pNextRect->y2 = y2; pReg->numRects += 1; pNextRect++; assert(pReg->numRects<=pReg->size); if (++r1 != r1End) { x1 = r1->x1; } } } /************************************************************************ * * _XmRegionSubtract () * * Subtract one region from another and place the result into a new * region. The new region is overwritten. ***********************************************************************/ void _XmRegionSubtract( XmRegion regM, XmRegion regS, XmRegion regD ) { /* check for trivial reject */ if ( ISEMPTY(regM) || ISEMPTY(regS) || (!EXTENTCHECK(®M->extents, ®S->extents)) ) { miRegionCopy(regD, regM); return; } miRegionOp (regD, regM, regS, miSubtractO, miSubtractNonO1, NULL); /* * Can't alter newReg's extents before we call miRegionOp because * it might be one of the source regions and miRegionOp depends * on the extents of those regions being the unaltered. Besides, this * way there's no checking against rectangles that will be nuked * due to coalescing, so we have to examine fewer rectangles. */ miSetExtents (regD); } /************************************************************************ * * Utility procedure Compress: * * Replace r by the region r', where * p in r' iff (Quantifer m <= dx) (p + m in r), and * Quantifier is Exists if grow is TRUE, For all if grow is FALSE, and * (x,y) + m = (x+m,y) if xdir is TRUE; (x,y+m) if xdir is FALSE. * * Thus, if xdir is TRUE and grow is FALSE, r is replaced by the region * of all points p such that p and the next dx points on the same * horizontal scan line are all in r. We do this using by noting * that p is the head of a run of length 2^i + k iff p is the head * of a run of length 2^i and p+2^i is the head of a run of length * k. Thus, the loop invariant: s contains the region corresponding * to the runs of length shift. r contains the region corresponding * to the runs of length 1 + dxo & (shift-1), where dxo is the original * value of dx. dx = dxo & ~(shift-1). As parameters, s and t are * scratch regions, so that we don't have to allocate them on every * call. ***********************************************************************/ static void Compress( XmRegion r, XmRegion s, XmRegion t, unsigned dx, int xdir, int grow ) { register unsigned shift = 1; miRegionCopy (s, r); while (dx) { if (dx & shift) { if (xdir) { _XmRegionOffset (r, -(int)shift, 0); } else { _XmRegionOffset (r, 0, -(int)shift); } if (grow) { _XmRegionUnion (r,s,r); } else { _XmRegionIntersect (r,s,r); } dx -= shift; if (!dx) break; } miRegionCopy (t, s); if (xdir) { _XmRegionOffset (s, -(int)shift, 0); } else { _XmRegionOffset (s, 0, -(int)shift); } if (grow) { _XmRegionUnion (s,t,s); } else { _XmRegionIntersect (s,t,s); } shift <<= 1; } } /************************************************************************ * * ShrinkRegion () * * Shrink an XmRegion dx and dy in the x and y directions, respectively. * The width and height are reduced by 2dx and 2dy, respectively. ***********************************************************************/ static void ShrinkRegion( XmRegion r, XmRegion s, XmRegion t, int dx, int dy ) { int grow; if ((grow = (dx < 0)) != 0) { dx = -dx; } if (dx) { Compress (r, s, t, (unsigned) 2*dx, TRUE, grow); } if ((grow = (dy < 0)) != 0) { dy = -dy; } if (dy) { Compress (r, s, t, (unsigned) 2*dy, FALSE, grow); } _XmRegionOffset (r, dx, dy); } /************************************************************************ * * _XmRegionShrink () * * Shrink an XmRegion dx and dy in the x and y directions, respectively. * The width and height are reduced by 2dx and 2dy, respectively. ***********************************************************************/ void _XmRegionShrink( XmRegion r, int dx, int dy ) { XmRegion s, t; if (!dx && !dy) { return; } if (!(s = _XmRegionCreate())) { return; } if (!(t = _XmRegionCreate())) { _XmRegionDestroy (s); return; } ShrinkRegion (r, s, t, dx, dy); _XmRegionDestroy (s); _XmRegionDestroy (t); } /************************************************************************ * * CreateLeftShadow () * * Create a one-pixel thick left shadow segment for the current XY- * banded rectangle. ***********************************************************************/ static void CreateLeftShadow( XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi ) { Position start_y = here->y1 + 1; Position end_y = here->y2; if (*segmi >= *segmc) { *segml = (XSegment *) XtRealloc ((char *)(*segml), (Cardinal) ((sizeof(XSegment) << 1) * (*segmc))); if (*segml == NULL) { XmeWarning(NULL, MESSAGE1); *segmi = *segmc = 0; return; } *segmc *= 2; } if (mask & BL_OPEN) { end_y--; } if (start_y <= end_y) { (*segml)[*segmi].x1 = (*segml)[*segmi].x2 = here->x1; (*segml)[*segmi].y1 = start_y; (*segml)[*segmi].y2 = end_y; (*segmi)++; } } /************************************************************************ * * CreateRightShadow () * * Create a one-pixel thick right shadow segment for the current XY- * banded rectangle. ***********************************************************************/ static void CreateRightShadow( XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi ) { Position start_y = here->y1; Position end_y = here->y2; if (*segmi >= *segmc) { *segml = (XSegment *) XtRealloc ((char *)(*segml), (Cardinal) ((sizeof(XSegment) << 1) * (*segmc))); if (*segml == NULL) { XmeWarning(NULL, MESSAGE1); *segmi = *segmc = 0; return; } *segmc *= 2; } if (!(mask & TR_MATCH)) { start_y++; } if (!(mask & BR_OPEN)) { end_y--; } if (start_y <= end_y) { (*segml)[*segmi].x1 = (*segml)[*segmi].x2 = here->x2; (*segml)[*segmi].y1 = start_y; (*segml)[*segmi].y2 = end_y; (*segmi)++; } } /************************************************************************ * * CreateTopShadow () * * Create a one-pixel thick top shadow segment between two points. ***********************************************************************/ static void CreateTopShadow( #if NeedWidePrototypes int start_x, int end_x, #else Position start_x, Position end_x, #endif /* NeedWidePrototypes */ XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi ) { if (*segmi >= *segmc) { *segml = (XSegment *) XtRealloc ((char *)(*segml), (Cardinal) ((sizeof(XSegment) << 1) * (*segmc))); if (*segml == NULL) { XmeWarning(NULL, MESSAGE1); *segmi = *segmc = 0; return; } *segmc *= 2; } if (mask & TL_OPEN) { start_x++; } if (start_x <= end_x) { (*segml)[*segmi].y1 = (*segml)[*segmi].y2 = here->y1; (*segml)[*segmi].x1 = start_x; (*segml)[*segmi].x2 = end_x; (*segmi)++; } } /************************************************************************ * * CreateBottomShadow () * * Create a one-pixel thick bottom shadow segment between two points. ***********************************************************************/ static void CreateBottomShadow( #if NeedWidePrototypes int start_x, int end_x, #else Position start_x, Position end_x, #endif /* NeedWidePrototypes */ XmRegionBox *here, unsigned long mask, XSegment **segml, int *segmc, int *segmi ) { if (*segmi >= *segmc) { *segml = (XSegment *) XtRealloc ((char *)(*segml), (Cardinal) ((sizeof(XSegment) << 1) * (*segmc))); if (*segml == NULL) { XmeWarning(NULL, MESSAGE1); *segmi = *segmc = 0; return; } *segmc *= 2; } if (!(mask & BL_OPEN)) { start_x++; } if (start_x <= end_x) { (*segml)[*segmi].y1 = (*segml)[*segmi].y2 = here->y2; (*segml)[*segmi].x1 = start_x; (*segml)[*segmi].x2 = end_x; (*segmi)++; } } /************************************************************************ * * _XmRegionDrawShadow () * * Shadows or highlights a possibly nonrectangular XmRegion. * This is done in multiple steps: * * 1. Remove any border region specified by a nonzero border_thick * parameter by shrinking the XmRegion() by that amount in both width * and height. * * 2. Create the shadow segment list by iteratively shadowing the XmRegion * one pixel thick, then shrinking the XmRegion by one pixel in both * width and height, until the shadow of specified thickness is * obtained. Each iteration scans the XmRegion's XY-banded rectangle * list to determine where left, right, top, and bottom shadows should * be drawn. The number and characteristics of these shadows * depend upon how the XY-banded rectangles overlap. * * This algorithm will usually correctly shadow detail finer than twice * the shadow thickness. The reason why it does not always work as one * might expect is that the ShrinkRegion() algorithm will drop XY-banded * rectangles when they become one pixel wide or high, and in some cases * the resulting shadow has "holes". This can be seen in shadowed * regions having curves not aligned horizontally or vertically. * * To draw a highlight, use the same highlight GC as both top_gc and * bottom_gc and specify border_thick equal to the XmRegion's * borderWidth. * * To draw a shadow, use appropraite top_gc and bottom_gc and specify * border_thick equal to the sum of the XmRegion's borderWidth and * highlightThickness. * ***********************************************************************/ void _XmRegionDrawShadow( Display *display, Drawable d, GC top_gc, GC bottom_gc, XmRegion region, #if NeedWidePrototypes int border_thick, int shadow_thick, #else Dimension border_thick, Dimension shadow_thick, #endif /* NeedWidePrototypes */ unsigned int shadow_type ) { XmRegion workReg; XmRegion scReg1, scReg2; XSegment *topSegms; int topSegmCount; int curTopSeg; XSegment *botSegms; int botSegmCount; int curBotSeg; register XmRegionBox *above, *here, *below; register XmRegionBox *end_above, *end_here, *end_below; XmRegionBox *end_all; unsigned long mask; Position x1, x2, y; Position start_x, end_x; Boolean draw; GC tmp_gc; XmRegionBox *rects; long nrects = region->numRects; int min_y, i ; if (!d || ISEMPTY(region) || !shadow_thick) { return; } if (shadow_type == XmSHADOW_IN) { tmp_gc = top_gc ; top_gc = bottom_gc ; /* switch top and bottom shadows */ bottom_gc = tmp_gc ; } /* * Create scratch regions and segment arrays. */ if (!(scReg1 = _XmRegionCreate())) { XmeWarning(NULL, MESSAGE1); return; } if (!(scReg2 = _XmRegionCreate())) { XmeWarning(NULL, MESSAGE1); _XmRegionDestroy (scReg1); return; } if (!(workReg = _XmRegionCreateSize (nrects))) { XmeWarning(NULL, MESSAGE1); _XmRegionDestroy (scReg2); _XmRegionDestroy (scReg1); return; } miRegionCopy (workReg, region); /* Currently this code crashes when given negative y and some big thickness. (it crashes below, the line that accesses 'above' in: while (above < end_above && above->x2 <= x1) { ... The reason is not currently understood and in the mean time, we patch it so that negative y are not present in the region. Just before drawing the segments, at the end of this function, we reincorpate this negative offset. min_y is used as both flag and offset value . CR 9141 */ for (i = 0, min_y = 0 ; i < nrects; i++) { min_y = MIN(min_y, workReg->rects[i].y1); min_y = MIN(min_y, workReg->rects[i].y2); } if (min_y < 0) { for (i = 0 ; i < nrects; i++) { workReg->rects[i].y1 += -min_y; workReg->rects[i].y2 += -min_y; } } topSegmCount = botSegmCount = (int) (nrects * shadow_thick << 1); if (!(topSegms = (XSegment *) XtMalloc(sizeof (XSegment) * topSegmCount))) { XmeWarning(NULL, MESSAGE1); _XmRegionDestroy (workReg); _XmRegionDestroy (scReg2); _XmRegionDestroy (scReg1); return; } if (!(botSegms = (XSegment *) XtMalloc(sizeof (XSegment) * botSegmCount))) { XmeWarning(NULL, MESSAGE1); XtFree((char *) topSegms); _XmRegionDestroy (workReg); _XmRegionDestroy (scReg2); _XmRegionDestroy (scReg1); return; } curTopSeg = curBotSeg = 0; /* * Remove the border from workReg. */ if (workReg->numRects && border_thick) { ShrinkRegion (workReg, scReg1, scReg2, border_thick, border_thick); } /* * Draw the shadows one pixel wide at a time. */ while ((nrects = workReg->numRects) && shadow_thick) { /* * Set up the initial banded rectangle pointers. */ rects = workReg->rects; end_all = &rects[nrects]; end_above = NULL; end_below = here = end_here = rects; while (end_below != end_all && end_below->y1 == end_here->y1) { end_below++; } y = -1; /* * Scan through the bands */ while (end_here != end_all) { /* * Shift down one band. * valid: y, end_above, here, end_here, end_below, end_all */ above = end_above; /* in case not there yet */ below = end_below; /* in case not there yet */ end_above = end_here; if (end_here->y1 != y) { /* gap between bands */ above = end_above; } y = here->y2; end_here = end_below; while (end_below != end_all && end_below->y1 == end_here->y1) { end_below++; } if ((end_here == end_all) || (end_here->y1 != y)) { /* gap */ below = end_below; } /* * Process this band. */ while (here < end_here) { x1 = here->x1; x2 = here->x2; mask = 0; /* * Determine the left shadow. */ while (above < end_above && above->x2 <= x1) { above++; } while (below < end_below && below->x2 <= x1) { below++; } if (above < end_above && above->x1 < x1) { mask |= TL_OPEN; } else if (above < end_above && above->x1 == x1) { mask |= TL_MATCH; } if (below < end_below && below->x1 < x1) { mask |= BL_OPEN; } else if (below < end_below && below->x1 == x1) { mask |= BL_MATCH; } CreateLeftShadow (here, mask, &topSegms, &topSegmCount, &curTopSeg); /* * Determine the top shadow(s). */ if (mask & (TL_OPEN | TL_MATCH)) { draw = False; } else { draw = True; } start_x = x1; while (above < end_above && above->x2 < x2) { if (draw) { CreateTopShadow (start_x, above->x1, here, mask | TR_OPEN, &topSegms, &topSegmCount, &curTopSeg); } mask &= ~TL_MATCH; mask |= TL_OPEN; draw = True; start_x = above->x2; above++; } if (above < end_above && above->x2 == x2) { if (draw) { CreateTopShadow (start_x, above->x1, here, mask | TR_OPEN, &topSegms, &topSegmCount, &curTopSeg); } mask |= TR_MATCH; above++; } else { if (above < end_above && above->x1 < x2) { mask |= TR_OPEN; end_x = above->x1; } else { end_x = x2; } if (draw) { CreateTopShadow (start_x, end_x, here, mask, &topSegms, &topSegmCount, &curTopSeg); } } /* * Determine the bottom shadow(s). */ if (mask & (BL_OPEN | BL_MATCH)) { draw = False; } else { draw = True; } start_x = x1; while (below < end_below && below->x2 < x2) { if (draw) { CreateBottomShadow (start_x, below->x1, here, mask | BR_OPEN, &botSegms, &botSegmCount, &curBotSeg); } mask &= ~BL_MATCH; mask |= BL_OPEN; draw = True; start_x = below->x2; below++; } if (below < end_below && below->x2 == x2) { if (draw) { CreateBottomShadow (start_x, below->x1, here, mask | BR_OPEN, &botSegms, &botSegmCount, &curBotSeg); } mask |= BR_MATCH; below++; } else { if (below < end_below && below->x1 < x2) { mask |= BR_OPEN; end_x = below->x1; } else { end_x = x2; } if (draw) { CreateBottomShadow (start_x, end_x, here, mask, &botSegms, &botSegmCount, &curBotSeg); } } /* * Determine the right shadow. */ CreateRightShadow (here, mask, &botSegms, &botSegmCount, &curBotSeg); here++; } } ShrinkRegion (workReg, scReg1, scReg2, 1, 1); shadow_thick--; } /* * Draw the segments. */ /* reincorporate the negative offset taken away one page up. CR 9141 */ if (min_y < 0) { for (i = 0 ; i < curTopSeg; i++) { topSegms[i].y1 += min_y; topSegms[i].y2 += min_y; } for (i = 0 ; i < curBotSeg; i++) { botSegms[i].y1 += min_y; botSegms[i].y2 += min_y; } } XDrawSegments (display, d, top_gc, topSegms, curTopSeg); XDrawSegments (display, d, bottom_gc, botSegms, curBotSeg); XtFree((char *) botSegms); XtFree((char *) topSegms); _XmRegionDestroy (workReg); _XmRegionDestroy (scReg2); _XmRegionDestroy (scReg1); } /* * _XmRegionFromImage: * This function was ported from the X server ddx driver code in the * mfb subsection. It is a port of the function mfbPixmapToRegion() * in mfbclip.c. The function takes an image and converts the image * into an XmRegion. */ XmRegion _XmRegionFromImage( XImage *image) { register XmRegion pReg; register int width, x1, x2, y1, crects; int irectPrevStart, irectLineStart; register XmRegionBox *prectO, *prectN; XmRegionBox *FirstRect, *rects, *prectLineStart; Bool fInBox, fSame; pReg = (XmRegion) XCreateRegion(); if(!pReg) return NULL; FirstRect = REGION_BOXPTR(pReg); rects = FirstRect; width = image->width; pReg->extents.x1 = width - 1; pReg->extents.x2 = 0; irectPrevStart = -1; x1 = 0; fInBox = False; for(y1 = 0; y1 < image->height; y1++) { irectLineStart = rects - FirstRect; /* If the Screen left most bit of the word is set, we're starting in * a box */ for (x2 = 0; x2 < width; x2++) { if (XGetPixel(image, x2, y1)) { if(!fInBox) { x1 = x2; /* start new box */ fInBox = TRUE; } } else { if(fInBox) { /* end box */ ADDRECT(pReg, rects, FirstRect, x1, y1, x2, y1 + 1); fInBox = FALSE; } } } /* If scanline ended with last bit set, end the box */ if (fInBox) { ADDRECT(pReg, rects, FirstRect, x1, y1, x2, y1 + 1); } /* if all rectangles on this line have the same x-coords as * those on the previous line, then add 1 to all the previous y2s and * throw away all the rectangles from this line */ fSame = FALSE; if (irectPrevStart != -1) { crects = irectLineStart - irectPrevStart; if(crects == ((rects - FirstRect) - irectLineStart)) { prectO = FirstRect + irectPrevStart; prectN = prectLineStart = FirstRect + irectLineStart; fSame = TRUE; while (prectO < prectLineStart) { if((prectO->x1 != prectN->x1) || (prectO->x2 != prectN->x2)) { fSame = FALSE; break; } prectO++; prectN++; } if (fSame) { prectO = FirstRect + irectPrevStart; while (prectO < prectLineStart) { prectO->y2 += 1; prectO++; } rects -= crects; pReg->numRects -= crects; } } } if (!fSame) irectPrevStart = irectLineStart; } return(pReg); } motif-2.3.8/lib/Xm/LabelGP.h0000644000175000017500000003102213145162623012335 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmLabelGP_h #define _XmLabelGP_h #include #include #include #include #ifdef __cplusplus extern "C" { #endif /*************************************************************/ /* The Label Gadget Cache Object's class and instance records*/ /*************************************************************/ /* Enumerations for fill_bg_box. */ enum { _XmPLAIN_BG_BOX, _XmFILL_BG_BOX, _XmALWAYS_FILL_BG_BOX }; typedef struct _XmLabelGCacheObjClassPart { int foo; } XmLabelGCacheObjClassPart; typedef struct _XmLabelGCacheObjClassRec /* label cache class record */ { ObjectClassPart object_class; XmExtClassPart ext_class; XmLabelGCacheObjClassPart label_class_cache; } XmLabelGCacheObjClassRec; externalref XmLabelGCacheObjClassRec xmLabelGCacheObjClassRec; /* The Label Gadget Cache instance record */ typedef struct _XmLabelGCacheObjPart { unsigned char label_type; unsigned char alignment; unsigned char string_direction; Dimension margin_height; /* margin around widget */ Dimension margin_width; Dimension margin_left; /* additional margins on */ Dimension margin_right; /* each side of widget */ Dimension margin_top; /* text (or pixmap) is placed */ Dimension margin_bottom; /* inside the margins */ Boolean recompute_size; Boolean skipCallback; /* set by RowColumn with entryCallback */ unsigned char menu_type; /* * Following are color resources and instance variables for Gadgets. * Because of problems involving the history of the gadget cache these * variables appear here rather than in XmGadget. * * XmArrowButtonGadget and XmSeparatorGadget have effectively the same * set of color resources implemented for each. * * XmLabelGadget does not use all of these variables (e.g top_shadow_color). * It initializes them and maintains them but does not use all of them * to render the label gadget. They are here for use by subclasses. * * Sterling Barrett * sterling@ics.com */ GC background_GC; GC top_shadow_GC; GC bottom_shadow_GC; GC highlight_GC; Pixel foreground; Pixel background; Pixel top_shadow_color; Pixmap top_shadow_pixmap; Pixel bottom_shadow_color; Pixmap bottom_shadow_pixmap; Pixel highlight_color; Pixmap highlight_pixmap; } XmLabelGCacheObjPart; typedef struct _XmLabelGCacheObjRec { ObjectPart object; XmExtPart ext; XmLabelGCacheObjPart label_cache; } XmLabelGCacheObjRec; /* The Label Widget Class and instance records */ /*************************************************/ typedef struct _XmLabelGadgetClassPart /* label class record */ { XtWidgetProc setOverrideCallback; XmMenuProc menuProcs; XtPointer extension; } XmLabelGadgetClassPart; typedef struct _XmLabelGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmLabelGadgetClassPart label_class; } XmLabelGadgetClassRec; externalref XmLabelGadgetClassRec xmLabelGadgetClassRec; typedef struct _XmLabelGadgetPart { _XmString _label; /* String sent to this widget */ _XmString _acc_text; KeySym mnemonic; XmStringCharSet mnemonicCharset; char *accelerator; XmFontList font; Pixmap pixmap; Pixmap pixmap_insen; /* PRIVATE members -- values computed by LabelWidgetClass methods */ GC normal_GC; /* GC for text */ GC insensitive_GC; XRectangle TextRect; /* The bounding box of the text or clip */ XRectangle acc_TextRect; /* rectangle of the window; whichever is smaller */ XmLabelGCacheObjPart *cache; Dimension acc_left_delta; /* Amount we increased the margins */ Dimension acc_right_delta; /* to accomodate accelerator text */ Dimension * baselines; /* Cached baseline information. */ XtEnum fill_bg_box; /* Computed by LabelGadget or */ /* pinned by subclasses. */ Boolean check_set_render_table; XmPixmapPlacement pixmap_placement; /* Where to place the icon label. */ Dimension pixmap_text_padding; /* padding between the icon and the text. */ XRectangle PixmapRect; /* The bounding box of the pixmap in TextRect */ XRectangle StringRect; /* The bounding box of the string in TextRect */ #ifdef FIX_1381 GC shadow_GC; #endif } XmLabelGadgetPart; typedef struct _XmLabelGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmLabelGadgetPart label; } XmLabelGadgetRec; typedef struct _LRectangle { int x, y; int width, height; } LRectangle; /* Inherited Functions exported by label */ #define XmInheritSetOverrideCallback ((XtWidgetProc) _XtInherit) #define XmInheritResize ((XtWidgetProc) _XtInherit) #define INVALID_PIXEL ((Pixel) -1) #define INVALID_PIXMAP ((Pixmap) -1) /* Padding between label text and accelerator text */ #define LABELG_ACC_PAD 15 /* MACROS */ /******** * Macros for cached instance fields */ #define LabG_LabelType(w) (((XmLabelGadget)(w)) -> \ label.cache-> label_type) #define LabG_Alignment(w) (((XmLabelGadget)(w)) -> \ label.cache-> alignment) #define LabG_StringDirection(w) (((XmLabelGadget)(w)) -> \ label.cache-> string_direction) #define LabG_MarginHeight(w) (((XmLabelGadget)(w)) -> \ label.cache-> margin_height) #define LabG_MarginWidth(w) (((XmLabelGadget)(w)) -> \ label.cache-> margin_width) #define LabG_MarginLeft(w) (((XmLabelGadget)(w)) -> \ label.cache-> margin_left) #define LabG_MarginRight(w) (((XmLabelGadget)(w)) -> \ label.cache-> margin_right) #define LabG_MarginTop(w) (((XmLabelGadget)(w)) -> \ label.cache-> margin_top) #define LabG_MarginBottom(w) (((XmLabelGadget)(w)) -> \ label.cache-> margin_bottom) #define LabG_RecomputeSize(w) (((XmLabelGadget)(w)) -> \ label.cache-> recompute_size) #define LabG_SkipCallback(w) (((XmLabelGadget)(w)) -> \ label.cache-> skipCallback) #define LabG_MenuType(w) (((XmLabelGadget)(w)) -> \ label.cache-> menu_type) #define LabG_BackgroundGC(w) (((XmLabelGadget)(w)) -> \ label.cache-> background_GC) #define LabG_TopShadowGC(w) (((XmLabelGadget)(w)) -> \ label.cache-> top_shadow_GC) #define LabG_BottomShadowGC(w) (((XmLabelGadget)(w)) -> \ label.cache-> bottom_shadow_GC) #define LabG_HighlightGC(w) (((XmLabelGadget)(w)) -> \ label.cache-> highlight_GC) #define LabG_Foreground(w) (((XmLabelGadget)(w)) -> \ label.cache-> foreground) #define LabG_Background(w) (((XmLabelGadget)(w)) -> \ label.cache-> background) #define LabG_TopShadowColor(w) (((XmLabelGadget)(w)) -> \ label.cache-> top_shadow_color) #define LabG_TopShadowPixmap(w) (((XmLabelGadget)(w)) -> \ label.cache-> top_shadow_pixmap) #define LabG_BottomShadowColor(w) (((XmLabelGadget)(w)) -> \ label.cache-> bottom_shadow_color) #define LabG_BottomShadowPixmap(w) (((XmLabelGadget)(w)) -> \ label.cache-> bottom_shadow_pixmap) #define LabG_HighlightColor(w) (((XmLabelGadget)(w)) -> \ label.cache-> highlight_color) #define LabG_HighlightPixmap(w) (((XmLabelGadget)(w)) -> \ label.cache-> highlight_pixmap) /******** * Macros for UNcached instance fields */ #define LabG__label(w) (((XmLabelGadget)(w)) -> \ label._label) #define LabG__acceleratorText(w) (((XmLabelGadget)(w)) -> \ label._acc_text) #define LabG_Font(w) (((XmLabelGadget)(w)) -> \ label.font) #define LabG_Mnemonic(w) (((XmLabelGadget)(w)) -> \ label.mnemonic) #define LabG_MnemonicCharset(w) (((XmLabelGadget)(w)) -> \ label.mnemonicCharset) #define LabG_Accelerator(w) (((XmLabelGadget)(w)) -> \ label.accelerator) #define LabG_Pixmap(w) (((XmLabelGadget)(w)) -> \ label.pixmap) #define LabG_PixmapInsensitive(w) (((XmLabelGadget)(w)) -> \ label.pixmap_insen) #define LabG_NormalGC(w) (((XmLabelGadget)(w)) -> \ label.normal_GC) #define LabG_InsensitiveGC(w) (((XmLabelGadget)(w)) -> \ label.insensitive_GC) #ifdef FIX_1381 #define LabG_ShadowGC(w) (((XmLabelGadget)(w)) -> \ label.shadow_GC) #endif #define LabG_TextRect(w) (((XmLabelGadget)(w)) -> \ label.TextRect) #define LabG_AccTextRect(w) (((XmLabelGadget)(w)) -> \ label.acc_TextRect) #define LabG_PixmapRect(w) (((XmLabelGadget)(w)) -> \ label.PixmapRect) #define LabG_StringRect(w) (((XmLabelGadget)(w)) -> \ label.StringRect) #define LabG_PixmapPlacement(w) (((XmLabelGadget)(w)) -> \ label.pixmap_placement) #define LabG_PixmapTextPadding(w) (((XmLabelGadget)(w)) -> \ label.pixmap_text_padding) /******** * Convenience Macros */ #define LabG_TextRect_x(w) (LabG_TextRect(w).x) #define LabG_TextRect_y(w) (LabG_TextRect(w).y) #define LabG_TextRect_width(w) (LabG_TextRect(w).width) #define LabG_TextRect_height(w) (LabG_TextRect(w).height) #define LabG_IsText(w) (LabG_LabelType(w) == XmSTRING) #define LabG_IsPixmap(w) (LabG_LabelType(w) == XmPIXMAP) #define LabG_IsPixmapAndText(w) (LabG_LabelType(w) == \ XmPIXMAP_AND_STRING) #define LabG_Cache(w) (((XmLabelGadget)(w))-> \ label.cache) #define LabG_Shadow(w) (((XmLabelGadget)(w))->gadget.shadow_thickness) #define LabG_Highlight(w) (((XmLabelGadget)(w))->gadget.highlight_thickness) #define LabG_Baseline(w) (_XmStringBaseline ((LabG_Font(w)), (LabG__Label(w)))) #define LabG_ClassCachePart(w) \ (((XmLabelGadgetClass)xmLabelGadgetClass)->gadget_class.cache_part) #define LabG_IsMenupane(w) ((LabG_MenuType(w) == XmMENU_POPUP) || \ (LabG_MenuType(w) == XmMENU_PULLDOWN)) #define _XmAssignLabG_MarginHeight_r(cache, val) \ cache->margin_height = val #define _XmAssignLabG_MarginWidth_r(cache, val) \ cache->margin_width = val #define _XmAssignLabG_MarginLeft_r(cache, val) \ cache->margin_left = val #define _XmAssignLabG_MarginRight_r(cache, val) \ cache->margin_right = val #define _XmAssignLabG_MarginTop_r(cache, val) \ cache->margin_top = val #define _XmAssignLabG_MarginBottom_r(cache, val) \ cache->margin_bottom = val extern void _XmQualifyLabelLocalCache(XmLabelGCacheObjPart *, XmLabelGadget); extern void _XmReCacheLabG_r(XmLabelGCacheObjPart *, XmLabelGadget); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmLabelGP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragICC.c0000644000175000017500000012717113145162623012271 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DragICC.c /main/14 1997/06/18 17:38:07 samborn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "DisplayI.h" #include "DragBSI.h" #include "DragICCI.h" #include "MessagesI.h" #include "RegionI.h" #include "XmI.h" #ifdef DEBUG #include /* for printf() */ #endif /* DEBUG */ #define MESSAGE1 _XmMMsgDragICC_0000 #define MESSAGE2 _XmMMsgDragICC_0001 #define BUFFER_DATA 0 #define BUFFER_HEAP 1 #define NUM_HEADER_ARGS 0 #define MAXSTACK 1000 /* * We assume that there are only 64 possible messageTypes for each * clientMessage type that we use. This allows us to only eat up a * single byte in the data area of the event. The following tables * and routines are used to map back and forth between the client * message and the callback reasons */ typedef struct _ReasonTable { int reason; unsigned char messageType; } ReasonTable; /*************************************************************** For improving response time in a Drag operation, OSF/Motif allows clients to cache frequently needed data on window properties to reduce roundtrip X server requests. The data is stored on window properties of the motifDragWindow, a persistent, override-redirect, InputOnly child window of the display's default root window. A client looks for the motifDragWindow id on the "_MOTIF_DRAG_WINDOW" property of the display's default root window. If the window id is NULL or invalid, a client may create the motifDragWindow. The motifDragWindow is mapped but is not visible on the screen. Three sets of data are stored on motifDragWindow properties: 1. a list of atom names/value pairs, 2. an atom table, and 3. a targets list table. The "_MOTIF_DRAG_ATOM_PAIRS" property contains a list of atoms name/value pairs from the "_MOTIF_DRAG_ATOM_PAIRS" property on motifDragWindow. If the property does not exist on motifDragWindow, a client may create the list of atom name/value pairs and store it on the property. The list created by the OSF/Motif toolkit includes most of the atoms used by Xm. If a client finds the "_MOTIF_DRAG_ATOM_PAIRS" property, it may read that property and cache the atoms, avoiding multiple roundtrip server requests to intern the atoms itself. The "_MOTIF_DRAG_ATOMS" property on motifDragWindow contains an atoms table, consisting of pairs of atoms and timestamps. The atoms have been interned once and are available for clients to use without repeated roundtrip server requests to intern them. A timestamp of 0 indicates that the atom is available. A nonzero timestamp indicates when the atom was last allocated to a client. The OSF/Motif toolkit initializes this property to contains only atom "_MOTIF_ATOM_0" with timestamp 0. A client requests an atom by trying to find an available atom in the table. If it succeeds it sets the atom's timestamp to the value specified and returns the atom. If no atom is available, a client may add an atom to the table with the specified timestamp, updates the "_MOTIF_DRAG_ATOMS" property on motifDragWindow, and use the new atom. These new atoms are named "_MOTIF_ATOM_n" where n is 1, 2, 3, etc. The "_MOTIF_DRAG_TARGETS" property on motifDragWindow contains a targets table, consisting of a sequence of target lists to be shared among clients. In other words, this property is a list of lists. These target lists are sorted into ascending order to avoid permutations. By sharing the targets table, clients may pass target lists between themselves by exchanging only the corresponding target list index in the protocol messages. The targets table on the "_MOTIF_DRAG_TARGETS" property initially contain only two lists: { 0, }, and { XA_STRING, } To add a target list to the table, a client must first sorts the target list into ascending order, then search the targets table for a match. If it finds a match, it may use the index of the matching targets table entry in the drag protocol. Otherwise, it adds the sorted target list to the table, updates the "_MOTIF_DRAG_TARGETS" property on motifDragWindow, and uses the index of the new targets table entry. ******************************************************************/ /******** Static Function Declarations ********/ static XmICCEventType GetMessageData( Display *display, xmICCMessageStruct *xmessage, XmICCCallbackStruct *callback) ; static void SwapMessageData( xmICCMessageStruct *xmessage) ; #ifdef DEBUG static void PrintMessage(char, xmICCMessageStruct *); #endif /* DEBUG */ /******** End Static Function Declarations ********/ externaldef(dragicc) unsigned char _XmByteOrderChar = (char) 0; static XmConst ReasonTable reasonTable[] = { { XmCR_TOP_LEVEL_ENTER, XmTOP_LEVEL_ENTER }, { XmCR_TOP_LEVEL_LEAVE, XmTOP_LEVEL_LEAVE }, { XmCR_DRAG_MOTION, XmDRAG_MOTION }, { XmCR_DROP_SITE_ENTER, XmDROP_SITE_ENTER }, { XmCR_DROP_SITE_LEAVE, XmDROP_SITE_LEAVE }, { XmCR_DROP_START, XmDROP_START }, { XmCR_DROP_FINISH, XmDROP_FINISH }, { XmCR_DRAG_DROP_FINISH, XmDRAG_DROP_FINISH }, { XmCR_OPERATION_CHANGED, XmOPERATION_CHANGED }, }; static XmConst int messageTable[] = { XmCR_TOP_LEVEL_ENTER, /* XmTOP_LEVEL_ENTER 0 */ XmCR_TOP_LEVEL_LEAVE, /* XmTOP_LEVEL_LEAVE 1 */ XmCR_DRAG_MOTION, /* XmDRAG_MOTION 2 */ XmCR_DROP_SITE_ENTER, /* XmDROP_SITE_ENTER 3 */ XmCR_DROP_SITE_LEAVE, /* XmDROP_SITE_LEAVE 4 */ XmCR_DROP_START, /* XmDROP_START 5 */ XmCR_DROP_FINISH, /* XmDROP_FINISH 6 */ XmCR_DRAG_DROP_FINISH, /* XmDRAG_DROP_FINISH 7 */ XmCR_OPERATION_CHANGED, /* XmOPERATION_CHANGED 8 */ }; /************************************************************************ * * _XmReasonToMessageType() * ***********************************************************************/ unsigned char _XmReasonToMessageType( int reason ) { int i; for (i = 0; i < XtNumber(reasonTable); i++) if (reasonTable[i].reason == reason) return((unsigned char)i); return 0xFF; } /************************************************************************ * * _XmMessageTypeToReason() * ***********************************************************************/ unsigned int _XmMessageTypeToReason( #if NeedWidePrototypes unsigned int messageType ) #else unsigned char messageType ) #endif /* NeedWidePrototypes */ { return(messageTable[messageType]); } /************************************************************************ * * _XmICCCallbackToICCEvent() * * Reformat a motif callback into a client message ***********************************************************************/ void _XmICCCallbackToICCEvent( Display *display, Window window, XmICCCallback callback, XClientMessageEvent *cmev, XmICCEventType type ) { xmICCMessageStruct *xmessage = (xmICCMessage)&cmev->data.b[0]; cmev->display = display; cmev->type = ClientMessage; cmev->serial = LastKnownRequestProcessed(display); cmev->send_event = True; cmev->window = window; cmev->format = 8; cmev->message_type = XInternAtom(display, _Xm_MOTIF_DRAG_AND_DROP_MESSAGE, False); xmessage->any.byte_order = (BYTE) _XmByteOrderChar; xmessage->any.message_type = (BYTE) _XmReasonToMessageType(callback->any.reason); switch (callback->any.reason) { case XmCR_TOP_LEVEL_ENTER: /* * this message goes to receiver */ { register XmTopLevelEnterCallback cb = (XmTopLevelEnterCallback)callback; xmessage->topLevelEnter.flags = 0; xmessage->topLevelEnter.time = cb->timeStamp; xmessage->topLevelEnter.src_window = cb->window; xmessage->topLevelEnter.icc_handle = cb->iccHandle; /* load has_drop_sites */ } break; case XmCR_TOP_LEVEL_LEAVE: /* * this message goes to receiver */ { register XmTopLevelLeaveCallback cb = (XmTopLevelLeaveCallback)callback; xmessage->topLevelLeave.flags = 0; xmessage->topLevelLeave.time = cb->timeStamp; xmessage->topLevelLeave.src_window = cb->window; } break; case XmCR_DRAG_MOTION: /* * this message goes both ways */ { register XmDragMotionCallback cb = (XmDragMotionCallback)callback; xmessage->dragMotion.flags = 0; xmessage->dragMotion.flags |= PUT_SITE_STATUS(cb->dropSiteStatus); xmessage->dragMotion.flags |= PUT_OPERATION(cb->operation); xmessage->dragMotion.flags |= PUT_MULTIOPS(cb->operations); xmessage->dragMotion.time = cb->timeStamp; xmessage->dragMotion.x = cb->x; xmessage->dragMotion.y = cb->y; } break; case XmCR_OPERATION_CHANGED: /* * this message goes both ways */ { register XmOperationChangedCallback cb = (XmOperationChangedCallback)callback; xmessage->operationChanged.flags = 0; xmessage->operationChanged.flags |= PUT_OPERATION(cb->operation); xmessage->operationChanged.flags |= PUT_SITE_STATUS(cb->dropSiteStatus); xmessage->operationChanged.flags |= PUT_MULTIOPS(cb->operations); xmessage->operationChanged.time = cb->timeStamp; } break; case XmCR_DROP_SITE_ENTER: /* * this message goes to initiator */ { register XmDropSiteEnterCallback cb = (XmDropSiteEnterCallback)callback; /* invalid flags stuff ||| */ xmessage->dropSiteEnter.flags = 0; xmessage->dropSiteEnter.flags |= PUT_OPERATION(cb->operation); xmessage->dropSiteEnter.flags |= PUT_MULTIOPS(cb->operations); xmessage->dropSiteEnter.flags |= PUT_SITE_STATUS(cb->dropSiteStatus); xmessage->dropSiteEnter.time = cb->timeStamp; xmessage->dropSiteEnter.x = cb->x; xmessage->dropSiteEnter.y = cb->y; } break; case XmCR_DROP_SITE_LEAVE: /* * this message goes to initiator */ { register XmDropSiteLeaveCallback cb = (XmDropSiteLeaveCallback)callback; /* invalid flags stuff ||| */ xmessage->dropSiteLeave.flags = 0; xmessage->dropSiteLeave.time = cb->timeStamp; } break; case XmCR_DROP_START: /* * this message goes to receiver */ { register XmDropStartCallback cb = (XmDropStartCallback)callback; xmessage->drop.flags = 0; xmessage->drop.flags |= PUT_SITE_STATUS(cb->dropSiteStatus); xmessage->drop.flags |= PUT_COMPLETION(cb->dropAction); xmessage->drop.flags |= PUT_OPERATION(cb->operation); xmessage->drop.flags |= PUT_MULTIOPS(cb->operations); xmessage->drop.time = cb->timeStamp; xmessage->drop.x = cb->x; xmessage->drop.y = cb->y; xmessage->drop.icc_handle = cb->iccHandle; xmessage->drop.src_window = cb->window; } break; default: break; } #ifdef DEBUG /* Print message */ PrintMessage('S', xmessage); #endif /* DEBUG */ xmessage->any.message_type |= PUT_ICC_EVENT_TYPE(type); } /************************************************************************ * * _XmSendICCCallback() * ***********************************************************************/ void _XmSendICCCallback( Display *display, Window window, XmICCCallback callback, XmICCEventType type ) { XClientMessageEvent msgEvent; Window receiverWindow; XmDisplay dd = (XmDisplay) XmGetXmDisplay(display); _XmICCCallbackToICCEvent(display, window, callback, &msgEvent, type); /* Fix for 8746 */ if (((receiverWindow = dd->display.proxyWindow) == None) || (type == XmICC_RECEIVER_EVENT)) /* always ACK to the src win */ receiverWindow = window; XSendEvent(display, receiverWindow, False, 0, (XEvent *) &msgEvent); } /************************************************************************ * * GetMessageData() * * Message data has already been byte-swapped, if necessary. ***********************************************************************/ static XmICCEventType GetMessageData( Display *display, xmICCMessageStruct *xmessage, XmICCCallbackStruct *callback ) { XmICCEventType type; unsigned char message_type; message_type = xmessage->any.message_type; type = GET_ICC_EVENT_TYPE(message_type); message_type &= CLEAR_ICC_EVENT_TYPE; /* Load up the callback */ callback->any.reason = (int) _XmMessageTypeToReason(message_type); callback->any.event = NULL; callback->any.timeStamp = (Time) xmessage->any.time; switch(message_type) { case XmTOP_LEVEL_ENTER: { register XmTopLevelEnterCallback cb = (XmTopLevelEnterCallback)callback; cb->window = (Window) xmessage->topLevelEnter.src_window; cb->iccHandle = (Atom) xmessage->topLevelEnter.icc_handle; } break; case XmTOP_LEVEL_LEAVE: { register XmTopLevelLeaveCallback cb = (XmTopLevelLeaveCallback)callback; cb->window = (Window) xmessage->topLevelLeave.src_window; } break; case XmDRAG_MOTION: { register XmDragMotionCallback cb = (XmDragMotionCallback)callback; cb->x = (Position) cvtINT16toShort(xmessage->dragMotion.x); cb->y = (Position) cvtINT16toShort(xmessage->dragMotion.y); cb->operation = (unsigned char) GET_OPERATION(xmessage->dragMotion.flags); cb->operations = (unsigned char) GET_MULTIOPS(xmessage->dragMotion.flags); cb->dropSiteStatus = (unsigned char) GET_SITE_STATUS(xmessage->dragMotion.flags); } break; case XmOPERATION_CHANGED: { register XmOperationChangedCallback cb = (XmOperationChangedCallback)callback; cb->operation = (unsigned char) GET_OPERATION(xmessage->dragMotion.flags); cb->operations = (unsigned char) GET_MULTIOPS(xmessage->dragMotion.flags); cb->dropSiteStatus = (unsigned char) GET_SITE_STATUS(xmessage->dragMotion.flags); } break; case XmCR_DROP_SITE_ENTER: /* * this message goes to initiator */ { register XmDropSiteEnterCallback cb = (XmDropSiteEnterCallback)callback; cb->x = (Position) cvtINT16toShort(xmessage->dropSiteEnter.x); cb->y = (Position) cvtINT16toShort(xmessage->dropSiteEnter.y); cb->operation = (unsigned char) GET_OPERATION(xmessage->dropSiteEnter.flags); cb->operations = (unsigned char) GET_MULTIOPS(xmessage->dropSiteEnter.flags); cb->dropSiteStatus = (unsigned char) GET_SITE_STATUS(xmessage->dropSiteEnter.flags); } break; case XmCR_DROP_SITE_LEAVE: /* * this message goes to initiator */ break; case XmCR_DROP_START: /* * this message goes to receiver */ { register XmDropStartCallback cb = (XmDropStartCallback)callback; cb->operation = (unsigned char) GET_OPERATION(xmessage->drop.flags); cb->operations = (unsigned char) GET_MULTIOPS(xmessage->drop.flags); cb->dropAction = (unsigned char) GET_COMPLETION(xmessage->drop.flags); cb->dropSiteStatus = (unsigned char) GET_SITE_STATUS(xmessage->drop.flags); cb->x = (Position) cvtINT16toShort(xmessage->drop.x); cb->y = (Position) cvtINT16toShort(xmessage->drop.y); cb->iccHandle = (Atom) xmessage->drop.icc_handle; cb->window = (Window) xmessage->drop.src_window; } break; default: XmeWarning ((Widget) XmGetXmDisplay (display), MESSAGE1); break; } return(type); } /************************************************************************ * * SwapMessageData() * ***********************************************************************/ static void SwapMessageData( xmICCMessageStruct *xmessage ) { swap2bytes(xmessage->any.flags); swap4bytes(xmessage->any.time); switch(xmessage->any.message_type) { case XmTOP_LEVEL_ENTER: { swap4bytes(xmessage->topLevelEnter.src_window); swap4bytes(xmessage->topLevelEnter.icc_handle); } break; case XmTOP_LEVEL_LEAVE: { swap4bytes(xmessage->topLevelLeave.src_window); } break; case XmDRAG_MOTION: { swap2bytes(xmessage->dragMotion.x); swap2bytes(xmessage->dragMotion.y); } break; case XmDROP_SITE_ENTER: { swap2bytes(xmessage->dropSiteEnter.x); swap2bytes(xmessage->dropSiteEnter.y); } break; case XmDROP_START: { swap2bytes(xmessage->drop.x); swap2bytes(xmessage->drop.y); swap4bytes(xmessage->drop.icc_handle); swap4bytes(xmessage->drop.src_window); } break; case XmDROP_SITE_LEAVE: default: break; } } /************************************************************************ * * _XmICCEventToICCCallback() * ***********************************************************************/ Boolean _XmICCEventToICCCallback( XClientMessageEvent *msgEv, XmICCCallback callback, XmICCEventType type ) { Atom motif_dnd_message_atom; xmICCMessage xmessage; if ((msgEv->type != ClientMessage) || (msgEv->format != 8)) return (False); motif_dnd_message_atom = XInternAtom(msgEv->display, _Xm_MOTIF_DRAG_AND_DROP_MESSAGE, False); if (msgEv->message_type != motif_dnd_message_atom) return (False); xmessage = (xmICCMessage)&msgEv->data.b[0]; if (xmessage->any.byte_order != _XmByteOrderChar) { /* * swap it inplace and update the byte_order field so no one * else will try to reswap it. This could happen since we're * probably being called out of an event Handler on a list */ SwapMessageData(xmessage); xmessage->any.byte_order = _XmByteOrderChar; } #ifdef DEBUG /* Print data */ PrintMessage('R', xmessage); #endif /* DEBUG */ if (type == GetMessageData(msgEv->display, xmessage, callback)) return(True); else return(False); } /************************************************************************ * * _XmReadDragBuffer() * ***********************************************************************/ CARD16 _XmReadDragBuffer( xmPropertyBuffer propBuf, #if NeedWidePrototypes int which, #else BYTE which, #endif /* NeedWidePrototypes */ BYTE *ptr, CARD32 size ) { xmByteBufRec *buf; CARD32 numCurr; if (which == BUFFER_DATA) /* data */ buf = &propBuf->data; else buf = &propBuf->heap; numCurr = buf->curr - buf->bytes; if (numCurr + size > buf->size) { size = buf->size - numCurr; } memcpy(ptr, buf->curr, (size_t)size); buf->curr += size; return size; } /************************************************************************ * * _XmWriteDragBuffer() * ***********************************************************************/ CARD16 _XmWriteDragBuffer( xmPropertyBuffer propBuf, #if NeedWidePrototypes int which, #else BYTE which, #endif /* NeedWidePrototypes */ BYTE *ptr, CARD32 size ) { CARD16 returnVal; xmByteBufRec *buf; if (which == BUFFER_DATA) /* data */ buf = &propBuf->data; else buf = &propBuf->heap; if (buf->size + size > buf->max) { buf->max += 1000; if (buf->bytes == buf->stack) { buf->bytes = (BYTE*)XtMalloc(buf->max); memcpy(buf->bytes, buf->stack, buf->size); } else { buf->bytes = (BYTE*)XtRealloc((char *)buf->bytes, (Cardinal)buf->max); } } memcpy(buf->bytes + buf->size, ptr, (size_t)size); returnVal = buf->size; buf->size += (size_t) size; return returnVal; } /************************************************************************ * * _XmWriteInitiatorInfo() * ***********************************************************************/ void _XmWriteInitiatorInfo( Widget dc ) { xmDragInitiatorInfoStruct infoRec; Atom initiatorAtom; int i = 0; Window srcWindow; Arg args[8]; XmDisplay xmDisplay = (XmDisplay)XtParent(dc); Atom *exportTargets; Cardinal numExportTargets; Atom iccHandle; XtSetArg(args[i], XmNexportTargets, &exportTargets);i++; XtSetArg(args[i], XmNnumExportTargets, &numExportTargets);i++; XtSetArg(args[i], XmNsourceWindow, &srcWindow);i++; XtSetArg(args[i], XmNiccHandle, &iccHandle);i++; XtGetValues(dc, args, i); infoRec.byte_order = _XmByteOrderChar; infoRec.protocol_version = _MOTIF_DRAG_PROTOCOL_VERSION; infoRec.targets_index = _XmTargetsToIndex((Widget)xmDisplay, exportTargets, numExportTargets); infoRec.icc_handle = iccHandle; initiatorAtom = XInternAtom(XtDisplayOfObject(dc), XmI_MOTIF_DRAG_INITIATOR_INFO, False); /* write the buffer to the property */ XChangeProperty (XtDisplayOfObject(dc), srcWindow, iccHandle, initiatorAtom, 8, PropModeReplace, (unsigned char *)&infoRec, sizeof(xmDragInitiatorInfoStruct)); } /************************************************************************ * * _XmReadInitiatorInfo() * * We assume that the dc has been initialized enough to have it's * source window field set. ***********************************************************************/ void _XmReadInitiatorInfo( Widget dc ) { xmDragInitiatorInfoStruct *info = NULL ; Atom initiatorAtom; int format; unsigned long bytesafter, lengthRtn; long length; Atom type; Arg args[4]; int i; Window srcWindow; Atom iccHandle; Atom *exportTargets; Cardinal numExportTargets; i = 0; XtSetArg(args[i], XmNsourceWindow, &srcWindow);i++; XtSetArg(args[i], XmNiccHandle, &iccHandle);i++; XtGetValues(dc, args, i); initiatorAtom = XInternAtom(XtDisplayOfObject(dc), XmI_MOTIF_DRAG_INITIATOR_INFO, FALSE); length = 100000L; if (XGetWindowProperty (XtDisplayOfObject(dc), srcWindow, iccHandle, 0L, length, False, initiatorAtom, &type, &format, &lengthRtn, &bytesafter, (unsigned char **) &info) == Success) { if(lengthRtn >= sizeof(xmDragInitiatorInfoStruct)) { if (info->byte_order != _XmByteOrderChar) { swap2bytes(info->targets_index); swap4bytes(info->icc_handle); } numExportTargets = _XmIndexToTargets(dc, info->targets_index, &exportTargets); i = 0; XtSetArg(args[i], XmNexportTargets, exportTargets);i++; XtSetArg(args[i], XmNnumExportTargets, numExportTargets);i++; XtSetValues(dc, args, i); } /* free the memory that Xlib passed us */ if(info) { XFree( (void *)info) ; } } } /************************************************************************ * * _XmGetDragReceiverInfo() * * The caller is responsible for freeing (using XFree) the dataRtn * pointer that passes thru the memory allocated by XGetWindowProperty. ***********************************************************************/ Boolean _XmGetDragReceiverInfo( Display *display, Window window, XmDragReceiverInfoStruct *receiverInfoRtn ) { xmDragReceiverInfoStruct *iccInfo = NULL ; Atom drag_hints_atom; int format; unsigned long bytesafter, lengthRtn, length; Atom type; XmReceiverDSTreeStruct *dsmInfo; Window root; unsigned int bw; XmDisplay dd = (XmDisplay) XmGetXmDisplay(display); drag_hints_atom = XInternAtom(display, XmI_MOTIF_DRAG_RECEIVER_INFO, FALSE); length = 100000L; if (XGetWindowProperty(display, window, drag_hints_atom, 0L, length, False, drag_hints_atom, &type, &format, &lengthRtn, &bytesafter, (unsigned char **) &iccInfo) == Success) { if (lengthRtn >= sizeof(xmDragReceiverInfoStruct)) { if (iccInfo->protocol_version != _MOTIF_DRAG_PROTOCOL_VERSION) { XmeWarning ((Widget) XmGetXmDisplay (display), MESSAGE2); } if (iccInfo->byte_order != _XmByteOrderChar) { swap2bytes(iccInfo->num_drop_sites); swap4bytes(iccInfo->proxy_window); swap4bytes(iccInfo->heap_offset); } dd->display.proxyWindow = iccInfo->proxy_window; (receiverInfoRtn)->dragProtocolStyle = iccInfo->drag_protocol_style; dsmInfo = XtNew(XmReceiverDSTreeStruct); dsmInfo->byteOrder = iccInfo->byte_order; dsmInfo->numDropSites = iccInfo->num_drop_sites; dsmInfo->currDropSite = 0; dsmInfo->propBufRec.data.bytes = (BYTE*)iccInfo; dsmInfo->propBufRec.data.size = (size_t) iccInfo->heap_offset; dsmInfo->propBufRec.heap.bytes = (BYTE*)iccInfo + iccInfo->heap_offset; dsmInfo->propBufRec.heap.size = (size_t) (lengthRtn - iccInfo->heap_offset); /* * skip over the info that we've already got */ dsmInfo->propBufRec.data.curr = (BYTE*)iccInfo + sizeof(xmDragReceiverInfoStruct); /* * now get their geometry */ XGetGeometry(display, window, &root, &(receiverInfoRtn->xOrigin), &(receiverInfoRtn->yOrigin), &(receiverInfoRtn->width), &(receiverInfoRtn->height), &bw, &(receiverInfoRtn->depth)); (void) XTranslateCoordinates(display, window, root, (int) -bw, (int) -bw, &(receiverInfoRtn->xOrigin), &(receiverInfoRtn->yOrigin), &root); (receiverInfoRtn)->iccInfo = (XtPointer) dsmInfo; return True; } else { (receiverInfoRtn)->dragProtocolStyle = XmDRAG_NONE; if (iccInfo) XFree((void *)iccInfo); return False; } } else return False; } /************************************************************************ * * _XmReadDSFromStream() * ***********************************************************************/ /*ARGSUSED*/ Boolean _XmReadDSFromStream( XmDropSiteManagerObject dsm, XtPointer iccInfo, XmICCDropSiteInfo dropSiteInfoRtn ) { xmDSHeaderStruct dsHeader; XmReceiverDSTree dsmInfo = (XmReceiverDSTree)iccInfo; xmPropertyBufferRec *propBuf = &dsmInfo->propBufRec; int i; xmICCRegBoxRec box; XmRegion region; _XmReadDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsHeader, sizeof(xmDSHeaderStruct)); if (dsmInfo->byteOrder != _XmByteOrderChar) { swap2bytes(dsHeader.flags); swap2bytes(dsHeader.import_targets_id); swap4bytes(dsHeader.dsRegionNumBoxes); } dropSiteInfoRtn->header.traversalType = (unsigned char) GET_TRAVERSAL_TYPE(dsHeader.flags); dropSiteInfoRtn->header.dropActivity = (unsigned char) GET_DS_ACTIVITY(dsHeader.flags); dropSiteInfoRtn->header.dropType = (unsigned char) GET_DS_TYPE(dsHeader.flags); dropSiteInfoRtn->header.operations = (unsigned char) GET_MULTIOPS(dsHeader.flags); dropSiteInfoRtn->header.animationStyle = (unsigned char) GET_ANIMATION_STYLE(dsHeader.flags); dropSiteInfoRtn->header.importTargetsID = (unsigned short) dsHeader.import_targets_id; switch (dropSiteInfoRtn->header.animationStyle) { case XmDRAG_UNDER_HIGHLIGHT: { XmICCDropSiteHighlight info = (XmICCDropSiteHighlight) dropSiteInfoRtn; xmDSHighlightDataStruct dsHighlight; _XmReadDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsHighlight, sizeof(xmDSHighlightDataStruct)); if (dsmInfo->byteOrder != _XmByteOrderChar) { swap2bytes(dsHighlight.borderWidth); swap2bytes(dsHighlight.highlightThickness); swap4bytes(dsHighlight.background); swap4bytes(dsHighlight.highlightColor); swap4bytes(dsHighlight.highlightPixmap); } info->animation_data.borderWidth = (Dimension) dsHighlight.borderWidth; info->animation_data.highlightThickness = (Dimension) dsHighlight.highlightThickness; info->animation_data.background = (Pixel) dsHighlight.background; info->animation_data.highlightColor = (Pixel) dsHighlight.highlightColor; info->animation_data.highlightPixmap = (Pixmap) dsHighlight.highlightPixmap; } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmICCDropSiteShadow info = (XmICCDropSiteShadow) dropSiteInfoRtn; xmDSShadowDataStruct dsShadow; _XmReadDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsShadow, sizeof(xmDSShadowDataStruct)); if (dsmInfo->byteOrder != _XmByteOrderChar) { swap2bytes(dsShadow.borderWidth); swap2bytes(dsShadow.highlightThickness); swap2bytes(dsShadow.shadowThickness); swap4bytes(dsShadow.foreground); swap4bytes(dsShadow.topShadowColor); swap4bytes(dsShadow.bottomShadowColor); swap4bytes(dsShadow.topShadowPixmap); swap4bytes(dsShadow.bottomShadowPixmap); } info->animation_data.borderWidth = (Dimension) dsShadow.borderWidth; info->animation_data.highlightThickness = (Dimension) dsShadow.highlightThickness; info->animation_data.shadowThickness = (Dimension) dsShadow.shadowThickness; info->animation_data.foreground = (Pixel) dsShadow.foreground; info->animation_data.topShadowColor = (Pixel) dsShadow.topShadowColor; info->animation_data.bottomShadowColor = (Pixel) dsShadow.bottomShadowColor; info->animation_data.topShadowPixmap = (Pixmap) dsShadow.topShadowPixmap; info->animation_data.bottomShadowPixmap = (Pixmap) dsShadow.bottomShadowPixmap; } break; case XmDRAG_UNDER_PIXMAP: { XmICCDropSitePixmap info = (XmICCDropSitePixmap) dropSiteInfoRtn; xmDSPixmapDataStruct dsPixmap; _XmReadDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsPixmap, sizeof(xmDSPixmapDataStruct)); if (dsmInfo->byteOrder != _XmByteOrderChar) { swap2bytes(dsPixmap.borderWidth); swap2bytes(dsPixmap.highlightThickness); swap2bytes(dsPixmap.shadowThickness); swap2bytes(dsPixmap.animationPixmapDepth); swap4bytes(dsPixmap.foreground); swap4bytes(dsPixmap.background); swap4bytes(dsPixmap.animationPixmap); swap4bytes(dsPixmap.animationMask); } info->animation_data.borderWidth = (Dimension) dsPixmap.borderWidth; info->animation_data.highlightThickness = (Dimension) dsPixmap.highlightThickness; info->animation_data.shadowThickness = (Dimension) dsPixmap.shadowThickness; info->animation_data.animationPixmapDepth = (Cardinal) dsPixmap.animationPixmapDepth; info->animation_data.foreground = (Pixel) dsPixmap.foreground; info->animation_data.background = (Pixel) dsPixmap.background; info->animation_data.animationPixmap = (Pixmap) dsPixmap.animationPixmap; info->animation_data.animationMask = (Pixmap) dsPixmap.animationMask; } break; case XmDRAG_UNDER_NONE: { XmICCDropSiteNone info = (XmICCDropSiteNone) dropSiteInfoRtn; xmDSNoneDataStruct dsNone; _XmReadDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsNone, sizeof(xmDSNoneDataStruct)); if (dsmInfo->byteOrder != _XmByteOrderChar) { swap2bytes(dsNone.borderWidth); } info->animation_data.borderWidth = (Dimension) dsNone.borderWidth; } break; default: break; } /* * Read the region, byte swapping if necessary. */ region = dropSiteInfoRtn->header.region = _XmRegionCreateSize ((long) dsHeader.dsRegionNumBoxes); for (i = 0; i < (long) dsHeader.dsRegionNumBoxes; i++) { _XmReadDragBuffer(propBuf, BUFFER_DATA, (BYTE*) &box, sizeof(xmICCRegBoxRec)); if (dsmInfo->byteOrder != _XmByteOrderChar) { swap2bytes(box.x1); swap2bytes(box.x2); swap2bytes(box.y1); swap2bytes(box.y2); } region->rects[i].x1 = (short) cvtINT16toShort(box.x1); region->rects[i].x2 = (short) cvtINT16toShort(box.x2); region->rects[i].y1 = (short) cvtINT16toShort(box.y1); region->rects[i].y2 = (short) cvtINT16toShort(box.y2); } region->numRects = (long) dsHeader.dsRegionNumBoxes; _XmRegionComputeExtents (region); if (++dsmInfo->currDropSite == dsmInfo->numDropSites) { /* free all the wire data */ XtFree((char *)dsmInfo->propBufRec.data.bytes); XtFree((char *)dsmInfo); #ifdef DEBUG printf("freed the dsmInfo, all done\n"); #endif } return True; } /************************************************************************ * * _XmWriteDSToStream() * ***********************************************************************/ /*ARGSUSED*/ void _XmWriteDSToStream( XmDropSiteManagerObject dsm, XtPointer stream, XmICCDropSiteInfo dropSiteInfo ) { xmDSHeaderStruct dsHeader; XmReceiverDSTree dsmInfo = (XmReceiverDSTree)stream; xmPropertyBufferRec *propBuf = &dsmInfo->propBufRec; int i; xmICCRegBoxRec box; XmRegion region = dropSiteInfo->header.region; dsHeader.flags = 0; dsHeader.flags |= PUT_TRAVERSAL_TYPE(dropSiteInfo->header.traversalType); dsHeader.flags |= PUT_DS_ACTIVITY(dropSiteInfo->header.dropActivity); dsHeader.flags |= PUT_DS_TYPE(dropSiteInfo->header.dropType); dsHeader.flags |= PUT_MULTIOPS(dropSiteInfo->header.operations); dsHeader.flags |= PUT_ANIMATION_STYLE(dropSiteInfo->header.animationStyle); dsHeader.import_targets_id = dropSiteInfo->header.importTargetsID; dsHeader.dsRegionNumBoxes = region->numRects; _XmWriteDragBuffer(propBuf, BUFFER_DATA, (BYTE*)&dsHeader, sizeof(xmDSHeaderStruct)); switch (dropSiteInfo->header.animationStyle) { case XmDRAG_UNDER_HIGHLIGHT: { XmICCDropSiteHighlight info = (XmICCDropSiteHighlight) dropSiteInfo; xmDSHighlightDataStruct dsHighlight; dsHighlight.borderWidth = info->animation_data.borderWidth; dsHighlight.highlightThickness = info->animation_data.highlightThickness; dsHighlight.background = info->animation_data.background; dsHighlight.highlightColor = info->animation_data.highlightColor; dsHighlight.highlightPixmap = info->animation_data.highlightPixmap; _XmWriteDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsHighlight, sizeof(xmDSHighlightDataStruct)); } break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: { XmICCDropSiteShadow info = (XmICCDropSiteShadow) dropSiteInfo; xmDSShadowDataStruct dsShadow; dsShadow.borderWidth = info->animation_data.borderWidth; dsShadow.highlightThickness = info->animation_data.highlightThickness; dsShadow.shadowThickness = info->animation_data.shadowThickness; dsShadow.foreground = info->animation_data.foreground; dsShadow.topShadowColor = info->animation_data.topShadowColor; dsShadow.bottomShadowColor = info->animation_data.bottomShadowColor; dsShadow.topShadowPixmap = info->animation_data.topShadowPixmap; dsShadow.bottomShadowPixmap = info->animation_data.bottomShadowPixmap; _XmWriteDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsShadow, sizeof(xmDSShadowDataStruct)); } break; case XmDRAG_UNDER_PIXMAP: { XmICCDropSitePixmap info = (XmICCDropSitePixmap) dropSiteInfo; xmDSPixmapDataStruct dsPixmap; dsPixmap.borderWidth = info->animation_data.borderWidth; dsPixmap.highlightThickness = info->animation_data.highlightThickness; dsPixmap.shadowThickness = info->animation_data.shadowThickness; dsPixmap.animationPixmapDepth = info->animation_data.animationPixmapDepth; dsPixmap.foreground = info->animation_data.foreground; dsPixmap.background = info->animation_data.background; dsPixmap.animationPixmap = info->animation_data.animationPixmap; dsPixmap.animationMask = info->animation_data.animationMask; _XmWriteDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsPixmap, sizeof(xmDSPixmapDataStruct)); } break; case XmDRAG_UNDER_NONE: { XmICCDropSiteNone info = (XmICCDropSiteNone) dropSiteInfo; xmDSNoneDataStruct dsNone; dsNone.borderWidth = info->animation_data.borderWidth; _XmWriteDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&dsNone, sizeof(xmDSNoneDataStruct)); } break; default: break; } /* write each rectangle box */ for (i = 0; i < region->numRects; i++) { box.x1 = (INT16) region->rects[i].x1; box.x2 = (INT16) region->rects[i].x2; box.y1 = (INT16) region->rects[i].y1; box.y2 = (INT16) region->rects[i].y2; _XmWriteDragBuffer(propBuf, BUFFER_DATA, (BYTE*) &box, sizeof(xmICCRegBoxRec)); } } /************************************************************************ * * _XmFreeDragReceiverInfo() * ***********************************************************************/ void _XmFreeDragReceiverInfo( XtPointer info ) { XmReceiverDSTreeStruct *dsmInfo = (XmReceiverDSTreeStruct *)info; if (dsmInfo) { XtFree((char *)dsmInfo->propBufRec.data.bytes); XtFree((char *)dsmInfo); } } /************************************************************************ * * _XmClearDragReceiverInfo() * * We can pass in the shell since we're pushing a property at one of * our windows. ***********************************************************************/ void _XmClearDragReceiverInfo( Widget shell ) { Atom receiverAtom; receiverAtom = XInternAtom(XtDisplayOfObject(shell), XmI_MOTIF_DRAG_RECEIVER_INFO, False); XDeleteProperty(XtDisplayOfObject(shell), XtWindow(shell), receiverAtom); return; } /************************************************************************ * * _XmSetDragReceiverInfo() * * We can pass in the shell since we're pushing a property at one of * our windows. This procedure should not be called for receivers * with a protocol style of NONE, because such receivers should not * have any visible receiver info. ***********************************************************************/ void _XmSetDragReceiverInfo( XmDisplay dd, Widget shell ) { Cardinal numDropSites = 0; BYTE stackData[MAXSTACK]; BYTE stackHeap[MAXSTACK]; xmPropertyBufferRec *propBuf; xmDragReceiverInfoStruct infoRec, *infoRecPtr; XmReceiverDSTreeStruct dsmInfoRec; Atom receiverAtom; XmDropSiteManagerObject dsm; dsm = _XmGetDropSiteManagerObject( dd) ; receiverAtom = XInternAtom(XtDisplayOfObject(shell), XmI_MOTIF_DRAG_RECEIVER_INFO, False); dsmInfoRec.numDropSites = 0; dsmInfoRec.currDropSite = 0; propBuf = &dsmInfoRec.propBufRec; propBuf->data.stack = propBuf->data.bytes = stackData; propBuf->data.size = 0; propBuf->data.max = MAXSTACK; propBuf->heap.stack = propBuf->heap.bytes = stackHeap; propBuf->heap.size = 0; propBuf->heap.max = MAXSTACK; infoRec.byte_order = _XmByteOrderChar; infoRec.protocol_version = _MOTIF_DRAG_PROTOCOL_VERSION; infoRec.drag_protocol_style = dd->display.dragReceiverProtocolStyle; infoRec.proxy_window = None; _XmWriteDragBuffer (propBuf, BUFFER_DATA, (BYTE*)&infoRec, sizeof(xmDragReceiverInfoStruct)); /* * Only attach a drop site tree to the property if the receiver * protocol style is not dynamic and not drop only (this procedure * shouldn't get called if style is NONE). */ if ((dd->display.dragReceiverProtocolStyle != XmDRAG_DYNAMIC) && (dd->display.dragReceiverProtocolStyle != XmDRAG_DROP_ONLY)) { numDropSites = _XmDSMGetTreeFromDSM(dsm, shell, (XtPointer)&dsmInfoRec); } else { /* * However, this procedure is called on the realize of the * shell, and the drop site manager is counting on having a * chance to synchronize the drop site db with the actual * widget information. */ _XmSyncDropSiteTree(shell); } infoRecPtr = (xmDragReceiverInfoStruct *)propBuf->data.bytes; infoRecPtr->num_drop_sites = numDropSites; infoRecPtr->heap_offset = propBuf->data.size; /* write the buffer to the property */ XChangeProperty (XtDisplayOfObject(shell), XtWindow(shell), receiverAtom, receiverAtom, 8, PropModeReplace, (unsigned char *)propBuf->data.bytes, propBuf->data.size); if (propBuf->data.bytes != propBuf->data.stack) XtFree((char *)propBuf->data.bytes); if (propBuf->heap.size) { XChangeProperty (XtDisplayOfObject(shell), XtWindow(shell), receiverAtom, receiverAtom, 8, PropModeAppend, (unsigned char *)propBuf->heap.bytes, propBuf->heap.size); if (propBuf->heap.bytes != propBuf->heap.stack) XtFree((char *)propBuf->heap.bytes); } } /************************************************************************ * * _XmInitByteOrderChar() * ***********************************************************************/ void _XmInitByteOrderChar( void ) { _XmProcessLock(); /* bootstrap the byteorder if needed */ if (!_XmByteOrderChar) { unsigned int endian = 1; /* get rid of irritating saber warning */ /*SUPPRESS 112*/ if (*((char *)&endian)) _XmByteOrderChar = 'l'; else _XmByteOrderChar = 'B'; } _XmProcessUnlock(); } #ifdef DEBUG static void PrintMessage(char c, xmICCMessageStruct *xmessage) { int message_type = xmessage->any.message_type; message_type &= CLEAR_ICC_EVENT_TYPE; switch (_XmMessageTypeToReason(message_type)) { case XmCR_TOP_LEVEL_ENTER: printf("%c ", c); printf("TL Enter %x %x %x %x\n", xmessage->topLevelEnter.flags, xmessage->topLevelEnter.time, xmessage->topLevelEnter.src_window, xmessage->topLevelEnter.icc_handle); break; case XmCR_TOP_LEVEL_LEAVE: printf("%c ", c); printf("TL Leave %x %x %x\n", xmessage->topLevelLeave.flags, xmessage->topLevelLeave.time, xmessage->topLevelLeave.src_window); break; case XmCR_DRAG_MOTION: #ifdef DEBUG_DRAG_MOTION printf("%c ", c); printf("Motion %x %x %x %x\n", xmessage->dragMotion.flags, xmessage->dragMotion.time, xmessage->dragMotion.x, xmessage->dragMotion.y); #endif /* DEBUG_DRAG_MOTION */ break; case XmCR_OPERATION_CHANGED: printf("%c ", c); printf("Op changed %x %x\n", xmessage->operationChanged.flags, xmessage->operationChanged.time); break; case XmCR_DROP_SITE_ENTER: printf("%c ", c); printf("Enter %x %x %x %x\n", xmessage->dropSiteEnter.flags, xmessage->dropSiteEnter.time, xmessage->dropSiteEnter.x, xmessage->dropSiteEnter.y); break; case XmCR_DROP_SITE_LEAVE: printf("%c ", c); printf("Leave %x %x\n", xmessage->dropSiteLeave.flags, xmessage->dropSiteLeave.time); break; case XmCR_DROP_START: printf("%c ", c); printf("Start %x %x %x %x %x %x\n", xmessage->drop.flags, xmessage->drop.time, xmessage->drop.x, xmessage->drop.y, xmessage->drop.icc_handle, xmessage->drop.src_window); break; default: break; } } #endif /* DEBUG */ motif-2.3.8/lib/Xm/DragUnder.c0000644000175000017500000006767213145162623012761 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: DragUnder.c /main/12 1995/07/14 10:26:51 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include "XmI.h" #include "DragCI.h" #include "DragICCI.h" #include "DragOverSI.h" #include "DragUnderI.h" #include "DropSMgrI.h" #include "GadgetUtiI.h" #include "MessagesI.h" #include "RegionI.h" #include "ScreenI.h" #define MESSAGE1 _XmMMsgDragUnder_0000 #define MESSAGE2 _XmMMsgDragUnder_0001 /******** Static Function Declarations ********/ static XmAnimationSaveData CreateAnimationSaveData( XmDragContext dc, XmAnimationData aData, XmDragProcCallbackStruct *dpcb) ; static void FreeAnimationData( XmAnimationSaveData aSaveData) ; static Boolean SaveAll( XmAnimationSaveData aSaveData, Position x, Position y, Dimension width, Dimension height) ; static Boolean SaveSegments( XmAnimationSaveData aSaveData, Position x, Position y, Dimension width, Dimension height, Dimension *thickness) ; static void DrawHighlight( XmAnimationSaveData aSaveData) ; static void DrawShadow( XmAnimationSaveData aSaveData) ; static void DrawPixmap( XmAnimationSaveData aSaveData) ; static void AnimateExpose(Widget w, XmAnimationSaveData aSaveData, XEvent *event, Boolean *cont); static void AnimateEnter( XmDropSiteManagerObject dsm, XmAnimationData aData, XmDragProcCallbackStruct *dpcb) ; static void AnimateLeave( XmDropSiteManagerObject dsm, XmAnimationData aData, XmDragProcCallbackStruct *dpcb) ; /******** End Static Function Declarations ********/ /***************************************************************************** * * CreateAnimationSaveData () * * Create and fill an XmAnimationSaveData structure containing the data * needed to animate the dropsite. ***************************************************************************/ /*ARGSUSED*/ static XmAnimationSaveData CreateAnimationSaveData( XmDragContext dc, XmAnimationData aData, XmDragProcCallbackStruct *dpcb ) /* unused */ { XmAnimationSaveData aSaveData; XGCValues v; unsigned long vmask; XmDropSiteVisuals dsv; int ac; Arg al[5]; Window junkWin; int junkInt; unsigned int junkUInt; unsigned char activeMode; aSaveData = (XmAnimationSaveData) XtMalloc (sizeof (XmAnimationSaveDataRec)); aSaveData->dragOver = aData->dragOver; aSaveData->display = XtDisplay (dc); aSaveData->xmScreen = (XmScreen) XmGetXmScreen (aData->screen); aSaveData->window = aData->window; aSaveData->windowX = aData->windowX; aSaveData->windowY = aData->windowY; if (aSaveData->dragOver) { aSaveData->xmScreen = (XmScreen) XmGetXmScreen (XtScreen (aSaveData->dragOver)); } else { aSaveData->xmScreen = (XmScreen) XmGetXmScreen(XtScreen (dc)); } /* * Get the window depth. */ if (!XGetGeometry (aSaveData->display, aSaveData->window, &junkWin, &junkInt, &junkInt, &junkUInt, &junkUInt, &junkUInt, &(aSaveData->windowDepth))) { XmeWarning ((Widget) dc, MESSAGE1); aSaveData->windowDepth = 0; } aSaveData->clipRegion = aData->clipRegion; aSaveData->dropSiteRegion = aData->dropSiteRegion; dsv = XmDropSiteGetActiveVisuals ((Widget) dc); aSaveData->background = dsv->background; aSaveData->foreground = dsv->foreground; aSaveData->topShadowColor = dsv->topShadowColor; aSaveData->topShadowPixmap = dsv->topShadowPixmap; aSaveData->bottomShadowColor = dsv->bottomShadowColor; aSaveData->bottomShadowPixmap = dsv->bottomShadowPixmap; aSaveData->shadowThickness = dsv->shadowThickness; aSaveData->highlightThickness = dsv->highlightThickness; aSaveData->highlightColor = dsv->highlightColor; aSaveData->highlightPixmap = dsv->highlightPixmap; aSaveData->borderWidth = dsv->borderWidth; XtFree ((char *)dsv); ac = 0; XtSetArg (al[ac], XmNanimationStyle, &(aSaveData->animationStyle)); ac++; XtSetArg (al[ac], XmNanimationMask, &(aSaveData->animationMask)); ac++; XtSetArg (al[ac], XmNanimationPixmap, &(aSaveData->animationPixmap)); ac++; XtSetArg (al[ac], XmNanimationPixmapDepth, &(aSaveData->animationPixmapDepth)); ac++; XmDropSiteRetrieve ((Widget) dc, al, ac); if (aSaveData->animationStyle == XmDRAG_UNDER_PIXMAP && aSaveData->animationPixmap != None && aSaveData->animationPixmap != XmUNSPECIFIED_PIXMAP && aSaveData->animationPixmapDepth != 1 && aSaveData->animationPixmapDepth != aSaveData->windowDepth) { XmeWarning ((Widget) dc, MESSAGE2); aSaveData->animationPixmap = XmUNSPECIFIED_PIXMAP; } /* * Create the draw GC. */ v.foreground = aSaveData->foreground; v.background = aSaveData->background; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; vmask = GCGraphicsExposures|GCSubwindowMode|GCForeground|GCBackground; aSaveData->drawGC = XCreateGC (aSaveData->display, aSaveData->window, vmask, &v); if (aSaveData -> dragOver != (Widget) NULL) { /* Save info on active drag over mode */ XtSetArg(al[0], XmNdragOverActiveMode, &activeMode); XtGetValues((Widget) aSaveData -> dragOver, al, 1); aSaveData->activeMode = activeMode; } else { /* XmCURSOR is as good as any other value for here. We only check this against XmDRAG_WINDOW */ aSaveData->activeMode = XmCURSOR; } /* initialize savedPixmaps list */ aSaveData->savedPixmaps = NULL; aSaveData->numSavedPixmaps = 0; return (aSaveData); } /***************************************************************************** * * FreeAnimationData () * * Free an XmAnimationSaveData structure. ***************************************************************************/ static void FreeAnimationData( XmAnimationSaveData aSaveData ) { Cardinal i; switch (aSaveData->animationStyle) { case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: XFreeGC (aSaveData->display, aSaveData->topShadowGC); XFreeGC (aSaveData->display, aSaveData->bottomShadowGC); XFreeGC (aSaveData->display, aSaveData->drawGC); break; case XmDRAG_UNDER_HIGHLIGHT: XFreeGC (aSaveData->display, aSaveData->highlightGC); XFreeGC (aSaveData->display, aSaveData->drawGC); break; case XmDRAG_UNDER_PIXMAP: XFreeGC (aSaveData->display, aSaveData->drawGC); case XmDRAG_UNDER_NONE: default: break; } if (aSaveData->numSavedPixmaps) { for (i = 0; i < aSaveData->numSavedPixmaps; i++) { _XmFreeScratchPixmap (aSaveData->xmScreen, aSaveData->savedPixmaps[i].pixmap); } XtFree ((char *)aSaveData->savedPixmaps); } XtFree ((char *)aSaveData); } /***************************************************************************** * * SaveAll () * * Save the original contents of a dropsite window that will be overwritten * by dropsite animation into a rectangular backing store. ***************************************************************************/ static Boolean SaveAll( XmAnimationSaveData aSaveData, Position x, Position y, Dimension width, Dimension height ) { DragPixmapData *pData; if (width <= 0 || height <= 0) { return (False); } aSaveData->numSavedPixmaps = 1; aSaveData->savedPixmaps = pData = (DragPixmapData *) XtMalloc (sizeof(DragPixmapData)); if (!pData) { return (False); } pData->x = x; pData->y = y; pData->width = width; pData->height = height; pData->pixmap = _XmAllocScratchPixmap (aSaveData->xmScreen, (Cardinal) aSaveData->windowDepth, pData->width, pData->height); XCopyArea (aSaveData->display, aSaveData->window, pData->pixmap, aSaveData->drawGC, pData->x, pData->y, pData->width, pData->height, 0, 0); return (True); } /***************************************************************************** * * SaveSegments () * * Save the original contents of a dropsite window that will be overwritten * by dropsite highlighting or shadowing of indicated thickness. This will * save 0, 1, or 4 strips into backing store, depending on the dimensions * of the dropsite and the animation thickness. ***************************************************************************/ static Boolean SaveSegments( XmAnimationSaveData aSaveData, Position x, Position y, Dimension width, Dimension height, Dimension *thickness ) { DragPixmapData *pData; Boolean save_all = False; if (width <= 0 || height <= 0 || *thickness <= 0) { return (False); } if (*thickness > (width >> 1)) { *thickness = (width >> 1); save_all = True; } if (*thickness > (height >> 1)) { *thickness = (height >> 1); save_all = True; } if (save_all) { return (SaveAll (aSaveData, x, y, width, height)); } aSaveData->numSavedPixmaps = 4; aSaveData->savedPixmaps = pData = (DragPixmapData *) XtMalloc (sizeof(DragPixmapData) * 4); if (!pData) { return (False); } pData->x = x; pData->y = y; pData->width = width; pData->height = *thickness; pData->pixmap = _XmAllocScratchPixmap (aSaveData->xmScreen, (Cardinal) aSaveData->windowDepth, pData->width, pData->height); XCopyArea (aSaveData->display, aSaveData->window, pData->pixmap, aSaveData->drawGC, pData->x, pData->y, pData->width, pData->height, 0, 0); pData++; pData->x = x; pData->y = y + *thickness; pData->width = *thickness; pData->height = height - (*thickness << 1); pData->pixmap = _XmAllocScratchPixmap (aSaveData->xmScreen, (Cardinal) aSaveData->windowDepth, pData->width, pData->height); XCopyArea (aSaveData->display, aSaveData->window, pData->pixmap, aSaveData->drawGC, pData->x, pData->y, pData->width, pData->height, 0, 0); pData++; pData->x = x; pData->y = y + height - *thickness; pData->width = width; pData->height = *thickness; pData->pixmap = _XmAllocScratchPixmap (aSaveData->xmScreen, (Cardinal) aSaveData->windowDepth, pData->width, pData->height); XCopyArea (aSaveData->display, aSaveData->window, pData->pixmap, aSaveData->drawGC, pData->x, pData->y, pData->width, pData->height, 0, 0); pData++; pData->x = x + width - *thickness; pData->y = y + *thickness; pData->width = *thickness; pData->height = height - (*thickness << 1); pData->pixmap = _XmAllocScratchPixmap (aSaveData->xmScreen, (Cardinal) aSaveData->windowDepth, pData->width, pData->height); XCopyArea (aSaveData->display, aSaveData->window, pData->pixmap, aSaveData->drawGC, pData->x, pData->y, pData->width, pData->height, 0, 0); return (True); } /***************************************************************************** * * DrawHighlight () * * Draws a highlight around the indicated region. ***************************************************************************/ static void DrawHighlight( XmAnimationSaveData aSaveData ) { XGCValues v; unsigned long vmask; Dimension offset; Position x; Position y; Dimension width; Dimension height; XRectangle extents; /* * Create the highlightGC */ v.foreground = aSaveData->highlightColor; v.background = aSaveData->background; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; vmask = GCGraphicsExposures|GCSubwindowMode|GCForeground|GCBackground; if (aSaveData->highlightPixmap != None && aSaveData->highlightPixmap != XmUNSPECIFIED_PIXMAP) { int depth ; XmeGetPixmapData(XtScreen(aSaveData->xmScreen), aSaveData->highlightPixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == 1) { v.fill_style = FillStippled; v.stipple = aSaveData->highlightPixmap; vmask |= GCStipple | GCFillStyle; } else { v.fill_style = FillTiled; v.tile = aSaveData->highlightPixmap; vmask |= GCTile | GCFillStyle; } } aSaveData->highlightGC = XCreateGC(aSaveData->display, aSaveData->window, vmask, &v); _XmRegionSetGCRegion (aSaveData->display, aSaveData->highlightGC, 0, 0, aSaveData->clipRegion); /* draw highlight */ _XmRegionGetExtents (aSaveData->dropSiteRegion, &extents); offset = aSaveData->borderWidth; if (_XmRegionGetNumRectangles(aSaveData->dropSiteRegion) == 1L) { x = extents.x + offset; y = extents.y + offset; width = extents.width - (offset << 1); height = extents.height - (offset << 1); if (SaveSegments (aSaveData, x, y, width, height, &aSaveData->highlightThickness)) { XmeDrawHighlight (aSaveData->display, aSaveData->window, aSaveData->highlightGC, x, y, width, height, aSaveData->highlightThickness); } } else { if (SaveAll (aSaveData, extents.x, extents.y, extents.width, extents.height)) { _XmRegionDrawShadow (aSaveData->display, aSaveData->window, aSaveData->highlightGC, aSaveData->highlightGC, aSaveData->dropSiteRegion, offset, aSaveData->highlightThickness, XmSHADOW_OUT); } } } /***************************************************************************** * * DrawShadow () * * Draws a 3-D shadow around the indicated region. ***************************************************************************/ static void DrawShadow( XmAnimationSaveData aSaveData ) { XGCValues v; unsigned long vmask; Dimension offset; Position x; Position y; Dimension width; Dimension height; XRectangle extents; /* * Create the topShadowGC */ v.foreground = aSaveData->topShadowColor; v.background = aSaveData->foreground; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; vmask = GCGraphicsExposures|GCSubwindowMode|GCForeground|GCBackground; if (aSaveData->topShadowPixmap != None && aSaveData->topShadowPixmap != XmUNSPECIFIED_PIXMAP) { int depth ; XmeGetPixmapData(XtScreen(aSaveData->xmScreen), aSaveData->topShadowPixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == 1) { v.fill_style = FillStippled; v.stipple = aSaveData->topShadowPixmap; vmask |= GCStipple | GCFillStyle; } else { v.fill_style = FillTiled; v.tile = aSaveData->topShadowPixmap; vmask |= GCTile | GCFillStyle; } } aSaveData->topShadowGC = XCreateGC(aSaveData->display, aSaveData->window, vmask, &v); _XmRegionSetGCRegion (aSaveData->display, aSaveData->topShadowGC, 0, 0, aSaveData->clipRegion); /* * Create the bottomShadowGC */ v.foreground = aSaveData->bottomShadowColor; v.background = aSaveData->foreground; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; vmask = GCGraphicsExposures|GCSubwindowMode|GCForeground|GCBackground; if (aSaveData->bottomShadowPixmap != None && aSaveData->bottomShadowPixmap != XmUNSPECIFIED_PIXMAP) { int depth ; XmeGetPixmapData(XtScreen(aSaveData->xmScreen), aSaveData->bottomShadowPixmap, NULL, &depth, NULL, NULL, NULL, NULL, NULL, NULL); if (depth == 1) { v.fill_style = FillStippled; v.stipple = aSaveData->bottomShadowPixmap; vmask |= GCStipple | GCFillStyle; } else { v.fill_style = FillTiled; v.tile = aSaveData->bottomShadowPixmap; vmask |= GCTile | GCFillStyle; } } aSaveData->bottomShadowGC = XCreateGC(aSaveData->display, aSaveData->window, vmask, &v); _XmRegionSetGCRegion (aSaveData->display, aSaveData->bottomShadowGC, 0, 0, aSaveData->clipRegion); /* * Draw the shadows. */ _XmRegionGetExtents (aSaveData->dropSiteRegion, &extents); offset = aSaveData->borderWidth + aSaveData->highlightThickness; if (_XmRegionGetNumRectangles(aSaveData->dropSiteRegion) == 1L) { x = extents.x + offset; y = extents.y + offset; width = extents.width - (offset << 1); height = extents.height - (offset << 1); if (SaveSegments (aSaveData, x, y, width, height, &aSaveData->shadowThickness)) { XmeDrawShadows (aSaveData->display, aSaveData->window, aSaveData->topShadowGC, aSaveData->bottomShadowGC, x, y, width, height, aSaveData->shadowThickness, (aSaveData->animationStyle == XmDRAG_UNDER_SHADOW_IN) ? XmSHADOW_IN : XmSHADOW_OUT); } } else { if (SaveAll (aSaveData, extents.x, extents.y, extents.width, extents.height)) { _XmRegionDrawShadow (aSaveData->display, aSaveData->window, aSaveData->topShadowGC, aSaveData->bottomShadowGC, aSaveData->dropSiteRegion, offset, aSaveData->shadowThickness, (aSaveData->animationStyle == XmDRAG_UNDER_SHADOW_IN) ? XmSHADOW_IN : XmSHADOW_OUT); } } } /***************************************************************************** * * DrawPixmap () * * Copy an animationPixmap, possibly masked, to the dropsite window. ***************************************************************************/ static void DrawPixmap( XmAnimationSaveData aSaveData ) { Position x; Position y; Dimension width; Dimension height; XRectangle extents; XGCValues v; unsigned long vmask; Pixmap mask = XmUNSPECIFIED_PIXMAP; GC maskGC = NULL; if (aSaveData->animationPixmap == None || aSaveData->animationPixmap == XmUNSPECIFIED_PIXMAP) { return; } /* * Determine the destination location and dimensions -- the * dropsite's bounding box. */ _XmRegionGetExtents (aSaveData->dropSiteRegion, &extents); x = extents.x; y = extents.y; width = extents.width; height = extents.height; /* * Save the original window contents. * Draw the DrawUnder pixmap into the window. * Assume correct depth -- checked in CreateAnimationSaveData(). */ if (SaveAll (aSaveData, x, y, width, height)) { if (aSaveData->animationMask != None && aSaveData->animationMask != XmUNSPECIFIED_PIXMAP) { /* * AnimationMask specified: create a composite mask consisting * of both the clipping region and the animationMask to use for * copying the animationPixmap into the dropSite. * * Create a mask and maskGC. * Set the composite mask to 0's. * Or the animationMask into it through the ClipRegion. * Set the drawGC's ClipMask to the composite mask. */ mask = _XmAllocScratchPixmap (aSaveData->xmScreen, 1, width, height); v.background = 0; v.foreground = 1; v.function = GXclear; v.graphics_exposures = False; v.subwindow_mode = IncludeInferiors; vmask = GCGraphicsExposures|GCSubwindowMode| GCBackground|GCForeground|GCFunction; maskGC = XCreateGC (aSaveData->display, mask, vmask, &v); XFillRectangle (aSaveData->display, mask, maskGC, 0, 0, width, height); XSetFunction (aSaveData->display, maskGC, GXor); _XmRegionSetGCRegion (aSaveData->display, maskGC, -x, -y, aSaveData->clipRegion); XCopyArea (aSaveData->display, aSaveData->animationMask, mask, maskGC, 0, 0, width, height, 0, 0); XSetClipOrigin (aSaveData->display, aSaveData->drawGC, x, y); XSetClipMask (aSaveData->display, aSaveData->drawGC, mask); XFreeGC (aSaveData->display, maskGC); } else { _XmRegionSetGCRegion (aSaveData->display, aSaveData->drawGC, 0, 0, aSaveData->clipRegion); } /* * Copy the animationPixmap to the window. * If the animationPixmapDepth is 1 we treat the animationPixmap * as a bitmap and use XCopyPlane. For 1-deep dropsite windows, * this may not be the same as treating the animationPixmap as a * 1-deep pixmap and using XCopyArea. */ if (aSaveData->animationPixmapDepth == 1) { XCopyPlane (aSaveData->display, aSaveData->animationPixmap, aSaveData->window, aSaveData->drawGC, 0, 0, width, height, x, y, 1L); } else { XCopyArea (aSaveData->display, aSaveData->animationPixmap, aSaveData->window, aSaveData->drawGC, 0, 0, width, height, x, y); } if (mask != XmUNSPECIFIED_PIXMAP) { _XmFreeScratchPixmap (aSaveData->xmScreen, mask); } } } /***************************************************************************** * * AnimateExpose () * ***************************************************************************/ /*ARGSUSED*/ static void AnimateExpose(Widget w, /* unused */ XmAnimationSaveData aSaveData, XEvent *event, /* unused */ Boolean *cont) /* unused */ { /* * If dragging a pixmap or window, hide it while drawing the * animation. */ if (aSaveData->dragOver && aSaveData->activeMode != XmDRAG_WINDOW) { _XmDragOverHide (aSaveData->dragOver, aSaveData->windowX, aSaveData->windowY, aSaveData->clipRegion); } /* Draw the visuals. */ switch(aSaveData->animationStyle) { default: case XmDRAG_UNDER_HIGHLIGHT: DrawHighlight (aSaveData); break; case XmDRAG_UNDER_SHADOW_IN: case XmDRAG_UNDER_SHADOW_OUT: DrawShadow (aSaveData); break; case XmDRAG_UNDER_PIXMAP: DrawPixmap (aSaveData); break; case XmDRAG_UNDER_NONE: break; } /* * If dragging a pixmap or window, show it. */ if (aSaveData->dragOver && aSaveData->activeMode != XmDRAG_WINDOW) { _XmDragOverShow (aSaveData->dragOver, aSaveData->windowX, aSaveData->windowY, aSaveData->clipRegion); } } /***************************************************************************** * * AnimateEnter () * ***************************************************************************/ /*ARGSUSED*/ static void AnimateEnter( XmDropSiteManagerObject dsm, /* unused */ XmAnimationData aData, XmDragProcCallbackStruct *dpcb ) { Widget dc = dpcb->dragContext; XmAnimationSaveData aSaveData; Widget dswidget = GetDSWidget((XmDSInfo) (dsm->dropManager.curInfo)); Boolean dummy; /* * Create and fill an XmAnimationSaveData structure containing the * data needed to animate the dropsite. Save it for AnimateLeave(). */ aSaveData = CreateAnimationSaveData ((XmDragContext) dc, aData, dpcb); *((XtPointer *) aData->saveAddr) = (XtPointer) aSaveData; /* Show the visual */ AnimateExpose(dswidget, aSaveData, NULL, &dummy); /* Save the dragunder widget */ aSaveData->dragUnder = dswidget; if (aSaveData->activeMode == XmDRAG_WINDOW) { /* Install the event handler to redo visual on Exposure */ Widget hwidget = dswidget; if (XmIsGadget(hwidget)) hwidget = XtParent(hwidget); XtInsertEventHandler(hwidget, ExposureMask, False, (XtEventHandler) AnimateExpose, (XtPointer) aSaveData, XtListTail); } } /***************************************************************************** * * AnimateLeave () * ***************************************************************************/ /*ARGSUSED*/ static void AnimateLeave( XmDropSiteManagerObject dsm, /* unused */ XmAnimationData aData, XmDragProcCallbackStruct *dpcb ) /* unused */ { XmAnimationSaveData aSaveData = (XmAnimationSaveData) *((XtPointer *) aData->saveAddr); if (aSaveData) { Cardinal i; DragPixmapData *pData; /* Move to here to avoid crashes when aSaveData already zeroed */ if (aSaveData->activeMode == XmDRAG_WINDOW) { /* Remove the event handler to redo visual on Exposure */ Widget hwidget = aSaveData -> dragUnder; if (XmIsGadget(hwidget)) hwidget = XtParent(hwidget); XtRemoveEventHandler(hwidget, ExposureMask, False, (XtEventHandler) AnimateExpose, (XtPointer) aSaveData); } /* * If dragging a pixmap or window, hide it while erasing the * animation. */ if (aSaveData->dragOver) { _XmDragOverHide (aSaveData->dragOver, aSaveData->windowX, aSaveData->windowY, aSaveData->clipRegion); } /* * Copy any saved segments back into the window. * Be sure GCRegion is set properly here. */ _XmRegionSetGCRegion (aSaveData->display, aSaveData->drawGC, 0, 0, aSaveData->clipRegion); for (pData = aSaveData->savedPixmaps, i = aSaveData->numSavedPixmaps; i; pData++, i--) { XCopyArea (aSaveData->display, pData->pixmap, aSaveData->window, aSaveData->drawGC, 0, 0, pData->width, pData->height, pData->x, pData->y); } /* * If dragging a pixmap or window, show it. * Free the XmAnimationSaveData structure created in AnimateEnter(). */ if (aSaveData->dragOver) { _XmDragOverShow (aSaveData->dragOver, aSaveData->windowX, aSaveData->windowY, aSaveData->clipRegion); } FreeAnimationData (aSaveData); *((XtPointer *) aData->saveAddr) = (XtPointer) NULL; } } /***************************************************************************** * * _XmDragUnderAnimation () * ***************************************************************************/ void _XmDragUnderAnimation( Widget w, XtPointer clientData, XtPointer callData ) { XmDropSiteManagerObject dsm = (XmDropSiteManagerObject) w; XmDragProcCallbackStruct *dpcb = (XmDragProcCallbackStruct *) callData; XmAnimationData aData = (XmAnimationData) clientData; switch(dpcb->reason) { case XmCR_DROP_SITE_LEAVE_MESSAGE: AnimateLeave(dsm, aData, dpcb); break; case XmCR_DROP_SITE_ENTER_MESSAGE: AnimateEnter(dsm, aData, dpcb); break; default: break; } } motif-2.3.8/lib/Xm/CascadeBG.h0000644000175000017500000000473413145162623012635 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCascadeBG_h #define _XmCascadeBG_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmCascadeButtonGadgetClass; typedef struct _XmCascadeButtonGadgetClassRec * XmCascadeButtonGadgetClass; typedef struct _XmCascadeButtonGadgetRec * XmCascadeButtonGadget; typedef struct _XmCascadeButtonGCacheObjRec * XmCascadeButtonGCacheObject; /*fast subclass define */ #ifndef XmIsCascadeButtonGadget #define XmIsCascadeButtonGadget(w) XtIsSubclass(w, xmCascadeButtonGadgetClass) #endif /* XmIsCascadeButtonGadget */ /******** Public Function Declarations ********/ extern Widget XmCreateCascadeButtonGadget( Widget parent, char *name, ArgList al, Cardinal ac) ; extern void XmCascadeButtonGadgetHighlight( Widget wid, #if NeedWidePrototypes int highlight) ; #else Boolean highlight) ; #endif /* NeedWidePrototypes */ /* * Variable argument list functions */ extern Widget XmVaCreateCascadeButtonGadget( Widget parent, char *name, ...); extern Widget XmVaCreateManagedCascadeButtonGadget( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCascadeBG_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MessageB.h0000644000175000017500000000714313145162623012564 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMessage_h #define _XmMessage_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmMessageBoxWidgetClass; typedef struct _XmMessageBoxClassRec * XmMessageBoxWidgetClass; typedef struct _XmMessageBoxRec * XmMessageBoxWidget; /* fast XtIsSubclass define */ #ifndef XmIsMessageBox #define XmIsMessageBox(w) XtIsSubclass (w, xmMessageBoxWidgetClass) #endif /******** Public Function Declarations ********/ extern Widget XmCreateMessageBox( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateMessageDialog( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateErrorDialog( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateInformationDialog( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateQuestionDialog( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateWarningDialog( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateWorkingDialog( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateTemplateDialog( Widget parent, char *name, ArgList al, Cardinal ac) ; extern Widget XmMessageBoxGetChild( Widget widget, #if NeedWidePrototypes unsigned int child) ; #else unsigned char child) ; #endif /* NeedWidePrototypes */ /* * Variable argument list functions */ extern Widget XmVaCreateMessageBox( Widget parent, char *name, ...); extern Widget XmVaCreateManagedMessageBox( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMessage_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CutPaste.h0000644000175000017500000001355213145162623012627 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCutPaste_h #define _XmCutPaste_h #include #ifdef __cplusplus extern "C" { #endif /* XmClipboard return status definitions */ typedef enum { XmClipboardFail = 0, XmClipboardSuccess = 1, XmClipboardTruncate = 2, XmClipboardLocked = 4, XmClipboardBadFormat = 5, XmClipboardNoData = 6 } XmClipboardStatus; /* XmClipboard pre-1.2 definitions */ #define ClipboardFail 0 #define ClipboardSuccess 1 #define ClipboardTruncate 2 #define ClipboardLocked 4 #define ClipboardBadFormat 5 #define ClipboardNoData 6 typedef struct { long DataId; long PrivateId; } XmClipboardPendingRec, *XmClipboardPendingList; typedef void (*XmCutPasteProc)( Widget w, long * data_id, long * private_id, int * reason) ; typedef void (*VoidProc)( Widget w, int * data_id, int * private_id, int * reason) ; /******** Public Function Declarations ********/ extern int XmClipboardBeginCopy( Display *display, Window window, XmString label, Widget widget, VoidProc callback, long *itemid) ; extern int XmClipboardStartCopy( Display *display, Window window, XmString label, Time timestamp, Widget widget, XmCutPasteProc callback, long *itemid) ; extern int XmClipboardCopy( Display *display, Window window, long itemid, char *format, XtPointer buffer, unsigned long length, long private_id, long *dataid) ; extern int XmClipboardEndCopy( Display *display, Window window, long itemid) ; extern int XmClipboardCancelCopy( Display *display, Window window, long itemid) ; extern int XmClipboardWithdrawFormat( Display *display, Window window, long data) ; extern int XmClipboardCopyByName( Display *display, Window window, long data, XtPointer buffer, unsigned long length, long private_id) ; extern int XmClipboardUndoCopy( Display *display, Window window) ; extern int XmClipboardLock( Display *display, Window window) ; extern int XmClipboardUnlock( Display *display, Window window, #if NeedWidePrototypes int all_levels) ; #else Boolean all_levels) ; #endif /* NeedWidePrototypes */ extern int XmClipboardStartRetrieve( Display *display, Window window, Time timestamp) ; extern int XmClipboardEndRetrieve( Display *display, Window window) ; extern int XmClipboardRetrieve( Display *display, Window window, char *format, XtPointer buffer, unsigned long length, unsigned long *outlength, long *private_id) ; extern int XmClipboardInquireCount( Display *display, Window window, int *count, unsigned long *maxlength) ; extern int XmClipboardInquireFormat( Display *display, Window window, int n, XtPointer buffer, unsigned long bufferlength, unsigned long *outlength) ; extern int XmClipboardInquireLength( Display *display, Window window, char *format, unsigned long *length) ; extern int XmClipboardInquirePendingItems( Display *display, Window window, char *format, XmClipboardPendingList *list, unsigned long *count) ; extern int XmClipboardRegisterFormat( Display *display, char *format_name, int format_length) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCutPaste_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/VendorS.h0000644000175000017500000000323113145162623012450 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmVendorS_h #define _XmVendorS_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsVendorShell #define XmIsVendorShell(w) XtIsSubclass(w, vendorShellWidgetClass) #endif /* XmIsVendorShell */ typedef struct _XmVendorShellRec *XmVendorShellWidget; typedef struct _XmVendorShellClassRec *XmVendorShellWidgetClass; externalref WidgetClass vendorShellWidgetClass; /******** Public Function Declarations ********/ extern Boolean XmIsMotifWMRunning( Widget shell) ; extern Widget XmToolTipGetLabel(Widget wid); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVendorS_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/MainWP.h0000644000175000017500000000570113145162623012227 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMainWindowP_h #define _XmMainWindowP_h #include #include #include #ifdef __cplusplus extern "C" { #endif #define DEFAULT_HEIGHT 20 #define DEFAULT_WIDTH 20 /* Constraint part record for MainWindow widget */ typedef struct _XmMainWindowConstraintPart { char unused; } XmMainWindowConstraintPart, * XmMainWindowConstraint; /* New fields for the MainWindow widget class record */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmMainWindowClassPart; /**************** * * Class record declaration * ****************/ typedef struct _XmMainWindowClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmScrolledWindowClassPart swindow_class; XmMainWindowClassPart mwindow_class; } XmMainWindowClassRec; externalref XmMainWindowClassRec xmMainWindowClassRec; /**************** * * Main Window instance structure. * ****************/ typedef struct { Dimension AreaWidth,AreaHeight; Dimension margin_width,margin_height; Widget CommandWindow; Widget MenuBar; Widget Message; unsigned char CommandLoc; XmSeparatorGadget Sep1,Sep2,Sep3; Boolean ManagingSep; Boolean ShowSep; } XmMainWindowPart; /************************************************************************ * * * Full instance record declaration * * * ************************************************************************/ typedef struct _XmMainWindowRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmScrolledWindowPart swindow; XmMainWindowPart mwindow; } XmMainWindowRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMainWindowP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/IconG.h0000644000175000017500000000412112672140200012055 00000000000000/* $XConsortium: IconG.h /main/5 1995/07/15 20:52:04 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmIconG_h #define _XmIconG_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ extern WidgetClass xmIconGadgetClass; typedef struct _XmIconGadgetClassRec * XmIconGadgetClass; typedef struct _XmIconGadgetRec * XmIconGadget; #ifndef XmIsIconGadget #define XmIsIconGadget(w) XtIsSubclass(w, xmIconGadgetClass) #endif /* XmIsIconGadget */ /******** Public Function Declarations ********/ extern Widget XmCreateIconGadget( Widget parent, String name, ArgList arglist, Cardinal argcount) ; extern Widget XmVaCreateIconGadget( Widget parent, char *name, ...); extern Widget XmVaCreateManagedIconGadget( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmIconG_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextOutI.h0000644000175000017500000000702513145162623012622 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmTextOutI_h #define _XmTextOutI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmTextFreeContextData( Widget w, XtPointer clientData, XtPointer callData) ; extern void _XmTextResetClipOrigin( XmTextWidget tw, XmTextPosition position, #if NeedWidePrototypes int clip_mask_reset) ; #else Boolean clip_mask_reset) ; #endif /* NeedWidePrototypes */ extern void _XmTextAdjustGC( XmTextWidget tw) ; extern Boolean _XmTextShouldWordWrap( XmTextWidget widget) ; extern Boolean _XmTextScrollable( XmTextWidget widget) ; extern XmTextPosition _XmTextFindLineEnd( XmTextWidget widget, XmTextPosition position, LineTableExtra *extra) ; extern void _XmTextOutputGetSecResData( XmSecondaryResourceData *secResDataRtn) ; extern int _XmTextGetNumberLines( XmTextWidget widget) ; extern void _XmTextMovingCursorPosition( XmTextWidget tw, XmTextPosition position) ; extern void _XmTextChangeBlinkBehavior( XmTextWidget widget, #if NeedWidePrototypes int newvalue) ; #else Boolean newvalue) ; #endif /* NeedWidePrototypes */ extern void _XmTextOutputCreate( Widget wid, ArgList args, Cardinal num_args) ; extern Boolean _XmTextGetBaselines( Widget widget, Dimension **baselines, int *line_count) ; extern Boolean _XmTextGetDisplayRect( Widget w, XRectangle *display_rect) ; extern void _XmTextMarginsProc( Widget w, XmBaselineMargins *margins_rec) ; extern void _XmTextChangeHOffset( XmTextWidget widget, int length) ; extern void _XmTextChangeVOffset( XmTextWidget widget, int length) ; extern void _XmTextToggleCursorGC( Widget widget) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextOutI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XmP.h0000644000175000017500000013555013150700346011602 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /************************************<+>************************************* **************************************************************************** ** ** File: XmP.h ** ** Description: This include file contains the class and instance record ** definitions for all meta classes. It also contains externs ** for internally shared functions and defines for internally ** shared values. ** **************************************************************************** ************************************<+>*************************************/ #ifndef _XmP_h #define _XmP_h #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /*************************************************************************** * * Macros replacing toolkit macros so that gadgets are handled properly. * ***************************************************************************/ /* Temporary hack until we can clean up our own code. ??? */ #ifndef NO_XM_1_2_XTMACROS #define XM_1_2_XTMACROS 1 #endif #ifdef XM_1_2_XTMACROS /* XtClass is a macro in IntrinsicP.h, but it does no casting so removing this one would certainly generate warnings everywhere, we can keep it */ #ifdef XtClass #undef XtClass #endif #define XtClass(widget) (((Object)(widget))->object.widget_class) /* Exist in IntrinsicP.h, but does no casting, so removing this one will probably generate a lot of warnings */ #ifdef XtParent #undef XtParent #endif #define XtParent(widget) (((Object)(widget))->object.parent) /* The following routines exist in Xt, but do not accept Gadgets. */ #ifdef XtDisplay #undef XtDisplay #endif #define XtDisplay(widget) XtDisplayOfObject((Widget) widget) #ifdef XtScreen #undef XtScreen #endif #define XtScreen(widget) XtScreenOfObject((Widget) widget) #ifdef XtWindow #undef XtWindow #endif #define XtWindow(widget) XtWindowOfObject((Widget) widget) /* The following macros are not provided by Xt */ #define XtX(w) ((w)->core.x) #define XtY(w) ((w)->core.y) #define XtWidth(w) ((w)->core.width) #define XtHeight(w) ((w)->core.height) #define XtBorderWidth(w) ((w)->core.border_width) #define XtBackground(w) ((w)->core.background_pixel) #define XtCoreProc(w,proc) ((w)->core.widget_class->core_class.proc) #endif /* XM_1_2_XTMACROS */ /*********************************************************************** * * Miscellaneous SemiPrivate Defines * ***********************************************************************/ /* new for the initialized gadget checking */ #define XmNdotCache ".cache" #define XmCDotCache ".Cache" #define XmDELAYED_PIXMAP (XmUNSPECIFIED_PIXMAP - 1) #define XmUNSPECIFIED (~0) #define XmUNSPECIFIED_COUNT (~0) /* Used by conversion routine in ResConvert.c, RepType.c, IconG.c, etc */ #define _XM_CONVERTER_DONE( to_rtn, type, value, failure ) \ { \ static type buf ; \ \ if (to_rtn->addr) \ { \ if (to_rtn->size < sizeof(type)) \ { \ failure \ to_rtn->size = sizeof(type); \ return FALSE; \ } \ else \ { \ *((type *) (to_rtn->addr)) = value; \ } \ } \ else \ { \ buf = value; \ to_rtn->addr = (XPointer) &buf; \ } \ to_rtn->size = sizeof(type); \ return TRUE; \ } /* defines needed for 3D visual enhancement of defaultButtonshadow and * implementation of ToggleButton Indicatorsize. **/ #define Xm3D_ENHANCE_PIXEL 2 #define XmINDICATOR_SHADOW_THICKNESS 2 #define XmINVALID_DIMENSION 0xFFFF /*********************************************************************** * * Const stuff * ***********************************************************************/ #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ /*********************************************************************** * * Status for menus * ***********************************************************************/ /* Defines used for menu/button communication */ enum{ XmMENU_POPDOWN, XmMENU_PROCESS_TREE, XmMENU_TRAVERSAL, XmMENU_SHELL_POPDOWN, XmMENU_CALLBACK, XmMENU_BUTTON, XmMENU_CASCADING, XmMENU_SUBMENU, XmMENU_ARM, XmMENU_DISARM, XmMENU_BAR_CLEANUP, XmMENU_STATUS, XmMENU_MEMWIDGET_UPDATE, XmMENU_BUTTON_POPDOWN, XmMENU_RESTORE_EXCLUDED_TEAROFF_TO_TOPLEVEL_SHELL, XmMENU_RESTORE_TEAROFF_TO_TOPLEVEL_SHELL, XmMENU_RESTORE_TEAROFF_TO_MENUSHELL, XmMENU_GET_LAST_SELECT_TOPLEVEL, XmMENU_TEAR_OFF_ARM } ; #define XmMENU_TORN_BIT (1 << 0) #define XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT (1 << 1) #define XmMENU_POPUP_POSTED_BIT (1 << 2) #define XmMENU_IN_DRAG_MODE_BIT (1 << 3) #define XmIsTorn(mask) \ (mask & XmMENU_TORN_BIT) #define XmIsTearOffShellDescendant(mask) \ (mask & XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT) #define XmPopupPosted(mask) \ (mask & XmMENU_POPUP_POSTED_BIT) #define XmIsInDragMode(mask) \ (mask & XmMENU_IN_DRAG_MODE_BIT) typedef void (*XmMenuProc)( int, Widget, ...) ; /*********************************************************************** * * Simple Menu Structure * ***********************************************************************/ typedef struct _XmSimpleMenuRec { int count; int post_from_button; XtCallbackProc callback; XmStringTable label_string; String *accelerator; XmStringTable accelerator_text; XmKeySymTable mnemonic; XmStringCharSetTable mnemonic_charset; XmButtonTypeTable button_type; int button_set; XmString option_label; KeySym option_mnemonic; } XmSimpleMenuRec, * XmSimpleMenu; /* For MapEvent: _XmMatchBtnEvent */ #define XmIGNORE_EVENTTYPE -1 /* Default minimum Toggle indicator dimension */ #define XmDEFAULT_INDICATOR_DIM 9 /************************************************************************ * * SyntheticP.h * ************************************************************************/ typedef enum{ XmSYNTHETIC_NONE, XmSYNTHETIC_LOAD } XmImportOperator ; typedef void (*XmExportProc)( Widget, int, XtArgVal *) ; typedef XmImportOperator (*XmImportProc)( Widget, int, XtArgVal *) ; typedef struct _XmSyntheticResource { String resource_name; Cardinal resource_size; Cardinal resource_offset; XmExportProc export_proc; XmImportProc import_proc; } XmSyntheticResource; /*********************************************************************** * * ParProcP.h * ***********************************************************************/ typedef struct { int process_type ; /* Common to all parent process records. */ } XmParentProcessAnyRec ; typedef struct { int process_type ; /* Common to all parent process records. */ XEvent * event ; int action ; String * params ; Cardinal * num_params ; } XmParentInputActionRec ; typedef union { XmParentProcessAnyRec any ; XmParentInputActionRec input_action ; } XmParentProcessDataRec, * XmParentProcessData ; enum{ XmPARENT_PROCESS_ANY, XmINPUT_ACTION } ; enum{ XmPARENT_ACTIVATE, XmPARENT_CANCEL } ; #define XmRETURN XmPARENT_ACTIVATE /* For Motif 1.1 BC. */ #define XmCANCEL XmPARENT_CANCEL /* For Motif 1.1 BC. */ /*********************************************************************** * * BaselineP.h * ***********************************************************************/ enum{ XmBASELINE_GET, XmBASELINE_SET } ; typedef struct _XmBaselineMargins { unsigned char get_or_set; Dimension margin_top; Dimension margin_bottom; Dimension shadow; Dimension highlight; Dimension text_height; Dimension margin_height; } XmBaselineMargins; typedef enum{ XmFOCUS_IN, XmFOCUS_OUT, XmENTER, XmLEAVE } XmFocusChange ; typedef enum{ XmNOT_NAVIGABLE, XmCONTROL_NAVIGABLE, XmTAB_NAVIGABLE, XmDESCENDANTS_NAVIGABLE, XmDESCENDANTS_TAB_NAVIGABLE } XmNavigability ; /*********************************************************************** * * Various proc types * ***********************************************************************/ #define XmVoidProc XtProc typedef Boolean (*XmParentProcessProc)( Widget, XmParentProcessData) ; typedef void (*XmWidgetDispatchProc)( Widget, XEvent *, Mask) ; typedef void (*XmGrabShellPopupProc)( Widget, Widget, XEvent *) ; typedef void (*XmMenuPopupProc)( Widget, Widget, XEvent *) ; typedef void (*XmMenuTraversalProc)( Widget, Widget, XmTraversalDirection) ; typedef void (*XmResizeFlagProc)( Widget, #if NeedWidePrototypes int) ; #else Boolean) ; #endif /* NeedWidePrototypes */ typedef void (*XmRealizeOutProc)( Widget, Mask *, XSetWindowAttributes *) ; typedef Boolean (*XmVisualChangeProc)( Widget, Widget, Widget) ; typedef void (*XmTraversalProc)( Widget, XtPointer, XtPointer, int) ; typedef void (*XmFocusMovedProc)( Widget, XtPointer, XtPointer) ; typedef void (*XmCacheCopyProc)( XtPointer, XtPointer, size_t) ; typedef void (*XmGadgetCacheProc)( XtPointer) ; typedef int (*XmCacheCompareProc)( XtPointer, XtPointer) ; typedef Boolean (*XmWidgetBaselineProc)(Widget, Dimension **, int *); typedef Boolean (*XmWidgetDisplayRectProc)(Widget, XRectangle *); typedef void (*XmWidgetMarginsProc)(Widget, XmBaselineMargins *); typedef XmNavigability (*XmWidgetNavigableProc)( Widget) ; typedef void (*XmFocusChangeProc)(Widget, XmFocusChange); typedef Boolean (*XmSpatialPlacementProc)(Widget, Widget, unsigned char); typedef Boolean (*XmSpatialRemoveProc)(Widget, Widget); typedef Boolean (*XmSpatialTestFitProc)(Widget, Widget, Position, Position); /**************** * * Data structure for building a real translation table out of a * virtual string. * ****************/ typedef struct { Modifiers mod; char *key; char *action; } _XmBuildVirtualKeyStruct; typedef struct _XmKeyBindingRec { KeySym keysym; Modifiers modifiers; } XmKeyBindingRec, *XmKeyBinding; /*********************************************************************** * * Types shared by text widgets * ***********************************************************************/ typedef enum { XmsdLeft, XmsdRight } XmTextScanDirection; /* * This struct is for support of Insert Selection targets. */ typedef struct { Atom selection; Atom target; } _XmTextInsertPair; typedef struct { XmTextPosition position; /* Starting position. */ XmHighlightMode mode; /* Highlighting mode for this position. */ } _XmHighlightRec; typedef struct { Cardinal number; /* Number of different highlight areas. */ Cardinal maximum; /* Number we've allocated space for. */ _XmHighlightRec *list; /* Pointer to array of highlight data. */ } _XmHighlightData; typedef enum { XmDEST_SELECT, XmPRIM_SELECT } XmSelectType; typedef struct { Boolean done_status; /* completion status of insert selection */ Boolean success_status; /* success status of insert selection */ XmSelectType select_type; /* insert selection type */ XSelectionRequestEvent *event; /* event that initiated the insert selection */ } _XmInsertSelect; typedef struct { XEvent *event; String *params; Cardinal *num_params; } _XmTextActionRec; typedef struct { Widget widget; XmTextPosition insert_pos; int num_chars; Time timestamp; Boolean move; } _XmTextDropTransferRec; typedef struct { XmTextPosition position; Atom target; Time time; int num_chars; int ref_count; } _XmTextPrimSelect; typedef struct { Screen *screen; XContext context; unsigned char type; } XmTextContextDataRec, *XmTextContextData; enum {_XM_IS_DEST_CTX, _XM_IS_GC_DATA_CTX, _XM_IS_PIXMAP_CTX}; #define XmTEXT_DRAG_ICON_WIDTH 64 #define XmTEXT_DRAG_ICON_HEIGHT 64 #define XmTEXT_DRAG_ICON_X_HOT 10 #define XmTEXT_DRAG_ICON_Y_HOT 4 /*********************************************************************** * * GeoUtilsP.h * ***********************************************************************/ /* Defines used by geometry manager utilities */ enum{ XmGET_ACTUAL_SIZE = 1, XmGET_PREFERRED_SIZE, XmGEO_PRE_SET, XmGEO_POST_SET } ; /* Defaults for Geometry Utility defines are always 0. */ enum{ XmGEO_EXPAND, XmGEO_CENTER, XmGEO_PACK } ; enum{ XmGEO_PROPORTIONAL, XmGEO_AVERAGING, XmGEO_WRAP } ; enum{ XmGEO_ROW_MAJOR, XmGEO_COLUMN_MAJOR } ; /* XmGEO_COLUMN_MAJOR is not yet supported. */ typedef struct _XmGeoMatrixRec *XmGeoMatrix ; typedef union _XmGeoMajorLayoutRec *XmGeoMajorLayout ; typedef struct _XmKidGeometryRec { Widget kid; /* ptr to kid */ XtWidgetGeometry box; /* kid geo box */ } XmKidGeometryRec, *XmKidGeometry; typedef void (*XmGeoArrangeProc)( XmGeoMatrix, #if NeedWidePrototypes int, int, #else Position, Position, #endif /* NeedWidePrototypes */ Dimension *, Dimension *) ; typedef Boolean (*XmGeoExceptProc)( XmGeoMatrix ) ; typedef void (*XmGeoExtDestructorProc)( XtPointer ) ; typedef void (*XmGeoSegmentFixUpProc)( XmGeoMatrix, int, XmGeoMajorLayout, XmKidGeometry) ; typedef struct { Boolean end ; /* Flag to mark end of rows. */ XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts. */ Dimension even_width ; /* If non-zero, set all boxes to same width.*/ Dimension even_height ;/* If non-zero, set all boxes to same height*/ Dimension min_height ; /* Minimum height, if stretch_height TRUE. */ Boolean stretch_height ;/* Stretch height to fill vertically. */ Boolean uniform_border ;/* Enforce on all kids this row, dflt F. */ Dimension border ; /* Value to use if uniform_border set. */ unsigned char fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/ /* or XmGEO_EXPAND (default). */ unsigned char fit_mode ; /* Method for fitting boxes into space, */ /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/ Boolean sticky_end ; /* Last box in row sticks to edge, dflt F. */ Dimension space_above ; /* Between-line spacing, default 0. */ Dimension space_end ; /* End spacing (XmGEO_CENTER), default 0. */ Dimension space_between ; /* Internal spacing, default 0. */ Dimension max_box_height ;/* Set during arrange routine. */ Dimension boxes_width ; /* Set during arrange routine. */ Dimension fill_width ; /* Set during arrange routine. */ Dimension box_count ; /* Set during arrange routine. */ } XmGeoRowLayoutRec, *XmGeoRowLayout ; typedef struct { Boolean end ; /* Flag to mark end of columns. */ XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts. */ Dimension even_height ;/* If non-zero, set all boxes to same height*/ Dimension even_width ; /* If non-zero, set all boxes to same width.*/ Dimension min_width ; /* Minimum width, if stretch_width TRUE. */ Boolean stretch_width ;/* Stretch width to fill horizontally. */ Boolean uniform_border ;/* Enforce on all kids this row, dflt F. */ Dimension border ; /* Value to use if uniform_border set. */ unsigned char fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/ /* or XmGEO_EXPAND (default). */ unsigned char fit_mode ; /* Method for fitting boxes into space, */ /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/ Boolean sticky_end ; /* Last box in row sticks to edge, dflt F. */ Dimension space_left ; /* Between-column spacing, default 0. */ Dimension space_end ; /* End spacing (XmGEO_CENTER), default 0. */ Dimension space_between ; /* Internal spacing, default 0. */ Dimension max_box_width ; /* Set during arrange routine. */ Dimension boxes_height ; /* Set during arrange routine. */ Dimension fill_height ; /* Set during arrange routine. */ Dimension box_count ; /* Set during arrange routine. */ } XmGeoColumnLayoutRec, *XmGeoColumnLayout ; typedef union _XmGeoMajorLayoutRec { XmGeoRowLayoutRec row ; XmGeoColumnLayoutRec col ; } XmGeoMajorLayoutRec ; typedef struct _XmGeoMatrixRec { Widget composite ; /* Widget managing layout. */ Widget instigator ; /* Widget initiating re-layout. */ XtWidgetGeometry instig_request ;/* Geometry layout request of instigatr.*/ XtWidgetGeometry parent_request ;/* Subsequent layout request to parent. */ XtWidgetGeometry *in_layout ; /* Geo. of instig. in layout (after Get).*/ XmKidGeometry boxes ;/* Array of boxes, lines separated by NULL record.*/ XmGeoMajorLayout layouts ; /* Array of major_order format info. */ Dimension margin_w ;/*Sum of margin, highlight, & shadow thickness.*/ Dimension margin_h ;/*Sum of margin, highlight, & shadow thickness.*/ Boolean stretch_boxes ; /* Set during arrange routine. */ Boolean uniform_border ;/* Enforce on all kids, default FALSE. */ Dimension border ; /* Value to use if uniform_border TRUE. */ Dimension max_major ; /* Set during arrange routine. */ Dimension boxes_minor ; /* Set during arrange routine. */ Dimension fill_minor ; /* Set during arrange routine. */ Dimension width ; /* Set during arrange routine. */ Dimension height ; /* Set during arrange routine. */ XmGeoExceptProc set_except ; XmGeoExceptProc almost_except ; XmGeoExceptProc no_geo_request ; XtPointer extension ; XmGeoExtDestructorProc ext_destructor ; XmGeoArrangeProc arrange_boxes ;/* For user-defined arrangement routine. */ unsigned char major_order ; } XmGeoMatrixRec; typedef XmGeoMatrix (*XmGeoCreateProc)( Widget, Widget, XtWidgetGeometry *) ; /*********************************************************************** * * XmInheritP.h * ***********************************************************************/ #define XmInheritCallbackProc ((XtCallbackProc) _XtInherit) #define XmInheritTraversalProc ((XmTraversalProc) _XtInherit) #define XmInheritParentProcess ((XmParentProcessProc) _XtInherit) #define XmInheritWidgetProc ((XtWidgetProc) _XtInherit) #define XmInheritMenuProc ((XmMenuProc) _XtInherit) #define XmInheritTranslations XtInheritTranslations #define XmInheritCachePart ((XmCacheClassPartPtr) _XtInherit) #define XmInheritBaselineProc ((XmWidgetBaselineProc) _XtInherit) #define XmInheritDisplayRectProc ((XmWidgetDisplayRectProc) _XtInherit) #define XmInheritMarginsProc ((XmWidgetMarginsProc) _XtInherit) #define XmInheritGeoMatrixCreate ((XmGeoCreateProc) _XtInherit) #define XmInheritFocusMovedProc ((XmFocusMovedProc) _XtInherit) #define XmInheritClass ((WidgetClass) &_XmInheritClass) #define XmInheritInitializePrehook ((XtInitProc) _XtInherit) #define XmInheritSetValuesPrehook ((XtSetValuesFunc) _XtInherit) #define XmInheritGetValuesPrehook ((XtArgsProc) _XtInherit) #define XmInheritInitializePosthook ((XtInitProc) _XtInherit) #define XmInheritSetValuesPosthook ((XtSetValuesFunc) _XtInherit) #define XmInheritGetValuesPosthook ((XtArgsProc) _XtInherit) #define XmInheritSecObjectCreate ((XtInitProc) _XtInherit) #define XmInheritGetSecResData ((XmGetSecResDataFunc) _XtInherit) #define XmInheritInputDispatch ((XmWidgetDispatchProc) _XtInherit) #define XmInheritVisualChange ((XmVisualChangeProc) _XtInherit) #define XmInheritArmAndActivate ((XtActionProc) _XtInherit) #define XmInheritActionProc ((XtActionProc) _XtInherit) #define XmInheritFocusChange ((XmFocusChangeProc) _XtInherit) #define XmInheritWidgetNavigable ((XmWidgetNavigableProc) _XtInherit) #define XmInheritClassPartInitPrehook ((XtWidgetClassProc) _XtInherit) #define XmInheritClassPartInitPosthook ((XtWidgetClassProc) _XtInherit) #define XmInheritBorderHighlight ((XtWidgetProc) _XtInherit) #define XmInheritBorderUnhighlight ((XtWidgetProc) _XtInherit) /************************************************************************ * * Fast subclassing macros and definitions * ************************************************************************/ /* WARNING: Application subclasses which choose to use fast * subclassing must use only those bits between * 192 (XmFIRST_APPLICATION_SUBCLASS_BIT) and 255. * All other fast subclass bits are reserved for * future use. Use of reserved fast subclass bits * will cause binary compatibility breaks with * future Motif versions. */ #define XmFIRST_APPLICATION_SUBCLASS_BIT 192 enum{ XmCASCADE_BUTTON_BIT = 1, XmCASCADE_BUTTON_GADGET_BIT, XmCOMMAND_BOX_BIT, XmDIALOG_SHELL_BIT, XmLIST_BIT, XmFORM_BIT, XmTEXT_FIELD_BIT, XmGADGET_BIT, XmLABEL_BIT, XmLABEL_GADGET_BIT, XmMAIN_WINDOW_BIT, XmMANAGER_BIT, XmMENU_SHELL_BIT, XmDRAWN_BUTTON_BIT, XmPRIMITIVE_BIT, XmPUSH_BUTTON_BIT, XmPUSH_BUTTON_GADGET_BIT, XmROW_COLUMN_BIT, XmSCROLL_BAR_BIT, XmSCROLLED_WINDOW_BIT, XmSELECTION_BOX_BIT, XmSEPARATOR_BIT, XmSEPARATOR_GADGET_BIT, XmTEXT_BIT, XmTOGGLE_BUTTON_BIT, XmTOGGLE_BUTTON_GADGET_BIT, XmDROP_TRANSFER_BIT, XmDROP_SITE_MANAGER_BIT, XmDISPLAY_BIT, XmSCREEN_BIT, XmPRINT_SHELL_BIT, XmARROW_BUTTON_BIT, XmARROW_BUTTON_GADGET_BIT, XmBULLETIN_BOARD_BIT, XmDRAWING_AREA_BIT, XmFILE_SELECTION_BOX_BIT, XmFRAME_BIT, XmMESSAGE_BOX_BIT, XmSASH_BIT, XmSCALE_BIT, XmPANED_WINDOW_BIT, XmVENDOR_SHELL_BIT, XmCLIP_WINDOW_BIT, XmDRAG_ICON_BIT, XmTEAROFF_BUTTON_BIT, XmDRAG_OVER_SHELL_BIT, XmDRAG_CONTEXT_BIT, XmCONTAINER_BIT, XmICONGADGET_BIT, XmNOTEBOOK_BIT, XmCSTEXT_BIT, XmGRAB_SHELL_BIT, XmCOMBO_BOX_BIT, XmSPINBOX_BIT, XmICONHEADER_BIT, XmBUTTONBOX_BIT, XmDATAFIELD_BIT, XmI18LIST_BIT, XmEXT18LIST_BIT, XmMULTI_LIST_BIT = XmEXT18LIST_BIT, XmCOLORSELECTOR_BIT, XmICONBOX_BIT, XmICONBUTTON_BIT, XmTABLE_BIT, XmTABSTACK_BIT, XmTREE_BIT, XmTABBOX_BIT, XmCOLUMN_BIT, XmFONTSELECTOR_BIT, XmCOMBINATION_BOX_2_BIT, XmDROP_DOWN_BIT = XmCOMBINATION_BOX_2_BIT, XmFAST_SUBCLASS_TAIL_BIT /* New entries precede this. */ } ; #define XmLAST_FAST_SUBCLASS_BIT (XmFAST_SUBCLASS_TAIL_BIT - 1) #undef XmIsCascadeButton #define XmIsCascadeButton(w) \ (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_BIT)) #undef XmIsCascadeButtonGadget #define XmIsCascadeButtonGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_GADGET_BIT)) #undef XmIsClipWindow #define XmIsClipWindow(w) \ (_XmIsFastSubclass(XtClass(w), XmCLIP_WINDOW_BIT)) #undef XmIsComboBox #define XmIsComboBox(w) \ (_XmIsFastSubclass(XtClass(w), XmCOMBO_BOX_BIT)) #undef XmIsCommandBox #define XmIsCommandBox(w) \ (_XmIsFastSubclass(XtClass(w), XmCOMMAND_BOX_BIT)) #undef XmIsContainer #define XmIsContainer(w) \ (_XmIsFastSubclass(XtClass(w), XmCONTAINER_BIT)) #undef XmIsDialogShell #define XmIsDialogShell(w) \ (_XmIsFastSubclass(XtClass(w), XmDIALOG_SHELL_BIT)) #undef XmIsDisplay #define XmIsDisplay(w) \ (_XmIsFastSubclass(XtClass(w), XmDISPLAY_BIT)) #undef XmIsGrabShell #define XmIsGrabShell(w) \ (_XmIsFastSubclass(XtClass(w), XmGRAB_SHELL_BIT)) #undef XmIsIconGadget #define XmIsIconGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmICONGADGET_BIT)) #undef XmIsList #define XmIsList(w) \ (_XmIsFastSubclass(XtClass(w), XmLIST_BIT)) #undef XmIsForm #define XmIsForm(w) \ (_XmIsFastSubclass(XtClass(w), XmFORM_BIT)) #undef XmIsTextField #define XmIsTextField(w) \ (_XmIsFastSubclass(XtClass(w), XmTEXT_FIELD_BIT)) #undef XmIsGadget #define XmIsGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmGADGET_BIT)) #undef XmIsLabel #define XmIsLabel(w) \ (_XmIsFastSubclass(XtClass(w), XmLABEL_BIT)) #undef XmIsLabelGadget #define XmIsLabelGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmLABEL_GADGET_BIT)) #undef XmIsMainWindow #define XmIsMainWindow(w) \ (_XmIsFastSubclass(XtClass(w), XmMAIN_WINDOW_BIT)) #undef XmIsManager #define XmIsManager(w) \ (_XmIsFastSubclass(XtClass(w), XmMANAGER_BIT)) #undef XmIsMenuShell #define XmIsMenuShell(w) \ (_XmIsFastSubclass(XtClass(w), XmMENU_SHELL_BIT)) #undef XmIsNotebook #define XmIsNotebook(w) \ (_XmIsFastSubclass(XtClass(w), XmNOTEBOOK_BIT)) #undef XmIsDragIcon #define XmIsDragIcon(w) \ (_XmIsFastSubclass(XtClass(w), XmDRAG_ICON_BIT)) #undef XmIsDropSiteManager #define XmIsDropSiteManager(w) \ (_XmIsFastSubclass(XtClass(w), XmDROP_SITE_MANAGER_BIT)) #undef XmIsDropTransfer #define XmIsDropTransfer(w) \ (_XmIsFastSubclass(XtClass(w), XmDROP_TRANSFER_BIT)) #undef XmIsDragOverShell #define XmIsDragOverShell(w) \ (_XmIsFastSubclass(XtClass(w), XmDRAG_OVER_SHELL_BIT)) #undef XmIsDragContext #define XmIsDragContext(w) \ (_XmIsFastSubclass(XtClass(w), XmDRAG_CONTEXT_BIT)) #undef XmIsDrawnButton #define XmIsDrawnButton(w) \ (_XmIsFastSubclass(XtClass(w), XmDRAWN_BUTTON_BIT)) #undef XmIsPrimitive #define XmIsPrimitive(w) \ (_XmIsFastSubclass(XtClass(w), XmPRIMITIVE_BIT)) #undef XmIsPushButton #define XmIsPushButton(w) \ (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_BIT)) #undef XmIsPushButtonGadget #define XmIsPushButtonGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_GADGET_BIT)) #undef XmIsRowColumn #define XmIsRowColumn(w) \ (_XmIsFastSubclass(XtClass(w), XmROW_COLUMN_BIT)) #undef XmIsScreen #define XmIsScreen(w) \ (_XmIsFastSubclass(XtClass(w), XmSCREEN_BIT)) #undef XmIsScrollBar #define XmIsScrollBar(w) \ (_XmIsFastSubclass(XtClass(w), XmSCROLL_BAR_BIT)) #undef XmIsScrolledWindow #define XmIsScrolledWindow(w) \ (_XmIsFastSubclass(XtClass(w), XmSCROLLED_WINDOW_BIT)) #undef XmIsSelectionBox #define XmIsSelectionBox(w) \ (_XmIsFastSubclass(XtClass(w), XmSELECTION_BOX_BIT)) #undef XmIsSeparator #define XmIsSeparator(w) \ (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_BIT)) #undef XmIsSeparatorGadget #define XmIsSeparatorGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_GADGET_BIT)) #undef XmIsSpinButton #define XmIsSpinButton(w) \ (_XmIsFastSubclass(XtClass(w), XmSPINBUTTON_BIT)) #undef XmIsText #define XmIsText(w) \ (_XmIsFastSubclass(XtClass(w), XmTEXT_BIT)) #undef XmIsTearOffButton #define XmIsTearOffButton(w) \ (_XmIsFastSubclass(XtClass(w), XmTEAROFF_BUTTON_BIT)) #undef XmIsToggleButton #define XmIsToggleButton(w) \ (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_BIT)) #undef XmIsToggleButtonGadget #define XmIsToggleButtonGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_GADGET_BIT)) #undef XmIsPrintShell #define XmIsPrintShell(w) \ (_XmIsFastSubclass(XtClass(w), XmPRINT_SHELL_BIT)) #undef XmIsArrowButton #define XmIsArrowButton(w) \ (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_BIT)) #undef XmIsArrowButtonGadget #define XmIsArrowButtonGadget(w) \ (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_GADGET_BIT)) #undef XmIsBulletinBoard #define XmIsBulletinBoard(w) \ (_XmIsFastSubclass(XtClass(w), XmBULLETIN_BOARD_BIT)) #undef XmIsDrawingArea #define XmIsDrawingArea(w) \ (_XmIsFastSubclass(XtClass(w), XmDRAWING_AREA_BIT)) #undef XmIsFileSelectionBox #define XmIsFileSelectionBox(w) \ (_XmIsFastSubclass(XtClass(w), XmFILE_SELECTION_BOX_BIT)) #undef XmIsFrame #define XmIsFrame(w) \ (_XmIsFastSubclass(XtClass(w), XmFRAME_BIT)) #undef XmIsMessageBox #define XmIsMessageBox(w) \ (_XmIsFastSubclass(XtClass(w), XmMESSAGE_BOX_BIT)) #undef XmIsSash #define XmIsSash(w) \ (_XmIsFastSubclass(XtClass(w), XmSASH_BIT)) #undef XmIsScale #define XmIsScale(w) \ (_XmIsFastSubclass(XtClass(w), XmSCALE_BIT)) #undef XmIsPanedWindow #define XmIsPanedWindow(w) \ (_XmIsFastSubclass(XtClass(w), XmPANED_WINDOW_BIT)) #undef XmIsCSText #define XmIsCSText(w) \ (_XmIsFastSubclass(XtClass(w), XmCSTEXT_BIT)) #undef XmIsCombinationBox2 #define XmIsCombinationBox2(w) \ (_XmIsFastSubclass(XtClass(w), XmCOMBINATION_BOX_2_BIT)) #undef XmIsDropDown #define XmIsDropDown(w) \ (_XmIsFastSubclass(XtClass(w), XmDROP_DOWN_BIT)) #undef XmIsExt18List #define XmIsExt18List(w) \ (_XmIsFastSubclass(XtClass(w), XmEXT18LIST_BIT)) #undef XmIsMultiList #define XmIsMultiList(w) \ (_XmIsFastSubclass(XtClass(w), XmMULTI_LIST_BIT)) /************************************************************************ * * ResolveP.h * ************************************************************************/ /* Widget class indices used with XmPartOffset and XmField macros */ #define XmObjectIndex 0 #define ObjectIndex XmObjectIndex #define XmRectObjIndex (XmObjectIndex + 1) #define RectObjIndex XmRectObjIndex #define XmWindowObjIndex (XmRectObjIndex + 1) #define WindowObjIndex XmWindowObjIndex #define XmCoreIndex 0 #define CoreIndex XmCoreIndex #define XmCompositeIndex (XmWindowObjIndex + 2) #define CompositeIndex XmCompositeIndex #define XmConstraintIndex (XmCompositeIndex + 1) #define ConstraintIndex XmConstraintIndex #define XmGadgetIndex (XmRectObjIndex + 1) #define XmPrimitiveIndex (XmWindowObjIndex + 2) #define XmManagerIndex (XmConstraintIndex + 1) #define XmArrowBIndex (XmPrimitiveIndex + 1) #define XmArrowButtonIndex XmArrowBIndex #define XmLabelIndex (XmPrimitiveIndex + 1) #define XmListIndex (XmPrimitiveIndex + 1) #define XmScrollBarIndex (XmPrimitiveIndex + 1) #define XmSeparatorIndex (XmPrimitiveIndex + 1) #define XmTextIndex (XmPrimitiveIndex + 1) #define XmTextFieldIndex (XmPrimitiveIndex + 1) #define XmCSTextIndex (XmPrimitiveIndex + 1) #define XmCascadeBIndex (XmLabelIndex + 1) #define XmCascadeButtonIndex XmCascadeBIndex #define XmDrawnBIndex (XmLabelIndex + 1) #define XmDrawnButtonIndex XmDrawnBIndex #define XmPushBIndex (XmLabelIndex + 1) #define XmPushButtonIndex XmPushBIndex #define XmToggleBIndex (XmLabelIndex + 1) #define XmToggleButtonIndex XmToggleBIndex #define XmTearOffButtonIndex (XmPushBIndex + 1) #define XmArrowBGIndex (XmGadgetIndex + 1) #define XmArrowButtonGadgetIndex XmArrowBGIndex #define XmLabelGIndex (XmGadgetIndex + 1) #define XmLabelGadgetIndex XmLabelGIndex #define XmSeparatoGIndex (XmGadgetIndex + 1) #define XmSeparatorGadgetIndex XmSeparatoGIndex #define XmCascadeBGIndex (XmLabelGIndex + 1) #define XmCascadeButtonGadgetIndex XmCascadeBGIndex #define XmPushBGIndex (XmLabelGIndex + 1) #define XmPushButtonGadgetIndex XmPushBGIndex #define XmToggleBGIndex (XmLabelGIndex + 1) #define XmToggleButtonGadgetIndex XmToggleBGIndex #define XmIconGadgetIndex (XmGadgetIndex + 1) #define XmBulletinBIndex (XmManagerIndex + 1) #define XmBulletinBoardIndex XmBulletinBIndex #define XmDrawingAIndex (XmManagerIndex + 1) #define XmDrawingAreaIndex XmDrawingAIndex #define XmClipWindowIndex (XmDrawingAIndex + 1) #define XmFrameIndex (XmManagerIndex + 1) #define XmPanedWIndex (XmManagerIndex + 1) #define XmPanedWindowIndex XmPanedWIndex #define XmSashIndex (XmPrimitiveIndex + 1) #define XmRowColumnIndex (XmManagerIndex + 1) #define XmScaleIndex (XmManagerIndex + 1) #define XmScrolledWIndex (XmManagerIndex + 1) #define XmScrolledWindowIndex XmScrolledWIndex #define XmFormIndex (XmBulletinBIndex + 1) #define XmMessageBIndex (XmBulletinBIndex + 1) #define XmMessageBoxIndex XmMessageBIndex #define XmSelectioBIndex (XmBulletinBIndex + 1) #define XmSelectionBoxIndex XmSelectioBIndex #define XmMainWIndex (XmScrolledWIndex + 1) #define XmMainWindowIndex XmMainWIndex #define XmCommandIndex (XmSelectioBIndex + 1) #define XmFileSBIndex (XmSelectioBIndex + 1) #define XmFileSelectionBoxIndex XmFileSBIndex #define XmShellIndex (XmCompositeIndex + 1) #define ShellIndex XmShellIndex #define XmOverrideShellIndex (XmShellIndex + 1) #define OverrideShellIndex XmOverrideShellIndex #define XmWMShellIndex (XmShellIndex + 1) #define WMShellIndex XmWMShellIndex #define XmVendorShellIndex (XmWMShellIndex + 1) #define VendorShellIndex XmVendorShellIndex #define XmTransientShellIndex (XmVendorShellIndex + 1) #define TransientShellIndex XmTransientShellIndex #define XmTopLevelShellIndex (XmVendorShellIndex + 1) #define TopLevelShellIndex XmTopLevelShellIndex #define XmApplicationShellIndex (XmTopLevelShellIndex + 1) #define ApplicationShellIndex XmApplicationShellIndex #define XmGrabShellIndex (XmVendorShellIndex + 1) #define XmDisplayIndex (XmApplicationShellIndex + 1) #define XmDialogSIndex (XmTransientShellIndex + 1) #define XmDialogShellIndex XmDialogSIndex #define XmMenuShellIndex (XmOverrideShellIndex + 1) #define XmContainerIndex (XmManagerIndex + 1) #define XmNotebookIndex (XmManagerIndex + 1) #define XmSpinButtonIndex (XmManagerIndex + 1) #define XmComboBoxIndex (XmManagerIndex + 1) #define XmDragIconIndex (XmRectObjIndex + 1) #define XmDropSiteManagerIndex (XmObjectIndex + 1) #define XmDropTransferIndex (XmObjectIndex + 1) #define XmDragOverShellIndex (XmVendorShellIndex + 1) #define XmDragContextIndex (XmCoreIndex + 1) /* * XmOFFSETBITS is the number of bits used for the part offset within the * resource_offset field in the XmPartResource struct. XmOFFSETMASK is the * bitmask to mask for the part offset. */ #define XmOFFSETBITS (sizeof(Cardinal)*8/2) #define XmOFFSETMASK ((1<resource_offset & XmOFFSETMASK) + \ (*(offset))[(r)->resource_offset >> XmOFFSETBITS] # define XmField(widget, offsetrecord, part, variable, type) \ (*(type *)(((char *) (widget)) + offsetrecord[part##Index] + \ XtOffsetOf( part##Part, variable))) # define XmConstraintField(widget, offsetrecord, part, variable, type) \ (*(type *)(((char *) (widget)->core.constraints) + \ offsetrecord[part##Index] + \ XtOffsetOf( part##ConstraintPart, variable))) #else # define XmPartOffset(part, variable) \ ((part/**/Index) << XmOFFSETBITS) + XtOffsetOf( part/**/Part, variable) # define XmConstraintPartOffset(part, variable) \ ((part/**/Index) << XmOFFSETBITS) + \ XtOffsetOf( part/**/ConstraintPart, variable) # define XmGetPartOffset(r, offset) \ ((r)->resource_offset & XmOFFSETMASK) + \ (*(offset))[(r)->resource_offset >> XmOFFSETBITS]; # define XmField(widget, offsetrecord, part, variable, type) \ (*(type *)(((char *) (widget)) + offsetrecord[part/**/Index] + \ XtOffsetOf( part/**/Part, variable))) # define XmConstraintField(widget, offsetrecord, part, variable, type) \ (*(type *)(((char *) (widget)->core.constraints) + \ offsetrecord[part/**/Index] + \ XtOffsetOf( part/**/ConstraintPart, variable))) #endif /*********************************************************************** * * RegionP.h * * This structure must match the opaque libX Region structure. ***********************************************************************/ typedef struct { short x1, x2, y1, y2; } XmRegionBox; typedef struct _XmRegion { long size; long numRects; XmRegionBox *rects; XmRegionBox extents; } XmRegionRec, *XmRegion; /******** ResConvert.c ********/ enum{ XmLABEL_FONTLIST = 1, XmBUTTON_FONTLIST, XmTEXT_FONTLIST } ; enum { XmLABEL_RENDER_TABLE = 1, XmBUTTON_RENDER_TABLE, XmTEXT_RENDER_TABLE } ; /**** Private Defines, Typedefs, and Function Declarations for XmString.c ****/ /* For _XmStringIndexCacheTag() and _XmStringCacheTag() length. */ #define XmSTRING_TAG_STRLEN -1 /* For _XmStringGetNextTabWidth. EOS = End Of String. */ typedef enum { XmTAB_NEXT, XmTAB_NEWLINE, XmTAB_EOS } NextTabResult; /******** End Private Function Declarations ********/ /******** Traversal.c ********/ #define XmTAB_ANY ((XmNavigationType) 255) #define XmNONE_OR_BC ((XmNavigationType) 254) typedef struct _XmFocusMovedCallbackStruct{ int reason; XEvent *event; Boolean cont; Widget old_focus; Widget new_focus; unsigned char focus_policy; XmTraversalDirection direction; } XmFocusMovedCallbackStruct, *XmFocusMovedCallback; typedef struct _XmFocusDataRec *XmFocusData; /******** ResInd.c ********/ typedef enum { XmPARSE_ERROR, XmPARSE_NO_UNITS, XmPARSE_UNITS_OK } XmParseResult; /******** Function Declarations for Xme ********/ /* GadgetUtil.c */ extern void XmeRedisplayGadgets( Widget w, register XEvent *event, Region region) ; extern void XmeConfigureObject( Widget g, #if NeedWidePrototypes int x, int y, int width, int height, int border_width) ; #else Position x, Position y, Dimension width, Dimension height, Dimension border_width) ; #endif /* NeedWidePrototypes */ /* Traversal.c */ extern void XmeNavigChangeManaged( Widget wid) ; extern Boolean XmeFocusIsInShell( Widget wid) ; /* ResInd.c */ extern XmImportOperator XmeToHorizontalPixels( Widget widget, int offset, XtArgVal *value) ; extern XmImportOperator XmeToVerticalPixels( Widget widget, int offset, XtArgVal *value) ; extern void XmeFromHorizontalPixels( Widget widget, int offset, XtArgVal *value) ; extern void XmeFromVerticalPixels( Widget widget, int offset, XtArgVal *value) ; extern XmParseResult XmeParseUnits(String spec, int *unitType); /* DragIcon. c */ extern Widget XmeGetTextualDragIcon(Widget w) ; /* BulletinB.c */ extern Widget XmeCreateClassDialog( WidgetClass w_class, Widget ds_p, String name, ArgList bb_args, Cardinal bb_n ) ; /* ImageCache.c */ extern Boolean XmeGetPixmapData( Screen *screen, Pixmap pixmap, char **image_name, int *depth, Pixel *foreground, Pixel *background, int *hot_x, int *hot_y, unsigned int *width, unsigned int *height) ; extern Pixmap XmeGetMask( Screen *screen, char *image_name) ; /* VaSimple.c */ extern int XmeCountVaListSimple(va_list al); extern Widget XmeVLCreateWidget( char *name, WidgetClass wc, Widget parent, Boolean managed, va_list al, int count); /* VirtKeys.c */ extern int XmeVirtualToActualKeysyms( Display *dpy, KeySym virtKeysym, XmKeyBinding *actualKeyData) ; /* Screen.c */ extern Cursor XmeGetNullCursor(Widget w) ; extern void XmeQueryBestCursorSize( Widget w, Dimension *width, Dimension *height ); /* Xm.c */ extern void XmeWarning( Widget w, char *message ) ; /* ResConvert.c */ extern XmFontList XmeGetDefaultRenderTable( Widget w, #if NeedWidePrototypes unsigned int fontListType ); #else unsigned char fontListType ); #endif /* NeedWidePrototypes */ extern Boolean XmeNamesAreEqual( register char *in_str, register char *test_str ); /* Primitive.c */ extern void XmeResolvePartOffsets( WidgetClass w_class, XmOffsetPtr *offset, XmOffsetPtr *constraint_offset ) ; /* XmString.c */ extern Boolean XmeStringIsValid( XmString string ) ; extern void XmeSetWMShellTitle( XmString xmstr, Widget shell) ; extern XmIncludeStatus XmeGetDirection(XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag locale_tag, XmParseMapping entry, int pattern_length, XmString *str_include, XtPointer call_data); extern XmIncludeStatus XmeGetNextCharacter(XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag locale_tag, XmParseMapping entry, int pattern_length, XmString *str_include, XtPointer call_data); extern XmStringComponentType XmeStringGetComponent(_XmStringContext context, Boolean update_context, Boolean copy_data, unsigned int *length, XtPointer *value); /* XmFontList.c */ extern Boolean XmeRenderTableGetDefaultFont( XmFontList fontlist, XFontStruct **font_struct ) ; /* GMUtils.c */ extern XtGeometryResult XmeReplyToQueryGeometry( Widget widget, XtWidgetGeometry * intended, XtWidgetGeometry * desired) ; /* Color.c */ extern void XmeGetDefaultPixel( Widget widget, int type, int offset, XrmValue *value) ; /* Xmos.c */ extern String XmeGetHomeDirName(void) ; extern int XmeMicroSleep( long secs) ; extern XmString XmeGetLocalizedString( char *reserved, Widget widget, char *resource, String string) ; extern void XmRenderTableGetDefaultFontExtents( XmRenderTable rendertable, int *height, int *ascent, int *descent) ; /******** End Function Declarations for Xme ********/ /******** ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #include /*********************************************************************** * * Motif 1.2 BC compilation. * ***********************************************************************/ #ifndef NO_XM_1_2_BC /* * These routines have all been made obsolete by public Xme functions. * The declarations here are intended solely as an aid to porting, * and will be removed in a future release. All applications should * name the Xme methods directly. * * _XmVirtualToActualKeysym, _XmResizeObject, and _XmMoveObject have * Xme counterparts with slightly different semantics or parameters, * so a simple rename will not work for them. */ #define _XmClearBorder XmeClearBorder #define _XmConfigureObject XmeConfigureObject #define _XmDrawArrow XmeDrawArrow #define _XmDrawDiamond XmeDrawDiamond #define _XmDrawSeparator XmeDrawSeparator #define _XmDrawShadows XmeDrawShadows #define _XmDrawSimpleHighlight XmeDrawHighlight #define _XmFontListGetDefaultFont XmeRenderTableGetDefaultFont #define _XmFromHorizontalPixels XmeFromHorizontalPixels #define _XmFromVerticalPixels XmeFromVerticalPixels #define _XmGMReplyToQueryGeometry XmeReplyToQueryGeometry #define _XmGetDefaultFontList XmeGetDefaultRenderTable #define _XmGetMaxCursorSize XmeQueryBestCursorSize #define _XmGetNullCursor XmeGetNullCursor #define _XmGetTextualDragIcon XmeGetTextualDragIcon #define _XmInputInGadget XmObjectAtPoint #define _XmMicroSleep XmeMicroSleep #define _XmNavigChangeManaged XmeNavigChangeManaged #define _XmOSGetHomeDirName XmeGetHomeDirName #define _XmOSGetLocalizedString XmeGetLocalizedString #define _XmRedisplayGadgets XmeRedisplayGadgets #define _XmStringIsXmString XmeStringIsValid #define _XmStringUpdateWMShellTitle XmeSetWMShellTitle #define _XmStringsAreEqual XmeNamesAreEqual #define _XmToHorizontalPixels XmeToHorizontalPixels #define _XmToVerticalPixels XmeToVerticalPixels #define _XmWarning XmeWarning /* * These routines are really undocumented and internal, but have been * used widely enough as data that they are preserved here for source * compatibility. */ extern void _XmDestroyParentCallback( Widget w, XtPointer client_data, XtPointer call_data) ; /* * Use of these internal macros is sufficiently widespread that they * are still made available here for source compatibility. */ /* The _XmCreateImage macro is used to create XImage with client * specific data for the bit and byte order. We still have to do the * following because XCreateImage will stuff here display specific * data and we want client specific values (i.e the bit orders we used * for creating the bitmap data in Motif) */ #define _XmCreateImage(IMAGE, DISPLAY, DATA, WIDTH, HEIGHT, BYTE_ORDER) {\ IMAGE = XCreateImage(DISPLAY,\ DefaultVisual(DISPLAY, DefaultScreen(DISPLAY)),\ 1,\ XYBitmap,\ 0,\ DATA,\ WIDTH, HEIGHT,\ 8,\ (WIDTH+7) >> 3);\ IMAGE->byte_order = BYTE_ORDER;\ IMAGE->bitmap_unit = 8;\ IMAGE->bitmap_bit_order = LSBFirst;\ } #endif /* NO_XM_1_2_BC */ #if __GNUC__ # define XM_DEPRECATED __attribute__((__deprecated__)) # ifdef NO_WEAK_ALIASES # define XM_ALIAS(sym) # else # define XM_ALIAS(sym) __attribute__((__weak__,alias(#sym))) # endif #else # define XM_DEPRECATED # define XM_ALIAS(sym) #endif #define FIX_1381 #endif /* _XmP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/ValTime.c0000644000175000017500000000374712672140200012427 00000000000000/* $TOG: ValTime.c /main/6 1997/06/18 17:46:26 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" /********************************************************************** * * _XmValidTimestamp * Returns a valid timestamp by generating an event. The time * that is returned is not 0 or CurrentTime. * Arguments: w - any widget on the display. * **********************************************************************/ Time _XmValidTimestamp( Widget w ) { Window win; Display *dsp = XtDisplay(w); XEvent event; EventMask shellMask; Atom timeProp = XInternAtom(dsp, XmI_MOTIF_CURRENT_TIME, False); while (!XtIsShell(w)) w = XtParent(w); win = XtWindow(w); if (! ((shellMask = XtBuildEventMask(w)) & PropertyChangeMask) ) XSelectInput(dsp, win, shellMask | PropertyChangeMask); XChangeProperty(dsp, win, timeProp, timeProp, 8, PropModeAppend, NULL, 0); XWindowEvent(dsp, win, PropertyChangeMask, &event); if (!(shellMask & PropertyChangeMask)) XSelectInput(dsp, win, shellMask); return (event.xproperty.time); } motif-2.3.8/lib/Xm/Container.h0000644000175000017500000000542312672140200013006 00000000000000/* $XConsortium: Container.h /main/5 1995/07/15 20:50:08 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmContainer_h #define _XmContainer_h #include #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmContainerWidgetClass; typedef struct _XmContainerClassRec *XmContainerWidgetClass; typedef struct _XmContainerRec *XmContainerWidget; #ifndef XmIsContainer #define XmIsContainer(w) XtIsSubclass(w, xmContainerWidgetClass) #endif /* XmIsContainer */ /******** Public Function Declarations ********/ extern Widget XmCreateContainer( Widget parent, String name, ArgList arglist, Cardinal argcount); extern Widget XmVaCreateContainer( Widget parent, char *name, ...); extern Widget XmVaCreateManagedContainer( Widget parent, char *name, ...); extern int XmContainerGetItemChildren( Widget wid, Widget item, WidgetList *item_children); extern void XmContainerRelayout( Widget wid); extern void XmContainerReorder( Widget wid, WidgetList cwid_list, int cwid_count); extern Boolean XmContainerCut( Widget wid, Time timestamp); extern Boolean XmContainerCopy( Widget wid, Time timestamp); extern Boolean XmContainerPaste( Widget wid); extern Boolean XmContainerCopyLink( Widget wid, Time timestamp); extern Boolean XmContainerPasteLink( Widget wid); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmContainer_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Container.c0000644000175000017500000112157513066310437013022 00000000000000/* $TOG: Container.c /main/35 1999/07/29 09:16:07 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED */ #ifdef HAVE_CONFIG_H #include #endif #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ColorI.h" #include "GadgetUtiI.h" #include "GeoUtilsI.h" #include "IconGI.h" #include "RepTypeI.h" #include "TransferI.h" #include "TraversalI.h" #include "XmI.h" #include "CareVisualTI.h" #include "MessagesI.h" #include "ClipWindTI.h" #include /* for bzero et al */ #define FIX_1384 #define FIX_1401 #define FIX_1425 #define ZERO_DIM 0 #define DEFAULT_INDENTATION 40 #define NO_CELL -1 #define OBNAME "OutlineButton" #define HEADERNAME "Header" #define DANAME "HeaderDA" #define INVALID_COUNT 32767 #define INVALID_DIMENSION 32767 #define MOTION_THRESHOLD 3 /* Make this nicely divisible by 2 */ #define DRAG_STATE_SIZE 14 #define WRONGPARAMS _XmMMsgContainer_0000 #define MESSAGE1 _XmMMsgContainer_0001 enum { ANY_FIT, EXACT_FIT, FORCE}; /* Useful macros */ #define _LEFT 0 #define _RIGHT 1 #define _UP 2 #define _DOWN 3 #define _FIRST 4 #define _LAST 5 #define _COLLAPSE 2 #define _EXPAND 3 #define _IN "In" #define _OUT "Out" #define _ENTER "Enter" #define _LEAVE "Leave" #define _LINK 0 #define _MOVE 1 #define _COPY 2 #define defaultTranslations _XmContainer_defaultTranslations #define traversalTranslations _XmContainer_traversalTranslations /******** Static Function Declarations ********/ static void GetDetailHeader( Widget wid, int offset, XtArgVal *value); static void GetDetailHeaderCount( Widget wid, int offset, XtArgVal *value); static void GetOutlineColumnWidth( Widget wid, int offset, XtArgVal *value); static void ClassPartInitialize( WidgetClass wc); static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void Destroy( Widget wid); static void Resize( Widget wid); static void Redisplay( Widget wid, XEvent *event, Region region); static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void GetSize( Widget wid, Dimension * pwidth, Dimension * pheight); static XtGeometryResult QueryGeometry( Widget wid, XtWidgetGeometry *intended, XtWidgetGeometry *desired); static XtGeometryResult GeometryManager( Widget instigator, XtWidgetGeometry *desired, XtWidgetGeometry *allowed); static void ChangeManaged( Widget wid); static void ChangeManagedOutlineDetail( Widget wid); static void ChangeManagedSpatial( Widget wid); static Boolean RequestSpatialGrowth( Widget wid, Widget cwid); static void ConstraintInitialize( Widget rcwid, Widget ncwid, ArgList args, Cardinal *num_args); static void ConstraintDestroy( Widget cwid); static Boolean ConstraintSetValues( Widget ccwid, Widget rcwid, Widget ncwid, ArgList args, Cardinal *num_args); static Widget ObjectAtPoint( Widget wid, Position x, Position y); static Boolean TestFitItem( Widget wid, Widget cwid, Position x, Position y); static Boolean PlaceItem( Widget wid, Widget cwid, unsigned char fit_type); static Boolean RemoveItem( Widget wid, Widget cwid); static void GetSpatialSize( Widget wid, Dimension * pwidth, Dimension * pheight); static void GetSpatialSizeCellAdjustment( Widget wid, int *width_in_cells, int *height_in_cells, ContainerCwidCellInfo cwid_info, int cwid_info_count); static void PlaceItemNone( Widget wid, Widget cwid, unsigned char fit_type); static void PlaceItemGridCells( Widget wid, Widget cwid, unsigned char fit_type); static int GetCellFromCoord( Widget wid, Position x, Position y); static XPoint * GetCoordFromCell( Widget wid, int cell_idx, XPoint *point); static void PlaceItemReset( Widget wid); static void PlaceCwid( Widget cwid, Position x, Position y); static XPoint * SnapCwid( Widget cwid, Position x, Position y, XPoint *point); static void HideCwid( Widget cwid); static void ContainerNoop( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerHandleBtn1Down( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerHandleBtn1Motion( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerHandleBtn1Up( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerHandleBtn2Down( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerHandleBtn2Motion( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerHandleBtn2Up( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerBeginSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerButtonMotion( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerEndSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerBeginToggle( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerEndToggle( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerBeginExtend( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerEndExtend( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerStartTransfer( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerEndTransfer( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerPrimaryCopy( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerPrimaryLink( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerPrimaryMove( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerCancel( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerExtend( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerMoveCursor( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerExtendCursor( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerToggleMode( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerSelectAll( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerDeselectAll( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerExpandOrCollapse( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ContainerConvertProc( Widget wid, XtPointer closure, XmConvertCallbackStruct *cs); static void ContainerDestinationProc( Widget wid, XtPointer closure, XmDestinationCallbackStruct *cs); static void ContainerDestPrehookProc( Widget wid, XtPointer closure, XmDestinationCallbackStruct *cs); static void ContGetValues( Widget wid, XmContainerData contData); static unsigned char GetVisualEmphasis( Widget cwid); static void SetVisualEmphasis( Widget cwid, unsigned char emphasis); static unsigned char GetViewType( Widget cwid); static void SetViewType( Widget cwid, unsigned char viewtype); static Dimension GetIconWidth( Widget cwid); static Cardinal GetDefaultDetailCount( Widget wid); static XmTabList SetDynamicTabList( Widget wid); static XmTabList GetDumbTabList( int tab_size, Cardinal asked_num_tab); static Dimension GetDynFirstColWidth( Widget wid); static void ResizeIconWidths( Widget wid); static void Layout( Widget wid); static void RequestOutlineDetail( Widget wid, XtWidgetGeometry * geo_desired); static void LayoutOutlineDetail( Widget wid); static void LayoutSpatial( Widget wid, Boolean growth_req_allowed, CwidNode stop_node); static void SetCellSizes( Widget wid); static void SetLargeCellSizes( Widget wid); static void SetSmallCellSizes( Widget wid); static void SizeOutlineButton( Widget wid); static void UpdateGCs( Widget wid); static void CreateIconHeader( Widget wid); static Widget GetRealIconHeader( Widget wid); static void UpdateIconHeader( Widget wid, Boolean count_only); static void ChangeView( Widget wid, unsigned char view); static CwidNode NewNode( Widget cwid); static void InsertNode( CwidNode node); static void SeverNode( CwidNode node); static void DeleteNode( Widget cwid); static CwidNode GetFirstNode( XmContainerWidget cw); static CwidNode GetNextNode( CwidNode start_item); static Boolean NodeIsActive( CwidNode node); static CwidNode GetNextUpLevelNode( CwidNode start_item); static void StartSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params); static Boolean ProcessButtonMotion( Widget wid, XEvent *event, String *params, Cardinal *num_params); static Boolean SelectAllCwids( Widget wid); static Boolean DeselectAllCwids( Widget wid); static Boolean MarkCwid( Widget cwid, Boolean visual_only); static Boolean UnmarkCwidVisual( Widget cwid); static void SetMarkedCwids( Widget wid); static Boolean ResetMarkedCwids( Widget wid); static Boolean MarkCwidsInRange( Widget wid, Widget cwid1, Widget cwid2, Boolean visual_only); static Boolean MarkCwidsInMarquee( Widget wid, Boolean find_anchor, Boolean visual_only); static Boolean InMarquee( Widget cwid); static void RecalcMarquee( Widget wid, Widget cwid, Position x, Position y); static void DrawMarquee( Widget wid); static void KBSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void SetLocationCursor( Widget cwid); static void CalcNextLocationCursor( Widget wid, String direction); static Widget RedirectTraversal( Widget old_focus, Widget new_focus, unsigned int focus_policy, XmTraversalDirection direction, unsigned int pass) ; static CwidNode GetLastTraversableChild( CwidNode node); static CwidNode GetPrevTraversableSibling( CwidNode node); static CwidNode GetPrevTraversableUplevel( CwidNode node); static CwidNode GetNextTraversableChild( CwidNode node); static CwidNode GetNextTraversableSibling( CwidNode node); static CwidNode GetNextTraversableUplevel( CwidNode node); static CwidNode GetNextTraversable( CwidNode node); static Widget GetLastTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap); static Widget GetFirstTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap); static Widget GetNextTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap); static Widget GetPrevTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap); static void MakeOutlineButton( Widget cwid); static void ChangeOutlineButtons( Widget wid); static void ExpandCwid( Widget cwid); static void CollapseCwid( Widget cwid); static void CallActionCB( Widget cwid, XEvent *event); static void CallSelectCB( Widget wid, XEvent *event, unsigned char auto_selection_type); static WidgetList GetSelectedCwids( Widget wid); static void GetSelectedItems( Widget wid, int offset, XtArgVal *value); static int CompareInts( XmConst void *p1, XmConst void *p2); static int Isqrt( int n); static void GainPrimary( Widget wid, Time timestamp); static void ConvertRefuse( Widget wid, XtPointer closure, XmConvertCallbackStruct * cs); static void DragStart( XtPointer data, XtIntervalId * id); static void OutlineButtonCallback( Widget pbwid, XtPointer client_data, XtPointer call_data); static void OutlineButtonAction( Widget cwid, unsigned char new_state, XEvent *event); static void MoveItemCallback( Widget wid, XtPointer client_data, XtPointer call_data); static void DropDoneCallback( Widget wid, XtPointer client_data, XtPointer call_data); static void FreeLocationData( Widget wid, XtEnum op, XmTransferDoneCallbackStruct*); static Boolean SetupDrag( Widget wid, XEvent *event, String *params, Cardinal *num_params); static void CheckSetRenderTable( Widget wid, int offset, XrmValue *value); static void DefaultCollapsedPixmap( Widget wid, int offset, XrmValue * value); static void EnterHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch); static void LeaveHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch); static void ScrollProc( XtPointer closure, XtIntervalId* id); static void ContainerResetDepths (XmContainerConstraint c); #ifdef FIX_1425 static void FindMaxDepths (XmContainerConstraint c, Widget cw); #endif static Boolean ContainerIsDescendant (Widget containerChild, Widget newEntryParent); static void ContainerResequenceNodes(XmContainerWidget cw, Widget entryParent); /******** End Static Function Declarations ********/ static XtActionsRec actionsList[] = { {"ContainerBeginSelect", (XtActionProc) ContainerBeginSelect}, {"ContainerButtonMotion", (XtActionProc) ContainerButtonMotion}, {"ContainerEndSelect", (XtActionProc) ContainerEndSelect}, {"ContainerBeginToggle", (XtActionProc) ContainerBeginToggle}, {"ContainerEndToggle", (XtActionProc) ContainerEndToggle}, {"ContainerBeginExtend", (XtActionProc) ContainerBeginExtend}, {"ContainerEndExtend", (XtActionProc) ContainerEndExtend}, {"ContainerStartTransfer", (XtActionProc) ContainerStartTransfer}, {"ContainerEndTransfer", (XtActionProc) ContainerEndTransfer}, {"ContainerPrimaryCopy", (XtActionProc) ContainerPrimaryCopy}, {"ContainerPrimaryLink", (XtActionProc) ContainerPrimaryLink}, {"ContainerPrimaryMove", (XtActionProc) ContainerPrimaryMove}, {"ContainerCancel", (XtActionProc) ContainerCancel}, {"ContainerSelect", (XtActionProc) ContainerSelect}, {"ContainerExtend", (XtActionProc) ContainerExtend}, {"ContainerMoveCursor", (XtActionProc) ContainerMoveCursor}, {"ContainerExtendCursor", (XtActionProc) ContainerExtendCursor}, {"ContainerToggleMode", (XtActionProc) ContainerToggleMode}, {"ContainerSelectAll", (XtActionProc) ContainerSelectAll}, {"ContainerDeselectAll", (XtActionProc) ContainerDeselectAll}, {"ContainerActivate", (XtActionProc) ContainerActivate}, {"ContainerExpandOrCollapse", (XtActionProc) ContainerExpandOrCollapse}, {"ContainerNoop", (XtActionProc) ContainerNoop}, {"ContainerHandleBtn1Down", (XtActionProc) ContainerHandleBtn1Down}, {"ContainerHandleBtn1Motion", (XtActionProc) ContainerHandleBtn1Motion}, {"ContainerHandleBtn1Up", (XtActionProc) ContainerHandleBtn1Up}, {"ContainerHandleBtn2Down", (XtActionProc) ContainerHandleBtn2Down}, {"ContainerHandleBtn2Motion", (XtActionProc) ContainerHandleBtn2Motion}, {"ContainerHandleBtn2Up", (XtActionProc) ContainerHandleBtn2Up} }; static XtResource resources[] = { { XmNautomaticSelection,XmCAutomaticSelection, XmRAutomaticSelection,sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.automatic), XmRImmediate,(XtPointer)XmAUTO_SELECT}, { XmNcollapsedStatePixmap,XmCCollapsedStatePixmap,XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmContainerRec, container.collapsed_state_pixmap), XmRCallProc, (XtPointer)DefaultCollapsedPixmap}, { XmNconvertCallback,XmCCallback,XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmContainerRec,container.convert_cb), XmRImmediate,(XtPointer)NULL}, { XmNdefaultActionCallback,XmCCallback,XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmContainerRec,container.default_action_cb), XmRImmediate,(XtPointer)NULL}, { XmNdestinationCallback,XmCCallback,XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmContainerRec,container.destination_cb), XmRImmediate,(XtPointer)NULL}, { XmNdetailColumnHeading,XmCDetailColumnHeading,XmRXmStringTable, sizeof(XmStringTable), XtOffsetOf(XmContainerRec,container.detail_heading), XmRImmediate,(XtPointer)NULL}, { XmNdetailColumnHeadingCount,XmCDetailColumnHeadingCount, XmRCardinal,sizeof(Cardinal), XtOffsetOf(XmContainerRec, container.detail_heading_count), XmRImmediate,(XtPointer)0}, { XmNdetailOrder,XmCDetailOrder,XmRCardinalList, sizeof(Cardinal *), XtOffsetOf(XmContainerRec,container.detail_order), XmRImmediate,(XtPointer)NULL}, { XmNdetailOrderCount,XmCDetailOrderCount,XmRCardinal, sizeof(Cardinal), XtOffsetOf(XmContainerRec,container.detail_order_count), XmRImmediate,(XtPointer)0}, { XmNdetailTabList,XmCDetailTabList,XmRTabList,sizeof(XmTabList), XtOffsetOf(XmContainerRec,container.detail_tablist), XmRImmediate,(XtPointer)NULL}, { XmNentryViewType,XmCEntryViewType,XmREntryViewType, sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.entry_viewtype), XmRImmediate,(XtPointer)XmANY_ICON}, { XmNexpandedStatePixmap,XmCExpandedStatePixmap,XmRDynamicPixmap, sizeof(Pixmap), XtOffsetOf(XmContainerRec, container.expanded_state_pixmap), XmRString,(XtPointer)"expanded"}, { XmNlargeCellHeight,XmCCellHeight,XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.large_cell_height), XmRImmediate,(XtPointer)ZERO_DIM}, { XmNlargeCellWidth,XmCCellWidth,XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.large_cell_width), XmRImmediate,(XtPointer)ZERO_DIM}, { XmNlayoutType,XmCLayoutType,XmRLayoutType, sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.layout_type), XmRImmediate,(XtPointer)XmSPATIAL}, { XmNmarginHeight,XmCMarginHeight,XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.margin_h), XmRImmediate,(XtPointer)ZERO_DIM}, { XmNmarginWidth,XmCMarginWidth,XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.margin_w), XmRImmediate,(XtPointer)ZERO_DIM}, { XmNoutlineButtonPolicy,XmCOutlineButtonPolicy, XmROutlineButtonPolicy,sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.ob_policy), XmRImmediate,(XtPointer)XmOUTLINE_BUTTON_PRESENT}, { XmNoutlineChangedCallback,XmCCallback,XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmContainerRec,container.outline_cb), XmRImmediate,(XtPointer)NULL}, { XmNoutlineColumnWidth,XmCOutlineColumnWidth,XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.first_col_width), XmRImmediate,(XtPointer)ZERO_DIM}, { XmNoutlineIndentation,XmCOutlineIndentation,XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.outline_indent), XmRImmediate,(XtPointer)DEFAULT_INDENTATION}, { XmNoutlineLineStyle,XmCLineStyle,XmRLineStyle, sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.outline_sep_style), XmRImmediate,(XtPointer)XmSINGLE}, { XmNprimaryOwnership,XmCPrimaryOwnership,XmRPrimaryOwnership, sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.primary_ownership), XmRImmediate,(XtPointer)XmOWN_POSSIBLE_MULTIPLE}, { "pri.vate","Pri.vate",XmRBoolean, sizeof(Boolean), XtOffsetOf(XmContainerRec,container.first_change_managed), XmRImmediate, (XtPointer) False}, { XmNfontList,XmCFontList,XmRFontList, sizeof(XmRenderTable), XtOffsetOf(XmContainerRec,container.render_table), XmRCallProc, (XtPointer)CheckSetRenderTable}, { XmNrenderTable,XmCRenderTable,XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmContainerRec,container.render_table), XmRCallProc, (XtPointer)CheckSetRenderTable}, { XmNselectColor,XmCSelectColor,XmRSelectColor,sizeof(Pixel), XtOffsetOf(XmContainerRec,container.select_color), XmRImmediate,(XtPointer)XmREVERSED_GROUND_COLORS}, { XmNselectedObjects,XmCSelectedObjects,XmRWidgetList, sizeof(WidgetList), XtOffsetOf(XmContainerRec,container.selected_items), XmRImmediate,(XtPointer)NULL}, { XmNselectedObjectCount,XmCSelectedObjectCount,XmRInt, sizeof(int), XtOffsetOf(XmContainerRec, container.selected_item_count), XmRImmediate,(XtPointer)0}, { XmNselectionCallback,XmCCallback,XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmContainerRec,container.selection_cb), XmRImmediate,(XtPointer)NULL}, { XmNselectionPolicy,XmCSelectionPolicy,XmRSelectionPolicy, sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.selection_policy), XmRImmediate,(XtPointer)XmEXTENDED_SELECT}, { XmNselectionTechnique,XmCSelectionTechnique, XmRSelectionTechnique,sizeof(unsigned char), XtOffsetOf(XmContainerRec, container.selection_technique), XmRImmediate,(XtPointer)XmTOUCH_OVER}, { XmNsmallCellHeight,XmCCellHeight,XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.small_cell_height), XmRImmediate,(XtPointer)ZERO_DIM}, { XmNsmallCellWidth,XmCCellWidth,XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.small_cell_width), XmRImmediate,(XtPointer)ZERO_DIM}, { XmNspatialIncludeModel,XmCSpatialIncludeModel, XmRSpatialIncludeModel,sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.include_model), XmRImmediate,(XtPointer)XmAPPEND}, { XmNspatialResizeModel,XmCSpatialResizeModel, XmRSpatialResizeModel,sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.resize_model), XmRImmediate,(XtPointer)XmGROW_MINOR}, { XmNspatialSnapModel,XmCSpatialSnapModel, XmRSpatialSnapModel,sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.snap_model), XmRImmediate,(XtPointer)XmNONE}, { XmNspatialStyle,XmCSpatialStyle,XmRSpatialStyle, sizeof(unsigned char), XtOffsetOf(XmContainerRec,container.spatial_style), XmRImmediate,(XtPointer)XmGRID}, }; static XmSyntheticResource syn_resources[] = { { XmNlargeCellHeight,sizeof(Dimension), XtOffsetOf(XmContainerRec,container.large_cell_height), XmeFromVerticalPixels,XmeToVerticalPixels}, { XmNlargeCellWidth,sizeof(Dimension), XtOffsetOf(XmContainerRec,container.large_cell_width), XmeFromHorizontalPixels,XmeToHorizontalPixels}, { XmNmarginHeight,sizeof(Dimension), XtOffsetOf(XmContainerRec,container.margin_h), XmeFromVerticalPixels,XmeToVerticalPixels}, { XmNmarginWidth,sizeof(Dimension), XtOffsetOf(XmContainerRec,container.margin_w), XmeFromHorizontalPixels,XmeToHorizontalPixels}, { XmNoutlineIndentation,sizeof(Dimension), XtOffsetOf(XmContainerRec,container.outline_indent), XmeFromHorizontalPixels,XmeToHorizontalPixels}, { XmNselectedObjects,sizeof(WidgetList), XtOffsetOf(XmContainerRec,container.selected_items), GetSelectedItems,NULL}, { XmNsmallCellHeight,sizeof(Dimension), XtOffsetOf(XmContainerRec,container.small_cell_height), XmeFromVerticalPixels,XmeToVerticalPixels}, { XmNsmallCellWidth,sizeof(Dimension), XtOffsetOf(XmContainerRec,container.small_cell_width), XmeFromHorizontalPixels,XmeToHorizontalPixels}, { XmNdetailColumnHeading, sizeof(XmStringTable), XtOffsetOf(XmContainerRec,container.detail_heading), GetDetailHeader, NULL}, { XmNdetailColumnHeadingCount, sizeof(Cardinal), XtOffsetOf(XmContainerRec, container.detail_heading_count), GetDetailHeaderCount, NULL}, { XmNoutlineColumnWidth, sizeof(Dimension), XtOffsetOf(XmContainerRec,container.first_col_width), GetOutlineColumnWidth, NULL}, }; /* The constraint resource list */ static XtResource constraints[] = { { XmNentryParent,XmCWidget,XmRWidget,sizeof(Widget), XtOffsetOf(XmContainerConstraintRec,container.entry_parent), XmRImmediate,(XtPointer)NULL}, { XmNoutlineState,XmCOutlineState,XmROutlineState, sizeof(unsigned char), XtOffsetOf(XmContainerConstraintRec,container.outline_state), XmRImmediate,(XtPointer)XmCOLLAPSED}, { XmNpositionIndex,XmCPositionIndex,XmRInt,sizeof(int), XtOffsetOf(XmContainerConstraintRec,container.position_index), XmRImmediate,(XtPointer)XmLAST_POSITION}, }; static XmManagerClassExtRec managerClassExtRec = { NULL, NULLQUARK, XmManagerClassExtVersion, sizeof(XmManagerClassExtRec), NULL, /* traversal_children */ ObjectAtPoint /* object_at_point */ }; externaldef( xmcontainerclassrec) XmContainerClassRec xmContainerClassRec = { /* CoreClassPart */ { (WidgetClass) &xmManagerClassRec, /* superclass */ "XmContainer", /* class_name */ sizeof(XmContainerRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMultiple, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ defaultTranslations, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* display_accelerator */ NULL, /* extension */ }, /* Composite class fields */ { GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, /* Constraint class fields */ { constraints, /* resource list */ XtNumber(constraints), /* num resources */ sizeof(XmContainerConstraintRec), /* constraint size */ ConstraintInitialize, /* init proc */ ConstraintDestroy, /* destroy proc */ ConstraintSetValues, /* set values proc */ NULL, /* extension */ }, /* XmManager class fields */ { traversalTranslations, /* translations */ syn_resources, /* get resources */ XtNumber(syn_resources), /* num get_resources */ NULL, /* get_cont_resources */ 0, /* num_get_cont_resources */ XmInheritParentProcess, /* parent_process */ (XtPointer)&managerClassExtRec, /* extension */ }, /* Container class fields */ { TestFitItem, /* test_fit_item */ PlaceItem, /* place_item */ RemoveItem, /* remove_item */ GetSpatialSize, /* get_spatial_size */ NULL, /* extension */ } }; externaldef( xmcontainerwidgetclass) WidgetClass xmContainerWidgetClass = (WidgetClass) &xmContainerClassRec; /* Transfer Trait record for Container */ static XmConst XmTransferTraitRec transferT = { 0, /* version */ (XmConvertCallbackProc) ContainerConvertProc, (XmDestinationCallbackProc) ContainerDestinationProc, (XmDestinationCallbackProc) ContainerDestPrehookProc, }; /* Trait record for ContainerT */ static XmConst XmContainerTraitRec containerT = { 0, /* version */ (XmContainerGetValuesProc) ContGetValues, }; /* TraversalControl Trait record for Container */ static XmConst XmTraversalControlTraitRec traversalControlT = { 0, /* version */ RedirectTraversal /* redirect */ }; /* Context for drag icon information */ static XContext dragIconInfoContext = 0; /* Data structure for drag icon info */ typedef struct _DragIconInfo { Widget state; Widget source; } DragIconInfoRec, *DragIconInfo; /************************************************************************ * GetDetailHeader ************************************************************************/ /*ARGSUSED*/ static void GetDetailHeader( Widget wid, int offset, /* unused */ XtArgVal *value) { XmContainerWidget cw = (XmContainerWidget) wid ; Widget icon_header ; Cardinal icon_detail_header_count, i ; XmStringTable detail_header = NULL, icon_detail_header ; XmString label_string ; /* If there is an icon_header, fetch the information out of it */ if ((icon_header = GetRealIconHeader(wid)) != NULL) { /* we get memory owned by IconG here */ XtVaGetValues (icon_header, XmNlabelString, &label_string, XmNdetail, &icon_detail_header, XmNdetailCount, &icon_detail_header_count, NULL); /* now we need to add the labelString itself, so malloc something in the Container itself. First free what is currently allocated. Last free is done in Destroy */ if (cw->container.cache_detail_heading) XtFree((char*)cw->container.cache_detail_heading) ; cw->container.cache_detail_heading = (XmStringTable) XtMalloc(sizeof(XmString) * (icon_detail_header_count + 1)) ; for (i=0; i < icon_detail_header_count; i++) cw->container.cache_detail_heading[i+1] = icon_detail_header[i] ; cw->container.cache_detail_heading[0] = label_string ; detail_header = cw->container.cache_detail_heading; /* app need not to free the returned array */ } else /* return real data set by the application, which we trust it ** has been maintaining */ detail_header = cw->container.detail_heading; *value = (XtArgVal)detail_header; } /************************************************************************ * GetDetailHeaderCount ************************************************************************/ /*ARGSUSED*/ static void GetDetailHeaderCount( Widget wid, int offset, /* unused */ XtArgVal *value) { Widget icon_header ; Cardinal detail_header_count = 0 ; /* If there is an icon_header, fetch the information out of it */ if ((icon_header = GetRealIconHeader(wid)) != NULL) { XtVaGetValues (icon_header, XmNdetailCount, &detail_header_count, NULL); detail_header_count += 1; /* +1 for the labelString itself */ } else { XmContainerWidget cw = (XmContainerWidget)wid; detail_header_count = cw->container.saved_detail_heading_count; } *value = (XtArgVal)detail_header_count; } /************************************************************************ * GetOutlineColumnWidth ************************************************************************/ /*ARGSUSED*/ static void GetOutlineColumnWidth( Widget wid, int offset, /* unused */ XtArgVal *value) { XmContainerWidget cw = (XmContainerWidget)wid; /* Send 0 if dynamic, real_first_col_width otherwise */ if (CtrIsDynamic(cw,FIRSTCW)) *value = (XtArgVal)0; else *value = (XtArgVal)cw->container.real_first_col_width; } /************************************************************************ * ClassPartInitialize (Core Method) ************************************************************************/ static void ClassPartInitialize( WidgetClass wc) { _XmFastSubclassInit(wc,XmCONTAINER_BIT); /* Allow inheritance for subclasses */ if (wc != xmContainerWidgetClass) { XmContainerClass this_class = (XmContainerClass)wc; XmContainerClass super = (XmContainerClass)wc; if (this_class->container_class.test_fit_item == XmInheritSpatialTestFitProc) this_class->container_class.test_fit_item = super->container_class.test_fit_item; if (this_class->container_class.place_item == XmInheritSpatialPlacementProc) this_class->container_class.place_item = super->container_class.place_item; if (this_class->container_class.remove_item == XmInheritSpatialRemoveProc) this_class->container_class.remove_item = super->container_class.remove_item; if (this_class->container_class.get_spatial_size == XmInheritSpatialGetSize) this_class->container_class.get_spatial_size = super->container_class.get_spatial_size; } XmeTraitSet((XtPointer)wc,XmQTtransfer,(XtPointer)&transferT); XmeTraitSet((XtPointer)wc,XmQTcontainer,(XtPointer)&containerT); XmeTraitSet((XtPointer)wc,XmQTtraversalControl,(XtPointer)&traversalControlT); } /************************************************************************ * Initialize (Core Method) ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmContainerWidget ncw = (XmContainerWidget)nw; XmContainerWidget rcw = (XmContainerWidget)rw; int n, i; Arg wargs[10]; Atom targets[1]; XmScrollFrameTrait scrollFrameTrait; /* * Verify enumerated resources. */ if (!XmRepTypeValidValue(XmRID_AUTOMATIC_SELECTION, ncw->container.automatic,nw)) ncw->container.automatic = XmAUTO_SELECT; if (!XmRepTypeValidValue(XmRID_ENTRY_VIEW_TYPE, ncw->container.entry_viewtype,nw)) ncw->container.entry_viewtype = XmANY_ICON; if (!XmRepTypeValidValue(XmRID_SPATIAL_INCLUDE_MODEL, ncw->container.include_model,nw)) ncw->container.include_model = XmAPPEND; if (!XmRepTypeValidValue(XmRID_LAYOUT_TYPE, ncw->container.layout_type,nw)) ncw->container.layout_type = XmSPATIAL; if (!XmRepTypeValidValue(XmRID_LINE_STYLE, ncw->container.outline_sep_style,nw)) ncw->container.outline_sep_style = XmSINGLE; if (!XmRepTypeValidValue(XmRID_OUTLINE_BUTTON_POLICY, ncw->container.ob_policy,nw)) ncw->container.ob_policy = XmOUTLINE_BUTTON_PRESENT; if (!XmRepTypeValidValue(XmRID_SPATIAL_STYLE, ncw->container.spatial_style,nw)) ncw->container.spatial_style = XmGRID; if (!XmRepTypeValidValue(XmRID_PRIMARY_OWNERSHIP, ncw->container.primary_ownership,nw)) ncw->container.primary_ownership = XmOWN_POSSIBLE_MULTIPLE; if (!XmRepTypeValidValue(XmRID_SPATIAL_RESIZE_MODEL, ncw->container.resize_model,nw)) ncw->container.resize_model = XmGROW_MINOR; if (!XmRepTypeValidValue(XmRID_SELECTION_POLICY, ncw->container.selection_policy,nw)) ncw->container.selection_policy = XmEXTENDED_SELECT; if (!XmRepTypeValidValue(XmRID_SELECTION_TECHNIQUE, ncw->container.selection_technique,nw)) ncw->container.selection_technique = XmTOUCH_OVER; if (!XmRepTypeValidValue(XmRID_SPATIAL_SNAP_MODEL, ncw->container.snap_model,nw)) ncw->container.snap_model = XmNONE; /* * deal with XmNdetailOrder & XmNdetailOrderCount */ if (ncw->container.detail_order_count && ncw->container.detail_order) { ncw->container.detail_order = (Cardinal *) XtMalloc(sizeof(Cardinal) * ncw->container.detail_order_count); for (i=0; i < ncw->container.detail_order_count; i++) ncw->container.detail_order[i] = rcw->container.detail_order[i] ; } /* * Initialize internal variables. */ ncw->container.first_node = NULL; ncw->container.last_node = NULL; ncw->container.self = False; ncw->container.create_cwid_type = CONTAINER_ICON; ncw->container.toggle_pressed = False; ncw->container.extend_pressed = False; ncw->container.ob_pressed = False; ncw->container.cancel_pressed = False; ncw->container.kaddmode = (CtrPolicyIsMULTIPLE(ncw) || CtrPolicyIsSINGLE(ncw)); ncw->container.marquee_mode = !(CtrTechIsTOUCH_ONLY(ncw)); ncw->container.marquee_drawn = False; ncw->container.selection_state = XmSELECTED; ncw->container.anchor_cwid = NULL; ncw->container.have_primary = False; ncw->container.last_click_time = 0; ncw->container.selecting = False; ncw->container.dynamic_resource = 0L; ncw->container.cache_detail_heading = NULL; /* * Get default Font. */ if (ncw->container.render_table == NULL) { XmFontList defaultFont = NULL; defaultFont = XmeGetDefaultRenderTable(nw,XmLABEL_FONTLIST); ncw->container.render_table = XmFontListCopy(defaultFont); } else ncw->container.render_table = XmFontListCopy(ncw->container.render_table); /* * Copy XmTablist if set, otherwise, keep track that it's dynamic. */ if (ncw->container.detail_tablist == NULL) ncw->container.dynamic_resource |= TABLIST; if (ncw->container.detail_tablist != NULL) ncw->container.detail_tablist = XmTabListCopy(ncw->container.detail_tablist,0,0); /* * Deal with setting of selectColor special cases */ if (ncw->container.select_color == XmDEFAULT_SELECT_COLOR) { XrmValue val; _XmSelectColorDefault(nw, 0, &val); ncw->container.select_color = *((Pixel*) val.addr); } else if (ncw->container.select_color == XmHIGHLIGHT_COLOR) { ncw->container.select_color = ncw->manager.highlight_color ; } /* * Initialize GCs */ ncw->container.normalGC = NULL; ncw->container.marqueeGC = NULL; UpdateGCs(nw); ncw->container.size_ob = NULL; SizeOutlineButton(nw); /* this flag is used during: expansion/collapse of outlinebutton to know if the first column can grow/shrink. If it was set, it can't, otherwise, a default is calculated whenever changemanaged is called and it is updated when state of expansion change. We need to mark the first col resource so that any change is caught during setvalues */ if (ncw->container.first_col_width == 0) ncw->container.dynamic_resource |= FIRSTCW; ncw->container.real_first_col_width = ncw->container.first_col_width ; ncw->container.first_col_width = INVALID_DIMENSION ; ncw->container.saved_detail_heading_count = 0 ; ncw->container.icon_header = NULL; if ((ncw->container.detail_heading_count && !ncw->container.detail_heading) || (!ncw->container.detail_heading_count && ncw->container.detail_heading)) { XmeWarning ((Widget) ncw, MESSAGE1); } if (ncw->container.detail_heading_count > 0) { /* if detail heading resources specified, create icon_header */ if (ncw->container.detail_heading) { /* and point to right sized array ! */ CreateIconHeader(nw); /* ncw->container.icon_header is a DA iff we are in the automatic SW case. ncw->container.icon_header is created unmanaged */ if (CtrLayoutIsDETAIL(ncw)) XtManageChild(ncw->container.icon_header); else XtUnmanageChild(ncw->container.icon_header); } /* saved the heading count in case the heading is set later on. */ ncw->container.saved_detail_heading_count = ncw->container.detail_heading_count; /* mark the detail_heading_count as invalid so that any change will be trapped by SetValues */ ncw->container.detail_heading_count = INVALID_COUNT ; } ncw->container.max_depth = 0; ncw->container.outline_segs = NULL; ncw->container.outline_seg_count = 0; /* * Register as Drop site. */ n = 0; targets[0] = XInternAtom(XtDisplay(nw),XmS_MOTIF_DRAG_OFFSET,False); XtSetArg(wargs[n],XmNimportTargets,targets); n++; XtSetArg(wargs[n],XmNnumImportTargets,1); n++; XmeDropSink(nw,wargs,n); ncw->container.drag_context = (Widget) NULL; ncw->container.transfer_action = NULL; ncw->container.transfer_timer_id = 0; /* * Initialize prev width for Resize calculations * & first_change_managed for initial sizing calculations. */ ncw->container.prev_width = 0; ncw->container.first_change_managed = True; /* * Initialize GRID/CELLS */ ncw->container.cells = NULL; ncw->container.cell_count = 0; ncw->container.next_free_cell = 0; ncw->container.current_width_in_cells = 0; ncw->container.current_height_in_cells = 0; ncw->container.cells_region = XCreateRegion(); /* * Set Cell sizes. */ ncw->container.large_cell_dim_fixed = ((ncw->container.large_cell_height > 0) && (ncw->container.large_cell_width > 0)); ncw->container.small_cell_dim_fixed = ((ncw->container.small_cell_height > 0) && (ncw->container.small_cell_width > 0)); SetCellSizes(nw); /* * init auto scroll related data */ scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer)XtClass(XtParent(nw)),XmQTscrollFrame); if (scrollFrameTrait && (scrollFrameTrait->getInfo(XtParent(nw),NULL,NULL,NULL))) { XtAddEventHandler(nw, EnterWindowMask, False, EnterHandler, NULL); XtAddEventHandler(nw, LeaveWindowMask, False, LeaveHandler, NULL); } ncw->container.scroll_proc_id = 0; ncw->container.LeaveDir = 0; } /************************************************************************ * Destroy (Core Method) ************************************************************************/ static void Destroy( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; XmScrollFrameTrait scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer)XtClass(XtParent(wid)),XmQTscrollFrame); XmFontListFree(cw->container.render_table); XtReleaseGC(wid,cw->container.normalGC); XtReleaseGC(wid,cw->container.marqueeGC); if (cw->container.transfer_timer_id != 0) XtRemoveTimeOut(cw->container.transfer_timer_id); /* free the detail_heading array that might have been allocated during a getvalues */ if (cw->container.cache_detail_heading) XtFree((char*)cw->container.cache_detail_heading); if (cw->container.detail_order_count && cw->container.detail_order) { XtFree((char*)cw->container.detail_order); } if (cw->container.detail_tablist) XmTabListFree(cw->container.detail_tablist); if (cw->container.outline_segs) XtFree((char*)cw->container.outline_segs); if (cw->container.cells) XtFree((char*)cw->container.cells); XDestroyRegion(cw->container.cells_region); if (scrollFrameTrait && cw->container.icon_header != NULL) { /* only destroy the icon_header if not a child of the Container, the auto SW/DA case */ assert (XtParent(cw->container.icon_header) != wid); /* that will destroy the icon header child as well */ XtDestroyWidget(cw->container.icon_header); } /* else the icon_header is a child of the container and is ** already destroyed (which is why we can't refer to it until we ** know its lineage) */ if (cw->container.scroll_proc_id) XtRemoveTimeOut(cw->container.scroll_proc_id); } /************************************************************************ * Resize (Core Method) ************************************************************************/ static void Resize( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; /* * The Outline layout is oblivious to size constraints * in the Left-to-Right layout direction. */ if (CtrLayoutIsOUTLINE_DETAIL(cw) && (!CtrLayoutIsDETAIL(cw)) && (!LayoutIsRtoLM(cw))) return; /* * One-dimensional Right-to_Left layouts are oblivious to * height changes; so, just return if the width hasn't changed. */ if (CtrLayoutIsOUTLINE_DETAIL(cw) && (cw->core.width == cw->container.prev_width)) return; /* * Save the current width for next time and reLayout. */ cw->container.prev_width = cw->core.width; cw->container.self = True; Layout(wid); cw->container.self = False; /* * Outline lines will be moved in response to width change in a * Right-to_Left Outline Layout. Better clear everything to erase * the old lines. Also, details may be redrawn. */ if (CtrLayoutIsOUTLINE_DETAIL(cw)) if (XtIsRealized((Widget)cw)) XClearArea(XtDisplay((Widget)cw),XtWindow((Widget)cw),0,0,0,0,True); } /************************************************************************ * Redisplay (Core Method) * Special care must be taken to redraw the marquee which is drawn in XOR * mode. Normaly we should only need to draw the marquee with a clip * rectangle equal to the expose region. However, the XmIconGadgets do not * perform clipped redraw and redraw themselves entirely instead, because * its a pain to deal with both a clip rectangle and a possible clip mask. * So to avoid any problem, we must fully erase the marquee and then * redraw it. ************************************************************************/ static void Redisplay( Widget wid, XEvent *event, Region region) { XmContainerWidget cw = (XmContainerWidget)wid; /* Erase the marquee if there is any */ if (cw->container.marquee_drawn) { DrawMarquee(wid); XSetRegion(XtDisplay(wid), cw->container.normalGC, region); XSetForeground(XtDisplay(wid), cw->container.normalGC, cw->core.background_pixel); XFillRectangle(XtDisplay(wid), XtWindow(wid), cw->container.normalGC, event->xexpose.x, event->xexpose.y, event->xexpose.width, event->xexpose.height); XSetClipMask(XtDisplay(wid), cw->container.normalGC, None); XSetForeground(XtDisplay(wid), cw->container.normalGC, cw->manager.foreground); } /* * If lines are present & we're in outline layout, draw the lines. */ if (CtrDrawLinesOUTLINE(cw) && (cw->container.outline_seg_count > 0)) { XSetClipMask(XtDisplay(wid), cw->container.normalGC, None); XDrawSegments(XtDisplay(wid),XtWindow(wid), cw->container.normalGC, cw->container.outline_segs, cw->container.outline_seg_count); } /* * Redisplay all affected gadgets. */ XmeRedisplayGadgets(wid,event,region); /* Redraw marquee when needed */ if (cw->container.marquee_drawn) DrawMarquee(wid); } /************************************************************************ * SetValues (Core Method) ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmContainerWidget ccw = (XmContainerWidget)cw; XmContainerWidget ncw = (XmContainerWidget)nw; Boolean container_need_layout = False; Boolean spatial_need_layout = False; Boolean outline_need_layout = False; Boolean detail_need_layout = False; Boolean need_expose = False; CwidNode node; Widget cwid; XmContainerConstraint c; XPoint snap_point; int i; ncw->container.self = True; /* * Verify enumerated resources. */ if (ncw->container.automatic != ccw->container.automatic) { if (!XmRepTypeValidValue(XmRID_AUTOMATIC_SELECTION, ncw->container.automatic,nw)) ncw->container.automatic = ccw->container.automatic; } if (ncw->container.entry_viewtype != ccw->container.entry_viewtype) { if (!XmRepTypeValidValue(XmRID_ENTRY_VIEW_TYPE, ncw->container.entry_viewtype,nw)) ncw->container.entry_viewtype = ccw->container.entry_viewtype; } if (ncw->container.include_model != ccw->container.include_model) { if (!XmRepTypeValidValue(XmRID_SPATIAL_INCLUDE_MODEL, ncw->container.include_model,nw)) ncw->container.include_model = ccw->container.include_model; } if (ncw->container.layout_type != ccw->container.layout_type) { if (!XmRepTypeValidValue(XmRID_LAYOUT_TYPE, ncw->container.layout_type,nw)) ncw->container.layout_type = ccw->container.layout_type; } if (ncw->container.outline_sep_style != ccw->container.outline_sep_style) { if (!XmRepTypeValidValue(XmRID_LINE_STYLE, ncw->container.outline_sep_style,nw)) ncw->container.outline_sep_style = ccw->container.outline_sep_style; } if (ncw->container.ob_policy != ccw->container.ob_policy) { if (!XmRepTypeValidValue(XmRID_OUTLINE_BUTTON_POLICY, ncw->container.ob_policy,nw)) ncw->container.ob_policy = ccw->container.ob_policy; } if (ncw->container.spatial_style != ccw->container.spatial_style) { if (!XmRepTypeValidValue(XmRID_SPATIAL_STYLE, ncw->container.spatial_style,nw)) ncw->container.spatial_style = ccw->container.spatial_style; } if (ncw->container.primary_ownership != ccw->container.primary_ownership) { if (!XmRepTypeValidValue(XmRID_PRIMARY_OWNERSHIP, ncw->container.primary_ownership,nw)) ncw->container.primary_ownership = ccw->container.primary_ownership; } if (ncw->container.resize_model != ccw->container.resize_model) { if (!XmRepTypeValidValue(XmRID_SPATIAL_RESIZE_MODEL, ncw->container.resize_model,nw)) ncw->container.resize_model = ccw->container.resize_model; } if (ncw->container.selection_policy != ccw->container.selection_policy) { if (!XmRepTypeValidValue(XmRID_SELECTION_POLICY, ncw->container.selection_policy,nw)) ncw->container.selection_policy = ccw->container.selection_policy; } if (ncw->container.selection_technique != ccw->container.selection_technique) { if (!XmRepTypeValidValue(XmRID_SELECTION_TECHNIQUE, ncw->container.selection_technique,nw)) ncw->container.selection_technique = ccw->container.selection_technique; } if (ncw->container.snap_model != ccw->container.snap_model) { if (!XmRepTypeValidValue(XmRID_SPATIAL_SNAP_MODEL, ncw->container.snap_model,nw)) ncw->container.snap_model = ccw->container.snap_model; } if (ncw->container.render_table == NULL) { XmFontList defaultFont = NULL; defaultFont = XmeGetDefaultRenderTable(nw,XmLABEL_FONTLIST); ncw->container.render_table = XmFontListCopy(defaultFont); } else ncw->container.render_table = XmFontListCopy(ncw->container.render_table); if (ccw->container.render_table) XmRenderTableFree(ccw->container.render_table); /* * Check if we'll need layout. * we update 4 differents boolean and at the end we * decide if relayout is actually needed. */ if (ncw->container.layout_type != ccw->container.layout_type) { if (CtrLayoutIsSPATIAL(ncw) && CtrSpatialStyleIsNONE(ncw)) need_expose = True; else container_need_layout = True; } if (ncw->manager.string_direction != ccw->manager.string_direction) container_need_layout = True; if ((ncw->container.margin_h != ccw->container.margin_h) || (ncw->container.margin_w != ccw->container.margin_w)) container_need_layout = True; if ((ncw->container.spatial_style != ccw->container.spatial_style) && (!(CtrLayoutIsSPATIAL(ncw) && CtrSpatialStyleIsNONE(ncw)))) spatial_need_layout = True; /* * Change all IconGadget children's XmNentryType to match */ if ((ncw->container.entry_viewtype != ccw->container.entry_viewtype) && (ncw->container.entry_viewtype != XmANY_ICON)) { ChangeView(nw,ncw->container.entry_viewtype); container_need_layout = True; } else { /* * If we're changing to XmSPATIAL from XmDETAIL || XmOUTLINE we need to * resize the Icons so they get rid of their "detail" room. */ if (CtrLayoutIsSPATIAL(ncw) && !CtrLayoutIsSPATIAL(ccw)) { XtWidgetGeometry desired; node = ncw->container.first_node; while (node) { cwid = node->widget_ptr; /* * Get and set preferred size */ XtQueryGeometry(cwid, NULL, &desired); XmeConfigureObject(cwid,cwid->core.x,cwid->core.y, desired.width,desired.height,0); /* * Get the next cwid, whether it's managed or not */ node = node->next_ptr; } } } if ((ncw->container.entry_viewtype != ccw->container.entry_viewtype) && ((ncw->container.entry_viewtype == XmSMALL_ICON) || (ccw->container.entry_viewtype == XmSMALL_ICON))) { ncw->container.current_width_in_cells = 0; ncw->container.current_height_in_cells = 0; spatial_need_layout = True; } if (CtrLayoutIsSPATIAL(ncw) && !CtrSpatialStyleIsNONE(ncw) && (CtrViewIsLARGE_ICON(ncw) || CtrViewIsANY_ICON(ncw))) { if ((ncw->container.large_cell_width != ccw->container.large_cell_width) && (ncw->container.large_cell_width == 0)) ncw->container.large_cell_dim_fixed = False; if ((ncw->container.large_cell_height != ccw->container.large_cell_height) && (ncw->container.large_cell_height == 0)) ncw->container.large_cell_dim_fixed = False; SetCellSizes(nw); if ((ncw->container.real_large_cellw != ccw->container.real_large_cellw) || (ncw->container.real_large_cellh != ccw->container.real_large_cellh)) { ncw->container.current_width_in_cells = 0; ncw->container.current_height_in_cells = 0; spatial_need_layout = True; } } if (CtrLayoutIsSPATIAL(ncw) && !CtrSpatialStyleIsNONE(ncw) && CtrViewIsSMALL_ICON(ncw)) { if ((ncw->container.small_cell_width != ccw->container.small_cell_width) && (ncw->container.small_cell_width == 0)) ncw->container.small_cell_dim_fixed = False; if ((ncw->container.small_cell_height != ccw->container.small_cell_height) && (ncw->container.small_cell_height == 0)) ncw->container.small_cell_dim_fixed = False; SetCellSizes(nw); if ((ncw->container.real_small_cellw != ccw->container.real_small_cellw) || (ncw->container.real_small_cellh != ccw->container.real_small_cellh)) { ncw->container.current_width_in_cells = 0; ncw->container.current_height_in_cells = 0; spatial_need_layout = True; } } /* * Deal with setting of special selectColor values. * No need to check for a change since if select_color is one of * the special value, it is always a change - only pixel * could have been there at that point in time */ if (ncw->container.select_color == XmDEFAULT_SELECT_COLOR) { XrmValue val; _XmSelectColorDefault(nw, 0, &val); ncw->container.select_color = *((Pixel*) val.addr); /* must notify the children at this point */ need_expose |= _XmNotifyChildrenVisual (cw, nw, VisualSelectColor); } else if (ncw->container.select_color == XmHIGHLIGHT_COLOR) { ncw->container.select_color = ncw->manager.highlight_color ; /* must notify the children at this point */ need_expose |= _XmNotifyChildrenVisual (cw, nw, VisualSelectColor); } /* * Hide all non-level-0 children if we've switched to SPATIAL layout. */ if (CtrLayoutIsSPATIAL(ncw) && !CtrLayoutIsSPATIAL(ccw)) { for (i = 0; i < ncw->composite.num_children; i++) { cwid = ncw->composite.children[i]; c = GetContainerConstraint(cwid); if (!CtrICON(cwid) || (c->entry_parent)) HideCwid(cwid); } } if ((ncw->container.collapsed_state_pixmap != ccw->container.collapsed_state_pixmap) || (ncw->container.expanded_state_pixmap != ccw->container.expanded_state_pixmap)) { /* compute the size of the new outline buttons */ SizeOutlineButton(nw); /* if the size has change, mark it for relayout */ if ((ncw->container.ob_width != ccw->container.ob_width) || (ncw->container.ob_height != ccw->container.ob_height)) outline_need_layout = True; /* update all the buttons */ ChangeOutlineButtons(nw); } /* * just Redisplay, if line style has changed. */ if (CtrLayoutIsOUTLINE_DETAIL(ncw) && (ncw->container.outline_sep_style != ccw->container.outline_sep_style)) need_expose = True; /* * Recalculate FirstColWidth. * */ if (ncw->container.first_col_width != ccw->container.first_col_width) { if (!ncw->container.first_col_width) { ncw->container.dynamic_resource |= FIRSTCW; } else { ncw->container.dynamic_resource &= ~FIRSTCW; ncw->container.real_first_col_width = ncw->container.first_col_width ; } outline_need_layout = True ; ncw->container.first_col_width = INVALID_DIMENSION ; } if ((ncw->container.ob_width != ccw->container.ob_width) || (ncw->container.outline_indent != ccw->container.outline_indent) || (ncw->container.ob_policy != ccw->container.ob_policy)) outline_need_layout = True ; /* * deal with XmNdetailTabList */ if ((ncw->container.detail_tablist != ccw->container.detail_tablist)) { detail_need_layout = True ; if (ccw->container.detail_tablist) XmTabListFree(ccw->container.detail_tablist) ; if (ncw->container.detail_tablist == NULL) ncw->container.dynamic_resource |= TABLIST; else ncw->container.dynamic_resource &= ~TABLIST; if (ncw->container.detail_tablist != NULL) ncw->container.detail_tablist = XmTabListCopy(ncw->container.detail_tablist,0,0); } /* * deal with XmNdetailOrder & XmNdetailOrderCount changes */ if ((ncw->container.detail_order != ccw->container.detail_order) || (ncw->container.detail_order_count != ccw->container.detail_order_count)) { detail_need_layout = True ; if (ccw->container.detail_order_count && ccw->container.detail_order) { XtFree((char*)ccw->container.detail_order) ; } if (ncw->container.detail_order_count && ncw->container.detail_order) { Cardinal * detail_order ; detail_order = (Cardinal *) XtMalloc(sizeof(Cardinal) * ncw->container.detail_order_count); for (i=0; i < ncw->container.detail_order_count; i++) detail_order[i] = ncw->container.detail_order[i] ; ncw->container.detail_order = detail_order ; } } /* * Reset cell/placed info if Spatial Layout options * have changed. */ if (CtrLayoutIsSPATIAL(ncw) && ((ncw->container.layout_type != ccw->container.layout_type) || (ncw->container.spatial_style != ccw->container.spatial_style))) { if (((XmContainerWidgetClass)XtClass(ncw))->container_class.place_item) (*((XmContainerWidgetClass) XtClass(ncw))->container_class.place_item)(nw,NULL,ANY_FIT); need_expose = True; } /* * Set selected items, if necessary. */ if ((ncw->container.selected_item_count != ccw->container.selected_item_count) || (ncw->container.selected_items != ccw->container.selected_items)) { int save_item_count; save_item_count = ncw->container.selected_item_count; ncw->container.selected_item_count = ccw->container.selected_item_count; DeselectAllCwids(nw); /* ncw->container.selected_item_count = 0 */ if (ncw->container.selected_items != NULL) { for (i = 0; i < save_item_count; i++) /* MarkCwid increments ncw->container.selected_item_count */ MarkCwid(ncw->container.selected_items[i],False); ncw->container.selected_items = NULL; } need_expose = True; } /* * Change GC's, if necessary. */ if ((ncw->manager.foreground != ccw->manager.foreground) || (ncw->core.background_pixel != ccw->core.background_pixel)) UpdateGCs(nw); { /* ** Deal with heading change ** ** There are two resources which affect whether or not the icon header ** is created and what is in it (not visibility): XmNdetailColumnHeading ** and XmNdetailColumnHeadingCount. The icon header is created if and ** only if we have string data in detail_heading and a positive !0 count ** in detail_heading_count. That much is simple. Complicating the issue ** (and necessary to preserve for compatibilty with subclasses) is the ** attempt both to catch a widget creation/destruction sequence in ** which the widget data happens to be at the same address and also to ** catch the case in which one of the resources is set without the ** other; the idea is that the detail_heading_count is marked invalid ** and the real value is moved out to a cached space in the widget ** record. (An earlier scheme which did similar things to the ** detail_heading field was removed when it became clear that the ** memory-management issues were impossible to track correctly.) ** (This scheme works except in the case in which the user has set a ** new real count to be higher than the number of strings in the ** existing string table; however, this can be considered user error, ** as it is for other cases in which widgets use combined list/number ** resource pairs rather than a resource which is a structure which ** contains the two values.) ** ** What this means is that detail_heading has the real values NULL ** and !NULL, and the transitions which are valid for it are between ** those two values. But detail_heading_count has three possible ** values: 0, which indicates that there has never been a count ** assigned, or indicates that the current count is 0; INVALID_COUNT, ** which indicates that a real value has been set and that that value ** is now in saved_detail_heading_count; and some other non-zero value, ** which is a new value coming into this routine or into Initialize. ** Valid transitions are as usual, with INVALID_COUNT taking the place ** of regular !0 values. Note that the transition to 0 is valid. ** ** At the end of the block, detail_heading is of course either NULL or ** !NULL and detail_heading_count is either 0 or INVALID_COUNT. The ** icon header exists when there is a valid count, either in this ** iteration or previously set, and valid data. We don't care whether ** or not the icon header is to be displayed; just indicate whether it ** was changed so that we know whether we need a relayout. */ #define NONE_CHANGED 0 #define COUNT_CHANGED (1<<0) #define HEADING_CHANGED (1<<1) unsigned char whichChanged = NONE_CHANGED; #define NONE_VALID 0 #define COUNT_VALID (1<<0) #define HEADING_VALID (1<<1) #define BOTH_VALID (COUNT_VALID | HEADING_VALID) unsigned char whichValid = NONE_VALID; if (ncw->container.detail_heading != ccw->container.detail_heading) whichChanged |= HEADING_CHANGED; if ((INVALID_COUNT != ncw->container.detail_heading_count) && (ncw->container.detail_heading_count != ncw->container.saved_detail_heading_count)) whichChanged |= COUNT_CHANGED; if (NONE_CHANGED != whichChanged) { if (ncw->container.detail_heading != NULL) whichValid |= HEADING_VALID; if (HEADING_VALID & whichValid) { if (HEADING_CHANGED & whichChanged) { /* We have a new set of heading strings. ** If we have a heading but the count is invalid, then we ** need to fetch it from one of the caches, so that the ** user can set the heading and the count in separate ** set-values invocations (really, we could just store the ** value where it goes, except that we want to track a ** change in the count in a memory-reuse case) */ if (INVALID_COUNT == ncw->container.detail_heading_count) { if (ncw->container.icon_header) { XtVaGetValues(GetRealIconHeader(nw), XmNdetailCount, &(ncw->container.detail_heading_count), NULL); /* the labelString takes detail_heading[0] */ ncw->container.detail_heading_count++; } else ncw->container.detail_heading_count = ncw->container.saved_detail_heading_count; } /* else we will use whatever value has been ** set -- either 0 or a new value */ } /* else use existing set of strings below; count must ** have changed */ } /* else if now NULL will result in destruction below */ /* changing a count without a valid heading doesn't require any work; ** in fact, we don't need to track a change to the count -- we just ** care about the current value or the value reconstructed above. */ if ( (ncw->container.detail_heading_count != 0) && (INVALID_COUNT != ncw->container.detail_heading_count) ) whichValid |= COUNT_VALID; if (BOTH_VALID == (BOTH_VALID & whichValid)) { /* we have valid data, and at least one resource changed */ /* we need an icon header; either create or update it */ assert(ncw->container.detail_heading); assert(ncw->container.detail_heading_count); assert(INVALID_COUNT != ncw->container.detail_heading_count); if (ccw->container.icon_header == NULL) CreateIconHeader(nw); else { /* pass False if there was a change in the strings as well ** as the count, True if it's only a change in the detail ** heading count. */ UpdateIconHeader(nw, (HEADING_CHANGED & whichChanged) ? False : True); } if (CtrLayoutIsDETAIL(ncw)) { assert(ncw->container.icon_header); XtManageChild(ncw->container.icon_header); /* may be redundant if this is a new state */ detail_need_layout = True; } } else { /* we need no icon header; if it existed, destroy it */ if (ncw->container.icon_header) { XtDestroyWidget(ncw->container.icon_header); ncw->container.icon_header = NULL; if (CtrLayoutIsDETAIL(ncw)) detail_need_layout = True; /* may be redundant if this is a new state */ } } if (INVALID_COUNT != ncw->container.detail_heading_count) /* including 0 */ ncw->container.saved_detail_heading_count = ncw->container.detail_heading_count; if (COUNT_VALID & whichValid) ncw->container.detail_heading_count = INVALID_COUNT; /* else if it is 0 don't do anything -- let value stay; the ** saved value is either 0 or a real !0 value but cannot be ** INVALID_COUNT */ } /* else no change to either, so just continue with SetValues code */ #undef NONE_CHANGED #undef COUNT_CHANGED #undef HEADING_CHANGED #undef NONE_VALID #undef COUNT_VALID #undef HEADING_VALID } if (CtrLayoutIsDETAIL(ncw) && !CtrLayoutIsDETAIL(ccw) && (ncw->container.icon_header != NULL)) { detail_need_layout = True ; XtManageChild(ncw->container.icon_header); } if (!CtrLayoutIsDETAIL(ncw) && CtrLayoutIsDETAIL(ccw) && (ncw->container.icon_header)) { outline_need_layout = True ; XtUnmanageChild(ncw->container.icon_header); if (XtParent(ncw->container.icon_header) != nw) { Widget real_icon_header = GetRealIconHeader(nw); /* reposition the container itself too */ nw->core.y -= real_icon_header->core.height ; } } /* * Update header margins, only if we are in the detail SW case * where the container.icon_header is the DA. */ if ((ncw->container.margin_w != ccw->container.margin_w) || (ncw->container.margin_h != ccw->container.margin_h) || (ncw->manager.foreground != ccw->manager.foreground) || (ncw->core.border_width != ccw->core.border_width) || (ncw->core.background_pixel != ccw->core.background_pixel) || (ncw->container.layout_type != ccw->container.layout_type) || (ncw->core.background_pixmap != ccw->core.background_pixmap)) { if ((CtrLayoutIsDETAIL(ncw)) && (ncw->container.icon_header) && (XtParent(ncw->container.icon_header) != nw)) { Widget real_icon_header = GetRealIconHeader(nw); /* we need to update the margin on the DA, resize it and reposition the container. */ /* if (0 == nw->core.y) */ nw->core.y = real_icon_header->core.height ; XtVaSetValues(ncw->container.icon_header, XmNmarginWidth, ncw->container.margin_w, XmNmarginHeight, ncw->container.margin_h, XmNbackground, ncw->core.background_pixel, XmNbackgroundPixmap, ncw->core.background_pixmap, XmNforeground, ncw->manager.foreground, NULL); XmeConfigureObject(ncw->container.icon_header, /* the DA */ ncw->container.icon_header->core.x, ncw->container.icon_header->core.y, real_icon_header->core.width + 2*ncw->container.margin_w, real_icon_header->core.height + ncw->container.margin_h, ncw->core.border_width); } } /* need also the check for change in borderPixel, borderPixmap... */ /* * Set internal variables that are based on resource values. */ if (ncw->container.selection_policy != ccw->container.selection_policy) ncw->container.kaddmode = (CtrPolicyIsMULTIPLE(ncw) || CtrPolicyIsSINGLE(ncw)); if (ncw->container.selection_technique != ccw->container.selection_technique) ncw->container.marquee_mode = (CtrTechIsTOUCH_ONLY(ncw) ? False : True); /** perform some logic */ spatial_need_layout |= container_need_layout ; outline_need_layout |= container_need_layout ; detail_need_layout |= outline_need_layout ; if (CtrLayoutIsSPATIAL(ncw) && !CtrSpatialStyleIsNONE(ncw) && !spatial_need_layout && (ncw->container.snap_model != ccw->container.snap_model)) { node = GetFirstNode(ncw); while (node) { (void)SnapCwid(node->widget_ptr, node->widget_ptr->core.x, node->widget_ptr->core.y, &snap_point); XmeConfigureObject(node->widget_ptr, snap_point.x,snap_point.y, node->widget_ptr->core.width,node->widget_ptr->core.height,0); node = GetNextNode(node); } need_expose = True ; } if (((CtrLayoutIsOUTLINE_DETAIL(ncw) && outline_need_layout) || (CtrLayoutIsDETAIL(ncw) && detail_need_layout) || (CtrLayoutIsSPATIAL(ncw) && spatial_need_layout))) { XmClipWindowTrait clipWindowTrait; XmScrollFrameTrait scrollFrameTrait; Widget swparent; /* get our preferred size first */ ncw->container.ideal_width = 0; ncw->container.ideal_height = 0; GetSize(nw,&ncw->container.ideal_width,&ncw->container.ideal_height); #ifdef FIX_1401 if (ncw->container.ideal_width && ncw->container.ideal_height && GetFirstNode(ncw)) { #endif ncw->core.width = ncw->container.ideal_width; ncw->core.height = ncw->container.ideal_height; #ifdef FIX_1401 } #endif Layout(nw); /* * update any scrolled window above to reflect a new original * y coordinate - CDExc19939 & CDExc23393 */ /* find a scrolled window*/ swparent = XtParent(ncw); clipWindowTrait = (XmClipWindowTrait) XmeTraitGet((XtPointer) XtClass(swparent), _XmQTclipWindow); if (clipWindowTrait != NULL) swparent = XtParent(swparent); scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass(swparent), XmQTscrollFrame); /* if we have one, update the geom */ if (scrollFrameTrait != NULL && scrollFrameTrait->version >= 1 && scrollFrameTrait->getInfo(swparent, NULL, NULL, NULL) && scrollFrameTrait->updateOrigGeom != NULL) { XtWidgetGeometry preferred; preferred.request_mode = CWY; preferred.y = ncw->core.y; scrollFrameTrait->updateOrigGeom(swparent, (Widget) ncw, &preferred); } need_expose = True ; } ncw->container.self = False; return(need_expose); } /* * XmRCallProc routine for checking font before setting it to NULL * if no value is specified for both XmNrenderTable and XmNfontList. * If "first_change_managed" is True, this function has been called * twice on same widget, thus * resource needs to be set NULL, otherwise * leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offset, XrmValue *value) { XmContainerWidget cw = (XmContainerWidget)wid; if (cw->container.first_change_managed) /* Been here before, so set resource = NULL */ value->addr = NULL; else { cw->container.first_change_managed = True; value->addr = (char*)&(cw->container.render_table); } } /* * XmRCallProc routine to determine the correct default collapsed * pixmap for this layout direction. */ /*ARGSUSED*/ static void DefaultCollapsedPixmap(Widget wid, int offset, XrmValue *value) { static Pixmap result; XmContainerWidget cw = (XmContainerWidget)wid; result = XmGetPixmapByDepth(XtScreen(wid), (LayoutIsRtoLM(cw) ? "collapsed_rtol" : "collapsed"), cw->manager.foreground, cw->core.background_pixel, cw->core.depth); value->size = sizeof(result); value->addr = (char *) &result; } /************************************************************************ * * QueryGeometry (Core Method) * ************************************************************************/ static XtGeometryResult QueryGeometry( Widget widget, XtWidgetGeometry *intended, XtWidgetGeometry *desired ) { /* deal with user initial size setting */ if (!XtIsRealized(widget)) { desired->width = XtWidth(widget) ; /* might be 0 */ desired->height = XtHeight(widget) ; /* might be 0 */ } else { /* always computes natural size afterwards */ desired->width = 0 ; desired->height = 0 ; } GetSize (widget, &desired->width, &desired->height); /* this function will set CWidth and CHeight */ return XmeReplyToQueryGeometry(widget, intended, desired) ; } /************************************************************************ * GetSize * * Updates the following container instance variables: * cw->container.ideal_width * cw->container.ideal_height * cw->container.first_column_width (if dynamic) ************************************************************************/ static void GetSize ( Widget wid, Dimension * pwidth, Dimension * pheight) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Widget cwid; XmContainerConstraint c; XtWidgetGeometry desired; XmTabList save_dynamic_tablist = NULL; Position save_x; if (CtrLayoutIsSPATIAL(cw)) /* * Get width & height from class method. */ { if (((XmContainerWidgetClass) XtClass(wid))->container_class.get_spatial_size) { (*((XmContainerWidgetClass) XtClass(wid))->container_class.get_spatial_size) (wid, pwidth, pheight); cw->container.ideal_width = *pwidth; cw->container.ideal_height = *pheight; } return; } /* * Calculate ideal width/height for OUTLINE/DETAIL. */ cw->container.ideal_width = 0; cw->container.ideal_height = cw->container.margin_h; /* * Find desired First Column width */ if (CtrIsDynamic(cw,FIRSTCW)) { cw->container.real_first_col_width = GetDynFirstColWidth(wid); } /* * Save the current dynamic tablist and set to NULL, so Icon's * response to QueryGeo will not be based on current width. */ if (CtrIsDynamic(cw,TABLIST)) { save_dynamic_tablist = cw->container.detail_tablist; cw->container.detail_tablist = NULL; } /* header first. */ if ((cwid = GetRealIconHeader(wid)) && (XtIsManaged(cwid)) && ((XtParent(cwid) == wid) || (XtIsManaged(XtParent(cwid))))) { XtQueryGeometry(cwid, NULL, &desired); save_x = cwid->core.x; cwid->core.x = MAX(0,cwid->core.x); cw->container.ideal_width = MAX(cw->container.ideal_width, cwid->core.x + desired.width); cw->container.ideal_height += desired.height; cwid->core.x = save_x; } /* then the icons */ node = GetFirstNode(cw); while(node) { cwid = node->widget_ptr; c = GetContainerConstraint(cwid); /* This query depends on the current first column width and the current x position. It assumes L to R, since the width/height would be the same. */ save_x = cwid->core.x; cwid->core.x = cw->container.margin_w + c->depth*cw->container.outline_indent + ((CtrOB_PRESENT(cw))?cw->container.ob_width:0) ; XtQueryGeometry(cwid, NULL, &desired); cw->container.ideal_width = MAX(cw->container.ideal_width, cwid->core.x + desired.width); cw->container.ideal_height += desired.height; cwid->core.x = save_x; node = GetNextNode(node); } cw->container.ideal_width += cw->container.margin_w; cw->container.ideal_height += cw->container.margin_h; /* Reset dynamic XmTabList, if necessary */ if (CtrIsDynamic(cw,TABLIST)) cw->container.detail_tablist = save_dynamic_tablist; /* here if we are in the dynamic first column case and in detail, with dynamic tablist, we want to grow up front by the amount of the difference between the old first column and the new one. In outline, that should happen automatacilly, but in detail, if tablist is dynamic, we have to compute it here. [ samborn, 25-MAY-1999 ] This used to be done in {Expand,Collapse}Cwid, but moved it here. The reason is that it needs to be applied to the ideal, not the current width in core. */ if (CtrLayoutIsDETAIL(cw) && CtrIsDynamic(cw,TABLIST)) { cw->container.ideal_width += cw->container.real_first_col_width; } if (!(*pwidth)) *pwidth = cw->container.ideal_width; if (!(*pheight)) *pheight = cw->container.ideal_height; } /************************************************************************ * GeometryManager (Composite Method) ************************************************************************/ /*ARGSUSED*/ static XtGeometryResult GeometryManager( Widget cwid, XtWidgetGeometry *desired, XtWidgetGeometry *allowed) /* unused */ { Widget wid = XtParent(cwid); XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c = GetContainerConstraint(cwid); Position save_x,save_y; Dimension save_width, save_height, save_border_width; unsigned char save_include_model; /* * Position and changes always allowed for spatial None */ if (CtrSpatialStyleIsNONE(cw)) { /* Move the child and save the original positions */ if (desired->request_mode & CWX) { cwid->core.x = desired->x; } if (desired->request_mode & CWY) { cwid->core.y = desired->y; } if (desired->request_mode & CWWidth) { cwid->core.width = desired->width; } if (desired->request_mode & CWHeight) { cwid->core.height = desired->height; } if (desired->request_mode & CWBorderWidth) { cwid->core.border_width = desired->border_width; } /* Request new size */ RequestSpatialGrowth(wid, cwid); return(XtGeometryYes); } /* * Called from inside Container (ChangeView routine) * Container will resize later, so do the job and * return XtGeometryYes. */ if (cw->container.self || /* No Spatial Layout methods? or not placed? or spatialStyleNONE? * Do whatever it wants. */ (!(((XmContainerWidgetClass)XtClass(wid))-> container_class.remove_item)) || (!(((XmContainerWidgetClass)XtClass(wid))-> container_class.place_item)) || (!CtrItemIsPlaced(cwid))) { if (desired->request_mode & CWX) cwid->core.x = desired->x; if (desired->request_mode & CWY) cwid->core.y = desired->y; if (desired->request_mode & CWWidth) cwid->core.width = desired->width; if (desired->request_mode & CWHeight) cwid->core.height = desired->height; if (desired->request_mode & CWBorderWidth) cwid->core.border_width = desired->border_width; return(XtGeometryYes); } /* * Position change allowed for Spatial layout && PlaceModel == CLOSEST */ if (((desired->request_mode & CWX) || (desired->request_mode & CWY)) && ((!CtrLayoutIsSPATIAL(cw)) || !CtrIncludeIsCLOSEST(cw))) return(XtGeometryNo); save_x = c->user_x; save_y = c->user_y; save_width = cwid->core.width; save_height = cwid->core.height; save_border_width = cwid->core.border_width ; if (desired->request_mode & CWX) c->user_x = desired->x; if (desired->request_mode & CWY) c->user_y = desired->y; if (desired->request_mode & CWWidth) cwid->core.width = desired->width; if (desired->request_mode & CWHeight) cwid->core.height = desired->height; if (desired->request_mode & CWBorderWidth) cwid->core.border_width = desired->border_width; /* * Outline/Detail Layout case. * Request are always granted, relayout is done. */ if (CtrLayoutIsOUTLINE_DETAIL(cw)) { XtWidgetGeometry geo_desired; geo_desired.width = 0; geo_desired.height = 0; /* means resize as you want */ RequestOutlineDetail(wid, &geo_desired); return(XtGeometryYes); } (*((XmContainerWidgetClass) XtClass(wid))->container_class.remove_item)(wid,cwid); /* * Fake out include model, so we get placed in the same spot. */ if (!CtrIncludeIsCLOSEST(cw)) { c->user_x = cwid->core.x; c->user_y = cwid->core.y; } save_include_model = cw->container.include_model; cw->container.include_model = XmCLOSEST; (*((XmContainerWidgetClass) XtClass(wid))->container_class.place_item)(wid,cwid,EXACT_FIT); cw->container.include_model = save_include_model; if (CtrItemIsPlaced(cwid)) return(XtGeometryYes); /* * See if we can grow and then re-layout to try again. */ if (RequestSpatialGrowth(wid,cwid)) LayoutSpatial(wid,False,NULL); cwid->core.width = save_width; cwid->core.height = save_height; cwid->core.border_width = save_border_width; if (CtrItemIsPlaced(cwid)) return(XtGeometryYes); /* * Place the item back where it was. */ if (CtrIncludeIsCLOSEST(cw)) { c->user_x = save_x; c->user_y = save_y; } save_include_model = cw->container.include_model; cw->container.include_model = XmCLOSEST; (*((XmContainerWidgetClass) XtClass(wid))->container_class.place_item)(wid,cwid,FORCE); cw->container.include_model = save_include_model; return(XtGeometryNo); } /************************************************************************ * ChangeManaged (Composite Method) ************************************************************************/ static void ChangeManaged( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; int i; Widget cwid; XmContainerConstraint c; /* * If it's one of our changes (SetValues), let's leave. */ if (cw->container.self) return; for (i = 0; i < cw->composite.num_children; i++) { cwid = cw->composite.children[i]; c = GetContainerConstraint(cwid); if (CtrICON(cwid)) if (!NodeIsActive(c->node_ptr)) HideCwid(cwid); if (CtrLayoutIsSPATIAL(cw) && (CtrOUTLINE_BUTTON(cwid) || CtrHEADER(cwid) || (c->entry_parent))) HideCwid(cwid); } if (CtrLayoutIsOUTLINE_DETAIL(cw)) ChangeManagedOutlineDetail(wid); else ChangeManagedSpatial(wid); } /************************************************************************ * ChangeManagedOutlineDetail (Private Function) ************************************************************************/ static void ChangeManagedOutlineDetail( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; XtWidgetGeometry geo_desired; if (!XtIsRealized(wid)) { geo_desired.width = cw->core.width ; geo_desired.height = cw->core.height ; /* can be 0 too */ } else { geo_desired.width = 0; geo_desired.height = 0; } RequestOutlineDetail(wid, &geo_desired); cw->container.first_change_managed = False; } /************************************************************************ * ChangeManagedSpatial (Private Function) ************************************************************************/ static void ChangeManagedSpatial( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; Widget cwid; XtWidgetGeometry geo_desired; CwidNode node; if ((CtrSpatialStyleIsGRID(cw) || CtrSpatialStyleIsCELLS(cw))) { if ((CtrViewIsSMALL_ICON(cw) && (!cw->container.small_cell_dim_fixed)) || ((CtrViewIsLARGE_ICON(cw) || CtrViewIsANY_ICON(cw)) && (!cw->container.large_cell_dim_fixed))) SetCellSizes(wid); } if (cw->container.first_change_managed) /* * First time through. Get initial size from QueryGeo */ { if (((XmContainerWidgetClass) XtClass(wid))->container_class.get_spatial_size) { Dimension width, height; if (!XtIsRealized(wid)) { width = cw->core.width; /* Can be 0 */ height = cw->core.height; } else { width = 0; height = 0; } (*((XmContainerWidgetClass) XtClass(wid))->container_class.get_spatial_size) (wid, &width, &height); geo_desired.request_mode = (CWWidth | CWHeight); geo_desired.width = width; geo_desired.height = height; if (geo_desired.width < 1) geo_desired.width = cw->core.width ; if (geo_desired.height < 1) geo_desired.height = cw->core.height ; _XmMakeGeometryRequest(wid, &geo_desired); } cw->container.first_change_managed = False; } node = cw->container.first_node; while (node) /* * Now loop through the linked list to see who needs to be * removed from the Spatial Layout. */ { cwid = node->widget_ptr; if ((!(XtIsManaged(cwid))) && CtrItemIsPlaced(cwid) && (((XmContainerWidgetClass) XtClass(wid))->container_class.remove_item)) (*((XmContainerWidgetClass) XtClass(wid))->container_class.remove_item)(wid,cwid); node = node->next_ptr; } /* * Layout will handle placing newly-managed cwids */ LayoutSpatial(wid,True,NULL); } /************************************************************************ * RequestSpatialGrowth (Private Function) * * As opposed to GetSpatialSize which makes a calculation based upon * placing all icons in a configuration as close to a square as possible, * this function calculates only the additional size needed to accomodate * the one icon passed in as "cwid". This routine also makes the * Geometry request. ************************************************************************/ static Boolean RequestSpatialGrowth( Widget wid, Widget cwid) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c; Boolean grow_width_allowed = True; Boolean grow_height_allowed = True; Dimension width_increase = 0; Dimension height_increase = 0; int new_width,new_height; int cell_width,cell_height; int width_in_cells, height_in_cells; XtWidgetGeometry geo_desired; /* * Must determine the constraints on growth from XmNresizeModel. * At Realize time, XmNspatialResizeModel is assumed to be XmGROW_BALANCED. * Note: XmNspatialResizeModel is only valid * for XmNspatialStyle XmGRID || XmCELLS. */ if (!CtrSpatialStyleIsNONE(cw)) { if ((CtrResizeModelIsGROW_MINOR(cw)) && XtIsRealized(wid)) { if (CtrIsHORIZONTAL(cw)) { grow_width_allowed = False; } else { grow_height_allowed = False; } } if ((CtrResizeModelIsGROW_MAJOR(cw)) && XtIsRealized(wid)) { if (CtrIsHORIZONTAL(cw)) { grow_height_allowed = False; } else { grow_width_allowed = False; } } if ((!grow_width_allowed) && (!grow_height_allowed)) return(False); } c = GetContainerConstraint(cwid); if (CtrSpatialStyleIsNONE(cw)) { if (grow_width_allowed) { new_width = cwid->core.x + cwid->core.width + cw->container.margin_w; if (new_width > cw->core.width) width_increase = new_width - cw->core.width; } if (grow_height_allowed) { new_height = cwid->core.y + cwid->core.height + cw->container.margin_h; if (new_height > cw->core.height) height_increase = new_height - cw->core.height; } } else { if (grow_width_allowed) { if (CtrViewIsSMALL_ICON(cw)) cell_width = cw->container.real_small_cellw; else cell_width = cw->container.real_large_cellw; if (CtrSpatialStyleIsCELLS(cw)) { width_in_cells = cwid->core.width / cell_width; if (cwid->core.width % cell_width) width_in_cells++; width_increase = width_in_cells * cell_width; } else width_increase = cell_width; if (CtrIncludeIsCLOSEST(cw) && (c->user_x > (cw->core.width - cw->container.margin_w))) { width_in_cells = (c->user_x - (cw->core.width - cw->container.margin_w)) / cell_width; if (c->user_x - (cw->core.width - cw->container.margin_w) % cell_width) width_in_cells++; width_increase += (width_in_cells - 1) * cell_width; } } if (grow_height_allowed) { if (CtrViewIsSMALL_ICON(cw)) cell_height = cw->container.real_small_cellh; else cell_height = cw->container.real_large_cellh; if (CtrSpatialStyleIsCELLS(cw)) { height_in_cells = cwid->core.height / cell_height; if (cwid->core.height % cell_height) height_in_cells++; height_increase = height_in_cells * cell_height; } else height_increase = cell_height; if (CtrIncludeIsCLOSEST(cw) && (c->user_y > (cw->core.height - cw->container.margin_h))) { height_in_cells = (c->user_y - (cw->core.height - cw->container.margin_h)) / cell_height; if (c->user_y - (cw->core.height - cw->container.margin_h) % cell_height) height_in_cells++; height_increase += (height_in_cells - 1) * cell_height; } } } geo_desired.request_mode = 0; if (width_increase != 0) { geo_desired.request_mode |= CWWidth; geo_desired.width = cw->core.width + width_increase; } if (height_increase != 0) { geo_desired.request_mode |= CWHeight; geo_desired.height = cw->core.height + height_increase; } if (geo_desired.request_mode == 0) return(False); /* * Make the geometry request (this will update the core width/height.) * We return True and it's the caller's responsibility to call * LayoutSpatial() so all the appropriate variables to keep up * with cell_count,etc. are updated. */ return(_XmMakeGeometryRequest(wid,&geo_desired) == XtGeometryYes); } /************************************************************************ * ConstraintInitialize (Constraint Method) ************************************************************************/ /*ARGSUSED*/ static void ConstraintInitialize( Widget rcwid, /* unused */ Widget ncwid, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmContainerWidget cw = (XmContainerWidget)XtParent(ncwid); XmContainerConstraint nc = GetContainerConstraint(ncwid); XmContainerConstraint pc; /* parent's constraints */ nc->related_cwid = NULL; nc->cwid_type = cw->container.create_cwid_type; if (!CtrICON(ncwid)) return; /* * validate resource values */ if (!XmRepTypeValidValue(XmRID_OUTLINE_STATE,nc->outline_state,ncwid)) nc->outline_state = XmCOLLAPSED; if (nc->position_index != XmLAST_POSITION) nc->position_index = MAX(0,nc->position_index); /* I can be my own grandpa but not my own descendant; pre-check */ if (nc->entry_parent) if (ContainerIsDescendant(ncwid, nc->entry_parent)) nc->entry_parent = NULL; /* * Enforce margins. Save initial x,y info. */ if (!LayoutIsRtoLM(cw)) ncwid->core.x = MAX(ncwid->core.x,(Position)cw->container.margin_w); ncwid->core.y = MAX(ncwid->core.y,(Position)cw->container.margin_h); nc->user_x = ncwid->core.x; nc->user_y = ncwid->core.y; /* * Create new node for child and insert into list. */ InsertNode(NewNode(ncwid)); /* * Override XmNviewType */ if (!CtrViewIsANY_ICON(cw)) SetViewType(ncwid,cw->container.entry_viewtype); nc->selection_visual = GetVisualEmphasis(ncwid); if (nc->selection_visual == XmSELECTED) { cw->container.selected_item_count++; if (cw->container.anchor_cwid == NULL) cw->container.anchor_cwid = ncwid; } nc->selection_state = nc->selection_visual; if (nc->entry_parent) { pc = GetContainerConstraint(nc->entry_parent); nc->depth = pc->depth +1; cw->container.max_depth = MAX(cw->container.max_depth, nc->depth); if (pc->outline_state == XmEXPANDED) nc->visible_in_outline = pc->visible_in_outline; else nc->visible_in_outline = False; if ((!nc->visible_in_outline) || (!CtrLayoutIsOUTLINE_DETAIL(cw))) HideCwid(ncwid); } else { nc->visible_in_outline = True; nc->depth = 0; } /* * Initialize variables used by * Container SpatialLayout methods. */ nc->cell_idx = NO_CELL; } /************************************************************************ * ConstraintDestroy (Constraint Method) ************************************************************************/ static void ConstraintDestroy( Widget cwid) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); if (cwid == cw->container.anchor_cwid) cw->container.anchor_cwid = NULL; if (!CtrICON(cwid)) return; #ifdef FIX_1384 cw->container.icon_header = NULL; #endif { CwidNode node = c->node_ptr->child_ptr; while (node) { Widget child = node->widget_ptr; XtVaSetValues(child, XmNentryParent, NULL, NULL); /* because the above operation has changed the ** linked-list, we just pull the first child off the ** list, rather than move along it */ node = c->node_ptr->child_ptr; } } DeleteNode(cwid); ContainerResequenceNodes(cw, c->entry_parent); if (c->selection_state == XmSELECTED) { unsigned char save_state = cw->container.selection_state; cw->container.selection_state = XmNOT_SELECTED; MarkCwid(cwid,False); cw->container.selection_state = save_state; } if (XtIsRealized((Widget)cw)) XClearArea(XtDisplay((Widget)cw),XtWindow((Widget)cw),0,0,0,0,True); } /************************************************************************ * ConstraintSetValues (Constraint Method) ************************************************************************/ /*ARGSUSED*/ static Boolean ConstraintSetValues( Widget ccwid, Widget rcwid, /* unused */ Widget ncwid, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmContainerWidget cw = (XmContainerWidget)XtParent(ncwid); XmContainerConstraint cc = GetContainerConstraint(ccwid); XmContainerConstraint nc = GetContainerConstraint(ncwid); XmContainerConstraint pc; /* Parent's Contraints */ Boolean need_layout = False; Boolean need_expose = False; /* * SetValues called from inside Container - let's get out of here! */ if (cw->container.self) return(False); if (!CtrICON(ncwid)) return(False); /* * Validate resource values */ if (nc->outline_state != cc->outline_state) { if (!XmRepTypeValidValue(XmRID_OUTLINE_STATE,nc->outline_state,ncwid)) nc->outline_state = cc->outline_state; } if (nc->position_index < 0) if (XmLAST_POSITION != nc->position_index) nc->position_index = cc->position_index; /* I can be my own grandpa but not my own descendant; pre-check */ if (nc->entry_parent != cc->entry_parent) if (nc->entry_parent) if (ContainerIsDescendant(ncwid, nc->entry_parent)) nc->entry_parent = cc->entry_parent; /* * Check if layout required. */ if (CtrLayoutIsOUTLINE_DETAIL(cw) && ((nc->entry_parent != cc->entry_parent) || (nc->position_index != cc->position_index) || (nc->outline_state != cc->outline_state))) need_layout = True; /* * Check for change in selection status */ nc->selection_visual = GetVisualEmphasis(ncwid); if (nc->selection_visual != cc->selection_visual) { if (nc->selection_visual == XmSELECTED) { cw->container.selected_item_count++; if (cw->container.anchor_cwid == NULL) cw->container.anchor_cwid = ncwid; } else cw->container.selected_item_count--; nc->selection_state = nc->selection_visual; } /* * Changes in parentage or position. * If XmNpositionIndex has changed, but the "node" has no siblings, * then there's no need to change the node's position in the * linked list. */ if ((nc->entry_parent != cc->entry_parent) || ((nc->position_index != cc->position_index) && ((nc->node_ptr->prev_ptr) || (nc->node_ptr->next_ptr)))) { SeverNode(nc->node_ptr); ContainerResequenceNodes(cw, cc->entry_parent); ContainerResequenceNodes(cw, nc->entry_parent); InsertNode(nc->node_ptr); } if (nc->entry_parent != cc->entry_parent) { if (nc->entry_parent == NULL) { nc->depth = 0; nc->visible_in_outline = True; ContainerResetDepths(nc); } else { pc = GetContainerConstraint(nc->entry_parent); nc->depth = pc->depth +1; ContainerResetDepths(nc); #ifdef FIX_1425 FindMaxDepths(cc, (Widget)cw); #else cw->container.max_depth = MAX(cw->container.max_depth,nc->depth); #endif if (pc->outline_state == XmEXPANDED) nc->visible_in_outline = pc->visible_in_outline; else nc->visible_in_outline = False; if ((!nc->visible_in_outline) || (!CtrLayoutIsOUTLINE_DETAIL(cw))) HideCwid(ncwid); } } if (nc->outline_state != cc->outline_state) OutlineButtonAction(ncwid, nc->outline_state, (XEvent*)NULL); /* * Change Spatial locations. */ if (((ncwid->core.x != ccwid->core.x) || (ncwid->core.y != ccwid->core.y)) && CtrLayoutIsSPATIAL(cw) && (((XmContainerWidgetClass) XtClass((Widget)cw))->container_class.remove_item) && (((XmContainerWidgetClass) XtClass((Widget)cw))->container_class.place_item)) { unsigned char save_include_model; unsigned char save_snap_model; (*((XmContainerWidgetClass) XtClass((Widget)cw))->container_class.remove_item) ((Widget)cw,ncwid); save_include_model = cw->container.include_model; cw->container.include_model = XmCLOSEST; save_snap_model = cw->container.snap_model; cw->container.snap_model = XmNONE; (*((XmContainerWidgetClass) XtClass((Widget)cw))->container_class.place_item) ((Widget)cw,ncwid,FORCE); cw->container.include_model = save_include_model; cw->container.snap_model = save_snap_model; need_expose = True; } if (need_layout) { if (CtrLayoutIsOUTLINE_DETAIL(cw)) { cw->container.ideal_width = 0; cw->container.ideal_height = 0; GetSize((Widget)cw,&cw->container.ideal_width, &cw->container.ideal_height); cw->core.width = cw->container.ideal_width; cw->core.height = cw->container.ideal_height; } Layout((Widget)cw); need_expose = True; } if (need_expose && XtIsRealized((Widget)cw)) XClearArea(XtDisplay((Widget)cw),XtWindow((Widget)cw),0,0,0,0,True); /* everything that needs to be done so far has been */ return(False); } /************************************************************************ * TestFitItem (Container Method) ************************************************************************/ static Boolean TestFitItem( Widget wid, Widget cwid, Position x, Position y) { XmContainerWidget cw = (XmContainerWidget)wid; int trial_cell; XPoint cell_coord; XmContainerConstraint cwidc = GetContainerConstraint(cwid); /* * Must be a 2-D layout. */ if (CtrLayoutIsOUTLINE_DETAIL(cw)) return(True); if (y < (Position)cw->container.margin_h) return(False); if (LayoutIsRtoLM(cw)) { if (x > (Position)(cw->core.width - cw->container.margin_w)) return(False); } else if (x < (Position)cw->container.margin_w) return(False); if (CtrSpatialStyleIsGRID(cw) || CtrSpatialStyleIsCELLS(cw)) { trial_cell = GetCellFromCoord(wid,x,y); /* First, we can always put a widget back where it started, but not if something else is there */ if (cw->container.cells[trial_cell] != 0) { if (cwidc -> cell_idx == trial_cell) return(True); else return(False); } (void)GetCoordFromCell(wid,trial_cell, &cell_coord); if (CtrSpatialStyleIsCELLS(cw)) if (XRectInRegion(cw->container.cells_region, cell_coord.x,cell_coord.y, cwid->core.width,cwid->core.height) != RectangleOut) return(False); } if (CtrSpatialStyleIsNONE(cw)) { XtWidgetGeometry child_req; XtGeometryResult result; /* If we don't need to resize, just return */ if ((XtWidth(cw) >= (x + XtWidth(cwid) + cw -> container.margin_w)) && (XtHeight(cw) >= (y + XtHeight(cwid) + cw -> container.margin_h))) return(True); /* Otherwise, we'll try it via the geometry manager */ child_req.request_mode = CWX | CWY; child_req.x = x; child_req.y = y; /* Make the request, but always allow the drop */ result = _XmMakeGeometryRequest(cwid, &child_req); } return(True); } /************************************************************************ * PlaceItem (Container Method) ************************************************************************/ static Boolean PlaceItem( Widget wid, Widget cwid, unsigned char fit_type) { XmContainerWidget cw = (XmContainerWidget)wid; /* cwid NULL means initialize */ if (cwid == NULL) { PlaceItemReset(wid); return(True); } if (CtrItemIsPlaced(cwid)) return(True); switch(cw->container.spatial_style) { case XmNONE: PlaceItemNone(wid,cwid,fit_type); break; case XmGRID: case XmCELLS: PlaceItemGridCells(wid,cwid,fit_type); } if ((!CtrItemIsPlaced(cwid)) && (!CtrSpatialStyleIsNONE(cw))) HideCwid(cwid); return(CtrItemIsPlaced(cwid)); } /************************************************************************ * RemoveItem (Container Method) ************************************************************************/ static Boolean RemoveItem( Widget wid, Widget cwid) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c = GetContainerConstraint(cwid); XRectangle cwid_rect; Region cwid_region; if (!CtrItemIsPlaced(cwid)) return(True); switch(cw->container.spatial_style) { case XmCELLS: cwid_rect.x = cwid->core.x; cwid_rect.y = cwid->core.y; cwid_rect.width = cwid->core.width; cwid_rect.height = cwid->core.height; cwid_region = XCreateRegion(); XUnionRectWithRegion(&cwid_rect,cwid_region,cwid_region); XSubtractRegion(cw->container.cells_region,cwid_region, cw->container.cells_region); XDestroyRegion(cwid_region); case XmGRID: cw->container.cells[c->cell_idx]--; case XmNONE: c->cell_idx = NO_CELL; } return(True); } /************************************************************************ * GetSpatialSize (Container method) ************************************************************************/ static void GetSpatialSize ( Widget wid, Dimension * pwidth, Dimension * pheight) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; XmContainerConstraint c; ContainerCwidCellInfo cwid_info; int cwid_info_count; Dimension trial_width = 0, trial_height = 0; Dimension cell_width = 0,cell_height = 0; int width_in_cells = 1,height_in_cells = 1; int min_width_in_cells = 1,min_height_in_cells = 1; int cwid_width_in_cells,cwid_height_in_cells; int cell_count = 0; Dimension width = 1, height = 1 ; if (CtrSpatialStyleIsGRID(cw) || CtrSpatialStyleIsCELLS(cw)) { if (CtrViewIsSMALL_ICON(cw)) { cell_width = cw->container.real_small_cellw; cell_height = cw->container.real_small_cellh; } else { cell_width = cw->container.real_large_cellw; cell_height = cw->container.real_large_cellh; } } /* * Must allocate array to hold cwid information so we can use it to * calculate adjustments to ideal size when we're in XmCELLS. Don't * really know how many we'll need, so allocate one for all children * of Container to be sure. */ if (CtrSpatialStyleIsCELLS(cw)) cwid_info = (ContainerCwidCellInfo) XtCalloc(cw->composite.num_children, sizeof(XmContainerCwidCellInfoRec)); else cwid_info = NULL; cwid_info_count = 0; /* * Go through the linked list of cwids and lets determine * their geometry needs. */ node = cw->container.first_node; while (node) { if (CtrSpatialStyleIsNONE(cw)) /* * In this case, we care about the desired x,y coordinates of * each child, so let's compute the smallest rectangle that * would contain all of them and still fulfill their desires: * (trial_width X trial_height) */ { trial_width = MAX(trial_width,node->widget_ptr->core.x + node->widget_ptr->core.width); trial_height = MAX(trial_height,node->widget_ptr->core.y + node->widget_ptr->core.height); } else if (CtrIncludeIsCLOSEST(cw)) { c = GetContainerConstraint(node->widget_ptr); trial_width = MAX(trial_width, c->user_x + node->widget_ptr->core.width); trial_height = MAX(trial_height, c->user_y + node->widget_ptr->core.height); } if (CtrSpatialStyleIsGRID(cw)) /* * CtrSpatialStyleIsGRID: One cell per cwid */ cell_count++; if (CtrSpatialStyleIsCELLS(cw)) /* * CtrSpatialStyleIsCELLS: Need enough cells to completely * contain all cwids. */ { cwid_width_in_cells = (node->widget_ptr)->core.width / cell_width; if ((node->widget_ptr)->core.width % cell_width) cwid_width_in_cells++; min_width_in_cells = MAX(min_width_in_cells,cwid_width_in_cells); cwid_height_in_cells = (node->widget_ptr)->core.height / cell_height; if ((node->widget_ptr)->core.height % cell_height) cwid_height_in_cells++; min_height_in_cells = MAX(min_height_in_cells, cwid_height_in_cells); cell_count += cwid_width_in_cells * cwid_height_in_cells; cwid_info[cwid_info_count].cwid_width_in_cells = cwid_width_in_cells; cwid_info[cwid_info_count].cwid_height_in_cells = cwid_height_in_cells; cwid_info_count++; } node = GetNextNode(node); } if (CtrSpatialStyleIsNONE(cw) || CtrIncludeIsCLOSEST(cw)) { trial_width += 2 * cw->container.margin_w; trial_height += 2 * cw->container.margin_h; } if (CtrSpatialStyleIsNONE(cw)) { width = trial_width; height = trial_height; } else /* CtrSpatialStyleIsGRID || CtrSpatialStyleIsCELLS */ { /* * Simple square will do. */ width_in_cells = Isqrt(cell_count); height_in_cells = width_in_cells; if (CtrSpatialStyleIsCELLS(cw)) /* * Make adjustments to accomodate very wide or tall cwids. * Then call GetSpatialSizeCellAdjustment() to do trial * placement and make furthur adjustments. */ { width_in_cells = MAX(width_in_cells,min_width_in_cells); height_in_cells = MAX(height_in_cells,min_height_in_cells); if (cwid_info != NULL) { GetSpatialSizeCellAdjustment(wid,&width_in_cells, &height_in_cells, cwid_info,cwid_info_count); XtFree((char*)cwid_info); } } /* * Add in the margins and calculate the pixels needed. */ width = width_in_cells * cell_width + 2 * cw->container.margin_w; height = height_in_cells * cell_height + 2 * cw->container.margin_h; if (CtrIncludeIsCLOSEST(cw)) /* * Make adjustments to accomodate cwids' desired x,y placement. */ { width = MAX(width,trial_width); height = MAX(height,trial_height); } } if (!*pwidth) *pwidth = width ; if (!*pheight) *pheight = height ; } /************************************************************************ * PlaceItemNone (Private Function) ************************************************************************/ /*ARGSUSED*/ static void PlaceItemNone( Widget wid, Widget cwid, unsigned char fit_type) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c = GetContainerConstraint(cwid); PlaceCwid(cwid,cwid->core.x,cwid->core.y); /* * Mark the cwid as placed (any value except NO_CELL) if it's within * the Container boundaries. */ if (((cwid->core.x + cwid->core.width) <= (cw->core.width - cw->container.margin_w)) && ((cwid->core.y + cwid->core.height) <= (cw->core.height - cw->container.margin_h))) c->cell_idx = 1; } /************************************************************************ * PlaceItemGridCells (Private Function) ************************************************************************/ static void PlaceItemGridCells( Widget wid, Widget cwid, unsigned char fit_type) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c = GetContainerConstraint(cwid); int start_cell; int trial_cell = 0; int closest_cell = -1; Boolean fits; XPoint cell_coord; XPoint place_point; XRectangle cwidrect; if (CtrIncludeIsAPPEND(cw)) trial_cell = cw->container.next_free_cell; if (CtrIncludeIsCLOSEST(cw)) { closest_cell = GetCellFromCoord(wid,c->user_x,c->user_y); trial_cell = closest_cell; if (trial_cell >= cw->container.cell_count) { if (fit_type == EXACT_FIT) return; /* exact fit or nothing! */ /* Adjust for current width/height boundaries */ trial_cell = GetCellFromCoord(wid, MIN(c->user_x, (Position)(cw->container.current_width_in_cells * (CtrViewIsSMALL_ICON(cw) ? cw->container.real_small_cellw : cw->container.real_large_cellw) - 1)), MIN(c->user_y, (Position)(cw->container.current_height_in_cells * (CtrViewIsSMALL_ICON(cw) ? cw->container.real_small_cellh : cw->container.real_large_cellh) - 1))); if (trial_cell >= cw->container.cell_count) /* This shouldn't occur - but just in case */ trial_cell = cw->container.next_free_cell; } } start_cell = trial_cell; if (trial_cell < cw->container.cell_count) { while (!CtrItemIsPlaced(cwid)) { fits = False; if ((cw->container.cells[trial_cell] == 0) && (fit_type != FORCE)) { if (CtrSpatialStyleIsGRID(cw)) fits = True; if (CtrSpatialStyleIsCELLS(cw)) { if (CtrIncludeIsCLOSEST(cw) && (trial_cell == closest_cell)) (void)SnapCwid(cwid,c->user_x,c->user_y, &place_point); else { (void)GetCoordFromCell(wid,trial_cell, &cell_coord); (void)SnapCwid(cwid,cell_coord.x,cell_coord.y,&place_point); } if ((XRectInRegion(cw->container.cells_region, place_point.x,place_point.y, cwid->core.width,cwid->core.height) == RectangleOut) && (place_point.x + cwid->core.width <= cw->core.width - cw->container.margin_w) && (place_point.y + cwid->core.height <= cw->core.height - cw->container.margin_h)) fits = True; } } if (fits || (fit_type == FORCE)) { cw->container.cells[trial_cell]++; c->cell_idx = trial_cell; } trial_cell++; if (trial_cell == cw->container.cell_count) trial_cell = 0; if (start_cell == trial_cell) break; } } if (!CtrItemIsPlaced(cwid)) return; if (CtrIncludeIsAPPEND(cw)) cw->container.next_free_cell = c->cell_idx + 1; if (CtrIncludeIsCLOSEST(cw) && (c->cell_idx == closest_cell)) (void)SnapCwid(cwid,c->user_x,c->user_y, &place_point); else { (void)GetCoordFromCell(wid,c->cell_idx, &cell_coord); (void)SnapCwid(cwid,cell_coord.x,cell_coord.y, &place_point); } if (CtrSpatialStyleIsCELLS(cw)) { cwidrect.x = place_point.x; cwidrect.y = place_point.y; cwidrect.width = cwid->core.width; cwidrect.height = cwid->core.height; XUnionRectWithRegion(&cwidrect,cw->container.cells_region, cw->container.cells_region); } PlaceCwid(cwid,place_point.x,place_point.y); } /************************************************************************ * GetCellFromCoord (Private Function) ************************************************************************/ static int GetCellFromCoord( Widget wid, Position x, Position y) { XmContainerWidget cw = (XmContainerWidget)wid; int cell_width,cell_height; int row,col; cell_width = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellw : cw->container.real_large_cellw; cell_height = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellh : cw->container.real_large_cellh; /* * Note: x & y parameters include Container margins. */ if (!LayoutIsRtoLM(cw)) x = MAX(0,x - cw->container.margin_w); y = MAX(0,y - cw->container.margin_h); row = y / cell_height; col = x / cell_width; if (LayoutIsRtoLM(cw)) col = cw->container.current_width_in_cells - col - 1; if (CtrIsHORIZONTAL(cw)) return(cw->container.current_width_in_cells * row + col); else return(cw->container.current_height_in_cells * col + row); } /************************************************************************ * GetCoordFromCell (Private Function) ************************************************************************/ static XPoint * GetCoordFromCell( Widget wid, int cell_idx, XPoint *point) { XmContainerWidget cw = (XmContainerWidget)wid; int cell_width,cell_height; int row,col; if (CtrIsHORIZONTAL(cw)) { row = cell_idx / cw->container.current_width_in_cells; col = cell_idx - (row * cw->container.current_width_in_cells); } else { col = cell_idx / cw->container.current_height_in_cells; row = cell_idx - (col * cw->container.current_height_in_cells); } if (LayoutIsRtoLM(cw)) col = cw->container.current_width_in_cells - col - 1; cell_width = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellw : cw->container.real_large_cellw; cell_height = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellh : cw->container.real_large_cellh; /* * Note: returned point must include Container Margins */ point->x = col * cell_width; if (!LayoutIsRtoLM(cw)) point->x += cw->container.margin_w; point->y = row * cell_height + cw->container.margin_h; return(point); } /************************************************************************ * PlaceItemReset (Private Function) ************************************************************************/ static void PlaceItemReset( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; int cell_width = 0,cell_height = 0; int width_in_cells = 0,height_in_cells = 0; /* * Deallocate old cell structure. */ if ((cw->container.cells) && (((XmContainerWidgetClass)XtClass(wid))->container_class.remove_item)) { node = cw->container.first_node; while (node) { if (CtrItemIsPlaced(node->widget_ptr)) (*((XmContainerWidgetClass) XtClass(wid))->container_class.remove_item) (wid,node->widget_ptr); node = GetNextNode(node); } XtFree((char*)cw->container.cells); cw->container.cells = NULL; } if (CtrSpatialStyleIsNONE(cw)) return; /* * Create new cell structure. */ cell_width = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellw : cw->container.real_large_cellw; cell_height = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellh : cw->container.real_large_cellh; if (cw->core.width > cell_width + 2 * cw->container.margin_w) width_in_cells = (cw->core.width - 2 * cw->container.margin_w) / cell_width; else width_in_cells = 1; if (cw->core.height > cell_height + 2 * cw->container.margin_h) height_in_cells = (cw->core.height - 2 * cw->container.margin_h) / cell_height; else height_in_cells = 1; cw->container.cell_count = width_in_cells * height_in_cells; cw->container.cells = (int *)XtCalloc(cw->container.cell_count,sizeof(int)); cw->container.next_free_cell = 0; cw->container.current_width_in_cells = width_in_cells; cw->container.current_height_in_cells = height_in_cells; if (CtrSpatialStyleIsGRID(cw)) return; XSubtractRegion(cw->container.cells_region,cw->container.cells_region, cw->container.cells_region); } /************************************************************************ * PlaceCwid (Private Function) ************************************************************************/ static void PlaceCwid( Widget cwid, Position x, Position y) { XmContainerWidget cw; if (cwid == NULL) return; cw = (XmContainerWidget)XtParent(cwid); /* * Adjust for margins */ if (LayoutIsRtoLM(cw)) { if ((cwid->core.width + (Position)cw->container.margin_w) >= cw->core.width) cwid->core.x = MIN(cwid->core.x,cw->core.width - cwid->core.width - (Position)cw->container.margin_w); } else x = MAX(x,(Position)cw->container.margin_w); y = MAX(y,(Position)cw->container.margin_h); if ((x != cwid->core.x) || (y != cwid->core.y)) XmeConfigureObject(cwid,x,y,cwid->core.width,cwid->core.height,0); } /************************************************************************ * SnapCwid (Private Function) ************************************************************************/ static XPoint * SnapCwid( Widget cwid, Position x, Position y, XPoint *point) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); int target_cell; XPoint target_cell_coord; int cell_width = 0,cell_height = 0; int width_in_cells = 0,height_in_cells = 0; target_cell = GetCellFromCoord((Widget)cw,x,y); (void)GetCoordFromCell((Widget)cw,target_cell, &target_cell_coord); point->x = target_cell_coord.x; point->y = target_cell_coord.y; if (CtrSnapModelIsSNAP(cw) && !LayoutIsRtoLM(cw)) return(point); if (CtrViewIsSMALL_ICON(cw)) { cell_width = cw->container.real_small_cellw; cell_height = cw->container.real_small_cellh; } else { cell_width = cw->container.real_large_cellw; cell_height = cw->container.real_large_cellh; } if (CtrSpatialStyleIsGRID(cw)) width_in_cells = height_in_cells = 1; else /* CtrSpatialStyleIsCELLS(cw) */ { width_in_cells = cwid->core.width / cell_width; if (cwid->core.width % cell_width) width_in_cells++; height_in_cells = cwid->core.height / cell_height; if (cwid->core.height % cell_height) height_in_cells++; } if (CtrSnapModelIsSNAP(cw)) /* LayoutIsRtoLM(cw) */ { point->x += (width_in_cells * cell_width) - cwid->core.width; return(point); } if (CtrSnapModelIsNONE(cw)) { point->x = MIN(x, target_cell_coord.x + (width_in_cells * cell_width) - 1); point->y = MIN(y, target_cell_coord.y + (height_in_cells * cell_height) - 1); return(point); } if (CtrSpatialStyleIsGRID(cw)) { /* Adjust large items to 0 so we don't try to center them */ width_in_cells = (cell_width < cwid->core.width) ? 0 : 1; height_in_cells = (cell_height < cwid->core.height) ? 0 : 1; } /* CtrSnapModelIsCENTER */ /* If this is small icon view then the icon is placed centered up/down, if this is large icon view then the icon is placed centered left/right */ if (CtrViewIsSMALL_ICON(cw)) { if (height_in_cells != 0) point->y += ((height_in_cells * cell_height) - cwid->core.height) / 2; if (LayoutIsRtoLM(cw)) point->x += ((width_in_cells * cell_width) - cwid->core.width); } else { if (width_in_cells != 0) point->x += ((width_in_cells * cell_width) - cwid->core.width) / 2; if (height_in_cells != 0) point->y += (height_in_cells * cell_height) - cwid->core.height; } return(point); } /************************************************************************ * HideCwid (Private Function) ************************************************************************/ static void HideCwid( Widget cwid) { XmContainerConstraint c; CwidNode node; CwidNode child_node; if (cwid == NULL) return; c = GetContainerConstraint(cwid); XmeConfigureObject( cwid,(Position)(0 - ((Widget)cwid)->core.width), (Position)(0 - ((Widget)cwid)->core.height), ((Widget)cwid)->core.width,((Widget)cwid)->core.height,0); if (!CtrICON(cwid)) return; /* * Hide our button! */ if (c->related_cwid) HideCwid(c->related_cwid); /* * If we're XmEXPANDED, then let's hide our children too. */ if (c->outline_state != XmEXPANDED) return; node = c->node_ptr; child_node = node->child_ptr; while (child_node) { HideCwid(child_node->widget_ptr); c = GetContainerConstraint(child_node->widget_ptr); if (c->related_cwid) HideCwid(c->related_cwid); child_node = child_node->next_ptr; } } /************************************************************************ * ContainerStartTransfer (Action Proc) ************************************************************************/ static void ContainerStartTransfer( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; Widget cwid; int transfer_action; if (cw->container.selecting) /* Don't allow drag while select in progress */ return; if (CtrLayoutIsOUTLINE_DETAIL(wid)) { cwid = (Widget)_XmInputForGadget(wid, event->xbutton.x,event->xbutton.y); if ((cwid) && CtrOUTLINE_BUTTON(cwid)) { XtCallActionProc(wid,"ManagerGadgetDrag", event,params,*num_params); return; } } /* * Allocate transfer context record to temporarily hold * event and operation argument until we can figure out whether * this is a primary transfer or the start of a drag. * If a context record already exists (might happen if there * was a Btn2 double-click, for example), then just reuse it * instead of malloc'ing a new one. */ if (cw->container.transfer_action == NULL) { cw->container.transfer_action = (ContainerXfrAction) XtCalloc(1,sizeof(XmContainerXfrActionRec)); cw->container.transfer_action->event = (XEvent *) XtCalloc(1,sizeof(XEvent)); } cw->container.transfer_action->wid = (Widget)cw; memcpy((void *)cw->container.transfer_action->event,(void *)event, sizeof(XEvent)); cw->container.transfer_action->params = params; cw->container.transfer_action->num_params = num_params; if (num_params == 0 || _XmConvertActionParamToRepTypeId((Widget) cw, XmRID_CONTAINER_START_TRANSFER_ACTION_PARAMS, params[0], False, &transfer_action) == False) { /* We couldn't convert the value. Just assume a value of _COPY. */ transfer_action = _COPY; } if (transfer_action == _LINK) cw->container.transfer_action->operation = XmLINK; else if (transfer_action == _MOVE) cw->container.transfer_action->operation = XmMOVE; else cw->container.transfer_action->operation = XmCOPY; /* * Set off timer. */ if (cw->container.transfer_timer_id != 0) XtRemoveTimeOut(cw->container.transfer_timer_id); cw->container.transfer_timer_id = XtAppAddTimeOut( XtWidgetToApplicationContext((Widget)cw), XtGetMultiClickTime(XtDisplay((Widget)cw)), DragStart,(XtPointer)cw); } /************************************************************************ * ContainerEndTransfer (Action Proc) ************************************************************************/ /*ARGSUSED*/ static void ContainerEndTransfer( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; /* * Kill the timeout. If it already expired, then we didn't make * the interval for primary transfer, so return. */ if (cw->container.transfer_timer_id != 0) XtRemoveTimeOut(cw->container.transfer_timer_id); else return; if (cw->container.transfer_action == NULL) return; /* No context record, shouldn't happen */ if (cw->container.transfer_action->operation == XmLINK) ContainerPrimaryLink(wid, cw->container.transfer_action->event,NULL,0); else if (cw->container.transfer_action->operation == XmMOVE) ContainerPrimaryMove(wid, cw->container.transfer_action->event,NULL,0); else ContainerPrimaryCopy(wid, cw->container.transfer_action->event,NULL,0); XtFree((char*)cw->container.transfer_action->event); XtFree((char*)cw->container.transfer_action); cw->container.transfer_action = NULL; } /************************************************************************ * ContainerPrimaryCopy (Action Proc) ************************************************************************/ /*ARGSUSED*/ static void ContainerPrimaryCopy( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XPoint *loc_data; /* WARNING: do not free the following memory in this module. It * will be freed in FreeLocationData, triggered at the end of * the data transfer operation. */ loc_data = (XPoint *) XtMalloc(sizeof(XPoint)); loc_data->x = event->xbutton.x; loc_data->y = event->xbutton.y; XmePrimarySink(wid,XmCOPY, (XtPointer) loc_data,event->xbutton.time); } /************************************************************************ * ContainerPrimaryLink (Action Proc) ************************************************************************/ /*ARGSUSED*/ static void ContainerPrimaryLink( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XPoint *loc_data; /* WARNING: do not free the following memory in this module. It * will be freed in FreeLocationData, triggered at the end of * the data transfer operation. */ loc_data = (XPoint *) XtMalloc(sizeof(XPoint)); loc_data->x = event->xbutton.x; loc_data->y = event->xbutton.y; XmePrimarySink(wid,XmLINK, (XtPointer) loc_data,event->xbutton.time); } /************************************************************************ * ContainerPrimaryMove (Action Proc) ************************************************************************/ /*ARGSUSED*/ static void ContainerPrimaryMove( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XPoint *loc_data; /* WARNING: do not free the following memory in this module. It * will be freed in FreeLocationData, triggered at the end of * the data transfer operation. */ loc_data = (XPoint *) XtMalloc(sizeof(XPoint)); loc_data->x = event->xbutton.x; loc_data->y = event->xbutton.y; XmePrimarySink(wid,XmMOVE, (XtPointer) loc_data,event->xbutton.time); } /************************************************************************ * Actions to dispatch based on button1 transfer options * * The first parameter is the default action to call if * enableBtn1Transfer is XmOFF * * If there is a second parameter, it is COPY, MOVE or LINK. ************************************************************************/ /*ARGSUSED*/ static void ContainerNoop( Widget wid, /* unused */ XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { /* Do nothing */ } /************************************************* * ContainerHandleBtn1Down * * We do a drag if enableBtn1Transfer is not XmOFF * Otherwise we do a select. * * Also, if nothing is selected we go ahead and do * a complete selection (Call ContainerBeginSelect,EndSelect) * so that we complete the selection before starting the * drag. *************************************************/ static void ContainerHandleBtn1Down( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint cwidc; Widget cwid = (Widget) NULL; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); if (*num_params < 2) { XmeWarning(wid, WRONGPARAMS); return; } cwid = ObjectAtPoint(wid, event->xbutton.x,event->xbutton.y); if (cwid != (Widget) NULL) cwidc = GetContainerConstraint(cwid); else cwidc = (XmContainerConstraint) NULL; if (dpy -> display.enable_btn1_transfer && cwid != (Widget) NULL && !CtrOUTLINE_BUTTON(cwid)) { /* Select if over unselected item or background*/ if (cwidc -> selection_state != XmSELECTED) { XtCallActionProc(wid, params[0], event, NULL, 0); ContainerEndSelect(wid,event,NULL,0); } else { SetupDrag(wid,event,params,num_params); cw->container.selecting = False; } if (cwidc -> selection_state == XmSELECTED) XtCallActionProc(wid, "ContainerStartTransfer", event, ¶ms[1], 1); else XtCallActionProc(wid, params[0], event, NULL, 0); } else { XtCallActionProc(wid, params[0], event, NULL, 0); } } static void ContainerHandleBtn1Motion( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); if (*num_params < 1) { XmeWarning(wid, WRONGPARAMS); return; } /* If we're doing btn1 transfer, then check to see if we've moved enough to start the drag */ if (dpy->display.enable_btn1_transfer != XmOFF && (! cw -> container.selecting)) { int dx, dy; dx = event->xmotion.x - cw->container.anchor_point.x; dy = event->xmotion.y - cw->container.anchor_point.y; if (ABS(dx) >= MOTION_THRESHOLD || ABS(dy) >= MOTION_THRESHOLD) { /* Force the drag to start */ DragStart((XtPointer) cw, &cw -> container.transfer_timer_id); } else { return; } } else { /* Do the default action */ XtCallActionProc(wid, params[0], event, NULL, 0); } } static void ContainerHandleBtn1Up( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); if (*num_params < 1) { XmeWarning(wid, WRONGPARAMS); return; } /* If we're doing btn1 transfer, then remove the timer that starts the drag */ if (dpy->display.enable_btn1_transfer) { if (cw->container.transfer_timer_id != 0) XtRemoveTimeOut(cw->container.transfer_timer_id); if (cw->container.drag_context != (Widget) NULL) { XmDragCancel(cw->container.drag_context); cw->container.drag_context = (Widget) NULL; } } XtCallActionProc(wid, params[0], event, NULL, 0); } static void ContainerHandleBtn2Down( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); if (*num_params < 2) { XmeWarning(wid, WRONGPARAMS); return; } if (dpy -> display.enable_btn1_transfer == XmBUTTON2_ADJUST) XtCallActionProc(wid, "ContainerBeginExtend", event, NULL, 0); else XtCallActionProc(wid, params[0], event, ¶ms[1], 1); } static void ContainerHandleBtn2Motion( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); if (*num_params < 1) { XmeWarning(wid, WRONGPARAMS); return; } if (dpy->display.enable_btn1_transfer != XmBUTTON2_ADJUST && (! cw -> container.selecting)) { int dx, dy; dx = event->xmotion.x - cw->container.anchor_point.x; dy = event->xmotion.y - cw->container.anchor_point.y; if (ABS(dx) >= MOTION_THRESHOLD || ABS(dy) >= MOTION_THRESHOLD) { /* Force the drag to start */ DragStart((XtPointer) cw, &cw -> container.transfer_timer_id); } else { return; } } else XtCallActionProc(wid, params[0], event, NULL, 0); } static void ContainerHandleBtn2Up( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); if ((dpy -> display.enable_btn1_transfer == XmBUTTON2_ADJUST) || (!num_params) || (*num_params < 1)) XtCallActionProc(wid, "ContainerEndExtend", event, NULL, 0); else XtCallActionProc(wid, params[0], event, NULL, 0); } /************************************************************************ * ContainerBeginSelect (Action Proc) ************************************************************************/ static void ContainerBeginSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; Widget cwid = (Widget) NULL; cw->container.cancel_pressed = False; if (CtrLayoutIsOUTLINE_DETAIL(wid)) { cwid = (Widget)_XmInputForGadget(wid,event->xbutton.x,event->xbutton.y); if ((cwid) && CtrOUTLINE_BUTTON(cwid)) { XtCallActionProc(wid,"ManagerGadgetArm",event,params,*num_params); cw->container.ob_pressed = True; return; } } cw->container.extending_mode = (CtrPolicyIsMULTIPLE(cw)); cw->container.selecting = True; StartSelect(wid,event,params,num_params); } /************************************************************************ * ContainerButtonMotion (Action Proc) ************************************************************************/ static void ContainerButtonMotion( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; Boolean selection_changes; /* if we are outside the window update LeaveDir */ if (cw->container.scroll_proc_id) { Widget clip = XtParent(wid); int rx, ry; /* event coords relative to the clip */ rx = event->xmotion.x + (int)wid->core.x; ry = event->xmotion.y + (int)wid->core.y; if (rx <= (int)clip->core.x) { cw->container.LeaveDir |= LEFTLEAVE; cw->container.LeaveDir &= ~RIGHTLEAVE; } else { cw->container.LeaveDir &= ~LEFTLEAVE; if (rx >= (int)clip->core.width) cw->container.LeaveDir |= RIGHTLEAVE; else cw->container.LeaveDir &= ~RIGHTLEAVE; } if (ry <= (int)clip->core.y) { cw->container.LeaveDir |= TOPLEAVE; cw->container.LeaveDir &= ~BOTTOMLEAVE; } else { cw->container.LeaveDir &= ~TOPLEAVE; if (ry >= (int)clip->core.height) cw->container.LeaveDir |= BOTTOMLEAVE; else cw->container.LeaveDir &= ~BOTTOMLEAVE; } /* store relative coordinates of the event */ cw->container.last_xmotion_x = rx; cw->container.last_xmotion_y = ry; } if (cw->container.cancel_pressed) return; if (cw->container.ob_pressed) { XtCallActionProc(wid,"ManagerGadgetButtonMotion", event,params,*num_params); return; } if (CtrPolicyIsSINGLE(wid)) return; if ((cw->container.extend_pressed) && (CtrLayoutIsSPATIAL(cw))) return; selection_changes = ProcessButtonMotion(wid,event,params,num_params); cw->container.no_auto_sel_changes |= selection_changes; if (CtrIsAUTO_SELECT(cw) && selection_changes) CallSelectCB(wid,event,XmAUTO_MOTION); } /************************************************************************ * ContainerEndSelect (Action Proc) ************************************************************************/ static void ContainerEndSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; Boolean selection_changes; /* first remove TimeOutProc if any */ cw->container.LeaveDir = 0; if (cw->container.scroll_proc_id) { XtRemoveTimeOut(cw->container.scroll_proc_id); cw->container.scroll_proc_id = 0; } cw->container.selecting = False; if (cw->container.cancel_pressed) return; if (cw->container.toggle_pressed) { ContainerEndToggle(wid,event,params,num_params); return; } if (cw->container.extend_pressed) { ContainerEndExtend(wid,event,params,num_params); return; } if (cw->container.ob_pressed) { XtCallActionProc(wid,"ManagerGadgetActivate", event,params,*num_params); cw->container.ob_pressed = False; return; } if (CtrPolicyIsSINGLE(cw)) { GainPrimary(wid,event->xbutton.time); CallSelectCB(wid,event,XmAUTO_UNSET); return; } selection_changes = ProcessButtonMotion(wid,event,params,num_params); cw->container.no_auto_sel_changes |= selection_changes; if (cw->container.marquee_drawn) { DrawMarquee(wid); cw->container.marquee_drawn = False; if XtIsRealized(wid) XClearArea(XtDisplay(wid),XtWindow(wid), cw->container.marquee_smallest.x, cw->container.marquee_smallest.y, cw->container.marquee_largest.x, cw->container.marquee_largest.y,True); } if (cw->container.anchor_cwid) { if (!cw->container.kaddmode) { Boolean set_cursor = False; Widget current_focus = XmGetFocusWidget(wid); /* Only move the focus if the old focus child is no longer in the set. We can tell by looking at the constraint record off the current focus widget */ if (current_focus != (Widget) NULL && XtParent(current_focus) == wid) { XmContainerConstraint c = GetContainerConstraint(current_focus); if (c->selection_visual != XmSELECTED) set_cursor = True; } else { set_cursor = True; } if (set_cursor) SetLocationCursor(cw->container.anchor_cwid); } if (CtrPolicyIsBROWSE(cw)) cw->container.no_auto_sel_changes |= MarkCwid(cw->container.anchor_cwid,False); else /* CtrPolicyIsMULTIPLE || CtrPolicyIsEXTENDED */ SetMarkedCwids(wid); } GainPrimary(wid,event->xbutton.time); if (CtrIsAUTO_SELECT(cw)) if (selection_changes) CallSelectCB(wid,event,XmAUTO_CHANGE); else CallSelectCB(wid,event,XmAUTO_NO_CHANGE); else CallSelectCB(wid,event,XmAUTO_UNSET); } /************************************************************************ * ContainerBeginToggle (Action Proc) ************************************************************************/ static void ContainerBeginToggle( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; Widget cwid; if (CtrLayoutIsOUTLINE_DETAIL(wid)) { cwid = (Widget)_XmInputForGadget(wid, event->xbutton.x,event->xbutton.y); if ((cwid) && CtrOUTLINE_BUTTON(cwid)) { XtCallActionProc(wid,"ManagerGadgetTraverseCurrent", event,params,*num_params); cw->container.ob_pressed = True; return; } } cw->container.toggle_pressed = True; cw->container.cancel_pressed = False; if (CtrPolicyIsSINGLE(cw) || CtrPolicyIsBROWSE(cw)) return; cw->container.extending_mode = True; cw->container.selecting = True; StartSelect(wid,event,params,num_params); } /************************************************************************ * ContainerEndToggle (Action Proc) ************************************************************************/ static void ContainerEndToggle( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; cw->container.toggle_pressed = False; cw->container.selecting = False; if (cw->container.cancel_pressed) return; if (cw->container.ob_pressed) { cw->container.ob_pressed = False; return; } if (CtrPolicyIsSINGLE(cw) || CtrPolicyIsBROWSE(cw)) return; ContainerEndSelect(wid,event,params,num_params); } /************************************************************************ * ContainerBeginExtend (Action Proc) ************************************************************************/ static void ContainerBeginExtend( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Widget current_cwid; if (CtrLayoutIsOUTLINE_DETAIL(wid)) { current_cwid = (Widget)_XmInputForGadget(wid, event->xbutton.x,event->xbutton.y); if ((current_cwid) && CtrOUTLINE_BUTTON(current_cwid)) { XtCallActionProc(wid,"ManagerGadgetArm", event,params,*num_params); cw->container.ob_pressed = True; return; } } cw->container.extend_pressed = True; cw->container.cancel_pressed = False; if (CtrPolicyIsSINGLE(cw) || CtrPolicyIsBROWSE(cw)) return; if (CtrLayoutIsSPATIAL(cw)) return; current_cwid = ObjectAtPoint(wid,event->xbutton.x,event->xbutton.y); /* Handle ObjectAtPoint returning an outline button */ if ((current_cwid) && CtrOUTLINE_BUTTON(current_cwid)) current_cwid = NULL; SetLocationCursor(current_cwid); if (current_cwid == NULL) return; if (cw->container.anchor_cwid == NULL) return; if (!cw->container.extending_mode) DeselectAllCwids(wid); (void) MarkCwidsInRange(wid,cw->container.anchor_cwid, current_cwid,(Boolean)True); if (CtrIsAUTO_SELECT(cw)) CallSelectCB(wid,event,XmAUTO_BEGIN); cw->container.selecting = True; } /************************************************************************ * ContainerEndExtend (Action Proc) ************************************************************************/ static void ContainerEndExtend( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Boolean selection_changes; cw->container.extend_pressed = False; cw->container.selecting = False; if (cw->container.cancel_pressed) return; if (cw->container.ob_pressed) { XtCallActionProc(wid,"ManagerGadgetActivate", event,params,*num_params); cw->container.ob_pressed = False; return; } if (CtrPolicyIsSINGLE(cw) || CtrPolicyIsBROWSE(cw)) return; if (CtrLayoutIsSPATIAL(cw)) return; selection_changes = ProcessButtonMotion(wid,event,params,num_params); if (cw->container.marquee_drawn) { DrawMarquee(wid); cw->container.marquee_drawn = False; if XtIsRealized(wid) XClearArea(XtDisplay(wid),XtWindow(wid), cw->container.marquee_smallest.x, cw->container.marquee_smallest.y, cw->container.marquee_largest.x, cw->container.marquee_largest.y,True); } SetMarkedCwids(wid); GainPrimary(wid,event->xbutton.time); if (CtrIsAUTO_SELECT(cw)) if (selection_changes) CallSelectCB(wid,event,XmAUTO_CHANGE); else CallSelectCB(wid,event,XmAUTO_NO_CHANGE); else CallSelectCB(wid,event,XmAUTO_UNSET); } /************************************************************************ * ContainerCancel (Action Proc) ************************************************************************/ static void ContainerCancel( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Boolean selection_changes = False; if (cw->container.ob_pressed) { XtCallActionProc(wid,"ManagerParentCancel", event,params,*num_params); cw->container.ob_pressed = False; return; } cw->container.toggle_pressed = False; cw->container.extend_pressed = False; if (CtrPolicyIsSINGLE(cw)) return; cw->container.cancel_pressed = True; if (CtrPolicyIsBROWSE(cw)) { if (cw->container.anchor_cwid) { selection_changes = UnmarkCwidVisual( cw->container.anchor_cwid); if (CtrIsAUTO_SELECT(cw) && selection_changes) { GainPrimary(wid,event->xbutton.time); CallSelectCB(wid,event,XmAUTO_CANCEL); } } return; } /* CtrPolicyIsMULTIPLE || CtrPolicyIsEXTENDED */ selection_changes = ResetMarkedCwids(wid); if (cw->container.marquee_drawn) { DrawMarquee(wid); cw->container.marquee_drawn = False; if XtIsRealized(wid) XClearArea(XtDisplay(wid),XtWindow(wid), cw->container.marquee_smallest.x, cw->container.marquee_smallest.y, cw->container.marquee_largest.x, cw->container.marquee_largest.y,True); } if (CtrIsAUTO_SELECT(cw) && selection_changes) { GainPrimary(wid,event->xbutton.time); CallSelectCB(wid,event,XmAUTO_CANCEL); } } /************************************************************************ * ContainerSelect (Action Proc) ************************************************************************/ static void ContainerSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; Widget focus_cwid = XmGetFocusWidget(wid); if (CtrLayoutIsOUTLINE_DETAIL(wid) && focus_cwid && (focus_cwid != wid) && CtrOUTLINE_BUTTON(focus_cwid)) { XtCallActionProc(wid,"ManagerGadgetSelect", event,params,*num_params); return; } cw->container.extending_mode = cw->container.kaddmode; KBSelect(wid,event,params,num_params); } /************************************************************************ * ContainerExtend (Action Proc) ************************************************************************/ /*ARGSUSED*/ static void ContainerExtend( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Widget focus_cwid = XmGetFocusWidget(wid); if ((focus_cwid == wid) || (focus_cwid == NULL)) return; if (CtrOUTLINE_BUTTON(focus_cwid)) return; if (CtrLayoutIsSPATIAL(cw)) return; if (CtrPolicyIsSINGLE(cw) || CtrPolicyIsBROWSE(cw)) return; if (!(cw->container.kaddmode)) cw->container.no_auto_sel_changes |= DeselectAllCwids(wid); cw->container.no_auto_sel_changes |= MarkCwidsInRange(wid,cw->container.anchor_cwid, focus_cwid,(Boolean)False); GainPrimary(wid,event->xbutton.time); if (CtrIsAUTO_SELECT(cw)) { CallSelectCB(wid,event,XmAUTO_BEGIN); CallSelectCB(wid,event,XmAUTO_NO_CHANGE); } else if (cw->container.no_auto_sel_changes) CallSelectCB(wid,event,XmAUTO_UNSET); } /************************************************************************ * ContainerMoveCursor (Action Proc) ************************************************************************/ static void ContainerMoveCursor( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; Widget focus_cwid; if (*num_params == 0) return; if (_XmGetFocusPolicy(wid) == XmPOINTER) return; CalcNextLocationCursor(wid,params[0]); focus_cwid = XmGetFocusWidget(wid); if (focus_cwid && (focus_cwid != wid) && CtrOUTLINE_BUTTON(focus_cwid)) return; if (cw->container.kaddmode) return; cw->container.extending_mode = False; KBSelect(wid,event,params,num_params); } /************************************************************************ * ContainerExtendCursor (Action Proc) ************************************************************************/ static void ContainerExtendCursor( Widget wid, XEvent *event, String *params, Cardinal *num_params) { if (*num_params == 0) return; if (_XmGetFocusPolicy(wid) == XmPOINTER) return; if (CtrLayoutIsSPATIAL(wid)) return; if (CtrPolicyIsSINGLE(wid) || CtrPolicyIsBROWSE(wid)) return; CalcNextLocationCursor(wid,params[0]); ContainerExtend(wid,event,params,num_params); } /************************************************************************ * ContainerToggleMode (Action Proc) ************************************************************************/ /*ARGSUSED*/ static void ContainerToggleMode( Widget wid, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Widget focus_cwid = XmGetFocusWidget(wid); if CtrPolicyIsEXTENDED(cw) cw->container.kaddmode = !cw->container.kaddmode; if (XtIsRealized(wid) && focus_cwid && (focus_cwid != wid)) XClearArea(XtDisplay(wid),XtWindow(wid), focus_cwid->core.x, focus_cwid->core.y, focus_cwid->core.width, focus_cwid->core.height, True); } /************************************************************************ * ContainerSelectAll (Action Proc) ************************************************************************/ static void ContainerSelectAll( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; if (CtrPolicyIsSINGLE(cw) || CtrPolicyIsBROWSE(cw)) { ContainerSelect(wid,event,params,num_params); return; } cw->container.no_auto_sel_changes |= SelectAllCwids(wid); GainPrimary(wid,event->xbutton.time); if (CtrIsAUTO_SELECT(cw)) { CallSelectCB(wid,event,XmAUTO_BEGIN); CallSelectCB(wid,event,XmAUTO_NO_CHANGE); } else if (cw->container.no_auto_sel_changes) CallSelectCB(wid,event,XmAUTO_UNSET); } /************************************************************************ * ContainerDeselectAll (Action Proc) ************************************************************************/ /*ARGSUSED*/ static void ContainerDeselectAll( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; cw->container.no_auto_sel_changes |= DeselectAllCwids(wid); GainPrimary(wid,event->xbutton.time); if (CtrIsAUTO_SELECT(cw) && (!CtrPolicyIsSINGLE(cw))) { CallSelectCB(wid,event,XmAUTO_BEGIN); CallSelectCB(wid,event,XmAUTO_NO_CHANGE); } else if (cw->container.no_auto_sel_changes) CallSelectCB(wid,event,XmAUTO_UNSET); } /************************************************************************ * ContainerActivate (Action Proc) ************************************************************************/ static void ContainerActivate( Widget wid, XEvent *event, String *params, Cardinal *num_params) { Widget focus_cwid = XmGetFocusWidget(wid); if ((focus_cwid == wid) || (focus_cwid == NULL)) return; if (CtrLayoutIsOUTLINE_DETAIL(wid) && CtrOUTLINE_BUTTON(focus_cwid)) { XtCallActionProc(wid,"ManagerParentActivate", event,params,*num_params); return; } CallActionCB(focus_cwid,event); } /************************************************************************ * ContainerExpandOrCollapse (Action Proc) ************************************************************************/ static void ContainerExpandOrCollapse( Widget wid, XEvent *event, String *params, Cardinal *num_params) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c; Widget focus_cwid; int state_to; unsigned char new_state; if (!num_params || *num_params != 1 || !params) return; if ( ((focus_cwid=XmGetFocusWidget(wid)) == NULL) || (wid != XtParent(focus_cwid)) || (CtrLayoutIsSPATIAL(cw)) || (CtrOUTLINE_BUTTON(focus_cwid))) return; if (_XmConvertActionParamToRepTypeId((Widget) cw, XmRID_CONTAINER_EXPAND_OR_COLLAPSE_ACTION_PARAMS, params[0], False, &state_to) == False) return; c = GetContainerConstraint(focus_cwid); /* check LtoR and reduce to _COLLAPSE and _EXPAND values */ if ((state_to == _COLLAPSE) || (state_to == _LEFT && (! LayoutIsRtoLM(cw))) || (state_to == _RIGHT && (LayoutIsRtoLM(cw)))) new_state = XmCOLLAPSED; else new_state = XmEXPANDED; /* check if there is anything to do */ if (new_state == c->outline_state) return; OutlineButtonAction(focus_cwid, new_state, NULL); } /************************************************************************ * ContainerConvertProc (Trait Method) ************************************************************************/ static void ContainerConvertProc( Widget wid, XtPointer closure, XmConvertCallbackStruct *cs) { enum { XmA_MOTIF_LOSE_SELECTION, XmA_MOTIF_EXPORT_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmA_COMPOUND_TEXT, XmA_MOTIF_COMPOUND_STRING, XmA_MOTIF_DRAG_OFFSET, XmA_MOTIF_DROP, XmA_TARGETS, XmAUTF8_STRING, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_LOSE_SELECTION, XmS_MOTIF_EXPORT_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSCOMPOUND_TEXT, XmS_MOTIF_COMPOUND_STRING, XmS_MOTIF_DRAG_OFFSET, XmS_MOTIF_DROP, XmSTARGETS, XmSUTF8_STRING, }; XmContainerWidget cw = (XmContainerWidget)wid; WidgetList items = NULL; int item_count = 0; XtPointer value = NULL; unsigned int length = 0; int format = 0; Atom type = 0; Atom atoms[XtNumber(atom_names)]; /* Get Atom values from cache. */ assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(wid), atom_names, XtNumber(atom_names), False, atoms); if (cs->target == atoms[XmA_MOTIF_LOSE_SELECTION]) { cw->container.have_primary = False; cs->value = NULL; cs->length = 0; cs->type = 0; cs->status = XmCONVERT_DONE; return; } if ((cs->target == atoms[XmA_TARGETS]) || (cs->target == atoms[XmA_MOTIF_EXPORT_TARGETS]) || (cs->target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS])) { Atom *targargs; int n = 0; if (cs -> target == atoms[XmA_TARGETS]) targargs = XmeStandardTargets(wid,6,&n); else targargs = (Atom*) XtMalloc(sizeof(Atom) * 6); targargs[n++] = XA_PIXMAP; targargs[n++] = atoms[XmAUTF8_STRING]; targargs[n++] = atoms[XmA_COMPOUND_TEXT]; targargs[n++] = atoms[XmA_MOTIF_COMPOUND_STRING]; if (cw->container.drag_context != (Widget) NULL) targargs[n++] = atoms[XmA_MOTIF_DRAG_OFFSET]; value = (XtPointer)targargs; format = 32; length = n; type = XA_ATOM; } else if (cs->target == atoms[XmA_MOTIF_DRAG_OFFSET]) { short *offset_args = (short *)XtCalloc(2,sizeof(short)); int n = 0; value = (XtPointer)offset_args; offset_args[n++] = cw->container.drag_offset_x; offset_args[n++] = cw->container.drag_offset_y; format = 16; length = n; type = XA_INTEGER; } else if ((cs->target == XA_PIXMAP) || (cs->target == atoms[XmA_MOTIF_COMPOUND_STRING]) || (cs->target == atoms[XmAUTF8_STRING]) || (cs->target == atoms[XmA_COMPOUND_TEXT])) { if ((cs->selection == atoms[XmA_MOTIF_DROP]) && (cs->location_data)) { items = (WidgetList)XtMalloc(sizeof(Widget)); items[0] = (Widget)cs->location_data; item_count = 1; } else { if ((item_count = cw->container.selected_item_count) == 0) ConvertRefuse(wid,closure,cs); items = GetSelectedCwids(wid); } } if (cs->target == XA_PIXMAP) { Arg wargs[10]; int n,i; Pixmap item_pm; Pixmap * return_pm = (Pixmap *) XtCalloc(item_count,sizeof(Pixmap)); int return_pm_count = 0; for (i = 0; i < item_count; i++) { n = 0; if (GetViewType(items[0]) == XmSMALL_ICON) XtSetArg(wargs[n],XmNsmallIconPixmap,&item_pm); else XtSetArg(wargs[n],XmNlargeIconPixmap,&item_pm); n++; item_pm = XmUNSPECIFIED_PIXMAP; XtGetValues(items[i],wargs,n); if (item_pm != XmUNSPECIFIED_PIXMAP) return_pm[return_pm_count++] = item_pm; } format = 32; type = XA_PIXMAP; value = (XtPointer)return_pm; length = return_pm_count; } else if ((cs->target == atoms[XmA_MOTIF_COMPOUND_STRING]) || (cs->target == atoms[XmA_COMPOUND_TEXT])) { Arg wargs[10]; int n,i; XmString item_xmstr; XmString return_xmstr = XmStringCreateLocalized(""); n = 0; XtSetArg(wargs[n],XmNlabelString,&item_xmstr); n++; for (i = 0; i < item_count; i++) { /* CR 7669: Concatenate efficiently and free strings. */ item_xmstr = NULL; XtGetValues(items[i],wargs,n); if (i > 0) return_xmstr = XmStringConcatAndFree(return_xmstr, XmStringSeparatorCreate()); return_xmstr = XmStringConcatAndFree(return_xmstr, item_xmstr); } format = 8; if (cs->target == atoms[XmA_MOTIF_COMPOUND_STRING]) { type = atoms[XmA_MOTIF_COMPOUND_STRING]; length = XmCvtXmStringToByteStream(return_xmstr, (unsigned char **)&(value)); } else if (cs->target == atoms[XmA_COMPOUND_TEXT]) { type = atoms[XmA_COMPOUND_TEXT]; value = XmCvtXmStringToCT(return_xmstr); if (value != NULL) length = strlen((char*) value); else length = 0; } #ifdef UTF8_SUPPORTED else if (cs->target == atoms[XmAUTF8_STRING]) { type = atoms[XmAUTF8_STRING]; value = XmCvtXmStringToUTF8String(return_xmstr); if (value != NULL) length = strlen((char*) value); else length = 0; } #endif XmStringFree(return_xmstr); } if (items) XtFree((char*) items); _XmConvertComplete(wid, value, length, format, type, cs); } /************************************************************************ * ContainerDestinationProc (Trait Method) ************************************************************************/ /*ARGSUSED*/ static void ContainerDestinationProc( Widget wid, XtPointer closure, /* unused */ XmDestinationCallbackStruct *cs) { enum { XmA_MOTIF_DROP, XmA_MOTIF_DRAG_OFFSET, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DROP, XmS_MOTIF_DRAG_OFFSET }; XmContainerWidget cw = (XmContainerWidget)wid; XmDropProcCallbackStruct * dropproc_cs; Atom atoms[XtNumber(atom_names)]; /* ** In case of a primary transfer operation where a location_data ** has been allocated, register a done proc to be called when ** the data transfer is complete to free the location_data */ if (cs->selection == XA_PRIMARY && cs->location_data) XmeTransferAddDoneProc(cs->transfer_id, FreeLocationData); /* If we aren't sensitive, don't allow transfer */ if (! wid -> core.sensitive || ! wid -> core.ancestor_sensitive) XmTransferDone(cs -> transfer_id, XmTRANSFER_DONE_FAIL); /* Get Atom values from cache. */ assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(wid), atom_names, XtNumber(atom_names), False, atoms); if (cs->selection != atoms[XmA_MOTIF_DROP]) return; if (cw->container.drag_context == (Widget) NULL) return; if (!CtrLayoutIsSPATIAL(cw)) { cw->container.drag_context = (Widget) NULL; return; } dropproc_cs = (XmDropProcCallbackStruct *)cs->destination_data; cw->container.dropspot.x = dropproc_cs->x; cw->container.dropspot.y = dropproc_cs->y; XmTransferValue(cs->transfer_id, atoms[XmA_MOTIF_DRAG_OFFSET], (XtCallbackProc)MoveItemCallback, (XtPointer)&cw->container.dropspot,cs->time); } /************************************************************************ * ContainerDestPrehookProc (Trait Method) ************************************************************************/ /*ARGSUSED*/ static void ContainerDestPrehookProc( Widget wid, XtPointer closure, /* unused */ XmDestinationCallbackStruct *cs) { XmContainerWidget cw = (XmContainerWidget)wid; XmDropProcCallbackStruct * dropproc_cs; XPoint *loc_data; /* For a PRIMARY selection, don't null out the location_data. * It can point to allocated memory, that will be free when * transfer is done. */ if (cs->selection != XA_PRIMARY) cs->location_data = NULL; if (cs->selection == XInternAtom(XtDisplay(wid),XmS_MOTIF_DROP,False)) { loc_data = (XPoint *) XtMalloc(sizeof(XPoint)); dropproc_cs = (XmDropProcCallbackStruct *) cs->destination_data; loc_data -> x = dropproc_cs->x; loc_data -> y = dropproc_cs->y; cs->location_data = (XtPointer) loc_data; XmeTransferAddDoneProc(cs->transfer_id, FreeLocationData); } } /************************************************ * Free data allocated for destination callback ************************************************/ /*ARGSUSED*/ static void FreeLocationData(Widget wid, /* unused */ XtEnum ignore_op, /* unused */ XmTransferDoneCallbackStruct* cs) { XmDestinationCallbackStruct *ds; ds = _XmTransferGetDestinationCBStruct(cs -> transfer_id); XtFree((char*) ds -> location_data); ds -> location_data = NULL; } /************************************************************************ * ContGetValues (Trait Method) ************************************************************************/ static void ContGetValues( Widget wid, XmContainerData contData) { XmContainerWidget cw = (XmContainerWidget)wid; if (CtrLayoutIsOUTLINE_DETAIL(cw)) { if (CtrLayoutIsDETAIL(cw)) { if (cw->container.detail_order_count) { contData->detail_order_count = cw->container.detail_order_count; contData->detail_order = cw->container.detail_order; /* detail_order might be NULL here */ } else /* take the max detail count and return NULL for the detail_order, so that the icon takes a default order */ if (contData->valueMask & ContDetailOrder) { contData->detail_order_count = MAX (GetDefaultDetailCount(wid), contData->detail_order_count); contData->detail_order = NULL ; } contData->detail_tablist = cw->container.detail_tablist; } else { contData->detail_order = NULL; contData->detail_order_count = 0; contData->detail_tablist = NULL; } /* we want to return a valid firstcolumnwidth even in pure outline, so that clipping can happen */ if (cw->container.real_first_col_width == 0) /* Use what was passed in so we always get something */ contData->first_column_width = contData->first_column_width; else contData->first_column_width = cw->container.real_first_col_width; contData->first_column_width += cw->container.margin_w; } else { contData->detail_order = NULL; contData->detail_order_count = 0; contData->detail_tablist = NULL; contData->first_column_width = 0; /* really the flag that says we're in spatial */ } if ((cw->container.kaddmode) && (_XmGetFocusPolicy(wid) == XmEXPLICIT)) contData->selection_mode = XmADD_MODE; else contData->selection_mode = XmNORMAL_MODE; contData->select_color = cw->container.select_color; } /************************************************************************ * GetVisualEmphasis (Private Function) ************************************************************************/ static unsigned char GetVisualEmphasis( Widget cwid) { XmContainerItemDataRec cItemData; XmContainerItemTrait cItemTrait; if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem)) == NULL) return(XmNOT_SELECTED); cItemData.valueMask = ContItemVisualEmphasis; cItemTrait->getValues(cwid,(XmContainerItemData)&cItemData); return(cItemData.visual_emphasis); } /************************************************************************ * SetVisualEmphasis (Private Function) ************************************************************************/ static void SetVisualEmphasis( Widget cwid, unsigned char emphasis) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerItemDataRec cItemData; XmContainerItemTrait cItemTrait; if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem)) == NULL) return; cItemData.valueMask = ContItemVisualEmphasis; cItemData.visual_emphasis = emphasis; cw->container.self = True; cItemTrait->setValues(cwid,(XmContainerItemData)&cItemData); cw->container.self = False; } /************************************************************************ * GetViewType (Private Function) ************************************************************************/ static unsigned char GetViewType( Widget cwid) { XmContainerItemDataRec cItemData; XmContainerItemTrait cItemTrait; if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem)) == NULL) return(XmLARGE_ICON); cItemData.valueMask = ContItemViewType; cItemTrait->getValues(cwid,(XmContainerItemData)&cItemData); return(cItemData.view_type); } /************************************************************************ * SetViewType (Private Function) ************************************************************************/ static void SetViewType( Widget cwid, unsigned char viewtype) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerItemDataRec cItemData; XmContainerItemTrait cItemTrait; if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem)) == NULL) return; cItemData.valueMask = ContItemViewType; cItemData.view_type = viewtype; cw->container.self = True; cItemTrait->setValues(cwid,(XmContainerItemData)&cItemData); cw->container.self = False; } /************************************************************************ * GetIconWidth (Private Function) ************************************************************************/ static Dimension GetIconWidth( Widget cwid) { XmContainerItemDataRec cItemData; XmContainerItemTrait cItemTrait; if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem)) == NULL) return(cwid->core.width); cItemData.valueMask = ContItemIconWidth; cItemTrait->getValues(cwid,(XmContainerItemData)&cItemData); return(cItemData.icon_width); } /************************************************************************ * GetDefaultDetailCount (Private Function) ************************************************************************/ static Cardinal GetDefaultDetailCount( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerItemDataRec cItemData; XmContainerItemTrait cItemTrait; Widget cwid; CwidNode node; Cardinal detail_count = 0; /* * Get the IconHeader's detail_count first */ if ((cwid = GetRealIconHeader(wid)) && (XtIsManaged(cwid)) && ((XtParent(cwid) == wid) || (XtIsManaged(XtParent(cwid))))) { cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem); cItemData.valueMask = ContItemDetailCount; cItemTrait->getValues(cwid,(XmContainerItemData)&cItemData); detail_count = MAX(detail_count,cItemData.detail_count); } /* * Get MAX detail count of all Icons now */ node = GetFirstNode(cw); while (node) { cwid = node->widget_ptr; if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem)) != NULL) { cItemData.valueMask = ContItemDetailCount; cItemTrait->getValues(cwid,(XmContainerItemData)&cItemData); detail_count = MAX(detail_count,cItemData.detail_count); } node = GetNextNode(node); } return(detail_count); } /************************************************************************ * SetDynamicTabList (Private Function) ************************************************************************/ static XmTabList SetDynamicTabList( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; int tab_size; Cardinal detail_order_count; if (!CtrIsDynamic(cw,TABLIST)) return(NULL); /* Just in case */ /* * Always free the previous XmTabList */ if (CtrIsDynamic(cw,TABLIST) && (cw->container.detail_tablist)) { XmTabListFree(cw->container.detail_tablist); cw->container.detail_tablist = NULL; } /* * If the Container has a valid size, a default tablist of * size detail_order_count shall be returned in detail_tablist. * The tabs in this tablist shall be equal to: * * (XmNwidth-2*XmNmarginWidth-XmNfirstColumnWidth) * /XmNdetailOrderCount * * If XmNwidth is not yet valid, a NULL detail_tablist * is returned, so that the icon can concat all its details * and get a reasonable size. */ if (cw->core.width == 0) return(NULL); tab_size = cw->core.width - (cw->container.margin_w * 2) - cw->container.real_first_col_width; detail_order_count = (cw->container.detail_order_count) ? cw->container.detail_order_count : GetDefaultDetailCount(wid); if (tab_size <= 0) return(NULL); if (detail_order_count == 0) return(NULL); tab_size /= detail_order_count; if (tab_size <=30) return NULL ; /* HACKKKK */ cw->container.detail_tablist = GetDumbTabList(tab_size,detail_order_count); return(cw->container.detail_tablist); } /************************************************************************ * GetDumbTabList (Private Function) ************************************************************************/ static XmTabList GetDumbTabList( int tab_size, Cardinal asked_num_tab) { static int Num_tab = 0 ; static XmTab * Tab_pool = NULL ; XmTabList Tab_list = NULL ; Cardinal i, prev_num_tab = Num_tab ; _XmProcessLock(); if (Num_tab < asked_num_tab) { Num_tab = MAX(asked_num_tab,100); /* HACKKKK */ Tab_pool = (XmTab*) XtRealloc((char*)Tab_pool,Num_tab*sizeof(XmTab)); } /* create more tabs */ for (i=prev_num_tab; igetValues(cwid,(XmContainerItemData)&cItemData); fcw = MAX(fcw,cItemData.icon_width); } /* * Get MAX icon_width of all Icons */ node = GetFirstNode(cw); while (node) { cwid = node->widget_ptr; if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(cwid),XmQTcontainerItem)) != NULL) { cItemData.valueMask = ContItemIconWidth; cItemTrait->getValues(cwid,(XmContainerItemData)&cItemData); cwid_fcw = cItemData.icon_width; } else /* * Just use Gadget width, if it doesn't have the trait. */ cwid_fcw = cwid->core.width; c = GetContainerConstraint(cwid); cwid_fcw += cw->container.ob_width + c->depth * cw->container.outline_indent; fcw = MAX(fcw,cwid_fcw); node = GetNextNode(node); } return(fcw); } /************************************************************************ * ResizeIconWidths (Private Function) * This function gets the preferred width of all icons based on the * current width of Container (this affects dynamic tablists) and * resizes them all to the max. ************************************************************************/ static void ResizeIconWidths( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Widget cwid; XmContainerConstraint c; XtWidgetGeometry desired; Position max_x = 0 ; /*** get the maximum right edge first */ if (cw->core.width == cw->container.ideal_width) max_x = cw->container.ideal_width - cw->container.margin_w; else { if (CtrIsDynamic(cw,TABLIST)) max_x = MAX(cw->container.margin_w + cw->container.real_first_col_width, cw->core.width - cw->container.margin_w); else { /* header first. */ if ((cwid = GetRealIconHeader(wid)) && (XtIsManaged(cwid)) && ((XtParent(cwid) == wid) || (XtIsManaged(XtParent(cwid))))) { XtQueryGeometry(cwid, NULL, &desired); max_x = MAX(max_x, cwid->core.x + desired.width); } /* then the icons */ node = GetFirstNode(cw); while(node) { cwid = node->widget_ptr; c = GetContainerConstraint(cwid); /* This query depends on the current first column width, and the current x position. */ cwid->core.x = cw->container.margin_w + c->depth*cw->container.outline_indent + ((CtrOB_PRESENT(cw))?cw->container.ob_width:0) ; if (LayoutIsRtoLM(cw)) cwid->core.x = (Position)cw->core.width - (Position)cwid->core.width - cwid->core.x; XtQueryGeometry(cwid, NULL, &desired); max_x = MAX(max_x, cwid->core.x + desired.width); node = GetNextNode(node); } } } /*** Then resize */ if ((cwid = GetRealIconHeader(wid)) && (XtIsManaged(cwid)) && ((XtParent(cwid) == wid) || (XtIsManaged(XtParent(cwid))))) { XtQueryGeometry(cwid, NULL, &desired); XmeConfigureObject(cwid, cwid->core.x, cwid->core.y, max_x - cwid->core.x, cwid->core.height, cwid->core.border_width); /* also recongifure the DA parent if any */ if (XtParent(cwid) != wid) { XmeConfigureObject(cw->container.icon_header, /* the DA */ cw->container.icon_header->core.x, cw->container.icon_header->core.y, cwid->core.width + 2*cw->container.margin_w, cwid->core.height + cw->container.margin_h, cw->core.border_width); } } node = GetFirstNode(cw); while(node) { cwid = node->widget_ptr; c = GetContainerConstraint(cwid); cwid->core.x = cw->container.margin_w + c->depth*cw->container.outline_indent + ((CtrOB_PRESENT(cw))?cw->container.ob_width:0) ; cwid->core.width = max_x - cwid->core.x; if (LayoutIsRtoLM(cw)) cwid->core.x = (Position)cw->core.width - (Position)cwid->core.width - cwid->core.x; XmeConfigureObject(cwid, cwid->core.x, cwid->core.y, cwid->core.width, cwid->core.height, cwid->core.border_width); node = GetNextNode(node); } } /************************************************************************ * Layout (Private Function) ************************************************************************/ static void Layout( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; if (CtrLayoutIsOUTLINE_DETAIL(cw)) LayoutOutlineDetail(wid); else LayoutSpatial(wid,False,NULL); } /************************************************************************ * RequestOutlineDetail (Private Function) ************************************************************************/ static void RequestOutlineDetail( Widget wid, XtWidgetGeometry * geo_desired) { XmContainerWidget cw = (XmContainerWidget)wid; Dimension saved_width = 0 ; /* deal with special requirements for width */ if (geo_desired->width) { saved_width = cw->core.width; cw->core.width = geo_desired->width; } /* let's find out about our preferred size */ cw->container.ideal_width = 0; cw->container.ideal_height = 0; GetSize(wid,&cw->container.ideal_width,&cw->container.ideal_height); geo_desired->request_mode = (CWWidth | CWHeight); /* see if a constraint was placed on the preferred size */ if (!(geo_desired->width)) geo_desired->width = cw->container.ideal_width; else cw->core.width = saved_width ; if (!(geo_desired->height)) geo_desired->height = cw->container.ideal_height; if (geo_desired->width < 1) geo_desired->width = cw->core.width ; if (geo_desired->height < 1) geo_desired->height = cw->core.height ; _XmMakeGeometryRequest(wid,geo_desired); if (XtIsRealized((Widget)cw)) XClearArea(XtDisplay((Widget)cw),XtWindow((Widget)cw),0,0,0,0,True); LayoutOutlineDetail(wid); cw->container.prev_width = cw->core.width; } /************************************************************************ * LayoutOutlineDetail (Private Function) ************************************************************************/ static void LayoutOutlineDetail( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c; XmContainerConstraint pc; Position x,y,ob_y; CwidNode node; Widget cwid; int n_outline_segs,seg_idx; XPoint * point_at_depth = NULL; int i; if (CtrLayoutIsDETAIL(cw)) { if (CtrIsDynamic(cw,TABLIST)) SetDynamicTabList(wid); ResizeIconWidths(wid); } /* ** assert(c->depth == pc->depth + 1); ** for children with entry-parents, and otherwise ** assert(c->depth == 0); */ /* * Create array of XSegments to hold line descriptions for Outline. */ n_outline_segs = seg_idx = 0; node = GetFirstNode(cw); while (node) /* * So, how many XSegments do we need? */ { c = GetContainerConstraint(node->widget_ptr); if (c->depth != 0) n_outline_segs += 2; node = GetNextNode(node); } if (cw->container.outline_seg_count != n_outline_segs) { if (cw->container.outline_segs) XtFree((char*)cw->container.outline_segs); cw->container.outline_segs = (XSegment *)XtCalloc (n_outline_segs,sizeof(XSegment)); cw->container.outline_seg_count = n_outline_segs; } point_at_depth = (XPoint *)XtCalloc((cw->container.max_depth + 1), sizeof(XPoint)); y = cw->container.margin_h; if (CtrLayoutIsDETAIL(cw) && cw->container.icon_header) { /* * Position the header/Drawing-area. * assert: cw->container.icon_header is valid */ Widget real_icon_header = GetRealIconHeader(wid), header_parent = XtParent(real_icon_header) ; /* only if it is managed */ if (XtIsManaged(real_icon_header) && ((header_parent == wid) || (XtIsManaged(header_parent)))) { if (header_parent != wid) { /* auto SW case : DA is the parent of the header */ /* set y of the container so that it glue the bottom of the real icon header *inside* the DA. So no margin_h added here, container must start underneath the DA/icon header because it has a margin height that need to be hidden (replaced by the DA one) */ if (0 == cw->core.y) cw->core.y = real_icon_header->core.height ; /* resize the DA to remove the bottom margin */ XmeConfigureObject(header_parent, header_parent->core.x, header_parent->core.y, real_icon_header->core.width + 2*cw->container.margin_w, real_icon_header->core.height + cw->container.margin_h, cw->core.border_width); } else { XmeConfigureObject(cw->container.icon_header, cw->container.margin_w, cw->container.margin_h, cw->container.icon_header->core.width, cw->container.icon_header->core.height,0); y += cw->container.icon_header->core.height; } } } node = GetFirstNode(cw); while (node) { cw->container.last_node = node; cwid = node->widget_ptr; c = GetContainerConstraint(cwid); if (LayoutIsRtoLM(cw)) x = cw->core.width - cw->container.margin_w - c->depth * cw->container.outline_indent; else x = cw->container.margin_w + c->depth * cw->container.outline_indent; ob_y = y + (cwid->core.height - cw->container.ob_height) / 2; if (CtrOB_PRESENT(cw) && LayoutIsRtoLM(cw)) x -= cw->container.ob_width; if ((node->child_ptr) && CtrOB_PRESENT(cw)) { if (!c->related_cwid) MakeOutlineButton(cwid); /* * we need to hide the outline button if they appear * after the first column limit */ if ((!LayoutIsRtoLM(cw) && ((x + cw->container.ob_width) > (cw->container.margin_w + cw->container.real_first_col_width))) || (LayoutIsRtoLM(cw) && (x < (Position)(cw->core.width - cw->container.margin_w - cw->container.real_first_col_width)))) HideCwid(c->related_cwid) ; else XmeConfigureObject(c->related_cwid,x,ob_y, cw->container.ob_width, cw->container.ob_height,0); } else if (c->related_cwid) { XtDestroyWidget(c->related_cwid); c->related_cwid = NULL; } if (CtrOB_PRESENT(cw) && !LayoutIsRtoLM(cw)) x += cw->container.ob_width; /* * we don't want the x position to be bigger than * the firstcolumnwidth, otherwize the arithmetic in * Icong get confused. Hackk */ if (LayoutIsRtoLM(cw)) x = MAX(x,(Position)(cw->core.width - cw->container.margin_w - cw->container.real_first_col_width + 1)); else x = MIN(x,(Position)(cw->container.margin_w + cw->container.real_first_col_width - 1)); /* * Calculate Outline lines */ if (point_at_depth[c->depth].x == 0) { point_at_depth[c->depth].x = cw->container.margin_w + cw->container.outline_indent * c->depth; } if (CtrOB_PRESENT(cw)) point_at_depth[c->depth].y = ob_y + cw->container.ob_height; else point_at_depth[c->depth].y = y + cwid->core.height; if (c->entry_parent) { pc = GetContainerConstraint(c->entry_parent); if (CtrOB_PRESENT(cw)) { /* Optimally, the line would be drawn from the center of the Outline Button (OB) ** causing problems when indentation is small. So we drop the line ** MIN (midpoint of OB, midpoint of OB left & child left */ cw->container.outline_segs[seg_idx].x1 = MIN((point_at_depth[pc->depth].x + cw->container.ob_width/2), (point_at_depth[pc->depth].x +point_at_depth[c->depth].x)/2 ); } else { /* Optimally, the line would be drawn from the center of the parent ** causing problems when parent labelString is too long. So we drop the ** line MIN (midpoint of parent, midpoint of parent left & child left edge) */ cw->container.outline_segs[seg_idx].x1 = MIN((point_at_depth[pc->depth].x + GetIconWidth(c->entry_parent)/2), (point_at_depth[pc->depth].x +point_at_depth[c->depth].x)/2 ); } cw->container.outline_segs[seg_idx].y1 = point_at_depth[pc->depth].y; cw->container.outline_segs[seg_idx].x2 = cw->container.outline_segs[seg_idx].x1; cw->container.outline_segs[seg_idx].y2 = y + cwid->core.height/2; cw->container.outline_segs[seg_idx + 1].x1 = cw->container.outline_segs[seg_idx].x2; cw->container.outline_segs[seg_idx + 1].y1 = cw->container.outline_segs[seg_idx].y2; cw->container.outline_segs[seg_idx + 1].x2 = cw->container.margin_w + cw->container.outline_indent * c->depth; if (CtrOB_PRESENT(cw) && (!c->related_cwid)) cw->container.outline_segs[seg_idx + 1].x2 += cw->container.ob_width; cw->container.outline_segs[seg_idx + 1].y2 = cw->container.outline_segs[seg_idx].y2; seg_idx += 2; } if (LayoutIsRtoLM(cw)) x = x - (Position)cwid->core.width; XmeConfigureObject(cwid,x,y,cwid->core.width,cwid->core.height,0); y += cwid->core.height; node = GetNextNode(node); } /* * Free the Malloc'd point_at_depth. * If Left-to-Right, reverse all the x1's & x2's and adjust. */ if (point_at_depth) XtFree((char*)point_at_depth); for (i = 0; i < cw->container.outline_seg_count; i++) { int max_x = (int)cw->container.real_first_col_width + (int)cw->container.margin_w; /* we don't want the lines to be drawn after the first column width, so we clip here the x positions of the segments */ cw->container.outline_segs[i].x1 = MIN(max_x, cw->container.outline_segs[i].x1); cw->container.outline_segs[i].x2 = MIN(max_x, cw->container.outline_segs[i].x2); } if (LayoutIsRtoLM(cw)) { int adjust; adjust = (int)cw->core.width - (int)cw->container.ideal_width; for (i = 0; i < cw->container.outline_seg_count; i++) { cw->container.outline_segs[i].x1 = MAX(0, cw->container.ideal_width - cw->container.outline_segs[i].x1 + adjust); cw->container.outline_segs[i].x2 = MAX(0, cw->container.ideal_width - cw->container.outline_segs[i].x2 + adjust); } } } /************************************************************************ * LayoutSpatial (Private Function) ************************************************************************/ static void LayoutSpatial( Widget wid, Boolean growth_req_allowed, CwidNode stop_node) { XmContainerWidget cw = (XmContainerWidget)wid; int cell_width,cell_height; int width_in_cells,height_in_cells; CwidNode node; if (!((XmContainerWidgetClass)XtClass(wid))->container_class.place_item) return; if (CtrSpatialStyleIsGRID(cw) || CtrSpatialStyleIsCELLS(cw)) /* * Let's see if things have changed enough so that we have to reset. */ { cell_width = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellw : cw->container.real_large_cellw; cell_height = (CtrViewIsSMALL_ICON(cw)) ? cw->container.real_small_cellh : cw->container.real_large_cellh; width_in_cells = (cw->core.width - 2 * cw->container.margin_w) / cell_width; height_in_cells = (cw->core.height - 2 * cw->container.margin_h) / cell_height; if (((width_in_cells != cw->container.current_width_in_cells) && (CtrIsHORIZONTAL(wid))) || ((height_in_cells != cw->container.current_height_in_cells) && (CtrIsVERTICAL(wid)))) (*((XmContainerWidgetClass) XtClass(wid))->container_class.place_item)(wid,NULL,ANY_FIT); else /* * Just grow the number of cells if only the Minor dimension * has changed. */ { cw->container.current_width_in_cells = width_in_cells; cw->container.current_height_in_cells = height_in_cells; if ((width_in_cells * height_in_cells) > cw->container.cell_count) { int i,old_cell_count = cw->container.cell_count; cw->container.cell_count = width_in_cells * height_in_cells; if (CtrIsHORIZONTAL(cw)) /* For "clipped" items */ cw->container.cell_count += height_in_cells; else cw->container.cell_count += width_in_cells; cw->container.cells = (int *)XtRealloc((char *)cw->container.cells, (sizeof(int) * (cw->container.cell_count))); for (i = old_cell_count; i < cw->container.cell_count; i++) cw->container.cells[i] = 0; } } } node = GetFirstNode(cw); while (node) { Widget cwid = node -> widget_ptr; cw->container.last_node = node; if (CtrItemIsPlaced(cwid)) PlaceCwid(cwid,cwid->core.x,cwid->core.y); else { /* Not placed */ (*((XmContainerWidgetClass) XtClass(wid))->container_class.place_item) (wid,cwid, (growth_req_allowed ? EXACT_FIT : ANY_FIT)); if (!CtrItemIsPlaced(cwid) && (growth_req_allowed)) /* * See if we can grow and then try again. */ { if (RequestSpatialGrowth(wid,cwid)) /* * If RequestSpatialGrowth succeeds it will update * core width/height. Now, call LayoutSpatial again * so it can update info to keep track of cells, etc. * and can place the item we just got growth for. * Don't set the "growth_req_allowed" parameter or * we could recurse forever. */ LayoutSpatial(wid,False,node); else /* try again, but don't be so picky */ { (*((XmContainerWidgetClass) XtClass(wid))->container_class.place_item) (wid,cwid,ANY_FIT); if (!CtrItemIsPlaced(cwid)) HideCwid(cwid); } } } if ((stop_node) && (node == stop_node)) /* * This is just a little hack to keep from having to traverse * through all the nodes when we recursively call LayoutSpatial(). */ return; node = GetNextNode(node); } } /************************************************************************ * SetCellSizes (Private Function) ************************************************************************/ static void SetCellSizes( Widget wid) { if (!CtrSpatialStyleIsGRID(wid) && !CtrSpatialStyleIsCELLS(wid)) return; if (CtrViewIsSMALL_ICON(wid)) SetSmallCellSizes(wid); else SetLargeCellSizes(wid); } /************************************************************************ * SetSmallCellSizes (Private Function) ************************************************************************/ static void SetSmallCellSizes( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; if (!CtrDynamicSmallCellHeight(cw)) cw->container.real_small_cellh = cw->container.small_cell_height; if (!CtrDynamicSmallCellWidth(cw)) cw->container.real_small_cellw = cw->container.small_cell_width; if (!CtrDynamicSmallCellHeight(cw) && !CtrDynamicSmallCellWidth(cw)) return; if ((cw->container.first_node) && (cw->container.small_cell_dim_fixed)) return; cw->container.small_cell_dim_fixed = True; if (cw->container.first_node) { node = cw->container.first_node; if (CtrDynamicSmallCellHeight(cw)) cw->container.real_small_cellh = cw->container.first_node->widget_ptr->core.height; if (CtrDynamicSmallCellWidth(cw)) cw->container.real_small_cellw = cw->container.first_node->widget_ptr->core.width; while (node) { if (CtrSpatialStyleIsGRID(cw)) /* * GRID: cell should be size of largest cwid. */ { if (CtrDynamicSmallCellHeight(cw)) cw->container.real_small_cellh = MAX( cw->container.real_small_cellh, node->widget_ptr->core.height); if (CtrDynamicSmallCellWidth(cw)) cw->container.real_small_cellw = MAX( cw->container.real_small_cellw, node->widget_ptr->core.width); } else { /* * CELLS: cell should be size of smallest cwid. */ if (CtrDynamicSmallCellHeight(cw)) cw->container.real_small_cellh = MIN( cw->container.real_small_cellh, node->widget_ptr->core.height); if (CtrDynamicSmallCellWidth(cw)) cw->container.real_small_cellw = MIN( cw->container.real_small_cellw, node->widget_ptr->core.width); } node = GetNextNode(node); } } else { if (CtrDynamicSmallCellHeight(cw)) cw->container.real_small_cellh = MAX(10,(int) (.02 * HeightOfScreen(XtScreen((Widget)cw)))); if (CtrDynamicSmallCellWidth(cw)) cw->container.real_small_cellw = MAX(10,(int) (.02 * WidthOfScreen(XtScreen((Widget)cw)))); } } /************************************************************************ * SetLargeCellSizes (Private Function) ************************************************************************/ static void SetLargeCellSizes( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; if (!CtrDynamicLargeCellHeight(cw)) cw->container.real_large_cellh = cw->container.large_cell_height; if (!CtrDynamicLargeCellWidth(cw)) cw->container.real_large_cellw = cw->container.large_cell_width; if (!CtrDynamicLargeCellHeight(cw) && !CtrDynamicLargeCellWidth(cw)) return; if ((cw->container.first_node) && (cw->container.large_cell_dim_fixed)) return; if (cw->container.first_node) { cw->container.large_cell_dim_fixed = True; node = cw->container.first_node; if (CtrDynamicLargeCellHeight(cw)) cw->container.real_large_cellh = cw->container.first_node->widget_ptr->core.height; if (CtrDynamicLargeCellWidth(cw)) cw->container.real_large_cellw = cw->container.first_node->widget_ptr->core.width; while (node) { if (CtrSpatialStyleIsGRID(cw)) /* * GRID: cell should be size of largest cwid. */ { if (CtrDynamicLargeCellHeight(cw)) cw->container.real_large_cellh = MAX( cw->container.real_large_cellh, node->widget_ptr->core.height); if (CtrDynamicLargeCellWidth(cw)) cw->container.real_large_cellw = MAX( cw->container.real_large_cellw, node->widget_ptr->core.width); } else { /* * CELLS: cell should be size of smallest cwid. */ if (CtrDynamicLargeCellHeight(cw)) cw->container.real_large_cellh = MIN( cw->container.real_large_cellh, node->widget_ptr->core.height); if (CtrDynamicLargeCellWidth(cw)) cw->container.real_large_cellw = MIN( cw->container.real_large_cellw, node->widget_ptr->core.width); } node = GetNextNode(node); } } else { if (CtrDynamicLargeCellHeight(cw)) cw->container.real_large_cellh = MAX(20,(int) (.04 * HeightOfScreen(XtScreen((Widget)cw)))); if (CtrDynamicLargeCellWidth(cw)) cw->container.real_large_cellw = MAX(20,(int) (.04 * WidthOfScreen(XtScreen((Widget)cw)))); } } /************************************************************************ * SizeOutlineButton (Private Function) ************************************************************************/ static void SizeOutlineButton( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; Arg wargs[10]; int n; Dimension width,height; /* * Create dummy outline button so we can get size. */ n = 0; XtSetArg(wargs[n],XmNlabelType,XmPIXMAP); n++; XtSetArg(wargs[n],XmNlabelPixmap,cw->container.expanded_state_pixmap); n++; XtSetArg(wargs[n],XmNmarginWidth,0); n++; XtSetArg(wargs[n],XmNmarginHeight,0); n++; cw->container.self = True; if (cw->container.size_ob) XtSetValues(cw->container.size_ob,wargs,n); else { cw->container.create_cwid_type = CONTAINER_OUTLINE_BUTTON; cw->container.size_ob = XtCreateWidget(OBNAME, xmPushButtonGadgetClass,(Widget)cw,wargs,n); cw->container.create_cwid_type = CONTAINER_ICON; } XtVaGetValues(cw->container.size_ob,XmNwidth,&cw->container.ob_width, XmNheight,&cw->container.ob_height,NULL); n = 0; XtSetArg(wargs[n],XmNlabelType,XmPIXMAP); n++; XtSetArg(wargs[n],XmNlabelPixmap, cw->container.collapsed_state_pixmap); n++; XtSetValues(cw->container.size_ob,wargs,n); cw->container.self = False; XtVaGetValues(cw->container.size_ob, XmNwidth,&width,XmNheight,&height,NULL); cw->container.ob_width = MAX(cw->container.ob_width,width); cw->container.ob_height = MAX(cw->container.ob_height,height); } /************************************************************************ * UpdateGCs (Private Function) ************************************************************************/ static void UpdateGCs( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; XGCValues values; XtGCMask valueMask, unusedMask; /* * Free any previous GC's */ if (cw->container.normalGC) XtReleaseGC(wid,cw->container.normalGC); if (cw->container.marqueeGC) XtReleaseGC(wid,cw->container.marqueeGC); /* * Get GC's */ valueMask = GCForeground | GCBackground | GCGraphicsExposures; unusedMask = GCClipXOrigin | GCClipYOrigin | GCFont; values.foreground = cw->manager.foreground; values.background = cw->core.background_pixel; values.graphics_exposures = False; cw->container.normalGC = XtAllocateGC(wid, 0, valueMask, &values, GCClipMask | GCForeground, unusedMask); valueMask = GCForeground | GCSubwindowMode | GCFunction; values.foreground = cw->core.background_pixel ^ cw->manager.foreground; values.subwindow_mode = IncludeInferiors; values.function = GXxor; cw->container.marqueeGC = XtAllocateGC(wid, 0, valueMask, &values, GCClipMask, 0); } /************************************************************************ * GetSpatialSizeCellAdjustment (Private Function) * This routine does a trial placement of all items using the * information in the array passed in. If not all items fit, * it adds 1 to width_in_cells & height_in_cells and calls itself * recursively until everything fits. This routine assumes * placement goes left-to-right-top-to-bottom, but the calculations * arrived at should work for all layoutDirections. ************************************************************************/ static void GetSpatialSizeCellAdjustment( Widget wid, int *parm_width_in_cells, int *parm_height_in_cells, ContainerCwidCellInfo cwid_info, int cwid_info_count) { int width_in_cells = *parm_width_in_cells; int height_in_cells = *parm_height_in_cells; Boolean all_cwids_fit; Boolean cwid_placed; Boolean this_spot_fits; Boolean *cell_occupied; int i,start_row,start_col,row,col; cell_occupied = (Boolean *)XtCalloc((width_in_cells * height_in_cells), sizeof(Boolean)); i = 0; all_cwids_fit = True; while ((i < cwid_info_count) && (all_cwids_fit)) /* * Keep placing all the cwids into the cell_occupied[] grid until * one doesn't fit. */ { start_col = 0; cwid_placed = False; while ((start_col < width_in_cells) && (!cwid_placed)) { start_row = 0; while ((start_row < height_in_cells) && (!cwid_placed)) { /* * Cycle through all the [col,row] combinations in the * cell_occupied[] grid until we find one that the current cwid * will fit into. */ this_spot_fits = True; col = start_col; while ((col < start_col + cwid_info[i].cwid_width_in_cells) && (this_spot_fits)) { row = start_row; while ((row < start_row + cwid_info[i].cwid_height_in_cells) && (this_spot_fits)) /* * Test all the cells needed by this cwid at this particular * spot in the cell_occupied[] grid until we see that one is * out-of-bounds or already occupied. */ { this_spot_fits = ((col < width_in_cells) && (row < height_in_cells) && (!(cell_occupied[col * width_in_cells + row]))); row++; } col++; } if (this_spot_fits) /* Mark everything as occupied */ for (col = start_col; col < start_col + cwid_info[i].cwid_width_in_cells; col++) for (row = start_row; row < start_row + cwid_info[i].cwid_height_in_cells; row++) cell_occupied[col * width_in_cells + row] = True; cwid_placed = this_spot_fits; start_row++; } start_col++; } all_cwids_fit = cwid_placed; i++; } XtFree((char*)cell_occupied); if (!all_cwids_fit) /* * Not big enough for all the cwids, increment width/height and * try it again. */ { width_in_cells++; height_in_cells++; GetSpatialSizeCellAdjustment(wid,&width_in_cells,&height_in_cells, cwid_info,cwid_info_count); *parm_width_in_cells = width_in_cells; *parm_height_in_cells = height_in_cells; } } /************************************************************************ * CreateIconHeader (Private Function) ************************************************************************/ static void CreateIconHeader( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; Widget header_parent = wid ; Arg sargs[10]; Cardinal n = 0; unsigned char scrollp = XmAPPLICATION_DEFINED ; #define NO_PARENT 0 #define SWINDOW_PARENT 1 #define CWINDOW_PARENT 2 int inScrolledWindow = NO_PARENT; cw->container.self = True; cw->container.create_cwid_type = CONTAINER_HEADER; /* * Set up args for DrawingArea and Create. */ { XmScrollFrameTrait scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer)XtClass(XtParent(wid)),XmQTscrollFrame); if ((NULL != scrollFrameTrait) && scrollFrameTrait->getInfo(XtParent(wid),NULL,NULL,NULL)) inScrolledWindow = SWINDOW_PARENT; if (NO_PARENT == inScrolledWindow) { XmClipWindowTrait clipWindowTrait = (XmClipWindowTrait) XmeTraitGet((XtPointer)XtClass(XtParent(wid)),_XmQTclipWindow); if (NULL != clipWindowTrait) inScrolledWindow = CWINDOW_PARENT; } } if (NO_PARENT != inScrolledWindow) { Widget sWindow = (SWINDOW_PARENT == inScrolledWindow) ? XtParent(wid) : XtParent(XtParent(wid)); scrollp = XmAUTOMATIC ; /* use an intermediate DA so that we can have margins */ n = 0 ; XtSetArg(sargs[n], XmNscrolledWindowChildType, XmSCROLL_HOR); n++; XtSetArg(sargs[n], XmNmarginHeight, cw->container.margin_h); n++ ; XtSetArg(sargs[n], XmNmarginWidth, cw->container.margin_w); n++ ; XtSetArg(sargs[n], XmNforeground, cw->manager.foreground); n++; XtSetArg(sargs[n], XmNbackground, cw->core.background_pixel); n++; XtSetArg(sargs[n], XmNbackgroundPixmap, cw->core.background_pixmap); n++; XtSetArg(sargs[n], XmNborderWidth, cw->core.border_width); n++; XtSetArg(sargs[n], XmNborderColor, cw->core.border_pixel); n++; XtSetArg(sargs[n], XmNborderPixmap, cw->core.border_pixmap); n++; XtSetArg(sargs[n], XmNtraversalOn, False); n++; header_parent = XmCreateDrawingArea(sWindow, DANAME, sargs, n); } /* * Set up args for IconHeader and Create. */ n = 0; XtSetArg(sargs[n],XmNcontainerID,wid); n++; XtSetArg(sargs[n],XmNshadowThickness,0); n++; XtSetArg(sargs[n],XmNtraversalOn,False); n++; /* not really necessary */ XtSetArg(sargs[n],XmNlargeIconPixmap, XmUNSPECIFIED_PIXMAP); n++; XtSetArg(sargs[n],XmNsmallIconPixmap, XmUNSPECIFIED_PIXMAP); n++; assert(cw->container.detail_heading_count > 0) ; XtSetArg(sargs[n],XmNlabelString, cw->container.detail_heading[0]); n++; if (cw->container.detail_heading_count > 1) { XtSetArg(sargs[n],XmNdetail,&(cw->container.detail_heading[1])); n++; } XtSetArg(sargs[n],XmNdetailCount, cw->container.detail_heading_count - 1); n++; cw->container.icon_header = XmCreateIconHeader(header_parent, HEADERNAME, sargs,n); if (scrollp == XmAUTOMATIC) { /* set y of the container so that it glue the bottom of the Icon header *inside* the DA, that is, it overlap the DA */ if (CtrLayoutIsDETAIL(cw)) /* if (0 == cw->core.y) */ cw->core.y = cw->container.icon_header->core.height ; /* also resize the DA to remove the bottom margin */ XmeConfigureObject(header_parent, header_parent->core.x, header_parent->core.y, cw->container.icon_header->core.width + 2*cw->container.margin_w, cw->container.icon_header->core.height + cw->container.margin_h, header_parent->core.border_width); /* manage the child inside */ XtManageChild(cw->container.icon_header); /* keep the reference to the DA parent, since that's the one to manage/unmanaged all the time */ cw->container.icon_header = header_parent ; } /* if not scrolling, no need to do anything it, it will be dealt with as a regular kid */ /* set the internal creation flag down */ cw->container.create_cwid_type = CONTAINER_ICON; cw->container.self = False; } /************************************************************************ * GetRealIconHeader (Private Function) ************************************************************************/ static Widget GetRealIconHeader( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; if (!cw->container.icon_header) return NULL; /* determine the real icon_header id */ if (XtParent(cw->container.icon_header) != wid) /* we are in the SW auto case where a DA was created as the parent of the icon_header and store in container icon_header. */ return ((CompositeWidget)(cw->container.icon_header)) ->composite.children[0] ; else return cw->container.icon_header ; } /************************************************************************ * UpdateIconHeader (Private Function) ************************************************************************/ static void UpdateIconHeader( Widget wid, Boolean count_only) { XmContainerWidget cw = (XmContainerWidget)wid; Arg wargs[10]; int n; Widget icon_header = GetRealIconHeader(wid); cw->container.self = True ; /* * Set up args for IconHeader. */ assert (cw->container.detail_heading_count > 0); n = 0; if (!count_only) { XtSetArg(wargs[n],XmNlabelString, cw->container.detail_heading[0]); n++; if (cw->container.detail_heading_count > 1) { XtSetArg(wargs[n],XmNdetail,&(cw->container.detail_heading[1])); n++; } } XtSetArg(wargs[n],XmNdetailCount, cw->container.detail_heading_count - 1); n++; XtSetValues(icon_header,wargs,n); cw->container.self = True ; } /************************************************************************ * ChangeView (Private Function) ************************************************************************/ static void ChangeView( Widget wid, unsigned char view) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Widget cwid; node = cw->container.first_node; while (node) { cwid = node->widget_ptr; SetViewType(cwid,view); /* setting a new view type will have the child request and get its preferred size */ /* * Get the next cwid, whether it's visible or not */ if (node->child_ptr) node = node->child_ptr; else if (node->next_ptr) node = node->next_ptr; else node = GetNextUpLevelNode(node); } } /************************************************************************ * NewNode (Private Function) ************************************************************************/ static CwidNode NewNode( Widget cwid) { XmContainerConstraint c = GetContainerConstraint(cwid); CwidNode new_node; /* * Create the new CwidNode structure. */ new_node = (CwidNode)XtCalloc(1,sizeof(XmCwidNodeRec)); new_node->widget_ptr = cwid; /* node ----> widget link */ c->node_ptr = new_node; /* widget --> node link */ return(new_node); } /************************************************************************ * InsertNode (Private Function) ************************************************************************/ static void InsertNode( CwidNode node) { XmContainerWidget cw; XmContainerConstraint c; XmContainerConstraint pc; /* parent's constraints */ XmContainerConstraint sc; /* sibling's constraints */ Widget cwid; CwidNode prev_node; CwidNode next_node; CwidNode parent_node; int count = 0; /* resequence as we go along so that ** XmNpositionIndex always reflects the child's ** position within all widgets which name the ** same widget as their XmNentryParent; no ** widgets have the same value for ** XmNpositionIndex; XmNpositionIndex has no ** gaps */ cwid = node->widget_ptr; cw = (XmContainerWidget)XtParent(cwid); c = GetContainerConstraint(cwid); /* * Find the first cwid within XmNentryParent, NULL if none. */ if (c->entry_parent == NULL) { parent_node = NULL; prev_node = cw->container.first_node; } else { pc = GetContainerConstraint(c->entry_parent); parent_node = pc->node_ptr; prev_node = parent_node->child_ptr; } if (prev_node == NULL) { /* * Assume this is the first and only cwid within XmNentryParent. */ next_node = NULL; } else { /* * Chain through this level until we find the correct position. */ next_node = prev_node; prev_node = NULL; while (next_node) { sc = GetContainerConstraint(next_node->widget_ptr); if ((c->position_index != XmLAST_POSITION) && (c->position_index <= sc->position_index)) break; sc->position_index = count++; prev_node = next_node; next_node = next_node->next_ptr; } } c->position_index = count++; /* * Insert the node into the linked list. */ node->parent_ptr = parent_node; if ((node->prev_ptr = prev_node) != NULL) prev_node->next_ptr = node; if ((node->next_ptr = next_node) != NULL) next_node->prev_ptr = node; if ((parent_node) && (node->prev_ptr == NULL)) parent_node->child_ptr = node; /* if we've done other parts right, we shouldn't need to do this part */ next_node = node->next_ptr; while (next_node) { sc = GetContainerConstraint(next_node->widget_ptr); sc->position_index = count++; next_node = next_node->next_ptr; } /* * Update cw->container.first_node, if we're now the first node. */ if (node->next_ptr == cw->container.first_node) cw->container.first_node = node; } /************************************************************************ * SeverNode (Private Function) ************************************************************************/ static void SeverNode( CwidNode node) { XmContainerWidget cw; CwidNode parent_node; CwidNode prev_node; CwidNode next_node; if (node == NULL) return; cw = (XmContainerWidget)XtParent(node->widget_ptr); /* * Find new cw->container.first_node, if we're now the first node. */ if (node == cw->container.first_node) { if (node->next_ptr) cw->container.first_node = node->next_ptr; else cw->container.first_node = GetNextUpLevelNode(node); } /* * If we're child #1, fix up parent-child pointers. */ if ((node->prev_ptr == NULL) && (node->parent_ptr)) { parent_node = node->parent_ptr; parent_node->child_ptr = node->next_ptr; } /* * Unlink node from the linked list. */ if (node->prev_ptr) { prev_node = node->prev_ptr; prev_node->next_ptr = node->next_ptr; } if (node->next_ptr) { next_node = node->next_ptr; next_node->prev_ptr = node->prev_ptr; } } /************************************************************************ * DeleteNode (Private Function) ************************************************************************/ static void DeleteNode( Widget cwid) { XmContainerConstraint c = GetContainerConstraint(cwid); CwidNode target_node; CwidNode child_node; CwidNode target_child; if ((target_node = c->node_ptr) == NULL) return; /* * Delete any children first. */ child_node = target_node->child_ptr; while (child_node) { target_child = child_node; child_node = child_node->next_ptr; DeleteNode(target_child->widget_ptr); } SeverNode(target_node); XtFree((char*)target_node); c->node_ptr = NULL; c->visible_in_outline = False; } /************************************************************************ * GetFirstNode (Private Function) ************************************************************************/ static CwidNode GetFirstNode( XmContainerWidget cw) { if (NodeIsActive(cw->container.first_node)) return cw->container.first_node; else return GetNextNode(cw->container.first_node) ; } /************************************************************************ * GetNextNode (Private Function) ************************************************************************/ static CwidNode GetNextNode( CwidNode start_node) { XmContainerWidget cw; CwidNode node; if (!start_node) return(NULL); cw = (XmContainerWidget)XtParent(start_node->widget_ptr); if (CtrLayoutIsSPATIAL(cw)) { node = start_node->next_ptr; while (node) { if (NodeIsActive(node)) return(node); node = node->next_ptr; } return(NULL); } /* depth-first search of tree */ if (NodeIsActive(start_node) && (start_node->child_ptr)) node = start_node->child_ptr; else if (start_node->next_ptr) node = start_node->next_ptr; else node = GetNextUpLevelNode(start_node); while (node) { if (NodeIsActive(node)) return(node); if (node->next_ptr) node = node->next_ptr; else node = GetNextUpLevelNode(node); } return(NULL); } /************************************************************************ * NodeIsActive (Private Function) ************************************************************************/ static Boolean NodeIsActive( CwidNode node) { XmContainerWidget cw; XmContainerConstraint c; if (!node) return(False); if (!XtIsManaged(node->widget_ptr)) return(False); cw = (XmContainerWidget)XtParent(node->widget_ptr); if (CtrLayoutIsOUTLINE_DETAIL(cw)) { c = GetContainerConstraint(node->widget_ptr); if (!c->visible_in_outline) return(False); } return(True); } /************************************************************************ * GetNextUpLevelNode (Private Function) ************************************************************************/ static CwidNode GetNextUpLevelNode( CwidNode start_node) { CwidNode node; node = start_node; while (node) { node = node->parent_ptr; if (node) if (node->next_ptr) return(node->next_ptr); } return(NULL); } static void ContainerResetDepths (XmContainerConstraint c) { CwidNode node = c->node_ptr->child_ptr; while (node) { Widget child = node->widget_ptr; XmContainerConstraint cc = GetContainerConstraint(child); cc->depth = c->depth + 1; ContainerResetDepths(cc); node = node->next_ptr; } } #ifdef FIX_1425 static void FindMaxDepths(XmContainerConstraint c, Widget w) { XmContainerWidget cw = (XmContainerWidget)w; CwidNode node = c->node_ptr->child_ptr; while (node) { Widget child = node->widget_ptr; XmContainerConstraint cc = GetContainerConstraint(child); cw->container.max_depth = MAX(cw->container.max_depth, cc->depth); FindMaxDepths(cc, (Widget)cw); node = node->next_ptr; } } #endif /* true if newEntryParent (or any other widget) is a descendant of the target; ** determine by looking upward in the tree for a match. Returns True for the ** widget itself. */ static Boolean ContainerIsDescendant (Widget containerChild, Widget newEntryParent) { XmContainerConstraint nepc = GetContainerConstraint(newEntryParent); CwidNode node = nepc->node_ptr; while (node) { if (node->widget_ptr == containerChild) return True; node = node->parent_ptr; } return False; } static void ContainerResequenceNodes (XmContainerWidget cw, Widget entryParent) { XmContainerConstraint c; CwidNode node; int count = 0; if (entryParent) { c = GetContainerConstraint(entryParent); node = c->node_ptr->child_ptr; } else { node = cw->container.first_node; } while (node) { c = GetContainerConstraint(node->widget_ptr); c->position_index = count++; node = node->next_ptr; } } /************************************************************************ * StartSelect (Private Function) ************************************************************************/ static void StartSelect( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Widget current_cwid; XmContainerConstraint c = NULL; current_cwid = ObjectAtPoint(wid,event->xbutton.x,event->xbutton.y); /* Handle ObjectAtPoint returning an outline button */ if ((current_cwid) && CtrOUTLINE_BUTTON(current_cwid)) current_cwid = NULL; cw->container.no_auto_sel_changes = False; /* * Setup for marque drawing and multiclick time. * Will return true if XmNdefaultActionCallback invoked. */ if (SetupDrag(wid, event, params, num_params)) return; if (CtrPolicyIsSINGLE(cw)) { /* CR 8400 - clicking on selected item should unselect in SINGLE mode */ /* Fix by Metro Link. First, get the constraints if current_cwid is valid. */ if (current_cwid) c = GetContainerConstraint(current_cwid); /* Now check to see if the *item* is selected. */ if (current_cwid && current_cwid == cw->container.anchor_cwid && c->selection_visual == XmSELECTED && cw->container.selection_state == XmSELECTED) { /* Unselect if clicking on a selected item */ cw->container.selection_state = XmNOT_SELECTED; MarkCwid(current_cwid,False); cw->container.anchor_cwid = NULL; return; } cw->container.no_auto_sel_changes |= DeselectAllCwids(wid); cw->container.anchor_cwid = current_cwid; if (cw->container.anchor_cwid == NULL) return; cw->container.no_auto_sel_changes |= MarkCwid(cw->container.anchor_cwid,False); SetLocationCursor(cw->container.anchor_cwid); return; } if (CtrPolicyIsBROWSE(cw)) { if (current_cwid != cw->container.anchor_cwid) { cw->container.no_auto_sel_changes |= DeselectAllCwids(wid); cw->container.anchor_cwid = current_cwid; if (cw->container.anchor_cwid) { cw->container.no_auto_sel_changes |= MarkCwid(cw->container.anchor_cwid, True); SetLocationCursor(cw->container.anchor_cwid); } } if (CtrIsAUTO_SELECT(cw)) CallSelectCB(wid,event,XmAUTO_BEGIN); return; } if (!cw->container.extending_mode) cw->container.no_auto_sel_changes |= DeselectAllCwids(wid); cw->container.anchor_cwid = current_cwid; if (cw->container.anchor_cwid) SetLocationCursor(cw->container.anchor_cwid); if (CtrTechIsTOUCH_OVER(cw)) { if (cw->container.anchor_cwid == NULL) cw->container.marquee_mode = True; else cw->container.marquee_mode = False; } if (cw->container.anchor_cwid == NULL) { if (CtrIsAUTO_SELECT(cw)) CallSelectCB(wid,event,XmAUTO_BEGIN); cw->container.started_in_anchor = False; return; } else cw->container.started_in_anchor = True; if (cw->container.extending_mode) { c = GetContainerConstraint(cw->container.anchor_cwid); if (c->selection_state == XmSELECTED) cw->container.selection_state = XmNOT_SELECTED; else cw->container.selection_state = XmSELECTED; } cw->container.no_auto_sel_changes |= MarkCwid(cw->container.anchor_cwid,True); if (CtrIsAUTO_SELECT(cw)) CallSelectCB(wid,event,XmAUTO_BEGIN); if ((CtrTechIsMARQUEE_ES(cw) || CtrTechIsMARQUEE_EB(cw)) && (!CtrLayoutIsDETAIL(cw))) { XSetClipMask(XtDisplay(wid), cw->container.marqueeGC, None); RecalcMarquee(wid,cw->container.anchor_cwid, event->xbutton.x,event->xbutton.y); DrawMarquee(wid); cw->container.marquee_drawn = True; } } /*ARGSUSED*/ static Boolean SetupDrag(Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Widget current_cwid; int multi_click_time; Time click_time; /* Figure out double clicking */ current_cwid = ObjectAtPoint(wid,event->xbutton.x,event->xbutton.y); /* Handle ObjectAtPoint returning an outline button */ if ((current_cwid) && CtrOUTLINE_BUTTON(current_cwid)) current_cwid = NULL; multi_click_time = XtGetMultiClickTime(XtDisplay(wid)); click_time = event->xbutton.time; if ((cw->container.anchor_cwid == current_cwid) && ((click_time - cw->container.last_click_time) < multi_click_time)) { cw->container.last_click_time = click_time; if (cw->container.anchor_cwid) CallActionCB(cw->container.anchor_cwid,event); cw->container.cancel_pressed = True; return(True); } cw->container.last_click_time = event->xbutton.time; cw->container.anchor_point.x = event->xbutton.x; cw->container.marquee_smallest.x = event->xbutton.x; cw->container.marquee_largest.x = event->xbutton.x; cw->container.anchor_point.y = event->xbutton.y; cw->container.marquee_smallest.y = event->xbutton.y; cw->container.marquee_largest.y = event->xbutton.y; return(False); } /************************************************************************ * ProcessButtonMotion (Private Function) ************************************************************************/ /*ARGSUSED*/ static Boolean ProcessButtonMotion( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Widget current_cwid; Boolean selection_changes = False; Boolean find_anchor = False; XmContainerConstraint c; current_cwid = ObjectAtPoint(wid,event->xbutton.x,event->xbutton.y); /* Handle ObjectAtPoint returning an outline button */ if ((current_cwid) && CtrOUTLINE_BUTTON(current_cwid)) current_cwid = NULL; if (CtrPolicyIsBROWSE(cw)) { if ((cw->container.extend_pressed) || (cw->container.toggle_pressed)) return(False); if (current_cwid == cw->container.anchor_cwid) return(False); if (cw->container.anchor_cwid) { cw->container.selection_state = XmNOT_SELECTED; selection_changes = MarkCwid(cw->container.anchor_cwid, False); cw->container.selection_state = XmSELECTED; } if (current_cwid) selection_changes |= MarkCwid(current_cwid,True); cw->container.anchor_cwid = current_cwid; return(selection_changes); } /* CtrPolicyIsMULTIPLE || CtrPolicyIsEXTENDED */ /* CUA Random Selection Technique */ if (CtrLayoutIsSPATIAL(cw) && (!cw->container.marquee_mode)) { if (current_cwid== NULL) return(False); if (cw->container.anchor_cwid == NULL) { /* Gotta have a reference point for toggling */ c = GetContainerConstraint(current_cwid); if (c->selection_visual == XmSELECTED) cw->container.selection_state = XmNOT_SELECTED; else cw->container.selection_state = XmSELECTED; cw->container.anchor_cwid = current_cwid; } return(MarkCwid(current_cwid,True)); } /* CUA Range Selection Technique */ if (CtrLayoutIsDETAIL(cw) || (CtrLayoutIsOUTLINE_DETAIL(cw) && !cw->container.marquee_mode)) return(MarkCwidsInRange(wid,cw->container.anchor_cwid, current_cwid,(Boolean)True)); /* CUA Marquee Selection Technique */ find_anchor = (cw->container.anchor_cwid == NULL); RecalcMarquee(wid,current_cwid,event->xbutton.x,event->xbutton.y); selection_changes = MarkCwidsInMarquee(wid,find_anchor,True); DrawMarquee(wid); cw->container.marquee_drawn = True; return(selection_changes); } /************************************************************************ * * ObjectAtPoint method * Given a composite widget and an (x, y) coordinate, see if the * (x, y) lies within one of the object (gadget or widget) contained * within the composite. * ************************************************************************/ static Widget ObjectAtPoint(Widget wid, Position x, Position y) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Widget prev_cwid; XmGadget g; XmPointInTrait pointInTrait ; node = cw->container.first_node; prev_cwid = NULL; while (node) { XmContainerConstraint c; g = (XmGadget)node->widget_ptr; c = GetContainerConstraint((Widget) g); /* If we are in OUTLINE_DETAIL, then check for hit in outline button, if there is one */ if (CtrLayoutIsOUTLINE_DETAIL(cw) && c -> related_cwid != (Widget) NULL) { Widget outline_button = c -> related_cwid; pointInTrait = (XmPointInTrait) XmeTraitGet((XtPointer)XtClass(outline_button),XmQTpointIn) ; if (pointInTrait) { if (pointInTrait->pointIn(outline_button, x, y)) return outline_button; } else if ((XtX(outline_button) <= x) && (XtX(outline_button) + XtWidth(outline_button) >= x) && (XtY(outline_button) <= y) && (XtY(outline_button) + XtHeight(outline_button) >= y)) return(outline_button); } pointInTrait = (XmPointInTrait) XmeTraitGet((XtPointer)XtClass(node->widget_ptr),XmQTpointIn) ; if ((y < g->rectangle.y) && CtrLayoutIsOUTLINE_DETAIL(cw)) return(prev_cwid); if (pointInTrait && ! CtrLayoutIsOUTLINE_DETAIL(cw)) { if (pointInTrait->pointIn(node->widget_ptr, x, y)) return node->widget_ptr ; } else if ((g->rectangle.x <= x) && (x <= g->rectangle.x + g->rectangle.width) && (g->rectangle.y <= y) && (y <= g->rectangle.y + g->rectangle.height)) return(node->widget_ptr); if ((g->rectangle.y + g->rectangle.height > cw->core.height) && CtrLayoutIsOUTLINE_DETAIL(cw)) return(NULL); if ((g->rectangle.x <= x) && (x <= g->rectangle.x + g->rectangle.width)) prev_cwid = node->widget_ptr; else prev_cwid = NULL; node = GetNextNode(node); } return(NULL); } /************************************************************************ * SelectAllCwids (Private Function) ************************************************************************/ static Boolean SelectAllCwids( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Boolean selection_changes = False; /* * Mark all visible cwids as XmSELECTED */ cw->container.selection_state = XmSELECTED; node = cw->container.first_node; while (node) { selection_changes |= MarkCwid(node->widget_ptr,False); node = GetNextNode(node); } return(selection_changes); } /************************************************************************ * DeselectAllCwids (Private Function) ************************************************************************/ static Boolean DeselectAllCwids( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Boolean selection_changes = False; if (cw->container.selected_item_count == 0) { cw->container.selection_state = XmSELECTED; return(False); } /* * Mark all visible cwids as XmNOT_SELECTED */ cw->container.selection_state = XmNOT_SELECTED; node = cw->container.first_node; while (node) { selection_changes |= MarkCwid(node->widget_ptr,False); node = GetNextNode(node); if (cw->container.selected_item_count == 0) { cw->container.selection_state = XmSELECTED; return(selection_changes); } } /* * Didn't work. There must be some hidden child cwids that are * XmSELECTED. We'll have to traverse the entire list. */ node = cw->container.first_node; while (node) { selection_changes |= MarkCwid(node->widget_ptr,False); if (cw->container.selected_item_count == 0) { cw->container.selection_state = XmSELECTED; return(selection_changes); } /* * depth-first search of tree, whether the cwids are * visible or not. */ if (node->child_ptr) node = node->child_ptr; else if (node->next_ptr) node = node->next_ptr; else node = GetNextUpLevelNode(node); } cw->container.selection_state = XmSELECTED; return(selection_changes); } /************************************************************************ * MarkCwid (Private Function) ************************************************************************/ static Boolean MarkCwid( Widget cwid, Boolean visual_only) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); Boolean selection_changes = False; if (XtIsSensitive(cwid)) { if (cw->container.selection_state != c->selection_visual) { c->selection_visual = cw->container.selection_state; SetVisualEmphasis(cwid,c->selection_visual); if (c->selection_visual == XmSELECTED) cw->container.selected_item_count++; else cw->container.selected_item_count--; selection_changes = True; } if (!visual_only) c->selection_state = c->selection_visual; } return(selection_changes); } /************************************************************************ * UnmarkCwidVisual (Private Function) ************************************************************************/ static Boolean UnmarkCwidVisual( Widget cwid) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); /* * If the item visual matches its select state, or the item * visual doesn't match our current select/unselect action, * then return. * Otherwise, restore the item's visual to its select state * and add to/remove from the selected items list. */ if ((c->selection_visual == c->selection_state) || (c->selection_visual != cw->container.selection_state)) return(False); c->selection_visual = c->selection_state; SetVisualEmphasis(cwid,c->selection_visual); if (c->selection_visual == XmSELECTED) cw->container.selected_item_count++; else cw->container.selected_item_count--; return(True); } /************************************************************************ * SetMarkedCwids (Private Function) ************************************************************************/ static void SetMarkedCwids( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; XmContainerConstraint c; node = cw->container.first_node; while (node) { c = GetContainerConstraint(node->widget_ptr); c->selection_state = c->selection_visual; node = GetNextNode(node); } } /************************************************************************ * ResetMarkedCwids (Private Function) ************************************************************************/ static Boolean ResetMarkedCwids( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Boolean selection_changes = False; node = cw->container.first_node; while (node) { selection_changes |= UnmarkCwidVisual(node->widget_ptr); node = GetNextNode(node); } return(selection_changes); } /************************************************************************ * MarkCwidsInRange (Private Function) ************************************************************************/ static Boolean MarkCwidsInRange( Widget wid, Widget cwid1, Widget cwid2, Boolean visual_only) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Boolean cwid1_found = False; Boolean cwid2_found = False; Boolean marking_started = False; Boolean marking_ended = False; Boolean selection_changes = False; node = cw->container.first_node; if (cwid1 == NULL) if ((cwid1 = cwid2) == NULL) return(False); if (cwid2 == NULL) if ((cwid2 = cwid1) == NULL) return(False); while (node) { if (node->widget_ptr == cwid1) cwid1_found = True; if (node->widget_ptr == cwid2) cwid2_found = True; if ((cwid1_found || cwid2_found) && (!marking_started)) marking_started = True; if (marking_started && (!marking_ended)) selection_changes |= MarkCwid(node->widget_ptr, visual_only); else selection_changes |= UnmarkCwidVisual(node->widget_ptr); if (cwid1_found && cwid2_found && marking_started) marking_ended = True; node = GetNextNode(node); } return(selection_changes); } /************************************************************************ * MarkCwidsInMarquee (Private Function) ************************************************************************/ static Boolean MarkCwidsInMarquee( Widget wid, Boolean find_anchor, Boolean visual_only) { XmContainerWidget cw = (XmContainerWidget)wid; CwidNode node; Boolean selection_changes = False; XmContainerConstraint c; node = cw->container.first_node; while (node) { if (InMarquee(node->widget_ptr)) { if (find_anchor) { cw->container.anchor_cwid = node->widget_ptr; c = GetContainerConstraint(node->widget_ptr); if (c->selection_state == XmSELECTED) cw->container.selection_state = XmNOT_SELECTED; else cw->container.selection_state = XmSELECTED; find_anchor = False; } selection_changes |= MarkCwid(node->widget_ptr, visual_only); } else selection_changes |= UnmarkCwidVisual(node->widget_ptr); node = GetNextNode(node); } return(selection_changes); } /************************************************************************ * InMarquee (Private Function) ************************************************************************/ static Boolean InMarquee( Widget cwid) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); Position cwid_x,cwid_y,cwid_xw,cwid_yh; Dimension width,height; XtVaGetValues(cwid,XmNx,&cwid_x,XmNy,&cwid_y, XmNwidth,&width,XmNheight,&height,NULL); cwid_xw = cwid_x + (Position)width; cwid_yh = cwid_y + (Position)height; return( (cwid_x >= cw->container.marquee_start.x) && (cwid_y >= cw->container.marquee_start.y) && (cwid_xw <= cw->container.marquee_end.x) && (cwid_yh <= cw->container.marquee_end.y)); } /************************************************************************ * RecalcMarquee (Private Function) ************************************************************************/ static void RecalcMarquee( Widget wid, Widget cwid, Position x, Position y) { XmContainerWidget cw = (XmContainerWidget)wid; Dimension width,height; Position anchor_x,anchor_y,anchor_xw,anchor_yh; Position cwid_x,cwid_y,cwid_xw,cwid_yh; /* * Erase any marquee that is currently drawn. */ if (cw->container.marquee_drawn) { DrawMarquee(wid); cw->container.marquee_drawn = False; } /* * Set the new marquee start and end points depending upon * the XmNselectionTechnique resource. * If XmMARQUEE_EXTEND_BOTH, use the anchor_cwid and current_cwid * corners as endpoints (if they are given). * If XmMARQUEE_EXTEND_START, use the anchor_cwid corners (if given) * and the current pointer position as endpoints. * If XmMARQUEE, use the original anchor points and the current * pointer position, given by the x & y parameters. * container.marquee_start.x & marquee_start.y always marks upper left. * container.marquee_end.x & marquee_end.y always marks lower right. */ switch(cw->container.selection_technique) { case XmMARQUEE_EXTEND_BOTH: if ((cw->container.started_in_anchor) && (cwid)) { XtVaGetValues(cw->container.anchor_cwid, XmNx,&anchor_x,XmNy,&anchor_y, XmNwidth,&width, XmNheight,&height,NULL); anchor_xw = anchor_x + (Position)width; anchor_yh = anchor_y + (Position)height; /* CR9113: adjust marquee to encompass child */ if(anchor_x > 0) anchor_x--, width++; if(anchor_y > 0) anchor_y--, height++; XtVaGetValues(cwid,XmNx,&cwid_x,XmNy,&cwid_y, XmNwidth,&width, XmNheight,&height,NULL); /* CR9113: adjust marquee to encompass child */ if(cwid_x > 0) cwid_x--, width++; if(cwid_y > 0) cwid_y--, height++; cwid_xw = cwid_x + (Position)width; cwid_yh = cwid_y + (Position)height; cw->container.marquee_start.x = MIN(anchor_x,cwid_x); cw->container.marquee_start.y = MIN(anchor_y,cwid_y); cw->container.marquee_end.x = MAX(anchor_xw,cwid_xw); cw->container.marquee_end.y = MAX(anchor_yh,cwid_yh); break; } if (cw->container.started_in_anchor) cwid = cw->container.anchor_cwid; if ((!cw->container.started_in_anchor) && (cwid)) { x = cw->container.anchor_point.x; y = cw->container.anchor_point.y; } case XmMARQUEE_EXTEND_START: if CtrTechIsMARQUEE_ES(cw) { if (cw->container.started_in_anchor) cwid = cw->container.anchor_cwid; else cwid = NULL; } if (cwid) { XtVaGetValues(cwid,XmNx,&cwid_x, XmNy,&cwid_y,XmNwidth,&width, XmNheight,&height,NULL); /* CR9113: adjust marquee to encompass child */ if(cwid_x > 0) cwid_x--, width++; if(cwid_y > 0) cwid_y--, height++; cwid_xw = cwid_x + (Position)width; cwid_yh = cwid_y + (Position)height; if (x <= cwid_xw) { cw->container.marquee_start.x = MIN(x,cwid_x); cw->container.marquee_end.x = cwid_xw; } else { cw->container.marquee_start.x = cwid_x; cw->container.marquee_end.x = MAX(x,cwid_xw); } if (y <= cwid_yh) { cw->container.marquee_start.y = MIN(y,cwid_y); cw->container.marquee_end.y = cwid_yh; } else { cw->container.marquee_start.y = cwid_y; cw->container.marquee_end.y = MAX(y,cwid_yh); } break; } case XmMARQUEE: case XmTOUCH_OVER: cw->container.marquee_start.x = MIN(x,cw->container.anchor_point.x); cw->container.marquee_start.y = MIN(y,cw->container.anchor_point.y); cw->container.marquee_end.x = MAX(x,cw->container.anchor_point.x); cw->container.marquee_end.y = MAX(y,cw->container.anchor_point.y); break; default: return; } /* * Keep track of the largest area covered by the marquee. */ cw->container.marquee_smallest.x = MIN(cw->container.marquee_start.x, cw->container.marquee_smallest.x); cw->container.marquee_smallest.y = MIN(cw->container.marquee_start.y, cw->container.marquee_smallest.y); cw->container.marquee_largest.x = MAX(cw->container.marquee_end.x, cw->container.marquee_largest.x); cw->container.marquee_largest.y = MAX(cw->container.marquee_end.y, cw->container.marquee_largest.y); } /************************************************************************ * DrawMarquee (Private Function) ************************************************************************/ static void DrawMarquee( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; Dimension width,height; /* * If the container widget is realized, draw the marquee rectangle * using the gc parameter. */ if (!XtIsRealized(wid)) return; width = (Dimension)(cw->container.marquee_end.x - cw->container.marquee_start.x); height = (Dimension)(cw->container.marquee_end.y - cw->container.marquee_start.y); XDrawRectangle(XtDisplay(wid),XtWindow(wid),cw->container.marqueeGC, cw->container.marquee_start.x,cw->container.marquee_start.y, width,height); } /************************************************************************ * KBSelect (Private Function) ************************************************************************/ /*ARGSUSED*/ static void KBSelect( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmContainerWidget cw = (XmContainerWidget)wid; Widget focus_cwid = XmGetFocusWidget(wid); XmContainerConstraint c; if ((focus_cwid == wid) || (focus_cwid == NULL)) return; cw->container.no_auto_sel_changes = False; c = GetContainerConstraint(focus_cwid); cw->container.anchor_cwid = focus_cwid; if ((!cw->container.extending_mode || CtrPolicyIsSINGLE(cw)) && ((cw->container.selected_item_count > 1) || (c->selection_state != XmSELECTED))) cw->container.no_auto_sel_changes |= DeselectAllCwids(wid); if (cw->container.extending_mode) { if (c->selection_state == XmSELECTED) cw->container.selection_state = XmNOT_SELECTED; else cw->container.selection_state = XmSELECTED; } cw->container.no_auto_sel_changes |= MarkCwid(focus_cwid,False); GainPrimary(wid,event->xbutton.time); if (CtrIsAUTO_SELECT(cw)) { CallSelectCB(wid,event,XmAUTO_BEGIN); CallSelectCB(wid,event,XmAUTO_NO_CHANGE); } else if (cw->container.no_auto_sel_changes) CallSelectCB(wid,event,XmAUTO_UNSET); } /************************************************************************ * SetLocationCursor (Private Function) ************************************************************************/ static void SetLocationCursor( Widget cwid) { if (cwid == NULL) return; if (cwid == XmGetFocusWidget(XtParent(cwid))) return; XmProcessTraversal(cwid,XmTRAVERSE_CURRENT); } /************************************************************************ * CalcNextLocationCursor (Private Function) ************************************************************************/ static void CalcNextLocationCursor( Widget wid, String direction) { XmContainerWidget cw = (XmContainerWidget)wid; int move_to; Widget w; if (_XmConvertActionParamToRepTypeId((Widget) cw, XmRID_CONTAINER_CURSOR_ACTION_PARAMS, direction, False, &move_to) == False) { /* We couldn't convert the value. Just assume a value of _FIRST. */ move_to = _FIRST; } if (CtrLayoutIsSPATIAL(cw)) { if (move_to == _LEFT) XmProcessTraversal(wid, XmTRAVERSE_LEFT); else if (move_to == _RIGHT) XmProcessTraversal(wid, XmTRAVERSE_RIGHT); else if (move_to == _UP) XmProcessTraversal(wid, XmTRAVERSE_UP); else if (move_to == _DOWN) XmProcessTraversal(wid, XmTRAVERSE_DOWN); else if (move_to == _FIRST) XmProcessTraversal(wid, XmTRAVERSE_HOME); else if (move_to == _LAST) XmProcessTraversal(cw->container.last_node->widget_ptr, XmTRAVERSE_CURRENT); } else /* CtrLayoutIsOUTLINE_DETAIL(cw) */ { if (move_to == _LEFT) XmProcessTraversal(wid, XmTRAVERSE_LEFT); else if (move_to == _RIGHT) XmProcessTraversal(wid, XmTRAVERSE_RIGHT); else if (move_to == _UP) XmProcessTraversal(wid, XmTRAVERSE_UP); else if (move_to == _DOWN) XmProcessTraversal(wid, XmTRAVERSE_DOWN); else if (move_to == _FIRST) XmProcessTraversal(wid, XmTRAVERSE_HOME); else if (move_to == _LAST) { w = GetLastTraversalWidget(cw, cw->container.first_node->widget_ptr, False); if (w) XmProcessTraversal(w, XmTRAVERSE_CURRENT); } } } /************************************************************************ * RedirectTraversal (ControlTraversal Trait Method) ************************************************************************/ static Widget RedirectTraversal( Widget old_focus, Widget new_focus, unsigned int focus_policy, XmTraversalDirection direction, unsigned int pass) { XmContainerWidget cw; Widget to_widget = new_focus; Boolean wrap; if ( (old_focus == NULL) || (focus_policy != XmEXPLICIT) || ( direction != XmTRAVERSE_PREV && direction != XmTRAVERSE_NEXT && direction != XmTRAVERSE_LEFT && direction != XmTRAVERSE_RIGHT && direction != XmTRAVERSE_UP && direction != XmTRAVERSE_DOWN && direction != XmTRAVERSE_HOME)) return new_focus; if ( ((cw=(XmContainerWidget)XtParent(old_focus)) == NULL) || (!XmIsContainer(cw)) || (CtrLayoutIsSPATIAL(cw)) || (CtrOUTLINE_BUTTON(old_focus))) return new_focus; wrap = !XmIsClipWindow((XmClipWindowWidget)XtParent(cw)); switch (direction) { case XmTRAVERSE_PREV: case XmTRAVERSE_LEFT: case XmTRAVERSE_UP: to_widget = GetPrevTraversalWidget(cw, old_focus, wrap); break; case XmTRAVERSE_NEXT: case XmTRAVERSE_RIGHT: case XmTRAVERSE_DOWN: to_widget = GetNextTraversalWidget(cw, old_focus, wrap); break; case XmTRAVERSE_HOME: to_widget = GetFirstTraversalWidget(cw, old_focus, wrap); break; default: break; } /* switch */ return (to_widget ? to_widget : old_focus); } /************************************************************************ * GetLastTraversableChild (Private Function) ************************************************************************/ static CwidNode GetLastTraversableChild( CwidNode node) { CwidNode last_node = NULL; CwidNode child_node; CwidNode recu_node; if (node && (child_node=node->child_ptr)) { while (child_node) { if (NodeIsActive(child_node)) { if (XtIsSensitive(child_node->widget_ptr)) last_node = child_node; if ((recu_node=GetLastTraversableChild(child_node))) last_node = recu_node; } child_node = child_node->next_ptr; } } return(last_node); } /************************************************************************ * GetPrevTraversableSibling (Private Function) ************************************************************************/ static CwidNode GetPrevTraversableSibling( CwidNode node) { CwidNode prev_node = NULL; CwidNode recu_node; if (node && (prev_node=node->prev_ptr)) { while (prev_node) { if (NodeIsActive(prev_node)) { if ((recu_node=GetLastTraversableChild(prev_node))) { prev_node = recu_node; break; } if (XtIsSensitive(prev_node->widget_ptr)) break; } prev_node = prev_node->prev_ptr; } } return(prev_node); } /************************************************************************ * GetPrevTraversableUplevel (Private Function) (Private Function) ************************************************************************/ static CwidNode GetPrevTraversableUplevel( CwidNode node) { CwidNode prev_node = NULL; CwidNode parent_node; CwidNode recu_node; if (node && (parent_node=node->parent_ptr)) { while (parent_node) { if (NodeIsActive(parent_node)) { if (XtIsSensitive(parent_node->widget_ptr)) { prev_node = parent_node; break; } if ((recu_node=GetPrevTraversableSibling(parent_node))) { prev_node = recu_node; break; } } parent_node = parent_node->parent_ptr; } } return(prev_node); } /************************************************************************ * GetNextTraversableChild (Private Function) ************************************************************************/ static CwidNode GetNextTraversableChild( CwidNode node) { CwidNode next_node = NULL; CwidNode recu_node; if (node && (next_node=node->child_ptr)) { while (next_node) { if (NodeIsActive(next_node)) { if (XtIsSensitive(next_node->widget_ptr)) break; if ((recu_node=GetNextTraversableChild(next_node))) { next_node = recu_node; break; } } next_node = next_node->next_ptr; } } return(next_node); } /************************************************************************ * GetNextTraversableSibling (Private Function) ************************************************************************/ static CwidNode GetNextTraversableSibling( CwidNode node) { CwidNode next_node = NULL; CwidNode recu_node; if (node && (next_node=node->next_ptr)) { while (next_node) { if (NodeIsActive(next_node)) { if (XtIsSensitive(next_node->widget_ptr)) break; if ((recu_node=GetNextTraversableChild(next_node))) { next_node = recu_node; break; } } next_node = next_node->next_ptr; } } return(next_node); } /************************************************************************ * GetNextTraversableUplevel (Private Function) ************************************************************************/ static CwidNode GetNextTraversableUplevel( CwidNode node) { CwidNode next_node = NULL; CwidNode parent_node; if (node && (parent_node=node->parent_ptr)) { while (parent_node && (next_node == NULL)) { next_node = GetNextTraversableSibling(parent_node); if (next_node == NULL) parent_node = parent_node->parent_ptr; } } return(next_node); } /************************************************************************ * GetNextTraversable (Private Function) ************************************************************************/ static CwidNode GetNextTraversable( CwidNode node) { CwidNode next_node = NULL; if (node == NULL) return(NULL); next_node = GetNextTraversableChild(node); if (next_node == NULL) next_node = GetNextTraversableSibling(node); if (next_node == NULL) next_node = GetNextTraversableUplevel(node); return(next_node); } /************************************************************************ * GetLastTraversalWidget (Private Function) ************************************************************************/ static Widget GetLastTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap) { CwidNode last_node = NULL; CwidNode temp_node; CwidNode child_node; if (cw == NULL || child == NULL) return(NULL); child_node = cw->container.first_node; while (child_node && !NodeIsActive(child_node)) child_node = child_node->next_ptr; if (child_node) { last_node = child_node; while ((temp_node=GetNextTraversableSibling(last_node))) last_node = temp_node; if (last_node && (temp_node=GetLastTraversableChild(last_node))) last_node = temp_node; if (last_node == NULL && XtIsSensitive(child_node->widget_ptr)) last_node = child_node; } if (last_node && !XmIsTraversable(last_node->widget_ptr)) last_node = NULL; return(last_node ? last_node->widget_ptr : NULL); } /************************************************************************ * GetFirstTraversalWidget (Private Function) ************************************************************************/ static Widget GetFirstTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap) { CwidNode first_node = NULL; CwidNode child_node; if (cw == NULL || child == NULL) return(NULL); child_node = cw->container.first_node; while (child_node && !NodeIsActive(child_node)) child_node = child_node->next_ptr; if (child_node) { if (XtIsSensitive(child_node->widget_ptr)) first_node = child_node; else first_node = GetNextTraversable(child_node); } if (first_node && !XmIsTraversable(first_node->widget_ptr)) first_node = NULL; return(first_node ? first_node->widget_ptr : NULL); } /************************************************************************ * GetNextTraversalWidget (Private Function) ************************************************************************/ static Widget GetNextTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap) { CwidNode child_node; CwidNode next_node; if (cw == NULL || child == NULL) return(NULL); child_node = GetContainerConstraint(child)->node_ptr; next_node = GetNextTraversable(child_node); if (next_node == NULL && wrap) return(GetFirstTraversalWidget(cw, child, wrap)); if (next_node && !XmIsTraversable(next_node->widget_ptr)) next_node = NULL; return(next_node ? next_node->widget_ptr : NULL); } /************************************************************************ * GetPrevTraversalWidget (Private Function) ************************************************************************/ static Widget GetPrevTraversalWidget( XmContainerWidget cw, Widget child, Boolean wrap) { CwidNode child_node; CwidNode prev_node; CwidNode last_node; if (cw == NULL || child == NULL) return(NULL); child_node = GetContainerConstraint(child)->node_ptr; prev_node = GetPrevTraversableSibling(child_node); if (prev_node == NULL) prev_node = GetPrevTraversableUplevel(child_node); if (prev_node == NULL && wrap) return(GetLastTraversalWidget(cw, child, wrap)); if (prev_node && !XmIsTraversable(prev_node->widget_ptr)) prev_node = NULL; return(prev_node ? prev_node->widget_ptr : NULL); } /************************************************************************ * MakeOutlineButton (Private Function) ************************************************************************/ static void MakeOutlineButton( Widget cwid) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); XmContainerConstraint obc; Pixmap pm; cw->container.self = True; if (c->outline_state == XmEXPANDED) pm = cw->container.expanded_state_pixmap; else pm = cw->container.collapsed_state_pixmap; cw->container.create_cwid_type = CONTAINER_OUTLINE_BUTTON; c->related_cwid = XtVaCreateWidget(OBNAME, xmPushButtonGadgetClass,(Widget)cw, XmNlabelType,XmPIXMAP, XmNlabelPixmap,pm, XmNtraversalOn,False, XmNmarginWidth,0, XmNmarginHeight,0, NULL); XtAddCallback(c->related_cwid,XmNactivateCallback, (XtCallbackProc)OutlineButtonCallback, (XtPointer)cwid); obc = GetContainerConstraint(c->related_cwid); obc->related_cwid = cwid; XtManageChild(c->related_cwid); cw->container.create_cwid_type = CONTAINER_ICON; cw->container.self = False; #undef NO_PARENT #undef SWINDOW_PARENT #undef CWINDOW_PARENT } /************************************************************************ * ChangeOutlineButton (Private Function) ************************************************************************/ static void ChangeOutlineButtons( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; int i; Widget cwid; XmContainerConstraint c; Pixmap pm; Arg wargs[2]; int n; for (i = 0; i < cw->composite.num_children; i++) { cwid = cw->composite.children[i]; if (CtrOUTLINE_BUTTON(cwid)) { c = GetContainerConstraint(cwid); if (c->outline_state == XmEXPANDED) pm = cw->container.expanded_state_pixmap; else pm = cw->container.collapsed_state_pixmap; n = 0; XtSetArg(wargs[n],XmNlabelPixmap,pm); n++; cw->container.self = True; XtSetValues(cwid,wargs,n); cw->container.self = False; } } } /************************************************************************ * ExpandCwid (Private Function) ************************************************************************/ static void ExpandCwid( Widget cwid) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); CwidNode node; CwidNode child_node; XtWidgetGeometry geo_desired ; if (c->related_cwid == NULL) return; cw->container.self = True; XtVaSetValues(c->related_cwid, XmNlabelPixmap,cw->container.expanded_state_pixmap,NULL); cw->container.self = False; c->outline_state = XmEXPANDED; node = c->node_ptr; child_node = node->child_ptr; if (child_node == NULL) return; while (child_node) { c = GetContainerConstraint(child_node->widget_ptr); c->visible_in_outline = True; child_node = child_node->next_ptr; } geo_desired.width = 0; geo_desired.height = 0; RequestOutlineDetail ((Widget)cw, &geo_desired); /* need to redraw lines correctly */ if (XtIsRealized((Widget)cw)) XClearArea(XtDisplay((Widget)cw),XtWindow((Widget)cw),0,0,0,0,True); } /************************************************************************ * CollapseCwid (Private Function) ************************************************************************/ static void CollapseCwid( Widget cwid) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); CwidNode node; CwidNode child_node; XtWidgetGeometry geo_desired ; if (c->related_cwid == NULL) return; cw->container.self = True; XtVaSetValues(c->related_cwid, XmNlabelPixmap,cw->container.collapsed_state_pixmap,NULL); cw->container.self = False; c->outline_state = XmCOLLAPSED; node = c->node_ptr; child_node = node->child_ptr; if (child_node == NULL) return; while (child_node) { c = GetContainerConstraint(child_node->widget_ptr); c->visible_in_outline = False; HideCwid(child_node->widget_ptr); if (c->related_cwid) HideCwid(c->related_cwid); child_node = child_node->next_ptr; } geo_desired.width = 0; geo_desired.height = 0; RequestOutlineDetail ((Widget)cw, &geo_desired); /* need to redraw lines correctly */ if (XtIsRealized((Widget)cw)) XClearArea(XtDisplay((Widget)cw),XtWindow((Widget)cw),0,0,0,0,True); } /************************************************************************ * CallActionCB (Private Function) ************************************************************************/ static void CallActionCB( Widget cwid, XEvent *event) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); XmContainerSelectCallbackStruct cbs; if (!(XtHasCallbacks((Widget)cw,XmNdefaultActionCallback) == XtCallbackHasSome)) return; if (!XtIsSensitive(cwid)) return; cbs.reason = XmCR_DEFAULT_ACTION; cbs.event = event; if (c->selection_state == XmSELECTED) { cbs.selected_items = GetSelectedCwids((Widget)cw); cbs.selected_item_count = cw->container.selected_item_count; } else { cbs.selected_items = (WidgetList)XtMalloc(sizeof(Widget)); cbs.selected_items[0] = cwid; cbs.selected_item_count = 1; } cbs.auto_selection_type = XmAUTO_UNSET; XtCallCallbackList((Widget)cw,cw->container.default_action_cb,&cbs); XtFree((char*)cbs.selected_items); } /************************************************************************ * CallSelectCB (Private Function) ************************************************************************/ static void CallSelectCB( Widget wid, XEvent *event, unsigned char auto_selection_type) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerSelectCallbackStruct cbs; if (!(XtHasCallbacks(wid,XmNselectionCallback) == XtCallbackHasSome)) return; cbs.selected_items = NULL; cbs.selected_item_count = 0; switch(cw->container.selection_policy) { case XmSINGLE_SELECT: cbs.reason = XmCR_SINGLE_SELECT; case XmBROWSE_SELECT: if (CtrPolicyIsBROWSE(cw)) cbs.reason = XmCR_BROWSE_SELECT; if (cw->container.anchor_cwid) { cbs.selected_items = (WidgetList) XtMalloc(sizeof(Widget)); cbs.selected_items[0] = cw->container.anchor_cwid; cbs.selected_item_count = 1; } break; case XmMULTIPLE_SELECT: cbs.reason = XmCR_MULTIPLE_SELECT; case XmEXTENDED_SELECT: if (CtrPolicyIsEXTENDED(cw)) cbs.reason = XmCR_EXTENDED_SELECT; cbs.selected_items = GetSelectedCwids(wid); cbs.selected_item_count = cw->container.selected_item_count; break; } cbs.event = event; cbs.auto_selection_type = auto_selection_type; XtCallCallbackList(wid,cw->container.selection_cb,&cbs); if (cbs.selected_items) XtFree((char*)cbs.selected_items); } /************************************************************************ * GetSelectedCwids (Private Function) ************************************************************************/ static WidgetList GetSelectedCwids( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; WidgetList selected_items; CwidNode node; unsigned int tally = 0; XmContainerConstraint c; if (cw->container.selected_item_count == 0) return(NULL); selected_items = (WidgetList)XtMalloc (cw->container.selected_item_count * sizeof(Widget)); /* * Search through all the visible items first - it'll work 99% of * the time and it's faster than searching through all the items. */ node = cw->container.first_node; while (node) { c = GetContainerConstraint(node->widget_ptr); if (c->selection_visual == XmSELECTED) { selected_items[tally] = node->widget_ptr; tally++; if (tally == cw->container.selected_item_count) return(selected_items); } node = GetNextNode(node); } /* * Didn't work. There must be some hidden child items that are * XmSELECTED. We'll have to traverse the entire list. */ tally = 0; node = cw->container.first_node; while (node) { c = GetContainerConstraint(node->widget_ptr); if (c->selection_visual == XmSELECTED) { selected_items[tally] = node->widget_ptr; tally++; if (tally == cw->container.selected_item_count) return(selected_items); } /* * depth-first search of tree, whether the items are * visible or not. */ if (node->child_ptr) node = node->child_ptr; else if (node->next_ptr) node = node->next_ptr; else node = GetNextUpLevelNode(node); } return(NULL); } /************************************************************************ * GetSelectedItems (Private Synthetic Resource Function) ************************************************************************/ /*ARGSUSED*/ static void GetSelectedItems( Widget wid, int offset, /* unused */ XtArgVal *value) { WidgetList selected_items; selected_items = GetSelectedCwids(wid); *value = (XtArgVal)selected_items; } /************************************************************************ * CompareInts (Private qsort Function) ************************************************************************/ static int CompareInts( XmConst void *p1, XmConst void *p2) { int i1 = * (int *)p1; int i2 = * (int *)p2; /* * A "qsort" function that simply compares two integers */ return(i1 - i2); } /************************************************************************ * Isqrt (Private Function) ************************************************************************/ static int Isqrt( int n) { /* * Integer Square Root (using Newton's Method) - rounded up */ int current_answer,next_trial; if (n <= 1) return(n); current_answer = n; next_trial = n/2; while(current_answer > next_trial) { current_answer = next_trial; next_trial = (next_trial + n/next_trial)/2; } if (current_answer * current_answer < n) current_answer++; return(current_answer); } /************************************************************************ * GainPrimary (Private Function) ************************************************************************/ static void GainPrimary( Widget wid, Time timestamp) { XmContainerWidget cw = (XmContainerWidget)wid; if (cw->container.primary_ownership == XmOWN_NEVER) return; if ((cw->container.primary_ownership == XmOWN_POSSIBLE_MULTIPLE) && (CtrPolicyIsSINGLE(cw) || CtrPolicyIsBROWSE(cw))) return; if ((cw->container.primary_ownership == XmOWN_MULTIPLE) && (cw->container.selected_item_count <= 1)) return; if (cw->container.selected_item_count == 0) return; cw->container.have_primary = XmePrimarySource(wid,timestamp); } /************************************************************************ * ConvertRefuse (Private Function) ************************************************************************/ /*ARGSUSED*/ static void ConvertRefuse( Widget wid, /* unused */ XtPointer closure, /* unused */ XmConvertCallbackStruct *cs) { cs->value = NULL; cs->length = 0; cs->type = 0; cs->status = XmCONVERT_REFUSE; } /************************************************************************ * DragStart (Private Function) ************************************************************************/ /*ARGSUSED*/ static void DragStart( XtPointer data, XtIntervalId * id) /* unused */ { XmContainerWidget cw = (XmContainerWidget)data; XmGadget g; Arg wargs[20]; int n; Pixmap pixmap = XmUNSPECIFIED_PIXMAP; Pixmap mask = XmUNSPECIFIED_PIXMAP; Widget drag_icon = (Widget) 0; unsigned char vis_state = XmNOT_SELECTED; XtPointer loc_data; Widget dc; Widget diParent = XmGetXmDisplay(XtDisplay(cw)); DragIconInfo dragIconInfo = NULL; int offsetx, offsety; Pixel bg, fg; cw->container.transfer_timer_id = 0; if (cw->container.transfer_action == NULL) return; /* No context record, shouldn't happen */ cw->container.druggee = ObjectAtPoint((Widget)cw, cw->container.transfer_action->event->xbutton.x, cw->container.transfer_action->event->xbutton.y); /* Handle ObjectAtPoint returning an outline button */ if ((cw->container.druggee) && CtrOUTLINE_BUTTON(cw->container.druggee)) cw->container.druggee = NULL; if (cw->container.druggee == NULL) { XtFree((char*)cw->container.transfer_action->event); XtFree((char*)cw->container.transfer_action); cw->container.transfer_action = NULL; return; } g = (XmGadget)cw->container.druggee; offsetx = cw->container.transfer_action->event->xbutton.x - g->rectangle.x; offsety = cw->container.transfer_action->event->xbutton.y - g->rectangle.y; cw->container.drag_offset_x = offsetx; cw->container.drag_offset_y = offsety; /* Get the pixmap if there is one from the IconGadget or other Container savvy object */ n = 0; if (GetViewType(cw->container.druggee) == XmSMALL_ICON) { XtSetArg(wargs[n],XmNsmallIconPixmap,&pixmap); n++; XtSetArg(wargs[n],XmNsmallIconMask,&mask); n++; } else { XtSetArg(wargs[n],XmNlargeIconPixmap,&pixmap); n++; XtSetArg(wargs[n],XmNlargeIconMask,&mask); n++; } XtGetValues(cw->container.druggee,wargs,n); vis_state = GetVisualEmphasis(cw->container.druggee); _XmProcessLock(); if (dragIconInfoContext == 0) dragIconInfoContext = XUniqueContext(); _XmProcessUnlock(); /* Note that there is one of these per display. That way we can just do a XtSetValues and not recreate the state XmDragIcon constantly */ if (XFindContext(XtDisplay(cw), None, dragIconInfoContext, (XPointer*) &dragIconInfo) == XCNOENT || dragIconInfo == (DragIconInfo) NULL) { Pixmap cross; Pixmap cross_m; GC tempgc; Arg args[10]; int n, midpoint = DRAG_STATE_SIZE / 2, farpoint = DRAG_STATE_SIZE; dragIconInfo = (DragIconInfo) XtMalloc(sizeof(DragIconInfoRec)); XSaveContext(XtDisplay(cw), None, dragIconInfoContext, (char*) dragIconInfo); dragIconInfo -> source = (Widget) NULL; cross = XCreatePixmap(XtDisplay(cw),XtWindow(cw),farpoint,farpoint,1); cross_m = XCreatePixmap(XtDisplay(cw),XtWindow(cw),farpoint,farpoint,1); tempgc = XCreateGC(XtDisplay(cw), cross, 0L, NULL); /* Draw a plus sign */ XSetForeground(XtDisplay(cw), tempgc, 0); XFillRectangle(XtDisplay(cw), cross, tempgc, 0, 0, farpoint, farpoint); XFillRectangle(XtDisplay(cw), cross_m, tempgc, 0, 0, farpoint, farpoint); XSetForeground(XtDisplay(cw), tempgc, 1); XSetLineAttributes(XtDisplay(cw), tempgc, 2, LineSolid, CapButt, JoinMiter); XDrawLine(XtDisplay(cw), cross, tempgc, midpoint, 0, midpoint, farpoint); XDrawLine(XtDisplay(cw), cross, tempgc, 0, midpoint, farpoint, midpoint); XSetLineAttributes(XtDisplay(cw), tempgc, 6, LineSolid, CapButt, JoinMiter); XDrawLine(XtDisplay(cw),cross_m,tempgc,midpoint,0,midpoint,farpoint); XDrawLine(XtDisplay(cw),cross_m,tempgc,0,midpoint,farpoint,midpoint); XFreeGC(XtDisplay(cw), tempgc); n = 0; XtSetArg(args[n], XmNpixmap, cross); n++; XtSetArg(args[n], XmNmask, cross_m); n++; XtSetArg(args[n], XmNheight, farpoint); n++; XtSetArg(args[n], XmNwidth, farpoint); n++; dragIconInfo -> state = XmCreateDragIcon(diParent, "stateIcon", args, n); } n = 0; XtSetArg(wargs[n],XmNforeground,&fg); n++; XtSetArg(wargs[n],XmNbackground,&bg); n++; XtGetValues((Widget) g, wargs, n); /* We're dragging from an icon gadget or other object with a pixmap obtained above. We use the pixmap as the source icon. The actual XmDragIcon object is cached to avoid constantly recreating and destroying the objects, and this is done on a per display basis. */ n = 0; if (pixmap != XmUNSPECIFIED_PIXMAP) { unsigned int rh, rw; int rd; int ix, iy; _XmIconGadgetIconPos((Widget) g, &ix, &iy); /* Fix the offset amounts */ offsetx -= ix; offsety -= iy; /* Adjust the state icon position */ XtSetArg(wargs[n],XmNoffsetX, offsetx); n++; XtSetArg(wargs[n],XmNoffsetY, offsety); n++; XtSetValues(dragIconInfo->state, wargs, n); /* now create or fix up the source icon */ XmeGetPixmapData(XtScreen(cw), pixmap, NULL, &rd, NULL, NULL, NULL, NULL, &rw, &rh); n = 0; XtSetArg(wargs[n],XmNpixmap,pixmap); n++; XtSetArg(wargs[n],XmNmask,mask); n++; XtSetArg(wargs[n],XmNheight, rh); n++; XtSetArg(wargs[n],XmNwidth, rw); n++; XtSetArg(wargs[n],XmNdepth, rd); n++; if (dragIconInfo -> source == (Widget) NULL) { drag_icon = XmCreateDragIcon(diParent,"dragIcon",wargs,n); dragIconInfo -> source = drag_icon; } else { drag_icon = dragIconInfo -> source; XtSetValues(drag_icon, wargs, n); } n = 0; XtSetArg(wargs[n],XmNsourcePixmapIcon,drag_icon); n++; XtSetArg(wargs[n],XmNstateCursorIcon,dragIconInfo->state); n++; } XtSetArg(wargs[n],XmNdragOperations, cw->container.transfer_action->operation); n++; if (vis_state == XmSELECTED) loc_data = NULL; else loc_data = (XtPointer)cw->container.druggee; XtSetArg(wargs[n],XmNcursorBackground,bg); n++; XtSetArg(wargs[n],XmNcursorForeground,fg); n++; dc = XmeDragSource((Widget)cw,loc_data, cw->container.transfer_action->event,wargs,n); if (dc) XtAddCallback(dc,XmNdropFinishCallback,DropDoneCallback,cw); cw->container.drag_context = (Widget) dc; XtFree((char*)cw->container.transfer_action->event); XtFree((char*)cw->container.transfer_action); cw->container.transfer_action = NULL; } /************************************************************************ * OutlineButtonCallback (Private Callback Function) ************************************************************************/ /*ARGSUSED*/ static void OutlineButtonCallback( Widget pbwid, /* unused */ XtPointer client_data, XtPointer call_data) { Widget cwid = (Widget)client_data; XmAnyCallbackStruct * pbcbs = (XmAnyCallbackStruct *)call_data; XmContainerConstraint c = GetContainerConstraint(cwid); if (c->outline_state == XmCOLLAPSED) OutlineButtonAction(cwid, XmEXPANDED, pbcbs->event); else /* if (c->outline_state == XmEXPANDED) */ OutlineButtonAction(cwid, XmCOLLAPSED, pbcbs->event); } /************************************************************************ * OutlineButtonAction (Private Callback Function) ************************************************************************/ /*ARGSUSED*/ static void OutlineButtonAction( Widget cwid, unsigned char new_state, XEvent *event) { XmContainerWidget cw = (XmContainerWidget)XtParent(cwid); XmContainerConstraint c = GetContainerConstraint(cwid); XmGadget g = (XmGadget)cwid; XmContainerOutlineCallbackStruct cbs; unsigned char state_before_callback; /* * call the XmNoutlineChangedCallback callback */ if (new_state == XmCOLLAPSED) cbs.reason = XmCR_COLLAPSED; else /* if (new_state == XmEXPANDED) */ cbs.reason = XmCR_EXPANDED; cbs.event = event; cbs.item = cwid; cbs.new_outline_state = new_state; c->outline_state = new_state; state_before_callback = c->outline_state; XtCallCallbackList((Widget)cw,cw->container.outline_cb,&cbs); /* in case user destroys child */ if (g->object.being_destroyed) return; /* verify value returned */ if ((cbs.new_outline_state != XmCOLLAPSED) && (cbs.new_outline_state != XmEXPANDED)) cbs.new_outline_state = state_before_callback; /* in case user has called SetValues in XmNoutlineChangedCallback */ if (c->outline_state != state_before_callback) return; /* the user wants to go back to the previous state */ if (cbs.new_outline_state != state_before_callback) { c->outline_state = cbs.new_outline_state; return; } if (c->outline_state == XmCOLLAPSED) CollapseCwid(cwid); else ExpandCwid(cwid); } /************************************************************************ * MoveItemCallback (Private Callback Function) ************************************************************************/ /* Create the multipliers to try the surrounding spots for cell or grid mode */ static int x_deltas[] = { 0, -1, 0, 1, -1, 1, -1, 0, 1}; static int y_deltas[] = { 0, -1, -1, -1, 0, 0, 1, 1, 1}; static void MoveItemCallback( Widget wid, XtPointer client_data, XtPointer call_data) { XmContainerWidget cw = (XmContainerWidget)wid; XPoint * dropspot = (XPoint *)client_data; XmSelectionCallbackStruct * cs = (XmSelectionCallbackStruct *)call_data; XmContainerConstraint c; unsigned char save_include_model = XmCLOSEST; Widget cwid = cw->container.druggee; XmDestinationCallbackStruct * ds = _XmTransferGetDestinationCBStruct(cs->transfer_id); XPoint *offset = (XPoint *) cs -> value; if (cwid == NULL) return; c = GetContainerConstraint(cwid); /* Offset the dropspot by the returned data */ dropspot->x -= offset->x; dropspot->y -= offset->y; if (((XmContainerWidgetClass) XtClass(wid))->container_class.test_fit_item ) { XmSpatialTestFitProc test_item; Boolean status; test_item = (XmSpatialTestFitProc) ((XmContainerWidgetClass) XtClass(wid)) ->container_class.test_fit_item; if (CtrSpatialStyleIsGRID(wid) || CtrSpatialStyleIsCELLS(wid)) { int pos; int dw, dh; int trial_x = 0, trial_y =0 ; if (CtrViewIsLARGE_ICON(wid) || CtrViewIsANY_ICON(wid)) { dw = cw -> container.real_large_cellw; dh = cw -> container.real_large_cellh; } else { dw = cw -> container.real_small_cellw; dh = cw -> container.real_small_cellh; } /* Try all the array positions until one is found. Start at the center and work around left to right, top to bottom */ status = False; for(pos = 0; pos < 9; pos++) { trial_x = dropspot->x + x_deltas[pos] * dw; trial_y = dropspot->y + y_deltas[pos] * dh; status = test_item(wid, cwid, trial_x, trial_y); if (status) break; } if (status && pos < 9) { dropspot->x = trial_x; dropspot->y = trial_y; } } else { /* Just try the direct spot */ status = test_item(wid,cwid,dropspot->x,dropspot->y); } if (! status) { XmTransferDone(cs->transfer_id,XmTRANSFER_DONE_FAIL); return; } } if (((XmContainerWidgetClass) XtClass(wid))->container_class.remove_item) (*((XmContainerWidgetClass) XtClass(wid))->container_class.remove_item) (wid,cwid); /* Clear old placement */ XClearArea(XtDisplay(wid),XtWindow(wid), cwid->core.x,cwid->core.y, cwid->core.width,cwid->core.height, True); if (CtrSpatialStyleIsGRID(cw) || CtrSpatialStyleIsCELLS(cw)) /* * Fake the include model so it pays attention to core.x & core.y */ { save_include_model = cw->container.include_model; cw->container.include_model = XmCLOSEST; } XmeConfigureObject(cwid, dropspot->x, dropspot->y, cwid->core.width, cwid->core.height, cwid->core.border_width); c->user_x = dropspot->x; c->user_y = dropspot->y; if (((XmContainerWidgetClass) XtClass(wid))->container_class.place_item) (*((XmContainerWidgetClass) XtClass(wid))->container_class.place_item) (wid,cwid,FORCE); if (CtrSpatialStyleIsGRID(cw) || CtrSpatialStyleIsCELLS(cw)) cw->container.include_model = save_include_model; /* If we've gotten down here, and we came from the same widget, and we've succeeded, so cancel the drop effect, moving is enough (and faster) */ if (ds -> flags & XmCONVERTING_SAME) XmTransferValue(cs->transfer_id, XInternAtom(XtDisplay(wid), XmS_MOTIF_CANCEL_DROP_EFFECT, False), (XtCallbackProc)NULL,NULL, XtLastTimestampProcessed(XtDisplay(wid))); } /************************************************************************ * DropDoneCallback (Private Callback Function) ************************************************************************/ /*ARGSUSED*/ static void DropDoneCallback( Widget wid, /* unused */ XtPointer client_data, XtPointer call_data) /* unused */ { XmContainerWidget cw = (XmContainerWidget)client_data; cw->container.drag_context = (Widget) NULL; } /************************************************************************ * * * EnterHandler - If there is a drag timeout, remove it. * * * ************************************************************************/ /*ARGSUSED*/ static void EnterHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch) { XmContainerWidget cw = (XmContainerWidget)wid; cw->container.LeaveDir = 0; if (cw->container.scroll_proc_id) { XtRemoveTimeOut(cw->container.scroll_proc_id); cw->container.scroll_proc_id = 0; } } /************************************************************************ * * * LeaveHandler - If the user leaves in Marquee Select mode set up a * * timer to scroll the container. * * * ************************************************************************/ /*ARGSUSED*/ static void LeaveHandler( Widget wid, XtPointer closure, XEvent *event, Boolean *continue_to_dispatch) { XmContainerWidget cw = (XmContainerWidget)wid; Widget clip = XtParent(wid); int rx, ry; /* event coords relative to the clip */ int interval = 200; if (!cw->container.selecting || CtrPolicyIsSINGLE(cw)) return; /* first lets see which direction we left the window */ cw->container.LeaveDir = 0; rx = event->xcrossing.x + (int)wid->core.x; ry = event->xcrossing.y + (int)wid->core.y; if (rx <= (int)clip->core.x) cw->container.LeaveDir |= LEFTLEAVE; else if (rx >= (int)clip->core.width) cw->container.LeaveDir |= RIGHTLEAVE; if (ry <= (int)clip->core.y) cw->container.LeaveDir |= TOPLEAVE; else if (ry >= (int)clip->core.height) cw->container.LeaveDir |= BOTTOMLEAVE; /* then add a TimeOutProc to handle the auto scroll */ cw->container.scroll_proc_id = XtAppAddTimeOut(XtWidgetToApplicationContext(wid), (unsigned long) interval, ScrollProc, (XtPointer) cw); } /************************************************************************ * * * ScrollProc - timer proc that scrolls the container if the user has * * left the window with the button down. If the button has * * been released, call the standard click stuff. * * * ************************************************************************/ /*ARGSUSED*/ static void ScrollProc( XtPointer closure, XtIntervalId *id) { Widget wid = (Widget) closure; XmContainerWidget cw = (XmContainerWidget)closure; Widget sf; XmScrollFrameTrait scrollFrameTrait; XmNavigatorTrait navigatorTrait; XmNavigatorDataRec nav_data; Cardinal i, num_nav_list; Widget *nav; int interval = 100; XEvent event; Boolean selection_changes; if (cw->container.scroll_proc_id == 0) return; cw->container.scroll_proc_id = 0; /* since we've got reparented by the clip the scrollFrame is 2 levels up */ sf = XtParent(XtParent((Widget)cw)); scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer)XtClass(sf), XmQTscrollFrame); if (!(scrollFrameTrait && (scrollFrameTrait->getInfo(sf,NULL,&nav,&num_nav_list)))) return; /* this should never happen */ for (i=0; i < num_nav_list; i++, nav++) { navigatorTrait = (XmNavigatorTrait) XmeTraitGet((XtPointer)XtClass(*nav), XmQTnavigator); /* get the current position */ nav_data.valueMask = NavValue | NavIncrement | NavMinimum | NavMaximum | NavSliderSize; bzero(&nav_data,sizeof(XmNavigatorDataRec)); navigatorTrait->getValue(*nav, &nav_data); /* compute the new position */ if (cw->container.LeaveDir & BOTTOMLEAVE) nav_data.value.y += nav_data.increment.y; else if (cw->container.LeaveDir & TOPLEAVE) nav_data.value.y -= nav_data.increment.y; if (cw->container.LeaveDir & LEFTLEAVE) nav_data.value.x -= nav_data.increment.x; else if (cw->container.LeaveDir & RIGHTLEAVE) nav_data.value.x += nav_data.increment.x; if (nav_data.value.y < nav_data.minimum.y) nav_data.value.y = nav_data.minimum.y; if (nav_data.value.y > (nav_data.maximum.y - nav_data.slider_size.y)) nav_data.value.y = nav_data.maximum.y - nav_data.slider_size.y; if (nav_data.value.x < nav_data.minimum.x) nav_data.value.x = nav_data.minimum.x; if (nav_data.value.x > (nav_data.maximum.x - nav_data.slider_size.x)) nav_data.value.x = nav_data.maximum.x - nav_data.slider_size.x; /* and set it */ nav_data.valueMask = NavValue; navigatorTrait->setValue(*nav, &nav_data, True); } /* fake a button event using the last event coordinates */ event.xbutton.x = cw->container.last_xmotion_x - (int)wid->core.x; event.xbutton.y = cw->container.last_xmotion_y - (int)wid->core.y; selection_changes = ProcessButtonMotion(wid, &event, NULL, 0); cw->container.no_auto_sel_changes |= selection_changes; if (CtrIsAUTO_SELECT(cw) && selection_changes) CallSelectCB(wid, NULL, XmAUTO_MOTION); /* reset timer proc */ cw->container.scroll_proc_id = XtAppAddTimeOut(XtWidgetToApplicationContext(wid), (unsigned long) interval, ScrollProc, (XtPointer) cw); } /************************************************************************ * XmContainerCut (Public Function) ************************************************************************/ Boolean XmContainerCut( Widget wid, Time timestamp) { XmContainerWidget cw = (XmContainerWidget)wid; Boolean status; _XmWidgetToAppContext(wid); _XmAppLock(app); if (cw->container.selected_item_count == 0) { _XmAppUnlock(app); return(False); } if (!cw->container.have_primary) { _XmAppUnlock(app); return(False); } status = XmeClipboardSource(wid,XmMOVE,timestamp); _XmAppUnlock(app); return(status); } /************************************************************************ * XmContainerCopy (Public Function) ************************************************************************/ Boolean XmContainerCopy( Widget wid, Time timestamp) { XmContainerWidget cw = (XmContainerWidget)wid; Boolean status; _XmWidgetToAppContext(wid); _XmAppLock(app); if (cw->container.selected_item_count == 0) { _XmAppUnlock(app); return(False); } if (!cw->container.have_primary) { _XmAppUnlock(app); return(False); } status = XmeClipboardSource(wid,XmCOPY,timestamp); _XmAppUnlock(app); return(status); } /************************************************************************ * XmContainerPaste (Public Function) ************************************************************************/ Boolean XmContainerPaste( Widget wid) { return(XmeClipboardSink(wid,XmCOPY,NULL)); } /************************************************************************ * XmContainerCopyLink (Public Function) ************************************************************************/ Boolean XmContainerCopyLink( Widget wid, Time timestamp) { XmContainerWidget cw = (XmContainerWidget)wid; Boolean status; _XmWidgetToAppContext(wid); _XmAppLock(app); if (cw->container.selected_item_count == 0) { _XmAppUnlock(app); return(False); } if (!cw->container.have_primary) { _XmAppUnlock(app); return(False); } status = XmeClipboardSource(wid,XmLINK,timestamp); _XmAppUnlock(app); return(status); } /************************************************************************ * XmContainerPasteLink (Public Function) ************************************************************************/ Boolean XmContainerPasteLink( Widget wid) { return(XmeClipboardSink(wid,XmLINK,NULL)); } /************************************************************************ * XmContainerGetItemChildren (Public Function) ************************************************************************/ int XmContainerGetItemChildren( Widget wid, Widget item, WidgetList *item_children) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c; CwidNode node; CwidNode first_child_node; WidgetList clist; int i,clist_count; _XmWidgetToAppContext(wid); _XmAppLock(app); if (item == NULL) { if (cw->container.first_node == NULL) { _XmAppUnlock(app); return(0); } first_child_node = cw->container.first_node; } else { if (XtParent(item) != wid) { _XmAppUnlock(app); return(0); } c = GetContainerConstraint(item); node = c->node_ptr; if (node->child_ptr == NULL) { _XmAppUnlock(app); return(0); } first_child_node = node->child_ptr; } clist_count = 1; node = first_child_node; while (node->next_ptr) { clist_count++; node = node->next_ptr; } clist = (WidgetList)XtMalloc(clist_count * sizeof(Widget)); node = first_child_node; for (i = 0; i < clist_count; i++) { clist[i] = node->widget_ptr; node = node->next_ptr; } *item_children = clist; _XmAppUnlock(app); return(clist_count); } /************************************************************************ * XmContainerRelayout (Public Function) ************************************************************************/ void XmContainerRelayout( Widget wid) { XmContainerWidget cw = (XmContainerWidget)wid; _XmWidgetToAppContext(wid); if (!XtIsRealized(wid)) /* Don't need to relayout, will be right anyway */ return; _XmAppLock(app); if (CtrLayoutIsOUTLINE_DETAIL(cw)) { _XmAppUnlock(app); return; } if (CtrSpatialStyleIsNONE(cw)) { _XmAppUnlock(app); return; } if (!((XmContainerWidgetClass)XtClass(wid))->container_class.place_item) { _XmAppUnlock(app); return; } /* Reset grid/cell information */ (*((XmContainerWidgetClass)XtClass(wid))->container_class.place_item) (wid,NULL,ANY_FIT); /* Relayout - no geometry changes */ LayoutSpatial(wid,False,NULL); if (XtIsRealized(wid)) XClearArea(XtDisplay(wid),XtWindow(wid),0,0,0,0,True); _XmAppUnlock(app); } /************************************************************************ * XmContainerReorder (Public Function) ************************************************************************/ void XmContainerReorder( Widget wid, WidgetList cwid_list, int cwid_count) { XmContainerWidget cw = (XmContainerWidget)wid; XmContainerConstraint c; Widget pcwid; int * pi_list; int i, pi_count; _XmWidgetToAppContext(wid); if (cwid_count <= 1) return; _XmAppLock(app); c = GetContainerConstraint(cwid_list[0]); pcwid = c->entry_parent; pi_list = (int *)XtMalloc(cwid_count * sizeof(int)); pi_count = 0; for (i=0; i < cwid_count; i++) { c = GetContainerConstraint(cwid_list[i]); if (c->entry_parent == pcwid) { pi_list[pi_count] = c->position_index; pi_count++; } } qsort(pi_list,pi_count,sizeof(int),CompareInts); pi_count = 0; for (i=0; i < cwid_count; i++) { c = GetContainerConstraint(cwid_list[i]); if (c->entry_parent == pcwid) { c->position_index = pi_list[pi_count]; pi_count++; SeverNode(c->node_ptr); ContainerResequenceNodes(cw, c->entry_parent); InsertNode(c->node_ptr); } } XtFree((char*)pi_list); /* * Outline & Detail Layouts must always remain in order. */ if (CtrLayoutIsOUTLINE_DETAIL(cw)) Layout(wid); /* * Outline lines may have changed location, erase the old ones. */ if (CtrDrawLinesOUTLINE(cw) && XtIsRealized((Widget)cw)) XClearArea(XtDisplay(wid),XtWindow(wid),0,0,0,0,True); _XmAppUnlock(app); } /************************************************************************ * XmCreateContainer (Public Function) ************************************************************************/ Widget XmCreateContainer( Widget parent, String name, ArgList arglist, Cardinal argcount) { /* * Create an instance of a container and return the widget id. */ return(XtCreateWidget(name,xmContainerWidgetClass,parent,arglist,argcount)); } Widget XmVaCreateContainer( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmContainerWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedContainer( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmContainerWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/RowColumn.h0000644000175000017500000000711613145162623013023 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmRowColumn_h #define _XmRowColumn_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmRowColumnWidgetClass; typedef struct _XmRowColumnClassRec * XmRowColumnWidgetClass; typedef struct _XmRowColumnRec * XmRowColumnWidget; #ifndef XmIsRowColumn #define XmIsRowColumn(w) XtIsSubclass((w),xmRowColumnWidgetClass) #endif /******** Public Function Declarations ********/ extern void XmMenuPosition( Widget p, XButtonPressedEvent *event) ; extern Widget XmCreateRowColumn( Widget p, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateWorkArea( Widget p, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateRadioBox( Widget p, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreateOptionMenu( Widget p, char *name, ArgList al, Cardinal ac) ; extern Widget XmOptionLabelGadget( Widget m) ; extern Widget XmOptionButtonGadget( Widget m) ; extern Widget XmCreateMenuBar( Widget p, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreatePopupMenu( Widget p, char *name, ArgList al, Cardinal ac) ; extern Widget XmCreatePulldownMenu( Widget p, char *name, ArgList al, Cardinal ac) ; extern Widget XmGetPostedFromWidget( Widget menu) ; extern Widget XmGetTearOffControl( Widget menu) ; extern void XmAddToPostFromList( Widget m, Widget widget ); extern void XmRemoveFromPostFromList( Widget m, Widget widget ); /* * Variable argument list functions */ extern Widget XmVaCreateRowColumn( Widget parent, char *name, ...); extern Widget XmVaCreateManagedRowColumn( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRowColumn_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/GMUtils.c0000644000175000017500000004071213145162623012414 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: GMUtils.c /main/11 1995/09/19 23:03:32 cde-sun $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /******************************************************************* * This file contains the common geometry management set of routines * for both pure BulletinBoard (not subclasses) and DrawingArea. ****************/ #include "XmI.h" #include "GMUtilsI.h" #include /******** Static Function Declarations ********/ /******** End Static Function Declarations ********/ /******************************************************************* * Figure out how much size we need. Shrink wrap around the children. ****************/ void _XmGMCalcSize(XmManagerWidget manager, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ Dimension *replyWidth, Dimension *replyHeight ) { register int i ; register Widget child ; int right, bottom ; *replyWidth = *replyHeight = 0 ; for (i = 0; i < manager->composite.num_children; i++) { child = manager->composite.children[i]; if (XtIsManaged (child)) { right = XtX(child) + 2*XtBorderWidth(child) + XtWidth(child) ; bottom = XtY(child) + 2*XtBorderWidth(child) + XtHeight(child) ; if (right > (int) *replyWidth) *replyWidth = right ; if (bottom > (int) *replyHeight) *replyHeight = bottom ; } } *replyWidth += margin_width + MGR_ShadowThickness(manager); *replyHeight += margin_height + MGR_ShadowThickness(manager); if (!(*replyWidth)) *replyWidth = 10; if (!(*replyHeight)) *replyHeight = 10; } /**************************************************************** * Calculate the size needed for the Manager * Request a change in size from parent if needed. ****************/ Boolean _XmGMDoLayout(XmManagerWidget manager, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ int resize_policy, #if NeedWidePrototypes int queryonly #else Boolean queryonly #endif /* NeedWidePrototypes */ ) { /* return: True means that the layout is accepted, either with no request to the parent, or with a successfull serie of requests. No means that the layout is denied, without request (NONE policy for instance) or with request (parent does not accept the change in size or proposes something unacceptable). Note that when the parent returns almost, since this function returns either true or false (see below), we don't handle almost reply to the instigator. The queryonly flag just controls the "reality" of the parent request and the call to resize. */ XtWidgetGeometry request ; XtWidgetGeometry reply ; XtWidgetProc resize; request.request_mode = CWWidth|CWHeight ; if (queryonly) request.request_mode |= XtCWQueryOnly ; _XmGMCalcSize(manager, margin_width, margin_height, &request.width, &request.height); /* no change, just accept it */ if ((XtWidth(manager) == request.width) && (XtHeight(manager) == request.height)) return (True); /* the current manager sizes are bigger than the new ones and we don't want to strink, just accept the layout as is, since it already fits */ if ((resize_policy == XmRESIZE_GROW || resize_policy == XmRESIZE_NONE) && ((XtWidth(manager) >= request.width) && (XtHeight(manager) >= request.height)) ) return (True); /* the previous test passes over, so one of the needed sizes must be bigger than one of the current, and we can't do that with NONE */ if (resize_policy == XmRESIZE_NONE ) return (False); /* we can't shrink on one side while growing on the other, just overwrite the shrinking side */ if(resize_policy == XmRESIZE_GROW ) { if(request.width < XtWidth(manager)) request.width = XtWidth(manager) ; if(request.height < XtHeight(manager)) request.height = XtHeight(manager) ; } _XmProcessLock(); resize = XtCoreProc(manager,resize); _XmProcessUnlock(); /* now the request */ switch(XtMakeGeometryRequest((Widget)manager, &request, &reply)) { case XtGeometryYes: if (!queryonly) /* call the resize proc, since the widget set has now a Yes policy */ (*resize)((Widget)manager) ; return(True) ; case XtGeometryAlmost: /* The following behavior is based on the shrink wrapper behavior of this manager. What we have asked is the minimum. If the almost returned size is smaller than the requested one, refuse, since it will always clip something */ if ((reply.width < request.width) || (reply.height < request.height)) { return( False) ; } else { /* if almost returned a bigger size than requested, accept it since it cannot hurt the shrink wrap behavior, neither the Grow policy (requested always > current). Apply it if not queryonly. If queryonly, we don't have to re-request something, since no change is needed and we already know it's OK */ if (!queryonly) { (void) XtMakeResizeRequest((Widget)manager, reply.width, reply.height, NULL, NULL) ; (*resize)((Widget)manager) ; } return(True) ; } case XtGeometryNo: default: break ; } return( False) ; } /* Enforce margins for children if margins are non-zero */ void _XmGMEnforceMargin(XmManagerWidget manager, #if NeedWidePrototypes int margin_width, int margin_height, int setvalue #else Dimension margin_width, Dimension margin_height, Boolean setvalue #endif /* NeedWidePrototypes */ ) { int i ; register Widget child ; register Boolean do_move ; Position newx, newy ; for(i = 0 ; i < manager->composite.num_children ; i++) { do_move = False ; child = (Widget) manager->composite.children[i] ; if(XtIsManaged (child)) { if ((margin_width != 0) && (XtX(child) < (int) margin_width )) { do_move = True ; newx = margin_width ; } else newx = XtX(child) ; if ((margin_height != 0) && (XtY(child) < (int) margin_height )) { do_move = True ; newy = margin_height ; } else newy = XtY(child) ; if(do_move) { if (setvalue) { Arg args[2] ; XtSetArg(args[0], XmNx, newx); XtSetArg(args[1], XmNy, newy); XtSetValues(child, args, 2); } else XmeConfigureObject(child, newx, newy, child->core.width, child->core.height, child->core.border_width); } } } } /**************************************************************** * Handle query geometry requests for both BB and DA. ****************/ XtGeometryResult _XmGMHandleQueryGeometry(Widget widget, XtWidgetGeometry * intended, XtWidgetGeometry * desired, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ int resize_policy) { Dimension width, height ; /* first determine what is the desired size, using the resize_policy. */ if (resize_policy == XmRESIZE_NONE) { desired->width = XtWidth(widget) ; desired->height = XtHeight(widget) ; } else { if (GMode( intended) & CWWidth) width = intended->width; if (GMode( intended) & CWHeight) height = intended->height; _XmGMCalcSize ((XmManagerWidget)widget, margin_width, margin_height, &width, &height); if ((resize_policy == XmRESIZE_GROW) && ((width < XtWidth(widget)) || (height < XtHeight(widget)))) { desired->width = XtWidth(widget) ; desired->height = XtHeight(widget) ; } else { desired->width = width ; desired->height = height ; } } /* deal with user initial size setting */ if (!XtIsRealized(widget)) { if (XtWidth(widget) != 0) desired->width = XtWidth(widget) ; if (XtHeight(widget) != 0) desired->height = XtHeight(widget) ; } return XmeReplyToQueryGeometry(widget, intended, desired) ; } /**************************************************************** * * XmeReplyToQueryGeometry. * * This is the generic handling of Almost, No and Yes replies * based on the intended values and the given desirs. * * This can be used by any widget that really only care about is * width and height dimension. It just has to compute its desired size * using its own private layout routine and resources before calling * this one that will deal with the Xt reply value cuisine. * ****************/ XtGeometryResult XmeReplyToQueryGeometry(Widget widget, XtWidgetGeometry * intended, XtWidgetGeometry * desired) { _XmWidgetToAppContext(widget); /* the caller should have set desired width and height*/ desired->request_mode = (CWWidth | CWHeight) ; /* Accept any x, y, border and stacking. If the proposed geometry matches the desired one, and the parent intends to use these values (flags are set in intended), return Yes. Otherwise, the parent intends to use values for width and height that differ from the desired size, return No if the desired is the current and Almost if the desired size is different from the current size */ if ((IsWidth(intended)) && (intended->width == desired->width) && (IsHeight(intended)) && (intended->height == desired->height)) { return XtGeometryYes ; } _XmAppLock(app); if ((desired->width == XtWidth(widget)) && (desired->height == XtHeight(widget))) { _XmAppUnlock(app); return XtGeometryNo ; } _XmAppUnlock(app); return XtGeometryAlmost ; } /**************** * Return True if w intersects with any other siblins. ****************/ Boolean _XmGMOverlap(XmManagerWidget manager, Widget w) { register int i ; Position left1 = XtX(w) ; Position top1 = XtY(w) ; Dimension right1 = XtX(w) + 2*XtBorderWidth(w) + XtWidth(w) ; Dimension bottom1 = XtY(w) + 2*XtBorderWidth(w) + XtHeight(w); /****************/ for(i=0 ; icomposite.num_children ; i++) { Widget kid = manager->composite.children[i] ; Position left2 = XtX(kid) ; Position top2 = XtY(kid) ; Dimension right2 = XtX(kid) + 2*XtBorderWidth(kid) + XtWidth(kid); Dimension bottom2 = XtY(kid) + 2*XtBorderWidth(kid) + XtHeight(kid) ; if(w != kid && (((left1 >= left2) && ((Dimension)left1 <= right2)) || ((left2 >= left1) && ((Dimension)left2 <= right1))) && (((top1 >= top2) && ((Dimension)top1 <= bottom2)) || ((top2 >= top1) && ((Dimension)top2 <= bottom1))) ) { return( True) ; } } return( False) ; } /**************** * Handle geometry requests from children. ****************/ XtGeometryResult _XmGMHandleGeometryManager(Widget parent, Widget w, XtWidgetGeometry * request, XtWidgetGeometry * reply, #if NeedWidePrototypes int margin_width, int margin_height, #else Dimension margin_width, Dimension margin_height, #endif /* NeedWidePrototypes */ int resize_policy, int allow_overlap) { /* Policy: Yes if margin is non null requests inside the margin or negative are a priori almosted (or denied if the resizepolicy does not authorize it). That's the only case where almost is returned, no management of a limit position or size is done */ XtWidgetGeometry localReply ; Dimension width, height, borderWidth ; Position x, y ; XtGeometryResult returnCode = XtGeometryNo ; Boolean geoFlag = False, queryonly = False ; XmManagerWidget manager = (XmManagerWidget) parent ; localReply = *request ; localReply.request_mode = CWX|CWY|CWWidth|CWHeight|CWBorderWidth ; if(!IsX(request)) localReply.x = XtX(w) ; if(!IsY(request)) localReply.y = XtY(w) ; if(!IsWidth(request)) localReply.width = XtWidth(w) ; if(!IsHeight(request)) localReply.height = XtHeight(w) ; if(!IsBorder(request)) localReply.border_width = XtBorderWidth(w) ; /* check for x less than margin width */ if(IsX(request) && (margin_width != 0) && (request->x < (int)margin_width)) { localReply.x = (Position) margin_width ; returnCode = XtGeometryAlmost ; } /* check for y less than margin height */ if(IsY(request) && (margin_height != 0) && (request->y < (int)margin_height)) { localReply.y = (Position) margin_height ; returnCode = XtGeometryAlmost ; } /* Save current size and set to new size */ x = XtX(w) ; y = XtY(w) ; width = XtWidth(w) ; height = XtHeight(w) ; borderWidth = XtBorderWidth(w) ; XtX(w) = localReply.x ; XtY(w) = localReply.y ; XtWidth(w) = localReply.width ; XtHeight(w) = localReply.height ; XtBorderWidth(w) = localReply.border_width ; if(!allow_overlap && _XmGMOverlap (manager, w)) { returnCode = XtGeometryNo ; } else { /* if we already know that we are not gonna change anything */ if ((returnCode == XtGeometryAlmost) || IsQueryOnly(request)) queryonly = True ; /* see if the new layout is OK */ geoFlag = _XmGMDoLayout(manager, margin_width, margin_height, resize_policy, queryonly) ; /* if we cannot adapt the new size but the child is still inside go for it */ if(!geoFlag && ((localReply.x + localReply.width + (localReply.border_width << 1)) <= (XtWidth(manager) - margin_width)) && ((localReply.y + localReply.height + (localReply.border_width << 1)) <= (XtHeight(manager) - margin_height))) geoFlag = True ; if (geoFlag) { if (returnCode != XtGeometryAlmost) returnCode = XtGeometryYes ; } else returnCode = XtGeometryNo ; if (returnCode == XtGeometryAlmost){ if (reply) *reply = localReply ; else returnCode = XtGeometryNo ; } } if ((returnCode != XtGeometryYes) || queryonly) { /* Can't oblige, so restore previous values. */ XtX(w) = x ; XtY(w) = y ; XtWidth(w) = width ; XtHeight(w) = height ; XtBorderWidth(w) = borderWidth ; } return returnCode ; } motif-2.3.8/lib/Xm/TraversalI.c0000644000175000017500000021044313145162623013144 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: TraversalI.c /main/13 1997/10/13 11:28:33 cshi $" #endif #endif #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include #include #include #include #include /* for memmove() */ #include "ScrolledWI.h" #include "TravActI.h" #include "TraversalI.h" #include "XmI.h" #define FIX_1272 #define XmTRAV_LIST_ALLOC_INCREMENT 16 #define XmTAB_LIST_ALLOC_INCREMENT 8 #define STACK_SORT_LIMIT 128 /* Type of sort comparison function. */ typedef int (*Comparator)(XmConst void *, XmConst void *); /******** Static Function Declarations ********/ static Boolean NodeIsTraversable(XmTraversalNode node); static XmTraversalNode TraverseControl(XmTraversalNode cur_node, XmTraversalDirection action); static XmTraversalNode NextControl(XmTraversalNode ctl_node); static XmTraversalNode PrevControl(XmTraversalNode ctl_node); static Boolean InitializeCurrent(XmTravGraph list, Widget wid, Boolean renew_list_if_needed); static XmTraversalNode GetNextNearestNode(XmGraphNode graph, XRectangle *rect, XmDirection layout); static XmTraversalNode TraverseTab(XmTraversalNode cur_node, XmTraversalDirection action); static XmTraversalNode AllocListEntry(XmTravGraph list); static Boolean GetChildList(Widget composite, Widget **widget_list, Cardinal *num_in_list); static void GetNodeList(Widget wid, XRectangle *parent_rect, XmTravGraph trav_list, int tab_parent, int control_parent); static XmTraversalNode GetNodeFromGraph(XmGraphNode graph, Widget wid); static XmTraversalNode GetNodeOfWidget(XmTravGraph trav_list, Widget wid); static void LinkNodeList(XmTravGraph list); static Boolean NodesOverlap(XmTraversalNode nodeA, XmTraversalNode nodeB, Boolean horizontal); static void TruncateRow(XmTraversalRow *row, Cardinal length, XmTraversalNode *free_list, Cardinal *first_free, Cardinal max_free, Boolean horizontal, XmDirection layout); static void AppendToRow(XmTraversalNode item, XmTraversalRow *row, Boolean horizontal, XmDirection layout); static Boolean NodeDominates(XmTraversalNode node_1, XmTraversalNode node_2, Boolean horizontal, XmDirection layout); static void Sort(XmTraversalNode *nodes, size_t n_mem, Boolean horizontal, XmDirection layout); static int CompareExclusive(XmConst void *A, XmConst void *B); static Comparator HorizNodeComparator(XmDirection layout); static int CompareNodesHorizLT(XmConst void *A, XmConst void *B); static int CompareNodesHorizRT(XmConst void *A, XmConst void *B); static int CompareNodesHorizLB(XmConst void *A, XmConst void *B); static int CompareNodesHorizRB(XmConst void *A, XmConst void *B); static Comparator VertNodeComparator(XmDirection layout); static int CompareNodesVertLT(XmConst void *A, XmConst void *B); static int CompareNodesVertRT(XmConst void *A, XmConst void *B); static int CompareNodesVertLB(XmConst void *A, XmConst void *B); static int CompareNodesVertRB(XmConst void *A, XmConst void *B); static void SortTabGraph(XmGraphNode graph, Boolean exclusive, XmDirection layout); static void SortControlGraph(XmGraphNode graph, Boolean exclusive, XmDirection layout); static void SortNodeList(XmTravGraph trav_list); static Boolean SetInitialNode(XmGraphNode graph, XmTraversalNode init_node); static void SetInitialWidgets(XmTravGraph trav_list); static void GetRectRelativeToShell(Widget wid, XRectangle *rect); static int SearchTabList(XmTravGraph graph, Widget wid); static void DeleteFromTabList(XmTravGraph graph, int indx); static Boolean LastControl(Widget w, XmTraversalDirection dir, XmTravGraph graph); static XmTraversalDirection LocalDirection(Widget w, XmTraversalDirection direction); /******** End Static Function Declarations ********/ #ifdef DEBUG_TRAVERSAL static void PrintControl(XmTraversalNode node); static void PrintTab(XmTraversalNode node); static void PrintGraph(XmTraversalNode node); static void PrintNodeList(XmTravGraph list); #endif /* DEBUG_TRAVERSAL */ static XmTravGraph SortReferenceGraph; XmNavigability _XmGetNavigability(Widget wid) { if (XtIsRectObj(wid) && !wid->core.being_destroyed) { XmBaseClassExt *er; if ((er = _XmGetBaseClassExtPtr(XtClass(wid), XmQmotif)) && (*er) && ((*er)->version >= XmBaseClassExtVersion) && (*er)->widgetNavigable) { return (*((*er)->widgetNavigable))(wid); } else { /* From here on is compatibility code. */ WidgetClass wc; if (XmIsPrimitive(wid)) wc = (WidgetClass) &xmPrimitiveClassRec; else if (XmIsGadget(wid)) wc = (WidgetClass) &xmGadgetClassRec; else if (XmIsManager(wid)) wc = (WidgetClass) &xmManagerClassRec; else wc = NULL; if (wc && (er = _XmGetBaseClassExtPtr(wc, XmQmotif)) && (*er) && ((*er)->version >= XmBaseClassExtVersion) && (*er)->widgetNavigable) { return (*((*er)->widgetNavigable))(wid); } } } return XmNOT_NAVIGABLE; } Boolean _XmIsViewable(Widget wid) { /* This routine returns TRUE is the widget is realized, managed * and, for window objects, mapped; returns FALSE otherwise. * A realized RowColumn with a MenuShell parent is always considered * viewable. */ XWindowAttributes xwa; if (!wid->core.being_destroyed && XtIsRealized(wid)) { /* Treat menupanes specially. */ if (XmIsRowColumn(wid) && XmIsMenuShell(XtParent(wid))) return TRUE; if (XtIsManaged(wid)) { /* CR 5593: Trust mapped_when_managed even though the spec */ /* hasn't yet been updated to allow it. */ if (XmIsGadget(wid) || wid->core.mapped_when_managed) return TRUE; /* Managed, but not necessarily mapped. */ XGetWindowAttributes(XtDisplay(wid), XtWindow(wid), &xwa); if (xwa.map_state == IsViewable) return TRUE; } } return FALSE; } Widget _XmIsScrollableClipWidget(Widget child, Boolean scrollable, XRectangle *visRect) { Widget wid = XtParent(child); XmScrolledWindowWidget sw; if (wid && XmIsClipWindow(wid) && ((sw = (XmScrolledWindowWidget) XtParent(wid)) != NULL) && XmIsScrolledWindow(sw) && ((Widget) sw->swindow.ClipWindow == wid) && (!scrollable || sw->swindow.traverseObscuredCallback)) { if (visRect) { if (!child || !_XmSWGetClipArea(child, visRect)) _XmSetRect(visRect, wid); } return (Widget)sw; } return NULL; } Boolean _XmGetEffectiveView(Widget wid, XRectangle *visRect) { /* This function will generate a rectangle describing the portion of the * specified widget or its scrolling area (for non-null * XmNtraverseObscuredCallback) which is not clipped by any of its * ancestors. It also verifies that the ancestors are viewable. * * It will return TRUE if the visibility rectangle returned in visRect * has a non-zero area, FALSE if the visibility area is zero or one * of its ancestors is not viewable. */ Widget prev; XRectangle tmpRect, widRect; Boolean acceptClipping = TRUE; if (!_XmIsViewable(wid)) { _XmClearRect(visRect); return FALSE; } _XmSetRect(visRect, wid); /* Process all widgets, excluding the shell widget */ for (prev = wid; ((wid = XtParent(wid)) != NULL) && !XtIsShell(wid); prev = wid) { if (!_XmIsViewable(wid)) { _XmClearRect(visRect); return FALSE; } if (_XmIsScrollableClipWidget(prev, True, visRect)) { /* This wid is the clip window for a Scrolled Window. */ acceptClipping = FALSE; } else { /* CR 9705: Special case overlapping work windows. */ if (!_XmIsScrollableClipWidget(prev, False, &widRect)) _XmSetRect(&widRect, wid); if (acceptClipping) { if (!_XmIntersectionOf(visRect, &widRect, visRect)) return FALSE; } else { if (!_XmIntersectionOf(visRect, &widRect, &tmpRect) || (visRect->width != tmpRect.width) || (visRect->height != tmpRect.height)) { _XmClearRect(visRect); return FALSE; } } } } return TRUE; } Boolean _XmIntersectionOf(register XRectangle *srcRectA, register XRectangle *srcRectB, register XRectangle *destRect) { /* Returns TRUE if there is a non-zero area at the intersection of the * two source rectangles, FALSE otherwise. The destRect receives * the rectangle of intersection (is cleared if no intersection). */ int srcABot, srcBBot; int srcARight, srcBRight; int newHeight, newWidth; srcABot = srcRectA->y + srcRectA->height - 1; srcBBot = srcRectB->y + srcRectB->height - 1; srcARight = srcRectA->x + srcRectA->width - 1; srcBRight = srcRectB->x + srcRectB->width - 1; if (srcRectA->x >= srcRectB->x) destRect->x = srcRectA->x; else destRect->x = srcRectB->x; if (srcRectA->y > srcRectB->y) destRect->y = srcRectA->y; else destRect->y = srcRectB->y; if (srcARight >= srcBRight) { newWidth = srcBRight - destRect->x + 1; destRect->width = (newWidth > 0) ? newWidth : 0; } else { newWidth = srcARight - destRect->x + 1; destRect->width = (newWidth > 0) ? newWidth : 0; } if (srcABot > srcBBot) { newHeight = srcBBot - destRect->y + 1; destRect->height = (newHeight > 0) ? newHeight : 0; } else { newHeight = srcABot - destRect->y + 1; destRect->height = (newHeight > 0) ? newHeight : 0; } return (destRect->width && destRect->height); } XmNavigationType _XmGetNavigationType(Widget widget) { if (XmIsPrimitive(widget)) return ((XmPrimitiveWidget) widget)->primitive.navigation_type; else if (XmIsGadget(widget)) return ((XmGadget) widget)->gadget.navigation_type; else if (XmIsManager(widget)) return ((XmManagerWidget) widget)->manager.navigation_type; else return XmNONE; } Widget _XmGetActiveTabGroup(Widget wid) { /* Return the active tab group for the specified widget hierarchy */ XmFocusData focus_data = _XmGetFocusData(wid); if (focus_data) return focus_data->active_tab_group; else return NULL; } static Boolean NodeIsTraversable(XmTraversalNode node) { return (node && node->any.widget && (node->any.type != XmTAB_GRAPH_NODE) && (node->any.type != XmCONTROL_GRAPH_NODE) && XmIsTraversable(node->any.widget)); } static XmTraversalNode TraverseControl(XmTraversalNode cur_node, XmTraversalDirection action) { XmTraversalNode new_ctl; XmTraversalDirection local_dir = LocalDirection(cur_node->any.widget,action); XmTraversalDirection dir = local_dir; if (!cur_node) return NULL; if (cur_node->any.type == XmCONTROL_GRAPH_NODE) { cur_node = cur_node->graph.sub_head; if (!cur_node) return NULL; dir = XmTRAVERSE_HOME; } else { if (cur_node->any.type != XmCONTROL_NODE) return NULL; } new_ctl = cur_node; do { switch( dir ) { case XmTRAVERSE_NEXT: new_ctl = NextControl(new_ctl); break; case XmTRAVERSE_RIGHT: new_ctl = new_ctl->any.next; break; case XmTRAVERSE_UP: new_ctl = new_ctl->control.up; break; case XmTRAVERSE_PREV: new_ctl = PrevControl(new_ctl); break; case XmTRAVERSE_LEFT: new_ctl = new_ctl->any.prev; break; case XmTRAVERSE_DOWN: new_ctl = new_ctl->control.down; break; case XmTRAVERSE_HOME: new_ctl = new_ctl->any.tab_parent.link->sub_head; cur_node = new_ctl->any.tab_parent.link->sub_tail; /* Reset dir in case new_ctl is not traversable.*/ if (action == XmTRAVERSE_GLOBALLY_BACKWARD) { new_ctl = new_ctl->any.prev; cur_node = cur_node->any.prev; dir = local_dir; } else if (action == XmTRAVERSE_GLOBALLY_FORWARD) dir = local_dir; else dir = XmTRAVERSE_RIGHT; break; case XmTRAVERSE_CURRENT: break; default: new_ctl = NULL; break; } if ((new_ctl == NULL) || NodeIsTraversable(new_ctl)) return new_ctl; } while (new_ctl != cur_node); return NULL; } static XmTraversalNode NextControl(XmTraversalNode ctl_node) { register XmTraversalNode ptr = ctl_node; XmTraversalNode next = NULL; XmTraversalNode min = ctl_node; do { if ((ptr > ctl_node) && ((ptr < next) || (next == NULL))) next = ptr; if (ptr < min) min = ptr; ptr = ptr->any.next; } while (ptr != ctl_node); if (next == NULL) next = min; return next; } static XmTraversalNode PrevControl(XmTraversalNode ctl_node) { register XmTraversalNode ptr = ctl_node; XmTraversalNode prev = NULL; XmTraversalNode max = ctl_node; do { if ((ptr < ctl_node) && ((ptr > prev) || (prev == NULL))) prev = ptr; if (ptr > max) max = ptr; ptr = ptr->any.prev; } while (ptr != ctl_node); if (prev == NULL) prev = max; return prev; } static Boolean InitializeCurrent(XmTravGraph list, Widget wid, Boolean renew_list_if_needed) { /* Returns TRUE if the current node has been initialized * to a non-NULL value. * * This routine first tries a linear search for the first * node in the node list. If it fails to get a match, it * will do a linear search successively on each ancestor of * the widget, up to the shell. If a match continues to * be elusive, this routine sets the current node to be * head of the list, which is always a tab-graph node. * * In general, this routine will either set list->current * to the node of the widget argument, or to a tab-graph * node. The only time when the returned "current" does * not match the argument AND it is not a tab-graph node is * when an ancestor of the argument widget has navigability * of either XmCONTROL_NAVIGABLE or XmTAB_NAVIGABLE (such * as Drawing Area). */ XmTraversalNode cur_node = list->current; if (cur_node) { if (!wid || (wid == cur_node->any.widget)) return TRUE; cur_node = NULL; } if (!(cur_node = GetNodeOfWidget(list, wid))) { if (renew_list_if_needed && _XmGetNavigability(wid)) return _XmNewTravGraph(list, list->top, wid); while ((wid = XtParent(wid)) && !XtIsShell(wid) && !(cur_node = GetNodeOfWidget(list, wid))) /*EMPTY*/; } if (cur_node) list->current = cur_node; else { if (!(list->current)) list->current = list->head; } return TRUE; } Widget _XmTraverseAway(XmTravGraph list, Widget wid, #if NeedWidePrototypes int wid_is_control) #else Boolean wid_is_control) #endif /* NeedWidePrototypes */ { /* This routine traverses away from the reference widget. The routine * tries to return the widget that would be the next one traversed due * to a XmTRAVERSE_RIGHT or XmTRAVERSE_NEXT_TAB_GROUP. * When the wid_is_control argument is TRUE, this routine tries to * return the next traversable control following the reference widget. */ if (!(list->num_entries)) { if (!_XmNewTravGraph(list, list->top, wid)) return NULL; } else { if (!InitializeCurrent(list, wid, TRUE)) return NULL; } if ((list->current->any.widget != wid) && (list->current->any.type == XmTAB_GRAPH_NODE)) { XmTraversalNode nearest_node; XRectangle wid_rect; if (wid_is_control) { /* A tab-graph node is always immediately followed by its * corresponding control-graph node. */ list->current = list->current + 1; } GetRectRelativeToShell(wid, &wid_rect); if ((nearest_node = GetNextNearestNode((XmGraphNode) list->current, &wid_rect, GetLayout(list->current->any.widget))) != NULL) { list->current = nearest_node; } } if ((list->current->any.widget == wid) || !NodeIsTraversable(list->current)) { XmTraversalNode rtnNode; /* If current is a control node or control graph node, try to * traverse to a control. If current is a tab node, or if the * attempted traversal to a control node fails, then traverse * to the next tab group. */ if (((list->current->any.type != XmCONTROL_NODE) && (list->current->any.type != XmCONTROL_GRAPH_NODE)) || !(rtnNode = TraverseControl(list->current, XmTRAVERSE_RIGHT))) { rtnNode = TraverseTab(list->current, XmTRAVERSE_NEXT_TAB_GROUP); } list->current = rtnNode; } if (list->current && (list->current->any.widget != wid)) return list->current->any.widget; else return NULL; } static XmTraversalNode GetNextNearestNode(XmGraphNode graph, XRectangle *rect, XmDirection layout) { XmTraversalNode node; if ((node = graph->sub_head) != NULL) { XmTraversalNode *list_ptr; unsigned idx; XmTraversalNode *node_list; XmTraversalNode storage[STACK_SORT_LIMIT]; XmTraversalNodeRec reference; unsigned num_nodes = 1; /* One node for the reference rectangle. */ /* Count the nodes in the graph. */ do { ++num_nodes; } while ((node != graph->sub_tail) && (node = node->any.next)); node_list = (XmTraversalNode*) XmStackAlloc(num_nodes * sizeof(XmTraversalNode), storage); /* Now copy nodes onto node list for sorting. */ list_ptr = node_list; reference.any.rect = *rect; /* Only the rectangle is used in sorting. */ reference.any.widget = NULL; *list_ptr++ = &reference; node = graph->sub_head; idx = 1; /* Leave one for reference node. */ do { *list_ptr++ = node; node = node->any.next; } while (++idx < num_nodes); Sort(node_list, num_nodes, True, layout); /* Now find the reference node in the sorted list. */ idx = 0; node = NULL; do { if (node_list[idx] == &reference) { /* Return node which follows the reference node in the * sorted list. */ ++idx; if (idx == num_nodes) { /* If reference node was the last in the list, then * wrap to the beginning of the list. */ idx = 0; } node = node_list[idx]; break; } } while (idx++ < num_nodes); XmStackFree((char*) node_list, storage); } return node; } Widget _XmTraverse(XmTravGraph list, XmTraversalDirection action, XmTraversalDirection *local_dir, Widget reference_wid) { XmTraversalNode rtnNode; Boolean traverse_control; /* Initialize the out parameters. */ *local_dir = action; if ((action == XmTRAVERSE_CURRENT) && reference_wid) { /* Try short-circuit evaluation for XmTRAVERSE_CURRENT (for * improved performance only; would be handled correctly below). */ XmNavigability wid_nav = _XmGetNavigability(reference_wid); if ((wid_nav == XmTAB_NAVIGABLE) || (wid_nav == XmCONTROL_NAVIGABLE)) { if (XmIsTraversable(reference_wid)) return reference_wid; else return NULL; } } if (!list->num_entries) { if (!_XmNewTravGraph(list, list->top, reference_wid)) return NULL; } else { if (!InitializeCurrent(list, reference_wid, TRUE)) return NULL; } /* After the preceding initialization, list->current either points * to the node of the reference widget (or its nearest ancestor * which is in the traversal graph) or to the beginning of the list * (if the reference widget is NULL). * * If the reference widget is a composite, then there will be two * nodes associated with it; one containing control nodes and the * other containing tab nodes (including the node containing * is associated control nodes). For a composite reference * widget, list->current will be the tab node, since it is * guaranteed to appear first in the list of nodes and will * match first in the search for the reference widget. */ if (action == XmTRAVERSE_CURRENT) { if (list->current->any.widget != reference_wid) { /* The reference widget was not found in the graph. * Finding ancestors is not good enough for XmTRAVERSE_CURRENT. */ return NULL; } if ((list->current->any.type == XmTAB_NODE) || (list->current->any.type == XmCONTROL_NODE)) { if (NodeIsTraversable(list->current)) return reference_wid; /* Since this node has no subgraph (no traversable descendents) * and is not traversable, XmTRAVERSE_CURRENT fails. */ return NULL; } } /* Are we going to traverse to a control or a tab group? */ switch (action) { case XmTRAVERSE_NEXT_TAB_GROUP: case XmTRAVERSE_PREV_TAB_GROUP: traverse_control = FALSE; break; case XmTRAVERSE_CURRENT: traverse_control = (list->current->any.type == XmCONTROL_GRAPH_NODE); break; case XmTRAVERSE_GLOBALLY_FORWARD: case XmTRAVERSE_GLOBALLY_BACKWARD: /* This test is slightly wrong: it should be something like */ /* traverse_control = !LastControl() || OnlyOneTabGroup(); */ traverse_control = !LastControl(reference_wid, action, list); if (traverse_control) *local_dir = LocalDirection(reference_wid, action); else *local_dir = (action == XmTRAVERSE_GLOBALLY_FORWARD ? XmTRAVERSE_NEXT_TAB_GROUP : XmTRAVERSE_PREV_TAB_GROUP); break; default: traverse_control = TRUE; break; } if (traverse_control) rtnNode = TraverseControl(list->current, *local_dir); else { rtnNode = TraverseTab(list->current, action); if (!rtnNode && ((action == XmTRAVERSE_GLOBALLY_FORWARD) || (action == XmTRAVERSE_GLOBALLY_BACKWARD))) { /* Tab traversal will fail if there is only one tab group, */ /* but we want to make sure global traversal succeeds. */ rtnNode = TraverseControl(list->current, action); } } if (rtnNode) { list->current = rtnNode; return rtnNode->any.widget; } else return NULL; } static XmTraversalNode TraverseTab(XmTraversalNode cur_node, XmTraversalDirection action) { /* This routine handles tab group traversal. It is assumed * that the "action" argument is not associated with traversal * among controls. * * Returns the leaf traversal node containing the widget which * would next receive the focus. */ XmTraversalNode new_tab; if (!cur_node) return NULL; if (cur_node->any.type == XmCONTROL_NODE) { /* This routine is for tab group traversal, so if current node * is a control node, reset cur_node to be its tab-group control * graph. */ cur_node = (XmTraversalNode) cur_node->any.tab_parent.link; /* A tab-graph node is the only node that might have a NULL * tab_parent, so cur_node is guaranteed to be non-NULL. */ } new_tab = cur_node; do { switch (action) { case XmTRAVERSE_GLOBALLY_FORWARD: case XmTRAVERSE_NEXT_TAB_GROUP: case XmTRAVERSE_CURRENT: default: if ((new_tab->any.type == XmTAB_GRAPH_NODE) && (new_tab->graph.sub_head)) { /* new_tab is a tab graph with a non-null subgraph; * go down into the graph to continue the search * for the next traversable node. */ new_tab = new_tab->graph.sub_head; } /* new_tab is not a tab graph with a non-null subgraph. */ else if (new_tab->any.next) { /* Try the next node at this level. */ new_tab = new_tab->any.next; } else { /* The next node is null, so move up out of this * subgraph. Keep going up until a non-null "next" * is found, but stop and fail if going up above * the cur_node if action is XmTRAVERSE_CURRENT. */ XmTraversalNode top_node = new_tab; while (((new_tab = (XmTraversalNode) new_tab->any.tab_parent.link) != NULL) && ((action != XmTRAVERSE_CURRENT) || (new_tab != cur_node)) && !(new_tab->any.next)) { top_node = new_tab; } if ((action == XmTRAVERSE_CURRENT) && (new_tab == cur_node)) return NULL; if (!new_tab) { /* Got to the top level of the traversal graph * without finding a non-null "next", so start * the cycle over; "take it from the top". */ new_tab = top_node; } else { /* We now know new_tab->any.next is non-null. */ new_tab = new_tab->any.next; } } break; case XmTRAVERSE_GLOBALLY_BACKWARD: case XmTRAVERSE_PREV_TAB_GROUP: /* Same structure as for XmTRAVERSE_NEXT_TAB_GROUP, * except the reverse direction. Also, don't have * to worry about XmTRAVERSE_CURRENT, which behaves * like XmTRAVERSE_NEXT_TAB_GROUP for a specific subgraph. */ if ((new_tab->any.type == XmTAB_GRAPH_NODE) && (new_tab->graph.sub_tail)) { new_tab = new_tab->graph.sub_tail; } else if (new_tab->any.prev) { new_tab = new_tab->any.prev; } else { XmTraversalNode top_node = new_tab; while ((new_tab = (XmTraversalNode)new_tab->any.tab_parent.link) && !(new_tab->any.prev)) { top_node = new_tab; } if (!new_tab) new_tab = top_node; else new_tab = new_tab->any.prev; } break; } if (new_tab->any.type == XmCONTROL_GRAPH_NODE) { /* While tabbing, the only way to know whether a control graph * is traversable is to attempt to traverse to it; can't depend * on the ensuing NodeIsTraversable(). */ XmTraversalNode rtnNode = TraverseControl(new_tab, action); if (rtnNode) return rtnNode; } if (new_tab == cur_node) { /* This is how we get out when there are no traversable * nodes in this traversal graph. We have traversed * the entire graph and have come back to the starting * point, so fail. */ return NULL; } } while (!NodeIsTraversable(new_tab)); return new_tab; } void _XmFreeTravGraph(XmTravGraph trav_list) { if (trav_list->num_alloc) { XtFree((char *) trav_list->head); trav_list->head = NULL; trav_list->next_alloc = trav_list->num_alloc; trav_list->num_alloc = 0; trav_list->num_entries = 0; trav_list->current = NULL; trav_list->top = NULL; } } void _XmTravGraphRemove(XmTravGraph tgraph, Widget wid) { XmTraversalNode node; if (tgraph->num_entries) { while ((node = GetNodeOfWidget(tgraph, wid)) != NULL) node->any.widget = NULL; } } void _XmTravGraphAdd(XmTravGraph tgraph, Widget wid) { if (tgraph->num_entries && !GetNodeOfWidget(tgraph, wid)) _XmFreeTravGraph(tgraph); } /*ARGSUSED*/ void _XmTravGraphUpdate(XmTravGraph tgraph, Widget wid) /* unused */ { _XmFreeTravGraph(tgraph); } Boolean _XmNewTravGraph(XmTravGraph trav_list, Widget top_wid, Widget init_current) { /* This procedure assumes that trav_list has been zeroed. * before the initial call to _XmNewTravGraph. Subsequent * calls to _XmFreeTravGraph and _XmNewTravGraph do not * require re-initialization. */ XRectangle w_rect; if (top_wid) { trav_list->top = top_wid; } else { if (!(trav_list->top)) { top_wid = init_current; while (top_wid && !XtIsShell(top_wid)) top_wid = XtParent(top_wid); trav_list->top = top_wid; } } if (!trav_list->top || trav_list->top->core.being_destroyed) { _XmFreeTravGraph(trav_list); return FALSE; } trav_list->num_entries = 0; trav_list->current = NULL; /* Traversal topography uses a coordinate system which is relative * to the shell window (avoids toolkit/window manager involvement). * Initialize x and y to cancel to zero when shell coordinates are * added in. */ w_rect.x = - (Position) (XtX(top_wid) + XtBorderWidth(top_wid)); w_rect.y = - (Position) (XtY(top_wid) + XtBorderWidth(top_wid)); w_rect.width = XtWidth(top_wid); w_rect.height = XtHeight(top_wid); GetNodeList(top_wid, &w_rect, trav_list, -1, -1); if ((trav_list->num_entries + XmTRAV_LIST_ALLOC_INCREMENT) < trav_list->num_alloc) { /* Except for the very first allocation of the traversal graph for * this shell hierarchy, the size of the initial allocation is based * on the number of nodes allocated for the preceding version of the * graph (as per the next_alloc field of the XmTravGraph). To prevent * a "grow-only" behavior in the size of the allocation, we must * routinely attempt to prune excessive memory allocation. */ trav_list->num_alloc -= XmTRAV_LIST_ALLOC_INCREMENT; trav_list->head = (XmTraversalNode) XtRealloc((char *) trav_list->head, trav_list->num_alloc * sizeof(XmTraversalNodeRec)); } LinkNodeList(trav_list); SortNodeList(trav_list); SetInitialWidgets(trav_list); InitializeCurrent(trav_list, init_current, FALSE); #ifdef DEBUG_TRAVERSAL PrintNodeList(trav_list); #endif return TRUE; } #define UnallocLastListEntry(list) (--(list->num_entries)) static XmTraversalNode AllocListEntry( XmTravGraph list) { if (!(list->num_alloc)) { /* Use next_alloc (from previous allocation of list) * as starting point for size of array. */ if (list->next_alloc) list->num_alloc = list->next_alloc; else list->num_alloc = XmTRAV_LIST_ALLOC_INCREMENT; list->head = (XmTraversalNode) XtMalloc(list->num_alloc * sizeof(XmTraversalNodeRec)); } else { if (list->num_entries == list->num_alloc) { list->num_alloc += XmTRAV_LIST_ALLOC_INCREMENT; list->head = (XmTraversalNode) XtRealloc((char *) list->head, list->num_alloc * sizeof(XmTraversalNodeRec)); } } return &(list->head[list->num_entries++]); } static Boolean GetChildList(Widget composite, Widget **widget_list, Cardinal *num_in_list) { XmManagerClassExt *mext; if (XmIsManager(composite) && (mext = (XmManagerClassExt *) _XmGetClassExtensionPtr((XmGenericClassExt *) &(((XmManagerWidgetClass) XtClass(composite)) ->manager_class.extension), NULLQUARK)) && *mext && (*mext)->traversal_children) { return (*((*mext)->traversal_children))(composite, widget_list, num_in_list); } return FALSE; } static void GetNodeList(Widget wid, XRectangle *parent_rect, XmTravGraph trav_list, int tab_parent, int control_parent) { /* This routine returns a node list of all navigable widgets in * a sub-hierarchy. The order of the list is such that the node * of widget's parent is guaranteed to precede the child widget's * node. */ /* This routine fills in the following fields of the * traversal nodes by this routine: * any.type * any.widget * any.nav_type * any.rect * any.tab_parent (initialized by offset) * graph.sub_head (set to NULL) * graph.sub_tail (set to NULL) */ XmTraversalNode list_entry; int list_entry_offset; XmNavigability node_type; if (wid->core.being_destroyed || (!(node_type = _XmGetNavigability(wid)) && !XtIsShell(wid))) return; list_entry_offset = (int) trav_list->num_entries; list_entry = AllocListEntry(trav_list); list_entry->any.widget = wid; list_entry->any.rect.x = parent_rect->x + XtX(wid) + XtBorderWidth(wid); list_entry->any.rect.y = parent_rect->y + XtY(wid) + XtBorderWidth(wid); list_entry->any.rect.width = XtWidth(wid); list_entry->any.rect.height = XtHeight(wid); /* Bootstrap: first entry must behave like a tab group. */ list_entry->any.nav_type = (list_entry_offset ? _XmGetNavigationType(wid) : XmSTICKY_TAB_GROUP); if (node_type == XmCONTROL_NAVIGABLE) { list_entry->any.type = XmCONTROL_NODE; list_entry->any.tab_parent.offset = control_parent; } else if (node_type == XmTAB_NAVIGABLE) { list_entry->any.type = XmTAB_NODE; list_entry->any.tab_parent.offset = tab_parent; } else if (((node_type == XmNOT_NAVIGABLE) && list_entry_offset) || !XtIsComposite(wid)) { UnallocLastListEntry(trav_list); } else /* XmDESCENDANTS_NAVIGABLE or XmDESCENDANTS_TAB_NAVIGABLE. */ { int controls_graph_offset; XmTraversalNode controls_graph; int i; Widget *trav_children; Cardinal num_trav_children; Boolean free_child_list; XRectangle tmp_rect; XRectangle *list_entry_rect = &tmp_rect; tmp_rect = list_entry->any.rect; if (node_type == XmDESCENDANTS_NAVIGABLE) { /* This Composite has no purpose in the traversal * graph, so use the passed-in parents and a * temporary copy of this widget's rectangle to * avoid the need for the memory of this list entry. */ controls_graph_offset = control_parent; list_entry_offset = tab_parent; tmp_rect = *list_entry_rect; list_entry_rect = &tmp_rect; UnallocLastListEntry(trav_list); } else /* (node_type == XmDESCENDANTS_TAB_NAVIGABLE) */ { list_entry->any.type = XmTAB_GRAPH_NODE; list_entry->graph.sub_head = NULL; list_entry->graph.sub_tail = NULL; list_entry->any.tab_parent.offset = tab_parent; controls_graph_offset = list_entry_offset + 1; controls_graph = AllocListEntry(trav_list); *controls_graph = trav_list->head[list_entry_offset]; controls_graph->any.tab_parent.offset = list_entry_offset; controls_graph->any.type = XmCONTROL_GRAPH_NODE; } if (!(free_child_list = GetChildList(wid, &trav_children, &num_trav_children))) { trav_children = ((CompositeWidget) wid)->composite.children; num_trav_children = ((CompositeWidget) wid)->composite.num_children; } for (i = 0; i < num_trav_children; i++) GetNodeList(trav_children[i], list_entry_rect, trav_list, list_entry_offset, controls_graph_offset); if (free_child_list) XtFree((char *) trav_children); } } static XmTraversalNode GetNodeFromGraph(XmGraphNode graph, Widget wid) { XmTraversalNode node; if (wid && (node = graph->sub_head)) { do { if (node->any.widget == wid) return node; } while ((node != graph->sub_tail) && (node = node->any.next)); } return NULL; } static XmTraversalNode GetNodeOfWidget(XmTravGraph trav_list, Widget wid) { /* This function returns the first node in the list to match the * widget argument. * * Note that tab-group composites will have two nodes in the * node list; a tab-graph node and a control-graph node. * The first match will always be the tab-graph node and * the corresponding control-graph node will always be the * next node in the list; many callers of this routine depend * on this behavior. * * Also note that the graph list is maintained such that * "obsolete" nodes have the widget id field set to NULL; * this ensures that this routine will never return a node * which is not part of the current linked traversal graph. */ if (wid) { unsigned cnt = 0; XmTraversalNode list_ptr = trav_list->head; while (cnt++ < trav_list->num_entries) { if (list_ptr->any.widget == wid) return list_ptr; ++list_ptr; } } return NULL; } static void LinkNodeList(XmTravGraph list) { XmTraversalNode head = list->head; XmTraversalNode entry = head; unsigned cnt = 0; while (cnt++ < list->num_entries) { XmGraphNode parent; if (entry->any.tab_parent.offset < 0) parent = NULL; else parent = (XmGraphNode) &(head[entry->any.tab_parent.offset]); entry->any.tab_parent.link = parent; if (parent) { if (!parent->sub_tail) parent->sub_head = entry; else parent->sub_tail->any.next = entry; entry->any.prev = parent->sub_tail; entry->any.next = NULL; parent->sub_tail = entry; } else { entry->any.prev = NULL; entry->any.next = NULL; } ++entry; } } /* * A helper for Sort(). Determine whether two nodes overlap enough to * be considered part of the same row. */ static Boolean NodesOverlap(XmTraversalNode nodeA, XmTraversalNode nodeB, Boolean horizontal) { Dimension Acent, Bcent; if (horizontal) { Acent = nodeA->any.rect.y + ((nodeA->any.rect.height) >> 1); Bcent = nodeB->any.rect.y + ((nodeB->any.rect.height) >> 1); if (((nodeA->any.rect.y + nodeA->any.rect.height) < Bcent) && (Acent < (Dimension) nodeB->any.rect.y)) return False; else if (((nodeB->any.rect.y + nodeB->any.rect.height) < Acent) && (Bcent < (Dimension) nodeA->any.rect.y)) return False; } else { Acent = nodeA->any.rect.x + ((nodeA->any.rect.width) >> 1); Bcent = nodeB->any.rect.x + ((nodeB->any.rect.width) >> 1); if (((nodeA->any.rect.x + nodeA->any.rect.width) < Bcent) && (Acent < (Dimension) nodeB->any.rect.x)) return False; else if (((nodeB->any.rect.x + nodeB->any.rect.width) < Acent) && (Bcent < (Dimension) nodeA->any.rect.x)) return False; } return True; } /* * A helper for Sort(). Truncate a row to a given length, putting * orphaned items back into the free list in order. */ static void TruncateRow(XmTraversalRow *row, Cardinal length, XmTraversalNode *free_list, Cardinal *first_free, Cardinal max_free, Boolean horizontal, XmDirection layout) { Cardinal tmp; XmTraversalNode item; Comparator compare = (horizontal ? HorizNodeComparator(layout) : VertNodeComparator(layout)); assert(length <= row->num_items); while (row->num_items > length) { /* Select an item to free. */ item = row->items[--(row->num_items)]; free_list[(*first_free)--] = item; assert(((int)*first_free) >= 0); /* This can't be the determining item for sorting rows. */ if (item == row->lead_item) row->lead_item = NULL; /* Push it back onto the free list in sorted order. */ for (tmp = *first_free + 2; tmp < max_free; tmp++) { if (compare (free_list + tmp, &item) < 0) { free_list[tmp - 1] = free_list[tmp]; free_list[tmp] = item; } else { /* The free list was sorted initially, so we're done. */ break; } } } } /* A helper for Sort(). Append a node to a row. */ static void AppendToRow(XmTraversalNode item, XmTraversalRow *row, Boolean horizontal, XmDirection layout) { Cardinal tmp; /* Make sure there is enough room in the array. */ assert (row->num_items <= row->max_items); if (row->num_items == row->max_items) { row->max_items += 10; row->items = (XmTraversalNode *) XtRealloc((char*)row->items, row->max_items * sizeof(XmTraversalNode)); } /* Append this item.*/ row->items[row->num_items++] = item; /* Update cached row information. */ tmp = row->num_items - 1; if (row->lead_item == NULL) { row->lead_item = row->items[0]; tmp = 1; row->min_hint = 32767; /* Should be MAX_POSITION. */ row->max_hint = -32768; /* Should be MIN_POSITION. */ } for (; tmp < row->num_items; tmp++) { XmTraversalNode node = row->items[tmp]; /* Look for a new dominant item. */ if (NodeDominates(node, row->lead_item, horizontal, layout)) row->lead_item = node; /* Look for new bounds hints. */ if (horizontal) { ASSIGN_MIN(row->min_hint, node->any.rect.y); ASSIGN_MAX(row->max_hint, node->any.rect.y + node->any.rect.height); } else { ASSIGN_MIN(row->min_hint, node->any.rect.x); ASSIGN_MAX(row->max_hint, node->any.rect.x + node->any.rect.width); } } } /* * A helper for Sort(). Test whether a node dominates another node * in the same row. A dominant node may force itself into an existing * row even if it has to displace nodes previously assigned to that row. */ static Boolean NodeDominates(XmTraversalNode node_1, XmTraversalNode node_2, Boolean horizontal, XmDirection layout) { if (horizontal) { if (XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK)) return (node_1->any.rect.y < node_2->any.rect.y); else return ((node_1->any.rect.y + node_1->any.rect.height) > (node_2->any.rect.y + node_2->any.rect.height)); } else { if (XmDirectionMatchPartial(layout, XmLEFT_TO_RIGHT, XmHORIZONTAL_MASK)) return (node_1->any.rect.x < node_2->any.rect.x); else return ((node_1->any.rect.x + node_1->any.rect.width) > (node_2->any.rect.x + node_2->any.rect.width)); } } static void Sort(XmTraversalNode *list, size_t n_mem, Boolean horizontal, XmDirection layout) { /* This rather involved algorithm is intended to produce a grid-like */ /* traversal order (like the keys on a telephone), but at the same */ /* time use an "intuitive" definition of which nodes form a row. */ XmTraversalRow *rows = NULL; int row; int num_rows = 0; Cardinal first_free = (Cardinal) -1; /* Take the easy out in degenerate cases. */ if (n_mem <= 1) return; /* First sort everything based simply on the absolute coordinates. */ if (horizontal) qsort(list, n_mem, sizeof(XmTraversalNode), HorizNodeComparator(layout)); else qsort(list, n_mem, sizeof(XmTraversalNode), VertNodeComparator(layout)); /* Assign each free node to a row. */ while (++first_free < n_mem) { XmTraversalNode node = list[first_free]; Boolean new_row = True; Boolean done = False; Boolean might_overlap = False ; Cardinal row_len = 0; row = 0; while (!done && (row < num_rows)) { /* Extract some row-specific information. */ if (new_row) { new_row = False; row_len = rows[row].num_items; if (horizontal) { might_overlap = (rows[row].max_hint > node->any.rect.y) && (rows[row].min_hint < (node->any.rect.y + node->any.rect.height)); } else { might_overlap = (rows[row].max_hint > node->any.rect.x) && (rows[row].min_hint < (node->any.rect.x + node->any.rect.width)); } } /* Append this node if it overlaps the end of the row. */ if (NodesOverlap(node, rows[row].items[row_len - 1], horizontal)) { TruncateRow(rows + row, row_len, list, &first_free, n_mem, horizontal, layout); AppendToRow(node, rows + row, horizontal, layout); done = True; } /* Else if this node is dominant backtrack and try again. */ else if ((row_len > 1) && might_overlap && #ifdef FIX_1272 NodeDominates(node, rows[row].items[row_len-1], #else NodeDominates(node, rows[row].items[rows[row].num_items-1], #endif horizontal, layout)) row_len--; /* Try the next row. */ else { row++; new_row = True; } } /* Create a new row if necessary. */ if (!done) { XmTraversalRow new_data; Cardinal new_index = num_rows; new_data.items = XtNew(XmTraversalNode); new_data.items[0] = node; new_data.lead_item = node; new_data.num_items = 1; new_data.max_items = 1; if (horizontal) { new_data.min_hint = node->any.rect.y; new_data.max_hint = node->any.rect.y + node->any.rect.height; } else { new_data.min_hint = node->any.rect.x; new_data.max_hint = node->any.rect.x + node->any.rect.width; } num_rows++; rows = (XmTraversalRow *) XtRealloc((char*) rows, num_rows * sizeof(XmTraversalRow)); /* Keep rows sorted by initial element. */ for (row = new_index; row > 0; row--) { if (NodeDominates(node, rows[row-1].lead_item, horizontal,layout)) { memcpy(rows + row, rows + row - 1, sizeof(XmTraversalRow)); new_index--; } else break; } memcpy(rows + new_index, &new_data, sizeof(XmTraversalRow)); } } assert(first_free == n_mem); /* Copy nodes out of rows and into the final order. */ first_free = 0; if ((horizontal && XmDirectionMatchPartial(layout, XmLEFT_TO_RIGHT, XmHORIZONTAL_MASK)) || (!horizontal && XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK))) { /* Nodes appear in the desired order. */ for (row = 0; row < num_rows; row++) { assert(rows[row].num_items && rows[row].items); memcpy(list + first_free, rows[row].items, sizeof(XmTraversalNode) * rows[row].num_items); first_free += rows[row].num_items; XtFree((char*) rows[row].items); } } else { /* Nodes are in exactly the wrong order, but the head is right. */ int col; for (row = num_rows - 1; row >= 0; row--) { assert(rows[row].num_items && rows[row].items); for (col = rows[row].num_items - 1; col >= 0; col--) list[++first_free % n_mem] = rows[row].items[col]; XtFree((char*) rows[row].items); } } assert(first_free == n_mem); XtFree((char*) rows); } static int CompareExclusive(XmConst void *A, XmConst void *B) { XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); int PositionA = SearchTabList(SortReferenceGraph, nodeA->any.widget); int PositionB = SearchTabList(SortReferenceGraph, nodeB->any.widget); if (PositionA < PositionB) return -1; else if (PositionA > PositionB) return 1; else return 0; } /* Select a horizontal comparator for this layout direction. */ static Comparator HorizNodeComparator(XmDirection layout) { if (XmDirectionMatchPartial(layout, XmLEFT_TO_RIGHT, XmHORIZONTAL_MASK)) { if (XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK)) return CompareNodesHorizLT; else return CompareNodesHorizLB; } else { if (XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK)) return CompareNodesHorizRT; else return CompareNodesHorizRB; } } /* Compare nodes horizontally in a Left-to-Right, Top-to-Bottom layout. */ static int CompareNodesHorizLT(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if (nodeA->any.rect.x != nodeB->any.rect.x) return (nodeA->any.rect.x < nodeB->any.rect.x) ? -1 : 1; if (nodeA->any.rect.y != nodeB->any.rect.y) return (nodeA->any.rect.y < nodeB->any.rect.y) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; return 0; } /* Compare nodes horizontally in a Right-to-Left, Top-to-Bottom layout. */ static int CompareNodesHorizRT(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if ((nodeA->any.rect.x + nodeA->any.rect.width) != (nodeB->any.rect.x + nodeB->any.rect.width)) return ((nodeA->any.rect.x + nodeA->any.rect.width) > (nodeB->any.rect.x + nodeB->any.rect.width)) ? -1 : 1; if (nodeA->any.rect.y != nodeB->any.rect.y) return (nodeA->any.rect.y < nodeB->any.rect.y) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; return 0; } /* Compare nodes horizontally in a Left-to-Right, Bottom-to-Top layout. */ static int CompareNodesHorizLB(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if (nodeA->any.rect.x != nodeB->any.rect.x) return (nodeA->any.rect.x < nodeB->any.rect.x) ? -1 : 1; if ((nodeA->any.rect.y + nodeA->any.rect.height) != (nodeB->any.rect.y + nodeB->any.rect.height)) return ((nodeA->any.rect.y + nodeA->any.rect.height) > (nodeB->any.rect.y + nodeB->any.rect.height)) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; return 0; } /* Compare nodes horizontally in a Right-to-Left, Bottom-to-Top layout. */ static int CompareNodesHorizRB(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if ((nodeA->any.rect.x + nodeA->any.rect.width) != (nodeB->any.rect.x + nodeB->any.rect.width)) return ((nodeA->any.rect.x + nodeA->any.rect.width) > (nodeB->any.rect.x + nodeB->any.rect.width)) ? -1 : 1; if ((nodeA->any.rect.y + nodeA->any.rect.height) != (nodeB->any.rect.y + nodeB->any.rect.height)) return ((nodeA->any.rect.y + nodeA->any.rect.height) > (nodeB->any.rect.y + nodeB->any.rect.height)) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; return 0; } /* Select a vertical comparator for this layout direction. */ static Comparator VertNodeComparator(XmDirection layout) { if (XmDirectionMatchPartial(layout, XmLEFT_TO_RIGHT, XmHORIZONTAL_MASK)) { if (XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK)) return CompareNodesVertLT; else return CompareNodesVertLB; } else { if (XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK)) return CompareNodesVertRT; else return CompareNodesVertRB; } } /* Compare nodes vertically in a Left-to-Right, Top-to-Bottom layout. */ static int CompareNodesVertLT(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if (nodeA->any.rect.y != nodeB->any.rect.y) return (nodeA->any.rect.y < nodeB->any.rect.y) ? -1 : 1; if (nodeA->any.rect.x != nodeB->any.rect.x) return (nodeA->any.rect.x < nodeB->any.rect.x) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; return 0; } /* Compare nodes vertically in a Right-to-Left, Top-to-Bottom layout. */ static int CompareNodesVertRT(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if (nodeA->any.rect.y != nodeB->any.rect.y) return (nodeA->any.rect.y < nodeB->any.rect.y) ? -1 : 1; if ((nodeA->any.rect.x + nodeA->any.rect.width) != (nodeB->any.rect.x + nodeB->any.rect.width)) return ((nodeA->any.rect.x + nodeA->any.rect.width) > (nodeB->any.rect.x + nodeB->any.rect.width)) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; return 0; } /* Compare nodes vertically in a Left-to-Right, Bottom-to-Top layout. */ static int CompareNodesVertLB(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if ((nodeA->any.rect.y + nodeA->any.rect.height) != (nodeB->any.rect.y + nodeB->any.rect.height)) return ((nodeA->any.rect.y + nodeA->any.rect.height) > (nodeB->any.rect.y + nodeB->any.rect.height)) ? -1 : 1; if (nodeA->any.rect.x != nodeB->any.rect.x) return (nodeA->any.rect.x < nodeB->any.rect.x) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; return 0; } /* Compare nodes vertically in a Right-to-Left, Bottom-to-Top layout. */ static int CompareNodesVertRB(XmConst void *A, XmConst void *B) { register XmConst XmTraversalNode nodeA = *((XmTraversalNode *) A); register XmConst XmTraversalNode nodeB = *((XmTraversalNode *) B); if ((nodeA->any.rect.y + nodeA->any.rect.height) != (nodeB->any.rect.y + nodeB->any.rect.height)) return ((nodeA->any.rect.y + nodeA->any.rect.height) > (nodeB->any.rect.y + nodeB->any.rect.height)) ? -1 : 1; if ((nodeA->any.rect.x + nodeA->any.rect.width) != (nodeB->any.rect.x + nodeB->any.rect.width)) return ((nodeA->any.rect.x + nodeA->any.rect.width) > (nodeB->any.rect.x + nodeB->any.rect.width)) ? -1 : 1; if (nodeA->any.rect.width != nodeB->any.rect.width) return (nodeA->any.rect.width < nodeB->any.rect.width) ? -1 : 1; if (nodeA->any.rect.height != nodeB->any.rect.height) return (nodeA->any.rect.height < nodeB->any.rect.height) ? -1 : 1; return 0; } /* Tab groups are sorted by "forward" direction. */ static void SortTabGraph(XmGraphNode graph, Boolean exclusive, XmDirection layout) { XmTraversalNode head = graph->sub_head; if (head) { XmTraversalNode node = head; XmTraversalNode *list_ptr; unsigned num_nodes = 1; unsigned idx; XmTraversalNode *node_list; XmTraversalNode storage[STACK_SORT_LIMIT]; while ((node = node->any.next) != NULL) ++num_nodes; node_list = (XmTraversalNode*) XmStackAlloc(num_nodes * sizeof(XmTraversalNode), storage); /* Now copy nodes onto node list for sorting. */ node = head; list_ptr = node_list; do { *list_ptr++ = node; } while ((node = node->any.next) != NULL); assert(graph->any.type == XmTAB_GRAPH_NODE); if (num_nodes > 1) { if (exclusive) qsort(node_list, num_nodes, sizeof(XmTraversalNode), CompareExclusive); else { /* For non-exclusive tab traversal, leave the control * subgraph at the beginning of the list, since it * always gets first traversal. */ Boolean horizontal; Boolean reverse; /* Sort axis depends on layout precedence. */ horizontal = XmDirectionMatchPartial(layout, XmPRECEDENCE_HORIZ_MASK, XmPRECEDENCE_MASK); reverse = (horizontal ? !XmDirectionMatchPartial(layout, XmLEFT_TO_RIGHT, XmHORIZONTAL_MASK) : !XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK)); Sort((node_list + 1), (num_nodes - 1), horizontal, layout); if (reverse) { XmTraversalNode tmp; /* If right/down is not forward reverse the list. */ for (idx = 0; idx < ((num_nodes - 1) / 2); idx++) { memcpy((char*) &tmp, (char*) (node_list + idx + 1), sizeof(XmTraversalNode)); memcpy((char*) (node_list + idx + 1), (char*) (node_list + num_nodes - idx - 1), sizeof(XmTraversalNode)); memcpy((char*) (node_list + num_nodes - idx - 1), (char*) &tmp, sizeof(XmTraversalNode)); } /* Rotate the initial element into the proper position. */ if (num_nodes > 2) { memcpy((char*) &tmp, (char*) (node_list + num_nodes - 1), sizeof(XmTraversalNode)); memmove((char*) (node_list + 2), (char*) (node_list + 1), (num_nodes - 2) * sizeof(XmTraversalNode)); memcpy((char*) (node_list + 1), (char*) &tmp, sizeof(XmTraversalNode)); } } } } list_ptr = node_list; graph->sub_head = *list_ptr; (*list_ptr)->any.prev = NULL; idx = 0; while (++idx < num_nodes) { /* This loop does one less than the number of nodes. */ (*list_ptr)->any.next = *(list_ptr + 1); ++list_ptr; (*list_ptr)->any.prev = *(list_ptr - 1); } (*list_ptr)->any.next = NULL; graph->sub_tail = *list_ptr; XmStackFree((char*) node_list, storage); } } /* Controls are sorted by absolute direction. */ static void SortControlGraph(XmGraphNode graph, Boolean exclusive, XmDirection layout) { XmTraversalNode head = graph->sub_head; if (head) { XmTraversalNode node = head; XmTraversalNode *list_ptr; unsigned num_nodes = 1; unsigned idx; XmTraversalNode *node_list; XmTraversalNode storage[STACK_SORT_LIMIT]; while ((node = node->any.next) != NULL) ++num_nodes; node_list = (XmTraversalNode*) XmStackAlloc(num_nodes * sizeof(XmTraversalNode), storage); /* Now copy nodes onto node list for sorting. */ node = head; list_ptr = node_list; do { *list_ptr++ = node; } while ((node = node->any.next) != NULL); assert(graph->any.type == XmCONTROL_GRAPH_NODE); if (!exclusive || (graph->any.nav_type == XmSTICKY_TAB_GROUP)) Sort(node_list, num_nodes, True, layout); list_ptr = node_list; graph->sub_head = *list_ptr; (*list_ptr)->any.prev = NULL; idx = 0; while (++idx < num_nodes) { /* This loop does one less than the number of nodes. */ (*list_ptr)->any.next = *(list_ptr + 1); ++list_ptr; (*list_ptr)->any.prev = *(list_ptr - 1); } (*list_ptr)->any.next = NULL; graph->sub_tail = *list_ptr; /* Add links for wrapping behavior of control nodes. */ graph->sub_head->any.prev = graph->sub_tail; graph->sub_tail->any.next = graph->sub_head; /* Now use current list to sort again, this time for up and down. */ if (!exclusive || (graph->any.nav_type == XmSTICKY_TAB_GROUP)) Sort(node_list, num_nodes, False, layout); list_ptr = node_list; (*list_ptr)->control.up = list_ptr[num_nodes - 1]; idx = 0; while (++idx < num_nodes) { /* This loop does one less than the number of nodes. */ (*list_ptr)->control.down = *(list_ptr + 1); ++list_ptr; (*list_ptr)->control.up = *(list_ptr - 1); } (*list_ptr)->control.down = *node_list; /* If vertical precedence is required set initial focus on */ /* the first column instead of the first row. */ if (! XmDirectionMatchPartial(layout, XmPRECEDENCE_HORIZ_MASK, XmPRECEDENCE_MASK)) { graph->sub_head = *node_list; graph->sub_tail = *list_ptr; } XmStackFree((char*) node_list, storage); } } static void SortNodeList(XmTravGraph trav_list) { XmTraversalNode ptr = trav_list->head; unsigned cnt = 0; _XmProcessLock(); SortReferenceGraph = trav_list; /* Slime for CompareExclusive(). */ while (cnt++ < trav_list->num_entries) { if (ptr->any.type == XmTAB_GRAPH_NODE) { SortTabGraph((XmGraphNode) ptr, !!(trav_list->exclusive), GetLayout(ptr->any.widget)); } else if (ptr->any.type == XmCONTROL_GRAPH_NODE) { SortControlGraph((XmGraphNode) ptr, !!(trav_list->exclusive), GetLayout(ptr->any.widget)); } ++ptr; } _XmProcessUnlock(); } Boolean _XmSetInitialOfTabGraph(XmTravGraph trav_graph, Widget tab_group, Widget init_focus) { XmTraversalNode tab_node = GetNodeOfWidget(trav_graph, tab_group); XmGraphNode control_graph_node; if (tab_node && ((tab_node->any.type == XmTAB_GRAPH_NODE) || (tab_node->any.type == XmCONTROL_GRAPH_NODE))) { if (SetInitialNode((XmGraphNode) tab_node, GetNodeFromGraph((XmGraphNode) tab_node, init_focus)) || ((control_graph_node = (XmGraphNode) GetNodeFromGraph((XmGraphNode) tab_node, tab_group)) && SetInitialNode(control_graph_node, GetNodeFromGraph(control_graph_node, init_focus)) && SetInitialNode((XmGraphNode) tab_node, (XmTraversalNode) control_graph_node))) { return TRUE; } } return FALSE; } static Boolean SetInitialNode(XmGraphNode graph, XmTraversalNode init_node) { /* It is presumed that init_node was derived from a call * to GetNodeFromGraph with the same "graph" argument. * It is a bug if the parent of init_node is not graph. */ if (init_node) { if (init_node != graph->sub_head) { if (graph->any.type == XmTAB_GRAPH_NODE) { graph->sub_tail->any.next = graph->sub_head; graph->sub_head->any.prev = graph->sub_tail; graph->sub_head = init_node; graph->sub_tail = init_node->any.prev; graph->sub_tail->any.next = NULL; init_node->any.prev = NULL; } else { graph->sub_head = init_node; graph->sub_tail = init_node->any.prev; } } return TRUE; } return FALSE; } static void SetInitialWidgets(XmTravGraph trav_list) { Widget init_focus; XmTraversalNode ptr = trav_list->head; XmTraversalNode init_node; unsigned cnt = 0; while (cnt < trav_list->num_entries) { if (((ptr->any.type == XmTAB_GRAPH_NODE) || (ptr->any.type == XmCONTROL_GRAPH_NODE)) && ptr->graph.sub_head) { if (ptr->any.widget && XmIsManager(ptr->any.widget) && (init_focus = ((XmManagerWidget) ptr->any.widget)->manager.initial_focus) && (init_node = GetNodeFromGraph((XmGraphNode) ptr, init_focus))) { SetInitialNode((XmGraphNode) ptr, init_node); } else { if (ptr->any.type == XmTAB_GRAPH_NODE) { /* A tab graph node is always followed immediately * by its corresponding control graph. * * Make sure that the control graph is the first * tab node of every tab graph (unless specified * otherwise). */ SetInitialNode((XmGraphNode) ptr, (ptr + 1)); } } } ++ptr; ++cnt; } } static void GetRectRelativeToShell(Widget wid, XRectangle *rect) { /* This routine returns the rectangle of the widget relative to its * nearest shell ancestor. */ Position x = 0; Position y = 0; rect->width = XtWidth(wid); rect->height = XtHeight(wid); do { x += XtX(wid) + XtBorderWidth(wid); y += XtY(wid) + XtBorderWidth(wid); } while ((wid = XtParent(wid)) && !XtIsShell(wid)); rect->x = x; rect->y = y; } void _XmTabListAdd(XmTravGraph graph, Widget wid) { if (SearchTabList(graph, wid) < 0) { if (!(graph->tab_list_alloc)) { Widget shell = _XmFindTopMostShell(wid); graph->tab_list_alloc = XmTAB_LIST_ALLOC_INCREMENT; graph->excl_tab_list = (Widget *) XtMalloc(graph->tab_list_alloc * sizeof(Widget)); graph->excl_tab_list[graph->num_tab_list++] = shell; } if (graph->num_tab_list >= graph->tab_list_alloc) { graph->tab_list_alloc += XmTAB_LIST_ALLOC_INCREMENT; graph->excl_tab_list = (Widget *) XtRealloc((char *) graph->excl_tab_list, graph->tab_list_alloc * sizeof(Widget)); } graph->excl_tab_list[graph->num_tab_list++] = wid; } } void _XmTabListDelete(XmTravGraph graph, Widget wid) { DeleteFromTabList(graph, SearchTabList(graph, wid)); if ((graph->num_tab_list + XmTAB_LIST_ALLOC_INCREMENT) < graph->tab_list_alloc) { graph->tab_list_alloc -= XmTAB_LIST_ALLOC_INCREMENT; graph->excl_tab_list = (Widget *) XtRealloc((char *) graph->excl_tab_list, graph->tab_list_alloc * sizeof(Widget)); } } static int SearchTabList(XmTravGraph graph, Widget wid) { int i; for (i = 0; i < graph->num_tab_list; i++) { if (graph->excl_tab_list[i] == wid) return i; } return -1; } static void DeleteFromTabList(XmTravGraph graph, int indx) { if (indx >= 0) { /* CR 7455: Don't index off the end of the array. */ while ((indx + 1) < graph->num_tab_list) { graph->excl_tab_list[indx] = graph->excl_tab_list[indx+1]; ++indx; } --(graph->num_tab_list); } } static Boolean LastControl(Widget w, XmTraversalDirection dir, XmTravGraph graph) { XmTraversalNode cur_node, new_ctl; cur_node = GetNodeOfWidget(graph, w); if (!cur_node) return False; if (cur_node->any.type == XmCONTROL_GRAPH_NODE) { /* This is only true on composites. */ cur_node = cur_node->graph.sub_head; if (!cur_node) return True; } else { if (cur_node->any.type != XmCONTROL_NODE) return True; } new_ctl = cur_node; do { switch(dir) { case XmTRAVERSE_GLOBALLY_FORWARD: /* The action will cause wrapping when the new_ctrl matches the * last item on the tab_parent's list. */ if (new_ctl == new_ctl->any.tab_parent.link->sub_head->any.prev) return True; else new_ctl = new_ctl->any.next; break; case XmTRAVERSE_GLOBALLY_BACKWARD: /* Moving backward will cause wrapping when the new control is the * first item in the tab group. */ if (new_ctl == new_ctl->any.tab_parent.link->sub_head) return True; else new_ctl = new_ctl->any.prev; break; default: return False; } } while (new_ctl && !NodeIsTraversable(new_ctl) && (new_ctl != cur_node)); return False; } static XmTraversalDirection LocalDirection(Widget w, XmTraversalDirection direction) { XmDirection layout; Boolean forward; /* Local direction is only interesting for global traversal. */ switch (direction) { case XmTRAVERSE_GLOBALLY_FORWARD: forward = TRUE; break; case XmTRAVERSE_GLOBALLY_BACKWARD: forward = FALSE; break; default: return direction; } /* Get the current layout direction. */ if (XmIsManager(w)) layout = LayoutM(w); else if (XmIsPrimitive(w)) layout = LayoutP(w); else if (XmIsGadget(w)) layout = LayoutG(w); else layout = _XmGetLayoutDirection(w); if (XmDirectionMatchPartial(layout, XmPRECEDENCE_HORIZ_MASK, XmPRECEDENCE_MASK)) { /* Horizontal precendence. */ if (XmDirectionMatchPartial(layout, XmLEFT_TO_RIGHT, XmHORIZONTAL_MASK)) return (forward ? XmTRAVERSE_RIGHT : XmTRAVERSE_LEFT); else return (forward ? XmTRAVERSE_LEFT : XmTRAVERSE_RIGHT); } else { /* Vertical precedence. */ if (XmDirectionMatchPartial(layout, XmTOP_TO_BOTTOM, XmVERTICAL_MASK)) return (forward ? XmTRAVERSE_DOWN : XmTRAVERSE_UP); else return (forward ? XmTRAVERSE_UP : XmTRAVERSE_DOWN); } } #ifdef DEBUG_TRAVERSAL #define WNAME(node) (XtName(node->any.widget)) #define CNAME(node) (node->any.widget->core.widget_class->core_class.class_name) static void PrintControl(XmTraversalNode node) { printf("%X: control %s \"%s\", (%d,%d), parent: %X, next: %X, prev: %X, up: %X, down: %X\n", node, CNAME(node), WNAME(node), node->any.rect.x, node->any.rect.y, node->any.tab_parent.link, node->any.next, node->any.prev, node->control.up, node->control.down); } static void PrintTab(XmTraversalNode node) { printf("%X: tab %s \"%s\", (%d,%d), parent: %X, next: %X, prev: %X\n", node, CNAME(node), WNAME(node), node->any.rect.x, node->any.rect.y, node->any.tab_parent.link, node->any.next, node->any.prev); } static void PrintGraph(XmTraversalNode node) { char *gr_str; if (node->any.type == XmCONTROL_GRAPH_NODE) gr_str = "ctl_graph"; else gr_str = "tab_graph"; printf("%X: %s %s \"%s\", (%d,%d), parent: %X, sub_head: %X, sub_tail: %X, next: %X, prev: %X\n", node, gr_str, CNAME(node), WNAME(node), node->any.rect.x, node->any.rect.y, node->any.tab_parent.link, node->graph.sub_head, node->graph.sub_tail, node->any.next, node->any.prev); } static void PrintNodeList(XmTravGraph list) { XmTraversalNode ptr = list->head; unsigned idx; for (idx = 0; idx < list->num_entries; idx++) { switch (ptr->any.type) { case XmTAB_GRAPH_NODE: case XmCONTROL_GRAPH_NODE: PrintGraph(ptr); break; case XmTAB_NODE: PrintTab(ptr); break; case XmCONTROL_NODE: PrintControl(ptr); break; } ++ptr; } } #endif /* DEBUG_TRAVERSAL */ motif-2.3.8/lib/Xm/ColorObjI.h0000644000175000017500000000320612672140200012703 00000000000000/* $XConsortium: ColorObjI.h /main/6 1995/07/15 20:49:00 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmColorObjI_h #define _XmColorObjI_h #include #ifdef __cplusplus extern "C" { #endif /* defines for palette.c */ #define VALUE_THRESHOLD 225 externalref XmColorObj _XmDefaultColorObj; externalref XContext _XmColorObjCache; externalref Display *_XmColorObjCacheDisplay; /******** Private Function Declarations ********/ extern void _XmColorObjCreate( Widget w, ArgList al, Cardinal *acPtr) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmColorObjI_h */ motif-2.3.8/lib/Xm/Gadget.c0000644000175000017500000007272213145162623012271 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Gadget.c /main/17 1997/07/07 11:38:57 cshi $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* doesn't define externalref */ #include /* needs it. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "XmI.h" #include "BaseClassI.h" #include "GadgetI.h" #include "MessagesI.h" #include "ResIndI.h" #include "RepTypeI.h" #include "SyntheticI.h" #include "TraitI.h" #include "TraversalI.h" #include "ToolTipI.h" #define INVALID_UNIT_TYPE 255 #define MESSAGE1 _XmMMsgGadget_0000 /******** Static Function Declarations ********/ static void GetHighlightColor( Widget w, int offset, XtArgVal *value) ; static void GetTopShadowColor( Widget w, int offset, XtArgVal *value) ; static void GetBottomShadowColor( Widget w, int offset, XtArgVal *value) ; static void ClassInitialize( void ) ; static void ClassPartInit( WidgetClass g) ; static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Destroy( Widget w) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void BorderHighlight( Widget w) ; static void BorderUnhighlight( Widget w) ; static void FocusChange( Widget wid, XmFocusChange change) ; static XmNavigability WidgetNavigable( Widget wid) ; static XmDirection GetDirection(Widget); static void GetColors(Widget widget, XmAccessColorData color_data); static unsigned char GetUnitType(Widget widget); static void GetToolTipString (Widget wid, int resource, /* unused */ XtArgVal * value); static XmImportOperator SetToolTipString (Widget wid, int resource, /* unused */ XtArgVal * value); /******** End Static Function Declarations ********/ /* Resource definitions for Subclasses of Gadget */ static XtResource resources[] = { { XmNx, XmCPosition, XmRHorizontalPosition, sizeof(Position), XtOffsetOf( struct _WidgetRec, core.x), XmRImmediate, (XtPointer) 0 }, { XmNy, XmCPosition, XmRVerticalPosition, sizeof(Position), XtOffsetOf( struct _WidgetRec, core.y), XmRImmediate, (XtPointer) 0 }, { XmNwidth, XmCDimension, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _WidgetRec, core.width), XmRImmediate, (XtPointer) 0 }, { XmNheight, XmCDimension, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf( struct _WidgetRec, core.height), XmRImmediate, (XtPointer) 0 }, { XmNborderWidth, XmCBorderWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf( struct _WidgetRec, core.border_width), XmRImmediate, (XtPointer) 0 }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmGadgetRec, gadget.traversal_on), XmRImmediate, (XtPointer) True }, { XmNhighlightOnEnter, XmCHighlightOnEnter, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmGadgetRec, gadget.highlight_on_enter), XmRImmediate, (XtPointer) False }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmGadgetRec, gadget.highlight_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmGadgetRec, gadget.shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness }, { XmNunitType, XmCUnitType, XmRUnitType, sizeof (unsigned char), XtOffsetOf( struct _XmGadgetRec, gadget.unit_type), XmRCallProc, (XtPointer) _XmUnitTypeDefault }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf( struct _XmGadgetRec, gadget.navigation_type), XmRImmediate, (XtPointer) XmNONE }, { XmNhelpCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( struct _XmGadgetRec, gadget.help_callback), XmRPointer, (XtPointer) NULL }, { XmNuserData, XmCUserData, XmRPointer, sizeof(XtPointer), XtOffsetOf( struct _XmGadgetRec, gadget.user_data), XmRPointer, (XtPointer) NULL }, { XmNlayoutDirection, XmCLayoutDirection, XmRDirection, sizeof(XmDirection), XtOffsetOf(XmGadgetRec, gadget.layout_direction), XmRCallProc, (XtPointer) _XmDirectionDefault }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource syn_resources[] = { { XmNx, sizeof (Position), XtOffsetOf( struct _RectObjRec, rectangle.x), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNy, sizeof (Position), XtOffsetOf( struct _RectObjRec, rectangle.y), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNwidth, sizeof (Dimension), XtOffsetOf( struct _RectObjRec, rectangle.width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNheight, sizeof (Dimension), XtOffsetOf( struct _RectObjRec, rectangle.height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNhighlightThickness, sizeof (Dimension), XtOffsetOf( struct _XmGadgetRec, gadget.highlight_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNshadowThickness, sizeof (Dimension), XtOffsetOf( struct _XmGadgetRec, gadget.shadow_thickness), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNhighlightColor, sizeof (Pixel), XtOffsetOf( struct _XmGadgetRec, object.parent), GetHighlightColor, NULL }, { XmNtopShadowColor, sizeof (Pixel), XtOffsetOf( struct _XmGadgetRec, object.parent), GetTopShadowColor, NULL }, { XmNbottomShadowColor, sizeof (Pixel), XtOffsetOf( struct _XmGadgetRec, object.parent), GetBottomShadowColor, NULL }, { XmNtoolTipString, 0, 0, GetToolTipString, SetToolTipString }, }; static XmBaseClassExtRec baseClassExtRec = { NULL, NULLQUARK, XmBaseClassExtVersion, sizeof(XmBaseClassExtRec), NULL, /* Initialize Prehook */ NULL, /* SetValues Prehook */ NULL, /* Initialize Posthook */ NULL, /* SetValues PostHook */ NULL, /* SecondaryObjectClass */ SecondaryObjectCreate, /* SecondaryObjectCreate */ NULL, /* getSecRes data */ {0}, /* fastSubclass flags */ NULL, /* GetValues Prehook */ NULL, /* GetValues Posthook */ NULL, /* classPartInitPrehook */ NULL, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ WidgetNavigable, /* widgetNavigable */ FocusChange, /* focusChange */ }; static XmGadgetClassExtRec _XmGadClassExtRec = { NULL, NULLQUARK, XmGadgetClassExtVersion, sizeof(XmGadgetClassExtRec), NULL, /* widget_baseline */ NULL, /* widget_display_rect */ NULL, /* widget_margins */ }; /* The gadget class record definition */ externaldef(xmgadgetclassrec) XmGadgetClassRec xmGadgetClassRec = { { (WidgetClass) &rectObjClassRec, /* superclass */ "XmGadget", /* class_name */ sizeof(XmGadgetRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInit, /* class part initialize */ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ True, /* compress_exposure */ True, /* compress_enterleave */ False, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ NULL, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ _XmGadgetGetValuesHook, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&baseClassExtRec, /* extension */ }, { BorderHighlight, /* border_highlight */ BorderUnhighlight, /* border_unhighlight */ NULL, /* arm_and_activate */ NULL, /* input_dispatch */ NULL, /* visual_change */ syn_resources, /* syn resources */ XtNumber(syn_resources), /* num_syn_resources */ NULL, /* cache_part */ (XtPointer)&_XmGadClassExtRec, /* extension */ } }; externaldef(xmgadgetclass) WidgetClass xmGadgetClass = (WidgetClass) &xmGadgetClassRec; /* Access Colors Trait record for Gadget */ static XmConst XmAccessColorsTraitRec gadACT = { 0, /* version */ GetColors }; /* Unit Type Trait record for Gadget */ static XmConst XmSpecUnitTypeTraitRec gadUTT = { 0, /* version */ GetUnitType }; static XmConst XmSpecifyLayoutDirectionTraitRec gadLDT = { 0, /* version */ GetDirection }; /************************************************************************ * * The following functions are synthetic hooks. * ************************************************************************/ /*ARGSUSED*/ static void GetHighlightColor( Widget w, int offset, /* unused */ XtArgVal *value ) { XmManagerWidget mw = (XmManagerWidget) XtParent(w); *value = (XtArgVal) mw->manager.highlight_color; } /*ARGSUSED*/ static void GetTopShadowColor( Widget w, int offset, /* unused */ XtArgVal *value ) { XmManagerWidget mw = (XmManagerWidget) XtParent(w); *value = (XtArgVal) mw->manager.top_shadow_color; } /*ARGSUSED*/ static void GetBottomShadowColor( Widget w, int offset, /* unused */ XtArgVal *value ) { XmManagerWidget mw = (XmManagerWidget) XtParent(w); *value = (XtArgVal) mw->manager.bottom_shadow_color; } /************************************************************************ * * ClassInitialize * ************************************************************************/ static void ClassInitialize( void ) { _XmInitializeExtensions(); _XmInitializeTraits(); baseClassExtRec.record_type = XmQmotif; } /************************************************************************ * * ClassPartInit * Used by subclasses of gadget to inherit class record procedures. * ************************************************************************/ static void ClassPartInit( WidgetClass g ) { static Boolean first_time = TRUE; XmGadgetClass wc = (XmGadgetClass) g; XmGadgetClass super = (XmGadgetClass) wc->rect_class.superclass; XmGadgetClassExt *wcePtr, *scePtr; wcePtr = _XmGetGadgetClassExtPtr(wc, NULLQUARK); if (((WidgetClass)wc != xmGadgetClass) && (*wcePtr)) { scePtr = _XmGetGadgetClassExtPtr(super, NULLQUARK); if ((*wcePtr)->widget_baseline == XmInheritBaselineProc) (*wcePtr)->widget_baseline = (*scePtr)->widget_baseline; if ((*wcePtr)->widget_display_rect == XmInheritDisplayRectProc) (*wcePtr)->widget_display_rect = (*scePtr)->widget_display_rect; if ((*wcePtr)->widget_margins == XmInheritMarginsProc) (*wcePtr)->widget_margins = (*scePtr)->widget_margins; } if (wc->gadget_class.border_highlight == XmInheritWidgetProc) wc->gadget_class.border_highlight = super->gadget_class.border_highlight; if (wc->gadget_class.border_unhighlight == XmInheritWidgetProc) wc->gadget_class.border_unhighlight = super->gadget_class.border_unhighlight; if (wc->gadget_class.arm_and_activate == XmInheritArmAndActivate) wc->gadget_class.arm_and_activate = super->gadget_class.arm_and_activate; if (wc->gadget_class.input_dispatch == XmInheritInputDispatch) wc->gadget_class.input_dispatch = super->gadget_class.input_dispatch; if (wc->gadget_class.visual_change == XmInheritVisualChange) wc->gadget_class.visual_change = super->gadget_class.visual_change; _XmFastSubclassInit (g, XmGADGET_BIT); if (first_time) { _XmReOrderResourceList(xmGadgetClass, XmNunitType, NULL); first_time = FALSE; } _XmBuildGadgetResources((WidgetClass) wc); /* Install the direction trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTspecifyLayoutDirection, (XtPointer)&gadLDT); /* Install the accessColors trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTaccessColors, (XtPointer)&gadACT); /* Install the unit type trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTspecifyUnitType, (XtPointer)&gadUTT); } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /* ARGSUSED */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *cePtr; Arg myArgs[1]; ArgList mergedArgs; XtSetArg(myArgs[0] ,XmNlogicalParent, new_w); if (*num_args) mergedArgs = XtMergeArgLists(args, *num_args, myArgs, XtNumber(myArgs)); else mergedArgs = myArgs; cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); (void) XtCreateWidget(XtName(new_w), (*cePtr)->secondaryObjectClass, XtParent(new_w) ? XtParent(new_w) : new_w, mergedArgs, *num_args + 1); if (mergedArgs != myArgs) XtFree( (char *) mergedArgs); } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmGadget request = (XmGadget) rw ; XmGadget gw = (XmGadget) nw; XmBaseClassExt *cePtr; XtInitProc secondaryCreate; XmString tool_tip_string; static XtResource subresources[] = { { XmNtoolTipString, XmCToolTipString, XmRXmString, sizeof(XmString), 0, XmRImmediate, (XtPointer) NULL }, }; if( !XmRepTypeValidValue( XmRID_UNIT_TYPE, gw->gadget.unit_type, (Widget) gw) ) { gw->gadget.unit_type = XmPIXELS; } /* Convert the fields from unit values to pixel values */ _XmGadgetImportArgs( (Widget) gw, args, num_args); _XmGadgetImportSecondaryArgs( (Widget) gw, args, num_args); cePtr = _XmGetBaseClassExtPtr(XtClass(gw), XmQmotif); if ((*cePtr) && (*cePtr)->secondaryObjectClass && (secondaryCreate = (*cePtr)->secondaryObjectCreate)) (*secondaryCreate)( (Widget) request, (Widget) gw, args, num_args); XtGetSubresources(nw, &tool_tip_string, NULL, NULL, subresources, XtNumber(subresources), args, *num_args); XmSetToolTipString(nw, tool_tip_string); gw->gadget.event_mask = 0; gw->gadget.have_traversal = FALSE ; gw->gadget.highlighted = FALSE ; gw->gadget.highlight_drawn = FALSE ; if( (gw->gadget.navigation_type != XmDYNAMIC_DEFAULT_TAB_GROUP) && !XmRepTypeValidValue( XmRID_NAVIGATION_TYPE, gw->gadget.navigation_type, (Widget) gw) ) { gw->gadget.navigation_type = XmNONE ; } _XmNavigInitialize ((Widget) request, (Widget) gw, args, num_args); gw->gadget.have_traversal = FALSE ; /* Check the geometry information for the widget */ if (request->rectangle.width == 0) gw->rectangle.width += gw->gadget.highlight_thickness * 2 + gw->gadget.shadow_thickness * 2; if (request->rectangle.height == 0) gw->rectangle.height += gw->gadget.highlight_thickness * 2 + gw->gadget.shadow_thickness * 2; /* Force the border width to 0 */ gw->rectangle.border_width = 0; return ; } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget w ) { XmGadget g = (XmGadget)w; _XmNavigDestroy(w); #ifdef FIX_1388 _XmToolTipRemove(w); #else _XmToolTipLeave(w, NULL, NULL, NULL); #endif } /************************************************************************ * * SetValues * Perform and updating necessary for a set values call. * ************************************************************************/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmGadget cur = (XmGadget) cw ; XmGadget req = (XmGadget) rw ; XmGadget new_w = (XmGadget) nw ; Boolean returnFlag; if (XtIsSensitive(cw) != XtIsSensitive(nw)) { if (!XtIsSensitive(nw)) { _XmToolTipLeave(nw, NULL, NULL, NULL); } } if (XmGetToolTipString(nw) != XmGetToolTipString(cw)) { XmSetToolTipString(cw, XmGetToolTipString(nw)); } /* CR 7124: XmNlayoutDirection is a CG resource. */ if (cur->gadget.layout_direction != new_w->gadget.layout_direction) { XmeWarning((Widget) new_w, MESSAGE1); new_w->gadget.layout_direction = cur->gadget.layout_direction; } if( cur->gadget.navigation_type != new_w->gadget.navigation_type ) { if( !XmRepTypeValidValue( XmRID_NAVIGATION_TYPE, new_w->gadget.navigation_type, (Widget) new_w) ) { new_w->gadget.navigation_type = cur->gadget.navigation_type ; } } returnFlag = _XmNavigSetValues ((Widget) cur, (Widget) req, (Widget) new_w, args, num_args); /* Validate changed data. */ if( !XmRepTypeValidValue( XmRID_UNIT_TYPE, new_w->gadget.unit_type, (Widget) new_w) ) { new_w->gadget.unit_type = cur->gadget.unit_type; } /* Convert the necessary fields from unit values to pixel values */ _XmGadgetImportArgs((Widget) new_w, args, num_args); /* Check for resize conditions */ if (cur->gadget.shadow_thickness != new_w->gadget.shadow_thickness || cur->gadget.highlight_thickness != new_w->gadget.highlight_thickness) returnFlag = True; /* Force the border width to 0 */ new_w->rectangle.border_width = 0; if( new_w->gadget.highlight_drawn && ( !XtIsSensitive( (Widget) new_w) || ( cur->gadget.highlight_on_enter && !(new_w->gadget.highlight_on_enter) && (_XmGetFocusPolicy( (Widget) new_w) == XmPOINTER))) ) { if( ((XmGadgetClass) XtClass( new_w)) ->gadget_class.border_unhighlight ) { (*(((XmGadgetClass) XtClass( new_w)) ->gadget_class.border_unhighlight))( (Widget) new_w) ; } } /* Return a flag which may indicate that a redraw needs to occur. */ return (returnFlag); } /********************************************************************** * * _XmBuildGadgetResources * Build up the gadget's synthetic resource processing list * by combining the super classes with this class. * **********************************************************************/ void _XmBuildGadgetResources( WidgetClass c ) { XmGadgetClass wc = (XmGadgetClass) c ; XmGadgetClass sc; XmBaseClassExt *classExtPtr; XmExtClassRec *secondaryObjClass; WidgetClass secObjSuperClass; _XmProcessLock(); sc = (XmGadgetClass) wc->rect_class.superclass; _XmInitializeSyntheticResources(wc->gadget_class.syn_resources, wc->gadget_class.num_syn_resources); /* * RectObj has no synthetic resources to incorporate. */ if (sc != (XmGadgetClass) rectObjClass) { _XmBuildResources (&(wc->gadget_class.syn_resources), &(wc->gadget_class.num_syn_resources), sc->gadget_class.syn_resources, sc->gadget_class.num_syn_resources); } classExtPtr = _XmGetBaseClassExtPtr(c, XmQmotif); secondaryObjClass = (XmExtClassRec *) ((*classExtPtr)->secondaryObjectClass); /* * Not all gadgets have secondary objects. */ if (secondaryObjClass == NULL) {_XmProcessUnlock(); return; } secObjSuperClass = secondaryObjClass->object_class.superclass; /* * secondary object resources have already been inited when they are * inherited */ if (!secObjSuperClass->core_class.class_inited) { _XmInitializeSyntheticResources( secondaryObjClass->ext_class.syn_resources, secondaryObjClass->ext_class.num_syn_resources); secObjSuperClass->core_class.class_inited = True; } /* * ExtObject has no synthetic resources to incorporate. */ if (secObjSuperClass != (WidgetClass) xmExtObjectClass) { _XmBuildResources ( &(secondaryObjClass->ext_class.syn_resources), &(secondaryObjClass->ext_class.num_syn_resources), ((XmExtClassRec *)secObjSuperClass) ->ext_class.syn_resources, ((XmExtClassRec *)secObjSuperClass) ->ext_class.num_syn_resources); } _XmProcessUnlock(); } static void BorderHighlight( Widget w ) { XmGadget g ; g = (XmGadget) w ; g->gadget.highlighted = True ; g->gadget.highlight_drawn = True ; if( g->rectangle.width == 0 || g->rectangle.height == 0 || g->gadget.highlight_thickness == 0 ) { return ; } XmeDrawHighlight( XtDisplay( (Widget) g), XtWindow( (Widget) g), ((XmManagerWidget)(g->object.parent))->manager.highlight_GC, g->rectangle.x, g->rectangle.y, g->rectangle.width, g->rectangle.height, g->gadget.highlight_thickness) ; return ; } static void BorderUnhighlight( Widget w ) { XmGadget g = (XmGadget) w ; XmSpecifyUnhighlightTrait UnhighlightT; GC manager_background_GC; g->gadget.highlighted = False ; g->gadget.highlight_drawn = False ; if ( g->rectangle.width == 0 || g->rectangle.height == 0 || g->gadget.highlight_thickness == 0) { return ; } /* If unhighlight trait in parent use specified GC, else just clear area */ if ( XmIsManager(g->object.parent) && ((UnhighlightT=(XmSpecifyUnhighlightTrait)XmeTraitGet((XtPointer) XtClass(g->object.parent), XmQTspecifyUnhighlight)) != NULL) && (UnhighlightT->getUnhighlightGC != NULL)) { /* Get and use parent's specified background GC for unhighlighting */ manager_background_GC = UnhighlightT->getUnhighlightGC( g->object.parent, w); XmeDrawHighlight( XtDisplay( g), XtWindow( g), manager_background_GC, g->rectangle.x, g->rectangle.y, g->rectangle.width, g->rectangle.height, g->gadget.highlight_thickness) ; } else { XmeClearBorder( XtDisplay( g), XtWindow( g), g->rectangle.x, g->rectangle.y, g->rectangle.width, g->rectangle.height, g->gadget.highlight_thickness) ; } return ; } static void FocusChange( Widget wid, XmFocusChange change) { /* Enter/Leave is called only in pointer mode, * Focus in/out only called in explicit mode. */ switch( change ) { case XmENTER: if( !(((XmGadget) wid)->gadget.highlight_on_enter) ) { break ; } /* Drop through. */ case XmFOCUS_IN: if( change == XmFOCUS_IN ) /* Because of drop-though. */ { ((XmGadget) wid)->gadget.have_traversal = TRUE ; } if( ((XmGadgetClass) XtClass( wid)) ->gadget_class.border_highlight ) { (*(((XmGadgetClass) XtClass( wid)) ->gadget_class.border_highlight))( wid) ; } break ; case XmLEAVE: if( !(((XmGadget) wid)->gadget.highlight_on_enter) ) { break ; } /* Drop through. */ case XmFOCUS_OUT: if( change == XmFOCUS_OUT ) /* Because of drop-though. */ { ((XmGadget) wid)->gadget.have_traversal = FALSE ; } if( ((XmGadgetClass) XtClass( wid)) ->gadget_class.border_unhighlight ) { (*(((XmGadgetClass) XtClass( wid)) ->gadget_class.border_unhighlight))( wid) ; } break ; } return ; } static XmNavigability WidgetNavigable( Widget wid) { if( XtIsSensitive(wid) && ((XmGadget) wid)->gadget.traversal_on ) { XmNavigationType nav_type = ((XmGadget) wid)->gadget.navigation_type ; if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !_XmShellIsExclusive( wid)) ) { return XmTAB_NAVIGABLE ; } return XmCONTROL_NAVIGABLE ; } return XmNOT_NAVIGABLE ; } static void GetColors(Widget w, XmAccessColorData color_data) { XmManagerWidget parent = (XmManagerWidget) XtParent(w); color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor; color_data->background = parent->core.background_pixel; color_data->foreground = parent->manager.foreground; color_data->highlight_color = parent->manager.highlight_color; color_data->top_shadow_color = parent->manager.top_shadow_color; color_data->bottom_shadow_color = parent->manager.bottom_shadow_color; } static unsigned char GetUnitType(Widget w) { return ((XmGadget) w)->gadget.unit_type ; } static XmDirection GetDirection(Widget w) { return ((XmGadget)(w))->gadget.layout_direction; } static void GetToolTipString(Widget wid, int resource, /* unused */ XtArgVal * value) { XmString string = XmGetToolTipString (wid); *value = (XtArgVal) string; } XmImportOperator SetToolTipString(Widget wid, int resource, /* unused */ XtArgVal * value) { XmSetToolTipString (wid, (XmString)*value); return XmSYNTHETIC_NONE; } motif-2.3.8/lib/Xm/XpmCrIFrP.c0000644000175000017500000000503712672140200012632 00000000000000/* $XConsortium: XpmCrIFrP.c /main/2 1996/09/20 08:03:45 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrIFrP.c: * * * * XPM library * * Create the XImage related to the given Pixmap. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" void xpmCreateImageFromPixmap(display, pixmap, ximage_return, width, height) Display *display; Pixmap pixmap; XImage **ximage_return; unsigned int *width; unsigned int *height; { unsigned int dum; int dummy; Window win; if (*width == 0 && *height == 0) XGetGeometry(display, pixmap, &win, &dummy, &dummy, width, height, &dum, &dum); *ximage_return = XGetImage(display, pixmap, 0, 0, *width, *height, AllPlanes, ZPixmap); } motif-2.3.8/lib/Xm/XpmCrDatFrP.c0000644000175000017500000000601312672140200013145 00000000000000/* $XConsortium: XpmCrDatFrP.c /main/2 1996/09/20 08:03:10 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * CrDataFP.c: * * * * XPM library * * Scan a pixmap and possibly its mask and create an XPM array * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmCreateDataFromPixmap(display, data_return, pixmap, shapemask, attributes) Display *display; char ***data_return; Pixmap pixmap; Pixmap shapemask; XpmAttributes *attributes; { XImage *ximage = NULL; XImage *shapeimage = NULL; unsigned int width = 0; unsigned int height = 0; int ErrorStatus; /* get geometry */ if (attributes && attributes->valuemask & XpmSize) { width = attributes->width; height = attributes->height; } /* get the ximages */ if (pixmap) xpmCreateImageFromPixmap(display, pixmap, &ximage, &width, &height); if (shapemask) xpmCreateImageFromPixmap(display, shapemask, &shapeimage, &width, &height); /* create the data */ ErrorStatus = XpmCreateDataFromImage(display, data_return, ximage, shapeimage, attributes); /* destroy the ximages */ if (ximage) XDestroyImage(ximage); if (shapeimage) XDestroyImage(shapeimage); return (ErrorStatus); } motif-2.3.8/lib/Xm/ObsoStr.c0000644000175000017500000013130312672140200012447 00000000000000/* $XConsortium: ObsoStr.c /main/5 1995/08/29 11:15:29 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif /*** This file contains the 700 or so globals that were used in 1.2.0 but not in 1.2.1 where they were replaced by a big array */ /* Define _XmConst before including anything, so that the * declarations will be in agreement with the definitions. */ #ifndef _XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define _XmConst const #else #define _XmConst #endif /* __STDC__ */ #endif /* _XmConst */ #include _XmConst char _XmSCAcceleratorText[] = "AcceleratorText" ; _XmConst char _XmSCAccelerator[] = "Accelerator" ; _XmConst char _XmSCAdjustLast[] = "AdjustLast" ; _XmConst char _XmSCAdjustMargin[] = "AdjustMargin" ; _XmConst char _XmSCAlignment[] = "Alignment" ; _XmConst char _XmSCAllowOverlap[] = "AllowOverlap" ; _XmConst char _XmSCAnimationMask[] = "AnimationMask" ; _XmConst char _XmSCAnimationPixmapDepth[] = "AnimationPixmapDepth" ; _XmConst char _XmSCAnimationPixmap[] = "AnimationPixmap" ; _XmConst char _XmSCAnimationStyle[] = "AnimationStyle" ; _XmConst char _XmSCApplyLabelString[] = "ApplyLabelString" ; _XmConst char _XmSCArmCallback[] = "ArmCallback" ; _XmConst char _XmSCArmColor[] = "ArmColor" ; _XmConst char _XmSCArmPixmap[] = "ArmPixmap" ; _XmConst char _XmSCArrowDirection[] = "ArrowDirection" ; _XmConst char _XmSCAtomList[] = "AtomList" ; _XmConst char _XmSCAttachment[] = "Attachment" ; _XmConst char _XmSCAudibleWarning[] = "AudibleWarning" ; _XmConst char _XmSCAutoShowCursorPosition[] = "AutoShowCursorPosition" ; _XmConst char _XmSCAutoUnmanage[] = "AutoUnmanage" ; _XmConst char _XmSCAutomaticSelection[] = "AutomaticSelection" ; _XmConst char _XmSCAvailability[] = "Availability" ; _XmConst char _XmSCBackgroundPixmap[] = "BackgroundPixmap" ; _XmConst char _XmSCBlendModel[] = "BlendModel" ; _XmConst char _XmSCBlinkRate[] = "BlinkRate" ; _XmConst char _XmSCBooleanDimension[] = "BooleanDimension" ; _XmConst char _XmSCBottomShadowColor[] = "BottomShadowColor" ; _XmConst char _XmSCBottomShadowPixmap[] = "BottomShadowPixmap" ; _XmConst char _XmSCButtonAcceleratorText[] = "ButtonAcceleratorText" ; _XmConst char _XmSCButtonAccelerators[] = "ButtonAccelerators" ; _XmConst char _XmSCButtonCount[] = "ButtonCount" ; _XmConst char _XmSCButtonFontList[] = "ButtonFontList" ; _XmConst char _XmSCButtonMnemonicCharSets[] = "ButtonMnemonicCharSets" ; _XmConst char _XmSCButtonMnemonics[] = "ButtonMnemonics" ; _XmConst char _XmSCButtonSet[] = "ButtonSet" ; _XmConst char _XmSCButtonType[] = "ButtonType" ; _XmConst char _XmSCButtons[] = "Buttons" ; _XmConst char _XmSCCallbackProc[] = "CallbackProc" ; _XmConst char _XmSCCancelLabelString[] = "CancelLabelString" ; _XmConst char _XmSCCharSetTable[] = "CharSetTable" ; _XmConst char _XmSCChar[] = "Char" ; _XmConst char _XmSCChildHorizontalAlignment[] = "ChildHorizontalAlignment" ; _XmConst char _XmSCChildHorizontalSpacing[] = "ChildHorizontalSpacing" ; _XmConst char _XmSCChildPlacement[] = "ChildPlacement" ; _XmConst char _XmSCChildType[] = "ChildType" ; _XmConst char _XmSCChildVerticalAlignment[] = "ChildVerticalAlignment" ; _XmConst char _XmSCChildren[] = "Children" ; _XmConst char _XmSCClientData[] = "ClientData" ; _XmConst char _XmSCClipWindow[] = "ClipWindow" ; _XmConst char _XmSCColumns[] = "Columns" ; _XmConst char _XmSCCommandWindowLocation[] = "CommandWindowLocation" ; _XmConst char _XmSCCommandWindow[] = "CommandWindow" ; _XmConst char _XmSCCompoundText[] = "CompoundText" ; _XmConst char _XmSCConvertProc[] = "ConvertProc" ; _XmConst char _XmSCCursorBackground[] = "CursorBackground" ; _XmConst char _XmSCCursorForeground[] = "CursorForeground" ; _XmConst char _XmSCCursorPositionVisible[] = "CursorPositionVisible" ; _XmConst char _XmSCCursorPosition[] = "CursorPosition" ; _XmConst char _XmSCDarkThreshold[] = "DarkThreshold" ; _XmConst char _XmSCDecimalPoints[] = "DecimalPoints" ; _XmConst char _XmSCDefaultButtonShadowThickness[] = "DefaultButtonShadowThickness" ; _XmConst char _XmSCDefaultButtonType[] = "DefaultButtonType" ; _XmConst char _XmSCDefaultFontList[] = "DefaultFontList" ; _XmConst char _XmSCDefaultNoneCursorIcon[] = "DefaultNoneCursorIcon" ; _XmConst char _XmSCDefaultPosition[] = "DefaultPosition" ; _XmConst char _XmSCDefaultValidCursorIcon[] = "DefaultValidCursorIcon" ; _XmConst char _XmSCDefaultInvalidCursorIcon[] = "DefaultInvalidCursorIcon" ; _XmConst char _XmSCDefaultMoveCursorIcon[] = "DefaultMoveCursorIcon" ; _XmConst char _XmSCDefaultCopyCursorIcon[] = "DefaultCopyCursorIcon" ; _XmConst char _XmSCDefaultLinkCursorIcon[] = "DefaultLinkCursorIcon" ; _XmConst char _XmSCDefaultSourceCursorIcon[] = "DefaultSourceCursorIcon" ; _XmConst char _XmSCDeleteResponse[] = "DeleteResponse" ; _XmConst char _XmSCDesktopParent[] = "DesktopParent" ; _XmConst char _XmSCDialogStyle[] = "DialogStyle" ; _XmConst char _XmSCDialogTitle[] = "DialogTitle" ; _XmConst char _XmSCDialogType[] = "DialogType" ; _XmConst char _XmSCDirListItemCount[] = "DirListItemCount" ; _XmConst char _XmSCDirListItems[] = "DirListItems" ; _XmConst char _XmSCDirListLabelString[] = "DirListLabelString" ; _XmConst char _XmSCDirMask[] = "DirMask" ; _XmConst char _XmSCDirSearchProc[] = "DirSearchProc" ; _XmConst char _XmSCDirSpec[] = "DirSpec" ; _XmConst char _XmSCDirectoryValid[] = "DirectoryValid" ; _XmConst char _XmSCDirectory[] = "Directory" ; _XmConst char _XmSCDisarmCallback[] = "DisarmCallback" ; _XmConst char _XmSCDoubleClickInterval[] = "DoubleClickInterval" ; _XmConst char _XmSCDragContextClass[] = "DragContextClass" ; _XmConst char _XmSCDragDropFinishCallback[] = "DragDropFinishCallback" ; _XmConst char _XmSCDragIconClass[] = "DragIconClass" ; _XmConst char _XmSCDragInitiatorProtocolStyle[] = "DragInitiatorProtocolStyle" ; _XmConst char _XmSCDragMotionCallback[] = "DragMotionCallback" ; _XmConst char _XmSCDragOperations[] = "DragOperations" ; _XmConst char _XmSCDragOverMode[] = "DragOverMode" ; _XmConst char _XmSCDragProc[] = "DragProc" ; _XmConst char _XmSCDragReceiverProtocolStyle[] = "DragReceiverProtocolStyle" ; _XmConst char _XmSCDropProc[] = "DropProc" ; _XmConst char _XmSCDropRectangles[] = "DropRectangles" ; _XmConst char _XmSCDropSiteActivity[] = "DropSiteActivity" ; _XmConst char _XmSCDropSiteEnterCallback[] = "DropSiteEnterCallback" ; _XmConst char _XmSCDropSiteLeaveCallback[] = "DropSiteLeaveCallback" ; _XmConst char _XmSCDropSiteManagerClass[] = "DropSiteManagerClass" ; _XmConst char _XmSCDropSiteOperations[] = "DropSiteOperations" ; _XmConst char _XmSCDropSiteType[] = "DropSiteType" ; _XmConst char _XmSCDropStartCallback[] = "DropStartCallback" ; _XmConst char _XmSCDropTransferClass[] = "DropTransferClass" ; _XmConst char _XmSCDropTransfers[] = "DropTransfers" ; _XmConst char _XmSCEditable[] = "Editable" ; _XmConst char _XmSCEntryBorder[] = "EntryBorder" ; _XmConst char _XmSCEntryClass[] = "EntryClass" ; _XmConst char _XmSCExportTargets[] = "ExportTargets" ; _XmConst char _XmSCExposeCallback[] = "ExposeCallback" ; _XmConst char _XmSCExtensionType[] = "ExtensionType" ; _XmConst char _XmSCFileListItemCount[] = "FileListItemCount" ; _XmConst char _XmSCFileListItems[] = "FileListItems" ; _XmConst char _XmSCFileListLabelString[] = "FileListLabelString" ; _XmConst char _XmSCFileSearchProc[] = "FileSearchProc" ; _XmConst char _XmSCFileTypeMask[] = "FileTypeMask" ; _XmConst char _XmSCFillOnArm[] = "FillOnArm" ; _XmConst char _XmSCFillOnSelect[] = "FillOnSelect" ; _XmConst char _XmSCFilterLabelString[] = "FilterLabelString" ; _XmConst char _XmSCFontList[] = "FontList" ; _XmConst char _XmSCForegroundThreshold[] = "ForegroundThreshold" ; _XmConst char _XmSCGadgetPixmap[] = "GadgetPixmap" ; _XmConst char _XmSCHelpLabelString[] = "HelpLabelString" ; _XmConst char _XmSCHighlightColor[] = "HighlightColor" ; _XmConst char _XmSCHighlightOnEnter[] = "HighlightOnEnter" ; _XmConst char _XmSCHighlightPixmap[] = "HighlightPixmap" ; _XmConst char _XmSCHighlightThickness[] = "HighlightThickness" ; _XmConst char _XmSCHorizontalDimension[] = "HorizontalDimension" ; _XmConst char _XmSCHorizontalFontUnit[] = "HorizontalFontUnit" ; _XmConst char _XmSCHorizontalInt[] = "HorizontalInt" ; _XmConst char _XmSCHorizontalPosition[] = "HorizontalPosition" ; _XmConst char _XmSCHorizontalScrollBar[] = "HorizontalScrollBar" ; _XmConst char _XmSCHot[] = "Hot" ; _XmConst char _XmSCICCHandle[] = "ICCHandle" ; _XmConst char _XmSCIconAttachment[] = "IconAttachment" ; _XmConst char _XmSCImportTargets[] = "ImportTargets" ; _XmConst char _XmSCIncrement[] = "Increment" ; _XmConst char _XmSCIncremental[] = "Incremental" ; _XmConst char _XmSCIndicatorOn[] = "IndicatorOn" ; _XmConst char _XmSCIndicatorSize[] = "IndicatorSize" ; _XmConst char _XmSCIndicatorType[] = "IndicatorType" ; _XmConst char _XmSCInitialDelay[] = "InitialDelay" ; _XmConst char _XmSCInitialFocus[] = "InitialFocus" ; _XmConst char _XmSCInputCreate[] = "InputCreate" ; _XmConst char _XmSCInputMethod[] = "InputMethod" ; _XmConst char _XmSCInvalidCursorForeground[] = "InvalidCursorForeground" ; _XmConst char _XmSCIsAligned[] = "IsAligned" ; _XmConst char _XmSCIsHomogeneous[] = "IsHomogeneous" ; _XmConst char _XmSCItemCount[] = "ItemCount" ; _XmConst char _XmSCItems[] = "Items" ; _XmConst char _XmSCKeySymTable[] = "KeySymTable" ; _XmConst char _XmSCKeySym[] = "KeySym" ; _XmConst char _XmSCKeyboardFocusPolicy[] = "KeyboardFocusPolicy" ; _XmConst char _XmSCLabelFontList[] = "LabelFontList" ; _XmConst char _XmSCLabelInsensitivePixmap[] = "LabelInsensitivePixmap" ; _XmConst char _XmSCLabelPixmap[] = "LabelPixmap" ; _XmConst char _XmSCLabelString[] = "LabelString" ; _XmConst char _XmSCLabelType[] = "LabelType" ; _XmConst char _XmSCLightThreshold[] = "LightThreshold" ; _XmConst char _XmSCListLabelString[] = "ListLabelString" ; _XmConst char _XmSCListMarginHeight[] = "ListMarginHeight" ; _XmConst char _XmSCListMarginWidth[] = "ListMarginWidth" ; _XmConst char _XmSCListSizePolicy[] = "ListSizePolicy" ; _XmConst char _XmSCListSpacing[] = "ListSpacing" ; _XmConst char _XmSCListUpdated[] = "ListUpdated" ; _XmConst char _XmSCLogicalParent[] = "LogicalParent" ; _XmConst char _XmSCMainWindowMarginHeight[] = "MainWindowMarginHeight" ; _XmConst char _XmSCMainWindowMarginWidth[] = "MainWindowMarginWidth" ; _XmConst char _XmSCManBottomShadowPixmap[] = "ManBottomShadowPixmap" ; _XmConst char _XmSCManForegroundPixmap[] = "ManForegroundPixmap" ; _XmConst char _XmSCManHighlightPixmap[] = "ManHighlightPixmap" ; _XmConst char _XmSCManTopShadowPixmap[] = "ManTopShadowPixmap" ; _XmConst char _XmSCMappingDelay[] = "MappingDelay" ; _XmConst char _XmSCMarginBottom[] = "MarginBottom" ; _XmConst char _XmSCMarginHeight[] = "MarginHeight" ; _XmConst char _XmSCMarginLeft[] = "MarginLeft" ; _XmConst char _XmSCMarginRight[] = "MarginRight" ; _XmConst char _XmSCMarginTop[] = "MarginTop" ; _XmConst char _XmSCMarginWidth[] = "MarginWidth" ; _XmConst char _XmSCMask[] = "Mask" ; _XmConst char _XmSCMaxItems[] = "MaxItems" ; _XmConst char _XmSCMaxLength[] = "MaxLength" ; _XmConst char _XmSCMaxValue[] = "MaxValue" ; _XmConst char _XmSCMaximum[] = "Maximum" ; _XmConst char _XmSCMenuBar[] = "MenuBar" ; _XmConst char _XmSCMenuPost[] = "MenuPost" ; _XmConst char _XmSCMenuWidget[] = "MenuWidget" ; _XmConst char _XmSCMessageProc[] = "MessageProc" ; _XmConst char _XmSCMessageWindow[] = "MessageWindow" ; _XmConst char _XmSCMinimizeButtons[] = "MinimizeButtons" ; _XmConst char _XmSCMinimum[] = "Minimum" ; _XmConst char _XmSCMnemonicCharSet[] = "MnemonicCharSet" ; _XmConst char _XmSCMnemonic[] = "Mnemonic" ; _XmConst char _XmSCMoveOpaque[] = "MoveOpaque" ; _XmConst char _XmSCMultiClick[] = "MultiClick" ; _XmConst char _XmSCMustMatch[] = "MustMatch" ; _XmConst char _XmSCMwmDecorations[] = "MwmDecorations" ; _XmConst char _XmSCMwmFunctions[] = "MwmFunctions" ; _XmConst char _XmSCMwmInputMode[] = "MwmInputMode" ; _XmConst char _XmSCMwmMenu[] = "MwmMenu" ; _XmConst char _XmSCMwmMessages[] = "MwmMessages" ; _XmConst char _XmSCNavigationType[] = "NavigationType" ; _XmConst char _XmSCNeedsMotion[] = "NeedsMotion" ; _XmConst char _XmSCNoMatchString[] = "NoMatchString" ; _XmConst char _XmSCNoResize[] = "NoResize" ; _XmConst char _XmSCNoneCursorForeground[] = "NoneCursorForeground" ; _XmConst char _XmSCNotifyProc[] = "NotifyProc" ; _XmConst char _XmSCNumChildren[] = "NumChildren" ; _XmConst char _XmSCNumColumns[] = "NumColumns" ; _XmConst char _XmSCNumDropRectangles[] = "NumDropRectangles" ; _XmConst char _XmSCNumDropTransfers[] = "NumDropTransfers" ; _XmConst char _XmSCNumExportTargets[] = "NumExportTargets" ; _XmConst char _XmSCNumImportTargets[] = "NumImportTargets" ; _XmConst char _XmSCOffset[] = "Offset" ; _XmConst char _XmSCOkLabelString[] = "OkLabelString" ; _XmConst char _XmSCOperationChangedCallback[] = "OperationChangedCallback" ; _XmConst char _XmSCOperationCursorIcon[] = "OperationCursorIcon" ; _XmConst char _XmSCOptionLabel[] = "OptionLabel" ; _XmConst char _XmSCOptionMnemonic[] = "OptionMnemonic" ; _XmConst char _XmSCOutputCreate[] = "OutputCreate" ; _XmConst char _XmSCPacking[] = "Packing" ; _XmConst char _XmSCPageIncrement[] = "PageIncrement" ; _XmConst char _XmSCPaneMaximum[] = "PaneMaximum" ; _XmConst char _XmSCPaneMinimum[] = "PaneMinimum" ; _XmConst char _XmSCPattern[] = "Pattern" ; _XmConst char _XmSCPendingDelete[] = "PendingDelete" ; _XmConst char _XmSCPopupEnabled[] = "PopupEnabled" ; _XmConst char _XmSCPositionIndex[] = "PositionIndex" ; _XmConst char _XmSCPostFromButton[] = "PostFromButton" ; _XmConst char _XmSCPostFromCount[] = "PostFromCount" ; _XmConst char _XmSCPostFromList[] = "PostFromList" ; _XmConst char _XmSCPreeditType[] = "PreeditType" ; _XmConst char _XmSCPrimForegroundPixmap[] = "PrimForegroundPixmap" ; _XmConst char _XmSCProc[] = "Proc" ; _XmConst char _XmSCProcessingDirection[] = "ProcessingDirection" ; _XmConst char _XmSCPromptString[] = "PromptString" ; _XmConst char _XmSCProtocolCallback[] = "ProtocolCallback" ; _XmConst char _XmSCPushButtonEnabled[] = "PushButtonEnabled" ; _XmConst char _XmSCQualifySearchDataProc[] = "QualifySearchDataProc" ; _XmConst char _XmSCRadioAlwaysOne[] = "RadioAlwaysOne" ; _XmConst char _XmSCRadioBehavior[] = "RadioBehavior" ; _XmConst char _XmSCRecomputeSize[] = "RecomputeSize" ; _XmConst char _XmSCRectangleList[] = "RectangleList" ; _XmConst char _XmSCRectangles[] = "Rectangles" ; _XmConst char _XmSCRepeatDelay[] = "RepeatDelay" ; _XmConst char _XmSCResizeCallback[] = "ResizeCallback" ; _XmConst char _XmSCResizeHeight[] = "ResizeHeight" ; _XmConst char _XmSCResizePolicy[] = "ResizePolicy" ; _XmConst char _XmSCResizeWidth[] = "ResizeWidth" ; _XmConst char _XmSCRowColumnType[] = "RowColumnType" ; _XmConst char _XmSCRows[] = "Rows" ; _XmConst char _XmSCRubberPositioning[] = "RubberPositioning" ; _XmConst char _XmSCSashHeight[] = "SashHeight" ; _XmConst char _XmSCSashIndent[] = "SashIndent" ; _XmConst char _XmSCSashWidth[] = "SashWidth" ; _XmConst char _XmSCScaleHeight[] = "ScaleHeight" ; _XmConst char _XmSCScaleMultiple[] = "ScaleMultiple" ; _XmConst char _XmSCScaleWidth[] = "ScaleWidth" ; _XmConst char _XmSCScrollBarDisplayPolicy[] = "ScrollBarDisplayPolicy" ; _XmConst char _XmSCScrollBarPlacement[] = "ScrollBarPlacement" ; _XmConst char _XmSCScrollSide[] = "ScrollSide" ; _XmConst char _XmSCScroll[] = "Scroll" ; _XmConst char _XmSCScrolledWindowMarginHeight[] = "ScrolledWindowMarginHeight" ; _XmConst char _XmSCScrolledWindowMarginWidth[] = "ScrolledWindowMarginWidth" ; _XmConst char _XmSCScrollingPolicy[] = "ScrollingPolicy" ; _XmConst char _XmSCSelectColor[] = "SelectColor" ; _XmConst char _XmSCSelectInsensitivePixmap[] = "SelectInsensitivePixmap" ; _XmConst char _XmSCSelectPixmap[] = "SelectPixmap" ; _XmConst char _XmSCSelectThreshold[] = "SelectThreshold" ; _XmConst char _XmSCSelectedItemCount[] = "SelectedItemCount" ; _XmConst char _XmSCSelectedItems[] = "SelectedItems" ; _XmConst char _XmSCSelectionArrayCount[] = "SelectionArrayCount" ; _XmConst char _XmSCSelectionLabelString[] = "SelectionLabelString" ; _XmConst char _XmSCSelectionPolicy[] = "SelectionPolicy" ; _XmConst char _XmSCSelectionType[] = "SelectionType" ; _XmConst char _XmSCSeparatorOn[] = "SeparatorOn" ; _XmConst char _XmSCSeparatorType[] = "SeparatorType" ; _XmConst char _XmSCSet[] = "Set" ; _XmConst char _XmSCShadowThickness[] = "ShadowThickness" ; _XmConst char _XmSCShadowType[] = "ShadowType" ; _XmConst char _XmSCShellHorizDim[] = "ShellHorizDim" ; _XmConst char _XmSCShellHorizPos[] = "ShellHorizPos" ; _XmConst char _XmSCShellUnitType[] = "ShellUnitType" ; _XmConst char _XmSCShellVertDim[] = "ShellVertDim" ; _XmConst char _XmSCShellVertPos[] = "ShellVertPos" ; _XmConst char _XmSCShowArrows[] = "ShowArrows" ; _XmConst char _XmSCShowAsDefault[] = "ShowAsDefault" ; _XmConst char _XmSCShowSeparator[] = "ShowSeparator" ; _XmConst char _XmSCShowValue[] = "ShowValue" ; _XmConst char _XmSCSimpleCheckBox[] = "SimpleCheckBox" ; _XmConst char _XmSCSimpleMenuBar[] = "SimpleMenuBar" ; _XmConst char _XmSCSimpleOptionMenu[] = "SimpleOptionMenu" ; _XmConst char _XmSCSimplePopupMenu[] = "SimplePopupMenu" ; _XmConst char _XmSCSimplePulldownMenu[] = "SimplePulldownMenu" ; _XmConst char _XmSCSimpleRadioBox[] = "SimpleRadioBox" ; _XmConst char _XmSCSizePolicy[] = "SizePolicy" ; _XmConst char _XmSCSliderSize[] = "SliderSize" ; _XmConst char _XmSCSourceCursorIcon[] = "SourceCursorIcon" ; _XmConst char _XmSCSourceIsExternal[] = "SourceIsExternal" ; _XmConst char _XmSCSourcePixmapIcon[] = "SourcePixmapIcon" ; _XmConst char _XmSCSourceWidget[] = "SourceWidget" ; _XmConst char _XmSCSourceWindow[] = "SourceWindow" ; _XmConst char _XmSCSource[] = "Source" ; _XmConst char _XmSCSpacing[] = "Spacing" ; _XmConst char _XmSCStartTime[] = "StartTime" ; _XmConst char _XmSCStateCursorIcon[] = "StateCursorIcon" ; _XmConst char _XmSCStringDirection[] = "StringDirection" ; _XmConst char _XmSCTearOffModel[] = "TearOffModel" ; _XmConst char _XmSCTextFontList[] = "TextFontList" ; _XmConst char _XmSCTextString[] = "TextString" ; _XmConst char _XmSCTextValue[] = "TextValue" ; _XmConst char _XmSCTitleString[] = "TitleString" ; _XmConst char _XmSCTopCharacter[] = "TopCharacter" ; _XmConst char _XmSCTopItemPosition[] = "TopItemPosition" ; _XmConst char _XmSCTopLevelEnterCallback[] = "TopLevelEnterCallback" ; _XmConst char _XmSCTopLevelLeaveCallback[] = "TopLevelLeaveCallback" ; _XmConst char _XmSCTopShadowColor[] = "TopShadowColor" ; _XmConst char _XmSCTopShadowPixmap[] = "TopShadowPixmap" ; _XmConst char _XmSCTransferProc[] = "TransferProc" ; _XmConst char _XmSCTransferStatus[] = "TransferStatus" ; _XmConst char _XmSCTraversalOn[] = "TraversalOn" ; _XmConst char _XmSCTraversalType[] = "TraversalType" ; _XmConst char _XmSCTreeUpdateProc[] = "TreeUpdateProc" ; _XmConst char _XmSCTroughColor[] = "TroughColor" ; _XmConst char _XmSCUnitType[] = "UnitType" ; _XmConst char _XmSCUnpostBehavior[] = "UnpostBehavior" ; _XmConst char _XmSCUnselectPixmap[] = "UnselectPixmap" ; _XmConst char _XmSCUpdateSliderSize[] = "UpdateSliderSize" ; _XmConst char _XmSCUseAsyncGeometry[] = "UseAsyncGeometry" ; _XmConst char _XmSCUserData[] = "UserData" ; _XmConst char _XmSCValidCursorForeground[] = "ValidCursorForeground" ; _XmConst char _XmSCValueChangedCallback[] = "ValueChangedCallback" ; _XmConst char _XmSCValueWcs[] = "ValueWcs" ; _XmConst char _XmSCVerifyBell[] = "VerifyBell" ; _XmConst char _XmSCVerticalAlignment[] = "VerticalAlignment" ; _XmConst char _XmSCVerticalDimension[] = "VerticalDimension" ; _XmConst char _XmSCVerticalFontUnit[] = "VerticalFontUnit" ; _XmConst char _XmSCVerticalInt[] = "VerticalInt" ; _XmConst char _XmSCVerticalPosition[] = "VerticalPosition" ; _XmConst char _XmSCVerticalScrollBar[] = "VerticalScrollBar" ; _XmConst char _XmSCVirtualBinding[] = "VirtualBinding" ; _XmConst char _XmSCVisibleItemCount[] = "VisibleItemCount" ; _XmConst char _XmSCVisibleWhenOff[] = "VisibleWhenOff" ; _XmConst char _XmSCVisualPolicy[] = "VisualPolicy" ; _XmConst char _XmSCWhichButton[] = "WhichButton" ; _XmConst char _XmSCWordWrap[] = "WordWrap" ; _XmConst char _XmSCWorkWindow[] = "WorkWindow" ; _XmConst char _XmSCXmBackgroundPixmap[] = "XmBackgroundPixmap" ; _XmConst char _XmSCXmStringCharSet[] = "XmStringCharSet" ; _XmConst char _XmSCXmStringTable[] = "XmStringTable" ; _XmConst char _XmSCXmString[] = "XmString" ; _XmConst char _XmSacceleratorText[] = "acceleratorText" ; _XmConst char _XmSaccelerator[] = "accelerator" ; _XmConst char _XmSactivateCallback[] = "activateCallback" ; _XmConst char _XmSadjustLast[] = "adjustLast" ; _XmConst char _XmSadjustMargin[] = "adjustMargin" ; _XmConst char _XmSalignment[] = "alignment" ; _XmConst char _XmSallowOverlap[] = "allowOverlap" ; _XmConst char _XmSallowResize[] = "allowResize" ; _XmConst char _XmSanimationMask[] = "animationMask" ; _XmConst char _XmSanimationPixmapDepth[] = "animationPixmapDepth" ; _XmConst char _XmSanimationPixmap[] = "animationPixmap" ; _XmConst char _XmSanimationStyle[] = "animationStyle" ; _XmConst char _XmSapplyCallback[] = "applyCallback" ; _XmConst char _XmSapplyLabelString[] = "applyLabelString" ; _XmConst char _XmSarmCallback[] = "armCallback" ; _XmConst char _XmSarmColor[] = "armColor" ; _XmConst char _XmSarmPixmap[] = "armPixmap" ; _XmConst char _XmSarrowDirection[] = "arrowDirection" ; _XmConst char _XmSattachment[] = "attachment" ; _XmConst char _XmSaudibleWarning[] = "audibleWarning" ; _XmConst char _XmSautoShowCursorPosition[] = "autoShowCursorPosition" ; _XmConst char _XmSautoUnmanage[] = "autoUnmanage" ; _XmConst char _XmSautomaticSelection[] = "automaticSelection" ; _XmConst char _XmSavailability[] = "availability" ; _XmConst char _XmSblendModel[] = "blendModel" ; _XmConst char _XmSblinkRate[] = "blinkRate" ; _XmConst char _XmSbottomAttachment[] = "bottomAttachment" ; _XmConst char _XmSbottomOffset[] = "bottomOffset" ; _XmConst char _XmSbottomPosition[] = "bottomPosition" ; _XmConst char _XmSbottomShadowColor[] = "bottomShadowColor" ; _XmConst char _XmSbottomShadowPixmap[] = "bottomShadowPixmap" ; _XmConst char _XmSbottomWidget[] = "bottomWidget" ; _XmConst char _XmSbrowseSelectionCallback[] = "browseSelectionCallback" ; _XmConst char _XmSbuttonAcceleratorText[] = "buttonAcceleratorText" ; _XmConst char _XmSbuttonAccelerators[] = "buttonAccelerators" ; _XmConst char _XmSbuttonCount[] = "buttonCount" ; _XmConst char _XmSbuttonFontList[] = "buttonFontList" ; _XmConst char _XmSbuttonMnemonicCharSets[] = "buttonMnemonicCharSets" ; _XmConst char _XmSbuttonMnemonics[] = "buttonMnemonics" ; _XmConst char _XmSbuttonSet[] = "buttonSet" ; _XmConst char _XmSbuttonType[] = "buttonType" ; _XmConst char _XmSbuttons[] = "buttons" ; _XmConst char _XmScancelButton[] = "cancelButton" ; _XmConst char _XmScancelCallback[] = "cancelCallback" ; _XmConst char _XmScancelLabelString[] = "cancelLabelString" ; _XmConst char _XmScascadeButton[] = "cascadeButton" ; _XmConst char _XmScascadePixmap[] = "cascadePixmap" ; _XmConst char _XmScascadingCallback[] = "cascadingCallback" ; _XmConst char _XmScheckButton[] = "checkButton" ; _XmConst char _XmSchildHorizontalAlignment[] = "childHorizontalAlignment" ; _XmConst char _XmSchildHorizontalSpacing[] = "childHorizontalSpacing" ; _XmConst char _XmSchildPlacement[] = "childPlacement" ; _XmConst char _XmSchildPosition[] = "childPosition" ; _XmConst char _XmSchildType[] = "childType" ; _XmConst char _XmSchildVerticalAlignment[] = "childVerticalAlignment" ; _XmConst char _XmSclientData[] = "clientData" ; _XmConst char _XmSclipWindow[] = "clipWindow" ; _XmConst char _XmScolumns[] = "columns" ; _XmConst char _XmScommandChangedCallback[] = "commandChangedCallback" ; _XmConst char _XmScommandEnteredCallback[] = "commandEnteredCallback" ; _XmConst char _XmScommandWindowLocation[] = "commandWindowLocation" ; _XmConst char _XmScommandWindow[] = "commandWindow" ; _XmConst char _XmScommand[] = "command" ; _XmConst char _XmSconvertProc[] = "convertProc" ; _XmConst char _XmScursorBackground[] = "cursorBackground" ; _XmConst char _XmScursorForeground[] = "cursorForeground" ; _XmConst char _XmScursorPositionVisible[] = "cursorPositionVisible" ; _XmConst char _XmScursorPosition[] = "cursorPosition" ; _XmConst char _XmSdarkThreshold[] = "darkThreshold" ; _XmConst char _XmSdecimalPoints[] = "decimalPoints" ; _XmConst char _XmSdecrementCallback[] = "decrementCallback" ; _XmConst char _XmSdefaultActionCallback[] = "defaultActionCallback" ; _XmConst char _XmSdefaultButtonShadowThickness[] = "defaultButtonShadowThickness" ; _XmConst char _XmSdefaultButtonType[] = "defaultButtonType" ; _XmConst char _XmSdefaultButton[] = "defaultButton" ; _XmConst char _XmSdefaultFontList[] = "defaultFontList" ; _XmConst char _XmSdefaultNoneCursorIcon[] = "defaultNoneCursorIcon" ; _XmConst char _XmSdefaultPosition[] = "defaultPosition" ; _XmConst char _XmSdefaultValidCursorIcon[] = "defaultValidCursorIcon" ; _XmConst char _XmSdefaultInvalidCursorIcon[] = "defaultInvalidCursorIcon" ; _XmConst char _XmSdefaultMoveCursorIcon[] = "defaultMoveCursorIcon" ; _XmConst char _XmSdefaultCopyCursorIcon[] = "defaultCopyCursorIcon" ; _XmConst char _XmSdefaultLinkCursorIcon[] = "defaultLinkCursorIcon" ; _XmConst char _XmSdefaultSourceCursorIcon[] = "defaultSourceCursorIcon" ; _XmConst char _XmSdeleteResponse[] = "deleteResponse" ; _XmConst char _XmSdesktopParent[] = "desktopParent" ; _XmConst char _XmSdialogStyle[] = "dialogStyle" ; _XmConst char _XmSdialogTitle[] = "dialogTitle" ; _XmConst char _XmSdialogType[] = "dialogType" ; _XmConst char _XmSdirListItemCount[] = "dirListItemCount" ; _XmConst char _XmSdirListItems[] = "dirListItems" ; _XmConst char _XmSdirListLabelString[] = "dirListLabelString" ; _XmConst char _XmSdirMask[] = "dirMask" ; _XmConst char _XmSdirSearchProc[] = "dirSearchProc" ; _XmConst char _XmSdirSpec[] = "dirSpec" ; _XmConst char _XmSdirectoryValid[] = "directoryValid" ; _XmConst char _XmSdirectory[] = "directory" ; _XmConst char _XmSdisarmCallback[] = "disarmCallback" ; _XmConst char _XmSdoubleClickInterval[] = "doubleClickInterval" ; _XmConst char _XmSdoubleSeparator[] = "doubleSeparator" ; _XmConst char _XmSdragCallback[] = "dragCallback" ; _XmConst char _XmSdragContextClass[] = "dragContextClass" ; _XmConst char _XmSdragDropFinishCallback[] = "dragDropFinishCallback" ; _XmConst char _XmSdragIconClass[] = "dragIconClass" ; _XmConst char _XmSdragInitiatorProtocolStyle[] = "dragInitiatorProtocolStyle" ; _XmConst char _XmSdragMotionCallback[] = "dragMotionCallback" ; _XmConst char _XmSdragOperations[] = "dragOperations" ; _XmConst char _XmSdragOverMode[] = "dragOverMode" ; _XmConst char _XmSdragProc[] = "dragProc" ; _XmConst char _XmSdragReceiverProtocolStyle[] = "dragReceiverProtocolStyle" ; _XmConst char _XmSdropFinishCallback[] = "dropFinishCallback" ; _XmConst char _XmSdropProc[] = "dropProc" ; _XmConst char _XmSdropRectangles[] = "dropRectangles" ; _XmConst char _XmSdropSiteActivity[] = "dropSiteActivity" ; _XmConst char _XmSdropSiteEnterCallback[] = "dropSiteEnterCallback" ; _XmConst char _XmSdropSiteLeaveCallback[] = "dropSiteLeaveCallback" ; _XmConst char _XmSdropSiteManagerClass[] = "dropSiteManagerClass" ; _XmConst char _XmSdropSiteOperations[] = "dropSiteOperations" ; _XmConst char _XmSdropSiteType[] = "dropSiteType" ; _XmConst char _XmSdropStartCallback[] = "dropStartCallback" ; _XmConst char _XmSdropTransferClass[] = "dropTransferClass" ; _XmConst char _XmSdropTransfers[] = "dropTransfers" ; _XmConst char _XmSeditMode[] = "editMode" ; _XmConst char _XmSeditable[] = "editable" ; _XmConst char _XmSentryAlignment[] = "entryAlignment" ; _XmConst char _XmSentryBorder[] = "entryBorder" ; _XmConst char _XmSentryCallback[] = "entryCallback" ; _XmConst char _XmSentryClass[] = "entryClass" ; _XmConst char _XmSentryVerticalAlignment[] = "entryVerticalAlignment" ; _XmConst char _XmSexportTargets[] = "exportTargets" ; _XmConst char _XmSexposeCallback[] = "exposeCallback" ; _XmConst char _XmSextendedSelectionCallback[] = "extendedSelectionCallback" ; _XmConst char _XmSextensionType[] = "extensionType" ; _XmConst char _XmSfileListItemCount[] = "fileListItemCount" ; _XmConst char _XmSfileListItems[] = "fileListItems" ; _XmConst char _XmSfileListLabelString[] = "fileListLabelString" ; _XmConst char _XmSfileSearchProc[] = "fileSearchProc" ; _XmConst char _XmSfileTypeMask[] = "fileTypeMask" ; _XmConst char _XmSfillOnArm[] = "fillOnArm" ; _XmConst char _XmSfillOnSelect[] = "fillOnSelect" ; _XmConst char _XmSfilterLabelString[] = "filterLabelString" ; _XmConst char _XmSfocusCallback[] = "focusCallback" ; _XmConst char _XmSfocusMovedCallback[] = "focusMovedCallback" ; _XmConst char _XmSfocusPolicyChanged[] = "focusPolicyChanged" ; _XmConst char _XmSfontList[] = "fontList" ; _XmConst char _XmSforegroundThreshold[] = "foregroundThreshold" ; _XmConst char _XmSfractionBase[] = "fractionBase" ; _XmConst char _XmSgainPrimaryCallback[] = "gainPrimaryCallback" ; _XmConst char _XmShelpCallback[] = "helpCallback" ; _XmConst char _XmShelpLabelString[] = "helpLabelString" ; _XmConst char _XmShighlightColor[] = "highlightColor" ; _XmConst char _XmShighlightOnEnter[] = "highlightOnEnter" ; _XmConst char _XmShighlightPixmap[] = "highlightPixmap" ; _XmConst char _XmShighlightThickness[] = "highlightThickness" ; _XmConst char _XmShistoryItemCount[] = "historyItemCount" ; _XmConst char _XmShistoryItems[] = "historyItems" ; _XmConst char _XmShistoryMaxItems[] = "historyMaxItems" ; _XmConst char _XmShistoryVisibleItemCount[] = "historyVisibleItemCount" ; _XmConst char _XmShorizontalFontUnit[] = "horizontalFontUnit" ; _XmConst char _XmShorizontalScrollBar[] = "horizontalScrollBar" ; _XmConst char _XmShorizontalSpacing[] = "horizontalSpacing" ; _XmConst char _XmShotX[] = "hotX" ; _XmConst char _XmShotY[] = "hotY" ; _XmConst char _XmSiccHandle[] = "iccHandle" ; _XmConst char _XmSimportTargets[] = "importTargets" ; _XmConst char _XmSincrementCallback[] = "incrementCallback" ; _XmConst char _XmSincrement[] = "increment" ; _XmConst char _XmSincremental[] = "incremental" ; _XmConst char _XmSindicatorOn[] = "indicatorOn" ; _XmConst char _XmSindicatorSize[] = "indicatorSize" ; _XmConst char _XmSindicatorType[] = "indicatorType" ; _XmConst char _XmSinitialDelay[] = "initialDelay" ; _XmConst char _XmSinitialFocus[] = "initialFocus" ; _XmConst char _XmSinputCallback[] = "inputCallback" ; _XmConst char _XmSinputCreate[] = "inputCreate" ; _XmConst char _XmSinputMethod[] = "inputMethod" ; _XmConst char _XmSinvalidCursorForeground[] = "invalidCursorForeground" ; _XmConst char _XmSisAligned[] = "isAligned" ; _XmConst char _XmSisHomogeneous[] = "isHomogeneous" ; _XmConst char _XmSitemCount[] = "itemCount" ; _XmConst char _XmSitems[] = "items" ; _XmConst char _XmSkeyboardFocusPolicy[] = "keyboardFocusPolicy" ; _XmConst char _XmSlabelFontList[] = "labelFontList" ; _XmConst char _XmSlabelInsensitivePixmap[] = "labelInsensitivePixmap" ; _XmConst char _XmSlabelPixmap[] = "labelPixmap" ; _XmConst char _XmSlabelString[] = "labelString" ; _XmConst char _XmSlabelType[] = "labelType" ; _XmConst char _XmSleftAttachment[] = "leftAttachment" ; _XmConst char _XmSleftOffset[] = "leftOffset" ; _XmConst char _XmSleftPosition[] = "leftPosition" ; _XmConst char _XmSleftWidget[] = "leftWidget" ; _XmConst char _XmSlightThreshold[] = "lightThreshold" ; _XmConst char _XmSlistItemCount[] = "listItemCount" ; _XmConst char _XmSlistItems[] = "listItems" ; _XmConst char _XmSlistLabelString[] = "listLabelString" ; _XmConst char _XmSlistMarginHeight[] = "listMarginHeight" ; _XmConst char _XmSlistMarginWidth[] = "listMarginWidth" ; _XmConst char _XmSlistSizePolicy[] = "listSizePolicy" ; _XmConst char _XmSlistSpacing[] = "listSpacing" ; _XmConst char _XmSlistUpdated[] = "listUpdated" ; _XmConst char _XmSlistVisibleItemCount[] = "listVisibleItemCount" ; _XmConst char _XmSlogicalParent[] = "logicalParent" ; _XmConst char _XmSlosePrimaryCallback[] = "losePrimaryCallback" ; _XmConst char _XmSlosingFocusCallback[] = "losingFocusCallback" ; _XmConst char _XmSmainWindowMarginHeight[] = "mainWindowMarginHeight" ; _XmConst char _XmSmainWindowMarginWidth[] = "mainWindowMarginWidth" ; _XmConst char _XmSmapCallback[] = "mapCallback" ; _XmConst char _XmSmappingDelay[] = "mappingDelay" ; _XmConst char _XmSmarginBottom[] = "marginBottom" ; _XmConst char _XmSmarginHeight[] = "marginHeight" ; _XmConst char _XmSmarginLeft[] = "marginLeft" ; _XmConst char _XmSmarginRight[] = "marginRight" ; _XmConst char _XmSmarginTop[] = "marginTop" ; _XmConst char _XmSmarginWidth[] = "marginWidth" ; _XmConst char _XmSmargin[] = "margin" ; _XmConst char _XmSmask[] = "mask" ; _XmConst char _XmSmaxLength[] = "maxLength" ; _XmConst char _XmSmaximum[] = "maximum" ; _XmConst char _XmSmenuAccelerator[] = "menuAccelerator" ; _XmConst char _XmSmenuBar[] = "menuBar" ; _XmConst char _XmSmenuCursor[] = "menuCursor" ; _XmConst char _XmSmenuHelpWidget[] = "menuHelpWidget" ; _XmConst char _XmSmenuHistory[] = "menuHistory" ; _XmConst char _XmSmenuPost[] = "menuPost" ; _XmConst char _XmSmessageAlignment[] = "messageAlignment" ; _XmConst char _XmSmessageProc[] = "messageProc" ; _XmConst char _XmSmessageString[] = "messageString" ; _XmConst char _XmSmessageWindow[] = "messageWindow" ; _XmConst char _XmSminimizeButtons[] = "minimizeButtons" ; _XmConst char _XmSminimum[] = "minimum" ; _XmConst char _XmSmnemonicCharSet[] = "mnemonicCharSet" ; _XmConst char _XmSmnemonic[] = "mnemonic" ; _XmConst char _XmSmodifyVerifyCallbackWcs[] = "modifyVerifyCallbackWcs" ; _XmConst char _XmSmodifyVerifyCallback[] = "modifyVerifyCallback" ; _XmConst char _XmSmotionVerifyCallback[] = "motionVerifyCallback" ; _XmConst char _XmSmoveOpaque[] = "moveOpaque" ; _XmConst char _XmSmultiClick[] = "multiClick" ; _XmConst char _XmSmultipleSelectionCallback[] = "multipleSelectionCallback" ; _XmConst char _XmSmustMatch[] = "mustMatch" ; _XmConst char _XmSmwmDecorations[] = "mwmDecorations" ; _XmConst char _XmSmwmFunctions[] = "mwmFunctions" ; _XmConst char _XmSmwmInputMode[] = "mwmInputMode" ; _XmConst char _XmSmwmMenu[] = "mwmMenu" ; _XmConst char _XmSmwmMessages[] = "mwmMessages" ; _XmConst char _XmSnavigationType[] = "navigationType" ; _XmConst char _XmSneedsMotion[] = "needsMotion" ; _XmConst char _XmSnoMatchCallback[] = "noMatchCallback" ; _XmConst char _XmSnoMatchString[] = "noMatchString" ; _XmConst char _XmSnoResize[] = "noResize" ; _XmConst char _XmSnoneCursorForeground[] = "noneCursorForeground" ; _XmConst char _XmSnotifyProc[] = "notifyProc" ; _XmConst char _XmSnumColumns[] = "numColumns" ; _XmConst char _XmSnumDropRectangles[] = "numDropRectangles" ; _XmConst char _XmSnumDropTransfers[] = "numDropTransfers" ; _XmConst char _XmSnumExportTargets[] = "numExportTargets" ; _XmConst char _XmSnumImportTargets[] = "numImportTargets" ; _XmConst char _XmSnumRectangles[] = "numRectangles" ; _XmConst char _XmSoffsetX[] = "offsetX" ; _XmConst char _XmSoffsetY[] = "offsetY" ; _XmConst char _XmSokCallback[] = "okCallback" ; _XmConst char _XmSokLabelString[] = "okLabelString" ; _XmConst char _XmSoperationChangedCallback[] = "operationChangedCallback" ; _XmConst char _XmSoperationCursorIcon[] = "operationCursorIcon" ; _XmConst char _XmSoptionLabel[] = "optionLabel" ; _XmConst char _XmSoptionMnemonic[] = "optionMnemonic" ; _XmConst char _XmSosfActivate[] = "osfActivate" ; _XmConst char _XmSosfAddMode[] = "osfAddMode" ; _XmConst char _XmSosfBackSpace[] = "osfBackSpace" ; _XmConst char _XmSosfBeginLine[] = "osfBeginLine" ; _XmConst char _XmSosfCancel[] = "osfCancel" ; _XmConst char _XmSosfClear[] = "osfClear" ; _XmConst char _XmSosfCopy[] = "osfCopy" ; _XmConst char _XmSosfCut[] = "osfCut" ; _XmConst char _XmSosfDelete[] = "osfDelete" ; _XmConst char _XmSosfDown[] = "osfDown" ; _XmConst char _XmSosfEndLine[] = "osfEndLine" ; _XmConst char _XmSosfHelp[] = "osfHelp" ; _XmConst char _XmSosfInsert[] = "osfInsert" ; _XmConst char _XmSosfLeft[] = "osfLeft" ; _XmConst char _XmSosfMenuBar[] = "osfMenuBar" ; _XmConst char _XmSosfMenu[] = "osfMenu" ; _XmConst char _XmSosfPageDown[] = "osfPageDown" ; _XmConst char _XmSosfPageLeft[] = "osfPageLeft" ; _XmConst char _XmSosfPageRight[] = "osfPageRight" ; _XmConst char _XmSosfPageUp[] = "osfPageUp" ; _XmConst char _XmSosfPaste[] = "osfPaste" ; _XmConst char _XmSosfPrimaryPaste[] = "osfPrimaryPaste" ; _XmConst char _XmSosfQuickPaste[] = "osfQuickPaste" ; _XmConst char _XmSosfRight[] = "osfRight" ; _XmConst char _XmSosfSelect[] = "osfSelect" ; _XmConst char _XmSosfUndo[] = "osfUndo" ; _XmConst char _XmSosfUp[] = "osfUp" ; _XmConst char _XmSoutputCreate[] = "outputCreate" ; _XmConst char _XmSpacking[] = "packing" ; _XmConst char _XmSpageDecrementCallback[] = "pageDecrementCallback" ; _XmConst char _XmSpageIncrementCallback[] = "pageIncrementCallback" ; _XmConst char _XmSpageIncrement[] = "pageIncrement" ; _XmConst char _XmSpaneMaximum[] = "paneMaximum" ; _XmConst char _XmSpaneMinimum[] = "paneMinimum" ; _XmConst char _XmSpattern[] = "pattern" ; _XmConst char _XmSpendingDelete[] = "pendingDelete" ; _XmConst char _XmSpopupEnabled[] = "popupEnabled" ; _XmConst char _XmSpositionIndex[] = "positionIndex" ; _XmConst char _XmSpostFromButton[] = "postFromButton" ; _XmConst char _XmSpostFromCount[] = "postFromCount" ; _XmConst char _XmSpostFromList[] = "postFromList" ; _XmConst char _XmSpreeditType[] = "preeditType" ; _XmConst char _XmSprocessingDirection[] = "processingDirection" ; _XmConst char _XmSpromptString[] = "promptString" ; _XmConst char _XmSprotocolCallback[] = "protocolCallback" ; _XmConst char _XmSpushButtonEnabled[] = "pushButtonEnabled" ; _XmConst char _XmSpushButton[] = "pushButton" ; _XmConst char _XmSqualifySearchDataProc[] = "qualifySearchDataProc" ; _XmConst char _XmSradioAlwaysOne[] = "radioAlwaysOne" ; _XmConst char _XmSradioBehavior[] = "radioBehavior" ; _XmConst char _XmSradioButton[] = "radioButton" ; _XmConst char _XmSrealizeCallback[] = "realizeCallback" ; _XmConst char _XmSrecomputeSize[] = "recomputeSize" ; _XmConst char _XmSrectangles[] = "rectangles" ; _XmConst char _XmSrefigureMode[] = "refigureMode" ; _XmConst char _XmSrepeatDelay[] = "repeatDelay" ; _XmConst char _XmSresizable[] = "resizable" ; _XmConst char _XmSresizeCallback[] = "resizeCallback" ; _XmConst char _XmSresizeHeight[] = "resizeHeight" ; _XmConst char _XmSresizePolicy[] = "resizePolicy" ; _XmConst char _XmSresizeWidth[] = "resizeWidth" ; _XmConst char _XmSrightAttachment[] = "rightAttachment" ; _XmConst char _XmSrightOffset[] = "rightOffset" ; _XmConst char _XmSrightPosition[] = "rightPosition" ; _XmConst char _XmSrightWidget[] = "rightWidget" ; _XmConst char _XmSrowColumnType[] = "rowColumnType" ; _XmConst char _XmSrows[] = "rows" ; _XmConst char _XmSrubberPositioning[] = "rubberPositioning" ; _XmConst char _XmSsashHeight[] = "sashHeight" ; _XmConst char _XmSsashIndent[] = "sashIndent" ; _XmConst char _XmSsashShadowThickness[] = "sashShadowThickness" ; _XmConst char _XmSsashWidth[] = "sashWidth" ; _XmConst char _XmSscaleHeight[] = "scaleHeight" ; _XmConst char _XmSscaleMultiple[] = "scaleMultiple" ; _XmConst char _XmSscaleWidth[] = "scaleWidth" ; _XmConst char _XmSscrollBarDisplayPolicy[] = "scrollBarDisplayPolicy" ; _XmConst char _XmSscrollBarPlacement[] = "scrollBarPlacement" ; _XmConst char _XmSscrollHorizontal[] = "scrollHorizontal" ; _XmConst char _XmSscrollLeftSide[] = "scrollLeftSide" ; _XmConst char _XmSscrollTopSide[] = "scrollTopSide" ; _XmConst char _XmSscrollVertical[] = "scrollVertical" ; _XmConst char _XmSscrolledWindowMarginHeight[] = "scrolledWindowMarginHeight" ; _XmConst char _XmSscrolledWindowMarginWidth[] = "scrolledWindowMarginWidth" ; _XmConst char _XmSscrollingPolicy[] = "scrollingPolicy" ; _XmConst char _XmSselectColor[] = "selectColor" ; _XmConst char _XmSselectInsensitivePixmap[] = "selectInsensitivePixmap" ; _XmConst char _XmSselectPixmap[] = "selectPixmap" ; _XmConst char _XmSselectThreshold[] = "selectThreshold" ; _XmConst char _XmSselectedItemCount[] = "selectedItemCount" ; _XmConst char _XmSselectedItems[] = "selectedItems" ; _XmConst char _XmSselectionArrayCount[] = "selectionArrayCount" ; _XmConst char _XmSselectionLabelString[] = "selectionLabelString" ; _XmConst char _XmSselectionPolicy[] = "selectionPolicy" ; _XmConst char _XmSseparatorOn[] = "separatorOn" ; _XmConst char _XmSseparatorType[] = "separatorType" ; _XmConst char _XmSseparator[] = "separator" ; _XmConst char _XmSset[] = "set" ; _XmConst char _XmSshadowThickness[] = "shadowThickness" ; _XmConst char _XmSshadowType[] = "shadowType" ; _XmConst char _XmSshadow[] = "shadow" ; _XmConst char _XmSshellUnitType[] = "shellUnitType" ; _XmConst char _XmSshowArrows[] = "showArrows" ; _XmConst char _XmSshowAsDefault[] = "showAsDefault" ; _XmConst char _XmSshowSeparator[] = "showSeparator" ; _XmConst char _XmSshowValue[] = "showValue" ; _XmConst char _XmSsimpleCallback[] = "simpleCallback" ; _XmConst char _XmSsingleSelectionCallback[] = "singleSelectionCallback" ; _XmConst char _XmSsingleSeparator[] = "singleSeparator" ; _XmConst char _XmSsizePolicy[] = "sizePolicy" ; _XmConst char _XmSskipAdjust[] = "skipAdjust" ; _XmConst char _XmSsliderSize[] = "sliderSize" ; _XmConst char _XmSsourceCursorIcon[] = "sourceCursorIcon" ; _XmConst char _XmSsourceIsExternal[] = "sourceIsExternal" ; _XmConst char _XmSsourcePixmapIcon[] = "sourcePixmapIcon" ; _XmConst char _XmSsourceWidget[] = "sourceWidget" ; _XmConst char _XmSsourceWindow[] = "sourceWindow" ; _XmConst char _XmSsource[] = "source" ; _XmConst char _XmSspacing[] = "spacing" ; _XmConst char _XmSstartTime[] = "startTime" ; _XmConst char _XmSstateCursorIcon[] = "stateCursorIcon" ; _XmConst char _XmSstringDirection[] = "stringDirection" ; _XmConst char _XmSsubMenuId[] = "subMenuId" ; _XmConst char _XmSsymbolPixmap[] = "symbolPixmap" ; _XmConst char _XmStearOffMenuActivateCallback[] = "tearOffMenuActivateCallback" ; _XmConst char _XmStearOffMenuDeactivateCallback[] = "tearOffMenuDeactivateCallback" ; _XmConst char _XmStearOffModel[] = "tearOffModel" ; _XmConst char _XmStextAccelerators[] = "textAccelerators" ; _XmConst char _XmStextColumns[] = "textColumns" ; _XmConst char _XmStextFontList[] = "textFontList" ; _XmConst char _XmStextString[] = "textString" ; _XmConst char _XmStextTranslations[] = "textTranslations" ; _XmConst char _XmStextValue[] = "textValue" ; _XmConst char _XmStitleString[] = "titleString" ; _XmConst char _XmStoBottomCallback[] = "toBottomCallback" ; _XmConst char _XmStoPositionCallback[] = "toPositionCallback" ; _XmConst char _XmStoTopCallback[] = "toTopCallback" ; _XmConst char _XmStopAttachment[] = "topAttachment" ; _XmConst char _XmStopCharacter[] = "topCharacter" ; _XmConst char _XmStopItemPosition[] = "topItemPosition" ; _XmConst char _XmStopLevelEnterCallback[] = "topLevelEnterCallback" ; _XmConst char _XmStopLevelLeaveCallback[] = "topLevelLeaveCallback" ; _XmConst char _XmStopOffset[] = "topOffset" ; _XmConst char _XmStopPosition[] = "topPosition" ; _XmConst char _XmStopShadowColor[] = "topShadowColor" ; _XmConst char _XmStopShadowPixmap[] = "topShadowPixmap" ; _XmConst char _XmStopWidget[] = "topWidget" ; _XmConst char _XmStransferProc[] = "transferProc" ; _XmConst char _XmStransferStatus[] = "transferStatus" ; _XmConst char _XmStraversalCallback[] = "traversalCallback" ; _XmConst char _XmStraversalOn[] = "traversalOn" ; _XmConst char _XmStraversalType[] = "traversalType" ; _XmConst char _XmStraverseObscuredCallback[] = "traverseObscuredCallback" ; _XmConst char _XmStreeUpdateProc[] = "treeUpdateProc" ; _XmConst char _XmStroughColor[] = "troughColor" ; _XmConst char _XmSunitType[] = "unitType" ; _XmConst char _XmSunmapCallback[] = "unmapCallback" ; _XmConst char _XmSunpostBehavior[] = "unpostBehavior" ; _XmConst char _XmSunselectPixmap[] = "unselectPixmap" ; _XmConst char _XmSupdateSliderSize[] = "updateSliderSize" ; _XmConst char _XmSuseAsyncGeometry[] = "useAsyncGeometry" ; _XmConst char _XmSuserData[] = "userData" ; _XmConst char _XmSvalidCursorForeground[] = "validCursorForeground" ; _XmConst char _XmSvalueChangedCallback[] = "valueChangedCallback" ; _XmConst char _XmSvalueWcs[] = "valueWcs" ; _XmConst char _XmSverifyBell[] = "verifyBell" ; _XmConst char _XmSverticalFontUnit[] = "verticalFontUnit" ; _XmConst char _XmSverticalScrollBar[] = "verticalScrollBar" ; _XmConst char _XmSverticalSpacing[] = "verticalSpacing" ; _XmConst char _XmSvisibleItemCount[] = "visibleItemCount" ; _XmConst char _XmSvisibleWhenOff[] = "visibleWhenOff" ; _XmConst char _XmSvisualPolicy[] = "visualPolicy" ; _XmConst char _XmSwhichButton[] = "whichButton" ; _XmConst char _XmSwordWrap[] = "wordWrap" ; _XmConst char _XmSworkWindow[] = "workWindow" ; /* Exceptions to the naming convention: */ _XmConst char _XmSEMPTY_STRING[] = "" ; _XmConst char _XmSCFONTLIST_DEFAULT_TAG_STRING[] = "FONTLIST_DEFAULT_TAG_STRING" ; _XmConst char _XmSCISO8859_DASH_1[] = "ISO8859-1" ; _XmConst char _XmSCXmFONTLIST_DEFAULT_TAG_STRING[] = "XmFONTLIST_DEFAULT_TAG_STRING" ; motif-2.3.8/lib/Xm/XmAll.h0000644000175000017500000000524513145162623012114 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmAll_h #define _XmAll_h #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef PRINTING_SUPPORTED #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* _XmAll_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DrawI.h0000644000175000017500000000370412672140200012072 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: DrawI.h /main/6 1995/07/14 10:27:37 drk $ */ #ifndef _XmDrawI_h #define _XmDrawI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmDrawHighlight( Display *display, Drawable d, GC gc, #if NeedWidePrototypes int x, int y, int width, int height, int highlight_thick, #else Position x, Position y, Dimension width, Dimension height, Dimension highlight_thick, #endif /* NeedWidePrototypes */ int line_style) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDrawI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextOutP.h0000644000175000017500000002456213145162623012636 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmTextOutP_h #define _XmTextOutP_h #include #include #ifdef __cplusplus extern "C" { #endif /**************************************************************** * * Definitions for modules implementing and using text output routines. * ****************************************************************/ #define ShouldWordWrap(data, widget) (data->wordwrap && \ (!(((XmDirectionMatch(XmPrim_layout_direction(widget), \ XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) ? \ data->scrollvertical : data->scrollhorizontal) \ && XmIsScrolledWindow(widget->core.parent))) \ && widget->text.edit_mode != XmSINGLE_LINE_EDIT) typedef struct _LineTableExtraRec { Dimension width; Boolean wrappedbychar; } LineTableExtraRec, *LineTableExtra ; /* * output.c (part of stext) */ typedef unsigned int LineNum; typedef enum {on, off} OnOrOff; /* For when Booleans aren't obvious enough. */ /* * Return the line number containing the given position. If text currently * knows of no line containing that position, returns NOLINE. */ #define NOLINE 30000 /* * These next define the types of the routines that output is required * to export for use by text and by input. */ typedef struct _OutputDataRec { XmFontList fontlist; /* Fontlist for text. */ unsigned int blinkrate; Boolean wordwrap; /* Whether to wordwrap. */ Boolean cursor_position_visible; Boolean autoshowinsertpoint; Boolean hasfocus; Boolean has_rect; Boolean handlingexposures; /* TRUE if in the midst of expose events. */ Boolean exposevscroll; /* Non-zero if we expect expose events to be off vertically. */ Boolean exposehscroll; /* Non-zero if we expect expose events to be off horizontally. */ Boolean resizewidth, resizeheight; Boolean scrollvertical, scrollhorizontal; Boolean scrollleftside, scrolltopside; Boolean ignorevbar; /* Whether to ignore callbacks from vbar. */ Boolean ignorehbar; /* Whether to ignore callbacks from hbar. */ short int cursor_on; /* Whether IBeam cursor is visible. */ Boolean refresh_ibeam_off; /* Indicates whether area under IBeam needs * to be re-captured */ Boolean suspend_hoffset; /* temporarily suspend horizontal scrolling */ Boolean use_fontset; /* True if font to be used is fontset (and * thus need X11R5 Xmb* routines to draw */ Boolean have_inverted_image_gc; /* fg/bg of image gc have been swapped; * on == True, off == False */ OnOrOff blinkstate; Position insertx, inserty; int number_lines; /* Number of lines that fit in the window. */ int leftmargin, rightmargin; int topmargin, bottommargin; int scrollwidth; /* Total width of text we have to display. */ int vsliderSize; /* How big the thumb is in the vbar. */ int hoffset; /* How much we've scrolled off the left. */ int averagecharwidth; /* Number of pixels for an "average" char. */ int tabwidth; /* Number of pixels for a tab. */ short columns, rows; Dimension lineheight; /* Number of pixels per line. */ Dimension minwidth, minheight; Dimension prevW; Dimension prevH; Dimension cursorwidth, cursorheight; Dimension font_ascent; /* ascent of the font[set] */ Dimension font_descent; /* descent of the font[set] */ XtIntervalId timerid; Pixmap cursor; /* Pixmap for IBeam cursor stencil. */ Pixmap add_mode_cursor; /* Pixmap to use for add mode cursor. */ Pixmap ibeam_off; /* Pixmap for area under the IBeam. */ Pixmap stipple_tile; /* stipple for add mode cursor. */ GC gc, imagegc; Widget vbar, hbar; XFontStruct *font; /* font used when NULL font is set. */ /* New for 1.2 */ GC save_gc; /* GC for saving/resotring under IBeam */ short columns_set, rows_set; /* history of previously set dimensions */ /* New for 2.0 */ XmRenderTable rendertable; /* Alias for fontlist - only for resource setting */ GC cursor_gc; /* 1-bit depth GC for creating the I-beam stipples (normal & add mode) */ int scrollheight; /* Total height of text we have to display. */ int voffset; /* How much we've scrolled off the top. */ int tabheight; /* Number of pixels for a tab. */ Dimension linewidth; /* Number of pixels per line (when vw). */ Boolean suspend_voffset; /* temporarily suspend horizontal scrolling */ #ifdef USE_XFT Boolean use_xft; /* True if font to be used is XftFont */ #endif } OutputDataRec, *OutputData; /* * Create a new instance of an output object. This is expected to fill in * info about innerwidget and output in the widget record. */ typedef void (*OutputCreateProc)( Widget, ArgList, Cardinal) ; /* * Given an (x,y) coordinate, return the closest corresponding position. (For * use by input; text shouldn't ever need to know.) */ typedef XmTextPosition (*XYToPosProc)( XmTextWidget, #if NeedWidePrototypes int, int) ; #else Position, /* These are relative to the */ Position) ; /* innerwindow returned above. */ #endif /* * Return the (x,y) coordinate corresponing to the given position. If this * returns FALSE, then the given position isn't being displayed. */ typedef Boolean (*PosToXYProc)( XmTextWidget, XmTextPosition, Position *, /* These are relative to the */ Position *) ; /* innerwindow returned above. */ /* * Measures the extent of a line. Given the line number and starting position * of a line, returns the starting position of the next line. Also returns * any extra information that the output module may want to associate with * this line for future reference. (In particular, it will want to associate * a vertical coordinate for this line.) This routine should return FALSE if * it decides that this line will not fit in the window. FALSE should never * be returned if the line number is zero. Output may assume that the line * table for all preceeding lines have already been set. In particular, when * this routine will return FALSE, then output knows that the entire linetable * has been calculated; that is a good time for it to look over the linetable * and decide if it wants to do something obnoxious like resize the window. * * A possible value to put in nextpos is PASTENDPOS. This indicates that the * current line contains the end of the text in the source. * * nextpos may be NULL. If it is, then this indicates that we only want to * know if the line will fit on the window. The caller already has its own * idea where the next line will start if it does fit. (If nextpos is NULL, * then no extra information should be generated, and the 'extra' parameter * should be ignored.) */ #define PASTENDPOS 2147483647 /* Biggest number that can fit in long */ typedef Boolean (*MeasureLineProc)( XmTextWidget, LineNum, XmTextPosition, XmTextPosition *, LineTableExtraRec **) ; /* * Draw some text within a line. The output finds out information about the * line by calling the line table routines. * * %%% Document special cases (like lines containing PASTENDPOS). */ typedef void (*DrawProc)( XmTextWidget, LineNum, XmTextPosition, XmTextPosition, XmHighlightMode) ; /* * Output should draw or erase an insertion point at the given position. */ typedef void (*DrawInsertionPointProc)( XmTextWidget, XmTextPosition, OnOrOff) ; /* * Output should ensure that the given position is visible (e.g., not scrolled * off horizontally). */ typedef void (*MakePositionVisibleProc)( XmTextWidget, XmTextPosition) ; /* Text would like to move some lines around on the screen. It would like to * move lines fromline through toline (inclusive) to now start at line * destline. If output can perform this move by means of a XCopyArea or * similar simple call, it does so and returns TRUE; otherwise, it will return * FALSE. If TRUE, output should modify affected values in the * "extra" entries in the linetable, because after returning text will go ahead * and move linetable entries around. */ typedef Boolean (*MoveLinesProc)( XmTextWidget, LineNum, LineNum, LineNum) ; /* * Inform output of invalidated positions. */ typedef void (*InvalidateProc)( XmTextWidget, XmTextPosition, XmTextPosition, long) ; /* * Get preferred size of text widget based on the row and column * resources multiplied by font attributes as well as adding the * margin resource values to the computed size. */ typedef void (*GetPreferredSizeProc)( Widget, Dimension *, Dimension *) ; /* * Get values out of the output object. */ typedef void (*GetValuesProc)( Widget, ArgList, Cardinal) ; /* * Set values in the output object. */ typedef Boolean (*SetValuesProc)( Widget, Widget, Widget, ArgList, Cardinal *) ; typedef struct _OutputRec { struct _OutputDataRec *data; /* Output-specific data; opaque type. */ XYToPosProc XYToPos; PosToXYProc PosToXY; MeasureLineProc MeasureLine; DrawProc Draw; DrawInsertionPointProc DrawInsertionPoint; MakePositionVisibleProc MakePositionVisible; MoveLinesProc MoveLines; InvalidateProc Invalidate; GetPreferredSizeProc GetPreferredSize; GetValuesProc GetValues; SetValuesProc SetValues; XmRealizeOutProc realize; XtWidgetProc destroy; XmResizeFlagProc resize; XtExposeProc expose; } OutputRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmTextOutP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/XpmWrFFrBuf.c0000644000175000017500000000477312672140200013176 00000000000000/* $XConsortium: XpmWrFFrBuf.c /main/2 1996/09/20 08:14:07 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * WrFFrBuf.c: * * * * XPM library * * Write a memory buffer to a file, provided as a convenience. * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif /* October 2004, source code review by Thomas Biege */ #include "XpmI.h" int XpmWriteFileFromBuffer(filename, buffer) char *filename; char *buffer; { int fcheck, len; FILE *fp = fopen(filename, "w"); if (!fp) return XpmOpenFailed; len = strlen(buffer); fcheck = fwrite(buffer, len, 1, fp); fclose(fp); if (fcheck != 1) return XpmOpenFailed; /* maybe use a better return value */ return XpmSuccess; } motif-2.3.8/lib/Xm/Protocols.h0000644000175000017500000001025313145162623013056 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmProtocols_h #define _XmProtocols_h #include #include #ifdef __cplusplus extern "C" { #endif /* should be in XmP.h */ #ifndef XmCR_WM_PROTOCOLS #define XmCR_WM_PROTOCOLS 6666 #endif /* XmCR_WM_PROTOCOLS */ /* define the XM_PROTOCOLS atom for use in routines */ #ifdef XA_WM_PROTOCOLS #define XM_WM_PROTOCOL_ATOM(shell) XA_WM_PROTOCOLS #else #define XM_WM_PROTOCOL_ATOM(shell) \ XInternAtom(XtDisplay(shell),"WM_PROTOCOLS",FALSE) #endif /* XA_WM_PROTOCOLS */ #define XmAddWMProtocols(shell, protocols, num_protocols) \ XmAddProtocols(shell, XM_WM_PROTOCOL_ATOM(shell), \ protocols, num_protocols) #define XmRemoveWMProtocols(shell, protocols, num_protocols) \ XmRemoveProtocols(shell, XM_WM_PROTOCOL_ATOM(shell), \ protocols, num_protocols) #define XmAddWMProtocolCallback(shell, protocol, callback, closure) \ XmAddProtocolCallback(shell, XM_WM_PROTOCOL_ATOM(shell), \ protocol, callback, closure) #define XmRemoveWMProtocolCallback(shell, protocol, callback, closure) \ XmRemoveProtocolCallback(shell, XM_WM_PROTOCOL_ATOM(shell), \ protocol, callback, closure) #define XmActivateWMProtocol(shell, protocol) \ XmActivateProtocol(shell, XM_WM_PROTOCOL_ATOM(shell), protocol) #define XmDeactivateWMProtocol(shell, protocol) \ XmDeactivateProtocol(shell, XM_WM_PROTOCOL_ATOM(shell), protocol) #define XmSetWMProtocolHooks(shell, protocol, pre_h, pre_c, post_h, post_c) \ XmSetProtocolHooks(shell, XM_WM_PROTOCOL_ATOM(shell), \ protocol, pre_h, pre_c, post_h, post_c) /******** Public Function Declarations ********/ extern void XmAddProtocols( Widget shell, Atom property, Atom *protocols, Cardinal num_protocols) ; extern void XmRemoveProtocols( Widget shell, Atom property, Atom *protocols, Cardinal num_protocols) ; extern void XmAddProtocolCallback( Widget shell, Atom property, Atom proto_atom, XtCallbackProc callback, XtPointer closure) ; extern void XmRemoveProtocolCallback( Widget shell, Atom property, Atom proto_atom, XtCallbackProc callback, XtPointer closure) ; extern void XmActivateProtocol( Widget shell, Atom property, Atom proto_atom) ; extern void XmDeactivateProtocol( Widget shell, Atom property, Atom proto_atom) ; extern void XmSetProtocolHooks( Widget shell, Atom property, Atom proto_atom, XtCallbackProc pre_hook, XtPointer pre_closure, XtCallbackProc post_hook, XtPointer post_closure) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmProtocols_h */ motif-2.3.8/lib/Xm/List.h0000644000175000017500000001637513145162623012020 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmList_h #define _XmList_h #include #ifdef __cplusplus extern "C" { #endif externalref WidgetClass xmListWidgetClass; #define XmINITIAL 0 #define XmADDITION 1 #define XmMODIFICATION 2 #ifndef XmIsList #define XmIsList(w) XtIsSubclass(w, xmListWidgetClass) #endif /* XmIsList */ typedef struct _XmListClassRec * XmListWidgetClass; typedef struct _XmListRec * XmListWidget; /******** Public Function Declarations ********/ extern void XmListAddItem( Widget w, XmString item, int pos) ; extern void XmListAddItems( Widget w, XmString *items, int item_count, int pos) ; extern void XmListAddItemsUnselected( Widget w, XmString *items, int item_count, int pos) ; extern void XmListAddItemUnselected( Widget w, XmString item, int pos) ; extern void XmListDeleteItem( Widget w, XmString item) ; extern void XmListDeleteItems( Widget w, XmString *items, int item_count) ; extern void XmListDeletePositions( Widget w, int *position_list, int position_count ) ; extern void XmListDeletePos( Widget w, int pos) ; extern void XmListDeleteItemsPos( Widget w, int item_count, int pos) ; extern void XmListDeleteAllItems( Widget w) ; extern void XmListReplaceItems( Widget w, XmString *old_items, int item_count, XmString *new_items) ; extern void XmListReplaceItemsPos( Widget w, XmString *new_items, int item_count, int position) ; extern void XmListReplaceItemsUnselected( Widget w, XmString *old_items, int item_count, XmString *new_items) ; extern void XmListReplaceItemsPosUnselected( Widget w, XmString *new_items, int item_count, int position) ; extern void XmListReplacePositions( Widget w, int *position_list, XmString *item_list, int item_count ) ; extern void XmListSelectItem( Widget w, XmString item, #if NeedWidePrototypes int notify) ; #else Boolean notify) ; #endif /* NeedWidePrototypes */ extern void XmListSelectPos( Widget w, int pos, #if NeedWidePrototypes int notify) ; #else Boolean notify) ; #endif /* NeedWidePrototypes */ extern void XmListDeselectItem( Widget w, XmString item) ; extern void XmListDeselectPos( Widget w, int pos) ; extern void XmListDeselectAllItems( Widget w) ; extern void XmListSetPos( Widget w, int pos) ; extern void XmListSetBottomPos( Widget w, int pos) ; extern void XmListSetItem( Widget w, XmString item) ; extern void XmListSetBottomItem( Widget w, XmString item) ; extern void XmListSetAddMode( Widget w, #if NeedWidePrototypes int add_mode) ; #else Boolean add_mode) ; #endif /* NeedWidePrototypes */ extern Boolean XmListItemExists( Widget w, XmString item) ; extern int XmListItemPos( Widget w, XmString item) ; extern int XmListGetKbdItemPos( Widget w) ; extern Boolean XmListSetKbdItemPos( Widget w, int pos ) ; extern int XmListYToPos( Widget w, Position y) ; /* NeedWidePrototypes ????? */ extern Boolean XmListPosToBounds( Widget w, int position, Position *x, Position *y, Dimension *width, Dimension *height) ; extern Boolean XmListGetMatchPos( Widget w, XmString item, int **pos_list, int *pos_count) ; extern Boolean XmListGetSelectedPos( Widget w, int **pos_list, int *pos_count) ; extern void XmListSetHorizPos( Widget w, int position) ; extern void XmListUpdateSelectedList( Widget w) ; extern Boolean XmListPosSelected( Widget w, int pos); extern Widget XmCreateList( Widget parent, char *name, ArgList args, Cardinal argCount) ; extern Widget XmCreateScrolledList( Widget parent, char *name, ArgList args, Cardinal argCount) ; extern Widget XmVaCreateList( Widget parent, char *name, ...); extern Widget XmVaCreateManagedList( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmList_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ComboBox2.h0000644000175000017500000001021012672140200012644 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmCominationBox2_h_ #define _XmCominationBox2_h_ #include #include #if defined(__cplusplus) extern "C" { #endif enum { XiCOMBINATIONBOX2_LABEL = XmDROPDOWN_LABEL, XiCOMBINATIONBOX2_TEXT = XmDROPDOWN_TEXT, XiCOMBINATIONBOX2_ARROW_BUTTON = XmDROPDOWN_ARROW_BUTTON, XiCOMBINATIONBOX2_LIST = XmDROPDOWN_LIST }; extern WidgetClass xmCombinationBox2WidgetClass XM_DEPRECATED; typedef XmDropDownWidgetClass *XmCombinationBox2WidgetClass; typedef XmDropDownWidget *XmCombinationBox2Widget; /* Function Name: XmCombinationBox2GetValue * Description: Retreives the value from the combo box. * Arguments: w - the combination box. * Returns: The value in the text widget. */ extern String XmCombinationBox2GetValue(Widget w) XM_DEPRECATED; /* Function Name: XmCreateCombinationBox2 * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ extern Widget XmCreateCombinationBox2(Widget w, char *name, ArgList args, Cardinal argCount) XM_DEPRECATED; /* * Variable argument list functions */ extern Widget XmVaCreateCombinationBox2( Widget parent, char *name, ...) XM_DEPRECATED; extern Widget XmVaCreateManagedCombinationBox2( Widget parent, char *name, ...) XM_DEPRECATED; /* Function Name: XmCombinationBox2GetLabel * Description: Returns the "label" child of the XmCombinationBox2 * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmCombinationBox2 */ Widget XmCombinationBox2GetLabel(Widget w) XM_DEPRECATED; /* Function Name: XmCombinationBox2GetArrow * Description: Returns the "arrow" child of the XmCombinationBox2 * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmCombinationBox2 */ Widget XmCombinationBox2GetArrow(Widget w) XM_DEPRECATED; /* Function Name: XmCombinationBox2GetText * Description: Returns the "text" child of the XmCombinationBox2 * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmCombinationBox2 */ Widget XmCombinationBox2GetText(Widget w) XM_DEPRECATED; /* Function Name: XmCombinationBox2GetList * Description: Returns the "list" child of the XmCombinationBox2 * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmCombinationBox2 */ Widget XmCombinationBox2GetList(Widget w) XM_DEPRECATED; /* Function Name: XmCombinationBox2GetChild * Description: Returns the child widget id of the XmCombinationBox2 * Arguments: w - The XmCombinationBox2 Widget * Returns: The specified child of the XmCombinationBox2 */ Widget XmCombinationBox2GetChild(Widget w, int child) XM_DEPRECATED; #if defined(__cplusplus) } #endif #endif /* _XmCombinationBox2_h_ */ motif-2.3.8/lib/Xm/SeparatoG.c0000644000175000017500000015065413145162623012764 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: SeparatoG.c /main/18 1999/01/26 15:32:56 mgreess $" #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CacheI.h" #include "ColorI.h" #include "ExtObjectI.h" #include "PixConvI.h" #include "RepTypeI.h" #include "SeparatoGI.h" #include "SyntheticI.h" #include "XmI.h" /******** Static Function Declarations ********/ static void SetTopShadowPixmapDefault( Widget widget, int offset, XrmValue * value); static void InputDispatch( Widget sg, XEvent *event, Mask event_mask) ; static void ClassInitialize( void ) ; static void ClassPartInitialize( WidgetClass wc) ; static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args) ; static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args) ; static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetSeparatorGC( XmSeparatorGadget sg) ; static void GetBackgroundGC( XmSeparatorGadget sg) ; static void Redisplay( Widget wid, XEvent *event, Region region) ; static void Destroy( Widget sg) ; static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void Help( Widget sg, XEvent *event) ; static Cardinal GetSeparatorGClassSecResData( WidgetClass w_class, XmSecondaryResourceData **data_rtn) ; static XtPointer GetSeparatorGClassSecResBase( Widget widget, XtPointer client_data) ; static Boolean HandleRedraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static void InitNewColorBehavior( XmSeparatorGadget sg); static void DealWithColors( XmSeparatorGadget sg); static void DealWithPixmaps( XmSeparatorGadget sg); static void InitNewPixmapBehavior( XmSeparatorGadget sg); static void GetColors(Widget widget, XmAccessColorData color_data); /******** End Static Function Declarations ********/ /* Menu Savvy trait record */ static XmConst XmMenuSavvyTraitRec MenuSavvySeparatorRecord = { 0, /* version */ NULL, /* disableCallback */ NULL, /* getAccelerator */ NULL, /* getMnemonic */ NULL, /* getActivateCBName */ }; static XmConst XmCareVisualTraitRec SeparatoGCVT = { 0, /* version */ HandleRedraw, }; /* Access Colors Trait record for separator */ static XmConst XmAccessColorsTraitRec sepACT = { 0, /* version */ GetColors }; /* Resource list for Separator */ static XtResource resources[] = { { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf( struct _XmGadgetRec, gadget.traversal_on), XmRImmediate, (XtPointer) False }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmGadgetRec, gadget.highlight_thickness), XmRImmediate, (XtPointer) 0 }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmGadgetRec, gadget.shadow_thickness), XmRImmediate, (XtPointer) 2 }, }; static XtResource cache_resources[] = { { XmNseparatorType, XmCSeparatorType, XmRSeparatorType, sizeof (unsigned char), XtOffsetOf( struct _XmSeparatorGCacheObjRec, separator_cache.separator_type), XmRImmediate, (XtPointer) XmSHADOW_ETCHED_IN }, { XmNmargin, XmCMargin, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( struct _XmSeparatorGCacheObjRec, separator_cache.margin), XmRImmediate, (XtPointer) 0 }, { XmNorientation, XmCOrientation, XmROrientation, sizeof (unsigned char), XtOffsetOf( struct _XmSeparatorGCacheObjRec, separator_cache.orientation), XmRImmediate, (XtPointer) XmHORIZONTAL }, { XmNbackground, XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.background), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNforeground, XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.foreground), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNtopShadowColor, XmCTopShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.top_shadow_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.top_shadow_pixmap), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNbottomShadowColor, XmCBottomShadowColor, XmRPixel, sizeof (Pixel), XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.bottom_shadow_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XmRNoScalingDynamicPixmap, sizeof (Pixmap), XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.bottom_shadow_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, }; static XmSyntheticResource cache_syn_resources[] = { { XmNmargin, sizeof (Dimension), XtOffsetOf( struct _XmSeparatorGCacheObjRec, separator_cache.margin), XmeFromHorizontalPixels, XmeToHorizontalPixels, }, }; /* ext rec static initialization */ externaldef(xmseparatorgcacheobjclassrec) XmSeparatorGCacheObjClassRec xmSeparatorGCacheObjClassRec = { { /* superclass */ (WidgetClass) &xmExtClassRec, /* class_name */ "XmSeparatorGadget", /* widget_size */ sizeof(XmSeparatorGCacheObjRec), /* class_initialize */ NULL, /* chained class init */ NULL, /* class_inited */ False, /* initialize */ NULL, /* initialize hook */ NULL, /* realize */ NULL, /* actions */ NULL, /* num_actions */ 0, /* resources */ cache_resources, /* num_resources */ XtNumber(cache_resources), /* xrm_class */ NULLQUARK, /* compress_motion */ False, /* compress_exposure */ False, /* compress enter/exit*/ False, /* visible_interest */ False, /* destroy */ NULL, /* resize */ NULL, /* expose */ NULL, /* set_values */ NULL, /* set values hook */ NULL, /* set values almost */ NULL, /* get values hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback offsetlst */ NULL, /* default trans */ NULL, /* query geo proc */ NULL, /* display accelerator*/ NULL, /* extension record */ NULL, }, { /* synthetic resources */ cache_syn_resources, /* num_syn_resources */ XtNumber(cache_syn_resources), /* extension */ NULL, } }; static XmBaseClassExtRec separatorBaseClassExtRec = { NULL, /* next_extension */ NULLQUARK, /* record_typ */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* record_size */ XmInheritInitializePrehook, /* initializePrehook */ SetValuesPrehook, /* setValuesPrehook */ InitializePosthook, /* initializePosthook */ SetValuesPosthook, /* setValuesPosthook */ (WidgetClass)&xmSeparatorGCacheObjClassRec, /* secondaryObjectClass */ SecondaryObjectCreate, /* secondaryObjectCreate */ GetSeparatorGClassSecResData, /* getSecResData */ {0}, /* Other Flags */ GetValuesPrehook, /* getValuesPrehook */ GetValuesPosthook, /* getValuesPosthook */ }; static XmCacheClassPart SeparatorClassCachePart = { {NULL, 0, 0}, /* head of class cache list */ _XmCacheCopy, /* Copy routine */ _XmCacheDelete, /* Delete routine */ _XmSeparatorCacheCompare, /* Comparison routine */ }; /* The Separator class record definition */ externaldef(xmseparatorgadgetclassrec) XmSeparatorGadgetClassRec xmSeparatorGadgetClassRec = { { (WidgetClass) &xmGadgetClassRec, /* superclass */ "XmSeparatorGadget", /* class_name */ sizeof(XmSeparatorGadgetRec), /* widget_size */ ClassInitialize, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ NULL, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback private */ NULL, /* tm_table */ NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)&separatorBaseClassExtRec, /* extension */ }, { NULL, /* border highlight */ NULL, /* border_unhighlight */ NULL, /* arm_and_activate */ InputDispatch, /* input dispatch */ XmInheritVisualChange, /* visual_change */ NULL, /* syn_resources */ 0, /* num_syn_resources */ &SeparatorClassCachePart, /* class cache part */ NULL, /* extension */ }, { NULL, /* extension */ } }; externaldef(xmseparatorgadgetclass) WidgetClass xmSeparatorGadgetClass = (WidgetClass) &xmSeparatorGadgetClassRec; /*ARGSUSED*/ static void SetTopShadowPixmapDefault( Widget widget, int offset, /* unused */ XrmValue *value ) { XmSeparatorGadget sg = (XmSeparatorGadget) widget; XmManagerWidget mw = (XmManagerWidget)XtParent(sg); static Pixmap pixmap; pixmap = XmUNSPECIFIED_PIXMAP; value->addr = (char *) &pixmap; value->size = sizeof (Pixmap); if (SEPG_TopShadowColor(sg) == SEPG_Background(sg)) pixmap = XmGetPixmapByDepth (XtScreen (sg), XmS50_foreground, SEPG_TopShadowColor(sg), SEPG_Foreground(sg), mw->core.depth); else if (DefaultDepthOfScreen (XtScreen (widget)) == 1) pixmap = XmGetPixmapByDepth (XtScreen (sg), XmS50_foreground, SEPG_TopShadowColor(sg), SEPG_Background(sg), mw->core.depth); } /************************************************************************ * * InputDispatch * This function catches input sent by a manager and dispatches it * to the individual routines. * ************************************************************************/ static void InputDispatch( Widget sg, XEvent *event, Mask event_mask ) { if (event_mask & XmHELP_EVENT) Help (sg, event); } /******************************************************************* * * _XmSeparatorCacheCompare * *******************************************************************/ int _XmSeparatorCacheCompare( XtPointer A, XtPointer B ) { XmSeparatorGCacheObjPart *separator_inst = (XmSeparatorGCacheObjPart *) A ; XmSeparatorGCacheObjPart *separator_cache_inst = (XmSeparatorGCacheObjPart *) B ; if((separator_inst->margin == separator_cache_inst->margin) && (separator_inst->orientation == separator_cache_inst->orientation) && (separator_inst->separator_type == separator_cache_inst->separator_type) && (separator_inst-> separator_GC == separator_cache_inst->separator_GC) && (separator_inst-> background_GC == separator_cache_inst->background_GC) && (separator_inst-> top_shadow_GC == separator_cache_inst->top_shadow_GC) && (separator_inst-> bottom_shadow_GC == separator_cache_inst->bottom_shadow_GC) && (separator_inst-> background == separator_cache_inst->background) && (separator_inst-> top_shadow_color == separator_cache_inst->top_shadow_color) && (separator_inst-> top_shadow_pixmap == separator_cache_inst->top_shadow_pixmap) && (separator_inst-> bottom_shadow_color == separator_cache_inst->bottom_shadow_color) && (separator_inst-> bottom_shadow_pixmap == separator_cache_inst->bottom_shadow_pixmap)) return 1; else return 0; } /*********************************************************** * * ClassInitialize * ************************************************************/ static void ClassInitialize( void ) { separatorBaseClassExtRec.record_type = XmQmotif; /* Install the menu savvy trait. */ XmeTraitSet((XtPointer) xmSeparatorGadgetClass, XmQTmenuSavvy, (XtPointer) &MenuSavvySeparatorRecord); } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { _XmFastSubclassInit (wc, XmSEPARATOR_GADGET_BIT); /* Install the careParentVisual trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTcareParentVisual, (XtPointer)&SeparatoGCVT); /* Install the accessColors trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTaccessColors, (XtPointer)&sepACT); } /************************************************************************ * * SecondaryObjectCreate * ************************************************************************/ /* ARGSUSED */ static void SecondaryObjectCreate( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmBaseClassExt *cePtr; XmWidgetExtData extData; WidgetClass wc; Cardinal size; XtPointer newSec, reqSec; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(new_w), XmQmotif); wc = (*cePtr)->secondaryObjectClass; size = wc->core_class.widget_size; newSec = _XmExtObjAlloc(size); reqSec = _XmExtObjAlloc(size); _XmProcessUnlock(); /* * Update pointers in instance records now so references to resources * in the cache record will be valid for use in CallProcs. */ SEPG_Cache(new_w) = &(((XmSeparatorGCacheObject)newSec)->separator_cache); SEPG_Cache(req) = &(((XmSeparatorGCacheObject)reqSec)->separator_cache); /* * fetch the resources in superclass to subclass order */ XtGetSubresources(new_w, newSec, NULL, NULL, wc->core_class.resources, wc->core_class.num_resources, args, *num_args ); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; ((XmSeparatorGCacheObject)newSec)->ext.extensionType = XmCACHE_EXTENSION; ((XmSeparatorGCacheObject)newSec)->ext.logicalParent = new_w; _XmPushWidgetExtData(new_w, extData, ((XmSeparatorGCacheObject)newSec)->ext.extensionType); memcpy(reqSec, newSec, size); } /************************************************************************ * * InitializePosthook * ************************************************************************/ /* ARGSUSED */ static void InitializePosthook( Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; XmSeparatorGadget sw = (XmSeparatorGadget)new_w; /* * - register parts in cache. * - update cache pointers * - and free req */ _XmProcessLock(); SEPG_Cache(sw) = (XmSeparatorGCacheObjPart *) _XmCachePart( SEPG_ClassCachePart(sw), (XtPointer) SEPG_Cache(sw), sizeof(XmSeparatorGCacheObjPart)); /* * might want to break up into per-class work that gets explicitly * chained. For right now, each class has to replicate all * superclass logic in hook routine */ /* * free the req subobject used for comparisons */ _XmPopWidgetExtData((Widget) sw, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); _XmProcessUnlock(); XtFree( (char *) ext); } /************************************************************************ * * SetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static Boolean SetValuesPrehook( Widget oldParent, Widget refParent, Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; XmSeparatorGCacheObject newSec, reqSec; Cardinal size; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmSeparatorGCacheObject)_XmExtObjAlloc(size); reqSec = (XmSeparatorGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy( &(newSec->separator_cache), SEPG_Cache(newParent), sizeof(XmSeparatorGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; extData->reqWidget = (Widget)reqSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); XtSetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); memcpy((XtPointer)reqSec, (XtPointer)newSec, size); SEPG_Cache(newParent) = &(((XmSeparatorGCacheObject)newSec)->separator_cache); SEPG_Cache(refParent) = &(((XmSeparatorGCacheObject)extData->reqWidget)->separator_cache); _XmExtImportArgs((Widget)newSec, args, num_args); return FALSE; } /************************************************************************ * * GetValuesPrehook * ************************************************************************/ /* ARGSUSED */ static void GetValuesPrehook( Widget newParent, ArgList args, Cardinal *num_args ) { XmWidgetExtData extData; XmBaseClassExt *cePtr; WidgetClass ec; XmSeparatorGCacheObject newSec; Cardinal size; _XmProcessLock(); cePtr = _XmGetBaseClassExtPtr(XtClass(newParent), XmQmotif); ec = (*cePtr)->secondaryObjectClass; size = ec->core_class.widget_size; newSec = (XmSeparatorGCacheObject)_XmExtObjAlloc(size); _XmProcessUnlock(); newSec->object.self = (Widget)newSec; newSec->object.widget_class = ec; newSec->object.parent = XtParent(newParent); newSec->object.xrm_name = newParent->core.xrm_name; newSec->object.being_destroyed = False; newSec->object.destroy_callbacks = NULL; newSec->object.constraints = NULL; newSec->ext.logicalParent = newParent; newSec->ext.extensionType = XmCACHE_EXTENSION; memcpy( &(newSec->separator_cache), SEPG_Cache(newParent), sizeof(XmSeparatorGCacheObjPart)); extData = (XmWidgetExtData) XtCalloc(1, sizeof(XmWidgetExtDataRec)); extData->widget = (Widget)newSec; _XmPushWidgetExtData(newParent, extData, XmCACHE_EXTENSION); XtGetSubvalues((XtPointer)newSec, ec->core_class.resources, ec->core_class.num_resources, args, *num_args); _XmExtGetValuesHook((Widget)newSec, args, num_args); } /************************************************************************ * * GetValuesPosthook * ************************************************************************/ /* ARGSUSED */ static void GetValuesPosthook( Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmProcessLock(); _XmExtObjFree((XtPointer) ext->widget); _XmProcessUnlock(); XtFree( (char *) ext); } /************************************************************************ * * SetValuesPosthook * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValuesPosthook( Widget current, Widget req, Widget new_w, ArgList args, Cardinal *num_args ) { XmWidgetExtData ext; /* * - register parts in cache. * - update cache pointers * - and free req */ /* assign if changed! */ _XmProcessLock(); if (!_XmSeparatorCacheCompare((XtPointer) SEPG_Cache(new_w), (XtPointer) SEPG_Cache(current))) { _XmCacheDelete( (XtPointer) SEPG_Cache(current)); /* delete the old one */ SEPG_Cache(new_w) = (XmSeparatorGCacheObjPart *) _XmCachePart(SEPG_ClassCachePart(new_w), (XtPointer) SEPG_Cache(new_w), sizeof(XmSeparatorGCacheObjPart)); } else SEPG_Cache(new_w) = SEPG_Cache(current); _XmPopWidgetExtData(new_w, &ext, XmCACHE_EXTENSION); _XmExtObjFree((XtPointer) ext->widget); _XmExtObjFree((XtPointer) ext->reqWidget); _XmProcessUnlock(); XtFree( (char *) ext); return FALSE; } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { XmSeparatorGadget request = (XmSeparatorGadget) rw ; XmSeparatorGadget new_w = (XmSeparatorGadget) nw ; new_w -> gadget.traversal_on = FALSE; /* Force highlightThickness to zero if in a menu. */ if (XmIsRowColumn(XtParent(new_w)) && ((RC_Type(XtParent(new_w)) == XmMENU_PULLDOWN) || (RC_Type(XtParent(new_w)) == XmMENU_POPUP))) new_w->gadget.highlight_thickness = 0; if( !XmRepTypeValidValue( XmRID_SEPARATOR_TYPE, SEPG_SeparatorType( new_w), (Widget) new_w) ) { SEPG_SeparatorType(new_w) = XmSHADOW_ETCHED_IN; } if( !XmRepTypeValidValue( XmRID_ORIENTATION, SEPG_Orientation( new_w), (Widget) new_w) ) { SEPG_Orientation(new_w) = XmHORIZONTAL; } if (SEPG_Orientation(new_w) == XmHORIZONTAL) { if (request -> rectangle.width == 0) new_w -> rectangle.width = 2 * new_w -> gadget.highlight_thickness +2; if (request -> rectangle.height == 0) { new_w -> rectangle.height = 2 * new_w -> gadget.highlight_thickness; if (SEPG_SeparatorType(new_w) == XmSINGLE_LINE || SEPG_SeparatorType(new_w) == XmSINGLE_DASHED_LINE) new_w -> rectangle.height += 3; else if (SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN_DASH || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT_DASH) new_w -> rectangle.height += new_w -> gadget.shadow_thickness; else if (SEPG_SeparatorType(new_w) == XmDOUBLE_LINE || SEPG_SeparatorType(new_w) == XmDOUBLE_DASHED_LINE) new_w -> rectangle.height += 5; else if (new_w -> rectangle.height == 0) new_w -> rectangle.height = 1; } } if (SEPG_Orientation(new_w) == XmVERTICAL) { if (request -> rectangle.height == 0) new_w -> rectangle.height = 2 * new_w -> gadget.highlight_thickness +2; if (request -> rectangle.width == 0) { new_w -> rectangle.width = 2 * new_w -> gadget.highlight_thickness; if (SEPG_SeparatorType(new_w) == XmSINGLE_LINE || SEPG_SeparatorType(new_w) == XmSINGLE_DASHED_LINE) new_w -> rectangle.width += 3; else if (SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN_DASH || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT_DASH) new_w -> rectangle.width += new_w -> gadget.shadow_thickness; else if (SEPG_SeparatorType(new_w) == XmDOUBLE_LINE || SEPG_SeparatorType(new_w) == XmDOUBLE_DASHED_LINE) new_w -> rectangle.width += 5; else if (new_w -> rectangle.width == 0) new_w -> rectangle.width = 1; } } DealWithColors(new_w); DealWithPixmaps(new_w); /* Get the drawing graphics contexts. */ GetSeparatorGC (new_w); GetBackgroundGC (new_w); SEPG_TopShadowGC(new_w) = _XmGetPixmapBasedGC (XtParent(nw), SEPG_TopShadowColor(new_w), SEPG_Background(new_w), SEPG_TopShadowPixmap(new_w)); SEPG_BottomShadowGC(new_w) = _XmGetPixmapBasedGC (XtParent(nw), SEPG_BottomShadowColor(new_w), SEPG_Background(new_w), SEPG_BottomShadowPixmap(new_w)); /* only want help input events */ new_w->gadget.event_mask = XmHELP_EVENT; } /* * * DealWithColors * * Deal with compatibility. * * */ static void DealWithColors( XmSeparatorGadget sg) { XmManagerWidget mw = (XmManagerWidget) XtParent(sg); /* If the gadget color is set to the tag value or it is the same as the manager color; bc mode is enabled otherwise initialize like a widget. */ if((SEPG_Background(sg) == INVALID_PIXEL || SEPG_Background(sg) == mw->core.background_pixel) && (SEPG_Foreground(sg) == INVALID_PIXEL || SEPG_Foreground(sg) == mw->manager.foreground) && (SEPG_TopShadowColor(sg) == INVALID_PIXEL || SEPG_TopShadowColor(sg) == mw->manager.top_shadow_color) && (SEPG_BottomShadowColor(sg) == INVALID_PIXEL || SEPG_BottomShadowColor(sg) == mw->manager.bottom_shadow_color) ) { SEPG_Background(sg) = mw->core.background_pixel; SEPG_Foreground(sg) = mw->manager.foreground; SEPG_TopShadowColor(sg) = mw->manager.top_shadow_color; SEPG_BottomShadowColor(sg) = mw->manager.bottom_shadow_color; } else { InitNewColorBehavior(sg); } } /* * InitNewColorBehavior * * Initialize colors like a widget. These are CallProcs so * they should be called with a correct offset. However offset * isn't used by these functions. Even so I supply offset. * You make the call. * */ static void InitNewColorBehavior( XmSeparatorGadget sg) { XrmValue value; value.size = sizeof(Pixel); if(SEPG_Background(sg) == INVALID_PIXEL) { _XmBackgroundColorDefault((Widget)sg, XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.background), &value); memcpy((char*) &SEPG_Background(sg), value.addr, value.size); } if(SEPG_Foreground(sg) == INVALID_PIXEL) { _XmForegroundColorDefault((Widget)sg, XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.foreground), &value); memcpy((char*) &SEPG_Foreground(sg), value.addr, value.size); } if(SEPG_TopShadowColor(sg) == INVALID_PIXEL) { _XmTopShadowColorDefault((Widget)sg, XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.top_shadow_color), &value); memcpy((char*) &SEPG_TopShadowColor(sg), value.addr, value.size); } if(SEPG_BottomShadowColor(sg) == INVALID_PIXEL) { _XmBottomShadowColorDefault((Widget)sg, XtOffsetOf(struct _XmSeparatorGCacheObjRec, separator_cache.bottom_shadow_color), &value); memcpy((char*) &SEPG_BottomShadowColor(sg), value.addr, value.size); } } /* * * DealWithPixmaps * * Deal with compatibility. * If any resource is set initialize like a widget otherwise get * everything from the parent. * * */ static void DealWithPixmaps( XmSeparatorGadget sg) { XmManagerWidget mw = (XmManagerWidget) XtParent(sg); if(SEPG_TopShadowPixmap(sg) == INVALID_PIXMAP || SEPG_TopShadowPixmap(sg) == mw->manager.top_shadow_pixmap ) { SEPG_TopShadowPixmap(sg) = mw->manager.top_shadow_pixmap; } else { InitNewPixmapBehavior(sg); } } /* * InitNewPixmapBehavior * * Initialize colors like a widget. These are CallProcs so * they should be called with a correct offset. However offset * isn't used by these functions. Even so I supply offset. * You make the call. * */ static void InitNewPixmapBehavior( XmSeparatorGadget sg) { XrmValue value; value.size = sizeof(Pixmap); if(SEPG_TopShadowPixmap(sg) == INVALID_PIXMAP) { SetTopShadowPixmapDefault((Widget)sg, 0, &value); SEPG_TopShadowColor(sg) = *value.addr; memcpy((char*) &SEPG_TopShadowPixmap(sg), value.addr, value.size); } } /************************************************************************ * * GetBackgroundGC * Get the graphics context used for drawing the separator. * ************************************************************************/ static void GetBackgroundGC( XmSeparatorGadget sg ) { XGCValues values; XtGCMask valueMask; XmManagerWidget mw; mw = (XmManagerWidget) XtParent(sg); sg->separator.fill_bg_box = ((mw->core.background_pixel != SEPG_Background(sg)) && (mw->core.background_pixmap == XmUNSPECIFIED_PIXMAP)); if (sg->separator.fill_bg_box) { valueMask = GCForeground | GCBackground; values.foreground = SEPG_Background(sg); values.background = SEPG_Foreground(sg); SEPG_BackgroundGC(sg) = XtGetGC ((Widget) mw, valueMask, &values); } else { /* CR 7650: At least initialize the field. */ SEPG_BackgroundGC(sg) = (GC) None; } } /************************************************************************ * * GetSeparatorGC * Get the graphics context used for drawing the separator. * ************************************************************************/ static void GetSeparatorGC( XmSeparatorGadget sg ) { XGCValues values; XtGCMask valueMask; XmManagerWidget mw; mw = (XmManagerWidget) XtParent(sg); valueMask = GCForeground | GCBackground; values.foreground = SEPG_Foreground(sg); values.background = SEPG_Background(sg); if (SEPG_SeparatorType(sg) == XmSINGLE_DASHED_LINE || SEPG_SeparatorType(sg) == XmDOUBLE_DASHED_LINE) { valueMask = valueMask | GCLineStyle; values.line_style = LineDoubleDash; } SEPG_SeparatorGC(sg) = XtGetGC ((Widget) mw, valueMask, &values); } /************************************************************************ * * Redisplay * Invoke the application exposure callbacks. * ************************************************************************/ /*ARGSUSED*/ static void Redisplay( Widget wid, XEvent *event, Region region ) { XmSeparatorGadget sg = (XmSeparatorGadget) wid ; int background_x_offset, background_y_offset, background_width, background_height; if (XmIsRowColumn(XtParent(sg))) { Widget rowcol = XtParent(sg); if ((RC_Type(rowcol) == XmMENU_PULLDOWN || RC_Type(rowcol) == XmMENU_POPUP) && (! ((ShellWidget)XtParent(rowcol))->shell.popped_up)) { /* in a menu system that is not yet popped up, ignore */ return; } } background_height = (int) sg->rectangle.height - 2 * sg->gadget.highlight_thickness; background_width = (int) sg->rectangle.width - 2 * sg->gadget.highlight_thickness; background_x_offset = sg->rectangle.x + sg->gadget.highlight_thickness; background_y_offset = sg->rectangle.y + sg->gadget.highlight_thickness; if (sg->separator.fill_bg_box) { XFillRectangle(XtDisplay(sg), XtWindow((Widget) sg), SEPG_BackgroundGC(sg), background_x_offset, background_y_offset, background_width, background_height); } XmeDrawSeparator(XtDisplay((Widget) sg), XtWindow((Widget) sg), SEPG_TopShadowGC(sg), SEPG_BottomShadowGC(sg), SEPG_SeparatorGC(sg), sg->rectangle.x + sg->gadget.highlight_thickness, sg->rectangle.y + sg->gadget.highlight_thickness , sg->rectangle.width - 2*sg->gadget.highlight_thickness, sg->rectangle.height - 2*sg->gadget.highlight_thickness, sg->gadget.shadow_thickness, SEPG_Margin(sg), SEPG_Orientation(sg), SEPG_SeparatorType(sg)); } /************************************************************************ * * Destroy * Remove the callback lists. * ************************************************************************/ static void Destroy( Widget sg ) { XmManagerWidget mw = (XmManagerWidget) XtParent(sg); XtReleaseGC( (Widget) mw, SEPG_SeparatorGC(sg)); if (((XmSeparatorGadget) sg)->separator.fill_bg_box) XtReleaseGC( (Widget) mw, SEPG_BackgroundGC(sg)); XtReleaseGC( (Widget) mw, SEPG_TopShadowGC(sg)); XtReleaseGC( (Widget) mw, SEPG_BottomShadowGC(sg)); _XmProcessLock(); _XmCacheDelete( (XtPointer) SEPG_Cache(sg)); _XmProcessUnlock(); } static Boolean HandleRedraw ( Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag) { XmSeparatorGadget sg = (XmSeparatorGadget) kid ; XmManagerWidget mw = (XmManagerWidget) new_parent; XmManagerWidget curmw = (XmManagerWidget) cur_parent; Boolean redraw = False; XmSeparatorGCacheObjPart oldCopy; _XmProcessLock(); _XmCacheCopy((XtPointer) SEPG_Cache(sg), (XtPointer) &oldCopy, sizeof(XmSeparatorGCacheObjPart)); _XmCacheDelete ((XtPointer) SEPG_Cache(sg)); SEPG_Cache(sg) = &oldCopy; _XmProcessUnlock(); if ((visual_flag & VisualBackgroundPixel) && (SEPG_Background(sg) == curmw->core.background_pixel)) { XtReleaseGC (XtParent(sg), SEPG_SeparatorGC(sg)); if (sg->separator.fill_bg_box) XtReleaseGC (XtParent(sg), SEPG_BackgroundGC(sg)); SEPG_Background(sg) = mw->core.background_pixel; GetSeparatorGC((XmSeparatorGadget)sg); GetBackgroundGC((XmSeparatorGadget)sg); redraw = True; } if (visual_flag & VisualBackgroundPixmap) { if (sg->separator.fill_bg_box) XtReleaseGC (XtParent(sg), SEPG_BackgroundGC(sg)); GetBackgroundGC((XmSeparatorGadget)sg); redraw = True; } if ((visual_flag & VisualForeground) && (SEPG_Foreground(sg) == curmw->manager.foreground)) { XtReleaseGC (XtParent(sg), SEPG_SeparatorGC(sg)); XtReleaseGC (XtParent(sg), SEPG_TopShadowGC(sg)); SEPG_Foreground(sg) = mw->manager.foreground; GetSeparatorGC((XmSeparatorGadget)sg); SEPG_TopShadowGC(sg) = _XmGetPixmapBasedGC (XtParent(sg), SEPG_TopShadowColor(sg), SEPG_Background(sg), SEPG_TopShadowPixmap(sg)); redraw = True; } if (visual_flag & (VisualTopShadowColor | VisualTopShadowPixmap)) { XtReleaseGC (XtParent(sg), SEPG_TopShadowGC(sg)); if(SEPG_TopShadowColor(sg) == curmw->manager.top_shadow_color) SEPG_TopShadowColor(sg) = mw->manager.top_shadow_color; if(SEPG_TopShadowPixmap(sg) == curmw->manager.top_shadow_pixmap && (SEPG_TopShadowPixmap(sg) != XmUNSPECIFIED_PIXMAP || SEPG_TopShadowColor(sg) == curmw->manager.top_shadow_color)) SEPG_TopShadowPixmap(sg) = mw->manager.top_shadow_pixmap; SEPG_TopShadowGC(sg) = _XmGetPixmapBasedGC (XtParent(sg), SEPG_TopShadowColor(sg), SEPG_Background(sg), SEPG_TopShadowPixmap(sg)); redraw = True; } if (visual_flag & (VisualBottomShadowColor | VisualBottomShadowPixmap)) { XtReleaseGC (XtParent(sg), SEPG_BottomShadowGC(sg)); if(SEPG_BottomShadowColor(sg) == curmw->manager.bottom_shadow_color) SEPG_BottomShadowColor(sg) = mw->manager.bottom_shadow_color; if(SEPG_BottomShadowPixmap(sg) == curmw->manager.bottom_shadow_pixmap && (SEPG_BottomShadowPixmap(sg) != XmUNSPECIFIED_PIXMAP || SEPG_BottomShadowColor(sg) == curmw->manager.bottom_shadow_color)) SEPG_BottomShadowPixmap(sg) = mw->manager.bottom_shadow_pixmap; SEPG_BottomShadowGC(sg) = _XmGetPixmapBasedGC (XtParent(sg), SEPG_BottomShadowColor(sg), SEPG_Background(sg), SEPG_BottomShadowPixmap(sg)); redraw = True; } _XmProcessLock(); SEPG_Cache(sg) = (XmSeparatorGCacheObjPart *) _XmCachePart(SEPG_ClassCachePart(sg), (XtPointer) SEPG_Cache(sg), sizeof(XmSeparatorGCacheObjPart)); _XmProcessUnlock(); return redraw ; } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmSeparatorGadget current = (XmSeparatorGadget) cw ; XmSeparatorGadget request = (XmSeparatorGadget) rw ; XmSeparatorGadget new_w = (XmSeparatorGadget) nw ; Boolean flag = FALSE; XmManagerWidget new_mw = (XmManagerWidget) XtParent(new_w); /* * We never allow our traversal flags to be changed during SetValues(); * this is enforced by our superclass. */ /* Force traversal_on to FALSE */ new_w -> gadget.traversal_on = FALSE; /* Force highlightThickness to zero if in a menu. */ if (XmIsRowColumn(XtParent(new_w)) && ((RC_Type(XtParent(new_w)) == XmMENU_PULLDOWN) || (RC_Type(XtParent(new_w)) == XmMENU_POPUP))) new_w->gadget.highlight_thickness = 0; if( !XmRepTypeValidValue( XmRID_SEPARATOR_TYPE, SEPG_SeparatorType( new_w), (Widget) new_w) ) { SEPG_SeparatorType(new_w) = SEPG_SeparatorType(current); } if( !XmRepTypeValidValue( XmRID_ORIENTATION, SEPG_Orientation( new_w), (Widget) new_w) ) { SEPG_Orientation(new_w) = SEPG_Orientation(current); } if (SEPG_Orientation(new_w) == XmHORIZONTAL) { if (request -> rectangle.width == 0) new_w -> rectangle.width = 2 * new_w -> gadget.highlight_thickness + 2; if (request -> rectangle.height == 0) { new_w -> rectangle.height = 2 * new_w -> gadget.highlight_thickness; if (SEPG_SeparatorType(new_w) == XmSINGLE_LINE || SEPG_SeparatorType(new_w) == XmSINGLE_DASHED_LINE) new_w -> rectangle.height += 3; else if (SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN_DASH || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT_DASH) new_w -> rectangle.height += new_w -> gadget.shadow_thickness; else if (SEPG_SeparatorType(new_w) == XmDOUBLE_LINE || SEPG_SeparatorType(new_w) == XmDOUBLE_DASHED_LINE) new_w -> rectangle.height += 5; else if (new_w -> rectangle.height == 0) new_w -> rectangle.height = 1; } if ((SEPG_SeparatorType(new_w) != SEPG_SeparatorType(current) || new_w->gadget.shadow_thickness != current->gadget.shadow_thickness || new_w->gadget.highlight_thickness != current->gadget.highlight_thickness) && request -> rectangle.height == current -> rectangle.height) { if (SEPG_SeparatorType(new_w) == XmSINGLE_LINE || SEPG_SeparatorType(new_w) == XmSINGLE_DASHED_LINE) new_w -> rectangle.height = 2 * new_w -> gadget.highlight_thickness + 3; else if (SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN_DASH || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT_DASH) new_w -> rectangle.height = 2 * new_w -> gadget.highlight_thickness + new_w -> gadget.shadow_thickness; else if (SEPG_SeparatorType(new_w) == XmDOUBLE_LINE || SEPG_SeparatorType(new_w) == XmDOUBLE_DASHED_LINE) new_w -> rectangle.height = 2 * new_w -> gadget.highlight_thickness + 5; } } if (SEPG_Orientation(new_w) == XmVERTICAL) { if (request -> rectangle.height == 0) new_w -> rectangle.height = 2 * new_w -> gadget.highlight_thickness + 2; if (request -> rectangle.width == 0) { new_w -> rectangle.width = 2 * new_w -> gadget.highlight_thickness; if (SEPG_SeparatorType(new_w) == XmSINGLE_LINE || SEPG_SeparatorType(new_w) == XmSINGLE_DASHED_LINE) new_w -> rectangle.width += 3; else if (SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN_DASH || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT_DASH) new_w -> rectangle.width += new_w -> gadget.shadow_thickness; else if (SEPG_SeparatorType(new_w) == XmDOUBLE_LINE || SEPG_SeparatorType(new_w) == XmDOUBLE_DASHED_LINE) new_w -> rectangle.width += 5; else if (new_w -> rectangle.width == 0) new_w -> rectangle.width = 1; } if ((SEPG_SeparatorType(new_w) != SEPG_SeparatorType(current) || new_w->gadget.shadow_thickness != current->gadget.shadow_thickness || new_w->gadget.highlight_thickness != current->gadget.highlight_thickness) && request -> rectangle.width == current -> rectangle.width) { if (SEPG_SeparatorType(new_w) == XmSINGLE_LINE || SEPG_SeparatorType(new_w) == XmSINGLE_DASHED_LINE) new_w -> rectangle.width = 2 * new_w -> gadget.highlight_thickness + 3; else if (SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_IN_DASH || SEPG_SeparatorType(new_w) == XmSHADOW_ETCHED_OUT_DASH) new_w -> rectangle.width = 2 * new_w -> gadget.highlight_thickness + new_w -> gadget.shadow_thickness; else if (SEPG_SeparatorType(new_w) == XmDOUBLE_LINE || SEPG_SeparatorType(new_w) == XmDOUBLE_DASHED_LINE) new_w -> rectangle.width = 2 * new_w -> gadget.highlight_thickness + 5; } } if (SEPG_Orientation(new_w) != SEPG_Orientation(current) || SEPG_Margin(new_w) != SEPG_Margin(current) || new_w -> gadget.shadow_thickness != current -> gadget.shadow_thickness) flag = TRUE; if (SEPG_SeparatorType(new_w) != SEPG_SeparatorType(current) || SEPG_Background(new_w)!= SEPG_Background(current) || SEPG_Foreground(new_w)!= SEPG_Foreground(current)) { XtReleaseGC( (Widget) new_mw, SEPG_SeparatorGC(new_w)); GetSeparatorGC (new_w); flag = TRUE; } if (SEPG_Background(new_w)!= SEPG_Background(current)) { if (new_w->separator.fill_bg_box) XtReleaseGC( (Widget) new_mw, SEPG_BackgroundGC(new_w)); GetBackgroundGC (new_w); flag = TRUE; } if (SEPG_TopShadowColor(new_w)!= SEPG_TopShadowColor(current) || (SEPG_TopShadowPixmap(new_w)!= SEPG_TopShadowPixmap(current))) { XtReleaseGC( (Widget) new_mw, SEPG_TopShadowGC(new_w)); SEPG_TopShadowGC(new_w) = _XmGetPixmapBasedGC ((Widget) new_mw, SEPG_TopShadowColor(new_w), SEPG_Background(new_w), SEPG_TopShadowPixmap(new_w)); flag = TRUE; } if (SEPG_BottomShadowColor(new_w)!= SEPG_BottomShadowColor(current) || (SEPG_BottomShadowPixmap(new_w)!= SEPG_BottomShadowPixmap(current))) { XtReleaseGC( (Widget) new_mw, SEPG_BottomShadowGC(new_w)); SEPG_BottomShadowGC(new_w) = _XmGetPixmapBasedGC ((Widget) new_mw, SEPG_BottomShadowColor(new_w), SEPG_Background(new_w), SEPG_BottomShadowPixmap(new_w)); flag = TRUE; } /* SPB Why is this here? */ /* Initialize the interesting input types */ new_w->gadget.event_mask = XmHELP_EVENT; return (flag); } /************************************************************************ * * Help * ************************************************************************/ static void Help( Widget sg, XEvent *event ) { XmRowColumnWidget parent = (XmRowColumnWidget) XtParent(sg); if (XmIsRowColumn(parent)) { if (RC_Type(parent) == XmMENU_POPUP || RC_Type(parent) == XmMENU_PULLDOWN) { (* ((XmRowColumnWidgetClass) parent->core.widget_class)-> row_column_class.menuProcedures) (XmMENU_POPDOWN, XtParent(sg), NULL, event, NULL); } } _XmSocorro( (Widget) sg, event, NULL, NULL); } /************************************************************************ * * XmCreateSeparatorGadget * Create an instance of a separator and return the widget id. * ************************************************************************/ Widget XmCreateSeparatorGadget( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget (name, xmSeparatorGadgetClass, parent, arglist, argcount)); } Widget XmVaCreateSeparatorGadget( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSeparatorGadgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedSeparatorGadget( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmSeparatorGadgetClass, parent, True, var, count); va_end(var); return w; } /**************************************************** * Functions for manipulating Secondary Resources. *********************************************************/ /* * GetSeparatorGClassSecResData() * Create a XmSecondaryResourceDataRec for each secondary resource; * Put the pointers to these records in an array of pointers; * Return the pointer to the array of pointers. * client_data = Address of the structure in the class record which * represents the (template of ) the secondary data. */ /*ARGSUSED*/ static Cardinal GetSeparatorGClassSecResData( WidgetClass w_class, /* unused */ XmSecondaryResourceData **data_rtn ) { int arrayCount; XmBaseClassExt bcePtr; String resource_class, resource_name; XtPointer client_data; _XmProcessLock(); bcePtr = &(separatorBaseClassExtRec ); client_data = NULL; resource_class = NULL; resource_name = NULL; arrayCount = _XmSecondaryResourceData ( bcePtr, data_rtn, client_data, resource_name, resource_class, GetSeparatorGClassSecResBase); _XmProcessUnlock(); return (arrayCount); } /* * GetSeparatorGClassResBase () * retrun the address of the base of resources. * If client data is the same as the address of the secndary data in the * class record then send the base address of the cache-resources for this * instance of the widget. * Right now we do not try to get the address of the cached_data from * the Gadget component of this instance - since Gadget class does not * have any cached_resources defined. If later secondary resources are * defined for Gadget class then this routine will have to change. */ /*ARGSUSED*/ static XtPointer GetSeparatorGClassSecResBase( Widget widget, XtPointer client_data ) /* unused */ { XtPointer widgetSecdataPtr; _XmProcessLock(); widgetSecdataPtr = (XtPointer) (SEPG_Cache(widget)); _XmProcessUnlock(); return (widgetSecdataPtr); } static void GetColors(Widget w, XmAccessColorData color_data) { color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor; color_data->background = SEPG_Background(w); color_data->foreground = SEPG_Foreground(w); color_data->highlight_color = SEPG_Foreground(w); color_data->top_shadow_color = SEPG_TopShadowColor(w); color_data->bottom_shadow_color = SEPG_BottomShadowColor(w); } motif-2.3.8/lib/Xm/SpinBP.h0000644000175000017500000001226712672140200012223 00000000000000/* $TOG: SpinBP.h /main/7 1999/09/01 17:14:17 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmSpinBP_h #define _XmSpinBP_h #include #include #include #ifdef __cplusplus extern "C" { #endif /* Spin constraints */ typedef struct _XmSpinBoxConstraint { XmStringTable values; /* array of XmString */ int position; /* position of current selection */ int num_values; /* number of XmString in the array */ int minimum_value; /* parameters for autonumeric mode */ int maximum_value; int increment_value; short decimal_points; unsigned char sb_child_type; unsigned char arrow_sensitivity; Boolean wrap; unsigned char position_type; /* governs interpretation of .position: XmPOSITION_{ARRAY,VALUE} */ } XmSpinBoxConstraintPart, *XmSpinBoxConstraint; typedef struct _XmSpinBoxConstraintRec { XmManagerConstraintPart manager; XmSpinBoxConstraintPart spinBox; } XmSpinBoxConstraintRec, *XmSpinBoxConstraintPtr; typedef Widget (*XmGetCallbackWidgetProc)(Widget); /* Spin class structure */ typedef struct _XmSpinBoxClassPart { XmGetCallbackWidgetProc get_callback_widget; XtPointer extension; /* not used */ } XmSpinBoxClassPart; /* Full class record declaration for Spin class */ typedef struct _XmSpinBoxClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmSpinBoxClassPart spinBox_class; } XmSpinBoxClassRec; externalref XmSpinBoxClassRec xmSpinBoxClassRec; /* The Spin instance record */ typedef struct _XmSpinBoxPart { Dimension arrow_size; Dimension margin_width; Dimension margin_height; Dimension spacing; unsigned int initial_delay; unsigned int repeat_delay; XtCallbackList modify_verify_cb; /* CB list for new selection */ XtCallbackList value_changed_cb; /* CB list for new selection */ XRectangle up_arrow_rect; XRectangle down_arrow_rect; Widget textw; /* text widget */ int boundary; int last_hit; int make_change; Dimension ideal_height; Dimension ideal_width; GC arrow_gc; GC insensitive_gc; Mask dim_mask; /* for the navigator trait */ XtIntervalId spin_timer; Boolean up_arrow_pressed; Boolean down_arrow_pressed; unsigned char arrow_layout; unsigned char default_arrow_sensitivity; Dimension detail_shadow_thickness; unsigned char arrow_orientation; /* Xm_ARROWS_{VERTICAL,HORIZONTAL} */ } XmSpinBoxPart; /* Full instance record declaration */ typedef struct _XmSpinBoxRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmSpinBoxPart spinBox; } XmSpinBoxRec; /* Macros */ #define XmRPositionValue "PositionValue" #define SB_GetConstraintRec(w) \ ((XmSpinBoxConstraint)(&((XmSpinBoxConstraintPtr) (w)->core.constraints)->spinBox)) #define SB_WithChild(w) \ (((XmSpinBoxRec *) (w))->spinBox.textw != NULL) #define SB_ChildCount(w) \ (((XmSpinBoxRec *) (w))->composite.num_children) #define SB_GetArrowOrientation(w) \ (((XmSpinBoxRec *) (w))->spinBox.arrow_orientation) #define SB_ChildIsNumeric(wc) \ (((XmSpinBoxConstraint) (wc))->sb_child_type == (unsigned char) XmNUMERIC) #define SB_ChildPositionTypeIsValue(wc) \ (((XmSpinBoxConstraint) (wc))->position_type == \ (unsigned char) XmPOSITION_VALUE) #define SB_ChildMaximumPositionValue(wc) \ ( ( ((wc) == (XmSpinBoxConstraint) NULL) ? \ 0 : \ ( (SB_ChildIsNumeric(wc)) ? \ (wc)->maximum_value : \ ( ((wc)->num_values > 0) ? \ ((wc)->num_values - 1) : \ 0 \ ) \ ) \ ) \ ) #define SB_ChildMinimumPositionValue(wc) \ ( ( ((wc) == (XmSpinBoxConstraint) NULL) ? \ 0 : \ ( (SB_ChildIsNumeric(wc)) ? \ (wc)->minimum_value : \ 0 \ ) \ ) \ ) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _SpinBP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Text.c0000644000175000017500000036511513145162623012023 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Text.c /main/47 1999/01/26 15:18:26 mgreess $" #endif #endif #define TEXT #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "MessagesI.h" #include "RepTypeI.h" #include "TextI.h" #include "TextInI.h" #include "TextOutI.h" #include "TextSelI.h" #include "TextStrSoI.h" #include "VendorSEI.h" #include "XmI.h" #include "XmStringI.h" #define FIX_1367 #define FIX_1147 /* Resolution independence conversion functions */ #define MESSAGE2 _XmMMsgText_0000 /* Memory Management for global line table */ #define INIT_TABLE_SIZE 64 #define TABLE_INCREMENT 1024 #define XmDYNAMIC_BOOL 255 /* Change ChangeVSB() and RedisplayHBar from TextOut.c to non-static functions; * they are needed for updating the scroll bars after re-enable redisplay. * DisableRedisplay prohibits the visuals of the widget from being updated * as the widget's contents are changed. If the widget is a scrolled widget, * this change prohibits the scroll bars from being updated until redisplay * is re-enabled. */ extern void _XmChangeVSB(XmTextWidget widget); extern void _XmRedisplayHBar(XmTextWidget widget); extern void _XmChangeHSB(XmTextWidget widget); extern void _XmRedisplayVBar(XmTextWidget widget); /******** Static Function Declarations ********/ static void NullAddWidget(XmTextSource source, XmTextWidget tw); static void NullRemoveWidget(XmTextSource source, XmTextWidget tw); static XmTextPosition NullRead(XmTextSource source, XmTextPosition position, XmTextPosition last_position, XmTextBlock block); static XmTextStatus NullReplace(XmTextWidget tw, XEvent *event, XmTextPosition *start, XmTextPosition *end, XmTextBlock block, #if NeedWidePrototypes int call_callbacks); #else Boolean call_callbacks); #endif /* NeedsWidePrototypes */ static XmTextPosition NullScan(XmTextSource source, XmTextPosition position, XmTextScanType sType, XmTextScanDirection dir, int n, #if NeedWidePrototypes int include); #else Boolean include); #endif /* NeedWidePrototypes */ static Boolean NullGetSelection(XmTextSource source, XmTextPosition *start, XmTextPosition *end); static void NullSetSelection(XmTextSource source, XmTextPosition start, XmTextPosition end, Time time); static void _XmCreateCutBuffers(Widget w); static Cardinal GetSecResData(WidgetClass w_class, XmSecondaryResourceData **secResDataRtn); static void ClassPartInitialize(WidgetClass wc); static void ClassInitialize(void); static void AddRedraw(XmTextWidget tw, XmTextPosition left, XmTextPosition right); static _XmHighlightRec * FindHighlight(XmTextWidget tw, XmTextPosition position, XmTextScanDirection dir); static void DisplayText(XmTextWidget tw, XmTextPosition updateFrom, XmTextPosition updateTo); static void RedrawChanges(XmTextWidget tw); static void DoMove(XmTextWidget tw, int startcopy, int endcopy, int destcopy); static void RefigureLines(XmTextWidget tw); static void RemoveLines(XmTextWidget tw, int num_lines, unsigned int cur_index); static void AddLines(XmTextWidget tw, XmTextLineTable temp_table, unsigned int tmp_index, unsigned int current_index); static void InitializeLineTable(XmTextWidget tw, register int size); static void FindHighlightingChanges(XmTextWidget tw); static void Redisplay(XmTextWidget tw); static void InsertHighlight(XmTextWidget tw, XmTextPosition position, XmHighlightMode mode); static void Initialize(Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void InitializeHook(Widget wid, ArgList args, Cardinal *num_args_ptr); static void Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes); static void Destroy(Widget w); static void Resize(Widget w); static void DoExpose(Widget w, XEvent *event, Region region); static void GetValuesHook(Widget w, ArgList args, Cardinal *num_args_ptr); static Boolean SetValues(Widget oldw, Widget reqw, Widget new_w, ArgList args, Cardinal *num_args); static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *reply); static void _XmTextSetString(Widget widget, char *value); static XtPointer TextGetValue(Widget w, int format); static void TextSetValue(Widget w, XtPointer s, int format); static int TextPreferredValue(Widget w); static int PreeditStart(XIC xic, XPointer client_data, XPointer call_data); static void PreeditDone(XIC xic, XPointer client_data, XPointer call_data); static void PreeditDraw(XIC xic, XPointer client_data, XIMPreeditDrawCallbackStruct *call_data); static void PreeditCaret(XIC xic, XPointer client_data, XIMPreeditCaretCallbackStruct *call_data); static void ResetUnder(XmTextWidget tw); /******** End Static Function Declarations ********/ /* * For resource list management. */ static XmTextSourceRec nullsource; static XmTextSource nullsourceptr = &nullsource; #define _XmTextEventBindings1 _XmTextIn_XmTextEventBindings1 #define _XmTextEventBindings2 _XmTextIn_XmTextEventBindings2 #define _XmTextEventBindings3 _XmTextIn_XmTextEventBindings3 #define _XmTextVEventBindings _XmTextIn_XmTextVEventBindings #define EraseInsertionPoint(tw)\ {\ (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off);\ } #define TextDrawInsertionPoint(tw)\ {\ (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on);\ } static XtResource resources[] = { { XmNsource, XmCSource, XmRPointer, sizeof(XtPointer), XtOffsetOf(struct _XmTextRec, text.source), XmRPointer, (XtPointer) &nullsourceptr }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.activate_callback), XmRCallback, NULL }, { XmNfocusCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.focus_callback), XmRCallback, NULL }, { XmNlosingFocusCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.losing_focus_callback), XmRCallback, NULL }, { XmNvalueChangedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.value_changed_callback), XmRCallback, NULL }, { XmNdestinationCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.destination_callback), XmRCallback, NULL }, { XmNmodifyVerifyCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.modify_verify_callback), XmRCallback, NULL }, { XmNmodifyVerifyCallbackWcs, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.wcs_modify_verify_callback), XmRCallback, NULL }, { XmNmotionVerifyCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.motion_verify_callback), XmRCallback, NULL }, { XmNgainPrimaryCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.gain_primary_callback), XmRCallback, NULL }, { XmNlosePrimaryCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmTextRec, text.lose_primary_callback), XmRCallback, NULL }, { XmNvalue, XmCValue, XmRString, sizeof(String), XtOffsetOf(struct _XmTextRec, text.value), XmRString, "" }, { XmNvalueWcs, XmCValueWcs, XmRValueWcs, sizeof(wchar_t*), XtOffsetOf(struct _XmTextRec, text.wc_value), XmRString, NULL }, { XmNmaxLength, XmCMaxLength, XmRInt, sizeof(int), XtOffsetOf(struct _XmTextRec, text.max_length), XmRImmediate, (XtPointer) INT_MAX }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(struct _XmTextRec, text.margin_height), XmRImmediate, (XtPointer) 5 }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(struct _XmTextRec, text.margin_width), XmRImmediate, (XtPointer) 5 }, { XmNoutputCreate, XmCOutputCreate, XmRFunction, sizeof(OutputCreateProc), XtOffsetOf(struct _XmTextRec, text.output_create), XmRFunction, (XtPointer) NULL }, { XmNinputCreate, XmCInputCreate, XmRFunction, sizeof(InputCreateProc), XtOffsetOf(struct _XmTextRec, text.input_create), XmRFunction, (XtPointer) NULL }, { XmNtopCharacter, XmCTopCharacter, XmRTextPosition, sizeof(XmTextPosition), XtOffsetOf(struct _XmTextRec, text.top_character), XmRImmediate, (XtPointer) 0 }, { XmNcursorPosition, XmCCursorPosition, XmRTextPosition, sizeof (XmTextPosition), XtOffsetOf(struct _XmTextRec, text.cursor_position), XmRImmediate, (XtPointer) 0 }, { XmNeditMode, XmCEditMode, XmREditMode, sizeof(int), XtOffsetOf(struct _XmTextRec, text.edit_mode), XmRImmediate, (XtPointer) XmSINGLE_LINE_EDIT }, { XmNautoShowCursorPosition, XmCAutoShowCursorPosition, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextRec, text.auto_show_cursor_position), XmRImmediate, (XtPointer) True }, { XmNeditable, XmCEditable, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextRec, text.editable), XmRImmediate, (XtPointer) True }, { XmNverifyBell, XmCVerifyBell, XmRBoolean, sizeof(Boolean), XtOffsetOf(struct _XmTextRec, text.verify_bell), XmRImmediate, (XtPointer) XmDYNAMIC_BOOL }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof (unsigned char), XtOffsetOf(struct _XmPrimitiveRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmTAB_GROUP }, { XmNtotalLines, XmCTotalLines, XmRInt, sizeof (int), XtOffsetOf(struct _XmTextRec, text.total_lines), XmRImmediate, (XtPointer) 1 }, }; /* Definition for resources that need special processing in get values */ static XmSyntheticResource get_resources[] = { { XmNmarginWidth, sizeof(Dimension), XtOffsetOf(struct _XmTextRec, text.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof(Dimension), XtOffsetOf(struct _XmTextRec, text.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, }; static XmBaseClassExtRec textBaseClassExtRec = { NULL, /* Next extension */ NULLQUARK, /* record type XmQmotif */ XmBaseClassExtVersion, /* version */ sizeof(XmBaseClassExtRec), /* size */ XmInheritInitializePrehook, /* initialize prehook */ XmInheritSetValuesPrehook, /* set_values prehook */ XmInheritInitializePosthook, /* initialize posthook */ XmInheritSetValuesPosthook, /* set_values posthook */ XmInheritClass, /* secondary class */ XmInheritSecObjectCreate, /* creation proc */ GetSecResData, /* getSecResData */ {0}, /* fast subclass */ XmInheritGetValuesPrehook, /* get_values prehook */ XmInheritGetValuesPosthook, /* get_values posthook */ XmInheritClassPartInitPrehook, /* classPartInitPrehook */ XmInheritClassPartInitPosthook, /* classPartInitPosthook*/ NULL, /* ext_resources */ NULL, /* compiled_ext_resources*/ 0, /* num_ext_resources */ FALSE, /* use_sub_resources */ XmInheritWidgetNavigable, /* widgetNavigable */ XmInheritFocusChange, /* focusChange */ NULL, /* wrapperData */ }; static XmPrimitiveClassExtRec _XmTextPrimClassExtRec = { NULL, NULLQUARK, XmPrimitiveClassExtVersion, sizeof(XmPrimitiveClassExtRec), _XmTextGetBaselines, /* widget_baseline */ _XmTextGetDisplayRect, /* widget_display_rect */ _XmTextMarginsProc, /* get/set widget margins */ }; externaldef(xmtextclassrec) XmTextClassRec xmTextClassRec = { { /* core_class fields */ /* superclass */ (WidgetClass) &xmPrimitiveClassRec, /* class_name */ "XmText", /* widget_size */ sizeof(XmTextRec), /* class_initialize */ ClassInitialize, /* class_part_initiali*/ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ InitializeHook, /* realize */ Realize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave*/ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ DoExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ GetValuesHook, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ NULL, /* query_geometry */ QueryGeometry, /* display accel */ NULL, /* extension */ (XtPointer)&textBaseClassExtRec, }, /* primitive_class fields */ { XmInheritBorderHighlight, /* Primitive border_highlight */ XmInheritBorderUnhighlight, /* Primitive border_unhighlight */ NULL, /* translations */ NULL, /* arm_and_activate */ get_resources, /* get resources */ XtNumber(get_resources), /* num get_resources */ (XtPointer) &_XmTextPrimClassExtRec, /* extension */ }, { /* text class fields */ NULL, /* extension */ } }; externaldef(xmtextwidgetclass) WidgetClass xmTextWidgetClass = (WidgetClass) &xmTextClassRec; /**************************************************************** * * Definitions for the null source. * ****************************************************************/ /* ARGSUSED */ static void NullAddWidget(XmTextSource source, XmTextWidget tw) { } /* ARGSUSED */ static void NullRemoveWidget(XmTextSource source, XmTextWidget tw) { } /* ARGSUSED */ static XmTextPosition NullRead(XmTextSource source, XmTextPosition position, XmTextPosition last_position, XmTextBlock block) { block->ptr = NULL; block->length = 0; block->format = XmFMT_8_BIT; return 0; } /* ARGSUSED */ static XmTextStatus NullReplace(XmTextWidget tw, XEvent * event, XmTextPosition *start, XmTextPosition *end, XmTextBlock block, #if NeedWidePrototypes int call_callbacks) #else Boolean call_callbacks) #endif { return EditError; } /* ARGSUSED */ static XmTextPosition NullScan(XmTextSource source, XmTextPosition position, XmTextScanType sType, XmTextScanDirection dir, int n, #if NeedWidePrototypes int include) #else Boolean include) #endif /* NeedWidePrototypes */ { return 0; } /* ARGSUSED */ static Boolean NullGetSelection(XmTextSource source, XmTextPosition *start, XmTextPosition *end) { return FALSE; } /* ARGSUSED */ static void NullSetSelection(XmTextSource source, XmTextPosition start, XmTextPosition end, Time time) { } static void _XmCreateCutBuffers(Widget w) { static XContext context = (XContext)NULL; char * tmp = NULL; Display *dpy = XtDisplay(w); Screen *screen = XtScreen(w); XContext local_context; _XmProcessLock(); if (context == (XContext)NULL) context = XUniqueContext(); local_context = context; _XmProcessUnlock(); if (XFindContext(dpy, (Window)screen, local_context, &tmp)) { XmTextContextData ctx_data; Widget xm_display = (Widget) XmGetXmDisplay(dpy); ctx_data = (XmTextContextData) XtMalloc(sizeof(XmTextContextDataRec)); ctx_data->screen = screen; ctx_data->context = local_context; ctx_data->type = '\0'; XtAddCallback(xm_display, XmNdestroyCallback, (XtCallbackProc) _XmTextFreeContextData, (XtPointer) ctx_data); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER0, XA_STRING, 8, PropModeAppend, NULL, 0); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER1, XA_STRING, 8, PropModeAppend, NULL, 0); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER2, XA_STRING, 8, PropModeAppend, NULL, 0); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER3, XA_STRING, 8, PropModeAppend, NULL, 0); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER4, XA_STRING, 8, PropModeAppend, NULL, 0); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER5, XA_STRING, 8, PropModeAppend, NULL, 0); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER6, XA_STRING, 8, PropModeAppend, NULL, 0); XChangeProperty(dpy, RootWindowOfScreen(screen), XA_CUT_BUFFER7, XA_STRING, 8, PropModeAppend, NULL, 0); XSaveContext(dpy, (Window)screen, local_context, tmp); } } /**************************************************************** * * Private definitions. * ****************************************************************/ /************************************************************************ * * GetSecResData * ************************************************************************/ /* ARGSUSED */ static Cardinal GetSecResData(WidgetClass w_class, XmSecondaryResourceData **secResDataRtn) { XmSecondaryResourceData *secResDataPtr; secResDataPtr = (XmSecondaryResourceData *) XtMalloc(sizeof(XmSecondaryResourceData) * 2); _XmTextInputGetSecResData(&secResDataPtr[0]); _XmTextOutputGetSecResData(&secResDataPtr[1]); *secResDataRtn = secResDataPtr; return 2; } /*********************************************************************/ /* Trait definitions */ /*********************************************************************/ /* AccessXmString Trait record for Text */ static XmConst XmAccessTextualTraitRec TextCS = { 0, /* version */ TextGetValue, /* getValue */ TextSetValue, /* setValue */ TextPreferredValue, /* preferredFormat */ }; /**************************************************************** * * ClassPartInitialize * Set up the fast subclassing for the widget. Set up merged * Translation table. * ****************************************************************/ static void ClassPartInitialize(WidgetClass wc) { XmTextWidgetClass twc = (XmTextWidgetClass) wc; WidgetClass super; XmPrimitiveClassExt *wcePtr, *scePtr; char * event_bindings; _XmProcessLock(); super = twc->core_class.superclass; wcePtr = _XmGetPrimitiveClassExtPtr(wc, NULLQUARK); scePtr = _XmGetPrimitiveClassExtPtr(super, NULLQUARK); if ((*wcePtr)->widget_baseline == XmInheritBaselineProc) (*wcePtr)->widget_baseline = (*scePtr)->widget_baseline; if ((*wcePtr)->widget_display_rect == XmInheritDisplayRectProc) (*wcePtr)->widget_display_rect = (*scePtr)->widget_display_rect; event_bindings = (char *)XtMalloc(strlen(_XmTextEventBindings1) + strlen(_XmTextEventBindings2) + strlen(_XmTextEventBindings3) + 1); strcpy(event_bindings, _XmTextEventBindings1); strcat(event_bindings, _XmTextEventBindings2); strcat(event_bindings, _XmTextEventBindings3); xmTextClassRec.core_class.tm_table = (String) XtParseTranslationTable(event_bindings); XtFree(event_bindings); _XmFastSubclassInit (wc, XmTEXT_BIT); _XmProcessUnlock(); } /**************************************************************** * * ClassInitialize * * ****************************************************************/ static void ClassInitialize(void) { xmTextClassRec.core_class.actions = (XtActionList)_XmdefaultTextActionsTable; xmTextClassRec.core_class.num_actions = _XmdefaultTextActionsTableSize; nullsource.AddWidget = NullAddWidget; nullsource.RemoveWidget = NullRemoveWidget; nullsource.ReadSource = NullRead; nullsource.Replace = NullReplace; nullsource.Scan = NullScan; nullsource.GetSelection = NullGetSelection; nullsource.SetSelection = NullSetSelection; textBaseClassExtRec.record_type = XmQmotif; /* Install traits */ _XmTextInstallTransferTrait(); XmeTraitSet((XtPointer)xmTextWidgetClass, XmQTaccessTextual, (XtPointer) &TextCS); } /* * Mark the given range of text to be redrawn. */ static void AddRedraw(XmTextWidget tw, XmTextPosition left, XmTextPosition right) { RangeRec *r = tw->text.repaint.range; int i; if (left == tw->text.last_position && tw->text.output->data->number_lines >= 1) left = (*tw->text.source->Scan)(tw->text.source, left, XmSELECT_POSITION, XmsdLeft, 1, TRUE); if (left < right) { for (i = 0; i < tw->text.repaint.number; i++) { if (left <= r[i].to && right >= r[i].from) { r[i].from = MIN(left, r[i].from); r[i].to = MAX(right, r[i].to); return; } } if (tw->text.repaint.number >= tw->text.repaint.maximum) { tw->text.repaint.maximum = tw->text.repaint.number + 1; tw->text.repaint.range = r = (RangeRec *) XtRealloc((char *)r, tw->text.repaint.maximum * sizeof(RangeRec)); } r[tw->text.repaint.number].from = left; r[tw->text.repaint.number].to = right; tw->text.repaint.number++; } } /* * Find the highlight record corresponding to the given position. Returns a * pointer to the record. The third argument indicates whether we are probing * the left or right edge of a highlighting range. */ static _XmHighlightRec * FindHighlight(XmTextWidget tw, XmTextPosition position, XmTextScanDirection dir) { _XmHighlightRec *l = tw->text.highlight.list; int i; if (dir == XmsdLeft) { for (i=tw->text.highlight.number - 1; i>=0; i--) if (position >= l[i].position) { l = l + i; break; } } else { for (i=tw->text.highlight.number - 1; i>=0; i--) if (position > l[i].position) { l = l + i; break; } } return(l); } /* * Redraw the specified range of text. Should only be called by * RedrawChanges(), below (as well as calling itself recursively). */ static void DisplayText(XmTextWidget tw, XmTextPosition updateFrom, XmTextPosition updateTo) { LineNum i; XmTextPosition nextstart; _XmHighlightRec *l1, *l2; if (updateFrom < tw->text.top_character) updateFrom = tw->text.top_character; if (updateTo > tw->text.bottom_position) updateTo = tw->text.bottom_position; if (updateFrom > updateTo) return; l1 = FindHighlight(tw, updateFrom, XmsdLeft); l2 = FindHighlight(tw, updateTo, XmsdRight); if ( (l1 != l2) && (l1->position != l2->position) ) { DisplayText(tw, updateFrom, l2->position); updateFrom = l2->position; } /* * Once we get here, we need to paint all of the text from updateFrom to * updateTo with current highlightmode. We have to break this into * separate lines, and then call the output routine for each line. */ for (i = _XmTextPosToLine(tw, updateFrom); updateFrom <= updateTo && i < tw->text.number_lines; i++) { nextstart = tw->text.line[i+1].start; (*tw->text.output->Draw)(tw, i, updateFrom, MIN(updateTo, nextstart), l2->mode); updateFrom = nextstart; } } /* * Redraw the changed areas of the text. This should only be called by * Redisplay(), below. */ static void RedrawChanges(XmTextWidget tw) { RangeRec *r = tw->text.repaint.range; XmTextPosition updateFrom, updateTo; int w, i; EraseInsertionPoint(tw); while (tw->text.repaint.number != 0) { updateFrom = r[0].from; w = 0; for (i=1; itext.repaint.number; i++) { if (r[i].from < updateFrom) { updateFrom = r[i].from; w = i; } } updateTo = r[w].to; tw->text.repaint.number--; r[w].from = r[tw->text.repaint.number].from; r[w].to = r[tw->text.repaint.number].to; for (i=tw->text.repaint.number-1; i>=0; i--) { while (i < tw->text.repaint.number) { updateTo = MAX(r[i].to, updateTo); tw->text.repaint.number--; r[i].from = r[tw->text.repaint.number].from; r[i].to = r[tw->text.repaint.number].to; } } DisplayText(tw, updateFrom, updateTo); } if (tw->text.first_position == tw->text.last_position) { (*tw->text.output->Draw)(tw, (LineNum) 0, tw->text.first_position, tw->text.last_position, XmHIGHLIGHT_NORMAL); } TextDrawInsertionPoint(tw); } static void DoMove(XmTextWidget tw, int startcopy, int endcopy, int destcopy) { Line line = tw->text.line; LineNum i; EraseInsertionPoint(tw); if (tw->text.disable_depth == 0 && (*tw->text.output->MoveLines)(tw, (LineNum) startcopy, (LineNum) endcopy, (LineNum) destcopy)) { TextDrawInsertionPoint(tw); return; } for (i=destcopy; i <= destcopy + endcopy - startcopy; i++) AddRedraw(tw, line[i].start, line[i+1].start); TextDrawInsertionPoint(tw); } /* * Find the starting position of the line that is delta lines away from the * line starting with position start. */ XmTextPosition _XmTextFindScroll(XmTextWidget tw, XmTextPosition start, int delta) { register XmTextLineTable line_table; register unsigned int t_index; register unsigned int max_index = 0; if (tw->text.total_lines <= tw->text.table_index) tw->text.table_index = tw->text.total_lines - 1; line_table = tw->text.line_table; t_index = tw->text.table_index; max_index = tw->text.total_lines - 1; /* look forward to find the current record */ if (line_table[t_index].start_pos < (unsigned int) start) { while (t_index <= max_index && line_table[t_index].start_pos < (unsigned int) start) t_index++; /* special handling if last lines of text are blank */ if (t_index <= max_index && (line_table[t_index].start_pos == tw->text.last_position) && (tw->text.number_lines == -delta) && t_index == max_index) t_index++; } else /* look backward to find the current record */ while (t_index && line_table[t_index].start_pos > (unsigned int) start) t_index--; if (delta > 0) { t_index += delta; if (t_index > tw->text.total_lines - 1) t_index = tw->text.total_lines - 1; } else { if (t_index > -delta) t_index += delta; else t_index = 0; } start = line_table[t_index].start_pos; tw->text.table_index = t_index; return start; } /* * Refigure the line breaks in this widget. */ static void RefigureLines(XmTextWidget tw) { Line line = tw->text.line; LineNum i, j; Line oldline = NULL; static XmTextPosition tell_output_force_display = -1; int oldNumLines = tw->text.number_lines; int startcopy, endcopy, destcopy, lastcopy; /* %%% Document! */ if (tw->text.in_refigure_lines || !tw->text.needs_refigure_lines) return; tw->text.in_refigure_lines = TRUE; tw->text.needs_refigure_lines = FALSE; if (XtIsRealized((Widget)tw)) EraseInsertionPoint(tw); oldline = (Line) XtMalloc((oldNumLines + 2) * sizeof(LineRec)); memcpy((void *) oldline, (void *) line, (size_t) (oldNumLines + 1) * sizeof(LineRec)); if (tw->text.pending_scroll != 0) { tw->text.new_top = _XmTextFindScroll(tw, tw->text.new_top, tw->text.pending_scroll); tw->text.pending_scroll = 0; } if (tw->text.new_top < tw->text.first_position) tw->text.new_top = tw->text.first_position; line[0].start = tw->text.top_character = tw->text.new_top; line[0].past_end = FALSE; line[0].extra = NULL; tw->text.number_lines = 0; j = 0; startcopy = endcopy = lastcopy = destcopy = -99; for (i = 0; i == 0 || !line[i-1].past_end; i++) { if (i+2 > tw->text.maximum_lines) { tw->text.maximum_lines = i+2; line = tw->text.line = (Line) XtRealloc((char *)line, tw->text.maximum_lines * sizeof(LineRec)); } while (j < oldNumLines && oldline[j].start < line[i].start) j++; if (j < oldNumLines && oldline[j].start >= oldline[j+1].start) j = oldNumLines; if (j >= oldNumLines) oldline[j].start = -1; /* Make comparisons fail. */ if (line[i].start >= tw->text.forget_past || line[i].start != oldline[j].start || oldline[j].changed || oldline[j+1].changed) { line[i].past_end = !(*tw->text.output->MeasureLine)(tw, i, line[i].start, &line[i+1].start, &line[i].extra); line[i+1].extra = NULL; if (!line[i].past_end && (line[i+1].start == PASTENDPOS) && (line[i].start != PASTENDPOS)) AddRedraw(tw, line[i].start, tw->text.last_position); } else { line[i] = oldline[j]; oldline[j].extra = NULL; line[i].past_end = !(*tw->text.output->MeasureLine)(tw, i, line[i].start, NULL, NULL); line[i+1].start = oldline[j+1].start; line[i+1].extra = oldline[j+1].extra; } if (!line[i].past_end) { if (line[i].start != oldline[j].start || line[i+1].start != oldline[j+1].start || line[i].start >= tw->text.forget_past) { AddRedraw(tw, line[i].start, line[i+1].start); } else { if (i != j && line[i+1].start >= tw->text.last_position) AddRedraw(tw, tw->text.last_position, tw->text.last_position); if (oldline[j].changed) AddRedraw(tw, oldline[j].changed_position, line[i+1].start); if (i != j && line[i].start != PASTENDPOS) { if (endcopy == j-1) { endcopy = j; lastcopy++; } else if (lastcopy >= 0 && j <= lastcopy) { /* This line was stomped by a previous move. */ AddRedraw(tw, line[i].start, line[i+1].start); } else { if (startcopy >= 0) DoMove(tw, startcopy, endcopy, destcopy); startcopy = endcopy = j; destcopy = lastcopy = i; } } } } line[i].changed = FALSE; if (!line[i].past_end) tw->text.number_lines++; else tw->text.bottom_position = MIN(line[i].start, tw->text.last_position); } if (startcopy >= 0) { DoMove(tw, startcopy, endcopy, destcopy); } for (j=0; j<=oldNumLines; j++) if (oldline[j].extra) { XtFree((char *) oldline[j].extra); oldline[j].extra = NULL; } XtFree((char *)oldline); /* XTHREADS */ tw->text.in_refigure_lines = FALSE; if (tw->text.top_character >= tw->text.last_position && tw->text.last_position > tw->text.first_position && tw->text.output->data->number_lines > 1) { tw->text.pending_scroll = -1; /* Try to not ever display nothing. */ tw->text.needs_refigure_lines = TRUE; } if (tw->text.force_display >= 0) { if (tw->text.force_display < tw->text.top_character) { if (tw->text.force_display > tw->text.first_position) tw->text.new_top = tw->text.force_display + 1 ; else tw->text.new_top = tw->text.first_position; tw->text.pending_scroll--; } else if (tw->text.force_display > tw->text.bottom_position) { /* need to add one to account for border condition, * i.e. cursor at begginning of line */ if (tw->text.force_display < tw->text.last_position) tw->text.new_top = tw->text.force_display + 1; else tw->text.new_top = tw->text.last_position; tw->text.pending_scroll -= tw->text.number_lines; } else if (tw->text.force_display == line[tw->text.number_lines].start) { tw->text.new_top = tw->text.force_display; tw->text.pending_scroll -= (tw->text.number_lines - 1); } tw->text.needs_refigure_lines = TRUE; _XmProcessLock(); tell_output_force_display = tw->text.force_display; _XmProcessUnlock(); tw->text.force_display = -1; } if (tw->text.needs_refigure_lines) { RefigureLines(tw); if (XtIsRealized((Widget)tw)) TextDrawInsertionPoint(tw); return; } AddRedraw(tw, tw->text.forget_past, tw->text.bottom_position); tw->text.forget_past = LONG_MAX; _XmProcessLock(); if (tell_output_force_display >= 0) { (*tw->text.output->MakePositionVisible)(tw, tell_output_force_display); tell_output_force_display = -1; } _XmProcessUnlock(); if (XtIsRealized((Widget)tw)) TextDrawInsertionPoint(tw); } /************************************************************************ * * RemoveLines() - removes the lines from the global line table. * widget - the widget that contains the global table. * num_lines - number of lines to be removed. * cur_line - pointer to the start of the lines to be removed. * ************************************************************************/ /* ARGSUSED */ static void RemoveLines(XmTextWidget tw, int num_lines, unsigned int cur_index) { if (!num_lines) return; /* move the existing lines at the end of the buffer */ if (tw->text.total_lines > cur_index) memmove((void *) &tw->text.line_table[cur_index - num_lines], (void *) &tw->text.line_table[cur_index], (size_t) ((tw->text.total_lines - (cur_index)) * sizeof (XmTextLineTableRec))); /* reduce total line count */ tw->text.total_lines -= num_lines; /* fix for bug 5166 */ if (tw->text.total_lines <= tw->text.table_index) tw->text.table_index = tw->text.total_lines - 1; /* Shrink Table if Necessary */ if ((tw->text.table_size > TABLE_INCREMENT && tw->text.total_lines <= tw->text.table_size-TABLE_INCREMENT) || tw->text.total_lines <= tw->text.table_size >> 1) { tw->text.table_size = INIT_TABLE_SIZE; while (tw->text.total_lines >= tw->text.table_size) { if (tw->text.table_size < TABLE_INCREMENT) tw->text.table_size *= 2; else tw->text.table_size += TABLE_INCREMENT; } tw->text.line_table = (XmTextLineTable) XtRealloc((char *) tw->text.line_table, tw->text.table_size * sizeof(XmTextLineTableRec)); } } static void AddLines(XmTextWidget tw, XmTextLineTable temp_table, unsigned int tmp_index, unsigned int current_index) { register unsigned int i; register unsigned int size_needed; register unsigned int cur_index; register unsigned int temp_index; cur_index = current_index; temp_index = tmp_index; size_needed = tw->text.total_lines + temp_index; /* make sure table is big enough to handle the additional lines */ if (tw->text.table_size < size_needed) { while (tw->text.table_size < size_needed) if (tw->text.table_size < TABLE_INCREMENT) tw->text.table_size *= 2; else tw->text.table_size += TABLE_INCREMENT; tw->text.line_table = (XmTextLineTable) XtRealloc((char *) tw->text.line_table, tw->text.table_size * sizeof(XmTextLineTableRec)); } /* move the existing lines at the end of the buffer */ if (tw->text.total_lines > cur_index) memmove((void *) &tw->text.line_table[cur_index + temp_index], (void *) &tw->text.line_table[cur_index], (size_t) ((tw->text.total_lines - cur_index) * sizeof (XmTextLineTableRec))); tw->text.total_lines += temp_index; /* Add the lines from the temp table */ if (temp_table) for (i = 0; i < temp_index; i++, cur_index++) tw->text.line_table[cur_index] = temp_table[i]; } void _XmTextRealignLineTable(XmTextWidget tw, XmTextLineTable *temp_table, int *temp_table_size, register unsigned int cur_index, register XmTextPosition cur_start, register XmTextPosition cur_end) { register int table_size; register XmTextPosition line_end; register XmTextPosition next_start; XmTextLineTable line_table; if (temp_table) { line_table = *temp_table; table_size = *temp_table_size; } else { line_table = tw->text.line_table; table_size = tw->text.table_size; } line_table[cur_index].start_pos = next_start = cur_start; cur_index++; line_end = (*tw->text.source->Scan)(tw->text.source, cur_start, XmSELECT_LINE, XmsdRight, 1, TRUE); while (next_start < cur_end) { if (_XmTextShouldWordWrap(tw)) next_start = _XmTextFindLineEnd(tw, cur_start, NULL); else { if (cur_start != line_end) next_start = line_end; else next_start = PASTENDPOS; } if (next_start == PASTENDPOS || next_start == cur_end) break; if (next_start == cur_start) next_start = (*tw->text.source->Scan) (tw->text.source, cur_start, XmSELECT_POSITION, XmsdRight, 1, TRUE); if (cur_index >= table_size) { if (table_size < TABLE_INCREMENT) table_size *= 2; else table_size += TABLE_INCREMENT; line_table = (XmTextLineTable) XtRealloc((char *)line_table, table_size * sizeof(XmTextLineTableRec)); } line_table[cur_index].start_pos = (unsigned int) next_start; if (line_end == next_start) { line_table[cur_index].virt_line = 0; line_end = (*tw->text.source->Scan)(tw->text.source, next_start, XmSELECT_LINE, XmsdRight, 1, TRUE); } else line_table[cur_index].virt_line = 1; cur_index++; cur_start = next_start; } if (temp_table) { *temp_table = line_table; *temp_table_size = cur_index; } else { tw->text.total_lines = cur_index; tw->text.line_table = line_table; tw->text.table_size = table_size; } } static void InitializeLineTable(XmTextWidget tw, register int size) { register unsigned int t_index; register XmTextLineTable line_table; line_table = (XmTextLineTable) XtMalloc(size * sizeof(XmTextLineTableRec)); for (t_index = 0; t_index < size; t_index++) { line_table[t_index].start_pos = 0; line_table[t_index].virt_line = 0; } tw->text.line_table = line_table; tw->text.table_index = 0; tw->text.table_size = size; } unsigned int _XmTextGetTableIndex(XmTextWidget tw, XmTextPosition pos) { register XmTextLineTable line_table; register unsigned int cur_index; register unsigned int max_index; register XmTextPosition position; position = pos; max_index = tw->text.total_lines - 1; line_table = tw->text.line_table; cur_index = tw->text.table_index; /* look forward to find the current record */ if (line_table[cur_index].start_pos < (unsigned int) position) { while (cur_index < max_index && line_table[cur_index].start_pos < (unsigned int) position) cur_index++; /* if over shot it by one */ if ((unsigned int) position < line_table[cur_index].start_pos) cur_index--; } else /* look backward to find the current record */ while (cur_index && line_table[cur_index].start_pos > (unsigned int) position) cur_index--; return (cur_index); } void _XmTextUpdateLineTable(Widget widget, XmTextPosition start, XmTextPosition end, XmTextBlock block, #if NeedWidePrototypes int update) #else Boolean update) #endif /* NeedWidePrototypes */ { register unsigned int cur_index; register unsigned int begin_index; register unsigned int end_index; register XmTextLineTable line_table; register unsigned int max_index; register int lines_avail; register int length; register long delta; unsigned int start_index; unsigned int top_index; XmTextWidget tw = (XmTextWidget) widget; Boolean word_wrap = _XmTextShouldWordWrap(tw); XmTextPosition cur_start, cur_end; int diff = 0; int block_num_chars = 0; int char_size = 0; lines_avail = 0; max_index = tw->text.total_lines - 1; if (tw->text.char_size != 1) block_num_chars = _XmTextCountCharacters(block->ptr, block->length); else block_num_chars = block->length; delta = block_num_chars - (end - start); length = block_num_chars; if (tw->text.line_table == NULL) { if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) { InitializeLineTable(tw, 1); } else { InitializeLineTable(tw, INIT_TABLE_SIZE); } } /* if there is no change or we expect RelignLineTable() to be called before the line table is necessary */ if ((start == end && length == 0) || (word_wrap && !XtIsRealized(widget) && XmIsScrolledWindow(XtParent(widget)) && XtIsShell(XtParent(XtParent(widget))))) { return; } line_table = tw->text.line_table; cur_index = _XmTextGetTableIndex(tw, start); top_index = _XmTextGetTableIndex(tw, tw->text.top_character); begin_index = start_index = end_index = cur_index; if (word_wrap && delta > 0) cur_end = end + delta; else cur_end = end; /* Find the cur_end position. Count the number of lines that were deleted. */ if (end > start) { if (end_index < tw->text.total_lines) { while (end_index < max_index && line_table[end_index + 1].start_pos <= (unsigned int) cur_end) { end_index++; lines_avail++; } } else if (line_table[end_index].start_pos > (unsigned int) start && line_table[end_index].start_pos <= (unsigned int) cur_end) { lines_avail++; } } cur_index = end_index; if (word_wrap) { register int i; XmTextLineTable temp_table = NULL; int temp_table_size = 0; if (line_table[start_index].virt_line) start_index--; begin_index = start_index; /* get the start position of the line at the start index. */ cur_start = line_table[begin_index].start_pos; /* If we are not at the end of the table, */ if (cur_index < max_index) { /* find the next non-wordwrapped line. */ while (cur_index < max_index) { cur_index++; if (!line_table[cur_index].virt_line) break; } /* Continue only if we have found a non-wordwrapped line. */ if (!line_table[cur_index].virt_line) { /* Set the cur_end position to the position of the next non-wordwrapped line. */ cur_end = line_table[cur_index].start_pos; /* estimate the temp table size - in number of lines */ temp_table_size = cur_index - begin_index; /* make sure the size is not zero */ if (!temp_table_size) temp_table_size++; /* do initial allocation of the temp_table */ temp_table = (XmTextLineTable) XtMalloc(temp_table_size * sizeof(XmTextLineTableRec)); /* Determine the lines that have changed. */ _XmTextRealignLineTable(tw, &temp_table, &temp_table_size, 0, cur_start, cur_end + delta); /* Compute the difference in the number of lines that have changed */ diff = temp_table_size - (cur_index - begin_index); /* if new/wrapped lines were added, push line down*/ if (diff > 0) AddLines(tw, NULL, diff, cur_index); /* if new/wrapped lines were deleted, move line up */ else RemoveLines(tw, -diff, cur_index); /* * The line table may have been realloc'd in any of the three * previous function calls, so it must be reassigned to prevent * a stale pointer. */ line_table = tw->text.line_table; /* Bypass the first entry in the temp_table */ begin_index++; /* Add the lines from the temp table */ for (i = 1; i < temp_table_size; i++, begin_index++) line_table[begin_index] = temp_table[i]; /* Free temp table */ XtFree((char *)temp_table); /* Adjust the cur_index by the number of lines that changed. */ cur_index += diff; max_index += diff; /* Adjust start values in table by the amount of change */ while (cur_index <= max_index) { line_table[cur_index].start_pos += delta; cur_index++; } } else /* we are at the end of the table */ _XmTextRealignLineTable(tw, NULL, 0, begin_index, cur_start, PASTENDPOS); } else /* add lines to the end */ _XmTextRealignLineTable(tw, NULL, 0, begin_index, cur_start, PASTENDPOS); } else { register char *ptr; register XmTextLineTable temp_table; register int temp_table_size; register int temp_index; temp_table = NULL; temp_table_size = 0; temp_index = 0; ptr = block->ptr; cur_start = start; while (cur_index < max_index) { cur_index++; line_table[cur_index].start_pos += delta; } if (tw->text.char_size == 1) { char *nl; while (length > 0 && (nl = (char *)memchr(ptr, '\012', length)) != NULL) { nl++; cur_start += (nl - ptr); length -= (nl - ptr); ptr = nl; if (lines_avail && begin_index < tw->text.total_lines) { begin_index++; lines_avail--; line_table[begin_index].start_pos = (unsigned int)cur_start; } else { if (temp_index >= temp_table_size) { if (!temp_table_size) { if (tw->text.output->data->columns > 1) { temp_table_size = length / (tw->text.output->data->columns / 2); if (!temp_table_size) temp_table_size = 1; } else { if (length) temp_table_size = length; else temp_table_size = 1; } } else temp_table_size *= 2; temp_table = (XmTextLineTable)XtRealloc((char*)temp_table, temp_table_size * sizeof(XmTextLineTableRec)); } temp_table[temp_index].start_pos = (unsigned int) cur_start; temp_table[temp_index].virt_line = (unsigned int) 0; temp_index++; } } } else { while (length--) { #ifndef NO_MULTIBYTE char_size = mblen(ptr, tw->text.char_size); if (char_size < 0) break; /* error */ #else char_size = *ptr ? 1 : 0; #endif cur_start++; if (char_size == 1 && *ptr == '\012') { ptr++; if (lines_avail && begin_index < tw->text.total_lines) { begin_index++; lines_avail--; line_table[begin_index].start_pos = (unsigned int)cur_start; } else { if (temp_index >= temp_table_size) { if (!temp_table_size) { if (tw->text.output->data->columns > 1) { temp_table_size = length / (tw->text.output->data->columns / 2); if (!temp_table_size) temp_table_size = 1; } else { if (length) temp_table_size = length; else temp_table_size = 1; } } else temp_table_size *= 2; temp_table =(XmTextLineTable)XtRealloc((char*)temp_table, temp_table_size * sizeof(XmTextLineTableRec)); } temp_table[temp_index].start_pos = (unsigned int) cur_start; temp_table[temp_index].virt_line = (unsigned int) 0; temp_index++; } } else { ptr += char_size; } } } /* add a block of lines to the line table */ if (temp_index) { AddLines(tw, temp_table, temp_index, begin_index + 1); } /* remove lines that are no longer necessary */ if (lines_avail) { RemoveLines(tw, lines_avail, end_index + 1); } /* * The line table may have been realloc'd in any of the three * previous function calls, so it must be reassigned to prevent * a stale pointer. */ line_table = tw->text.line_table; diff = temp_index - lines_avail; if (temp_table) XtFree((char *)temp_table); } if (update) { if (start < tw->text.top_character) { if (end < tw->text.top_character) { tw->text.top_line += diff; tw->text.new_top = tw->text.top_character + delta; } else { int adjusted; if (diff < 0) adjusted = diff + (top_index - start_index); else adjusted = diff - (top_index - start_index); tw->text.top_line += adjusted; if (adjusted + (int) start_index <= 0) { tw->text.new_top = 0; } else if (adjusted + start_index > max_index) { tw->text.new_top = line_table[max_index].start_pos; } else { tw->text.new_top = line_table[start_index + adjusted].start_pos; } } tw->text.top_character = tw->text.new_top; tw->text.forget_past = MIN(tw->text.forget_past, tw->text.new_top); tw->text.top_line = _XmTextGetTableIndex(tw, tw->text.new_top); if (tw->text.top_line < 0) tw->text.top_line = 0; if (tw->text.top_line > tw->text.total_lines) tw->text.top_line = tw->text.total_lines - 1; } if (tw->text.table_index > tw->text.total_lines) tw->text.table_index = tw->text.total_lines; #ifdef FIX_1367 if (tw->text.on_or_off == on) { XmTextPosition cursorPos = tw->text.cursor_position; if (start < tw->text.cursor_position) { if (tw->text.cursor_position < end) { if (tw->text.cursor_position - start <= block_num_chars) cursorPos = tw->text.cursor_position; else cursorPos = start + block_num_chars; } else { cursorPos = tw->text.cursor_position - (end - start) + block_num_chars; } _XmTextSetCursorPosition(widget, cursorPos); } else if (start == tw->text.cursor_position && tw->text.auto_show_cursor_position) { _XmTextShowPosition((Widget)tw, cursorPos); } } #else if (start < tw->text.cursor_position && tw->text.on_or_off == on) { XmTextPosition cursorPos = tw->text.cursor_position; if (tw->text.cursor_position < end) { if (tw->text.cursor_position - start <= block_num_chars) cursorPos = tw->text.cursor_position; else cursorPos = start + block_num_chars; } else { cursorPos = tw->text.cursor_position - (end - start) + block_num_chars; } _XmTextSetCursorPosition(widget, cursorPos); } #endif } } /* * Compare the old_highlight list and the highlight list, determine what * changed, and call AddRedraw with the changed areas. */ static void FindHighlightingChanges(XmTextWidget tw) { int n1 = tw->text.old_highlight.number; int n2 = tw->text.highlight.number; _XmHighlightRec *l1 = tw->text.old_highlight.list; _XmHighlightRec *l2 = tw->text.highlight.list; int i1, i2; XmTextPosition next1, next2, last_position; i1 = i2 = 0; last_position = 0; while (i1 < n1 && i2 < n2) { if (i1 < n1-1) next1 = l1[i1+1].position; else next1 = tw->text.last_position; if (i2 < n2-1) next2 = l2[i2+1].position; else next2 = tw->text.last_position; if (l1[i1].mode != l2[i2].mode) { AddRedraw(tw, last_position, MIN(next1, next2)); } last_position = MIN(next1, next2); if (next1 <= next2) i1++; if (next1 >= next2) i2++; } } /* * Actually do some work. This routine gets called to actually paint all the * stuff that has been pending. Prevent recursive calls and text redisplays * during destroys */ static void Redisplay(XmTextWidget tw) { /* Prevent recursive calls or text redisplay during detroys. */ if (tw->text.in_redisplay || tw->core.being_destroyed || tw->text.disable_depth != 0 || !XtIsRealized((Widget)tw)) return; EraseInsertionPoint(tw); tw->text.in_redisplay = TRUE; if (tw->text.needs_refigure_lines) RefigureLines(tw); tw->text.needs_redisplay = FALSE; if (tw->text.highlight_changed) { FindHighlightingChanges(tw); tw->text.highlight_changed = FALSE; } RedrawChanges(tw); /* Can be caused by auto-horiz scrolling... */ if (tw->text.needs_redisplay) { RedrawChanges(tw); tw->text.needs_redisplay = FALSE; } tw->text.in_redisplay = FALSE; TextDrawInsertionPoint(tw); } /**************************************************************** * * Definitions exported to output. * ****************************************************************/ /* * Mark the given range of text to be redrawn. */ void _XmTextMarkRedraw(XmTextWidget tw, XmTextPosition left, XmTextPosition right) { if (left < right) { AddRedraw(tw, left, right); tw->text.needs_redisplay = TRUE; if (tw->text.disable_depth == 0) Redisplay(tw); } } /* * Return the number of lines in the linetable. */ LineNum _XmTextNumLines(XmTextWidget tw) { if (tw->text.needs_refigure_lines) RefigureLines(tw); return tw->text.number_lines; } void _XmTextLineInfo(XmTextWidget tw, LineNum line, XmTextPosition *startpos, LineTableExtra *extra) { if (tw->text.needs_refigure_lines) RefigureLines(tw); if (tw->text.number_lines >= line) { if (startpos) *startpos = tw->text.line[line].start; if (extra) *extra = tw->text.line[line].extra; } else { if (startpos) { unsigned int cur_index = _XmTextGetTableIndex(tw, tw->text.line[line - 1].start); if (cur_index < tw->text.total_lines - 1) *startpos = tw->text.line_table[cur_index + 1].start_pos; else *startpos = tw->text.last_position; } if (extra) *extra = NULL; } } /* * Return the line number containing the given position. If text currently * knows of no line containing that position, returns NOLINE. */ LineNum _XmTextPosToLine(XmTextWidget tw, XmTextPosition position) { int i; if (tw->text.needs_refigure_lines) RefigureLines(tw); if (position < tw->text.top_character || position > tw->text.bottom_position) return NOLINE; for (i=0; itext.number_lines; i++) if (tw->text.line[i+1].start > position) return i; if (position == tw->text.line[tw->text.number_lines].start) return tw->text.number_lines; return NOLINE; /* Couldn't find line with given position */ } /**************************************************************** * * Definitions exported to sources. * ****************************************************************/ void _XmTextInvalidate(XmTextWidget tw, XmTextPosition position, XmTextPosition topos, long delta) { LineNum l; int i; XmTextPosition p, endpos; int shift = 0; int shift_start = 0; #define ladjust(p) \ if ((p > position && p != PASTENDPOS) || \ (p == position && delta < 0)) { \ p += delta; \ if (p < tw->text.first_position) p = tw->text.first_position; \ if (p > tw->text.last_position) p = tw->text.last_position; \ } #define radjust(p) \ if ((p > position && p != PASTENDPOS) || \ (p == position && delta > 0)) { \ p += delta; \ if (p < tw->text.first_position) p = tw->text.first_position; \ if (p > tw->text.last_position) p = tw->text.last_position; \ } tw->text.first_position = (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdLeft, 1, FALSE); tw->text.last_position = (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdRight, 1, FALSE); if (delta == NODELTA) { if (tw->text.top_character == topos && position != topos) { tw->text.pending_scroll = -1; tw->text.forget_past = MIN(tw->text.forget_past, position); } if (tw->text.top_character > position && tw->text.bottom_position < topos) { tw->text.new_top = position; tw->text.pending_scroll = -1; tw->text.forget_past = MIN(tw->text.forget_past, position); } if (tw->text.in_resize && tw->text.line_table != NULL) { unsigned int top_index, last_index, next_index; int index_offset, lines_used; top_index = tw->text.top_line; last_index = _XmTextGetTableIndex(tw, tw->text.last_position); lines_used = (last_index - top_index) + 1; if (top_index != 0 && tw->text.output->data->number_lines > lines_used) { index_offset = tw->text.output->data->number_lines-lines_used; if (index_offset < tw->text.total_lines - lines_used) next_index = top_index - index_offset; else next_index = 0; tw->text.new_top = tw->text.top_character = tw->text.line_table[next_index].start_pos; } } tw->text.forget_past = MIN(tw->text.forget_past, position); } else { for (i=0; itext.repaint.number; i++) { radjust(tw->text.repaint.range[i].from); ladjust(tw->text.repaint.range[i].to); } for (i=1; i < tw->text.highlight.number; i++) { if (delta < 0 && tw->text.highlight.list[i].position >= position - delta) ladjust(tw->text.highlight.list[i].position); if (delta > 0 && ((tw->text.highlight.list[i].position > position) || ((tw->text.highlight.list[i].position == position) && (tw->text.highlight.list[i].mode != XmHIGHLIGHT_NORMAL)))) radjust(tw->text.highlight.list[i].position); } for (i=1; itext.old_highlight.number; i++) { if (delta < 0 && tw->text.old_highlight.list[i].position >= position - delta) ladjust(tw->text.old_highlight.list[i].position); if (delta > 0 && ((tw->text.old_highlight.list[i].position > position) || ((tw->text.old_highlight.list[i].position == position) && (tw->text.old_highlight.list[i].mode != XmHIGHLIGHT_NORMAL)))) radjust(tw->text.old_highlight.list[i].position); } for (i=0; i <= tw->text.number_lines && tw->text.line[i].start != PASTENDPOS; i++) { if (delta > 0) { radjust(tw->text.line[i].start); } else { if (tw->text.line[i].start > position && tw->text.line[i].start <= topos) { if (i != 0 && shift_start == 0) shift_start = i; shift++; } else { radjust(tw->text.line[i].start); } } if (tw->text.line[i].changed) { radjust(tw->text.line[i].changed_position); } } if (shift) { for (i=shift_start; i < tw->text.number_lines; i++) { if ((i < (shift_start + shift)) && tw->text.line[i].extra) XtFree((char *)tw->text.line[i].extra); if (i + shift < tw->text.number_lines) { tw->text.line[i].start = tw->text.line[i+shift].start; tw->text.line[i].extra = tw->text.line[i+shift].extra; } else { tw->text.line[i].start = PASTENDPOS; tw->text.line[i].extra = NULL; } tw->text.line[i].changed = TRUE; if (tw->text.line[i].start != PASTENDPOS) tw->text.line[i].changed_position = tw->text.line[i + 1].start - 1; else tw->text.line[i].changed_position = PASTENDPOS; } } ladjust(tw->text.bottom_position); tw->text.output->data->refresh_ibeam_off = True; endpos = topos; radjust(endpos); /* Force _XmTextPosToLine to not bother trying to recalculate. */ tw->text.needs_refigure_lines = FALSE; for (l = _XmTextPosToLine(tw, position), p = position; l < tw->text.number_lines && tw->text.line[l].start <= endpos; l++, p = tw->text.line[l].start) { if (l != NOLINE) { if (tw->text.line[l].changed) { tw->text.line[l].changed_position = MIN(p, tw->text.line[l].changed_position); } else { tw->text.line[l].changed_position = p; tw->text.line[l].changed = TRUE; } } } } (*tw->text.output->Invalidate)(tw, position, topos, delta); (*tw->text.input->Invalidate)(tw, position, topos, delta); tw->text.needs_refigure_lines = tw->text.needs_redisplay = TRUE; if (tw->text.disable_depth == 0) Redisplay(tw); } static void InsertHighlight(XmTextWidget tw, XmTextPosition position, XmHighlightMode mode) { _XmHighlightRec *l1; _XmHighlightRec *l = tw->text.highlight.list; int i, j; l1 = FindHighlight(tw, position, XmsdLeft); if (l1->position == position && position != 0) l1->mode = mode; else { i = (l1 - l) + 1; tw->text.highlight.number++; if (tw->text.highlight.number > tw->text.highlight.maximum) { tw->text.highlight.maximum = tw->text.highlight.number; l = tw->text.highlight.list = (_XmHighlightRec *) XtRealloc((char *) l, tw->text.highlight.maximum * sizeof(_XmHighlightRec)); } for (j=tw->text.highlight.number-1; j>i; j--) l[j] = l[j-1]; l[i].position = position; l[i].mode = mode; } } /**************************************************************** * * Creation definitions. * ****************************************************************/ /* * Create the text widget. To handle default condition of the core * height and width after primitive has already reset it's height and * width, use request values and reset height and width to original * height and width state. */ /* ARGSUSED */ static void Initialize(Widget rw, Widget nw, ArgList args, Cardinal *num_args) { XmTextWidget req = (XmTextWidget) rw; XmTextWidget newtw = (XmTextWidget) nw; if (MB_CUR_MAX > 0) newtw->text.char_size = (char)MB_CUR_MAX; else newtw->text.char_size = 1; if (req->core.width == 0) newtw->core.width = req->core.width; if (req->core.height == 0) newtw->core.height = req->core.height; /* Flag used in losing focus verification to indicate that a traversal key was pressed. Must be initialized to False */ newtw->text.traversed = False; newtw->text.total_lines = 1; newtw->text.top_line = 0; newtw->text.vsbar_scrolling = False; newtw->text.hsbar_scrolling = False; newtw->text.in_setvalues = False; if (newtw->text.output_create == NULL) newtw->text.output_create = _XmTextOutputCreate; if (newtw->text.input_create == NULL) newtw->text.input_create = _XmTextInputCreate; /* The following resources are defaulted to invalid values to indicate */ /* that it was not set by the application. If it gets to this point */ /* and they are still invalid then set them to their appropriate default. */ if (!XmRepTypeValidValue(XmRID_EDIT_MODE, newtw->text.edit_mode, nw)) { newtw->text.edit_mode = XmSINGLE_LINE_EDIT; } /* All 8 buffers must be created to be able to rotate the cut buffers */ _XmCreateCutBuffers(nw); if (newtw->text.verify_bell == (Boolean) XmDYNAMIC_BOOL) { if (_XmGetAudibleWarning(nw) == XmBELL) newtw->text.verify_bell = True; else newtw->text.verify_bell = False; } /* * Initialize on-the-spot data */ newtw->text.onthespot = (OnTheSpotDataTW) XtMalloc(sizeof(OnTheSpotDataRecTW) ); newtw->text.onthespot->start = newtw->text.onthespot->end = newtw->text.onthespot->cursor = newtw->text.onthespot->over_len = newtw->text.onthespot->over_maxlen = 0; newtw->text.onthespot->over_str = NULL; newtw->text.onthespot->under_preedit = False; newtw->text.onthespot->under_verify_preedit = False; newtw->text.onthespot->verify_commit = False; newtw->text.tm_table = (XtTranslations)NULL; } /* * Create a text widget. Note that most of the standard stuff is actually * to be done by the output create routine called here, since output is in * charge of window handling. */ static void InitializeHook(Widget wid, ArgList args, Cardinal *num_args_ptr) { register XmTextWidget tw; Cardinal num_args = *num_args_ptr; XmTextSource source; XmTextPosition top_character; XmTextBlockRec block; Position dummy; Boolean used_source = False; tw = (XmTextWidget) wid; /* If text.wc_value is set, it overrides. Call _Xm..Create with it. */ if (tw->text.source == nullsourceptr) { if (tw->text.wc_value != NULL) { source = _XmStringSourceCreate((char*)tw->text.wc_value, True); tw->text.value = NULL; tw->text.wc_value = NULL; } else { source = _XmStringSourceCreate(tw->text.value, False); tw->text.value = NULL; } } else { source = tw->text.source; if (tw->text.wc_value != NULL) { char * tmp_value; int num_chars, n_bytes; for (num_chars=0; tw->text.wc_value[num_chars]!=0L; num_chars++) /*EMPTY*/; tmp_value = XtMalloc((unsigned) (num_chars + 1) * (int)tw->text.char_size); n_bytes = wcstombs(tmp_value, tw->text.wc_value, (num_chars + 1) * (int)tw->text.char_size); if (n_bytes == -1) n_bytes = 0; tmp_value[n_bytes] = 0; /* NULL terminate the string */ _XmStringSourceSetValue(tw, tmp_value); XtFree(tmp_value); tw->text.wc_value = NULL; } else if (tw->text.value != NULL) { /* Default value or argument ? */ int i; for (i = 0; i < num_args; i++) if (tw->text.value == (char *)args[i].value && (args[i].name == XmNvalue || strcmp(args[i].name, XmNvalue) == 0)) { _XmStringSourceSetValue(tw, tw->text.value); break; } } tw->text.value = NULL; used_source = True; } tw->text.disable_depth = 1; tw->text.first_position = 0; tw->text.last_position = 0; tw->text.dest_position = 0; tw->text.needs_refigure_lines = tw->text.needs_redisplay = TRUE; tw->text.number_lines = 0; tw->text.maximum_lines = 1; tw->text.line = (Line) XtMalloc(sizeof(LineRec)); tw->text.line->start = PASTENDPOS; tw->text.line->changed = False; tw->text.line->changed_position = PASTENDPOS; tw->text.line->past_end = False; tw->text.line->extra = NULL; tw->text.repaint.number = tw->text.repaint.maximum = 0; tw->text.repaint.range = (RangeRec *) XtMalloc(sizeof(RangeRec)); tw->text.highlight.number = tw->text.highlight.maximum = 1; tw->text.highlight.list = (_XmHighlightRec *) XtMalloc(sizeof(_XmHighlightRec)); tw->text.highlight.list[0].position = 0; tw->text.highlight.list[0].mode = XmHIGHLIGHT_NORMAL; tw->text.old_highlight.number = 0; tw->text.old_highlight.maximum = 1; tw->text.old_highlight.list = (_XmHighlightRec *) XtMalloc(sizeof(_XmHighlightRec)); tw->text.highlight_changed = FALSE; tw->text.on_or_off = on; tw->text.force_display = -1; tw->text.in_redisplay = tw->text.in_refigure_lines = FALSE; tw->text.in_resize = FALSE; tw->text.in_expose = FALSE; tw->text.pending_scroll = 0; tw->text.new_top = tw->text.top_character; tw->text.bottom_position = 0; tw->text.add_mode = False; tw->text.pendingoff = True; tw->text.forget_past = 0; /* Translation table overwrite */ if (XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { char *vevent_bindings; vevent_bindings = (String)XtMalloc(strlen(_XmTextIn_XmTextVEventBindings) + 1); strcpy(vevent_bindings, _XmTextIn_XmTextVEventBindings); tw->text.tm_table = (XtTranslations)XtParseTranslationTable(vevent_bindings); XtFree(vevent_bindings); XtOverrideTranslations(wid, tw->text.tm_table); } /* Initialize table */ if (tw->text.edit_mode == XmSINGLE_LINE_EDIT) InitializeLineTable(tw, 1); else InitializeLineTable(tw, INIT_TABLE_SIZE); (*tw->text.source->RemoveWidget)(tw->text.source, tw); tw->text.source = source; (*tw->text.source->AddWidget)(tw->text.source, tw); (*tw->text.output_create)(wid, args, num_args); _XmTextSetEditable(wid, tw->text.editable); _XmStringSourceSetMaxLength(GetSrc(tw), tw->text.max_length); (*tw->text.input_create)(wid, args, num_args); tw->text.first_position = (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdLeft, 1, FALSE); tw->text.last_position = (*tw->text.source->Scan)(tw->text.source, 0, XmSELECT_ALL, XmsdRight, 1, FALSE); if (tw->text.cursor_position < 0) tw->text.cursor_position = 0; if (tw->text.cursor_position > tw->text.last_position) tw->text.cursor_position = tw->text.last_position; tw->text.dest_position = tw->text.cursor_position; if (!tw->text.editable || !XtIsSensitive(wid)) _XmTextSetDestinationSelection(wid, 0, False, (Time)NULL); if (tw->text.edit_mode == XmMULTI_LINE_EDIT) top_character = (*tw->text.source->Scan)(tw->text.source, tw->text.top_character, XmSELECT_LINE, XmsdLeft, 1, FALSE); else top_character = tw->text.top_character; tw->text.new_top = top_character; tw->text.top_character = 0; _XmTextInvalidate(tw, top_character, top_character, NODELTA); if (tw->text.disable_depth == 0) Redisplay(tw); /* * Fix for CR 5704 - If the source has already been created, do not use * the original code - it has already been processed and * the gaps are not where they were the first time * through for this source. Instead, use * code similar to that used in XmTextSetSource(). */ if (!used_source) { tw->text.source->data->gap_start[0] = '\0'; /*Hack to utilize initial value when setting line table - saves a malloc and free. */ if (tw->text.char_size == 1) { block.ptr = tw->text.source->data->ptr; if (block.ptr == NULL) block.length = 0; else block.length = strlen(block.ptr); } else (void)(*tw->text.source->ReadSource)(source, 0, source->data->length, &block); } else (void)(*tw->text.source->ReadSource)(source, 0, source->data->length, &block); _XmTextUpdateLineTable(wid, 0, 0, &block, False); _XmStringSourceSetGappedBuffer(source->data, tw->text.cursor_position); tw->text.forget_past = tw->text.first_position; tw->text.disable_depth = 0; (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &(tw->text.cursor_position_x), &dummy); } static void Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes) { XmTextWidget tw = (XmTextWidget) w; Position dummy; Arg im_args[20]; XIMCallback xim_cb[4]; Cardinal n = 0; (*tw->text.output->realize)(w, valueMask, attributes); (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &(tw->text.cursor_position_x), &dummy); if (tw->text.editable) { /* * Register on the spot callbacks. */ xim_cb[0].client_data = (XPointer)tw; xim_cb[0].callback = (XIMProc)PreeditStart; xim_cb[1].client_data = (XPointer)tw; xim_cb[1].callback = (XIMProc)PreeditDone; xim_cb[2].client_data = (XPointer)tw; xim_cb[2].callback = (XIMProc)PreeditDraw; xim_cb[3].client_data = (XPointer)tw; xim_cb[3].callback = (XIMProc)PreeditCaret; XtSetArg(im_args[n], XmNpreeditStartCallback, &xim_cb[0]); n++; XtSetArg(im_args[n], XmNpreeditDoneCallback, &xim_cb[1]); n++; XtSetArg(im_args[n], XmNpreeditDrawCallback, &xim_cb[2]); n++; XtSetArg(im_args[n], XmNpreeditCaretCallback, &xim_cb[3]); n++; XmImSetValues(w, im_args, n); } } /**************************************************************** * * Semi-public definitions. * ****************************************************************/ static void Destroy(Widget w) { XmTextWidget tw = (XmTextWidget) w; int j; (*tw->text.source->RemoveWidget)(tw->text.source, tw); if (tw->text.input->destroy) (*tw->text.input->destroy)(w); if (tw->text.output->destroy) (*tw->text.output->destroy)(w); for (j = 0; j < tw->text.number_lines; j++) { if (tw->text.line[j].extra) XtFree((char *)tw->text.line[j].extra); } XtFree((char *)tw->text.line); XtFree((char *)tw->text.repaint.range); XtFree((char *)tw->text.highlight.list); XtFree((char *)tw->text.old_highlight.list); if (tw->text.line_table != NULL) XtFree((char *)tw->text.line_table); if (tw->text.onthespot != NULL) XtFree((char *)tw->text.onthespot); if (tw->text.tm_table != NULL) XtFree((char *)tw->text.tm_table); } static void Resize(Widget w) { XmTextWidget tw = (XmTextWidget) w; /* this flag prevents resize requests */ tw->text.in_resize = True; if (_XmTextShouldWordWrap(tw)) _XmTextRealignLineTable(tw, NULL, 0, 0, 0, PASTENDPOS); (*(tw->text.output->resize))(w, FALSE); tw->text.in_resize = False; } static void DoExpose(Widget w, XEvent *event, Region region) { XmTextWidget tw = (XmTextWidget) w; /* this flag prevents resize requests */ tw->text.in_expose = True; (*(tw->text.output->expose))(w, event, region); tw->text.in_expose = False; } static void GetValuesHook(Widget w, ArgList args, Cardinal *num_args_ptr) { XmTextWidget tw = (XmTextWidget) w; Cardinal num_args = *num_args_ptr; int i; XtGetSubvalues((XtPointer) tw, resources, XtNumber(resources), args, num_args); for (i = 0; i < num_args; i++) { if (!strcmp(args[i].name, XmNvalue)) { *((XtPointer *)args[i].value) = (XtPointer)_XmStringSourceGetValue(GetSrc(tw), False); } } for (i = 0; i < num_args; i++) { if (!strcmp(args[i].name, XmNvalueWcs)) { *((XtPointer *)args[i].value) = (XtPointer)_XmStringSourceGetValue(GetSrc(tw), True); } } (*tw->text.output->GetValues)(w, args, num_args); (*tw->text.input->GetValues)(w, args, num_args); } void _XmTextSetTopCharacter(Widget widget, XmTextPosition top_character) { XmTextWidget tw = (XmTextWidget) widget; LineNum line_num; if (tw->text.edit_mode != XmSINGLE_LINE_EDIT) { line_num = _XmTextGetTableIndex(tw, top_character); top_character = tw->text.line_table[line_num].start_pos; } if (top_character != tw->text.new_top) { EraseInsertionPoint(tw); tw->text.new_top = top_character; tw->text.pending_scroll = 0; tw->text.needs_refigure_lines = tw->text.needs_redisplay = TRUE; if (XmSINGLE_LINE_EDIT == tw->text.edit_mode) tw->text.output->data->hoffset = 0; if (tw->text.disable_depth == 0) Redisplay(tw); TextDrawInsertionPoint(tw); } /* * Fixes CDExc23645 and CDExc23898 */ else if (tw->text.auto_show_cursor_position && tw->text.edit_mode == XmSINGLE_LINE_EDIT) _XmTextShowPosition(widget, top_character); } static void LosingFocus(XmTextWidget tw) { XmTextVerifyCallbackStruct cbdata; cbdata.reason = XmCR_LOSING_FOCUS; cbdata.event = NULL; cbdata.doit = True; cbdata.currInsert = tw->text.cursor_position; cbdata.newInsert = tw->text.cursor_position; cbdata.startPos = tw->text.cursor_position; cbdata.endPos = tw->text.cursor_position; cbdata.text = NULL; XtCallCallbackList((Widget)tw, tw->text.losing_focus_callback, (XtPointer) &cbdata); tw->text.source->data->take_selection = True; } /* ARGSUSED */ static Boolean SetValues(Widget oldw, Widget reqw, Widget new_w, ArgList args, Cardinal *num_args) { XmTextWidget old = (XmTextWidget) oldw; XmTextWidget newtw = (XmTextWidget) new_w; XmTextPosition new_cursor_pos; Boolean o_redisplay; Position dummy; Boolean need_new_cursorPos = False; Boolean need_text_redisplay = False; Boolean new_source = (newtw->text.source != old->text.source); XmTextSource cache_source = NULL; if (newtw->core.being_destroyed) { return False; } _XmTextResetIC(oldw); newtw->text.in_setvalues = True; if (newtw->text.cursor_position<0) { newtw->text.cursor_position=0; } /* It is unfortunate that the rest of the Text widget code, particularly the ** redisplay code, assumes that the current source is valid; in fact, it may ** have been changed by a set-values call. Ideally, we would be able to ** handle before anything else a change in the XmNsource resource of the ** widget; in practice, the changes would be extensive. ** Compromise by temporarily restoring the old value for those pieces of ** code which affect the display of the old source; then restore the new ** value for the display of the current source. That is, deal with the old ** value for just this one line of code. */ if (new_source) { cache_source = newtw->text.source; newtw->text.source = old->text.source; } EraseInsertionPoint(newtw); /* assumes newtw->text.source matches values */ if (new_source) newtw->text.source = cache_source; _XmTextDisableRedisplay(newtw, TRUE); /* set cursor_position to a known acceptable value (0 is always acceptable) */ new_cursor_pos = newtw->text.cursor_position; newtw->text.cursor_position = 0; if (! XtIsSensitive(new_w) && newtw->text.input->data->has_destination) { _XmTextSetDestinationSelection(new_w, 0, True, XtLastTimestampProcessed(XtDisplay(new_w))); } if (!XmRepTypeValidValue(XmRID_EDIT_MODE, newtw->text.edit_mode, new_w)) { newtw->text.edit_mode = old->text.edit_mode; } if ((old->text.top_character != newtw->text.top_character) && (newtw->text.top_character != newtw->text.new_top)) { XmTextPosition new_top; if (newtw->text.output->data->resizeheight && !(newtw->text.output->data->scrollvertical && XmIsScrolledWindow(XtParent((Widget)newtw))) ) new_top = 0; else new_top = newtw->text.top_character; newtw->text.top_character = old->text.top_character; _XmTextSetTopCharacter(new_w, new_top); if (newtw->text.needs_refigure_lines) newtw->text.top_character = new_top; } if (old->text.source != newtw->text.source) { XmTextSource source = newtw->text.source; newtw->text.source = old->text.source; o_redisplay = newtw->text.needs_redisplay; XmTextSetSource(new_w, source, old->text.top_character, 0); need_text_redisplay = newtw->text.needs_redisplay; newtw->text.needs_redisplay = o_redisplay; } if (old->text.editable != newtw->text.editable) { Boolean editable = newtw->text.editable; newtw->text.editable = old->text.editable; _XmTextSetEditable(new_w, editable); } _XmStringSourceSetMaxLength(GetSrc(newtw), newtw->text.max_length); /* Four cases to handle for value: * 1. user set both XmNvalue and XmNwcValue. * 2. user set the opposite resource (i.e. value is a char* * and user set XmNwcValue, or vice versa). * 3. user set the corresponding resource (i.e. value is a char* * and user set XmNValue, or vice versa). * 4. user set neither XmNValue nor XmNwcValue */ /* OSF says: if XmNvalueWcs set, it overrides all else */ if (newtw->text.wc_value != NULL) { /* user set XmNvalueWcs resource - it rules ! */ wchar_t * wc_value; char * tmp_value; int num_chars, n_bytes; num_chars = n_bytes = 0; for (num_chars = 0, wc_value = newtw->text.wc_value; wc_value[num_chars] != 0L;) num_chars++; tmp_value = XtMalloc((unsigned) (num_chars + 1) * (int)newtw->text.char_size); n_bytes = wcstombs(tmp_value, newtw->text.wc_value, (num_chars + 1) * (int)newtw->text.char_size); if (n_bytes == -1) n_bytes = 0; tmp_value[n_bytes] = 0; /* NULL terminate the string */ o_redisplay = newtw->text.needs_redisplay; newtw->text.wc_value = NULL; newtw->text.value = NULL; _XmStringSourceSetValue(newtw, tmp_value); need_text_redisplay = newtw->text.needs_redisplay; newtw->text.needs_redisplay = o_redisplay; XtFree(tmp_value); need_new_cursorPos = True; } else if (newtw->text.value != NULL) { char * tmp_value; newtw->text.pendingoff = TRUE; o_redisplay = newtw->text.needs_redisplay; tmp_value = newtw->text.value; newtw->text.value = NULL; _XmStringSourceSetValue(newtw, tmp_value); need_text_redisplay = newtw->text.needs_redisplay; newtw->text.needs_redisplay = o_redisplay; need_new_cursorPos = True; } /* return cursor_position to it's original changed value */ newtw->text.cursor_position = new_cursor_pos; if (old->text.cursor_position != newtw->text.cursor_position) { XmTextPosition new_position = newtw->text.cursor_position; newtw->text.cursor_position = old->text.cursor_position; if (new_position > newtw->text.source->data->length) _XmTextSetCursorPosition(new_w, newtw->text.source->data->length); else _XmTextSetCursorPosition(new_w, new_position); } else if (need_new_cursorPos) { XmTextPosition cursorPos = -1; int ix; for (ix = 0; ix < *num_args; ix++) if (strcmp(args[ix].name, XmNcursorPosition) == 0) { cursorPos = (XmTextPosition)args[ix].value; break; } if (cursorPos == -1) cursorPos = (*newtw->text.source->Scan)(newtw->text.source, newtw->text.cursor_position, XmSELECT_ALL, XmsdLeft, 1, TRUE); _XmTextSetCursorPosition(new_w, cursorPos); } else if (newtw->text.cursor_position > newtw->text.source->data->length) { _XmTextSetCursorPosition(new_w, newtw->text.source->data->length); } o_redisplay = (*newtw->text.output->SetValues) (oldw, reqw, new_w, args, num_args); (*newtw->text.input->SetValues)(oldw, reqw, new_w, args, num_args); newtw->text.forget_past = 0; newtw->text.disable_depth--; /* _XmTextEnableRedisplay() is not called because we don't want a repaint yet */ TextDrawInsertionPoint(newtw); /* increment cursor_on stack in lieu of _XmTextEnableRedisplay() call. */ (*newtw->text.output->PosToXY)(newtw, newtw->text.cursor_position, &(newtw->text.cursor_position_x), &dummy); if (o_redisplay) newtw->text.needs_redisplay = True; TextDrawInsertionPoint(newtw); if (XtIsSensitive(new_w) != XtIsSensitive(oldw)) { if (XtIsSensitive(new_w)) { EraseInsertionPoint(newtw); newtw->text.output->data->blinkstate = off; TextDrawInsertionPoint(newtw); } else { if (newtw->text.output->data->hasfocus) { newtw->text.output->data->hasfocus = False; _XmTextChangeBlinkBehavior(newtw, False); EraseInsertionPoint(newtw); newtw->text.output->data->blinkstate = on; TextDrawInsertionPoint(newtw); XmImUnsetFocus(new_w); } } if (newtw->text.source->data->length > 0) newtw->text.needs_redisplay = True; } if ((!newtw->text.editable || !XtIsSensitive(new_w)) && _XmTextHasDestination(new_w)) _XmTextSetDestinationSelection(new_w, 0, False, (Time)NULL); /* don't shrink to nothing */ if (newtw->core.width == 0) newtw->core.width = old->core.width; if (newtw->core.height == 0) newtw->core.height = old->core.height; /* Optimization for the case when only XmNvalue changes. This considerably reduces flashing due to unneeded redraws */ if (need_text_redisplay && !newtw->text.needs_redisplay && newtw->text.disable_depth == 0) { EraseInsertionPoint(newtw); newtw->text.disable_depth++; newtw->text.needs_redisplay = True; _XmTextEnableRedisplay(newtw); newtw->text.needs_redisplay = False; } newtw->text.in_setvalues = newtw->text.needs_redisplay; return newtw->text.needs_redisplay; } static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *reply) { XmTextWidget tw = (XmTextWidget) w; if (GMode (intended) & (~(CWWidth | CWHeight))) return(XtGeometryNo); reply->request_mode = (CWWidth | CWHeight); (*tw->text.output->GetPreferredSize)(w, &reply->width, &reply->height); if ((GMode(intended) != GMode(reply)) || (reply->width != intended->width) || (reply->height != intended->height)) return (XtGeometryAlmost); else { reply->request_mode = 0; return (XtGeometryYes); } } static void _XmTextSetString(Widget widget, char *value) { XmTextWidget tw = (XmTextWidget) widget; _XmTextResetIC(widget); tw->text.pendingoff = TRUE; if (value == NULL) value = ""; _XmStringSourceSetValue(tw, value); /* after set, move insertion cursor to beginning of string. */ _XmTextSetCursorPosition(widget, 0); } void _XmTextSetCursorPosition(Widget widget, XmTextPosition position) { XmTextWidget tw = (XmTextWidget) widget; XmTextSource source; XmTextVerifyCallbackStruct cb; Position dummy; int n = 0; XPoint xmim_point; XRectangle xmim_area; Arg args[10]; if (position < 0) { position = 0; } if (position > tw->text.last_position) { position = tw->text.last_position; } source = GetSrc(tw); /* if position hasn't changed, don't call the modify verify callback */ if (position != tw->text.cursor_position) { /* Call Motion Verify Callback before Cursor Changes Positon */ cb.reason = XmCR_MOVING_INSERT_CURSOR; cb.event = NULL; cb.currInsert = tw->text.cursor_position; cb.newInsert = position; cb.doit = True; XtCallCallbackList (widget, tw->text.motion_verify_callback, (XtPointer) &cb); /* Cancel action upon application request */ if (!cb.doit) { if (tw->text.verify_bell) XBell(XtDisplay(widget), 0); return; } } /* Erase insert cursor prior to move */ EraseInsertionPoint(tw); tw->text.cursor_position = position; /* * If not in add_mode and pending delete state is on reset * the selection. */ if (!tw->text.add_mode && tw->text.pendingoff && _XmStringSourceHasSelection(source)) (*source->SetSelection)(source, position, position, XtLastTimestampProcessed(XtDisplay(widget))); /* ensure that IBeam at new location will be displayed correctly */ _XmTextMovingCursorPosition(tw, position); /*correct GC for new location */ if (tw->text.auto_show_cursor_position) _XmTextShowPosition(widget, position); if (tw->text.needs_redisplay && tw->text.disable_depth == 0) Redisplay(tw); (*tw->text.output->PosToXY) (tw, position, &(tw->text.cursor_position_x), &dummy); tw->text.output->data->refresh_ibeam_off = True; /* update IBeam off area * before drawing IBeam */ (*tw->text.output->PosToXY)(tw, position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); n = 0; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XmImSetValues((Widget)tw, args, n); TextDrawInsertionPoint(tw); } /* ARGSUSED */ void _XmTextDisableRedisplay(XmTextWidget widget, #if NeedWidePrototypes int losesbackingstore) #else Boolean losesbackingstore) #endif /* NeedWidePrototypes */ { widget->text.disable_depth++; EraseInsertionPoint(widget); } void _XmTextEnableRedisplay(XmTextWidget widget) { if (widget->text.disable_depth) widget->text.disable_depth--; if (widget->text.disable_depth == 0 && widget->text.needs_redisplay) Redisplay(widget); /* If this is a scrolled widget, better update the scroll bars to reflect * any changes that have occured while redisplay has been disabled. */ if (widget->text.disable_depth == 0) { if (XmDirectionMatch(XmPrim_layout_direction(widget), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { if (widget->text.output->data->scrollvertical && #ifdef FIX_1147 XmIsScrolledWindow(XtParent(widget))) #else XtClass(widget->core.parent) == xmScrolledWindowWidgetClass) #endif _XmRedisplayVBar(widget); if (widget->text.output->data->scrollhorizontal && #ifdef FIX_1147 XmIsScrolledWindow(XtParent(widget)) && #else XtClass(widget->core.parent) == xmScrolledWindowWidgetClass && #endif !widget->text.hsbar_scrolling) _XmChangeHSB(widget); } else { if (widget->text.output->data->scrollvertical && #ifdef FIX_1147 XmIsScrolledWindow(XtParent(widget)) && #else XtClass(widget->core.parent) == xmScrolledWindowWidgetClass && #endif !widget->text.vsbar_scrolling) _XmChangeVSB(widget); if (widget->text.output->data->scrollhorizontal && #ifdef FIX_1147 XmIsScrolledWindow(XtParent(widget))) #else XtClass(widget->core.parent) == xmScrolledWindowWidgetClass) #endif _XmRedisplayHBar(widget); } } TextDrawInsertionPoint(widget); } /* Count the number of characters represented in the char* str. By * definition, if MB_CUR_MAX == 1 then num_count_bytes == number of characters. * Otherwise, use mblen to calculate. */ int _XmTextCountCharacters(char *str, int num_count_bytes) { char * bptr; int count = 0; int char_size = 0; if (num_count_bytes <= 0) return 0; #ifndef NO_MULTIBYTE if (MB_CUR_MAX == 1 || MB_CUR_MAX == 0) /* Sun sets MB_CUR_MAX to 0, Argg!!*/ #endif return num_count_bytes; for (bptr = str; num_count_bytes > 0; count++, bptr+= char_size) { char_size = mblen(bptr, MB_CUR_MAX); if (char_size <= 0) break; /* error */ num_count_bytes -= char_size; } return count; } void _XmTextSetEditable(Widget widget, #if NeedWidePrototypes int editable) #else Boolean editable) #endif /* NeedWidePrototypes */ { Arg args[20]; XIMCallback xim_cb[4]; Cardinal n = 0; XPoint xmim_point; XRectangle xmim_area; XmTextWidget tw = (XmTextWidget) widget; if (!tw->text.editable && editable) { OutputData o_data = tw->text.output->data; XmImRegister(widget, (unsigned int) NULL); (*tw->text.output->PosToXY)(tw, tw->text.cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); n = 0; XtSetArg(args[n], XmNfontList, o_data->fontlist); n++; XtSetArg(args[n], XmNbackground, widget->core.background_pixel); n++; XtSetArg(args[n], XmNforeground, tw->primitive.foreground); n++; XtSetArg(args[n], XmNbackgroundPixmap, widget->core.background_pixmap); n++; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XtSetArg(args[n], XmNlineSpace, o_data->lineheight); n++; /* * Register on the spot callbacks. */ xim_cb[0].client_data = (XPointer)tw; xim_cb[0].callback = (XIMProc)PreeditStart; xim_cb[1].client_data = (XPointer)tw; xim_cb[1].callback = (XIMProc)PreeditDone; xim_cb[2].client_data = (XPointer)tw; xim_cb[2].callback = (XIMProc)PreeditDraw; xim_cb[3].client_data = (XPointer)tw; xim_cb[3].callback = (XIMProc)PreeditCaret; XtSetArg(args[n], XmNpreeditStartCallback, &xim_cb[0]); n++; XtSetArg(args[n], XmNpreeditDoneCallback, &xim_cb[1]); n++; XtSetArg(args[n], XmNpreeditDrawCallback, &xim_cb[2]); n++; XtSetArg(args[n], XmNpreeditCaretCallback, &xim_cb[3]); n++; if (o_data->hasfocus) XmImSetFocusValues(widget, args, n); else XmImSetValues(widget, args, n); } else if (tw->text.editable && !editable) { XmImUnregister(widget); } tw->text.editable = editable; n = 0; if (editable) { XtSetArg(args[n], XmNdropSiteActivity, XmDROP_SITE_ACTIVE); n++; } else { XtSetArg(args[n], XmNdropSiteActivity, XmDROP_SITE_INACTIVE); n++; } XmDropSiteUpdate(widget, args, n); _XmStringSourceSetEditable(GetSrc(tw), editable); } void _XmTextSetHighlight(Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode) { XmTextWidget tw = (XmTextWidget)w; _XmHighlightRec *l; XmHighlightMode endmode; int i, j; _XmWidgetToAppContext(w); _XmAppLock(app); /* If right position is out-bound, change it to the last position. */ if (right > tw->text.last_position) right = tw->text.last_position; /* If left is out-bound, don't do anything. */ if (left >= right || right <= 0) { _XmAppUnlock(app); return; } if (left < 0) left = 0; EraseInsertionPoint(tw); if (!tw->text.highlight_changed) { tw->text.highlight_changed = TRUE; if (tw->text.old_highlight.maximum < tw->text.highlight.number) { tw->text.old_highlight.maximum = tw->text.highlight.number; tw->text.old_highlight.list = (_XmHighlightRec *) XtRealloc((char *)tw->text.old_highlight.list, tw->text.old_highlight.maximum * sizeof(_XmHighlightRec)); } tw->text.old_highlight.number = tw->text.highlight.number; memcpy((void *) tw->text.old_highlight.list, (void *) tw->text.highlight.list, (size_t) tw->text.old_highlight.number * sizeof(_XmHighlightRec)); } endmode = FindHighlight(tw, right, XmsdLeft)->mode; InsertHighlight(tw, left, mode); InsertHighlight(tw, right, endmode); l = tw->text.highlight.list; i = 1; while (i < tw->text.highlight.number) { if (l[i].position >= left && l[i].position < right) l[i].mode = mode; if (l[i].mode == l[i-1].mode) { tw->text.highlight.number--; for (j=i; jtext.highlight.number; j++) l[j] = l[j+1]; } else i++; } /* Force the image GC to be updated based on the new highlight record */ _XmTextMovingCursorPosition(tw, tw->text.cursor_position); tw->text.needs_redisplay = TRUE; if (tw->text.disable_depth == 0) Redisplay(tw); tw->text.output->data->refresh_ibeam_off = True; TextDrawInsertionPoint(tw); _XmAppUnlock(app); } void _XmTextShowPosition(Widget widget, XmTextPosition position) { XmTextWidget tw = (XmTextWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!tw->text.needs_refigure_lines && (position < 0 || (position >= tw->text.top_character && position < tw->text.bottom_position))) { (*tw->text.output->MakePositionVisible)(tw, position); _XmAppUnlock(app); return; } tw->text.force_display = position; tw->text.needs_refigure_lines = tw->text.needs_redisplay = TRUE; if (tw->text.disable_depth == 0) Redisplay(tw); _XmAppUnlock(app); } /* Why is this here? It's never used */ int _XmTextGetTotalLines(Widget widget) { return(((XmTextWidget)widget)->text.total_lines); } /* Why is this here? It's never used */ XmTextLineTable _XmTextGetLineTable(Widget widget, int *total_lines) { XmTextWidget tw = (XmTextWidget) widget; XmTextLineTable line_table; *total_lines = tw->text.total_lines; line_table = (XmTextLineTable) XtMalloc((unsigned) *total_lines * sizeof(XmTextLineTableRec)); memcpy((void *) line_table, (void *) tw->text.line_table, *total_lines * sizeof(XmTextLineTableRec)); return line_table; } /******************************************** * AccessTextual trait method implementation ********************************************/ static XtPointer TextGetValue(Widget w, int format) { char *str; XmString tmp; switch(format) { case XmFORMAT_XmSTRING: str = XmTextGetString(w); tmp = XmStringCreateLocalized(str); if (str != NULL) XtFree(str); return((XtPointer) tmp); case XmFORMAT_MBYTE: return((XtPointer) XmTextGetString(w)); case XmFORMAT_WCS: return((XtPointer) XmTextGetStringWcs(w)); } return(NULL); } static void TextSetValue(Widget w, XtPointer s, int format) { char *str; switch(format) { case XmFORMAT_XmSTRING: str = (char*) _XmStringUngenerate((XmString)s, NULL, XmMULTIBYTE_TEXT, XmMULTIBYTE_TEXT); XmTextSetString(w, str); if (str != NULL) XtFree(str); break; case XmFORMAT_MBYTE: XmTextSetString(w, (char*) s); break; case XmFORMAT_WCS: XmTextSetStringWcs(w, (wchar_t *) s); } } /*ARGSUSED*/ static int TextPreferredValue(Widget w) /* unused */ { return(XmFORMAT_MBYTE); } /** ** New functions for the on the spot support. **/ /* * This function and _XmTextSetCursorPosition are almost the same. * The difference is that this function doesn't call any user's * callbacks like XmNmotionVerifyCallback */ static void _XmTextPreeditSetCursorPosition(Widget widget, XmTextPosition position) { XmTextWidget tw = (XmTextWidget) widget; XmTextSource source; Position dummy; if (position < 0) { position = 0; } if (position > tw->text.last_position) { position = tw->text.last_position; } source = GetSrc(tw); /* Erase insert cursor prior to move */ EraseInsertionPoint(tw); tw->text.cursor_position = position; /* ensure that IBeam at new location will be displayed correctly */ _XmTextMovingCursorPosition(tw, position); /*correct GC for new location */ (*tw->text.output->PosToXY) (tw, position, &(tw->text.cursor_position_x), &dummy); if (tw->text.auto_show_cursor_position) XmTextShowPosition(widget, position); if (tw->text.needs_redisplay && tw->text.disable_depth == 0) Redisplay(tw); _XmTextResetClipOrigin(tw, position, False); /* move clip origin */ tw->text.output->data->refresh_ibeam_off = True; /* update IBeam off area * before drawing IBeam */ TextDrawInsertionPoint(tw); } static void PreeditVerifyReplace(Widget w, XmTextPosition frompos, XmTextPosition topos, char *mb, XmTextPosition cursor, Boolean *end_preedit) { XmTextWidget tw = (XmTextWidget)w; UnderVerifyPreedit(tw) = True; _XmTextReplace(w, frompos, topos, mb, False); UnderVerifyPreedit(tw) = False; if (VerifyCommitNeeded(tw)) { _XmTextResetIC(w); *end_preedit = True; } _XmTextSetCursorPosition(w, cursor); } /* * This is the function set to XNPreeditStartCallback resource. * This function is called when the preedit process starts. * Initialize the preedit data and also treat pending delete. */ static int PreeditStart(XIC xic, XPointer client_data, XPointer call_data) { XmTextPosition left, right, lastPos; Widget w = (Widget) client_data; XmTextWidget tw = (XmTextWidget) client_data; if (PreUnder(tw)) return 0; /* check editable */ if (!tw->text.source->data->editable){ PreUnder(tw) = False; return 0; } PreOverLen(tw) = PreOverMaxLen(tw) = 0L; PreOverStr(tw) = NULL; /* Treat Pending delete */ if (_XmTextNeedsPendingDeleteDis(tw, &left, &right, False)) _XmTextReplace(w, left, right, NULL, False); PreStartTW(tw) = PreEndTW(tw) = PreCursorTW(tw) = XmTextGetCursorPosition(w); PreUnder(tw) = True; /* when overstrike mode, stock text buffer */ if (tw->text.input->data->overstrike){ lastPos = (*(tw->text.source->Scan))(tw->text.source, PreCursorTW(tw), XmSELECT_LINE, XmsdRight, 1, TRUE); PreOverLen(tw) = lastPos - PreCursorTW(tw); PreOverStr(tw) = _XmStringSourceGetString(tw, PreCursorTW(tw), lastPos, False); } return (-1); } /* * This is the function set to XNPreeditDoneCallback resource. * This function is called when the preedit process is finished. */ static void PreeditDone(XIC xic, XPointer client_data, XPointer call_data) { char *mb; XmTextBlockRec block; XmTextWidget tw = (XmTextWidget)client_data; Widget w = (Widget)client_data; int size, num_bytes = 0; Widget p = w; Boolean need_verify, end_preedit = False; if (!PreUnder(tw)) return; while (!XtIsShell(p)) p = XtParent(p); XtVaGetValues(p, XmNverifyPreedit, &need_verify, NULL); /* * Delete preedit string */ if (PreEndTW(tw) > PreStartTW(tw)) { if (need_verify) { PreeditVerifyReplace(w, PreStartTW(tw), PreEndTW(tw), NULL, PreStartTW(tw), &end_preedit); if (end_preedit) return; } else { block.ptr = NULL; block.length = 0; block.format = XmFMT_8_BIT; (*tw->text.source->Replace)(tw, NULL, &PreStartTW(tw), &PreEndTW(tw), &block, False); } } if (tw->text.input->data->overstrike && PreOverMaxLen(tw) > 0){ if (PreOverMaxLen(tw) == PreOverLen(tw)) mb = PreOverStr(tw); else { mb = XtMalloc((PreOverMaxLen(tw)+1)*tw->text.char_size); for (size = PreOverMaxLen(tw); size >0; size--) num_bytes +=mblen(PreOverStr(tw)+num_bytes, tw->text.char_size); memmove (mb, PreOverStr(tw), num_bytes); mb[num_bytes] = 0; } if (need_verify) { PreeditVerifyReplace(w, PreStartTW(tw), PreStartTW(tw), mb, PreStartTW(tw), &end_preedit); if (end_preedit) return; } else { (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); block.ptr = mb; block.length = strlen(block.ptr); block.format = XmFMT_8_BIT; (*tw->text.source->Replace)(tw, NULL, &PreStartTW(tw), &PreStartTW(tw), &block, False); _XmTextPreeditSetCursorPosition(w, PreStartTW(tw)); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); } if (PreOverMaxLen(tw) != PreOverLen(tw)) XtFree(mb); PreOverMaxLen(tw) = PreOverLen(tw) = 0; XtFree((char *)PreOverStr(tw)); } PreStartTW(tw) = PreEndTW(tw) = PreCursorTW(tw) = 0; PreUnder(tw) = False; } /* * This function shows the correspondence of rendition data between * the input server and XmTextField. */ static XmHighlightMode _XimFeedbackToXmHighlightMode(XIMFeedback fb) { switch (fb) { case XIMReverse: return(XmHIGHLIGHT_SELECTED); case XIMUnderline: return(XmHIGHLIGHT_SECONDARY_SELECTED); case XIMHighlight: return(XmHIGHLIGHT_NORMAL); case XIMPrimary: return(XmHIGHLIGHT_SELECTED); case XIMSecondary: return(XmHIGHLIGHT_SECONDARY_SELECTED); case XIMTertiary: return(XmHIGHLIGHT_SELECTED); default: return(XmHIGHLIGHT_NORMAL); } } /* * This function treats the rendition data. */ static void PreeditSetRendition(Widget w, XIMPreeditDrawCallbackStruct* data) { XIMText *text = data->text; unsigned short cnt; XIMFeedback fb; XmTextPosition prestart = PreStartTW((XmTextWidget)w)+data->chg_first, left, right; XmHighlightMode mode; if (!text->length) return; if (!text->feedback) return; fb = text->feedback[0]; /* initial feedback */ left = right = prestart; /* mode start/end position */ mode = _XimFeedbackToXmHighlightMode(fb); /* mode */ cnt = 1; /* counter initialize */ while (cnt < text->length) { if (fb != text->feedback[cnt]) { right = prestart + cnt; XmTextSetHighlight(w, left, right, mode); left = right; /* start position update */ fb = text->feedback[cnt]; /* feedback update */ mode = _XimFeedbackToXmHighlightMode(fb); } cnt++; /* counter increment */ } XmTextSetHighlight(w, left, (prestart + cnt), mode); /* for the last segment */ } #define TEXT_MAX_INSERT_SIZE 512 /* * This is the function set to XNPreeditDrawCallback resource. * This function is called when the input server requests XmText * to draw a preedit string. */ static void PreeditDraw(XIC xic, XPointer client_data, XIMPreeditDrawCallbackStruct *call_data) { Widget w = (Widget) client_data; XmTextWidget tw = (XmTextWidget) client_data; InputData data = tw->text.input->data; XmTextPosition startPos, endPos, rest_len, tmp_end; char *mb, *over_mb; XmTextBlockRec block; unsigned short insert_length=0; int i; int total_mb_len; int recover_len = 0; char *ptr; OutputData o_data = tw->text.output->data; XFontStruct *font = o_data->font; XRectangle overall_ink; int escapement; size_t mb_siz; Widget p =w; Boolean need_verify, end_preedit = False; if (!PreUnder(tw)) return; /* if no data in callback structs simply return - nothing to do */ if (!call_data->caret && !call_data->chg_first && !call_data->chg_length && !call_data->text) return; /* have we exceeded max size of preedit buffer? - then punt */ if (call_data->text && ((insert_length = call_data->text->length) > TEXT_MAX_INSERT_SIZE)) return; if (call_data->chg_length>PreEndTW(tw)-PreStartTW(tw)) call_data->chg_length = PreEndTW(tw)-PreStartTW(tw); /* loop to determine parent shell widget id */ while (!XtIsShell(p)) p = XtParent(p); /* determine whether verify preedit is set in shell widget */ XtVaGetValues(p, XmNverifyPreedit, &need_verify, NULL); /* turn cursor off */ (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); XmTextSetHighlight(w, PreStartTW(tw)+call_data->chg_first, PreStartTW(tw) + call_data->chg_first + call_data->chg_length, XmHIGHLIGHT_NORMAL); /* preedit deletion */ if (!data->overstrike && (!call_data->text || !insert_length)){ startPos = PreStartTW(tw) + call_data->chg_first; endPos = startPos + call_data->chg_length; PreCursorTW(tw) = startPos; PreEndTW(tw) -= endPos - startPos; if (need_verify) { PreeditVerifyReplace(w, startPos, endPos, NULL, startPos, &end_preedit); if (end_preedit) { (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); return; } } else { block.ptr = NULL; block.length = 0; block.format = XmFMT_8_BIT; if ((*tw->text.source->Replace)(tw, NULL, &startPos, &endPos, &block, False) != EditDone) { XBell(XtDisplay(tw), 0); return; } else _XmTextPreeditSetCursorPosition(w, PreCursorTW(tw)); } (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); return; } /* sanity check data to make sure its *really* there */ if (call_data->text) if ((call_data->text->encoding_is_wchar && !call_data->text->string.wide_char) || (!call_data->text->encoding_is_wchar && !call_data->text->string.multi_byte)){ PreeditSetRendition(w, call_data); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); return; } /* convert text data to char - it may be wchar or char */ if (insert_length > 0){ if (o_data->use_fontset) { if (call_data->text->encoding_is_wchar){ mb = XtMalloc((insert_length+1)*tw->text.char_size); mb_siz = wcstombs(mb, call_data->text->string.wide_char, insert_length); } else { mb = XtMalloc((insert_length+1)*tw->text.char_size); strcpy(mb,call_data->text->string.multi_byte); } /* set TextExtents for preedit data, if unable, punt */ escapement = XmbTextExtents((XFontSet)font, mb, strlen(mb), &overall_ink, NULL ); if (escapement == 0 && overall_ink.width == 0 && strchr(mb, '\t') == 0 ) { XtFree(mb); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); return; } } else { (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); return; } } else { mb = XtMalloc(4); mb[0] = '\0'; } /* setup overstrike buffers and data */ if (data->overstrike) { startPos = PreStartTW(tw) + call_data->chg_first; tmp_end = (XmTextPosition)(PreEndTW(tw) + insert_length - call_data->chg_length); if (PreOverMaxLen(tw) < tmp_end - PreStartTW(tw)){ if (tmp_end - PreStartTW(tw) > PreOverLen(tw)){ endPos = startPos + call_data->chg_length; PreOverMaxLen(tw) = PreOverLen(tw); } else { endPos = PreEndTW(tw) + tmp_end - PreStartTW(tw) - PreOverMaxLen(tw); PreOverMaxLen(tw) = tmp_end - PreStartTW(tw); } } else { if (PreOverMaxLen(tw) > tmp_end - PreStartTW(tw)){ endPos = PreEndTW(tw); recover_len = PreOverMaxLen(tw) - tmp_end + PreStartTW(tw); PreOverMaxLen(tw) = tmp_end - PreStartTW(tw); } else endPos = startPos + call_data->chg_length; } rest_len = PreEndTW(tw) - PreStartTW(tw) - call_data->chg_first - call_data->chg_length; if (rest_len) { over_mb = _XmStringSourceGetString(tw, (XmTextPosition) (PreStartTW(tw)+call_data->chg_first+call_data->chg_length), PreEndTW(tw), False); mb = XtRealloc(mb, strlen(mb)+strlen(over_mb)+1); strcat(mb, over_mb); XtFree(over_mb); } if (recover_len > 0) { mb = XtRealloc(mb, strlen(mb) + (recover_len + 1 ) * tw->text.char_size); ptr = PreOverStr(tw); for (i=0; ichg_first; endPos = startPos + call_data->chg_length; } if (data->overstrike) PreEndTW(tw) = startPos + insert_length; else PreEndTW(tw) += insert_length - endPos + startPos; PreCursorTW(tw) = PreStartTW(tw) + call_data->caret; /* verify preedit set, so call PreeditVerifyReplace */ if (need_verify) { PreeditVerifyReplace(w, startPos, endPos, mb, PreCursorTW(tw), &end_preedit); if (end_preedit) { (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); return; } } /* no need to verify, just insert text into buffer */ else { block.ptr = mb; block.length = strlen(mb); block.format = XmFMT_8_BIT; if ((*tw->text.source->Replace)(tw, NULL, &startPos, &endPos, &block, False) != EditDone) { XBell(XtDisplay(tw), 0); return; } else _XmTextPreeditSetCursorPosition(w, PreCursorTW(tw)); } /* set feedback */ if (insert_length>0) PreeditSetRendition(w, call_data); /* turn cursor back on */ (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); if (mb) XtFree(mb); } /* * This is the function set to XNPreeditCaretCallback resource. * This function is called when the input server requests XmText to move * the caret. */ static void PreeditCaret(XIC xic, XPointer client_data, XIMPreeditCaretCallbackStruct *call_data) { XmTextWidget tw = (XmTextWidget) client_data; XmSourceData data = tw->text.source->data; Widget w = (Widget) client_data; XmTextPosition new_position, start = 0; Widget p = (Widget) tw; Boolean need_verify; (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); while (!XtIsShell(p)) p = XtParent(p); XtVaGetValues(p, XmNverifyPreedit, &need_verify, NULL); switch (call_data->direction) { case XIMForwardChar: new_position = PreCursorTW(tw) + 1 - PreStartTW(tw); break; case XIMBackwardChar: new_position = PreCursorTW(tw) - 1 - PreStartTW(tw); break; case XIMAbsolutePosition: new_position = (XmTextPosition) call_data->position; break; default: new_position = PreCursorTW(tw) - PreStartTW(tw); } _XmTextValidate(&start, &new_position, data->length); PreCursorTW(tw) = PreStartTW(tw) + new_position; if (need_verify) { UnderVerifyPreedit(tw) = True; _XmTextSetCursorPosition (w, PreCursorTW(tw)); UnderVerifyPreedit(tw) = False; } else _XmTextPreeditSetCursorPosition(w, PreCursorTW(tw)); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); } static void ResetUnder(XmTextWidget tw) { if (XmImGetXICResetState((Widget)tw) != XIMPreserveState) PreUnder(tw) = False; } /* * Resets input method context. * * 1. Call XmImMbResetIC to reset the input method and get the current * preedit string. * 2. Set the string to XmText */ void _XmTextResetIC(Widget widget) { int escapement, n, size; char *mb, *tmp_mb; XRectangle overall_ink; XmTextPosition cursorPos, beginPos, nextPos, lastPos; XmTextWidget tw = (XmTextWidget) widget; InputData data = tw->text.input->data; OutputData o_data = tw->text.output->data; XFontStruct *font = o_data->font; if (!PreUnder((XmTextWidget) widget)) return; if (VerifyCommitNeeded(tw)) { VerifyCommitNeeded(tw) = False; mb = _XmStringSourceGetString(tw, PreStartTW(tw), PreEndTW(tw), False); XmImMbResetIC(widget, &tmp_mb); if (tmp_mb) XtFree(tmp_mb); } else XmImMbResetIC(widget, &mb); if (!mb) { ResetUnder(tw); return; } n = strlen(mb); if (n > TEXT_MAX_INSERT_SIZE) { ResetUnder(tw); return; } if (n > 0) { (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); mb[n]='\0'; if (o_data->use_fontset) { escapement = XmbTextExtents((XFontSet)font, mb, n, &overall_ink, NULL ); if (escapement == 0 && overall_ink.width == 0 && strchr(mb, '\t') == 0 ) { (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); ResetUnder(tw); return; } } else { (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); ResetUnder(tw); return; } beginPos = nextPos = XmTextGetCursorPosition(widget); if (data->overstrike) { tmp_mb = XtMalloc((n+1)*tw->text.char_size); size = _XmTextBytesToCharacters(tmp_mb, mb, n, False, tw->text.char_size); nextPos += size; XtFree(tmp_mb); lastPos = (*(tw->text.source->Scan))(tw->text.source, beginPos, XmSELECT_LINE, XmsdRight, 1, TRUE); if (nextPos > lastPos) nextPos = lastPos; } else if (PreUnder(tw) && PreStartTW(tw) < PreEndTW(tw)) { beginPos = PreStartTW(tw); nextPos = PreEndTW(tw); XmTextSetHighlight((Widget)tw, beginPos, nextPos, XmHIGHLIGHT_NORMAL); } _XmTextReplace(widget, beginPos, nextPos, mb, False); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); XtFree(mb); } ResetUnder(tw); } XmTextPosition _XmTextSetPreeditPosition(Widget w, XmTextPosition position) { XmTextWidget tw = (XmTextWidget)w; XmTextPosition cursorPos = position; if (tw != NULL && tw->text.onthespot) { if (PreUnder(tw) && PreStartTW(tw) < PreEndTW(tw)) { int diff = PreEndTW(tw) - PreStartTW(tw); PreStartTW(tw) = cursorPos; cursorPos += diff; PreEndTW(tw) = PreCursorTW(tw) = cursorPos; } else { PreStartTW(tw) = PreEndTW(tw) = PreCursorTW(tw) = cursorPos; } } return cursorPos; } /**************************************************************** * * Public definitions. * ****************************************************************/ char * XmTextGetString(Widget widget) { char *text_copy = NULL; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) { XmAccessTextualTrait textT; textT = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(widget), XmQTaccessTextual); if (textT) text_copy = (char*) textT->getValue(widget, XmFORMAT_MBYTE); } else text_copy = _XmStringSourceGetValue(GetSrc(widget), False); _XmAppUnlock(app); return (text_copy); } wchar_t * XmTextGetStringWcs(Widget widget) { wchar_t *text_copy = NULL; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)){ XmAccessTextualTrait textT; textT = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(widget), XmQTaccessTextual); if (textT) text_copy = (wchar_t *) textT->getValue(widget, XmFORMAT_WCS); } else text_copy = (wchar_t *) _XmStringSourceGetValue(GetSrc(widget), True); _XmAppUnlock(app); return (text_copy); } void XmTextSetString(Widget widget, char *value) { _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) { XmAccessTextualTrait textT; textT = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(widget), XmQTaccessTextual); if (textT) textT->setValue(widget, (XtPointer)value, XmFORMAT_MBYTE); } else _XmTextSetString(widget, value); _XmAppUnlock(app); } void XmTextSetStringWcs(Widget widget, wchar_t *wc_value) { char * tmp; int num_chars = 0; int result; XmTextWidget tw = (XmTextWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); if(XmIsTextField(widget)) { XmAccessTextualTrait textT; textT = (XmAccessTextualTrait) XmeTraitGet((XtPointer) XtClass(widget), XmQTaccessTextual); if (textT) textT->setValue(widget, (XtPointer)wc_value, XmFORMAT_WCS); } else { for (num_chars = 0; wc_value[num_chars] != (wchar_t)0L; num_chars++) /*EMPTY*/; tmp = XtMalloc((unsigned) (num_chars + 1) * (int)tw->text.char_size); result = wcstombs(tmp, wc_value, (num_chars + 1) * (int)tw->text.char_size); if (result == (size_t) -1) {/* if wcstombs fails, it returns (size_t) -1 */ XtFree(tmp); /* if invalid data, pass in the empty string */ _XmTextSetString(widget, ""); } else { _XmTextSetString(widget, tmp); XtFree(tmp); } } _XmAppUnlock(app); } XmTextPosition XmTextGetTopCharacter(Widget widget) { XmTextWidget tw = (XmTextWidget) widget; XmTextPosition ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); if (tw->text.needs_refigure_lines) RefigureLines(tw); ret_val = tw->text.top_character; _XmAppUnlock(app); return ret_val; } void XmTextSetTopCharacter(Widget widget, XmTextPosition top_character) { XmTextWidget tw = (XmTextWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); if (tw->text.output->data->resizeheight && !(tw->text.output->data->scrollvertical && XmIsScrolledWindow(XtParent(widget))) ) { if (tw->text.top_character == 0) { _XmAppUnlock(app); return; } else top_character = 0; } _XmTextSetTopCharacter(widget, top_character); _XmAppUnlock(app); } XmTextSource XmTextGetSource(Widget widget) { XmTextWidget tw = (XmTextWidget) widget; XmTextSource ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); ret_val = tw->text.source; _XmAppUnlock(app); return ret_val; } void XmTextSetSource(Widget widget, XmTextSource source, XmTextPosition top_character, XmTextPosition cursor_position) { XmTextWidget tw = (XmTextWidget) widget; XmTextPosition pos = 0; XmTextPosition last_pos = 0; XmTextPosition old_pos = 0; XmTextBlockRec block; int n = 0; XPoint xmim_point; XRectangle xmim_area; Arg args[10]; _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextResetIC(widget); EraseInsertionPoint(tw); if (source == NULL) { XmeWarning(widget, MESSAGE2); _XmAppUnlock(app); return; } /* zero out old line table */ block.ptr = NULL; block.length = 0; _XmTextUpdateLineTable(widget, 0, 0, &block, False); tw->text.total_lines = 1; (*tw->text.source->RemoveWidget)(tw->text.source, tw); tw->text.source = source; if (cursor_position > source->data->length) cursor_position = source->data->length; else if (cursor_position < 0) cursor_position = 0; tw->text.cursor_position = cursor_position; _XmTextMovingCursorPosition(tw, cursor_position); /*correct GC for * new location */ tw->text.output->data->refresh_ibeam_off = True; (*tw->text.source->AddWidget)(tw->text.source, tw); _XmStringSourceSetGappedBuffer(source->data, cursor_position); if (tw->text.edit_mode == XmMULTI_LINE_EDIT) top_character = (*tw->text.source->Scan)(tw->text.source, top_character, XmSELECT_LINE, XmsdLeft, 1, FALSE); tw->text.new_top = top_character; tw->text.top_character = 0; /* reset line table with new source */ last_pos = (XmTextPosition) source->data->length; while (pos < last_pos) { pos = (*tw->text.source->ReadSource)(source, pos, last_pos, &block); if (block.length == 0) break; _XmTextUpdateLineTable(widget, old_pos, old_pos, &block, False); old_pos = pos; } _XmTextInvalidate(tw, top_character, top_character, NODELTA); if (tw->text.disable_depth == 0) Redisplay(tw); /* Tell the input method the new x,y location of the cursor */ (*tw->text.output->PosToXY)(tw, cursor_position, &xmim_point.x, &xmim_point.y); (void)_XmTextGetDisplayRect((Widget)tw, &xmim_area); n = 0; XtSetArg(args[n], XmNspotLocation, &xmim_point); n++; XtSetArg(args[n], XmNarea, &xmim_area); n++; XmImSetValues((Widget)tw, args, n); TextDrawInsertionPoint(tw); _XmAppUnlock(app); } void XmTextScroll(Widget widget, int n) { XmTextWidget tw = (XmTextWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); tw->text.pending_scroll += n; tw->text.needs_refigure_lines = tw->text.needs_redisplay = TRUE; if (tw->text.disable_depth == 0) Redisplay(tw); _XmAppUnlock(app); } void XmTextDisableRedisplay(Widget widget) { _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextDisableRedisplay((XmTextWidget)widget, False); _XmAppUnlock(app); } void XmTextEnableRedisplay(Widget widget) { _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextEnableRedisplay((XmTextWidget)widget); _XmAppUnlock(app); } Widget XmCreateScrolledText(Widget parent, char *name, ArgList arglist, Cardinal argcount) { Widget swindow; Widget stext; Arg args_cache[30]; ArgList merged_args; int n; char s_cache[30]; char *s; Cardinal s_size; Cardinal arg_size = argcount + 5; _XmWidgetToAppContext(parent); _XmAppLock(app); s_size = ((name) ? strlen(name) : 0) + 3; s = (char *) XmStackAlloc(s_size, s_cache); /* Name + NULL + "SW" */ if (name) { strcpy(s, name); strcat(s, "SW"); } else { strcpy(s, "SW"); } /* * merge the application arglist with the required preset arglist, for * creating the scrolled window portion of the scroll text. */ merged_args = (ArgList)XmStackAlloc(arg_size*sizeof(Arg), args_cache); for (n=0; n < argcount; n++) { merged_args[n].name = arglist[n].name; merged_args[n].value = arglist[n].value; } XtSetArg(merged_args[n], XmNscrollingPolicy, (XtArgVal) XmAPPLICATION_DEFINED); n++; XtSetArg(merged_args[n], XmNvisualPolicy, (XtArgVal)XmVARIABLE); n++; XtSetArg(merged_args[n], XmNscrollBarDisplayPolicy, (XtArgVal)XmSTATIC); n++; XtSetArg(merged_args[n], XmNshadowThickness, (XtArgVal) 0); n++; swindow = XtCreateManagedWidget(s, xmScrolledWindowWidgetClass, parent, merged_args, n); XmStackFree(s, s_cache); XmStackFree((char *)merged_args, args_cache); /* Create Text widget. */ stext = XtCreateWidget(name, xmTextWidgetClass, swindow, arglist, argcount); /* Add callback to destroy ScrolledWindow parent. */ XtAddCallback (stext, XmNdestroyCallback, _XmDestroyParentCallback, NULL); _XmAppUnlock(app); /* Return Text.*/ return (stext); } Widget XmCreateText(Widget parent, char *name, ArgList arglist, Cardinal argcount) { return XtCreateWidget(name, xmTextWidgetClass, parent, arglist, argcount); } Widget XmVaCreateText( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmTextWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedText( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmTextWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/DialogSEP.h0000644000175000017500000000466213145162623012650 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDialogShellExtP_h #define _XmDialogShellExtP_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsDialogShellExt #define XmIsDialogShellExt(w) XtIsSubclass(w, xmDialogShellExtObjectClass) #endif /* XmIsDialogShellExt */ externalref WidgetClass xmDialogShellExtObjectClass; typedef struct _XmDialogShellExtClassRec *XmDialogShellExtObjectClass ; typedef struct _XmDialogShellExtRec *XmDialogShellExtObject ; typedef struct _XmDialogShellExtClassPart{ XtPointer extension; /* Pointer to extension record */ }XmDialogShellExtClassPart, *XmDialogShellExtClassPartPtr; typedef struct _XmDialogShellExtClassRec{ ObjectClassPart object_class; XmExtClassPart ext_class; XmDesktopClassPart desktop_class; XmShellExtClassPart shell_class; XmVendorShellExtClassPart vendor_class; XmDialogShellExtClassPart dialog_class; }XmDialogShellExtClassRec; typedef struct _XmDialogShellExtPart{ int empty; } XmDialogShellExtPart; externalref XmDialogShellExtClassRec xmDialogShellExtClassRec; typedef struct _XmDialogShellExtRec{ ObjectPart object; XmExtPart ext; XmDesktopPart desktop; XmShellExtPart shell; XmVendorShellExtPart vendor; XmDialogShellExtPart dialog; }XmDialogShellExtRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDialogShellExtP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DataFP.h0000644000175000017500000002366212672140200012170 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmDataFP_h #define _XmDataFP_h #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* * Motif doesn't define this: go figure */ #ifndef XmTextFieldIndex #define XmTextFieldIndex (XmPrimitiveIndex + 1) #endif #define XmDataFieldIndex (XmTextFieldIndex) typedef struct _XmDataFieldClassPart { XtPointer extension; } XmDataFieldClassPart; typedef struct _XmDataFieldClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmDataFieldClassPart data_class; } XmDataFieldClassRec; typedef struct _XmDataFieldPart { unsigned char alignment; /* XmALIGNMENT_BEGINNING by default */ String picture_source; XmPicture picture; Boolean auto_fill; XtCallbackList picture_error_cb; XtCallbackList validate_cb; } XmDataFieldPart; typedef struct _XmDataFieldRec { CorePart core; XmPrimitivePart primitive; XmTextFieldPart text; XmDataFieldPart data; } XmDataFieldRec; extern XmDataFieldClassRec xmDataFieldClassRec; #define XmTextF_activate_callback(w) (((XmDataFieldWidget)(w))->text.activate_callback) #define XmTextF_focus_callback(w) (((XmDataFieldWidget)(w))->text.focus_callback) #define XmTextF_losing_focus_callback(w) (((XmDataFieldWidget)(w))->text.losing_focus_callback) #define XmTextF_modify_verify_callback(w) (((XmDataFieldWidget)(w))->text.modify_verify_callback) #define XmTextF_wcs_modify_verify_callback(w) (((XmDataFieldWidget)(w))->text.wcs_modify_verify_callback) #define XmTextF_motion_verify_callback(w) (((XmDataFieldWidget)(w))->text.motion_verify_callback) #define XmTextF_gain_primary_callback(w) (((XmDataFieldWidget)(w))->text.gain_primary_callback) #define XmTextF_lose_primary_callback(w) (((XmDataFieldWidget)(w))->text.lose_primary_callback) #define XmTextF_value_changed_callback(w) (((XmDataFieldWidget)(w))->text.value_changed_callback) #define XmTextF_value(w) (((XmDataFieldWidget)(w))->text.value) #define XmTextF_wc_value(w) (((XmDataFieldWidget)(w))->text.wc_value) #define XmTextF_font_list(w) (((XmDataFieldWidget)(w))->text.font_list) #define XmTextF_font(w) ((XFontStruct*)(((XmDataFieldWidget)(w))->text.font)) #define XmTextF_selection_array(w) (((XmDataFieldWidget)(w))->text.selection_array) #define XmTextF_highlight(w) (((XmDataFieldWidget)(w))->text.highlight) #define XmTextF_gc(w) (((XmDataFieldWidget)(w))->text.gc) #define XmTextF_image_gc(w) (((XmDataFieldWidget)(w))->text.image_gc) #define XmTextF_save_gc(w) (((XmDataFieldWidget)(w))->text.save_gc) #define XmTextF_ibeam_off(w) (((XmDataFieldWidget)(w))->text.ibeam_off) #define XmTextF_add_mode_cursor(w) (((XmDataFieldWidget)(w))->text.add_mode_cursor) #define XmTextF_cursor(w) (((XmDataFieldWidget)(w))->text.cursor) #define XmTextF_putback(w) (((XmDataFieldWidget)(w))->text.putback) #define XmTextF_stipple_tile(w) (((XmDataFieldWidget)(w))->text.stipple_tile) #define XmTextF_image_clip(w) (((XmDataFieldWidget)(w))->text.image_clip) #define XmTextF_cursor_position(w) (((XmDataFieldWidget)(w))->text.cursor_position) #define XmTextF_new_h_offset(w) (((XmDataFieldWidget)(w))->text.new_h_offset) #define XmTextF_h_offset(w) (((XmDataFieldWidget)(w))->text.h_offset) #define XmTextF_orig_left(w) (((XmDataFieldWidget)(w))->text.orig_left) #define XmTextF_orig_right(w) (((XmDataFieldWidget)(w))->text.orig_right) #define XmTextF_prim_pos_left(w) (((XmDataFieldWidget)(w))->text.prim_pos_left) #define XmTextF_prim_pos_right(w) (((XmDataFieldWidget)(w))->text.prim_pos_right) #define XmTextF_prim_anchor(w) (((XmDataFieldWidget)(w))->text.prim_anchor) #define XmTextF_sec_pos_left(w) (((XmDataFieldWidget)(w))->text.sec_pos_left) #define XmTextF_sec_pos_right(w) (((XmDataFieldWidget)(w))->text.sec_pos_right) #define XmTextF_sec_anchor(w) (((XmDataFieldWidget)(w))->text.sec_anchor) #define XmTextF_stuff_pos(w) (((XmDataFieldWidget)(w))->text.stuff_pos) #define XmTextF_select_pos_x(w) (((XmDataFieldWidget)(w))->text.select_pos_x) #define XmTextF_prim_time(w) (((XmDataFieldWidget)(w))->text.prim_time) #define XmTextF_dest_time(w) (((XmDataFieldWidget)(w))->text.dest_time) #define XmTextF_sec_time(w) (((XmDataFieldWidget)(w))->text.sec_time) #define XmTextF_last_time(w) (((XmDataFieldWidget)(w))->text.last_time) #define XmTextF_timer_id(w) (((XmDataFieldWidget)(w))->text.timer_id) #define XmTextF_select_id(w) (((XmDataFieldWidget)(w))->text.select_id) #define XmTextF_blink_rate(w) (((XmDataFieldWidget)(w))->text.blink_rate) #define XmTextF_selection_array_count(w) (((XmDataFieldWidget)(w))->text.selection_array_count) #define XmTextF_threshold(w) (((XmDataFieldWidget)(w))->text.threshold) #define XmTextF_size_allocd(w) (((XmDataFieldWidget)(w))->text.size_allocd) #define XmTextF_string_length(w) (((XmDataFieldWidget)(w))->text.string_length) #define XmTextF_cursor_height(w) (((XmDataFieldWidget)(w))->text.cursor_height) #define XmTextF_cursor_width(w) (((XmDataFieldWidget)(w))->text.cursor_width) #define XmTextF_sarray_index(w) (((XmDataFieldWidget)(w))->text.sarray_index) #define XmTextF_max_length(w) (((XmDataFieldWidget)(w))->text.max_length) #define XmTextF_max_char_size(w) (((XmDataFieldWidget)(w))->text.max_char_size) #define XmTextF_columns(w) (((XmDataFieldWidget)(w))->text.columns) #define XmTextF_margin_width(w) (((XmDataFieldWidget)(w))->text.margin_width) #define XmTextF_margin_height(w) (((XmDataFieldWidget)(w))->text.margin_height) #define XmTextF_average_char_width(w) (((XmDataFieldWidget)(w))->text.average_char_width) #define XmTextF_margin_top(w) (((XmDataFieldWidget)(w))->text.margin_top) #define XmTextF_margin_bottom(w) (((XmDataFieldWidget)(w))->text.margin_bottom) #define XmTextF_font_ascent(w) (((XmDataFieldWidget)(w))->text.font_ascent) #define XmTextF_font_descent(w) (((XmDataFieldWidget)(w))->text.font_descent) #define XmTextF_resize_width(w) (((XmDataFieldWidget)(w))->text.resize_width) #define XmTextF_pending_delete(w) (((XmDataFieldWidget)(w))->text.pending_delete) #define XmTextF_editable(w) (((XmDataFieldWidget)(w))->text.editable) #define XmTextF_verify_bell(w) (((XmDataFieldWidget)(w))->text.verify_bell) #define XmTextF_cursor_position_visible(w) (((XmDataFieldWidget)(w))->text.cursor_position_visible) #define XmTextF_traversed(w) (((XmDataFieldWidget)(w))->text.traversed) #define XmTextF_add_mode(w) (((XmDataFieldWidget)(w))->text.add_mode) #define XmTextF_has_focus(w) (((XmDataFieldWidget)(w))->text.has_focus) #define XmTextF_blink_on(w) (((XmDataFieldWidget)(w))->text.blink_on) #define XmTextF_cursor_on(w) (((XmDataFieldWidget)(w))->text.cursor_on) #define XmTextF_refresh_ibeam_off(w) (((XmDataFieldWidget)(w))->text.refresh_ibeam_off) #define XmTextF_have_inverted_image_gc(w) (((XmDataFieldWidget)(w))->text.have_inverted_image_gc) #define XmTextF_has_primary(w) (((XmDataFieldWidget)(w))->text.has_primary) #define XmTextF_has_secondary(w) (((XmDataFieldWidget)(w))->text.has_secondary) #define XmTextF_has_destination(w) (((XmDataFieldWidget)(w))->text.has_destination) #define XmTextF_sec_drag(w) (((XmDataFieldWidget)(w))->text.sec_drag) #define XmTextF_selection_move(w) (((XmDataFieldWidget)(w))->text.selection_move) #define XmTextF_pending_off(w) (((XmDataFieldWidget)(w))->text.pending_off) #define XmTextF_fontlist_created(w) (((XmDataFieldWidget)(w))->text.fontlist_created) #define XmTextF_has_rect(w) (((XmDataFieldWidget)(w))->text.has_rect) #define XmTextF_do_drop(w) (((XmDataFieldWidget)(w))->text.do_drop) #define XmTextF_cancel(w) (((XmDataFieldWidget)(w))->text.cancel) #define XmTextF_extending(w) (((XmDataFieldWidget)(w))->text.extending) #define XmTextF_sec_extending(w) (((XmDataFieldWidget)(w))->text.sec_extending) #define XmTextF_in_setvalues(w) (((XmDataFieldWidget)(w))->text.in_setvalues) #define XmTextF_do_resize(w) (((XmDataFieldWidget)(w))->text.do_resize) #define XmTextF_sel_start(w) (((XmDataFieldWidget)(w))->text.sel_start) #define XmTextF_check_set_render_table(w) (((XmDataFieldWidget)(w))->text.check_set_render_table) #define XmTextF_extension(w) (((XmDataFieldWidget)(w))->text.extension) #define XmTextF_overstrike(w) (((XmDataFieldWidget)(w))->text.overstrike) #define XmTextF_redisplay(w) (((XmDataFieldWidget)(w))->text.redisplay) #define XmTextF_have_fontset(w) (((XmDataFieldWidget)(w))->text.have_fontset) #ifdef USE_XFT #define XmTextF_use_xft(w) (((XmDataFieldWidget)(w))->text.use_xft) #define XmTextF_xft_font(w) (((XftFont*)((XmDataFieldWidget)(w))->text.font)) #endif #define XmTextF_changed_visible(w) (((XmDataFieldWidget)(w))->text.changed_visible) #define XmDataField_alignment(w) (((XmDataFieldWidget)(w))->data.alignment) #define XmDataField_picture_source(w) (((XmDataFieldWidget)(w))->data.picture_source) #define XmDataField_picture(w) (((XmDataFieldWidget)(w))->data.picture) #define XmDataField_picture_state(w) (((XmDataFieldWidget)(w))->data.picture_state) #define XmDataField_auto_fill(w) (((XmDataFieldWidget)(w))->data.auto_fill) #define XmDataField_picture_error_cb(w) (((XmDataFieldWidget)(w))->data.picture_error_cb) #define XmDataField_validate_cb(w) (((XmDataFieldWidget)(w))->data.validate_cb) #ifdef __cplusplus } /* extern "C" */ #endif #endif /* _XmDataFP_h */ motif-2.3.8/lib/Xm/Column.c0000644000175000017500000022670312672140200012322 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "XmI.h" #define XK_LATIN1 #include static void ClassInitialize(void); static void Initialize(Widget, Widget, ArgList, Cardinal*); static void ClassPartInitialize(WidgetClass w_class); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal*); static void Destroy(Widget); static void Resize(Widget); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry*, XtWidgetGeometry*); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry*, XtWidgetGeometry*); static void ChangeManaged(Widget); static void ConstraintInitialize(Widget, Widget, ArgList, Cardinal*); static Boolean ConstraintSetValues(Widget, Widget, Widget, ArgList, Cardinal*); static void ConstraintDestroy(Widget); static void ConstraintGetValues(Widget, ArgList, Cardinal*); static Boolean CvtStringToXiAlignment( Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer ); static Boolean CvtStringToFillStyle( Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer ); static Boolean CvtStringToDistribution( Display*, XrmValue*, Cardinal*, XrmValue*, XrmValue*, XtPointer ); static void Layout( XmColumnWidget, Widget, XtWidgetGeometry*, int, int ); static void HorizontalLayout( XmColumnWidget, Widget, XtWidgetGeometry*, int, int ); static void VerticalLayout( XmColumnWidget, Widget, XtWidgetGeometry*, int, int ); static void VerifyResources( XmColumnWidget, XmColumnWidget, XmColumnWidget ); static void VerifyConstraints( Widget, Widget, Widget ); static void CalcSize( XmColumnWidget, Widget, XtWidgetGeometry*, Boolean, Dimension*, Dimension* ); static Boolean CompareGeometry( XtWidgetGeometry*, XtWidgetGeometry* ); static Boolean CompareGeometryToWidget( XtWidgetGeometry*, Widget ); static void CheckSetEntryLabelRenderTable(Widget wid, int offs, XrmValue *value); static void CheckSetDefaultEntryLabelRenderTable(Widget wid, int offs, XrmValue *value); static void XmColumnLabelDestroyedCallback( Widget, XtPointer, XtPointer ); #if 0 /* POSITION HANDLING */ Note: this code was never finished and has been pulled out. The public and semi-public traces have been pulled out of the header files. Everything is marked with the #if used above. #endif #define BBPart(w) ((XmBulletinBoardPart*)(&(((XmBulletinBoardWidget)(w))->bulletin_board))) #define XiC(w) ((XmColumnConstraintPart*)(&((XmColumnConstraintPtr)((w)->core.constraints))->column)) #define XiValidChild(c) (((c)) != NULL && XtIsManaged((c)) && \ !(c)->core.being_destroyed && \ XiC(c)->label_widget != NULL) #define XmColumn(c) ((XmColumnWidget) XtParent((c))) #define XiAlignment(c) ((XiC((c))->label_alignment == XmALIGNMENT_UNSPECIFIED) \ ? XmColumn_default_label_alignment(XmColumn((c))) \ : XiC(c)->label_alignment) #if 0 /* POSITION HANDLING */ #define XiPosition(c) ((XiC(c)->label_position == XiLABEL_POSITION_UNSPECIFIED)\ ? XmColumn_default_label_position(XmColumn(c)) \ : XiC(c)->label_position) #endif #define XiFill(c) ((XiC(c)->fill_style == XmFILL_UNSPECIFIED)\ ? XmColumn_default_fill_style(XmColumn(c)) \ : XiC(c)->fill_style) #define XiWidth(c) (XtWidth(c) + 2 * XtBorderWidth(c)) #define XiHeight(c) (XtHeight(c) + 2 * XtBorderWidth(c)) #if 0 /* POSITION HANDLING */ /* from public .h file */ #define XiLABEL_POSITION_UNSPECIFIED 0 #define XiLABEL_POSITION_CENTER (1L<<0) #define XiLABEL_POSITION_LEFT (1L<<1) #define XiLABEL_POSITION_RIGHT (1L<<2) #define XiLABEL_POSITION_TOP (1L<<3) #define XiLABEL_POSITION_BOTTOM (1L<<4) /* structure member elements from private P.h file */ unsigned char default_label_position; unsigned char label_position; #define XmColumnC_label_position(w) XmColCField(w, label_position, unsigned char) #define XmColumn_default_label_position(w) XmColField(w, default_label_position, unsigned char) #endif #define DEFAULT_ALIGNMENT XmALIGNMENT_BEGINNING #if 0 /* POSITION HANDLING */ #define DEFAULT_POSITION XiLABEL_POSITION_LEFT #endif #define DEFAULT_ORIENTATION XmVERTICAL #define DEFAULT_FILL_STYLE XmFILL_RAGGED static XtResource resources[] = { { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmColumnRec, column.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNdefaultEntryLabelFontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmBulletinBoardRec, bulletin_board.label_font_list), XmRCallProc, (XtPointer) CheckSetDefaultEntryLabelRenderTable }, { XmNdefaultEntryLabelRenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmBulletinBoardRec, bulletin_board.label_font_list), XmRCallProc, (XtPointer) CheckSetDefaultEntryLabelRenderTable }, { XmNdefaultEntryLabelAlignment, XmCAlignment, XmRXmAlignment, sizeof(unsigned char), XtOffsetOf(XmColumnRec, column.default_label_alignment), XmRImmediate, (XtPointer) DEFAULT_ALIGNMENT }, #if 0 /* POSITION HANDLING */ { XmNdefaultEntryLabelPosition, XmCEntryLabelPosition, XmRLabelPosition, sizeof(unsigned char), XtOffsetOf(XmColumnRec, column.default_label_position), XmRImmediate, (XtPointer) DEFAULT_POSITION }, #endif { XmNdefaultFillStyle, XmCFillStyle, XmRFillStyle, sizeof(unsigned char), XtOffsetOf(XmColumnRec, column.default_fill_style), XmRImmediate, (XtPointer) DEFAULT_FILL_STYLE }, { XmNitemSpacing, XmCItemSpacing, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmColumnRec, column.item_spacing), XmRImmediate, (XtPointer) 2 }, { XmNlabelSpacing, XmCLabelSpacing, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmColumnRec, column.label_spacing), XmRImmediate, (XtPointer) 10 }, { XmNorientation, XmCOrientation, XmROrientation, sizeof(unsigned char), XtOffsetOf(XmColumnRec, column.orientation), XmRImmediate, (XtPointer) DEFAULT_ORIENTATION }, { XmNdistribution, XmCDistribution, XmRDistribution, sizeof(unsigned char), XtOffsetOf(XmColumnRec, column.distribution), XmRImmediate, (XtPointer) XmDISTRIBUTE_TIGHT } }; static XmSyntheticResource get_resources[] = { { XmNlabelSpacing, sizeof(Dimension), XtOffsetOf(XmColumnRec, column.label_spacing), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNitemSpacing, sizeof(Dimension), XtOffsetOf(XmColumnRec, column.item_spacing), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels } }; static XtResource constraint_resources[] = { { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmColumnConstraintRec, column.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNentryLabelFontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmColumnConstraintRec, column.label_font_list), XmRCallProc, (XtPointer) CheckSetEntryLabelRenderTable }, { XmNentryLabelRenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmColumnConstraintRec, column.label_font_list), XmRCallProc, (XtPointer) CheckSetEntryLabelRenderTable }, { XmNentryLabelAlignment, XmCAlignment, XmRXmAlignment, sizeof(unsigned char), XtOffsetOf(XmColumnConstraintRec, column.label_alignment), XmRImmediate, (XtPointer) XmALIGNMENT_UNSPECIFIED }, #if 0 /* POSITION HANDLING */ { XmNentryLabelPosition, XmCEntryLabelPosition, XmRLabelPosition, sizeof(unsigned char), XtOffsetOf(XmColumnConstraintRec, column.label_position), XmRImmediate, (XtPointer) XiLABEL_POSITION_UNSPECIFIED }, #endif { XmNfillStyle, XmCFillStyle, XmRFillStyle, sizeof(unsigned char), XtOffsetOf(XmColumnConstraintRec, column.fill_style), XmRImmediate, (XtPointer) XmFILL_UNSPECIFIED }, { XmNentryLabelType, XmCLabelType, XmRLabelType, sizeof(unsigned char), XtOffsetOf(XmColumnConstraintRec, column.label_type), XmRImmediate, (XtPointer) XmSTRING }, { XmNentryLabelString, XmCLabelString, XmRXmString, sizeof(XmString), XtOffsetOf(XmColumnConstraintRec, column.label_string), XmRImmediate, (XtPointer) NULL }, { XmNentryLabelPixmap, XmCLabelPixmap, XmRPrimForegroundPixmap, sizeof(Pixmap), XtOffsetOf(XmColumnConstraintRec, column.label_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNshowEntryLabel, XmCShowLabel, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmColumnConstraintRec, column.show_label), XmRImmediate, (XtPointer) True }, { XmNstretchable, XmCStretchable, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmColumnConstraintRec, column.stretchable), XmRImmediate, (XtPointer) False } }; /* * Synthetic constraints. Note that these are NOT currently used, * as the constraint get_values_hook method below seems to work where * synthetic resources don't. Dunno. */ static void Get_entryLabelString(Widget, int, XtArgVal *); static XmSyntheticResource cont_get_resources[] = { { XmNentryLabelString, sizeof(XmString), XtOffsetOf(XmColumnConstraintRec, column.label_string), Get_entryLabelString, (XmImportProc) NULL } }; ConstraintClassExtensionRec xiColumnConstraintExtension = { NULL, /* next_extension */ NULLQUARK, /* record_type */ XtConstraintExtensionVersion, /* version */ sizeof(ConstraintClassExtensionRec), /* record_size */ ConstraintGetValues /* get_values_hook */ }; XmColumnClassRec xmColumnClassRec = { { /* core_class members */ /* superclass */ (WidgetClass) &xmBulletinBoardClassRec, /* class_name */ "XmColumn", /* widget_size */ sizeof(XmColumnRec), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ False, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ True, /* compress_exposure */ True, /* compress_enterleave*/ True, /* visible_interest */ False, /* destroy */ Destroy, /* resize */ Resize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator*/ NULL, /* extension */ NULL, }, { /* composite_class members */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ (XtResource*)constraint_resources, /* num resources */ XtNumber(constraint_resources), /* constraint size */ sizeof(XmColumnConstraintRec), /* init proc */ ConstraintInitialize, /* destroy proc */ ConstraintDestroy, /* set values proc */ ConstraintSetValues, /* extension */ &xiColumnConstraintExtension, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ NULL, /* cont_get_resources, */ /* num_syn_cont_resources */ 0, /* XtNumber(cont_get_resources),*/ /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* bulletin board members */ /* always_install_accel */ False, /* geo_matrix_create */ NULL, /* focus_moved_proc */ XmInheritFocusMovedProc, /* extension */ NULL, }, { /* column class members */ /* extension */ NULL, } }; WidgetClass xmColumnWidgetClass = (WidgetClass) &xmColumnClassRec; /* * Function: * ClassInitialize(void) * Description: * This function is called the first time XmColumn or subclass is * created. This function is used to install all need type * converters for this widget class. * Input: * None. * Output: * None. */ static void ClassInitialize(void) { XmColumnClassRec* wc = &xmColumnClassRec; #if 0 /* POSITION HANDLING */ XtSetTypeConverter(XmRString, XmRLabelPosition, (XtTypeConverter) CvtStringToLabelPosition, NULL, 0, XtCacheAll, NULL); #endif XtSetTypeConverter(XmRString, XmRXmAlignment, (XtTypeConverter) CvtStringToXiAlignment, NULL, 0, XtCacheAll, NULL); XtSetTypeConverter(XmRString, XmRFillStyle, (XtTypeConverter) CvtStringToFillStyle, NULL, 0, XtCacheAll, NULL); XtSetTypeConverter(XmRString, XmRDistribution, (XtTypeConverter) CvtStringToDistribution, NULL, 0, XtCacheAll, NULL); } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmCOLUMN_BIT); } /* * Function: * Initialize(request, set, arg_list, arg_cnt) * Description: * This function is called to initialize the resource values for each * new widget instance. This function verifies the resource values * and takes the needed actions to initialize the new instance. * Input: * request : Widget - user resource requests * set : Widget - the resource values for the new widget * arg_list : ArgList - the argument list used to set the resource * ang_cnt : Cardinal - the number of arguments in the list * Output: * None. */ /* ARGSUSED */ static void Initialize(Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) { XmColumnWidget rc = (XmColumnWidget) request, sc = (XmColumnWidget) set; VerifyResources(rc, (XmColumnWidget) NULL, sc); if( rc->core.width == 0 ) { sc->core.width = 2 * (rc->manager.shadow_thickness + BBPart(rc)->margin_width); } if( rc->core.height == 0 ) { sc->core.height = 2 * (rc->manager.shadow_thickness + BBPart(rc)->margin_height); } } /* * Function: * Destroy(widget) * Description: * This function is called when an instance of the Column is being * destroyed. This function deallocates any memory allocated by the * instance. * Input: * widget : Widget - the widget being destroyed * Output: * None. */ /* ARGSUSED */ static void Destroy(Widget widget) { /* This space intentionally left blank */ } /* * Function: * Resize(widget) * Description: * This function is called when an instance changes size. This * function needs to adjust the childrens sizes and positions * appropriately for the new size. * Input: * widget : Widget - the widget that changed size. * Output: * None. */ static void Resize(Widget widget) { WidgetClass sc = XtSuperclass(widget); XmColumnWidget cw = (XmColumnWidget) widget; XtWidgetProc resize; _XmProcessLock(); resize = *sc->core_class.resize; _XmProcessUnlock(); (* resize) (widget); Layout(cw, NULL, NULL, -1, -1); XmColumn_resize_done(cw) = True; } /* * Function: * SetValues(current, request, set, arg_list, arg_cnt) * Description: * This function is called when the user changes the resource * values for the column. This function adjusts the columns * appearance and behavior based on the new resource settings. * Input: * current : Widget - the current resource values for the widget * request : Widget - the requested resource values for the widget * set : Widget - the new resource values for the widget * arg_list : ArgList - the argument list used to change the resource * values * arg_cnt :Cardinal - the number of arguments * Output: * Boolean - True if the Column needs redisplayed, else False. */ /* ARGSUSED */ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList arg_list, Cardinal *arg_cnt) { XmColumnWidget cc = (XmColumnWidget) current, cs = (XmColumnWidget) set; Boolean request_size = False, relayout = False; WidgetList kid, kids = cs->composite.children; Cardinal n, i, kidCnt = cs->composite.num_children; Arg args[10]; VerifyResources((XmColumnWidget) request, cc, cs); if( XmColumn_item_spacing(cc) != XmColumn_item_spacing(cs) || XmColumn_label_spacing(cc) != XmColumn_label_spacing(cs) || XmColumn_distribution(cc) != XmColumn_distribution(cs) || XmColumn_orientation(cc) != XmColumn_orientation(cs) || cc->manager.shadow_thickness != cs->manager.shadow_thickness || BBPart(cc)->margin_width != BBPart(cs)->margin_width || BBPart(cc)->margin_height != BBPart(cs)->margin_height) { request_size = True; } if( XmColumn_default_fill_style(cc) != XmColumn_default_fill_style(cs) #if 0 /* POSITION HANDLING */ || XmColumn_default_label_position(cc) != XmColumn_default_label_position(cs) #endif ) { relayout = True; } n = 0; if( cc->core.background_pixel != cs->core.background_pixel ) { XtSetArg(args[n], XmNbackground, cs->core.background_pixel); n++; } if( cc->manager.foreground != cs->manager.foreground ) { XtSetArg(args[n], XmNforeground, cs->manager.foreground); n++; } for( i = 0, kid = kids; i < kidCnt; ++i, ++kid ) { if( (*kid) == NULL || (*kid)->core.being_destroyed || XiC(*kid)->label_widget == NULL ) continue; XtSetValues(XiC(*kid)->label_widget, args, n); } if( BBPart(cc)->label_font_list != BBPart(cs)->label_font_list ) { for( i = 0, kid = kids; i < kidCnt; ++i, ++kid ) { if( (*kid) == NULL || (*kid)->core.being_destroyed || XiC(*kid)->label_widget == NULL ) continue; if( XiC(*kid)->label_font_list == NULL ) { XtVaSetValues(XiC(*kid)->label_widget, XmNrenderTable, BBPart(cs)->label_font_list, NULL); } } } if( XmColumn_default_label_alignment(cc) != XmColumn_default_label_alignment(cs) ) { for( i = 0, kid = kids; i < kidCnt; ++i, ++kid ) { if( (*kid) == NULL || (*kid)->core.being_destroyed || XiC(*kid)->label_widget == NULL ) continue; if( XiC(*kid)->label_alignment == XmALIGNMENT_UNSPECIFIED ) { XtVaSetValues(XiC(*kid)->label_widget, XmNalignment, XmColumn_default_label_alignment(cs), NULL); } } } if( request_size ) { Dimension width, height; XmColumn_resize_done(cs) = False; CalcSize(cs, NULL, NULL, False, &width, &height); if( XtMakeResizeRequest((Widget) cs, width, height, &width, &height) == XtGeometryAlmost ) { XmColumn_resize_done(cs) = False; XtMakeResizeRequest((Widget) cs, width, height, NULL, NULL); } relayout = !XmColumn_resize_done(cs); } if( relayout ) { Resize((Widget) cs); } return( False ); } /* * Function: * QueryGeometry(widget, request, allowed) * Description: * This function is called when someone wants to know how the Column * would react to a specific geometry or when someone wants to know * what size the Column wants to be. * Input: * widget : Widget - the column widget * request : XtWidgetGeometry* - the requested widget geometry * allowed : XtWidgetGeometry* - the geometry column is will to accept * Output: * XtWidgetResult - the columns response to the geometry request */ static XtGeometryResult QueryGeometry(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *wanted) { XmColumnWidget cw = (XmColumnWidget) widget; XtGeometryResult result; Dimension width, height; /* * Lets start by calling this handly dandy function to calculate * the geometry we want to be. */ CalcSize(cw, NULL, NULL, False, &width, &height); /* * Now lets see if the caller requested anything and if not * lets give him our prefered geometry. */ if( request->request_mode == 0 ) { wanted->request_mode = CWWidth | CWHeight; wanted->width = width; wanted->height = height; if( width == XtWidth(cw) && height == XtHeight(cw) ) { return( XtGeometryNo ); } return( XtGeometryAlmost ); } *wanted = *request; if( request->request_mode & CWWidth ) { if( request->width < width ) { wanted->width = width; } } if( request->request_mode & CWHeight ) { if( request->height < height ) { wanted->height = height; } } /* * Now we have set everything in our return structure to what we * want it to be. Now all that is left is to come up with the * correct return result. The return result is something like. * * o request == wanted and wanted != real -> XtGeometryYes * o request == wanted and wanted == real -> XtGeometryNo * o request != wanted and wanted != real -> XtGeometryAlmost * o request != wanted and wanted == real -> XtGeometryNo */ /* * Lets first see if request == wanted */ if( CompareGeometryToWidget(wanted, (Widget) cw) ) { result = XtGeometryNo; } else { if( CompareGeometry(request, wanted) ) { result = XtGeometryYes; } else { result = XtGeometryNo; } } return( result ); } /* * Function: * GeometryManager(widget, request, allowed) * Description: * This function is called when a child of the Column would like * to change size. This function reacts to the child's request. * Input: * widget : Widget - the child requesting the change * request : XtWidgetGeometry* - the requested widget geometry * allowed : XtWidgetGeometry* - the geometry column is will to accept * Output: * XtWidgetResult - the columns response to the geometry request */ static XtGeometryResult GeometryManager(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *allowed) { XmColumnWidget cw = (XmColumnWidget) XtParent(widget); Dimension width, height, width_return, height_return; XtGeometryResult result; Boolean equal; /* * Now being the mean manager that we are, we are only going to * allow our children to change geometry parts the affect their * size. i.e. we will not even discuss with them their position, * this is mainly because we do not want to deal with it. */ *allowed = *request; allowed->request_mode = request->request_mode = (request->request_mode & ~(CWX | CWY)); /* * Now lets see what this child wants to change. */ if( request->request_mode & CWWidth ) { allowed->width = request->width; } else { allowed->width = XiC(widget)->request_width; } if( request->request_mode & CWHeight ) { allowed->height = request->height; } else { allowed->height = XiC(widget)->request_height; } if( request->request_mode & CWBorderWidth ) { allowed->border_width = request->border_width; } else { allowed->border_width = XtBorderWidth(widget); } /* * Now that we know what size our child want to be lets see * how that effects the geometry we want to be. */ CalcSize(cw, widget, allowed, False, &width, &height); /* * Now that we know that size that we want to be, lets ask our * parent and see what they have to say. */ if( request->request_mode & XtCWQueryOnly ) { XtWidgetGeometry req, alw; req.request_mode = CWWidth | CWHeight | XtCWQueryOnly; req.width = width; req.height = height; width = XtWidth(cw); height = XtHeight(cw); switch( XtMakeGeometryRequest((Widget) cw, &req, &alw) ) { case XtGeometryYes: return( XtGeometryYes ); break; case XtGeometryAlmost: if( alw.request_mode & CWWidth ) width = alw.width; if( alw.request_mode & CWHeight ) height = alw.height; case XtGeometryNo: default: Layout(cw, widget, allowed, width, height); allowed->width = XiC(widget)->position.width; allowed->height = XiC(widget)->position.height; break; } } else { Dimension cur_width, cur_height; XiC(widget)->request_width = allowed->width; XiC(widget)->request_height = allowed->height; XmColumn_resize_done(cw) = False; cur_width = XtWidth(cw); cur_height = XtHeight(cw); switch( XtMakeResizeRequest((Widget) cw, width, height, &width_return, &height_return) ) { case XtGeometryYes: /* * It appears that our parent will has let us change to * the size that we want to be, so lets see if we need to * call our resize procedure. */ if( !XmColumn_resize_done(cw) ) Resize((Widget) cw); Layout(cw, widget, allowed, width, height); allowed->width = XiC(widget)->position.width; allowed->height = XiC(widget)->position.height; break; case XtGeometryAlmost: cur_width = width_return; cur_height = height_return; case XtGeometryNo: default: Layout(cw, widget, allowed, cur_width, cur_height); allowed->width = XiC(widget)->position.width; allowed->height = XiC(widget)->position.height; break; } } width = XtWidth(widget); height = XtHeight(widget); equal = CompareGeometryToWidget(allowed, widget); if( equal ) { result = XtGeometryNo; } else { if( CompareGeometry(request, allowed) ) { result = XtGeometryYes; } else { result = XtGeometryAlmost; } } if( result == XtGeometryYes ) { Layout(cw, NULL, NULL, -1, -1); } return( result ); } /* * Function: * ChangeManaged(widget) * Description: * This is called when one of the children of the column changes * managed state. This routine just takes care of this situation. * Input: * widget : Widget - the column widget * Output: * None. */ static void ChangeManaged(Widget widget) { static Boolean in = False; XmColumnWidget cw = (XmColumnWidget) widget; WidgetList kid = cw->composite.children; Widget label; Cardinal i; Dimension width, height; if( in ) return; in = True; for( i = 0; i < cw->composite.num_children; ++i, ++kid ) { if( !XiValidChild(*kid) ) { if( (*kid) != NULL && !XtIsManaged(*kid) ) { /* CR03731 */ if (XiC(*kid)->label_widget) { XtUnmanageChild(XiC(*kid)->label_widget); } XiC(*kid)->request_width = 0; XiC(*kid)->request_height = 0; } continue; } label = XiC(*kid)->label_widget; if( !XiC(*kid)->show_label ) { if( XtIsManaged(*kid) ) XtUnmanageChild(label); } else if( XtIsManaged(*kid) != XtIsManaged(label) ) { if( XtIsManaged(*kid) ) { XtManageChild(label); } else { XtUnmanageChild(label); } } if( XiC(*kid)->request_width == 0 && XtIsManaged(*kid) ) { XiC(*kid)->request_width = XtWidth(*kid); XiC(*kid)->request_height = XtHeight(*kid); } if( XtIsManaged(label) ) { if( XiC(label)->request_width == 0 ) { #if 0 XiC(label)->request_width = XtWidth(label); XiC(label)->request_height = XtHeight(label); #else { /* Unfortunately, XtWidth() and XtHeight() may not be valid in ** this case. The request_width and request_height values are ** used both to indicate real requested size and also, when 0, ** to indicate a label with particular geometry needs. ** However, if the code goes through ConstraintSetValues (in ** code generated by the Xcessory tools, constraint resources ** are set via set-values after widget creation) first, the ** sizes are 0 and are then set to 1 in VerticalLayout; then ** the code comes through here and updates the request values ** from the real widths -- 1 -- which are then set back on the ** widget as the geometry. The net result is that the labels ** appear with width 1 (and correct height). ** ** Ideally we would cache the real initial requested value and ** update from that value. ** ** For now, rather than storing those values, query the ** label locally for its preferences and use those; the result ** should be that the size is set correctly (going through ** CalcSize and then VerticalLayout). */ XtWidgetGeometry wants; XtQueryGeometry(label, NULL, &wants); if( wants.request_mode & CWWidth ) { XiC(label)->request_width = wants.width; } else { XiC(label)->request_width = XtWidth(label); } if( wants.request_mode & CWHeight ) { XiC(label)->request_height = wants.height; } else { XiC(label)->request_height = XtHeight(label); } } #endif } } else { XiC(label)->request_width = 0; XiC(label)->request_height = 0; } } CalcSize(cw, NULL, NULL, False, &width, &height); if( XtMakeResizeRequest(widget, width, height, &width, &height) == XtGeometryAlmost ) { XtMakeResizeRequest(widget, width, height, NULL, NULL); } Layout(cw, NULL, NULL, -1, -1); in = False; } /* * Function: * ConstraintInitialize(request, new_w, arg_list, arg_cnt) * Description: * This function initializes the constraint record for a new child, * this includes adding a label for each child. * Input: * request : Widget - the requested resource values * new_w : Widget - the new_w resource values (the new widget) * arg_list : ArgList - the argument used to create the widget * arg_cnt : Cardinal - the number of arguments * Output: * None. */ /* ARGSUSED */ static void ConstraintInitialize(Widget request, Widget new_w, ArgList arg_list, Cardinal *arg_cnt) { static Boolean label_widget = False; /* STATIC DATA */ XmColumnWidget cw = (XmColumnWidget) XtParent(new_w); XmBulletinBoardPart *bbpart; /* CR03562 CR02961 When ChangeManaged is bypassed, request width and height are not set. The 2 line will prevent this assumption which sometimes will case the widget size to have zero width/height */ #if 1 /* Note! below fix problematic w.r.t. ChangeManaged code, and needs ** revisiting; back out temporarily */ /* ** It is possible that the widget will have a constraint resource set ** on it before the XmColumn itself is realized (ChangeManaged is ** bypassed in that case), so that we enter the Layout code without ** having the values request_width and request_height set from the ** code in ChangeManaged. Rather than use 0 here, which gives poor ** results when those values are used in XtConfigureWidget to set ** the size, initialize them to reasonable default values. */ XiC(new_w)->request_width = XtWidth(new_w); XiC(new_w)->request_height = XtHeight(new_w); #else XiC(new_w)->request_width = 0; XiC(new_w)->request_height = 0; #endif XiC(new_w)->label_string = XmStringCopy(XiC(new_w)->label_string); if( label_widget ) { XiC(new_w)->label_alignment = XmALIGNMENT_UNSPECIFIED; #if 0 /* POSITION HANDLING */ XiC(new_w)->label_position = XiLABEL_POSITION_UNSPECIFIED; #endif XiC(new_w)->label_type = XmSTRING; XiC(new_w)->label_pixmap = XmUNSPECIFIED_PIXMAP; XiC(new_w)->label_string = (XmString) NULL; XiC(new_w)->label_widget = (Widget) NULL; XiC(new_w)->show_label = False; } else { Arg args[64]; int nargs; char buf[256]; Widget label; XmFontList lfont; VerifyConstraints(request, NULL, new_w); if( strlen(XtName(new_w)) > 240 ) { strncpy(buf, XtName(new_w), 240); buf[240] = '\0'; strcat(buf, "_label"); } else { strcpy(buf, XtName(new_w)); strcat(buf, "_label"); } label_widget = True; lfont = XmColumnC_label_font_list(new_w); bbpart = BBPart(XtParent(new_w)); if(lfont == NULL) lfont = bbpart->label_font_list; nargs = 0; XtSetArg(args[nargs], XmNmarginWidth, 0); nargs++; XtSetArg(args[nargs], XmNmarginHeight, 0); nargs++; XtSetArg(args[nargs], XmNmarginTop, 0); nargs++; XtSetArg(args[nargs], XmNmarginBottom, 0); nargs++; XtSetArg(args[nargs], XmNmarginLeft, 0); nargs++; XtSetArg(args[nargs], XmNmarginRight, 0); nargs++; XtSetArg(args[nargs], XmNshadowThickness, 0); nargs++; XtSetArg(args[nargs], XmNhighlightThickness, 0); nargs++; XtSetArg(args[nargs], XmNtraversalOn, False); nargs++; XtSetArg(args[nargs], XmNlabelType, XiC(new_w)->label_type); nargs++; XtSetArg(args[nargs], XmNlabelString, XiC(new_w)->label_string); nargs++; XtSetArg(args[nargs], XmNlabelPixmap, XiC(new_w)->label_pixmap); nargs++; XtSetArg(args[nargs], XmNalignment, XiAlignment(new_w)); nargs++; XtSetArg(args[nargs], XmNrenderTable, lfont); nargs++; XtSetArg(args[nargs], XmNrecomputeSize, True); nargs++; XtSetArg(args[nargs], XmNforeground, cw->manager.foreground); nargs++; XtSetArg(args[nargs], XmNbackground, cw->core.background_pixel); nargs++; label = XtCreateWidget(buf, xmLabelWidgetClass, (Widget) cw, args, nargs); XiC(new_w)->label_widget = label; XtAddCallback(label, XmNdestroyCallback, XmColumnLabelDestroyedCallback, (XtPointer) new_w); XiC(label)->label_alignment = XmALIGNMENT_UNSPECIFIED; #if 0 /* POSITION HANDLING */ XiC(label)->label_position = XiLABEL_POSITION_UNSPECIFIED; #endif XiC(label)->label_type = XmSTRING; XiC(label)->label_pixmap = XmUNSPECIFIED_PIXMAP; XiC(label)->label_string = (XmString) NULL; XiC(label)->label_widget = (Widget) NULL; XiC(label)->show_label = False; label_widget = False; } } /* * Function: * ConstraintSetValues(current, request, new_w, arg_list, arg_cnt) * Description: * This function is called when the user changes an attribute of * one of the columns children. This routine reacts to the change. * Input: * current : Widget - the current state of the child * request : Widget - the request state of the child * new_w : Widget - the child with the requested changes * arg_list : ArgList - the argument that modified the child * arg_cnt : Cardinal - the number of argument * Output: * Boolean - True if the child needs to be redisplayed, else False. */ /* ARGSUSED */ static Boolean ConstraintSetValues(Widget current, Widget request, Widget new_w, ArgList arg_list, Cardinal *arg_cnt) { XmColumnWidget cw = (XmColumnWidget) XtParent(new_w); XmColumnConstraintPart *cc = XiC(current), *sc = XiC(new_w); Boolean relayout = False; Arg args[10]; Cardinal i = 0; if( XiC(new_w)->label_widget == NULL ) return( False ); VerifyConstraints(request, current, new_w); if( #if 0 /* POSITION HANDLING */ cc->label_position != sc->label_position || #endif cc->fill_style != sc->fill_style || cc->show_label != sc->show_label ) { relayout = True; } if( cc->label_font_list != sc->label_font_list ) { XmFontList lfont = XmColumnC_label_font_list(new_w); if(lfont == NULL) lfont = BBPart(XtParent(new_w))->label_font_list; XtSetArg(args[i], XmNrenderTable, lfont); ++i; } if( cc->label_alignment != sc->label_alignment ) { XtSetArg(args[i], XmNalignment, XiAlignment(new_w)); ++i; } if( cc->label_string != sc->label_string ) { XmStringFree(cc->label_string); sc->label_string = XmStringCopy(sc->label_string); XtSetArg(args[i], XmNlabelString, sc->label_string); ++i; } if( cc->label_pixmap != sc->label_pixmap ) { XtSetArg(args[i], XmNlabelPixmap, sc->label_pixmap); ++i; } if( cc->label_type != sc->label_type ) { XtSetArg(args[i], XmNlabelType, sc->label_type); ++i; } if( i > 0 ) XtSetValues(sc->label_widget, args, i); XmColumn_resize_done(cw) = False; if( cc->show_label != sc->show_label ) { if( sc->show_label ) { XtManageChild(sc->label_widget); } else { XtUnmanageChild(sc->label_widget); } } if( relayout && !XmColumn_resize_done(cw) ) { Layout(cw, NULL, NULL, -1, -1); } return( False ); } /* * Function: * ConstraintDestroy(widget) * Description: * This function is called to deallocate any resources allocated by * the constraint record. * Input: * widget : Widget - the widget being destroyed. * Output: * None. */ static void ConstraintDestroy(Widget widget) { XmStringFree(XiC(widget)->label_string); if( XiC(widget)->label_widget != NULL ) { XtRemoveCallback(XiC(widget)->label_widget, XmNdestroyCallback, XmColumnLabelDestroyedCallback, (XtPointer) widget); XtDestroyWidget(XiC(widget)->label_widget); XiC(widget)->label_widget = NULL; } } /* * Function: * ConstraintGetValues * Description: * The constraint get_values_hook method. It makes copies of the * XmNentryLabelString values to prevent returning internal * XmString data. * Input: * w - The child widget * args - Array of Arg structures * num_args - Number of entries in args * Output: * none (other than the silently copies XmString value) */ static void ConstraintGetValues(Widget w, ArgList args, Cardinal *num_args) { XrmQuark quark; int i; quark = XrmStringToQuark(XmNentryLabelString); for (i = 0; i < ((int) *num_args); i++) { if (quark == XrmStringToQuark(args[i].name)) { args[i].value = (XtArgVal) XmStringCopy(XmColumnC_label_string(w)); break; } } } static int CompareISOLatin1 (char *first, char *second) { register unsigned char *ap, *bp; for (ap = (unsigned char *) first, bp = (unsigned char *) second; *ap && *bp; ap++, bp++) { register unsigned char a, b; if ((a = *ap) != (b = *bp)) { /* try lowercasing and try again */ if ((a >= XK_A) && (a <= XK_Z)) a += (XK_a - XK_A); else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis)) a += (XK_agrave - XK_Agrave); else if ((a >= XK_Ooblique) && (a <= XK_Thorn)) a += (XK_oslash - XK_Ooblique); if ((b >= XK_A) && (b <= XK_Z)) b += (XK_a - XK_A); else if ((b >= XK_Agrave) && (b <= XK_Odiaeresis)) b += (XK_agrave - XK_Agrave); else if ((b >= XK_Ooblique) && (b <= XK_Thorn)) b += (XK_oslash - XK_Ooblique); if (a != b) break; } } return (((int) *bp) - ((int) *ap)); } /* * Function: * done * Description: * This macro is used by the resource conversion routines and * simply assigns the value and returns the correct result. */ #define done(type, value) \ { \ if( to->addr != NULL ) \ { \ if( to->size < sizeof(type) ) \ { \ to->size = sizeof(type); \ return( False ); \ } \ *(type*)(to->addr) = (value); \ } \ else \ { \ static type static_val; \ static_val = (value); \ to->addr = (XtPointer) &static_val; \ } \ to->size = sizeof(type); \ return( True ); \ } #if 0 /* POSITION HANDLING */ /* * Function: * CvtStringToLabelPosition(dpy, args, arg_cnt, from, to, data) * Description: * This function converts a string representation of the representation * type XmRLabelPosition to an actual value. * Input: * dpy : Display - unused * args : XrmValue* - unused * arg_cnt : Cardinal - unused * from : XrmValue* - contains the string representation of the value * to : XrmValue* - returns the actual value * data : XtPointer - unused * Output: * Boolean - True if the conversion was successful else False. */ static Boolean CvtStringToLabelPosition(Display *dpy, XrmValue *args, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer data) { unsigned char result = XiLABEL_POSITION_LEFT; String str = (String) (from->addr); if( CompareISOLatin1(str, "label_position_unspecified") == 0 || CompareISOLatin1(str, "unspecified") == 0 ) { result = XiLABEL_POSITION_UNSPECIFIED; } else if( CompareISOLatin1(str, "label_position_left") == 0 || CompareISOLatin1(str, "left") == 0 ) { result = XiLABEL_POSITION_LEFT; } else if( CompareISOLatin1(str, "label_position_right") == 0 || CompareISOLatin1(str, "right") == 0 ) { result = XiLABEL_POSITION_RIGHT; } else if( CompareISOLatin1(str, "label_position_top") == 0 || CompareISOLatin1(str, "top") == 0 ) { result = XiLABEL_POSITION_TOP; } else if( CompareISOLatin1(str, "label_position_bottom") == 0 || CompareISOLatin1(str, "bottom") == 0 ) { result = XiLABEL_POSITION_BOTTOM; } else if( CompareISOLatin1(str, "label_position_center") == 0 || CompareISOLatin1(str, "CENTER") == 0 ) { result = XiLABEL_POSITION_CENTER; } else { XtDisplayStringConversionWarning(dpy, from->addr, XmRLabelPosition); return( False ); } done(unsigned char, result); } #endif /* * Function: * CvtStringToXiAlignment(dpy, args, arg_cnt, from, to, data) * Description: * This function converts a string representation of the representation * type XmRXnAlignment to an actual value. * Input: * dpy : Display - unused * args : XrmValue* - unused * arg_cnt : Cardinal - unused * from : XrmValue* - contains the string representation of the value * to : XrmValue* - returns the actual value * data : XtPointer - unused * Output: * Boolean - True if the conversion was successful else False. */ /* ARGSUSED */ static Boolean CvtStringToXiAlignment(Display *dpy, XrmValue *args, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer data) { unsigned char result = XmALIGNMENT_CENTER; String str = (String) (from->addr); if( CompareISOLatin1(str, "alignment_unspecified") == 0 || CompareISOLatin1(str, "unspecified") == 0 ) { result = XmALIGNMENT_UNSPECIFIED; } else if( CompareISOLatin1(str, "alignment_beginning") == 0 || CompareISOLatin1(str, "beginning") == 0 ) { result = XmALIGNMENT_BEGINNING; } else if( CompareISOLatin1(str, "alignment_center") == 0 || CompareISOLatin1(str, "center") == 0 ) { result = XmALIGNMENT_CENTER; } else if( CompareISOLatin1(str, "alignment_end") == 0 || CompareISOLatin1(str, "end") == 0 ) { result = XmALIGNMENT_END; } else { XtDisplayStringConversionWarning(dpy, from->addr, XmRXmAlignment); return( False ); } done(unsigned char, result); } /* * Function: * CvtStringToFillStyle(dpy, args, arg_cnt, from, to, data) * Description: * This function converts a string representation of the representation * type XmRFillStyle to an actual value. * Input: * dpy : Display - unused * args : XrmValue* - unused * arg_cnt : Cardinal - unused * from : XrmValue* - contains the string representation of the value * to : XrmValue* - returns the actual value * data : XtPointer - unused * Output: * Boolean - True if the conversion was successful else False. */ /* ARGSUSED */ static Boolean CvtStringToFillStyle(Display *dpy, XrmValue *args, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer data) { unsigned char result = XmFILL_UNSPECIFIED; String str = (String) (from->addr); if( CompareISOLatin1(str, "fill_unspecified") == 0 || CompareISOLatin1(str, "unspecified") == 0 ) { result = XmFILL_UNSPECIFIED; } else if( CompareISOLatin1(str, "fill_flush") == 0 || CompareISOLatin1(str, "flush") == 0 ) { result = XmFILL_FLUSH; } else if( CompareISOLatin1(str, "fill_ragged") == 0 || CompareISOLatin1(str, "ragged") == 0 ) { result = XmFILL_RAGGED; } else { XtDisplayStringConversionWarning(dpy, from->addr, XmRFillStyle); return( False ); } done(unsigned char, result); } /* * Function: * CvtStringToDistribution(dpy, args, arg_cnt, from, to, data) * Description: * This function converts a string representation of the representation * type XmRDistribution to an actual value. * Input: * dpy : Display - unused * args : XrmValue* - unused * arg_cnt : Cardinal - unused * from : XrmValue* - contains the string representation of the value * to : XrmValue* - returns the actual value * data : XtPointer - unused * Output: * Boolean - True if the conversion was successful else False. */ /* ARGSUSED */ static Boolean CvtStringToDistribution(Display *dpy, XrmValue *args, Cardinal *arg_cnt, XrmValue *from, XrmValue *to, XtPointer data) { unsigned char result = XmDISTRIBUTE_TIGHT; String str = (String) (from->addr); if( CompareISOLatin1(str, "distribute_tight") == 0 || CompareISOLatin1(str, "tight") == 0 ) { result = XmDISTRIBUTE_TIGHT; } else if( CompareISOLatin1(str, "distribute_spread") == 0 || CompareISOLatin1(str, "spread") == 0 ) { result = XmDISTRIBUTE_SPREAD; } else { XtDisplayStringConversionWarning(dpy, from->addr, XmRDistribution); return( False ); } done(unsigned char, result); } /* * Function: * VerifyResources(request, current, new_w) * Description: * This function verifies the values for the Column's resource in * "new_w" resetting them to the previous or default values if an * invalid resource value was set. * Input: * request : XmColumnWidget - the requested setting for the widget * current : XmColumnWidget - the current setting for the widget * new_w : XmColumnWidget - the setting for the widget * Output: * None. */ /* ARGSUSED */ static void VerifyResources(XmColumnWidget request, XmColumnWidget current, XmColumnWidget new_w) { Boolean reset; if( BBPart(new_w)->label_font_list == NULL ) { BBPart(new_w)->label_font_list = XmeGetDefaultRenderTable((Widget) new_w, XmLABEL_FONTLIST); } reset = False; #if 0 /* POSITION HANDLING */ switch( XmColumn_default_label_position(new_w) ) { case XiLABEL_POSITION_CENTER: case XiLABEL_POSITION_LEFT: case XiLABEL_POSITION_RIGHT: case XiLABEL_POSITION_TOP: case XiLABEL_POSITION_BOTTOM: break; case XiLABEL_POSITION_UNSPECIFIED: XmeWarning((Widget) new_w), "The illegal resource value \"XiLABEL_POSITION_UNSPECIFIED\" was assigned to the resource XmNDefaultLabelPosition"); reset = True; break; default: XmeWarning((Widget) new_w, "An illegal resource value was assigned to the resource XmNDefaultLabelPosition"); reset = True; break; } if( reset ) { XmColumn_default_label_position(new_w) = (current != NULL ? XmColumn_default_label_position(current) : DEFAULT_POSITION); } #endif reset = False; switch( XmColumn_default_label_alignment(new_w) ) { case XmALIGNMENT_BEGINNING: case XmALIGNMENT_CENTER: case XmALIGNMENT_END: break; case XmALIGNMENT_UNSPECIFIED: XmeWarning((Widget) new_w, "The illegal resource value \"XmALIGNMENT_UNSPECIFIED\" was assigned to the resource XmNdefaultEntryLabelAlignment"); reset = True; break; default: XmeWarning((Widget) new_w, "An illegal resource value was assigned to the resource XmNdefaultEntryLabelAlignment"); reset = True; break; } if( reset ) { XmColumn_default_label_alignment(new_w) = (current != NULL ? XmColumn_default_label_alignment(current) : DEFAULT_ALIGNMENT); } reset = False; switch( XmColumn_orientation(new_w) ) { case XmHORIZONTAL: case XmVERTICAL: break; default: XmeWarning((Widget) new_w, "An illegal resource value was assigned to the resource XmNorientation"); reset = True; break; } if( reset ) { XmColumn_orientation(new_w) = (current != NULL ? XmColumn_orientation(current) : DEFAULT_ORIENTATION); } } /* * Function: * Layout(cw, child, child_size, col_width, col_height) * Description: * This is simply a launcher routine. This routine passes control * to the appropriate layout routine depending on the orientation * of the column. * Input: * cw : XmColumnWidget - the column to layout * child : Widget - A childs whose geometry is specified * child_size : XtWidgetGeometry* - the specified child geometry * col_width : int - a specified width for the column * col_height : int - a specified height for the column * Output: * None. */ static void Layout(XmColumnWidget cw, Widget child, XtWidgetGeometry *child_size, int col_width, int col_height) { if (XmColumn_orientation(cw) == XmHORIZONTAL) { HorizontalLayout(cw, child, child_size, col_width, col_height); } else { VerticalLayout(cw, child, child_size, col_width, col_height); } } /* * Function: * HorizontalLayout(cw, child, child_size, col_witdh, col_height) * Description: * This routine handles the horizontal layout for the column widget * Input: * cw : XmColumnWidget - the column to layout * child : Widget - A childs whose geometry is specified * child_size : XtWidgetGeometry* - the specified child geometry * col_width : int - a specified width for the column * col_height : int - a specified height for the column * Output: * None. */ static void HorizontalLayout(XmColumnWidget cw, Widget child, XtWidgetGeometry *child_size, int col_width, int col_height) { /* Do the Horizontal Layout, Baby! */ WidgetList kids = cw->composite.children, kid; Widget label; Cardinal i, kidCnt = cw->composite.num_children; Position x, y; int cWidth, cBorder, cbWidth, lWidth, valid, space; Dimension fillHeight; int ispace = (int)XmColumn_item_spacing(cw); int kidSpace; if( col_width < 0 ) col_width = XtWidth(cw); if( col_height < 0 ) col_height = XtHeight(cw); fillHeight = col_height - 2 * (cw->manager.shadow_thickness + BBPart(cw)->margin_height); for( i = 0, kid = kids, lWidth = 0, cbWidth = 0, valid = 0, space = 0, kidSpace = 0; i < kidCnt; ++i, ++kid ) { XiC(*kid)->position.x = XiC(*kid)->position.y = 0; if( *kid == child ) { XiC(*kid)->position.width = child_size->width; XiC(*kid)->position.height = child_size->height; } else { XiC(*kid)->position.width = XiC(*kid)->request_width; XiC(*kid)->position.height = XiC(*kid)->request_height; } if( !XiValidChild(*kid) ) continue; valid++; if( *kid == child ) cbWidth += child_size->width + 2*child_size->border_width; else cbWidth += XiC(*kid)->request_width + 2*XtBorderWidth(*kid); if( !XiC(*kid)->show_label ) continue; space += XmColumn_label_spacing(cw); kidSpace++; label = XiC(*kid)->label_widget; if( label == child ) lWidth += child_size->width; else lWidth += XiC(label)->request_width; } x = cw->manager.shadow_thickness + BBPart(cw)->margin_width; if( valid > 0 && (x + lWidth + space + cbWidth + ispace*(valid-1) + x > col_width ) ) { /* * First try to shrink labelSpacing, then itemSpacing, otherwise clip. */ int have = (col_width - 2 * x), want = lWidth + space + ispace*(valid-1) + cbWidth, diff = want - have; if ( space - diff > 1) { space -= diff; } else { if (0 != space) space = kidSpace; want = lWidth + space + ispace*(valid-1) + cbWidth; diff = want - have; if (ispace*(valid-1) - diff > 1) ispace = (ispace*(valid-1)-diff)/(valid-1); else { if (0 != ispace) ispace = 1; } } } if (0==kidSpace) kidSpace = 1; space /= kidSpace; /* * Calculating the widths for the various kids is a one shot, so lets * first walk through the kids and calculate all the width. */ for( kid = kids, i = 0; i < kidCnt; ++i, ++kid ) { int mySpace; if( !XiValidChild(*kid) ) continue; label = XiC(*kid)->label_widget; XiC(label)->position.width = XtWidth(label); if( XiC(*kid)->show_label ) { lWidth = XtWidth(label); mySpace = space; } else { lWidth = 0; mySpace = 0; } if (LayoutIsRtoLM(cw)) XiC(label)->position.x = col_width - x - lWidth; else XiC(label)->position.x = x; /* First, let's calculate the kid's X-position */ if( *kid == child ) cWidth = XiC(*kid)->position.width = child_size->width; else cWidth = XiC(*kid)->position.width = XiC(*kid)->request_width; if (LayoutIsRtoLM(cw)) XiC(*kid)->position.x = col_width - (x + lWidth + space) - cWidth; else XiC(*kid)->position.x = x + lWidth + space; if( child == *kid ) cBorder = child_size->border_width; else cBorder = XtBorderWidth(*kid); x += lWidth + mySpace + cWidth + ispace + 2*cBorder; /* Now, let's calculate the kid's Y-position */ y = cw->manager.shadow_thickness + BBPart(cw)->margin_height; XiC(label)->position.y += y; XiC(*kid)->position.y += y; /* If XmNfillStyle == XmFILL_FLUSH, adjust height to same as column */ if (XiFill(*kid) == XmFILL_FLUSH) { XiC(label)->position.height = fillHeight; XiC(*kid)->position.height = fillHeight; } } if( child == NULL ) { for( i = 0, kid = kids; i < kidCnt; ++i, ++kid ) { if( !XiValidChild(*kid) ) continue; label = XiC(*kid)->label_widget; if( XiC(*kid)->show_label ) { XtConfigureWidget(label, XiC(label)->position.x, XiC(label)->position.y, XiC(label)->position.width, XiC(*kid)->position.height, 0); } XtConfigureWidget(*kid, XiC(*kid)->position.x, XiC(*kid)->position.y, XiC(*kid)->position.width, XiC(*kid)->position.height, XtBorderWidth(*kid)); } } } /* * Function: * VerticalLayout(cw, child, child_size, col_witdh, col_height) * Description: * This routine handles the vertical layout for the column widget * Input: * cw : XmColumnWidget - the column to layout * child : Widget - A childs whose geometry is specified * child_size : XtWidgetGeometry* - the specified child geometry * col_width : int - a specified width for the column * col_height : int - a specified height for the column * Output: * None. */ static void VerticalLayout(XmColumnWidget cw, Widget child, XtWidgetGeometry *child_size, int col_width, int col_height) { WidgetList kids = cw->composite.children, kid; Widget label; Cardinal i, kidCnt = cw->composite.num_children, j; Position x, y; int cWidth, cMaxWidth, cMinWidth, cHeight, cBorder, cbWidth, cbHeight, lWidth, lHeight, cnt, hExtra, hEach =0 , hLeft = 0, valid, space; Dimension width, height; Boolean change, stretch; if( col_width < 0 ) col_width = XtWidth(cw); if( col_height < 0 ) col_height = XtHeight(cw); CalcSize(cw, NULL, NULL, False, &width, &height); for( i = 0, kid = kids, lWidth = 0, cMinWidth = 0, cMaxWidth = 0, cnt = 0, valid = 0, space = 0; i < kidCnt; ++i, ++kid ) { XiC(*kid)->position.x = XiC(*kid)->position.y = 0; if( *kid == child ) { XiC(*kid)->position.width = child_size->width; XiC(*kid)->position.height = child_size->height; } else { XiC(*kid)->position.width = XiC(*kid)->request_width; XiC(*kid)->position.height = XiC(*kid)->request_height; } if( !XiValidChild(*kid) ) continue; valid++; if( *kid == child ) { cbWidth = child_size->width + 2*child_size->border_width; } else { cbWidth = XiC(*kid)->request_width + 2*XtBorderWidth(*kid); } if( cMinWidth == 0 ) { cMinWidth = cbWidth; } else if( cbWidth < cMinWidth ) { cMinWidth = cbWidth; } if( cMaxWidth == 0 ) { cMaxWidth = cbWidth; } else if( cbWidth > cMaxWidth ) { cMaxWidth = cbWidth; } if( XiC(*kid)->stretchable ) ++cnt; if( !XiC(*kid)->show_label ) continue; space = XmColumn_label_spacing(cw); label = XiC(*kid)->label_widget; if( child == label ) { if( (int)child_size->width > lWidth ) { lWidth = child_size->width; } } else { if( (int)XiC(label)->request_width > lWidth ) { lWidth = XiC(label)->request_width; } } } x = cw->manager.shadow_thickness + BBPart(cw)->margin_width; if( valid > 0 && (x + lWidth + space + cMaxWidth + x > col_width ) ) { int have = (col_width - 2 * x), want = lWidth + space + cMaxWidth, diff = want - have; /* Try to subtract from the label space first; if we can't do it (it ** may be 0 right now), ** then the data fields will shrink until they are the size of the ** smallest field, and after that the labels will shrink. ** The shadow and margin aren't affected. */ if ( space - diff > 1) space -= diff; else { if (0 != space) space = 1; want = lWidth + space + cMinWidth; diff = want - have; if (diff > 0) { if( lWidth - diff > 1 ) lWidth -= diff; else lWidth = 1; } } } /* * Calculating the widths for the various kids is a one shot, so lets * first walk through the kids and calculate all the width. */ for( kid = kids, i = 0; i < kidCnt; ++i, ++kid ) { if( !XiValidChild(*kid) ) continue; label = XiC(*kid)->label_widget; cBorder = XtBorderWidth(*kid); if (LayoutIsRtoLM(cw)) XiC(label)->position.x = col_width - x - lWidth; else XiC(label)->position.x = x; XiC(label)->position.width = lWidth; /* cbWidth is whatever is left over */ cbWidth = col_width - ((int)cw->manager.shadow_thickness + (int)BBPart(cw)->margin_width + x + lWidth + space); if( cbWidth < 1 ) cbWidth = 1; cWidth = cbWidth - 2*cBorder; if( cWidth < 1 ) cWidth = 1; /* cWidth is now the value to use for XmFILL_FLUSH */ if( XiFill(*kid) == XmFILL_RAGGED ) { if( child == *kid ) { if( (int) child_size->width < cWidth ) { cWidth = child_size->width; } } else { if( (int) XiC(*kid)->request_width < cWidth ) { cWidth = XiC(*kid)->request_width; } } } if (LayoutIsRtoLM(cw)) XiC(*kid)->position.x = col_width - (x + lWidth + space + cWidth); else XiC(*kid)->position.x = x + lWidth + space; XiC(*kid)->position.width = cWidth; } /* * Now that we have calculated the x position and the width of * each of the children lets now try to calculate the y position * and the height. */ space = XmColumn_item_spacing(cw); hExtra = col_height - height; /* but first make a quick check on reducing the itemSpacing */ if (hExtra < 0) { if (valid) { int totalItemSpacing = (valid - 1) * space; if (totalItemSpacing + hExtra > 0) space = (totalItemSpacing + hExtra)/(valid-1); else space = 1; } hExtra = 0; /* or very close to it */ } for( j = 0; j < 2; ++j ) { do { y = cw->manager.shadow_thickness + BBPart(cw)->margin_height; if( j != 0 ) { cnt = valid; } if( cnt > 0 ) { hEach = hExtra / cnt; hLeft = hExtra % cnt; } else if( cnt == 0 ) { hEach = 0; hLeft = hExtra; } change = False; for( kid = kids, i = 0; i < kidCnt; ++i, ++kid ) { if( !XiValidChild(*kid) ) continue; label = XiC(*kid)->label_widget; cHeight = XiC(*kid)->position.height; if( j == 0 || hExtra > 0 ) { stretch = XiC(*kid)->stretchable; } else { stretch = True; } if( stretch ) { if( hExtra < 0 && cHeight > 1 ) { if( hEach != 0 ) { int tmp = -hEach; change = True; if( tmp < cHeight ) { hExtra += tmp; cHeight -= tmp; } else { tmp = cHeight - 1; hExtra += tmp; cHeight = 1; } } if( hLeft != 0 && cHeight > 1 ) { change = True; hLeft++; hExtra++; cHeight--; } } else if( hExtra > 0 ) { change = True; cHeight += hEach; hExtra -= hEach; if( hLeft > 0 ) { cHeight++; hLeft--; hExtra--; } } } if( cHeight < 1 ) cHeight = 1; if( child == *kid ) { cBorder = child_size->border_width; } else { cBorder = XtBorderWidth(*kid); } if( XiC(*kid)->show_label ) { if( child == label ) { lHeight = child_size->height; } else { lHeight = XiC(label)->request_height; } } else { lHeight = 1; } cbHeight = cHeight + 2 * cBorder; if( cbHeight > lHeight || stretch ) { lHeight = cbHeight; } else { cHeight = lHeight - 2*cBorder; if( cHeight < 1 ) cHeight = 1; cbHeight = cHeight + 2*cBorder; } XiC(label)->position.y = y; XiC(label)->position.height = lHeight; XiC(*kid)->position.y = y; XiC(*kid)->position.height = cHeight; if( child == *kid ) { cBorder = child_size->border_width; } else { cBorder = XtBorderWidth(*kid); } y += XiC(*kid)->position.height + (2 * cBorder) + space; } } while( hExtra != 0 && change ); } /* * If we get here and we still have some extra space we want to see * if the user wants to distribute the space between children or * not. */ if( XmColumn_distribution(cw) == XmDISTRIBUTE_SPREAD && hExtra > 0 ) { if( valid == 1 ) { hEach = hExtra / 2; XiC(*kids)->position.y += hEach; } else { if( valid > 1 ) { valid--; hEach = hExtra / valid; hLeft = hExtra % valid; } else { hEach = 0; hLeft = hExtra; } y = cw->manager.shadow_thickness + BBPart(cw)->margin_height; for( i = 0, kid = kids; i < kidCnt; ++i, ++kid ) { if( !XiValidChild(*kid) ) continue; if( i > 0 ) { XiC(*kid)->position.y = y; XiC(XiC(*kid)->label_widget)->position.y = y; } space = XmColumn_item_spacing(cw) + hEach; if( hLeft > 0 ) { space++; hLeft--; } if( child == *kid ) { cBorder = child_size->border_width; } else { cBorder = XtBorderWidth(*kid); } y += XiC(*kid)->position.height + (2 * cBorder) + space; } } } if( child == NULL ) { for( i = 0, kid = kids; i < kidCnt; ++i, ++kid ) { if( !XiValidChild(*kid) ) continue; label = XiC(*kid)->label_widget; if( XiC(*kid)->show_label ) { XtConfigureWidget(label, XiC(label)->position.x, XiC(label)->position.y, XiC(label)->position.width, XiC(*kid)->position.height, 0); } XtConfigureWidget(*kid, XiC(*kid)->position.x, XiC(*kid)->position.y, XiC(*kid)->position.width, XiC(*kid)->position.height, XtBorderWidth(*kid)); } } } /* * Function: * VerifyConstraint(request, current, set) * Description: * This function verifies the values for the Column child's constraint * resources in "set" resetting them to the previous or default * values if an invalid resource value was set. * Input: * request : Widget - the requested setting for the widget * current : Widget - the current setting for the widget * set : Widget - the setting for the widget * Output: * None. */ /* ARGSUSED */ static void VerifyConstraints(Widget request, Widget current, Widget set) { Boolean reset; #if 0 /* POSITION HANDLING */ reset = False; switch( XiC(set)->label_position ) { case XiLABEL_POSITION_CENTER: case XiLABEL_POSITION_LEFT: case XiLABEL_POSITION_RIGHT: case XiLABEL_POSITION_TOP: case XiLABEL_POSITION_BOTTOM: case XiLABEL_POSITION_UNSPECIFIED: break; default: XmeWarning(set, "An illegal resource value was assigned to the resource XmNentryLabelPosition"); reset = True; break; } if( reset ) { XiC(set)->label_position = (current != NULL ? XiC(current)->label_position : XiLABEL_POSITION_UNSPECIFIED); } #endif reset = False; switch( XiC(set)->label_alignment ) { case XmALIGNMENT_BEGINNING: case XmALIGNMENT_CENTER: case XmALIGNMENT_END: case XmALIGNMENT_UNSPECIFIED: break; default: XmeWarning(set, "An illegal resource value was assigned to the resource XmNentryLabelAlignment"); reset = True; break; } if( reset ) { XiC(set)->label_alignment = (current != NULL ? XiC(current)->label_alignment : XmALIGNMENT_UNSPECIFIED); } reset = False; switch( XiC(set)->fill_style ) { case XmFILL_UNSPECIFIED: case XmFILL_FLUSH: case XmFILL_RAGGED: break; default: XmeWarning(set, "An illegal resource value was assigned to the resource XmNfillStyle"); reset = True; break; } if( reset ) { XiC(set)->fill_style = (current != NULL ? XiC(current)->fill_style : XmFILL_UNSPECIFIED); } } /* * Function: * CalcSize(cw, child, child_size, query, width, height) * Description: * This function calculates and returns the prefered size for the * column. * Input: * cw : XmColumnWidget - the column widget * child : Widget - a widget whose geometry is specified * child_size : XtWidgetGeometry* - the specified child's geometry * query : Boolean - query the kids? * width : Dimension* - return the desired width * height : Dimension* - return the desired height * Output: * None. */ static void CalcSize(XmColumnWidget cw, Widget child, XtWidgetGeometry *child_size, Boolean query, Dimension *width, Dimension *height) { int _width = 0, _height = 0, cnt = 0; Cardinal i, kidCnt = cw->composite.num_children; WidgetList kid, kids = cw->composite.children; Widget label; Dimension cWidth, cHeight, cBorder, cSum = 0, lWidth, lHeight; Dimension lSum = 0, space = 0, hSumSpace = 0; XtWidgetGeometry wants; for (i = 0, kid = kids; i < kidCnt; ++i, ++kid) { if (!XiValidChild(*kid)) continue; if (XiC(*kid)->show_label) { space = XmColumn_label_spacing(cw); hSumSpace += XmColumn_label_spacing(cw); } /* * Check for the child widgets preferred geometry. * if the prefered geometry is greater than the requested * geometry, then set the query geometry to "True". * Doing this, column widget will take care of improper * size settings on the compound children widgets (CR03821) */ query = False; XtQueryGeometry(*kid, NULL, &wants); if (wants.width > XiC(*kid)->request_width || \ wants.height > XiC(*kid)->request_height) { query = True; } if (*kid == child && child_size != NULL) { cWidth = child_size->width; cHeight = child_size->height; cBorder = child_size->border_width; } else if (query) { XtQueryGeometry(*kid, NULL, &wants); if (wants.request_mode & CWWidth) { cWidth = wants.width; XiC(*kid)->request_width = wants.width; } else { cWidth = XiC(*kid)->request_width; } if (wants.request_mode & CWHeight) { cHeight = wants.height; XiC(*kid)->request_height = wants.height; } else { cHeight = XiC(*kid)->request_height; } if (wants.request_mode & CWBorderWidth) { cBorder = wants.border_width; } else { cBorder = XtBorderWidth(*kid); } } else { cWidth = XiC(*kid)->request_width; cHeight = XiC(*kid)->request_height; cBorder = XtBorderWidth(*kid); } cWidth += (2 * cBorder); cHeight += (2 * cBorder); if (XtIsManaged((label = XiC(*kid)->label_widget))) { if (label == child && child_size != NULL) { lWidth = child_size->width; lHeight = child_size->height; } else if (query) { XtQueryGeometry(label, NULL, &wants); if (wants.request_mode & CWWidth) { lWidth = wants.width; } else { lWidth = XiC(label)->request_width; } if (wants.request_mode & CWHeight) { lHeight = wants.height; } else { lHeight = XiC(label)->request_height; } } else { lWidth = XiC(label)->request_width; lHeight = XiC(label)->request_height; } } else { lWidth = lHeight = 0; } if (XmColumn_orientation(cw) == XmVERTICAL) { if (lWidth > lSum) lSum = lWidth; if (cWidth > cSum) cSum = cWidth; _height += (lHeight > cHeight ? lHeight : cHeight); } else /* XmHORIZONTAL Layout */ { /* Choose the maximum height */ if (_height < (int)cHeight) _height = cHeight; if (_height < (int)lHeight) _height = lHeight; _width += lWidth + cWidth; } cnt++; } if (cnt > 1) --cnt; if (XmColumn_orientation(cw) == XmVERTICAL) { _width = lSum + cSum + space + 2 * (cw->manager.shadow_thickness + BBPart(cw)->margin_width); _height += (cnt * XmColumn_item_spacing(cw) + 2 * (cw->manager.shadow_thickness + BBPart(cw)->margin_height)); } else /* XmHORIZONTAL Layout */ { _width += (hSumSpace + 2 * (cw->manager.shadow_thickness + BBPart(cw)->margin_width)) + cnt*XmColumn_item_spacing(cw); _height += 2 * (cw->manager.shadow_thickness + BBPart(cw)->margin_height); } if (_width < 1) _width = 1; if (_height < 1) _height = 1; if (width != NULL) *width = _width; if (height != NULL) *height = _height; } /* * Function: * CompareGeometry(geom1, geom2) * Description: * This function compares to XtWidgetGeometry structure to see if * the are equal. * Input: * geom1 : XtWidgetGeometry* - a geometry spec * geom2 : XtWidgetGeometry* - another geometry spec * Output: * Boolean - True if the geometry structures are equal, else False */ static Boolean CompareGeometry(XtWidgetGeometry *geom1, XtWidgetGeometry *geom2) { Boolean result; result = (geom1 == NULL || geom2 == NULL) || (geom1->request_mode != geom2->request_mode) || (geom1->request_mode & CWX && geom1->x != geom2->x) || (geom1->request_mode & CWY && geom1->y != geom2->y) || (geom1->request_mode & CWWidth && geom1->width != geom2->width) || (geom1->request_mode & CWHeight && geom1->height != geom2->height) || (geom1->request_mode & CWBorderWidth && geom1->border_width != geom2->border_width); return( !result ); } /* * Function: * CompareGeometryToWidget(geom, widget) * Description: * Compares a geometry spec to a widget's actual geometry. * Input: * geom : XtWidgetGeometry* - the geometry * widget : Widget - the widget * Output: * Boolean - True if the widget equals the geom spec, else False. */ static Boolean CompareGeometryToWidget(XtWidgetGeometry *geom, Widget widget) { Boolean result; result = (geom == NULL || widget == NULL) || (geom->request_mode == 0) || (geom->request_mode & CWX && geom->x != XtX(widget)) || (geom->request_mode & CWY && geom->y != XtY(widget)) || (geom->request_mode & CWWidth && geom->width != XtWidth(widget)) || (geom->request_mode & CWHeight && geom->height != XtHeight(widget)) || (geom->request_mode & CWBorderWidth && geom->border_width != XtBorderWidth(widget)); return( !result ); } /* * XmRCallProc routine for checking label_font_list before setting it to NULL * If constrainit's "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetEntryLabelRenderTable(Widget wid, int offs, XrmValue *value) { XmColumnConstraintPart* cc = XiC(wid); /* Check if been here before */ if (cc->check_set_render_table) value->addr = NULL; else { cc->check_set_render_table = True; value->addr = (char*)&(cc->label_font_list); } } /* * XmRCallProc routine for checking label_font_list before setting it to NULL * If column's "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetDefaultEntryLabelRenderTable(Widget wid, int offs, XrmValue *value) { XmBulletinBoardPart* bb = BBPart(wid); XmColumnWidget c = (XmColumnWidget)wid; /* Check if been here before */ if (c->column.check_set_render_table) value->addr = NULL; else { c->column.check_set_render_table = True; value->addr = (char*)&(bb->label_font_list); } } /* * Function: * XmColumnLabelDestroyedCallback(widget, client, cbdata) * Description: * This callback is called when a label that is associated with a field * is destoyed. The purpose of this callback is to inform the column * when this happens to it does not try to do bad things. * Input: * widget : Widget - the widget being destroyed * client : XtPointer - the widget that this label is associated with * cbdata : XtPointer - unused. * Output: * None. */ /* ARGSUSED */ static void XmColumnLabelDestroyedCallback(Widget widget, XtPointer client, XtPointer cbdata) { Widget field = (Widget) client; XiC(field)->label_widget = NULL; } /* ARGSUSED */ static void Get_entryLabelString (Widget widget, int offset, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XiC(widget)->label_string); } /* * Function: * XmCreateColumn(parent, name, arg_list, arg_cnt); * Description: * Creates an unmanaged instance of an XmColumn and returns its * widget id. * Input: * parent : Widget - the parent of the new instance. * name : String - the name of the new instance. * arg_list : ArgList - the arguments to create the instance with. * arg_cnt : Cardinal - the number of arguments in the list * * Output: * Widget - the widget id of the new instance. */ Widget XmCreateColumn(Widget parent, String name, ArgList arg_list, Cardinal arg_cnt) { return( XtCreateWidget(name, xmColumnWidgetClass, parent, arg_list, arg_cnt) ); } Widget XmVaCreateColumn( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmColumnWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedColumn( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmColumnWidgetClass, parent, True, var, count); va_end(var); return w; } motif-2.3.8/lib/Xm/DrawingAP.h0000644000175000017500000000516613145162623012715 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDrawingAreaP_h #define _XmDrawingAreaP_h #include #include #ifdef __cplusplus extern "C" { #endif #define XmRESIZE_SWINDOW 10 /* Constraint part record for DrawingArea widget */ typedef struct _XmDrawingAreaConstraintPart { char unused; } XmDrawingAreaConstraintPart, * XmDrawingAreaConstraint; /* New fields for the DrawingArea widget class record */ typedef struct { XtPointer extension; /* Pointer to extension record */ } XmDrawingAreaClassPart; /* Full class record declaration */ typedef struct _XmDrawingAreaClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmDrawingAreaClassPart drawing_area_class; } XmDrawingAreaClassRec; externalref XmDrawingAreaClassRec xmDrawingAreaClassRec; /* New fields for the DrawingArea widget record */ typedef struct { Dimension margin_width; Dimension margin_height; XtCallbackList resize_callback; XtCallbackList expose_callback; XtCallbackList input_callback; unsigned char resize_policy; #ifndef XM_PART_BC XtCallbackList convert_callback; XtCallbackList destination_callback; #endif } XmDrawingAreaPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmDrawingAreaRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmDrawingAreaPart drawing_area; } XmDrawingAreaRec; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDrawingAreaP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Transfer.c0000644000175000017500000021421012672140200012637 00000000000000/* $TOG: Transfer.c /main/17 1997/07/16 16:31:41 csn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "CutPasteI.h" #include "DragBSI.h" #include "HashI.h" #include "MessagesI.h" #include "ResEncodI.h" #include "TransferI.h" #include "XmI.h" typedef enum { DoXFree, DoFree } FreeType; #define FreeSafeAtomName(val,how) if (1) { if (DoXFree==how) XFree(val); else free(val); } static ConvertContext LookupContextBlock(Display*, Atom); static void ClearContextBlock(Display*, Atom); static void ClipboardCallback(Widget, long*, long*, int*); static void DisownCallback(Widget, XtPointer, XtPointer); static void FreeTransferID(XtPointer); static void CallDoneProcs(Widget, XtPointer, XmTransferDoneCallbackStruct*); static XtPointer GetTransferID(void); static void SelectionCallbackWrapper(Widget, XtPointer, Atom*, Atom*, XtPointer, unsigned long*, int*); static Boolean DragConvertHandler(Widget, Atom *, Atom *, Atom *, XtPointer *, unsigned long *, int *); static void SecondaryConvertHandler(Widget, XtPointer, XmConvertCallbackStruct *); static void ReleaseSecondaryLock(Widget, XtEnum, XmTransferDoneCallbackStruct*); static void DropDestinationHandler(Widget, XtPointer, XmDropProcCallbackStruct *); static TransferBlock AddTransferBlock(TransferContext tc); static void SecondaryDone(Widget, XtPointer, Atom*, Atom*, XtPointer, unsigned long*, int*); static void TransferWarning(Widget w, char* name, char* type, char* message); static void DeleteDropCBStruct(Widget w, XtEnum ignored_status, XmTransferDoneCallbackStruct *cs); static void FinishTransfer(Widget wid, TransferContext tc); static char* GetSafeAtomName(Display *display, Atom a, FreeType *howFree); static void LoseProc(Widget w, Atom *selection); static void ClipboardLoseProc(Widget w, Atom *selection); #define BAD_ATOM_MESSAGE _XmMMsgTransfer_0005 #define BAD_STATUS_MESSAGE _XmMMsgTransfer_0004 #define BAD_SCB_MESSAGE _XmMMsgTransfer_0000 #define BAD_MATCHED_CONVERT _XmMMsgTransfer_0002 #define BAD_STATUS _XmMMsgTransfer_0003 #define ERROR_MULTIPLE_IN_PROGRESS _XmMMsgTransfer_0006 #define ERROR_MULTIPLE_NOT_IN_PROGRESS _XmMMsgTransfer_0007 #define MERGE "XmeConvertMerge" #define ATOM "XGetAtomName" #define MATCH "Format or type mismatch" #define ARG "Argument" #define START_MULTIPLE "XmTransferStartRequest" #define END_MULTIPLE "XmTransferSendRequest" #define XmS_MOTIF_SNAPSHOT "_MOTIF_SNAPSHOT" #define XmSCLIPBOARD_MANAGER "CLIPBOARD_MANAGER" #define BYTELENGTH( length, format ) \ ((format == 8) ? length : \ ((format == 16) ? length * sizeof(short) : \ (length * sizeof(long)))) static int local_convert_flag = 0; static XmHashTable DataIdDictionary = NULL; void _XmConvertHandlerSetLocal(void) { _XmProcessLock(); local_convert_flag = 1; _XmProcessUnlock(); } /************************************************************************/ /* */ /* Convert section. These functions provide an API to setting up */ /* selections, working with the clipboard and starting Drag and Drop. */ /* */ /************************************************************************/ /****************************************************************/ /* ConvertHandler is a generalized version of the convert proc */ /* in Xt. It calls the convertCallbacks and the transferTrait */ /* on the particular widgetclass. */ /****************************************************************/ Boolean _XmConvertHandler(Widget wid, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *size, int *fmt) { enum { XmA_MOTIF_DESTINATION, XmAINSERT_SELECTION, XmALINK_SELECTION, XmA_MOTIF_LOSE_SELECTION, XmA_MOTIF_DROP, XmACLIPBOARD, XmA_MOTIF_CLIPBOARD_TARGETS, XmA_MOTIF_DEFERRED_CLIPBOARD_TARGETS, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DESTINATION, XmSINSERT_SELECTION, XmSLINK_SELECTION, XmS_MOTIF_LOSE_SELECTION, XmS_MOTIF_DROP, XmSCLIPBOARD, XmS_MOTIF_CLIPBOARD_TARGETS, XmS_MOTIF_DEFERRED_CLIPBOARD_TARGETS }; XmTransferTrait ttrait; XmConvertCallbackStruct cbstruct; ConvertContext cc; Atom atoms[XtNumber(atom_names)]; Atom real_selection_atom = None; /* DND hides the selection atom from us */ int my_local_convert_flag; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(wid), atom_names, XtNumber(atom_names), False, atoms); _XmProcessLock(); my_local_convert_flag = local_convert_flag; _XmProcessUnlock(); /* Find the context block */ cc = LookupContextBlock(XtDisplay(wid), *selection); /* Setup the callback structure */ cbstruct.reason = XmCR_OK; cbstruct.event = NULL; cbstruct.selection = *selection; cbstruct.target = *target; cbstruct.source_data = (XtPointer) cc -> drag_context; cbstruct.flags = XmCONVERTING_NONE; cbstruct.location_data = cc -> location_data; cbstruct.status = XmCONVERT_DEFAULT; cbstruct.value = NULL; cbstruct.type = XA_INTEGER; cbstruct.format = 8; cbstruct.length = 0; _XmProcessLock(); /* Get the request event if we can */ if (my_local_convert_flag == 0) { Arg args[1]; Widget req_widget; if (*selection == atoms[XmA_MOTIF_DROP]) { XtSetArg(args[0], XmNiccHandle, &real_selection_atom); XtGetValues(cc -> drag_context, args, 1); cbstruct.event = (XEvent *) XtGetSelectionRequest(cc -> drag_context, real_selection_atom, NULL); req_widget = cc -> drag_context; } else { cbstruct.event = (XEvent *) XtGetSelectionRequest(wid, *selection, NULL); req_widget = wid; } /* Get the parameters from this request. Use the correct selection atom here as well */ { Atom sel_atom = (real_selection_atom != None) ? real_selection_atom : *selection; XtGetSelectionParameters(req_widget, sel_atom, NULL, &cbstruct.parm_type, &cbstruct.parm, &cbstruct.parm_length, &cbstruct.parm_format); } } else { /* We're called locally when XmeClipboardSource is invoked and there is no CLIPBOARD_MANAGER. In this case we must pickup the operation from the context block and put it in the parameter */ if (*selection == atoms[XmACLIPBOARD]) { if (*target == atoms[XmA_MOTIF_CLIPBOARD_TARGETS] || *target == atoms[XmA_MOTIF_DEFERRED_CLIPBOARD_TARGETS]) { cbstruct.parm = (XtPointer) cc -> op; cbstruct.parm_length = 1; cbstruct.parm_format = 32; cbstruct.parm_type = XA_INTEGER; } else { cbstruct.parm = NULL; cbstruct.parm_length = 0; cbstruct.parm_format = 8; cbstruct.parm_type = None; } } } _XmProcessUnlock(); if (cbstruct.event != NULL && ((XSelectionRequestEvent *) cbstruct.event) -> requestor == ((XSelectionRequestEvent *) cbstruct.event) -> owner) { cbstruct.flags |= XmCONVERTING_SAME; } _XmProcessLock(); /* Reset bypass flag */ local_convert_flag = 0; _XmProcessUnlock(); if (*selection != atoms[XmA_MOTIF_DESTINATION] || *target == atoms[XmA_MOTIF_LOSE_SELECTION]) { /* First we call any convert callbacks */ if (XtHasCallbacks(wid, XmNconvertCallback) == XtCallbackHasSome) XtCallCallbacks(wid, XmNconvertCallback, &cbstruct); if (cbstruct.status == XmCONVERT_MORE) { /* Print error message, and revert this flag to XmCONVERT_DEFAULT */ XmeWarning(wid, BAD_STATUS_MESSAGE); cbstruct.status = XmCONVERT_DEFAULT; } /* Now lookup the trait on this widget and call the internal routine */ if (cbstruct.status == XmCONVERT_DEFAULT || cbstruct.status == XmCONVERT_MERGE) { ttrait = (XmTransferTrait) XmeTraitGet((XtPointer) XtClass(wid), XmQTtransfer); if (ttrait != NULL) ttrait -> convertProc(wid, NULL, &cbstruct); } } /* If this is an INSERT_SELECTION or LINK_SELECTION then we call SecondaryConvertHandler to finish the work */ if (cbstruct.status == XmCONVERT_DEFAULT && (*target == atoms[XmAINSERT_SELECTION] || *target == atoms[XmALINK_SELECTION])) SecondaryConvertHandler(wid, NULL, &cbstruct); /* Copy out the flags value for CLIPBOARD to use */ cc -> flags = cbstruct.flags; if (cbstruct.status == XmCONVERT_DONE || cbstruct.status == XmCONVERT_DEFAULT) { /* Copy out the data */ *value = cbstruct.value; *size = cbstruct.length; *fmt = cbstruct.format; *type = cbstruct.type; return True; } else { *value = NULL; *size = 0; *fmt = 8; *type = None; return False; } } /****************************************************************/ /* DragConvertHandler acts as a wrapper to convert handler for */ /* drag and drop. This is because drag and drop passes the */ /* DragContext as the widget to the convert proc in the drag */ /****************************************************************/ static Boolean DragConvertHandler(Widget drag_context, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *size, int *fmt) { ConvertContext cc; Atom MOTIF_DROP = XInternAtom(XtDisplay(drag_context), XmS_MOTIF_DROP, False); /* Find the context block */ cc = LookupContextBlock(XtDisplay(drag_context), MOTIF_DROP); /* Originating widget was stored in client_data */ return(_XmConvertHandler((Widget) cc -> client_data, selection, target, type, value, size, fmt)); } static int secondary_lock = 0; /********************************************************************/ /* SecondaryConvertHandler handles the detail of */ /* Secondary selection. This is because secondary is a synchronous */ /* mechanism which requires a spinlock. */ /********************************************************************/ /*ARGSUSED*/ static void SecondaryConvertHandler(Widget w, XtPointer ignored, /* unused */ XmConvertCallbackStruct *cs) { enum { XmANULL, XmAINSERT_SELECTION, XmALINK_SELECTION, NUM_ATOMS }; static char *atom_names[] = {XmSNULL, XmSINSERT_SELECTION, XmSLINK_SELECTION}; XtAppContext app = XtWidgetToApplicationContext(w); _XmTextInsertPair *pair; XSelectionRequestEvent *req_event; static unsigned long old_serial = 0; Atom atoms[XtNumber(atom_names)]; XtEnum operation; _XmProcessLock(); if (secondary_lock != 0) { cs -> status = XmCONVERT_REFUSE; _XmProcessUnlock(); return; } _XmProcessUnlock(); req_event = XtGetSelectionRequest(w, cs -> selection, NULL); cs -> event = (XEvent *) req_event; _XmProcessLock(); /* Work around for intrinsics selection bug */ if (req_event != NULL && old_serial != req_event->serial) old_serial = req_event->serial; else { cs -> status = XmCONVERT_REFUSE; _XmProcessUnlock(); return; } _XmProcessUnlock(); if (cs -> parm_length == 0) { cs -> status = XmCONVERT_REFUSE; return; } pair = (_XmTextInsertPair *) cs -> parm; _XmProcessLock(); /* Lock */ secondary_lock = 1; _XmProcessUnlock(); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); if (cs -> target == atoms[XmAINSERT_SELECTION]) operation = XmCOPY; else if (cs -> target == atoms[XmALINK_SELECTION]) operation = XmLINK; else operation = XmOTHER; if (_XmDestinationHandler(w, pair -> selection, operation, ReleaseSecondaryLock, (XtPointer) pair -> target, req_event -> time, req_event) != True) { cs -> status = XmCONVERT_REFUSE; return; } /* * Make sure the above selection request is completed * before returning from the convert proc. */ #ifdef XTHREADS while (XtAppGetExitFlag(app) == False) { #else for (;;) { #endif XEvent event; XtInputMask mask; if (secondary_lock == 0) break; #ifndef XTHREADS XtAppNextEvent(app, &event); XtDispatchEvent(&event); #else while (!(mask = XtAppPending(app))) ; /* Busy waiting - so that we don't lose our lock */ if (mask & XtIMXEvent) { /* We have an XEvent */ /* Get the event since we know its there. * Note that XtAppNextEvent would also process * timers/alternate inputs. */ XtAppNextEvent(app, &event); /* no blocking */ XtDispatchEvent(&event); /* Process it */ } else /* not an XEvent, process it */ XtAppProcessEvent(app, mask); /* non blocking */ #endif } cs -> value = NULL; cs -> type = atoms[XmANULL]; cs -> format = 8; cs -> length = 0; cs -> status = XmCONVERT_DONE; } /*ARGSUSED*/ static void ReleaseSecondaryLock(Widget w, /* unused */ XtEnum a, /* unused */ XmTransferDoneCallbackStruct *ts) /* unused */ { _XmProcessLock(); secondary_lock = 0; _XmProcessUnlock(); } /****************************************************************/ /* ClipboardLoseProc allows us to perform the delete operation */ /* for the case where the user is performing a CUT to the */ /* CLIPBOARD, and the CLIPBOARD is owned by a */ /* CLIPBOARD_MANAGER. */ /****************************************************************/ static void ClipboardLoseProc(Widget w, Atom *selection) { Atom DELETE = XInternAtom(XtDisplay(w), XmSDELETE, False); XtPointer value; Atom type; unsigned long size; int fmt; _XmConvertHandlerSetLocal(); _XmConvertHandler(w, selection, &DELETE, &type, &value, &size, &fmt); LoseProc(w, selection); } /****************************************************************/ /* LoseProc is just a thin wrapper routine so */ /* we have a place to do bookkeeping. */ /****************************************************************/ static void LoseProc(Widget w, Atom *selection) { XtPointer value; Atom type; unsigned long size; int fmt; Atom MOTIF_LOSE = XInternAtom(XtDisplay(w), XmS_MOTIF_LOSE_SELECTION, False); _XmConvertHandlerSetLocal(); _XmConvertHandler(w, selection, &MOTIF_LOSE, &type, &value, &size, &fmt); XtFree((char*) value); XtRemoveCallback(w, XmNdestroyCallback, DisownCallback, (XtPointer) *selection); } /********************************************************************/ /* This gets run to disown the selection if the widget is destroyed */ /********************************************************************/ /*ARGSUSED*/ static void DisownCallback(Widget w, XtPointer ignore, /* unused */ XtPointer client_data) { Time time = XtLastTimestampProcessed(XtDisplay(w)); XtDisownSelection(w, (Atom) client_data, time); } /****************************************************************/ /* XmeConvertMerge merges the new data into the old return */ /* value in the callback structure. */ /****************************************************************/ void XmeConvertMerge(XtPointer data, Atom type, int format, unsigned long size, XmConvertCallbackStruct *cs) { _XmProcessLock(); if (cs -> status != XmCONVERT_MERGE) { TransferWarning(NULL, MERGE, ARG, BAD_STATUS); _XmProcessUnlock(); return; } /* Merge the results. Format and type better agree */ if (format == cs -> format && type == cs -> type) { int total_size, offset, user_bytes; /* Calculate all sizes in bytes */ offset = BYTELENGTH(cs -> length, cs -> format); user_bytes = BYTELENGTH(size, format); total_size = offset + user_bytes; /* Reallocate user data */ cs-> value = (XtPointer) XtRealloc((char*) cs -> value, total_size); if (cs -> value == NULL) { _XmProcessUnlock(); return; } /* Copy widget data to cs.value from data */ memcpy(&((char*) cs -> value)[offset], (char*) data, user_bytes); /* Add in the new size */ cs -> length += size; } else /* If not, print an error message */ TransferWarning(NULL, MERGE, MATCH, BAD_MATCHED_CONVERT); _XmProcessUnlock(); } /****************************************************************/ /* XmeTransferAddDoneProc(tid, done_proc) */ /* Adds a new done proc to the end of the current list of done */ /* procs. */ /****************************************************************/ void XmeTransferAddDoneProc(XtPointer id, XmSelectionFinishedProc done_proc) { TransferContext tid = (TransferContext) id; _XmProcessLock(); tid -> numDoneProcs++; if (tid -> numDoneProcs == 1) tid -> doneProcs = (XmSelectionFinishedProc *) XtMalloc(sizeof(XmSelectionFinishedProc*)); else tid -> doneProcs = (XmSelectionFinishedProc *) XtRealloc((char*) tid -> doneProcs, sizeof(XmSelectionFinishedProc*) * tid -> numDoneProcs); tid -> doneProcs[tid -> numDoneProcs - 1] = done_proc; _XmProcessUnlock(); } /****************************************************************/ /* XmePrimarySource(Widget, Time) */ /* Owns the primary selection and sets up the appropriate */ /* conversion handling */ /****************************************************************/ Boolean XmePrimarySource(Widget w, Time time) { return(XmeNamedSource(w, XA_PRIMARY, time)); } /****************************************************************/ /* XmeNamedSource(Widget, Atom, Time) */ /* Owns the named selection and sets up the appropriate */ /* conversion handling */ /****************************************************************/ Boolean XmeNamedSource(Widget w, Atom sel, Time time) { Boolean status; _XmWidgetToAppContext(w); _XmAppLock(app); ClearContextBlock(XtDisplay(w), sel); if (time == 0) time = XtLastTimestampProcessed(XtDisplay(w)); status = XtOwnSelection(w, sel, time, _XmConvertHandler, LoseProc, NULL); if (status) XtAddCallback(w, XmNdestroyCallback, DisownCallback, (XtPointer) sel); _XmAppUnlock(app); return(status); } /****************************************************************/ /* XmeSecondarySource(Widget, Op, Time) */ /* Owns the secondary selection and sets up the appropriate */ /* conversion handling. This is the function to call when */ /* starting the secondary selection. */ /****************************************************************/ Boolean XmeSecondarySource(Widget w, Time time) { return(XmeNamedSource(w, XA_SECONDARY, time)); } /****************************************************************/ /* XmeSecondaryTransfer(Widget, target, op, Time) */ /* Triggers the actual secondary transfer by requesting the */ /* target passed into XmeSecondarySource of the selection */ /* _MOTIF_DESTINATION */ /****************************************************************/ void XmeSecondaryTransfer(Widget w, Atom target, XtEnum op, Time time) { enum { XmA_MOTIF_DESTINATION, XmAINSERT_SELECTION, XmALINK_SELECTION, XmAATOM_PAIR, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DESTINATION, XmSINSERT_SELECTION, XmSLINK_SELECTION, XmIATOM_PAIR }; ConvertContext cc; _XmTextInsertPair pair; Atom transfer_target; Atom atoms[XtNumber(atom_names)]; _XmWidgetToAppContext(w); _XmAppLock(app); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); cc = LookupContextBlock(XtDisplay(w), XA_SECONDARY); cc -> op = op; if (op == XmLINK) transfer_target = atoms[XmALINK_SELECTION]; else transfer_target = atoms[XmAINSERT_SELECTION]; pair.selection = XA_SECONDARY; pair.target = target; XtSetSelectionParameters(w, atoms[XmA_MOTIF_DESTINATION], atoms[XmAATOM_PAIR], (XtPointer) &pair, 2, 32); XtGetSelectionValue(w, atoms[XmA_MOTIF_DESTINATION], transfer_target, SecondaryDone, NULL, time); _XmAppUnlock(app); } /*****************************************************************/ /* SecondaryDone deals with the completion of the */ /* convert selection request started in XmeSecondaryTransfer */ /* This also callback to a widget supplied routine to deal with */ /* issues surrounding the success or failure of the transfer */ /*****************************************************************/ /*ARGSUSED*/ static void SecondaryDone(Widget wid, XtPointer client_data, /* unused */ Atom *selection, /* unused */ Atom *type, XtPointer value, unsigned long *length, int *format) { ConvertContext cc; Boolean success; Atom convert_selection; Atom DELETE = XInternAtom(XtDisplay(wid), XmSDELETE, False); cc = LookupContextBlock(XtDisplay(wid), XA_SECONDARY); if (*type == None && *length == 0 && value == NULL) success = False; else success = True; convert_selection = XA_SECONDARY; /* Call the convertCallback with target DELETE if successful */ if (success && cc -> op == XmMOVE) { _XmConvertHandlerSetLocal(); _XmConvertHandler(wid, &convert_selection, &DELETE, type, (XtPointer*) &value, length, format); XtFree((char*) value); } XtDisownSelection(wid, convert_selection, XtLastTimestampProcessed(XtDisplay(wid))); } /****************************************************************/ /* XmeClipboardSource(Widget, Op, Time) */ /* Puts data onto the clipboard. */ /****************************************************************/ Boolean XmeClipboardSource(Widget w, XtEnum op, Time time) { enum { XmA_MOTIF_DEFERRED_CLIPBOARD_TARGETS, XmA_MOTIF_CLIPBOARD_TARGETS, XmACLIPBOARD, XmACLIPBOARD_MANAGER, XmA_MOTIF_SNAPSHOT, XmADELETE, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DEFERRED_CLIPBOARD_TARGETS, XmS_MOTIF_CLIPBOARD_TARGETS, XmSCLIPBOARD, XmSCLIPBOARD_MANAGER, XmS_MOTIF_SNAPSHOT, XmSDELETE }; ConvertContext cc; Atom type, type2, *targets; XtPointer value; unsigned long size, size2; int format, format2; int i, count, status, transferred = 0; Display *display; long itemid; char *name; FreeType howFree; Atom atoms[XtNumber(atom_names)]; Window clipboard_owner; _XmWidgetToAppContext(w); _XmAppLock(app); display = XtDisplay(w); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms); if (time == 0) time = XtLastTimestampProcessed(display); ClearContextBlock(display, atoms[XmACLIPBOARD]); cc = LookupContextBlock(display, atoms[XmACLIPBOARD]); cc -> op = op; /* If there is a clipboard manager, then just take ownership of the clipboard selection and the manager will do the rest. Otherwise we use the motif clipboard code. */ clipboard_owner = XGetSelectionOwner(display, atoms[XmACLIPBOARD_MANAGER]); if (clipboard_owner != None) { int status; if (op == XmMOVE) { /* We call a special lose proc for move which will call _XmConvertHandler to delete the selection */ status = XtOwnSelection(w, atoms[XmACLIPBOARD], time, _XmConvertHandler, ClipboardLoseProc, NULL); } else { status = XtOwnSelection(w, atoms[XmACLIPBOARD], time, _XmConvertHandler, LoseProc, NULL); } if (status) { XtAddCallback(w, XmNdestroyCallback, DisownCallback, (XtPointer) atoms[XmACLIPBOARD]); } else { _XmAppUnlock(app); return True; } } /* Use Motif clipboard */ status = XmClipboardStartCopy(display, XtWindow(w), NULL, time, w, ClipboardCallback, &itemid); if (status == XmClipboardLocked) { _XmAppUnlock(app); return(False); } /* OK. We've got the clipboard, now setup the targets items */ cc -> itemid = itemid; /* Call the converter to get the targets for the clipboard if _MOTIF_CLIPBOARD_TARGETS doesn't work then try TARGETS target */ _XmConvertHandlerSetLocal(); if (_XmConvertHandler(w, &atoms[XmACLIPBOARD], &atoms[XmA_MOTIF_CLIPBOARD_TARGETS], &type, &value, &size, &format) == True && size != 0 && type == XA_ATOM) { targets = (Atom *) value; count = size; /* For each item we register the format, ask to convert it and if it is converted we put it on the clipboard */ for(i = 0; i < count; i++) { name = GetSafeAtomName(display, targets[i], &howFree); _XmConvertHandlerSetLocal(); if (_XmConvertHandler(w, &atoms[XmACLIPBOARD], &targets[i], &type2, &value, &size2, &format2) == True && ! (cc -> flags & XmCONVERTING_PARTIAL)) { XmClipboardRegisterFormat(display, name, format2); /* format must be 8, 16 or 32. */ size2 = BYTELENGTH(size2, format2); transferred++; /* Critical section for MT */ _XmProcessLock(); _XmClipboardPassType(type2); XmClipboardCopy(display, XtWindow(w), itemid, name, value, size2, 0, 0); _XmProcessUnlock(); /* End Critical section for MT */ } XtFree((char*) value); FreeSafeAtomName(name,howFree); } XtFree((char*) targets); } /* Call the converter to get the deferred targets for the clipboard */ _XmConvertHandlerSetLocal(); if( _XmConvertHandler(w, &atoms[XmACLIPBOARD], &atoms[XmA_MOTIF_DEFERRED_CLIPBOARD_TARGETS], &type, &value, &size, &format) == True && size != 0 && type == XA_ATOM) { _XmProcessLock(); if (DataIdDictionary == NULL) { /* Create dictionary which stores data about particular snapshots and particular dataids. Since it takes an integer as a key, don't need match or hash functions */ DataIdDictionary = _XmAllocHashTable(10, NULL, NULL); } _XmProcessUnlock(); targets = (Atom *) value; count = size; /* If there are deferred targets then the snapshot target must be converted successfully. The value returned by snapshot will be used as a unique id in the clipboard callback to identify this deferred data item */ _XmConvertHandlerSetLocal(); if (_XmConvertHandler(w, &atoms[XmACLIPBOARD], &atoms[XmA_MOTIF_SNAPSHOT], &type2, &value, &size2, &format2) == True) { long data_id; SnapshotRequest req; if (count != 0) { req = (SnapshotRequest) XtMalloc(sizeof(SnapshotRequestRec)); req -> outstanding = 0; req -> distinguisher = * (Atom *) value; } else { req = NULL; } XtFree((char*) value); for(i = 0; i < count; i++) { name = GetSafeAtomName(display, targets[i], &howFree); transferred++; /* Critical section for MT */ _XmProcessLock(); _XmClipboardPassType(type2); XmClipboardCopy(display, XtWindow(w), itemid, name, NULL, 0, targets[i], &data_id); _XmProcessUnlock(); /* End Critical section for MT */ /* Associate the data_id with this snapshot and increment the number of requests outstanding */ _XmProcessLock(); _XmAddHashEntry(DataIdDictionary, (XmHashKey)data_id, (XtPointer)req); _XmProcessUnlock(); req -> outstanding++; FreeSafeAtomName(name,howFree); } } XtFree((char*) targets); } XmClipboardEndCopy(display, XtWindow(w), itemid); if (op == XmMOVE && transferred != 0) { _XmConvertHandlerSetLocal(); _XmConvertHandler(w, &atoms[XmACLIPBOARD], &atoms[XmADELETE], &type, &value, &size, &format); XtFree((char*) value); } if (transferred != 0) { _XmAppUnlock(app); return(True); } else { _XmAppUnlock(app); return(False); } } static void ClipboardCallback(Widget w, long *data_id, long *target, int *reason) { XtPointer value; Atom type; unsigned long size; int format; Display *display; Atom CLIPBOARD = XInternAtom(XtDisplay(w), XmSCLIPBOARD, False); SnapshotRequest req; ConvertContext cc; cc = LookupContextBlock(XtDisplay(w), CLIPBOARD); _XmProcessLock(); req = (SnapshotRequest) _XmGetHashEntry(DataIdDictionary, (XmHashKey) *data_id); /* Decrement count and remove this association */ req -> outstanding--; _XmRemoveHashEntry(DataIdDictionary, (XtPointer)data_id); _XmProcessUnlock(); display = XtDisplay(w); if (*reason != XmCR_CLIPBOARD_DATA_DELETE) { _XmConvertHandlerSetLocal(); if (_XmConvertHandler(w, &req -> distinguisher, (Atom *) target, &type, &value, &size, &format) == True && ! (cc -> flags & XmCONVERTING_PARTIAL)) { char *name; FreeType howFree; size = BYTELENGTH( size, format ); if (format % 8 != 0) size++; name = GetSafeAtomName(display, * (Atom *) target, &howFree); XmClipboardRegisterFormat(display, name, format); FreeSafeAtomName(name,howFree); /* Critical section for MT */ _XmProcessLock(); _XmClipboardPassType(type); XmClipboardCopyByName(display, XtWindow(w), *data_id, value, size, 0L); _XmProcessUnlock(); XtFree((char*) value); } else XmClipboardCopyByName(display, XtWindow(w), *data_id, NULL, 0, 0L); } if (req -> outstanding == 0) { Atom done = XInternAtom(display, XmIDONE, False); /* If this was the last item, call _XmConvertHandler with DELETE on the distinguisher and then free the req */ _XmConvertHandlerSetLocal(); _XmConvertHandler(w, &req -> distinguisher, (Atom *) &done, &type, &value, &size, &format); XtFree((char*) value); XtFree((char*) req); } } /****************************************************************/ /* XmeDragSource */ /* Sets up for drag and drop and calls XmDragStart */ /****************************************************************/ Widget XmeDragSource(Widget w, XtPointer location_data, XEvent *event, ArgList in_args, Cardinal in_arg_count) { enum { XmA_MOTIF_DROP, XmA_MOTIF_EXPORT_TARGETS, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DROP, XmS_MOTIF_EXPORT_TARGETS }; Arg *args; int arg_count; XtPointer targets; unsigned long size; Atom type; int format; Widget dragContext; ConvertContext cc; Atom atoms[XtNumber(atom_names)]; _XmWidgetToAppContext(w); _XmAppLock(app); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); /* merge and copy arg list */ arg_count = in_arg_count + 10; args = (Arg *) XtMalloc(sizeof(Arg) * arg_count); for(arg_count = 0; arg_count < in_arg_count; arg_count++) args[arg_count] = in_args[arg_count]; arg_count = in_arg_count; ClearContextBlock(XtDisplay(w), atoms[XmA_MOTIF_DROP]); cc = LookupContextBlock(XtDisplay(w), atoms[XmA_MOTIF_DROP]); cc -> location_data = location_data; cc -> client_data = (XtPointer) w; XtSetArg(args[arg_count], XmNconvertProc, DragConvertHandler); arg_count++; _XmConvertHandlerSetLocal(); if (_XmConvertHandler(w, &atoms[XmA_MOTIF_DROP], &atoms[XmA_MOTIF_EXPORT_TARGETS], &type, &targets, &size, &format) == True) { XtSetArg(args[arg_count], XmNexportTargets, targets); arg_count++; XtSetArg(args[arg_count], XmNnumExportTargets, size); arg_count++; } else { /* Free copied arguments */ XtFree((char*) args); XtFree((char*) targets); _XmAppUnlock(app); return(NULL); } XtSetArg(args[arg_count], XmNclientData, location_data); arg_count++; dragContext = XmDragStart(w, event, args, arg_count); cc -> drag_context = dragContext; /* Free copied arguments */ XtFree((char*) args); XtFree((char*) targets); _XmAppUnlock(app); return(dragContext); } /****************************************************************/ /* Destination section */ /* */ /****************************************************************/ /* internal flag for transfer block setup */ static int TB_internal = 0; Boolean _XmDestinationHandler(Widget wid, Atom selection, XtEnum op, XmSelectionFinishedProc done_proc, XtPointer location_data, Time time, XSelectionRequestEvent *event) { Window selection_owner; TransferContext tc; XmDestinationCallbackStruct *cbstruct; XmTransferTrait ttrait; Atom MOTIF_DROP = XInternAtom(XtDisplay(wid), XmS_MOTIF_DROP, False); cbstruct = (XmDestinationCallbackStruct *) XtMalloc(sizeof(XmDestinationCallbackStruct)); cbstruct -> reason = XmCR_OK; cbstruct -> event = (XEvent *) event; cbstruct -> selection = selection; cbstruct -> flags = 0; cbstruct -> operation = op; cbstruct -> location_data = location_data; cbstruct -> destination_data = NULL; cbstruct -> time = time; /* Setup transfer */ cbstruct -> transfer_id = (XtPointer) GetTransferID(); tc = (TransferContext) cbstruct -> transfer_id; tc -> widget = wid; tc -> numDoneProcs = 0; tc -> doneProcs = NULL; tc -> auto_proc = (XtCallbackProc) NULL; tc -> status = XmTRANSFER_DONE_DEFAULT; tc -> flags = TC_NONE; tc -> selection = selection; tc -> real_selection = selection; tc -> op = op; tc -> client_data = NULL; tc -> drop_context = (Widget) NULL; tc -> drag_context = (Widget) NULL; tc -> callback_struct = cbstruct; if (done_proc != NULL) XmeTransferAddDoneProc((XtPointer) tc, done_proc); ttrait = (XmTransferTrait) XmeTraitGet((XtPointer) XtClass(wid), XmQTtransfer); if (tc -> selection == MOTIF_DROP) { /* We pass the drop callback struct in through location_data */ XmDropProcCallbackStruct *ds = (XmDropProcCallbackStruct *) location_data; XtPointer malloc_ds; int i; Arg args[1]; malloc_ds = XtMalloc(sizeof(XmDropProcCallbackStruct)); memcpy(malloc_ds, ds, sizeof(XmDropProcCallbackStruct)); location_data = malloc_ds; XmeTransferAddDoneProc((XtPointer) tc, DeleteDropCBStruct); tc -> drag_context = ds -> dragContext; i = 0; XtSetArg(args[i], XmNiccHandle, &tc -> real_selection); i++; XtGetValues(ds->dragContext, args, i); /* If this is a drop, we need to do more to figure out who really owns the selection */ selection_owner = XGetSelectionOwner(XtDisplay(wid), tc -> real_selection); if (XtWindowToWidget(XtDisplay(wid), selection_owner) != (Widget) NULL) { ConvertContext cc; cc = LookupContextBlock(XtDisplay(wid), MOTIF_DROP); /* We go get the origination information if this is in the same client as the originator. We know its the same client if XtWindowToWidget is successful */ if (cc -> client_data == (XtPointer) wid) cbstruct -> flags |= XmCONVERTING_SAME; } /* We pass this callback struct on through destination_data and get new data from the widget trait for location_data */ cbstruct -> destination_data = location_data; cbstruct -> location_data = NULL; } else { /* Not D&D */ /* For regular selections, we can just use this info, otherwise we need to get the real selection atom for D&D */ selection_owner = XGetSelectionOwner(XtDisplay(wid), selection); if (selection_owner == XtWindow(wid)) cbstruct -> flags |= XmCONVERTING_SAME; } /* Call the prehook to allow the widget to setup information. This is currently only envisioned to be useful in D&D */ if (ttrait != NULL && ttrait -> destinationPreHookProc != NULL) ttrait -> destinationPreHookProc(wid, NULL, cbstruct); /* First we call any destination callbacks */ if (XtHasCallbacks(wid, XmNdestinationCallback) == XtCallbackHasSome) XtCallCallbacks(wid, XmNdestinationCallback, cbstruct); tc -> flags |= TC_CALLED_CALLBACKS; /* Now lookup the trait on this widget and call the internal routine if there were no transfers via the destination callbacks (or no destination callbacks) or there were transfers and the user set the status to DEFAULT and has finished (if it hasn't finished we'll handle this in SelectionCallbackWrapper) */ if (ttrait != NULL && tc -> status == XmTRANSFER_DONE_DEFAULT && ((tc -> count == 0) || (tc -> outstanding == 0 && ! (TC_CALLED_WIDGET)))) { _XmProcessLock(); TB_internal = 1; _XmProcessUnlock(); tc -> flags |= TC_CALLED_WIDGET; if (ttrait -> destinationProc != 0) ttrait -> destinationProc(wid, NULL, cbstruct); _XmProcessLock(); TB_internal = 0; _XmProcessUnlock(); } if (tc -> count == 0 && tc -> selection == MOTIF_DROP) { XmDropProcCallbackStruct *ds = (XmDropProcCallbackStruct *) location_data; if (ds -> dropAction == XmDROP_HELP) { /* If a drop help occured, then we do not want to cleanup yet, despite there being no transfers. Right at this moment, the user is deciding whether to accept or cancel the drop based on the presented dialog. */ tc -> flags |= TC_EXITED_DH; /* Indicate safe to free record */ /* Exit immediately to avoid freeing the transfer block below */ return(True); } else { /* If no transfers occurred, and this is a drop, then it failed */ Arg args[2]; XtSetArg(args[0], XmNtransferStatus, XmTRANSFER_FAILURE); XtSetArg(args[1], XmNnumDropTransfers, 0); XmDropTransferStart(tc -> drag_context, args, 2); } } /* If we either have performed no transfers or we are finished with the transfers, go finish the work */ if (tc -> count == 0 || tc -> outstanding == 0) { FinishTransfer(wid, tc); return(True); } else { /* Otherwise set the flag so SelectionCallbackWrapper can finish the work */ tc -> flags |= TC_EXITED_DH; /* Indicate safe to free record */ return(True); } } static void FinishTransfer(Widget wid, TransferContext tc) { XmTransferDoneCallbackStruct ts; tc -> flags |= TC_FLUSHED; /* Ignore any future requests */ ts.reason = XmCR_OK; ts.event = (XEvent *) NULL; ts.selection = tc -> selection; ts.transfer_id = (XtPointer) tc; if (tc -> status == XmTRANSFER_DONE_FAIL) ts.status = XmTRANSFER_DONE_FAIL; else ts.status = XmTRANSFER_DONE_SUCCEED; /* Override if no transfers have occurred */ if (tc -> count == 0) ts.status = XmTRANSFER_DONE_FAIL; ts.client_data = tc -> client_data; CallDoneProcs(wid, tc, &ts); XtFree((char*) tc -> callback_struct); FreeTransferID(tc); } /****************************************************************/ /* DropDestinationHandler acts as a wrapper to the destination */ /* handler for drag and drop. This is because drag and drop */ /* passes the DragContext as the widget to the destination proc */ /* in the drop */ /****************************************************************/ /*ARGSUSED*/ static void DeleteDropCBStruct(Widget w, /* unused */ XtEnum ignored_status, /* unused */ XmTransferDoneCallbackStruct *cs) { TransferContext tc = (TransferContext) cs -> transfer_id; /* The malloc'd structure is in the destination_data member */ XtFree((char*) tc -> callback_struct -> destination_data); } /*ARGSUSED*/ static void DropDestinationHandler(Widget w, XtPointer client_data, /* unused */ XmDropProcCallbackStruct *ds) { Atom MOTIF_DROP = XInternAtom(XtDisplay(w), XmS_MOTIF_DROP, False); XtEnum op; if (ds -> dropAction == XmDROP_HELP || ds -> operation == XmDROP_NOOP) op = XmOTHER; else op = ds -> operation; (void) _XmDestinationHandler(w, MOTIF_DROP, op, NULL, (XtPointer) ds, ds -> timeStamp, NULL); } /*************************************************************/ /* XmePrimarySink begins a transfer for the contents of the */ /* XA_PRIMARY selection. */ /*************************************************************/ Boolean XmePrimarySink(Widget w, XtEnum op, XtPointer location_data, Time time) { Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = _XmDestinationHandler(w, XA_PRIMARY, op, NULL, location_data, time, NULL); _XmAppUnlock(app); return ret_val; } /*************************************************************/ /* XmeNamedSink begins a transfer for the contents of the */ /* named selection. */ /*************************************************************/ Boolean XmeNamedSink(Widget w, Atom sel, XtEnum op, XtPointer location_data, Time time) { Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = _XmDestinationHandler(w, sel, op, NULL, location_data, time, NULL); _XmAppUnlock(app); return ret_val; } /*************************************************************/ /* XmeSecondarySink takes ownership of the MOTIF_DESTINATION */ /* selection. */ /*************************************************************/ Boolean XmeSecondarySink(Widget w, Time time) { Boolean status; Atom MOTIF_DESTINATION = XInternAtom(XtDisplay(w), XmS_MOTIF_DESTINATION, False); _XmWidgetToAppContext(w); _XmAppLock(app); ClearContextBlock(XtDisplay(w), MOTIF_DESTINATION); if (time == 0) time = XtLastTimestampProcessed(XtDisplay(w)); /* Setup our end of the secondary selection */ status = XtOwnSelection(w, MOTIF_DESTINATION, time, _XmConvertHandler, LoseProc, NULL); if (status) XtAddCallback(w, XmNdestroyCallback, DisownCallback, (XtPointer) MOTIF_DESTINATION); _XmAppUnlock(app); return(status); } /**************************************************************/ /* XmeClipboardSink begins a transfer for the contents of the */ /* CLIPBOARD selection. */ /**************************************************************/ Boolean XmeClipboardSink(Widget w, XtEnum op, XtPointer location_data) { Atom CLIPBOARD = XInternAtom(XtDisplay(w), XmSCLIPBOARD, False); Boolean ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = _XmDestinationHandler(w, CLIPBOARD, op, NULL, location_data, 0, NULL); _XmAppUnlock(app); return ret_val; } /*************************************************************/ /* XmeDropSink creates a drop site that will use the */ /* destinationCallbacks to handle drops. */ /*************************************************************/ void XmeDropSink(Widget w, ArgList in_args, Cardinal in_arg_count) { Arg *args; int arg_count; _XmWidgetToAppContext(w); _XmAppLock(app); /* merge and copy arg list */ arg_count = in_arg_count + 2; args = (Arg *) XtMalloc(sizeof(Arg) * arg_count); for(arg_count = 0; arg_count < in_arg_count; arg_count++) args[arg_count] = in_args[arg_count]; arg_count = in_arg_count; XtSetArg(args[arg_count], XmNdropProc, DropDestinationHandler); arg_count++; XmDropSiteRegister(w, args, arg_count); XtFree((char*) args); _XmAppUnlock(app); } /*************************************************************/ /* Transfer routine section */ /*************************************************************/ /************************************************************************/ /* XmTransferDone allows the user to control the transfer queue */ /* If the user calls XmTransferDone with a status of DEFAULT then */ /* all remaining non-internal transfers are ignored and the widget's */ /* internal transfers are done. SUCCEED, FAIL or CONTINUE cause the */ /* entire queue to be flushed, and the appropriate status to be set. */ /************************************************************************/ void XmTransferDone(XtPointer transfer_id, XmTransferStatus status) { TransferContext tc = (TransferContext) transfer_id; Atom MOTIF_DROP = XInternAtom(XtDisplay(tc -> widget), XmS_MOTIF_DROP, False); _XmWidgetToAppContext(tc->widget); _XmAppLock(app); tc -> status = status; /* Make sure MULTIPLE request is unblocked */ if (tc -> flags & TC_IN_MULTIPLE) { tc -> flags &= ~ TC_IN_MULTIPLE; XtSendSelectionRequest(tc -> widget, tc -> selection, XtLastTimestampProcessed(XtDisplay(tc -> widget))); } if (status == XmTRANSFER_DONE_SUCCEED || status == XmTRANSFER_DONE_FAIL || status == XmTRANSFER_DONE_CONTINUE) { tc -> flags |= TC_FLUSHED; if (status == XmTRANSFER_DONE_FAIL && tc -> selection == MOTIF_DROP) { Arg args[2]; XtSetArg(args[0], XmNtransferStatus, XmTRANSFER_FAILURE); XtSetArg(args[1], XmNnumDropTransfers, 0); if (tc -> drop_context != (Widget) NULL) XtSetValues(tc -> drop_context, args, 2); else XmDropTransferStart(tc -> drag_context, args, 2); /* Also, if there are no transfers, and we have exited _XmDestinationHandler, we must cleanup the transfer infomation here as SelectionCallbackWrapper, where the data is normally freed, won't be called */ if (tc -> count == 0 && tc -> flags & TC_EXITED_DH ) { FinishTransfer(tc -> widget, tc); } } } else if (status == XmTRANSFER_DONE_DEFAULT) { TransferBlock tb; /* If we are going to default then we'll skip all requests placed by callbacks */ for(tb = tc -> requests; tb != NULL; tb = (TransferBlock) tb -> next) { if (!(tb -> flags & TB_INTERNAL)) tb -> flags = tb -> flags | TB_IGNORE; } } _XmAppUnlock(app); } /************************************************************************/ /* XmTransferSetParameters defines a set of parameters to be passed */ /* with the next call to XmTransferValue. */ /************************************************************************/ void XmTransferSetParameters(XtPointer transfer_id, XtPointer parm, int parm_fmt, unsigned long parm_length, Atom parm_type) { TransferContext tc = (TransferContext) transfer_id; _XmWidgetToAppContext(tc->widget); _XmAppLock(app); /******************************************************/ /* Return if we already finished this transfer set */ /* The problem is that if the flags are set then we */ /* are about to delete the transferContext in */ /* SelectionCallbackWrapper() */ /******************************************************/ if (tc -> flags & TC_FLUSHED) { _XmAppUnlock(app); return; } if (parm_fmt == 0) parm_fmt = 8; if (parm != NULL) XtSetSelectionParameters(tc -> widget, tc -> real_selection, parm_type, parm, parm_length, parm_fmt); _XmAppUnlock(app); } /************************************************************************/ /* XmTransferValue allows the user to get data from the owner of the */ /* selection for which we started the destination callback. */ /* This takes care of the small details for getting the data from */ /* either the selection mechanism (user, PRIMARY, SECONDARY, or */ /* CLIPBOARD) or from another mechanism (Drag and Drop). */ /************************************************************************/ void XmTransferValue(XtPointer transfer_id, Atom target, XtCallbackProc proc, XtPointer client_data, Time time) { enum { XmACLIPBOARD, XmA_MOTIF_DROP, NUM_ATOMS }; static char *atom_names[] = { XmSCLIPBOARD, XmS_MOTIF_DROP }; TransferContext tc = (TransferContext) transfer_id; TransferBlock tb; unsigned long length; Atom atoms[XtNumber(atom_names)]; _XmWidgetToAppContext(tc->widget); _XmAppLock(app); /******************************************************/ /* Return if we already finished this transfer set */ /* The problem is that if the flags are set then we */ /* are about to delete the transferContext in */ /* SelectionCallbackWrapper() */ /******************************************************/ if (tc -> flags & TC_FLUSHED) { _XmAppUnlock(app); return; } assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(tc -> widget), atom_names, XtNumber(atom_names), False, atoms); if (time == 0) time = XtLastTimestampProcessed(XtDisplay(tc -> widget)); tb = AddTransferBlock(tc); tb -> client_data = client_data; tb -> selection_proc = proc; tb -> target = target; tb -> location_data = NULL; tc -> outstanding++; tc -> count++; if (tc -> selection == atoms[XmACLIPBOARD]) { /* Assure the clipboard is owned to prevent orphan data problems in the data transfer */ XmClipboardInquireLength(XtDisplay(tc -> widget), XtWindow(tc -> widget), XmSTARGETS, &length); } if (tc -> selection != atoms[XmA_MOTIF_DROP]) { XtGetSelectionValue(tc -> widget, tc -> real_selection, target, SelectionCallbackWrapper, (XtPointer)tc, time); } else { XmDropTransferEntryRec transfers[1]; transfers[0].client_data = (XtPointer) tc; transfers[0].target = tb -> target; if (tc -> drop_context == NULL) { Arg args[5]; XtSetArg(args[0], XmNdropTransfers, transfers); XtSetArg(args[1], XmNnumDropTransfers, 1); XtSetArg(args[2], XmNtransferProc, SelectionCallbackWrapper); tc -> drop_context = (Widget) XmDropTransferStart(tc -> drag_context, args, 3); } else XmDropTransferAdd(tc -> drop_context, transfers, 1); } _XmAppUnlock(app); } /************************************************************************/ /* XmTransferStartRequest and XmTransferSendRequest bracket a MULTIPLE */ /* request. In between the user calls XmTransferSetParameters and */ /* XmTransferValue to arrange requests. */ /************************************************************************/ void XmTransferStartRequest(XtPointer transfer_id) { TransferContext tc = (TransferContext) transfer_id; _XmWidgetToAppContext(tc->widget); _XmAppLock(app); /******************************************************/ /* Return if we already finished this transfer set */ /* The problem is that if the flags are set then we */ /* are about to delete the transferContext in */ /* SelectionCallbackWrapper() */ /******************************************************/ if (tc -> flags & TC_FLUSHED) { _XmAppUnlock(app); return; } if (tc -> flags & TC_IN_MULTIPLE) { char *sel; FreeType howFree; sel = GetSafeAtomName(XtDisplay(tc -> widget), tc -> selection, &howFree); /* Already doing a multiple */ TransferWarning(tc->widget, START_MULTIPLE, sel, ERROR_MULTIPLE_IN_PROGRESS); FreeSafeAtomName(sel,howFree); _XmAppUnlock(app); return; } tc -> flags |= TC_IN_MULTIPLE; XtCreateSelectionRequest(tc -> widget, tc -> real_selection); _XmAppUnlock(app); } void XmTransferSendRequest(XtPointer transfer_id, Time time) { TransferContext tc = (TransferContext) transfer_id; _XmWidgetToAppContext(tc->widget); _XmAppLock(app); /******************************************************/ /* Return if we already finished this transfer set */ /* The problem is that if the flags are set then we */ /* are about to delete the transferContext in */ /* SelectionCallbackWrapper() */ /******************************************************/ if (tc -> flags & TC_FLUSHED) { /* Assume that cleanup would be appropriate here */ XtCancelSelectionRequest(tc -> widget, tc -> real_selection); _XmAppUnlock(app); return; } if (! (tc -> flags & TC_IN_MULTIPLE)) { char *sel; FreeType howFree; sel = GetSafeAtomName(XtDisplay(tc -> widget), tc -> selection, &howFree); /* Not doing a multiple */ TransferWarning(tc->widget, END_MULTIPLE, sel, ERROR_MULTIPLE_NOT_IN_PROGRESS); FreeSafeAtomName(sel, howFree); _XmAppUnlock(app); return; } tc -> flags &= ~ TC_IN_MULTIPLE; if (time == 0) time = XtLastTimestampProcessed(XtDisplay(tc -> widget)); XtSendSelectionRequest(tc -> widget, tc -> real_selection, time); _XmAppUnlock(app); } /************************************************************************/ /* SelectionCallbackWrapper does the bookeeping for the transfer */ /* routines and makes sure that the TransferContext is deleted when */ /* there are no more outstanding transfers. */ /************************************************************************/ static void SelectionCallbackWrapper(Widget wid, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format) { enum { XmA_MOTIF_DROP, XmADELETE, NUM_ATOMS }; static char *atom_names[] = { XmS_MOTIF_DROP, XmSDELETE }; XmSelectionCallbackStruct cbstruct; TransferContext tc = (TransferContext) client_data; TransferBlock tb = tc -> requests; Atom atoms[XtNumber(atom_names)]; assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(wid), atom_names, XtNumber(atom_names), False, atoms); /* Get the real widget if this is a drop transfer */ if (tc -> selection == atoms[XmA_MOTIF_DROP]) wid = tc -> widget; if (tc -> outstanding == 0) { XmeWarning(wid, BAD_SCB_MESSAGE); return; } if (tb != NULL) { /* Unchain this transfer block */ tc -> requests = (TransferBlock) tb -> next; /* If this is the last block then reset last */ if (tc -> last == tb) tc -> last = NULL; } if (! (tc -> flags & TC_FLUSHED)) { if (tb != NULL && ! (tb -> flags & TB_IGNORE)) { cbstruct.reason = XmCR_OK; cbstruct.event = (XEvent *) NULL; cbstruct.selection = *selection; cbstruct.target = tb -> target; cbstruct.transfer_id = (XtPointer) tc; cbstruct.flags = XmSELECTION_DEFAULT; cbstruct.remaining = tc -> outstanding; cbstruct.type = *type; cbstruct.value = value; cbstruct.length = *length; cbstruct.format = *format; if (tb -> selection_proc != NULL) tb -> selection_proc(wid, tb -> client_data, &cbstruct); } } /* Free this transfer block */ if (tb != NULL) { XtFree((char*) tb); } /* Ignore callbacks after we're done */ tc -> outstanding--; /* When outstanding is 0, check to see if the status is XmTRANSFER_DONE_DEFAULT. This indicates that we should attempt calling the widget's destination proc. We'll set a flag in tc to indicate that we've done this, so we don't repeat the action */ if (tc -> outstanding == 0 && tc -> status == XmTRANSFER_DONE_DEFAULT && tc -> flags & TC_CALLED_CALLBACKS && !(tc -> flags & TC_CALLED_WIDGET)) { XmTransferTrait ttrait; tc -> flags |= TC_CALLED_WIDGET; ttrait = (XmTransferTrait) XmeTraitGet((XtPointer) XtClass(wid), XmQTtransfer); /* Now lookup the trait on this widget and call the internal routine. */ if (ttrait != NULL) { _XmProcessLock(); TB_internal = 1; _XmProcessUnlock(); if (ttrait -> destinationProc != 0) ttrait -> destinationProc(wid, NULL, tc -> callback_struct); _XmProcessLock(); TB_internal = 0; _XmProcessUnlock(); } } /* Send a delete if this is a move operation and we've complete successfully for PRIMARY transfer */ if (tc -> selection == XA_PRIMARY && tc -> outstanding == 0 && tc -> count != 0 && (tc -> status == XmTRANSFER_DONE_SUCCEED || tc -> status == XmTRANSFER_DONE_DEFAULT) && tc -> op == XmMOVE && ! (tc -> flags & TC_DID_DELETE)) { tc -> flags |= TC_DID_DELETE; XmTransferValue((XtPointer) tc, atoms[XmADELETE], NULL, NULL, XtLastTimestampProcessed(XtDisplay(wid))); } /* When outstanding reaches 0, free context block. But don't do this in the local case. There we can free in the caller, so check the TC_EXITED_DH flag to see if we've exited _XmDestinationHandler yet. */ if (tc -> outstanding == 0 && tc -> flags & TC_EXITED_DH ) { FinishTransfer(wid, tc); } } /**********************************************************/ /* Context block handlers for convert and transfer blocks */ /**********************************************************/ typedef struct __XmCCKey { Display *display; Atom selection; } _XmCCKeyRec, *_XmCCKey; static Boolean CCMatch(XtPointer x, XtPointer y) { _XmCCKey a, b; a = (_XmCCKey) x; b = (_XmCCKey) y; return(a -> display == b -> display && a -> selection == b -> selection); } static XmHashValue CCHash(XtPointer x) { _XmCCKey a; a = (_XmCCKey) x; return((XmHashValue) ((long) a -> display + (long) a -> selection)); } static XmHashTable ConvertHashTable = (XmHashTable) NULL; static ConvertContext LookupContextBlock(Display *d, Atom a) { ConvertContext cc; _XmCCKeyRec x; x.display = d; x.selection = a; _XmProcessLock(); if (ConvertHashTable == (XmHashTable) NULL) ConvertHashTable = _XmAllocHashTable(10, CCMatch, CCHash); cc = (ConvertContext) _XmGetHashEntry(ConvertHashTable, (XmHashKey) &x); _XmProcessUnlock(); if (cc == NULL) { _XmCCKey new_k; new_k = (_XmCCKey) XtMalloc(sizeof(_XmCCKeyRec)); new_k -> display = d; new_k -> selection = a; /* Allocate a context block for this selection */ cc = (ConvertContext) XtMalloc(sizeof(ConvertContextRec)); _XmProcessLock(); _XmAddHashEntry(ConvertHashTable, (XmHashKey)new_k, (XtPointer)cc); _XmProcessUnlock(); } return(cc); } static void ClearContextBlock(Display *d, Atom a) { ConvertContext cc; cc = LookupContextBlock(d, a); cc -> flags = 0; cc -> op = 0; cc -> itemid = 0; cc -> location_data = NULL; cc -> client_data = NULL; cc -> drag_context = (Widget) NULL; } /* Functions to get and free transfer ids */ static TransferContext global_tc = NULL; static TransferContext free_tc = NULL; static XtPointer GetTransferID(void) { TransferContext rval; /* If there is one on the free list, unchain it and return it */ _XmProcessLock(); if (free_tc != NULL) { rval = free_tc; free_tc = (TransferContext) rval -> next; } else rval = (TransferContext) XtMalloc(sizeof(TransferContextRec)); /* Put it on the chain */ rval -> next = (XtPointer) global_tc; rval -> prev = NULL; if (global_tc != NULL) global_tc -> prev = (XtPointer) rval; global_tc = rval; _XmProcessUnlock(); /* Initialize */ rval -> outstanding = 0; rval -> count = 0; rval -> flags = TC_NONE; rval -> requests = NULL; rval -> last = NULL; return((XtPointer) rval); } static void FreeTransferID(XtPointer id) { TransferContext tid = (TransferContext) id; TransferContext pid, nid; /* Free done_proc list */ if (tid -> doneProcs != NULL) XtFree((char*) tid -> doneProcs); /* first unchain from global_tc */ if (global_tc == tid) { _XmProcessLock(); global_tc = (TransferContext) tid -> next; if (global_tc != NULL) global_tc -> prev = NULL; _XmProcessUnlock(); } else { /* Get previous and next */ pid = (TransferContext) tid -> prev; nid = (TransferContext) tid -> next; /* Connect prev and next */ if (pid != NULL) pid -> next = (XtPointer) nid; if (nid != NULL) nid -> prev = (XtPointer) pid; } _XmProcessLock(); /* Put on free list */ tid -> next = (XtPointer) free_tc; free_tc = tid; _XmProcessUnlock(); } static void CallDoneProcs(Widget wid, XtPointer id, XmTransferDoneCallbackStruct *ts) { int i; TransferContext tid = (TransferContext) id; for(i = 0; i < tid -> numDoneProcs; i++) { (tid -> doneProcs[i])(wid, tid -> op, ts); } } static TransferBlock AddTransferBlock(TransferContext tc) { TransferBlock tb; tb = (TransferBlock) XtMalloc(sizeof(TransferBlockRec)); tb -> next = NULL; /* we append blocks to the end of the list */ if (tc -> requests == NULL) { tc -> requests = tb; tc -> last = tb; } else { (tc -> last) -> next = (XtPointer) tb; tc -> last = tb; } _XmProcessLock(); if (TB_internal) tb -> flags = TB_INTERNAL; else tb -> flags = TB_NONE; _XmProcessUnlock(); return(tb); } /* Warning routine */ static void TransferWarning(Widget w, char* name, char* type, char* message) { XmeWarning(w, message); } /****************************************************************/ /* Standard target support */ /* */ /* This support makes it easy for all widgets to support a set */ /* of targets which can be automatically converted to. */ /* */ /****************************************************************/ /* * XmeStandardTargets takes a widget, and a count of the widget's * private target list, and returns a list of standard targets. * The count of standard targets is returned in the passed in * integer */ #define MAXBUILTIN 12 Atom* XmeStandardTargets(Widget w, int count, int *tcount) { enum { XmATARGETS, XmATIMESTAMP, XmAFOREGROUND, XmABACKGROUND, XmACLASS, XmANAME, XmACLIENT_WINDOW, XmA_MOTIF_RENDER_TABLE, XmA_MOTIF_ENCODING_REGISTRY, NUM_ATOMS }; static char *atom_names[] = { XmSTARGETS, XmSTIMESTAMP, XmIFOREGROUND, XmIBACKGROUND, XmICLASS, XmINAME, XmSCLIENT_WINDOW, XmS_MOTIF_RENDER_TABLE, XmS_MOTIF_ENCODING_REGISTRY }; int i = 0; Atom atoms[XtNumber(atom_names)]; Atom *targets; _XmWidgetToAppContext(w); _XmAppLock(app); targets = (Atom *) XtMalloc(sizeof(Atom) * MAXBUILTIN); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); targets[i] = atoms[XmATARGETS]; i++; targets[i] = atoms[XmATIMESTAMP]; i++; targets[i] = atoms[XmAFOREGROUND]; i++; targets[i] = atoms[XmABACKGROUND]; i++; targets[i] = XA_COLORMAP; i++; targets[i] = atoms[XmACLASS]; i++; targets[i] = atoms[XmANAME]; i++; targets[i] = atoms[XmACLIENT_WINDOW]; i++; targets[i] = atoms[XmA_MOTIF_RENDER_TABLE]; i++; targets[i] = atoms[XmA_MOTIF_ENCODING_REGISTRY]; i++; /* Realloc the full size now */ targets = (Atom *) XtRealloc((char*) targets, sizeof(Atom) * (count + i)); *tcount = i; /* Return the builtin target count */ _XmAppUnlock(app); return(targets); } /* * XmeStandardConvert is called when receiving an unknown * target. It should be called last in most convert procs. */ /*ARGSUSED*/ void XmeStandardConvert(Widget w, XtPointer ignore, /* unused */ XmConvertCallbackStruct *cs) { enum { XmATARGETS, XmAFOREGROUND, XmAPIXEL, XmABACKGROUND, XmACLASS, XmANAME, XmACLIENT_WINDOW, XmA_MOTIF_RENDER_TABLE, XmA_MOTIF_ENCODING_REGISTRY, NUM_ATOMS }; static char *atom_names[] = { XmSTARGETS, XmIFOREGROUND, XmIPIXEL, XmIBACKGROUND, XmICLASS, XmINAME, XmSCLIENT_WINDOW, XmS_MOTIF_RENDER_TABLE, XmS_MOTIF_ENCODING_REGISTRY }; Arg arg[1]; Atom atoms[XtNumber(atom_names)]; _XmWidgetToAppContext(w); _XmAppLock(app); assert(XtNumber(atom_names) == NUM_ATOMS); XInternAtoms(XtDisplay(w), atom_names, XtNumber(atom_names), False, atoms); if (atoms[XmATARGETS] == cs -> target) { int tcount; cs -> value = (XtPointer) XmeStandardTargets(w, 0, &tcount); cs -> format = 32; cs -> length = tcount; cs -> type = XA_ATOM; } else if (atoms[XmAFOREGROUND] == cs -> target) { Pixel *fg; if (XmIsGadget(w)) w = XtParent(w); fg = (Pixel *) XtMalloc(sizeof(Pixel)); XtSetArg(arg[0], XtNforeground, fg); XtGetValues(w, arg, 1); cs -> value = (XtPointer) fg; cs -> format = 32; cs -> length = 1; cs -> type = atoms[XmAPIXEL]; } else if (atoms[XmABACKGROUND] == cs -> target) { Pixel *bg; if (XmIsGadget(w)) w = XtParent(w); bg = (Pixel *) XtMalloc(sizeof(Pixel)); XtSetArg(arg[0], XtNbackground, bg); XtGetValues(w, arg, 1); cs -> value = (XtPointer) bg; cs -> format = 32; cs -> length = 1; cs -> type = atoms[XmAPIXEL]; } else if (XA_COLORMAP == cs -> target) { Colormap *cmap; if (XmIsGadget(w)) w = XtParent(w); cmap = (Colormap *) XtMalloc(sizeof(Colormap)); XtSetArg(arg[0], XtNcolormap, cmap); XtGetValues(w, arg, 1); cs -> value = (XtPointer) cmap; cs -> format = 32; cs -> length = 1; cs -> type = XA_COLORMAP; } else if (atoms[XmACLASS] == cs -> target) { Widget current; unsigned long bytesAfter; cs -> value = NULL; cs -> format = 32; cs -> length = 0; cs -> type = XA_INTEGER; for(current = w; current != (Widget) NULL; current = XtParent(current)) { if (XtIsShell(current)) { XGetWindowProperty(XtDisplay(current), XtWindow(current), XA_WM_CLASS, 0L, 100000L, False, (Atom) AnyPropertyType, &cs -> type, &cs -> format, &cs -> length, &bytesAfter, (unsigned char**) &cs -> value); if (cs -> value != NULL) break; } } } else if (atoms[XmANAME] == cs -> target) { Widget current; unsigned long bytesAfter; Atom type; int format; unsigned char *value = NULL; char *total_value; unsigned long length; for(current = w; current != (Widget) NULL; current = XtParent(current)) { if (XtIsShell(current)) { XGetWindowProperty(XtDisplay(current), XtWindow(current), XA_WM_NAME, 0L, 100000L, False, (Atom) AnyPropertyType, &type, &format, &length, &bytesAfter, &value); if (value != NULL) break; } } total_value = _XmTextToLocaleText(w, (XtPointer)value, type, format, length, NULL); cs -> value = (XtPointer) total_value; cs -> format = 8; cs -> length = total_value != NULL ? strlen(total_value) : 0; cs -> type = XmeGetEncodingAtom(w); } else if (atoms[XmACLIENT_WINDOW] == cs -> target) { Widget current; Window *cw; cw = (Window *) XtMalloc(sizeof(Window)); for(current = w; current != (Widget) NULL; current = XtParent(current)) if (XtIsShell(current)) break; *cw = XtWindow(current); cs -> value = (XtPointer) cw; cs -> format = 32; cs -> length = 1; cs -> type = XA_WINDOW; } else if (atoms[XmA_MOTIF_RENDER_TABLE] == cs -> target) { XmRenderTable table; Arg args[1]; char *value; int size; table = (XmRenderTable) NULL; XtSetArg(args[0], XmNrenderTable, &table); XtGetValues(w, args, 1); if (table == NULL) { /* If we didn't find a render table on this widget, then go ahead and look up the chain for something which does have one */ table = XmeGetDefaultRenderTable(w, XmTEXT_RENDER_TABLE); } if (table != NULL) { size = XmRenderTableCvtToProp(w, table, &value); cs -> value = (XtPointer) value; cs -> format = 8; cs -> length = size; cs -> type = XA_STRING; } } else if (atoms[XmA_MOTIF_ENCODING_REGISTRY] == cs -> target) { int len; cs -> format = 8; cs -> type = XA_STRING; cs -> value = _XmGetEncodingRegistryTarget(&len); cs -> length = len; } _XmAppUnlock(app); } Atom XmeGetEncodingAtom(Widget w) { int ret_status = 0; XTextProperty tmp_prop; char * tmp_string = "ABC"; /* these are characters in XPCS, so... safe */ Atom encoding; _XmWidgetToAppContext(w); _XmAppLock(app); tmp_prop.value = NULL; /* just in case X doesn't do it */ ret_status = XmbTextListToTextProperty(XtDisplay(w), &tmp_string, 1, (XICCEncodingStyle)XTextStyle, &tmp_prop); if (ret_status == Success) encoding = tmp_prop.encoding; else encoding = None; /* XmbTextList... should always be able * to convert XPCS characters; but in * case its broken, this prevents a core * dump. */ if (tmp_prop.value != NULL) XFree((char *)tmp_prop.value); _XmAppUnlock(app); return(encoding); } char * _XmTextToLocaleText(Widget w, XtPointer value, Atom type, int format, unsigned long length, Boolean *success) { Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), XmSCOMPOUND_TEXT, False); #ifdef UTF8_SUPPORTED Atom UTF8_STRING = XInternAtom(XtDisplay(w), XmSUTF8_STRING, False); #endif XTextProperty text_prop; int status; char ** values; int num_values = 0; char *total_value = NULL; int malloc_size = 0; int i; if (type == XA_STRING || type == COMPOUND_TEXT #ifdef UTF8_SUPPORTED || type == UTF8_STRING #endif ) { text_prop.value = (unsigned char *) value; text_prop.encoding = type; text_prop.format = format; text_prop.nitems = length; status = XmbTextPropertyToTextList(XtDisplay(w), &text_prop, &values, &num_values); if (success != NULL) { if (status == Success || status > 0) *success = True; else *success = False; } if (num_values) { for (i = 0; i < num_values ; i++) malloc_size += strlen(values[i]); total_value = XtMalloc ((unsigned) malloc_size + 1); total_value[0] = '\0'; for (i = 0; i < num_values ; i++) strcat(total_value, values[i]); XFreeStringList(values); } } return total_value; } void _XmConvertComplete(Widget wid, XtPointer value, unsigned long size, int format, Atom type, XmConvertCallbackStruct *cs) { if (value == NULL && cs -> value == NULL) { XmeStandardConvert(wid, NULL, cs); } else { if (cs -> status == XmCONVERT_MERGE) { XmeConvertMerge(value, type, format, size, cs); XtFree((char*) value); } else { /* Not merging */ if (cs -> value != NULL) XtFree((char*) cs -> value); cs -> type = type; cs -> value = value; cs -> length = size; cs -> format = format; } } if (cs -> value != NULL) cs -> status = XmCONVERT_DONE; else cs -> status = XmCONVERT_REFUSE; } XmDestinationCallbackStruct* _XmTransferGetDestinationCBStruct(XtPointer tid) { TransferContext tc = (TransferContext) tid; return(tc -> callback_struct); } /* Error handler for XGetAtomName */ static int SIF_ErrorFlag; /*ARGSUSED*/ static int SIF_ErrorHandler( Display *display, /* unused */ XErrorEvent *event) { _XmProcessLock(); SIF_ErrorFlag = event -> type; _XmProcessUnlock(); return 0; } /* NOTE! XGetAtomName return value MUST be freed with XFree; however, there ** isn't a good way to allocate data which can be freed with XFree. We could ** cache a static character pointer to NULL and check it to decide whether or ** not to free; for now, just pass information back on what to do with the ** returned value. */ static char* GetSafeAtomName(Display *display, Atom a, FreeType *howFree) { XErrorHandler old_Handler; char *returnvalue; /* Setup error proc and reset error flag */ old_Handler = XSetErrorHandler((XErrorHandler) SIF_ErrorHandler); _XmProcessLock(); SIF_ErrorFlag = 0; _XmProcessUnlock(); returnvalue = XGetAtomName(display, a); *howFree = DoXFree; XSetErrorHandler(old_Handler); _XmProcessLock(); if (SIF_ErrorFlag != 0) { returnvalue = (char*) malloc(1); returnvalue[0] = 0; /* Create empty string to return */ *howFree = DoFree; TransferWarning(NULL, ATOM, ARG, BAD_ATOM_MESSAGE); } _XmProcessUnlock(); return(returnvalue); } motif-2.3.8/lib/Xm/ReadImage.c0000644000175000017500000000353713145162623012712 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: ReadImage.c /main/15 1996/10/21 11:40:15 cde-osf $" #endif #endif #include "XmI.h" /* for _XmCreateImage() */ #include "ReadImageI.h" /************************************************************************ * * _XmReadImageAndHotSpotFromFile * Given a filename, extract and create an image from the file data. * This one takes a Display. ************************************************************************/ XImage * _XmReadImageAndHotSpotFromFile( Display * display, char *filename, int *hot_x, int *hot_y) { unsigned int width; unsigned int height; unsigned char * data; if (BitmapSuccess == XReadBitmapFileData(filename, &width, &height, &data, hot_x, hot_y)) { XImage * image; _XmCreateImage(image, display, (char*)data, width, height, LSBFirst); return (image); } return (NULL); } motif-2.3.8/lib/Xm/MainW.h0000644000175000017500000000475213145162623012114 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmMainWindow_h #define _XmMainWindow_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsMainWindow #define XmIsMainWindow(w) XtIsSubclass(w, xmMainWindowWidgetClass) #endif /* XmIsMainWindow */ externalref WidgetClass xmMainWindowWidgetClass; typedef struct _XmMainWindowClassRec * XmMainWindowWidgetClass; typedef struct _XmMainWindowRec * XmMainWindowWidget; /******** Public Function Declarations ********/ extern void XmMainWindowSetAreas( Widget w, Widget menu, Widget command, Widget hscroll, Widget vscroll, Widget wregion) ; extern Widget XmMainWindowSep1( Widget w) ; extern Widget XmMainWindowSep2( Widget w) ; extern Widget XmMainWindowSep3( Widget w) ; extern Widget XmCreateMainWindow( Widget parent, char *name, ArgList args, Cardinal argCount) ; extern Widget XmVaCreateMainWindow( Widget parent, char *name, ...); extern Widget XmVaCreateManagedMainWindow( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMainWindow_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CvtUnit.c0000644000175000017500000000375612672140200012462 00000000000000/* $XConsortium: CvtUnit.c /main/5 1995/07/15 20:50:25 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include "RepTypeI.h" /************************************************************************ * * XmCvtStringToUnitType * Convert a string to resolution independent unit type. * This routine is obsolete, the converter is now available * by default. We just call it here. * ************************************************************************/ /*ARGSUSED*/ void XmCvtStringToUnitType( XrmValuePtr args, /* unused */ Cardinal *num_args, /* unused */ XrmValue *from_val, XrmValue *to_val ) { Display * dpy = _XmGetDefaultDisplay(); /* we cannot call XmRUnitType directly, since it would loop if a program registers this function with to_type = XmRUnitType (which is very likely). So we use REAL_UNIT_TYPE_NAME, which has been registered with the same semantics as the original XmRUnitType in RepType.c */ XtConvertAndStore(XmGetXmDisplay(dpy), XmRString, from_val, REAL_UNIT_TYPE_NAME, to_val); } motif-2.3.8/lib/Xm/Trait.c0000644000175000017500000001461612672140200012146 00000000000000/* $TOG: Trait.c /main/9 1997/07/07 11:36:10 cshi $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* #define DEBUG */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "HashI.h" #include "TraitI.h" #include "XmI.h" /* * Internal data structures */ static XmHashTable TraitTable; typedef struct _XmTraitEntry { XtPointer obj; XrmQuark name; } XmTraitEntryRec, *XmTraitEntry; /* * Static functions */ static Boolean TraitCompare(XmHashKey, XmHashKey); static XmHashValue TraitHash(XmHashKey); /* * List all quarks here */ externaldef(traits) XrmQuark XmQTmotifTrait = NULLQUARK; externaldef(traits) XrmQuark XmQTmenuSystem = NULLQUARK; externaldef(traits) XrmQuark XmQTtransfer = NULLQUARK; externaldef(traits) XrmQuark XmQTaccessTextual = NULLQUARK; externaldef(traits) XrmQuark XmQTmenuSavvy = NULLQUARK; externaldef(traits) XrmQuark XmQTnavigator = NULLQUARK; externaldef(traits) XrmQuark XmQTscrollFrame = NULLQUARK; externaldef(traits) XrmQuark XmQTactivatable = NULLQUARK; externaldef(traits) XrmQuark XmQTdialogShellSavvy = NULLQUARK; externaldef(traits) XrmQuark XmQTjoinSide = NULLQUARK; externaldef(traits) XrmQuark XmQTcareParentVisual = NULLQUARK; externaldef(traits) XrmQuark XmQTspecifyRenderTable = NULLQUARK; externaldef(traits) XrmQuark XmQTtakesDefault = NULLQUARK; externaldef(traits) XrmQuark XmQTcontainerItem = NULLQUARK; externaldef(traits) XrmQuark XmQTcontainer = NULLQUARK; externaldef(traits) XrmQuark XmQTspecifyLayoutDirection = NULLQUARK; externaldef(traits) XrmQuark XmQTaccessColors = NULLQUARK; externaldef(traits) XrmQuark XmQTspecifyUnitType = NULLQUARK; externaldef(traits) XrmQuark XmQTtraversalControl = NULLQUARK; externaldef(traits) XrmQuark XmQTspecifyUnhighlight = NULLQUARK; externaldef(traits) XrmQuark XmQTpointIn = NULLQUARK; externaldef(traits) XrmQuark _XmQTclipWindow = NULLQUARK; externaldef(traits) XrmQuark XmQTtoolTipConfig = NULLQUARK; externaldef(traits) XrmQuark XmQTtoolTip = NULLQUARK; /* * Initialize traits system * * This routine sets up all quarks used by the traits in * Motif */ void _XmInitializeTraits() { /* avoid initializing more than once */ if(TraitTable != NULL) return; /* Create Hash Table */ TraitTable = _XmAllocHashTable(200, TraitCompare, TraitHash); XmQTmotifTrait = XrmPermStringToQuark("XmQTmotifTrait"); /* Menu system manipulation and status */ XmQTmenuSystem = XrmPermStringToQuark("XmTmenuSystem"); XmQTmenuSavvy = XrmPermStringToQuark("XmTmenuSavvy"); /* Transfer Trait */ XmQTtransfer = XrmPermStringToQuark("XmTtransfer"); /* String get/set */ XmQTaccessTextual = XrmPermStringToQuark("XmTaccessTextual"); /* Navigator/Scrolling trait */ XmQTnavigator = XrmPermStringToQuark("XmTnavigator"); XmQTscrollFrame = XrmPermStringToQuark("XmTscrollFrame"); _XmQTclipWindow= XrmPermStringToQuark("_XmTclipWindow"); /* Activatable trait */ XmQTactivatable = XrmPermStringToQuark("XmTactivatable"); /* JoinSide trait */ XmQTjoinSide = XrmPermStringToQuark("XmTjoinSide"); /* DialogShellSavvy trait */ XmQTdialogShellSavvy = XrmPermStringToQuark("XmTdialogShellSavvy"); /* Care about Parent Visual trait */ XmQTcareParentVisual = XrmPermStringToQuark("XmTcareParentVisual"); /* SpecifyRenderTable trait */ XmQTspecifyRenderTable = XrmPermStringToQuark("XmTspecifyRenderTable"); /* TakesDefault trait */ XmQTtakesDefault = XrmPermStringToQuark("XmTtakesDefault"); /* Container/Item trait */ XmQTcontainerItem = XrmPermStringToQuark("XmTcontainerItem"); XmQTcontainer = XrmPermStringToQuark("XmTcontainer"); /* LayoutDirection trait */ XmQTspecifyLayoutDirection = XrmPermStringToQuark("XmTspecifyLayoutDirection"); /* get colors */ XmQTaccessColors = XrmPermStringToQuark("XmTaccessColors"); /* Unit type */ XmQTspecifyUnitType = XrmPermStringToQuark("XmTspecifyUnitType"); /* Traversal control. */ XmQTtraversalControl = XrmPermStringToQuark("XmTtraversalControl"); /* Specify UnHighlight GC trait */ XmQTspecifyUnhighlight = XrmPermStringToQuark("XmTspecifyUnhighlight"); /* PointIn trait */ XmQTpointIn = XrmPermStringToQuark("XmTpointIn"); /* ToolTip traits */ XmQTtoolTipConfig = XrmPermStringToQuark("XmTtoolTipConfig"); XmQTtoolTip = XrmPermStringToQuark("XmTtoolTip"); } XtPointer XmeTraitGet(XtPointer obj, XrmQuark name) { XtPointer trait; XmTraitEntryRec entry; entry.obj = obj; entry.name = name; _XmProcessLock(); trait = _XmGetHashEntry(TraitTable, &entry); _XmProcessUnlock(); return(trait); } Boolean XmeTraitSet(XtPointer object, XrmQuark name, XtPointer data) { XmTraitEntry entry; /* Create key, this will be freed if the record is removed */ entry = (XmTraitEntry) XtMalloc(sizeof(XmTraitEntryRec)); entry -> obj = object; entry -> name = name; _XmProcessLock(); if (data != NULL) { _XmAddHashEntry(TraitTable, entry, data); } else { /* if data == NULL then remove the context */ XtPointer key; key = _XmRemoveHashEntry(TraitTable, entry); XtFree((char*) entry); XtFree((char*) key); } _XmProcessUnlock(); return True; } static Boolean TraitCompare(XmHashKey key1, XmHashKey key2) { XmTraitEntry entry1, entry2; entry1 = (XmTraitEntry) key1; entry2 = (XmTraitEntry) key2; return(entry1 -> obj == entry2 -> obj && entry1 -> name == entry2 -> name); } static XmHashValue TraitHash(XmHashKey key) { XmTraitEntry entry = (XmTraitEntry) key; return(((long) entry -> obj) + ((long) entry -> name)); } motif-2.3.8/lib/Xm/XpmWrFFrP.c0000644000175000017500000000577512672140200012664 00000000000000/* $XConsortium: XpmWrFFrP.c /main/2 1996/09/20 08:14:53 pascale $ */ /* * Copyright (C) 1989-95 GROUPE BULL * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of GROUPE BULL shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from GROUPE BULL. */ /*****************************************************************************\ * WrFFrP.c: * * * * XPM library * * Write a pixmap and possibly its mask to an XPM file * * * * Developed by Arnaud Le Hors * \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include "XpmI.h" int XpmWriteFileFromPixmap(display, filename, pixmap, shapemask, attributes) Display *display; char *filename; Pixmap pixmap; Pixmap shapemask; XpmAttributes *attributes; { XImage *ximage = NULL; XImage *shapeimage = NULL; unsigned int width = 0; unsigned int height = 0; int ErrorStatus; /* get geometry */ if (attributes && attributes->valuemask & XpmSize) { width = attributes->width; height = attributes->height; } /* get the ximages */ if (pixmap) xpmCreateImageFromPixmap(display, pixmap, &ximage, &width, &height); if (shapemask) xpmCreateImageFromPixmap(display, shapemask, &shapeimage, &width, &height); /* write to the file */ ErrorStatus = XpmWriteFileFromImage(display, filename, ximage, shapeimage, attributes); /* destroy the ximages */ if (ximage) XDestroyImage(ximage); if (shapeimage) XDestroyImage(shapeimage); return (ErrorStatus); } motif-2.3.8/lib/Xm/MenuProc.c0000644000175000017500000001124712672140200012610 00000000000000 /* $XConsortium: MenuProc.c /main/8 1996/01/17 10:50:38 lehors $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif /* * The following functions are used to separate the private class function * in RowColumn from the buttons that may be children of the RowColumn. * This is simply an interface supplied so that the buttons will not have * to have intimate knowledge of the RowColumn class functions. */ #include #include #include "MenuProcI.h" #include "GadgetUtiI.h" #include "XmI.h" static XtPointer menuProcEntry = NULL; /* * this routine is called at RowColumn class init to * save the address of the menuProcedureEntry routine. */ void _XmSaveMenuProcContext( XtPointer address ) { menuProcEntry = address; } /* * This routine is used by the button children of the RowColumn (currently * all label and labelgadget subclasses) to get the address of the * menuProcedureEntry routine. It is called by the buttons class init * routines. */ XtPointer _XmGetMenuProcContext( void ) { return menuProcEntry; } /* temp hold for core class translations used during subclass' * InitializePrehook & InitializePosthook */ static XContext SaveTranslationsContext = 0; /************************************************************************ * * _XmSaveCoreClassTranslations * * Save away the core class translations during the initialization * routines. This is used by rowcol and subclasses of Label that set their * translations during initialization depending on whether they are in * a menu. The InitializePrehook calls this routine to save the * core class translations. ************************************************************************/ void _XmSaveCoreClassTranslations( Widget widget) { _XmProcessLock(); if (SaveTranslationsContext == 0) SaveTranslationsContext = XUniqueContext(); XSaveContext(XtDisplay(widget), (XID)widget, SaveTranslationsContext, (char *)(widget->core.widget_class->core_class.tm_table)); _XmProcessUnlock(); } /************************************************************************ * * _XmRestoreCoreClassTranslations * * Restore the core class translations during the initialization * routines. This is used by rowcol and subclasses of Label that set their * translations during initialization depending on whether they are in * a menu. The InitializePosthook calls this routine to restore the * core class translations. ************************************************************************/ void _XmRestoreCoreClassTranslations( Widget widget) { String saved_translations; _XmProcessLock(); if (SaveTranslationsContext && (!XFindContext(XtDisplay(widget), (XID)widget, SaveTranslationsContext, (XtPointer)&saved_translations))) widget->core.widget_class->core_class.tm_table = saved_translations; #ifdef DEBUG else /* This should'nt happen ! */ abort(); #endif _XmProcessUnlock(); } /************************************************* * This function extracts a time from an event or * returns the last processed time if the event * is NULL or isn't an event with a timestamp *************************************************/ /*ARGSUSED*/ Time _XmGetDefaultTime(Widget wid, XEvent *event) { if (event == NULL) return(XtLastTimestampProcessed(XtDisplay(wid))); else if (event -> type == ButtonPress || event -> type == ButtonRelease) return(event -> xbutton.time); else if (event -> type == KeyPress || event -> type == KeyRelease) return(event -> xkey.time); else if (event -> type == MotionNotify) return(event -> xmotion.time); else if (event -> type == EnterNotify || event -> type == LeaveNotify) return(event -> xcrossing.time); else return(XtLastTimestampProcessed(XtDisplay(wid))); } motif-2.3.8/lib/Xm/FontS.h0000644000175000017500000000500312672140200012107 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _XmFontSelector_h #define _XmFontSelector_h #if defined(VMS) || defined(__VMS) #include #endif /************************************************************ * INCLUDE FILES ************************************************************/ #include #if defined(__cplusplus) extern "C" { #endif /************************************************************ * TYPEDEFS AND DEFINES ************************************************************/ typedef struct _XmFontSelectorClassRec *XmFontSelectorWidgetClass; typedef struct _XmFontSelectorRec *XmFontSelectorWidget; /************************************************************ * MACROS ************************************************************/ /************************************************************ * GLOBAL DECLARATIONS ************************************************************/ /************************************************************ * EXTERNAL DECLARATIONS ************************************************************/ /* Function Name: XmCreateFontSelector * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The Widget created. */ Widget XmCreateFontSelector( #ifndef _NO_PROTO Widget, String, ArgList, Cardinal #endif ); extern WidgetClass xmFontSelectorWidgetClass; #if defined(__cplusplus) } #endif #if defined(VMS) || defined(__VMS) #include #endif #endif /* _XmFontSelector_h - DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/VirtKeysI.h0000644000175000017500000000350712672140200012756 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: VirtKeysI.h /main/5 1995/07/13 18:20:49 drk $ */ #ifndef _XmVirtKeyI_h #define _XmVirtKeyI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmVirtKeysInitialize( Widget widget) ; extern void _XmVirtKeysDestroy( Widget widget) ; extern void _XmVirtKeysStoreBindings( Widget shell, String binding) ; extern Boolean _XmVirtKeysLoadFileBindings( char *fileName, String *binding) ; extern int _XmVirtKeysLoadFallbackBindings( Display *display, String *binding) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVirtKeyI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/DrawnB.h0000644000175000017500000000433413145162623012252 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /*********************************************************************** * * DrawnButton Widget * ***********************************************************************/ #ifndef _XmDButton_h #define _XmDButton_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsDrawnButton #define XmIsDrawnButton(w) XtIsSubclass(w, xmDrawnButtonWidgetClass) #endif /* XmIsDrawnButton */ /* DrawnButon Widget */ externalref WidgetClass xmDrawnButtonWidgetClass; typedef struct _XmDrawnButtonClassRec *XmDrawnButtonWidgetClass; typedef struct _XmDrawnButtonRec *XmDrawnButtonWidget; /******** Public Function Declarations ********/ extern Widget XmCreateDrawnButton( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern Widget XmVaCreateDrawnButton( Widget parent, char *name, ...); extern Widget XmVaCreateManagedDrawnButton( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDButton_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ArrowBG.c0000644000175000017500000012432413145162623012375 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: ArrowBG.c /main/20 1999/01/26 15:30:15 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "ColorI.h" #include "PixConvI.h" #include "PrimitiveI.h" #include "RepTypeI.h" #include "ScreenI.h" #include "TravActI.h" #include "TraversalI.h" #include "XmI.h" #define DELAY_DEFAULT 100 #define INVALID_PIXEL ((Pixel) -1) #define INVALID_PIXMAP ((Pixmap) -1) /******** Static Function Declarations ********/ static Pixmap GetHighlightPixmapDefault(XmArrowButtonGadget ag); static Pixmap GetTopShadowPixmapDefault(XmArrowButtonGadget ag); static void ClassPartInitialize(WidgetClass wc); static void Initialize(Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void GetArrowGC(XmArrowButtonGadget ag); static void GetBackgroundGC(XmArrowButtonGadget ag); static void Redisplay(Widget w, XEvent *event, Region region); static void Destroy(Widget w); static Boolean SetValues(Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void HighlightBorder(Widget w); static void InputDispatch(Widget wid, XEvent *event, Mask event_mask); static void Arm(XmArrowButtonGadget aw, XEvent *event); static void Activate(Widget wid, XEvent *event, String *params, Cardinal *num_params); static void ArmAndActivate(Widget w, XEvent *event, String *params, Cardinal *num_params); static void ArmTimeout(XtPointer data, XtIntervalId *id); static void Disarm(XmArrowButtonGadget aw, XEvent *event); static void Enter(XmArrowButtonGadget aw, XEvent *event); static void Leave(XmArrowButtonGadget aw, XEvent *event); static void Help(XmArrowButtonGadget aw, XEvent *event); static void ActivateCommonG(XmArrowButtonGadget ag, XEvent *event, Mask event_mask); static void ChangeCB(Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset); static Boolean HandleRedraw(Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static void InitNewColorBehavior(XmArrowButtonGadget ag); static void DealWithColors(XmArrowButtonGadget ag); static void DealWithPixmaps(XmArrowButtonGadget ag); static void InitNewPixmapBehavior(XmArrowButtonGadget ag); static void DrawArrowG(XmArrowButtonGadget ag, GC top_gc, GC bottom_gc, GC center_gc); static void GetColors(Widget widget, XmAccessColorData color_data); /******** End Static Function Declarations ********/ /* Resource list for Arrow */ static XtResource resources[] = { { XmNmultiClick, XmCMultiClick, XmRMultiClick, sizeof(unsigned char), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.multiClick), XmRImmediate, (XtPointer) XmMULTICLICK_KEEP }, { XmNarrowDirection, XmCArrowDirection, XmRArrowDirection, sizeof(unsigned char), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.direction), XmRImmediate, (XtPointer) XmARROW_UP }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.activate_callback), XmRPointer, (XtPointer) NULL }, { XmNarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.arm_callback), XmRPointer, (XtPointer) NULL }, { XmNdisarmCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.disarm_callback), XmRPointer, (XtPointer) NULL }, { XmNbackground, XmCBackground, XmRPixel, sizeof(Pixel), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.background), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNforeground, XmCForeground, XmRPixel, sizeof(Pixel), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.foreground), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNtopShadowColor, XmCTopShadowColor, XmRPixel, sizeof(Pixel), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.top_shadow_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.top_shadow_pixmap), XmRImmediate, (XtPointer) INVALID_PIXMAP }, { XmNbottomShadowColor, XmCBottomShadowColor, XmRPixel, sizeof(Pixel), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.bottom_shadow_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.bottom_shadow_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNhighlightColor, XmCHighlightColor, XmRPixel, sizeof(Pixel), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.highlight_color), XmRImmediate, (XtPointer) INVALID_PIXEL }, { XmNhighlightPixmap, XmCHighlightPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.highlight_pixmap), XmRImmediate, (XtPointer) INVALID_PIXMAP }, { XmNdetailShadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmArrowButtonGadgetRec, arrowbutton.detail_shadow_thickness), XmRCallProc, (XtPointer) _XmSetThickness } }; static XmSyntheticResource syn_resources[] = { { XmNdetailShadowThickness, sizeof(Dimension), XtOffsetOf(XmArrowButtonGadgetRec, arrowbutton.detail_shadow_thickness), XmeFromHorizontalPixels,XmeToHorizontalPixels } }; /* The Arrow class record definition */ externaldef(xmarrowbuttongadgetclassrec) XmArrowButtonGadgetClassRec xmArrowButtonGadgetClassRec = { { /* object fields */ (WidgetClass) &xmGadgetClassRec, /* superclass */ "XmArrowButtonGadget", /* class_name */ sizeof(XmArrowButtonGadgetRec), /* widget_size */ (XtProc)NULL, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ NULL, /* realize */ NULL, /* actions */ 0, /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ (XtWidgetProc)NULL, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ (XtPointer)NULL, /* callback private */ (String)NULL, /* tm_table */ (XtGeometryHandler)NULL, /* query_geometry */ NULL, /* display_accelerator */ (XtPointer)NULL /* extension */ }, { /* XmGadget fields */ HighlightBorder, /* border highlight */ XmInheritBorderUnhighlight, /* border_unhighlight */ ArmAndActivate, /* arm_and_activate */ InputDispatch, /* input dispatch */ XmInheritVisualChange, /* visual_change */ syn_resources, /* syn_resources */ XtNumber(syn_resources), /* num_syn_resources */ (XmCacheClassPartPtr)NULL, /* class cache part */ (XtPointer)NULL /* extension */ }, { /* XmArrowButtonGadget fields */ (XtPointer)NULL /* extension */ } }; externaldef(xmarrowbuttongadgetclass) WidgetClass xmArrowButtonGadgetClass = (WidgetClass) &xmArrowButtonGadgetClassRec; /* Trait record for arrowBG */ static XmConst XmActivatableTraitRec arrowBGAT = { 0, /* version */ ChangeCB /* changeCB */ }; static XmConst XmCareVisualTraitRec arrowBGCVT = { 0, /* version */ HandleRedraw /* redraw */ }; /* Access Colors Trait record for arrow button gadget */ static XmConst XmAccessColorsTraitRec arrowBGACT = { 0, /* version */ GetColors, /* getColors */ NULL /* setColors */ }; static Pixmap GetHighlightPixmapDefault(XmArrowButtonGadget ag) { XmManagerWidget mw = (XmManagerWidget)XtParent(ag); Pixmap result = XmUNSPECIFIED_PIXMAP; if (ag->arrowbutton.highlight_color == ag->arrowbutton.background) result = XmGetPixmapByDepth(XtScreen(ag), XmS50_foreground, ag->arrowbutton.highlight_color, ag->arrowbutton.foreground, mw->core.depth); return result; } static Pixmap GetTopShadowPixmapDefault(XmArrowButtonGadget ag) { XmManagerWidget mw = (XmManagerWidget)XtParent(ag); Pixmap result = XmUNSPECIFIED_PIXMAP; if (ag->arrowbutton.top_shadow_color == ag->arrowbutton.background) result = XmGetPixmapByDepth(XtScreen(ag), XmS50_foreground, ag->arrowbutton.top_shadow_color, ag->arrowbutton.foreground, mw->core.depth); else if (DefaultDepthOfScreen(XtScreen(ag)) == 1) result = XmGetPixmapByDepth(XtScreen(ag), XmS50_foreground, ag->arrowbutton.top_shadow_color, ag->arrowbutton.background, mw->core.depth); return result; } /************************************************************************ * * ClassPartInitialize * Set up the fast subclassing for the widget * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc) { _XmFastSubclassInit (wc, XmARROW_BUTTON_GADGET_BIT); /* Install the activatable trait for all subclasses */ XmeTraitSet((XtPointer)wc, XmQTactivatable, (XtPointer)&arrowBGAT); /* Install the careParentVisual trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTcareParentVisual, (XtPointer)&arrowBGCVT); /* Install the accessColors trait for all subclasses as well. */ XmeTraitSet((XtPointer)wc, XmQTaccessColors, (XtPointer)&arrowBGACT); } /************************************************************************ * * Initialize * The main widget instance initialization routine. * ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmArrowButtonGadget request = (XmArrowButtonGadget) rw; XmArrowButtonGadget new_w = (XmArrowButtonGadget) nw; /* * Check the data put into the new widget from .Xdefaults * or through the arg list. */ if (!XmRepTypeValidValue(XmRID_ARROW_DIRECTION, new_w->arrowbutton.direction, (Widget) new_w)) { new_w->arrowbutton.direction = XmARROW_UP; } /* Set up a geometry for the widget if it is currently 0. */ if (request->rectangle.width == 0) new_w->rectangle.width += 15; if (request->rectangle.height == 0) new_w->rectangle.height += 15; /* Set the internal arrow variables */ new_w->arrowbutton.timer = 0; new_w->arrowbutton.selected = False; /* Get the drawing graphics contexts. */ DealWithColors(new_w); DealWithPixmaps(new_w); GetArrowGC (new_w); GetBackgroundGC (new_w); new_w->arrowbutton.highlight_GC = _XmGetPixmapBasedGC (XtParent(nw), new_w->arrowbutton.highlight_color, new_w->arrowbutton.background, new_w->arrowbutton.highlight_pixmap); new_w->arrowbutton.top_shadow_GC = _XmGetPixmapBasedGC (XtParent(nw), new_w->arrowbutton.top_shadow_color, new_w->arrowbutton.background, new_w->arrowbutton.top_shadow_pixmap); new_w->arrowbutton.bottom_shadow_GC = _XmGetPixmapBasedGC (XtParent(nw), new_w->arrowbutton.bottom_shadow_color, new_w->arrowbutton.background, new_w->arrowbutton.bottom_shadow_pixmap); /* Initialize the interesting input types. */ new_w->gadget.event_mask = XmARM_EVENT | XmACTIVATE_EVENT | XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmMULTI_ARM_EVENT| XmMULTI_ACTIVATE_EVENT; } /************************************************************************ * * GetBackgroundGC * Get the graphics context used for drawing the background. * ************************************************************************/ static void GetBackgroundGC( XmArrowButtonGadget ag) { XGCValues values; XtGCMask valueMask; XmManagerWidget mw = (XmManagerWidget) XtParent(ag); ag->arrowbutton.fill_bg_box = ((mw->core.background_pixel != ag->arrowbutton.background) && (mw->core.background_pixmap == XmUNSPECIFIED_PIXMAP)); if (!ag->arrowbutton.fill_bg_box) return; valueMask = GCForeground | GCBackground; values.foreground = ag->arrowbutton.background; values.background = ag->arrowbutton.foreground; ag->arrowbutton.background_GC = XtGetGC ((Widget) mw, valueMask, &values); } /************************************************************************ * * GetArrowGC * Get the graphics context used for drawing the arrowbutton. * ************************************************************************/ static void GetArrowGC( XmArrowButtonGadget ag) { XGCValues values; XtGCMask valueMask, unusedMask; XmManagerWidget mw = (XmManagerWidget) XtParent(ag); valueMask = GCForeground | GCBackground | GCGraphicsExposures; unusedMask = GCClipXOrigin | GCClipYOrigin | GCFont; values.foreground = ag->arrowbutton.foreground; values.background = ag->arrowbutton.background; values.graphics_exposures = False; ag->arrowbutton.arrow_GC = XtAllocateGC ((Widget) mw, 0, valueMask, &values, GCClipMask, unusedMask); valueMask |= GCFillStyle | GCStipple; values.fill_style = FillOpaqueStippled; values.stipple = _XmGetInsensitiveStippleBitmap((Widget) ag); ag->arrowbutton.insensitive_GC = XtAllocateGC((Widget) mw, 0, valueMask, &values, GCClipMask, unusedMask); } /************************************************************************ * * Redisplay * General redisplay function called on exposure events. * ************************************************************************/ /*ARGSUSED*/ static void Redisplay( Widget w, XEvent *event, Region region) { XmArrowButtonGadget aw = (XmArrowButtonGadget) w; int iwidth, iheight; int background_x_offset, background_y_offset, background_width, background_height; iwidth = (int) aw->rectangle.width - 2 * aw->gadget.highlight_thickness; iheight = (int) aw->rectangle.height - 2 * aw->gadget.highlight_thickness; background_x_offset = (aw->rectangle.x + aw->gadget.highlight_thickness + aw->gadget.shadow_thickness); background_y_offset = (aw->rectangle.y + aw->gadget.highlight_thickness + aw->gadget.shadow_thickness); background_height = iheight - 2 * aw->gadget.shadow_thickness; background_width = iwidth - 2 * aw->gadget.shadow_thickness; if (aw->arrowbutton.fill_bg_box) XFillRectangle(XtDisplay(aw), XtWindow((Widget) aw), aw->arrowbutton.background_GC, background_x_offset, background_y_offset, background_width, background_height); /* Draw the arrow */ if ((iwidth > 0) && (iheight > 0)) { if (aw->gadget.shadow_thickness > 0) XmeDrawShadows (XtDisplay (aw), XtWindow (aw), aw->arrowbutton.top_shadow_GC, aw->arrowbutton.bottom_shadow_GC, aw->rectangle.x + aw->gadget.highlight_thickness, aw->rectangle.y + aw->gadget.highlight_thickness, aw->rectangle.width - 2 * aw->gadget.highlight_thickness, aw->rectangle.height-2 * aw->gadget.highlight_thickness, aw->gadget.shadow_thickness, XmSHADOW_OUT); if (aw->arrowbutton.selected && XtIsSensitive(w)) DrawArrowG(aw, aw->arrowbutton.bottom_shadow_GC, aw->arrowbutton.top_shadow_GC, aw->arrowbutton.arrow_GC); else DrawArrowG(aw, aw->arrowbutton.top_shadow_GC, aw->arrowbutton.bottom_shadow_GC, (XtIsSensitive(w) ? aw->arrowbutton.arrow_GC : aw->arrowbutton.insensitive_GC)); } if (aw->gadget.highlighted) { (*(xmArrowButtonGadgetClassRec.gadget_class.border_highlight)) (w); } } /* * * DealWithColors * * Deal with compatibility. * If any resource is set initialize like a widget otherwise get * everything from the parent. * * */ static void DealWithColors( XmArrowButtonGadget ag) { XmManagerWidget mw = (XmManagerWidget) XtParent(ag); /* * If the gadget color is set to the tag value or it is the * same as the manager color; bc mode is enabled otherwise * initialize like a widget. */ if ((ag->arrowbutton.background == INVALID_PIXEL || ag->arrowbutton.background == mw->core.background_pixel) && (ag->arrowbutton.foreground == INVALID_PIXEL || ag->arrowbutton.foreground == mw->manager.foreground) && (ag->arrowbutton.top_shadow_color == INVALID_PIXEL || ag->arrowbutton.top_shadow_color == mw->manager.top_shadow_color) && (ag->arrowbutton.bottom_shadow_color == INVALID_PIXEL || ag->arrowbutton.bottom_shadow_color == mw->manager.bottom_shadow_color) && (ag->arrowbutton.highlight_color == INVALID_PIXEL || ag->arrowbutton.highlight_color == mw->manager.highlight_color)) { ag->arrowbutton.background = mw->core.background_pixel; ag->arrowbutton.foreground = mw->manager.foreground; ag->arrowbutton.top_shadow_color = mw->manager.top_shadow_color; ag->arrowbutton.bottom_shadow_color = mw->manager.bottom_shadow_color; ag->arrowbutton.highlight_color = mw->manager.highlight_color; } else { InitNewColorBehavior(ag); } } static void InitNewColorBehavior( XmArrowButtonGadget ag) { XrmValue value; value.size = sizeof(Pixel); if (ag->arrowbutton.background == INVALID_PIXEL) { _XmBackgroundColorDefault ((Widget)ag, XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.background), &value); memcpy((char*) &ag->arrowbutton.background, value.addr, value.size); } if (ag->arrowbutton.foreground == INVALID_PIXEL) { _XmForegroundColorDefault ((Widget)ag, XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.foreground), &value); memcpy((char*) &ag->arrowbutton.foreground, value.addr, value.size); } if (ag->arrowbutton.top_shadow_color == INVALID_PIXEL) { _XmTopShadowColorDefault ((Widget)ag, XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.top_shadow_color), &value); memcpy((char*)&ag->arrowbutton.top_shadow_color, value.addr,value.size); } if (ag->arrowbutton.bottom_shadow_color == INVALID_PIXEL) { _XmBottomShadowColorDefault((Widget)ag, XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.bottom_shadow_color), &value); memcpy((char*)&ag->arrowbutton.bottom_shadow_color, value.addr, value.size); } if (ag->arrowbutton.highlight_color == INVALID_PIXEL) { _XmHighlightColorDefault((Widget)ag, XtOffsetOf(struct _XmArrowButtonGadgetRec, arrowbutton.highlight_color), &value); memcpy((char*) &ag->arrowbutton.highlight_color, value.addr,value.size); } } /* * * DealWithPixmaps * * Deal with compatibility. * If any resource is set initialize like a widget otherwise get * everything from the parent. * */ static void DealWithPixmaps( XmArrowButtonGadget ag) { XmManagerWidget mw = (XmManagerWidget) XtParent(ag); if ((ag->arrowbutton.top_shadow_pixmap == INVALID_PIXMAP || ag->arrowbutton.top_shadow_pixmap == mw->manager.top_shadow_pixmap) && (ag->arrowbutton.highlight_pixmap == INVALID_PIXMAP || ag->arrowbutton.highlight_pixmap == mw->manager.highlight_pixmap)) { ag->arrowbutton.top_shadow_pixmap = mw->manager.top_shadow_pixmap; ag->arrowbutton.highlight_pixmap = mw->manager.highlight_pixmap; } else { InitNewPixmapBehavior(ag); } } /* * InitNewPixmapBehavior * * Initialize colors like a widget. */ static void InitNewPixmapBehavior( XmArrowButtonGadget ag) { if (ag->arrowbutton.top_shadow_pixmap == INVALID_PIXMAP) { ag->arrowbutton.top_shadow_pixmap = GetTopShadowPixmapDefault(ag); } if (ag->arrowbutton.highlight_pixmap == INVALID_PIXMAP) { ag->arrowbutton.highlight_pixmap = GetHighlightPixmapDefault(ag); } } /************************************************************************ * * Destroy * Clean up allocated resources when the widget is destroyed. * ************************************************************************/ static void Destroy( Widget w) { XmArrowButtonGadget aw = (XmArrowButtonGadget) w; XmManagerWidget mw = (XmManagerWidget) XtParent(aw); if (aw->arrowbutton.timer) XtRemoveTimeOut (aw->arrowbutton.timer); XtReleaseGC ((Widget) mw, aw->arrowbutton.arrow_GC); XtReleaseGC ((Widget) mw, aw->arrowbutton.insensitive_GC); if (aw->arrowbutton.fill_bg_box) XtReleaseGC ((Widget) mw, aw->arrowbutton.background_GC); XtReleaseGC ((Widget) mw, aw->arrowbutton.top_shadow_GC); XtReleaseGC ((Widget) mw, aw->arrowbutton.bottom_shadow_GC); XtReleaseGC ((Widget) mw, aw->arrowbutton.highlight_GC); } /************************************************************************ * * SetValues * ************************************************************************/ /*ARGSUSED*/ static Boolean SetValues( Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmArrowButtonGadget current = (XmArrowButtonGadget) cw; XmArrowButtonGadget new_w = (XmArrowButtonGadget) nw; Boolean returnFlag = FALSE; /* Check the data put into the new widget. */ if (!XmRepTypeValidValue(XmRID_ARROW_DIRECTION, new_w->arrowbutton.direction, (Widget) new_w)) { new_w->arrowbutton.direction = current->arrowbutton.direction; } /* ReInitialize the interesting input types. */ new_w->gadget.event_mask |= XmARM_EVENT | XmACTIVATE_EVENT | XmHELP_EVENT | XmFOCUS_IN_EVENT | XmFOCUS_OUT_EVENT | XmENTER_EVENT | XmLEAVE_EVENT | XmMULTI_ARM_EVENT | XmMULTI_ACTIVATE_EVENT; if (new_w->arrowbutton.direction != current->arrowbutton.direction || XtIsSensitive(nw) != XtIsSensitive(cw) || new_w->gadget.highlight_thickness != current->gadget.highlight_thickness || new_w->gadget.shadow_thickness != current->gadget.shadow_thickness) { returnFlag = TRUE; } if (new_w->arrowbutton.foreground != current->arrowbutton.foreground || new_w->arrowbutton.background != current->arrowbutton.background) { XtReleaseGC (XtParent(current), new_w->arrowbutton.arrow_GC); XtReleaseGC (XtParent(current), new_w->arrowbutton.insensitive_GC); if (new_w->arrowbutton.fill_bg_box) XtReleaseGC (XtParent(current), new_w->arrowbutton.background_GC); GetArrowGC (new_w); GetBackgroundGC (new_w); return (True); } if (current->arrowbutton.top_shadow_color != new_w->arrowbutton.top_shadow_color || current->arrowbutton.top_shadow_pixmap != new_w->arrowbutton.top_shadow_pixmap) { XtReleaseGC ((Widget) new_w, new_w->arrowbutton.top_shadow_GC); new_w->arrowbutton.top_shadow_GC = _XmGetPixmapBasedGC (XtParent(nw), new_w->arrowbutton.top_shadow_color, new_w->arrowbutton.background, new_w->arrowbutton.top_shadow_pixmap); returnFlag = True; } if (current->arrowbutton.bottom_shadow_color != new_w->arrowbutton.bottom_shadow_color || current->arrowbutton.bottom_shadow_pixmap != new_w->arrowbutton.bottom_shadow_pixmap) { XtReleaseGC ((Widget) new_w, new_w->arrowbutton.bottom_shadow_GC); new_w->arrowbutton.bottom_shadow_GC = _XmGetPixmapBasedGC (XtParent(nw), new_w->arrowbutton.bottom_shadow_color, new_w->arrowbutton.background, new_w->arrowbutton.bottom_shadow_pixmap); returnFlag = True; } if (current->arrowbutton.highlight_color != new_w->arrowbutton.highlight_color || current->arrowbutton.highlight_pixmap != new_w->arrowbutton.highlight_pixmap) { XtReleaseGC ((Widget) new_w, new_w->arrowbutton.highlight_GC); new_w->arrowbutton.highlight_GC = _XmGetPixmapBasedGC (XtParent(nw), new_w->arrowbutton.highlight_color, new_w->arrowbutton.background, new_w->arrowbutton.highlight_pixmap); returnFlag = True; } return (returnFlag); } static void HighlightBorder( Widget w) { XmArrowButtonGadget ag = (XmArrowButtonGadget) w; if (ag->rectangle.width == 0 || ag->rectangle.height == 0 || ag->gadget.highlight_thickness == 0) { return; } ag->gadget.highlighted = True; ag->gadget.highlight_drawn = True; /* CR 7330: Use XmeDrawHighlight, not _XmDrawHighlight. */ XmeDrawHighlight(XtDisplay((Widget) ag), XtWindow((Widget) ag), ag->arrowbutton.highlight_GC, ag->rectangle.x, ag->rectangle.y, ag->rectangle.width, ag->rectangle.height, ag->gadget.highlight_thickness); } static Boolean HandleRedraw ( Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag) { XmArrowButtonGadget ag = (XmArrowButtonGadget) kid; XmManagerWidget mw = (XmManagerWidget) new_parent; XmManagerWidget curmw = (XmManagerWidget) cur_parent; Boolean redraw, do_bg, do_arrow, do_highlight, do_top, do_bot; redraw = do_bg = do_arrow = do_highlight = do_top = do_bot = False; if ((visual_flag & VisualBackgroundPixel) && (ag->arrowbutton.background == curmw->core.background_pixel)) { redraw = do_bg = do_arrow = do_highlight = do_top = do_bot = True; ag->arrowbutton.background = mw->core.background_pixel; } if ((visual_flag & VisualForeground) && (ag->arrowbutton.foreground == curmw->manager.foreground)) { redraw = do_arrow = True; ag->arrowbutton.foreground = mw->manager.foreground; } if (visual_flag & VisualBackgroundPixmap) { redraw = do_bg = True; } if (visual_flag & (VisualTopShadowColor | VisualTopShadowPixmap)) { redraw = do_top = True; if (ag->arrowbutton.top_shadow_color == curmw->manager.top_shadow_color) ag->arrowbutton.top_shadow_color = mw->manager.top_shadow_color; if ((ag->arrowbutton.top_shadow_pixmap == curmw->manager.top_shadow_pixmap) && (ag->arrowbutton.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP || ag->arrowbutton.top_shadow_color == curmw->manager.top_shadow_color)) ag->arrowbutton.top_shadow_pixmap = mw->manager.top_shadow_pixmap; } if (visual_flag & (VisualBottomShadowColor | VisualBottomShadowPixmap)) { redraw = do_bot = True; if (ag->arrowbutton.bottom_shadow_color == curmw->manager.bottom_shadow_color) ag->arrowbutton.bottom_shadow_color = mw->manager.bottom_shadow_color; if ((ag->arrowbutton.bottom_shadow_pixmap == curmw->manager.bottom_shadow_pixmap) && (ag->arrowbutton.bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP || ag->arrowbutton.bottom_shadow_color == curmw->manager.bottom_shadow_color)) ag->arrowbutton.bottom_shadow_pixmap = mw->manager.bottom_shadow_pixmap; } if (visual_flag & (VisualHighlightColor | VisualHighlightPixmap)) { redraw = do_highlight = True; if (ag->arrowbutton.highlight_color == curmw->manager.highlight_color) ag->arrowbutton.highlight_color = mw->manager.highlight_color; if (ag->arrowbutton.highlight_pixmap == curmw->manager.highlight_pixmap && (ag->arrowbutton.highlight_pixmap != XmUNSPECIFIED_PIXMAP || ag->arrowbutton.highlight_color != curmw->manager.highlight_color)) ag->arrowbutton.highlight_pixmap = mw->manager.highlight_pixmap; ag->arrowbutton.highlight_GC = _XmGetPixmapBasedGC (XtParent(ag), ag->arrowbutton.highlight_color, ag->arrowbutton.background, ag->arrowbutton.highlight_pixmap); } if (do_bg) { if (ag->arrowbutton.fill_bg_box) XtReleaseGC ((Widget)mw, ag->arrowbutton.background_GC); GetBackgroundGC (ag); } if (do_arrow) { XtReleaseGC ((Widget)mw, ag->arrowbutton.arrow_GC); XtReleaseGC ((Widget)mw, ag->arrowbutton.insensitive_GC); GetArrowGC (ag); } if (do_highlight) { XtReleaseGC ((Widget)mw, ag->arrowbutton.highlight_GC); ag->arrowbutton.highlight_GC = _XmGetPixmapBasedGC (XtParent(ag), ag->arrowbutton.highlight_color, ag->arrowbutton.background, ag->arrowbutton.highlight_pixmap); } if (do_top) { XtReleaseGC ((Widget)mw, ag->arrowbutton.top_shadow_GC); ag->arrowbutton.top_shadow_GC = _XmGetPixmapBasedGC (XtParent(ag), ag->arrowbutton.top_shadow_color, ag->arrowbutton.background, ag->arrowbutton.top_shadow_pixmap); } if (do_bot) { XtReleaseGC ((Widget)mw, ag->arrowbutton.bottom_shadow_GC); ag->arrowbutton.bottom_shadow_GC = _XmGetPixmapBasedGC (XtParent(ag), ag->arrowbutton.bottom_shadow_color, ag->arrowbutton.background, ag->arrowbutton.bottom_shadow_pixmap); } return redraw; } /************************************************************************ * * InputDispatch * This function catches input sent by a manager and dispatches it * to the individual routines. * ************************************************************************/ static void InputDispatch( Widget wid, XEvent *event, Mask event_mask) { XmArrowButtonGadget ag = (XmArrowButtonGadget) wid; if ((event_mask & XmARM_EVENT) || ((ag->arrowbutton.multiClick == XmMULTICLICK_KEEP) && (event_mask & XmMULTI_ARM_EVENT))) Arm (ag, event); else if (event_mask & XmACTIVATE_EVENT) { ag->arrowbutton.click_count = 1; ActivateCommonG (ag, event, event_mask); } else if (event_mask & XmMULTI_ACTIVATE_EVENT) { /* if XmNMultiClick resource is set to DISCARD - do nothing * else call ActivateCommon() and increment clickCount; */ if (ag->arrowbutton.multiClick == XmMULTICLICK_KEEP) { ag->arrowbutton.click_count++; ActivateCommonG (ag, event, event_mask); } } else if (event_mask & XmHELP_EVENT) Help (ag, event); else if (event_mask & XmENTER_EVENT) Enter (ag, event); else if (event_mask & XmLEAVE_EVENT) Leave (ag, event); else if (event_mask & XmFOCUS_IN_EVENT) _XmFocusInGadget ((Widget) ag, event, NULL, NULL); else if (event_mask & XmFOCUS_OUT_EVENT) _XmFocusOutGadget ((Widget)ag, event, NULL, NULL); } /************************************************************************ * * Arm * This function processes button 1 down occuring on the arrowbutton. * ************************************************************************/ static void Arm( XmArrowButtonGadget aw, XEvent *event) { XmArrowButtonCallbackStruct call_value; aw->arrowbutton.selected = True; DrawArrowG(aw, aw->arrowbutton.bottom_shadow_GC, aw->arrowbutton.top_shadow_GC, NULL); if (aw->arrowbutton.arm_callback) { XFlush(XtDisplay(aw)); call_value.reason = XmCR_ARM; call_value.event = event; XtCallCallbackList ((Widget) aw, aw->arrowbutton.arm_callback, &call_value); } } /************************************************************************ * * Activate * This function processes button 1 up occuring on the arrowbutton. * If the button 1 up occurred inside the button the activate * callbacks are called. * ************************************************************************/ /*ARGSUSED*/ static void Activate( Widget wid, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmArrowButtonGadget aw = (XmArrowButtonGadget) wid; XButtonPressedEvent *buttonEvent = (XButtonPressedEvent *) event; XmPushButtonCallbackStruct call_value; aw->arrowbutton.selected = False; DrawArrowG(aw, aw->arrowbutton.top_shadow_GC, aw->arrowbutton.bottom_shadow_GC, NULL); /* CR 9181: Consider clipping when testing visibility. */ if ((buttonEvent->type == ButtonPress || buttonEvent->type == ButtonRelease) && _XmGetPointVisibility(wid, buttonEvent->x_root, buttonEvent->y_root) && (aw->arrowbutton.activate_callback)) { XFlush(XtDisplay(aw)); call_value.reason = XmCR_ACTIVATE; call_value.event = (XEvent *) buttonEvent; call_value.click_count = aw->arrowbutton.click_count; XtCallCallbackList ((Widget) aw, aw->arrowbutton.activate_callback, &call_value); } } /************************************************************************ * * ArmAndActivate * ************************************************************************/ /*ARGSUSED*/ static void ArmAndActivate( Widget w, XEvent *event, String *params, /* unused */ Cardinal *num_params) /* unused */ { XmArrowButtonGadget ab = (XmArrowButtonGadget) w; XmPushButtonCallbackStruct call_value; XtExposeProc expose; ab->arrowbutton.selected = TRUE; ab->arrowbutton.click_count = 1; _XmProcessLock(); expose = ab->object.widget_class->core_class.expose; _XmProcessUnlock(); (*(expose)) ((Widget) ab, event, FALSE); XFlush (XtDisplay (ab)); if (ab->arrowbutton.arm_callback) { call_value.reason = XmCR_ARM; call_value.event = event; call_value.click_count = ab->arrowbutton.click_count; XtCallCallbackList ((Widget) ab, ab->arrowbutton.arm_callback, &call_value); } call_value.reason = XmCR_ACTIVATE; call_value.event = event; call_value.click_count = 1; /* always 1 in kselect */ if (ab->arrowbutton.activate_callback) { XFlush (XtDisplay (ab)); XtCallCallbackList ((Widget) ab, ab->arrowbutton.activate_callback, &call_value); } ab->arrowbutton.selected = FALSE; if (ab->arrowbutton.disarm_callback) { XFlush (XtDisplay (ab)); call_value.reason = XmCR_DISARM; XtCallCallbackList ((Widget) ab, ab->arrowbutton.disarm_callback, &call_value); } /* If the button is still around, show it released, after a short delay */ if (ab->object.being_destroyed == False) { ab->arrowbutton.timer = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget) ab), (unsigned long) DELAY_DEFAULT, ArmTimeout, (XtPointer)ab); } } /*ARGSUSED*/ static void ArmTimeout( XtPointer data, XtIntervalId *id) { XmArrowButtonGadget ab = (XmArrowButtonGadget) data; ab->arrowbutton.timer = 0; if (XtIsRealized((Widget)ab) && XtIsManaged((Widget)ab)) { Redisplay ((Widget) ab, NULL, FALSE); XFlush (XtDisplay (ab)); } } /************************************************************************ * * Disarm * This function processes button 1 up occuring on the arrowbutton. * ************************************************************************/ static void Disarm( XmArrowButtonGadget aw, XEvent *event) { XmArrowButtonCallbackStruct call_value; call_value.reason = XmCR_DISARM; call_value.event = event; XtCallCallbackList ((Widget) aw, aw->arrowbutton.disarm_callback, &call_value); } /************************************************************************ * * Enter * ************************************************************************/ static void Enter( XmArrowButtonGadget aw, XEvent *event) { _XmEnterGadget ((Widget) aw, event, NULL, NULL); if (aw->arrowbutton.selected && XtIsSensitive((Widget) aw)) DrawArrowG(aw, aw->arrowbutton.bottom_shadow_GC, aw->arrowbutton.top_shadow_GC, NULL); } /************************************************************************ * * Leave * ************************************************************************/ static void Leave( XmArrowButtonGadget aw, XEvent *event) { _XmLeaveGadget ((Widget) aw, event, NULL, NULL); if (aw->arrowbutton.selected && XtIsSensitive((Widget) aw)) DrawArrowG(aw, aw->arrowbutton.top_shadow_GC, aw->arrowbutton.bottom_shadow_GC, NULL); } /************************************************************************ * * Help * This function processes Function Key 1 press occuring on * the arrowbutton. * ************************************************************************/ static void Help( XmArrowButtonGadget aw, XEvent *event) { _XmSocorro((Widget) aw, event, NULL, NULL); } /************************************************************************ * * ChangeCB * add or remove the activate callback list. * ************************************************************************/ static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) { if (setunset) XtAddCallback (w, XmNactivateCallback, activCB, closure); else XtRemoveCallback (w, XmNactivateCallback, activCB, closure); } static void GetColors(Widget w, XmAccessColorData color_data) { color_data->valueMask = AccessForeground | AccessBackgroundPixel | AccessHighlightColor | AccessTopShadowColor | AccessBottomShadowColor; color_data->background = ArrowBG_Background(w); color_data->foreground = ArrowBG_Foreground(w); color_data->highlight_color = ArrowBG_HighlightColor(w); color_data->top_shadow_color = ArrowBG_TopShadowColor(w); color_data->bottom_shadow_color = ArrowBG_BottomShadowColor(w); } /************************************************************************ * * XmCreateArrowButtonGadget * Create an instance of an arrowbutton and return the widget id. * ************************************************************************/ Widget XmCreateArrowButtonGadget( Widget parent, char *name, ArgList arglist, Cardinal argcount) { return XtCreateWidget(name, xmArrowButtonGadgetClass, parent, arglist, argcount); } Widget XmVaCreateArrowButtonGadget( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmArrowButtonGadgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedArrowButtonGadget( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmArrowButtonGadgetClass, parent, True, var, count); va_end(var); return w; } /* ARGSUSED */ static void ActivateCommonG( XmArrowButtonGadget ag, XEvent *event, Mask event_mask) { if (event->type == ButtonRelease) { Activate((Widget) ag, event, NULL, NULL); Disarm (ag, event); } else /* assume KeyPress or KeyRelease */ (* (((XmArrowButtonGadgetClassRec *)(ag->object.widget_class))-> gadget_class.arm_and_activate)) ((Widget) ag, event, NULL, NULL); } /* Wrapper around XmeDrawArrow to calculate sizes. */ static void DrawArrowG(XmArrowButtonGadget ag, GC top_gc, GC bottom_gc, GC center_gc) { Position x, y; Dimension width, height; Dimension margin = ag->gadget.highlight_thickness + ag->gadget.shadow_thickness; /* Don't let large margins cause confusion. */ if (margin <= (ag->rectangle.width / 2)) { x = ag->rectangle.x + margin; width = ag->rectangle.width - (margin * 2); } else { x = ag->rectangle.x + ag->rectangle.width / 2; width = 0; } if (margin <= (ag->rectangle.height / 2)) { y = ag->rectangle.y + margin; height = ag->rectangle.height - (margin * 2); } else { y = ag->rectangle.y + ag->rectangle.height / 2; height = 0; } /* The way we currently handle 1 shadowThickness in XmeDrawArrow is by drawing the center a little bit bigger, so the center_gc has to be present. Kinda hacky... */ if (!center_gc && ag->arrowbutton.detail_shadow_thickness == 1) center_gc = ag->arrowbutton.arrow_GC ; if (center_gc) XSetClipMask(XtDisplay((Widget) ag), center_gc, None); XmeDrawArrow (XtDisplay ((Widget) ag), XtWindow ((Widget) ag), top_gc, bottom_gc, center_gc, x, y, width, height, ag->arrowbutton.detail_shadow_thickness, ag->arrowbutton.direction); } motif-2.3.8/lib/Xm/XmI.h0000644000175000017500000002135313145162623011572 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmI_h #define _XmI_h #ifndef _XmNO_BC_INCL #define _XmNO_BC_INCL #endif #include #include #include #include "XmStrDefsI.h" #ifdef __cplusplus extern "C" { #endif #define FIX_345 #ifdef FIX_345 extern Boolean _init_modifiers; extern unsigned int NumLockMask; extern unsigned int ScrollLockMask; void _XmInitModifiers (void); #define _XmCheckInitModifiers() \ { \ if (_init_modifiers) \ { \ _XmInitModifiers(); \ _init_modifiers = FALSE; \ } \ } #endif #ifndef DEBUG # define assert(assert_exp) #elif (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) # define assert(assert_exp) \ (((assert_exp) ? (void) 0 : \ (void) (fprintf(stderr, "assert(%s) failed at line %d in %s\n", \ #assert_exp, __LINE__, __FILE__), abort()))) #else # define assert(assert_exp) \ (((assert_exp) ? 0 : \ (void) (fprintf(stderr, "assert(%s) failed at line %d in %s\n", \ "assert_exp", __LINE__, __FILE__), abort()))) #endif #define ASSIGN_MAX(a, b) ((a) = ((a) > (b) ? (a) : (b))) #define ASSIGN_MIN(a, b) ((a) = ((a) < (b) ? (a) : (b))) #ifndef MAX #define MAX(x,y) ((x) > (y) ? (x) : (y)) #endif #ifndef MIN #define MIN(x,y) ((x) > (y) ? (y) : (x)) #endif #ifndef ABS #define ABS(x) (((x) >= 0) ? (x) : -(x)) #endif #define GMode(g) ((g)->request_mode) #define IsX(g) (GMode (g) & CWX) #define IsY(g) (GMode (g) & CWY) #define IsWidth(g) (GMode (g) & CWWidth) #define IsHeight(g) (GMode (g) & CWHeight) #define IsBorder(g) (GMode (g) & CWBorderWidth) #define IsWidthHeight(g) (GMode (g) & (CWWidth | CWHeight)) #define IsQueryOnly(g) (GMode (g) & XtCWQueryOnly) #define XmStrlen(s) ((s) ? strlen(s) : 0) #define XmStackAlloc(size, stack_cache_array) \ ((((char*)(stack_cache_array) != NULL) && \ ((size) <= sizeof(stack_cache_array))) \ ? (char *)(stack_cache_array) \ : XtMalloc((unsigned)(size))) #define XmStackFree(pointer, stack_cache_array) \ if ((pointer) != ((char*)(stack_cache_array))) XtFree(pointer); /******** _XmCreateImage ********/ #ifdef NO_XM_1_2_BC /* The _XmCreateImage macro is used to create XImage with client specific data for the bit and byte order. We still have to do the following because XCreateImage will stuff here display specific data and we want client specific values (i.e the bit orders we used for creating the bitmap data in Motif) -- BUG 4262 */ /* Used in Motif 1.2 in DragIcon.c, MessageB.c, ReadImage.c and ImageCache.c */ #define _XmCreateImage(IMAGE, DISPLAY, DATA, WIDTH, HEIGHT, BYTE_ORDER) {\ IMAGE = XCreateImage(DISPLAY,\ DefaultVisual(DISPLAY, DefaultScreen(DISPLAY)),\ 1,\ XYBitmap,\ 0,\ DATA,\ WIDTH, HEIGHT,\ 8,\ (WIDTH+7) >> 3);\ IMAGE->byte_order = BYTE_ORDER;\ IMAGE->bitmap_unit = 8;\ IMAGE->bitmap_bit_order = LSBFirst;\ } #endif /* NO_XM_1_2_BC */ /**************************************************************** * * Macros for Right-to-left Layout * ****************************************************************/ #define GetLayout(w) (_XmGetLayoutDirection((Widget)(w))) #define LayoutM(w) (XmIsManager(w) ? \ ((XmManagerWidget)w)->manager.string_direction : \ GetLayout(w)) #define LayoutP(w) (XmIsPrimitive(w) ? \ XmPrim_layout_direction(((XmPrimitiveWidget)w)) :\ GetLayout(w)) #define LayoutG(w) (XmIsGadget(w) ? \ ((XmGadget)w)->gadget.layout_direction : \ GetLayout(w)) #define LayoutIsRtoL(w) \ (XmDirectionMatchPartial(GetLayout(w), XmRIGHT_TO_LEFT, XmHORIZONTAL_MASK)) #define LayoutIsRtoLM(w) \ (XmDirectionMatchPartial(LayoutM(w), XmRIGHT_TO_LEFT, XmHORIZONTAL_MASK)) #define LayoutIsRtoLP(w) \ (XmDirectionMatchPartial(LayoutP(w), XmRIGHT_TO_LEFT, XmHORIZONTAL_MASK)) #define LayoutIsRtoLG(w) \ (XmDirectionMatchPartial(LayoutG(w), XmRIGHT_TO_LEFT, XmHORIZONTAL_MASK)) /******** Private Function Declarations for Direction.c ********/ extern void _XmDirectionDefault(Widget widget, int offset, XrmValue *value ); extern void _XmFromLayoutDirection( Widget widget, int offset, XtArgVal *value) ; extern XmImportOperator _XmToLayoutDirection( Widget widget, int offset, XtArgVal *value) ; extern XmDirection _XmGetLayoutDirection(Widget w); /******** Private Function Declarations for thickness ********/ extern void _XmSetThickness( Widget widget, int offset, XrmValue *value) ; extern void _XmSetThicknessDefault0( Widget widget, int offset, XrmValue *value) ; /******** Private Function Declarations for Xm.c ********/ extern void _XmReOrderResourceList( WidgetClass widget_class, String res_name, String insert_after) ; extern void _XmSocorro( Widget w, XEvent *event, String *params, Cardinal *num_params) ; extern Boolean _XmParentProcess( Widget widget, XmParentProcessData data) ; extern void _XmClearShadowType( Widget w, #if NeedWidePrototypes int old_width, int old_height, int old_shadow_thickness, int old_highlight_thickness) ; #else Dimension old_width, Dimension old_height, Dimension old_shadow_thickness, Dimension old_highlight_thickness) ; #endif /* NeedWidePrototypes */ #ifdef NO_XM_1_2_BC extern void _XmDestroyParentCallback( Widget w, XtPointer client_data, XtPointer call_data) ; #endif extern Time _XmValidTimestamp( Widget w); extern void _XmWarningMsg(Widget w, char *type, char *message, char **params, Cardinal num_params); extern Display *_XmGetDefaultDisplay(void); extern Boolean _XmIsISO10646(Display *dpy, XFontStruct *font); extern XChar2b* _XmUtf8ToUcs2(char *draw_text, size_t seg_len, size_t *ret_str_len); /******** End Private Function Declarations ********/ /******** Conditionally defined macros for thread_safe Motif ******/ #if defined(XTHREADS) && defined(XUSE_MTSAFE_API) # define _XmWidgetToAppContext(w) \ XtAppContext app = XtWidgetToApplicationContext(w) # define _XmDisplayToAppContext(d) \ XtAppContext app = XtDisplayToApplicationContext(d) # define _XmAppLock(app) XtAppLock(app) # define _XmAppUnlock(app) XtAppUnlock(app) # define _XmProcessLock() XtProcessLock() # define _XmProcessUnlock() XtProcessUnlock() /* Remove use of _XtProcessLock when Xt provides API to query its MT-status */ extern void (*_XtProcessLock)(); # define _XmIsThreadInitialized() (_XtProcessLock) #else # define _XmWidgetToAppContext(w) # define _XmDisplayToAppContext(d) # define _XmAppLock(app) # define _XmAppUnlock(app) # define _XmProcessLock() # define _XmProcessUnlock() # define _XmIsThreadInitialized() (FALSE) #endif /* XTHREADS && XUSE_MTSAFE_API */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #define FIX_1396 #ifdef FIX_1381 extern Pixel _XmAssignInsensitiveColor(Widget w); #endif #define FIX_1375 #define FIX_1395 #define FIX_1388 #define FIX_1398 #define FIX_1402 #define FIX_1445 #define FIX_1474 #define FIX_1501 #define FIX_1521 #define FIX_1505 #endif /* _XmI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/CutPasteI.h0000644000175000017500000000234012672140200012720 00000000000000/* $XConsortium: CutPasteI.h /main/5 1995/07/15 20:50:21 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmCutPasteI_H #define _XmCutPasteI_H #include #ifdef __cplusplus extern "C" { #endif void _XmClipboardPassType(Atom); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmCutPasteI_H */ motif-2.3.8/lib/Xm/MenuStateI.h0000644000175000017500000000343512672140200013103 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: MenuStateI.h /main/5 1995/07/13 17:36:46 drk $ */ #ifndef _XmMenuStateI_h #define _XmMenuStateI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern Widget _XmGetRC_PopupPosted ( Widget wid) ; extern Boolean _XmGetInDragMode( Widget widget) ; extern void _XmSetInDragMode( Widget widget, #if NeedWidePrototypes int mode) ; #else Boolean mode) ; #endif /* NeedWidePrototypes */ extern XmMenuState _XmGetMenuState( Widget widget) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuStateI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ClipWindTI.h0000644000175000017500000000301312672140200013023 00000000000000/* $XConsortium: ClipWindTI.h /main/1 1996/10/10 11:36:14 cde-osf $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED */ #ifndef _XmClipWindowTI_H #define _XmClipWindowTI_H #include #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark _XmQTclipWindow; /* Version 0: initial release. */ typedef struct _XmClipWindowTraitRec { int version; /* 0 */ } XmClipWindowTraitRec, *XmClipWindowTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmClipWindowTI_H */ motif-2.3.8/lib/Xm/DragIconI.h0000644000175000017500000000312612672140200012661 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: DragIconI.h /main/6 1995/07/14 10:25:29 drk $ */ #ifndef _XmDragIconI_h #define _XmDragIconI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmDestroyDefaultDragIcon(XmDragIconObject icon) ; extern Boolean _XmDragIconIsDirty(XmDragIconObject icon) ; extern void _XmDragIconClean(XmDragIconObject icon1, XmDragIconObject icon2, XmDragIconObject icon3) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDragIconI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/PushBGP.h0000644000175000017500000001431413145162623012344 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmPButtonGP_h #define _XmPButtonGP_h #include #include #ifdef __cplusplus extern "C" { #endif /*************************************************************/ /* The PushButton Gadget Cache Object's class and instance records*/ /*************************************************************/ typedef struct _XmPushButtonGCacheObjClassPart { int foo; } XmPushButtonGCacheObjClassPart; typedef struct _XmPushButtonGCacheObjClassRec { ObjectClassPart object_class; XmExtClassPart ext_class; XmLabelGCacheObjClassPart label_class_cache; XmPushButtonGCacheObjClassPart pushbutton_class_cache; } XmPushButtonGCacheObjClassRec; externalref XmPushButtonGCacheObjClassRec xmPushButtonGCacheObjClassRec; typedef struct _XmPushButtonGCacheObjPart { Boolean fill_on_arm; Pixel arm_color; Pixmap arm_pixmap; Pixmap unarm_pixmap; unsigned char multiClick; /* KEEP/DISCARD resource */ Dimension default_button_shadow_thickness; /* New resource - always add it to gadget's dimension. */ GC fill_gc; GC background_gc; /* following items have some persistence across gadget instances and are ** here only for data-space savings */ XtIntervalId timer; Widget timer_widget; } XmPushButtonGCacheObjPart; typedef struct _XmPushButtonGCacheObjRec { ObjectPart object; XmExtPart ext; XmLabelGCacheObjPart label_cache; XmPushButtonGCacheObjPart pushbutton_cache; } XmPushButtonGCacheObjRec; /* PushButton class structure */ typedef struct _XmPushButtonGadgetClassPart { XtPointer extension; /* Pointer to extension record */ } XmPushButtonGadgetClassPart; /* Full class record declaration for PushButton class */ typedef struct _XmPushButtonGadgetClassRec { RectObjClassPart rect_class; XmGadgetClassPart gadget_class; XmLabelGadgetClassPart label_class; XmPushButtonGadgetClassPart pushbutton_class; } XmPushButtonGadgetClassRec; externalref XmPushButtonGadgetClassRec xmPushButtonGadgetClassRec; /* PushButton instance record */ typedef struct _XmPushButtonGadgetPart { XtCallbackList activate_callback; XtCallbackList arm_callback; XtCallbackList disarm_callback; Dimension show_as_default; Boolean armed; int click_count; Boolean compatible; /* if false it is Motif 1.1 else Motif 1.0 */ /* not cached for performance reasons */ XmPushButtonGCacheObjPart *cache; /* Replace cache instance fields */ /* with a pointer */ } XmPushButtonGadgetPart; /* Full instance record declaration */ typedef struct _XmPushButtonGadgetRec { ObjectPart object; RectObjPart rectangle; XmGadgetPart gadget; XmLabelGadgetPart label; XmPushButtonGadgetPart pushbutton; } XmPushButtonGadgetRec; /* MACROS */ /**********/ /* Macros for cached instance fields */ #define PBG_FillOnArm(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->fill_on_arm) #define PBG_ArmColor(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->arm_color) #define PBG_FillGc(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->fill_gc) #define PBG_BackgroundGc(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->background_gc) #define PBG_Timer(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->timer) #define PBG_ArmPixmap(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->arm_pixmap) #define PBG_UnarmPixmap(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->unarm_pixmap) #define PBG_MultiClick(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->multiClick) #define PBG_DefaultButtonShadowThickness(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.cache->default_button_shadow_thickness) /* Macros for uncached instance fields */ #define PBG_ActivateCallback(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.activate_callback) #define PBG_ArmCallback(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.arm_callback) #define PBG_DisarmCallback(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.disarm_callback) #define PBG_Armed(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.armed) #define PBG_ClickCount(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.click_count) #define PBG_Compatible(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.compatible) #define PBG_ShowAsDefault(w) (((XmPushButtonGadget) (w)) -> \ pushbutton.show_as_default) /******************************/ /* Convenience Macros */ /******************************/ #define PBG_Cache(w) (((XmPushButtonGadget)(w))->\ pushbutton.cache) #define PBG_ClassCachePart(w) \ (((XmPushButtonGadgetClass)xmPushButtonGadgetClass)->gadget_class.cache_part) /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmPButtonGP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TabList.h0000644000175000017500000001027012672140200012422 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifndef _Xm_TabList_h_ #define _Xm_TabList_h_ #include #ifdef __cplusplus extern "C" { #endif #define XmCOLOR_DYNAMIC ((Pixel)-1) #define XmPIXMAP_DYNAMIC ((Pixmap) 3) #define XmTAB_LAST_POSITION -1 #define XmTAB_NOT_FOUND -1 #define XmTAB_LABEL_STRING (1L<<0) #define XmTAB_LABEL_PIXMAP (1L<<1) #define XmTAB_PIXMAP_PLACEMENT (1L<<2) #define XmTAB_BACKGROUND (1L<<3) #define XmTAB_FOREGROUND (1L<<4) #define XmTAB_VALUE_MODE (1L<<5) #define XmTAB_LABEL_ALIGNMENT (1L<<6) #define XmTAB_STRING_DIRECTION (1L<<7) #define XmTAB_BACKGROUND_PIXMAP (1L<<8) #define XmTAB_SENSITIVE (1L<<9) #define XmTAB_ALL_FLAGS (XmTAB_LABEL_STRING|XmTAB_LABEL_PIXMAP|\ XmTAB_PIXMAP_PLACEMENT|XmTAB_BACKGROUND|\ XmTAB_FOREGROUND|XmTAB_VALUE_MODE|\ XmTAB_LABEL_ALIGNMENT|XmTAB_STRING_DIRECTION|\ XmTAB_BACKGROUND_PIXMAP|XmTAB_SENSITIVE) typedef struct _XmTabAttributeRec { XmString label_string; /* default: NULL */ XmStringDirection string_direction; /* default: XmSTRING_DIRECTION_L_TO_R*/ Pixmap label_pixmap; /* default: XmUNSPECIFIED_PIXMAP */ int label_alignment; /* default: XmALIGNEMENT_CENTER */ XmPixmapPlacement pixmap_placement; /* default: XmPIXMAP_RIGHT */ Pixel foreground; /* default: XmCOLOR_DYNAMIC */ Pixel background; /* default: XmCOLOR_DYNAMIC */ Pixmap background_pixmap;/* default: XmPIXMAP_DYNAMIC */ Boolean sensitive; /* default: True */ XmTabValueMode value_mode; /* default: XmTAB_VALUE_COPY */ } XmTabAttributeRec, * XmTabAttributes; typedef struct _XmTabbedStackListRec *XmTabbedStackList; XmTabbedStackList XmTabbedStackListCreate( #ifndef _NO_PROTO void #endif ); XmTabbedStackList XmTabbedStackListCopy( #ifndef _NO_PROTO XmTabbedStackList #endif ); void XmTabbedStackListFree( #ifndef _NO_PROTO XmTabbedStackList #endif ); void XmTabbedStackListRemove( #ifndef _NO_PROTO XmTabbedStackList, int #endif ); int XmTabbedStackListInsert( #ifndef _NO_PROTO XmTabbedStackList, int, XtValueMask, XmTabAttributes #endif ); int XmTabbedStackListAppend( #ifndef _NO_PROTO XmTabbedStackList, XtValueMask, XmTabAttributes #endif ); void XmTabbedStackListModify( #ifndef _NO_PROTO XmTabbedStackList, int, XtValueMask, XmTabAttributes #endif ); void XmTabbedStackListQuery( #ifndef _NO_PROTO XmTabbedStackList, int, XmTabAttributes #endif ); int XmTabbedStackListFind( #ifndef _NO_PROTO XmTabbedStackList, XmString #endif ); void XmTabbedStackListSimpleRemove( #ifndef _NO_PROTO XmTabbedStackList, XmString #endif ); int XmTabbedStackListSimpleInsert( #ifndef _NO_PROTO XmTabbedStackList, int, XmString #endif ); int XmTabbedStackListSimpleAppend( #ifndef _NO_PROTO XmTabbedStackList, XmString #endif ); void XmTabbedStackListSimpleModify( #ifndef _NO_PROTO XmTabbedStackList, int, XmString #endif ); XmString XmTabbedStackListSimpleQuery( #ifndef _NO_PROTO XmTabbedStackList, int #endif ); XmTabResult XmTabbedStackListCompare( #ifndef _NO_PROTO XmTabbedStackList, XmTabbedStackList #endif ); void XmTabAttibutesFree( #ifndef _NO_PROTO XmTabAttributes #endif ); #ifdef __cplusplus } /* Closes scope of 'extern "C"' declaration */ #endif #endif motif-2.3.8/lib/Xm/RCMenuI.h0000644000175000017500000001333012672140200012322 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: RCMenuI.h /main/5 1995/07/13 17:45:45 drk $ */ #ifndef _XmRCMenuI_h #define _XmRCMenuI_h #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _XmMenuBtnUp( Widget wid, XEvent *event, String *params, Cardinal *num_params); extern void _XmMenuBtnDown( Widget wid, XEvent *event, String *params, Cardinal *num_params); extern void _XmHandleMenuButtonPress( Widget wid, XEvent *event); extern Boolean _XmMatchBDragEvent( Widget wid, XEvent *event); extern Boolean _XmMatchBSelectEvent( Widget wid, XEvent *event); extern void _XmGetActiveTopLevelMenu( Widget wid, Widget *rwid); extern void _XmMenuFocus( Widget w, int operation, Time _time ); extern void _XmSetSwallowEventHandler( Widget widget, #if NeedWidePrototypes int add_handler ); #else Boolean add_handler ); #endif /* NeedWidePrototypes */ extern void _XmMenuPopDown( Widget w, XEvent *event, Boolean *popped_up ); extern Boolean _XmGetPopupMenuClick( Widget wid ); extern void _XmSetPopupMenuClick( Widget wid, #if NeedWidePrototypes int popupMenuClick); #else Boolean popupMenuClick); #endif /* NeedWidePrototypes */ extern void _XmRC_DoProcessMenuTree( Widget w, int mode) ; extern void _XmRC_ProcessSingleWidget( Widget w, int mode) ; extern void _XmRC_AddToPostFromList( XmRowColumnWidget m, Widget widget) ; extern void _XmRC_UpdateOptionMenuCBG( Widget cbg, Widget memWidget) ; extern void _XmRC_SetMenuHistory( XmRowColumnWidget m, RectObj child) ; extern void _XmRC_SetOptionMenuHistory( XmRowColumnWidget m, RectObj child) ; extern void _XmRCMenuProcedureEntry( int proc, Widget widget, ... ) ; extern void _XmRCArmAndActivate( Widget w, XEvent *event, String *parms, Cardinal *num_parms ); extern void _XmRCGetTopManager( Widget w, Widget *topManager ) ; extern void _XmMenuFocusOut( Widget cb, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmMenuFocusIn( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmGetMenuKidMargins( XmRowColumnWidget m, Dimension *width, Dimension *height, Dimension *left, Dimension *right, Dimension *top, Dimension *bottom) ; extern void _XmMenuUnmap( Widget wid, XEvent *event, String *param, Cardinal *num_param) ; extern void _XmMenuBarGadgetSelect( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmMenuGadgetTraverseCurrent( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmMenuGadgetTraverseCurrentUp( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern void _XmMenuGadgetDrag( Widget wid, XEvent *event, String *params, Cardinal *num_params) ; extern int _XmRC_PopupMenuHandler(Widget, XEvent*); extern Boolean _XmRC_PostTimeOut( XtPointer wid ); extern void _XmRC_RemoveHandlersFromPostFromWidget( Widget popup, Widget widget) ; extern void _XmRC_AddPopupEventHandlers( XmRowColumnWidget pane) ; extern void _XmRC_RemovePopupEventHandlers( XmRowColumnWidget pane) ; void _XmRC_RemoveFromPostFromList( XmRowColumnWidget m, Widget widget) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRCMenuI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/RepType.c0000644000175000017500000015672613145162623012475 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: RepType.c /main/17 1997/09/15 10:10:39 cshi $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "RepTypeI.h" #include "MessagesI.h" #include /* for (indirectly) atoi() */ #include #include #include #include "XmI.h" #define MESSAGE0 _XmMMsgRepType_0000 #define MESSAGE1 _XmMMsgRepType_0001 #define MESSAGE2 _XmMMsgRepType_0002 /* INSTRUCTIONS to add a statically-stored representation type: * (For dynamically allocated/created representation types, see the * man page for XmRepTypeRegister). * * 1) Determine whether or not the numerical values of the representation * type can be enumerated with consecutive numerical values beginning * with value zero. If this is the case, continue with step 2). * * If this is not the case, the representation type needs an extra * array in the data structure to map the numerical resource value to * the array position of the value name in the representation type data * structures. If the representation type must be mapped in this way, * go to step 2M). * * 2) Define a static array of the names of the values for the * representation type in RepType.c. Use the representation type name, * plus the suffix "Names" for the name of the array (see existing name * arrays for an example). The ordering of the value names in this * array determines the numerical value of each name, beginning with * zero and incrementing consecutively. * * 3) Add an enumeration symbol for the ID number of the representation * type in the enum statement in the RepTypeI.h module. * Keep the enum alphabetically sorted. * * Note: if the numerical value is int sized or will be put into an * int sized field, then the ID number of representation type * needs to also be added to the "special case for int * sized fields" clause in the ConvertRepType function below. * * 4) Add an element to the static array of representation type data * structures named "_XmStandardRepTypes". Use the same format as the * other elements in the array; the fields which are initialized with * FALSE and NULL should be the same for all elements of the array. * Always add the new entry sorted in the array. * * 5) You're done. A generic "string to representation type" converter * for the representation type that you just added will be automatically * registered when all other Xm converters are registered. * ******** For "mapped" representation types: ******** * * 2M) Define a static array of the numerical values for the * representation type in RepType.c. Use the enumerated symbols * (generally defined in Xm.h) to initialize the array of numerical * values. Use the representation type name, plus the suffix "Map" * for the name of the array (see existing map arrays for an example). * * 3M) Go to 2). * ************************************************************************* * * NOTE: We have decided to use the reptype mechanism for action parameter * symbolic names. In order to capture the name of the widget class, the * name of the action the parameters apply to and the fact that this reptype * is for parameters to an action, the names tend to be rather long. This * is a feature not a bug. Furthermore, we decided not to create new * XmR types for each reptype which serves that purpose. To that end, I * have hardcoded strings in the reptype table where the XmR value would * normally go. */ /******** Static Function Declarations ********/ static String * CopyStringArray( String *StrArray, unsigned char NumEntries, Boolean UppercaseFormat) ; static void CopyRecord( XmRepTypeEntry OutputEntry, String rep_type_name, String *value_names, unsigned char *values, unsigned char num_values, Boolean reverse_installed, XmRepTypeId rep_type_id, Boolean copy_in) ; static Boolean ValuesConsecutiveStartingAtZero( unsigned char *values, unsigned char num_values) ; static XmRepTypeEntry GetRepTypeRecord( XmRepTypeId rep_type_id) ; static Boolean ConvertRepType( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; static Boolean ReverseConvertRepType( Display *disp, XrmValue *args, Cardinal *n_args, XrmValue *from, XrmValue *to, XtPointer *converter_data) ; /******** End Static Function Declarations ********/ /*** For consistency with the enum and array declaration, keep these declarations sorted. Put the map array right after the string array if any. ***/ static XmConst char *XmConst AlignmentNames[] = { "alignment_beginning", "alignment_center", "alignment_end" } ; static XmConst char *XmConst AnimationStyleNames[] = { "drag_under_none", "drag_under_pixmap", "drag_under_shadow_in", "drag_under_shadow_out", "drag_under_highlight" }; static XmConst char *XmConst ArrowDirectionNames[] = { "arrow_up", "arrow_down", "arrow_left", "arrow_right" } ; static XmConst char *XmConst ArrowLayoutNames[] = { "arrows_end", "arrows_beginning", "arrows_split", "arrows_flat_end", "arrows_flat_beginning" }; static XmConst char *XmConst ArrowOrientationNames[] = { "arrows_vertical", "arrows_horizontal" }; static XmConst char *XmConst ArrowSensitivityNames[] = { "arrows_insensitive", /* 0b000 */ "arrows_increment_sensitive", /* 0b001 */ "arrows_decrement_sensitive", /* 0b010 */ "arrows_sensitive", /* 0b011 */ "arrows_default_sensitivity" /* 0b100 Inherit */ }; static XmConst char *XmConst AttachmentNames[] = { "attach_none", "attach_form", "attach_opposite_form", "attach_widget", "attach_opposite_widget", "attach_position", "attach_self" } ; static XmConst char *XmConst AudibleWarningNames[] = { "none", "bell" } ; static XmConst char *XmConst AutoDragModelNames[] = { "auto_drag_enabled", "auto_drag_disabled", } ; static XmConst char *XmConst AutomaticSelectionNames[] = { "no_auto_select", "auto_select", XtEoff, XtEfalse, XtEno, "0", XtEon, XtEtrue, XtEyes, "1" } ; static XmConst unsigned char AutomaticSelectionMap[] = { XmNO_AUTO_SELECT, XmAUTO_SELECT, XmNO_AUTO_SELECT, XmNO_AUTO_SELECT, XmNO_AUTO_SELECT, XmNO_AUTO_SELECT, XmAUTO_SELECT, XmAUTO_SELECT, XmAUTO_SELECT, XmAUTO_SELECT } ; static XmConst char *XmConst BindingTypeNames[] = { "none", "pixmap", "solid", "spiral", "pixmap_overlap_only" } ; static XmConst char *XmConst BitmapConversionModelNames[] = { "match_depth", "dynamic_depth" } ; static XmConst char *XmConst BlendModelNames[] = { "blend_all", "blend_state_source", "blend_just_source", "blend_none" } ; #define ChildHorizontalAlignmentNames AlignmentNames static XmConst char *XmConst ChildPlacementNames[] = { "place_top", "place_above_selection", "place_below_selection" } ; static XmConst char *XmConst ChildTypeNames[] = { "frame_generic_child", "frame_workarea_child", "frame_title_child" } ; static XmConst char *XmConst ChildVerticalAlignmentNames[] = { "alignment_baseline_top", "alignment_center", "alignment_baseline_bottom", "alignment_widget_top", "alignment_widget_bottom", "alignment_child_top", "alignment_child_bottom" } ; static XmConst unsigned char ChildVerticalAlignmentMap[] = { XmALIGNMENT_BASELINE_TOP, XmALIGNMENT_CENTER, XmALIGNMENT_BASELINE_BOTTOM, XmALIGNMENT_WIDGET_TOP, XmALIGNMENT_WIDGET_BOTTOM, XmALIGNMENT_CHILD_TOP, XmALIGNMENT_CHILD_BOTTOM } ; static XmConst char *XmConst ComboBoxListActionActionParamNames[] = { "up", "down", "listprevpage", "listnextpage", "listbegindata", "listenddata" } ; static XmConst char *XmConst ComboBoxTypeNames[] = { "combo_box", "drop_down_combo_box", "drop_down_list" } ; static XmConst char *XmConst CommandSelectionBoxUpOrDownActionParamNames[] = { "previous", "next", "first", "last" } ; static XmConst char *XmConst CommandWindowLocationNames[] = { "command_above_workspace", "command_below_workspace" } ; static XmConst char *XmConst ContainerCursorActionParamNames[] = { "left", "right", "up", "down", "first", "last" } ; static XmConst char *XmConst ContainerExpandCollapseActionParamNames[] = { "left", "right", "collapse", "expand" } ; static XmConst char *XmConst ContainerStartTransferActionParamNames[] = { "link", "move", "copy" } ; static XmConst char *XmConst DefaultButtonEmphasisNames[] = { "external_highlight", "internal_highlight" } ; static XmConst char *XmConst DefaultButtonTypeNames[] = { "dialog_none", "dialog_cancel_button", "dialog_ok_button", "dialog_help_button" } ; static XmConst unsigned char DefaultButtonTypeMap[] = { XmDIALOG_NONE, XmDIALOG_CANCEL_BUTTON, XmDIALOG_OK_BUTTON, XmDIALOG_HELP_BUTTON } ; static XmConst char *XmConst DeleteResponseNames[] = { "destroy", "unmap", "do_nothing" } ; static XmConst char *XmConst DialogStyleNames[] = { "dialog_modeless", "dialog_work_area", "dialog_primary_application_modal", "dialog_application_modal", "dialog_full_application_modal", "dialog_system_modal" } ; static XmConst unsigned char DialogStyleMap[] = { XmDIALOG_MODELESS, XmDIALOG_WORK_AREA, XmDIALOG_PRIMARY_APPLICATION_MODAL, XmDIALOG_APPLICATION_MODAL, XmDIALOG_FULL_APPLICATION_MODAL, XmDIALOG_SYSTEM_MODAL } ; static XmConst char *XmConst DialogTypeNames[] = { "dialog_template", "dialog_error", "dialog_information", "dialog_message", "dialog_question", "dialog_warning", "dialog_working" } ; static XmConst char *XmConst DirectionNames[] = { "left_to_right", "right_to_left", "left_to_right_top_to_bottom", "right_to_left_top_to_bottom", "left_to_right_bottom_to_top", "right_to_left_bottom_to_top", "top_to_bottom_left_to_right", "top_to_bottom_right_to_left", "bottom_to_top_left_to_right", "bottom_to_top_right_to_left" } ; static XmConst unsigned char DirectionMap[] = { XmLEFT_TO_RIGHT, XmRIGHT_TO_LEFT, XmLEFT_TO_RIGHT_TOP_TO_BOTTOM, XmRIGHT_TO_LEFT_TOP_TO_BOTTOM, XmLEFT_TO_RIGHT_BOTTOM_TO_TOP, XmRIGHT_TO_LEFT_BOTTOM_TO_TOP, XmTOP_TO_BOTTOM_LEFT_TO_RIGHT, XmTOP_TO_BOTTOM_RIGHT_TO_LEFT, XmBOTTOM_TO_TOP_LEFT_TO_RIGHT, XmBOTTOM_TO_TOP_RIGHT_TO_LEFT }; static XmConst char *XmConst DragInitiatorProtocolStyleNames[] = { "drag_none", "drag_drop_only", "drag_prefer_preregister", "drag_preregister", "drag_prefer_dynamic", "drag_dynamic", "drag_prefer_receiver" }; static XmConst char *XmConst DragReceiverProtocolStyleNames[] = { "drag_none", "drag_drop_only", "drag_prefer_preregister", "drag_preregister", "drag_prefer_dynamic", "drag_dynamic" }; static XmConst char *XmConst DropSiteActivityNames[] = { "drop_site_active", "drop_site_inactive", "drop_site_ignore" }; static XmConst char *XmConst DropSiteTypeNames[] = { "drop_site_simple", "drop_site_composite" }; static XmConst char *XmConst EditModeNames[] = { "multi_line_edit", "single_line_edit" } ; static XmConst char *XmConst EnableBtn1Names[] = { XtEfalse, XtEtrue, XtEoff, "button2_adjust", "button2_transfer" }; static XmConst unsigned char EnableBtn1Map[] = { XmOFF, XmBUTTON2_ADJUST, XmOFF, XmBUTTON2_ADJUST, XmBUTTON2_TRANSFER }; static XmConst char *XmConst EnableWarpNames[] = { "enable_warp_on", "enable_warp_off", } ; static XmConst char *XmConst EntryViewTypeNames[] = { "large_icon", "small_icon", "any_icon" } ; static XmConst char *XmConst FileFilterStyleNames[] = { "filter_none", "filter_hidden_files" } ; static XmConst char *XmConst FileSelectionBoxUpOrDownActionParamNames[] = { "previous", "next", "first", "last" } ; static XmConst char *XmConst FileTypeMaskNames[] = { "file_directory", "file_regular", "file_any_type" } ; static XmConst unsigned char FileTypeMaskMap[] = { XmFILE_DIRECTORY, XmFILE_REGULAR, XmFILE_ANY_TYPE } ; static XmConst char *XmConst FontTypeNames[] = { "font_is_font", "font_is_fontset", "as_is", "font_is_xft" } ; static XmConst unsigned char FontTypeMap[] = { XmFONT_IS_FONT, XmFONT_IS_FONTSET, XmAS_IS, XmFONT_IS_XFT } ; static XmConst char *XmConst IconAttachmentNames[] = { "attach_north_west", "attach_north", "attach_north_east", "attach_east", "attach_south_east", "attach_south", "attach_south_west", "attach_west", "attach_center", "attach_hot" } ; static XmConst char *XmConst IndicatorOnNames[] = { "indicator_none", "indicator_fill", "indicator_box", "indicator_check", "indicator_check_box", "indicator_cross", "indicator_cross_box", XtEoff, XtEfalse, XtEno, XtEon, XtEtrue, XtEyes }; static XmConst unsigned char IndicatorOnMap[] = { XmINDICATOR_NONE, XmINDICATOR_FILL, XmINDICATOR_BOX, XmINDICATOR_CHECK, XmINDICATOR_CHECK_BOX, XmINDICATOR_CROSS, XmINDICATOR_CROSS_BOX, XmINDICATOR_NONE, XmINDICATOR_NONE, XmINDICATOR_NONE, XmINDICATOR_FILL, XmINDICATOR_FILL, XmINDICATOR_FILL }; static XmConst char *XmConst IndicatorTypeNames[] = { "n_of_many", "one_of_many", "one_of_many_round", "one_of_many_diamond" } ; static XmConst unsigned char IndicatorTypeMap[] = { XmN_OF_MANY, XmONE_OF_MANY, XmONE_OF_MANY_ROUND, XmONE_OF_MANY_DIAMOND } ; static XmConst char *XmConst InputPolicyNames[] = { "per_shell", "per_widget" } ; static XmConst char *XmConst KeyboardFocusPolicyNames[] = { "explicit", "pointer" } ; static XmConst char *XmConst LabelTypeNames[] = { "pixmap", "string", "pixmap_and_string" } ; static XmConst unsigned char LabelTypeMap[] = { XmPIXMAP, XmSTRING, XmPIXMAP_AND_STRING } ; static XmConst char *XmConst LayoutTypeNames[] = { "outline", "spatial", "detail" } ; static XmConst char *XmConst LineStyleNames[] = { "no_line", "single" } ; static XmConst char *XmConst LineTypeNames[] = { "no_line", "single_line", "double_line", "single_dashed_line", "double_dashed_line", "as_is" } ; static XmConst unsigned char LineTypeMap[] = { XmNO_LINE, XmSINGLE_LINE, XmDOUBLE_LINE, XmSINGLE_DASHED_LINE, XmDOUBLE_DASHED_LINE, XmAS_IS } ; static XmConst char *XmConst ListSizePolicyNames[] = { "variable", "constant", "resize_if_possible" } ; static XmConst char *XmConst LoadModelNames[] = { "load_deferred", "load_immediate", "as_is" } ; static XmConst unsigned char LoadModelMap[] = { XmLOAD_DEFERRED, XmLOAD_IMMEDIATE, XmAS_IS } ; static XmConst char *XmConst MatchBehaviorNames[] = { "none", "quick_navigate" } ; static XmConst char *XmConst MultiClickNames[] = { "multiclick_discard", "multiclick_keep" } ; static XmConst char *XmConst NavigationTypeNames[] = { "none", "tab_group", "sticky_tab_group", "exclusive_tab_group" } ; static XmConst char *XmConst NotebookChildTypeNames[] = { "none", "page", "major_tab", "minor_tab", "status_area", "page_scroller" } ; static XmConst char *XmConst NotebookTraverseTabActionParamNames[] = { "home", "end", "next", "previous" } ; static XmConst char *XmConst OrientationNames[] = { XtEvertical, XtEhorizontal } ; static XmConst unsigned char OrientationMap[] = { XmVERTICAL, XmHORIZONTAL } ; static XmConst char *XmConst OutlineButtonPolicyNames[] = { "outline_button_present", "outline_button_absent" } ; static XmConst char *XmConst OutlineStateNames[] = { "collapsed", "expanded" } ; static XmConst char *XmConst PackingNames[] = { "pack_tight", "pack_column", "pack_none" } ; static XmConst unsigned char PackingMap[] = { XmPACK_TIGHT, XmPACK_COLUMN, XmPACK_NONE } ; static XmConst char *XmConst PanedWindowSashActionParamNames[] = { "start", "move", "commit", "key" }; static XmConst char *XmConst PanedWindowSashDirectionActionParamNames[] = { "up", "down", "right", "left", "first", "last" }; static XmConst char *XmConst PanedWindowSashIncrementActionParamNames[] = { "defaultincr", "largeincr" }; static XmConst char *XmConst PathModeNames[] = { "path_mode_full", "path_mode_relative" } ; static XmConst char *XmConst PositionModeNames[] = { "zero_based", "one_based" }; static XmConst char *XmConst PositionTypeNames[] = { "position_index", "position_value" }; static XmConst char *XmConst PrimaryOwnershipNames[] = { "own_never", "own_always", "own_multiple", "own_possible_multiple" } ; static XmConst char *XmConst ProcessingDirectionNames[] = { "max_on_top", "max_on_bottom", "max_on_left", "max_on_right" } ; static XmConst char *XmConst ResizePolicyNames[] = { "resize_none", "resize_grow", "resize_any" } ; static XmConst char *XmConst RowColumnTypeNames[] = { "work_area", "menu_bar", "menu_pulldown", "menu_popup", "menu_option" } ; static XmConst char *XmConst ScrollBarDisplayPolicyNames[] = { "static", "as_needed" } ; static XmConst char *XmConst ScrollBarIncrementDownOrRightActionParamNames[] = { "down", "right" } ; static XmConst char *XmConst ScrollBarIncrementUpOrLeftActionParamNames[] = { "up", "left" } ; static XmConst char *XmConst ScrollBarPageDownOrRightActionParamNames[] = { "down", "right" } ; static XmConst char *XmConst ScrollBarPageUpOrLeftActionParamNames[] = { "up", "left" } ; static XmConst char *XmConst ScrollBarPlacementNames[] = { "bottom_right", "top_right", "bottom_left", "top_left" } ; /* NOTE: work_area, menu_bar and separator have to match the existing ones */ static XmConst char *XmConst ScrolledWindowChildTypeNames[] = { "work_area", "menu_bar", "hor_scrollbar", "vert_scrollbar", "command_window", "separator", "message_window", "scroll_hor", "scroll_vert", "no_scroll", "clip_window", "generic_child" } ; static XmConst char *XmConst ScrollingPolicyNames[] = { "automatic", "application_defined" } ; static XmConst char *XmConst SelectionBoxUpOrDownActionParamNames[] = { "previous", "next", "first", "last" } ; static XmConst char *XmConst SelectionModeNames[] = { "normal_mode", "add_mode" } ; static XmConst char *XmConst SelectionPolicyNames[] = { "single_select", "multiple_select", "extended_select", "browse_select" } ; static XmConst char *XmConst SelectionTechniqueNames[] = { "marquee", "marquee_extend_start", "marquee_extend_both", "touch_only", "touch_over" } ; static XmConst char *XmConst SelectionTypeNames[] = { "dialog_work_area", "dialog_prompt", "dialog_selection", "dialog_command", "dialog_file_selection" } ; static XmConst char *XmConst SeparatorTypeNames[] = { "no_line", "single_line", "double_line", "single_dashed_line", "double_dashed_line", "shadow_etched_in", "shadow_etched_out", "shadow_etched_in_dash", "shadow_etched_out_dash" } ; static XmConst char *XmConst SetNames[] = { "unset", "set", "indeterminate", XtEoff, XtEfalse, XtEno, "0", XtEon, XtEtrue, XtEyes, "1" } ; static XmConst unsigned char SetMap[] = { XmUNSET, XmSET, XmINDETERMINATE, XmUNSET, XmUNSET, XmUNSET, XmUNSET, XmSET, XmSET, XmSET, XmSET } ; static XmConst char *XmConst ShadowTypeNames[] = { "shadow_etched_in", "shadow_etched_out", "shadow_in", "shadow_out" } ; static XmConst unsigned char ShadowTypeMap[] = { XmSHADOW_ETCHED_IN, XmSHADOW_ETCHED_OUT, XmSHADOW_IN, XmSHADOW_OUT } ; static XmConst char *XmConst ShowArrowsNames[] = { "each_side", XtEtrue, XtEyes, XtEon, "1", "max_side", "min_side", "none", XtEfalse, XtEno, XtEoff, "0" } ; static XmConst unsigned char ShowArrowsMap[] = { 1,1,1,1,1, XmMAX_SIDE, XmMIN_SIDE, 0,0,0,0,0 } ; static XmConst char *XmConst ShowValueNames[] = { "near_slider", XtEtrue, XtEyes, XtEon, "1", "near_border", "none", XtEfalse, XtEno, XtEoff, "0" } ; static XmConst unsigned char ShowValueMap[] = { 1,1,1,1,1, XmNEAR_BORDER, 0,0,0,0,0 } ; static XmConst char *XmConst SliderMarkNames[] = { "none", "etched_line", "thumb_mark", "round_mark" } ; static XmConst char *XmConst SliderVisualNames[] = { "background", "foreground", "trough_color", "shadowed_background" } ; static XmConst char *XmConst SlidingModeNames[] = { "slider", "thermometer", } ; static XmConst char *XmConst SpatialIncludeModelNames[] = { "append", "closest", "first_fit" } ; static XmConst char *XmConst SpatialResizeModelNames[] = { "grow_minor", "grow_major", "grow_balanced" } ; static XmConst char *XmConst SpatialSnapModelNames[] = { "none", "snap_to_grid", "center" } ; static XmConst char *XmConst SpatialStyleNames[] = { "none", "grid", "cells" } ; static XmConst char *XmConst SpinBoxChildTypeNames[] = { "string", "numeric", }; static XmConst unsigned char SpinBoxChildTypeMap[] = { (unsigned char) XmSTRING, (unsigned char) XmNUMERIC, }; static XmConst char *XmConst StringDirectionNames[] = { "string_direction_l_to_r", "string_direction_r_to_l" } ; static XmConst char *XmConst TearOffModelNames[] = { "tear_off_enabled", "tear_off_disabled" } ; static XmConst char *XmConst TextExtendMovementActionParamNames[] = { "extend" } ; static XmConst char *XmConst TextFieldExtendMovementActionParamNames[] = { "extend" } ; static XmConst char *XmConst TextFieldDirectionActionParamNames[] = { "right", "left" } ; static XmConst char *XmConst TextHorizontalDirectionActionParamNames[] = { "right", "left" } ; static XmConst char *XmConst TextVerticalDirectionActionParamNames[] = { "up", "down" } ; static XmConst char *XmConst ToggleModeNames[] = { "toggle_boolean", "toggle_indeterminate" } ; static XmConst char *XmConst UnitTypeNames[] = { "pixels", "100th_millimeters", "1000th_inches", "100th_points", "100th_font_units", "inches", "centimeters", "millimeters", "points", "font_units" } ; static XmConst char *XmConst UnpostBehaviorNames[] = { "unpost", "unpost_and_replay" } ; static XmConst char *XmConst VerticalAlignmentNames[] = { "alignment_baseline_top", "alignment_center", "alignment_baseline_bottom", "alignment_contents_top", "alignment_contents_bottom" } ; static XmConst char *XmConst ViewTypeNames[] = { "large_icon", "small_icon" } ; static XmConst char *XmConst VisualEmphasisNames[] = { "selected", "not_selected" }; static XmConst char *XmConst VisualPolicyNames[] = { "variable", "constant" } ; static XmConst char *XmConst WhichButtonNames[] = { "button1", "1", "button2", "2", "button3", "3", "button4", "4", "button5", "5" } ; static XmConst unsigned char WhichButtonMap[] = { Button1, Button1, Button2, Button2, Button3, Button3, Button4, Button4, Button5, Button5 } ; static XmConst char *XmConst PixmapPlacementNames[] = { "top", "bottom", "left", "right" } ; static XmConst unsigned char PixmapPlacementMap[] = { XmPIXMAP_TOP, XmPIXMAP_BOTTOM, XmPIXMAP_LEFT, XmPIXMAP_RIGHT } ; /* Note that this array does not initialize rep_type_id fields, * for this field is useless. It always matches the index of the * entry in the array. We have to keep the field since the structure * is public. For the API, rep_type_id is set on query. */ static XmRepTypeEntryRec StandardRepTypes[] = { { XmRAlignment, (String*)AlignmentNames, NULL, XtNumber(AlignmentNames), FALSE, }, { XmRAnimationStyle, (String*)AnimationStyleNames, NULL, XtNumber(AnimationStyleNames), FALSE, }, { XmRArrowDirection, (String*)ArrowDirectionNames, NULL, XtNumber(ArrowDirectionNames), FALSE, }, { XmRArrowLayout, (String*)ArrowLayoutNames, NULL, XtNumber(ArrowLayoutNames), FALSE, }, { XmRArrowOrientation, (String*)ArrowOrientationNames, NULL, XtNumber(ArrowOrientationNames), FALSE, }, { XmRArrowSensitivity, (String*)ArrowSensitivityNames, NULL, XtNumber(ArrowSensitivityNames), FALSE, }, { XmRAttachment, (String*)AttachmentNames, NULL, XtNumber(AttachmentNames), FALSE, }, { XmRAudibleWarning, (String*)AudibleWarningNames, NULL, XtNumber(AudibleWarningNames), FALSE, }, { XmRAutoDragModel, (String*)AutoDragModelNames, NULL, XtNumber(AutoDragModelNames), FALSE, }, { XmRAutomaticSelection, (String*)AutomaticSelectionNames, (unsigned char *)AutomaticSelectionMap, XtNumber(AutomaticSelectionNames), FALSE, }, { XmRBindingType, (String*)BindingTypeNames, NULL, XtNumber(BindingTypeNames), FALSE, }, { XmRBitmapConversionModel, (String*)BitmapConversionModelNames, NULL, XtNumber(BitmapConversionModelNames), FALSE, }, { XmRBlendModel, (String*)BlendModelNames, NULL, XtNumber(BlendModelNames), FALSE, }, { XmRChildHorizontalAlignment, (String*)ChildHorizontalAlignmentNames, NULL, XtNumber(ChildHorizontalAlignmentNames), FALSE, }, { XmRChildPlacement, (String*)ChildPlacementNames, NULL, XtNumber(ChildPlacementNames), FALSE, }, { XmRChildType, (String*)ChildTypeNames, NULL, XtNumber(ChildTypeNames), FALSE, }, { XmRChildVerticalAlignment, (String*)ChildVerticalAlignmentNames, (unsigned char *)ChildVerticalAlignmentMap, XtNumber(ChildVerticalAlignmentNames), FALSE, }, { "ComboBoxListActionActionParam", /* See instructions above. */ (String*)ComboBoxListActionActionParamNames, NULL, XtNumber(ComboBoxListActionActionParamNames), TRUE, }, { XmRComboBoxType, (String*)ComboBoxTypeNames, NULL, XtNumber(ComboBoxTypeNames), FALSE, }, { "CommandSelectionBoxUpOrDownActionParam", (String*)CommandSelectionBoxUpOrDownActionParamNames, NULL, XtNumber(CommandSelectionBoxUpOrDownActionParamNames), TRUE, }, { XmRCommandWindowLocation, (String*)CommandWindowLocationNames, NULL, XtNumber(CommandWindowLocationNames), FALSE, }, { "ContainerCursorActionParam", /* See instructions above. */ (String*)ContainerCursorActionParamNames, NULL, XtNumber(ContainerCursorActionParamNames), TRUE, }, { "ContainerExpandCollapseActionParamName", /* See instructions above. */ (String*)ContainerExpandCollapseActionParamNames, NULL, XtNumber(ContainerExpandCollapseActionParamNames), TRUE, }, { "ContainerStartTransferActionParam", /* See instructions above. */ (String*)ContainerStartTransferActionParamNames, NULL, XtNumber(ContainerStartTransferActionParamNames), TRUE, }, { XmRDefaultButtonEmphasis, (String*)DefaultButtonEmphasisNames, NULL, XtNumber(DefaultButtonEmphasisNames), FALSE, }, { XmRDefaultButtonType, (String*)DefaultButtonTypeNames, (unsigned char *)DefaultButtonTypeMap, XtNumber(DefaultButtonTypeNames), FALSE, }, { XmRDeleteResponse, (String*)DeleteResponseNames, NULL, XtNumber(DeleteResponseNames), FALSE, }, { XmRDialogStyle, (String*)DialogStyleNames, (unsigned char *)DialogStyleMap, XtNumber(DialogStyleNames), FALSE, }, { XmRDialogType, (String*)DialogTypeNames, NULL, XtNumber(DialogTypeNames), FALSE, }, { XmRDirection, (String*)DirectionNames, (unsigned char *)DirectionMap, XtNumber(DirectionNames), FALSE, }, { XmRDragInitiatorProtocolStyle, (String*)DragInitiatorProtocolStyleNames, NULL, XtNumber(DragInitiatorProtocolStyleNames), FALSE, }, { XmRDragReceiverProtocolStyle, (String*)DragReceiverProtocolStyleNames, NULL, XtNumber(DragReceiverProtocolStyleNames), FALSE, }, { XmRDropSiteActivity, (String*)DropSiteActivityNames, NULL, XtNumber(DropSiteActivityNames), FALSE, }, { XmRDropSiteType, (String*)DropSiteTypeNames, NULL, XtNumber(DropSiteTypeNames), FALSE, }, { XmREditMode, (String*)EditModeNames, NULL, XtNumber(EditModeNames), FALSE, }, { XmREnableBtn1Transfer, (String*)EnableBtn1Names, (unsigned char *) EnableBtn1Map, XtNumber(EnableBtn1Names), FALSE }, { XmREnableWarp, (String*)EnableWarpNames, NULL, XtNumber(EnableWarpNames), FALSE, }, { XmREntryViewType, (String*)EntryViewTypeNames, NULL, XtNumber(EntryViewTypeNames), FALSE, }, { XmRFileFilterStyle, (String*)FileFilterStyleNames, NULL, XtNumber(FileFilterStyleNames), FALSE, }, { "FileSelectionBoxUpOrDownActionParam", /* See instructions above. */ (String*)FileSelectionBoxUpOrDownActionParamNames, NULL, XtNumber(FileSelectionBoxUpOrDownActionParamNames), TRUE, }, { XmRFileTypeMask, (String*)FileTypeMaskNames, (unsigned char *)FileTypeMaskMap, XtNumber(FileTypeMaskNames), FALSE, }, { XmRFontType, (String*)FontTypeNames, (unsigned char *)FontTypeMap, XtNumber(FontTypeNames), FALSE, }, { XmRIconAttachment, (String*)IconAttachmentNames, NULL, XtNumber(IconAttachmentNames), FALSE, }, { XmRIndicatorOn, (String*)IndicatorOnNames, (unsigned char *)IndicatorOnMap, XtNumber(IndicatorOnNames), FALSE, }, { XmRIndicatorType, (String*)IndicatorTypeNames, (unsigned char *)IndicatorTypeMap, XtNumber(IndicatorTypeNames), FALSE, }, { XmRInputPolicy, (String*)InputPolicyNames, NULL, XtNumber(InputPolicyNames), FALSE, }, { XmRKeyboardFocusPolicy, (String*)KeyboardFocusPolicyNames, NULL, XtNumber(KeyboardFocusPolicyNames), FALSE, }, { XmRLabelType, (String*)LabelTypeNames, (unsigned char *)LabelTypeMap, XtNumber(LabelTypeNames), FALSE, }, { XmRLayoutType, (String*)LayoutTypeNames, NULL, XtNumber(LayoutTypeNames), FALSE, }, { XmRLineStyle, (String*)LineStyleNames, NULL, XtNumber(LineStyleNames), FALSE, }, { XmRLineType, (String*)LineTypeNames, (unsigned char *)LineTypeMap, XtNumber(LineTypeNames), FALSE, }, { XmRListSizePolicy, (String*)ListSizePolicyNames, NULL, XtNumber(ListSizePolicyNames), FALSE, }, { XmRLoadModel, (String*)LoadModelNames, (unsigned char *)LoadModelMap, XtNumber(LoadModelNames), FALSE, }, { XmRMatchBehavior, (String*)MatchBehaviorNames, NULL, XtNumber(MatchBehaviorNames), FALSE, }, { XmRMultiClick, (String*)MultiClickNames, NULL, XtNumber(MultiClickNames), FALSE, }, { XmRNavigationType, (String*)NavigationTypeNames, NULL, XtNumber(NavigationTypeNames), FALSE, }, { XmRNotebookChildType, (String*)NotebookChildTypeNames, NULL, XtNumber(NotebookChildTypeNames), FALSE, }, { "NotebookTraverseTabActionParam", /* See instructions above. */ (String*)NotebookTraverseTabActionParamNames, NULL, XtNumber(NotebookTraverseTabActionParamNames ), TRUE, }, { XmROrientation, (String*)OrientationNames, (unsigned char *)OrientationMap, XtNumber(OrientationNames), FALSE, }, { XmROutlineButtonPolicy, (String*)OutlineButtonPolicyNames, NULL, XtNumber(OutlineButtonPolicyNames), FALSE, }, { XmROutlineState, (String*)OutlineStateNames, NULL, XtNumber(OutlineStateNames), FALSE, }, { XmRPacking, (String*)PackingNames, (unsigned char *)PackingMap, XtNumber(PackingNames), FALSE, }, { "PanedWindowSashActionParam", /* See instructions above. */ (String*)PanedWindowSashActionParamNames, NULL, XtNumber(PanedWindowSashActionParamNames ), TRUE, }, { "PanedWindowSashDirectionActionParam", /* See instructions above. */ (String*)PanedWindowSashDirectionActionParamNames, NULL, XtNumber(PanedWindowSashDirectionActionParamNames ), TRUE, }, { "PanedWindowSashIncrementActionParam", /* See instructions above. */ (String*)PanedWindowSashIncrementActionParamNames, NULL, XtNumber(PanedWindowSashIncrementActionParamNames ), TRUE, }, { XmRPathMode, (String*)PathModeNames, NULL, XtNumber(PathModeNames), FALSE, }, { XmRPositionMode, (String*)PositionModeNames, NULL, XtNumber(PositionModeNames), FALSE, }, { XmRPositionType, (String*)PositionTypeNames, NULL, XtNumber(PositionTypeNames), FALSE, }, { XmRPrimaryOwnership, (String*)PrimaryOwnershipNames, NULL, XtNumber(PrimaryOwnershipNames), FALSE, }, { XmRProcessingDirection, (String*)ProcessingDirectionNames, NULL, XtNumber(ProcessingDirectionNames), FALSE, }, { XmRResizePolicy, (String*)ResizePolicyNames, NULL, XtNumber(ResizePolicyNames), FALSE, }, { XmRRowColumnType, (String*)RowColumnTypeNames, NULL, XtNumber(RowColumnTypeNames), FALSE, }, { XmRScrollBarDisplayPolicy, (String*)ScrollBarDisplayPolicyNames, NULL, XtNumber(ScrollBarDisplayPolicyNames), FALSE, }, { "ScrollBarIncrementDownOrRightActionParam", /* See instructions above. */ (String*)ScrollBarIncrementDownOrRightActionParamNames, NULL, XtNumber(ScrollBarIncrementDownOrRightActionParamNames), TRUE, }, { "ScrollBarIncrementUpOrLeftActionParam", /* See instructions above. */ (String*)ScrollBarIncrementUpOrLeftActionParamNames, NULL, XtNumber(ScrollBarIncrementUpOrLeftActionParamNames), TRUE, }, { "ScrollBarPageDownOrRightActionParam", /* See instructions above. */ (String*)ScrollBarPageDownOrRightActionParamNames, NULL, XtNumber(ScrollBarPageDownOrRightActionParamNames), TRUE, }, { "ScrollBarPageUpOrLeftActionParam", /* See instructions above. */ (String*)ScrollBarPageUpOrLeftActionParamNames, NULL, XtNumber(ScrollBarPageUpOrLeftActionParamNames), TRUE, }, { XmRScrollBarPlacement, (String*)ScrollBarPlacementNames, NULL, XtNumber(ScrollBarPlacementNames), FALSE, }, { XmRScrolledWindowChildType, (String*)ScrolledWindowChildTypeNames, NULL, XtNumber(ScrolledWindowChildTypeNames), FALSE, }, { XmRScrollingPolicy, (String*)ScrollingPolicyNames, NULL, XtNumber(ScrollingPolicyNames), FALSE, }, { "SelectionBoxUpOrDownActionParam", /* See instructions above. */ (String*)SelectionBoxUpOrDownActionParamNames, NULL, XtNumber(SelectionBoxUpOrDownActionParamNames), TRUE, }, { XmRSelectionMode, (String*)SelectionModeNames, NULL, XtNumber(SelectionModeNames), FALSE, }, { XmRSelectionPolicy, (String*)SelectionPolicyNames, NULL, XtNumber(SelectionPolicyNames), FALSE, }, { XmRSelectionTechnique, (String*)SelectionTechniqueNames, NULL, XtNumber(SelectionTechniqueNames), FALSE, }, { XmRSelectionType, (String*)SelectionTypeNames, NULL, XtNumber(SelectionTypeNames), FALSE, }, { XmRSeparatorType, (String*)SeparatorTypeNames, NULL, XtNumber(SeparatorTypeNames), FALSE, }, { XmRSet, (String*)SetNames, (unsigned char *)SetMap, XtNumber(SetNames), FALSE, }, { XmRShadowType, (String*)ShadowTypeNames, (unsigned char *)ShadowTypeMap, XtNumber(ShadowTypeNames), FALSE, }, { XmRShowArrows, (String*)ShowArrowsNames, (unsigned char *)ShowArrowsMap, XtNumber(ShowArrowsNames), FALSE, }, { XmRShowValue, (String*)ShowValueNames, (unsigned char *)ShowValueMap, XtNumber(ShowValueNames), FALSE, }, { XmRSliderMark, (String*)SliderMarkNames, NULL, XtNumber(SliderMarkNames), FALSE, }, { XmRSliderVisual, (String*)SliderVisualNames, NULL, XtNumber(SliderVisualNames), FALSE, }, { XmRSlidingMode, (String*)SlidingModeNames, NULL, XtNumber(SlidingModeNames), FALSE, }, { XmRSpatialIncludeModel, (String*)SpatialIncludeModelNames, NULL, XtNumber(SpatialIncludeModelNames), FALSE, }, { XmRSpatialResizeModel, (String*)SpatialResizeModelNames, NULL, XtNumber(SpatialResizeModelNames), FALSE, }, { XmRSpatialSnapModel, (String*)SpatialSnapModelNames, NULL, XtNumber(SpatialSnapModelNames), FALSE, }, { XmRSpatialStyle, (String*)SpatialStyleNames, NULL, XtNumber(SpatialStyleNames), FALSE, }, { XmRSpinBoxChildType, (String*)SpinBoxChildTypeNames, (unsigned char *)SpinBoxChildTypeMap, XtNumber(SpinBoxChildTypeNames), FALSE, }, { XmRStringDirection, (String*)StringDirectionNames, NULL, XtNumber(StringDirectionNames), FALSE, }, { XmRTearOffModel, (String*)TearOffModelNames, NULL, XtNumber(TearOffModelNames), FALSE, }, { "TextExtendMovementActionParam", /* See instructions above. */ (String*)TextExtendMovementActionParamNames, NULL, XtNumber(TextExtendMovementActionParamNames ), TRUE, }, { "TextFieldDirectionActionParam", /* See instructions above. */ (String*)TextFieldDirectionActionParamNames, NULL, XtNumber(TextFieldDirectionActionParamNames ), TRUE, }, { "TextFieldExtendMovementActionParam", /* See instructions above. */ (String*)TextFieldExtendMovementActionParamNames, NULL, XtNumber(TextFieldExtendMovementActionParamNames ), FALSE, }, { "TextHorizontalDirectionActionParam", /* See instructions above. */ (String*)TextHorizontalDirectionActionParamNames, NULL, XtNumber(TextHorizontalDirectionActionParamNames ), TRUE, }, { "TextVerticalDirectionActionParam", /* See instructions above. */ (String*)TextVerticalDirectionActionParamNames, NULL, XtNumber(TextVerticalDirectionActionParamNames ), TRUE, }, { XmRToggleMode, (String*)ToggleModeNames, NULL, XtNumber(ToggleModeNames), FALSE, }, { XmRUnitType, (String*)UnitTypeNames, NULL, XtNumber(UnitTypeNames), FALSE, }, { XmRUnpostBehavior, (String*)UnpostBehaviorNames, NULL, XtNumber(UnpostBehaviorNames), FALSE, }, { XmRVerticalAlignment, (String*)VerticalAlignmentNames, NULL, XtNumber(VerticalAlignmentNames), FALSE, }, { XmRViewType, (String*)ViewTypeNames, NULL, XtNumber(ViewTypeNames), FALSE, }, { XmRVisualEmphasis, (String*)VisualEmphasisNames, NULL, XtNumber(VisualEmphasisNames), FALSE, }, { XmRVisualPolicy, (String*)VisualPolicyNames, NULL, XtNumber(VisualPolicyNames), FALSE, }, { XmRWhichButton, (String*)WhichButtonNames, (unsigned char *)WhichButtonMap, XtNumber(WhichButtonNames), FALSE, }, { XmRPixmapPlacement, (String*)PixmapPlacementNames, (unsigned char *)PixmapPlacementMap, XtNumber(PixmapPlacementNames), FALSE, } } ; static XmConst Cardinal StandardNumRecs = XtNumber( StandardRepTypes ); static XmRepTypeEntryRec *DynamicRepTypes = NULL; static Cardinal DynamicRepTypeNumRecords = 0; static String * CopyStringArray( String *StrArray, unsigned char NumEntries, Boolean UppercaseFormat) { unsigned int Index ; String * TmpStr ; int PrefixSize = 0 ; TmpStr = (String *) XtMalloc((NumEntries + 1) * sizeof(String)); TmpStr[NumEntries] = NULL ; if (UppercaseFormat) PrefixSize = 2 ; Index = 0 ; while(Index < NumEntries) { TmpStr[Index] = XtMalloc(PrefixSize + strlen(StrArray[Index]) + 1); strcpy(TmpStr[Index] + PrefixSize, StrArray[Index]); Index ++ ; } if (UppercaseFormat) { Index = 0 ; while( Index < NumEntries) { Cardinal i ; TmpStr[Index][0] = 'X' ; TmpStr[Index][1] = 'm' ; i = 2 ; while (TmpStr[Index][i]) { if (islower(TmpStr[Index][i])) TmpStr[Index][i] = toupper(TmpStr[Index][i]); i++; } ++Index ; } } return( TmpStr) ; } static void CopyRecord( XmRepTypeEntry OutputEntry, String rep_type_name, String *value_names, unsigned char *values, unsigned char num_values, Boolean reverse_installed, XmRepTypeId rep_type_id, Boolean copy_in) { OutputEntry->rep_type_name = XtNewString(rep_type_name) ; OutputEntry->value_names = CopyStringArray(value_names, num_values, False); /* only when the record is copied out to the app we want to create a array of consecutive values */ if (values || !copy_in) OutputEntry->values = (unsigned char *) XtMalloc(sizeof(unsigned char)*num_values); else OutputEntry->values = NULL; if (values) { memcpy(OutputEntry->values, values, (size_t)num_values); } else if (!copy_in) { Cardinal i ; for (i=0; ivalues[i] = i ; } OutputEntry->num_values = num_values ; OutputEntry->reverse_installed = reverse_installed ; OutputEntry->rep_type_id = rep_type_id ; } static Boolean ValuesConsecutiveStartingAtZero( unsigned char *values, unsigned char num_values) { if( values ) { while( num_values-- ) { if( num_values != values[num_values] ) { return( FALSE) ; } } } return( TRUE) ; } static XmRepTypeEntry GetRepTypeRecord( XmRepTypeId rep_type_id) { if (rep_type_id < StandardNumRecs) { return (XmRepTypeEntry) &StandardRepTypes[rep_type_id]; } if (rep_type_id < DynamicRepTypeNumRecords + StandardNumRecs) { return &DynamicRepTypes[rep_type_id - StandardNumRecs]; } return (XmRepTypeEntry)NULL ; } XmRepTypeId XmRepTypeRegister( String rep_type_name, String *value_names, unsigned char *values, #if NeedWidePrototypes unsigned int num_values) #else unsigned char num_values) #endif /* NeedWidePrototypes */ { XmRepTypeEntry NewRecord ; XtConvertArgRec convertArg; XmRepTypeId reptype_id; if (!num_values || !rep_type_name || !value_names) return( XmREP_TYPE_INVALID) ; _XmProcessLock(); /** expand the dynamic table */ DynamicRepTypes = (XmRepTypeList) XtRealloc( (char *) DynamicRepTypes, (sizeof(XmRepTypeEntryRec) * (DynamicRepTypeNumRecords + 1))) ; /** fill in the new record */ NewRecord = &DynamicRepTypes[DynamicRepTypeNumRecords] ; /* the new reptype ID values are located after the standard ones */ CopyRecord(NewRecord, rep_type_name, value_names, (ValuesConsecutiveStartingAtZero( values, num_values)) ? NULL:values, num_values, False, DynamicRepTypeNumRecords + StandardNumRecs, True); /** register the converter to Xt */ convertArg.address_mode = XtImmediate; convertArg.address_id = (XPointer)(long)NewRecord->rep_type_id; convertArg.size = sizeof(convertArg.address_id); XtSetTypeConverter( XmRString, NewRecord->rep_type_name, ConvertRepType, &convertArg, 1, XtCacheNone, NULL) ; DynamicRepTypeNumRecords++ ; reptype_id = NewRecord->rep_type_id; _XmProcessUnlock(); /*XmRepTypeAddReverse(reptype_id);*/ return reptype_id; } void XmRepTypeAddReverse( #if NeedWidePrototypes int rep_type_id) #else XmRepTypeId rep_type_id) #endif { XtConvertArgRec convertArg; XmRepTypeEntry Record; _XmProcessLock(); Record = GetRepTypeRecord( rep_type_id); if( Record && !Record->reverse_installed ) { convertArg.address_mode = XtImmediate; convertArg.address_id = (XPointer)(long)rep_type_id; convertArg.size = sizeof(convertArg.address_id); XtSetTypeConverter( Record->rep_type_name, XmRString, ReverseConvertRepType, &convertArg, 1, XtCacheNone, NULL) ; Record->reverse_installed = TRUE ; } _XmProcessUnlock(); return ; } Boolean XmRepTypeValidValue( #if NeedWidePrototypes int rep_type_id, unsigned int test_value, #else XmRepTypeId rep_type_id, unsigned char test_value, #endif Widget enable_default_warning) { XmRepTypeEntry Record; _XmProcessLock(); Record = GetRepTypeRecord( rep_type_id); if (!Record) { _XmProcessUnlock(); if (enable_default_warning) { XmeWarning(enable_default_warning, MESSAGE1); } return FALSE; } else { if (Record->values) { unsigned int Index; for (Index=0; Index < Record->num_values; Index++ ) { if (Record->values[Index] == test_value) { _XmProcessUnlock(); return(TRUE) ; } } } else if (test_value < Record->num_values) { _XmProcessUnlock(); return (TRUE) ; } if (enable_default_warning) { char *params[2]; params[0] = (char *)(long)test_value; params[1] = Record->rep_type_name; _XmProcessUnlock(); _XmWarningMsg(enable_default_warning, "illegalRepTypeValue", MESSAGE2, params, 2) ; return FALSE; } } _XmProcessUnlock(); return FALSE ; } XmRepTypeList XmRepTypeGetRegistered( void ) { unsigned int TotalEntries ; XmRepTypeList OutputList ; unsigned int Index ; /* Total up the data sizes of the static and run-time lists. */ _XmProcessLock(); TotalEntries = StandardNumRecs + DynamicRepTypeNumRecords ; OutputList = (XmRepTypeList) XtMalloc((TotalEntries + 1) * sizeof(XmRepTypeEntryRec)) ; for ( Index = 0; Index < StandardNumRecs; Index++ ) { XmRepTypeEntry Record = (XmRepTypeEntry) &(StandardRepTypes[Index]); CopyRecord(&(OutputList[Index]), Record->rep_type_name, Record->value_names, Record->values, Record->num_values, Record->reverse_installed, Index, False) ; } for ( Index = 0; Index < DynamicRepTypeNumRecords; Index++ ) { XmRepTypeEntry Record = &(DynamicRepTypes[Index]) ; CopyRecord(&(OutputList[StandardNumRecs + Index]), Record->rep_type_name, Record->value_names, Record->values, Record->num_values, Record->reverse_installed, Index + StandardNumRecs, False) ; } OutputList[TotalEntries].rep_type_name = NULL ; _XmProcessUnlock(); return(OutputList) ; } XmRepTypeEntry XmRepTypeGetRecord( #if NeedWidePrototypes int rep_type_id) #else XmRepTypeId rep_type_id) #endif { XmRepTypeEntry Record; XmRepTypeEntry OutputRecord ; _XmProcessLock(); Record = GetRepTypeRecord( rep_type_id); if( Record ) { OutputRecord = (XmRepTypeEntry) XtMalloc(sizeof( XmRepTypeEntryRec)) ; CopyRecord(OutputRecord, Record->rep_type_name, Record->value_names, Record->values, Record->num_values, Record->reverse_installed, rep_type_id, False) ; _XmProcessUnlock(); return( OutputRecord) ; } _XmProcessUnlock(); return( NULL) ; } XmRepTypeId XmRepTypeGetId( String rep_type_name) { Cardinal Index ; _XmProcessLock(); /* First look in the statically defined lists */ /* Just an ordered search, could do better, but this routine is probably not be worth it */ for ( Index = 0; Index < StandardNumRecs ; Index++ ) { int compare_name = strcmp(rep_type_name, StandardRepTypes[Index].rep_type_name ) ; if(compare_name == 0) { _XmProcessUnlock(); return Index; } else if (compare_name < 0) break ; } /* Not in the static list; look in the run-time list. */ /* This one is not ordered: have to go thru */ for ( Index = 0; Index < DynamicRepTypeNumRecords; Index++ ) { if( !strcmp( rep_type_name, DynamicRepTypes[Index].rep_type_name )) { _XmProcessUnlock(); return Index + StandardNumRecs ; } } _XmProcessUnlock(); return( XmREP_TYPE_INVALID) ; } String * XmRepTypeGetNameList( #if NeedWidePrototypes int rep_type_id, int use_uppercase_format) #else XmRepTypeId rep_type_id, Boolean use_uppercase_format) #endif /* NeedWidePrototypes */ { XmRepTypeEntry Record; String *name_list = NULL; _XmProcessLock(); Record = GetRepTypeRecord( rep_type_id); if(Record) { name_list = CopyStringArray(Record->value_names, Record->num_values, use_uppercase_format); } _XmProcessUnlock(); return name_list; } /*ARGSUSED*/ static Boolean ConvertRepType( Display *disp, XrmValue *args, Cardinal *n_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { char *in_str = (char *) (from->addr) ; XtPointer argvalue = *((XtPointer*)args[0].addr); XmRepTypeId RepTypeID = (XmRepTypeId)(long)argvalue; XmRepTypeEntry Record; Cardinal Index = 0 ; _XmProcessLock(); Record = GetRepTypeRecord( RepTypeID); while(Index < Record->num_values) { if(XmeNamesAreEqual( in_str, Record->value_names[Index])) { if ((RepTypeID == XmRID_EDIT_MODE) || (RepTypeID == XmRID_WHICH_BUTTON) || (RepTypeID == XmRID_FONT_TYPE)) { /* special case for int sized fields */ int conversion_buffer ; conversion_buffer = (int) ((Record->values) ? Record->values[Index] : Index) ; _XmProcessUnlock(); _XM_CONVERTER_DONE (to, int, conversion_buffer, ;) } else { unsigned char conversion_buffer ; conversion_buffer = (unsigned char) ((Record->values) ? Record->values[Index] : Index) ; _XmProcessUnlock(); _XM_CONVERTER_DONE (to, unsigned char, conversion_buffer, ;) } } ++Index ; } _XmProcessUnlock(); XtDisplayStringConversionWarning( disp, in_str, Record->rep_type_name); return( FALSE) ; } /*ARGSUSED*/ static Boolean ReverseConvertRepType( Display *disp, XrmValue *args, Cardinal *n_args, /* unused */ XrmValue *from, XrmValue *to, XtPointer *converter_data) /* unused */ { XtPointer argvalue = *(XtPointer *)args[0].addr; XmRepTypeId RepTypeID = (XmRepTypeId)(long)argvalue; XmRepTypeEntry Record; unsigned char in_value = *(unsigned char *) from->addr ; unsigned short NumValues; char **OutValue = NULL ; String in_str ; String reverse_message = MESSAGE0 ; _XmProcessLock(); Record = GetRepTypeRecord( RepTypeID); NumValues = Record->num_values; if(Record->values) { /* mapped type */ unsigned short Index = 0 ; while(Index < NumValues ) { if(in_value == Record->values[Index] ) { OutValue = (char **) &Record->value_names[Index] ; break ; } ++Index ; } } else { if( in_value < NumValues ) { OutValue = (char **) &Record->value_names[in_value] ; } } _XmProcessUnlock(); #if 0 if (OutValue) _XM_CONVERTER_DONE (to, String, *OutValue, ;) #else if (OutValue) { if (to->addr) { if (to->size < sizeof(String)) { to->size = sizeof(String); return(False); } else { to->addr = (XtPointer)*OutValue; } } else { to->addr = (XtPointer)OutValue; } to->size = sizeof(String); return(True); } #endif /** generate a message and display it */ in_str = (char *) XtMalloc (strlen(reverse_message) + 10) ; sprintf(in_str, "%s %d", reverse_message, in_value); XtDisplayStringConversionWarning( disp, in_str, Record->rep_type_name) ; return( FALSE) ; } void _XmRepTypeInstallConverters( void ) { unsigned short Index = XmRID_UNIT_TYPE ; XtConvertArgRec convertArg; /* in order to be able to implement the XmCvtStringToUnitType converter as using the native code in RepType, we must have a different unit type converter name to refer to from ResConvert.c when calling XtConvertAndStore */ convertArg.address_mode = XtImmediate; convertArg.address_id = (XPointer)(long)Index; convertArg.size = sizeof(convertArg.address_id); XtSetTypeConverter(XmRString, REAL_UNIT_TYPE_NAME, ConvertRepType, &convertArg, 1, XtCacheNone, NULL) ; /* Install the static consecutive-valued converters. */ for ( Index = 0; Index < StandardNumRecs; Index ++ ) { /* Special case the record used for the action param, where we don't need to install the converter. For these, we have used the reverse_installed field set to True to notify this routine not to install them */ if (StandardRepTypes[Index].reverse_installed) continue ; /* only update the index data, the other field are already good */ convertArg.address_id = (XPointer)(long)Index; XtSetTypeConverter(XmRString, StandardRepTypes[Index].rep_type_name, ConvertRepType, &convertArg, 1, XtCacheNone, NULL) ; XmRepTypeAddReverse(Index); } } void XmRepTypeInstallTearOffModelConverter( void ) { /* Obsolete, we now do this by default */ } /* * Given a rep_type_id and a string parameter, this function tries to * find the reptype value for that string. The resulting reptype value is * returned in result. For backwards compatibility, the string parameter * for some actions could be a numeric rather than an alphabetic string * (i.e. "0"). If an action parameter reptype is able to accept a * numeric, then pass True for the can_be_numeric parameter. This will * cause the function to first parse the string as a numeric. If it * succeeds in doing so, it checks to verify that the value is a valid * value for the given reptype. If it can't parse the string as a * numeric, it tries to do the rep type lookup. If both fail, it returns * False and does not set result. If either succeeds, it returns True and * sets the result parameter to be the resulting numeric value. The * widget parameter is used by various warning message functions so any * widget may be passed. */ Boolean _XmConvertActionParamToRepTypeId(Widget widget, XmRepTypeId rep_type_id, char *parameter, Boolean can_be_numeric, int *result) { int value, i; XtPointer aligned_value; XrmValue args, from, to; /* If the parameter can be numeric (for backward compatibility) then try to convert the parameter to a number */ if (can_be_numeric) { value = i = 0; while (isspace(parameter[i])) ++i; /* skip leading white space */ if (isdigit(parameter[i])) { value = atoi(parameter + i); /* If the number was converted, verify that it is a valid value for the reptype. If so return it in the result argument and return True. Otherwise, don't set the result argument and return False. */ if (XmRepTypeValidValue(rep_type_id, value, widget)) { *result = value; return(True); } return(False); } } /* If we made it this far, then the parameter can't be numeric or can be numeric but we were unable to parse it as such. Try to convert the parameter via the rep type converters. */ args.size = sizeof(rep_type_id); aligned_value = (XtPointer)(long)(rep_type_id); args.addr = (char*)(&aligned_value); from.size = sizeof(char *); from.addr = parameter; to.size = sizeof(unsigned char); to.addr = (XPointer) &value; if (ConvertRepType(XtDisplay(widget), &args, NULL, &from, &to, NULL)) { /* We converted okay. Set up result and return True. */ *result = *((unsigned char *)(to.addr)); return(True); } /* All conversions failed. Just return False. */ return(False); } #ifdef DEBUG void _XmCheckStandardNumRecs() { Cardinal Index ; XmRepTypeEntry Record, PrevRecord = NULL ; for ( Index = 0; Index < StandardNumRecs; Index++ ) { Record = &(StandardRepTypes[Index]) ; printf("Record[%d]: %s", Index, Record->rep_type_name) ; if (PrevRecord) if (strcmp(Record->rep_type_name, PrevRecord->rep_type_name) <= 0) printf(" ** UNSORTED ENTRY **"); printf("\n"); PrevRecord = Record ; } } #endif motif-2.3.8/lib/Xm/Makefile.am0000644000175000017500000002555213175710762012773 00000000000000XMSTRING_LIST = xmstring.list MAINTAINERCLEANFILES = Makefile.in CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = xmstring.list Xm.msg \ XmStrDefs.ct INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \ -DINCDIR=\"@INCDIR@\" \ -DLIBDIR=\"@LIBDIR@\" \ ${X_CFLAGS} xmdir = $(includedir)/Xm libXm_la_LDFLAGS = -version-info @CURRENT@:@REVISION@:@AGE@ lib_LTLIBRARIES = libXm.la TIP_SRCS = ToolTip.c TIP_HDRS = ToolTipI.h EXTRA_HDRS = Ext.h ExtP.h \ Column.h ColumnP.h \ ButtonBox.h ButtonBoxP.h \ ColorS.h ColorSP.h \ Picture.h PictureP.h DataF.h DataFP.h DataFSelP.h \ Ext18List.h Ext18ListP.h MultiList.h MultiListP.h \ Paned.h PanedP.h FontS.h FontSP.h \ IconBox.h IconBoxP.h IconButton.h IconButtonP.h xmlist.h \ Hierarchy.h HierarchyP.h Outline.h OutlineP.h \ TabBox.h TabBoxP.h TabStack.h TabStackP.h \ TabList.h DrawUtils.h Tree.h TreeP.h \ ComboBox2.h ComboBox2P.h DropDown.h DropDownP.h \ ToolTipT.h ToolTipCT.h EXTRA_SRCS = XmExtUtil.c \ Column.c ButtonBox.c ColorS.c Picture.c DataFSel.c DataF.c \ MultiList.c I18List.c Paned.c FontS.c IconBox.c IconButton.c xmlist.c \ Hierarchy.c Outline.c TabBox.c TabList.c TabStack.c \ DrawUtils.c Tree.c DropDown.c \ XmStrDefs.ht XmStrDefs22.ht XmStrDefs23.ht XmStrDefsI.ht SLIDE_HDRS = SlideC.h SlideCP.h SLIDE_SRCS = SlideC.c if OM_XMU EDITRES_SRCS = EditresCom.c else EDITRES_SRCS = endif if OM_LIBJPEG JPEG_SRCS = Jpeg.c JPEG_HDRS = JpegI.h else JPEG_SRCS = JPEG_HDRS = endif if OM_LIBPNG PNG_SRCS = Png.c PNG_HDRS = PngI.h else PNG_SRCS = PNG_HDRS = endif if PRINTING PRINTS_SRC = PrintS.c else PRINTS_SRC = endif libXm_la_LIBADD = ${X_LIBS} ${X_XMU} -lXt -lXext ${LIB_XP} -lX11 ${X_EXTRA_LIBS} noinst_HEADERS = BaseClassI.h \ BitmapsI.h \ BulletinBI.h \ CacheI.h \ CallbackI.h \ CareVisualTI.h \ CascadeBGI.h \ CascadeBI.h \ ClipWindTI.h \ CntrbmI.h \ ColorI.h \ ColorObjI.h \ CommandI.h \ CutPasteI.h \ DestI.h \ DisplayI.h \ DragBSI.h \ DragCI.h \ DragICCI.h \ DragIconI.h \ DragOverSI.h \ DragUnderI.h \ DrawI.h \ DrawingAI.h \ DropSMgrI.h \ ExtObjectI.h \ GMUtilsI.h \ GadgetI.h \ GadgetUtiI.h \ GeoUtilsI.h \ HashI.h \ IconGI.h \ ImageCachI.h \ LabelGI.h \ LabelI.h \ ManagerI.h \ MapEventsI.h \ MenuProcI.h \ MenuShellI.h \ MenuStateI.h \ MenuUtilI.h \ MessageBI.h \ MessagesI.h \ PixConvI.h \ PrimitiveI.h \ PrintSI.h \ ProtocolsI.h \ RCHookI.h \ RCLayoutI.h \ RCMenuI.h \ ReadImageI.h \ RegionI.h \ RepTypeI.h \ ResConverI.h \ ResEncodI.h \ ResIndI.h \ RowColumnI.h \ ScreenI.h \ ScrollFramTI.h \ ScrolledWI.h \ SelectioBI.h \ SeparatoGI.h \ SyntheticI.h \ TearOffI.h \ TextDIconI.h \ TextFI.h \ TextFSelI.h \ TextI.h \ TextInI.h \ TextOutI.h \ TextSelI.h \ TextStrSoI.h \ ToggleBGI.h \ TraitI.h \ TransferI.h \ TravActI.h \ TraversalI.h \ UniqueEvnI.h \ VaSimpleI.h \ VendorSEI.h \ VendorSI.h \ VirtKeysI.h \ XmI.h \ XmImI.h \ XmMsgI.h \ XmRenderTI.h \ XmStrDefsI.h \ XmStringI.h \ XmTabListI.h \ XmosI.h \ XpmI.h \ EditresComI.h \ $(JPEG_HDRS) \ $(PNG_HDRS) \ $(TIP_HDRS) xm_HEADERS = ArrowB.h ArrowBG.h ArrowBGP.h ArrowBP.h \ BulletinB.h BulletinBP.h CacheP.h CascadeB.h \ CascadeBG.h CascadeBGP.h CascadeBP.h Command.h \ CommandP.h CutPaste.h DialogS.h \ DialogSP.h DialogSEP.h DragC.h DragCP.h \ DragDrop.h DragIcon.h DragIconP.h DragOverS.h \ DragOverSP.h DropTransP.h DropSMgr.h DropSMgrP.h \ DropTrans.h DrawingA.h DrawingAP.h DrawnB.h \ DrawnBP.h FileSB.h FileSBP.h Form.h \ FormP.h Frame.h FrameP.h Label.h \ LabelG.h LabelGP.h LabelP.h List.h \ ListP.h MainW.h MainWP.h MenuShell.h \ MenuShellP.h MessageB.h MessageBP.h PanedW.h \ PanedWP.h PushB.h PushBG.h PushBGP.h \ PushBP.h RCLayoutP.h RowColumn.h RowColumnP.h \ SashP.h Scale.h ScaleP.h ScrollBar.h \ ScrollBarP.h ScrolledW.h ScrolledWP.h SelectioB.h \ SelectioBP.h SeparatoG.h SeparatoGP.h Separator.h \ SeparatorP.h TextF.h TextFP.h TextFSelP.h \ TextSelP.h Text.h TextInP.h TextOutP.h \ TextP.h TextStrSoP.h ToggleB.h ToggleBG.h \ ToggleBGP.h ToggleBP.h XmP.h \ BaseClassP.h ManagerP.h PrimitiveP.h GadgetP.h \ XmStrDefs.h XmStrDefs22.h XmStrDefs23.h \ VaSimpleP.h VirtKeys.h VirtKeysP.h \ ExtObjectP.h Display.h DisplayP.h Screen.h \ ScreenP.h ShellEP.h VendorS.h VendorSP.h \ VendorSEP.h DesktopP.h AtomMgr.h \ Protocols.h ProtocolsP.h MwmUtil.h TransltnsP.h \ RepType.h XmosP.h Xmos_r.h DrawP.h \ Xmpoll.h TearOffP.h \ TearOffBP.h MenuUtilP.h MenuT.h XmAll.h \ TraitP.h SpinB.h SpinBP.h SSpinB.h \ SSpinBP.h \ Container.h ContainerP.h IconG.h IconGP.h \ Notebook.h NotebookP.h ContItemT.h ContainerT.h \ RCMenuP.h ClipWindowP.h TransferT.h \ Transfer.h AccTextT.h NavigatorT.h IconFileP.h\ ScrollFrameT.h GrabShell.h GrabShellP.h ComboBox.h \ ComboBoxP.h XmIm.h IconFile.h AccColorT.h\ ActivatableT.h JoinSideT.h SpecRenderT.h \ CareVisualT.h DialogSavvyT.h TransferP.h TakesDefT.h \ ColorP.h Primitive.h Manager.h \ Gadget.h LayoutT.h IconH.h IconHP.h \ UnitTypeT.h TxtPropCv.h MenuProcP.h MenuStateP.h\ ColorObjP.h TravConT.h UnhighlightT.h PointInT.h \ Print.h PrintSP.h XpmP.h Xmfuncs.h \ ${SLIDE_HDRS} ${EXTRA_HDRS} nodist_xm_HEADERS = Xm.h SRCS1 = XmStrDefs.c ArrowB.c ArrowBG.c BulletinB.c CallbackI.c \ CascadeB.c CascadeBG.c Command.c CutPaste.c \ Dest.c DialogS.c DialogSE.c DragBS.c \ DragC.c DragOverS.c DragICC.c DragIcon.c \ DragUnder.c DrawingA.c DrawnB.c DropSMgr.c \ DropSMgrI.c DropTrans.c ExtObject.c FileSB.c \ Form.c Frame.c Gadget.c GadgetUtil.c \ GeoUtils.c ImageCache.c Label.c LabelG.c \ List.c MainW.c MapEvents.c MenuShell.c \ MenuUtil.c MessageB.c PanedW.c PushB.c \ PushBG.c ReadImage.c Region.c ResConvert.c \ ResInd.c RowColumn.c Sash.c \ Scale.c ScrollBar.c ScrolledW.c SelectioB.c \ SeparatoG.c Separator.c Simple.c Text.c \ TextIn.c TextOut.c TextStrSo.c TextSel.c \ ToggleB.c ToggleBG.c TrackLoc.c UniqueEvnt.c \ VaSimple.c VirtKeys.c XmString.c ResEncod.c\ TextF.c TextFSel.c AtomMgr.c \ Cache.c Protocols.c Primitive.c Manager.c \ Traversal.c TravAct.c TraversalI.c BaseClass.c SRCS2 = Desktop.c Messages.c Transltns.c RepType.c \ Xmos.c Draw.c TearOff.c TearOffB.c \ XmIm.c GMUtils.c Display.c Screen.c \ ShellE.c VendorS.c VendorSE.c RCMenu.c \ RCLayout.c GetPixData.c RCPopup.c Trait.c \ Synthetic.c XmFontList.c ClipWindow.c Transfer.c \ Hash.c ScrollFrameT.c \ XmTabList.c Resolve.c XmStringFunc.c \ XmRenderT.c PixConv.c Color.c Xm.c \ CareVisualT.c Direction.c XmStringObso.c XmStringGet.c \ IsMwmRun.c MenuProc.c MenuState.c TextFind.c \ TextFunc.c ColorObj.c IconFile.c RCHook.c \ GetRes.c BBUtil.c ChColor.c ColObjFunc.c \ DrTog.c DrArrow.c DrPoly.c DrHiDash.c \ ValTime.c FocusAct.c CvtUnit.c ScalTics.c \ ScroVis.c WidGet.c $(PRINTS_SRC) OBSO_SRCS = Obso1_2.c ObsoStr.c ObsoXme.c Obso2_0.c XPM_SRCS = \ XpmAttrib.c XpmCrIFrDat.c XpmInfo.c XpmWrFFrDat.c Xpmmisc.c \ XpmCrBufFrI.c XpmCrIFrP.c XpmRdFToBuf.c XpmWrFFrI.c Xpmparse.c\ XpmCrBufFrP.c XpmCrPFrBuf.c XpmRdFToDat.c XpmWrFFrP.c Xpmrgb.c \ XpmCrDatFrI.c XpmCrPFrDat.c XpmRdFToI.c Xpmcreate.c Xpmscan.c \ Xpms_popen.c XpmCrDatFrP.c XpmCrPFrI.c XpmRdFToP.c Xpmdata.c \ XpmCrIFrBuf.c XpmImage.c XpmWrFFrBuf.c Xpmhashtab.c NEW_WID_SRCS = IconH.c Container.c IconG.c \ Notebook.c ComboBox.c GrabShell.c SpinB.c \ SSpinB.c TxtPropCv.c XmStringSeg.c TranslNew.c libXm_la_SOURCES = $(SRCS1) $(SRCS2) $(OBSO_SRCS) $(XPM_SRCS) $(NEW_WID_SRCS) $(SLIDE_SRCS) \ $(TIP_SRCS) $(EDITRES_SRCS) $(EXTRA_SRCS) $(JPEG_SRCS) $(PNG_SRCS) EXTRA_libXm_la_SOURCES = $(SLIDE_SRCS) $(TIP_SRCS) STRING_FILES = XmStrDefs.h XmStrDefs22.h XmStrDefs23.h XmStrDefsI.h XmStrDefs.c BUILT_SOURCES = $(STRING_FILES) $(CAT_FILES) $(top_builddir)/config/util/makestrs: ( cd $(top_builddir)/config/util && $(MAKE) $(AM_MAKEFLAGS) makestrs ) $(STRING_FILES): Makefile $(XMSTRING_LIST) XmStrDefs.ht XmStrDefsI.ht XmStrDefs.ct $(top_builddir)/config/util/makestrs test -f $(XMSTRING_LIST) || $(LN_S) $(srcdir)/$(XMSTRING_LIST) $(XMSTRING_LIST) test -f XmStrDefs.ht || $(LN_S) $(srcdir)/XmStrDefs.ht XmStrDefs.ht test -f XmStrDefs22.ht || $(LN_S) $(srcdir)/XmStrDefs22.ht XmStrDefs22.ht test -f XmStrDefs23.ht || $(LN_S) $(srcdir)/XmStrDefs23.ht XmStrDefs23.ht test -f XmStrDefsI.ht || $(LN_S) $(srcdir)/XmStrDefsI.ht XmStrDefsI.ht test -f XmStrDefs.ct || $(LN_S) $(srcdir)/XmStrDefs.ct XmStrDefs.ct $(top_builddir)/config/util/makestrs -f $(XMSTRING_LIST) >XmStrDefs.c if MessageCatalog CAT_FILES = Xm.cat XmMsgCatI.h $(CAT_FILES): Xm.msg $(mkinstalldirs) $(top_builddir)/localized/C/msg $(top_builddir)/localized/util/mkcatdefs XmMsgCatI.h $(srcdir)/Xm.msg >$(top_builddir)/localized/C/msg/Xm.msg gencat Xm.cat $(top_builddir)/localized/C/msg/Xm.msg SPLINT_EXTRAFLAGS = -I/usr/include -I. +posixlib -nestcomment else SPLINT_EXTRAFLAGS = -I/usr/include -I. -DNO_MESSAGE_CATALOG +posixlib -nestcomment endif splint: $(STRING_FILES) $(SPLINT) $(INCLUDES) $(SPLINT_EXTRAFLAGS) $(top_srcdir)/lib/Xm/*.c #include $(srcdir)/check_headers.am motif-2.3.8/lib/Xm/IconButton.c0000644000175000017500000016472413066310437013166 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /************************************************************ * INCLUDE FILES *************************************************************/ #include #include #include #include #include #include #include #include #include "PrimitiveI.h" #include "XmStrDefsI.h" #include "xmlist.h" #include "RepTypeI.h" /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define SUPERCLASS ((WidgetClass) &xmPrimitiveClassRec) #define FILL_SPACE(iw) ((iw)->primitive.highlight_thickness + \ (iw)->primitive.shadow_thickness) #define H_SPACE(iw) (FILL_SPACE(iw) + XmIconButton_h_space(iw)) #define V_SPACE(iw) (FILL_SPACE(iw) + XmIconButton_v_space(iw)) #define ALLOC_INCREMENT 5 #define DELAY 100 #define NO_TIMER 0 #define NEW_LINE ('\n') #define EOL ('\0') typedef struct _PixCacheEntry { Display *display; Pixmap pixmap; long count; /*The tree widget uses the folder icon A LOT*/ Dimension width, height, depth; } PixCacheEntry; /************************************************************ * MACROS *************************************************************/ #define streq(a, b) (((a) != NULL) && ((b) != NULL) && (strcmp((a), (b)) == 0)) #define ValidPixmap(p) ((p)!=None&&(p)!=XmUNSPECIFIED_PIXMAP) /************************************************************ * GLOBAL DECLARATIONS *************************************************************/ extern void _XmSelectColorDefault(); static XmList pix_cache_list = NULL; /************************************************************ * STATIC FUNCTION DECLARATIONS *************************************************************/ static void Resize(Widget), Destroy(Widget), ClassInit(void); static void ClassPartInitialize(WidgetClass w_class); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void Redisplay(Widget, XEvent *, Region); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static void SetValuesAlmost(Widget, Widget, XtWidgetGeometry *, XtWidgetGeometry *); static void GetValues_labelString ( Widget w, int n, XtArgVal *value) ; static void ChangeCB(Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset); /************************ * Actions and callbacks. ************************/ static void ToggleState(Widget, XEvent *, String *, Cardinal *); static void Notify(Widget, XEvent *, String *, Cardinal *); static void DoubleNotify(Widget, XEvent *, String *, Cardinal *); static void ArmAndActivate(Widget, XEvent *, String *, Cardinal *); static void ButtonUp(Widget, XEvent *, String *, Cardinal *); /********************* * Internal Routines. *********************/ static XmListElem * GetCacheElem(Display *, Pixmap); static Boolean CheckPixCache(Display *, Pixmap, unsigned int *, unsigned int *, unsigned int *); static void AddPixCache(Display *, Pixmap, unsigned int, unsigned int, unsigned int); static void IncPixCache(Display *, Pixmap); static void DecPixCache(Display *, Pixmap); static void Deactivate(XtPointer, XtIntervalId *); static void GetDesiredSize(Widget, Dimension *, Dimension *); static void RequestNewSize(Widget, Dimension, Dimension); static void CalcLocations(Widget), DrawTextAndImage(Widget, GC, GC, GC); static void CreateGCs(Widget), DestroyGCs(Widget w); static void FromPaddingPixels(Widget, int, XtArgVal *); static XmImportOperator ToPaddingPixels(Widget, int, XtArgVal *); static XmString CreateXmString(Widget, String); static void CheckSetRenderTable(Widget wid, int offs, XrmValue *value); /****************** * Type Converters ******************/ static Boolean CvtStringToIconPlacement(Display *, XrmValuePtr, Cardinal *, XrmValuePtr, XrmValuePtr); /************************************************************ * STATIC DECLARATIONS *************************************************************/ /* * It seems redundant to have both Btn1Up and BtnUp bound to * EndDrag, but for some reason BtnUp does not cause the event to * fire on button 1, must be some Translations magic that I don't * understand. * * CDP - 5/11/91. */ typedef struct _StippleInfo { struct _StippleInfo *next; Pixmap stipple; Display *disp; Screen *screen; } StippleInfo; /* * ||| It would be nice to put this in the widget class. */ static StippleInfo *stipple_cache; /* Only one of these for each app. */ static char defaultTranslations[] = ",: XiToggle() XmNotify() XiButtonUp()\n\ : XiGetFocus() XiToggle() \n\ osfSelect: XiArmAndActivate()\n\ osfActivate: XiArmAndActivate()\n\ Nonespace: XiArmAndActivate()\n\ NoneReturn: XiArmAndActivate()\n\ ,: XiToggle()"; /* * These are the primitive translations that we need, this list * adds enter and leave to the primitive defaults. */ static char traverseTranslations[] = "osfBeginLine: PrimitiveTraverseHome()\n\ osfHelp: PrimitiveHelp()\n\ osfUp: PrimitiveTraverseUp()\n\ osfDown: PrimitiveTraverseDown()\n\ osfLeft: PrimitiveTraverseLeft()\n\ osfRight: PrimitiveTraverseRight()\n\ Shift ~Meta ~Alt Tab: PrimitivePrevTabGroup()\n\ ~Meta ~Alt Tab: PrimitiveNextTabGroup()\n\ : PrimitiveFocusIn()\n\ : PrimitiveFocusOut()\n\ : PrimitiveEnter()\n\ : PrimitiveLeave()\n\ : PrimitiveUnmap()"; static XtActionsRec actionsList[] = { {"XiArmAndActivate", ArmAndActivate}, {"XiToggle", ToggleState}, {"XmNotify", Notify}, {"XiGetFocus", _XmGetFocus}, {"XiDoubleNotify", DoubleNotify}, {"XiButtonUp", ButtonUp}, /* * Why aren't these in primitive? */ { "PrimitiveEnter", (XtActionProc) _XmPrimitiveEnter }, { "PrimitiveLeave", (XtActionProc) _XmPrimitiveLeave }, }; static XtResource resources[] = { { XmNlabel, XmCLabel, XmRString, sizeof(String), XtOffsetOf(XmIconButtonRec, icon.label), XmRImmediate, (XtPointer) NULL }, { XmNlabelString, XmCLabelString, XmRXmString, sizeof(XmString), XtOffsetOf(XmIconButtonRec, icon.label_string), XmRImmediate, (XtPointer) NULL }, { XmNpixmap, XmCPixmap, XmRPrimForegroundPixmap, sizeof(Pixmap), XtOffsetOf(XmIconButtonRec, icon.pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmIconButtonRec, icon.check_set_render_table), XmRImmediate, (XtPointer) False }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), XtOffsetOf(XmIconButtonRec, icon.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf(XmIconButtonRec, icon.font_list), XmRCallProc, (XtPointer)CheckSetRenderTable }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf(XmIconButtonRec, icon.alignment), XmRImmediate,(XtPointer) XmALIGNMENT_BEGINNING }, { XmNstringDirection, XmCStringDirection, XmRStringDirection, sizeof(unsigned char), XtOffsetOf(XmIconButtonRec, icon.string_direction), XmRImmediate, (XtPointer) XmDEFAULT_DIRECTION }, { XmNiconPlacement, XmCIconPlacement, XmRXmIconPlacement, sizeof(XmIconPlacement), XtOffsetOf(XmIconButtonRec, icon.icon_placement), XmRImmediate, (XtPointer) XmIconTop }, { XmNrecomputeSize, XmCBoolean , XmRBoolean, sizeof(Boolean), XtOffsetOf(XmIconButtonRec, icon.recompute), XmRImmediate, (XtPointer) True }, { XmNarmColor, XmCArmColor, XmRPixel, sizeof(Pixel), XtOffsetOf(XmIconButtonRec, icon.arm_color), XmRCallProc, (XtPointer) _XmSelectColorDefault }, { XmNset, XmCBoolean , XmRBoolean, sizeof(Boolean), XtOffsetOf(XmIconButtonRec, icon.set), XmRImmediate, (XtPointer) False }, { XmNverticalMargin, XmCSpace, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.v_space), XmRImmediate, (XtPointer) 2 }, { XmNhorizontalMargin, XmCSpace, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.h_space), XmRImmediate, (XtPointer) 2 }, { XmNiconTextPadding, XmCSpace, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.icon_text_padding), XmRImmediate, (XtPointer) 2 }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmIconButtonRec, icon.activate_callback), XmRPointer, (XtPointer) NULL }, { XmNdoubleClickCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmIconButtonRec, icon.double_click_callback), XmRPointer, (XtPointer) NULL }, { XmNpixmapWidth, XmCDimension, XmRDimension, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.pix_width), XmRImmediate, (XtPointer) 0 }, { XmNpixmapHeight, XmCDimension, XmRDimension, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.pix_height), XmRImmediate, (XtPointer) 0 }, { XmNpixmapDepth, XmCDimension, XmRDimension, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.pix_depth), XmRImmediate, (XtPointer) 0 } }; static XmSyntheticResource get_resources[] = { { XmNhorizontalMargin, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.h_space), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNverticalMargin, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.v_space), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, { XmNiconTextPadding, sizeof(Dimension), XtOffsetOf(XmIconButtonRec, icon.icon_text_padding), FromPaddingPixels, (XmImportProc) ToPaddingPixels }, { XmNlabelString, sizeof(XmString), XtOffsetOf(XmIconButtonRec, icon.label_string), GetValues_labelString, NULL } }; XmIconButtonClassRec xmIconButtonClassRec = { { /* core fields */ /* superclass */ SUPERCLASS, /* class_name */ XM_ICON_BUTTON_CLASS_NAME, /* widget_size */ sizeof(XmIconButtonRec), /* class_initialize */ ClassInit, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actionsList, /* num_actions */ XtNumber(actionsList), /* resources */ (XtResourceList)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMultiple, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ SetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* Xmprimitive fields */ (XtWidgetProc)_XtInherit, /* border_highlight */ (XtWidgetProc)_XtInherit, /* border_unhighlight */ traverseTranslations, /* translations */ NULL, /* arm_and_activate */ get_resources, /* syn resources */ XtNumber(get_resources), /* num syn_resources */ NULL /* extension */ }, { /* Icon Button class fields */ NULL /* extension */ } }; WidgetClass xmIconButtonWidgetClass = (WidgetClass)&xmIconButtonClassRec; /* Trait record for iconButton */ static XmConst XmActivatableTraitRec iconButtonAT = { 0, /* version */ ChangeCB /* changeCB */ }; /************************************************************ * STATIC CODE *************************************************************/ /* Function Name: ClassInit * Description: Called to initialize information specific * to this widget class. * Arguments: none. * Returns: none. */ /*ARGSUSED*/ static void ClassInit() { XmIconButtonClassRec *wc = &xmIconButtonClassRec; XtSetTypeConverter(XmRString, XmRXmIconPlacement, (XtTypeConverter) CvtStringToIconPlacement, NULL, (Cardinal) 0, XtCacheAll, (XtDestructor) NULL); } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void #ifdef _NO_PROTO ClassPartInitialize(w_class) WidgetClass w_class ; #else ClassPartInitialize(WidgetClass w_class) #endif /* _NO_PROTO */ { _XmFastSubclassInit (w_class, XmICONBUTTON_BIT ); /* Install the activatable trait for all subclasses */ XmeTraitSet((XtPointer)w_class, XmQTactivatable, (XtPointer) &iconButtonAT); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /*ARGSUSED*/ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmIconButtonWidget iw = (XmIconButtonWidget) set; Boolean resetPixmapValues = True; XmIconButton_unset_timer(iw) = NO_TIMER; XmIconButton_time(iw) = 0L; /* * If the label string is specified then it wins. If only the label * is specified the it is converted into an XmString and stored * in the label_string. */ XmIconButton_label_from_name(iw) = False; if (XmIconButton_label_string(iw) == NULL) { if (XmIconButton_label(iw) == NULL) { XmIconButton_label_string(iw) = CreateXmString(set, XtName(set)); XmIconButton_label_from_name(iw) = True; } else { if ((XmIconButton_label_string(iw) = CreateXmString(set, XmIconButton_label(iw))) == NULL) { XmIconButton_label_string(iw) = CreateXmString(set, XtName(set)); XmIconButton_label_from_name(iw) = True; } } } else { XmIconButton_label_string(iw) = XmStringCopy(XmIconButton_label_string(iw)); } if (XmIconButton_label(iw)) XmIconButton_label(iw) = XtNewString(XmIconButton_label(iw)); if (ValidPixmap(XmIconButton_pixmap(iw))) { /* here's what we enforce: all must be non-zero */ if ( (0 != XmIconButton_pix_width(iw)) && (0 != XmIconButton_pix_height(iw)) && (0 != XmIconButton_pix_depth(iw)) ) resetPixmapValues = False; } if (resetPixmapValues) { XmIconButton_pix_width(iw) = 0; XmIconButton_pix_height(iw) = 0; XmIconButton_pix_depth(iw) = 0; } else { /* we have a validPixmap and valid values */ AddPixCache(XtDisplay(set), XmIconButton_pixmap(iw), XmIconButton_pix_width(iw), XmIconButton_pix_height(iw), XmIconButton_pix_depth(iw)); IncPixCache(XtDisplay(set), XmIconButton_pixmap(iw)); } /* If layout_direction is set, it overrides string_direction. * If string_direction is set, but not layout_direction, use * string_direction value. * If neither is set, get from parent */ if (XmPrim_layout_direction(iw) != XmDEFAULT_DIRECTION) { if (XmIconButton_string_direction(iw) == XmDEFAULT_DIRECTION) XmIconButton_string_direction(iw) = XmDirectionToStringDirection(XmPrim_layout_direction(iw)); } else if (XmIconButton_string_direction(iw) != XmDEFAULT_DIRECTION) { XmPrim_layout_direction(iw) = XmStringDirectionToDirection(XmIconButton_string_direction(iw)); } else { XmPrim_layout_direction(iw) = _XmGetLayoutDirection(XtParent(set)); XmIconButton_string_direction(iw) = XmDirectionToStringDirection(XmPrim_layout_direction(iw)); } if (!XmRepTypeValidValue(XmRID_STRING_DIRECTION, XmIconButton_string_direction(iw), (Widget) iw)) { XmIconButton_string_direction(iw) = XmSTRING_DIRECTION_L_TO_R; XmPrim_layout_direction(iw) = XmStringDirectionToDirection(XmIconButton_string_direction(iw)); } if (XmIconButton_font_list(iw) == NULL) { XmIconButton_font_list(iw) = XmeGetDefaultRenderTable((Widget) iw, XmBUTTON_FONTLIST); } /* Make a local copy of the font list */ XmIconButton_font_list(iw) = XmFontListCopy( XmIconButton_font_list(iw)); if ((req->core.width == 0) || (req->core.height == 0)) { Dimension width, height; GetDesiredSize(set, &width, &height); RequestNewSize(set, width, height); } CalcLocations(set); CreateGCs(set); } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - the widget to resize. * Returns: none. */ static void Resize(Widget w) { CalcLocations(w); } /* Function Name: Redisplay * Description: This function redraws the contents of the widget. * Arguments: w - the widget. * event - event that caused the exposure. * region - the region containing all the exposures. * Returns: none */ /*ARGSUSED*/ static void Redisplay(Widget w, XEvent * event, Region region) { XmIconButtonWidget iw = (XmIconButtonWidget) w; int dx, dy, width, height; GC topgc, bottomgc, text_gc, icon_gc, icon_stippled_gc; dx = iw->primitive.highlight_thickness; dy = dx; width = iw->core.width - (2 * dx); height = iw->core.height - (2 * dy); if (XmIconButton_set(iw)) { Dimension fill_width, fill_height; if ((int)iw->core.width > (int)(2 * H_SPACE(iw))) fill_width = iw->core.width - 2 * FILL_SPACE(iw); else fill_width = 0; if ((int)iw->core.height > (int)(2 * V_SPACE(iw))) fill_height = iw->core.height - 2 * FILL_SPACE(iw); else fill_height = 0; if ((fill_width != 0) && (fill_height != 0)) XFillRectangle(XtDisplay(w), XtWindow(w), XmIconButton_fill_gc(iw), FILL_SPACE(iw), FILL_SPACE(iw), fill_width, fill_height); icon_gc = XmIconButton_pixmap_fill_gc(iw); icon_stippled_gc = XmIconButton_stippled_set_gc(iw); topgc = iw->primitive.bottom_shadow_GC; bottomgc = iw->primitive.top_shadow_GC; } else { icon_gc = XmIconButton_gc(iw); icon_stippled_gc = XmIconButton_stippled_unset_gc(iw); topgc = iw->primitive.top_shadow_GC; bottomgc = iw->primitive.bottom_shadow_GC; } if (XtIsSensitive(w)) { if (XmIconButton_set(iw)) text_gc = XmIconButton_pixmap_fill_gc(iw); else text_gc = XmIconButton_gc(iw); icon_stippled_gc = None; } else { if (XmIconButton_set(iw)) text_gc = XmIconButton_stippled_set_text_gc(iw); else text_gc = XmIconButton_stippled_text_gc(iw); } DrawTextAndImage(w, text_gc, icon_gc, icon_stippled_gc); XmeDrawShadows(XtDisplay(w), XtWindow(w), topgc, bottomgc, dx, dy, width, height, iw->primitive.shadow_thickness, XmSHADOW_OUT); if (iw->primitive.highlighted) _XmExtHighlightBorder(w); else _XmExtUnhighlightBorder(w); } /* Function Name: SetValuesAlmost * Description: Handles the case of our geom request being denied. * Arguments: old - the old state of the widget. * set - the new state of the widget. * request - the requested new geometry. * reply - the compromise from our parent. * Returns: none */ /* ARGSUSED */ static void SetValuesAlmost(Widget old, Widget set, XtWidgetGeometry * request, XtWidgetGeometry * reply) { if (request->request_mode != 0) /* XtGeometryAlmost, make new request */ *request = *reply; CalcLocations(set); } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /*ARGSUSED*/ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { Boolean resetGCs, recalc, redisplay, reinit_l, reinit_ls; XmIconButtonWidget old_iw = (XmIconButtonWidget) current; XmIconButtonWidget set_iw = (XmIconButtonWidget) set; register int i; Boolean pixmapChanged = False; Boolean pixmapGeoChanged = False; Boolean resetPixmapValues = False; reinit_l = reinit_ls = resetGCs = recalc = redisplay = False; for (i = 0; i < *num_args; i++) { String name = args[i].name; if (streq(XmNlabel, name)) reinit_l = resetGCs = recalc = redisplay = TRUE; if (streq(XmNlabelString, name)) reinit_ls = resetGCs = recalc = redisplay = TRUE; if (streq(XmNpixmap, name)) { DecPixCache(XtDisplay(current), XmIconButton_pixmap(old_iw)); recalc = redisplay = TRUE; pixmapChanged = True; } if ( streq(XmNpixmapWidth, name) || streq(XmNpixmapHeight, name) || streq(XmNpixmapDepth, name) ) { pixmapGeoChanged = True; /* for now, we naively assume that the user knows that all of ** these resources should be changed at the same time */ } if (streq(XmNset, name)) { /* * Remove the timer since programmer has changed value. */ if (XmIconButton_unset_timer(set_iw) != NO_TIMER) { XtRemoveTimeOut(XmIconButton_unset_timer(set_iw)); XmIconButton_unset_timer(set_iw) = NO_TIMER; } } } /* ----------------------------------------------------------------- */ /* now make sense of the pixmap changes */ if (pixmapChanged && !pixmapGeoChanged) { /* for backward compatibility, reset values and fall through to ** GetDesiredSize */ resetPixmapValues = True; } else if (pixmapGeoChanged && !pixmapChanged) { /* we don't allow this case */ resetPixmapValues = True; } /* else if neither changed, then we don't worry about anything */ /* else if both changed, we use new values */ if (pixmapGeoChanged) { /* here's what we enforce: all must be non-zero */ if (!( (0 != XmIconButton_pix_width(set_iw)) && (0 != XmIconButton_pix_height(set_iw)) && (0 != XmIconButton_pix_depth(set_iw)) )) resetPixmapValues = True; } /* for backward-compatibility, preserve old behavior in which pixmap ** can change without sizes changing when recomputeSize is not set, in ** which case we restore the values rather than use the new ones */ if (resetPixmapValues) { if (XmIconButton_recompute(set_iw)) { XmIconButton_pix_width(set_iw) = 0; XmIconButton_pix_height(set_iw) = XmIconButton_pix_depth(set_iw) = 0; } else { XmIconButton_pix_width(set_iw) = XmIconButton_pix_width(old_iw); XmIconButton_pix_height(set_iw) = XmIconButton_pix_height(old_iw); XmIconButton_pix_depth(set_iw) = XmIconButton_pix_depth(old_iw); } } /* ----------------------------------------------------------------- */ if ((old_iw->primitive.foreground != set_iw->primitive.foreground) || (old_iw->core.background_pixel != set_iw->core.background_pixel) || (XmIconButton_arm_color(old_iw) != XmIconButton_arm_color(set_iw))) { resetGCs = redisplay = True; } if( XtIsSensitive(current) != XtIsSensitive(set) ) { redisplay = True; } if( XmIconButton_font_list(old_iw) != XmIconButton_font_list(set_iw) ) { if( XmIconButton_font_list(old_iw) != NULL ) { XmFontListFree (XmIconButton_font_list(old_iw)); } if( XmIconButton_font_list(set_iw) == NULL ) { XmIconButton_font_list(set_iw) = XmeGetDefaultRenderTable(set, XmBUTTON_FONTLIST); } XmIconButton_font_list(set_iw) = XmFontListCopy(XmIconButton_font_list(set_iw)); recalc = redisplay = True; } if ((XmIconButton_icon_placement(old_iw) != XmIconButton_icon_placement(set_iw)) || (XmIconButton_v_space(old_iw) != XmIconButton_v_space(set_iw)) || (XmIconButton_h_space(old_iw) != XmIconButton_h_space(set_iw)) || (XmIconButton_icon_text_padding(old_iw) != XmIconButton_icon_text_padding(set_iw))) { recalc = redisplay = TRUE; } if ((XmIconButton_set(old_iw) != XmIconButton_set(set_iw)) || (XmIconButton_alignment(old_iw) != XmIconButton_alignment(set_iw)) || (XmIconButton_string_direction(old_iw) != XmIconButton_string_direction(set_iw)) || (XmPrim_layout_direction(old_iw) != XmPrim_layout_direction(set_iw))) { redisplay = TRUE; } if (XmIconButton_recompute(old_iw) != XmIconButton_recompute(set_iw)) { if (XmIconButton_recompute(set_iw)) redisplay = recalc = TRUE; } if (reinit_l || reinit_ls) { /* * The order here makes sure that label string overrides label * when both are set. Fix up data first, then check what we * should be displaying. If both have changed, deal only with * the label string case. */ /* this has the desired behavior, except in this case: only * XmNlabel is set at the beginning, then it migrates to * XmNlabelString; then XmNlabel is reset to NULL. What value * should be used? */ /* Boolean was_from_name; */ if (reinit_ls) { XmStringFree(XmIconButton_label_string(old_iw)); if (XmIconButton_label_string(set_iw)) XmIconButton_label_string(set_iw) = XmStringCopy(XmIconButton_label_string(set_iw)); } if (reinit_l) { XtFree(XmIconButton_label(old_iw)); if (XmIconButton_label(set_iw)) XmIconButton_label(set_iw) = XtNewString(XmIconButton_label(set_iw)); } /* was_from_name = XmIconButton_label_from_name(set_iw); */ XmIconButton_label_from_name(set_iw) = False; if (reinit_ls) { if (XmIconButton_label_string(set_iw) == NULL) { if (XmIconButton_label(set_iw) == NULL) { XmIconButton_label_string(set_iw) = CreateXmString(set, XtName(set)); XmIconButton_label_from_name(set_iw) = True; } else { if ((XmIconButton_label_string(set_iw) = CreateXmString(set, XmIconButton_label(set_iw))) == NULL) { XmIconButton_label_string(set_iw) = CreateXmString(set, XtName(set)); XmIconButton_label_from_name(set_iw) = True; } } } } else if (reinit_l) { /* spec says, if labelString is set it is used, which * isn't enough to really work with; I think it really * means that if both are set, XmNlabelString is used, * which is a much different thing */ /* now I'm confused as to why this was ever necessary */ /* if (was_from_name) */ { XmStringFree(XmIconButton_label_string(set_iw)); if (XmIconButton_label(set_iw) == NULL) { XmIconButton_label_string(set_iw) = CreateXmString(set, XtName(set)); XmIconButton_label_from_name(set_iw) = True; } else { if ((XmIconButton_label_string(set_iw) = CreateXmString(set, XmIconButton_label(set_iw))) == NULL) { XmIconButton_label_string(set_iw) = CreateXmString(set, XtName(set)); XmIconButton_label_from_name(set_iw) = True; } } } } } if (recalc) { if (XmIconButton_recompute(set_iw)) { Dimension width, height; GetDesiredSize(set, &width, &height); /* * SetValues will ask for a new size. */ set->core.height = height; set->core.width = width; } CalcLocations(set); } if (resetGCs) { DestroyGCs(current); CreateGCs(set); } return(redisplay); } /* Function Name: Destroy * Description: Cleans up after the widget. * Arguments: w - the widget. * Returns: none. */ /*ARGSUSED*/ static void Destroy(Widget w) { XmIconButtonWidget iw = (XmIconButtonWidget) w; XtFree(XmIconButton_label(iw)); XmStringFree(XmIconButton_label_string(iw)); if (XmIconButton_font_list(iw) != NULL) XmFontListFree (XmIconButton_font_list(iw)); DestroyGCs(w); if (XmIconButton_unset_timer(w) != NO_TIMER) { XtRemoveTimeOut(XmIconButton_unset_timer(w)); XmIconButton_unset_timer(w) = NO_TIMER; } } /* Function Name: QueryGeometry * Description: Called when my parent wants to know what size * I would like to be. * Arguments: w - the widget to check. * indended - constriants imposed by the parent. * preferred - what I would like. * Returns: See Xt Manual. */ static XtGeometryResult QueryGeometry(Widget w,XtWidgetGeometry *intended, XtWidgetGeometry *preferred) { XmIconButtonWidget iw = (XmIconButtonWidget) w; if (XmIconButton_recompute(iw)) GetDesiredSize(w, &(preferred->width), &(preferred->height)); else { preferred->width = w->core.width; preferred->height = w->core.height; } return(_XmHWQuery(w, intended, preferred)); } /************************************************************ * * Type Converters. * ************************************************************/ /* Function Name: CvtStringToIconPlacement * Description: Converts a string to an Icon Placement * Arguments: dpy - the X Display. * args, num_args - *** NOT USED *** * fromVal - contains the string to convert. * toVal - contains the converted node state. * Returns: True if the SetValues succeeds. */ /*ARGSUSED*/ static Boolean CvtStringToIconPlacement(Display * dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal) { static XmIconPlacement type; static XrmQuark XtQETop; static XrmQuark XtQELeft; static XrmQuark XtQERight; static XrmQuark XtQEBottom; static XrmQuark XtQEIconOnly; static XrmQuark XtQEIconNone; static Boolean haveQuarks = FALSE; XrmQuark q; char lowerName[BUFSIZ]; if (!haveQuarks) { XtQETop = XrmStringToQuark("top"); XtQELeft = XrmStringToQuark("left"); XtQERight = XrmStringToQuark("right"); XtQEBottom = XrmStringToQuark("bottom"); XtQEIconOnly = XrmStringToQuark("icononly"); XtQEIconNone = XrmStringToQuark("none"); haveQuarks = TRUE; } XmCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr); q = XrmStringToQuark(lowerName); if ( (q == XtQETop) || streq(lowerName, "icontop") ) type = XmIconTop; else if ( (q == XtQELeft) || streq(lowerName, "iconleft") ) type = XmIconLeft; else if ( (q == XtQERight) || streq(lowerName, "iconright") ) type = XmIconRight; else if ( (q == XtQEBottom) || streq(lowerName, "iconbottom") ) type = XmIconBottom; else if (q == XtQEIconOnly) type = XmIconOnly; else if ( (q == XtQEIconNone) || streq(lowerName, "iconnone") ) type = XmIconNone; else { XtDisplayStringConversionWarning(dpy, fromVal->addr, XmRXmIconPlacement); return(FALSE); /* Conversion failed. */ } if (toVal->addr == NULL) { toVal->size = sizeof(XmIconPlacement); toVal->addr = (XtPointer) &type; return(TRUE); } if (toVal->size >= sizeof(XmIconPlacement)) { XmIconPlacement *loc = (XmIconPlacement *)toVal->addr; *loc = type; return(TRUE); } toVal->size = sizeof(XmIconPlacement); return(FALSE); } /************************************************************ * * Actions and Callbacks. * ************************************************************/ /* Function Name: ToggleState * Description: Toggles the state of the icon button. * Arguments: w - the icon button widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ToggleState(Widget w, XEvent * event, String * params, Cardinal * num_params) { XmIconButtonWidget iw = (XmIconButtonWidget) w; Arg args[1]; XtSetArg(args[0], XmNset, !(XmIconButton_set(iw))); XtSetValues(w, args, (Cardinal) 1); } /* Function Name: DoubleNotify * Description: Calls all functions on the icon button's * doubleClickCallback list * Arguments: w - the icon button widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void DoubleNotify(Widget w, XEvent * event, String * params, Cardinal * num_params) { XmIconButtonWidget iw = (XmIconButtonWidget) w; XmIconButtonCallbackInfo info; info.state = XmIconButton_set(iw); info.event = event; XtCallCallbackList(w, XmIconButton_double_click_callback(iw), &info); } /* Function Name: Notify * Description: Calls all functions on the icon button's * activateCallback list * Arguments: w - the icon button widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void Notify(Widget w, XEvent * event, String * params, Cardinal * num_params) { XmIconButtonWidget iw = (XmIconButtonWidget) w; XmIconButtonCallbackInfo info; Boolean dclick; if ((event->type == ButtonPress) || (event->type == ButtonRelease)) dclick = ((event->xbutton.time - XmIconButton_time(iw)) <= XtGetMultiClickTime(XtDisplay(w))); else dclick = False; info.state = XmIconButton_set(iw); info.event = event; if (dclick) XtCallCallbackList(w, XmIconButton_double_click_callback(iw), &info); else XtCallCallbackList(w, XmIconButton_activate_callback(iw), &info); } /* Function Name: ArmAndActivate * Description: Arms the button, notifies it of the action, then * disarms the button after a small delay. * Arguments: w - the icon button widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ArmAndActivate(Widget w, XEvent * event, String * params, Cardinal * num_params) { XmIconButtonWidget iw = (XmIconButtonWidget) w; Arg args[1]; if (!XmIconButton_set(iw)) { XtSetArg(args[0], XmNset, True); XtSetValues(w, args, (Cardinal) 1); } XmIconButton_unset_timer(iw) = XtAppAddTimeOut(XtWidgetToApplicationContext(w), (unsigned long) DELAY, Deactivate, (XtPointer) w); Notify(w, event, params, num_params); } /* Function Name: Deactivate * Description: Called when the icon button should be deactivated. * Arguments: data - the client data. * timer - the timer that fired. * Returns: none. */ /* ARGSUSED */ static void Deactivate(XtPointer data, XtIntervalId *timer) { Arg args[1]; Widget w = (Widget) data; XmIconButtonWidget iw = (XmIconButtonWidget) w; XtSetArg(args[0], XmNset, False); XtSetValues(w, args, (Cardinal) 1); XmIconButton_unset_timer(iw) = NO_TIMER; } /* Function Name: ButtonUp * Description: Saves the timestamp of the ButtonUp event * for later double click processing * Arguments: w - the icon button widget. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ButtonUp(Widget w, XEvent * event, String * params, Cardinal * num_params) { XmIconButtonWidget iw = (XmIconButtonWidget) w; XmIconButton_time(iw) = event->xbutton.time; } /************************************************************ * * Internal routines. * ************************************************************/ /* Function Name: GetCacheElem * Description: Gets an element in the cache. * Arguments: disp, pixmap - The keys into the cache. * Returns: elem - The list elem for this element. */ static XmListElem * GetCacheElem(Display *disp, Pixmap pix) { register XmListElem *elem; if (pix_cache_list == NULL) return(NULL); for (elem = XmListFirst(pix_cache_list); elem != NULL; elem = XmListElemNext(elem)) { PixCacheEntry * entry = (PixCacheEntry *) XmListElemData(elem); if ((entry->display == disp) && (entry->pixmap == pix)) { return(elem); } } return(NULL); } /* Function Name: CheckPixCache * Description: Checks the cache to see if this pixmap is in it. * Arguments: disp, pixmap - The keys into the cache. * width, height and depth - data about the pixmap. * Returns: True if a match found. */ static Boolean CheckPixCache(Display *disp, Pixmap pixmap, unsigned int *width, unsigned int *height, unsigned int *depth) { XmListElem * elem = GetCacheElem(disp, pixmap); PixCacheEntry * entry; if (elem == NULL) return(False); entry = (PixCacheEntry *) XmListElemData(elem); *width = entry->width; *height = entry->height; *depth = entry->depth; return(True); } /* Function Name: AddPixCache * Description: Adds or updates data in the pixmap cache. * Arguments: disp, pixmap - The keys into the cache. * width, height and depth - data about the pixmap. * Returns: True if a match found. */ static void AddPixCache(Display *disp, Pixmap pixmap, unsigned int width, unsigned int height, unsigned int depth) { XmListElem * elem = GetCacheElem(disp, pixmap); PixCacheEntry * entry; if (elem == NULL) { entry = (PixCacheEntry *) XtCalloc(sizeof(PixCacheEntry), 1); entry->display = disp; entry->pixmap = pixmap; if (pix_cache_list == NULL) pix_cache_list = _XmListInit(); _XmListAddBefore(pix_cache_list, NULL, (XtPointer) entry); } else entry = (PixCacheEntry *) XmListElemData(elem); entry->width = width; entry->height = height; entry->depth = depth; } /* Function Name: IncPixCache * Description: Increments the count in the pixmap cache. * Arguments: disp - The current display. * pix - The pixmap to increment. * Returns: none. */ static void IncPixCache(Display *disp, Pixmap pix) { XmListElem * elem = GetCacheElem(disp, pix); if (elem != NULL) (((PixCacheEntry *) XmListElemData(elem))->count)++; } /* Function Name: DecPixCache * Description: Decrements the count in the pixmap cache. * Arguments: disp - The current display. * pix - The pixmap to increment. * Returns: none. */ static void DecPixCache(Display *disp, Pixmap pix) { XmListElem * elem = GetCacheElem(disp, pix); PixCacheEntry * entry; if (elem == NULL) return; entry = (PixCacheEntry *) XmListElemData(elem); if (entry->count > 0) (entry->count)--; if (entry->count == 0) { _XmListRemove(pix_cache_list, elem); XtFree((char *) entry); } } /* ARGSUSED */ static void GetValues_labelString ( Widget w, int n, XtArgVal *value) { (*value) = (XtArgVal) XmStringCopy(XmIconButton_label_string(w)); } /* Function Name: FromPaddingPixels * Description: Converts from pixels to current unit type * does either horiz or vert depending on icon placement. * Arguments: widget - the icon button widget. * offset, value - passed to correct function based * on orientation. * Returns: none */ static void FromPaddingPixels(Widget widget, int offset, XtArgVal *value) { XmIconButtonWidget iw = (XmIconButtonWidget) widget; switch(XmIconButton_icon_placement(iw)) { case XmIconTop: case XmIconBottom: XmeFromVerticalPixels(widget, offset, value); break; default: /* everything else is horiz. */ XmeFromHorizontalPixels(widget, offset, value); break; } } /* Function Name: ToPaddingPixels * Description: Converts to pixels from current unit type * does either horiz or vert depending on icon placement. * Arguments: widget - the icon button widget. * offset, value - passed to correct function based * on orientation. * Returns: the import order from _XmTo{Horizontal, Vertical}Pixels. */ static XmImportOperator ToPaddingPixels(Widget widget, int offset, XtArgVal *value) { XmIconButtonWidget iw = (XmIconButtonWidget) widget; switch(XmIconButton_icon_placement(iw)) { case XmIconTop: case XmIconBottom: return(XmeToVerticalPixels(widget, offset, value)); default: return(XmeToHorizontalPixels(widget, offset, value)); } } /* Function Name: GetDesiredSize * Description: Gets the size that this widget would like to be. * Arguments: w - the icon widget. * RETURNED width, height - the desired size. * Returns: none. */ static void GetDesiredSize(Widget w, Dimension * width, Dimension * height) { XmIconButtonWidget iw = (XmIconButtonWidget) w; Dimension total_width, total_height; XmStringExtent(XmIconButton_font_list(iw), XmIconButton_label_string(iw), &total_width, &total_height); if( (XmIconButton_icon_placement(iw) != XmIconNone) && ValidPixmap(XmIconButton_pixmap(iw)) ) { Window root; int x, y; unsigned int local_width, local_height, bw, depth; /* * If we have an icon of unknown size then ask the server, * be sure to not make a round trip if not needed. */ if ((XmIconButton_pix_width(iw) == 0) || (XmIconButton_pix_height(iw) == 0) || (XmIconButton_pix_depth(iw) == 0)) { if (!CheckPixCache(XtDisplay(w), XmIconButton_pixmap(iw), &local_width, &local_height, &depth)) { XGetGeometry(XtDisplay(w), XmIconButton_pixmap(iw), &root, &x, &y, &local_width, &local_height, &bw, &depth); AddPixCache(XtDisplay(w), XmIconButton_pixmap(iw), local_width, local_height, depth); } IncPixCache(XtDisplay(w), XmIconButton_pixmap(iw)); XmIconButton_pix_width(iw) = local_width; XmIconButton_pix_height(iw) = local_height; XmIconButton_pix_depth(iw) = depth; } else { local_width = XmIconButton_pix_width(iw); local_height = XmIconButton_pix_height(iw); depth = XmIconButton_pix_depth(iw); } switch (XmIconButton_icon_placement(iw)) { case XmIconTop: case XmIconBottom: total_height += local_height + XmIconButton_icon_text_padding(iw); if ( local_width > total_width ) total_width = local_width; break; case XmIconOnly: total_height = local_height; total_width = local_width; break; case XmIconLeft: case XmIconRight: total_width += local_width + XmIconButton_icon_text_padding(iw); if (local_height > total_height) total_height = local_height; break; default: break; } } else { XmIconButton_pix_width(iw) = XmIconButton_pix_height(iw) = 0; XmIconButton_pix_depth(iw) = 0; } *height = total_height + 2 * V_SPACE(iw); *width = total_width + 2 * H_SPACE(iw); } /* Function Name: RequestNewSize * Description: Asks our parent for a new size. * Arguments: w - the Icon Button widget. * width, height - the width and height we want to be. * Returns: none. */ static void RequestNewSize(Widget w, Dimension width, Dimension height) { Dimension w_ret, h_ret; XtGeometryResult ret_val; ret_val = XtMakeResizeRequest(w, width, height, &w_ret, &h_ret); if (ret_val == XtGeometryAlmost) (void) XtMakeResizeRequest(w, w_ret, h_ret, NULL, NULL); Resize(w); /* May not have been called. */ } /* Function Name: CalcLocations * Description: Calculates where the icon and strings should be * painted. * Arguments: w - the icon button widget. * Returns: none. */ static void CalcLocations(Widget w) { XmIconButtonWidget iw = (XmIconButtonWidget) w; Dimension width, height, d_width, d_height; Dimension extra_y_space; Boolean have_pixmap = True; width = w->core.width; height = w->core.height; GetDesiredSize(w, &d_width, &d_height); if (height > d_height) extra_y_space = (int)(height - d_height)/2; else extra_y_space = 0; XmIconButton_max_text_width(iw) = width - 2 * H_SPACE(iw); XmIconButton_max_text_height(iw) = height - 2 * V_SPACE(iw); XmIconButton_text_x(iw) = H_SPACE(iw); XmIconButton_text_y(iw) = V_SPACE(iw); if( XmIconButton_icon_placement(iw) != XmIconNone && ValidPixmap(XmIconButton_pixmap(iw)) ) { /* * Here we actually have a pixmap so lets figure out the * location of the pixmap. First we will loook at the * horizontal position. */ switch (XmIconButton_icon_placement(iw)) { case XmIconLeft: /* Flush Left */ XmIconButton_pix_x(iw) = (Position) H_SPACE(iw); break; case XmIconRight: /* Flush Right */ XmIconButton_pix_x(iw) = (Position) (width - H_SPACE(iw) - XmIconButton_pix_width(iw)); break; default: /* Centered */ XmIconButton_pix_x(iw) = ((Position) width - (Position) XmIconButton_pix_width(iw))/2; break; } /* * Now lets deside on the the vertical position */ switch (XmIconButton_icon_placement(iw)) { case XmIconTop: /* Centered At the top */ XmIconButton_pix_y(iw) = V_SPACE(iw) + extra_y_space; break; case XmIconBottom: /* Centered at the bottom */ XmIconButton_pix_y(iw) = ((Position) height - ((Position) V_SPACE(iw) + (Position) extra_y_space + (Position) XmIconButton_pix_height(iw))); break; default: /* Centered */ XmIconButton_pix_y(iw) = ((Position) height - (Position) XmIconButton_pix_height(iw))/2; break; } } else { /* * If we get here that means that we do not have a pixmap * to play with so lets just zero the x and y locations of the * pixmap. */ XmIconButton_pix_x(iw) = XmIconButton_pix_y(iw) = 0; have_pixmap = False; } /* * Now that we know the location of the pixmap, lets go and try to * find out what we want to do with the XmString if there is one. */ if( XmIconButton_icon_placement(iw) != XmIconOnly ) { Dimension text_width, text_height; int tmp; /* * First let find out what the size of the string we have is */ XmStringExtent(XmIconButton_font_list(iw), XmIconButton_label_string(iw), &text_width, &text_height); XmIconButton_max_text_height(iw) = text_height; switch (XmIconButton_icon_placement(iw)) { case XmIconLeft: /* Aligned to Right of Icon. */ /* * If the pixmap is to our left then we can use all the * space to the right of the pixmap. */ if( have_pixmap ) { XmIconButton_text_x(iw) = XmIconButton_pix_x(iw) + XmIconButton_pix_width(iw) + XmIconButton_icon_text_padding(iw); if( (tmp = (int)width - (int)H_SPACE(iw) - (int)XmIconButton_text_x(iw)) < 0 ) { tmp = 0; } XmIconButton_max_text_width(iw) = tmp; } break; case XmIconRight: /* Aligned to left of Icon. */ if( have_pixmap ) { XmIconButton_text_x(iw) = H_SPACE(iw); if( (tmp = XmIconButton_pix_x(iw) - XmIconButton_text_x(iw)) < 0 ) tmp = 0; XmIconButton_max_text_width(iw) = tmp; } break; default: break; } switch (XmIconButton_icon_placement(iw)) { case XmIconTop: /* Along Bottom. */ XmIconButton_text_y(iw) = height - (V_SPACE(iw) + (Position)text_height); if( have_pixmap ) { tmp = XmIconButton_pix_y(iw) + XmIconButton_pix_height(iw) + XmIconButton_icon_text_padding(iw); if( XmIconButton_text_y(iw) < tmp ) { XmIconButton_text_y(iw) = tmp; if( (tmp = height - V_SPACE(iw) - XmIconButton_text_y(iw)) < 0 ) tmp = 0; XmIconButton_max_text_height(iw) = tmp; } } break; case XmIconBottom: /* Along Top. */ XmIconButton_text_y(iw) = V_SPACE(iw); if( have_pixmap ) { tmp = XmIconButton_pix_y(iw) - XmIconButton_icon_text_padding(iw) - XmIconButton_text_y(iw); if( tmp < 0 ) tmp = 0; XmIconButton_max_text_height(iw) = tmp; } break; default: /* Centered. */ XmIconButton_text_y(iw) = ((Position) height - (Position) text_height)/2; break; } } /* * Else * * Text_x and Text_y are garbage, but never used. */ } /* Function Name: DrawTextAndImage * Description: Renders the Text and the image. * Arguments: w - the icon button widget. * text_gc - gc to use when drawing the text. * icon_gc - gc to use when drawing the icon. * icon_stippled_gc - gc to use to fake a stipple * on the image. * Returns: none. */ static void DrawTextAndImage(Widget w, GC text_gc, GC icon_gc, GC icon_stippled_gc) { XmIconButtonWidget iw = (XmIconButtonWidget) w; if( XmIconButton_icon_placement(iw) != XmIconNone && ValidPixmap(XmIconButton_pixmap(iw)) ) { if (XmIconButton_pix_depth(iw) == 1) { XCopyPlane(XtDisplay(w), XmIconButton_pixmap(iw), XtWindow(w), icon_gc, 0, 0, XmIconButton_pix_width(iw), XmIconButton_pix_height(iw), XmIconButton_pix_x(iw), XmIconButton_pix_y(iw), 1L); } else { XCopyArea(XtDisplay(w), XmIconButton_pixmap(iw), XtWindow(w), icon_gc, 0, 0, XmIconButton_pix_width(iw), XmIconButton_pix_height(iw), XmIconButton_pix_x(iw), XmIconButton_pix_y(iw)); } /* * Stipple the background color over the top of the image * since XCopyPlace and Area do not use the tile or stipple. */ if( icon_stippled_gc != None ) { XFillRectangle(XtDisplay(w), XtWindow(w), icon_stippled_gc, XmIconButton_pix_x(iw), XmIconButton_pix_y(iw), XmIconButton_pix_width(iw), XmIconButton_pix_height(iw)); } } if( XmIconButton_icon_placement(iw) != XmIconOnly ) { int size, tmp; XRectangle clip; clip.x = XmIconButton_text_x(iw); clip.y = XmIconButton_text_y(iw); clip.width = XmIconButton_max_text_width(iw); clip.height = XmIconButton_max_text_height(iw); if( (int)clip.x < (int)H_SPACE(iw) ) clip.x = H_SPACE(iw); if( (int)clip.y < (int)V_SPACE(iw) ) clip.y = V_SPACE(iw); size = XtWidth(iw) - H_SPACE(iw); if( (int) (clip.x + clip.width) > size ) { tmp = size - (int)clip.x; if( tmp < 0 ) tmp = 0; clip.width = tmp; } size = XtHeight(iw) - V_SPACE(iw); if( (int)(clip.y + clip.height) > size ) { tmp = size - (int)clip.y; if( tmp < 0 ) tmp = 0; clip.height = tmp; } if( clip.width != 0 && clip.height != 0 ) { /* * Set the clip rectangle so things do not * overlap or go out of bounds. */ XSetClipRectangles(XtDisplay(w), text_gc, 0, 0, &clip, 1, Unsorted); #ifdef FIX_1381 /*Draw shadow for insensitive text*/ if (!XtIsSensitive(w)) { XmStringDraw(XtDisplay(w), XtWindow(w), XmIconButton_font_list(iw), XmIconButton_label_string(iw), XmIconButton_shadow_gc(iw), XmIconButton_text_x(iw)+1, XmIconButton_text_y(iw)+1, XmIconButton_max_text_width(iw), XmIconButton_alignment(iw), XmPrim_layout_direction(iw), NULL); } #endif XmStringDraw(XtDisplay(w), XtWindow(w), XmIconButton_font_list(iw), XmIconButton_label_string(iw), text_gc, XmIconButton_text_x(iw), XmIconButton_text_y(iw), XmIconButton_max_text_width(iw), XmIconButton_alignment(iw), XmPrim_layout_direction(iw), NULL); XSetClipMask(XtDisplay(w), text_gc, None); } } } /* * There is almost always only 1 display, and certainly only a few, therefore * there is no need to be clever here, just make sure it works for one * fast, and doesn't break when using many. * * Would be nice to refocunt and remove... */ static Pixmap GetGreyStipple(Widget w) { StippleInfo *set, *ptr; for (ptr = stipple_cache; ptr != NULL; ptr = ptr->next) { /* Check for both screen and display, such that it displays */ /* correctly on multi-headed X-servers. */ /* Change Request #: CR03619 */ if (ptr->disp == XtDisplay(w) && ptr->screen == XtScreen(w)) { return (ptr->stipple); } } set = (StippleInfo *) XtMalloc(sizeof(StippleInfo)); set->stipple = XCreateBitmapFromData(XtDisplay(w), RootWindowOfScreen(XtScreen(w)), gray_bits, gray_width, gray_height); set->disp = XtDisplay(w); set->screen = XtScreen(w); set->next = NULL; if (stipple_cache == NULL) stipple_cache = set; else for (ptr = stipple_cache; ptr != NULL; ptr = ptr->next) if (ptr->next == NULL) { ptr->next = set; break; } return(set->stipple); } /* Function Name: CreateGCs * Description: Creates the Graphics contexts * Arguments: w - the icon button widget. * Returns: none */ static void CreateGCs(Widget w) { XmIconButtonWidget iw = (XmIconButtonWidget) w; XtGCMask mask, smask; XGCValues values; Pixel fg, bg; Pixmap stipple; Arg args[2]; Cardinal num_args = 0; XFontStruct *fs = NULL; XtSetArg(args[num_args], XmNforeground, &fg); num_args++; XtSetArg(args[num_args], XmNbackground, &bg); num_args++; XtGetValues(w, args, num_args); stipple = GetGreyStipple(w); XmeRenderTableGetDefaultFont(XmIconButton_font_list(iw), &fs); values.foreground = fg; values.background = bg; values.graphics_exposures = False; values.stipple = stipple; values.fill_style = FillStippled; mask = GCForeground | GCBackground | GCGraphicsExposures; #ifdef FIX_1381 smask = mask | GCFillStyle; #else smask = mask | GCStipple | GCFillStyle; #endif if (fs) { values.font = fs->fid; mask |= GCFont; } XmIconButton_gc(iw) = XtGetGC(w, mask, &values); #ifdef FIX_1381 /*generally gray insensitive foreground (instead stipple)*/ values.foreground = _XmAssignInsensitiveColor((Widget)iw); XmIconButton_insensitive_text_gc(iw) = XtGetGC(w, smask, &values); #else XmIconButton_stippled_text_gc(iw) = XtGetGC(w, smask, &values); #endif #ifdef FIX_1381 /*light shadow for insensitive text (instead stipple)*/ values.foreground = iw->primitive.top_shadow_color; XmIconButton_shadow_gc(iw) = XtGetGC(w, smask, &values); #endif /* * HACK ALERT: !!! Motif hack for monochrome displays. !!! * If fg and arm color are the same then replace fg color * with bg color. */ if (values.foreground == XmIconButton_arm_color(iw)) values.foreground = bg; /* * else just use the same fg color we used to be using. */ values.background = XmIconButton_arm_color(iw); XmIconButton_pixmap_fill_gc(iw) = XtGetGC(w, mask, &values); XmIconButton_stippled_set_text_gc(iw) = XtGetGC(w, smask, &values); mask = GCForeground; values.foreground = XmIconButton_arm_color(iw); XmIconButton_fill_gc(iw) = XtGetGC(w, mask, &values); values.foreground = bg; smask = mask | GCStipple | GCFillStyle; XmIconButton_stippled_unset_gc(iw) = XtGetGC(w, smask, &values); values.foreground = XmIconButton_arm_color(iw); XmIconButton_stippled_set_gc(iw) = XtGetGC(w, smask, &values); } /* Function Name: DestroyGCs * Description: Destroys all GC's needed by icon button. * Arguments: w - the icon button widget. * Returns: none. */ static void DestroyGCs(Widget w) { XmIconButtonWidget iw = (XmIconButtonWidget) w; XtReleaseGC(w, XmIconButton_gc(iw)); XtReleaseGC(w, XmIconButton_fill_gc(iw)); XtReleaseGC(w, XmIconButton_pixmap_fill_gc(iw)); XtReleaseGC(w, XmIconButton_stippled_set_gc(iw)); XtReleaseGC(w, XmIconButton_stippled_unset_gc(iw)); #ifdef FIX_1381 XtReleaseGC(w, XmIconButton_shadow_gc(iw)); XtReleaseGC(w, XmIconButton_insensitive_text_gc(iw)); #else XtReleaseGC(w, XmIconButton_stippled_text_gc(iw)); #endif XtReleaseGC(w, XmIconButton_stippled_set_text_gc(iw)); } /* Function Name: CreateXmString * Description: Given a char * create an Xm String. * an remember to put in the new lines. * Arguments: str - the String. * Returns: The Motif string for this string. */ static XmString CreateXmString(Widget w, String str) { XrmValue fromVal, toVal; XmString xmstr; fromVal.size = strlen(str) + 1; /* space for NULL. */ fromVal.addr = str; toVal.size = sizeof(XmString); toVal.addr = (XtPointer) &xmstr; if (XtConvertAndStore(w, XmRString, &fromVal, XmRXmString, &toVal)) { xmstr = XmStringCopy(xmstr); /* because I free it later. */ return(xmstr); } return(NULL); } /* * XmRCallProc routine for checking font_list before setting it to NULL * If "check_set_render_table" is True, then function has * been called twice on same widget, thus resource needs to be set NULL, * otherwise leave it alone. */ /*ARGSUSED*/ static void CheckSetRenderTable(Widget wid, int offs, XrmValue *value) { XmIconButtonWidget lw = (XmIconButtonWidget)wid; /* Check if been here before */ if (lw->icon.check_set_render_table) value->addr = NULL; else { lw->icon.check_set_render_table = True; value->addr = (char*)&(lw->icon.font_list); } } /* Function name: ChangeCB * Description: add or remove the activate callback list. * Arguments: w - the child widget ha� its list of callbacks modified * activCB - the callback to add or remove from * closure - additional data to be passed to the callback * setunset - set/unset flag * Returns: none */ static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) { if (setunset) XtAddCallback (w, XmNactivateCallback, activCB, closure); else XtRemoveCallback (w, XmNactivateCallback, activCB, closure); } /************************************************************ * * Public routines. * ************************************************************/ /* Function Name: XmCreateIconButton * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateIconButton(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmIconButtonWidgetClass, parent, args, num_args)); } motif-2.3.8/lib/Xm/AtomMgr.c0000644000175000017500000000402113145162623012427 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: AtomMgr.c /main/13 1997/09/08 14:06:18 cshi $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include #include #include /***************************************************************************** * * XmInternAtom() * ****************************************************************************/ Atom XmInternAtom( Display *display, String name, #if NeedWidePrototypes int only_if_exists ) #else Boolean only_if_exists ) #endif /* NeedWidePrototypes */ { /* While not yet obsolete, this routine is not in favor. Use */ /* XInternAtom directly. */ return XInternAtom(display, name, only_if_exists); } /***************************************************************************** * * XmGetAtomName() * ****************************************************************************/ String XmGetAtomName( Display *display, Atom atom ) { /* While not yet obsolete, this routine is not in favor. Use */ /* XGetAtomName directly. */ return XGetAtomName(display, atom); } motif-2.3.8/lib/Xm/XmosI.h0000644000175000017500000001007012672140200012115 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: XmosI.h /main/6 1995/07/13 18:28:56 drk $ */ #ifndef _XmosI_h #define _XmosI_h #include #ifdef __cplusplus extern "C" { #endif /* Vendor dependent macro for XmCvtXmStringToCT */ /* Sample implementation treats unmapped charsets as locale encoded text. */ #define _XmOSProcessUnmappedCharsetAndText(tag, ctext, sep, outc, outl, prev) \ processCharsetAndText(XmFONTLIST_DEFAULT_TAG, (ctext), (sep), \ (outc), (outl), (prev)) /******** Private Function Declarations ********/ extern String _XmOSFindPatternPart( String fileSpec) ; extern void _XmOSQualifyFileSpec( String dirSpec, String filterSpec, String *pQualifiedDir, String *pQualifiedPattern) ; extern void _XmOSGetDirEntries( String qualifiedDir, String matchPattern, #if NeedWidePrototypes unsigned int fileType, int matchDotsLiterally, int listWithFullPath, #else unsigned char fileType, Boolean matchDotsLiterally, Boolean listWithFullPath, #endif /* NeedWidePrototypes */ String **pEntries, unsigned int *pNumEntries, unsigned int *pNumAlloc) ; extern void _XmOSBuildFileList( String dirPath, String pattern, #if NeedWidePrototypes unsigned int typeMask, #else unsigned char typeMask, #endif /* NeedWidePrototypes */ String **pEntries, unsigned int *pNumEntries, unsigned int *pNumAlloc) ; extern int _XmOSFileCompare( XmConst void *sp1, XmConst void *sp2) ; extern String _XmOSInitPath( String file_name, String env_pathname, Boolean *user_path) ; extern String _XmOSBuildFileName( String file, String path) ; extern int _XmOSPutenv( char *string); extern void _XmOSGenerateMaskName( String imageName, String maskNameBuf) ; extern Status _XmOSGetInitialCharsDirection(XtPointer characters, XmTextType type, XmStringTag locale, unsigned int *num_bytes, XmDirection *direction) ; extern XmDirection _XmOSGetCharDirection(XtPointer character, XmTextType type, XmStringTag locale) ; extern int _XmOSKeySymToCharacter(KeySym keysym, char *locale, char *buffer); extern void _XmOSFindPathParts(String path, String *filenameRtn, String *suffixRtn); extern Boolean _XmOSAbsolutePathName( String path, String *pathRtn, String buf) ; /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmosI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Scale.h0000644000175000017500000000444413145162623012126 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScale_h #define _XmScale_h #include #ifdef __cplusplus extern "C" { #endif /* Class record constants */ externalref WidgetClass xmScaleWidgetClass; /* fast XtIsSubclass define */ #ifndef XmIsScale #define XmIsScale(w) XtIsSubclass (w, xmScaleWidgetClass) #endif typedef struct _XmScaleClassRec * XmScaleWidgetClass; typedef struct _XmScaleRec * XmScaleWidget; /******** Public Function Declarations ********/ void XmScaleSetValue( Widget w, int value) ; void XmScaleGetValue( Widget w, int *value) ; Widget XmCreateScale( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; Widget XmVaCreateScale( Widget parent, char *name, ...); Widget XmVaCreateManagedScale( Widget parent, char *name, ...); void XmScaleSetTicks( Widget scale, int big_every, Cardinal num_med, Cardinal num_small, Dimension size_big, Dimension size_med, Dimension size_small); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScale_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/TextFunc.c0000644000175000017500000005262613145162623012637 00000000000000/* $XConsortium: TextFunc.c /main/16 1996/11/19 12:37:29 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "XmI.h" #include "TextFI.h" #include "TextI.h" #include "TextInI.h" #include "TextStrSoI.h" /**************************************************************** * * Public definitions with TextField calls. * ****************************************************************/ XmTextPosition XmTextGetLastPosition(Widget widget) { XmTextPosition ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)){ XmTextFieldWidget tf = (XmTextFieldWidget) widget; ret_val = tf->text.string_length; } else { XmTextSource source; source = GetSrc(widget); ret_val = (*source->Scan)(source, 0, XmSELECT_ALL, XmsdRight, 1, TRUE); } _XmAppUnlock(app); return ret_val; } void _XmTextReplace(Widget widget, XmTextPosition frompos, XmTextPosition topos, char *value, #if NeedWidePrototypes int is_wchar) #else Boolean is_wchar) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) widget; XmTextSource source; XmTextBlockRec block, newblock; Boolean editable, freeBlock; Boolean need_free = False; int max_length; int num_chars; wchar_t * tmp_wc; XmTextPosition selleft, selright, cursorPos; char * tmp_block = NULL; source = GetSrc(tw); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); if ((*source->GetSelection)(tw->text.source, &selleft, &selright)) { if ((selleft > frompos && selleft < topos) || (selright >frompos && selright < topos) || (selleft <= frompos && selright >= topos)) { (*source->SetSelection)(tw->text.source, tw->text.cursor_position, tw->text.cursor_position, XtLastTimestampProcessed(XtDisplay(widget))); if (tw->text.input->data->pendingdelete) tw->text.pendingoff = FALSE; } } block.format = XmFMT_8_BIT; if (!is_wchar) { if (value == NULL) block.length = 0; else block.length = strlen(value); block.ptr = value; } else { /* value is really a wchar_t ptr cast to char* */ if (value == NULL) { block.length = 0; } else { for (tmp_wc = (wchar_t*)value, num_chars = 0; *tmp_wc != (wchar_t)0L; num_chars++) tmp_wc++; tmp_block = XtMalloc((unsigned) (num_chars + 1) * (int)tw->text.char_size); block.ptr = tmp_block; need_free = True; tmp_wc = (wchar_t *) value; /* if successful, wcstombs returns number of bytes, else -1 */ block.length = wcstombs(block.ptr, tmp_wc, (num_chars + 1) * (int)tw->text.char_size); if (block.length == -1) { block.length = 0; /* if error, don't insert anything */ block.ptr[0] = '\0'; /* use the empty string */ } } } editable = _XmStringSourceGetEditable(source); max_length = _XmStringSourceGetMaxLength(source); _XmStringSourceSetEditable(source, TRUE); _XmStringSourceSetMaxLength(source, INT_MAX); if (_XmTextModifyVerify(tw, NULL, &frompos, &topos, &cursorPos, &block, &newblock, &freeBlock)) { (*source->Replace)(tw, NULL, &frompos, &topos, &newblock, False); if (frompos == tw->text.cursor_position && frompos == topos) { _XmTextSetCursorPosition((Widget)tw, cursorPos); } _XmTextValueChanged(tw, NULL); if (UnderVerifyPreedit(tw)) if (newblock.length != block.length || strncmp(newblock.ptr, block.ptr, block.length) != 0) { VerifyCommitNeeded(tw) = True; PreEndTW(tw) += _XmTextCountCharacters(newblock.ptr, newblock.length) - _XmTextCountCharacters(block.ptr, block.length); } if (freeBlock && newblock.ptr) XtFree(newblock.ptr); } else if (UnderVerifyPreedit(tw)) { VerifyCommitNeeded(tw) = True; PreEndTW(tw) -= _XmTextCountCharacters(block.ptr, block.length); } if (need_free) XtFree(tmp_block); _XmStringSourceSetEditable(source, editable); _XmStringSourceSetMaxLength(source, max_length); if (tw->text.input->data->has_destination) _XmTextSetDestinationSelection(widget, tw->text.cursor_position, False, XtLastTimestampProcessed(XtDisplay(widget))); (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); } void XmTextReplace(Widget widget, XmTextPosition frompos, XmTextPosition topos, char *value) { if (XmIsTextField(widget)) XmTextFieldReplace(widget, frompos, topos, value); else { _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextReplace(widget, frompos, topos, value, False); _XmAppUnlock(app); } } void XmTextReplaceWcs(Widget widget, XmTextPosition frompos, XmTextPosition topos, wchar_t *value) { if (XmIsTextField(widget)) XmTextFieldReplaceWcs(widget, frompos, topos, (wchar_t*) value); else { _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextReplace(widget, frompos, topos, (char*) value, True); _XmAppUnlock(app); } } void XmTextInsert(Widget widget, XmTextPosition position, char *value) { XmTextReplace(widget, position, position, value); } void XmTextInsertWcs(Widget widget, XmTextPosition position, wchar_t *wc_value) { XmTextReplaceWcs(widget, position, position, wc_value); } void XmTextSetAddMode(Widget widget, #if NeedWidePrototypes int state) #else Boolean state) #endif /* NeedWidePrototypes */ { if (XmIsTextField(widget)) XmTextFieldSetAddMode(widget, state); else { XmTextWidget tw = (XmTextWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); if (tw->text.add_mode == state) { _XmAppUnlock(app); return; } (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, off); tw->text.add_mode = state; (*tw->text.output->DrawInsertionPoint)(tw, tw->text.cursor_position, on); _XmAppUnlock(app); } } Boolean XmTextGetAddMode(Widget widget) { Boolean ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)){ XmTextFieldWidget tf = (XmTextFieldWidget) widget; ret_val = tf->text.add_mode; } else { XmTextWidget tw = (XmTextWidget) widget; ret_val = tw->text.add_mode; } _XmAppUnlock(app); return ret_val; } Boolean XmTextGetEditable(Widget widget) { Boolean ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) ret_val = TextF_Editable(widget); else ret_val = _XmStringSourceGetEditable(GetSrc(widget)); _XmAppUnlock(app); return ret_val; } void XmTextSetEditable(Widget widget, #if NeedWidePrototypes int editable) #else Boolean editable) #endif /* NeedWidePrototypes */ { if (XmIsTextField(widget)) XmTextFieldSetEditable(widget, editable); else { _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextSetEditable(widget, editable); _XmAppUnlock(app); } } int XmTextGetMaxLength(Widget widget) { int ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) ret_val = TextF_MaxLength(widget); else ret_val = _XmStringSourceGetMaxLength(GetSrc(widget)); _XmAppUnlock(app); return ret_val; } void XmTextSetMaxLength(Widget widget, int max_length) { _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) TextF_MaxLength(widget) = max_length; else { XmTextWidget tw = (XmTextWidget) widget; tw->text.max_length = max_length; _XmStringSourceSetMaxLength(GetSrc(tw), max_length); } _XmAppUnlock(app); } XmTextPosition XmTextGetInsertionPosition(Widget widget) { XmTextPosition ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) ret_val = TextF_CursorPosition(widget); else { XmTextWidget tw = (XmTextWidget) widget; ret_val = tw->text.cursor_position; } _XmAppUnlock(app); return ret_val; } void XmTextSetInsertionPosition(Widget widget, XmTextPosition position) { XmTextWidget tw = (XmTextWidget) widget; if (XmIsTextField(widget)) XmTextFieldSetInsertionPosition(widget, position); else { _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextResetIC(widget); _XmTextSetCursorPosition(widget, position); _XmTextSetDestinationSelection(widget, tw->text.cursor_position, False, XtLastTimestampProcessed(XtDisplay(widget))); _XmAppUnlock(app); } } Boolean XmTextRemove(Widget widget) { if (XmIsTextField(widget)) return(XmTextFieldRemove(widget)); else { XmTextWidget tw = (XmTextWidget) widget; XmTextSource source; XmTextPosition left, right; _XmWidgetToAppContext(widget); _XmAppLock(app); if (tw->text.editable == False) { _XmAppUnlock(app); return False; } source = tw->text.source; _XmTextResetIC(widget); if (!(*source->GetSelection)(source, &left, &right) || left == right) { tw->text.input->data->anchor = tw->text.cursor_position; _XmAppUnlock(app); return False; } XmTextReplace(widget, left, right, NULL); if (tw->text.cursor_position > left) _XmTextSetCursorPosition(widget, left); tw->text.input->data->anchor = tw->text.cursor_position; _XmAppUnlock(app); return True; } } Boolean XmTextCopy(Widget widget, Time copy_time) { Boolean result = False; XmTextPosition left, right; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmTextGetSelectionPosition(widget, &left, &right) && right != left) /* start copy to clipboard */ result = XmeClipboardSource(widget, XmCOPY, copy_time); _XmAppUnlock(app); return result; } Boolean XmTextCopyLink(Widget widget, Time copy_time) { Boolean result = False; XmTextPosition left, right; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmTextGetSelectionPosition(widget, &left, &right) && right != left) /* start copy to clipboard */ result = XmeClipboardSource(widget, XmLINK, copy_time); _XmAppUnlock(app); return result; } Boolean XmTextCut(Widget widget, Time cut_time) { Boolean result = False; XmTextPosition left, right; _XmWidgetToAppContext(widget); _XmAppLock(app); /* can't cut if you can't edit */ if (XmTextGetEditable(widget) && XmTextGetSelectionPosition(widget, &left, &right) && (right != left)) /* start copy to clipboard */ result = XmeClipboardSource(widget, XmMOVE, cut_time); _XmAppUnlock(app); return result; } /* * Retrieves the current data from the clipboard * and paste it at the current cursor position */ Boolean XmTextPaste(Widget widget) { Boolean status; InputData data; if (XmIsTextField(widget)) return XmTextFieldPaste(widget); _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextResetIC(widget); data = ((XmTextWidget) widget)->text.input->data; data->selectionMove = FALSE; data->selectionLink = FALSE; status = XmeClipboardSink(widget, XmCOPY, NULL); _XmAppUnlock(app); return(status); } /* * Retrieves the current data from the clipboard * and paste it at the current cursor position */ Boolean XmTextPasteLink(Widget widget) { Boolean status; InputData data; _XmWidgetToAppContext(widget); _XmAppLock(app); data = ((XmTextWidget) widget)->text.input->data; data->selectionMove = FALSE; data->selectionLink = True; status = XmeClipboardSink(widget, XmLINK, NULL); _XmAppUnlock(app); return(status); } char * XmTextGetSelection(Widget widget) { if (XmIsTextField(widget)) return(XmTextFieldGetSelection(widget)); else { XmTextSource source; XmTextPosition left, right; char *ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); source = GetSrc(widget); if ((!(*source->GetSelection)(source, &left, &right)) || right == left) { _XmAppUnlock(app); return NULL; } ret_val = _XmStringSourceGetString((XmTextWidget)widget, left, right, False); _XmAppUnlock(app); return ret_val; } } wchar_t * XmTextGetSelectionWcs(Widget widget) { if (XmIsTextField(widget)) return(XmTextFieldGetSelectionWcs(widget)); else { XmTextSource source; XmTextPosition left, right; wchar_t *ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); source = GetSrc(widget); if (!(*source->GetSelection)(source, &left, &right)) { _XmAppUnlock(app); return NULL; } ret_val = (wchar_t *)_XmStringSourceGetString((XmTextWidget)widget, left, right, True); _XmAppUnlock(app); return ret_val; } } void XmTextSetSelection(Widget widget, XmTextPosition first, XmTextPosition last, Time set_time) { if (XmIsTextField(widget)) XmTextFieldSetSelection(widget, first, last, set_time); else { XmTextSource source; XmTextWidget tw = (XmTextWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextResetIC(widget); if (first < 0 || last > tw->text.last_position) { _XmAppUnlock(app); return; } source = GetSrc(widget); source->data->take_selection = True; (*source->SetSelection)(source, first, last, set_time); tw->text.pendingoff = FALSE; _XmTextSetCursorPosition(widget, last); _XmTextSetDestinationSelection(widget, tw->text.cursor_position, False, set_time); _XmAppUnlock(app); } } void XmTextClearSelection(Widget widget, Time clear_time) { if (XmIsTextField(widget)) XmTextFieldClearSelection(widget, clear_time); else { XmTextWidget tw = (XmTextWidget) widget; XmTextSource source = GetSrc(widget); _XmWidgetToAppContext(widget); _XmAppLock(app); (*source->SetSelection)(source, 1, -999, source->data->prim_time); if (tw->text.input->data->pendingdelete) { tw->text.pendingoff = FALSE; } _XmAppUnlock(app); } } Boolean XmTextGetSelectionPosition(Widget widget, XmTextPosition *left, XmTextPosition *right) { Boolean ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) { XmTextFieldWidget tf = (XmTextFieldWidget) widget; if (!tf->text.has_primary) { ret_val = False; } else { *left = tf->text.prim_pos_left; *right = tf->text.prim_pos_right; ret_val = True; } } else { XmTextWidget tw = (XmTextWidget) widget; ret_val = (*tw->text.source->GetSelection)(tw->text.source, left, right); } _XmAppUnlock(app); return ret_val; } XmTextPosition XmTextXYToPos(Widget widget, #if NeedWidePrototypes int x, int y) #else Position x, Position y) #endif /* NeedWidePrototypes */ { if (XmIsTextField(widget)) return(XmTextFieldXYToPos(widget, x, y)); else { XmTextWidget tw = (XmTextWidget) widget; XmTextPosition ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); ret_val = (*tw->text.output->XYToPos)(tw, x, y); _XmAppUnlock(app); return ret_val; } } Boolean XmTextPosToXY(Widget widget, XmTextPosition position, Position *x, Position *y) { if (XmIsTextField(widget)) return(XmTextFieldPosToXY(widget, position, x, y)); else { XmTextWidget tw = (XmTextWidget) widget; Boolean ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); ret_val = (*tw->text.output->PosToXY)(tw, position, x, y); _XmAppUnlock(app); return ret_val; } } /* * Force the given position to be displayed. If position < 0, then don't force * any position to be displayed. */ /* ARGSUSED */ void XmTextShowPosition(Widget widget, XmTextPosition position) { if (XmIsTextField(widget)) XmTextFieldShowPosition(widget, position); else { _XmWidgetToAppContext(widget); _XmAppLock(app); _XmTextShowPosition(widget, position); _XmAppUnlock(app); } } int XmTextGetBaseline(Widget widget) { _XmWidgetToAppContext(widget); _XmAppLock(app); if (XmIsTextField(widget)) { XmTextFieldWidget tf = (XmTextFieldWidget) widget; Dimension margin_top; int ret_val; if(XmDirectionMatch(XmPrim_layout_direction(tf), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { _XmAppUnlock(app); return(0); } margin_top = tf->text.margin_top + tf->primitive.shadow_thickness + tf->primitive.highlight_thickness; ret_val = (int) margin_top + (int) TextF_FontAscent(tf); _XmAppUnlock(app); return ret_val; } else { Dimension *baselines; int temp_bl; int line_count; XmPrimitiveClassExt *wcePtr; XmTextWidget tw = (XmTextWidget) widget; if(XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { _XmAppUnlock(app); return(0); } wcePtr = _XmGetPrimitiveClassExtPtr(XtClass(widget), NULLQUARK); if (*wcePtr && (*wcePtr)->widget_baseline) (void) (*(*wcePtr)->widget_baseline)(widget, &baselines, &line_count); if (line_count) temp_bl = (int) baselines[0]; else temp_bl = 0; XtFree((char *) baselines); _XmAppUnlock(app); return (temp_bl); } } int XmTextGetCenterline(Widget widget) { Dimension *baselines; int temp_bl; int line_count; XmPrimitiveClassExt *wcePtr; XmTextWidget tw = (XmTextWidget) widget; _XmWidgetToAppContext(widget); _XmAppLock(app); if (!XmDirectionMatch(XmPrim_layout_direction(tw), XmTOP_TO_BOTTOM_RIGHT_TO_LEFT)) { _XmAppUnlock(app); return(0); } wcePtr = _XmGetPrimitiveClassExtPtr(XtClass(widget), NULLQUARK); if (*wcePtr && (*wcePtr)->widget_baseline) (void) (*(*wcePtr)->widget_baseline)(widget, &baselines, &line_count); if (line_count) temp_bl = (int) baselines[0]; else temp_bl = 0; XtFree((char *) baselines); _XmAppUnlock(app); return (temp_bl); } void XmTextSetHighlight(Widget w, XmTextPosition left, XmTextPosition right, XmHighlightMode mode) { if (XmIsTextField(w)) { XmTextFieldSetHighlight(w, left, right, mode); } else { _XmWidgetToAppContext(w); _XmAppLock(app); _XmTextSetHighlight(w, left, right, mode); _XmAppUnlock(app); } } static int _XmTextGetSubstring(Widget widget, XmTextPosition start, int num_chars, int buf_size, char *buffer, #if NeedWidePrototypes int want_wchar) #else Boolean want_wchar) #endif /* NeedWidePrototypes */ { XmTextWidget tw = (XmTextWidget) widget; XmTextBlockRec block; XmTextPosition pos, end; wchar_t * wc_buffer = (wchar_t*)buffer; int destpos = 0; end = start + num_chars; num_chars = 0; /* We're done with the value passed in, so let's * re-use it when needed for the wchar functionality * instead of creating a local automatic variable. */ for (pos = start; pos < end;) { pos = (*tw->text.source->ReadSource)(tw->text.source, pos, end, &block); if (block.length == 0) { if (!want_wchar) buffer[destpos] = '\0'; else wc_buffer[destpos] = (wchar_t)0L; return XmCOPY_TRUNCATED; } if (!want_wchar) { if (((destpos + block.length) * sizeof(char)) >= buf_size) return XmCOPY_FAILED; } else { /* Need number of characters for buffer comparison */ num_chars = _XmTextCountCharacters(block.ptr, block.length); if (((destpos + num_chars) * sizeof(char)) >= buf_size) return XmCOPY_FAILED; } if (!want_wchar) { (void)memcpy((void*)&buffer[destpos], (void*)block.ptr, block.length); destpos += block.length; } else { /* want wchar_t* data */ num_chars = mbstowcs(&wc_buffer[destpos], block.ptr, num_chars); if (num_chars < 0) num_chars = 0; destpos += num_chars; } } if (!want_wchar) buffer[destpos] = '\0'; else wc_buffer[destpos] = (wchar_t)0L; return XmCOPY_SUCCEEDED; } int XmTextGetSubstring(Widget widget, XmTextPosition start, int num_chars, int buf_size, char *buffer) { if (XmIsTextField(widget)) return (XmTextFieldGetSubstring(widget, start, num_chars, buf_size, buffer)); else { int ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); ret_val =_XmTextGetSubstring(widget, start, num_chars, buf_size, buffer, False); _XmAppUnlock(app); return ret_val; } } int XmTextGetSubstringWcs(Widget widget, XmTextPosition start, int num_chars, int buf_size, wchar_t *buffer) { if (XmIsTextField(widget)) return (XmTextFieldGetSubstringWcs(widget, start, num_chars, buf_size, buffer)); else { int ret_val; _XmWidgetToAppContext(widget); _XmAppLock(app); ret_val =_XmTextGetSubstring(widget, start, num_chars, buf_size, (char*) buffer, True); _XmAppUnlock(app); return ret_val; } } motif-2.3.8/lib/Xm/DropTrans.h0000644000175000017500000000411713145162623013010 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmDropTrans_h #define _XmDropTrans_h #include #ifdef __cplusplus extern "C" { #endif #define XmTRANSFER_FAILURE 0 #define XmTRANSFER_SUCCESS 1 externalref WidgetClass xmDropTransferObjectClass; typedef struct _XmDropTransferClassRec * XmDropTransferObjectClass; typedef struct _XmDropTransferRec * XmDropTransferObject; #ifndef XmIsDropTransfer #define XmIsDropTransfer(w) \ XtIsSubclass((w), xmDropTransferObjectClass) #endif /* XmIsDropTransfer */ typedef struct _XmDropTransferEntryRec { XtPointer client_data; Atom target; } XmDropTransferEntryRec, * XmDropTransferEntry; /******** Public Function Declarations ********/ extern Widget XmDropTransferStart( Widget refWidget, ArgList args, Cardinal argCount) ; extern void XmDropTransferAdd( Widget widget, XmDropTransferEntry transfers, Cardinal num_transfers) ; /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmDropTrans_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/ToggleBP.h0000644000175000017500000000737013145162623012543 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /******************************************** * * No new fields need to be defined * for the Toggle widget class record * ********************************************/ #ifndef _XmToggleButtonP_h #define _XmToggleButtonP_h #include #include #ifdef __cplusplus extern "C" { #endif typedef struct _XmToggleButtonClassPart { XtPointer extension; /* Pointer to extension record */ } XmToggleButtonClassPart; /**************************************************** * * Full class record declaration for Toggle class * ****************************************************/ typedef struct _XmToggleButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; XmLabelClassPart label_class; XmToggleButtonClassPart toggle_class; } XmToggleButtonClassRec; externalref XmToggleButtonClassRec xmToggleButtonClassRec; /******************************************** * * No new fields needed for instance record * ********************************************/ typedef struct _XmToggleButtonPart { unsigned char ind_type; Boolean visible; Dimension spacing; Dimension indicator_dim; Boolean indicator_set; Pixmap on_pixmap; Pixmap insen_pixmap; unsigned char set; unsigned char visual_set; /* used for visuals and does not reflect the true state of the button */ unsigned char ind_on; Boolean fill_on_select; Pixel select_color; GC select_GC; GC background_gc; GC arm_GC; /* used in menus when enableEtchedInMenu is set. */ XtCallbackList value_changed_CB, arm_CB, disarm_CB; Boolean Armed; unsigned char toggle_mode; Boolean reversed_select; Pixmap indeterminate_pixmap; Pixmap indeterminate_insensitive_pixmap; Pixel unselect_color; GC unselect_GC; GC indeterminate_GC; GC indeterminate_box_GC; Dimension ind_left_delta; Dimension ind_right_delta; Dimension ind_top_delta; Dimension ind_bottom_delta; Dimension detail_shadow_thickness ; } XmToggleButtonPart; /**************************************************************** * * Full instance record declaration * ****************************************************************/ typedef struct _XmToggleButtonRec { CorePart core; XmPrimitivePart primitive; XmLabelPart label; XmToggleButtonPart toggle; } XmToggleButtonRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmToggleButtonP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/GrabShell.c0000644000175000017500000004735613145162623012746 00000000000000/* $XConsortium: GrabShell.c /main/9 1996/08/15 17:12:04 pascale $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include "ColorI.h" #include "MenuShellI.h" #include "PixConvI.h" #include "UniqueEvnI.h" /* Warning messages */ #define default_translations _XmGrabShell_translations #define Events (EnterWindowMask | LeaveWindowMask | \ ButtonPressMask | ButtonReleaseMask) /******** Static Function Declarations ********/ #ifdef FIX_1445 static void MouseWheel (Widget grabshell, XEvent *event, String *params, Cardinal *num_params); #endif static void BtnUp (Widget grabshell, XEvent *event, String *params, Cardinal *num_params); static void BtnDown (Widget grabshell, XEvent *event, String *params, Cardinal *num_params); static void Popdown (Widget grabshell, XEvent *event, String *params, Cardinal *num_params); static void ClassPartInitialize (WidgetClass wc); static void Initialize (Widget req, Widget new_w, ArgList args, Cardinal *num_args); static Boolean SetValues (Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void Resize (Widget wid); static void ChangeManaged (Widget w); static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static void Destroy (Widget wid); static void MapNotifyHandler(Widget shell, XtPointer client_data, XEvent *, Boolean *); static void _XmFastExpose (Widget widget); static void DrawBorder (Widget widget); static void DoLayout (Widget gs); static void GSAllowEvents(Widget gs, int, Time); static int IgnoreXErrors(Display *, XErrorEvent *); /******** End Static Function Declarations ********/ static XtActionsRec actionsList[] = { { "GrabShellBtnDown", BtnDown }, { "GrabShellBtnUp", BtnUp }, { "GrabShellPopdown", Popdown } #ifdef FIX_1445 , { "GrabShellMouseWheel", MouseWheel } #endif }; #define Offset(field) (XtOffsetOf(XmGrabShellRec, field)) static XtResource resources[] = { { XmNallowShellResize, XmCAllowShellResize, XmRBoolean, sizeof(Boolean), Offset(shell.allow_shell_resize), XtRImmediate, (XtPointer)TRUE }, { XmNbackground, XmCBackground, XmRPixel, sizeof (Pixel), Offset(core.background_pixel), XmRCallProc, (XtPointer) _XmBackgroundColorDefault }, { XmNoverrideRedirect, XmCOverrideRedirect, XmRBoolean, sizeof(Boolean), Offset(shell.override_redirect), XtRImmediate, (XtPointer)TRUE }, { XmNsaveUnder, XmCSaveUnder, XmRBoolean, sizeof(Boolean), Offset(shell.save_under), XtRImmediate, (XtPointer)FALSE }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension), Offset(grab_shell.shadow_thickness), XmRImmediate, (XtPointer)2 }, { XmNtransient, XmCTransient, XmRBoolean, sizeof(Boolean), Offset(wm_shell.transient), XtRImmediate, (XtPointer)TRUE }, { XmNwaitForWm, XmCWaitForWm, XmRBoolean, sizeof(Boolean), Offset(wm_shell.wait_for_wm), XtRImmediate, (XtPointer)FALSE }, { XmNtopShadowColor, XmCTopShadowColor, XmRPixel, sizeof(Pixel), Offset(grab_shell.top_shadow_color), XmRCallProc, (XtPointer) _XmTopShadowColorDefault }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), Offset(grab_shell.top_shadow_pixmap), XmRCallProc, (XtPointer) _XmTopShadowPixmapDefault }, { XmNbottomShadowColor, XmCBottomShadowColor, XmRPixel, sizeof(Pixel), Offset(grab_shell.bottom_shadow_color), XmRCallProc, (XtPointer) _XmBottomShadowColorDefault }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XmRNoScalingDynamicPixmap, sizeof(Pixmap), Offset(grab_shell.bottom_shadow_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, { XmNgrabStyle, XmCGrabStyle, XmRInt, sizeof(int), Offset(grab_shell.grab_style), XmRImmediate, (XtPointer) GrabModeAsync }, { XmNownerEvents, XmCOwnerEvents, XmRBoolean, sizeof(Boolean), Offset(grab_shell.owner_events), XmRImmediate, (XtPointer) FALSE } }; #undef Offset externaldef(xmgrabshellclassrec) XmGrabShellClassRec xmGrabShellClassRec = { { /* core class fields */ (WidgetClass) &vendorShellClassRec, /* superclass */ "XmGrabShell", /* class_name */ sizeof (XmGrabShellWidgetRec), /* widget_size */ NULL, /* class_initialize */ ClassPartInitialize, /* class_part_initialize */ FALSE, /* class_inited */ Initialize, /* initialize */ (XtArgsProc)NULL, /* initialize_hook */ XtInheritRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resource list */ XtNumber(resources), /* resource_count */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ NULL, /* expose */ SetValues, /* set_values */ (XtArgsFunc)NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ (XtArgsProc)NULL, /* get_values_hook */ (XtAcceptFocusProc)NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_private */ default_translations, /* tm_table */ (XtGeometryHandler)NULL, /* query_geometry */ (XtStringProc)NULL, /* display_accelerator */ NULL, /* extension */ }, { /* composite class fields */ GeometryManager, /* geometry_manager */ ChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* shell class fields */ NULL, /* extension */ }, { /* wmshell class fields */ NULL, /* extension */ }, { /* vendor shell class fields */ NULL, /* extension */ }, { /* grabshell class fields */ NULL, /* extension */ }, }; externaldef(xmgrabshellwidgetclass) WidgetClass xmGrabShellWidgetClass = (WidgetClass) &xmGrabShellClassRec; /* ------------- WIDGET CLASS METHODS ---------- */ /* * Initialize() */ /*ARGSUSED*/ static void Initialize(Widget req, /* unused */ Widget new_w, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmGrabShellWidget grabsh = (XmGrabShellWidget)new_w; XtAddEventHandler(new_w, StructureNotifyMask, False, MapNotifyHandler, NULL); grabsh->grab_shell.unpost_time = (Time) -1; grabsh->grab_shell.cursor = None; grabsh->grab_shell.top_shadow_GC = _XmGetPixmapBasedGC (new_w, grabsh->grab_shell.top_shadow_color, grabsh->core.background_pixel, grabsh->grab_shell.top_shadow_pixmap); grabsh->grab_shell.bottom_shadow_GC = _XmGetPixmapBasedGC (new_w, grabsh->grab_shell.bottom_shadow_color, grabsh->core.background_pixel, grabsh->grab_shell.bottom_shadow_pixmap); /* CR 6723: The BtnUp event may arrive before MapNotify. */ grabsh->grab_shell.post_time = XtLastTimestampProcessed(XtDisplay(new_w)); /* CR 9920: Popdown may be requested before MapNotify. */ grabsh->grab_shell.mapped = False; } /* * ClassPartInitialize() * Set up the fast subclassing. */ static void ClassPartInitialize(WidgetClass wc) { _XmFastSubclassInit (wc, XmGRAB_SHELL_BIT); } /* * SetValues() */ /*ARGSUSED*/ static Boolean SetValues(Widget cw, Widget rw, /* unused */ Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { XmGrabShellWidget new_w = (XmGrabShellWidget) nw; XmGrabShellWidget old_w = (XmGrabShellWidget) cw; Boolean redisplay = FALSE; if (old_w->grab_shell.shadow_thickness != new_w->grab_shell.shadow_thickness) { if (XtIsRealized(nw)) { DoLayout(nw); redisplay = TRUE; } } if ((old_w->grab_shell.top_shadow_color != new_w->grab_shell.top_shadow_color) || (old_w->grab_shell.top_shadow_pixmap != new_w->grab_shell.top_shadow_pixmap)) { XtReleaseGC (nw, new_w->grab_shell.top_shadow_GC); new_w->grab_shell.top_shadow_GC = _XmGetPixmapBasedGC (nw, new_w->grab_shell.top_shadow_color, new_w->core.background_pixel, new_w->grab_shell.top_shadow_pixmap); redisplay = TRUE; } if ((old_w->grab_shell.bottom_shadow_color != new_w->grab_shell.bottom_shadow_color) || (old_w->grab_shell.bottom_shadow_pixmap != new_w->grab_shell.bottom_shadow_pixmap)) { XtReleaseGC (nw, new_w->grab_shell.bottom_shadow_GC); new_w->grab_shell.bottom_shadow_GC = _XmGetPixmapBasedGC (nw, new_w->grab_shell.bottom_shadow_color, new_w->core.background_pixel, new_w->grab_shell.bottom_shadow_pixmap); redisplay = TRUE; } return redisplay; } /* * PopupCB() * Grabs. */ /*ARGSUSED*/ static void MapNotifyHandler(Widget shell, XtPointer client_data, XEvent *event, Boolean *cont) { XmGrabShellWidget grabshell = (XmGrabShellWidget)shell; Time time; XErrorHandler old_handler; /* Only handles map events */ if (event -> type != MapNotify) return; /* CR 9920: Popdown may be called before MapNotify. */ grabshell->grab_shell.mapped = True; if (!(time = XtLastTimestampProcessed(XtDisplay(shell)))) time = CurrentTime; if (grabshell->grab_shell.cursor == None) grabshell->grab_shell.cursor = XCreateFontCursor (XtDisplay(grabshell), XC_arrow); _XmFastExpose(shell); (void) XtGrabKeyboard(shell, grabshell -> grab_shell.owner_events, grabshell -> grab_shell.grab_style, GrabModeAsync, time); (void) XtGrabPointer(shell, grabshell -> grab_shell.owner_events, Events, grabshell -> grab_shell.grab_style, GrabModeAsync, None, grabshell->grab_shell.cursor, time); GSAllowEvents(shell, SyncPointer, time); /* Fix focus to shell */ XGetInputFocus(XtDisplay(shell), &grabshell->grab_shell.old_focus, &grabshell->grab_shell.old_revert_to); old_handler = XSetErrorHandler(IgnoreXErrors); XSetInputFocus(XtDisplay(shell), XtWindow(shell), RevertToParent, time); XSync(XtDisplay(shell), False); XSetErrorHandler(old_handler); } #ifdef FIX_1445 static void MouseWheel (Widget w, XEvent *event, String *params, Cardinal *num_params) { XmGrabShellWidget grabshell = (XmGrabShellWidget) w; GSAllowEvents(w, SyncPointer, event -> xbutton.time); } #endif /* * For BtnUp and BtnDown events we need to decide whether to * popdown the grabshell. We "see" these if the user presses * outside the shell. * * To decide, we call the XmNhasInterestCB to see if our poster * wants to handle the event. If our poster does, we call * XAllowEvents with REPLAY to get the event to the poster, otherwise * we Popdown() * */ static void BtnUp (Widget w, XEvent *event, String *params, Cardinal *num_params) { XmGrabShellWidget grabshell = (XmGrabShellWidget) w; int delta; /* Handle click to post we then ignore the event if it occured within the click to post time */ delta = event -> xbutton.time - grabshell -> grab_shell.post_time; if (delta <= XtGetMultiClickTime(XtDisplay(w))) { GSAllowEvents(w, SyncPointer, event -> xbutton.time); return; } Popdown(w, event, params, num_params); } static void BtnDown (Widget grabshell, XEvent *event, String *params, Cardinal *num_params) { int x, y; Window win; /* Ignore modal cascade replay of event */ if (! _XmIsEventUnique(event)) return; /* Move to grabshell's coordinate system */ XTranslateCoordinates(XtDisplay(grabshell), event -> xbutton.window, XtWindow(grabshell), event -> xbutton.x, event -> xbutton.y, &x, &y, &win); /* Popdown if outside the shell */ if (x >= 0 && y >= 0 && x <= XtWidth(grabshell) && y <= XtHeight(grabshell)) { GSAllowEvents(grabshell, SyncPointer, event -> xbutton.time); } else { Popdown(grabshell, event, params, num_params); } } /* * Popdown() * Popdown a GrabShell widget, also flag it's child as unmanaged. */ /*ARGSUSED*/ static void Popdown(Widget shell, XEvent *event, /* unused */ String *params, Cardinal *num_params) { XmScreen screen = (XmScreen) XmGetXmScreen(XtScreen(shell)); XmGrabShellWidget grabshell = (XmGrabShellWidget)shell; Time time; /* Record for replay detection */ if (event && (event->type == ButtonPress || event->type == ButtonRelease)) { grabshell->grab_shell.unpost_time = event->xbutton.time; } if (!(time = XtLastTimestampProcessed(XtDisplay(shell)))) time = CurrentTime; /* CR 9920: Popdown may be called before MapNotify. */ if (grabshell->shell.popped_up && grabshell->grab_shell.mapped) { XErrorHandler old_handler; if (screen -> screen.unpostBehavior == XmUNPOST_AND_REPLAY) GSAllowEvents(shell, ReplayPointer, event ? event->xbutton.time : time); XtUngrabPointer(shell, time); XtUngrabKeyboard(shell, time); _XmPopdown(shell); /* Reset focus to old holder */ old_handler = XSetErrorHandler(IgnoreXErrors); if (time != CurrentTime) time = time - 1; /* Avoid race in wm */ XSetInputFocus(XtDisplay(shell), grabshell->grab_shell.old_focus, grabshell->grab_shell.old_revert_to, time); XSync(XtDisplay(shell), False); XSetErrorHandler(old_handler); } grabshell->grab_shell.mapped = False; } /* * This only calls allow events if we have a sync grab. */ static void GSAllowEvents(Widget gs, int mode, Time time) { XmGrabShellWidget grabshell = (XmGrabShellWidget) gs; if (grabshell -> grab_shell.grab_style == GrabModeSync) { XAllowEvents(XtDisplay(gs), mode, time); } } /* * Destroy() */ static void Destroy(Widget widg) { XmGrabShellWidget grabshell = (XmGrabShellWidget) widg; if (grabshell->grab_shell.cursor != None) XFreeCursor(XtDisplay(widg), grabshell->grab_shell.cursor); } /* * DoLayout() */ static void DoLayout(Widget wid) { XmGrabShellWidget gs = (XmGrabShellWidget)wid; if (XtIsManaged(gs->composite.children[0])) { Widget childwid = gs->composite.children[0]; Position offset = (gs->grab_shell.shadow_thickness + childwid->core.border_width); int cw = ((int) gs->core.width) - 2 * offset; int ch = ((int) gs->core.height) - 2 * offset; Dimension childW = MAX(1, cw); Dimension childH = MAX(1, ch); XmeConfigureObject (childwid, offset, offset, childW, childH, childwid->core.border_width); } } /************************************************************************ * * GeometryManager * ************************************************************************/ /*ARGSUSED*/ static XtGeometryResult GeometryManager( Widget wid, XtWidgetGeometry *request, XtWidgetGeometry *reply ) /* unused */ { XmGrabShellWidget gs = (XmGrabShellWidget) XtParent(wid); XtWidgetGeometry modified; int bw; XtGeometryResult ret_val; /* Copy the existing request */ modified = *request; bw = XtBorderWidth(wid); /* Add shell's shadow thickness and child's borderwidth */ modified.width += 2*bw + 2*gs->grab_shell.shadow_thickness; modified.height += 2*bw + 2*gs->grab_shell.shadow_thickness; _XmProcessLock(); /* Send to vendor shell for final */ ret_val = ((VendorShellClassRec *) vendorShellWidgetClass) -> composite_class.geometry_manager(wid,&modified,reply); _XmProcessUnlock(); return ret_val; } /* * ChangeManaged() */ static void ChangeManaged(Widget wid) { XmGrabShellWidget gs = (XmGrabShellWidget)wid; ShellWidget shell = (ShellWidget)wid; Dimension bw = 0; XtWidgetGeometry pref, mygeom, replygeom; XtGeometryResult result; Widget child; mygeom.request_mode = 0; if (gs->composite.num_children) { child = gs->composite.children[0]; if (XtIsManaged(child)) { /* Get child's preferred size */ result = XtQueryGeometry(child, NULL, &pref); /* Take whatever they want */ if (pref.request_mode & CWWidth) { mygeom.width = pref.width; mygeom.request_mode |= CWWidth; } if (pref.request_mode & CWHeight) { mygeom.height = pref.height; mygeom.request_mode |= CWHeight; } if (pref.request_mode & CWBorderWidth) bw = pref.border_width; else bw = child->core.border_width; } } mygeom.width += 2*bw + 2*gs->grab_shell.shadow_thickness; mygeom.height += 2*bw + 2*gs->grab_shell.shadow_thickness; result = XtMakeGeometryRequest((Widget)shell, &mygeom, &replygeom); switch (result) { case XtGeometryAlmost: XtMakeGeometryRequest((Widget)shell, &replygeom, NULL); /* fall through. */ case XtGeometryYes: DoLayout(wid); break; case XtGeometryNo: case XtGeometryDone: break; } } /* * Resize() */ static void Resize(Widget w) { DoLayout(w); } /* * When using an override redirect window, it is safe to draw to the * window as soon as you have mapped it; you need not wait for exposure * events to arrive. So ... to force shells to post quickly, we will * redraw all of the items now, and ignore the exposure events we receive * later. */ static void _XmFastExpose(Widget widg) { register int i; register Widget child; XmGrabShellWidget gs = (XmGrabShellWidget)widg; _XmProcessLock(); (*(XtClass(widg)->core_class.expose)) (widg, NULL, NULL); _XmProcessUnlock(); /* Process each windowed child */ for (i = 0; i < gs->composite.num_children; i++) { child = gs->composite.children[i]; if (XtIsWidget(child) && XtIsManaged(child)) { _XmProcessLock(); (*(XtClass(child)->core_class.expose)) (child, NULL, NULL); _XmProcessUnlock(); } } XFlush(XtDisplay(widg)); DrawBorder(widg); } /* * DrawBorder() */ static void DrawBorder(Widget widg) { XmGrabShellWidget gs = (XmGrabShellWidget)widg; int offset = 0; XmeDrawShadows(XtDisplay(widg), XtWindow(widg), gs->grab_shell.top_shadow_GC, gs->grab_shell.bottom_shadow_GC, offset, offset, XtWidth(widg) - 2 * offset, XtHeight(widg) - 2 * offset, gs->grab_shell.shadow_thickness, XmSHADOW_OUT); } /* * IgnoreXErrors() * An XErrorHandler that smothers errors. */ /*ARGSUSED*/ static int IgnoreXErrors(Display *dpy, /* unused */ XErrorEvent *event) /* unused */ { return 0; } /******************* * Public Routines * *******************/ Widget XmCreateGrabShell(Widget parent, char *name, ArgList al, Cardinal ac) { return XtCreatePopupShell(name, xmGrabShellWidgetClass, parent, al, ac); } motif-2.3.8/lib/Xm/WidGet.c0000644000175000017500000000630012672140200012235 00000000000000/* $XConsortium: WidGet.c /main/6 1995/10/25 20:27:58 cde-sun $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #include "XmI.h" #include #include #include /************************************************************************ * * XmWidgetGetBaselines * ************************************************************************/ Boolean XmWidgetGetBaselines( Widget wid, Dimension **baselines, int *line_count) { _XmWidgetToAppContext(wid); _XmAppLock(app); if (XmIsPrimitive(wid)) { XmPrimitiveClassExt *wcePtr; WidgetClass wc = XtClass(wid); wcePtr = _XmGetPrimitiveClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->widget_baseline) { _XmAppUnlock(app); return( (*((*wcePtr)->widget_baseline)) (wid, baselines, line_count)) ; } } else if (XmIsGadget(wid)) { XmGadgetClassExt *wcePtr; WidgetClass wc = XtClass(wid); wcePtr = _XmGetGadgetClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->widget_baseline) { _XmAppUnlock(app); return( (*((*wcePtr)->widget_baseline)) (wid, baselines, line_count)) ; } } _XmAppUnlock(app); return (False); } /************************************************************************ * * XmWidgetDisplayRect * ************************************************************************/ Boolean XmWidgetGetDisplayRect( Widget wid, XRectangle *displayrect) { _XmWidgetToAppContext(wid); _XmAppLock(app); if (XmIsPrimitive(wid)) { XmPrimitiveClassExt *wcePtr; WidgetClass wc = XtClass(wid); wcePtr = _XmGetPrimitiveClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->widget_display_rect) (*((*wcePtr)->widget_display_rect)) (wid, displayrect); _XmAppUnlock(app); return (True); } else if (XmIsGadget(wid)) { XmGadgetClassExt *wcePtr; WidgetClass wc = XtClass(wid); wcePtr = _XmGetGadgetClassExtPtr(wc, NULLQUARK); if (*wcePtr && (*wcePtr)->widget_display_rect) (*((*wcePtr)->widget_display_rect)) (wid, displayrect); _XmAppUnlock(app); return (True); } else { _XmAppUnlock(app); return (False); } } motif-2.3.8/lib/Xm/VendorSEP.h0000644000175000017500000001025513145162623012701 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmVendorSEP_h #define _XmVendorSEP_h #include #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsVendorShellExt #define XmIsVendorShellExt(w) XtIsSubclass(w, xmVendorShellExtObjectClass) #endif /* XmIsVendorShellExt */ typedef struct _XmVendorShellExtRec *XmVendorShellExtObject; typedef struct _XmVendorShellExtClassRec *XmVendorShellExtObjectClass; externalref WidgetClass xmVendorShellExtObjectClass; #define XmInheritProtocolHandler ((XtCallbackProc)_XtInherit) typedef struct _XmVendorShellExtClassPart{ XtCallbackProc delete_window_handler; XtCallbackProc offset_handler; XtPointer extension; }XmVendorShellExtClassPart, *XmVendorShellExtClassPartPtr; typedef struct _XmVendorShellExtClassRec{ ObjectClassPart object_class; XmExtClassPart ext_class; XmDesktopClassPart desktop_class; XmShellExtClassPart shell_class; XmVendorShellExtClassPart vendor_class; }XmVendorShellExtClassRec; typedef struct { XmFontList default_font_list; unsigned char focus_policy; XmFocusData focus_data; unsigned char delete_response; unsigned char unit_type; MwmHints mwm_hints; MwmInfo mwm_info; String mwm_menu; XtCallbackList focus_moved_callback; /* * internal fields */ Widget old_managed; Position xAtMap, yAtMap, xOffset, yOffset; unsigned long lastOffsetSerial; unsigned long lastMapRequest; Boolean externalReposition; /* mapStyle is an unused field. I'm using this field to keep * track of the *font_list resource values. Refer * CheckSetRenderTable in VendorSE.c */ unsigned char mapStyle; XtCallbackList realize_callback; XtGrabKind grab_kind; Boolean audible_warning; XmFontList button_font_list; XmFontList label_font_list; XmFontList text_font_list; String input_method_string; String preedit_type_string; unsigned int light_threshold; unsigned int dark_threshold; unsigned int foreground_threshold; unsigned int im_height; XtPointer im_info; Boolean im_vs_height_set; /* New public resources for Motif 2.0 */ XmDirection layout_direction; XmInputPolicy input_policy; Boolean verify_preedit; /* toolTip related stuff */ Widget label; /* XmLabel for the tips */ int post_delay; /* delay before posting XmNtoolTipPostDelay */ int post_duration; /* duration XmNtoolTipPostDuration */ XtIntervalId timer; /* timer for post delay */ XtIntervalId duration_timer; /* timer for duration */ Time leave_time; /* time of the last leave event */ Widget slider; /* the XmSlideContext used to slide in the tip */ Boolean enable; /* flag to disable all this stuff */ } XmVendorShellExtPart, *XmVendorShellExtPartPtr; externalref XmVendorShellExtClassRec xmVendorShellExtClassRec; typedef struct _XmVendorShellExtRec{ ObjectPart object; XmExtPart ext; XmDesktopPart desktop; XmShellExtPart shell; XmVendorShellExtPart vendor; } XmVendorShellExtRec; /******** Xme Functions ********/ void XmeAddFocusChangeCallback(Widget, XtCallbackProc, XtPointer); void XmeRemoveFocusChangeCallback(Widget, XtCallbackProc, XtPointer); /******** End Xme Functions ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmVendorSEP_h */ motif-2.3.8/lib/Xm/MultiList.c0000644000175000017500000012321513146706756013032 00000000000000#ifdef HAVE_CONFIG_H #include #endif #include #include "XmI.h" #include "MessagesI.h" #include #include #include #include #include #include #include #include #include #include /************************************************************ * TYPEDEFS AND DEFINES *************************************************************/ #define BUG_FIX_1385 1 #define H_MARGIN 5 #define V_MARGIN 5 #define FIND_STRING _XmMMsgResource_0013 extern XmMultiListRowInfo \ *XmI18ListFindRow(Widget, String, int *, Boolean, Boolean); extern int *XmI18ListGetSelectedRowArray(XmI18ListWidget, int *); extern void XmI18ListMakeRowVisible(XmI18ListWidget, int); extern void XmI18ListDeselectRow(XmI18ListWidget, int); extern void XmI18ListSelectRow(XmI18ListWidget, int, Boolean); extern void XmI18ListSelectAllItems(XmI18ListWidget, Boolean); extern void XmI18ListDeselectItems(XmI18ListWidget, XmString, int); extern void XmI18ListSelectItems(XmI18ListWidget, XmString, int, Boolean); static Widget CreateTitle(Widget, XmString, ArgList, Cardinal); static Widget CreateScrollbar(Widget, Boolean, ArgList, Cardinal); static Widget CreateFindButton(Widget, ArgList, Cardinal); static Widget CreateFindText(Widget, ArgList, Cardinal); static Widget CreateFrame(Widget, ArgList, Cardinal); static void ActivateTextSearch(Widget, XtPointer, XtPointer); static void LayoutChildren(Widget), ChangeManaged(Widget); static void PositionFindAndFindText(Widget); static void ClassInitialize(); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void ClassPartInitialize(WidgetClass w_class); static void Resize(Widget), Destroy(Widget w); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static void GetValuesHook(Widget, ArgList, Cardinal *); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static XtResource resources[] = { { XmNwidth, XmCWidth, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(CoreRec, core.width), XmRImmediate, (XtPointer) 0 }, { XmNheight, XmCHeight, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(CoreRec, core.height), XmRImmediate, (XtPointer) 0 }, { XmNtitle, XmCTitle, XmRXmString, sizeof(XmString), XtOffsetOf(XmMultiListRec, ext_list.title), XmRImmediate, (XtPointer) NULL }, { XmNtitleString, XmCTitleString, XmRXmString, sizeof(XmString), XtOffsetOf(XmMultiListRec, ext_list.title_string), XmRImmediate, (XtPointer) NULL }, { XmNdoubleClickCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmMultiListRec, ext_list.double_click), XmRImmediate, (XtPointer) NULL }, { "pri.vate", "Pri.vate", XmRBoolean, sizeof(Boolean), XtOffsetOf(XmMultiListRec, ext_list.check_set_select_callback), XmRImmediate, (XtPointer) False }, { XmNselectCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmMultiListRec, ext_list.single_select), XmRImmediate, (XtPointer) NULL }, /* this is the old name for the above */ { XmNsingleSelectionCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmMultiListRec, ext_list.single_select), XmRImmediate, (XtPointer) NULL }, { XmNshowFind, XmCShowFind, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmMultiListRec, ext_list.show_find), XmRImmediate, (XtPointer) True }, { XmNfindLabel, XmCFindLabel, XmRXmString, sizeof(XmString), XtOffsetOf(XmMultiListRec, ext_list.find_label), XmRImmediate, (XtPointer) NULL }, { XmNitemNotFoundCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmMultiListRec, ext_list.not_found), XmRImmediate, (XtPointer) NULL }, { XmNitemFoundCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmMultiListRec, ext_list.item_found), XmRImmediate, (XtPointer) NULL }, { XmNvisibleItemCount, XmCVisibleItemCount, XmRInt, sizeof(int), XtOffsetOf(XmMultiListRec, ext_list.visible_rows), XmRImmediate, (XtPointer) XmMultiList_DEFAULT_VISIBLE_COUNT }, #ifndef BUG_FIX_1385 { XmNnumColumns, XmCNumColumns, XmRShort, sizeof(short), 0, NULL, (XtPointer) NULL }, { XmNnumRows, XmCNumRows, XmRShort, sizeof(short), 0, NULL, (XtPointer) NULL }, { XmNselectedColumn, XmCSelectedColumn, XmRShort, sizeof(short), 0, NULL, (XtPointer) NULL }, { XmNcolumnTitles, XmCColumnTitles, XmRXmStringTable, sizeof(XmString *), 0, NULL, (XtPointer) NULL }, { XmNentryData, XmCEntryData, XmRPointer, sizeof(XtPointer), 0, NULL, (XtPointer) NULL }, { XmNentryBackground, XmCBackground, XtRPixel, sizeof(Pixel), 0, NULL, (XtPointer) NULL }, { XmNfirstColumnPixmaps, XmCFirstColumnPixmaps, XmRBoolean, sizeof(Boolean), 0, NULL, (XtPointer) NULL }, { XmNfontList, XmCFontList, XmRFontList, sizeof(XmFontList), 0, NULL, (XtPointer) NULL }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), 0, NULL, (XtPointer) NULL }, { XmNverticalScrollBar, XmCScrollBar, XmRWidget, sizeof(Widget), 0, NULL, (XtPointer) NULL }, { XmNhorizontalScrollBar, XmCScrollBar, XmRWidget, sizeof(Widget), 0, NULL, (XtPointer) NULL }, { XmNfirstRow, XmCFirstLocation, XmRShort, sizeof(short), 0, NULL, (XtPointer) NULL }, { XmNfirstColumn, XmCFirstLocation, XmRShort, sizeof(short), 0, NULL, (XtPointer) NULL }, { XmNsortFunctions, XmCFunction, XmRFunction, sizeof(Xm18SortFunction **), 0, NULL, (XtPointer) NULL }, { XmNselectionPolicy, XmCSelectionPolicy, XmRSelectionPolicy, sizeof(unsigned char), 0, NULL, (XtPointer) NULL } #endif }; static XmSyntheticResource syn_resources[] = { { XmNwidth, sizeof (Dimension), XtOffsetOf(CoreRec, core.width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNheight, sizeof (Dimension), XtOffsetOf(CoreRec, core.height), XmeFromVerticalPixels, XmeToVerticalPixels } }; XmMultiListClassRec xmMultiListClassRec = { { /* core fields */ /* superclass */ (WidgetClass)&xmManagerClassRec, /* class_name */ "XmMultiList", /* widget_size */ sizeof(XmMultiListRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ (Cardinal)0, /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ NULL, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ GetValuesHook, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite_class fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ NULL, /* num resources */ 0, /* constraint size */ 0, /* destroy proc */ NULL, /* init proc */ NULL, /* set values proc */ NULL, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* syn_cont_resources */ NULL, /* num_syn_cont_resources */ 0, /* parent_process */ NULL, /* extension */ NULL, }, { /* Extended List fields */ NULL /* extension */ } }; WidgetClass xmMultiListWidgetClass = (WidgetClass)&xmMultiListClassRec; /* Function Name: ClassInitialize * Description: Initializes class-specific data (offsets) * Arguments: none * Returns: nothing */ static void ClassInitialize() { /* do nothing */ } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /*ARGSUSED*/ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { ArgList f_args; Cardinal f_num_args; XmMultiListWidget elist = (XmMultiListWidget) set; /* * Pass filtered setvalues requests down to all children. */ _XmFilterArgs(args, *num_args, xm_std_filter, &f_args, &f_num_args); XmMultiList_last_search(elist) = NULL; XmMultiList_ilist(elist) = NULL; if (XmMultiList_title(elist) != NULL) XmMultiList_title(elist) = XmStringCopy(XmMultiList_title(elist)); if (XmMultiList_title_string(elist) != NULL) XmMultiList_title_string(elist) = XmStringCopy(XmMultiList_title_string(elist)); if (XmMultiList_find_label(elist) != NULL) XmMultiList_find_label(elist) = XmStringCopy(XmMultiList_find_label(elist)); else XmMultiList_find_label(elist) = XmStringGenerate(FIND_STRING, NULL, XmCHARSET_TEXT, NULL); XmMultiList_title_wid(elist) = CreateTitle(set, (XmMultiList_title_string(elist) ? XmMultiList_title_string(elist) : XmMultiList_title(elist)), f_args, f_num_args); XmMultiList_v_bar(elist) = CreateScrollbar(set, True, f_args, f_num_args); XmMultiList_h_bar(elist) = CreateScrollbar(set, False, f_args, f_num_args); /* * Scrollbars must be created before the frame. */ XmMultiList_frame(elist) = CreateFrame(set, f_args, f_num_args); XmMultiList_find(elist) = CreateFindButton(set, f_args, f_num_args); XmMultiList_find_text(elist) = CreateFindText(set, f_args, f_num_args); /* Compute our initial height & width if unset... */ if (XtHeight(req) == 0) { int title_height = 0; if (XmMultiList_title(elist) || XmMultiList_title_string(elist)) title_height = XmMultiList_title_wid(elist)->core.height + 2 * (XmMultiList_title_wid(elist)->core.border_width + V_MARGIN); if (XmMultiList_show_find(elist)) XtHeight(set) = XmMultiList_h_bar(elist)->core.height + XmMultiList_frame(elist)->core.height + title_height + XmMultiList_find(elist)->core.height + 2 * (V_MARGIN + elist->core.border_width + XmMultiList_h_bar(elist)->core.border_width + XmMultiList_frame(elist)->core.border_width + XmMultiList_find(elist)->core.border_width); else XtHeight(set) = XmMultiList_title_wid(elist)->core.height + XmMultiList_h_bar(elist)->core.height + title_height + XmMultiList_frame(elist)->core.height + 2 * (V_MARGIN + elist->core.border_width + XmMultiList_h_bar(elist)->core.border_width + XmMultiList_frame(elist)->core.border_width); } if (XtWidth(req) == 0) { XtWidth(set) = XmMultiList_ilist(elist)->core.width + XmMultiList_v_bar(elist)->core.width + (5 * H_MARGIN) + (2 * elist->core.border_width); } XtFree((XtPointer) f_args); } /* * ClassPartInitialize sets up the fast subclassing for the widget. */ static void ClassPartInitialize(WidgetClass w_class) { _XmFastSubclassInit (w_class, XmEXT18LIST_BIT); } /* Function Name: Destroy * Description: Cleans up after the widget. * Arguments: w - the widget. * Returns: none. */ static void Destroy(Widget w) { XmMultiListWidget elist = (XmMultiListWidget) w; XmStringFree(XmMultiList_title(elist)); XmStringFree(XmMultiList_title_string(elist)); XmStringFree(XmMultiList_find_label(elist)); XtRemoveAllCallbacks(w, XmNsingleSelectionCallback); } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - Extended List Widget to realize. * Returns: none. */ static void Resize(Widget w) { LayoutChildren(w); } /* Function Name: ChangeManaged * Description: when a management change has occurred. * Arguments: w - the Ext List widget. * Returns: none. */ /* ARGSUSED */ static void ChangeManaged(Widget w) { LayoutChildren(w); XmeNavigChangeManaged((Widget)w); /* for Motif navigation */ } /* Function Name: GetValuesHook * Description: Called to retrieve resource values from either * the extended list or the interal list * Arguments: w - the extended list widget. * args, num_args - the argument list. * Returns: none * * Added: 04/09/92 beth */ /*ARGSUSED*/ static void GetValuesHook(Widget w, ArgList args, Cardinal *num_args) { XmMultiListWidget elist = (XmMultiListWidget) w; register Cardinal i, num=0, j = *num_args; Arg i_args[15]; /* * Get the correct args to pass to the I18List widget */ for (i=0; i < j; i++) { if (streq(args[i].name, XmNnumColumns) || streq(args[i].name, XmNnumRows) || streq(args[i].name, XmNselectedColumn) || streq(args[i].name, XmNcolumnTitles) || streq(args[i].name, XmNentryData) || streq(args[i].name, XmNentryBackground) || streq(args[i].name, XmNfirstColumnPixmaps) || streq(args[i].name, XmNfontList) || streq(args[i].name, XmNrenderTable) || streq(args[i].name, XmNverticalScrollBar) || streq(args[i].name, XmNhorizontalScrollBar) || streq(args[i].name, XmNfirstRow) || streq(args[i].name, XmNfirstColumn) || streq(args[i].name, XmNsortFunctions) || streq(args[i].name, XmNselectionPolicy)) { XtSetArg(i_args[num], args[i].name, args[i].value); num++; } else if (streq(args[i].name, XmNtitle)) *(XmString*)args[i].value = XmStringCopy(XmMultiList_title(elist)); else if (streq(args[i].name, XmNtitleString)) *(XmString*)args[i].value = XmStringCopy(XmMultiList_title_string(elist)); else if (streq(args[i].name, XmNfindLabel)) *(XmString*)args[i].value = XmStringCopy(XmMultiList_find_label(elist)); } /* * Pass argument list through to the IList widget. */ if (num > 0) XtGetValues(XmMultiList_ilist(elist), i_args, num); } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ #define NUM_FIND_WIDGETS 2 /*ARGSUSED*/ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { XmMultiListWidget e_old = (XmMultiListWidget) current; XmMultiListWidget e_set = (XmMultiListWidget) set; ArgList f_args; Cardinal f_num_args; Boolean redisplay = False; /* * Pass the SetValues request through to all children. */ _XmFilterArgs(args, *num_args, xm_std_filter, &f_args, &f_num_args); _XmSetValuesOnChildren((Widget) e_set, f_args, f_num_args); XtFree((XtPointer) f_args); if (XmMultiList_visible_rows(e_old) != XmMultiList_visible_rows(e_set)) { if (XmMultiList_visible_rows(e_set) < 1) XmMultiList_visible_rows(e_set) = 1; /* reset values less than 1 */ } if (XmMultiList_show_find(e_old) != XmMultiList_show_find(e_set)) { Widget find_widgets[NUM_FIND_WIDGETS]; find_widgets[0] = XmMultiList_find(e_set); find_widgets[1] = XmMultiList_find_text(e_set); if (XmMultiList_show_find(e_set)) XtManageChildren(find_widgets, NUM_FIND_WIDGETS); else XtUnmanageChildren(find_widgets, NUM_FIND_WIDGETS); } /* * This check may return, so it must be last. */ if (XmMultiList_find_label(e_old) != XmMultiList_find_label(e_set)) { Arg args[1]; redisplay = True; XmStringFree(XmMultiList_find_label(e_old)); if (XmMultiList_find_label(e_set) != NULL) XmMultiList_find_label(e_set) = XmStringCopy(XmMultiList_find_label(e_set)); else XmMultiList_find_label(e_set) = XmStringCreateLocalized(FIND_STRING); XtSetArg(args[0], XmNlabelString, XmMultiList_find_label(e_set)); XtSetValues(XmMultiList_find(e_set), args, 1); } /* * MultiList supports both XmNtitle (for backwards compatibility) and * XmNtitleString resources, so we must check for changes to both here */ if ((XmMultiList_title(e_old) != XmMultiList_title(e_set)) || (XmMultiList_title_string(e_old) != XmMultiList_title_string(e_set))) { XmString *title, old_title; /* note: fails if both are set at the same time */ if (XmMultiList_title_string(e_old) != XmMultiList_title_string(e_set)) { title = &XmMultiList_title_string(e_set); old_title = XmMultiList_title_string(e_old); } else { title = &XmMultiList_title(e_set); old_title = XmMultiList_title(e_old); } if ((*title == NULL) || (old_title == NULL)) { LayoutChildren(set); } if (*title != NULL) { Arg zargs[2]; Cardinal znum_args = 0; *title = XmStringCopy(*title); XtSetArg(zargs[znum_args], XmNlabelString, *title); znum_args++; XtSetValues(XmMultiList_title_wid(e_set), zargs, znum_args); } XmStringFree(old_title); } return(redisplay); } /* Function Name: GeometryManager * Description: handles requests from children for a size change. * Arguments: child - the child to change. * request - the geometry that the child wants. * return - what we will allow if this is an almost. * Returns: status. * * This function will allow any width or height request on the label, * find button, or frame. Any other widget will have its request * disallowed. */ /*ARGSUSED*/ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry * request, XtWidgetGeometry * result) { XmMultiListWidget elist = (XmMultiListWidget) XtParent(w); XtGeometryResult answer = XtGeometryYes; if (!(request->request_mode & (CWWidth | CWHeight | CWBorderWidth))) return(XtGeometryNo); /* * Only these three widgets are ever allowed to initiate a resize * request: Frame (parent of I18List), Title Widget, Find Button * * The scrollbars should be allowed to be thicker, and the text area * should be able to ask to resize the window wider if necessary... */ if ((w != XmMultiList_title_wid(elist)) && (w != XmMultiList_find(elist)) && (w != XmMultiList_frame(elist))) return(XtGeometryNo); /* * Handle the request from the I18List (frame & ilist) child to resize... */ if ((w == XmMultiList_frame(elist)) && ((request->request_mode & CWWidth) || (request->request_mode & CWHeight))) { Widget parent = XtParent(XtParent(w)); XtWidgetGeometry ext_request, ext_reply; ext_request.request_mode = 0; if (request->request_mode & CWWidth) { ext_request.width = elist->core.width - (w->core.width - request->width); ext_request.request_mode |= CWWidth; } if (request->request_mode & CWHeight) { ext_request.height = elist->core.height - (w->core.height - request->height); ext_request.request_mode |= CWHeight; } answer = XtMakeGeometryRequest(parent, &ext_request, &ext_reply); if (answer == XtGeometryYes) { if (request->request_mode & CWHeight) elist->core.height = ext_request.height; if (request->request_mode & CWWidth) elist->core.width = ext_request.width; } else if (answer == XtGeometryAlmost) { if (request->request_mode & CWHeight) elist->core.height = ext_reply.height; if (request->request_mode & CWWidth) elist->core.width = ext_reply.width; } } if (!(request->request_mode & CWWidth)) request->width = w->core.width; if (!(request->request_mode & CWHeight)) request->height = w->core.height; if (!(request->request_mode & CWBorderWidth)) request->border_width = w->core.border_width; *result = *request; if (request->request_mode & (CWX | CWY | CWStackMode | CWSibling)) { return(XtGeometryAlmost); } if (request->request_mode & XtCWQueryOnly) return(XtGeometryYes); /* * A real allowed request, set the new dimensions */ w->core.width = result->width; w->core.height = result->height; LayoutChildren((Widget) elist); return(answer); } /************************************************************ * * Actions and Callbacks (More entry points into the widget code). * ************************************************************/ /*ARGSUSED*/ static void ActivateTextSearch(Widget w, XtPointer elist_ptr, XtPointer client) { XmMultiListWidget elist = (XmMultiListWidget) elist_ptr; XmMultiListCallbackStruct find_info; XmPushButtonCallbackStruct *cbs = (XmPushButtonCallbackStruct *) client; Boolean reset = True; XmMultiListRowInfo *match; char * ptr; wchar_t *wc_string; if (!XmMultiList_show_find(elist)) return; ptr = XmTextFieldGetString(XmMultiList_find_text(elist)); wc_string = XmTextFieldGetStringWcs(XmMultiList_find_text(elist)); if (XmMultiList_last_search(elist)) reset = !streq(ptr, XmMultiList_last_search(elist)); /* Last parameter tells search proc to highlight a matching row... */ match = XmI18ListFindRow(XmMultiList_ilist(elist), ptr, &find_info.column, reset, True); find_info.event = cbs->event; find_info.string = ptr; find_info.wc_string = wc_string; find_info.row = match; if (!match) { XBell(XtDisplay(w), 0); find_info.reason = XmMULTILIST_NOT_FOUND; XtCallCallbackList((Widget) elist, XmMultiList_not_found(elist), (XtPointer) &find_info); } else { find_info.reason = XmMULTILIST_FOUND; XtCallCallbackList((Widget) elist, XmMultiList_item_found(elist), (XtPointer) &find_info); } XtFree((XtPointer)wc_string); XtFree(XmMultiList_last_search(elist)); XmMultiList_last_search(elist) = ptr; } /************************************************************ * LOCAL CODE *************************************************************/ /* Function Name: LayoutChildren * Description: Lays out the "child" widgets in the Ext List widget. * Arguments: w - the ext list widget. * Returns: none. */ static void LayoutChildren(Widget w) { Arg args[1]; XmMultiListWidget elist = (XmMultiListWidget) w; Widget t_wid = XmMultiList_title_wid(elist); Widget frame = XmMultiList_frame(elist); Widget find_text = XmMultiList_find_text(elist); Widget vbar = XmMultiList_v_bar(elist); Widget hbar = XmMultiList_h_bar(elist); Dimension title_height, h_thick, v_thick, temp_val; Position scroll_top, scroll_bottom, scroll_left, scroll_right; Dimension height = elist->core.height; Dimension width = elist->core.width; /* * Put Find and Find Text along the bottom */ PositionFindAndFindText(w); if ((XmMultiList_title(elist) == NULL) && (XmMultiList_title_string(elist) == NULL)) { scroll_top = V_MARGIN; XtSetArg(args[0], XmNmappedWhenManaged, False); XtSetValues(t_wid, args, (Cardinal) 1); } else { /* * Put the title widget in the top left corner */ if (LayoutIsRtoLM(w)) _XmMoveWidget(t_wid, (Position)(width - H_MARGIN - XtWidth(t_wid)), (Position) V_MARGIN); else _XmMoveWidget(t_wid, (Position) H_MARGIN, (Position) V_MARGIN); XtSetArg(args[0], XmNmappedWhenManaged, True); XtSetValues(t_wid, args, (Cardinal) 1); title_height = t_wid->core.height + 2 * t_wid->core.border_width; scroll_top = title_height + 2 * V_MARGIN; } v_thick = vbar->core.width + 2 * vbar->core.border_width; h_thick = hbar->core.height + 2 * vbar->core.border_width; if (XmMultiList_show_find(elist)) scroll_bottom = find_text->core.y - find_text->core.border_width - V_MARGIN; else scroll_bottom = height - V_MARGIN; scroll_left = H_MARGIN; scroll_right = width - H_MARGIN; /* * Place the frame. * * NOTE: I am reusing "width" and "height" for the size of the widget * that I am about to configure. */ temp_val = v_thick + scroll_left + H_MARGIN; if ((int)temp_val >= (int)scroll_right) width = 1; else width = scroll_right - temp_val; temp_val = h_thick + scroll_top + V_MARGIN; if ( (Position) temp_val >= scroll_bottom ) height = 1; else height = scroll_bottom - temp_val; _XmConfigureWidget(frame, scroll_left, scroll_top, width, height, frame->core.border_width); /* * Place the scrollbars. */ _XmConfigureWidget(hbar, scroll_left, scroll_bottom - (Position) h_thick, width, hbar->core.height, hbar->core.border_width); temp_val = h_thick + scroll_top + V_MARGIN; if ( (Position) temp_val >= scroll_bottom) height = 1; else height = scroll_bottom - temp_val; _XmConfigureWidget(vbar, scroll_right - v_thick, scroll_top, vbar->core.width, height, vbar->core.border_width); } /* Function Name: PositionFindAndFindText * Description: Positions the find and find text widgets. * Arguments: parent - the parent of the find and find text- the EList * Returns: none. */ static void PositionFindAndFindText(Widget w) { XmMultiListWidget elist = (XmMultiListWidget) w; Widget find = XmMultiList_find(elist); Widget find_text = XmMultiList_find_text(elist); Dimension find_height, max_child_height, find_width; Dimension height = elist->core.height; Dimension width = elist->core.width; Position find_x, find_y; if (!XmMultiList_show_find(elist)) return; find_height = find->core.height + 2 * find->core.border_width; find_width = find->core.width + 2 * find->core.border_width; max_child_height = find_text->core.height + 2*find_text->core.border_width; if (find_height > max_child_height) max_child_height = find_height; /* * Put the Find widget in the lower left corner. */ if (LayoutIsRtoLM(w)) find_x = width - H_MARGIN - find_width; else find_x = H_MARGIN; find_y = (Position) height - (Position) ((int)(max_child_height + find_height)/2 + V_MARGIN); _XmMoveWidget(find, find_x, find_y); /* * Put the Find Text widget next to the find widget, * and resize it to fill the entire bottom width. */ { Dimension text_width, temp_val; Position x, y; if (LayoutIsRtoLM(w)) x = H_MARGIN; else x = (Dimension) find_x + find_width + H_MARGIN; y = find_y - (int)(max_child_height - find_height)/2; temp_val = x + H_MARGIN; if (temp_val >= width) text_width = 1; else if (LayoutIsRtoLM(w)) text_width = width - find_width - temp_val; else text_width = width - temp_val; _XmConfigureWidget(find_text, x, y, text_width, find_text->core.height, find_text->core.border_width); } } /************************************************************ * * Functions that Create Widgets. * ************************************************************/ /* Function Name: CreateTitle * Description: Creates the Title widget. * Arguments: parent - parent of the title widget. * label - The label string. * args, num_args - arguments used to create ext list. * Returns: the title widget. */ static Widget CreateTitle(Widget parent, XmString label, ArgList args, Cardinal num_args) { Widget w; Arg *new_args, largs[5]; Cardinal num_largs; num_largs = 0; if (label != NULL) { XtSetArg(largs[num_largs], XmNlabelString, label); num_largs++; } new_args = XtMergeArgLists(args, num_args, largs, num_largs); w = XtCreateManagedWidget("title", xmLabelWidgetClass, parent, new_args, num_largs + num_args); XtFree((XtPointer) new_args); return(w); } /* Function Name: CreateScrollbar * Description: Creates a vert or horizontal scrollbar. * Arguments: parent - parent of the scrollbar widget. * is_vert - if true then create a vertical scrollbar, * else, create a horiz one. * args, num_args - arguments used to create ext list. * Returns: none */ static Widget CreateScrollbar(Widget parent, Boolean is_vert,ArgList args, Cardinal num_args) { Widget w; Arg *new_args, largs[5]; Cardinal num_largs = 0; String name; if (is_vert) { XtSetArg(largs[num_largs], XmNorientation, XmVERTICAL); name = "vertBar"; } else { XtSetArg(largs[num_largs], XmNorientation, XmHORIZONTAL); name = "horizBar"; } num_largs++; new_args = XtMergeArgLists(args, num_args, largs, num_largs); w = XtCreateManagedWidget(name, xmScrollBarWidgetClass, parent, new_args, num_args + num_largs); XtFree((XtPointer) new_args); return(w); } static Widget CreateFindButton(Widget parent, ArgList args, Cardinal num_args) { Widget w; Arg *new_args, largs[5]; Cardinal num_largs = 0; XmMultiListWidget elist = (XmMultiListWidget) parent; num_largs = 0; XtSetArg(largs[num_largs], XmNlabelString, XmMultiList_find_label(elist)); num_largs++; new_args = XtMergeArgLists(args, num_args, largs, num_largs); w = XtCreateWidget("find", xmPushButtonWidgetClass, parent, new_args, num_largs + num_args); XtAddCallback(w, XmNactivateCallback, ActivateTextSearch, parent); if (XmMultiList_show_find(elist)) XtManageChild(w); XtFree((XtPointer) new_args); return(w); } /* Function Name: CreateFindText * Description: Creates the find text. * Arguments: parent - parent of the find text widget. * args, num_args - arguments used to create ext list. * Returns: the find text widget. */ static Widget CreateFindText(Widget parent, ArgList args, Cardinal num_args) { Widget w; XmMultiListWidget elist = (XmMultiListWidget) parent; w = XtCreateWidget("findText", xmTextFieldWidgetClass, parent, args, num_args); XtAddCallback(w, XmNactivateCallback, ActivateTextSearch, parent); if (XmMultiList_show_find(elist)) XtManageChild(w); return(w); } /* Function Name: CreateFrame * Description: Creates the frame to contain the list region * Arguments: parent - parent of the frame. * args, num_args - arguments used to create ext list. * Returns: none */ static Widget CreateFrame(Widget parent, ArgList args, Cardinal num_args) { XmMultiListWidget elist = (XmMultiListWidget) parent; Widget w; Arg largs[2], * new_args; Cardinal num_largs; num_largs = 0; XtSetArg(largs[num_largs], XmNshadowType, XmSHADOW_IN); num_largs++; new_args = XtMergeArgLists(args, num_args, largs, num_largs); w = XtCreateWidget("frame", xmFrameWidgetClass, parent, new_args, num_args + num_largs); XtFree((XtPointer) new_args); num_largs = 0; XtSetArg(largs[num_largs], XmNverticalScrollBar, XmMultiList_v_bar(elist)); num_largs++; XtSetArg(largs[num_largs], XmNhorizontalScrollBar, XmMultiList_h_bar(elist)); num_largs++; new_args = XtMergeArgLists(args, num_args, largs, num_largs); XmMultiList_ilist(elist) = XtCreateManagedWidget("list", xmI18ListWidgetClass, w, new_args, num_args + num_largs); XtFree((XtPointer) new_args); /* PWC - Note... * * Required to force geometry of frame here (it won't inherit child's size) */ w->core.width = XmMultiList_ilist(elist)->core.width + 2 * w->core.border_width; w->core.height = XmMultiList_ilist(elist)->core.height + 2 * w->core.border_width; XtManageChild(w); return(w); } /************************************************************ * * Public Functions. * ************************************************************/ /* -kat 1/18/91 * Function Name: XmMultiListGetSelectedRows * Description: Takes an Extended List and returns a NULL terminated array * of pointers to selected rows from the internal list * Arguments: w - the extended list widget * Returns: XmMultiListRowInfo ** */ XmMultiListRowInfo ** XmMultiListGetSelectedRows(Widget w) { XmMultiListWidget elist = (XmMultiListWidget) w; XmMultiListRowInfo **ret_rows = NULL; _XmWidgetToAppContext(w); _XmAppLock(app); ret_rows = XmI18ListGetSelectedRows(XmMultiList_ilist(elist)); _XmAppUnlock(app); return ret_rows; } /* Function Name: XmCreateMultiList * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateMultiList(Widget parent, String name, ArgList args, Cardinal num_args) { return (XtCreateWidget(name, xmMultiListWidgetClass, parent, args, num_args)); } Widget XmVaCreateMultiList( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmMultiListWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedMultiList( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmMultiListWidgetClass, parent, True, var, count); va_end(var); return w; } /* Function Name: XmMultiListUnselectAllItems * Description: Unselects all rows * Arguments: w - the ilist widget. * Returns: none */ void XmMultiListUnselectAllItems(Widget w) { XmMultiListWidget elist = (XmMultiListWidget)w; _XmWidgetToAppContext(w); _XmAppLock(app); Xm18IListUnselectAllItems( XmMultiList_ilist(elist) ); _XmAppUnlock(app); } /* Function Name: XmMultiListUnselectItem * Description: Unselects the row passed in * Arguments: w - the ilist widget. * row_info - ptr to the row passed in * Returns: none */ void XmMultiListUnselectItem(Widget w, XmMultiListRowInfo *row_info) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); Xm18IListUnselectItem( XmMultiList_ilist(elist), row_info ); _XmAppUnlock(app); } /* Function Name: XmMultiListToggleRow * Description: Toggles the selection state of a specified row * Arguments: w - the extended list widget * Returns: none */ void XmMultiListToggleRow(Widget w, short row) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmI18ListToggleRow(XmMultiList_ilist(elist), row); _XmAppUnlock(app); } /* Function Name: XmMultiListSelectItems * Description: Set selection state by matching column entries to XmString * Arguments: w - the extended list widget * item - XmString to use as selection key * notify - if True, call XmNsingleSelectionCallback * column - column number (0 - N) to match (or XmANY_COLUMN) * Returns: none */ void XmMultiListSelectItems(Widget w, XmString item, int column, Boolean notify) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmI18ListSelectItems((XmI18ListWidget)XmMultiList_ilist(elist), item, column, notify); _XmAppUnlock(app); } /* Function Name: XmMultiListDeselectItems * Description: Set selection state by matching column entries to XmString * Arguments: w - the extended list widget * item - XmString to use as selection key * column - column number (0 - N) to match (or XmANY_COLUMN) * Returns: none */ void XmMultiListDeselectItems(Widget w, XmString item, int column) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmI18ListDeselectItems((XmI18ListWidget)XmMultiList_ilist(elist), item, column); _XmAppUnlock(app); } /* Function Name: XmMultiListSelectAllItems * Description: Set selection state of all rows * Arguments: w - the extended list widget * notify - if True, call XmNsingleSelectionCallback * Returns: none */ void XmMultiListSelectAllItems(Widget w, Boolean notify) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmI18ListSelectAllItems((XmI18ListWidget)XmMultiList_ilist(elist), notify); _XmAppUnlock(app); } /* Function Name: XmMultiListSelectRow * Description: Set selection state on all rows * Arguments: w - the extended list widget * row - the row to select * notify - if True, call XmNsingleSelectionCallback * Returns: none */ void XmMultiListSelectRow(Widget w, int row, Boolean notify) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmI18ListSelectRow((XmI18ListWidget)XmMultiList_ilist(elist), row, notify); _XmAppUnlock(app); } /* Function Name: XmMultiListDeselectRow * Description: Set selection state on all rows * Arguments: w - the extended list widget * row - the row to select * Returns: none */ void XmMultiListDeselectRow(Widget w, int row) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmI18ListDeselectRow((XmI18ListWidget)XmMultiList_ilist(elist), row); _XmAppUnlock(app); } /* Function Name: XmMultiGetSelectedRowArray * Description: Creates an array of integers which are selected row #'s * Arguments: w - the extended list widget * rows - pointer to the array of selected row #'s * num_rows - pointer to the number of selected rows * Returns: selected rows array */ int * XmMultiListGetSelectedRowArray(Widget w, int *num_rows) { XmMultiListWidget elist = (XmMultiListWidget) w; int *ret_val; _XmWidgetToAppContext(w); _XmAppLock(app); ret_val = XmI18ListGetSelectedRowArray( (XmI18ListWidget)XmMultiList_ilist(elist), num_rows); _XmAppUnlock(app); return ret_val; } /* Function Name: XmMultiListMakeRowVisible * Description: Shifts the visible extended list rows as desired * Arguments: w - the extended list widget * row - the row number wished to be made visible * Returns: none */ void XmMultiListMakeRowVisible(Widget w, int row) { XmMultiListWidget elist = (XmMultiListWidget) w; _XmWidgetToAppContext(w); _XmAppLock(app); XmI18ListMakeRowVisible((XmI18ListWidget)XmMultiList_ilist(elist), row); _XmAppUnlock(app); } /* aliases of deprecated functiosn of XmExt18List */ extern WidgetClass xmExt18ListWidgetClass XM_ALIAS(xmMultiListWidgetClass); XmMultiListRowInfo ** XmExt18ListGetSelectedRows(Widget) XM_ALIAS(XmMultiListGetSelectedRows); Widget XmCreateExtended18List(Widget, String, ArgList, Cardinal) XM_ALIAS(XmCreateMultiList); Widget XmCreateExt18List(Widget, String, ArgList, Cardinal) XM_ALIAS(XmCreateMultiList); Widget XmVaCreateExt18List(Widget, char *, ...) XM_ALIAS(XmVaCreateMultiList); Widget XmVaCreateManagedExt18List(Widget, char *, ...) XM_ALIAS(XmVaCreateManagedMultiList); void XmExt18ListUnselectAllItems(Widget) XM_ALIAS(XmMultiListUnselectAllItems); void XmExt18ListUnselectItem(Widget, XmMultiListRowInfo*) XM_ALIAS(XmMultiListUnselectItem); void XmExt18ListToggleRow(Widget, short) XM_ALIAS(XmMultiListToggleRow); void XmExt18ListSelectItems(Widget, XmString, int, Boolean) XM_ALIAS(XmMultiListSelectItems); void XmExt18ListDeselectItems(Widget, XmString, int) XM_ALIAS(XmMultiListDeselectItems); void XmExt18ListSelectAllItems(Widget, Boolean) XM_ALIAS(XmMultiListSelectAllItems); void XmExt18ListSelectRow(Widget, int, Boolean) XM_ALIAS(XmMultiListSelectRow); void XmExt18ListDeselectRow(Widget, int) XM_ALIAS(XmMultiListDeselectRow); int *XmExt18ListGetSelectedRowArray(Widget, int *) XM_ALIAS(XmMultiListGetSelectedRowArray); void XmExt18ListMakeRowVisible(Widget, int) XM_ALIAS(XmMultiListMakeRowVisible); extern XmMultiListClassRec xmExt18ListClassRec XM_ALIAS(xmMultiListClassRec); motif-2.3.8/lib/Xm/ColorI.h0000644000175000017500000000524412672140200012254 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: ColorI.h /main/6 1995/07/14 10:15:47 drk $ */ #ifndef _XmColorI_h #define _XmColorI_h #include #include #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations for Color.c ********/ extern void _XmForegroundColorDefault( Widget widget, int offset, XrmValue *value) ; extern void _XmHighlightColorDefault( Widget widget, int offset, XrmValue *value) ; extern void _XmBackgroundColorDefault( Widget widget, int offset, XrmValue *value) ; extern void _XmTopShadowColorDefault( Widget widget, int offset, XrmValue *value) ; extern void _XmBottomShadowColorDefault( Widget widget, int offset, XrmValue *value) ; extern void _XmSelectColorDefault( Widget widget, int offset, XrmValue *value) ; extern Boolean _XmSearchColorCache( unsigned int which, XmColorData *values, XmColorData **ret) ; extern XmColorData * _XmAddToColorCache( XmColorData *new_rec) ; #ifdef FIX_1381 extern Pixmap _XmConvertToBW( Widget w, Pixmap pm) ; #endif /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmColorI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/MenuT.h0000644000175000017500000001112512672140200012110 00000000000000/* $XConsortium: MenuT.h /main/5 1995/07/15 20:53:03 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmMenuT_H #define _XmMenuT_H #include #ifdef __cplusplus extern "C" { #endif /* Quick fix for Linux-ARM where "arm" is the #define symbol */ #ifdef arm # undef arm #endif /* Menu System Traits */ externalref XrmQuark XmQTmenuSystem; externalref XrmQuark XmQTmenuSavvy; /* Trait structures and typedefs, place typedefs first */ /* Used by the disable callback method of the menu savvy trait */ typedef enum { XmDISABLE_ACTIVATE, /* defer to the entryCallback */ XmENABLE_ACTIVATE /* invoke own activate callback */ } XmActivateState; /* Menu trait typedefs */ typedef int (*XmMenuSystemWidgetProc)(Widget); typedef Boolean (*XmMenuSystemVerifyProc)(Widget, XEvent*); typedef void (*XmMenuSystemControlTraversalProc)(Widget, Boolean); typedef void (*XmMenuSystemCascadeProc)(Widget, Widget, XEvent*); typedef void (*XmMenuSystemPositionProc)(Widget, XEvent*); typedef Boolean (*XmMenuSystemPopdownProc)(Widget, XEvent*); typedef void (*XmMenuSystemEntryCallbackProc)(Widget, Widget, XtPointer); typedef Boolean (*XmMenuSystemUpdateHistoryProc)(Widget, Widget, Boolean); typedef void (*XmMenuSystemUpdateBindingsProc)(Widget, int); typedef void (*XmMenuSystemRecordPostFromWidgetProc)(Widget, Widget, Boolean); typedef void (*XmMenuSystemDisarmProc)(Widget); typedef Widget (*XmMenuSystemPopupPostedProc)(Widget); typedef void (*XmMenuSavvyDisableProc)(Widget, XmActivateState); typedef char* (*XmMenuSavvyGetAcceleratorProc)(Widget); typedef KeySym (*XmMenuSavvyGetMnemonicProc)(Widget); typedef char* (*XmMenuSavvyGetActivateCBNameProc)(); #define XmMenuSystemTypeProc XmMenuSystemWidgetProc #define XmMenuSystemStatusProc XmMenuSystemWidgetProc #define XmMenuSystemGetPostedFromWidgetProc XmMenuSystemDisarmProc #define XmMenuSystemArmProc XmMenuSystemDisarmProc #define XmMenuSystemMenuBarCleanupProc XmMenuSystemDisarmProc #define XmMenuSystemTearOffArmProc XmMenuSystemDisarmProc #define XmMenuSystemReparentProc XmMenuSystemPositionProc #define XmMenuSystemPopdownAllProc XmMenuSystemPositionProc #define XmMenuSystemChildFocusProc XmMenuSystemDisarmProc /* XmTmenuProcTrait */ /* Version 0: initial release. */ typedef struct _XmMenuSystemTraitRec { int version; /* 0 */ XmMenuSystemTypeProc type; XmMenuSystemStatusProc status; XmMenuSystemCascadeProc cascade; XmMenuSystemVerifyProc verifyButton; XmMenuSystemControlTraversalProc controlTraversal; XmMenuSystemMenuBarCleanupProc menuBarCleanup; XmMenuSystemPopdownProc popdown; XmMenuSystemPopdownProc buttonPopdown; XmMenuSystemReparentProc reparentToTearOffShell; XmMenuSystemReparentProc reparentToMenuShell; XmMenuSystemArmProc arm; XmMenuSystemDisarmProc disarm; XmMenuSystemTearOffArmProc tearOffArm; XmMenuSystemEntryCallbackProc entryCallback; XmMenuSystemUpdateHistoryProc updateHistory; XmMenuSystemGetPostedFromWidgetProc getLastSelectToplevel; XmMenuSystemPositionProc position; XmMenuSystemUpdateBindingsProc updateBindings; XmMenuSystemRecordPostFromWidgetProc recordPostFromWidget; XmMenuSystemPopdownAllProc popdownEveryone; XmMenuSystemChildFocusProc childFocus; XmMenuSystemPopupPostedProc getPopupPosted; } XmMenuSystemTraitRec, *XmMenuSystemTrait; /* XmTmenuSavvyTrait */ /* Version 0: initial release. */ typedef struct _XmMenuSavvyTraitRec { int version; /* 0 */ XmMenuSavvyDisableProc disableCallback; XmMenuSavvyGetAcceleratorProc getAccelerator; XmMenuSavvyGetMnemonicProc getMnemonic; XmMenuSavvyGetActivateCBNameProc getActivateCBName; } XmMenuSavvyTraitRec, *XmMenuSavvyTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmMenuT_H */ motif-2.3.8/lib/Xm/RowColumnP.h0000644000175000017500000004157413145162623013151 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmRowColumnP_h #define _XmRowColumnP_h #include #include #ifdef __cplusplus extern "C" { #endif /* Button Event Status Record for popup verification at manage time */ typedef struct _XmButtonEventStatusRec { Time time; Boolean verified; Boolean waiting_to_be_managed; XButtonEvent event; } XmButtonEventStatusRec; /* replay info rec - last menu that was posted before event replay */ typedef struct _XmReplayInfoRec { Time time; Widget toplevel_menu; } XmReplayInfoRec; typedef struct _XmMenuFocusRec { Widget oldWidget; Window oldFocus; int oldRevert; Time oldTime; } XmMenuFocusRec; /* Menu State is per screen */ typedef struct _XmMenuStateRec { Widget RC_LastSelectToplevel; XmButtonEventStatusRec RC_ButtonEventStatus; XmReplayInfoRec RC_ReplayInfo; /* * needed for funky menubar mode so that the traversal can be restored * to the correct highlighted item when we are done. */ Widget RC_activeItem; XmMenuFocusRec RC_menuFocus; /* * A workaround is provided to allow applications to get insensitive * menu items. This is useful for context "sensitive-shared-tear off- * accelerated" menu items. Accessed via internal (for now) function, * _XmAllowAcceleratedInsensitiveUmanagedMenuItems(). */ Boolean RC_allowAcceleratedInsensitiveUnmanagedMenuItems; Time MS_LastManagedMenuTime; Boolean MU_InDragMode; Widget MU_CurrentMenuChild; Boolean MU_InPMMode; } XmMenuStateRec, *XmMenuState; typedef struct _XmRCKidGeometryRec { Widget kid; XtWidgetGeometry box; Dimension margin_top; Dimension margin_bottom; Dimension baseline; } XmRCKidGeometryRec, *XmRCKidGeometry; /* The RowColumn instance record */ typedef struct _XmRowColumnPart { Dimension margin_height; /* margin around inside of widget */ Dimension margin_width; Dimension spacing; /* pixels between entries */ Dimension entry_border; /* size of entry borders */ /* next only used w/ menubars */ Widget help_pushbutton; /* ptr to help pushbutton widget */ Widget cascadeBtn; /* if this menu is pulled down by a */ /* pulldown widget this will point */ /* at the pulldown. needed to go */ /* up the cascade */ /* next two only used w/ option menus */ /* they are really only temporary */ /* since the data is passed off to */ /* the pulldown widget which is */ /* automatically built */ XmString option_label; /* label for option menu pulldown */ Widget option_submenu; /* which submenu to pulldown */ XmRCKidGeometry boxes; /* when doing menu layouts is an */ /* array of geo req's to make it easy */ WidgetClass entry_class; /* if homogeneous, what class */ XtCallbackList entry_callback; /* a child fired off */ XtCallbackList map_callback; /* about to be mapped call back */ XtCallbackList unmap_callback; /* about to be unmapped call back */ Widget memory_subwidget; /* id of last subwidget that */ /* fired off. Recorded by the */ /* entry_fired proc, can be set too */ /* this causes mouse/muscle memory */ /* to also be reset */ short num_columns; /* if columnar packing this is how */ /* many columns to use */ String menuPost; /* a translation for posting popups */ unsigned int postButton; /* active mouse button */ int postEventType; /* active mouse event type */ unsigned int postModifiers; /* active mouse modifier */ String menu_accelerator; KeySym mnemonic; XmStringCharSet mnemonicCharSet; unsigned char entry_alignment; /* type of label alignment */ /* our children should have */ /* next two are layout, Tight is the */ /* standard menubar packing. Columns */ /* is radio box style, orientation */ /* determines if it is column or row */ /* major, Vert = column major */ unsigned char packing; /* entry packing (layout) style */ unsigned char type; /* temporary: diff between menu/bar */ unsigned char orientation; /* horizontal or vertical */ /* next two indicate how the widget */ /* responds to size changes if there */ /* is no geo mgr. If true then the */ /* dimension is never changed. Set */ /* to true if dimension is spec'd */ /* at create time */ Boolean armed; /* controls whether pulldowns work */ /* or not, button down in any part of */ /* the menubar arms it, this is a bit field */ /* used for other internal flags, see macros */ /* next is only valid for popup menus */ Boolean adjust_margin; /* T/F, indicating if we should force */ /* all subwidgets to have similar */ /* margins */ Boolean adjust_last; /* Indicates whether or not the last row */ /* row or column should be stretched to */ /* the edge of the row_column widget. */ Boolean do_alignment; /* T/F, do we force alignment on all */ /* our children */ Boolean radio; /* T/F, do we do the toggle button */ /* 'only-one-down' enforcement */ Boolean radio_one; /* T/F, must have one radio button */ /* set to on */ Boolean homogeneous; /* T/F, do we only allow a single */ /* class of children */ Boolean resize_width; Boolean resize_height; XtEnum popup_enabled; Dimension old_width; /* save the old width, etc to use */ Dimension old_height; /* at resize time since it now has */ Dimension old_shadow_thickness; /* NW gravity */ Widget * postFromList; /* list for sharing menupanes */ int postFromCount; /* count of the list */ int postFromListSize; /* size of the malloc'ed list */ Widget lastSelectToplevel; /* returned in XmGetPostedFromWidget*/ Widget popupPosted; /* popup submenu currently posted */ unsigned char oldFocusPolicy; /* save when menus begin traversal */ /***************** 1.2 ***************/ unsigned char TearOffModel; /* enable/disable flag */ Widget ParentShell; /* Save the parent shell when torn */ Widget tear_off_control; Boolean to_state; /* tear off state */ /* tear off activate/deactivate callbacks */ XtCallbackList tear_off_activated_callback; XtCallbackList tear_off_deactivated_callback; Widget tear_off_lastSelectToplevel; Widget tear_off_focus_item; /* when tear off is inactive */ unsigned char entry_vertical_alignment; unsigned char popup_menu_click; XtWorkProcId popup_workproc; XmString tear_off_title; } XmRowColumnPart; /* Full instance record declaration */ typedef struct _XmRowColumnRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmRowColumnPart row_column; } XmRowColumnRec; typedef struct _XmRowColumnWidgetRec /* OBSOLETE (for compatibility only).*/ { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmRowColumnPart row_column; } XmRowColumnWidgetRec; /* RowColumn class structure */ typedef struct _XmRowColumnClassPart { XmMenuProc menuProcedures; /* proc to interface with menu widgets */ XtActionProc armAndActivate; /* proc triggered by acclerator */ XmMenuTraversalProc traversalHandler;/* proc to handle menu traversal */ XtPointer extension; /* Pointer to extension record */ } XmRowColumnClassPart; typedef struct _XmRowColumnClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmRowColumnClassPart row_column_class; } XmRowColumnClassRec, *XmRowColumnClass; externalref XmRowColumnClassRec xmRowColumnClassRec; /* Constraint Definition */ /* No constraint resources */ typedef struct _XmRowColumnConstraintPart { Boolean was_managed; Dimension margin_top; Dimension margin_bottom; Dimension baseline; short position_index; } XmRowColumnConstraintPart; typedef struct _XmRowColumnConstraintRec { XmManagerConstraintPart manager; XmRowColumnConstraintPart row_column; } XmRowColumnConstraintRec; /* Access macros */ #define XmRC_ARMED_BIT (1 << 0) #define XmRC_BEING_ARMED_BIT (1 << 1) /* bits in menu's armed byte */ #define XmRC_EXPOSE_BIT (1 << 2) /* used in both menu and */ #define XmRC_WINDOW_MOVED_BIT (1 << 3) /* popup menu, careful */ #define XmRC_WIDGET_MOVED_BIT (1 << 4) #define XmRC_POPPING_DOWN_BIT (1 << 5) #define XmRC_FROM_RESIZE_BIT (1 << 6) #define RC_IsArmed(m) (((XmRowColumnWidget)(m))->row_column.armed & XmRC_ARMED_BIT) #define RC_BeingArmed(m) (((XmRowColumnWidget)(m))->row_column.armed & XmRC_BEING_ARMED_BIT) #define RC_DoExpose(m) (((XmRowColumnWidget)(m))->row_column.armed & XmRC_EXPOSE_BIT) #define RC_WidgetHasMoved(m) (((XmRowColumnWidget)(m))->row_column.armed & XmRC_WIDGET_MOVED_BIT) #define RC_WindowHasMoved(m) (((XmRowColumnWidget)(m))->row_column.armed & XmRC_WINDOW_MOVED_BIT) #define RC_PoppingDown(m) (((XmRowColumnWidget)(m))->row_column.armed & XmRC_POPPING_DOWN_BIT) #define RC_FromResize(m) (((XmRowColumnWidget)(m))->row_column.armed & XmRC_FROM_RESIZE_BIT) #define RC_SetBit(byte,bit,v) byte = (byte & (~bit)) | (v ? bit : 0) #define RC_SetArmed(m,v) RC_SetBit (((XmRowColumnWidget)(m))->row_column.armed, XmRC_ARMED_BIT, v) #define RC_SetBeingArmed(m,v) RC_SetBit (((XmRowColumnWidget)(m))->row_column.armed, XmRC_BEING_ARMED_BIT, v) #define RC_SetExpose(m,v) RC_SetBit (((XmRowColumnWidget)(m))->row_column.armed, XmRC_EXPOSE_BIT, v) #define RC_SetWidgetMoved(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.armed, XmRC_WIDGET_MOVED_BIT,v) #define RC_SetWindowMoved(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.armed, XmRC_WINDOW_MOVED_BIT,v) #define RC_SetPoppingDown(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.armed, XmRC_POPPING_DOWN_BIT,v) #define RC_SetFromResize(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.armed, XmRC_FROM_RESIZE_BIT,v) #define RC_MarginW(m) (((XmRowColumnWidget)(m))->row_column.margin_width) #define RC_MarginH(m) (((XmRowColumnWidget)(m))->row_column.margin_height) #define RC_Entry_cb(m) (((XmRowColumnWidget)(m))->row_column.entry_callback) #define RC_Map_cb(m) (((XmRowColumnWidget)(m))->row_column.map_callback) #define RC_Unmap_cb(m) (((XmRowColumnWidget)(m))->row_column.unmap_callback) #define RC_Orientation(m) (((XmRowColumnWidget)(m))->row_column.orientation) #define RC_Spacing(m) (((XmRowColumnWidget)(m))->row_column.spacing) #define RC_EntryBorder(m) (((XmRowColumnWidget)(m))->row_column.entry_border) #define RC_HelpPb(m) (((XmRowColumnWidget)(m))->row_column.help_pushbutton) #define RC_DoMarginAdjust(m) (((XmRowColumnWidget)(m))->row_column.adjust_margin) #define RC_EntryAlignment(m) (((XmRowColumnWidget)(m))->row_column.entry_alignment) #define RC_EntryVerticalAlignment(m) (((XmRowColumnWidget)(m))->row_column.entry_vertical_alignment) #define RC_Packing(m) (((XmRowColumnWidget)(m))->row_column.packing) #define RC_NCol(m) (((XmRowColumnWidget)(m))->row_column.num_columns) #define RC_AdjLast(m) (((XmRowColumnWidget)(m))->row_column.adjust_last) #define RC_AdjMargin(m) (((XmRowColumnWidget)(m))->row_column.adjust_margin) #define RC_MemWidget(m) (((XmRowColumnWidget)(m))->row_column.memory_subwidget) #define RC_CascadeBtn(m) (((XmRowColumnWidget)(m))->row_column.cascadeBtn) #define RC_OptionLabel(m) (((XmRowColumnWidget)(m))->row_column.option_label) #define RC_OptionSubMenu(m) (((XmRowColumnWidget)(m))->row_column.option_submenu) #define RC_RadioBehavior(m) (((XmRowColumnWidget)(m))->row_column.radio) #define RC_RadioAlwaysOne(m) (((XmRowColumnWidget)(m))->row_column.radio_one) #define RC_PopupPosted(m) (((XmRowColumnWidget)(m))->row_column.popupPosted) #define RC_ResizeHeight(m) (((XmRowColumnWidget)(m))->row_column.resize_height) #define RC_ResizeWidth(m) (((XmRowColumnWidget)(m))->row_column.resize_width) #define RC_Type(m) (((XmRowColumnWidget)(m))->row_column.type) #define RC_EntryClass(m) (((XmRowColumnWidget)(m))->row_column.entry_class) #define RC_IsHomogeneous(m) (((XmRowColumnWidget)(m))->row_column.homogeneous) #define RC_Boxes(m) (((XmRowColumnWidget)(m))->row_column.boxes) #define RC_PopupEnabled(m) (((XmRowColumnWidget)(m))->row_column.popup_enabled) #define RC_MenuAccelerator(m) (((XmRowColumnWidget)(m))->row_column.menu_accelerator) #define RC_Mnemonic(m) (((XmRowColumnWidget)(m))->row_column.mnemonic) #define RC_MnemonicCharSet(m) (((XmRowColumnWidget)(m))->row_column.mnemonicCharSet) #define RC_MenuPost(m) (((XmRowColumnWidget) m)->row_column.menuPost) #define RC_PostButton(m) (((XmRowColumnWidget) m)->row_column.postButton) #define RC_PostModifiers(m) (((XmRowColumnWidget) m)->row_column.postModifiers) #define RC_PostEventType(m) (((XmRowColumnWidget) m)->row_column.postEventType) #define RC_OldFocusPolicy(m) (((XmRowColumnWidget) m)->row_column.oldFocusPolicy) #define RC_ParentShell(m) (((XmRowColumnWidget) m)->row_column.ParentShell) #define RC_TearOffControl(m) (((XmRowColumnWidget) m)->row_column.tear_off_control) #define RC_TearOffModel(m) (((XmRowColumnWidget) m)->row_column.TearOffModel) #define RC_popupMenuClick(m) (((XmRowColumnWidget)(m))->row_column.popup_menu_click) #define RC_TearOffTitle(m) (((XmRowColumnWidget)(m))->row_column.tear_off_title) /* Tear Off State */ #define XmTO_TORN_OFF_BIT (1 << 0) #define XmTO_FROM_INIT_BIT (1 << 1) #define XmTO_VISUAL_DIRTY_BIT (1 << 2) #define XmTO_ACTIVE_BIT (1 << 3) #define RC_SetTornOff(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.to_state, XmTO_TORN_OFF_BIT,v) #define RC_TornOff(m) (((XmRowColumnWidget)(m))->row_column.to_state & XmTO_TORN_OFF_BIT) #define RC_SetFromInit(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.to_state, XmTO_FROM_INIT_BIT,v) #define RC_FromInit(m) (((XmRowColumnWidget)(m))->row_column.to_state & XmTO_FROM_INIT_BIT) #define RC_SetTearOffDirty(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.to_state, XmTO_VISUAL_DIRTY_BIT,v) #define RC_TearOffDirty(m) (((XmRowColumnWidget)(m))->row_column.to_state & XmTO_VISUAL_DIRTY_BIT) #define RC_TearOffActive(m) (((XmRowColumnWidget)(m))->row_column.to_state & XmTO_ACTIVE_BIT) #define RC_SetTearOffActive(m,v) RC_SetBit(((XmRowColumnWidget)(m))->row_column.to_state, XmTO_ACTIVE_BIT,v) #define initial_value 0 /* Defines used when calling _XmProcessMenuTree() */ #define XmADD 0 #define XmDELETE 1 #define XmREPLACE 2 /* Defines used when calling _XmMenuIsAccessible() */ #define XmWEAK_CHECK 1 #define XmMEDIUM_CHECK 2 #define XmSTRONG_CHECK 3 #define XmMENU_BEGIN 0 #define XmMENU_MIDDLE 1 #define XmMENU_END 2 /* Defines used when calling find_first_managed_child() */ #define ANY_CHILD 0 #define FIRST_BUTTON 1 #define XmInheritMenuProceduresProc ((XmMenuProc) _XtInherit) #define XmInheritArmAndActivateProc ((XtActionProc) _XtInherit) #define XmInheritMenuTraversalProc ((XmMenuTraversalProc) _XtInherit) #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRowColumnP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/UnitTypeT.h0000644000175000017500000000303312672140200012764 00000000000000/* $XConsortium: UnitTypeT.h /main/5 1995/07/15 20:57:00 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _XmUnitTypeT_H #define _XmUnitTypeT_H #include #ifdef __cplusplus extern "C" { #endif externalref XrmQuark XmQTspecifyUnitType; /* Trait structures and typedefs, place typedefs first */ typedef unsigned char (*XmSpecUnitTypeGetProc)(Widget wid); /* Version 0: initial release. */ typedef struct _XmSpecUnitTypeTraitRec { int version; /* 0 */ XmSpecUnitTypeGetProc getUnitType; } XmSpecUnitTypeTraitRec, *XmSpecUnitTypeTrait; #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmUnitTypeT_H */ motif-2.3.8/lib/Xm/RCLayoutP.h0000644000175000017500000000235012672140200012702 00000000000000/* $XConsortium: RCLayoutP.h /main/4 1995/07/15 20:54:35 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _XmRCLayoutP_h #define _XmRCLayoutP_h #include #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmRCLayoutP_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/Separator.h0000644000175000017500000000400313145162623013026 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* Separator Widget */ #ifndef _XmSeparator_h #define _XmSeparator_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsSeparator #define XmIsSeparator(w) XtIsSubclass(w, xmSeparatorWidgetClass) #endif /* XmIsSeparator */ externalref WidgetClass xmSeparatorWidgetClass; typedef struct _XmSeparatorClassRec * XmSeparatorWidgetClass; typedef struct _XmSeparatorRec * XmSeparatorWidget; /******** Public Function Declarations ********/ Widget XmCreateSeparator( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; Widget XmVaCreateSeparator( Widget parent, char *name, ...); Widget XmVaCreateManagedSeparator( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmSeparator_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Xm/DragBS.c0000644000175000017500000014040713145162623012174 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DragBS.c /main/29 1998/03/18 15:10:28 csn $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /***************************************************************************** * * The purpose of the routines in this module is to cache frequently needed * data on window properties to reduce roundtrip server requests. * * The data is stored on window properties of motifWindow, a persistent, * override-redirect, InputOnly child window of the display's default root * window. A client looks for the motifWindow id on the "_MOTIF_DRAG_WINDOW" * property of the display's default root window. If it finds the id, the * client saves it in its displayToMotifWindowContext. Otherwise, the * client creates the motifWindow and stores its id on that root property * and saves the id in its displayToMotifWindowContext. MotifWindow is * mapped but is not visible on the screen. * * Two sets of data are stored on motifWindow properties: * * 1. an atom table, and * 2. a targets list table. * * The "_MOTIF_DRAG_ATOMS" property on motifWindow contains an atoms table, * consisting of pairs of atoms and timestamps. The atoms are interned * once and are available for clients to use without repeated roundtrip * server requests to intern them. A timestamp of 0 indicates that the * atom is available. A nonzero timestamp indicates when the atom was last * allocated to a client. The atoms table initially contains only atom * "_MOTIF_ATOM_0" with timestamp 0. A client requests an atom by calling * _XmAllocMotifAtom() with a timestamp. _XmAllocMotifAtom() tries to find * an available atom in the table. If it succeeds it sets the atom's * timestamp to the value specified and returns the atom. If no atom is * available, _XmAllocMotifAtom() adds an atom to the table with the * specified timestamp, updates the "_MOTIF_DRAG_ATOMS" property on * motifWindow, and returns the new atom. These new atoms are named * "_MOTIF_ATOM_n" where n is 1, 2, 3, ... . The routine _XmGetMotifAtom() * returns the atom from the atoms table with nonzero timestamp less than * but closest to a specified value. It does not change the atoms table. * A client frees an atom by calling _XmFreeMotifAtom(), which sets the * atom's timestamp to 0 and updates the "_MOTIF_DRAG_ATOMS" property on * motifWindow. To minimize property access, the client saves the address * of its current atoms table on the displayToAtomsContext context. * * The "_MOTIF_DRAG_TARGETS" property on motifWindow contains a targets * table, consisting of a sequence of target lists to be shared among * clients. These target lists are sorted into ascending order to avoid * permutations. By sharing the targets table, clients may pass target * lists between themselves by passing instead the corresponding target * list indexes. The routine _XmInitTargetsTable() initializes the atoms * table on the "_MOTIF_DRAG_ATOMS" property, then initializes the targets * table on the "_MOTIF_DRAG_TARGETS" property to contain only two lists: * * { 0, }, and * { XA_STRING, } * * A client adds a target list to the targets table by passing the target * list to _XmTargetsToIndex(). _XmTargetsToIndex() first sorts the target * list into ascending order, then searches the targets table for a match. * If it finds a match, it returns the index of the matching targets table * entry. Otherwise, it adds the sorted target list to the table, updates * the "_MOTIF_DRAG_TARGETS" property on motifWindow, and returns the index * of the new targets table entry. A client uses _XmIndexToTargets() to * map a targets table index to a target list. To minimize property access, * the client saves the address of its current targets table on the * displayToTargetsContext context. * * The "_MOTIF_DRAG_PROXY_WINDOW" property on motifWindow contains the * window id of the DragNDrop proxy window. The routine * _XmGetDragProxyWindow() returns the window id stored there. ***************************************************************************/ #include #include "XmI.h" #include "DragICCI.h" #include "DragBSI.h" #include "MessagesI.h" #include #include #include #include #ifndef X_NOT_STDC_ENV #include #endif #undef _XmIndexToTargets #undef _XmTargetsToIndex #define MAXSTACK 1200 #define MAXPROPLEN 100000L /* structures to improve portability of WriteTargets */ typedef struct { CARD32 value B32; } CARD32Item; typedef struct { CARD16 value B16; CARD16 pad B16; } CARD16Item; #define MESSAGE1 _XmMMsgDragBS_0000 #define MESSAGE2 _XmMMsgDragBS_0001 #define MESSAGE3 _XmMMsgDragBS_0002 #define MESSAGE4 _XmMMsgDragBS_0003 #define MESSAGE5 _XmMMsgDragBS_0004 #define MESSAGE6 _XmMMsgDragBS_0005 #define MESSAGE7 _XmMMsgDragBS_0006 /******** Static Function Declarations ********/ static int LocalErrorHandler( Display *display, XErrorEvent *error) ; static void StartProtectedSection( Display *display, Window window) ; static void EndProtectedSection( Display *display) ; static Window GetMotifWindow( Display *display) ; static void SetMotifWindow( Display *display, Window motifWindow) ; static xmTargetsTable GetTargetsTable( Display *display) ; static void SetTargetsTable( Display *display, xmTargetsTable targetsTable) ; static xmAtomsTable GetAtomsTable( Display *display) ; static void SetAtomsTable( Display *display, xmAtomsTable atomsTable) ; static Window ReadMotifWindow( Display *display) ; static Window CreateMotifWindow( Display *display) ; static void WriteMotifWindow( Display *display, Window *motifWindow) ; static void WriteAtomsTable( Display *display, xmAtomsTable atomsTable) ; static Boolean ReadAtomsTable( Display *display, xmAtomsTable atomsTable) ; static void WriteTargetsTable( Display *display, xmTargetsTable targetsTable) ; static Boolean ReadTargetsTable( Display *display, xmTargetsTable targetsTable) ; static xmTargetsTable CreateDefaultTargetsTable( Display *display) ; static xmAtomsTable CreateDefaultAtomsTable( Display *display) ; static int AtomCompare( XmConst void *atom1, XmConst void *atom2) ; /******** End Static Function Declarations ********/ static Boolean bad_window; static XErrorHandler oldErrorHandler = NULL; static unsigned long firstProtectRequest; static Window errorWindow; static XContext displayToMotifWindowContext = (XContext) NULL; static XContext displayToTargetsContext = (XContext) NULL; static XContext displayToAtomsContext = (XContext) NULL; /***************************************************************************** * * LocalErrorHandler () * ***************************************************************************/ static int LocalErrorHandler( Display *display, XErrorEvent *error ) { int ret_val; _XmProcessLock(); if (error->error_code == BadWindow && error->resourceid == errorWindow && error->serial >= firstProtectRequest) { bad_window = True; _XmProcessUnlock(); return 0; } if (oldErrorHandler == NULL) { _XmProcessUnlock(); return 0; /* should never happen */ } ret_val = (*oldErrorHandler)(display, error); _XmProcessUnlock(); return ret_val; } /***************************************************************************** * * StartProtectedSection () * * To protect against reading or writing to a property on a window that has * been destroyed. ***************************************************************************/ static void StartProtectedSection( Display *display, Window window ) { bad_window = False; oldErrorHandler = XSetErrorHandler (LocalErrorHandler); firstProtectRequest = NextRequest (display); errorWindow = window; } /***************************************************************************** * * EndProtectedSection () * * Flushes any generated errors on and restores the original error handler. ***************************************************************************/ static void EndProtectedSection( Display *display ) { XSync (display, False); XSetErrorHandler (oldErrorHandler); oldErrorHandler = NULL; } /***************************************************************************** * * GetMotifWindow () * * Get the motifWindow id from the displayToMotifWindowContext. ***************************************************************************/ static Window GetMotifWindow( Display *display ) { Window motifWindow; XContext loc_context; _XmProcessLock(); if (displayToMotifWindowContext == (XContext) NULL) { displayToMotifWindowContext = XUniqueContext(); } loc_context = displayToMotifWindowContext; _XmProcessUnlock(); if (XFindContext(display, DefaultRootWindow (display), loc_context, (char **)&motifWindow)) { motifWindow = None; } return (motifWindow); } /***************************************************************************** * * SetMotifWindow () * * Set the motifWindow id into the displayToMotifWindowContext. ***************************************************************************/ static void SetMotifWindow( Display *display, Window motifWindow ) { Window oldMotifWindow; XContext loc_context; _XmProcessLock(); if (displayToMotifWindowContext == (XContext) NULL) { displayToMotifWindowContext = XUniqueContext(); } loc_context = displayToMotifWindowContext; _XmProcessUnlock(); /* * Save window data. * Delete old context if one exists. */ if (XFindContext (display, DefaultRootWindow (display), loc_context, (char **) &oldMotifWindow)) { XSaveContext(display, DefaultRootWindow (display), loc_context, (char *) motifWindow); } else if (oldMotifWindow != motifWindow) { XDeleteContext (display, DefaultRootWindow (display), loc_context); XSaveContext(display, DefaultRootWindow (display), loc_context, (char *) motifWindow); } } /***************************************************************************** * * GetTargetsTable () * * Get the targets table address from the displayToTargetsContext. ***************************************************************************/ static xmTargetsTable GetTargetsTable( Display *display ) { xmTargetsTable targetsTable; XContext loc_context; _XmProcessLock(); if (displayToTargetsContext == (XContext) NULL) { displayToTargetsContext = XUniqueContext(); } loc_context = displayToTargetsContext; _XmProcessUnlock(); if (XFindContext(display, DefaultRootWindow (display), loc_context, (char **)&targetsTable)) { targetsTable = NULL; } return (targetsTable); } /***************************************************************************** * * SetTargetsTable () * * Set the targets table address into the displayToTargetsContext. ***************************************************************************/ static void SetTargetsTable( Display *display, xmTargetsTable targetsTable ) { xmTargetsTable oldTargetsTable; XContext loc_context; _XmProcessLock(); if (displayToTargetsContext == (XContext) NULL) { displayToTargetsContext = XUniqueContext(); } loc_context = displayToTargetsContext; _XmProcessUnlock(); /* * Save targets data. * Delete old context if one exists. */ if (XFindContext (display, DefaultRootWindow (display), loc_context, (char **) &oldTargetsTable)) { if (targetsTable) XSaveContext(display, DefaultRootWindow (display), loc_context, (char *) targetsTable); } else if (oldTargetsTable != targetsTable) { XDeleteContext (display, DefaultRootWindow (display), loc_context); { unsigned i = 0 ; while( i < oldTargetsTable->numEntries ) { XtFree( (char *) oldTargetsTable->entries[i++].targets) ; } XtFree( (char *) oldTargetsTable->entries) ; XtFree( (char *) oldTargetsTable) ; } if (targetsTable) XSaveContext(display, DefaultRootWindow (display), loc_context, (char *) targetsTable); } } /***************************************************************************** * * GetAtomsTable () * * Get the atomsTable address from the displayToAtomsContext. ***************************************************************************/ static xmAtomsTable GetAtomsTable( Display *display ) { xmAtomsTable atomsTable; XContext loc_context; _XmProcessLock(); if (displayToAtomsContext == (XContext) NULL) { displayToAtomsContext = XUniqueContext(); } loc_context = displayToAtomsContext; _XmProcessUnlock(); if (XFindContext (display, DefaultRootWindow (display), loc_context, (XPointer *)&atomsTable)) { atomsTable = NULL; } return (atomsTable); } /***************************************************************************** * * SetAtomsTable () * * Set the atoms table address into the displayToAtomsContext. ***************************************************************************/ static void SetAtomsTable( Display *display, xmAtomsTable atomsTable ) { xmAtomsTable oldAtomsTable; XContext loc_context; _XmProcessLock(); if (displayToAtomsContext == (XContext) NULL) { displayToAtomsContext = XUniqueContext(); } loc_context = displayToAtomsContext; _XmProcessUnlock(); /* * Save atom data. * Delete old context if one exists. */ if (XFindContext (display, DefaultRootWindow (display), loc_context, (char **) &oldAtomsTable)) { if (atomsTable) XSaveContext(display, DefaultRootWindow (display), loc_context, (char *) atomsTable); } else if (oldAtomsTable != atomsTable) { XDeleteContext (display, DefaultRootWindow (display), loc_context); XtFree( (char *) (oldAtomsTable->entries)) ; XtFree( (char *) oldAtomsTable) ; if (atomsTable) XSaveContext(display, DefaultRootWindow (display), loc_context, (char *) atomsTable); } } /***************************************************************************** * * ReadMotifWindow () * ***************************************************************************/ static Boolean RMW_ErrorFlag; /*ARGSUSED*/ static int RMW_ErrorHandler(Display *display, /* unused */ XErrorEvent* event) /* unused */ { _XmProcessLock(); RMW_ErrorFlag = True; _XmProcessUnlock(); return 0 ; /* unused */ } static Window ReadMotifWindow( Display *display ) { Atom motifWindowAtom; Atom type; int format; unsigned long lengthRtn; unsigned long bytesafter; Window *property = NULL; Window motifWindow = None; XErrorHandler old_Handler; /* Setup error proc and reset error flag */ old_Handler = XSetErrorHandler((XErrorHandler) RMW_ErrorHandler); _XmProcessLock(); RMW_ErrorFlag = False; _XmProcessUnlock(); motifWindowAtom = XInternAtom (display, XmI_MOTIF_DRAG_WINDOW, False); if ((XGetWindowProperty (display, RootWindow (display, 0), motifWindowAtom, 0L, MAXPROPLEN, False, AnyPropertyType, &type, &format, &lengthRtn, &bytesafter, (unsigned char **) &property) == Success) && (type == XA_WINDOW) && (format == 32) && (lengthRtn == 1)) { motifWindow = *property; } if (property) { XFree ((char *)property); } XSetErrorHandler(old_Handler); _XmProcessLock(); if (RMW_ErrorFlag) motifWindow = None; _XmProcessUnlock(); return (motifWindow); } /***************************************************************************** * * CreateMotifWindow () * * Creates a persistent window to hold the target list and atom pair * properties. This window is not visible on the screen. * ***************************************************************************/ static Window CreateMotifWindow( Display *display ) { Display *ndisplay; XSetWindowAttributes sAttributes; Window motifWindow; if ((ndisplay = XOpenDisplay(XDisplayString(display))) == NULL) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE3); return None; } XGrabServer(ndisplay); XSetCloseDownMode (ndisplay, RetainPermanent); sAttributes.override_redirect = True; sAttributes.event_mask = PropertyChangeMask; motifWindow = XCreateWindow (ndisplay, DefaultRootWindow (ndisplay), -100, -100, 10, 10, 0, 0, InputOnly, CopyFromParent, (CWOverrideRedirect |CWEventMask), &sAttributes); XMapWindow (ndisplay, motifWindow); WriteMotifWindow (ndisplay, &motifWindow); XCloseDisplay(ndisplay); return (motifWindow); } /***************************************************************************** * * WriteMotifWindow () * ***************************************************************************/ static void WriteMotifWindow( Display *display, Window *motifWindow ) { Atom motifWindowAtom; motifWindowAtom = XInternAtom (display, XmI_MOTIF_DRAG_WINDOW, False); XChangeProperty (display, RootWindow (display, 0), motifWindowAtom, XA_WINDOW, 32, PropModeReplace, (unsigned char *) motifWindow, 1); } /***************************************************************************** * * WriteAtomsTable () * ***************************************************************************/ static void WriteAtomsTable( Display *display, xmAtomsTable atomsTable ) { BYTE stackData[MAXSTACK]; struct _propertyRec { xmMotifAtomsPropertyRec info; xmMotifAtomsTableRec entry[1]; } *propertyRecPtr; Atom atomsTableAtom; int i; Window motifWindow; size_t dataSize; if (!atomsTable) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE4); return; } /* If the data is bigger than the default stack allocation, then * allocate heap storage, else use automatic storage. */ dataSize = sizeof(xmMotifAtomsPropertyRec) + atomsTable->numEntries * sizeof(xmMotifAtomsTableRec) ; if ( dataSize > MAXSTACK ) { propertyRecPtr = (struct _propertyRec *)XtMalloc( dataSize ); } else { propertyRecPtr = (struct _propertyRec *)stackData; } propertyRecPtr->info.byte_order = (BYTE) _XmByteOrderChar; propertyRecPtr->info.protocol_version = (BYTE) _MOTIF_DRAG_PROTOCOL_VERSION; propertyRecPtr->info.num_atoms = atomsTable->numEntries; propertyRecPtr->info.heap_offset = dataSize; /* write each entry's atom and time */ for (i = 0; i < atomsTable->numEntries; i++) { propertyRecPtr->entry[i].atom = atomsTable->entries[i].atom; propertyRecPtr->entry[i].time = atomsTable->entries[i].time; } /* * Write the buffer to the property within a protected section. */ atomsTableAtom = XInternAtom (display, XmI_MOTIF_DRAG_ATOMS, False); motifWindow = GetMotifWindow (display); _XmProcessLock(); StartProtectedSection (display, motifWindow); XChangeProperty (display, motifWindow, atomsTableAtom, atomsTableAtom, 8, PropModeReplace, (unsigned char *)propertyRecPtr, dataSize ); /* If we had to use a heap buffer, free it. */ if (propertyRecPtr != (struct _propertyRec *)stackData) { XtFree((char *)propertyRecPtr); } EndProtectedSection (display); if (bad_window) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE1); } _XmProcessUnlock(); } /***************************************************************************** * * ReadAtomsTable () * ***************************************************************************/ static Boolean ReadAtomsTable( Display *display, xmAtomsTable atomsTable ) { struct { xmMotifAtomsPropertyRec info; xmMotifAtomsTableRec entry[1]; } *propertyRecPtr = NULL; Atom atomsTableAtom; int format; unsigned long bytesafter, lengthRtn; Atom type; int i; Boolean ret; Window motifWindow; atomsTableAtom = XInternAtom (display, XmI_MOTIF_DRAG_ATOMS, False); motifWindow = GetMotifWindow (display); _XmProcessLock(); StartProtectedSection (display, motifWindow); ret = ((XGetWindowProperty (display, /* display* */ motifWindow, /* window */ atomsTableAtom, /* property atom */ 0L, MAXPROPLEN, /* long_offset, long_length */ False, /* delete flag */ atomsTableAtom, /* property type */ &type, /* returned actual type */ &format, /* returned actual format */ &lengthRtn, /* returned item count */ &bytesafter, /* returned bytes remaining */ (unsigned char **) &propertyRecPtr) /* returned data */ == Success) && (lengthRtn >= sizeof(xmMotifAtomsPropertyRec))); EndProtectedSection (display); if (bad_window) { static Boolean first_time = True; /* * Try to recreate the motifWindow. We could have gotten an invalid * window id from the _MOTIF_DRAG_WINDOW property. */ if (first_time) { motifWindow = CreateMotifWindow (display); SetMotifWindow (display, motifWindow); first_time = False; } else XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE1); ret = False; } _XmProcessUnlock(); if (ret) { if (propertyRecPtr->info.protocol_version != _MOTIF_DRAG_PROTOCOL_VERSION) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE2); } if (propertyRecPtr->info.byte_order != _XmByteOrderChar) { swap2bytes(propertyRecPtr->info.num_atoms); swap4bytes(propertyRecPtr->info.heap_offset); } if (atomsTable == NULL) { atomsTable = (xmAtomsTable) XtMalloc(sizeof(xmAtomsTableRec)); atomsTable->numEntries = 0; atomsTable->entries = NULL; SetAtomsTable (display, atomsTable); } if (propertyRecPtr->info.num_atoms > atomsTable->numEntries) { /* * expand the atoms table */ atomsTable->entries = (xmAtomsTableEntry) XtRealloc( (char *)atomsTable->entries, /* NULL ok */ sizeof(xmAtomsTableEntryRec) * propertyRecPtr->info.num_atoms); } /* * Read the atom table entries. */ for (i = 0; i < (int)propertyRecPtr->info.num_atoms; i++) { if (propertyRecPtr->info.byte_order != _XmByteOrderChar) { swap4bytes(propertyRecPtr->entry[i].atom); swap4bytes(propertyRecPtr->entry[i].time); } atomsTable->entries[i].atom = (Atom) propertyRecPtr->entry[i].atom; atomsTable->entries[i].time = (Time) propertyRecPtr->entry[i].time; } atomsTable->numEntries = propertyRecPtr->info.num_atoms; } /* * Free any memory that Xlib passed us. */ if (propertyRecPtr) { XFree((char *)propertyRecPtr); } return (ret); } /***************************************************************************** * * WriteTargetsTable () * ***************************************************************************/ static void WriteTargetsTable( Display *display, xmTargetsTable targetsTable ) { BYTE stackData[MAXSTACK], *fill; struct _propertyRec { xmMotifTargetsPropertyRec info; } *propertyRecPtr; Atom targetsTableAtom; int i, j; Window motifWindow; size_t dataSize; CARD16Item shortItem; CARD32Item longItem; if (!targetsTable) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE5); return; } /* Calculate the total size of the property. */ dataSize = sizeof(xmMotifTargetsPropertyRec); for (i = 0; i < targetsTable->numEntries; i++) { dataSize += targetsTable->entries[i].numTargets * 4 + 2; } /* If size needed is bigger than the pre-allocated space, allocate a * bigger buffer. */ if ( dataSize > MAXSTACK ){ propertyRecPtr = (struct _propertyRec *)XtMalloc( dataSize ); } else { propertyRecPtr = (struct _propertyRec *)stackData ; } propertyRecPtr->info.byte_order = (BYTE) _XmByteOrderChar; propertyRecPtr->info.protocol_version = (BYTE) _MOTIF_DRAG_PROTOCOL_VERSION; propertyRecPtr->info.num_target_lists = targetsTable->numEntries; propertyRecPtr->info.heap_offset = dataSize; /* write each target list's count and atoms */ fill = (BYTE *)propertyRecPtr + sizeof(xmMotifTargetsPropertyRec); for (i = 0; i < targetsTable->numEntries; i++) { shortItem.value = targetsTable->entries[i].numTargets; memcpy( fill, &shortItem, 2 ); fill += 2; /* * Write each Atom out one at a time as a CARD32. */ for (j = 0; j < targetsTable->entries[i].numTargets; j++) { longItem.value = targetsTable->entries[i].targets[j]; memcpy( fill, &longItem, 4 ); fill += 4; } } /* * Write the buffer to the property within a protected section. */ targetsTableAtom = XInternAtom (display, XmI_MOTIF_DRAG_TARGETS, False); motifWindow = GetMotifWindow (display); _XmProcessLock(); StartProtectedSection (display, motifWindow); XChangeProperty (display, motifWindow, targetsTableAtom, targetsTableAtom, 8, PropModeReplace, (unsigned char *)propertyRecPtr, dataSize); /* If a buffer was allocated, free it. */ if (propertyRecPtr != (struct _propertyRec *)stackData) { XtFree((char *)propertyRecPtr); } EndProtectedSection (display); if (bad_window) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE1); } _XmProcessUnlock(); } /***************************************************************************** * * ReadTargetsTable () * ***************************************************************************/ static Boolean ReadTargetsTable( Display *display, xmTargetsTable targetsTable ) { struct _propertyRec { xmMotifTargetsPropertyRec info; } *propertyRecPtr = NULL; char *bufptr; short num_targets; Atom targetsTableAtom; int format; unsigned long bytesafter, lengthRtn; Atom type; int i, j; Atom *targets; Boolean ret; Window motifWindow; CARD16Item shortItem; CARD32Item longItem; targetsTableAtom = XInternAtom (display, XmI_MOTIF_DRAG_TARGETS, False); motifWindow = GetMotifWindow (display); _XmProcessLock(); StartProtectedSection (display, motifWindow); ret = ((XGetWindowProperty (display, motifWindow, targetsTableAtom, 0L, MAXPROPLEN, False, targetsTableAtom, &type, &format, &lengthRtn, &bytesafter, (unsigned char **) &propertyRecPtr) == Success) && (lengthRtn >= sizeof(xmMotifTargetsPropertyRec))); EndProtectedSection (display); if (bad_window) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE1); ret = False; } _XmProcessUnlock(); if (ret) { if (propertyRecPtr->info.protocol_version != _MOTIF_DRAG_PROTOCOL_VERSION) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE2); } if (propertyRecPtr->info.byte_order != _XmByteOrderChar) { swap2bytes(propertyRecPtr->info.num_target_lists); swap4bytes(propertyRecPtr->info.heap_offset); } if (targetsTable == NULL) { targetsTable = (xmTargetsTable)XtMalloc(sizeof(xmTargetsTableRec)); targetsTable->numEntries = 0; targetsTable->entries = NULL; SetTargetsTable (display, targetsTable); } if (propertyRecPtr->info.num_target_lists > targetsTable->numEntries) { /* * expand the target table */ targetsTable->entries = (xmTargetsTableEntry) XtRealloc( (char *)targetsTable->entries, /* NULL ok */ sizeof(xmTargetsTableEntryRec) * propertyRecPtr->info.num_target_lists); /* * read the new entries */ bufptr = (char *)propertyRecPtr + sizeof(xmMotifTargetsPropertyRec); for (i = 0; i < targetsTable->numEntries; i++) { memcpy( &shortItem, bufptr, 2 ); if (propertyRecPtr->info.byte_order != _XmByteOrderChar) { swap2bytes(shortItem.value); } num_targets = shortItem.value; bufptr += 2 + 4 * num_targets; if (num_targets != targetsTable->entries[i].numTargets) { XmeWarning( (Widget) XmGetXmDisplay (display), MESSAGE6); } } for (; i < (int)propertyRecPtr->info.num_target_lists; i++) { memcpy( &shortItem, bufptr, 2 ); bufptr += 2; if (propertyRecPtr->info.byte_order != _XmByteOrderChar) { swap2bytes(shortItem.value); } num_targets = shortItem.value; if(!num_targets) targets = NULL; else targets = (Atom *) XtMalloc(sizeof(Atom) * num_targets); /* * Read each Atom in one at a time. */ for (j = 0; j < num_targets; j++) { memcpy( &longItem, bufptr, 4 ); bufptr += 4; if (propertyRecPtr->info.byte_order != _XmByteOrderChar) { swap4bytes(longItem.value); } targets[j] = (Atom) longItem.value ; } targetsTable->numEntries++; targetsTable->entries[i].numTargets = num_targets; targetsTable->entries[i].targets = targets; } } } /* * Free any memory that Xlib passed us. */ if (propertyRecPtr) { XFree((char *)propertyRecPtr); } return (ret); } /***************************************************************************** * * CreateDefaultTargetsTable () * * Create the default targets table. ***************************************************************************/ static Atom nullTargets[] = { 0, }; static Atom stringTargets[] = { XA_STRING, }; static xmTargetsTable CreateDefaultTargetsTable( Display *display ) { xmTargetsTable targetsTable; Cardinal size; targetsTable = (xmTargetsTable) XtMalloc(sizeof(xmTargetsTableRec)); targetsTable->numEntries = 2; targetsTable->entries = (xmTargetsTableEntry) XtMalloc(sizeof(xmTargetsTableEntryRec) * 2); /* According to specs and man pages, default values of XmNimportTargets * and XmNnumImportTargets should be NULL and zero respectively. The * corresponding record in default targets table is entries[0]. The original * setting of entries[0] (commented out below) was resulting in to default * values of non NULL pointer pointing to target list with NULL entry and * 1 for XmNimportTargets and XmNnumImportTargets respectively. * * The changed code set the XmNnumImportTargets to 0 and XmNimportTargets to * NULL. This change may cause problem in code where importTarget * is dereferanced twice without checking for possible NULL value. It that * happens, and there is no easy way to fix it, change entries[0].targets to * nullTargets, but leave entries[0].numTargets to 0. */ #if 0 targetsTable->entries[0].numTargets = XtNumber(nullTargets); size = sizeof(Atom) * targetsTable->entries[0].numTargets; targetsTable->entries[0].targets = (Atom*) XtMalloc(size); memcpy(targetsTable->entries[0].targets, nullTargets, size); #endif targetsTable->entries[0].numTargets = _XmDefaultNumImportTargets; targetsTable->entries[0].targets = (Atom*) _XmDefaultImportTargets; targetsTable->entries[1].numTargets = XtNumber(stringTargets); size = sizeof(Atom) * targetsTable->entries[1].numTargets; targetsTable->entries[1].targets = (Atom*) XtMalloc(size); memcpy(targetsTable->entries[1].targets, stringTargets, size); SetTargetsTable (display, targetsTable); return (targetsTable); } /***************************************************************************** * * CreateDefaultAtomsTable () * * Create the default atoms table. ***************************************************************************/ static xmAtomsTable CreateDefaultAtomsTable( Display *display ) { xmAtomsTable atomsTable; atomsTable = (xmAtomsTable) XtMalloc(sizeof(xmAtomsTableRec)); atomsTable->numEntries = 1; atomsTable->entries = (xmAtomsTableEntry) XtMalloc(sizeof(xmAtomsTableEntryRec)); atomsTable->entries[0].atom = XInternAtom (display, XmS_MOTIF_ATOM_0, False); atomsTable->entries[0].time = 0; SetAtomsTable (display, atomsTable); return (atomsTable); } /***************************************************************************** * * _XmInitTargetsTable () * ***************************************************************************/ void _XmInitTargetsTable( Display *display ) { Window motifWindow; Boolean grabbed = False; /* * Read the motifWindow property on the root. If the property is not * there, create a persistant motifWindow and put it on the property. * Reading the atom pair, atoms table, and targets table properties * on motifWindow is delayed so they can be saved in contexts indexed * by the original display. */ if ((motifWindow = ReadMotifWindow (display)) == None) { motifWindow = CreateMotifWindow (display); } SetMotifWindow (display, motifWindow); /* * At this time, we are not sure the motifWindow id is valid, * but we will find out in the ReadAtomsTable. We will try to * recreate it there. */ if (!ReadAtomsTable (display, GetAtomsTable (display))) { XGrabServer(display); grabbed = True; if (!ReadAtomsTable (display, GetAtomsTable (display))) { WriteAtomsTable (display, CreateDefaultAtomsTable (display)); } } if (!ReadTargetsTable (display, GetTargetsTable (display))) { if (!grabbed) { XGrabServer(display); grabbed = True; if (!ReadTargetsTable (display, GetTargetsTable (display))) { WriteTargetsTable (display, CreateDefaultTargetsTable (display)); } } else { WriteTargetsTable (display, CreateDefaultTargetsTable (display)); } } if (grabbed) { XUngrabServer (display); XFlush (display); } } void _XmClearDisplayTables (Display *display) { SetAtomsTable(display,NULL); SetTargetsTable(display,NULL); } /***************************************************************************** * * _XmIndexToTargets () * ***************************************************************************/ Cardinal _XmIndexToTargets( Widget shell, Cardinal t_index, Atom **targetsRtn ) { Display *display = XtDisplay (shell); xmTargetsTable targetsTable; if (!(targetsTable = GetTargetsTable (display))) { _XmInitTargetsTable (display); targetsTable = GetTargetsTable (display); } if (t_index >= targetsTable->numEntries) { /* * Retrieve the targets table from motifWindow. * If this fails, then either the motifWindow or the targets table * property on motifWindow has been destroyed, so reinitialize. */ if (!ReadTargetsTable (display, targetsTable)) { _XmInitTargetsTable (display); targetsTable = GetTargetsTable (display); } } if (t_index >= targetsTable->numEntries) { XmeWarning ((Widget) XmGetXmDisplay (display), MESSAGE7); *targetsRtn = NULL; return 0; } *targetsRtn = targetsTable->entries[t_index].targets; return targetsTable->entries[t_index].numTargets; } /***************************************************************************** * * _XmAtomCompare () * * The routine must return an integer less than, equal to, or greater than * 0 according as the first argument is to be considered less * than, equal to, or greater than the second. ***************************************************************************/ static int AtomCompare( XmConst void *atom1, XmConst void *atom2 ) { return (*((Atom *) atom1) - *((Atom *) atom2)); } /***************************************************************************** * * _XmTargetsToIndex () * ***************************************************************************/ Cardinal _XmTargetsToIndex( Widget shell, Atom *targets, Cardinal numTargets ) { Display *display = XtDisplay (shell); Cardinal i, j; Cardinal size; Cardinal oldNumEntries; Atom *newTargets; xmTargetsTable targetsTable; if(!numTargets) return 0; _XmProcessLock(); if (!(targetsTable = GetTargetsTable (display))) { _XmInitTargetsTable (display); targetsTable = GetTargetsTable (display); } /* * Create a new targets list, sorted in ascending order. */ size = sizeof(Atom) * numTargets; newTargets = (Atom *) XtMalloc(size); memcpy (newTargets, targets, size); qsort ((void *)newTargets, (size_t)numTargets, (size_t)sizeof(Atom), AtomCompare); /* * Try to find the targets list in the targets table. */ for (i = 0; i < targetsTable->numEntries; i++) { if (numTargets == targetsTable->entries[i].numTargets) { for (j = 0; j < numTargets; j++) { if (newTargets[j] != targetsTable->entries[i].targets[j]) { break; } } if (j == numTargets) { XtFree ((char *)newTargets); _XmProcessUnlock(); return i; } } } oldNumEntries = targetsTable->numEntries; /* * Lock and retrieve the target table from motifWindow. * If this fails, then either the motifWindow or the targets table * property on motifWindow has been destroyed, so reinitialize. * If the target list is still not in the table, add the target list * to the table and write the table out to its property. */ XGrabServer (display); if (!ReadTargetsTable (display, targetsTable)) { XUngrabServer (display); _XmInitTargetsTable (display); XGrabServer (display); targetsTable = GetTargetsTable (display); } for (i = oldNumEntries; i < targetsTable->numEntries; i++) { if (numTargets == targetsTable->entries[i].numTargets) { for (j = 0; j < numTargets; j++) { if (newTargets[j] != targetsTable->entries[i].targets[j]) { break; } } if (j == numTargets) { XtFree ((char *)newTargets); break; } } } if (i == targetsTable->numEntries) { targetsTable->numEntries++; targetsTable->entries = (xmTargetsTableEntry) XtRealloc( (char *)targetsTable->entries, /* NULL ok */ sizeof(xmTargetsTableEntryRec) * (targetsTable->numEntries)); targetsTable->entries[i].numTargets = numTargets; targetsTable->entries[i].targets = newTargets; WriteTargetsTable (display, targetsTable); } XUngrabServer (display); XFlush (display); _XmProcessUnlock(); return i; } /***************************************************************************** * * _XmAllocMotifAtom () * * Allocate an atom in the atoms table with the specified time stamp. ***************************************************************************/ Atom _XmAllocMotifAtom( Widget shell, Time time ) { Display *display = XtDisplay (shell); xmAtomsTable atomsTable; xmAtomsTableEntry p; Cardinal i; char atomname[80]; Atom atomReturn = None; if (!(atomsTable = GetAtomsTable (display))) { _XmInitTargetsTable (display); atomsTable = GetAtomsTable (display); } /* * Lock and retrieve the atoms table from motifWindow. * If this fails, then either the motifWindow or the atoms table * property on motifWindow has been destroyed, so reinitialize. * Try to find an available atom in the table (time == 0). * If no atom is available, add an atom to the table. * Write the atoms table out to its property. */ XGrabServer (display); if (!ReadAtomsTable (display, atomsTable)) { XUngrabServer (display); _XmInitTargetsTable (display); XGrabServer (display); atomsTable = GetAtomsTable (display); } for (p = atomsTable->entries, i = atomsTable->numEntries; i; p++, i--) { if ((p->time) == 0) { p->time = time; atomReturn = p->atom; break; } } if (atomReturn == None) { i = atomsTable->numEntries++; atomsTable->entries = (xmAtomsTableEntry) XtRealloc( (char *)atomsTable->entries, /* NULL ok */ (atomsTable->numEntries * sizeof(xmAtomsTableEntryRec))); sprintf(atomname, "%s%d", "_MOTIF_ATOM_", i); atomsTable->entries[i].atom = XInternAtom (display, atomname, False); atomsTable->entries[i].time = time; atomReturn = atomsTable->entries[i].atom; } WriteAtomsTable (display, atomsTable); XUngrabServer (display); XFlush (display); return (atomReturn); } /***************************************************************************** * * _XmGetMotifAtom () * * Get the atom from the atoms table with nonzero timestamp less than but * closest to the specified value. ***************************************************************************/ Atom _XmGetMotifAtom( Widget shell, Time time ) { Display *display = XtDisplay (shell); xmAtomsTable atomsTable; Cardinal i; Atom atomReturn = None; Time c_time; /* * Get the atoms table saved in the display's context. * This table will be updated from the motifWindow property. */ if (!(atomsTable = GetAtomsTable (display))) { _XmInitTargetsTable (display); atomsTable = GetAtomsTable (display); } /* * Lock and retrieve the atoms table from motifWindow. * If this fails, then either the motifWindow or the atoms table * property on motifWindow has been destroyed, so reinitialize. * Try to find the atom with nonzero timestamp less than but closest * to the specified value. */ XGrabServer (display); if (!ReadAtomsTable (display, atomsTable)) { XUngrabServer (display); _XmInitTargetsTable (display); XGrabServer (display); atomsTable = GetAtomsTable (display); } for (i = 0; i < atomsTable->numEntries; i++) { if ((atomsTable->entries[i].time) && (atomsTable->entries[i].time <= time)) { break; } } if (i < atomsTable->numEntries) { atomReturn = atomsTable->entries[i].atom; c_time = atomsTable->entries[i++].time; for (; i < atomsTable->numEntries; i++) { if ((atomsTable->entries[i].time > c_time) && (atomsTable->entries[i].time < time)) { atomReturn = atomsTable->entries[i].atom; c_time = atomsTable->entries[i].time; } } } XUngrabServer (display); XFlush (display); return (atomReturn); } /***************************************************************************** * * _XmFreeMotifAtom () * * Free an atom in the atoms table by giving it a zero timestamp. ***************************************************************************/ void _XmFreeMotifAtom( Widget shell, Atom atom ) { Display *display = XtDisplay (shell); xmAtomsTable atomsTable; xmAtomsTableEntry p; Cardinal i; if (atom == None) { return; } /* * Get the atoms table saved in the display's context. * This table will be updated from the motifWindow property. */ if (!(atomsTable = GetAtomsTable (display))) { _XmInitTargetsTable (display); atomsTable = GetAtomsTable (display); } /* * Lock and retrieve the atoms table from its property. * If this fails, then either the motifWindow or the atoms table * property on motifWindow has been destroyed, so reinitialize. * Free the matched atom, if present, and write the atoms table out * to its property. */ XGrabServer (display); if (!ReadAtomsTable (display, atomsTable)) { XUngrabServer (display); _XmInitTargetsTable (display); XGrabServer (display); atomsTable = GetAtomsTable (display); } for (p = atomsTable->entries, i = atomsTable->numEntries; i; p++, i--) { if (p->atom == atom) { p->time = (Time) 0; WriteAtomsTable (display, atomsTable); break; } } XUngrabServer (display); XFlush (display); } /***************************************************************************** * * _XmDestroyMotifWindow () * ***************************************************************************/ void _XmDestroyMotifWindow( Display *display ) { Window motifWindow; Atom motifWindowAtom; if ((motifWindow = ReadMotifWindow (display)) != None) { motifWindowAtom = XInternAtom (display, XmI_MOTIF_DRAG_WINDOW, False); XDeleteProperty (display, DefaultRootWindow (display), motifWindowAtom); XDestroyWindow (display, motifWindow); } } /***************************************************************************** * * _XmGetDragProxyWindow () * ***************************************************************************/ Window _XmGetDragProxyWindow( Display *display ) { Atom motifProxyWindowAtom; Atom type; int format; unsigned long lengthRtn; unsigned long bytesafter; Window *property = NULL; Window motifWindow; Window motifProxyWindow = None; if ((motifWindow = ReadMotifWindow (display)) != None) { motifProxyWindowAtom = XInternAtom (display, XmI_MOTIF_DRAG_PROXY_WINDOW, False); _XmProcessLock(); StartProtectedSection (display, motifWindow); if ((XGetWindowProperty (display, motifWindow, motifProxyWindowAtom, 0L, MAXPROPLEN, False, AnyPropertyType, &type, &format, &lengthRtn, &bytesafter, (unsigned char **) &property) == Success) && (type == XA_WINDOW) && (format == 32) && (lengthRtn == 1)) { motifProxyWindow = *property; } EndProtectedSection (display); _XmProcessUnlock(); if (property) { XFree ((char *)property); } } return (motifProxyWindow); } motif-2.3.8/lib/Xm/DropDown.c0000644000175000017500000023145113145162623012626 00000000000000#ifdef HAVE_CONFIG_H #include #endif #include #include #if defined(VMS) && !defined(__alpha) #define mbstowcs(a,b,n) XiMbstowcs(a,b,n) #endif #include #include #include "XmI.h" #include #include #include #include #include #include #include #include #include #include #include #define FIX_1371 #define FIX_1486 #define FIX_1170 #ifdef FIX_1486 #include "MenuShellI.h" #endif /* * NOTE: I use the same syntax for popup and popdown that Xt Uses. * so something is "up" if it is on the screen. With combo * boxes this can often be backwards of how the user thinks, * but it is all internal stuff anyway. * Note: most uses are now unposted (up) (doesn't appear) and posted (down) * (does appear) */ #ifndef XmNautoTraversal #define XmNautoTraversal "autoTraversal" #define XmCAutoTraversal "AutoTraversal" #endif #ifndef XmNactivateOnFill #define XmNactivateOnFill "activateOnFill" #define XmCActivateOnFill "ActivateOnFill" #endif #define XmTextFieldGetString(t) \ ( XmIsTextField(t) ? XmTextFieldGetString(t) : XmTextGetString(t) ) #define XmTextFieldSetString(t,s) \ ( XmIsTextField(t) ? XmTextFieldSetString(t,s) : XmTextSetString(t,s) ) #define XmTextFieldInsert(t,l,p) \ ( XmIsTextField(t) ? XmTextFieldInsert(t,l,p) : XmTextInsert(t,l,p) ) #define XmTextFieldSetInsertionPosition(t,p) \ ( XmIsTextField(t) ? XmTextFieldSetInsertionPosition(t,p) \ : XmTextSetInsertionPosition(t,p) ) /* From GrabShell.c */ #define Events (EnterWindowMask | LeaveWindowMask | ButtonPressMask | \ ButtonReleaseMask) static void TextButtonPress(Widget, XtPointer, XEvent *, Boolean *); static char combo_translations[] = "#override \n\ Ctrl osfDown: XiComboListPost()\n\ Ctrl osfUp: XiComboListUnpost()\n\ Any osfCancel: XiComboListCancel()"; static void Resize(Widget), ChangeManaged(Widget), Destroy(Widget); static void Initialize(Widget, Widget, ArgList, Cardinal *); static void GetValuesHook(Widget, ArgList, Cardinal *); static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *); static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry*, XtWidgetGeometry*); static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *); static void ClassPartInitialize(WidgetClass); static void ClassInitialize(); static void ExposeMethod(Widget, XEvent*, Region); static Boolean ComboBoxParentProcess(Widget wid, XmParentProcessData event); /************************ * Actions and callbacks. ************************/ static void VerifyTextField(Widget, XtPointer, XtPointer); static void ModifyVerifyTextField(Widget, XtPointer, XtPointer); static void ValueChangedTextField(Widget, XtPointer, XtPointer); static void ListSelected(Widget, XtPointer, XtPointer); static void ComboUnpost(Widget, XEvent *, String *, Cardinal *); static void ComboPost(Widget, XEvent *, String *, Cardinal *); static void ComboCancel(Widget, XEvent *, String *, Cardinal *); static void SBBtnDownEH (Widget, XtPointer, XEvent *, Boolean *); static void SBBtnUpEH (Widget, XtPointer, XEvent *, Boolean *); /********************* * Internal Routines. *********************/ static XmDropDownWidget FindComboBox(Widget); static void PopdownList(Widget); static void LoseFocusHandler(Widget, XtPointer, XEvent *, Boolean *); static void RegisterShellHandler(Widget); static void CreateChildren(Widget, ArgList, Cardinal); static void CreatePopup(Widget, ArgList, Cardinal); static void PlaceChildren(Widget, Boolean, Widget); static void FindDesiredSize(Widget, Widget, Dimension *, Dimension *, XtWidgetGeometry *, XtWidgetGeometry *, XtWidgetGeometry *); static void GetTextAndLabelWidth(Widget, Dimension, Dimension, Dimension, Dimension, Dimension *, Dimension *); static Boolean SetListFromText(Widget, Boolean), SetTextFromList(Widget); static Boolean PopupList(Widget); /************************************************************ * STATIC DECLARATIONS *************************************************************/ static XtActionsRec actions[] = { { "XiComboListDown", ComboPost }, { "XiComboListPost", ComboPost }, { "XiComboListUp", ComboUnpost }, { "XiComboListUnpost", ComboUnpost }, { "XiComboListCancel", ComboCancel }, }; static XtResource resources[] = { { XmNhorizontalMargin, XmCMargin, XmRHorizontalDimension, sizeof(Dimension), XtOffsetOf(XmDropDownRec, combo.h_space), XmRImmediate, (XtPointer) 2 }, { XmNverticalMargin, XmCMargin, XmRVerticalDimension, sizeof(Dimension), XtOffsetOf(XmDropDownRec, combo.v_space), XmRImmediate, (XtPointer) 2 }, { XmNverify, XmCVerify, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDropDownRec, combo.verify), XmRImmediate, (XtPointer) True }, { XmNeditable, XmCEditable, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDropDownRec, combo.editable), XmRImmediate, (XtPointer) True }, { XmNcustomizedCombinationBox, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDropDownRec, combo.customized_combo_box), XmRImmediate, (XtPointer) False }, { XmNverifyTextCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDropDownRec, combo.verify_text_callback), XmRImmediate, (XtPointer) NULL }, { XmNupdateTextCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDropDownRec, combo.update_text_callback), XmRImmediate, (XtPointer) NULL }, { XmNupdateShellCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDropDownRec, combo.update_shell_callback), XmRImmediate, (XtPointer) NULL }, { XmNpopupShellWidget, XmCWidget, XmRWidget, sizeof(Widget), XtOffsetOf(XmDropDownRec, combo.popup_shell), XmRImmediate, (XtPointer) NULL }, { XmNshowLabel, XmCBoolean, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDropDownRec, combo.show_label), XmRImmediate, (XtPointer) True }, { XmNpopupOffset, XmCPopupOffset, XmRInt, sizeof(int), XtOffsetOf(XmDropDownRec, combo.popup_offset), XmRImmediate, (XtPointer) 15 }, { XmNpopupCursor, XmCCursor, XmRCursor, sizeof(Cursor), XtOffsetOf(XmDropDownRec, combo.popup_cursor), XmRString, (XtPointer) "left_ptr" }, { XmNuseTextField, XmCUseTextField, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDropDownRec, combo.use_text_field), XmRImmediate, (XtPointer) True }, { XmNcomboTranslations, XmCTranslations, XmRTranslationTable, sizeof(XtTranslations), XtOffsetOf(XmDropDownRec, combo.translations), XmRString, (XtPointer) combo_translations }, { XmNvisibleItemCount, XmCVisibleItemCount, XmRInt, sizeof(int), XtOffsetOf(XmDropDownRec, combo.visible_items), XmRImmediate, (XtPointer) 5 }, { XmNnewVisualStyle, XmCNewVisualStyle, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDropDownRec, combo.new_visual_style), XmRImmediate, (XtPointer)True }, { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf(XmManagerRec, manager.shadow_thickness), XmRImmediate, (XtPointer) 2 }, /* intentionally undocumented feature used by other ICS widgets */ { XmNverifyTextFailedCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(XmDropDownRec, combo.verify_text_failed_callback), XmRImmediate, (XtPointer) NULL }, #ifdef XmNautoTraversal { XmNautoTraversal, XmCAutoTraversal, XmRBoolean, sizeof(Boolean), XtOffsetOf(XmDropDownRec, combo.autoTraversal), XmRImmediate, (XtPointer) True }, #endif #ifdef XmNactivateOnFill { XmNactivateOnFill, XmCActivateOnFill, XmRInt, sizeof(int), XtOffsetOf(XmDropDownRec, combo.activateOnFill), XmRImmediate, (XtPointer) 0 }, #endif }; static XmSyntheticResource get_resources[] = { { XmNhorizontalMargin, sizeof(Dimension), XtOffsetOf(XmDropDownRec, combo.h_space), XmeFromHorizontalPixels, (XmImportProc) XmeToHorizontalPixels }, { XmNverticalMargin, sizeof(Dimension), XtOffsetOf(XmDropDownRec, combo.v_space), XmeFromVerticalPixels, (XmImportProc) XmeToVerticalPixels }, }; #undef offset XmDropDownClassRec xmDropDownClassRec = { { /* core fields */ /* superclass */ (WidgetClass)&xmManagerClassRec, /* class_name */ "XmDropDown", /* widget_size */ sizeof(XmDropDownRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actions, /* num_actions */ XtNumber(actions), /* resources */ (XtResource*)resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ ExposeMethod, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ GetValuesHook, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ (XtGeometryHandler) QueryGeometry, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* composite_class fields */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class fields */ /* resource list */ NULL, /* num resources */ 0, /* constraint size */ 0, /* destroy proc */ NULL, /* init proc */ NULL, /* set values proc */ NULL, /* extension */ NULL, }, { /* manager_class fields */ /* default translations */ XtInheritTranslations, /* syn_resources */ get_resources, /* num_syn_resources */ XtNumber(get_resources), /* syn_cont_resources */ NULL, /* num_syn_cont_resources */ 0, /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* Combination Box fields */ NULL /* extension */ } }; WidgetClass xmDropDownWidgetClass = (WidgetClass)&xmDropDownClassRec; /************************************************************ * STATIC CODE *************************************************************/ #if defined(VAX) && defined(VMS) static char * OsiStrncpy( char *s1, char *s2, int len ); static size_t XiMbstowcs(wchar_t* wcs, char* mbs, size_t n) { if (wcs) { memset((char*)wcs, 0, n); OsiStrncpy((char*)wcs, mbs, n); return((size_t) strlen((char*) wcs)); } else { return (0); } } /* Function: * OsiStrncpy(s1, s2, len) * Description: * strncpy() with check for NULL strings * Input: * s1 - char * : copy to here * s2 - char * : copy from here * len - int : bytes to copy * * Output: * s1 */ static char * OsiStrncpy( char *s1, char *s2, int len ) { if (s2 == NULL) s2 = ""; if (s1 == NULL) return(NULL); return(strncpy(s1,s2,len)); } #endif /* Function Name: ClassInitialize * Description: class_initialize method for XmDropDown * Arguments: none * Returns: nothing */ static void ClassInitialize() { /* do nothing */ } /* Function Name: ClassPartInitialize * Description: class_part_initialize method for XmDropDown * Arguments: w_class - the widget class. * Returns: nothing */ /*ARGSUSED*/ static void ClassPartInitialize(WidgetClass w_class) { _XmFastSubclassInit (w_class, XmDROP_DOWN_BIT); } /* Function Name: Initialize * Description: Called to initialize information specific * to this widget. * Arguments: req - what was originally requested. * set - what will be created (our superclassed have * already mucked with this) * args, num_args - The arguments passed to * the creation call. * Returns: none. */ /*ARGSUSED*/ static void Initialize(Widget req, Widget set, ArgList args, Cardinal * num_args) { XmDropDownWidget cbw = (XmDropDownWidget) set; ArgList f_args; Cardinal f_num_args; Dimension desired_height, desired_width; XmDropDown_list_state(cbw) = XmDropDown_POSTED; XmDropDown_old_text(cbw) = NULL; XmDropDown_doActivate(cbw) = False; XmDropDown_inValueChanged(cbw) = False; cbw->combo.hsb = NULL; cbw->combo.vsb = NULL; _XmFilterArgs(args, *num_args, xm_std_filter, &f_args, &f_num_args); CreateChildren(set, f_args, f_num_args); if (!XmDropDown_customized_combo_box(cbw)) CreatePopup(set, f_args, f_num_args); RegisterShellHandler(set); if (!XmDropDown_editable(cbw)) { VerifyTextField(NULL, (XtPointer) cbw, (XtPointer) NULL); XtAddEventHandler(XmDropDown_text(cbw), ButtonPressMask, False, TextButtonPress, NULL); } /* * Override the bad things that XmManager is doing to me. */ if ((req->core.height == 0) || (req->core.width == 0)) { XtWidgetGeometry arrow_geom, text_geom, label_geom; FindDesiredSize(set, NULL, &desired_width, &desired_height, &label_geom, &text_geom, &arrow_geom); } if (req->core.height == 0) set->core.height = desired_height; else set->core.height = req->core.height; if (req->core.width == 0) set->core.width = desired_width; else set->core.width = req->core.width; XtFree((char *) f_args); } /* Function Name: Resize * Description: Called when this widget has been resized. * Arguments: w - Extended List Widget to realize. * Returns: none. */ static void Resize(Widget w) { if (XtIsRealized(w)) XClearWindow(XtDisplay(w), XtWindow(w)); PlaceChildren(w, False, NULL); } /*ARGSUSED*/ static void GetValuesHook(Widget w, ArgList args, Cardinal *num_args) { XmDropDownWidget cbw = (XmDropDownWidget) w; XrmQuark visible_quark; int i; visible_quark = XrmStringToQuark(XmNvisibleItemCount); for (i = 0; i < ((int) *num_args); i++) { if (visible_quark == XrmStringToQuark(args[i].name)) { XtVaGetValues(XmDropDown_list(cbw), args[i].name, args[i].value, NULL); break; } } } /* Function Name: SetValues * Description: Called when some widget data needs to be modified on- * the-fly. * Arguments: current - the current (old) widget values. * request - before superclassed have changed things. * set - what will acutally be the new values. * args, num_args - the arguments in the list. * Returns: none */ /*ARGSUSED*/ static Boolean SetValues(Widget current, Widget request, Widget set, ArgList args, Cardinal * num_args) { Boolean place_children = False; XmDropDownWidget old_cbw = (XmDropDownWidget) current, set_cbw = (XmDropDownWidget) set; ArgList f_args; Cardinal f_num_args; Boolean retval = False; /* * Pass filtered setvalues requests down to children. */ _XmFilterArgs(args, *num_args, xm_std_filter, &f_args, &f_num_args); if( !XmDropDown_customized_combo_box(set_cbw) ) { /* * It is possible that the new combo box does not have a list * associated with it because if the old value for the * resource "XmNcustomizedCombinationBox" is True. If this is * the case then we need to build a popup list for the new * combo box. */ if( XmDropDown_customized_combo_box(old_cbw) && !XmDropDown_popup_shell(set_cbw) ) { /* * It turns out that we need to create a new popup list * for this widget so lets go ahead and do it. */ CreatePopup (set, f_args, f_num_args); } XtSetValues(XmDropDown_list(set_cbw), f_args, f_num_args); } /* make it Create/Get only */ if( XmDropDown_use_text_field(set_cbw) != XmDropDown_use_text_field(old_cbw) ) XmDropDown_use_text_field(set_cbw) = XmDropDown_use_text_field(old_cbw); _XmSetValuesOnChildren(set, f_args, f_num_args); if (XmDropDown_editable(set_cbw) != XmDropDown_editable(old_cbw)){ if (!XmDropDown_editable(set_cbw)) XtAddEventHandler(XmDropDown_text(set_cbw), ButtonPressMask, False, TextButtonPress, NULL); else XtRemoveEventHandler(XmDropDown_text(set_cbw), ButtonPressMask, False, TextButtonPress, NULL); } if ((XmDropDown_h_space(set_cbw) != XmDropDown_h_space(old_cbw)) || (XmDropDown_v_space(set_cbw) != XmDropDown_v_space(old_cbw))) { place_children = True; } if (XmDropDown_popup_shell(set_cbw) != XmDropDown_popup_shell(old_cbw)) { if (!XmDropDown_customized_combo_box(old_cbw)) { /* * Non custom box, I created it, so I should destroy it. */ XtDestroyWidget(XmDropDown_popup_shell(old_cbw)); } RegisterShellHandler(set); } /* note! the following causes a size change in the XmDropDown. It ** could be possible to redefine the visuals so that this isn't the case, ** though. As is, the effect is that the widget changes size when the ** resource changes. By itself, this isn't a problem -- it changes back ** when the resource is flipped the other way. But when used with a ** manager widget whose geometry management is the equivalent of ** XmRESIZE_GROW, the XmDropDown will not shrink back down in size. */ if (XmDropDown_new_visual_style(set_cbw) != XmDropDown_new_visual_style(old_cbw)) { Arg targs[4]; int tn = 0; if(XmDropDown_new_visual_style(set_cbw)) { /* ArrowB doesn't track this information itself; it draws ** itself minus its highlightThickness */ Dimension width, height; tn = 0; XtSetArg(targs[tn], XmNwidth, &width); tn++; XtSetArg(targs[tn], XmNheight, &height); tn++; XtGetValues(XmDropDown_arrow(set_cbw),targs,tn); tn = 0; XtSetArg(targs[tn], XmNwidth, width - 4); tn++; XtSetArg(targs[tn], XmNheight, height - 4); tn++; XtSetArg(targs[tn], XmNhighlightThickness, 0); tn++; XtSetValues(XmDropDown_arrow(set_cbw),targs,tn); tn = 0; XtSetArg(targs[tn], XmNhighlightThickness, 0); tn++; XtSetArg(targs[tn], XmNshadowThickness, 0); tn++; XtSetValues(XmDropDown_text(set_cbw),targs,tn); } else { Dimension width, height; tn = 0; XtSetArg(targs[tn], XmNwidth, &width); tn++; XtSetArg(targs[tn], XmNheight, &height); tn++; XtGetValues(XmDropDown_arrow(set_cbw),targs,tn); tn = 0; XtSetArg(targs[tn], XmNwidth, width + 4); tn++; XtSetArg(targs[tn], XmNheight, height + 4); tn++; XtSetArg(targs[tn], XmNhighlightThickness, 2); tn++; XtSetValues(XmDropDown_arrow(set_cbw),targs,tn); tn = 0; XtSetArg(targs[tn], XmNhighlightThickness, 2); tn++; XtSetArg(targs[tn], XmNshadowThickness, 2); tn++; XtSetValues(XmDropDown_text(set_cbw),targs,tn); } retval = True; /* for shadows */ } if (XmDropDown_show_label(set_cbw) != XmDropDown_show_label(old_cbw)) { retval = True; if (XmDropDown_show_label(old_cbw)) { XtUnmanageChild(XmDropDown_label(old_cbw)); } else { XtManageChild(XmDropDown_label(set_cbw)); } } XtFree((char *) f_args); #ifdef FIX_1170 if (XtIsSensitive((Widget)set_cbw) != XtIsSensitive((Widget)old_cbw)) { retval = True; } #endif if (place_children) { /* figure out the new geometry needed */ XtWidgetGeometry arrow_geom, text_geom, label_geom; FindDesiredSize(set, NULL, &(set->core.width), &(set->core.height), &label_geom, &text_geom, &arrow_geom); } /* Fix for CR03893, not resizing once the */ /* label width is modified */ Resize((Widget)set_cbw); return(retval); } /* Function Name: QueryGeometry * Description: Called when my parent wants to know what size * I would like to be. * Arguments: w - the widget to check. * indended - constriants imposed by the parent. * preferred - what I would like. * Returns: See Xt Manual. */ static XtGeometryResult QueryGeometry(Widget w,XtWidgetGeometry *intended, XtWidgetGeometry *preferred) { XtWidgetGeometry arrow_geom, text_geom, label_geom; FindDesiredSize(w, NULL, &(preferred->width), &(preferred->height), &label_geom, &text_geom, &arrow_geom); return(_XmHWQuery(w, intended, preferred)); } /* Function Name: Destroy * Description: Called when the widget dies. * Arguments: w - the widget. * Returns: none. */ static void Destroy(Widget w) { XmDropDownWidget cbw = (XmDropDownWidget) w; XtFree((char *) XmDropDown_old_text(cbw)); } /************************************************************ * * Semi - Public Routines for child management. * ************************************************************/ /* Function Name: GeometryManager * Description: handles requests from children for a size change. * Arguments: child - the child to change. * request - the geometry that the child wants. * return - what we will allow if this is an almost. * Returns: status. */ /*ARGSUSED*/ static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry * request, XtWidgetGeometry * result) { XmDropDownWidget cbw = (XmDropDownWidget) XtParent(w); Dimension c_width, c_height, old_width, old_height, r_width, r_height; XtGeometryResult ret_val; XtWidgetGeometry arrow_geom, text_geom, label_geom; Boolean w_req = request->request_mode & CWWidth; Boolean h_req = request->request_mode & CWHeight; if (!(w_req || h_req)) return(XtGeometryNo); old_width = w->core.width; old_height = w->core.height; if (w_req) w->core.width = request->width; if (h_req) w->core.height = request->height; FindDesiredSize((Widget) cbw, w, &c_width, &c_height, &label_geom, &text_geom, &arrow_geom); _XmRequestNewSize((Widget) cbw, True, c_width, c_height, &r_width, &r_height); if (c_height == r_height) { Dimension arrow_width, text_width, label_width, tbw, lbw; result->height = w->core.height; if (XmDropDown_show_label(cbw)) { label_width = label_geom.width; lbw = label_geom.border_width; } else { label_width = 0; lbw = 0; } text_width = text_geom.width; tbw = text_geom.border_width; arrow_width = arrow_geom.width + 2 * arrow_geom.border_width; GetTextAndLabelWidth((Widget) cbw, r_width, arrow_width, lbw, tbw, &text_width, &label_width); if ((text_width != 1) && ((label_width != 1) || XmDropDown_show_label(cbw))) { if (w == XmDropDown_text(cbw)) result->width = text_width; else if (w == XmDropDown_label(cbw)) result->width = label_width; else result->width = w->core.width; } else { result->width = old_width; } result->request_mode = CWWidth | CWHeight; } if ((!h_req || (result->height == request->height)) && (!w_req || (result->width == request->width))) { if (request->request_mode & XtCWQueryOnly) ret_val = XtGeometryYes; else { /* PlaceChildren((Widget) cbw, True, w); */ _XmRequestNewSize((Widget) cbw, False, c_width, c_height, &r_width, &r_height); return(XtGeometryYes); } } else if ((!h_req || (result->height == request->height)) || (!w_req || (result->width == request->width))) { ret_val = XtGeometryAlmost; } else ret_val = XtGeometryNo; w->core.height = old_height; w->core.width = old_width; return(ret_val); } /* Function Name: ChangeManaged * Description: When a management change has occured... * Arguments: w - the combination box widget. * Returns: none. */ static void ChangeManaged(Widget w) { if(XtIsRealized(w)) PlaceChildren(w, True, NULL); else PlaceChildren(w, False, NULL); XmeNavigChangeManaged(w); /* for Motif navigation */ } /* * Function Name: ExposeMethod * Description: Handles redisplay * Arguments: w - the combobox * event - The expose event in question * r - The region to be exposed */ /*ARGSUSED*/ static void ExposeMethod(Widget wid, XEvent *event, Region r) { Dimension x, y, w, h; XmDropDownWidget cbw = (XmDropDownWidget)wid; Widget text = XmDropDown_text(cbw); Widget arrow = XmDropDown_arrow(cbw); if(!XmDropDown_new_visual_style(cbw)) return; if (LayoutIsRtoLM(cbw)) x = arrow->core.x - arrow->core.border_width - cbw->manager.shadow_thickness; else x = text->core.x - text->core.border_width - cbw->manager.shadow_thickness; y = text->core.y - text->core.border_width - cbw->manager.shadow_thickness; w = text->core.width + arrow->core.width + 2*(text->core.border_width + arrow->core.border_width) + 2*cbw->manager.shadow_thickness; h = text->core.height + 2*text->core.border_width + 2*cbw->manager.shadow_thickness; XmeDrawShadows(XtDisplay(cbw), XtWindow(cbw), cbw->manager.top_shadow_GC, cbw->manager.bottom_shadow_GC, x, y, w, h, cbw->manager.shadow_thickness, XmSHADOW_IN); } /************************************************************ * * Actions and Callbacks. * ************************************************************/ #ifdef FIX_1446 /* Function Name: CheckUnpost * Description: This is called when the arrow button is armed. * Arguments: w - the arrow button widget. * combo_ptr - the combination box pointer. * info_ptr - a pointer to the arrow button info. * Returns: none. */ /* ARGSUSED */ static void CheckUnpost(Widget w, XtPointer combo_ptr, XtPointer info_ptr) { XmDropDownWidget cbw = (XmDropDownWidget) combo_ptr; XmArrowButtonCallbackStruct *arrow = (XmArrowButtonCallbackStruct *) info_ptr; XmGrabShellWidget gs = (XmGrabShellWidget) XmDropDown_popup_shell(cbw) ; if (gs && arrow && arrow->event->xbutton.time == gs->grab_shell.unpost_time) XmDropDown_list_state(cbw) = XmDropDown_AFTER_UNPOST; } #endif /* Function Name: ArrowClicked * Description: This is called when the arrow button is selected. * Arguments: w - the arrow button widget. * combo_ptr - the combination box pointer. * info_ptr - a pointer to the arrow button info. * Returns: none. */ /* ARGSUSED */ static void ArrowClicked(Widget w, XtPointer combo_ptr, XtPointer info_ptr) { XmDropDownWidget cbw = (XmDropDownWidget) combo_ptr; Arg args[10]; Cardinal num_args; Boolean is_unposted, success = True; XmAnyCallbackStruct cbdata; XmArrowButtonCallbackStruct *arrow = (XmArrowButtonCallbackStruct*) info_ptr; /* * Do Nothing... */ if (XmDropDown_list_state(cbw) == XmDropDown_IN_PROGRESS) return; #ifdef FIX_1446 if (XmDropDown_list_state(cbw) == XmDropDown_AFTER_UNPOST ) { XmDropDown_list_state(cbw) = XmDropDown_POSTED; return; } #endif /* * DANGER: Do not return early from this function w/o setting * XmDropDown_list_state(cbw) back to either XmDropDown_UNPOSTED or XmDropDown_POSTED or * the combo box will never be able to pop up or down its * list. * * You have been warned! CP 9/8/93. */ if (XmDropDown_list_state(cbw) == XmDropDown_UNPOSTED) is_unposted = True; else /* (XmDropDown_list_state(cbw) == XmDropDown_POSTED) */ is_unposted = False; XmDropDown_list_state(cbw) = XmDropDown_IN_PROGRESS; if (is_unposted) { #ifndef FIX_1371 if (!XmIsGrabShell(XmDropDown_popup_shell(cbw))) #endif PopdownList((Widget) cbw); if (!XmDropDown_customized_combo_box(cbw)) (void) SetTextFromList((Widget) cbw); cbdata.reason = XmCR_UPDATE_TEXT; cbdata.event = (arrow == NULL ? NULL : arrow->event); XtCallCallbackList((Widget) cbw, XmDropDown_update_text_callback(cbw), (XtPointer) &cbdata); } else { if ((success = PopupList((Widget) cbw)) == True) { cbdata.reason = XmCR_UPDATE_SHELL; cbdata.event = (arrow == NULL ? NULL : arrow->event); XtCallCallbackList((Widget) cbw, XmDropDown_update_shell_callback(cbw), (XtPointer) &cbdata); /* * Save the old text in case the user cancels. */ XtFree((char *) XmDropDown_old_text(cbw)); XmDropDown_old_text(cbw) = XmTextFieldGetString(XmDropDown_text(cbw)); if (!XmDropDown_customized_combo_box(cbw) && !SetListFromText((Widget) cbw, False) && XmDropDown_verify(cbw)) { XmTextFieldSetString(XmDropDown_text(cbw), ""); } } } /* * 'success' will only be False if Popuplist failed. */ if (success) { num_args = 0; XtSetArg(args[num_args], XmNarrowDirection, is_unposted ? XmARROW_DOWN : XmARROW_UP); num_args++; XtSetValues(w, args, num_args); } /* * If we were up, we are now down, and visa-versa. */ if (is_unposted) XmDropDown_list_state(cbw) = XmDropDown_POSTED; else XmDropDown_list_state(cbw) = XmDropDown_UNPOSTED; } #ifdef FIX_1446 /* Function Name: PopdownDone * Description: This is called when the popup_shell is poped down. * Arguments: w - the popup_shell widget. * combo_ptr - the combination box pointer. * info_ptr - a pointer to the popup_shell info. * Returns: none. */ /* ARGSUSED */ static void PopdownDone(Widget w, XtPointer combo_ptr, XtPointer info_ptr) { XmDropDownWidget cbw = (XmDropDownWidget) combo_ptr; ArrowClicked(XmDropDown_arrow(cbw), (XtPointer) cbw, NULL); } #endif /* Function Name: CheckExtensions * Description: Verifies that the extension is of the correct * format, with correct version number and * record type * Arguments: combo - XmDropDownWidgetClass * Returns: returns a valid extension as a * XmDropDownClassPartExtension pointer */ static XmDropDownClassPartExtension * CheckExtensions( XmDropDownWidgetClass combo ) { XmDropDownClassPartExtension *ret_extension=NULL, *extension; _XmProcessLock(); extension= (XmDropDownClassPartExtension *)(combo->combo_class.extension); _XmProcessUnlock(); while ((ret_extension == NULL) && (extension != NULL)){ if ((extension->record_type == NULLQUARK) && (extension->version == XmDropDownExtensionVersion)) { ret_extension = (XmDropDownClassPartExtension *)extension; } extension=(XmDropDownClassPartExtension *)extension->next_extension; } return( ret_extension ); } /* Function Name: IsTextOK * Description: This is called to verify the text field. * Arguments: w - the text field widget. * combo_ptr - the combination box pointer. * UNUSED info_ptr - a pointer to the arrow button info. * Returns: none. */ /*ARGSUSED*/ static Boolean IsTextOK(XmDropDownWidget cbw) { Boolean isOK = True; XmDropDownClassPartExtension *addition; addition = CheckExtensions( (XmDropDownWidgetClass)XtClass(cbw) ); if (addition && addition->verify) { char *text = XmTextFieldGetString(XmDropDown_text(cbw)); /* let the subclass verify the string with the application */ isOK = (*addition->verify)((Widget)cbw, text); XtFree(text); } else { isOK = SetListFromText((Widget) cbw, True); } return isOK; } /* Function Name: VerifyTextField * Description: This is called to verify the text field. * Arguments: w - the text field widget. * combo_ptr - the combination box pointer. * UNUSED info_ptr - a pointer to the arrow button info. * Returns: none. */ /*ARGSUSED*/ static void VerifyTextField(Widget w, XtPointer combo_ptr, XtPointer info_ptr) { XmDropDownWidget cbw = (XmDropDownWidget) combo_ptr; XmTextVerifyCallbackStruct *field = (XmTextVerifyCallbackStruct*) info_ptr; XmAnyCallbackStruct cbdata; Boolean allowTraverse = True; if (!XmDropDown_customized_combo_box(cbw)) { if (XmDropDown_verify(cbw) && !IsTextOK(cbw)) { /* * Check to see if the extension is there */ XmDropDownClassPartExtension *addition; addition = CheckExtensions((XmDropDownWidgetClass)XtClass(cbw)); cbdata.reason = XmCR_VERIFY_TEXT_FAILED; cbdata.event = (field == NULL ? NULL : field->event); XtCallCallbackList((Widget)cbw, XmDropDown_verify_text_failed_callback(cbw), (XtPointer) &cbdata); /* otherwise we handle the error; again must let the subclass ** know the string has been updated -- in response to the user's ** input although not to that value -- to some other value */ if (!XmDropDown_editable(cbw)) { /* it is not clear how this case can be reached but fill it out ** for completeness */ XmListSelectPos(XmDropDown_list(cbw), 1, False); SetTextFromList((Widget) cbw); if (addition && addition->update) { char *text = XmTextFieldGetString(XmDropDown_text(cbw)); (void)(*addition->update)((Widget)cbw,text); XtFree(text); } } else { XmTextFieldSetString(XmDropDown_text(cbw), ""); if (addition && addition->update) (void)(*addition->update)((Widget)cbw,""); } } /* else blindly accept the value */ else { XmDropDownClassPartExtension *addition = CheckExtensions( (XmDropDownWidgetClass)XtClass(cbw) ); if (addition && addition->update) { char *text = XmTextFieldGetString(XmDropDown_text(cbw)); (void)(*addition->update)((Widget)cbw,text); XtFree(text); } } } if (w != NULL) { cbdata.reason = XmCR_VERIFY_TEXT; cbdata.event = (field == NULL ? NULL : field->event); XtCallCallbackList((Widget) cbw, XmDropDown_verify_text_callback(cbw), (XtPointer) &cbdata); } if(!XmDropDown_doActivate(cbw)) { /* here if we were NOT called from the autofill code */ if(field == NULL || field->reason != XmCR_ACTIVATE) { allowTraverse = False; } } if(allowTraverse && XmDropDown_autoTraversal(cbw)) { (void) XmProcessTraversal((Widget)cbw, XmTRAVERSE_NEXT_TAB_GROUP); } } /* Function Name: ModifyVerifyTextField * Description: This is called to check if text field is filled so * we can autotraverse * Arguments: w - the text field widget. * combo_ptr - the combination box pointer. * UNUSED info_ptr - a pointer to the arrow button info. * Returns: none. */ /*ARGSUSED*/ static void ModifyVerifyTextField(Widget w, XtPointer combo_ptr, XtPointer info_ptr) { XmDropDownWidget cbw = (XmDropDownWidget) combo_ptr; XmTextVerifyCallbackStruct *field = (XmTextVerifyCallbackStruct*) info_ptr; if (XmDropDown_activateOnFill(cbw) <= 0) return; if(field == NULL || field->event == NULL || field->event->type != KeyPress) return; /* printf("Text m/v callback, cur/new/start/end = %d %d %d %d\n", * field->currInsert, field->newInsert, field->startPos, field->endPos); */ /* No make sure we are inserting a single character at the end */ if(field->currInsert != field->endPos) return; if(field->currInsert != field->startPos) return; if(field->text->length != 1) return; if(field->currInsert + 1 == XmDropDown_activateOnFill(cbw)) { XmDropDown_doActivate(cbw) = True; } } /* Function Name: ValueChangedTextField * Description: Called after value is changed, checks doActivate flag * to see if we should try traversal * Arguments: w - the text field widget. * combo_ptr - the combination box pointer. * UNUSED info_ptr - a pointer to the arrow button info. * Returns: none. */ /*ARGSUSED*/ static void ValueChangedTextField(Widget w, XtPointer combo_ptr, XtPointer info_ptr) { XmDropDownWidget cbw = (XmDropDownWidget) combo_ptr; if(XmDropDown_inValueChanged(cbw)) return; XmDropDown_inValueChanged(cbw) = True; if(XmDropDown_doActivate(cbw)) { VerifyTextField(NULL, (XtPointer) cbw, (XtPointer) info_ptr); /* We clear this AFTER the call, because it is used to * check inside VerifyText if we should do an autoTraversal * or not */ XmDropDown_doActivate(cbw) = False; } XmDropDown_inValueChanged(cbw) = False; } /* Function Name: ListSelected * Description: Called when the popdown list is selected. * Arguments: w - the list widget. * cbw_ptr - pointer to the combination box. * list_data_ptr - data from the list widget. * Returns: none. */ /* ARGSUSED */ static void ListSelected(Widget w, XtPointer cbw_ptr, XtPointer list_data_ptr) { XmDropDownWidget cbw = (XmDropDownWidget) cbw_ptr; XmListCallbackStruct *list_data; list_data = (XmListCallbackStruct *) list_data_ptr; if ((list_data->reason == XmCR_BROWSE_SELECT) && ((list_data->event == NULL) || ((list_data->event->xany.type != ButtonPress) && (list_data->event->xany.type != ButtonRelease)))) { /* * Do not popup list is browse select mode. */ if (!XmDropDown_customized_combo_box(cbw)) (void) SetTextFromList((Widget) cbw); return; } /* * Same thing happens as when the arrow is clicked. */ #ifndef FIX_1446 ArrowClicked(XmDropDown_arrow(cbw), (XtPointer) cbw, NULL); #endif } /* Function Name: ShellButtonEvent * Description: Called when a button press is passed to the shell * from the grab that was activated. * Arguments: w - the shell widget. * cbw_ptr - the combo box widget pointer. * event - the event that caused this action. * junk - *** UNUSED. * Returns: none. * * NOTE: Because this is popped up spring loaded we get all events * that are delivered, so we need to not pop this down if we clicked * on the arrow (the arrow click is handled by the arrow button) * or if we click in the popped up combo box widget. */ /* ARGSUSED */ static void ShellButtonEvent(Widget w, XtPointer cbw_ptr, XEvent *event, Boolean *dispatch) { XmDropDownWidget cbw = (XmDropDownWidget) cbw_ptr; Widget event_widget; switch (event->type) { case ButtonRelease: if (cbw->combo.scrolling) *dispatch = cbw->combo.scrolling = FALSE; break; case ButtonPress: /* Press & release in the scrollbar shouldn't popdown the list. */ if ((cbw->combo.vsb && XtIsRealized(cbw->combo.vsb) && (event->xbutton.window == XtWindow(cbw->combo.vsb))) || (cbw->combo.hsb && XtIsRealized(cbw->combo.hsb) && (event->xbutton.window == XtWindow(cbw->combo.hsb)))) cbw->combo.scrolling = TRUE; break; default: /* This shouldn't happen. */ break; } /* TODO: move the following into the switch statement above */ if (event->xany.type != ButtonPress) { if ((event->xany.type == ButtonRelease) && !XmDropDown_customized_combo_box(cbw)) { XtCallActionProc(XmDropDown_list(cbw), "ListEndSelect", event, NULL, 0); } return; } event_widget = XtWindowToWidget(event->xany.display, event->xany.window); if (event_widget == XmDropDown_arrow(cbw)) return; else if ((event_widget == XmDropDown_text(cbw)) && !XmDropDown_editable(cbw)) { TextButtonPress(event_widget, NULL, event, dispatch); return; } else { Widget event_shell = event_widget; while (!XtIsShell(event_shell)) event_shell = XtParent(event_shell); if ( (event_shell == (Widget) XmDropDown_popup_shell(cbw)) && (event_widget != (Widget) XmDropDown_popup_shell(cbw))) { return; } } if (XmDropDown_list_state(cbw) != XmDropDown_POSTED) /* in case this popup shell is used for more than one combobox */ ArrowClicked(XmDropDown_arrow(cbw), cbw_ptr, NULL); } /* Function Name: LoseFocusHandler * Description: This function is called whenever the shell loses focus * in this case we should bring down the list. * Arguments: w - the shell widget. * cbw_ptr - the combo box widget pointer. * event - the event that caused this action. * junk - *** UNUSED ***. * Returns: none. */ /* ARGSUSED */ static void LoseFocusHandler(Widget w, XtPointer cbw_ptr, XEvent *event, Boolean *junk) { XmDropDownWidget cbw = (XmDropDownWidget) cbw_ptr; XFocusChangeEvent *fevent = &(event->xfocus); if ((event->xany.type != FocusOut) || (XmDropDown_list_state(cbw) != XmDropDown_UNPOSTED) || (fevent->detail == NotifyInferior)) { return; } #ifndef FIX_1446 ArrowClicked(XmDropDown_arrow(cbw), cbw_ptr, NULL); #endif } /* Function Name: ComboUnpost * Description: Called when the user wants to remove the list from the * screen. * Arguments: w - a child widget of the combo box. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ComboUnpost(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmDropDownWidget cbw = FindComboBox(w); if (cbw == NULL) return; if (XmDropDown_list_state(cbw) == XmDropDown_UNPOSTED) ArrowClicked(XmDropDown_arrow(cbw), (XtPointer) cbw, NULL); } /* Function Name: ComboPost * Description: Called when the user wants to show the list on the * screen. * Arguments: w - a child widget of the combo box. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ComboPost(Widget w, XEvent *event, String *params, Cardinal *num_params) { XmDropDownWidget cbw = FindComboBox(w); if (cbw == NULL) return; if (XmDropDown_list_state(cbw) != XmDropDown_UNPOSTED) ArrowClicked(XmDropDown_arrow(cbw), (XtPointer) cbw, NULL); } /* Function Name: ComboCancel * Description: Called when the user wants to remove the list from the * screen, but not update the text. * Arguments: w - a child widget of the combo box. * event - the event that caused this action. * params, num_params - action routine parameters. * Returns: none. */ /*ARGSUSED*/ static void ComboCancel(Widget w, XEvent *event, String *params, Cardinal *num_params) { Arg args[10]; Cardinal num_args; XmDropDownWidget cbw = FindComboBox(w); if ((cbw == NULL) || XmDropDown_list_state(cbw) != XmDropDown_UNPOSTED) return; if (!XmIsGrabShell((Widget)cbw)) PopdownList((Widget) cbw); XmDropDown_list_state(cbw) = XmDropDown_POSTED; /* List is now down (not visible). */ num_args = 0; XtSetArg(args[num_args], XmNarrowDirection, XmARROW_DOWN); num_args++; XtSetValues(XmDropDown_arrow(cbw), args, num_args); if (XmDropDown_old_text(cbw) != NULL) { XmTextFieldSetString(XmDropDown_text(cbw), XmDropDown_old_text(cbw)); XtFree((char *) XmDropDown_old_text(cbw)); XmDropDown_old_text(cbw) = NULL; } } /************************************************************ * * Internal routines. * ************************************************************/ /* Function Name: FindComboBox * Description: Finds the combo box given any one of its descendants. * Arguments: w - any descendant of the combo box. * Returns: the combo box widget or NULL. */ static XmDropDownWidget FindComboBox(Widget w) { while (!XtIsSubclass(w, xmDropDownWidgetClass)) { if ((w = XtParent(w)) == NULL) break; } return((XmDropDownWidget) w); } /* Function Name: RegisterShellHandler * Description: Registers an event handler on the shell. * Arguments: w - the combo box widget. * Returns: none. */ static void RegisterShellHandler(Widget w) { XmDropDownWidget cbw = (XmDropDownWidget) w; if (XmDropDown_popup_shell(cbw) == NULL) return; /* * Don't register the translations if it's a customized shell; the * actions referenced won't be there! * This, of course, means that any actions specified in this * translation table won't ever get called for a customized shell... */ if(!XmDropDown_customized_combo_box(cbw)) { XtOverrideTranslations(XmDropDown_popup_shell(cbw), XmDropDown_translations(cbw)); } XtAddEventHandler(XmDropDown_popup_shell(cbw), ButtonPressMask | ButtonReleaseMask, False, ShellButtonEvent, (XtPointer) w); } /* Function Name: PlaceChildren * Description: Places and sizes the children. * Arguments: w - the combo box widget. * allow_resize - allow the combo box to attempt a resize. * child - Do not query this child for a width, just * use its default size. * Returns: none */ static void PlaceChildren(Widget w, Boolean allow_resize, Widget child) { XmDropDownWidget cbw = (XmDropDownWidget) w; Dimension width, height, rwidth, rheight, child_height; Dimension text_width, label_width, label_bw; Dimension shadow; Position label_x, arrow_x, text_x; XtWidgetGeometry arrow_geom, label_geom, text_geom; Widget label = NULL; Widget text = XmDropDown_text(cbw); Widget arrow = XmDropDown_arrow(cbw); FindDesiredSize(w, child, &width, &height, &label_geom, &text_geom, &arrow_geom); if (XmDropDown_show_label(cbw)) { label = XmDropDown_label(cbw); label_width = label_geom.width; label_bw = label_geom.border_width; } else { label_width = 0; label_bw = 0; } text_width = text_geom.width; if (allow_resize) { _XmRequestNewSize(w, False, width, height, &rwidth, &rheight); } else { rwidth = w->core.width; rheight = w->core.height; } if (width != rwidth) { Dimension arrow_width = arrow_geom.width + 2 * arrow_geom.border_width; GetTextAndLabelWidth(w, rwidth, arrow_width, label_bw, text_geom.border_width, &text_width, &label_width); } child_height = rheight - 2 * XmDropDown_v_space(cbw); if (LayoutIsRtoLM(cbw)) { arrow_x = XmDropDown_h_space(cbw); label_x = (rwidth - (label_width + 2 * label_geom.border_width) \ - XmDropDown_h_space(cbw)); text_x = label_x - text_width - 2*text_geom.border_width; } else { label_x = XmDropDown_h_space(cbw); arrow_x = (rwidth - (arrow_geom.width + 2 * arrow_geom.border_width) \ - XmDropDown_h_space(cbw)); text_x = label_width + 2*label_geom.border_width + \ XmDropDown_h_space(cbw); } if (XmDropDown_show_label(cbw)) { if (!LayoutIsRtoLM(cbw)) text_x += XmDropDown_h_space(cbw); else text_x -= XmDropDown_h_space(cbw); } else { text_geom.border_width = 0; } XmDropDown_text_x(cbw) = text_x; if ( XmDropDown_new_visual_style(cbw) ) { shadow = cbw->manager.shadow_thickness; child_height -= 2 * shadow; if (LayoutIsRtoLM(cbw)) { arrow_x += shadow; text_x -= shadow; } else { arrow_x -= shadow; text_x += shadow; } } else { shadow = 0; } /* * Now resize the widgets */ if (XmDropDown_show_label(cbw)) { _XmConfigureWidget(label, label_x, /* XmDropDown_h_space(cbw), */ XmDropDown_v_space(cbw), label_width, child_height - 2 * label_geom.border_width, label_geom.border_width); } _XmConfigureWidget(text, text_x, XmDropDown_v_space(cbw) + shadow, text_width, child_height - 2 * text_geom.border_width, text_geom.border_width); _XmConfigureWidget(arrow, arrow_x, XmDropDown_v_space(cbw) + shadow, arrow_geom.width, child_height - 2 * arrow_geom.border_width, arrow_geom.border_width); } /* Function Name: GetTextAndLabelWidth * Description: Finds the size for both the text and label widgets. * Arguments: w - the combo box. * combo_width - the new size of the combo box. * arrow_width - the new width of the arrow button. * lbw, tbw - the border widths of the label * and text widgets. * text_width, label_width - The desired size of the * RETURNED text and label is passed in, * and the new sizes are returned * Returns: none */ static void GetTextAndLabelWidth(Widget w, Dimension combo_width, Dimension arrow_width, Dimension lbw, Dimension tbw, Dimension *text_width, Dimension *label_width) { XmDropDownWidget cbw = (XmDropDownWidget) w; int text_and_label; text_and_label = combo_width - (arrow_width + 2 * (lbw + tbw)); text_and_label -= 3 * XmDropDown_h_space(cbw); if (XmDropDown_show_label(cbw)) { text_and_label -= XmDropDown_h_space(cbw); } if (XmDropDown_new_visual_style(cbw)) { text_and_label -= 2 * cbw->manager.shadow_thickness; text_and_label += XmDropDown_h_space(cbw); } if (text_and_label >= (int) (*text_width + *label_width)) { *text_width = text_and_label - *label_width; } /* * We need to shrink each a bit. */ else { if ( text_and_label < 2 ) { *text_width = *label_width = 1; return; } *text_width = ((int)(*text_width * text_and_label)/ (int)(*text_width + *label_width)); *label_width = text_and_label - *text_width; } if (*text_width < 1) { *text_width = 1; } if ((*label_width < 1) && (XmDropDown_show_label(cbw))) { *label_width = 1; } } /* Function Name: FindDesiredSize * Description: Finds the desired size of the combination box. * Arguments: w - the combo box. * RETURNED width_ret, height_ret - The desired size. * Returns: none */ static void FindDesiredSize(Widget w, Widget child, Dimension * width_ret, Dimension * height_ret, XtWidgetGeometry * label, XtWidgetGeometry * text, XtWidgetGeometry * arrow) { XmDropDownWidget cbw = (XmDropDownWidget) w; Dimension shadow; int label_width, text_width, arrow_width, h_space; if ( !XmDropDown_show_label(cbw) ) { label->width = 0; label->height = 0; label->border_width = 0; } else if ( child != XmDropDown_label(cbw) ) { (void) XtQueryGeometry(XmDropDown_label(cbw), NULL, label); } else { label->width = child->core.width; label->height = child->core.height; label->border_width = child->core.border_width; } if ( child != XmDropDown_text(cbw) ) { (void) XtQueryGeometry(XmDropDown_text(cbw), NULL, text); } else { text->width = child->core.width; text->height = child->core.height; text->border_width = child->core.border_width; } if ( child != XmDropDown_arrow(cbw) ) { (void) XtQueryGeometry(XmDropDown_arrow(cbw), NULL, arrow); } else { arrow->width = child->core.width; arrow->height = child->core.height; arrow->border_width = child->core.border_width; } label_width = label->width + 2 * label->border_width; text_width = text->width + 2 * text->border_width; arrow_width = arrow->width + 2 * arrow->border_width; h_space = 3 * XmDropDown_h_space(cbw); *width_ret = (Dimension )(label_width + text_width \ + arrow_width + h_space); if ( XmDropDown_show_label(cbw) ) { *width_ret += XmDropDown_h_space(cbw); } if ( XmDropDown_new_visual_style(cbw) ) { shadow = cbw->manager.shadow_thickness; *width_ret += 2 * shadow; *width_ret -= XmDropDown_h_space(cbw); } else { shadow = 0; } *height_ret = 0; ASSIGN_MAX(*height_ret, label->height + 2 * label->border_width); ASSIGN_MAX(*height_ret, text->height + \ 2 * text->border_width + 2 * shadow); /* * can't use arrow sizes in the specification; * it has no query_geometry procedure */ /* * ASSIGN_MAX(*height_ret, arrow->height + 2 * arrow->border_width * + 2 * shadow); */ *height_ret += 2 * XmDropDown_v_space(cbw); } /* Function Name: CreateChildren * Description: Creates all normal children for the Combo Box. * Arguments: w - the combo box. * args, num_args - the args to create this widget with. * Returns: none. * * NOTE(DKB:03/07/96): * This function used to only created the needed children, i.e. if * show label was False the label was not created, and the popup list * was never created. This was changed due to the fact that this widget * uses a resources pass-through method thus if the widgets are not * created at initialization all resources that should be pass-through * to those widgets are lost. */ static void CreateChildren(Widget w, ArgList args, Cardinal num_args) { XmDropDownWidget cbw = (XmDropDownWidget) w; Arg largs[10]; Cardinal num_largs; Arg targs[10], *merge; Cardinal tn = 0; XmDropDown_label(cbw) = XtCreateWidget("label", xmLabelWidgetClass, w, args, num_args); XtVaSetValues(XmDropDown_label(cbw), XmNtraversalOn, False, NULL); /* * If we are supposed to show this label lets manage the widget. */ if( XmDropDown_show_label(cbw) ) { XtManageChild(XmDropDown_label(cbw)); } if( XmDropDown_use_text_field(cbw) ) { tn = 0; if(XmDropDown_new_visual_style(cbw)) { XtSetArg(targs[tn], XmNshadowThickness, 0); tn++; XtSetArg(targs[tn], XmNhighlightThickness, 0); tn++; } else { XtSetArg(targs[tn], XmNshadowThickness, 2); tn++; XtSetArg(targs[tn], XmNhighlightThickness, 2); tn++; } merge = XtMergeArgLists(args, num_args, targs, tn); XmDropDown_text(cbw) = XtCreateManagedWidget("text", xmTextFieldWidgetClass, w, merge, num_args+tn); XtFree((XtPointer)merge); } else { tn = 0; if(XmDropDown_new_visual_style(cbw)) { XtSetArg(targs[tn], XmNshadowThickness, 0); tn++; XtSetArg(targs[tn], XmNhighlightThickness, 0); tn++; } else { XtSetArg(targs[tn], XmNshadowThickness, 2); tn++; XtSetArg(targs[tn], XmNhighlightThickness, 2); tn++; } XtSetArg(targs[tn], XmNeditMode, XmSINGLE_LINE_EDIT); tn++; XtSetArg(targs[tn], XmNrows, 1); tn++; XtSetArg(targs[tn], XmNwordWrap, False); tn++; XtSetArg(targs[tn], XmNscrollHorizontal, False); tn++; XtSetArg(targs[tn], XmNscrollVertical, False); tn++; merge = XtMergeArgLists(args, num_args, targs, tn); XmDropDown_text(cbw) = XtCreateManagedWidget("text", xmTextWidgetClass, w, merge, num_args + tn); XtFree((XtPointer)merge); } XtAddCallback(XmDropDown_text(cbw), XmNlosingFocusCallback, VerifyTextField, (XtPointer) cbw); XtAddCallback(XmDropDown_text(cbw), XmNactivateCallback, VerifyTextField, (XtPointer) cbw); XtAddCallback(XmDropDown_text(cbw), XmNmodifyVerifyCallback, ModifyVerifyTextField, (XtPointer) cbw); XtAddCallback(XmDropDown_text(cbw), XmNvalueChangedCallback, ValueChangedTextField, (XtPointer) cbw); XtOverrideTranslations(XmDropDown_text(cbw), XmDropDown_translations(cbw)); if(XmDropDown_new_visual_style(cbw)) { tn = 0; XtSetArg(targs[tn], XmNhighlightThickness, 0); tn++; XtSetArg(targs[tn], XmNshadowThickness, 2); tn++; merge = XtMergeArgLists(args, num_args, targs, tn); XmDropDown_arrow(cbw) = XtCreateManagedWidget("arrow", xmArrowButtonWidgetClass, w, merge, num_args+tn); XtFree((XtPointer)merge); } else { tn = 0; XtSetArg(targs[tn], XmNshadowThickness, 2); tn++; XtSetArg(targs[tn], XmNhighlightThickness, 2); tn++; XmDropDown_arrow(cbw) = XtCreateManagedWidget("arrow", xmArrowButtonWidgetClass, w, args, num_args); } num_largs = 0; XtSetArg(largs[num_largs], XmNarrowDirection, XmARROW_DOWN); num_largs++; XtSetValues(XmDropDown_arrow(cbw), largs, num_largs); XtOverrideTranslations(XmDropDown_arrow(cbw), XmDropDown_translations(cbw)); XtAddCallback(XmDropDown_arrow(cbw), XmNactivateCallback, ArrowClicked, (XtPointer) w); #ifdef FIX_1446 XtAddCallback(XmDropDown_arrow(cbw), XmNarmCallback, CheckUnpost, (XtPointer) w); #endif } /* * To deal with the problem, SBBtnDownEH will do an XtGrabPointer * to transfer the grab to the scrollbar and SBBtnUpEH will cause * the grab to return to the grab shell. */ /*ARGSUSED*/ static void SBBtnDownEH(Widget w, XtPointer client_data, XEvent *event, Boolean *cont) /* unused */ { XmGrabShellWidget shell = (XmGrabShellWidget) client_data; XtGrabPointer(w, False, Events | PointerMotionMask | ButtonMotionMask, GrabModeAsync, GrabModeAsync, None, shell->grab_shell.cursor, event->xbutton.time); } /*ARGSUSED*/ static void SBBtnUpEH(Widget w, /* unused */ XtPointer client_data, XEvent *event, Boolean *cont) /* unused */ { XmGrabShellWidget shell = (XmGrabShellWidget) client_data; /* Note that this regrab to the grab shell will need to be changed * if the kind of grab that the grabshell imposes changes. */ XtGrabPointer((Widget) shell, shell->grab_shell.owner_events, Events, shell->grab_shell.grab_style, GrabModeAsync, None, shell->grab_shell.cursor, event->xbutton.time); if (shell->grab_shell.grab_style == GrabModeSync) XAllowEvents(XtDisplay(shell), SyncPointer, event->xbutton.time); } /* Function Name: CreatePopup * Description: Create the popup shell that contains the list. * Arguments: w - the combo box. * args, num_args - the number of arguments in the list. * Returns: none. */ static void CreatePopup(Widget w, ArgList args, Cardinal num_args) { XmDropDownWidget cbw = (XmDropDownWidget) w; Arg *new_list, largs[10]; Cardinal num_largs; Widget sb; num_largs = 0; XtSetArg(largs[num_largs], XmNoverrideRedirect, True); num_largs++; XtSetArg(largs[num_largs], XmNsaveUnder, True); num_largs++; XtSetArg(largs[num_largs], XmNallowShellResize, True); num_largs++; XtSetArg(largs[num_largs], XmNancestorSensitive, True); num_largs++; XtSetArg(largs[num_largs], XmNownerEvents, True), num_largs++; XtSetArg(largs[num_largs], XmNgrabStyle, GrabModeSync), num_largs++; new_list = XtMergeArgLists(args, num_args, largs, num_largs); XmDropDown_popup_shell(cbw) = XtCreatePopupShell("popupShell", xmGrabShellWidgetClass, w, new_list, num_largs + num_args); XtFree((char *) new_list); #ifdef FIX_1446 XtAddCallback(XmDropDown_popup_shell(cbw), XmNpopdownCallback, PopdownDone , (XtPointer) w); #endif /* * Set the visible item count of the list child widget */ num_largs = 0; XtSetArg(largs[num_largs], XmNvisibleItemCount, XmDropDown_visible_items(cbw)); num_largs++; new_list = XtMergeArgLists(args, num_args, largs, num_largs); XmDropDown_list(cbw) = XmCreateScrolledList(XmDropDown_popup_shell(cbw), "list", new_list, num_args + num_largs); XtFree((char *) new_list); XtAddCallback(XmDropDown_list(cbw), XmNdefaultActionCallback, ListSelected, (XtPointer) cbw); XtAddCallback(XmDropDown_list(cbw), XmNsingleSelectionCallback, ListSelected, (XtPointer) cbw); XtAddCallback(XmDropDown_list(cbw), XmNbrowseSelectionCallback, ListSelected, (XtPointer) cbw); XtManageChild(XmDropDown_list(cbw)); num_largs = 0; XtSetArg(largs[num_largs], XmNhorizontalScrollBar, &(cbw->combo.hsb)), num_largs++; XtSetArg(largs[num_largs], XmNverticalScrollBar, &(cbw->combo.vsb)), num_largs++; XtGetValues(XtParent(XmDropDown_list(cbw)), largs, num_largs); sb = cbw->combo.vsb; if (sb != (Widget) NULL) { XtInsertEventHandler(sb, ButtonPressMask, False, SBBtnDownEH, (XtPointer) XmDropDown_popup_shell(cbw), XtListHead); XtInsertEventHandler(sb, ButtonReleaseMask, False, SBBtnUpEH, (XtPointer) XmDropDown_popup_shell(cbw), XtListHead); } sb = cbw->combo.hsb; if (sb != (Widget) NULL) { XtInsertEventHandler(sb, ButtonPressMask, False, SBBtnDownEH, (XtPointer) XmDropDown_popup_shell(cbw), XtListHead); XtInsertEventHandler(sb, ButtonReleaseMask, False, SBBtnUpEH, (XtPointer) XmDropDown_popup_shell(cbw), XtListHead); } } /* Function Name: PopdownList * Description: Pops down the list of choices. * Arguments: w - the combo box. * Returns: none */ static void PopdownList(Widget w) { XmDropDownWidget cbw = (XmDropDownWidget) w; #ifdef FIX_1371 Widget gs = XmDropDown_popup_shell(cbw); if (gs && XmIsGrabShell(gs) && (XmDropDown_list_state(cbw) != XmDropDown_POSTED)) XtCallActionProc(gs, "GrabShellPopdown", NULL, NULL, 0); #else if (XmDropDown_popup_shell(cbw) != NULL) { XSetInputFocus(XtDisplay(w), XmDropDown_focus_owner(cbw), XmDropDown_focus_state(cbw), XtLastTimestampProcessed(XtDisplay(w))); /* * The order is important here to keep from generating Xt Errors. */ if (!XmIsGrabShell(XmDropDown_popup_shell(cbw))) XtRemoveGrab(XmDropDown_arrow(cbw)); XtUngrabKeyboard(w, XtLastTimestampProcessed(XtDisplay(w))); XtPopdown(XmDropDown_popup_shell(cbw)); } #endif else { XmeWarning(w, XmNnoComboShellMsg); } } /* ARGSUSED */ static void TextButtonPress(Widget w , XtPointer client, XEvent *event, Boolean *go_on) { XmDropDownWidget cbw = FindComboBox(w); if (cbw == NULL) return; /* * It is debatable whether or not we should eat this event. For now, * we'll let it continue. */ #ifdef notdef *go_on = False; #endif if (event->xany.type == ButtonPress) { if (XmDropDown_list_state(cbw) == XmDropDown_POSTED) { (void)ComboPost( w, NULL, NULL, NULL ); XmDropDown_list_state(cbw) = XmDropDown_BEGIN_POPUP_FROM_TEXT; return; } else if (XmDropDown_list_state(cbw) == XmDropDown_UNPOSTED) { (void)ComboUnpost( w, NULL, NULL, NULL ); } else if (XmDropDown_list_state(cbw) == XmDropDown_BEGIN_POPUP_FROM_TEXT) XmDropDown_list_state(cbw) = XmDropDown_UNPOSTED; } } /* Function Name: PopupList * Description: Pops up the list of choices. * Arguments: w - the combo box. * Returns: True if sucessful. */ static Boolean PopupList(Widget w) { XmDropDownWidget cbw = (XmDropDownWidget) w; Widget shell = XmDropDown_popup_shell(cbw); Position x, y, temp; Dimension width; int ret, scr_width, scr_height; Arg args[10]; Cardinal num_args; if (shell == NULL) { XmeWarning(w, XmNnoComboShellMsg); return(False); } XtTranslateCoords(w, 0, XtHeight(w), &x, &y); XtRealizeWidget(shell); num_args = 0; if (LayoutIsRtoLM(w)) temp = XmDropDown_arrow(cbw)->core.x + XmDropDown_popup_offset(cbw); else temp = XmDropDown_text_x(cbw) + XmDropDown_popup_offset(cbw); x += temp; if (!XmDropDown_customized_combo_box(cbw)) { width = (cbw->core.width - temp - (shell)->core.border_width); XtSetArg(args[num_args], XmNwidth, width); num_args++; } else { width = XtWidth(shell); } /* * Now that we know where on the screen we want to display the popup * we have to make sure that it will fit on the screen. What we * do here is check if y + height and x + width are still on the * screen. If now we decrease x and/or until the popup would be on * the screen. As a last check we make sure that x and y are >= 0. * * Lets start by getting the width and height of the screen. */ scr_width = WidthOfScreen(XtScreen(shell)); scr_height = HeightOfScreen(XtScreen(shell)); if( (int)(y + XtHeight(shell)) > scr_height ) { Position tmp; XtTranslateCoords(w, 0, 0, &tmp, &y); y -= ((int)XtHeight(shell)); } if( y < 0 ) y = 0; if( (int)(x + width) > scr_width ) { x = scr_width - ((int)width); } if( x < 0 ) x = 0; XtSetArg(args[num_args], XmNx, x); num_args++; XtSetArg(args[num_args], XmNy, y); num_args++; XtSetValues(shell, args, num_args); /* * Because of an Xt bug, we need to cal the shell widget's resize * proc ourselves. */ { /* THIS WAS - (*(XtClass(shell)->core_class.resize))(shell); */ XtWidgetProc resize; _XmProcessLock(); resize = *(XtClass(shell)->core_class.resize); _XmProcessUnlock(); (*resize) (shell); } if (!XmIsGrabShell(shell)) XGetInputFocus(XtDisplay(shell), &(XmDropDown_focus_owner(cbw)), &(XmDropDown_focus_state(cbw))); /* * If we are in pointer root mode it is possible that the pointer is * over our popup so that when it is popped up we have the focus. * if we later do a XSetInputFocus a lose focus will be delivered * to us and pop us down. I have solved this problem by temporarily * setting the keyboard focus to the combo box's window and then * popping up the window and setting the focus to us. This keeps * us from losing the focus. * * Keyboard events could be lost, but until the window comes up we * don't know where the events will be delivered anyway so this is * no worse than just settting the input focus to our window. * * A Sync. popup may solve this problem, but it is not too big a deal. * * Chris D. Peterson */ if (!XmIsGrabShell(shell)) XSetInputFocus(XtDisplay(shell), XtWindow((Widget) cbw), RevertToParent, XtLastTimestampProcessed(XtDisplay(w)) - 1); #ifdef FIX_1486 _XmPopupSpringLoaded(shell); #else XtPopupSpringLoaded(shell); #endif if (!XmIsGrabShell(shell)) { ret = XtGrabPointer(shell, True, ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, XmDropDown_popup_cursor(cbw), XtLastTimestampProcessed(XtDisplay(w))); if (ret != GrabSuccess) { XtPopdown(shell); /* * We could not popup the list, this is because somehow things * got so slow that we were not allowed to grab the server. * In this case I will fail silently and the user can try again. */ return(False); } XtAddGrab(XmDropDown_arrow(cbw), False, False); /* * Since this is an override redirect window we know that no one * will get in the way of thisX SetInputFocus Event. */ XSetInputFocus(XtDisplay(shell), XtWindow(shell), RevertToParent, CurrentTime); } return(True); } /* Function Name: SetListFromText * Description: Makes the list highlights match the text widget. * Arguments: w - the combo box widget. * no_action - just check to see if this would succeed. * Returns: True if each item was found, or the text widget is * empty. */ static Boolean SetListFromText(Widget w, Boolean no_action) { Arg args[10]; Cardinal num_args; int count = 0, vcount, tcount; XrmValue to, from; XmStringTable table, tptr; XmDropDownWidget cbw = (XmDropDownWidget) w; String ptr = XmTextFieldGetString(XmDropDown_text(cbw)); XmStringTable sel_table; Boolean error = False; unsigned char policy; XmDropDownClassPartExtension *addition; if (ptr != NULL) { int num_items; addition = CheckExtensions((XmDropDownWidgetClass)XtClass(cbw)); if (addition && addition->setListFromText) { XtFree(ptr); return (*addition->setListFromText)(w, XmDropDown_text(cbw), XmDropDown_list(cbw)); } num_args = 0; XtSetArg(args[num_args], XmNitemCount, &num_items); num_args++; XtGetValues(XmDropDown_list(cbw), args, num_args); /* * Strlen can be used here because we are attempting to find the * number of bytes in the string not the number of i18n characters. */ from.size = sizeof(char) * (strlen(ptr) + 1); from.addr = ptr; to.size = sizeof(XmStringTable); to.addr = (XtPointer) &table; XtConvertAndStore(XmDropDown_list(cbw), XmRString, &from, XmRXmStringTable, &to); /* * If the text field contains "", the table will be NULL */ if (table != NULL) { for(tptr = table, count = 0; *tptr != NULL ; tptr++) count++; sel_table = (XmStringTable) XtMalloc(sizeof(XmString) * count); for(tptr = table, count = 0; *tptr != NULL ; tptr++) { if (XmListItemExists(XmDropDown_list(cbw), *tptr)) sel_table[count++] = *tptr; else { error = TRUE; break; } } } else sel_table = NULL; XtFree((char *) ptr); } else { count = 0; sel_table = NULL; } if (!no_action) XmListDeselectAllItems(XmDropDown_list(cbw)); /* * If single select and there is more than one element in * the list, then we have an error. */ num_args = 0; XtSetArg(args[num_args], XmNselectionPolicy, &policy); num_args++; XtSetArg(args[num_args], XmNvisibleItemCount, &vcount); num_args++; XtSetArg(args[num_args], XmNitemCount, &tcount); num_args++; XtGetValues(XmDropDown_list(cbw), args, num_args); if ((((policy == XmSINGLE_SELECT) || (policy == XmBROWSE_SELECT)) && (count > 1)) || error) { XtFree((char *) sel_table); return(FALSE); } num_args = 0; XtSetArg(args[num_args], XmNselectedItems, sel_table); num_args++; XtSetArg(args[num_args], XmNselectedItemCount, count); num_args++; XtSetValues(XmDropDown_list(cbw), args, num_args); /* * Makes the first selected item the first item in the list. */ if (count > 0) { int *pos_list, num, pos = 0; XmListGetMatchPos(XmDropDown_list(cbw), sel_table[0], &pos_list, &num); if (num > 0) { pos = pos_list[0] - vcount/2; if (pos < 1) pos = 1; else if (pos > (tcount - vcount + 1)) pos = tcount - vcount + 1; XtFree((char *) pos_list); } XmListSetPos(XmDropDown_list(cbw), pos); } XtFree((char *) sel_table); return(TRUE); } /* Function Name: SetTextFromList * Description: Makes the text strings matched the elements * highlighted in the list. * Arguments: w - the combo box widget. * Returns: True if each item was found, or the text widget is * empty. */ static Boolean SetTextFromList(Widget w) { XmDropDownWidget cbw = (XmDropDownWidget) w; Arg args[10]; Cardinal num_args; XmStringTable items; int count; unsigned char policy; register int i, text_loc; XmDropDownClassPartExtension *addition; addition = CheckExtensions( (XmDropDownWidgetClass)XtClass(cbw) ); if (addition && addition->setTextFromList) { return (*addition->setTextFromList)(w,XmDropDown_text(cbw), XmDropDown_list(cbw)); } num_args = 0; XtSetArg(args[num_args], XmNselectedItems, &items); num_args++; XtSetArg(args[num_args], XmNselectedItemCount, &count); num_args++; XtSetArg(args[num_args], XmNselectionPolicy, &policy); num_args++; XtGetValues(XmDropDown_list(cbw), args, num_args); if ((policy == XmMULTIPLE_SELECT) || (policy == XmEXTENDED_SELECT) || (count > 0)) { XmTextFieldSetString(XmDropDown_text(cbw), ""); } text_loc = 0; i = 0; while (i < count) { register int len; String ptr; wchar_t temp[BUFSIZ]; ptr = XmStringUnparse(items[i], NULL, XmCHARSET_TEXT, XmMULTIBYTE_TEXT, NULL, 0, XmOUTPUT_ALL); if (mbstowcs(NULL, ptr, 0) == (ssize_t)(-1)) { XmeWarning((Widget) cbw, XmNstringGetFailedMsg); i++; continue; } /* * There must be a better way to do a strlen for I18N text. */ len = (int) mbstowcs(temp, ptr, BUFSIZ); XmTextFieldInsert(XmDropDown_text(cbw), text_loc, ptr); XtFree((char *) ptr); text_loc += len; if (++i >= count) break; XmTextFieldInsert(XmDropDown_text(cbw), text_loc, ","); text_loc++; } XmTextFieldSetInsertionPosition(XmDropDown_text(cbw), 0); return(FALSE); } /************************************************************ * * Public Routines. * ************************************************************/ /* Function Name: XmDropDownGetValue * Description: Retreives the value from the combo box. * Arguments: w - the combination box. * Returns: The value in the text widget. */ String XmDropDownGetValue(Widget w) { XmDropDownWidget cbw = (XmDropDownWidget) w; String ptr; _XmWidgetToAppContext(w); _XmAppLock(app); ptr = XmTextFieldGetString(XmDropDown_text(cbw)); _XmAppUnlock(app); return ptr; } /* Function Name: XmCreateDropDown * Description: Creation Routine for UIL and ADA. * Arguments: parent - the parent widget. * name - the name of the widget. * args, num_args - the number and list of args. * Returns: The created widget. */ Widget XmCreateDropDown(Widget parent, String name, ArgList args, Cardinal num_args) { return(XtCreateWidget(name, xmDropDownWidgetClass, parent, args, num_args)); } Widget XmVaCreateDropDown( Widget parent, char *name, ...) { register Widget w; va_list var; int count; Va_start(var,name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDropDownWidgetClass, parent, False, var, count); va_end(var); return w; } Widget XmVaCreateManagedDropDown( Widget parent, char *name, ...) { Widget w = NULL; va_list var; int count; Va_start(var, name); count = XmeCountVaListSimple(var); va_end(var); Va_start(var, name); w = XmeVLCreateWidget(name, xmDropDownWidgetClass, parent, True, var, count); va_end(var); return w; } /* Function Name: XmDropDownGetLabel * Description: Returns the "label" child of the XmDropDown * Arguments: w - The XmDropDown Widget * Returns: The specified child of the XmDropDown */ Widget XmDropDownGetLabel(Widget w) { if(!XtIsSubclass(w, xmDropDownWidgetClass)) return NULL; return XmDropDown_label(w); } /* Function Name: XmDropDownGetArrow * Description: Returns the "arrow" child of the XmDropDown * Arguments: w - The XmDropDown Widget * Returns: The specified child of the XmDropDown */ Widget XmDropDownGetArrow(Widget w) { if(!XtIsSubclass(w, xmDropDownWidgetClass)) return NULL; return XmDropDown_arrow(w); } /* Function Name: XmDropDownGetText * Description: Returns the "text" child of the XmDropDown * Arguments: w - The XmDropDown Widget * Returns: The specified child of the XmDropDown */ Widget XmDropDownGetText(Widget w) { if(!XtIsSubclass(w, xmDropDownWidgetClass)) return NULL; return XmDropDown_text(w); } /* Function Name: XmDropDownGetList * Description: Returns the "list" child of the XmDropDown * Arguments: w - The XmDropDown Widget * Returns: The specified child of the XmDropDown */ Widget XmDropDownGetList(Widget w) { if(!XtIsSubclass(w, xmDropDownWidgetClass)) return NULL; return XtNameToWidget(w, "*list"); } /* Function Name: XmDropDownGetChild * Description: Returns the child widget id of the XmDropDown * Arguments: w - The XmDropDown Widget * Returns: The specified child of the XmDropDown */ Widget XmDropDownGetChild(Widget w, int num) { XmDropDownWidget cbw = (XmDropDownWidget) w; Widget child; _XmWidgetToAppContext(w); _XmAppLock(app); if(!XtIsSubclass(w, xmDropDownWidgetClass)) { _XmAppUnlock(app); return NULL; } switch (num) { XmDROPDOWN_LABEL: child = XmDropDown_label(w); XmDROPDOWN_TEXT: child = XmDropDown_text(w); XmDROPDOWN_ARROW_BUTTON: child = XmDropDown_arrow(w); XmDROPDOWN_LIST: child = XmDropDown_list(w); default: child = NULL; } _XmAppUnlock(app); return child; } /* aliases for deprecated functions of XmComboBox2 */ extern WidgetClass xmCombinationBox2WidgetClass XM_ALIAS(xmDropDownWidgetClass); String XmCombinationBox2GetValue(Widget) XM_ALIAS(XmDropDownGetValue); Widget XmCreateCombinationBox2(Widget, char *, ArgList, Cardinal) XM_ALIAS(XmCreateDropDown); Widget XmVaCreateCombinationBox2(Widget, char *, ...) XM_ALIAS(XmVaCreateDropDown); Widget XmVaCreateManagedCombinationBox2(Widget, char *, ...) XM_ALIAS(XmVaCreateManagedDropDown); Widget XmCombinationBox2GetLabel(Widget) XM_ALIAS(XmDropDownGetLabel); Widget XmCombinationBox2GetArrow(Widget) XM_ALIAS(XmDropDownGetArrow); Widget XmCombinationBox2GetText(Widget) XM_ALIAS(XmDropDownGetText); Widget XmCombinationBox2GetList(Widget) XM_ALIAS(XmDropDownGetList); Widget XmCombinationBox2GetChild(Widget, int) XM_ALIAS(XmDropDownGetChild); extern XmDropDownClassRec xmCombinationBox2ClassRec XM_ALIAS(xmDropDownClassRec); motif-2.3.8/lib/Xm/ScrolledW.h0000644000175000017500000000471113145162623012772 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _XmScrolledWindow_h #define _XmScrolledWindow_h #include #ifdef __cplusplus extern "C" { #endif #ifndef XmIsScrolledWindow #define XmIsScrolledWindow(w) XtIsSubclass(w, xmScrolledWindowWidgetClass) #endif /* XmIsScrolledWindow */ externalref WidgetClass xmScrolledWindowWidgetClass; typedef struct _XmScrolledWindowClassRec * XmScrolledWindowWidgetClass; typedef struct _XmScrolledWindowRec * XmScrolledWindowWidget; /******** Public Function Declarations ********/ extern void XmScrolledWindowSetAreas( Widget w, Widget hscroll, Widget vscroll, Widget wregion) ; extern Widget XmCreateScrolledWindow( Widget parent, char *name, ArgList args, Cardinal argCount) ; extern void XmScrollVisible( Widget scrw, Widget wid, Dimension hor_margin, Dimension ver_margin) ; /* * Variable argument list functions */ extern Widget XmVaCreateScrolledWindow( Widget parent, char *name, ...); extern Widget XmVaCreateManagedScrolledWindow( Widget parent, char *name, ...); /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _XmScrolledWindow_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Xm/Traversal.c0000644000175000017500000013164213145162623013036 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Traversal.c /main/20 1999/08/17 11:52:26 vipin $" #endif #endif #include #include #include #include #include #include #include #include #include #include #include "BaseClassI.h" #include "CallbackI.h" #include "RepTypeI.h" #include "TravActI.h" #include "TraversalI.h" /******** Static Function Declarations ********/ static Widget FindFirstManaged( Widget wid) ; static Boolean CallTraverseObsured( Widget new_focus, XmTraversalDirection dir) ; static Boolean IsTraversable( Widget wid, Boolean require_in_view) ; static Widget FindFirstFocus( Widget wid) ; static Boolean CallFocusMoved(Widget old, Widget new_wid, XEvent *event, XmTraversalDirection direction); static Widget RedirectTraversal(Widget old_focus, Widget new_focus, unsigned int focus_policy, XmTraversalDirection direction, unsigned int pass); /******** End Static Function Declarations ********/ XmFocusData _XmCreateFocusData( void ) { return (XmFocusData) XtCalloc(1, sizeof( XmFocusDataRec)) ; } void _XmDestroyFocusData( XmFocusData focusData ) { _XmFreeTravGraph( &(focusData->trav_graph)) ; XtFree((char *) focusData->trav_graph.excl_tab_list) ; XtFree((char *) focusData) ; } void _XmSetActiveTabGroup( XmFocusData focusData, Widget tabGroup ) { focusData->active_tab_group = tabGroup; } Widget _XmGetActiveItem( Widget w ) { return XmGetFocusWidget( w) ; } /*ARGSUSED*/ void _XmNavigInitialize( Widget request, /* unused */ Widget new_wid, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { XmFocusData focusData ; if( (focusData = _XmGetFocusData( new_wid)) != NULL ) { XmNavigationType navType = _XmGetNavigationType( new_wid) ; if( navType == XmEXCLUSIVE_TAB_GROUP ) { ++(focusData->trav_graph.exclusive) ; _XmTabListAdd( &(focusData->trav_graph), new_wid) ; } else { if( navType == XmSTICKY_TAB_GROUP ) { _XmTabListAdd( &(focusData->trav_graph), new_wid) ; } } if( focusData->trav_graph.num_entries && _XmGetNavigability( new_wid) ) { /* If the graph exists, add the new navigable widget. */ _XmTravGraphAdd( &(focusData->trav_graph), new_wid) ; } } /* If the traversal graph doesn't exist, do nothing, since the * new widget will be picked-up when the graph is needed and created. */ return ; } /*ARGSUSED*/ Boolean _XmNavigSetValues( Widget current, Widget request, /* unused */ Widget new_wid, ArgList args, /* unused */ Cardinal *num_args ) /* unused */ { /* This routine is called from the SetValues method of Manager, * Primitive, and Gadget to keep the traversal data structures * up-to-date in regards to changes in the traversability of widgets. * * There are three purposes for this routine: * * 1: Update the traversal graph in response to changes in * a widget's resources such that the widget is newly * eligible to receive the traversal focus. * * 2: Update the focus data according to changes in * the Motif 1.0 "exclusive tab group" behavior. * * 3: If the new widget of the SetValues call is the focus * widget and it becomes ineligible to have the focus, * then find an alternative to receive the focus (or * reset the focus for the hierarchy to the bootstrap * condition). */ XmFocusData focusData ; if( (focusData = _XmGetFocusData( new_wid)) != NULL ) { XmTravGraph graph = &(focusData->trav_graph) ; XmNavigationType newNavType = _XmGetNavigationType( new_wid) ; XmNavigationType curNavType = _XmGetNavigationType( current) ; Boolean ChangeInExclusive = FALSE ; if( curNavType != newNavType ) { if( (curNavType == XmEXCLUSIVE_TAB_GROUP) || (newNavType == XmEXCLUSIVE_TAB_GROUP) ) { /* This widget was "exclusive", now it is not (or vice-versa). * Update the value of the focus data "exclusive" field. */ ChangeInExclusive = TRUE ; if( newNavType == XmEXCLUSIVE_TAB_GROUP ) { ++(graph->exclusive) ; } else { --(graph->exclusive) ; } } if( (newNavType == XmEXCLUSIVE_TAB_GROUP) || (newNavType == XmSTICKY_TAB_GROUP) ) { if( (curNavType != XmEXCLUSIVE_TAB_GROUP) && (curNavType != XmSTICKY_TAB_GROUP) ) { _XmTabListAdd( graph, new_wid) ; } } else { if( (curNavType == XmEXCLUSIVE_TAB_GROUP) || (curNavType == XmSTICKY_TAB_GROUP) ) { _XmTabListDelete( graph, new_wid) ; } } } if( XtIsRealized( new_wid) && (focusData->focus_policy == XmEXPLICIT) ) { if( graph->num_entries ) { if( ChangeInExclusive ) { /* Since widget has changed to/from exlusive tab group * behavior, need to re-make the traversal graph (as needed). */ _XmFreeTravGraph( graph) ; } else { XmNavigability cur_nav = _XmGetNavigability( current) ; XmNavigability new_nav = _XmGetNavigability( new_wid) ; if( !cur_nav && new_nav ) { /* Newly navigable widget; add it to the * traversal graph. */ _XmTravGraphAdd( graph, new_wid) ; } else { if( cur_nav != new_nav ) { /* Navigability changed; need to re-create the * graph the next time it is needed. */ _XmFreeTravGraph( graph) ; } } } } if( !(focusData->focus_item) ) { Widget shell ; /* CR 5417: Remove (focusData->focalPoint != XmMySelf) test. */ if( XmIsTraversable( new_wid) && (shell = _XmFindTopMostShell( new_wid)) && XmeFocusIsInShell( shell)) { /* Hierarchy currently has no focus, and this widget is * now traversable, so bootstrap the focus for the hierarchy. */ _XmMgrTraversal( shell, XmTRAVERSE_CURRENT) ; } } else { if( (focusData->focus_item == new_wid) && !IsTraversable( new_wid, TRUE) ) { /* The new_wid now has the focus and is no longer * traversable, so traverse away from it to the * next traversable item. */ Widget new_focus = _XmTraverseAway( graph, new_wid, (focusData->active_tab_group != new_wid)) ; if( !new_focus ) { /* Could not find another widget eligible to take * the focus, so use any widget to re-initialize/clear * the focus in the widget hierarchy. */ new_focus = new_wid ; } _XmMgrTraversal( new_focus, XmTRAVERSE_CURRENT) ; if( !XtIsSensitive( new_wid) ) { /* Since widget has become insensitive, it did not * receive the focus-out event. Call the focus * change method directly. */ _XmWidgetFocusChange( new_wid, XmFOCUS_OUT) ; } return TRUE ; } } } } return FALSE ; } void XmeNavigChangeManaged( Widget wid ) { /* This routine must be called from the ChangeManaged method of * all composite widgets that may have traversable children. * This routine checks to see if the focus widget is traversable; * if it is not, then an alternative traversable widget is found * or the focus for the hierarchy is reset to the bootstrap condition. * * This routine also detects the condition for which there is no * focus widget in the hierarchy and a newly managed widget is * now eligible to have the focus; the focus is then initialized. */ XmFocusData focus_data ; _XmWidgetToAppContext(wid); _XmAppLock(app); if( XtIsRealized( wid) && (focus_data = _XmGetFocusData( wid)) && (focus_data->focus_policy == XmEXPLICIT) ) { if( focus_data->focus_item == NULL ) { Widget firstManaged ; if( XtIsShell( wid) ) { if( focus_data->first_focus == NULL ) { focus_data->first_focus = FindFirstFocus( wid) ; } if( (firstManaged = FindFirstManaged( wid)) != NULL ) { /* Set bootstrap trigger for hierarchy that * has no current focus. */ XtSetKeyboardFocus( wid, firstManaged) ; } } } else { /* If the focus widget is being destroyed, do nothing for now. * We need to wait until _XmNavigDestroy is called to initiate * the focus change; if we don't defer selection of the focus * widget, the Intrinsics-generated focus-out event for the * focus widget will go to the newly-selected focus widget * (instead of the widget being destroyed, as intended). */ if( !(focus_data->focus_item->core.being_destroyed) && !IsTraversable( focus_data->focus_item, TRUE) ) { Widget new_focus = _XmTraverseAway( &(focus_data->trav_graph), focus_data->focus_item, (focus_data->active_tab_group != focus_data->focus_item)) ; if( !new_focus ) { new_focus = focus_data->focus_item ; } if(new_focus) _XmMgrTraversal( new_focus, XmTRAVERSE_CURRENT) ; } } } _XmAppUnlock(app); return ; } static Widget FindFirstManaged( Widget wid) { if( XtIsShell( wid) ) { unsigned i = 0 ; while( i < ((CompositeWidget) wid)->composite.num_children ) { if( XtIsManaged( ((CompositeWidget) wid) ->composite.children[i]) ) { return ((CompositeWidget) wid)->composite.children[i] ; } ++i ; } } return NULL ; } void _XmNavigResize( Widget wid) { /* This routine must be called by all composites with (potentially) * traversable children. This is generally handled for all managers * in the resize wrapper routines. * * This routine makes sure that the focus widget is always in view, * either by invoking the XmNtraverseObscurredCallback mechansism * of Scrolled Window or by finding an alternative focus widget. */ XmFocusData focus_data ; if( XtIsRealized( wid) && !XtIsShell( wid) && (focus_data = _XmGetFocusData( wid)) ) { /* If the focus item is being destroyed, do nothing, since this * will be handled more appropriately by _XmNavigDestroy(). */ if( (focus_data->focus_policy == XmEXPLICIT) && ( !(focus_data->focus_item) || !((focus_data->focus_item)->core.being_destroyed)) ) { if( !(focus_data->focus_item) ) { /* Hierarchy has no focus widget; re-initialize/clear the * focus, but only if the parent is a managed shell (to * avoid premature initialization during XtRealizeWidget). */ Widget parent = XtParent( wid) ; Widget firstManaged ; if( parent && XtIsShell( parent) && (firstManaged = FindFirstManaged( parent)) ) { /* Set bootstrap trigger for hierarchy that * has no current focus. */ XtSetKeyboardFocus( wid, firstManaged) ; } } else { if( !IsTraversable( focus_data->focus_item, TRUE) ) { /* Widget is not traversable, either because it is not * viewable or some other reason. Test again, this * time allowing for obscured traversal. * * If it is not traversable regardless of the * XmNtraverseObscuredCallback, or traversal to the * obscured widget fails for some other reason, traverse * away from the non-traversable widget. */ if( !IsTraversable( focus_data->focus_item, FALSE) || !_XmMgrTraversal( focus_data->focus_item, XmTRAVERSE_CURRENT) ) { Widget new_focus = _XmTraverseAway( &(focus_data->trav_graph), focus_data->focus_item, (focus_data->active_tab_group != focus_data->focus_item)) ; if( !new_focus ) { new_focus = focus_data->focus_item ; } if(new_focus) _XmMgrTraversal( new_focus, XmTRAVERSE_CURRENT) ; } } } } } } void _XmValidateFocus( Widget wid ) { XmFocusData focus_data = _XmGetFocusData( wid) ; if( focus_data && (focus_data->focus_policy == XmEXPLICIT) && (focus_data->focus_item != NULL) && !IsTraversable( focus_data->focus_item, TRUE) ) { Widget new_focus = _XmTraverseAway( &(focus_data->trav_graph), focus_data->focus_item, (focus_data->active_tab_group != focus_data->focus_item)) ; if( !new_focus ) { new_focus = wid ; } _XmMgrTraversal( new_focus, XmTRAVERSE_CURRENT) ; } } void _XmNavigDestroy( Widget wid ) { /* This routine is used to keep the traversal data up-to-date with * regards to widgets which are being destroyed. It must be called * by all composites that might have traversable children. The * DeleteChild method for Manager calls this routine, so its * subclasses can explicitly chain to its superclasses DeleteChild * method or call this routine directly. * * In addition to finding a new focus widget if it is being * destroyed, this routine must make sure that there are no * stale pointers to the widget being destroyed in any of its * data structures. */ XmFocusData focusData = _XmGetFocusData( wid) ; if( focusData ) { XmTravGraph trav_list = &(focusData->trav_graph) ; XmNavigationType navType = _XmGetNavigationType( wid) ; if( wid == focusData->first_focus ) { focusData->first_focus = NULL ; } if( navType == XmEXCLUSIVE_TAB_GROUP ) { --(trav_list->exclusive) ; _XmTabListDelete( trav_list, wid) ; } else { if( navType == XmSTICKY_TAB_GROUP ) { _XmTabListDelete( trav_list, wid) ; } } if( focusData->focus_item == wid ) { /* The focus widget for this hierarhcy is being destroyed. * Traverse away if in explicit mode, or just clear the * focus item field. */ Widget new_focus ; if( (focusData->focus_policy != XmEXPLICIT) || ( !(new_focus = _XmTraverseAway( trav_list, focusData->focus_item, (focusData->active_tab_group != wid))) && !(new_focus = _XmFindTopMostShell( wid))) || !_XmMgrTraversal( new_focus, XmTRAVERSE_CURRENT) ) { focusData->focus_item = NULL ; } } if( focusData->trav_graph.num_entries ) { _XmTravGraphRemove( trav_list, wid) ; } if( focusData->active_tab_group == wid ) { focusData->active_tab_group = NULL ; } if( focusData->old_focus_item == wid ) { focusData->old_focus_item = NULL ; } if( focusData->pointer_item == wid ) { focusData->pointer_item = NULL ; } } return ; } static Boolean CallFocusMoved(Widget old, Widget new_wid, XEvent *event, XmTraversalDirection direction) { Widget w ; Widget topShell ; XtCallbackList callbacks ; Boolean contin = TRUE ; if (old) w = old; else /* if (new_wid) -- if there's no w assignment we're in big trouble! */ w = new_wid; topShell = (Widget) _XmFindTopMostShell(w); /* * make sure it's a shell that has a vendorExt object */ if (XmIsVendorShell(topShell)) { XmWidgetExtData extData; XmVendorShellExtObject vendorExt; extData = _XmGetWidgetExtData(topShell, XmSHELL_EXTENSION); if(extData==NULL) return (contin); if ((vendorExt = (XmVendorShellExtObject) extData->widget) != NULL) { if ((callbacks = vendorExt->vendor.focus_moved_callback) != NULL) { XmFocusMovedCallbackStruct callData; callData.reason = XmCR_FOCUS_MOVED; callData.event = event; callData.cont = True; callData.old_focus = old; callData.new_focus = new_wid; callData.focus_policy = vendorExt->vendor.focus_policy; callData.direction = direction; _XmCallCallbackList((Widget) vendorExt, callbacks, (XtPointer) &callData); contin = callData.cont ; } } } return( contin) ; } Boolean _XmCallFocusMoved( Widget old, Widget new_wid, XEvent *event ) { return CallFocusMoved(old, new_wid, event, XmTRAVERSE_CURRENT); } Boolean _XmMgrTraversal( Widget wid, XmTraversalDirection direction) { /* This routine is the workhorse for all traversal activities. */ Widget top_shell ; Widget old_focus ; Widget new_focus ; Widget new_active_tab ; XmFocusData focus_data; XmTravGraph trav_list ; Boolean rtnVal = FALSE ; XmTraversalDirection local_dir; XmDisplay dd = (XmDisplay)XmGetXmDisplay(XtDisplay(wid)); #define traversal_in_progress \ ((XmDisplayInfo *)(dd->display.displayInfo))->traversal_in_progress if( traversal_in_progress || !(top_shell = _XmFindTopMostShell( wid)) || top_shell->core.being_destroyed || !(focus_data = _XmGetFocusData( wid)) || (focus_data->focus_policy != XmEXPLICIT) ) { return FALSE ; } traversal_in_progress = TRUE ; /* Recursive traversal calls can sometimes be generated during * the handling of focus events and associated callbacks. * In this version of Motif, recursive calls always fail. * * Future enhancements could include the addition of a queue * for recursive calls; these calls would then be serviced on * a FIFO basis following the completion of the initial traversal * processing. Sequential FIFO processing is essential for * providing a consistent and predicable environment for * focus change callbacks and event processing. */ trav_list = &(focus_data->trav_graph) ; old_focus = focus_data->focus_item ; if( (old_focus == NULL) && (wid == top_shell) && focus_data->first_focus && IsTraversable( focus_data->first_focus, TRUE) ) { new_focus = focus_data->first_focus ; if (direction == XmTRAVERSE_GLOBALLY_FORWARD) local_dir = XmTRAVERSE_NEXT_TAB_GROUP; else if (direction == XmTRAVERSE_GLOBALLY_BACKWARD) local_dir = XmTRAVERSE_PREV_TAB_GROUP; else local_dir = direction; } else { new_focus = _XmTraverse(trav_list, direction, &local_dir, wid) ; } new_focus = RedirectTraversal(old_focus, new_focus, focus_data->focus_policy, local_dir, 0); if( new_focus && (new_focus == old_focus) && focus_data->old_focus_item ) { /* When traversal does not cause the focus to change * to a different widget, focus-change events should * not be generated. The old_focus_item will be NULL * when the focus is moving into this shell hierarchy * from a different shell; in this case, focus-in * events should be generated below. */ rtnVal = TRUE ; } else if( new_focus && (new_active_tab = XmGetTabGroup( new_focus)) && CallFocusMoved(old_focus, new_focus, NULL, local_dir) && CallTraverseObsured(new_focus, local_dir)) { /* Set the keyboard focus in two steps; first to None, then * to the new focus widget. This will cause appropriate * focus-in and focus-out events to be generated, even if * the focus change is between two gadgets. * * Note that XtSetKeyboardFocus() generates focus change * events "in-line", so focus data and manager active_child * fields are not updated until after the focus-out events have * been generated and dispatched to the current focus item. * * The FocusResetFlag is used to tell event actions procs to * ignore any focus-in event that might be generated by the * window manager (which won't like the fact that there the * focus is now going to point to nobody). */ _XmSetFocusFlag( top_shell, XmFOCUS_RESET, TRUE) ; XtSetKeyboardFocus( top_shell, None) ; _XmSetFocusFlag( top_shell, XmFOCUS_RESET, FALSE) ; _XmClearFocusPath( old_focus) ; focus_data->active_tab_group = new_active_tab ; if( (new_active_tab != new_focus) && XmIsManager( new_active_tab) ) { XmManagerWidget manager = (XmManagerWidget) new_active_tab; manager->manager.active_child = new_focus; } if( (new_active_tab != XtParent( new_focus)) /* Set above. */ && XmIsManager( XtParent( new_focus)) ) { XmManagerWidget manager = (XmManagerWidget) XtParent(new_focus); manager->manager.active_child = new_focus ; } focus_data->focus_item = new_focus ; focus_data->old_focus_item = old_focus ? old_focus : new_focus ; /* Setting the focus data and manager active_child fields enables * focus-in events to be propagated to the new focus widget. */ XtSetKeyboardFocus( top_shell, new_focus) ; rtnVal = TRUE ; } else { /* Have failed to traverse to a new widget focus widget. * If the current focus widget is no longer traversable, * then reset focus data to its bootstrap state. */ if( !old_focus || !IsTraversable( old_focus, TRUE) ) { Widget firstManaged = FindFirstManaged( top_shell) ; _XmSetFocusFlag( top_shell, XmFOCUS_RESET, TRUE) ; XtSetKeyboardFocus( top_shell, firstManaged) ; _XmSetFocusFlag( top_shell, XmFOCUS_RESET, FALSE) ; _XmClearFocusPath( old_focus) ; _XmFreeTravGraph( trav_list) ; } } if( trav_list->num_entries && (focus_data->focalPoint == XmUnrelated) && ( XmIsVendorShell( top_shell) || !XmeFocusIsInShell( top_shell)) ) { /* Free the graversal graph whenever the focus is out of this * shell hierarchy, so memory use is limited to one traversal * graph per display. Since VendorShell has a handler which * tracks the input focus, all we need to do is look at the * focusData field. For MenuShell and others, we need to go * through the X server to find out where the focus is. * * Note the logic of the above conditional; VendorShell is the * only shell class that maintains the focalPoint field of the * focus data. So, if its a VendorShell and focalPoint says * "unrelated", we have the answer; any other shell and we need * to call the generic focus test routine. */ _XmFreeTravGraph( trav_list) ; } traversal_in_progress = FALSE ; return rtnVal ; } static Boolean CallTraverseObsured( Widget new_focus, XmTraversalDirection dir) { Widget prev; Widget ancestor = new_focus; XRectangle focus_rect; /* Area we're trying to make visible. */ XRectangle clip_rect; /* Area a given ancestor obscures. */ XRectangle view_rect; /* Temporary intersection of the two. */ XmTraverseObscuredCallbackStruct call_data; call_data.reason = XmCR_OBSCURED_TRAVERSAL; call_data.event = NULL; call_data.traversal_destination = new_focus; call_data.direction = dir; _XmSetRect(&focus_rect, new_focus); /* Look for ancestors that clip this window. */ for (prev = ancestor; ((ancestor = XtParent(ancestor)) != NULL) && !XtIsShell(ancestor); prev = ancestor) { /* CR 9705: Special case overlapping work windows. */ if (!_XmIsScrollableClipWidget(ancestor, False, &clip_rect)) _XmSetRect(&clip_rect, ancestor); if (!_XmIntersectionOf(&focus_rect, &clip_rect, &view_rect) || (view_rect.width != focus_rect.width) || (view_rect.height != focus_rect.height)) { /* This ancestor clips somebody. */ Widget sw = _XmIsScrollableClipWidget(prev, True, &focus_rect); if (sw != NULL) { XtCallbackList callbacks = ((XmScrolledWindowWidget) sw) ->swindow.traverseObscuredCallback; XtCallCallbackList(sw, callbacks, (XtPointer) &call_data); ancestor = sw; } else { _XmIntersectRect(&focus_rect, ancestor, &focus_rect); } } } return IsTraversable( new_focus, TRUE); } void _XmClearFocusPath( Widget wid ) { /* This routine should be called whenever the focus of a shell * hierarchy needs to be reset to the bootstrap condition. * * This routine clears the active_child field of all manager * widget ancestors of the widget argument, and clears other * focus widget fields of the focus data record. The clearing * of the old_focus_item field indicates to the traversal code * that the focus is not in this shell hierarchy. */ XmFocusData focus_data ; while( wid && !XtIsShell( wid) ) { if( XmIsManager( wid) ) { ((XmManagerWidget) wid)->manager.active_child = NULL ; } wid = XtParent( wid) ; } if( (focus_data = _XmGetFocusData( wid)) != NULL ) { focus_data->focus_item = NULL ; focus_data->old_focus_item = NULL ; focus_data->active_tab_group = NULL ; } } Boolean _XmFocusIsHere( Widget w ) { XmFocusData focus_data; Widget item; if ((focus_data = _XmGetFocusData( w)) && (item = focus_data->focus_item)) { for (; !XtIsShell(item); item = XtParent(item)) if (item == w) return True; } return(False); } unsigned char _XmGetFocusPolicy( Widget w ) { Widget topmost_shell ; /* Find the topmost shell widget */ topmost_shell = _XmFindTopMostShell( w) ; if( XtIsVendorShell( topmost_shell) ) { XmWidgetExtData xwed = _XmGetWidgetExtData(topmost_shell, XmSHELL_EXTENSION); if(xwed == NULL) return(XmPOINTER); return (((XmVendorShellExtObject) (xwed)->widget) ->vendor.focus_policy) ; } else { if( XmIsMenuShell( topmost_shell) ) { return( ((XmMenuShellWidget) topmost_shell)->menu_shell.focus_policy); } } return( XmPOINTER) ; } Widget _XmFindTopMostShell( Widget w ) { while( w && !XtIsShell( w) ) { w = XtParent( w) ; } return( w) ; } /*ARGSUSED*/ void _XmFocusModelChanged( Widget wid, XtPointer client_data, /* unused */ XtPointer call_data ) { /* Invoked by the VendorShell widget, when the focus_policy changes. * Registered as a callback by both the Manager and Primitive classes, * when the parent is a VendorShell widget. */ unsigned char new_focus_policy = (unsigned char)(unsigned long) call_data ; Widget shell = _XmFindTopMostShell( wid) ; XmFocusData focus_data = _XmGetFocusData( shell) ; if( focus_data ) { if( new_focus_policy == XmEXPLICIT ) { Widget new_item = focus_data->pointer_item ; if( new_item != NULL ) { if( XmIsManager( new_item) && (((XmManagerWidget) new_item) ->manager.highlighted_widget != NULL) ) { new_item = ((XmManagerWidget) new_item) ->manager.highlighted_widget ; } _XmWidgetFocusChange( new_item, XmLEAVE) ; } if( (new_item == NULL) || !_XmMgrTraversal( new_item, XmTRAVERSE_CURRENT) ) { _XmMgrTraversal( shell, XmTRAVERSE_CURRENT) ; } } else /* new_focus_policy == XmPOINTER */ { if( focus_data->focus_item ) { Widget firstManaged = FindFirstManaged( shell) ; _XmWidgetFocusChange( focus_data->focus_item, XmFOCUS_OUT) ; _XmClearFocusPath( focus_data->focus_item) ; _XmSetFocusFlag( shell, XmFOCUS_RESET, TRUE) ; XtSetKeyboardFocus( shell, firstManaged) ; _XmSetFocusFlag( shell, XmFOCUS_RESET, FALSE) ; } _XmFreeTravGraph( &(focus_data->trav_graph)) ; } } } XmFocusData _XmGetFocusData (Widget wid) { /* This function returns a pointer to the focus data associated with the * topmost shell. This allows us to treat the location opaquely. */ while (wid && !XtIsShell (wid)) { wid = XtParent (wid); } if (wid && !(wid->core.being_destroyed)) { if (XmIsVendorShell (wid)) { XmWidgetExtData xwed = _XmGetWidgetExtData (wid, XmSHELL_EXTENSION); XmVendorShellExtObject vse; if (xwed == NULL) return NULL; vse = (XmVendorShellExtObject) xwed->widget; if (vse && vse->vendor.focus_data) { vse->vendor.focus_data->focus_policy = vse->vendor.focus_policy; return vse->vendor.focus_data; } } else { if (XmIsMenuShell (wid) && ((XmMenuShellWidget) wid)->menu_shell.focus_data) { ((XmMenuShellWidget) wid)->menu_shell.focus_data-> focus_policy = ((XmMenuShellWidget) wid)->menu_shell.focus_policy; return ((XmMenuShellWidget) wid)->menu_shell.focus_data; } } } return NULL; } Boolean _XmComputeVisibilityRect(Widget w, XRectangle *rectPtr, Boolean include_initial_border, Boolean allow_scrolling) { /* This function will generate a rectangle describing the portion of * the specified widget which is not clipped by any of its ancestors. * It also verifies that the ancestors are both managed and * mapped_when_managed. * * It will return TRUE if the rectangle returned in rectPtr has a * non-zero area; it will return FALSE if the widget is not visible. * * If allow_scrolling is set and w is the work area child of an * automatic scrolled window with a non-null XmNtraverseObscuredCallback, * then the clip window is used as the initial rectangle for w. */ Widget sw; if (!_XmIsViewable(w)) { _XmClearRect(rectPtr); return False; } if (allow_scrolling && w && XtParent(w) && ((sw = _XmIsScrollableClipWidget(w, True, rectPtr)) != NULL)) { w = sw; if (!_XmIsViewable(w)) { _XmClearRect(rectPtr); return False; } } else { _XmSetRect(rectPtr, w); } if (include_initial_border) { int border = XtBorderWidth(w); rectPtr->x -= border; rectPtr->y -= border; rectPtr->width += 2 * border; rectPtr->height += 2 * border; } /* Process all widgets, excluding the shell widget. */ while (((w = XtParent(w)) != NULL) && !XtIsShell(w)) { if (!_XmIsViewable(w) || !_XmIntersectRect(rectPtr, w, rectPtr)) { _XmClearRect(rectPtr); return False; } } return True; } Boolean _XmGetPointVisibility(Widget w, int root_x, int root_y) { /* Compute whether a point is really visible inside a widget. */ XRectangle rect; if (_XmComputeVisibilityRect(w, &rect, TRUE, FALSE)) { return ((root_x >= rect.x) && (root_x < rect.x + (int)rect.width) && (root_y >= rect.y) && (root_y < rect.y + (int)rect.height)); } return False; } void _XmSetRect( register XRectangle *rect, Widget w ) { /* Initialize the rectangle structure to the specified values. * The widget must be realized. */ Position x, y; XtTranslateCoords(XtParent(w), w->core.x, w->core.y, &x, &y); rect->x = x + w->core.border_width; rect->y = y + w->core.border_width; rect->width = w->core.width; rect->height = w->core.height; } int _XmIntersectRect( register XRectangle *srcRectA, register Widget widget, register XRectangle *dstRect ) { /* Intersects the specified rectangle with the rectangle describing the * passed-in widget. Returns True if they intersect, or False if they * do not. */ XRectangle srcRectB; _XmSetRect(&srcRectB, widget); return( (int) _XmIntersectionOf( srcRectA, &srcRectB, dstRect)) ; } int _XmEmptyRect( register XRectangle *r ) { if (r->width <= 0 || r->height <= 0) return (TRUE); return (FALSE); } void _XmClearRect( register XRectangle *r ) { r->x = 0; r->y = 0; r->width = 0; r->height = 0; } Boolean _XmIsNavigable( Widget wid) { XmNavigability nav = _XmGetNavigability( wid) ; if( (nav != XmTAB_NAVIGABLE) && (nav != XmCONTROL_NAVIGABLE) ) { return FALSE ; } while( (wid = XtParent( wid)) && !XtIsShell( wid) ) { if( !_XmGetNavigability( wid) ) { return FALSE ; } } return TRUE ; } void _XmWidgetFocusChange( Widget wid, XmFocusChange change) { XmBaseClassExt *er ; if( XtIsRectObj( wid) && !wid->core.being_destroyed ) { if( (er = _XmGetBaseClassExtPtr( XtClass( wid), XmQmotif)) && (*er) && ((*er)->version >= XmBaseClassExtVersion) && (*er)->focusChange ) { (*((*er)->focusChange))( wid, change) ; } else { /* From here on is compatibility code. */ WidgetClass wc ; if( XmIsPrimitive( wid) ) { wc = (WidgetClass) &xmPrimitiveClassRec ; } else if( XmIsGadget( wid) ) { wc = (WidgetClass) &xmGadgetClassRec ; } else if( XmIsManager( wid) ) { wc = (WidgetClass) &xmManagerClassRec ; } else { wc = NULL ; } if( wc && (er = _XmGetBaseClassExtPtr( wc, XmQmotif)) && (*er) && ((*er)->version >= XmBaseClassExtVersion) && (*er)->focusChange ) { (*((*er)->focusChange))( wid, change) ; } } } return ; } Widget _XmNavigate( Widget wid, XmTraversalDirection direction ) { XmTraversalDirection local_dir; XmFocusData focus_data; Widget nav_wid = NULL ; Widget shell = _XmFindTopMostShell( wid) ; if( (focus_data = _XmGetFocusData( shell)) && (focus_data->focus_policy == XmEXPLICIT) ) { XmTravGraph trav_list = &(focus_data->trav_graph) ; nav_wid = _XmTraverse( trav_list, direction, &local_dir, wid) ; nav_wid = RedirectTraversal(focus_data->focus_item, nav_wid, focus_data->focus_policy, local_dir, 0); if( trav_list->num_entries && (focus_data->focalPoint == XmUnrelated) && ( XmIsVendorShell( shell) || !XmeFocusIsInShell( shell)) ) { _XmFreeTravGraph( trav_list) ; } } return nav_wid ; } void _XmSetInitialOfTabGroup( Widget tab_group, Widget init_focus) { XmFocusData focus_data ; if( XmIsManager( tab_group) ) { ((XmManagerWidget) tab_group)->manager.initial_focus = init_focus ; } if( (focus_data = _XmGetFocusData( tab_group)) && focus_data->trav_graph.num_entries ) { _XmSetInitialOfTabGraph( &(focus_data->trav_graph), tab_group, init_focus) ; } } static Boolean IsTraversable( Widget wid, Boolean require_in_view) { if( wid && _XmIsNavigable( wid) ) { if( require_in_view ) { return (XmGetVisibility( wid) != XmVISIBILITY_FULLY_OBSCURED) ; } else { /* _XmGetEffectiveView() returns the view port in * which the widget could be viewed through the use * of the XmNtraverseObscuredCallback of ScrolledWindow. */ XRectangle visRect ; return _XmGetEffectiveView( wid, &visRect) ; } } return FALSE ; } void _XmResetTravGraph( Widget wid) { XmFocusData focus_data = _XmGetFocusData( wid) ; if( focus_data && focus_data->trav_graph.num_entries ) { _XmFreeTravGraph( &(focus_data->trav_graph)) ; } } Boolean XmeFocusIsInShell( Widget wid) { Window focus ; Widget focus_wid ; Widget shell_of_wid = _XmFindTopMostShell( wid) ; XmFocusData focus_data ; int revert ; _XmWidgetToAppContext(wid); _XmAppLock(app); if( XmIsVendorShell( shell_of_wid) && (focus_data = _XmGetFocusData( shell_of_wid)) ) { if( focus_data->focalPoint != XmUnrelated ) { _XmAppUnlock(app); return TRUE ; } } else { XGetInputFocus( XtDisplay( shell_of_wid), &focus, &revert) ; if( (focus != PointerRoot) && (focus != None) && (focus_wid = XtWindowToWidget( XtDisplay( shell_of_wid), focus)) && (shell_of_wid == _XmFindTopMostShell( focus_wid)) ) { _XmAppUnlock(app); return TRUE ; } } _XmAppUnlock(app); return FALSE ; } Boolean _XmShellIsExclusive( Widget wid) { XmFocusData focusData = _XmGetFocusData( wid) ; if( focusData && focusData->trav_graph.exclusive ) { return TRUE ; } return FALSE ; } static Widget FindFirstFocus( Widget wid) { Widget shell = _XmFindTopMostShell( wid) ; return _XmNavigate( shell, XmTRAVERSE_CURRENT) ; } Widget _XmGetFirstFocus( Widget wid) { XmFocusData focus_data = _XmGetFocusData( wid) ; if( focus_data ) { if( focus_data->focus_item ) { return focus_data->focus_item ; } else { if( focus_data->first_focus == NULL ) { focus_data->first_focus = FindFirstFocus( wid) ; } return focus_data->first_focus ; } } return NULL ; } /******************* * Public procedures *******************/ Boolean XmIsTraversable( Widget wid) { Boolean traversable; _XmWidgetToAppContext(wid); _XmAppLock(app); traversable = IsTraversable( wid, FALSE) ; _XmAppUnlock(app); return traversable; } XmVisibility XmGetVisibility( Widget wid) { XRectangle rect ; Window rootwindow, parent_window, p_window, *children; unsigned int numchildren; int i; Window *windowptr; _XmWidgetToAppContext(wid); _XmAppLock(app); if( !wid || !_XmComputeVisibilityRect(wid, &rect, FALSE, TRUE) ) { _XmAppUnlock(app); return( XmVISIBILITY_FULLY_OBSCURED) ; } if( (rect.width != XtWidth( wid)) || (rect.height != XtHeight( wid)) ) { _XmAppUnlock(app); return( XmVISIBILITY_PARTIALLY_OBSCURED) ; } /* Obscurity by siblings */ children = NULL; if (!(parent_window = XtWindow(XtParent(wid))) || XQueryTree( XtDisplay(wid), parent_window, &rootwindow, &p_window, &children, &numchildren ) == 0) { if (children) XFree(children); _XmAppUnlock(app); return( XmVISIBILITY_UNOBSCURED) ; } windowptr = children; /* walk through those which are under the window of interest */ for ( i = 0; i < numchildren; i++ ) { if ( *windowptr == XtWindow(wid)) { break; } windowptr++; } i++; windowptr++; /* process windows above the window of interest */ if(i < numchildren) { XRectangle parent_rect, srcRectB, intersect_rect; XWindowAttributes window_attributes_return; Region region = XCreateRegion(); Region tmp_region = XCreateRegion(); Region left_region = XCreateRegion(); XmVisibility value; XUnionRectWithRegion(&rect, region, region); while(i < numchildren) { XGetWindowAttributes(XtDisplay(wid), *windowptr, &window_attributes_return); if(window_attributes_return.map_state == IsViewable) { _XmSetRect(&parent_rect, XtParent(wid)); srcRectB.x = parent_rect.x + window_attributes_return.x + window_attributes_return.border_width; srcRectB.y = parent_rect.y + window_attributes_return.y + window_attributes_return.border_width; srcRectB.width = window_attributes_return.width; srcRectB.height = window_attributes_return.height; /* accumulate all the region covered by siblings */ if(_XmIntersectionOf( &rect, &srcRectB, &intersect_rect)) { XUnionRectWithRegion(&intersect_rect, tmp_region, tmp_region); } } i++; windowptr++; } XSubtractRegion(region, tmp_region, left_region); if(XEqualRegion(region, left_region)) { value = XmVISIBILITY_UNOBSCURED; } else if(XEmptyRegion(left_region)) { value = XmVISIBILITY_FULLY_OBSCURED; } else { value = XmVISIBILITY_PARTIALLY_OBSCURED; } XDestroyRegion(region); XDestroyRegion(tmp_region); XDestroyRegion(left_region); if (children) XFree(children); _XmAppUnlock(app); return (value); } XFree((Window*)children); _XmAppUnlock(app); return( XmVISIBILITY_UNOBSCURED) ; } Widget XmGetTabGroup( Widget wid) { XmFocusData focus_data ; Boolean exclusive ; _XmWidgetToAppContext(wid); _XmAppLock(app); if( !wid || (_XmGetFocusPolicy( wid) != XmEXPLICIT) || !(focus_data = _XmGetFocusData( wid)) ) { _XmAppUnlock(app); return( NULL) ; } exclusive = !!(focus_data->trav_graph.exclusive) ; do { XmNavigationType nav_type = _XmGetNavigationType( wid) ; if( (nav_type == XmSTICKY_TAB_GROUP) || (nav_type == XmEXCLUSIVE_TAB_GROUP) || ( (nav_type == XmTAB_GROUP) && !exclusive) ) { _XmAppUnlock(app); return( wid) ; } } while( (wid = XtParent( wid)) && !XtIsShell( wid) ) ; _XmAppUnlock(app); return wid ; } Widget XmGetFocusWidget( Widget wid) { Widget focus_wid = NULL ; XmFocusData focus_data = _XmGetFocusData( wid) ; _XmWidgetToAppContext(wid); _XmAppLock(app); if( focus_data != NULL ) { if( focus_data->focus_policy == XmEXPLICIT ) { focus_wid = focus_data->focus_item ; } else { focus_wid = focus_data->pointer_item ; if( (focus_wid != NULL) && XmIsManager( focus_wid) && (((XmManagerWidget) focus_wid) ->manager.highlighted_widget != NULL) ) { focus_wid = ((XmManagerWidget) focus_wid) ->manager.highlighted_widget ; } } } _XmAppUnlock(app); return focus_wid ; } Boolean XmProcessTraversal( Widget w, XmTraversalDirection dir) { XmFocusData focus_data ; Boolean ret_val = FALSE; if ( w ) { _XmWidgetToAppContext(w); _XmAppLock(app); if( (focus_data = _XmGetFocusData( w)) && (focus_data->focus_policy == XmEXPLICIT) ) { if( dir != XmTRAVERSE_CURRENT ) { if( focus_data->focus_item ) { w = focus_data->focus_item ; } else { w = _XmFindTopMostShell( w) ; } } ret_val = _XmMgrTraversal( w, dir) ; } _XmAppUnlock(app); } return ret_val; } void XmAddTabGroup( Widget tabGroup ) { Arg arg; XtSetArg(arg, XmNnavigationType, XmEXCLUSIVE_TAB_GROUP); XtSetValues(tabGroup, &arg, 1); } void XmRemoveTabGroup( Widget w ) { Arg arg; XtSetArg(arg, XmNnavigationType, XmNONE); XtSetValues(w, &arg, 1); } /* * Invoke the traversal redirection trait for all ancestors of both * old_focus and new_focus. Repeat until concensus is achieved. */ static Widget RedirectTraversal(Widget old_focus, Widget new_focus, unsigned int focus_policy, XmTraversalDirection direction, unsigned int pass) { XmTraversalControlTrait trav_trait; Widget proposal = new_focus; Widget parent; /* Try not to get into an infinite loop. */ if (pass >= 255) { assert(FALSE); return NULL; } /* Check ancestors of the old focus. */ for (parent = old_focus; parent != NULL; parent = XtParent(parent)) { trav_trait = (XmTraversalControlTrait) XmeTraitGet((XtPointer) XtClass(parent), XmQTtraversalControl); if (trav_trait && trav_trait->redirect) { proposal = trav_trait->redirect(old_focus, new_focus, focus_policy, direction, pass); if (proposal != new_focus) return RedirectTraversal(old_focus, proposal, focus_policy, direction, pass + 1); } } /* Check ancestors of the new focus. */ for (parent = new_focus; parent != NULL; parent = XtParent(parent)) { trav_trait = (XmTraversalControlTrait) XmeTraitGet((XtPointer) XtClass(parent), XmQTtraversalControl); if (trav_trait && trav_trait->redirect) { proposal = trav_trait->redirect(old_focus, new_focus, focus_policy, direction, pass); if (proposal != new_focus) return RedirectTraversal(old_focus, proposal, focus_policy, direction, pass + 1); } } /* Nobody changed our mind. */ return new_focus; } motif-2.3.8/lib/Mrm/0000755000175000017500000000000013211513005011133 500000000000000motif-2.3.8/lib/Mrm/Mrmlread.c0000644000175000017500000005663513145162623013015 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmlread.c /main/16 1996/11/13 14:02:28 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains the literal read routines. All these routines * read a literal from a hierarchy or IDB file into a resource context. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmosI.h" #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * UrmGetIndexedLiteral Read indexed literal from IDB file * * UrmGetRIDLiteral Read RID literal from IDB file * * UrmHGetIndexedLiteral Read indexed literal from hierarchy * */ /* *++ * * PROCEDURE DESCRIPTION: * * This routine is a service routine for the various XmFetch...Literal * routine. It fetches a literal into a context. It also fetches any * other literals which are referenced. * * FORMAL PARAMETERS: * * hierarchy_id id of an open hierarchy containing the literal * index index of the desired literal * context_id context in which to return literal. Literal will * be fixed up. * ctxlist list of other contexts created (if needed) * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal Urm__FetchLiteral (MrmHierarchy hierarchy_id, String index, URMResourceContextPtr context_id, URMPointerListPtr *ctxlist) { /* * Local variables */ Cardinal result; /* function results */ IDBFile file_id = NULL; /* file containing literal */ long val; /* literal value */ MrmType type; /* literal type */ char err_msg[300]; /* for error messages */ Boolean swap_needed = FALSE ; /* * read the literal into the context */ result = Urm__HGetIndexedLiteral (hierarchy_id, index, context_id, &file_id); if ( result != MrmSUCCESS ) { sprintf (err_msg, _MrmMMsg_0042, index); return Urm__UT_Error ("Urm__FetchLiteral", err_msg, NULL, NULL, result); } swap_needed = UrmRCByteSwap(context_id) ; /* * Acquire the literal type and value, and do any fixups which are required. */ val = (long) UrmRCBuffer (context_id); type = UrmRCType (context_id); switch ( type ) { case MrmRtypeIconImage: UrmPlistInit (10, ctxlist); result = Urm__CW_LoadIconImage ((RGMIconImagePtr)val, (XtPointer)val, hierarchy_id, file_id, *ctxlist); /* LoadIconImage checks validations and handle swapping */ swap_needed = FALSE ; break; case MrmRtypeFontList: /* Check for old style font list, allocate new value if necessary. */ if (strcmp(file_id->db_version, URM1_1version) <= 0) { int count = ((OldRGMFontListPtr)val)->count; RGMFontListPtr fontlist = (RGMFontListPtr) XtMalloc(sizeof(RGMFontList) + (sizeof(RGMFontItem) * (count - 1))); Urm__CW_FixupValue ((long)fontlist, type, (XtPointer)val, file_id, &swap_needed); XtFree((char *)val); UrmRCBuffer(context_id) = (char *)fontlist; } else Urm__CW_FixupValue (val, type, (XtPointer)val, file_id, &swap_needed); break; case MrmRtypeInteger: case MrmRtypeBoolean: if ( swap_needed ) { swapbytes( (*(int *)UrmRCBuffer (context_id)) ); swap_needed = FALSE ; } break; case MrmRtypeSingleFloat: if ( swap_needed ) { swapbytes( (*(int *)UrmRCBuffer (context_id)) ); swap_needed = FALSE ; } _MrmOSIEEEFloatToHost( (float *)UrmRCBuffer (context_id)); break; case MrmRtypeFloat: if ( swap_needed ) { swapdouble( (*(double *)UrmRCBuffer (context_id)) ); swap_needed = FALSE ; } _MrmOSIEEEDoubleToHost( (double *)UrmRCBuffer (context_id)); break; default: Urm__CW_FixupValue (val, type, (XtPointer)val, file_id, &swap_needed); break; } UrmRCSetByteSwap(context_id, swap_needed); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine reads and returns the value of a literal (named value) * stored as a public resource in a single UID file. It returns a * pointer to value of the literal, fixed up and converted for * use as a toolkit argument. The return is always a pointer -- an * integer is returned as a pointer to an integer, and a string is * returned as a pointer to a string. The caller is responsible for * freeing the literal's storage, which was acquired with XtMalloc. * * This routine should not be used for fetching icon or color literals, * as more information is required for converting them. If fetched, * an error is returned. * * FORMAL PARAMETERS: * * hierarchy_id id of an open hierarchy containing the literal * index index of the desired literal * value_return to return pointer to literal value * type_return will be set to the literal data type, from RGMrType... * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS - literal found and returned * MrmWRONG_TYPE - unsupported literal type encountered * MrmNOT_FOUND - literal not found * MrmFAILURE - file system error * * SIDE EFFECTS: * *-- */ Cardinal MrmFetchLiteral (MrmHierarchy hierarchy_id, String index, Display *display, XtPointer *value_return, MrmCode *type_return) { /* * Local variables */ Cardinal result; /* function results */ URMResourceContextPtr context_id; /* for the literal */ URMPointerListPtr ctxlist = NULL; /* save added contexts */ Cardinal ndx; /* loop index */ int vec_size = 0; int vec_count = 0; _MrmDisplayToAppContext(display); _MrmAppLock(app); _MrmProcessLock(); /* * Read the literal, discard the context, and return. */ UrmGetResourceContext ((char *(*)())NULL, (void(*)())NULL, 0, &context_id); result = Urm__FetchLiteral (hierarchy_id, index, context_id, &ctxlist); if ( result == MrmSUCCESS ) { *value_return = (XtPointer) UrmRCBuffer (context_id); (*type_return) = (MrmCode) UrmRCType (context_id); vec_size = UrmRCSize (context_id); switch ( *type_return ) { case MrmRtypeIconImage: case MrmRtypeColor: case MrmRtypeColorTable: case MrmRtypeXBitmapFile: if ( ctxlist != NULL ) { for ( ndx=0 ; ndxcount; result = Urm__CW_ConvertValue (NULL, (long*)value_return, (MrmType)*type_return, 0, display, hierarchy_id, NULL) ; if ( result != MrmSUCCESS ) { _MrmAppUnlock(app); _MrmProcessUnlock(); return MrmFAILURE; } Urm__CW_SafeCopyValue ((long *)value_return, (MrmType)*type_return, NULL, vec_count, vec_size); UrmFreeResourceContext (context_id); break; case MrmRtypeIntegerVector: /* ** Do necessary conversions (Fixups were done by Urm__FetchLiteral) */ vec_count = ((RGMIntegerVectorPtr)*value_return)->count; vec_size = vec_count * sizeof ( int * ); result = Urm__CW_ConvertValue (NULL, (long*)value_return, (MrmType)*type_return, 0, display, hierarchy_id, NULL) ; if ( result != MrmSUCCESS ) { _MrmAppUnlock(app); _MrmProcessUnlock(); return MrmFAILURE; } Urm__CW_SafeCopyValue ((long *)value_return, (MrmType)*type_return, NULL, vec_count, vec_size); UrmFreeResourceContext (context_id); break; default : /* ** Do necessary conversions (Fixups were done by Urm__FetchLiteral) */ result = Urm__CW_ConvertValue (NULL, (long*)value_return, (MrmType)*type_return, 0, display, hierarchy_id, NULL) ; switch ( *type_return ) { /* * Free the context id AND the buffer in these cases */ case MrmRtypeTransTable: case MrmRtypeClassRecName: case MrmRtypeKeysym: UrmFreeResourceContext (context_id); break; default: /* * Only free the context id in all other cases */ (*(context_id->free_func)) (context_id) ; break; } if ( result != MrmSUCCESS ) { _MrmAppUnlock(app); _MrmProcessUnlock(); return MrmFAILURE; } break; } _MrmAppUnlock(app); _MrmProcessUnlock(); return MrmSUCCESS; } else { (*(context_id->free_func)) (context_id) ; _MrmAppUnlock(app); _MrmProcessUnlock(); return result; } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine fetches an icon literal from a hierarchy. It converts * the icon to an X pixmap. * * FORMAL PARAMETERS: * * hierarchy_id id of an open hierarchy containing the literal * index index of the desired literal * screen screen to use for pixmap * display display to use for pixmap * fgpix foreground color for pixmap * bgpix background color for pixmap * pixmap_return to return resulting X pixmap * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal MrmFetchIconLiteral (MrmHierarchy hierarchy_id, String index, Screen *screen, Display *display, Pixel fgpix, Pixel bgpix, Pixmap *pixmap_return) { /* * Local variables */ Cardinal result; /* function results */ URMResourceContextPtr context_id; /* for the literal */ URMPointerListPtr ctxlist = NULL; /* save added contexts */ Cardinal ndx; /* loop index */ MrmType type; _MrmDisplayToAppContext(display); _MrmAppLock(app); _MrmProcessLock(); /* * Read the literal, and deal with errors */ UrmGetResourceContext ((char *(*)())NULL, (void(*)())NULL, 0, &context_id); result = Urm__FetchLiteral (hierarchy_id, index, context_id, &ctxlist); if ( result == MrmSUCCESS ) { type = UrmRCType(context_id); } else { if ( ctxlist != NULL ) { for ( ndx=0 ; ndxwidth; *height = icon->height; break; /* >>> Andy research here if we can do this for a depth of 1 case MrmRtypeXBitmapFile: result = Urm__CW_ReadBitmapFile (UrmRCBuffer(context_id), screen, fgpix, bgpix, pixmap_return); break; */ default: result = MrmWRONG_TYPE; } if ( ctxlist != NULL ) { for ( ndx=0 ; ndxdesc_type) { case URMColorDescTypeName: result = Urm__UT_GetNamedColorPixel (display, cmap, colorptr, pixel_return, XBlackPixelOfScreen(XDefaultScreenOfDisplay(display))); break; case URMColorDescTypeRGB: result = Urm__UT_GetColorPixel (display, cmap, colorptr, pixel_return, XBlackPixelOfScreen(XDefaultScreenOfDisplay(display))); break; default: sprintf(err_msg, _MrmMMsg_0040); result = Urm__UT_Error ("MrmFetchColorLiteral", err_msg, NULL, NULL, MrmFAILURE) ; _MrmAppUnlock(app); _MrmProcessUnlock(); return result; }; UrmFreeResourceContext (context_id); /* partial success only returned when a color allocation fails, but we've tried to make a reasonable substitution */ if (result == MrmPARTIAL_SUCCESS) result = MrmSUCCESS; _MrmAppUnlock(app); _MrmProcessUnlock(); return result; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmGetIndexedLiteral searches a single database file for a literal * given its index (i.e. it gets a public literal from a single file). * It returns the literal as the contents of the context buffer. The * group which is fetched is always URMgLiteral. The literal type * filter is taken from the context; if unmodified in the context * as obtained from UrmGetResourceContext, there is no filtering * (type=RGMtNul). * * The buffer contents will be as follows for some common literal * types obtained from a .UID file. Note that in some cases that * the caller must fix up offsets to be memory pointers. * * UrmRCType(context_id) == MrmRtypeChar8: * UrmRCBuffer(context_id) contains a nul-terminated * ASCII string * * UrmRCType(context_id) == MrmRtypeCString: * UrmRCBuffer(context_id) contains a compound string * * UrmRCType(context_id) == MrmRtypeChar8Vector: * UrmRCType(context_id) == MrmRtypeCStringVector: * UrmRCBuffer(context_id) contains an RGM text vector * or stringtable (RGMTextVector). The items in the * text vector contain offsets into the buffer which * locate either nul-terminated ASCII strings or compound * compound strings. These may be relocated to memory * pointers by adding the buffer address to the offset, i.e. * item[n].text_item.pointer = item[n].text_item.offset+bufadr * * FORMAL PARAMETERS: * * file_id id of an open URM database file (IDB file) * index index of the desired literal * context_id resource context into which to read the literal * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * Other See UrmIdbGetIndexedResource * * SIDE EFFECTS: * *-- */ Cardinal UrmGetIndexedLiteral (IDBFile file_id , String index , URMResourceContextPtr context_id ) { /* * Local variables */ MrmType lit_type ; /* the type of the literal */ /* * Validate context, then attempt the read. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmGetIndexedLiteral", _MrmMMsg_0043, file_id, context_id, MrmBAD_CONTEXT) ; lit_type = UrmRCType (context_id) ; return UrmIdbGetIndexedResource (file_id, index, URMgLiteral, lit_type, context_id) ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmGetRIDLiteral retrieves a literal from a single database file * given its resource id as an accessor. It returns the literal record. * * FORMAL PARAMETERS: * * file_id id of an open URM database file (IDB file) * resource_id resource id for literal * context_id literal context in which to return record read in * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND literal not found * MrmFAILURE operation failed, further reason not given. * * SIDE EFFECTS: * *-- */ Cardinal UrmGetRIDLiteral (IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id ) { /* * Local variables */ MrmType lit_type ; /* the type of the literal */ /* * Validate context, then attempt the read. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmGetRIDLiteral", _MrmMMsg_0043, file_id, context_id, MrmBAD_CONTEXT) ; lit_type = UrmRCType (context_id) ; return UrmIdbGetRIDResource (file_id, resource_id, URMgLiteral, lit_type, context_id) ; } /* *++ * * PROCEDURE DESCRIPTION: * * Urm__HGetIndexedLiteral is exactly like UrmGetLiteral except * that it searches a hierarchy for the literal rather than reading * from a single file. * * FORMAL PARAMETERS: * * hierarchy_id hierarchy to be searched * index index of the desired literal * context_id resource context into which to read the literal * file_id_return to return IDB file in which literal was found * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * Other See UrmIdbGetIndexedResource * * SIDE EFFECTS: * *-- */ Cardinal Urm__HGetIndexedLiteral (MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id , IDBFile *file_id_return ) { /* * Local variables */ MrmType lit_type ; /* the type of the literal */ /* * Validate hierarchy and context, then attempt the read. */ if ( hierarchy_id == NULL ) return Urm__UT_Error ("Urm__HGetIndexedLiteral", _MrmMMsg_0023, NULL, NULL, MrmBAD_HIERARCHY) ; if ( ! MrmHierarchyValid(hierarchy_id) ) return Urm__UT_Error ("Urm__HGetIndexedLiteral", _MrmMMsg_0024, NULL, NULL, MrmBAD_HIERARCHY) ; if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("Urm__HGetIndexedLiteral", _MrmMMsg_0043, NULL, context_id, MrmBAD_CONTEXT) ; lit_type = UrmRCType (context_id) ; return UrmHGetIndexedResource (hierarchy_id, index, URMgLiteral, lit_type, context_id, file_id_return) ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmHGetIndexedLiteral is exactly like UrmGetLiteral except * that it searches a hierarchy for the literal rather than reading * from a single file. * * FORMAL PARAMETERS: * * hierarchy_id hierarchy to be searched * index index of the desired literal * context_id resource context into which to read the literal * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * Other See UrmIdbGetIndexedResource * * SIDE EFFECTS: * *-- */ Cardinal UrmHGetIndexedLiteral (MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id ) { /* * Local variables */ IDBFile dummy ; /* unused file return */ return Urm__HGetIndexedLiteral (hierarchy_id, index, context_id, &dummy) ; } motif-2.3.8/lib/Mrm/Mrmlwrite.c0000644000175000017500000001042613145162623013220 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmlwrite.c /main/11 1996/11/13 14:02:48 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains all the routines which write a Literal * from a resource context into an IDB file. * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * UrmPutIndexedLiteral Write indexed literal to IDB file * * UrmPutRIDLiteral Write RID literal to IDB file * */ /* *++ * * PROCEDURE DESCRIPTION: * * UrmPutIndexedLiteral puts a URMgLiteral resource record in the * database. Its content is the literal. The resource type, access, * and locking attributes are assumed to be already set. * * FORMAL PARAMETERS: * * file_id file into which to write record * index case-sensitive index for the literal * context_id resource context containing literal * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * Others: See UrmIdbPutIndexedResource * * SIDE EFFECTS: * *-- */ Cardinal UrmPutIndexedLiteral (IDBFile file_id , String index , URMResourceContextPtr context_id ) { /* * Local variables */ Cardinal result; /* return status */ /* * Validate record, then set resource group and enter in the * IDB file. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmPutIndexedLiteral", _MrmMMsg_0043, file_id, context_id, MrmBAD_CONTEXT) ; UrmRCSetGroup (context_id, URMgLiteral) ; /* * The size, type, access, and lock fields should have already be * set. * *UrmRCSetSize (context_id, ) ; *UrmRCSetType (context_id, ) ; *UrmRCSetAccess (context_id, ) ; *UrmRCSetLock (context_id, ) ; */ result = UrmIdbPutIndexedResource (file_id, index, context_id) ; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmPutRIDLiteral puts a literal accessed by a resource id into the * database. Its content is the literal. The resource type, access, * and locking attributes are assumed to be already set. * * * FORMAL PARAMETERS: * * file_id file into which to write record * resource_id resource id for the record * context_id resource context containing literal * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * Others: See UrmIdbPutRIDResource * * SIDE EFFECTS: * *-- */ Cardinal UrmPutRIDLiteral (IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id ) { /* * Local variables */ Cardinal result ; /* function results */ /* * Validate record, then set resource group and enter in the * IDB file. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmPutRIDLiteral", _MrmMMsg_0043, file_id, context_id, MrmBAD_CONTEXT) ; UrmRCSetGroup (context_id, URMgLiteral) ; UrmRCSetAccess (context_id, URMaPrivate) ; /* * The size, type, and lock fields are assumed to be set. * *UrmRCSetSize (context_id, ) ; *UrmRCSetType (context_id, ) ; *UrmRCSetLock (context_id, ) ; */ result = UrmIdbPutRIDResource (file_id, resource_id, context_id) ; return result ; } motif-2.3.8/lib/Mrm/MrmPublic.h0000644000175000017500000001620313145162623013134 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef MrmPublic #define MrmPublic #include #include /* * Success or other non-error return codes */ #define MrmSUCCESS 1 #define MrmCREATE_NEW 3 #define MrmINDEX_RETRY 5 /* Retry on entering index required */ #define MrmINDEX_GT 7 /* Index orders greater-than entry */ #define MrmINDEX_LT 9 /* Index orders less-than entry */ #define MrmPARTIAL_SUCCESS 11 /* operation partly succeeded */ /* * Failure return codes */ #define MrmFAILURE 0 #define MrmNOT_FOUND 2 #define MrmEXISTS 4 #define MrmNUL_GROUP 6 #define MrmNUL_TYPE 8 #define MrmWRONG_GROUP 10 #define MrmWRONG_TYPE 12 #define MrmOUT_OF_RANGE 14 /* Record number too big */ #define MrmBAD_RECORD 16 /* Record number wrong type */ #define MrmNULL_DATA 18 /* No data for entry */ #define MrmBAD_DATA_INDEX 20 /* Data index in RID out of range */ #define MrmBAD_ORDER 22 /* Bad ordering specifier */ #define MrmBAD_CONTEXT 24 /* Invalid Mrm context */ #define MrmNOT_VALID 26 /* Validation failure */ #define MrmBAD_BTREE 28 /* GT/LT pointer error in BTree */ #define MrmBAD_WIDGET_REC 30 /* Validation failure on widget record */ #define MrmBAD_CLASS_TYPE 32 /* Class type not a valid Mrmwc... value */ #define MrmNO_CLASS_NAME 34 /* User class name is null */ #define MrmTOO_MANY 36 /* Too many entries requested in some list */ #define MrmBAD_IF_MODULE 38 /* invalid interface module */ #define MrmNULL_DESC 40 /* Arglist or children descriptor null */ #define MrmOUT_OF_BOUNDS 42 /* Argument index out of arglist bounds */ #define MrmBAD_COMPRESS 44 /* Invalid compression code */ #define MrmBAD_ARG_TYPE 46 /* Invalid type, not in RGMrType... */ #define MrmNOT_IMP 48 /* Not yet implemented */ #define MrmNULL_INDEX 50 /* empty index string */ #define MrmBAD_KEY_TYPE 52 /* key must be MrmrIndex or MrmrRID */ #define MrmBAD_CALLBACK 54 /* Invalid callback descriptor */ #define MrmNULL_ROUTINE 56 /* Empty callback routine name string */ #define MrmVEC_TOO_BIG 58 /* too many elements in vector */ #define MrmBAD_HIERARCHY 60 /* invalid Mrm file hierarchy */ #define MrmBAD_CLASS_CODE 62 /* Class code not found in Mrmwc... */ #define MrmDISPLAY_NOT_OPENED 63 /* Display not yet created */ #define MrmEOF 64 /* End of file */ #define MrmUNRESOLVED_REFS 65 /* Unresolved widget refs in callback*/ /* * Definitions associated with widget representations */ /* * Define the creation callback */ #define MrmNcreateCallback "createCallback" /* BEGIN OSF Fix pir 2813 */ #define MrmCR_CREATE XmCR_CREATE /* END OSF Fix pir 2813 */ /* * Code for unknown (user-defined) classes. */ #define MrmwcUnknown 1 /* * The data types of values stored in uid files. */ #define MrmRtypeMin 1 #define MrmRtypeInteger 1 /* int */ #define MrmRtypeBoolean 2 #define MrmRtypeChar8 3 /* a nul-terminated string */ #define MrmRtypeChar8Vector 4 /* a vector of char_8 strings */ #define MrmRtypeCString 5 /* a compound string (DDIS) */ #define MrmRtypeCStringVector 6 /* a vector of compound strings */ #define MrmRtypeFloat 7 /* 8 = TypeCompressed now unused */ #define MrmRtypeCallback 9 /* code for a callback descriptor */ #define MrmRtypePixmapImage 10 /* Pixmap in image form */ #define MrmRtypePixmapDDIF 11 /* Pixmap in DDIF form */ #define MrmRtypeResource 12 /* Mrm resource descriptor */ #define MrmRtypeNull 13 /* no value given */ #define MrmRtypeAddrName 14 /* nul-terminated string to be interpreted as runtime address */ #define MrmRtypeIconImage 15 /* icon image */ #define MrmRtypeFont 16 /* Mrm font structure */ #define MrmRtypeFontList 17 /* Mrm font list */ #define MrmRtypeColor 18 /* Mrm color descriptor */ #define MrmRtypeColorTable 19 /* Mrm color table */ #define MrmRtypeAny 20 /* Any is allowed in UID file */ #define MrmRtypeTransTable 21 /* Translation table (ASCIZ string) */ #define MrmRtypeClassRecName 22 /* class record name (ASCIZ string) */ #define MrmRtypeIntegerVector 23 /* a vector of integers */ #define MrmRtypeXBitmapFile 24 /* X bitmap file to make pixmap with */ #define MrmRtypeCountedVector 25 /* vector with associated count */ #define MrmRtypeKeysym 26 /* X keysym data type */ #define MrmRtypeSingleFloat 27 /* single float data type */ #define MrmRtypeWideCharacter 28 /* wide_character string type */ #define MrmRtypeFontSet 29 #define MrmRtypeHorizontalInteger 30 #define MrmRtypeVerticalInteger 31 #define MrmRtypeHorizontalFloat 32 #define MrmRtypeVerticalFloat 33 #define MrmRtypeMax 33 /* * MRM typedefs */ /* * MRM primitive types */ typedef short int MrmCode; /* Used for codes, e.g. Mrmcr... */ typedef unsigned char MrmSCode; /* Short code for small ranges */ typedef unsigned short int MrmOffset;/* Used for offsets in records */ typedef short int MrmType; /* Used for types, e.g. MrmrType... */ typedef unsigned short int MrmSize; /* For size fields */ typedef short int MrmCount; /* For counter fields */ typedef unsigned char MrmFlag; /* flag fields */ typedef long int MrmResource_id; /* Resource id in portable IDB files */ typedef short int MrmGroup; /* For Mrm resource groups */ #define MrmMaxResourceSize 65535 /* (2)16 - 1 */ /* * Operating System specific parameter struct. Passed to low level * file OPEN. */ #define MrmOsOpenParamVersion 1 typedef struct { /* * The version of this structure. Set to MrmOsOpenParamVersion */ Cardinal version; /* * The default name, for systems which can use it */ char *default_fname; /* * The related name, for systems which can use it * Flag for file clobber (1 means OK to clobber) */ union { unsigned long related_nam; Boolean clobber_flg; } nam_flg; /* * The display, for which the user wants us to open * this hierarchy on. Used for the LANG variable. */ Display *display; } MrmOsOpenParam, *MrmOsOpenParamPtr ; /* * The opaque result of opening a Mrm hierarchy. */ typedef struct MrmHierarchyDescStruct *MrmHierarchy; /* * Structure used to pass name/value pairs to MrmRegisterNames */ typedef struct { String name ; /* case-sensitive name */ XtPointer value ; /* value/address associated with name */ } MRMRegisterArg, MrmRegisterArg, *MrmRegisterArglist ; /* * Code for unknown (user-defined) classes. */ #define URMwcUnknown 1 /* * Declarations of Mrm public entry points */ #include #endif /* MrmPublic */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Mrm/Mrmvm.c0000644000175000017500000000410413145162623012330 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmvm.c /main/10 1996/11/13 14:05:05 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM) * * ABSTRACT: * * This module handles memory management for URM. * * AUTHORS: * * MODIFICATION HISTORY: *-- */ /* * * INCLUDE FILES * */ #include #include /* * * TABLE OF CONTENTS * * Urm__UT_AllocString - allocates and copies a nul-terminated string * */ /* *++ * * PROCEDURE DESCRIPTION: * * This utility allocates memory for a string from the miscellaneous * zone and copies the string into it. * * FORMAL PARAMETERS: * * stg null-terminated string to copy * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * pointer to the new string; NULL if an allocation error * * SIDE EFFECTS: * *-- */ String Urm__UT_AllocString (String stg) { /* * Local variables */ String new_stg ; /* the string copy */ if ( stg == NULL ) return NULL ; new_stg = (String) XtMalloc (strlen(stg)+1) ; if ( new_stg != NULL ) strcpy (new_stg, stg) ; return new_stg ; } motif-2.3.8/lib/Mrm/Mrmtable.c0000644000175000017500000001601213145162623012776 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmtable.c /main/13 1996/11/13 14:04:22 drk $" #endif #endif /* *++ * FACILITY: * * UIL Manager (URM) * * ABSTRACT: * * This module contains the keyword tables and functions used by to * support the compressing and uncompressing of strings in URM. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* * * TABLE of CONTENTS * * Urm__FixupCompressionTable make table memory resident * * Urm__FindClassDescriptor find descriptor in file/memory * * Urm__UncompressCode uncompress a code * * Urm__IsSubtreeResource predicate for subtree resources */ /* *++ * * FUNCTIONAL DESCRIPTION: * * This routine fixes up a file-based compression table. It resolves * offsets into memory pointers. If requested, it then looks up * each resulting string and attempts to replace it with a * function pointer (from the function hash table). * * FORMAL PARAMETERS: * * ctable the compression table to fix up * qfindcldesc if TRUE, attempt to look up the strings as * indexes of class descriptors * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * MrmSUCCESS if all fixup operations succeed * MrmFAILURE if any operation fails (usually function lookup) * * SIDE EFFECTS: * * none * *-- */ Cardinal Urm__FixupCompressionTable (UidCompressionTablePtr ctable, Boolean qfindcldesc, Boolean byte_swapped) { /* * Local variables */ int fixndx ; /* table fixup loop index */ Cardinal result = MrmSUCCESS; WCIClassDescPtr cldesc; /* for class descriptor */ Cardinal clres; /* lookup result */ /* * Swap bytes if necessary and fix up the table offsets to be pointers */ if ( byte_swapped ) { swapbytes(ctable->validation); swapbytes(ctable->num_entries); } for ( fixndx=UilMrmMinValidCode ; fixndxnum_entries ; fixndx++ ) { if ( byte_swapped ) swapbytes(ctable->entry[fixndx].stoffset); ctable->entry[fixndx].cstring = ((char *)ctable+ctable->entry[fixndx].stoffset); } /* * Look up each string as a function if requested */ if ( qfindcldesc ) for ( fixndx=UilMrmMinValidCode ; fixndxnum_entries ; fixndx++ ) { clres = Urm__WCI_LookupClassDescriptor (ctable->entry[fixndx].cstring, &cldesc); if ( clres == MrmSUCCESS ) ctable->entry[fixndx].cldesc = cldesc; else { ctable->entry[fixndx].cldesc = NULL; result = MrmFAILURE; } } return result; } /* *++ * * FUNCTIONAL DESCRIPTION: * * This routine finds a class descriptor corresponding to a class * compression code or name. It looks up the class in the file's * compression table if possible. Otherwise, it uses the older built-in * tables. * * FORMAL PARAMETERS: * * cfile IDB file in which to find compression table * code compression code to be uncompressed * name the class name; the convenience function name. * class_return to return the class descriptor * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * MrmSUCCESS if class descriptor found * MrmFAILURE otherwise * * SIDE EFFECTS: * * none * *-- */ Cardinal Urm__FindClassDescriptor (IDBFile cfile, MrmCode code, char *name, WCIClassDescPtr *class_return) { /* * Use the built-in tables if the file has none. Else a simple lookup. */ if ( code == UilMrmUnknownCode ) return Urm__WCI_LookupClassDescriptor (name, class_return); if ( cfile->class_ctable == NULL ) return Urm__UT_Error ("Urm__FindClassDescriptor", _MrmMMsg_0050, NULL, NULL, MrmFAILURE); if ( code < UilMrmMinValidCode ) return MrmFAILURE; if ( code >= cfile->class_ctable->num_entries ) return MrmFAILURE; *class_return = cfile->class_ctable->entry[code].cldesc; if ( *class_return == NULL ) return MrmFAILURE; return MrmSUCCESS; } /* *++ * * FUNCTIONAL DESCRIPTION: * * This routine returns the string corresponding to a compression code. * It looks up the code in the file's compression table if it has * one, else falls back on the old built-in tables. The code is looked * up in the resource tables. * * FORMAL PARAMETERS: * * cfile IDB file in which to find compression table * code compression code to be uncompressed * stg_return to return result of uncompression * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * MrmSUCCESS if uncompression successful * MrmFAILURE otherwise * * SIDE EFFECTS: * * none * *-- */ Cardinal Urm__UncompressCode (IDBFile cfile, MrmCode code, String *stg_return) { /* * A simple lookup in the file's compression tables. */ if ( cfile->resource_ctable == NULL ) return Urm__UT_Error ("Urm__UncompressCode", _MrmMMsg_0050, NULL, NULL, MrmFAILURE); if ( code < UilMrmMinValidCode ) return MrmFAILURE; if ( code >= cfile->resource_ctable->num_entries ) return MrmFAILURE; *stg_return = cfile->resource_ctable->entry[code].cstring; return MrmSUCCESS; } /* *++ * * FUNCTIONAL DESCRIPTION: * * This routine checks to see if a resource is marked as rooting a * widget subtree, that is, is a resource which requires that a * widget subtree be instantiated as its value. * * Initial version uses crude check. To be replaced by table lookup. * * FORMAL PARAMETERS: * * cfile file containing table information * code code to be checked * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * TRUE if subtree value is required * FALSE otherwise * * SIDE EFFECTS: * * none * *-- */ Boolean Urm__IsSubtreeResource (IDBFile cfile, MrmCode code) { /* * Do a string comparison for for the subtree resources. */ if ( code < UilMrmMinValidCode ) return FALSE; if ( code >= cfile->resource_ctable->num_entries ) return FALSE; if ( strcmp(cfile->resource_ctable->entry[code].cstring,XmNsubMenuId) == 0 ) return TRUE; return FALSE; } motif-2.3.8/lib/Mrm/Mrmwrefs.c0000644000175000017500000003640413145162623013044 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmwrefs.c /main/14 1996/11/13 14:07:43 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains all routines which manage references to * widgets which must be handled during or immediately after * widget creation. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* *++ * * PROCEDURE DESCRIPTION: * * routine acquires a resource context, and initializes * it for use a a widget reference structure. * * FORMAL PARAMETERS: * * wref_id to return pointer to initialized context * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * See UrmGetResourceContext * * SIDE EFFECTS: * *-- */ Cardinal Urm__CW_InitWRef (URMResourceContextPtr *wref_id) { Cardinal result; /* function results */ URMWRefStructPtr refdsc; /* buffer as reference structure */ /* * Acquire and initialize resource context */ result = UrmGetResourceContext ((char *(*)())NULL,(void(*)())NULL, 500, wref_id); if ( result != MrmSUCCESS ) return result; refdsc = (URMWRefStructPtr) UrmRCBuffer (*wref_id); refdsc->num_refs = 0; refdsc->heap_size = 0; return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine adds a widget definition to the widget reference structure * * FORMAL PARAMETERS: * * wref_id widget reference structure * w_name name of the widget to enter * w_id widget id * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * See UrmResizeResourceContext * * SIDE EFFECTS: * *-- */ Cardinal Urm__CW_AddWRef (URMResourceContextPtr wref_id, String w_name, Widget w_id) { /* * Local variables */ Cardinal result; /* function results */ URMWRefStructPtr refdsc; /* buffer as reference structure */ MrmCount name_bytes; /* # bytes for name & NULL */ MrmCount bytes_needed; /* # bytes for whole ref */ Cardinal ndx; /* entry index in structure */ MrmOffset new_offs; /* new offset in heap */ Cardinal old_size; /* old buffer size */ Cardinal new_size; /* new buffer size */ Cardinal delta; /* difference in size */ char *old_heap; /* old heap address */ char *new_heap; /* new heap address */ /* * Set up pointers. Compute size needed and available, and resize structure * if required. Name need not be entered if it is compiler-generated * (contains non-legal character '-') */ refdsc = (URMWRefStructPtr) UrmRCBuffer (wref_id); name_bytes = strlen(w_name); for ( ndx=0 ; ndx (UrmRCBufSize(wref_id)-UrmWRefBytesUsed(refdsc)) ) { old_size = UrmRCBufSize (wref_id); new_size = 2 * old_size; delta = new_size - old_size; result = UrmResizeResourceContext (wref_id, new_size); if ( result != MrmSUCCESS ) return result; refdsc = (URMWRefStructPtr) UrmRCBuffer (wref_id); old_heap = (char *) refdsc+old_size-refdsc->heap_size; new_heap = (char *) (old_heap+delta); UrmBCopy (old_heap, new_heap, refdsc->heap_size); for ( ndx=0 ; ndxnum_refs ; ndx++ ) refdsc->refs[ndx].w_name_offs += delta; } /* * There is enough space. Copy in the name, and set up the descriptor. */ new_offs = UrmRCBufSize(wref_id) - refdsc->heap_size - name_bytes; ndx = refdsc->num_refs; refdsc->refs[ndx].w_id = w_id; refdsc->refs[ndx].w_name_offs = new_offs; refdsc->num_refs += 1; refdsc->heap_size += name_bytes; strcpy ((String)refdsc+new_offs, w_name); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine searches the widget reference structure for a widget, * and returns its id if found. * * FORMAL PARAMETERS: * * wref_id widget reference structure * w_name name of widget to be found * w_id_return to return widget id * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS - found, id is returned * MrmNOT_FOUND - not found * * SIDE EFFECTS: * *-- */ Cardinal Urm__CW_FindWRef (URMResourceContextPtr wref_id, String w_name, Widget *w_id_return) { /* * Local variables */ URMWRefStructPtr refdsc; /* buffer as reference structure */ int ndx; /* loop index */ /* * Search the vector for the name, returning the id if found. Search * backwards, so the most recent definitions are searched first. */ refdsc = (URMWRefStructPtr) UrmRCBuffer (wref_id); for ( ndx=refdsc->num_refs-1 ; ndx>=0 ; ndx-- ) if ( strcmp(w_name,UrmWRefNameN(refdsc,ndx)) == 0 ) { *w_id_return = UrmWRefIdN (refdsc, ndx); return MrmSUCCESS; } return MrmNOT_FOUND; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine creates a SetValues descriptor, initializes it from * the resource descriptor, and appends it to the list. The id of the * widget to be modified is set NULL to identify this descriptor as * one to be set. * * FORMAL PARAMETERS: * * file_id file from which to uncompress argtag * svlist list of SetValues of descriptor * w_name widget name * argtag Argument tag code * argname Argument tag name if code is URMcUnknown * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__CW_AppendSVWidgetRef (IDBFile file_id, URMPointerListPtr *svlist, String w_name, MrmCode argtag, String argname) { /* * Local variables */ URMSetValuesDescPtr svdesc ; /* new descriptor */ Cardinal uncmp_res; /* function result */ char errmsg[300]; /* * Initialize the pointer list if required */ if ( *svlist == NULL ) UrmPlistInit (10, svlist) ; /* * Create and set the new descriptor. The argument tag must be uncompressed * into its string now, when the compression code for it is available from the * file. If the tag code is unknown, then the string must be copied into * allocated memory. */ svdesc = (URMSetValuesDescPtr) XtMalloc (sizeof(URMSetValuesDesc)) ; svdesc->setw = NULL ; svdesc->type = URMsvWidgetRef ; svdesc->tagcode = argtag ; if ( argtag == UilMrmUnknownCode ) { svdesc->tagname = (String) XtMalloc (strlen(argname)+1); strcpy (svdesc->tagname, argname); } else { uncmp_res = Urm__UncompressCode (file_id, argtag, &svdesc->tagname); if ( uncmp_res != MrmSUCCESS ) { sprintf (errmsg, _MrmMMsg_0108, argtag); XtFree ((char *)svdesc); Urm__UT_Error ("Urm__CW_AppendSVWidgetRef", errmsg, NULL, NULL, MrmNOT_FOUND); return; } } svdesc->done = FALSE ; svdesc->sv.wname = Urm__UT_AllocString (w_name) ; UrmPlistAppendPointer (( URMPointerListPtr)*svlist, (XtPointer) svdesc) ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine creates a SetValues descriptor, initializes it from * the resource descriptor, adds the callback list and appends it to the * list. The id of the * widget to be modified is set NULL to identify this descriptor as * one to be set. * * FORMAL PARAMETERS: * * file_id file from which to uncompress argtag * svlist list of SetValues of descriptor * w_name widget name * argtag Argument tag code * argname Argument tag name if code is URMcUnknown * cbptr Callback description pointer * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__CW_AppendCBSVWidgetRef (IDBFile file_id, URMPointerListPtr *svlist, RGMCallbackDescPtr cbptr, MrmCode argtag, String argname) { URMSetValuesDescPtr svdesc ; /* new descriptor */ RGMCallbackDescPtr cbdesc; /* Copy of descriptor */ MrmSize descsize; /* Size of descriptor to be copied */ Cardinal uncmp_res; /* function result */ char errmsg[300]; /* * Initialize the pointer list if required */ if ( *svlist == NULL ) UrmPlistInit (10, svlist) ; /* * Create and set the new descriptor. The argument tag must be uncompressed * into its string now, when the compression code for it is available from the * file. If the tag code is unknown, then the string must be copied into * allocated memory. */ svdesc = (URMSetValuesDescPtr) XtMalloc (sizeof(URMSetValuesDesc)) ; svdesc->setw = NULL ; svdesc->type = URMsvCallBackList ; svdesc->tagcode = argtag ; if ( argtag == UilMrmUnknownCode ) { svdesc->tagname = (String) XtMalloc (strlen(argname)+1); strcpy (svdesc->tagname, argname); } else { uncmp_res = Urm__UncompressCode (file_id, argtag, &svdesc->tagname); if ( uncmp_res != MrmSUCCESS ) { sprintf (errmsg, _MrmMMsg_0108, argtag); XtFree ((char *)svdesc); Urm__UT_Error ("Urm__CW_AppendCBSVWidgetRef", errmsg, NULL, NULL, MrmNOT_FOUND); return; } } svdesc->done = FALSE ; /* Copy callback descriptor */ descsize = sizeof(RGMCallbackDesc) + (cbptr->count)*sizeof(RGMCallbackItem); cbdesc = (RGMCallbackDescPtr)XtMalloc(descsize); memcpy(cbdesc, cbptr, descsize); svdesc->sv.callbacks = cbdesc ; UrmPlistAppendPointer (( URMPointerListPtr)*svlist, (XtPointer) svdesc) ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine updates a SetValues list from a just-created widget. * Any entry whose modified widget field is NULL is has the modified * widget set to the given widget. * * FORMAL PARAMETERS: * * svlist List of SetValues descriptors * cur_id current widget to be entered in descriptors * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__CW_UpdateSVWidgetRef (URMPointerListPtr *svlist, Widget cur_id) { /* * Local variables */ int ndx ; /* loop index */ URMSetValuesDescPtr svdesc ; /* current SetValues descriptor */ /* * Loop over all descriptors. Enter the current widget as appropriate. * Since each descriptor is used only once, immediately free any * allocated tag string. */ for ( ndx=0 ; ndxdone ) continue ; if ( svdesc->setw == NULL ) svdesc->setw = cur_id ; } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine updates a SetValues list from a just-created widget. * Any entry whose modified widget field is NULL is has the modified * widget set to the given widget. It also uses this widget to * immediately update any previously saved widget which can be * resolved with this new widget and to update widget references * in callback items. * * FORMAL PARAMETERS: * * svlist List of SetValues descriptors * cur_name current widget's name * cur_id current widget to be entered in descriptors * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__CW_ResolveSVWidgetRef (URMPointerListPtr *svlist, String cur_name, Widget cur_id) { /* * Local variables */ int ndx ; /* loop index */ int cbndx; /* callback list index */ URMSetValuesDescPtr svdesc ; /* current SetValues descriptor */ Arg args[1] ; /* SetValues argument list */ RGMCallbackDescPtr cbdesc; /* Current callback descriptor */ RGMCallbackItemPtr items; /* Array of callback items */ /* * Loop over all descriptors. Enter the current widget as appropriate. * Since each descriptor is used only once, immediately free any * allocated tag string. */ for ( ndx=0 ; ndxdone ) continue ; if ( svdesc->setw == NULL ) { svdesc->setw = cur_id ; continue ; } switch (svdesc->type) { case URMsvWidgetRef: if ( strcmp(cur_name,svdesc->sv.wname) == 0 ) { args[0].name = svdesc->tagname ; args[0].value = (XtArgVal) cur_id ; XtSetValues (svdesc->setw, args, 1) ; svdesc->done = TRUE ; if ( svdesc->tagcode == UilMrmUnknownCode ) { XtFree ((char *)svdesc->tagname); svdesc->tagname = NULL; } /* Does this really need to be freed here? */ XtFree(svdesc->sv.wname); svdesc->sv.wname = NULL; } break; case URMsvCallBackList: cbdesc = (RGMCallbackDescPtr)svdesc->sv.callbacks; items = cbdesc->item; /* Loop through callback items, resolving where possible */ for (cbndx = 0; cbndx < cbdesc->count; cbndx++) { if (items[cbndx].runtime.resolved) continue; if (strcmp(cur_name, items[cbndx].runtime.wname) == 0) /* Finish resolving the callback item. */ { items[cbndx].runtime.callback.closure = (XtPointer)cur_id; items[cbndx].runtime.resolved = TRUE; cbdesc->unres_ref_count--; /* Free the widget name. */ XtFree(items[cbndx].runtime.wname); items[cbndx].runtime.wname = NULL; } } if (cbdesc->unres_ref_count == 0) { /* Move individual items so array functions as callback list */ XtCallbackRec *callbacks = (XtCallbackRec *)items; for (cbndx = 0; cbndx <= cbdesc->count; cbndx++) /* <= so that null item is copied. */ { callbacks[cbndx].callback = (XtCallbackProc) items[cbndx].runtime.callback.callback; callbacks[cbndx].closure = (XtPointer) items[cbndx].runtime.callback.closure; } args[0].name = svdesc->tagname; args[0].value = (XtArgVal)items; XtSetValues(svdesc->setw, args, 1); svdesc->done = TRUE; /* Free memory. */ if ( svdesc->tagcode == UilMrmUnknownCode ) { XtFree ((char *)svdesc->tagname); svdesc->tagname = NULL; } XtFree((char *)svdesc->sv.callbacks); svdesc->sv.callbacks = NULL; } break; default: continue; } } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine frees a SetValues descriptor. * * FORMAL PARAMETERS: * * svdesc SetValues descriptor * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__CW_FreeSetValuesDesc (URMSetValuesDescPtr svdesc) { if ( (svdesc->type == URMsvWidgetRef) && (svdesc->sv.wname != NULL) ) XtFree ((char *)svdesc->sv.wname); XtFree ((char *)svdesc); } motif-2.3.8/lib/Mrm/IDB.h0000644000175000017500000004263213145162623011645 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef idb_h #define idb_h 1 /* * This file defines the constants and structs required by the URM * Indexed Data Base facility (IDB). The order of definition is: * o literals * o primitive typedefs * o typedefs for file records * o typedefs for in-memory structures */ /* * IDB literals */ /* * Primitive typedefs */ /* * A data pointer. Consists of a record number (of a data record) and an * offset in the record to the data entry. */ typedef union { unsigned pointer ; /* the pointer as a value */ struct { IDBRecordNumber rec_no B32 ; /* record number */ MrmOffset item_offs B32 ; /* offset of data entry in record. Must be a IDB*DataEntry struct */ } internal_id ; /* 2 fields internally */ } IDBDataPointer ; /* * A data pointer as a passed-by-value reference */ #if 0 typedef unsigned IDBDataHandle ; #endif typedef struct { IDBRecordNumber rec_no ; /* record number */ MrmOffset item_offs ; /* offset of data entry in record. Must be a IDB*DataEntry struct */ } IDBDataHandle ; /* * A data item in a data record. */ /* * entry types distinguish simple and overflow records */ #define IDBdrSimple 1 #define IDBdrOverflow 2 /* * Common header for both simple and overflow data entries */ #define IDBDataEntryValid 222857390 typedef struct { unsigned validation; /* validation code = IDBDataEntryValid */ MrmCode entry_type; /* IDBdrSimple, IDBdrOverflow */ MrmCode resource_group; /* resource group */ MrmCode resource_type; /* resource type */ MrmCode access; /* URMaPrivate or URMaPublic */ MrmCode lock; /* locking code */ MrmSize entry_size; /* number of data bytes */ MrmOffset prev_entry; /* Offset of previous entry in this data record. */ } IDBDataEntryHdr, *IDBDataEntryHdrPtr ; #define SwapIDBDataEntryHdr(deh) { \ swap4bytes(deh->validation); \ swap2bytes(deh->entry_type) ; \ swap2bytes(deh->resource_group) ; \ swap2bytes(deh->resource_type) ; \ swap2bytes(deh->access) ; \ swap2bytes(deh->lock) ; \ swap2bytes(deh->entry_size) ; \ swap2bytes(deh->prev_entry) ; \ } /* * A simple data entry */ typedef struct { IDBDataEntryHdr header ; /* common header, entry_type = IDBdrSimple */ char data[1] ; /* First byte in data */ } IDBSimpleData, *IDBSimpleDataPtr ; /* * An overflow data entry. These are used for all data entries which are * too big to fit in a single record. These are broken up into 2 or more * overflow entries, whose contents are concatenated to produce the * actual data entry. */ typedef struct { IDBDataEntryHdr header ; /* common header, entry_type = IDBdrOverflow */ MrmSize segment_size; /* number of data bytes in this segment */ MrmCount segment_count; /* number of records needed to store entry */ MrmCount segment_num; /* this segment's number */ IDBDataPointer next_segment ; /* next segment */ char data[1] ; /* first data byte */ } IDBOverflowData, *IDBOverflowDataPtr ; #define SwapIDBOverflowData(doh) { \ swap2bytes(doh->segment_size) ; \ swap2bytes(doh->segment_count) ; \ swap2bytes(doh->segment_num) ; \ swap2bytes(doh->next_segment.internal_id.rec_no) ; \ swap2bytes(doh->next_segment.internal_id.item_offs) ; \ } /* * Header sizes for data entries */ #define IDBSimpleDataHdrSize (sizeof(IDBSimpleData) - sizeof(char)) #define IDBOverflowDataHdrSize (sizeof(IDBOverflowData) - sizeof(char)) /* * File record definitions * * IDB uses one size of fixed-length record for all its file records. * The size of this record is determined as a reasonable common size * which gives efficient disk access on all the file systems on which * IDB runs. * * All records are accessed by record number. These increase monotonically * from the lowest valid record number, which is maintained in the file * header. * * IDB defines the following types of records: * Header - one per file * Index leaf - contains leaf nodes of the B-tree index * Index node - contains non-leaf nodes of the B-tree index * RID map - contains pointers which map IDB resourc IDs to * data block pointers * Data - Contains data blocks * * All records have a common record header which gives the record number * and record type. This header and the information for each record type * are defined below. */ /* * Number of bytes in a low-level file block = # bytes in an IDB file record */ #define IDBRecordSize 4096 /* * IDB record header */ #define IDBRecordHeaderValid 310144882 typedef struct { unsigned validation; /* validation code = IDBRecordHeaderValid */ MrmType record_type; /* record type */ IDBRecordNumber record_num; /* IDB record number */ } IDBRecordHeader, *IDBRecordHeaderPtr ; /* * Dummy IDB record. */ typedef struct { IDBRecordHeader header ; char dummy[IDBRecordSize-sizeof(IDBRecordHeader)] ; } IDBDummyRecord, *IDBDummyRecordPtr ; /* * IDB header record definition * * There is one header record per IDB file. It is the only record in the * which must be at a fixed location; its record number is * IDBHeaderRecordNumber. * * The header contains the following: * o Information about how the file was created * o A pointer to the root node record for the B-tree index * o The next available resourc id (RID) * o An end-of-file pointer (record number of last record in file) * o Counters of the number of index and RID entries in the file * o Counter of the different types of records in the file * o The remainder of the record is used as the initial space in * which to allocate a small RID map and data entries. This * enables relatively small files to be created when a small * amount of information will be stored, as the minimal file * need contain only a header and (probably) and index leaf record * rather than also requiring an RID map record and a data record. */ /* * IDB file header record header */ typedef struct { IDBRecordHeader header ; /* record_type = IDBrtHeader, record_num = IDBrtHeader, */ char db_version[IDBhsVersion1] ; /* database version */ char creator[IDBhsCreator1] ; /* creator id */ char creator_version[IDBhsVersion1] ; /* creator version */ char creation_date[IDBhsDate1] ; /* creation date */ char module[IDBhsModule1] ; /* module id */ char module_version[IDBhsVersion1] ; /* module version */ IDBRecordNumber index_root ; /* index root pointer */ MrmCount num_indexed ; /* # entries in index */ MrmCount num_RID ; /* # RID entries in file */ IDBridDesc next_RID ; /* next available RID. */ IDBRecordNumber last_record ; /* last record used in file */ IDBRecordNumber last_data_record ; /* last data record in file */ MrmCount group_counts[URMgVecSize] ; /* vector of record counts by resource group */ MrmCount rt_counts[IDBrtVecSize] ; /* vector of record counts by record type (statistics) */ } IDBHeaderHdr, *IDBHeaderHdrPtr ; /* * IDB file header record * * Max number of entries in RID pointer vector */ #define IDBHeaderRIDMax 20 typedef struct { IDBHeaderHdr header_hdr ; /* header part */ IDBDataPointer RID_pointers[IDBHeaderRIDMax]; /* RID pointer vector */ MrmCount num_entry; /* number of entries in record */ MrmOffset last_entry; /* last entry in page */ MrmOffset free_ptr; /* offset of first free byte. initial value = 0 */ MrmCount free_count; /* number of free bytes. Initial value = IDBHeaderFreeMax */ char data[1]; /* First available byte for data */ } IDBHeaderRecord, *IDBHeaderRecordPtr ; /* * Free space in header record, max number of bytes available for data. */ #define IDBHeaderFreeMax (IDBRecordSize-sizeof(IDBHeaderRecord)+sizeof(char)) /* * Record number of the header record */ #define IDBHeaderRecordNumber 1 /* * Index leaf record definition * * IDB provides two mutually exclusive mechanisms for accessing data. * The first is an index system based on ASCII keys (indexes). This * uses a B-tree index as its lookup mechanism. The second mechanism * is a resource id mechanism offering potentially faster access, as * described below. * * As usual in B-tree systems, the B-tree index has two kinds of nodes: * leaf nodes, which contain only data pointers, and B-tree nodes, * which contain pointers to other B-tree records. The following describes * leaf records in the B-tree index. * * The root node of the index is a leaf record if there is exactly 1 * record in the index, and is a tree node otherwise. * * A leaf record consists of a sorted vector of index entries, ordered * in increasing alphabetical order by the index value. The vector * contains fixed-length entries, with the key strings being allocated * at the bottom of the record. The vector grows down from the top and * the string heap up from the bottom as entries are added, until the * record fills. */ /* * An entry in the index vector */ typedef struct { MrmOffset index_stg; /* offset of the index string in the record. Nul-terminated. */ IDBDataPointer data ; /* pointer to the data entry */ } IDBIndexLeafEntry, *IDBIndexLeafEntryPtr ; /* * Size of an index vector entry */ #define IDBIndexLeafEntrySize sizeof(IDBIndexLeafEntry) /* * Max length of an index string (terminating nul not included) */ #define IDBMaxIndexLength URMMaxIndexLen #define IDBMaxIndexLength1 (IDBMaxIndexLength + 1) /* * Leaf record header */ typedef struct { IDBRecordHeader header ; /* record_type = IDBrtIndexLeaf */ IDBRecordNumber parent; /* B-tree parent record */ MrmCount index_count; /* Number of index entries in record */ MrmOffset heap_start; /* Offset of first byte in use for index string heap storage. Offset is from .index[0] */ MrmCount free_bytes; /* Number of free bytes in record */ } IDBIndexLeafHdr, *IDBIndexLeafHdrPtr ; /* * The leaf record */ typedef struct { IDBIndexLeafHdr leaf_header ; /* header part of record. Initial values: heap_start = free_bytes = IDBIndexLeafFreeMax */ IDBIndexLeafEntry index[1] ; /* First entry in index vector. There are index_count entries. */ } IDBIndexLeafRecord, *IDBIndexLeafRecordPtr ; /* * Max number of free bytes in leaf index record (0 entries) */ #define IDBIndexLeafFreeMax (IDBRecordSize - sizeof(IDBIndexLeafHdr)) /* * Index B-tree node record definition * * A B-tree node record is similar to a leaf entry, except that each node * contains a pair of pointers to other nodes in the tree; one to a LT * node, all of whose entries order < the entry's index; one to a GT node, * all of whose entries order > the entry's index. The GT pointer of node * m = the LT pointer of node m+1. Thus any node record containing n nodes * points to n+1 tree nodes. Allocation of heap for index strings is as in * a leaf record. All entries also locate a data entry. */ /* * An entry in the index vector */ typedef struct { MrmOffset index_stg; /* offset of the index string in the record. Nul-terminated. */ IDBDataPointer data ; /* pointer to the data entry */ IDBRecordNumber LT_record; /* pointer to LT record */ IDBRecordNumber GT_record; /* pointer to GT record */ } IDBIndexNodeEntry, *IDBIndexNodeEntryPtr ; /* * Size of an index vector entry */ #define IDBIndexNodeEntrySize sizeof(IDBIndexNodeEntry) /* * Node record header */ typedef struct { IDBRecordHeader header ; /* record_type = IDBrtIndexNode */ IDBRecordNumber parent; /* B-tree parent record */ MrmCount index_count; /* Number of index entries in record */ MrmOffset heap_start; /* Offset of first byte in use for index string heap storage. Offset is from .index[0] */ MrmCount free_bytes; /* Number of free bytes in record */ } IDBIndexNodeHdr, *IDBIndexNodeHdrPtr ; /* * The B-tree node entry */ typedef struct { IDBIndexNodeHdr node_header ; /* header part of record. Initial values: heap_start = free_bytes = IDBIndexNodeFreeMax */ IDBIndexNodeEntry index[1] ; /* First entry in index vector. There are index_count entries. */ } IDBIndexNodeRecord, *IDBIndexNodeRecordPtr ; /* * Max number of free bytes in node index record (0 entries) */ #define IDBIndexNodeFreeMax (IDBRecordSize - sizeof(IDBIndexNodeHdr)) /* * Max number of bytes consumed by a new entry */ #define IDBIndexNodeEntryMax (IDBMaxIndexLength1 + IDBIndexNodeEntrySize \ + sizeof(IDBRecordNumber)) /* * Resource ID record * * RID records locate the data block associated with a given resource ID. * Looking up a data block accessed by RID is a two-step process: * 1. The index map in the file header (maintained in-memory for open * files) is used to locate the correct resource ID record. The * map_index field in a RID descriptor accesses this record via * the RID_maps vector in the header. * 2. The Resource ID record supplies the data block pointer. The * data block pointer is found in the resource_ptr vector using the * res_index field of the RID descriptor. * * Aside from the standard record header, an RID record contains only * a vector of data block pointer. */ /* * The RID map record header */ typedef struct { IDBRecordHeader header ; /* record type = IDBrdRIDMap */ } IDBridMapHdr, *IDBridMapHdrPtr ; /* * The RID map record is a vector of data pointers */ typedef struct { IDBridMapHdr map_header ; /* Header part of record */ IDBDataPointer pointers[1] ; /* First pointer in vector. */ } IDBridMapRecord, *IDBridMapRecordPtr ; /* * Max number of free bytes, number of vector entries in RID record */ #define IDBridFreeMax (IDBRecordSize - sizeof(IDBridMapHdr)) #define IDBridPtrVecMax (IDBridFreeMax / sizeof(IDBDataPointer)) /* * Data record * * Data records hold data entries. The record maintains a free space * pointer, but otherwise contains little information. IDB attempts * to avoid splitting data entries into segments, and is thus willing * to waste some space in a data record if a data item will fit in * a new record. * * All the data entries in a record are chained via the prev_entry offset * field. This is for the convenience of the dump routines. The first * entry is always at offset 0 (= initial value of free ptr). */ /* * The data record header */ typedef struct { IDBRecordHeader header ; /* record = IDBrtData */ MrmCount num_entry; /* number of entries in record */ MrmOffset last_entry; /* last entry in page */ MrmOffset free_ptr; /* offset of first free byte. initial value = 0 */ MrmCount free_count; /* number of free bytes. Initial value = IDBDataFreeMax */ } IDBDataHdr, *IDBDataHdrPtr ; /* * The data record */ typedef struct { IDBDataHdr data_header ; /* Header part of record. Initial values: free_ptr = &.data[0], free_count = IDBDataFreeMax */ char data[1] ; /* First available byte for data */ } IDBDataRecord, *IDBDataRecordPtr ; /* * Max number of free bytes in data record */ #define IDBDataFreeMax (IDBRecordSize - sizeof(IDBDataHdr)) /* * Max number of bytes of data which can be stored as simple or overflow * entries in a data record. */ #define IDBDataSimpleMax (IDBDataFreeMax - IDBSimpleDataHdrSize) #define IDBDataOverflowMax (IDBDataFreeMax - IDBOverflowDataHdrSize) /* * In-memory definitions * * The following structs are used to save runtime informtion used * by IDB. These definitions cover file management and buffer management. */ /* * The IDBOpenFile/IDBFile struct is defined in Mrm.h */ /* * Buffer management * * IDB manages a pool of record buffers which is shared among all open * IDB files. All access to these buffers is via the IDB buffer manager, * which must be used in all requests to access these buffers for * either reading or writing. */ /* * IDB buffer header */ #define IDBRecordBufferValid 327711354 typedef struct { unsigned validation ; /* validation code = IDBRecordBufferValid */ long int activity ; /* activity count to determine moldiest buffer */ IDBFile cur_file ; /* file which currently owns buffer */ MrmCode access ; /* URMReadAccess or URMWriteAccess */ MrmCode modified ; /* t if buffer has been modified */ IDBDummyRecord *IDB_record ; /* record in buffer */ } IDBRecordBuffer, *IDBRecordBufferPtr ; /* * Macro which validates a buffer */ #define Idb__BM_Valid(bufptr) ((bufptr)->validation==IDBRecordBufferValid) /* * Macros which return the record type, number of the record in a buffer */ #define _IdbBufferRecordType(bufptr) ((bufptr)->IDB_record->header.record_type) #define _IdbBufferRecordNumber(bufptr) ((bufptr)->IDB_record->header.record_num) #endif /* idb_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Mrm/MrmIheader.c0000644000175000017500000006464213145162623013264 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmIheader.c /main/16 1996/11/13 13:56:56 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB facility * * ABSTRACT: * * These routines transfer header information between a file and the * in-memory file header struct. All IDB routines maintain the in-memory * file header; the on-disk header is only updated when the header is * initialized or the file is closed. These routines assume that all * information required in the header is continuously up-to-date in * the open file struct. * * All header information must be updated at the time a record is * modified, not written. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * Idb__HDR_GetHeader - Read a file header to memory * * Idb__HDR_InitHeader - Initialize a file header * * Idb__HDR_PutHeader - Write the header to disk * */ /* * * DEFINE and MACRO DEFINITIONS * */ /* * Macros which validate index records in buffers */ #define Idb__HDR_ValidRecord(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtHeader) /* * * OWN VARIABLE DECLARATIONS * */ /* * The following defines the database version written into all * header records. */ static XmConst char *idb__database_version = URMversion; /* *++ * * PROCEDURE DESCRIPTION: * * Idb__HDR_GetHeader reads the file's header record into a buffer, * copies the information into the in-memory header. * * This routine is called as part of InitHeader to move the contents * of the initialized header to memory. This usage expects the * the record to be in the buffer pool, of course. * * FORMAL PARAMETERS: * * file_id Partially initialized in-memory file header struct; the * file is open and the low-level file id is saved. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND header record not found * MrmNOT_VALID database version mismatch * MrmBAD_RECORD not the header record * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_GetHeader (IDBFile file_id) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr hdrbuf; /* header record buffer */ IDBHeaderRecordPtr recptr; /* header record in buffer */ IDBHeaderHdrPtr hdrptr; /* record header */ int ndx; /* loop index */ char errmsg[300]; int file_major, file_minor; /* version numbers of file */ int db_major, db_minor; /* version nums of database */ /* * Get the header record */ result = Idb__BM_GetRecord (file_id, IDBHeaderRecordNumber, &hdrbuf); if ( result != MrmSUCCESS ) return result; if ( ! Idb__HDR_ValidRecord(hdrbuf) ) return Urm__UT_Error ("Idb__HDR_GetHeader", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD); /* * Read the header contents into memory, acquiring buffers as necessary */ recptr = (IDBHeaderRecordPtr) hdrbuf->IDB_record; hdrptr = (IDBHeaderHdrPtr) &recptr->header_hdr; file_id->index_root = hdrptr->index_root; file_id->num_indexed = hdrptr->num_indexed; file_id->num_RID = hdrptr->num_RID; file_id->next_RID = hdrptr->next_RID; file_id->last_record = hdrptr->last_record; file_id->last_data_record = hdrptr->last_data_record; for ( ndx=IDBrtMin ; ndx<=IDBrtMax ; ndx++ ) file_id->rt_counts[ndx] = hdrptr->rt_counts[ndx]; for ( ndx=URMgMin ; ndx<=URMgMax ; ndx++ ) file_id->group_counts[ndx] = hdrptr->group_counts[ndx]; strcpy (file_id->db_version, hdrptr->db_version); strcpy (file_id->creator, hdrptr->creator); strcpy (file_id->creator_version, hdrptr->creator_version); strcpy (file_id->creation_date, hdrptr->creation_date); strcpy (file_id->module, hdrptr->module); strcpy (file_id->module_version, hdrptr->module_version); /* * Header successfully read. Leave the buffer committed in case data * will be read from it. * * Compare version in header against compiled-in version, flagging * mismatch if found. */ if (sscanf(hdrptr->db_version, "URM %d.%d", &file_major, &file_minor) != 2) { sprintf(errmsg, _MrmMMsg_0117, hdrptr->db_version); return Urm__UT_Error ("Idb__HDR_GetHeader", errmsg, file_id, NULL, MrmNOT_VALID); } { /* sscanf() may call ungetc(), which would write the XmConst string. */ char *buf = XtMalloc(strlen(idb__database_version) + 1); strcpy(buf, idb__database_version); sscanf(buf, "URM %d.%d", &db_major, &db_minor); XtFree(buf); } if ((file_major > db_major) || ((file_major == db_major) && (file_minor > db_minor))) { sprintf (errmsg, _MrmMMsg_0011, hdrptr->db_version, idb__database_version); return Urm__UT_Error ("Idb__HDR_GetHeader", errmsg, file_id, NULL, MrmNOT_VALID); } else if (db_major > file_major) { sprintf(errmsg, _MrmMMsg_0118, idb__database_version, hdrptr->db_version); return Urm__UT_Error ("Idb__HDR_GetHeader", errmsg, file_id, NULL, MrmNOT_VALID); } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__HDR_InitHeader initializes a header record for a new file. The * information in the routine arguments is combined with information * derived by the routine (database version, dates and times) and * written into the file header record. Then the buffer is * decommitted. * * FORMAL PARAMETERS: * * creator Creator id for the file * creator_version Creator version string * module Module id for the file * module_version Module version string * file_id To return new in-memory file header for the file. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_InitHeader (IDBFile file_id, String creator, String creator_version, String module, String module_version) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr hdrbuf; /* header record buffer */ IDBHeaderRecordPtr recptr; /* header record in buffer */ IDBHeaderHdrPtr hdrptr; /* record header */ int ndx; /* loop index */ /* * Acquire a buffer for the header, initialize it, and set pointers * into it. */ result = Idb__BM_InitRecord (file_id, IDBHeaderRecordNumber, IDBrtHeader, &hdrbuf); if ( result != MrmSUCCESS ) return result; recptr = (IDBHeaderRecordPtr) hdrbuf->IDB_record; hdrptr = (IDBHeaderHdrPtr) &recptr->header_hdr; /* * Initialize the record contents, first the ones which occur only in * the file header, then those in common with the in-memory file struct. */ strcpy ( hdrptr->db_version, "" ); strncat (hdrptr->db_version, idb__database_version, IDBhsVersion); strcpy ( hdrptr->creator, "" ); strncat (hdrptr->creator, creator, IDBhsCreator); strcpy ( hdrptr->creator_version, "" ); strncat (hdrptr->creator_version, creator_version, IDBhsVersion); Urm__UT_Time (hdrptr->creation_date); strcpy ( hdrptr->module, "" ); strncat (hdrptr->module, module, IDBhsModule); strcpy ( hdrptr->module_version, "" ); strncat (hdrptr->module_version, module_version, IDBhsVersion); hdrptr->index_root = 0; hdrptr->num_indexed = 0; hdrptr->num_RID = 0; hdrptr->next_RID.internal_id.map_rec = hdrptr->header.record_num; hdrptr->next_RID.internal_id.res_index = 0; hdrptr->last_data_record = 0; for ( ndx=IDBrtMin ; ndx<=IDBrtMax ; ndx++ ) hdrptr->rt_counts[ndx] = file_id->rt_counts[ndx]; for ( ndx=URMgMin ; ndx<=URMgMax ; ndx++ ) hdrptr->group_counts[ndx] = 0; for ( ndx=0 ; ndxRID_pointers[ndx].internal_id.rec_no = 0; recptr->RID_pointers[ndx].internal_id.item_offs = 0; } recptr->num_entry = 0; recptr->last_entry = 0; recptr->free_ptr = 0; recptr->free_count = IDBHeaderFreeMax; Idb__BM_MarkModified (hdrbuf); /* * Set the file structure in memory */ file_id->index_root = hdrptr->index_root; file_id->num_indexed = hdrptr->num_indexed; file_id->num_RID = hdrptr->num_RID; file_id->next_RID = hdrptr->next_RID; file_id->last_data_record = hdrptr->last_data_record; for ( ndx=URMgMin ; ndx<=URMgMax ; ndx++ ) file_id->group_counts[ndx] = 0; /* * Header successfully initialized */ return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__Hdr_PutHeader copies all dynamic information from the in-memory * file header into the on-disk file header. This routine is called * before the final DecommitAll on a file as it is being closed. It * is required that no information be placed in the header as a result * of the DecommitAll; thus all header modifications take place as * records are modified, not written. * * This routine updates the header, then decommits it. * * FORMAL PARAMETERS: * * IDBFile file_id; * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_PutHeader (IDBFile file_id) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr hdrbuf; /* header record buffer */ result = Idb__HDR_UpdateHeader (file_id, &hdrbuf); if ( result != MrmSUCCESS ) return result; /* * Header successfully written */ return Idb__BM_Decommit (hdrbuf); } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__Hdr_UpdateHeader copies all dynamic information from the * in-memory file header into the on-disk file header. * * FORMAL PARAMETERS: * * file_id Open IDB file * buffer To return pointer to buffer containing header record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_RECORD not the header record * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_UpdateHeader (IDBFile file_id, IDBRecordBufferPtr *buffer) { /* * Local variables */ Cardinal result; /* function results */ IDBHeaderRecordPtr recptr; /* header record in buffer */ IDBHeaderHdrPtr hdrptr; /* record header */ int ndx; /* loop index */ /* * Get the header record */ result = Idb__BM_GetRecord (file_id, IDBHeaderRecordNumber, buffer); if ( result != MrmSUCCESS ) return result; if ( ! Idb__HDR_ValidRecord(*buffer) ) return Urm__UT_Error("Idb__HDR_PutHeader", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD); /* * Set up pointers into the record, then copy from the memory structure * into it. */ recptr = (IDBHeaderRecordPtr) (*buffer)->IDB_record; hdrptr = (IDBHeaderHdrPtr) &recptr->header_hdr; hdrptr->index_root = file_id->index_root; hdrptr->num_indexed = file_id->num_indexed; hdrptr->num_RID = file_id->num_RID; hdrptr->next_RID = file_id->next_RID; hdrptr->last_record = file_id->last_record; hdrptr->last_data_record = file_id->last_data_record; for ( ndx=IDBrtMin ; ndx<=IDBrtMax ; ndx++ ) hdrptr->rt_counts[ndx] = file_id->rt_counts[ndx]; for ( ndx=URMgMin ; ndx<=URMgMax ; ndx++ ) hdrptr->group_counts[ndx] = file_id->group_counts[ndx]; /* * Header successfully written */ Idb__BM_MarkModified (*buffer); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__HDR_EnterItem is the analog of Idb__RID_EnterItem for entering * a resource id in the header record. * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * resource_id Resource ID under which to enter entry * data_entry Data entry pointer for data * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * MrmOUT_OF_RANGE Record number out of range * MrmBAD_RECORD not the header record * URMBadDataindex Data index out of range * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_EnterItem (IDBFile file_id, IDBResource resource_id, IDBDataHandle data_entry) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr bufptr; /* header record buffer */ IDBHeaderRecordPtr recptr; /* header record in buffer */ IDBridDesc resid; /* CAST resource id */ IDBResourceIndex resndx; /* to check resource index */ IDBRecordNumber recno; /* Map record record number */ /* * Get the header record. */ resid.external_id = resource_id; recno = resid.internal_id.map_rec; resndx = resid.internal_id.res_index; if ( recno != IDBHeaderRecordNumber ) return Urm__UT_Error("Idb__HDR_EnterItem", _MrmMMsg_0012, file_id, NULL, MrmOUT_OF_RANGE); result = Idb__BM_GetRecord (file_id, recno, &bufptr); if ( result != MrmSUCCESS ) return result; if ( ! Idb__HDR_ValidRecord(bufptr) ) return Urm__UT_Error("Idb__HDR_EnterItem", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD); recptr = (IDBHeaderRecordPtr) bufptr->IDB_record; /* * Set the data item. */ if ( resndx >= IDBHeaderRIDMax ) return Urm__UT_Error("Idb__HDR_EnterItem", _MrmMMsg_0013, file_id, NULL, MrmBAD_DATA_INDEX); recptr->RID_pointers[resndx].internal_id.rec_no = data_entry.rec_no; recptr->RID_pointers[resndx].internal_id.item_offs = data_entry.item_offs; Idb__BM_MarkActivity (bufptr); /* * successful entry */ Idb__BM_MarkModified (bufptr); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__HDR_ReturnItem returns the data entry pointer for an item * entered under a resource ID maintained in the header record. It * is an analog of Idb__RID_ReturnItem. * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * resource_id Entry's resource id * signal_null if TRUE, signal error on null data entry * entry_return To return data pointer for data * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmOUT_OF_RANGE Record number out of range * MrmBAD_RECORD not the data record * MrmNULL_DATA no data for resource id * MrmFAILURE some other failure * URMBadDataindex Data index out of range * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_ReturnItem (IDBFile file_id, IDBResource resource_id, Boolean signal_null, IDBDataHandle *entry_return) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr bufptr; /* RID map record buffer */ IDBHeaderRecordPtr recptr; /* RID map record in buffer */ IDBridDesc resid; /* CAST resource id */ IDBResourceIndex resndx; /* to check resource index */ IDBRecordNumber recno; /* Map record record number */ /* * Get the header record */ resid.external_id = resource_id; recno = resid.internal_id.map_rec; resndx = resid.internal_id.res_index; if ( recno != IDBHeaderRecordNumber ) return Urm__UT_Error("Idb__HDR_ReturnItem", _MrmMMsg_0012, file_id, NULL, MrmOUT_OF_RANGE); result = Idb__BM_GetRecord (file_id, recno, &bufptr); if ( result != MrmSUCCESS ) return result; if ( ! Idb__HDR_ValidRecord(bufptr) ) return Urm__UT_Error("Idb__HDR_ReturnItem", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD); recptr = (IDBHeaderRecordPtr) bufptr->IDB_record; /* * Retrieve the data item. */ if ( resndx >= IDBHeaderRIDMax ) return Urm__UT_Error("Idb__HDR_ReturnItem", _MrmMMsg_0013, file_id, NULL, MrmBAD_DATA_INDEX); if (( recptr->RID_pointers[resndx].internal_id.rec_no == 0) && ( recptr->RID_pointers[resndx].internal_id.item_offs == 0)) { if ( signal_null ) { return Urm__UT_Error("Idb__HDR_ReturnItem", _MrmMMsg_0014, file_id, NULL, MrmNULL_DATA); } else { return MrmNULL_DATA; } } entry_return->rec_no = recptr->RID_pointers[resndx].internal_id.rec_no; entry_return->item_offs = recptr->RID_pointers[resndx].internal_id.item_offs; /* * Successful retrieval */ Idb__BM_MarkActivity (bufptr); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__HDR_NextRID returns the next available resource ID in the * header record, if there is one. It is an analog of Idb__RID_NextRID, * and serves it. * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * res_id_return To return new resource id * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_RECORD not the header record * MrmFAILURE some other failure. Use an RID record. * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_NextRID (IDBFile file_id, IDBResource *res_id_return) { /* * Local variables */ IDBResourceIndex resndx; /* to check resource index */ /* * use the next available ID, or fail. */ resndx = file_id->next_RID.internal_id.res_index; if ( file_id->next_RID.internal_id.map_rec != IDBHeaderRecordNumber ) return Urm__UT_Error("Idb__HDR_NextRID", _MrmMMsg_0012, file_id, NULL, MrmBAD_RECORD); if ( resndx >= IDBHeaderRIDMax ) return MrmFAILURE; /* * Increment resource index, returning current value. */ *res_id_return = (IDBResource) file_id->next_RID.external_id; file_id->next_RID.internal_id.res_index++; return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__HDR_GetDataEntry is the analog to Idb__HDR_GetDataEntry for * retrieving data entries from the header record. * * FORMAL PARAMETERS: * * file_id Open ID file * data_entry Data entry to be fetched * context_id To receive data block for data entry * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_RECORD not the header record * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_GetDataEntry (IDBFile file_id, IDBDataHandle data_entry, URMResourceContextPtr context_id) { /* * Local variables */ Cardinal result; /* return status */ IDBRecordNumber record_number; /* Record to be read in */ IDBDataEntryHdrPtr datahdr; /* Header part of entry */ IDBSimpleDataPtr sim_data; /* Simple data entry */ IDBHeaderRecordPtr recptr; /* pointer data record */ IDBRecordBufferPtr bufptr; /* temp buffer for record */ char *buff_ptr; /* ptr into context buffer */ /* * Check and see if the context is valid */ if (! UrmRCValid (context_id)) return Urm__UT_Error("Idb__HDR_GetDataEntry", _MrmMMsg_0006, NULL, NULL, MrmBAD_CONTEXT); /* * Make the data entry accessible as a data pointer. */ record_number = data_entry.rec_no; if ( record_number != IDBHeaderRecordNumber ) return Urm__UT_Error("Idb__HDR_GetDataEntry", _MrmMMsg_0012, NULL, NULL, MrmBAD_RECORD); /* * Get the record that contains this data, get to the correct offset in * that record. */ result = Idb__BM_GetRecord (file_id, record_number, &bufptr); if ( result != MrmSUCCESS ) return result; /* * Point to the header in the data entry, set the context data. The context * is resized if necessary. Note that all context info except the * actual data can be set now regardless of the entry type. */ recptr = (IDBHeaderRecordPtr) bufptr->IDB_record; datahdr = (IDBDataEntryHdrPtr) &recptr->data[data_entry.item_offs]; if ((datahdr->validation != IDBDataEntryValid) && ( file_id->byte_swapped )) SwapIDBDataEntryHdr(datahdr) ; if (datahdr->validation != IDBDataEntryValid) return Urm__UT_Error("Idb__HDR_GetDataEntry", _MrmMMsg_0007, NULL, context_id, MrmNOT_VALID); if ( datahdr->entry_size > UrmRCSize(context_id) ) { result = UrmResizeResourceContext (context_id, datahdr->entry_size); if ( result != MrmSUCCESS ) return result; } UrmRCSetSize (context_id, datahdr->entry_size); UrmRCSetGroup (context_id, datahdr->resource_group); UrmRCSetType (context_id, datahdr->resource_type); UrmRCSetAccess (context_id, datahdr->access); UrmRCSetLock (context_id, datahdr->lock); UrmRCSetByteSwap (context_id, file_id->byte_swapped) ; /* * Read the data into the context. It must always be a simple type in * the header record. */ buff_ptr = (char *) UrmRCBuffer(context_id); switch ( datahdr->entry_type ) { case IDBdrSimple: sim_data = (IDBSimpleDataPtr) datahdr; UrmBCopy (sim_data->data, buff_ptr, datahdr->entry_size); return MrmSUCCESS; case IDBdrOverflow: return Urm__UT_Error("Idb__HDR_GetDAtaEntry", _MrmMMsg_0015, file_id, NULL, MrmFAILURE); default: return Urm__UT_Error("Idb__HDR_GetDataEntry", _MrmMMsg_0009, NULL, context_id, MrmFAILURE); } } /* *++ * * PROCEDURE DESCRIPTION: * * Idb_DB_PutDataEntry stores the resource described in the resource * context into the database, returning the resulting data entry pointer. * * FORMAL PARAMETERS: * * file_id Open IDB file * context_id contains data block to be stored * one_entry To return data entry for newly stored entry * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__HDR_PutDataEntry (IDBFile file_id, URMResourceContextPtr context_id, IDBDataHandle *data_entry) { /* * Local variables */ Cardinal result; /* returned status */ IDBSimpleDataPtr simpledata; /* simple data entry ptr */ IDBHeaderRecordPtr recptr; /* pointer data record */ IDBRecordBufferPtr bufptr; /* current record buffer pointer */ int entsiz; /* Number of bytes for new entry */ MrmOffset entoffs; /* Entry offset in buffer */ char *dataptr; /* pointer to data in context */ /* * Consistency check */ if (! UrmRCValid (context_id)) return Urm__UT_Error("Idb__HDR_PutDataEntry", _MrmMMsg_0006, NULL, NULL, MrmBAD_CONTEXT); /* * Acquire the header record and pointers to it */ result = Idb__BM_GetRecord (file_id, IDBHeaderRecordNumber, &bufptr); if ( result != MrmSUCCESS ) return result; recptr = (IDBHeaderRecordPtr) bufptr->IDB_record; /* * See if the entry will fit. Simple failure if not, use a regular data * record. */ entsiz = (int) (IDBSimpleDataHdrSize + UrmRCSize(context_id)); entsiz = _FULLWORD (entsiz); if ( entsiz > (int) recptr->free_count ) return MrmFAILURE; /* * Acquire a simple data entry, and put this entry into it. */ entoffs = recptr->free_ptr; simpledata = (IDBSimpleDataPtr) &recptr->data[entoffs]; simpledata->header.validation = IDBDataEntryValid; simpledata->header.entry_type = IDBdrSimple; simpledata->header.resource_group = UrmRCGroup(context_id); simpledata->header.resource_type = UrmRCType(context_id); simpledata->header.access = UrmRCAccess(context_id); simpledata->header.entry_size = UrmRCSize(context_id); simpledata->header.lock = UrmRCLock(context_id); dataptr = (char *) UrmRCBuffer(context_id); UrmBCopy (dataptr, simpledata->data, UrmRCSize(context_id)); /* * Set the return value to the data pointer for this entry */ data_entry->rec_no = _IdbBufferRecordNumber (bufptr); data_entry->item_offs = recptr->free_ptr; /* * Update the entry chain, mark the buffer, and return. */ simpledata->header.prev_entry = recptr->last_entry; recptr->num_entry++; recptr->last_entry = entoffs; recptr->free_ptr += entsiz; recptr->free_count -= entsiz; Idb__BM_MarkModified (bufptr); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine checks if a data entry matchs a set of filters. * It reads the record containing the header for the data entry, * then does the filter match. If both filters are NUL, then * the test becomes merely one of confirming the data entry * can be read. * * FORMAL PARAMETERS: * * file_id Open ID file * data_entry Data entry to be matched * group_filter if not null, entry found must match this group * type_filter if not null, entry found must match this type * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * TRUE Match is good * FALSE match not good. * * SIDE EFFECTS: * *-- */ Boolean Idb__HDR_MatchFilter (IDBFile file_id, IDBDataHandle data_entry, MrmCode group_filter, MrmCode type_filter) { /* * Local variables */ Cardinal result; /* return status */ IDBRecordNumber record_number; /* Record to be read in */ IDBRecordBufferPtr bufptr; /* buffer for data record */ IDBHeaderRecordPtr recptr; /* pointer data record */ IDBDataEntryHdrPtr datahdr; /* Header part of entry */ /* * Get the header record and get to the correct offset in * that record. Immediately decommit the buffer, since it won't be * compromised by this read. */ record_number = data_entry.rec_no; if ( record_number != IDBHeaderRecordNumber ) { Urm__UT_Error("Idb__HDR_MatchFilter", _MrmMMsg_0012, file_id, NULL, MrmBAD_RECORD); return FALSE; } result = Idb__BM_GetRecord (file_id, record_number, &bufptr); if ( result != MrmSUCCESS ) return FALSE; Idb__BM_Decommit (bufptr); /* * Point to the header in the entry, and check the filters. */ recptr = (IDBHeaderRecordPtr) bufptr->IDB_record; datahdr = (IDBDataEntryHdrPtr) &recptr->data[data_entry.item_offs]; if (datahdr->validation != IDBDataEntryValid) { Urm__UT_Error("Idb__HDR_GetDataEntry", _MrmMMsg_0007, NULL, NULL, MrmNOT_VALID); return FALSE; } if ( group_filter!=URMgNul && group_filter!=datahdr->resource_group ) return FALSE; if ( type_filter!=URMtNul && type_filter!=datahdr->resource_type ) return FALSE; return TRUE; } motif-2.3.8/lib/Mrm/MrmIindex.c0000644000175000017500000004170313145162623013134 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmIindex.c /main/13 1996/11/13 13:57:31 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB Facility * Index management routines * * ABSTRACT: * * These routines manage the index of an IDB file, including entering * data entries accessed by index. These routines are read or common * (used by both read and writing (MrmIindexw.c)). * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * Idb__INX_ReturnItem - Return the data entry for an index * * Idb__INX_FindIndex - Search the index * * Idb__INX_SearchIndex - Search a record for an index * * Idb__INX_GetBTreeRecord - Read a record in the B-tree * * Idb__INX_FindResources - Search the index for resources * matching the filter * */ /* * * DEFINE and MACRO DEFINITIONS * */ /* * Macros which validate index records in buffers */ #define Idb__INX_ValidLeaf(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtIndexLeaf) #define Idb__INX_ValidNode(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtIndexNode) #define Idb__INX_ValidRecord(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtIndexLeaf || \ _IdbBufferRecordType(buffer)==IDBrtIndexNode) /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_ReturnItem locates a data entry in the file, and returns * the data entry pointer (without reading the data record). * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * index The entry's case-sensitive index * data_entry To return data entry pointer for data * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_ReturnItem (IDBFile file_id, char *index, IDBDataHandle *data_entry) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr bufptr ; /* buffer containing entry */ MrmCount entndx ; /* entry index */ IDBIndexLeafRecordPtr leafrec ; /* index leaf record */ IDBIndexNodeRecordPtr noderec ; /* index node record */ /* * Attempt to find the index */ result = Idb__INX_FindIndex (file_id, index, &bufptr, &entndx) ; switch ( result ) { case MrmINDEX_GT: case MrmINDEX_LT: return MrmNOT_FOUND ; case MrmSUCCESS: break ; default: return result ; } /* * Point into the buffer, and retrieve the data pointer */ switch ( _IdbBufferRecordType (bufptr) ) { case IDBrtIndexLeaf: leafrec = (IDBIndexLeafRecordPtr) bufptr->IDB_record ; data_entry->rec_no = leafrec->index[entndx].data.internal_id.rec_no ; data_entry->item_offs = leafrec->index[entndx].data.internal_id.item_offs ; return MrmSUCCESS ; case IDBrtIndexNode: noderec = (IDBIndexNodeRecordPtr) bufptr->IDB_record ; data_entry->rec_no = noderec->index[entndx].data.internal_id.rec_no ; data_entry->item_offs = noderec->index[entndx].data.internal_id.item_offs ; return MrmSUCCESS ; default: return Urm__UT_Error ("Idb__INX_ReturnItem", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_FindIndex finds the index record containing an index entry, * and returns the buffer containing that record. It is used both as the * low-level routine for locating an index for retrieving a data entry, * and for locating the record in which a new index should be inserted. * Thus the interpretation of the return code is: * * MrmSUCCESS found the index, the index record is in the buffer * and the index_return locates the entry * MrmINDEX_GT buffer contains the leaf index record which should * MrmINDEX_LT contain the index, and index_return locates the entry * in the buffer at which search terminated. The result * value indicates how the given index orders against * the entry in index_return. * * FORMAL PARAMETERS: * * file_id Open IDB file in which to find index * index Case-sensitive index string * buffer_return To return pointer to buffer containing index record * index_return To return item's index in the records index vector * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmINDEX_GT index not found, but orders greater-than entry at * index_return * MrmINDEX_LT index not found, but orders less-than entry at * index_return * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_FindIndex (IDBFile file_id, char *index, IDBRecordBufferPtr *buffer_return, MrmCount *index_return) { /* * Local variables */ Cardinal result ; /* function results */ /* * Initialize search at the root of the index, then continue searching * until either the index is found or search terminates at some leaf record. */ if ( !file_id->index_root ) return MrmFAILURE ; result = Idb__BM_GetRecord (file_id, file_id->index_root, buffer_return) ; if ( result != MrmSUCCESS ) return result ; if ( ! Idb__INX_ValidRecord(*buffer_return) ) return Urm__UT_Error ("Idb__INX_FindIndex", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; do { result = Idb__INX_SearchIndex (file_id, index, *buffer_return, index_return) ; if ( _IdbBufferRecordType(*buffer_return) == IDBrtIndexLeaf) return result ; switch ( result ) { case MrmINDEX_GT: case MrmINDEX_LT: result = Idb__INX_GetBtreeRecord (file_id, buffer_return, *index_return, result) ; if (result != MrmSUCCESS ) { if (result == MrmNOT_FOUND) result = MrmEOF; return result ; } break ; default: return result ; } } while ( TRUE ) ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_SearchIndex searches a record for an index. The record * may be either a leaf or a node record. If the index is found, * index_return is its entry in the records index vector. If it is not * found, then index_return locates the entry in the record at which * search terminated. * * Thus the interpretation of the return code is: * * MrmSUCCESS found the index, and the index_return locates the entry * MrmINDEX_GT index orders greater-than the entry at index_return * MrmINDEX_LT index orders less-than the entry at index_return * * FORMAL PARAMETERS: * * file_id Open IDB file in which to find index * index Case-sensitive index string * buffer Buffer containing record to be searched * index_return To return item's index in the records index vector * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmINDEX_GT index not found, but orders greater-than entry at * index_return * MrmINDEX_LT index not found, but orders less-than entry at * index_return * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_SearchIndex (IDBFile file_id, char *index, IDBRecordBufferPtr buffer, MrmCount *index_return) { /* * Local variables */ MrmType buftyp ; /* buffer type */ IDBIndexLeafRecordPtr leafrec =NULL ; /* index leaf record */ IDBIndexLeafHdrPtr leafhdr =NULL; /* index leaf header */ IDBIndexNodeRecordPtr noderec ; /* index node record */ IDBIndexNodeHdrPtr nodehdr ; /* index node header */ IDBIndexLeafEntryPtr leaf_ndxvec = NULL; /* index leaf entry vector */ IDBIndexNodeEntryPtr node_ndxvec = NULL; /* index node entry vector */ MrmCount ndxcnt ; /* number of entries in vector */ char *stgbase ; /* base adddress for string offsets */ int lowlim ; /* binary search lower limit index */ int uprlim ; /* binary search upper limit index */ char *ndxstg ; /* pointer to current index string */ int cmpres=0; /* strncmp result */ /* * Set up search pointers based on the record type */ buftyp = _IdbBufferRecordType (buffer) ; switch ( buftyp ) { case IDBrtIndexLeaf: leafrec = (IDBIndexLeafRecordPtr) buffer->IDB_record ; leafhdr = (IDBIndexLeafHdrPtr) &leafrec->leaf_header ; leaf_ndxvec = leafrec->index ; ndxcnt = leafhdr->index_count ; stgbase = (char *) leafrec->index ; break ; case IDBrtIndexNode: noderec = (IDBIndexNodeRecordPtr) buffer->IDB_record ; nodehdr = (IDBIndexNodeHdrPtr) &noderec->node_header ; node_ndxvec = noderec->index ; ndxcnt = nodehdr->index_count ; stgbase = (char *) noderec->index ; break ; default: return Urm__UT_Error ("Idb__INX_SearchIndex", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; } /* * Search the index vector for the given index (binary search) */ Idb__BM_MarkActivity (buffer) ; for ( lowlim=0,uprlim=ndxcnt-1 ; lowlim<=uprlim ; ) { *index_return = (lowlim+uprlim) / 2 ; ndxstg = (buftyp==IDBrtIndexLeaf) ? (char *) stgbase + leaf_ndxvec[*index_return].index_stg : (char *) stgbase + node_ndxvec[*index_return].index_stg ; cmpres = strncmp (index, ndxstg, IDBMaxIndexLength) ; if ( cmpres == 0 ) return MrmSUCCESS ; if ( cmpres < 0 ) uprlim = *index_return - 1 ; if ( cmpres > 0 ) lowlim = *index_return + 1 ; } /* * Not found, result determined by final ordering. */ return (cmpres>0) ? MrmINDEX_GT : MrmINDEX_LT ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine reads in the next level index record in the B-tree * associated with some entry in the current record (i.e. the one * currently contained in the buffer). The buffer pointer is reset. * The order variable indicates which record to read: * MrmINDEX_GT - read the record ordering greater-than the entry * MrmINDEX_LT - read the record ordering less-than the entry * * FORMAL PARAMETERS: * * file_id Open IDB file from which to read record * buffer_return points to current buffer; reset to buffer read in * entry_index entry in current buffer to use as reference * order MrmINDEX_GT for GT ordered record, else MrmINDEX_LT * for LT ordered record. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_ORDER Order variable has illegal value * MrmBAD_RECORD new record not an index record * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_GetBtreeRecord ( IDBFile file_id, IDBRecordBufferPtr *buffer_return, MrmCount entry_index, Cardinal order) { /* * Local variables */ Cardinal result ; /* function results */ IDBIndexNodeRecordPtr recptr ; /* node record in buffer */ IDBRecordNumber recno ; /* Record number to read in */ /* * Set buffer pointers */ recptr = (IDBIndexNodeRecordPtr) (*buffer_return)->IDB_record ; /* * Retrieve the record number */ switch ( order ) { case MrmINDEX_GT: recno = recptr->index[entry_index].GT_record ; break ; case MrmINDEX_LT: recno = recptr->index[entry_index].LT_record ; break ; default: return Urm__UT_Error ("Idb__INX_GetBTreeRecord", _MrmMMsg_0010, file_id, NULL, MrmBAD_ORDER) ; } /* * Retrieve and sanity check the record */ result = Idb__BM_GetRecord (file_id, recno, buffer_return) ; if ( result != MrmSUCCESS ) return result ; if ( ! Idb__INX_ValidRecord(*buffer_return) ) return Urm__UT_Error ("Idb__INX_GetBTreeRecord", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; /* * Record successfully retrieved */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This is the internal routine which searches the database for * indexed resources matching a filter. It starts at the current node, * then recurses down the BTree inspecting every entry. Each entry * which matches the filter is appended to the index list. * * FORMAL PARAMETERS: * * file_id The IDB file id returned by XmIdbOpenFile * recno The record to be searched. If a node entry, * then each pointed-to record is also searched. * group_filter if not null, entries found must match this group * type_filter if not null, entries found must match this type * index_list A pointer list in which to return index * strings for matches. The required strings * are automatically allocated. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_FindResources (IDBFile file_id, IDBRecordNumber recno, MrmGroup group_filter, MrmType type_filter, URMPointerListPtr index_list) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr bufptr ; /* buffer containing entry */ int entndx ; /* entry loop index */ IDBIndexLeafRecordPtr leafrec ; /* index leaf record */ IDBIndexLeafHdrPtr leafhdr ; /* index leaf header */ IDBIndexNodeRecordPtr noderec ; /* index node record */ IDBIndexNodeHdrPtr nodehdr ; /* index node header */ IDBIndexLeafEntryPtr leaf_ndxvec ; /* index leaf entry vector */ IDBIndexNodeEntryPtr node_ndxvec ; /* index node entry vector */ MrmCount ndxcnt ; /* number of entries in vector */ char *stgbase ; /* base adddress for string offsets */ /* * Read the record in, then bind pointers and process the record. */ result = Idb__BM_GetRecord (file_id, recno, &bufptr) ; if ( result != MrmSUCCESS ) return result ; switch ( _IdbBufferRecordType (bufptr) ) { /* * Simply apply the filter to all entries in the leaf record */ case IDBrtIndexLeaf: leafrec = (IDBIndexLeafRecordPtr) bufptr->IDB_record ; leafhdr = (IDBIndexLeafHdrPtr) &leafrec->leaf_header ; leaf_ndxvec = leafrec->index ; ndxcnt = leafhdr->index_count ; stgbase = (char *) leafrec->index ; for ( entndx=0 ; entndxIDB_record ; nodehdr = (IDBIndexNodeHdrPtr) &noderec->node_header ; node_ndxvec = noderec->index ; ndxcnt = nodehdr->index_count ; stgbase = (char *) noderec->index ; result = Idb__INX_FindResources (file_id, node_ndxvec[0].LT_record, group_filter, type_filter, index_list) ; if ( result != MrmSUCCESS ) return result ; for ( entndx=0 ; entndxIDB_record ; nodehdr = (IDBIndexNodeHdrPtr) &noderec->node_header ; node_ndxvec = noderec->index ; stgbase = (char *) noderec->index ; if ( Idb__DB_MatchFilter (file_id, entry_data, group_filter, type_filter) ) UrmPlistAppendString (index_list, stgbase+node_ndxvec[entndx].index_stg) ; result = Idb__INX_FindResources (file_id, node_ndxvec[entndx].GT_record, group_filter, type_filter, index_list) ; if ( result != MrmSUCCESS ) return result ; } return MrmSUCCESS ; default: return Urm__UT_Error ("Idb__INX_FindResources", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; } } motif-2.3.8/lib/Mrm/Mrmos.c0000644000175000017500000000501312672140200012316 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmos.c /main/7 1996/11/13 14:03:33 drk $" #endif #endif #include #ifdef __cplusplus extern "C" { /* some 'locale.h' do not have prototypes (sun) */ #endif #include #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration */ #endif /* __cplusplus */ #include /* For _NO_PROTO declaration. */ #include "MrmosI.h" /************************************************************ * * The following routines are used for portable uid files to convert * between the host's native format for floats and IEEE format floats. * Type SINGLE_FLOAT in a uid file should be stored as a 32 bit IEEE float * Type FLOAT in a uid file should be stored as a 64 bit IEEE double * The routines need support for the VAX architecture, maybe others. * ************************************************************/ /*ARGSUSED*/ void _MrmOSHostFloatToIEEE(float *val) /* unused */ { /*EMPTY*/ } /*ARGSUSED*/ void _MrmOSHostDoubleToIEEE(double *val) /* unused */ { /*EMPTY*/ } /*ARGSUSED*/ void _MrmOSIEEEFloatToHost(float *val) /* unused */ { /*EMPTY*/ } /*ARGSUSED*/ void _MrmOSIEEEDoubleToHost(double *val) /* unused */ { /*EMPTY*/ } /************************************************************************ * * _MrmOSSetLocale wrapper so vendor can disable call to set * if locale is superset of "C". * ************************************************************************/ String _MrmOSSetLocale(String locale) { return setlocale(LC_ALL, locale); } motif-2.3.8/lib/Mrm/Mrmappl.c0000644000175000017500000006056313145162623012655 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmappl.c /main/17 1996/11/13 13:59:58 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * These are the top-level routines in URM normally accessible to * and used by an application at runtime to access URM facilities. * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * MrmOpenHierarchy Open a hierarchy * * MrmOpenHierarchyPerDisplay Open a hierarchy taking display arg * * MrmOpenHierarchyFromBuffer Open a hierarchy from a memory buffer * * MrmCloseHierarchy Close an open hierarchy * * MrmRegisterClass Register a widget class * * MrmFetchInterfaceModule Fetch widgets in an interface module * * MrmFetchWidget Fetch a widget * * MrmFetchWidgetOverride Fetch a widget, overriding name, args * * MrmFetchSetValues Do SetValues from UID literals * */ /* *++ * * PROCEDURE DESCRIPTION: * * This routine allocates a hierarchy descriptor, and opens * all the IDB files in the hierarchy. It initializes the * optimized search lists in the hierarchy from the open files. * All files are closed if there are any errors. * * FORMAL PARAMETERS: * * num_files The number of files in the name list * name_list A list of the file names * os_ext_list A list of system-dependent ancillary * structures corresponding to the files. * This parameter may be NULL. * hierarchy_id_return To return the hierarchy id * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * Others see UrmIdbOpenFileRead * * SIDE EFFECTS: * *-- */ Cardinal MrmOpenHierarchy ( #if NeedWidePrototypes int num_files, #else MrmCount num_files, #endif String *name_list, MrmOsOpenParamPtr *os_ext_list, MrmHierarchy *hierarchy_id_return) { /* * Local variables */ Cardinal result; _MrmProcessLock(); result = Urm__OpenHierarchy (num_files, name_list, os_ext_list, hierarchy_id_return, FALSE, NULL); _MrmProcessUnlock(); return result; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine allocates a hierarchy descriptor, and opens * all the IDB files in the hierarchy. It initializes the * optimized search lists in the hierarchy from the open files. * All files are closed if there are any errors. * * FORMAL PARAMETERS: * * display The Display to be passed to XtResolvePathname * num_files The number of files in the name list * name_list A list of the file names * os_ext_list A list of system-dependent ancillary * structures corresponding to the files. * This parameter may be NULL. * hierarchy_id_return To return the hierarchy id * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * Others see UrmIdbOpenFileRead * * SIDE EFFECTS: * *-- */ Cardinal MrmOpenHierarchyPerDisplay (Display *display, #if NeedWidePrototypes int num_files, #else MrmCount num_files, #endif String *name_list, MrmOsOpenParamPtr *os_ext_list, MrmHierarchy *hierarchy_id_return) { /* * Local variables */ MrmOsOpenParam os_data; MrmOsOpenParamPtr new_os_ext_list = &os_data; Cardinal result; _MrmProcessLock(); if (os_ext_list == NULL) os_ext_list = (MrmOsOpenParamPtr *)&new_os_ext_list; (*os_ext_list)->display = display; result = Urm__OpenHierarchy(num_files, name_list, os_ext_list, hierarchy_id_return, FALSE, NULL); _MrmProcessUnlock(); return result; } /* *++ * * PROCEDURE DESCRIPTION: * * MrmOpenHierarcyFromBuffer opens a buffer containing the * memory image of a UID file. * * FORMAL PARAMETERS: * * hierarchy_id ID of an open URM database hierarchy * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal MrmOpenHierarchyFromBuffer (unsigned char *uid_buffer, MrmHierarchy *hierarchy_id_return) { /* * Local variables */ Cardinal result; _MrmProcessLock(); result = Urm__OpenHierarchy((MrmCount) 1, NULL, NULL, hierarchy_id_return, TRUE, uid_buffer); _MrmProcessUnlock(); return result; } /* *++ * * PROCEDURE DESCRIPTION: * * MrmCloseHierarchy closes a URM search hierarchy. * * FORMAL PARAMETERS: * * hierarchy_id ID of an open URM database hierarchy * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal MrmCloseHierarchy (MrmHierarchy hierarchy_id) { /* * Local variables */ Cardinal result; _MrmProcessLock(); result = Urm__CloseHierarchy (hierarchy_id); _MrmProcessUnlock(); return result; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine registers a vector of names and associated values * for access in URM. The values may be callback routines, pointers * to user-defined data, or any other values. The information provided * is used exactly as registered callback information is used. * * The names in the list are case-sensitive, as usual. The list may * either ordered or unordered; this routine will detect lexicographic * ordering if it exists, and exploit it. * * For details on callbacks in URM, consult XmRegisterMRMCallbacks. * * FORMAL PARAMETERS: * * reglist A list of name/value pairs for the names to * be registered. Each name is a case-sensitive * nul-terminated ASCII string. Each value is * a 32-bit quantity, interpreted as a procedure * address if the name is a callback routine, and * uninterpreted otherwise. * num_reg The number of entries in reglist. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal MrmRegisterNames (MrmRegisterArglist reglist, #if NeedWidePrototypes int num_reg #else MrmCount num_reg #endif ) { /* * Local variables */ Cardinal result; /* function result */ String *names; /* vector of names */ XtPointer *values; /* vector of values */ int ndx; /* loop index */ _MrmProcessLock(); /* * Construct RegisterNames vectors, and call the WCI routine */ names = (String *) XtMalloc (num_reg*sizeof(String)); values = (XtPointer *) XtMalloc (num_reg*sizeof(XtPointer)); for ( ndx=0 ; ndxcount ; ndx++ ) { result = MrmFetchWidget (hierarchy_id, modptr->topmost[ndx].index, parent, &cur_w, &class); if ( result != MrmSUCCESS ) { UrmFreeResourceContext (mod_context); _MrmProcessUnlock(); _MrmAppUnlock(app); return result; } } /* * successfully fetched all widgets */ UrmFreeResourceContext (mod_context); _MrmProcessUnlock(); _MrmAppUnlock(app); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * MrmFetchWidget fetchs any indexed application widget. As usual in fetch * operations, the fetched widget's subtree is also fetched. There are * no constraints on this widget except that it must not also appear * as the child of some widget within its own subtree, i.e. there must * be no cycles in the subtree graph! MrmFetchWidget does not do a * XtManageChild for the newly created widget. * * The semantics of the URM database require that any widget which is to * be fetched with MrmFetchWidget meet the following requirements: * * o Not be referenced as the child of any widget in the database * * o Be indexed * * MrmFetchWidget replaces XmFetchTopmost, and is used to fetch * topmost widgets where MrmFetchInterfaceModule is not used. A topmost * widget is either the main window or any indexed widget whose parent is * the top-level widget. MrmFetchWidget may be called at any time to fetch * a widget which was not fetched at application startup. MrmFetchWidget * determines if a widget has already been fetched by checking *w_return * for a NULL value. Non-NULL values signify that the widget already * has been fetched, and MrmFetchWidget no-ops. (If the toolkit ever * supplies a validation routine for widgets, this will be used in * place of a non-NULL check). Thus MrmFetchWidget may be used to * defer fetching popup widgets until they are first referenced * (presumably in a callback), and then fetching them once. * * MrmFetchWidget may also be used to make multiple instances of a * widget (and its subtree). In this case, the UID definition functions * as a skeleton; there are no constraints on how many times a widget * definition may be fetched. The only requirement is the *w_return be * NULL on each call. This may be used to make multiple copies of * a widget in e.g. a dialog box or menu (to construct a uniform form). * * The index which identifies the widget must be known to the application * via previous agreement. * MrmFetchWidget will successfully fetch topmost widgets as long as the * parent parameter is correct (the top-level widget), and this * replaces XmFetchTopmost (which vanishes). * * FORMAL PARAMETERS: * * hierarchy_id Hierarchy containing interface definition * index The index of the widget to fetch. * parent ID of the parent widget * w_return To return the widget id of the created widget. * *w_return must be NULL or MrmFetchWidget no-ops. * class_return To return the code identifying the widget class. * This is principally used to distinguish main window * and other toolkit widgets. It will be one of the * URMwc... codes defined in MRM.h. The code * for a main window is URMwcMainWindow. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND widget not found in database * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal MrmFetchWidget (MrmHierarchy hierarchy_id, String index, Widget parent, Widget *w_return, MrmType *class_return) { return MrmFetchWidgetOverride (hierarchy_id, index, parent, NULL, NULL, 0, w_return, class_return); } /* *++ * * PROCEDURE DESCRIPTION: * * This procedure is the extended version of MrmFetchWidget. It is * identical to MrmFetchWidget in all respsects, except that it allows * the caller to override the widget's name and any number of the * arguments which would otherwise receive from the UID database or * one of the defaulting mechanisms (i.e. the override is not limited * to those arguments in the UID file). * * The override parameters apply only to the widget fetched and returned * by this procedure; its children (subtree) do not receive any override * parameters. * * FORMAL PARAMETERS: * * hierarchy_id Hierarchy containing interface definition * index The index of the widget to fetch. * parent ID of the parent widget * ov_name Name to override widget name (NULL for no override) * ov_args Override arglist, exactly as would be given to * XtCreateWidget (conversion complete, etc). NULL * for no override. * ov_num_args # args in ov_args; 0 for no override * w_return To return the widget id of the created widget. * *w_return must be NULL or MrmFetchWidget no-ops. * class_return To return the code identifying the widget class. * This is principally used to distinguish main window * and other toolkit widgets. It will be one of the * URMwc... codes defined in MRM.h. The code * for a main window is URMwcMainWindow. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND widget not found in database * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal MrmFetchWidgetOverride (MrmHierarchy hierarchy_id, String index, Widget parent, String ov_name, ArgList ov_args, Cardinal ov_num_args, Widget *w_return, MrmType *class_return) { /* * Local variables */ Cardinal result; /* function results */ URMResourceContextPtr w_context; /* context containing widget */ RGMWidgetRecordPtr widgetrec; /* widget record in context */ IDBFile hfile_id; /* file in widget was found */ URMResourceContextPtr wref_ctx; /* for widget references */ URMSetValuesDescPtr svlist = NULL; /* list of SetValues descriptors */ int ndx ; /* loop index */ char errmsg[300]; _MrmWidgetToAppContext(parent); _MrmAppLock(app); _MrmProcessLock(); /* * Validate the hierachy, then attempt to fetch the widget */ if ( hierarchy_id == NULL ) { result = Urm__UT_Error ("MrmFetchWidgetOverride", _MrmMMsg_0023, NULL, NULL, MrmBAD_HIERARCHY); _MrmProcessUnlock(); _MrmAppUnlock(app); return result; } if ( ! MrmHierarchyValid(hierarchy_id) ) { result = Urm__UT_Error ("MrmFetchWidgetOverride", _MrmMMsg_0024, NULL, NULL, MrmBAD_HIERARCHY); _MrmProcessUnlock(); _MrmAppUnlock(app); return result; } result = UrmGetResourceContext (NULL, NULL, 300, &w_context); if ( result != MrmSUCCESS ) { _MrmProcessUnlock(); _MrmAppUnlock(app); return result; } result = UrmHGetWidget (hierarchy_id, index, w_context, &hfile_id); if ( result != MrmSUCCESS ) { UrmFreeResourceContext (w_context); _MrmProcessUnlock(); _MrmAppUnlock(app); return result; } /* * Validate the widget record, then set the class return. Then instantiate the * widget and its subtree. */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (w_context); if ( ! UrmWRValid(widgetrec) ) { UrmFreeResourceContext (w_context); result = Urm__UT_Error ("MrmFetchWidgetOverride", _MrmMMsg_0026, NULL, w_context, MrmFAILURE); _MrmProcessUnlock(); _MrmAppUnlock(app); return result; } /* * The following test breaks compatibility with the CDE1.0 * version of Mrm and cannot be done for CDEnext. * * if (widgetrec->access == URMaPrivate) * { * UrmFreeResourceContext (w_context); * sprintf(errmsg, _MrmMMsg_0119, index); * result = Urm__UT_Error("MrmFetchWidgetOverride", errmsg, * NULL, w_context, MrmFAILURE); * _MrmProcessUnlock(); * _MrmAppUnlock(app); * return result; * } */ *class_return = widgetrec->type; Urm__CW_InitWRef (&wref_ctx); result = UrmCreateWidgetTree (w_context, parent, hierarchy_id, hfile_id, ov_name, ov_args, ov_num_args, URMrIndex, index, 0L, MrmManageDefault, (URMPointerListPtr *)&svlist, wref_ctx, w_return); UrmFreeResourceContext (w_context); if ( result != MrmSUCCESS ) { _MrmProcessUnlock(); _MrmAppUnlock(app); return result; } /* * Free up resources */ if ( svlist != NULL ) { for ( ndx=0 ; ndx #endif #ifndef _MrmConst #define _MrmConst XmConst #endif #include #include "MrmMsgI.h" #if 0 /* Comments below contain nested comments. */ /*===========================================================================*/ /* IMPORTANT NOTICE!! Please READ before editing this file! */ /* */ /* This file is also used to generate the XPG4 type message catalog. */ /* NO MESSAGES CAN BE REMOVED! If a message is no longer used, it can */ /* be removed from the object module by adding an #if 0 or /* above the */ /* line(s) containing the message, and the corresponding #endif or */ /* end-of-comment after the line(s). */ /* */ /* When ADDING messages to existing "sets" - a set is found inside /**** *****/ /* always add the new "externaldef(messages)" definition after everything */ /* else in the set. Example: */ /* */ /* /**************** First.c ****************/ /* */ /* externaldef(mrmmsg) _MrmConst char *_MrmMsgFirst_0000 = */ /* "Memory error"; */ /* */ /* /* Needed for message catalog BC. Do not remove */ /* /***+MSG_First_1000 "Fake message."*/ /* /***+$ MSG_First_1000 message is obsolete - DO NOT localize this message.*/ /* */ /* */ /* /**************** Second.c ****************/ /* */ /* Messages added to the set "First" should be added after the line */ /* /****+MSG_First_1000 "Fake message."*/ /* not after "Memory error". */ /* */ /* If you need to add another message "set", do so right before the */ /* externaldef(mrmmsg) nl_catd Mrm_catd = NULL; definition. */ /* */ /*===========================================================================*/ #endif /* * Text for message catalog header */ /***+$ This message catalog contains messages issued by Motif Mrm library.*/ /***+$ Consult X-Window systems, OSF/MOTIF Programmer's Guide and OSF/MOTIF*/ /***+$ Programmer's Reference Manual for technical terms if you have any*/ /***+$ doubts about their meanings.*/ /***+$ Do not translate variables such as %s, %d %s ... etc.*/ /***+$ Do not translate Motif resource name, such as XmNlabelType.*/ /***+$ Special terms with capital letter(s) should not be translated.*/ /***+$ "False" and "True" are keywords. Do not translate.*/ /***+ */ /***+ */ /***************** Mrm *********************/ /* Messages in the code */ externaldef(mrmmsg) _MrmConst char *_MrmMsg_0000 = "Vector allocation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0001 = "Buffer allocation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0002 = "Invalid buffer"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0003 = "Get block failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0004 = "Put block failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0005 = "Invalid record header"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0006 = "Invalid context"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0007 = "Invalid data entry"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0008 = "Invalid segment entry"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0009 = "Unknown data entry type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0010 = "Unexpected record type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0011 = "File version %s is greater than Mrm version %s."; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0012 = "This is not the header record."; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0013 = "Resource index out of range"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0014 = "NULL data pointer"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0015 = "Illegal overflow record"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0016 = "GT record mismatch"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0017 = "LT record mismatch"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0018 = "Unexpected parent record type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0019 = "Record beyond EOF"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0020 = "Cannot swap record #%d type %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0021 = "Encountered unimplemented type %d, in Callback item %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0022 = "Encountered unimplemented argument type %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0023 = "NULL hierarchy id"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0024 = "Invalid hierarchy"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0025 = "Invalid interface module"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0026 = "Invalid widget record"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0027 = "Context allocation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0028 = "Validation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0029 = "Resource size too large"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0030 = "Display not yet opened"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0031 = "Could not open file %s"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0032 = "Could not open file %s - UID file version mismatch"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0033 = "XmGetPixmap failed with XmUNSPECIFIED_PIXMAP for %s"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0034 = "XCreateImage failed during IconImage conversion"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0035 = "XCreatePixmap failed during IconImage conversion"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0036 = "XCreateGC failed during IconImage conversion"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0037 = "XtMalloc failed during IconImage conversion"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0038 = "Could not load color '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0039 = "Could not convert RGB color/pixel '%d,%d,%d'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0040 = "Invalid color descriptor type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0041 = "Illegal Color item monochrome state %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0042 = "Cannot find literal '%s'"; /***+$ literal in this context means a named value. */ externaldef(mrmmsg) _MrmConst char *_MrmMsg_0043 = "Invalid resource context"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0044 = "Too many widgets"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0045 = "Topmost index out of bounds"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0046 = "List allocation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0047 = "List vector allocation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0048 = "Vector re-allocation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0049 = "String allocation failed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0050 = "UID file is obsolete - has no compression table"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0051 = "Could not find class descriptor for class %s"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0052 = "Cannot find indexed widget '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0053 = "Cannot find RID widget '%x'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0054 = "?? UNKNOWN key type %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0055 = "Unknown widget variety"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0056 = "Unresolved Widget reference in creation callback"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0057 = "Could not Fixup creation callbacks"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0058 = "Unknown child type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0059 = "Child of parent not found"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0060 = "Widget reference not Indexed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0061 = "Could not convert color/pixel '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0062 = "Could not uncompress string code %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0063 = "Unhandled resource group"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0064 = "Could not convert ASCIZ '%s' to compound string"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0065 = "Could not parse translation table '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0066 = "Could not convert identifier '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0067 = "Internal error: case MrmRtypeIconImage found"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0068 = "Internal error: case MrmRtypeXBitmapFile found"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0069 = "Internal error: Could not convert Display to String"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0070 = "Could not convert font '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0071 = "Could not convert fontset '%s'"; /***+$ please do not translate fontset.*/ externaldef(mrmmsg) _MrmConst char *_MrmMsg_0072 = "Could not open one or more fonts for fontset '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0073 = "Could not add fontlist font '%s' to list"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0074 = "Could not add fontlist fontset '%s' to list"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0075 = "Could not convert class record name '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0076 = "Could not convert keysym string '%s' to KeySym"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0077 = "Cannot find indexed literal '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0078 = "Cannot find RID literal '%x'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0079 = "Unknown literal key type %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0080 = "Invalid ColorTable literal type %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0081 = "Invalid ColorTable type code %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0082 = "Invalid Color literal type %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0083 = "Invalid ColorItem type code %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0084 = "Callback routine '%s' not registered"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0085 = "Widget reference not Indexed"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0086 = "Cannot find indexed widget resource '%s'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0087 = "Cannot find RID widget resource '%x'"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0088 = "Unknown resource key type %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0089 = "Could not instantitate widget tree"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0090 = "Null user-defined class name"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0091 = "Invalid class code"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0092 = "Too many arguments"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0093 = "Invalid compression code"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0094 = "Invalid or unhandled type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0095 = "Vector too big"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0096 = "Empty routine name"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0097 = "Char8Vector not yet implemented"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0098 = "CStringVector not yet implemented"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0099 = "Too many children"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0100 = "Null children list descriptor"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0101 = "Child index out of bounds"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0102 = "Null index"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0103 = "Invalid key type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0104 = "Arg index out of bounds"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0105 = "Invalid widget/gadget record"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0106 = "Invalid callback descriptor"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0107 = "Callback item index out of bounds"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0108 = "Could not uncompress string code %d"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0109 = "Too many items"; /* BEGIN OSF Fix CR 4859 */ externaldef(mrmmsg) _MrmConst char *_MrmMsg_0110 = "Could not convert multibyte string to widecharacter string"; /* END OSF Fix CR 4859 */ externaldef(mrmmsg) _MrmConst char *_MrmMsg_0111 = "Could not convert integer '%d' to icon image"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0112 = "Could not convert to icon image"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0113 = "Could not open buffer - UID version mismatch"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0114 = "Could not open buffer"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0115 = "Unable to convert units to XmPIXELS: bad units format or type"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0116 = "Unable to convert units to XmPIXELS: floating point overflow"; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0117 = "Invalid version string %s in UID file. Unable to read file."; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0118 = "Mrm version %s is greater than file version %s;\nplease recompile UIL file."; externaldef(mrmmsg) _MrmConst char *_MrmMsg_0119 = "Object '%s' declared PRIVATE."; #ifndef NO_MESSAGE_CATALOG externaldef(mrmmsg) nl_catd Mrm_catd = NULL; #endif motif-2.3.8/lib/Mrm/MrmWidget.h0000644000175000017500000000574113145162623013146 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef MrmWidget_H #define MrmWidget_H /* ** This file includes all .h files and definitions which are needed by Mrm code ** which does require access to the widget-building variants of Xm */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* MrmWidget_H */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Mrm/MrmIfile.c0000644000175000017500000001774413145162623012754 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmIfile.c /main/13 1996/11/13 13:56:30 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM) * * ABSTRACT: * * This module contains the low-level file utilities * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include /* Standard IO definitions */ #include #include #ifndef X_NOT_STDC_ENV #include #endif /* * * DEFINE and MACRO DEFINITIONS * */ #define PMODE 0666 /* Default protection mode before umask */ #define FAILURE -1 /* creat/stat returns this */ /* *++ * * PROCEDURE DESCRIPTION: * * This routine will take the file name specified and * open or create it depending on the access parameter. * An attempt is made to save any existing file of the * same name. * * * FORMAL PARAMETERS: * * name the system-dependent file spec of the IDB file * to be opened. * accss access type desired, read or write access. * os_ext an operating specific structure to take advantage * of file system features (if any). * file_id IDB file id used in all calls to low level routines. * returned_fname The resultant file name. * * IMPLICIT INPUTS: * * NONE * * IMPLICIT OUTPUTS: * * NONE * * FUNCTION VALUE: * * Returns an integer: * * MrmSUCCESS - When access is read and open works * MrmCREATE_NEW - When access is write and open works * MrmNOT_FOUND - When access is read and the file isn't present * MrmFAILURE - When the open fails for any other reason * * SIDE EFFECTS: * * Opens or creates the named file and assigns a channel to it. * *-- */ Cardinal Idb__FU_OpenFile (char *name, MrmCode access, MrmOsOpenParamPtr os_ext, IDBLowLevelFilePtr *file_id, char *returned_fname) { /* * Local variables */ int file_desc; /* 'unix' file descriptor */ int length; /* the length of the above string */ IDBLowLevelFile *a_file; /* pointer to the file_id */ /* Fill in the result name with the name specified so far */ length = strlen (name); strcpy (returned_fname, name); returned_fname[length] = 0; /* Check if this file is to be opened for read or write access */ if (access == URMWriteAccess) { file_desc = open (name, O_RDWR, PMODE); if (file_desc != FAILURE) /* filename already exists. */ { if (os_ext == 0) return MrmFAILURE; else if (!os_ext->nam_flg.clobber_flg) return MrmEXISTS; /* no clobber. return Exists */ else if (os_ext->version != MrmOsOpenParamVersion) return MrmFAILURE; (void) close (file_desc); /* we care not what close returns*/ } file_desc = creat (name,PMODE); if (file_desc == FAILURE) /* verify that worked */ return MrmFAILURE; close (file_desc); /* we care not what close returns */ file_desc = open (name, O_RDWR, PMODE); if (file_desc == FAILURE) /* verify that worked */ return MrmFAILURE; } /* Else this file is to opened for read access */ else if (access == URMReadAccess) { file_desc = open (name, O_RDONLY, PMODE); /* verify that worked */ if (file_desc == FAILURE) { if ( errno == EACCES ) return MrmFAILURE; else return MrmNOT_FOUND; } } /* Not URMReadAccess or URMWriteAccess, so return invalid access type */ else return MrmFAILURE; /* * now all we have to do is set up the IDBFile and return the * proper success code. */ *file_id = (IDBLowLevelFilePtr) XtMalloc(sizeof (IDBLowLevelFile)); if (*file_id==0) return MrmFAILURE; a_file = (IDBLowLevelFile *) *file_id; a_file->name = XtMalloc (length+1); if (a_file->name==0) { XtFree ((char*)*file_id); return (MrmFAILURE); } a_file->file_desc = file_desc; strcpy (a_file->name, name); a_file->name[length] = 0; if (access == URMWriteAccess) return (MrmCREATE_NEW); else return (MrmSUCCESS); } /* *++ * * PROCEDURE DESCRIPTION: * * This routine will close the file and free any allocated storage * * * FORMAL PARAMETERS: * * file_id IDB file id * delete delete the file if == true * * IMPLICIT INPUTS: * * the file name and channel from the IDBFile record * * IMPLICIT OUTPUTS: * * NONE * * FUNCTION VALUE: * * MrmSUCCESS - When the file is closed [and deleted] successfully * MrmFAILURE - When the close fails * * SIDE EFFECTS: * * Closes the file, deassigns the channel and possible deletes the file. * *-- */ Cardinal Idb__FU_CloseFile (IDBLowLevelFile *file_id , int delete) { /* * Local variables */ int status; /* ret status for sys services */ status = close (file_id->file_desc); if (status != 0) return MrmFAILURE; if (delete) { status = unlink (file_id->name); } XtFree (file_id->name); XtFree ((char*)file_id); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This function reads in the desired record into the given * buffer. * * FORMAL PARAMETERS: * * file_id the IDB file identifier * block_num the record number to retrieve * buffer pointer to the buffer to fill in * * IMPLICIT INPUTS: * * NONE * * IMPLICIT OUTPUTS: * * NONE * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND entry not found * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * * The buffer is filled in. Should the $READ fail the buffer's * content is not predictable. * *-- */ Cardinal Idb__FU_GetBlock (IDBLowLevelFile *file_id, IDBRecordNumber block_num, char *buffer) { /* * Local variables */ int number_read; /* the number of bytes actually read */ int fdesc ; /* file descriptor from lowlevel desc */ fdesc = file_id->file_desc ; lseek (fdesc, (block_num-1)*IDBRecordSize, 0); number_read = read (file_id->file_desc, buffer, IDBRecordSize); if (number_read != IDBRecordSize) return MrmFAILURE; else return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This function writes the data in the givin buffer into * the desired record in the file. * * FORMAL PARAMETERS: * * file_id the IDB file identifier * block_num the record number to write * buffer pointer to the buffer to read from * * IMPLICIT INPUTS: * * NONE * * IMPLICIT OUTPUTS: * * NONE * * FUNCTION VALUE: * * Returns an integer by value: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * * the file is modified. * *-- */ Cardinal Idb__FU_PutBlock (IDBLowLevelFile *file_id, IDBRecordNumber block_num, char *buffer) { /* * Local variables */ int number_written; /* the # of bytes acctually written */ int fdesc ; /* file descriptor from lowlevel desc */ fdesc = file_id->file_desc ; lseek (fdesc, (block_num-1)*IDBRecordSize, 0); number_written = write (file_id->file_desc, buffer, IDBRecordSize); if (number_written != IDBRecordSize) return MrmFAILURE; else return MrmSUCCESS; } motif-2.3.8/lib/Mrm/Makefile.in0000644000175000017500000006364113211512767013150 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/Mrm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(mrm_HEADERS) $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(mrmdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libMrm_la_DEPENDENCIES = ../Xm/libXm.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_1 = MrmIbuffer.lo MrmIentry.lo MrmIfile.lo MrmIheader.lo \ MrmIindex.lo MrmIindexw.lo MrmIrid.lo MrmIswap.lo MrmItop.lo \ MrmItopw.lo Mrmappl.lo Mrmcontext.lo Mrmerror.lo Mrmhier.lo \ Mrmicon.lo Mrminit.lo Mrmlread.lo Mrmlwrite.lo Mrmmodule.lo \ Mrmos.lo Mrmptrlist.lo Mrmtable.lo Mrmtime.lo Mrmvm.lo \ Mrmwci.lo Mrmwcrw.lo Mrmwcrwr.lo Mrmwread.lo Mrmwrefs.lo \ Mrmwvalues.lo Mrmwwrite.lo MrmMessages.lo am_libMrm_la_OBJECTS = $(am__objects_1) libMrm_la_OBJECTS = $(am_libMrm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libMrm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libMrm_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libMrm_la_SOURCES) DIST_SOURCES = $(libMrm_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(mrm_HEADERS) $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = Mrm.msg INCLUDES = -I$(srcdir)/.. -I.. -I../Xm ${X_CFLAGS} mrmdir = $(includedir)/Mrm libMrm_la_LIBADD = ../Xm/libXm.la ${X_LIBS} -lXt ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} libMrm_la_LDFLAGS = -version-info @CURRENT@:@REVISION@:@AGE@ lib_LTLIBRARIES = libMrm.la noinst_HEADERS = IDB.h \ Mrm.h \ MrmMsgI.h \ MrmWidget.h mrm_HEADERS = MrmDecls.h MrmPublic.h MrmAppl.h MrmosI.h SRCS = MrmIbuffer.c MrmIentry.c MrmIfile.c MrmIheader.c \ MrmIindex.c MrmIindexw.c MrmIrid.c MrmIswap.c \ MrmItop.c MrmItopw.c Mrmappl.c \ Mrmcontext.c Mrmerror.c Mrmhier.c Mrmicon.c \ Mrminit.c Mrmlread.c Mrmlwrite.c Mrmmodule.c \ Mrmos.c \ Mrmptrlist.c Mrmtable.c Mrmtime.c Mrmvm.c \ Mrmwci.c Mrmwcrw.c Mrmwcrwr.c Mrmwread.c \ Mrmwrefs.c Mrmwvalues.c Mrmwwrite.c MrmMessages.c libMrm_la_SOURCES = $(SRCS) BUILT_SOURCES = $(CAT_FILES) @MessageCatalog_TRUE@CAT_FILES = Mrm.cat MrmMsgCatI.h @MessageCatalog_FALSE@SPLINT_EXTRAFLAGS = -I/usr/include -I. -DNO_MESSAGE_CATALOG +posixlib -nestcomment @MessageCatalog_TRUE@SPLINT_EXTRAFLAGS = -I/usr/include -I. +posixlib -nestcomment all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Mrm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Mrm/Makefile $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libMrm.la: $(libMrm_la_OBJECTS) $(libMrm_la_DEPENDENCIES) $(EXTRA_libMrm_la_DEPENDENCIES) $(AM_V_CCLD)$(libMrm_la_LINK) -rpath $(libdir) $(libMrm_la_OBJECTS) $(libMrm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIbuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIheader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIindex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIindexw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIrid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmIswap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmItop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmItopw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MrmMessages.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmappl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmcontext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmhier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmicon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrminit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmlread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmlwrite.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmptrlist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmtable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmtime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmvm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmwci.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmwcrw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmwcrwr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmwread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmwrefs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmwvalues.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mrmwwrite.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-mrmHEADERS: $(mrm_HEADERS) @$(NORMAL_INSTALL) @list='$(mrm_HEADERS)'; test -n "$(mrmdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(mrmdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(mrmdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(mrmdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(mrmdir)" || exit $$?; \ done uninstall-mrmHEADERS: @$(NORMAL_UNINSTALL) @list='$(mrm_HEADERS)'; test -n "$(mrmdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(mrmdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(mrmdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-mrmHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-mrmHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man \ install-mrmHEADERS install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-libLTLIBRARIES uninstall-mrmHEADERS .PRECIOUS: Makefile Makefile: $(BUILT_SOURCES) @MessageCatalog_TRUE@$(CAT_FILES): Mrm.msg @MessageCatalog_TRUE@ $(mkinstalldirs) $(top_builddir)/localized/C/msg @MessageCatalog_TRUE@ $(top_builddir)/localized/util/mkcatdefs MrmMsgCatI.h $(srcdir)/Mrm.msg >$(top_builddir)/localized/C/msg/Mrm.msg @MessageCatalog_TRUE@ gencat Mrm.cat $(top_builddir)/localized/C/msg/Mrm.msg splint: $(SPLINT) $(INCLUDES) $(SPLINT_EXTRAFLAGS) $(top_srcdir)/lib/Mrm/*.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/lib/Mrm/Mrmmodule.c0000644000175000017500000002420313145162623013175 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmmodule.c /main/12 1996/11/13 14:03:12 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * These routines get and put data entries from a record into a buffer. * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * UrmIFMInitModule - Init module in a context * * UrmIFMSetTopmost - Set a topmost widget in module * * UrmIFMPutModule - Write module to IDB file * * UrmIFMHGetModule - Get module from hierarchy * * UrmIFMGetModule - Get module from IDB file * * */ /* * * MACROS * */ /* * Macro to validate a resource context and bind interface module pointer * * Formal parameters: * ctx_ptr variable bound to context pointer * routine quoted string giving routine name * recptr variable to be bound to module pointer * * WARNING: Don't use expressions where variables are expected! * */ #define _validate_context(ctx_ptr,routine,recptr) \ { \ if ( ! UrmRCValid(ctx_ptr) ) \ return Urm__UT_Error (routine, _MrmMMsg_0043, \ NULL, ctx_ptr, MrmBAD_CONTEXT) ; \ recptr = (RGMModuleDescPtr) UrmRCBuffer (ctx_ptr) ; \ } /* *++ * * PROCEDURE DESCRIPTION: * * UrmIFMInitModule initializes a context for creating a new * interface module. It stores the access and lock attributes, and * sizes and initializes the topmost widget descriptors for the number * of widgets specified. * * This routine sets all the context parameters, including group, * type, and size. * * FORMAL PARAMETERS: * * context_id URM resource context in which to build the * interface module * num_widget number of topmost widgets to allocate in module * access The module's access attribute, URMaPublic or * URMaPrivate * lock The module's locking attribute, TRUE to lock the * module * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * MrmTOO_MANY number of indexes exceeds internal limit * MrmFAILURE unexplained failure * * SIDE EFFECTS: * *-- */ Cardinal UrmIFMInitModule (URMResourceContextPtr context_id, MrmCount num_widget, MrmCode access, MrmCode lock) { /* * Local variables */ Cardinal result ; /* Function results */ RGMModuleDescPtr ifmodptr ; /* IF module in context */ MrmCount descsiz ; /* # bytes for descriptor */ int ndx ; /* loop index */ /* * validate context and bind pointer. Size check. */ _validate_context (context_id, "UrmIFMInitModule", ifmodptr) ; if ( num_widget >= RGMListSizeMax ) return Urm__UT_Error ("UrmIFMInitModule", _MrmMMsg_0044, NULL, context_id, MrmTOO_MANY) ; /* * compute descriptor size and guarantee space. Null all the widgets. */ descsiz = sizeof(RGMModuleDesc) + (num_widget-1)*sizeof(RGMTopmostDesc) ; descsiz = _FULLWORD (descsiz) ; result = UrmResizeResourceContext (context_id, descsiz) ; if ( result != MrmSUCCESS ) return result ; ifmodptr = (RGMModuleDescPtr) UrmRCBuffer(context_id) ; ifmodptr->validation = URMInterfaceModuleValid ; ifmodptr->count = num_widget ; ifmodptr->annex1 = 0 ; ifmodptr->annex2 = 0 ; for ( ndx=0 ; ndxtopmost[ndx].index, "") ; /* * Set context parameters */ UrmRCSetSize (context_id, descsiz) ; UrmRCSetGroup (context_id, URMgResourceSet) ; UrmRCSetType (context_id, URMrsInterfaceModule) ; UrmRCSetAccess (context_id, access) ; UrmRCSetLock (context_id, lock) ; /* * Successfully created */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine sets the topmost widget index for one of the topmost * widgets specified by an interface module. * * FORMAL PARAMETERS: * * context_id resource context holding a valid interface module * topmost_ndx 0-based index of the widget in the module * index the widget's index (name) * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_IF_MODULE invalid interface module * MrmOUT_OF_BOUNDS topmost_ndx out of bounds * * SIDE EFFECTS: * *-- */ Cardinal UrmIFMSetTopmost (URMResourceContextPtr context_id , Cardinal topmost_ndx , String index ) { /* * Local variables */ RGMModuleDescPtr ifmodptr ; /* IF module in context */ /* * Validate context and interface module. Make sure the index is in bounds */ _validate_context (context_id, "UrmIFMSetTopmost", ifmodptr) ; if ( ifmodptr->validation != URMInterfaceModuleValid ) return Urm__UT_Error ("UrmIFMSetTopmost", _MrmMMsg_0025, NULL, context_id, MrmBAD_IF_MODULE) ; if ( topmost_ndx >= ifmodptr->count ) return Urm__UT_Error ("UrmIFMSetTopmost", _MrmMMsg_0045, NULL, context_id, MrmOUT_OF_BOUNDS) ; /* * Copy in index, and return */ strncat (ifmodptr->topmost[topmost_ndx].index, index, URMMaxIndexLen) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmIFMPutModule creates a resource set entry of type interface * module in the given IDB file. The access and locking attriutes * are taken from the context. * * FORMAL PARAMETERS: * * file_id IDB file into which to write the interface module * index index (name) under which to enter the module * context_id URM resource context containing the module * representation. This must be a valid interface * module. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * MrmSUCCESS Operation succeeded * MrmBAD_CONTEXT invalid resource context * MrmBAD_IF_MODULE invalid interface module in context * Others see UrmIdbPutIndexedResource * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal UrmIFMPutModule (IDBFile file_id , String index , URMResourceContextPtr context_id ) { /* * Local variables */ Cardinal result ; /* Function results */ RGMModuleDescPtr ifmodptr ; /* IF module in context */ /* * Validate context and interface module. */ _validate_context (context_id, "UrmIFMPutModule", ifmodptr) ; if ( ifmodptr->validation != URMInterfaceModuleValid ) return Urm__UT_Error ("UrmIFMPutModule", _MrmMMsg_0025, NULL, context_id, MrmBAD_IF_MODULE) ; /* * Make sure the context is properly set, then put the module in the file */ UrmRCSetGroup (context_id, URMgResourceSet) ; UrmRCSetType (context_id, URMrsInterfaceModule) ; result = UrmIdbPutIndexedResource (file_id, index, context_id) ; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmIFMHGetModule searches the database hierarchy for the module * given its index. It returns the module descriptor in the resource * context. * * FORMAL PARAMETERS: * * hierarchy_id id of an open URM database hierarchy * index index (name) of the desired interface module * context_id resource context into which to read the module * file_id_return to return IDB file in which the module is found * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS module found and loaded in context * MrmNOT_FOUND module not found in hierarchy * MrmBAD_HIERARCHY hierarchy not valid * Others See UrmGetModule * * SIDE EFFECTS: * *-- */ Cardinal UrmIFMHGetModule (MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id , IDBFile *file_id_return ) { /* * Local variables */ Cardinal result ; /* function results */ /* * Get the module */ result = UrmHGetIndexedResource (hierarchy_id, index, URMgResourceSet, URMrsInterfaceModule, context_id, file_id_return) ; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmIFMGetModule retrieves an interface module from an IDB file, and * reads it into the given resource context. * * FORMAL PARAMETERS: * * file_id open IDB file from which to retrieve module * index index (name) of the desired interface module * context_id resource context into which to read the module * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * DMBadContext invalid resource context * MrmBAD_IF_MODULE invalid interface module found in file * Others see UrmIdbGetIndexedResource * * SIDE EFFECTS: * *-- */ Cardinal UrmIFMGetModule (IDBFile file_id , String index , URMResourceContextPtr context_id ) { /* * Local variables */ Cardinal result ; /* function results */ RGMModuleDescPtr ifmodptr ; /* IF module in context */ /* * Validate context, then attempt the read */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmIFMGetModule", _MrmMMsg_0043, file_id, context_id, MrmBAD_CONTEXT) ; result = UrmIdbGetIndexedResource (file_id, index, URMgResourceSet, URMrsInterfaceModule, context_id) ; if ( result != MrmSUCCESS ) return result ; /* * validate the interface module */ ifmodptr = (RGMModuleDescPtr) UrmRCBuffer(context_id) ; if ( ifmodptr->validation != URMInterfaceModuleValid ) return Urm__UT_Error ("UrmIFMPutModule", _MrmMMsg_0025, NULL, context_id, MrmBAD_IF_MODULE) ; /* * Successfully retrieved */ return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/Mrmwcrwr.c0000644000175000017500000017552113145162623013066 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmwcrwr.c /main/14 1996/11/13 14:06:42 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains all the CWR routines (Create Widget Record) * which create the contents of a widget record in a resource context. * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmosI.h" #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * UrmCWRInit Initialize CWR * * UrmCWRSetClass Set class name/code/variety * * UrmCWRInitArglist Initialize arglist * * UrmCWRSetCompressedArgTag Set compressed tag in arglist * * UrmCWRSetUncompressedArgTag Set uncompressed tag in arglist * * UrmCWRSetArgValue Set arg value (immediate) * * UrmCWRSetArgResourceRef Set arg value (resource reference) * * UrmCWRSetArgChar8Vec Set arg value to vector of strings * * UrmCWRSetArgCStringVec Set arg value to compound string vector * * UrmCWRSetArgCallback Set arg to be callback list * * UrmCWRSetCallbackItem Set callback item to immediate value * * UrmCWRSetCallbackItemRes Set callback item to resource * * UrmCWRSetExtraArgs Set extra args count * * UrmCWRInitChildren Initialize children list * * UrmCWRSetChild Set child in list * * UrmCWRSetComment Set widget comment * * UrmCWRSetCreationCallback Set widget creation callback * * UrmCWR__AppendString Append a string to the record * * UrmCWR__GuaranteeSpace Guarantee enough space in the record * * UrmCWR__AppendResource Append a resource descriptor * */ /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRInit initializes a context for creating a new widget record. * It initializes a widget record in the context (reusing the already * allocate buffer if possible). It stores the widget name, and correctly * initializes the size field of the RGMWidgetRecord struct. This is used * and maintained by all UrmCWR... routines to locate the next * available location in the record. The access and locking attributes * of the record are also set. * * FORMAL PARAMETERS: * * context_id resource context to initialize for the widget (must * be already allocated with UrmGetResourceContext * name name of widget * access URMaPublic or URMaPrivate * lock TRUE if widget is to be write-protected * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRInit (URMResourceContextPtr context_id, String name, MrmCode access, MrmCode lock) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ MrmOffset offset ; /* offset for name */ /* * Validate record */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmCWRInit", _MrmMMsg_0043, NULL, context_id, MrmBAD_CONTEXT) ; /* * Set validation code, and set record size to size of header */ if ( UrmRCSize(context_id) <= _FULLWORD(RGMWidgetRecordHdrSize) ) { result = UrmResizeResourceContext (context_id, _FULLWORD(RGMWidgetRecordHdrSize)) ; if ( result != MrmSUCCESS ) return result ; } widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; widgetrec->validation = URMWidgetRecordValid ; widgetrec->size = _FULLWORD (RGMWidgetRecordHdrSize) ; widgetrec->access = access ; widgetrec->lock = lock ; UrmRCSetSize (context_id, widgetrec->size) ; /* * Move in the name */ result = UrmCWR__AppendString (context_id, name, &offset) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; widgetrec->name_offs = offset ; /* * Null out all other fields and offsets */ widgetrec->type = 0 ; widgetrec->class_offs = 0 ; widgetrec->arglist_offs = 0 ; widgetrec->children_offs = 0 ; widgetrec->comment_offs = 0 ; widgetrec->creation_offs = 0 ; widgetrec->variety = 0 ; widgetrec->annex = 0 ; /* * Successfully initialized */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmSetClass appends the class specification to the widget record. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * type Class type, from URMwc... * class string identifying class if not a toolkit/SDT widget. * This string is stored only if type == URMwcUnknown * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT context not valid * MrmBAD_WIDGET_REC widget record not valid * MrmBAD_CLASS_TYPE unknown class type * MrmNO_CLASS_NAME empty class name for user (URMwcUnknown) class * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetClass (URMResourceContextPtr context_id, MrmCode type, String class, unsigned long variety) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ MrmOffset offset ; /* class name offset */ /* * Validate record */ UrmCWR__ValidateContext (context_id, "UrmCWRSetClass") ; /* * Validate the class code. If unknown, must have a non-null class name. * Else needs only the code. */ if ( type == UilMrmUnknownCode ) { if ( strlen(class) <= 0 ) return Urm__UT_Error ("UrmCWRSetClass", _MrmMMsg_0090, NULL, context_id, MrmNO_CLASS_NAME) ; result = UrmCWR__AppendString (context_id, class, &offset) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; widgetrec->type = URMwcUnknown ; widgetrec->class_offs = offset ; widgetrec->variety = variety; return MrmSUCCESS ; } else { if ( type < UilMrmMinValidCode ) return Urm__UT_Error ("UrmCWRSetClass", _MrmMMsg_0091, NULL, context_id, MrmBAD_CLASS_TYPE) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; widgetrec->type = type ; widgetrec->class_offs = 0 ; widgetrec->variety = variety; return MrmSUCCESS ; } } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRInitArglist appends an empty RGMArgListDesc struct to the * record. The arglist contains narg RGMArgument descriptors in a vector * following the arglist header. These are then filled in by * UrmCWRSet*ArgTag, and UrmCWRSet*ArgValue and its analogs. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * nargs number of arguments in arglist * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT context not valid * MrmBAD_WIDGET_REC widget record not valid * MrmTOO_MANY number of arguments exceeds internal limit * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRInitArglist (URMResourceContextPtr context_id, Cardinal nargs) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ MrmSize descsiz ; /* descriptor size */ MrmOffset offset ; /* arglist descriptor offset */ RGMArgListDescPtr argdesc ; /* pointer to arglist in record */ int ndx ; /* loop index */ /* * Validate record */ UrmCWR__ValidateContext (context_id, "UrmCWRInitArglist") ; /* * Error check that the number of arguments is reasonable */ if ( nargs > RGMListSizeMax ) return Urm__UT_Error ("UrmCWRInitArgList", _MrmMMsg_0092, NULL, context_id, MrmTOO_MANY) ; /* * compute the size required for the descriptor and the argument list, * and acquire the memory in the record. Note their is one argument * preallocated in the descriptor. */ descsiz = sizeof(RGMArgListDesc) + (nargs-1)*sizeof(RGMArgument) ; result = UrmCWR__GuaranteeSpace (context_id, descsiz, &offset, (char **)&argdesc) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; widgetrec->arglist_offs = offset ; /* * initialize the descriptor and all the arguments */ argdesc->count = nargs ; argdesc->extra = 0 ; for ( ndx=0 ; ndxargs[ndx].tag_code = 0 ; argdesc->args[ndx].stg_or_relcode.tag_offs = 0 ; argdesc->args[ndx].arg_val.datum.ival = 0L ; } /* * successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRSetCompressedArgTag sets the tag of the specified argument * in the arglist. UrmCWRSetCompressedTag is provided for callers who * already know the compressed code for the tag. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * arg_ndx the 0-based index of the argument in the arglist * tag code specifying tag for argument from a compression * code set * related_tag code for a related argument from the same compression * code set * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS arg_ndx out of bounds * MrmBAD_COMPRESS invalid compressed string code * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetCompressedArgTag (URMResourceContextPtr context_id, Cardinal arg_ndx, MrmCode tag, MrmCode related_tag) { /* * Local variables */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ /* * Validate record, arglist descriptor, and argument number */ UrmCWR__ValidateContext (context_id, "UrmCWRSetCompressedArgTag") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetCompressedArgTag", arg_ndx, &argdesc, &argptr) ; /* * Validate the compressed code and set the argument. */ if ( tag < UilMrmMinValidCode ) return Urm__UT_Error ("UrmCWRSetCompressedArgTag", _MrmMMsg_0093, NULL, context_id, MrmBAD_COMPRESS) ; argptr->tag_code = tag ; argptr->stg_or_relcode.related_code = related_tag; /* * successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRSetUncompressedArgTag sets the tag of the specified argument * in thearglist. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * arg_ndx the 0-based index of the argument in the arglist * tag string nameing the argument * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS arg_ndx out of bounds * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetUncompressedArgTag (URMResourceContextPtr context_id , Cardinal arg_ndx , String tag ) { /* * Local variables */ Cardinal result ; /* function results */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ MrmOffset offset ; /* tag string offset */ /* * Validate record, arglist descriptor, and argument number */ UrmCWR__ValidateContext (context_id, "UrmCWRSetUncompressedArgTag") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetUncompressedArgTag", arg_ndx, &argdesc, &argptr) ; /* * Append the tag string to the record and set the argument */ result = UrmCWR__AppendString (context_id, tag, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetUncompressedArgTag", arg_ndx, &argdesc, &argptr) ; argptr->tag_code = UilMrmUnknownCode ; argptr->stg_or_relcode.tag_offs = offset ; /* * successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRSetArgValue is used to supply the value for an argument for * all representation types listed below. For others, see below. The usage * of the arg_val parameter depends on the value of the type parameter, as * follows; arg_val is CAST in order to access the caller's value for the * argument: * * * MrmRtypeInteger (value): arg_val is CAST to an integer * * MrmRtypeBoolean (value): arg_val is CAST to a boolean value * * MrmRtypeSingleFloat (value): arg_val is CAST to a float * * MrmRtypeChar8 (reference): arg_val is CAST to a pointer to a * MrmRtypeAddrName (reference): string * MrmRtypeTransTable (reference): * MrmRtypeClassRecName (reference): * MrmRtypeKeysym(reference): * * MrmRtypeCString (reference): arg_val is CAST to a pointer to a * compound string * * MrmRtypeFloat (reference): arg_val is CAST to a pointer to a * double constant * * MrmRtypeNull No value, enter null. * * MrmRtypeColorTable Allocate and copy the color table * * MrmRtypeIconImage Allocate and copy the icon. Currently, * the color table must be allocated * with the icon imate. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * arg_ndx the 0-based index of the argument in the arglist * type the representation type for the value, from RGMrType... * arg_val a longword which will be CAST and used as required to * access the value to be stored (copied) into the widget * record. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS arg_ndx out of bounds * MrmBAD_ARG_TYPE unknown or unhandled representation type * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetArgValue (URMResourceContextPtr context_id, Cardinal arg_ndx, MrmCode type, unsigned long arg_val) { /* * Local variables */ Cardinal result ; /* function results */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ MrmOffset offset, dumoff; /* non-immediate value offset */ double *dblptr ; /* pointer to double constant */ char *dumaddr; /* dummy address for GuaranteeSpace */ Cardinal diff; /* alignment diff for dblptr */ RGMColorTablePtr src_ct ; /* arg_val as color table pointer */ RGMColorTablePtr dst_ct ; /* color table allocated in record */ RGMIconImagePtr src_icon ; /* arg_val as icon pointer */ RGMIconImagePtr dst_icon ; /* icon allocated in record */ /* * Validate record, arglist descriptor, and argument number. * Set the argument type now. */ UrmCWR__ValidateContext (context_id, "UrmCWRSetArgValue") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgValue", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.rep_type = type ; /* * Set the argument value depending on the type */ switch ( type ) { case MrmRtypeInteger: case MrmRtypeHorizontalInteger: case MrmRtypeVerticalInteger: case MrmRtypeBoolean: argptr->arg_val.datum.ival = (long) arg_val ; return MrmSUCCESS ; case MrmRtypeSingleFloat: _MrmOSHostFloatToIEEE((float *) &arg_val); argptr->arg_val.datum.ival = (long)arg_val ; return MrmSUCCESS ; case MrmRtypeChar8: case MrmRtypeAddrName: case MrmRtypeTransTable: case MrmRtypeClassRecName: case MrmRtypeKeysym: result = UrmCWR__AppendString (context_id, (char *)arg_val, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgValue", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeCString: result = UrmCWR__AppendCString (context_id, (XmString)arg_val, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgValue", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeWideCharacter: result = UrmCWR__AppendWcharString (context_id, (wchar_t *)arg_val, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgValue", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeFloat: case MrmRtypeHorizontalFloat: case MrmRtypeVerticalFloat: result = UrmCWR__GuaranteeSpace (context_id, sizeof(double), &offset, (char **) &dblptr) ; if ( result != MrmSUCCESS ) return result ; #ifdef USE_ORIGINAL_MOTIF_CODE /* This is necessary for machines (such as hp9000) that require doubles to be aligned on 8 byte boundaries. */ diff = ((long)dblptr % 8); if (diff != 0) { result = UrmCWR__GuaranteeSpace (context_id, diff, &dumoff, &dumaddr) ; if ( result != MrmSUCCESS ) return result ; } dblptr = (double *)((char *)dblptr + diff); #endif *dblptr = *((double *) arg_val) ; _MrmOSHostDoubleToIEEE(dblptr); UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgValue", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeNull: argptr->arg_val.datum.ival = 0L ; return MrmSUCCESS ; case MrmRtypeColorTable: src_ct = (RGMColorTablePtr) arg_val ; result = UrmCWR__GuaranteeSpace (context_id, UrmColorTableSize(src_ct), &offset, (char **)&dst_ct) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgValue", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeIconImage: src_icon = (RGMIconImagePtr) arg_val ; result = UrmCWR__GuaranteeSpace (context_id, UrmIconImageSize(src_icon), &offset, (char **)&dst_icon) ; if ( result != MrmSUCCESS ) return result ; UrmCopyAllocatedIconImage (dst_icon, src_icon) ; /* ??relocate pointers to offsets?? */ UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgValue", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; return MrmSUCCESS ; default: return Urm__UT_Error ("UrmCWRSetArgValue", _MrmMMsg_0094, NULL, context_id, MrmBAD_ARG_TYPE) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCCWRSetArgResourceRef creates a resource reference as the value * of a MrmRtypeResource argument. Only one of the index or resource_id * parameters is used, depending on the value of the key_type parameter. * The resource group and type are as given, but are currently meaningful * only if the group is either URMgLiteral or URMgWidget. The type may * by unspecified (URMtNul). * * FORMAL PARAMETERS: * * context_id resource context containing widget record * arg_ndx the 0-based index of the argument in the arglist * access the access to the resource - URMaPublic or URMaPrivate * group the resource group, usually URMgLiteral or URMgWidget * type the literal type, from RGMrType... or URMwc... * URMtNul is also legal * key_type the key type - URMrIndex or URMrRID * index index for URMaIndex literal * resource_id resource id for URMaRID literal * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS arg_ndx out of bounds * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetArgResourceRef(URMResourceContextPtr context_id, Cardinal arg_ndx, MrmCode access, MrmGroup group, MrmCode type, MrmCode key_type, String index, MrmResource_id resource_id) { /* * Local variables */ Cardinal result ; /* function results */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ MrmOffset offset ; /* RGMResourceDesc offset */ /* * Validate record, arglist descriptor, and argument number. * Set the argument type. */ UrmCWR__ValidateContext (context_id, "UrmCWRSetArgResourceRef") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgResourceRef", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.rep_type = MrmRtypeResource ; /* * Acquire a resource descriptor, and bind the value to it. */ result = UrmCWR__AppendResource (context_id, access, group, type, key_type, index, resource_id, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgResourceRef", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; /* * successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine sets the value of an argument in the arglist to * be a vector of ASCIZ strings. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * arg_ndx the 0-based index of the argument in the arglist * stg_vec a vector of ASCIZ string pointers * num_stg the number of pointers in stg_vec * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS arg_ndx out of bounds * MrmVEC_TOO_BIG vector size exceeds internal limit * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetArgChar8Vec (URMResourceContextPtr context_id, Cardinal arg_ndx, String *stg_vec, MrmCount num_stg) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ RGMTextVectorPtr vecptr ; /* text vector in record */ MrmOffset vecoffs ; /* text vector offset */ MrmOffset offset ; /* current string offset */ MrmSize vecsiz ; /* # bytes for text vector */ int ndx ; /* loop index */ /* * Validate record, arglist descriptor, and argument number. */ UrmCWR__ValidateContext (context_id, "UrmCWRSetArgChar8Vec") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgChar8Vec", arg_ndx, &argdesc, &argptr) ; /* * Validate vector - make sure it doesn't contain too many elements */ if ( num_stg > RGMListSizeMax ) return Urm__UT_Error ("DwUrmCWRSetArgChar8Vec", _MrmMMsg_0095, NULL, context_id, MrmVEC_TOO_BIG) ; /* * Allocate the text vector. Then loop and append each string in * the input vector to the record, setting its offset in the * record vector. This list requires count+1 entries so it may be * overwritten as an in-memory list at runtime with a terminating NULL. * One item is already allocated, so num_stg additional entries are needed. */ vecsiz = sizeof(RGMTextVector) + (num_stg)*sizeof(RGMTextEntry) ; result = UrmCWR__GuaranteeSpace (context_id, vecsiz, &vecoffs, (char **)&vecptr) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgChar8Vec", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.rep_type = MrmRtypeChar8Vector ; argptr->arg_val.datum.offset = vecoffs ; vecptr->validation = URMTextVectorValid ; vecptr->count = num_stg ; for ( ndx=0 ; ndxitem[ndx].text_item.rep_type = MrmRtypeChar8 ; vecptr->item[ndx].text_item.offset = offset ; } /* * set terminating null */ vecptr->item[num_stg].pointer = NULL ; /* * Successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine sets the value of an argument in the arglist to * be a vector of compound strings * * FORMAL PARAMETERS: * * context_id resource context containing widget record * arg_ndx the 0-based index of the argument in the arglist * cstg_vec a vector of compound string pointers * num_cstg the number of pointers in cstg_vec * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS arg_ndx out of bounds * MrmVEC_TOO_BIG vector size exceeds internal limit * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetArgCStringVec (URMResourceContextPtr context_id, Cardinal arg_ndx, XmString *cstg_vec, MrmCount num_cstg) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ RGMTextVectorPtr vecptr ; /* text vector in record */ MrmOffset vecoffs ; /* text vector offset */ MrmOffset offset ; /* current compound string offset */ MrmSize vecsiz ; /* # bytes for text vector */ int ndx ; /* loop index */ /* * Validate record, arglist descriptor, and argument number. */ UrmCWR__ValidateContext (context_id, "UrmCWRSetArgCStringVec") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgCStringVec", arg_ndx, &argdesc, &argptr) ; /* * Validate vector - make sure it doesn't contain too many elements */ if ( num_cstg > RGMListSizeMax ) return Urm__UT_Error ("DwUrmCWRSetArgCStringVec", _MrmMMsg_0095, NULL, context_id, MrmVEC_TOO_BIG) ; /* * Allocate the text vector. Then loop and append each string in * the input vector to the record, setting its offset in the * record vector. This list requires count+1 entries so it may be * overwritten as an in-memory list at runtime with a terminating NULL. * One item is already allocated, so num_cstg additional entries are needed. */ vecsiz = sizeof(RGMTextVector) + (num_cstg)*sizeof(RGMTextEntry) ; result = UrmCWR__GuaranteeSpace (context_id, vecsiz, &vecoffs, (char **)&vecptr) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgCStringVec", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.rep_type = MrmRtypeCStringVector ; argptr->arg_val.datum.offset = vecoffs ; vecptr->validation = URMTextVectorValid ; vecptr->count = num_cstg ; for ( ndx=0 ; ndxitem[ndx].text_item.rep_type = MrmRtypeCString ; vecptr->item[ndx].text_item.offset = offset ; } /* * set terminating null */ vecptr->item[num_cstg].pointer = NULL ; /* * Successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRSetArgCallback creates a callback descriptor for a * MrmRtypeCallback argument. The callback descriptor is created with a * vector of callback item descriptors whose length is nitems. The * callback items may then be filled in with UrmCWRSetCallbackItem * and UrmCWRSetCallbackItemRes. The offset of the new callback * descriptor is returned for use in the set callback item routines. * * FORMAL PARAMETERS: * * context resource context containing widget record * arg_ndx the 0-based index of the argument in the arglist * nitems number of items to appear in the callback list * cb_offs_return to return offset of RGMCallbackDesc struct created in * widget record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS arg_ndx out of bounds * MrmTOO_MANY number of items exceeds internal limit * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetArgCallback (URMResourceContextPtr context_id , Cardinal arg_ndx , Cardinal nitems , MrmOffset *cb_offs_return ) { /* * Local variables */ Cardinal result ; /* function results */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ MrmSize descsiz ; /* descriptor size */ MrmOffset offset ; /* RGMCallbackDesc offset */ RGMCallbackDescPtr cbdesc ; /* resource descriptor */ int ndx ; /* loop index */ /* * Validate record, arglist descriptor, and argument number. * Set the argument type. */ UrmCWR__ValidateContext (context_id, "UrmCWRSetArgCallback") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgCallback", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.rep_type = MrmRtypeCallback ; /* * Confirm that the number of items is reasonable, then size and * allocate a callback descriptor. Initialize it. Note an extra * item is added for a terminating NULL for runtime use as an * in-memory list. */ if ( nitems > RGMListSizeMax ) return Urm__UT_Error ("UrmCWRSetArgCallback", _MrmMMsg_0109, NULL, context_id, MrmTOO_MANY) ; descsiz = sizeof(RGMCallbackDesc) + (nitems)*sizeof(RGMCallbackItem) ; result = UrmCWR__GuaranteeSpace (context_id, descsiz, &offset, (char **)&cbdesc) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetArgCallback", arg_ndx, &argdesc, &argptr) ; argptr->arg_val.datum.offset = offset ; cbdesc->validation = URMCallbackDescriptorValid ; cbdesc->count = nitems ; cbdesc->unres_ref_count = 0 ; for ( ndx=0 ; ndxitem[ndx].cb_item.routine = 0 ; cbdesc->item[ndx].cb_item.rep_type = 0 ; cbdesc->item[ndx].cb_item.datum.ival = 0L ; } /* * Set terminating NULL */ cbdesc->item[nitems].runtime.callback.callback = NULL ; cbdesc->item[nitems].runtime.callback.closure = 0 ; /* * successfully added */ *cb_offs_return = offset ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRSetCallbackItem sets the routine name for the callback item * to the given routine, and sets the tag value to the immedidate value * specified by the type and itm_val parameters. The usage of the type * and itm_val parameters is identical to UrmCWRSetArgValue. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * cb_offs offset to the callback descriptor in the widget * record (NOT a memory pointer, in case a new buffer * is allocated). * item_ndx the 0-based index of the item in the callback list * routine routine name associated with this item * type the representation type for the tag value, from * RGMrType... * itm_val a longword which will be CAST and used as required to * access the value to be stored (copied) into the widget * record for this tag value. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * URMBadcontext resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmBAD_CALLBACK invalid callback descriptor * MrmOUT_OF_BOUNDS item_ndx out of bounds * MrmBAD_ARG_TYPE unknown or unhandled representation type * MrmNULL_ROUTINE routine name is empty * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetCallbackItem (URMResourceContextPtr context_id, MrmOffset cb_offs, Cardinal item_ndx, String routine, MrmCode type, unsigned long itm_val) { /* * Local variables */ Cardinal result ; /* function results */ RGMCallbackDescPtr cbdesc ; /* callback descriptor */ RGMCallbackItemPtr itmptr ; /* callback item in list */ MrmOffset offset ; /* appended data offset */ double *dblptr ; /* pointer to double constant */ /* * Validate context and bind pointers to callback descriptor and item */ UrmCWR__ValidateContext (context_id, "UrmCWRSetCallbackItem") ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItem", cb_offs, item_ndx, &cbdesc, &itmptr) ; /* * Validate the routine (must be non-empty) */ if ( strlen(routine) <= 0 ) return Urm__UT_Error ("UrmCWRSetCallbackItem", _MrmMMsg_0096, NULL, context_id, MrmNULL_ROUTINE) ; /* * Append the routine string and set the item */ result = UrmCWR__AppendString (context_id, routine, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItem", cb_offs, item_ndx, &cbdesc, &itmptr) ; itmptr->cb_item.routine = offset ; /* * Set the tag to the literal value as in SetArgValue */ itmptr->cb_item.rep_type = type ; switch ( type ) { case MrmRtypeInteger: case MrmRtypeHorizontalInteger: case MrmRtypeVerticalInteger: case MrmRtypeBoolean: itmptr->cb_item.datum.ival = (int) itm_val ; return MrmSUCCESS ; case MrmRtypeSingleFloat: _MrmOSHostFloatToIEEE((float *)&itm_val); itmptr->cb_item.datum.ival = (int) itm_val ; return MrmSUCCESS ; case MrmRtypeChar8: case MrmRtypeAddrName: case MrmRtypeTransTable: case MrmRtypeKeysym: result = UrmCWR__AppendString (context_id, (char *)itm_val, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItem", cb_offs, item_ndx, &cbdesc, &itmptr) ; itmptr->cb_item.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeChar8Vector: return Urm__UT_Error ("UrmCWRSetCallbackItem", _MrmMMsg_0097, NULL, context_id, MrmBAD_ARG_TYPE) ; case MrmRtypeCString: result = UrmCWR__AppendCString (context_id, (XmString)itm_val, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItem", cb_offs, item_ndx, &cbdesc, &itmptr) ; itmptr->cb_item.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeWideCharacter: result = UrmCWR__AppendWcharString (context_id, (wchar_t *)itm_val, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItem", cb_offs, item_ndx, &cbdesc, &itmptr) ; itmptr->cb_item.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeCStringVector: return Urm__UT_Error ("UrmCWRSetCallbackItem", _MrmMMsg_0098, NULL, context_id, MrmBAD_ARG_TYPE) ; case MrmRtypeFloat: case MrmRtypeHorizontalFloat: case MrmRtypeVerticalFloat: result = UrmCWR__GuaranteeSpace (context_id, sizeof(double), &offset, (char **)&dblptr) ; if ( result != MrmSUCCESS ) return result ; *dblptr = *((double *) itm_val) ; _MrmOSHostDoubleToIEEE(dblptr); UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItem", cb_offs, item_ndx, &cbdesc, &itmptr) ; itmptr->cb_item.datum.offset = offset ; return MrmSUCCESS ; case MrmRtypeNull: itmptr->cb_item.datum.ival = 0L ; return MrmSUCCESS ; default: return Urm__UT_Error ("UrmCWRSetCallbackItem", _MrmMMsg_0094, NULL, context_id, MrmBAD_ARG_TYPE) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRSetCallbackItemRes sets the callback item routine name for * the callback item to the given routine, and sets the tag value to * be a resource reference. The interpretation of the resource * specification parameters is identical to UrmCWRSetArgResourceRef. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * cb_offs offset to the callback descriptor in the widget record * (NOTa memory pointer, in case a new buffer is * allocated). * item_ndx the 0-based index of the item in the callback list * routine name of the routine for the callback item * access the access to the resource - URMaPublic or URMaPrivate * group the resource group. Only URMgLiteral makes sense, * but the parameter is available for completeness * type the literal type, from RGMrType... (or URMtNul) * key_type the key type - URMrIndex or URMrRID * index index for URMaIndex literal * resource_id resource id for URMaRID literal * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmBAD_CALLBACK invalid callback descriptor * MrmOUT_OF_BOUNDS item_ndx out of bounds * DMNullIndex empty index string * MrmNULL_ROUTINE routine name is empty * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetCallbackItemRes (URMResourceContextPtr context_id, MrmOffset cb_offs, Cardinal item_ndx, String routine, MrmGroup group, MrmCode access, MrmCode type, MrmCode key_type, String index, MrmResource_id resource_id) { /* * Local variables */ Cardinal result ; /* function results */ RGMCallbackDescPtr cbdesc ; /* callback descriptor */ RGMCallbackItemPtr itmptr ; /* callback item in list */ MrmOffset offset ; /* appended data offset */ /* * Validate context and bind pointers to callback descriptor and item */ UrmCWR__ValidateContext (context_id, "UrmCWRSetCallbackItemRes") ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItemRes", cb_offs, item_ndx, &cbdesc, &itmptr) ; /* * Validate the routine (must be non-empty) */ if ( strlen(routine) <= 0 ) return Urm__UT_Error ("UrmCWRSetCallbackItemRes", _MrmMMsg_0096, NULL, context_id, MrmNULL_ROUTINE) ; /* * Append the routine string and set the item */ result = UrmCWR__AppendString (context_id, routine, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItemRes", cb_offs, item_ndx, &cbdesc, &itmptr) ; itmptr->cb_item.routine = offset ; /* * Acquire and set a resource descriptor */ result = UrmCWR__AppendResource (context_id, access, group, type, key_type, index, resource_id, &offset) ; if ( result != MrmSUCCESS ) return result ; UrmCWR__BindCallbackPtrs (context_id, "UrmCWRSetCallbackItemRes", cb_offs, item_ndx, &cbdesc, &itmptr) ; itmptr->cb_item.rep_type = MrmRtypeResource ; itmptr->cb_item.datum.offset = offset ; /* * Successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine sets the extra args count in the arglist descriptor * to the given value * * FORMAL PARAMETERS: * * context_id resource context containing widget record * nextra # of extra args which should be allocated by URM * at runtime to deal with args URM creates which * are related to those in the arglist (already * set to 0). * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC arglist descriptor is null * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetExtraArgs (URMResourceContextPtr context_id , Cardinal nextra ) { /* * Local variables */ RGMArgListDescPtr argdesc ; /* arglist desc in record */ RGMArgumentPtr argptr ; /* argument being set */ /* * Validate record, arglist descriptor. Bind usual pointers, although * argptr not used. Set the extra args field. */ UrmCWR__ValidateContext (context_id, "UrmCWRSetExtraArgs") ; UrmCWR__BindArgPtrs (context_id, "UrmCWRSetExtraArgs", 0, &argdesc, &argptr) ; argdesc->extra = nextra ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRInitChildren appends an empty RGMChildrenDesc struct to the * record, preparing it for setting children. The descriptor is * allocated a vector of child descriptors whose length is given by the * nchildren parameter. Each child is then set with UrmCWRSetChild. * * The children descriptor's access field is set from the record's * access field. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * nchildren number of children in list * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmTOO_MANY number of children exceeded internal limit * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRInitChildren (URMResourceContextPtr context_id , Cardinal nchildren ) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ MrmSize descsiz ; /* descriptor size */ MrmOffset offset ; /* children descriptor offset */ RGMChildrenDescPtr listdesc ; /* pointer to desc in record */ int ndx ; /* loop index */ /* * Validate record */ UrmCWR__ValidateContext (context_id, "UrmCWRInitChildren") ; /* * Error check that the number of children is reasonable */ if ( nchildren > RGMListSizeMax ) return Urm__UT_Error ("UrmCWRInitChildren", _MrmMMsg_0099, NULL, context_id, MrmTOO_MANY) ; /* * compute the size required for the descriptor and the child list, * and acquire the memory in the record. Note there is one child * preallocated in the descriptor. */ descsiz = sizeof(RGMChildrenDesc) + (nchildren-1)*sizeof(RGMChildDesc) ; result = UrmCWR__GuaranteeSpace (context_id, descsiz, &offset, (char **)&listdesc) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; widgetrec->children_offs = offset ; /* * initialize the descriptor and all the arguments */ listdesc->count = nchildren ; listdesc->annex1 = 0 ; for ( ndx=0 ; ndxchild[ndx].manage = 0 ; listdesc->child[ndx].access = 0 ; listdesc->child[ndx].type = 0 ; listdesc->child[ndx].annex1 = 0 ; listdesc->child[ndx].key.id = 0 ; } /* * successfully added */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCWRSetChild sets a child descriptor in the children list for * the widget record. Only one of the index or resource_id parameters * is used, depending on the value of the key_type parameter. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * child_ndx index of child descriptor in children list descriptor * manage true/false indicating child is managed with parent at * initialization time * access the access to the child - URMaPublic or URMaPrivate * key_type the key type - URMrIndex or URMrRID * index index for URMrIndex child * resource_id resource id for URMaRID child * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmNULL_DESC children descriptor is null * MrmOUT_OF_BOUNDS child_ndx was out of bounds * MrmNULL_INDEX empty index string for URMrIndex * MrmBAD_KEY_TYPE key_type was an unknown type * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetChild (URMResourceContextPtr context_id, Cardinal child_ndx, Boolean manage, MrmCode access, MrmCode key_type, String index, MrmResource_id resource_id) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ MrmOffset offset ; /* child index offset */ RGMChildrenDescPtr listdesc ; /* pointer to desc in record */ RGMChildDescPtr childptr ; /* child in list */ /* * Validate record */ UrmCWR__ValidateContext (context_id, "UrmCWRSetChild") ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; if ( widgetrec->children_offs == 0 ) return Urm__UT_Error ("UrmCWRSetChild", _MrmMMsg_0100, NULL, context_id, MrmNULL_DESC) ; listdesc = (RGMChildrenDescPtr) ((char*)widgetrec + widgetrec->children_offs); if ( child_ndx >= listdesc->count ) return Urm__UT_Error ("UrmCWRSetChild", _MrmMMsg_0101, NULL, context_id, MrmOUT_OF_BOUNDS) ; childptr = &listdesc->child[child_ndx] ; /* * set child descriptor */ childptr->manage = manage ; childptr->access = access ; childptr->type = key_type ; switch ( childptr->type ) { case URMrIndex: if ( strlen(index) <= 0 ) return Urm__UT_Error ("UrmCWRSetChild", _MrmMMsg_0102, NULL, context_id, MrmNULL_INDEX) ; result = UrmCWR__AppendString (context_id, index, &offset) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; listdesc = (RGMChildrenDescPtr) ((char *)widgetrec + widgetrec->children_offs) ; childptr = &listdesc->child[child_ndx] ; childptr->key.index_offs = offset ; return MrmSUCCESS ; case URMrRID: childptr->key.id = resource_id ; return MrmSUCCESS ; default: return Urm__UT_Error ("UrmCWRSetChild", _MrmMMsg_0103, NULL, context_id, MrmBAD_KEY_TYPE) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * UrmSetComment appends a comment to the widget record. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * comment comment string for this widget * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetComment (URMResourceContextPtr context_id , String comment ) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ MrmOffset offset ; /* comment offset */ /* * Validate record */ UrmCWR__ValidateContext (context_id, "UrmCWRSetComment") ; /* * Append the comment if it is non-empty */ if ( strlen(comment) <= 0 ) { widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; widgetrec->comment_offs = 0 ; return MrmSUCCESS ; } result = UrmCWR__AppendString (context_id, comment, &offset) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; widgetrec->comment_offs = offset ; /* * successfully added */ return MrmSUCCESS ; } /* *++ * * * PROCEDURE DESCRIPTION: * * UrmCWRSetCreationCallback initialize a callback descriptor for the * URM creation callback for this widget. It is similar to * UrmCWRSetArgCallback in returning the offset of a RGMCallbackDesc * struct which may then be completed with calls to * UrmCWRSetCallbackItem or UrmCWRSetCallbackItemRes. * * FORMAL PARAMETERS: * * context_id resource context containing widget record * nitems number of items to appear in the callback list * cb_offs_return to return offset of RGMCallbackDesc struct created in * widget record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * MrmTOO_MANY number of items exceeds internal limit * * SIDE EFFECTS: * *-- */ Cardinal UrmCWRSetCreationCallback (URMResourceContextPtr context_id , Cardinal nitems , MrmOffset *cb_offs_return ) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ MrmSize descsiz ; /* descriptor size */ MrmOffset offset ; /* RGMCallbackDesc offset */ RGMCallbackDescPtr cbdesc ; /* resource descriptor */ int ndx ; /* loop index */ /* * Validate record, arglist descriptor, and argument number. * Set the argument type. */ UrmCWR__ValidateContext (context_id, "UrmCWRSetCreationCallback") ; /* * Confirm that the number of items is reasonable, then size and * allocate a callback descriptor. Initialize it. As in SetArgCallbac, * an extra item is added for runtime use. */ if ( nitems > RGMListSizeMax ) return Urm__UT_Error ("UrmCWRSetCreationCallback", _MrmMMsg_0109, NULL, context_id, MrmTOO_MANY) ; descsiz = sizeof(RGMCallbackDesc) + (nitems)*sizeof(RGMCallbackItem) ; result = UrmCWR__GuaranteeSpace (context_id, descsiz, &offset, (char **)&cbdesc) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; widgetrec->creation_offs = offset ; cbdesc->validation = URMCallbackDescriptorValid ; cbdesc->count = nitems ; cbdesc->unres_ref_count = 0 ; for ( ndx=0 ; ndxitem[ndx].cb_item.routine = 0 ; cbdesc->item[ndx].cb_item.rep_type = 0 ; cbdesc->item[ndx].cb_item.datum.ival = 0L ; } /* * Set terminating NULL */ cbdesc->item[nitems].runtime.callback.callback = NULL ; cbdesc->item[nitems].runtime.callback.closure = 0 ; /* * successfully added */ *cb_offs_return = offset ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine appends a string into the widget record at the * next available location in the record. It resizes the context * if necessary. * * FORMAL PARAMETERS: * * context_id context containing the widget record * stg the string to append. Nothing is done if empty * offset To return offset in record. 0 is returned if * the string is empty. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * See UrmResizeResourceContext * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__AppendString (URMResourceContextPtr context_id , String stg , MrmOffset *offset ) { /* * Local variables */ Cardinal result ; /* function results */ int len ; /* string length */ String stgadr ; /* destination address in record */ /* * Offset zero for NULL pointer */ if ( stg == NULL ) { *offset = 0; return MrmSUCCESS ; } /* * Guarantee space and copy in string */ len = strlen (stg) + 1 ; result = UrmCWR__GuaranteeSpace (context_id, len, offset, &stgadr) ; if ( result != MrmSUCCESS ) return result ; memcpy (stgadr, stg, len) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine appends a compound string into the widget record at the * next available location in the record. It resizes the context * if necessary. * * FORMAL PARAMETERS: * * context_id context containing the widget record * cstg the compound string to append. Nothing is done if empty * offset To return offset in record. 0 is returned if * the string is empty. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * See UrmResizeResourceContext * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__AppendCString (URMResourceContextPtr context_id , XmString cstg , MrmOffset *offset ) { /* * Local variables */ Cardinal result ; /* function results */ int len ; /* length of string */ char *cstgadr ; /* destination address in record */ unsigned char *asn1; /* * Offset zero for empty string or NULL pointer */ if ( cstg == NULL ) { *offset = 0; return MrmSUCCESS ; } len = XmCvtXmStringToByteStream(cstg, &asn1) ; if ( len <= 0 ) { *offset = 0; return MrmSUCCESS ; } /* * Guarantee space and copy in string */ result = UrmCWR__GuaranteeSpace (context_id, len, offset, &cstgadr) ; if ( result != MrmSUCCESS ) return result ; memcpy (cstgadr, (char *)asn1, len) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine appends a wide character string into the widget record at * the next available location in the record. It resizes the context * if necessary. * * FORMAL PARAMETERS: * * context_id context containing the widget record * wcs the wide character string to append. * Nothing is done if empty. * offset To return offset in record. 0 is returned if * the string is empty. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * See UrmResizeResourceContext * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__AppendWcharString (URMResourceContextPtr context_id , wchar_t *wcs , MrmOffset *offset ) { /* * Local variables */ Cardinal result ; /* function results */ MrmSize len ; /* string length */ wchar_t *wcsadr ; /* destination address in record */ int cnt; /* * Offset zero for NULL pointer */ if ( wcs == NULL ) { *offset = 0; return MrmSUCCESS ; } /* * Guarantee space and copy in string */ for (cnt = 0; ; cnt++) if (wcs[cnt] == 0) break; len = (cnt+1) * sizeof(wchar_t); result = UrmCWR__GuaranteeSpace (context_id, len, offset, (char **)&wcsadr) ; if ( result != MrmSUCCESS ) return result ; memcpy (wcsadr, wcs, len) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine guarantees that there is enough space in the * widget record in the context for an append operation. It * returns the address in the record of the available space. It * also resets the widget record size to include the delta space. * It guarantees that all space so granted is on a fullword boundary. * * FORMAL PARAMETERS: * * context_id context containing the widget record * delta the number of additional bytes needed for the append * offset to return the offset in the record * addr to return the address in the record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__GuaranteeSpace (URMResourceContextPtr context_id, MrmSize delta, MrmOffset *offset, char **addr) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error ("UrmCWR__GuaranteeSpace", _MrmMMsg_0026, NULL, context_id, MrmBAD_RECORD) ; delta = _FULLWORD (delta) ; result = UrmResizeResourceContext (context_id, widgetrec->size+delta) ; if ( result != MrmSUCCESS ) return result ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; *offset = widgetrec->size ; *addr = (char *) widgetrec+widgetrec->size ; widgetrec->size += delta ; UrmRCSetSize (context_id, widgetrec->size) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCCWR__AppendResource creates a resource reference and appends * it to the record. Only one of the index or resource_id * parameters is used, depending on the value of the key_type parameter. * The only currently meaningful groups are URMgLiteral and URMgWidget. * The resource type is taken from the type parameter (which may be * URMtNul). * * FORMAL PARAMETERS: * * context_id resource context containing widget record * access the access to the resource - URMaPublic or URMaPrivate * group resource group, usually URMgLiteral or URMgWidget * type conversion type for argument values, from RGMrType... * key_type the key type - URMrIndex or URMrRID * index index for URMrIndex literal * resource_id resource id for URMaRID literal * offset to return offset of descriptor * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT resource context invalid * MrmBAD_WIDGET_REC widget record not valid * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__AppendResource (URMResourceContextPtr context_id, MrmCode access, MrmCode group, MrmCode type, MrmCode key_type, String index, MrmResource_id resource_id, MrmOffset *offset) { /* * Local variables */ Cardinal result ; /* function results */ MrmSize descsiz ; /* descriptor size */ RGMResourceDescPtr resdesc ; /* resource descriptor */ /* * Acquire and set a resource descriptor. If an RID reference, no extra is * needed. If an index, extra space for the string is required. Since * one character is allocated already, no extra is needed for the NUL. */ switch ( key_type ) { case URMrIndex: if ( strlen(index) <= 0 ) return Urm__UT_Error ("UrmCWR__AppendResource", _MrmMMsg_0102, NULL, context_id, MrmNULL_INDEX) ; descsiz = sizeof(RGMResourceDesc) + strlen(index) ; result = UrmCWR__GuaranteeSpace (context_id, descsiz, offset, (char **)&resdesc) ; if ( result != MrmSUCCESS ) return result ; resdesc->size = descsiz ; resdesc->access = access ; resdesc->type = URMrIndex ; resdesc->res_group = group ; resdesc->cvt_type = type ; resdesc->annex1 = 0 ; strcpy (resdesc->key.index, index) ; return MrmSUCCESS ; case URMrRID: descsiz = sizeof(RGMResourceDesc) ; result = UrmCWR__GuaranteeSpace (context_id, descsiz, offset, (char **)&resdesc) ; if ( result != MrmSUCCESS ) return result ; resdesc->size = descsiz ; resdesc->access = access ; resdesc->type = URMrRID ; resdesc->res_group = group ; resdesc->cvt_type = type ; resdesc->annex1 = 0 ; resdesc->key.id = resource_id ; return MrmSUCCESS ; default: return Urm__UT_Error ("UrmCWR__AppendResource", _MrmMMsg_0103, NULL, context_id, MrmBAD_KEY_TYPE) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine checks that the context is valid and contains * a valid widget record. It signals and returns an error * otherwise. * * FORMAL PARAMETERS: * * context_id resource context containing record * routine Name of calling routine for error signal. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS Validation succeeded * MrmBAD_CONTEXT Invalid resource context * MrmBAD_WIDGET_REC Invalid widget record in context * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__ValidateContext (URMResourceContextPtr context_id , String routine ) { /* * Local variables */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error (routine, _MrmMMsg_0043, NULL, NULL, MrmBAD_CONTEXT) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error (routine, _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine bind an arglist descriptor pointer and an argument pointer * to the arglist descriptor and designated argument item in a * widget record. It also performs the following validations: * non-null arglist descriptor * argument index in bounds * * FORMAL PARAMETERS: * * context_id resource context containing record * routine name of calling routine for error signal * argndx 0-based argument index in list * descptr to return pointer to arglist descriptor * argptr to return pointer to designated argument item * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNULL_DESC arglist descriptor is null * MrmOUT_OF_BOUNDS argument index out of bounds * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__BindArgPtrs (URMResourceContextPtr context_id , String routine , Cardinal argndx , RGMArgListDescPtr *descptr , RGMArgumentPtr *argptr ) { /* * Local variables */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ /* * Pick up a widget record, and set descriptor pointer. */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; if ( UrmWRValid(widgetrec) ) *descptr = (RGMArgListDescPtr) ((char *)widgetrec+widgetrec->arglist_offs) ; else return Urm__UT_Error (routine, _MrmMMsg_0026, NULL, context_id, MrmBAD_RECORD) ; /* * Validate argument index and set pointer */ if ( argndx >= (*descptr)->count ) return Urm__UT_Error (routine, _MrmMMsg_0104, NULL, context_id, MrmOUT_OF_BOUNDS) ; *argptr = &(*descptr)->args[argndx] ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine binds pointers to a callback descriptor in a widget * record, and a designated item in the callback list. It also * performs the following validations: * valid callback descriptor * item index in bounds * * FORMAL PARAMETERS: * * context_id context containing widget record * routine name of calling routine for error signal * descoffs offset of descriptor in record * itemndx 0-based index of item in callback list * descptr to return callback descriptor pointer * itmptr to return callback item pointer * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CALLBACK invalid callback descriptor * MrmOUT_OF_BOUNDS item index out of bounds * * SIDE EFFECTS: * *-- */ Cardinal UrmCWR__BindCallbackPtrs (URMResourceContextPtr context_id, String routine, MrmOffset descoffs, Cardinal itemndx, RGMCallbackDescPtr *descptr, RGMCallbackItemPtr *itmptr) { /* * Local variables */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ /* * Pick up a widget record, and set descriptor pointer. */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer(context_id) ; if ( UrmWRValid(widgetrec) ) *descptr = (RGMCallbackDescPtr) ((char *)widgetrec+descoffs) ; else return Urm__UT_Error (routine, _MrmMMsg_0105, NULL, context_id, MrmBAD_RECORD) ; if ( (*descptr)->validation != URMCallbackDescriptorValid ) return Urm__UT_Error (routine, _MrmMMsg_0106, NULL, context_id, MrmBAD_CALLBACK) ; /* * validate item index and compute item pointer */ if ( itemndx >= (*descptr)->count ) return Urm__UT_Error (routine, _MrmMMsg_0107, NULL, context_id, MrmOUT_OF_BOUNDS) ; *itmptr = &(*descptr)->item[itemndx] ; return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/Mrmwcrw.c0000644000175000017500000031745213145162623012705 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Mrmwcrw.c /main/20 1999/05/19 15:26:23 mgreess $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains the routine which implement widget creation * and management at runtime from a widget stored in a resource context. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmosI.h" #include "MrmMsgI.h" #include #include /* for ALLOCATE/DEALLOCATE_LOCAL */ #include /* for XmGetTearOffControl */ #include /* for XmDisplay */ #include #include #include /* * * TABLE OF CONTENTS * * UrmCreateWidgetTree Create a widget and its subtree * * UrmCreateWidgetInstance Create a widget instance * * Urm__CW_CreateArglist Create a widget arglist * * Urm__CW_FixupCallback Complete a callback item * * Urm__CW_EvaluateResource Evaluate a resource ref value * */ static void DisplayDestroyCallback (Widget w, XtPointer client_data, XtPointer call_data ); /* * * DEFINE and MACRO DEFINITIONS * */ #define MAKEINT(float_value) ((int) (((float_value) > 0.0) ? \ ((float_value) + 0.5) : \ ((float_value) - 0.5))) /* *++ * * PROCEDURE DESCRIPTION: * * UrmCreateWidgetInstanceCleanup determines from a RGM widget * record if the widget instance is real. If it is and it has * a cleanup, the cleanup is called. This mechanism is * used to clean up dangling XmRenderTable and XmRendition handles * left dangling in calls to UrmCreateWidgetInstance. * * FORMAL PARAMETERS: * * context_id context containing widget record describing widget * to create * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * child id of child widget * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid context * MrmBAD_WIDGET_REC invalid widget record * * SIDE EFFECTS: * *-- */ Cardinal UrmCreateWidgetInstanceCleanup (URMResourceContextPtr context_id, Widget child, IDBFile file_id) { /* * Local variables */ RGMWidgetRecordPtr widgetrec ; /* widget record in the context */ WCIClassDescPtr cldesc ; /* class descriptor */ Cardinal result; /* * Validate the context and the widget record in the context. * Check the variety and call the appropriate set or create function. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmCreateWidgetInstanceCleanup", _MrmMMsg_0043, NULL, NULL, MrmBAD_CONTEXT) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error ("UrmCreateWidgetInstanceCleanup", _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; if (widgetrec->variety == UilMrmWidgetVariety) { result = Urm__FindClassDescriptor (file_id, widgetrec->type, (XtPointer) ((char *)widgetrec+widgetrec->class_offs), &cldesc) ; if ( result != MrmSUCCESS ) return result ; if (NULL != cldesc->cleanup) (*(cldesc->cleanup)) (child) ; } else if (widgetrec->variety != UilMrmAutoChildVariety) return Urm__UT_Error("UrmCreateWidgetInstanceCleanup", _MrmMMsg_0055, NULL, context_id, MrmBAD_WIDGET_REC); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCreateWidgetTree is the recursive routine * which recurses down a widget subtree and instantiates all widgets * in the tree. The recursion process is: * * o Create this widget. * o Create a new context. Read each child of this widget * into the context in succession. Create each child, * saving its id. * o manage the children * * This routine accepts override parameters for the widget name, and * to override arguments in the creation arglist. The latter are appended * to the list created from the UID file, and do not replace all values. * The parameters are not passed down to any children in the subtree. * * FORMAL PARAMETERS: * * context_id context containing widget record describing widget * to create * parent id of parent widget * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * ov_name Name to override widget name (NULL for no override) * ov_args Override arglist, exactly as would be given to * XtCreateWidget (conversion complete, etc). NULL * for no override. * ov_num_args # args in ov_args; 0 for no override * keytype type of key which accessed this widget * kindex index for URMrIndex access * krid resource id for URMrRID access * svlist list of SetValues descriptors for widgets in tree * wref_id to accumulate widget reference definitions * w_return To return id of newly created widget * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid context * MrmBAD_WIDGET_REC invalid widget record * * SIDE EFFECTS: * *-- */ Cardinal UrmCreateWidgetTree (URMResourceContextPtr context_id, Widget parent, MrmHierarchy hierarchy_id, IDBFile file_id, String ov_name, ArgList ov_args, Cardinal ov_num_args, MrmCode keytype, String kindex, MrmResource_id krid, MrmManageFlag manage, URMPointerListPtr *svlist, URMResourceContextPtr wref_id, Widget *w_return) { /* * Local variables */ Cardinal result ; /* function results */ Widget widget_id ; /* this widget id */ URMResourceContextPtr child_ctx ; /* context for children */ Widget child_id ; /* current child */ IDBFile loc_file_id ; /* local file id, may be modified */ RGMWidgetRecordPtr widgetrec ; /* the widget record in the context */ int ndx ; /* loop index */ RGMChildrenDescPtr childrendesc ; /* children list descriptor */ RGMChildDescPtr childptr ; /* current child */ String child_idx = NULL ; /* current child index */ char err_msg[300] ; char *w_name; /* * Create the widget instance. */ result = UrmCreateOrSetWidgetInstance (context_id, parent, hierarchy_id, file_id, ov_name, ov_args, ov_num_args, keytype, kindex, krid, manage, svlist, wref_id, &widget_id, &w_name) ; if ( result != MrmSUCCESS ) return result ; *w_return = widget_id ; /* * Initialize a context, and create all the children, Saving their ids. * Note there are no interior returns from the processing loop, and that * all locally acquired resources are returned at the routine exit. * * Initialize a sibling reference context for any class which allows * sibling widget references. */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( widgetrec->children_offs > 0) { UrmGetResourceContext ((char *(*)())NULL, (void(*)())NULL, 0, &child_ctx); childrendesc = (RGMChildrenDescPtr)((char *)widgetrec+widgetrec->children_offs); for ( ndx=0 ; ndxcount ; ndx++ ) { childptr = &childrendesc->child[ndx] ; /* * Read the next child into the child context. Continue looping if it * can't be found. Reading the child from a hierarchy may modify the * file id, but only for reading the child's subtree. */ loc_file_id = file_id ; switch ( childptr->type ) { case URMrIndex: child_idx = (char *) widgetrec+childptr->key.index_offs ; if ( childptr->access == URMaPublic ) result = UrmHGetWidget (hierarchy_id, child_idx, child_ctx, &loc_file_id) ; else result = UrmGetIndexedWidget (file_id, child_idx, child_ctx) ; if ( result != MrmSUCCESS ) sprintf (err_msg, _MrmMMsg_0052, child_idx) ; break ; case URMrRID: result = UrmGetRIDWidget (file_id, childptr->key.id, child_ctx) ; if ( result != MrmSUCCESS ) sprintf (err_msg, _MrmMMsg_0053, childptr->key.id) ; break ; default: result = MrmFAILURE ; sprintf (err_msg, _MrmMMsg_0054, childptr->type) ; break ; } if ( result != MrmSUCCESS ) { Urm__UT_Error ("UrmCreateWidgetTree", err_msg, NULL, NULL, result) ; continue ; } /* * Create the child and its subtree. */ result = UrmCreateWidgetTree (child_ctx, widget_id, hierarchy_id, loc_file_id, NULL, NULL, 0, childptr->type, child_idx, childptr->key.id, ((childptr->manage) ? MrmManageManage : MrmManageUnmanage), svlist, wref_id, &child_id) ; UrmCreateWidgetInstanceCleanup(child_ctx, child_id, loc_file_id); if ( result != MrmSUCCESS ) continue ; /* * loop end */ } /* * done. Deallocate local resources. */ UrmFreeResourceContext (child_ctx) ; } /* * Add the parent widget to the widget reference structure, and update the * SetValues descriptors if appropriate */ if ((w_name != NULL) && (*svlist != NULL)) Urm__CW_ResolveSVWidgetRef(svlist, w_name, *w_return); return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCreateOrSetWidgetInstance determines from a RGM widget * record if the widget instance is real and has to be created by * a call to UrmCreateWidgetInstance or is an automatic child widget * and has to be set by a call to UrmSetWidgetInstance. * * Once UrmCreateOrSetWidgetInstance has been called, then the only * information in the RGM record which may still be required is the * privacy information and the widget children list. This information * may be copied and the resource context reused by users who are doing * recursive widget access, and wish to avoid recursive accumulation * of resource contexts in memory. * * The URM hierarchy for public resources and the IDB file for private * resources are required to evaluate resource references occurring in * the widget arglist. * * This routine accepts override parameters for the widget name, and * to override arguments in the creation arglist. The latter are appended * to the list created from the UID file, and do not replace all values. * * FORMAL PARAMETERS: * * context_id context containing widget record describing widget * to create * parent id of parent widget * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * ov_name Name to override widget name (NULL for no override) * ov_args Override arglist, exactly as would be given to * XtCreateWidget (conversion complete, etc). NULL * for no override. * ov_num_args # args in ov_args; 0 for no override * keytype type of key which accessed this widget * kindex index for URMrIndex access * krid resource id for URMrRID access * manage create-managed flag * svlist list of SetValues descriptors * wref_id structure in which to resolve references to widgets * which have already been defined. * w_return To return id of newly created widget * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid context * MrmBAD_WIDGET_REC invalid widget record * * SIDE EFFECTS: * *-- */ Cardinal UrmCreateOrSetWidgetInstance (URMResourceContextPtr context_id, Widget parent, MrmHierarchy hierarchy_id, IDBFile file_id, String ov_name, ArgList ov_args, Cardinal ov_num_args, MrmCode keytype, String kindex, MrmResource_id krid, MrmManageFlag manage, URMPointerListPtr *svlist, URMResourceContextPtr wref_id, Widget *w_return, char **w_name) { /* * Local variables */ RGMWidgetRecordPtr widgetrec ; /* widget record in the context */ /* * Validate the context and the widget record in the context. * Check the variety and call the appropriate set or create function. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmCreateOrSetWidgetInstance", _MrmMMsg_0043, NULL, NULL, MrmBAD_CONTEXT) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error ("UrmCreateOrSetWidgetInstance", _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; if (widgetrec->variety == UilMrmWidgetVariety) { return UrmCreateWidgetInstance(context_id, parent, hierarchy_id, file_id, ov_name, ov_args, ov_num_args, keytype, kindex, krid, manage, svlist, wref_id, w_return, w_name); } else if (widgetrec->variety == UilMrmAutoChildVariety) { *w_name = NULL; return UrmSetWidgetInstance(context_id, parent, hierarchy_id, file_id, ov_args, ov_num_args, keytype, kindex, krid, manage, svlist, wref_id, w_return); } else return Urm__UT_Error("UrmCreateOrSetWidgetInstance", _MrmMMsg_0055, NULL, context_id, MrmBAD_WIDGET_REC); } /* *++ * * PROCEDURE DESCRIPTION: * * UrmCreateWidgetInstance creates a widget instance from a RGM widget * record by: * * o Creating a legal XtCreateWidget arglist from the RGM * arglist by expanding compressed tags, evaluating values, * and doing type conversion. * * o Deriving the correct low-level widget creation routine * from the RGM record's class specifier, and calling with * the given parent and the arglist. * * Once UrmCreateWidgetInstance has been called, then the only * information in the RGM record which may still be required is the * privacy information and the widget children list. This information * may be copied and the resource context reused by users who are doing * recursive widget access, and wish to avoid recursive accumulation * of resource contexts in memory (see next routine). * * The URM hierarchy for public resources and the IDB file for private * resources are required to evaluate resource references occurring in * the widget arglist. * * This routine accepts override parameters for the widget name, and * to override arguments in the creation arglist. The latter are appended * to the list created from the UID file, and do not replace all values. * * FORMAL PARAMETERS: * * context_id context containing widget record describing widget * to create * parent id of parent widget * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * ov_name Name to override widget name (NULL for no override) * ov_args Override arglist, exactly as would be given to * XtCreateWidget (conversion complete, etc). NULL * for no override. * ov_num_args # args in ov_args; 0 for no override * keytype type of key which accessed this widget * kindex index for URMrIndex access * krid resource id for URMrRID access * manage create-managed flag * svlist list of SetValues descriptors * wref_id structure in which to resolve references to widgets * which have already been defined. * w_return To return id of newly created widget * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid context * MrmBAD_WIDGET_REC invalid widget record * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal UrmCreateWidgetInstance (URMResourceContextPtr context_id, Widget parent, MrmHierarchy hierarchy_id, IDBFile file_id, String ov_name, ArgList ov_args, Cardinal ov_num_args, MrmCode keytype, /* unused */ String kindex, /* unused */ MrmResource_id krid, /* unused */ MrmManageFlag manage, URMPointerListPtr *svlist, URMResourceContextPtr wref_id, Widget *w_return, char **w_name) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in the context */ RGMArgListDescPtr argdesc = NULL ; /* arg list descriptor in record */ Arg *args = NULL ; /* arg list argument for create */ Cardinal num_used = 0 ; /* number of args used in arglist */ MrmCount num_listent = ov_num_args ; /* # entries in args */ WCIClassDescPtr cldesc ; /* class descriptor */ URMPointerListPtr ptrlist = NULL ; /* to hold scratch callbacks */ URMPointerListPtr cblist = NULL ; /* to hold scratch contexts */ URMPointerListPtr ftllist = NULL ; /* to hold scratch fontlists */ int ndx ; /* loop index */ RGMCallbackDescPtr cbptr ; /* creation callback descriptor */ RGMCallbackItemPtr itmptr ; /* current callback item */ void (* cb_rtn) () ; /* current callback routine */ /* BEGIN OSF Fix pir 1860, 2813 */ XmAnyCallbackStruct cb_reason; /* creation callback reason */ /* END OSF Fix pir 1860, 2813 */ /* * Validate the context and the widget record in the context. * Get the low-level creation routine pointer. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmCreateWidgetInstance", _MrmMMsg_0043, NULL, NULL, MrmBAD_CONTEXT) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error ("UrmCreateWidgetInstance", _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; result = Urm__FindClassDescriptor (file_id, widgetrec->type, (XtPointer) ((char *)widgetrec+widgetrec->class_offs), &cldesc) ; if ( result != MrmSUCCESS ) return result ; /* * Allocate the args list, big enough for all the arguments in the widget * record plus all the override arguments. Also initialize a pointer list * to save any contexts created to evaluate resources. */ if ( widgetrec->arglist_offs != 0) { argdesc = (RGMArgListDescPtr) ((char *)widgetrec + widgetrec->arglist_offs) ; num_listent += argdesc->count + argdesc->extra ; UrmPlistInit (10, &ftllist) ; } if ( num_listent > 0 ) { args = (Arg *) XtMalloc (num_listent*sizeof(Arg)) ; UrmPlistInit (10, &ptrlist) ; } /* * Set up the structure for the callback list to free memory on destory widget */ UrmPlistInit (10, &cblist); /* * Set the arg list from the widget record argument list */ if ( argdesc != NULL ) { Urm__CW_CreateArglist (parent, widgetrec, argdesc, ptrlist, cblist, ftllist, hierarchy_id, file_id, args, svlist, wref_id, &num_used) ; } /* * Copy in any override args */ for ( ndx=0 ; ndxname_offs; *w_return = (*(cldesc->creator)) (parent, *w_name, args, num_used) ; Urm__CW_AddWRef (wref_id, *w_name, *w_return) ; if ( *svlist != NULL ) Urm__CW_UpdateSVWidgetRef (svlist, *w_return) ; if ( manage==MrmManageManage )XtManageChild(*w_return); /* * Call the creation callbacks if there are any. */ if ( widgetrec->creation_offs != 0) { if (strcmp(file_id->db_version, URM1_1version) <= 0) cbptr = Urm__CW_TranslateOldCallback((OldRGMCallbackDescPtr) ((char *)widgetrec + widgetrec->creation_offs)); else cbptr = (RGMCallbackDescPtr) ((char *)widgetrec + widgetrec->creation_offs) ; if ( ptrlist == NULL ) UrmPlistInit (10, &ptrlist) ; result = Urm__CW_FixupCallback (parent, (XtPointer)widgetrec, cbptr, ptrlist, cblist, hierarchy_id, file_id, wref_id) ; if ( result == MrmSUCCESS ) for ( ndx=0 ; ndxcount ; ndx++ ) { itmptr = &cbptr->item[ndx] ; cb_rtn = (void (*)()) itmptr->runtime.callback.callback ; if ( cb_rtn != (XtCallbackProc)NULL ) /* BEGIN OSF Fix pir 2813 */ { cb_reason.reason = MrmCR_CREATE; cb_reason.event = NULL; (*cb_rtn) (*w_return, itmptr->runtime.callback.closure, &cb_reason) ; } /* END OSF Fix pir 2813 */ } else if (result == MrmUNRESOLVED_REFS) Urm__UT_Error("UrmCreateWidgetInstance", _MrmMMsg_0056, NULL, NULL, MrmFAILURE) ; else return Urm__UT_Error("UrmCreateWidgetInstance", _MrmMMsg_0057, NULL, NULL, MrmFAILURE); if (strcmp(file_id->db_version, URM1_1version) <= 0) XtFree((char *)cbptr); } /* * successfully created (as far as we can tell). Deallocate all local * resources, including any contexts in the pointer list. */ if ( args != NULL ) XtFree ((char*)args) ; if ( ptrlist != NULL ) { for ( ndx=0 ; ndxnum_ptrs > 0) { XtAddCallback (*w_return, XmNdestroyCallback, (XtCallbackProc) UrmDestroyCallback, cblist); } else { UrmPlistFree (cblist); } /* ** We should really let Xt take care of handling the fontlists by using its ** converters; but for the meanwhile avoid freeing the fontlists here, as the ** widget may be one which doesn't do an XmFontListCopy. Instead, later free ** our extra copy. */ if (ftllist != NULL) { if (UrmPlistNum(ftllist) > 0) XtAddCallback(*w_return, XmNdestroyCallback, (XtCallbackProc) UrmDestroyCallback, ftllist); else UrmPlistFree (ftllist) ; } return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmSetWidgetInstance sets the appropriate resources from a RGM widget * record on the appropriate automatically created child of parent by: * * o Creating a legal XtSetValues arglist from the RGM * arglist by expanding compressed tags, evaluating values, * and doing type conversion. * * o Finding the correct widget child of parent by uncompressing * the resource compression code found in the RGM record's * type specifier, and calling XtNameToWidget on the result. * * Once UrmSetWidgetInstance has been called, then the only * information in the RGM record which may still be required is the * privacy information and the widget children list. This information * may be copied and the resource context reused by users who are doing * recursive widget access, and wish to avoid recursive accumulation * of resource contexts in memory (see next routine). * * The URM hierarchy for public resources and the IDB file for private * resources are required to evaluate resource references occurring in * the widget arglist. * * This routine accepts override parameters to override * arguments in the setvalues arglist. They are appended * to the list created from the UID file, and do not replace all values. * * FORMAL PARAMETERS: * * context_id context containing widget record describing widget * to create * parent id of parent widget * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * ov_args Override arglist, exactly as would be given to * XtCreateWidget (conversion complete, etc). NULL * for no override. * ov_num_args # args in ov_args; 0 for no override * keytype type of key which accessed this widget * kindex index for URMrIndex access * krid resource id for URMrRID access * manage create-managed flag * svlist list of SetValues descriptors * wref_id structure in which to resolve references to widgets * which have already been defined. * w_return To return id of newly created widget * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid context * MrmBAD_WIDGET_REC invalid widget record * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal UrmSetWidgetInstance (URMResourceContextPtr context_id, Widget parent, MrmHierarchy hierarchy_id, IDBFile file_id, ArgList ov_args, Cardinal ov_num_args, MrmCode keytype, /* unused */ String kindex, /* unused */ MrmResource_id krid, /* unused */ MrmManageFlag manage, URMPointerListPtr *svlist, URMResourceContextPtr wref_id, Widget *w_return) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in the context */ String c_name ; /* child name */ String c_name_tmp ; /* child name - temporary */ RGMArgListDescPtr argdesc = NULL ; /* arg list descriptor in record */ Arg *args = NULL ; /* arg list argument for create */ Cardinal num_used = 0 ; /* number of args used in arglist */ MrmCount num_listent = ov_num_args ; /* # entries in args */ URMPointerListPtr ptrlist = NULL ;/* to hold scratch contexts */ URMPointerListPtr cblist = NULL ; /* to hold scratch callbacks */ URMPointerListPtr ftllist = NULL ;/* to hold scratch fontlists */ int ndx ; /* loop index */ RGMCallbackDescPtr cbptr ; /* creation callback descriptor */ RGMCallbackItemPtr itmptr ; /* current callback item */ void (* cb_rtn) () ; /* current callback routine */ /* BEGIN OSF Fix pir 1860, 2813 */ XmAnyCallbackStruct cb_reason; /* creation callback reason */ /* END OSF Fix pir 1860, 2813 */ /* * Validate the context and the widget record in the context. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmSetWidgetInstance", _MrmMMsg_0043, NULL, NULL, MrmBAD_CONTEXT) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error ("UrmSetWidgetInstance", _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; result = Urm__UncompressCode (file_id, widgetrec->type, &c_name) ; if ( result != MrmSUCCESS ) return Urm__UT_Error("UrmSetWidgetInstance", _MrmMMsg_0058, NULL, context_id, result) ; /* Find the widget */ if (strcmp(c_name, "TearOffControl") == 0) /* Special case */ *w_return = XmGetTearOffControl(parent); else { /* Need to add * for ScrolledText and ScrolledList */ c_name_tmp = (String)ALLOCATE_LOCAL((strlen(c_name) + 2) * sizeof(char)); sprintf(c_name_tmp, "*%s", c_name); *w_return = XtNameToWidget(parent, c_name_tmp); /* Deal with ScrollBars for ScrolledList and ScrolledText subclasses. */ if ((*w_return == NULL) && ((strcmp(c_name, "VertScrollBar") == 0) || (strcmp(c_name, "HorScrollBar") == 0))) { *w_return = XtNameToWidget(XtParent(parent), c_name_tmp); } DEALLOCATE_LOCAL(c_name_tmp); } if (*w_return == NULL) return Urm__UT_Error("UrmSetWidgetInstance", _MrmMMsg_0059, NULL, context_id, MrmFAILURE) ; /* * Allocate the args list, big enough for all the arguments in the widget * record plus all the override arguments. Also initialize a pointer list * to save any contexts created to evaluate resources. */ if ( widgetrec->arglist_offs != 0) { argdesc = (RGMArgListDescPtr) ((char *)widgetrec + widgetrec->arglist_offs) ; num_listent += argdesc->count + argdesc->extra ; UrmPlistInit (10, &ftllist) ; } if ( num_listent > 0 ) { args = (Arg *) XtMalloc (num_listent*sizeof(Arg)) ; UrmPlistInit (10, &ptrlist) ; } /* * Set up the structure for the callback list to free memory on destroy widget */ UrmPlistInit (10, &cblist); /* * Set the arg list from the widget record argument list */ if ( argdesc != NULL ) { Urm__CW_CreateArglist (parent, widgetrec, argdesc, ptrlist, cblist, ftllist, hierarchy_id, file_id, args, svlist, wref_id, &num_used) ; } /* * Copy in any override args */ for ( ndx=0 ; ndxcreation_offs != 0) { if (strcmp(file_id->db_version, URM1_1version) <= 0) cbptr = Urm__CW_TranslateOldCallback((OldRGMCallbackDescPtr) ((char *)widgetrec + widgetrec->creation_offs)); else cbptr = (RGMCallbackDescPtr) ((char *)widgetrec + widgetrec->creation_offs) ; if ( ptrlist == NULL ) UrmPlistInit (10, &ptrlist) ; result = Urm__CW_FixupCallback (parent, (XtPointer)widgetrec, cbptr, ptrlist, cblist, hierarchy_id, file_id, wref_id) ; if ( result == MrmSUCCESS ) for ( ndx=0 ; ndxcount ; ndx++ ) { itmptr = &cbptr->item[ndx] ; cb_rtn = (void (*)()) itmptr->runtime.callback.callback ; if ( cb_rtn != (XtCallbackProc)NULL ) /* BEGIN OSF Fix pir 2813 */ { cb_reason.reason = MrmCR_CREATE; cb_reason.event = NULL; (*cb_rtn) (*w_return, itmptr->runtime.callback.closure, &cb_reason) ; } /* END OSF Fix pir 2813 */ } else if (result == MrmUNRESOLVED_REFS) Urm__UT_Error("UrmCreateWidgetInstance", _MrmMMsg_0056, NULL, NULL, MrmFAILURE) ; else return Urm__UT_Error("UrmCreateWidgetInstance", _MrmMMsg_0057, NULL, NULL, MrmFAILURE); if (strcmp(file_id->db_version, URM1_1version) <= 0) XtFree((char *)cbptr); } /* * successfully set (as far as we can tell). Deallocate all local * resources, including any contexts in the pointer list. */ if ( args != NULL ) XtFree ((char*)args) ; if ( ptrlist != NULL ) { for ( ndx=0 ; ndxnum_ptrs > 0) { XtAddCallback (*w_return, XmNdestroyCallback, (XtCallbackProc) UrmDestroyCallback, cblist); } else { UrmPlistFree (cblist); } /* ** We should really let Xt take care of handling the fontlists by using its ** converters; but for the meanwhile avoid freeing the fontlists here, as the ** widget may be one which doesn't do an XmFontListCopy. Instead, later free ** our extra copy. */ if (ftllist != NULL) { if (UrmPlistNum(ftllist) > 0) XtAddCallback(*w_return, XmNdestroyCallback, (XtCallbackProc) UrmDestroyCallback, ftllist); else UrmPlistFree (ftllist) ; } return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Urm__CW_CreateArglist reads the arglist descriptor in an RGM widget * record and produces a legal arglist for XtCreateWidget in the args * parameter. Any argument which encounters an error, or which must * be done with a SetValues, does not appear in the list. * * FORMAL PARAMETERS: * * parent parent of the widget being created * widgetrec widget record pointer * argdesc arglist descriptor in widget record * ctxlist A pointer list to save contexts created to * evaluate literals. * ftllist A pointer list to save fontlists created for use * as resource values, and which must be freed * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * args buffer in which the arglist array of longwords is to * be created. Caller guarantees that it is big enough * (since caller knows number of arguments). * svlist SetValues descriptor list. This routine will add * any SetValues widget arguments to this list. * wref_id reference structure from which references to * previously created widgets in the tree can be * resolved. * num_used Returns number of arguments actually set in args * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__CW_CreateArglist (Widget parent, RGMWidgetRecordPtr widgetrec, RGMArgListDescPtr argdesc, URMPointerListPtr ctxlist, URMPointerListPtr cblist, URMPointerListPtr ftllist, MrmHierarchy hierarchy_id, IDBFile file_id, ArgList args, URMPointerListPtr *svlist, URMResourceContextPtr wref_id, Cardinal *num_used) { /* * Local structures */ typedef struct { RGMIconImagePtr icon ; /* icon to be converted */ RGMArgumentPtr pixarg ; /* argument in widget record */ String filename; /* file name if pixtype is bitmap */ MrmType pixtype ; /* MrmRtypeIconImage or */ /* MrmRtypeXBitmapFile */ } _SavePixmapItem, *_SavePixmapItemPtr ; /* * Local variables */ Cardinal result ; /* function results */ int ndx, cbndx; /* loop indices */ RGMArgumentPtr argptr ; /* current argument descriptor */ MrmType reptype ; /* arg value representation type */ long argval ; /* arg value as it is in record */ int vec_count ; /* count of items in the vector */ long val ; /* value as immediate or pointer */ RGMCallbackDescPtr cbptr ; /* val as callback descriptor */ RGMCallbackItemPtr items; /* Callback items as RGM items */ XtCallbackRec *callbacks; /* Callback items as Xt callbacks */ RGMIconImagePtr icon ; /* val as icon image */ RGMResourceDescPtr resptr ; /* values as resource reference */ String ref_name ; /* referenced widget name */ Widget ref_id ; /* referenced widget id */ IDBFile act_file ; /* file from which literals read */ RGMTextVectorPtr vecptr ; /* text vector arg value */ char err_msg[300] ; _SavePixmapItem pixargs[10] ; /* to save pixmap args */ Cardinal pixargs_cnt = 0 ; /* # pixargs saved */ _SavePixmapItemPtr savepix ; /* current saved pixmap entry */ Screen *screen ; /* screen for pixmaps */ Display *display ; /* display for pixmaps */ Pixel fgint = (Pixel) -1 ; /* fg for pixmaps */ Pixel bgint = (Pixel) -1 ; /* background for pixmaps */ Pixmap pixmap ; /* result of icon conversion */ Cardinal uncmp_res ; /* string uncompression result */ WCIClassDescPtr class_desc ; /* for URM__FindClassDescriptor */ String resource_name ; /* resource name for comparison */ int vec_size ; RGMFontListPtr fontlist; /* for converting old style fontlist */ Boolean swap_needed; /* for resource arguments */ /* * Loop through all the arguments in descriptor. An entry is made in the * in the arglist for each entry which can be successfully evaluated, * fixed up, and converted. * * Some arguments may be affected by other arg values in the arglist. These * are deferred so that these other values will * be available if they are present in the arglist. This removes order * dependency. All such arguments are handled as special cases: * IconImages: saved in pixargs vector * * Ordering may have an important effect on finding widget references. In * particular, references to widgets in submenus depends on the submenus * being created before the reference, as the referenced widget then * appears in the widget reference structure. This is currently done * by the compiler, which orders submenus first in an arglist. */ for ( ndx=0 ; ndxcount ; ndx++ ) { argptr = &argdesc->args[ndx] ; reptype = argptr->arg_val.rep_type ; swap_needed = FALSE ; /* * Create the value. Some representation types and arguments require * special handling. First, the immediate value or pointer is evaluated. * then special handling is done. If no special handling is required, then * the value is fixed up, converted, and put in the args list. * * Icon images are loaded (i.e. brought into memory and all pointer * fixups done), but they are then treated as SetValues args, and saved * for processing after the widget is created. */ argval = Urm__CW_EvaluateValOrOffset (reptype, (XtPointer)widgetrec, argptr->arg_val.datum.ival, argptr->arg_val.datum.offset) ; val = argval ; switch ( reptype ) { case MrmRtypeCallback: if (strcmp(file_id->db_version, URM1_1version) <= 0) cbptr = Urm__CW_TranslateOldCallback((OldRGMCallbackDescPtr)val); else cbptr = (RGMCallbackDescPtr)val; result = Urm__CW_FixupCallback(parent, (XtPointer)widgetrec, cbptr, ctxlist, cblist, hierarchy_id, file_id, wref_id) ; switch (result) { case MrmSUCCESS: /* Move individual items so array functions as callback list */ items = cbptr->item; callbacks = (XtCallbackRec *)((RGMCallbackDescPtr)val)->item; for (cbndx = 0; cbndx <= cbptr->count; cbndx++) /* <= so that null item is copied. */ { callbacks[cbndx].callback = (XtCallbackProc) items[cbndx].runtime.callback.callback; callbacks[cbndx].closure = (XtPointer) items[cbndx].runtime.callback.closure; } val = (long)callbacks; break; case MrmUNRESOLVED_REFS: Urm__CW_AppendCBSVWidgetRef (file_id, svlist, cbptr, argptr->tag_code, (String) ((char *)widgetrec+argptr->stg_or_relcode.tag_offs)); /* No break */ default: continue; } if (strcmp(file_id->db_version, URM1_1version) <= 0) XtFree((char *)cbptr); break ; case MrmRtypeResource: resptr = (RGMResourceDescPtr) val ; if (resptr->cvt_type & MrmResourceUnswapped) { resptr->cvt_type &= ~MrmResourceUnswapped; swap_needed = TRUE; } switch ( resptr->res_group ) { case URMgWidget: if ( ((unsigned char)resptr->cvt_type==RGMwrTypeSubTree) || Urm__IsSubtreeResource(file_id,argptr->tag_code) ) { result = Urm__CW_LoadWidgetResource (parent, widgetrec, resptr, ctxlist, hierarchy_id, file_id, svlist, wref_id, &val) ; if ( result != MrmSUCCESS ) continue ; } else { if ( resptr->type != URMrIndex ) { Urm__UT_Error ("Urm__CW_CreateArglist", _MrmMMsg_0060, NULL, NULL, MrmFAILURE) ; continue; } ref_name = (String) resptr->key.index; result = Urm__CW_FindWRef (wref_id, ref_name, &ref_id) ; if ( result != MrmSUCCESS ) { Urm__CW_AppendSVWidgetRef (file_id, svlist, ref_name, argptr->tag_code, (String)widgetrec+ argptr->stg_or_relcode.tag_offs); continue ; } val = (long) ref_id ; } break ; case URMgLiteral: result = Urm__CW_ReadLiteral (resptr, hierarchy_id, file_id, ctxlist, &reptype, &argval, &vec_count, &act_file, &vec_size) ; val = argval ; if ( result != MrmSUCCESS ) continue ; switch ( reptype ) { case MrmRtypeIconImage: savepix = &pixargs[pixargs_cnt] ; savepix->icon = (RGMIconImagePtr) val ; savepix->pixarg = argptr ; savepix->pixtype = reptype ; pixargs_cnt += 1 ; continue ; case MrmRtypeXBitmapFile: savepix = &pixargs[pixargs_cnt] ; savepix->filename = (String) val ; savepix->pixarg = argptr ; savepix->pixtype = reptype ; pixargs_cnt += 1 ; continue ; case MrmRtypeInteger: case MrmRtypeBoolean: if ( swap_needed ) { swapbytes( val ); swap_needed = FALSE ; } break; case MrmRtypeFontList: if (strcmp(file_id->db_version, URM1_1version) <= 0) { int count = ((OldRGMFontListPtr)val)->count; fontlist = (RGMFontListPtr) XtMalloc(sizeof(RGMFontList) + (sizeof(RGMFontItem) * (count - 1))); result = Urm__CW_FixupValue((long)fontlist, reptype, (XtPointer)val, file_id, &swap_needed); val = (long)fontlist; } else result = Urm__CW_FixupValue(val, reptype, (XtPointer)val, file_id, &swap_needed) ; break; case MrmRtypeSingleFloat: if ( swap_needed ) { swapbytes( val ); swap_needed = FALSE ; } _MrmOSIEEEFloatToHost( (float *) &val ); break; case MrmRtypeFloat: if ( swap_needed ) { swapdouble( *(double *)val ); swap_needed = FALSE ; } _MrmOSIEEEDoubleToHost( (double *) val ); break; default: result = Urm__CW_FixupValue(val,reptype,(XtPointer)val, file_id, &swap_needed) ; } if ( result != MrmSUCCESS ) continue ; /* * Fix for CR 5410 - Do not run ConvertValue on Colors * because the parent's colormap should be used when * allocating the colors which is currently impossible * in ConvertValue. Convert the colors separately. */ if (reptype == MrmRtypeColor) { Pixel pix; RGMColorDescPtr colorptr; Colormap cmap; uncmp_res = Urm__FindClassDescriptor (file_id, widgetrec->type, (XtPointer)((char *)widgetrec+widgetrec->class_offs), &class_desc) ; if ((uncmp_res == MrmSUCCESS) && (class_desc->creator == _XmCreateRendition)) { display = _XmRenderTableDisplay((XmRenderTable)parent); cmap = XDefaultColormap(display, XDefaultScreen(display)); } else { display = XtDisplay(parent); cmap = parent->core.colormap; } colorptr = (RGMColorDescPtr) val; switch (colorptr->desc_type) { case URMColorDescTypeName: result = Urm__UT_GetNamedColorPixel (display, cmap, colorptr, &pix, XBlackPixelOfScreen(XDefaultScreenOfDisplay(display))); if ( result != MrmSUCCESS ) { sprintf (err_msg, _MrmMMsg_0061, (String)(colorptr->desc.name)) ; result = Urm__UT_Error("Urm__CW_ConvertValue",err_msg, NULL, NULL, MrmNOT_FOUND) ; } break; case URMColorDescTypeRGB: result = Urm__UT_GetColorPixel (display, cmap, colorptr, &pix, XBlackPixelOfScreen(XDefaultScreenOfDisplay(display))); if ( result != MrmSUCCESS ) { sprintf (err_msg, _MrmMMsg_0039, colorptr->desc.rgb.red, colorptr->desc.rgb.green, colorptr->desc.rgb.blue) ; result = Urm__UT_Error("Urm__CW_ConvertValue",err_msg, NULL, NULL, MrmNOT_FOUND) ; } break; default: sprintf (err_msg, _MrmMMsg_0040); result = Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmFAILURE) ; }; val = (long) pix ; } else /* * End Fix for CR 5410 */ { uncmp_res = Urm__FindClassDescriptor (file_id, widgetrec->type, (XtPointer)((char *)widgetrec+widgetrec->class_offs), &class_desc) ; if ((uncmp_res == MrmSUCCESS) && (class_desc->creator == _XmCreateRendition)) display = _XmRenderTableDisplay((XmRenderTable)parent); else display = XtDisplay(parent); result = Urm__CW_ConvertValue (parent, &val, reptype, resptr->cvt_type, display, hierarchy_id, ftllist) ; } if ( result != MrmSUCCESS ) continue ; if ( argptr->tag_code == UilMrmUnknownCode ) { resource_name = (char *) ((char *)widgetrec+argptr->stg_or_relcode.tag_offs) ; } else { uncmp_res = Urm__UncompressCode (file_id, argptr->tag_code, &resource_name) ; if ( uncmp_res != MrmSUCCESS ) { sprintf (err_msg, _MrmMMsg_0062, argptr->tag_code) ; Urm__UT_Error ("Urm__CW_CreateArglist", err_msg, NULL, NULL, uncmp_res) ; } } if ( strcmp(resource_name, XmNuserData) == 0) { switch (reptype) { case MrmRtypeChar8Vector: case MrmRtypeCStringVector: vec_size -= (sizeof ( RGMTextVector ) - sizeof ( RGMTextEntry )); break; default: break; } Urm__CW_SafeCopyValue (&val, reptype, cblist, vec_count, vec_size); } /* * Fix for CR 3281 - check to see if the resource_name * is XmNaccelerators. If it is, run * XtParseAcceleratorTable and assign the output to val. */ if ( strcmp(resource_name, XmNaccelerators) == 0) { val = (long)XtParseAcceleratorTable((String)argval); } /* * End fix for CR 3281 */ break ; default: Urm__UT_Error ("Urm__CW_CreateArglist", _MrmMMsg_0063, NULL, NULL, MrmFAILURE) ; continue ; } break ; case MrmRtypeIconImage: icon = (RGMIconImagePtr) val ; result = Urm__CW_LoadIconImage (icon, (XtPointer)widgetrec, hierarchy_id, file_id, ctxlist) ; if ( result != MrmSUCCESS ) continue ; savepix = &pixargs[pixargs_cnt] ; savepix->icon = icon ; savepix->pixarg = argptr ; savepix->pixtype = reptype ; pixargs_cnt += 1 ; continue ; case MrmRtypeXBitmapFile: savepix = &pixargs[pixargs_cnt] ; savepix->filename = (String) val ; savepix->pixarg = argptr ; savepix->pixtype = reptype ; pixargs_cnt += 1 ; continue ; default: result = Urm__CW_FixupValue (val, reptype, (XtPointer)widgetrec, file_id, &swap_needed) ; if ( result != MrmSUCCESS ) continue ; uncmp_res = Urm__FindClassDescriptor (file_id, widgetrec->type, (XtPointer)((char *)widgetrec+widgetrec->class_offs), &class_desc); if ((uncmp_res == MrmSUCCESS) && (class_desc->creator == _XmCreateRendition)) display = _XmRenderTableDisplay((XmRenderTable)parent); else if ((uncmp_res == MrmSUCCESS) && (class_desc->creator == _XmCreateTab)) display = NULL; else display = XtDisplay(parent); result = Urm__CW_ConvertValue (parent, &val, reptype, 0, display, hierarchy_id, ftllist) ; if ( result != MrmSUCCESS ) continue ; break ; } args[*num_used].value = (XtArgVal)val ; /* * Create the tag string in the name slot of the current entry. Also * do any special processing based on tag code: * - Retain values of foreground and background if they are * explicitly set * - Set the count for some lists * * 'argval' has preserved the pointer to RGM structures which may have * been replaced in 'val' by a pointer to structures (lists) required by * the toolkit */ if ( argptr->tag_code == UilMrmUnknownCode ) { args[*num_used].name = (char *) widgetrec+argptr->stg_or_relcode.tag_offs ; *num_used += 1 ; } else { uncmp_res = Urm__UncompressCode (file_id, argptr->tag_code, &(args[*num_used].name)) ; if ( uncmp_res == MrmSUCCESS ) *num_used += 1 ; else { sprintf (err_msg, _MrmMMsg_0062, argptr->tag_code) ; Urm__UT_Error ("Urm__CW_CreateArglist", err_msg, NULL, NULL, uncmp_res) ; } } /* * Special processing: * retain the value pointer for foreground or background. * Note reference to name in arglist from previous operation. */ /* Begin fixing OSF 5473 */ if(*num_used){ if ( strcmp(args[*num_used-1].name,XmNforeground) == 0 ) fgint = val ; if ( strcmp(args[*num_used-1].name,XmNbackground) == 0 ) bgint = val ; } /* End fixing OSF 5473 */ /* * Create an additional arglist entry for the count field for any argument * which has a related argument (which is always a counter) */ if ( argptr->tag_code != UilMrmUnknownCode ) if ( argptr->stg_or_relcode.related_code != 0) { switch ( reptype ) { case MrmRtypeChar8Vector: case MrmRtypeCStringVector: /* * Fix for HaL DTS 10226 - If the type is Integer Vector * (used mainly in the XmNselectionArray resource on * the Text and TextField widgets), load in the count * for the XmNselectionArrayCount resource. */ case MrmRtypeIntegerVector: vecptr = (RGMTextVectorPtr) argval; args[*num_used].value = (XtArgVal)vecptr->count; break; } uncmp_res = Urm__UncompressCode (file_id, argptr->stg_or_relcode.related_code, &args[*num_used].name); if ( uncmp_res == MrmSUCCESS ) *num_used += 1; else { sprintf (err_msg, _MrmMMsg_0062, argptr->tag_code) ; Urm__UT_Error ("Urm__CW_CreateArglist", err_msg, NULL, NULL, uncmp_res) ; } } } /* Loop end */ /* * Now set any pixmap arguments. This requires finding the display, screen, * foreground, and background values for this widget. These values are * available from the parent widget and the arglist. */ if ( pixargs_cnt > 0 ) { Urm__CW_GetPixmapParms (parent, &screen, &display, &fgint, &bgint) ; for ( ndx=0,savepix=pixargs ; ndxpixtype == MrmRtypeXBitmapFile ) { result = Urm__CW_ReadBitmapFile (savepix->filename, screen, fgint, bgint, &pixmap, parent); if ( result != MrmSUCCESS ) continue ; } else { /* ** Create a pixmap from an Icon definition */ result = UrmCreatePixmap (savepix->icon, screen, display, fgint, bgint, &pixmap, parent) ; if ( result != MrmSUCCESS ) continue ; } /* ** Place resultant Pixmap in arglist */ args[*num_used].value = (XtArgVal) pixmap ; argptr = savepix->pixarg ; if ( argptr->tag_code == UilMrmUnknownCode ) args[*num_used].name = (char *) (widgetrec+argptr->stg_or_relcode.tag_offs) ; else Urm__UncompressCode (file_id, argptr->tag_code, &(args[*num_used].name)) ; *num_used += 1 ; } } /* * arglist creation complete. */ } /* *++ * * PROCEDURE DESCRIPTION: * * Return either a immediate value (ival) or a widget record memory * pointer depending on the representation type. * * FORMAL PARAMETERS: * * reptype representation type, from RGMrType... * bufptr buffer address for offset * ival immediate value * offset offset in widget record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ long Urm__CW_EvaluateValOrOffset (MrmType reptype, XtPointer bufptr, long ival, MrmOffset offset) { switch ( reptype ) { case MrmRtypeInteger: case MrmRtypeBoolean: case MrmRtypeSingleFloat: return ival ; case MrmRtypeNull: return 0; default: return (long) ((char *)bufptr+offset) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine does any fixups required on a value. The fixups are * usually relocation of pointers within the object located by the * value interpreted as a pointer to a data structure. * * FORMAL PARAMETERS: * * val value of an argument (may be a pointer) * reptype vaue representation type, from RGMrType... * bufptr the buffer (base address) for any fixed-up * values * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS ; * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal Urm__CW_FixupValue (long val, MrmType reptype, XtPointer bufptr, IDBFile file_id, /* unused */ Boolean *swap_needed) { /* * Local variables */ RGMTextVectorPtr vecptr ; /* text vector arg value */ int fixndx ; /* list fixup loop index */ /* BEGIN OSF Fix CR 4859 */ RGMWCharEntryPtr wcharentry; /* Resource as wide character string */ wchar_t *wcstr_r; size_t max_size, str_size; /* END OSF Fix CR 4859 */ RGMFontItemPtr fontitem; /* resource as font item */ OldRGMFontItemPtr olditem; /* old style font item */ RGMFontListPtr fontlist ; /* resource as font list */ OldRGMFontListPtr oldlist ; /* resource as old style font list */ switch ( reptype ) { case MrmRtypeChar8Vector: case MrmRtypeCStringVector: vecptr = (RGMTextVectorPtr) val ; if ( *swap_needed ) { swapbytes(vecptr->count); swapbytes(vecptr->validation); } for ( fixndx=0 ; fixndxcount ; fixndx++ ) { if ( *swap_needed ) { #ifdef WORD64 swap4bytes(vecptr->item[fixndx].text_item.rep_type); swap4bytes(vecptr->item[fixndx].text_item.offset); #else swap2bytes(vecptr->item[fixndx].text_item.rep_type); swap2bytes(vecptr->item[fixndx].text_item.offset); #endif } if (reptype == MrmRtypeChar8Vector) vecptr->item[fixndx].pointer = (XtPointer) ((char *)bufptr+vecptr->item[fixndx].text_item.offset) ; else vecptr->item[fixndx].pointer = (XtPointer) XmCvtByteStreamToXmString((unsigned char *)bufptr + vecptr->item[fixndx].text_item.offset); } *swap_needed = FALSE; break ; /* BEGIN OSF Fix CR 4859 */ case MrmRtypeWideCharacter: wcharentry = (RGMWCharEntryPtr)val; if (*swap_needed) swapbytes(wcharentry->wchar_item.count); /* Allocate memory */ max_size = wcharentry->wchar_item.count; wcstr_r = (wchar_t *)XtMalloc(sizeof(wchar_t) * (max_size + 1)); /* Convert, realloc, store */ str_size = mbstowcs(wcstr_r, wcharentry->wchar_item.bytes, max_size); if (str_size == -1) return(Urm__UT_Error("Urm__CW_FixupValue", _MrmMMsg_0110, NULL, NULL, MrmFAILURE)); if (str_size != max_size) wcstr_r = (wchar_t *)XtRealloc((char *)wcstr_r, sizeof(wchar_t) * (str_size + 1)); else wcstr_r[str_size] = (wchar_t)0L; wcharentry->pointer = (XtPointer)wcstr_r; *swap_needed = FALSE; break; /* END OSF Fix CR 4859 */ case MrmRtypeFont: case MrmRtypeFontSet: fontitem = (RGMFontItemPtr) val; if ( *swap_needed ) { swapbytes( fontitem->cset.cs_offs ); swapbytes( fontitem->font.font_offs ); } fontitem->cset.charset = (/*XmStringCharset*/String) bufptr+fontitem->cset.cs_offs; fontitem->font.font = (String) bufptr+fontitem->font.font_offs; *swap_needed = FALSE; break; case MrmRtypeFontList: if (strcmp(file_id->db_version, URM1_1version) <= 0) /* Converting an old style fontlist */ { oldlist = (OldRGMFontListPtr)bufptr; fontlist = (RGMFontListPtr)val; fontlist->validation = oldlist->validation; fontlist->count = oldlist->count; for ( fixndx=0 ; fixndxcount ; fixndx++ ) { olditem = &oldlist->item[fixndx]; fontitem = &fontlist->item[fixndx]; fontitem->cset.charset = XtNewString(( /*XmStringCharset*/String) bufptr+olditem->cset.cs_offs); fontitem->font.font = XtNewString((String)bufptr+olditem->font.font_offs); fontitem->type = MrmRtypeFont; } } else { fontlist = (RGMFontListPtr) val ; if ( *swap_needed ) { swapbytes( fontlist->validation ); swapbytes( fontlist->count ); } for ( fixndx=0 ; fixndxcount ; fixndx++ ) { fontitem = &fontlist->item[fixndx]; if ( *swap_needed ) { swapbytes( fontitem->cset.cs_offs ); swapbytes( fontitem->font.font_offs ); swapbytes( fontitem->type ); } fontitem->cset.charset = ( /*XmStringCharset*/String) bufptr+fontitem->cset.cs_offs; fontitem->font.font = (String) bufptr+fontitem->font.font_offs; } } *swap_needed = FALSE; break ; case MrmRtypeHorizontalInteger: case MrmRtypeVerticalInteger: { RGMUnitsIntegerPtr unitsvalue; unitsvalue = (RGMUnitsIntegerPtr) val; if ( *swap_needed ) { swapbytes( unitsvalue->value ); swapbytes( unitsvalue->units ); *swap_needed = FALSE; } } break ; case MrmRtypeHorizontalFloat: case MrmRtypeVerticalFloat: { RGMUnitsFloatPtr unitsvalue; double *floatval; unitsvalue = (RGMUnitsFloatPtr) val; floatval = (double *)(&unitsvalue->value[0]); if ( *swap_needed ) { swapdouble(*floatval); swapbytes( unitsvalue->units ); } *swap_needed = FALSE; _MrmOSIEEEDoubleToHost( floatval ); *((double *)(&unitsvalue->value[0])) = *floatval; } break ; default: break ; } return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine converts the display into a string byte by * byte. Any Null bytes are not (?) omitted in returned string. * * FORMAL PARAMETERS: * * val the value to be converted (may be a pointer) * add_sting a string to be added to the returned string * after the display. * add_string_size the additional string length when Calloc on * the return value is done. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * returns the string if one is created, otherwise returns null * * SIDE EFFECTS: * *-- */ String Urm__CW_DisplayToString (char *val, String add_string, int add_string_size) { /* * Local variables */ String return_val; unsigned int dpysize = sizeof(Display *); int ndx; int count=0; return_val = XtCalloc (1, dpysize + add_string_size); if (return_val == NULL) { return (return_val); } for (ndx=0 ; ndxcount; tbl = (String *)vecptr->item; for (ndx = 0; ndx < vec_count; ndx++) tbl[ndx] = (String)(vecptr->item[ndx].pointer); *val = (long)tbl; break ; } case MrmRtypeCStringVector: { XmStringTable tbl; vecptr = (RGMTextVectorPtr) (*val) ; /* Have to pack vecptr */ vec_count = vecptr->count; tbl = (XmStringTable)vecptr->item; for (ndx = 0; ndx < vec_count; ndx++) tbl[ndx] = (XmString)(vecptr->item[ndx].pointer); *val = (long)tbl; break; } case MrmRtypeCString: cstg = XmCvtByteStreamToXmString((unsigned char *)*val); *val = (long)cstg; /* BEGIN OSF Fix CR 8392 */ /* fix memory leak */ if ( ftllist != NULL ) { UrmPlistAppendPointer (ftllist, (XtPointer)(long)reptype); UrmPlistAppendPointer (ftllist, (XtPointer)*val); } /* END OSF Fix CR 8392 */ break; case MrmRtypeIntegerVector: { RGMIntegerVectorPtr vecptr ; /* val as integer vector */ vecptr = (RGMIntegerVectorPtr) (*val) ; *val = (long) vecptr->item ; break ; } case MrmRtypeAddrName: result = Urm__LookupNameInHierarchy (hierarchy_id, (String)(*val), &addr); if ( result != MrmSUCCESS ) { sprintf (err_msg, _MrmMMsg_0066, (String)(*val)) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, result) ; } *val = (long) addr ; break ; case MrmRtypeIconImage: Urm__CW_GetPixmapParms(parent, &screen, &display, &fgint, &bgint); result = UrmCreatePixmap((RGMIconImagePtr)(*val), screen, display, fgint, bgint, &pixmap, parent); if (result != MrmSUCCESS) return (Urm__UT_Error("Urm__CW_ConvertValue", _MrmMMsg_0112, NULL, NULL, MrmFAILURE)); *val = (long)pixmap; break; case MrmRtypeXBitmapFile: Urm__CW_GetPixmapParms(parent, &screen, &display, &fgint, &bgint); result = Urm__CW_ReadBitmapFile((char *)(*val), screen, fgint, bgint, &pixmap, parent); if (result != MrmSUCCESS) return (Urm__UT_Error("Urm__CW_ConvertValue", _MrmMMsg_0112, NULL, NULL, MrmFAILURE)); *val = (long)pixmap; break; case MrmRtypeFont: case MrmRtypeFontSet: fontptr = (RGMFontItemPtr) (*val) ; fontstg = fontptr->font.font; dpyandfontstr = Urm__CW_DisplayToString ((char*)&display, fontstg, strlen(fontstg) + 1); if ( dpyandfontstr == NULL) { return Urm__UT_Error ("Urm__CW_ConvertValue", _MrmMMsg_0069, NULL, NULL, MrmFAILURE) ; } switch (reptype) { case MrmRtypeFont: result = Urm__WCI_LookupRegisteredName(dpyandfontstr, (XtPointer *)&font); if ( result != MrmSUCCESS ) { font = XLoadQueryFont (display, fontstg); if ( font == NULL ) { sprintf (err_msg, _MrmMMsg_0070, fontstg); return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } Urm__WCI_RegisterNames (&dpyandfontstr, (XtPointer *)&font, 1); { XmDisplay dd = (XmDisplay) XmGetXmDisplay(display); if (dd) XtAddCallback((Widget)dd,XtNdestroyCallback, DisplayDestroyCallback, (XtPointer) XtNewString(dpyandfontstr)); } } break; case MrmRtypeFontSet: result = Urm__WCI_LookupRegisteredName(dpyandfontstr, (XtPointer *)&fontset); if ( result != MrmSUCCESS ) { fontset = XCreateFontSet(display, fontstg, &missing_csets, &missing_cset_cnt, &def_string); if (fontset == NULL) { sprintf(err_msg, _MrmMMsg_0071, fontstg); return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } Urm__WCI_RegisterNames(&dpyandfontstr, (XtPointer *)&fontset, 1); } break; } XtFree (dpyandfontstr); if ( cvttype == MrmRtypeFontList ) { switch(reptype) { case MrmRtypeFont: dfontlist = XmFontListCreate (font, fontptr->cset.charset) ; break; case MrmRtypeFontSet: fontset_entry = XmFontListEntryCreate(fontptr->cset.charset, XmFONT_IS_FONTSET, fontset); dfontlist = XmFontListAppendEntry(NULL, fontset_entry); break; } if ( ftllist != NULL ) { UrmPlistAppendPointer (ftllist, (XtPointer)(long)reptype); UrmPlistAppendPointer (ftllist, (XtPointer)dfontlist); } *val = (long) dfontlist ; } else *val = (long) font ; break ; case MrmRtypeFontList: fontlist = (RGMFontListPtr) (*val) ; dfontlist = NULL ; for ( ndx=0 ; ndxcount ; ndx++ ) { fontstg = fontlist->item[ndx].font.font; dpyandfontstr = Urm__CW_DisplayToString((char*)&display, fontstg, strlen(fontstg) + 1); if ( dpyandfontstr == NULL) { return Urm__UT_Error ("Urm__CW_ConvertValue", _MrmMMsg_0069, NULL, NULL, MrmFAILURE) ; } switch (fontlist->item[ndx].type) { case MrmRtypeFont: result = Urm__WCI_LookupRegisteredName(dpyandfontstr, (XtPointer *)&font); if ( result != MrmSUCCESS ) { font = XLoadQueryFont (display, fontstg); if ( font == NULL ) { sprintf (err_msg, _MrmMMsg_0070, fontstg); return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } Urm__WCI_RegisterNames(&dpyandfontstr, (XtPointer *)&font, 1); { XmDisplay dd = (XmDisplay) XmGetXmDisplay(display); if (dd) XtAddCallback((Widget)dd,XtNdestroyCallback, DisplayDestroyCallback, (XtPointer) XtNewString(dpyandfontstr)); } } break; case MrmRtypeFontSet: result = Urm__WCI_LookupRegisteredName(dpyandfontstr, (XtPointer *)&fontset); if ( result != MrmSUCCESS ) { fontset = XCreateFontSet(display, fontstg, &missing_csets, &missing_cset_cnt, &def_string); if (fontset == NULL) { sprintf(err_msg, _MrmMMsg_0071, fontstg); return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } if (missing_csets != NULL) { sprintf(err_msg, _MrmMMsg_0072, fontstg); XFreeStringList(missing_csets); } Urm__WCI_RegisterNames(&dpyandfontstr, (XtPointer *)&fontset, 1); } break; } XtFree (dpyandfontstr); switch(fontlist->item[ndx].type) { case MrmRtypeFont: if ( dfontlist == NULL ) dfontlist = XmFontListCreate (font, fontlist->item[ndx].cset.charset) ; else dfontlist = XmFontListAdd (dfontlist, font, fontlist->item[ndx].cset.charset) ; if ( dfontlist == NULL ) { sprintf (err_msg, _MrmMMsg_0073, fontlist->item[ndx].font.font) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmFAILURE) ; } break; case MrmRtypeFontSet: fontset_entry = XmFontListEntryCreate(fontlist->item[ndx].cset.charset, XmFONT_IS_FONTSET, fontset); dfontlist = XmFontListAppendEntry(NULL, fontset_entry); if ( dfontlist == NULL ) { sprintf (err_msg, _MrmMMsg_0074, fontlist->item[ndx].font.font) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmFAILURE) ; } break; } } *val = (long) dfontlist ; /* * Save only the final fontlist to be freed later. All intermediate * ones are freed by XmFontListAdd */ if ( ftllist != NULL ) { UrmPlistAppendPointer (ftllist, (XtPointer)(long)reptype); UrmPlistAppendPointer (ftllist, (XtPointer)dfontlist); } break ; case MrmRtypeColor: colorptr = (RGMColorDescPtr) (*val) ; switch (colorptr->desc_type) { case URMColorDescTypeName: result = Urm__UT_GetNamedColorPixel (display, (Colormap)0, colorptr, &pix, XBlackPixelOfScreen(XDefaultScreenOfDisplay(display))) ; if ( result != MrmSUCCESS ) { if (result == MrmPARTIAL_SUCCESS) result = MrmSUCCESS; sprintf (err_msg, _MrmMMsg_0061, (String)(colorptr->desc.name)) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } break; case URMColorDescTypeRGB: result = Urm__UT_GetColorPixel (display, (Colormap)0, colorptr, &pix, XBlackPixelOfScreen(XDefaultScreenOfDisplay(display))) ; if ( result != MrmSUCCESS ) { if (result == MrmPARTIAL_SUCCESS) result = MrmSUCCESS; sprintf (err_msg, _MrmMMsg_0039, colorptr->desc.rgb.red, colorptr->desc.rgb.green, colorptr->desc.rgb.blue) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } break; default: sprintf(err_msg, _MrmMMsg_0040); return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmFAILURE) ; }; *val = (long) pix ; break ; /* BEGIN OSF Fix CR 4859 */ case MrmRtypeWideCharacter: { RGMWCharEntryPtr wcharentry; wcharentry = (RGMWCharEntryPtr)*val; *val = (long)wcharentry->pointer; break; } /* END OSF Fix CR 4859 */ case MrmRtypeTransTable: /* * WARNING: memory leak created... */ trans = XtParseTranslationTable ((String)(*val)) ; if ( trans == NULL ) { sprintf (err_msg, _MrmMMsg_0065, (String)(*val)) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmFAILURE) ; } *val = (long) trans ; break ; case MrmRtypeClassRecName: clrec = Urm__WCI_GetClRecOfName ((String)*val) ; if ( clrec == NULL ) { sprintf (err_msg, _MrmMMsg_0075, (String)(*val)) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } *val = (long) clrec ; break ; case MrmRtypeKeysym: xkey = XStringToKeysym ((String)*val); if ( xkey == NoSymbol ) { sprintf (err_msg, _MrmMMsg_0076, (String)(*val)) ; return Urm__UT_Error ("Urm__CW_ConvertValue", err_msg, NULL, NULL, MrmNOT_FOUND) ; } *val = (long) xkey; break; case MrmRtypeHorizontalInteger: orientation = XmHORIZONTAL; /* fall through */ case MrmRtypeVerticalInteger: if (orientation == XmNO_ORIENTATION) { orientation = XmVERTICAL; } /* get a screen that we can use */ screen = DefaultScreenOfDisplay(display); unitsintvalue = (RGMUnitsIntegerPtr) *val; if (unitsintvalue->value != 0) { *val = _XmConvertUnits(screen, orientation, unitsintvalue->units, unitsintvalue->value, XmPIXELS); if (*val == 0) { return Urm__UT_Error ("Urm__CW_ConvertValue", _MrmMMsg_0115, NULL, NULL, MrmNOT_FOUND) ; } } else *val = 0; break; case MrmRtypeHorizontalFloat: orientation = XmHORIZONTAL; /* fall through */ case MrmRtypeVerticalFloat: { float float_val, int_value; int int_units, float_units; if (orientation == XmNO_ORIENTATION) { orientation = XmVERTICAL; } /* get a screen that we can use */ screen = DefaultScreenOfDisplay(display); unitsfloatvalue = (RGMUnitsFloatPtr) *val; float_units = unitsfloatvalue->units; float_val = (float)(*((double *)(&unitsfloatvalue->value[0]))); if (float_val != 0) { if (_XmConvertFloatUnitsToIntUnits(float_units, float_val, &int_units, &int_value, XmPIXELS) == False) { return Urm__UT_Error ("Urm__CW_ConvertValue", _MrmMMsg_0116, NULL, NULL, MrmFAILURE); } *val = _XmConvertUnits(screen, orientation, int_units, MAKEINT(int_value), XmPIXELS); if (*val == 0) { return Urm__UT_Error ("Urm__CW_ConvertValue", _MrmMMsg_0115, NULL, NULL, MrmFAILURE); } } else *val = 0; } break; default: break ; } return MrmSUCCESS ; } /* ** Remove the font from the hash table so it won't later cause a protocol ** error if the display is closed and reopened and the same value is fetched. */ /*ARGSUSED*/ static void DisplayDestroyCallback ( Widget w, XtPointer client_data, XtPointer call_data ) /* unused */ { String dpyandfontstr = (String) client_data; XFontStruct *font ; if (MrmSUCCESS == Urm__WCI_LookupRegisteredName(dpyandfontstr, (XtPointer *)&font)) XFreeFont(XtDisplay(w), font); Urm__WCI_UnregisterName (dpyandfontstr); XtFree(dpyandfontstr); } /* *++ * * PROCEDURE DESCRIPTION: * * This routine copies a value to an 'eternal' block in order * to guarantee that callback tag values will live forever. * * FORMAL PARAMETERS: * * val the value to be copied (may be a pointer) * reptype value representation type * vec_count number of elements in the vector (for vector types) * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ static char* staticNull = NULL; void Urm__CW_SafeCopyValue (long *val, MrmType reptype, URMPointerListPtr cblist, int vec_count, int vec_size) { /* * Local variables */ int *int_src ; /* to copy integer values */ int *int_dst ; String char8_src ; /* to copy string values */ String char8_dst ; float *single_float_src ; /* to copy FP values */ float *single_float_dst ; double *float_src ; /* to copy FP values */ double *float_dst ; XmString cstr_src ; /* to copy compound strings */ XmString *cstr_table_src; /* to copy compound string table */ XmString *cstr_table_dst ; String *char8_table_src ; /* to coy string table */ String *char8_table_dst ; wchar_t *wchar_src; /* to copy wide character strings */ wchar_t *wchar_dst; size_t size; int cnt ; /* * Make copies of all primitive data structures. Note this has the side * effect of converting integer values to by-reference. */ switch ( reptype ) { case MrmRtypeIntegerVector: int_src = (int *) *val ; int_dst = (int *) XtMalloc ((unsigned int)vec_size) ; UrmBCopy (int_src, int_dst, vec_size) ; *val = (long) int_dst ; if (cblist != NULL) { UrmPlistAppendPointer (cblist, (XtPointer)(long)reptype); UrmPlistAppendPointer (cblist, (XtPointer)*val); } break ; case MrmRtypeCStringVector: cstr_table_src = (XmString *)*val; cstr_table_dst = (XmString *)XtMalloc(vec_count * sizeof(XmString)) ; for (cnt=0; cntnum_ptrs ; ndx++) { reptype = (MrmType)(long)list_id->ptr_vec[ndx]; ndx++; switch ( reptype ) { case MrmRtypeCString: XmStringFree ((XmString)list_id->ptr_vec[ndx]); break ; /* BEGIN OSF Fix CR 6224 */ case MrmRtypeFont: /* Do not free the fontstruct. */ break; /* END OSF Fix CR 6224 */ case MrmRtypeFontList: XmFontListFree ((XmFontList)list_id->ptr_vec[ndx]); break; default: /* BEGIN OSF Fix CR 6843 */ /* Check for duplicates on list before freeing. */ if (list_id->ptr_vec[ndx] != NULL) { for (i = ndx + 1; i < list_id->num_ptrs; ++i) if (list_id->ptr_vec[ndx] == list_id->ptr_vec[i]) list_id->ptr_vec[i] = NULL; XtFree (list_id->ptr_vec[ndx]); } /* END OSF Fix CR 6843 */ break ; } } UrmPlistFree (list_id); } /* *++ * * PROCEDURE DESCRIPTION: * * This routine reads a literal resource from either a hierarchy or * a file. It returns the resource type and either a pointer to the * value or its immediate value. * * FORMAL PARAMETERS: * * resptr resource reference to literal * hierarchy_id hierarchy from which to read public resource * file_id file from which to read private resource * ctxlist list in which to save resource contexts * type to return representation type * val to return immediate value or pointer * vec_count to return number of items if type is a vector * act_file_id to return id of file from which literal was read * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * * MrmSUCCESS operation succeeded * other some failure, usually reading the literal * *-- */ Cardinal Urm__CW_ReadLiteral (RGMResourceDescPtr resptr , MrmHierarchy hierarchy_id , IDBFile file_id , URMPointerListPtr ctxlist , MrmType *type , long *val , int *vec_count , IDBFile *act_file_id , int *vec_size ) { /* * Local variables */ Cardinal result ; /* function results */ URMResourceContextPtr context_id ; /* context for reading literal */ char err_msg[300] ; long *bufptr ; /* context buffer */ /* * Acquire a context and read the literal into it. */ UrmGetResourceContext ((char *(*)())NULL, (void(*)())NULL, 0, &context_id) ; switch ( resptr->type ) { case URMrIndex: if ( resptr->access == URMaPublic ) result = Urm__HGetIndexedLiteral (hierarchy_id, resptr->key.index, context_id, act_file_id) ; else result = UrmGetIndexedLiteral (file_id, resptr->key.index, context_id) ; if ( result != MrmSUCCESS ) { UrmFreeResourceContext (context_id) ; sprintf (err_msg, _MrmMMsg_0077, resptr->key.index) ; return Urm__UT_Error ("Urm__CW_ReadLiteral", err_msg, NULL, NULL, result) ; } break ; case URMrRID: result = UrmGetRIDLiteral (file_id, resptr->key.id, context_id) ; *act_file_id = file_id ; if ( result != MrmSUCCESS ) { UrmFreeResourceContext (context_id) ; sprintf (err_msg, _MrmMMsg_0078, resptr->key.id) ; return Urm__UT_Error ("Urm__CW_ReadLiteral", err_msg, NULL, NULL, result) ; } break ; default: result = MrmFAILURE ; UrmFreeResourceContext (context_id) ; sprintf ( err_msg, _MrmMMsg_0079, resptr->type) ; return Urm__UT_Error ("Urm__CW_ReadLiteral", err_msg, NULL, NULL, result) ; } /* * return the rep type, size, and value. Save the resource context. */ *type = UrmRCType (context_id) ; *vec_size = UrmRCSize(context_id); *vec_count = 0; bufptr = (long *) UrmRCBuffer (context_id) ; *val = Urm__CW_EvaluateValOrOffset (*type, (XtPointer)bufptr, *bufptr, 0) ; UrmPlistAppendPointer (ctxlist, (XtPointer)context_id) ; /* * Handle literals which may have further embedded literal references. Note * that the file for private references is the local file, possibly changed * by the HGetIndexedLiteral */ switch ( *type ) { case MrmRtypeIntegerVector: *vec_count = ((RGMIntegerVectorPtr)*val)->count ; break; case MrmRtypeChar8Vector: case MrmRtypeCStringVector: *vec_count = ((RGMTextVectorPtr)*val)->count ; break; case MrmRtypeIconImage: result = Urm__CW_LoadIconImage ((RGMIconImagePtr)*val, (XtPointer)*val, hierarchy_id, *act_file_id, ctxlist) ; if ( result != MrmSUCCESS ) return result ; break ; } return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine completes the loading and fixup of a URM * icon image. Iconimages may have several other literal * resource references embedded within their definition. * These are all read and turned into memory references. * * FORMAL PARAMETERS: * * iconptr The (unfixedup) icon image now in memory * bufptr buffer for offsets * hierarchy_id hierarchy from which to read public resource * file_id file from which to read private resource * ctxlist list in which to save resource contexts * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * other failures from ReadLiteral * * SIDE EFFECTS: * *-- */ Cardinal Urm__CW_LoadIconImage (RGMIconImagePtr iconptr , XtPointer bufptr , MrmHierarchy hierarchy_id , IDBFile file_id , URMPointerListPtr ctxlist ) { /* * Local variables */ Cardinal result ; /* function results */ RGMResourceDescPtr resptr ; /* to read resource literals */ RGMColorTablePtr ctable ; /* color table in icon image */ Cardinal ndx ; /* loop index */ RGMColorTableEntryPtr citem ; /* color table entry */ MrmType cttype = MrmRtypeColorTable ; /* expected type */ XtPointer ctbufptr ; /* buffer base addr for table */ MrmType ctype ; /* color entry type */ IDBFile act_file ; /* file from which literals read */ char err_msg[300] ; int vec_size ; Boolean swap_needed = FALSE ; /* * Fixup pointers as required. Read the color table if it is a resource. * Note that bufptr is reset to a color table resource read in in order * provide the correct relocation for color items. */ if (iconptr->validation != URMIconImageValid) { if ( Urm__SwapValidation(iconptr->validation) == URMIconImageValid ) { swapbytes( iconptr->validation ); swapbytes( iconptr->width ); swapbytes( iconptr->height ); swapbytes( iconptr->hot_x ); swapbytes( iconptr->hot_y ); swapbytes( iconptr->ct_type ); swapbytes( iconptr->annex1 ); swapbytes( iconptr->color_table.ctoff ); swapbytes( iconptr->pixel_data.pdoff ); swap_needed = TRUE; } else { /* CR9259 */ return Urm__UT_Error ("Urm__CW_LoadIconImage", _MrmMMsg_0028, NULL, NULL, MrmNOT_VALID) ; } } iconptr->pixel_data.pdptr = (char *) bufptr+iconptr->pixel_data.pdoff ; switch ( iconptr->ct_type ) { case MrmRtypeColorTable: iconptr->color_table.ctptr = (RGMColorTablePtr) ((char *)bufptr+iconptr->color_table.ctoff) ; ctbufptr = bufptr ; break ; case MrmRtypeResource: { int vec_count; resptr = (RGMResourceDescPtr) ((char *)bufptr+iconptr->color_table.ctoff) ; if ( swap_needed ) Urm__SwapRGMResourceDesc(resptr); result = Urm__CW_ReadLiteral (resptr, hierarchy_id, file_id, ctxlist, &cttype, (long *)(&iconptr->color_table.ctptr), &vec_count, &act_file, &vec_size) ; if ( result != MrmSUCCESS ) return result ; if ( cttype != MrmRtypeColorTable ) { sprintf (err_msg, _MrmMMsg_0080, cttype) ; return Urm__UT_Error ("Urm__CW_LoadIconImage", err_msg, NULL, NULL, MrmNOT_VALID) ; } ctbufptr = (XtPointer) iconptr->color_table.ctptr ; break ; } default: sprintf (err_msg, _MrmMMsg_0081, iconptr->ct_type) ; return Urm__UT_Error ("Urm__CW_LoadIconImage", err_msg, NULL, NULL, MrmNOT_VALID) ; } /* * Load any resource colors in the color table. */ ctable = iconptr->color_table.ctptr ; if (ctable->validation != URMColorTableValid) { if ( Urm__SwapValidation(ctable->validation) == URMColorTableValid ) { swapbytes( ctable->validation ); swapbytes( ctable->count ); swap_needed = TRUE; } else { /* CR9259 */ return Urm__UT_Error ("Urm__CW_LoadIconImage", _MrmMMsg_0028, NULL, NULL, MrmNOT_VALID) ; } } for ( ndx=URMColorTableUserMin ; ndxcount ; ndx++ ) { citem = &ctable->item[ndx] ; if ( swap_needed ) { swapbytes( citem->type ); swapbytes( citem->annex1 ); swapbytes( citem->color_item.coffs ); } switch ( citem->type ) { case MrmRtypeColor: citem->color_item.cptr = (RGMColorDescPtr) ((char *)ctbufptr+citem->color_item.coffs) ; break ; case MrmRtypeResource: { int vec_count; resptr = (RGMResourceDescPtr) ((char *)ctbufptr+citem->color_item.coffs) ; if ( swap_needed ) Urm__SwapRGMResourceDesc(resptr); ctype = MrmRtypeColor ; result = Urm__CW_ReadLiteral (resptr, hierarchy_id, file_id, ctxlist, &ctype, (long *)(&citem->color_item.cptr), &vec_count, &act_file, &vec_size) ; if ( result != MrmSUCCESS ) return result ; if ( ctype != MrmRtypeColor ) { sprintf (err_msg, _MrmMMsg_0082, ctype) ; return Urm__UT_Error ("Urm__CW_LoadIconImage", err_msg, NULL, NULL, MrmNOT_VALID) ; } break ; } default: sprintf ( err_msg, _MrmMMsg_0083, citem->type) ; return Urm__UT_Error ("Urm__CW_LoadIconImage", err_msg, NULL, NULL, MrmNOT_VALID) ; } } return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine fixes up a callback list in a record to function * as the callback list passed to create. It must turn routine * names into addresses, and evaluate tag values. * * FORMAL PARAMETERS: * * parent this widget's parent * bufptr buffer (base address) for resolving offsets * cbdesc Callback descriptor in record. Its pointers * must be fixed up and its tag values evaluated. * ctxlist A pointer list to save contexts created to * evaluate literals. * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * wref_id reference structure from which references to * previously created widgets in the tree can be * resolved. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmUNRESOLVED_REFS unresolved references to widgets remain * other conversion or resource evaluation failure * * SIDE EFFECTS: * *-- */ Cardinal Urm__CW_FixupCallback (Widget parent , XtPointer bufptr , RGMCallbackDescPtr cbdesc , URMPointerListPtr ctxlist , URMPointerListPtr cblist , MrmHierarchy hierarchy_id , IDBFile file_id , URMResourceContextPtr wref_id) { /* * Local variables */ Cardinal result ; /* function results */ int ndx ; /* loop index */ RGMCallbackItemPtr itmptr ; /* current list item */ String rtn_name ; /* routine name in item */ MrmType reptype ; /* arg value representation type */ RGMResourceDescPtr resptr ; /* resource descriptor in tag */ IDBFile act_file ; /* file from which literals read */ XtPointer rtn_addr ; /* routine address */ long tag_val ; /* to save value */ int vec_count ; /* number of items in the vector */ char err_msg[300] ; MrmCount unres_ref_count = 0; /* num unres. widgets in cblist */ String ref_name; /* referenced widget name */ Widget ref_id ; /* referenced widget id */ int vec_size ; RGMFontListPtr fontlist; /* for converting old style fontlist */ Boolean swap_needed = FALSE; /* * Loop through all the items in the callback list */ for ( ndx=0 ; ndxcount ; ndx++ ) { itmptr = &cbdesc->item[ndx] ; /* * Set the routine pointer to the actual routine address. This * routine name must be a registered URM callback. */ rtn_name = (String) bufptr + itmptr->cb_item.routine ; result = Urm__LookupNameInHierarchy (hierarchy_id, rtn_name, &rtn_addr) ; if ( result != MrmSUCCESS ) { sprintf (err_msg, _MrmMMsg_0084, rtn_name) ; return Urm__UT_Error ("Urm__CW_FixupCallback", err_msg, NULL, NULL, result) ; } /* * Evaluate the tag value, and set in the item. */ reptype = itmptr->cb_item.rep_type ; tag_val = Urm__CW_EvaluateValOrOffset (reptype, bufptr, itmptr->cb_item.datum.ival, itmptr->cb_item.datum.offset) ; switch ( reptype ) { case MrmRtypeResource: resptr = (RGMResourceDescPtr) tag_val ; switch ( resptr->res_group ) { case URMgWidget: /* Do we need to worry about subtree resources here? */ if (resptr->type != URMrIndex) { Urm__UT_Error("Urm__CW_FixupCallback", _MrmMMsg_0085, NULL, NULL, MrmNOT_VALID); continue; } ref_name = (String) resptr->key.index; /* See if reference can be resolved immediatetly. */ result = Urm__CW_FindWRef(wref_id, ref_name, &ref_id) ; if ( result == MrmSUCCESS ) tag_val = (long)ref_id; else { /* Save to resolve later */ itmptr->runtime.resolved = FALSE; itmptr->runtime.wname = Urm__UT_AllocString(ref_name); tag_val = 0L; unres_ref_count++; } break; case URMgLiteral: result = Urm__CW_ReadLiteral (resptr, hierarchy_id, file_id, ctxlist, &reptype, &tag_val, &vec_count, &act_file, &vec_size); if ( result != MrmSUCCESS ) continue ; if ((reptype == MrmRtypeFontList) && (strcmp(file_id->db_version, URM1_1version) <= 0)) { int count = ((OldRGMFontListPtr)tag_val)->count; fontlist = (RGMFontListPtr) XtMalloc(sizeof(RGMFontList) + (sizeof(RGMFontItem) * (count - 1))); result = Urm__CW_FixupValue((long)fontlist, reptype, (XtPointer)tag_val, file_id, &swap_needed); XtFree((char *)tag_val); tag_val = (long)fontlist; } else result = Urm__CW_FixupValue (tag_val, reptype, (XtPointer)tag_val, file_id, &swap_needed) ; if ( result != MrmSUCCESS ) continue ; result = Urm__CW_ConvertValue (parent, &tag_val, reptype, (MrmType)0, XtDisplay(parent), hierarchy_id, NULL) ; if ( result != MrmSUCCESS ) continue ; switch (reptype) { case MrmRtypeChar8Vector: case MrmRtypeCStringVector: vec_size -= (sizeof ( RGMTextVector ) - sizeof ( RGMTextEntry )); break; default: break; } Urm__CW_SafeCopyValue (&tag_val, reptype, cblist, vec_count, vec_size) ; itmptr->runtime.resolved = TRUE; break ; default: return Urm__UT_Error ("Urm__CW_FixupCallback", _MrmMMsg_0063, NULL, NULL, MrmFAILURE) ; } break ; default: result = Urm__CW_FixupValue (tag_val, reptype, bufptr, file_id, &swap_needed) ; if ( result != MrmSUCCESS ) continue ; result = Urm__CW_ConvertValue (parent, &tag_val, reptype, (MrmType)0, XtDisplay(parent), hierarchy_id, NULL) ; Urm__CW_SafeCopyValue (&tag_val, reptype, cblist, 0, 0) ; itmptr->runtime.resolved = TRUE; break ; } itmptr->runtime.callback.callback = (XtCallbackProc)rtn_addr; itmptr->runtime.callback.closure = (XtPointer) tag_val ; } cbdesc->unres_ref_count = unres_ref_count; if (unres_ref_count == 0) /* * callback list successfully fixed up */ return MrmSUCCESS ; else return MrmUNRESOLVED_REFS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine evaluates a resource reference to a widget by loading * the widget definition and instantiating the widget tree. It returns * the widget id. * This routine evaluates a resource reference, resulting in setting * * FORMAL PARAMETERS: * * parent parent of the widget being created * widgetrec widget record pointer * resptr the resource to be evaluated * ctxlist A pointer list to save contexts created to * evaluate literals. * hierarchy_id URM hierarchy from which to read public resources * file_id URM file from which to read private resources * wref_id widget reference structure * svlist SetValues descriptor list * val to return the value (widget id) * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * other load or instantiate failure * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal Urm__CW_LoadWidgetResource (Widget parent , RGMWidgetRecordPtr widgetrec , /* unused */ RGMResourceDescPtr resptr , URMPointerListPtr ctxlist , /* unused */ MrmHierarchy hierarchy_id , IDBFile file_id , URMPointerListPtr *svlist , URMResourceContextPtr wref_id , long *val ) { /* * Local variables */ Cardinal result ; /* function results */ URMResourceContextPtr context_id ; /* context for widget record */ IDBFile loc_fileid = file_id ; /* file id from HGet */ char err_msg[300] ; /* to format error messages */ /* * Acquire a context, then load the widget and instantiate the tree. * An HGet call may replace the file for private references. */ UrmGetResourceContext ((char *(*)())NULL, (void(*)())NULL, 0, &context_id) ; switch ( resptr->type ) { case URMrIndex: if ( resptr->access == URMaPublic ) result = UrmHGetWidget (hierarchy_id, resptr->key.index, context_id, &loc_fileid) ; else result = UrmGetIndexedWidget (file_id, resptr->key.index, context_id) ; if ( result != MrmSUCCESS ) sprintf (err_msg, _MrmMMsg_0086, resptr->key.index) ; break ; case URMrRID: result = UrmGetRIDWidget (file_id, resptr->key.id, context_id) ; if ( result != MrmSUCCESS ) sprintf (err_msg, _MrmMMsg_0087, resptr->key.id) ; break ; default: result = MrmFAILURE ; sprintf ( err_msg, _MrmMMsg_0088, resptr->type) ; } if ( result != MrmSUCCESS ) { UrmFreeResourceContext (context_id) ; return Urm__UT_Error ("Urm__CW_LoadWidgetResource", err_msg, NULL, NULL, result) ; } /* * Now create the widget subtree. The pointer result is the widget id of * the widget we now have (the root of the tree). */ result = UrmCreateWidgetTree (context_id, parent, hierarchy_id, loc_fileid, NULL, NULL, 0, resptr->type, resptr->key.index, resptr->key.id, MrmManageDefault, (URMPointerListPtr *)svlist, wref_id, (Widget *)val) ; if ( result != MrmSUCCESS ) Urm__UT_Error ("Urm__CW_LoadWidgetResource", _MrmMMsg_0089, NULL, NULL, result) ; UrmFreeResourceContext (context_id) ; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine returns parameters needed to create a pixmap from * an IconImage. It extracts the screen and display from the given * widget. It then determines the foreground and background colors * for the widget. The setting of these values is idiosyncratic, due * to the fact that all widgets have a Background attribute from core, * but are not guaranteed to have a Foreground attribute. * - if value is already set, do nothing * - else choose the value for the widget if available * - else choose white/black PixelOfScreen * - make sure we haven't ended up with identical values * for both foreground and background. If we have, accept * the background value and set the foreground to something * else (black or white). * * FORMAL PARAMETERS: * * w widget to use for default values * screen to return screen for pixmap * display to return display for pixmap * fgint to return foreground value for pixmap. A value of * -1 on input means this must be set; else ignored * bgint to return background value for pixmap. -1 is used * as above to signal value needed * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__CW_GetPixmapParms (Widget w , Screen **screen , Display **display , Pixel *fgint , Pixel *bgint ) { /* * Local variables */ Arg pixarg[2] ; /* to read FG/BG values */ Cardinal pcnt = 0 ; /* # entries in arglist */ /* * Screen and display come straight from widget */ *screen = XtScreen (w) ; *display = XtDisplay (w) ; /* * Else load the foreground and background pixel values from the * widget. Fallback to Black/WhitePixelOfScreen if the widget * doesn't have these values. */ if ( *fgint == -1 ) { XtSetArg (pixarg[pcnt], XmNforeground, fgint) ; pcnt += 1 ; } if ( *bgint == -1 ) { XtSetArg (pixarg[pcnt], XmNbackground, bgint) ; pcnt += 1 ; } if ( pcnt > 0 ) XtGetValues (w, pixarg, pcnt) ; /* * Fall back on ...PixelOfScreen */ if ( *fgint == -1 ) *fgint = BlackPixelOfScreen (*screen) ; if ( *bgint == -1 ) *bgint = WhitePixelOfScreen (*screen) ; /* * Make sure we haven't ended with identical values */ if ( *fgint == *bgint ) { if ( *bgint == BlackPixelOfScreen(*screen) ) *fgint = WhitePixelOfScreen (*screen) ; else *fgint = BlackPixelOfScreen (*screen) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine translates an RGMCallbackDescPtr stored in a 1.1 uid * file into the equivalent 1.2+ structure. This routine allocates * memory which must later be freed using XtFree. * * FORMAL PARAMETERS: * * oldptr Pointer into the buffer where the 1.1 callback * descriptor starts. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * This function returns a pointer to a new RGMCallbackDesc containing * all the information from the structure stored in the uid file. * * SIDE EFFECTS: * * Memory is allocated which must be freed using XtFree. * *-- */ RGMCallbackDescPtr Urm__CW_TranslateOldCallback (OldRGMCallbackDescPtr oldptr) { /* * Local variables */ RGMCallbackDescPtr cbptr; /* pointer to new callback descriptor */ RGMCallbackItemPtr itmptr; /* current callback item */ OldRGMCallbackItemPtr olditmptr; /* callback item being converted */ int ndx; /* loop index */ cbptr = (RGMCallbackDescPtr) XtMalloc(sizeof(RGMCallbackDesc) + oldptr->count*sizeof(RGMCallbackItem)); cbptr->validation = oldptr->validation; cbptr->count = oldptr->count; /* Loop through all items in old callback list copying to new. */ for (ndx = 0; ndx <= cbptr->count; ndx++) /* <= so that null item is copied. */ { olditmptr = &oldptr->item[ndx]; itmptr = &cbptr->item[ndx]; itmptr->cb_item.routine = olditmptr->cb_item.routine; itmptr->cb_item.rep_type = olditmptr->cb_item.rep_type; itmptr->cb_item.datum = olditmptr->cb_item.datum; } return cbptr; } motif-2.3.8/lib/Mrm/Mrmhier.c0000644000175000017500000004441613145162623012647 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmhier.c /main/17 1996/11/13 14:01:19 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * *-- */ /* * This file contains routines which assist in managing URM hierarchies */ /* * * INCLUDE FILES * */ #include #include #include #include /* for _XmOSInitPath() */ #include /* for _XmGetDefaultDisplay() */ #include "MrmMsgI.h" #ifndef NO_MESSAGE_CATALOG #if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 #endif #endif /* * * TABLE OF CONTENTS * * Urm__OpenHierarchy Open hierarchy (internal version) * * Urm__CloseHierarchy Close hierarchy (internal version) * * UrmHGetIndexedResource Get resource from hierarchy * */ /* * * DEFINE and MACRO DEFINITIONS * */ static Cardinal I18NOpenFile (Display *display, String name , MrmOsOpenParamPtr os_ext , IDBFile *file_id_return ); /* * * OWN VARIABLE DECLARATIONS * */ static char *uidPath; static SubstitutionRec uidSubs[1]; /* *++ * * PROCEDURE DESCRIPTION: * * This routine allocates a hierarchy descriptor, and opens * all the IDB files in the hierarchy. It initializes the * optimized search lists in the hierarchy from the open files. * All files are closed if there are any errors. * * FORMAL PARAMETERS: * * num_files The number of files in the name list * name_list A list of the file names * os_ext_list A list of system-dependent ancillary * structures corresponding to the files. * This parameter may be NULL. * hierarchy_id_return To return the hierarchy id * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE allocation or other failure * MrmDISPLAY_NOT_OPENED Display hasn't been opened yet * Others see UrmIdbOpenFileRead * * SIDE EFFECTS: * *-- */ Cardinal Urm__OpenHierarchy (MrmCount num_files, String *name_list, MrmOsOpenParamPtr *os_ext_list, MrmHierarchy *hierarchy_id_return, MrmFlag in_memory, unsigned char *uid_buffer) { /* * Local variables */ Cardinal result ; /* function result */ MrmHierarchy hiptr ; /* hierarchy descriptor */ MrmCount list_size ; /* # bytes for file lists */ int ndx ; /* loop index */ IDBFile *idvec ; /* current file id vector */ int file_ndx ; /* file loop index */ IDBFile cur_file ; /* current IDB file */ URMResourceContextPtr class_ctx; /* for class compression table */ URMResourceContextPtr resource_ctx; /* for resource compression table */ Display *display; /* display for XtResolvePathNames */ char err_stg[300]; #ifndef NO_MESSAGE_CATALOG static Boolean first = True; /* * We open the message catalog from MrmOpenHierarchy... routines. * We cannot open it from MrmInitialize, since this call can be done * before Xt has been initialized, so at that time the locale could * be wrong. */ /* We only want to open the message catalog once. */ if (first) { Mrm_catd = catopen("Mrm", NL_CAT_LOCALE); first = False; } #endif if ( os_ext_list == NULL ) { display = NULL; } else { MrmOsOpenParamPtr os_data; os_data = *os_ext_list; if (os_data->display == NULL) { display = NULL; } else { display = os_data->display; } } if (display == NULL) { display = _XmGetDefaultDisplay(); } if (display == NULL) { return Urm__UT_Error ("Urm__OpenHierarchy", _MrmMMsg_0030, NULL, NULL, MrmDISPLAY_NOT_OPENED); }; /* * If the uidPath was previously set, XtFree it so we can try any * new paths that may have been setup. */ if (uidPath != 0) { XtFree (uidPath); uidPath = 0; } /* * Allocate a hierarchy, and allocate all file lists. */ hiptr = (MrmHierarchy) XtMalloc (sizeof(MrmHierarchyDesc)) ; if ( hiptr == NULL ) return MrmFAILURE ; hiptr->validation = MrmHIERARCHY_VALID; hiptr->num_file = 0 ; list_size = num_files * sizeof(IDBFile) ; hiptr->file_list = (IDBFile *) XtMalloc (list_size) ; if ( hiptr->file_list == NULL ) return MrmFAILURE ; for ( ndx=URMgMin ; ndx<=URMgMax ; ndx++ ) { hiptr->grp_num[ndx] = 0 ; idvec = (IDBFile *) XtMalloc (list_size) ; if ( idvec == NULL ) return MrmFAILURE ; hiptr->grp_ids[ndx] = idvec ; } hiptr->name_registry = NULL; /* * Now open each file. Any failure causes an error return, with any * open files closed and the descriptor and lists freed. */ for ( file_ndx=0 ; file_ndxfile_list[hiptr->num_file] = cur_file ; hiptr->num_file++ ; for ( ndx=URMgMin ; ndx<=URMgMax ; ndx++ ) if ( cur_file->group_counts[ndx] > 0 ) { idvec = hiptr->grp_ids[ndx] ; idvec[hiptr->grp_num[ndx]] = cur_file ; hiptr->grp_num[ndx]++ ; } /* * Attempt to read in compression tables for this UID file. * Retain and fixup the tables if they are found. */ cur_file->class_ctable = NULL; cur_file->resource_ctable = NULL; result = UrmGetResourceContext ((char *(*)())NULL, (void(*)())NULL, 0, &class_ctx); if ( result != MrmSUCCESS ) return result; result = UrmGetResourceContext ((char *(*)())NULL, (void(*)())NULL, 0, &resource_ctx); if ( result != MrmSUCCESS ) return result; result = UrmGetIndexedLiteral (cur_file, UilMrmClassTableIndex, class_ctx); if ( result != MrmSUCCESS ) continue; result = UrmGetIndexedLiteral (cur_file, UilMrmResourceTableIndex, resource_ctx); if ( result != MrmSUCCESS ) continue; /* * Retain the buffers from the contexts, but free the contexts * themselves. Fixup the tables. */ cur_file->class_ctable = (UidCompressionTablePtr) UrmRCBuffer (class_ctx); UrmRCSetBuffer (class_ctx, NULL); UrmFreeResourceContext (class_ctx); Urm__FixupCompressionTable (cur_file->class_ctable, TRUE, cur_file->byte_swapped); cur_file->resource_ctable = (UidCompressionTablePtr) UrmRCBuffer (resource_ctx); UrmRCSetBuffer (resource_ctx, NULL); UrmFreeResourceContext (resource_ctx); Urm__FixupCompressionTable (cur_file->resource_ctable, FALSE, cur_file->byte_swapped); } /* * successfully opened. Free the uidPath at this point */ XtFree (uidPath); uidPath = 0; *hierarchy_id_return = hiptr ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This is the internal routine which closes a URM search hierarchy * * FORMAL PARAMETERS: * * hierarchy_id ID of an open URM database hierarchy * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_HIERARCHY invalid URM hierarchy * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal Urm__CloseHierarchy (MrmHierarchy hierarchy_id) { /* * Local variables */ int ndx ; /* loop index */ URMHashTableEntryPtr cp, np; /* for fixing 7303 */ /* * validity check the hierarchy, then close all files, deallocate all * lists, and deallocate the descriptor */ if ( hierarchy_id == NULL ) return Urm__UT_Error ("Urm__CloseHierarchy", _MrmMMsg_0023, NULL, NULL, MrmBAD_HIERARCHY) ; if ( ! MrmHierarchyValid(hierarchy_id) ) return Urm__UT_Error ("Urm__CloseHierarchy", _MrmMMsg_0024, NULL, NULL, MrmBAD_HIERARCHY) ; for ( ndx=0 ; ndxnum_file ; ndx++ ) if (hierarchy_id->file_list[ndx]->in_memory == FALSE ) UrmIdbCloseFile (hierarchy_id->file_list[ndx], FALSE) ; /* Begin fixing DTS 7303 */ if(hierarchy_id->name_registry){ for ( ndx=0 ; ndxname_registry[ndx]) != NULL) while(cp){ np = cp->az_next_entry; XtFree((char*)cp); cp = np; }; XtFree ((char*)hierarchy_id->name_registry); } /* End fixing DTS 7303 */ XtFree ((char*)hierarchy_id->file_list); for ( ndx=URMgMin ; ndx<=URMgMax ; ndx++ ) XtFree ((char*)hierarchy_id->grp_ids[ndx]) ; hierarchy_id->validation = 0; XtFree ((char*)hierarchy_id) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmHGetIndexedResource attempts to retrieve a resource * from an open URM hierarchy. It functions exactly like * UrmIdbGetIndexedResource except that it queries each file * in the hierarchy in turn. It uses the optimized search lists * where possible. * * FORMAL PARAMETERS: * * hierarchy_id open URM hierarchy to search * index case-sensitive index for the entry to match * group_filter if not null, entry found must match this group * type_filter if not null, entry found must match this type * context_id URM resource context to receieve data block * file_id_return to return file in which resource was found * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_HIERARCHY invalid URM hierarchy * MrmNOT_FOUND entry not found * MrmWRONG_GROUP entry didn't match group filter * MrmWRONG_TYPE entry didn't match type filter * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal UrmHGetIndexedResource (MrmHierarchy hierarchy_id, String index , MrmGroup group_filter, MrmType type_filter, URMResourceContextPtr context_id, IDBFile *file_id_return) { /* * Local variables */ Cardinal result ; /* function results */ IDBFile *file_ids ; /* list of files to search */ int num_ids ; /* number of entries in file_ids */ int ndx ; /* loop index */ /* * Validate hierarchy. Then loop through the files which define the resource, * searching for the desired resource. */ if ( hierarchy_id == NULL ) return Urm__UT_Error ("UrmHGetIndexedResource", _MrmMMsg_0023, NULL, NULL, MrmBAD_HIERARCHY) ; if ( ! MrmHierarchyValid(hierarchy_id) ) return Urm__UT_Error ("UrmHGetIndexedResource", _MrmMMsg_0024, NULL, context_id, MrmBAD_HIERARCHY) ; if ( group_filter>=URMgMin && group_filter<=URMgMax) { file_ids = hierarchy_id->grp_ids[group_filter] ; num_ids = hierarchy_id->grp_num[group_filter] ; } else { file_ids = hierarchy_id->file_list ; num_ids = hierarchy_id->num_file ; } for ( ndx=0 ; ndxname_registry; if ( name_table == NULL ) { name_table = (URMHashTableEntryPtr *) XtMalloc(sizeof(URMHashTableEntryPtr)*k_hash_table_size); /* Begin fixing DTS 7303 */ for ( ndx=0 ; ndxname_registry = name_table; hash_initialize (name_table, &inited); } /* * Store each name-value pair in the hash table. */ for (ndx = 0 ; ndx < num_cb ; ndx++) { current_name = names [ndx]; current_value = values [ndx]; hash_entry = (URMHashTableEntryPtr) hash_insert_name (name_table, current_name); hash_entry->az_value = current_value; } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine returns the value registered for a name. It first * attempts to look up the name in the hierarchy's name registry. * If that fails, or their is no registry, then a global lookup is * attempted. * * FORMAL PARAMETERS: * * hierarchy_id open URM hierarchy to search. * name case-sensitive name to be matched * value_return to return value. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND no match found * * SIDE EFFECTS: * *-- */ Cardinal Urm__LookupNameInHierarchy (MrmHierarchy hierarchy_id, String name, XtPointer *value_return) { URMHashTableEntryPtr *name_table; URMHashTableEntryPtr hash_entry; /* * Look up in hierarchy first (if there is a registry) */ name_table = hierarchy_id->name_registry; if ( name_table != NULL ) { hash_entry = (URMHashTableEntryPtr) hash_find_name (name_table, name); if (hash_entry != NULL) { *value_return = hash_entry->az_value; return MrmSUCCESS; } } /* * Fall back on global table */ return Urm__WCI_LookupRegisteredName (name, value_return); } /* *++ * * PROCEDURE DESCRIPTION: * * This routine opens a single UID file in a platform-dependent way, * performing i18n language switching in order to do so. * * Per the latest agreement on semantics, this routine does: * - first, try to open in the local directory (that is, with * no switching). * - second, try language switching and open * * FORMAL PARAMETERS: * * name A system-dependent string specifying the IDB file * to be opened. * os_ext An operating-system specific structure which * supports using specific file system features * file_id_return returns the IDB file id used in all other IDB routines * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ static Cardinal I18NOpenFile (Display *display, String name, MrmOsOpenParamPtr os_ext, IDBFile *file_id_return) { /* * Local variables */ Cardinal result; /* function results */ char dummy[300]; /* file name (unused) */ char err_stg[300]; /* * Use XtResolvePathName. If the last 4 characters of the file name * are not .uid then pass in the suffix of .uid. If a file is not * found with the suffix passed in then try without the suffix. */ char *resolvedname; /* current resolved name */ Boolean user_path ; uidSubs[0].substitution = name; if (uidPath == 0) { uidPath = _XmOSInitPath(name, "UIDPATH", &user_path); if (user_path) uidSubs[0].match = 'U'; else uidSubs[0].match = MATCH_CHAR ; } resolvedname = 0; /* * Check and see if the .uid suffix is already on the file. If not then try to * resolve the pathname with .uid suffix first. If that fails or the suffix is * already on the file then just try to resolve the pathname. */ if ( strcmp (&name[strlen(name)-4],".uid") != 0 ) resolvedname = XtResolvePathname (display, "uid", NULL, ".uid", uidPath, uidSubs, XtNumber(uidSubs), (XtFilePredicate)NULL); /* * No .uid suffix or a failure to resolve the pathname with the .uid suffix */ if (resolvedname == 0) resolvedname = XtResolvePathname (display, "uid", NULL, NULL, uidPath, uidSubs, XtNumber(uidSubs), (XtFilePredicate)NULL); if (resolvedname == 0) { sprintf (err_stg, _MrmMMsg_0031, name) ; return Urm__UT_Error ("I18NOpenFile", err_stg, NULL, NULL, MrmNOT_FOUND); } result = UrmIdbOpenFileRead (resolvedname, os_ext, file_id_return, dummy) ; switch ( result ) { case MrmSUCCESS: break; case MrmNOT_VALID: sprintf (err_stg, _MrmMMsg_0032, resolvedname) ; break; case MrmNOT_FOUND: default: sprintf (err_stg, _MrmMMsg_0031, resolvedname) ; break; } XtFree(resolvedname); /* allocated in XtResolvePathName() */ if (result == MrmSUCCESS) return result; else return Urm__UT_Error ("I18NOpenFile", err_stg, NULL, NULL, result); } motif-2.3.8/lib/Mrm/Mrmicon.c0000644000175000017500000011217313145162623012644 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmicon.c /main/14 1996/11/13 14:01:43 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM) * * ABSTRACT: * * This module contains routines which operate on URM icon images - * RGMIconImage structs. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* *++ * * PROCEDURE DESCRIPTION: * * This routine creates and returns an X pixmap from a URM icon * for some widget. It uses the foreground and background obtainable * from the widget as required. * * FORMAL PARAMETERS: * * icon URM icon image to be converted to X pixmap * screen screen to use for pixmap * display display to use for pixmap * fgpix foreground color for pixmap * bgpix background color for pixmap * pixmap to return resulting X pixmap * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * URM status * * SIDE EFFECTS: * *-- */ Cardinal UrmCreatePixmap (RGMIconImagePtr icon, Screen *screen, Display *display, Pixel fgpix, Pixel bgpix, Pixel *pixmap, Widget parent) { /* * Local variables */ Cardinal result; /* function results */ RGMColorTablePtr ctable; /* color table in icon */ unsigned maxbits; /* # bits required for X image */ int srcpix; /* # bits per pixel in icon (actual) */ int dds ; /* * Convert the color table colors to pixels. */ ctable = icon->color_table.ctptr; result = Urm__RealizeColorTable (screen, display, fgpix, bgpix, ctable, parent); if ( result != MrmSUCCESS ) return result; /* * Use the depth of screen to infer the number of bits required to * hold the pixels in X format. The ZPixmap format only supports 1, 8, 16, * and 32 bit pixels, so we always map to one of these sizes. */ if (parent) dds = parent->core.depth; else dds = DefaultDepthOfScreen(screen) ; if (dds == 1) maxbits = 1; else if (dds <= 8) maxbits = 8; else if (dds <= 16) maxbits = 16; else maxbits = 32; /* * See if the icon can be mapped as a bitmap. This will be true if the * color table has only FG/BG entries, or uses only those entries. */ if ( ctable->count <= 2 ) maxbits = 1; /* * Compute the number of bits available in the icon pixmap */ switch ( icon->pixel_size ) { case URMPixelSize1Bit: srcpix = 1; break; case URMPixelSize2Bit: srcpix = 2; break; case URMPixelSize4Bit: srcpix = 4; break; case URMPixelSize8Bit: srcpix = 8; break; default: return MrmNOT_VALID; } /* * Map the icon image pixmap from color table indices to Pixel values. * There are three cases: * maxbits == 1; a bitmap is possible, so map to a bitmap. * maxbits <= # bits/pixel in pixmap. Map in place. In fact, * only works if maxbits == srcpix == 8. * maxbits > # bits/pixel. Map to allocated pixmap. * * Each of the three routines which performs these mappings completes * the entire process of doing the mapping and creating the X pixmap. */ if ( maxbits == 1 ) return Urm__MapIconBitmap (icon, srcpix, ctable, screen, display, pixmap); if ((maxbits == 8) && (srcpix == 8)) return Urm__MapIconReplace (icon, srcpix, ctable, screen, display, pixmap, parent); if ( maxbits > srcpix ) return Urm__MapIconAllocate (icon, srcpix, maxbits, ctable, screen, display, pixmap, parent); return MrmNOT_VALID; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine creates and returns an X pixmap of depth 1 from a URM icon * for some widget. * * FORMAL PARAMETERS: * * icon URM icon image to be converted to X pixmap * screen screen to use for pixmap * display display to use for pixmap * pixmap to return resulting X pixmap * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * URM status * * SIDE EFFECTS: * *-- */ Cardinal UrmCreateBitmap (RGMIconImagePtr icon, Screen *screen, Display *display, Pixel *pixmap) { /* * Local variables */ int srcpix; /* # bits per pixel in icon (actual) */ /* * Compute the number of bits available in the icon pixmap */ switch ( icon->pixel_size ) { case URMPixelSize1Bit: srcpix = URMPixelSize1Bit; break; default: return MrmNOT_VALID; } return Urm__MapIconBitmapDepth1 (icon, srcpix, screen, display, pixmap); } /* *++ * * PROCEDURE DESCRIPTION: * * This routine creates and returns an X pixmap from the X bitmap file * name specified. It uses the foreground and background as needed. * * * FORMAL PARAMETERS: * * filename file containing the bitmap to be converted to X pixmap * screen screen to use for pixmap * display display to use for pixmap - not used * fgint foreground color for pixmap * bgint background color for pixmap * pixmap to return resulting X pixmap * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * URM status * * SIDE EFFECTS: * *-- */ Cardinal Urm__CW_ReadBitmapFile (String filename, Screen *screen, Pixel fgint, Pixel bgint, Pixmap *pixmap, Widget parent) { int depth; char err_msg[300]; /* ** Create a pixmap from a X bitmap file specification */ depth = parent ? parent->core.depth : DefaultDepthOfScreen(screen); *pixmap = XmGetPixmapByDepth(screen, filename, fgint, bgint, depth); if (*pixmap == XmUNSPECIFIED_PIXMAP) { pixmap = 0; sprintf (err_msg, _MrmMMsg_0033, filename); return Urm__UT_Error ("UrmReadBitmapFile", err_msg, NULL, NULL, MrmFAILURE); } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine maps the pixmap in the icon into a bitmap. The * bitmap is written over pixmap data. The X pixmap is then * constructed as an XYBitmap. * * FORMAL PARAMETERS: * * icon the IconImage being converted * srcpix number of bits/pixel in icon * ctable the color table for (in) icon * screen screen for the X pixmap * display display for the X pixmap * pixmap to return the result * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal Urm__MapIconBitmap(RGMIconImagePtr icon, int srcpix, RGMColorTablePtr ctable, Screen *screen, Display *display, Pixmap *pixmap) { /* * Local variables */ Pixel fgpix; /* foreground pixel value */ int iconwid; /* icon width */ int srclinebyt; /* # bytes per icon line */ int dstlinebyt; /* # bytes per bitmap line */ char *srcbytptr; /* image byte pointer */ char *dstbytptr; /* bitmap pointer */ int lin; /* icon line number */ int byt; /* line byte number */ int pix; /* line pixel number */ unsigned char srcbyt; /* icon image byte */ unsigned char dstbyt; /* mapped image byte */ int tndx; /* color table index */ XImage *imagep; /* X image */ GC gc; XGCValues gcValues; int endian; /* to determine which endian. */ /* * Overwrite the icon data with a bitmap. Use 0 for background, 1 for * foreground. */ fgpix = ctable->item[URMColorTableFG].color_pixel; iconwid = icon->width; srclinebyt = (iconwid*srcpix+7) / 8; dstlinebyt = (iconwid+7) / 8; srcbytptr = icon->pixel_data.pdptr; for ( lin=0 ; linheight ; lin++ ) { pix = 0; dstbytptr = icon->pixel_data.pdptr + lin*dstlinebyt; dstbyt = 0; for ( byt=0 ; bytpixel_size ) { case URMPixelSize1Bit: *dstbytptr = srcbyt; srcbytptr += 1; dstbytptr += 1; pix += 8; /* * NOTE: The original algorithm used here cleared any * unused bits of the last byte. I don't think * the protocol requires that... if ( pix > iconwid ) */ continue; case URMPixelSize2Bit: tndx = srcbyt & 0x3; if ( pix < iconwid ) if ( ctable->item[tndx].color_pixel == fgpix) dstbyt |= 1<<(pix%8); pix += 1; srcbyt >>= 2; tndx = srcbyt & 0x3; if ( pix < iconwid ) if ( ctable->item[tndx].color_pixel == fgpix) dstbyt |= 1<<(pix%8); pix += 1; srcbyt >>= 2; tndx = srcbyt & 0x3; if ( pix < iconwid ) if ( ctable->item[tndx].color_pixel == fgpix) dstbyt |= 1<<(pix%8); pix += 1; srcbyt >>= 2; tndx = srcbyt & 0x3; if ( pix < iconwid ) if ( ctable->item[tndx].color_pixel == fgpix) dstbyt |= 1<<(pix%8); pix += 1; break; case URMPixelSize4Bit: tndx = srcbyt & 0xF; if ( pix < iconwid ) if ( ctable->item[tndx].color_pixel == fgpix) dstbyt |= 1<<(pix%8); pix += 1; srcbyt >>= 4; tndx = srcbyt & 0xF; if ( pix < iconwid ) if ( ctable->item[tndx].color_pixel == fgpix) dstbyt |= 1<<(pix%8); pix += 1; break; case URMPixelSize8Bit: if ( pix < iconwid ) if ( ctable->item[srcbyt].color_pixel == fgpix) dstbyt |= 1<<(pix%8); pix += 1; break; } /* * NOTE: The "1Bit" case CONTINUEs directly and will never * reach this point in the loop... */ srcbytptr += 1; if ( pix%8 == 0 ) { *dstbytptr = dstbyt; dstbytptr += 1; dstbyt = 0; } } if ( pix%8 != 0 ) *dstbytptr = dstbyt; } imagep = XCreateImage(display, DefaultVisualOfScreen(screen), 1, XYBitmap, 0, icon->pixel_data.pdptr, (unsigned int)icon->width, (unsigned int)icon->height, 8, dstlinebyt); if ( imagep == NULL ) return Urm__UT_Error ("Urm__MapIconBitmap", _MrmMMsg_0034, NULL, NULL, MrmFAILURE); /* * Well, Uil creates a uid icon in its byteorder, on his side * XCreateImage creates an image in the byte_order of the server, so * its not correct, we have to adjust the byte_order fields of this * image to match those of the icon. */ endian = 1; imagep->bitmap_unit = 8 ; if (*(char *) &endian) { imagep->byte_order = LSBFirst ; imagep->bitmap_bit_order = LSBFirst ; } else { imagep->byte_order = MSBFirst; imagep->bitmap_bit_order = LSBFirst ; } *pixmap = XCreatePixmap (display, RootWindowOfScreen(screen), icon->width, icon->height, (unsigned)DefaultDepthOfScreen(screen)); if ( *pixmap == (Pixmap)0) { XFree((char*)imagep); return Urm__UT_Error ("Urm__MapIconBitmap", _MrmMMsg_0035, NULL, NULL, MrmFAILURE); } /* * Build a gc to use when drawing into the pixmap */ gcValues.foreground = ctable->item[URMColorTableFG].color_pixel; gcValues.background = ctable->item[URMColorTableBG].color_pixel; gcValues.fill_style = FillTiled; gcValues.tile = *pixmap; gc = XCreateGC (display, RootWindowOfScreen (screen), GCForeground | GCBackground | GCFillStyle | GCTile, &gcValues); if ( gc == NULL ) return Urm__UT_Error ("Urm__MapIconBitmap", _MrmMMsg_0036, NULL, NULL, MrmFAILURE); /* * Put bits into the pixmap */ XPutImage (display, *pixmap, gc, imagep, 0, 0, /* source x, y */ 0, 0, icon->width, icon->height); /* dest, loc & size */ XFreeGC (display, gc); XFree ((char*)imagep); /* * Successfully created */ return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine maps the pixmap in the icon into a bitmap. The * bitmap is written over pixmap data. The X pixmap is then * constructed as an XYBitmap. * * FORMAL PARAMETERS: * * icon the IconImage being converted * srcpix number of bits/pixel in icon * screen screen for the X pixmap * display display for the X pixmap * pixmap to return the result * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal Urm__MapIconBitmapDepth1 (RGMIconImagePtr icon, int srcpix, Screen *screen, Display *display, Pixmap *pixmap) { /* * Local variables */ int iconwid; /* icon width */ int srclinebyt; /* # bytes per icon line */ int dstlinebyt; /* # bytes per bitmap line */ char *srcbytptr; /* image byte pointer */ char *dstbytptr; /* bitmap pointer */ int lin; /* icon line number */ int byt; /* line byte number */ int pix; /* line pixel number */ unsigned char srcbyt; /* icon image byte */ unsigned char dstbyt; /* mapped image byte */ XImage *imagep; /* X image */ GC gc; XGCValues gcValues; int endian; /* to determine which endian. */ /* * Overwrite the icon data with a bitmap. Use 0 for background, 1 for * foreground. */ iconwid = icon->width; srclinebyt = (iconwid*srcpix+7) / 8; dstlinebyt = (iconwid+7) / 8; srcbytptr = icon->pixel_data.pdptr; for ( lin=0 ; linheight ; lin++ ) { pix = 0; dstbytptr = icon->pixel_data.pdptr + lin*dstlinebyt; dstbyt = 0; for ( byt=0 ; bytpixel_size ) { case URMPixelSize1Bit: *dstbytptr = srcbyt; srcbytptr += 1; dstbytptr += 1; pix += 8; /* * NOTE: The original algorithm used here cleared any * unused bits of the last byte. I don't think * the protocol requires that... if ( pix > iconwid ) */ continue; default: return MrmNOT_VALID; } } if ( pix%8 != 0 ) *dstbytptr = dstbyt; } imagep = XCreateImage(display, DefaultVisualOfScreen(screen), 1, XYBitmap, 0, icon->pixel_data.pdptr, (unsigned int)icon->width, (unsigned int)icon->height, 8, dstlinebyt); if ( imagep == NULL ) return Urm__UT_Error ("Urm__MapIconBitmapDepth1", _MrmMMsg_0034, NULL, NULL, MrmFAILURE); /* Well, Uil creates a uid icon in its byteorder, on his side XCreateImage creates an image in the byte_order of the server, so its not correct, we have to adjust the byte_order fields of this image to match those of the icon. */ endian = 1; imagep->bitmap_unit = 8 ; if (*(char *) &endian) { imagep->byte_order = LSBFirst ; imagep->bitmap_bit_order = LSBFirst ; } else { imagep->byte_order = MSBFirst; imagep->bitmap_bit_order = LSBFirst ; } *pixmap = XCreatePixmap (display, RootWindowOfScreen(screen), icon->width, icon->height, 1); if ( *pixmap == (Pixmap)0) { XFree((char*)imagep); return Urm__UT_Error ("Urm__MapIconBitmapDepth1", _MrmMMsg_0035, NULL, NULL, MrmFAILURE); } /* * Build a gc to use when drawing into the pixmap */ gcValues.foreground = 1; gcValues.background = 0; gcValues.fill_style = FillTiled; gcValues.tile = *pixmap; gc = XCreateGC (display, *pixmap, GCForeground | GCBackground | GCFillStyle | GCTile, &gcValues); if ( gc == NULL ) return Urm__UT_Error ("Urm__MapIconBitmapDepth1", _MrmMMsg_0036, NULL, NULL, MrmFAILURE); /* * Put bits into the pixmap */ XPutImage (display, *pixmap, gc, imagep, 0, 0, /* source x, y */ 0, 0, icon->width, icon->height); /* dest, loc & size */ XFreeGC (display, gc); XFree ((char *)imagep); /* * Successfully created */ return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine maps the pixmap in the icon into a ZPixmap. The * ZPixmap is written over the icon image pixmap data. The X pixmap * is then constructed as a ZPixmap from the overwritten data. * * This routine is called only when srcpix == 8. * * FORMAL PARAMETERS: * * icon the IconImage being converted * srcpix number of bits/pixel in icon * ctable the color table for (in) icon * screen screen for the X pixmap * display display for the X pixmap * pixmap to return the result * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal Urm__MapIconReplace (RGMIconImagePtr icon, int srcpix, RGMColorTablePtr ctable, Screen *screen, Display *display, Pixmap *pixmap, Widget parent) { /* * Local variables */ int iconwid; /* icon width */ int linebyt; /* # bytes per icon line */ char *bytptr; /* image byte pointer */ int lin; /* icon line number */ int byt; /* line byte number */ int pix; /* line pixel number */ unsigned char srcbyt; /* icon image byte */ XImage *imagep; /* X image */ GC gc; XGCValues gcValues; int depth; /* depth of screen */ /* * Overwrite the pixmap with actual Pixel values. The source and destination * bit widths are the same (==8), and the same pointer can be used for * both source and destination. */ iconwid = icon->width; linebyt = (iconwid*srcpix+7) / 8; bytptr = icon->pixel_data.pdptr; for ( lin=0 ; linheight ; lin++ ) { pix = 0; for ( byt=0 ; bytitem[srcbyt].color_pixel; pix += 1; bytptr += 1; } } depth = parent ? parent->core.depth : DefaultDepthOfScreen(screen); imagep = XCreateImage(display, DefaultVisualOfScreen(screen), depth, ZPixmap, 0, icon->pixel_data.pdptr, (unsigned int)icon->width, (unsigned int)icon->height, srcpix, linebyt); if ( imagep == NULL ) return Urm__UT_Error ("Urm__MapIconReplace", _MrmMMsg_0034, NULL, NULL, MrmFAILURE); *pixmap = XCreatePixmap (display, RootWindowOfScreen(screen), icon->width, icon->height, (unsigned)depth); if ( *pixmap == (Pixmap)0) { XFree((char*)imagep); return Urm__UT_Error ("Urm__MapIconReplace", _MrmMMsg_0035, NULL, NULL, MrmFAILURE); } /* * Build a gc to use when drawing into the pixmap */ gcValues.foreground = ctable->item[URMColorTableFG].color_pixel; gcValues.background = ctable->item[URMColorTableBG].color_pixel; gcValues.fill_style = FillTiled; gcValues.tile = *pixmap; gc = XCreateGC (display, RootWindowOfScreen (screen), GCForeground | GCBackground | GCFillStyle | GCTile, &gcValues); if ( gc == NULL ) return Urm__UT_Error ("Urm__MapIconReplace", _MrmMMsg_0036, NULL, NULL, MrmFAILURE); /* * Put bits into the pixmap */ XPutImage (display, *pixmap, gc, imagep, 0, 0, /* source x, y */ 0, 0, icon->width, icon->height); /* dest, loc & size */ XFreeGC (display, gc); XFree((char*)imagep); /* * Successfully created */ return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine maps the pixmap in the icon into a ZPixmap. The * ZPixmap is allocated 1 byte per pixel, as the icon image pixmap * has too few bits per pixel to be replace in situ. The X pixmap * is created from the allocated ZPixmap. * * FORMAL PARAMETERS: * * icon the IconImage being converted * srcpix number of bits/pixel in icon * dstpix number of bits/pixel in resulting image * ctable the color table for (in) icon * screen screen for the X pixmap * display display for the X pixmap * pixmap to return the result * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal Urm__MapIconAllocate (RGMIconImagePtr icon, int srcpix, int dstpix, RGMColorTablePtr ctable, Screen *screen, Display *display, Pixmap *pixmap, Widget parent) { /* * Local variables */ int iconwid; /* icon width */ int iconhgt; /* icon height */ char *alloc_pixmap; /* allocated pixmap */ int dstbytsize; /* # 8-bit bytes per bitmap byte */ int srclinebyt; /* # bytes per icon line */ char *srcbytptr; /* image byte pointer */ int lin; /* icon line number */ int byt; /* line byte number */ int bit; /* bit loop index */ int pix; /* line pixel number */ unsigned char srcbyt; /* icon image byte */ int bitmask = 0; /* mask all but significant bits */ int num_bits = 0; /* real (not coded) pixel size */ int tndx; /* color table index */ XImage *imagep; /* X image */ GC gc; XGCValues gcValues; int depth; /* depth of screen */ /* * Allocate a new pixmap image. */ iconwid = icon->width; iconhgt = icon->height; if (dstpix <= 8) dstpix = 8; else if (dstpix <= 16) dstpix = 16; else dstpix = 32; dstbytsize = dstpix / 8; alloc_pixmap = (char *) XtMalloc (iconwid * iconhgt * dstbytsize); if (alloc_pixmap == NULL) return Urm__UT_Error ("Urm__MapIconAllocate", _MrmMMsg_0037, NULL, NULL, MrmFAILURE); srclinebyt = (iconwid * srcpix + 7) / 8; srcbytptr = icon->pixel_data.pdptr; depth = parent ? parent->core.depth : DefaultDepthOfScreen(screen); imagep = XCreateImage(display, DefaultVisualOfScreen(screen), depth, ZPixmap, 0, alloc_pixmap, iconwid, iconhgt, dstpix, 0); /* Let Xlib calculate it. */ if ( imagep == NULL ) { XtFree (alloc_pixmap); return Urm__UT_Error ("Urm__MapIconAllocate", _MrmMMsg_0034, NULL, NULL, MrmFAILURE); } if(icon->pixel_size == URMPixelSize1Bit) { num_bits = 1; bitmask=0x1; } else if(icon->pixel_size == URMPixelSize2Bit) { num_bits = 2; bitmask=0x3; } else if(icon->pixel_size == URMPixelSize4Bit) { num_bits = 4; bitmask=0xF; } else if(icon->pixel_size == URMPixelSize8Bit) { num_bits = 8; bitmask=0xFF; } for ( pix=0,lin=0 ; linheight ; pix=0,lin++ ) { for ( byt=0 ; bytitem[tndx].color_pixel); pix++; srcbyt >>= num_bits; } } } *pixmap = XCreatePixmap (display, RootWindowOfScreen(screen), iconwid, iconhgt, (unsigned)depth); if ( *pixmap == (Pixmap)0) { XtFree (alloc_pixmap); XFree((char*)imagep); return Urm__UT_Error ("Urm__MapIconAllocate", _MrmMMsg_0035, NULL, NULL, MrmFAILURE); } /* * Build a gc to use when drawing into the pixmap */ gcValues.foreground = ctable->item[URMColorTableFG].color_pixel; gcValues.background = ctable->item[URMColorTableBG].color_pixel; gcValues.fill_style = FillTiled; gcValues.tile = *pixmap; gc = XCreateGC (display, RootWindowOfScreen (screen), GCForeground | GCBackground | GCFillStyle | GCTile, &gcValues); if ( gc == NULL ) { XtFree (alloc_pixmap); return Urm__UT_Error ("Urm__MapIconAllocate", _MrmMMsg_0036, NULL, NULL, MrmFAILURE); } /* * Put bits into the pixmap */ XPutImage (display, *pixmap, gc, imagep, 0, 0, /* source x, y */ 0, 0, iconwid, iconhgt); /* dest, loc & size */ /* * don't deallocate with XDestroyImage, which would destroy alloc_pixmap */ XFree((char*)imagep); XFreeGC (display, gc); XtFree (alloc_pixmap); /* * Successfully created */ return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine sets the Pixel values corresponding to each of the * entries in the color table. Foreground and background are set by * querying the widget for those values, or falling back on * Black/WhitePixelOfScreen. All other colors are set by honoring * FG/BG setting for monochrome devices, or by getting the xolor * Pixel values from X. * * FORMAL PARAMETERS: * * screen screen to use for color table * display display to use for color table * fgpix foreground color for color table * bgpix background color for color table * ctable the color table * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal Urm__RealizeColorTable (Screen *screen, Display *display, Pixel fgpix, Pixel bgpix, RGMColorTablePtr ctable, Widget parent) { /* * Local variables */ Cardinal result = 0; /* function results */ Cardinal ndx; /* loop index */ RGMColorTableEntryPtr citem; /* color table entry */ Colormap cmap; /* default color map */ int depth; /* # planes in screen */ char err_msg[300]; /* * Load the foreground and background pixel values. */ ctable->item[URMColorTableFG].color_pixel = fgpix; ctable->item[URMColorTableBG].color_pixel = bgpix; /* * Get the Pixel for each defined color. Honor the FG/BG specification * if present on monochrome displays. Otherwise, get the Pixel value for * the color. Use the FG/BG specification as a fallback for unfound * colors in non-monochrome. If no reasonable color Pixel can be found, * return an error. */ cmap = parent ? parent->core.colormap : DefaultColormapOfScreen(screen); depth = parent ? parent->core.depth : DefaultDepthOfScreen(screen); for ( ndx=URMColorTableUserMin ; ndxcount ; ndx++ ) { citem = &ctable->item[ndx]; if ( depth == 1 ) switch ( citem->color_item.cptr->mono_state ) { case URMColorMonochromeUnspecified: switch (citem->color_item.cptr->desc_type) { case URMColorDescTypeName: result = Urm__UT_GetNamedColorPixel (display, cmap, citem->color_item.cptr, &citem->color_pixel, ctable->item[URMColorTableBG].color_pixel); if ( result != MrmSUCCESS) { /* we use PARTIAL_SUCCESS only to indicate the color allocation failed and we've substituted the fallback color. We still want a warning, though */ if (result == MrmPARTIAL_SUCCESS) { result = MrmSUCCESS; sprintf (err_msg, _MrmMMsg_0038, citem->color_item.cptr->desc.name); return Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } else { sprintf (err_msg, _MrmMMsg_0038, citem->color_item.cptr->desc.name); return Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } } break; case URMColorDescTypeRGB: result = Urm__UT_GetColorPixel (display, cmap, citem->color_item.cptr, &citem->color_pixel, ctable->item[URMColorTableBG].color_pixel); if ( result != MrmSUCCESS ) { /* we use PARTIAL_SUCCESS only to indicate the color allocation failed and we've substituted the fallback color. We still want a warning, though */ if (result == MrmPARTIAL_SUCCESS) { result = MrmSUCCESS; sprintf (err_msg, _MrmMMsg_0038, citem->color_item.cptr->desc.name); return Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } else { sprintf (err_msg, _MrmMMsg_0039, citem->color_item.cptr->desc.rgb.red, citem->color_item.cptr->desc.rgb.green, citem->color_item.cptr->desc.rgb.blue) ; return Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } } break; default: sprintf(err_msg, _MrmMMsg_0040); return Urm__UT_Error ("Urm__RelizeColorTable", err_msg, NULL, NULL, MrmFAILURE) ; } break; case URMColorMonochromeForeground: citem->color_pixel = ctable->item[URMColorTableFG].color_pixel; break; case URMColorMonochromeBackground: citem->color_pixel = ctable->item[URMColorTableBG].color_pixel; break; default: sprintf (err_msg, _MrmMMsg_0041, citem->color_item.cptr->mono_state); return Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } else { switch (citem->color_item.cptr->desc_type) { case URMColorDescTypeName: result = Urm__UT_GetNamedColorPixel (display, cmap, citem->color_item.cptr, &citem->color_pixel, ((citem->color_item.cptr->mono_state == URMColorMonochromeForeground) ? ctable->item[URMColorTableFG].color_pixel : ctable->item[URMColorTableBG].color_pixel)); if (result != MrmSUCCESS) { /* we use PARTIAL_SUCCESS only to indicate the color allocation failed and we've substituted the fallback color. We still want a warning, though */ if (result == MrmPARTIAL_SUCCESS) { result = MrmSUCCESS; sprintf (err_msg, _MrmMMsg_0038, citem->color_item.cptr->desc.name); return Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } else { sprintf (err_msg, _MrmMMsg_0038, citem->color_item.cptr->desc.name); Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } } break; case URMColorDescTypeRGB: result = Urm__UT_GetColorPixel (display, cmap, citem->color_item.cptr, &citem->color_pixel, ctable->item[URMColorTableBG].color_pixel); if (result != MrmSUCCESS) { /* we use PARTIAL_SUCCESS only to indicate the color allocation failed and we've substituted the fallback color. We still want a warning, though */ if (result == MrmPARTIAL_SUCCESS) { result = MrmSUCCESS; sprintf (err_msg, _MrmMMsg_0038, citem->color_item.cptr->desc.name); return Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } else { sprintf (err_msg, _MrmMMsg_0039, citem->color_item.cptr->desc.rgb.red, citem->color_item.cptr->desc.rgb.green, citem->color_item.cptr->desc.rgb.blue) ; Urm__UT_Error ("Urm__RealizeColorTable", err_msg, NULL, NULL, result); } } break; default: result = MrmFAILURE; sprintf (err_msg, _MrmMMsg_0040); Urm__UT_Error ("Urm__RelizeColorTable", err_msg, NULL, NULL, MrmFAILURE) ; } if ( result != MrmSUCCESS ) { switch ( citem->color_item.cptr->mono_state ) { case URMColorMonochromeForeground: citem->color_pixel = ctable->item[URMColorTableFG].color_pixel; break; case URMColorMonochromeBackground: citem->color_pixel = ctable->item[URMColorTableBG].color_pixel; break; default: return result; } } } } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine makes a copy of a URM icon into a memory block * which has been pre-allocated. The block must be big enough * to hold both the header and the bit vector. * * FORMAL PARAMETERS: * * dst_icon the memory block to receive the copy * src_icon the URM icon descriptor to be copied. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ RGMIconImagePtr UrmCopyAllocatedIconImage (RGMIconImagePtr dst_icon, RGMIconImagePtr src_icon) { /* * Copy the header and bit vector into the new memory block. */ dst_icon->validation = URMIconImageValid; dst_icon->pixel_size = src_icon->pixel_size; dst_icon->width = src_icon->width; dst_icon->height = src_icon->height; dst_icon->hot_x = src_icon->hot_x; dst_icon->hot_y = src_icon->hot_y; /* * Copy the color table as an immediate. It is allocated immediately * after the image header. */ /* * Copy the pixel data */ return dst_icon; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine attempts to look up the name of a color, and return * the pixel value required as a widget arglist value. It will use * the default color map if necessary, and returns the closest color * supported by the hardware (as defined by X), not the exact database * definition. If the screen is depth 1 (monochrome), the routine will * honor the monochrome rendition specified in the color descriptor. * * FORMAL PARAMETERS: * * display specifies the X server connection * cmap color map ID. If NULL, the default color map is used * colorptr color descriptor * pixel_return to return the pixel value for the color * fallback fallback color to use in case of alloc failure * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS color found and translated * MrmNOT_FOUND conversion failure * MrmPARTIAL_SUCCESS internal only, for allocation failure * * SIDE EFFECTS: * *-- */ Cardinal Urm__UT_GetNamedColorPixel (Display *display, Colormap cmap, RGMColorDescPtr colorptr, Pixel *pixel_return, Pixel fallback) { /* * Local variables */ XColor screen_def; /* realizable values */ XColor exact_def; /* exact values */ int status; /* function return */ if ( cmap == (Colormap)0) cmap = DefaultColormap (display, DefaultScreen(display)); /* CR 9891: Support new pixel constants. */ if (XmeNamesAreEqual(colorptr->desc.name, "default_select_color")) { *pixel_return = XmDEFAULT_SELECT_COLOR; return MrmSUCCESS; } else if (XmeNamesAreEqual(colorptr->desc.name, "reversed_ground_colors")) { *pixel_return = XmREVERSED_GROUND_COLORS; return MrmSUCCESS; } else if (XmeNamesAreEqual(colorptr->desc.name, "highlight_color")) { *pixel_return = XmHIGHLIGHT_COLOR; return MrmSUCCESS; } status = XAllocNamedColor (display, cmap, colorptr->desc.name, &screen_def, &exact_def); if ( status == 0) { if (fallback) { *pixel_return = fallback; return MrmPARTIAL_SUCCESS; } else return MrmFAILURE; } *pixel_return = screen_def.pixel; return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine attempts to look up the RGB values of a color, and return * the pixel value required as a widget arglist value. It will use * the default color map if necessary, and returns the closest color * supported by the hardware (as defined by X), not the exact database * definition. If the screen is depth 1 (monochrome), the routine will * honor the monochrome rendition specified in the color descriptor. * * FORMAL PARAMETERS: * * display specifies the X server connection * cmap color map ID. If NULL, the default color map is used * colorptr color descriptor * pixel_return to return the pixel value for the color * fallback fallback color to use in case of alloc failure * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS color found and translated * MrmNOT_FOUND conversion failure * MrmPARTIAL_SUCCESS internal only, for allocation failure * * SIDE EFFECTS: * *-- */ Cardinal Urm__UT_GetColorPixel (Display *display, Colormap cmap, RGMColorDescPtr colorptr, Pixel *pixel_return, Pixel fallback) { /* * Local variables */ XColor screen_in_out; /* realizable values */ int status; /* function return */ if ( cmap == (Colormap)0) cmap = DefaultColormap (display, DefaultScreen(display)); screen_in_out.red = colorptr->desc.rgb.red; screen_in_out.green = colorptr->desc.rgb.green; screen_in_out.blue = colorptr->desc.rgb.blue; status = XAllocColor (display, cmap, &screen_in_out); if ( status == 0) { if (fallback) { *pixel_return = fallback; return MrmPARTIAL_SUCCESS; } else return MrmFAILURE; } *pixel_return = screen_in_out.pixel; return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine computes the number of bytes used by a URM icon * * FORMAL PARAMETERS: * * icon URM icon image * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * # bytes in the image * * SIDE EFFECTS: * *-- */ Cardinal UrmIconImageSize (RGMIconImagePtr icon) { /* * Local variables */ int bytes_per_line; /* # bytes for padded width */ int raster_len; /* bytes in image */ Cardinal size; /* # bytes in descriptor */ bytes_per_line = (icon->width+7) / 8; raster_len = bytes_per_line * icon->height; size = sizeof(RGMIconImage) + (raster_len-1)*sizeof(char); return size; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine computes the number of bytes necessary to store * the given color table in a single memory block. * * FORMAL PARAMETERS: * * ctable An allocated color table * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * table size in bytes * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal UrmColorTableSize (RGMColorTablePtr ctable) /* unused */ { return sizeof(RGMColorTable); } motif-2.3.8/lib/Mrm/Mrm.msg0000644000175000017500000001467213145162623012344 00000000000000$ $XConsortium: Mrm.msg /main/2 1996/08/19 12:09:05 pascale $ $ $ Motif $ $ Copyright (c) 1987-2012, The Open Group. All rights reserved. $ $ These libraries and programs are free software; you can $ redistribute them and/or modify them under the terms of the GNU $ Lesser General Public License as published by the Free Software $ Foundation; either version 2 of the License, or (at your option) $ any later version. $ $ These libraries and programs are distributed in the hope that $ they will be useful, but WITHOUT ANY WARRANTY; without even the $ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR $ PURPOSE. See the GNU Lesser General Public License for more $ details. $ $ You should have received a copy of the GNU Lesser General Public $ License along with these librararies and programs; if not, write $ to the Free Software Foundation, Inc., 51 Franklin Street, Fifth $ Floor, Boston, MA 02110-1301 USA $ $ This file is automatically generated. $ Do not edit. $ This message catalog contains messages issued by Motif Mrm library. $ Consult X-Window systems, OSF/MOTIF Programmer's Guide and OSF/MOTIF $ Programmer's Reference Manual for technical terms if you have any $ doubts about their meanings. $ Do not translate variables such as %s, %d %s ... etc. $ Do not translate Motif resource name, such as XmNlabelType. $ Special terms with capital letter(s) should not be translated. $ "False" and "True" are keywords. Do not translate. $set MS_Mrm MSG__0000 Vector allocation failed MSG__0001 Buffer allocation failed MSG__0002 Invalid buffer MSG__0003 Get block failed MSG__0004 Put block failed MSG__0005 Invalid record header MSG__0006 Invalid context MSG__0007 Invalid data entry MSG__0008 Invalid segment entry MSG__0009 Unknown data entry type MSG__0010 Unexpected record type MSG__0011 File version %s is greater than Mrm version %s. MSG__0012 This is not the header record. MSG__0013 Resource index out of range MSG__0014 NULL data pointer MSG__0015 Illegal overflow record MSG__0016 GT record mismatch MSG__0017 LT record mismatch MSG__0018 Unexpected parent record type MSG__0019 Record beyond EOF MSG__0020 Cannot swap record #%d type %d MSG__0021 Encountered unimplemented type %d, in Callback item %d MSG__0022 Encountered unimplemented argument type %d MSG__0023 NULL hierarchy id MSG__0024 Invalid hierarchy MSG__0025 Invalid interface module MSG__0026 Invalid widget record MSG__0027 Context allocation failed MSG__0028 Validation failed MSG__0029 Resource size too large MSG__0030 Display not yet opened MSG__0031 Could not open file %s MSG__0032 Could not open file %s - UID file version mismatch MSG__0033 XmGetPixmap failed with XmUNSPECIFIED_PIXMAP for %s MSG__0034 XCreateImage failed during IconImage conversion MSG__0035 XCreatePixmap failed during IconImage conversion MSG__0036 XCreateGC failed during IconImage conversion MSG__0037 XtMalloc failed during IconImage conversion MSG__0038 Could not load color '%s' MSG__0039 Could not convert RGB color/pixel '%d,%d,%d' MSG__0040 Invalid color descriptor type MSG__0041 Illegal Color item monochrome state %d MSG__0042 Cannot find literal '%s' $ literal in this context means a named value. MSG__0043 Invalid resource context MSG__0044 Too many widgets MSG__0045 Topmost index out of bounds MSG__0046 List allocation failed MSG__0047 List vector allocation failed MSG__0048 Vector re-allocation failed MSG__0049 String allocation failed MSG__0050 UID file is obsolete - has no compression table MSG__0051 Could not find class descriptor for class %s MSG__0052 Cannot find indexed widget '%s' MSG__0053 Cannot find RID widget '%x' MSG__0054 ?? UNKNOWN key type %d MSG__0055 Unknown widget variety MSG__0056 Unresolved Widget reference in creation callback MSG__0057 Could not Fixup creation callbacks MSG__0058 Unknown child type MSG__0059 Child of parent not found MSG__0060 Widget reference not Indexed MSG__0061 Could not convert color/pixel '%s' MSG__0062 Could not uncompress string code %d MSG__0063 Unhandled resource group MSG__0064 Could not convert ASCIZ '%s' to compound string MSG__0065 Could not parse translation table '%s' MSG__0066 Could not convert identifier '%s' MSG__0067 Internal error: case MrmRtypeIconImage found MSG__0068 Internal error: case MrmRtypeXBitmapFile found MSG__0069 Internal error: Could not convert Display to String MSG__0070 Could not convert font '%s' MSG__0071 Could not convert fontset '%s' $ please do not translate fontset. MSG__0072 Could not open one or more fonts for fontset '%s' MSG__0073 Could not add fontlist font '%s' to list MSG__0074 Could not add fontlist fontset '%s' to list MSG__0075 Could not convert class record name '%s' MSG__0076 Could not convert keysym string '%s' to KeySym MSG__0077 Cannot find indexed literal '%s' MSG__0078 Cannot find RID literal '%x' MSG__0079 Unknown literal key type %d MSG__0080 Invalid ColorTable literal type %d MSG__0081 Invalid ColorTable type code %d MSG__0082 Invalid Color literal type %d MSG__0083 Invalid ColorItem type code %d MSG__0084 Callback routine '%s' not registered MSG__0085 Widget reference not Indexed MSG__0086 Cannot find indexed widget resource '%s' MSG__0087 Cannot find RID widget resource '%x' MSG__0088 Unknown resource key type %d MSG__0089 Could not instantitate widget tree MSG__0090 Null user-defined class name MSG__0091 Invalid class code MSG__0092 Too many arguments MSG__0093 Invalid compression code MSG__0094 Invalid or unhandled type MSG__0095 Vector too big MSG__0096 Empty routine name MSG__0097 Char8Vector not yet implemented MSG__0098 CStringVector not yet implemented MSG__0099 Too many children MSG__0100 Null children list descriptor MSG__0101 Child index out of bounds MSG__0102 Null index MSG__0103 Invalid key type MSG__0104 Arg index out of bounds MSG__0105 Invalid widget/gadget record MSG__0106 Invalid callback descriptor MSG__0107 Callback item index out of bounds MSG__0108 Could not uncompress string code %d MSG__0109 Too many items MSG__0110 Could not convert multibyte string to widecharacter string MSG__0111 Could not convert integer '%d' to icon image MSG__0112 Could not convert to icon image MSG__0113 Could not open buffer - UID version mismatch MSG__0114 Could not open buffer MSG__0115 Unable to convert units to XmPIXELS: bad units format or type MSG__0116 Unable to convert units to XmPIXELS: floating point overflow MSG__0117 Invalid version string %s in UID file. Unable to read file. MSG__0118 Mrm version %s is greater than file version %s;\nplease recompile UIL file. MSG__0119 Object '%s' declared PRIVATE. motif-2.3.8/lib/Mrm/MrmItopw.c0000644000175000017500000002314213145162623013013 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmItopw.c /main/13 1996/11/13 13:59:22 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB facility * * ABSTRACT: * * This module contains the publicly accessible top-level * IDB write routines. * *-- */ /* * * INCLUDE FILES * */ #include #include #include /* * * TABLE OF CONTENTS * * UrmIdbOpenFileWrite Open a file for write access * * UrmIdbPutIndexedResource Put indexed resource to file * * UrmIdbPutRIDResource Put resource id'ed resource in file * */ /* *++ * * PROCEDURE DESCRIPTION: * * IdbOpenFileWrite creates a new IDB database file, with null index * structures. This call creates the file and initializes the file * header. * * FORMAL PARAMETERS: * * name A system-dependent string specifying the IDB * file to be opened. * os_ext An operating-system specific structure which * supports using specific file system features * creator Identifies the database creator (application) * creator_version Creator version * module Identifies the UIL module * module_version Module version * file_id_return returns the IDB file id * fname_return returns the name of the file actually opened * (via strcpy). Should be at least 256 chars. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * * 1. Acquires memory for the file descriptor * *-- */ Cardinal UrmIdbOpenFileWrite (String name , MrmOsOpenParamPtr os_ext , String creator , String creator_version , String module , String module_version , IDBFile *file_id_return , char *fname_return ) { /* * Local variables */ Cardinal result ; /* function results */ IDBLowLevelFilePtr fileid ; /* low-level id for file */ IDBFile filedesc ; /* new file descriptor */ int ndx ; /* loop index */ /* * An OS extension block must be present for Unix, and by default * specifies that existing files are over-written. */ MrmOsOpenParam osext ; /* to delete file on open */ osext.version = MrmOsOpenParamVersion ; osext.nam_flg.clobber_flg = TRUE ; if ( os_ext == NULL ) os_ext = &osext ; /* * Attempt to open the file. For now, pay no attention to temporary naming * issues. */ result = Idb__FU_OpenFile(name, URMWriteAccess, os_ext, &fileid, fname_return); if ( result != MrmCREATE_NEW ) return result ; /* * File successfully opened. Acquire a file descriptor and initialize it. */ filedesc = (IDBFile) XtMalloc (sizeof(IDBOpenFile)) ; filedesc->validation = IDBOpenFileValid ; filedesc->access = URMWriteAccess ; filedesc->lowlevel_id = fileid ; filedesc->last_record = 0 ; filedesc->last_data_record = 0 ; filedesc->get_count = 0 ; filedesc->put_count = 0 ; filedesc->byte_swapped = FALSE ; filedesc->in_memory = FALSE ; filedesc->uid_buffer = NULL ; for ( ndx=IDBrtMin ; ndx<=IDBrtMax ; ndx++ ) filedesc->rt_counts[ndx] = 0 ; /* * Make sure all variables are initialized that aren't initialized elsewhere */ filedesc->index_root = 0; filedesc->timer = 0; filedesc->class_ctable = (UidCompressionTablePtr)NULL; filedesc->resource_ctable = (UidCompressionTablePtr)NULL; filedesc->user1 = 0; filedesc->user2 = 0; for ( ndx=0 ; ndx<=IDBhsVersion ; ndx++ ) { filedesc->db_version[ndx] = 0 ; filedesc->creator_version[ndx] = 0 ; filedesc->module_version[ndx] = 0 ; }; for ( ndx=0 ; ndx<=IDBhsCreator ; ndx++ ) filedesc->creator[ndx] = 0 ; for ( ndx=0 ; ndx<=IDBhsDate ; ndx++ ) filedesc->creation_date[ndx] = 0 ; for ( ndx=0 ; ndx<=IDBhsModule ; ndx++ ) filedesc->module[ndx] = 0 ; /* * Write a new file header for this file */ result = Idb__HDR_InitHeader (filedesc, creator, creator_version, module, module_version) ; if ( result != MrmSUCCESS ) { UrmIdbCloseFile (filedesc, TRUE) ; return result ; } /* * File successfully opened */ *file_id_return = filedesc ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * IdbPutIndexedResource creates a resource record holding the * group, type, and resource data in the resource context, and saves it * under the given index. The group and type must not be null, and the * index must not be currently entered in the database index. The * resource record is marked public or private depending on the value * of the access parameter. * * FORMAL PARAMETERS: * * file_id The IDB file id returned by IdbOpenFile * index case-sensitive index for the new entry, must * not match any existing entry * context_id URM resource context containing data block * for entry * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmEXISTS operation failed, index already exists * MrmNUL_GROUP operation failed, null group parameter * MrmNUL_TYPE operation failed, null type parameter * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal UrmIdbPutIndexedResource (IDBFile file_id, String index, URMResourceContextPtr context_id) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr bufptr ; /* not used */ MrmCount recno ; /* not used */ IDBDataHandle data_entry ; /* return new data entry */ MrmCode group ; /* the entry's group code */ if ( (result=Idb__FIL_Valid(file_id)) != MrmSUCCESS ) return result ; /* * Validity check on group and type, and make sure entry doesn't * currently exist. */ if ( UrmRCGroup(context_id) == URMgNul ) return MrmNUL_GROUP ; if ( UrmRCType(context_id) == URMtNul) return MrmNUL_TYPE ; result = Idb__INX_FindIndex (file_id, index, &bufptr, &recno) ; if ( result == MrmSUCCESS) return MrmEXISTS ; /* * Create the data entry for this item */ result = Idb__DB_PutDataEntry (file_id, context_id, &data_entry) ; if ( result != MrmSUCCESS ) return result ; /* * Enter the data entry under the index */ result = Idb__INX_EnterItem (file_id, index, data_entry) ; if ( result != MrmSUCCESS ) return result ; file_id->num_indexed++ ; group = UrmRCGroup (context_id) ; if ( group>=URMgMin && group<=URMgMax ) file_id->group_counts[group]++ ; /* * item successfully entered */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * IdbPutRIDResource creates a resource record holding the group, type, * and resource data, and saves under the given resource id. The group * and type must not be null, and the resource must currently have no * resource record associated with it. Access is always URMaPrivate * regardless of the data context access field. * * FORMAL PARAMETERS: * * file_id The IDB file id returned by IdbOpenFile * resource_id resource id for the new entry, should * currently have no existing resource record * context_id URM resource context holding data block. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmEXISTS operation failed, index already exists * MrmNUL_GROUP operation failed, null group parameter * MrmNUL_TYPE operation failed, null type parameter * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal UrmIdbPutRIDResource (IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id ) { /* * Local variables */ Cardinal result ; /* function results */ IDBDataHandle data_entry ; /* new data entry */ MrmCode group ; /* the entry's group code */ if ( (result=Idb__FIL_Valid(file_id)) != MrmSUCCESS ) return result ; /* * Validity check on group and type, and make sure entry doesn't * currently exist. */ if ( UrmRCGroup(context_id) == URMgNul ) return MrmNUL_GROUP ; if ( UrmRCType(context_id) == URMtNul) return MrmNUL_TYPE ; result = Idb__RID_ReturnItem (file_id, resource_id, FALSE, &data_entry) ; if ( result == MrmSUCCESS) return MrmEXISTS ; /* * Create the data entry for this item */ result = Idb__DB_PutDataEntry (file_id, context_id, &data_entry) ; if ( result != MrmSUCCESS ) return result ; /* * Enter the data entry under the resource id */ result = Idb__RID_EnterItem (file_id, resource_id, data_entry) ; if ( result != MrmSUCCESS ) return result ; file_id->num_RID++ ; group = UrmRCGroup (context_id) ; if ( group>=URMgMin && group<=URMgMax ) file_id->group_counts[group]++ ; /* * item successfully entered */ return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/Mrmwci.c0000644000175000017500000004622513145162623012502 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Mrmwci.c /main/16 1999/05/19 15:25:58 mgreess $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module holds all routines, structures, and structure definitions * required for the FT1 widget class information package (WCI). This * package provides routines which register information about widget * classes, and which retrieve information about widget classes * as required by URM. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * */ static int hash_function ( int l_length , char *c_value ); /* * * GLOBAL VARIABLE DECLARATIONS * */ /* * The list of registered classes, so they can be searched. */ externaldef(urm__wci) WCIClassDescPtr wci_cldesc_list = NULL; /* * * OWN VARIABLE DECLARATIONS * */ /* ** Hash tables */ /* The hash tables are initialized to NULL by default. */ static Boolean hash_hash_inited = FALSE; static URMHashTableEntryPtr hash_az_hash_table [k_hash_table_size]; static Boolean cldesc_hash_inited = FALSE; static URMHashTableEntryPtr cldesc_hash_table [k_hash_table_size]; /* *++ * * * PROCEDURE DESCRIPTION: * * MrmRegisterClass saves the information needed to access the widget * creation routine using the information in URM databases. * type conversion of arglists. * * FORMAL PARAMETERS: * * class_code NOW UNUSED * class_name NOW UNUSED * create_name The case-sensitive name of the low-level * create routine for the class; an example * from the Motif toolkit is XmLabelCreate. * Arguments are (parent, name, arglist, argcount) * The string which names the class in UIL. * creator The low-level routine named create_name * class_record The toolkit class record for the class * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE failure allocating class descriptor * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal MrmRegisterClass ( #if NeedWidePrototypes int class_code, /* unused */ #else MrmType class_code, /* unused */ #endif String class_name, /* unused */ String create_name, Widget (* creator) (), WidgetClass class_record) { Cardinal status = MrmRegisterClassWithCleanup( class_code, class_name, create_name, creator, class_record, NULL); return status; } /*ARGSUSED*/ Cardinal MrmRegisterClassWithCleanup ( #if NeedWidePrototypes int class_code, /* unused */ #else MrmType class_code, /* unused */ #endif String class_name, /* unused */ String create_name, Widget (* creator) (), WidgetClass class_record, void (* cleanup) ()) { /* * Local variables */ WCIClassDescPtr cldesc; /* creator descriptor being written */ URMHashTableEntryPtr hash_entry; /* new hash entry */ _MrmProcessLock(); /* * Allocate and fill in a new descriptor */ if (create_name == NULL) { _MrmProcessUnlock(); return MrmFAILURE; } cldesc = (WCIClassDescPtr) XtMalloc (sizeof(WCIClassDesc) + strlen(create_name) + 1); if ( cldesc == NULL ) { _MrmProcessUnlock(); return MrmFAILURE; } cldesc->creator_name = (String) cldesc + sizeof(WCIClassDesc); strcpy (cldesc->creator_name, create_name); cldesc->validation = URMWCIClassDescValid; cldesc->next_desc = wci_cldesc_list; wci_cldesc_list = cldesc; cldesc->creator = creator; cldesc->class_record = class_record; cldesc->cleanup = cleanup; /* * Enter the descriptor in the descriptor hash table */ hash_initialize (cldesc_hash_table, &cldesc_hash_inited); hash_entry = (URMHashTableEntryPtr) hash_insert_name (cldesc_hash_table, cldesc->creator_name); /* Begin fixing CR 5573 */ if (hash_entry->az_value != NULL) XtFree ((char *) hash_entry->az_value); /* End fixing CR 5573 */ hash_entry->az_value = (char *) cldesc; _MrmProcessUnlock(); return MrmSUCCESS; } Cardinal Urm__WCI_UnregisterName (String name) { /* * Make sure the hash table is initialized */ hash_initialize (hash_az_hash_table, &hash_hash_inited); hash_delete_name (hash_az_hash_table, name); return MrmSUCCESS; /* in any case */ } /* *++ * * PROCEDURE DESCRIPTION: * * This routine inserts the names and their associated values into * the hash table. No check for duplicate names is made - new * values for duplicate names will override the previous value. * * FORMAL PARAMETERS: * * names A vector of case-sensitive callback routine names. * values A vector of the corresponding routine addresses * num_cb The number of entries in names and values. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * * SIDE EFFECTS: * *-- */ Cardinal Urm__WCI_RegisterNames (String *names, XtPointer *values, MrmCount num_cb) { int ndx; URMHashTableEntryPtr hash_entry; char *current_name; char *current_value; /* * Make sure the hash table is initialized */ hash_initialize (hash_az_hash_table, &hash_hash_inited); /* * Store each name-value pair in the hash table. */ for (ndx = 0 ; ndx < num_cb ; ndx++) { current_name = names [ndx]; current_value = values [ndx]; hash_entry = (URMHashTableEntryPtr) hash_insert_name (hash_az_hash_table, current_name); hash_entry -> az_value = current_value; } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routin returns a pointer to the class descriptor for a class. * The descriptor hash table is used to look up descriptors. * * FORMAL PARAMETERS: * * class_name Class name if class_code is URMwcUnknown * class_return To return pointer to class descriptor * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND descriptor not found * * SIDE EFFECTS: * *-- */ Cardinal Urm__WCI_LookupClassDescriptor (String class_name, WCIClassDescPtr *class_return) { /* * Local variables */ URMHashTableEntryPtr hash_entry; /* hash entry found */ char err_msg[300]; /* * Find a hash entry, and return the value. */ hash_entry = (URMHashTableEntryPtr) hash_find_name (cldesc_hash_table, class_name); if ( hash_entry == NULL ) { *class_return = NULL; sprintf (err_msg, _MrmMMsg_0051, class_name); return Urm__UT_Error ("Urm__WCI_LookupClassDescriptor", err_msg, NULL, NULL, MrmNOT_FOUND); } *class_return = (WCIClassDescPtr) hash_entry->az_value; return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine locates a class record for a given class name, * and returns the widget class record associated with it. * It searches for a match on either the name in the class record * or the creation routine name. * * FORMAL PARAMETERS: * * clname the display name of the class * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * Class record pointer, or NULL if not found * * SIDE EFFECTS: * *-- */ WidgetClass Urm__WCI_GetClRecOfName (String clname) { /* * Local variables */ WCIClassDescPtr cldesc; /* current class */ /* * Search the class list */ for ( cldesc=wci_cldesc_list ; cldesc!=NULL ; cldesc=cldesc->next_desc) { if ( strcmp(clname,cldesc->creator_name) == 0 ) return cldesc->class_record; if ( cldesc->class_record == NULL ) continue; if ( strcmp(clname,cldesc->class_record->core_class.class_name) == 0 ) return cldesc->class_record; } return NULL; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine gets, from the hash table, the value that corresponds * to the given name. If no match is found, NULL is returned. * * FORMAL PARAMETERS: * * name case-sensitive name to be matched * value_return to return value. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND no match found * * SIDE EFFECTS: * *-- */ Cardinal Urm__WCI_LookupRegisteredName (String name, XtPointer *value_return) { URMHashTableEntryPtr hash_entry; hash_entry = (URMHashTableEntryPtr) hash_find_name (hash_az_hash_table, name); if (hash_entry == NULL) { *value_return = NULL; return MrmNOT_FOUND; } else { *value_return = hash_entry->az_value; return MrmSUCCESS; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine initializes a hash table. ** ** FORMAL PARAMETERS: ** ** htable the hash table to initialize ** initflag if TRUE, the table is already initialized ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** SIDE EFFECTS: ** ** none ** **-- **/ void hash_initialize (URMHashTableEntryPtr *htable, Boolean *initflag) { int ndx; /* loop index */ /* * Initialize only once */ if ( *initflag ) return; for ( ndx=0 ; ndx symbol: name not found */ for (az_current_name = htable[ l_hash_code ]; az_current_name != NULL; az_current_name = az_current_name->az_next_entry) { l_compare_result = strcmp (c_text, az_current_name->c_text); if (l_compare_result == 0) /* c_text = current name */ { /* found the entry we are looking for */ return az_current_name; } if (l_compare_result > 0) /* c_text > current name */ { /* return NULL - name should be before this spot in list */ return (URMHashTableEntryPtr) NULL; } } /* came to end of the list without finding the name */ return (URMHashTableEntryPtr) NULL; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine searches for a name entry of the same name as its parameters. ** If the entry is found, a pointer to that entry node is ** returned as the value of the function. If no entry is found, one is ** allocated and inserted. In this case the value of the function is ** a pointer to the name entry created. ** ** Name entries are linked off of a hash table. Those ** entries that have the same hash code, are sorted according to the ** collating sequence. Thus the algorithm involves hashing the symbol and ** then following the chain for that hash code until one of the following ** conditions is met. 1) the identifier is found, then return a pointer ** to that entry. 2) come to the end of the chain or a hash table ** entry that comes later in the collating sequence than the symbol being ** searched for. In this case the name is inserted just prior to this ** point in the chain. ** ** FORMAL PARAMETERS: ** ** htable the hash table to update ** c_text pointer to a null terminated string for name ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** htable may be updated with an additional name ** ** FUNCTION VALUE: ** ** a pointer to a hash table entry ** ** SIDE EFFECTS: ** ** may create a new entry and update the hash table ** **-- **/ URMHashTableEntryPtr hash_insert_name (URMHashTableEntryPtr *htable, char *c_text) { int l_length; URMHashTableEntryPtr az_previous_name; URMHashTableEntryPtr az_current_name; URMHashTableEntryPtr az_new_name; int l_hash_code; int l_compare_result; /* ** algorithm keeps 2 pointers, one for the previous name and one ** for the current name. This permits easy insertion of a new name */ /* obtain the hash code of for the name */ l_length = strlen (c_text); l_hash_code = hash_function( l_length, c_text ); /* ** chain along hash chain looking for symbol - exit loop under 3 condition ** 1) come to the end of the chain: insert new node on end ** 2) find symbol: return this symbol ** 3) find node > symbol: insert new node prior to current node */ for (az_current_name = htable[ l_hash_code ], az_previous_name = (URMHashTableEntryPtr) NULL; az_current_name != (URMHashTableEntryPtr) NULL; az_previous_name = az_current_name, az_current_name = az_current_name->az_next_entry) { l_compare_result = strcmp (c_text, az_current_name->c_text); if (l_compare_result == 0) /* c_text = current name */ { /* found the name we are looking for */ return az_current_name; } if (l_compare_result > 0) /* c_text > current name */ { /* exit the loop to insert just prior to current name */ goto insert_name; } } insert_name: /* ** name is not in the table so it must be inserted between the ** az_previous_name and az_current_name entries. */ /* allocate and initialize the name entry, including the null */ az_new_name = (URMHashTableEntryPtr) XtMalloc (sizeof(URMHashTableEntry)+l_length+1); az_new_name -> az_value = (char *) NULL; UrmBCopy (c_text, az_new_name -> c_text, l_length + 1); /* ** link the name entry into the hash table */ az_new_name->az_next_entry = az_current_name; if (az_previous_name == (URMHashTableEntryPtr) NULL) htable[ l_hash_code ] = az_new_name; else az_previous_name->az_next_entry = az_new_name; return az_new_name; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** just like hash_insert_name but removes the item instead **-- */ URMHashTableEntryPtr hash_delete_name (URMHashTableEntryPtr *htable, char *c_text) { int l_length; URMHashTableEntryPtr az_previous_name; URMHashTableEntryPtr az_current_name; int l_hash_code; int l_compare_result; /* ** algorithm keeps 2 pointers, one for the previous name and one ** for the current name. This permits easy deletion of a name */ /* obtain the hash code of for the name */ l_length = strlen (c_text); l_hash_code = hash_function( l_length, c_text ); /* ** chain along hash chain looking for symbol - exit loop under 3 condition ** 1) come to the end of the chain: too far; return ** 2) find symbol: delete ** 3) find node > symbol: too far; return */ for (az_current_name = htable[ l_hash_code ], az_previous_name = (URMHashTableEntryPtr) NULL; az_current_name != (URMHashTableEntryPtr) NULL; az_previous_name = az_current_name, az_current_name = az_current_name->az_next_entry) { l_compare_result = strcmp (c_text, az_current_name->c_text); if (l_compare_result == 0) /* c_text = current name */ { /* found the name we are looking for */ goto delete_name; } if (l_compare_result > 0) /* c_text > current name */ { /* return NULL - name should be before this spot in list */ return (URMHashTableEntryPtr) NULL; } } /* came to end of the list without finding the name */ return (URMHashTableEntryPtr) NULL; delete_name: /* ** remove the name entry from the hash table */ if (az_previous_name == (URMHashTableEntryPtr) NULL) htable[ l_hash_code ] = az_current_name->az_next_entry; else az_previous_name->az_next_entry = az_current_name->az_next_entry; XtFree((char*)az_current_name); return (URMHashTableEntryPtr) NULL; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure is a hashing function. It takes a length and a ** pointer to a value. Using this value as a string, the function ** returns an integer in the range of 0 to sym_k_hash_table_limit-1. ** ** FORMAL PARAMETERS: ** ** l_length length of the value in bytes not including null ** c_value a null terminated string ** ** IMPLICIT INPUTS: ** ** sym_k_hash_table_limit ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** integer (the hash code) in range 0 to sym_k_hash_table_limit-1 ** ** SIDE EFFECTS: ** ** none ** **-- **/ static int hash_function(int l_length, char *c_value) { #ifdef WORD64 #define _shift 3 static unsigned int XmConst mask[ 8 ] = { 0x00000000000000FF, 0x000000000000FFFF, 0x0000000000FFFFFF, 0x00000000FFFFFFFF, 0x00000000FFFFFFFF, 0x0000FFFFFFFFFFFF, 0x00FFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, }; #else #define _shift 2 static unsigned int XmConst mask[ 4 ] = { 0x000000FF, 0x0000FFFF, 0x00FFFFFF, 0xFFFFFFFF }; #endif unsigned int l_hash_code; unsigned int al_value[20]; int l_limit; int l_extra; int i; /* BEGIN OSF Fix CR 5232 */ /* Don't go past array bounds */ if (l_length > (sizeof(int) * 20)) l_length = sizeof(int) * 20; /* END OSF Fix CR 5232 */ l_limit = (l_length-1) >> _shift; /* divide by wordsize */ /* BEGIN OSF Fix CR 5232 */ l_extra = (l_length-1) & _shift; /* remainder from divide by wordsize */ /* END OSF Fix CR 5232 */ bzero((char *)al_value, sizeof(int) * 20); strncpy((char *)al_value, c_value, l_length); l_hash_code = 0; for (i = 0 ; i < l_limit ; i++) l_hash_code = l_hash_code ^ al_value[ i ]; l_hash_code = l_hash_code ^ (al_value[ i ] & mask[ l_extra ]); /* BEGIN OSF Fix CR 5232 */ /* Make sure result isn't negative */ return abs((int)(l_hash_code % k_hash_table_size)); /* END OSF Fix CR 5232 */ } motif-2.3.8/lib/Mrm/Mrmwwrite.c0000644000175000017500000001213513145162623013232 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmwwrite.c /main/11 1996/11/13 14:08:21 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains all the routines which write a widget * from a resource context into an IDB file. * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * UrmPutIndexedWidget Write indexed widget to IDB file * * UrmPutRIDWidget Write RID widget to IDB file * */ /* *++ * * PROCEDURE DESCRIPTION: * * UrmPutIndexedWidget puts a URMgWidget resource record in the * database. Its contents are the widget record. The resource type is * the value of the widget record's type field. The access is the * value of the record's access field; the locking attribute is the * value of the record's lock field. * * FORMAL PARAMETERS: * * file_id file into which to write record * index case-sensitive index for the widget * context_id resource context containing widget record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * MrmBAD_WIDGET_REC invalid widget record in context * Others: See UrmIdbPutIndexedResource * * SIDE EFFECTS: * *-- */ Cardinal UrmPutIndexedWidget (IDBFile file_id , String index , URMResourceContextPtr context_id ) { Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* Widget record in context */ /* * Validate record, then set resource group and type, and enter in * IDB file. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmPutIndexedWidget", _MrmMMsg_0043, file_id, NULL, MrmBAD_CONTEXT) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error ("UrmPutIndexedWidget", _MrmMMsg_0026, file_id, context_id, MrmBAD_WIDGET_REC) ; UrmRCSetSize (context_id, widgetrec->size) ; UrmRCSetGroup (context_id, URMgWidget) ; UrmRCSetType (context_id, widgetrec->type) ; UrmRCSetAccess (context_id, widgetrec->access) ; UrmRCSetLock (context_id, widgetrec->lock) ; result = UrmIdbPutIndexedResource (file_id, index, context_id) ; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmPutRIDWidget puts a widget accessed by a resource id into the * given database file. The resource type is the value of the widget * record's type field. As usual for resources accessed by resource id, * the access is always private; this routine resets the record's access * field if necessary to be consistent with private access. The value * of the locking attribute is the value of the record's lock field. * * FORMAL PARAMETERS: * * file_id file into which to write record * resource_id resource id for the record * context_id resource context containing widget record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * MrmBAD_WIDGET_REC invalid widget record in context * Others: See UrmIdbPutRIDResource * * SIDE EFFECTS: * *-- */ Cardinal UrmPutRIDWidget (IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id ) { Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* Widget record in context */ /* * Validate record, then set resource group and type, and enter in * IDB file. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmPutRIDWidget", _MrmMMsg_0043, file_id, NULL, MrmBAD_CONTEXT) ; widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( ! UrmWRValid(widgetrec) ) return Urm__UT_Error ("UrmPutRIDWidget", _MrmMMsg_0026, file_id, context_id, MrmBAD_WIDGET_REC) ; UrmRCSetSize (context_id, widgetrec->size) ; UrmRCSetGroup (context_id, URMgWidget) ; UrmRCSetType (context_id, widgetrec->type) ; UrmRCSetAccess (context_id, URMaPrivate) ; UrmRCSetLock (context_id, widgetrec->lock) ; result = UrmIdbPutRIDResource (file_id, resource_id, context_id) ; return result ; } motif-2.3.8/lib/Mrm/MrmosI.h0000644000175000017500000000304612672140200012440 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: MrmosI.h /main/6 1995/07/14 10:42:09 drk $ */ #ifndef _MrmosI_h #define _MrmosI_h #ifdef __cplusplus extern "C" { #endif /******** Private Function Declarations ********/ extern void _MrmOSHostFloatToIEEE(float *val); extern void _MrmOSHostDoubleToIEEE(double *val); extern void _MrmOSIEEEFloatToHost(float *val); extern void _MrmOSIEEEDoubleToHost(double *val); extern String _MrmOSSetLocale(String locale); /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _MrmosI_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/lib/Mrm/Mrmerror.c0000644000175000017500000001440013145162623013037 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmerror.c /main/13 1996/11/13 14:00:43 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * All error signalling and handling routines are found here. * *-- */ /* * * INCLUDE FILES * */ #include #include /* * * GLOBAL VARIABLE DECLARATIONS * */ externaldef(urm__err_out) MrmCode urm__err_out = URMErrOutStdout ; externaldef(urm__latest_error_code) MrmCode urm__latest_error_code = 0 ; externaldef(urm__latest_error_msg) String urm__latest_error_msg = NULL ; /* * * OWN VARIABLE DECLARATIONS * */ static String urm_codes_codstg[] = { "MrmFAILURE" ,"MrmSUCCESS" ,"MrmNOT_FOUND" ,"MrmCREATE_NEW" ,"MrmEXISTS" ,"URMIndex retry" ,"MrmNUL_GROUP" ,"MrmINDEX_GT" ,"MrmNUL_TYPE" ,"MrmINDEX_LT" ,"MrmWRONG_GROUP" ,"MrmPARTIAL_SUCCESS" ,"MrmWRONG_TYPE" ,"URM unused code 13" ,"MrmOUT_OF_RANGE" ,"URM unused code 15" ,"MrmBAD_RECORD" ,"URM unused code 17" ,"MrmNULL_DATA" ,"URM unused code 19" ,"MrmBAD_DATA_INDEX" ,"URM unused code 21" ,"MrmBAD_ORDER" ,"URM unused code 23" ,"MrmBAD_CONTEXT" ,"URM unused code 25" ,"MrmNOT_VALID" ,"URM unused code 27" ,"MrmBAD_BTREE" ,"URM unused code 29" ,"MrmBAD_WIDGET_REC" ,"URM unused code 31" ,"MrmBAD_CLASS_TYPE" ,"URM unused code 33" ,"MrmNO_CLASS_NAME" ,"URM unused code 35" ,"MrmTOO_MANY" ,"URM unused code 37" ,"MrmBAD_IF_MODULE" ,"URM unused code 39" ,"MrmNULL_DESC" ,"URM unused code 41" ,"MrmOUT_OF_BOUNDS" ,"URM unused code 43" ,"MrmBAD_COMPRESS" ,"URM unused code 45" ,"MrmBAD_ARG_TYPE" ,"URM unused code 47" ,"MrmNOT_IMP" ,"URM unused code 49" ,"MrmNULL_INDEX" ,"URM unused code 51" ,"MrmBAD_KEY_TYPE" ,"URM unused code 53" ,"MrmBAD_CALLBACK" ,"URM unused code 55" ,"MrmNULL_ROUTINE" ,"URM unused code 57" ,"MrmVEC_TOO_BIG" ,"URM unused code 59" ,"MrmBAD_HIERARCHY" ,"URM unused code 61" ,"MrmBAD_CLASS_CODE" } ; static String urm_codes_invalidcode = "Invalid URM code" ; /* *++ * * PROCEDURE DESCRIPTION: * * This routine is an error signalling routine for use within URM. * It currently just reports the error on the terminal. * * FORMAL PARAMETERS: * * module Identifies the module (routine) detecting the error * error Brief description of the error * file_id if not NULL, the IDB file implicated in the error * context_id if not NULL, the URM resource implicated in the error * status the return code associated with the error. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal Urm__UT_Error (char *module, char *error, IDBFile file_id, /* unused */ URMResourceContextPtr context_id, /* unused */ Cardinal status) { /* * Local variables */ char msg[300] ; /* error message */ /* * construct error message */ /* Old form * sprintf (msg, "%s detected error %s - %s", module, error, * Urm__UT_UrmCodeString(status)) ; */ sprintf (msg, "%s: %s - %s", module, error, Urm__UT_UrmCodeString(status)) ; /* * Print or save the message depending on the reporting style */ urm__latest_error_code = status ; switch ( urm__err_out ) { case URMErrOutMemory: if ( urm__latest_error_msg != NULL ) XtFree (urm__latest_error_msg) ; urm__latest_error_msg = (String) XtMalloc (strlen(msg)+1) ; strcpy (urm__latest_error_msg, msg) ; return status ; case URMErrOutStdout: default: XtWarning (msg) ; return status ; } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine sets the URM error report type to a standard state * * FORMAL PARAMETERS: * * report_type URMErrOutMemory - save message in memory, don't print * URMErrOutStdout - report to stdout * * IMPLICIT INPUTS: * * urm__err_out * * IMPLICIT OUTPUTS: * * urm__err_out * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE illegal state requested * * SIDE EFFECTS: * *-- */ Cardinal Urm__UT_SetErrorReport (MrmCode report_type) { switch ( report_type ) { case URMErrOutMemory: case URMErrOutStdout: urm__err_out = report_type ; return MrmSUCCESS ; default: return MrmFAILURE ; } } /* *++ * * PROCEDURE DESCRIPTION: * * Returns the current error code * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ MrmCode Urm__UT_LatestErrorCode (void) { return urm__latest_error_code ; } /* *++ * * PROCEDURE DESCRIPTION: * * Returns the current error message * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ String Urm__UT_LatestErrorMessage (void) { return urm__latest_error_msg ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine returns a static string naming a URM return code. * * FORMAL PARAMETERS: * * cod A URM return code * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ String Urm__UT_UrmCodeString (MrmCode cod) { if ( cod >= MrmFAILURE && cod <= MrmBAD_CLASS_CODE ) return urm_codes_codstg[cod] ; return urm_codes_invalidcode ; } motif-2.3.8/lib/Mrm/Mrm.h0000644000175000017500000021014713145162623012000 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef Mrm_H #define Mrm_H #define urm_h 1 #include #include /* XmString definition and _NO_PROTO */ #include /* * This is the internal file used throughout URM for literal and * struct definitions. It defines everything not found in public * files. */ #ifndef MIN #define MIN(x,y) ((x) < (y) ? (x) : (y)) #endif #ifndef MAX #define MAX(x,y) ((x) > (y) ? (x) : (y)) #endif #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ /* * The following macro is used to round the size of memory allocation requests * up to eight bytes. This is done to help satisfy alignment * request for MIPS, CRAY, Alpah, HP9000 (for doubles) and similar machines. */ #define _sl sizeof(long) #define _slm (sizeof(long) - 1) #define _FULLWORD(exp) (_sl * (((exp) + _slm) / _sl)) /* (4*(((exp)+3)/4)) */ /* * Swap the byte order of 4- and 2- byte quantities. * "tp +=" lines are needed on Cray (CARD32 is actually 64 bits). */ #define swap4bytes(l) {\ CARD32 t = (CARD32) l;\ char n, *tp = (char *) &t;\ tp += sizeof(CARD32) - 4;\ n = tp[0]; tp[0] = tp[3]; tp[3] = n;\ n = tp[1]; tp[1] = tp[2]; tp[2] = n;\ l = t;\ } #define swap2bytes(s) {\ CARD16 t = (CARD16) s;\ char n, *tp = (char *) &t;\ tp += sizeof(CARD16) - 2;\ n = tp[0]; tp[0] = tp[1]; tp[1] = n;\ s = t;\ } #define swapbytes(v) {\ if (sizeof(v) == 2) \ swap2bytes(v) \ else if (sizeof(v) == 4) \ swap4bytes(v); \ } #define swapdouble(d) {\ double dt = (double) d;\ unsigned m, *dp = (unsigned *) &dt;\ swap4bytes( dp[0] );\ swap4bytes( dp[1] );\ m = dp[0]; dp[0] = dp[1]; dp[1] = m;\ d = dt;\ } /* * When a resource record is referenced but not yet fetched, logical or * the convert type with this value as a flag. */ #define MrmResourceUnswapped (unsigned char)128 /* * URM-wide constants */ #define URMversion "URM 1.2" #define URM1_1version "URM 1.1" /* * The indexes of the self-encoding compression tables in a UID file. They * intentionally include characters which are illegal in UIL identifiers. */ #define UilMrmClassTableIndex ">ClassTable" #define UilMrmResourceTableIndex ">ResourceTable" /* * Resource classes and types */ #define URMgNul 0 #define URMgWidget 1 #define URMgLiteral 2 /* types in MrmRtype... */ #define URMgResourceSet 3 /* type in URMrs... */ /* 4 unused */ #define URMgMessage 5 #define URMgMin 1 /* lowest legal group value */ #define URMgMax 5 /* highest legal group value */ #define URMgVecSize URMgMax+1 /* To size any vectors */ /* * The null resource type */ #define URMtNul 0 /* * Access types */ #define URMaPublic 1 #define URMaPrivate 2 /* * Index types. Immediate is included for the convenience of the UIL compiler */ #define URMrIndex 1 #define URMrRID 2 #define URMrImmediate 3 /* * Maximum number of characters in an index */ #define URMMaxIndexLen 31 #define URMMaxIndexLen1 (URMMaxIndexLen + 1) /* to size vectors */ /* * File open access types */ #define URMReadAccess 1 #define URMWriteAccess 2 /* * Standard date string length */ #define URMhsDate 29 /* any date string */ /* * Types of resource sets. */ #define URMrsInterfaceModule 1 /* Interface module */ /* * Values for the manage flag in memory only -- the manage field in RGMChildDesc * is just a Boolean. */ typedef enum { MrmManageUnmanage, MrmManageManage, MrmManageDefault } MrmManageFlag; /* * Urm typedefs */ /* * The maximum number of arguments allowed in an arglist or children in * a child list. A number intended to catch gross errors. */ #define RGMListSizeMax 32767 /* * URM pointer list * * The following structure is inspired by resource contexts, but is used * to store lists of pointers. Its supporting routines automatically manage * space in the same the context routines do. Since this is used only * internally, no validation is provided. */ typedef struct { int num_slots ; /* number of available pointer slots */ int num_ptrs ; /* number of slots actually used */ XtPointer *ptr_vec ; /* pointer slot vector */ } URMPointerList, *URMPointerListPtr ; /* * Accessors for the list or a pointer in the list */ #define UrmPlistPtrList(list) ((list)->ptr_vec) #define UrmPlistNum(list) ((list)->num_ptrs) #define UrmPlistPtrN(list,ndx) ((list)->ptr_vec[ndx]) /* * URM Resource context * * The following context structure is provided by URM to cover all memory * management of in-memory resources. This mechanism provides: * o improved memory management efficiency through buffer re-use * o collection of resource attributes in one place * o support for non-standard allocation routines */ #define URMResourceContextValid 232570204 typedef struct { unsigned validation ; /* validation code = URMResourceContextValid */ char *data_buffer ; /* pointer to data buffer in memory */ MrmSize buffer_size ; /* number of bytes in buffer */ MrmSize resource_size ; /* number of bytes used by resource */ MrmGroup group ; /* resource group */ MrmType type ; /* resource type */ MrmCode access ; /* URMaPrivate or URMaPublic */ MrmCode lock ; /* resource locking code */ char *((*alloc_func) ()) ; /* memory allocation func */ void (*free_func) () ; /* deallocation func */ MrmFlag byte_swapped ; /* resource is byte_swapped */ } URMResourceContext, *URMResourceContextPtr ; /* * Validation macro, returns TRUE/FALSE */ #define UrmRCValid(context) ((context)->validation==URMResourceContextValid) /* * The following are accessor macros for a resource context */ #define UrmRCBuffer(context) ((context)->data_buffer) #define UrmRCBufSize(context) ((context)->buffer_size) #define UrmRCSize(context) ((context)->resource_size) #define UrmRCGroup(context) ((context)->group) #define UrmRCType(context) ((context)->type) #define UrmRCAccess(context) ((context)->access) #define UrmRCLock(context) ((context)->lock) #define UrmRCByteSwap(context) ((context)->byte_swapped) /* * The following are modifiers for a resource context */ #define UrmRCSetBuffer(context,bufadr) {(context)->data_buffer=(bufadr);} #define UrmRCSetSize(context,sizval) {(context)->resource_size=(sizval);} #define UrmRCSetGroup(context,grpval) {(context)->group=(grpval);} #define UrmRCSetType(context,typval) {(context)->type=(typval);} #define UrmRCSetAccess(context,accval) {(context)->access=(accval);} #define UrmRCSetLock(context,lckval) {(context)->lock=(lckval);} #define UrmRCSetByteSwap(context,swapval) {(context)->byte_swapped=(swapval);} /* * Error reporting states */ #define URMRCErrorDefault 1 /* default - report on line */ #define URMRCErrorSave 2 /* save error, don't report */ /* * Error reporting destinations */ #define URMErrOutMemory 1 /* Save error messages in memory, no print */ #define URMErrOutStdout 2 /* print error messages to stdout */ /* * IDB definitions in common use. The principal one is IDBFile; others * are included to make that definition valid. */ /* * Record type definitions - IDBrt... */ #define IDBrtMin 1 #define IDBrtHeader 1 #define IDBrtIndexLeaf 2 #define IDBrtIndexNode 3 #define IDBrtRIDMap 4 #define IDBrtData 5 #define IDBrtMax 5 #define IDBrtVecSize 6 /* * Sizes of fixed-length strings in the file header. Definitions are * provided for both the number of characters in the string and the * constant which gives the string length including the terminating nul. * IDBhs... */ #define IDBhsVersion 9 /* Any version string */ #define IDBhsVersion1 (IDBhsVersion + 1) #define IDBhsCreator 29 /* Creator id */ #define IDBhsCreator1 (IDBhsCreator + 1) #define IDBhsDate URMhsDate /* Any date string */ #define IDBhsDate1 (IDBhsDate + 1) #define IDBhsModule 29 /* Module id */ #define IDBhsModule1 (IDBhsModule + 1) /* * Record number. 65k should be enough... */ typedef short int IDBRecordNumber ; /* * A resource ID consists of the resource map index and the ID index * in the given resource map. */ typedef short int IDBResourceIndex ; typedef union { unsigned external_id ; /* Looks like a fullword */ struct { IDBRecordNumber map_rec B32 ; /* resource map record */ IDBResourceIndex res_index B32 ; /* resource index into map */ } internal_id ; /* 2 fields internally */ } IDBridDesc ; /* * A resource ID passed by value in a fullword. */ typedef unsigned IDBResource ; /* a declaration for RIDs passed by value */ /* * Class descriptor. * * This descriptor contains the information URM requires about a toolkit * class. */ #define URMWCIClassDescValid 39963371 #define UrmWCIClassDescValid(classdesc) \ ((classdesc)->validation==URMWCIClassDescValid) typedef struct _WCIClassDesc { unsigned validation ; /* URMWCIClassDescValid */ struct _WCIClassDesc *next_desc ; /* next descriptor in chain */ String creator_name ; /* create routine name. This is also the accessor key for non-toolkit widget classes. */ Widget (*creator) () ; /* low-level create routine. This is also the class identifier (name) used to match user classes. */ WidgetClass class_record ; /* Pointer to toolkit class record */ void (*cleanup) () ; /* low-level destructor routine. Used to clean up after creation routines that leave dangling memory (i.e. XmRendition, XmRenderTable) */ } WCIClassDesc, *WCIClassDescPtr ; /* * Table used to uncompress compression codes in a self-encoding UID file. * Table entries can be overlaid with function pointers for tables which * encode convenience functions. * * The table is accessed by the compression code. Code 0 is unused by * convention, and code 1 is unused because it is the marker for an * unknown (user defined) entry, which is specified by an explicit string. * Thus the valid entries begin at 2 (UilMrmMinValidCode). Any code * < UilMrmMinValidCode or > num_entries is invalid. * * When stored in a UID file, a table is a block of memory with the * following properties: * o The table is allocated with enough space for all the decompression * pointers required. * o The table is followed by the strings in the table. They are allocated * in a heap built from contiguous memory following table itself. */ #define UidCompressionTableValid 317938336 #define UilMrmUnknownCode 1 #define UilMrmMinValidCode 2 #define UilMrmReservedCodeCount 2 typedef union { MrmOffset stoffset; /* offset of string in heap (in file) */ char *cstring; /* compressed string as a memory pointer */ WCIClassDescPtr cldesc; /* class descriptor for class table */ } UidCTableEntry; typedef struct { unsigned validation; /* validation code = UIDCompressionTableValid */ MrmCount num_entries; /* number of table entries */ UidCTableEntry entry[1]; /* first entry */ } UidCompressionTable, *UidCompressionTablePtr; /* * Hash table entry */ #define k_hash_table_size (127) typedef struct _URMHashTableEntry { char *az_value; /* value associated with this name */ struct _URMHashTableEntry *az_next_entry; /* next entry on hash chain */ char c_text[1]; /* text of the name */ } URMHashTableEntry, *URMHashTableEntryPtr; /* * Low level file information. * * This structure is pointed to in the IDBOpenFile structure and blindly * passed to the low level routines. */ typedef struct { unsigned rab; /* Record Access Block */ int file_desc; /* File Descriptor */ char *name; /* The file name */ } IDBLowLevelFile, *IDBLowLevelFilePtr; /* * IDB open file information * * The following is the information retained by IDB for an open file. * Much of this information matches that found in the file header, * and is the source of for that info when the header is updated. */ #define IDBOpenFileValid 421642674 typedef struct { unsigned validation ; /* validation code = IDBOpenFileValid */ int get_count ; /* # get operations on file */ int put_count ; /* # put operations on file */ MrmCode access ; /* URMReadAccess or URMWriteAccess */ IDBLowLevelFilePtr lowlevel_id ; /* open file id returned by low-level routines */ IDBRecordNumber index_root ; /* index root pointer */ MrmCount num_indexed ; /* # entries in index */ MrmCount num_RID ; /* # RID entries in file */ IDBridDesc next_RID ; /* next available RID */ IDBRecordNumber last_record ; /* last record used in file */ IDBRecordNumber last_data_record ; /* last data record in file. NULL if no records yet */ MrmCount group_counts[URMgVecSize] ; /* vector of record counts by resource group */ MrmCount rt_counts[IDBrtVecSize] ; /* vector of record counts by record type (statistics) */ unsigned long timer ; /* for statistics */ char db_version[IDBhsVersion1] ; /* database version */ char creator[IDBhsCreator1] ; /* creator id */ char creator_version[IDBhsVersion1] ; /* creator version */ char creation_date[IDBhsDate1] ; /* creation date */ char module[IDBhsModule1] ; /* module id */ char module_version[IDBhsVersion1] ; /* module version */ UidCompressionTablePtr class_ctable; /* compression table for class info */ UidCompressionTablePtr resource_ctable; /* compression table for resource info */ int user1 ; /* for caller use */ int user2 ; /* for caller use */ MrmFlag byte_swapped ; /* indicates uid file created on opposite-endian machine */ MrmFlag in_memory ; /* for memory mapped files */ unsigned char *uid_buffer ; /* pointer to memory buffer */ } IDBOpenFile, *IDBFile ; /* * Open hierarchy struct * * The following structure represents an open hierarchy. A hierarchy * is principally a list of open IDB files in search order. As an aid to * efficient searching, a list of files by resource group is also kept. * Each entry in the list is the subset of the files in the hierarchy * which contains resources in the corresponding group. */ #define MrmHIERARCHY_VALID 102214835 typedef struct MrmHierarchyDescStruct { unsigned validation ; /* MrmHIERARCHY_VALID */ MrmCount num_file ; /* number of files open */ IDBFile *file_list ; /* list of open files */ MrmCount grp_num[URMgVecSize] ; /* vector of file counts by resource group */ IDBFile *grp_ids[URMgVecSize] ; /* vectors of file ids by resource group */ URMHashTableEntryPtr *name_registry; /* to register names */ } MrmHierarchyDesc; /* * Validation macro */ #define MrmHierarchyValid(hierarchy) \ ((hierarchy)->validation==MrmHIERARCHY_VALID) /* * RGM widget record typedefs */ /* * RGM Widget record. All offset are relative to the beginning of the record */ #define URMWidgetRecordValid 373946338 /* Variety codes. */ #define UilMrmWidgetVariety 0 #define UilMrmAutoChildVariety 1 typedef struct { unsigned validation; /* validation code = URMWidgetRecordValid */ MrmSize size; /* Total number of bytes for record */ MrmCode access; /* URMaPublic or URMaPrivate */ MrmCode lock; /* locking code */ MrmType type; /* widget type, equates to class for toolkit widgets. (Unknown or a uid-based compression code). */ MrmOffset name_offs; /* Offset of widget name. Locates a String. Empty string is illegal */ MrmOffset class_offs; /* Offset of class name. The class name is required for application-defined widgets. */ MrmOffset arglist_offs; /* Offset of arglist descriptor. Locates a RGMArgListDesc struct */ MrmOffset children_offs; /* Offset of children descriptor. Locates a RGMChildrenDesc struct */ MrmOffset comment_offs; /* Offset of comment string for this widget. (URM extension) */ MrmOffset creation_offs; /* Offset of RGMCallnackDesc struct specifying URM creation callback for this widget */ unsigned long variety;/* Regular widget or auto child. */ unsigned long annex; /* annex allows compatible growth */ } RGMWidgetRecord, *RGMWidgetRecordPtr ; /* * Size of the header part of the record */ #define RGMWidgetRecordHdrSize sizeof(RGMWidgetRecord) /* * Macro to access the widget record in a context */ #define UrmWRWidgetRec(context) \ ((RGMWidgetRecordPtr) UrmRCBuffer(context)) /* * All validation, accessor, and setting macros access a widget record in * a context. They all take a pointer to the widget record, which is * the context buffer CAST to RGMWidgetRecordptr. */ #define UrmWRValid(widgetrec) \ ((widgetrec)->validation==URMWidgetRecordValid) /* * Accessor macros for the widget record header */ #define UrmWRPSize(context) (UrmWRWidgetRec(context)->size) #define UrmWRPAccess(context) (UrmWRWidgetRec(context)->access) #define UrmWRPLock(context) (UrmWRWidgetRec(context)->lock) #define UrmWRPType(context) (UrmWRWidgetRec(context)->type) /* * value descriptor. This consists of a representation type, followed * by a union of either an immediate value or an offset, depending * on the representation type. */ typedef struct { MrmType rep_type; /* representation type from RGMrType... */ union { int ival; /* integer, boolean, compressed */ MrmOffset offset ; /* offset for all others */ } datum ; /* immediate value or offset */ } RGMArgValue, *RGMArgValuePtr ; /* * RGM widget record argument descriptor */ typedef struct { MrmCode tag_code; /* Either the compressed code for the argument tag from URMc..., or UilMrmUnknownCode to indicate no known string. If UilMrmUnknownCode, then the offset is in tag_off */ union { MrmOffset tag_offs; /* offset to tag string if needed */ MrmCode related_code; /* related argument code for case where tag_code is valid and a related argument is to be set */ } stg_or_relcode; RGMArgValue arg_val ; /* argument value */ } RGMArgument, *RGMArgumentPtr ; /* * RGM widget record arglist descriptor */ typedef struct { MrmCount count; /* number of arguments in list */ MrmCount extra; /* # extra runtime args needed */ unsigned long annex1 ; /* annex allows compatible growth */ RGMArgument args[1] ; /* first of the argument descriptors */ } RGMArgListDesc, *RGMArgListDescPtr ; /* * RGM widget record text vector item (text vector literal) * * The following represents vectors of either ASCIZ or compound strings. * each member of the vector is type-tagged so that mixed vectors are possible. * This descriptor is a union so that a vector of these items can be over- * written to become an in-memory list of pointers. This avoids some * allocation problems at widget instantiation. Char8 items are String, * CString items are XmString. * * Offsets are interpreted as follows: * text vector as immediate in widget record - offset from beginning * of record buffer. * text vector as UID literal - offset from beginning of resource buffer */ typedef union { XtPointer pointer ; /* for use as memory pointer */ struct { MrmType rep_type B32; /* MrmRtypeChar8 or MrmRtypeCString */ MrmOffset offset B32; /* offset of item in record */ } text_item ; /* for use as item type & offset */ } RGMTextEntry, *RGMTextEntryPtr ; /* * The text Vector. This is designed to allow the vector of text entries * to be over-written into an in-memory vector of pointers. Thus this list * has one extra entry to provide a terminating null. */ #define URMTextVectorValid 34966592 typedef struct { unsigned validation; /* URMTextVectorValid */ MrmCount count; /* Number of text items in vector */ RGMTextEntry item[1] ; /* first text item in a vector of n = .count+1 items. item[.count] always = NULL */ } RGMTextVector, *RGMTextVectorPtr ; /* * The integer Vector. This is designed to allow the vector of integers * to be over-written into an in-memory vector of pointers. */ #define URMIntegerVectorValid 34966593 typedef struct { unsigned validation; /* URMIntegerVectorValid */ MrmCount count; /* Number of integer items in vector */ int item[1] ; /* first integer item in a vector */ /* of n = .count+1 items. */ } RGMIntegerVector, *RGMIntegerVectorPtr ; /* * RGM widget record callback item * * A callback item is the offset of a routine name (which must be a * non-imported string), and the routine tag value, which is encoded * as a value. The tag value can evaluate to almost anything, including * an imported value. * * This structure is intended to be over-written with memory pointers * and thus function as an arglist value. */ typedef union { int ival; /* integer, boolean, compressed */ MrmOffset offset; /* offset for all others */ } RGMdatum; /* immediate value, offset, widget */ typedef union { struct { XtCallbackRec callback ; /* item as Xt callback */ MrmFlag resolved; /* Item resolved to XtCallbackRec */ String wname; /* Name of widget reference */ } runtime; struct { MrmOffset routine B32; /* offset to routine name string */ /* duplicate RGMArgValue, avoiding union alignment hassles */ MrmType rep_type B32; /* from RGMrType... */ RGMdatum datum ; /* immediate value, offset, widget */ } cb_item ; /* callback item in record */ } RGMCallbackItem, *RGMCallbackItemPtr ; /* * RGM widget record callback argument descriptor. This list has * count + 1 entries so that this structure may be overwritten */ #define URMCallbackDescriptorValid 107397480 typedef struct { unsigned validation; /* URMCallbackDescriptorValid */ MrmCount count; /* Number of callback items */ MrmCount annex; /* annex allows growth */ MrmCount unres_ref_count; /* # of unresolved widget refs in the RGMCallbackItems */ RGMCallbackItem item[1] ; /* First callback item in a list of n = .count+1 items */ } RGMCallbackDesc, *RGMCallbackDescPtr ; /* * We need to have the 1.1 versions of RGMCallbackItem and RGMCallbackDesc * so that backwards compatibility can be maintained between 1.1 and 1.2. */ typedef union { XtCallbackRec runtime ; /* item as Xt callback */ struct { MrmOffset routine ; /* offset to routine name string */ /* duplicate RGMArgValue, avoiding union alignment hassles */ MrmType rep_type ; /* from RGMrType... */ RGMdatum datum ; /* immediate value or offset */ } cb_item ; /* callback item in record */ } OldRGMCallbackItem, *OldRGMCallbackItemPtr ; typedef struct { unsigned validation ; /* URMCallbackDescriptorValid */ MrmCount count ; /* Number of callback items */ unsigned long annex1 ; /* annex allows compatible growth */ OldRGMCallbackItem item[1] ; /* First callback item in a list of n = .count+1 items */ } OldRGMCallbackDesc, *OldRGMCallbackDescPtr ; /* BEGIN OSF Fix CR 4859 */ /* * Wide character uid form * * The following represents a multi-byte string which needs to be converted * to a wide-character string when it is retrieved. * The structure contains a byte count followed by the bytes. */ typedef union { XtPointer pointer; /* for use as memory pointer */ struct { MrmCount count; /* # of bytes */ char bytes[1]; /* vector of bytes */ } wchar_item; } RGMWCharEntry, *RGMWCharEntryPtr; /* END OSF Fix CR 4859 */ /* * Font literal * * The following represents a MrmRtypeFont literal. Since it contains two * strings, the same offset mechanism is used to store both, and this * is a fixed-length data structure. * data structure. */ typedef struct { union { /*XmStringCharset*/char* charset; /* character set (resolved) */ MrmOffset cs_offs; /* character set in buffer */ } cset; union { String font; /* string naming font */ MrmOffset font_offs; /* font name in buffer */ } font; MrmCode type; } RGMFontItem, *RGMFontItemPtr ; /* * A font list, which is a vector of font items. The font items are * treated as a heap store following the fixed length list (similar * to text vectors). Font lists in widget records have offsets from * the beginning of the record; font list literals in a UID file have * offsets from the beginning of the list itself (just like text * vectors). Font items in a font list are a union of a pointer and * an offset, so that (as in text vectors) they can be converted in * place to an in-memory pointer list. */ #define URMFontListValid 74149235 typedef struct { unsigned validation; /* URMFontListValid */ MrmCount count; /* # of font items in list */ RGMFontItem item[1] ; /* vector of RGMFontItems */ } RGMFontList, *RGMFontListPtr ; /* * We need to have the 1.1 versions of RGMFontItem and RGMFontList * so that backwards compatibility can be maintained between 1.1 and 1.2. */ typedef struct { union { /*XmStringCharset*/char* charset; /* character set (resolved) */ MrmOffset cs_offs; /* character set in buffer */ } cset; union { String font; /* string naming font */ MrmOffset font_offs; /* font name in buffer */ } font; } OldRGMFontItem, *OldRGMFontItemPtr ; typedef struct { unsigned validation ; /* URMFontListValid */ MrmCount count ; /* # of font items in list */ OldRGMFontItem item[1] ; /* vector of RGMFontItems */ } OldRGMFontList, *OldRGMFontListPtr ; /* * RGM widget record child descriptor */ typedef struct { MrmFlag manage ; /* true if child is managed by parent at initialization */ MrmSCode access ; /* URMaPublic or URMaPrivate */ MrmSCode unused1 ; /* formerly class, unused anywhere */ MrmSCode type ; /* specifier type - URMrIndex or URMrRID */ unsigned long annex1; /* annex allows compatible growth */ union { int index_offs; /* index string offset (URMrIndex) */ MrmResource_id id; /* IDB resource id (URMrRID) */ } key ; /* key to widget by index or id */ } RGMChildDesc, *RGMChildDescPtr ; /* * RGM widget record children list descriptor */ typedef struct { MrmCount count; /* number of children */ MrmCode unused1; /* formerly access, unused anywhere */ unsigned long annex1; /* annex allows compatible growth */ RGMChildDesc child[1] ; /* First child descriptor in a list of n = .count descriptors. */ } RGMChildrenDesc, *RGMChildrenDescPtr ; /* * RGM widget record URM resource descriptor. This is commonly used as the * value of an argument which is a discrete resource. In this case, the * resource specifies the data type required for the argument (from * RGMrType...) to allow conversion if the literal is a different type * when read. */ typedef struct { MrmSize size; /* number of bytes in structure */ MrmFlag access ; /* Public/private - URMaPublic or URMaPrivate for this resource */ MrmSCode type ; /* URMrIndex or URMrRID */ MrmSCode res_group ; /* resource group */ MrmSCode cvt_type ; /* RGMrType... to which the resource needs to be converted when used as an argument value. RGMwrType for widget references. */ unsigned long annex1 ; /* annex allows compatible growth */ union { char index[1] ; /* index for URMrIndex resource (nul teminated) */ MrmResource_id id ; /* resource id */ } key ; /* key to resource by index or id */ } RGMResourceDesc, *RGMResourceDescPtr ; /* * When a resource descriptor names a widget, the cvt_type is used to * indicate the type of reference, which indicates the processing required. */ #define RGMwrTypeReference 233 /* Reference a widget defined by a CreateInstance elsewhere */ #define RGMwrTypeSubTree 234 /* Subtree reference. The subtree must be instantiated as part of the current operation */ /* * Interface module descriptor * * An interface module is currently the only type of resource set defined. * It defines the topmost widgets for some application (there is no * requirement that there be only one interface module for an application). */ /* * A topmost widget descriptor. These are currently required to be * accessed by index only, and the index is currently the only information * saved. The index is stored as a fixed-length entry to simplify the * layout of an interface module. * * The widgets referenced in an interface module are those who have * no parent in the interface definition. Commonly these will have * the top-level widget as their parent at runtime, but this is not * required. */ typedef struct { char index[URMMaxIndexLen1] ; /* Index (name) of widget */ } RGMTopmostDesc, *RGMTopmostDescPtr ; #define URMInterfaceModuleValid 408427447 typedef struct { unsigned validation; /* URMInterfaceModuleValid */ MrmCount count; /* number of topmost widgets */ unsigned long annex1; /* annex allows compatible growth */ unsigned long annex2; /* annex allows compatible growth */ RGMTopmostDesc topmost[1] ; /* First topmost descriptor in a list of n= .count descriptors */ } RGMModuleDesc, *RGMModuleDescPtr ; /* * Validation macro */ #define UrmInterfaceModuleValid(module) \ ((module)->validation==URMInterfaceModuleValid) /* * Representations for URM color descriptor (MrmRtypeColor) and * color table (MrmRtypeColorTable). */ /* * RGB color data structure */ typedef struct { unsigned short red; /* RGB colors */ unsigned short green; /* RGB colors */ unsigned short blue; /* RGB colors */ }RGBColor, *RGBColorPtr; /* * URM color descriptor. This is a color name plus a fallback * designator specifying the color as foreground or background. */ typedef struct { MrmSCode mono_state ; /* monochrome treatment, from URMColorMonochrome... */ MrmSCode desc_type; /* color desc_type from URMColorDescType... */ union { char name[1] ; /* color name */ RGBColor rgb ; /* RGB Color */ } desc; } RGMColorDesc, *RGMColorDescPtr ; /* * Monochrome treatments */ #define URMColorMonochromeUnspecified 1 #define URMColorMonochromeForeground 2 #define URMColorMonochromeBackground 3 /* * Color descriptor types */ #define URMColorDescTypeName 1 #define URMColorDescTypeRGB 2 /* * Use this Min size plus the size of the color name string to determine the * exact size that the RGMColorDesc will need to allocate. */ #define RGMColorDescNameMinSize (sizeof (RGMColorDesc)\ - sizeof (RGBColor)\ + sizeof (char)) /* * URM color table item. This is a pointer to a color descriptor, plus * a Pixel for the runtime conversion of the color. */ typedef struct { Pixel color_pixel ; /* runtime translation */ MrmType type; /* descriptor reference type, either MrmRtypeColor, or or MrmRtypeResource if coffs locates a resource */ unsigned long annex1; /* annex allows growth */ union { RGMColorDescPtr cptr ; /* in-memory color descriptor */ MrmOffset coffs; /* descriptor/resource in record */ } color_item ; /* pointer or offset */ } RGMColorTableEntry, *RGMColorTableEntryPtr ; /* * A color table. This is a vector of color items. Items 0 and 1 are * reserved for "background"(0) and "foreground"(1) in all color tables; * user-specified colors begin at entry 2. The color count always * includes these predefined colors, so the minimum count is 2. No * color descriptor is required or used for the predefined entries; * only the color_pixel field in the table item is ever used. * * Color descriptor offsets are valid only in a widget record. All * other instances of a color table, including those which are * are parameters to the widget record creation routines, must have * valid memory pointers. */ #define URMColorTableValid 9424574 typedef struct { unsigned validation ; /* URMColorTableValid */ MrmCount count ; /* # entries in table */ RGMColorTableEntry item[1] ; /* 1st entry in table */ } RGMColorTable, *RGMColorTablePtr ; /* * Predefined entries, first accessible user-defined entry */ #define URMColorTableBG 0 #define URMColorTableFG 1 #define URMColorTableUserMin 2 /* * Definitions to a support a URM icon; the representation for * MrmRtypeIconImage objects. * * A URM icon supports a pixmap of arbitrary size and with, and with support * for up to 256 colors including foreground and background. The * icon pixels are stored using either 1, 4, or 8 bits, depending on * how much information is required to index the icon's color map. * * The pixel array is stored in row-major order. Each row begins on a byte * boundary no matter what the pixel size is. URM uses the ZPixmap * representation for the image data at runtime, and attempts to avoid * allocating memory for the pixel array by overwriting the pixel data * array with Pixel values if the number of bits per pixel is sufficient. * * The color table design is intended to support eventual creation of * color tables as discrete resources, possibly accessible as resource * references. Currently, the color table must be allocated and managed * as part of the icon image. * * Icon image offsets are valid only in a widget record. All * other instances of an icon image, including those which are * are parameters to the widget record creation routines, must have * valid memory pointers. */ #define URMIconImageValid 160003640 typedef struct { unsigned validation; /* URMIconImageValid */ MrmSCode pixel_size ; /* from URMIconPixelSize... */ MrmCount width; /* # pixels wide */ MrmCount height; /* # pixels high */ MrmCount hot_x, hot_y ; /* hot spot location */ MrmType ct_type; /* MrmRtypeColorTable for table in record. MrmRtypeResource for separate resource ref. */ unsigned long annex1; /* annex allows growth */ union { RGMColorTablePtr ctptr ; /* in-memory color table */ MrmOffset ctoff; /* color table or resource desc offset in record */ } color_table ; /* memory/record color table */ union { char *pdptr ; /* pixel data in memory */ MrmOffset pdoff; /* pixel data record offset */ } pixel_data ; } RGMIconImage, *RGMIconImagePtr ; /* * Pixel sizes. These are limited and specified with literals. */ #define URMPixelSize1Bit 1 /* 1 bit (bitmap) */ #define URMPixelSize2Bit 2 /* 2 bits */ #define URMPixelSize4Bit 3 /* 4 bits */ #define URMPixelSize8Bit 4 /* 8 bits */ /* * Definitions of the data structures used to store units information for * dimensional values. */ typedef struct { unsigned value; /* the actual integer value */ unsigned units; /* the units designation of the value. Matches the Xm units values in Xm.h */ } RGMUnitsInteger, *RGMUnitsIntegerPtr ; typedef struct { unsigned long value[2]; /* the actual floating point value */ unsigned units; /* the units designation of the value. Matches the Xm units values in Xm.h */ } RGMUnitsFloat, *RGMUnitsFloatPtr ; /* * Definition of the data structure used during widget creation to retain * and provide the information required to resolve widget arguments which * must be SetValue rather than create. The layout and use of * the descriptor depends on the type argument: * URMsvWidgetRef - widget resource forward reference. Resolved * when the widget is defined, applied when all the * widgets in a tree are instantiated. * URMsvIconImage - Icon image which is SetValued immediately * after the widget create (when foreground/backgound * info is available). */ typedef struct { Widget setw ; /* widget to be modified */ MrmCode type ; /* from URMsv... */ MrmCode tagcode ; /* code of argument to be set */ String tagname ; /* string name of argument. If the tag code is UilMrmUnknownCode, this must be freed. */ MrmFlag done ; /* set TRUE when SetValues done */ union { String wname ; /* arg widget index */ RGMIconImagePtr icon ; /* icon pointer only */ RGMCallbackDescPtr callbacks; /* callback list */ } sv ; /* some SetValues descriptor */ } URMSetValuesDesc, *URMSetValuesDescPtr ; /* * SetValues descriptor types */ #define URMsvWidgetRef 1 /* widget reference */ #define URMsvIconImage 2 /* icon image */ #define URMsvCallBackList 3 /* list of callbacks */ /* * The following data structures support resolving references to widgets * found during creation of a widget tree. The data structure retains * an ordered list of the widget name/id pairs instantiated during * tree creation. The data structure is maintained in a resource context * which allows for expansion. The top part of the data structure retains * fixed-length information, while the bottom part of the buffer is * used as a string heap. */ /* * Single element in the fixed-length vector */ typedef struct { Widget w_id; /* widget id */ MrmOffset w_name_offs; /* name offset in heap */ } URMWRef, URMWRefPtr; /* * Header for the structure */ typedef struct { MrmCount num_refs; /* # entries defined */ MrmCount heap_size; /* # bytes used in heap */ URMWRef refs[1]; /* beginning of vector */ } URMWRefStruct, *URMWRefStructPtr; /* * size and access macros */ #define UrmWRefHeaderBytes(ref_id) \ (sizeof(URMWRefStruct)+((ref_id)->num_refs-1)*sizeof(URMWRef)) #define UrmWRefBytesUsed(ref_id) \ (UrmWRefHeaderBytes((ref_id))+(ref_id)->heap_size) #define UrmWRefIdN(ref_id,ndx) \ ((ref_id)->refs[(ndx)].w_id) #define UrmWRefNameN(ref_id,ndx) \ ((String)((String)(ref_id)+(ref_id)->refs[(ndx)].w_name_offs)) /* * Function prototypes for URM routines */ #ifndef _ARGUMENTS #define _ARGUMENTS(arglist) arglist #endif #include "IDB.h" /* needed for prototype definitions */ /* mrmcontext.c */ extern Cardinal UrmGetResourceContext _ARGUMENTS(( char *((*alloc_func )()), void (*free_func )(), MrmSize size , URMResourceContextPtr *context_id_return )); extern Cardinal UrmResizeResourceContext _ARGUMENTS(( URMResourceContextPtr context_id , int size )); extern Cardinal UrmFreeResourceContext _ARGUMENTS(( URMResourceContextPtr context_id )); /* mrmerror.c */ extern Cardinal Urm__UT_Error _ARGUMENTS(( char *module , char *error , IDBFile file_id , URMResourceContextPtr context_id , Cardinal status )); extern Cardinal Urm__UT_SetErrorReport _ARGUMENTS(( MrmCode report_type )); extern MrmCode Urm__UT_LatestErrorCode _ARGUMENTS(( void )); extern String Urm__UT_LatestErrorMessage _ARGUMENTS(( void )); extern String Urm__UT_UrmCodeString _ARGUMENTS(( MrmCode cod )); /* mrmhier.c */ extern Cardinal Urm__OpenHierarchy _ARGUMENTS(( MrmCount num_files , String *name_list , MrmOsOpenParamPtr *os_ext_list , MrmHierarchy *hierarchy_id_return, MrmFlag in_memory, unsigned char *uid_buffer)); extern Cardinal Urm__CloseHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id )); extern Cardinal UrmHGetIndexedResource _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , MrmGroup group_filter , MrmType type_filter , URMResourceContextPtr context_id , IDBFile *file_id_return )); extern Cardinal Urm__RegisterNamesInHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id , String *names , XtPointer *values , MrmCount num_cb )); extern Cardinal Urm__LookupNameInHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id , String name , XtPointer *value_return )); /* mrmibuffer.c */ extern Cardinal Idb__BM_InitBufferVector _ARGUMENTS(( void )); extern Cardinal Idb__BM_GetBuffer _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr *buffer_return )); extern Cardinal Idb__BM_MarkActivity _ARGUMENTS(( IDBRecordBufferPtr buffer )); extern Cardinal Idb__BM_MarkModified _ARGUMENTS(( IDBRecordBufferPtr buffer )); extern Cardinal Idb__BM_GetRecord _ARGUMENTS(( IDBFile file_id , IDBRecordNumber record , IDBRecordBufferPtr *buffer_return )); extern Cardinal Idb__BM_InitRecord _ARGUMENTS(( IDBFile file_id , IDBRecordNumber record , MrmType type , IDBRecordBufferPtr *buffer_return )); extern Cardinal Idb__BM_InitDataRecord _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr *buffer_return )); extern Cardinal Idb__BM_Decommit _ARGUMENTS(( IDBRecordBufferPtr buffer )); extern Cardinal Idb__BM_DecommitAll _ARGUMENTS(( IDBFile file_id )); /* mrmicon.c */ extern Cardinal UrmCreatePixmap _ARGUMENTS(( RGMIconImagePtr icon , Screen *screen , Display *display , Pixel fgpix , Pixel bgpix , Pixel *pixmap , Widget parent )); extern Cardinal UrmCreateBitmap _ARGUMENTS(( RGMIconImagePtr icon , Screen *screen , Display *display , Pixel *pixmap )); extern Cardinal Urm__CW_ReadBitmapFile _ARGUMENTS(( String filename , Screen *screen , Pixel fgint , Pixel bgint , Pixmap *pixmap , Widget parent )); extern Cardinal Urm__MapIconBitmap _ARGUMENTS(( RGMIconImagePtr icon , int srcpix , RGMColorTablePtr ctable , Screen *screen , Display *display , Pixmap *pixmap )); extern Cardinal Urm__MapIconBitmapDepth1 _ARGUMENTS(( RGMIconImagePtr icon , int srcpix , Screen *screen , Display *display , Pixmap *pixmap )); extern Cardinal Urm__MapIconReplace _ARGUMENTS(( RGMIconImagePtr icon , int srcpix , RGMColorTablePtr ctable , Screen *screen , Display *display , Pixmap *pixmap , Widget parent )); extern Cardinal Urm__MapIconAllocate _ARGUMENTS(( RGMIconImagePtr icon , int srcpix , int dstpix , RGMColorTablePtr ctable , Screen *screen , Display *display , Pixmap *pixmap , Widget parent )); extern Cardinal Urm__RealizeColorTable _ARGUMENTS(( Screen *screen , Display *display , Pixel fgpix , Pixel bgpix , RGMColorTablePtr ctable , Widget parent )); extern RGMIconImagePtr UrmCopyAllocatedIconImage _ARGUMENTS(( RGMIconImagePtr dst_icon , RGMIconImagePtr src_icon )); extern Cardinal Urm__UT_GetNamedColorPixel _ARGUMENTS(( Display *display , Colormap cmap , RGMColorDescPtr colorptr , Pixel *pixel_return , Pixel fallback)); extern Cardinal Urm__UT_GetColorPixel _ARGUMENTS(( Display *display , Colormap cmap , RGMColorDescPtr colorptr , Pixel *pixel_return, Pixel fallback)); extern Cardinal UrmIconImageSize _ARGUMENTS(( RGMIconImagePtr icon )); extern Cardinal UrmColorTableSize _ARGUMENTS(( RGMColorTablePtr ctable )); /* mrmientry.c */ extern Cardinal Idb__DB_GetDataEntry _ARGUMENTS(( IDBFile file_id , IDBDataHandle data_entry , URMResourceContextPtr context_id )); extern Cardinal Idb__DB_PutDataEntry _ARGUMENTS(( IDBFile file_id , URMResourceContextPtr context_id , IDBDataHandle *data_entry )); extern Boolean Idb__DB_MatchFilter _ARGUMENTS(( IDBFile file_id , IDBDataHandle data_entry , MrmCode group_filter , MrmCode type_filter )); /* mrmifile.c */ extern Cardinal Idb__FU_OpenFile _ARGUMENTS(( char *name , MrmCode access , MrmOsOpenParamPtr os_ext , IDBLowLevelFilePtr *file_id , char *returned_fname )); extern Cardinal Idb__FU_PutBlock _ARGUMENTS((IDBLowLevelFile *file_id, IDBRecordNumber block_num, char *buffer)) ; extern Cardinal Idb__FU_CloseFile _ARGUMENTS((IDBLowLevelFile *file_id, int del)) ; extern Cardinal Idb__FU_GetBlock _ARGUMENTS(( IDBLowLevelFile *file_id , IDBRecordNumber block_num , char *buffer )); /* mrmiheader.c */ extern Cardinal Idb__HDR_GetHeader _ARGUMENTS(( IDBFile file_id )); extern Cardinal Idb__HDR_InitHeader _ARGUMENTS(( IDBFile file_id , String creator , String creator_version , String module , String module_version )); extern Cardinal Idb__HDR_PutHeader _ARGUMENTS(( IDBFile file_id )); extern Cardinal Idb__HDR_UpdateHeader _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr *buffer )); extern Cardinal Idb__HDR_EnterItem _ARGUMENTS(( IDBFile file_id , IDBResource resource_id , IDBDataHandle data_entry )); extern Cardinal Idb__HDR_ReturnItem _ARGUMENTS(( IDBFile file_id , IDBResource resource_id , Boolean signal_null , IDBDataHandle *entry_return )); extern Cardinal Idb__HDR_NextRID _ARGUMENTS(( IDBFile file_id , IDBResource *res_id_return )); extern Cardinal Idb__HDR_GetDataEntry _ARGUMENTS(( IDBFile file_id , IDBDataHandle data_entry , URMResourceContextPtr context_id )); extern Cardinal Idb__HDR_PutDataEntry _ARGUMENTS(( IDBFile file_id , URMResourceContextPtr context_id , IDBDataHandle *data_entry )); extern Boolean Idb__HDR_MatchFilter _ARGUMENTS(( IDBFile file_id , IDBDataHandle data_entry , MrmCode group_filter , MrmCode type_filter )); /* mrmiindex.c */ extern Cardinal Idb__INX_ReturnItem _ARGUMENTS(( IDBFile file_id , char *index , IDBDataHandle *data_entry )); extern Cardinal Idb__INX_FindIndex _ARGUMENTS(( IDBFile file_id , char *index , IDBRecordBufferPtr *buffer_return , MrmCount *index_return )); extern Cardinal Idb__INX_SearchIndex _ARGUMENTS(( IDBFile file_id , char *index , IDBRecordBufferPtr buffer , MrmCount *index_return )); extern Cardinal Idb__INX_GetBtreeRecord _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr *buffer_return , MrmCount entry_index , Cardinal order )); extern Cardinal Idb__INX_FindResources _ARGUMENTS(( IDBFile file_id , IDBRecordNumber recno , MrmGroup group_filter , MrmType type_filter , URMPointerListPtr index_list )); /* mrmiindexw.c */ extern Cardinal Idb__INX_EnterItem _ARGUMENTS(( IDBFile file_id , char *index , IDBDataHandle data_entry )); extern Cardinal Idb__INX_EnterLeafIndex _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr buffer , char *index , IDBDataHandle data_entry , MrmCount entry_index , Cardinal order )); extern Cardinal Idb__INX_EnterNodeIndex _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr buffer , char *index , IDBDataHandle data_entry , IDBRecordNumber lt_record , IDBRecordNumber gt_record )); extern Cardinal Idb__INX_SplitLeafRecord _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr gt_buffer )); extern Cardinal Idb__INX_SplitNodeRecord _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr gt_buffer )); extern Cardinal Idb__INX_InitRootLeafRecord _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr *buffer_return )); extern Cardinal Idb__INX_InitRootNodeRecord _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr *buffer_return , char *index , IDBDataHandle data_entry , IDBRecordNumber lt_record , IDBRecordNumber gt_record )); extern void Idb__INX_CopyLeafRecord _ARGUMENTS(( IDBIndexLeafRecordPtr dst_recptr , IDBIndexLeafRecordPtr src_recptr )); extern void Idb__INX_CopyNodeRecord _ARGUMENTS(( IDBIndexNodeRecordPtr dst_recptr , IDBIndexNodeRecordPtr src_recptr )); extern void Idb__INX_CollapseLeafRecord _ARGUMENTS(( IDBIndexLeafRecordPtr recptr , MrmCount start , MrmCount end )); extern void Idb__INX_CollapseNodeRecord _ARGUMENTS(( IDBIndexNodeRecordPtr recptr , MrmCount start , MrmCount end )); extern Cardinal Idb__INX_ConfirmNodeSpace _ARGUMENTS(( IDBFile file_id , IDBRecordBufferPtr buffer )); extern Cardinal Idb__INX_SetParent _ARGUMENTS(( IDBFile file_id , IDBRecordNumber parent_record , IDBRecordNumber child_record )); extern Cardinal Idb__INX_FixNodeChildren _ARGUMENTS(( IDBFile file_id , IDBRecordNumber p_record )); /* mrmirid.c */ extern Cardinal Idb__RID_EnterItem _ARGUMENTS(( IDBFile file_id , IDBResource resource_id , IDBDataHandle data_entry )); extern Cardinal Idb__RID_ReturnItem _ARGUMENTS(( IDBFile file_id , IDBResource resource_id , Boolean signal_null , IDBDataHandle *entry_return )); extern Cardinal Idb__RID_NextRID _ARGUMENTS(( IDBFile file_id , IDBResource *res_id_return )); extern Cardinal Idb__RID_AddRecord _ARGUMENTS(( IDBFile file_id )); /* mrmitop.c */ extern Cardinal UrmIdbOpenFileRead _ARGUMENTS(( String name , MrmOsOpenParamPtr os_ext , IDBFile *file_id_return , char *fname_return )); extern Cardinal UrmIdbOpenBuffer _ARGUMENTS(( unsigned char *uid_buffer , IDBFile *file_id_return )); extern Cardinal UrmIdbCloseFile _ARGUMENTS(( IDBFile file_id , Boolean keep_new_file )); extern Cardinal UrmIdbGetIndexedResource _ARGUMENTS(( IDBFile file_id , String index , MrmGroup group_filter , MrmType type_filter , URMResourceContextPtr context_id )); extern Cardinal UrmIdbFindIndexedResource _ARGUMENTS(( IDBFile file_id , MrmGroup group_filter , MrmType type_filter , URMPointerListPtr index_list )); extern Cardinal UrmIdbGetRIDResource _ARGUMENTS(( IDBFile file_id , MrmResource_id resource_id , MrmGroup group_filter , MrmType type_filter , URMResourceContextPtr context_id )); extern Cardinal UrmIdbGetResourceId _ARGUMENTS(( IDBFile file_id , MrmResource_id *resource_id_return )); extern Cardinal Idb__FIL_Valid _ARGUMENTS(( IDBFile file_id )); /* mrmitopw.c */ extern Cardinal UrmIdbOpenFileWrite _ARGUMENTS(( String name , MrmOsOpenParamPtr os_ext , String creator , String creator_version , String module , String module_version , IDBFile *file_id_return , char *fname_return )); extern Cardinal UrmIdbPutIndexedResource _ARGUMENTS(( IDBFile file_id , String index , URMResourceContextPtr context_id )); extern Cardinal UrmIdbPutRIDResource _ARGUMENTS(( IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id )); /* mrmlread.c */ extern Cardinal Urm__FetchLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id , URMPointerListPtr *ctxlist )); extern Cardinal UrmGetIndexedLiteral _ARGUMENTS(( IDBFile file_id , String index , URMResourceContextPtr context_id )); extern Cardinal UrmGetRIDLiteral _ARGUMENTS(( IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id )); extern Cardinal Urm__HGetIndexedLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id , IDBFile *file_id_return )); extern Cardinal UrmHGetIndexedLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id )); /* mrmlwrite.c */ extern Cardinal UrmPutIndexedLiteral _ARGUMENTS(( IDBFile file_id , String index , URMResourceContextPtr context_id )); extern Cardinal UrmPutRIDLiteral _ARGUMENTS(( IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id )); /* mrmmodule.c */ extern Cardinal UrmIFMInitModule _ARGUMENTS(( URMResourceContextPtr context_id , MrmCount num_widget , MrmCode access , MrmCode lock )); extern Cardinal UrmIFMSetTopmost _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal topmost_ndx , String index )); extern Cardinal UrmIFMPutModule _ARGUMENTS(( IDBFile file_id , String index , URMResourceContextPtr context_id )); extern Cardinal UrmIFMHGetModule _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id , IDBFile *file_id_return )); extern Cardinal UrmIFMGetModule _ARGUMENTS(( IDBFile file_id , String index , URMResourceContextPtr context_id )); /* mrmptrlist.c */ extern Cardinal UrmPlistInit _ARGUMENTS(( int size , URMPointerListPtr *list_id_return )); extern Cardinal UrmPlistResize _ARGUMENTS(( URMPointerListPtr list_id , int size )); extern Cardinal UrmPlistFree _ARGUMENTS(( URMPointerListPtr list_id )); extern Cardinal UrmPlistFreeContents _ARGUMENTS(( URMPointerListPtr list_id )); extern Cardinal UrmPlistAppendPointer _ARGUMENTS(( URMPointerListPtr list_id , XtPointer ptr )); extern Cardinal UrmPlistAppendString _ARGUMENTS(( URMPointerListPtr list_id , String stg )); extern MrmCount UrmPlistFindString _ARGUMENTS(( URMPointerListPtr list_id , String stg )); /* mrmtable.c */ extern Cardinal Urm__FixupCompressionTable _ARGUMENTS(( UidCompressionTablePtr ctable , Boolean qfindcldesc, Boolean byte_swapped )); extern Cardinal Urm__FindClassDescriptor _ARGUMENTS(( IDBFile cfile , MrmCode code , char *name , WCIClassDescPtr *class_return )); extern Cardinal Urm__UncompressCode _ARGUMENTS(( IDBFile cfile , MrmCode code , String *stg_return )); extern Boolean Urm__IsSubtreeResource _ARGUMENTS(( IDBFile cfile , MrmCode code )); /* mrmtime.c */ extern void Urm__UT_Time _ARGUMENTS(( char *time_stg )); /* mrmvm.c */ extern String Urm__UT_AllocString _ARGUMENTS(( String stg )); /* mrmwci.c */ extern Cardinal Urm__WCI_RegisterNames _ARGUMENTS(( String *names , XtPointer *values , MrmCount num_cb )); extern Cardinal Urm__WCI_UnregisterName _ARGUMENTS(( String name )); extern Cardinal Urm__WCI_LookupClassDescriptor _ARGUMENTS(( String class_name , WCIClassDescPtr *class_return )); extern WidgetClass Urm__WCI_GetClRecOfName _ARGUMENTS(( String clname )); extern Cardinal Urm__WCI_LookupRegisteredName _ARGUMENTS(( String name , XtPointer *value_return )); extern void hash_initialize _ARGUMENTS(( URMHashTableEntryPtr *htable , Boolean *initflag )); extern URMHashTableEntryPtr hash_find_name _ARGUMENTS(( URMHashTableEntryPtr *htable , char *c_text )); extern URMHashTableEntryPtr hash_insert_name _ARGUMENTS(( URMHashTableEntryPtr *htable , char *c_text )); extern URMHashTableEntryPtr hash_delete_name _ARGUMENTS(( URMHashTableEntryPtr *htable , char *c_text )); /* mrmwcrw.c */ extern Cardinal UrmCreateWidgetTree _ARGUMENTS(( URMResourceContextPtr context_id , Widget parent , MrmHierarchy hierarchy_id , IDBFile file_id , String ov_name , ArgList ov_args , Cardinal ov_num_args , MrmCode keytype , String kindex , MrmResource_id krid , MrmManageFlag manage , URMPointerListPtr *svlist , URMResourceContextPtr wref_id , Widget *w_return )); extern Cardinal UrmCreateWidgetInstance _ARGUMENTS((URMResourceContextPtr context_id , Widget parent , MrmHierarchy hierarchy_id , IDBFile file_id , String ov_name , ArgList ov_args , Cardinal ov_num_args , MrmCode keytype , String kindex , MrmResource_id krid , MrmManageFlag manage, URMPointerListPtr *svlist , URMResourceContextPtr wref_id , Widget *w_return, char **w_name)); extern Cardinal UrmCreateOrSetWidgetInstance _ARGUMENTS((URMResourceContextPtr context_id , Widget parent , MrmHierarchy hierarchy_id , IDBFile file_id , String ov_name , ArgList ov_args , Cardinal ov_num_args , MrmCode keytype , String kindex , MrmResource_id krid , MrmManageFlag manage , URMPointerListPtr *svlist , URMResourceContextPtr wref_id , Widget *w_return, char **w_name)); extern Cardinal UrmSetWidgetInstance _ARGUMENTS((URMResourceContextPtr context_id , Widget parent , MrmHierarchy hierarchy_id , IDBFile file_id , ArgList ov_args , Cardinal ov_num_args , MrmCode keytype , String kindex , MrmResource_id krid , MrmManageFlag manage , URMPointerListPtr *svlist , URMResourceContextPtr wref_id , Widget *w_return )); extern void Urm__CW_CreateArglist _ARGUMENTS(( Widget parent , RGMWidgetRecordPtr widgetrec , RGMArgListDescPtr argdesc , URMPointerListPtr ctxlist , URMPointerListPtr cblist, URMPointerListPtr ftllist , MrmHierarchy hierarchy_id , IDBFile file_id , ArgList args , URMPointerListPtr *svlist , URMResourceContextPtr wref_id , Cardinal *num_used )); extern long Urm__CW_EvaluateValOrOffset _ARGUMENTS(( MrmType reptype , XtPointer bufptr , long ival , MrmOffset offset )); extern Cardinal Urm__CW_FixupValue _ARGUMENTS(( long val , MrmType reptype , XtPointer bufptr , IDBFile file_id , Boolean *swap_needed)); extern String Urm__CW_DisplayToString _ARGUMENTS(( char *val , String add_string , int add_string_size )); extern Cardinal Urm__CW_ConvertValue _ARGUMENTS(( Widget parent, long *val , MrmType reptype , MrmType cvttype , Display *display , MrmHierarchy hierarchy_id , URMPointerListPtr ftllist )); extern void Urm__CW_SafeCopyValue _ARGUMENTS(( long *val , MrmType reptype , URMPointerListPtr cblist, int vec_count , int vec_size )); extern void UrmDestroyCallback _ARGUMENTS((Widget w , URMPointerListPtr list_id , XmAnyCallbackStruct *reason)); extern Cardinal Urm__CW_ReadLiteral _ARGUMENTS(( RGMResourceDescPtr resptr , MrmHierarchy hierarchy_id , IDBFile file_id , URMPointerListPtr ctxlist , MrmType *type , long *val , int *vec_count , IDBFile *act_file_id , int *vec_size )); extern Cardinal Urm__CW_LoadIconImage _ARGUMENTS(( RGMIconImagePtr iconptr , XtPointer bufptr , MrmHierarchy hierarchy_id , IDBFile file_id , URMPointerListPtr ctxlist )); extern Cardinal Urm__CW_FixupCallback _ARGUMENTS(( Widget parent , XtPointer bufptr , RGMCallbackDescPtr cbdesc , URMPointerListPtr ctxlist , URMPointerListPtr cblist , MrmHierarchy hierarchy_id , IDBFile file_id , URMResourceContextPtr wref_id)); extern Cardinal Urm__CW_LoadWidgetResource _ARGUMENTS(( Widget parent , RGMWidgetRecordPtr widgetrec , RGMResourceDescPtr resptr , URMPointerListPtr ctxlist , MrmHierarchy hierarchy_id , IDBFile file_id , URMPointerListPtr *svlist , URMResourceContextPtr wref_id , long *val )); extern void Urm__CW_GetPixmapParms _ARGUMENTS(( Widget w , Screen **screen , Display **display , Pixel *fgint , Pixel *bgint )); extern RGMCallbackDescPtr Urm__CW_TranslateOldCallback _ARGUMENTS(( OldRGMCallbackDescPtr oldptr)); /* mrmwcrwr.c */ extern Cardinal UrmCWRInit _ARGUMENTS(( URMResourceContextPtr context_id , String name , MrmCode access , MrmCode lock )); extern Cardinal UrmCWRSetClass _ARGUMENTS(( URMResourceContextPtr context_id, MrmCode type, String urm_class, unsigned long variety )); extern Cardinal UrmCWRInitArglist _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal nargs )); extern Cardinal UrmCWRSetCompressedArgTag _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal arg_ndx , MrmCode tag , MrmCode related_tag )); extern Cardinal UrmCWRSetUncompressedArgTag _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal arg_ndx , String tag )); extern Cardinal UrmCWRSetArgValue _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal arg_ndx , MrmCode type , unsigned long arg_val )); extern Cardinal UrmCWRSetArgResourceRef _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal arg_ndx , MrmCode access , MrmGroup group , MrmCode type , MrmCode key_type , String index , MrmResource_id resource_id )); extern Cardinal UrmCWRSetArgChar8Vec _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal arg_ndx , String *stg_vec , MrmCount num_stg )); extern Cardinal UrmCWRSetArgCStringVec _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal arg_ndx , XmString *cstg_vec , MrmCount num_cstg )); extern Cardinal UrmCWRSetArgCallback _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal arg_ndx , Cardinal nitems , MrmOffset *cb_offs_return )); extern Cardinal UrmCWRSetCallbackItem _ARGUMENTS(( URMResourceContextPtr context_id , MrmOffset cb_offs , Cardinal item_ndx , String routine , MrmCode type , unsigned long itm_val )); extern Cardinal UrmCWRSetCallbackItemRes _ARGUMENTS(( URMResourceContextPtr context_id , MrmOffset cb_offs , Cardinal item_ndx , String routine , MrmGroup group , MrmCode access , MrmCode type , MrmCode key_type , String index , MrmResource_id resource_id )); extern Cardinal UrmCWRSetExtraArgs _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal nextra )); extern Cardinal UrmCWRInitChildren _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal nchildren )); extern Cardinal UrmCWRSetChild _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal child_ndx , Boolean manage , MrmCode access , MrmCode key_type , String index , MrmResource_id resource_id )); extern Cardinal UrmCWRSetComment _ARGUMENTS(( URMResourceContextPtr context_id , String comment )); extern Cardinal UrmCWRSetCreationCallback _ARGUMENTS(( URMResourceContextPtr context_id , Cardinal nitems , MrmOffset *cb_offs_return )); extern Cardinal UrmCWR__AppendString _ARGUMENTS(( URMResourceContextPtr context_id , String stg , MrmOffset *offset )); extern Cardinal UrmCWR__AppendCString _ARGUMENTS(( URMResourceContextPtr context_id , XmString cstg , MrmOffset *offset )); extern Cardinal UrmCWR__AppendWcharString _ARGUMENTS(( URMResourceContextPtr context_id , wchar_t *wcs , MrmOffset *offset )); extern Cardinal UrmCWR__GuaranteeSpace _ARGUMENTS(( URMResourceContextPtr context_id , MrmSize delta , MrmOffset *offset , char **addr )); extern Cardinal UrmCWR__AppendResource _ARGUMENTS(( URMResourceContextPtr context_id , MrmCode access , MrmCode group , MrmCode type , MrmCode key_type , String index , MrmResource_id resource_id , MrmOffset *offset )); extern Cardinal UrmCWR__ValidateContext _ARGUMENTS(( URMResourceContextPtr context_id , String routine)); extern Cardinal UrmCWR__BindArgPtrs _ARGUMENTS(( URMResourceContextPtr context_id , String routine , Cardinal argndx , RGMArgListDescPtr *descptr , RGMArgumentPtr *argptr )); extern Cardinal UrmCWR__BindCallbackPtrs _ARGUMENTS(( URMResourceContextPtr context_id , String routine , MrmOffset descoffs , Cardinal itemndx , RGMCallbackDescPtr *descptr , RGMCallbackItemPtr *itmptr )); /* mrmwread.c */ extern Cardinal UrmHGetWidget _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , URMResourceContextPtr context_id , IDBFile *file_id_return )); extern Cardinal UrmGetIndexedWidget _ARGUMENTS(( IDBFile file_id , String index , URMResourceContextPtr context_id )); extern Cardinal UrmGetRIDWidget _ARGUMENTS(( IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id )); /* mrmwrefs.c */ extern Cardinal Urm__CW_InitWRef _ARGUMENTS(( URMResourceContextPtr *wref_id )); extern Cardinal Urm__CW_AddWRef _ARGUMENTS(( URMResourceContextPtr wref_id , String w_name , Widget w_id )); extern Cardinal Urm__CW_FindWRef _ARGUMENTS(( URMResourceContextPtr wref_id , String w_name , Widget *w_id_return )); extern void Urm__CW_AppendSVWidgetRef _ARGUMENTS(( IDBFile file_id , URMPointerListPtr *svlist , String w_name , MrmCode argtag , String argname )); extern void Urm__CW_AppendCBSVWidgetRef _ARGUMENTS((IDBFile file_id, URMPointerListPtr *svlist, RGMCallbackDescPtr cbptr, MrmCode argtag, String argname)); extern void Urm__CW_UpdateSVWidgetRef _ARGUMENTS(( URMPointerListPtr *svlist , Widget cur_id )); extern void Urm__CW_ResolveSVWidgetRef _ARGUMENTS(( URMPointerListPtr *svlist , String cur_name , Widget cur_id )); extern void Urm__CW_FreeSetValuesDesc _ARGUMENTS((URMSetValuesDescPtr svdesc)); /* mrmwvalues.c */ extern Cardinal UrmFetchSetValues _ARGUMENTS(( MrmHierarchy hierarchy_id , Widget w , ArgList args , Cardinal num_args )); /* mrmwwrite.c */ extern Cardinal UrmPutIndexedWidget _ARGUMENTS(( IDBFile file_id , String index , URMResourceContextPtr context_id )); extern Cardinal UrmPutRIDWidget _ARGUMENTS(( IDBFile file_id , MrmResource_id resource_id , URMResourceContextPtr context_id )); /* mrmiswap.c */ extern Cardinal Idb__BM_SwapRecordBytes _ARGUMENTS(( IDBRecordBufferPtr buffer )); extern unsigned Urm__SwapValidation _ARGUMENTS(( unsigned validation )); extern Cardinal Urm__SwapRGMResourceDesc _ARGUMENTS(( RGMResourceDescPtr res_desc )); extern Cardinal Urm__SwapRGMCallbackDesc _ARGUMENTS(( RGMCallbackDescPtr callb_desc, RGMWidgetRecordPtr widget_rec )); extern Cardinal Urm__SwapRGMWidgetRecord _ARGUMENTS(( RGMWidgetRecordPtr widget_rec )); /* * string copy macro */ /* If the alignment characteristics of your machine are right, these may be faster */ #ifdef UNALIGNED #define UrmBCopy(src, dst, size) \ if (size == sizeof(long)) \ *((long *) (dst)) = *((long *) (src)); \ else if (size == sizeof(int)) \ *((int *) (dst)) = *((int *) (src)); \ else if (size == sizeof(short)) \ *((short *) (dst)) = *((short *) (src)); \ else if (size == sizeof(char)) \ *((char *) (dst)) = *((char *) (src)); \ else \ memmove((char *) (dst), (char *) (src), (int) (size)); #else #define UrmBCopy(src, dst, size) \ memmove((char *) (dst), (char *) (src), (int) (size)); #endif /* UNALIGNED */ /******** Conditionally defined macros for thread_safe DtTerm ******/ #ifdef XTHREADS #define _MrmWidgetToAppContext(w) \ XtAppContext app = XtWidgetToApplicationContext(w) #define _MrmDisplayToAppContext(d) \ XtAppContext app = XtDisplayToApplicationContext(d) #define _MrmAppLock(app) XtAppLock(app) #define _MrmAppUnlock(app) XtAppUnlock(app) #define _MrmProcessLock() XtProcessLock() #define _MrmProcessUnlock() XtProcessUnlock() #else /* XTHREADS */ #define _MrmWidgetToAppContext(w) #define _MrmDisplayToAppContext(d) #define _MrmAppLock(app) #define _MrmAppUnlock(app) #define _MrmProcessLock() #define _MrmProcessUnlock() #endif /* XTHREADS */ #endif /* Mrm_H */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Mrm/MrmIbuffer.c0000644000175000017500000004600313145162623013274 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmIbuffer.c /main/16 1996/11/13 13:55:44 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB Facility * Buffer management routines * * ABSTRACT: * * These routines manage the buffer pool for all IDB files, and manage * reading and writing actual file records into these buffers on request. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * Idb__BM_InitBufferVector - Allocates and initializes * the buffer vector * * Idb__BM_GetBuffer - Acquire a free buffer * * Idb__BM_MarkActivity - Mark a buffer as having seen activity * * Idb__BM_MarkModified - Mark a buffer as modified for write * * Idb__BM_GetRecord - Get a record into some buffer * * Idb__BM_InitRecord - Initialize a new record into * some buffer * * Idb__BM_InitDataRecord - Initialize a new data record into * some buffer * * Idb__BM_Decommit - Through with buffer contents * * Idb__BM_DecommitAll - Decommit all buffers for some file */ /* * * OWN VARIABLE DECLARATIONS * */ /* * This module manages a pool of buffers for all open IDB files. The pool * is located and managed via the following globals. */ /* * The following defines the number of buffers in the buffer pool. Once * the pool is initialized, this number is invariant (currently). This * variable will be accessible via currently undefined means for applications * to tailor the buffer pool size at startup. */ externaldef(idb__buffer_pool_size) int idb__buffer_pool_size = 8 ; /* * The following pointer locates a vector of pointers to buffers. This pointer * is initially NULL. The first request for a buffer detects that the buffer * has not been allocated, and does the following: * o Allocate a vector of buffer pointers (IDBRecordBufferPtr) containing * the number of entries specified in idb__buffer_pool_size. * * Thereafter, this vector locates the buffer pool. */ static IDBRecordBufferPtr idb__buffer_pool_vec = NULL ; /* * The following counter is used to maintain the activity count in all * buffers. */ static long int idb__buffer_activity_count = 1 ; /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_InitBufferVector is responsible for initializaing * the buffer pool. This routine allocates the vector of record * buffers, but does not allocate the actual buffer for each * record, which is done on demand. * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_InitBufferVector (void) { /* * Local variables */ Cardinal ndx ; /* loop variable */ IDBRecordBufferPtr bufptr ; /* entry into buffer pool vector */ idb__buffer_pool_vec = (IDBRecordBufferPtr) XtMalloc (idb__buffer_pool_size*sizeof(IDBRecordBuffer)) ; if ( idb__buffer_pool_vec == NULL ) return Urm__UT_Error ("Idb__BM_InitBufferVector", _MrmMMsg_0000, NULL, NULL, MrmFAILURE) ; for ( ndx=0,bufptr=idb__buffer_pool_vec ; ndxvalidation = IDBRecordBufferValid; bufptr->activity = 0 ; bufptr->access = 0 ; bufptr->cur_file = NULL ; bufptr->modified = FALSE ; bufptr->IDB_record = NULL ; } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_GetBuffer acquires a buffer from the buffer pool. The * buffer chosen is some buffer with the lowest activity count. If * necessary, its contents are written to disk. Note that a buffer * which has been decommitted (activity count = 0) may be used * immediately - a search for a buffer with a lower activity count * is not required. * * This routine is responsible for initializaing the buffer pool if * it is not initialized. It is also responsible for acquiring * a record buffer if a buffer pool vector entry is needed but has none. * * FORMAL PARAMETERS: * * file_id Open IDB file * buffer_return Returns a free buffer, contents undefined * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_GetBuffer (IDBFile file_id, IDBRecordBufferPtr *buffer_return) { /* * Local macro to complete allocation of a buffer to a file, and * mark its activity. */ #define _IDB_Getbuffer_return() \ { \ (*buffer_return)->cur_file = file_id; \ (*buffer_return)->access = file_id->access; \ Idb__BM_MarkActivity (*buffer_return); \ return MrmSUCCESS; \ } /* * Local variables */ Cardinal result ; /* function results */ int ndx ; /* loop index */ long int lowest ; /* lowest activity count found */ IDBRecordBufferPtr curbuf ; /* current buffer being examined */ /* * If the buffer pool is uninitialized, allocate it and * return the first buffer in the pool. Else search the buffer pool for the * buffer with the lowest activity. Decommited/0 activity buffers can * be returned immediately. */ if (idb__buffer_pool_vec == NULL) { result = Idb__BM_InitBufferVector () ; if ( result != MrmSUCCESS ) return result ; *buffer_return = idb__buffer_pool_vec ; } else { lowest = idb__buffer_activity_count; for ( ndx=0,curbuf=idb__buffer_pool_vec ; ndxactivity == 0 ) { *buffer_return = curbuf ; break ; } if ( curbuf->activity < lowest ) { *buffer_return = curbuf ; lowest = curbuf->activity ; } } } /* * Allocate a record buffer if required, and return immediately if * the buffer is decommitted or not yet used. */ if ( (*buffer_return)->IDB_record == NULL ) { (*buffer_return)->IDB_record = (IDBDummyRecord *) XtMalloc(sizeof(IDBDummyRecord)) ; if ( (*buffer_return)->IDB_record == NULL ) return Urm__UT_Error ("Idb__BM_GetBuffer", _MrmMMsg_0001, NULL, NULL, MrmFAILURE) ; _IDB_Getbuffer_return (); } if ( (*buffer_return)->activity == 0 ) _IDB_Getbuffer_return (); /* * We have set the buffer pointer. See if it needs to be updated on * disk, and do so if required. */ if ( ((*buffer_return)->access == URMWriteAccess) && ((*buffer_return)->modified) ) { result = Idb__BM_Decommit (*buffer_return) ; if ( result != MrmSUCCESS ) return result ; } /* * Allocate the buffer to the file, and return. */ _IDB_Getbuffer_return (); } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_MarkActivity asserts that the buffer has seen some activity, * and updates its activity count. This is done by storing the current * idb__buffer_activity_count++ in the buffer. * * FORMAL PARAMETERS: * * buffer Record buffer to mark as modified * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_MarkActivity (IDBRecordBufferPtr buffer) { if ( ! Idb__BM_Valid(buffer) ) return Urm__UT_Error ("Idb__BM_MarkActivity", _MrmMMsg_0002, NULL, NULL, MrmNOT_VALID) ; buffer->activity = idb__buffer_activity_count++ ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_MarkModified asserts that the buffer has been modified, * and sets its modify flag. Its activity count is updated. * * FORMAL PARAMETERS: * * buffer Record buffer to mark as modified * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_MarkModified (IDBRecordBufferPtr buffer) { if ( ! Idb__BM_Valid(buffer) ) return Urm__UT_Error ("Idb__BM_MarkModified", _MrmMMsg_0002, NULL, NULL, MrmNOT_VALID) ; buffer->activity = idb__buffer_activity_count++ ; buffer->modified = TRUE ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_GetRecord reads a record from an open IDB file into a buffer. * If the record is already available in some buffer, then that buffer is * returned without re-reading the record from disk. Otherwise, a buffer is * acquired, the record read into it, and the buffer is returned. The * buffer's activity count is updated. * * FORMAL PARAMETERS: * * file_id Open IDB file * record The desired record number * buffer_return Returns buffer containing record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND record doesn't exist * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_GetRecord (IDBFile file_id, IDBRecordNumber record, IDBRecordBufferPtr *buffer_return) { /* * Local variables */ Cardinal result ; /* function results */ int ndx ; /* loop index */ IDBRecordBufferPtr curbuf ; /* current buffer being examined */ unsigned char *buf_src; /* tmp pointer to location in uid buffer */ /* * If buffer pool is unallocated, get a buffer (which WILL allocate it), * and read the record into that. Else see if the record is already in * memory, and return it if so. If the record is not found, get a buffer * to read it into. We exit this if statement with a buffer ready for * the read operation. */ if ( idb__buffer_pool_vec == NULL ) { result = Idb__BM_GetBuffer (file_id, buffer_return) ; if ( result != MrmSUCCESS ) return result ; } else { for ( ndx=0,curbuf=idb__buffer_pool_vec ; ndxcur_file==file_id) && (curbuf->IDB_record->header.record_num==record) ) { *buffer_return = curbuf ; Idb__BM_MarkActivity (*buffer_return) ; return MrmSUCCESS ; } } result = Idb__BM_GetBuffer (file_id, buffer_return) ; if ( result != MrmSUCCESS ) return result ; } /* * Read the record into the buffer. */ if ( file_id->in_memory ) { buf_src = file_id->uid_buffer + (record-1)*IDBRecordSize; UrmBCopy(buf_src, (*buffer_return)->IDB_record, IDBRecordSize); result = MrmSUCCESS; } else result = Idb__FU_GetBlock(file_id->lowlevel_id, record, (char*)(*buffer_return)->IDB_record) ; if ( result != MrmSUCCESS ) return Urm__UT_Error ("Idb__BM_GetRecord", _MrmMMsg_0003, file_id, NULL, result) ; file_id->get_count++ ; /* * Validate the record, this is the first routine that is called to read * from a newly opened file. If the byte order is different, we find it * here. */ if ( (*buffer_return)->IDB_record->header.validation != IDBRecordHeaderValid ) { swapbytes( (*buffer_return)->IDB_record->header.validation ); if ((*buffer_return)->IDB_record->header.validation == IDBRecordHeaderValid) { /* must be a file needing byte swapping */ file_id->byte_swapped = TRUE; Idb__BM_SwapRecordBytes (*buffer_return); Idb__BM_MarkActivity (*buffer_return); return MrmSUCCESS ; } /* byte swapping has done no good, return error */ return Urm__UT_Error("Idb__BM_GetRecord", _MrmMMsg_0005, file_id, NULL, MrmNOT_VALID) ; } /* * Record successfully read */ Idb__BM_MarkActivity (*buffer_return) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_InitRecord initializes a new record for the file. A buffer * is acquired, and the record number and record type set. The record * number may be specified; if the record number given is <= 0, then the * next available record is taken from the file header. The next * available record number is updated to the new record number if it is * greater than the current value. The record is marked for write access, * and as modified. It is not written to disk. The buffer's activity * count is updated. * * FORMAL PARAMETERS: * * file_id Open IDB file * record The desired record number. This will be a new record in * the file * type The record type, from IDBrt... * buffer_return Returns buffer initialized for record, with type set. * Access is URMWriteAccess, modified. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_InitRecord (IDBFile file_id, IDBRecordNumber record, MrmType type, IDBRecordBufferPtr *buffer_return) { if ((Idb__BM_GetBuffer (file_id, buffer_return)) != MrmSUCCESS) return MrmFAILURE; /* * Set the record number if required. Since the last_record parameter * records the last record currently in use, it must be incremented * before use to give the new last record. */ if (record <= 0) record = ++file_id->last_record; if (record > file_id->last_record) file_id->last_record = record; (*buffer_return)->IDB_record->header.validation = IDBRecordHeaderValid ; (*buffer_return)->IDB_record->header.record_num = record ; (*buffer_return)->IDB_record->header.record_type = type ; (*buffer_return)->access = file_id->access ; (*buffer_return)->cur_file = file_id ; (*buffer_return)->modified = TRUE ; Idb__BM_MarkActivity (*buffer_return) ; /* * Update the record type counter in the file header */ file_id->rt_counts[type]++ ; /* * Successfully initialized */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_InitDataRecord initializes a new data record for the file. * A buffer is acquired, and the record number and record type set. * The record number may be specified; if the record number given * is <= 0, then the next available record is taken from the file * header. The next available record number is updated to the * new record number if it is greater than the current value. The * record is marked for write access, and as modified. It is not * written to disk. The buffer's activity count is updated. This * routine is nearly identical to InitRecord. * * FORMAL PARAMETERS: * * file_id Open IDB file * buffer_return Returns buffer initialized for record, with type set. * Access is URMWriteAccess, modified. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_InitDataRecord (IDBFile file_id, IDBRecordBufferPtr *buffer_return) { /* * Local variables */ Cardinal result ; /* function results */ IDBDataRecordPtr data_rec; /* data record specific */ /* * Get a new record */ result = Idb__BM_InitRecord (file_id, 0, IDBrtData, buffer_return) ; if ( result != MrmSUCCESS ) return result ; /* * Set the last data record pointer in the file */ file_id->last_data_record = _IdbBufferRecordNumber (*buffer_return) ; /* * Initialize the record contents */ data_rec = (IDBDataRecord *) (*buffer_return)->IDB_record; data_rec->data_header.free_ptr = 0 ; data_rec->data_header.free_count = IDBDataFreeMax ; data_rec->data_header.num_entry = 0 ; data_rec->data_header.last_entry = 0 ; Idb__BM_MarkActivity (*buffer_return) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_Decommit asserts that the buffer contents are no longer * required to be in memory. If the buffer is marked for write access * and as modified, it is written to disk. Then the modified flag is * reset and the activity count set to 0 (least value). * * Note that GetRecord may legally re-acquire a decommitted buffer. * * FORMAL PARAMETERS: * * buffer Record buffer to decommit * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_Decommit (IDBRecordBufferPtr buffer) { /* * Local variables */ Cardinal result ; /* function results */ if ( ! Idb__BM_Valid(buffer) ) return Urm__UT_Error ("Idb__BM_Decommit", _MrmMMsg_0002, NULL, NULL, MrmNOT_VALID) ; if ((buffer->access == URMWriteAccess) && (buffer->modified == TRUE)) { result = Idb__FU_PutBlock (buffer->cur_file->lowlevel_id, buffer->IDB_record->header.record_num, (char*)buffer->IDB_record) ; if ( result != MrmSUCCESS ) return Urm__UT_Error ("Idb__BM_Decommit", _MrmMMsg_0004, NULL, NULL, MrmNOT_VALID) ; buffer->cur_file->put_count++ ; buffer->activity = 0; buffer->modified = FALSE; } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_DecommitAll decommits all the buffers currently allocated * for a file. It returns an error immediately if there is any * problem decommitting any buffer. * * Since this routine removes all buffers for a file in prepration * for closing it, it also wipes out the file pointer in each buffer. * * FORMAL PARAMETERS: * * file_id IDB file for which to write all modified buffers * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_DecommitAll (IDBFile file_id) { /* * Local variables */ Cardinal result ; /* function result */ Cardinal ndx ; /* loop variable */ IDBRecordBufferPtr curbuf ; /* ptr to element in buff pool */ if ( idb__buffer_pool_vec == NULL ) return MrmFAILURE; for ( ndx=0,curbuf=idb__buffer_pool_vec ; ndxcur_file == file_id) { result = Idb__BM_Decommit (curbuf) ; if ( result != MrmSUCCESS ) return result ; curbuf->cur_file = NULL ; } } return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/Mrmtime.c0000644000175000017500000000436713145162623012657 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmtime.c /main/19 1996/11/21 20:03:40 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * System-dependent routines dealing with time and dates. * *-- */ /* * * INCLUDE FILES * */ #define X_INCLUDE_TIME_H #define XOS_USE_XT_LOCKING #ifndef NEED_XOS_R_H #include /* Must precede Mrm/MrmAppl.h and Mrm/Mrm.h to avoid possible redefinitions of MIN() and MAX(). */ #else #include #endif #include #include /* * * TABLE OF CONTENTS * * Urm__UT_Time - Get current time as a string * */ /* *++ * * PROCEDURE DESCRIPTION: * * This routine writes the current date/time string into a buffer * * FORMAL PARAMETERS: * * time_stg location into which to copy time string. The * length of this buffer should be at least * URMhsDate1 * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Urm__UT_Time (char *time_stg) { #if defined(__STDC__) time_t timeval; #else long timeval; #endif /* __STDC__ */ _Xctimeparams ctime_buf; char *result; time (&timeval); if ((result = _XCtime(&timeval, ctime_buf)) != NULL) strcpy(time_stg, result); else *time_stg = 0; } motif-2.3.8/lib/Mrm/Mrminit.c0000644000175000017500000003551613145162623012664 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Mrminit.c /main/14 1999/05/19 15:25:33 mgreess $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This contains only the top-level routine MrmIntialize. It can be * modified by vendors as needed to add or remove widgets being \ * initialized for URM facilities. This routine is normally accessible to * and used by an application at runtime to access URM facilities. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include #include #include #include #include #include #ifdef DXM_V11 #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * * TABLE OF CONTENTS * * MrmInitialize Initialize URM internals before use * */ /* * * OWN VARIABLE DECLARATIONS * */ /* * The following flag is set to indicate successful URM initialization */ static Boolean urm__initialize_complete = FALSE; /* *++ * PROCEDURE DESCRIPTION: * * MrmInitialize must be called in order to prepare an application to * use URM widget fetching facilities. It initializes the internal data * structures (creating the mapping from class codes to the creation * routine for each builtin widget class) which URM needs in order to * successfully perform type conversion on arguments, and successfully * access widget creation facilities. MrmInitialize must be called before * any widgets are created, whether by URM's fetch mechanisms or directly * by the application. It may be called before or after XtInitialize, and * multiple calls after the first one are benign (no-ops). * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void MrmInitialize (void) { /* * Local variables */ _MrmProcessLock(); /* * Initialize only once */ if ( urm__initialize_complete ) { _MrmProcessUnlock(); return ; } /* * Initialize the class descriptors for all the known widgets. */ #ifdef DXM_V11 MrmRegisterClass (0, NULL, "DXmCreateHelpWidget", DXmCreateHelp, (WidgetClass)&dxmhelpwidgetclassrec); #endif MrmRegisterClass (0, NULL, "XmCreateArrowButton", XmCreateArrowButton, (WidgetClass)&xmArrowButtonClassRec); MrmRegisterClass (0, NULL, "XmCreateArrowButtonGadget", XmCreateArrowButtonGadget, (WidgetClass)&xmArrowButtonGadgetClassRec); MrmRegisterClass (0, NULL, "XmCreateBulletinBoard", XmCreateBulletinBoard, (WidgetClass)&xmBulletinBoardClassRec); MrmRegisterClass (0, NULL, "XmCreateBulletinBoardDialog", XmCreateBulletinBoardDialog, (WidgetClass)&xmBulletinBoardClassRec); MrmRegisterClass (0, NULL, "XmCreateButtonBox", XmCreateButtonBox, (WidgetClass)&xmButtonBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateCascadeButton", XmCreateCascadeButton, (WidgetClass)&xmCascadeButtonClassRec); MrmRegisterClass (0, NULL, "XmCreateCascadeButtonGadget", XmCreateCascadeButtonGadget, (WidgetClass)&xmCascadeButtonGadgetClassRec); MrmRegisterClass (0, NULL, "XmCreateColumn", XmCreateColumn, (WidgetClass)&xmColumnClassRec); MrmRegisterClass (0, NULL, "XmCreateCommand", XmCreateCommand, (WidgetClass)&xmCommandClassRec); MrmRegisterClass (0, NULL, "XmCreateCommandDialog", XmCreateCommandDialog, (WidgetClass)&xmCommandClassRec); MrmRegisterClass (0, NULL, "XmCreateColorSelector", XmCreateColorSelector, (WidgetClass)&xmColorSelectorClassRec); MrmRegisterClass (0, NULL, "XmCreateDataField", XmCreateDataField, (WidgetClass)&xmDataFieldClassRec); MrmRegisterClass (0, NULL, "XmCreateDialogShell", XmCreateDialogShell, (WidgetClass)&xmDialogShellClassRec); MrmRegisterClass (0, NULL, "XmCreateDrawingArea", XmCreateDrawingArea, (WidgetClass)&xmDrawingAreaClassRec); MrmRegisterClass (0, NULL, "XmCreateMultiList", XmCreateMultiList, (WidgetClass)&xmMultiListClassRec); MrmRegisterClass (0, NULL, "XmCreateDrawnButton", XmCreateDrawnButton, (WidgetClass)&xmDrawnButtonClassRec); MrmRegisterClass (0, NULL, "XmCreateFileSelectionBox", XmCreateFileSelectionBox, (WidgetClass)&xmFileSelectionBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateFileSelectionDialog", XmCreateFileSelectionDialog, (WidgetClass)&xmFileSelectionBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateForm", XmCreateForm, (WidgetClass)&xmFormClassRec); MrmRegisterClass (0, NULL, "XmCreateFontSelector", XmCreateFontSelector, (WidgetClass)&xmFontSelectorClassRec); MrmRegisterClass (0, NULL, "XmCreateFormDialog", XmCreateFormDialog, (WidgetClass)&xmFormClassRec); MrmRegisterClass (0, NULL, "XmCreateFrame", XmCreateFrame, (WidgetClass)&xmFrameClassRec); MrmRegisterClass (0, NULL, "XmCreateIconButton", XmCreateIconButton, (WidgetClass)&xmIconButtonClassRec); MrmRegisterClass (0, NULL, "XmCreateIconBox", XmCreateIconBox, (WidgetClass)&xmIconBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateLabel", XmCreateLabel, (WidgetClass)&xmLabelClassRec); MrmRegisterClass (0, NULL, "XmCreateLabelGadget", XmCreateLabelGadget, (WidgetClass)&xmLabelGadgetClassRec); MrmRegisterClass (0, NULL, "XmCreateList", XmCreateList, (WidgetClass)&xmListClassRec); MrmRegisterClass (0, NULL, "XmCreateScrolledList", XmCreateScrolledList, (WidgetClass)&xmListClassRec); MrmRegisterClass (0, NULL, "XmCreateMainWindow", XmCreateMainWindow, (WidgetClass)&xmMainWindowClassRec); MrmRegisterClass (0, NULL, "XmCreateMenuShell", XmCreateMenuShell, (WidgetClass)&xmMenuShellClassRec); MrmRegisterClass (0, NULL, "XmCreateMessageBox", XmCreateMessageBox, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateOutline", XmCreateOutline, (WidgetClass)&xmOutlineClassRec); MrmRegisterClass (0, NULL, "XmCreateMessageDialog", XmCreateMessageDialog, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateErrorDialog", XmCreateErrorDialog, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateInformationDialog", XmCreateInformationDialog, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateQuestionDialog", XmCreateQuestionDialog, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateTemplateDialog", XmCreateTemplateDialog, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateWarningDialog", XmCreateWarningDialog, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateWorkingDialog", XmCreateWorkingDialog, (WidgetClass)&xmMessageBoxClassRec); MrmRegisterClass (0, NULL, "XmCreatePushButton", XmCreatePushButton, (WidgetClass)&xmPushButtonClassRec); MrmRegisterClass (0, NULL, "XmCreatePushButtonGadget", XmCreatePushButtonGadget, (WidgetClass)&xmPushButtonGadgetClassRec); MrmRegisterClass (0, NULL, "XmCreateRowColumn", XmCreateRowColumn, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreateWorkArea", XmCreateWorkArea, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreateRadioBox", XmCreateRadioBox, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreateMenuBar", XmCreateMenuBar, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreateOptionMenu", XmCreateOptionMenu, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreatePopupMenu", XmCreatePopupMenu, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreatePulldownMenu", XmCreatePulldownMenu, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreateSimpleCheckBox", XmCreateSimpleCheckBox, (WidgetClass)&xmRowColumnClassRec); MrmRegisterClass (0, NULL, "XmCreateScale", XmCreateScale, (WidgetClass)&xmScaleClassRec); MrmRegisterClass (0, NULL, "XmCreateScrolledWindow", XmCreateScrolledWindow, (WidgetClass)&xmScrolledWindowClassRec); MrmRegisterClass (0, NULL, "XmCreateScrollBar", XmCreateScrollBar, (WidgetClass)&xmScrollBarClassRec); MrmRegisterClass (0, NULL, "XmCreateSelectionBox", XmCreateSelectionBox, (WidgetClass)&xmSelectionBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateSelectionDialog", XmCreateSelectionDialog, (WidgetClass)&xmSelectionBoxClassRec); MrmRegisterClass (0, NULL, "XmCreatePromptDialog", XmCreatePromptDialog, (WidgetClass)&xmSelectionBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateSeparator", XmCreateSeparator, (WidgetClass)&xmSeparatorClassRec); MrmRegisterClass (0, NULL, "XmCreateSeparatorGadget", XmCreateSeparatorGadget, (WidgetClass)&xmSeparatorGadgetClassRec); MrmRegisterClass (0, NULL, "XmCreateTabBox", XmCreateTabBox, (WidgetClass)&xmTabBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateTabStack", XmCreateTabStack, (WidgetClass)&xmTabStackClassRec); MrmRegisterClass (0, NULL, "XmCreateText", XmCreateText, (WidgetClass)&xmTextClassRec); MrmRegisterClass (0, NULL, "XmCreateTextField", XmCreateTextField, (WidgetClass)&xmTextFieldClassRec); MrmRegisterClass (0, NULL, "XmCreateScrolledText", XmCreateScrolledText, (WidgetClass)&xmTextClassRec); MrmRegisterClass (0, NULL, "XmCreateToggleButton", XmCreateToggleButton, (WidgetClass)&xmToggleButtonClassRec); MrmRegisterClass (0, NULL, "XmCreateToggleButtonGadget", XmCreateToggleButtonGadget, (WidgetClass)&xmToggleButtonGadgetClassRec); MrmRegisterClass (0, NULL, "XmCreateTree", XmCreateTree, (WidgetClass)&xmTreeClassRec); MrmRegisterClass (0, NULL, "XmCreatePaned", XmCreatePaned, (WidgetClass)&xmPanedClassRec); MrmRegisterClass (0, NULL, "XmCreatePanedWindow", XmCreatePanedWindow, (WidgetClass)&xmPanedWindowClassRec); MrmRegisterClass (0, NULL, "XmCreateComboBox", XmCreateComboBox, (WidgetClass)&xmComboBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateContainer", XmCreateContainer, (WidgetClass)&xmContainerClassRec); MrmRegisterClass (0, NULL, "XmCreateNotebook", XmCreateNotebook, (WidgetClass)&xmNotebookClassRec); MrmRegisterClass (0, NULL, "XmCreateSpinBox", XmCreateSpinBox, (WidgetClass)&xmSpinBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateSimpleSpinBox", XmCreateSimpleSpinBox, (WidgetClass)&xmSimpleSpinBoxClassRec); MrmRegisterClass (0, NULL, "XmCreateIconGadget", XmCreateIconGadget, (WidgetClass)&xmIconGadgetClassRec); MrmRegisterClassWithCleanup (0, NULL, "_XmCreateRenderTable", _XmCreateRenderTable, (WidgetClass)NULL, XmRenderTableFree); MrmRegisterClassWithCleanup (0, NULL, "_XmCreateRendition", _XmCreateRendition, (WidgetClass)NULL, XmRenditionFree); MrmRegisterClass (0, NULL, "_XmCreateTabList", _XmCreateTabList, (WidgetClass)NULL); MrmRegisterClass (0, NULL, "_XmCreateTab", _XmCreateTab, (WidgetClass)NULL); MrmRegisterClass (0, NULL, "XmCreateDropDown", XmCreateDropDown, (WidgetClass)&xmDropDownClassRec); /* * Initialization complete */ urm__initialize_complete = TRUE ; _MrmProcessUnlock(); } motif-2.3.8/lib/Mrm/Mrmwread.c0000644000175000017500000001507713145162623013023 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmwread.c /main/11 1996/11/13 14:07:06 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains the widget read routines. All these routines * read a widget from a hierarchy or IDB file into a resource context. * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * UrmHGetWidget Read indexed widget from hierarchy * * UrmGetIndexedWidget Read indexed widget from IDB file * * UrmGetRIDWidget Read RID widget from IDB file * */ /* *++ * * PROCEDURE DESCRIPTION: * * UrmHGetWidget searches the database hierarchy for a public * (EXPORTed) widget given its index. It returns the RGM widget record * in a resource context. * * FORMAL PARAMETERS: * * hierarchy_id id of an open URM database hierarchy * index index of the desired widget * context_id widget context in which to return record read in * file_id_return to return IDB file in which widget was found * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND widget not found * MrmBAD_HIERARCHY invalid URM file hierarchy * MrmBAD_WIDGET_REC invalid widget record in context * Others see UrmGetIndexedWidget * * SIDE EFFECTS: * *-- */ Cardinal UrmHGetWidget (MrmHierarchy hierarchy_id, String index, URMResourceContextPtr context_id, IDBFile *file_id_return) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ /* * Get the widget */ result = UrmHGetIndexedResource (hierarchy_id, index, URMgWidget, URMtNul, context_id, file_id_return) ; if ( result != MrmSUCCESS ) return result ; /* * Validate the widget record in the context */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( UrmWRValid(widgetrec) ) return MrmSUCCESS ; else { if ( (*file_id_return)->byte_swapped ) swapbytes(widgetrec->validation); if ( UrmWRValid(widgetrec) ) { Urm__SwapRGMWidgetRecord(widgetrec); return MrmSUCCESS ; } } return Urm__UT_Error("UrmHGetIndexedWidget", _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmGetIndexedWidget searches a single database file for a widget * given its index (i.e. it gets a public widget from a single file). * It returns the RGM widget record. * * FORMAL PARAMETERS: * * file_id id of an open URM database file (IDB file) * index index of the desired widget * context_id widget context in which to return record read in * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT invalid resource context * Other See UrmIdbGetIndexedResource * * SIDE EFFECTS: * *-- */ Cardinal UrmGetIndexedWidget (IDBFile file_id, String index, URMResourceContextPtr context_id) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ /* * Validate context, then attempt the read. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmGetIndexedWidget", _MrmMMsg_0043, file_id, NULL, MrmBAD_CONTEXT) ; result = UrmIdbGetIndexedResource (file_id, index, URMgWidget, URMtNul, context_id) ; if ( result != MrmSUCCESS ) return result ; /* * Validate the widget record in the context */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( UrmWRValid(widgetrec) ) return MrmSUCCESS ; else { if ( file_id->byte_swapped ) swapbytes(widgetrec->validation); if ( UrmWRValid(widgetrec) ) { Urm__SwapRGMWidgetRecord(widgetrec); return MrmSUCCESS ; } } return Urm__UT_Error("UrmGetIndexedWidget", _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmGetRIDWidget retrieves a widget from a single database file * given its resource id as an accessor. It returns the widget record. * * FORMAL PARAMETERS: * * file_id id of an open URM database file (IDB file) * resource_id resource id for widget * context_id widget context in which to return record read in * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND widget not found * MrmFAILURE operation failed, further reason not given. * * SIDE EFFECTS: * *-- */ Cardinal UrmGetRIDWidget (IDBFile file_id, MrmResource_id resource_id, URMResourceContextPtr context_id) { /* * Local variables */ Cardinal result ; /* function results */ RGMWidgetRecordPtr widgetrec ; /* widget record in context */ /* * Validate context, then attempt the read. */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmGetRIDWidget", _MrmMMsg_0043, file_id, NULL, MrmBAD_CONTEXT) ; result = UrmIdbGetRIDResource (file_id, resource_id, URMgWidget, URMgNul, context_id) ; if ( result != MrmSUCCESS ) return result ; /* * Validate the widget record in the context */ widgetrec = (RGMWidgetRecordPtr) UrmRCBuffer (context_id) ; if ( UrmWRValid(widgetrec) ) return MrmSUCCESS ; else { if ( file_id->byte_swapped ) swapbytes(widgetrec->validation); if ( UrmWRValid(widgetrec) ) { Urm__SwapRGMWidgetRecord(widgetrec); return MrmSUCCESS ; } } return Urm__UT_Error("UrmGetRIDWidget", _MrmMMsg_0026, NULL, context_id, MrmBAD_WIDGET_REC) ; } motif-2.3.8/lib/Mrm/MrmIentry.c0000644000175000017500000004040513145162623013164 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmIentry.c /main/13 1996/11/13 13:56:11 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB Facility * Data entry management routines * * ABSTRACT: * * These routines get and put data entries from a record into a buffer. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * Idb__DB_GetDataEntry - Get data entry into buffer * * Idb__DB_PutDataEntry - Put data entry into record * */ /* *++ * * PROCEDURE DESCRIPTION: * * Idb__DB_GetDataEntry retrieves the requested data entry into a * resource context, returning the number of bytes, resource group, and * resource type. The resource context is resized as required to hold * the data block. * * FORMAL PARAMETERS: * * file_id Open ID file * data_entry Data entry to be fetched * context_id To receive data block for data entry * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__DB_GetDataEntry (IDBFile file_id, IDBDataHandle data_entry, URMResourceContextPtr context_id) { /* * Local variables */ Cardinal status; /* return status */ IDBRecordNumber record_number ; /* Record to be read in */ IDBDataEntryHdrPtr datahdr ; /* Header part of entry */ IDBSimpleDataPtr sim_data ; /* Simple data entry */ IDBOverflowDataPtr ofl_data ; /* Overflow data entry */ IDBDataRecordPtr data_rec; /* pointer data record */ IDBRecordBufferPtr curbuf ; /* temp buffer for record */ Cardinal num_recs; /* # records to save overflow */ Cardinal cur_rec; /* the current record */ char *buff_ptr; /* ptr into context buffer */ /* * Check and see if the context is valid */ if (! UrmRCValid (context_id)) return Urm__UT_Error ("Idb__DB_GetDataEntry", _MrmMMsg_0006, NULL, NULL, MrmBAD_CONTEXT) ; /* * Make the data entry accessible as a data pointer. Let the header * handle this request if the entry is there. */ record_number = data_entry.rec_no; if ( record_number == IDBHeaderRecordNumber ) return Idb__HDR_GetDataEntry (file_id, data_entry, context_id); /* * Get the record that contains this data, get to the correct offset in * that record. */ status = Idb__BM_GetRecord (file_id, record_number, &curbuf) ; if ( status != MrmSUCCESS ) return status ; /* * Point to the header in the data entry, set the context data. The context * is resized if necessary. Note that all context info except the * actual data can be set now regardless of the entry type. */ data_rec = (IDBDataRecord *) curbuf->IDB_record; datahdr = (IDBDataEntryHdrPtr) &data_rec->data[data_entry.item_offs] ; if ((datahdr->validation != IDBDataEntryValid) && ( file_id->byte_swapped )) SwapIDBDataEntryHdr(datahdr) ; if (datahdr->validation != IDBDataEntryValid) return Urm__UT_Error ("Idb__DB_GetDataEntry", _MrmMMsg_0007, NULL, context_id, MrmNOT_VALID) ; if ( datahdr->entry_size > UrmRCSize(context_id) ) { status = UrmResizeResourceContext (context_id, datahdr->entry_size) ; if ( status != MrmSUCCESS ) return status ; } UrmRCSetSize (context_id, datahdr->entry_size) ; UrmRCSetGroup (context_id, datahdr->resource_group) ; UrmRCSetType (context_id, datahdr->resource_type) ; UrmRCSetAccess (context_id, datahdr->access) ; UrmRCSetLock (context_id, datahdr->lock) ; UrmRCSetByteSwap (context_id, file_id->byte_swapped) ; /* * Read the data into the context. Technique depends on entry type. */ buff_ptr = (char *) UrmRCBuffer(context_id) ; switch ( datahdr->entry_type ) { case IDBdrSimple: sim_data = (IDBSimpleDataPtr) datahdr ; UrmBCopy (sim_data->data, buff_ptr, datahdr->entry_size) ; return MrmSUCCESS ; case IDBdrOverflow: ofl_data = (IDBOverflowDataPtr) datahdr ; if ( file_id->byte_swapped ) SwapIDBOverflowData(ofl_data); num_recs = ofl_data->segment_count ; for ( cur_rec=1 ; cur_rec<=num_recs ; cur_rec++ ) { UrmBCopy (ofl_data->data, buff_ptr, ofl_data->segment_size) ; buff_ptr += ofl_data->segment_size ; /* * Read the next record in the chain if this is not the last */ if ( cur_rec < num_recs ) { record_number = ofl_data->next_segment.internal_id.rec_no; status = Idb__BM_GetRecord (file_id, record_number, &curbuf) ; if ( status != MrmSUCCESS ) return status ; data_rec = (IDBDataRecord *) curbuf->IDB_record; datahdr = (IDBDataEntryHdrPtr) &data_rec->data[data_entry.item_offs] ; if ( file_id->byte_swapped ) SwapIDBDataEntryHdr(datahdr) ; if (datahdr->validation != IDBDataEntryValid) return Urm__UT_Error ("Idb__DB_GetDataEntry", _MrmMMsg_0008, NULL, context_id, MrmNOT_VALID) ; ofl_data = (IDBOverflowDataPtr) datahdr ; if ( file_id->byte_swapped ) SwapIDBOverflowData(ofl_data); } } return MrmSUCCESS ; default: return Urm__UT_Error ("Idb__DB_GetDataEntry", _MrmMMsg_0009, NULL, context_id, MrmFAILURE) ; } } /* *++ * * PROCEDURE DESCRIPTION: * * Idb_DB_PutDataEntry stores the resource described in the resource * context into the database, returning the resulting data entry pointer. * * FORMAL PARAMETERS: * * file_id Open IDB file * context_id contains data block to be stored * one_entry To return data entry for newly stored entry * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__DB_PutDataEntry (IDBFile file_id, URMResourceContextPtr context_id, IDBDataHandle *data_entry) { /* * Local variables */ Cardinal result; /* returned status */ MrmType ent_typ ; /* entry type */ IDBOverflowDataPtr overflowdata; /* complex data entry ptr */ IDBSimpleDataPtr simpledata; /* simple data entry ptr */ IDBDataRecordPtr data_rec; /* pointer data record */ IDBRecordBufferPtr curbuf; /* current record buffer pointer */ IDBRecordBufferPtr nxtbuf; /* next record buffer pointer */ IDBDataHdrPtr dataheader; /* data record header */ MrmCount entsiz ; /* Number of bytes for new entry */ MrmOffset entoffs ; /* Entry offset in buffer */ Cardinal num_recs; /* # records to save overflow */ Cardinal cur_rec; /* the current record */ char *dataptr ; /* pointer to data in context */ MrmCount datarem ; /* # bytes left to copy in data */ MrmCount cursiz ; /* # bytse of data in cur. segment */ /* * Consistency check */ if (! UrmRCValid (context_id)) return Urm__UT_Error ("Idb__DB_PutDataEntry", _MrmMMsg_0006, NULL, NULL, MrmBAD_CONTEXT) ; /* * Try to put this entry in the header record. */ result = Idb__HDR_PutDataEntry (file_id, context_id, data_entry ); if ( result == MrmSUCCESS ) return result; /* * Initialize the first data record if required, or use the last one. */ if ( !file_id->last_data_record ) { result = Idb__BM_InitDataRecord (file_id, &curbuf) ; if ( result != MrmSUCCESS ) return result ; file_id->last_data_record = _IdbBufferRecordNumber (curbuf) ; } else { result = Idb__BM_GetRecord (file_id, file_id->last_data_record, &curbuf) ; if ( result != MrmSUCCESS ) return result ; } /* * This is a simple data entry if it will fit, else it is an overflow entry. * The size computes is of a simple entry, which will be used if this turns * out to be correct. */ entsiz = IDBSimpleDataHdrSize + UrmRCSize(context_id) ; entsiz = _FULLWORD (entsiz) ; if ( entsiz <= IDBDataFreeMax ) ent_typ = IDBdrSimple ; else ent_typ = IDBdrOverflow ; /* * Create the data entry depending on entry type. */ switch ( ent_typ ) { case IDBdrSimple: /* * Bind pointers into this record, and see if this entry will fit. If * not, get a new record and rebind pointers. */ data_rec = (IDBDataRecord *) curbuf->IDB_record; dataheader = (IDBDataHdr *) &data_rec->data_header; if ( entsiz > dataheader->free_count ) { result = Idb__BM_InitDataRecord (file_id, &curbuf) ; if ( result != MrmSUCCESS ) return result ; data_rec = (IDBDataRecord *) curbuf->IDB_record; dataheader = (IDBDataHdr *) &data_rec->data_header; } /* * Get the offset for the entry, and create the entry at that offset. * Copy in the data contents. */ entoffs = dataheader->free_ptr ; simpledata = (IDBSimpleData *) &data_rec->data[entoffs]; simpledata->header.validation = IDBDataEntryValid; simpledata->header.entry_type = IDBdrSimple; simpledata->header.resource_group = UrmRCGroup(context_id); simpledata->header.resource_type = UrmRCType(context_id); simpledata->header.access = UrmRCAccess(context_id); simpledata->header.entry_size = UrmRCSize(context_id); simpledata->header.lock = UrmRCLock(context_id); dataptr = (char *) UrmRCBuffer(context_id) ; UrmBCopy (dataptr, simpledata->data, UrmRCSize(context_id)); /* * Set the return value to the data pointer for this entry */ data_entry->rec_no = _IdbBufferRecordNumber (curbuf) ; data_entry->item_offs = dataheader->free_ptr; /* * Update the entry chain, mark the buffer, and return. */ simpledata->header.prev_entry = dataheader->last_entry ; dataheader->num_entry++ ; dataheader->last_entry = entoffs ; dataheader->free_ptr += entsiz ; dataheader->free_count -= entsiz ; Idb__BM_MarkModified (curbuf) ; return MrmSUCCESS ; case IDBdrOverflow: /* * Compute the number of records required to hold this entry. Each segment * of the entry will begin in a new record, and occupy all of it, except, * usually, the last. */ num_recs = (UrmRCSize(context_id)+IDBDataOverflowMax-1) / IDBDataOverflowMax ; /* * Enter a loop to create and fill all the records needed. Initialize the * record and pointers outside the loop, as a convenience for chaining * the segments. Also set the the result data pointer to point to this * record. Note that the offset of all overflow segments is 0. */ result = Idb__BM_InitDataRecord (file_id, &curbuf) ; if ( result != MrmSUCCESS ) return result ; data_rec = (IDBDataRecordPtr) curbuf->IDB_record ; dataheader = (IDBDataHdrPtr) &data_rec->data_header ; overflowdata = (IDBOverflowDataPtr) data_rec->data ; data_entry->rec_no = _IdbBufferRecordNumber (curbuf) ; data_entry->item_offs = 0 ; /* * Set up pointers to copy the data from the context. */ dataptr = (char *) UrmRCBuffer (context_id) ; datarem = UrmRCSize (context_id) ; for ( cur_rec=1 ; cur_rec<=num_recs ; cur_rec++ ) { /* * Set up the header of this segment, and copy in the appropriate part * of the data buffer in the context */ cursiz = MIN(datarem, IDBDataOverflowMax) ; entsiz = cursiz + IDBOverflowDataHdrSize ; entsiz = _FULLWORD (entsiz) ; overflowdata->header.validation = IDBDataEntryValid; overflowdata->header.entry_type = IDBdrOverflow; overflowdata->header.resource_group = UrmRCGroup(context_id); overflowdata->header.resource_type = UrmRCType(context_id); overflowdata->header.access = UrmRCAccess(context_id); overflowdata->header.lock = UrmRCLock(context_id); overflowdata->header.entry_size = UrmRCSize(context_id); UrmBCopy (dataptr, overflowdata->data, cursiz) ; dataptr += cursiz ; datarem -= cursiz ; /* * Set up the segment info, including chaining. Chaining is * done after the next buffer is acquired. If this is not the * last record, then the chain is updated. If it is the last * record, then the free pointer is set. This code assumes * that acquiring a new data record does not free/reuse the * current buffer. */ overflowdata->segment_size = cursiz ; overflowdata->segment_count = num_recs ; overflowdata->segment_num = cur_rec ; overflowdata->header.prev_entry = 0 ; dataheader->num_entry++ ; dataheader->last_entry = 0 ; dataheader->free_ptr += entsiz ; dataheader->free_count -= entsiz ; Idb__BM_MarkModified (curbuf) ; if ( cur_rec == num_recs ) { overflowdata->next_segment.internal_id.rec_no = 0 ; overflowdata->next_segment.internal_id.item_offs = 0 ; } else { result = Idb__BM_InitDataRecord (file_id, &nxtbuf) ; if ( result != MrmSUCCESS ) return result ; overflowdata->next_segment.internal_id.rec_no = _IdbBufferRecordNumber (nxtbuf) ; overflowdata->next_segment.internal_id.item_offs = 0 ; curbuf = nxtbuf ; data_rec = (IDBDataRecordPtr) curbuf->IDB_record ; dataheader = (IDBDataHdrPtr) &data_rec->data_header ; overflowdata = (IDBOverflowDataPtr) data_rec->data ; } } return MrmSUCCESS ; } return MrmFAILURE; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine checks if a data entry matchs a set of filters. * It reads the record containing the header for the data entry, * then does the filter match. If both filters are NUL, then * the test becomes merely one of confirming the data entry * can be read. * * FORMAL PARAMETERS: * * file_id Open ID file * data_entry Data entry to be matched * group_filter if not null, entry found must match this group * type_filter if not null, entry found must match this type * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * TRUE Match is good * FALSE match not good. * * SIDE EFFECTS: * *-- */ Boolean Idb__DB_MatchFilter (IDBFile file_id, IDBDataHandle data_entry, MrmCode group_filter, MrmCode type_filter) { /* * Local variables */ Cardinal result ; /* return status */ IDBRecordNumber record_number ; /* Record to be read in */ IDBRecordBufferPtr bufptr ; /* buffer for data record */ IDBDataRecordPtr data_rec; /* pointer data record */ IDBDataEntryHdrPtr datahdr ; /* Header part of entry */ /* * Get the record that contains this data, get to the correct offset in * that record. Immediately decommit the buffer, since it won't be * compromised by this read. As usual, go to the header record if required. */ record_number = data_entry.rec_no ; if ( record_number == IDBHeaderRecordNumber ) return Idb__HDR_MatchFilter (file_id, data_entry, group_filter, type_filter); result = Idb__BM_GetRecord (file_id, record_number, &bufptr) ; if ( result != MrmSUCCESS ) return FALSE ; Idb__BM_Decommit (bufptr) ; /* * Point to the header in the entry, and check the filters. */ data_rec = (IDBDataRecord *) bufptr->IDB_record; datahdr = (IDBDataEntryHdrPtr) &data_rec->data[data_entry.item_offs] ; if (datahdr->validation != IDBDataEntryValid) { Urm__UT_Error ("Idb__DB_GetDataEntry", _MrmMMsg_0007, NULL, NULL, MrmNOT_VALID) ; return FALSE ; } if ( group_filter!=URMgNul && group_filter!=datahdr->resource_group ) return FALSE ; if ( type_filter!=URMtNul && type_filter!=datahdr->resource_type ) return FALSE ; return TRUE ; } motif-2.3.8/lib/Mrm/MrmIrid.c0000644000175000017500000002411113145162623012575 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmIrid.c /main/13 1996/11/13 13:58:17 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB Facility * Resource ID management routines. * * ABSTRACT: * * These routines acquire RIDs, allow entering a data block under an RID, * and manage the RID and index map records. * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * Idb__RID_EnterItem - Enter a data entry under an RID * * Idb__RID_ReturnItem - Return the data entry for an RID * * Idb__RID_NextRID - Return next available RID * * Idb__RID_AddRecord - Set up a new resource ID record * */ /* * * DEFINE and MACRO DEFINITIONS * */ /* * Macros which validate index records in buffers */ #define Idb__RID_ValidRecord(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtRIDMap) /* *++ * * PROCEDURE DESCRIPTION: * * Idb__RID_EnterItem makes an entry in the resource record for the * resourc id of the data entry pointer. * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * resource_id Resource ID under which to enter entry * data_entry Data entry pointer for data * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * MrmOUT_OF_RANGE Record number out of range * MrmBAD_RECORD not an RID map record * URMBadDataindex Data index out of range * * SIDE EFFECTS: * *-- */ Cardinal Idb__RID_EnterItem (IDBFile file_id, IDBResource resource_id, IDBDataHandle data_entry) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr bufptr; /* header record buffer */ IDBridMapRecordPtr recptr; /* header record in buffer */ IDBridDesc resid; /* CAST resource id */ IDBResourceIndex resndx; /* to check resource index */ IDBRecordNumber recno; /* Map record record number */ /* * Get the resource map record. Let the header handle it if the * RID is in the header record. */ resid.external_id = resource_id; recno = resid.internal_id.map_rec; if ( recno == IDBHeaderRecordNumber ) return Idb__HDR_EnterItem (file_id, resource_id, data_entry); resndx = resid.internal_id.res_index; if ( recno > file_id->last_record ) return Urm__UT_Error ("Idb__RID_EnterItem", _MrmMMsg_0019, file_id, NULL, MrmOUT_OF_RANGE); result = Idb__BM_GetRecord (file_id, recno, &bufptr); if ( result != MrmSUCCESS ) return result; if ( ! Idb__RID_ValidRecord(bufptr) ) return Urm__UT_Error ("Idb__RID_EnterItem", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD); recptr = (IDBridMapRecordPtr) bufptr->IDB_record; /* * Set the data item. */ if ( resndx >= IDBridPtrVecMax ) return Urm__UT_Error ("Idb__RID_EnterItem", _MrmMMsg_0013, file_id, NULL, MrmBAD_DATA_INDEX); recptr->pointers[resndx].internal_id.rec_no = data_entry.rec_no; recptr->pointers[resndx].internal_id.item_offs = data_entry.item_offs; Idb__BM_MarkActivity (bufptr); /* * successful entry */ Idb__BM_MarkModified (bufptr); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb_RID_ReturnItem returns the data entry pointer for an item * entered in the database under a resource id. Since this routine * is also used to check if an entry exists before writing, it * uses a flag to determine if a null entry should be signalled. * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * resource_id Entry's resource id * signal_null if TRUE, signal error on null data entry * entry_return To return data pointer for data * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmOUT_OF_RANGE Record number out of range * MrmBAD_RECORD not an RID map record * MrmNULL_DATA no data for resource id * MrmFAILURE some other failure * URMBadDataindex Data index out of range * * SIDE EFFECTS: * *-- */ Cardinal Idb__RID_ReturnItem (IDBFile file_id, IDBResource resource_id, Boolean signal_null, IDBDataHandle *entry_return) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr bufptr; /* RID map record buffer */ IDBridMapRecordPtr recptr; /* RID map record in buffer */ IDBridDesc resid; /* CAST resource id */ IDBResourceIndex resndx; /* to check resource index */ IDBRecordNumber recno; /* Map record record number */ /* * Get the resource map record. Let the header handle it if the RID is * in the header. */ resid.external_id = resource_id; recno = resid.internal_id.map_rec; if ( recno == IDBHeaderRecordNumber ) return Idb__HDR_ReturnItem (file_id, resource_id, signal_null, entry_return); resndx = resid.internal_id.res_index; if ( recno > file_id->last_record ) return Urm__UT_Error ("Idb__RID_ReturnItem", _MrmMMsg_0019, file_id, NULL, MrmOUT_OF_RANGE); result = Idb__BM_GetRecord (file_id, recno, &bufptr); if ( result != MrmSUCCESS ) return result; if ( ! Idb__RID_ValidRecord(bufptr) ) return Urm__UT_Error ("Idb__RID_ReturnItem", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD); recptr = (IDBridMapRecordPtr) bufptr->IDB_record; /* * Retrieve the data item. */ if ( resndx >= IDBridPtrVecMax ) return Urm__UT_Error ("Idb__RID_ReturnItem", _MrmMMsg_0013, file_id, NULL, MrmBAD_DATA_INDEX); if ((recptr->pointers[resndx].internal_id.rec_no == 0) && (recptr->pointers[resndx].internal_id.item_offs == 0)) { if ( signal_null ) return Urm__UT_Error ("Idb__RID_ReturnItem", _MrmMMsg_0014, file_id, NULL, MrmNULL_DATA); else return MrmNULL_DATA; } entry_return->rec_no = recptr->pointers[resndx].internal_id.rec_no; entry_return->item_offs = recptr->pointers[resndx].internal_id.item_offs; /* * Successful retrieval */ Idb__BM_MarkActivity (bufptr); return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__RID_NextRID returns the next available resource ID in the * file. It is the internal version of UrmIdbGetResourceId. If a new * resource record is required, this routine: * - Acquires a new resource record, and initializes it * to all null pointers. * - Adds a new entry to map index vector in the file header * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * res_id_return To return new resource id * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__RID_NextRID (IDBFile file_id, IDBResource *res_id_return) { /* * Local variables */ Cardinal result; /* function results */ IDBResourceIndex resndx; /* to check resource index */ /* * use the next available ID, or acquire a new record. Handle both header * record and RID record maps. */ resndx = file_id->next_RID.internal_id.res_index; if ( file_id->next_RID.internal_id.map_rec == IDBHeaderRecordNumber ) { if ( resndx >= IDBHeaderRIDMax ) { result = Idb__RID_AddRecord (file_id); if ( result != MrmSUCCESS ) return result; resndx = file_id->next_RID.internal_id.res_index; } } /* * RID comes from a RID record */ if ( resndx >= IDBridPtrVecMax ) { result = Idb__RID_AddRecord (file_id); if ( result != MrmSUCCESS ) return result; resndx = file_id->next_RID.internal_id.res_index; } /* * Increment resource index, returning current value. */ *res_id_return = (IDBResource) file_id->next_RID.external_id; file_id->next_RID.internal_id.res_index++; return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__RID_AddRecord initializes a new resource id record and enters * in in the index map in the header. * * FORMAL PARAMETERS: * * file_id Open IDB file * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__RID_AddRecord (IDBFile file_id) { /* * Local variables */ Cardinal result; /* function results */ IDBRecordBufferPtr bufptr; /* RID map record buffer */ IDBridMapRecordPtr recptr; /* RID map record in buffer */ int ndx; /* loop index */ /* * Acquire a record. */ result = Idb__BM_InitRecord (file_id, 0, IDBrtRIDMap, &bufptr); if ( result != MrmSUCCESS ) return result; recptr = (IDBridMapRecordPtr) bufptr->IDB_record; /* * Initialize the record contents */ for (ndx=0 ; ndxpointers[ndx].internal_id.rec_no = 0; recptr->pointers[ndx].internal_id.item_offs = 0; } Idb__BM_MarkModified (bufptr); /* * Update the next RID in the file header to point to the first entry in * the new record. */ file_id->next_RID.internal_id.map_rec = recptr->map_header.header.record_num; file_id->next_RID.internal_id.res_index = 0; /* * Record successfully created. */ Idb__BM_MarkModified (bufptr); return MrmSUCCESS; } motif-2.3.8/lib/Mrm/MrmAppl.h0000644000175000017500000000237513145162623012617 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef MrmAppl_H #define MrmAppl_H /* ** This file includes all .h files and definitions which are needed by Mrm code ** which does not require access to the widget-building variants of Xm */ #include #include #include #include #include #endif /* MrmAppl_H */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Mrm/MrmMsgI.h0000644000175000017500000003013413145162623012554 00000000000000/* $XConsortium: MrmMsgI.h /main/2 1996/08/19 12:09:55 pascale $ */ /* * * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* This file is automatically generated. */ /* Do not edit. */ #ifndef NO_MESSAGE_CATALOG #include #include "MrmMsgCatI.h" externalref nl_catd Mrm_catd; #define _MrmCatgets(catd, set_num, msg_num, def_str) \ catgets(catd, set_num, msg_num, def_str) #else #define _MrmCatgets(catd, set_num, msg_num, def_str) def_str #endif /* NO_MESSAGE_CATALOG */ #define _MrmMMsg_0000 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0000, _MrmMsg_0000) #define _MrmMMsg_0001 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0001, _MrmMsg_0001) #define _MrmMMsg_0002 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0002, _MrmMsg_0002) #define _MrmMMsg_0003 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0003, _MrmMsg_0003) #define _MrmMMsg_0004 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0004, _MrmMsg_0004) #define _MrmMMsg_0005 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0005, _MrmMsg_0005) #define _MrmMMsg_0006 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0006, _MrmMsg_0006) #define _MrmMMsg_0007 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0007, _MrmMsg_0007) #define _MrmMMsg_0008 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0008, _MrmMsg_0008) #define _MrmMMsg_0009 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0009, _MrmMsg_0009) #define _MrmMMsg_0010 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0010, _MrmMsg_0010) #define _MrmMMsg_0011 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0011, _MrmMsg_0011) #define _MrmMMsg_0012 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0012, _MrmMsg_0012) #define _MrmMMsg_0013 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0013, _MrmMsg_0013) #define _MrmMMsg_0014 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0014, _MrmMsg_0014) #define _MrmMMsg_0015 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0015, _MrmMsg_0015) #define _MrmMMsg_0016 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0016, _MrmMsg_0016) #define _MrmMMsg_0017 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0017, _MrmMsg_0017) #define _MrmMMsg_0018 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0018, _MrmMsg_0018) #define _MrmMMsg_0019 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0019, _MrmMsg_0019) #define _MrmMMsg_0020 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0020, _MrmMsg_0020) #define _MrmMMsg_0021 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0021, _MrmMsg_0021) #define _MrmMMsg_0022 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0022, _MrmMsg_0022) #define _MrmMMsg_0023 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0023, _MrmMsg_0023) #define _MrmMMsg_0024 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0024, _MrmMsg_0024) #define _MrmMMsg_0025 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0025, _MrmMsg_0025) #define _MrmMMsg_0026 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0026, _MrmMsg_0026) #define _MrmMMsg_0027 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0027, _MrmMsg_0027) #define _MrmMMsg_0028 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0028, _MrmMsg_0028) #define _MrmMMsg_0029 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0029, _MrmMsg_0029) #define _MrmMMsg_0030 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0030, _MrmMsg_0030) #define _MrmMMsg_0031 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0031, _MrmMsg_0031) #define _MrmMMsg_0032 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0032, _MrmMsg_0032) #define _MrmMMsg_0033 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0033, _MrmMsg_0033) #define _MrmMMsg_0034 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0034, _MrmMsg_0034) #define _MrmMMsg_0035 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0035, _MrmMsg_0035) #define _MrmMMsg_0036 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0036, _MrmMsg_0036) #define _MrmMMsg_0037 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0037, _MrmMsg_0037) #define _MrmMMsg_0038 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0038, _MrmMsg_0038) #define _MrmMMsg_0039 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0039, _MrmMsg_0039) #define _MrmMMsg_0040 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0040, _MrmMsg_0040) #define _MrmMMsg_0041 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0041, _MrmMsg_0041) #define _MrmMMsg_0042 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0042, _MrmMsg_0042) #define _MrmMMsg_0043 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0043, _MrmMsg_0043) #define _MrmMMsg_0044 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0044, _MrmMsg_0044) #define _MrmMMsg_0045 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0045, _MrmMsg_0045) #define _MrmMMsg_0046 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0046, _MrmMsg_0046) #define _MrmMMsg_0047 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0047, _MrmMsg_0047) #define _MrmMMsg_0048 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0048, _MrmMsg_0048) #define _MrmMMsg_0049 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0049, _MrmMsg_0049) #define _MrmMMsg_0050 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0050, _MrmMsg_0050) #define _MrmMMsg_0051 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0051, _MrmMsg_0051) #define _MrmMMsg_0052 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0052, _MrmMsg_0052) #define _MrmMMsg_0053 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0053, _MrmMsg_0053) #define _MrmMMsg_0054 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0054, _MrmMsg_0054) #define _MrmMMsg_0055 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0055, _MrmMsg_0055) #define _MrmMMsg_0056 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0056, _MrmMsg_0056) #define _MrmMMsg_0057 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0057, _MrmMsg_0057) #define _MrmMMsg_0058 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0058, _MrmMsg_0058) #define _MrmMMsg_0059 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0059, _MrmMsg_0059) #define _MrmMMsg_0060 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0060, _MrmMsg_0060) #define _MrmMMsg_0061 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0061, _MrmMsg_0061) #define _MrmMMsg_0062 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0062, _MrmMsg_0062) #define _MrmMMsg_0063 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0063, _MrmMsg_0063) #define _MrmMMsg_0064 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0064, _MrmMsg_0064) #define _MrmMMsg_0065 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0065, _MrmMsg_0065) #define _MrmMMsg_0066 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0066, _MrmMsg_0066) #define _MrmMMsg_0067 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0067, _MrmMsg_0067) #define _MrmMMsg_0068 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0068, _MrmMsg_0068) #define _MrmMMsg_0069 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0069, _MrmMsg_0069) #define _MrmMMsg_0070 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0070, _MrmMsg_0070) #define _MrmMMsg_0071 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0071, _MrmMsg_0071) #define _MrmMMsg_0072 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0072, _MrmMsg_0072) #define _MrmMMsg_0073 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0073, _MrmMsg_0073) #define _MrmMMsg_0074 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0074, _MrmMsg_0074) #define _MrmMMsg_0075 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0075, _MrmMsg_0075) #define _MrmMMsg_0076 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0076, _MrmMsg_0076) #define _MrmMMsg_0077 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0077, _MrmMsg_0077) #define _MrmMMsg_0078 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0078, _MrmMsg_0078) #define _MrmMMsg_0079 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0079, _MrmMsg_0079) #define _MrmMMsg_0080 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0080, _MrmMsg_0080) #define _MrmMMsg_0081 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0081, _MrmMsg_0081) #define _MrmMMsg_0082 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0082, _MrmMsg_0082) #define _MrmMMsg_0083 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0083, _MrmMsg_0083) #define _MrmMMsg_0084 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0084, _MrmMsg_0084) #define _MrmMMsg_0085 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0085, _MrmMsg_0085) #define _MrmMMsg_0086 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0086, _MrmMsg_0086) #define _MrmMMsg_0087 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0087, _MrmMsg_0087) #define _MrmMMsg_0088 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0088, _MrmMsg_0088) #define _MrmMMsg_0089 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0089, _MrmMsg_0089) #define _MrmMMsg_0090 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0090, _MrmMsg_0090) #define _MrmMMsg_0091 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0091, _MrmMsg_0091) #define _MrmMMsg_0092 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0092, _MrmMsg_0092) #define _MrmMMsg_0093 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0093, _MrmMsg_0093) #define _MrmMMsg_0094 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0094, _MrmMsg_0094) #define _MrmMMsg_0095 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0095, _MrmMsg_0095) #define _MrmMMsg_0096 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0096, _MrmMsg_0096) #define _MrmMMsg_0097 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0097, _MrmMsg_0097) #define _MrmMMsg_0098 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0098, _MrmMsg_0098) #define _MrmMMsg_0099 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0099, _MrmMsg_0099) #define _MrmMMsg_0100 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0100, _MrmMsg_0100) #define _MrmMMsg_0101 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0101, _MrmMsg_0101) #define _MrmMMsg_0102 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0102, _MrmMsg_0102) #define _MrmMMsg_0103 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0103, _MrmMsg_0103) #define _MrmMMsg_0104 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0104, _MrmMsg_0104) #define _MrmMMsg_0105 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0105, _MrmMsg_0105) #define _MrmMMsg_0106 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0106, _MrmMsg_0106) #define _MrmMMsg_0107 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0107, _MrmMsg_0107) #define _MrmMMsg_0108 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0108, _MrmMsg_0108) #define _MrmMMsg_0109 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0109, _MrmMsg_0109) #define _MrmMMsg_0110 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0110, _MrmMsg_0110) #define _MrmMMsg_0111 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0111, _MrmMsg_0111) #define _MrmMMsg_0112 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0112, _MrmMsg_0112) #define _MrmMMsg_0113 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0113, _MrmMsg_0113) #define _MrmMMsg_0114 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0114, _MrmMsg_0114) #define _MrmMMsg_0115 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0115, _MrmMsg_0115) #define _MrmMMsg_0116 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0116, _MrmMsg_0116) #define _MrmMMsg_0117 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0117, _MrmMsg_0117) #define _MrmMMsg_0118 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0118, _MrmMsg_0118) #define _MrmMMsg_0119 _MrmCatgets(Mrm_catd, MS_Mrm, MSG__0119, _MrmMsg_0119) motif-2.3.8/lib/Mrm/MrmItop.c0000644000175000017500000003742213145162623012632 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmItop.c /main/15 1996/11/13 13:58:55 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB facility * * ABSTRACT: * * This module contains the publicly accessible top-level * IDB read & common (to read and write operations) routines. * *-- */ /* * * INCLUDE FILES * */ #include #include #include /* * * TABLE OF CONTENTS * * UrmIdbOpenFileRead Open a file for read access * * UrmIdbOpenBuffer Open a file contained in a buffer * * UrmIdbCloseFile Close an open file * * UrmIdbGetIndexedResource Get indexed resource from file * * UrmIdbFindIndexedResource Find indexed resource(s) in file * * UrmIdbGetRIDResource Get resource id'ed resource from file * * UrmIdbGetResourceId Get next resource id in file * * Idb__FIL_Valid Validate file id */ /* *++ * * PROCEDURE DESCRIPTION: * * IdbOpenFile opens the requested IDB database file, and returns a * handle or id which is used in all subsequent IDB operations. * IdbOpenFile initializes the file's index structures and sets up * any buffers it needs. The database file is opened for read access only. * * FORMAL PARAMETERS: * * name A system-dependent string specifying the IDB file * to be opened. * os_ext An operating-system specific structure which * supports using specific file system features * file_id_return returns the IDB file id used in all other IDB routines * fname_return returns the name of the file actually opened * (via strcpy). Should be at least 256 chars. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND existing file not found * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * * 1. Acquires memory for the file descriptor. * *-- */ Cardinal UrmIdbOpenFileRead (String name, MrmOsOpenParamPtr os_ext, IDBFile *file_id_return, char *fname_return) { /* * Local variables */ Cardinal result ; /* function results */ IDBLowLevelFilePtr fileid ; /* low-level id for file */ IDBFile filedesc ; /* new file descriptor */ int ndx ; /* loop index */ /* * Attempt to open the file. */ result = Idb__FU_OpenFile (name, URMReadAccess, os_ext, &fileid, fname_return) ; if ( result != MrmSUCCESS ) return result ; /* * File successfully opened. Acquire a file descriptor and initialize it. */ filedesc = (IDBFile) XtMalloc (sizeof(IDBOpenFile)) ; if ( filedesc == NULL ) { Idb__FU_CloseFile (fileid, FALSE); return MrmFAILURE ; } filedesc->validation = IDBOpenFileValid ; filedesc->access = URMReadAccess ; filedesc->lowlevel_id = fileid ; filedesc->last_record = 0 ; filedesc->last_data_record = 0 ; filedesc->get_count = 0 ; filedesc->put_count = 0 ; filedesc->class_ctable = NULL; filedesc->resource_ctable = NULL; filedesc->byte_swapped = FALSE ; filedesc->in_memory = FALSE ; filedesc->uid_buffer = NULL ; for ( ndx=IDBrtMin ; ndx<=IDBrtMax ; ndx++ ) filedesc->rt_counts[ndx] = 0 ; /* * Read the file header record info into the file descriptor */ result = Idb__HDR_GetHeader (filedesc) ; if ( result != MrmSUCCESS ) { UrmIdbCloseFile (filedesc, TRUE) ; return result ; } /* * File successfully opened */ *file_id_return = filedesc ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This is a simplified version of UrmIdbOpenFile which opens * a buffer contained in memory. * * FORMAL PARAMETERS: * * uid_buffer the buffer containing the uid file * file_id_return returns the IDB file id used in all other IDB routines * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND existing file not found * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * * 1. Acquires memory for the file descriptor. * *-- */ Cardinal UrmIdbOpenBuffer (unsigned char *uid_buffer, IDBFile *file_id_return) { /* * Local variables */ Cardinal result ; /* function results */ IDBFile filedesc ; /* new file descriptor */ int ndx ; /* loop index */ filedesc = (IDBFile) XtMalloc (sizeof(IDBOpenFile)) ; if ( filedesc == NULL ) return MrmFAILURE ; filedesc->validation = IDBOpenFileValid ; filedesc->access = URMReadAccess ; filedesc->lowlevel_id = NULL ; filedesc->last_record = 0 ; filedesc->last_data_record = 0 ; filedesc->get_count = 0 ; filedesc->put_count = 0 ; filedesc->class_ctable = NULL; filedesc->resource_ctable = NULL; filedesc->byte_swapped = FALSE ; filedesc->in_memory = TRUE ; filedesc->uid_buffer = uid_buffer ; for ( ndx=IDBrtMin ; ndx<=IDBrtMax ; ndx++ ) filedesc->rt_counts[ndx] = 0 ; /* * Read the file header record info into the file descriptor */ result = Idb__HDR_GetHeader (filedesc) ; if ( result != MrmSUCCESS ) return result ; /* * Buffer ready */ *file_id_return = filedesc ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * If the file was opened for read access, then UrmIdbCloseFile simply * closes it. If it was opened for write acccess, then UrmIdbCloseFile * uses keep_new_file to determine its behavior. If keep_new_file is * true, then the file's index structures are updated, the file is * closed, and it becomes the newest version of the database file. * If keep_new_file is false, then the working copy of the file is closed * and deleted, retaining the previous version of the file as the latest * version. In all cases, UrmIdbCloseFile frees all memory structures * associated with the file. * * FORMAL PARAMETERS: * * file_id The IDB file id returned by IdbOpenFile * keep_new_file true if database is to be permanently updated; * false to quit without changing the database * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed * * SIDE EFFECTS: * *-- */ /*ARGSUSED*/ Cardinal UrmIdbCloseFile (IDBFile file_id, Boolean keep_new_file) /* unused */ { /* * Local variables */ Cardinal result ; /* function results */ /* * Local macros */ #define _error_close() \ { \ Idb__FU_CloseFile(file_id->lowlevel_id,TRUE) ; \ file_id->validation = 0 ; \ XtFree((char*)file_id) ; \ return MrmFAILURE ; \ } if ( (result=Idb__FIL_Valid(file_id)) != MrmSUCCESS ) return result ; /* * We are serious about closing this file so deallocate the class and resource * tables before we do anything else. */ if (file_id->class_ctable != NULL) XtFree ((char*)file_id->class_ctable); if (file_id->resource_ctable != NULL) XtFree ((char*)file_id->resource_ctable); /* * If the file was opened for write, update its header */ if ( file_id->access == URMWriteAccess ) { result = Idb__HDR_PutHeader ( file_id ) ; if ( result != MrmSUCCESS ) _error_close () ; } /* * Decommit the file's buffers */ result = Idb__BM_DecommitAll (file_id) ; if ( result != MrmSUCCESS ) _error_close () ; /* * Close the file and deallocate the file descriptor */ result = Idb__FU_CloseFile (file_id->lowlevel_id, FALSE) ; file_id->validation = 0 ; XtFree ((char*)file_id) ; /* * File successfully closed */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * IdbGetIndexedResource attempts to retrieve a resource record with * a matching index. The entry's group and type must match the filters * when these are not null (RMCcNull and RMCtNull respectively). If a * matching entry is found, its resource group, type, access, and data * block are returned in the resource context. The resource context * memory buffer will be reallocated as required to hold the data block. * * FORMAL PARAMETERS: * * file_id The IDB file id returned by IdbOpenFile * index case-sensitive index for the entry to match * group_filter if not null, entry found must match this group * type_filter if not null, entry found must match this type * context_id URM resource context to receieve data block * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND entry not found * MrmWRONG_GROUP entry didn't match group filter * MrmWRONG_TYPE entry didn't match type filter * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal UrmIdbGetIndexedResource (IDBFile file_id, String index, MrmGroup group_filter, MrmType type_filter, URMResourceContextPtr context_id) { /* * Local variables */ Cardinal result ; /* function results */ IDBDataHandle data_entry ; /* return new data entry */ MrmCode group ; /* data entry's group */ MrmCode type ; /* data entry's type */ if ( (result=Idb__FIL_Valid(file_id)) != MrmSUCCESS ) return result ; /* * Attempt to find the item. */ result = Idb__INX_ReturnItem (file_id, index, &data_entry) ; if ( result != MrmSUCCESS ) return result ; result = Idb__DB_GetDataEntry (file_id, data_entry, context_id) ; if ( result != MrmSUCCESS ) return result ; /* * Check group and type against filters. */ group = UrmRCGroup (context_id) ; type = UrmRCType (context_id) ; if ( (group_filter!=URMgNul) && (group_filter!=group) ) return MrmWRONG_GROUP ; if ( (type_filter!=URMtNul) && (type_filter!=type) ) return MrmWRONG_TYPE ; /* * Item successfuly retrieved */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * IdbFindIndexedResource locates and lists all resources in the * database which match the given filters. The entries in the * index list will be in alphabetical order. The index strings must * be deallocated by the caller using UrmFreePlistContents. This * routine returns MrmSUCCESS even if no entries (0 entries) are found. * Failure returns are used only for internal and other errors. * * The number of entries in index_list is not reset to 0 when * the search begins; its state is as the caller gives it. * * FORMAL PARAMETERS: * * file_id The IDB file id returned by IdbOpenFile * group_filter if not null, entries found must match this group * type_filter if not null, entries found must match this type * index_list A pointer list in which to return index * strings for matches. The required strings * are automatically allocated. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal UrmIdbFindIndexedResource (IDBFile file_id, MrmGroup group_filter, MrmType type_filter, URMPointerListPtr index_list) { /* * Local variables */ Cardinal result ; /* function results */ /* * Validate file id, then initiate search with the root node. Return * immediately if there are no indexed resources. */ if ( (result=Idb__FIL_Valid(file_id)) != MrmSUCCESS ) return result ; if ( file_id->num_indexed <= 0 ) return MrmSUCCESS ; return Idb__INX_FindResources (file_id, file_id->index_root, group_filter, type_filter, index_list) ; } /* *++ * * PROCEDURE DESCRIPTION: * * IdbGetRIDResource attempts to retrieve a resource record with a * matching resource id. If there is a resource record associated with * the resource id, it is returned - the resource group, type, and data * block are set in the resource context. The memory buffer in the * resource context is reallocated automatically as require to hold the * data block. * * FORMAL PARAMETERS: * * file_id The IDB file id returned by IdbOpenFile * resource_id resource id matching entry * group_filter if not null, entries found must match this group * type_filter if not null, entries found must match this type * context_id to return data block * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmNOT_FOUND entry not found * MrmWRONG_GROUP entry didn't match group filter * MrmWRONG_TYPE entry didn't match type filter * MrmFAILURE operation failed, no further reason * * SIDE EFFECTS: * *-- */ Cardinal UrmIdbGetRIDResource (IDBFile file_id, MrmResource_id resource_id, MrmGroup group_filter, MrmType type_filter, URMResourceContextPtr context_id) { /* * Local variables */ Cardinal result ; /* function results */ IDBDataHandle data_entry ; /* return new data entry */ MrmCode group ; /* data entry's group */ MrmCode type ; /* data entry's type */ if ( (result=Idb__FIL_Valid(file_id)) != MrmSUCCESS ) return result ; /* * Attempt to find the item. */ result = Idb__RID_ReturnItem (file_id, resource_id, TRUE, &data_entry) ; if ( result != MrmSUCCESS ) return result ; result = Idb__DB_GetDataEntry (file_id, data_entry, context_id) ; if ( result != MrmSUCCESS ) return result ; /* * Check group and type against filters. */ group = UrmRCGroup (context_id) ; type = UrmRCType (context_id) ; if ( (group_filter!=URMgNul) && (group_filter!=group) ) return MrmWRONG_GROUP ; if ( (type_filter!=URMtNul) && (type_filter!=type) ) return MrmWRONG_TYPE ; /* * Item successfuly retrieved */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * IdbGetResourceId returns the next available resource id in the file * * FORMAL PARAMETERS: * * file_id The IDB file id returned by IdbOpenFile * resource_id_return To return new resource id * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE operation failed, no further reason given * * SIDE EFFECTS: * *-- */ Cardinal UrmIdbGetResourceId (IDBFile file_id, MrmResource_id *resource_id_return) { /* * Local variables */ Cardinal result ; /* function results */ IDBResource resource_id; if ( (result=Idb__FIL_Valid((IDBFile)file_id)) != MrmSUCCESS ) return result ; result = Idb__RID_NextRID ((IDBFile)file_id, &resource_id) ; *resource_id_return = resource_id; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine performs a validity check on a (supposed) IDB file * pointer. It should probably signal errors, but currently just * returns a code. * * FORMAL PARAMETERS: * * file_id Supposed pointer to file descriptor to validate * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__FIL_Valid (IDBFile file_id) { if ( file_id == NULL ) return MrmFAILURE ; if ( file_id->validation != IDBOpenFileValid ) return MrmFAILURE ; return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/MrmDecls.h0000644000175000017500000002520113145162623012746 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef MrmDecls_H #define MrmDecls_H /*----------------------------------*/ /* Error messages */ /*----------------------------------*/ /* The symbol _MrmConst is used for constant data that cannot be * declared const in the header file because of usage as arguments to * routines which have string arguments that are not declared const. * * So, _XmConst is always defined to be nothing in header files. * In the source file, however, _XmConst is defined to be const, * so as to allow shared data in a shared library environment. */ #ifndef _MrmConst #define _MrmConst #endif externalref _MrmConst char *_MrmMsg_0000; externalref _MrmConst char *_MrmMsg_0001; externalref _MrmConst char *_MrmMsg_0002; externalref _MrmConst char *_MrmMsg_0003; externalref _MrmConst char *_MrmMsg_0004; externalref _MrmConst char *_MrmMsg_0005; externalref _MrmConst char *_MrmMsg_0006; externalref _MrmConst char *_MrmMsg_0007; externalref _MrmConst char *_MrmMsg_0008; externalref _MrmConst char *_MrmMsg_0009; externalref _MrmConst char *_MrmMsg_0010; externalref _MrmConst char *_MrmMsg_0011; externalref _MrmConst char *_MrmMsg_0012; externalref _MrmConst char *_MrmMsg_0013; externalref _MrmConst char *_MrmMsg_0014; externalref _MrmConst char *_MrmMsg_0015; externalref _MrmConst char *_MrmMsg_0016; externalref _MrmConst char *_MrmMsg_0017; externalref _MrmConst char *_MrmMsg_0018; externalref _MrmConst char *_MrmMsg_0019; externalref _MrmConst char *_MrmMsg_0020; externalref _MrmConst char *_MrmMsg_0021; externalref _MrmConst char *_MrmMsg_0022; externalref _MrmConst char *_MrmMsg_0023; externalref _MrmConst char *_MrmMsg_0024; externalref _MrmConst char *_MrmMsg_0025; externalref _MrmConst char *_MrmMsg_0026; externalref _MrmConst char *_MrmMsg_0027; externalref _MrmConst char *_MrmMsg_0028; externalref _MrmConst char *_MrmMsg_0029; externalref _MrmConst char *_MrmMsg_0030; externalref _MrmConst char *_MrmMsg_0031; externalref _MrmConst char *_MrmMsg_0032; externalref _MrmConst char *_MrmMsg_0033; externalref _MrmConst char *_MrmMsg_0034; externalref _MrmConst char *_MrmMsg_0035; externalref _MrmConst char *_MrmMsg_0036; externalref _MrmConst char *_MrmMsg_0037; externalref _MrmConst char *_MrmMsg_0038; externalref _MrmConst char *_MrmMsg_0039; externalref _MrmConst char *_MrmMsg_0040; externalref _MrmConst char *_MrmMsg_0041; externalref _MrmConst char *_MrmMsg_0042; externalref _MrmConst char *_MrmMsg_0043; externalref _MrmConst char *_MrmMsg_0044; externalref _MrmConst char *_MrmMsg_0045; externalref _MrmConst char *_MrmMsg_0046; externalref _MrmConst char *_MrmMsg_0047; externalref _MrmConst char *_MrmMsg_0048; externalref _MrmConst char *_MrmMsg_0049; externalref _MrmConst char *_MrmMsg_0050; externalref _MrmConst char *_MrmMsg_0051; externalref _MrmConst char *_MrmMsg_0052; externalref _MrmConst char *_MrmMsg_0053; externalref _MrmConst char *_MrmMsg_0054; externalref _MrmConst char *_MrmMsg_0055; externalref _MrmConst char *_MrmMsg_0056; externalref _MrmConst char *_MrmMsg_0057; externalref _MrmConst char *_MrmMsg_0058; externalref _MrmConst char *_MrmMsg_0059; externalref _MrmConst char *_MrmMsg_0060; externalref _MrmConst char *_MrmMsg_0061; externalref _MrmConst char *_MrmMsg_0062; externalref _MrmConst char *_MrmMsg_0063; externalref _MrmConst char *_MrmMsg_0064; externalref _MrmConst char *_MrmMsg_0065; externalref _MrmConst char *_MrmMsg_0066; externalref _MrmConst char *_MrmMsg_0067; externalref _MrmConst char *_MrmMsg_0068; externalref _MrmConst char *_MrmMsg_0069; externalref _MrmConst char *_MrmMsg_0070; externalref _MrmConst char *_MrmMsg_0071; externalref _MrmConst char *_MrmMsg_0072; externalref _MrmConst char *_MrmMsg_0073; externalref _MrmConst char *_MrmMsg_0074; externalref _MrmConst char *_MrmMsg_0075; externalref _MrmConst char *_MrmMsg_0076; externalref _MrmConst char *_MrmMsg_0077; externalref _MrmConst char *_MrmMsg_0078; externalref _MrmConst char *_MrmMsg_0079; externalref _MrmConst char *_MrmMsg_0080; externalref _MrmConst char *_MrmMsg_0081; externalref _MrmConst char *_MrmMsg_0082; externalref _MrmConst char *_MrmMsg_0083; externalref _MrmConst char *_MrmMsg_0084; externalref _MrmConst char *_MrmMsg_0085; externalref _MrmConst char *_MrmMsg_0086; externalref _MrmConst char *_MrmMsg_0087; externalref _MrmConst char *_MrmMsg_0088; externalref _MrmConst char *_MrmMsg_0089; externalref _MrmConst char *_MrmMsg_0090; externalref _MrmConst char *_MrmMsg_0091; externalref _MrmConst char *_MrmMsg_0092; externalref _MrmConst char *_MrmMsg_0093; externalref _MrmConst char *_MrmMsg_0094; externalref _MrmConst char *_MrmMsg_0095; externalref _MrmConst char *_MrmMsg_0096; externalref _MrmConst char *_MrmMsg_0097; externalref _MrmConst char *_MrmMsg_0098; externalref _MrmConst char *_MrmMsg_0099; externalref _MrmConst char *_MrmMsg_0100; externalref _MrmConst char *_MrmMsg_0101; externalref _MrmConst char *_MrmMsg_0102; externalref _MrmConst char *_MrmMsg_0103; externalref _MrmConst char *_MrmMsg_0104; externalref _MrmConst char *_MrmMsg_0105; externalref _MrmConst char *_MrmMsg_0106; externalref _MrmConst char *_MrmMsg_0107; externalref _MrmConst char *_MrmMsg_0108; externalref _MrmConst char *_MrmMsg_0109; /* BEGIN OSF Fix CR 4859 */ externalref _MrmConst char *_MrmMsg_0110; /* END OSF Fix CR 4859 */ externalref _MrmConst char *_MrmMsg_0111; externalref _MrmConst char *_MrmMsg_0112; externalref _MrmConst char *_MrmMsg_0113; externalref _MrmConst char *_MrmMsg_0114; externalref _MrmConst char *_MrmMsg_0115; externalref _MrmConst char *_MrmMsg_0116; externalref _MrmConst char *_MrmMsg_0117; externalref _MrmConst char *_MrmMsg_0118; externalref _MrmConst char *_MrmMsg_0119; /*----------------------------------*/ /* URM external routines (Motif) */ /*----------------------------------*/ #ifndef _ARGUMENTS #define _ARGUMENTS(arglist) arglist #endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* mrminit.c */ extern void MrmInitialize _ARGUMENTS(( void )); /* mrmlread.c */ extern Cardinal MrmFetchLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , Display *display , XtPointer *value_return , MrmCode *type_return )); extern Cardinal MrmFetchIconLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , Screen *screen , Display *display , Pixel fgpix , Pixel bgpix , Pixmap *pixmap_return )); extern Cardinal MrmFetchBitmapLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , Screen *screen , Display *display , Pixmap *pixmap_return , Dimension *width , Dimension *height)); extern Cardinal MrmFetchColorLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , Display *display , Colormap cmap , Pixel *pixel_return )); /* Deal with Wide stuff now because there is an error in Saber 3.0 */ #if NeedWidePrototypes extern Cardinal MrmOpenHierarchy _ARGUMENTS(( int num_files , String *name_list , MrmOsOpenParamPtr *os_ext_list , MrmHierarchy *hierarchy_id_return )); extern Cardinal MrmOpenHierarchyPerDisplay _ARGUMENTS(( Display *display , int num_files , String *name_list , MrmOsOpenParamPtr *os_ext_list , MrmHierarchy *hierarchy_id_return )); extern Cardinal MrmRegisterNames _ARGUMENTS(( MrmRegisterArglist reglist ,int num_reg )); extern Cardinal MrmRegisterNamesInHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id , MrmRegisterArglist reglist , int num_reg )); #if defined(__cplusplus) || defined(c_plusplus) extern Cardinal MrmRegisterClass _ARGUMENTS(( int class_code , String class_name , String create_name , Widget (*creator )(...), WidgetClass class_record )); extern Cardinal MrmRegisterClassWithCleanup _ARGUMENTS(( int class_code , String class_name , String create_name , Widget (*creator )(), WidgetClass class_record, void (*cleanup)(...) )); #else extern Cardinal MrmRegisterClass _ARGUMENTS(( int class_code , String class_name , String create_name , Widget (*creator )(), WidgetClass class_record )); extern Cardinal MrmRegisterClassWithCleanup _ARGUMENTS(( int class_code , String class_name , String create_name , Widget (*creator )(), WidgetClass class_record, void (*cleanup)() )); #endif #else extern Cardinal MrmOpenHierarchy _ARGUMENTS(( MrmCount num_files , String *name_list , MrmOsOpenParamPtr *os_ext_list , MrmHierarchy *hierarchy_id_return )); extern Cardinal MrmOpenHierarchyPerDisplay _ARGUMENTS(( Display *display , MrmCount num_files , String *name_list , MrmOsOpenParamPtr *os_ext_list , MrmHierarchy *hierarchy_id_return )); extern Cardinal MrmRegisterNames _ARGUMENTS(( MrmRegisterArglist reglist ,MrmCount num_reg )); extern Cardinal MrmRegisterNamesInHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id , MrmRegisterArglist reglist , MrmCount num_reg )); extern Cardinal MrmRegisterClass _ARGUMENTS(( MrmType class_code , String class_name , String create_name , Widget (*creator )(), WidgetClass class_record )); extern Cardinal MrmRegisterClassWithCleanup _ARGUMENTS(( MrmType class_code , String class_name , String create_name , Widget (*creator )(), WidgetClass class_record, void (*cleanup)() )); #endif extern Cardinal MrmCloseHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id )); extern Cardinal MrmFetchInterfaceModule _ARGUMENTS(( MrmHierarchy hierarchy_id , char *module_name , Widget parent , Widget *w_return )); extern Cardinal MrmFetchWidget _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , Widget parent , Widget *w_return , MrmType *class_return )); extern Cardinal MrmFetchWidgetOverride _ARGUMENTS(( MrmHierarchy hierarchy_id , String index , Widget parent , String ov_name , ArgList ov_args , Cardinal ov_num_args , Widget *w_return , MrmType *class_return )); extern Cardinal MrmFetchSetValues _ARGUMENTS(( MrmHierarchy hierarchy_id , Widget w , ArgList args , Cardinal num_args )); /* mrmwci.c */ /* extern Cardinal XmRegisterMrmCallbacks () ; */ #if defined(__cplusplus) || defined(c_plusplus) } #endif #undef _ARGUMENTS #endif /* MrmDecls_H */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/lib/Mrm/Mrmcontext.c0000644000175000017500000001624713145162623013405 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmcontext.c /main/12 1996/11/13 14:00:18 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * URM context routines * * ABSTRACT: * * These routines create, modify, and delete a URM context structure. * Note that accessors for a URM context are macros. * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * UrmGetResourceContext - Allocate a new resource context * * UrmResizeResourceContext - Resize a resource context * * UrmFreeResourceContext - Free a resource context * */ /* *++ * * PROCEDURE DESCRIPTION: * * UrmGetResourceContext allocates a new resource context, then * allocates a memory buffer of the requested size and associates it * with the context. * * FORMAL PARAMETERS: * * alloc_func Function to use in allocating memory for this * context. A null pointer means use default * (XtMalloc). * free_func Function to use in freeing memory for this * context. A null pointer means use default * (XtFree). * size Size of memory buffer to allocate. * context_id_return To return new context. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE allocation failure * * SIDE EFFECTS: * *-- */ Cardinal UrmGetResourceContext (char *((*alloc_func) ()), void (*free_func) (), MrmSize size, URMResourceContextPtr *context_id_return) { /* * Set function defaults if NULL */ if ( alloc_func == NULL ) alloc_func = XtMalloc ; if ( free_func == NULL ) free_func = XtFree ; /* * Allocate the context buffer and memory buffer, and set the * context up. */ *context_id_return = (URMResourceContextPtr) (*alloc_func) (sizeof(URMResourceContext)) ; if ( *context_id_return == NULL ) return Urm__UT_Error ("UrmGetResourceContext", _MrmMMsg_0027, NULL, *context_id_return, MrmFAILURE) ; (*context_id_return)->validation = URMResourceContextValid ; (*context_id_return)->data_buffer = NULL ; if ( size > 0 ) { (*context_id_return)->data_buffer = (char *) (*alloc_func) (size) ; if ( (*context_id_return)->data_buffer == NULL ) { (*free_func) (*context_id_return) ; return Urm__UT_Error ("UrmGetResourceContext", _MrmMMsg_0001, NULL, *context_id_return, MrmFAILURE) ; } } (*context_id_return)->buffer_size = size ; (*context_id_return)->resource_size = 0 ; (*context_id_return)->group = URMgNul ; (*context_id_return)->type = URMtNul ; (*context_id_return)->access = 0 ; (*context_id_return)->lock = 0 ; (*context_id_return)->alloc_func = alloc_func ; (*context_id_return)->free_func = free_func ; /* * Context successfully created */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmResizeResourceContext reallocates the memory buffer in a * resource context to increase its size. The contents of the current * memory buffer are copied into the new memory buffer. If the size * parameter is smaller than the current memory buffer size, the request * is ignored. If the size parameter is greater than MrmMaxResourceSize, a * MrmTooMany error is returned * * FORMAL PARAMETERS: * * context_id Resource context to receive resized memory buffer * size New size for memory buffer in resource context * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT Illegal resource context * MrmFAILURE memory allocation failure * MrmTOO_MANY size was larger than MrmMaxResourceSize * * SIDE EFFECTS: * *-- */ Cardinal UrmResizeResourceContext (URMResourceContextPtr context_id, int size) { /* * Local variables */ char *newbuf ; /* new buffer */ if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmResizeResourceContext", _MrmMMsg_0028, NULL, context_id, MrmBAD_CONTEXT) ; if ( size > MrmMaxResourceSize) return Urm__UT_Error ("MrmResizeResourceContext", _MrmMMsg_0029, NULL, context_id, MrmTOO_MANY) ; /* * CR 8391: buffer will eventually be passed to * Urm__CW_EvaluateValOrOffset which is expecting a long. Make sure to * allocate at least a long so that we don't get array bounds read * violations. Ideally Urm__CW_EvaluateValOrOffset and the code that * calls it should be rewritten, but we don't have time for that now. */ if (size < sizeof(long)) size = sizeof(long); /* * Resize unless buffer is bigger than requested size. */ if ( context_id->buffer_size > size ) return MrmSUCCESS ; /* * Allocate the new buffer, copy the old buffer contents, and * update the context. */ if ( context_id->alloc_func == XtMalloc ) { context_id->data_buffer = XtRealloc (context_id->data_buffer, size) ; context_id->buffer_size = size ; } else { newbuf = (char *) (*(context_id->alloc_func)) (size) ; if ( newbuf == NULL ) return Urm__UT_Error ("UrmResizeResourceContext", _MrmMMsg_0001, NULL, context_id, MrmFAILURE) ; if ( context_id->data_buffer != NULL ) { UrmBCopy (context_id->data_buffer, newbuf, context_id->buffer_size) ; (*(context_id->free_func)) (context_id->data_buffer) ; } context_id->data_buffer = newbuf ; context_id->buffer_size = size ; } /* * Resize succeeded */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * UrmFreeResourceContext frees the memory buffer and the * resource context. * * FORMAL PARAMETERS: * * context_id Resource context to be freed * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_CONTEXT Illegal resource context * * SIDE EFFECTS: * *-- */ Cardinal UrmFreeResourceContext (URMResourceContextPtr context_id) { if ( ! UrmRCValid(context_id) ) return Urm__UT_Error ("UrmFreeResourceContext", _MrmMMsg_0028, NULL, context_id, MrmBAD_CONTEXT) ; context_id->validation = 0 ; if ( context_id->data_buffer != NULL ) (*(context_id->free_func)) (context_id->data_buffer) ; (*(context_id->free_func)) (context_id) ; return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/Mrmwvalues.c0000644000175000017500000002217313145162623013402 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Mrmwvalues.c /main/12 1999/04/16 09:42:44 mgreess $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * This module contains the routines which implement modifying * a widget (XtSetValues) from UID literals. * *-- */ /* * * INCLUDE FILES * */ #include #include /* * * TABLE OF CONTENTS * * UrmFetchSetValues Do XtSetValues from UID literals. * */ /* *++ * * PROCEDURE DESCRIPTION: * * UrmFetchSetValues is the internal routine which will * modify a widget via XtSetValues on an argument list whose values * are evaluated literals from a URM hierarchy. * * The args list has ordinary Strings as each tag name. Each value * is interpreted as a String whose value is the index of a literal * to be fetched and evaluated as the actual value. This routine * constructs its own arglist, copying each tag, and setting the * value to the fetched, fixed up, and converted literal value. The * argument is not set in this list (is dropped) if there are any * errors. * * This code must also handle pixmaps in the same way that URM does; * it defers converting icons and inserting them in the list * until all the rest of the arglist is done; this allows FG/BG * values to be uncovered in the list for use in the pixmap. * * FORMAL PARAMETERS: * * hierarchy_id URM hierarchy from which to read public resources * w widget to be modified * args arglist, with literal indexes as values * num_args # args in args * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmPARTIAL_SUCCESS at least one fetch suboperation succeeded * other any error fatal to the operation * * SIDE EFFECTS: * *-- */ Cardinal UrmFetchSetValues (MrmHierarchy hierarchy_id , Widget w , ArgList args , Cardinal num_args ) { /* * Local structures */ typedef struct { RGMIconImagePtr icon ; /* icon to be converted */ int pixndx ; /* argument in arglist (args) */ } _SavePixmapArg, *_SavePixmapArgPtr ; /* * Local variables */ Cardinal result ; /* function results */ int num_succ = 0; /* # of successful fetches */ int fet_fail = 0; /* # of failed fetches */ int cvt_fail = 0; /* # failed conversions */ Cardinal badfet_res = MrmNOT_FOUND; /* to save NOT_FOUND */ ArgList locargs ; /* local arglist */ Cardinal num_used = 0 ; /* # args used in arglist */ RGMResourceDescPtr resptr ; /* descriptor for literals */ int indexlen = 0 ; /* longest literal length */ URMPointerListPtr ptrlist ; /* to hold scratch contexts */ int ndx ; /* loop index */ IDBFile file_id ; /* file from which literal read */ MrmType reptype ; /* arg value representation type */ long val ; /* value as immediate or pointer */ int vec_count ; /* number of items in val if vector */ int vec_size ; _SavePixmapArg pixargs[10] ; /* to save pixmap args */ Cardinal pixargs_cnt = 0 ; /* # pixargs saved */ _SavePixmapArgPtr savepix ; /* current saved pixmap entry */ Screen *screen ; /* screen for pixmaps */ Display *display ; /* display for pixmaps */ Pixel fgint = (Pixel) -1 ; /* fg for pixmaps. */ Pixel bgint = (Pixel) -1 ; /* background for pixmaps */ Pixmap pixmap ; /* pixmap created from icon */ Boolean swap_needed = FALSE; /* * Create local arglist and pointer list for contexts. */ locargs = (ArgList) XtMalloc (num_args*sizeof(Arg)) ; UrmPlistInit (num_args, &ptrlist) ; /* * Find the longest literal index, and allocate a resource descriptor * which can hold it. Set the fixed fields of the descriptor. */ for ( ndx=0 ; ndxaccess = URMaPublic ; resptr->type = URMrIndex ; resptr->res_group = URMgLiteral ; resptr->cvt_type = URMtNul ; /* * Loop through all the entries in the given arglist. Copy each tag into * the local arglist. Create a new context to hold the literal, then * try to read it from the hierarchy. */ for ( ndx=0 ; ndxkey.index, (char*)args[ndx].value) ; result = Urm__CW_ReadLiteral (resptr, hierarchy_id, NULL, ptrlist, &reptype, &val, &vec_count, &file_id, &vec_size) ; if ( result == MrmSUCCESS ) num_succ += 1; else { fet_fail += 1; if ( result != MrmNOT_FOUND ) badfet_res = result; continue; } /* * Fix up and perform conversion on the value. If this succeeds, put it * in the local arglist. Special casing is required for some types, * particularly icons. * * Type conversion for some ASCIZ strings is also provided as a V1 * compatibility feature. */ switch ( reptype ) { case MrmRtypeIconImage: savepix = &pixargs[pixargs_cnt] ; savepix->icon = (RGMIconImagePtr) val ; savepix->pixndx = ndx ; pixargs_cnt += 1 ; continue ; case MrmRtypeFontList: /* Check for 1.1 version and malloc new fontlist if necessary. */ if (strcmp(file_id->db_version, URM1_1version) <= 0) { int count = ((OldRGMFontListPtr)val)->count; RGMFontListPtr fontlist = (RGMFontListPtr) XtMalloc(sizeof(RGMFontList) + (sizeof(RGMFontItem) * (count - 1))); result = Urm__CW_FixupValue((long)fontlist, reptype, (XtPointer)val, file_id, &swap_needed); XtFree((char *)val); val = (long)fontlist; } else result = Urm__CW_FixupValue (val, reptype, (XtPointer)val, file_id, &swap_needed) ; default: result = Urm__CW_FixupValue (val, reptype, (XtPointer)val, file_id, &swap_needed) ; if ( result != MrmSUCCESS ) { num_succ -= 1; cvt_fail += 1; continue; } if (XtIsWidget(w)) display = XtDisplay(w); else display = XtDisplay(XtParent(w)); result = Urm__CW_ConvertValue (XtParent(w), &val, reptype, (MrmType)0, display, hierarchy_id, NULL) ; if ( result != MrmSUCCESS ) { num_succ -= 1; cvt_fail += 1; continue; } locargs[num_used].value = (XtArgVal)val ; num_used += 1 ; break ; } /* * Do any processing based on specific arguments (after conversion): * - retain FG/BG info */ switch ( reptype ) { case MrmRtypeColor: if ( strcmp(args[ndx].name,XmNforeground) == 0 ) fgint = val; else if ( strcmp (args[ndx].name,XmNbackground) == 0 ) bgint = val; break ; } } /* end loop */ /* * Now set any pixmap arguments. This requires finding the display, screen, * foreground, and background values for this widget. These values are * available from the parent widget and the arglist. */ if ( pixargs_cnt > 0 ) { Urm__CW_GetPixmapParms (w, &screen, &display, &fgint, &bgint) ; for ( ndx=0,savepix=pixargs ; ndxicon, screen, display, (Pixel)fgint, (Pixel)bgint, &pixmap, w) ; if ( result != MrmSUCCESS ) { num_succ -= 1; cvt_fail += 1; continue; } locargs[num_used].name = args[savepix->pixndx].name ; locargs[num_used].value = (XtArgVal) pixmap ; num_used += 1 ; } } /* * arglist creation complete. Modify the widget if we have succeeded in * fetching any values. Deallocate resources. */ if ( num_used > 0 ) XtSetValues (w, locargs, num_used) ; XtFree ((char*)locargs) ; XtFree ((char*)resptr) ; for ( ndx=0 ; ndx 0 ) { if ( fet_fail==0 && cvt_fail == 0 ) return MrmSUCCESS; else return MrmPARTIAL_SUCCESS; } if ( fet_fail > 0 ) return badfet_res; else return MrmFAILURE; } motif-2.3.8/lib/Mrm/MrmIswap.c0000644000175000017500000003335012672140200012765 00000000000000/* $XConsortium: MrmIswap.c /main/7 1996/11/13 13:58:35 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef HAVE_CONFIG_H #include #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB Facility * Byte Swap routines for IDB records * * ABSTRACT: * * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include #include "MrmosI.h" #include "MrmMsgI.h" /* *++ * * PROCEDURE DESCRIPTION: * * Idb__BM_SwapBytes performs byte swapping on the (currently 6) * record types in an IDB file * * FORMAL PARAMETERS: * * buffer Record buffer to swap in place * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__BM_SwapRecordBytes (IDBRecordBufferPtr buffer) { /* * Local variables */ Cardinal ndx; /* loop index */ IDBDummyRecordPtr idb_record; /* pointer to the generic IDB record */ IDBRecordHeaderPtr idb_header; /* pointer to hdr w/type and record # */ IDBHeaderRecordPtr header_rec; /* pointer to record type IDBrtHeader */ IDBHeaderHdrPtr header_hdr; /* pointer to the header in the header */ IDBIndexLeafRecordPtr leaf_rec; /* pointer to record type IDBrtIndexLeaf */ IDBIndexNodeRecordPtr node_rec; /* pointer to record type IDBrtIndexNode */ IDBridMapRecordPtr ridmap_rec; /* pointer to record type IDBrtRIDMap */ IDBDataRecordPtr data_rec; /* pointer to record type IDBrtData */ char err_msg[300] ; if ( ! Idb__BM_Valid(buffer) ) return Urm__UT_Error("Idb__BM_MarkActivity", _MrmMMsg_0002, NULL, NULL, MrmNOT_VALID) ; /* load pointers to the record and record header */ idb_record = (IDBDummyRecordPtr) buffer->IDB_record ; idb_header = (IDBRecordHeaderPtr)&idb_record->header ; /* swap the remaining record entries in IDBRecordHeader */ swapbytes( idb_header->record_type ) ; swapbytes( idb_header->record_num ) ; /* * Swap IDB record items based on record type */ switch ( idb_header->record_type ) { case IDBrtHeader: header_rec = (IDBHeaderRecordPtr)buffer->IDB_record ; header_hdr = (IDBHeaderHdrPtr)&header_rec->header_hdr ; /* swap the HeaderHdr first */ swapbytes( header_hdr->index_root ); swapbytes( header_hdr->num_indexed ); swapbytes( header_hdr->num_RID ); /* VAR check */ #ifdef WORD64 swap4bytes( header_hdr->next_RID.internal_id.map_rec ); swap4bytes( header_hdr->next_RID.internal_id.res_index ); #else swap2bytes( header_hdr->next_RID.internal_id.map_rec ); swap2bytes( header_hdr->next_RID.internal_id.res_index ); #endif swapbytes( header_hdr->last_record ); swapbytes( header_hdr->last_data_record ); for( ndx=0 ; ndx < URMgVecSize ; ndx++) swapbytes(header_hdr->group_counts[ndx]); for( ndx=0 ; ndx < IDBrtVecSize ; ndx++) swapbytes(header_hdr->rt_counts[ndx]); /* now swap the rest of the header */ /* VAR check */ for( ndx=0 ; ndx < IDBHeaderRIDMax ; ndx++) { swap2bytes(header_rec->RID_pointers[ndx].internal_id.rec_no); swap2bytes(header_rec->RID_pointers[ndx].internal_id.item_offs); } swapbytes( header_rec->num_entry ); swapbytes( header_rec->last_entry ); swapbytes( header_rec->free_ptr ); swapbytes( header_rec->free_count ); break; case IDBrtIndexLeaf: leaf_rec = (IDBIndexLeafRecordPtr)buffer->IDB_record ; swapbytes( leaf_rec->leaf_header.parent ); swapbytes( leaf_rec->leaf_header.index_count ); swapbytes( leaf_rec->leaf_header.heap_start ); swapbytes( leaf_rec->leaf_header.free_bytes ); for( ndx=0 ; ndx < leaf_rec->leaf_header.index_count ; ndx++ ) { swapbytes( leaf_rec->index[ndx].index_stg ); swap2bytes( leaf_rec->index[ndx].data.internal_id.rec_no ); swap2bytes( leaf_rec->index[ndx].data.internal_id.item_offs ); } break; case IDBrtIndexNode: node_rec = (IDBIndexNodeRecordPtr)buffer->IDB_record ; swapbytes( node_rec->node_header.parent ); swapbytes( node_rec->node_header.index_count ); swapbytes( node_rec->node_header.heap_start ); swapbytes( node_rec->node_header.free_bytes ); for( ndx=0 ; ndx < node_rec->node_header.index_count ; ndx++ ) { swapbytes( node_rec->index[ndx].index_stg ); swap2bytes( node_rec->index[ndx].data.internal_id.rec_no ); swap2bytes( node_rec->index[ndx].data.internal_id.item_offs ); swapbytes( node_rec->index[ndx].LT_record ); swapbytes( node_rec->index[ndx].GT_record ); } break; case IDBrtRIDMap: ridmap_rec = (IDBridMapRecordPtr)buffer->IDB_record ; ndx = 0; while ( (ndx < IDBridPtrVecMax) && (ridmap_rec->pointers[ndx].internal_id.rec_no != 0) ) { swap2bytes( ridmap_rec->pointers[ndx].internal_id.rec_no ); swap2bytes( ridmap_rec->pointers[ndx].internal_id.item_offs ); ndx++; } break; case IDBrtData: data_rec = (IDBDataRecordPtr)buffer->IDB_record ; swapbytes( data_rec->data_header.num_entry ); swapbytes( data_rec->data_header.last_entry ); swapbytes( data_rec->data_header.free_ptr ); swapbytes( data_rec->data_header.free_count ); break; default: sprintf(err_msg, _MrmMMsg_0020, idb_header->record_num, idb_header->record_type); return Urm__UT_Error ("Idb__BM_SwapRecordBytes", err_msg, NULL, NULL, MrmFAILURE) ; } return MrmSUCCESS ; } unsigned Urm__SwapValidation (unsigned validation) { swapbytes(validation); return validation; } Cardinal Urm__SwapRGMResourceDesc (RGMResourceDescPtr res_desc) { IDBridDesc *idb_rid_ptr; swapbytes( res_desc->size ); swapbytes( res_desc->annex1 ); if ( res_desc->type == URMrRID ) { idb_rid_ptr = (IDBridDesc *)&(res_desc->key.id); #ifdef WORD64 swap4bytes( idb_rid_ptr->internal_id.map_rec ); swap4bytes( idb_rid_ptr->internal_id.res_index ); #else swap2bytes( idb_rid_ptr->internal_id.map_rec ); swap2bytes( idb_rid_ptr->internal_id.res_index ); #endif } return MrmSUCCESS; } Cardinal Urm__SwapRGMCallbackDesc (RGMCallbackDescPtr callb_desc, RGMWidgetRecordPtr widget_rec) { Cardinal ndx; /* inner loop index */ RGMResourceDescPtr res_desc; /* resource description literal */ char err_msg[300]; swapbytes( callb_desc->validation ); swapbytes( callb_desc->count ); swapbytes( callb_desc->annex ); swapbytes( callb_desc->unres_ref_count ); for (ndx=0 ; ndx < callb_desc->count ; ndx++) { #ifdef WORD64 swap4bytes( callb_desc->item[ndx].cb_item.routine ); swap4bytes( callb_desc->item[ndx].cb_item.rep_type ); #else swap2bytes( callb_desc->item[ndx].cb_item.routine ); swap2bytes( callb_desc->item[ndx].cb_item.rep_type ); #endif switch (callb_desc->item[ndx].cb_item.rep_type) { case MrmRtypeInteger: case MrmRtypeBoolean: swapbytes( callb_desc->item[ndx].cb_item.datum.ival ); break; case MrmRtypeSingleFloat: swapbytes( callb_desc->item[ndx].cb_item.datum.ival ); _MrmOSIEEEFloatToHost((float *) &(callb_desc->item[ndx].cb_item.datum.ival)); case MrmRtypeNull: break; case MrmRtypeResource: swapbytes( callb_desc->item[ndx].cb_item.datum.offset ); res_desc = (RGMResourceDesc *) ((char *)widget_rec + callb_desc->item[ndx].cb_item.datum.offset); Urm__SwapRGMResourceDesc( res_desc ); /* flag this resource as needing further byte swapping */ res_desc->cvt_type |= MrmResourceUnswapped; break; default: swapbytes( callb_desc->item[ndx].cb_item.datum.offset ); sprintf(err_msg, _MrmMMsg_0021, callb_desc->item[ndx].cb_item.rep_type, ndx); return Urm__UT_Error ("Urm__SwapRGMCallbackDesc", err_msg, NULL, NULL, MrmFAILURE) ; break; } } return MrmSUCCESS; } /* *++ * * PROCEDURE DESCRIPTION: * * * FORMAL PARAMETERS: * * buffer Record buffer to swap in place * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Urm__SwapRGMWidgetRecord(RGMWidgetRecordPtr widget_rec) { /* * Local variables */ RGMArgListDescPtr arg_list; /* pointer to widget arglist */ RGMChildrenDescPtr child_list; /* pointer to the widgets children */ RGMResourceDescPtr res_desc; /* resource description literal */ RGMCallbackDescPtr callb_desc; /* pointer to a callback decriptor */ Cardinal ndx; /* loop index */ IDBridDesc *idb_rid_ptr; void *offset; /* generic offset pointer */ char err_msg[300]; /* Swap the main part of the widget record */ swapbytes( widget_rec->size ); swapbytes( widget_rec->access ); swapbytes( widget_rec->lock ); swapbytes( widget_rec->type ); swapbytes( widget_rec->name_offs ); swapbytes( widget_rec->class_offs ); swapbytes( widget_rec->arglist_offs ); swapbytes( widget_rec->children_offs ); swapbytes( widget_rec->comment_offs ); swapbytes( widget_rec->creation_offs ); swapbytes( widget_rec->variety ); swapbytes( widget_rec->annex ); /* handle the argument list */ if (widget_rec->arglist_offs > 0) { arg_list = (RGMArgListDesc *) ((char *)widget_rec + widget_rec->arglist_offs); swapbytes( arg_list->count ); swapbytes( arg_list->extra ); for ( ndx=0 ; ndxcount ; ndx++ ) { swapbytes( arg_list->args[ndx].tag_code ); swapbytes( arg_list->args[ndx].stg_or_relcode.tag_offs ); swapbytes( arg_list->args[ndx].arg_val.rep_type ); switch( arg_list->args[ndx].arg_val.rep_type ) { case MrmRtypeInteger: case MrmRtypeBoolean: swapbytes( arg_list->args[ndx].arg_val.datum.ival ); break; case MrmRtypeSingleFloat: swapbytes( arg_list->args[ndx].arg_val.datum.ival ); _MrmOSIEEEFloatToHost((float *) &(arg_list->args[ndx].arg_val.datum.ival)); default: swapbytes( arg_list->args[ndx].arg_val.datum.offset ); break; } offset = ((char *)widget_rec+ arg_list->args[ndx].arg_val.datum.offset); switch( arg_list->args[ndx].arg_val.rep_type ) { /* these are immediate, do nothing special */ case MrmRtypeInteger: case MrmRtypeBoolean: case MrmRtypeSingleFloat: break; /* these are offsets into the file, handle them specially */ case MrmRtypeCallback: callb_desc = (RGMCallbackDesc * )offset; Urm__SwapRGMCallbackDesc( callb_desc, widget_rec ); break; case MrmRtypeResource: res_desc = (RGMResourceDesc *)offset; Urm__SwapRGMResourceDesc( res_desc ); /* flag this resource as needing further byte swapping */ res_desc->cvt_type |= MrmResourceUnswapped; break; case MrmRtypeHorizontalInteger: case MrmRtypeVerticalInteger: case MrmRtypeHorizontalFloat: case MrmRtypeVerticalFloat: case MrmRtypeChar8: case MrmRtypeChar8Vector: case MrmRtypeCString: case MrmRtypeCStringVector: case MrmRtypeFloat: case MrmRtypePixmapImage: case MrmRtypePixmapDDIF: case MrmRtypeNull: case MrmRtypeAddrName: case MrmRtypeIconImage: case MrmRtypeFont: case MrmRtypeFontList: case MrmRtypeColor: case MrmRtypeColorTable: case MrmRtypeAny: case MrmRtypeTransTable: case MrmRtypeClassRecName: case MrmRtypeIntegerVector: case MrmRtypeXBitmapFile: case MrmRtypeCountedVector: case MrmRtypeKeysym: case MrmRtypeWideCharacter: case MrmRtypeFontSet: sprintf(err_msg,_MrmMMsg_0022, arg_list->args[ndx].arg_val.rep_type); return Urm__UT_Error ("Urm__SwapRGMWidgetRecord", err_msg, NULL, NULL, MrmFAILURE) ; break; } } } /* handle the child list */ if (widget_rec->children_offs > 0) { child_list = (RGMChildrenDesc *) ((char *)widget_rec + widget_rec->children_offs); swapbytes( child_list->count ); swapbytes( child_list->unused1 ); swapbytes( child_list->annex1 ); for ( ndx=0 ; ndxcount ; ndx++ ) { swapbytes( child_list->child[ndx].annex1 ); if (child_list->child[ndx].type == URMrRID ) { idb_rid_ptr = (IDBridDesc *)&(child_list->child[ndx].key.id); #ifdef WORD64 swap4bytes( idb_rid_ptr->internal_id.map_rec ); swap4bytes( idb_rid_ptr->internal_id.res_index ); #else swap2bytes( idb_rid_ptr->internal_id.map_rec ); swap2bytes( idb_rid_ptr->internal_id.res_index ); #endif } else swapbytes( child_list->child[ndx].key.index_offs ); } } /* handle the creation callback, if any */ if (widget_rec->creation_offs > 0) { callb_desc = (RGMCallbackDesc * ) ((char *)widget_rec + widget_rec->creation_offs); Urm__SwapRGMCallbackDesc( callb_desc, widget_rec ); } return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/MrmIindexw.c0000644000175000017500000012663613145162623013334 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: MrmIindexw.c /main/12 1996/11/13 13:57:54 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): IDB Facility * Index management routines * * ABSTRACT: * * These routines manage the index of an IDB file, including * retrieving data entries accessed by index, and maintaing the * index structure, particularly index splitting * *-- */ /* * * INCLUDE FILES * */ #include #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * * Idb__INX_EnterItem - Enter a data entry under an index * * Idb__INX_EnterLeafIndex - Add an entry to a leaf record * * Idb__INX_EnterNodeIndex - Add an entry to a node record * * Idb__INX_SplitLeafRecord - Split a leaf index record * * Idb__INX_SplitNodeRecord - Split a node index record * * Idb__INX_InitRootLeafRecord - Init a (root) leaf index record * * Idb__INX_InitRootNodeRecord - Init a (root) node index record * * Idb__INX_CopyLeafRecord - Copy a leaf record * * Idb__INX_CopyNodeRecord - Copy a node record * * Idb__INX_CollapseLeafRecord - Collapse a leaf record (truncate) * * Idb__INX_CollapseNodeRecord - Collapse a node record (truncate) * * Idb__INX_ConfirmNodeSpace - Confirm enough space in node * record for new entry * * Idb__INX_SetParent - Set parent pointer in record * * Idb__INX_FixNodeChildren - Reset parent pointers for all * the children of some node * */ /* * * DEFINE and MACRO DEFINITIONS * */ /* * Macros which validate index records in buffers */ #define Idb__INX_ValidLeaf(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtIndexLeaf) #define Idb__INX_ValidNode(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtIndexNode) #define Idb__INX_ValidRecord(buffer) \ (_IdbBufferRecordType(buffer)==IDBrtIndexLeaf || \ _IdbBufferRecordType(buffer)==IDBrtIndexNode) /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_EnterItem makes an entry in the file's index for a data * entry which has been previously entered in the file. * * FORMAL PARAMETERS: * * file_id Open IDB file in which to write entry * index The entry's case-sensitive index * data_entry Data entry pointer for data * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmEXISTS index already exists in file * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_EnterItem (IDBFile file_id , char *index , IDBDataHandle data_entry ) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr bufptr ; /* buffer into which to stuff entry */ MrmCount entndx ; /* locates pivotal entry in buffer */ /* * Initialize the index with this entry if this is the initial one. */ if ( !file_id->index_root ) { result = Idb__INX_InitRootLeafRecord (file_id, &bufptr) ; if (result != MrmSUCCESS ) return result ; result = Idb__INX_EnterLeafIndex (file_id, bufptr, index, data_entry, 0, MrmINDEX_LT) ; return result ; } /* * Find the (leaf) record in which to place this entry, and the * position in the record. Place it in the record (which must be * a leaf record). This process loops as long as record splitting * forces retries. */ do { result = Idb__INX_FindIndex (file_id, index, &bufptr, &entndx) ; switch ( result ) { case MrmINDEX_GT: case MrmINDEX_LT: break ; case MrmSUCCESS: return MrmEXISTS ; default: return result ; } result = Idb__INX_EnterLeafIndex (file_id, bufptr, index, data_entry, entndx, result) ; } while ( result == MrmINDEX_RETRY ) ; /* * Return results of final attempt to stuff in a leaf record */ return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_EnterLeafIndex creates a new entry for a data entry in a * leaf index record. If there isn't enough room in the record for * the new entry, the record is split and the enter operation must * be retried. * * FORMAL PARAMETERS: * * file_id Open IDB file * buffer Buffer containing leaf index record * index The entry's case-sensitive index * data_entry Data entry pointer for data * entry_index Entry in record at which to force new entry * order Specifies how new entry orders WRT entry at * entry_index; MrmINDEX_GT or MrmINDEX_LT. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmINDEX_RETRY operation must be tried again. * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_EnterLeafIndex (IDBFile file_id, IDBRecordBufferPtr buffer, char *index, IDBDataHandle data_entry, MrmCount entry_index, Cardinal order) { /* * Local variables */ Cardinal result ; /* function results */ IDBIndexLeafRecordPtr recptr ; /* leaf record in buffer */ IDBIndexLeafHdrPtr hdrptr ; /* record header */ MrmCount entndx ; /* index for new entry */ Cardinal entsiz ; /* # bytes needed for new entry */ MrmCount ndxsiz ; /* # bytes needed for new string */ char *ndxstg ; /* location for new string */ int ndx ; /* loop index */ char *stgheap ; /* string heap beginning */ MrmCount nfree ; /* # free bytes */ IDBIndexLeafEntryPtr itemvec ; /* The vector of index entries */ MrmCount itemcnt ; /* # entries in vector */ /* * Initialize pointers into the record */ recptr = (IDBIndexLeafRecordPtr) buffer->IDB_record ; hdrptr = (IDBIndexLeafHdrPtr) &recptr->leaf_header ; /* * Compute sizes for new entry. Split record and retry if required * to get enough space. */ ndxsiz = MIN(strlen(index),IDBMaxIndexLength) + 1 ; ndxsiz = _FULLWORD(ndxsiz); entsiz = IDBIndexLeafEntrySize + ndxsiz ; nfree = hdrptr->free_bytes ; if ( entsiz > nfree ) { result = Idb__INX_SplitLeafRecord (file_id, buffer) ; if ( result != MrmSUCCESS ) return result ; return MrmINDEX_RETRY ; } /* * Pick up values and pointers into the record. * Adjust entry index based on ordering, then make room for the * new entry. */ stgheap = (char *) &recptr->index[0] + hdrptr->heap_start ; itemvec = recptr->index ; itemcnt = hdrptr->index_count ; entndx = (order==MrmINDEX_GT) ? entry_index+1 : entry_index ; ndxstg = (char *) stgheap - ndxsiz ; for ( ndx=itemcnt ; ndx>entndx ; ndx--) { itemvec[ndx].index_stg = itemvec[ndx-1].index_stg ; itemvec[ndx].data = itemvec[ndx-1].data ; } /* * Move the string and set the values in the vector entry */ strcpy (ndxstg, "") ; strncat (ndxstg, index, IDBMaxIndexLength) ; itemvec[entndx].index_stg = (MrmOffset) (ndxstg-(char *)itemvec) ; itemvec[entndx].data.internal_id.rec_no = data_entry.rec_no ; itemvec[entndx].data.internal_id.item_offs = data_entry.item_offs ; /* * update the header */ hdrptr->index_count++ ; hdrptr->heap_start -= ndxsiz ; hdrptr->free_bytes -= entsiz ; /* * entry successfully added */ Idb__BM_MarkModified (buffer) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_EnterNodeIndex creates a new entry for a data entry in a * node index record. It differs from entering an item in a leaf record * in that the position for the new entry is not known. * If there isn't room for the new entry, the record is split, and * the operation must be tried again. * * FORMAL PARAMETERS: * * file_id Open IDB file * buffer Buffer containing node index record * index The entry's case-sensitive index * data_entry Data entry pointer for data * lt_record Record number of the less-than record associated with * this entry * gt_record Record number of the greater-than record associated with * this entry * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmINDEX_RETRY operation must be tried again. * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_EnterNodeIndex (IDBFile file_id, IDBRecordBufferPtr buffer, char *index, IDBDataHandle data_entry, IDBRecordNumber lt_record, IDBRecordNumber gt_record) { /* * Local variables */ Cardinal result ; /* function results */ IDBIndexNodeRecordPtr recptr ; /* node record in buffer */ IDBIndexNodeHdrPtr hdrptr ; /* record header */ MrmCount entry_index ; /* searched location for new entry */ Cardinal order ; /* order of index WRT location */ MrmCount entndx ; /* index for new entry */ Cardinal entsiz ; /* # bytes needed for new entry */ MrmCount ndxsiz ; /* # bytes needed for new string */ char *ndxstg ; /* location for new string */ int ndx ; /* loop index */ char *stgheap ; /* string heap beginning */ MrmCount nfree ; /* # free bytes */ IDBIndexNodeEntryPtr itemvec ; /* The vector of index entries */ MrmCount itemcnt ; /* # entries in vector */ MrmCount prvndx ; /* preceding entry index */ MrmCount nxtndx ; /* succeeding entry index */ IDBRecordNumber p_recno ; /* this node record number */ /* * Initialize pointers into the record */ recptr = (IDBIndexNodeRecordPtr) buffer->IDB_record ; hdrptr = (IDBIndexNodeHdrPtr) &recptr->node_header ; /* * Compute sizes for new entry. Split record and retry if required * to get enough space. */ ndxsiz = MIN(strlen(index),IDBMaxIndexLength) + 1 ; ndxsiz = _FULLWORD(ndxsiz); entsiz = IDBIndexNodeEntrySize + ndxsiz ; nfree = hdrptr->free_bytes ; if ( entsiz > nfree ) { result = Idb__INX_SplitNodeRecord (file_id, buffer) ; if ( result != MrmSUCCESS ) return result ; return MrmINDEX_RETRY ; } /* * Pick up value and pointers into the record. Figure out the * location at which to insert the record (0 for a new entry), * and make room for the new entry. */ stgheap = (char *) &recptr->index[0] + hdrptr->heap_start ; itemvec = recptr->index ; itemcnt = hdrptr->index_count ; if ( itemcnt == 0 ) entndx = 0 ; else { order = Idb__INX_SearchIndex (file_id, index, buffer, &entry_index) ; entndx = (order==MrmINDEX_GT) ? entry_index+1 : entry_index ; for ( ndx=itemcnt ; ndx>entndx ; ndx--) { itemvec[ndx].index_stg = itemvec[ndx-1].index_stg ; itemvec[ndx].data = itemvec[ndx-1].data ; itemvec[ndx].LT_record = itemvec[ndx-1].LT_record ; itemvec[ndx].GT_record = itemvec[ndx-1].GT_record ; } } /* * Move the string and set the values in the vector entry and record vector */ ndxstg = (char *) stgheap - ndxsiz ; strcpy (ndxstg, "") ; strncat (ndxstg, index, IDBMaxIndexLength) ; itemvec[entndx].index_stg = (MrmOffset) (ndxstg-(char *)itemvec) ; itemvec[entndx].data.internal_id.rec_no = data_entry.rec_no ; itemvec[entndx].data.internal_id.item_offs = data_entry.item_offs ; itemvec[entndx].LT_record = lt_record ; itemvec[entndx].GT_record = gt_record ; /* * update the header */ hdrptr->index_count = ++itemcnt ; hdrptr->heap_start -= ndxsiz ; hdrptr->free_bytes -= entsiz ; /* * Now the entries to either side of the new index must have their LT * and LT pointers verified and changed. By practice, the GT record of the * new entry is a previous record which should occur as the GT record of * the preceding entry and the LT record of the succeeding entry. * These entries must be modified to have LT and GT pointers matching the * records given here as arguments. */ if ( entndx > 0 ) { prvndx = entndx - 1 ; if ( itemvec[prvndx].GT_record != gt_record ) return Urm__UT_Error ("Idb__INX_EnterNodeIndex", _MrmMMsg_0016, file_id, NULL, MrmBAD_BTREE) ; itemvec[prvndx].GT_record = lt_record ; } if ( entndx < (itemcnt-1) ) { nxtndx = entndx + 1 ; if ( itemvec[nxtndx].LT_record != gt_record ) return Urm__UT_Error ("Idb__INX_EnterNodeIndex", _MrmMMsg_0017, file_id, NULL, MrmBAD_BTREE) ; itemvec[nxtndx].LT_record = gt_record ; } /* * entry successfully added */ Idb__BM_MarkModified (buffer) ; /* * Set the parent pointer in the LT and GT records */ p_recno = _IdbBufferRecordNumber (buffer) ; result = Idb__INX_SetParent (file_id, p_recno, lt_record) ; result = Idb__INX_SetParent (file_id, p_recno, gt_record) ; if ( result != MrmSUCCESS ) return result ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_SplitRecord splits an index record in order to make room * for new entries. This is the crucial routine in causing the B-tree * to grow. It splits leaf records only. * * The split process takes place as follows: * - extract the middle entry from the record and save it. * - create a new leaf record and move all the less-than * ordered entries into it. * - reorganize the current record to contain only the greater-than * ordered entries (garbage collecting the string heap). * - Enter the extracted entry in the parent (creating a new * parent if required). This entry takes the less-than * record with it to the parent, thus entering the new leaf * record in the B-tree. The old record is retained as a * greater-than record for the extracted index. * * The trickiest aspect of splitting nodes is maintaining parent * pointers when splitting may cause parents to change. IDB deals * this by splitting from the top of the tree down, so that a node's * parent pointer is guaranteed correct when the node is split. * This is done by: * - Before splitting, check that parent has enough room * for a new entry. If not, the parent will split and * inform the caller to retry. * - Splitting the root node is always safe * * FORMAL PARAMETERS: * * file_id Open IDB file * gt_buffer Buffer containing leaf index record to be split * This will become the new GT buffer * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_RECORD not a leaf index record * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_SplitLeafRecord (IDBFile file_id, IDBRecordBufferPtr gt_buffer) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordNumber p_recno ; /* parent record number */ IDBRecordBufferPtr p_buffer ; /* parent buffer */ IDBRecordBufferPtr lt_buffer ; /* buffer for LT leaf record */ IDBIndexLeafRecordPtr lt_recptr ; /* LT leaf record in buffer */ IDBIndexLeafRecordPtr gt_recptr ; /* GT leaf record in buffer */ IDBIndexLeafHdrPtr gt_hdrptr ; /* GT record header */ MrmCount p_index ; /* index of hoisted entry */ char p_index_stg[IDBMaxIndexLength1] ; /* save hoisted idx */ char *p_index_stgadr ; /* Address of hoisted index string */ IDBDataHandle p_data ; /* saves hoisted entry data */ MrmCount lt_cnt ; /* number of LT items */ MrmCount gt_cnt ; /* number of GT items */ MrmCount old_cnt ; /* original number of items */ IDBIndexLeafEntryPtr old_itmvec ; /* Original vector */ /* * Initialize pointers into the record and sanity check. This record * will become the GT leaf record */ if ( ! Idb__INX_ValidLeaf(gt_buffer) ) return Urm__UT_Error ("Idb__INX_SplitLeafRecord", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; gt_recptr = (IDBIndexLeafRecordPtr) gt_buffer->IDB_record ; gt_hdrptr = (IDBIndexLeafHdrPtr) >_recptr->leaf_header ; /* * If this node has a parent, make sure it can hold a new entry. * If not, it will split, and we must retry. Note a parent must be * a node record. */ p_recno = gt_hdrptr->parent ; if ( gt_hdrptr->parent ) { result = Idb__BM_GetRecord (file_id, gt_hdrptr->parent, &p_buffer) ; if ( result != MrmSUCCESS ) return result ; if ( ! Idb__INX_ValidNode(p_buffer) ) return Urm__UT_Error ("Idb__INX_SplitLeafRecord", _MrmMMsg_0018, file_id, NULL, MrmBAD_RECORD) ; result = Idb__INX_ConfirmNodeSpace (file_id, p_buffer) ; if ( result != MrmSUCCESS ) return result ; } /* * Pick up current parameters */ old_cnt = gt_hdrptr->index_count ; old_itmvec = gt_recptr->index ; /* * Compute the indexes and counts for the split, and save the hoisted entry. */ lt_cnt = old_cnt / 2 ; p_index = lt_cnt ; gt_cnt = old_cnt - lt_cnt - 1; p_index_stgadr = (char *) old_itmvec+old_itmvec[p_index].index_stg ; strcpy (p_index_stg, p_index_stgadr) ; p_data.rec_no = old_itmvec[p_index].data.internal_id.rec_no ; p_data.item_offs = old_itmvec[p_index].data.internal_id.item_offs ; /* * Acquire a new record to become the LT part. Copy the entire current * record into it, then collapse both records into their final form. */ result = Idb__BM_InitRecord (file_id, 0, IDBrtIndexLeaf, <_buffer) ; lt_recptr = (IDBIndexLeafRecordPtr) lt_buffer->IDB_record ; Idb__INX_CopyLeafRecord (lt_recptr, gt_recptr) ; Idb__INX_CollapseLeafRecord (lt_recptr, 0, lt_cnt-1) ; Idb__INX_CollapseLeafRecord (gt_recptr, p_index+1, p_index+gt_cnt) ; /* * Both records now have their parent set correctly via the copy operation, * since our check on space in the parent guarantees that the parent * pointer present in the original buffer will remain the parent after * we host the pivot index (unless we create a new root node, which * is guaranteed safe anyway. So we we can mark the buffers and * hoist the pivot index. */ Idb__BM_MarkModified (lt_buffer) ; Idb__BM_MarkModified (gt_buffer) ; /* * Either enter the hoisted entry into the parent, or create * a parent (which will be the root record). */ if ( !p_recno ) { result = Idb__INX_InitRootNodeRecord (file_id, &p_buffer, p_index_stg, p_data, _IdbBufferRecordNumber(lt_buffer), _IdbBufferRecordNumber(gt_buffer)) ; return result ; } /* * Hoist the entry into the parent (we know there should be room). * The parent is already loaded in its buffer as part of the space check. */ result = Idb__INX_EnterNodeIndex (file_id, p_buffer, p_index_stg, p_data, _IdbBufferRecordNumber(lt_buffer), _IdbBufferRecordNumber(gt_buffer)) ; if ( result != MrmSUCCESS ) return result ; /* * Successfully added. */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_SplitRecord splits an index record in order to make room * for new entries. This is the crucial routine in causing the B-tree * to grow. It splits node records only. * * The split process takes place as follows: * - extract the middle entry from the record and save it. * - create a new node record and move all the less-than * ordered entries into it. * - reorganize the current record to contain only the greater-than * ordered entries (garbage collecting the string heap). * - Enter the extracted entry in the parent (creating a new * parent if required). This entry takes the less-than * record with it to the parent, thus entering the new node * record in the B-tree. The old record is retained as a * greater-than record for the extracted index. * * For node records, the record vectors are handled entirely by * the collapse routines. No record number is saved for the hoisted * index, since the associated record number is either new LT record * or both records if a root node is created. * * FORMAL PARAMETERS: * * file_id Open IDB file * gt_buffer Buffer containing node index record to be split. This * will become the new GT buffer. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmBAD_RECORD not a node index record * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_SplitNodeRecord (IDBFile file_id, IDBRecordBufferPtr gt_buffer) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordNumber p_recno ; /* parent record number */ IDBRecordBufferPtr p_buffer ; /* parent buffer */ IDBRecordBufferPtr lt_buffer ; /* buffer for LT node record */ IDBIndexNodeRecordPtr lt_recptr ; /* LT node record in buffer */ IDBIndexNodeRecordPtr gt_recptr ; /* GT node record in buffer */ IDBIndexNodeHdrPtr gt_hdrptr ; /* GT record header */ IDBRecordNumber lt_recno ; /* LT node record number */ IDBRecordNumber gt_recno ; /* GT node record number */ MrmCount p_index ; /* index of hoisted entry */ char p_index_stg[IDBMaxIndexLength1]; /* save hoisted indx */ char *p_index_stgadr ; /* Address of hoisted index string */ IDBDataHandle p_data ; /* saves hoisted entry data */ MrmCount lt_cnt ; /* number of LT items */ MrmCount gt_cnt ; /* number of GT items */ MrmCount old_cnt ; /* original number of items */ IDBIndexNodeEntryPtr old_itmvec ; /* Original vector */ /* * Initialize pointers into the record and sanity check. This record * will become the GT node record */ if ( ! Idb__INX_ValidNode(gt_buffer) ) return Urm__UT_Error ("Idb__INX_SplitNodeRecord", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; gt_recptr = (IDBIndexNodeRecordPtr) gt_buffer->IDB_record ; gt_hdrptr = (IDBIndexNodeHdrPtr) >_recptr->node_header ; /* * If this node has a parent, make sure it can hold a new entry. * If not, it will split, and we must retry. Note a parent must be * a node record. */ p_recno = gt_hdrptr->parent ; if ( p_recno ) { result = Idb__BM_GetRecord (file_id, p_recno, &p_buffer) ; if ( result != MrmSUCCESS ) return result ; if ( ! Idb__INX_ValidNode(p_buffer) ) return Urm__UT_Error ("Idb__INX_SplitNodeRecord", _MrmMMsg_0018, file_id, NULL, MrmBAD_RECORD) ; result = Idb__INX_ConfirmNodeSpace (file_id, p_buffer) ; if ( result != MrmSUCCESS ) return result ; } /* * Pick up current parameters */ old_cnt = gt_hdrptr->index_count ; old_itmvec = gt_recptr->index ; /* * Compute the indexes and counts for the split, and save the hoisted entry. */ lt_cnt = old_cnt / 2 ; p_index = lt_cnt ; gt_cnt = old_cnt - lt_cnt - 1; p_index_stgadr = (char *) old_itmvec+old_itmvec[p_index].index_stg ; strcpy (p_index_stg, p_index_stgadr) ; p_data.rec_no = old_itmvec[p_index].data.internal_id.rec_no ; p_data.item_offs = old_itmvec[p_index].data.internal_id.item_offs ; /* * Acquire a new record to become the LT part. Copy the entire current * record into it, then collapse both records into their final form. */ result = Idb__BM_InitRecord (file_id, 0, IDBrtIndexNode, <_buffer) ; lt_recptr = (IDBIndexNodeRecordPtr) lt_buffer->IDB_record ; Idb__INX_CopyNodeRecord (lt_recptr, gt_recptr) ; Idb__INX_CollapseNodeRecord (lt_recptr, 0, lt_cnt-1) ; Idb__INX_CollapseNodeRecord (gt_recptr, p_index+1, p_index+gt_cnt) ; /* * Both records now have their parent set correctly via the copy operation, * since our check on space in the parent guarantees that the parent * pointer present in the original buffer will remain the parent after * we host the pivot index (unless we create a new root node, which * is guaranteed safe anyway. Thus we are done with all changes to these * buffers, and can mark them. Then save their record numbers and child * list for future operations. */ Idb__BM_MarkModified (lt_buffer) ; Idb__BM_MarkModified (gt_buffer) ; lt_recno = _IdbBufferRecordNumber (lt_buffer) ; gt_recno = _IdbBufferRecordNumber (gt_buffer) ; /* * Either enter the hoisted entry into the parent, or create * a parent (which will be the root record). * * Otherwise, hoist the entry into the parent (we know there should be room). * The parent should be already loaded in its buffer as part of the space * check, but a reload is done to make sure buffer turning hasn't interfered. */ if ( !p_recno ) { result = Idb__INX_InitRootNodeRecord (file_id, &p_buffer, p_index_stg, p_data, lt_recno, gt_recno) ; if ( result != MrmSUCCESS ) return result ; } else { result = Idb__BM_GetRecord (file_id, p_recno, &p_buffer) ; if ( result != MrmSUCCESS ) return result ; result = Idb__INX_EnterNodeIndex (file_id, p_buffer, p_index_stg, p_data, lt_recno, gt_recno) ; if ( result != MrmSUCCESS ) return result ; } /* * Now all child nodes of the split record must have their parent * pointers updated. The gt_buffer children should still have the same * parent, but the update will be done to that buffer as well for * completeness. */ result = Idb__INX_FixNodeChildren (file_id, lt_recno) ; if ( result != MrmSUCCESS ) return result ; result = Idb__INX_FixNodeChildren (file_id, gt_recno) ; if ( result != MrmSUCCESS ) return result ; /* * Successfully added. */ return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_InitLeafRecord initializes a new leaf index record, * resulting in an empty record with the maximum free space available. * It may be immediately used to enter an index item. This routine * is used just once, to create the initial root record. Thereafter, * all leaf records are created by splitting and collapsing existing * records. * * FORMAL PARAMETERS: * * file_id Open IDB file * buffer_return To return pointer to buffer containing new record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_InitRootLeafRecord (IDBFile file_id, IDBRecordBufferPtr *buffer_return) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr bufptr ; /* leaf record buffer */ IDBIndexLeafRecordPtr recptr ; /* leaf record in buffer */ IDBIndexLeafHdrPtr hdrptr ; /* record header */ /* * Acquire a record */ result = Idb__BM_InitRecord (file_id, 0, IDBrtIndexLeaf, &bufptr) ; if ( result != MrmSUCCESS ) return result ; recptr = (IDBIndexLeafRecordPtr) bufptr->IDB_record ; hdrptr = (IDBIndexLeafHdrPtr) &recptr->leaf_header ; /* * Initialize the record header */ hdrptr->parent = 0 ; hdrptr->index_count = 0 ; hdrptr->heap_start = IDBIndexLeafFreeMax ; hdrptr->free_bytes = IDBIndexLeafFreeMax ; /* * Successfully initialized */ Idb__BM_MarkModified (bufptr) ; *buffer_return = bufptr ; file_id->index_root = hdrptr->header.record_num ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * Idb__INX_InitNodeRecord initializes a new node index record. It * creates the initial entry in the record, with its index, data pointer, * and pointers to two children records in the B-tree. This entry always * becomes the root of the B-tree, since the only occasion on which * a node record is created in this way is when a new root is needed. * * FORMAL PARAMETERS: * * file_id Open IDB file * buffer_return To return pointer to buffer containing new record * index Index for single entry in record * data_entry Data entry pointer for data * lt_record Record number of B-tree record ordering < the index * gt_record Record number of B-tree record ordering > the index * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some other failure * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_InitRootNodeRecord (IDBFile file_id, IDBRecordBufferPtr *buffer_return, char *index, IDBDataHandle data_entry, IDBRecordNumber lt_record, IDBRecordNumber gt_record) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr bufptr ; /* node record buffer */ IDBIndexNodeRecordPtr recptr ; /* node record in buffer */ IDBIndexNodeHdrPtr hdrptr ; /* record header */ IDBRecordNumber recno ; /* this buffer's record number */ /* * Acquire a record */ result = Idb__BM_InitRecord (file_id, 0, IDBrtIndexNode, &bufptr) ; if ( result != MrmSUCCESS ) return result ; recptr = (IDBIndexNodeRecordPtr) bufptr->IDB_record ; hdrptr = (IDBIndexNodeHdrPtr) &recptr->node_header ; /* * Initialize the record header */ hdrptr->parent = 0 ; hdrptr->index_count = 0 ; hdrptr->heap_start = IDBIndexNodeFreeMax ; hdrptr->free_bytes = IDBIndexNodeFreeMax ; /* * Enter the initial entry */ result = Idb__INX_EnterNodeIndex (file_id, bufptr, index, data_entry, lt_record, gt_record) ; if ( result != MrmSUCCESS ) return result ; /* * Successfully initialized */ Idb__BM_MarkModified (bufptr) ; *buffer_return = bufptr ; /* * Set the parent pointers in the two child entries. */ recno = _IdbBufferRecordNumber (bufptr) ; result = Idb__INX_SetParent (file_id, recno, lt_record) ; if ( result != MrmSUCCESS ) return result ; result = Idb__INX_SetParent (file_id, recno, gt_record) ; if ( result != MrmSUCCESS ) return result ; /* * Root node successfully created. Update file header. */ file_id->index_root = hdrptr->header.record_num ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routines copies one leaf record into another. * * FORMAL PARAMETERS: * * dst_recptr pointer to record into which to copy * src_recptr source record pointer * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Idb__INX_CopyLeafRecord (IDBIndexLeafRecordPtr dst_recptr, IDBIndexLeafRecordPtr src_recptr) { /* * Local variables */ IDBIndexLeafHdrPtr dst_hdrptr ; /* destination record header */ IDBIndexLeafHdrPtr src_hdrptr ; /* source record header */ char *dst_data ; /* data part of dest record */ char *src_data ; /* data part of source record */ /* * copy the header, field by field */ dst_hdrptr = (IDBIndexLeafHdrPtr) &dst_recptr->leaf_header ; src_hdrptr = (IDBIndexLeafHdrPtr) &src_recptr->leaf_header ; dst_hdrptr->parent = src_hdrptr->parent ; dst_hdrptr->index_count = src_hdrptr->index_count ; dst_hdrptr->heap_start = src_hdrptr->heap_start ; dst_hdrptr->free_bytes = src_hdrptr->free_bytes ; /* * copy the data area in the record */ dst_data = (char *) dst_recptr->index ; src_data = (char *) src_recptr->index ; UrmBCopy (src_data, dst_data, IDBIndexLeafFreeMax) ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routines copies one node record into another. * * FORMAL PARAMETERS: * * dst_recptr pointer to record into which to copy * src_recptr source record pointer * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Idb__INX_CopyNodeRecord (IDBIndexNodeRecordPtr dst_recptr, IDBIndexNodeRecordPtr src_recptr) { /* * Local variables */ IDBIndexNodeHdrPtr dst_hdrptr ; /* destination record header */ IDBIndexNodeHdrPtr src_hdrptr ; /* source record header */ char *dst_data ; /* data part of dest record */ char *src_data ; /* data part of source record */ /* * copy the header, field by field */ dst_hdrptr = (IDBIndexNodeHdrPtr) &dst_recptr->node_header ; src_hdrptr = (IDBIndexNodeHdrPtr) &src_recptr->node_header ; dst_hdrptr->parent = src_hdrptr->parent ; dst_hdrptr->index_count = src_hdrptr->index_count ; dst_hdrptr->heap_start = src_hdrptr->heap_start ; dst_hdrptr->free_bytes = src_hdrptr->free_bytes ; /* * copy the data area in the record */ dst_data = (char *) dst_recptr->index ; src_data = (char *) src_recptr->index ; UrmBCopy (src_data, dst_data, IDBIndexNodeFreeMax) ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine collapses a leaf index record as part of splitting * a record. Collapsing the record truncates the record contents * by removing part of the index vector, re-organizing the string * heap to consume minimal space, resetting the heap parameters, * and resetting the index count. * * FORMAL PARAMETERS: * * recptr The leaf index record to collapse * start First entry in the index vector to be preserved * end Last entry in the index vector to be preserved * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ void Idb__INX_CollapseLeafRecord (IDBIndexLeafRecordPtr recptr, MrmCount start, MrmCount end) { /* * Local variables */ IDBIndexLeafHdrPtr hdrptr ; /* record header */ int ndx ; /* loop index */ char *temp_heap ; /* temporary heap */ char *cur_heap ; /* current heap pointer */ MrmCount heap_size ; /* # bytes used in temp heap */ IDBIndexLeafEntryPtr srcvec ; /* source index vector */ IDBIndexLeafEntryPtr dstvec ; /* destination index vector */ char *stgbase ; /* base address for string offsets */ char *ndxstg ; /* current index string */ MrmCount stgsiz ; /* # bytes for current string */ MrmCount ndxcnt ; /* # entries in collapsed record */ MrmCount nfree ; /* # free bytes in collapsed record */ MrmOffset heap_start ; /* new heap start offset */ /* * Allocate a temporary heap (big enough to hold data area). Copy each * string which must be preserved into the temporary heap. The heap * is allocated top-to-bottom, and the temporary offsets will be * made permanent when the temporary heap is copied into the record. * * Copy the surviving part of the index vector while saving the strings. * The new offset is set as part of this operation. */ temp_heap = (char *) XtMalloc (IDBIndexLeafFreeMax) ; cur_heap = temp_heap ; heap_size = 0 ; hdrptr = (IDBIndexLeafHdrPtr) &recptr->leaf_header ; srcvec = &recptr->index[start] ; dstvec = &recptr->index[0] ; stgbase = (char *) recptr->index ; ndxcnt = end - start + 1 ; for ( ndx=0 ; ndxindex_count = ndxcnt ; heap_start = IDBIndexLeafFreeMax - heap_size ; hdrptr->heap_start = heap_start ; nfree = IDBIndexLeafFreeMax - heap_size - ndxcnt*IDBIndexLeafEntrySize ; hdrptr->free_bytes = nfree ; UrmBCopy (temp_heap, &stgbase[heap_start], heap_size) ; for ( ndx=0 ; ndxnode_header ; srcvec = &recptr->index[start] ; dstvec = &recptr->index[0] ; stgbase = (char *) recptr->index ; ndxcnt = end - start + 1 ; for ( ndx=0 ; ndxindex_count = ndxcnt ; heap_start = IDBIndexNodeFreeMax - heap_size ; hdrptr->heap_start = heap_start ; nfree = IDBIndexNodeFreeMax - heap_size - ndxcnt*IDBIndexNodeEntrySize ; hdrptr->free_bytes = nfree ; UrmBCopy (temp_heap, &stgbase[heap_start], heap_size) ; for ( ndx=0 ; ndxIDB_record ; hdrptr = (IDBIndexNodeHdrPtr) &recptr->node_header ; /* * Check the size. If there is enough, OK. Else split this record and * return a retry. */ if ( hdrptr->free_bytes >= IDBIndexNodeEntryMax ) return MrmSUCCESS ; result = Idb__INX_SplitNodeRecord (file_id, buffer) ; if ( result == MrmSUCCESS ) result = MrmINDEX_RETRY ; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine sets the parent pointer in a child record * * FORMAL PARAMETERS: * * file_id Open IDB file * parent_record Parent record number * child_record Child record number * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE some failure occurred * * SIDE EFFECTS: * *-- */ Cardinal Idb__INX_SetParent (IDBFile file_id, IDBRecordNumber parent_record, IDBRecordNumber child_record) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr buffer ; /* buffer for child record */ IDBIndexLeafRecordPtr leafrec ; /* index leaf record */ IDBIndexLeafHdrPtr leafhdr ; /* index leaf header */ IDBIndexNodeRecordPtr noderec ; /* index node record */ IDBIndexNodeHdrPtr nodehdr ; /* index node header */ /* * Get the child record */ result = Idb__BM_GetRecord (file_id, child_record, &buffer) ; if ( result != MrmSUCCESS ) return result ; if ( ! Idb__INX_ValidRecord(buffer) ) return Urm__UT_Error ("Idb__INX_SetParent", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; /* * Set up pointers and set parent based on record type */ switch ( _IdbBufferRecordType (buffer) ) { case IDBrtIndexLeaf: leafrec = (IDBIndexLeafRecordPtr) buffer->IDB_record ; leafhdr = (IDBIndexLeafHdrPtr) &leafrec->leaf_header ; if ( leafhdr->parent != parent_record ) { leafhdr->parent = parent_record ; Idb__BM_MarkModified (buffer) ; } return MrmSUCCESS ; case IDBrtIndexNode: noderec = (IDBIndexNodeRecordPtr) buffer->IDB_record ; nodehdr = (IDBIndexNodeHdrPtr) &noderec->node_header ; if ( nodehdr->parent != parent_record ) { nodehdr->parent = parent_record ; Idb__BM_MarkModified (buffer) ; } return MrmSUCCESS ; default: return MrmBAD_RECORD ; } } /* *++ * * PROCEDURE DESCRIPTION: * * This routine guarantees that the children of a node record have * a correct parent pointer. * * FORMAL PARAMETERS: * * file_id Open IDB file * p_record Record number of parent record * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * * This routine uses MarkActivity to guarantee that the parent * record remains in memory. * *-- */ Cardinal Idb__INX_FixNodeChildren (IDBFile file_id, IDBRecordNumber p_record) { /* * Local variables */ Cardinal result ; /* function results */ IDBRecordBufferPtr buffer ; /* parent node buffer */ IDBIndexNodeRecordPtr recptr ; /* parent node record in buffer */ IDBIndexNodeHdrPtr hdrptr ; /* parent record header */ int ndx ; /* loop index */ /* * Get the parent record */ result = Idb__BM_GetRecord (file_id, p_record, &buffer) ; if ( result != MrmSUCCESS ) return result ; if ( ! Idb__INX_ValidNode(buffer) ) return Urm__UT_Error ("Idb__INX_FixNodeChildren", _MrmMMsg_0010, file_id, NULL, MrmBAD_RECORD) ; /* * Bind pointers into the record, and set each child's parent pointer */ recptr = (IDBIndexNodeRecordPtr) buffer->IDB_record ; hdrptr = (IDBIndexNodeHdrPtr) &recptr->node_header ; for ( ndx=0 ; ndxindex_count ; ndx++ ) { result = Idb__INX_SetParent (file_id, p_record, recptr->index[ndx].LT_record) ; if ( result != MrmSUCCESS ) return result ; result = Idb__INX_SetParent (file_id, p_record, recptr->index[ndx].GT_record) ; if ( result != MrmSUCCESS ) return result ; Idb__BM_MarkActivity (buffer) ; } /* * Successfully modified */ return MrmSUCCESS ; } motif-2.3.8/lib/Mrm/Makefile.am0000644000175000017500000000270313145162623013125 00000000000000MAINTAINERCLEANFILES = Makefile.in CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = Mrm.msg INCLUDES = -I$(srcdir)/.. -I.. -I../Xm ${X_CFLAGS} mrmdir = $(includedir)/Mrm libMrm_la_LIBADD = ../Xm/libXm.la ${X_LIBS} -lXt ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} libMrm_la_LDFLAGS = -version-info @CURRENT@:@REVISION@:@AGE@ lib_LTLIBRARIES = libMrm.la noinst_HEADERS = IDB.h \ Mrm.h \ MrmMsgI.h \ MrmWidget.h mrm_HEADERS = MrmDecls.h MrmPublic.h MrmAppl.h MrmosI.h SRCS = MrmIbuffer.c MrmIentry.c MrmIfile.c MrmIheader.c \ MrmIindex.c MrmIindexw.c MrmIrid.c MrmIswap.c \ MrmItop.c MrmItopw.c Mrmappl.c \ Mrmcontext.c Mrmerror.c Mrmhier.c Mrmicon.c \ Mrminit.c Mrmlread.c Mrmlwrite.c Mrmmodule.c \ Mrmos.c \ Mrmptrlist.c Mrmtable.c Mrmtime.c Mrmvm.c \ Mrmwci.c Mrmwcrw.c Mrmwcrwr.c Mrmwread.c \ Mrmwrefs.c Mrmwvalues.c Mrmwwrite.c MrmMessages.c libMrm_la_SOURCES = $(SRCS) BUILT_SOURCES = $(CAT_FILES) Makefile: $(BUILT_SOURCES) if MessageCatalog CAT_FILES = Mrm.cat MrmMsgCatI.h $(CAT_FILES): Mrm.msg $(mkinstalldirs) $(top_builddir)/localized/C/msg $(top_builddir)/localized/util/mkcatdefs MrmMsgCatI.h $(srcdir)/Mrm.msg >$(top_builddir)/localized/C/msg/Mrm.msg gencat Mrm.cat $(top_builddir)/localized/C/msg/Mrm.msg SPLINT_EXTRAFLAGS = -I/usr/include -I. +posixlib -nestcomment else SPLINT_EXTRAFLAGS = -I/usr/include -I. -DNO_MESSAGE_CATALOG +posixlib -nestcomment endif splint: $(SPLINT) $(INCLUDES) $(SPLINT_EXTRAFLAGS) $(top_srcdir)/lib/Mrm/*.c motif-2.3.8/lib/Mrm/Mrmptrlist.c0000644000175000017500000001574213145162623013421 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: Mrmptrlist.c /main/12 1996/11/13 14:03:53 drk $" #endif #endif /* *++ * FACILITY: * * UIL Resource Manager (URM): * * ABSTRACT: * * These routines manage a dynamic pointer list * *-- */ /* * * INCLUDE FILES * */ #include #include #include "MrmMsgI.h" /* * * TABLE OF CONTENTS * */ /* *++ * * PROCEDURE DESCRIPTION: * * This routine acquires and initializes a new pointer list. * * FORMAL PARAMETERS: * * size number of pointer slots to allocate in list * list_id_return to return pointer to new list structure * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE allocation failure * * SIDE EFFECTS: * *-- */ Cardinal UrmPlistInit (int size, URMPointerListPtr *list_id_return) { /* * Allocate the list buffer and the slot vector buffer, and initialize */ *list_id_return = (URMPointerListPtr) XtMalloc (sizeof(URMPointerList)) ; if ( *list_id_return == NULL ) return Urm__UT_Error ("UrmPlistInit", _MrmMMsg_0046, NULL, NULL, MrmFAILURE) ; (*list_id_return)->ptr_vec = (XtPointer *) XtMalloc (size*sizeof(XtPointer)) ; if ( (*list_id_return)->ptr_vec == NULL ) return Urm__UT_Error ("UrmPlistInit", _MrmMMsg_0047, NULL, NULL, MrmFAILURE) ; (*list_id_return)->num_slots = size ; (*list_id_return)->num_ptrs = 0 ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine reallocates the list vector in a pointer list in order * to increase its size. The contents of the current list are copied * into the new list. * * FORMAL PARAMETERS: * * list_id The pointer list to be resized * size The new number of pointer slots * * IMPLICIT INPUTS: * * MrmSUCCESS operation succeeded * MrmFAILURE memory allocation failure * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal UrmPlistResize (URMPointerListPtr list_id, int size) { /* * Allocate the new vector, and copy the current vector into it. */ list_id->ptr_vec = (XtPointer *) XtRealloc ((char *)(list_id->ptr_vec), size*sizeof(XtPointer)) ; if ( list_id->ptr_vec == NULL ) return Urm__UT_Error ("UrmPlistResize", _MrmMMsg_0048, NULL, NULL, MrmFAILURE) ; list_id->num_slots = size ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine frees the pointer vector and list structure. * * FORMAL PARAMETERS: * * list_id The pointer list to be freed * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * * SIDE EFFECTS: * *-- */ Cardinal UrmPlistFree (URMPointerListPtr list_id) { XtFree ((char*)list_id->ptr_vec) ; XtFree ((char*)list_id) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine frees each of the items pointed to by the active * pointers in the pointer list. The items must have been allocated * with XtMalloc. * * FORMAL PARAMETERS: * * list_id The pointer list * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operatoin succeeded * * SIDE EFFECTS: * *-- */ Cardinal UrmPlistFreeContents (URMPointerListPtr list_id) { /* * Local variables */ int ndx ; /* loop index */ for ( ndx=0 ; ndxnum_ptrs ; ndx++ ) XtFree (list_id->ptr_vec[ndx]) ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine appends a pointer to the list. If no space remains, * the list is resized to double its current size. * * FORMAL PARAMETERS: * * list_id The pointer list * ptr The pointer to append * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * MrmSUCCESS operation succeeded * MrmFAILURE allocation failure * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ Cardinal UrmPlistAppendPointer (URMPointerListPtr list_id , XtPointer ptr ) { /* * Local variables */ Cardinal result ; /* function results */ if ( list_id->num_ptrs == list_id->num_slots ) { result = UrmPlistResize (list_id, 2*list_id->num_slots) ; if ( result != MrmSUCCESS ) return result ; } list_id->ptr_vec[list_id->num_ptrs] = ptr ; list_id->num_ptrs++ ; return MrmSUCCESS ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine allocates space for a string, copies, and appends the * pointer to the string in the pointer list. All the strings in the * list may be freed with UrmPlistFreeContents. * * FORMAL PARAMETERS: * * list_id The pointer list * stg The string to alocate, copy, and append * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * MrmSUCCESS operation succeeded * MrmFAILURE allocation failure * * SIDE EFFECTS: * *-- */ Cardinal UrmPlistAppendString (URMPointerListPtr list_id , String stg ) { /* * Local variables */ Cardinal result ; /* function results */ String newstg ; /* allocated string */ newstg = XtMalloc (strlen(stg)+1) ; if ( newstg == NULL ) return Urm__UT_Error ("UrmPlistAppendString", _MrmMMsg_0049, NULL, NULL, MrmFAILURE) ; strcpy (newstg, stg) ; result = UrmPlistAppendPointer (list_id, newstg) ; return result ; } /* *++ * * PROCEDURE DESCRIPTION: * * This routine searches a list (assumed to be a list of string * pointers) for a case-sensitive match to a string. If found, * its index in the list is found; else -1 is returned. * * FORMAL PARAMETERS: * * list_id The pointer list * stg the (case-sensitive) string to be found * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * 0-based index in list if found * -1 if not found * * SIDE EFFECTS: * *-- */ MrmCount UrmPlistFindString (URMPointerListPtr list_id , String stg ) { /* * Local variables */ MrmCount ndx ; /* search index */ for ( ndx=0 ; ndx/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # 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" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/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= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="lib/Xm/Form.c" # 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" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS OM_LIBPNG_FALSE OM_LIBPNG_TRUE OM_LIBJPEG_FALSE OM_LIBJPEG_TRUE FONTCONFIG_LIBS FONTCONFIG_CFLAGS fc_config XRENDER_LIBS XRENDER_CFLAGS CONFDIR confdir FC_DEFAULT_FONTS FREETYPE_CFLAGS ft_config LIB_XP PRINTING_FALSE PRINTING_TRUE PRINTING_SUPPORTED_TRUE PRINTING_SUPPORTED_FALSE OM22_COMPATIBILITY_TRUE OM22_COMPATIBILITY_FALSE RM XMBINDDIR_FALLBACK INCDIR MWMRCDIR LIBDIR CDE_CONFIGURATION_TOP CDE_INSTALLATION_TOP OM_XMTHEMES_FALSE OM_XMTHEMES_TRUE XMTHEME_DIST MessageCatalog_FALSE MessageCatalog_TRUE LIBOBJS ALLOCA OM_XMU_FALSE OM_XMU_TRUE X_XMU X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF LEXLIB LEX_OUTPUT_ROOT LEX SPLINT YACC LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM AGE REVISION CURRENT target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_x enable_message_catalog enable_themes enable_debug_themes enable_motif22_compatibility enable_utf8 enable_printing enable_xft with_freetype_includes with_freetype_lib with_freetype_config with_default_fonts with_fontconfig_includes with_fontconfig_lib with_fontconfig_config enable_jpeg with_libjpeg_includes with_libjpeg_lib enable_png with_libpng_includes with_libpng_lib ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP LT_SYS_LIBRARY_PATH XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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}' 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= ;; *) 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_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=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_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. 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 # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" 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 this package 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/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names 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] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-message-catalog Enable building of the message catalog (default=no) --enable-themes Enable themes (default=no) --enable-debug-themes Enable themes debugging (default=no) --disable-motif22-compatibility Disable binary compatibility with OpenMotif 2.2 --disable-utf8 Disable UTF-8 support --disable-printing Disable printing support --enable-xft Enable XFT support (font anti aliasing) --enable-jpeg Enable JPEG support --enable-png Enable PNG support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-x use the X Window System --with-freetype-includes=DIR Use FreeType includes in DIR --with-freetype-lib=DIR Use FreeType library in DIR --with-freetype-config=PROG Use FreeType configuration program PROG --with-default-fonts=DIR Use fonts from DIR when config is busted --with-fontconfig-includes=DIR Use Fontconfig includes in DIR --with-fontconfig-lib=DIR Use Fontconfig library in DIR --with-fontconfig-config=PROG Use Fontconfig configuration program PROG --with-libjpeg-includes=DIR Use libjpeg includes in DIR --with-libjpeg-lib=DIR Use libjpeg library in DIR --with-libpng-includes=DIR Use libpng includes in DIR --with-libpng-lib=DIR Use libpng library in DIR 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 (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. 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 the package provider. _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" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 $as_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 configure generated by GNU Autoconf 2.69 Copyright (C) 2012 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 ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type 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 $as_me, which was generated by GNU Autoconf 2.69. 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=. $as_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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 $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_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'; as_fn_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 $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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"/.; 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/X/include/X11/X.h" >&5 $as_echo_n "checking for /usr/X/include/X11/X.h... " >&6; } if ${ac_cv_file__usr_X_include_X11_X_h+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/X/include/X11/X.h"; then ac_cv_file__usr_X_include_X11_X_h=yes else ac_cv_file__usr_X_include_X11_X_h=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_X_include_X11_X_h" >&5 $as_echo "$ac_cv_file__usr_X_include_X11_X_h" >&6; } if test "x$ac_cv_file__usr_X_include_X11_X_h" = xyes; then : ac_default_prefix=/usr/X else ac_default_prefix=/usr fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/X11R6/include/X11/X.h" >&5 $as_echo_n "checking for /usr/X11R6/include/X11/X.h... " >&6; } if ${ac_cv_file__usr_X11R6_include_X11_X_h+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/X11R6/include/X11/X.h"; then ac_cv_file__usr_X11R6_include_X11_X_h=yes else ac_cv_file__usr_X11R6_include_X11_X_h=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_X11R6_include_X11_X_h" >&5 $as_echo "$ac_cv_file__usr_X11R6_include_X11_X_h" >&6; } if test "x$ac_cv_file__usr_X11R6_include_X11_X_h" = xyes; then : ac_default_prefix=/usr/X11R6 else ac_default_prefix=/usr fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&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 && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&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` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- CURRENT=4 REVISION=4 AGE=0 am__api_version='1.15' # 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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=motif VERSION=2.3.8 # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi LIBTOOL_VERSION=$CURRENT:$REVISION:$AGE ac_config_headers="$ac_config_headers include/config.h lib/Xm/Xm.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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.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 if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg 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) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then 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" as_fn_executable_p "$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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then 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" as_fn_executable_p "$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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 as_fn_arith $ac_count + 1 && ac_count=$as_val 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 if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&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. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname 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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: for ac_prog in byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in splint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_SPLINT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$SPLINT"; then ac_cv_prog_SPLINT="$SPLINT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_SPLINT="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi SPLINT=$ac_cv_prog_SPLINT if test -n "$SPLINT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SPLINT" >&5 $as_echo "$SPLINT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SPLINT" && break done for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&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 #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&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 dylib la dll; 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 | /usr/lib64 | /lib | /lib64) ;; *) 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/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else 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.i 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_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 dylib la dll; 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$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$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'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libXt was compiled with -DXTHREADS" >&5 $as_echo_n "checking whether libXt was compiled with -DXTHREADS... " >&6; } if ${lt_cv_xthreads+:} false; then : $as_echo_n "(cached) " >&6 else lt_save_CFLAGS="$CFLAGS" lt_save_CPPFLAGS="$CPPFLAGS" lt_save_LIBS="$LIBS" LIBS="$X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" if test "$cross_compiling" = yes; then : lt_cv_xthreads=dunno else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { Boolean brc; brc=XtToolkitThreadInitialize(); if (True==brc) exit(0); else exit(1); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : lt_cv_xthreads=yes else lt_cv_xthreads=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$lt_save_CFLAGS" CPPFLAGS="$lt_save_CPPFLAGS" LIBS="$lt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_xthreads" >&5 $as_echo "$lt_cv_xthreads" >&6; } if test $lt_cv_xthreads = dunno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't check for XTHREADS if cross-compiling. Assume XTHREADS" >&5 $as_echo "$as_me: WARNING: Can't check for XTHREADS if cross-compiling. Assume XTHREADS" >&2;} $as_echo "#define XTHREADS 1" >>confdefs.h $as_echo "#define XUSE_MTSAFE_API 1" >>confdefs.h fi if test $lt_cv_xthreads = yes; then $as_echo "#define XTHREADS 1" >>confdefs.h $as_echo "#define XUSE_MTSAFE_API 1" >>confdefs.h fi for ac_header in X11/Xos_r.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/Xos_r.h" "ac_cv_header_X11_Xos_r_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Xos_r_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_XOS_R_H 1 _ACEOF fi done for ac_header in X11/Xpoll.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/Xpoll.h" "ac_cv_header_X11_Xpoll_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Xpoll_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_XPOLL_H 1 _ACEOF fi done save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$X_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" for ac_header in X11/Xmu/Editres.h do : ac_fn_c_check_header_compile "$LINENO" "X11/Xmu/Editres.h" "ac_cv_header_X11_Xmu_Editres_h" "#include " if test "x$ac_cv_header_X11_Xmu_Editres_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_XMU_EDITRES_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _XEditResCheckMessages in -lXmu" >&5 $as_echo_n "checking for _XEditResCheckMessages in -lXmu... " >&6; } if ${ac_cv_lib_Xmu__XEditResCheckMessages+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu -lXt -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 _XEditResCheckMessages (); int main () { return _XEditResCheckMessages (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xmu__XEditResCheckMessages=yes else ac_cv_lib_Xmu__XEditResCheckMessages=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu__XEditResCheckMessages" >&5 $as_echo "$ac_cv_lib_Xmu__XEditResCheckMessages" >&6; } if test "x$ac_cv_lib_Xmu__XEditResCheckMessages" = xyes; then : X_XMU=-lXmu $as_echo "#define HAVE_LIBXMU 1" >>confdefs.h else X_XMU="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmuNCopyISOLatin1Lowered in -lXmu" >&5 $as_echo_n "checking for XmuNCopyISOLatin1Lowered in -lXmu... " >&6; } if ${ac_cv_lib_Xmu_XmuNCopyISOLatin1Lowered_+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu -lXt -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 XmuNCopyISOLatin1Lowered (); int main () { return XmuNCopyISOLatin1Lowered (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xmu_XmuNCopyISOLatin1Lowered_=yes else ac_cv_lib_Xmu_XmuNCopyISOLatin1Lowered_=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_XmuNCopyISOLatin1Lowered_" >&5 $as_echo "$ac_cv_lib_Xmu_XmuNCopyISOLatin1Lowered_" >&6; } if test "x$ac_cv_lib_Xmu_XmuNCopyISOLatin1Lowered_" = xyes; then : $as_echo "#define HAVE_XMU_N_COPY_ISO 1" >>confdefs.h fi fi done LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" if test x$X_XMU != x; then OM_XMU_TRUE= OM_XMU_FALSE='#' else OM_XMU_TRUE='#' OM_XMU_FALSE= fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in fcntl.h limits.h malloc.h sys/malloc.h strings.h sys/file.h sys/time.h unistd.h wchar.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wctype.h do : ac_fn_c_check_header_mongrel "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" if test "x$ac_cv_header_wctype_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WCTYPE_H 1 _ACEOF $as_echo "#define HAS_WIDECHAR_FUNCTIONS 1" >>confdefs.h fi done ac_fn_c_check_header_mongrel "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" if test "x$ac_cv_header_langinfo_h" = xyes; then : else $as_echo "#define CSRG_BASED 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "X11/Xos_r.h" "ac_cv_header_X11_Xos_r_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Xos_r_h" = xyes; then : else $as_echo "#define NEED_XOS_R_H 1" >>confdefs.h fi ac_fn_c_check_header_mongrel "$LINENO" "X11/Xpoll.h" "ac_cv_header_X11_Xpoll_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Xpoll_h" = xyes; then : else $as_echo "#define NEED_XPOLL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether weak aliases are supported" >&5 $as_echo_n "checking whether weak aliases are supported... " >&6; } if ${ac_cv_weak_alias_support+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int get_value(int *value) { return *value; } int get_value_alias(int *high) __attribute__((__weak__,alias("get_value"))); int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_weak_alias_support=yes else ac_cv_weak_alias_support=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_weak_alias_support" >&5 $as_echo "$ac_cv_weak_alias_support" >&6; } if test $ac_cv_weak_alias_support = no; then $as_echo "#define NO_WEAK_ALIASES 1" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 $as_echo_n "checking whether setpgrp takes no argument... " >&6; } if ${ac_cv_func_setpgrp_void+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* If this system has a BSD-style setpgrp which takes arguments, setpgrp(1, 1) will fail with ESRCH and return -1, in that case exit successfully. */ return setpgrp (1,1) != -1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_setpgrp_void=no else ac_cv_func_setpgrp_void=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 $as_echo "$ac_cv_func_setpgrp_void" >&6; } if test $ac_cv_func_setpgrp_void = yes; then $as_echo "#define SETPGRP_VOID 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 $as_echo_n "checking for working strcoll... " >&6; } if ${ac_cv_func_strcoll_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strcoll_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { return (strcoll ("abc", "def") >= 0 || strcoll ("ABC", "DEF") >= 0 || strcoll ("123", "456") >= 0) ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strcoll_works=yes else ac_cv_func_strcoll_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 $as_echo "$ac_cv_func_strcoll_works" >&6; } if test $ac_cv_func_strcoll_works = yes; then $as_echo "#define HAVE_STRCOLL 1" >>confdefs.h fi for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sprintf returns void" >&5 $as_echo_n "checking whether sprintf returns void... " >&6; } if ${ac_cv_func_void_sprintf+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_void_sprintf=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int sprintf(); main() { exit(sprintf(".")); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_void_sprintf=no else ac_cv_func_void_sprintf=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_void_sprintf" >&5 $as_echo "$ac_cv_func_void_sprintf" >&6; } if test $ac_cv_func_void_sprintf = no; then $as_echo "#define VOID_SPRINTF 1" >>confdefs.h fi for ac_func in wcslen wcscpy wcsncpy wcschr wcscat wcsncat getcwd gettimeofday mkdir re_comp regcmp select strcspn strerror strstr strtod strtol uname do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRDUP 1 _ACEOF else $as_echo "#define NEED_STRDUP 1" >>confdefs.h fi done for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCASECMP 1 _ACEOF else $as_echo "#define NEED_STRCASECMP 1" >>confdefs.h fi done for ac_func in putenv do : ac_fn_c_check_func "$LINENO" "putenv" "ac_cv_func_putenv" if test "x$ac_cv_func_putenv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PUTENV 1 _ACEOF else $as_echo "#define NO_PUTENV 1" >>confdefs.h fi done for ac_func in regcomp do : ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" if test "x$ac_cv_func_regcomp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REGCOMP 1 _ACEOF else $as_echo "#define NO_REGCOMP 1" >>confdefs.h fi done for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMMOVE 1 _ACEOF else $as_echo "#define NO_MEMMOVE 1" >>confdefs.h fi done ac_fn_c_check_type "$LINENO" "XICProc" "ac_cv_type_XICProc" "#include " if test "x$ac_cv_type_XICProc" = xyes; then : else $as_echo "#define NO_XICPROC 1" >>confdefs.h fi # Check whether --enable-message-catalog was given. if test "${enable_message_catalog+set}" = set; then : enableval=$enable_message_catalog; fi if test "$enable_message_catalog" != "yes" then $as_echo "#define NO_MESSAGE_CATALOG 1" >>confdefs.h fi if test x$enable_message_catalog = xyes; then MessageCatalog_TRUE= MessageCatalog_FALSE='#' else MessageCatalog_TRUE='#' MessageCatalog_FALSE= fi # Check whether --enable-themes was given. if test "${enable_themes+set}" = set; then : enableval=$enable_themes; fi if test "$enable_themes" = "yes" then if test -f $srcdir/lib/Xm/Theme.h then $as_echo "#define USE_XMTHEMES 1" >>confdefs.h XMTHEME_DIST = "Theme.h ThemeP.h DynLibP.h Theme.c DynLib.c" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-themes specified, but I don't have the code. Disabled" >&5 $as_echo "$as_me: WARNING: --enable-themes specified, but I don't have the code. Disabled" >&2;} enable_themes="no" fi fi if test "$enable_themes" = "yes"; then OM_XMTHEMES_TRUE= OM_XMTHEMES_FALSE='#' else OM_XMTHEMES_TRUE='#' OM_XMTHEMES_FALSE= fi # Check whether --enable-debug-themes was given. if test "${enable_debug_themes+set}" = set; then : enableval=$enable_debug_themes; fi if test "$enable_themes" = "yes" then if test "$enable_debug_themes" = "yes" then $as_echo "#define DEBUGTHEMES 1" >>confdefs.h fi fi if test x$GCC = xyes then CFLAGS="$CFLAGS -Wall -g -fno-strict-aliasing -Wno-unused -Wno-comment" if test ` $CC -dumpversion | sed -e 's/\(^.\).*/\1/'` = "4" ; then CFLAGS="$CFLAGS -fno-tree-ter" fi fi $as_echo "#define NO_OL_COMPAT 1" >>confdefs.h CDE_INSTALLATION_TOP="\${prefix}/dt" CDE_CONFIGURATION_TOP="\${prefix}/etc/dt" LIBDIR="${libdir}/X11" MWMRCDIR="${libdir}/X11" INCDIR="${includedir}/X11" XMBINDDIR_FALLBACK="${libdir}/X11/bindings" RM="rm -f" # Check whether --enable-motif22-compatibility was given. if test "${enable_motif22_compatibility+set}" = set; then : enableval=$enable_motif22_compatibility; fi # Check whether --enable-utf8 was given. if test "${enable_utf8+set}" = set; then : enableval=$enable_utf8; fi case "$host_os" in freebsd*) CFLAGS="$CFLAGS -DCSRG_BASED -DXNO_MTSAFE_API -DXNO_MTSAFE_PWDAPI"; LDFLAGS="$LDFLAGS -L/usr/local/lib";; cygwin*) CFLAGS="$CFLAGS -DXNO_MTSAFE_DIRENTDAPI";; solaris* | sunos*) X_LIBS="$X_LIBS -L/usr/X/lib" && if test x$enable_motif22_compatibility = x then enable_motif22_compatibility="no" fi; if test x$enable_utf8 = x then enable_utf8="no" fi; if test x$enable_xft = x then enable_xft="no" fi;; esac if test x$enable_motif22_compatibility = x then enable_motif22_compatibility="yes" fi if test "$enable_motif22_compatibility" = "yes" then $as_echo "#define OM22_COMPATIBILITY 1" >>confdefs.h OM22_COMPATIBILITY_FALSE=! OM22_COMPATIBILITY_TRUE= else OM22_COMPATIBILITY_FALSE= OM22_COMPATIBILITY_TRUE=! fi if test x$enable_utf8 = x then enable_utf8="yes" fi if test "$enable_utf8" = "yes" then $as_echo "#define UTF8_SUPPORTED 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing iconv_open" >&5 $as_echo_n "checking for library containing iconv_open... " >&6; } if ${ac_cv_search_iconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 iconv_open (); int main () { return iconv_open (); ; return 0; } _ACEOF for ac_lib in '' iconv; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_iconv_open=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_iconv_open+:} false; then : break fi done if ${ac_cv_search_iconv_open+:} false; then : else ac_cv_search_iconv_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv_open" >&5 $as_echo "$ac_cv_search_iconv_open" >&6; } ac_res=$ac_cv_search_iconv_open if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing libiconv_open" >&5 $as_echo_n "checking for library containing libiconv_open... " >&6; } if ${ac_cv_search_libiconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 libiconv_open (); int main () { return libiconv_open (); ; return 0; } _ACEOF for ac_lib in '' iconv; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_libiconv_open=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_libiconv_open+:} false; then : break fi done if ${ac_cv_search_libiconv_open+:} false; then : else ac_cv_search_libiconv_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_libiconv_open" >&5 $as_echo "$ac_cv_search_libiconv_open" >&6; } ac_res=$ac_cv_search_libiconv_open if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi fi # Check whether --enable-printing was given. if test "${enable_printing+set}" = set; then : enableval=$enable_printing; fi if test x$enable_printing = x then enable_printing="yes" fi if test "$enable_printing" = "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libXp" >&5 $as_echo_n "checking for libXp... " >&6; } for ac_header in X11/extensions/Print.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Print.h" "ac_cv_header_X11_extensions_Print_h" "$ac_includes_default" if test "x$ac_cv_header_X11_extensions_Print_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_PRINT_H 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpCreateContext in -lXp" >&5 $as_echo_n "checking for XpCreateContext in -lXp... " >&6; } if ${ac_cv_lib_Xp_XpCreateContext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 XpCreateContext (); int main () { return XpCreateContext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xp_XpCreateContext=yes else ac_cv_lib_Xp_XpCreateContext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpCreateContext" >&5 $as_echo "$ac_cv_lib_Xp_XpCreateContext" >&6; } if test "x$ac_cv_lib_Xp_XpCreateContext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXP 1 _ACEOF LIBS="-lXp $LIBS" else enable_printing="no" fi else enable_printing="no" fi done fi if test "$enable_printing" = "yes" then LIB_XP=-lXp $as_echo "#define PRINTING_SUPPORTED 1" >>confdefs.h PRINTING_SUPPORTED_FALSE=! PRINTING_SUPPORTED_TRUE= else LIB_XP= PRINTING_SUPPORTED_FALSE= PRINTING_SUPPORTED_TRUE=! fi if test "$enable_printing" = "yes"; then PRINTING_TRUE= PRINTING_FALSE='#' else PRINTING_TRUE='#' PRINTING_FALSE= fi # Check whether --enable-xft was given. if test "${enable_xft+set}" = set; then : enableval=$enable_xft; else enable_xft=yes fi # Check whether --with-freetype_includes was given. if test "${with_freetype_includes+set}" = set; then : withval=$with_freetype_includes; freetype_includes=$withval else freetype_includes=yes fi # Check whether --with-freetype_lib was given. if test "${with_freetype_lib+set}" = set; then : withval=$with_freetype_lib; freetype_lib=$withval else freetype_lib=yes fi # Check whether --with-freetype_config was given. if test "${with_freetype_config+set}" = set; then : withval=$with_freetype_config; freetype_config=$withval else freetype_config=yes fi # Check whether --with-default_fonts was given. if test "${with_default_fonts+set}" = set; then : withval=$with_default_fonts; defaultfonts="$withval" else default_fonts=yes fi # Check whether --with-fontconfig_includes was given. if test "${with_fontconfig_includes+set}" = set; then : withval=$with_fontconfig_includes; fontconfig_includes=$withval else fontconfig_includes=yes fi # Check whether --with-fontconfig_lib was given. if test "${with_fontconfig_lib+set}" = set; then : withval=$with_fontconfig_lib; fontconfig_lib=$withval else fontconfig_lib=yes fi # Check whether --with-fontconfig_config was given. if test "${with_fontconfig_config+set}" = set; then : withval=$with_fontconfig_config; fontconfig_config=$withval else fontconfig_config=yes fi if test "$enable_xft" = "yes" then # # Check freetype configuration # case "$freetype_config" in no) ;; yes) # Extract the first word of "freetype-config", so it can be a program name with args. set dummy freetype-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ft_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ft_config"; then ac_cv_prog_ft_config="$ft_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ft_config="freetype-config" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ft_config" && ac_cv_prog_ft_config="no" fi fi ft_config=$ac_cv_prog_ft_config if test -n "$ft_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ft_config" >&5 $as_echo "$ft_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) ft_config="$freetype_config" ;; esac case "$freetype_includes" in no) FREETYPE_CFLAGS="" ;; yes) case "$ft_config" in no) FREETYPE_CFLAGS="" ;; *) FREETYPE_CFLAGS="`$ft_config --cflags`" ;; esac ;; *) FREETYPE_CFLAGS="-I$freetype_includes" ;; esac case "$freetype_lib" in no) freetype_lib="" ;; yes) case "$ft_config" in no) freetype_lib="" ;; *) freetype_lib="`$ft_config --libs`" ;; esac ;; *) freetype_lib="-L$freetype_lib -lfreetype" ;; esac saved_LIBS="$LIBS" LIBS="$LIBS $freetype_lib" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" for ac_header in freetype/freetype.h do : ac_fn_c_check_header_mongrel "$LINENO" "freetype/freetype.h" "ac_cv_header_freetype_freetype_h" "$ac_includes_default" if test "x$ac_cv_header_freetype_freetype_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FREETYPE_FREETYPE_H 1 _ACEOF fi done FINDXFT_HAVE_FREETYPE="no" case "$ac_cv_header_freetype_freetype_h" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) for ac_func in FT_Init_FreeType do : ac_fn_c_check_func "$LINENO" "FT_Init_FreeType" "ac_cv_func_FT_Init_FreeType" if test "x$ac_cv_func_FT_Init_FreeType" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FT_INIT_FREETYPE 1 _ACEOF fi done case "$ac_cv_func_FT_Init_FreeType" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) FINDXFT_HAVE_FREETYPE="yes" $as_echo "#define HAVE_FREETYPE 1" >>confdefs.h ;; esac ;; esac case "$default_fonts" in yes) FC_DEFAULT_FONTS="/usr/share/fonts" cat >>confdefs.h <<_ACEOF #define FC_DEFAULT_FONTS "/usr/share/fonts" _ACEOF ;; *) FC_DEFAULT_FONTS="$default_fonts" cat >>confdefs.h <<_ACEOF #define FC_DEFAULT_FONTS "$default_fonts" _ACEOF ;; esac # # Set CONFDIR and FONTCONFIG_PATH # case "$confdir" in no|yes) confdir=/etc/fonts ;; *) ;; esac CONFDIR='${confdir}' cat >>confdefs.h <<_ACEOF #define CONFDIR "$CONFDIR" _ACEOF # # Check X configuration # FINDXFT_HAVE_XRENDER="no" case "$have_x" in yes) XRENDER_CFLAGS="-I$x_includes" XRENDER_LIBS="-L$x_libraries -lXft -lXrender" saved_LIBS="$LIBS" LIBS="$LIBS $XRENDER_LIBS" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS" for ac_header in X11/extensions/Xrender.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrender.h" "ac_cv_header_X11_extensions_Xrender_h" "$ac_includes_default" if test "x$ac_cv_header_X11_extensions_Xrender_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_EXTENSIONS_XRENDER_H 1 _ACEOF fi done case "$ac_cv_header_X11_extensions_Xrender_h" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) for ac_func in XRenderParseColor do : ac_fn_c_check_func "$LINENO" "XRenderParseColor" "ac_cv_func_XRenderParseColor" if test "x$ac_cv_func_XRenderParseColor" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_XRENDERPARSECOLOR 1 _ACEOF fi done case "$ac_cv_func_XRenderParseColor" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) FINDXFT_HAVE_XRENDER="yes" $as_echo "#define HAVE_XRENDER 1" >>confdefs.h ;; esac ;; esac ;; esac # # Check fontconfig configuration # case "$fontconfig_config" in no) ;; yes) # Extract the first word of "fontconfig-config", so it can be a program name with args. set dummy fontconfig-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_fc_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$fc_config"; then ac_cv_prog_fc_config="$fc_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_fc_config="fontconfig-config" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_fc_config" && ac_cv_prog_fc_config="no" fi fi fc_config=$ac_cv_prog_fc_config if test -n "$fc_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fc_config" >&5 $as_echo "$fc_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) fc_config="$fontconfig_config" ;; esac case "$fontconfig_includes" in no) FONTCONFIG_CFLAGS="" ;; yes) case "$fc_config" in no) FONTCONFIG_CFLAGS="`pkg-config fontconfig --cflags`" ;; *) FONTCONFIG_CFLAGS="`$fc_config --cflags`" ;; esac ;; *) FONTCONFIG_CFLAGS="-I$fontconfig_includes" ;; esac case "$fontconfig_lib" in no) fontconfig_lib="" ;; yes) case "$fc_config" in no) FONTCONFIG_LIBS="`pkg-config fontconfig --libs`" ;; *) FONTCONFIG_LIBS="`$fc_config --libs`" ;; esac ;; *) FONTCONFIG_LIBS="-L$fontconfig_lib -lfontconfig" ;; esac saved_LIBS="$LIBS" LIBS="$LIBS $FONTCONFIG_LIBS" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $FONTCONFIG_CFLAGS" for ac_header in fontconfig/fontconfig.h do : ac_fn_c_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" if test "x$ac_cv_header_fontconfig_fontconfig_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FONTCONFIG_FONTCONFIG_H 1 _ACEOF fi done case "$ac_cv_header_fontconfig_fontconfig_h" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) for ac_func in FcInit do : ac_fn_c_check_func "$LINENO" "FcInit" "ac_cv_func_FcInit" if test "x$ac_cv_func_FcInit" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FCINIT 1 _ACEOF fi done case "$ac_cv_func_FcInit" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) $as_echo "#define HAVE_FONTCONFIG 1" >>confdefs.h ;; esac ;; esac $as_echo "#define USE_XFT 1" >>confdefs.h CFLAGS="$CFLAGS `pkg-config xft --cflags`" LIBS="$LIBS `pkg-config xft --libs`" fi # Check whether --enable-jpeg was given. if test "${enable_jpeg+set}" = set; then : enableval=$enable_jpeg; else enable_jpeg=yes fi # Check whether --with-libjpeg_includes was given. if test "${with_libjpeg_includes+set}" = set; then : withval=$with_libjpeg_includes; libjpeg_includes=$withval fi # Check whether --with-libjpeg_lib was given. if test "${with_libjpeg_lib+set}" = set; then : withval=$with_libjpeg_lib; libjpeg_lib=$withval fi # Check whether --enable-png was given. if test "${enable_png+set}" = set; then : enableval=$enable_png; else enable_png=yes fi # Check whether --with-libpng_includes was given. if test "${with_libpng_includes+set}" = set; then : withval=$with_libpng_includes; libpng_includes=$withval fi # Check whether --with-libpng_lib was given. if test "${with_libpng_lib+set}" = set; then : withval=$with_libpng_lib; libpng_lib=$withval fi # # Check libjpeg configuration # if test "$enable_jpeg" = "yes" then if test "$libjpeg_includes" then LIBJPEG_CFLAGS="-I$libjpeg_includes" fi if test "$libjpeg_lib" then LIBJPEG_LIBS="-L$libjpeg_lib -ljpeg" else LIBJPEG_LIBS="-ljpeg" fi saved_LIBS="$LIBS" LIBS="$LIBS $LIBJPEG_LIBS" saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBJPEG_CFLAGS" for ac_header in jpeglib.h do : ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" if test "x$ac_cv_header_jpeglib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_JPEGLIB_H 1 _ACEOF libjpeg_headers_present="yes" fi done for ac_func in jpeg_start_decompress do : ac_fn_c_check_func "$LINENO" "jpeg_start_decompress" "ac_cv_func_jpeg_start_decompress" if test "x$ac_cv_func_jpeg_start_decompress" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_JPEG_START_DECOMPRESS 1 _ACEOF libjpeg_present="yes" fi done if test "$libjpeg_present" = "yes" -a "$libjpeg_headers_present" = "yes" then use_libjpeg=yes $as_echo "#define JPEG_SUPPORTED 1" >>confdefs.h else CFLAGS="$saved_CFLAGS" LIBS="$saved_LIBS" fi fi if test "$use_libjpeg" = "yes"; then OM_LIBJPEG_TRUE= OM_LIBJPEG_FALSE='#' else OM_LIBJPEG_TRUE='#' OM_LIBJPEG_FALSE= fi # # Check libpng configuration # if test "$enable_png" = "yes" then if test "$libpng_includes" then LIBPNG_CFLAGS="-I$libpng_includes" fi if test "$libpng_lib" then LIBPNG_LIBS="-L$libpng_lib -lpng" else LIBPNG_LIBS="-lpng" fi saved_LIBS="$LIBS" LIBS="$LIBS $LIBPNG_LIBS" saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBPNG_CFLAGS" for ac_header in png.h do : ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PNG_H 1 _ACEOF libpng_headers_present="yes" fi done for ac_func in png_create_read_struct do : ac_fn_c_check_func "$LINENO" "png_create_read_struct" "ac_cv_func_png_create_read_struct" if test "x$ac_cv_func_png_create_read_struct" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PNG_CREATE_READ_STRUCT 1 _ACEOF libpng_present="yes" fi done if test "$libpng_present" = "yes" -a "$libpng_headers_present" = "yes" then use_libpng=yes $as_echo "#define PNG_SUPPORTED 1" >>confdefs.h else CFLAGS="$saved_CFLAGS" LIBS="$saved_LIBS" fi fi if test "$use_libpng" = "yes"; then OM_LIBPNG_TRUE= OM_LIBPNG_FALSE='#' else OM_LIBPNG_TRUE='#' OM_LIBPNG_FALSE= fi # AM_CONDITIONAL(Motif22Compatibility, test x$enable_motif22_compatibility = xyes) ac_config_files="$ac_config_files Makefile bindings/Makefile bitmaps/Makefile clients/Makefile clients/mwm/Makefile clients/mwm/WmWsmLib/Makefile clients/uil/Makefile clients/xmbind/Makefile config/Makefile config/util/Makefile include/Makefile include/Dt/Makefile lib/Makefile lib/Xm/Makefile lib/Mrm/Makefile localized/Makefile localized/util/Makefile doc/Makefile doc/man/Makefile doc/man/man1/Makefile doc/man/man3/Makefile doc/man/man4/Makefile doc/man/man5/Makefile tools/Makefile tools/wml/Makefile demos/Makefile demos/lib/Makefile demos/lib/Xmd/Makefile demos/lib/Wsm/Makefile demos/lib/Exm/Makefile demos/lib/Exm/wml/Makefile demos/programs/Makefile demos/programs/Exm/Makefile demos/programs/Exm/app_in_c/Makefile demos/programs/Exm/app_in_uil/Makefile demos/programs/Exm/simple_app/Makefile demos/programs/airport/Makefile demos/programs/animate/Makefile demos/programs/drag_and_drop/Makefile demos/programs/draw/Makefile demos/programs/earth/Makefile demos/programs/filemanager/Makefile demos/programs/fileview/Makefile demos/programs/getsubres/Makefile demos/programs/hellomotif/Makefile demos/programs/hellomotifi18n/Makefile demos/programs/hellomotifi18n/C/Makefile demos/programs/hellomotifi18n/C/uid/Makefile demos/programs/hellomotifi18n/english/Makefile demos/programs/hellomotifi18n/english/uid/Makefile demos/programs/hellomotifi18n/french/Makefile demos/programs/hellomotifi18n/french/uid/Makefile demos/programs/hellomotifi18n/hebrew/Makefile demos/programs/hellomotifi18n/hebrew/uid/Makefile demos/programs/hellomotifi18n/japan/Makefile demos/programs/hellomotifi18n/japan/uid/Makefile demos/programs/hellomotifi18n/japanese/Makefile demos/programs/hellomotifi18n/japanese/uid/Makefile demos/programs/hellomotifi18n/swedish/Makefile demos/programs/hellomotifi18n/swedish/uid/Makefile demos/programs/i18ninput/Makefile demos/programs/panner/Makefile demos/programs/periodic/Makefile demos/programs/piano/Makefile demos/programs/popups/Makefile demos/programs/sampler2_0/Makefile demos/programs/setdate/Makefile demos/programs/todo/Makefile demos/programs/workspace/Makefile demos/programs/tooltips/Makefile demos/programs/FontSel/Makefile demos/programs/ButtonBox/Makefile demos/programs/ColorSel/Makefile demos/programs/Column/Makefile demos/programs/Combo2/Makefile demos/programs/Ext18List/Makefile demos/programs/Ext18List/pixmaps/Makefile demos/programs/IconB/Makefile demos/programs/Outline/Makefile demos/programs/Paned/Makefile demos/programs/TabStack/Makefile demos/programs/Tree/Makefile demos/programs/pixmaps/Makefile demos/unsupported/Makefile demos/unsupported/Exm/Makefile demos/unsupported/aicon/Makefile demos/unsupported/dainput/Makefile demos/unsupported/dogs/Makefile demos/unsupported/hellomotif/Makefile demos/unsupported/motifshell/Makefile demos/unsupported/uilsymdump/Makefile demos/unsupported/xmapdef/Makefile demos/unsupported/xmfonts/Makefile demos/unsupported/xmforc/Makefile demos/unsupported/xmform/Makefile demos/doc/Makefile demos/doc/programGuide/Makefile demos/doc/programGuide/ch05/Makefile demos/doc/programGuide/ch05/Scale/Makefile demos/doc/programGuide/ch06/Makefile demos/doc/programGuide/ch06/spin_box/Makefile demos/doc/programGuide/ch06/combo_box/Makefile demos/doc/programGuide/ch08/Makefile demos/doc/programGuide/ch08/Notebook/Makefile demos/doc/programGuide/ch08/Container/Makefile demos/doc/programGuide/ch16/Makefile demos/doc/programGuide/ch17/Makefile demos/doc/programGuide/ch17/simple_drop/Makefile demos/doc/programGuide/ch17/simple_drag/Makefile lib/Xm/xmstring.list" 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; 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 if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_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= U= 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=`$as_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. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OM_XMU_TRUE}" && test -z "${OM_XMU_FALSE}"; then as_fn_error $? "conditional \"OM_XMU\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MessageCatalog_TRUE}" && test -z "${MessageCatalog_FALSE}"; then as_fn_error $? "conditional \"MessageCatalog\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OM_XMTHEMES_TRUE}" && test -z "${OM_XMTHEMES_FALSE}"; then as_fn_error $? "conditional \"OM_XMTHEMES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PRINTING_TRUE}" && test -z "${PRINTING_FALSE}"; then as_fn_error $? "conditional \"PRINTING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OM_LIBJPEG_TRUE}" && test -z "${OM_LIBJPEG_FALSE}"; then as_fn_error $? "conditional \"OM_LIBJPEG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OM_LIBPNG_TRUE}" && test -z "${OM_LIBPNG_FALSE}"; then as_fn_error $? "conditional \"OM_LIBPNG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## 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=: # Pre-4.2 versions of Zsh do 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_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac 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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_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 || $as_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" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 $as_me, which was generated by GNU Autoconf 2.69. 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 case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # 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_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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 the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= 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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_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. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "lib/Xm/Xm.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/Xm/Xm.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bindings/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Makefile" ;; "bitmaps/Makefile") CONFIG_FILES="$CONFIG_FILES bitmaps/Makefile" ;; "clients/Makefile") CONFIG_FILES="$CONFIG_FILES clients/Makefile" ;; "clients/mwm/Makefile") CONFIG_FILES="$CONFIG_FILES clients/mwm/Makefile" ;; "clients/mwm/WmWsmLib/Makefile") CONFIG_FILES="$CONFIG_FILES clients/mwm/WmWsmLib/Makefile" ;; "clients/uil/Makefile") CONFIG_FILES="$CONFIG_FILES clients/uil/Makefile" ;; "clients/xmbind/Makefile") CONFIG_FILES="$CONFIG_FILES clients/xmbind/Makefile" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "config/util/Makefile") CONFIG_FILES="$CONFIG_FILES config/util/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/Dt/Makefile") CONFIG_FILES="$CONFIG_FILES include/Dt/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/Xm/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Xm/Makefile" ;; "lib/Mrm/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Mrm/Makefile" ;; "localized/Makefile") CONFIG_FILES="$CONFIG_FILES localized/Makefile" ;; "localized/util/Makefile") CONFIG_FILES="$CONFIG_FILES localized/util/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/man/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/Makefile" ;; "doc/man/man1/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/man1/Makefile" ;; "doc/man/man3/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/man3/Makefile" ;; "doc/man/man4/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/man4/Makefile" ;; "doc/man/man5/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/man5/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/wml/Makefile") CONFIG_FILES="$CONFIG_FILES tools/wml/Makefile" ;; "demos/Makefile") CONFIG_FILES="$CONFIG_FILES demos/Makefile" ;; "demos/lib/Makefile") CONFIG_FILES="$CONFIG_FILES demos/lib/Makefile" ;; "demos/lib/Xmd/Makefile") CONFIG_FILES="$CONFIG_FILES demos/lib/Xmd/Makefile" ;; "demos/lib/Wsm/Makefile") CONFIG_FILES="$CONFIG_FILES demos/lib/Wsm/Makefile" ;; "demos/lib/Exm/Makefile") CONFIG_FILES="$CONFIG_FILES demos/lib/Exm/Makefile" ;; "demos/lib/Exm/wml/Makefile") CONFIG_FILES="$CONFIG_FILES demos/lib/Exm/wml/Makefile" ;; "demos/programs/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Makefile" ;; "demos/programs/Exm/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Exm/Makefile" ;; "demos/programs/Exm/app_in_c/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Exm/app_in_c/Makefile" ;; "demos/programs/Exm/app_in_uil/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Exm/app_in_uil/Makefile" ;; "demos/programs/Exm/simple_app/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Exm/simple_app/Makefile" ;; "demos/programs/airport/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/airport/Makefile" ;; "demos/programs/animate/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/animate/Makefile" ;; "demos/programs/drag_and_drop/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/drag_and_drop/Makefile" ;; "demos/programs/draw/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/draw/Makefile" ;; "demos/programs/earth/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/earth/Makefile" ;; "demos/programs/filemanager/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/filemanager/Makefile" ;; "demos/programs/fileview/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/fileview/Makefile" ;; "demos/programs/getsubres/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/getsubres/Makefile" ;; "demos/programs/hellomotif/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotif/Makefile" ;; "demos/programs/hellomotifi18n/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/Makefile" ;; "demos/programs/hellomotifi18n/C/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/C/Makefile" ;; "demos/programs/hellomotifi18n/C/uid/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/C/uid/Makefile" ;; "demos/programs/hellomotifi18n/english/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/english/Makefile" ;; "demos/programs/hellomotifi18n/english/uid/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/english/uid/Makefile" ;; "demos/programs/hellomotifi18n/french/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/french/Makefile" ;; "demos/programs/hellomotifi18n/french/uid/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/french/uid/Makefile" ;; "demos/programs/hellomotifi18n/hebrew/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/hebrew/Makefile" ;; "demos/programs/hellomotifi18n/hebrew/uid/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/hebrew/uid/Makefile" ;; "demos/programs/hellomotifi18n/japan/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/japan/Makefile" ;; "demos/programs/hellomotifi18n/japan/uid/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/japan/uid/Makefile" ;; "demos/programs/hellomotifi18n/japanese/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/japanese/Makefile" ;; "demos/programs/hellomotifi18n/japanese/uid/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/japanese/uid/Makefile" ;; "demos/programs/hellomotifi18n/swedish/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/swedish/Makefile" ;; "demos/programs/hellomotifi18n/swedish/uid/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/hellomotifi18n/swedish/uid/Makefile" ;; "demos/programs/i18ninput/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/i18ninput/Makefile" ;; "demos/programs/panner/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/panner/Makefile" ;; "demos/programs/periodic/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/periodic/Makefile" ;; "demos/programs/piano/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/piano/Makefile" ;; "demos/programs/popups/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/popups/Makefile" ;; "demos/programs/sampler2_0/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/sampler2_0/Makefile" ;; "demos/programs/setdate/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/setdate/Makefile" ;; "demos/programs/todo/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/todo/Makefile" ;; "demos/programs/workspace/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/workspace/Makefile" ;; "demos/programs/tooltips/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/tooltips/Makefile" ;; "demos/programs/FontSel/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/FontSel/Makefile" ;; "demos/programs/ButtonBox/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/ButtonBox/Makefile" ;; "demos/programs/ColorSel/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/ColorSel/Makefile" ;; "demos/programs/Column/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Column/Makefile" ;; "demos/programs/Combo2/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Combo2/Makefile" ;; "demos/programs/Ext18List/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Ext18List/Makefile" ;; "demos/programs/Ext18List/pixmaps/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Ext18List/pixmaps/Makefile" ;; "demos/programs/IconB/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/IconB/Makefile" ;; "demos/programs/Outline/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Outline/Makefile" ;; "demos/programs/Paned/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Paned/Makefile" ;; "demos/programs/TabStack/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/TabStack/Makefile" ;; "demos/programs/Tree/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/Tree/Makefile" ;; "demos/programs/pixmaps/Makefile") CONFIG_FILES="$CONFIG_FILES demos/programs/pixmaps/Makefile" ;; "demos/unsupported/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/Makefile" ;; "demos/unsupported/Exm/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/Exm/Makefile" ;; "demos/unsupported/aicon/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/aicon/Makefile" ;; "demos/unsupported/dainput/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/dainput/Makefile" ;; "demos/unsupported/dogs/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/dogs/Makefile" ;; "demos/unsupported/hellomotif/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/hellomotif/Makefile" ;; "demos/unsupported/motifshell/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/motifshell/Makefile" ;; "demos/unsupported/uilsymdump/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/uilsymdump/Makefile" ;; "demos/unsupported/xmapdef/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/xmapdef/Makefile" ;; "demos/unsupported/xmfonts/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/xmfonts/Makefile" ;; "demos/unsupported/xmforc/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/xmforc/Makefile" ;; "demos/unsupported/xmform/Makefile") CONFIG_FILES="$CONFIG_FILES demos/unsupported/xmform/Makefile" ;; "demos/doc/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/Makefile" ;; "demos/doc/programGuide/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/Makefile" ;; "demos/doc/programGuide/ch05/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch05/Makefile" ;; "demos/doc/programGuide/ch05/Scale/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch05/Scale/Makefile" ;; "demos/doc/programGuide/ch06/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch06/Makefile" ;; "demos/doc/programGuide/ch06/spin_box/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch06/spin_box/Makefile" ;; "demos/doc/programGuide/ch06/combo_box/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch06/combo_box/Makefile" ;; "demos/doc/programGuide/ch08/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch08/Makefile" ;; "demos/doc/programGuide/ch08/Notebook/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch08/Notebook/Makefile" ;; "demos/doc/programGuide/ch08/Container/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch08/Container/Makefile" ;; "demos/doc/programGuide/ch16/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch16/Makefile" ;; "demos/doc/programGuide/ch17/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch17/Makefile" ;; "demos/doc/programGuide/ch17/simple_drop/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch17/simple_drop/Makefile" ;; "demos/doc/programGuide/ch17/simple_drag/Makefile") CONFIG_FILES="$CONFIG_FILES demos/doc/programGuide/ch17/simple_drag/Makefile" ;; "lib/Xm/xmstring.list") CONFIG_FILES="$CONFIG_FILES lib/Xm/xmstring.list" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # 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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[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="$ac_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 || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append 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 '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 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 || $as_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"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 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 || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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 s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi motif-2.3.8/acinclude.m40000644000175000017500000000417313150700036011754 00000000000000dnl dnl This file provides the following macros dnl dnl LT_LIB_XTHREADS dnl AM_FUNC_VOID_SPRINTF dnl WEAK_ALIAS_SUPPORT dnl dnl This should be the canonical approach to check for XTHREADS. dnl (see "man XtToolkitThreadInitialize") AC_DEFUN([LT_LIB_XTHREADS], [AC_REQUIRE([AC_PATH_X]) AC_CACHE_CHECK(whether libXt was compiled with -DXTHREADS, lt_cv_xthreads, [lt_save_CFLAGS="$CFLAGS" lt_save_CPPFLAGS="$CPPFLAGS" lt_save_LIBS="$LIBS" LIBS="$X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" CFLAGS="$X_CFLAGS $CFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" AC_TRY_RUN([ #include int main() { Boolean brc; brc=XtToolkitThreadInitialize(); if (True==brc) exit(0); else exit(1); } ], lt_cv_xthreads=yes, lt_cv_xthreads=no, lt_cv_xthreads=dunno) CFLAGS="$lt_save_CFLAGS" CPPFLAGS="$lt_save_CPPFLAGS" LIBS="$lt_save_LIBS" ]) if test $lt_cv_xthreads = dunno; then AC_MSG_WARN(Can't check for XTHREADS if cross-compiling. Assume XTHREADS) AC_DEFINE(XTHREADS,1,"Has XThreads") AC_DEFINE(XUSE_MTSAFE_API,1,"API is MTSAFE") fi if test $lt_cv_xthreads = yes; then AC_DEFINE(XTHREADS,1,"Has XThreads") AC_DEFINE(XUSE_MTSAFE_API,1,"API is MTSAFE") fi ]) dnl This test is not very reliable probably ... AC_DEFUN([AM_FUNC_VOID_SPRINTF], [AC_CACHE_CHECK(whether sprintf returns void, ac_cv_func_void_sprintf, [AC_TRY_RUN([#include int sprintf(); main() { exit(sprintf(".")); }], ac_cv_func_void_sprintf=no, ac_cv_func_void_sprintf=yes, ac_cv_func_void_sprintf=yes)]) if test $ac_cv_func_void_sprintf = no; then AC_DEFINE(VOID_SPRINTF,1, [Define if sprintf doesn't return the number of chars written]) fi ]) dnl This tests whether weak aliases are supported. AC_DEFUN([WEAK_ALIAS_SUPPORT], [AC_CACHE_CHECK(whether weak aliases are supported, ac_cv_weak_alias_support, [AC_TRY_COMPILE([ int get_value(int *value) { return *value; } int get_value_alias(int *high) __attribute__((__weak__,alias("get_value"))); ], [], ac_cv_weak_alias_support=yes, ac_cv_weak_alias_support=no)]) if test $ac_cv_weak_alias_support = no; then AC_DEFINE(NO_WEAK_ALIASES,1,[Define if weak aliases are not supported]) fi ]) dnl dnl End of special macros. dnl motif-2.3.8/doc/0000755000175000017500000000000013211513006010400 500000000000000motif-2.3.8/doc/Makefile.in0000644000175000017500000004635013211512767012412 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = man all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/doc/man/0000755000175000017500000000000013211513006011153 500000000000000motif-2.3.8/doc/man/Makefile.in0000644000175000017500000004640413211512767013165 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = man1 man3 man4 man5 all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/doc/man/man1/0000755000175000017500000000000013211513006012007 500000000000000motif-2.3.8/doc/man/man1/mwm.10000644000175000017500000021327612672140200012626 00000000000000'\" t ...\" mwm.sgm /main/13 1996/09/25 11:30:27 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "mwm" "user cmd" .SH "NAME" \fBmwm\fP \(em The Motif Window Manager .SH "SYNOPSIS" .PP \fBmwm\fP [\fIoptions\fP] .SH "DESCRIPTION" .PP The \fBmwm\fP window manager provides functions that facilitate control (by the user and the programmer) of elements of window state such as placement, size, icon/normal display, and input-focus ownership\&. .PP The stand-alone window manager is not an integral part of CDE and does not support communication with other components in the CDE environment, such as the Style Manager and the Session Manager\&. .SS "Options" .IP "\fI-display\fP\ \fBdisplay\fP" 10 This option specifies the display to use; see \fBX\fP(1)\&. .IP "\fI-xrm\fP\ \fBresourcestring\fP" 10 This option specifies a resource string to use\&. .IP "\fI-multiscreen\fP" 10 This option causes \fBmwm\fP to manage all screens on the display\&. The default is to manage only a single screen. .IP "\fI-name\fP\ \fBname\fP" 10 This option causes \fBmwm\fP to retrieve its resources using the specified name, as in \fBname*resource\fP\&. .IP "\fI-screens\fP\ \fBname\ [name\ [\&.\&.\&.]]\fP" 10 This option specifies the resource names to use for the screens managed by \fBmwm\fP\&. If \fBmwm\fP is managing a single screen, only the first name in the list is used\&. If \fBmwm\fP is managing multiple screens, the names are assigned to the screens in order, starting with screen 0\&. Screen 0 gets the first name, screen 1 the second name, and so on\&. .SS "Appearance" .PP The following sections describe the basic default behaviors of windows, icons, the icon box, input focus, and window stacking\&. The appearance and behavior of the window manager can be altered by changing the configuration of specific resources\&. Resources are defined under the heading "X DEFAULTS\&." .SS "Screens" .PP By default, \fBmwm\fP manages only the single screen specified by the \fI-display\fP option or the \fBDISPLAY\fP environment variable (by default, screen 0)\&. If the \fI-multiscreen\fP option is specified or if the \fImultiScreen\fP resource is True, \fBmwm\fP tries to manage all the screens on the display\&. .PP When \fBmwm\fP is managing multiple screens, the \fI-screens\fP option can be used to give each screen a unique resource name\&. The names are separated by blanks, for example, \fI-screens\fP scr0 scr1\&. If there are more screens than names, resources for the remaining screens will be retrieved using the first name\&. By default, the screen number is used for the screen name\&. .SS "Windows" .PP Default \fBmwm\fP window frames have distinct components with associated functions: .IP "\fITitle\ Area\fP" 10 In addition to displaying the client\&'s title, the title area is used to move the window\&. To move the window, place the pointer over the title area, press button 1 and drag the window to a new location\&. By default, a wire frame is moved during the drag to indicate the new location\&. When the button is released, the window is moved to the new location\&. .IP "\fITitle\ Bar\fP" 10 The title bar includes the title area, the minimize button, the maximize button, and the window menu button\&. In shaped windows, such as round windows, the title bar floats above the window\&. .IP "\fIMinimize\ Button\fP" 10 To turn the window into an icon, click button 1 on the minimize button (the frame box with a \fBsmall\fP square in it)\&. .IP "\fIMaximize\ Button\fP" 10 To make the window fill the screen (or enlarge to the largest size allowed by the configuration files), click button 1 on the maximize button (the frame box with a \fBlarge\fP square in it)\&. .IP "\fIWindow\ Menu\ Button\fP" 10 The window menu button is the frame box with a horizontal bar in it\&. To pull down the window menu, press button 1\&. While pressing, drag the pointer on the menu to your selection, then release the button when your selection is highlighted\&. Pressing button 3 in the title bar or resize border handles also posts the window menu\&. Alternately, you can click button 1 to pull down the menu and keep it posted; then position the pointer and select\&. You can also post the window menu by pressing or \&. Double-clicking button 1 with the pointer on the window menu button closes the window\&. .PP The following table lists the contents of the window menu\&. .SS "Default Window Menu" .TS tab(); lw(1.803823i) lw(1.062374i) lw(2.633803i). SelectionAcceleratorDescription RestoreT{ Restores the window to its size before minimizing or maximizing\&. T} MoveT{ Allows the window to be moved with keys or mouse\&. T} SizeAllows the window to be resized\&. MinimizeTurns the window into an icon\&. MaximizeMakes the window fill the screen\&. LowerT{ Moves window to bottom of window stack\&. T} CloseAlt+F4Causes client to terminate\&. .TE .IP "\fIResize\ Border\ Handles\fP" 10 To change the size of a window, move the pointer over a resize border handle (the cursor changes), press button 1, and drag the window to a new size\&. When the button is released, the window is resized\&. While dragging is being done, a rubber-band outline is displayed to indicate the new window size\&. .IP "\fIMatte\fP" 10 An optional matte decoration can be added between the client area and the window frame (see the \fImatteWidth\fP resource)\&. A \fImatte\fP is not actually part of the window frame\&. There is no functionality associated with a matte\&. .SS "Icons" .PP Icons are small graphic representations of windows\&. A window can be minimized (iconified) using the minimize button on the window frame\&. Icons provide a way to reduce clutter on the screen\&. .PP Pressing mouse button 1 when the pointer is over an icon causes the icon\&'s window menu to pop up\&. Releasing the button (press + release without moving mouse = click) causes the menu to stay posted\&. The menu contains the following selections: .SS "Icon Window Menu" .TS tab(); lw(0.913000i) lw(1.144000i) lw(3.443000i). SelectionAcceleratorDescription RestoreOpens the associated window\&. MoveT{ Allows the icon to be moved with keys\&. T} SizeInactive (not an option for icons)\&. MinimizeInactive (not an option for icons)\&. MaximizeT{ Opens the associated window and makes it fill the screen\&. T} LowerMoves icon to bottom of icon stack\&. CloseAlt+F4T{ Removes client from \fBmwm\fP management\&. T} .TE .PP Note that pressing button 3 over an icon also causes the icon\&'s window menu to pop up\&. To make a menu selection, drag the pointer over the menu and release button 3 when the desired item is highlighted\&. .PP Double-clicking button 1 on an icon invokes the \fBf\&.restore_and_raise\fP function and restores the icon\&'s associated window to its previous state\&. For example, if a maximized window is iconified, double-clicking button 1 restores it to its maximized state\&. Double-clicking button 1 on the icon box\&'s icon opens the icon box and allows access to the contained icons\&. (In general, double-clicking a mouse button is a quick way to perform a function\&.) Pressing or (the pop-up menu key) causes the icon window menu of the currently selected icon to pop up\&. .SS "Icon Box" .PP When icons begin to clutter the screen, they can be packed into an icon box\&. (To use an icon box, \fBmwm\fP must be started with the icon box configuration already set\&.) The icon box is a \fBmwm\fP window that holds client icons\&. It includes one or more scroll bars when there are more window icons than the icon box can show at the same time\&. .PP Icons in the icon box can be manipulated with the mouse\&. The following table summarizes the behavior of this interface\&. Button actions apply whenever the pointer is on any part of the icon\&. Note that double-clicking an icon in the icon box invokes the \fBf\&.restore_and_raise\fP function\&. .TS tab(); lw(0.841046i) lw(1.051308i) lw(3.607646i). ButtonActionDescription Button 1clickSelects the icon\&. Button 1double-clickT{ Normalizes (opens) the associated window\&. Raises an already open window to the top of the stack\&. T} Button 1dragMoves the icon\&. Button 3pressT{ Causes the menu for that icon to pop up\&. T} Button 3dragT{ Highlights items as the pointer moves across the menu\&. T} .TE .PP Pressing mouse button 3 when the pointer is over an icon causes the menu for that icon to pop up\&. .SS "Icon Menu for the Icon Box" .TS tab(); lw(0.885312i) lw(1.062374i) lw(3.552314i). SelectionAcceleratorDescription RestoreT{ Opens the associated window (if not already open)\&. T} MoveT{ Allows the icon to be moved with keys\&. T} SizeInactive\&. MinimizeInactive\&. MaximizeT{ Opens the associated window (if not already open) and maximizes its size\&. T} LowerInactive\&. CloseAlt+F4T{ Removes client from \fBmwm\fP management\&. T} .TE .PP To pull down the window menu for the icon box itself, press button 1 with the pointer over the menu button for the icon box\&. The window menu of the icon box differs from the window menu of a client window: The "Close" selection is replaced with the "PackIcons Shift+Alt+F7" selection\&. When selected, PackIcons packs the icons in the box to achieve neat rows with no empty slots\&. .PP You can also post the window menu by pressing , or \&. Pressing (the pop-up menu key) causes the icon window menu of the currently selected icon to pop up\&. .SS "Input Focus" .PP The \fBmwm\fP window manager supports (by default) a keyboard input focus policy of explicit selection\&. This means when a window is selected to get keyboard input, it continues to get keyboard input until the window is withdrawn from window management, another window is explicitly selected to get keyboard input, or the window is iconified\&. Several resources control the input focus\&. The client window with the keyboard input focus has the active window appearance with a visually distinct window frame\&. .PP The following tables summarize the keyboard input focus selection behavior: .TS tab(); lw(0.880482i) lw(0.844298i) lw(1.350877i) lw(2.424342i). ButtonActionObjectFunction Description Button 1pressWindow / window frameKeyboard focus selection\&. Button 1pressIconKeyboard focus selection\&. .TE .TS tab(); lw(1.394366i) lw(4.105634i). Key ActionFunction Description [Alt][Tab]T{ Move input focus to next window in window stack (available only in explicit focus mode)\&. T} [Alt][Shift][Tab]T{ Move input focus to previous window in window stack (available only in explicit focus mode)\&. T} .TE .SS "Window Stacking" .PP There are two types of window stacks: global window stacks and an application\&'s local family window stack\&. .PP The global stacking order of windows may be changed as a result of setting the keyboard input focus, iconifying a window, or performing a window manager window stacking function\&. When keyboard focus policy is explicit the default value of the \fIfocusAutoRaise\fP resource is True\&. This causes a window to be raised to the top of the stack when it receives input focus, for example, by pressing button 1 on the title bar\&. The key actions defined in the previous table will thus raise the window receiving focus to the top of the stack\&. .PP In pointer mode, the default value of \fIfocusAutoRaise\fP is False, that is, the window stacking order is not changed when a window receives keyboard input focus\&. The following key actions can be used to cycle through the global window stack\&. .TS tab(); lw(1.567982i) lw(3.932018i). Key ActionFunction Description [Alt][ESC]T{ Place top window on bottom of stack\&. T} [Alt][Shift][ESC]T{ Place bottom window on top of stack\&. T} .TE .PP By default, a window\&'s icon is placed on the bottom of the stack when the window is iconified; however, the default can be changed by the \fIlowerOnIconify\fP resource\&. .PP Transient windows (secondary windows such a dialog boxes) stay above their parent windows by default; however, an application\&'s local family stacking order may be changed to allow a transient window to be placed below its parent top-level window\&. The following arguments show the modification of the stacking order for the \fBf\&.lower\fP function\&. .IP "\fBf\&.lower\fP" 10 Lowers the transient window within the family (staying above the parent) and lowers the family in the global window stack\&. .IP "\fBf\&.lower\fP\ [ \fIwithin\fP]" 10 Lowers the transient window within the family (staying above the parent) but does not lower the family in the global window stack\&. .IP "\fBf\&.lower\fP\ [\fIfreeFamily\fP ]" 10 Lowers the window free from its family stack (below the parent), but does not lower the family in the global window stack\&. .PP The arguments \fIwithin\fP and \fIfreeFamily\fP can also be used with \fBf\&.raise\fP and \fBf\&.raise_lower\fP\&. .SS "Session Management" .PP The window manager is an X Session Management Protocol aware client\&. It responds to SaveYourself (and other associated messages) by saving the geometries of its clients to a state file\&. \fBmwm\fP can then be restarted by the XSMP session manager\&. The default location for the state file is \fB$HOME/\&.mwmclientdb\fP\&. This location can be overriden with the resource \fBsessionClientDB\fP\&. .SS "X Resources" .PP The \fBmwm\fP command is configured from its resource database\&. This database is built from the following sources\&. They are listed in order of precedence, low to high: .PP \fB/usr/X11R6/lib/X11/app-defaults/Mwm\fP .PP \fB$HOME/Mwm\fP .PP \fBRESOURCE_MANAGER\fP root window property or \fB$HOME/\&.Xdefaults\fP .PP \fBXENVIRONMENT\fP variable or \fB$HOME/\&.Xdefaults-host\fP .PP \fBmwm\fP command line options .PP The file names \fB/usr/X11R6/lib/X11/app-defaults/Mwm\fP and \fB$HOME/Mwm\fP represent customary locations for these files\&. The actual location of the system-wide class resource file may depend on the \fBXFILESEARCHPATH\fP environment variable and the current language environment\&. The actual location of the user-specific class resource file may depend on the \fBXUSERFILESEARCHPATH\fP and \fBXAPPLRESDIR\fP environment variables and the current language environment\&. .PP Entries in the resource database may refer to other resource files for specific types of resources\&. These include files that contain bitmaps, fonts, and \fBmwm\fP specific resources such as menus and behavior specifications (for example, button and key bindings)\&. .PP \fIMwm\fP is the resource class name of \fBmwm\fP and \fBmwm\fP is the default resource name used by \fBmwm\fP to look up resources\&. the \fI-screens\fP command line option specifies resource names, such as "mwm_b+w" and "mwm_color"\&.) In the following discussion of resource specification, "Mwm" and "mwm" (and the aliased \fBmwm\fP resource names) can be used interchangeably, but "mwm" takes precedence over "Mwm"\&. .PP The \fBmwm\fP command uses the following types of resources: .IP "\fBComponent Appearance Resources:\fP" 10 These resources specify appearance attributes of window manager user interface components\&. They can be applied to the appearance of window manager menus, feedback windows (for example, the window reconfiguration feedback window), client window frames, and icons\&. .IP "\fBGeneral Appearance and Behavior Resources:\fP" 10 These resources specify \fBmwm\fP appearance and behavior (for example, window management policies)\&. They are not set separately for different \fBmwm\fP user interface components\&. They apply to all screens and workspaces\&. .IP "\fBScreen Specific Appearance and Behavior Resources:\fP" 10 These resources specify the appearance and behavior of \fBmwm\fP elements that are settable on a per-screen basis\&. .IP "\fBClient Specific Resources:\fP" 10 These \fBmwm\fP resources can be set for a particular client window or class of client windows\&. They specify client-specific icon and client window frame appearance and behavior\&. .PP Resource identifiers can be either a resource name (for example, foreground) or a resource class (for example, Foreground)\&. If the value of a resource is a filename and if the filename is prefixed by "~/", then it is relative to the path contained in the \fBHOME\fP environment variable (generally the user\&'s home directory)\&. .SS "Component Appearance Resources" .PP The syntax for specifying component appearance resources that apply to window manager icons, menus, and client window frames is \fIMwm*\fP \fBresource_id\fP .PP For example, \fIMwm*foreground\fP is used to specify the foreground color for \fBmwm\fP menus, icons, client window frames, and feedback dialogs\&. .PP The syntax for specifying component appearance resources that apply to a particular \fBmwm\fP component is \fIMwm*\fP[\fImenu\fP|\fIicon\fP|\fIclient\fP|\fIfeedback\fP] \fI*\fP\fBresource_id\fP .PP If \fBmenu\fP is specified, the resource is applied only to \fBmwm\fP menus; if \fBicon\fP is specified, the resource is applied to icons; and if \fBclient\fP is specified, the resource is applied to client window frames\&. For example, \fIMwm*icon*foreground\fP is used to specify the foreground color for \fBmwm\fP icons, \fIMwm*menu*foreground\fP specifies the foreground color for \fBmwm\fP menus, and \fIMwm*client*foreground\fP is used to specify the foreground color for \fBmwm\fP client window frames\&. .PP The appearance of the title area of a client window frame (including window management buttons) can be separately configured\&. The syntax for configuring the title area of a client window frame is \fIMwm*client*title*\fP \fBresource_id\fP .PP For example, \fIMwm*client*title*foreground\fP specifies the foreground color for the title area\&. Defaults for title area resources are based on the values of the corresponding client window frame resources\&. .PP The appearance of menus can be configured based on the name of the menu\&. The syntax for specifying menu appearance by name is \fIMwm*menu*\fP \fBmenu_name\fP\fI*\fP\fBresource_id\fP .PP For example, \fIMwm*menu*my_menu*foreground\fP specifies the foreground color for the menu named \fImy_menu\fP\&. The user can also specify resources for window manager menu components, that is, the gadgets that comprise the menu\&. These may include for example, a menu title, title separator, one or more buttons, and separators\&. If a menu contains more than one instance of a class, such as multiple PushButtonGadgets, the name of the first instance is "PushButtonGadget1", the second is "PushButtonGadget2", and so on\&. The following list identifies the naming convention used for window manager menu components: .IP " \(bu" 6 Menu Title LabelGadget - "TitleName" .IP " \(bu" 6 Menu Title SeparatorGadget - "TitleSeparator" .IP " \(bu" 6 CascadeButtonGadget - "CascadeButtonGadget" .IP " \(bu" 6 PushButtonGadget - "PushButtonGadget" .IP " \(bu" 6 SeparatorGadget - "SeparatorGadget" .PP Refer to the man page for each class for a list of resources that can be specified\&. .PP The following component appearance resources that apply to all window manager parts can be specified: .SS "Component Appearance Resources - All Window Manager Parts" .TS tab(); lw(1.802521i) lw(1.571429i) lw(1.178571i) lw(0.947479i). NameClassValue TypeDefault backgroundBackgroundcolorvaries\(dg backgroundPixmapBackgroundPixmapstring\(dg\(dgvaries\(dg bottomShadowColorForegroundcolorvaries\(dg bottomShadowPixmapForegroundstring\(dg\(dgvaries\(dg fontListFontListT{ string\(dg\(dg\(dg T}"fixed" foregroundForegroundcolorvaries\(dg saveUnderSaveUnderT/FF topShadowColorBackgroundcolorvaries\(dg topShadowPixmapTopShadowPixmapstring\(dg\(dgvaries\(dg .TE .PP \(dgThe default is chosen based on the visual type of the screen\&. \(dg\(dgImage name\&. See \fBXmInstallImage\fP(3)\&. \(dg\(dg\(dgX11 X Logical Font Description .IP "\fIbackground\fP\ (class\ \fIBackground\fP)" 10 This resource specifies the background color\&. Any legal X color may be specified\&. The default value is chosen based on the visual type of the screen\&. .IP "\fIbackgroundPixmap\fP\ (class\ \fIBackgroundPixmap\fP)" 10 This resource specifies the background Pixmap of the \fBmwm\fP decoration when the window is inactive (does not have the keyboard focus)\&. The default value is chosen based on the visual type of the screen\&. .IP "\fIbottomShadowColor\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the bottom shadow color\&. This color is used for the lower and right bevels of the window manager decoration\&. Any legal X color may be specified\&. The default value is chosen based on the visual type of the screen\&. .IP "\fIbottomShadowPixmap\fP\ (class\ \fIBottomShadowPixmap\fP)" 10 This resource specifies the bottom shadow Pixmap\&. This Pixmap is used for the lower and right bevels of the window manager decoration\&. The default is chosen based on the visual type of the screen\&. .IP "\fIfontList\fP\ (class\ \fIFontList\fP)" 10 This resource specifies the font used in the window manager decoration\&. The character encoding of the font should match the character encoding of the strings that are used\&. The default is "fixed\&." .IP "\fIforeground\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the foreground color\&. The default is chosen based on the visual type of the screen\&. .IP "\fIsaveUnder\fP\ (class\ \fISaveUnder\fP)" 10 This is used to indicate whether "save unders" are used for \fBmwm\fP components\&. For this to have any effect, save unders must be implemented by the X server\&. If save unders are implemented, the X server saves the contents of windows obscured by windows that have the save under attribute set\&. If the \fIsaveUnder\fP resource is True, \fBmwm\fP will set the save under attribute on the window manager frame of any client that has it set\&. If \fIsaveUnder\fP is False, save unders will not be used on any window manager frames\&. The default value is False\&. .IP "\fItopShadowColor\fP\ (class\ \fIBackground\fP)" 10 This resource specifies the top shadow color\&. This color is used for the upper and left bevels of the window manager decoration\&. The default is chosen based on the visual type of the screen\&. .IP "topShadowPixmap\ (\ class\ \fITopShadowPixmap)\fP" 10 This resource specifies the top shadow Pixmap\&. This Pixmap is used for the upper and left bevels of the window manager decoration\&. The default is chosen based on the visual type of the screen\&. .PP The following component appearance resources that apply to frame and icons can be specified: .SS "Frame and Icon Components" .TS tab(); lw(2.072144i) lw(1.653307i) lw(0.991984i) lw(0.782565i). NameClassValue TypeDefault activeBackgroundBackgroundcolorvaries\(dg activeBackgroundPixmapBackgroundPixmapstring\(dg\(dgvaries\(dg activeBottomShadowColorForegroundcolorvaries\(dg activeBottomShadowPixmapBottomShadowPixmapstring\(dg\(dgvaries\(dg activeForegroundForegroundcolorvaries\(dg activeTopShadowColorBackgroundcolorvaries\(dg activeTopShadowPixmapTopShadowPixmapstring\(dg\(dgvaries\(dg .TE .PP \(dgThe default is chosen based on the visual type of the screen\&. \(dg\(dgSee \fBXmInstallImage\fP(3)\&. .IP "\fIactiveBackground\fP\ (class\ \fIBackground\fP)" 10 This resource specifies the background color of the \fBmwm\fP decoration when the window is active (has the keyboard focus)\&. The default is chosen based on the visual type of the screen\&. .IP "\fIactiveBackgroundPixmap\fP\ (class\ \fIActiveBackgroundPixmap\fP)" 10 This resource specifies the background Pixmap of the \fBmwm\fP decoration when the window is active (has the keyboard focus)\&. The default is chosen based on the visual type of the screen\&. .IP "\fIactiveBottomShadowColor\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the bottom shadow color of the \fBmwm\fP decoration when the window is active (has the keyboard focus)\&. The default is chosen based on the visual type of the screen\&. .IP "\fIactiveBottomShadowPixmap\fP\ (class\ \fIBottomShadowPixmap\fP)" 10 This resource specifies the bottom shadow Pixmap of the \fBmwm\fP decoration when the window is active (has the keyboard focus)\&. The default is chosen based on the visual type of the screen\&. .IP "\fIactiveForeground\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the foreground color of the \fBmwm\fP decoration when the window is active (has the keyboard focus)\&. The default is chosen based on the visual type of the screen\&. .IP "\fIactiveTopShadowColor\fP\ (class\ \fIBackground\fP)" 10 This resource specifies the top shadow color of the \fBmwm\fP decoration when the window is active (has the keyboard focus)\&. The default is chosen based on the visual type of the screen\&. .IP "\fIactiveTopShadowPixmap\fP\ (class\ \fITopShadowPixmap\fP)" 10 This resource specifies the top shadow Pixmap of the \fBmwm\fP decoration when the window is active (has the keyboard focus)\&. The default is chosen based on the visual type of the screen\&. .SS "General Appearance and Behavior Resources" .PP The syntax for specifying general appearance and behavior resources is \fIMwm*\fP\fBresource_id\fP .PP For example, \fIMwm*keyboardFocusPolicy\fP specifies the window manager policy for setting the keyboard focus to a particular client window\&. .PP The following general appearance and behavior resources can be specified: .SS "General Appearance and Behavior Resources" .TS tab(); lw(1.528376i) lw(1.592955i) lw(1.054795i) lw(1.323875i). NameClassValue TypeDefault autoKeyFocusAutoKeyFocusT/FT autoRaiseDelayAutoRaiseDelaymillisec500 bitmap-Bitmap-directory/usr/X11R6/include- DirectoryDirectory/X11/bitmaps clientAutoPlaceClientAutoPlaceT/FT colormapFocus-ColormapFocus-stringkeyboard PolicyPolicy configFileConfigFilefile$HOME/mwmrc deiconifyKeyFocusDeiconifyKeyFocusT/FT doubleClick-DoubleClick-millisec\&.multi-click TimeTimetime\(dg enableWarpenableWarpT/FT enforceKeyFocusEnforceKeyFocusT/FT frameStyleFrameStylestringrecessed iconAutoPlaceIconAutoPlaceT/FT iconClickIconClickT/FT interactivePlacementInteractivePlacementT/FT keyboardFocus-KeyboardFocus-stringexplicit PolicyPolicy lowerOnIconifyLowerOnIconifyT/FT moveThresholdMoveThresholdpixels4 multiScreenMultiScreenT/FF passButtonsPassButtonsT/FF passSelectButtonPassSelectButtonT/FT positionIsFramePositionIsFrameT/FT positionOnScreenPositionOnScreenT/FT quitTimeoutQuitTimeoutmillisec\&.1000 raiseKeyFocusRaiseKeyFocusT/FF refreshByClearingRefreshByClearingT/FT rootButtonClickRootButtonClickT/FF screensScreensstringvaries sessionClientDBSessionClientDBstring$HOME/\&.mwmclientdb showFeedbackShowFeedbackstringall startupKeyFocusStartupKeyFocusT/FT wMenuButtonClickWMenuButtonClickT/FT wMenuButtonClick2WMenuButtonClick2T/FT .TE .PP \(dgThe resource doubleClickTime is included for backward compatibility\&. Use of the Xt resource multiClickTime is preferred\&. .IP "\fIautoKeyFocus\fP\ (class\ \fIAutoKeyFocus\fP)" 10 This resource is available only when the keyboard input focus policy is explicit\&. If \fIautoKeyFocus\fP is given a value of True, then when a window with the keyboard input focus is withdrawn from window management or is iconified, the focus is set to the previous window that had the focus\&. If the value given is False, there is no automatic setting of the keyboard input focus\&. It is recommended that both \fIautoKeyFocus\fP and \fIstartupKeyFocus\fP be True to work with tear off menus\&. The default value is True\&. .IP "\fIautoRaiseDelay\fP\ (class\ \fIAutoRaiseDelay\fP)" 10 This resource is available only when the \fIfocusAutoRaise\fP resource is True and the keyboard focus policy is pointer\&. The \fIautoRaiseDelay\fP resource specifies the amount of time (in milliseconds) that \fBmwm\fP will wait before raising a window after it gets the keyboard focus\&. The default value of this resource is 500 (ms)\&. .IP "\fIbitmapDirectory\fP\ (class\ \fIBitmapDirectory\fP)" 10 This resource identifies a directory to be searched for bitmaps referenced by \fBmwm\fP resources\&. This directory is searched if a bitmap is specified without an absolute pathname\&. The default value for this resource is \fB/usr/X11R6/include/X11/bitmaps\fP\&. The directory \fB/usr/X11R6/include/X11/bitmaps\fP represents the customary locations for this directory\&. The actual location of this directory may vary on some systems\&. If the bitmap is not found in the specified directory, \fBXBMLANGPATH\fP is searched\&. .IP "\fIclientAutoPlace\fP\ (class\ \fIClientAutoPlace\fP)" 10 This resource determines the position of a window when the window has not been given a program- or user-specified position\&. With a value of True, windows are positioned with the top left corners of the frames offset horizontally and vertically\&. A value of False causes the currently configured position of the window to be used\&. In either case, \fBmwm\fP will attempt to place the windows totally on-screen\&. The default value is True\&. .IP "\fIcolormapFocusPolicy\fP\ (class\ \fIColormapFocusPolicy\fP)" 10 This resource indicates the colormap focus policy that is to be used\&. If the resource value is explicit, a colormap selection action is done on a client window to set the colormap focus to that window\&. If the value is pointer, the client window containing the pointer has the colormap focus\&. If the value is keyboard, the client window that has the keyboard input focus has the colormap focus\&. The default value for this resource is keyboard\&. .IP "\fIconfigFile\fP\ (class\ \fIConfigFile\fP)" 10 The resource value is the pathname for a \fBmwm\fP resource description file\&. If the pathname begins with "~/", \fBmwm\fP considers it to be relative to the user\&'s home directory (as specified by the \fBHOME\fP environment variable)\&. If the \fBLANG\fP environment variable is set, \fBmwm\fP looks for \fI$HOME/$LANG\fP/ \fBconfigFile\fP\&. If that file does not exist or if \fBLANG\fP is not set, \fBmwm\fP looks for \fB$HOME\fP/\fBconfigFile\fP\&. If the \fIconfigFile\fP pathname does not begin with "~/" or "/", \fBmwm\fP considers it to be relative to the current working directory\&. If the \fIconfigFile\fP resource is not specified or if that file does not exist, \fBmwm\fP uses several default paths to find a configuration file\&. The order of the search is shown below: \fB/usr/X11R6/lib/X11/$LANG/system\&.mwmrc\fP\(dg \fB/usr/X11R6/lib/X11/system\&.mwmrc\fP\(dg Paths marked with \&'\(dg\&' are implementation dependent\&. .IP "\fIdeiconifyKeyFocus\fP\ (class\ \fIDeiconifyKeyFocus\fP)" 10 This resource applies only when the keyboard input focus policy is explicit\&. If a value of True is used, a window receives the keyboard input focus when it is normalized (deiconified)\&. True is the default value\&. .IP "\fIdoubleClickTime\fP\ (class\ \fIDoubleClickTime\fP)" 10 This resource is used to set the maximum time (in ms) between the clicks (button presses) that make up a double-click\&. The use of this resource is deprecated\&. Use the Xt resource \fImultiClickTime\fP instead\&. The value of \fIdoubleClickTime\fP dynamically defaults to the value of \fImultiClickTime\fP\&. .IP "\fIenableWarp\fP\ (class\ \fIEnableWarp\fP)" 10 The default value of this resource, True, causes \fBmwm\fP to warp the pointer to the center of the selected window during keyboard-controlled resize and move operations\&. Setting the value to False causes \fBmwm\fP to leave the pointer at its original place on the screen, unless the user explicitly moves it with the cursor keys or pointing device\&. .IP "\fIenforceKeyFocus\fP\ (class\ \fIEnforceKeyFocus\fP)" 10 If this resource is given a value of True, the keyboard input focus is always explicitly set to selected windows even if there is an indication that they are "globally active" input windows\&. (An example of a globally active window is a scroll bar that can be operated without setting the focus to that client\&.) If the resource is False, the keyboard input focus is not explicitly set to globally active windows\&. The default value is True\&. .IP "\fIframeStyle\fP\ (class\ \fIframeStyle\fP)" 10 If this resource is given a value of "slab", the the window manager frame is drawn such that the client area appears to be at the same height as the top of the window frame\&. If the resource is set to "recessed", the window frame is drawn such that the client area appears lower than the top of the window frame\&. The default value is "recessed"\&. .IP "\fIiconAutoPlace\fP\ (class\ \fIIconAutoPlace\fP)" 10 This resource indicates whether the window manager arranges icons in a particular area of the screen or places each icon where the window was when it was iconified\&. The value True indicates that icons are arranged in a particular area of the screen, determined by the \fIiconPlacement\fP resource\&. The value False indicates that an icon is placed at the location of the window when it is iconified\&. The default is True\&. .IP "\fIiconClick\fP\ (class\ \fIIconClick\fP)" 10 When this resource is given the value of True, the system menu is posted and left posted when an icon is clicked\&. The default value is True\&. .IP "\fIinteractivePlacement\fP\ (class\ \fIInteractivePlacement\fP)" 10 This resource controls the initial placement of new windows on the screen\&. If the value is True, the pointer shape changes before a new window is placed on the screen to indicate to the user that a position should be selected for the upper-left hand corner of the window\&. If the value is False, windows are placed according to the initial window configuration attributes\&. The default value of this resource is False\&. .IP "\fIkeyboardFocusPolicy\fP\ (class\ \fIKeyboardFocusPolicy\fP)" 10 If set to pointer, the keyboard focus policy is to have the keyboard focus set to the client window that contains the pointer (the pointer could also be in the client window decoration that \fBmwm\fP adds)\&. If set to explicit, the policy is to have the keyboard focus set to a client window when the user presses button 1 with the pointer on the client window or any part of the associated \fBmwm\fP decoration\&. The default value for this resource is explicit\&. .IP "\fIlowerOnIconify\fP\ (class\ \fILowerOnIconify\fP)" 10 If this resource is given the default value of True, a window\&'s icon appears on the bottom of the window stack when the window is minimized (iconified)\&. A value of False places the icon in the stacking order at the same place as its associated window\&. The default value of this resource is True\&. .IP "\fImoveThreshold\fP\ (class\ \fIMoveThreshold\fP)" 10 This resource is used to control the sensitivity of dragging operations that move windows and icons\&. The value of this resource is the number of pixels that the locator is moved with a button down before the move operation is initiated\&. This is used to prevent window/icon movement when you click or double-click and there is unintentional pointer movement with the button down\&. The default value of this resource is 4 (pixels)\&. .IP "\fImultiScreen\fP\ (class\ \fIMultiScreen\fP)" 10 This resource, if True, causes \fBmwm\fP to manage all the screens on the display\&. If False, \fBmwm\fP manages only a single screen\&. The default value is False\&. .IP "\fIpassButtons\fP\ (class\ \fIPassButtons\fP)" 10 This resource indicates whether or not button press events are passed to clients after they are used to do a window manager function in the client context\&. If the resource value is False, the button press is not passed to the client\&. If the value is True, the button press is passed to the client window\&. The window manager function is done in either case\&. The default value for this resource is False\&. .IP "\fIpassSelectButton\fP\ (class\ \fIPassSelectButton\fP)" 10 This resource indicates whether or not to pass the select button press events to clients after they are used to do a window manager function in the client context\&. If the resource value is False, then the button press will not be passed to the client\&. If the value is True, the button press is passed to the client window\&. The window manager function is done in either case\&. The default value for this resource is True\&. .IP "\fIpositionIsFrame\fP\ (class\ \fIPositionIsFrame\fP)" 10 This resource indicates how client window position information (from the \fIWM_NORMAL_HINTS\fP property and from configuration requests) is to be interpreted\&. If the resource value is True, the information is interpreted as the position of the \fBmwm\fP client window frame\&. If the value is False, it is interpreted as being the position of the client area of the window\&. The default value of this resource is True\&. .IP "\fIpositionOnScreen\fP\ (class\ \fIPositionOnScreen\fP)" 10 This resource is used to indicate that windows should initially be placed (if possible) so that they are not clipped by the edge of the screen (if the resource value is True)\&. If a window is larger than the size of the screen, at least the upper-left corner of the window is on-screen\&. If the resource value is False, windows are placed in the requested position even if totally off-screen\&. The default value of this resource is True\&. .IP "\fIquitTimeout\fP\ (class\ \fIQuitTimeout\fP)" 10 This resource specifies the amount of time (in milliseconds) that \fBmwm\fP will wait for a client to update the \fIWM_COMMAND\fP property after \fBmwm\fP has sent the \fBWM_SAVE_YOURSELF\fP message\&. The default value of this resource is 1000 (ms)\&. (Refer to the \fBf\&.kill\fP function description for additional information\&.) .IP "\fIraiseKeyFocus\fP\ (class\ \fIRaiseKeyFocus\fP)" 10 This resource is available only when the keyboard input focus policy is explicit\&. When set to True, this resource specifies that a window raised by means of the \fBf\&.normalize_and_raise\fP function also receives the input focus\&. The default value of this resource is False\&. .IP "\fIrefreshByClearing\fP\ (class\ \fIRefreshByClearing\fP)" 10 This resource determines the mechanism used to refresh a window (or the screen) when the \fBf\&.refresh_win\fP (\fBf\&.refresh\fP) function is executed\&. When set to True, an XClearArea is performed over the window for \fBf\&.refresh_win\fP\&. When set to False, a covering window is created and destroyed over the top of the window to be refreshed\&. If the function is \fBf\&.refresh\fP and this resource is set to True, then an XClearArea is performed over every window on the screen\&. If the resource is set to False, then one large window covering the entire screen is created and destroyed\&. The default value of this resource is True\&. .IP "\fIrootButtonClick\fP\ (class\ \fIRootButtonClick\fP)" 10 The \fIrootButtonClick\fP resource controls whether the a click on the root window will post the root menu in a "sticky" mode\&. If this resource is set to True, a button click on the root window will post the menu bound to the button down event for that button in a "sticky" fashion\&. If this resource is set to False, then the same button click would only cause the menu to flash as it would be unposted once the button up event is seen\&. The criterion used to determine if it is a button click is if the pointer doesn\&'t move between the button down and button up events\&. The default value for this resource is True\&. .IP "\fIscreens\fP\ (class\ \fIScreens\fP)" 10 This resource specifies the resource names to use for the screens managed by \fBmwm\fP\&. If \fBmwm\fP is managing a single screen, only the first name in the list is used\&. If \fBmwm\fP is managing multiple screens, the names are assigned to the screens in order, starting with screen 0\&. Screen 0 gets the first name, screen 1 the second name, and so on\&. The default screen names are 0, 1, and so on\&. .IP "\fIsessionClientDB\fP\ (class\ \fISessionClientDB\fP)" 10 This resource identifies a file name to use as a root when saving state at the request of an XSMP session manager\&. When the session is saved, the window manager will then reuse the file name by automatically incrementing a suffix\&. .IP "\fIshowFeedback\fP\ (class\ \fIShowFeedback\fP)" 10 This resource controls whether or not feedback windows or confirmation dialogs are displayed\&. A feedback window shows a client window\&'s initial placement and shows position and size during move and resize operations\&. Confirmation dialogs can be displayed for certain operations\&. The value for this resource is a list of names of the feedback options to be enabled or disabled; the names must be separated by a space\&. If an option is preceded by a minus sign, that option is excluded from the list\&. The \fBsign\fP of the first item in the list determines the initial set of options\&. If the sign of the first option is minus, \fBmwm\fP assumes all options are present and starts subtracting from that set\&. If the sign of the first decoration is plus (or not specified), \fBmwm\fP starts with no options and builds up a list from the resource\&. .PP The names of the feedback options are shown below: .TS tab(); lw(1.097588i) lw(4.402412i). NameDescription allShow all feedback (Default value)\&. behaviorConfirm behavior switch\&. killConfirm on receipt of KILL signal\&. moveShow position during move\&. noneShow no feedback\&. placementT{ Show position and size during initial placement\&. T} quitConfirm quitting \fBmwm\fP\&. resizeShow size during resize\&. restartConfirm \fBmwm\fP restart\&. .TE .PP The following command line illustrates the syntax for showFeedback: .PP .nf \f(CW\fIMwm*showFeedback: placement resize behavior restart\fP\fR .fi .PP .PP This resource specification provides feedback for initial client placement and resize, and enables the dialog boxes to confirm the restart and set behavior functions\&. It disables feedback for the move function\&. The default value for this resource is all\&. .IP "\fIstartupKeyFocus\fP\ (class\ \fIStartupKeyFocus\fP)" 10 This resource is available only when the keyboard input focus policy is explicit\&. When given the default value of True, a window gets the keyboard input focus when the window is mapped (that is, initially managed by the window manager)\&. It is recommended that both \fIautoKeyFocus\fP and \fIstartupKeyFocus\fP be True to work with tear off menus\&. The default value is True\&. .IP "\fIwMenuButtonClick\fP\ (class\ \fIWMenuButtonClick\fP)" 10 This resource indicates whether a click of the mouse when the pointer is over the window menu button posts and leaves posted the window menu\&. If the value given this resource is True, the menu remains posted\&. True is the default value for this resource\&. .IP "\fIwMenuButtonClick2\fP\ (class\ \fIWMenuButtonClick2\fP)" 10 When this resource is given the default value of True, a double-click action on the window menu button does an \fIf\&.kill function\fP\&. .SS "Screen Specific Appearance and Behavior Resources" .PP The syntax for specifying screen specific resources is \fIMwm*\fP \fBscreen_name\fP\fI*\fP\fBresource_id\fP For example, \fIMwm*1*keyBindings\fP specifies the key bindings to use for screen "1"\&. .SS "Screen Specific Resources" .TS tab(); lw(1.768627i) lw(1.790196i) lw(0.927451i) lw(1.013725i). NameClassValue TypeDefault buttonBindingsButtonBindingsstringDefaultButtonBindings cleanTextCleanTextT/FT fadeNormalIconFadeNormalIconT/FF feedbackGeometryFeedbackGeometrystringcenter on screen frameBorderWidthFrameBorderWidthpixelsvaries iconBoxGeometryIconBoxGeometrystring6x1+0-0 iconBoxNameIconBoxNamestringiconbox iconBoxSBDisplayPolicyIconBoxSBDisplayPolicystringall iconBoxTitleIconBoxTitleXmStringIcons iconDecorationIconDecorationstringvaries iconImageMaximumIconImageMaximumwxh48x48 iconImageMinimumIconImageMinimumwxh16x16 iconPlacementIconPlacementstringleft bottom iconPlacementMarginIconPlacementMarginpixelsvaries keyBindingsKeyBindingsstringDefaultKeyBindings limitResizeLimitResizeT/FT maximumMaximumSizeMaximumMaximumSizewxh (pixels)2X screen w&h moveOpaqueMoveOpaqueT/FF resizeBorderWidthResizeBorderWidthpixelsvaries resizeCursorsResizeCursorsT/FT transientDecorationTransientDecorationstringmenu title transientFunctionsTransientFunctionsstringT{ -minimize-maximize T} useIconBoxUseIconBoxT/FF .TE .IP "\fIbuttonBindings\fP\ (class\ \fIButtonBindings\fP)" 10 This resource identifies the set of button bindings for window management functions\&. The named set of button bindings is specified in the \fBmwm\fP resource description file\&. These button bindings are \fBmerged\fP with the built-in default bindings\&. The default value for this resource is "DefaultButtonBindings"\&. .IP "\fIcleanText\fP\ (class\ \fICleanText\fP)" 10 This resource controls the display of window manager text in the client title and feedback windows\&. If the default value of True is used, the text is drawn with a clear (no stipple) background\&. This makes text easier to read on monochrome systems where a backgroundPixmap is specified\&. Only the stippling in the area immediately around the text is cleared\&. If False, the text is drawn directly on top of the existing background\&. .IP "\fIfadeNormalIcon\fP\ (class\ \fIFadeNormalIcon\fP)" 10 If this resource is given a value of True, an icon is grayed out whenever it has been normalized (its window has been opened)\&. The default value is False\&. .IP "\fIfeedbackGeometry\fP\ (class\ \fIFeedbackGeometry\fP)" 10 This resource sets the position of the move and resize feedback window\&. If this resource is not specified, the default is to place the feedback window at the center of the screen\&. The value of the resource is a standard window geometry string with the following syntax: [\fI=\fP]{ \fI+-\fP}\fBxoffset\fP{\fI+-\fP} \fByoffset\fP] .IP "\fIframeBorderWidth\fP\ (class\ \fIFrameBorderWidth\fP)" 10 This resource specifies the width (in pixels) of a client window frame border without resize handles\&. The border width includes the 3-D shadows\&. The default value is based on the size and resolution of the screen\&. .IP "\fIiconBoxGeometry\fP\ (class\ \fIIconBoxGeometry\fP)" 10 This resource indicates the initial position and size of the icon box\&. The value of the resource is a standard window geometry string with the following syntax: [\fI=\fP][\fBwidth\fP \fIx\fP\fBheight\fP][{\fI+-\fP}\fBxoffset\fP {\fI+-\fP}\fByoffset\fP] If the offsets are not provided, the iconPlacement policy is used to determine the initial placement\&. The units for width and height are columns and rows\&. The actual screen size of the icon box window depends on the iconImageMaximum (size) and \fIiconDecoration\fP resources\&. The default value for size is (6 * iconWidth + padding) wide by (1 * iconHeight + padding) high\&. The default value of the location is +0 -0\&. .IP "\fIiconBoxName\fP\ (class\ \fIIconBoxName\fP)" 10 This resource specifies the name that is used to look up icon box resources\&. The default name is iconbox\&. .IP "\fIiconBoxSBDisplayPolicy\fP\ (class\ \fIIconBoxSBDisplayPolicy\fP)" 10 This resource specifies the scroll bar display policy of the window manager in the icon box\&. The resource has three possible values: all, vertical, and horizontal\&. The default value, "all", causes both vertical and horizontal scroll bars always to appear\&. The value "vertical" causes a single vertical scroll bar to appear in the icon box and sets the orientation of the icon box to horizontal (regardless of the iconBoxGeometry specification)\&. The value "horizontal" causes a single horizontal scroll bar to appear in the icon box and sets the orientation of the icon box to vertical (regardless of the iconBoxGeometry specification)\&. .IP "\fIiconBoxTitle\fP\ (class\ \fIIconBoxTitle\fP)" 10 This resource specifies the name that is used in the title area of the icon box frame\&. The default value is Icons\&. .IP "\fIiconDecoration\fP\ (class\ \fIIconDecoration\fP)" 10 This resource specifies the general icon decoration\&. The resource value is label (only the label part is displayed) or image (only the image part is displayed) or label image (both the label and image parts are displayed)\&. A value of activelabel can also be specified to get a label (not truncated to the width of the icon) when the icon is selected\&. The default icon decoration for icon box icons is that each icon has a label part and an image part (label image)\&. The default icon decoration for stand alone icons is that each icon has an active label part, a label part, and an image part (activelabel label image)\&. .IP "\fIiconImageMaximum\fP\ (class\ \fIIconImageMaximum\fP)" 10 This resource specifies the maximum size of the icon image\&. The resource value is \fBwidth\fP\fIx\fP \fBheight\fP (for example, 64x64)\&. The maximum supported size is 128x128\&. The default value of this resource is 50x50\&. .IP "\fIiconImageMinimum\fP\ (class\ \fIIconImageMinimum\fP)" 10 This resource specifies the minimum size of the icon image\&. The resource value is \fBwidth\fP\fIx\fP \fBheight\fP (for example, 32x50)\&. The minimum supported size is 16x16\&. The default value of this resource is 16x16\&. .IP "\fIiconPlacement\fP\ (class\ \fIIconPlacement\fP)" 10 This resource specifies the icon placement scheme to be used\&. The resource value has the following syntax: .IP "" 10 \fBprimary_layout secondary_layout [tight]\fP .PP The layout values are one of the following: .TS tab(); lw(0.796053i) lw(4.703947i). ValueDescription topLay the icons out top to bottom\&. bottomLay the icons out bottom to top\&. leftLay the icons out left to right\&. rightLay the icons out right to left\&. .TE .PP A horizontal (vertical) layout value should not be used for both the \fBprimary_layout\fP and the \fBsecondary_layout\fP (for example, don\&'t use top for the \fBprimary_layout\fP and bottom for the \fBsecondary_layout\fP)\&. .PP The \fBprimary_layout\fP indicates whether, when an icon placement is done, the icon is placed in a row or a column and the direction of placement\&. The \fBsecondary_layout\fP indicates where to place new rows or columns\&. For example, top right indicates that icons should be placed top to bottom on the screen and that columns should be added from right to left on the screen\&. .PP The default placement is left bottom (icons are placed left to right on the screen, with the first row on the bottom of the screen, and new rows added from the bottom of the screen to the top of the screen)\&. A \fBtight\fP value places icons with zero spacing in between icons\&. This value is useful for aesthetic reasons, as well as X-terminals with small screens\&. .IP "\fIiconPlacementMargin\fP\ (class\ \fIIconPlacementMargin\fP)" 10 This resource sets the distance between the edge of the screen and the icons that are placed along the edge of the screen\&. The value should be greater than or equal to 0\&. A default value (see below) is used if the value specified is invalid\&. The default value for this resource is equal to the space between icons as they are placed on the screen (this space is based on maximizing the number of icons in each row and column)\&. .IP "\fIkeyBindings\fP\ (class\ \fIKeyBindings\fP)" 10 This resource identifies the set of key bindings for window management functions\&. If specified, these key bindings \fBreplace\fP the built-in default bindings\&. The named set of key bindings is specified in \fBmwm\fP resource description file\&. The default value for this resource is "DefaultKeyBindings"\&. .IP "\fIlimitResize\fP\ (class\ \fILimitResize\fP)" 10 If this resource is True, the user is not allowed to resize a window to greater than the maximum size\&. The default value for this resource is True\&. .IP "\fImaximumMaximumSize\fP\ (class\ \fIMaximumMaximumSize\fP)" 10 This resource is used to limit the maximum size of a client window as set by the user or client\&. The resource value is \fBwidth\fP\fIx\fP\fBheight\fP (for example, 1024x1024) where the width and height are in pixels\&. The default value of this resource is twice the screen width and height\&. .IP "\fImoveOpaque\fP\ (class\ \fIMoveOpaque\fP)" 10 This resource controls whether the actual window is moved or a rectangular outline of the window is moved\&. A default value of False displays a rectangular outline on moves\&. .IP "\fIresizeBorderWidth\fP\ (class\ \fIResizeBorderWidth\fP)" 10 This resource specifies the width (in pixels) of a client window frame border with resize handles\&. The specified border width includes the 3-D shadows\&. The default value is based on the size and resolution of the screen\&. .IP "\fIresizeCursors\fP\ (class\ \fIResizeCursors\fP)" 10 This is used to indicate whether the resize cursors are always displayed when the pointer is in the window size border\&. If True, the cursors are shown, otherwise the window manager cursor is shown\&. The default value is True\&. .IP "\fItransientDecoration\fP\ (class\ \fITransientDecoration\fP)" 10 This controls the amount of decoration that \fBmwm\fP puts on transient windows\&. The decoration specification is exactly the same as for the \fIclientDecoration\fP (client specific) resource\&. Transient windows are identified by the \fIWM_TRANSIENT_FOR\fP property, which is added by the client to indicate a relatively temporary window\&. The default value for this resource is menu title (that is, transient windows have frame borders and a titlebar with a window menu button)\&. .IP "" 10 An application can also specify which decorations \fBmwm\fP should apply to its windows\&. If it does so, \fBmwm\fP applies only those decorations indicated by both the application and the \fItransientDecoration\fP resource\&. Otherwise, \fBmwm\fP applies the decorations indicated by the \fItransientDecoration\fP resource\&. For more information see the description of \fBXmNmwmDecorations\fP on the \fBVendorShell\fP(3) reference page\&. .IP "\fItransientFunctions\fP\ (class\ \fITransientFunctions\fP)" 10 This resource is used to indicate which window management functions are applicable (or not applicable) to transient windows\&. The function specification is exactly the same as for the \fIclientFunctions\fP (client specific) resource\&. The default value for this resource is -minimize -maximize\&. .IP "" 10 An application can also specify which functions \fBmwm\fP should apply to its windows\&. If it does so, \fBmwm\fP applies only those functions indicated by both the application and the \fItransientFunctions\fP resource\&. Otherwise, \fBmwm\fP applies the functions indicated by the \fItransientFunctions\fP resource\&. For more information see the description of \fBXmNmwmFunctions\fP on the \fBVendorShell\fP(3) reference page\&. .IP "\fIuseIconBox\fP\ (class\ \fIUseIconBox\fP)" 10 If this resource is given a value of True, icons are placed in an icon box\&. When an icon box is not used, the icons are placed on the root window (default value)\&. .SS "Client Specific Resources" .PP The syntax for specifying client specific resources is .PP \fIMwm*\fP\fBclient_name_or_class\fP \fI*\fP\fBresource_id\fP .PP For example, \fIMwm*mterm*windowMenu\fP is used to specify the window menu to be used with mterm clients\&. The syntax for specifying client specific resources for all classes of clients is .PP \fIMwm*\fP\fBresource_id\fP .PP Specific client specifications take precedence over the specifications for all clients\&. For example, \fIMwm*windowMenu\fP is used to specify the window menu to be used for all classes of clients that don\&'t have a window menu specified\&. .PP The syntax for specifying resource values for windows that have an unknown name and class (that is, windows that do not have a \fBWM_CLASS\fP property associated with them) is .PP \fIMwm*defaults*\fP\fBresource_id\fP .PP For example, \fIMwm*defaults*iconImage\fP is used to specify the icon image to be used for windows that have an unknown name and class\&. .PP The following client specific resources can be specified: .SS "Client Specific Resources" .TS tab(); lw(1.999018i) lw(1.458743i) lw(0.918468i) lw(1.123772i). NameClassValue TypeDefault clientDecorationClientDecorationstringall\&. clientFunctionsClientFunctionsstringall\&. focusAutoRaiseFocusAutoRaiseT/Fvaries iconImageIconImagepathname(image) iconImage-Backgroundcoloricon background Background iconImageBottom-Foregroundcoloricon ShadowColorbottom shadow iconImageBottom-BottomShadow-coloricon bottom ShadowPixmapPixmapshadow pixmap iconImageForegroundForegroundcolorvaries iconImageTopShadowColorBackgroundcoloricon top shadow color iconImageTop-TopShadowPixmapcoloricon top ShadowPixmapshadow pixmap matteBackgroundBackgroundcolorbackground matteBottom-Foregroundcolorbottom ShadowColorshadow color matteBottom-BottomShadow-colorbottom ShadowPixmapPixmapshadow pixmap matteForegroundForegroundcolorforeground matteTopShadowColorBackgroundcolortop shadow color matteTopShadowPixmapTopShadowPixmapcolortop shadow pixmap matteWidthMatteWidthpixels0 maximumClientSizeMaximumClientSizewxh vertical horizontalfill the screen useClientIconUseClientIconT/FT usePPositionUsePPositionstringnonzero windowMenuWindowMenustringDefaultWindowMenu .TE .IP "\fIclientDecoration\fP\ (class\ \fIClientDecoration\fP)" 10 This resource controls the amount of window frame decoration\&. The resource is specified as a list of decorations to specify their inclusion in the frame\&. If a decoration is preceded by a minus sign, that decoration is excluded from the frame\&. The \fBsign\fP of the first item in the list determines the initial amount of decoration\&. If the sign of the first decoration is minus, \fBmwm\fP assumes all decorations are present and starts subtracting from that set\&. If the sign of the first decoration is plus (or not specified), then \fBmwm\fP starts with no decoration and builds up a list from the resource\&. .IP "" 10 An application can also specify which decorations \fBmwm\fP should apply to its windows\&. If it does so, \fBmwm\fP applies only those decorations indicated by both the application and the \fIclientDecoration\fP resource\&. Otherwise, \fBmwm\fP applies the decorations indicated by the \fIclientDecoration\fP resource\&. For more information see the description of \fBXmNmwmDecorations\fP on the \fBVendorShell\fP(3) reference page\&. .TS tab(); lw(0.989035i) lw(4.510965i). NameDescription allT{ Include all decorations (default value)\&. T} borderWindow border\&. maximizeT{ Maximize button (includes title bar)\&. T} minimizeT{ Minimize button (includes title bar)\&. T} noneNo decorations\&. resizehT{ Border resize handles (includes border)\&. T} menuT{ Window menu button (includes title bar)\&. T} titleTitle bar (includes border)\&. .TE .PP Examples: \fIMwm*XClock\&.clientDecoration: -resizeh -maximize\fP This removes the resize handles and maximize button from XClock windows\&. \fIMwm*XClock\&.clientDecoration: menu minimize border\fP This does the same thing as above\&. Note that either \fImenu\fP or \fIminimize\fP implies \fItitle\fP\&. .IP "\fIclientFunctions\fP\ (class\ \fIClientFunctions\fP)" 10 This resource is used to indicate which \fBmwm\fP functions are applicable (or not applicable) to the client window\&. The value for the resource is a list of functions\&. If the first function in the list has a minus sign in front of it, then \fBmwm\fP starts with all functions and subtracts from that set\&. If the first function in the list has a plus sign in front of it, then \fBmwm\fP starts with no functions and builds up a list\&. Each function in the list must be preceded by the appropriate plus or minus sign and separated from the next function by a space\&. .IP "" 10 An application can also specify which functions \fBmwm\fP should apply to its windows\&. If it does so, \fBmwm\fP applies only those functions indicated by both the application and the \fIclientFunctions\fP resource\&. Otherwise, \fBmwm\fP applies the functions indicated by the \fIclientFunctions\fP resource\&. For more information see the description of \fBXmNmwmFunctions\fP on the \fBVendorShell\fP(3) reference page\&. .PP The following table lists the functions available for this resource: .TS tab(); lw(0.928728i) lw(4.571272i). NameDescription allT{ Include all functions (default value)\&. T} noneNo functions\&. resizef\&.resize\(dg\&. movef\&.move\(dg\&. minimizef\&.minimize\(dg\&. maximizef\&.maximize\(dg\&. closef\&.kill\(dg\&. .TE .PP \(dgSee \fBmwmrc\fP(4)\&. .IP "\fIfocusAutoRaise\fP\ (class\ \fIFocusAutoRaise\fP)" 10 When the value of this resource is True, clients are raised when they get the keyboard input focus\&. If the value is False, the stacking of windows on the display is not changed when a window gets the keyboard input focus\&. The default value is True when the keyboardFocusPolicy is explicit and False when the keyboardFocusPolicy is pointer\&. .IP "\fIiconImage\fP\ (class\ \fIIconImage\fP)" 10 This resource can be used to specify an icon image for a client (for example, "Mwm*myclock*iconImage")\&. The resource value is a pathname for a pixmap or bitmap file\&. The value of the (client specific) \fIuseClientIcon\fP resource is used to determine whether or not user supplied icon images are used instead of client supplied icon images\&. The default value is to display a built-in window manager icon image\&. .IP "\fIiconImageBackground\fP\ (class\ \fIBackground\fP)" 10 This resource specifies the background color of the icon image that is displayed in the image part of an icon\&. The default value of this resource is the icon background color (that is, specified by "Mwm*background or Mwm*icon*background)\&. .IP "\fIiconImageBottomShadowColor\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the bottom shadow color of the icon image that is displayed in the image part of an icon\&. The default value of this resource is the icon bottom shadow color (that is, specified by Mwm*icon*bottomShadowColor)\&. .IP "\fIiconImageBottomShadowPixmap\fP\ (class\ \fIBottomShadowPixmap\fP)" 10 This resource specifies the bottom shadow Pixmap of the icon image that is displayed in the image part of an icon\&. The default value of this resource is the icon bottom shadow Pixmap (that is, specified by Mwm*icon*bottomShadowPixmap)\&. .IP "\fIiconImageForeground\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the foreground color of the icon image that is displayed in the image part of an icon\&. The default value of this resource varies depending on the icon background\&. .IP "\fIiconImageTopShadowColor\fP\ (class\ \fIBackground\fP)" 10 This resource specifies the top shadow color of the icon image that is displayed in the image part of an icon\&. The default value of this resource is the icon top shadow color (that is, specified by Mwm*icon*topShadowColor)\&. .IP "\fIiconImageTopShadowPixmap\fP\ (class\ \fITopShadowPixmap\fP)" 10 This resource specifies the top shadow Pixmap of the icon image that is displayed in the image part of an icon\&. The default value of this resource is the icon top shadow pixmap (that is, specified by Mwm*icon*topShadowPixmap)\&. .IP "\fImatteBackground\fP\ \ (class\ \fIBackground\fP)" 10 This resource specifies the background color of the matte, when \fImatteWidth\fP is positive\&. The default value of this resource is the client background color (that is, specified by "Mwm*background or Mwm*client*background)\&. .IP "\fImatteBottomShadowColor\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the bottom shadow color of the matte, when \fImatteWidth\fP is positive\&. The default value of this resource is the client bottom shadow color (that is, specified by Mwm*bottomShadowColor or Mwm*client*bottomShadowColor)\&. .IP "\fImatteBottomShadowPixmap\fP\ (class\ \fIBottomShadowPixmap\fP)" 10 This resource specifies the bottom shadow Pixmap of the matte, when \fImatteWidth\fP is positive\&. The default value of this resource is the client bottom shadow pixmap (that is, specified by Mwm*bottomShadowPixmap or Mwm*client*bottomShadowPixmap)\&. .IP "\fImatteForeground\fP\ (class\ \fIForeground\fP)" 10 This resource specifies the foreground color of the matte, when \fImatteWidth\fP is positive\&. The default value of this resource is the client foreground color (that is, specified by Mwm*foreground or Mwm*client*foreground)\&. .IP "\fImatteTopShadowColor\fP\ (class\ \fIBackground\fP)" 10 This resource specifies the top shadow color of the matte, when \fImatteWidth\fP is positive\&. The default value of this resource is the client top shadow color (that is, specified by Mwm*topShadowColor or Mwm*client*topShadowColor)\&. .IP "\fImatteTopShadowPixmap\fP\ (class\ \fITopShadowPixmap\fP)" 10 This resource specifies the top shadow pixmap of the matte, when \fImatteWidth\fP is positive\&. The default value of this resource is the client top shadow pixmap (that is, specified by "Mwm*topShadowPixmap or Mwm*client*topShadowPixmap)\&. .IP "\fImatteWidth\fP\ (class\ \fIMatteWidth\fP)" 10 This resource specifies the width of the optional matte\&. The default value is 0, which effectively disables the matte\&. .IP "\fImaximumClientSize\fP\ (class\ \fIMaximumClientSize\fP)" 10 This resource is either a size specification or a direction that indicates how a client window is to be maximized\&. The resource value can be specified as a size specification \fBwidth\fP\fIx\fP\fBheight\fP\&. The width and height are interpreted in the units that the client uses (for example, for terminal emulators this is generally characters)\&. Alternately, "vertical" or "horizontal" can be specified to indicate the direction in which the client maximizes\&. .IP "" 10 If this resource is not specified, the maximum size from the \fIWM_NORMAL_HINTS\fP property is used if set\&. Otherwise the default value is the size where the client window with window management borders fills the screen\&. When the maximum client size is not determined by the \fImaximumClientSize\fP resource, the \fImaximumMaximumSize\fP resource value is used as a constraint on the maximum size\&. .IP "\fIuseClientIcon\fP\ (class\ \fIUseClientIcon\fP)" 10 If the value given for this resource is True, a client-supplied icon image takes precedence over a user-supplied icon image\&. The default value is True, giving the client-supplied icon image higher precedence than the user-supplied icon image\&. .IP "\fIusePPosition\fP\ (class\ \fIUsePPosition\fP)" 10 This resource specifies whether Mwm honors program specified position \fBPPosition\fP specified in the \fIWM_NORMAL_HINTS\fP property in the absence of an user specified position\&. Setting this resource to on, causes \fBmwm\fP to always honor program specified position\&. Setting this resource to off, causes \fBmwm\fP to always ignore program specified position\&. Setting this resource to the default value of nonzero cause \fBmwm\fP to honor program specified position other than (0,0)\&. .IP "\fIwindowMenu\fP\ (class\ \fIWindowMenu\fP)" 10 This resource indicates the name of the menu pane that is posted when the window menu is popped up (usually by pressing button 1 on the window menu button on the client window frame)\&. Menu panes are specified in the \fBmwm\fP resource description file\&. Window menus can be customized on a client class basis by creating custom menus in your \fBmwmrc\fP file (see \fBmwmrc\fP(4) and specifying resources to activate the custom menus\&. The resources have the form \fIMwm*\fP \fBclient_name_or_class\fP\fI*windowMenu\fP\&. The default value of this resource is DefaultWindowMenu\&. .SS "Resource Description File" .PP The \fBmwm\fP resource description file is a supplementary resource file that contains resource descriptions that are referred to by entries in the resource manager property (see \fBxrdb\fP(1) and the defaults files (\fB\&.Xdefaults\fP, \fBapp-defaults/Mwm\fP )\&. It contains descriptions of resources that are to be used by \fBmwm\fP, and that cannot be easily encoded in the defaults files (a bitmap file is an analogous type of resource description file)\&. A particular \fBmwm\fP resource description file can be selected using the \fIconfigFile\fP resource\&. .PP The following types of resources can be described in the \fBmwm\fP resource description file: .IP "\fIButtons\fP" 10 Window manager functions can be bound (associated) with button events\&. .IP "\fIKeys\fP" 10 Window manager functions can be bound (associated) with key press events\&. .IP "\fIMenus\fP" 10 Menu panes can be used for the window menu and other menus posted with key bindings and button bindings\&. .IP "" 10 The \fBmwm\fP resource description file is described in \fBmwmrc\fP(4)\&. .SS "Environment" .PP The \fBmwm\fP window manager uses the environment variable \fBHOME\fP specifying the user\&'s home directory\&. .PP The \fBmwm\fP window manager uses the environment variable \fBLANG\fP specifying the user\&'s choice of language for the \fBmwm\fP message catalog and the \fBmwm\fP resource description file\&. .PP The \fBmwm\fP window uses the environment variable \fBXFILESEARCHPATH\fP, \fBXUSERFILESEARCHPATH\fP, \fBXAPPLRESDIR\fP, \fBXENVIRONMENT\fP, \fBLANG\fP, and \fBHOME\fP in determining search paths for resource defaults files\&. The \fBmwm\fP window manager may also us \fBXBMLANGPATH\fP to search for bitmap files\&. .PP The \fBmwm\fP window manager reads the \fB$HOME/\&.motifbind\fP file if it exists to install a virtual key bindings property on the root window\&. For more information on the content of the \fB\&.motifbind\fP file, see .PP The \fBmwm\fP window manager uses the environment variable \fBMWMSHELL\fP (or \fBSHELL\fP, \fIif\fP \fBMWMSHELL\fP is not set), specifying the shell to use when executing commands via the \fBf\&.exec\fP function\&. .SS "Files" .PP \fB/usr/X11R6/lib/X11/$LANG/system\&.mwmrc\fP .PP \fB/usr/X11R6/lib/X11/system\&.mwmrc\fP .PP \fB/usr/X11R6/lib/X11/app-defaults/Mwm\fP .PP \fB$HOME/Mwm\fP .PP \fB$HOME/$LANG/\&.mwmrc\fP .PP \fB$HOME/\&.mwmrc\fP .SS "RELATED INFORMATION" .PP \fBVendorShell\fP(3), \fBVirtualBindings\fP(3), \fBX\fP(1), \fBXmInstallImage\fP(3), \fBxrdb\fP(1)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:15 motif-2.3.8/doc/man/man1/Makefile.in0000644000175000017500000004017513211512767014020 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/man/man1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = \ mwm.1 \ uil.1 \ xmbind.1 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man/man1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man/man1/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man1 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/doc/man/man1/xmbind.10000644000175000017500000000342112672140200013274 00000000000000'\" t ...\" xmbind.sgm /main/8 1996/09/08 21:43:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "xmbind" "user cmd" .SH "NAME" \fBxmbind\fP \(em Configures virtual key bindings .iX "xmbind" .SH "SYNOPSIS" .PP \fBxmbind\fP [\fIoptions\fP ] [\fIfile\fP ] .SH "DESCRIPTION" .PP \fBxmbind\fP is an X Window System client that configures the virtual key bindings for Motif applications\&. This action is performed by \fBmwm\fP at its startup, so the \fBxmbind\fP client is only needed when \fBmwm\fP is not in use, or when you want to change bindings without restarting \fBmwm\fP\&. If a file is specified, its contents are used as the virtual key bindings\&. If a file is not specified, the file \fB\&.motifbind\fP in the user\&'s home directory is used\&. If this file is not found, \fBxmbind\fP loads the default virtual key bindings, as described in \fBVirtualBindings\fP(3)\&. .SS "Options" .IP "\fB-display\fP" 10 This option specifies the display to use; see X(1)\&. .SH "RELATED" .PP \fBVirtualBindings\fP(3) and \fBX\fP(1)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man1/uil.10000644000175000017500000000676112672140200012616 00000000000000'\" t ...\" uil.sgm /main/12 1996/09/08 21:43:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "uil" "user cmd" .SH "NAME" \fBuil\fP \(em The user interface language compiler .iX "user interface language" .iX "user interface language" "compiler" .iX "uil" .iX "uil" "compiler" .SH "SYNOPSIS" .PP \fBuil\fP [\fIoptions\fP ] [\fIfile\fP] .SH "DESCRIPTION" .PP The \fBuil\fP command invokes the UIL compiler\&. The User Interface Language (UIL) is a specification language for describing the initial state of a user interface for a Motif application\&. The specification describes the objects (menus, dialog boxes, labels, push buttons, and so on) used in the interface and specifies the routines to be called when the interface changes state as a result of user interaction\&. .IP "\fIfile\fP" 10 Specifies the file to be compiled through the UIL compiler\&. .IP "\fIoptions\fP" 10 Specifies one or more of the following options: .RS .IP "\fB-I\fP\fIpathname\fP" 10 This option causes the compiler to look for include files in the directory specified if the include files have not been found in the paths that already were searched\&. Specify this option followed by a pathname, with no intervening spaces\&. .IP "\fB-m\fP" 10 Machine code is listed\&. This directs the compiler to place in the listing file a description of the records that it added to the User Interface Database (UID)\&. This helps you isolate errors\&. The default is no machine code\&. .IP "\fB-o\ \fP\fIfile\fP" 10 .iX "user interface database" .iX "uid file" .IP "" 10 Directs the compiler to produce a UID\&. By default, UIL creates a UID with the name \fBa\&.uid\fP\&. The file specifies the filename for the UID\&. No UID is produced if the compiler issues any diagnostics categorized as error or severe\&. UIDs are portable only across same-size machine architectures\&. .IP "\fB-s\fP" 10 Directs the compiler to set the locale before compiling any files\&. The locale is set in an implementation-dependent manner\&. On ANSI C-based systems, the locale is usually set by calling setlocale(\fBLC_ALL, ""\fP)\&. If this option is not specified, the compiler does not set the locale\&. .IP "\fB-v\ \fP\fIfile\fP" 10 Directs the compiler to generate a listing\&. The file specifies the filename for the listing\&. If the \fB-v\fP option is not present, no listing is generated by the compiler\&. The default is no listing\&. .IP "\fB-w\fP" 10 Specifies that the compiler suppress all warning and informational messages\&. If this option is not present, all messages are generated, regardless of the severity\&. .IP "\fB-wmd\ \fP\fIfile\fP" 10 Specifies a binary widget meta-language description file to be used in place of the default WML description\&. .RE .SH "RELATED INFORMATION" .PP \fBX\fP(1) and \fBUil\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man1/Makefile.am0000644000175000017500000000016012672140200013762 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = \ mwm.1 \ uil.1 \ xmbind.1 motif-2.3.8/doc/man/man4/0000755000175000017500000000000013211513006012012 500000000000000motif-2.3.8/doc/man/man4/Makefile.in0000644000175000017500000004014413211512767014017 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/man/man4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man4dir = $(mandir)/man4 am__installdirs = "$(DESTDIR)$(man4dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = \ mwmrc.4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man/man4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man/man4/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man4: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man4dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man4dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man4dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.4[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^4][0-9a-z]*$$,4,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man4dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man4dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man4dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man4dir)" || exit $$?; }; \ done; } uninstall-man4: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man4dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.4[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^4][0-9a-z]*$$,4,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man4dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man4dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man4 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man4 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man4 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man4 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/doc/man/man4/mwmrc.40000644000175000017500000007400512672140200013154 00000000000000'\" t ...\" mwmrc.sgm /main/8 1996/09/08 21:43:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "mwmrc" "special file" .SH "NAME" \fBmwmrc\fP \(em the Motif Window Manager Resource Description File .SH "DESCRIPTION" .PP The \fBmwmrc\fP file is a supplementary resource file that controls much of the behavior of the Motif window manager \fBmwm\fP\&. It contains descriptions of resources that cannot easily be written using standard X Window System, Version 11 resource syntax\&. The resource description file contains entries that are referred to by X resources in defaults files (for example, \fB/usr/X11R6/lib/X11/app-defaults/Mwm\fP) or in the \fBRESOURCE_MANAGER\fP property on the root window\&. For example, the resource description file enables you to specify different types of window menus; however, an X resource is used to specify which of these window menus \fBmwm\fP should use for a particular window\&. .SS "Location" .PP The window manager searches for one of the following resource description files, where \fI$LANG\fP is the value of the language environment on a per-user basis: .PP .nf \f(CW$HOME/$LANG/\&.mwmrc $HOME/\&.mwmrc /usr/X11R6/lib/X11/$LANG/system\&.mwmrc /usr/X11R6/lib/X11/system\&.mwmrc\fR .fi .PP .PP The first file found is the first used\&. If no file is found, a set of built-in specifications is used\&. A particular resource description file can be selected using the \fIconfigFile\fP resource\&. The following shows how a different resource description file can be specified from the command line: .PP .nf \f(CW/usr/X11R6/bin/X11/mwm -xrm "mwm*configFile: mymwmrc"\fR .fi .PP .SS "Resource Types" .PP The following types of resources can be described in the mwm resource description file: .IP "\fBButtons\fP" 10 Window manager functions can be bound (associated) with button events\&. .IP "\fBKeys\fP" 10 Window manager functions can be bound (associated) with key press events\&. .IP "\fBMenus\fP" 10 Menu panes can be used for the window menu and other menus posted with key bindings and button bindings\&. .SH "MWM RESOURCE DESCRIPTION FILE SYNTAX" .PP The \fBmwm\fP resource description file is a standard text file that contains items of information separated by blanks, tabs, and new lines characters\&. Blank lines are ignored\&. Items or characters can be quoted to avoid special interpretation (for example, the comment character can be quoted to prevent it from being interpreted as the comment character)\&. A quoted item can be contained in double quotes (\fB" "\fP)\&. Single characters can be quoted by preceding them by the back-slash character (\fB\\\fP)\&. If a line ends with a back-slash, the next line is considered a continuation of that line\&. All text from an unquoted \fB#\fP to the end of the line is regarded as a comment and is not interpreted as part of a resource description\&. If \fB!\fP is the first character in a line, the line is regarded as a comment\&. .SS "Window Manager Functions" .PP Window manager functions can be accessed with button and key bindings, and with window manager menus\&. Functions are indicated as part of the specifications for button and key binding sets, and menu panes\&. The function specification has the following syntax: .PP .nf \f(CW\fBfunction\fP = \fBfunction_name\fP [\fBfunction_args\fP] \fBfunction_name\fP = \fBwindow manager function\fP \fBfunction_args\fP = {\fBquoted_item\fP | \fBunquoted_item\fP}\fR .fi .PP .PP The following functions are supported\&. If a function is specified that isn\&'t one of the supported functions then it is interpreted by \fBmwm\fP as \fBf\&.nop\fP\&. .IP "\fBf\&.beep\fP" 10 This function causes a beep\&. .IP "\fBf\&.circle_down\fP [ \fIicon\fP | \fIwindow\fP]" 10 This function causes the window or icon that is on the top of the window stack to be put on the bottom of the window stack (so that it is no longer obscuring any other window or icon)\&. This function affects only those windows and icons that are obscuring other windows and icons, or that are obscured by other windows and icons\&. Secondary windows (that is, transient windows) are restacked with their associated primary window\&. Secondary windows always stay on top of the associated primary window and there can be no other primary windows between the secondary windows and their primary window\&. If an \fIicon\fP function argument is specified, then the function applies only to icons\&. If a \fIwindow\fP function argument is specified then the function applies only to windows\&. .IP "\fBf\&.circle_up\fP [ \fIicon\fP | \fIwindow\fP]" 10 This function raises the window or icon on the bottom of the window stack (so that it is not obscured by any other windows)\&. This function affects only those windows and icons that are obscuring other windows and icons, or that are obscured by other windows and icons\&. Secondary windows (that is, transient windows) are restacked with their associated primary window\&. If an \fIicon\fP function argument is specified then the function applies only to icons\&. If an \fIwindow\fP function argument is specified then the function applies only to windows\&. .IP "\fBf\&.exec\fP \fBcommand\fP (or \fI!\fP \fBcommand\fP)" 10 This function causes \fIcommand\fP to be executed (using the value of the \fI$MWMSHELL\fP or \fI$SHELL\fP environment variable if set; otherwise, \fB/bin/sh\fP )\&. The \fI!\fP notation can be used in place of the \fBf\&.exec\fP function name\&. .IP "\fBf\&.focus_color\fP" 10 This function sets the colormap focus to a client window\&. If this function is done in a root context, then the default colormap (setup by the X Window System for the screen where \fBmwm\fP is running) is installed and there is no specific client window colormap focus\&. This function is treated as \fBf\&.nop\fP if \fIcolormapFocusPolicy\fP is not explicit\&. .IP "\fBf\&.focus_key\fP" 10 This function sets the keyboard input focus to a client window or icon\&. This function is treated as \fBf\&.nop\fP if \fIkeyboardFocusPolicy\fP is not explicit or the function is executed in a root context\&. .IP "\fBf\&.kill\fP" 10 This function is used to close application windows\&. The actual processing that occurs depends on the protocols that the application observes\&. The application lists the protocols it observes in the \fBWM_PROTOCOLS\fP property on its top level window\&. If the application observes the \fBWM_DELETE_WINDOW\fP protocol, it is sent a message that requests the window be deleted\&. If the application observes both \fBWM_DELETE_WINDOW\fP and \fBWM_SAVE_YOURSELF\fP, it is sent one message requesting the window be deleted and another message advising it to save its state\&. If the application observes only the \fBWM_SAVE_YOURSELF\fPprotocol \fI,\fP it is sent a message advising it to save its state\&. After a delay (specified by the resource \fIquitTimeout\fP), the application\&'s connection to the X server is terminated\&. If the application observes neither of these protocols, its connection to the X server is terminated\&. .IP "\fBf\&.lower\fP\ [\fI-\fP \fBclient\fP | \fIwithin\fP\ | \fIfreeFamily\fP]" 10 This function lowers a primary window to the bottom of the global window stack (where it obscures no other window) and lowers the secondary window (transient window or dialog box) within the client family\&. The arguments to this function are mutually exclusive\&. The \fIclient\fP argument indicates the name or class of a client to lower\&. The name or class of a client appears in the \fBWM_CLASS\fP property on the client\&'s top-level window\&. If the \fIclient\fP argument is not specified, the context that the function was invoked in indicates the window or icon to lower\&. Specifying \fIwithin\fP lowers the secondary window within the family (staying above the parent) but does not lower the client family in the global window stack\&. Specifying \fIfreeFamily\fP lowers the window to the bottom of the global windows stack from its local family stack\&. .IP "\fBf\&.maximize\fP" 10 This function causes a client window to be displayed with its maximum size\&. Refer to the \fImaximumClientSize\fP, \fImaximumMaximumSize\fP, and \fIlimitResize\fP resources in \fBmwm\fP(1)\&. .IP "\fBf\&.menu\fP \fImenu_name\fP" 10 This function associates a cascading (pull-right) menu with a menu pane entry or a menu with a button or key binding\&. The \fImenu_name\fP function argument identifies the menu to be used\&. .IP "\fBf\&.minimize\fP" 10 This function causes a client window to be minimized (iconified)\&. When a window is minimized with no icon box in use, and if the \fIlowerOnIconify\fP resource has the value True (the default), the icon is placed on the bottom of the window stack (such that it obscures no other window)\&. If an icon box is used, then the client\&'s icon changes to its iconified form inside the icon box\&. Secondary windows (that is, transient windows) are minimized with their associated primary window\&. There is only one icon for a primary window and all its secondary windows\&. .IP "\fBf\&.move\fP" 10 This function initiates an interactive move of a client window\&. .IP "\fBf\&.next_cmap\fP" 10 This function installs the next colormap in the list of colormaps for the window with the colormap focus\&. .IP "\fBf\&.next_key\fP [ \fIicon\fP | \fIwindow\fP | \fItransient\fP]" 10 This function sets the keyboard input focus to the next window/icon in the set of windows/icons managed by the window manager (the ordering of this set is based on the stacking of windows on the screen)\&. This function is treated as \fBf\&.nop\fP if \fBkeyboardFocusPolicy\fP is not explicit\&. The keyboard input focus is only moved to windows that do not have an associated secondary window that is application modal\&. If the \fItransient\fP argument is specified, then transient (secondary) windows are traversed (otherwise, if only \fIwindow\fP is specified, traversal is done only to the last focused window in a transient group)\&. If an \fIicon\fP function argument is specified, then the function applies only to icons\&. If a \fIwindow\fP function argument is specified, then the function applies only to windows\&. .IP "\fBf\&.nop\fP" 10 This function does nothing\&. .IP "\fBf\&.normalize\fP" 10 This function causes a client window to be displayed with its normal size\&. Secondary windows (that is, transient windows) are placed in their normal state along with their associated primary window\&. .IP "\fBf\&.normalize_and_raise\fP" 10 This function causes a client window to be displayed with its normal size and raised to the top of the window stack\&. Secondary windows (that is, transient windows) are placed in their normal state along with their associated primary window\&. .IP "\fBf\&.pack_icons\fP" 10 This function is used to relayout icons (based on the layout policy being used) on the root window or in the icon box\&. In general this causes icons to be "packed" into the icon grid\&. .IP "\fBf\&.pass_keys\fP" 10 This function is used to enable/disable (toggle) processing of key bindings for window manager functions\&. When it disables key binding processing all keys are passed on to the window with the keyboard input focus and no window manager functions are invoked\&. If the \fBf\&.pass_keys\fP function is invoked with a key binding to disable key binding processing the same key binding can be used to enable key binding processing\&. .IP "\fBf\&.post_wmenu\fP" 10 This function is used to post the window menu\&. If a key is used to post the window menu and a window menu button is present, the window menu is automatically placed with its top-left corner at the bottom-left corner of the window menu button for the client window\&. If no window menu button is present, the window menu is placed at the top-left corner of the client window\&. .IP "\fBf\&.prev_cmap\fP" 10 This function installs the previous colormap in the list of colormaps for the window with the colormap focus\&. .IP "\fBf\&.prev_key\fP [ \fIicon\fP | \fIwindow\fP | \fItransient\fP]" 10 This function sets the keyboard input focus to the previous window/icon in the set of windows/icons managed by the window manager (the ordering of this set is based on the stacking of windows on the screen)\&. This function is treated as \fBf\&.nop\fP if \fIkeyboardFocusPolicy\fP is not explicit\&. The keyboard input focus is only moved to windows that do not have an associated secondary window that is application modal\&. If the \fItransient\fP argument is specified, then transient (secondary) windows are traversed (otherwise, if only \fIwindow\fP is specified, traversal is done only to the last focused window in a transient group)\&. If an \fIicon\fP function argument is specified then the function applies only to icons\&. If an \fIwindow\fP function argument is specified then the function applies only to windows\&. .IP "\fBf\&.quit_mwm\fP" 10 This function terminates mwm (but NOT the X window system)\&. .IP "\fBf\&.raise\fP\ [\fI-\fP\fIclient\fP | \fIwithin\fP | \fIfreeFamily\fP]" 10 This function raises a primary window to the top of the global window stack (where it is obscured by no other window) and raises the secondary window (transient window or dialog box) within the client family\&. The arguments to this function are mutually exclusive\&. The \fIclient\fP argument indicates the name or class of a client to lower\&. If the \fIclient\fP is not specified, the context that the function was invoked in indicates the window or icon to lower\&. Specifying \fIwithin\fP raises the secondary window within the family but does not raise the client family in the global window stack\&. Specifying \fIfreeFamily\fP raises the window to the top of its local family stack and raises the family to the top of the global window stack\&. .IP "\fBf\&.raise_lower\fP\ [ \fIwithin\fP | \fIfreeFamily\fP]" 10 This function raises a primary window to the top of the global window stack if it is partially obscured by another window; otherwise, it lowers the window to the bottom of the window stack\&. The arguments to this function are mutually exclusive\&. Specifying \fIwithin\fP raises a secondary window within the family (staying above the parent window), if it is partially obscured by another window in the application\&'s family; otherwise, it lowers the window to the bottom of the family stack\&. It has no effect on the global window stacking order\&. Specifying \fIfreeFamily\fP raises the window to the top of its local family stack, if obscured by another window, and raises the family to the top of the global window stack; otherwise, it lowers the window to the bottom of its local family stack and lowers the family to the bottom of the global window stack\&. .IP "\fBf\&.refresh\fP" 10 This function causes all windows to be redrawn\&. .IP "\fBf\&.refresh_win\fP" 10 This function causes a client window to be redrawn\&. .IP "\fBf\&.resize\fP" 10 This function initiates an interactive resize of a client window\&. .IP "\fBf\&.restore\fP" 10 This function restores the previous state of an icon\&'s associated window\&. If a maximized window is iconified, then \fBf\&.restore\fP restores it to its maximized state\&. If a normal window is iconified, then \fBf\&.restore\fP restores it to its normalized state\&. .IP "\fBf\&.restore_and_raise\fP" 10 This function restores the previous state of an icon\&'s associated window and raises the window to the top of the window stack\&. If a maximized window is iconified, then \fBf\&.restore_and_raise\fP restores it to its maximized state and raises it to the top of the window stack\&. If a normal window is iconified, then \fBf\&.restore_and_raise\fP restores it to its normalized state and raises it to the top of the window stack\&. .IP "\fBf\&.restart\fP" 10 This function causes mwm to be restarted (effectively terminated and re-executed)\&. Restart is necessary for \fBmwm\fP to incorporate changes in both the \fBmwmrc\fP file and X resources\&. .IP "\fBf\&.screen\fP\ [ \fInext\fP | \fIprev\fP | \fIback\fP | \fIscreen_number\fP]" 10 This function causes the pointer to be warp to a specific screen number or to the \fInext\fP, \fIprevious\fP, or last visited (\fIback\fP) screen\&. The arguments to this function are mutually exclusive\&. The \fIscreen_number\fP argument indicates the screen number that the pointer is to be warped\&. Screens are numbered starting from screen 0\&. Specifying \fInext\fP cause the pointer to warp to the next managed screen (skipping over any unmanaged screens)\&. Specifying \fIprev\fP cause the pointer to warp to the previous managed screen (skipping over any unmanaged screens)\&. Specifying \fIback\fP cause the pointer to warp to the last visited screen\&. .IP "\fBf\&.send_msg\fP \fImessage_number\fP" 10 This function sends an \fBXClientMessageEvent\fR of type \fB_MOTIF_WM_MESSAGES\fP with \fImessage_type\fP set to \fImessage_number\fP\&. The client message is sent only if \fImessage_number\fP is included in the client\&'s \fB_MOTIF_WM_MESSAGES\fP property\&. A menu item label is grayed out if the menu item is used to do \fBf\&.send_msg\fP of a message that is not included in the client\&'s \fB_MOTIF_WM_MESSAGES\fP property\&. .IP "\fBf\&.separator\fP" 10 This function causes a menu separator to be put in the menu pane at the specified location (the label is ignored)\&. .IP "\fBf\&.set_behavior\fP" 10 This function causes the window manager to restart with the default behavior (if a custom behavior is configured) or a custom behavior (if a default behavior is configured)\&. By default this is bound to \fIShift\ Ctrl\ Alt\ !\fP\&. .IP "\fBf\&.title\fP" 10 This function inserts a title in the menu pane at the specified location\&. .IP "\fBf\&.version\fP" 10 This function causes the window manager to display its release version in a dialog box\&. .SS "Function Constraints" .PP Each function may be constrained as to which resource types can specify the function (for example, menu pane) and also what context the function can be used in (for example, the function is done to the selected client window)\&. Function contexts are: .IP "\fIroot\fP" 10 No client window or icon has been selected as an object for the function\&. .IP "\fIwindow\fP" 10 A client window has been selected as an object for the function\&. This includes the window\&'s title bar and frame\&. Some functions are applied only when the window is in its normalized state (for example, \fBf\&.maximize\fP) or its maximized state (for example, \fBf\&.normalize\fP)\&. .IP "\fIicon\fP" 10 An icon has been selected as an object for the function\&. .PP If a function is specified in a type of resource where it is not supported or is invoked in a context that does not apply then the function is treated as \fBf\&.nop\fP\&. The following table indicates the resource types and function contexts in which window manager functions apply\&. .PP .TS tab(); lw(2.289841i) lw(1.851594i) lw(1.358566i). FunctionContextsResources _ \fBf\&.beep\fProot,icon,windowbutton,key,menu \fBf\&.circle_down\fProot,icon,windowbutton,key,menu \fBf\&.circle_up\fProot,icon,windowbutton,key,menu \fBf\&.exec\fProot,icon,windowbutton,key,menu \fBf\&.focus_color\fProot,icon,windowbutton,key,menu \fBf\&.focus_key\fProot,icon,windowbutton,key,menu \fBf\&.kill\fPicon,windowbutton,key,menu \fBf\&.lower\fProot,icon,windowbutton,key,menu \fBf\&.maximize\fPicon,window(normal)button,key,menu \fBf\&.menu\fProot,icon,windowbutton,key,menu \fBf\&.minimize\fPwindowbutton,key,menu \fBf\&.move\fPicon,windowbutton,key,menu \fBf\&.next_cmap\fProot,icon,windowbutton,key,menu \fBf\&.next_key\fProot,icon,windowbutton,key,menu \fBf\&.nop\fProot,icon,windowbutton,key,menu \fBf\&.normalize\fPicon,window(maximized)button,key,menu \fBf\&.normalize_and_raise\fPicon,windowbutton,key,menu \fBf\&.pack_icons\fProot,icon,windowbutton,key,menu \fBf\&.pass_keys\fProot,icon,windowbutton,key,menu \fBf\&.post_wmenu\fProot,icon,windowbutton,key \fBf\&.prev_cmap\fProot,icon,windowbutton,key,menu \fBf\&.prev_key\fProot,icon,windowbutton,key,menu \fBf\&.quit_mwm\fProotbutton,key,menu (root only) \fBf\&.raise\fProot,icon,windowbutton,key,menu \fBf\&.raise_lower\fPicon,windowbutton,key,menu \fBf\&.refresh\fProot,icon,windowbutton,key,menu \fBf\&.refresh_win\fPwindowbutton,key,menu \fBf\&.resize\fPwindowbutton,key,menu \fBf\&.restart\fProotbutton,key,menu (root only) \fBf\&.restore\fPicon,windowbutton,key,menu \fBf\&.restore_and_raise\fPicon,windowbutton,key,menu \fBf\&.screen\fProot,icon,windowbutton,key,menu \fBf\&.send_msg\fPicon,windowbutton,key,menu \fBf\&.separator\fProot,icon,windowmenu \fBf\&.set_behavior\fProot,icon,windowbutton,key,menu \fBf\&.title\fProot,icon,windowmenu \fBf\&.version\fProot,icon,windowbutton,key,menu .TE .SH "WINDOW MANAGER EVENT SPECIFICATION" .PP Events are indicated as part of the specifications for button and key binding sets, and menu panes\&. Button events have the following syntax: .PP .nf \f(CW\fBbutton\fP =~[\fBmodifier_list\fP ]\fI<\fP\fBbutton_event_name\fP \fI>\fP \fBmodifier_list\fP =~\fBmodifier_name\fP { \fBmodifier_name\fP}\fR .fi .PP .PP The following table indicates the values that can be used for \fBmodifier_name\fP\&. Note that [Alt] and [Meta] can be used interchangably on some hardware\&. .PP .TS tab(); lw(1.097588i) lw(4.402412i). ModifierDescription _ CtrlControl Key ShiftShift Key AltAlt Key MetaMeta Key Mod1Modifier1 Mod2Modifier2 Mod3Modifier3 Mod4Modifier4 Mod5Modifier5 .TE .PP Locking modifiers are ignored when processing button and key bindings\&. The following table lists keys that are interpreted as locking modifiers\&. The X server may map some of these symbols to the Mod1 - Mod5 modifier keys\&. These keys may or may not be available on your hardware: Key Symbol Caps Lock Shift Lock Kana Lock Num Lock Scroll Lock The following table indicates the values that can be used for \fBbutton_event_name\fP\&. .PP .TS tab(); lw(1.290570i) lw(4.209430i). ButtonDescription _ Btn1DownButton 1 Press Btn1UpButton 1 Release Btn1ClickButton 1 Press and Release Btn1Click2Button 1 Double Click Btn2DownButton 2 Press Btn2UpButton 2 Release Btn2ClickButton 2 Press and Release Btn2Click2Button 2 Double Click Btn3DownButton 3 Press Btn3UpButton 3 Release Btn3ClickButton 3 Press and Release Btn3Click2Button 3 Double Click Btn4DownButton 4 Press Btn4UpButton 4 Release Btn4ClickButton 4 Press and Release Btn4Click2Button 4 Double Click Btn5DownButton 5 Press Btn5UpButton 5 Release Btn5ClickButton 5 Press and Release Btn5Click2Button 5 Double Click .TE .PP Key events that are used by the window manager for menu mnemonics and for binding to window manager functions are single key presses; key releases are ignored\&. Key events have the following syntax: .PP .nf \f(CW\fBkey\fP =~[\fBmodifier_list\fP] \fB\fP\fBkey_name\fP \fBmodifier_list\fP =~\fBmodifier_name\fP { \fBmodifier_name\fP}\fR .fi .PP .PP All modifiers specified are interpreted as being exclusive (this means that only the specified modifiers can be present when the key event occurs)\&. Modifiers for keys are the same as those that apply to buttons\&. The \fBkey_name\fP is an X11 keysym name\&. Keysym names can be found in the \fBkeysymdef\&.h\fP file (remove the \fBXK_\fP prefix)\&. .SH "BUTTON BINDINGS" .PP The \fBbuttonBindings\fP resource value is the name of a set of button bindings that are used to configure window manager behavior\&. A window manager function can be done when a button press occurs with the pointer over a framed client window, an icon or the root window\&. The context for indicating where the button press applies is also the context for invoking the window manager function when the button press is done (significant for functions that are context sensitive)\&. The button binding syntax is .PP .nf \f(CW\fIButtons\fP \fBbindings_set_name\fP \fI{\fP \fBbutton\fP \fBcontext\fP \fBfunction\fP \fBbutton\fP \fBcontext\fP \fBfunction\fP \&.\&.\&. \fBbutton\fP \fBcontext\fP \fBfunction\fP \fI}\fP\fR .fi .PP .PP The syntax for the \fBcontext\fP specification is: \fBcontext\fP = \fBobject\fP[\fI|\fP \fBcontext\fP] \fBobject\fP = \fIroot\fP | \fIicon\fP | \fIwindow\fP | \fItitle\fP | \fIframe\fP | \fIborder\fP | \fIapp\fP The context specification indicates where the pointer must be for the button binding to be effective\&. For example, a context of \fIwindow\fP indicates that the pointer must be over a client window or window management frame for the button binding to be effective\&. The \fIframe\fP context is for the window management frame around a client window (including the border and titlebar), the \fIborder\fP context is for the border part of the window management frame (not including the titlebar), the \fItitle\fP context is for the title area of the window management frame, and the \fIapp\fP context is for the application window (not including the window management frame)\&. If an \fBf\&.nop\fP function is specified for a button binding, the button binding is not done\&. .SH "KEY BINDINGS" .PP The \fBkeyBindings\fP resource value is the name of a set of key bindings that are used to configure window manager behavior\&. A window manager function can be done when a particular key is pressed\&. The context in which the key binding applies is indicated in the key binding specification\&. The valid contexts are the same as those that apply to button bindings\&. The key binding syntax is: .PP .nf \f(CW\fIKeys\fP \fBbindings_set_name\fP \fI{\fP \fBkey\fP \fBcontext\fP \fBfunction\fP \fBkey\fP \fBcontext\fP \fBfunction\fP \&.\&.\&. \fBkey\fP \fBcontext\fP \fBfunction\fP \fI}\fP\fR .fi .PP .PP If an \fBf\&.nop\fP function is specified for a key binding, the key binding is not done\&. If an \fBf\&.post_wmenu\fP or \fBf\&.menu\fP function is bound to a key, \fBmwm\fP automatically uses the same key for removing the menu from the screen after it has been popped up\&. The \fBcontext\fP specification syntax is the same as for button bindings with one addition\&. The context \fIifkey\fP may be specified for binding keys that may not be available on all displays\&. If the key is not available and if \fIifkey\fP is in the context, then reporting of the error message to the error log is suppressed\&. This feature is useful for networked, heterogeneous environments\&. For key bindings, the \fIframe\fP, \fItitle\fP, \fIborder\fP, and \fIapp\fP contexts are equivalent to the \fIwindow\fP context\&. The context for a key event is the window or icon that has the keyboard input focus (\fIroot\fP if no window or icon has the keyboard input focus)\&. .SH "MENU PANES" .PP Menus can be popped up using the \fBf\&.post_wmenu\fP and \fBf\&.menu\fP window manager functions\&. The context for window manager functions that are done from a menu is \fIroot\fP, \fIicon\fP or \fIwindow\fP depending on how the menu was popped up\&. In the case of the \fIwindow\fP menu or menus popped up with a key binding, the location of the keyboard input focus indicates the context\&. For menus popped up using a button binding, the context of the button binding is the context of the menu\&. The menu pane specification syntax is: .PP .nf \f(CW\fIMenu\fP \fBmenu_name\fP \fI{\fP \fBlabel\fP [\fBmnemonic\fP] [\fBaccelerator\fP ] \fBfunction\fP \fBlabel\fP [\fBmnemonic\fP] [\fBaccelerator\fP ] \fBfunction\fP \&.\&.\&. \fBlabel\fP [\fBmnemonic\fP] [\fBaccelerator\fP ] \fBfunction\fP \fI}\fP\fR .fi .PP .PP Each line in the \fIMenu\fP specification identifies the label for a menu item and the function to be done if the menu item is selected\&. Optionally a menu button mnemonic and a menu button keyboard accelerator may be specified\&. Mnemonics are functional only when the menu is posted and keyboard traversal applies\&. The \fBlabel\fP may be a string or a bitmap file\&. The label specification has the following syntax: .PP .nf \f(CW\fBlabel\fP = \fBtext\fP | \fBbitmap_file\fP \fBbitmap_file\fP = \fI@\fP\fBfile_name\fP \fBtext\fP = \fBquoted_item\fP | \fBunquoted_item\fP\fR .fi .PP .PP The string encoding for labels must be compatible with the menu font that is used\&. Labels are greyed out for menu items that do the \fBf\&.nop\fP function or an invalid function or a function that doesn\&'t apply in the current context\&. A \fBmnemonic\fP specification has the following syntax: .PP .nf \f(CW\fBmnemonic\fP = \fI_\fP \fBcharacter\fP\fR .fi .PP .PP The first matching \fBcharacter\fP in the label is underlined\&. If there is no matching \fBcharacter\fP in the label, no mnemonic is registered with the window manager for that label\&. Although the \fBcharacter\fP must exactly match a character in the label, the mnemonic does not execute if any modifier (such as Shift) is pressed with the character key\&. The \fBaccelerator\fP specification is a key event specification with the same syntax as is used for key bindings to window manager functions\&. .SH "INCLUDING FILES" .PP You may include other files into your mwmrc file by using the \fIinclude\fP construct\&. For example, .PP .nf \f(CWINCLUDE { /usr/local/shared/mwm\&.menus /home/kmt/personal/my\&.bindings }\fR .fi .PP .PP causes the files named to be read in and interpreted in order as an additional part of the mwmrc file\&. \fIInclude\fP is a top-level construct\&. It cannot be nested inside another construct\&. .SH "WARNINGS" .PP Errors that occur during the processing of the resource description file are recorded in: \fB$HOME/\&.mwm/errorlog\fP\&. Be sure to check this file if the appearance or behavior of \fBmwm\fP is not what you expect\&. .SH "FILES" .PP .nf \fB$HOME/$LANG/\&.mwmrc $HOME/\&.mwmrc /usr/X11R6/lib/X11/$LANG/system\&.mwmrc /usr/X11R6/lib/X11/system\&.mwmrc\fP .fi .SH "RELATED INFORMATION" .PP \fBmwm\fP(1), \fBX\fP(1)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man4/Makefile.am0000644000175000017500000000012712672140200013770 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = \ mwmrc.4 motif-2.3.8/doc/man/man5/0000755000175000017500000000000013211513006012013 500000000000000motif-2.3.8/doc/man/man5/WML.50000644000175000017500000004045412672140200012471 00000000000000'\" t ...\" WML.sgm /main/10 1996/09/08 21:23:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "WML" "file formats" .SH "NAME" \fBWML\fP \(em The widget meta-language file format for creating uil compilers .iX "widget meta-language" .iX "WML" .SH "DESCRIPTION" .PP The widget meta-language facility (WML) is used to generate the components of the user interface language (UIL) compiler that can change depending on the widget set\&. Using WML you can add support in UIL for new widgets to the Motif widget set or for a totally new widget set\&. .SS "File" .PP WML files are ASCII files that you can modify with any standard text editor\&. They are accessed in the \fBtools/wml\fP directory by WML\&. By convention WML files have the suffix \fB\&.wml\fP\&. The Motif widget set is described in the \fBmotif\&.wml\fP file\&. This is also the default WML file when using the WML facility\&. .PP When adding new widgets or changing widget characteristics, you should start with a copy of the \fBmotif\&.wml\fP file\&. If you are creating a new widget set for use with UIL, you should start from scratch\&. In either case the \fBmotif\&.wml\fP file is a good example of WML syntax, and you should familiarize yourself with it before writing your own WML file\&. .PP WML files have a simple syntax, similar in structure to UIL\&. It is made up of the following elements: .IP " \(bu" 6 Comments .IP " \(bu" 6 Data Type Definitions .IP " \(bu" 6 Character Set Definitions .IP " \(bu" 6 Enumeration Set Definitions .IP " \(bu" 6 Control List Definitions .IP " \(bu" 6 Class Definitions .IP " \(bu" 6 Child Definitions .IP " \(bu" 6 Resource Definitions .PP You can use space, tabs, or newlines anywhere in the syntax, as long as you do not split up keywords or strings, except that comments end at a newline\&. The order of elements is not important to the syntax\&. .PP This description uses the following additional conventions to describe the syntax of the widget meta-language: .IP "[\ \ ]" 10 Indicates optional elements\&. .IP "\&.\&.\&." 10 Indicates where an element of syntax can be repeated\&. .IP "|" 10 Indicates a choice among multiple items\&. .SS "Comments" .PP You can include comments in the WML file\&. Comments have the following syntax: .PP .nf [any\&.element]!any\&.comment .fi .PP Comments begin with an exclamation point and extend to the end of the line\&. A comment can begin on a line by itself or follow any part of another element\&. A comment does not change the meaning of any other element\&. For example: .PP .nf \f(CW!This is a comment ! that spans two lines\&. DataType !This is a comment following code\&.\fR .fi .PP .SS "Data Type Definitions" .PP Data type definitions register all the resource data types used in the file\&. You must register all the data types used in your WML file\&. Data type definitions have the following syntax: .PP .nf DataType any\&.datatype [{ InternalLiteral = internal\&.name | DocName = "\fIstring\fP"; [\&.\&.\&.]}]; [\&.\&.\&.] .fi .PP A data type definition begins with the keyword \fBDataType\fP\&. Following the \fBDataType\fP keyword is a list of data types that can be further modified with .IP "\fBInternalLiteral\fP" 10 This forces the value of the internal symbol table literal definition of the data type name\&. This modifier is only used to get around symbol table definitions hard coded into the UIL compiler\&. It should rarely be used\&. .IP "\fBDocName\fP" 10 This gives an arbitrary string for use in the documentation\&. This string is meant to supply a different name for the data type for use in the documentation, or a single name for the data type if the data type has aliases\&. .PP For example: .PP .nf \f(CWDataType OddNumber {DocName="OddNumber";}; NewString;\fR .fi .PP .SS "Character Set Definitions" .PP Character set definitions register the Motif Toolkit name and other information for the character set names used in UIL\&. Character set definitions have the following syntax: .PP .nf CharacterSet any\&.character\&.set { [ FontListElementTag | XmStringCharsetName ] = "\fIstring\fP"; [ Alias = "\fIstring\fP" \&.\&.\&.; | Direction = [ LeftToRight | RightToLeft ]; | ParseDirection = [ LeftToRight | RightToLeft ]; | CharacterSize = [ OneByte | TwoByte ]; ] [ \&.\&.\&. ] }; [ \&.\&.\&. ] .fi .PP A character set definition begins with the keyword \fBCharacterSet\fP\&. Following the \fBCharacterSet\fP keyword is a list of character sets that can be further modified with .IP "\fBFontListElementTag\fP\ |\ \fBXmStringCharsetName\fP" 10 Specifies the name of the character set, which will become the character set component of a compound string segment created using this character set\&. This modifier is required\&. .IP "\fBAlias\fP" 10 Specifies one or more aliases for the character set name\&. Each alias can be used within UIL to refer to the same character set\&. .IP "\fBDirection\fP" 10 Specifies the direction of a compound string segment created using this character set\&. The default is \fBLeftToRight\fP\&. .IP "\fBParseDirection\fP" 10 Specifies the direction in which an input string is parsed when a compound string segment is created using this character set\&. The default is whatever \fBDirection\fP is specified\&. .IP "\fBCharacterSize\fP" 10 Specifies the number of bytes in each character of a compound string segment created using this character set\&. The default is \fBOneByte\fP\&. .PP For example: .PP .nf \f(CWCharacterSet iso_latin1 { XmStringCharsetName = "ISO8859-1"; Alias = "ISOLatin1"; }; iso_hebrew_lr { XmStringCharsetName = "ISO8859-8"; Alias = "iso_latin8_lr"; Direction = RightToLeft; ParseDirection = LeftToRight; }; ksc_korean { XmStringCharsetName = "KSC5601\&.1987-0"; CharacterSize = TwoByte; };\fR .fi .PP .SS "Enumeration Set Definitions" .PP Enumeration set definitions register the named constants used in the Motif Toolkit to specify some resource values\&. Enumeration set definitions have the following syntax: .PP .nf EnumerationSet resource\&.name: resource\&.type { enum\&.value\&.name; [ \&.\&.\&. ] }; .fi .PP An enumeration set definition begins with the keyword \fBEnumerationSet\fP\&. For each enumeration set defined, the name and type of the resource are listed\&. The resource name is the Motif Toolkit resource name, with the beginning \fBXmN\fP removed and with the initial letter capitalized\&. For example, the name of the Motif Toolkit resource \fBXmNrowColumnType\fP is \fBRowColumnType\fP\&. The resource type is the data type for the resource; for most resources, this is \fIinteger\fP\&. Following the resource name and type is a list of names of enumeration values that can be used as settings for the resource\&. These names are the same as those in the Motif Toolkit\&. .PP For example: .PP .nf \f(CWEnumerationSet RowColumnType: integer { XmWORK_AREA; XmMENU_BAR; XmMENU_POPUP; XmMENU_PULLDOWN; XmMENU_OPTION; };\fR .fi .PP .PP Enumeration sets also support Boolean values\&. .SS "Control List Definitions" .PP Control list definitions assign a name to groups of controls\&. You can use these control lists later in class definitions to simplify the structure of your WML file\&. Control list definitions have the following syntax: .PP .nf ControlList any\&.control\&.list [{ any\&.control; [\&.\&.\&.]}]; .fi .PP A control list definition starts with the \fBControlList\fP keyword\&. Following the \fBControlList\fP keyword are any number of control list definitions\&. Control list definitions are made up of a control list name followed by the set of controls it represents\&. For example: .PP .nf \f(CWControlList Buttons {PushButton; RadioButton; CascadeButton; NewCascadebutton;};\fR .fi .PP .PP Each control specified in the control list must be defined as a class in the file\&. .SS "Class Definitions" .PP Class definitions describe a particular widget class including its position in the class hierarchy, toolkit convenience function, resources, and controls\&. There should be one class definition for each widget or gadget in the widget set you want to support in UIL\&. Class definitions have the following syntax: .PP .nf Class class\&.name: MetaClass | Widget | Gadget [{[ SuperClass = class\&.name; | ParentClass = parent\&.class\&.name; | InternalLiteral = internal\&.name; | Alias = \fIalias\fP; | ConvenienceFunction = convenience\&.function; | WidgetClass = widget\&.class; | DocName = "\fIstring\fP"; | DialogClass = True | False; | Resources { any\&.resource\&.name [{ Default = new\&.default\&.value; | Exclude = True | False; [\&.\&.\&.]} ]; [\&.\&.\&.]}; | Controls { any\&.control\&.name; [\&.\&.\&.]}; Children { any\&.child\&.name; [\&.\&.\&.] }; [\&.\&.\&.] ]}]; .fi .PP Class definitions start with the \fBClass\fP keyword\&. For each class defined, the name of the class and whether the class is a metaclass, widget, or gadget is listed\&. Each class definition can be further modified with the keywords described in the following list\&. .IP "\fBSuperClass\fP" 10 This indicates the name of the parent class\&. Only the root of the hierarchy does not specify a SuperClass\&. .IP "\fBParentClass\fP" 10 This indicates the name of the widget\&'s automatically created parent class if one exists\&. This allows resources for that automatically created class to be used in instances of this class\&. For example, \fBXmBulletinBoardDialog\fP creates both an \fBXmBulletinBoard\fP and an \fBXmDialogShell\fP\&. To access the resources of the \fBXmDialogShell\fP parent class it must be specified here\&. .IP "\fBInternalLiteral\fP" 10 This forces the value of the internal symbol table literal definition of the class name\&. This modifier is only used to get around symbol table definitions hard coded into the UIL compiler\&. It should rarely be used\&. .IP "\fBAlias\fP" 10 This indicates alternate names for the class for use in a UIL specification\&. .IP "\fBConvenienceFunction\fP" 10 This indicates the name of the creation convenience function for this class\&. All widget and gadget classes must have a \fBConvenienceFunction\&.\fP .IP "\fBWidgetClass\fP" 10 This indicates the associated widget class of gadget type classes\&. Presently, nothing is done with this value\&. .IP "\fBDocName\fP" 10 This defines an arbitrary string for use in the documentation\&. Presently, nothing is done with this value\&. .IP "\fBDialogClass\fP" 10 This indicates whether the class is a dialog class\&. Presently, nothing is done with this value\&. .IP "\fBResources\fP" 10 This lists the resources of the widget class\&. This keyword can be further modified with .RS .IP "\fBDefault\fP" 10 This specifies a new default value for this resource\&. Resource default values are usually set in the resource definition\&. If an inherited resource\&'s default value is changed by the class, the new default value should be noted here\&. .IP "\fBExclude\fP" 10 This specifies whether an inherited resource should be excluded from the resource list of the class\&. \fBExclude\fP is False by default\&. .RE .IP "\fBChildren\fP" 10 This lists the names of the automatically created children of this class, so that those children can be accessed in the UIL file\&. .IP "\fBControls\fP" 10 This lists the controls that the widget class allows\&. The controls can be other classes or a control list from the control list definition\&. .PP The following example uses the examples from the data type definitions and control list definitions above\&. .PP .nf \f(CWClass TopLevelWidget: MetaClass { Resources { XtbNfirstResource; XtbNsecondResource; }; }; NewWidget: Widget { SuperClass = TopLevelWidget; ConvenienceFunction = XtbCreateNewWidget; Resources { XtbNnewResource; XtbNfirstResource {Default="XtbNEW_VALUE";}; XtbNsecondResource {Exclude=True;}; }; Controls { NewWidget; Buttons; }; };\fR .fi .PP .SS "Child Definitions" .PP Child definitions register the classes of automatically created children\&. Automatically created children are referenced elsewhere in a \fBuil\fP file using the \fBChildren\fP keyword within a class definition\&. Child definitions have the following syntax: .PP \fBChild\fP \fBchild\&.name\fR \fB:\fP \fBclass\&.name\fR\fB;\fP [\&.\&.\&.] .PP Where \fBchild\&.name\fR is the name of the automatically created child and \fBclass\&.name\fR is the name of the class of that child\&. .SS "Resource Definitions" .PP Resource definitions describe a particular resource including its type, and default value\&. There should be a resource definition for each new resource referenced in the class definitions\&. Resource definitions have the following syntax: .PP .nf Resource resource\&.name: Argument | Reason | Constraint | SubResource [{[ Type = \fItype\fP; [ResourceLiteral = resource\&.literal; ] [InternalLiteral = internal\&.name; ] [Alias = \fIalias\fP; ] [Related = \fIrelated\fP; ] [Default = \fIdefault\fP; ] [DocName = doc\&.name; ] [\&.\&.\&.]}] [\&.\&.\&.] .fi .PP Resource definitions start with the \fBResource\fP keyword\&. For each resource definition, the name of the resource and whether the resource is an argument, reason, constraint or subresource is listed\&. .IP "\fBArgument\fP" 10 Indicates a standard resource .IP "\fBReason\fP" 10 Indicates a callback resource .IP "\fBConstraint\fP" 10 Indicates a constraint resource .IP "\fBSubResource\fP" 10 Presently, nothing is done with this value .PP The resource definition can be further modified with the following keywords: .IP "\fBType\fP" 10 This indicates the data type of the resource\&. It must be listed in the data type definition\&. .IP "\fBResourceLiteral\fP" 10 This indicates the keyword used in the UIL file to reference the resource\&. In Motif, the resource name is the same as the \fBResourceLiteral\fP\&. .IP "\fBInternalLiteral\fP" 10 This forces the value of the internal symbol table literal definition of the resource name\&. This modifier is only used to get around symbol table definitions hard coded into the UIL compiler\&. It should rarely be used\&. .IP "\fBAlias\fP" 10 This indicates alternate names for the resource for use in a UIL specification\&. .IP "\fBRelated\fP" 10 This is a special purpose field that allows resources that act as a counter for the current resources to be related to the resource\&. UIL automatically sets the value of this related resource to the number of items in the compiled instance of type \fBresource\&.name\fR\&. .IP "\fBDefault\fP" 10 This indicates the default value of the resource\&. .IP "\fBDocName\fP" 10 This defines an arbitrary string for use in the documentation\&. Presently, nothing is done with this value\&. .PP The following example uses the examples from the data type definitions, control list definitions and class definitions above\&. .PP .nf \f(CWResource XtbNfirstResource: Argument { Type = OddNumber; Default = "XtbOLD_VALUE";}; XtbNsecondResource: Argument { Type = NewString; Default = "XtbNEW_STRING"; }; XtbNnewResource: Argument { Type = OddNumber; Default = "XtbODD_NUMBER"; };\fR .fi .PP ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:37 motif-2.3.8/doc/man/man5/Makefile.in0000644000175000017500000004017513211512767014024 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/man/man5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = \ Traits.5 \ UIL.5 \ WML.5 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man/man5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man/man5/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man5dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man5 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man5 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man5 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man5 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/doc/man/man5/UIL.50000644000175000017500000023251412672140200012463 00000000000000'\" t ...\" UIL.sgm /main/12 1996/09/08 21:23:10 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "UIL" "file formats" .SH "NAME" \fBUIL\fP \(em The user interface language file format .iX "user interface language" .iX "UIL" .SH "SYNOPSIS" .PP .nf MODULE \fImodule_name\fP [ NAMES = CASE_INSENSITIVE | CASE_SENSITIVE ] [ CHARACTER_SET = character_set ] [ OBJECTS = { \fIwidget_name\fP = GADGET | WIDGET; [\&.\&.\&.] } ] { [ [ \fIvalue_section\fP ] | [ \fIprocedure_section\fP ] | [ \fIlist_section\fP ] | [ \fIobject_section\fP ] | [ \fIidentifier_section\fP ] [ \&.\&.\&. ] ] } END MODULE; .fi .SH "DESCRIPTION" .PP The UIL language is used for describing the initial state of a user interface for a widget based application\&. UIL describes the widgets used in the interface, the resources of those widgets, and the callbacks of those widgets\&. The UIL file is compiled into a UID file using the command \fBuil\fP or by the callable compiler \fBUil()\fP\&. The contents of the compiled UID file can then be accessed by the various Motif Resource Management (MRM) functions from within an application program\&. .PP The UID file is independent of the platform on which the Motif program will eventually be run\&. In other words, the same UID file can be used on any system that can run Motif\&. .SS "File" .PP A UIL file consists of a single complete module, described in the syntax description above, or, if the file is to be included in a larger UIL file, one complete "section," as described below\&. UIL uses five different kinds of sections: value, procedure, list, object, and identifier\&. .PP UIL is a free-form language\&. This means that high-level constructs such as object and value declarations do not need to begin in any particular column and can span any number of lines\&. Low-level constructs such as keywords and punctuation characters can also begin in any column; however, except for string literals and comments, they cannot span lines\&. .PP The UIL compiler accepts input lines up to 132 characters in length\&. .IP "\fBMODULE\fP \fImodule_name\fP" 10 The name by which the UIL module is known in the UID file\&. This name is stored in the UID file for later use in the retrieval of resources by the MRM\&. This name is always stored in uppercase in the UID file\&. .IP "\fBNAMES\fP\ \fB=\fP\ \fBCASE_INSENSITIVE\fP\ |\ \fBCASE_SENSITIVE\fP" 10 .iX "UIL" "case sensitivity clause" .IP "" 10 Indicates whether names should be treated as case sensitive or case insensitive\&. The default is case sensitive\&. The case-sensitivity clause should be the first clause in the module header, and in any case must precede any statement that contains a name\&. If names are case sensitive in a UIL module, UIL keywords in that module must be in lowercase\&. Each name is stored in the UIL file in the same case as it appears in the UIL module\&. If names are case insensitive, then keywords can be in uppercase, lowercase, or mixed case, and the uppercase equivalent of each name is stored in the UID file\&. .IP "\fBCHARACTER_SET\fP\ \fB=\fP\ \fBcharacter_set\fP" 10 .iX "UIL" "default character set clause" .IP "" 10 Specifies the default character set for string literals in the module that do not explicitly set their character set\&. The default character set, in the absence of this clause is the codeset component of the \fBLANG\fP environment variable, or the value of \fBXmFALLBACK_CHARSET\fP if \fBLANG\fP is not set or has no codeset component\&. The value of \fBXmFALLBACK_CHARSET\fP is defined by the UIL supplier, but is usually ISO8859-1 (equivalent to ISO_LATIN1)\&. Use of this clause turns off all localized string literal processing turned on by the compiler flag \fB-s\fP or the \fBUil_command_type\fP data structure element \fBuse_setlocale_flag\fP\&. .IP "\fBOBJECTS\ =\ {\fP\ \fIwidget_name\fP = \fBGADGET\fP | \fBWIDGET;\ }\fP" 10 .iX "UIL" "objects clause" .IP "" 10 Indicates whether the widget or gadget form of the control specified by \fIwidget_name\fP is used by default\&. By default the widget form is used, so the gadget keyword is usually the only one used\&. The specified control should be one that has both a widget and gadget version: XmCascadeButton, XmLabel, XmPushButton, XmSeparator, and XmToggleButton\&. The form of more than one control can be specified by delimiting them with semicolons\&. The gadget or widget form of an instance of a control can be specified with the \fBGADGET\fP and \fBWIDGET\fP keywords in a particular object declaration\&. .IP "\fIvalue_section\fP" 10 Provides a way to name a value expression or literal\&. The value name can then be referred to by declarations that occur elsewhere in the UIL module in any context where a value can be used\&. Values can be forward referenced\&. Value sections are described in more detail later in the reference page\&. .IP "\fIprocedure_section\fP" 10 Defines the callback routines used by a widget and the creation routines for user-defined widgets\&. These definitions are used for error checking\&. Procedure sections are described in more detail later in the reference page\&. .IP "\fIlist_section\fP" 10 Provides a way to group together a set of arguments, controls (children), callbacks, or procedures for later use in the UIL module\&. Lists can contain other lists, so that you can set up a hierarchy to clearly show which arguments, controls, callbacks, and procedures are common to which widgets\&. List sections are described in more detail later in the reference page\&. .IP "\fIobject_section\fP" 10 Defines the objects that make up the user interface of the application\&. You can reference the object names in declarations that occur elsewhere in the UIL module in any context where an object name can be used (for example, in a controls list, as a symbolic reference to a widget ID, or as the \fItag_value\fP argument for a callback procedure)\&. Objects can be forward referenced\&. Object sections are described in more detail later in the reference page\&. .IP "\fIidentifier_section\fP" 10 Defines a run-time binding of data to names that appear in the UIL module\&. Identifier sections are described in more detail later in the reference page\&. .PP The UIL file can also contain comments and include directives, which are described along with the main elements of the UIL file format in the following sections\&. .SS "Comments" .PP Comments can take one of two forms, as follows: .IP " \(bu" 6 The comment is introduced with the sequence \fB/*\fP followed by the text of the comment and terminated with the sequence \fB*/\fP\&. This form of comment can span multiple source lines\&. .IP " \(bu" 6 The comment is introduced with an ! (exclamation point), followed by the text of the comment and terminated by the end of the source line\&. .PP Neither form of comment can be nested\&. .SS "Value sections" .PP .iX "UIL" "value section" A value section consists of the keyword \fBVALUE\fP followed by a sequence of value declarations\&. It has the following syntax: .PP \fBVALUE\fP \fIvalue_name\fP \fB:\fP [ \fBEXPORTED\fP | \fBPRIVATE\fP ] \fIvalue_expression\fP | \fBIMPORTED\fP \fIvalue_type\fP \fB;\fP .PP Where \fIvalue_expression\fP is assigned to \fIvalue_name\fP or a \fIvalue_type\fP is assigned to an imported value name\&. A value declaration provides a way to name a value expression or literal\&. The value name can be referred to by declarations that occur later in the UIL module in any context where a value can be used\&. Values can be forward referenced\&. .iX "IMPORTED" .iX "EXPORTED" .iX "PRIVATE" .IP "\fBEXPORTED\fP" 10 A value that you define as exported is stored in the UID file as a named resource, and therefore can be referenced by name in other UID files\&. When you define a value as exported, MRM looks outside the module in which the exported value is declared to get its value at run time\&. .IP "\fBPRIVATE\fP" 10 A private value is a value that is not imported or exported\&. A value that you define as private is not stored as a distinct resource in the UID file\&. You can reference a private value only in the UIL module containing the value declaration\&. The value or object is directly incorporated into anything in the UIL module that references the declaration\&. .IP "\fBIMPORTED\fP" 10 A value that you define as imported is one that is defined as a named resource in a UID file\&. MRM resolves this declaration with the corresponding exported declaration at application run time\&. .PP By default, values and objects are private\&. The following is a list of the supported value types in UIL: .IP " \(bu" 6 \fBANY\fP .IP " \(bu" 6 \fBARGUMENT\fP .IP " \(bu" 6 \fBBOOLEAN\fP .IP " \(bu" 6 \fBCOLOR\fP .IP " \(bu" 6 \fBCOLOR_TABLE\fP .IP " \(bu" 6 \fBCOMPOUND_STRING\fP .IP " \(bu" 6 \fBFLOAT\fP .IP " \(bu" 6 \fBFONT\fP .IP " \(bu" 6 \fBFONT_TABLE\fP .IP " \(bu" 6 \fBFONTSET\fP .IP " \(bu" 6 \fBICON\fP .IP " \(bu" 6 \fBINTEGER\fP .IP " \(bu" 6 \fBINTEGER_TABLE\fP .IP " \(bu" 6 \fBKEYSYM\fP .IP " \(bu" 6 \fBREASON\fP .IP " \(bu" 6 \fBSINGLE_FLOAT\fP .IP " \(bu" 6 \fBSTRING\fP .IP " \(bu" 6 \fBSTRING_TABLE\fP .IP " \(bu" 6 \fBTRANSLATION_TABLE\fP .IP " \(bu" 6 \fBWIDE_CHARACTER\fP .IP " \(bu" 6 \fBWIDGET\fP .SS "Procedure sections" .PP .iX "UIL" "procedure section" A procedure section consists of the keyword \fBPROCEDURE\fP followed by a sequence of procedure declarations\&. It has the following syntax: .PP .nf PROCEDURE \fIprocedure_name\fP [ ( [ \fIvalue_type\fP ]) ]; .fi .PP .iX "UIL" "procedure declaration" Use a procedure declaration to declare .IP " \(bu" 6 A routine that can be used as a callback routine for a widget .IP " \(bu" 6 The creation function for a user-defined widget .PP You can reference a procedure name in declarations that occur later in the UIL module in any context where a procedure can be used\&. Procedures can be forward referenced\&. You cannot use a name you used in another context as a procedure name\&. .PP In a procedure declaration, you have the option of specifying that a parameter will be passed to the corresponding callback routine at run time\&. This parameter is called the callback tag\&. You can specify the data type of the callback tag by putting the data type in parentheses following the procedure name\&. When you compile the module, the UIL compiler checks that the argument you specify in references to the procedure is of this type\&. Note that the data type of the callback tag must be one of the valid UIL data types\&. You can use a widget as a callback tag, as long as the widget is defined in the same widget hierarchy as the callback, that is they have a common ancestor that is in the same UIL hierarchy\&. .PP The following list summarizes how the UIL compiler checks argument type and argument count, depending on the procedure declaration\&. .IP "No\ parameters" 10 No argument type or argument count checking occurs\&. You can supply either 0 or one arguments in the procedure reference\&. .IP "\fB(\ )\fP" 10 Checks that the argument count is 0 (zero)\&. .IP "\fB(ANY)\fP" 10 Checks that the argument count is 1\&. Does not check the argument type\&. Use the \fBANY\fP type to prevent type checking on procedure tags\&. .IP "\fB(\fP\fItype\fP\fB)\fP" 10 Checks for one argument of the specified type\&. .IP "\fB(\fP\fBclass_name\fP\fB)\fP" 10 Checks for one widget argument of the specified widget class\&. .PP While it is possible to use any UIL data type to specify the type of a tag in a procedure declaration, you must be able to represent that data type in the programming language you are using\&. Some data types (such as integer, Boolean, and string) are common data types recognized by most programming languages\&. Other UIL data types (such as string tables) are more complicated and may require that you set up an appropriate corresponding data structure in the application in order to pass a tag of that type to a callback routine\&. .PP You can also use a procedure declaration to specify the creation function for a user-defined widget\&. In this case, you specify no formal parameters\&. The procedure is invoked with the standard three arguments passed to all widget creation functions\&. (See the Motif Toolkit documentation for more information about widget creation functions\&.) .SS "List sections" .PP .iX "UIL" "list section" A list section consists of the keyword \fBLIST\fP followed by a sequence of list declarations\&. It has the following syntax: .PP .nf LIST \fIlist_name\fP: { list_item; [\&.\&.\&.] } [\&.\&.\&.] .fi .PP You can also use list sections to group together a set of arguments, controls (children), callbacks, or procedures for later use in the UIL module\&. Lists can contain other lists, so that you can set up a hierarchy to clearly show which arguments, controls, callbacks, and procedures are common to which widgets\&. You cannot mix the different types of lists; a list of a particular type cannot contain entries of a different list type or reference the name of a different list type\&. A list name is always private to the UIL module in which you declare the list and cannot be stored as a named resource in a UID file\&. .PP The additional list types are described in the following sections\&. .PP \fBArguments List Structure\fP .PP .iX "List types" "argument" .iX "UIL" "arguments list" An arguments list defines which arguments are to be specified in the arguments list parameter when the creation routine for a particular object is called at run time\&. An arguments list also specifies the values for those arguments\&. Argument lists have the following syntax: .PP .nf LIST \fIlist_name\fP: ARGUMENTS { \fIargument_name\fP = \fIvalue_expression\fP; [\&.\&.\&.] } [\&.\&.\&.] .fi .PP The argument name must be either a built-in argument name or a user-defined argument name that is specified with the \fBARGUMENT\fP function\&. .PP If you use a built-in argument name as an arguments list entry in an object definition, the UIL compiler checks the argument name to be sure that it is supported by the type of object that you are defining\&. If the same argument name appears more than once in a given arguments list, the last entry that uses that argument name supersedes all previous entries with that name, and the compiler issues a message\&. .PP Some arguments, such as \fBXmNitems\fP and \fBXmNitemCount\fP, are coupled by the UIL compiler\&. When you specify one of the arguments, the compiler also sets the other\&. The coupled argument is not available to you\&. .iX "UIL" "coupled arguments" .iX "Arguments" "coupled in UIL" .PP The Motif Toolkit and the X Toolkit (intrinsics) support constraint arguments\&. A constraint argument is one that is passed to children of an object, beyond those arguments normally available\&. For example, the Form widget grants a set of constraint arguments to its children\&. These arguments control the position of the children within the Form\&. .PP Unlike the arguments used to define the attributes of a particular widget, constraint arguments are used exclusively to define additional attributes of the children of a particular widget\&. These attributes affect the behavior of the children within their parent\&. To supply constraint arguments to the children, you include the arguments in the arguments list for the child\&. .PP See \fBAppendix B\fP for information about which arguments are supported by which widgets\&. See \fBAppendix C\fP for information about what the valid value type is for each built-in argument\&. .PP \fBCallbacks List Structure\fP .iX "UIL" "callbacks list" .iX "List types" "callback" .PP Use a callbacks list to define which callback reasons are to be processed by a particular widget at run time\&. Callback lists have the following syntax: .PP \fBLIST\fP \fIlist_name\fP \fB: CALLBACKS {\fP \fIreason_name\fP \fB= PROCEDURE\fP \fIprocedure_name\fP \fB[\fP \fB(\fP [ \fIvalue_expression\fP ] \fB)\fP ]\fB;\fP | \fIreason_name\fP \fB=\fP \fIprocedure_list\fP \fB;\fP [\&.\&.\&.] \fB}\fP [\&.\&.\&.] .PP For Motif Toolkit widgets, the reason name must be a built-in reason name\&. For a user-defined widget, you can use a reason name that you previously specified using the \fBREASON\fP function\&. If you use a built-in reason in an object definition, the UIL compiler ensures that reason is supported by the type of object you are defining\&. Appendix B shows which reasons each object supports\&. .PP If the same reason appears more than once in a callbacks list, the last entry referring to that name supersedes all previous entries using the same reason, and the UIL compiler issues a diagnostic message\&. .PP If you specify a named value for the procedure argument (callback tag), the data type of the value must match the type specified for the callback tag in the corresponding procedure declaration\&. When specifying a widget name as a procedure value expression you must also specify the type of the widget and a space before the name of the widget\&. .PP Because the UIL compiler produces a UID file rather than an object module (\&.o), the binding of the UIL name to the address of the entry point to the procedure is not done by the loader, but is established at run time with the MRM function \fBMrmRegisterNames\fP\&. You call this function before fetching any objects, giving it both the UIL names and the procedure addresses of each callback\&. The name you register with MRM in the application program must match the name you specified for the procedure in the UIL module\&. .PP Each callback procedure receives three arguments\&. The first two arguments have the same form for each callback\&. The form of the third argument varies from object to object\&. .PP The first argument is the address of the data structure maintained by the Motif Toolkit for this object instance\&. This address is called the widget ID for this object\&. .PP The second argument is the address of the value you specified in the callbacks list for this procedure\&. If you do not specify an argument, the address is NULL\&. Note that, in the case where the value you specified is a string or an \fBXmString\fR, the value specified in the callbacks list already represents an address rather than an actual value\&. In the case of a simple string, for example, the value is the address of the first character of that string\&. In these cases, UIL does not add a level of indirection, and the second argument to the callback procedure is simply the value as specified in the callbacks list\&. .PP The third argument is the reason name you specified in the callbacks list\&. .PP \fBControls List Structure\fP .PP .iX "UIL" "controls list" A controls list defines which objects are children of, or controlled by, a particular object\&. Each entry in a controls list has the following syntax: .PP .nf LIST \fIlist_name\fP: CONTROLS { [\fIchild_name\fP: ] [MANAGED | UNMANAGED] \fIobject_definition\fP; [\&.\&.\&.] } [\&.\&.\&.] .fi .PP If you specify the keyword \fBMANAGED\fP at run time, the object is created and managed; if you specify \fBUNMANAGED\fP at run time, the object is only created\&. Objects are managed by default\&. .PP You can use \fIchild_name\fP to specify resources for the automatically created children of a particular control\&. Names for automatically created children are formed by appending \fBXm_\fP to the name of the child widget\&. This name is specified in the documentation for the parent widget\&. .PP Unlike the arguments list and the callbacks list, a controls list entry that is identical to a previous entry does not supersede the previous entry\&. At run time, each controls list entry causes a child to be created when the parent is created\&. If the same object definition is used for multiple children, multiple instances of the child are created at run time\&. See \fBAppendix B\fP for a list of which widget types can be controlled by which other widget types\&. .PP \fBProcedures List Structure\fP .PP You can specify multiple procedures for a callback reason in UIL by defining a procedures list\&. Just as with other list types, procedures lists can be defined in-line or in a list section and referenced by name\&. .PP If you define a reason more than once (for example, when the reason is defined both in a referenced procedures list and in the callbacks list for the object), previous definitions are overridden by the latest definition\&. The syntax for a procedures list is as follows: .PP .nf LIST \fIlist_name\fP: PROCEDURES { \fIprocedure_name\fP [ ( [ \fIvalue_expression\fP ]) ]; [\&.\&.\&.] } [\&.\&.\&.] .fi .PP When specifying a widget name as a procedure value expression you must also specify the type of the widget and a space before the name of the widget\&. .SS "Object Sections" .PP .iX "UIL" "object section" An object section consists of the keyword \fBOBJECT\fP followed by a sequence of object declarations\&. It has the following syntax: .PP .nf OBJECT \fIobject_name\fP: [ EXPORTED | PRIVATE | IMPORTED ] \fIobject_type\fP [ PROCEDURE \fIcreation_function\fP ] [ \fIobject_name\fP [ WIDGET | GADGET ] | {\fIlist_definitions\fP } ] .fi .PP .iX "UIL" "object declaration" Use an object declaration to define the objects that are to be stored in the UID file\&. You can reference the object name in declarations that occur elsewhere in the UIL module in any context where an object name can be used (for example, in a controls list, as a symbolic reference to a widget ID, or as the \fItag_value\fP argument for a callback procedure)\&. Objects can be forward referenced; that is, you can declare an object name after you reference it\&. All references to an object name must be consistent with the type of the object, as specified in the object declaration\&. You can specify an object as exported, imported, or private\&. .PP The object definition can contain a sequence of lists that define the arguments, hierarchy, and callbacks for the widget\&. You can specify only one list of each type for an object\&. When you declare a user-defined widget, you must include a reference to the widget creation function for the user-defined widget\&. .PP Note: Several widgets in the Motif Toolkit actually consist of two linked widgets\&. For example, \fBXmScrolledText\fP and \fBXmScrolledList\fP each consist of children \fBXmText\fP and \fBXmList\fP widgets under a \fBXmScrolledWindow\fP widget\&. When such a widget is created, its resources are available to both of the underlying widgets\&. This can occasionally cause problems, as when the programmer wants a \fBXmNdestroyCallback\fP routine named to act when the widget is destroyed\&. In this case, the callback resource will be available to both sub-widgets, and will cause an error when the widget is destroyed\&. To avoid these problems, the programmer should separately create the parent and child widgets, rather than relying on these linked widgets\&. .PP Use the \fBGADGET\fP or \fBWIDGET\fP keyword to specify the object type or to override the default variant for this object type\&. You can use the Motif Toolkit name of an object type that has a gadget variant (for example, \fBXmLabelGadget\fP) as an attribute of an object declaration\&. The \fIobject_type\fP can be any object type, including gadgets\&. You need to specify the \fBGADGET\fP or \fBWIDGET\fP keyword only in the declaration of an object, not when you reference the object\&. You cannot specify the \fBGADGET\fP or \fBWIDGET\fP keyword for a user-defined object; user-defined objects are always widgets\&. .SS "Identifier sections" .PP .iX "UIL" "identifiers" The identifier section allows you to define an identifier, a mechanism that achieves run-time binding of data to names that appear in a UIL module\&. The identifier section consists of the reserved keyword \fBIDENTIFIER\fP, followed by a list of names, each name followed by a semicolon\&. .PP \fBIDENTIFIER\fP \fIidentifier_name\fP\fB;\fP [\&.\&.\&.\fB;\fP] .PP You can later use these names in the UIL module as either the value of an argument to a widget or the tag value to a callback procedure\&. At run time, you use the MRM functions \fBMrmRegisterNames\fP and \fBMrmRegisterNamesInHierarchy\fP to bind the identifier name with the data (or, in the case of callbacks, with the address of the data) associated with the identifier\&. .PP Each UIL module has a single name space; therefore, you cannot use a name you used for a value, object, or procedure as an identifier name in the same module\&. .PP The UIL compiler does not do any type checking on the use of identifiers in a UIL module\&. Unlike a UIL value, an identifier does not have a UIL type associated with it\&. Regardless of what particular type a widget argument or callback procedure tag is defined to be, you can use an identifier in that context instead of a value of the corresponding type\&. .PP To reference these identifier names in a UIL module, you use the name of the identifier wherever you want its value to be used\&. .SS "Include directives" .PP .iX "UIL" "include directive" The include directive incorporates the contents of a specified file into a UIL module\&. This mechanism allows several UIL modules to share common definitions\&. The syntax for the include directive is as follows: .PP .nf INCLUDE FILE \fIfile_name\fP; .fi .PP The UIL compiler replaces the include directive with the contents of the include file and processes it as if these contents had appeared in the current UIL source file\&. .PP You can nest include files; that is, an include file can contain include directives\&. The UIL compiler can process up to 100 references (including the file containing the UIL module)\&. Therefore, you can include up to 99 files in a single UIL module, including nested files\&. Each time a file is opened counts as a reference, so including the same file twice counts as two references\&. .PP The \fIfile_name\fP is a simple string containing a file specification that identifies the file to be included\&. The rules for finding the specified file are similar to the rules for finding header, or \fB\&.h\fP files using the include directive, \fB#include\fP, with a quoted string in C\&. The UIL uses the \fB\fB-I\fP\fP option for specifying a search directory for include files\&. .IP " \(bu" 6 If you do not supply a directory, the UIL compiler searches for the include file in the directory of the main source file\&. .IP " \(bu" 6 If the compiler does not find the include file there, the compiler looks in the same directory as the source file\&. .IP " \(bu" 6 If you supply a directory, the UIL compiler searches only that directory for the file\&. .SS "Names and Strings" .PP Names can consist of any of the characters A to Z, a to z, 0 to 9, $ (dollar sign), and \^_\^ (underscore)\&. Names cannot begin with a digit (0 to 9)\&. The maximum length of a name is 31 characters\&. .PP UIL gives you a choice of either case-sensitive or case-insensitive names through a clause in the \fBMODULE\fP header\&. For example, if names are case sensitive, the names "sample" and "Sample" are distinct from each other\&. If names are case insensitive, these names are treated as the same name and can be used interchangeably\&. By default, UIL assumes names are case sensitive\&. .PP In \fBCASE-INSENSITIVE\fP mode, the compiler outputs all names in the UID file in uppercase form\&. In \fBCASE-SENSITIVE\fP mode, names appear in the UIL file exactly as they appear in the source\&. .PP The following table lists the reserved keywords, which are not available for defining programmer defined names\&. .iX "UIL" "keywords" .iX "UIL module" "keywords" .iX "UIL specification file" "keywords" .iX "Keywords" .TS tab() box; c s s s l l l l. \fBReserved Keywords\fP ____ ARGUMENTSCALLBACKSCONTROLSEND EXPORTEDFALSEGADGETIDENTIFIER INCLUDELISTMODULEOFF ONOBJECTPRIVATEPROCEDURE PROCEDURESTRUEVALUEWIDGET .TE .PP The UIL unreserved keywords are described in the following list and table\&. These keywords can be used as programmer defined names, however, if you use any keyword as a name, you cannot use the UIL-supplied usage of that keyword\&. .IP " \(bu" 6 Built-in argument names (for example, \fBXmNx\fP, \fBXmNheight\fP) .IP " \(bu" 6 Built-in reason names (for example, \fBXmNactivateCallback\fP, \fBXmNhelpCallback\fP) .IP " \(bu" 6 Character set names (for example, \fBISO_LATIN1\fP, \fBISO_HEBREW_LR\fP) .IP " \(bu" 6 Constant value names (for example, \fBXmMENU_OPTION\fP, \fBXmBROWSE_SELECT\fP) .IP " \(bu" 6 Object types (for example, \fBXmPushButton\fP, \fBXmBulletinBoard\fP) .TS tab() box; c s s l l l. \fBUnreserved Keywords\fP ___ ANYARGUMENTASCIZ_STRING_TABLE ASCIZ_TABLEBACKGROUNDBOOLEAN CASE_INSENSITIVECASE_SENSITIVECHARACTER_SET COLORCOLOR_TABLECOMPOUND_STRING COMPOUND_STRING_COMPONENTCOMPOUND_STRING_TABLEFILE FLOATFONTFONT_TABLE FONTSETFOREGROUNDICON IMPORTEDINTEGERINTEGER_TABLE KEYSYMMANAGEDNAMES OBJECTSREASONRGB RIGHT_TO_LEFTSINGLE_FLOATSTRING STRING_TABLETRANSLATION_TABLEUNMANAGED USER_DEFINEDVERSIONWIDE_CHARACTER WIDGETXBITMAPFILE .TE .PP String literals can be composed of the uppercase and lowercase letters, digits, and punctuation characters\&. Spaces, tabs, and comments are special elements in the language\&. They are a means of delimiting other elements, such as two names\&. One or more of these elements can appear before or after any other element in the language\&. However, spaces, tabs, and comments that appear in string literals are treated as character sequences rather than delimiters\&. .SS "Data Types" .iX "UIL" "literals" .iX "UIL module" "literals" .iX "UIL specification file" "literals" .iX "Values" "literals" .PP UIL provides literals for several of the value types it supports\&. Some of the value types are not supported as literals (for example, pixmaps and string tables)\&. You can specify values for these types by using functions described in the \fIFunctions\fP section\&. UIL directly supports the following literal types: .IP " \(bu" 6 String literal .IP " \(bu" 6 Integer literal .IP " \(bu" 6 Boolean literal .IP " \(bu" 6 Floating-point literal .PP UIL also includes the data type \fBANY\fP, which is used to turn off compile time checking of data types\&. .SS "String Literals" .iX "UIL" "string literals" .iX "UIL module" "string literals" .iX "UIL specification file" "string literals" .iX "Values" "string literals" .PP A string literal is a sequence of zero or more 8-bit or 16-bit characters or a combination delimited by \fB\&'\fP (single quotation marks) or \fB"\fP (double quotation marks)\&. String literals can also contain multibyte characters delimited with double quotation marks\&. String literals can be no more than 2000 characters long\&. .PP A single-quoted string literal can span multiple source lines\&. To continue a single-quoted string literal, terminate the continued line with a \fB\e\fP (backslash)\&. The literal continues with the first character on the next line\&. .PP Double-quoted string literals cannot span multiple source lines\&. (Because double-quoted strings can contain escape sequences and other special characters, you cannot use the backslash character to designate continuation of the string\&.) To build a string value that must span multiple source lines, use the concatenation operator described later in this section\&. .PP The syntax of a string literal is one of the following: .PP .nf \&'[\fIcharacter_string\fP]\&' [#\fIchar_set\fP]"[\fIcharacter_string\fP]" .fi .PP Both string forms associate a character set with a string value\&. UIL uses the following rules to determine the character set and storage format for string literals: .IP " \(bu" 6 A string declared as \fB\&'\fP\fIstring\fP\fB\&'\fP is equivalent to \fB#\fP\fIcur_charset\fP\fB"\fP\fIstring\fP\fB"\fP, where \fIcur_charset\fP will be the codeset portion of the value of the \fBLANG\fP environment variable if it is set or the value of \fBXmFALLBACK_CHARSET\fP if \fBLANG\fP is not set or has no codeset component\&. By default, \fBXmFALLBACK_CHARSET\fP is \fBISO8859-1\fP (equivalent to \fBISO_LATIN1\fP), but vendors may define a different default\&. .IP " \(bu" 6 A string declared as \fB"\fP\fIstring\fP\fB"\fP is equivalent to \fB#\fP\fIchar_set\fP\fB"\fP\fIstring\fP\fB"\fP if you specified \fIchar_set\fP as the default character set for the module\&. If no default character set has been specified for the module, then if the \fB-s\fP option is provided to the \fBuil\fP command or the \fBuse_setlocale_flag\fP is set for the callable compiler, \fBUil()\fP, the string will be interpreted to be a string in the current locale\&. This means that the string is parsed in the locale of the user by calling \fIsetlocale\fP, its charset is \fBXmFONTLIST_DEFAULT_TAG\fP, and that if the string is converted to a compound string, it is stored as a locale encoded text segment\&. Otherwise, \fB"\fP\fIstring\fP\fB"\fP is equivalent to \fB#\fP\fIcur_charset\fP\fB"\fP\fIstring\fP\fB"\fP, where \fIcur_charset\fP is interpreted as described for single quoted strings\&. .IP " \(bu" 6 A string of the form \fB"\fP\fIstring\fP\fB"\fP or \fB#\fP\fIchar_set\fP\fB"\fP\fIstring\fP\fB"\fP is stored as a null-terminated string\&. .PP If the \fIchar_set\fP in a string specified in the form above is not a built-in charset, and is not a user-defined charset, the charset of the string will be set to \fBXmFONTLIST_DEFAULT_TAG\fP, and an informational message will be issued to the user to note that this substitution has been made\&. .PP The following table lists the character sets supported by the UIL compiler for string literals\&. Note that several UIL names map to the same character set\&. In some cases, the UIL name influences how string literals are read\&. For example, strings identified by a UIL character set name ending in \fB_LR\fP are read left-to-right\&. Names that end in a different number reflect different fonts (for example, ISO_LATIN1 or ISO_LATIN6)\&. All character sets in this table are represented by 8 bits\&. .TS tab() box; c s l l. \fBSupported Character Sets\fP __ \fBUIL Name\fP\fBDescription\fP __ \fBISO_LATIN1\fPGL: ASCII, GR: Latin-1 Supplement \fBISO_LATIN2\fPGL: ASCII, GR: Latin-2 Supplement \fBISO_ARABIC\fPT{ GL: ASCII, GR: Latin-Arabic Supplement T} \fBISO_LATIN6\fPT{ GL: ASCII, GR: Latin-Arabic Supplement T} \fBISO_GREEK\fPT{ GL: ASCII, GR: Latin-Greek Supplement T} \fBISO_LATIN7\fPT{ GL: ASCII, GR: Latin-Greek Supplement T} \fBISO_HEBREW\fPT{ GL: ASCII, GR: Latin-Hebrew Supplement T} \fBISO_LATIN8\fPT{ GL: ASCII, GR: Latin-Hebrew Supplement T} \fBISO_HEBREW_LR\fPT{ GL: ASCII, GR: Latin-Hebrew Supplement T} \fBISO_LATIN8_LR\fPT{ GL: ASCII, GR: Latin-Hebrew Supplement T} \fBJIS_KATAKANA\fPGL: JIS Roman, GR: JIS Katakana .TE .PP Following are the parsing rules for each of the character sets: .IP "All\ character\ sets" 10 Character codes in the range 00\&.\&.\&.1F, 7F, and 80\&.\&.\&.9F are control characters including both bytes of 16-bit characters\&. The compiler flags these as illegal characters\&. .IP "\fBISO_LATIN1\ ISO_LATIN2\ ISO_LATIN3\ ISO_GREEK\ ISO_LATIN4\fP" 10 These sets are parsed from left to right\&. The escape sequences for null-terminated strings are also supported by these character sets\&. .IP "\fBISO_HEBREW\ ISO_ARABIC\ ISO_LATIN8\fP" 10 These sets are parsed from right to left\&. For example, the string \f(CW#ISO_HEBREW"012345"\fP will generate a primitive string of "543210" with character set \fBISO_HEBREW\fP\&. The string direction for such a string would be right-to-left, so when rendered, the string will appear as "012345\&." The escape sequences for null-terminated strings are also supported by these character sets, and the characters that compose the escape sequences are in left-to-right order\&. For example, you would enter \en, not n\e\&. .IP "\fBISO_HEBREW_LR\ ISO_ARABIC_LR\ ISO_LATIN8_LR\fP" 10 These sets are parsed from left to right\&. For example, the string \f(CW#ISO_HEBREW_LR"012345"\fP generates a primitive string "012345" with character set \fBISO_HEBREW\fP\&. The string direction for such a string would still be right-to-left, however, so when rendered, it will appear as "543210\&." In other words, the characters were originally typed in the \fIsame order\fP in which they would have been typed in Hebrew (although in Hebrew, the typist would have been using a text editor that went from right to left)\&. The escape sequences for null-terminated strings are also supported by these character sets\&. .IP "\fBJIS_KATAKANA\fP" 10 This set is parsed from left to right\&. The escape sequences for null-terminated strings are also supported by this character set\&. Note that the \fB\e\fP (backslash) may be displayed as a yen symbol\&. .PP In addition to designating parsing rules for strings, character set information remains an attribute of a compound string\&. If the string is included in a string consisting of several concatenated segments, the character set information is included with that string segment\&. This gives the Motif Toolkit the information it needs to decipher the compound string and choose a font to display the string\&. .PP For an application interface displayed only in English, UIL lets you ignore the distinctions between the two uses of strings\&. The compiler recognizes by context when a string must be passed as a null-terminated string or as a compound string\&. .PP The UIL compiler recognizes enough about the various character sets to correctly parse string literals\&. The compiler also issues errors if you use a compound string in a context that supports only null-terminated strings\&. .PP Since the character set names are keywords, you must put them in lowercase if case-sensitive names are in force\&. If names are case insensitive, character set names can be uppercase, lowercase, or mixed case\&. .PP In addition to the built-in character sets recognized by UIL, you can define your own character sets with the \fBCHARACTER_SET\fP function\&. You can use the \fBCHARACTER_SET\fP function anywhere a character set can be specified\&. .PP String literals can contain characters with the eighth (high-order) bit set\&. You cannot type control characters (00-1F, 7F, and 80-9F) directly in a single-quoted string literal\&. However, you can represent these characters with escape sequences\&. The following list shows the escape sequences for special characters\&. .iX "UIL" "escape sequences" .iX "Escape sequences" .IP "\fB\eb\fP" 10 Backspace .IP "\fB\ef\fP" 10 Form-feed .IP "\fB\en\fP" 10 Newline .IP "\fB\er\fP" 10 Carriage return .IP "\fB\et\fP" 10 Horizontal tab .IP "\fB\ev\fP" 10 Vertical tab .IP "\fB\e\&'\fP" 10 Single quotation mark .IP "\fB\e""\fP" 10 Double quotation mark .IP "\fB\e\e\fP" 10 Backslash .IP "\fB\e\fP\fIinteger\fP\^\fB\e\fP" 10 Character whose internal representation is given by \fIinteger\fP (in the range 0 to 255 decimal) .PP Note that escape sequences are processed literally in strings that are parsed in the current locale (localized strings)\&. .PP The UIL compiler does not process newline characters in compound strings\&. The effect of a newline character in a compound string depends only on the character set of the string, and the result is not guaranteed to be a multiline string\&. .PP \fBCompound String Literals\fP .PP A compound string consists of a string of 8-bit, 16-bit, or multibyte characters, a named character set, and a writing direction\&. Its UIL data type is \fBcompound_string\fP\&. .PP The writing direction of a compound string is implied by the character set specified for the string\&. You can explicitly set the writing direction for a compound string by using the \fBCOMPOUND_STRING\fP function\&. .PP A compound string can consist of a sequence of concatenated compound strings, null-terminated strings, or a combination of both, each of which can have a different character set property and writing direction\&. Use the concatenation operator & (ampersand) to create a sequence of compound strings\&. .PP Each string in the sequence is stored, including the character set and writing direction information\&. .PP Generally, a string literal is stored in the UID file as a compound string when the literal consists of concatenated strings having different character sets or writing directions, or when you use the string to specify a value for an argument that requires a compound string value\&. If you want to guarantee that a string literal is stored as a compound string, you must use the \fBCOMPOUND_STRING\fP function\&. .PP \fBData Storage Consumption for String Literals\fP .PP The way a string literal is stored in the UID file depends on how you declare and use the string\&. The UIL compiler automatically converts a null-terminated string to a compound string if you use the string to specify the value of an argument that requires a compound string\&. However, this conversion is costly in terms of storage consumption\&. .PP \fBPRIVATE\fP, \fBEXPORTED\fP, and \fBIMPORTED\fP string literals require storage for a single allocation when the literal is declared; thereafter, storage is required for each reference to the literal\&. Literals declared in-line require storage for both an allocation and a reference\&. .PP The following table summarizes data storage consumption for string literals\&. The storage requirement for an allocation consists of a fixed portion and a variable portion\&. The fixed portion of an allocation is roughly the same as the storage requirement for a reference (a few bytes)\&. The storage consumed by the variable portion depends on the size of the literal value (that is, the length of the string)\&. To conserve storage space, avoid making string literal declarations that result in an allocation per use\&. .TS tab() box; c s s s l| l| l| l ^| ^| ^| l. T{ \fBData Storage Consumption for String Literals\fP T} ____ \fBDeclaration\fP\fBData Type\fP\fBUsed As\fP\fBStorage Requirements\fP \fBPer Use\fP ____ In-lineNull-terminatedNull-terminatedT{ An allocation and a reference (within the module) T} PrivateNull-terminatedNull-terminatedA reference (within the module) ExportedNull-terminatedNull-terminatedT{ A reference (within the UID hierarchy) T} ImportedNull-terminatedNull-terminatedT{ A reference (within the UID hierarchy) T} In-lineNull-terminatedCompoundT{ An allocation and a reference (within the module) T} PrivateNull-terminatedCompoundT{ An allocation and a reference (within the module) T} ExportedNull-terminatedCompoundT{ A reference (within the UID hierarchy) T} ImportedNull-terminatedCompoundT{ A reference (within the UID hierarchy) T} In-lineCompoundCompoundT{ An allocation and a reference (within the module) T} PrivateCompoundCompoundA reference (within the module) ExportedCompoundCompoundT{ A reference (within the UID hierarchy) T} ImportedCompoundCompoundT{ A reference (within the UID hierarchy) T} .TE .SS "Integer Literals" .iX "UIL" "integer literals" .iX "UIL module" "integer literals" .iX "UIL specification file" "integer literals" .iX "Values" "integer literals" .PP An integer literal represents the value of a whole number\&. Integer literals have the form of an optional sign followed by one or more decimal digits\&. An integer literal must not contain embedded spaces or commas\&. .PP Integer literals are stored in the UID file as 32-bit integers\&. Exported and imported integer literals require a single allocation when the literal is declared; thereafter, a few bytes of storage are required for each reference to the literal\&. Private integer literals and those declared in-line require allocation and reference storage per use\&. To conserve storage space, avoid making integer literal declarations that result in an allocation per use\&. .PP The following table shows data storage consumption for integer literals\&. .TS tab() box; c s l| l. T{ \fBData Storage Consumption for Integer Literals\fP T} __ \fBDeclaration\fP\fBStorage Requirements Per Use\fP __ In-lineT{ An allocation and a reference (within the module) T} PrivateT{ An allocation and a reference (within the module) T} ExportedT{ A reference (within the UID hierarchy) T} ImportedT{ A reference (within the UID hierarchy) T} .TE .SS "Boolean Literal" .PP .iX "UIL" "Boolean literals" .iX "UIL module" "Boolean literals" .iX "UIL specification file" "Boolean literals" .iX "Values" "Boolean literals" .iX "Boolean literals" A Boolean literal represents the value True (reserved keyword \fBTRUE\fP or \fBOn\fP) or False (reserved keyword \fBFALSE\fP or \fBOff\fP)\&. These keywords are subject to case-sensitivity rules\&. .PP In a UID file, \fBTRUE\fP is represented by the integer value 1 and \fBFALSE\fP is represented by the integer value 0 (zero)\&. .PP Data storage consumption for Boolean literals is the same as that for integer literals\&. .SS "Floating-Point Literal" .iX "UIL" "floating-point literals" .iX "UIL module" "floating-point literals" .iX "UIL specification file" "floating-point literals" .iX "Values" "floating-point literals" .PP A floating-point literal represents the value of a real (or float) number\&. Floating-point literals have the following form: .PP .nf [+|-][\fIinteger\fP]\&.\fIinteger\fP[E|e[+|-]\fIexponent\fP] .fi .PP For maximum portability, a floating-point literal can represent values in the range 1\&.0E-37 to 1\&.0E+37 with at least 6 significant digits\&. On many machines this range will be wider, with more significant digits\&. A floating-point literal must not contain embedded spaces or commas\&. .PP Floating-point literals are stored in the UID file as double-precision, floating-point numbers\&. The following table gives examples of valid and invalid floating-point notation for the UIL compiler\&. .TS tab() box; c s l l. \fBFloating Point Literals\fP __ \fBValid Floating-Point Literals\fP\fBInvalid Floating-Point Literals\fP __ 1\&.01e1 (no decimal point) T{ 3\&.1415E-2 (equals \&.031415) T}2\&.87 e6 (embedded blanks) T{ -6\&.29e7 (equals -62900000) T}2\&.0e100 (out of range) .TE .PP Data storage consumption for floating-point literals is the same as that for integer literals\&. .PP .iX "UIL" "ANY value" .iX "UIL module" "ANY value" .iX "UIL specification file" "ANY value" .iX "Functions" "ANY value" .iX "ANY value" The purpose of the \fBANY\fP data type is to shut off the data-type checking feature of the UIL compiler\&. You can use the \fBANY\fP data type for the following: .IP " \(bu" 6 Specifying the type of a callback procedure tag .IP " \(bu" 6 Specifying the type of a user-defined argument .PP You can use the \fBANY\fP data type when you need to use a type not supported by the UIL compiler or when you want the data-type restrictions imposed by the compiler to be relaxed\&. For example, you might want to define a widget having an argument that can accept different types of values, depending on run-time circumstances\&. .PP If you specify that an argument takes an \fBANY\fP value, the compiler does not check the type of the value specified for that argument; therefore, you need to take care when specifying a value for an argument of type \fBANY\fP\&. You could get unexpected results at run time if you pass a value having a data type that the widget does not support for that argument\&. .SS "Expressions" .PP .iX "UIL" "expressions" .iX "expressions" UIL includes compile-time value expressions\&. These expressions can contain references to other UIL values, but cannot be forward referenced\&. .PP The following table lists the set of operators in UIL that allow you to create integer, real, and Boolean values based on other values defined with the UIL module\&. In the table, a precedence of 1 is the highest\&. .TS tab() box; l s s s l| l| l| l c| l| l| c. \fBValid Operators\fP ____ \fBOperator\fP\fBOperand Types\fP\fBMeaning\fP\fBPrecedence\fP ____ ~BooleanNOT1 integerOne\&'s complement -floatNegate1 integerNegate +floatNOP1 integerNOP *float,floatMultiply2 integer,integerMultiply /float,floatDivide2 integer,integerDivide +float,floatAdd3 integer,integerAdd -float,floatSubtract3 integer,integerSubtract >>integer,integerShift right4 <<integer,integerShift left4 &Boolean,BooleanAND5 integer,integerBitwise AND string,stringConcatenate |Boolean,BooleanOR6 integer,integerBitwise OR ^Boolean,BooleanXOR6 integer,integerBitwise XOR .TE .PP A string can be either a single compound string or a sequence of compound strings\&. If the two concatenated strings have different properties (such as writing direction or character set), the result of the concatenation is a multisegment compound string\&. .PP The string resulting from the concatenation is a null-terminated string unless one or more of the following conditions exists: .IP " \(bu" 6 One of the operands is a compound string .IP " \(bu" 6 The operands have different character set properties .IP " \(bu" 6 The operands have different writing directions .PP Then the resulting string is a compound string\&. You cannot use imported or exported values as operands of the concatenation operator\&. .PP The result of each operator has the same type as its operands\&. You cannot mix types in an expression without using conversion routines\&. .PP You can use parentheses to override the normal precedence of operators\&. In a sequence of unary operators, the operations are performed in right-to-left order\&. For example, \fB- + -A\fP is equivalent to \fB-(+(-A))\fP\&. In a sequence of binary operators of the same precedence, the operations are performed in left-to-right order\&. For example, \fBA*B/C*D\fP is equivalent to \fB((A*B)/C)*D\fP\&. .PP A value declaration gives a value a name\&. You cannot redefine the value of that name in a subsequent value declaration\&. You can use a value containing operators and functions anywhere you can use a value in a UIL module\&. You cannot use imported values as operands in expressions\&. .iX "UIL" "data type conversions" .iX "Data type" "conversions" .iX "Conversions" "data type" .PP Several of the binary operators are defined for multiple data types\&. For example, the operator for multiplication (\fB*\fP) is defined for both floating-point and integer operands\&. .PP For the UIL compiler to perform these binary operations, both operands must be of the same type\&. If you supply operands of different data types, the UIL compiler automatically converts one of the operands to the type of the other according to the following conversions rules: .IP " \(bu" 6 If the operands are an integer and a Boolean, the Boolean is converted to an integer\&. .IP " \(bu" 6 If the operands are an integer and a floating-point, the integer is converted to an floating-point\&. .IP " \(bu" 6 If the operands are a floating-point and a Boolean, the Boolean is converted to a floating-point\&. .PP You can also explicitly convert the data type of a value by using one of the conversion functions \fBINTEGER\fP, \fBFLOAT\fP or \fBSINGLE_FLOAT\fP\&. .SS "Functions" .PP .iX "UIL Functions" .iX "UIL module" "functions" .iX "UIL specification file" "functions" .iX "Functions" UIL provides functions to generate the following types of values: .IP " \(bu" 6 Character sets .IP " \(bu" 6 Keysyms .IP " \(bu" 6 Colors .IP " \(bu" 6 Pixmaps .IP " \(bu" 6 Single-precision, floating-point numbers .IP " \(bu" 6 Double-precision, floating-point numbers .IP " \(bu" 6 Fonts .IP " \(bu" 6 Fontsets .IP " \(bu" 6 Font tables .IP " \(bu" 6 Compound strings .IP " \(bu" 6 Compound string tables .IP " \(bu" 6 ASCIZ (null-terminated) string tables .IP " \(bu" 6 Wide character strings .IP " \(bu" 6 Widget class names .IP " \(bu" 6 Integer tables .IP " \(bu" 6 Arguments .IP " \(bu" 6 Reasons .IP " \(bu" 6 Translation tables .PP Remember that all examples in the following sections assume case-insensitive mode\&. Keywords are shown in uppercase letters to distinguish them from user-specified names, which are shown in lowercase letters\&. This use of uppercase letters is not required in case-insensitive mode\&. In case-sensitive mode, keywords must be in lowercase letters\&. .IP "\fBCHARACTER_SET(\fP\fIstring_expression[\fP,\ property[,\ \&.\&.\&.]]\fB)\fP" 10 .iX "UIL" "user-defined character set" .iX "UIL module" "user-defined character set" .iX "UIL specification file" "user-defined character set" .iX "UIL Functions" "CHARACTER_SET" .iX "User-defined character set" .iX "Character set" "user-defined" .iX "CHARACTER_SET function" .IP "" 10 You can define your own character sets with the \fBCHARACTER_SET\fP function\&. You can use the \fBCHARACTER_SET\fP function anywhere a character set can be specified\&. .IP "" 10 The result of the \fBCHARACTER_SET\fP function is a character set with the name \fBstring_expression\fP and the properties you specify\&. \fBstring_expression\fP must be a null-terminated string\&. You can optionally include one or both of the following clauses to specify properties for the resulting character set: .PP .nf RIGHT_TO_LEFT = \fIboolean_expression\fP SIXTEEN_BIT = \fIboolean_expression\fP .fi .IP "" 10 The \fBRIGHT_TO_LEFT\fP clause sets the default writing direction of the string from right to left if \fIboolean_expression\fP is True, and right to left otherwise\&. .IP "" 10 The \fBSIXTEEN_BIT\fP clause allows the strings associated with this character set to be interpreted as 16-bit characters if \fIboolean_expression\fP is True, and 8-bit characters otherwise\&. .IP "\fBKEYSYM(\fP\fIstring_literal\fP\fB)\fP" 10 .iX "UIL" "keysyms" .iX "UIL module" "keysyms" .iX "UIL specification file" "keysyms" .iX "UIL Functions" "KEYSYM" .iX "Keysyms" "defining in UIL" .IP "" 10 The \fBKEYSYM\fP function is used to specify a keysym for a mnemonic resource\&. \fIstring_literal\fP must contain a valid \fBKeySym\fP name\&. (See XStringToKeysym(3 X11) for more information\&.) .IP "\fBCOLOR(\fP\fBstring_expression\fP[\fB,FOREGROUND\fP|\fBBACKGROUND\fP]\fB)\fP" 10 .iX "UIL" "color values" .iX "UIL module" "color values" .iX "UIL specification file" "color values" .iX "UIL Functions" "COLOR" .iX "Color values" "defining in UIL" .IP "" 10 The \fBCOLOR\fP function supports the definition of colors\&. Using the \fBCOLOR\fP function, you can designate a value to specify a color and then use that value for arguments requiring a color value\&. The string expression names the color you want to define; the optional keywords \fBFOREGROUND\fP and \fBBACKGROUND\fP identify how the color is to be displayed on a monochrome device when the color is used in the definition of a color table\&. .IP "" 10 The UIL compiler does not have built-in color names\&. Colors are a server-dependent attribute of an object\&. Colors are defined on each server and may have different red-green-blue (RGB) values on each server\&. The string you specify as the color argument must be recognized by the server on which your application runs\&. .IP "" 10 In a UID file, UIL represents a color as a character string\&. MRM calls X translation routines that convert a color string to the device-specific pixel value\&. If you are running on a monochrome server, all colors translate to black or white\&. If you are on a color server, the color names translate to their proper colors if the following conditions are met: .RS .IP " \(bu" 6 The color is defined\&. .IP " \(bu" 6 The color map is not yet full\&. .RE .IP "" 10 If the color map is full, even valid colors translate to black or white (foreground or background)\&. .IP "" 10 Interfaces do not, in general, specify colors for widgets, so that the selection of colors can be controlled by the user through the \fB\&.Xdefaults\fP file\&. .IP "" 10 To write an application that runs on both monochrome and color devices, you need to specify which colors in a color table (defined with the \fBCOLOR_TABLE\fP function) map to the background and which colors map to the foreground\&. UIL lets you use the \fBCOLOR\fP function to designate this mapping in the definition of the color\&. The following example shows how to use the \fBCOLOR\fP function to map the color red to the background color on a monochrome device: .PP .nf \f(CWVALUE c: COLOR ( \&'red\&',BACKGROUND );\fR .fi .PP .IP "" 10 The mapping comes into play only when the MRM is given a color and the application is to be displayed on a monochrome device\&. In this case, each color is considered to be in one of the following three categories: .RS .IP " \(bu" 6 The color is mapped to the background color on the monochrome device\&. .IP " \(bu" 6 The color is mapped to the foreground color on the monochrome device\&. .IP " \(bu" 6 Monochrome mapping is undefined for this color\&. .RE .IP "" 10 If the color is mapped to the foreground or background color, MRM substitutes the foreground or background color, respectively\&. If you do not specify the monochrome mapping for a color, MRM passes the color string to the Motif Toolkit for mapping to the foreground or background color\&. .IP "\fBRGB(\fP\fIred_integer\fP,\ \fIgreen_integer\fP, \fIblue_integer\fP\fB)\fP" 10 .iX "UIL" "color values" .iX "UIL module" "color values" .iX "UIL specification file" "color values" .iX "UIL Functions" "RGB" .iX "Color values" "defining in UIL" .IP "" 10 The three integers define the values for the red, green, and blue components of the color, in that order\&. The values of these components can range from 0 to 65,535, inclusive\&. The values may be represented as integer expressions\&. .IP "" 10 In a UID file, UIL represents an \fBRGB\fP value as three integers\&. MRM calls X translation routines that convert the integers to the device-specific pixel value\&. If you are running on a monochrome server, all colors translate to black or white\&. If you are on a color server, \fBRGB\fP values translate to their proper colors if the colormap is not yet full\&. If the colormap is full, values translate to black or white (foreground or background)\&. .IP "\fBCOLOR_TABLE(\fP\fIcolor_expression\fP\fB=\&'\fP\fIcharacter\fP\fB\&'\fP[,\&.\&.\&.]\fB)\fP" 10 .iX "COLOR_TABLE Function" .IP "" 10 The color expression is a previously defined color, a color defined in line with the \fBCOLOR\fP function, or the phrase \fBBACKGROUND COLOR\fP or \fBFOREGROUND COLOR\fP\&. The character can be any valid UIL character\&. .IP "" 10 The \fBCOLOR_TABLE\fP function provides a device-independent way to specify a set of colors\&. The \fBCOLOR_TABLE\fP function accepts either previously defined UIL color names or in line color definitions (using the \fBCOLOR\fP function)\&. A color table must be private because its contents must be known by the UIL compiler to construct an icon\&. The colors within a color table, however, can be imported, exported, or private\&. .IP "" 10 The single letter associated with each color is the character you use to represent that color when creating an icon\&. Each letter used to represent a color must be unique within the color table\&. .IP "\fBICON(\fP[\fBCOLOR_TABLE=\fP\fIcolor_table_name\fP,]\ \fIrow\fP[,\&.\&.\&.\fB)\fP" 10 \fIcolor-table-name\fP must refer to a previously defined color table, and \fIrow\fP is a character expression giving one row of the icon\&. .IP "" 10 The \fBICON\fP function describes a rectangular icon that is x pixels wide and y pixels high\&. The strings surrounded by single quotation marks describe the icon\&. Each string represents a row in the icon; each character in the string represents a pixel\&. .IP "" 10 The first row in an icon definition determines the width of the icon\&. All rows must have the same number of characters as the first row\&. The height of the icon is dictated by the number of rows\&. The maximum number of rows is 999\&. .IP "" 10 The first argument of the \fBICON\fP function (the color table specification) is optional and identifies the colors that are available in this icon\&. By using the single letter associated with each color, you can specify the color of each pixel in the icon\&. The icon must be constructed of characters defined in the specified color table\&. .IP "" 10 A default color table is used if you omit the argument specifying the color table\&. To make use of the default color table, the rows of your icon must contain only spaces and asterisks\&. The default color table is defined as follows: .PP .nf \f(CWCOLOR_TABLE( BACKGROUND COLOR = \&' \&', FOREGROUND COLOR = \&'*\&')\fR .fi .PP .IP "" 10 You can define other characters to represent the background color and foreground color by replacing the space and asterisk in the \fBBACKGROUND COLOR\fP and \fBFOREGROUND COLOR\fP clauses shown in the previous statement\&. You can specify icons as private, imported, or exported\&. Use the MRM function \fBMrmFetchIconLiteral\fP to retrieve an exported icon at run time\&. .IP "\fBXBITMAPFILE(\fP\fBstring_expression\fP\fB)\fP" 10 The \fBXBITMAPFILE\fP function is similar to the \fBICON\fP function in that both describe a rectangular icon that is x pixels wide and y pixels high\&. However, \fBXBITMAPFILE\fP allows you to specify an external file containing the definition of an X bitmap, whereas all \fBICON\fP function definitions must be coded directly within UIL\&. X bitmap files can be generated by many different X applications\&. UIL reads these files through the \fBXBITMAPFILE\fP function, but does not support creation of these files\&. The X bitmap file specified as the argument to the \fBXBITMAPFILE\fP function is read at application run time by MRM\&. .IP "" 10 The \fBXBITMAPFILE\fP function returns a value of type \fIpixmap\fP and can be used anywhere a pixmap data type is expected\&. .IP "\fBSINGLE_FLOAT(\fP\fIreal_number_literal\fP\fB)\fP" 10 .iX "UIL" "floating-point values" .iX "UIL module" "floating-point values" .iX "UIL specification file" "floating-point values" .iX "UIL Functions" "SINGLE_FLOAT" .iX "Floating-point values" .IP "" 10 The \fBSINGLE_FLOAT\fP function lets you store floating-point literals in UIL files as single-precision, floating-point numbers\&. Single-precision floating-point numbers can often be stored using less memory than double-precision, floating-point numbers\&. The \fIreal_number_literal\fP can be either an integer literal or a floating-point literal\&. .IP "\fBFLOAT(\fP\fIreal_number_literal\fP\fB)\fP" 10 .iX "UIL" "floating-point values" .iX "UIL module" "floating-point values" .iX "UIL specification file" "floating-point values" .iX "UIL Functions" "FLOAT" .iX "Floating-point values" .IP "" 10 The \fBFLOAT\fP function lets you store floating-point literals in UIL files as double-precision, floating-point numbers\&. The \fIreal_number_literal\fP can be either an integer literal or a floating-point literal\&. .IP "\fBFONT(\fP\fBstring_expression\fP[\fB,\ CHARACTER_SET=\fP\fIchar_set\fP]\fB)\fP" 10 .iX "UIL" "font values" .iX "UIL module" "font values" .iX "UIL specification file" "font values" .iX "UIL Functions" "FONT" .iX "Font values" .IP "" 10 You define fonts with the \fBFONT\fP function\&. Using the \fBFONT\fP function, you designate a value to specify a font and then use that value for arguments that require a font value\&. The UIL compiler has no built-in fonts\&. .IP "" 10 Each font makes sense only in the context of a character set\&. The \fBFONT\fP function has an additional parameter to let you specify the character set for the font\&. This parameter is optional; if you omit it, the default character set depends on the value of the \fBLANG\fP environment variable if it is set, or on the value of \fBXmFALLBACK_CHARSET\fP if \fBLANG\fP is not set\&. .IP "" 10 \fBstring_expression\fP specifies the name of the font and the clause \fBCHARACTER_SET\fP = \fIchar_set\fP specifies the character set for the font\&. The string expression used in the \fBFONT\fP function cannot be a compound string\&. .IP "\fBFONTSET(\fP\fBstring_expression\fP[,\&.\&.\&.][\fB,\ CHARACTER_SET=\fP\fIcharset\fP]\fB)\fP" 10 .iX "UIL" "fontset value" .iX "UIL module" "fontset value" .iX "UIL specification file" "fontset value" .iX "Functions" "fontset value" .iX "UIL Functions" "FONT_TABLE" .iX "fontset value" "defining" .IP "" 10 You define fontsets with the \fBFONTSET\fP function\&. Using the \fBFONTSET\fP function, you designate a set of values to specify fonts and then use those values for arguments that require a fontset\&. The UIL compiler has no built-in fonts\&. .IP "" 10 Each font makes sense only in the context of a character set\&. The \fBFONTSET\fP function has an additional parameter to let you specify the character set for the font\&. This parameter is optional; if you omit it, the default character set depends on the value of the \fBLANG\fP environment variable if it is set, or on the value of \fBXmFALLBACK_CHARSET\fP if \fBLANG\fP is not set\&. .IP "" 10 The string expression specifies the name of the font and the clause \fBCHARACTER_SET\fP = \fIchar_set\fP specifies the character set for the font\&. The string expression used in the \fBFONTSET\fP function cannot be a compound string\&. .IP "\fBFONT_TABLE(\fP\fIfont_expression\fP[,\&.\&.\&.]\fB)\fP" 10 .iX "UIL" "font table value" .iX "UIL module" "font table value" .iX "UIL specification file" "font table value" .iX "Functions" "font table value" .iX "UIL Functions" "FONT_TABLE" .iX "Font table value" "defining" .IP "" 10 A font table is a sequence of pairs of fonts and character sets\&. At run time, when an object needs to display a string, the object scans the font table for the character set that matches the character set of the string to be displayed\&. UIL provides the \fBFONT_TABLE\fP function to let you supply such an argument\&. \fIfont_expression\fP is created with the \fBFONT\fP and \fBFONTSET\fP functions\&. .IP "" 10 If you specify a single font value to specify an argument that requires a font table, the UIL compiler automatically converts a font value to a font table\&. .IP "\fBCOMPOUND_STRING(\fP\fBstring_expression\fP[,\fIproperty\fP[,\&.\&.\&.]]\fB)\fP" 10 Use the \fBCOMPOUND_STRING\fP function to set properties of a null-terminated string and to convert it into a compound string\&. The properties you can set are the writing direction and separator\&. .IP "" 10 The result of the \fBCOMPOUND_STRING\fP function is a compound string with the string expression as its value\&. You can optionally include one or more of the following clauses to specify properties for the resulting compound string: .IP "" 10 \fBRIGHT_TO_LEFT\fP = \fIboolean_expression\fP \fBSEPARATE\fP = \fIboolean_expression\fP .IP "" 10 The \fBRIGHT_TO_LEFT\fP clause sets the writing direction of the string from right to left if \fIboolean_expression\fP is True, and left to right otherwise\&. Specifying this argument does not cause the value of the string expression to change\&. If you omit the \fBRIGHT_TO_LEFT\fP argument, the resulting string has the same writing direction as \fBstring_expression\fP\&. .IP "" 10 The \fBSEPARATE\fP clause appends a separator to the end of the compound string if \fIboolean_expression\fP is True\&. If you omit the \fBSEPARATE\fP clause, the resulting string does not have a separator\&. .IP "" 10 You cannot use imported or exported values as the operands of the \fBCOMPOUND_STRING\fP function\&. .IP "\fBCOMPOUND_STRING_COMPONENT\fP(\fIcomponent_type\fP [, {\fIstring\fP | \fIenumval\fP}])" 10 Use the \fBCOMPOUND_STRING_COMPONENT\fP function to create compound strings in UIL consisting of single components\&. This function is analagous to \fBXmStringComponentCreate\fP\&. This function lets you create simple compound strings containing components such as \fBXmSTRING_COMPONENT_TAB\fP and \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP which are not produced by the \fBCOMPOUND_STRING\fP function\&. These components can then be concatenated to other compound strings to build more complex compound strings\&. .IP "" 10 The first argument must be an \fBXmStringComponentType\fR enumerated constant\&. The type and interpretation of the second argument depends on the first argument\&. For example, if you specify any of the following enumerated constants for the first argument, then you should not specify a second argument: \fBXmSTRING_COMPONENT_SEPARATOR\fP, \fBXmSTRING_COMPONENT_LAYOUT_POP\fP, \fBXmSTRING_COMPONENT_TAB\fP, and \fBXmSTRING_COMPONENT_LOCALE\fP\&. However, if you specify an enumerated constant from the following group, then you must supply a \fIstring\fP as the second argument: \fBXmSTRING_COMPONENT_CHARSET\fP, \fBXmSTRING_COMPONENT_TEXT\fP, \fBXmSTRING_COMPONENT_LOCALE_TEXT\fP, \fBXmSTRING_COMPONENT_WIDECHAR_TEXT\fP, \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP, and \fBXmSTRING_COMPONENT_RENDITION_END\fP\&. If you specify \fBXmSTRING_COMPONENT_DIRECTION\fP as the first argument, then you must specify an \fBXmStringDirection\fR enumerated constant as the second argument\&. Finally, if you specify \fBXmSTRING_COMPONENT_LAYOUT_PUSH\fP as the first argument, then you must specify an \fBXmDirection\fR enumerated constant as the second argument\&. .IP "" 10 The compound string components \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP, and \fBXmSTRING_COMPONENT_RENDITION_END\fP take, for their argument, the "tag," or name, of a rendition from the current render table\&. See the following section for more information about how to specify a render table\&. .IP "\fBCOMPOUND_STRING_TABLE(\fP\fBstring_expression\fP[,\&.\&.\&.]\fB)\fP" 10 A compound string table is an array of compound strings\&. Objects requiring a list of string values, such as the \fBXmNitems\fP and \fBXmNselectedItems\fP arguments for the list widget, use string table values\&. The \fBCOMPOUND_STRING_TABLE\fP function builds the values for these two arguments of the list widget\&. The \fBCOMPOUND_STRING_TABLE\fP function generates a value of type \fIstring_table\fP\&. The name \fBSTRING_TABLE\fP is a synonym for \fBCOMPOUND_STRING_TABLE\fP\&. .IP "" 10 The strings inside the string table must be simple strings, which the UIL compiler automatically converts to compound strings\&. .IP "\fBASCIZ_STRING_TABLE(\fP\fBstring_expression\fP[,\&.\&.\&.]\fB)\fP" 10 An ASCIZ string table is an array of ASCIZ (null-terminated) string values separated by commas\&. This function allows you to pass more than one ASCIZ string as a callback tag value\&. The \fBASCIZ_STRING_TABLE\fP function generates a value of type \fBasciz_table\fP\&. The name \fBASCIZ_TABLE\fP is a synonym for \fBASCIZ_STRING_TABLE\fP\&. .IP "\fBWIDE_CHARACTER(\fP\fBstring_expression\fP\fB)\fP" 10 .iX "UIL" "wide character strings" .iX "UIL module" "wide character strings" .iX "UIL specification file" "wide character strings" .iX "UIL Functions" "WIDE_CHARACTER" .iX "wide character strings" "defining in UIL" .IP "" 10 Use the \fBWIDE_CHARACTER\fP function to generate a wide character string from null-terminated string in the current locale\&. .IP "\fBCLASS_REC_NAME(\fP\fBstring_expression\fP\fB)\fP" 10 .iX "UIL" "widget class names" .iX "UIL module" "widget class names" .iX "UIL specification file" "widget class names" .iX "UIL Functions" "CLASS_REC_NAME" .iX "widget class names" "defining in UIL" .IP "" 10 Use the \fBCLASS_REC_NAME\fP function to generate a widget class name\&. For a widget class defined by the toolkit, the string argument is the name of the class\&. For a user-defined widget, the string argument is the name of the creation routine for the widget\&. .IP "\fBINTEGER_TABLE(\fP\fIinteger_expression\fP[,\&.\&.\&.]\fB)\fP" 10 An integer table is an array of integer values separated by commas\&. This function allows you to pass more than one integer per callback tag value\&. The \fBINTEGER_TABLE\fP function generates a value of type \fBinteger_table\fP\&. .IP "\fBARGUMENT(\fP\fBstring_expression\fP[,\ \fIargument_type\fP]\fB)\fP" 10 .iX "UIL" "argument values" .iX "UIL module" "argument values" .iX "UIL specification file" "argument values" .iX "UIL Functions" "ARGUMENT" .iX "Argument values" "defining in UIL" .IP "" 10 The \fBARGUMENT\fP function defines the arguments to a user-defined widget\&. Each of the objects that can be described by UIL permits a set of arguments, listed in Appendix B\&. For example, \fBXmNheight\fP is an argument to most objects and has an integer data type\&. To specify height for a user-defined widget, you can use the built-in argument name \fBXmNheight\fP, and specify an integer value when you declare the user-defined widget\&. You do not use the \fBARGUMENT\fP function to specify arguments that are built into the UIL compiler\&. .IP "" 10 The \fBstring_expression\fP name is the name the UIL compiler uses for the argument in the UID file\&. \fIargument_type\fP is the type of value that can be associated with the argument\&. If you omit the second argument, the default type is \fBANY\fP and no value type checking occurs\&. Use one of the following keywords to specify the argument type: .RS .IP " \(bu" 6 ANY .IP " \(bu" 6 ASCIZ_TABLE .IP " \(bu" 6 BOOLEAN .IP " \(bu" 6 COLOR .IP " \(bu" 6 COMPOUND_STRING .IP " \(bu" 6 FLOAT .IP " \(bu" 6 FONT .IP " \(bu" 6 FONT_TABLE .IP " \(bu" 6 FONTSET .IP " \(bu" 6 ICON .IP " \(bu" 6 INTEGER .IP " \(bu" 6 INTEGER_TABLE .IP " \(bu" 6 KEYSYM .IP " \(bu" 6 PIXMAP .IP " \(bu" 6 REASON .IP " \(bu" 6 SINGLE_FLOAT .IP " \(bu" 6 STRING .IP " \(bu" 6 STRING_TABLE .IP " \(bu" 6 TRANSLATION_TABLE .IP " \(bu" 6 WIDE_CHARACTER .IP " \(bu" 6 WIDGET .RE .IP "" 10 You can use the \fBARGUMENT\fP function to allow the UIL compiler to recognize extensions to the Motif Toolkit\&. For example, an existing widget may accept a new argument\&. Using the \fBARGUMENT\fP function, you can make this new argument available to the UIL compiler before the updated version of the compiler is released\&. .IP "\fBREASON(\fP\fBstring_expression\fP\fB)\fP" 10 .iX "UIL" "reason value" .iX "UIL Functions" "reason value" .iX "UIL module" "reason value" .iX "UIL specification file" "reason value" .iX "Functions" "reason value" .iX "Reason value" .IP "" 10 The \fBREASON\fP function is useful for defining new reasons for user-defined widgets\&. .IP "" 10 Each of the objects in the Motif Toolkit defines a set of conditions under which it calls a user-defined function\&. These conditions are known as callback reasons\&. The user-defined functions are termed callback procedures\&. In a UIL module, you use a callbacks list to specify which user-defined functions are to be called for which reasons\&. .IP "" 10 Appendix B lists the callback reasons supported by the Motif Toolkit objects\&. .IP "" 10 When you declare a user-defined widget, you can define callback reasons for that widget using the \fBREASON\fP function\&. The string expression specifies the argument name stored in the UID file for the reason\&. This reason name is supplied to the widget creation routine at run time\&. .IP "\fBTRANSLATION_TABLE(\fP\fBstring_expression\fP[,\&.\&.\&.]\fB)\fP" 10 .iX "UIL" "translation table value" .iX "UIL module" "translation table value" .iX "UIL specification file" "translation table value" .iX "Functions" "translation table value" .iX "Translation table value" .IP "" 10 Each of the Motif Toolkit widgets has a translation table that maps X events (for example, mouse button 1 being pressed) to a sequence of actions\&. Through widget arguments, such as the common translations argument, you can specify an alternate set of events or actions for a particular widget\&. The \fBTRANSLATION_TABLE\fP function creates a translation table that can be used as the value of an argument that is of the data type \fBtranslation_table\fP\&. .IP "" 10 You can use one of the following translation table directives with the \fBTRANSLATION_TABLE\fP function: \fB#override\fP, \fB#augment\fP, or \fB#replace\fP\&. The default is \fB#replace\fP\&. If you specify one of these directives, it must be the first entry in the translation table\&. .IP "" 10 The \fB#override\fP directive causes any duplicate translations to be ignored\&. For example, if a translation for <\fBBtn1Down\fP> is already defined in the current translations for a PushButton, the translation defined by \fInew_translations\fP overrides the current definition\&. If the \fB#augment\fP directive is specified, the current definition takes precedence\&. The \fB#replace\fP directive replaces all current translations with those specified in the \fBXmNtranslations\fP resource\&. .SS "Renditions and Render Tables" .iX "Renditions" .iX "Render Tables" .PP In addition to the string direction, each compound string carries a great deal of information about how its text is to be rendered\&. Each compound string contains a "tag," identifying the "rendition" to be used to draw that string\&. The rendition contains such information as the font, the size, the color, whether the text is to be underlined or crossed out, and the position and style of any tab stops\&. Many renditions are combined into a "render table," which is specified to any widget with the \fBXmNrenderTable\fP resource, and in the widget\&'s \fIcontrols\fP list\&. .PP UIL implements render tables, renditions, tab lists, and tab stops as a special class of objects, in a form similar to the widget class\&. These objects are not themselves widgets or gadgets, but the format used by UIL to specify widget resources provides a convenient way to specify the qualities and dependencies of these objects\&. .PP For example, a render table, included in some widget\&'s \fIcontrols\fP list, must also have a \fIcontrols\fP list in its specification, containing the names of its member renditions\&. Each rendition, in its specification, will contain an \fIarguments\fP list specifying such qualities as the font, the color, and whether the text is to be underlined\&. Any of the renditions may also control a tablist, which will itself control one or more tab stops\&. .PP Please refer to the \fIMotif Programmer\&'s Guide\fP for a complete description of renditions and render tables, and for an example of how to use them in UIL\&. .SH "RELATED INFORMATION" .PP \fBuil\fP(1), \fBUil\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:37 motif-2.3.8/doc/man/man5/Traits.50000644000175000017500000003140512672140200013274 00000000000000'\" t ...\" Traits.sgm /main/10 1996/09/08 21:23:02 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "Traits" "file formats" .SH "NAME" \fBTraits\fP \(em Lists the traits used by the Motif Toolkit\&. .iX "Traits" .SH "DESCRIPTION" .PP A trait is a characteristic of a widget\&. A widget holding a particular trait is announcing a particular ability to other widgets\&. The following table summarizes the standard Motif traits\&. .PP .TS tab() box; c s l| l. \fBPurpose of Each Trait\fP \fBTrait Name\fPT{ \fBA Widget Holding This Trait Can Do The Following:\fP T} __ \fBXmQTaccessTextual\fPDisplay one primary text parcel\&. __ \fBXmQTactivatable\fPT{ Become a command button in a dialog box\&. T} __ \fBXmQTcareParentVisual\fPT{ Borrow its parent\&'s visual information\&. T} __ \fBXmQTcontainer\fPManage container item children\&. __ \fBXmQTcontainerItem\fPT{ Become a child of a container widget\&. T} __ \fBXmQTdialogShellSavvy\fPBecome a child of a DialogShell\&. __ \fBXmQTjoinSide\fPT{ Attach itself to one side of a suitable parent\&. T} __ \fBXmQTmenuSavvy\fPBecome a menu child\&. __ \fBXmQTmenuSystem\fPManage a menu system\&. __ \fBXmQTnavigator\fPT{ Act as a navigator to a scrollable widget\&. T} __ \fBXmQTscrollFrame\fPT{ Handle one or more navigator widgets\&. T} __ \fBXmQTspecifyRenderTable\fPT{ Supply the names of its default render tables\&. T} __ \fBXmQTtakesDefault\fPT{ Change its appearance to show that it is the default button\&. T} __ \fBXmQTtransfer\fPT{ Transfer data to other widgets and/or receive data from other widgets T} __ .TE .PP Traits are not often used in Motif application programs\&. However, traits are very important to widget writers\&. For complete details on traits, see the \fIMotif Widget Writer\&'s Guide\fP\&. .PP The following table lists the names of all widgets and gadgets in the standard Motif widget set that hold a particular trait\&. For example, the following table shows that the \fBXmQTcontainerItem\fP trait is held by the \fBXmIconGadget\fR\&. As the table suggests, some traits are held by many of the standard Motif widgets\&. .PP .TS tab() box; c s l| l. T{ \fBTrait Installation in Standard Widget Set\fP T} \fBTrait Name\fPT{ \fBIs Installed on The Following Widgets:\fP T} __ \fBXmQTaccessTextual\fPT{ \fBXmLabel\fP and all its subclasses; \fBXmLabelGadget\fP and all its subclasses; \fBXmText; XmTextField\fP T} __ \fBXmQTactivatable\fPT{ \fBXmArrowButton; XmArrowButtonGadget; XmDrawnButton; XmPushButton; XmPushButtonGadget\fP T} __ \fBXmQTcareParentVisual\fPT{ All the subclasses of \fBXmGadget\fP (but not \fBXmGadget\fP itself); \fBXmPrimitive\fP and all its subclasses T} __ \fBXmQTcontainer\fP\fBXmContainer\fP __ \fBXmQTcontainerItem\fP\fBXmIconGadget\fR __ \fBXmQTdialogShellSavvy\fP\fBXmBulletinBoard\fP __ \fBXmQTjoinSide\fPNo widgets install this trait __ \fBXmQTmenuSavvy\fPT{ \fBXmLabel; XmDrawnButton; XmCascadeButton; XmPushButton; XmToggleButton; XmLabelGadget; XmCascadeButtonGadget; XmPushButtonGadget; XmToggleButtonGadget\fP T} __ \fBXmQTmenuSystem\fP\fBXmRowColumn\fP __ \fBXmQTnavigator\fP\fBXmScrollBar; XmSpinBox\fP __ \fBXmQTscrollFrame\fP\fBXmNotebook; XmScrolledWindow\fP __ \fBXmQTspecifyRenderTable\fPT{ \fBXmBulletinBoard\fP and all its subclasses; \fBXmMenuShell; XmVendorShell\fP T} __ \fBXmQTtakesDefault\fP\fBXmPushButton; XmPushButtonGadget\fP __ \fBXmQTtransfer\fPT{ \fBXmContainer; XmLabel\fP and all its subclasses; \fBXmLabelGadget\fP and all its subclasses; \fBXmList; XmScale; XmText; XmTextField\fP T} __ .TE .PP The following table lists the traits installed on each widget\&. For example, the following table indicates that the \fBXmArrowButton\fP widget holds both the \fBXmQTactivatable\fP and \fBXmQTcareParentVisual\fP traits\&. .TS tab() box; c s l| l. \fBTrait Use by Widget\fP \fBWidget Name\fP\fBInstalls These Traits\fP __ \fB=\fP __ \fBXmArrowButton\fPT{ \fBXmQTactivatable, XmQTcareParentVisual\fP T} __ \fBXmArrowButtonGadget\fPT{ \fBXmQTactivatable, XmQTcareParentVisual\fP T} __ \fBXmBulletinBoard\fPT{ \fBXmQTdialogShellSavvy, XmQTspecifyRenderTable\fP T} __ \fBXmCascadeButton\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTmenuSavvy, XmQTtransfer\fP T} __ \fBXmCascadeButtonGadget\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTmenuSavvy, XmQTtransfer XmComboBox\fP T} __ \fBXmCommand\fP\fBXmQTspecifyRenderTable\fP __ \fBXmContainer\fP\fBXmQTcontainer, XmQTtransfer\fP __ \fBXmDialogShell\fPNone __ \fBXmDisplay\fPNone __ \fBXmDragContext\fPNone __ \fBXmDragIcon\fPNone __ \fBXmDrawingArea\fPNone __ \fBXmDrawnButton\fPT{ \fBXmQTaccessTextual, XmQTactivatable, XmQTcareParentVisual, XmQTmenuSavvy, XmQTtransfer\fP T} __ \fBXmDropTransfer\fPNone __ \fBXmFileSelectionBox\fP\fBXmQTspecifyRenderTable\fP __ \fBXmForm\fP\fBXmQTspecifyRenderTable\fP __ \fBXmFrame\fPNone __ \fBXmGadget\fPNone __ \fBXmIconGadget\fRT{ \fBXmQTcareParentVisual, XmQTcontainerItem\fP T} __ \fBXmLabel\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTmenuSavvy, XmQTtransfer\fP T} __ \fBXmLabelGadget\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTmenuSavvy, XmQTtransfer\fP T} __ \fBXmList\fP\fBXmQTcareParentVisual, XmQTtransfer\fP __ \fBXmMainWindow\fP __ \fBXmManager\fP __ \fBXmMenuShell\fP\fBXmQTspecifyRenderTable\fP __ \fBXmMessageBox\fP\fBXmQTspecifyRenderTable\fP __ \fBXmNotebook\fP\fBXmQTscrollFrame\fP __ \fBXmPanedWindow\fP __ \fBXmPrimitive\fP\fBXmQTcareParentVisual\fP __ \fBXmPushButton\fPT{ \fBXmQTaccessTextual, XmQTactivatable, XmQTcareParentVisual, XmQTmenuSavvy, XmQTtakesDefault, XmQTtransfer\fP T} __ \fBXmPushButtonGadget\fPT{ \fBXmQTaccessTextual, XmQTactivatable, XmQTcareParentVisual, XmQTmenuSavvy, XmQTtakesDefault, XmQTtransfer\fP T} __ \fBXmRowColumn\fP\fBXmQTmenuSystem\fP __ \fBXmScale\fP\fBXmQTtransfer\fP __ \fBXmScreen\fP __ \fBXmScrollbar\fP\fBXmQTcareParentVisual, XmQTnavigator\fP __ \fBXmScrolledWindow\fP\fBXmQTscrollFrame\fP __ \fBXmSelectionBox\fP\fBXmQTspecifyRenderTable\fP __ \fBXmSeparator\fP\fBXmQTcareParentVisual\fP __ \fBXmSeparatorGadget\fP\fBXmQTcareParentVisual\fP __ \fBXmSpinBox\fP\fBXmQTnavigator\fP __ \fBXmText\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTtransfer\fP T} __ \fBXmTextField\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTtransfer\fP T} __ \fBXmToggleButton\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTtransfer\fP T} __ \fBXmToggleButtonGadget\fPT{ \fBXmQTaccessTextual, XmQTcareParentVisual, XmQTtransfer\fP T} __ \fBVendorShell\fP\fBXmQTspecifyRenderTable\fP __ .TE .PP The following table summarizes how the standard Motif widgets access traits\&. There are two general ways for a widget to access the traits of another widget\&. .PP One way is for a widget to ask another widget if it holds a particular trait\&. For example, \fBXmBulletinBoard\fP asks each of its children widgets if they hold the \fBXmQTtakesDefault\fP trait\&. \fBXmBulletinBoard\fP calls none of the trait methods of \fBXmQTtakesDefault\fP\&. .PP Another kind of access is when one widget calls another widget\&'s trait method(s)\&. For example, \fBXmBulletinBoard\fP calls the \fBgetRenderTable\fP trait method of the \fBXmQTspecifyRenderTable\fP trait\&. .TS tab() box; c s s l| l| l. \fBTrait Access By Widget\fP \fBWidget\fP\fBAccesses These Traits:\fP\fBCalls These Trait Methods:\fP ___ \fBXmArrowButton\fPNoneNone ___ \fBXmArrowButtonGadget\fPNoneNone ___ \fBXmBulletinBoard\fP\fBXmQTtakesDefault\fPNone ___ \fBXmBulletinBoard\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmCascadeButton\fP\fBXmQTmenuSystem\fPMany ___ \fBXmCascadeButton\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmCascadeButtonGadget\fP\fBXmQTmenuSystem\fPMany ___ \fBXmCascadeButtonGadget\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmComboBox\fP\fBXmQTaccessTextual\fP\fBgetValue, setValue\fP ___ \fBXmCommand\fPNoneNone ___ \fBXmContainer\fP\fBXmQTcontainerItem\fP\fBgetValues, setValues\fP ___ \fBXmContainer\fP\fBXmQTscrollFrame\fP\fBgetInfo\fP ___ \fBXmDialogShell\fP\fBXmQTdialogShellSavvy\fP\fBcallMapUnmapCB\fP ___ \fBXmDisplay\fPNoneNone ___ \fBXmDragContext\fPNoneNone ___ \fBXmDragIcon\fPNoneNone ___ \fBXmDrawingArea\fPNoneNone ___ \fBXmDrawnButton\fP\fBXmQTmenuSystem\fPMany ___ \fBXmDrawnButton\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmDropTransfer\fPNoneNone ___ \fBXmFileSelectionBox\fP\fBXmQTactivatable\fPNone ___ \fBXmForm\fPNoneNone ___ \fBXmFrame\fPNoneNone ___ \fBXmGadget\fPNoneNone ___ \fBXmIconGadget\fR\fBXmQTcontainer\fP\fBgetValues\fP ___ \fBXmIconGadget\fR\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmLabel\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmLabel\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmLabelGadget\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmLabelGadget\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmList\fP\fBXmQTnavigator\fP\fBgetValues\fP ___ \fBXmList\fP\fBXmQTscrollFrame\fP\fBgetInfo, init\fP ___ \fBXmList\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmMainWindow\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmManager\fPNoneNone ___ \fBXmMenuShell\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmMenuShell\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmMessageBox\fP\fBXmQTactivatable\fPNone ___ \fBXmNotebook\fP\fBXmQTscrollFrame\fP\fBinit, addNavigator, removeNavigator\fP ___ \fBXmNotebook\fP\fBXmQTnavigator\fP\fBgetValue\fP ___ \fBXmNotebook\fP\fBXmQTactivatable\fP\fBchangeCB\fP ___ \fBXmNotebook\fP\fBXmQTaccessTextual\fPNone ___ \fBXmPanedWindow\fPNoneNone ___ \fBXmPrimitive\fPNoneNone ___ \fBXmPushButton\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmPushButton\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmPushButtonGadget\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmPushButtonGadget\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmRowColumn\fP\fBXmQTmenuSavvy\fPT{ \fBgetAccelerator, getMnemonic, getActivateCBName\fP T} ___ \fBXmRowColumn\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmScale\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmScreen\fPNoneNone ___ \fBXmScrollbar\fPNoneNone ___ \fBXmScrolledWindow\fP\fBXmQTnavigator\fP\fBgetValue\fP ___ \fBXmScrolledWindow\fP\fBXmQTscrollFrame\fP\fBinit, addNavigator\fP ___ \fBXmSelectionBox\fP\fBXmQTaccessTextual\fP\fBsetValue;\fP ___ \fBXmSelectionBox\fP\fBXmQTactivatable\fPNone ___ \fBXmSeparator\fPNoneNone ___ \fBXmSeparatorGadget\fPNoneNone ___ \fBXmSpinBox\fP\fBXmQTaccessTextual\fP\fBsetValue\fP ___ \fBXmText\fP\fBXmQTaccessTextual\fP\fBgetValue, setValue\fP ___ \fBXmText\fP\fBXmQTnavigator\fP\fBgetValue\fP ___ \fBXmText\fP\fBXmQTscrollFrame\fP\fBgetInfo, init\fP ___ \fBXmText\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmTextField\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmToggleButton\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmToggleButton\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBXmToggleButtonGadget\fP\fBXmQTmenuSystem\fP\fBvarious methods\fP ___ \fBXmToggleButtonGadget\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ \fBVendorShell\fP\fBXmQTspecifyRenderTable\fP\fBgetRenderTable\fP ___ .TE .SH "RELATED" .PP The following reference pages are documented in the \fIMotif Widget Writer\&'s Guide\fP: \fBXmeTraitSet\fP(3), \fBXmeTraitGet\fP(3), \fBXmQTaccessTextual\fP(3), \fBXmQTactivatable\fP(3), \fBXmQTcareParentVisual\fP(3), \fBXmQTcontainer\fP(3), \fBXmQTcontainerItem\fP(3), \fBXmQTdialogShellSavvy\fP(3), \fBXmQTjoinSide\fP(3), \fBXmQTmenuSavvy\fP(3), \fBXmQTmenuSystem\fP(3), \fBXmQTnavigator\fP(3), \fBXmQTscrollFrame\fP(3), \fBXmQTspecifyRenderTable\fP(3), and \fBXmQTtakesDefault\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man5/Makefile.am0000644000175000017500000000016012672140200013766 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = \ Traits.5 \ UIL.5 \ WML.5 motif-2.3.8/doc/man/man3/0000755000175000017500000000000013211513006012011 500000000000000motif-2.3.8/doc/man/man3/XmListSetItem.30000644000175000017500000000313312672140200014532 00000000000000'\" t ...\" LstSetIt.sgm /main/7 1996/08/30 15:47:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSetItem" "library call" .SH "NAME" \fBXmListSetItem\fP \(em A List function that makes an existing item the first visible item in the list .iX "XmListSetItem" .iX "List functions" "XmListSetItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSetItem\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSetItem\fP makes the first item in the list that matches \fIitem\fP the first visible item in the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget from whose list an item is made the first visible .IP "\fIitem\fP" 10 Specifies the item .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmImGetXIC.30000644000175000017500000000470712672140200013705 00000000000000'\" t ...\" ImGetXIC.sgm /main/9 1996/09/08 20:47:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImGetXIC" "library call" .SH "NAME" \fBXmImGetXIC\fP \(em An input manager function that obtains an XIC for a widget .iX "XmImGetXIC" .iX "input manager functions" "XmImGetXIC" .SH "SYNOPSIS" .PP .nf #include \fBXIC \fBXmImGetXIC\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmInputPolicy \fBinput_policy\fR\fR, \fBArgList \fBargs\fR\fR, \fBCardinal \fBnum_args\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImGetXIC\fP creates and registers an X Input Context (XIC) with the specified arguments for \fIwidget\fP\&. If \fBXmINHERIT_POLICY\fP is specified for \fIinput_policy\fP, a new XIC will be created only if required to by the arguments or by the \fBVendorShell\fP input policy\&. Any existing XIC registered with \fIwidget\fP is unregistered\&. .PP Refer to the \fBVendorShell\fP reference page for further details\&. .IP "\fIwidget\fP" 10 Specifies the ID of a widget for which an Input Context is to be created\&. .IP "\fIinput_policy\fP" 10 Specifies the type of input policy\&. It accepts the following values: .RS .IP "\fBXmINHERIT_POLICY\fP" 10 Inherits the policy from \fBVendorShell\fP\&. .IP "\fBXmPER_WIDGET\fP" 10 Creates a new XIC for this widget\&. .IP "\fBXmPER_SHELL\fP" 10 Creates a new XIC for the shell, if needed\&. .RE .IP "\fIargs\fP" 10 Specifies an \fBXtArgList\fP parameter to use for creating the XIC\&. .IP "\fInum_args\fP" 10 Specifies the number of arguments in the \fIargs\fP parameter\&. .SH "RETURN" .PP Returns the created XIC\&. The application is responsible for freeing the returned XIC by calling \fBXmImFreeXIC\fP\&. .SH "RELATED" .PP \fBXmImSetXIC\fP(3) and \fBXmImFreeXIC\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmTextSetStringWcs.30000644000175000017500000000413612672140200015574 00000000000000'\" t ...\" TxtSetSD.sgm /main/8 1996/09/08 21:20:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetStringWcs" "library call" .SH "NAME" \fBXmTextSetStringWcs\fP \(em A Text function that sets a wide character string value .iX "XmTextSetStringWcs" .iX "Text functions" "XmTextSetStringWcs" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetStringWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBwchar_t *\fBwcstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetStringWcs\fP sets the wide character string value of the Text widget\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. This function also sets the insertion cursor position to the beginning of the string and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIvalue\fP" 10 Specifies the wide character string value .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextSetString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmGetTabGroup.30000644000175000017500000000345612672140200014517 00000000000000'\" t ...\" GetTabGr.sgm /main/7 1996/08/30 15:28:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetTabGroup" "library call" .SH "NAME" \fBXmGetTabGroup\fP \(em Returns the widget ID of a tab group .iX "XmGetTabGroup" .iX "traversal functions" "XmGetTabGroup" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetTabGroup\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetTabGroup\fP returns the widget ID of the tab group that contains the specified widget\&. .IP "\fIwidget\fP" 10 Specifies a widget ID within a tab group .SH "RETURN" .PP Returns the widget ID of a tab group or shell, determined as follows: .IP " \(bu" 6 If \fIwidget\fP is a tab group or shell, returns \fIwidget\fP .IP " \(bu" 6 If neither \fIwidget\fP nor any ancestor up to the nearest shell is a tab group, returns the nearest ancestor of \fIwidget\fP that is a shell .IP " \(bu" 6 Otherwise, returns the nearest ancestor of \fIwidget\fP that is a tab group .SH "RELATED" .PP \fBXmAddTabGroup\fP(3), \fBXmManager\fP(3), and \fBXmPrimitive\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmVaCreateSimpleMenuBar.30000644000175000017500000001003312672140200016437 00000000000000'\" t ...\" VaCreB.sgm /main/9 1996/09/08 21:21:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmVaCreateSimpleMenuBar" "library call" .SH "NAME" \fBXmVaCreateSimpleMenuBar\fP \(em A RowColumn widget convenience creation function .iX "XmVaCreateSimpleMenuBar" .iX "creation functions" "XmVaCreateSimpleMenuBar" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmVaCreateSimpleMenuBar\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmVaCreateSimpleMenuBar\fP creates an instance of a RowColumn widget of type \fBXmMENU_BAR\fP and returns the associated widget ID\&. This routine uses the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP This routine creates a MenuBar and its CascadeButtonGadget children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. Buttons are named and created in the order in which they are specified in the variable portion of the argument list\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .PP The variable portion of the argument list consists of groups of arguments\&. The first argument in each group is a constant or a string and determines which arguments follow in that group\&. The last argument in the list must be NULL\&. Following are the possible first arguments in each group of \fIvarargs\fP: .IP "\fBXmVaCASCADEBUTTON\fP" 10 This is followed by two additional arguments\&. The set specifies one button in the MenuBar and some of its resource values\&. Following are the additional two arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .RE .IP "\fIresource_name\fP" 10 This is followed by one additional argument, the value of the resource, of type \fBXtArgVal\fP\&. The pair specifies a resource and its value for the RowColumn widget\&. .IP "\fBXtVaTypedArg\fP" 10 This is followed by four additional arguments\&. The set specifies a resource and its value for the RowColumn widget\&. A resource type conversion is performed if necessary\&. Following are the additional four arguments, in order: .RS .IP "\fIname\fP" 10 The resource name, of type \fBString\fR .IP "\fItype\fP" 10 The type of the resource value supplied, of type \fBString\fR .IP "\fIvalue\fP" 10 The resource value (or a pointer to the resource value, depending on the type and size of the value), of type \fBXtArgVal\fP .IP "\fIsize\fP" 10 The size of the resource value in bytes, of type \fIint\fP .RE .IP "\fBXtVaNestedList\fP" 10 This is followed by one additional argument of type \fBXtVarArgsList\fP\&. This argument is a nested list of \fIvarargs\fP returned by \fBXtVaCreateArgsList\fP\&. .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateMenuBar\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleMenuBar\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmDataFieldCopy.30000644000175000017500000000412112672140200014772 00000000000000'\" t ...\" TxtFieAC.sgm /main/8 1996/09/08 21:12:45 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldCopy" "library call" .SH "NAME" \fBXmDataFieldCopy\fP \(em A DataField function that copies the primary selection to the clipboard .iX "XmDataFieldCopy" .iX "DataField functions" "XmDataFieldCopy" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmDataFieldCopy\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldCopy\fP copies the primary selected text to the clipboard\&. .PP This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmCOPY\fP\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID\&. .IP "\fItime\fP" 10 Specifies the time at which the selection value is to be modified\&. This should be the time of the event that triggered this request\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. motif-2.3.8/doc/man/man3/XmCvtXmStringToCT.30000644000175000017500000000661012672140200015311 00000000000000'\" t ...\" CvtXmStC.sgm /main/8 1996/08/31 15:21:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCvtXmStringToCT" "library call" .SH "NAME" \fBXmCvtXmStringToCT\fP \(em A compound string function that converts a compound string to compound text .iX "XmCvtXmStringToCT" .iX "compound string functions" "XmCvtXmStringToCT" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmCvtXmStringToCT\fP\fR( \fBXmString \fBstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCvtXmStringToCT\fP converts a compound string to a (\fBchar *\fR) string in compound text format\&. The application must call \fBXtAppInitialize\fP before calling this function\&. The converter uses the font list tag associated with a given compound string segment to select a compound text format for that segment\&. A registry defines a mapping between font list tags and compound text encoding formats\&. The converter uses the following algorithm for each compound string segment: .IP " 1." 6 If the compound string segment tag is mapped to \fBXmFONTLIST_DEFAULT_TAG\fP in the registry, the converter passes the text of the compound string segment to \fBXmbTextListToTextProperty\fP with an encoding style of \fBXCompoundTextStyle\fP and uses the resulting compound text for that segment\&. .IP " 2." 6 If the compound string segment tag is mapped to an MIT registered charset in the registry, the converter creates the compound text for that segment using the charset (from the registry) and the text of the compound string segment as defined in the X Consortium Standard \fICompound Text Encoding\fP\&. .IP " 3." 6 If the compound string segment tag is mapped to a charset in the registry that is neither \fBXmFONTLIST_DEFAULT_TAG\fP nor an MIT registered charset, the converter creates the compound text for that segment using the charset (from the registry) and the text of the compound string segment as an "extended segment" with a variable number of octets per character\&. .IP " 4." 6 If the compound string segment tag is not mapped in the registry, the result is implementation dependent\&. .IP "\fIstring\fP" 10 Specifies a compound string to be converted to compound text\&. .SH "RETURN" .PP Returns a (\fBchar *\fR) string in compound text format\&. This format is described in the X Consortium Standard \fICompound Text Encoding\fP\&. The function allocates space to hold the returned string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXtFree\fP\&. .SH "RELATED" .PP \fBXmCvtCTToXmString\fP(3), \fBXmFontList\fP(3), \fBXmMapSegmentEncoding\fP(3), \fBXmRegisterSegmentEncoding\fP(3), and \fBXmString\fR\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmLabel.30000644000175000017500000010105412672140200013344 00000000000000'\" t ...\" Label.sgm /main/9 1996/09/08 20:49:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmLabel" "library call" .SH "NAME" \fBXmLabel\fP \(em The Label widget class .iX "XmLabel" .iX "widget class" "Label" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Label is an instantiable widget and is also used as a superclass for other button widgets, such as PushButton and ToggleButton\&. The Label widget does not accept any button or key input, and the help callback is the only callback defined\&. Label also receives enter and leave events\&. .PP Label can contain either text or a pixmap\&. Label text is a compound string\&. Refer to the \fIMotif Programmer\&'s Guide\fP for more information on compound strings\&. The text can be multilingual, multiline, and/or multifont\&. When a Label is insensitive, its text is stippled, or the user-supplied insensitive pixmap is displayed\&. .PP Label supports both accelerators and mnemonics primarily for use in Label subclass widgets that are contained in menus\&. Mnemonics are available in a menu system when the button is visible\&. Accelerators in a menu system are accessible even when the button is not visible\&. The Label widget displays the mnemonic by underlining the first matching character in the text string\&. The accelerator is displayed as a text string adjacent to the label text or pixmap, depending on the layout direction\&. .PP Label consists of many margin fields surrounding the text or pixmap\&. These margin fields are resources that may be set by the user, but Label subclasses and Manager parents also modify some of these fields\&. They tend to modify the \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and \fBXmNmarginBottom\fP resources and leave the \fBXmNmarginWidth\fP and \fBXmNmarginHeight\fP resources as set by the application\&. .PP Label takes into account \fBXmNshadowThickness\fP in determining its layout but does not draw the shadow\&. That is, if \fBXmNshadowThickness\fP is greater than 0 (zero), Label leaves space for the shadow, but the shadow does not appear\&. .PP In a Label, \fBXmNtraversalOn\fP and \fBXmNhighlightOnEnter\fP are forced to False inside Popup menu panes, Pulldown menu panes, and OptionMenus\&. Otherwise, these resources default to False\&. .PP Label uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits, and holds the \fBXmQTaccessTextual\fP, \fBXmQTmenuSavvy\fP, and \fBXmQTtransfer\fP traits\&. .SS "Data Transfer Behavior" .PP Label and it subclasses, except when used in a menu system, support dragging of the label contents from the Label\&. However, the label contents are draggable only if the \fBXmNenableUnselectableDrag\fP resource of \fBXmDisplay\fP is set to True\&. .PP As a source of data, Label and its subclasses support the following targets and associated conversions of data to these targets: .IP "\fIlocale\fP" 10 If the \fIlocale\fP target matches the widget\&'s locale, the widget transfers \fBXmNlabelString\fP in the encoding of the locale\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBCOMPOUND_TEXT\fP" 10 The widget transfers \fBXmNlabelString\fP as type \fBCOMPOUND_TEXT\fP\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBUTF8_STRING\fP" 10 The widget transfers \fBXmNlabelString\fP as type \fBUTF8_STRING\fP\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBPIXMAP\fP" 10 The widget transfers \fBXmNlabelPixmap\fP as type \fBDRAWABLE\fP\&. This target is supported when \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBSTRING\fP" 10 The widget transfers \fBXmNlabelString\fP as type \fBSTRING\fP\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBTEXT\fP" 10 If \fBXmNlabelString\fP is fully convertible to the encoding of the locale, the widget transfers \fBXmNlabelString\fP in the encoding of the locale\&. Otherwise, the widget transfers \fBXmNlabelString\fP as type \fBCOMPOUND_TEXT\fP\&. This target is supported only when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fB_MOTIF_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for the \fBCLIPBOARD\fP selection\&. When \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP, these include the following targets: .RS .IP " \(bu" 6 \fB_MOTIF_COMPOUND_STRING\fP .IP " \(bu" 6 \fBCOMPOUND_TEXT\fP .IP " \(bu" 6 \fBUTF8_STRING\fP .IP " \(bu" 6 The encoding of the locale, if \fBXmNlabelString\fP is fully convertible to the encoding of the locale .IP " \(bu" 6 \fBSTRING\fP, if \fBXmNlabelString\fP is fully convertible to \fBSTRING\fP .RE .IP "" 10 When \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the targets include \fBPIXMAP\fP\&. .IP "\fB_MOTIF_COMPOUND_STRING\fP" 10 The widget transfers \fBXmNlabelString\fP as a compound string in Byte Stream format\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fB_MOTIF_EXPORT_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to be used as the value of the DragContext\&'s \fBXmNexportTargets\fP in a drag-and-drop transfer\&. When \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP, these include \fB_MOTIF_COMPOUND_STRING\fP, \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP, \fBBACKGROUND\fP, and \fBFOREGROUND\fP\&. When \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, these include \fBPIXMAP\fP, \fBBACKGROUND\fP, and \fBFOREGROUND\fP\&. .PP As a source of data, Label also supports the following standard Motif targets: .IP "\fBBACKGROUND\fP" 10 The widget transfers \fBXmNbackground\fP as type \fBPIXEL\fP\&. .IP "\fBCLASS\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_CLASS\fP property and transfers the contents as text in the current locale\&. .IP "\fBCLIENT_WINDOW\fP" 10 The widget finds the first shell in the widget hierarchy and transfers its window as type \fBWINDOW\fP\&. .IP "\fBCOLORMAP\fP" 10 The widget transfers \fBXmNcolormap\fP as type \fBCOLORMAP\fP\&. .IP "\fBFOREGROUND\fP" 10 The widget transfers \fBXmNforeground\fP as type \fBPIXEL\fP\&. .IP "\fBNAME\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_NAME\fP property and transfers the contents as text in the current locale\&. .IP "\fBTARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports\&. These include the standard targets in this list\&. When \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP, these also include \fB_MOTIF_COMPOUND_STRING\fP, \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP, the encoding of the locale, \fBSTRING\fP, and \fBTEXT\fP\&. When \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, these also include \fBPIXMAP\fP\&. .IP "\fBTIMESTAMP\fP" 10 The widget transfers the timestamp used to acquire the selection as type \fBINTEGER\fP\&. .IP "\fB_MOTIF_RENDER_TABLE\fP" 10 The widget transfers \fBXmNrenderTable\fP if it exists, or else the default text render table, as type \fBSTRING\fP\&. .IP "\fB_MOTIF_ENCODING_REGISTRY\fP" 10 The widget transfers its encoding registry as type \fBSTRING\fP\&. The value is a list of NULL separated items in the form of tag encoding pairs\&. This target symbolizes the transfer target for the Motif Segment Encoding Registry\&. Widgets and applications can use this Registry to register text encoding formats for specified render table tags\&. Applications access this Registry by calling \fBXmRegisterSegmentEncoding\fP and \fBXmMapSegmentEncoding\fP\&. .SS "Classes" .PP Label inherits behavior, resources, and traits from \fBCore\fP and \fBXmPrimitive\fP\&. .PP The class pointer is \fBxmLabelWidgetClass\fP\&. .PP The class name is \fBXmLabel\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabel Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLCSG _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLCSG _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimension0CSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimension0CSG _____ XmNmarginRightXmCMarginRightDimension0CSG _____ XmNmarginTopXmCMarginTopDimension0CSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGCSG _____ XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG _____ XmNpixmapTextPaddingXmCSpaceDimension2CSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .IP "\fBXmNaccelerator\fP" 10 Sets the accelerator on a button widget in a menu, which activates a visible or invisible, but managed, button from the keyboard\&. This resource is a string that describes a set of modifiers and the key that may be used to select the button\&. The format of this string is identical to that used by the translations manager, with the exception that only a single event may be specified and only \fBKeyPress\fP events are allowed\&. .IP "" 10 Accelerators for buttons are supported only for PushButtons and ToggleButtons in Pulldown and Popup menu panes\&. .IP "\fBXmNacceleratorText\fP" 10 Specifies the text displayed for the accelerator\&. The text is displayed adjacent to the label string or pixmap\&. The direction of its layout depends on the \fBXmNlayoutDirection\fP resource of the widget\&. Accelerator text for buttons is displayed only for PushButtons and ToggleButtons in Pulldown and Popup Menus\&. .IP "\fBXmNalignment\fP" 10 Specifies the label alignment for text or pixmap\&. .RS .IP "\fBXmALIGNMENT_BEGINNING\fP (left alignment)" 10 Causes the left sides of the lines of text to be vertically aligned with the left edge of the widget window\&. For a pixmap, its left side is vertically aligned with the left edge of the widget window\&. .IP "\fBXmALIGNMENT_CENTER\fP (center alignment)" 10 Causes the centers of the lines of text to be vertically aligned in the center of the widget window\&. For a pixmap, its center is vertically aligned with the center of the widget window\&. .IP "\fBXmALIGNMENT_END\fP (right alignment)" 10 Causes the right sides of the lines of text to be vertically aligned with the right edge of the widget window\&. For a pixmap, its right side is vertically aligned with the right edge of the widget window\&. .RE .IP "" 10 The preceding descriptions for text are correct when \fBXmNlayoutDirection\fP is \fBXmLEFT_TO_RIGHT\fP\&. When that resource is \fBXmRIGHT_TO_LEFT\fP, the descriptions for \fBXmALIGNMENT_BEGINNING\fP and \fBXmALIGNMENT_END\fP are switched\&. .IP "" 10 If the parent is a RowColumn whose \fBXmNisAligned\fP resource is True, \fBXmNalignment\fP is forced to the same value as the RowColumn\&'s \fBXmNentryAlignment\fP if the RowColumn\&'s \fBXmNrowColumnType\fP is \fBXmWORK_AREA\fP or if the widget is a subclass of XmLabel\&. Otherwise, the default is \fBXmALIGNMENT_CENTER\fP\&. .IP "\fBXmNfontList\fP" 10 Specifies the font of the text used in the widget\&. \fBXmNfontList\fP is obsolete and exists for compatibility with previous releases\&. You should now use \fBXmNrenderTable\fP instead of \fBXmNfontList\fP\&. If both are specified, the render table will take precedence\&. If \fBXmNfontList\fP is NULL at initialization, Label searches its parent hierarchy for an ancestor that is a subclass of the XmBulletinBoard, VendorShell, or XmMenuShell widget class\&. If such an ancestor is found, Label initializes \fBXmNfontList\fP to the \fBXmNlabelFontList\fP of the ancestor widget\&. Similarly, button subclasses of Label initialize \fBXmNfontList\fP to the \fBXmNbuttonFontList\fP of the ancestor widget\&. (Currently, all subclasses of Label are button subclasses\&.) If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmFontList\fP(3) for more information on the creation and structure of a font list\&. .IP "\fBXmNlabelInsensitivePixmap\fP" 10 Specifies a pixmap used as the button face if \fBXmNlabelType\fP is \fBXmPIXMAP\fP and the button is insensitive\&. The default value, \fBXmUNSPECIFIED_PIXMAP\fP, displays an empty label\&. .IP "\fBXmNlabelPixmap\fP" 10 Specifies the pixmap when \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&. The default value, \fBXmUNSPECIFIED_PIXMAP\fP, displays an empty label\&. .IP "\fBXmNlabelString\fP" 10 Specifies the compound string when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. If this value is NULL, it is initialized by converting the name of the widget to a compound string\&. Refer to \fBXmString\fP(3) for more information on the creation and structure of compound strings\&. .IP "\fBXmNlabelType\fP" 10 Specifies the label type\&. .RS .IP "\fBXmSTRING\fP" 10 Displays text using \fBXmNlabelString\fP\&. .IP "\fBXmPIXMAP\fP" 10 Displays pixmap using \fBXmNlabelPixmap\fP or .IP "\fBXmPIXMAP_AND_STRING\fP" 10 Displays text and pixmap using \fBXmNlabelPixmap\fP or \fBXmNlabelInsensitivePixmap\fP and \fBXmNlabelString\fP\&. .RE .IP "\fBXmNmarginBottom\fP" 10 Specifies the amount of spacing between the bottom of the label text and the top of the bottom margin specified by \fBXmNmarginHeight\fP\&. This may be modified by Label\&'s subclasses\&. For example, CascadeButton may increase this field to make room for the cascade pixmap\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies an equal amount of spacing above the margin defined by \fBXmNmarginTop\fP and below the margin defined by \fBXmNmarginBottom\fP\&. \fBXmNmarginHeight\fP specifies the amount of spacing between the top edge of the margin set by \fBXmNmarginTop\fP and the bottom edge of the top shadow, and the amount of spacing between the bottom edge of the margin specified by \fBXmNmarginBottom\fP and the top edge of the bottom shadow\&. .IP "\fBXmNmarginLeft\fP" 10 Specifies the amount of spacing between the left edge of the label text and the right side of the left margin (specified by \fBXmNmarginWidth\fP)\&. This may be modified by Label\&'s subclasses\&. For example, ToggleButton may increase this field to make room for the toggle indicator and for spacing between the indicator and label\&. Whether this actually applies to the left or right side of the label depends on the value of the \fBXmNlayoutDirection\fP resource\&. .IP "\fBXmNmarginRight\fP" 10 Specifies the amount of spacing between the right edge of the label text and the left side of the right margin (specified by \fBXmNmarginWidth\fP)\&. This may be modified by Label\&'s subclasses\&. For example, CascadeButton may increase this field to make room for the cascade pixmap\&. Whether this actually applies to the left or right side of the label depends on the value of the \fBXmNlayoutDirection\fP resource\&. .IP "\fBXmNmarginTop\fP" 10 Specifies the amount of spacing between the top of the label text and the bottom of the top margin specified by \fBXmNmarginHeight\fP\&. This may be modified by Label\&'s subclasses\&. For example, CascadeButton may increase this field to make room for the cascade pixmap\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies an equal amount of spacing to the left of the margin defined by \fBXmNmarginLeft\fP and to the right of the margin defined by \fBXmNmarginRight\fP\&. \fBXmNmarginWidth\fP specifies the amount of spacing between the left edge of the margin set by \fBXmNmarginLeft\fP and the right edge of the left shadow, and the amount of spacing between the right edge of the margin specified by \fBXmNmarginRight\fP and the left edge of the right shadow\&. .IP "\fBXmNmnemonic\fP" 10 Provides the user with an alternate means of activating a button\&. A button in a MenuBar, a Popup menu pane, or a Pulldown menu pane can have a mnemonic\&. .IP "" 10 This resource contains a keysym as listed in the X11 keysym table\&. The first character in the label string that exactly matches the mnemonic in the character set specified in \fBXmNmnemonicCharSet\fP is underlined when the button is displayed\&. .IP "" 10 When a mnemonic has been specified, the user activates the button by pressing the mnemonic key while the button is visible\&. If the button is a CascadeButton in a MenuBar and the MenuBar does not have the focus, the user must use the \fBMAlt\fP modifier while pressing the mnemonic\&. The user can activate the button by pressing either the shifted or the unshifted mnemonic key\&. .IP "\fBXmNmnemonicCharSet\fP" 10 Specifies the character set of the mnemonic for the label\&. The default is \fBXmFONTLIST_DEFAULT_TAG\fP\&. .IP "\fBXmNpixmapPlacement\fP" 10 The location of the pixmap with respect to the text label. This resource can take one of the following values: \fBXmPIXMAP_TOP\fP, \fBXmPIXMAP_BOTTOM\fP, \fBXmPIXMAP_LEFT\fP, and \fBXmPIXMAP_RIGHT\fP. A type converter has been registered that converts the following strings: "top", "bottom", "left", and "right". .IP "\fBXmNpixmapTextPadding\fP" 10 The amount of space to be left between the pixmap and the label string. .IP "\fBXmNrecomputeSize\fP" 10 Specifies a Boolean value that indicates whether the widget shrinks or expands to accommodate its contents (label string or pixmap) as a result of an \fBXtSetValues\fP resource value that would change the size of the widget\&. If True, the widget shrinks or expands to exactly fit the label string or pixmap\&. If False, the widget never attempts to change size on its own\&. .IP "\fBXmNrenderTable\fP" 10 Specifies the render table associated with the \fBlabelString\fP\&. If this value is NULL at initialization, Label searches its parent hierarchy for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, Label initializes \fBXmNrenderTable\fP to the \fBXmLABEL_RENDER_TABLE\fP value of the ancestor widget\&. Similarly, button subclasses of Label initialize \fBXmNrenderTable\fP to the \fBXmBUTTON_RENDER_TABLE\fP value of the ancestor widget\&. (Note that all current subclasses of Label are button subclasses\&.) If no such ancestor is found, the default is implementation dependent\&. If a font list and a render table are both sepcified, the render table will take precedence\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNstringDirection\fP" 10 Is a synthetic resource for setting \fBXmNlayoutDirection\fP\&. The values for this resource are \fBXmSTRING_DIRECTION_L_TO_R\fP and \fBXmSTRING_DIRECTION_R_TO_L\fP\&. Refer to the \fBXmNlayoutDirection\fP resource description\&. The \fBXmNstringDirection\fP resource is obsoleted by \fBXmNlayoutDirection\fP, but is kept here for backward compatibility\&. .SS "Inherited Resources" .PP Label inherits behavior and resources from the following superclasses\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension0CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanFalseCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP XmLabel includes translations from Primitive\&. The XmLabel translations are described in the following list\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 ProcessDrag() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .PP The translations used by subclasses of XmLabel for menu traversal are described in the following list\&. .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuEscape() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuTraverseLeft() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuTraverseRight() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuTraverseUp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuTraverseDown() .SS "Action Routines" .PP The \fBXmLabel\fP action routines are .IP "Help():" 10 In a Popup or Pulldown MenuPane, unposts all menus in the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu system was entered\&. Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "MenuEscape():" 10 In a MenuBar, disarms the CascadeButton and the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu was entered\&. .IP "" 10 In a top-level Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, unposts the menu and moves the focus to its CascadeButton\&. .IP "" 10 In a Popup MenuPane, unposts the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget from which the menu was posted\&. .IP "MenuTraverseDown():" 10 If the current menu item has a submenu and is in a MenuBar, then this action posts the submenu, disarms the current menu item, and arms the submenu\&'s first traversable menu item\&. .IP "" 10 If the current menu item is in a MenuPane, then this action disarms the current menu item and arms the item below it\&. This action wraps within the MenuPane\&. The direction of the wrapping depends on the \fBXmNlayoutDirection\fP resource\&. .IP "MenuTraverseLeft():" 10 When the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left\&. If the current menu item is at the left edge of a submenu attached to a MenuBar item, then this action unposts the submenu and traverses to the MenuBar item to the left, wrapping if necessary\&. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu\&. If the current menu item is at the left edge of a submenu not directly attached to a MenuBar item, then this action unposts the current submenu only\&. .IP "" 10 In Popup or Torn-off MenuPanes, when the current menu item is at the left edge, this action wraps within the MenuPane\&. If the current menu item is at the left edge of the MenuPane and not in the top row, this action wraps to the rightmost menu item in the row above\&. If the current menu item is in the upper, leftmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, rightmost menu item in the MenuPane\&. The preceding description applies when the \fBXmNlayoutDirection\fP horizontal direction is \fBXmLEFT_TO_RIGHT\fP\&. If the \fBXmNlayoutDirection\fP horizontal direction is \fBXmRIGHT_TO_LEFT\fP, then the following applies\&. .IP "" 10 If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu\&. If the current menu item is not a CascadeButton and is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left, wrapping if necessary\&. If the current menu item is not a CascadeButton and is at the left edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the left\&. If that MenuBar item has a submenu, it posts the submenu and arms the submenu\&'s first traversable item\&. .IP "" 10 In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the left edge of a row (except the bottom row), this action wraps to the rightmost menu item in the row below\&. If the current menu item is not a CascadeButton and is in the bottom, leftmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, rightmost menu item of the MenuPane\&. .IP "MenuTraverseRight():" 10 If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the right\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu\&. If the current menu item is not a CascadeButton and is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right, wrapping if necessary\&. If the current menu item is not a CascadeButton and is at the right edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the right\&. If that MenuBar item has a submenu, it posts the submenu and arms the submenu\&'s first traversable item\&. .IP "" 10 In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the right edge of a row (except the bottom row), this action wraps to the leftmost menu item in the row below\&. If the current menu item is not a CascadeButton and is in the bottom, rightmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, leftmost menu item of the MenuPane\&. The preceding description applies when the \fBXmNlayoutDirection\fP horizontal direction is \fBXmLEFT_TO_RIGHT\fP\&. If the \fBXmNlayoutDirection\fP horizontal direction is \fBXmRIGHT_TO_LEFT\fP, then the following applies\&. When the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right\&. If the current menu item is at the right edge of a submenu attached to a MenuBar item, then this action unposts the submenu and traverses to the MenuBar item to the right, wrapping if necessary\&. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu\&. If the current menu item is at the right edge of a submenu not directly attached to a MenuBar item, then this action unposts the current submenu only\&. .IP "" 10 In Popup or Torn-off MenuPanes, when the current menu item is at the right edge, this action wraps within the MenuPane\&. If the current menu item is at the right edge of the MenuPane and not in the top row, this action wraps to the leftmost menu item in the row above\&. If the current menu item is in the upper, rightmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, leftmost menu item in the MenuPane\&. .IP "MenuTraverseUp():" 10 When the current menu item is in a MenuPane, then this action disarms the current menu item and arms the item above it\&. This action wraps within the MenuPane\&. The direction of the wrapping depends on the \fBXmNlayoutDirection\fP resource\&. .IP "ProcessDrag():" 10 Drags the contents of a Label, identified when \fBBTransfer\fP is pressed\&. This action sets the \fBXmNconvertProc\fP of the DragContext to a function that calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fB_MOTIF_DROP\fP selection\&. This action is undefined for Labels used in a menu system\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateLabel\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmStringCreate\fP(3), \fBXmStringCreateLtoR\fP(3), \fBXmPrimitive\fP(3), \fBXmVaCreateLabel\fP(3), and \fBXmVaCreateManagedLabel\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateFileSelectionBox.30000644000175000017500000000304412672140200017136 00000000000000.DT .TH "XmVaCreateFileSelectionBox" "library call" .SH "NAME" \fBXmVaCreateFileSelectionBox\fP, \fBXmVaCreateManagedFileSelectionBox\fP \(em A FileSelectionBox widget convenience creation functions\&. .iX "XmVaCreateFileSelectionBox" "XmVaCreateManagedFileSelectionBox" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateFileSelectionBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedFileSelectionBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a FileSelectionBox widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateFileSelectionBox\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedFileSelectionBox\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of FileSelectionBox and its associated resources, see \fBXmFileSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the FileSelectionBox widget ID\&. .SH "RELATED" .PP \fBXmCreateFileSelectionBox\fP(3), \fBXtCreateManagedWidget\fP(3), \fBXtCreateWidget\fP(3), and \fBXmFileSelectionBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmWidgetGetBaselines.30000644000175000017500000000433712672140200016044 00000000000000'\" t ...\" WidgetGA.sgm /main/8 1996/09/08 21:21:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmWidgetGetBaselines" "library call" .SH "NAME" \fBXmWidgetGetBaselines\fP \(em Retrieves baseline information for a widget .iX "XmWidgetGetBaselines" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmWidgetGetBaselines\fP\fR( \fBWidget \fBwidget\fR\fR, \fBDimension **\fBbaselines\fR\fR, \fBint *\fBline_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmWidgetGetBaselines\fP returns an array that contains one or more baseline values associated with the specified widget\&. The baseline of any given line of text is a vertical offset in pixels from the origin of the widget\&'s bounding box to the given baseline\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget for which baseline values are requested .IP "\fIbaselines\fP" 10 Returns an array that contains the value of each baseline of text in the widget\&. The function allocates space to hold the returned array\&. The application is responsible for managing the allocated space\&. The application can recover this allocated space by calling \fBXtFree\fP\&. .IP "\fIline_count\fP" 10 Returns the number of lines in the widget .SH "RETURN" .PP Returns a Boolean value that indicates whether the widget contains a baseline\&. If the value is True, the function returns a value for each baseline of text\&. If it is False, the function was unable to return a baseline value\&. .SH "RELATED" .PP \fBXmWidgetGetDisplayRect\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmCreatePulldownMenu.30000644000175000017500000001111712672140200016102 00000000000000'\" t ...\" CrePuA.sgm /main/8 1996/09/08 20:34:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreatePulldownMenu" "library call" .SH "NAME" \fBXmCreatePulldownMenu\fP \(em A RowColumn widget convenience creation function .iX "XmCreatePulldownMenu" .iX "creation functions" "XmCreatePulldownMenu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreatePulldownMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreatePulldownMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_PULLDOWN\fP and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. When this function is used to create the Pulldown menu pane, a MenuShell widget is automatically created as the parent of the menu pane\&. If the widget specified by the \fIparent\fP parameter is a Popup or a Pulldown menu pane, the MenuShell widget is created as a child of the \fIparent\fP MenuShell; otherwise, it is created as a child of the specified \fIparent\fP widget\&. .PP \fBXmCreatePulldownMenu\fP is provided as a convenience function for creating RowColumn widgets configured to operate as Pulldown menu panes and is not implemented as a separate widget class\&. .PP A Pulldown menu pane displays a 3-D shadow, unless the feature is disabled by the application\&. The shadow appears around the edge of the menu pane\&. .PP A Pulldown menu pane is used with submenus that are to be attached to a CascadeButton or a CascadeButtonGadget\&. This is the case for all menu panes that are part of a PulldownMenu system (a MenuBar), the menu pane associated with an OptionMenu, and any menu panes that cascade from a Popup menu pane\&. Pulldown menu panes that are to be associated with an OptionMenu must be created before the OptionMenu is created\&. .PP The Pulldown menu pane must be attached to a CascadeButton or CascadeButtonGadget that resides in a MenuBar, a Popup menu pane, a Pulldown menu pane, or an OptionMenu\&. It is attached with the button resource \fBXmNsubMenuId\fP\&. .PP A MenuShell widget is required between the Pulldown menu pane and its parent\&. If the application uses this convenience function for creating a Pulldown menu pane, the MenuShell is automatically created as the real parent of the menu pane; otherwise, it is the application\&'s responsibility to create the MenuShell widget\&. .PP To function correctly when incorporated into a menu, the Pulldown menu pane\&'s hierarchy must be considered\&. This hierarchy depends on the type of menu system that is being built, as follows: .IP " \(bu" 6 If the Pulldown menu pane is to be pulled down from a MenuBar, its \fIparent\fP must be the MenuBar\&. .IP " \(bu" 6 If the Pulldown menu pane is to be pulled down from a Popup or another Pulldown menu pane, its \fIparent\fP must be that Popup or Pulldown menu pane\&. .IP " \(bu" 6 If the Pulldown menu pane is to be pulled down from an OptionMenu, its \fIparent\fP must be the same as the OptionMenu parent\&. .PP PullDown menu panes support tear-off capabilities for tear-off menus through \fBXmRowColumn\fP resources\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCascadeButton\fP(3), \fBXmCascadeButtonGadget\fP(3), \fBXmCreateOptionMenu\fP(3), \fBXmCreatePopupMenu\fP(3), \fBXmCreateSimplePulldownMenu\fP(3), \fBXmMenuShell\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimplePulldownMenu\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmVaCreateSpinBox.30000644000175000017500000000266112672140200015326 00000000000000.DT .TH "XmVaCreateSpinBox" "library call" .SH "NAME" \fBXmVaCreateSpinBox\fP, \fBXmVaCreateManagedSpinBox\fP \(em A SpinBox widget convenience creation functions\&. .iX "XmVaCreateToggleSpinBox" "XmVaCreateManagedSpinBox" .iX "creation functions" "XmVaCreateSpinBox" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateSpinBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedSpinBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateSpinBox\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateSpinBox\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of SpinBox and its associated resources, see \fBXmSpinBox\fP(3)\&. .SH "RETURN" .PP Returns the SpinBox widget ID\&. .SH "RELATED" .PP \fBXmSpinBox\fP(3), \fBXmCreateSpinBox\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmDropDown.30000644000175000017500000003352212672140200014065 00000000000000.DT .TH "XmDropDown" "library call" .SH NAME \fBXmDropDown\fP \(em The DropDown widget class .SH "SYNOPSIS" .PP .nf #include .fi .SH DESCRIPTION .PP The DropDown widget allows the user to select elements from a list of choices, and enter their own values in a text widget. To conserve screen space, the list of choices is shown only when the user selects the down arrow button. The choices may then be selected from this list. If the list widget is in Browse Select mode (the default) or Single Select mode, then the list will automatically be removed when the user selects an item in the list. When the list is in other modes, multiple items may be selected and the list may be popped down by either another click on the arrow button, a click outside the list or double-clicking an item. When using keyboard traversal, the list may be popped down by selecting the arrow button or Alt - down arrow, and popped back up by typing either the osfActivate key, a carriage return, or Alt - up arrow. In any case, when the list is removed the item or items that were selected will be placed in the text widget separated by commas. Typing the escape key when the list is up, cancels the list popup, restoring the DropDown widget to the state it was in before the list was popped up. If the text field area is non-editable, clicking anywhere in the text field the list will also pop down. .PP Resources are available to change the margin sizes, the location of the left edge of the popup list, whether or not the label is shown, whether the text field widget may be edited, and whether or not the text in the list is verified against the choices available in the list. By setting resources that occur in the children of the DropDown widget, the contents of the list, the number of items visible in the list, the initial value of the text field, and the value of the label may be set or changed dynamically. .PP If a developer wishes the popup list's shell to be resizable, they should set the allowShellResize to True at creation time. .SS "Classes" .PP \fBXmDropDown\fP inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmDropDownWidgetClass\fP\&. .PP The class name is \fBXmDropDown\fP\&. .PP .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .TS tab() box; c s s s s l| l| l| l| l. \fBXmDropDown Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNcustomizedCombinationBoxXmCBooleanBooleanFalseCSG _____ XmNeditableXmCBooleanBooleanTrueCSG _____ XmNhorizontalMarginXmCMarginDimension2CSG _____ XmNitemCountlistint0CSG _____ XmNitemslistXmStringTableNULLCSG _____ XmNlabelStringlabelXmString"label"CSG _____ XmNpopupCursorXmCCursorCursorleft_ptrCSG _____ XmNpopupOffsetMxCPopupOffsetint15CSG _____ XmNpopupShellWidgetXmCWidgetWidgetNULLCSG _____ XmNshowLabelXmCBooleanBooleanTrueCSG _____ XmNupdateShellCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNupdateTextCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNuseTextFieldXmCUseTextFieldBooleanTrueCSG _____ XmNvaluetextString""CSG _____ XmNverifyXmCVerifyBooleanTrueCSG _____ XmNverifyTextCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNverticalMarginXmCMarginDimension2CSG _____ XmNvisibleItemCountXmCVisibleItemCountint0CSG _____ .TE .IP "\fBXmNcustomizedCombinationBox\fP" 10 If this resource is True then the widget will not automatically create a popup shell and list widget. This resource can be used, as the name implies, to create a custom combination box that has something other than a list in it. If this resource is true then a shell must be provided to the DropDown widget via the popupShellWidget resource. Just before the shell is popped up the updateShellCallback is called. Just after the shell is popped down the updateTextCallback is called. If verify is true then the verifyTextCallback is called when the combo box needs to verify the contents of the text widget against the allowable values in the custom shell. .IP "\fBXmNeditable\fP" 10 This boolean value determines whether the user is allowed to type into TextField widget of the DropDown widget. If this value is False, selecting the text field will popup the combo box list .IP "\fBXmNhorizontalMargin\fP" 10 Specifies the horizontal spacing between the child widgets and the boundary of the DropDown widget\&. .IP "\fBXmNverticalMargin\fP" 10 Specifies the vertical spacing between the child widgets and the boundary of the DropDown widget\&. .IP "\fBXmNitemCount\fP" 10 The number of items in the popup list. .IP "\fBXmNitems\fP" 10 The list of all choice that will be displayed in the popup list. .IP "\fBXmNlabelString\fP" 10 The string displayed as the label of the DropDown widget. .IP "\fBXmNpopupCursor\fP" 10 The cursor to display to the user when the DropDown's list is popped up. See X Window System, Robert Scheiffler et al., Appendix B, for choices. .IP "\fBXmNpopupOffset\fP" 10 The amount of space in pixels between the left edge of the Text widget and the left edge of the list when the list is displayed. Positive values mean the text's left edge is farther to the left, negative values mean the list's edge is farther to the left. If this is a non-custom DropDown widget the right edge of the text and the right edge of the arrow button will always line up. .IP "\fBXmNpopupShellWidget\fP" 10 The widget identifier for the shell that is popped up when the arrow is clicked. If customizedCombinationBox is False then this widget is automatically created by the DropDown widget. .IP "\fBXmNshowLabel\fP" 10 A boolean value that specifies whether or not to display the DropDown Label widget. .IP "\fBXmNupdateShellCallback\fP" 10 .IP "\fBXmNupdateTextCallback\fP" 10 The callback routine to call when either the shell widget contents or the Text widget need to be updated to correspond with the other. The shell is updated just before it is popped up. The text is updated just after the shell is popped down. If customizedComboBox is False then the updates are done automatically by the combo box. These routines are called to inform the application that an action has been taken, in case it would like to do any further processing. .IP "\fBXmNuseTextField\fP" 10 A boolean value that specifies if an XmTextField or an XmText widget should be used for the text entry portion of the DropDown widget. .IP "\fBXmNvalue\fP" 10 The string displayed in the Text widget. .IP "\fBXmNverify\fP" 10 If this resource is true the DropDown widget will verify its value against the list whenever it loses focus or the user types . If the verification fails, an XtWarning is generated with a name of XmNtextVerifyFailed. To trap this message register an XtWarningMsgHandler. .IP "\fBXmNverifyTextCallback\fP" 10 This routine is called whenever the Text widget's contents may need to be verified against the popup shell's contents. If the customizedComboBox resource is False then the DropDown widget has already performed the verification when this routine is called. .IP "\fBXmNvisibleItemCount\fP" 10 The number of items visible in the popup list at one time. .RE .SS Children .PP The DropDown is composed of many sub-widgets. Most of the information displayed to the user is set through these sub widgets. Most values passed to this widget through the argument list at creation time or via set values are passed to each of this widget's children. Get values requests must be made on a child by child basis. The children of the DropDown are listed below. The OSF/Motifdocumentation should be consulted for an exhaustive set of resources for each child. A partial list of the most common resources are listed here for convenience. .PP .ta 18n 35n 40n 50n .df XmDropDown comboBox XmLabel label XmTextField text XmArrowButton arrow OverrideShell popupShell XmScrolledWindow listSW XmScrollBar ListvScrollBar XmScrollBar ListhScrollBar XmList list .fi The popup shell and its children are only created when customizedCombinationBox is False. .PP .SS "Inherited Resources" .PP XmDropDown inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP None of the DropDown's callback procedures have any call data currently defined for them. The widget passed to each of these functions is the DropDown widget. .HP 20 void (Callback)(Widget cbw, XtPointer client_data, XtPointer unused) .ta 15 .HP 15 cbw This is the widget identifier of the DropDown widget. .PP .HP 15 client_data The client data passed to this widget by the application programmer. .HP 15 unused This value is undefined. .PP .SS "Geometry Management" .PP The DropDown widget lays out its children (the label, text and arrow) in a row. The amount of space they are each allocated when the DropDown is not allowed to be the exact size it desires is determined using the following rules: .ta 5 .HP 5 1. The arrow is always given its requested size. .HP 5 2. If the combo box is bigger than it wants to be all extra space is given to the text widget. .HP 5 3. If the combo box is smaller that is wants to be then the text and label widgets are each sized smaller than they desire in exactly the same ratio. For example: If the amount of space for the label and text is 100 pixels and the label wants to be 50 pixels wide and the text would like to be 100 pixels wide then the label will get 34 pixels and the text 66. The popup shell widget is sized such that the width of the scrolled list widget equals the width of the text widget minus the value of the "popupOffset" resource. If the popup shell resides in a customized combination box, however, it is allowed to be whatever size the child of the popup shell would like to be. .PP .SH RELATED .PP \fBComposite\fP(3), \fBCore\fP(3), \fBXmCreateDropDown\fP(3), \fBXmDropDownGetArrow\fP(3), \fBXmDropDownGetLabel\fP(3), \fBXmDropDownGetList\fP(3), \fBXmDropDownGetText\fP(3), \fBXmDropDownGetValue\fP(3), \fBXmList\fP(3), \fBXmManager\fP(3), \fBXmTextField\fP(3), \fBXmVaCreateDropDown\fP(3), and \fBXmVaCreateManagedDropDown\fP(3)\&. .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmRenderTableGetRendition.30000644000175000017500000000364712672140200017041 00000000000000'\" t ...\" RendTaG.sgm /main/9 1996/09/08 20:57:36 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableGetRendition" "library call" .SH "NAME" \fBXmRenderTableGetRendition\fP \(em A convenience function that matches a rendition tag .iX "XmRenderTableGetRendition" .SH "SYNOPSIS" .PP .nf #include \fBXmRendition \fBXmRenderTableGetRendition\fP\fR( \fBXmRenderTable \fBtable\fR\fR, \fBXmStringTag \fBtag\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableGetRendition\fP searches \fItable\fP and returns a copy of the rendition whose \fBXmNtag\fP resource matches \fItag\fP\&. If no rendition matches, then NULL is returned\&. This function is to be used for just one rendition match\&. .PP It is the responsibility of the caller to free the returned rendition with the \fBXmRenditionFree\fP function\&. .IP "\fItable\fP" 10 Specifies the table containing renditions to be searched\&. .IP "\fItag\fP" 10 Specifies the tag to search for\&. .SH "RETURN" .PP Returns NULL if there is no match; otherwise, this function returns a new \fBXmRendition\fR\&. .SH "RELATED" .PP \fBXmRenderTableGetRenditions\fP(3), \fBXmRenderTableGetTags\fP(3), and \fBXmRendition\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmFontListFree.30000644000175000017500000000303312672140200014667 00000000000000'\" t ...\" FontLstQ.sgm /main/8 1996/08/31 15:23:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListFree" "library call" .SH "NAME" \fBXmFontListFree\fP \(em A font list function that recovers memory used by a font list .iX "XmFontListFree" .iX "font list functions" "XmFontListFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmFontListFree\fP\fR( \fBXmFontList \fBlist\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListFree\fP recovers memory used by a font list\&. This routine does not free the \fBXFontSet\fP or \fBXFontStruct\fP associated with the specified font list\&. .IP "\fIlist\fP" 10 Specifies the font list to be freed .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmFontListCopy\fP(3), and \fBXmFontListRemoveEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmCreateScale.30000644000175000017500000000341512672140200014502 00000000000000'\" t ...\" CreScA.sgm /main/7 1996/08/30 14:50:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateScale" "library call" .SH "NAME" \fBXmCreateScale\fP \(em The Scale widget creation function .iX "XmCreateScale" .iX "creation functions" "XmCreateScale" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateScale\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateScale\fP creates an instance of a Scale widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Scale and its associated resources, see \fBXmScale\fP(3)\&. .SH "RETURN" .PP Returns the Scale widget ID\&. .SH "RELATED" .PP \fBXmScale\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmVaCreateManagedText.30000644000175000017500000000003212672140200016133 00000000000000.so man3/XmVaCreateText.3 motif-2.3.8/doc/man/man3/XmRemoveTabGroup.30000644000175000017500000000304212672140200015224 00000000000000'\" t ...\" RemTab.sgm /main/7 1996/08/30 15:56:02 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRemoveTabGroup" "library call" .SH "NAME" \fBXmRemoveTabGroup\fP \(em A function that removes a tab group .iX "XmRemoveTabGroup" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmRemoveTabGroup\fP\fR( \fBWidget \fBtab_group\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and its behavior is replaced by setting \fBXmNnavigationType\fP to \fBXmNONE\fP\&. \fBXmRemoveTabGroup\fP removes a widget from the list of tab groups associated with a particular widget hierarchy and sets the widget\&'s \fBXmNnavigationType\fP to \fBXmNONE\fP\&. .IP "\fItab_group\fP" 10 Specifies the widget ID .SH "RELATED" .PP \fBXmAddTabGroup\fP(3), \fBXmManager\fP(3), and \fBXmPrimitive\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmImSetFocusValues.30000644000175000017500000000602612672140200015531 00000000000000'\" t ...\" ImSetFoc.sgm /main/10 1996/09/08 20:48:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImSetFocusValues" "library call" .SH "NAME" \fBXmImSetFocusValues\fP \(em An input manager function that notifies an input manager that a widget has received input focus and updates the input context attributes .iX "XmImSetFocusValues" .iX "input manager functions" "XmImSetFocusValues" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImSetFocusValues\fP\fR( \fBWidget \fBwidget\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR, \fB\fR); .fi .SH "DESCRIPTION" .PP \fBXmImSetFocusValues\fP notifies the input manager that the specified widget has received input focus\&. This function also updates the attributes of the input context associated with the widget\&. The focus window for the XIC is set to the window of the widget\&. The \fIarglist\fP argument is a list of attribute/value pairs for the input context\&. This function passes the attributes and values to \fBXICSetValues\fP\&. The caller of this routine should pass in only those values that have changed since the last call to any of these functions; \fBXmImSetValues\fP, \fBXmImSetFocusValues\fP, \fBXmImVaSetValues\fP, or \fBXmImVaSetFocusValues\fP\&. See the description in the \fBXmImSetValues\fP(3) reference page for a list of associated resources\&. .PP If the previous parameters for the widget\&'s XIC do not allow the previously registered XIC to be reused, that XIC will be unregistered, and a new one will be created and registered with the widget\&. Note that sharing of data is preserved\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget registered with the input manager\&. .IP "\fIarglist\fP" 10 Specifies the list of attribute/value pairs to be passed to \fBXICSetValues\fP\&. See the description in the \fBXmImSetValues\fP(3) man page for a description of resources\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/values pairs in the argument list (\fIarglist)\fP .PP Note that the Text and TextField widgets call the \fBXmImSetFocusValues\fP function when they receive focus\&. Therefore, further calls to the \fBXmImSetFocusValues\fP function for these widgets are unnecessary\&. .SH "RELATED" .PP \fBXmImSetValues\fP(3), \fBXmImVaSetFocusValues\fP(3), and \fBXmImVaSetValues\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmTextSetHighlight.30000644000175000017500000000464112672140200015561 00000000000000'\" t ...\" TxtSetHi.sgm /main/8 1996/09/08 21:19:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetHighlight" "library call" .SH "NAME" \fBXmTextSetHighlight\fP \(em A Text function that highlights text .iX "XmTextSetHighlight" .iX "Text functions" "XmTextSetHighlight" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetHighlight\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBleft\fR\fR, \fBXmTextPosition \fBright\fR\fR, \fBXmHighlightMode \fBmode\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetHighlight\fP highlights text between the two specified character positions\&. The \fImode\fP parameter determines the type of highlighting\&. Highlighting text merely changes the visual appearance of the text; it does not set the selection\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIleft\fP" 10 Specifies the position of the left boundary of text to be highlighted\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fIright\fP" 10 Specifies the position of the right boundary of text to be highlighted\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fImode\fP" 10 Specifies the type of highlighting to be done\&. A value of \fBXmHIGHLIGHT_NORMAL\fP removes highlighting\&. A value of \fBXmHIGHLIGHT_SELECTED\fP highlights the text using reverse video\&. A value of \fBXmHIGHLIGHT_SECONDARY_SELECTED\fP highlights the text using underlining\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmGetColors.30000644000175000017500000000500012672140200014220 00000000000000'\" t ...\" GetCols.sgm /main/8 1996/09/08 20:45:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetColors" "library call" .SH "NAME" \fBXmGetColors\fP \(em A function that generates foreground, select, and shadow colors .iX "XmGetColors" .iX "Color functions" "XmGetColors" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmGetColors\fP\fR( \fBScreen \fB* screen\fR\fR, \fBColormap \fBcolormap\fR\fR, \fBPixel \fBbackground\fR\fR, \fBPixel \fB* foreground\fR\fR, \fBPixel \fB* top_shadow\fR\fR, \fBPixel \fB* bottom_shadow\fR\fR, \fBPixel \fB* select\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetColors\fP takes a screen, a colormap, and a background pixel, and returns pixel values for foreground, select, and shadow colors\&. .IP "\fIscreen\fP" 10 Specifies the screen for which these colors should be allocated\&. .IP "\fIcolormap\fP" 10 Specifies the colormap from which these colors should be allocated\&. .IP "\fIbackground\fP" 10 Specifies the background on which the colors should be based\&. .IP "\fIforeground\fP" 10 Specifies a pointer to the returned foreground pixel value\&. If this argument is NULL, no value is allocated or returned for this color\&. .IP "\fItop_shadow\fP" 10 Specifies a pointer to the returned top shadow pixel value\&. If this argument is NULL, no value is allocated or returned for this color\&. .IP "\fIbottom_shadow\fP" 10 Specifies a pointer to the returned bottom shadow pixel value\&. If this argument is NULL, no value is allocated or returned for this color\&. .IP "\fIselect\fP" 10 Specifies a pointer to the returned select pixel value\&. If this argument is NULL, no value is allocated or returned for this color\&. .SH "RELATED" .PP \fBXmChangeColor\fP(3), \fBXmGetColorCalculation\fP(3), and \fBXmSetColorCalculation\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmDropSiteUpdate.30000644000175000017500000000365012672140200015224 00000000000000'\" t ...\" DropSitY.sgm /main/8 1996/09/08 20:42:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteUpdate" "library call" .SH "NAME" \fBXmDropSiteUpdate\fP \(em A Drag and Drop function that sets resource values for a drop site .iX "XmDropSiteUpdate" .iX "Drag and Drop functions" "XmDropSiteUpdate" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropSiteUpdate\fP\fR( \fBWidget \fBwidget\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteUpdate\fP modifies drop site resources associated with the specified widget\&. This routine updates the drop site resources specified in the \fIarglist\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget registered as a drop site .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RELATED" .PP \fBXmDropSite\fP(3), \fBXmDropSiteEndUpdate\fP(3), \fBXmDropSiteRegister\fP(3), \fBXmDropSiteStartUpdate\fP(3), and \fBXmDropSiteUnregister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmTextFieldCopy.30000644000175000017500000000422312672140200015050 00000000000000'\" t ...\" TxtFieAC.sgm /main/8 1996/09/08 21:12:45 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldCopy" "library call" .SH "NAME" \fBXmTextFieldCopy\fP \(em A TextField function that copies the primary selection to the clipboard .iX "XmTextFieldCopy" .iX "TextField functions" "XmTextFieldCopy" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldCopy\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldCopy\fP copies the primary selected text to the clipboard\&. .PP This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmCOPY\fP\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .IP "\fItime\fP" 10 Specifies the time at which the selection value is to be modified\&. This should be the time of the event that triggered this request\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmDragIcon.30000644000175000017500000002047712672140200014024 00000000000000'\" t ...\" DragIcon.sgm /main/9 1996/09/08 20:39:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDragIcon" "library call" .SH "NAME" \fBXmDragIcon\fP \(em The DragIcon widget class .iX "XmDragIcon" .iX "widget class" "DragIcon" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP A DragIcon is a component of the visual used to represent the source data in a drag and drop transaction\&. During a drag operation, a real or simulated X cursor provides drag-over visuals consisting of a static portion that represents the object being dragged, and dynamic cues that provide visual feedback during the drag operation\&. The visual is attained by blending together various \fBXmDragIcons\fP specified in the \fBXmDragContext\fP associated with the drag operation\&. .PP The static portion of the drag-over visual is the graphic representation that identifies the drag source\&. For example, when a user drags several items within a list, a DragIcon depicting a list might be supplied as the visual\&. The \fBXmDragContext\fP resources, \fBXmNsourceCursorIcon\fP or \fBXmNsourcePixmapIcon\fP, specify a DragIcon to use for the static portion of the visual\&. .PP A drag-over visual incorporates dynamic cues in order to provide visual feedback in response to the user\&'s actions\&. For instance, the drag-over visual might use different indicators to identify the type of operation (copy, link, or move) being performed\&. Dynamic cues could also alert the user that a drop site is valid or invalid as the pointer traverses the drop site\&. The \fBXmNoperationCursorIcon\fP and \fBXmNstateCursorIcon\fP resources of \fBXmDragContext\fP specify DragIcons for dynamic cues\&. .PP A drag-over visual typically consists of a source, operation and state DragIcon\&. The \fBXmNblendModel\fP resource of \fBXmDragContext\fP offers several options that determine which icons are blended to produce the drag-over visual\&. DragIcon resources control the relative position of the operation and state icons (if used)\&. If a particular DragIcon is not specified, the toolkit uses the \fBXmScreen\fP default DragIcons\&. .PP An application initializes a DragIcon with the function \fBXmCreateDragIcon\fP or through entries in the resource database\&. If a pixmap and its mask (optional) are specified in the resource database, the toolkit converts the values in the X11 Bitmap file format and assigns values to the corresponding resources\&. .SS "Classes" .PP DragIcon inherits behavior and a resource from \fBObject\fP\&. .PP The class pointer is \fBxmDragIconObjectClass\fP\&. .PP The class name is \fBXmDragIcon\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDragIcon Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNattachmentXmCAttachmentunsigned charXmATTACH_NORTH_WESTCSG _____ XmNdepthXmCDepthint1CSG _____ XmNheightXmCHeightDimension0CSG _____ XmNhotXXmCHotPosition0CSG _____ XmNhotYXmCHotPosition0CSG _____ XmNmaskXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNoffsetXXmCOffsetPosition0CSG _____ XmNoffsetYXmCOffsetPosition0CSG _____ XmNpixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNwidthXmCWidthDimension0CSG _____ .TE .IP "\fBXmNattachment\fP" 10 Specifies a relative location on the source icon for the attachment of the state or operation icon\&. The origin of the state and operation icons is aligned with the specified compass point on the source icon\&. The \fBXmNoffsetX\fP and \fBXmNoffsetY\fP resources can be used to further refine the icon positions\&. The possible values are .RS .IP "\fBXmATTACH_NORTH_WEST\fP" 10 Attaches the origin of the state or operation icon to the northwest point on the source icon\&. .IP "\fBXmATTACH_NORTH\fP" 10 Attaches the origin of the state or operation icon to the north point on the source icon\&. .IP "\fBXmATTACH_NORTH_EAST\fP" 10 Attaches the origin of the state or operation icon to the northeast point on the source icon\&. .IP "\fBXmATTACH_EAST\fP" 10 Attaches the origin of the state or operation icon to the east point on the source icon\&. .IP "\fBXmATTACH_SOUTH_EAST\fP" 10 Attaches the origin of the state or operation icon to the southeast point on the source icon\&. .IP "\fBXmATTACH_SOUTH\fP" 10 Attaches the origin of the state or operation icon to the south point on the source icon\&. .IP "\fBXmATTACH_SOUTH_WEST\fP" 10 Attaches the origin of the state or operation icon to the southwest point on the source icon\&. .IP "\fBXmATTACH_WEST\fP" 10 Attaches the origin of the state or operation icon to the west point on the source icon\&. .IP "\fBXmATTACH_CENTER\fP" 10 Attaches the origin of the state or operation icon to the center of the source icon\&. The \fBXmNoffsetX\fP and \fBXmNoffsetY\fP resources may be used to center the attached icon\&. .IP "\fBXmATTACH_HOT\fP" 10 Attaches the hotspot coordinates of a state or operation DragIcon to an x,y position on the source icon\&. The x,y coordinate is taken from the event passed to the \fBXmDragStart\fP function, and made relative to the widget passed as an argument to the same function\&. .RE .IP "\fBXmNdepth\fP" 10 Specifies the depth of the pixmap\&. .IP "\fBXmNheight\fP" 10 Specifies the height of the pixmap\&. .IP "\fBXmNhotX\fP" 10 Specifies the x-coordinate of the hotspot of a cursor DragIcon in relation to the origin of the pixmap bounding box\&. .IP "\fBXmNhotY\fP" 10 Specifies the y-coordinate of the hotspot of a cursor DragIcon in relation to the origin of the pixmap bounding box\&. .IP "\fBXmNmask\fP" 10 Specifies a pixmap of depth 1 to use as the DragIcon mask pixmap\&. .IP "\fBXmNoffsetX\fP" 10 Specifies a horizontal offset (in pixels) of the origin of the state or operation icon relative to the attachment point on the source icon\&. A positive offset value moves the origin to the right; a negative value moves the origin to the left\&. .IP "\fBXmNoffsetY\fP" 10 Specifies a vertical offset (in pixels) of the origin of the state or operation icon relative to the attachment point on the source icon\&. A positive offset value moves the origin down; a negative value moves the origin up\&. .IP "\fBXmNpixmap\fP" 10 Specifies a pixmap to use as the DragIcon pixmap\&. .IP "\fBXmNwidth\fP" 10 Specifies the width of the pixmap\&. .SS "Inherited Resources" .PP DragIcon inherits behavior and a resource from \fBObject\fP\&. For a complete description of this resource, refer to the \fBObject\fP reference page\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SH "RELATED INFORMATION" .PP \fBObject\fP(3), \fBXmCreateDragIcon\fP(3), \fBXmDisplay\fP(3), \fBXmDragContext\fP(3), \fBXmDropSite\fP(3), \fBXmDropTransfer\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmSetFontUnits.30000644000175000017500000000464212672140200014737 00000000000000'\" t ...\" SetFonUB.sgm /main/8 1996/09/08 21:02:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSetFontUnits" "library call" .SH "NAME" \fBXmSetFontUnits\fP \(em A function that sets the font unit value for a display .iX "XmSetFontUnits" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmSetFontUnits\fP\fR( \fBDisplay \fB* display\fR\fR, \fBint \fBh_value\fR\fR, \fBint \fBv_value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmSetFontUnits\fP provides an external function to initialize font unit values\&. Applications may want to specify resolution-independent data based on a global font size\&. This function must be called before any widgets with resolution-independent data are created\&. See the \fBXmNunitType\fP resource description in the reference pages for \fBXmGadget\fP, \fBXmManager\fP, and \fBXmPrimitive\fP for more information on resolution independence\&. .PP This function sets the font units for all screens on the display\&. .PP \fBNOTE:\fP \fBXmSetFontUnits\fP is obsolete and exists for compatibility with previous releases\&. Instead of using this function, provide initial values or call \fBXtSetValues\fP for the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fIdisplay\fP" 10 Defines the display for which this font unit value is to be applied\&. .IP "\fIh_value\fP" 10 Specifies the value to be used for horizontal units in the conversion calculations\&. .IP "\fIh_value\fP" 10 Specifies the value to be used for vertical units in the conversion calculations\&. .SH "RELATED" .PP \fBXmConvertUnits\fP(3), \fBXmSetFontUnit\fP(3), \fBXmGadget\fP(3), \fBXmManager\fP(3), \fBXmPrimitive\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextGetSource.30000644000175000017500000000377412672140200015104 00000000000000'\" t ...\" TxtGetSD.sgm /main/8 1996/09/08 21:17:36 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetSource" "library call" .SH "NAME" \fBXmTextGetSource\fP \(em A Text function that accesses the source of the widget .iX "XmTextGetSource" .iX "Text functions" "XmTextGetSource" .SH "SYNOPSIS" .PP .nf #include \fBXmTextSource \fBXmTextGetSource\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetSource\fP accesses the source of the Text widget\&. Text widgets can share sources of text so that editing in one widget is reflected in another\&. This function accesses the source of one widget so that it can be made the source of another widget, using the function \fBXmTextSetSource\fP(3)\&. .PP Setting a new text source destroys the old text source if no other Text widgets are using that source\&. To replace a text source but keep it for later use, create an unmanaged Text widget and set its source to the text source you want to keep\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns an \fBXmTextSource\fR value that represents the source of the Text widget\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmCreateCommand.30000644000175000017500000000344712672140200015036 00000000000000'\" t ...\" CreCoB.sgm /main/7 1996/08/30 14:30:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateCommand" "library call" .SH "NAME" \fBXmCreateCommand\fP \(em The Command widget creation function .iX "XmCreateCommand" .iX "creation functions" "XmCreateCommand" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateCommand\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateCommand\fP creates an instance of a Command widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Command and its associated resources, see \fBXmCommand\fP(3)\&. .SH "RETURN" .PP Returns the Command widget ID\&. .SH "RELATED" .PP \fBXmCommand\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmTextFieldGetSubstringWcs.30000644000175000017500000000621412672140200017235 00000000000000'\" t ...\" TxtFieAQ.sgm /main/9 1996/09/08 21:14:13 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetSubstringWcs" "library call" .SH "NAME" \fBXmTextFieldGetSubstringWcs\fP \(em A TextField function that retrieves a portion of a wide character internal text buffer .iX "XmTextFieldGetSubstring\\%Wcs" .iX "TextField functions" "XmTextFieldGetSubstring\\%Wcs" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextFieldGetSubstringWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBstart\fR\fR, \fBint \fBnum_chars\fR\fR, \fBint \fBbuffer_size\fR\fR, \fBwchar_t *\fBbuffer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetSubstringWcs\fP retrieves a copy of a portion of the internal text buffer of a TextField widget that is stored in a wide character format\&. The function copies a specified number of characters from a given start position in the internal text buffer into a buffer provided by the application\&. A NULL terminator is placed at the end of the copied data\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .IP "\fIstart\fP" 10 Specifies the beginning character position from which the data will be retrieved\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fInum_chars\fP" 10 Specifies the number of \fBwchar_t\fR characters to be copied into the provided buffer\&. .IP "\fIbuffer_size\fP" 10 Specifies the size of the supplied buffer as a number of \fBwchar_t\fR storage locations\&. The minimum size is \fInum_chars\fP + 1\&. .IP "\fIbuffer\fP" 10 Specifies the wide character buffer into which the internal text buffer will be copied\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .IP "\fBXmCOPY_SUCCEEDED\fP" 10 The function was successful\&. .IP "\fBXmCOPY_FAILED\fP" 10 The function failed because it was unable to copy the specified number of characters into the buffer provided\&. The buffer size may be insufficient\&. The contents of \fIbuffer\fP are undefined\&. .IP "\fBXmCOPY_TRUNCATED\fP" 10 The requested number of characters extended beyond the internal buffer\&. The function copied characters to the end of the buffer and terminated the string with a NULL terminator; fewer than \fInum_chars\fP characters were copied\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldGetSubstring\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmToggleButton.30000644000175000017500000007404112672140200014747 00000000000000'\" t ...\" ToggleBA.sgm /main/16 1996/09/25 13:46:15 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmToggleButton" "library call" .SH "NAME" \fBXmToggleButton\fP \(em The ToggleButton widget class .iX "XmToggleButton" .iX "widget class" "ToggleButton" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP ToggleButton sets nontransitory state data within an application\&. Usually this widget consists of an indicator (square, diamond, or round) with either text or a pixmap on one side of it\&. However, it can also consist of just text or a pixmap without the indicator\&. .PP The toggle graphics display a \fB1-of-many\fP, \fBN-of-many\fP, or \fB1-of-many-round\fP selection state\&. When a toggle indicator is displayed, a square indicator shows an \fBN-of-many\fP selection state, a diamond-shaped indicator shows a \fB1-of-many\fP selection state, and a circle-shaped indicator shows a \fB1-of-many-round\fP selection state\&. .PP ToggleButton implies a set or unset state\&. In the case of a label and an indicator, an empty indicator (square, diamond, or round) indicates that ToggleButton is unset, and a filled indicator shows that it is set\&. The indicator may be filled with a check mark, a cross, or the select color\&. In the case of a pixmap toggle, different pixmaps are used to display the set/unset states\&. ToggleButton can also indicate an indeterminate state\&. In the case of a label and an indicator, an indeterminate state is indicated by a stippled flat box\&. In the case of a pixmap toggle, a different pixmap is used to display the indeterminate state\&. .PP The default behavior associated with a ToggleButton in a menu depends on the type of menu system in which it resides\&. By default, \fB\fP controls the behavior of the ToggleButton\&. In addition, \fB\fP controls the behavior of the ToggleButton if it resides in a PopupMenu system\&. The actual mouse button used is determined by its RowColumn parent\&. .PP Label\&'s resource \fBXmNmarginLeft\fP may be increased to accommodate the toggle indicator when it is created\&. .PP ToggleButton uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits\&. .SS "Classes" .PP ToggleButton inherits behavior, resources, and traits from \fBCore\fP, \fBXmPrimitive\fP, and \fBXmLabel\fP\&. .PP The class pointer is \fBxmToggleButtonWidgetClass\fP\&. .PP The class name is \fBXmToggleButton\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmToggleButton Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNarmCallbackXmCArmCallbackXtCallbackListNULLC _____ XmNdetailShadowThicknessXmCDetailShadowThicknessDimension2CSG _____ XmNdisarmCallbackXmCDisarmCallbackXtCallbackListNULLC _____ XmNfillOnSelectXmCFillOnSelectBooleandynamicCSG _____ XmNindeterminatePixmapXmCIndeterminatePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNindicatorOnXmCIndicatorOnunsigned charXmINDICATOR_FILLCSG _____ XmNindicatorSizeXmCIndicatorSizeDimensiondynamicCSG _____ XmNindicatorTypeXmCIndicatorTypeunsigned chardynamicCSG _____ XmNselectColorXmCSelectColorPixeldynamicCSG _____ XmNselectInsensitivePixmapXmCSelectInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNselectPixmapXmCSelectPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNsetXmCSetunsigned charXmUNSETCSG _____ XmNspacingXmCSpacingDimension4CSG _____ XmNtoggleModeXmCToggleModeunsigned charXmTOGGLE_BOOLEANCSG _____ XmNunselectColorXmCUnselectColorPixeldynamicCSG _____ XmNvalueChangedCallbackXmCValueChangedCallbackXtCallbackListNULLC _____ XmNvisibleWhenOffXmCVisibleWhenOffBooleandynamicCSG _____ .TE .IP "\fBXmNarmCallback\fP" 10 Specifies the list of callbacks called when the ToggleButton is armed\&. To arm this widget, press the active mouse button while the pointer is inside the ToggleButton\&. For this callback, the reason is \fBXmCR_ARM\fP\&. .IP "\fBXmNdetailShadowThickness\fP" 10 Specifies the thickness of the indicator shadow\&. The default thickness is 2 pixels\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies the list of callbacks called when ToggleButton is disarmed\&. To disarm this widget, press and release the active mouse button while the pointer is inside the ToggleButton\&. This widget is also disarmed when the user moves out of the widget and releases the mouse button when the pointer is outside the widget\&. For this callback, the reason is \fBXmCR_DISARM\fP\&. .IP "\fBXmNfillOnSelect\fP" 10 Fills the indicator with the color specified in \fBXmNselectColor\fP and switches the top and bottom shadow colors when set to True\&. If unset, fills the indicator with the unselect color\&. If indeterminate, fills the indicator with half select color and half unselect color\&. Otherwise, it switches only the top and bottom shadow colors\&. The default is True only if a box type of indicator (such as a check box) is specified, or if the \fBXmNindicatorType\fP is a \fB1-of\fP type and a toggle indicator is drawn\&. .IP "" 10 If \fBXmNfillOnSelect\fP is True, \fBXmNset\fP is \fBXmSET\fP, and \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP the ToggleButton\&'s background is set to \fBXmNselectColor\fP\&. For the other \fBXmNindicatorOn\fP values, only the indicator is filled with \fBXmNselectColor\fP\&. .IP "\fBXmNindeterminateInsensitivePixmap\fP" 10 Specifies the pixmap to be displayed as the button face when the Label \fBXmNlableType\fP resource is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the ToggleButton \fBXmNset\fP resource is \fBXmINDETERMINATE\fP, and the \fBCore\fP \fBXmNsensitive\fP resource is False\&. .IP "\fBXmNindeterminatePixmap\fP" 10 Specifies the pixmap to be displayed as the button face when the Label \fBXmNlableType\fP resource is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the ToggleButton \fBXmNset\fP resource is \fBXmINDETERMINATE\fP, and the \fBCore\fP \fBXmNsensitive\fP resource is True\&. .IP "\fBXmNindicatorOn\fP" 10 Specifies that if a toggle indicator is to be drawn, it will be drawn to one side of the toggle text or pixmap, depending on the \fBXmNlayoutDirection\fP resource of the widget\&. The default value is \fBXmINDICATOR_FILL\fP\&. Toggles accept the following values: .RS .IP "\fBXmINDICATOR_NONE\fP" 10 No space is allocated for the indicator, and it is not displayed\&. Any shadows around the entire widget are switched when the toggle is selected or unselected\&. .IP "\fBXmINDICATOR_BOX\fP" 10 The toggle indicator is in the shape of a shadowed box\&. .IP "\fBXmINDICATOR_FILL\fP" 10 If the value of the \fBXmDisplay XmNenableToggleVisual\fP resource is \fBTrue\fP , the visuals are those of \fBXmINDICATOR_CHECK_BOX\fP ; if \fBFalse\fP , the indicator visuals are those of \fBXmINDICATOR_BOX\fP\&. .IP "\fBXmINDICATOR_CHECK\fP" 10 The toggle indicator is in the shape of a checkmark in the foreground color\&. .IP "\fBXmINDICATOR_CHECK_BOX\fP" 10 The toggle indicator is in the shape of a checkmark enclosed in a box\&. This is the default if the \fBXmDisplay XmNenableToggleVisual\fP resource is set\&. .IP "\fBXmINDICATOR_CROSS_BOX\fP" 10 The toggle indicator is in the shape of a cross enclosed in a box\&. .IP "\fBXmINDICATOR_CROSS\fP" 10 The toggle indicator is in the shape of a cross\&. .RE .IP "" 10 All ToggleButton checks and crosses should be drawn in the foreground color\&. .IP "" 10 If this resource is not \fBXmINDICATOR_NONE\fP, it will control the appearance of the toggle visual\&. If \fBXmNset\fP is \fBXmINDETERMINATE\fP and \fBXmNindicatorOn\fP is not \fBXmINDICATOR_NONE\fP, this resource shows a stippled flat box\&. If \fBXmNset\fP is \fBXmINDETERMINATE\fP, \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP, and \fBXmNtoggleMode\fP is \fBXmTOGGLE_INDETERMINATE\fP, the label and the ToggleButton are stippled with a combination of the \fBXmNselectColor\fP and the \fBXmNunselectColor\fP color, and the border is flat\&. .IP "\fBXmNindicatorSize\fP" 10 Sets the size of the indicator\&. If no value is specified, the size of the indicator is based on the size of the label string or pixmap\&. If the label string or pixmap changes, the size of the indicator is recomputed based on the size of the label string or pixmap\&. Once a value has been specified for \fBXmNindicatorSize\fP, the indicator has that size, regardless of the size of the label string or pixmap, until a new value is specified\&. The size of indicators inside menus may differ from those outside of menus\&. Note that a change in this resource may also cause a change in the values of the inherited resources \fBXmNmarginTop\fP, \fBXmNmarginBottom\fP, and \fBXmNmarginLeft\fP\&. .IP "\fBXmNindicatorType\fP" 10 Specifies if the indicator is a \fB1-of\fP or \fBN-of\fP indicator\&. For the \fB1-of\fP indicator, the value can be \fBXmONE_OF_MANY\fP, \fBXmONE_OF_MANY_ROUND\fP, or \fBXmONE_OF_MANY_DIAMOND\fP\&. For the \fBN-of\fP indicator, the value is \fBXmN_OF_MANY\fP\&. This value specifies only the visuals and does not enforce the behavior\&. When the ToggleButton is in a radio box, the default is \fBXmONE_OF_MANY\fP; otherwise, the default is \fBXmN_OF_MANY\fP\&. Legal values are: .RS .IP "\fBXmONE_OF_MANY\fP" 10 When the Display \fBXmNenableToggleVisual\fP resource is set, indicators are drawn with the same appearance as \fBXmONE_OF_MANY_ROUND\fP; otherwise, they appear the same as \fBXmONE_OF_MANY_DIAMOND\fP\&. .IP "\fBXmN_OF_MANY\fP" 10 The indicators are drawn as specified by the \fBXmNindicatorOn\fP resource\&. .IP "\fBXmONE_OF_MANY_ROUND\fP" 10 A shadowed circle\&. .IP "\fBXmONE_OF_MANY_DIAMOND\fP" 10 A shadowed diamond\&. .RE .IP "\fBXmNselectColor\fP" 10 Allows the application to specify what color fills the center of the square, diamond-shaped, or round indicator when it is set\&. If this color is the same as either the top or the bottom shadow color of the indicator, a one-pixel-wide margin is left between the shadows and the fill; otherwise, it is filled completely\&. The results of this resource depend on the value of the Display resource \fBXmNenableToggleColor\fP\&. A value of True causes the fill color to use the \fBXmHIGHLIGHT_COLOR\fP color by default\&. A value of False causes the fill color to use the background color\&. This resource\&'s default for a color display is a color between the background and the bottom shadow color\&. For a monochrome display, the default is set to the foreground color\&. To set the background of the button to \fBXmNselectColor\fP when \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP, the value of \fBXmNfillOnSelect\fP must be explicitly set to True\&. .IP "" 10 This resource is also used as the background color when all of the following conditions are met: the button is armed in a menu, the \fBXmNenableEtchedInMenu\fP resource is \fBTrue\fP, the \fBXmNindicatorOn\fP resource is \fBFalse\fP, and the \fBXmNfillOnSelect\fP resource is \fBTrue\fP\&. .IP "" 10 This resource can take the following values: .RS .IP "\fBXmDEFAULT_SELECT_COLOR\fP" 10 Is the same as the current dynamic default, which is a color between the background and the bottom shadow color\&. .IP "\fBXmREVERSED_GROUND_COLORS\fP" 10 Forces the select color to the foreground color and causes the default color of any text rendered over the select color to be in the background color\&. .IP "\fBXmHIGHLIGHT_COLOR\fP" 10 Forces the fill color to use the highlight color\&. .RE .IP "\fBXmNselectInsensitivePixmap\fP" 10 Specifies a pixmap used as the button face when the ToggleButton is selected, the button is insensitive, and the Label resource \fBXmNlabelType\fP is set to \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&. If the ToggleButton is unselected and the button is insensitive, the pixmap in \fBXmNlabelInsensitivePixmap\fP is used as the button face\&. If no value is specified for \fBXmNlabelInsensitivePixmap\fP, that resource is set to the value specified for \fBXmNselectInsensitivePixmap\fP\&. .IP "\fBXmNselectPixmap\fP" 10 Specifies the pixmap to be used as the button face when \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, and the ToggleButton is selected\&. When the ToggleButton is unselected, the pixmap specified in the Label\&'s \fBXmNlabelPixmap\fP is used\&. If no value is specified for \fBXmNlabelPixmap\fP, that resource is set to the value specified for \fBXmNselectPixmap\fP\&. .IP "\fBXmNset\fP" 10 Represents the state of the ToggleButton\&. A value of \fBXmUNSET\fP indicates that the ToggleButton is not set\&. A value of \fBXmSET\fP indicates that the ToggleButton is set\&. A value of \fBXmINDETERMINATE\fP indicates that the ToggleButton is in an indeterminate state (neither set nor unset)\&. The ToggleButton states cycle through in the order of \fBXmSET\fP, \fBXmINDETERMINATE\fP (if \fBXmNtoggleMode\fP is set to \fBXmTOGGLE_INDETERMINATE\fP), and \fBXmUNSET\fP, and then back around to \fBXmSET\fP\&. If \fBXmNtoggleMode\fP is set to \fBXmTOGGLE_BOOLEAN\fP, then the ToggleButton states cycle through in the order of \fBXmSET\fP, then \fBXmUNSET\fP, and then back around to \fBXmSET\fP\&. Setting this resource sets the state of the ToggleButton\&. .IP "\fBXmNspacing\fP" 10 Specifies the amount of spacing between the toggle indicator and the toggle label (text or pixmap)\&. .IP "\fBXmNtoggleMode\fP" 10 Specifies the mode of the ToggleButton as either \fBXmTOGGLE_BOOLEAN\fP or \fBXmTOGGLE_INDETERMINATE\fP\&. The \fBXmTOGGLE_INDETERMINATE\fP value allows the \fBXmNset\fP resource to be able to accept the values \fBXmINDETERMINATE\fP, \fBXmSET\fP, and \fBXmUNSET\fP\&. The \fBXmNtoggleMode\fP resource is forced to \fBXmTOGGLE_BOOLEAN\fP if the toggle is in an \fBXmRowColumn\fP widget whose radio behavior is \fBXmONE_OF_MANY\fP\&. In \fBXmTOGGLE_BOOLEAN\fP mode, the \fBXmNset\fP resource can only accept \fBXmSET\fP and \fBXmUNSET\fP\&. .IP "\fBXmNunselectColor\fP" 10 Allows the application to specify what color fills the center of the square, diamond-shaped, or round indicator when it is not set\&. If this color is the same as either the top or the bottom shadow color of the indicator, a one-pixel-wide margin is left between the shadows and the fill; otherwise, it is filled completely\&. This resource\&'s default for a color display is \fBXmNbackground\fP\&. For a monochrome display, the default is set to the background color\&. To set the background of the button to \fBXmNunselectColor\fP when \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP, the value of \fBXmNfillOnSelect\fP must be explicitly set to True\&. This resource acts like the \fBXmNselectColor\fP resource, but for the case when \fBXmNset\fP is \fBXmUNSET\fP\&. .IP "\fBXmNvalueChangedCallback\fP" 10 Specifies the list of callbacks called when the ToggleButton value is changed\&. To change the value, press and release the active mouse button while the pointer is inside the ToggleButton\&. This action also causes this widget to be disarmed\&. For this callback, the reason is \fBXmCR_VALUE_CHANGED\fP\&. .IP "\fBXmNvisibleWhenOff\fP" 10 Indicates that the toggle indicator is visible in the unselected state when the Boolean value is True\&. When the ToggleButton is in a menu, the default value is False\&. When the ToggleButton is in a RadioBox, the default value is True\&. .SS "Inherited Resources" .PP ToggleButton inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabel Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLCSG _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLCSG _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimensiondynamicCSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimensiondynamicCSG _____ XmNmarginRightXmCMarginRightDimension0CSG _____ XmNmarginTopXmCMarginTopDimensiondynamicCSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGCSG _____ XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG _____ XmNpixmapTextPaddingXmCSpaceDimension2CSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIset\fP; } XmToggleButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fIset\fP" 10 Reflects the ToggleButton\&'s state, either \fBXmSET\fP (selected), \fBXmUNSET\fP (unselected), or \fBXmINDETERMINATE\fP (neither)\&. Note that the reported state is the state that the ToggleButton is in after the \fIevent\fP has been processed\&. For example, suppose that a user clicks on a ToggleButton to change it from the unselected state to the selected state\&. In this case, ToggleButton changes the value of \fIset\fP from \fBXmUNSET\fP to \fBXmSET\fP prior to calling the callback\&. .SS "Translations" .PP \fBXmToggleButton\fP includes translations from \fIPrimitive\fP\&. Additional \fBXmToggleButton\fP translations for buttons not in a menu system are described in the following list\&. .PP Note that altering translations in \fB#override\fP or \fB#augment\fP mode is undefined\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fBc\fP:" 10 ButtonTakeFocus() .IP "\fB\(apc\fP\fB\fP:" 10 Arm() .IP "\fB\(apc\fP\fB\fP:" 10 Select() Disarm() .IP "\fB\fP:" 10 ProcessDrag() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ArmAndActivate() .PP \fBXmToggleButton\fP inherits menu traversal translations from \fBXmLabel\fP\&. Additional \fBXmToggleButton\fP translations for \fBToggleButtons\fP in a menu system are described in the following list\&. In a Popup menu system, \fB\fP also performs the \fB\fP actions\&. .IP "\fB\fP:" 10 ProcessDrag() .IP "\fBc\fP:" 10 MenuButtonTakeFocus() .IP "\fBc\fP:" 10 MenuButtonTakeFocusUp() .IP "\fB\(apc\fP\fB\fP:" 10 BtnDown() .IP "\fB\(apc\fP\fB\fP:" 10 BtnUp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuEscape() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 ArmAndActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ArmAndActivate() .SS "Action Routines" .PP The \fBXmToggleButton\fP action routines are .IP "Arm():" 10 If the button was previously unset, this action does the following: if \fBXmNindicatorOn\fP is True, it draws the indicator shadow so that the indicator looks pressed; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the color specified by \fBXmNselectColor\fP\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks pressed\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNselectPixmap\fP is used as the button face\&. This action calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 If the button was previously set, this action does the following: if both \fBXmNindicatorOn\fP and \fBXmNvisibleWhenOff\fP are True, it draws the indicator shadow so that the indicator looks raised; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the background color\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks raised\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used as the button face\&. This action calls the \fBXmNarmCallback\fP callbacks\&. .IP "ArmAndActivate():" 10 If the ToggleButton was previously set, unsets it; if the ToggleButton was previously unset, sets it\&. .IP "" 10 In a menu, this action unposts all menus in the menu hierarchy\&. Unless the button is already armed, it calls the \fBXmNarmCallback\fP callbacks\&. This action calls the \fBXmNvalueChangedCallback\fP and \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, if the button was previously unset, this action does the following: if \fBXmNindicatorOn\fP is True, it draws the indicator shadow so that the indicator looks pressed; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the color specified by \fBXmNselectColor\fP\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks pressed\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNselectPixmap\fP is used as the button face\&. This action calls the \fBXmNarmCallback\fP, \fBXmNvalueChangedCallback\fP, and \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, if the button was previously set, this action does the following: if both \fBXmNindicatorOn\fP and \fBXmNvisibleWhenOff\fP are True, it draws the indicator shadow so that the indicator looks raised; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the background color\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks raised\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used as the button face\&. This action calls the \fBXmNarmCallback\fP, \fBXmNvalueChangedCallback\fP, and \fBXmNdisarmCallback\fP callbacks\&. .IP "BtnDown():" 10 This action unposts any menus posted by the ToggleButton\&'s parent menu, disables keyboard traversal for the menu, and enables mouse traversal for the menu\&. It draws the shadow in the armed state and, unless the button is already armed, calls the \fBXmNarmCallback\fP callbacks\&. .IP "BtnUp():" 10 This action unposts all menus in the menu hierarchy\&. If the ToggleButton was previously set, unsets it; if the ToggleButton was previously unset, sets it\&. It calls the \fBXmNvalueChangedCallback\fP callbacks and then the \fBXmNdisarmCallback\fP callbacks\&. .IP "ButtonTakeFocus():" 10 Causes the ToggleButton to take keyboard focus when \fBCtrl\fP is pressed, without activating the widget\&. .IP "Disarm():" 10 Calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "Help():" 10 In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy and restores keyboard focus to the widget that had the focus before the menu system was entered\&. Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "MenuShellPopdownOne():" 10 In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, unposts the menu\&. .IP "" 10 In a Popup MenuPane, unposts the menu and restores keyboard focus to the widget from which the menu was posted\&. .IP "ProcessDrag():" 10 Drags the contents of a ToggleButton label, identified when \fBBTransfer\fP is pressed\&. This action sets the \fBXmNconvertProc\fP of the DragContext to a function that calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fB_MOTIF_DROP\fP selection\&. This action is undefined for ToggleButtons used in a menu system\&. .IP "Select():" 10 If the pointer is within the button, takes the following actions: If the button was previously unset, sets it; if the button was previously set, unsets it\&. This action calls the \fBXmNvalueChangedCallback\fP callbacks\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the armed state and calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 If the ToggleButton is not in a menu and the cursor leaves and then reenters the ToggleButton\&'s window while the button is pressed, this action restores the button\&'s armed appearance\&. .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the unarmed state and calls the \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 If the ToggleButton is not in a menu and the cursor leaves the ToggleButton\&'s window while the button is pressed, this action restores the button\&'s unarmed appearance\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateRadioBox\fP(3), \fBXmCreateToggleButton\fP(3), \fBXmLabel\fP(3), \fBXmPrimitive\fP(3), \fBXmRowColumn\fP(3), \fBXmToggleButtonGetState\fP(3), \fBXmToggleButtonSetState\fP(3), \fBXmVaCreateToggleButton\fP(3), \fBXmVaCreateManagedToggleButton\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextFindStringWcs.30000644000175000017500000000571612672140200015726 00000000000000'\" t ...\" TxtFindB.sgm /main/9 1996/09/25 14:51:45 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFindStringWcs" "library call" .SH "NAME" \fBXmTextFindStringWcs\fP \(em A Text function that finds the beginning position of a wide character text string .iX "XmTextFindStringWcs" .iX "Text functions" "XmTextFindStringWcs" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFindStringWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBstart\fR\fR, \fBwchar_t *\fBwcstring\fR\fR, \fBXmTextDirection \fBdirection\fR\fR, \fBXmTextPosition *\fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFindStringWcs\fP locates the beginning position of a specified wide character text string\&. This routine searches forward or backward for the first occurrence of the string, starting from the given start position\&. If a match is found, the function returns the position of the first character of the string in \fIposition\fP\&. If the match string begins at the current position, this routine returns the current position\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fIstart\fP" 10 Specifies the character position from which the search proceeds\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fIwcstring\fP" 10 Specifies the wide character search string\&. .IP "\fIdirection\fP" 10 Indicates the search direction\&. It is relative to the primary direction of the text\&. The possible values are .RS .IP "\fBXmTEXT_FORWARD\fP" 10 The search proceeds toward the end of the buffer\&. .IP "\fBXmTEXT_BACKWARD\fP" 10 The search proceeds toward the beginning of the buffer\&. .RE .IP "\fIposition\fP" 10 Specifies the pointer in which the first character position of the string match is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. If the function returns False, this value is undefined\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns True if a string match is found; otherwise, returns False\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextFindString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmSetFontUnit.30000644000175000017500000000434012672140200014547 00000000000000'\" t ...\" SetFonUA.sgm /main/8 1996/09/08 21:02:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSetFontUnit" "library call" .SH "NAME" \fBXmSetFontUnit\fP \(em A function that sets the font unit value for a display .iX "XmSetFontUnit" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmSetFontUnit\fP\fR( \fBDisplay \fB* display\fR\fR, \fBint \fBfont_unit_value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmSetFontUnit\fP provides an external function to initialize font unit values\&. Applications may want to specify resolution-independent data based on a global font size\&. See the \fBXmNunitType\fP resource description in the reference pages for \fBXmGadget\fP, \fBXmManager\fP, and \fBXmPrimitive\fP for more information on resolution independence\&. .PP This function sets the font units for all screens on the display\&. .PP \fBNOTE:\fP \fBXmSetFontUnit\fP is obsolete and exists for compatibility with previous releases\&. Instead of using this function, provide initial values or call \fBXtSetValues\fP for the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fIdisplay\fP" 10 Defines the display for which this font unit value is to be applied\&. .IP "\fIfont_unit_value\fP" 10 Specifies the value to be used for both horizontal and vertical font units in the conversion calculations\&. .SH "RELATED" .PP \fBXmConvertUnits\fP(3), \fBXmSetFontUnits\fP(3), \fBXmGadget\fP(3), \fBXmManager\fP(3), \fBXmPrimitive\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextShowPosition.30000644000175000017500000000366712672140200015652 00000000000000'\" t ...\" TxtShowP.sgm /main/8 1996/09/08 21:20:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextShowPosition" "library call" .SH "NAME" \fBXmTextShowPosition\fP \(em A Text function that forces text at a given position to be displayed .iX "XmTextShowPosition" .iX "Text functions" "XmTextShowPosition" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextShowPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextShowPosition\fP forces text at the specified position to be displayed\&. If the \fBXmNautoShowCursorPosition\fP resource is True, the application should also set the insert cursor to this position\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIposition\fP" 10 Specifies the character position to be displayed\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .PP If a navigator exists, this function uses the \fBXmQTnavigator\fP trait to update the horizontal navigator\&'s value\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmTransferDone.30000644000175000017500000000775112672140200014730 00000000000000'\" t ...\" TransfA.sgm /main/8 1996/08/30 16:20:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTransferDone" "library call" .SH "NAME" \fBXmTransferDone\fP \(em A toolkit function that completes a data transfer .iX "XmTransferDone" .iX "toolkit functions" "XmTransferDone" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBXmTransferDone\fP\fR( \fBXtPointer \fBtransfer_id\fR\fR, \fBXmTransferStatus \fBstatus\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTransferDone\fP completes an already-initiated data transfer operation\&. An application can call this routine from an \fBXmNdestinationCallback\fP procedure or any function called as a result, including the selection procedures called as a result of calls to \fBXmTransferValue\fP\&. .PP The caller of \fBXmTransferDone\fP supplies an identifier for the transfer operation and an indication of the completion status\&. \fBXmTransferDone\fP causes any remaining transfers for the operation to be discarded\&. .IP "\fBtransfer_id\fP" 10 Specifies a unique indentifier for the data transfer operation\&. The value must be the same as the value of the \fBtransfer_id\fP member of the \fBXmDestinationCallbackStruct\fR passed to the \fBXmNdestinationCallback\fP procedure\&. .IP "\fIstatus\fP" 10 Specifies the completion status of the data transfer\&. Following are the possible values: .RS .IP "\fBXmTRANSFER_DONE_SUCCEED\fP" 10 The transfer was completed successfully\&. This status has the following additional effects: .RS .IP " \(bu" 6 For a move operation, the selection owner receives a request to convert the selection to the \fBDELETE\fP target\&. .IP " \(bu" 6 If a \fBTRANSACT\fP operation is in progress, the owner receives a request to commit the transaction\&. .IP " \(bu" 6 If a \fBPERSIST\fP or \fB_MOTIF_SNAPSHOT\fP operation is in progress, the owner receives a notification that the operation is finished\&. .IP " \(bu" 6 The widget class destination procedure is not called\&. .RE .IP "\fBXmTRANSFER_DONE_FAIL\fP" 10 The transfer was completed unsuccessfully\&. This status has the following additional effects: .RS .IP " \(bu" 6 For a move operation, the selection owner does not receive a request to convert the selection to the \fBDELETE\fP target\&. .IP " \(bu" 6 For a drag and drop operation, the DropTransfer\&'s \fBXmNtransferStatus\fP is set to \fBXmTRANSFER_FAILURE\fP\&. .IP " \(bu" 6 If a \fBTRANSACT\fP operation is in progress, the owner receives a request to abort the transaction\&. .IP " \(bu" 6 If a \fBPERSIST\fP or \fB_MOTIF_SNAPSHOT\fP operation is in progress, the owner receives a notification that the operation is finished\&. .IP " \(bu" 6 The widget class destination procedure is not called\&. .RE .IP "\fBXmTRANSFER_DONE_CONTINUE\fP" 10 This status has the same effect as \fBXmTRANSFER_DONE_SUCCEED\fP, except that if a \fBPERSIST\fP or \fB_MOTIF_SNAPSHOT\fP operation is in progress, the owner does not receive a notification that the operation is finished\&. .IP "\fBXmTRANSFER_DONE_DEFAULT\fP" 10 The widget class destination procedure is called\&. Further effects depend on the actions of that procedure\&. .RE .SH "RELATED" .PP \fBXmTransferSendRequest\fP(3), \fBXmTransferStartRequest\fP(3), \fBXmTransferStartRequest\fP(3), and \fBXmTransferValue\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmStringFreeContext.30000644000175000017500000000301012672140200015733 00000000000000'\" t ...\" StrFrB.sgm /main/7 1996/08/30 16:10:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringFreeContext" "library call" .SH "NAME" \fBXmStringFreeContext\fP \(em A compound string function that releases the string scanning context data structure .iX "XmStringFreeContext" .iX "compound string functions" "XmStringFreeContext" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmStringFreeContext\fP\fR( \fBXmStringContext \fBcontext\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringFreeContext\fP releases the string scanning context data structure\&. .IP "\fIcontext\fP" 10 Specifies the string context structure that was allocated by the \fBXmStringInitContext\fP function .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringInitContext\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmTree.30000644000175000017500000001257112672140200013231 00000000000000.DT .TH XmForm 3X "15 July 1992" .SH NAME XmTree - The Tree widget class .SH SYNOPSIS #include .SH DESCRIPTION .PP .TS tab (%); l l. .TE .PP The Tree widget is a container that shows the relationship of its children in a graphical tree-like format. Each child of the Tree widget is a node in the Tree. The parent-child relationships between these nodes are completely distinct from the widget hierarch.. The hierarchy of nodes is created by specifying the tree "parent" of each node as a constraint resource. If a node's parent is NULL then it is assumed to be a root of the tree. Although each widget can only have one parent, the Tree widget supports adding more than one "root" node to a single Tree. .PP Note: the Tree widget assumes that is will be totally responsible for mapping and unmapping its children. Therefore no child of this widget should ever modify its mappedWhenManaged resource. If a child does modify this resource the behavior is undefined. .PP .SH User Interaction .PP Each node in the tree can be in four states: open, closed, always open, and hidden. The state of a node changes how it appears to the user and what actions are available to the user. .ta 15 .HP 15 Open This node will have an open folder shown to its left that may be selected by the user to close this node. When a node is open all of its children will be visible to the user. .ta 15 .HP 15 Closed This node will have a closed folder shown to its left that may be selected by the user to open this node. When a node is closed none of its children will be visible to the user. .ta 15 .HP 15 Always Open This node will have no folder button associated with it. All of its children will be visible to the user. .ta 15 .HP 15 Hidden This node will not be shown to the user and all of its children will appear and act exactly as if they were children of this node's parent. It will appear to the user as if this node does not exist. .PP To maintain consistency of the user interface we have found that it is bestto use the node state "Always Open" for nodes with no children. This way the user will only see a folder button next to a node that has children to display. A folder button associated with a node that has no children has no defined semantics. .PP .SH Normal Resources .PP .TS tab (%); l l l l. Name%Class%Type%Initial Value connectStyle%ConnectStyle%unsigned char%XmTreeDirect horizontalNodeSpace%Dimension%HorizontalDimension%20 verticalNodeSpace%Dimension%VerticalDimension%2 .TE .PP All resource names begin with XmN and all resource class names begin with XmC. .PP .SH connectStyle .PP The style of the lines visually connecting parent nodes to children nodes. The valid styles are XmTreeDirect or XmTreeLadder. .SH horizontalNodeSpace .PP .SH verticalNodeSpace .PP The amount of space between each node in the tree and it nearest neighbor. The following resources are inherited from the XmHierarchy widget: .TS tab (%); l l l l. Name%Class%Type%Initial Value autoClose%AutoClose%Boolean%True closeFolderPixmap%Pixmap%Pixmap%XmUNSPECIFIED_PIXMAP horizontalMargin%Dimension%HorizontalDimension%2 openFolderPixmap%Pixmap%Pixmap%XmUNSPECIFIED_PIXMAP refigureMode%Boolean%Boolean%True verticalMargin%Dimension%VerticalDimension%2 .TE .PP All resource names begin with XmN and all resource class names begin with XmC. .PP .SH Constraint Resources .PP .TS tab (%); l l l l. Name%Class%Type%Initial Value openClosePadding%OpenClosePadding%Int%0 lineColor%Foreground%Pixel% lineWidth%LineWidth%Dimension%0 .TE .PP All resource names begin with XmN and all resource class names begin with XmC. openClosePadding .PP The number of pixels between the folder button and the node it is associated with. .PP .SH lineColor .PP The color of the line connecting a node to its parent. The default value for this resource is the foreground color of the Tree widget. .PP .SH lineWidth .PP The width of a connection line between a node and its parent .PP The following constraint resources are inherited from the XmHierarchy widget: .PP .TS tab (%); l l l l. Name%Class%Type%Initial Value insertBefore%InsertBefore%Widget%NULL nodeState%NodeState%XmHierarchyNodeState%Open parentNode%ParentNode%Widget%NULL .TE .PP All resource names begin with XmN and all resource class names begin with XmC. Geometry Management: .PP The layout is performed by assigning each node a box that is just large enough to con- tain itself and all of its children. A recursive layout is then performed that centers each node vertically in its box and at the extreme left horizontally. The children's boxes are then placed to the right of the node separated by the horizontalNodeSpace from their parent, stacked above each other and separated by verticalNodeSpace. This process is repeated recursively for each child in the tree. .PP The preferred size of the entire tree will be just large enough to contain all nodes in the hierarchy. As the state of nodes change the tree will attempt to resize itself to con- tain its current configuration. If the tree is forced larger than the desired size the nodes will be centered vertically and flush to the left edge of the tree widget. If the tree is forced smaller, some nodes may be moved or drawn outside the end of the tree. For this reason it is usually desirable to put the tree into a Scrolled Window widget. .PP .SH SEE ALSO .PP XmColumn(3X) .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmVaCreateManagedDropDown.30000644000175000017500000000003612672140200016747 00000000000000.so man3/XmVaCreateDropDown.3 motif-2.3.8/doc/man/man3/XmVaCreateManagedSeparatorGadget.30000644000175000017500000000004512672140200020267 00000000000000.so man3/XmVaCreateSeparatorGadget.3 motif-2.3.8/doc/man/man3/XmListDeletePositions.30000644000175000017500000000411612672140200016274 00000000000000'\" t ...\" LstDeleF.sgm /main/8 1996/09/08 20:50:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeletePositions" "library call" .SH "NAME" \fBXmListDeletePositions\fP \(em A List function that deletes items from a list based on an array of positions .iX "XmListDeletePositions" .iX "List functions" "XmListDeletePositions" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeletePositions\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint *\fBposition_list\fR\fR, \fBint \fBposition_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeletePositions\fP deletes noncontiguous items from a list\&. The function deletes all items whose corresponding positions appear in the \fIposition_list\fP array\&. A warning message is displayed if a specified position is invalid; that is, the value is 0, a negative integer, or a number greater than the number of items in the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIposition_list\fP" 10 Specifies an array of the item positions to be deleted\&. The position of the first item in the list is 1; the position of the second item is 2; and so on\&. .IP "\fIposition_count\fP" 10 Specifies the number of elements in the \fIposition_list\fP\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmTextSetEditable.30000644000175000017500000000313012672140200015353 00000000000000'\" t ...\" TxtSetEd.sgm /main/7 1996/08/30 16:32:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetEditable" "library call" .SH "NAME" \fBXmTextSetEditable\fP \(em A Text function that sets the edit permission .iX "XmTextSetEditable" .iX "Text functions" "XmTextSetEditable" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetEditable\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBeditable\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetEditable\fP sets the edit permission state of the Text widget\&. When set to True, the text string can be edited\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIeditable\fP" 10 Specifies a Boolean value that when True allows text string edits .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmArrowButtonGadget.30000644000175000017500000002414212672140200015731 00000000000000'\" t ...\" ArrowBuB.sgm /main/11 1996/09/08 20:25:10 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmArrowButtonGadget" "library call" .SH "NAME" \fBXmArrowButtonGadget\fP \(em The ArrowButtonGadget widget class .iX "XmArrowButtonGadget" .iX "widget class" "ArrowButtonGadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP ArrowButtonGadget consists of a directional arrow surrounded by a border shadow\&. When it is selected, the shadow changes to give the appearance that the ArrowButtonGadget has been pressed in\&. When it is unselected, the shadow reverts to give the appearance that the button is released, or out\&. .PP ArrowButtonGadget holds the \fBXmQTactivatable\fP trait\&. .SS "Classes" .PP ArrowButtonGadget inherits behavior, resources, and traits from the \fBObject\fP, \fBRectObj\fP, and \fBXmGadget\fP classes\&. .PP The class pointer is \fBxmArrowButtonGadgetClass\fP\&. .PP The class name is \fBXmArrowButtonGadget\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmArrowButtonGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNarrowDirectionXmCArrowDirectionunsigned charXmARROW_UPCSG _____ XmNdetailShadowThicknessXmCDetailShadowThicknessDimension2CSG _____ XmNdisarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNmultiClickXmCMultiClickunsigned chardynamicCSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies a list of callbacks that is called when the ArrowButtonGadget is activated\&. To activate the button, press and release \fBBSelect\fP while the pointer is inside the ArrowButtonGadget\&. Activating the ArrowButtonGadget also disarms it\&. The reason sent by this callback is \fBXmCR_ACTIVATE\fP\&. This callback uses the \fBXmQTactivatable\fP trait\&. .IP "\fBXmNarmCallback\fP" 10 Specifies a list of callbacks that is called when the ArrowButtonGadget is armed\&. To arm this widget, press \fBBSelect\fP while the pointer is inside the ArrowButtonGadget\&. The reason sent by this callback is \fBXmCR_ARM\fP\&. .IP "\fBXmNarrowDirection\fP" 10 Sets the arrow direction\&. The values for this resource are .RS .IP " \(bu" 6 \fBXmARROW_UP\fP .IP " \(bu" 6 \fBXmARROW_DOWN\fP .IP " \(bu" 6 \fBXmARROW_LEFT\fP .IP " \(bu" 6 \fBXmARROW_RIGHT\fP .RE .IP "\fBXmNdetailShadowThickness\fP" 10 Specifies the thickness of the inside arrow shadows\&. The default thickness is 2 pixels\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies a list of callbacks that is called when the ArrowButtonGadget is disarmed\&. To disarm this widget, press and release \fBBSelect\fP while the pointer is inside the ArrowButtonGadget\&. The reason sent by this callback is \fBXmCR_DISARM\fP\&. .IP "\fBXmNmultiClick\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time and this resource is set to \fBXmMULTICLICK_DISCARD\fP, the second click is not processed\&. If this resource is set to \fBXmMULTICLICK_KEEP\fP, the event is processed and \fIclick_count\fP is incremented in the callback structure\&. When the ArrowButtonGadget is not in a menu, the default value is \fBXmMULTICLICK_KEEP\fP\&. .SS "Inherited Resources" .PP \fBXmArrowButtonGadget\fP inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIclick_count\fP; } XmArrowButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fIclick_count\fP" 10 This value is valid only when the reason is \fBXmCR_ACTIVATE\fP\&. It contains the number of clicks in the last multiclick sequence if the \fBXmNmultiClick\fP resource is set to \fBXmMULTICLICK_KEEP\fP, otherwise it contains 1\&. The activate callback is invoked for each click if \fBXmNmultiClick\fP is set to \fBXmMULTICLICK_KEEP\fP\&. .SS "Behavior" .PP \fBXmArrowButtonGadget\fP includes behavior from \fBXmGadget\fP\&. The following list describes additional XmArrowButtonGadget behavior: .IP "\fB\fP:" 10 Draws the shadow in the selected state and calls the callbacks for \fBXmNarmCallback\fP\&. .IP "\fB\fP\fB\ or\ \fP\fB\fP:" 10 Draws the shadow in the unselected state\&. If the pointer is within the ArrowButtonGadget, calls the callbacks for \fBXmNactivateCallback\fP\&. Calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "\fB\fP\fB(2+)\fP:" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action draws the shadow in the selected state and calls the callbacks for \fBXmNarmCallback\fP\&. .IP "\fB\fP\fB(2+)\fP:" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action increments \fIclick_count\fP in the callback structure and draws the shadow in the unselected state\&. If the pointer is within the ArrowButtonGadget, this action calls the callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP\&. .IP "\fB\fP\fB\fP:" 10 Draws the shadow in the selected state and calls the callbacks for \fBXmNarmCallback\fP\&. Arranges for the shadow to be drawn in the unselected state and the callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP to be called, either immediately or at a later time\&. .IP "\fB\fP\fB\fP:" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "\fB\fP:" 10 Draws the ArrowButtonGadget shadow in its selected state if the pointer leaves and re-enters the gadget while is pressed\&. .IP "\fB\fP:" 10 Draws the ArrowButtonGadget shadow in its unselected state if the pointer leaves the gadget while is pressed\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBObject\fP(3), \fBRectObj\fP(3), \fBXmCreateArrowButtonGadget\fP(3), \fBXmGadget\fP(3), \fBXmVaCreateArrowButtonGadget\fP(3), and \fBXmVaCreateManagedArrowButtonGadget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCommandAppendValue.30000644000175000017500000000326012672140200016030 00000000000000'\" t ...\" CommAp.sgm /main/7 1996/08/30 14:18:26 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCommandAppendValue" "library call" .SH "NAME" \fBXmCommandAppendValue\fP \(em A Command function that appends the passed XmString to the end of the string displayed in the command area of the widget .iX "XmCommandAppendValue" .iX "Command functions" "XmCommandAppendValue" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmCommandAppendValue\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBcommand\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCommandAppendValue\fP appends the passed \fBXmString\fR to the end of the string displayed in the command area of the Command widget\&. .IP "\fIwidget\fP" 10 Specifies the Command widget ID .IP "\fIcommand\fP" 10 Specifies the passed \fBXmString\fR .PP For a complete definition of Command and its associated resources, see \fBXmCommand\fP(3)\&. .SH "RELATED" .PP \fBXmCommand\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/MrmRegisterNames.30000644000175000017500000001001612672140200015241 00000000000000'\" t ...\" RegisteB.sgm /main/8 1996/09/08 21:26:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmRegisterNames" "library call" .SH "NAME" \fBMrmRegisterNames\fP \(em Registers the values associated with the names referenced in UIL (for example, UIL callback function names or UIL identifier names) .iX "MrmRegisterNames" .iX "uil functions" "MrmRegisterNames" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmRegisterNames\fP\fR( \fBMrmRegisterArglist \fBregister_list\fR\fR, \fBMrmCount \fBregister_count\fR\fR); .fi .iX "MRM function" "MrmRegisterNames" .iX "MrmRegisterNames" "definition" .SH "DESCRIPTION" .PP The \fBMrmRegisterNames\fP function .iX "MrmRegisterNames" "description" registers a vector of names and associated values for access in MRM\&. The values can be callback functions, pointers to user-defined data, or any other values\&. The information provided is used to resolve symbolic references occurring in UID files to their run-time values\&. For callbacks, this information provides the procedure address required by the Motif Toolkit\&. For names used as identifiers in UIL, this information provides any run-time mapping the application needs\&. .PP This function is similar to \fBMrmRegisterNamesInHierarchy\fP, except that the scope of the names registered by \fBMrmRegisterNamesInHierarchy\fP is limited to the hierarchy specified in the call to that function, whereas the names registered by \fBMrmRegisterNames\fP have global scope\&. When MRM looks up a name, it first tries to find the name among those registered for the given hierarchy\&. If that lookup fails, it tries to find the name among those registered globally\&. .IP "\fIregister_list\fP" 10 Specifies a list of name/value pairs for the names to be registered\&. Each name is a case-sensitive, NULL-terminated ASCII string\&. Each value is a 32-bit quantity, interpreted as a procedure address if the name is a callback function, and uninterpreted otherwise\&. .IP "\fIregister_count\fP" 10 Specifies the number of entries in \fIregister_list\fP\&. .PP The names in the list are case-sensitive\&. The list can be either ordered or unordered\&. .PP Callback functions registered through \fBMrmRegisterNames\fP can be either regular or creation callbacks\&. Regular callbacks have declarations determined by Motif Toolkit and user requirements\&. Creation callbacks have the same format as any other callback: .PP .nf \fBvoid \fBCallBackProc\fP\fR( \fBWidget *\fBwidget_id\fR\fR, \fBOpaque \fBtag\fR\fR, \fBXmAnyCallbackStruct *\fBcallback_data\fR\fR); .fi .IP "\fIwidget_id\fP" 10 Specifies the widget ID associated with the widget performing the callback (as in any callback function)\&. .IP "\fItag\fP" 10 Specifies the tag value (as in any callback function)\&. .IP "\fIcallback_data\fP" 10 Specifies a widget-specific data structure\&. This data structure has a minimum of two members: event and reason\&. The reason member is always set to \fBMrmCR_CREATE\fP\&. .PP Note that the widget name and parent are available from the widget record accessible through \fIwidget_id\fP\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmMenuShell.30000644000175000017500000003066012672140200014225 00000000000000'\" t ...\" MenuSh.sgm /main/9 1996/09/08 20:54:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMenuShell" "library call" .SH "NAME" \fBXmMenuShell\fP \(em The MenuShell widget class .iX "XmMenuShell" .iX "widget class" "MenuShell" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The MenuShell widget is a custom OverrideShell widget\&. An OverrideShell widget bypasses \fBmwm\fP when displaying itself\&. It is designed specifically to contain Popup or Pulldown menu panes\&. .PP Most application writers never encounter this widget if they use the menu-system convenience functions, \fBXmCreatePopupMenu\fP or \fBXmCreatePulldown Menu\fP, to create a Popup or Pulldown menu pane\&. The convenience functions automatically create a MenuShell widget as the parent of the menu pane\&. However, if the convenience functions are not used, the application programmer must create the required MenuShell\&. In this case, it is important to note that the parent of the MenuShell depends on the type of menu system being built\&. .IP " \(bu" 6 If the MenuShell is for the top-level Popup menu pane, the MenuShell\&'s parent must be the widget from which the Popup menu pane is popped up\&. .IP " \(bu" 6 If the MenuShell is for a menu pane that is pulled down from a Popup or another Pulldown menu pane, the MenuShell\&'s parent must be the Popup or Pulldown menu pane\&. .IP " \(bu" 6 If the MenuShell is for a menu pane that is pulled down from a MenuBar, the MenuShell\&'s parent must be the MenuBar\&. .IP " \(bu" 6 If the MenuShell is for a Pulldown menu pane in an OptionMenu, the MenuShell\&'s parent must be the OptionMenu\&'s parent\&. .PP Setting \fBXmNheight\fP, \fBXmNwidth\fP, or \fBXmNborderWidth\fP for either a MenuShell or its child sets that resource to the same value in both the parent and the child\&. An application should always specify these resources for the child, not the parent\&. .PP For the managed child of a MenuShell, regardless of the value of the shell\&'s \fBXmNallowShellResize\fP, setting \fBXmNx\fP or \fBXmNy\fP sets the corresponding resource of the parent but does not change the child\&'s position relative to the parent\&. \fBXtGetValues\fP for the child\&'s \fBXmNx\fP or \fBXmNy\fP yields the value of the corresponding resource in the parent\&. The x and y-coordinates of the child\&'s upper left outside corner relative to the parent\&'s upper left inside corner are both 0 (zero) minus the value of \fBXmNborderWidth\fP\&. .PP MenuShell uses the \fBXmQTmenuSystem\fP trait and holds the \fBXmQTspecifyRenderTable\fP trait\&. .SS "Classes" .PP MenuShell inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBShell\fP, and \fBOverrideShell\fP\&. .PP The class pointer is \fBxmMenuShellWidgetClass\fP\&. .PP The class name is \fBXmMenuShell\fP\&. .SS "New Resources" .PP MenuShell overrides the \fBXmNallowShellResize\fP resource in Shell\&. The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmMenuShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTableNULLCSG _____ XmNdefaultFontListXmCDefaultFontListXmFontListdynamicCG _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTableXmRenderTableNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectionXmLEFT_TO_RIGHTCG _____ XmNanimateXmCAnimateBooleanFalseCG _____ .TE .IP "\fBXmNbuttonFontList\fP" 10 Specifies the font list used for button descendants\&. See the \fBXmNbuttonRenderTable\fP resource\&. .IP "\fBXmNbuttonRenderTable\fP" 10 Specifies the render table used for MenuShell\&'s button descendants\&. If this value is NULL at initialization and if the value of \fBXmNdefaultFontList\fP is not NULL, \fBXmNbuttonRenderTable\fP is initialized to the value of \fBXmNdefaultFontList\fP\&. If the value of \fBXmNdefaultFontList\fP is NULL, \fBXmNbuttonRenderTable\fP is initialized by looking up the parent hierarchy of the widget for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, \fBXmNbuttonRenderTable\fP is initialized to the \fBXmBUTTON_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNdefaultFontList\fP" 10 Specifies a default font list for MenuShell\&'s descendants\&. This resource is obsolete and exists for compatibility with earlier releases\&. It has been replaced by \fBXmNbuttonFontList\fP and \fBXmNlabelFontList\fP\&. .IP "\fBXmNlabelFontList\fP" 10 Specifies the font list used for label descendants\&. See the \fBXmNlabelRenderTable\fP resource\&. .IP "\fBXmNlabelRenderTable\fP" 10 Specifies the render table used for MenuShell\&'s label descendants (Labels and LabelGadgets)\&. If this value is NULL at initialization and if the value of \fBXmNdefaultFontList\fP is not NULL, \fBXmNlabelRenderTable\fP is initialized to the value of \fBXmNdefaultFontList\fP\&. If the value of \fBXmNdefaultFontList\fP is NULL, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, \fBXmNlabelRenderTable\fP is initialized to the \fBXmLABEL_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNlayoutDirection\fP" 10 Specifies the direction in which the subwidgets, children of a widget, or other visual components are to be laid out\&. This policy will apply as the default layout policy for all descendants of this MenuShell\&. .IP "\fBXmNanimate\fP" 10 Controls whether menus will post in an animated fashion. .SS "Inherited Resources" .PP MenuShell inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. The programmer can set the resource values for these inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanTrueG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanTrueCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanTrueCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP The XmMenuShell translations are described in the following list\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 ClearTraversal() .IP "\fB\fP:" 10 MenuShellPopdownDone() .SS "Action Routines" .PP The \fBXmMenuShell\fP action routines are .IP "ClearTraversal():" 10 Disables keyboard traversal for the menu, enables mouse traversal, and unposts any menus posted by this menu\&. .IP "MenuShellPopdownDone():" 10 Unposts the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores focus to the widget that had the focus before the menu system was entered\&. .IP "MenuShellPopdownOne():" 10 In a top-level Pulldown MenuPane from a MenuBar, this action unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, this action unposts the menu\&. .IP "" 10 In a Popup MenuPane, this action unposts the menu, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget from which the menu was posted\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBOverrideShell\fP(3), \fBShell\fP(3), \fBXmCreateMenuShell\fP(3), \fBXmCreatePopupMenu\fP(3), \fBXmCreatePulldownMenu\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmVaCreateManagedMainWindow.30000644000175000017500000000004012672140200017262 00000000000000.so man3/XmVaCreateMainWindow.3 motif-2.3.8/doc/man/man3/XmCreateDropDownComboBox.30000644000175000017500000000353612672140200016644 00000000000000'\" t ...\" CreDrD.sgm /main/8 1996/08/31 17:32:49 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateDropDownComboBox" "library call" .SH "NAME" \fBXmCreateDropDownComboBox\fP \(em The Drop-down ComboBox widget creation function .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateDropDownComboBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBarg_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateDropDownComboBox\fP creates an instance of a ComboBox widget of \fBXmNcomboBoxType\fP \fBXmDROP_DOWN_COMBO_BOX\fP and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fBarg_count\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of ComboBox and its associated resources, see \fBXmComboBox\fP(3)\&. .SH "RETURN" .PP Returns the ComboBox widget ID\&. .SH "RELATED" .PP \fBXmComboBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmCommand.30000644000175000017500000004107012672140200013704 00000000000000'\" t ...\" Command.sgm /main/12 1996/09/26 14:53:59 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCommand" "library call" .SH "NAME" \fBXmCommand\fP \(em The Command widget class .iX "XmCommand" .iX "widget class" "Command" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Command is a special-purpose composite widget for command entry that provides a built-in command-history mechanism\&. Command includes a command-line text-input field, a command-line prompt, and a command-history list region\&. .PP One additional \fBWorkArea\fP child may be added to the Command after creation\&. .PP Whenever a command is entered, it is automatically added to the end of the command-history list and made visible\&. This does not change the selected item in the list, if there is one\&. .PP Many of the new resources specified for Command are actually SelectionBox resources that have been renamed for clarity and ease of use\&. .SS "Descendants" .PP Command automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBItemsList\fP\fBXmList\fPcommand-history list region ___ \fBItemsListSW\fP\fBXmScrolledWindow\fPT{ the ScrolledWindow parent of \fBItemsList\fP T} ___ \fBSelection\fP\fBXmLabelGadget\fPcommand-line prompt ___ \fBText\fP\fBXmTextField\fPcommand-line text-input field ___ .TE .SS "Classes" .PP Command inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP, \fBXmBulletinBoard\fP, and \fBXmSelectionBox\fP\&. .PP The class pointer is \fBxmCommandWidgetClass\fP\&. .PP The class name is \fBXmCommand\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmCommand Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNcommandXmCTextStringXmString""CSG _____ XmNcommandChangedCallbackXmCCallbackXtCallbackListNULLC _____ XmNcommandEnteredCallbackXmCCallbackXtCallbackListNULLC _____ XmNhistoryItemsXmCItemsXmStringTableNULLCSG _____ XmNhistoryItemCountXmCItemCountint0CSG _____ XmNhistoryMaxItemsXmCMaxItemsint100CSG _____ XmNhistoryVisibleItemCountXmCVisibleItemCountintdynamicCSG _____ XmNpromptStringXmCPromptStringXmStringdynamicCSG _____ .TE .IP "\fBXmNcommand\fP" 10 Contains the current command-line text\&. This is the \fBXmNtextString\fP resource in SelectionBox, renamed for Command\&. This resource can also be modified with \fBXmCommandSetValue\fP and \fBXmCommandAppendValue\fP functions\&. The command area is a Text widget\&. .IP "\fBXmNcommandChangedCallback\fP" 10 Specifies the list of callbacks that is called after each time the value of the command changes\&. The callback reason is \fBXmCR_COMMAND_CHANGED\fP\&. This is equivalent to the \fBXmNvalueChangedCallback\fP of the Text widget, except that a pointer to an \fBXmCommandCallbackStructure\fP is passed, and the structure\&'s \fIvalue\fP member contains the \fBXmString\fR\&. .IP "\fBXmNcommandEnteredCallback\fP" 10 Specifies the list of callbacks that is called when a command is entered in the Command\&. The callback reason is \fBXmCR_COMMAND_ENTERED\fP\&. A pointer to an \fBXmCommandCallback\fP structure is passed\&. .IP "\fBXmNhistoryItems\fP" 10 Lists \fBXmString\fR items that make up the contents of the history list\&. This is the \fBXmNlistItems\fP resource in SelectionBox, renamed for Command\&. \fBXtGetValues\fP for this resource returns the list items themselves, not a copy of the list items\&. The application must not free the returned items\&. .IP "\fBXmNhistoryItemCount\fP" 10 Specifies the number of \fBXmStrings\fP in \fBXmNhistoryItems\fP\&. This is the \fBXmNlistItemCount\fP resource in SelectionBox, renamed for Command\&. The value must not be negative\&. .IP "\fBXmNhistoryMaxItems\fP" 10 Specifies the maximum number of items allowed in the history list\&. Once this number is reached, an existing list item must be removed before a new item can be added to the list\&. For each command entered, the first list item is removed from the list, so the new command can be added to the list\&. The value must be greater than 0 (zero)\&. .IP "\fBXmNhistoryVisibleItemCount\fP" 10 Specifies the number of items in the history list that should be visible at one time\&. In effect, it sets the height (in lines) of the history list window\&. This is the \fBXmNlistVisibleItemCount\fP resource in SelectionBox, renamed for Command\&. The value must be greater than 0 (zero)\&. The default is dynamic based on the height of the list\&. .IP "\fBXmNpromptString\fP" 10 Specifies a prompt for the command line\&. This is the \fBXmNselectionLabelString\fP resource in SelectionBox, renamed for Command\&. The default may vary depending on the value of the \fBXmNlayoutDirection\fP resource and the locale\&. In the C locale the default is > (right angle bracket)\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .SS "Inherited Resources" .PP Command inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmSelectionBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNapplyCallbackXmCCallbackXtCallbackListNULLN/A _____ XmNapplyLabelStringXmCApplyLabelStringXmStringdynamicN/A _____ XmNcancelCallbackXmCCallbackXtCallbackListNULLN/A _____ XmNcancelLabelStringXmCCancelLabelStringXmStringdynamicN/A _____ XmNchildPlacementXmCChildPlacementunsigned charXmPLACE_ABOVE_SELECTIONCSG _____ XmNdialogTypeXmCDialogTypeunsigned charXmDIALOG_COMMANDG _____ XmNhelpLabelStringXmCHelpLabelStringXmStringdynamicN/A _____ XmNlistItemCountXmCItemCountint0CSG _____ XmNlistItemsXmCItemsXmStringTableNULLCSG _____ XmNlistLabelStringXmCListLabelStringXmStringNULLN/A _____ XmNlistVisibleItemCountXmCVisibleItemCountintdynamicCSG _____ XmNminimizeButtonsXmCMinimizeButtonsBooleanFalseN/A _____ XmNmustMatchXmCMustMatchBooleanFalseN/A _____ XmNnoMatchCallbackXmCCallbackXtCallbackListNULLN/A _____ XmNokCallbackXmCCallbackXtCallbackListNULLN/A _____ XmNokLabelStringXmCOkLabelStringXmStringdynamicN/A _____ XmNselectionLabelStringXmCSelectionLabelStringXmStringdynamicCSG _____ XmNtextAcceleratorsXmCTextAcceleratorsXtAcceleratorsdefaultC _____ XmNtextColumnsXmCColumnsshortdynamicCSG _____ XmNtextStringXmCTextStringXmString""CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmBulletinBoard Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowOverlapXmCAllowOverlapBooleanTrueCSG _____ XmNautoUnmanageXmCAutoUnmanageBooleanFalseN/A _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicN/A _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNcancelButtonXmCWidgetWidgetNULLN/A _____ XmNdefaultButtonXmCWidgetWidgetNULLN/A _____ XmNdefaultPositionXmCDefaultPositionBooleanFalseCSG _____ XmNdialogStyleXmCDialogStyleunsigned chardynamicCSG _____ XmNdialogTitleXmCDialogTitleXmStringNULLCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTableXmRenderTabledynamicCSG _____ XmNmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension10CSG _____ XmNmarginWidthXmCMarginWidthDimension10CSG _____ XmNnoResizeXmCNoResizeBooleanFalseCSG _____ XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_NONECSG _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_OUTCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNtextTranslationsXmCTranslationsXtTranslationsNULLC _____ XmNunmapCallbackXmCCallbackXtCallbackListNULLC _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; XmString \fIvalue\fP; int \fIlength\fP; } XmCommandCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fIvalue\fP" 10 Specifies the \fBXmString\fR in the CommandArea .IP "\fIlength\fP" 10 Specifies the size in bytes of the \fBXmString\fR value\&. This member is obsolete and exists for compatibility with earlier releases\&. .SS "Translations" .PP \fBXmCommand\fP inherits translations from \fBXmSelectionBox\fP\&. .SS "Accelerators" .PP The \fBXmNtextAccelerators\fP from \fBXmSelectionBox\fP are added to the Text descendant of \fBXmCommand\fP\&. .SS "Action Routines" .PP The \fBXmCommand\fP action routines are: .IP "SelectionBoxUpOrDown(\fBPrevious|Next|First|Last\fP):" 10 When called with an argument of \fBPrevious\fP, or 0 (zero) for compatibility, selects the previous item in the history list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBNext\fP, or 1 for compatibility, selects the next item in the history list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBFirst\fP, or 2 for compatibility, selects the first item in the history list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBLast\fP, or 3 for compatibility, selects the last item in the history list and replaces the text with that item\&. .IP "" 10 Calls the callbacks for \fBXmNcommandChangedCallback\fP\&. .SS "Additional Behavior" .PP The Command widget has the following additional behavior: .IP "\fB\fP\fB\fP:" 10 If the parent of the Command is a manager, the event is passed to the parent\&. .IP "\fB\fP\fB\fP\ in\ Text:" 10 Calls the Text widget\&'s \fBXmNactivateCallback\fP callbacks\&. If the text is empty, this action then returns\&. Otherwise, if the history list has \fBXmNhistoryMaxItems\fP items, it removes the first item in the list\&. It adds the text to the history list as the last item, clears the text, and calls the \fBXmNcommandEnteredCallback\fP callbacks\&. .IP "\fB\fP\ in\ Text:" 10 When any change is made to the text edit widget, this action calls the callbacks for \fBXmNcommandChangedCallback\fP\&. .IP "\fB\fP\fB(2+)\fP\ or\ \fB\fP\fB\fP\ in\ List:" 10 Calls the List widget\&'s \fBXmNdefaultActionCallback\fP callbacks\&. If the history list has \fBXmNhistoryMaxItems\fP items, this action removes the first item in the list\&. It adds the selected List item to the history list as the last item, clears the text, and calls the \fBXmNcommandEnteredCallback\fP callbacks\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNfocusCallback\fP\&. .IP "\fB\fP:" 10 When a Command that is the child of a DialogShell is mapped, this action calls the callbacks for \fBXmNmapCallback\fP\&. .IP "\fB\fP:" 10 When a Command that is the child of a DialogShell is unmapped, this action calls the callbacks for \fBXmNunmapCallback\fP\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmBulletinBoard\fP(3), \fBXmCommandAppendValue\fP(3), \fBXmCommandError\fP(3), \fBXmCommandGetChild\fP(3), \fBXmCommandSetValue\fP(3), \fBXmCreateCommand\fP(3), \fBXmManager\fP(3), \fBXmSelectionBox\fP(3), \fBXmVaCreateCommand\fP(3), and \fBXmVaCreateManagedCommand\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedComboBox.30000644000175000017500000000003612672140200016723 00000000000000.so man3/XmVaCreateComboBox.3 motif-2.3.8/doc/man/man3/XmVaCreateText.30000644000175000017500000000260012672140200014661 00000000000000.DT .TH "XmVaCreateText" "library call" .SH "NAME" \fBXmVaCreateText\fP, \fBXmVaCreateManagedText\fP \(em A Text widget convenience creation functions\&. .iX "XmVaCreateToggleText" "XmVaCreateManagedText" .iX "creation functions" "XmVaCreateText" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateText\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedText\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateText\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateText\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns the Text widget ID\&. .SH "RELATED" .PP \fBXmText\fP(3), \fBXmCreateText\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreatePushButtonGadget.30000644000175000017500000000310212672140200017162 00000000000000.DT .TH "XmVaCreatePushButtonGadget" "library call" .SH "NAME" \fBXmVaCreatePushButtonGadget\fP, \fBXmVaCreateManagedPushButtonGadget\fP \(em A PushButtonGadget widget convenience creation functions\&. .iX "XmVaCreateTogglePushButtonGadget" "XmVaCreateManagedPushButtonGadget" .iX "creation functions" "XmVaCreatePushButtonGadget" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreatePushButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedPushButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreatePushButtonGadget\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreatePushButtonGadget\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of PushButtonGadget and its associated resources, see \fBXmPushButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the PushButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmPushButtonGadget\fP(3), \fBXmCreatePushButtonGadget\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmContainerGetItemChildren.30000644000175000017500000000440112672140200017175 00000000000000'\" t ...\" ContainE.sgm /main/8 1996/09/08 20:31:53 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerGetItemChildren" "library call" .SH "NAME" \fBXmContainerGetItemChildren\fP \(em Container widget function to find all children of an item .iX "XmContainerGetItemChildren" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmContainerGetItemChildren\fP\fR( \fBWidget \fBcontainer\fR\fR, \fBWidget \fBitem\fR\fR, \fBWidgetList * \fBitem_children\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerGetItemChildren\fP allocates a WidgetList and stores within it the widget IDs of all widgets that have \fIitem\fP specified as the value of their \fBXmNentryParent\fP resource\&. The application programmer is responsible for freeing the allocated WidgetList using XtFree\&. The number of widget IDs returned in \fIitem_children\fP is returned by the function\&. If no widgets specify \fIitem\fP as the value of their \fBXmNentryParent\fP resource, the function returns zero and \fIitem_children\fP is left unchanged\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .IP "\fIitem\fP" 10 Specifies a widgetID within \fIcontainer\fP\&. .IP "\fIitem_children\fP" 10 Returned array of Widgets\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP This function returns a count of all widgets that have \fIitem\fP specified as the value of their \fBXmNentryParent\fP resource\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmRemoveWMProtocols.30000644000175000017500000000374012672140200015736 00000000000000'\" t ...\" RemWMB.sgm /main/8 1996/08/30 15:56:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRemoveWMProtocols" "library call" .SH "NAME" \fBXmRemoveWMProtocols\fP \(em A VendorShell convenience interface that removes the protocols from the protocol manager and deallocates the internal tables .iX "XmRemoveWMProtocols" .iX "VendorShell functions" "XmRemoveWMProtocols" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmRemoveWMProtocols\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fB* protocols\fR\fR, \fBCardinal \fBnum_protocols\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRemoveWMProtocols\fP is a convenience interface\&. It calls \fBXmRemoveProtocols\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIprotocols\fP" 10 Specifies the protocol atoms .IP "\fInum_protocols\fP" 10 Specifies the number of elements in protocols .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddWMProtocols\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveProtocols\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmVaCreateContainer.30000644000175000017500000000266712672140200015674 00000000000000.DT .TH "XmVaCreateContainer" "library call" .SH "NAME" \fBXmVaCreateContainer\fP, \fBXmVaCreateManagedContainer\fP \(em A Container widget convenience creation functions\&. .iX "XmVaCreateContainer" "XmVaCreateManagedContainer" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateContainer\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedContainer\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Container widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateContainer\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreatemanagedContainer\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP Returns the Container widget ID\&. .SH "RELATED" .PP \fBXmContainer\fP(3), \fBXmCreateContainer\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmListYToPos.30000644000175000017500000000354512672140200014364 00000000000000'\" t ...\" LstYToPo.sgm /main/8 1996/09/08 20:52:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListYToPos" "library call" .SH "NAME" \fBXmListYToPos\fP \(em A List function that returns the position of the item at a specified y-coordinate .iX "XmListYToPos" .iX "List functions" "XmListYToPos" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmListYToPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBPosition \fBy\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListYToPos\fP returns the position of the item at the given y-coordinate within the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIy\fP" 10 Specifies the y-coordinate in the list\&'s coordinate system .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns the position of the item at the specified y coordinate\&. A value of 1 indicates the first item in the list; a value of 2 indicates the second item; and so on\&. A value of 0 (zero) indicates that no item exists at the specified y coordinate\&. .SH "RELATED" .PP \fBXmList\fP(3) and \fBXmListPosToBounds\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/MrmCloseHierarchy.30000644000175000017500000000412112672140200015375 00000000000000'\" t ...\" CloseHie.sgm /main/9 1996/09/08 21:24:38 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmCloseHierarchy" "library call" .SH "NAME" \fBMrmCloseHierarchy\fP \(em Closes a UID hierarchy .iX "MrmCloseHierarchy" .iX "uil functions" "MrmCloseHierarchy" .iX "uid hierarchy" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmCloseHierarchy\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR); .fi .iX "MRM function" "MrmCloseHierarchy" .iX "MrmCloseHierarchy" "definition" .SH "DESCRIPTION" .PP The \fBMrmCloseHierarchy\fP function .iX "MrmCloseHierarchy" "description" closes a UID hierarchy previously opened by \fBMrmOpenHierarchyPerDisplay\fP\&. All files associated with the hierarchy are closed by the Motif Resource Manager (MRM) and all associated memory is returned\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of a previously opened UID hierarchy\&. The \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmOpenHierarchyPerDisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmVaCreateList.30000644000175000017500000000254212672140200014655 00000000000000.DT .TH "XmVaCreateList" "library call" .SH "NAME" \fBXmVaCreateList\fP, \fBXmVaCreateManagedList\fP \(em A List widget convenience creation functions\&. .iX "XmVaCreateList" "XmVaCreateManagedList" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateList\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedList\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a List widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateList\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedList\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns the List widget ID\&. .SH "RELATED" .PP \fBXmList\fP(3), \fBXmCreateList\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmHierarchy.30000644000175000017500000002073112672140200014245 00000000000000.TH "XmHierarchy" "library call" .SH "NAME" \fBXmHierarchy\fR \(em The Hierarchy widget class .iX "XmHierarchy" .iX "Hierarchy" "hierarchy" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The Hierarchy widget is not intended to be instantiated itself, but rather should be used as the base class for any widget that would like to present a hierarchy of information to the user that is different for the actual widget instance hierarchy of the application. This base class is currently used for two widgets in the Motif widget set, Tree and Outline, giving those two widgets a very similar API. .PP Note: The Hierarchy widget assumes that it will be totally responsible for mapping and unmapping its children. Therefore no child of this widget should ever modify its mappedWhenManaged resource. If a child does modify this resource the behavior is undefined. .SS "Classes" .PP Hierarchy inherits behaviour, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmHierarchyWidgetClass\fP\&. .PP The class name is \fBXmHierarchy\fR\&. .SS "New Resources" .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmHierarchy Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNautoCloseXmCAutoCloseBooleanTrueCSG _____ XmNcloseFolderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNhorizontalMarginXmCDimensionDimension2CSG _____ XmNnodeStateCallbackXmCNodeStateCallbackXtCallbackListNULLC _____ XmNopenFolderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNrefigureModeXmCBooleanBooleanTrueCSG _____ XmNverticalMarginXmCDimensionDimension2CSG _____ .TE .IP "\fBXmNautoClose\fP" 10 This resource determines if the hierarchy should automatically restore a parent node's children when the parent node is reopened. If autoClose is False, and the hierarchy is fully expanded when the root node is closed, then the entire hierarchy will be displayed as expanded when the root node is reopened. If autoClose is True, then the root node's children are closed when the root node is reopened\&. .IP "\fBXmNcloseFolderPixmap\fP" 10 This resource defines a pixmap for the closed representation of the folder pixmap to be used throughout the tree\&. It can be a color pixmap or bitmap. If the user does not specify a pixmap the default bitmap will be used\&. .IP "\fBXmNhorizontalMargin\fP" 10 .IP "\fBXmNverticalMargin\fP" 10 The exact definition of these resources are left to the subclass of the hierarchy widget that does the geometry layout\&. They are intended to be used as the amount of space between the object and the edges of the window it is displayed in\&. They are included here for consistency\&. .IP "\fBXmNopenFolderPixmap\fP" 10 This resource defines a pixmap for the open representation of the folder pixmap to be used throughout the tree . It can be a color pixmap or bitmap. If the user does not specify a pixmap the default opened folder bitmap\&. .IP "\fBXmNnodeStateCallback\fP" 10 The list of callback routines called when a folder button is clicked. See "Callback Routine" for more details. .IP "\fBXmNrefigureMode\fP" 10 This resource determines whether the Hierarchy should adjust the sizes of the children after a geometry or resize request, or simply ignore the request. This resource is very useful in improving the performance of an application that is making a large number of geometry changes all at once. .TS tab() box; c s s s s l| l| l| l| l. \fBXmHierarchy Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNinsertBeforeXmCInsertbeforeWidgetNULLCSG _____ XmNnodeStateXmCNodeStateXMHierarchyNodeStateXmOpenCSG _____ XmNparentNodeXmCParentNodeWidgetNULLCSG _____ .TE .IP "\fBXmNinsertBefore\fP" 10 Specifies another node that has the same parentNode. This node will then be placed immediately before that node in the hierarchy. If this value is NULL then the node will be inserted at the end of the list. This resource allows the hierarchy's children to be reordered. .IP "\fBXmNnodeState\fP" 10 The state of this node. Acceptable values are: XmOpen, XmClosed, XmAlwaysOpen, and XmHidden. A type converter has been registered that can convert the following strings: "open", "close", "alwaysOpen", and "hidden". .IP "\fBXmNparentNode\fP" 10 The hierarchy parent of this node. The parent node MUST be a widget sibling of the current node. .SS "Inherited Resources" .PP Hierarchy inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .SS "Callback Information" .PP When a folder is clicked, the routines registered on the XmNnodeStateCallback list are passed a pointer to the following structure as client data: .nf typedef struct _XmHierarchyNodeStateData { Widget \fIwidget\fP; XmHierarchyNodeState \fIstate\fP; } XmHierarchyNodeStateData; .nf .IP "\fIwidget\fP" 10 the child node of Hierarchy being opened or closed. .IP "\fIstate\fP" 10 the current XmNnodeState (after the click) of the node. Legal values are XmOpen, XmClosed, XmAlwaysOpen, and XmHidden. .PP .SS Children The hierarchy maintains IconButtons for each node in the hierarchy. Setting openFolderPixmap or closeFolderPixmap is done through XtSetValues. IconButtons may only be manipulated by the Hierarchy. .SH RELATED .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateHierarchy\fP(3), \fBXmHierarchyGetChildNodes\fP(3), \fBXmHierarchyOpenAllAncestors\fP(3), \fBXmManager\fP(3)\&. motif-2.3.8/doc/man/man3/XmConvertUnits.30000644000175000017500000000762412672140200015000 00000000000000'\" t ...\" CvtUn.sgm /main/9 1996/09/08 20:38:03 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmConvertUnits" "library call" .SH "NAME" \fBXmConvertUnits\fP \(em A function that converts a value in one unit type to another unit type .iX "XmConvertUnits" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmConvertUnits\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBorientation\fR\fR, \fBint \fBfrom_unit_type\fR\fR, \fBint \fBfrom_value\fR\fR, \fBint \fBto_unit_type\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmConvertUnits\fP converts the value and returns it as the return value from the function\&. For resources of type, dimension, or position, you can specify units using the syntax described in the \fBXmNunitType\fP resource of the \fBXmPrimitive\fP reference page\&. .IP "\fIwidget\fP" 10 Specifies the widget for which the data is to be converted\&. .IP "\fIorientation\fP" 10 Specifies whether the converter uses the horizontal or vertical screen resolution when performing the conversions\&. The \fIorientation\fP parameter can have values of \fBXmHORIZONTAL\fP or \fBXmVERTICAL\fP\&. .IP "\fIfrom_unit_type\fP" 10 Specifies the current unit type of the supplied value .IP "\fIfrom_value\fP" 10 Specifies the value to be converted .IP "\fIto_unit_type\fP" 10 Converts the value to the unit type specified .PP The parameters \fIfrom_unit_type\fP and \fIto_unit_type\fP can have the following values: .IP "\fBXmPIXELS\fP" 10 All values provided to the widget are treated as pixel values\&. This is the default for the resource\&. .IP "\fBXmMILLIMETERS\fP" 10 All values provided to the widget are treated as millimeter values\&. .IP "\fBXm100TH_MILLIMETERS\fP" 10 All values provided to the widget are treated as 1/100 of a millimeter\&. .IP "\fBXmCENTIMETERS\fP" 10 All values provided to the widget are treated as centimeter values\&. .IP "\fBXmINCHES\fP" 10 All values provided to the widget are treated as inch values\&. .IP "\fBXm1000TH_INCHES\fP" 10 All values provided to the widget are treated as 1/1000 of an inch\&. .IP "\fBXmPOINTS\fP" 10 All values provided to the widget are treated as point values\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXm100TH_POINTS\fP" 10 All values provided to the widget are treated as 1/100 of a point\&. A point is a unit typically used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXmFONT_UNITS\fP" 10 All values provided to the widget are treated as normal font units\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fBXm100TH_FONT_UNITS\fP" 10 All values provided to the widget are treated as 1/100 of a font unit\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .SH "RETURN" .PP Returns the converted value\&. If a NULL widget, incorrect \fIorientation\fP, or incorrect \fIunit_type\fP is supplied as parameter data, 0 (zero) is returned\&. .SH "RELATED" .PP \fBXmPrimitive\fP, \fBXmSetFontUnits\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmDialogShell.30000644000175000017500000002553012672140200014520 00000000000000'\" t ...\" DialogSh.sgm /main/10 1996/09/25 15:29:11 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDialogShell" "library call" .SH "NAME" \fBXmDialogShell\fP \(em The DialogShell widget class .iX "XmDialogShell" .iX "widget class" "DialogShell" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Modal and modeless dialogs use DialogShell as the Shell parent\&. DialogShell widgets cannot be iconified\&. Instead, all secondary DialogShell widgets associated with an ApplicationShell widget are iconified and de-iconified as a group with the primary widget\&. .PP The client indirectly manipulates DialogShell through the convenience interfaces during creation, and it can directly manipulate its BulletinBoard-derived child\&. Much of the functionality of DialogShell assumes that its child is a BulletinBoard subclass, although it can potentially stand alone\&. .PP Setting \fBXmNheight\fP, \fBXmNwidth\fP, or \fBXmNborderWidth\fP for either a DialogShell or its managed child usually sets that resource to the same value in both the parent and the child\&. When an off-the-spot input method exists, the height and width of the shell may be greater than those of the managed child in order to accommodate the input method\&. In this case, setting \fBXmNheight\fP or \fBXmNwidth\fP for the shell does not necessarily set that resource to the same value in the managed child, and setting \fBXmNheight\fP or \fBXmNwidth\fP for the child does not necessarily set that resource to the same value in the shell\&. .PP For the managed child of a DialogShell, regardless of the value of the shell\&'s \fBXmNallowShellResize\fP resource, setting \fBXmNx\fP or \fBXmNy\fP sets the corresponding resource of the parent but does not change the child\&'s position relative to the parent\&. The \fBXtGetValues\fP resource for the child\&'s \fBXmNx\fP or \fBXmNy\fP yields the value of the corresponding resource in the parent\&. The x and y-coordinates of the child\&'s upper left outside corner relative to the parent\&'s upper left inside corner are both 0 (zero) minus the value of \fBXmNborderWidth\fP\&. .PP Note that the \fIInter-Client Communication Conventions Manual\fP (ICCCM) allows a window manager to change or control the border width of a reparented top-level window\&. .PP DialogShell uses the \fBXmQTdialogShellSavvy\fP trait\&. .SS "Classes" .PP DialogShell inherits behavior, resources, and traits from the \fBCore\fP, \fBComposite\fP, \fBShell\fP, \fBWMShell\fP, \fBVendorShell\fP, and \fBTransientShell\fP classes\&. .PP The class pointer is \fBxmDialogShellWidgetClass\fP\&. .PP The class name is \fBXmDialogShell\fP\&. .SS "New Resources" .PP DialogShell defines no new resources but overrides the \fBXmNdeleteResponse\fP resource in the \fBVendorShell\fP class\&. .SS "Inherited Resources" .PP DialogShell inherits behavior and resources from the superclasses described in the following tables, which define sets of widget resources used by the programmer to specify data\&. .PP For a complete description of each resource, refer to the reference page for that superclass\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBTransientShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNtransientForXmCTransientForWidgetNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBVendorShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNaudibleWarningXmCAudibleWarningunsigned charXmBELLCSG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNdefaultFontListXmCDefaultFontListXmFontListdynamicCG _____ XmNdeleteResponseXmCDeleteResponseunsigned charXmUNMAPCSG _____ XmNinputMethodXmCInputMethodStringNULLCSG _____ XmNinputPolicyXmCInputPolicyXmInputPolicyXmPER_SHELLCSG _____ XmNkeyboardFocusPolicyXmCKeyboardFocusPolicyunsigned charXmEXPLICITCSG _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTabelXmRenderTabledynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectionXmLEFT_TO_RIGHTCG _____ XmNmwmDecorationsXmCMwmDecorationsint-1CG _____ XmNmwmFunctionsXmCMwmFunctionsint-1CG _____ XmNmwmInputModeXmCMwmInputModeint-1CG _____ XmNmwmMenuXmCMwmMenuStringNULLCG _____ XmNpreeditTypeXmCPreeditTypeStringdynamicCSG _____ XmNshellUnitTypeXmCShellUnitTypeunsigned charXmPIXELSCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNunitTypeXmCUnitTypeunsigned charXmPIXELSCSG _____ XmNuseAsyncGeometryXmCUseAsyncGeometryBooleanFalseCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBWMShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbaseHeightXmCBaseHeightintXtUnspecifiedShellIntCSG _____ XmNbaseWidthXmCBaseWidthintXtUnspecifiedShellIntCSG _____ XmNheightIncXmCHeightIncintXtUnspecifiedShellIntCSG _____ XmNiconMaskXmCIconMaskPixmapNULLCSG _____ XmNiconPixmapXmCIconPixmapPixmapNULLCSG _____ XmNiconWindowXmCIconWindowWindowNULLCSG _____ XmNiconXXmCIconXintXtUnspecifiedShellIntCSG _____ XmNiconYXmCIconYintXtUnspecifiedShellIntCSG _____ XmNinitialStateXmCInitialStateintNormalStateCSG _____ XmNinputXmCInputBooleanTrueCSG _____ XmNmaxAspectXXmCMaxAspectXintXtUnspecifiedShellIntCSG _____ XmNmaxAspectYXmCMaxAspectYintXtUnspecifiedShellIntCSG _____ XmNmaxHeightXmCMaxHeightintXtUnspecifiedShellIntCSG _____ XmNmaxWidthXmCMaxWidthintXtUnspecifiedShellIntCSG _____ XmNminAspectXXmCMinAspectXintXtUnspecifiedShellIntCSG _____ XmNminAspectYXmCMinAspectYintXtUnspecifiedShellIntCSG _____ XmNminHeightXmCMinHeightintXtUnspecifiedShellIntCSG _____ XmNminWidthXmCMinWidthintXtUnspecifiedShellIntCSG _____ XmNtitleXmCTitleStringdynamicCSG _____ XmNtitleEncodingXmCTitleEncodingAtomdynamicCSG _____ XmNtransientXmCTransientBooleanTrueCSG _____ XmNwaitForWmXmCWaitForWmBooleanTrueCSG _____ XmNwidthIncXmCWidthIncintXtUnspecifiedShellIntCSG _____ XmNwindowGroupXmCWindowGroupWindowdynamicCSG _____ XmNwinGravityXmCWinGravityintdynamicCSG _____ XmNwmTimeoutXmCWmTimeoutint5000 msCSG _____ .TE .PP .RS \fBNote: .PP If values for \fBXmNminWidth\fP and \fBXmNminHeight\fP are present, and values for \fBXmNbaseWidth\fP and \fBXmNbaseHeight\fP are absent, \fBXmNminWidth\fP and \fBXmNminHeight\fP will be used as default values for \fBXmNbaseWidth\fP and \fBXmNbaseHeight\fP, and these values will be added to the shell size specified by the user\&. To work around this, add arguments during widget creation to explicitly set \fBXmNbaseWidth\fP and \fBXmNbaseHeight\fP to zero\&. .RE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanFalseCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanTrueCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for XmDialogShell\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBShell\fP(3), \fBTransientShell\fP(3), \fBWMShell\fP(3), \fBVendorShell\fP(3), and \fBXmCreateDialogShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmVaCreateSimplePulldownMenu.30000644000175000017500000001753512672140200017555 00000000000000'\" t ...\" VaCreE.sgm /main/9 1996/09/08 21:21:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmVaCreateSimplePulldownMenu" "library call" .SH "NAME" \fBXmVaCreateSimplePulldownMenu\fP \(em A RowColumn widget convenience creation function .iX "XmVaCreateSimplePulldown\\%Menu" .iX "creation functions" "XmVaCreateSimplePulldown\\%Menu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmVaCreateSimplePulldownMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBint \fBpost_from_button\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmVaCreateSimplePulldownMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_PULLDOWN\fP and returns the associated widget ID\&. This routine uses the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP This routine creates a Pulldown menu pane and its button children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 to the number of buttons in the menu minus 1\&. The name of each separator is \fBseparator_\fP\fIn\fP, where \fIn\fP is an integer from 0 to the number of separators in the menu minus 1\&. The name of each title is \fBlabel_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of titles in the menu minus 1\&. Buttons, separators, and titles are named and created in the order in which they are specified in the variable portion of the argument list\&. .PP This routine also attaches the PulldownMenu to a CascadeButton or CascadeButtonGadget in the parent\&. The PulldownMenu is then posted from this button\&. .IP "\fIparent\fP" 10 Specifies the widget ID of the parent of the MenuShell\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIpost_from_button\fP" 10 Specifies the CascadeButton or CascadeButtonGadget in the parent to which the Pulldown menu pane is attached\&. The value is the integer \fIn\fP that corresponds to the \fIn\fPth CascadeButton or CascadeButtonGadget specified for the parent of the Pulldown menu pane\&. A Pulldown menu pane can be attached only to a CascadeButton or CascadeButtonGadget, and only CascadeButtons and CascadeButtonGadgets are counted in determining the integer \fIn\fP\&. The first CascadeButton or CascadeButtonGadget is number 0 (zero)\&. .IP "\fIcallback\fP" 10 Specifies a callback procedure to be called when a button is activated or when its value changes\&. This callback function is added to each button after creation\&. For a CascadeButtonGadget or a PushButtonGadget, the callback is added as the button\&'s \fBXmNactivateCallback\fP, and it is called when the button is activated\&. For a ToggleButtonGadget, the callback is added as the button\&'s \fBXmNvalueChangedCallback\fP, and it is called when the button\&'s value changes\&. The button number is returned in the \fIclient_data\fP field\&. .PP The variable portion of the argument list consists of groups of arguments\&. The first argument in each group is a constant or a string and determines which arguments follow in that group\&. The last argument in the list must be NULL\&. Following are the possible first arguments in each group of \fIvarargs\fP: .IP "\fBXmVaCASCADEBUTTON\fP" 10 This is followed by two additional arguments\&. The set specifies one button in the PulldownMenu and some of its resource values\&. The button created is a CascadeButtonGadget\&. Following are the additional two arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .RE .IP "\fBXmVaPUSHBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the PulldownMenu and some of its resource values\&. The button created is a PushButtonGadget\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR .RE .IP "\fBXmVaRADIOBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the PulldownMenu and some of its resource values\&. The button created is a ToggleButtonGadget\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR .RE .IP "\fBXmVaCHECKBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the PulldownMenu and some of its resource values\&. The button created is a ToggleButtonGadget\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\&.\fP .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR .RE .IP "\fBXmVaTITLE\fP" 10 This is followed by one additional argument\&. The pair specifies a title LabelGadget in the PulldownMenu\&. Following is the additional argument: .RS .IP "\fItitle\fP" 10 The title string, of type \fBXmString\fR .RE .IP "\fBXmVaSEPARATOR\fP" 10 This is followed by no additional arguments\&. It specifies one separator in the PulldownMenu\&. .IP "\fBXmVaDOUBLE_SEPARATOR\fP" 10 This is followed by no additional arguments\&. It specifies one separator in the PulldownMenu\&. The separator type is \fBXmDOUBLE_LINE\fP\&. .IP "\fIresource_name\fP" 10 This is followed by one additional argument, the value of the resource, of type XtArgVal\&. The pair specifies a resource and its value for the RowColumn widget\&. .IP "\fBXtVaTypedArg\fP" 10 This is followed by four additional arguments\&. The set specifies a resource and its value for the RowColumn widget\&. A resource type conversion is performed if necessary\&. Following are the additional four arguments, in order: .RS .IP "\fIname\fP" 10 The resource name, of type String\&. .IP "\fItype\fP" 10 The type of the resource value supplied, of type String\&. .IP "\fIvalue\fP" 10 The resource value (or a pointer to the resource value, depending on the type and size of the value), of type XtArgVal\&. .IP "\fIsize\fP" 10 The size of the resource value in bytes, of type int\&. .RE .IP "\fBXtVaNestedList\fP" 10 This is followed by one additional argument of type XtVarArgsList\&. This argument is a nested list of \fIvarargs\fP returned by \fBXtVaCreateArgsList\fP\&. .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreatePulldownMenu\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimplePulldownMenu\fP, and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmTextClearSelection.30000644000175000017500000000331512672140200016067 00000000000000'\" t ...\" TxtClear.sgm /main/8 1996/09/08 21:11:45 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextClearSelection" "library call" .SH "NAME" \fBXmTextClearSelection\fP \(em A Text function that clears the primary selection .iX "XmTextClearSelection" .iX "Text functions" "XmTextClearSelection" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextClearSelection\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextClearSelection\fP clears the primary selection in the Text widget\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fItime\fP" 10 Specifies the server time at which the selection value is desired\&. This should be the time of the event that triggered this request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed()\fP\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmVaCreateManagedNotebook.30000644000175000017500000000003612672140200016773 00000000000000.so man3/XmVaCreateNotebook.3 motif-2.3.8/doc/man/man3/XmStringExtent.30000644000175000017500000000337412672140200014771 00000000000000'\" t ...\" StrExt.sgm /main/9 1996/09/08 21:04:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringExtent" "library call" .SH "NAME" \fBXmStringExtent\fP \(em A compound string function that determines the size of the smallest rectangle that will enclose the compound string .iX "XmStringExtent" .iX "compound string functions" "XmStringExtent" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmStringExtent\fP\fR( \fBXmRenderTable \fBrendertable\fR\fR, \fBXmString \fBstring\fR\fR, \fBDimension \fB*width\fR\fR, \fBDimension \fB*height\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringExtent\fP determines the width and height, in pixels, of the smallest rectangle that will enclose the provided compound string\&. .IP "\fIrendertable\fP" 10 Specifies the render table .IP "\fIstring\fP" 10 Specifies the string .IP "\fIwidth\fP" 10 Specifies a pointer to the width of the rectangle .IP "\fIheight\fP" 10 Specifies a pointer to the height of the rectangle .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmScrollVisible.30000644000175000017500000000524612672140200015107 00000000000000'\" t ...\" ScrollVi.sgm /main/10 1996/09/08 21:01:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScrollVisible" "library call" .SH "NAME" \fBXmScrollVisible\fP \(em A ScrolledWindow function that makes an invisible descendant of a ScrolledWindow work area visible .iX "XmScrollVisible" .iX "Scrolled Window functions" "XmScrollVisible" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmScrollVisible\fP\fR( \fBWidget \fBscrollw_widget\fR\fR, \fBWidget \fBwidget\fR\fR, \fBDimension \fBleft_right_margin\fR\fR, \fBDimension \fBtop_bottom_margin\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmScrollVisible\fP makes an obscured or partially obscured widget or gadget descendant of a ScrolledWindow work area visible\&. The function repositions the work area and sets the specified margins between the widget and the nearest viewport boundary\&. The widget\&'s location relative to the viewport determines whether one or both of the margins must be adjusted\&. This function requires that the \fBXmNscrollingPolicy\fP of the ScrolledWindow widget be set to \fBXmAUTOMATIC\fP\&. .IP "\fIscrollw_widget\fP" 10 Specifies the ID of the ScrolledWindow widget whose work area window contains an obscured descendant\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget to be made visible\&. .IP "\fIleft_right_margin\fP" 10 Specifies the margin to establish between the left or right edge of the widget and the associated edge of the viewport\&. This margin is established only if the widget must be moved horizontally to make it visible\&. .IP "\fItop_bottom_margin\fP" 10 Specifies the margin to establish between the top or bottom edge of the widget and the associated edge of the viewport\&. This margin is established only if the widget must be moved vertically to make it visible\&. .PP For a complete definition of ScrolledWindow and its associated resources, see \fBXmScrolledWindow\fP(3) .SH "RELATED" .PP \fBXmScrolledWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmClipboardCopyByName.30000644000175000017500000000630612672140200016157 00000000000000'\" t ...\" ClipbC.sgm /main/10 1996/09/25 10:23:50 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardCopyByName" "library call" .SH "NAME" \fBXmClipboardCopyByName\fP \(em A clipboard function that copies a data item passed by name .iX "XmClipboardCopyByName" .iX "clipboard functions" "XmClipboardCopyByName" .SH "SYNOPSIS" .PP .nf #include int XmClipboardCopyByName (\fIdisplay, window, data_id, buffer, length, private_id\fP) Display \fI* display\fP; Window \fIwindow\fP; long \fIdata_id\fP; XtPointer \fIbuffer\fP; unsigned long \fIlength\fP; long \fIprivate_id\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardCopyByName\fP copies the actual data for a data item that was previously passed by name to the clipboard\&. Data is considered to be passed by name when a call to \fBXmClipboardCopy\fP is made with a NULL buffer parameter\&. Additional calls to this function append new data to the existing data\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each clipboard function it calls\&. .IP "\fIdata_id\fP" 10 Specifies an identifying number assigned to the data item that uniquely identifies the data item and the format\&. This number was assigned by \fBXmClipboardCopy\fP to the data item\&. .IP "\fIbuffer\fP" 10 Specifies the buffer from which the clipboard copies the data\&. .IP "\fIlength\fP" 10 Specifies the number of bytes in the data item\&. .IP "\fIprivate_id\fP" 10 Specifies the private data that the application wants to store with the data item\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardCopy\fP(3), \fBXmClipboardLock\fP(3), \fBXmClipboardStartCopy\fP(3), and \fBXmClipboardUnlock\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTab.30000644000175000017500000000306712672140200013040 00000000000000'\" t ...\" Tab.sgm /main/8 1996/09/08 21:08:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTab" "library call" .SH "NAME" \fBXmTab\fR \(em Data type for a tab stop .iX "XmTab" .SH "SYNOPSIS" .PP .nf #include XmTab .fi .SH "DESCRIPTION" .PP \fBXmTab\fR is a data structure that specifies a tab stop to be used in rendering an \fBXmString\fR containing tab components\&. An \fBXmTab\fR value contains a value, a unit type, an offset model (either \fBXmABSOLUTE\fP or \fBXmRELATIVE\fP), an alignment model (\fBXmALIGNMENT_BEGINNING\fP), and a decimal point character\&. The resource file syntax for \fBXmTab\fR is specified in the \fBXmTabList\fR reference page\&. .SH "RELATED" .PP \fBXmTabCreate\fP(3), \fBXmTabFree\fP(3), \fBXmTabGetValues\fP(3), \fBXmTabList\fP(3), and \fBXmTabSetValue\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmForm.30000644000175000017500000007451512672140200013243 00000000000000'\" t ...\" Form.sgm /main/9 1996/09/08 20:45:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmForm" "library call" .SH "NAME" \fBXmForm\fP \(em The Form widget class .iX "XmForm" .iX "widget class" "Form" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Form is a container widget with no input semantics of its own\&. Constraints are placed on children of the Form to define attachments for each of the child\&'s four sides\&. These attachments can be to the Form, to another child widget or gadget, to a relative position within the Form, or to the initial position of the child\&. The attachments determine the layout behavior of the Form when resizing occurs\&. .PP The default value for \fBXmNinitialFocus\fP is the value of \fBXmNdefaultButton\fP\&. .PP Following are some important considerations in using a Form: .IP " \(bu" 6 Every child must have an attachment on either the left or the right\&. If initialization or \fBXtSetValues\fP leaves a widget without such an attachment, the result depends upon the value of \fBXmNrubberPositioning\fP\&. .IP "" 10 If \fBXmNrubberPositioning\fP is False, the child is given an \fBXmNleftAttachment\fP of \fBXmATTACH_FORM\fP and an \fBXmNleftOffset\fP equal to its current \fIx\fP value\&. .IP "" 10 If \fBXmNrubberPositioning\fP is True, the child is given an \fBXmNleftAttachment\fP of \fBXmATTACH_POSITION\fP and an \fBXmNleftPosition\fP proportional to the current \fIx\fP value divided by the width of the Form\&. .IP "" 10 In either case, if the child has not been previously given an \fIx\fP value, its \fIx\fP value is taken to be 0 (zero), which places the child at the left side of the Form\&. .IP " \(bu" 6 If you want to create a child without any attachments, and then later (for example, after creating and managing it, but before realizing it) give it a right attachment through \fBXtSetValues\fP, you must set its \fBXmNleftAttachment\fP to \fBXmATTACH_NONE\fP at the same time\&. .IP " \(bu" 6 The \fBXmNresizable\fP resource controls only whether a geometry request by the child will be granted\&. It has no effect on whether the child\&'s size can be changed because of changes in geometry of the Form or of other children\&. .IP " \(bu" 6 Every child has a preferred width, based on geometry requests it makes (whether they are granted or not)\&. .IP " \(bu" 6 If a child has attachments on both the left and the right sides, its size is completely controlled by the Form\&. It can be shrunk below its preferred width or enlarged above it, if necessary, due to other constraints\&. In addition, the child\&'s geometry requests to change its own width may be refused\&. .IP " \(bu" 6 If a child has attachments on only its left or right side, it will always be at its preferred width (if resizable, otherwise at is current width)\&. This may cause it to be clipped by the Form or by other children\&. .IP " \(bu" 6 If a child\&'s left (or right) attachment is set to \fBXmATTACH_SELF\fP, its corresponding left (or right) offset is forced to 0 (zero)\&. The attachment is then changed to \fBXmATTACH_POSITION\fP, with a position that corresponds to the \fIx\fP value of the child\&'s left (or right) edge\&. To fix the position of a side at a specific \fIx\fP value, use \fBXmATTACH_FORM\fP or \fBXmATTACH_OPPOSITE_FORM\fP with the \fIx\fP value as the left (or right) offset\&. .IP " \(bu" 6 Unmapping a child has no effect on the Form except that the child is not mapped\&. .IP " \(bu" 6 Unmanaging a child unmaps it\&. If no other child is attached to it, or if all children attached to it and all children recursively attached to them are also all unmanaged, all of those children are treated as if they did not exist in determining the size of the Form\&. .IP " \(bu" 6 When using \fBXtSetValues\fP to change the \fBXmNx\fP resource of a child, you must simultaneously set its left attachment to either \fBXmATTACH_SELF\fP or \fBXmATTACH_NONE\fP\&. Otherwise, the request is not granted\&. If \fBXmNresizable\fP is False, the request is granted only if the child\&'s size can remain the same\&. .IP " \(bu" 6 A left (or right) attachment of \fBXmATTACH_WIDGET\fP, where \fBXmNleftWidget\fP (or \fBXmNrightWidget\fP) is NULL, acts like an attachment of \fBXmATTACH_FORM\fP\&. .IP " \(bu" 6 If an attachment is made to a widget that is not a child of the Form, but an ancestor of the widget is a child of the Form, the attachment is made to the ancestor\&. .PP All these considerations are true of top and bottom attachments as well, with top acting like left, bottom acting like right, \fIy\fP acting like \fIx\fP, and height acting like width\&. .SS "Classes" .PP Form inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP, and \fBXmBulletinBoard\fP\&. .PP The class pointer is \fBxmFormWidgetClass\fP\&. .PP The class name is \fBXmForm\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmForm Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNfractionBaseXmCMaxValueint100CSG _____ XmNhorizontalSpacingXmCSpacingDimension0CSG _____ XmNrubberPositioningXmCRubberPositioningBooleanFalseCSG _____ XmNverticalSpacingXmCSpacingDimension0CSG _____ .TE .IP "\fBXmNfractionBase\fP" 10 Specifies the denominator used in calculating the relative position of a child widget using \fBXmATTACH_POSITION\fP constraints\&. The value must not be 0 (zero)\&. .IP "" 10 If the value of a child\&'s \fBXmNleftAttachment\fP (or \fBXmNrightAttachment\fP) is \fBXmATTACH_POSITION\fP, the position of the left (or right) side of the child is relative to the left side of the Form and is a fraction of the width of the Form\&. This fraction is the value of the child\&'s \fBXmNleftPosition\fP (or \fBXmNrightPosition\fP) resource divided by the value of the Form\&'s \fBXmNfractionBase\fP\&. .IP "" 10 If the value of a child\&'s \fBXmNtopAttachment\fP (or \fBXmNbottomAttachment\fP) is \fBXmATTACH_POSITION\fP, the position of the top (or bottom) side of the child is relative to the top side of the Form and is a fraction of the height of the Form\&. This fraction is the value of the child\&'s \fBXmNtopPosition\fP (or \fBXmNbottomPosition\fP) resource divided by the value of the Form\&'s \fBXmNfractionBase\fP\&. .IP "\fBXmNhorizontalSpacing\fP" 10 Specifies the offset for right and left attachments\&. This resource is only used if no offset resource is specified (when attaching to a widget), or if no margin resource is specified (when attaching to the Form)\&. .IP "\fBXmNrubberPositioning\fP" 10 Indicates the default near (left) and top attachments for a child of the Form\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP\&.) .IP "" 10 The default left attachment is applied whenever initialization or \fBXtSetValues\fP leaves the child without either a left or right attachment\&. The default top attachment is applied whenever initialization or \fBXtSetValues\fP leaves the child without either a top or bottom attachment\&. .IP "" 10 If this Boolean resource is set to False, \fBXmNleftAttachment\fP and \fBXmNtopAttachment\fP default to \fBXmATTACH_FORM\fP, \fBXmNleftOffset\fP defaults to the current \fIx\fP value of the left side of the child, and \fBXmNtopOffset\fP defaults to the current \fIy\fP value of the child\&. The effect is to position the child according to its absolute distance from the left or top side of the Form\&. .IP "" 10 If this resource is set to True, \fBXmNleftAttachment\fP and \fBXmNtopAttachment\fP default to \fBXmATTACH_POSITION\fP, \fBXmNleftPosition\fP defaults to a value proportional to the current \fIx\fP value of the left side of the child divided by the width of the Form, and \fBXmNtopPosition\fP defaults to a value proportional to the current \fIy\fP value of the child divided by the height of the Form\&. The effect is to position the child relative to the left or top side of the Form and in proportion to the width or height of the Form\&. .IP "\fBXmNverticalSpacing\fP" 10 Specifies the offset for top and bottom attachments\&. This resource is only used if no offset resource is specified (when attaching to a widget), or if no margin resource is specified (when attaching to the Form)\&. .IP "" 10 .TS tab() box; c s s s s l| l| l| l| l. \fBXmForm Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomAttachmentXmCAttachmentunsigned charXmATTACH_NONECSG _____ XmNbottomOffsetXmCOffsetint0CSG _____ XmNbottomPositionXmCPositionint0CSG _____ XmNbottomWidgetXmCWidgetWidgetNULLCSG _____ XmNleftAttachmentXmCAttachmentunsigned charXmATTACH_NONECSG _____ XmNleftOffsetXmCOffsetint0CSG _____ XmNleftPositionXmCPositionint0CSG _____ XmNleftWidgetXmCWidgetWidgetNULLCSG _____ XmNresizableXmCBooleanBooleanTrueCSG _____ XmNrightAttachmentXmCAttachmentunsigned charXmATTACH_NONECSG _____ XmNrightOffsetXmCOffsetint0CSG _____ XmNrightPositionXmCPositionint0CSG _____ XmNrightWidgetXmCWidgetWidgetNULLCSG _____ XmNtopAttachmentXmCAttachmentunsigned charXmATTACH_NONECSG _____ XmNtopOffsetXmCOffsetint0CSG _____ XmNtopPositionXmCPositionint0CSG _____ XmNtopWidgetXmCWidgetWidgetNULLCSG _____ .TE .IP "\fBXmNbottomAttachment\fP" 10 Specifies attachment of the bottom side of the child\&. It can have the following values: .RS .IP "\fBXmATTACH_NONE\fP" 10 Do not attach the bottom side of the child\&. .IP "\fBXmATTACH_FORM\fP" 10 Attach the bottom side of the child to the bottom side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_FORM\fP" 10 Attach the bottom side of the child to the top side of the Form\&. \fBXmNbottomOffset\fP can be used to determine the visibility of the child\&. .IP "\fBXmATTACH_WIDGET\fP" 10 Attach the bottom side of the child to the top side of the widget or gadget specified in the \fBXmNbottomWidget\fP resource\&. If \fBXmNbottomWidget\fP is NULL, \fBXmATTACH_WIDGET\fP is replaced by \fBXmATTACH_FORM\fP, and the child is attached to the bottom side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_WIDGET\fP" 10 Attach the bottom side of the child to the bottom side of the widget or gadget specified in the \fBXmNbottomWidget\fP resource\&. .IP "\fBXmATTACH_POSITION\fP" 10 Attach the bottom side of the child to a position that is relative to the top side of the Form and in proportion to the height of the Form\&. This position is determined by the \fBXmNbottomPosition\fP and \fBXmNfractionBase\fP resources\&. .IP "\fBXmATTACH_SELF\fP" 10 Attach the bottom side of the child to a position that is proportional to the current \fIy\fP value of the bottom of the child divided by the height of the Form\&. This position is determined by the \fBXmNbottomPosition\fP and \fBXmNfractionBase\fP resources\&. \fBXmNbottomPosition\fP is set to a value proportional to the current \fIy\fP value of the bottom of the child divided by the height of the Form\&. .RE .IP "\fBXmNbottomOffset\fP" 10 Specifies the constant offset between the bottom side of the child and the object to which it is attached\&. The relationship established remains, regardless of any resizing operations that occur\&. When this resource is explicitly set, the value of \fBXmNverticalSpacing\fP is ignored\&. .IP "\fBXmNbottomPosition\fP" 10 This resource is used to determine the position of the bottom side of the child when the child\&'s \fBXmNbottomAttachment\fP is set to \fBXmATTACH_POSITION\fP\&. In this case the position of the bottom side of the child is relative to the top side of the Form and is a fraction of the height of the Form\&. This fraction is the value of the child\&'s \fBXmNbottomPosition\fP resource divided by the value of the Form\&'s \fBXmNfractionBase\fP\&. For example, if the child\&'s \fBXmNbottomPosition\fP is 50, the Form\&'s \fBXmNfractionBase\fP is 100, and the Form\&'s height is 200, the position of the bottom side of the child is 100\&. .IP "\fBXmNbottomWidget\fP" 10 Specifies the widget or gadget to which the bottom side of the child is attached\&. This resource is used if the \fBXmNbottomAttachment\fP resource is set to either \fBXmATTACH_WIDGET\fP or \fBXmATTACH_OPPOSITE_WIDGET\fP\&. .IP "" 10 A string-to-widget resource converter is automatically installed for use with this resource\&. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created\&. .IP "\fBXmNleftAttachment\fP" 10 Specifies attachment of the near (left) side of the child\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) It can have the following values: .RS .IP "\fBXmATTACH_NONE\fP" 10 Do not attach the left side of the child\&. If \fBXmNrightAttachment\fP is also \fBXmATTACH_NONE\fP, this value is ignored and the child is given a default left attachment\&. .IP "\fBXmATTACH_FORM\fP" 10 Attach the left side of the child to the left side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_FORM\fP" 10 Attach the left side of the child to the right side of the Form\&. \fBXmNleftOffset\fP can be used to determine the visibility of the child\&. .IP "\fBXmATTACH_WIDGET\fP" 10 Attach the left side of the child to the right side of the widget or gadget specified in the \fBXmNleftWidget\fP resource\&. If \fBXmNleftWidget\fP is NULL, \fBXmATTACH_WIDGET\fP is replaced by \fBXmATTACH_FORM\fP, and the child is attached to the left side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_WIDGET\fP" 10 Attach the left side of the child to the left side of the widget or gadget specified in the \fBXmNleftWidget\fP resource\&. .IP "\fBXmATTACH_POSITION\fP" 10 Attach the left side of the child to a position that is relative to the left side of the Form and in proportion to the width of the Form\&. This position is determined by the \fBXmNleftPosition\fP and \fBXmNfractionBase\fP resources\&. .IP "\fBXmATTACH_SELF\fP" 10 Attach the left side of the child to a position that is proportional to the current \fIx\fP value of the left side of the child divided by the width of the Form\&. This position is determined by the \fBXmNleftPosition\fP and \fBXmNfractionBase\fP resources\&. \fBXmNleftPosition\fP is set to a value proportional to the current \fIx\fP value of the left side of the child divided by the width of the Form\&. .RE .IP "\fBXmNleftOffset\fP" 10 Specifies the constant offset between the near (left) side of the child and the object to which it is attached\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) The relationship established remains, regardless of any resizing operations that occur\&. When this resource is explicitly set, the value of \fBXmNhorizontalSpacing\fP is ignored\&. .IP "\fBXmNleftPosition\fP" 10 This resource is used to determine the position of the near (left) side of the child when the child\&'s \fBXmNleftAttachment\fP is set to \fBXmATTACH_POSITION\fP\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) .IP "" 10 In this case, the position of the left side of the child is relative to the left side of the Form and is a fraction of the width of the Form\&. This fraction is the value of the child\&'s \fBXmNleftPosition\fP resource divided by the value of the Form\&'s \fBXmNfractionBase\fP\&. For example, if the child\&'s \fBXmNleftPosition\fP is 50, the Form\&'s \fBXmNfractionBase\fP is 100, and the Form\&'s width is 200, the position of the left side of the child is 100\&. .IP "\fBXmNleftWidget\fP" 10 Specifies the widget or gadget to which the near (left) side of the child is attached\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) The \fBXmNleftWidget\fP resource is used if the \fBXmNleftAttachment\fP resource is set to either \fBXmATTACH_WIDGET\fP or \fBXmATTACH_OPPOSITE_WIDGET\fP\&. .IP "" 10 A string-to-widget resource converter is automatically installed for use with this resource\&. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created\&. .IP "\fBXmNresizable\fP" 10 This Boolean resource specifies whether or not a child\&'s request for a new size is (conditionally) granted by the Form\&. If this resource is set to True the request is granted if possible\&. If this resource is set to False the request is always refused\&. .IP "" 10 If a child has both left and right attachments, its width is completely controlled by the Form, regardless of the value of the child\&'s \fBXmNresizable\fP resource\&. If a child has a left or right attachment but not both, the child\&'s \fBXmNwidth\fP is used in setting its width if the value of the child\&'s \fBXmNresizable\fP resource is True\&. These conditions are also true for top and bottom attachments, with height acting like width\&. .IP "\fBXmNrightAttachment\fP" 10 Specifies attachment of the far (right) side of the child\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) It can have the following values: .RS .IP "\fBXmATTACH_NONE\fP" 10 Do not attach the right side of the child\&. .IP "\fBXmATTACH_FORM\fP" 10 Attach the right side of the child to the right side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_FORM\fP" 10 Attach the right side of the child to the left side of the Form\&. \fBXmNrightOffset\fP can be used to determine the visibility of the child\&. .IP "\fBXmATTACH_WIDGET\fP" 10 Attach the right side of the child to the left side of the widget or gadget specified in the \fBXmNrightWidget\fP resource\&. If \fBXmNrightWidget\fP is NULL, \fBXmATTACH_WIDGET\fP is replaced by \fBXmATTACH_FORM\fP, and the child is attached to the right side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_WIDGET\fP" 10 Attach the right side of the child to the right side of the widget or gadget specified in the \fBXmNrightWidget\fP resource\&. .IP "\fBXmATTACH_POSITION\fP" 10 Attach the right side of the child to a position that is relative to the left side of the Form and in proportion to the width of the Form\&. This position is determined by the \fBXmNrightPosition\fP and \fBXmNfractionBase\fP resources\&. .IP "\fBXmATTACH_SELF\fP" 10 Attach the right side of the child to a position that is proportional to the current \fIx\fP value of the right side of the child divided by the width of the Form\&. This position is determined by the \fBXmNrightPosition\fP and \fBXmNfractionBase\fP resources\&. \fBXmNrightPosition\fP is set to a value proportional to the current \fIx\fP value of the right side of the child divided by the width of the Form\&. .RE .IP "\fBXmNrightOffset\fP" 10 Specifies the constant offset between the far (right) side of the child and the object to which it is attached\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) The relationship established remains, regardless of any resizing operations that occur\&. When this resource is explicitly set, the value of \fBXmNhorizontalSpacing\fP is ignored\&. .IP "\fBXmNrightPosition\fP" 10 This resource is used to determine the position of the far (right) side of the child when the child\&'s \fBXmNrightAttachment\fP is set to \fBXmATTACH_POSITION\fP\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) .IP "" 10 In this case the position of the right side of the child is relative to the left side of the Form and is a fraction of the width of the Form\&. This fraction is the value of the child\&'s \fBXmNrightPosition\fP resource divided by the value of the Form\&'s \fBXmNfractionBase\fP\&. For example, if the child\&'s \fBXmNrightPosition\fP is 50, the Form\&'s \fBXmNfractionBase\fP is 100, and the Form\&'s width is 200, the position of the right side of the child is 100\&. .IP "\fBXmNrightWidget\fP" 10 Specifies the widget or gadget to which the far (right) side of the child is attached\&. (Note that whether this resource actually applies to the left or right side of the child and its attachment depends on the value of the \fBXmNlayoutDirection\fP resource\&.) The \fBXmNrightWidget\fP resource is used if the \fBXmNrightAttachment\fP resource is set to either \fBXmATTACH_WIDGET\fP or \fBXmATTACH_OPPOSITE_WIDGET\fP\&. .IP "" 10 A string-to-widget resource converter is automatically installed for use with this resource\&. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created\&. .IP "\fBXmNtopAttachment\fP" 10 Specifies attachment of the top side of the child\&. It can have following values: .RS .IP "\fBXmATTACH_NONE\fP" 10 Do not attach the top side of the child\&. If the \fBXmNbottomAttachment\fP resource is also \fBXmATTACH_NONE\fP, this value is ignored and the child is given a default top attachment\&. .IP "\fBXmATTACH_FORM\fP" 10 Attach the top side of the child to the top side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_FORM\fP" 10 Attach the top side of the child to the bottom side of the Form\&. \fBXmNtopOffset\fP can be used to determine the visibility of the child\&. .IP "\fBXmATTACH_WIDGET\fP" 10 Attach the top side of the child to the bottom side of the widget or gadget specified in the \fBXmNtopWidget\fP resource\&. If \fBXmNtopWidget\fP is NULL, \fBXmATTACH_WIDGET\fP is replaced by \fBXmATTACH_FORM\fP and the child is attached to the top side of the Form\&. .IP "\fBXmATTACH_OPPOSITE_WIDGET\fP" 10 Attach the top side of the child to the top side of the widget or gadget specified in the \fBXmNtopWidget\fP resource\&. .IP "\fBXmATTACH_POSITION\fP" 10 Attach the top side of the child to a position that is relative to the top side of the Form and in proportion to the height of the Form\&. This position is determined by the \fBXmNtopPosition\fP and \fBXmNfractionBase\fP resources\&. .IP "\fBXmATTACH_SELF\fP" 10 Attach the top side of the child to a position that is proportional to the current \fIy\fP value of the child divided by the height of the Form\&. This position is determined by the \fBXmNtopPosition\fP and \fBXmNfractionBase\fP resources\&. \fBXmNtopPosition\fP is set to a value proportional to the current \fIy\fP value of the child divided by the height of the Form\&. .RE .IP "\fBXmNtopOffset\fP" 10 Specifies the constant offset between the top side of the child and the object to which it is attached\&. The relationship established remains, regardless of any resizing operations that occur\&. When this resource is explicitly set, the value of \fBXmNverticalSpacing\fP is ignored\&. .IP "\fBXmNtopPosition\fP" 10 This resource is used to determine the position of the top side of the child when the child\&'s \fBXmNtopAttachment\fP is set to \fBXmATTACH_POSITION\fP\&. In this case, the position of the top side of the child is relative to the top side of the Form and is a fraction of the height of the Form\&. This fraction is the value of the child\&'s \fBXmNtopPosition\fP resource divided by the value of the Form\&'s \fBXmNfractionBase\fP\&. For example, if the child\&'s \fBXmNtopPosition\fP is 50, the Form\&'s \fBXmNfractionBase\fP is 100, and the Form\&'s height is 200, the position of the top side of the child is 100\&. .IP "\fBXmNtopWidget\fP" 10 Specifies the widget or gadget to which the top side of the child is attached\&. This resource is used if \fBXmNtopAttachment\fP is set to a value of either \fBXmATTACH_WIDGET\fP or \fBXmATTACH_OPPOSITE_WIDGET\fP\&. .IP "" 10 A string-to-widget resource converter is automatically installed for use with this resource\&. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created\&. .SS "Inherited Resources" .PP Form inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmBulletinBoard Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowOverlapXmCAllowOverlapBooleanTrueCSG _____ XmNautoUnmanageXmCAutoUnmanageBooleanTrueCG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNcancelButtonXmCWidgetWidgetNULLSG _____ XmNdefaultButtonXmCWidgetWidgetNULLSG _____ XmNdefaultPositionXmCDefaultPositionBooleanTrueCSG _____ XmNdialogStyleXmCDialogStyleunsigned chardynamicCSG _____ XmNdialogTitleXmCDialogTitleXmStringNULLCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTableXmRenderTabledynamicCSG _____ XmNmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension0CSG _____ XmNmarginWidthXmCMarginWidthDimension0CSG _____ XmNnoResizeXmCNoResizeBooleanFalseCSG _____ XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_ANYCSG _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_OUTCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNtextTranslationsXmCTranslationsXtTranslationsNULLC _____ XmNunmapCallbackXmCCallbackXtCallbackListNULLC _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP XmForm inherits translations from XmBulletinBoard\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmBulletinBoard\fP(3), \fBXmCreateForm\fP, \fBXmCreateFormDialog\fP(3), \fBXmManager\fP(3), \fBXmVaCreateForm\fP, and \fBXmVaCreateManagedForm\fP\&. motif-2.3.8/doc/man/man3/XmFontListAdd.30000644000175000017500000000475512672140200014512 00000000000000'\" t ...\" FontLstB.sgm /main/8 1996/09/08 20:43:21 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListAdd" "library call" .SH "NAME" \fBXmFontListAdd\fP \(em A font list function that creates a new font list .iX "XmFontListAdd" .iX "font list functions" "XmFontListAdd" .SH "SYNOPSIS" .PP .nf #include \fBXmFontList \fBXmFontListAdd\fP\fR( \fBXmFontList \fBoldlist\fR\fR, \fBXFontStruct \fB*font\fR\fR, \fBXmStringCharSet \fBcharset\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListAdd\fP creates a new font list consisting of the contents of \fIoldlist\fP and the new font list element being added\&. This function deallocates \fIoldlist\fP after extracting the required information; therefore, do not reference \fIoldlist\fP thereafter\&. .PP \fBNOTE:\fP This function is obsolete and exists for compatibility with previous releases\&. It has been replaced by \fBXmFontListAppendEntry\fP\&. .IP "\fIoldlist\fP" 10 Specifies a pointer to the font list to which an entry will be added\&. .IP "\fIfont\fP" 10 Specifies a pointer to a font structure for which the new font list is generated\&. This is the structure returned by the XLib \fBXLoadQueryFont\fP function\&. .IP "\fIcharset\fP" 10 Specifies the character set identifier for the font\&. This can be \fBXmSTRING_DEFAULT_CHARSET\fP, but this value does not comply with the AES, and it may be removed in future versions of Motif\&. If the value is \fBXmSTRING_DEFAULT_CHARSET\fP, the routine derives the character set from the current language environment\&. .SH "RETURN" .PP Returns NULL if \fIoldlist\fP is NULL; returns \fIoldlist\fP if \fIfont\fP or \fIcharset\fP is NULL; otherwise, returns a new font list\&. .SH "RELATED" .PP \fBXmFontList\fP(3) and \fBXmFontListAppendEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmIsMotifWMRunning.30000644000175000017500000000324412672140200015506 00000000000000'\" t ...\" IsMWM.sgm /main/5 1995/08/19 13:47:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmIsMotifWMRunning" "library call" .SH "NAME" \fBXmIsMotifWMRunning\fP \(em A function that determines whether the window manager is running .iX "XmIsMotifWMRunning" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmIsMotifWMRunning\fP\fR( \fBWidget \fBshell\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmIsMotifWMRunning\fP lets a user know whether the Motif Window Manager is running on a screen that contains a specific widget hierarchy\&. This function first sees whether the \fB_MOTIF_WM_INFO\fP property is present on the root window of the shell\&'s screen\&. If it is, its window field is used to query for the presence of the specified window as a child of root\&. .IP "\fIshell\fP" 10 Specifies the shell whose screen will be tested for \fBmwm\fP\&'s presence\&. .SH "RETURN" .PP Returns True if MWM is running\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmDataFieldSetHighlight.30000644000175000017500000000463412672140200016454 00000000000000'\" t ...\" TxtFieBB.sgm /main/8 1996/09/08 21:15:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldSetHighlight" "library call" .SH "NAME" \fBXmDataFieldSetHighlight\fP \(em A DataField function that highlights text .iX "XmDataFieldSetHighlight" .iX "DataField functions" "XmDataFieldSetHighlight" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDataFieldSetHighlight\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBleft\fR\fR, \fBXmTextPosition \fBright\fR\fR, \fBXmHighlightMode \fBmode\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldSetHighlight\fP highlights text between the two specified character positions\&. The \fImode\fP parameter determines the type of highlighting\&. Highlighting text merely changes the visual appearance of the text; it does not set the selection\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIleft\fP" 10 Specifies the position of the left boundary of text to be highlighted\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fIright\fP" 10 Specifies the position of the right boundary of text to be highlighted\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fImode\fP" 10 Specifies the type of highlighting to be done\&. A value of \fBXmHIGHLIGHT_NORMAL\fP removes highlighting\&. A value of \fBXmHIGHLIGHT_SELECTED\fP highlights the test using reverse video\&. A value of \fBXmHIGHLIGHT_SECONDARY_SELECTED\fP highlights the text using underlining\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. motif-2.3.8/doc/man/man3/XmRenderTable.30000644000175000017500000001540412672140200014517 00000000000000'\" t ...\" RendTaA.sgm /main/8 1996/09/08 20:57:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTable" "library call" .SH "NAME" \fBXmRenderTable\fR \(em Data type for a render table .iX "XmRenderTable" .SH "SYNOPSIS" .PP .nf #include XmRenderTable .fi .SH "DESCRIPTION" .PP \fBXmRenderTable\fR is the data type for a render table, which contains a table of renditions (\fBXmRendition\fRs)\&. Each rendition consists of a set of attributes for rendering text, including a font or fontset, colors, tabs, and lines\&. Each rendition is identified with a tag\&. .PP When a compound string is displayed, for each segment in the string, the rendition used to render that string is formed as follows\&. If the segment has at least one rendition begin tag or if the list of tags formed by accumulating from previous segments the rendition begin tags and removing the rendition end tags is not empty, these tags are matched with renditions in the render table\&. The effective rendition used to render the segment is formed by successively merging each rendition found into the current rendition with non-\fBXmAS_IS\fP (\fBXmUNSPECIFIED_PIXEL\fP for color resources) values for resources in the rendition to be merged, thus replacing the corresponding values of the resources in the current rendition\&. Finally, if the resulting rendition still has resources with unspecified values and the segment has a locale or charset tag (these are optional and mutually exclusive) this tag is matched with a rendition in the render table, and the missing rendition values are filled in from that entry\&. .PP If no matching rendition is found for a particular tag, then the \fBXmNnoRenditionCallback\fP of the \fBXmDisplay\fP object is called and the render table is searched again for that tag\&. .PP If the resulting rendition does not specify a font or fontset, then for segments whose text type is \fBXmCHARSET_TEXT\fP, the render table will be searched for a rendition tagged with \fBXmFONTLIST_DEFAULT_TAG\fP, and if a matching rendition is found, it will be merged into the current rendition\&. If the resulting rendition contains no font or fontset, the \fBXmNnoFontCallback\fP will be called with the default rendition and "" as the font name\&. If no rendition matches or no font was found after the callback, then the first rendition in the render table will be merged into the current rendition\&. If this rendition still has no font, then the segment will not be rendered and a warning will be emitted\&. .PP For segments whose text type is \fBXmMULTIBYTE_TEXT\fP or \fBXmWIDECHAR_TEXT\fP, the render table will be searched for a rendition tagged with \fB_MOTIF_DEFAULT_LOCALE\fP, and, if a matching rendition is found, it will be merged into the current rendition\&. If the resulting rendition contains no font, the \fBXmNnoFontCallback\fP will be called with the default rendition and "" as the font name\&. An application can have this callback attempt to remedy this problem by calling \fBXmRenditionUpdate\fP on the input rendition to provide a font for the widget to use\&. This may be done by either providing an alternative font name to be loaded using the \fBXmNfontName\fP and \fBXmNfontType\fP resources or with an already loaded font using the \fBXmNfont\fP resource\&. If no rendition matches or no font was found after the callback, then the segment will not be rendered and a warning will be issued\&. .PP Render tables are specified in resource files with the following syntax: .PP .nf \fIresource_spec\fP: [ \fItag\fP [, \fItag\fP ]* ] .fi .PP where \fItag\fP is some string suitable for the \fBXmNtag\fP resource of a rendition\&. .PP If no tags are specified, then a render table will be created that is either empty or contains only a rendition with a tag of \fB_MOTIF_DEFAULT_LOCALE\fP\&. .PP Specific values for specific rendition resources are specified using the following syntax: .PP .nf \fIresource_spec\fP [*|\&.] \fIrendition\fP[*|\&.] \fIresource_name\fP: \fIvalue\fP .fi .PP where: .IP "\fIresource_spec\fP" 10 Specifies the render table\&. .IP "\fIrendition\fP" 10 Is either the class Rendition or a tag\&. .IP "\fIresource_name\fP" 10 Is either the class or name of a particular resource\&. .IP "\fIvalue\fP" 10 Is the specification of the value to be set\&. .PP Any resource line that consists of just a resource name or class component with no rendition component or loose binding will be assumed to specify resource values for a rendition with a tag of \fB_MOTIF_DEFAULT_LOCALE\fP\&. In effect, this creates a default rendition in much the same way that specifying no fontlist tag for a fontlist resource causes the fontlist created to contain an entry tagged with \fBXmFONTLIST_DEFAULT_TAG\fP: .PP .nf \fIresource_spec\fP\&.\fIresource_name\fP: \fIvalue\fP .fi .PP For example, the following would set the \fBXmNrenderTable\fP resource of \fBlabel1\fP to a render table consisting of three renditions tagged with \fB_MOTIF_DEFAULT_LOCALE\fP, \fIbold\fP, and \fIoblique\fP, with values for resources set as described in the resource specifications\&. .PP .nf \f(CW*label1\&.renderTable: bold, oblique *label1\&.renderTable\&.bold\&.renditionForeground: Green *label1\&.renderTable\&.bold\&.fontName: *-*-*-bold-*-iso8859-1 *label1\&.renderTable\&.bold\&.fontType: FONT_IS_FONT *label1\&.renderTable\&.oblique\&.renditionBackground: Red *label1\&.renderTable\&.oblique\&.fontName: *-*-*-italic-*-iso8859-1 *label1\&.renderTable\&.oblique\&.fontType: FONT_IS_FONT *label1\&.renderTable\&.oblique\&.underlineType: AS_IS *label1\&.renderTable\&.fontName: fixed *label1\&.renderTable\&.fontType: FONT_IS_FONT *label1\&.renderTable\&.renditionForegound: black *label1\&.renderTable*tabList: 1in, +1\&.5in, +3in\fR .fi .PP .SH "RELATED" .PP \fBXmRenderTableAddRenditions\fP(3), \fBXmRenderTableCopy\fP(3), \fBXmRenderTableCvtFromProp\fP(3), \fBXmRenderTableCvtToProp\fP(3), \fBXmRenderTableFree\fP(3), \fBXmRenderTableGetRendition\fP(3), \fBXmRenderTableGetRenditions\fP(3), \fBXmRenderTableGetTags\fP(3), \fBXmRenderTableRemoveRenditions\fP(3), \fBXmRendition\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmPrintPopupPDM.30000644000175000017500000000766012672140200015016 00000000000000'\" t ...\" PrtPopup.sgm /main/9 1996/08/31 15:27:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPrintPopupPDM" "library call" .SH "NAME" \fBXmPrintPopupPDM\fR \(em Send a notification for the PDM to be popped up .SH "SYNOPSIS" .PP .nf #include \fBXtEnum \fBXmPrintPopupPDM\fP\fR( \fBWidget\fBprint_shell\fR\fR, \fBWidget\fBvideo_transient_for\fR\fR); .fi .SH "DESCRIPTION" .PP A convenience function that sends a notification to start a Print Dialog Manager on behalf of the application, \fBXmPrintPopupPDM\fP hides the details of the X selection mechanism used to notify the PDM that a new dialog must be popped up for this application\&. .PP \fBXmPrintPopupPDM\fP sends a selection request to either the print display of the print shell, or the video display of the transient_for video widget (depending on the environment variable \fBXPDMDISPLAY\fP, which can only takes the value "print" or "video"), asking for the PDM windows to be popped up on behalf of the app\&. .PP Return right away with status of \fBXmPDM_NOTIFY_FAIL\fP (e\&.g\&. if the function couldn\&'t malloc memory for the selection value, or if \fBXPDMDISPLAY\fP is not "print" or "video") or with \fBXmPDM_NOTIFY_SUCCESS\fP , which only means a "message" was sent out to the PDM specified by \fBXPDMSELECTION\fP , not that it\&'s already up on the screen yet\&. .PP In order to know if the PDM is up, or not running, the application must register a \fBXmNpdmNotificationCallback\fP with the Print Shell\&. .PP \fBXmPrintPopupPDM\fP puts up an \fBInputOnly\fP window on top of the dialog, so that the end user doesn\&'t use the print setup dialog while the PDM is trying to come up\&. This window is automatically removed when the shell is about to call the callback for the first time\&. .IP "\fIprint_shell\fP" 10 The Print Shell used for this print job and context\&. .IP "\fIvideo_transient_for\fP" 10 The video widget dealing with application print setup\&. .SH "RETURN VALUE" .PP Returns \fBXmPDM_NOTIFY_SUCCESS\fP if the function was able to send the notification out to the PDM process, \fBXmPDM_NOTIFY_FAIL\fP otherwise\&. .SH "ERRORS/WARNINGS" .PP Not applicable\&. .SH "EXAMPLES" .PP Example of callback from a Print set up dialog box "Setup\&.\&.\&." button: .PP .nf \f(CWPrintSetupCallback(print_dialog\&.\&.\&.) /*-------------*/ { if (XmPrintPopupPDM (pshell, XtParent(print_dialog)) != XmPDM_NOTIFY_SUCCESS) { /* some error dialog */ } }\fR .fi .PP .PP Example of \fBXmNpdmNotificationCallback\fP from a Print Shell: .PP .nf \f(CWpdmNotifyCB(print_shell\&.\&.\&.) { XmPrintShellCallBackStruct * pr_cb = \&.\&.\&. switch (pr_cb->reason) { case XmCR_PDM_NONE: /* no PDM available */ PostErrorDialog(\&.\&.\&.); break; case XmCR_PDM_VXAUTH: /* PDM is not authorized \&.\&.\&. */ PostErrorDialog(\&.\&.\&.); break; case XmCR_PDM_UP: the PDM is up and running /* everything is fine */ break; default: /* other cases */ } }\fR .fi .PP .SH "SEE ALSO" .PP \fBXmPrintSetup\fP(3), \fBXmPrintShell\fP(3), \fBXmRedisplayWidget\fP(3), \fBXmPrintToFile\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmVaCreateCombinationBox2.30000644000175000017500000000300112672140200016726 00000000000000.DT .TH "XmVaCreateCombinationBox2" "library call" .SH "NAME" \fBXmVaCreateCombinationBox2\fP, \fBXmVaCreateManagedCombinationBox2\fP \(em A Form widget convenience creation functions\&. .iX "XmVaCreateCombinationBox2" "XmVaCreateManagedCombinationBox2" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateCombinationBox2\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedCombinationBox2\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a CombinationBox2 widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateCombinationBox2\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedCombinationBox2\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Form and its associated resources, see \fBXmCombinationBox2\fP(3)\&. .SH "RETURN" .PP Returns the CombinationBox2 widget ID\&. .SH "RELATED" .PP \fBXmCombinationBox2\fP(3), \fBXmCreateCombinationBox2\fP(3), \fBXtCreateManagedWidget\fP(3), and \fBXtCreateWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmImRegister.30000644000175000017500000000460012672140200014376 00000000000000'\" t ...\" ImRegist.sgm /main/9 1996/09/08 20:47:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImRegister" "library call" .SH "NAME" \fBXmImRegister\fP \(em An input manager function that registers a widget with an input manager .iX "XmImRegister" .iX "input manager functions" "XmImRegister" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImRegister\fP\fR( \fBWidget \fBwidget\fR\fR, \fBunsigned int \fBreserved\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImRegister\fP registers a widget with its input manager\&. This adds the specified widget to a list of widgets that are supported by the input manager for an input method\&. If an input method has not been opened by a previous call to \fBXmImRegister\fP, the first time this routine is called it opens an input method using the \fBXmNinputMethod\fP resource for the VendorShell\&. If the \fBXmNinputMethod\fP is NULL, an input method is opened using the current locale\&. .PP If an input method cannot be opened in the current locale, \fBXLookupString\fP provides input processing\&. .PP The application is responsible for unregistering a widget by calling \fBXmImUnregister\fP\&. .PP Note that the Text, TextField, and List widgets already call the \fBXmImRegister\fP function internally\&. You should not call this function for these widgets before calling \fBXmImUnregister\fP first\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget to be registered\&. .IP "\fIreserved\fP" 10 This argument is not used in the current release of Motif\&. The value should always be 0 (zero)\&. .SH "RELATED" .PP \fBXmImGetXIM\fP(3), \fBXmImMbLookupString\fP(3), and \fBXmImUnregister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmAddTabGroup.30000644000175000017500000000434112672140200014462 00000000000000'\" t ...\" AddTabGr.sgm /main/9 1996/09/08 20:24:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmAddTabGroup" "library call" .SH "NAME" \fBXmAddTabGroup\fP \(em A function that adds a manager or a primitive widget to the list of tab groups .iX "XmAddTabGroup" .iX "VendorShell functions" "XmAddTabGroup" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmAddTabGroup\fP\fR( \fBWidget \fBtab_group\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and its behavior is replaced by setting \fBXmNnavigationType\fP to \fBXmEXCLUSIVE_TAB_GROUP\fP\&. When the keyboard is used to traverse through a widget hierarchy, primitive or manager widgets are grouped together into what are known as \fBtab groups\fP\&. Any manager or primitive widget can be a tab group\&. Within a tab group, move the focus to the next widget in the tab group by using the arrow keys\&. To move to another tab group, use \fBKNextField\fP or \fBKPrevField\fP\&. .PP Tab groups are ordinarily specified by the \fBXmNnavigationType\fP resource\&. \fBXmAddTabGroup\fP is called to control the order of traversal of tab groups\&. The widget specified by \fItab_group\fP is appended to the list of tab groups to be traversed, and the widget\&'s \fBXmNnavigationType\fP is set to \fBXmEXCLUSIVE_TAB_GROUP\fP\&. .IP "\fItab_group\fP" 10 Specifies the manager or primitive widget ID .SH "RELATED" .PP \fBXmManager\fP(3), \fBXmGetTabGroup\fP(3), \fBXmPrimitive\fP(3), and \fBXmRemoveTabGroup\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmCreateMessageDialog.30000644000175000017500000000467012672140200016163 00000000000000'\" t ...\" CreMeD.sgm /main/8 1996/09/08 20:33:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateMessageDialog" "library call" .SH "NAME" \fBXmCreateMessageDialog\fP \(em The MessageBox MessageDialog convenience creation function .iX "XmCreateMessageDialog" .iX "creation functions" "XmCreateMessageDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateMessageDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateMessageDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged MessageBox child of the DialogShell\&. A MessageDialog is used for common interaction tasks, which include giving information, asking questions, and reporting errors\&. It includes a symbol, a message, and three buttons\&. By default, there is no symbol\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. .PP Use \fBXtManageChild\fP to pop up the MessageDialog (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateMessageDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmVaCreateSimpleCheckBox.30000644000175000017500000001155612672140200016607 00000000000000'\" t ...\" VaCreA.sgm /main/9 1996/09/08 21:21:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmVaCreateSimpleCheckBox" "library call" .SH "NAME" \fBXmVaCreateSimpleCheckBox\fP \(em A RowColumn widget convenience creation function .iX "XmVaCreateSimpleCheckBox" .iX "creation functions" "XmVaCreateSimpleCheckBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmVaCreateSimpleCheckBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmVaCreateSimpleCheckBox\fP creates an instance of a RowColumn widget of type \fBXmWORK_AREA\fP and returns the associated widget ID\&. This routine uses the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP This routine creates a CheckBox and its ToggleButtonGadget children\&. A CheckBox is similar to a RadioBox, except that more than one button can be selected at a time\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. Buttons are named and created in the order in which they are specified in the variable portion of the argument list\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIcallback\fP" 10 Specifies a callback procedure to be called when a button\&'s value changes\&. This callback function is added to each button after creation as the button\&'s \fBXmNvalueChangedCallback\fP\&. The callback function is called when a button\&'s value changes, and the button number is returned in the \fIclient_data\fP field\&. .PP The variable portion of the argument list consists of groups of arguments\&. The first argument in each group is a constant or a string and determines which arguments follow in that group\&. The last argument in the list must be NULL\&. The following list describes the possible first arguments in each group of \fIvarargs\fP: .IP "\fBXmVaCHECKBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the CheckBox and some of its resource values\&. The following list describes the additional four arguments, in order\&. .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP\&. This is ignored in this release\&. .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR\&. This is ignored in this release\&. .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR\&. This is ignored in this release\&. .RE .IP "\fIresource_name\fP" 10 This is followed by one additional argument, the value of the resource, of type \fBXtArgVal\fP\&. The pair specifies a resource and its value for the RowColumn widget\&. .IP "\fBXtVaTypedArg\fP" 10 This is followed by four additional arguments\&. The set specifies a resource and its value for the RowColumn widget\&. A resource type conversion is performed if necessary\&. Following are the additional four arguments, in order: .RS .IP "\fIname\fP" 10 The resource name, of type \fBString\fR .IP "\fItype\fP" 10 The type of the resource value supplied, of type \fBString\fR .IP "\fIvalue\fP" 10 The resource value (or a pointer to the resource value, depending on the type and size of the value), of type \fBXtArgVal\fP .IP "\fIsize\fP" 10 The size of the resource value in bytes, of type \fIint\fP .RE .IP "\fBXtVaNestedList\fP" 10 This is followed by one additional argument of type XtVarArgsList\&. This argument is a nested list of \fIvarargs\fP returned by \fBXtVaCreateArgsList\fP\&. .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateRadioBox\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleCheckBox\fP(3), \fBXmCreateSimpleRadioBox\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimpleRadioBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmCvtXmStringTableToTextProperty.30000644000175000017500000001045412672140200020445 00000000000000'\" t ...\" CvtXmStA.sgm /main/9 1996/09/08 20:38:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCvtXmStringTableToTextProperty" "library call" .SH "NAME" \fBXmCvtXmStringTableToTextProperty\fP \(em A function that converts from XmStringTable to an XTextProperty Structure .iX "XmCvtXmStringTableToTextProperty" .SH "SYNOPSIS" .PP .nf #include int XmCvtXmStringTableToTextProperty (\fIdisplay, string_table, count, style, text_prop_return\fP) Display *\fIdisplay\fP; XmStringTable \fIstring_table\fP; int \fIcount\fP; XmICCEncodingStyle \fIstyle\fP; XTextProperty *\fItext_prop_return\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmCvtXmStringTableToTextProperty\fP converts the \fBXmString\fRs in the specified \fBXmStringTable\fR into an \fBXTextProperty\fP structure\&. .PP The function sets the encoding member of \fItext_prop_return\fP to an \fBAtom\fP for the specified display naming the encoding determined by the specified style, and it converts the first \fIcount\fP compound strings in the specified \fBXmStringTable\fR to this encoding for storage in the \fItext_prop_return\fP value member\&. Following are the possible encoding styles: .IP "\fBXmSTYLE_COMPOUND_STRING\fP" 10 The encoding is \fB_MOTIF_COMPOUND_STRING\fP\&. The function converts each specified \fBXmString\fR to a compound string in Byte Stream format\&. .IP "\fBXmSTYLE_COMPOUND_TEXT\fP" 10 The encoding is \fBCOMPOUND_TEXT\fP\&. The function converts each specified \fBXmString\fR to compound text\&. .IP "\fBXmSTYLE_LOCALE\fP" 10 The encoding is the encoding of the current locale\&. The function converts each specified \fBXmString\fR to the encoding of the current locale\&. .IP "\fBXmSTYLE_STRING\fP" 10 The encoding is \fBSTRING\fP (plain C strings encoded in ISO8859-1), and the function converts each specified \fBXmString\fR to \fBSTRING\fP\&. .IP "\fBXmSTYLE_TEXT\fP" 10 If all specified \fBXmString\fRs are fully convertible to the encoding of the current locale, the encoding is the encoding of the current locale, and the function converts each specified \fBXmString\fR to the encoding of the current locale\&. Otherwise, the encoding is \fBCOMPOUND_TEXT\fP, and the function converts each specified compound string to compound text\&. .IP "\fBXmSTYLE_STANDARD_ICC_TEXT\fP" 10 If all specified \fBXmString\fRs are fully convertible to \fBSTRING\fP, the encoding is \fBSTRING\fP, and the function converts each specified \fBXmString\fR to \fBSTRING\fP\&. Otherwise, the encoding is \fBCOMPOUND_TEXT\fP, and the function converts each specified \fBXmString\fR to compound text\&. .IP "\fIdisplay\fP" 10 Specifies the connection to the X server\&. .IP "\fIstring_table\fP" 10 Specifies a set of \fBXmString\fRs\&. .IP "\fIcount\fP" 10 Specifies the number of \fBXmString\fRs to be converted in \fIstring_table\fP\&. .IP "\fIstyle\fP" 10 Specifies the manner in which the property is encoded\&. .IP "\fItext_prop_return\fP" 10 Returns the \fBXTextProperty\fP structure\&. .PP To free the storage for the value member of the \fBXTextProperty\fP, use \fBXtFree\fP\&. .SH "RETURN VALUES" .PP If conversion depends on the locale and the current locale is not supported, the function returns \fBXLocaleNotSupported\fP\&. In both of these cases, the function does not set \fItext_prop_return\fP\&. .PP To determine whether the function is guaranteed not to return \fBXLocaleNotSupported\fP, use \fBXSupportsLocale\fP\&. .SH "RELATED INFORMATION" .PP \fBXmCvtXmStringToByteStream\fP(3), \fBXmCvtTextPropertyToXmStringTable\fP(3), and \fBXmStringTable\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmToggleButtonGetState.30000644000175000017500000000313712672140200016406 00000000000000'\" t ...\" ToggleBE.sgm /main/7 1996/08/30 16:19:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmToggleButtonGetState" "library call" .SH "NAME" \fBXmToggleButtonGetState\fP \(em A ToggleButton function that obtains the state of a ToggleButton .iX "XmToggleButtonGetState" .iX "ToggleButton functions" "XmToggleButtonGetState" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmToggleButtonGetState\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmToggleButtonGetState\fP obtains the state of a ToggleButton\&. .IP "\fIwidget\fP" 10 Specifies the ToggleButton widget ID .PP For a complete definition of ToggleButton and its associated resources, see \fBXmToggleButton\fP(3)\&. .SH "RETURN" .PP Returns True if the button is selected and False if the button is unselected\&. .SH "RELATED" .PP \fBXmToggleButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmCreateMenuBar.30000644000175000017500000000635012672140200015005 00000000000000'\" t ...\" CreMeA.sgm /main/8 1996/09/08 20:33:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateMenuBar" "library call" .SH "NAME" \fBXmCreateMenuBar\fP \(em A RowColumn widget convenience creation function .iX "XmCreateMenuBar" .iX "creation functions" "XmCreateMenuBar" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateMenuBar\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateMenuBar\fP creates an instance of a RowColumn widget of type \fBXmMENU_BAR\fP and returns the associated widget ID\&. It is provided as a convenience function for creating RowColumn widgets configured to operate as a MenuBar and is not implemented as a separate widget class\&. .PP The MenuBar widget is generally used for building a Pulldown menu system\&. Typically, a MenuBar is created and placed along the top of the application window, and several CascadeButtons are inserted as the children\&. Each of the CascadeButtons has a Pulldown menu pane associated with it\&. These Pulldown menu panes must have been created as children of the MenuBar\&. The user interacts with the MenuBar by using either the mouse or the keyboard\&. .PP The MenuBar displays a 3-D shadow along its border\&. The application controls the shadow attributes using the visual-related resources supported by \fBXmManager\fP\&. .PP The MenuBar widget is homogeneous in that it accepts only children that are a subclass of \fBXmCascadeButton\fP or \fBXmCascadeButtonGadget\fP\&. Attempting to insert a child of a different class results in a warning message\&. .PP If the MenuBar does not have enough room to fit all of its subwidgets on a single line, the MenuBar attempts to wrap the remaining entries onto additional lines if allowed by the geometry manager of the parent widget\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCascadeButton\fP(3), \fBXmCascadeButtonGadget\fP(3), \fBXmCreatePulldownMenu\fP(3), \fBXmCreateSimpleMenuBar\fP(3), \fBXmManager\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimpleMenuBar\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmStringNConcat.30000644000175000017500000000465212672140200015047 00000000000000'\" t ...\" StrNCA.sgm /main/8 1996/09/08 21:06:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringNConcat" "library call" .SH "NAME" \fBXmStringNConcat\fP \(em A compound string function that appends a specified number of bytes to a compound string .iX "XmStringNConcat" .iX "compound string functions" "XmStringNConcat" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringNConcat\fP\fR( \fBXmString \fBs1\fR\fR, \fBXmString \fBs2\fR\fR, \fBint \fBnum_bytes\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmStringConcat\fP\&. \fBXmStringNConcat\fP appends a specified number of bytes from \fIs2\fP to the end of \fIs1\fP, including tags, directional indicators, and separators\&. It then returns the resulting compound string\&. The original strings are preserved\&. The function allocates space for the resulting compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fIs1\fP" 10 Specifies the compound string to which a copy of \fIs2\fP is appended\&. .IP "\fIs2\fP" 10 Specifies the compound string that is appended to the end of \fIs1\fP\&. .IP "\fInum_bytes\fP" 10 Specifies the number of bytes of \fIs2\fP to append to \fIs1\fP\&. If this value is less than the length of \fIs2\fP, as many bytes as possible, but possibly fewer than this value, will be appended to \fIs1\fP such that the resulting string is still a valid compound string\&. .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmOptionLabelGadget.30000644000175000017500000000476412672140200015663 00000000000000'\" t ...\" OptionLa.sgm /main/8 1996/09/08 20:55:05 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmOptionLabelGadget" "library call" .SH "NAME" \fBXmOptionLabelGadget\fP \(em A RowColumn function that obtains the widget ID for the LabelGadget in an OptionMenu .iX "XmOptionLabelGadget" .iX "RowColumn functions" "XmOptionLabelGadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmOptionLabelGadget\fP\fR( \fBWidget \fBoption_menu\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmOptionLabelGadget\fP provides the application with the means for obtaining the widget ID for the internally created LabelGadget\&. Once the application has obtained the widget ID, it can adjust the visuals for the LabelGadget, if desired\&. .IP "\fIoption_menu\fP" 10 Specifies the OptionMenu widget ID .PP When an application creates an instance of the OptionMenu widget, the widget creates two internal gadgets\&. One is a LabelGadget that is used to display RowColumn\&'s \fBXmNlabelString\fP resource\&. The other is a CascadeButtonGadget that displays the current selection and provides the means for posting the OptionMenu\&'s submenu\&. .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of an OptionMenu\&. The following list identifies the names of these widgets (or gadgets) and the associated OptionMenu areas\&. .IP "Option Menu Label Gadget" 10 \fBOptionLabel\fP .IP "Option Menu Cascade Button" 10 \fBOptionButton\fP .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the widget ID for the internal label\&. .SH "RELATED" .PP \fBXmCreateOptionMenu\fP(3), \fBXmLabelGadget\fP(3), \fBXmOptionButtonGadget\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmParseMappingCreate.30000644000175000017500000000427412672140200016045 00000000000000'\" t ...\" ParMapB.sgm /main/7 1996/08/30 15:52:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmParseMappingCreate" "library call" .SH "NAME" \fBXmParseMappingCreate\fP \(em A compound string function to create a parse mapping .iX "XmParseMappingCreate" .iX "compound string functions" "XmParseMappingCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmParseMapping \fBXmParseMappingCreate\fP\fR( \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmParseMappingCreate\fP creates a parse mapping for use in a parse table\&. This function allows the application to specify values for components of the parse mapping using a resource-style argument list\&. .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of \fBXmParseMapping\fR and its associated resources, see \fBXmParseMapping\fP(3)\&. .SH "RETURN" .PP Returns the \fBXmParseMapping\fR object\&. The function allocates space to hold the returned \fBXmParseMapping\fR object\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmParseMappingFree\fP\&. .SH "RELATED" .PP \fBXmParseMapping\fP(3), \fBXmParseMappingFree\fP(3), \fBXmParseMappingGetValues\fP(3), \fBXmParseMappingSetValues\fP(3), \fBXmParseTable\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmImGetXIM.30000644000175000017500000000416712672140200013717 00000000000000'\" t ...\" ImGetXIM.sgm /main/8 1996/09/08 20:47:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImGetXIM" "library call" .SH "NAME" \fBXmImGetXIM\fP \(em An input manager function that retrieves the input method associated with a specified widget .iX "XmImGetXIM" .iX "input manager functions" "XmImGetXIM" .SH "SYNOPSIS" .PP .nf #include \fBXIM \fBXmImGetXIM\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImGetXIM\fP retrieves the XIM data structure representing the input method that the input manager has opened for the specified widget\&. If an input method has not been opened by a previous call to \fBXmImRegister\fP, the first time this routine is called it opens an input method using the \fBXmNinputMethod\fP resource for the VendorShell\&. If the \fBXmNinputMethod\fP is NULL, an input method is opened using the current locale\&. If it cannot open an input method, the function returns NULL\&. .IP "\fIwidget\fP" 10 Specifies the ID of a widget registered with the input manager .SH "RETURN" .PP Returns the input method for the current locale associated with the specified widget\&'s input manager; otherwise, returns NULL\&. The application is responsible for freeing the returned XIM by calling \fBXmImCloseXIM\fP\&. .SH "RELATED" .PP \fBXmImCloseXIM\fP(3), \fBXmImGetXIM\fP(3), \fBXmImMbLookupString\fP(3), and \fBXmImRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmCreateScrolledText.30000644000175000017500000000740112672140200016066 00000000000000'\" t ...\" CreScE.sgm /main/8 1996/09/08 20:35:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateScrolledText" "library call" .SH "NAME" \fBXmCreateScrolledText\fP \(em The Text ScrolledText convenience creation function .iX "XmCreateScrolledText" .iX "creation functions" "XmCreateScrolledText" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateScrolledText\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateScrolledText\fP creates an instance of a Text widget that is contained within a ScrolledWindow\&. The ScrolledWindow parent is created managed\&. All ScrolledWindow subarea widgets are automatically created by this function\&. The ID returned by this function is that of the Text widget (not the ScrolledWindow widget)\&. Use this widget ID for all operations on the Text widget\&. Use the widget ID of the Text widget\&'s parent for all operations on the ScrolledWindow\&. To obtain the ID of the ScrolledWindow widget associated with the Text widget, use the Xt Intrinsics \fBXtParent\fP function\&. The name of the ScrolledWindow created by this function is formed by concatenating the letters \fBSW\fP onto the end of the \fIname\fP specified in the parameter list\&. .PP The Text widget defaults to single-line text edit; therefore, no ScrollBars are displayed\&. The Text resource \fBXmNeditMode\fP must be set to \fBXmMULTI_LINE_EDIT\fP to display the ScrollBars\&. The results of placing a Text widget inside a ScrolledWindow when the Text\&'s \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP are undefined\&. .PP All arguments to either the Text or the ScrolledWindow widget can be specified at creation time with this function\&. Changes to initial position and size are sent only to the ScrolledWindow widget\&. Other resources are sent to the Text or the ScrolledWindow widget as appropriate\&. Note that the result of providing the \fBXmNdestroyCallback\fP resource in the creation \fIarglist\fP is unspecified\&. The application should use the \fBXtAddCallback\fP function to add callbacks to the appropriate widget (Text or ScrolledWindow) after creating it\&. .PP This function forces the following initial values for ScrolledWindow resources: .IP " \(bu" 6 \fBXmNscrollingPolicy\fP is set to \fBXmAPPLICATION_DEFINED\fP\&. .IP " \(bu" 6 \fBXmNvisualPolicy\fP is set to \fBXmVARIABLE\fP\&. .IP " \(bu" 6 \fBXmNscrollBarDisplayPolicy\fP is set to \fBXmSTATIC\fP\&. .IP " \(bu" 6 \fBXmNshadowThickness\fP is set to 0 (zero)\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns the Text widget ID\&. .SH "RELATED" .PP \fBXmScrolledWindow\fP(3) and \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmVaCreateButtonBox.30000644000175000017500000000266712672140200015676 00000000000000.DT .TH "XmVaCreateButtonBox" "library call" .SH "NAME" \fBXmVaCreateButtonBox\fP, \fBXmVaCreateManagedButtonBox\fP \(em A ButtonBox widget convenience creation functions\&. .iX "XmVaCreateButtonBox" "XmVaCreateManagedButtonBox" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateButtonBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedButtonBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ButtonBox widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateButtonBox\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedButtonBox\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ButtonBox and its associated resources, see \fBXmButtonBox\fP(3)\&. .SH "RETURN" .PP Returns the ButtonBox widget ID\&. .SH "RELATED" .PP \fBXmButtonBox\fP(3), \fBXmCreateButtonBox\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedCascadeButtonGadget.30000644000175000017500000000005112672140200021043 00000000000000.so man3/XmVaCreateCascadeButtonGadget.3 motif-2.3.8/doc/man/man3/XmAddProtocols.30000644000175000017500000000414412672140200014724 00000000000000'\" t ...\" AddProtB.sgm /main/8 1996/09/25 10:11:10 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmAddProtocols" "library call" .SH "NAME" \fBXmAddProtocols\fP \(em A VendorShell function that adds the protocols to the protocol manager and allocates the internal tables .iX "XmAddProtocols" .iX "VendorShell functions" "XmAddProtocols" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmAddProtocols\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBproperty\fR\fR, \fBAtom *\fBprotocols\fR\fR, \fBCardinal \fBnum_protocols\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmAddProtocols\fP adds the protocols to the protocol manager and allocates the internal tables\&. .PP \fBXmAddWMProtocols\fP is a convenience interface\&. It calls \fBXmAddProtocols\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIproperty\fP" 10 Specifies the protocol property .IP "\fIprotocols\fP" 10 Specifies the protocol \fBAtoms\fP .IP "\fInum_protocols\fP" 10 Specifies the number of elements in \fIprotocols\fP .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddWMProtocols\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveProtocols\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmCreateSeparator.30000644000175000017500000000350112672140200015407 00000000000000'\" t ...\" CreSeC.sgm /main/7 1996/08/30 14:53:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSeparator" "library call" .SH "NAME" \fBXmCreateSeparator\fP \(em The Separator widget creation function .iX "XmCreateSeparator" .iX "creation functions" "XmCreateSeparator" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSeparator\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSeparator\fP creates an instance of a Separator widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Separator and its associated resources, see \fBXmSeparator\fP(3)\&. .SH "RETURN" .PP Returns the Separator widget ID\&. .SH "RELATED" .PP \fBXmSeparator\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmBulletinBoard.30000644000175000017500000004720012672140200015055 00000000000000'\" t ...\" BulletB.sgm /main/11 1996/09/08 20:25:26 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmBulletinBoard" "library call" .SH "NAME" \fBXmBulletinBoard\fP \(em The BulletinBoard widget class .iX "XmBulletinBoard" .iX "widget class" "BulletinBoard" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP BulletinBoard is a composite widget that provides simple geometry management for child widgets\&. It does not force positioning on its children, but can be set to reject geometry requests that result in overlapping children\&. BulletinBoard is the base widget for most dialog widgets and is also used as a general container widget\&. .PP Modal and modeless dialogs are implemented as collections of widgets that include a DialogShell, a BulletinBoard (or subclass) child of the shell, and various dialog components (buttons, labels, and so on) that are children of BulletinBoard\&. BulletinBoard defines callbacks useful for dialogs (focus, map, unmap), which are available for application use\&. If its parent is a DialogShell, BulletinBoard passes title and input mode (based on dialog style) information to the parent, which is responsible for appropriate communication with the window manager\&. .PP The default value for \fBXmNinitialFocus\fP is the value of \fBXmNdefaultButton\fP\&. .PP BulletinBoard uses the \fBXmQTtakesDefault\fP trait, and holds the \fBXmQTdialogShellSavvy\fP and \fBXmQTspecifyRenderTable\fP traits\&. .SS "Classes" .PP BulletinBoard inherits behavior, resources, and traits from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmBulletinBoardWidgetClass\fP\&. .PP The class name is \fBXmBulletinBoard\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmBulletinBoard Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowOverlapXmCAllowOverlapBooleanTrueCSG _____ XmNautoUnmanageXmCAutoUnmanageBooleanTrueCG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNcancelButtonXmCWidgetWidgetNULLSG _____ XmNdefaultButtonXmCWidgetWidgetNULLSG _____ XmNdefaultPositionXmCDefaultPositionBooleanTrueCSG _____ XmNdialogStyleXmCDialogStyleunsigned chardynamicCSG _____ XmNdialogTitleXmCDialogTitleXmStringNULLCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTableXmRenderTabledynamicCSG _____ XmNmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension10CSG _____ XmNmarginWidthXmCMarginWidthDimension10CSG _____ XmNnoResizeXmCNoResizeBooleanFalseCSG _____ XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_ANYCSG _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_OUTCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNtextTranslationsXmCTranslationsXtTranslationsNULLC _____ XmNunmapCallbackXmCCallbackXtCallbackListNULLC _____ .TE .IP "\fBXmNallowOverlap\fP" 10 Controls the policy for overlapping child widgets\&. If this resource is True, BulletinBoard allows geometry requests that result in overlapping children\&. .IP "\fBXmNautoUnmanage\fP" 10 Controls whether or not BulletinBoard is automatically unmanaged after a button is activated\&. If this resource is True on initialization and if the BulletinBoard\&'s parent is a DialogShell, BulletinBoard adds a callback to button children (PushButtons, PushButtonGadgets, and DrawnButtons) that unmanages the BulletinBoard when a button is activated\&. If this resource is False on initialization or if the BulletinBoard\&'s parent is not a DialogShell, the BulletinBoard is not automatically unmanaged\&. For BulletinBoard subclasses with Apply or Help buttons, activating those buttons does not automatically unmanage the BulletinBoard\&. .IP "\fBXmNbuttonFontList\fP" 10 Specifies the font list used for button descendants\&. See the \fBXmNbuttonRenderTable\fP resource\&. .IP "\fBXmNbuttonRenderTable\fP" 10 Specifies the render table used for BulletinBoard\&'s button descendants\&. If this value is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the render table is initialized to the \fBXmBUTTON_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNcancelButton\fP" 10 Specifies the widget ID of the \fBCancel\fP button\&. BulletinBoard\&'s subclasses, which define a \fBCancel\fP button, set this resource\&. BulletinBoard does not directly provide any behavior for that button\&. .IP "\fBXmNdefaultButton\fP" 10 Specifies the widget ID of the default button\&. Some BulletinBoard subclasses, which define a default button, set this resource\&. BulletinBoard defines translations and installs accelerators that activate that button when \fBKActivate\fP is pressed and the keyboard focus is not in another button\&. .IP "\fBXmNdefaultPosition\fP" 10 Controls the positioning of a DialogShell managing a BulletinBoard\&. If the BulletinBoard is not being managed by a DialogShell, then this resource has no effect\&. If \fBXmNdefaultPosition\fP is True, the DialogShell will center itself at the center of its own parent\&. For example, if the parent of the DialogShell is an ApplicationShell, then the center of the DialogShell will be at the same coordinates as the center of the ApplicationShell\&. If the DialogShell becomes unmapped (but stays managed) and then remapped, this resource has no influence on the DialogShell\&'s position\&. If this resource is False, the DialogShell does not automatically center itself\&. .IP "\fBXmNdialogStyle\fP" 10 Indicates the dialog style associated with the BulletinBoard\&. If the parent of the BulletinBoard is a DialogShell, the parent\&'s \fBXmNmwmInputMode\fP is set according to the value of this resource\&. This resource can be set only if the BulletinBoard is unmanaged\&. Possible values for this resource include the following: .RS .IP "\fBXmDIALOG_SYSTEM_MODAL\fP" 10 Used for dialogs that must be responded to before any other interaction in any application\&. .IP "\fBXmDIALOG_PRIMARY_APPLICATION_MODAL\fP" 10 Used for dialogs that must be responded to before some other interactions in ancestors of the widget\&. .IP "\fBXmDIALOG_APPLICATION_MODAL\fP" 10 Used for dialogs that must be responded to before some other interactions in ancestors of the widget\&. This value is the same as \fBXmDIALOG_PRIMARY_APPLICATION_MODAL\fP, and remains for compatibility\&. .IP "\fBXmDIALOG_FULL_APPLICATION_MODAL\fP" 10 Used for dialogs that must be responded to before some other interactions in the same application\&. .IP "\fBXmDIALOG_MODELESS\fP" 10 Used for dialogs that do not interrupt interaction of any application\&. This is the default when the parent of the BulletinBoard is a DialogShell\&. .IP "\fBXmDIALOG_WORK_AREA\fP" 10 Used for BulletinBoard widgets whose parents are not DialogShells\&. \fBXmNdialogStyle\fP is forced to have this value when the parent of the BulletinBoard is not a DialogShell\&. .RE .IP "" 10 Posting a modal dialog in response to a button down or key down event (via translation actions or callbacks) can cause the corresponding button up or key up event to be lost\&. For example, posting a modal dialog from an \fBXmNincrementCallback\fP of \fBXmScrollBar\fP will cause the loss of the button up event, causing the \fBXmScrollBar\fP to auto-increment indefinitely\&. .IP "\fBXmNdialogTitle\fP" 10 Specifies the dialog title\&. If this resource is not NULL, and the parent of the BulletinBoard is a subclass of WMShell, BulletinBoard sets the \fBXmNtitle\fP and \fBXmNtitleEncoding\fP of its parent\&. If the only character set in \fBXmNdialogTitle\fP is ISO8859-1, \fBXmNtitle\fP is set to the string of the title, and \fBXmNtitleEncoding\fP is set to \fBSTRING\fP\&. If \fBXmNdialogTitle\fP contains character sets other than ISO8859-1, \fBXmNtitle\fP is set to the string of the title converted to a compound text string, and \fBXmNtitleEncoding\fP is set to \fBCOMPOUND_TEXT\fP\&. The direction of the title is based on the \fBXmNlayoutDirection\fP resource of the widget\&. .IP "\fBXmNfocusCallback\fP" 10 Specifies the list of callbacks that is called when the BulletinBoard widget or one of its descendants accepts the input focus\&. The callback reason is \fBXmCR_FOCUS\fP\&. .IP "\fBXmNlabelFontList\fP" 10 Specifies the font list used for label descendants\&. See the \fBXmNlabelRenderTable\fP resource\&. .IP "\fBXmNlabelRenderTable\fP" 10 Specifies the render table used for BulletinBoard\&'s label descendants\&. If this value is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the render table is initialized to the \fBXmLABEL_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNmapCallback\fP" 10 Specifies the list of callbacks that is called only when the parent of the BulletinBoard is a DialogShell\&. In this case, this callback list is invoked when the BulletinBoard widget is mapped\&. The callback reason is \fBXmCR_MAP\fP\&. DialogShells are usually mapped when the DialogShell is managed\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the minimum spacing in pixels between the top or bottom edge of BulletinBoard and any child widget\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the minimum spacing in pixels between the left or right edge of BulletinBoard and any child widget\&. .IP "\fBXmNnoResize\fP" 10 Controls whether or not resize controls are included in the window manager frame around the BulletinBoard\&'s parent\&. If this resource is set to True, \fBmwm\fP does not include resize controls in the window manager frame containing the parent of the BulletinBoard if the parent is a subclass of VendorShell\&. If this resource is set to False, the window manager frame does include resize controls\&. Other controls provided by \fBmwm\fP can be included or excluded through the \fBmwm\fP resources provided by VendorShell\&. .IP "\fBXmNresizePolicy\fP" 10 Controls the policy for resizing BulletinBoard widgets\&. Possible values include .RS .IP "\fBXmRESIZE_NONE\fP" 10 Fixed size .IP "\fBXmRESIZE_ANY\fP" 10 Shrink or grow as needed .IP "\fBXmRESIZE_GROW\fP" 10 Grow only .RE .IP "\fBXmNshadowType\fP" 10 Describes the shadow drawing style for BulletinBoard\&. This resource can have the following values: .RS .IP "\fBXmSHADOW_IN\fP" 10 Draws the BulletinBoard shadow so that it appears inset\&. This means that the bottom shadow visuals and top shadow visuals are reversed\&. .IP "\fBXmSHADOW_OUT\fP" 10 Draws the BulletinBoard shadow so that it appears outset\&. .IP "\fBXmSHADOW_ETCHED_IN\fP" 10 Draws the BulletinBoard shadow using a double line giving the effect of a line etched into the window, similar to the Separator widget\&. .IP "\fBXmSHADOW_ETCHED_OUT\fP" 10 Draws the BulletinBoard shadow using a double line giving the effect of a line coming out of the window, similar to the Separator widget\&. .RE .IP "\fBXmNtextFontList\fP" 10 Specifies the font list used for text descendants\&. See the \fBXmNtextRenderTable\fP resource\&. .IP "\fBXmNtextRenderTable\fP" 10 Specifies the render table used for BulletinBoard\&'s text descendants\&. If this value is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the render table is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNtextTranslations\fP" 10 It adds translations to any Text widget or Text widget subclass that is added as a child of BulletinBoard\&. .IP "\fBXmNunmapCallback\fP" 10 Specifies the list of callbacks that is called only when the parent of the BulletinBoard is a DialogShell\&. In this case, this callback list is invoked when the BulletinBoard widget is unmapped\&. The callback reason is \fBXmCR_UNMAP\fP\&. DialogShells are usually unmapped when the DialogShell is unmanaged\&. .SS "Inherited Resources" .PP BulletinBoard inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .SS "Translations" .PP \fBXmBulletinBoard\fP includes the translations from \fBXmManager\fP\&. .SS "Additional Behavior" .PP The \fBXmBulletinBoard\fP widget has the following additional behavior: .IP "\fB\fP\fB\fP:" 10 Calls the activate callbacks for the cancel button if it is sensitive\&. If no cancel button exists and if the parent of the BulletinBoard is a manager, passes the event to the parent\&. .IP "\fB\fP\fB\fP:" 10 Calls the activate callbacks for the button with the keyboard focus\&. If no button has the keyboard focus, calls the activate callbacks for the default button if it is sensitive\&. In a List widget or single-line Text widget, the List or Text action associated with \fB\fP\fB\fP is called before the BulletinBoard actions associated with \fB\fP\fB\fP\&. .IP "" 10 In a multiline Text widget, any \fB\fP\fB\fP event except \fB\fP\fB\fP calls the Text action associated with \fB\fP\fB\fP, then the BulletinBoard actions associated with \fB\fP\fB\fP\&. If no button has the focus, no default button exists, and the parent of the BulletinBoard is a manager, passes the event to the parent\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNfocusCallback\fP\&. When the focus policy is \fBXmPOINTER\fP, the callbacks are called when the pointer enters the window\&. When the focus policy is \fBXmEXPLICIT\fP, the callbacks are called when the user traverses to the widget\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNmapCallback\fP\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNunmapCallback\fP\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateBulletinBoard\fP(3), \fBXmCreateBulletinBoardDialog\fP(3), \fBXmDialogShell\fP(3), \fBXmManager\fP(3), \fBXmVaCreateBulletinBoard\fP(3), and \fBXmVaCreateManagedBulletinBoard\fP(3)\&. motif-2.3.8/doc/man/man3/XmImSetXIC.30000644000175000017500000000406512672140200013716 00000000000000'\" t ...\" ImSetXIC.sgm /main/8 1996/09/08 20:48:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImSetXIC" "library call" .SH "NAME" \fBXmImSetXIC\fP \(em An input manager function that registers an existing XIC with a widget .iX "XmImSetXIC" .iX "input manager functions" "XmImSetXIC" .SH "SYNOPSIS" .PP .nf #include \fBXIC \fBXmImSetXIC\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXIC \fBxic\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImSetXIC\fP registers the specified X Input Context (XIC) with \fIwidget\fP\&. Any existing XIC registered for \fIwidget\fP is unregistered\&. The new XIC registered for \fIwidget\fP is returned\&. .PP If \fIxic\fP was not created by \fBXmImGetXIC\fP or \fBXmImRegister\fP, it will not be subject to closing activities when it has no widgets registered with it\&. .IP "\fIwidget\fP" 10 Specifies the ID of a widget for which a new Input Context is to be registered\&. .IP "\fIxic\fP" 10 Specifies the Input Context to be registered with the widget\&. If \fIxic\fP is NULL, the function returns the current \fBXIC\fP used by \fIwidget\fP\&. .SH "RETURN" .PP Returns the new XIC registered for \fIwidget\fP\&. The application is responsible for freeing the returned XIC\&. To free the XIC, call \fBXmImFreeXIC\fP\&. .SH "RELATED" .PP \fBXmImGetXIC\fP(3) and \fBXmImFreeXIC\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmContainerRelayout.30000644000175000017500000000303412672140200015773 00000000000000'\" t ...\" ContainH.sgm /main/7 1996/08/30 14:25:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerRelayout" "library call" .SH "NAME" \fBXmContainerRelayout\fP \(em Container widget relayout function .iX "XmContainerRelayout" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmContainerRelayout\fP\fR( \fBWidget \fBcontainer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerRelayout\fP forces a layout of all items in the Container using the \fBXmNpositionIndex\fP and \fBXmNentryParent\fP constraint resources associated with each item\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmTransferStartRequest.30000644000175000017500000000362012672140200016500 00000000000000'\" t ...\" TransfD.sgm /main/9 1996/09/08 21:11:30 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTransferStartRequest" "library call" .SH "NAME" \fBXmTransferStartRequest\fP \(em A toolkit function that begins a MULTIPLE transfer .iX "XmTransferStartRequest" .iX "toolkit functions" "XmTransferStartRequest" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBXmTransferStartRequest\fP\fR( \fBXtPointer \fBtransfer_id\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTransferStartRequest\fP begins a \fBMULTIPLE\fP request\&. The \fBMULTIPLE\fP request may contain one or more calls to \fBXmTransferValue\fP\&. Your application concludes a \fBMULTIPLE\fP request by calling \fBXmTransferSendRequest\fP\&. .PP \fBXmTransferStartRequest\fP is typically called by a destination callback or by a transfer procedure\&. .IP "\fBtransfer_id\fP" 10 Specifies a unique indentifier for the data transfer operation\&. You should use the \fBtransfer_id\fP passed in the \fBXmDestinationCallbackStruct\fR or \fBXmSelectionCallbackStruct\fR\&. .SH "RELATED" .PP \fBXmTransferSetParameters\fP(3), \fBXmTransferSendRequest\fP(3), and \fBXmTransferValue\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmSpinBox.30000644000175000017500000011244712672140200013717 00000000000000'\" t ...\" SpinBox.sgm /main/15 1996/09/08 21:02:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSpinBox" "library call" .SH "NAME" \fBXmSpinBox\fP \(em The SpinBox widget class .iX "XmSpinBox" .iX "widget class" "SpinBox" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP SpinBox allows the user to select a value from a ring of related but mutually exclusive choices which are displayed in sequence\&. The SpinBox always has an increment arrow, a decrement arrow, and one or more other children\&. The choices are displayed, one at a time, in a traversable text child ( \fBXmText\fP or \fBXmTextField\fP\&. The user clicks \fB\fP on an arrow to display the next (or previous) item in the ring of choices\&. By pressing and holding \fB\fP on an arrow, the user continuously cycles through the choices\&. .PP The traversable children in a SpinBox can be of type \fBXmNUMERIC\fP or \fBXmSTRING\fP, as defined by the \fBXmNspinBoxChildType\fP constraint resource\&. The ring of choices for numeric children is defined by minimum, maximum, incremental, and decimal point values\&. The ring of choices for string children is defined in an array of compound strings\&. .PP The application programmer can include multiple traversable children in the SpinBox\&. For example, a SpinBox might consist of a pair of arrows and month, day, and year text fields\&. The arrows only spin the child that currently has focus\&. .PP Arrow size is specified by the SpinBox resource \fBXmNarrowSize\fP\&. This value sets both width and height of each arrow in pixels\&. .PP The programmer can display SpinBox arrows in one of several layouts, as specified by the \fBXmNarrowLayout\fP resource: .IP "\fBXmARROWS_BEGINNING\fP" 10 Places a pair of left and right arrows before the children\&. .IP "\fBXmARROWS_END\fP" 10 Places a pair of left and right arrows after the children\&. .IP "\fBXmARROWS_SPLIT\fP" 10 Places one arrow on each side of the children\&. .IP "\fBXmARROWS_FLAT_BEGINNING\fP" 10 Places a pair of arrows side by side before the \fBXmSpinBox\fP children\&. .IP "\fBXmARROWS_FLAT_BEGINNING\fP" 10 Places a pair of arrows side by side after the \fBXmSpinBox\fP children\&. .PP Positions for \fBXmARROWS_BEGINNING\fP and \fBXmARROWS_END\fP are dependent on the \fBVendorShell\fP resource \fBXmNlayoutDirection\fP\&. When layout direction is left-to-right, beginning arrows are positioned to the left of the children\&. When layout direction is right-to-left, beginning arrows are positioned to the right\&. .PP The actions of the arrows are determined by the \fBVendorShell\fP resource \fBXmNlayoutDirection\fP\&. For left-to-right layouts, the right arrow is the increment arrow and the left arrow is the decrement arrow\&. For right-to-left layouts, the right arrow is the decrement arrow and the left arrow is the increment arrow\&. .PP For a numeric type child, the increment arrow increases the displayed value by the incremental value up to the maximum\&. The decrement arrow decreases the displayed value by the given incremental value down to the minimum\&. .PP The increment arrow for a string type child moves toward the last entry of the array of compound strings (by increasing the SpinBox constraint resource \fBXmNposition\fP)\&. The decrement arrow moves toward the first entry of the compound string array\&. .PP The programmer can also control the sensitivity of each arrow in the SpinBox\&. Sensitive arrows spin choices; insensitive arrows do not spin choices\&. Arrow sensitivity is set for the SpinBox widget by using the \fBXmNdefaultArrowSensitivity\fP resource, but it can be modified on a per child basis by using the \fBXmNarrowSensitivity\fP constraint resource\&. .PP SpinBox provides two callbacks to application programmers\&. (In addition, the callbacks of the SpinBox\&'s children may be invoked\&.) Each of these callbacks receives a pointer to \fBXmSpinBoxCallbackStruct\fR\&. The \fBXmNmodifyVerifyCallback\fP procedures are called \fIbefore\fP a new choice is displayed\&. The \fBXmNvalueChangedCallback\fP procedures are called \fIafter\fP a new choice is displayed\&. .PP \fBXmNmodifyVerifyCallback\fP tells the application what the new position will be in the ring of choices\&. This callback can be used to make the SpinBox stop at the upper and lower limits or go to a different, nonconsecutive choice\&. The application allows the change in position by leaving the \fIdoit\fP member set to True\&. The application can spin to a position other than the next consecutive position by leaving \fIdoit\fP set to True and by changing the \fIposition\fP member to the desired position\&. When \fIdoit\fP is set to False by an application, there is no change in the choice displayed\&. .PP After a new choice is displayed, the \fBXmNvalueChangedCallback\fP procedure is called\&. The application can use this procedure to perform tasks when specific values are reached or when boundaries are crossed\&. For example, if the user spins from January back to December, the application could change to the previous year\&. If the user spins from December to January, the application could change to the next year\&. .PP SpinBox dimensions can be set using the Core resources \fBXmNheight\fP and \fBXmNwidth\fP\&. If dimensions are not specified, the SpinBox size is determined by the sizes of its arrows and children\&. The SpinBox will attempt to grow so that the arrows and all children are visible\&. .PP SpinBox uses the \fBXmQTaccessTextual\fP trait and holds the \fBXmQTnavigator\fP trait\&. .SS "Classes" .PP SpinBox inherits behavior, resources, and traits from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmSpinBoxWidgetClass\fP\&. .PP The class name is \fBXmSpinBox\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate whether the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .TS tab(); lw(1.35in) lw(1.48in) lw(1.18in) lw(1.39in) lw(1.00in). \fBXmSpinBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNarrowLayoutXmCArrowLayoutunsigned charXmARROWS_BEGINNINGCSG XmNarrowOrientationXmCArrowOrientationunsigned charXmARROWS_VERTICALCSG XmNarrowSizeXmCArrowSizeDimension16CSG XmNdefaultArrowSensitivityXmCDefaultArrowSensitivityunsigned charXmARROWS_SENSITIVECSG XmNdetailShadowThicknessXmCDetailShadowThicknessDimension2CSG XmNinitialDelayXmCInitialDelayunsigned int250 msCSG XmNmarginHeightXmCMarginHeightDimensiondynamicCSG XmNmarginWidthXmCMarginWidthDimensiondynamicCSG XmNmodifyVerifyCallbackXmCCallbackXtCallbackListNULLC XmNrepeatDelayXmCRepeatDelayunsigned int200 msCSG XmNspacingXmCSpacingDimensiondynamicCSG XmNvalueChangedCallbackXmCCallbackXtCallbackListNULLC .TE .IP "\fBXmNarrowLayout\fP" 10 Specifies placement of the two arrows in the widget\&. Possible layouts are as follows: .RS .IP "\fBXmARROWS_BEGINNING\fP" 10 Places left and right arrows beside each other, before the child(ren)\&. Positioning for this layout is dependent on the VendorShell resource \fBXmNlayoutDirection\&.\fP .IP "\fBXmARROWS_END\fP" 10 Places left and right arrows beside each other, after the child(ren)\&. Positioning for this layout is dependent on the VendorShell resource \fBXmNlayoutDirection\fP\&. .IP "\fBXmARROWS_FLAT_BEGINNING\fP" 10 Places a pair of arrows side by side before the \fBXmSpinBox\fP children\&. Positioning for this layout is dependent on the VendorShell resource \fBXmNlayoutDirection\&.\fP .IP "\fBXmARROWS_FLAT_END\fP" 10 Places a pair of arrows side by side after the \fBXmSpinBox\fP children\&. Positioning for this layout is dependent on the VendorShell resource \fBXmNlayoutDirection\&.\fP .IP "\fBXmARROWS_SPLIT\fP" 10 Places a left arrow on the left side and a right arrow on the right side of the child(ren)\&. .RE .IP "\fBXmNarrowSize\fP" 10 Specifies both the width and height of the arrow in pixels\&. .IP "\fBXmNdefaultArrowSensitivity\fP" 10 Specifies the default sensitivity of the arrows in the widget\&. Insensitive arrows change color, cannot be depressed, and perform no action\&. (This resource may be overridden by the constraint resource \fBXmNarrowSensitivity\fP for individual traversable text children of the SpinBox\&.) Possible default sensitivity values are as follows: .RS .IP "\fBXmARROWS_SENSITIVE\fP" 10 Both arrows are sensitive\&. .IP "\fBXmARROWS_DECREMENT_SENSITIVE\fP" 10 Only the decrement arrow (as determined by \fBXmNlayoutDirection\fP) is sensitive\&. The increment arrow is insensitive\&. .IP "\fBXmARROWS_INCREMENT_SENSITIVE\fP" 10 Only the increment arrow (as determined by \fBXmNlayoutDirection\fP) is sensitive\&. The decrement arrow is insensitive\&. .IP "\fBXmARROWS_INSENSITIVE\fP" 10 Both arrows are insensitive\&. .RE .IP "\fBXmNdetailShadowThickness\fP" 10 Specifies the thickness of the inside arrow shadows\&. The default thickness is 2 pixels\&. .IP "\fBXmNinitialDelay\fP" 10 Specifies how long, in milliseconds, the mouse button must be held down before automatic spinning begins\&. In other words, when the user selects the increment or decrement arrow and keeps it depressed, this delay occurs before the choices start spinning\&. If \fBXmNinitialDelay\fP is 0, then \fBXmNrepeatDelay\fP is used as the initial delay\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the amount of blank space between the top edge of the SpinBox widget and the first item in each column, and the bottom edge of the SpinBox widget and the last item in each column\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the amount of blank space between the left edge of the SpinBox widget and the first item in each row, and the right edge of the SpinBox widget and the last item in each row\&. .IP "\fBXmNmodifyVerifyCallback\fP" 10 This callback is called before the SpinBox position changes (see the Constraint resource \fBXmNposition\fP)\&. The application can use this callback to set the next position, change SpinBox resources, or cancel the impending action\&. For example, this callback can be used to stop the spinning just before wrapping at the upper and lower position boundaries\&. If the \fIdoit\fP member is set to False, nothing happens\&. Otherwise the position changes\&. Reasons sent by the callback are \fBXmCR_SPIN_NEXT\fP, \fBXmCR_SPIN_PRIOR\fP, \fBXmCR_SPIN_FIRST\fP, or \fBXmCR_SPIN_LAST\fP\&. .IP "\fBXmNrepeatDelay\fP" 10 When the user selects and keeps an arrow button depressed by pressing and holding \fB\fP, spinning begins\&. After the time specified in \fBXmNinitialDelay\fP elapses, the SpinBox position changes automatically until the arrow button is released\&. The \fBXmNrepeatDelay\fP resource specifies the delay in milliseconds between each automatic change\&. If \fBXmNrepeatDelay\fP is set to 0 (zero), automatic spinning is turned off and \fBXmNinitialDelay\fP is ignored\&. .IP "\fBXmNspacing\fP" 10 Specifies the horizontal and vertical spacing between items contained within the SpinBox widget\&. .IP "\fBXmNvalueChangedCallback\fP" 10 This is called \fIn\fP+1 times for \fIn\fP SpinBox position changes (see the Constraint resource \fBXmNposition\fP)\&. Reasons sent by the callback are \fBXmCR_OK\fP, \fBXmCR_SPIN_NEXT\fP, \fBXmCR_SPIN_PRIOR\fP, \fBXmCR_SPIN_FIRST\fP, or \fBXmCR_SPIN_LAST\fP\&. Other members are detailed in the callback structure description\&. .TS tab(); lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in). \fBXmSpinBox Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNarrowSensitivityXmCArrowSensitivityunsigned charXmARROWS_DEFAULT_SENSITIVITYCSG XmNdecimalPointsXmCDecimalPointsshort0CSG XmNincrementValueXmCIncrementValueint1CSG XmNmaximumValueXmCMaximumValueint10CSG XmNminimumValueXmCMinimumValueint0CSG XmNnumValuesXmCNumValuesint0CSG XmNpositionXmCPositionint0CSG XmNpositionTypeXmCPositionTypecharXmPOSITION_VALUECG XmNspinBoxChildTypeXmSpinBoxChildTypeunsigned charXmSTRINGCG XmNvaluesXmCValuesXmStringTableNULLCSG .TE .IP "\fBXmNarrowSensitivity\fP" 10 Specifies the sensitivity of the arrows for a SpinBox child\&. By using this resource in the definition of a SpinBox child, the application programmer can override the default SpinBox sensitivity (set by \fBXmNdefaultArrowSensitivity\fP) for a particular child\&. This allows each traversable child to have a different arrow sensitivity\&. The arrow sensitivity values are as follows: .RS .IP "\fBXmARROWS_SENSITIVE\fP" 10 Both arrows are sensitive\&. .IP "\fBXmARROWS_DECREMENT_SENSITIVE\fP" 10 Only the decrement arrow (as determined by \fBXmNlayoutDirection\fP) is sensitive\&. .IP "\fBXmARROWS_INCREMENT_SENSITIVE\fP" 10 Only the increment arrow (as determined by \fBXmNlayoutDirection\fP) is sensitive\&. .IP "\fBXmARROWS_INSENSITIVE\fP" 10 Both arrows are insensitive\&. .IP "\fBXmARROWS_DEFAULT_SENSITIVITY\fP" 10 Use the sensitivity specified in the \fBXmNdefaultArrowSensitivity\fP resource\&. .RE .IP "\fBXmNdecimalPoints\fP" 10 Specifies the number of decimal places used when displaying the value of a SpinBox numeric type child\&. If the number of decimal places specified is greater than the number of digits in a displayed value, the value is padded with 0 (zeros)\&. For example, when \fBXmNinitialValue\fP is 1 and \fBXmNmaximumValue\fP is 1000 and \fBXmNdecimalPoints\fP is 3, the range of values displayed in the SpinBox is 0\&.001 to 1\&.000\&. This is used only when \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. .IP "\fBXmNincrementValue\fP" 10 Specifies the amount by which to increment or decrement a SpinBox numeric type child\&. This is used only when \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. .IP "\fBXmNmaximumValue\fP" 10 Specifies the highest possible value for a numeric SpinBox\&. This is used only when \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. .IP "\fBXmNminimumValue\fP" 10 Specifies the lowest possible value for a numeric SpinBox\&. This is used only when \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. .IP "\fBXmNnumValues\fP" 10 Specifies the number of strings in \fBXmNvalues\fP\&. The application must change this value when strings are added or removed from \fBXmNvalues\fP\&. This is used only when \fBXmNspinBoxChildType\fP is \fBXmSTRING\fP\&. .IP "\fBXmNposition\fP" 10 Specifies the position of the currently displayed item\&. The interpritation of \fBXmNposition\fP is dependent upon the value of the \fBXmNpositionType\fP resource\&. .IP "" 10 When \fBXmNpositionType\fP is \fBXmPOSITION_INDEX\fP the \fBXmNposition\fP value is interpreted as follows: For \fBXmSpinBox\fP children of type \fBXmNUMERIC\fP, the \fBXmNposition\fP resource is interpreted as an index into an array of items\&. The minimum allowable value for \fBXmNposition\fP is 0\&. The maximum allowable value for \fBXmNposition\fP is \fB(XmNmaximumValue-XmNminimumValue)/XmNincrementValue\fP\&. The value display by the \fBXmSpinBox\fP child is \fBXmNminimumValue+(XmNposition*XmNincrementValue)\fP\&. For \fBXmSpinBox\fP children of type \fBXmSTRING\fP, the \fBXmNposition\fP resource is interpreted as an index into an array of \fBXmNnumValues\fP items\&. The minimum allowable value for \fBXmNposition\fP is 0\&. The maximum allowable value for \fBXmNposition\fP is \fBXmNnumValues - 1\fP\&. The value displayed by the \fBXmSpinBox\fP is the \fBXmNposition\fP\&'th value in the \fBXmNvalues\fP array\&. .IP "" 10 When \fBXmNpositionType\fP is \fBXmPOSITION_VALUE\fP the \fBXmNposition\fP value is interpreted as follows: .IP "" 10 For \fBXmSpinBox\fP children of type \fBXmNUMERIC\fP, the \fBXmNposition\fP resource is interpreted as the actual value to be displayed\&. The minimum allowable value for \fBXmNposition\fP is \fBXmNminimumValue\fP\&. The maximum allowable value for \fBXmNposition\fP is \fBXmNmaximumValue\fP\&. The value displayed by the \fBXmSpinBox\fP child is \fBXmNposition\fP\&. For \fBXmSpinBox\fP children of type \fBXmSTRING\fP, the interpretation is the same for \fBXmPOSITION_VALUE\fP as for \fBXmPOSITION_INDEX\fP\&. .IP "" 10 Position values falling outside the specified range are invalid\&. When an application assigns a value to \fBXmNposition\fP which is less than the minimum, \fBXmNposition\fP is set to the minimum and an error message is displayed\&. When an application assigns a value to \fBXmNposition\fP which is greater than the maximum, \fBXmNposition\fP is set to the maximum and an error message is displayed\&. .IP "\fBXmNpositionType\fP" 10 Specifies how values the \fBXmNposition\fP resource are to be interpreted\&. Valid values include \fBXmPOSITION_INDEX\fP and \fBXmPOSITION_VALUE\fP\&. .IP "\fBXmNspinBoxChildType\fP" 10 Specifies the type of data displayed in the child: .RS .IP "\fBXmNUMERIC\fP" 10 The SpinBox choice range is defined by numeric minimum, maximum, and incremental values\&. .IP "\fBXmSTRING\fP" 10 The SpinBox choices are alphanumeric\&. .RE .IP "\fBXmNvalues\fP" 10 Specifies the array of \fBXmString\fRs to be displayed in a SpinBox string type child\&. The application must change \fBXmNnumValues\fP when strings are added to or removed from \fBXmNvalues\fP\&. This is used only when \fBXmNspinBoxChildType\fP is \fBXmSTRING\fP\&. .SS "Inherited Resources" .PP SpinBox inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .TS tab(); lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in). \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG XmNforegroundXmCForegroundPixeldynamicCSG XmNhelpCallbackXmCCallbackXtCallbackListNULLC XmNhighlightColorXmCHighlightColorPixeldynamicCSG XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG XmNinitialFocusXmCInitialFocusWidgetdynamicCSG XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC XmNshadowThicknessXmCShadowThicknessDimension0CSG XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG XmNtraversalOnXmCTraversalOnBooleanTrueCSG XmNunitTypeXmCUnitTypeunsigned chardynamicCSG XmNuserDataXmCUserDataXtPointerNULLCSG .TE .TS tab(); lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in). \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNchildrenXmCReadOnlyWidgetListNULLG XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG XmNnumChildrenXmCReadOnlyCardinal0G .TE .TS tab(); lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in) lw(1.18in). \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG XmNancestorSensitiveXmCSensitiveBooleandynamicG XmNbackgroundXmCBackgroundPixeldynamicCSG XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG XmNborderWidthXmCBorderWidthDimension0CSG XmNcolormapXmCColormapColormapdynamicCG XmNdepthXmCDepthintdynamicCG XmNdestroyCallbackXmCCallbackXtCallbackListNULLC XmNheightXmCHeightDimensiondynamicCSG XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG XmNscreenXmCScreenScreen *dynamicCG XmNsensitiveXmCSensitiveBooleanTrueCSG XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG XmNwidthXmCWidthDimensiondynamicCSG XmNxXmCPositionPosition0CSG XmNyXmCPositionPosition0CSG .TE .SS "Callback" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Widget \fIwidget\fP; Boolean \fIdoit\fP; int \fIposition\fP; XmString \fIvalue\fP; Boolean \fIcrossed_boundary\fP; } XmSpinBoxCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. Reasons may be the following: .RS .IP "\fBXmCR_OK\fP" 10 Spinning has stopped because the SpinBox arrow has been disarmed\&. \fBXmCR_OK\fP is either the last or only call\&. .IP "\fBXmCR_SPIN_NEXT\fP" 10 The increment arrow has been armed and position is increasing\&. Further callbacks will come\&. For a numeric type child, the values displayed are approaching the maximum\&. For a string SpinBox, the values displayed are approaching the last entry in the array of \fBXmString\fR s\&. .IP "\fBXmCR_SPIN_PRIOR\fP" 10 The decrement arrow has been armed and position is decreasing\&. Further callbacks will come\&. For a numeric type child, the values displayed are approaching the minimum\&. For a string type child, the values displayed are approaching the first entry in the array of \fBXmString\fRs\&. .IP "\fBXmCR_SPIN_FIRST\fP" 10 The begin data (\fB\fP) key sequence has been pressed\&. The SpinBox is at its first position, displaying the lowest value or the first entry in the array of \fBXmString\fRs\&. .IP "\fBXmCR_SPIN_LAST\fP" 10 The end data (\fB\fP) key sequence has been pressed\&. The SpinBox is at its last position, displaying the highest value or the last entry in the array of \fBXmString\fRs\&. .RE .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered this callback\&. .IP "\fIwidget\fP" 10 Specifies the child widget affected by this callback\&. .IP "\fIdoit\fP" 10 When the callback is \fBXmNmodifyVerifyCallback\fP, \fIdoit\fP indicates whether or not an action will be performed before the SpinBox position changes\&. If the callback leaves \fIdoit\fP set to True (the default), the spinning action is performed\&. If the callback sets \fIdoit\fP to False, the spinning action is not performed\&. When the callback is \fBXmNvalueChangedCallback\fP, \fIdoit\fP is ignored\&. .IP "\fIposition\fP" 10 Specifies the next value of the SpinBox position (same as \fBXmNposition\fP)\&. This is an output field for the \fBXmNmodifyVerifyCallback\fP, which may change the next position as dictated by the needs of an application\&. .IP "\fIvalue\fP" 10 Specifies the new \fBXmString\fR value in the text child widget\&. The user program must copy this string if it is to be used outside the callback routine\&. .IP "\fIcrossed_boundary\fP" 10 Specifies whether or not the SpinBox has crossed the upper or lower boundary (the last or first compound string, or the maximum or minimum value)\&. The \fIcrossed_boundary\fP value is True if the SpinBox has just crossed a boundary, and False if it has not\&. .SS "Translations" .PP The \fBXmSpinBox\fP translations are as follows: .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 SpinBArm() .IP "\fB\fP:" 10 SpinBDisarm() .IP "\fB:\fP\fB\fP\fB\fP :" 10 SpinBPrior() .IP "\fB:\fP\fB\fP\fB\fP :" 10 SpinBNext() .IP "\fB:\fP\fB\fP\fB\fP :" 10 SpinBLeft() .IP "\fB:\fP\fB\fP\fB\fP :" 10 SpinBRight() .IP "\fB:\fP\fB\fP\fB\fP :" 10 SpinBFirst() .IP "\fB:\fP\fB\fP\fB\fP :" 10 SpinBLast() .SS "Accelerators" .PP The \fBXmNaccelerators\fP resource of a SpinBox are added to each traversable text child\&. The default \fBXmNaccelerators\fP are defined in the following list\&. The bindings for \fB\fP\fB\fP and \fB\fP\fB\fP cannot be changed\&. .IP "\fB\fP \fB\fP:" 10 SpinBPrior() .IP "\fB\fP \fB\fP:" 10 SpinBNext() .IP "\fB\fP \fB\fP:" 10 SpinBDisarm() .IP "\fB\fP \fB\fP:" 10 SpinBDisarm() .IP "\fB\fP \fB\fP:" 10 SpinBLeft() .IP "\fB\fP \fB\fP:" 10 SpinBRight() .IP "\fB\fP \fB\fP:" 10 SpinBDisarm() .IP "\fB\fP \fB\fP:" 10 SpinBDisarm() .IP "\fB\fP \fB\fP:" 10 SpinBFirst() .IP "\fB\fP \fB\fP:" 10 SpinBLast() .SS "Action Routines" .PP The \fBXmSpinBox\fP action routines are as follows: .IP "SpinBArm():" 10 Visually arms the SpinBox by drawing the armed arrow so that it appears to be depressed\&. This action is initiated when the user presses \fB\fP while the pointer is within the boundaries of either the increment or decrement arrow\&. The arrow remains visually armed as long as \fB\fP remains depressed\&. .IP "" 10 If the time period specified by \fBXmNrepeatDelay\fP is not greater than zero milliseconds, nothing else happens while \fB\fP remains depressed\&. .IP "" 10 If the time period specified by \fBXmNrepeatDelay\fP is greater than zero milliseconds, and the arrow is disarmed before the time period specified by \fBXmNinitialDelay\fP has elapsed, nothing else happens in this action\&. .IP "" 10 If the time period specified by \fBXmNrepeatDelay\fP is greater than zero milliseconds, and the arrow is still armed after the time period specified by \fBXmNinitialDelay\fP has elapsed, the following occurs: .RS .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure, \fBXmSpinBoxCallbackStruct\fR, is set to \fBXmCR_SPIN_NEXT\fP if the increment arrow is armed, or to \fBXmCR_SPIN_PRIOR\fP if the decrement arrow is armed\&. .IP " \(bu" 6 The \fIposition\fP member is set to the next position\&. .IP " \(bu" 6 The \fIdoit\fP member is set to True\&. .IP " \(bu" 6 \fBXmNmodifyVerifyCallback\fP, if it exists, is invoked\&. The application may change the value of \fIposition\fP and \fIdoit\fP\&. If the application sets \fIdoit\fP to False, nothing else happens until the \fBXmNrepeatDelay\fP period has elapsed, or until \fB\fP is released\&. .RE .IP "" 10 If \fIdoit\fP remains set to True, the following occurs: .RS .IP " \(bu" 6 The value of \fBXmNposition\fP is changed to the value of \fIposition\fP in the SpinBox callback structure\&. .IP " \(bu" 6 The text corresponding to the new position is displayed in the traversable text child that currently has focus\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_SPIN_NEXT\fP if the increment arrow is armed, or \fBXmCR_SPIN_PRIOR\fP if the decrement arrow is armed\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) value of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP, if it exists, is called\&. SpinBox ignores any changes to \fIposition\fP or \fIdoit\fP members made by \fBXmNvalueChangedCallback\fP\&. .RE .IP "" 10 These events are repeated each time the \fBXmNrepeatDelay\fP period elapses and the arrow remains armed\&. .IP "SpinBDisarm():" 10 Visually disarms the SpinBox by drawing the previously armed arrow so that it no longer appears to be depressed\&. .IP "" 10 If the time period specified by \fBXmNrepeatDelay\fP is not greater than zero milliseconds, or the time period specified by \fBXmNinitialDelay\fP has not elapsed, the following then occurs: .RS .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure, \fBXmSpinBoxCallbackStruct\fR, is set to \fBXmCR_SPIN_NEXT\fP if the increment arrow is armed, or to \fBXmCR_SPIN_PRIOR\fP if the decrement arrow is armed\&. .IP " \(bu" 6 The \fIposition\fP member is set to the next position\&. .IP " \(bu" 6 The \fIdoit\fP member is set to True\&. .IP " \(bu" 6 The \fBXmNmodifyVerifyCallback\fP, if there is one, is invoked\&. The application may change the value of \fIposition\fP and \fIdoit\fP\&. If the application sets \fIdoit\fP to False, nothing else happens until the \fBXmNrepeatDelay\fP period has elapsed, or until \fB\fP is released\&. .RE .IP "" 10 If \fIdoit\fP remains set to True, the following occurs: .RS .IP " \(bu" 6 The value of \fBXmNposition\fP is changed to the value of \fIposition\fP in the SpinBox callback structure\&. .IP " \(bu" 6 The text corresponding to the new position is displayed in the traversable text child that currently has focus\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_SPIN_NEXT\fP if the increment arrow is armed, or \fBXmCR_SPIN_PRIOR\fP if the decrement arrow is armed\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) value of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP, if it exists, is called\&. SpinBox ignores any changes to \fIposition\fP or \fIdoit\fP members made by an \fBXmNvalueChangedCallback\fP\&. .RE .IP "" 10 If an \fBXmNvalueChangedCallback\fP procedure is issued after the button has been armed, regardless of the value of \fBXmNrepeatDelay\fP or whether the \fBXmNinitialDelay\fP has expired: .RS .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_OK\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current value of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP, if it exists, is called\&. .RE .IP "SpinBFirst():" 10 The following occurs: .RS .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure, \fBXmSpinBoxCallbackStruct\fR, is set to \fBXmCR_SPIN_FIRST\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the first (0) position\&. .IP " \(bu" 6 The \fIdoit\fP member is set to True\&. .IP " \(bu" 6 \fBXmNmodifyVerifyCallback\fP, if it exists, is invoked\&. The application may change the value of \fIposition\fP and \fIdoit\fP\&. If the application sets \fIdoit\fP to False, nothing else happens until the \fBXmNrepeatDelay\fP period has elapsed, or until \fB\fP is released\&. .RE .IP "" 10 If \fIdoit\fP remains set to True, the following occurs: .RS .IP " \(bu" 6 The value of \fBXmNposition\fP is changed to the value of \fIposition\fP in the SpinBox callback structure\&. .IP " \(bu" 6 The text corresponding to the new position is displayed in the traversable text child that currently has focus\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_SPIN_FIRST\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) value of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP, if it exists, is called\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_OK\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) \fBXmNposition\fP value\&. .IP " \(bu" 6 The \fBXmNvalueChangedCallback\fP is called again\&. SpinBox ignores any changes to \fIposition\fP or \fIdoit\fP members made by \fBXmNvalueChangedCallback\fP\&. .RE .IP "SpinBLast():" 10 The following occurs: .RS .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure, \fBXmSpinBoxCallbackStruct\fR, is set to \fBXmCR_SPIN_LAST\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the last position\&. .IP " \(bu" 6 The \fIdoit\fP member is set to True\&. .IP " \(bu" 6 \fBXmNmodifyVerifyCallback\fP, if it exists, is invoked\&. The application may change the value of \fIposition\fP and \fIdoit\fP\&. If the application sets \fIdoit\fP to False, nothing else happens until the \fBXmNrepeatDelay\fP period has elapsed, or until \fB\fP is released\&. .RE .IP "" 10 If \fIdoit\fP remains set to True, the following occurs: .RS .IP " \(bu" 6 The value of \fBXmNposition\fP is changed to the value of \fIposition\fP in the SpinBox callback structure\&. .IP " \(bu" 6 The text corresponding to the new position is displayed in the traversable text child that currently has focus\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_SPIN_LAST\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) value \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP, if it exists, is called\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_OK\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP is called again\&. SpinBox ignores any changes to the \fIposition\fP or \fIdoit\fP members made by \fBXmNvalueChangedCallback\fP\&. .RE .IP "SpinBLeft():" 10 If the VendorShell resource \fBXmNlayoutDirection\fP is left-to-right, the \fBSpinBPrior\fP action is invoked\&. Otherwise, the \fBSpinBNext\fP action is invoked\&. .IP "SpinBNext():" 10 Visually arms the SpinBox by drawing the increment arrow so that it appears to be depressed\&. The following occurs: .RS .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure, \fBXmSpinBoxCallbackStruct\fR, is set to \fBXmCR_SPIN_NEXT\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the next position\&. .IP " \(bu" 6 The \fIdoit\fP member is set to True\&. .IP " \(bu" 6 \fBXmNmodifyVerifyCallback\fP, if it exists, is invoked\&. The application may change the value of \fIposition\fP and \fIdoit\fP\&. If the application sets \fIdoit\fP to False, nothing else happens until the \fBXmNrepeatDelay\fP period has elapsed, or until \fB\fP is released\&. .RE .IP "" 10 If \fIdoit\fP remains set to True, the following occurs: .RS .IP " \(bu" 6 The value of \fBXmNposition\fP is changed to the value of \fIposition\fP in the SpinBox callback structure\&. .IP " \(bu" 6 The text corresponding to the new position is displayed in the traversable text child that currently has focus\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_SPIN_NEXT\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) value of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP, if it exists, is called\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_OK\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) \fBXmNposition\fP\&. .IP " \(bu" 6 The \fBXmNvalueChangedCallback\fP is called again\&. SpinBox ignores any changes to \fIposition\fP or \fIdoit\fP members made by \fBXmNvalueChangedCallback\fP\&. .RE .IP "SpinBPrior():" 10 Visually arms the SpinBox by drawing the decrement arrow so that it appears to be depressed\&. The following occurs: .RS .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure, \fBXmSpinBoxCallbackStruct\fR, is set to \fBXmCR_SPIN_PRIOR\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the next position\&. .IP " \(bu" 6 The \fIdoit\fP member is set to True\&. .IP " \(bu" 6 \fBXmNmodifyVerifyCallback\fP, if it exists, is invoked\&. The application may change the value of \fIposition\fP and \fIdoit\fP\&. If the application sets \fIdoit\fP to False, nothing else happens until the \fBXmNrepeatDelay\fP period has elapsed, or until \fB\fP is released\&. .RE .IP "" 10 If \fIdoit\fP remains set to True, the following occurs: .RS .IP " \(bu" 6 The value of \fBXmNposition\fP is changed to the value of \fIposition\fP in the SpinBox callback structure\&. .IP " \(bu" 6 The text corresponding to the new position is displayed in the traversable text child that currently has focus\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_SPIN_PRIOR\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) value of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP, if it exists, is called\&. .IP " \(bu" 6 The \fIreason\fP member of the SpinBox callback structure is set to \fBXmCR_OK\fP\&. .IP " \(bu" 6 The \fIposition\fP member is set to the current (new) value of \fBXmNposition\fP\&. .IP " \(bu" 6 \fBXmNvalueChangedCallback\fP is called again\&. SpinBox ignores any changes to \fIposition\fP or \fIdoit\fP members made by \fBXmNvalueChangedCallback\fP\&. .RE .IP "SpinBRight():" 10 If the VendorShell resource \fBXmNlayoutDirection\fP is left-to-right, the \fBSpinBNext\fP action is invoked\&. Otherwise, the \fBSpinBPrior\fP action is invoked\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateSpinBox\fP(3), \fBXmManager\fP(3), \fBXmString\fP(3), \fBXmVaCreateSpinBox\fP(3), and \fBXmVaCreateManagedSpinBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmTranslateKey.30000644000175000017500000000451412672140200014736 00000000000000'\" t ...\" Translat.sgm /main/9 1996/09/08 21:11:37 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTranslateKey" "library call" .SH "NAME" \fBXmTranslateKey\fP \(em The default keycode-to-keysym translator .iX "XmTranslateKey" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTranslateKey\fP\fR( \fBDisplay *\fBdisplay\fR\fR, \fBKeyCode \fBkeycode\fR\fR, \fBModifiers \fBmodifiers\fR\fR, \fBModifiers *\fBmodifiers_return\fR\fR, \fBKeySym *\fBkeysym_return\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTranslateKey\fP is the default \fBXtKeyProc\fP translation procedure for Motif applications\&. The function takes a keycode and modifiers and returns the corresponding keysym\&. .PP \fBXmTranslateKey\fP serves two main purposes: to enable new translators with expanded functionality to get the default Motif keycode-to-keysym translation in addition to whatever they add, and to reinstall the default translator\&. This function enables keysyms defined by the Motif virtual bindings to be used when an application requires its own XtKeyProc to be installed\&. .IP "\fIdisplay\fP" 10 Specifies the display that the keycode is from .IP "\fIkeycode\fP" 10 Specifies the keycode to translate .IP "\fImodifiers\fP" 10 Specifies the modifier keys to be applied to the keycode .IP "\fImodifiers_return\fP" 10 Specifies a mask of the modifier keys actually used to generate the keysym (an AND of \fImodifiers\fP and any default modifiers applied by the currently registered translator) .IP "\fIkeysym_return\fP" 10 Specifies a pointer to the resulting keysym .SH "RELATED" .PP \fBVirtualBindings\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmTextFieldSetInsertionPosition.30000644000175000017500000000364412672140200020317 00000000000000'\" t ...\" TxtFieBC.sgm /main/8 1996/09/08 21:15:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetInsertionPosition" "library call" .SH "NAME" \fBXmTextFieldSetInsertionPosition\fP \(em A TextField function that sets the position of the insertion cursor .iX "XmTextFieldSetInsertion\\%Position" .iX "TextField functions" "XmTextFieldSetInsertion\\%Position" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetInsertionPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetInsertionPosition\fP sets the insertion cursor position of the TextField widget\&. This routine also calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks if the insertion cursor position changes\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIposition\fP" 10 Specifies the position of the insert cursor\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmCreateLabel.30000644000175000017500000000341512672140200014472 00000000000000'\" t ...\" CreLaA.sgm /main/7 1996/08/30 14:40:03 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateLabel" "library call" .SH "NAME" \fBXmCreateLabel\fP \(em The Label widget creation function .iX "XmCreateLabel" .iX "creation functions" "XmCreateLabel" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateLabel\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateLabel\fP creates an instance of a Label widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Label and its associated resources, see \fBXmLabel\fP(3)\&. .SH "RETURN" .PP Returns the Label widget ID\&. .SH "RELATED" .PP \fBXmLabel\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmTextFieldInsert.30000644000175000017500000000501212672140200015377 00000000000000'\" t ...\" TxtFieAR.sgm /main/8 1996/09/08 21:14:21 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldInsert" "library call" .SH "NAME" \fBXmTextFieldInsert\fP \(em A TextField function that inserts a character string into a text string .iX "XmTextFieldInsert" .iX "TextField functions" "XmTextFieldInsert" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldInsert\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR, \fBchar \fB* value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldInsert\fP inserts a character string into the text string in the TextField widget\&. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text\&. For example, to insert a string after the fourth character, the \fIposition\fP parameter must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as \fIposition\fP, the \fBXmNmotionVerifyCallback\fP is called\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIposition\fP" 10 Specifies the position in the text string where the character string is to be inserted .IP "\fIvalue\fP" 10 Specifies the character string value to be added to the text widget .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldInsertWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmVaCreateTextField.30000644000175000017500000000272112672140200015631 00000000000000.DT .TH "XmVaCreateTextField" "library call" .SH "NAME" \fBXmVaCreateTextField\fP, \fBXmVaCreateManagedTextField\fP \(em A TextField widget convenience creation functions\&. .iX "XmVaCreateToggleTextField" "XmVaCreateManagedTextField" .iX "creation functions" "XmVaCreateTextField" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateTextField\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedTextField\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateTextField\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateTextField\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns the TextField widget ID\&. .SH "RELATED" .PP \fBXmTextField\fP(3), \fBXmCreateTextField\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedTabStack.30000644000175000017500000000003612672140200016707 00000000000000.so man3/XmVaCreateTabStack.3 motif-2.3.8/doc/man/man3/XmContainerReorder.30000644000175000017500000000374612672140200015603 00000000000000'\" t ...\" ContainI.sgm /main/7 1996/08/30 14:26:29 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerReorder" "library call" .SH "NAME" \fBXmContainerReorder\fP \(em Container widget function to reorder children .iX "XmContainerReorder" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmContainerReorder\fP\fR( \fBWidget \fBcontainer\fR\fR, \fBWidgetList \fBwidgets\fR\fR, \fBint \fBnum_widgets\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerReorder\fP obtains the \fBXmNpositionIndex\fP constraint resources of each widget specified in \fIwidgets\fP, sorts them in ascending order, and inserts the \fBXmNpositionIndex\fP constraint resources in the new order into each widget\&. If the \fBXmNlayoutType\fP resource of Container is \fBXmOUTLINE\fP or \fBXmDETAIL\fP, \fBXmContainerReorder\fP will force a layout of all items\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .IP "\fIwidgets\fP" 10 Specifies an array of widget children of \fIcontainer\fP\&. .IP "\fInum_widgets\fP" 10 Specifies the number of items in the \fIwidgets\fP array\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmFontListEntryGetFont.30000644000175000017500000000435612672140200016407 00000000000000'\" t ...\" FontLstM.sgm /main/9 1996/09/08 20:43:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListEntryGetFont" "library call" .SH "NAME" \fBXmFontListEntryGetFont\fP \(em A font list function that retrieves font information from a font list entry .iX "XmFontListEntryGetFont" .iX "font list functions" "XmFontListEntryGetFont" .SH "SYNOPSIS" .PP .nf #include \fBXtPointer \fBXmFontListEntryGetFont\fP\fR( \fBXmFontListEntry \fBentry\fR\fR, \fBXmFontType *\fBtype_return\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListEntryGetFont\fP retrieves font information for a specified font list entry\&. If the font list entry contains a font, \fItype_return\fP returns \fBXmFONT_IS_FONT\fP and the function returns a pointer to an \fBXFontStruct\fP\&. If the font list entry contains a font set, \fItype_return\fP returns \fBXmFONT_IS_FONTSET\fP and the function returns the \fBXFontSet\fP\&. .IP "\fIentry\fP" 10 Specifies the font list entry\&. .IP "\fItype_return\fP" 10 Specifies a pointer to the type of the font element for the current entry\&. Valid values are \fBXmFONT_IS_FONT\fP and \fBXmFONT_IS_FONTSET\fP\&. .PP The returned \fBXFontSet\fP or \fBXFontStruct\fP is not a copy of the toolkit data and must not be freed\&. .SH "RETURN" .PP Returns an \fBXFontSet\fP or a pointer to an \fBXFontStruct\fP structure\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryGetTag\fP(3) \fBXmFontListEntryLoad\fP(3), and \fBXmFontListNextEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmFontListEntryFree.30000644000175000017500000000345712672140200015723 00000000000000'\" t ...\" FontLstL.sgm /main/8 1996/08/31 15:23:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListEntryFree" "library call" .SH "NAME" \fBXmFontListEntryFree\fP \(em A font list function that recovers memory used by a font list entry .iX "XmFontListEntryFree" .iX "font list functions" "XmFontListEntryFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmFontListEntryFree\fP\fR( \fBXmFontListEntry *\fBentry\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListEntryFree\fP recovers memory used by a font list entry\&. This routine does not free the \fBXFontSet\fP or \fBXFontStruct\fP associated with the font list entry\&. .IP "\fIentry\fP" 10 Specifies a pointer to the font list entry to be freed\&. In addition, it may be necessary to take the address of the font list entry (via the \fB&\fP operator) before passing it to this function\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryLoad\fP(3), \fBXmFontListNextEntry\fP(3), and \fBXmFontListRemoveEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmParseMapping.30000644000175000017500000002076212672140200014721 00000000000000'\" t ...\" ParMapA.sgm /main/10 1996/09/08 20:55:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmParseMapping" "library call" .SH "NAME" \fBXmParseMapping\fR \(em Data type for a compound string parse mapping .iX "XmParseMapping" .iX "data types" "XmParseMapping" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmParseMapping\fR is an opaque data type for a parse mapping used by \fBXmStringParseText\fP to create a compound string\&. A parse mapping contains a pattern to be matched in text being parsed to create a compound string\&. It also contains a compound string, or a function to be invoked to provide a compound string, to be included in the compound string being created whenever the pattern is matched\&. .PP An application uses a resource-style interface to specify components for an \fBXmParseMapping\fR\&. \fBXmParseMappingCreate\fP creates a parse mapping, using a resource-style argument list\&. \fBXmParseMappingGetValues\fP and \fBXmParseMappingSetValues\fP retrieve and set the components of a parse mapping\&. \fBXmParseMappingFree\fP recovers memory used by a parse mapping\&. \fBXmParseTable\fR is an array of \fBXmParseMapping\fR objects\&. .PP The \fBXmNinvokeParseProc\fP resource is a function of type \fBXmParseProc\fR, which is defined as follows: .PP .nf XmIncludeStatus (*XmParseProc) (\fItext_in_out, text_end, type, tag, entry, pattern_length, str_include, call_data\fP) XtPointer *\fItext_in_out\fP; XtPointer \fItext_end\fP; XmTextType \fItype\fP; XmStringTag \fItag\fP; XmParseMapping \fIentry\fP; int \fIpattern_length\fP; XmString *\fIstr_include\fP; XtPointer \fIcall_data\fP; .fi .PP A parse procedure provides an escape mechanism for arbitrarily complex parsing\&. This procedure is invoked when a pattern in the input text is matched with a pattern in a parse mapping whose \fBXmNincludeStatus\fP is \fBXmINVOKE\fP\&. .PP The input text is a pointer to the first byte of the pattern that was matched to trigger the call to the parse procedure\&. The parse procedure consumes as many bytes of the input string as it needs and sets the input text pointer to the following byte\&. It returns a compound string to be included in the compound string being constructed, and it also returns an \fBXmIncludeStatus\fR indicating how the returned compound string should be handled\&. If the parse procedure does not set the input text pointer ahead by at least one byte, the parsing routine continues trying to match the input text with the patterns in the remaining parse mappings in the parse table\&. Otherwise, the parsing routine begins with the new input text pointer and tries to match the input text with patterns in the parse mappings starting at the beginning of the parse table\&. .IP "\fItext_in_out\fP" 10 Specifies the text being parsed\&. The value is a pointer to the first byte of text matching the pattern that triggered the call to the parse procedure\&. When the parse procedure returns, this argument is set to the position in the text where parsing should resume\(emthat is, to the byte following the last character parsed by the parse procedure\&. .IP "\fItext_end\fP" 10 Specifies a pointer to the end of the \fItext_in_out\fP string\&. If \fItext_end\fP is NULL, the string is scanned until a NULL character is found\&. Otherwise, the string is scanned up to but not including the character whose address is \fItext_end\fP\&. .IP "\fItype\fP" 10 Specifies the type of text and the tag type\&. If a locale tag should be created, \fItype\fP has a value of either \fBXmMULTIBYTE_TEXT\fP or \fBXmWIDECHAR_TEXT\fP\&. If a charset should be created, \fItype\fP has a value of \fBXmCHARSET_TEXT\fP\&. .IP "\fItag\fP" 10 Specifies the tag to be used in creating the result\&. The type of string tag created (charset or locale) depends on the text type and the passed in \fItag\fP value\&. If the \fItag\fP value is NULL and if \fItype\fP indicates that a charset string tag should be created, the string tag has the value that is the result of mapping \fBXmSTRING_DEFAULT_CHARSET\fP\&. If \fItype\fP indicates a locale string tag, the string tag has the value \fB_MOTIF_DEFAULT_LOCALE\fP\&. .IP "\fIentry\fP" 10 Specifies the parse mapping that triggered the call to the parse procedure\&. .IP "\fIpattern_length\fP" 10 Specifies the number of bytes in the input text, following \fItext_in_out\fP, that constitute the matched pattern\&. .IP "\fIstr_include\fP" 10 Specifies a pointer to a compound string\&. The parse procedure creates a compound string to be included in the compound string being constructed\&. The parse procedure then returns the compound string in this argument\&. .IP "\fIcall_data\fP" 10 Specifies data passed by the application to the parsing routine\&. .PP The parse procedure returns an \fBXmIncludeStatus\fR indicating how \fIstr_include\fP is to be included in the compound string being constructed\&. Following are the possible values: .IP "\fBXmINSERT\fP" 10 Concatenate the result to the compound string being constructed and continue parsing\&. .IP "\fBXmTERMINATE\fP" 10 Concatenate the result to the compound string being constructed and terminate parsing\&. .SS "New Resources" .PP The following table defines a set of resources used by the programmer to specify data\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXmParseMappingSetValues\fP (S), retrieved by using \fBXmParseMappingGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmParseMapping Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNclientDataXtPointerNULLCSG _____ XmNincludeStatusXmIncludeStatusXmINSERTCSG _____ XmNinvokeParseProcXmParseProcNULLCSG _____ XmNpatternXtPointerNULLCSG _____ XmNpatternTypeXmTextTypeXmCHARSET_TEXTCSG _____ XmNsubstituteXmStringNULLCSG _____ .TE .IP "\fBXmNclientData\fP" 10 Specifies data to be used by the parse procedure\&. .IP "\fBXmNincludeStatus\fP" 10 Specifies how the result of the mapping is to be included in the compound string being constructed\&. Unless the value is \fBXmINVOKE\fP, the result of the mapping is the value of \fBXmNsubstitute\fP\&. Following are the possible values for \fBXmNincludeStatus\fP: .RS .IP "\fBXmINSERT\fP" 10 Concatenate the result to the compound string being constructed and continue parsing\&. .IP "\fBXmINVOKE\fP" 10 Invoke the \fBXmNinvokeParseProc\fP on the text being parsed and use the returned compound string instead of \fBXmNsubstitute\fP as the result to be inserted into the compound string being constructed\&. The include status returned by the parse procedure (\fBXmINSERT\fP or \fBXmTERMINATE\fP) determines how the returned compound string is included\&. .IP "\fBXmTERMINATE\fP" 10 Concatenate the result to the compound string being constructed and terminate parsing\&. .RE .IP "\fBXmNinvokeParseProc\fP" 10 Specifies the parse procedure to be invoked when \fBXmNincludeStatus\fP is \fBXmINVOKE\fP\&. .IP "\fBXmNpattern\fP" 10 Specifies a pattern to be matched in the text being parsed\&. This is a maximum of one character\&. .IP "\fBXmNpatternType\fP" 10 Specifies the type of the pattern that is the value of \fBXmNpattern\fP\&. Following are the possible values: .RS .IP " \(bu" 6 \fBXmCHARSET_TEXT\fP .IP " \(bu" 6 \fBXmMULTIBYTE_TEXT\fP .IP " \(bu" 6 \fBXmWIDECHAR_TEXT\fP .RE .IP "\fBXmNsubstitute\fP" 10 Specifies the compound string to be included in the compound string being constructed when \fBXmNincludeStatus\fP is \fBXmINSERT\fP or \fBXmTERMINATE\fP\&. .SH "RELATED" .PP \fBXmParseMappingCreate\fP(3), \fBXmParseMappingFree\fP(3), \fBXmParseMappingGetValues\fP(3), \fBXmParseMappingSetValues\fP(3), \fBXmParseTable\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmTextFieldGetLastPosition.30000644000175000017500000000362712672140200017235 00000000000000'\" t ...\" TxtFieAI.sgm /main/8 1996/09/08 21:13:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetLastPosition" "library call" .SH "NAME" \fBXmTextFieldGetLastPosition\fP \(em A TextField function that accesses the position of the last text character .iX "XmTextFieldGetLastPosition" .iX "TextField functions" "XmTextFieldGetLastPosition" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmTextFieldGetLastPosition\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetLastPosition\fP accesses the position of the last character in the text buffer of the TextField widget\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns an \fBXmTextPosition\fR value that indicates the position of the last character in the text buffer\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. The last character position is equal to the number of characters in the text buffer\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmComboBoxUpdate.30000644000175000017500000000311612672140200015200 00000000000000'\" t ...\" ComboBU.sgm /main/8 1996/09/08 20:30:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmComboBoxUpdate" "library call" .SH "NAME" \fBXmComboBoxUpdate\fP \(em A ComboBox function that resynchronizes data .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmComboBoxUpdate\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmComboBoxUpdate\fP resynchronizes the internal data structures of a specified ComboBox widget\&. This function is useful when an application manipulates ComboBox\&'s child widgets, possibly changing data structures\&. For example, you might want to use the \fBXmComboBoxUpdate\fP function after a ComboBox List child selection has been changed without notification\&. .IP "\fIwidget\fP" 10 Specifies the ComboBox widget ID\&. .SH "RELATED INFORMATION" .PP \fBXmComboBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmStringWidth.30000644000175000017500000000305512672140200014575 00000000000000'\" t ...\" StrWid.sgm /main/8 1996/09/08 21:08:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringWidth" "library call" .SH "NAME" \fBXmStringWidth\fP \(em A compound string function that returns the width of the widest line in a compound string .iX "XmStringWidth" .iX "compound string functions" "XmStringWidth" .SH "SYNOPSIS" .PP .nf #include \fBDimension \fBXmStringWidth\fP\fR( \fBXmRenderTable \fBrendertable\fR\fR, \fBXmString \fBstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringWidth\fP returns the width, in pixels, of the widest line in the provided compound string\&. .IP "\fIrendertable\fP" 10 Specifies the render table .IP "\fIstring\fP" 10 Specifies the string .SH "RETURN" .PP Returns the width of the compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmFontListInitFontContext.30000644000175000017500000000445212672140200017113 00000000000000'\" t ...\" FontLstU.sgm /main/8 1996/09/08 20:44:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListInitFontContext" "library call" .SH "NAME" \fBXmFontListInitFontContext\fP \(em A font list function that allows applications to access the entries in a font list .iX "XmFontListInitFontContext" .iX "font list functions" "XmFontListInitFontContext" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmFontListInitFontContext\fP\fR( \fBXmFontContext \fB*context\fR\fR, \fBXmFontList \fBfontlist\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListInitFontContext\fP establishes a context to allow applications to access the contents of a font list\&. This context is used when reading the font list entry tag, font, or font set associated with each entry in the font list\&. A Boolean status is returned to indicate whether or not the font list is valid\&. .PP If an application deallocates the font list passed to \fBXmFontListInitFontContext\fP as the fontlist argument, the context established by this function is rendered no longer valid\&. .IP "\fIcontext\fP" 10 Specifies a pointer to the allocated context .IP "\fIfontlist\fP" 10 Specifies the font list .SH "RETURN" .PP Returns True if the context was allocated; otherwise, returns False\&. If the function allocated a context, the application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmFontListFreeFontContext\fP\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListFreeFontContext\fP(3), and \fBXmFontListNextEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmTrackingEvent.30000644000175000017500000000477612672140200015106 00000000000000'\" t ...\" TrackE.sgm /main/8 1996/09/08 21:11:06 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTrackingEvent" "library call" .SH "NAME" \fBXmTrackingEvent\fP \(em A Toolkit function that provides a modal interaction .iX "XmTrackingEvent" .iX "Toolkit functions" "XmTrackingEvent" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmTrackingEvent\fP\fR( \fBWidget \fBwidget\fR\fR, \fBCursor \fBcursor\fR\fR, \fBBoolean \fBconfine_to\fR\fR, \fBXEvent *\fBevent_return\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTrackingEvent\fP provides a modal interface for selection of a component\&. It is intended to support context help\&. The function calls the \fBXmUpdateDisplay\fP function\&. \fBXmTrackingEvent\fP then grabs the pointer and discards succeeding events until \fBBSelect\fP is released or a key is pressed and then released\&. The function then returns the widget or gadget that contains the pointer when \fBBSelect\fP is released or a key is released, and ungrabs the pointer\&. .IP "\fIwidget\fP" 10 Specifies the widget ID of a widget to use as the basis of the modal interaction\&. That is, the widget within which the interaction must occur, usually a top-level shell\&. .IP "\fIcursor\fP" 10 Specifies the cursor to be used for the pointer during the interaction\&. This is a standard X cursor name\&. .IP "\fIconfine_to\fP" 10 Specifies whether or not the cursor should be confined to \fIwidget\fP\&. .IP "\fIevent_return\fP" 10 Returns the ButtonRelease or KeyRelease event that causes the function to return\&. .SH "RETURN" .PP Returns the widget or gadget that contains the pointer when \fBBSelect\fP is released or a key is released\&. If no widget or gadget contains the pointer, the function returns NULL\&. .SH "RELATED" .PP \fBXmTrackingLocate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmDeactivateProtocol.30000644000175000017500000000522512672140200016123 00000000000000'\" t ...\" DeactivA.sgm /main/8 1996/09/08 20:38:26 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDeactivateProtocol" "library call" .SH "NAME" \fBXmDeactivateProtocol\fP \(em A VendorShell function that deactivates a protocol without removing it .iX "XmDeactivateProtocol" .iX "protocols" .iX "VendorShell functions" "XmDeactivateProtocol" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmDeactivateProtocol\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBproperty\fR\fR, \fBAtom \fBprotocol\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDeactivateProtocol\fP deactivates a protocol without removing it\&. It updates the handlers and the \fIproperty\fP if the \fIshell\fP is realized\&. It is sometimes useful to allow a protocol\&'s state information (callback lists, and so on) to persist, even though the client may choose to temporarily resign from the interaction\&. The main use of this capability is to gray/ungray \fBf\&.send_msg\fP entries in the MWM system menu\&. To support this capability, \fIprotocol\fP is allowed to be in one of two states: active or inactive\&. If \fIprotocol\fP is active and \fIshell\fP is realized, \fIproperty\fP contains the \fIprotocol\fP \fBAtom\fP\&. If \fIprotocol\fP is inactive, \fBAtom\fP is not present in the \fIproperty\fP\&. .PP \fBXmDeactivateWMProtocol\fP is a convenience interface\&. It calls \fBXmDeactivateProtocol\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIproperty\fP" 10 Specifies the protocol property .IP "\fIprotocol\fP" 10 Specifies the protocol atom .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBmwm\fP(1), \fBVendorShell\fP(3), \fBXmActivateProtocol\fP(3), \fBXmDeactivateWMProtocol\fP(3), and \fBXmInternAtom\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmCreateSimpleSpinBox.30000644000175000017500000000345012672140200016206 00000000000000'\" t ...\" CreSpinB.sgm /main/6 1996/09/06 09:24:11 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSimpleSpinBox" "library call" .SH "NAME" \fBXmCreateSimpleSpinBox\fP \(em the SimpleSpinBox widget creation function .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSimpleSpinBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmCreateSimpleSpinBox\fP function creates an instance of a SpinBox widget and returns the associated widget ID\&. .PP The \fIparent\fP argument specifies the parent widget ID\&. .PP The \fIname\fP argument specifies the name of the created widget\&. .PP The \fIarglist\fP argument specifies the argument list\&. .PP The \fIargcount\fP argument specifies the number of attribute/value pairs in the argument list\&. .SH "RETURN VALUE" .PP Upon successful completion, the \fBXmCreateSimpleSpinBox\fP function returns the SimpleSpinBox widget ID\&. .SH "SEE ALSO" .PP \fBXmSimpleSpinBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmVaCreatePanedWindow.30000644000175000017500000000276212672140200016165 00000000000000.DT .TH "XmVaCreatePanedWindow" "library call" .SH "NAME" \fBXmVaCreatePanedWindow\fP, \fBXmVaCreateManagedPanedWindow\fP \(em A PanedWindow widget convenience creation functions\&. .iX "XmVaCreateTogglePanedWindow" "XmVaCreateManagedPanedWindow" .iX "creation functions" "XmVaCreatePanedWindow" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreatePanedWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedPanedWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreatePanedWindow\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreatePanedWindow\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of PanedWindow and its associated resources, see \fBXmPanedWindow\fP(3)\&. .SH "RETURN" .PP Returns the PanedWindow widget ID\&. .SH "RELATED" .PP \fBXmPanedWindow\fP(3), \fBXmCreatePanedWindow\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmStringGenerate.30000644000175000017500000000574612672140200015261 00000000000000'\" t ...\" StrGeA.sgm /main/8 1996/09/08 21:04:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringGenerate" "library call" .SH "NAME" \fBXmStringGenerate\fP \(em A convenience function that generates a compound string .iX "XmStringGenerate" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringGenerate\fP\fR( \fBXtPointer \fBtext\fR\fR, \fBXmStringTag \fBtag\fR\fR, \fBXmTextType \fBtype\fR\fR, \fBXmStringTag \fBrendition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringGenerate\fP calls the \fBXmStringParseText\fP function with a default parse table of entries consisting of \&'\n\&', which maps to Separator, and \&'\t\&', which maps to Tab\&. Matching \fBRENDITION_BEGIN\fP and \fBRENDITION_END\fP components containing \fIrendition\fP are placed around the resulting \fBXmString\fR\&. .IP "\fItext\fP" 10 Specifies a NULL-terminated string containing characters of a type determined by \fItype\fP\&. .IP "\fItag\fP" 10 Specifies the tag to be used in creating the result\&. The type of tag created (charset or locale) depends on the text type and the value given\&. If specified value is NULL, and \fItype\fP indicates that a charset tag should be created, then the tag will have the value of \fBXmFONTLIST_DEFAULT_TAG\fP\&. If \fItag\fP is NULL, and \fItype\fP indicates a locale tag, then the tag will have the value of \fB_MOTIF_DEFAULT_LOCALE\fP\&. .IP "\fItype\fP" 10 Specifies the type of text to be passed in, and the tag type\&. If a locale tag should be created, then \fItype\fP has a value of either \fBXmMULTIBYTE_TEXT\fP or \fBXmWIDECHAR_TEXT\fP\&. If a charset should be created, \fItype\fP has a value of \fBXmCHARSET_TEXT\fP\&. .IP "\fIrendition\fP" 10 Specifies the rendition tag to be used in an \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP component which will begin the returned string and in an \fBXmSTRING_COMPONENT_RENDITION_END\fP component which will end it\&. If \fIrendition\fP is NULL, no rendition tag is placed\&. .SH "RETURN" .PP Returns a new compound string\&. The function will allocate space to hold the returned compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .SH "RELATED" .PP \fBXmString\fP(3) and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmCreateComboBox.30000644000175000017500000000346212672140200015165 00000000000000'\" t ...\" CreCoA.sgm /main/8 1996/08/31 17:32:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateComboBox" "library call" .SH "NAME" \fBXmCreateComboBox\fP \(em The default ComboBox widget creation function .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateComboBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBarg_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateComboBox\fP creates an instance of a ComboBox widget of \fBXmNcomboBoxType\fP \fBXmCOMBO_BOX\fP and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fBarg_count\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of ComboBox and its associated resources, see \fBXmComboBox\fP(3)\&. .SH "RETURN" .PP Returns the ComboBox widget ID\&. .SH "RELATED" .PP \fBXmComboBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmPrintToFile.30000644000175000017500000000777612672140200014544 00000000000000'\" t ...\" PrtToFil.sgm /main/9 1996/10/02 11:49:29 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPrintToFile" "library call" .SH "NAME" \fBXmPrintToFile\fP \(em Retrieves and saves data that would normally be printed by the X Print Server\&. .SH "SYNOPSIS" .PP .nf #include \fBXtEnum\fBXmPrintToFile\fP\fR( \fBDisplay\fB*dpy\fR\fR, \fBString\fBfilename\fR\fR, \fBXPFinishProc\fBfinish_proc\fR\fR, \fBXtPointer\fBclient_data\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmPrintToFile\fP hides the details of X display connection and \fBXpGetDocumentData\fP to the Motif application programmer\&. .PP This function is a convenience routine that hides the details of the X and Xp internals to the application programmer by calling the \fBXpGetDocumentData\fP function with appropriate save and finish callbacks\&. .PP This is used in the context of X Printing when the user has specified the "print-to-file" option from a regular Print Setup Dialog box\&. .PP \fBXmPrintToFile\fP first tries to open the given filename for writing and returns \fBFalse\fP if it can\&'t\&. Else, it uses \fBXpGetDocumentData\fP, giving it a save proc that writes the data received in the file and a finish proc that closes the file or removes it on an unsuccessful termination\&. It calls \fBfinish_proc\fP at that point, passing it the argument received from the Xp layer (\fBstatus == XPGetDocFinished\fP means the file is valid and was closed, otherwise the file was removed)\&. .PP \fBXmPrintToFile\fP is non-blocking; if it returns successfully, it just means the file was opened successfully, not that all the data was received\&. .IP "\fIdpy\fP" 10 Print display connection\&. .IP "\fIfilename\fP" 10 Name of the file to put the print data in\&. .IP "\fIfinish_proc\fP" 10 Called when all the data has been received\&. .IP "\fIclient_data\fP" 10 Passed with the \fIfinish_proc\fP\&. .SH "RETURN VALUE" .PP Returns \fBFalse\fP if the filename could not be created or opened for writing, \fBTrue\fP otherwise\&. .SH "ERRORS/WARNINGS" .PP Not applicable .SH "EXAMPLES" .PP A typical OK callback from a \fBDtPrintSetupBox\fP: .PP .nf \f(CWPrintOKCallback(widget\&.\&.\&.) /*-------------*/ { int save_data = XPSpool; pshell = XmPrintSetup (widget, pbs->print_screen, "Print", NULL, 0); XtAddCallback(pshell, XmNstartJobCallback, startJobCB, data); if (pbs->destination == DtPRINT_TO_FILE) save_data = XPGetData; /* start job must precede XpGetDocumentData in XmPrintToFile */ XpStartJob(XtDisplay(pshell), save_data); XFlush(XtDisplay(pshell)); /* maintain the sequence between startjob and getdocument */ /* setup print to file */ if (pbs->destination == DtPRINT_TO_FILE) XmPrintToFile(XtDisplay(pshell), pbs->dest_info, FinishPrintToFile, NULL); } } static void startJobCB(Widget, XtPointer call_data, XtPointer client_data) { print(p); /* rendering happens here */ XpEndJob(XtDisplay(p->print_shell)); /* clean up */ XtDestroyWidget(p->print_shell); XtCloseDisplay(XtDisplay(p->print_shell)); }\fR .fi .PP .SH "SEE ALSO" .PP \fBXmPrintSetup\fP(3), \fBXmPrintShell\fP(3), \fBXmRedisplayWidget\fP(3), \fBXmPrintPopupPDM\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmMultiListMakeRowVisible.30000644000175000017500000000153212672140200017057 00000000000000.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMultiListMakeRowVisible" "library call" .SH "NAME" \fBXmMultiListMakeRowVisible\fP \(em A MultiList function that shifts the visible list rows as desired .iX "XmMultiListSelectRow" .iX "MultiList functions" "XmMultiListSelectRow" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListMakeRowVisible\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBrow\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMultiListMakeRowVisible\fP makes specified row visible\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget from whose list an item is selected\&. .IP "\fIrow\fP" 10 Specifies the row number (starting from 0) to be visible in the MultiList widget\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmCascadeButtonGadget.30000644000175000017500000004024312672140200016162 00000000000000'\" t ...\" CascBB.sgm /main/11 1996/09/08 20:25:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCascadeButtonGadget" "library call" .SH "NAME" \fBXmCascadeButtonGadget\fP \(em The CascadeButtonGadget widget class .iX "XmCascadeButtonGadget" .iX "widget class" "CascadeButtonGadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP CascadeButtonGadget links two menu panes, a MenuBar to a menu pane, or an OptionMenu to a menu pane\&. .PP It is used in menu systems and must have a RowColumn parent with its \fBXmNrowColumnType\fP resource set to \fBXmMENU_BAR\fP, \fBXmMENU_POPUP\fP, \fBXmMENU_PULLDOWN\fP, or \fBXmMENU_OPTION\fP\&. .PP It is the only gadget that can have a Pulldown menu pane attached to it as a submenu\&. The submenu is displayed when this gadget is activated within a PopupMenu, a PulldownMenu, or an OptionMenu\&. Its visuals can include a label or pixmap and a cascading indicator when it is in a Popup or Pulldown menu pane; or it can include only a label or a pixmap when it is in an OptionMenu\&. The positioning of the PulldownMenu with respect to the CascadeButton depends on the \fBXmNlayoutDirection\fP resource of the MenuShell\&. .PP The default behavior associated with a CascadeButtonGadget depends on the type of menu system in which it resides\&. By default, \fBBSelect\fP controls the behavior of the CascadeButtonGadget\&. In addition, \fBBMenu\fP controls the behavior of the CascadeButtonGadget if it resides in a PopupMenu system\&. The actual mouse button used is determined by its RowColumn parent\&. \fBBMenu\fP also performs the \fBBSelect\fP actions in all types of menu systems\&. .PP A CascadeButtonGadget\&'s visuals differ from most other button gadgets\&. When the button becomes armed, its visuals change from a 2-D to a 3-D look, and it displays the submenu that has been attached to it\&. If no submenu is attached, it simply changes its visuals\&. .PP When a CascadeButtonGadget within a Pulldown or Popup menu pane is armed as the result of the user moving the mouse pointer into the gadget, it does not immediately display its submenu\&. Instead, it waits a short time to see if the arming was temporary (that is, the user was simply passing through the gadget), or the user really wanted the submenu posted\&. This delay is configurable using \fBXmNmappingDelay\fP\&. .PP CascadeButtonGadget provides a single mechanism for activating the gadget from the keyboard\&. This mechanism is referred to as a keyboard mnemonic\&. If a mnemonic has been specified for the gadget, the user may activate it by simply typing the mnemonic while the CascadeButtonGadget is visible\&. If the CascadeButtonGadget is in a MenuBar and the MenuBar does not have focus, the \fBMAlt\fP modifier must be pressed with the mnemonic\&. Mnemonics are typically used to interact with a menu using the keyboard\&. .PP If a CascadeButtonGadget is in a Pulldown or Popup menu pane and there is a submenu attached, the \fBXmNmarginBottom\fP, \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, and \fBXmNmarginTop\fP resources may enlarge to accommodate \fBXmNcascadePixmap\fP\&. \fBXmNmarginWidth\fP defaults to 6 if this resource is in a MenuBar; otherwise, it takes LabelGadget\&'s default, which is 2\&. .PP CascadeButtonGadget uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits\&. .SS "Classes" .PP CascadeButtonGadget inherits behavior, resources, and traits from the \fBObject\fP, \fBRectObj\fP, \fBXmGadget\fP, and \fBXmLabelGadget\fP classes\&. .PP The class pointer is \fBxmCascadeButtonGadgetClass\fP\&. .PP The class name is \fBXmCascadeButtonGadget\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmCascadeButtonGadget\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNcascadePixmapXmCPixmapPixmapdynamicCSG _____ XmNcascadingCallbackXmCCallbackXtCallbackListNULLC _____ XmNmappingDelayXmCMappingDelayint180 msCSG _____ XmNsubMenuIdXmCMenuWidgetWidgetNULLCSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when the user activates the CascadeButtonGadget, and there is no submenu attached to pop up\&. The activation occurs when a mouse button is released or when the mnemonic associated with the gadget is typed\&. The specific mouse button depends on information in the RowColumn parent\&. The reason sent by the callback is \fBXmCR_ACTIVATE\fP\&. .IP "\fBXmNcascadePixmap\fP" 10 Specifies the cascade pixmap displayed on one end of the gadget when a CascadeButtonGadget is used within a Popup or Pulldown menu pane and a submenu is attached\&. The LabelGadget class resources \fBXmNmarginBottom\fP, \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, and \fBXmNmarginTop\fP may be modified to ensure that room is left for the cascade pixmap\&. The default cascade pixmap in menus other than option menus is an arrow pointing to the side of the menu where the submenu will appear\&. The default for the CascadeButtonGadget in an option menu is \fBXmUNSPECIFIED_PIXMAP\fP\&. .IP "" 10 The positioning of the cascade pixmap to either the left of right of the widget, and the direction of the arrow, depend on the \fBXmNlayoutDirection\fP resource of the MenuShell\&. .IP "\fBXmNcascadingCallback\fP" 10 Specifies the list of callbacks that is called just prior to the mapping of the submenu associated with the CascadeButtonGadget\&. The reason sent by the callback is \fBXmCR_CASCADING\fP\&. .IP "\fBXmNmappingDelay\fP" 10 Specifies the amount of time, in milliseconds, between when a CascadeButtonGadget becomes armed and when it maps its submenu\&. This delay is used only when the gadget is within a Popup or Pulldown menu pane\&. The value must not be negative\&. .IP "\fBXmNsubMenuId\fP" 10 Specifies the widget ID for the Pulldown menu pane to be associated with this CascadeButtonGadget\&. The specified menu pane is displayed when the CascadeButtonGadget becomes armed\&. The menu pane must have been created with the appropriate parentage depending on the type of menu used\&. See \fBXmCreatePulldownMenu\fP(3), \fBXmCreatePopupMenu\fP(3), and \fBXmCreateOptionMenu\fP(3) for more information on the menu systems\&. .SS "Inherited Resources" .PP CascadeButtonGadget inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabelGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLN/A _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLN/A _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimensiondynamicCSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimension0CSG _____ XmNmarginRightXmCMarginRightDimensiondynamicCSG _____ XmNmarginTopXmCMarginTopDimensiondynamicCSG _____ XmNmarginWidthXmCMarginWidthDimensiondynamicCSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringdynamicCSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension0CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback or is NULL if this callback was not triggered by an \fBXEvent\fP .SS "Behavior" .PP \fBXmCascadeButtonGadget\fP includes behavior from \fBXmGadget\fP\&. \fBXmCascadeButton\fP includes the menu traversal behavior from \fBXmLabel\fP\&. Additional \fBXmCascadeButtonGadget\fP behavior is described in the following list (in a Popup menu system, \fB\fP also performs the \fB\fP actions)\&. .IP "\fB\fP:" 10 Unposts any menus posted by the parent menu\&. Arms the CascadeButtonGadget, posts the associated submenu, enables mouse traversal, and, in a MenuBar, arms the MenuBar\&. If the menu is already active, this event disables keyboard traversal for the menu and returns the menu to mouse traversal mode\&. .IP "\fB\fP:" 10 Calls the callbacks in \fBXmNcascadingCallback\fP, posts the submenu attached to the CascadeButtonGadget and enables keyboard traversal within the menu\&. If the CascadeButtonGadget does not have a submenu attached, this action calls the callbacks in \fBXmNactivateCallback\fP, activates the CascadeButtonGadget, and unposts all posted menus in the cascade\&. .IP "\fB\fP\fB\fP:" 10 Calls the callbacks in \fBXmNcascadingCallback\fP, and posts the submenu attached to the CascadeButtonGadget if keyboard traversal is enabled in the menu\&. If the CascadeButtonGadget does not have a submenu attached, this action calls the callbacks in \fBXmNactivateCallback\fP, activates the CascadeButtonGadget, and unposts all posted menus in the cascade\&. This action applies only to gadgets in MenuBars, PulldownMenus, and PopupMenus\&. For a CascadeButtonGadget in an OptionMenu, if the parent is a manager, this action passes the event to the parent\&. .IP "\fB\fP\fB\fP:" 10 Calls the callbacks in \fBXmNcascadingCallback\fP, and posts the submenu attached to the CascadeButtonGadget if keyboard traversal is enabled in the menu\&. If the CascadeButtonGadget does not have a submenu attached, this action calls the callbacks in \fBXmNactivateCallback\fP, activates the CascadeButtonGadget, and unposts all posted menus in the cascade\&. .IP "\fB\fP\fB\fP:" 10 Unposts all menus in the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu system was entered\&. Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "\fB\fP\fB\fP:" 10 In a MenuBar, disarms the CascadeButtonGadget and the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu was entered\&. For a CascadeButtonGadget in an OptionMenu, if the parent is a manager, this action passes the event to the parent\&. .IP "" 10 In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, unposts the menu\&. .IP "" 10 In a Popup MenuPane, unposts the menu and restores keyboard focus to the widget from which the menu was posted\&. .IP "\fB\fP:" 10 If keyboard traversal is enabled does nothing\&. Otherwise, in a MenuBar, unposts any MenuPanes associated with another MenuBar entry, arms the CascadeButtonGadget, and posts the associated submenu\&. In other menus, arms the CascadeButtonGadget and posts the associated submenu after the delay specified by \fBXmNmappingDelay\fP\&. .IP "\fB\fP:" 10 If keyboard traversal is enabled does nothing\&. Otherwise, in a MenuBar, disarms the CascadeButtonGadget if the submenu associated with the CascadeButtonGadget is not currently posted or if there is no submenu associated with the CascadeButtonGadget\&. .IP "" 10 In other menus, if the pointer moves anywhere except into a submenu associated with the CascadeButtonGadget, the CascadeButtonGadget is disarmed and its submenu is unposted\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBObject\fP(3), \fBRectObj\fP(3), \fBXmCascadeButtonHighlight\fP(3), \fBXmCreateCascadeButtonGadget\fP(3), \fBXmCreatePulldownMenu\fP(3), \fBXmCreatePopupMenu\fP(3), \fBXmCreateOptionMenu\fP(3), \fBXmGadget\fP(3), \fBXmLabelGadget\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreateCascadeButtonGadget\fP(3), and \fBXmVaCreateManagedCascadeButtonGadget\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextSetSelection.30000644000175000017500000000411512672140200015573 00000000000000'\" t ...\" TxtSetSA.sgm /main/8 1996/09/08 21:20:02 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetSelection" "library call" .SH "NAME" \fBXmTextSetSelection\fP \(em A Text function that sets the primary selection of the text .iX "XmTextSetSelection" .iX "Text functions" "XmTextSetSelection" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetSelection\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBfirst\fR\fR, \fBXmTextPosition \fBlast\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetSelection\fP sets the primary selection of the text in the widget\&. It also sets the insertion cursor position to the last position of the selection and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIfirst\fP" 10 Marks the first character position of the text to be selected .IP "\fIlast\fP" 10 Marks the last position of the text to be selected .IP "\fItime\fP" 10 Specifies the time at which the selection value is desired\&. This should be the same as the time of the event that triggered this request\&. request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed\fP\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmListSelectItem.30000644000175000017500000000407212672140200015221 00000000000000'\" t ...\" LstSeleA.sgm /main/10 1996/09/08 20:51:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSelectItem" "library call" .SH "NAME" \fBXmListSelectItem\fP \(em A List function that selects an item in the list .iX "XmListSelectItem" .iX "List functions" "XmListSelectItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSelectItem\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR, \fBBoolean \fBnotify\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSelectItem\fP highlights and adds to the selected list the first item in the list that matches \fIitem\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget from whose list an item is selected\&. .IP "\fIitem\fP" 10 Specifies the item to be selected in the List widget\&. If \fIitem\fP appears more than once in the List, only the first occurrence is matched\&. .IP "\fInotify\fP" 10 Specifies a Boolean value that when TRUE invokes the selection callback for the current mode\&. From an application interface view, calling this function with \fInotify\fP True is indistinguishable from a user-initiated selection action\&. When \fInotify\fP is FALSE, no callbacks are called\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3) and \fBXmListSelectPos\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmSetProtocolHooks.30000644000175000017500000000544012672140200015610 00000000000000'\" t ...\" SetProto.sgm /main/7 1996/08/30 16:06:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSetProtocolHooks" "library call" .SH "NAME" \fBXmSetProtocolHooks\fP \(em A VendorShell function that allows preactions and postactions to be executed when a protocol message is received from MWM .iX "XmSetProtocolHooks" .iX "VendorShell functions" "XmSetProtocolHooks" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmSetProtocolHooks\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBproperty\fR\fR, \fBAtom \fBprotocol\fR\fR, \fBXtCallbackProc \fBprehook\fR\fR, \fBXtPointer \fBpre_closure\fR\fR, \fBXtCallbackProc \fBposthook\fR\fR, \fBXtPointer \fBpost_closure\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmSetProtocolHooks\fP is used by shells that want to have preactions and postactions executed when a protocol message is received from MWM\&. Since there is no guaranteed ordering in execution of event handlers or callback lists, this allows the shell to control the flow while leaving the protocol manager structures opaque\&. .PP \fBXmSetWMProtocolHooks\fP is a convenience interface\&. It calls \fBXmSetProtocolHooks\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIproperty\fP" 10 Specifies the protocol property .IP "\fIprotocol\fP" 10 Specifies the protocol atom .IP "\fIprehook\fP" 10 Specifies the procedure to call before calling entries on the client callback list .IP "\fIpre_closure\fP" 10 Specifies the client data to be passed to the prehook when it is invoked .IP "\fIposthook\fP" 10 Specifies the procedure to call after calling entries on the client callback list .IP "\fIpost_closure\fP" 10 Specifies the client data to be passed to the posthook when it is invoked .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmInternAtom\fP(3), and \fBXmSetWMProtocolHooks\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextFieldClearSelection.30000644000175000017500000000326312672140200017035 00000000000000'\" t ...\" TxtFieAB.sgm /main/8 1996/09/08 21:12:37 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldClearSelection" "library call" .SH "NAME" \fBXmTextFieldClearSelection\fP \(em A TextField function that clears the primary selection .iX "XmTextFieldClearSelection" .iX "TextField functions" "XmTextFieldClearSelection" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldClearSelection\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldClearSelection\fP clears the primary selection in the TextField widget\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .IP "\fItime\fP" 10 Specifies the time at which the selection value is desired\&. This should be the time of the event that triggered this request\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmCreateFormDialog.30000644000175000017500000000452212672140200015476 00000000000000'\" t ...\" CreFoB.sgm /main/7 1996/08/30 14:37:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateFormDialog" "library call" .SH "NAME" \fBXmCreateFormDialog\fP \(em A Form FormDialog convenience creation function .iX "XmCreateFormDialog" .iX "creation functions" "XmCreateFormDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateFormDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateFormDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged Form child of the DialogShell\&. A FormDialog is used for interactions not supported by the standard dialog set\&. This function does not automatically create any labels, buttons, or other dialog components\&. Such components should be added by the application after the FormDialog is created\&. .PP Use \fBXtManageChild\fP to pop up the FormDialog (passing the Form as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateFormDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Form and its associated resources, see \fBXmForm\fP(3)\&. .SH "RETURN" .PP Returns the Form widget ID\&. .SH "RELATED" .PP \fBXmForm\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/MrmInitialize.30000644000175000017500000000342312672140200014576 00000000000000'\" t ...\" Initiali.sgm /main/8 1996/09/08 21:25:38 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmInitialize" "library call" .SH "NAME" \fBMrmInitialize\fP \(em Prepares an application to use MRM widget-fetching facilities .iX "MrmInitialize" .iX "uil functions" "MrmInitialize" .SH "SYNOPSIS" .PP .nf \fBvoid \fBMrmInitialize\fP\fR(\fBvoid\fR) .fi .iX "MRM function" "MrmInitialize" .iX "MrmInitialize" "definition" .SH "DESCRIPTION" .PP The \fBMrmInitialize\fP function must be called to prepare an application to use MRM widget-fetching facilities\&. You must call this function prior to fetching a widget\&. However, it is good programming practice to call \fBMrmInitialize\fP prior to performing any MRM operations\&. .PP \fBMrmInitialize\fP initializes .iX "MrmInitialize" "description" the internal data structures that MRM needs to successfully perform type conversion on arguments and to successfully access widget creation facilities\&. An application must call \fBMrmInitialize\fP before it uses other MRM functions\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmClipboardInquireCount.30000644000175000017500000000627712672140200016605 00000000000000'\" t ...\" ClipbF.sgm /main/11 1996/09/25 10:24:13 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardInquireCount" "library call" .SH "NAME" \fBXmClipboardInquireCount\fP \(em A clipboard function that returns the number of data item formats .iX "XmClipboardInquireCount" .iX "clipboard functions" "XmClipboardInquireCount" .SH "SYNOPSIS" .PP .nf #include int XmClipboardInquireCount (\fIdisplay, window, count, max_format_name_length\fP) Display \fI* display\fP; Window \fIwindow\fP; int \fI* count\fP; unsigned long \fI* max_format_name_length\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardInquireCount\fP returns the number of data item formats available for the data item in the clipboard\&. This function also returns the maximum name-length for all formats in which the data item is stored\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIcount\fP" 10 Returns the number of data item formats available for the data item in the clipboard\&. If no formats are available, this argument equals 0 (zero)\&. The count includes the formats that were passed by name\&. .IP "\fImax_format_name_length\fP" 10 Specifies the maximum length of all format names for the data item in the clipboard\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardNoData\fP" 10 The function could not find data on the clipboard corresponding to the format requested\&. This could occur because the clipboard is empty; there is data on the clipboard, but not in the requested format; or the data in the requested format was passed by name and is no longer available\&. .SH "RELATED" .PP \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmCreateDropDownList.30000644000175000017500000000351612672140200016045 00000000000000'\" t ...\" CreDrE.sgm /main/8 1996/08/31 17:35:19 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateDropDownList" "library call" .SH "NAME" \fBXmCreateDropDownList\fP \(em The Drop-down list ComboBox widget creation function .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateDropDownList\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBarg_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateDropDownList\fP creates an instance of a ComboBox widget of \fBXmNcomboBoxType\fP \fBXmDROP_DOWN_LIST\fP and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fBarg_count\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of ComboBox and its associated resources, see \fBXmComboBox\fP(3)\&. .SH "RETURN" .PP Returns the ComboBox widget ID\&. .SH "RELATED" .PP \fBXmComboBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmMainWindowSep2.30000644000175000017500000000374012672140200015136 00000000000000'\" t ...\" MainWinC.sgm /main/8 1996/09/08 20:53:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMainWindowSep2" "library call" .SH "NAME" \fBXmMainWindowSep2\fP \(em A MainWindow function that returns the widget ID of the second Separator widget .iX "XmMainWindowSep2" .iX "MainWindow functions" "XmMainWindowSep2" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmMainWindowSep2\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMainWindowSep2\fP returns the widget ID of the second Separator in the MainWindow\&. The second Separator is located between the Command widget and the ScrolledWindow\&. This Separator is visible only when \fBXmNshowSeparator\fP is True\&. .PP \fBNOTE:\fP \fBXmMainWindowSep2\fP is obsolete and exists for compatibility with previous releases\&. Use \fBXtNameToWidget\fP instead\&. Pass a MainWindow variable as the first argument to \fBXtNameToWidget\fP and pass \fBSeparator2\fP as the second argument\&. .IP "\fIwidget\fP" 10 Specifies the MainWindow widget ID .PP For a complete definition of MainWindow and its associated resources, see \fBXmMainWindow\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the second Separator\&. .SH "RELATED" .PP \fBXmMainWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmTextGetSelection.30000644000175000017500000000340212672140200015555 00000000000000'\" t ...\" TxtGetSA.sgm /main/8 1996/09/08 21:17:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetSelection" "library call" .SH "NAME" \fBXmTextGetSelection\fP \(em A Text function that retrieves the value of the primary selection .iX "XmTextGetSelection" .iX "Text functions" "XmTextGetSelection" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmTextGetSelection\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetSelection\fP retrieves the value of the primary selection\&. It returns a NULL pointer if no text is selected in the widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns a character pointer to the string that is associated with the primary selection\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextGetSelectionWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmCreateSimpleOptionMenu.30000644000175000017500000000613212672140200016721 00000000000000'\" t ...\" CreSiC.sgm /main/7 1996/08/30 14:54:35 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSimpleOptionMenu" "library call" .SH "NAME" \fBXmCreateSimpleOptionMenu\fP \(em A RowColumn widget convenience creation function .iX "XmCreateSimpleOptionMenu" .iX "creation functions" "XmCreateSimpleOptionMenu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSimpleOptionMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSimpleOptionMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_OPTION\fP and returns the associated widget ID\&. .PP This routine creates an OptionMenu and its submenu containing PushButtonGadget or CascadeButtonGadget children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. The name of each separator is \fBseparator_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of separators in the menu minus 1\&. Buttons and separators are named and created in the order they are specified in the RowColumn simple menu creation resources supplied in the argument list\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of an OptionMenu\&. These widgets (or gadgets) and the associated OptionMenu areas are .IP "Option Menu Label Gadget" 10 \fBOptionLabel\fP .IP "Option Menu Cascade Button" 10 \fBOptionButton\fP .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. The only button types allowed in the \fBXmNbuttonType\fP resource are \fBXmPUSHBUTTON\fP, \fBXmCASCADEBUTTON\fP, \fBXmSEPARATOR\fP, and \fBXmDOUBLE_SEPARATOR\fP\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateOptionMenu\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimpleOptionMenu\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmTextSetSource.30000644000175000017500000000517512672140200015115 00000000000000'\" t ...\" TxtSetSB.sgm /main/8 1996/09/08 21:20:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetSource" "library call" .SH "NAME" \fBXmTextSetSource\fP \(em A Text function that sets the source of the widget .iX "XmTextSetSource" .iX "Text functions" "XmTextSetSource" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetSource\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextSource \fBsource\fR\fR, \fBXmTextPosition \fBtop_character\fR\fR, \fBXmTextPosition \fBcursor_position\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetSource\fP sets the source of the Text widget\&. Text widgets can share sources of text so that editing in one widget is reflected in another\&. This function sets the source of one widget so that it can share the source of another widget\&. .PP Setting a new text source destroys the old text source if no other Text widgets are using that source\&. To replace a text source but keep it for later use, create an unmanaged Text widget and set its source to the text source you want to keep\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fIsource\fP" 10 Specifies the source with which the widget displays text\&. This can be a value returned by the \fBXmTextGetSource\fP(3) function\&. If no source is specified, the widget creates a default string source\&. .IP "\fItop_character\fP" 10 Specifies the position in the text to display at the top of the widget\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fIcursor_position\fP" 10 Specifies the position in the text at which the insert cursor is located\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmIsTraversable.30000644000175000017500000000603412672140200015075 00000000000000'\" t ...\" IsTraver.sgm /main/8 1996/09/08 20:49:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmIsTraversable" "library call" .SH "NAME" \fBXmIsTraversable\fP \(em A function that identifies whether a widget can be traversed .iX "XmIsTraversable" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmIsTraversable\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmIsTraversable\fP determines whether the specified widget is eligible to receive focus through keyboard traversal\&. In general, a widget is eligible to receive focus when all of the following conditions are true: .IP " \(bu" 6 The widget and its ancestors are not being destroyed, are sensitive, and have a value of True for \fBXmNtraversalOn\fP\&. .IP " \(bu" 6 The widget and its ancestors are realized, managed, and (except for gadgets) mapped\&. If an application unmaps a \fIwidget\fP that has its \fBXmNmappedWhenManaged\fP resource set to True, the return value is undefined\&. .IP " \(bu" 6 Some part of the widget\&'s rectangular area is unobscured by the widget\&'s ancestors, or some part of the widget\&'s rectangular area is inside the work window (but possibly outside the clip window) of a ScrolledWindow whose \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP and whose \fBXmNtraverseObscuredCallback\fP is not NULL\&. .PP Some widgets may not be eligible to receive focus even if they meet all these conditions\&. For example, most managers cannot receive focus through keyboard traversal\&. Some widgets may be eligible to receive focus under particular conditions\&. For example, a DrawingArea is eligible to receive focus if it meets the conditions above and has no child whose \fBXmNtraversalOn\fP resource is True\&. .PP Note that when all widgets in a shell hierarchy have been made untraversable, they are considered to have lost focus\&. When a widget in this hierarchy is made traversable again, it regains focus\&. .PP \fBXmIsTraversable\fP may return unexpected results when \fIwidget\fP or its ancestors are overlapped by their siblings\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget .SH "RETURN" .PP Returns True if the widget is eligible to receive focus through keyboard traversal; otherwise, returns False\&. .SH "RELATED" .PP \fBXmGetVisibility\fP(3) and \fBXmProcessTraversal\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmClipboardCopy.30000644000175000017500000001142712672140200015063 00000000000000'\" t ...\" ClipbB.sgm /main/10 1996/09/25 10:23:42 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardCopy" "library call" .SH "NAME" \fBXmClipboardCopy\fP \(em A clipboard function that copies a data item to temporary storage for later copying to clipboard .iX "XmClipboardCopy" .iX "clipboard functions" "XmClipboardCopy" .SH "SYNOPSIS" .PP .nf #include int XmClipboardCopy (\fIdisplay, window, item_id, format_name, buffer, length, private_id, data_id\fP) Display \fI* display\fP; Window \fIwindow\fP; long \fIitem_id\fP; char \fI* format_name\fP; XtPointer \fIbuffer\fP; unsigned long \fIlength\fP; long \fIprivate_id\fP; long \fI* data_id\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardCopy\fP copies a data item to temporary storage\&. The data item is moved from temporary storage to the clipboard data structure when a call to \fBXmClipboardEndCopy\fP is made\&. Additional calls to \fBXmClipboardCopy\fP before a call to \fBXmClipboardEndCopy\fP add additional data item formats to the same data item or append data to an existing format\&. Formats are described in the \fIInter-Client Communication Conventions Manual\fP (ICCCM) as targets\&. .PP \fBNOTE:\fP Do not call \fBXmClipboardCopy\fP before a call to \fBXmClipboardStartCopy\fP has been made\&. The latter function allocates temporary storage required by \fBXmClipboardCopy\fP\&. .PP If the \fIbuffer\fP argument is NULL, the data is considered to be passed by name\&. When data that has been passed by name is later requested by another application, the application that owns the data receives a callback with a request for the data\&. The application that owns the data must then transfer the data to the clipboard with the \fBXmClipboardCopyByName\fP function\&. When a data item that was passed by name is deleted from the clipboard, the application that owns the data receives a callback stating that the data is no longer needed\&. .PP For information on the callback function, see the callback argument description for \fBXmClipboardStartCopy\fP\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIitem_id\fP" 10 Specifies the number assigned to this data item\&. This number was returned by a previous call to \fBXmClipboardStartCopy\fP\&. .IP "\fIformat_name\fP" 10 Specifies the name of the format in which the data item is stored on the clipboard\&. The format was known as target in the ICCCM\&. .IP "\fIbuffer\fP" 10 Specifies the buffer from which the clipboard copies the data\&. .IP "\fIlength\fP" 10 Specifies the length, in bytes, of the data being copied to the clipboard\&. .IP "\fIprivate_id\fP" 10 Specifies the private data that the application wants to store with the data item\&. .IP "\fIdata_id\fP" 10 Specifies an identifying number assigned to the data item that uniquely identifies the data item and the format\&. This argument is required only for data that is passed by name\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardFail\fP" 10 The function failed because \fBXmClipboardStartCopy\fP was not called or because the data item contains too many formats\&. .SH "RELATED" .PP \fBXmClipboardCopyByName\fP(3), \fBXmClipboardEndCopy\fP(3), and \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmInstallImage.30000644000175000017500000000660112672140200014700 00000000000000'\" t ...\" InstIm.sgm /main/9 1996/09/08 20:49:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmInstallImage" "library call" .SH "NAME" \fBXmInstallImage\fP \(em A pixmap caching function that adds an image to the image cache .iX "XmInstallImage" .iX "pixmaps" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmInstallImage\fP\fR( \fBXImage \fB* image\fR\fR, \fBchar \fB* image_name\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmInstallImage\fP stores an image in an image cache that can later be used to generate a pixmap\&. Part of the installation process is to extend the resource converter used to reference these images\&. The resource converter is given the image name so that the image can be referenced in a \fB\&.Xdefaults\fP file\&. Since an image can be referenced by a widget through its pixmap resources, it is up to the application to ensure that the image is installed before the widget is created\&. .IP "\fIimage\fP" 10 Points to the image structure to be installed\&. The installation process does not make a local copy of the image\&. Therefore, the application should not destroy the image until it is uninstalled from the caching functions\&. .IP "\fIimage_name\fP" 10 Specifies a string that the application uses to name the image\&. After installation, this name can be used in \fB\&.Xdefaults\fP for referencing the image\&. A local copy of the name is created by the image caching functions\&. .PP The image caching functions provide a set of eight preinstalled images\&. These names can be used within a \fB\&.Xdefaults\fP file for generating pixmaps for the resource for which they are provided\&. .TS tab() box; l| l. \fBImage Name\fP\fBDescription\fP __ backgroundA tile of solid background __ 25_foregroundT{ A tile of 25% foreground, 75% background T} __ 50_foregroundT{ A tile of 50% foreground, 50% background T} __ 75_foregroundT{ A tile of 75% foreground, 25% background T} __ horizontalT{ A tile of horizontal lines of the two colors T} __ verticalT{ A tile of vertical lines of the two colors T} __ slant_rightT{ A tile of slanting lines of the two colors T} __ slant_leftT{ A tile of slanting lines of the two colors T} __ menu_cascadeT{ A tile of an arrow of the foreground color T} __ menu_checkmarkT{ A tile of a checkmark of the foreground color T} __ menu_dashT{ A tile of one horizontal line of the foreground color T} __ .TE .SH "RETURN" .PP Returns True when successful; returns False if NULL \fIimage\fP, NULL \fIimage_name\fP, or duplicate \fIimage_name\fP is used as a parameter value\&. .SH "RELATED" .PP \fBXmUninstallImage\fP(3), \fBXmGetPixmap\fP(3), and \fBXmDestroyPixmap\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmVaCreateManagedScale.30000644000175000017500000000003312672140200016237 00000000000000.so man3/XmVaCreateScale.3 motif-2.3.8/doc/man/man3/XmVaCreateArrowButton.30000644000175000017500000000272412672140200016232 00000000000000.DT .TH "XmVaCreateArrowButton" "library call" .SH "NAME" \fBXmVaCreateArrowButton\fP, \fBXmVaCreateManagedArrowButton\fP \(em A ArrowButton widget convenience creation functions\&. .iX "XmVaCreateArrowButton" "XmVaCreateManagedArrowButton" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateArrowButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedArrowButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ArrowButton widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateArrowButton\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedArrowButton\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ArrowButton and its associated resources, see \fBXmArrowButton\fP(3)\&. .SH "RETURN" .PP Returns the ArrowButton widget ID\&. .SH "RELATED" .PP \fBXmArrowButton\fP(3), \fBXmCreateArrowButton\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmImUnregister.30000644000175000017500000000321212672140200014737 00000000000000'\" t ...\" ImUnreg.sgm /main/9 1996/09/08 20:48:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImUnregister" "library call" .SH "NAME" \fBXmImUnregister\fP \(em An input manager function that removes a widget from association with its input manager .iX "XmImUnregister" .iX "input manager functions" "XmImUnregister" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImUnregister\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImUnregister\fP removes the specified widget from the list of widgets registered for input by the input manager\&. .PP Note that the Text, TextField, and List widgets already call the \fBXmImRegister\fP internally\&. You should call the \fBXmImUnregister\fP function for these widgets before calling \fBXmImRegister\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget to be unregistered .SH "RELATED" .PP \fBXmImRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmVaCreateManagedDrawingArea.30000644000175000017500000000004112672140200017373 00000000000000.so man3/XmVaCreateDrawingArea.3 motif-2.3.8/doc/man/man3/XmDataFieldGetString.30000644000175000017500000000346212672140200015775 00000000000000'\" t ...\" TxtFieAN.sgm /main/8 1996/09/08 21:13:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldGetString" "library call" .SH "NAME" \fBXmDataFieldGetString\fP \(em A DataField function that accesses the string value .iX "XmDataFieldGetString" .iX "DataField functions" "XmDataFieldGetString" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmDataFieldGetString\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldGetString\fP accesses the string value of the DataField widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP Returns a character pointer to the string value of the DataField widget\&. This returned value is a copy of the value of the \fBXmNvalue\fP resource\&. Returns an empty string if the length of the DataField widget\&'s string is 0 (zero)\&. .SH "RELATED" .PP \fBXmDataField\fP(3) and \fBXmDataFieldGetStringWcs\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateForm.30000644000175000017500000000340012672140200014350 00000000000000'\" t ...\" CreFoA.sgm /main/7 1996/08/30 14:37:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateForm" "library call" .SH "NAME" \fBXmCreateForm\fP \(em The Form widget creation function .iX "XmCreateForm" .iX "creation functions" "XmCreateForm" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateForm\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateForm\fP creates an instance of a Form widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Form and its associated resources, see \fBXmForm\fP(3)\&. .SH "RETURN" .PP Returns the Form widget ID\&. .SH "RELATED" .PP \fBXmForm\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmVaCreateColorSelector.30000644000175000017500000000276412672140200016527 00000000000000.DT .TH "XmVaCreateColorSelector" "library call" .SH "NAME" \fBXmVaCreateColorSelector\fP, \fBXmVaCreateManagedColorSelector\fP \(em A ColorSelector widget convenience creation functions\&. .iX "XmVaCreateColorSelector" "XmVaCreateManagedColorSelector" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateColorSelector\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedColorSelector\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ColorSelector widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateColorSelector\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreatemanagedColorSelector\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ColorSelector and its associated resources, see \fBXmColorSelector\fP(3)\&. .SH "RETURN" .PP Returns the ColorSelector widget ID\&. .SH "RELATED" .PP \fBXmColorSelector\fP(3), \fBXmCreateColorSelector\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateOutline.30000644000175000017500000000262512672140200015363 00000000000000.DT .TH "XmVaCreateOutline" "library call" .SH "NAME" \fBXmVaCreateOutline\fP, \fBXmVaCreateManagedOutline\fP \(em A Outline widget convenience creation functions\&. .iX "XmVaCreateOutline" "XmVaCreateManagedOutline" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateOutline\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedOutline\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Outline widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateOutline\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedOutline\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Outline and its associated resources, see \fBXmOutline\fP(3)\&. .SH "RETURN" .PP Returns the Outline widget ID\&. .SH "RELATED" .PP \fBXmCreateOutline\fP(3), \fBXtCreateWidget\fP(3), \fBXtCreateManagedWidget\fP(3), and \fBXmOutline\fP(3)\&. motif-2.3.8/doc/man/man3/XmStringConcatAndFree.30000644000175000017500000000441312672140200016151 00000000000000'\" t ...\" StrCoE.sgm /main/8 1996/09/08 21:03:37 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringConcatAndFree" "library call" .SH "NAME" \fBXmStringConcatAndFree\fP \(em A compound string function that appends one string to another and frees the original strings .iX "XmStringConcatAndFree" .iX "compound string functions" "XmStringConcatAndFree" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringConcatAndFree\fP\fR( \fBXmString \fBs1\fR\fR, \fBXmString \fBs2\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringConcatAndFree\fP copies \fIs2\fP to the end of \fIs1\fP and returns a copy of the resulting compound string\&. The original strings are freed\&. The function will allocate space to hold the returned compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fIs1\fP" 10 Specifies the compound string to which a copy of \fIs2\fP is appended .IP "\fIs2\fP" 10 Specifies the compound string that is appended to the end of \fIs1\fP .PP The \fBXmStringConcatAndFree\fP function works like the \fBXmStringConcat\fP function, except that it frees the \fIs1\fP and \fIs2\fP strings, and is therefore more efficient\&. You should use \fBXmStringConcatAndFree\fP instead of \fBXmStringConcat\fP if you want \fIs1\fP and \fIs2\fP to be freed afterwards\&. .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringConcat\fP(3), \fBXmStringCreate\fP(3), and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextFieldGetSelectionWcs.30000644000175000017500000000366412672140200017210 00000000000000'\" t ...\" TxtFieAM.sgm /main/8 1996/09/08 21:13:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetSelectionWcs" "library call" .SH "NAME" \fBXmTextFieldGetSelectionWcs\fP \(em A TextField function that retrieves the value of a wide character encoded primary selection .iX "XmTextFieldGetSelection\\%Wcs" .iX "TextField functions" "XmTextFieldGetSelection\\%Wcs" .SH "SYNOPSIS" .PP .nf #include \fBwchar_t * \fBXmTextFieldGetSelectionWcs\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetSelectionWcs\fP retrieves the value of the primary selection, encoded in a wide character format\&. It returns a NULL pointer if no text is selected in the widget\&. The application is responsible for freeing the storage associated with the wide character buffer by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns the wide character string that is associated with the primary selection in the TextField widget\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldGetSelection\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmFontListRemoveEntry.30000644000175000017500000000510612672140200016270 00000000000000'\" t ...\" FontLstW.sgm /main/9 1996/09/08 20:44:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListRemoveEntry" "library call" .SH "NAME" \fBXmFontListRemoveEntry\fP \(em A font list function that removes a font list entry from a font list .iX "XmFontListRemoveEntry" .iX "font list functions" "XmFontListRemoveEntry" .SH "SYNOPSIS" .PP .nf #include \fBXmFontList \fBXmFontListRemoveEntry\fP\fR( \fBXmFontList \fBoldlist\fR\fR, \fBXmFontListEntry \fBentry\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListRemoveEntry\fP creates a new font list that contains the contents of \fIoldlist\fP minus those entries specified in \fIentry\fP\&. The routine removes any entries from \fIoldlist\fP that match the components (tag, type font/font set) of the specified entry\&. The function deallocates the original font list after extracting the required information\&. The caller uses \fBXmFontListEntryFree\fP to recover memory allocated for the specified entry\&. This routine does not free the \fBXFontSet\fP or \fBXFontStruct\fP associated with the font list entry that is removed\&. .IP "\fIoldlist\fP" 10 Specifies the font list .IP "\fIentry\fP" 10 Specifies the font list entry to be removed .SH "RETURN" .PP If \fIoldlist\fP is NULL, the function returns NULL\&. If \fIentry\fP is NULL or no entries are removed, the function returns \fIoldlist\fP\&. Otherwise, it returns a new font list\&. If the function returns a new font list, the function allocates space to hold the new font list\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmFontListFree\fP\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryFree\fP(3), \fBXmFontListEntryLoad\fP(3), and \fBXmFontListFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmTextFieldGetSelectionPosition.30000644000175000017500000000443412672140200020254 00000000000000'\" t ...\" TxtFieAL.sgm /main/8 1996/09/08 21:13:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetSelectionPosition" "library call" .SH "NAME" \fBXmTextFieldGetSelectionPosition\fP \(em A TextField function that accesses the position of the primary selection .iX "XmTextFieldGetSelection\\%Position" .iX "TextField functions" "XmTextFieldGetSelection\\%Position" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldGetSelectionPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fB*left\fR\fR, \fBXmTextPosition \fB*right\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetSelectionPosition\fP accesses the left and right position of the primary selection in the text buffer of the TextField widget\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIleft\fP" 10 Specifies the pointer in which the position of the left boundary of the primary selection is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .IP "\fIright\fP" 10 Specifies the pointer in which the position of the right boundary of the primary selection is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns True if the widget owns the primary selection; otherwise, it returns False\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmStringPeekNextTriple.30000644000175000017500000000332312672140200016417 00000000000000'\" t ...\" StrPeB.sgm /main/8 1996/08/30 16:13:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringPeekNextTriple" "library call" .SH "NAME" \fBXmStringPeekNextTriple\fP \(em A function that returns the component type of the next component .iX "XmStringPeekNextTriple" .SH "SYNOPSIS" .PP .nf #include \fBXmStringComponentType \fBXmStringPeekNextTriple\fP\fR( \fBXmStringContext \fBcontext\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringPeekNextTriple\fP examines the next component that would be fetched by \fBXmStringGetNextTriple\fP and returns the component type\&. .IP "\fIcontext\fP" 10 Specifies the string context structure that was allocated by the \fBXmStringInitContext\fP function\&. .SH "RETURN" .PP Returns the type of the component found\&. Refer to the \fBXmStringComponentType\fP(3) reference page for a list of component types\&. .SH "RELATED" .PP \fBXmString\fP(3), \fBXmStringComponentType\fP(3), and \fBXmStringGetNextTriple\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmTextSetInsertionPosition.30000644000175000017500000000353412672140200017351 00000000000000'\" t ...\" TxtSetIn.sgm /main/8 1996/09/08 21:19:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetInsertionPosition" "library call" .SH "NAME" \fBXmTextSetInsertionPosition\fP \(em A Text function that sets the position of the insert cursor .iX "XmTextSetInsertionPosition" .iX "Text functions" "XmTextSetInsertionPosition" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetInsertionPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetInsertionPosition\fP sets the insertion cursor position of the Text widget\&. This routine also calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks if the insertion cursor position changes\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIposition\fP" 10 Specifies the position of the insertion cursor\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmClipboardRetrieve.30000644000175000017500000001152012672140200015730 00000000000000'\" t ...\" ClipbL.sgm /main/10 1996/09/25 10:24:57 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardRetrieve" "library call" .SH "NAME" \fBXmClipboardRetrieve\fP \(em A clipboard function that retrieves a data item from the clipboard .iX "XmClipboardRetrieve" .iX "clipboard functions" "XmClipboardRetrieve" .SH "SYNOPSIS" .PP .nf #include int XmClipboardRetrieve (\fIdisplay, window, format_name, buffer, length, num_bytes, private_id\fP) Display \fI* display\fP; Window \fIwindow\fP; char \fI* format_name\fP; XtPointer \fIbuffer\fP; unsigned long \fIlength\fP; unsigned long \fI* num_bytes\fP; long \fI* private_id\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardRetrieve\fP retrieves the current data item from clipboard storage\&. It returns a warning if the clipboard is locked, if there is no data on the clipboard, or if the data needs to be truncated because the buffer length is too short\&. .PP Between a call to \fBXmClipboardStartRetrieve\fP and a call to \fBXmClipboardEndRetrieve\fP, multiple calls to \fBXmClipboardRetrieve\fP with the same format name result in data being incrementally copied from the clipboard until the data in that format has all been copied\&. .PP The return value \fBXmClipboardTruncate\fP from calls to \fBXmClipboardRetrieve\fP indicates that more data remains to be copied in the given format\&. It is recommended that any calls to the \fBInquire\fP functions that the application needs to make to effect the copy from the clipboard be made between the call to \fBXmClipboardStartRetrieve\fP and the first call to \fBXmClipboardRetrieve\fP\&. This way, the application does not need to call \fBXmClipboardLock\fP and \fBXmClipboardUnlock\fP\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIformat_name\fP" 10 Specifies the name of a format in which the data is stored on the clipboard\&. .IP "\fIbuffer\fP" 10 Specifies the buffer to which the application wants the clipboard to copy the data\&. The function allocates space to hold the data returned into the buffer\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXtFree\fP\&. .IP "\fIlength\fP" 10 Specifies the length of the application buffer\&. .IP "\fInum_bytes\fP" 10 Specifies the number of bytes of data copied into the application buffer\&. .IP "\fIprivate_id\fP" 10 Specifies the private data stored with the data item by the application that placed the data item on the clipboard\&. If the application did not store private data with the data item, this argument returns 0 (zero)\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardTruncate\fP" 10 The data returned is truncated because the user did not provide a buffer large enough to hold the data\&. .IP "\fBXmClipboardNoData\fP" 10 The function could not find data on the clipboard corresponding to the format requested\&. This could occur because the clipboard is empty; there is data on the clipboard but not in the requested format; or the data in the requested format was passed by name and is no longer available\&. .SH "RELATED" .PP \fBXmClipboardEndRetrieve\fP(3), \fBXmClipboardLock\fP(3), \fBXmClipboardStartCopy\fP(3), \fBXmClipboardStartRetrieve\fP(3), and \fBXmClipboardUnlock\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmSetWMProtocolHooks.30000644000175000017500000000470712672140200016061 00000000000000'\" t ...\" SetWMPro.sgm /main/7 1996/08/30 16:06:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSetWMProtocolHooks" "library call" .SH "NAME" \fBXmSetWMProtocolHooks\fP \(em A VendorShell convenience interface that allows preactions and postactions to be executed when a protocol message is received from the window manager .iX "XmSetWMProtocolHooks" .iX "VendorShell functions" "XmSetWMProtocolHooks" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmSetWMProtocolHooks\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBprotocol\fR\fR, \fBXtCallbackProc \fBprehook\fR\fR, \fBXtPointer \fBpre_closure\fR\fR, \fBXtCallbackProc \fBposthook\fR\fR, \fBXtPointer \fBpost_closure\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmSetWMProtocolHooks\fP is a convenience interface\&. It calls \fBXmSetProtocolHooks\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIprotocol\fP" 10 Specifies the protocol atom (or an \fIint\fP cast to \fBAtom\fP) .IP "\fIprehook\fP" 10 Specifies the procedure to call before calling entries on the client callback list .IP "\fIpre_closure\fP" 10 Specifies the client data to be passed to the prehook when it is invoked .IP "\fIposthook\fP" 10 Specifies the procedure to call after calling entries on the client callback list .IP "\fIpost_closure\fP" 10 Specifies the client data to be passed to the posthook when it is invoked .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmInternAtom\fP(3), and \fBXmSetProtocolHooks\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmVaCreateColumn.30000644000175000017500000000260412672140200015176 00000000000000.DT .TH "XmVaCreateColumn" "library call" .SH "NAME" \fBXmVaCreateColumn\fP, \fBXmVaCreateManagedColumn\fP \(em A Column widget convenience creation functions\&. .iX "XmVaCreateColumn" "XmVaCreateManagedColumn" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateColumn\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedColumn\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Column widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateColumn\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedColumn\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Column and its associated resources, see \fBXmColumn\fP(3)\&. .SH "RETURN" .PP Returns the Column widget ID\&. .SH "RELATED" .PP \fBXmColumn\fP(3), \fBXmCreateColumn\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreatePushButtonGadget.30000644000175000017500000000361312672140200016702 00000000000000'\" t ...\" CrePuC.sgm /main/7 1996/08/30 14:48:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreatePushButtonGadget" "library call" .SH "NAME" \fBXmCreatePushButtonGadget\fP \(em The PushButtonGadget creation function .iX "XmCreatePushButtonGadget" .iX "creation functions" "XmCreatePushButtonGadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreatePushButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreatePushButtonGadget\fP creates an instance of a PushButtonGadget widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of PushButtonGadget and its associated resources, see \fBXmPushButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the PushButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmPushButtonGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmCreateSelectionDialog.30000644000175000017500000000544012672140200016520 00000000000000'\" t ...\" CreSeB.sgm /main/7 1996/08/30 14:52:30 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSelectionDialog" "library call" .SH "NAME" \fBXmCreateSelectionDialog\fP \(em The SelectionBox SelectionDialog convenience creation function .iX "XmCreateSelectionDialog" .iX "creation functions" "XmCreateSelectionDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSelectionDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSelectionDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged SelectionBox child of the DialogShell\&. A SelectionDialog offers the user a choice from a list of alternatives and gets a selection\&. It includes the following: .IP " \(bu" 6 A scrolling list of alternatives .IP " \(bu" 6 An editable text field for the selected alternative .IP " \(bu" 6 Labels for the text field .IP " \(bu" 6 Four buttons .PP The default button labels are \fBOK\fP, \fBCancel\fP, \fBApply\fP, and \fBHelp\fP\&. One additional \fBWorkArea\fP child may be added to the SelectionBox after creation\&. .PP \fBXmCreateSelectionDialog\fP forces the value of the SelectionBox resource \fBXmNdialogType\fP to \fBXmDIALOG_SELECTION\fP\&. .PP \fBXmCreateSelectionDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .PP Use \fBXtManageChild\fP to pop up the SelectionDialog (passing the SelectionBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of SelectionBox and its associated resources, see \fBXmSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the SelectionBox widget ID\&. .SH "RELATED" .PP \fBXmSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmSlideContext.30000644000175000017500000001037412672140200014736 00000000000000...\" ** $Id: XmSlideContext.3,v 1.1 2002/01/10 20:56:16 jimk Exp $ ...\" ** .TH XmSlideContext 3X "" "" "" "" .ds )H Rick Scott .ds ]W LessTifExtensions Version 8.0.8 .SH NAME \fIXmSlideContext\fP \- The SlideContext widget class .SH SYNOPSIS .nf .sS .iS \&#include .iE .sE .SH DESCRIPTION .fi SlideContext can be used to change a widgets geometry over a period of time. .PP Next paragraph .PP Next paragraph .SS "Classes" SlideContext inherits behavior and resources from the \fIObject\fP class. .PP The class pointer is \fIXmSlideContextWidgetClass\fP. .PP The class name is \fIXmSlideContext\fP. .SS "New Resources" The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the \fIXmN\fP or \fIXmC\fP prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the \fIXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fIXtSetValues\fP (S), retrieved by using \fIXtGetValues\fP (G), or is not applicable (N/A). .P .sp 1 .in 0 .KS .TS center; cBp7 ssss lBp6 lBp6 lBp6 lBp6 lBp6 lp6 lp6 lp6 lp6 lp6. XmSlideContext Resource Set Name Class Type Default Access _ XmNslideDestHeight XtCSlideDestHeight Dimension variable C XmNslideDestWidth XtCSlideDestWidth Dimension variable C XmNslideDestX XtCSlideDestX Position variable C XmNslideDestY XtCSlideDestY Position variable C XmNslideFinishCallback XtCCallback XtCallbackList NULL C XmNslideInterval XtCSlideInterval int 5 C XmNslideMotionCallback XtCCallback XtCallbackList NULL C XmNslideWidget XtCSlideWidget Widget NULL C .TE .KE .in .sp 1 .IP "\fIXmNslideDestHeight\fP" If not specified, the current height of XmNslideWidget is used. .IP "\fIXmNslideDestWidth\fP" If not specified, the current width of XmNslideWidget is used. .IP "\fIXmNslideDestX\fP" If not specified, the current x of XmNslideWidget is used. .IP "\fIXmNslideDestY\fP" If not specified, the current y of XmNslideWidget is used. .IP "\fIXmNslideFinishCallback\fP" Specifies the list of callbacks that is called when the XmNslideWidget reaches it's destination. .IP "\fIXmNslideInterval\fP" The time between each geometry change. A value of 0 will set the destination values on the first iteration. .IP "\fIXmNslideMotionCallback\fP" Specifies the list of callbacks that is called when the widget geometry changes. .IP "\fIXmNslideWidget\fP" The widget to alter. This _must_ be specified during creation. .SS "Inherited Resources" SlideContext inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the man page for that superclass. .P .sp 1 .in 0 .KS .TS center; cBp7 ssss lBp6 lBp6 lBp6 lBp6 lBp6 lp6 lp6 lp6 lp6 lp6. Object Resource Set Name Class Type Default Access _ XmNdestroyCallback XmCCallback XtCallbackList NULL C XmNscreen XmCScreen Screen * dynamic CG .wH .tH .TE .KE .in .sp 1 .wH .in ...\" ** ...\" .SS "Callback Information" ...\" A pointer to the following structure is passed to each callback: ...\" .sS ...\" .iS ...\" .ta .25i 1.1i ...\" .nf ...\" typedef struct ...\" { ...\" int \fBreason\fI; ...\" } XmSlideContextCallbackStruct; ...\" .iE ...\" .sE ...\" .wH ...\" .fi ...\" .IP "\fBreason\fP" ...\" Indicates why the callback was invoked .SS "Behavior" XmSlideContext behavior is described below: XmSlideContext installs an Xt timer that is called every XmNslideInterval miliseconds. At each call of the timer proc the XmNslideWidget geometry is adjusted such that the X/Y/Width/Height are 10 percent closer to the final values. The XmSlideContext is automatically destroyed when the XmNslideWidget reaches its destination. If the XmNslideWidget is destroyed before the slide is finished, the XmSlideContext is destroyed. .SS "Virtual Bindings" The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see \fIVirtualBindings(3X)\fP. .SH RELATED INFORMATION .na \fIObject(3X)\fP, .ad motif-2.3.8/doc/man/man3/XmVaCreateManagedToggleButton.30000644000175000017500000000004212672140200017625 00000000000000.so man3/XmVaCreateToggleButton.3 motif-2.3.8/doc/man/man3/XmVaCreateToggleButtonGadget.30000644000175000017500000000314412672140200017472 00000000000000.DT .TH "XmVaCreateToggleButtonGadget" "library call" .SH "NAME" \fBXmVaCreateToggleButtonGadget\fP, \fBXmVaCreateManagedToggleButtonGadget\fP \(em A ToggleButtonGadget widget convenience creation functions\&. .iX "XmVaCreateToggleToggleButtonGadget" "XmVaCreateManagedToggleButtonGadget" .iX "creation functions" "XmVaCreateToggleButtonGadget" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateToggleButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedToggleButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateToggleButtonGadget\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateToggleButtonGadget\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ToggleButtonGadget and its associated resources, see \fBXmToggleButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the ToggleButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmToggleButtonGadget\fP(3), \fBXmCreateToggleButtonGadget\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmMessageBox.30000644000175000017500000004200612672140200014363 00000000000000'\" t ...\" MsgBA.sgm /main/11 1996/09/26 14:54:34 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMessageBox" "library call" .SH "NAME" \fBXmMessageBox\fP \(em The MessageBox widget class .iX "XmMessageBox" .iX "widget class" "MessageBox" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP MessageBox is a dialog class used for creating simple message dialogs\&. Convenience dialogs based on MessageBox are provided for several common interaction tasks, which include giving information, asking questions, and reporting errors\&. .PP A MessageBox dialog is typically transient in nature, displayed for the duration of a single interaction\&. MessageBox is a subclass of BulletinBoard and depends on it for much of its general dialog behavior\&. .PP The default value for \fBXmNinitialFocus\fP is the value of \fBXmNdefaultButton\fP\&. .PP A typical MessageBox contains a message symbol, a message, and up to three standard default PushButtons: \fBOK, Cancel\fP, and \fBHelp\fP\&. It is laid out with the symbol and message on top and the PushButtons on the bottom\&. The \fBHelp\fP button is positioned to the side of the other push buttons\&. You can localize the default symbols and button labels for MessageBox convenience dialogs\&. .PP The user can specify resources in a resource file for the gadgets created automatically that contain the MessageBox symbol pixmap and separator\&. The gadget names are \fBSymbol\fP and \fBSeparator\fP\&. .PP A MessageBox can also be customized by creating and managing new children that are added to the MessageBox children created automatically by the convenience dialogs\&. In the case of TemplateDialog, only the separator child is created by default\&. If the callback, string, or pixmap symbol resources are specified, the appropriate child will be created\&. .PP Additional children are laid out in the following manner: .IP " \(bu" 6 The first MenuBar child is placed at the top of the window\&. The \fBXmQTmenuSystem\fP trait is used to check that it is the first MenuBar child\&. .IP " \(bu" 6 All widgets or gadgets are placed after the \fBOK\fP button in the order of their creation (this order is checked using the \fBXmQTactivatable\fP trait)\&. .IP " \(bu" 6 A child that is not in the above categories is placed above the row of buttons\&. If a message label exists, the child is placed below the label\&. If a message pixmap exists, but a message label is absent, the child is placed on the same row as the pixmap\&. The child behaves as a work area and grows or shrinks to fill the space above the row of buttons\&. The layout of multiple work area children is undefined\&. .PP At initialization, MessageBox looks for the following bitmap files: .IP " \(bu" 6 \fBxm_error\fP .IP " \(bu" 6 \fBxm_information\fP .IP " \(bu" 6 \fBxm_question\fP .IP " \(bu" 6 \fBxm_working\fP .IP " \(bu" 6 \fBxm_warning\fP .PP See \fBXmGetPixmap\fP(3) for a list of the paths that are searched for these files\&. .PP MessageBox uses the \fBXmQTactivatable\fP and \fBXmQTmenuSystem\fP traits\&. .SS "Descendants" .PP MessageBox automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBCancel\fP\fBXmPushButtonGadget\fPCancel button ___ \fBHelp\fP\fBXmPushButtonGadget\fPHelp button ___ \fBMessage\fP\fBXmLabelGadget\fPdisplayed message ___ \fBOK\fP\fBXmPushButtonGadget\fPOK button ___ \fBSeparator\fP\fBXmSeparatorGadget\fPT{ dividing line between message and buttons T} ___ \fBSymbol\fP\fBXmLabelGadget\fPicon symbolizing message type ___ .TE .SS "Classes" .PP MessageBox inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP, and \fBXmBulletinBoard\fP\&. .PP The class pointer is \fBxmMessageBoxWidgetClass\fP\&. .PP The class name is \fBXmMessageBox\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmMessageBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNcancelCallbackXmCCallbackXtCallbackListNULLC _____ XmNcancelLabelStringXmCCancelLabelStringXmStringdynamicCSG _____ XmNdefaultButtonTypeXmCDefaultButtonTypeunsigned charXmDIALOG_OK_BUTTONCSG _____ XmNdialogTypeXmCDialogTypeunsigned charXmDIALOG_MESSAGECSG _____ XmNhelpLabelStringXmCHelpLabelStringXmStringdynamicCSG _____ XmNmessageAlignmentXmCAlignmentunsigned charXmALIGNMENT_BEGINNINGCSG _____ XmNmessageStringXmCMessageStringXmString""CSG _____ XmNminimizeButtonsXmCMinimizeButtonsBooleanFalseCSG _____ XmNokCallbackXmCCallbackXtCallbackListNULLC _____ XmNokLabelStringXmCOkLabelStringXmStringdynamicCSG _____ XmNsymbolPixmapXmCPixmapPixmapdynamicCSG _____ .TE .IP "\fBXmNcancelCallback\fP" 10 Specifies the list of callbacks that is called when the user clicks on the cancel button\&. The reason sent by the callback is \fBXmCR_CANCEL\fP\&. .IP "\fBXmNcancelLabelString\fP" 10 Specifies the string label for the cancel button\&. The default for this resource depends on the locale\&. In the C locale the default is \fBCancel\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNdefaultButtonType\fP" 10 Specifies the default PushButton\&. A value of \fBXmDIALOG_NONE\fP means that there should be no default PushButton\&. The following types are valid: .RS .IP " \(bu" 6 \fBXmDIALOG_CANCEL_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_OK_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_HELP_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_NONE\fP .RE .IP "\fBXmNdialogType\fP" 10 Specifies the type of MessageBox dialog, which determines the default message symbol\&. The following are the possible values for this resource: .RS .IP "\fBXmDIALOG_ERROR\fP" 10 Indicates an ErrorDialog\&. .IP "\fBXmDIALOG_INFORMATION\fP" 10 Indicates an InformationDialog\&. .IP "\fBXmDIALOG_MESSAGE\fP" 10 Indicates a MessageDialog\&. This is the default MessageBox dialog type\&. It does not have an associated message symbol\&. .IP "\fBXmDIALOG_QUESTION\fP" 10 Indicates a QuestionDialog\&. .IP "\fBXmDIALOG_TEMPLATE\fP" 10 Indicates a TemplateDialog\&. The TemplateDialog contains only a separator child\&. It does not have an associated message symbol\&. .IP "\fBXmDIALOG_WARNING\fP" 10 Indicates a WarningDialog\&. .IP "\fBXmDIALOG_WORKING\fP" 10 Indicates a WorkingDialog\&. .RE .IP "" 10 If this resource is changed with \fBXtSetValues\fP, the symbol bitmap is modified to the new \fBXmNdialogType\fP bitmap unless \fBXmNsymbolPixmap\fP is also being set in the call to \fBXtSetValues\fP\&. If the dialog type does not have an associated message symbol, then no bitmap will be displayed\&. .IP "\fBXmNhelpLabelString\fP" 10 Specifies the string label for the help button\&. The default for this resource depends on the locale\&. In the C locale the default is \fBHelp\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNmessageAlignment\fP" 10 Controls the alignment of the message Label\&. Possible values include the following: .RS .IP " \(bu" 6 \fBXmALIGNMENT_BEGINNING\fP (default) .IP " \(bu" 6 \fBXmALIGNMENT_CENTER\fP .IP " \(bu" 6 \fBXmALIGNMENT_END\fP .RE .IP "" 10 See the description of \fBXmNalignment\fP in the \fBXmLabel\fP reference page for an explanation of these values\&. .IP "\fBXmNmessageString\fP" 10 Specifies the string to be used as the message\&. .IP "\fBXmNminimizeButtons\fP" 10 Sets the buttons to the width of the widest button and height of the tallest button if False\&. If this resource is True, button width and height are set to the preferred size of each button\&. .IP "\fBXmNokCallback\fP" 10 Specifies the list of callbacks that is called when the user clicks on the OK button\&. The reason sent by the callback is \fBXmCR_OK\fP\&. .IP "\fBXmNokLabelString\fP" 10 Specifies the string label for the OK button\&. The default for this resource depends on the locale\&. In the C locale the default is \fBOK\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNsymbolPixmap\fP" 10 Specifies the pixmap label to be used as the message symbol\&. .SS "Inherited Resources" .PP MessageBox inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmBulletinBoard Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowOverlapXmCAllowOverlapBooleanTrueCSG _____ XmNautoUnmanageXmCAutoUnmanageBooleanTrueCG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNcancelButtonXmCWidgetWidgetCancel buttonSG _____ XmNdefaultButtonXmCWidgetWidgetdynamicSG _____ XmNdefaultPositionXmCDefaultPositionBooleanTrueCSG _____ XmNdialogStyleXmCDialogStyleunsigned chardynamicCSG _____ XmNdialogTitleXmCDialogTitleXmStringNULLCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTableXmRenderTabledynamicCSG _____ XmNmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension10CSG _____ XmNmarginWidthXmCMarginWidthDimension10CSG _____ XmNnoResizeXmCNoResizeBooleanFalseCSG _____ XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_ANYCSG _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_OUTCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNtextTranslationsXmCTranslationsXtTranslationsNULLC _____ XmNunmapCallbackXmCCallbackXtCallbackListNULLC _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .SS "Translations" .PP \fBXmMessageBox\fP includes the translations from \fBXmManager\fP\&. .SS "Additional Behavior" .PP The \fBXmMessageBox\fP widget has the following additional behavior: .IP "\fB\fP\fB\fP:" 10 Calls the activate callbacks for the cancel button if it is sensitive\&. .IP "\fB\fP\fB\fP:" 10 Calls the activate callbacks for the button with the keyboard focus\&. If no button has the keyboard focus, calls the activate callbacks for the default button if it is sensitive\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNokCallback\fP\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNcancelCallback\fP\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNhelpCallback\fP\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNfocusCallback\fP\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNmapCallback\fP if the parent is a DialogShell\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNunmapCallback\fP if the parent is a DialogShell\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmBulletinBoard\fP(3), \fBXmCreateErrorDialog\fP(3), \fBXmCreateInformationDialog\fP(3), \fBXmCreateMessageBox\fP(3), \fBXmCreateMessageDialog\fP(3), \fBXmCreateQuestionDialog\fP(3), \fBXmCreateTemplateDialog\fP(3), \fBXmCreateWarningDialog\fP(3), \fBXmCreateWorkingDialog\fP(3), \fBXmManager\fP(3), \fBXmMessageBoxGetChild\fP(3), \fBXmVaCreateMessageBox\fP(3), and \fBXmVaCreateManagedMessageBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmTabStack.30000644000175000017500000004376012672140200014032 00000000000000.TH XmTabStack 3X .SH NAME \fBXmTabStack\fP \- The TabStack widget class .SH SYNOPSIS .sS .iS \&#include .iE .sE .SH DESCRIPTION .iX "XmTabStack" .iX "widget class" TabStack" The XmTabStack widget manages a group of widgets such that only one widget in the group is visible at a time. Each child is associated with a "tab" that displays a text label and/or a pixmap. By selecting the "tab" the user interactively determines which child is displayed. This widget exhibits behavior similar to the Microsoft Windows(TM) Tab Control. .PP The tabs can be configured to appear above, below, to the right, and to the left of a work area with the text oriented in any of the four cardinal directions. .PP The TabStack allows the user to select, either by pointer or keyboard traversal, tabs. When a tab is selected it changes appearance so that it appears to be raised above the other tabs. When a tab is selected the child associated with the tab is made visible. One tab is selected at all times. .SS "Classes" TabStack inherits behavior and resources form \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP and \fBXmBulletinBoard\*0 Classes. .PP The class pointer is \fBxmTabStackWidgetClass\fP. .PP The class name is \fBXmTabStack\fP. .SS "New Resources" The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the \fBXm\fP or prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time(C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A). .PP .TS center ; CB ss lB lB lB lB lB lB l l l. XmTabStack Resource Set _ Name Default Access \ \ \ \ \ \ Class \ \ \ \ \ \ Type _ _ ./"XmNallowTearOffTabs True CSG ./"\ \ \ \ \ \ XmCAllowTearOffTabs \ \ \ \ \ \ Boolean ./"_ XmNfontList Dynamic CSG \ \ \ \ \ \ XmCFontList \ \ \ \ \ \ XmFontList _ XmNhighlightThickness 2 CSG \ \ \ \ \ \ XmCHighlightThickness \ \ \ \ \ \ Dimension _ XmNstackedEffect True CSG \ \ \ \ \ \ XmCStackedEffect \ \ \ \ \ \ Boolean _ XmNtabAutoSelect True CG \ \ \ \ \ \ XmCTabAutoSelect \ \ \ \ \ \ Boolean _ XmNtabCornerPercent 40 CSG \ \ \ \ \ \ XmCTabCornerPercent \ \ \ \ \ \ int _ XmNtabLabelSpacing 2 CSG \ \ \ \ \ \ XmCTabLabelSpacing \ \ \ \ \ \ Dimension _ XmNtabMarginHeight 3 CSG \ \ \ \ \ \ XmCTabMarginHeight \ \ \ \ \ \ Dimension _ XmNtabMarginWidth 3 CSG \ \ \ \ \ \ XmCTabMarginWidth \ \ \ \ \ \ Dimension _ XmNtabMode XmTABS_BASIC CSG \ \ \ \ \ \ XmCTabMode \ \ \ \ \ \ int _ XmNtabOffset 10 CSG \ \ \ \ \ \ XmCTabOffset \ \ \ \ \ \ Dimension _ XmNtabOrientation Dynamic CSG \ \ \ \ \ \ XmCTabOrientation \ \ \ \ \ \ int _ XmNtabSelectColor Dynamic CSG \ \ \ \ \ \ XmCTabSelectColor \ \ \ \ \ \ Pixel _ XmNtabSelectedCallback NULL CS \ \ \ \ \ \ XmCCallback \ \ \ \ \ \ XtCallbackList _ XmNtabSelectPixmap XmUNSPECIFIED_PIXMAP CSG \ \ \ \ \ \ XmCTabSelectPixmap \ \ \ \ \ \ Pixmap _ XmNtabSide XmTABS_ON_TOP CSG \ \ \ \ \ \ XmCTabSide \ \ \ \ \ \ int _ XmNtabStyle XmTABS_BEVELED CSG \ \ \ \ \ \ XmCTabStyle \ \ \ \ \ \ int _ XmNuniformTabSize True CSG \ \ \ \ \ \ XmCUniformTabSize \ \ \ \ \ \ Boolean _ XmNuseImageCache True CSG \ \ \ \ \ \ XmCUseImageCache \ \ \ \ \ \ Boolean _ .TE .wH .in .VL ./".IP "\fBXmNallowTearOffTabs\fP" ./"Specifies if the user is allowed to tear-off tabs and place them ./"within other XmTabStacks. The tear-off mechanism only works with ./"XmTabStacks in the same process space. .IP "\fBXmNfontList\fP" Specifies the XmFontList to use when drawing the label strings for the tabs. .IP "\fBXmNhighlightThickness\fP" Specifies the thickness of the rectangle drawn around the label string and label pixmap of the tab with keyboard traversal. .IP "\fBXmNstackedEffect\fP" Specifies if the visuals should depict a stack of folders, True, or if the XmTabStack should use all available space for its children, False. .IP "\fBXmNtabAutoSelect\fP" Specifies if a tab is automatically selected when it receives keyboard traversal. .IP "\fBXmNtabCornerPercent\fP" Specifies the percent of the font height that should be used for the corner visual. .IP "\fBXmNtabLabelSpacing\fP" Specifies the amount of space to leave between a text label and a pixmap in the tab area. .IP "\fBXmNtabMarginHeight\fP" Specifies the vertical border that is placed around the label area of a tab. .IP "\fBXmNtabMarginWidth\fP" Specifies the horizontal border that is placed around the label area of a tab. .IP "\fBXmNtabMode\fP" Specifies the mode in which the XmTabStack distributes the tabs. Valid values for this resource include: .wH .rs .RS .TP \fBXmTABS_BASIC\fP Distributes the tabs in either a vertical or horizontal row and clips the tabs if there is not enough room to display all the tabs. .\" .TP .\" \fBXmTABS_SCROLLED\fP .\" Distributes the tabs in either a vertical or horizontal row. If there .\" is not enough room to display all the tabs arrow are displayed to .\" allow the user to scroll through the list of available tabs. .TP \fBXmTABS_STACKED\fP Distributes the tabs in either a vertical or horizontal row. If there is not enough room to display all the tabs additional rows are added. When a tab is selected, its row is moved next to the children in the stack. .TP \fBXmTABS_STACKED_STATIC\fP Distributes the tabs in either a vertical or horizontal row. If there is not enough room to display all the tabs additional rows are added. The positions of rows are not changed when tabs are selected. .\" .TP .\" \fBXmTABS_OVERLAYED\fP .\" Distributes the tabs in either a vertical or horizontal row. If there .\" is not enough room to display all the tabs then the tabs are colapsed .\" at the ends and a popup menu of the available tabs can be displayed .\" using mouse button 3. .RE .wH .rE .IP "\fBXmNtabOffset\fP" Specifies the amount of indentation used to stagger the tab rows when displaying tabs in either the \fBXmTABS_STACKED\fP or \fBXmTABS_STACKED_STATIC\fP mode. .IP "\fBXmNtabOrientation\fP" Specifies the orientation of the tab, and the rotation factor of the tab label. Valid values for this resource include: .wH .rs .RS .TP \fBXmTAB_ORIENTATION_DYNAMIC\fP Specifies that the orientation of the tabs should be calculated dynamically based on the \fBXmNtabSide\fP resource. .TP \fBXmTABS_LEFT_TO_RIGHT\fP Specifies that the text appears at the default rotation. .TP \fBXmTABS_RIGHT_TO_LEFT\fP Specifies that the text appears upside down. .TP \fBXmTABS_TOP_TO_BOTTOM\fP Specifies that the text should be rotated to the vertical position with the first character drawn at the lowest y position and the bottom of the text faces the lowest x position. .TP \fBXmTABS_BOTTOM_TO_TOP\fP Specifies that the text should be rotated to the vertical, position with the first character drawn at the highest y position and the bottom of the text faces the highest x position. .RE .wH .rE .IP "\fBXmNtabSelectColor\fP" Specifies the color of the selected tab. .IP "\fBXmNtabSelectedCallback\fP" Specifies the list of callbacks to call when a child becomes the selected tab. .IP "\fBXmNtabSelectPixmap\fP" Specifies the pixmap of the selected tab. .IP "\fBXmNtabSide\fP" Specifies the location of the tab with respect to the children of the XmTabStack. Valid values for this resource include: .wH .rs .RS .TP \fBXmTABS_ON_TOP\fP Specifies that the tabs should be placed above the children. .TP \fBXmTABS_ON_BOTTOM\fP Specifies that the tabs should be placed below the children. .TP \fBXmTABS_ON_RIGHT\fP Specifies that the tabs should be placed to the right of the children. .TP \fBXmTABS_ON_LEFT\fP Specifies that the tabs should be placed to the left of the children. .RE .wH .rE .IP "\fBXmNtabStyle\fP" Specifies the appearance of the tabs associated with the children of the XmTabStack. Valid values for this resource include: .wH .rs .RS .TP \fBXmTABS_BEVELED\fP Draws the corners of the tabs as an angled line. .TP \fBXmTABS_ROUNDED\fP Draws the corners of the tabs as a quarter of a circle. .TP \fBXmTABS_SQUARED\fP Draws the tabs as rectangles. .RE .wH .rE .IP "\fBXmNuniformTabSize\fP" Determines if all tabs should have a uniform major dimension, where the major dimension is width if the tab orientation is \fBXmTABS_LEFT_TO_RIGHT\fP or \fBXmTABS_RIGHT_TO_LEFT\fP or height if the tab orientation is \fBXmTABS_TOP_TO_BOTTOM\fP or \fBXmTABS_BOTTOM_TO_TOP\fP. When \fBXmNtabMode\fP is either \fBXmTABS_STACKED\fP or \fBXmTABS_STACKED_STATIC\fP, this resource is forced to True. .IP "\fBXmNuseImageCache\fP" Destermines if the Xmmages used for rotating text and pixmaps should be cached. This increases performance but uses up more memory. .sp .wH .in 0 .TS center ; CB ss lB lB lB lB lB lB l l l. XmTabStack Constraint Resource Set _ Name Default Access \ \ \ \ \ \ Class \ \ \ \ \ \ Type _ _ XmNfreeTabPixmap False CSG \ \ \ \ \ \ XmCFreeTabPixmap \ \ \ \ \ \ Boolean _ XmNtabAlignment XmALIGNMENT_CENTER CSG \ \ \ \ \ \ XmCAlignment \ \ \ \ \ \ unsigned char _ XmNtabBackground Dynamic CSG \ \ \ \ \ \ XmCBackground \ \ \ \ \ \ Pixel _ XmNtabBackgroundPixmap Dynamic CSG \ \ \ \ \ \ XmCBackgroundPixmap \ \ \ \ \ \ Pixmap _ XmNtabForeground Dynamic CSG \ \ \ \ \ \ XmCForeground \ \ \ \ \ \ Pixel _ XmNtabLabelPixmap XmUNSPECIFIED_PIXMAP CSG \ \ \ \ \ \ XmCTabLabelPixmap \ \ \ \ \ \ Pixmap _ XmNtabLabelString NULL CSG \ \ \ \ \ \ XmCTabLabelString \ \ \ \ \ \ XmString _ XmNtabPixmapPlacement XmPIXMAP_RIGHT CSG \ \ \ \ \ \ XmCTabPixmapPlacement \ \ \ \ \ \ XmPixmapPlacement _ XmNtabStringDirection XmSTRING_DIRECTION_DEFAULT CSG \ \ \ \ \ \ XmCTabStringDirection \ \ \ \ \ \ unsigned char _ .\" XmNtabTearOffEnabled True CSG .\" \ \ \ \ \ \ XmCTabTearOffEnabled \ \ \ \ \ \ Boolean .\" _ .TE .wH .in .VL .IP "\fBXmNfreeTabPixmap\fP" Specifies that the pixmaps assigned to the \fBXmNlabelPixmap\fP resources should be freed when the widget is destroyed. .IP "\fBXmNtabAlignment\fP" Specifies the alignment of the tab label. Valid values for this resource include: .wH .rs .RS .TP \fBXmALIGNMENT_BEGINNING\fP Aligns the label to the left side of the available space. .TP \fBXmALIGNMENT_CENTER\fP Aligns the label centered in the available space. .TP \fBXmALIGNMENT_END\fP Aligns the label to the right side of the available space. .RE .wH .rE .IP "\fBXmNtabBackground\fP" Specifies the background pixel for the tab. .IP "\fBXmNtabBackgroundPixmap\fP" Specifies the background pixmap for the tab. .IP "\fBXmNtabForeground\fP" Specifies the foreground pixel for the tab. .IP "\fBXmNtabLabelPixmap\fP" Specifies the pixmap to display in the tab label. .IP "\fBXmNtabLabelString\fP" Specifies the XmString to display as the textual portion of the tab label. This is copied when set on the widget. The value fetched via XtGetValues should not be freed as it returns a pointer to the widgets value. If you wish to use the value returned from XtGetValues use XmStringCopy the returned value. .IP "\fBXmNtabPixmapPlacement\fP" Specifies the location of the pixmap with respect to the text in the tab label. Valid values for this resource include: .wH .rs .RS .TP \fBXmPIXMAP_TOP\fP Specifies that the pixmap should be above the XmString. .TP \fBXmPIXMAP_BOTTOM\fP Specifies that the pixmap should be below the XmString. .TP \fBXmPIXMAP_RIGHT\fP Specifies that the pixmap should be to the right of the XmString. .TP \fBXmPIXMAP_LEFT\fP Specifies that the pixmap should be to the left of the XmString. .TP \fBXmPIXMAP_ONLY\fP Specifies that only the pixmap portion of the tab label should be displayed. .TP \fBXmPIXMAP_NONE\fP Specifies that only the XmString portion of the tab label should be displayed. .RE .wH .rE .IP "\fBXmNtabStringDirection\fP" Specifies the string direction for the XmString portion of the tab label. Valid values for this resouce include: .wH .re .RS .TP \fBXmSTRING_DIRECTION_L_TO_R\fP Left to right .TP \fBXmSTRING_DIRECTION_R_TO_L\fP Right to left .RE .wH .rS .\" .IP "\fBXmNtabTearOffEnabled\fP" .\" Specifies the this tab is enabled to be torn of and dragged to another .\" XmTabStack within a process space. This resource is ignored it the .\" XmTabStack resource \fBXmNallowTearOffTabs\fP is False. .sp .wH .in 0 .SS "Inherited Resources" TabStack inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the man page for that superclass. .sp .TS center ; cB ss lB lB lB l l l. XmBulletinBoard Resource Set Name Default Access \ \ \ \ \ \ Class \ \ \ \ \ \ Type _ _ XmNallowOverlap True CSG \ \ \ \ \ \ XmCAllowOverlap \ \ \ \ \ \ Boolean _ XmNautoUnmanage False CG \ \ \ \ \ \ XmCAutoUnmanage \ \ \ \ \ \ Boolean _ XmNbuttonFontList dynamic CSG \ \ \ \ \ \ XmCButtonFontList \ \ \ \ \ \ XmFontList _ XmNcancelButton NULL SG \ \ \ \ \ \ XmCWidget \ \ \ \ \ \ Widget _ XmNdefaultButton NULL SG \ \ \ \ \ \ XmCWidget \ \ \ \ \ \ Widget _ XmNdefaultPosition True CSG \ \ \ \ \ \ XmCDefaultPosition \ \ \ \ \ \ Boolean _ XmNdialogStyle dynamic CSG \ \ \ \ \ \ XmCDialogStyle \ \ \ \ \ \ unsigned char _ XmNdialogTitle NULL CSG \ \ \ \ \ \ XmCDialogTitle \ \ \ \ \ \ XmString _ XmNfocusCallback NULL C \ \ \ \ \ \ XmCCallback \ \ \ \ \ \ XtCallbackList _ XmNlabelFontList dynamic CSG \ \ \ \ \ \ XmCLabelFontList \ \ \ \ \ \ XmFontList _ XmNmapCallback NULL C \ \ \ \ \ \ XmCCallback \ \ \ \ \ \ XtCallbackList _ XmNmarginHeight 10 CSG \ \ \ \ \ \ XmCMarginHeight \ \ \ \ \ \ Dimension _ XmNmarginWidth 10 CSG \ \ \ \ \ \ XmCMarginWidth \ \ \ \ \ \ Dimension _ XmNnoResize False CSG \ \ \ \ \ \ XmCNoResize \ \ \ \ \ \ Boolean _ .TE .sp .TS center ; cB ss lB lB lB l l l. XmManager Resource Set _ Name Default Access \ \ \ \ \ \ Class \ \ \ \ \ \ Type _ _ XmNbottomShadowColor dynamic CSG \ \ \ \ \ \ XmCBottomShadowColor \ \ \ \ \ \ Pixel _ XmNbottomShadowPixmap XmUNSPECIFIED_PIXMAP CSG \ \ \ \ \ \ XmCBottomShadowPixmap \ \ \ \ \ \ Pixmap _ XmNforeground dynamic CSG \ \ \ \ \ \ XmCForeground \ \ \ \ \ \ Pixel _ XmNhelpCallback NULL C \ \ \ \ \ \ XmCCallback \ \ \ \ \ \ XtCallbackList _ XmNhighlightColor dynamic CSG \ \ \ \ \ \ XmCHighlightColor \ \ \ \ \ \ Pixel _ XmNhighlightPixmap dynamic CSG \ \ \ \ \ \ XmCHighlightPixmap \ \ \ \ \ \ Pixmap _ XmNinitialFocus dynamic CSG \ \ \ \ \ \ XmCInitialFocus \ \ \ \ \ \ Widget _ XmNnavigationType XmTAB_GROUP CSG \ \ \ \ \ \ XmCNavigationType \ \ \ \ \ \ XmNavigationType _ XmNshadowThickness 2 CSG \ \ \ \ \ \ XmCShadowThickness \ \ \ \ \ \ Dimension _ XmNstringDirection dynamic CG \ \ \ \ \ \ XmCStringDirection \ \ \ \ \ \ XmStringDirection _ XmNtopShadowColor dynamic CSG \ \ \ \ \ \ XmCTopShadowColor \ \ \ \ \ \ Pixel _ XmNtopShadowPixmap dynamic CSG \ \ \ \ \ \ XmCTopShadowPixmap \ \ \ \ \ \ Pixmap _ XmNtraversalOn True CSG \ \ \ \ \ \ XmCTraversalOn \ \ \ \ \ \ Boolean _ XmNunitType dynamic CSG \ \ \ \ \ \ XmCUnitType \ \ \ \ \ \ unsigned char _ XmNuserData NULL CSG \ \ \ \ \ \ XmCUserData \ \ \ \ \ \ XtPointer _ .TE .sp .TS center ; cB ss lB lB lB l l l. Composite Resource Set _ Name Default Access \ \ \ \ \ \ Class \ \ \ \ \ \ Type _ _ XmNchildren NULL G \ \ \ \ \ \ XmCReadOnly \ \ \ \ \ \ WidgetList _ XmNinsertPosition NULL CSG \ \ \ \ \ \ XmCInsertPosition \ \ \ \ \ \ XtOrderProc _ XmNnumChildren 0 G \ \ \ \ \ \ XmCReadOnly \ \ \ \ \ \ Cardinal _ .TE .sp .TS center ; cB ss lB lB lB l l l. Core Resource Set _ Name Default Access \ \ \ \ \ \ Class \ \ \ \ \ \ Type _ _ XmNaccelerators dynamic N/A \ \ \ \ \ \ XmCAccelerators \ \ \ \ \ \ XtAccelerators _ XmNancestorSensitive dynamic G \ \ \ \ \ \ XmCSensitive \ \ \ \ \ \ Boolean _ XmNbackground dynamic CSG \ \ \ \ \ \ XmCBackground \ \ \ \ \ \ Pixel _ XmNbackgroundPixmap XmUNSPECIFIED_PIXMAP CSG \ \ \ \ \ \ XmCPixmap \ \ \ \ \ \ Pixmap _ XmNborderColor XtDefaultForeground CSG \ \ \ \ \ \ XmCBorderColor \ \ \ \ \ \ Pixel _ XmNborderPixmap XmUNSPECIFIED_PIXMAP CSG \ \ \ \ \ \ XmCPixmap \ \ \ \ \ \ Pixmap _ XmNborderWidth 0 CSG \ \ \ \ \ \ XmCBorderWidth \ \ \ \ \ \ Dimension _ XmNcolormap dynamic CG \ \ \ \ \ \ XmCColormap \ \ \ \ \ \ Colormap _ XmNdepth dynamic CG \ \ \ \ \ \ XmCDepth \ \ \ \ \ \ int _ XmNdestroyCallback NULL C \ \ \ \ \ \ XmCCallback \ \ \ \ \ \ XtCallbackList _ XmNheight dynamic CSG \ \ \ \ \ \ XmCHeight \ \ \ \ \ \ Dimension _ XmNinitialResourcesPersistent True C \ \ \ \ \ \ XmCInitialResourcesPersistent \ \ \ \ \ \ Boolean _ XmNmappedWhenManaged True CSG \ \ \ \ \ \ XmCMappedWhenManaged \ \ \ \ \ \ Boolean _ XmNscreen Screen* dynamic \ \ \ \ \ \ XmCScreen \ \ \ \ \ \ Screen _ XmNsensitive True CSG \ \ \ \ \ \ XmCSensitive \ \ \ \ \ \ Boolean _ XmNtranslations dynamic CSG \ \ \ \ \ \ XmCTranslations \ \ \ \ \ \ XtTranslations _ XmNwidth dynamic CSG \ \ \ \ \ \ XmCWidth \ \ \ \ \ \ Dimension _ XmNx 0 CSG \ \ \ \ \ \ XmCPosition \ \ \ \ \ \ Position _ XmNy 0 CSG \ \ \ \ \ \ XmCPosition \ \ \ \ \ \ Position _ .TE .wH .in .SS "Calback Information" A pointer to the following structure is passed to each callback: .sp .sp .ps -1 .ft B .nf .ta .25i 1.li typedef struct _XmTabStackCallbackStruct { int \fIreason\fB; XEvent \fI*event\fB; Widget \fIselected_child\fB; } XmTabStackCallbackStruct; .ps +1 .ft R .fi .sp .sp .wH .fi .VL .75i .IP "\fIreason\fP" Indicates why the callback was invoked. Valid callbacks reasons include: .wH .rs .RS .TP \fBXmCR_TAB_SELECTED\fP Indicates that a child has been made the selected widget. .RE .wH .rE .IP "\fIevent\fP" Points to the \fBXEvent\fP that triggered the callback. .IP "\fIselected_child\fP" Contains the widget ID of the selected child. .RE .SS "Translations" XmTabStack includes the translations from the XmManager. .sp .nL .ne 20 .SS "Additional Behavior" The XmTabStack has no additional behavior. .SS "Virtual Bindings" The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see \fBVirtualBindings(3X)\fP. .SH RELATED INFORMATION .na \fBXmBulletinBoard\fP(3), \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateTabStack\fP(3), \fBXmManager\fP(3), \fBXmVaCreateTabStack\fP(3), and \fBXmVaCreateManagedTabStack\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateSimplePopupMenu.30000644000175000017500000000574212672140200016562 00000000000000'\" t ...\" CreSiD.sgm /main/7 1996/08/30 14:54:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSimplePopupMenu" "library call" .SH "NAME" \fBXmCreateSimplePopupMenu\fP \(em A RowColumn widget convenience creation function .iX "XmCreateSimplePopupMenu" .iX "creation functions" "XmCreateSimplePopupMenu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSimplePopupMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSimplePopupMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_POPUP\fP and returns the associated widget ID\&. .PP This routine creates a Popup menu pane and its button children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. The name of each separator is \fBseparator_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of separators in the menu minus 1\&. The name of each title is \fBlabel_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of titles in the menu minus 1\&. Buttons, separators, and titles are named and created in the order in which they are specified in the RowColumn simple menu creation resources supplied in the argument list\&. .IP "\fIparent\fP" 10 Specifies the widget ID of the parent of the MenuShell .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. The only button types allowed in the \fBXmNbuttonType\fP resource are \fBXmCASCADEBUTTON\fP, \fBXmPUSHBUTTON\fP, \fBXmRADIOBUTTON\fP, \fBXmCHECKBUTTON\fP, \fBXmTITLE\fP, \fBXmSEPARATOR\fP, and \fBXmDOUBLE_SEPARATOR\fP\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreatePopupMenu\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimplePopupMenu\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmArrowButton.30000644000175000017500000002757312672140200014630 00000000000000'\" t ...\" ArrowBuA.sgm /main/11 1996/09/08 20:24:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmArrowButton" "library call" .SH "NAME" \fBXmArrowButton\fP \(em The ArrowButton widget class .iX "XmArrowButton" .iX "widget class" "ArrowButton" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP ArrowButton consists of a directional arrow surrounded by a border shadow\&. When it is selected, the shadow changes to give the appearance that the ArrowButton has been pressed in\&. When the ArrowButton is unselected, the shadow reverts to give the appearance that the ArrowButton is released, or out\&. .PP ArrowButton holds the \fBXmQTactivatable\fP trait\&. .SS "Classes" .PP ArrowButton inherits behavior, resources, and traits from the \fBCore\fP and \fBXmPrimitive\fP classes\&. .PP The class pointer is \fBxmArrowButtonWidgetClass\fP\&. .PP The class name is \fBXmArrowButton\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmArrowButton Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNarrowDirectionXmCArrowDirectionunsigned charXmARROW_UPCSG _____ XmNdetailShadowThicknessXmCDetailShadowThicknessDimension2CSG _____ XmNdisarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNmultiClickXmCMultiClickunsigned chardynamicCSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies a list of callbacks that is called when the ArrowButton is activated\&. To activate the button, press and release \fBBSelect\fP while the pointer is inside the ArrowButton widget\&. Activating the ArrowButton also disarms it\&. The reason sent by this callback is \fBXmCR_ACTIVATE\fP\&. This callback uses the \fBXmQTactivatable\fP trait\&. .IP "\fBXmNarmCallback\fP" 10 Specifies a list of callbacks that is called when the ArrowButton is armed\&. To arm this widget, press \fBBSelect\fP while the pointer is inside the ArrowButton\&. The reason sent by this callback is \fBXmCR_ARM\fP\&. .IP "\fBXmNarrowDirection\fP" 10 Sets the arrow direction\&. The values for this resource are .RS .IP " \(bu" 6 \fBXmARROW_UP\fP .IP " \(bu" 6 \fBXmARROW_DOWN\fP .IP " \(bu" 6 \fBXmARROW_LEFT\fP .IP " \(bu" 6 \fBXmARROW_RIGHT\fP .RE .IP "\fBXmNdetailShadowThickness\fP" 10 Specifies the thickness of the inside arrow shadows\&. The default thickness is 2 pixels\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies a list of callbacks that is called when the ArrowButton is disarmed\&. To disarm this widget, press and release \fBBSelect\fP while the pointer is inside the ArrowButton\&. The reason for this callback is \fBXmCR_DISARM\fP\&. .IP "\fBXmNmultiClick\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time, and this resource is set to \fBXmMULTICLICK_DISCARD\fP, the second click\&. is not processed\&. If this resource is set to \fBXmMULTICLICK_KEEP\fP, the event is processed and \fIclick_count\fP is incremented in the callback structure\&. When the button is not in a menu, the default value is \fBXmMULTICLICK_KEEP\fP\&. .SS "Inherited Resources" .PP ArrowButton inherits behavior and resources from the superclasses described in the following table\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIclick_count\fP; } XmArrowButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fIclick_count\fP" 10 This value is valid only when the reason is \fBXmCR_ACTIVATE\fP\&. It contains the number of clicks in the last multiclick sequence if the \fBXmNmultiClick\fP resource is set to \fBXmMULTICLICK_KEEP\fP; otherwise it contains 1\&. The activate callback is invoked for each click if \fBXmNmultiClick\fP is set to \fBXmMULTICLICK_KEEP\fP\&. .SS "Translations" .PP XmArrowButton includes translations for XmPrimitive\&. The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 Enter() .IP "\fB\fP:" 10 Leave() .IP "\fBc\fP:" 10 ButtonTakeFocus() .IP "\fB\(apc\fP\fB\fP:" 10 Arm() .IP "\fB\(apc\fP\fB\fP\fB,\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiArm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiActivate() .IP "\fB\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ArmAndActivate() .SS "Action Routines" .PP The \fBXmArrowButton\fP action routines are .IP "Activate():" 10 Draws the shadow in the unselected state\&. If the pointer is within the ArrowButton, calls the callbacks for \fBXmNactivateCallback\fP\&. .IP "Arm():" 10 Draws the shadow in the selected state and calls the callbacks for \fBXmNarmCallback\fP\&. .IP "ArmAndActivate():" 10 Draws the shadow in the selected state and calls the callbacks for \fBXmNarmCallback\fP\&. Arranges for the shadow to be drawn in the unselected state and the callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP to be called, either immediately or at a later time\&. .IP "ButtonTakeFocus():" 10 Causes the ArrowButton to take keyboard focus when \fBCtrl\fP is pressed, without activating the widget\&. .IP "Disarm():" 10 Draws the shadow in the unselected state and calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "MultiActivate():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action increments \fIclick_count\fP in the callback structure and draws the shadow in the unselected state\&. If the pointer is within the ArrowButton, this action calls the callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP\&. .IP "MultiArm():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action draws the shadow in the selected state and calls the callbacks for \fBXmNarmCallback\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 Draws the ArrowButton shadow in its selected state if the pointer leaves and re-enters the window while \fB\fP is pressed\&. .IP "\fB\fP:" 10 Draws the ArrowButton shadow in its unselected state if the pointer leaves the window while \fB\fP is pressed\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateArrowButton\fP(3), \fBXmPrimitive\fP(3), \fBXmVaCreateArrowButton\fP(3), and \fBXmVaCreateManagedArrowButton\fP(3)\&. motif-2.3.8/doc/man/man3/MrmOpenHierarchy.30000644000175000017500000001636212672140200015243 00000000000000'\" t ...\" OpenHieA.sgm /main/10 1996/09/08 21:25:45 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmOpenHierarchy" "library call" .SH "NAME" \fBMrmOpenHierarchy\fP \(em Allocates a hierarchy ID and opens all the UID files in the hierarchy .iX "MrmOpenHierarchy" .iX "uil functions" "MrmOpenHierarchy" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmOpenHierarchy\fP\fR( \fBMrmCount \fBnum_files\fR\fR, \fBString \fBfile_names_list\fR[]\fR, \fBMrmOsOpenParamPtr *\fBancillary_structures_list\fR\fR, \fBMrmHierarchy *\fBhierarchy_id\fR\fR); .fi .iX "MRM function" "MrmOpenHierarchy" .iX "MrmOpenHierarchy" "definition" .SH "DESCRIPTION" .PP This routine is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBMrmOpenHierarchyPerDisplay\fP\&. \fBMrmOpenHierarchy\fP is identical to \fBMrmOpenHierarchyPerDisplay\fP except that \fBMrmOpenHierarchy\fP does not take a \fIdisplay\fP argument\&. .IP "\fInum_files\fP" 10 Specifies the number of files in the name list\&. .IP "\fIfile_names_list\fP" 10 Specifies an array of character strings that identify the UID files\&. .IP "\fIancillary_structures_list\fP" 10 A list of operating-system-dependent ancillary structures corresponding to items such as filenames, clobber flags, and so forth\&. This argument should be NULL for most operations\&. If you need to reference this structure, see the definition of \fBMrmOsOpenParamPtr\fR in the \fBMrmPublic\&.h\fP header file for more information\&. .IP "\fIhierarchy_id\fP" 10 Returns the search hierarchy ID\&. The search hierarchy ID identifies the list of UID files that MRM searches (in order) when performing subsequent fetch calls\&. .PP Each UID file string in \fIfile_names_list\fP can specify either a full pathname or a filename\&. If a UID file string has a leading slash (/), it specifies a full pathname, and MRM opens the file as specified\&. Otherwise, the UID file string specifies a filename\&. In this case, MRM looks for the file along a search path specified by the \fBUIDPATH\fP environment variable or by a default search path, which varies depending on whether or not the \fBXAPPLRESDIR\fP environment variable is set\&. .PP The \fBUIDPATH\fP environment variable specifies a search path and naming conventions associated with UID files\&. It can contain the substitution field \fB%U\fP, where the UID file string from the \fIfile_names_list\fP argument to \fBMrmOpenHierarchyPerDisplay\fP is substituted for \fB%U\fP\&. It can also contain the substitution fields accepted by \fBXtResolvePathname\fP\&. The substitution field \fB%T\fP is always mapped to \fIuid\fP\&. The entire path is first searched with \fB%S\fP mapped to \fB\&.uid\fP\&. If no file is found, it is searched again with \fB%S\fP mapped to NULL\&. .PP If no display is set prior to calling this function, the result of this function\&'s call to \fBXtResolvePathname\fP is undefined\&. .PP For example, the following \fBUIDPATH\fP value and \fBMrmOpenHierarchy\fP call cause MRM to open two separate UID files: .PP .nf \f(CWUIDPATH=/uidlib/%L/%U\&.uid:/uidlib/%U/%L static char *uid_files[] = {"/usr/users/me/test\&.uid", "test2"}; MrmHierarchy *Hierarchy_id; MrmOpenHierarchy((MrmCount)2,uid_files, NULL, Hierarchy_id)\fR .fi .PP .PP MRM opens the first file, \fB/usr/users/me/test\&.uid\fP, as specified in the \fIfile_names_list\fP argument to \fBMrmOpenHierarchy\fP, because the UID file string in the \fIfile_names_list\fP argument specifies a full pathname\&. MRM looks for the second file, \fBtest2\fP, first as \fB/uidlib/%L/test2\&.uid\fP and second as \fB/uidlib/test2/%L\fP, where the display\&'s language string is substituted for \fB%L\fP\&. .PP After \fBMrmOpenHierarchy\fP opens the UID hierarchy, you should not delete or modify the UID files until you close the UID hierarchy by calling \fBMrmCloseHierarchy\fP\&. .PP If \fBUIDPATH\fP is not set but the environment variable \fBXAPPLRESDIR\fP is set, MRM searches the following pathnames: .IP " \(bu" 6 \fB%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/uid/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/uid/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/include/X11/uid/%U%S\fP .PP If neither \fBUIDPATH\fP nor \fBXAPPLRESDIR\fP is set, MRM searches the following pathnames: .IP " \(bu" 6 \fB%U%S\fP .IP " \(bu" 6 \fBHOME/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fBHOME/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$HOME/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$HOME/%L/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/%l/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/include/X11/uid/%U%S\fP .PP These paths are defaults that vendors may change\&. For example, a vendor may use different directories for \fB/usr/lib/X11\fP and \fB/usr/include/X11\fP\&. .PP The following substitutions are used in these paths: .IP "\fB%U\fP" 10 The UID file string, from the \fIfile_names_list\fP argument\&. .IP "\fB%N\fP" 10 The class name of the application\&. .IP "\fB%L\fP" 10 The display\&'s language string\&. This string is influenced by \fBXtSetLanguageProc\fP\&. The default string is determined by calling setlocale(\fBLC_ALL, NULL\fP)\&. .IP "\fB%l\fP" 10 The language component of the display\&'s language string\&. .IP "\fB%S\fP" 10 The suffix to the filename\&. The entire path is first searched with a suffix of \fB\&.uid\fP\&. If no file is found, it is searched again with a NULL suffix\&. .SH "RETURN" .PP This function returns one of the following status return constants: .iX "MrmSUCCESS" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmNOT_FOUND\fP" 10 File not found\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmOpenHierarchyPerDisplay\fP(3) and \fBMrmCloseHierarchy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmPushButtonGadget.30000644000175000017500000004713312672140200015563 00000000000000'\" t ...\" PushButB.sgm /main/11 1996/09/08 20:56:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPushButtonGadget" "library call" .SH "NAME" \fBXmPushButtonGadget\fP \(em The PushButtonGadget widget class .iX "XmPushButtonGadget" .iX "widget class" "PushButtonGadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP PushButtonGadget issues commands within an application\&. It consists of a text label or pixmap surrounded by a border shadow\&. When PushButtonGadget is selected, the shadow changes to give the appearance that the PushButtonGadget has been pressed in\&. When PushButtonGadget is unselected, the shadow changes to give the appearance that the PushButtonGadget is out\&. .PP The default behavior associated with a PushButtonGadget in a menu depends on the type of menu system in which it resides\&. By default, \fB\fP controls the behavior of the PushButtonGadget\&. In addition, \fB\fP controls the behavior of the PushButtonGadget if it resides in a PopupMenu system\&. The actual mouse button used is determined by its RowColumn parent\&. .PP Thickness for a second shadow may be specified with the \fBXmNshowAsDefault\fP resource\&. If it has a nonzero value, the Label\&'s \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and \fBXmNmarginBottom\fP resources may be modified to accommodate the second shadow\&. .PP If an initial value is specified for \fBXmNarmPixmap\fP but not for \fBXmNlabelPixmap\fP, the \fBXmNarmPixmap\fP value is used for \fBXmNlabelPixmap\fP\&. .PP PushButtonGadget uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits, and holds the \fBXmQactivatable\fP, \fBXmQTmenuSavvy\fP, and \fBXmQTtakesDefault\fP traits\&. .SS "Classes" .PP PushButtonGadget inherits behavior, resources, and traits from \fBObject\fP, \fBRectObj\fP, \fBXmGadget\fP and \fBXmLabelGadget\fP\&. .PP The class pointer is \fBxmPushButtonGadgetClass\fP\&. .PP The class name is \fBXmPushButtonGadget\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPushButtonGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmColorXmCArmColorPixeldynamicCSG _____ XmNarmPixmapXmCArmPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNdefaultButtonShadowThicknessXmCdefaultButtonShadowThicknessDimensiondynamicCSG _____ XmNdisarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNfillOnArmXmCFillOnArmBooleanTrueCSG _____ XmNmultiClickXmCMultiClickunsigned chardynamicCSG _____ XmNshowAsDefaultXmCShowAsDefaultDimension0CSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when the PushButtonGadget is activated\&. It is activated when the user presses and releases the active mouse button while the pointer is inside the PushButtonGadget\&. Activating PushButtonGadget also disarms it\&. For this callback, the reason is \fBXmCR_ACTIVATE\fP\&. This callback uses the \fBXmQTactivatable\fP trait\&. .IP "\fBXmNarmCallback\fP" 10 Specifies the list of callbacks that is called when PushButtonGadget is armed\&. It is armed when the user presses the active mouse button while the pointer is inside the PushButtonGadget\&. For this callback, the reason is \fBXmCR_ARM\fP\&. .IP "\fBXmNarmColor\fP" 10 Specifies the color with which to fill the armed button\&. \fBXmNfillOnArm\fP must be set to True for this resource to have an effect\&. The default for a color display is a color between the background and the bottom shadow color\&. For a monochrome display, the default is set to the foreground color, and any text in the label appears in the background color when the button is armed\&. .IP "\fBXmNarmPixmap\fP" 10 Specifies the pixmap to be used as the button face if \fBXmNlabeltype\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP and PushButtonGadget is armed\&. This resource is disabled when the PushButtonGadget is in a menu\&. .IP "\fBXmNdefaultButtonShadowThickness\fP" 10 This resource specifies the width of the default button indicator shadow\&. If this resource is 0 (zero), the width of the shadow comes from the value of the \fBXmNshowAsDefault\fP resource\&. If this resource is greater than zero, the \fBXmNshowAsDefault\fP resource is only used to specify whether this button is the default\&. The default value is the initial value of \fBXmNshowAsDefault\fP\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies the list of callbacks that is called when the PushButtonGadget is disarmed\&. PushButtonGadget is disarmed when the user presses and releases the active mouse button while the pointer is inside that gadget\&. For this callback, the reason is \fBXmCR_DISARM\fP\&. .IP "\fBXmNfillOnArm\fP" 10 Forces the PushButtonGadget to fill the background of the button with the color specified by \fBXmNarmColor\fP when the button is armed and when this resource is set to True\&. If it is False, only the top and bottom shadow colors are switched\&. When the PushButtonGadget is in a menu, this resource is ignored and assumed to be False\&. .IP "\fBXmNmultiClick\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time, and this resource is set to \fBXmMULTICLICK_DISCARD\fP, the second click is not processed\&. If this resource is set to \fBXmMULTICLICK_KEEP\fP, the event is processed and \fIclick_count\fP is incremented in the callback structure\&. When the button is in a menu, the default is \fBXmMULTICLICK_DISCARD\fP; otherwise, for a button not in a menu, the default value is \fBXmMULTICLICK_KEEP\fP\&. .IP "\fBXmNshowAsDefault\fP" 10 If \fBXmNdefaultButtonShadowThickness\fP is greater than 0 (zero), a value greater than zero in this resource specifies to mark this button as the default button\&. If \fBXmNdefaultButtonShadowThickness\fP is 0, a value greater than 0 in this resource specifies to mark this button as the default button with the shadow thickness specified by this resource\&. The space between the shadow and the default shadow is equal to the sum of both shadows\&. The default value is 0\&. When the Display resource \fBXmNdefaultButtonEmphasis\fP has a value of \fBXmEXTERNAL_HIGHLIGHT\fP (the default), PushButton draws the location cursor outside of the outer shadow\&. When this resource has a value of \fBXmINTERNAL_HIGHLIGHT\fP, the highlight is drawn between the inner and outer shadows\&. When this value is not 0, the Label \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and \fBXmNmarginBottom\fP resources may be modified to accommodate the second shadow\&. This resource is disabled when the PushButton is in a menu\&. .SS "Inherited Resources" .PP PushButtonGadget inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabelGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLCSG _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLCSG _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapdynamicCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimensiondynamicCSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimensiondynamicCSG _____ XmNmarginRightXmCMarginRightDimensiondynamicCSG _____ XmNmarginTopXmCMarginTopDimensiondynamicCSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG _____ XmNpixmapTextPaddingXmCSpaceDimension2CSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringdynamicCSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIclick_count\fP; } XmPushButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fIclick_count\fP" 10 Valid only when the reason is \fBXmCR_ACTIVATE\fP\&. It contains the number of clicks in the last multiclick sequence if the \fBXmNmultiClick\fP resource is set to \fBXmMULTICLICK_KEEP\fP; otherwise it contains 1\&. The activate callback is invoked for each click if \fBXmNmultiClick\fP is set to \fBXmMULTICLICK_KEEP\fP\&. .SS "Behavior" .PP \fBXmPushButtonGadget\fP includes behavior from \fBXmGadget\fP\&. \fBXmPushButtonGadget\fP includes menu traversal behavior from \fBXmLabelGadget\fP\&. Additional behavior for XmPushButtonGadget is described in the following list\&. .IP "\fB\fP:" 10 Drags the contents of a PushButtonGadget label, identified when \fB\fP is pressed\&. This action is undefined for PushButtonGadgets used in a menu system\&. .IP "\fB\fP:" 10 This action arms the PushButtonGadget\&. .IP "" 10 In a menu, this action unposts any menus posted by the PushButtonGadget\&'s parent menu, disables keyboard traversal for the menu, and enables mouse traversal for the menu\&. It draws the shadow in the armed state\&. Unless the button is already armed, it calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 If the button is not in a menu, this action draws the shadow in the armed state\&. If \fBXmNfillOnArm\fP is set to True, it fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNarmPixmap\fP is used for the button face\&. It calls the \fBXmNarmCallback\fP callbacks\&. .IP "\fB\fP\fB(2+)\fP:" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action draws the shadow in the armed state\&. If the button is not in a menu and if \fBXmNfillOnArm\fP is set to True, it fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNarmPixmap\fP is used for the button face\&. This action calls the \fBXmNarmCallback\fP callbacks\&. .IP "\fB\fP:" 10 In a menu, this action unposts all menus in the menu hierarchy and activates the PushButtonGadget\&. It calls the \fBXmNactivateCallback\fP callbacks and then the \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 If the PushButtonGadget is not in a menu, this action draws the shadow in the unarmed state\&. If \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used for the button face\&. If the pointer is still within the button, this action calls the callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP\&. .IP "\fB\fP\fB(2+)\fP:" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action increments \fIclick_count\fP in the callback structure and draws the shadow in the unarmed state\&. If the button is not in a menu and if \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, \fBXmNlabelPixmap\fP is used for the button face\&. If the pointer is within the PushButtonGadget, this action calls the callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP\&. .IP "\fB\fP\fB\fP:" 10 In a menu, this action unposts all menus in the menu hierarchy, unless the button is already armed, and calls the \fBXmNarmCallback\fP callbacks, the \fBXmNactivateCallback\fP and the \fBXmNdisarmCallback\fP callbacks\&. Outside a menu, \fBKActivate\fP has no effect\&. For PushButtonGadgets outside of a menu, if the parent is a manager, this action passes the event to the parent\&. .IP "\fB\fP\fB\fP:" 10 In a menu, this action unposts all menus in the menu hierarchy, unless the button is already armed, and calls the \fBXmNarmCallback\fP callbacks\&. This acton calls the \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, this action draws the shadow in the armed state and, if \fBXmNfillOnArm\fP is set to True, fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, \fBXmNarmPixmap\fP is used for the button face\&. This action calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, this action also arranges for the following to happen, either immediately or at a later time: the shadow is drawn in the unarmed state and, if \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used for the button face\&. The \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP callbacks are called\&. .IP "\fB\fP\fB\fP:" 10 In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy and restores keyboard focus to the widget that had the focus before the menu system was entered\&. This action calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "\fB\fP\fB\fP:" 10 In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, unposts the menu\&. .IP "" 10 In a Popup MenuPane, unposts the menu and restores keyboard focus to the widget from which the menu was posted\&. For a PushButtonGadget outside of a menu, if the parent is a manger, this action passes the event to the parent\&. .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the armed state and calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 If the PushButtonGadget is not in a menu and the cursor leaves and then reenters the PushButtonGadget while the button is pressed, this action draws the shadow in the armed state\&. If \fBXmNfillOnArm\fP is set to True, it also fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNarmPixmap\fP is used for the button face\&. .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the unarmed state and calls the \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 If the PushButtonGadget is not in a menu and the cursor leaves the PushButtonGadget while the button is pressed, this action draws the shadow in the unarmed state\&. If \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used for the button face\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBObject\fP(3), \fBRectObj\fP(3), \fBXmCreatePushButtonGadget\fP(3), \fBXmGadget\fP(3), \fBXmLabelGadget\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreatePushButtonGadget\fP(3), and \fBXmVaCreateManagedPushButtonGadget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateDialogShell.30000644000175000017500000000352712672140200015646 00000000000000'\" t ...\" CreDia.sgm /main/7 1996/08/30 14:31:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateDialogShell" "library call" .SH "NAME" \fBXmCreateDialogShell\fP \(em The DialogShell widget creation function .iX "XmCreateDialogShell" .iX "creation functions" "XmCreateDialogShell" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateDialogShell\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateDialogShell\fP creates an instance of a DialogShell widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of DialogShell and its associated resources, see \fBXmDialogShell\fP(3)\&. .SH "RETURN" .PP Returns the DialogShell widget ID\&. .SH "RELATED" .PP \fBXmDialogShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmRenderTableCopy.30000644000175000017500000000404612672140200015352 00000000000000'\" t ...\" RendTaC.sgm /main/8 1996/09/08 20:57:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableCopy" "library call" .SH "NAME" \fBXmRenderTableCopy\fP \(em A render table function that copies renditions .iX "XmRenderTableCopy" .SH "SYNOPSIS" .PP .nf #include \fBXmRenderTable \fBXmRenderTableCopy\fP\fR( \fBXmRenderTable \fBtable\fR\fR, \fBXmStringTag \fB*tags\fR\fR, \fBint \fBtag_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableCopy\fP creates a new render table which will contain the renditions of the \fItable\fP whose tags match those in \fItags\fP\&. .IP "\fItable\fP" 10 Specifies the table containing the renditions to be copied\&. .IP "\fItags\fP" 10 Specifies an array of tags, whose corresponding renditions are to be copied\&. NULL indicates that the complete table should be copied\&. .IP "\fItag_count\fP" 10 Specifies the number of tags in \fItags\fP\&. .SH "RETURN" .PP Returns NULL if \fItable\fP is NULL\&. Otherwise, this function returns the new render table\&. This function allocates space to hold the new render table\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXmRenderTableFree\fP\&. .SH "RELATED" .PP \fBXmRendition\fP(3) and \fBXmRenderTableFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmInternAtom.30000644000175000017500000000355712672140200014416 00000000000000'\" t ...\" InternA.sgm /main/8 1996/09/25 10:03:28 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmInternAtom" "library call" .SH "NAME" \fBXmInternAtom\fP \(em A macro that returns an atom for a given name .iX "XmInternAtom" .iX "atoms" .SH "SYNOPSIS" .PP .nf #include \fBAtom \fBXmInternAtom\fP\fR( \fBDisplay \fB* display\fR\fR, \fBString \fBname\fR\fR, \fBBoolean \fBonly_if_exists\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmInternAtom\fP returns an atom for a given name\&. The returned atom remains defined even after the client\&'s connection closes\&. The returned atom becomes undefined when the last connection to the X server closes\&. .IP "\fIdisplay\fP" 10 Specifies the connection to the X server .IP "\fIname\fP" 10 Specifies the name associated with the atom you want returned\&. The value of \fIname\fP is case dependent\&. .IP "\fIonly_if_exists\fP" 10 Specifies a Boolean value\&. If False, the atom is created even if it does not exist\&. (If it does not exist, the returned atom will be \fBNone\fP\&.) If True, the atom is created only if it exists\&. .SH "RETURN" .PP Returns an atom\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmCreateRadioBox.30000644000175000017500000000551412672140200015164 00000000000000'\" t ...\" CreRad.sgm /main/8 1996/09/08 20:35:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateRadioBox" "library call" .SH "NAME" \fBXmCreateRadioBox\fP \(em A RowColumn widget convenience creation function .iX "XmCreateRadioBox" .iX "creation functions" "XmCreateRadioBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateRadioBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateRadioBox\fP creates an instance of a RowColumn widget of type \fBXmWORK_AREA\fP and returns the associated widget ID\&. Typically, this is a composite widget that contains multiple ToggleButtonGadgets\&. The RadioBox arbitrates and ensures that at most one ToggleButtonGadget is on at any time\&. .PP Unless the application supplies other values in the \fIarglist\fP, this function provides initial values for several RowColumn resources\&. It initializes \fBXmNpacking\fP to \fBXmPACK_COLUMN\fP, \fBXmNradioBehavior\fP to True, \fBXmNisHomogeneous\fP to True, and \fBXmNentryClass\fP to \fBXmToggleButtonGadgetClass\fR\&. .PP In a RadioBox, the ToggleButton or ToggleButtonGadget resource \fBXmNindicatorType\fP defaults to \fBXmONE_OF_MANY\fP, and the ToggleButton or ToggleButtonGadget resource\fBXmNvisibleWhenOff\fP defaults to True\&. .PP This routine is provided as a convenience function for creating RowColumn widgets\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleCheckBox\fP(3), \fBXmCreateSimpleRadioBox\fP(3), \fBXmCreateWorkArea\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreateSimpleCheckBox\fP(3), and \fBXmVaCreateSimpleRadioBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmRepTypeRegister.30000644000175000017500000001002312672140200015415 00000000000000'\" t ...\" RepTypRe.sgm /main/8 1996/09/08 20:58:50 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeRegister" "library call" .SH "NAME" \fBXmRepTypeRegister\fP \(em A representation type manager function that registers a representation type resource .iX "XmRepTypeRegister" .iX "representation type manager functions" "XmRepTypeRegister" .SH "SYNOPSIS" .PP .nf #include \fBXmRepTypeId \fBXmRepTypeRegister\fP\fR( \fBString \fBrep_type\fR\fR, \fBString *\fBvalue_names\fR\fR, \fBunsigned char *\fBvalues\fR\fR, \fBunsigned char \fBnum_values\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRepTypeRegister\fP registers a representation type resource with the representation type manager\&. All features of the representation type management facility become available for the specified representation type\&. The function installs a forward type converter to convert string values to numerical representation type values\&. .PP When the \fIvalues\fP argument is NULL, consecutive numerical values are assumed\&. The order of the strings in the \fIvalue_names\fP array determines the numerical values for the resource\&. For example, the first value name is 0 (zero); the second value name is 1; and so on\&. .PP If it is non-NULL, the \fIvalues\fP argument can be used to assign values to representation types that have nonconsecutive values or have duplicate names for the same value\&. Representation types registered in this manner will consume additional storage and will be slightly slower than representation types with consecutive values\&. .PP A representation type can only be registered once; if the same representation type name is registered more than once, the behavior is undefined\&. .PP The function \fBXmRepTypeAddReverse\fP installs a reverse converter for a registered representation type\&. The reverse converter takes a representation type numerical value and returns the corresponding string value\&. If the list of numerical values for a representation type contains duplicate values, the reverse converter uses the first name in the \fIvalue_names\fP list that matches the specified numeric value\&. For example, if a \fIvalue_names\fP array has \fIcancel\fP, \fIproceed\fP, and \fIabort\fP, and the corresponding \fIvalues\fP array contains 0, 1, and 0, the reverse converter will return \fIcancel\fP instead of \fIabort\fP for an input value of 0\&. .IP "\fIrep_type\fP" 10 Specifies the representation type name\&. .IP "\fIvalue_names\fP" 10 Specifies a pointer to an array of value names associated with the representation type\&. A value name is specified in lowercase characters without an \fBXm\fP prefix\&. Words within a name are separated with underscores\&. .IP "\fIvalues\fP" 10 Specifies a pointer to an array of values associated with the representation type\&. A value in this array is associated with the value name in the corresponding position of the \fIvalue_names\fP array\&. .IP "\fInum_values\fP" 10 Specifies the number of entries in the \fIvalue_names\fP and \fIvalues\fP arrays\&. .SH "RETURN" .PP Returns the identification number for the specified representation type\&. .SH "RELATED" .PP \fBXmRepTypeAddReverse\fP(3), \fBXmRepTypeGetId\fP(3), \fBXmRepTypeGetNameList\fP(3), \fBXmRepTypeGetRecord\fP(3), \fBXmRepTypeGetRegistered\fP(3), and \fBXmRepTypeValidValue\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmRemoveProtocolCallback.30000644000175000017500000000442412672140200016724 00000000000000'\" t ...\" RemPrA.sgm /main/7 1996/08/30 15:55:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRemoveProtocolCallback" "library call" .SH "NAME" \fBXmRemoveProtocolCallback\fP \(em A VendorShell function that removes a callback from the internal list .iX "XmRemoveProtocol\\%Callback" .iX "VendorShell functions" "XmRemoveProtocol\\%Callback" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmRemoveProtocolCallback\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBproperty\fR\fR, \fBAtom \fBprotocol\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR, \fBXtPointer \fBclosure\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRemoveProtocolCallback\fP removes a callback from the internal list\&. .PP \fBXmRemoveWMProtocolCallback\fP is a convenience interface\&. It calls \fBXmRemoveProtocolCallback\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIproperty\fP" 10 Specifies the protocol property .IP "\fIprotocol\fP" 10 Specifies the protocol atom .IP "\fIcallback\fP" 10 Specifies the procedure to call when a protocol message is received .IP "\fIclosure\fP" 10 Specifies the client data to be passed to the callback when it is invoked .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddProtocolCallback\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveWMProtocolCallback\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmTextFieldSetAddMode.30000644000175000017500000000341312672140200016107 00000000000000'\" t ...\" TxtFieAZ.sgm /main/8 1996/09/08 21:15:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetAddMode" "library call" .SH "NAME" \fBXmTextFieldSetAddMode\fP \(em A TextField function that sets the state of Add mode .iX "XmTextFieldSetAddMode" .iX "TextField functions" "XmTextFieldSetAddMode" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetAddMode\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBstate\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetAddMode\fP controls whether or not the TextField widget is in Add mode\&. When the widget is in Add mode, the insert cursor can be moved without disturbing the primary selection\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIstate\fP" 10 Specifies whether or not the widget is in Add mode\&. A value of True turns on Add mode; a value of False turns off Add mode\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextFieldCut.30000644000175000017500000000537512672140200014702 00000000000000'\" t ...\" TxtFieAE.sgm /main/8 1996/09/08 21:12:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldCut" "library call" .SH "NAME" \fBXmTextFieldCut\fP \(em A TextField function that copies the primary selection to the clipboard and deletes the selected text .iX "XmTextFieldCut" .iX "TextField functions" "XmTextFieldCut" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldCut\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldCut\fP copies the primary selected text to the clipboard and then deletes the primary selected text\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. .PP This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmMOVE\fP\&. If the transfer is successful, this routine then calls the \fBXmNconvertCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBDELETE\fP target\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .IP "\fItime\fP" 10 Specifies the time at which the selection value is to be modified\&. This should be the time of the event that triggered this request\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextCopy.30000644000175000017500000000426212672140200014107 00000000000000'\" t ...\" TxtCopy.sgm /main/8 1996/09/08 21:11:53 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextCopy" "library call" .SH "NAME" \fBXmTextCopy\fP \(em A Text function that copies the primary selection to the clipboard .iX "XmTextCopy" .iX "Text functions" "XmTextCopy" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextCopy\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextCopy\fP copies the primary selected text to the clipboard\&. .PP This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmCOPY\fP\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fItime\fP" 10 Specifies the server time at which the selection value is to be modified\&. This should be the time of the event which triggered this request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed()\fP\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmVaCreateManagedContainer.30000644000175000017500000000003712672140200017136 00000000000000.so man3/XmVaCreateContainer.3 motif-2.3.8/doc/man/man3/XmCvtTextPropertyToXmStringTable.30000644000175000017500000001103712672140200020443 00000000000000'\" t ...\" CvtTxtPr.sgm /main/9 1996/09/08 20:37:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCvtTextPropertyToXmStringTable" "library call" .SH "NAME" \fBXmCvtTextPropertyToXmStringTable\fP \(em A function that converts from a TextProperty Structure to a StringTable .iX "XmCvtTextPropertyToXmStringTable" .SH "SYNOPSIS" .PP .nf #include int XmCvtTextPropertyToXmStringTable (\fIdisplay, text_prop, string_table_return, count_return\fP) Display *\fIdisplay\fP; XTextProperty *\fItext_prop\fP; XmStringTable *\fIstring_table_return\fP; int *\fIcount_return\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmCvtTextPropertyToXmStringTable\fP converts the specified \fBXTextProperty\fP structure into an \fBXmStringTable\fR, as follows: .IP " \(bu" 6 If the encoding member of \fItext_prop\fP is the Atom \fBSTRING\fP, each returned \fBXmString\fR has a tag of "ISO8859-1" and a text type of \fBXmCHARSET_TEXT\fP\&. .IP " \(bu" 6 If the encoding member of \fItext_prop\fP is the encoding of the current locale, and if that encoding is not \fBSTRING\fP, each returned \fBXmString\fR has a tag of \fB_MOTIF_DEFAULT_LOCALE\fP and a text type of \fBXmMULTIBYTE_TEXT\fP\&. .IP " \(bu" 6 If the encoding member of \fItext_prop\fP is other than \fBSTRING\fP or the encoding of the current locale, the contents of the returned compound strings are implementation dependent\&. .PP If conversion depends on the locale and the current locale is not supported, the function returns \fBXLocaleNotSupported\fP\&. If conversion to the encoding of the current locale is required and if the locale is supported but no converter is available for the encoding specified in \fItext_prop\fP, the function returns \fBXConverterNotFound\fP\&. For supported locales, existence of a converter from \fBCOMPOUND_TEXT\fP, \fBSTRING\fP, \fBUTF8_STRING\fP, or the encoding of the current locale is guaranteed if \fBXSupportsLocale\fP returns True for the current locale (but the actual text may contain unconvertible characters)\&. Conversion of other encodings to the encoding of the current locale is implementation dependent\&. In all of these error cases, the function does not set any return values\&. .PP If an element of the value member of \fItext_prop\fP is not convertible to \fBXmString\fR, the corresponding entry in the returned \fBXmStringTable\fR will be NULL, and \fBXmCvtTextPropertyToXmStringTable\fP returns Success\&. .PP To free the storage for the \fBXmStringTable\fR and its \fIcount_return\fP compound strings returned by this function, first free each \fBXmString\fR in the table using \fBXmStringFree\fP, and then free the \fBXmStringTable\fR itself using \fBXtFree\fP\&. .IP "\fIdisplay\fP" 10 Specifies the connection to the X server\&. .IP "\fItext_prop\fP" 10 Specifies a pointer to the \fBXTextProperty\fP\&. The format member of \fItext_prop\fP must be 8\&. .IP "\fIstring_table_return\fP" 10 Specifies the \fBXmStringTable\fR array into which the converted compound strings are placed\&. .IP "\fIcount_return\fP" 10 Specifies the number of \fBXmString\fRs returned by this function\&. .SH "RETURN VALUES" .PP Upon success, this function returns the set of \fBXmString\fRs in \fIstring_table_return\fP, and it returns the number of \fBXmString\fRs in \fIcount_return\fP, and returns Success\&. Otherwise, it returns the following: .IP "\fBXLocaleNotSupported\fP" 10 Returned if conversion depends on the locale and the current locale is not supported\&. .IP "\fBXConverterNotFound\fP" 10 Returned if conversion to the encoding of the current locale is required and if the locale is supported but no converter is available for the encoding specified in \fItext_prop\fP\&. .SH "RELATED INFORMATION" .PP \fBXmCvtXmStringTableToTextProperty\fP(3), \fBXmText\fP(3), and \fBXmTextGetString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmCreateOptionMenu.30000644000175000017500000001273412672140200015554 00000000000000'\" t ...\" CreOpt.sgm /main/9 1996/09/08 20:34:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateOptionMenu" "library call" .SH "NAME" \fBXmCreateOptionMenu\fP \(em A RowColumn widget convenience creation function .iX "XmCreateOptionMenu" .iX "creation functions" "XmCreateOptionMenu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateOptionMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateOptionMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_OPTION\fP and returns the associated widget ID\&. .PP It is provided as a convenience function for creating a RowColumn widget configured to operate as an OptionMenu and is not implemented as a separate widget class\&. .PP The OptionMenu widget is a specialized RowColumn manager composed of a label, a selection area, and a single Pulldown menu pane\&. When an application creates an OptionMenu widget, it supplies the label string and the Pulldown menu pane\&. In order for the operation to be successful, there must be a valid \fBXmNsubMenuId\fP resource set when this function is called\&. The LabelGadget and the selection area (a CascadeButtonGadget) are created by the OptionMenu\&. .PP The OptionMenu\&'s Pulldown menu pane must not contain any ToggleButtons or ToggleButtonGadgets\&. The results of including CascadeButtons or CascadeButtonGadgets in the OptionMenu\&'s Pulldown menu pane are undefined\&. .PP An OptionMenu is laid out with the label displayed on one side of the widget and the selection area on the other side when \fBXmNorientation\fP is \fBXmHORIZONTAL\fP\&. The layout of the label with respect to the selection area depends on the \fBXmNlayoutDirection\fP resource in the horizontal orientation\&. If the value is \fBXmVERTICAL\fP, the label is above the selection area\&. The selection area has a dual purpose; it displays the label of the last item selected from the associated Pulldown menu pane, and it provides the means for posting the Pulldown menu pane\&. .PP The OptionMenu typically does not display any 3-D visuals around itself or the internal LabelGadget\&. By default, the internal CascadeButtonGadget has a visible 3-D shadow\&. The application may change this by getting the CascadeButtonGadget ID using \fBXmOptionButtonGadget\fP, and then calling \fBXtSetValues\fP using the standard visual-related resources\&. .PP The Pulldown menu pane is posted when the mouse pointer is moved over the selection area and a mouse button that is defined by OptionMenu\&'s RowColumn parent is pressed\&. The Pulldown menu pane is posted and positioned so that the last selected item is directly over the selection area\&. The mouse is then used to arm the desired menu item\&. When the mouse button is released, the armed menu item is selected and the label within the selection area is changed to match that of the selected item\&. By default, \fBBSelect\fP is used to interact with an OptionMenu\&. The default can be changed with the RowColumn resource \fBXmNmenuPost\fP\&. .PP The OptionMenu also operates with the keyboard interface mechanism\&. If the application has established a mnemonic with the OptionMenu, pressing \fB\fP with the mnemonic causes the Pulldown menu pane to be posted with traversal enabled\&. The standard traversal keys can then be used to move within the menu pane\&. Pressing \fB\fP or typing a mnemonic or accelerator for one of the menu items selects that item\&. .PP An application may use the \fBXmNmenuHistory\fP resource to indicate which item in the Pulldown menu pane should be treated as the current choice and have its label displayed in the selection area\&. By default, the first selectable item in the Pulldown menu pane is used\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of an OptionMenu\&. These widgets (or gadgets) and the associated OptionMenu areas are .IP "Option Menu Label Gadget" 10 \fBOptionLabel\fP .IP "Option Menu Cascade Button" 10 \fBOptionButton\fP .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCascadeButtonGadget\fP(3), \fBXmCreatePulldownMenu\fP(3), \fBXmCreateSimpleOptionMenu\fP(3), \fBXmLabelGadget\fP(3), \fBXmOptionButtonGadget\fP(3), \fBXmOptionLabelGadget\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimpleOptionMenu\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmDropTransferStart.30000644000175000017500000000432712672140200015761 00000000000000'\" t ...\" DropTrC.sgm /main/8 1996/09/08 20:42:38 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropTransferStart" "library call" .SH "NAME" \fBXmDropTransferStart\fP \(em A Drag and Drop function that initiates a drop transfer .iX "XmDropTransferStart" .iX "Drag and Drop functions" "XmDropTransferStart" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmDropTransferStart\fP\fR( \fBWidget \fBwidget\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropTransferStart\fP initiates a drop transfer and uses the specified argument list to initialize an \fBXmDropTransfer\fP object\&. The DropTransfer object can be manipulated with \fBXtSetValues\fP and \fBXtGetValues\fP until the last call to the \fBXmNtransferProc\fP procedure is made\&. After that point, the result of using the widget pointer is undefined\&. The DropTransfer object is freed by the toolkit when a transfer is complete\&. .IP "\fIwidget\fP" 10 Specifies the ID of the DragContext widget associated with the transaction .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of DropTransfer and its associated resources, see \fBXmDropTransfer\fP(3)\&. .SH "RETURN" .PP Returns the ID of the DropTransfer widget\&. .SH "RELATED" .PP \fBXmDragContext\fP(3), \fBXmDropTransfer\fP(3), and \fBXmDropTransferAdd\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmSelectionBox.30000644000175000017500000006035512672140200014733 00000000000000'\" t ...\" SelectA.sgm /main/12 1996/09/26 14:54:17 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSelectionBox" "library call" .SH "NAME" \fBXmSelectionBox\fP \(em The SelectionBox widget class .iX "XmSelectionBox" .iX "widget class" "SelectionBox" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP SelectionBox is a general dialog widget that allows the user to select one item from a list\&. By default, a SelectionBox includes the following: .IP " \(bu" 6 A scrolling list of alternatives .IP " \(bu" 6 An editable text field for the selected alternative .IP " \(bu" 6 Labels for the list and text field .IP " \(bu" 6 Three or four buttons .PP The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. By default an \fBApply\fP button is also created; if the parent of the SelectionBox is a DialogShell, it is managed; otherwise it is unmanaged\&. Additional children may be added to the SelectionBox after creation\&. The first child is used as a work area\&. The value of \fBXmNchildPlacement\fP determines if the work area is placed above or below the Text area, or above or below the List area\&. Additional children are laid out in the following manner: .IP "Menubar" 10 The first menu bar child is placed at the top of the window\&. The \fBXmQTmenuSystem\fP trait is used to check that it is the first MenuBar child\&. .IP "Buttons" 10 All \fBXmPushButton\fP widgets or gadgets, and their subclasses are placed after the \fBOK\fP button in the order of their creation (this order is checked using the \fBXmQTactivatable\fP trait)\&. The layout direction of the buttons depends on the \fBXmNlayoutDirection\fP resource\&. .PP The layout of additional children that are not in the above categories is undefined\&. .PP The user can select an item in two ways: by scrolling through the list and selecting the desired item or by entering the item name directly into the text edit area\&. Selecting an item from the list causes that item name to appear in the selection text edit area\&. .PP The user may select a new item as many times as desired\&. The item is not actually selected until the user presses the \fBOK\fP PushButton\&. .PP The default value for the \fBXmBulletinBoard\fP resource \fBXmNcancelButton\fP is the Cancel button, unless \fBXmNdialogType\fP is \fBXmDIALOG_COMMAND\fP, when the default is NULL\&. The default value for the \fBXmBulletinBoard\fP \fBXmNdefaultButton\fP resource is the OK button, unless \fBXmNdialogType\fP is \fBXmDIALOG_COMMAND\fP, when the default is NULL\&. .PP For SelectionBox and its subclasses, the default value for \fBXmNinitialFocus\fP is the text edit area\&. .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of SelectionBox\&. The following list identifies the names of these widgets (or gadgets) and the associated SelectionBox areas: .IP "List Items Label" 10 \fBItems\fP .IP "List Items" 10 \fBItemsList\fP .IP "Selection Label" 10 \fBSelection\fP .IP "Selection Text" 10 \fBText\fP or \fBTextField\fP .IP "Selection Separator" 10 \fBSeparator\fP .PP SelectionBox uses the \fBXmQTaccessTextual\fP, \fBXmQTactivatable\fP, and \fBXmQTmenuSystem\fP traits\&. .SS "Descendants" .PP SelectionBox automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBApply\fP\fBXmPushButtonGadget\fPApply button ___ \fBCancel\fP\fBXmPushButtonGadget\fPCancel button ___ \fBHelp\fP\fBXmPushButtonGadget\fPHelp button ___ \fBItems\fP\fBXmLabelGadget\fPtitle above the list of items ___ \fBItemsList\fP\fBXmList\fPT{ list of items from which the user will select T} ___ \fBItemsListSW\fP\fBXmScrolledWindow\fPScrolledWindow parent of \fBItemsList\fP ___ \fBOK\fP\fBXmPushButtonGadget\fPOK button ___ \fBSelection\fP\fBXmLabelGadget\fPtitle above the selection box ___ \fBSeparator\fP\fBXmSeparatorGadget\fPT{ dividing line between selection box and buttons T} ___ \fBText\fP\fBXmTextField\fPT{ selection box containing text of selected item T} ___ .TE .SS "Classes" .PP SelectionBox inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP, and \fBXmBulletinBoard\fP\&. .PP The class pointer is \fBxmSelectionBoxWidgetClass\fP\&. .PP The class name is \fBXmSelectionBox\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmSelectionBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNapplyCallbackXmCCallbackXtCallbackListNULLC _____ XmNapplyLabelStringXmCApplyLabelStringXmStringdynamicCSG _____ XmNcancelCallbackXmCCallbackXtCallbackListNULLC _____ XmNcancelLabelStringXmCCancelLabelStringXmStringdynamicCSG _____ XmNchildPlacementXmCChildPlacementunsigned charXmPLACE_ABOVE_SELECTIONCSG _____ XmNdialogTypeXmCDialogTypeunsigned chardynamicCG _____ XmNhelpLabelStringXmCHelpLabelStringXmStringdynamicCSG _____ XmNlistItemCountXmCItemCountint0CSG _____ XmNlistItemsXmCItemsXmStringTableNULLCSG _____ XmNlistLabelStringXmCListLabelStringXmStringdynamicCSG _____ XmNlistVisibleItemCountXmCVisibleItemCountintdynamicCSG _____ XmNminimizeButtonsXmCMinimizeButtonsBooleanFalseCSG _____ XmNmustMatchXmCMustMatchBooleanFalseCSG _____ XmNnoMatchCallbackXmCCallbackXtCallbackListNULLC _____ XmNokCallbackXmCCallbackXtCallbackListNULLC _____ XmNokLabelStringXmCOkLabelStringXmStringdynamicCSG _____ XmNselectionLabelStringXmCSelectionLabelStringXmStringdynamicCSG _____ XmNtextAcceleratorsXmCTextAcceleratorsXtAcceleratorsdefaultC _____ XmNtextColumnsXmCColumnsshortdynamicCSG _____ XmNtextStringXmCTextStringXmString""CSG _____ .TE .IP "\fBXmNapplyCallback\fP" 10 Specifies the list of callbacks called when the user activates the \fBApply\fP button\&. The callback reason is \fBXmCR_APPLY\fP\&. .IP "\fBXmNapplyLabelString\fP" 10 Specifies the string label for the \fBApply\fP button\&. The default for this resource depends on the locale\&. In the C locale the default is \fBApply\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNcancelCallback\fP" 10 Specifies the list of callbacks called when the user activates the \fBCancel\fP button\&. The callback reason is \fBXmCR_CANCEL\fP\&. .IP "\fBXmNcancelLabelString\fP" 10 Specifies the string label for the \fBCancel\fP button\&. The default for this resource depends on the locale\&. In the C locale the default is \fBCancel\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNchildPlacement\fP" 10 Specifies the placement of the work area child\&. The possible values are .RS .IP "\fBXmPLACE_ABOVE_SELECTION\fP" 10 Places the work area child above the Text area .IP "\fBXmPLACE_BELOW_SELECTION\fP" 10 Places the work area child below the Text area .IP "\fBXmPLACE_TOP\fP" 10 Places the work area child above the List area, and below a MenuBar, if one is present .RE .IP "\fBXmNdialogType\fP" 10 Determines the set of SelectionBox children widgets that are created and managed at initialization\&. The possible values are .RS .IP "\fBXmDIALOG_PROMPT\fP" 10 All standard children except the list and list label are created, and all except the \fBApply\fP button are managed .IP "\fBXmDIALOG_COMMAND\fP" 10 Only the list, the selection label, and the text field are created and managed .IP "\fBXmDIALOG_SELECTION\fP" 10 All standard children are created and managed .IP "\fBXmDIALOG_FILE_SELECTION\fP" 10 All standard children are created and managed .IP "\fBXmDIALOG_WORK_AREA\fP" 10 All standard children are created, and all except the \fBApply\fP button are managed .RE .IP "" 10 If the parent of the SelectionBox is a DialogShell, the default is \fBXmDIALOG_SELECTION\fP; otherwise, the default is \fBXmDIALOG_WORK_AREA\fP\&. \fBXmCreatePromptDialog\fP and \fBXmCreateSelectionDialog\fP set and append this resource to the creation \fIarglist\fP supplied by the application\&. This resource cannot be modified after creation\&. .IP "\fBXmNhelpLabelString\fP" 10 Specifies the string label for the \fBHelp\fP button\&. The default for this resource depends on the locale\&. In the C locale the default is \fBHelp\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNlistItems\fP" 10 Specifies the items in the SelectionBox list\&. \fBXtGetValues\fP for this resource returns the list items themselves, not a copy of the list items\&. The application must not free the returned items\&. .IP "\fBXmNlistItemCount\fP" 10 Specifies the number of items in the SelectionBox list\&. The value must not be negative\&. .IP "\fBXmNlistLabelString\fP" 10 Specifies the string label to appear above the SelectionBox list containing the selection items\&. The default for this resource depends on the locale\&. In the C locale the default is \fBItems\fP unless \fBXmNdialogType\fP is \fBXmDIALOG_PROMPT\fP; in this case the default is NULL\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNlistVisibleItemCount\fP" 10 Specifies the number of items displayed in the SelectionBox list\&. The value must be greater than 0 (zero) unless \fBXmNdialogType\fP is \fBXmDIALOG_PROMPT\fP; in this case, the value is always 0\&. The default is dynamic based on the height of the list\&. .IP "\fBXmNminimizeButtons\fP" 10 Sets the buttons to the width of the widest button and height of the tallest button if False\&. If True, button width and height are not modified\&. .IP "\fBXmNmustMatch\fP" 10 Specifies whether the selection widget should check if the user\&'s selection in the text edit field has an exact match in the SelectionBox list when the \fBOK\fP button is activated\&. If the selection does not have an exact match, and \fBXmNmustMatch\fP is True, the \fBXmNnoMatchCallback\fP callbacks are called\&. If the selection does have an exact match or if \fBXmNmustMatch\fP is False, \fBXmNokCallback\fP callbacks are called\&. .IP "\fBXmNnoMatchCallback\fP" 10 Specifies the list of callbacks called when the user makes a selection from the text edit field that does not have an exact match with any of the items in the list box\&. The callback reason is \fBXmCR_NO_MATCH\fP\&. Callbacks in this list are called only if \fBXmNmustMatch\fP is true\&. .IP "\fBXmNokCallback\fP" 10 Specifies the list of callbacks called when the user activates the \fBOK\fP button\&. The callback reason is \fBXmCR_OK\fP\&. If the selection text does not match a list item, and \fBXmNmustMatch\fP is True, the \fBXmNnoMatchCallback\fP callbacks are called instead\&. .IP "\fBXmNokLabelString\fP" 10 Specifies the string label for the \fBOK\fP button\&. The default for this resource depends on the locale\&. In the C locale the default is \fBOK\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNselectionLabelString\fP" 10 Specifies the string label for the selection text edit field\&. The default for this resource depends on the locale\&. In the C locale the default is \fBSelection\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNtextAccelerators\fP" 10 Specifies translations added to the Text widget child of the SelectionBox\&. The default includes bindings for the up and down keys for auto selection of list items\&. This resource is ignored if \fBXmNaccelerators\fP is initialized to a nondefault value\&. .IP "\fBXmNtextColumns\fP" 10 Specifies the number of columns in the Text widget\&. The value must be greater than 0 (zero)\&. .IP "\fBXmNtextString\fP" 10 Specifies the text in the text edit selection field\&. .SS "Inherited Resources" .PP SelectionBox inherits behavior and resources from the superclasses in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmBulletinBoard Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowOverlapXmCAllowOverlapBooleanTrueCSG _____ XmNautoUnmanageXmCAutoUnmanageBooleanTrueCG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNcancelButtonXmCWidgetWidgetdynamicSG _____ XmNdefaultButtonXmCWidgetWidgetdynamicSG _____ XmNdefaultPositionXmCDefaultPositionBooleanTrueCSG _____ XmNdialogStyleXmCDialogStyleunsigned chardynamicCSG _____ XmNdialogTitleXmCDialogTitleXmStringNULLCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTableXmRenderTabledynamicCSG _____ XmNmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension10CSG _____ XmNmarginWidthXmCMarginWidthDimension10CSG _____ XmNnoResizeXmCNoResizeBooleanFalseCSG _____ XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_ANYCSG _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_OUTCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNtextTranslationsXmCTranslationsXtTranslationsNULLC _____ XmNunmapCallbackXmCCallbackXtCallbackListNULLC _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; XmString \fIvalue\fP; int \fIlength\fP; } XmSelectionBoxCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fIvalue\fP" 10 Indicates the \fBXmString\fR value selected by the user from the SelectionBox list or entered into the SelectionBox text field .IP "\fIlength\fP" 10 Indicates the size in bytes of the \fBXmString\fR value This member is obsolete and exists for compatibility with earlier releases\&. .SS "Translations" .PP \fBXmSelectionBox\fP inherits translations from \fBXmBulletinBoard\fP\&. .SS "Accelerators" .PP The \fBXmNtextAccelerators\fP are added to the Text descendant of \fBXmSelectionBox\fP\&. The default accelerators are described in the following list\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB:\fP\fB\fP\fB\fP:" 10 SelectionBoxUpOrDown(\fBPrevious\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SelectionBoxUpOrDown(\fBNext\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SelectionBoxUpOrDown(\fBFirst\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SelectionBoxUpOrDown(\fBLast\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SelectionBoxRestore() .IP "\fBs c \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 SelectionBoxRestore() .SS "Action Routines" .PP The XmSelectionBox action routines are .IP "SelectionBoxUpOrDown(\fBPrevious|Next|First|Last\fP):" 10 When called with an argument of \fBPrevious\fP, or 0 (zero) for compatibility, selects the previous item in the list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBNext\fP, or 1 for compatibility, selects the next item in the list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBFirst\fP, or 2 for compatibility, selects the first item in the list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBLast\fP, or 3 for compatibility, selects the last item in the list and replaces the text with that item\&. .IP "SelectionBoxRestore():" 10 Replaces the text value with the list selection\&. If no item in the list is selected, clears the text\&. .SS "Additional Behavior" .PP The SelectionBox widget has the following additional behavior: .IP "\fB\fP\fB\fP:" 10 Calls the activate callbacks for the cancel button if it is sensitive\&. If no cancel button exists and the parent of the SelectionBox is a manager, passes the event to the parent\&. .IP "\fB\fP\fB\fP:" 10 Calls the activate callbacks for the button with the keyboard focus\&. If no button has the keyboard focus, calls the activate callbacks for the default button if it is sensitive\&. In a List widget or single-line Text widget, the List or Text action associated with \fB\fP\fB\fP is called before the SelectionBox actions associated with \fB\fP\fB\fP\&. In a multiline Text widget, any \fB\fP\fB\fP event except \fB\fP\fB\fP calls the Text action associated with \fB\fP\fB\fP, then the SelectionBox actions associated with \fB\fP\fB\fP\&. If no button has the focus, no default button exists, and the parent of the SelectionBox is a manager, passes the event to the parent\&. .IP "\fB\fP:" 10 If \fBXmNmustMatch\fP is True and the text does not match an item in the file list, calls the \fBXmNnoMatchCallback\fP callbacks with reason \fBXmCR_NO_MATCH\fP\&. Otherwise, calls the \fBXmNokCallback\fP callbacks with reason \fBXmCR_OK\fP\&. .IP "\fB\fP:" 10 Calls the \fBXmNapplyCallback\fP callbacks with reason \fBXmCR_APPLY\fP\&. .IP "\fB\fP:" 10 Calls the \fBXmNcancelCallback\fP callbacks with reason \fBXmCR_CANCEL\fP\&. .IP "\fB\fP:" 10 Calls the \fBXmNhelpCallback\fP callbacks with reason \fBXmCR_HELP\fP\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNmapCallback\fP if the SelectionBox is a child of a Dialog shell\&. .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNunmapCallback\fP if the SelectionBox is the child of a DialogShell\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmBulletinBoard\fP(3), \fBXmCreateSelectionBox\fP(3), \fBXmCreateSelectionDialog\fP(3), \fBXmCreatePromptDialog\fP(3), \fBXmManager\fP(3), and \fBXmSelectionBoxGetChild\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmCommandSetValue.30000644000175000017500000000312112672140200015350 00000000000000'\" t ...\" CommSe.sgm /main/7 1996/08/30 14:20:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCommandSetValue" "library call" .SH "NAME" \fBXmCommandSetValue\fP \(em A Command function that replaces a displayed string .iX "XmCommandSetValue" .iX "Command functions" "XmCommandSetValue" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmCommandSetValue\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBcommand\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCommandSetValue\fP replaces the string displayed in the command area of the Command widget with the passed \fBXmString\fR\&. .IP "\fIwidget\fP" 10 Specifies the Command widget ID .IP "\fIcommand\fP" 10 Specifies the passed \fBXmString\fR .PP For a complete definition of Command and its associated resources, see \fBXmCommand\fP(3)\&. .SH "RELATED" .PP \fBXmCommand\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmPrintSetup.30000644000175000017500000001010412672140200014435 00000000000000'\" t ...\" PrtSetup.sgm /main/9 1996/10/02 11:48:23 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPrintSetup" "library call" .SH "NAME" \fBXmPrintSetup\fR \(em setup and create a Print Shell widget .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmPrintSetup\fP\fR( \fBWidget \fBvideo_widget\fR\fR, \fBScreen \fB*print_screen\fR\fR, \fBString \fBprint_shell_name\fR\fR, \fBArgList \fBargs\fR\fR, \fBCardinal \fBnum_args\fR\fR); .fi .SH "DESCRIPTION" .PP A function that does the appropriate setting and creates a realized \fBXmPrintShell\fP that it returns to the caller\&. This function hides the details of the \fBXt\fP to set up a valid print shell heirarchy for the application\&. It is also meant to encourage consistency in the way applications root their print widget hierarchy\&. .PP \fBprint_screen\fP must belong to a Display connection that has already been initialized with \fBXt\fP\&. .PP The \fBvideo_widget\fP is used to get at the application context, application name and class, and \fBargc/argv\fP stored on the \fBapplicationShell\fP that roots this widget\&. If no \fBapplicationShell\fP is found, \fBNULL argv/argc\fP are used\&. .PP \fBXmPrintSetup\fP then creates an unrealized \fBApplicationShell\fP with the same name and class as the one given by the video display, on the print display and on the print screen specified\&. .PP An \fBXmPrintShell\fP is then created as a child of this toplevel shell, using \fBXtCreatePopupShell\fP, with the name \fBprint_shell_name\fP, and using the \fBargs\fP provided\&. It then realizes and maps the print shell, using \fBXtPopup\fP with \fBXtGrabNone\fP\&. .PP This way, application resource files and users can specify print specific attributes using the following syntax (if \fBprint_shell_name\fP is "Print"): .PP .nf \f(CWDtpad\&.Print*textFontList: somefont *Print*background:white *Print*highlightThickness:0\fR .fi .PP .IP "\fIvideo_widget\fP" 10 A video widget to fetch app video data from\&. .IP "\fIprint_screen\fP" 10 A print screen on the print display - specifies the screen onto which the new shell is created\&. .IP "\fIprint_shell_name\fP" 10 Specifies the name of the XmPrintShell created on the X Print server\&. .IP "\fIargs\fP" 10 Specifies the argument list from which to get the resources for the XmPrintShell\&. .IP "\fInum_args\fP" 10 Specifies the number of arguments in the argument list\&. .SH "RETURN VALUE" .PP The id the \fBXmPrintShell\fP widget created on the X Print Server connection, or NULL if an error has occured\&. .SH "ERRORS/WARNINGS" .PP None\&. .SH "EXAMPLES" .PP From the \fBOK\fP callback and the \fBSetUp\fP callback of the primary print dialog widget: .PP .nf \f(CWstatic void printOKCB(Widget, XtPointer call_data, XtPointer client_data) { AppPrint *p = (AppPrint *) client_data; DtPrintSetupCallbackStruct *pbs = (XmPrintCallbackStruct *) call_data; /* connect if not already done\&. the print dialog callback always provides valid printer name, print display and screen already initialized: XpInitContext called */ */ p->print_shell = XmPrintSetup (widget, pbs->print_screen, "Print", NULL, 0); \&.\&.\&. }\fR .fi .PP .SH "SEE ALSO" .PP \fBXmPrintShell\fP(3), \fBXmRedisplayWidget\fP(3), \fBXmPrintToFile\fP(3), \fBXmPrintPopupPDM\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmTextXYToPos.30000644000175000017500000000425012672140200014517 00000000000000'\" t ...\" TxtXYToP.sgm /main/11 1996/09/08 21:20:46 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextXYToPos" "library call" .SH "NAME" \fBXmTextXYToPos\fP \(em A Text function that accesses the character position nearest an x and y position .iX "XmTextXYToPos" .iX "Text functions" "XmTextXYToPos" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmTextXYToPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBPosition \fBx\fR\fR, \fBPosition \fBy\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextXYToPos\fP accesses the character position nearest to the specified \fIx\fP and \fIy\fP position, relative to the upper left corner of the Text widget\&. .PP In the case of horizontal writing, the position is the origin of the character\&. In the case of vertical writing, the position is the vertical origin of the character\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIx\fP" 10 Specifies the \fIx\fP position, relative to the upper left corner of the widget .IP "\fIy\fP" 10 Specifies the \fIy\fP position, relative to the upper left corner of the widget .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns the character position in the text nearest the \fIx\fP and \fIy\fP position specified\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmCreateWarningDialog.30000644000175000017500000000463712672140200016207 00000000000000'\" t ...\" CreWar.sgm /main/8 1996/09/08 20:37:05 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateWarningDialog" "library call" .SH "NAME" \fBXmCreateWarningDialog\fP \(em The MessageBox WarningDialog convenience creation function .iX "XmCreateWarningDialog" .iX "creation functions" "XmCreateWarningDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateWarningDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateWarningDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged MessageBox child of the DialogShell\&. A WarningDialog warns users of action consequences and gives them a choice of resolutions\&. It includes a symbol, a message, and three buttons\&. The default symbol is an exclamation point\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. .PP Use \fBXtManageChild\fP to pop up the WarningDialog (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateWarningDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmComboBox.30000644000175000017500000006310412672140200014040 00000000000000'\" t ...\" ComboBox.sgm /main/16 1996/10/29 16:07:27 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmComboBox" "library call" .SH "NAME" \fBXmComboBox\fP \(em The ComboBox widget class .iX "XmComboBox" .iX "widget class" "ComboBox" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmComboBox\fP combines the capabilities of a single-line TextField widget and a List widget\&. It allows users to perform opoerations like typing and pasting information, and it also provides a list of possible choices that the user can select from to complete the TextField entry field\&. The list can either be displayed at all times or can be dropped down by the user\&. When the list portion of the ComboBox is hidden, users are given a visual cue (a downward-pointing arrow) next to the TextField field\&. The position of the arrow relative to the TextField field depends on the \fBXmNlayoutDirection\fP resource of the widget\&. This version of the ComboBox is called the "drop-down" ComboBox\&. Drop-down ComboBoxes are useful when screen space is limited, or when users will complete the text entry field more often by typing text than by selecting the entry field text from the list\&. The user can access the drop-down ComboBox in either one of two ways: .IP " \(bu" 6 By clicking and releasing \fB\fP on the downward-pointing arrow, which pops the list up, and the list stays up\&. A later selection of an item in the list will cause the item to appear in the text entry field, and the list will unpost itself\&. .IP " \(bu" 6 By pressing \fB\fP on the downward-pointing arrow, dragging it to a list item, and then releasing it there, which selects that item\&. The list disappears, and the selected item appears in the text entry field\&. .PP The application provides an array of strings that fill the list\&. At creation time, string items can be passed to the ComboBox via an arglist\&. Each string becomes an item in the list, with the first string becoming the item in position 1, the second string becoming the item in position 2, and so on\&. The size of the list is set by specifying the number of items that are visible in the list (\fBXmNvisibleItemCount\fP)\&. If the number of items in the list exceeds the number of items that are visible, a vertical scroll bar will automatically appear that allows the user to scroll through a large number of items\&. .PP ComboBox creates two child widgets: a TextField widget for entering text and a ScrolledWindow containing a List for the list of items\&. The name of the items list itself is \fBList\fP, and the name of the TextField is \fBText\fP\&. The application or user can specify resource values for these widgets in a resource file, and the application can use \fBXtNameToWidget\fP (specifying \fB"*List"\fP for the items list or \fB"*Text"\fP for the TextField widget) to obtain the widget IDs of the descendant widgets\&. At creation time, ComboBox passes appropriate resource values in the creation arglist, including \fBXmNitems\fP, to the items list\&. Note that the result of providing the \fBXmNdestroyCallback\fP resource in the creation \fIarglist\fP is unspecified\&. The application should use the \fBXtAddCallback\fP function to add callbacks to the appropriate widget (TextField or List) after creating it\&. .PP ComboBox forces the following resource values on its List child: .IP " \(bu" 6 If \fBXmNcomboBoxType\fP is \fBXmCOMBO_BOX\fP, \fBXmNtraversalOn\fP is forced to False\&. .IP " \(bu" 6 \fBXmNhighlightThickness\fP is forced to 2 in a drop-down ComboBox and to 0 in other types of ComboBoxes\&. .IP " \(bu" 6 \fBXmNborderWidth\fP is forced to 0\&. .IP " \(bu" 6 \fBXmNnavigationType\fP is forced to \fBXmNONE\fP\&. .IP " \(bu" 6 \fBXmNselectionPolicy\fP is forced to \fBXmBROWSE_SELECT\fP\&. .IP " \(bu" 6 \fBXmNlistSizePolicy\fP is forced to \fBXmVARIABLE\fP\&. .IP " \(bu" 6 \fBXmNspacing\fP is forced to 0\&. .IP " \(bu" 6 \fBXmNvisualPolicy\fP is forced to \fBXmVARIABLE\fP\&. .IP " \(bu" 6 \fBXmNselectedPositions\fP is forced to NULL\&. .IP " \(bu" 6 \fBXmNselectedPositionsCount\fP is forced to 0\&. .PP When \fBXmNcomboBoxType\fP is \fBXmDROP_DOWN_LIST\fP, ComboBox forces the following resource values on its TextField child: .IP " \(bu" 6 \fBXmNeditable\fP is forced to False\&. .IP " \(bu" 6 \fBXmNcursorPositionVisible\fP is forced to False\&. .IP " \(bu" 6 \fBXmNshadowThickness\fP is forced to 0\&. .PP By contrast, when \fBXmNcomboBoxType\fP is \fBXmCOMBO_BOX\fP or \fBXmDROP_DOWN_COMBO_BOX\fP, ComboBox forces the following resource values on its TextField child: .IP " \(bu" 6 \fBXmNeditable\fP is forced to True\&. .IP " \(bu" 6 \fBXmNcursorPositionVisible\fP is forced to True\&. .IP " \(bu" 6 \fBXmNeditMode\fP is forced to \fBXmSINGLE_LINE_EDIT\fP\&. .PP ComboBox always forces the values of the following resources on the TextField: .IP " \(bu" 6 \fBXmNnavigationType\fP is forced to \fBXmNONE\fP\&. .IP " \(bu" 6 \fBXmNhighlightThickness\fP is forced to 0\&. .IP " \(bu" 6 \fBXmNborderWidth\fP is forced to 0\&. .PP ComboBox allows a single item to be selected in two ways: by selecting the desired item from the List or by entering text into the TextField\&. ComboBox does not automatically select a list item if the user types that string into the TextField\&. It selects the item when the user presses \fBKActivate\fP or moves the focus\&. ComboBox supports the Browse Select selection model of List (see the \fBXmList\fP reference page for a description of this model), so selections are mutually exclusive\&. Selecting an item from the list causes that item to be displayed in the TextField portion of the ComboBox\&. If an application sets the \fBXmNvalue\fP resource of TextField, that string is shown in the TextField\&. If the application has not provided any list items, or if there is no current selection, the TextField is empty\&. .PP The TextField in the ComboBox widget can be either editable or noneditable, depending on the value of the \fBXmNcomboBoxType\fP resource\&. .PP If the TextField is editable, the user can type into it\&. When the user presses the Return key, the ComboBox will compare the typed entry to the items in the List\&. If there is an exact match, then the matched List item is selected\&. If the application wishes to validate the entered text (for example, to ensure that the typed selection is a valid one), it can do so by setting \fBXmNmodifyVerifyCallback\fP on the TextField widget\&. .PP If the TextField is noneditable, typing text may invoke a matching algorithm that will attempt to match the entered text with items in the list\&. The specific matching algorithm applied, which may be none, is determined by the value of the \fBXmNmatchBehavior\fP resource in ComboBox, which can be either \fBXmNONE\fP or \fBXmQUICK_NAVIGATE\fP\&. A value of \fBXmNONE\fP indicates that no matching algorithm will occur\&. A value of \fBXmQUICK_NAVIGATE\fP indicates that when the List widget has focus, one-character navigation is supported\&. In this algorithm, if the typed character is the initial character of some item in the List, this algorithm causes that item to be navigated to and selected, and the item is displayed in the TextField\&. Subsequently typing the same character will cycle among the items with the same first character\&. .PP Regardless of the selection mechanism used (either selected directly from the List or typed into the TextField), when an item in the List is selected, that item is highlighted in the List\&. In addition, the selected item is displayed in the TextField of the ComboBox\&. If the user performs an action that would move focus away from ComboBox, or selects a List item, the \fBXmNselectionCallback\fP callbacks are invoked to notify the application of the current contents of the TextField (or choice)\&. The application then takes whatever action is required based on those contents (or choice)\&. .PP ComboBox uses the \fBXmQTspecifyRenderTable\fP trait and holds the \fBXmQTaccessTextual\fP trait\&. .SS "Classes" .PP \fBXmComboBox\fP inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmComboBoxWidgetClass\fP\&. .PP The class name is \fBXmComboBox\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .TS tab() box; c s s s s l| l| l| l| l. \fBXmComboBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNarrowSizeXmCArrowSizeDimensiondynamicCSG _____ XmNarrowSpacingXmCArrowSpacingDimensiondynamicCSG _____ XmNcolumnsXmCColumnshortdynamicCSG _____ XmNcomboBoxTypeXmCComboBoxTypeunsigned charXmCOMBO_BOXCG _____ XmNfontListXmCFontListXmFontListNULLCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNitemCountXmCItemCountintdynamicCSG _____ XmNitemsXmCItemsXmStringTabledynamicCSG _____ XmNlistXmCListWidgetdynamicG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmatchBehaviorXmCMatchBehaviorunsigned chardynamicCSG _____ XmNpositionModeXmCPositionModeXtEnumXmZERO_BASEDCG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNselectedItemXmCSelectedItemXmStringNULLCSG _____ XmNselectedPositionXmCSelectedPositionintdynamicCSG _____ XmNselectionCallbackXmCCallbackXmCallbackListNULLC _____ XmtextFieldXmCTextFieldWidgetdynamicG _____ XmNvisibleItemCountXmCVisibleItemCountint10CSG _____ .TE .IP "\fBXmNarrowSize\fP" 10 Specifies the width of the arrow\&. The default size depends on the size of the text, as well as the size of the ComboBox\&. .IP "\fBXmNarrowSpacing\fP" 10 Specifies the space between the text and arrow visual in pixels\&. The default value is obtained from the \fBXmNmarginWidth\fP resource\&. .IP "\fBXmNcolumns\fP" 10 Specifies the number of columns in the text field\&. If unset, the text field\&'s value is used\&. Refer to the \fBXmTextField\fP man page for more detailed information\&. .IP "\fBXmNcomboBoxType\fP" 10 Specifies the type of ComboBox to be created\&. This can be one of the following: .RS .IP "\fBXmCOMBO_BOX\fP" 10 Generates a ComboBox where the list is always displayed, and the text entry field is editable\&. .IP "\fBXmDROP_DOWN_COMBO_BOX\fP" 10 Generates a ComboBox where the list is hidden unless specifically requested, and the text entry field is editable\&. .IP "\fBXmDROP_DOWN_LIST\fP" 10 Generates a ComboBox where the list is hidden unless specifically requested, and the text entry field is noneditable\&. .RE .IP "\fBXmNfontList\fP" 10 Specifies the fontlist associated with \fBXmComboBox\fP\&. The fontlist is an obsolete construct, and has been superseded by the render table\&. It is included for compatibility with earlier versions of Motif, and for applications that do not easily support render tables\&. The default fontlist is derived from the default render table, and if both a fontlist and a render table are specified, the render table takes precedence\&. .IP "\fBXmNhighlightThickness\fP" 10 Specifies the thickness of the highlighting rectangle\&. .IP "\fBXmNitemCount\fP" 10 Specifies the number of items in the list\&. If unset, the lists\&'s value is used\&. Refer to the \fBXmList\fP man page for more detailed information\&. .IP "\fBXmNitems\fP" 10 Specifies the items in the list\&. If unset, the lists\&'s value is used\&. Refer to the \fBXmList\fP man page for more detailed information\&. .IP "\fBXmNlist\fP" 10 The list widget\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the horizontal spacing between the child widgets and the boundary of the ComboBox\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the vertical spacing between the child widgets and the boundary of the ComboBox\&. .IP "\fBXmNmatchBehavior\fP" 10 Defines the matching algorithm applied to match the text typed by the user in the TextField field with items in the list\&. The current values are \fBXmNONE\fP and \fBXmQUICK_NAVIGATE\fP, as follows: .RS .IP "\fBXmNONE\fP" 10 Indicates that there is no assigned matching algorithm\&. .IP "\fBXmQUICK_NAVIGATE\fP" 10 Is only valid for noneditable ComboBoxes (\fBXmNcomboBoxType\fP resource value \fBXmDROP_DOWN_LIST\fP)\&. This algorithm supports 1-character navigation when the List widget has focus\&. If the typed character is the initial character of some item in the List, this algorithm causes that item to be navigated to and selected\&. Subsequently typing the same character will cycle among the items with the same first character\&. .RE .IP "\fBXmNpositionMode\fP" 10 Specifies how the value of the \fBXmNselectedPosition\fP resource and the \fBitem_position\fP field of the callback structure are to be interpreted\&. Note that the convenience functions \fBXmComboBoxDeletePos\fP and \fBXmComboBoxAddItem\fP are not affected by this resource, and (like \fBXmList\fP) always use 1-based positions\&. Valid values for this resource are: .RS .IP "\fBXmZERO_BASED\fP" 10 (DtComboBox compatibility mode: default) \fBXmNselectedPosition\fP is in \fB[0,itemcount-1]\fP\&. The \fBitem_position\fP in the \fBXmComboBoxCallbackStruct\fP is 0 if the first element in the list was selected\&. Note that 0 is also returned if no element in the list was selected (that is, a new item was entered in the text field)\&. .IP "\fBXmONE_BASED\fP" 10 (Motif mode) Both the resource value and the callback fields are 1-based\&. This is consistent with other Motif widgets\&. .RE .IP "\fBXmNrenderTable\fP" 10 Specifies the render table associated with ComboBox\&. This render table is used in both the TextField field and the List in the ComboBox\&. This is used in conjunction with the \fBXmNvisibleItemCount\fP resource of the List to determine the height of the ComboBox widget\&. .IP "" 10 If this value is NULL at initialization, and if the widget parent is \fBXmBulletinBoard\fP or its subclasses, \fBVendorShell\fP or its subclasses, or \fBXmMenuShell\fP, then the widget parent provides the default render table associated with the widget\&. If both a render table and a fontlist are specified, the render table will take precedence\&. .IP "\fBXmNselectedItem\fP" 10 Specifies a compound string that represents the current selection of the ComboBox\&. The selected item is the content of the ComboBox text entry field\&. .IP "\fBXmNselectedPosition\fP" 10 If the selection in the ComboBox is an item in the list, this is the index of the selected item in the list\&. If no item in the list is selected, this is 0\&. .IP "\fBXmNselectionCallback\fP" 10 Specifies the list of callbacks called when an item is selected\&. The reason field in the \fBXmComboBoxCallbackStruct\fR is \fBXmCR_SELECT\fP\&. .IP "\fBXmNtextField\fP" 10 The text field widget\&. .IP "\fBXmNvisibleItemCount\fP" 10 Specifies the number of visible items in the list\&. This will override any value specified for the list\&. Refer to the \fBXmList\fP man page for more detailed information\&. .SS "Inherited Resources" .PP ComboBox inherits behavior and resources from superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmSTICKY_TAG_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback\&. The callback structure is defined as follows: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; XmString \fIitem_or_text\fP; int \fIitem_position\fP; } XmComboBoxCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIitem_or_text\fP" 10 The contents of the text field at the time the event caused the callback\&. The \fIitem_or_text\fP parameter points to a temporary storage space that is reused after the callback is finished\&. If an application needs to save the item, it should copy \fIitem_or_text\fP into its own data space\&. .IP "\fIitem_position\fP" 10 The position of item in the list\&'s \fBXmNitems\fP 1-based array\&. If this is 0, it means that the \fIitem_or_text\fP was not selected from the List\&. .SS "Translations" .PP The ComboBox translations are listed below\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .PP .RS \fBNote: .PP The KPageUp and KPageDown translations do not take effect unless the \fBList\fP child widget is posted\&. .RE .IP "\fB\fP:" 10 CBArmAndDropDownList() .IP "\fB\fP:" 10 CBDisarm() .PP The following lists the List translations in the drop-down list\&. When ComboBox \fBXmNcomboBoxType\fP is \fBXmDROP_DOWN_LIST\fP, \fB\fP, \fB\fP, and \fBReturn\fP are overriden by ComboBox actions\&. .IP "\fB:c\fP \fB\fP:" 10 CBDropDownList() .IP "\fB:c\fP \fB\fP:" 10 CBDropDownList() .IP "\fB:\fP\fB\fP:" 10 CBCancel() .IP "\fB:\fP\fB\fP:" 10 CBActivate() .IP "\fB\(aps \(apm \(apa\fP\fBReturn\fP:" 10 CBActivate() .SS "Accelerators" .PP The following accelerators are added to ComboBox and its children\&. The accelerators may not directly correspond to a translation table\&. If the translation is not listed below, it may depend on the context of the event\&. .IP "\fB:c\fP \fB\fP:" 10 CBDropDownList() .IP "\fB:\fP\fB\fP:" 10 CBListAction(\fBUp\fP) .IP "\fB:c\fP \fB\fP:" 10 CBDropDownList() .IP "\fB:\fP\fB\fP:" 10 CBListAction(\fBDown\fP) .IP "\fB:c\fP \fB\fP:" 10 CBListAction(\fBListBeginData\fP) .IP "\fB:c\fP \fB\fP:" 10 CBListAction(\fBListEndData\fP) .IP "\fB:\fP\fB\fP:" 10 CBListAction(\fBListPrevPage\fP) .IP "\fB:\fP\fB\fP:" 10 CBListAction(\fBListNextPage\fP) .PP A drop-down ComboBox also adds accelerators to its List child\&. Aside from the accelerators that are already listed in this section, those accelerators are the default TextField key translations\&. .SS "Action Routines" .PP The \fBXmComboBox\fP action routines are as follows: .IP "CBActivate():" 10 Calls the \fBXmNselectionCallback\fP callbacks\&. If the \fBXmNcomboBoxType\fP is \fBXmDROP_DOWN_COMBO_BOX\fP or \fBXmDROP_DOWN_LIST\fP, it unposts the list\&. If the parent is a manager, passes the event to the parent\&. .IP "CBArmAndDropDownList():" 10 If the pointer is within the down arrow, draws the shadow of the arrow in the selected state, and then posts the list\&. .IP "CBCancel():" 10 If the \fBXmNcomboBoxType\fP is \fBXmDROP_DOWN_COMBO_BOX\fP or \fBXmDROP_DOWN_LIST\fP, pops down the list\&. If the parent is a manager, passes the event to the parent\&. .IP "CBDisarm():" 10 Redraws the arrow in an unselected state\&. .IP "CBDropDownList():" 10 If \fBXmNcomboBoxType\fP is \fBXmDROP_DOWN\fP or \fBXmDROP_DOWN_LIST\fP, and list is not displayed, posts the list\&. If list is displayed, it unposts the list\&. .IP "CBListAction(\fBListBeginData\fP):" 10 Moves the location cursor to the first item in the list\&. In Normal Mode, this also deselects any current selection, selects the first item in the list, and calls the \fBXmNbrowseSelectionCallback\fP selection callback\&. .IP "CBListAction(\fBListEndData\fP):" 10 Moves the location cursor to the last item in the list\&. In Normal Mode, this also deselects any current selection, selects the last item in the list, and calls the \fBXmNbrowseSelectionCallback\fP selection callback\&. .IP "CBListAction(\fBListPrevPage\fP):" 10 Scrolls the list to the previous page, moving the location cursor to a new item\&. This action also selects the new item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. If the ComboBox is not a drop-down type, then this action does nothing\&. .IP "CBListAction(\fBListNextPage\fP):" 10 Scrolls the list to the next page, moving the location cursor to a new item\&. This action also selects the new item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. If the ComboBox is not a drop-down type, then this action does nothing\&. .IP "CBListAction(\fBUp\fP):" 10 Moves the location cursor to the previous item in the list\&. This action also selects the previous item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. Note that, unlike the List \fBListPrevItem\fP action, this action wraps around\&. .IP "CBListAction(\fBDown\fP):" 10 Moves the location cursor to the next item in the list\&. This action also selects the next item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. Note that, unlike the List \fBListNextItem\fP action, this action wraps around\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "ERRORS/WARNINGS" .PP The toolkit will display a warning if the application tries to set the value of \fBXmNlist\fP or the \fBXmNtextField\fP resource, which are read-only (marked G in the resource table)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBXmCreateComboBox\fP(3), \fBXmList\fP(3), \fBXmManager\fP(3), \fBXmTextField\fP(3), \fBXmVaCreateComboBox\fP(3), and \fBXmVaCreateManagedComboBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateSimpleOptionMenu.30000644000175000017500000001432112672140200017207 00000000000000'\" t ...\" VaCreC.sgm /main/9 1996/09/08 21:21:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmVaCreateSimpleOptionMenu" "library call" .SH "NAME" \fBXmVaCreateSimpleOptionMenu\fP \(em A RowColumn widget convenience creation function .iX "XmVaCreateSimpleOption\\%Menu" .iX "creation functions" "XmVaCreateSimpleOption\\%Menu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmVaCreateSimpleOptionMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBXmString \fBoption_label\fR\fR, \fBKeySym \fBoption_mnemonic\fR\fR, \fBint \fBbutton_set\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmVaCreateSimpleOptionMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_OPTION\fP and returns the associated widget ID\&. This routine uses the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP This routine creates an OptionMenu and its Pulldown submenu containing PushButtonGadget or CascadeButtonGadget children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. The name of each separator is \fBseparator_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of separators in the menu minus 1\&. Buttons and separators are named and created in the order in which they are specified in the variable portion of the argument list\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIoption_label\fP" 10 Specifies the label string to be used on the left side of the OptionMenu\&. .IP "\fIoption_mnemonic\fP" 10 Specifies a keysym for a key that, when pressed by the user, posts the associated Pulldown menu pane\&. .IP "\fIbutton_set\fP" 10 Specifies which PushButtonGadget is initially set\&. The value is the integer \fIn\fP that corresponds to the \fIn\fPth PushButtonGadget specified in the variable portion of the argument list\&. Only a PushButtonGadget can be set, and only PushButtonGadgets are counted in determining the integer \fIn\fP\&. The first PushButtonGadget is number 0 (zero)\&. .IP "\fIcallback\fP" 10 Specifies a callback procedure to be called when a button is activated\&. This callback function is added to each button after creation as the button\&'s \fBXmNactivateCallback\fP\&. The callback function is called when a button is activated, and the button number is returned in the \fIclient_data\fP field\&. .PP The variable portion of the argument list consists of groups of arguments\&. The first argument in each group is a constant or a string and determines which arguments follow in that group\&. The last argument in the list must be NULL\&. Following are the possible first arguments in each group of \fIvarargs\fP: .IP "\fBXmVaPUSHBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the OptionMenu\&'s Pulldown submenu and some of its resource values\&. The button created is a PushButtonGadget\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR .RE .IP "\fBXmVaSEPARATOR\fP" 10 This is followed by no additional arguments\&. It specifies one separator in the OptionMenu\&'s Pulldown submenu\&. .IP "\fBXmVaDOUBLE_SEPARATOR\fP" 10 This is followed by no additional arguments\&. It specifies one separator in the OptionMenu\&'s Pulldown submenu\&. The separator type is \fBXmDOUBLE_LINE\fP\&. .IP "\fIresource_name\fP" 10 This is followed by one additional argument, the value of the resource, of type \fBXtArgVal\fP\&. The pair specifies a resource and its value for the Pulldown submenu\&. .IP "\fBXtVaTypedArg\fP" 10 This is followed by four additional arguments\&. The set specifies a resource and its value for the Pulldown submenu\&. A resource type conversion is performed if necessary\&. Following are the additional four arguments, in order: .RS .IP "\fIname\fP" 10 The resource name, of type \fBString\fR .IP "\fItype\fP" 10 The type of the resource value supplied, of type \fBString\fR .IP "\fIvalue\fP" 10 The resource value (or a pointer to the resource value, depending on the type and size of the value), of type \fBXtArgVal\fP .IP "\fIsize\fP" 10 The size of the resource value in bytes, of type \fIint\fP .RE .IP "\fBXtVaNestedList\fP" 10 This is followed by one additional argument of type \fBXtVarArgsList\fP\&. This argument is a nested list of \fIvarargs\fP returned by \fBXtVaCreateArgsList\fP\&. .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of an OptionMenu\&. The following list identifies the names of these widgets (or gadgets) and the associated OptionMenu areas: .IP "Option Menu Label Gadget" 10 \fBOptionLabel\fP .IP "Option Menu Cascade Button" 10 \fBOptionButton\fP .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateOptionMenu\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleOptionMenu\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmButtonBox.30000644000175000017500000001764712672140200014267 00000000000000.DT .TH XmButtonBox 3X "" .SH NAME \fBXmButtonBox\fP \(em The Button Box class .SH SYNOPSIS .nf #include .fi .SH DESCRIPTION .PP The Button Box widget manages children (usually buttons) in a single row or single column layout. .PP The Button Box maintains equal spacing between its children at all times and attempts to adjust its height and width as necessary so that all children will fit. If this is not possible, due to parent or application programmer constraints, the Button Box will resize its children as necessary to fit within the available space. .PP Note: in what follows, major direction refers to the direction of orientation, and minor direction refers to the perpendicular direction. .SS "Classes" .PP Button Box inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP\&. .PP The class pointer is \fBxmButtonBoxWidgetClass\fP\&. .PP The class name is \fBXmButtonBox\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmButtonBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNequalSizeXmCEqualSizeBooleanFalseCSG _____ XmNfillOptionXmCFillOptionunsigned charXmFillNoneCSG _____ XmNmarginHeightXmCMarginVerticalDimension0CSG _____ XmNmarginWidthXmCMarginHorizontalDimension0CSG _____ XmNorientationXmCOrientationunsigned charXmHORIZONTALCSG _____ XmNdefaultButtonXmCWidgetWidgetNULLSG _____ .TE .IP "\fBXmNequalSize\fP" 10 Specifies whether the children are to be maintained with equal sized heights and widths. The chosen height and width for the children is found by asking each child for its preferred size and taking the largest value in each direction. .IP "\fBXmNfillOption\fP" 10 Specifies how to use any extra space left over once all children have been sized according to either their preference or equalSize. There are four options: .RS .IP "\fBXmFillNone\fP" 10 No automatic filling is performed. Center the children in the minor direction and place the children with equal padding between them in the major direction. .IP "\fBXmFillMinor\fP" 10 Place the children with equal padding between them in the major direction, but force all the children to take on the Button Box minor dimension as their minor direction. .IP "\fBXmFillMajor\fP" 10 Center the children in the minor direction, but expand all the children in their major direction so that there is no padding between them. Expand the children such that their relative sizes remain constant. .IP "\fBXmFillAll\fP" 10 This option combines the placement actions and sizing actions of XmFillMinor and XmFillMajor. .IP "" 10 Regardless of the fill mode, the ButtonBox widget will always leave the specified margin between its edge and the nearest child. A new String to fillOption resource converter has been registered to convert the following strings to fill options: "none", "major", "minor", "all." This resource can therefore be set in an application defaults file. .RE .IP "\fBXmNmarginHeight\fP" 10 .IP "\fBXmNmarginWidth\fP" 10 Specifies the number of pixels to use as a margin around the entire group of children. The marginHeight value applies to both the top and bottom margins, while the marginWidth applies to the left and right margins. .IP "\fBXmNorientation\fP" 10 Specifies whether children are to be placed in a row or a column. The orientation may be either XmHORIZONTAL or XmVERTICAL. If the orientation is XmHORIZONTAL, the children are placed in a row with the major dimension being width and the minor dimension being height. If the value is XmVERTICAL, the children are placed in a column with the major dimension being height and the minor dimension being width. The default value is XmHORIZONTAL. .SS "Inherited Resources" .PP Button Box inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP XmButtonBox inherits translations from XmManager\&. .PP .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateButtonBox\fP(3), \fBXmManager\fP(3), \fBXmVaCreateButtonBox\fP(3), \fBXmVaCreateManagedButtonBox\fP(3)\&. .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmVaCreateSimpleSpinBox.30000644000175000017500000000302212672140200016470 00000000000000.DT .TH "XmVaCreateSimpleSpinBox" "library call" .SH "NAME" \fBXmVaCreateSimpleSpinBox\fP, \fBXmVaCreateManagedSimpleSpinBox\fP \(em A SimpleSpinBox widget convenience creation functions\&. .iX "XmVaCreateToggleSimpleSpinBox" "XmVaCreateManagedSimpleSpinBox" .iX "creation functions" "XmVaCreateSimpleSpinBox" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateSimpleSpinBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedSimpleSpinBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateSimpleSpinBox\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateSimpleSpinBox\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of SimpleSpinBox and its associated resources, see \fBXmSimpleSpinBox\fP(3)\&. .SH "RETURN" .PP Returns the SimpleSpinBox widget ID\&. .SH "RELATED" .PP \fBXmSimpleSpinBox\fP(3), \fBXmCreateSimpleSpinBox\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreatePanedWindow.30000644000175000017500000000352612672140200015675 00000000000000'\" t ...\" CrePan.sgm /main/7 1996/08/30 14:45:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreatePanedWindow" "library call" .SH "NAME" \fBXmCreatePanedWindow\fP \(em The PanedWindow widget creation function .iX "XmCreatePanedWindow" .iX "creation functions" "XmCreatePanedWindow" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreatePanedWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreatePanedWindow\fP creates an instance of a PanedWindow widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of PanedWindow and its associated resources, see \fBXmPanedWindow\fP(3)\&. .SH "RETURN" .PP Returns the PanedWindow widget ID\&. .SH "RELATED" .PP \fBXmPanedWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmTabListCopy.30000644000175000017500000000460612672140200014527 00000000000000'\" t ...\" TabLstCo.sgm /main/8 1996/09/08 21:08:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabListCopy" "library call" .SH "NAME" \fBXmTabListCopy\fP \(em A convenience function that creates a new tab list from an existing list .iX "XmTabListCopy" .SH "SYNOPSIS" .PP .nf #include \fBXmTabList \fBXmTabListCopy\fP\fR( \fBXmTabList \fBtablist\fR\fR, \fBint \fBoffset\fR\fR, \fBCardinal \fBcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabListCopy\fP creates a new tab list consisting of a copy of a portion of the contents of the \fItablist\fP argument\&. This function starts copying at the specified offset value of the tab list and copies \fIcount\fP values\&. .IP "\fItablist\fP" 10 Specifies a tab list to be copied\&. .IP "\fIoffset\fP" 10 Specifies where to start copying\&. A value of 0 (zero) indicates begin at the beginning, a value of 1 indicates to skip the first tab, and so on\&. A negative indicates to begin counting backwards from the end\&. A value of -1 indicates to start copying from the last tab\&. .IP "\fIcount\fP" 10 Specifies the number of tabs to copy\&. A value of 0 (zero) indicates to copy all elements from the starting point to the end (beginning if \fIoffset\fP is negative) of the tab list\&. .SH "RETURN" .PP If \fItablist\fP is NULL, this function returns NULL\&. Otherwise, this function returns a newly allocated \fBXmTabList\fR\&. If the function does allocate an \fBXmTabList\fR, then the application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmTabListFree\fP\&. .SH "RELATED" .PP \fBXmTabList\fP(3) and \fBXmTabListFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmTargetsAreCompatible.30000644000175000017500000000475312672140200016376 00000000000000'\" t ...\" TargetsA.sgm /main/8 1996/09/08 21:09:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTargetsAreCompatible" "library call" .SH "NAME" \fBXmTargetsAreCompatible\fP \(em A function that tests whether the target types match between a drop site and source object .iX "XmTargetsAreCompatible" .iX "Drag and Drop functions" "XmTargetsAreCompatible" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTargetsAreCompatible\fP\fR( \fBDisplay *\fBdisplay\fR\fR, \fBAtom *\fBexport_targets\fR\fR, \fBCardinal \fBnum_export_targets\fR\fR, \fBAtom *\fBimport_targets\fR\fR, \fBCardinal \fBnum_import_targets\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTargetsAreCompatible\fP determines whether the import targets of the destination match any of the export targets of a source\&. If there is at least one target in common, the function returns True\&. .IP "\fIdisplay\fP" 10 Specifies the display connection\&. .IP "\fIexport_targets\fP" 10 Specifies the list of target atoms associated with the source object\&. This resource identifies the selection targets the source can convert to\&. .IP "\fInum_export_targets\fP" 10 Specifies the number of entries in the list of export targets\&. .IP "\fIimport_targets\fP" 10 Specifies the list of targets to be checked against the \fBXmNexportTargets\fP of the source associated with the specified DragContext .IP "\fInum_import_targets\fP" 10 Specifies the number of entries in the \fIimport_targets\fP list\&. .SH "RETURN" .PP Returns a Boolean value that indicates whether the destination targets are compatible with the source targets\&. If there is at least one target in common, the routine returns True; otherwise, returns False\&. .SH "RELATED" .PP \fBXmDragContext\fP(3) and \fBXmDropSite\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmResolveAllPartOffsets.30000644000175000017500000001533412672140200016563 00000000000000'\" t ...\" ResolveA.sgm /main/10 1996/09/25 10:05:27 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmResolveAllPartOffsets" "library call" .SH "NAME" \fBXmResolveAllPartOffsets\fP \(em A function that allows writing of upward-compatible applications and widgets .iX "XmResolveAllPartOffsets" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmResolveAllPartOffsets\fP\fR( \fBWidgetClass \fBwidget_class\fR\fR, \fBXmOffsetPtr \fB* offset\fR\fR, \fBXmOffsetPtr \fB* constraint_offset\fR\fR); .fi .SH "DESCRIPTION" .PP .RS \fBNote: .PP This routine is obsolete and exists for compatibility with previous releases\&. You should call \fBXmeResolvePartOffsets\fP instead\&. .RE .PP The use of offset records requires two extra global variables per widget class\&. The variables consist of pointers to arrays of offsets into the widget record and constraint record for each part of the widget structure\&. The \fBXmResolveAllPartOffsets\fP function allocates the offset records needed by an application to guarantee upward-compatible access to widget instance and constraint records by applications and widgets\&. These offset records are used by the widget to access all of the widget\&'s variables\&. A widget needs to take the steps described in the following paragraphs\&. .PP Instead of creating a resource list, the widget creates an offset resource list\&. To accomplish this, use the \fBXmPartResource\fR structure and the \fBXmPartOffset\fP macro\&. The \fBXmPartResource\fR data structure looks just like a resource list, but instead of having one integer for its offset, it has two shorts\&. This structure is put into the class record as if it were a normal resource list\&. Instead of using \fBXtOffset\fP for the offset, the widget uses \fBXmPartOffset\fP\&. .PP If the widget is a subclass of the Constraint class and it defines additional constraint resources, create an offset resource list for the constraint part as well\&. Instead of using \fBXtOffset\fP for the offset, the widget uses \fBXmConstraintPartOffset\fP in the constraint resource list\&. .PP .nf \f(CWXmPartResource resources[] = { { BarNxyz, BarCXyz, XmRBoolean, sizeof(Boolean), XmPartOffset(Bar,xyz), XmRImmediate, (XtPointer)False } }; XmPartResource constraints[] = { { BarNmaxWidth, BarNMaxWidth, XmRDimension, sizeof(Dimension), XmConstraintPartOffset(Bar,max_width), XmRImmediate, (XtPointer)100 } };\fR .fi .PP .PP Instead of putting the widget size in the class record, the widget puts the widget part size in the same field\&. If the widget is a subclass of the Constraint class, instead of putting the widget constraint record size in the class record, the widget puts the widget constraint part size in the same field\&. .PP Instead of putting \fBXtVersion\fP in the class record, the widget puts \fBXtVersionDontCheck\fP in the class record\&. .PP Define a variable, of type \fBXmOffsetPtr\fR, to point to the offset record\&. If the widget is a subclass of the Constraint class, define a variable of type \fBXmOffsetPtr\fR to point to the constraint offset record\&. These can be part of the widget\&'s class record or separate global variables\&. .PP In class initialization, the widget calls \fBXmResolveAllPartOffsets\fP, passing it pointers to the class record, the address of the offset record, and the address of the constraint offset record\&. If the widget not is a subclass of the Constraint class, it should pass NULL as the address of the constraint offset record\&. This does several things: .IP " \(bu" 6 Adds the superclass (which, by definition, has already been initialized) size field to the part size field .IP " \(bu" 6 If the widget is a subclass of the Constraint class, adds the superclass constraint size field to the constraint size field .IP " \(bu" 6 Allocates an array based upon the number of superclasses .IP " \(bu" 6 If the widget is a subclass of the constraint class, allocates an array for the constraint offset record .IP " \(bu" 6 Fills in the offsets of all the widget parts and constraint parts with the appropriate values, determined by examining the size fields of all superclass records .IP " \(bu" 6 Uses the part offset array to modify the offset entries in the resource list to be real offsets, in place .PP The widget defines a constant that will be the index to its part structure in the offsets array\&. The value should be 1 greater than the index of the widget\&'s superclass\&. Constants defined for all \fBXm\fP widgets can be found in \fBXmP\&.h\fP\&. .PP .nf \f(CW#define BarIndex (XmBulletinBIndex + 1)\fR .fi .PP .PP Instead of accessing fields directly, the widget must always go through the offset table\&. The \fBXmField\fP and \fBXmConstraintField\fP macros help you access these fields\&. Because the \fBXmPartOffset\fP, \fBXmConstraintPartOffset\fP, \fBXmField\fP, and \fBXmConstraintField\fP macros concatenate things, you must ensure that there is no space after the part argument\&. For example, the following macros do not work because of the space after the part (Label) argument: .PP .nf \f(CWXmField(w, offset, Label, text, char *) XmPartOffset(Label, text)\&.\fR .fi .PP .PP Therefore, you must not have any spaces after the part (Label) argument, as illustrated here: .PP .nf \f(CWXmField(w, offset, Label, text, char *)\fR .fi .PP .PP You can define macros for each field to make this easier\&. Assume an integer field \fIxyz\fP: .PP .nf \f(CW#define BarXyz(w) (*(int *)(((char *) w) + \e offset[BarIndex] + XtOffset(BarPart,xyz)))\fR .fi .PP .PP For constraint field \fImax_width\fP: .PP .nf \f(CW#define BarMaxWidth(w) \e XmConstraintField(w,constraint_offsets,Bar,max_width,Dimension)\fR .fi .PP .PP The parameters for \fBXmResolveAllPartOffsets\fP are .IP "\fIwidget_class\fP" 10 Specifies the widget class pointer for the created widget .IP "\fIoffset\fP" 10 Returns the offset record .IP "\fIconstraint_offset\fP" 10 Returns the constraint offset record .SH "RELATED INFORMATION" .PP \fBXmResolvePartOffsets\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmRenderTableAddRenditions.30000644000175000017500000000711612672140200017170 00000000000000'\" t ...\" RendTaB.sgm /main/11 1996/09/08 20:57:19 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableAddRenditions" "library call" .SH "NAME" \fBXmRenderTableAddRenditions\fP \(em Creates a new render table .iX "XmRenderTableAddRenditions" .SH "SYNOPSIS" .PP .nf #include \fBXmRenderTable \fBXmRenderTableAddRenditions\fP\fR( \fBXmRenderTable \fBoldtable\fR\fR, \fBXmRendition \fB*renditions\fR\fR, \fBCardinal \fBrendition_count\fR\fR, \fBXmMergeMode \fBmerge_mode\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableAddRenditions\fP is a function to create a new render table that includes the renditions listed in \fIoldtable\fP, if there is one\&. This function also copies specified renditions (\fIrenditions\fP) to the new render table\&. The first \fIrendition_count\fP renditions of the \fIrenditions\fP array are added to the new table\&. If a rendition is tagged with a tag that matches a tag already in \fIoldtable\fP, then the existing rendition using that tag is either modified or freed and replaced with the new rendition, depending on the value of \fImerge_mode\fP\&. If \fIoldtable\fP is NULL, \fBXmRenderTableAddRenditions\fP creates a new render table containing only the specified renditions\&. .PP This function deallocates the original render table after extracting the required information\&. It is the responsibility of the caller to free the renditions of the \fIrenditions\fP array by calling the \fBXmRenditionFree\fP function\&. .IP "\fIoldtable\fP" 10 Specifies the render table to be added to\&. .IP "\fIrenditions\fP" 10 Specifies an array of renditions to be added\&. .IP "\fIrendition_count\fP" 10 Specifies the number of renditions from \fIrenditions\fP to be added\&. .IP "\fImerge_mode\fP" 10 Specifies what to do if the \fBXmNtag\fP of a rendition matches that of one that already exists in \fIoldtable\fP\&. The possible values are as follows: .RS .IP "\fBXmMERGE_REPLACE\fP" 10 Completely replaces the old rendition with the new one\&. .IP "\fBXmMERGE_OLD\fP" 10 Replaces any unspecified values of the old rendition with the corresponding values from the new rendition\&. .IP "\fBXmMERGE_NEW\fP" 10 Replaces the old rendition with the new rendition, replacing any unspecified values of the new rendition with the corresponding values from the old rendition\&. .IP "\fBXmSKIP\fP" 10 Skips over the new rendition, leaving the old rendition intact\&. .RE .SH "RETURN" .PP If \fIrenditions\fP is NULL or \fIrendition_count\fP is 0 (zero), this function returns \fIoldtable\fP\&. Otherwise, the function returns a new \fBXmRenderTable\fR\&. The function allocates space to hold this new render table\&. The application is responsible for managing this allocated space\&. The application can recover the allocated space by calling \fBXmRenderTableFree\fP\&. .SH "RELATED" .PP \fBXmRendition\fP(3) and \fBXmRenderTableFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmActivateProtocol.30000644000175000017500000000474012672140200015613 00000000000000'\" t ...\" ActivP.sgm /main/10 1996/09/25 10:07:11 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmActivateProtocol" "library call" .SH "NAME" \fBXmActivateProtocol\fP \(em A VendorShell function that activates a protocol .iX "XmActivateProtocol" .iX "VendorShell functions" "XmActivateProtocol" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmActivateProtocol\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBproperty\fR\fR, \fBAtom \fBprotocol\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmActivateProtocol\fP activates a protocol\&. It updates the handlers and the \fIproperty\fP if the \fIshell\fP is realized\&. It is sometimes useful to allow a protocol\&'s state information (callback lists, and so on) to persist, even though the client may choose to temporarily resign from the interaction\&. This is supported by allowing a \fIprotocol\fP to be in one of two states: active or inactive\&. If the \fIprotocol\fP is active and the \fIshell\fP is realized, the \fIproperty\fP contains the \fIprotocol\fP \fBAtom\fP\&. If the \fIprotocol\fP is inactive, the \fBAtom\fP is not present in the \fIproperty\fP\&. .PP \fBXmActivateWMProtocol\fP is a convenience interface\&. It calls \fBXmActivateProtocol\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIproperty\fP" 10 Specifies the protocol property .IP "\fIprotocol\fP" 10 Specifies the protocol \fBAtom\fP .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmActivateWMProtocol\fP(3), \fBXmRemoveProtocols\fP(3) and \fBXmInternAtom\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmVaCreateHierarchy.30000644000175000017500000000266712672140200015670 00000000000000.DT .TH "XmVaCreateHierarchy" "library call" .SH "NAME" \fBXmVaCreateHierarchy\fP, \fBXmVaCreateManagedHierarchy\fP \(em A Hierarchy widget convenience creation functions\&. .iX "XmVaCreateHierarchy" "XmVaCreateManagedHierarchy" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateHierarchy\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedHierarchy\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Hierarchy widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateHierarchy\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedHierarchy\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Hierarchy and its associated resources, see \fBXmHierarchy\fP(3)\&. .SH "RETURN" .PP Returns the Hierarchy widget ID\&. .SH "RELATED" .PP \fBXmCreateHierarchy\fP(3), \fBXtCreateWidget\fP(3), \fBXtCreateManagedWidget\fP(3), and \fBXmHierarchy\fP(3)\&. motif-2.3.8/doc/man/man3/Makefile.in0000644000175000017500000010566013211512767014023 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = doc/man/man3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = ApplicationShell.3 \ Composite.3 \ Constraint.3 \ Core.3 \ MrmCloseHierarchy.3 \ MrmFetchBitmapLiteral.3 \ MrmFetchColorLiteral.3 \ MrmFetchIconLiteral.3 \ MrmFetchLiteral.3 \ MrmFetchSetValues.3 \ MrmFetchWidget.3 \ MrmFetchWidgetOverride.3 \ MrmInitialize.3 \ MrmOpenHierarchy.3 \ MrmOpenHierarchyFromBuffer.3 \ MrmOpenHierarchyPerDisplay.3 \ MrmRegisterClass.3 \ MrmRegisterNames.3 \ MrmRegisterNamesInHierarchy.3 \ Object.3 \ OverrideShell.3 \ RectObj.3 \ Shell.3 \ TopLevelShell.3 \ TransientShell.3 \ Uil.3 \ UilDumpSymbolTable.3 \ VendorShell.3 \ VirtualBindings.3 \ WMShell.3 \ XmActivateProtocol.3 \ XmActivateWMProtocol.3 \ XmAddProtocolCallback.3 \ XmAddProtocols.3 \ XmAddTabGroup.3 \ XmAddToPostFromList.3 \ XmAddWMProtocolCallback.3 \ XmAddWMProtocols.3 \ XmArrowButton.3 \ XmArrowButtonGadget.3 \ XmBulletinBoard.3 \ XmButtonBox.3 \ XmCascadeButton.3 \ XmCascadeButtonGadget.3 \ XmCascadeButtonGadgetHighlight.3 \ XmCascadeButtonHighlight.3 \ XmChangeColor.3 \ XmClipboardCancelCopy.3 \ XmClipboardCopy.3 \ XmClipboardCopyByName.3 \ XmClipboardEndCopy.3 \ XmClipboardEndRetrieve.3 \ XmClipboardInquireCount.3 \ XmClipboardInquireFormat.3 \ XmClipboardInquireLength.3 \ XmClipboardInquirePendingItems.3 \ XmClipboardLock.3 \ XmClipboardRegisterFormat.3 \ XmClipboardRetrieve.3 \ XmClipboardStartCopy.3 \ XmClipboardStartRetrieve.3 \ XmClipboardUndoCopy.3 \ XmClipboardUnlock.3 \ XmClipboardWithdrawFormat.3 \ XmColorSelector.3 \ XmColumn.3 \ XmComboBox.3 \ XmComboBoxAddItem.3 \ XmComboBoxDeletePos.3 \ XmComboBoxSelectItem.3 \ XmComboBoxSetItem.3 \ XmComboBoxUpdate.3 \ XmCommand.3 \ XmCommandAppendValue.3 \ XmCommandError.3 \ XmCommandGetChild.3 \ XmCommandSetValue.3 \ XmContainer.3 \ XmContainerCopy.3 \ XmContainerCopyLink.3 \ XmContainerCut.3 \ XmContainerGetItemChildren.3 \ XmContainerPaste.3 \ XmContainerPasteLink.3 \ XmContainerRelayout.3 \ XmContainerReorder.3 \ XmConvertStringToUnits.3 \ XmConvertUnits.3 \ XmCreateArrowButton.3 \ XmCreateArrowButtonGadget.3 \ XmCreateBulletinBoard.3 \ XmCreateBulletinBoardDialog.3 \ XmCreateButtonBox.3 \ XmCreateCascadeButton.3 \ XmCreateCascadeButtonGadget.3 \ XmCreateDropDown.3 \ XmCreateComboBox.3 \ XmCreateCombinationBox2.3 \ XmCreateCommand.3 \ XmCreateCommandDialog.3 \ XmCreateContainer.3 \ XmCreateDialogShell.3 \ XmCreateDragIcon.3 \ XmCreateDrawingArea.3 \ XmCreateDrawnButton.3 \ XmCreateDropDownComboBox.3 \ XmCreateDropDownList.3 \ XmCreateErrorDialog.3 \ XmCreateFileSelectionBox.3 \ XmCreateFileSelectionDialog.3 \ XmCreateForm.3 \ XmCreateFormDialog.3 \ XmCreateFrame.3 \ XmCreateHierarchy.3 \ XmCreateIconGadget.3 \ XmCreateInformationDialog.3 \ XmCreateLabel.3 \ XmCreateLabelGadget.3 \ XmCreateList.3 \ XmCreateMainWindow.3 \ XmCreateMenuBar.3 \ XmCreateMenuShell.3 \ XmCreateMessageBox.3 \ XmCreateMessageDialog.3 \ XmCreateNotebook.3 \ XmCreateOptionMenu.3 \ XmCreateOutline.3 \ XmCreatePanedWindow.3 \ XmCreatePopupMenu.3 \ XmCreatePromptDialog.3 \ XmCreatePulldownMenu.3 \ XmCreatePushButton.3 \ XmCreatePushButtonGadget.3 \ XmCreateQuestionDialog.3 \ XmCreateRadioBox.3 \ XmCreateRowColumn.3 \ XmCreateScale.3 \ XmCreateScrollBar.3 \ XmCreateScrolledList.3 \ XmCreateScrolledText.3 \ XmCreateScrolledWindow.3 \ XmCreateSelectionBox.3 \ XmCreateSelectionDialog.3 \ XmCreateSeparator.3 \ XmCreateSeparatorGadget.3 \ XmCreateSimpleCheckBox.3 \ XmCreateSimpleMenuBar.3 \ XmCreateSimpleOptionMenu.3 \ XmCreateSimplePopupMenu.3 \ XmCreateSimplePulldownMenu.3 \ XmCreateSimpleRadioBox.3 \ XmCreateSimpleSpinBox.3 \ XmCreateSpinBox.3 \ XmCreateTemplateDialog.3 \ XmCreateText.3 \ XmCreateTextField.3 \ XmCreateToggleButton.3 \ XmCreateToggleButtonGadget.3 \ XmCreateWarningDialog.3 \ XmCreateWorkArea.3 \ XmCreateWorkingDialog.3 \ XmCvtByteStreamToXmString.3 \ XmCvtCTToXmString.3 \ XmCvtStringToUnitType.3 \ XmCvtTextPropertyToXmStringTable.3 \ XmCvtXmStringTableToTextProperty.3 \ XmCvtXmStringToByteStream.3 \ XmCvtXmStringToCT.3 \ XmDataField.3 \ XmDataFieldCopy.3 \ XmDataFieldCut.3 \ XmDataFieldPaste.3 \ XmDataFieldGetSelection.3 \ XmDataFieldGetSelectionPosition.3 \ XmDataFieldGetString.3 \ XmDataFieldGetStringWcs.3 \ XmDataFieldSetAddMode.3 \ XmDataFieldSetEditable.3 \ XmDataFieldSetHighlight.3 \ XmDataFieldSetInsertionPosition.3 \ XmDataFieldSetSelection.3 \ XmDataFieldSetString.3 \ XmDataFieldXYToPos.3 \ XmDeactivateProtocol.3 \ XmDeactivateWMProtocol.3 \ XmDestroyPixmap.3 \ XmDialogShell.3 \ XmDirection.3 \ XmDirectionMatch.3 \ XmDirectionMatchPartial.3 \ XmDirectionToStringDirection.3 \ XmDisplay.3 \ XmDragCancel.3 \ XmDragContext.3 \ XmDragIcon.3 \ XmDragStart.3 \ XmDrawingArea.3 \ XmDrawnButton.3 \ XmDropDown.3 \ XmDropDownGetChild.3 \ XmDropSite.3 \ XmDropSiteConfigureStackingOrder.3 \ XmDropSiteEndUpdate.3 \ XmDropSiteQueryStackingOrder.3 \ XmDropSiteRegister.3 \ XmDropSiteRegistered.3 \ XmDropSiteRetrieve.3 \ XmDropSiteStartUpdate.3 \ XmDropSiteUnregister.3 \ XmDropSiteUpdate.3 \ XmDropTransfer.3 \ XmDropTransferAdd.3 \ XmDropTransferStart.3 \ XmMultiList.3 \ XmMultiListDeselectItems.3 \ XmMultiListDeselectRow.3 \ XmMultiListGetSelectedRowArray.3 \ XmMultiListGetSelectedRows.3 \ XmMultiListMakeRowVisible.3 \ XmMultiListSelectAllItems.3 \ XmMultiListSelectItems.3 \ XmMultiListSelectRow.3 \ XmMultiListToggleRow.3 \ XmMultiListUnselectAllItems.3 \ XmMultiListUnselectItem.3 \ XmExt18List.3 \ XmFileSelectionBox.3 \ XmFileSelectionBoxGetChild.3 \ XmFileSelectionDoSearch.3 \ XmFontList.3 \ XmFontListAdd.3 \ XmFontListAppendEntry.3 \ XmFontListCopy.3 \ XmFontListCreate.3 \ XmFontListEntryCreate.3 \ XmFontListEntryFree.3 \ XmFontListEntryGetFont.3 \ XmFontListEntryGetTag.3 \ XmFontListEntryLoad.3 \ XmFontListFree.3 \ XmFontListFreeFontContext.3 \ XmFontListGetNextFont.3 \ XmFontListInitFontContext.3 \ XmFontListNextEntry.3 \ XmFontListRemoveEntry.3 \ XmFontSelector.3 \ XmForm.3 \ XmFrame.3 \ XmGadget.3 \ XmGetAtomName.3 \ XmGetColorCalculation.3 \ XmGetColors.3 \ XmGetDestination.3 \ XmGetDragContext.3 \ XmGetFocusWidget.3 \ XmGetMenuCursor.3 \ XmGetPixmap.3 \ XmGetPixmapByDepth.3 \ XmGetPostedFromWidget.3 \ XmGetScaledPixmap.3 \ XmGetSecondaryResourceData.3 \ XmGetTabGroup.3 \ XmGetTearOffControl.3 \ XmGetVisibility.3 \ XmGetXmDisplay.3 \ XmGetXmScreen.3 \ XmHierarchy.3 \ XmHierarchyGetChildNodes.3 \ XmHierarchyOpenAllAncestors.3 \ XmIconBox.3 \ XmIconBoxIsCellEmpty.3 \ XmIconButton.3 \ XmIconGadget.3 \ XmImCloseXIM.3 \ XmImFreeXIC.3 \ XmImGetXIC.3 \ XmImGetXIM.3 \ XmImMbLookupString.3 \ XmImMbResetIC.3 \ XmImRegister.3 \ XmImSetFocusValues.3 \ XmImSetValues.3 \ XmImSetXIC.3 \ XmImUnregister.3 \ XmImUnsetFocus.3 \ XmImVaSetFocusValues.3 \ XmImVaSetValues.3 \ XmInstallImage.3 \ XmInternAtom.3 \ XmIsMotifWMRunning.3 \ XmIsTraversable.3 \ XmLabel.3 \ XmLabelGadget.3 \ XmList.3 \ XmListAddItem.3 \ XmListAddItems.3 \ XmListAddItemsUnselected.3 \ XmListAddItemUnselected.3 \ XmListDeleteAllItems.3 \ XmListDeleteItem.3 \ XmListDeleteItems.3 \ XmListDeleteItemsPos.3 \ XmListDeletePos.3 \ XmListDeletePositions.3 \ XmListDeselectAllItems.3 \ XmListDeselectItem.3 \ XmListDeselectPos.3 \ XmListGetKbdItemPos.3 \ XmListGetMatchPos.3 \ XmListGetSelectedPos.3 \ XmListItemExists.3 \ XmListItemPos.3 \ XmListPosSelected.3 \ XmListPosToBounds.3 \ XmListReplaceItems.3 \ XmListReplaceItemsPos.3 \ XmListReplaceItemsPosUnselected.3 \ XmListReplaceItemsUnselected.3 \ XmListReplacePositions.3 \ XmListSelectItem.3 \ XmListSelectPos.3 \ XmListSetAddMode.3 \ XmListSetBottomItem.3 \ XmListSetBottomPos.3 \ XmListSetHorizPos.3 \ XmListSetItem.3 \ XmListSetKbdItemPos.3 \ XmListSetPos.3 \ XmListUpdateSelectedList.3 \ XmListYToPos.3 \ XmMainWindow.3 \ XmMainWindowSep1.3 \ XmMainWindowSep2.3 \ XmMainWindowSep3.3 \ XmMainWindowSetAreas.3 \ XmManager.3 \ XmMapSegmentEncoding.3 \ XmMenuPosition.3 \ XmMenuShell.3 \ XmMessageBox.3 \ XmMessageBoxGetChild.3 \ XmNotebook.3 \ XmNotebookGetPageInfo.3 \ XmObjectAtPoint.3 \ XmOptionButtonGadget.3 \ XmOptionLabelGadget.3 \ XmOutline.3 \ XmPaned.3 \ XmPanedGetPanes.3 \ XmPanedWindow.3 \ XmParseMapping.3 \ XmParseMappingCreate.3 \ XmParseMappingFree.3 \ XmParseMappingGetValues.3 \ XmParseMappingSetValues.3 \ XmParseTable.3 \ XmParseTableFree.3 \ XmPrimitive.3 \ XmPrintPopupPDM.3 \ XmPrintSetup.3 \ XmPrintShell.3 \ XmPrintToFile.3 \ XmProcessTraversal.3 \ XmPushButton.3 \ XmPushButtonGadget.3 \ XmRedisplayWidget.3 \ XmRegisterSegmentEncoding.3 \ XmRemoveFromPostFromList.3 \ XmRemoveProtocolCallback.3 \ XmRemoveProtocols.3 \ XmRemoveTabGroup.3 \ XmRemoveWMProtocolCallback.3 \ XmRemoveWMProtocols.3 \ XmRenderTable.3 \ XmRenderTableAddRenditions.3 \ XmRenderTableCopy.3 \ XmRenderTableCvtFromProp.3 \ XmRenderTableCvtToProp.3 \ XmRenderTableFree.3 \ XmRenderTableGetRendition.3 \ XmRenderTableGetRenditions.3 \ XmRenderTableGetTags.3 \ XmRenderTableRemoveRenditions.3 \ XmRendition.3 \ XmRenditionCreate.3 \ XmRenditionFree.3 \ XmRenditionRetrieve.3 \ XmRenditionUpdate.3 \ XmRepTypeAddReverse.3 \ XmRepTypeGetId.3 \ XmRepTypeGetNameList.3 \ XmRepTypeGetRecord.3 \ XmRepTypeGetRegistered.3 \ XmRepTypeInstallTearOffModelConverter.3 \ XmRepTypeRegister.3 \ XmRepTypeValidValue.3 \ XmResolveAllPartOffsets.3 \ XmResolvePartOffsets.3 \ XmRowColumn.3 \ XmScale.3 \ XmScaleGetValue.3 \ XmScaleSetTicks.3 \ XmScaleSetValue.3 \ XmScreen.3 \ XmScrollBar.3 \ XmScrollBarGetValues.3 \ XmScrollBarSetValues.3 \ XmScrolledWindow.3 \ XmScrolledWindowSetAreas.3 \ XmScrollVisible.3 \ XmSelectionBox.3 \ XmSelectionBoxGetChild.3 \ XmSeparator.3 \ XmSeparatorGadget.3 \ XmSetColorCalculation.3 \ XmSetFontUnit.3 \ XmSetFontUnits.3 \ XmSetMenuCursor.3 \ XmSetProtocolHooks.3 \ XmSetWMProtocolHooks.3 \ XmSimpleSpinBox.3 \ XmSimpleSpinBoxAddItem.3 \ XmSimpleSpinBoxDeletePos.3 \ XmSimpleSpinBoxSetItem.3 \ XmSlideContext.3 \ XmSpinBox.3 \ XmSpinBoxValidatePosition.3 \ XmString.3 \ XmStringBaseline.3 \ XmStringByteCompare.3 \ XmStringByteStreamLength.3 \ XmStringCompare.3 \ XmStringComponentCreate.3 \ XmStringComponentType.3 \ XmStringConcat.3 \ XmStringConcatAndFree.3 \ XmStringCopy.3 \ XmStringCreate.3 \ XmStringCreateLocalized.3 \ XmStringCreateLtoR.3 \ XmStringCreateSimple.3 \ XmStringDirection.3 \ XmStringDirectionCreate.3 \ XmStringDirectionToDirection.3 \ XmStringDraw.3 \ XmStringDrawImage.3 \ XmStringDrawUnderline.3 \ XmStringEmpty.3 \ XmStringExtent.3 \ XmStringFree.3 \ XmStringFreeContext.3 \ XmStringGenerate.3 \ XmStringGetLtoR.3 \ XmStringGetNextComponent.3 \ XmStringGetNextSegment.3 \ XmStringGetNextTriple.3 \ XmStringHasSubstring.3 \ XmStringHeight.3 \ XmStringInitContext.3 \ XmStringIsVoid.3 \ XmStringLength.3 \ XmStringLineCount.3 \ XmStringNConcat.3 \ XmStringNCopy.3 \ XmStringParseText.3 \ XmStringPeekNextComponent.3 \ XmStringPeekNextTriple.3 \ XmStringPutRendition.3 \ XmStringSegmentCreate.3 \ XmStringSeparatorCreate.3 \ XmStringTable.3 \ XmStringTableParseStringArray.3 \ XmStringTableProposeTablist.3 \ XmStringTableToXmString.3 \ XmStringTableUnparse.3 \ XmStringToXmStringTable.3 \ XmStringUnparse.3 \ XmStringWidth.3 \ XmTab.3 \ XmTabCreate.3 \ XmTabFree.3 \ XmTabGetValues.3 \ XmTabList.3 \ XmTabListCopy.3 \ XmTabListFree.3 \ XmTabListGetTab.3 \ XmTabListInsertTabs.3 \ XmTabListRemoveTabs.3 \ XmTabListReplacePositions.3 \ XmTabListTabCount.3 \ XmTabSetValue.3 \ XmTabStack.3 \ XmTabStackGetSelectedTab.3 \ XmTabStackSelectTab.3 \ XmTabStackXYToWidget.3 \ XmTargetsAreCompatible.3 \ XmText.3 \ XmTextClearSelection.3 \ XmTextCopy.3 \ XmTextCopyLink.3 \ XmTextCut.3 \ XmTextDisableRedisplay.3 \ XmTextEnableRedisplay.3 \ XmTextField.3 \ XmTextFieldClearSelection.3 \ XmTextFieldCopy.3 \ XmTextFieldCopyLink.3 \ XmTextFieldCut.3 \ XmTextFieldGetBaseline.3 \ XmTextFieldGetEditable.3 \ XmTextFieldGetInsertionPosition.3 \ XmTextFieldGetLastPosition.3 \ XmTextFieldGetMaxLength.3 \ XmTextFieldGetSelection.3 \ XmTextFieldGetSelectionPosition.3 \ XmTextFieldGetSelectionWcs.3 \ XmTextFieldGetString.3 \ XmTextFieldGetStringWcs.3 \ XmTextFieldGetSubstring.3 \ XmTextFieldGetSubstringWcs.3 \ XmTextFieldInsert.3 \ XmTextFieldInsertWcs.3 \ XmTextFieldPaste.3 \ XmTextFieldPasteLink.3 \ XmTextFieldPosToXY.3 \ XmTextFieldRemove.3 \ XmTextFieldReplace.3 \ XmTextFieldReplaceWcs.3 \ XmTextFieldSetAddMode.3 \ XmTextFieldSetEditable.3 \ XmTextFieldSetHighlight.3 \ XmTextFieldSetInsertionPosition.3 \ XmTextFieldSetMaxLength.3 \ XmTextFieldSetSelection.3 \ XmTextFieldSetString.3 \ XmTextFieldSetStringWcs.3 \ XmTextFieldShowPosition.3 \ XmTextFieldXYToPos.3 \ XmTextFindString.3 \ XmTextFindStringWcs.3 \ XmTextGetBaseline.3 \ XmTextGetCenterline.3 \ XmTextGetEditable.3 \ XmTextGetInsertionPosition.3 \ XmTextGetLastPosition.3 \ XmTextGetMaxLength.3 \ XmTextGetSelection.3 \ XmTextGetSelectionPosition.3 \ XmTextGetSelectionWcs.3 \ XmTextGetSource.3 \ XmTextGetString.3 \ XmTextGetStringWcs.3 \ XmTextGetSubstring.3 \ XmTextGetSubstringWcs.3 \ XmTextGetTopCharacter.3 \ XmTextInsert.3 \ XmTextInsertWcs.3 \ XmTextPaste.3 \ XmTextPasteLink.3 \ XmTextPosition.3 \ XmTextPosToXY.3 \ XmTextRemove.3 \ XmTextReplace.3 \ XmTextReplaceWcs.3 \ XmTextScroll.3 \ XmTextSetAddMode.3 \ XmTextSetEditable.3 \ XmTextSetHighlight.3 \ XmTextSetInsertionPosition.3 \ XmTextSetMaxLength.3 \ XmTextSetSelection.3 \ XmTextSetSource.3 \ XmTextSetString.3 \ XmTextSetStringWcs.3 \ XmTextSetTopCharacter.3 \ XmTextShowPosition.3 \ XmTextXYToPos.3 \ XmToggleButton.3 \ XmToggleButtonGadget.3 \ XmToggleButtonGadgetGetState.3 \ XmToggleButtonGadgetSetState.3 \ XmToggleButtonGetState.3 \ XmToggleButtonSetState.3 \ XmToggleButtonSetValue.3 \ XmTrackingEvent.3 \ XmTrackingLocate.3 \ XmTransferDone.3 \ XmTransferSendRequest.3 \ XmTransferSetParameters.3 \ XmTransferStartRequest.3 \ XmTransferValue.3 \ XmTranslateKey.3 \ XmTree.3 \ XmUninstallImage.3 \ XmUpdateDisplay.3 \ XmVaCreateArrowButton.3 \ XmVaCreateArrowButtonGadget.3 \ XmVaCreateBulletinBoard.3 \ XmVaCreateButtonBox.3 \ XmVaCreateCascadeButton.3 \ XmVaCreateCascadeButtonGadget.3 \ XmVaCreateColorSelector.3 \ XmVaCreateColumn.3 \ XmVaCreateCombinationBox2.3 \ XmVaCreateComboBox.3 \ XmVaCreateCommand.3 \ XmVaCreateContainer.3 \ XmVaCreateDataField.3 \ XmVaCreateDrawingArea.3 \ XmVaCreateDrawnButton.3 \ XmVaCreateDropDown.3 \ XmVaCreateExt18List.3 \ XmVaCreateFileSelectionBox.3 \ XmVaCreateForm.3 \ XmVaCreateFrame.3 \ XmVaCreateHierarchy.3 \ XmVaCreateIconGadget.3 \ XmVaCreateLabel.3 \ XmVaCreateLabelGadget.3 \ XmVaCreateList.3 \ XmVaCreateMainWindow.3 \ XmVaCreateManagedArrowButton.3 \ XmVaCreateManagedArrowButtonGadget.3 \ XmVaCreateManagedBulletinBoard.3 \ XmVaCreateManagedButtonBox.3 \ XmVaCreateManagedCascadeButton.3 \ XmVaCreateManagedCascadeButtonGadget.3 \ XmVaCreateManagedColorSelector.3 \ XmVaCreateManagedColumn.3 \ XmVaCreateManagedComboBox.3 \ XmVaCreateManagedCombinationBox2.3 \ XmVaCreateManagedCommand.3 \ XmVaCreateManagedContainer.3 \ XmVaCreateManagedDataField.3 \ XmVaCreateManagedDrawingArea.3 \ XmVaCreateManagedDrawnButton.3 \ XmVaCreateManagedDropDown.3 \ XmVaCreateManagedExt18List.3 \ XmVaCreateManagedFileSelectionBox.3 \ XmVaCreateManagedForm.3 \ XmVaCreateManagedFrame.3 \ XmVaCreateManagedHierarchy.3 \ XmVaCreateManagedIconGadget.3 \ XmVaCreateManagedLabel.3 \ XmVaCreateManagedLabelGadget.3 \ XmVaCreateManagedList.3 \ XmVaCreateManagedMainWindow.3 \ XmVaCreateManagedMessageBox.3 \ XmVaCreateManagedMultiList.3 \ XmVaCreateManagedNotebook.3 \ XmVaCreateManagedOutline.3 \ XmVaCreateManagedPanedWindow.3 \ XmVaCreateManagedPushButton.3 \ XmVaCreateManagedPushButtonGadget.3 \ XmVaCreateManagedRowColumn.3 \ XmVaCreateManagedScale.3 \ XmVaCreateManagedScrollBar.3 \ XmVaCreateManagedScrolledWindow.3 \ XmVaCreateManagedSelectionBox.3 \ XmVaCreateManagedSeparatorGadget.3 \ XmVaCreateManagedSimpleSpinBox.3 \ XmVaCreateManagedSpinBox.3 \ XmVaCreateManagedTabStack.3 \ XmVaCreateManagedText.3 \ XmVaCreateManagedTextField.3 \ XmVaCreateManagedToggleButton.3 \ XmVaCreateManagedToggleButtonGadget.3 \ XmVaCreateMessageBox.3 \ XmVaCreateMultiList.3 \ XmVaCreateNotebook.3 \ XmVaCreateOutline.3 \ XmVaCreatePanedWindow.3 \ XmVaCreatePushButton.3 \ XmVaCreatePushButtonGadget.3 \ XmVaCreateRowColumn.3 \ XmVaCreateScale.3 \ XmVaCreateScrollBar.3 \ XmVaCreateScrolledWindow.3 \ XmVaCreateSelectionBox.3 \ XmVaCreateSeparatorGadget.3 \ XmVaCreateSimpleCheckBox.3 \ XmVaCreateSimpleMenuBar.3 \ XmVaCreateSimpleOptionMenu.3 \ XmVaCreateSimplePopupMenu.3 \ XmVaCreateSimplePulldownMenu.3 \ XmVaCreateSimpleRadioBox.3 \ XmVaCreateSimpleSpinBox.3 \ XmVaCreateSpinBox.3 \ XmVaCreateTabStack.3 \ XmVaCreateText.3 \ XmVaCreateTextField.3 \ XmVaCreateToggleButton.3 \ XmVaCreateToggleButtonGadget.3 \ XmWidgetGetBaselines.3 \ XmWidgetGetDisplayRect.3 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/man/man3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/man/man3/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man3dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man3 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man3 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man3 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man3 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/doc/man/man3/XmList.30000644000175000017500000020331212672140200013240 00000000000000'\" t ...\" List.sgm /main/12 1996/09/08 20:49:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmList" "library call" .SH "NAME" \fBXmList\fP \(em The List widget class .iX "XmList" .iX "widget class" "List" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP List allows a user to select one or more items from a group of choices\&. Items are selected from the list in a variety of ways, using both the pointer and the keyboard\&. List operates on an array of compound strings that are defined by the application\&. Each compound string becomes an item in the List, with the first compound string becoming the item in position 1, the second becoming the item in position 2, and so on\&. .PP Specifying the number of items that are visible sets the size of the List\&. If the number of visible items is not specified, the height of the list controls the number of visible items\&. Each item assumes the height of the tallest element in the list\&. To create a list that allows the user to scroll easily through a large number of items, use the \fBXmCreateScrolledList\fP convenience function\&. .PP To select items, move the pointer or cursor to the desired item and press the \fB\fP mouse button or the key defined as \fB\fP\&. There are several styles of selection behavior, and they all highlight the selected item or items by displaying them in inverse colors\&. An appropriate callback is invoked to notify the application of the user\&'s choice\&. The application then takes whatever action is required for the specified selection\&. When a List is insensitive, all of the list items are displayed in a stippled fill pattern\&. .PP List uses the \fBXmQTspecifyRenderTable\fP, \fBXmQTscrollFrame\fP, and \fBXmQTnavigator\fP traits, and holds the \fBXmQTtransfer\fP trait\&. .SS "Selection" .PP Each list has one of four selection models: .IP " \(bu" 6 Single Select .IP " \(bu" 6 Browse Select .IP " \(bu" 6 Multiple Select .IP " \(bu" 6 Extended Select .PP In Single Select and Browse Select, at most one item is selected at a time\&. In Single Select, pressing \fB\fP on an item toggles its selection state and deselects any other selected item\&. In Browse Select, pressing \fB\fP on an item selects it and deselects any other selected item; dragging \fB\fP moves the selection as the pointer is moved\&. Releasing \fB\fP on an item moves the location cursor to that item\&. .PP In Multiple Select, any number of items can be selected at a time\&. Pressing \fB\fP on an item toggles its selection state but does not deselect any other selected items\&. .PP In Extended Select, any number of items can be selected at a time, and the user can easily select ranges of items\&. Pressing \fB\fP on an item selects it and deselects any other selected item\&. Dragging \fB\fP or pressing or dragging \fB\fP\fB\fP following a \fB\fP action selects all items between the item under the pointer and the item on which \fB\fP was pressed\&. This action also deselects any other selected items outside that range\&. .PP Extended Select also allows the user to select and deselect discontiguous ranges of items\&. Pressing \fB\fP\fB\fP on an item toggles its selection state but does not deselect any other selected items\&. Dragging \fB\fP\fB\fP or pressing or dragging \fB\fP\fB\fP following a \fB\fP\fB\fP action sets the selection state of all items between the item under the pointer and the item on which \fB\fP\fB\fP was pressed to the state of the item on which \fB\fP\fB\fP was pressed\&. This action does not deselect any other selected items outside that range\&. .PP All selection operations available from the mouse are also available from the keyboard\&. List has two keyboard selection modes, Normal Mode and Add Mode\&. In Normal Mode, navigation operations and \fB\fP select the item at the location cursor and deselect any other selected items\&. In Add Mode, navigation operations have no effect on selection, and \fB\fP toggles the selection state of the item at the location cursor without deselecting any other selected items, except in Single Select\&. .PP Single and Multiple Select use Add Mode, and Browse Select uses Normal Mode\&. .PP Extended Select can use either mode; the user changes modes by pressing \fB\fP\&. In Extended Select Normal Mode, pressing \fB\fP has the same effect as pressing \fB\fP; \fB\fP and shifted navigation have the same effect as pressing \fB\fP\fB\fP following a \fB\fP action\&. In Extended Select Add Mode, pressing \fB\fP has the same effect as pressing \fB\fP\fB\fP; \fB\fP and shifted navigation have the same effect as pressing \fB\fP\fB\fP following a \fB\fP\fB\fP action\&. .PP Normal Mode is indicated by a solid location cursor, and Add Mode is indicated by a dashed location cursor\&. .SS "Data Transfer Behavior" .PP List supports dragging of items from the List and transfer of items to the clipboard\&. When the user presses \fBBTransfer\fP on a selected item, the widget transfers all selected items\&. When the user presses \fBBTransfer\fP on an unselected item, the widget transfers only that item\&. Depending on the value of \fBXmNprimaryOwnership\fP, List can also support primary selection\&. .PP When the \fBXmNconvertCallback\fP procedures are called, the \fBlocation_data\fP member of the \fBXmConvertCallbackStruct\fR member is NULL if the selected items are being transferred\&. If the selected items are not being transferred, this member has the following value: If a single item is being transferred, the value is an integer representing the position of the item in the List\&. A value of 1 transfers the first item in the List; a value of 2 transfers the second item; and so on\&. If the entire contents of the List are being transferred, the value is -1\&. .PP As a source of data, List supports the following targets and associated conversions of data to these targets: .IP "\fIlocale\fP" 10 If the \fIlocale\fP target matches the widget\&'s locale, the widget transfers the selected list items in the encoding of the locale\&. Each item transferred except the last includes a trailing separator\&. .IP "\fBCOMPOUND_TEXT\fP" 10 The widget transfers the selected list items as type \fBCOMPOUND_TEXT\fP\&. Each item transferred except the last includes a trailing separator\&. .IP "\fBUTF8_STRING\fP" 10 The widget transfers the selected list items as type \fBUTF8_STRING\fP\&. Each item transferred except the last includes a trailing separator\&. .IP "\fBSTRING\fP" 10 The widget transfers the selected list items as type \fBSTRING\fP\&. Each item transferred except the last includes a trailing separator\&. .IP "\fBTEXT\fP" 10 If the selected list items are fully convertible to the encoding of the locale, the widget transfers the selected list items in the encoding of the locale\&. Otherwise, the widget transfers the selected list items as type \fBCOMPOUND_TEXT\fP\&. Each item transferred except the last includes a trailing separator\&. .IP "\fB_MOTIF_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for immediate transfer for the \fBCLIPBOARD\fP selection\&. These include \fB_MOTIF_COMPOUND_STRING\fP\&. If the selected list items are fully convertible to \fBSTRING\fP, these also include \fBSTRING\fP; otherwise, they also include \fBCOMPOUND_TEXT\fP and \fBUTF8_STRING\fP\&. .IP "\fB_MOTIF_COMPOUND_STRING\fP" 10 The widget transfers the selected list items as a compound string in Byte Stream format\&. Each item transferred except the last includes a trailing separator\&. .IP "\fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for delayed transfer for the \fBCLIPBOARD\fP selection\&. This widget currently supplies no targets for \fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP\&. .IP "\fB_MOTIF_EXPORT_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to be used as the value of the DragContext\&'s \fBXmNexportTargets\fP in a drag-and-drop transfer\&. These include \fB_MOTIF_COMPOUND_STRING\fP, \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP, \fBBACKGROUND\fP, and \fBFOREGROUND\fP\&. .IP "\fB_MOTIF_LOSE_SELECTION\fP" 10 When the widget loses the selection, it deselects all list items\&. .PP As a source of data, List also supports the following standard Motif targets: .IP "\fBBACKGROUND\fP" 10 The widget transfers \fBXmNbackground\fP as type \fBPIXEL\fP\&. .IP "\fBCLASS\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_CLASS\fP property and transfers the contents as text in the current locale\&. .IP "\fBCLIENT_WINDOW\fP" 10 The widget finds the first shell in the widget hierarchy and transfers its window as type \fBWINDOW\fP\&. .IP "\fBCOLORMAP\fP" 10 The widget transfers \fBXmNcolormap\fP as type \fBCOLORMAP\fP\&. .IP "\fBFOREGROUND\fP" 10 The widget transfers \fBXmNforeground\fP as type \fBPIXEL\fP\&. .IP "\fBNAME\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_NAME\fP property and transfers the contents as text in the current locale\&. .IP "\fBTARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports\&. These include the standard targets in this list\&. These also include \fB_MOTIF_COMPOUND_STRING\fP, \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP the encoding of the locale, \fBSTRING\fP, and \fBTEXT\fP\&. .IP "\fBTIMESTAMP\fP" 10 The widget transfers the timestamp used to acquire the selection as type \fBINTEGER\fP\&. .IP "\fB_MOTIF_RENDER_TABLE\fP" 10 The widget transfers \fBXmNrenderTable\fP if it exists, or else the default text render table, as type \fBSTRING\fP\&. .IP "\fB_MOTIF_ENCODING_REGISTRY\fP" 10 The widget transfers its encoding registry as type \fBSTRING\fP\&. The value is a list of NULL separated items in the form of tag encoding pairs\&. This target symbolizes the transfer target for the Motif Segment Encoding Registry\&. Widgets and applications can use this Registry to register text encoding formats for specified render table tags\&. Applications access this Registry by calling \fBXmRegisterSegmentEncoding\fP and \fBXmMapSegmentEncoding\fP\&. .PP List has no widget class destination procedure\&. Subclasses and the \fBXmNdestinationCallback\fP procedures are responsible for any data transfers to the widget\&. .SS "Classes" .PP List inherits behavior, resources, and traits from \fBCore\fP and \fBXmPrimitive\fP\&. .PP The class pointer is \fBxmListWidgetClass\fP\&. .PP The class name is \fBXmList\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmList Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNautomaticSelectionXmCAutomaticSelectionXtEnumFalseCSG _____ XmNbrowseSelectionCallbackXmCCallbackXtCallbackListNULLC _____ XmNdefaultActionCallbackXmCCallbackXtCallbackListNULLC _____ XmNdestinationCallbackXmCCallbackXtCallbackListNULLC _____ XmNdoubleClickIntervalXmCDoubleClickIntervalintdynamicCSG _____ XmNextendedSelectionCallbackXmCCallbackXtCallbackListNULLC _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNitemCountXmCItemCountint0CSG _____ XmNitemsXmCItemsXmStringTableNULLCSG _____ XmNlistMarginHeightXmCListMarginHeightDimension0CSG _____ XmNlistMarginWidthXmCListMarginWidthDimension0CSG _____ XmNlistSizePolicyXmCListSizePolicyunsigned charXmVARIABLECG _____ XmNlistSpacingXmCListSpacingDimension0CSG _____ XmNmatchBehaviorXmCMatchBehaviorunsigned charXmQUICK_NAVIGATECSG _____ XmNmultipleSelectionCallbackXmCCallbackXtCallbackListNULLC _____ XmNprimaryOwnershipXmCPrimaryOwnershipunsigned charXmOWN_NEVERCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNscrollBarDisplayPolicyXmCScrollBarDisplayPolicyunsigned charXmAS_NEEDEDCSG _____ XmNselectColorXmCSelectColorXmRSelectColorXmREVERSED_GROUND_COLORSCSG _____ XmNselectedItemCountXmCSelectedItemCountint0CSG _____ XmNselectedItemsXmCSelectedItemsXmStringTableNULLCSG _____ XmNselectedPositionCountXmCSelectedPositionCountint0CSG _____ XmNselectedPositionsXmCSelectedPositionsunsigned int *NULLCSG _____ XmNselectionModeXmCSelectionModeunsigned chardynamicCSG _____ XmNselectionPolicyXmCSelectionPolicyunsigned charXmBROWSE_SELECTCSG _____ XmNsingleSelectionCallbackXmCCallbackXtCallbackListNULLC _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ XmNtopItemPositionXmCTopItemPositionint1CSG _____ XmNvisibleItemCountXmCVisibleItemCountintdynamicCSG _____ .TE .IP "\fBXmNautomaticSelection\fP" 10 Invokes either \fBXmNbrowseSelectionCallback\fP or \fBXmNextendedSelectionCallback\fP when \fB\fP is pressed and the items that are shown as selected change if the value is True (or \fBXmAUTO\fP) and the selection mode is either \fBXmBROWSE_SELECT\fP or \fBXmEXTENDED_SELECT\fP respectively\&. If False (\fBXmNO_AUTO_SELECT\fP), no selection callbacks are invoked until the user releases the mouse button\&. See \fBBehavior\fP for further details on the interaction of this resource with the selection modes\&. .IP "\fBXmNbrowseSelectionCallback\fP" 10 Specifies a list of callbacks that is called when an item is selected in the browse selection mode\&. The reason is \fBXmCR_BROWSE_SELECT\fP\&. .IP "\fBXmNdefaultActionCallback\fP" 10 Specifies a list of callbacks that is called when an item is double clicked or \fB\fP is pressed\&. The reason is \fBXmCR_DEFAULT_ACTION\fP\&. .IP "\fBXmNdestinationCallback\fP" 10 Specifies a list of callbacks called when the List is the destination of a transfer operation\&. The type of the structure whose address is passed to these callbacks is \fBXmDestinationCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNdoubleClickInterval\fP" 10 If a button click is followed by another button click within the time span specified by this resource (in milliseconds), the button clicks are considered a double-click action, rather than two single-click actions\&. The value must not be negative\&. The default value is the display\&'s multiclick time\&. .IP "\fBXmNextendedSelectionCallback\fP" 10 Specifies a list of callbacks that is called when items are selected using the extended selection mode\&. The reason is \fBXmCR_EXTENDED_SELECT\fP\&. .IP "\fBXmNfontList\fP" 10 Specifies the font list associated with the list items\&. \fBXmNfontList\fP is obsolete and exists only for compatibility with previous releases\&. You should now use \fBXmNrenderTable\fP instead of \fBXmNfontList\fP\&. If both are specified, the render table will take precedence\&. The font list is used in conjunction with the \fBXmNvisibleItemCount\fP resource to determine the height of the List widget\&. If this value is NULL at initialization, the parent hierarchy of the widget is searched for a widget that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the font list is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such widget is found, the default is implementation dependent\&. Refer to \fBXmFontList\fP(3) for more information on a font list structure\&. .IP "\fBXmNitemCount\fP" 10 Specifies the total number of items\&. The value must be the number of items in \fBXmNitems\fP and must not be negative\&. It is automatically updated by the list whenever an item is added to or deleted from the list\&. .IP "\fBXmNitems\fP" 10 Points to an array of compound strings that are to be displayed as the list items\&. Refer to \fBXmString\fP(3) for more information on the creation and structure of compound strings\&. \fBXtGetValues\fP for this resource returns the list items themselves, not a copy of the list items\&. The application must not free the returned items\&. .IP "\fBXmNlistMarginHeight\fP" 10 Specifies the height of the margin between the list border and the items\&. .IP "\fBXmNlistMarginWidth\fP" 10 Specifies the width of the margin between the list border and the items\&. .IP "\fBXmNlistSizePolicy\fP" 10 Controls the reaction of the List when an item grows horizontally beyond the current size of the list work area\&. If the value is \fBXmCONSTANT\fP, the list viewing area does not grow, and a horizontal ScrollBar is added for a List whose parent is a ScrolledWindow\&. If this resource is set to \fBXmVARIABLE\fP, the List grows to match the size of the longest item, and no horizontal ScrollBar appears\&. .IP "" 10 When the value of this resource is \fBXmRESIZE_IF_POSSIBLE\fP, the List attempts to grow or shrink to match the width of the widest item\&. If it cannot grow to match the widest size, a horizontal ScrollBar is added for a List whose parent is a ScrolledWindow if the longest item is wider than the list viewing area\&. .IP "" 10 The size policy must be set at the time the List widget is created\&. It cannot be changed at a later time through \fBXtSetValues\fP\&. .IP "\fBXmNlistSpacing\fP" 10 Specifies the spacing between list items\&. This spacing increases by the value of the \fBXmNhighlightThickness\fP resource in Primitive\&. .IP "\fBXmNmatchBehavior\fP" 10 Specifies the matching behavior followed by XmList\&. The current values are \fBXmNONE\fP and \fBXmQUICK_NAVIGATE\fP, as follows: .RS .IP "\fBXmNONE\fP" 10 Specifies that the typed in characters are ignored\&. .IP "\fBXmQUICK_NAVIGATE\fP" 10 Specifies that 1-character navigation shall be supported when List has focus\&. If the typed character is the initial character of some set of items in List, the first of those items following the current item will be navigated to (become the current item)\&. If all such items precede the current item, the first such item becomes the current item\&. Subsequently, typing the same character will cyclically navigate among the items with the same first character\&. .RE .IP "\fBXmNmultipleSelectionCallback\fP" 10 Specifies a list of callbacks that is called when an item is selected in multiple selection mode\&. The reason is \fBXmCR_MULTIPLE_SELECT\fP\&. .IP "\fBXmNprimaryOwnership\fP" 10 Specifies whether XmContainer takes ownership of the Primary selection when a selection is made inside it\&. This resource can take the following values: .RS .IP "\fBXmOWN_NEVER\fP" 10 Never takes ownership\&. .IP "\fBXmOWN_ALWAYS\fP" 10 Always takes ownership\&. .IP "\fBXmOWN_MULTIPLE\fP" 10 Only takes ownership is more than one element has been selected\&. .IP "\fBXmOWN_POSSIBLE_MULTIPLE\fP" 10 Only takes ownership if more than one element can be selected at a time\&. .RE .IP "\fBXmNrenderTable\fP" 10 Specifies the render table associated with the list items\&. The render table is used in conjunction with the \fBXmNvisibleItemCount\fP resource to determine the height of the List widget\&. If this value is NULL at initialization, List searches its parent hierarchy for a widget that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the render table is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such widget is found, the default is implementation dependent\&. If a font list and a render table are both specified, the render table will take precedence\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNscrollBarDisplayPolicy\fP" 10 Controls the display of vertical ScrollBars in a List whose parent is a ScrolledWindow\&. When the value of this resource is \fBXmAS_NEEDED\fP, a vertical ScrollBar is displayed only when the number of items in the List exceeds the number of visible items\&. When the value is \fBXmSTATIC\fP, a vertical ScrollBar is always displayed\&. .IP "\fBXmNselectColor\fP" 10 Allows the application to specify the color of the background rectangle that indicates selected text\&. It takes two values: .RS .IP "\fBXmDEFAULT_SELECT_COLOR\fP" 10 Causes the select color to be set to a color between the background and the bottom shadow color\&. .IP "\fBXmREVERSED_GROUND_COLORS\fP" 10 Forces the select color to the foreground color and the color of any text rendered over the select color to be in the background color\&. .IP "\fBHIGHLIGHT_COLOR\fP" 10 Forces the fill color to use the highlight color\&. .RE .IP "\fBXmNselectedItemCount\fP" 10 Specifies the number of strings in the selected items list\&. The value must be the number of items in \fBXmNselectedItems\fP and must not be negative\&. .IP "\fBXmNselectedItems\fP" 10 Points to an array of compound strings that represents the list items that are currently selected, either by the user or by the application\&. \fBXtGetValues\fP for this resource returns the list items themselves, not a copy of the list items\&. The application must not free the returned items or the array\&. .IP "" 10 Setting \fBXmNselectedItems\fP selects those list items that exactly match items in the given \fBXmNselectedItems\fP list\&. There may be additional items in \fBXmNselectedItems\fP that do not match items in the list\&. These items remain until \fBXmNselectedItems\fP is updated\&. If \fBXmNitems\fP is changed such that the list now contains items matching previously unmatched items in \fBXmNselectedItems\fP, those new items will also appear selected\&. .IP "" 10 Any user interaction with the list that causes at least one item to be selected or deselected and any call to \fBXmListDeleteAllItems\fP, \fBXmListDeleteItem\fP, \fBXmListDeleteItems\fP, \fBXmListDeleteItemsPos\fP, \fBXmListDeletePos\fP, \fBXmListDeletePositions\fP, \fBXmListDeselectAllItems\fP, \fBXmListDeselectItem\fP, \fBXmListDeselectPos\fP, \fBXmListSelectItem\fP, \fBXmListSelectPos\fP, or \fBXmListUpdateSelectedList\fP cause \fBXmNselectedItems\fP to be updated immediately to exactly reflect the visual state of the list\&. Calls to any other \fBXmList\fP functions do not affect \fBXmNselectedItems\fP\&. .IP "\fBXmNselectedPositionCount\fP" 10 Specifies the number of positions in the selected positions list\&. The value must be the number of items in \fBXmNselectedPositions\fP .IP "\fBXmNselectedPositions\fP" 10 Points to an array of the positions of the selected items in the List\&. \fBXtGetValues\fP for this resource returns the list items themselves, not a copy of the list items\&. The application must not free the returned items or the array\&. .IP "\fBXmNselectionMode\fP" 10 Defines what effect keyboard navigations have on selection\&. The valid modes are: .RS .IP "\fBXmADD_MODE\fP" 10 Allows no navigation operations to have effect on selection, and \fB\fP toggles the selection state of the item at the location cursor without deselecting any other selected items, except in Single Select\&. However, the widget cannot be put into add mode if the \fBXmNselectionPolicy\fP resource is an incompatible mode (\fBXmNselectionPolicy\fP cannot be \fBXmBROWSE_SELECT\fP)\&. .IP "\fBXmNORMAL_MODE\fP" 10 Allows navigation operations and \fB\fP to select the item at the location cursor and deselect any other selected items\&. However, the widget cannot be put into normal mode if the \fBXmNselectionPolicy\fP resource is an incompatible mode (\fBXmNselectionPolicy\fP cannot be \fBXmSINGLE_SELECT\fP or \fBXmMULTIPLE_SELECT\fP)\&. .RE .IP "\fBXmNselectionPolicy\fP" 10 Defines the interpretation of the selection action\&. This can be one of the following: .RS .IP "\fBXmSINGLE_SELECT\fP" 10 Allows only single selections .IP "\fBXmMULTIPLE_SELECT\fP" 10 Allows multiple selections .IP "\fBXmEXTENDED_SELECT\fP" 10 Allows extended selections .IP "\fBXmBROWSE_SELECT\fP" 10 Allows drag-and-browse functionality .RE .IP "\fBXmNsingleSelectionCallback\fP" 10 Specifies a list of callbacks that is called when an item is selected in single selection mode\&. The reason is \fBXmCR_SINGLE_SELECT\fP\&. .IP "\fBXmNstringDirection\fP" 10 Is a synthetic resource for setting \fBXmNlayoutDirection\fP\&. The values for this resource are \fBXmSTRING_DIRECTION_L_TO_R\fP and \fBXmSTRING_DIRECTION_R_TO_L\fP\&. Refer to the \fBXmNlayoutDirection\fP resource description\&. The \fBXmNstringDirection\fP resource is obsoleted by \fBXmNlayoutDirection\fP, but is kept here for backward compatibility\&. .IP "\fBXmNtopItemPosition\fP" 10 Specifies the position of the item that is the first visible item in the list\&. Setting this resource is equivalent to calling the \fBXmListSetPos\fP function\&. The position of the first item in the list is 1; the position of the second item is 2; and so on\&. A position of 0 (zero) specifies the last item in the list\&. The value must not be negative\&. .IP "\fBXmNvisibleItemCount\fP" 10 Specifies the number of items that can fit in the visible space of the list work area\&. The List uses this value to determine its height\&. The value must be greater than 0 (zero)\&. .SS "Inherited Resources" .PP List inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP List defines a new callback structure\&. The application must first look at the reason field and use only the structure members that are valid for that particular reason, because not all fields are relevant for every possible reason\&. The callback structure is defined as follows: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; XmString \fIitem\fP; int \fIitem_length\fP; int \fIitem_position\fP; XmString *\fIselected_items\fP; int \fIselected_item_count\fP; int *\fIselected_item_positions\fP; char \fIselection_type\fP; unsigned char \fIauto_selection_type\fP; } XmListCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIitem\fP" 10 The last item selected at the time of the \fIevent\fP that caused the callback\&. \fIitem\fP points to a temporary storage space that is reused after the callback is finished\&. Therefore, if an application needs to save the item, it should copy the item into its own data space\&. .IP "\fIitem_length\fP" 10 The length in bytes of \fIitem\fP\&. This member is obsolete and exists for compatibility with earlier releases\&. .IP "\fIitem_position\fP" 10 The position (plus one) of \fIitem\fP in the List\&'s \fBXmNitems\fP array\&. An \fIitem_position\fP value of one symbolizes the first element in the list\&. .IP "\fIselected_items\fP" 10 A list of items selected at the time of the \fIevent\fP that caused the callback\&. \fIselected_items\fP points to a temporary storage space that is reused after the callback is finished\&. Therefore, if an application needs to save the selected list, it should copy the list into its own data space\&. .IP "\fIselected_item_count\fP" 10 The number of items in the \fIselected_items\fP list\&. This number must be non-negative\&. .IP "\fIselected_item_positions\fP" 10 An array of integers, one for each selected item, representing the position of each selected item in the List\&'s \fBXmNitems\fP array\&. \fIselected_item_positions\fP points to a temporary storage space that is reused after the callback is finished\&. Therefore, if an application needs to save this array, it should copy the array into its own data space\&. .IP "\fIselection_type\fP" 10 Indicates that the most recent extended selection was the initial selection (\fBXmINITIAL\fP), a modification of an existing selection (\fBXmMODIFICATION\fP), or an additional noncontiguous selection (\fBXmADDITION\fP)\&. .IP "\fBauto_selection_type\fP" 10 Indicates the type of automatic selection callback\&. The types of callbacks include the following: .RS .IP "\fBXmAUTO_BEGIN\fP" 10 Indicates the beginning of automatic selection\&. .IP "\fBXmAUTO_MOTION\fP" 10 Indicates that there is a button drag selection\&. .IP "\fBXmAUTO_CANCEL\fP" 10 Indicates that the new selection is cancelled\&. .IP "\fBXmAUTO_NO_CHANGE\fP" 10 Indicates that the currently selected item matches the initial item\&. .IP "\fBXmAUTO_CHANGE\fP" 10 Indicates that the currently selected item does not match the initial item\&. .RE .PP The following table describes the reasons for which the individual callback structure fields are valid\&. .TS tab() box; l| l. \fBReason\fP\fBValid Fields\fP __ XmCR_SINGLE_SELECTT{ \fIreason, event, item, item_length, item_position\fP T} __ XmCR_DEFAULT_ACTIONT{ \fIreason, event, item, item_length, item_position, selected_items, selected_item_count, selected_item_positions\fP T} __ XmCR_BROWSE_SELECTT{ \fIreason, event, item, item_length, item_position\fP T} __ XmCR_MULTIPLE_SELECTT{ \fIreason, event, item, item_length, item_position, selected_items, selected_item_count, selected_item_positions\fP T} __ XmCR_EXTENDED_SELECTT{ \fIreason, event, item, item_length, item_position, selected_items, selected_item_count, selected_item_positions, selection_type\fP T} __ .TE .PP A pointer to the following callback structure is passed to the \fBXmNdestinationCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; XtEnum \fIoperation\fP; int \fIflags\fP; XtPointer \fItransfer_id\fP; XtPointer \fIdestination_data\fP; XtPointer \fIlocation_data\fP; Time \fItime\fP; } XmDestinationCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which data transfer is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fIoperation\fP" 10 Indicates the type of transfer operation requested\&. .RS .IP " \(bu" 6 When the selection is \fBPRIMARY\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fBSECONDARY\fP or \fBCLIPBOARD\fP, possible values are \fBXmCOPY\fP and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fB_MOTIF_DROP\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, \fBXmLINK\fP, and \fBXmOTHER\fP\&. A value of \fBXmOTHER\fP means that the callback procedure must get further information from the \fBXmDropProcCallbackStruct\fR in the \fIdestination_data\fP member\&. .RE .IP "\fIflags\fP" 10 Indicates whether or not the destination widget is also the source of the data to be transferred\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 The destination widget is not the source of the data to be transferred\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The destination widget is the source of the data to be transferred\&. .RE .IP "\fBtransfer_id\fP" 10 Serves as a unique ID to identify the transfer transaction\&. .IP "\fIdestination_data\fP" 10 Contains information about the destination\&. When the selection is \fB_MOTIF_DROP\fP, the callback procedures are called by the drop site\&'s \fBXmNdropProc\fP, and \fIdestination_data\fP is a pointer to the \fBXmDropProcCallbackStruct\fR passed to the \fBXmNdropProc\fP procedure\&. When the selection is \fBSECONDARY\fP, \fIdestination_data\fP is an Atom representing a target recommmended by the selection owner for use in converting the selection\&. Otherwise, \fIdestination_data\fP is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location where data is to be transferred\&. The value is always NULL when the selection is \fBSECONDARY\fP or \fBCLIPBOARD\fP\&. If the value is NULL, the data is to be inserted at the widget\&'s cursor position\&. Otherwise, the value is an integer representing the position in the List where the items are to be transferred\&. A value of 1 makes the first new item the first item in the list; a value of 2 makes it the second item; and so on\&. Once \fBXmTransferDone\fP procedures start to be called, \fBlocation_data\fP will no longer be stable\&. .IP "\fItime\fP" 10 Indicates the time when the transfer operation began\&. .SS "Translations" .PP \fBXmList\fP includes translations from Primitive\&. The \fBXmList\fP translations are described in the following list\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP\fB\fP:" 10 ListButtonMotion() .IP "\fBs \(apm \(apa\fP \fB\fP:" 10 ListBeginExtend() .IP "\fBs \(apm \(apa\fP \fB\fP:" 10 ListEndExtend() .IP "\fBc \(aps \(apm \(apa\fP \fB\fP:" 10 ListBeginToggle() .IP "\fBc \(aps \(apm \(apa\fP \fB\fP:" 10 ListEndToggle() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP:" 10 ListBeginSelect() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP:" 10 ListEndSelect() .IP "\fB\fP:" 10 ListProcessDrag() .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 ListBeginDataExtend() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ListBeginData() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListBeginLine() .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 ListEndDataExtend() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ListEndData() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListEndLine() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListLeftPage() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ListLeftPage() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListPrevPage() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListRightPage() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ListRightPage() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListNextPage() .IP "\fBs\fP \fB\fP\fB\fP\fB:\fP" 10 ListKbdBeginExtend() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListKbdBeginSelect() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ListKbdEndExtend() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListKbdEndSelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListKbdSelectAll() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListKbdDeSelectAll() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListKbdActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListAddMode() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveHelp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListKbdCancel() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ListLeftPage() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListLeftChar() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ListRightPage() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListRightChar() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ListExtendPrevItem() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListPrevItem() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ListExtendNextItem() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListNextItem() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ListCopyToClipboard() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ListCopyToClipboard() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP\fBslash\fP:" 10 ListKbdSelectAll() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP\fBbackslash\fP:" 10 ListKbdDeSelectAll() .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrimitivePrevTabGroup() .IP "\fB\(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrimitiveNextTabGroup() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 ListKbdActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ListKbdBeginSelect() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ListKbdEndSelect() .IP "\fBs \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ListKbdBeginExtend() .IP "\fBs \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ListKbdEndExtend() .IP "\fB\fP:" 10 ListQuickNavigate() .PP The List button event translations are modified when Display\&'s \fBXmNenableBtn1Transfer\fP resource does not have a value of \fBXmOFF\fP (in other words, it is either \fBXmBUTTON2_TRANSFER\fP or \fBXmBUTTON2_ADJUST\fP)\&. This option allows the actions for selection and transfer to be integrated on \fB\fP, and the actions for extending the selection can be bound to \fB\fP\&. The actions for \fB\fP that are defined above still apply when the \fB\fP event occurs over text that is not selected\&. The following actions apply when the \fB\fP event occurs over text that is selected: .IP "\fB\fP\fB:\fP" 10 ListProcessBtn1(\fBListButtonMotion\fP) .IP "\fBs \(apm \(apa\fP \fB\fP" 10 ListProcessBtn1(\fBListBeginExtend\fP) .IP "\fBs \(apm \(apa\fP \fB\fP" 10 ListProcessBtn1(\fBListEndExtend\fP) .IP "\fBc \(aps \(apm \(apa\fP \fB\fP" 10 ListProcessBtn1(\fBListBeginToggle\fP) .IP "\fBc \(aps \(apm \(apa\fP \fB\fP" 10 ListProcessBtn1(\fBListEndToggle\fP) .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP" 10 ListProcessBtn1(\fBListBeginSelect\fP) .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP" 10 ListProcessBtn1(\fBListEndSelect\fP) .PP When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_ADJUST\fP, the following actions apply: .IP "\fB\fP\fB:\fP" 10 ListProcessBtn2(\fBListBeginExtend\fP) .IP "\fB\fP\fB:\fP" 10 ListProcessBtn2(\fBListButtonMotion\fP) .IP "\fB\fP\fB:\fP" 10 ListProcessBtn2(\fBListEndExtend\fP) .SS "Action Routines" .PP The \fBXmList\fP action routines are described in the following list\&. The current selection is always shown with inverted colors\&. .IP "ListAddMode():" 10 Toggles the state of Add Mode for keyboard selection\&. .IP "ListBeginData():" 10 Moves the location cursor to the first item in the list\&. In Normal Mode, this also deselects any current selection, selects the first item in the list, and calls the appropriate selection callbacks (\fBXmNbrowseSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, \fBXmNextendedSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP)\&. .IP "ListBeginDataExtend():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP or \fBXmEXTENDED_SELECT\fP, this action moves the location cursor to the first item in the list\&. .IP "" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done; changes the selection state of the first item and all items between it and the current anchor point to the state of the item at the current anchor point; calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "ListBeginExtend():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done, and changes the selection state of the item under the pointer and all items between it and the current anchor point to the state of the item at the current anchor point\&. If \fBXmNautomaticSelection\fP is set to True, this action calls the \fBXmNextendedSelectionCallback\fP callbacks\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_BEGIN\fP\&. .IP "ListBeginLine():" 10 Moves the horizontal scroll region to the beginning of the line\&. .IP "ListBeginSelect():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP, deselects any current selection and toggles the selection state of the item under the pointer\&. .IP "" 10 If \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, deselects any current selection and selects the item under the pointer\&. If \fBXmNautomaticSelection\fP is set to True, calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_BEGIN\fP\&. .IP "" 10 If \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP, toggles the selection state of the item under the pointer\&. Any previous selections remain\&. .IP "" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action deselects any current selection, selects the item under the pointer, and sets the current anchor at that item\&. If \fBXmNautomaticSelection\fP is set to True, this action calls the \fBXmNextendedSelectionCallback\fP callbacks\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_BEGIN\fP\&. .IP "ListBeginToggle():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action moves the current anchor to the item under the pointer without changing the current selection\&. If the item is unselected, this action selects it; if the item is selected, this action unselects it\&. If \fBXmNautomaticSelection\fP is set to True, this action calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "" 10 Otherwise, the list takes keyboard focus\&. No other action occurs\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_BEGIN\fP\&. .IP "ListButtonMotion():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, this action deselects any current selection and selects the item under the pointer\&. If \fBXmNautomaticSelection\fP is set to True and the pointer has entered a new list item, this action calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. .IP "" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action does the following: If an extended selection is being made and an extended selection has previously been made from the current anchor point, restores the selection state of the items in that range to their state before the previous extended selection was done and changes the selection state of the item under the pointer and all items between it and the current anchor point to the state of the item at the current anchor point\&. If \fBXmNautomaticSelection\fP is set to True and the pointer has entered a new list item, calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "" 10 If the pointer leaves a scrolled list, this action scrolls the list in the direction of the pointer motion\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_MOTION\fP\&. .IP "ListCopyToClipboard()" 10 Copies the content of the selected items to the clipboard as a single compound string with each item separated by a newline\&. This action calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBCLIPBOARD\fP selection\&. .IP "ListEndData():" 10 Moves the location cursor to the last item in the list\&. In Normal Mode, this also deselects any current selection, selects the last item in the list, and calls the appropriate selection callbacks (\fBXmNbrowseSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, \fBXmNextendedSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP)\&. .IP "ListEndDataExtend():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP or \fBXmEXTENDED_SELECT\fP, this action moves the location cursor to the last item in the list\&. .IP "" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done; changes the selection state of the last item and all items between it and the current anchor point to the state of the item at the current anchor point; calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "ListEndExtend():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action moves the location cursor to the last item selected or deselected and calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "" 10 If \fBXmNautomaticSelection\fP is set to True, then the \fBauto_selection_type\fP field of the callback will be valid\&. If \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP and the currently selected item position matches the position of the item that was selected before the browse selection began, or if \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with \fBauto_selection_type\fP set to \fBXmAUTO_NO_CHANGE\fP\&. Otherwise, it will be set to \fBXmAUTO_CHANGE\fP\&. .IP "ListEndLine():" 10 Moves the horizontal scroll region to the end of the line\&. .IP "ListEndSelect():" 10 This action moves the location cursor to the last item selected or deselected and calls the appropriate selection callbacks (\fBXmNsingleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP, \fBXmNbrowseSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, \fBXmNmultipleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP, \fBXmNextendedSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP)\&. .IP "" 10 If \fBXmNautomaticSelection\fP is set to True, then the \fBauto_selection_type\fP field of the callback will be valid\&. If \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP and the currently selected item position matches the position of the item that was selected before the brose selection began, or if \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with \fBauto_selection_type\fP set to \fBXmAUTO_NO_CHANGE\fP\&. Otherwise, it will be set to \fBXmAUTO_CHANGE\fP\&. .IP "ListEndToggle():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, moves the location cursor to the last item selected or deselected and calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "" 10 If \fBXmNautomaticSelection\fP is set to True, then the \fBauto_selection_type\fP field of the callback will be valid\&. If \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP and the currently selected item position matches the position of the item that was selected before the browse selection began, or if \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with \fBauto_selection_type\fP set to \fBXmAUTO_NO_CHANGE\fP\&. Otherwise, it will be set to \fBXmAUTO_CHANGE\fP\&. .IP "ListExtendNextItem():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done; moves the location cursor to the next item and changes the selection state of the item and all items between it and the current anchor point to the state of the item at the current anchor point; calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "ListExtendPrevItem():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done; moves the location cursor to the previous item and changes the selection state of the item and all items between it and the current anchor point to the state of the item at the current anchor point; calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "ListScrollCursorVertically(\fIpercentage\fP\fB)\fP:" 10 Scrolls the line containing the insertion cursor vertically to an intermediate position in the visible window based on an input percentage\&. A value of 0 (zero) indicates the top of the window; a value of 100, the bottom of the window\&. If this action is called with no argument, the line containing the insertion cursor is scrolled vertically to a new position designated by the \fIy\fP event passed to the routine\&. .IP "ListKbdActivate():" 10 Calls the callbacks for \fBXmNdefaultActionCallback\fP\&. If the List\&'s parent is a manager, this action passes the event to the parent\&. .IP "ListKbdBeginExtend():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done; changes the selection state of the item at the location cursor and all items between it and the current anchor point to the state of the item at the current anchor point\&. If \fBXmNautomaticSelection\fP is set to True, this action calls the \fBXmNextendedSelectionCallback\fP callbacks\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_BEGIN\fP"\&. .IP "ListKbdBeginSelect():" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP, deselects any current selection and toggles the state of the item at the location cursor\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_BEGIN\fP"\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, deselects any current selection and selects the item at the location cursor\&. If \fBXmNautomaticSelection\fP is set to True, calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP, toggles the selection state of the item at the location cursor\&. Any previous selections remain\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, moves the current anchor to the item at the location cursor\&. In Normal Mode, this action deselects any current selection and selects the item at the location cursor\&. In Add Mode, this action toggles the selection state of the item at the location cursor and leaves the current selection unchanged\&. If \fBXmNautomaticSelection\fP is set to True, this action calls the \fBXmNextendedSelectionCallback\fP callbacks\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_BEGIN\fP"\&. .IP "ListKbdCancel():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP and an extended selection is being made from the current anchor point, this action cancels the new selection and restores the selection state of the items in that range to their state before the extended selection was done\&. If \fBXmNautomaticSelection\fP is set to True, this action calls the \fBXmNextendedSelectionCallback\fP callbacks; otherwise, if the parent is a manager, it passes the event to the parent\&. The \fBauto_selection_type\fP component of the callback structure will be set to \fBXmAUTO_CANCEL\fP"\&. .IP "ListKbdDeSelectAll():" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP, \fBXmMULTIPLE_SELECT\fP, or \fBXmEXTENDED_SELECT\fP in Add Mode, this action deselects all items in the list\&. If the \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP in Normal Mode, this action deselects all items in the list (except the item at the location cursor if the shell\&'s \fBXmNkeyboardFocusPolicy\fP is \fBXmEXPLICIT\fP)\&. This action also calls the appropriate selection callbacks (\fBXmNsingleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP, \fBXmNmultipleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP, \fBXmNextendedSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP)\&. .IP "ListKbdEndExtend():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action calls the \fBXmNextendedSelectionCallback\fP callbacks\&. .IP "" 10 If \fBXmNautomaticSelection\fP is set to True, then the \fBauto_selection_type\fP field of the callback will be valid\&. If \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP and the currently selected item position matches the position of the item that was selected before the browse selection began, or if \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with \fBauto_selection_type\fP set to \fBXmAUTO_NO_CHANGE\fP\&. Otherwise, it will be set to \fBXmAUTO_CHANGE\fP\&. .IP "ListKbdEndSelect():" 10 Calls the appropriate selection callbacks (\fBXmNsingleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP, \fBXmNbrowseSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, \fBXmNmultipleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP, \fBXmNextendedSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP)\&. .IP "" 10 If \fBXmNautomaticSelection\fP is set to True, then the \fBauto_selection_type\fP field of the callback will be valid\&. If \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP and the currently selected item position matches the position of the item that was selected before the browse selection began, or if \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with \fBauto_selection_type\fP set to \fBXmAUTO_NO_CHANGE\fP\&. Otherwise, it will be set to \fBXmAUTO_CHANGE\fP\&. .IP "ListKbdSelectAll():" 10 If \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP, this action selects the item at the location cursor\&. If \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP or \fBXmMULTIPLE_SELECT\fP, it selects all items in the list\&. This action also calls the appropriate selection callbacks (\fBXmNsingleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmSINGLE_SELECT\fP, \fBXmNbrowseSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, \fBXmNmultipleSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmMULTIPLE_SELECT\fP, \fBXmNextendedSelectionCallback\fP when \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP)\&. .IP "ListLeftChar():" 10 Scrolls the list one character to the left\&. .IP "ListLeftPage():" 10 Scrolls the list one page to the left\&. .IP "ListNextItem():" 10 Moves the location cursor to the next item in the list\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, this action also selects the next item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action in Normal Mode also selects the next item, deselects any current selection, moves the current anchor to the next item, and calls the \fBXmNextendedSelectionCallback\fP callbacks\&. In Add Mode, this action does not affect the selection or the anchor\&. .IP "ListNextPage():" 10 Scrolls the list to the next page, moving the location cursor to a new item\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, this action also selects the new item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action in Normal Mode also selects the new item, deselects any current selection, moves the current anchor to the new item, and calls the \fBXmNextendedSelectionCallback\fP callbacks\&. In Add Mode, this action does not affect the selection or the anchor\&. .IP "ListPrevItem():" 10 Moves the location cursor to the previous item in the list\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, this action also selects the previous item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action in Normal Mode also selects the previous item, deselects any current selection, moves the current anchor to the previous item, and calls the \fBXmNextendedSelectionCallback\fP callbacks\&. In Add Mode, this action does not affect the selection or the anchor\&. .IP "ListPrevPage():" 10 Scrolls the list to the previous page, moving the location cursor to a new item\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmBROWSE_SELECT\fP, this action also selects the new item, deselects any current selection, and calls the \fBXmNbrowseSelectionCallback\fP callbacks\&. .IP "" 10 If the \fBXmNselectionPolicy\fP is set to \fBXmEXTENDED_SELECT\fP, this action in Normal Mode also selects the new item, deselects any current selection, moves the current anchor to the new item, and calls the \fBXmNextendedSelectionCallback\fP callbacks\&. In Add Mode this action does not affect the selection or the anchor\&. .IP "ListProcessBtn1(\fIstring\fP)" 10 When Display\&'s \fBXmNenableBtn1Transfer\fP resource is not \fBXmOFF\fP, the actions for selection and transfer are integrated on \fB\fP\&. When the button is not performing a transfer or drag, the action that is performed depends on the value of \fIstring\fP, which can be one of the following actions: .RS .IP " \(bu" 6 \fBListButtonMotion\fP .IP " \(bu" 6 \fBListBeginExtend\fP .IP " \(bu" 6 \fBListEndExtend\fP .IP " \(bu" 6 \fBListBeginToggle\fP .IP " \(bu" 6 \fBListEndToggle\fP .IP " \(bu" 6 \fBListBeginSelect\fP .IP " \(bu" 6 \fBListEndSelect\fP .RE .IP "\fBListProcessBtn2\fP" 10 When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_TRANSFER\fP, the actions for extending selection are bound on \fB\fP, and a drag starts immediately\&. When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_ADJUST\fP, the action that is performed depends on the value of \fIstring\fP, which can be one of the following actions: .RS .IP " \(bu" 6 \fBListBeginExtend\fP .IP " \(bu" 6 \fBListButtonMotion\fP .IP " \(bu" 6 \fBListEndExtend\fP .RE .IP "ListProcessDrag():" 10 Drags the content of one or more selected list items\&. Each item is separated by a newline\&. If \fBBTransfer\fP is pressed on an unselected item, it drags only that item, excluding any other selected items\&. This action sets the \fBXmNconvertProc\fP of the DragContext to a function that calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fB_MOTIF_DROP\fP selection\&. .IP "\fBListQuickNavigate\fP" 10 Navigates to an item\&. When List\&'s \fBXmNmatchBehavior\fP resource is \fBXmQUICK_NAVIGATE\fP, this action uses 1-character navigation to navigate\&. Refer to the \fBXmNmatchBehavior\fP resource for a description of how this navigation works\&. .IP "ListRightChar():" 10 Scrolls the list one character to the right\&. .IP "ListRightPage():" 10 Scrolls the list one page to the right\&. .IP "PrimitiveHelp():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "PrimitiveNextTabGroup():" 10 Moves the focus to the first item contained within the next tab group\&. If the current tab group is the last entry in the tab group list, it wraps to the beginning of the tab group list\&. .IP "PrimitivePrevTabGroup():" 10 Moves the focus to the first item contained within the previous tab group\&. If the beginning of the tab group list is reached, it wraps to the end of the tab group list\&. .SS "Additional Behavior" .PP The List widget has the following additional behavior: .IP "\fB\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time, the List interprets that as a double click and calls the callbacks for \fBXmNdefaultActionCallback\fP\&. The item\&'s colors invert to indicate that it is selected\&. The \fBXmNdoubleClickInterval\fP resource can be used to specify a time span that overrides the display\&'s multi-click time\&. .IP "\fB\fP:" 10 If the focus policy is Explicit, this action sets the focus and draw the location cursor\&. .IP "\fB\fP:" 10 If the focus policy is Explicit, this action removes the focus and erase the location cursor\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateList\fP(3), \fBXmCreateScrolledList\fP(3), \fBXmFontListCreate\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmListAddItem\fP(3), \fBXmListAddItems\fP(3), \fBXmListAddItemUnselected\fP(3), \fBXmListAddItemsUnselected\fP(3), \fBXmListDeleteAllItems\fP(3), \fBXmListDeleteItem\fP(3), \fBXmListDeleteItems\fP(3), \fBXmListDeleteItemsPos\fP(3), \fBXmListDeletePos\fP(3), \fBXmListDeletePositions\fP(3), \fBXmListDeselectAllItems\fP(3), \fBXmListDeselectItem\fP(3), \fBXmListDeselectPos\fP(3), \fBXmListGetKbdItemPos\fP \fBXmListGetMatchPos\fP(3), \fBXmListGetSelectedPos\fP(3), \fBXmListItemExists\fP(3), \fBXmListItemPos\fP(3), \fBXmListPosToBounds\fP(3), \fBXmListReplaceItems\fP(3), \fBXmListReplaceItemsPos\fP(3), \fBXmListReplaceItemsPos\fP(3), \fBXmListReplaceItemsPosUnselected\fP(3), \fBXmListReplaceItemsUnselected\fP(3), \fBXmListSelectItem\fP(3), \fBXmListSelectPos\fP(3), \fBXmListSetAddMode\fP(3), \fBXmListSetBottomItem\fP(3), \fBXmListSetBottomPos\fP(3), \fBXmListSetHorizPos\fP(3), \fBXmListSetItem\fP(3), \fBXmListSetKbdItemPos\fP(3), \fBXmListSetPos\fP(3), \fBXmListUpdateSelectedList\fP(3), \fBXmListYToPos\fP(3), \fBXmPrimitive\fP(3) \fBXmStringCreate\fP(3), \fBXmVaCreateList\fP(3), and \fBXmVaCreateManagedList\fP(3)\&. motif-2.3.8/doc/man/man3/XmPrimitive.30000644000175000017500000006564712672140200014316 00000000000000'\" t ...\" Primitiv.sgm /main/12 1996/09/08 20:55:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPrimitive" "library call" .SH "NAME" \fBXmPrimitive\fP \(em The Primitive widget class .iX "XmPrimitive" .iX "widget class" "Primitive" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Primitive is a widget class used as a supporting superclass for other widget classes\&. It handles border drawing and highlighting, traversal activation and deactivation, and various callback lists needed by Primitive widgets\&. Primitive and all its subclasses hold the \fBXmQTcareParentVisual\fP trait\&. .SS "Data Transfer Behavior" .PP Primitive has no widget class conversion or destination procedure\&. Subclasses and the \fBXmNconvertCallback\fP procedures are responsible for any conversion of selections\&. Subclasses and the subclass \fBXmNdestinationCallback\fP procedures are responsible for any data transfers to the widget\&. .SS "Classes" .PP Primitive inherits behavior, resources, and traits from \fBCore\fP\&. .PP The class pointer is \fBxmPrimitiveWidgetClass\fP\&. .PP The class name is \fBXmPrimitive\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtoolTipStringXmCToolTipStringXmStringNULLCSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .IP "\fBXmNbottomShadowColor\fP" 10 Specifies the color to use to draw the bottom and right sides of the border shadow\&. This color is used if the \fBXmNtopShadowPixmap\fP resource is unspecified\&. .IP "\fBXmNbottomShadowPixmap\fP" 10 Specifies the pixmap to use to draw the bottom and right sides of the border shadow\&. .IP "\fBXmNconvertCallback\fP" 10 Specifies a list of callbacks called when the widget is asked to convert a selection\&. The type of the structure whose address is passed to these callbacks is \fBXmConvertCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNforeground\fP" 10 Specifies the foreground drawing color used by Primitive widgets\&. .IP "\fBXmNhelpCallback\fP" 10 Specifies the list of callbacks that is called when the help key is pressed\&. The reason sent by the callback is \fBXmCR_HELP\fP\&. .IP "\fBXmNhighlightColor\fP" 10 Specifies the color of the highlighting rectangle\&. This color is used if the highlight pixmap resource is \fBXmUNSPECIFIED_PIXMAP\fP\&. .IP "\fBXmNhighlightOnEnter\fP" 10 Specifies if the highlighting rectangle is drawn when the cursor moves into the widget\&. If the shell\&'s focus policy is \fBXmEXPLICIT\fP, this resource is ignored, and the widget is highlighted when it has the focus\&. If the shell\&'s focus policy is \fBXmPOINTER\fP and if this resource is True, the highlighting rectangle is drawn when the cursor moves into the widget\&. If the shell\&'s focus policy is \fBXmPOINTER\fP and if this resource is False, the highlighting rectangle is not drawn when the the cursor moves into the widget\&. The default is False\&. .IP "\fBXmNhighlightPixmap\fP" 10 Specifies the pixmap used to draw the highlighting rectangle\&. .IP "\fBXmNhighlightThickness\fP" 10 Specifies the thickness of the highlighting rectangle\&. .IP "\fBXmNlayoutDirection\fP" 10 Specifies the direction in which components of the primitive (including strings) are laid out\&. The values are of type \fBXmDirection\fR\&. If the widget\&'s parent is a primitive or shell, the value is inherited from the widget\&'s parent\&. Otherwise, it is inherited from the closest ancestor vendor or menu shell\&. Refer to the \fBXmDirection\fP(3) reference page for the possible direction values\&. .IP "\fBXmNnavigationType\fP" 10 Determines whether the widget is a tab group\&. .RS .IP "\fBXmNONE\fP" 10 Indicates that the widget is not a tab group\&. .IP "\fBXmTAB_GROUP\fP" 10 Indicates that the widget is a tab group, unless the \fBXmNnavigationType\fP of another widget in the hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP\&. .IP "\fBXmSTICKY_TAB_GROUP\fP" 10 Indicates that the widget is a tab group, even if the \fBXmNnavigationType\fP of another widget in the hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP\&. .IP "\fBXmEXCLUSIVE_TAB_GROUP\fP" 10 Indicates that the widget is a tab group and that widgets in the hierarchy whose \fBXmNnavigationType\fP is \fBXmTAB_GROUP\fP are not tab groups\&. .IP "" 10 When a parent widget has an \fBXmNnavigationType\fP of \fBXmEXCLUSIVE_TAB_GROUP\fP, traversal of non-tab-group widgets within the group is based on the order of those widgets in their parent\&'s \fBXmNchildren\fP list\&. .IP "" 10 When the \fBXmNnavigationType\fP of any widget in a hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP, traversal of tab groups in the hierarchy proceeds to widgets in the order in which their \fBXmNnavigationType\fP resources were specified as \fBXmEXCLUSIVE_TAB_GROUP\fP or \fBXmSTICKY_TAB_GROUP\fP, whether by creating the widgets with that value, by calling \fBXtSetValues\fP, or by calling \fBXmAddTabGroup\fP\&. .RE .IP "\fBXmNpopupHandlerCallback\fP" 10 Allows the application to control which popup menu will be automatically posted\&. The reason can either be \fBXmCR_POST\fP or \fBXmCR_REPOST:\fP .RS .IP "\fBXmCR_POST\fP" 10 Indicates that this is a regular posting request\&. .IP "\fBXmCR_REPOST\fP" 10 Indicates that the menu was just unposted and that this callback was invoked on a replay\&. .RE .IP "" 10 This callback uses the \fBXmPopupHandlerCallbackStruct\fR structure to pass information\&. .IP "\fBXmNshadowThickness\fP" 10 Specifies the size of the drawn border shadow\&. .IP "\fBXmNtoolTipString\fP" 10 The XmString to display as the toolTip. If this resource is NULL, no tip will be displayed. ToolTips are described in VendorShell(3) .IP "\fBXmNtopShadowColor\fP" 10 Specifies the color to use to draw the top and left sides of the border shadow\&. This color is used if the \fBXmNtopShadowPixmap\fP resource is unspecified\&. If a default top shadow pixmap exists, it will need to be removed for the \fBXmNtopShadowColor\fP to take effect\&. .IP "\fBXmNtopShadowPixmap\fP" 10 Specifies the pixmap to use to draw the top and left sides of the border shadow\&. A Primitive top shadow pixmap is created in two situations\&. In either of these situations, a default 50-foreground top shadow pixmap is created\&. .RS .IP " \(bu" 6 If the Primitive top shadow color is the same as the Core background pixel color\&. .IP " \(bu" 6 If the depth of the screen is only one\&. .RE .IP "" 10 For example, if a widget with the same top shadow and background color is created, a default shadow pixmap is generated\&. Such a pixmap needs to be removed for the \fBXmNtopShadowColor\fP resource to take effect\&. .IP "\fBXmNtraversalOn\fP" 10 Specifies if traversal is activated for this widget\&. In CascadeButton and CascadeButtonGadget, this resource is forced to True unless the parent is an OptionMenu\&. .IP "\fBXmNunitType\fP" 10 Provides the basic support for resolution independence\&. It defines the type of units a widget uses with sizing and positioning resources\&. If the widget\&'s parent is a subclass of \fBXmManager\fP and if the \fBXmNunitType\fP resource is not explicitly set, it defaults to the unit type of the parent widget\&. If the widget\&'s parent is not a subclass of \fBXmManager\fP, the resource has a default unit type of \fBXmPIXELS\fP\&. .IP "" 10 The unit type can also be specified in resource files, with the following format: .PP .nf \f(CW\fI\fP\fR .fi .PP .IP "" 10 where: .RS .IP "\fIunit\fP" 10 is <" ", pixels, inches, centimeters, millimeters, points, font units> .IP "\fIpixels\fP" 10 is <\fIpix\fP, \fIpixel\fP, \fIpixels\fP> .IP "\fIinches\fP" 10 is <\fIin\fP, \fIinch\fP, \fIinches\fP> .IP "\fIcentimeter\fP" 10 is <\fIcm\fP, \fIcentimeter\fP, \fIcentimeters\fP> .IP "\fImillimeters\fP" 10 is <\fImm\fP, \fImillimeter\fP, \fImillimeters\fP> .IP "\fBpoints\fP" 10 is <\fIpt\fP, \fIpoint\fP, \fIpoints\fP> .IP "\fBfont units\fP" 10 is <\fIfu\fP, \fBfont_unit\fP, \fBfont_units\fP> .IP "\fIfloat\fP" 10 is {"+"|"-"}{{<"0"-"9">*}\&.}<"0"-"9">* .IP "" 10 Note that the type Dimension must always be positive\&. .RE .IP "" 10 For example, .PP .nf \f(CWxmfonts*XmMainWindow\&.height: 10\&.4cm *PostIn\&.width: 3inches\fR .fi .PP .IP "" 10 \fBXmNunitType\fP can have the following values: .RS .IP "\fBXmPIXELS\fP" 10 All values provided to the widget are treated as normal pixel values\&. .IP "\fBXmMILLIMETERS\fP" 10 All values provided to the widget are treated as normal millimeter values\&. .IP "\fBXm100TH_MILLIMETERS\fP" 10 All values provided to the widget are treated as 1/100 of a millimeter\&. .IP "\fBXmCENTIMETERS\fP" 10 All values provided to the widget are treated as normal centimeter values\&. .IP "\fBXmINCHES\fP" 10 All values provided to the widget are treated as normal inch values\&. .IP "\fBXm1000TH_INCHES\fP" 10 All values provided to the widget are treated as 1/1000 of an inch\&. .IP "\fBXmPOINTS\fP" 10 All values provided to the widget are treated as normal point values\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXm100TH_POINTS\fP" 10 All values provided to the widget are treated as 1/100 of a point\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXmFONT_UNITS\fP" 10 All values provided to the widget are treated as normal font units\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fBXm100TH_FONT_UNITS\fP" 10 All values provided to the widget are treated as 1/100 of a font unit\&. A font unit has horizontal and vertical components\&. These are the values of the \fBXmScreen\fP resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .RE .IP "\fBXmNuserData\fP" 10 Allows the application to attach any necessary specific data to the widget\&. It is an internally unused resource\&. .SS "Dynamic Color Defaults" .PP The foreground, background, top shadow, bottom shadow, and highlight color resources are dynamically defaulted\&. If no color data is specified, the colors are automatically generated\&. On a single-plane system, a black and white color scheme is generated\&. Otherwise, four colors are generated, which display the correct shading for the 3-D visuals\&. If the background is the only color specified for a widget, the top shadow and bottom shadow colors are generated to give the 3-D appearance\&. Foreground and highlight colors are generated to provide sufficient contrast with the background color\&. .PP Colors are generated only at creation\&. Resetting the background through \fBXtSetValues\fP does not regenerate the other colors\&. \fBXmChangeColor\fP can be used to recalculate all associated colors based on a new background color\&. .SS "Inherited Resources" .PP Primitive inherits behavior and resources from the superclass described in the following table\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback for \fBXmNhelpCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. For this callback, \fIreason\fP is set to \fBXmCR_HELP\fP\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .PP A pointer to the following callback structure is passed to the \fBXmNconvertCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; Atom \fItarget\fP; XtPointer \fIsource_data\fP; XtPointer location_data; int \fIflags\fP; XtPointer \fIparm\fP; int \fIparm_format\fP; unsigned long \fIparm_length\fP; Atom \fIparm_type\fP; int \fIstatus\fP; XtPointer \fIvalue\fP; Atom \fItype\fP; int \fIformat\fP; unsigned long \fIlength\fP; } XmConvertCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which conversion is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fItarget\fP" 10 Indicates the conversion target\&. .IP "\fIsource_data\fP" 10 Contains information about the selection source\&. When the selection is \fB_MOTIF_DROP\fP, \fIsource_data\fP is the DragContext\&. Otherwise, it is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location of data to be converted\&. If the value is NULL, the data to be transferred consists of the widget\&'s current selection\&. Otherwise, the type and interpretation of the value are specific to the widget class\&. .IP "\fIflags\fP" 10 Indicates the status of the conversion\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 This flag is currently unused\&. .IP "\fBXmCONVERTING_PARTIAL\fP" 10 The target widget was able to be converted, but some data was lost\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The conversion target is the source of the data to be transferred\&. .IP "\fBXmCONVERTING_TRANSACT\fP" 10 This flag is currently unused\&. .RE .IP "\fIparm\fP" 10 Contains parameter data for this target\&. If no parameter data exists, the value is NULL\&. .IP "" 10 When \fIselection\fP is \fBCLIPBOARD\fP and \fItarget\fP is \fB_MOTIF_CLIPBOARD_TARGETS\fP or \fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP, the value is the requested operation (\fBXmCOPY\fP, \fBXmMOVE\fP, or \fBXmLINK\fP)\&. .IP "\fIparm_format\fP" 10 Specifies whether the data in \fIparm\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. Possible values are 0 (when \fIparm\fP is NULL), 8 (when the data in \fIparm\fP should be viewed as a list of \fIchar\fPs), 16 (when the data in \fIparm\fP should be viewed as a list of \fIshort\fPs), or 32 (when the data in \fIparm\fP should be viewed as a list of \fIlong\fPs)\&. Note that \fIparm_format\fP symbolizes a data type, not the number of bits in each list element\&. For example, on some machines, a \fIparm_format\fP of 32 means that the data in \fIparm\fP should be viewed as a list of 64-bit quantities, not 32-bit quantities\&. .IP "\fIparm_length\fP" 10 Specifies the number of elements of data in \fIparm\fP, where each element has the size specified by \fIparm_format\fP\&. When \fIparm\fP is NULL, the value is 0\&. .IP "\fIparm_type\fP" 10 Specifies the parameter type of \fIparm\fP\&. .IP "\fIstatus\fP" 10 An IN/OUT member that specifies the status of the conversion\&. The initial value is \fBXmCONVERT_DEFAULT\fP\&. The callback procedure can set this member to one of the following values: .RS .IP "\fBXmCONVERT_DEFAULT\fP" 10 This value means that the widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it overwrites the data provided by the callback procedures in the \fIvalue\fP member\&. .IP "\fBXmCONVERT_MERGE\fP" 10 This value means that the widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it appends its data to the data provided by the callback procedures in the \fIvalue\fP member\&. This value is intended for use with targets that result in lists of data, such as \fBTARGETS\fP\&. .IP "\fBXmCONVERT_DONE\fP" 10 This value means that the callback procedure has successfully finished the conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .IP "\fBXmCONVERT_REFUSE\fP" 10 This value means that the callback procedure has terminated the conversion process without completing the requested conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .RE .IP "\fIvalue\fP" 10 An IN/OUT parameter that contains any data that the callback procedure produces as a result of the conversion\&. The initial value is NULL\&. If the callback procedure sets this member, it must ensure that the \fItype\fP, \fIformat\fP, and \fIlength\fP members correspond to the data in \fIvalue\fP\&. The callback procedure is responsible for allocating memory when it sets this member\&. The toolkit frees this memory when it is no longer needed\&. .IP "\fItype\fP" 10 An IN/OUT parameter that indicates the type of the data in the \fIvalue\fP member\&. The initial value is \fBINTEGER\fP\&. .IP "\fIformat\fP" 10 An IN/OUT parameter that specifies whether the data in \fIvalue\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. The initial value is 8\&. The callback procedure can set this member to 8 (for a list of \fIchar\fP), 16 (for a list of \fIshort\fP), or 32 (for a list of \fIlong\fP)\&. .IP "\fIlength\fP" 10 An IN/OUT member that specifies the number of elements of data in \fIvalue\fP, where each element has the size symbolized by \fIformat\fP\&. The initial value is 0\&. .PP A pointer to the following structure is passed to each callback for \fBXmNpopupHandlerCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Widget \fImenuToPost\fP; Boolean \fIpostIt\fP; Widget \fItarget\fP; } XmPopupHandlerCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the handler\&. .IP "\fImenuToPost\fP" 10 Specifies the popup menu that the menu system believes should be posted\&. The application may modify this field\&. .IP "\fIpostIt\fP" 10 Indicates whether the posting process should continue\&. The application may modify this field\&. .IP "\fItarget\fP" 10 Specifies the most specific widget or gadget that the menu sytem found from the event that matches the event\&. .SS "Translations" .PP The \fBXmPrimitive\fP translations are listed below\&. .PP Note that for buttons in menus, altering translations in \fB#override\fP or \fB#augment\fP mode is undefined\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveTraverseHome() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveTraverseUp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveTraverseDown() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveTraverseLeft() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveTraverseRight() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrimitivePrevTabGroup() .IP "\fB\(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrimitiveNextTabGroup() .IP "\fB\fP\fB\fP:" 10 PrimitiveHelp() .SS "Action Routines" .PP The \fBXmPrimitive\fP action routines are .IP "PrimitiveHelp():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "PrimitiveNextTabGroup():" 10 This action depends on the value of the Display resource \fBXmNenableButtonTab\fP\&. When \fBXmNenableButtonTab\fP is False (default), this action traverses to the first item in the next tab group\&. If the current tab group is the last entry in the tab group list, it wraps to the beginning of the tab group list\&. .IP "" 10 When \fBXmNenableButtonTab\fP is True, this action moves to the next item within the current tab group, unless it is the last item in the tab group\&. When the item is the last in the group, the action traverses to the first item in the next tab group\&. The \fBXmNenableButtonTab\fP behavior applies only to PushButton, ArrowButton, and DrawnArrow\&. .IP "PrimitiveParentActivate():" 10 If the parent is a manager, passes the \fBKActivate\fP event received by the widget to the parent\&. .IP "PrimitiveParentCancel():" 10 If the parent is a manager, passes the \fBKCancel\fP event received by the widget to the parent\&. .IP "PrimitivePrevTabGroup():" 10 This action depends on the value of the Display resource \fBXmNenableButtonTab\fP\&. When \fBXmNenableButtonTab\fP is False (default), this action traverses to the first item in the previous tab group\&. If the beginning of the tab group list is reached, it wraps to the end of the tab group list\&. .IP "" 10 When \fBXmNenableButtonTab\fP is True, this action moves to the previous item within the current tab group unless it is the first item in the tab group\&. When the item is the first in the group, the action traverses to the first item in the previous tab group\&. The \fBXmNenableButtonTab\fP behavior applies only PushButton, ArrowButton, and DrawnButton\&. .IP "PrimitiveTraverseDown():" 10 Traverses to the next item below the current widget in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "PrimitiveTraverseHome():" 10 Traverses to the first widget or gadget in the current tab group\&. .IP "PrimitiveTraverseLeft():" 10 Traverses to the next item to the left of the current widget in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "PrimitiveTraverseNext():" 10 Traverses to the next item in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "PrimitiveTraversePrev():" 10 Traverses to the previous item in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "PrimitiveTraverseRight():" 10 Traverses to the next item to the right of the current gadget in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "PrimitiveTraverseUp():" 10 Traverses to the next item above the current gadget in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 If the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, highlights the widget and gives it the focus .IP "\fB\fP:" 10 If the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, unhighlights the widget and removes the focus .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmDirection\fP(3), \fBXmChangeColor\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmVaCreateLabel.30000644000175000017500000000256312672140200014764 00000000000000.DT .TH "XmVaCreateLabel" "library call" .SH "NAME" \fBXmVaCreateLabel\fP, \fBXmVaCreateManagedLabel\fP \(em A Label widget convenience creation functions\&. .iX "XmVaCreateLabel" "XmVaCreateManagedLabel" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateLabel\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedLabel\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Label widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateLabel\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedLabel\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Label and its associated resources, see \fBXmLabel\fP(3)\&. .SH "RETURN" .PP Returns the Label widget ID\&. .SH "RELATED" .PP \fBXmLabel\fP(3), \fBXmCreateLabel\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmTabListGetTab.30000644000175000017500000000367412672140200014767 00000000000000'\" t ...\" TabLstGe.sgm /main/9 1996/09/08 21:09:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabListGetTab" "library call" .SH "NAME" \fBXmTabListGetTab\fP \(em A convenience function that returns a copy of a tab .iX "XmTabListGetTab" .SH "SYNOPSIS" .PP .nf #include \fBXmTab \fBXmTabListGetTab\fP\fR( \fBXmTabList \fBtablist\fR\fR, \fBCardinal \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabListGetTab\fP returns a copy of the tab that is located at the specified position in the tab list\&. .IP "\fItablist\fP" 10 Specifies the tab list\&. .IP "\fIposition\fP" 10 Specifies the position of the tab to be returned\&. A value of 0 (zero) returns the first tab in the tab list, a value of 1 returns the second tab, and so on\&. .SH "RETURN" .PP Returns a copy of the tab that is located at the specified position in the tab list\&. If \fIposition\fP is greater than or equal to the number of tabs in the tab list, this function returns NULL\&. The application is responsible for managing the space allocted by the returned tab copy\&. The application can recover this allocated space by calling \fBXmTabFree\fP\&. .SH "RELATED" .PP \fBXmTabFree\fP(3) and \fBXmTabList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/MrmFetchBitmapLiteral.30000644000175000017500000000721612672140200016204 00000000000000'\" t ...\" FetchBit.sgm /main/10 1996/09/08 21:24:46 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmFetchBitmapLiteral" "library call" .SH "NAME" \fBMrmFetchBitmapLiteral\fP \(em Fetches a bitmap literal from a hierarchy .iX "MrmFetchBitmapLiteral" .iX "uil functions" "MrmFetchBitmapLiteral" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmFetchBitmapLiteral\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBString \fBindex\fR\fR, \fBScreen *\fBscreen\fR\fR, \fBDisplay *\fBdisplay\fR\fR, \fBPixmap *\fBpixmap_return\fR\fR, \fBDimension *\fBwidth\fR\fR, \fBDimension *\fBheight\fR\fR); .fi .iX "MRM function" "MrmFetchBitmapLiteral" .iX "MrmFetchBitmapLiteral" "definition" .SH "DESCRIPTION" .iX "MrmFetchBitmapLiteral" "description" .PP The \fBMrmFetchBitmapLiteral\fP function fetches a bitmap literal from an MRM hierarchy, and converts the bitmap literal to an X pixmap of depth 1\&. The function returns this pixmap and its width and height\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of the UID hierarchy that contains the specified icon literal\&. The value of \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIindex\fP" 10 Specifies the UIL name of the bitmap literal to fetch\&. .IP "\fIscreen\fP" 10 Specifies the screen used for the pixmap\&. The \fIscreen\fP argument specifies a pointer to the Xlib structure \fBScreen\fR which contains the information about that screen and is linked to the \fBDisplay\fR structure\&. For more information on the \fBDisplay\fR and \fBScreen\fR structures, see the Xlib function \fBXOpenDisplay\fP and the associated screen information macros\&. .IP "\fIdisplay\fP" 10 Specifies the display used for the pixmap\&. The \fIdisplay\fP argument specifies the connection to the X server\&. For more information on the \fBDisplay\fR structure, see the Xlib function \fBXOpenDisplay\fP\&. .IP "\fIpixmap_return\fP" 10 Returns the resulting X pixmap value\&. The function allocates space for this pixmap\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmDestroyPixmap\fP\&. .IP "\fIwidth\fP" 10 Specifies a pointer to the width of the pixmap\&. .IP "\fIheight\fP" 10 Specifies a pointer to the height of the pixmap\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmNOT_FOUND\fP" 10 The bitmap literal was not found in the hierarchy\&. .IP "\fBMrmWRONG_TYPE\fP" 10 The caller tried to fetch a literal of a type not supported by this function\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmFetchIconLiteral\fP(3), \fBMrmFetchLiteral\fP(3), and \fBXOpenDisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmListReplaceItemsUnselected.30000644000175000017500000000476612672140200017566 00000000000000'\" t ...\" LstReplD.sgm /main/8 1996/09/08 20:51:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListReplaceItemsUnselected" "library call" .SH "NAME" \fBXmListReplaceItemsUnselected\fP \(em A List function that replaces items in a list .iX "XmListReplaceItemsUn\\%selected" .iX "List functions" "XmListReplaceItemsUn\\%selected" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListReplaceItemsUnselected\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString *\fBold_items\fR\fR, \fBint \fBitem_count\fR\fR, \fBXmString *\fBnew_items\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListReplaceItemsUnselected\fP replaces each specified item in the list with a corresponding new item\&. The replacement items remain unselected, even if they currently appear in the \fBXmNselectedItems\fP list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget to replace items in\&. .IP "\fIold_items\fP" 10 Specifies a pointer to the list items to be replaced\&. .IP "\fIitem_count\fP" 10 Specifies the number of elements in \fIold_items\fP and \fInew_items\fP\&. This number must be nonnegative\&. .IP "\fInew_items\fP" 10 Specifies a pointer to the replacement items\&. Every occurrence of each element of \fIold_items\fP is replaced with the corresponding element from \fInew_items\fP\&. That is, the first element of \fIold_items\fP is replaced with the first element of \fInew_items\fP\&. The second element of \fIold_items\fP is replaced with the second element of \fInew_items\fP, and so on until \fIitem_count\fP is reached\&. If an element in \fIold_items\fP does not exist in the list, the corresponding entry in \fInew_items\fP is skipped\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmCreateIconGadget.30000644000175000017500000000352612672140200015462 00000000000000'\" t ...\" CreIco.sgm /main/7 1996/08/30 14:38:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateIconGadget" "library call" .SH "NAME" \fBXmCreateIconGadget\fP \(em The IconGadget widget creation function .iX "XmCreateIconGadget" .iX "creation functions" "XmCreateIconGadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateIconGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateIconGadget\fP creates an instance of an IconGadget widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of IconGadget and its associated resources, see \fBXmIconGadget\fP(3)\&. .SH "RETURN" .PP Returns the IconGadget widget ID\&. .SH "RELATED" .PP \fBXmIconGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmTextCut.30000644000175000017500000000543212672140200013730 00000000000000'\" t ...\" TxtCut.sgm /main/8 1996/09/08 21:12:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextCut" "library call" .SH "NAME" \fBXmTextCut\fP \(em A Text function that copies the primary selection to the clipboard and deletes the selected text .iX "XmTextCut" .iX "Text functions" "XmTextCut" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextCut\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextCut\fP copies the primary selected text to the clipboard and then deletes the primary selected text\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. .PP This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmMOVE\fP\&. If the transfer is successful, this routine then calls the \fBXmNconvertCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBDELETE\fP target\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fItime\fP" 10 Specifies the server time at which the selection value is to be modified\&. This should be the time of the event that triggered this request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed()\fP\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmCreateList.30000644000175000017500000000340012672140200014360 00000000000000'\" t ...\" CreLis.sgm /main/7 1996/08/30 14:41:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateList" "library call" .SH "NAME" \fBXmCreateList\fP \(em The List widget creation function .iX "XmCreateList" .iX "creation functions" "XmCreateList" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateList\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateList\fP creates an instance of a List widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns the List widget ID\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmTextGetSelectionPosition.30000644000175000017500000000432412672140200017306 00000000000000'\" t ...\" TxtGetSB.sgm /main/8 1996/09/08 21:17:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetSelectionPosition" "library call" .SH "NAME" \fBXmTextGetSelectionPosition\fP \(em A Text function that accesses the position of the primary selection .iX "XmTextGetSelectionPosition" .iX "Text functions" "XmTextGetSelectionPosition" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextGetSelectionPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fB*left\fR\fR, \fBXmTextPosition \fB*right\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetSelectionPosition\fP accesses the left and right position of the primary selection in the text buffer of the Text widget\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIleft\fP" 10 Specifies the pointer in which the position of the left boundary of the primary selection is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .IP "\fIright\fP" 10 Specifies the pointer in which the position of the right boundary of the primary selection is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns True if the widget owns the primary selection; otherwise, it returns False\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmSpinBoxValidatePosition.30000644000175000017500000001361112672140200017107 00000000000000'\" t ...\" SpinBoxV.sgm /main/7 1996/09/08 21:02:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSpinBoxValidatePosition" "library call" .SH "NAME" \fBXmSpinBoxValidatePosition\fP \(em translate the current value of the specified XmSpinBox child into a valid position .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmSpinBoxValidatePosition\fP\fR( \fBWidget \fBtextfield\fR\fR, \fBint \fB*position\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmSpinBoxValidatePosition\fP function is a utility that can be used by applications wanting to implement a policy for tracking user modifications to editable \fBXmSpinBox\fP children of type \fBXmNUMERIC\fP\&. The specifics of when and how the user\&'s modifications take effect is left up to the application\&. .IP "\fItext_field\fP" 10 The \fItext_field\fP argument specifies the widget ID of the child of the \fBXmSpinBox\fP that is being modified\&. The requirement on \fItext_field\fP is that it holds the \fBaccessTextual\fP trait (already a requirement for children of \fBXmSpinBox\fP)\&. This way, \fBXmSpinBox\fP can extract the string out of the \fItext_field\fP widget (even if it is not an \fBXmTextField\fP)\&. .IP "\fIposition\fP" 10 The location pointed to by the position argument is assigned the result of the translation done by \fBXmSpinBoxValidatePosition\fP\&. \fBXmSpinBoxValidatePosition\fP first checks to make sure this is an \fBXmNUMERIC\fP \fBXmSpinBox\fP child\&. If it is not, \fBXSmpinBoxValidatePosition\fP sets position to the current position and returns \fBXmCURRENT_VALUE\fP\&. .PP \fBXmSpinBoxValidatePosition\fP attempts to translate the input string to a floating point number\&. If this translation fails, \fBXmSpinBoxValidatePosition\fP sets position to the current position and returns \fBXmCURRENT_VALUE\fP\&. .PP \fBXmSpinBoxValidatePosition\fP converts the floating point number to an integer using the \fBXmNdecimalPoints\fP resource\&. Extra decimal places are truncated\&. The resulting integer is range checked to make sure it falls within the valid range defined by \fBXmNminimumValue\fP and \fBXmNmaximumValue\fP inclusive\&. If the input falls outside this range, \fBXmSpinBoxValidatePosition\fP sets position to the nearest limit and returns either \fBXmMINIMUM_VALUE\fP or \fBXmMAXIMUM_VALUE\fP\&. .PP Finally, \fBXmSpinBoxValidatePosition\fP checks the integer to make sure it belongs to the series defined by \fBXmNminimumValue \&.\&.\&. XmNminimumValue + ((n - 1) * XmNincrementValue)\fP\&. If the integer does not belong to this series, \fBXmSpinBoxValidatePosition\fP sets position to the nearest element which is less than or equal to the integer and returns \fBXmINCREMENT_VALUE\fP\&. .PP Otherwise, \fBXmSpinBoxValidatePosition\fP assigns the integer to position and returns \fBXmVALID_VALUE\fP\&. .SH "RETURN VALUE" .PP The \fBXmSpinBoxValidatePosition\fP function returns the status of the validation\&. The set of possible values returned is as follows: .IP "\fBXmCURRENT_VALUE\fP" 10 Cannot convert, returning current position_value\&. .IP "\fBXmMINIMUM_VALUE\fP" 10 Less than min\&. .IP "\fBXmMAXIMUM_VALUE\fP" 10 More than max\&. .IP "\fBXmINCREMENT_VALUE\fP" 10 Not on increment\&. .IP "\fBXmVALID_VALUE\fP" 10 Okay\&. .SH "EXAMPLES" .PP This first example demonstrates how the \fBXmSpinBoxValidatePosition\fP function could be used from inside an \fBXmNmodifyVerifyCallback\fP callback installed on the \fBXmSpinBox\fP or the \fBXmSimpleSpinBox\fP: .PP .nf \f(CW/* * Install a callback on a spin box arrow press\&. */ XtAddCallback(sb, XmNmodifyVerifyCallback, ModifyVerifyCB, NULL); XtAddCallback(simple_sb, XmNmodifyVerifyCallback, ModifyVerifyCB, NULL);\fR .fi .PP .PP with the callback doing: .PP .nf \f(CWvoid ModifyVerifyCB(widget, call_data, client_data) { XmSpinBoxCallbackStruct *cbs = (XmSpinBoxCallbackStruct*) call_data; int position; Widget textual = NULL; if (XtIsSubclass(w, xmSimpleSpinBoxWidgetClass)) { Arg args[1]; XtSetArg(args[0], XmNtextField, &textual); XtGetValues(w, args, 1); } else if (XtIsSubclass(w, xmSpinBoxWidgetClass)) textual = cbs->widget; else textual = (Widget) NULL; \&.\&.\&. if (XmSpinBoxValidatePosition(textual, &position) == XmCURRENT_VALUE) XBell(XtDisplay(w), 0); else cbs->position = position; }\fR .fi .PP .PP This second example demonstrates how the \fBXmSpinBoxValidatePosition\fP function could be used from inside an \fBXmNactivateCallback\fP callback installed on the \fBTextField\fP child of the \fBXmSpinBox\fP: .PP .nf \f(CW/* * Install a callback on a spin box arrow press\&. */ XtAddCallback(tf, XmNactivateCallback, ModifyVerifyChildCB, NULL);\fR .fi .PP .PP with the callback doing: .PP .nf \f(CWvoid ModifyVerifyChildCB(widget, call_data, client_data) { int position; Widget textual = widget; Arg args[1]; if (XmSpinBoxValidatePosition (textual, &position) == XmCURRENT_VALUE) XBell(XtDisplay(widget), 0); /* Set the position constraint resource of the textfield */ XtSetArg(args[0], XmNposition, position); XtSetValues(textual, args, 1); }\fR .fi .PP .SH "SEE ALSO" .PP \fBXmSpinBox\fP(3), \fBXmCreateSpinBox\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextFieldPosToXY.30000644000175000017500000000511212672140200015461 00000000000000'\" t ...\" TxtFieAV.sgm /main/9 1996/09/08 21:14:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldPosToXY" "library call" .SH "NAME" \fBXmTextFieldPosToXY\fP \(em A TextField function that accesses the x and y position of a character position .iX "XmTextFieldPosToXY" .iX "TextField functions" "XmTextFieldPosToXY" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldPosToXY\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR, \fBPosition \fB*x\fR\fR, \fBPosition \fB*y\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldPosToXY\fP accesses the \fIx\fP and \fIy\fP position, relative to the upper left corner of the TextField widget, of a given character position in the text buffer\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIposition\fP" 10 Specifies the character position in the text for which the \fIx\fP and \fIy\fP position is accessed\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0\&. .IP "\fIx\fP" 10 Specifies the pointer in which the \fIx\fP position is returned\&. The returned position is the distance from the left side of the widget to the left border of the character\&. This value is meaningful only if the function returns True\&. .IP "\fIy\fP" 10 Specifies the pointer in which the \fIy\fP position is returned\&. The returned position is the distance from the top of the widget to the character\&'s baseline\&. This value is meaningful only if the function returns True\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns True if the character position is displayed in the TextField widget; otherwise, it returns False, and no \fIx\fP or \fIy\fP value is returned\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmCreateContainer.30000644000175000017500000000353312672140200015376 00000000000000'\" t ...\" CreCon.sgm /main/7 1996/08/30 14:31:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateContainer" "library call" .SH "NAME" \fBXmCreateContainer\fP \(em The Container widget creation function .iX "XmCreateContainer" .iX "creation functions" "XmCreateContainer" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateContainer\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateContainer\fP creates an instance of a Container widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP This function returns the Container widget ID\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmTextRemove.30000644000175000017500000000404212672140200014426 00000000000000'\" t ...\" TxtRemov.sgm /main/8 1996/09/08 21:19:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextRemove" "library call" .SH "NAME" \fBXmTextRemove\fP \(em A Text function that deletes the primary selection .iX "XmTextRemove" .iX "Text functions" "XmTextRemove" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextRemove\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextRemove\fP deletes the primary selected text\&. If there is a selection, this routine also calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. This function may also call the \fBXmNmotionVerifyCallback\fP callback\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL or if the \fIwidget\fP does not own the primary selection\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmMapSegmentEncoding.30000644000175000017500000000364612672140200016044 00000000000000'\" t ...\" MapSeg.sgm /main/8 1996/09/08 20:53:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMapSegmentEncoding" "library call" .SH "NAME" \fBXmMapSegmentEncoding\fP \(em A compound string function that returns the compound text encoding format associated with the specified font list tag .iX "XmMapSegmentEncoding" .iX "compound string functions" "XmMapSegmentEncoding" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmMapSegmentEncoding\fP\fR( \fBchar *\fBfontlist_tag\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMapSegmentEncoding\fP searches the segment encoding registry for an entry that matches the specified font list tag and returns a copy of the associated compound text encoding format\&. The application is responsible for freeing the storage associated with the returned data by calling \fBXtFree\fP\&. .IP "\fIfontlist_tag\fP" 10 Specifies the compound string font list tag .SH "RETURN" .PP Returns a copy of the associated compound text encoding format if the font list tag is found in the registry; otherwise, returns NULL\&. .SH "RELATED" .PP \fBXmCvtXmStringToCT\fP(3), \fBXmFontList\fP(3), \fBXmRegisterSegmentEncoding\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmVaCreateIconGadget.30000644000175000017500000000270312672140200015745 00000000000000.DT .TH "XmVaCreateIconGadget" "library call" .SH "NAME" \fBXmVaCreateIconGadget\fP, \fBXmVaCreateManagedIconGadget\fP \(em A IconGadget widget convenience creation functions\&. .iX "XmVaCreateIconGadget" "XmVaCreateManagedIconGadget" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateIconGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedIconGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a IconGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateIconGadget\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedIconGadget\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of IconGadget and its associated resources, see \fBXmIconGadget\fP(3)\&. .SH "RETURN" .PP Returns the IconGadget widget ID\&. .SH "RELATED" .PP \fBXmIconGadget\fP(3), \fBXmCreateIconGadget\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateQuestionDialog.30000644000175000017500000000462012672140200016401 00000000000000'\" t ...\" CreQue.sgm /main/8 1996/09/08 20:34:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateQuestionDialog" "library call" .SH "NAME" \fBXmCreateQuestionDialog\fP \(em The MessageBox QuestionDialog convenience creation function .iX "XmCreateQuestionDialog" .iX "creation functions" "XmCreateQuestionDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateQuestionDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateQuestionDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged MessageBox child of the DialogShell\&. A QuestionDialog is used to get the answer to a question from the user\&. It includes a symbol, a message, and three buttons\&. The default symbol is a question mark\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. .PP Use \fBXtManageChild\fP to pop up the QuestionDialog (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateQuestionDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmClipboardInquireLength.30000644000175000017500000000661012672140200016725 00000000000000'\" t ...\" ClipbH.sgm /main/10 1996/09/25 10:24:28 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardInquireLength" "library call" .SH "NAME" \fBXmClipboardInquireLength\fP \(em A clipboard function that returns the length of the stored data .iX "XmClipboardInquireLength" .iX "clipboard functions" "XmClipboardInquireLength" .SH "SYNOPSIS" .PP .nf #include int XmClipboardInquireLength (\fIdisplay, window, format_name, length\fP) Display \fI* display\fP; Window \fIwindow\fP; char \fI* format_name\fP; unsigned long \fI* length\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardInquireLength\fP returns the length of the data stored under a specified format name for the clipboard data item\&. If no data is found for the specified format, or if there is no item on the clipboard, this function returns a value of 0 (zero) in the \fIlength\fP argument\&. .PP Any format passed by name is assumed to have \fIlength\fP passed in a call to \fBXmClipboardCopy\fP, even though the data has not yet been transferred to the clipboard in that format\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIformat_name\fP" 10 Specifies the name of the format for the data item\&. .IP "\fIlength\fP" 10 Specifies the length of the next data item in the specified format\&. This argument equals 0 (zero) if no data is found for the specified format, or if there is no item on the clipboard\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardNoData\fP" 10 The function could not find data on the clipboard corresponding to the format requested\&. This could occur because the clipboard is empty; there is data on the clipboard, but not in the requested format; or the data in the requested format was passed by name and is no longer available\&. .SH "RELATED" .PP \fBXmClipboardCopy\fP(3) and \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTextScroll.30000644000175000017500000000405512672140200014433 00000000000000'\" t ...\" TxtScrol.sgm /main/12 1996/09/08 21:19:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextScroll" "library call" .SH "NAME" \fBXmTextScroll\fP \(em A Text function that scrolls text .iX "XmTextScroll" .iX "Text functions" "XmTextScroll" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextScroll\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBlines\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextScroll\fP scrolls text by a given number of lines in a Text widget\&. The sign of the number is interpreted according to the value of the \fBXmNlayoutDirection\fP resource\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIlines\fP" 10 Specifies the number of lines of text to scroll\&. A positive value causes text to scroll upward; a negative value causes text to scroll downward\&. Note that the text will scroll only as long as one line of text remains visible in the window\&. .IP "" 10 If a navigator exists, this function uses the \fBXmQTnavigator\fP trait to update the vertical navigator\&'s value\&. .IP "" 10 In the case of vertical writing, a positive value causes the text to scroll forward; a negative value causes the lines to scroll backward\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmStringGetNextSegment.30000644000175000017500000000547712672140200016431 00000000000000'\" t ...\" StrGeE.sgm /main/9 1996/09/08 21:05:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringGetNextSegment" "library call" .SH "NAME" \fBXmStringGetNextSegment\fP \(em A compound string function that fetches the bytes in the next segment of a compound string .iX "XmStringGetNextSegment" .iX "compound string functions" "XmStringGetNextSegment" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringGetNextSegment\fP\fR( \fBXmStringContext \fBcontext\fR\fR, \fBchar **\fBtext\fR\fR, \fBXmStringTag *\fBtag\fR\fR, \fBXmStringDirection *\fBdirection\fR\fR, \fBBoolean *\fBseparator\fR\fR); .fi .SH "DESCRIPTION" .PP This routine is obsolete and exists for compatibility with previous releases\&. To read the contents of a compound string, read each component of the string with \fBXmStringGetNextTriple\fP\&. This \fBXmString\fR function returns the type, length, and value of the next component in the compound string\&. \fBXmStringGetNextSegment\fP fetches the bytes in the next segment; repeated calls fetch sequential segments\&. The \fItext\fP, \fItag\fP, and \fIdirection\fP of the fetched segment are returned each time\&. A Boolean status is returned to indicate whether a valid segment was successfully parsed\&. .PP If the function returns True, then the function allocates space to hold the returned \fItext\fP and \fItag\fP\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXtFree\fP\&. .IP "\fIcontext\fP" 10 Specifies the string context structure which was allocated by the \fBXmStringInitContext\fP function .IP "\fItext\fP" 10 Specifies a pointer to a NULL-terminated string .IP "\fItag\fP" 10 Specifies a pointer to the font list element tag associated with the text .IP "\fIdirection\fP" 10 Specifies a pointer to the direction of the text .IP "\fIseparator\fP" 10 Specifies whether the next component of the compound string is a separator .SH "RETURN" .PP Returns True if a valid segment is found\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringInitContext\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmDirectionMatchPartial.30000644000175000017500000000432312672140200016540 00000000000000'\" t ...\" DirectC.sgm /main/8 1996/09/08 20:39:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDirectionMatchPartial" "library call" .SH "NAME" \fBXmDirectionMatchPartial\fP \(em A function that checks for a specified direction component .iX "XmDirectionMatchPartial" .SH "SYNOPSIS" .PP .nf #include Boolean XmDirectionMatchPartial (\fId1, d2, dmask\fP) XmDirection \fId1\fP; XmDirection \fId2\fP; XmDirection \fIdmask\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmDirectionMatchPartial\fP compares \fId1\fP and \fId2\fP along the direction component specified by \fIdmask\fP\&. For example, if \fIdmask\fP equals \fBXmVERTICAL_MASK\fP, then the function will compare only the vertical components of \fId1\fP and \fId2\fP\&. .IP "\fId1\fP" 10 Specifies an \fBXmDirection\fR value to check\&. .IP "\fId2\fP" 10 Specifies an \fBXmDirection\fR value to check\&. .IP "\fIdmask\fP" 10 Specifies the direction component along which \fId1\fP and \fId2\fP are to be checked\&. Appropriate values for \fIdmask\fP are \fBXmHORIZONTAL_MASK\fP, \fBXmVERTICAL_MASK\fP, and \fBXmPRECEDENCE_MASK\fP\&. .SH "RETURN VALUES" .PP Returns True if the \fId1\fP and \fId2\fP match in the component specified by \fIdmask\fP; otherwise, returns False\&. .SH "RELATED INFORMATION" .PP \fBXmDirection\fP(3), \fBXmDirectionMatch\fP(3), \fBXmDirectionToStringDirection\fP(3), \fBXmStringDirection\fP(3), and \fBXmStringDirectionToDirection\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmCreateFileSelectionDialog.30000644000175000017500000000535412672140200017324 00000000000000'\" t ...\" CreFiB.sgm /main/8 1996/09/08 20:33:19 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateFileSelectionDialog" "library call" .SH "NAME" \fBXmCreateFileSelectionDialog\fP \(em The FileSelectionBox FileSelectionDialog convenience creation function .iX "XmCreateFileSelection\\%Dialog" .iX "creation functions" "XmCreateFileSelection\\%Dialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateFileSelectionDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateFileSelectionDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged FileSelectionBox child of the DialogShell\&. A FileSelectionDialog selects a file\&. It includes the following: .IP " \(bu" 6 An editable text field for the directory mask .IP " \(bu" 6 A scrolling list of filenames .IP " \(bu" 6 An editable text field for the selected file .IP " \(bu" 6 Labels for the list and text fields .IP " \(bu" 6 Four buttons .PP The default button labels are \fBOK\fP, \fBFilter\fP, \fBCancel\fP, and \fBHelp\fP\&. One additional \fBWorkArea\fP child may be added to the FileSelectionBox after creation\&. .PP Use \fBXtManageChild\fP to pop up the FileSelectionDialog (passing the FileSelectionBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateFileSelectionDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of FileSelectionBox and its associated resources, see \fBXmFileSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the FileSelectionBox widget ID\&. .SH "RELATED" .PP \fBXmFileSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmCreateCombinationBox2.30000644000175000017500000000347112672140200016452 00000000000000'\" t ...\" CreArA.sgm /main/7 1996/08/30 14:27:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateArrowButton" "library call" .SH "NAME" \fBXmCreateCombinationBox2\fP \(em The CombinationBox2 widget creation function .iX "XmCreateCombinationBox2" .iX "creation functions" "XmCreateCombinationBox2" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateCombinationBox2\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateCombinationBox2\fP creates an instance of an ArrowButton widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ArrowButton and its associated resources, see \fBXmCombinationBox2\fP(3)\&. .SH "RETURN" .PP Returns the CombinationBox2 widget ID\&. .SH "RELATED" .PP \fBXmCombinationBox2\fP(3)\&. motif-2.3.8/doc/man/man3/XmDirectionToStringDirection.30000644000175000017500000000541612672140200017605 00000000000000'\" t ...\" DirectD.sgm /main/7 1996/08/30 15:07:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDirectionToStringDirection" "library call" .SH "NAME" \fBXmDirectionToStringDirection\fP \(em A function that converts an XmDirection value to an XmStringDirection value .iX "XmDirectionToStringDirection" .SH "SYNOPSIS" .PP .nf #include XmStringDirection XmDirectionToStringDirection (\fIdir\fP) XmDirection \fIdir\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmDirectionToStringDirection\fP converts the specified \fBXmDirection\fR direction value to its equivalent \fBXmStringDirection\fR value\&. Basically, if the \fBXmDirection\fR value has a horizontal direction specification, that horizontal element is used; otherwise, the \fBXmStringDirection\fR value is interpreted as \fBXmSTRING_DIRECTION_L_TO_R\fP\&. This function provides backward compatibility with the \fBXmStringDirection\fR data type\&. .PP Note that the Motif toolkit also contains an \fBXmStringDirectionToDirection\fP routine to convert an \fBXmStringDirection\fR value to its \fBXmDirection\fR equivalent\&. .IP "\fIdir\fP" 10 Specifies the \fBXmDirection\fR value to be converted\&. .SH "RETURN" .PP Returns the following \fBXmStringDirection\fR values: .IP "\fBXmSTRING_DIRECTION_R_TO_L\fP" 10 If the \fIdir\fP argument has a right to left horizontal direction value in it, for example \fBXmRIGHT_TO_LEFT_TOP_TO_BOTTOM\fP\&. .IP "\fBXmSTRING_DIRECTION_L_TO_R\fP" 10 If the \fIdir\fP argument has a left to right horizontal direction in it, for example \fBXmLEFT_TO_RIGHT_TOP_TO_BOTTOM\fP, or if the horizontal direction value in the \fIdir\fP argument is ambiguous, such as in the \fBXmTOP_TO_BOTTOM\fP value\&. .IP "\fBXmSTRING_DIRECTION_DEFAULT\fP" 10 If there was no horizontal direction specified\&. .SH "RELATED INFORMATION" .PP \fBXmDirection\fP(3), \fBXmDirectionMatch\fP(3), \fBXmDirectionMatchPartial\fP(3), \fBXmDirectionToStringDirection\fP(3), \fBXmString\fP(3), \fBXmStringDirection\fP(3), and \fBXmStringDirectionToDirection\fP(3), ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmStringDrawImage.30000644000175000017500000000660412672140200015361 00000000000000'\" t ...\" StrDrB.sgm /main/9 1996/09/08 21:04:26 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringDrawImage" "library call" .SH "NAME" \fBXmStringDrawImage\fP \(em A compound string function that draws a compound string in an X Window and creates an image .iX "XmStringDrawImage" .iX "compound string functions" "XmStringDrawImage" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmStringDrawImage\fP\fR( \fBDisplay \fB* d\fR\fR, \fBWindow \fBw\fR\fR, \fBXmRenderTable \fBrendertable\fR\fR, \fBXmString \fBstring\fR\fR, \fBGC \fBgc\fR\fR, \fBPosition \fBx\fR\fR, \fBPosition \fBy\fR\fR, \fBDimension \fBwidth\fR\fR, \fBunsigned char \fBalignment\fR\fR, \fBunsigned char \fBlayout_direction\fR\fR, \fBXRectangle \fB* clip\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringDrawImage\fP draws a compound string in an X Window and paints both the foreground and background bits of each character\&. If a compound string segment uses a rendition that contains a font set, the graphic context passed to this routine will have the GC font member left in an undefined state\&. The underlying \fBXmbStringDraw\fP function called by this routine modifies the font ID field of the GC passed into it and does not attempt to restore the font ID to the incoming value\&. If the compound string segment is not drawn using a font set, the graphic context must contain a valid font member\&. Graphic contexts created by \fBXtGetGC\fP are not accepted by this routine; instead, use \fBXtAllocateGC\fP to create a graphic context\&. .IP "\fId\fP" 10 Specifies the display\&. .IP "\fIw\fP" 10 Specifies the window\&. .IP "\fIrendertable\fP" 10 Specifies the render table\&. .IP "\fIstring\fP" 10 Specifies the string\&. .IP "\fIgc\fP" 10 Specifies the graphics context to use\&. .IP "\fIx\fP" 10 Specifies a coordinate of the rectangle that will contain the displayed compound string\&. .IP "\fIy\fP" 10 Specifies a coordinate of the rectangle that will contain the displayed compound string\&. .IP "\fIwidth\fP" 10 Specifies the width of the rectangle that will contain the displayed compound string\&. .IP "\fIalignment\fP" 10 Specifies how the string will be aligned within the specified rectangle\&. It is either \fBXmALIGNMENT_BEGINNING\fP, \fBXmALIGNMENT_CENTER\fP, or \fBXmALIGNMENT_END\fP\&. .IP "\fIlayout_direction\fP" 10 Controls the direction in which the segments of the compound string will be laid out\&. It also determines the meaning of the \fIalignment\fP parameter\&. .IP "\fIclip\fP" 10 Allows the application to restrict the area into which the compound string will be drawn\&. If NULL, clipping will be determined by the GC\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmUpdateDisplay.30000644000175000017500000000413612672140200015100 00000000000000'\" t ...\" UpdateDi.sgm /main/7 1996/09/08 21:20:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmUpdateDisplay" "library call" .SH "NAME" \fBXmUpdateDisplay\fP \(em A function that processes all pending exposure events immediately .iX "XmUpdateDisplay" .SH "SYNOPSIS" .PP .nf void XmUpdateDisplay (\fIwidget\fP) Widget \fIwidget\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmUpdateDisplay\fP provides the application with a mechanism for forcing all pending exposure events to be removed from the input queue and processed immediately\&. When a user selects a button within a menu pane, the menu panes are unposted and then any activation callbacks registered by the application are invoked\&. If one of the callbacks performs a time-consuming action, the portion of the application window that was covered by the menu panes will not have been redrawn; normal exposure processing does not occur until all of the callbacks have been invoked\&. If the application writer suspects that a callback will take a long time, then the callback may choose to invoke \fBXmUpdateDisplay\fP before starting its time-consuming operation\&. This function is also useful any time a transient window, such as a dialog box, is unposted; callbacks are invoked before normal exposure processing can occur\&. .IP "\fIwidget\fP" 10 Specifies any widget or gadget\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmCreateSimpleRadioBox.30000644000175000017500000000505012672140200016331 00000000000000'\" t ...\" CreSiF.sgm /main/8 1996/09/08 20:36:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSimpleRadioBox" "library call" .SH "NAME" \fBXmCreateSimpleRadioBox\fP \(em A RowColumn widget convenience creation function .iX "XmCreateSimpleRadioBox" .iX "creation functions" "XmCreateSimpleRadioBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSimpleRadioBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSimpleRadioBox\fP creates an instance of a RowColumn widget of type \fBXmWORK_AREA\fP and returns the associated widget ID\&. .PP This routine creates a RadioBox and its ToggleButtonGadget children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. Buttons are named and created in the order they are specified in the RowColumn simple menu creation resources supplied in the argument list\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. The only button type allowed in the \fBXmNbuttonType\fP resource is \fBXmRADIOBUTTON\fP\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateRadioBox\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleCheckBox\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimpleRadioBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmCreateCommandDialog.30000644000175000017500000000427212672140200016153 00000000000000'\" t ...\" CreCoC.sgm /main/2 1996/09/25 10:32:36 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateCommandDialog" "library call" .SH "NAME" \fBXmCreateCommandDialog\fP \(em The Command CommandDialog convenience creation function .iX "XmCreateCommandDialog" .iX "creation functions" "XmCreateCommandDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateCommandDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateCommandDialog\fP is a convenience function that creates a DialogShell and an unmanaged Command child of the DialogShell\&. A CommandDialog is used for entering commands for processing\&. .PP Use \fBXtManageChild\fP to pop up the CommandDialog (passing the Command as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateCommandDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Command and its associated resources, see \fBXmCommand\fP(3)\&. .SH "RETURN" .PP Returns the Command widget ID\&. .SH "RELATED" .PP \fBXmCommand\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmDirectionMatch.30000644000175000017500000000532712672140200015230 00000000000000'\" t ...\" DirectB.sgm /main/8 1996/09/08 20:39:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDirectionMatch" "library call" .SH "NAME" \fBXmDirectionMatch\fP \(em A function that checks for a specified direction component .iX "XmDirectionMatch" .SH "SYNOPSIS" .PP .nf #include Boolean XmDirectionMatch (\fId1, d2\fP) XmDirection \fId1\fP; XmDirection \fId2\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmDirectionMatch\fP compares two \fBXmDirection\fR values\&. The function returns a Boolean value depending on whether or not the two input values "match\&." The simplest match is when \fId1\fP and \fId2\fP are identical\&. However, other matches are possible\&. \fBXmDirectionMatch\fP attempts to compare specified bits only; nonspecified bits automatically match\&. .PP For example, suppose that \fId1\fP equals \fBXmTOP_TO_BOTTOM_RIGHT_TO_LEFT\fP\&. In this case, the function will return True if \fId2\fP equals either \fBXmRIGHT_TO_LEFT\fP or \fBXmTOP_TO_BOTTOM\fP\&. However, the function will return False if \fId2\fP equals \fBXmTOP_TO_BOTTOM_LEFT_TO_RIGHT\fP, \fBXmBOTTOM_TO_TOP_RIGHT_TO_LEFT\fP, or \fBXmBOTTOM_TO_TOP_LEFT_TO_RIGHT\fP\&. .PP Note that direction can be thought of as having three components, a horizontal component, a vertical component, and the precedence among them\&. This means that in addition to the previously mentioned directions, the function will still return False if \fId1\fP equals \fBXmTOP_TO_BOTTOM_RIGHT_TO_LEFT\fP and \fId2\fP equals \fBXmRIGHT_TO_LEFT_TOP_TO_BOTTOM\fP\&. .IP "\fId1\fP" 10 Specifies an \fBXmDirection\fR value\&. .IP "\fId2\fP" 10 Specifies an \fBXmDirection\fR value\&. .SH "RETURN VALUES" .PP Returns True if \fId1\fP "matches" \fId2\fP; otherwise, returns False\&. .SH "RELATED INFORMATION" .PP \fBXmDirection\fP(3), \fBXmDirectionMatchPartial\fP(3), \fBXmDirectionToStringDirection\fP(3), \fBXmString\fP(3), \fBXmStringDirection\fP(3), and \fBXmStringDirectionToDirection\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmDataFieldSetInsertionPosition.30000644000175000017500000000364412672140200020244 00000000000000'\" t ...\" TxtFieBC.sgm /main/8 1996/09/08 21:15:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldSetInsertionPosition" "library call" .SH "NAME" \fBXmDataFieldSetInsertionPosition\fP \(em A DataField function that sets the position of the insertion cursor .iX "XmDataFieldSetInsertion\\%Position" .iX "DataField functions" "XmDataFieldSetInsertion\\%Position" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDataFieldSetInsertionPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmDataPosition \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldSetInsertionPosition\fP sets the insertion cursor position of the DataField widget\&. This routine also calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks if the insertion cursor position changes\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIposition\fP" 10 Specifies the position of the insert cursor\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmStringInitContext.30000644000175000017500000000371312672140200015767 00000000000000'\" t ...\" StrIni.sgm /main/8 1996/09/08 21:05:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringInitContext" "library call" .SH "NAME" \fBXmStringInitContext\fP \(em A compound string function that creates a data structure for scanning an XmString component by component .iX "XmStringInitContext" .iX "compound string functions" "XmStringInitContext" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringInitContext\fP\fR( \fBXmStringContext \fB* context\fR\fR, \fBXmString \fBstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringInitContext\fP creates a context to allow applications to read out the contents of a compound string component by component\&. A Boolean status is returned to indicate that the context could not be initalized\&. .PP If the function returns True, the function will allocate space to hold the returned \fIcontext\fP\&. The application is responsible for managing the allocated space\&. The memory can be recovered by calling \fBXmStringFreeContext\fP\&. .IP "\fIcontext\fP" 10 Specifies a pointer to the allocated context .IP "\fIstring\fP" 10 Specifies the string .SH "RETURN" .PP Returns True if the context was allocated .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmCreateScrollBar.30000644000175000017500000000350112672140200015332 00000000000000'\" t ...\" CreScB.sgm /main/8 1996/09/08 20:35:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateScrollBar" "library call" .SH "NAME" \fBXmCreateScrollBar\fP \(em The ScrollBar widget creation function .iX "XmCreateScrollBar" .iX "creation functions" "XmCreateScrollBar" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateScrollBar\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateScrollBar\fP creates an instance of a ScrollBar widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ScrollBar and its associated resources, see \fBXmScrollBar\fP(3)\&. .SH "RETURN" .PP Returns the ScrollBar widget ID\&. .SH "RELATED" .PP \fBXmScrollBar\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmTextFieldSetSelection.30000644000175000017500000000442112672140200016537 00000000000000'\" t ...\" TxtFieBE.sgm /main/9 1996/09/08 21:15:46 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetSelection" "library call" .SH "NAME" \fBXmTextFieldSetSelection\fP \(em A TextField function that sets the primary selection of the text .iX "XmTextFieldSetSelection" .iX "TextField functions" "XmTextFieldSetSelection" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetSelection\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBfirst\fR\fR, \fBXmTextPosition \fBlast\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetSelection\fP sets the primary selection of the text in the widget\&. It also sets the insertion cursor position to the last position of the selection and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. \fBXmTextFieldSetSelection\fP always generates an \fBXmNgainPrimaryCallback\fP unless it fails to take ownership of the primary text selection\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIfirst\fP" 10 Marks the first character position of the text to be selected .IP "\fIlast\fP" 10 Marks the last position of the text to be selected .IP "\fItime\fP" 10 Specifies the time at which the selection value is desired\&. This should be the same as the time of the event that triggered this request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed\fP\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextPaste.30000644000175000017500000000473012672140200014251 00000000000000'\" t ...\" TxtPastA.sgm /main/8 1996/09/08 21:18:38 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextPaste" "library call" .SH "NAME" \fBXmTextPaste\fP \(em A Text function that inserts the clipboard selection .iX "XmTextPaste" .iX "Text functions" "XmTextPaste" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextPaste\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextPaste\fP inserts the clipboard selection at the insertion cursor of the destination widget\&. If \fBXmNpendingDelete\fP is True and the insertion cursor is inside the current selection, the clipboard selection replaces the selected text\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as the position where the selection is to be inserted, the \fBXmNmotionVerifyCallback\fP is called\&. .PP This routine calls the widget\&'s \fBXmNdestinationCallback\fP procedures with the \fIselection\fP member of the \fBXmDestinationCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIoperation\fP member set to \fBXmCOPY\fP\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns False if no transfers take place\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmVaCreateManagedExt18List.30000644000175000017500000000003712672140200016761 00000000000000.so man3/XmVaCreateExt18List.3 motif-2.3.8/doc/man/man3/XmVaCreateManagedTextField.30000644000175000017500000000003712672140200017104 00000000000000.so man3/XmVaCreateTextField.3 motif-2.3.8/doc/man/man3/XmTabListRemoveTabs.30000644000175000017500000000477312672140200015671 00000000000000'\" t ...\" TabLstRA.sgm /main/8 1996/09/08 21:09:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabListRemoveTabs" "library call" .SH "NAME" \fBXmTabListRemoveTabs\fP \(em A convenience function that removes noncontiguous tabs .iX "XmTabListRemoveTabs" .SH "SYNOPSIS" .PP .nf #include \fBXmTabList \fBXmTabListRemoveTabs\fP\fR( \fBXmTabList \fBoldlist\fR\fR, \fBCardinal \fB*position_list\fR\fR, \fBCardinal \fBposition_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabListRemoveTabs\fP removes noncontiguous tabs from a tab list\&. The function creates a new tab list by copying the contents of \fIoldlist\fP and removing all tabs whose corresponding positions appear in the \fIposition_list\fP array\&. A warning message is displayed if a specified position is invalid; for example, if the value is a number greater than the number of tabs in the tab list\&. .IP "\fItablist\fP" 10 Specifies the tab list\&. The function deallocates \fIoldlist\fP and the tabs it contains after extracting the required information\&. .IP "\fIposition_list\fP" 10 Specifies an array of the tab positions to be removed\&. The position of the first tab in the list is 0 (zero), the position of the second tab is 1, and so on\&. .IP "\fIposition_count\fP" 10 Specifies the number of elements in the \fIposition_list\fP\&. .SH "RETURN" .PP If \fIoldlist\fP or \fIposition_list\fP is NULL, or \fIposition_count\fP is 0 (zero), returns \fIoldlist\fP\&. Otherwise, this function returns the new tab list\&. The function allocates space to hold the returned tab list\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmTabListFree\fP\&. .SH "RELATED" .PP \fBXmTabList\fP(3) and \fBXmTabListFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmGetVisibility.30000644000175000017500000000550512672140200015120 00000000000000'\" t ...\" GetVisi.sgm /main/8 1996/09/08 20:46:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetVisibility" "library call" .SH "NAME" \fBXmGetVisibility\fP \(em A function that determines if a widget is visible .iX "XmGetVisibility" .SH "SYNOPSIS" .PP .nf #include \fBXmVisibility \fBXmGetVisibility\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetVisibility\fP returns the visibility state of the specified widget\&. It checks to see if some part of the widget\&'s rectangular area is unobscured by the widget\&'s ancestors, or some part of the widget\&'s rectangular area is inside the work window (but possibly outside the clip window) of a ScrolledWindow whose \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP and whose \fBXmNtraverseObscuredCallback\fP is not NULL\&. .PP \fBXmGetVisibility\fP does not check to see if \fIwidget\fP is obscured by its siblings or by siblings of its ancestors\&. Consequently, \fBXmGetVisibility\fP returns \fBXmVISIBILITY_UNOBSCURED\fP for widgets which are completely or partially covered by one or more siblings of \fIwidget\fP by one or more siblings of ancestors of \fIwidget\fP\&. .PP When a widget which is unrealized is being queried, it is indicated that the widget is fully obscured\&. If an application unmaps a \fIwidget\fP that has its \fBXmNmappedWhenManaged\fP resource set to True, the return value is undefined\&. When a widget which is unmanaged is being queried, it is indicated that the widget is fully obscured\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget .SH "RETURN" .PP Returns one of the following values: .IP "\fBXmVISIBILITY_UNOBSCURED\fP" 10 Indicates that the widget is mapped, not obscured, and is completely visible on the screen\&. .IP "\fBXmVISIBILITY_PARTIALLY_OBSCURED\fP" 10 Indicates that the widget is mapped, and is not completely visible on the screen (partially obscured)\&. .IP "\fBXmVISIBILITY_FULLY_OBSCURED\fP" 10 Indicates that the widget is not at all visible on the screen\&. .SH "RELATED" .PP \fBXmIsTraversable\fP(3), \fBXmManager\fP(3), and \fBXmProcessTraversal\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmContainerCopyLink.30000644000175000017500000000436212672140200015724 00000000000000'\" t ...\" ContainC.sgm /main/7 1996/08/30 14:23:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerCopyLink" "library call" .SH "NAME" \fBXmContainerCopyLink\fP \(em Container widget function to copy links to the clipboard .iX "XmContainerCopyLink" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmContainerCopyLink\fP\fR( \fBWidget \fBcontainer\fR\fR, \fBTime \fBtimestamp\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerCopyLink\fP copies links to the primary selected items to the clipboard\&. This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmLINK\fP\&. The Container widget itself does not copy any links; \fBXmNconvertCallback\fP procedures are responsible for copying the link to the clipboard and for taking any related actions\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .IP "\fItimestamp\fP" 10 Specifies the server time at which to modify the selection value\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP The function returns False in the following cases: if the primary selection is NULL, if the widget does not own the primary selection, or if the function is unable to gain ownership of the clipboard selection\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmVaCreateSimplePopupMenu.30000644000175000017500000001615712672140200017053 00000000000000'\" t ...\" VaCreD.sgm /main/9 1996/09/08 21:21:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmVaCreateSimplePopupMenu" "library call" .SH "NAME" \fBXmVaCreateSimplePopupMenu\fP \(em A RowColumn widget convenience creation function .iX "XmVaCreateSimplePopup\\%Menu" .iX "creation functions" "XmVaCreateSimplePopup\\%Menu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmVaCreateSimplePopupMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmVaCreateSimplePopupMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_POPUP\fP and returns the associated widget ID\&. This routine uses the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP This routine creates a Popup menu pane and its button children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. The name of each separator is \fBseparator_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of separators in the menu minus 1\&. The name of each title is \fBlabel_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of titles in the menu minus 1\&. Buttons, separators, and titles are named and created in the order in which they are specified in the variable portion of the argument list\&. .IP "\fIparent\fP" 10 Specifies the widget ID of the parent of the MenuShell .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIcallback\fP" 10 Specifies a callback procedure to be called when a button is activated or when its value changes\&. This callback function is added to each button after creation\&. For a CascadeButtonGadget or a PushButtonGadget, the callback is added as the button\&'s \fBXmNactivateCallback\fP, and it is called when the button is activated\&. For a ToggleButtonGadget, the callback is added as the button\&'s \fBXmNvalueChangedCallback\fP, and it is called when the button\&'s value changes\&. The button number is returned in the \fIclient_data\fP field\&. .PP The variable portion of the argument list consists of groups of arguments\&. The first argument in each group is a constant or a string and determines which arguments follow in that group\&. The last argument in the list must be NULL\&. The following list describes the possible first arguments in each group of \fIvarargs\fP\&. .IP "\fBXmVaCASCADEBUTTON\fP" 10 This is followed by two additional arguments\&. The set specifies one button in the PopupMenu and some of its resource values\&. The button created is a CascadeButtonGadget\&. Following are the additional two arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .RE .IP "\fBXmVaPUSHBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the PopupMenu and some of its resource values\&. The button created is a PushButtonGadget\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR .RE .IP "\fBXmVaRADIOBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the PopupMenu and some of its resource values\&. The button created is a ToggleButtonGadget\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR .RE .IP "\fBXmVaCHECKBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the PopupMenu and some of its resource values\&. The button created is a ToggleButtonGadget\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR .RE .IP "\fBXmVaTITLE\fP" 10 This is followed by one additional argument\&. The pair specifies a title LabelGadget in the PopupMenu\&. Following is the additional argument: .RS .IP "\fItitle\fP" 10 The title string, of type \fBXmString\fR .RE .IP "\fBXmVaSEPARATOR\fP" 10 This is followed by no additional arguments\&. It specifies one separator in the PopupMenu\&. .IP "\fBXmVaDOUBLE_SEPARATOR\fP" 10 This is followed by no additional arguments\&. It specifies one separator in the PopupMenu\&. The separator type is \fBXmDOUBLE_LINE\fP\&. .IP "\fIresource_name\fP" 10 This is followed by one additional argument, the value of the resource, of type \fBXtArgVal\fP\&. The pair specifies a resource and its value for the RowColumn widget\&. .IP "\fBXtVaTypedArg\fP" 10 This is followed by four additional arguments\&. The set specifies a resource and its value for the RowColumn widget\&. A resource type conversion is performed if necessary\&. Following are the additional four arguments, in order: .RS .IP "\fIname\fP" 10 The resource name, of type \fBString\fR .IP "\fItype\fP" 10 The type of the resource value supplied, of type \fBString\fR .IP "\fIvalue\fP" 10 The resource value (or a pointer to the resource value, depending on the type and size of the value), of type \fBXtArgVal\fP .IP "\fIsize\fP" 10 The size of the resource value in bytes, of type \fIint\fP .RE .IP "\fBXtVaNestedList\fP" 10 This is followed by one additional argument of type \fBXtVarArgsList\fP\&. This argument is a nested list of \fIvarargs\fP returned by \fBXtVaCreateArgsList\fP\&. .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreatePopupMenu\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimplePopupMenu\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmTextFieldGetInsertionPosition.30000644000175000017500000000351212672140200020275 00000000000000'\" t ...\" TxtFieAH.sgm /main/8 1996/09/08 21:13:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetInsertionPosition" "library call" .SH "NAME" \fBXmTextFieldGetInsertionPosition\fP \(em A TextField function that accesses the position of the insertion cursor .iX "XmTextFieldGetInsertion\\%Position" .iX "TextField functions" "XmTextFieldGetInsertion\\%Position" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmTextFieldGetInsertionPosition\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetInsertionPosition\fP accesses the insertion cursor position of the TextField widget\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns an \fBXmTextPosition\fR value that indicates the state of the \fBXmNcursorPosition\fP resource\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextCopyLink.30000644000175000017500000000454312672140200014727 00000000000000'\" t ...\" TxtCopyL.sgm /main/7 1996/08/30 16:21:30 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextCopyLink" "library call" .SH "NAME" \fBXmTextCopyLink\fP \(em A Text function that copies a link to the primary selection to the clipboard .iX "XmTextCopyLink" .iX "Text functions" "XmTextCopyLink" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextCopyLink\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextCopyLink\fP copies a link to the primary selected text to the clipboard\&. This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmLINK\fP\&. The Text widget itself does not copy any links; \fBXmNconvertCallback\fP procedures are responsible for copying the link to the clipboard and for taking any related actions\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fItime\fP" 10 Specifies the time of the transfer\&. This should be the time of the event which triggered this request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed\fP\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmFontListEntryGetTag.30000644000175000017500000000356612672140200016216 00000000000000'\" t ...\" FontLstO.sgm /main/8 1996/09/08 20:44:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListEntryGetTag" "library call" .SH "NAME" \fBXmFontListEntryGetTag\fP \(em A font list function that retrieves the tag of a font list entry .iX "XmFontListEntryGetTag" .iX "font list functions" "XmFontListEntryGetTag" .SH "SYNOPSIS" .PP .nf #include \fBchar* \fBXmFontListEntryGetTag\fP\fR( \fBXmFontListEntry \fBentry\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListEntryGetTag\fP retrieves a copy of the tag of the specified font list entry\&. This routine allocates memory for the tag string that must be freed by the application\&. .IP "\fIentry\fP" 10 Specifies the font list entry .SH "RETURN" .PP Returns the tag for the font list entry\&. The function allocates space to hold the returned tag\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXtFree\fP\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryGetFont\fP(3), \fBXmFontListEntryLoad\fP(3), and \fBXmFontListNextEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmGetXmDisplay.30000644000175000017500000000325412672140200014702 00000000000000'\" t ...\" GetXmD.sgm /main/8 1996/09/08 20:46:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetXmDisplay" "library call" .SH "NAME" \fBXmGetXmDisplay\fP \(em A Display function that returns the XmDisplay object ID for a specified display .iX "XmGetXmDisplay" .iX "Display functions" "XmGetXmDisplay" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetXmDisplay\fP\fR( \fBDisplay *\fBdisplay\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetXmDisplay\fP returns the \fBXmDisplay\fP object ID associated with a display\&. The application can access Display resources with \fBXtGetValues\fP\&. .IP "\fIdisplay\fP" 10 Specifies the display for which the \fBXmDisplay\fP object ID is to be returned .PP For a complete definition of Display and its associated resources, see \fBXmDisplay\fP(3)\&. .SH "RETURN" .PP Returns the \fBXmDisplay\fP object ID for the specified display\&. .SH "RELATED" .PP \fBXmDisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmListSetBottomPos.30000644000175000017500000000357012672140200015567 00000000000000'\" t ...\" LstSetBB.sgm /main/7 1996/08/30 15:46:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSetBottomPos" "library call" .SH "NAME" \fBXmListSetBottomPos\fP \(em A List function that makes a specified item the last visible item in the list .iX "XmListSetBottomPos" .iX "List functions" "XmListSetBottomPos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSetBottomPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSetBottomPos\fP makes the item at the specified position the last visible item in the List\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIposition\fP" 10 Specifies the position of the item to be made the last visible item in the list\&. A value of 1 indicates that the first item in the list is the last visible item; a value of 2 indicates that the second item is the last visible item; and so on\&. A value of 0 (zero) indicates that the last item in the list is the last visible item\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmNotebook.30000644000175000017500000007423112672140200014113 00000000000000'\" t ...\" Notebook.sgm /main/11 1996/09/08 20:54:37 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmNotebook" "library call" .SH "NAME" \fBXmNotebook\fP \(em The Notebook widget class .iX "XmNotebook" .iX "widget class" "Notebook" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Notebook is a manager widget that organizes its children into pages, tabs, status areas, and page scrollers to simulate a real notebook\&. It stacks its page children so that all page children occupy the same area like real book pages\&. Notebook displays visuals that look like the binding of a book and the edges of other pages around the page that is shown\&. Tab children simulate notebook tabs\&. Major tabs divide Notebook into several sections, and minor tabs subdivide these sections\&. Status area children provide additional information about pages such as page numbers\&. The page scroller child allows the user to move from page to page\&. Notebook also provides tab scrollers for scrolling major and minor tabs if it cannot display all tabs within its edges\&. .PP The application creates pages, tabs, status areas, and page scroller as children of the Notebook widget\&. Notebook creates tab scrollers when the Notebook is created\&. .PP The \fBXmNnotebookChildType\fP constraint resource of Notebook determines whether a child widget is a page, tab, status area, or page scroller\&. Any Motif widget can be a page of the Notebook\&. When the application creates a child of the Notebook widget without setting the child type constraint, the child becomes a page by default, unless it has the \fBXmQTactivatable\fP, \fBXmQTaccessTextual\fP, or \fBXmQTnavigator\fP trait\&. Children with the \fBXmQTactivatable\fP, \fBXmQTaccessTextual\fP, or \fBXmQTnavigator\fP trait become major tabs, status areas, and page scrollers, respectively\&. .PP Notebook uses the \fBXmQTaccessTextual\fP, \fBXmQTactivatable\fP, \fBXmQTjoinSide\fP, and \fBXmQTnavigator\fP traits, and installs the \fBXmQTscrollFrame\fP trait\&. .PP The application attaches a tab to a page by creating a tab child of the Notebook and setting the \fBXmNpageNumber\fP constraint to the page number of the targeted page\&. By the same method, a status area widget can be attached to a page\&. The page scroller child, on the other hand, is associated with the Notebook, not with a specific page\&. Therefore, there is only one valid page scroller for each Notebook\&. .SS "Pages" .PP Only one child of type \fBXmPAGE\fP is displayed at a time by Notebook\&. Other page children are hidden off-screen\&. When Notebook displays a particular page, it positions the previously-displayed page off-screen and puts the new page in its place\&. The page is resized to fit into the dimensions that Notebook has allocated to display pages\&. .SS "Page Numbers" .PP Notebook uses the \fBXmNcurrentPageNumber\fP, \fBXmNfirstPageNumber\fP, and \fBXmNlastPageNumber\fP resources to determine the current page and available page number range\&. Only those pages whose page numbers are within the range can be displayed\&. Other pages cannot be displayed until the range between \fBXmNfirstPageNumber\fP and \fBXmNlastPageNumber\fP is changed to include them or their page numbers are changed to a number within the range\&. .PP If \fBXmNfirstPageNumber\fP and \fBXmNlastPageNumber\fP are not set explicitly by the application, they are set to 1 by default; Notebook sets \fBXmNlastPageNumber\fP to the largest page number assigned by the application thereafter by default\&. However, once \fBXmNlastPageNumber\fP is set by the application, Notebook no longer changes it even when a page with a higher page number is managed\&. .PP The \fBXmNpageNumber\fP constraint resource is used for specifying the page number of a page widget\&. It can be set to any integer\&. For tab and status area children, the resource is used for linking the child widget to a page\&. For the page scroller child, the resource has no meaning and is ignored by the Notebook\&. .PP When a page without a page number is managed, Notebook assigns it the smallest unallocated page number that is not less than the first page number and greater than the last allocated page number\&. When a tab or a status area without a page number is managed, the newly managed widget is assigned the page number of the most recently managed page, unless the page already has the same type of child\&. If the page does have the same type of child, Notebook assigns the newly managed widget a page number one greater than the most recently managed page; this new page number is now occupied\&. Notebook may generate a default page number greater than \fBXmNlastPageNumber\fP, making those pages inaccessible to the user\&. .SS "Duplicate and Empty Pages" .PP Since an application can create or change page numbers, it is possible to have duplicate page numbers and empty pages\&. When two pages with the same page number are managed, only the more recently managed page can be displayed\&. Inserting a page with an existing page number does not cause a warning\&. The old page widget cannot be displayed until the new page widget is removed from the Notebook or until the page number of the old page widget is changed to some other number\&. .PP An empty page is a page slot where no page is inserted\&. Empty pages occur when a tab or status area is associated with a page number that has no matching page widget\&. Empty pages display the blank Notebook background unless the application provides visual information to this empty area while processing \fBXmNpageChangedCallback\fP\&. .SS "Notebook Visuals" .PP Notebook draws lines around two sides of the top page to simulate the edges of other pages that are behind the top page\&. The \fBXmNbackPagePlacement\fP and \fBXmNorientation\fP resources determine which two sides have the lines drawn around them\&. By default, they are drawn on the bottom and right sides of the top page\&. The application can set resources to control how many lines are drawn and how wide the area that they are drawn in is\&. Applications can also choose from three styles of binding visual that simulates the binding of a Notebook\&. Solid or spiral bindings can be drawn by Notebook, or the application can supply a pixmap that is tiled into the binding\&. .SS "Tabs" .PP A major or minor tab is a Motif widget with the \fBXmQTactivatable\fP trait\&. If a widget without the trait is created for a tab, Notebook does not provide the page activation callback\&. As a result, even though the tab is displayed, it cannot automatically move the associated page to the top\&. .PP Major tabs divide the Notebook pages into sections\&. Minor tabs subdivide these sections\&. Only minor tabs associated with the current section are displayed, where a section consists of the group of pages between the current major tab and the next major tab, including the current major tab but not including the page containing the next major tab\&. The exception to this is when there is no preceding major tab, in which case the section starts from the \fBXmNfirstPageNumber\fP value\&. A user in one major tab section does not see the minor tabs in other sections\&. However, all tabs are used in computing the size of the Notebook\&. .PP Unlike regular notebook tabs, tabs in the Notebook are not attached to a physical page (a widget)\&. They are, instead, attached to a logical page (a page number)\&. Therefore, it is possible to have a tab with an empty page\&. When a page with a tab is removed from the Notebook, the tab is not removed because it is still bound to a logical page\&. Destroying or unmanaging a page widget only erases the page and leaves an empty page\&. It does not tear the page out of the Notebook\&. To remove the tab, the application must explicitly destroy or unmanage it\&. .PP Notebook supports the \fBXmQTjoinSide\fP trait\&. A widget that has the \fBXmQTjoinSide\fP trait can be added to the Notebook as a Major or Minor tab and will appear to be attached to its associated page with no margins or shadows between them\&. .SS "Status Areas" .PP A status area is any widget that is used for describing the associated page\&. For example, the Label widget as a status area child can hold a simple string or a pixmap that describes a page\&. A status area widget is also attached to a page by the page number constraint resource\&. Therefore, it is possible to have multiple status area widgets for one page\&. Only the most recently managed status area widget for that page can be displayed\&. All others for that page are not unmanaged, but their sizes are used for computing the size of the Notebook\&. If no status area widget is provided, the Notebook displays its blank background in the status area\&'s reserved space\&. Notebook does not create any default status area widget\&. .SS "Page Scrollers" .PP The page scroller of the Notebook is any widget that the application creates for scrolling pages\&. If the application does not create one when the Notebook is realized, Notebook creates a SpinBox widget as the default page scroller\&. If the application creates a new page scroller, the default page scroller is destroyed\&. If the application creates multiple page scrollers, only the most recently managed one can be displayed and used\&. All others are unmanaged\&. .PP The default SpinBox page scroller grays out one of the arrow visuals if the current page is a boundary page\&. If the current page is the first page, the previous arrow of the SpinBox is grayed\&. If the current page is the last page, the next arrow of the SpinBox is grayed\&. .SS "Tab Scrollers" .PP Tab scrollers are created by the Notebook for scrolling major tabs and minor tabs\&. When Notebook is initialized, it creates four ArrowButtonGadgets for scrolling to the next major tab, the previous major tab, the next minor tab, and the previous minor tab\&. The application cannot replace these tab scrollers\&. The application can change all resources of these widgets except the position and the arrow direction\&. Tab scrollers are only visible and enabled when there is not enough space to display all the major or minor tabs appropriate to the page\&. Tab scrollers are also grayed out when scrolling is inappropriate\&. The following lists the tab scrollers that are created: .TS tab() box; c s s l| l| l. T{ \fBChild Widgets that XmNotebook Creates\fP T} \fBChild\fP\fBName\fP\fBWidget Class\fP ___ Page ScrollerPageScrollerXmSpinBox ___ Next Major Tab ScrollerMajorTabScrollerNextXmArrowButtonGadget ___ Previous Major Tab ScrollerMajorTabScrollerPreviousXmArrowButtonGadget ___ Next Minor Tab ScrollerMinorTabScrollerNextXmArrowButtonGadget ___ Previous Minor Tab ScrollerMinorTabScrollerPreviousXmArrowButtonGadget ___ .TE .PP When the user selects the page scroller, a major tab, or a minor tab, the value of \fBXmNcurrentPageNumber\fP is changed to the selected page number and \fBXmNpageChangedCallback\fP is invoked\&. After the application returns from the callback, the Notebook displays the last page child whose page number is equal to the current page number\&. It also displays the last matched status area child\&. All other pages and status areas are automatically hidden\&. Major tabs and minor tabs that can fit into the Notebook\&'s edges are displayed and positioned appropriately\&. All other tabs are also hidden\&. The application can also cause a page change by calling \fBXtSetValues\fP on \fBXmNcurrentPageNumber\fP and then calling \fBXtCallCallbacks\fP on \fBXmNpageChangedCallback\fP\&. .SS "Orientation" .PP The Notebook has eight different visual configurations, depending on the value of \fBXmNbackPagePlacement\fP and \fBXmNorientation\fP\&. These two resources determine the placement of back pages, the binding, major tabs, minor tabs, the status area, and the page scroller\&. The location of the binding is determined by \fBXmNorientation\fP\&. Major tabs are always placed on the back page side opposite to the binding; Minor tabs are placed on the back page display area that is visually connected to the binding\&. Both Major and Minor tabs are ordered so that the page numbers they access increase as they get closer to the corner where the back pages meet\&. The status area and the page scroller are always located on the bottom of the Notebook, inside the frame\&. The page scroller is always placed adjacent to a back page side\&. The following table shows the possible configurations and the locations of each Notebook component within the configuration\&. The default back page value and the default orientation are based upon \fBXmNlayoutDirection\fP\&. .TS tab() box; c s s s s l| l| l| l| l. \fBNotebook Configurations\fP \fBXmNbackPagePlacement\fP\fBXmNorientation\fP\fBMajor Tabs\fP\fBStatus Area\fP\fBBinding\fP _____ \fBMinor Tabs\fP\fBPage Scroller\fP _____ XmBOTTOM_RIGHTXmHORIZONTALRIGHTBOTTOM LEFTLEFT _____ BOTTOMBOTTOM RIGHT _____ XmBOTTOM_RIGHTXmVERTICALBOTTOMBOTTOM LEFTTOP _____ RIGHTBOTTOM RIGHT _____ XmBOTTOM_LEFTXmHORIZONTALLEFTBOTTOM RIGHTRIGHT _____ BOTTOMBOTTOM LEFT _____ XmBOTTOM_LEFTXmVERTICALBOTTOMBOTTOM RIGHTTOP _____ LEFTBOTTOM LEFT _____ XmTOP_RIGHTXmHORIZONTALRIGHTBOTTOM LEFTLEFT _____ TOPBOTTOM RIGHT _____ XmTOP_RIGHTXmVERTICALTOPBOTTOM LEFTBOTTOM _____ RIGHTBOTTOM RIGHT _____ XmTOP_LEFTXmHORIZONTALLEFTBOTTOM RIGHTRIGHT _____ TOPBOTTOM LEFT _____ XmTOP_LEFTXmVERTICALTOPBOTTOM RIGHTBOTTOM _____ LEFTBOTTOM LEFT _____ .TE .PP There are three tab groups for tab group traversal inside the Notebook: major tabs, minor tabs, and the page scroller\&. The application can also create additional types of tab groups within the Notebook; for example, each page added by the application is treated as a separate tab group by the traversal actions\&. .SS "Classes" .PP Notebook inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmNotebookWidgetClass\fP\&. .PP The class name is \fBXmNotebook\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmNotebook Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackPageBackgroundXmCBackPageBackgroundPixeldynamicCSG _____ XmNbackPageForegroundXmCBackPageForegroundPixeldynamicCSG _____ XmNbackPageNumberXmCBackPageNumberCardinal2CSG _____ XmNbackPagePlacementXmCBackPagePlacementunsigned chardynamicCSG _____ XmNbackPageSizeXmCBackPageSizeDimension8CSG _____ XmNbindingPixmapXmCBindingPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbindingTypeXmCBindingTypeunsigned charXmSPIRALCSG _____ XmNbindingWidthXmCBindingWidthDimension25CSG _____ XmNcurrentPageNumberXmCCurrentPageNumberintdynamicCSG _____ XmNfirstPageNumberXmCFirstPageNumberint1CSG _____ XmNframeBackgroundXmCFrameBackgroundPixeldynamicCSG _____ XmNframeShadowThicknessXmCShadowThicknessDimension0CSG _____ XmNinnerMarginHeightXmCInnerMarginHeightDimension0CSG _____ XmNinnerMarginWidthXmCInnerMarginWidthDimension0CSG _____ XmNlastPageNumberXmCLastPageNumberintdynamicCSG _____ XmNminorTabSpacingXmCMinorTabSpacingDimension3CSG _____ XmNmajorTabSpacingXmCMajorTabSpacingDimension3CSG _____ XmNorientationXmCOrientationunsigned charXmHORIZONTALCSG _____ XmNpageChangedCallbackXmCCallbackXtCallbackListNULLC _____ .TE .IP "\fBXmNbackPageBackground\fP" 10 Specifies the background color for drawing back pages\&. The default is a lower-intensity version of \fBXmNframeBackground\fP\&. .IP "\fBXmNbackPageForeground\fP" 10 Specifies the forground color for drawing back pages\&. The default is taken from the application\&'s default foreground color\&. .IP "\fBXmNbackPageNumber\fP" 10 Specifies the number of lines to draw for back pages\&. The minimum value is 1, and the maximum value is (\fBXmNbackPageSize\fP / 2)\&. .IP "\fBXmNbackPagePlacement\fP" 10 Specifies where to place the back pages\&. The default is dependent on the \fBXmNlayoutDirection\fP resource of the Notebook\&'s instance parents\&. It can have one of the following values: .RS .IP "\fBXmBOTTOM_RIGHT\fP" 10 Displays back pages on the Notebook\&'s bottom and right sides\&. .IP "\fBXmBOTTOM_LEFT\fP" 10 Displays back pages on the Notebook\&'s bottom and left sides\&. .IP "\fBXmTOP_RIGHT\fP" 10 Displays back pages on the Notebook\&'s top and right sides\&. .IP "\fBXmTOP_LEFT\fP" 10 Displays back pages on the Notebook\&'s top and left sides\&. .RE .IP "\fBXmNbackPageSize\fP" 10 Specifies the thickness of the back page rendering\&. .IP "\fBXmNbindingPixmap\fP" 10 Specifies the pixmap or bitmap for stippling or tiling the binding when \fBXmNbindingType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_OVERLAP_ONLY\fP\&. .IP "\fBXmNbindingType\fP" 10 Specifies the binding type\&. It can have one of the following values: .RS .IP "\fBXmNONE\fP" 10 Displays no binding\&. .IP "\fBXmSOLID\fP" 10 Displays a solid binding in the foreground color of the Notebook within the binding area specified by \fBXmNbindingWidth\fP\&. .IP "\fBXmSPIRAL\fP" 10 Displays a spiral binding in the foreground color of the Notebook within the area specified by \fBXmNbindingWidth\fP and within the area outside of the frame equal to the area specified by \fBXmNbindingWidth\fP\&. .IP "\fBXmPIXMAP\fP" 10 Displays the binding with the pixmap or bitmap specified by \fBXmNbindingPixmap\fP as a stipple or tile\&. It uses the foreground color of the Notebook for stippling\&. The binding width is decided by the larger value of \fBXmNbindingWidth\fP and the width of the pixmap or bitmap\&. .IP "\fBXmPIXMAP_OVERLAP_ONLY\fP" 10 Displays the binding with the pixmap or bitmap specified by \fBXmNbindingPixmap\fP as a stipple or tile\&. It uses the foreground color of the Notebook for stippling\&. The binding is displayed only within the binding area specified by \fBXmNbindingWidth\fP\&. .RE .IP "\fBXmNbindingWidth\fP" 10 Specifies the width of the Notebook binding\&. If \fBXmNbindingType\fP is \fBXmPIXMAP\fP and the width of the pixmap specified in \fBXmNbindingPixmap\fP is greater than \fBXmNbindingWidth\fP, then this resource is ignored and the width of the pixmap is used as the width of the Notebook binding instead\&. .IP "\fBXmNcurrentPageNumber\fP" 10 Specifies the page number of the currently displayed page\&. Initially, it is set to \fBXmNfirstPageNumber\fP\&. If it is set to less than \fBXmNfirstPageNumber\fP, then it is set to \fBXmNfirstPageNumber\fP\&. If it is set to \fBXmNlastPageNumber\fP, then it is set to \fBXmNlastPageNumber\fP\&. .IP "\fBXmNfirstPageNumber\fP" 10 Specifies the page number for the first page of the Notebook\&. The Notebook does not scroll to any page numbers below this value\&. .IP "\fBXmNframeBackground\fP" 10 Specifies the background color for drawing the Notebook\&'s frame\&. .IP "\fBXmNframeShadowThickness\fP" 10 Specifies the shadow thickness around the Notebook\&'s frame\&. .IP "\fBXmNinnerMarginHeight\fP" 10 Specifies the margin on the top and bottom sides of the page, status area, and page scroller widgets\&. .IP "\fBXmNinnerMarginWidth\fP" 10 Specifies the margin on the left and right sides of the page, status area, and page scroller widgets\&. .IP "\fBXmNlastPageNumber\fP" 10 Specifies the page number for the last page of the Notebook\&. The Notebook does not scroll to any page numbers above this value\&. The default page number is the largest page number of managed page, major tab, or minor tab widgets\&. If this is set to a value that is less than \fBXmNfirstPageNumber\fP, the behavior of the Notebook is undefined\&. .IP "\fBXmNmajorTabSpacing\fP" 10 Specifies the spacing distance between major tabs\&. If \fBXmNframeShadowThickness\fP is greater than \fBXmNmajorTabSpacing\fP, then this resource is ignored and the size of \fBXmNframeShadowThickness\fP is used as the spacing distance between major tabs\&. .IP "\fBXmNminorTabSpacing\fP" 10 Specifies the spacing distance between minor tabs\&. If \fBXmNframeShadowThickness\fP is greater than \fBXmNminorTabSpacing\fP, then this resource is ignored and the size of \fBXmNframeShadowThickness\fP is used as the spacing distance between minor tabs\&. .IP "\fBXmNorientation\fP" 10 Specifies the orientation of the Notebook\&. It can have one of the following values: .RS .IP "\fBXmHORIZONTAL\fP" 10 Places the binding beside the pages, in the left or right side of the frame\&. .IP "\fBXmVERTICAL\fP" 10 Places the binding above or below the pages, in the top or the bottom of the frame\&. .RE .IP "\fBXmNpageChangedCallback\fP" 10 Specifies the list of callbacks to call whenever the \fBXmNcurrentPageNumber\fP, representing the current page number, is changed\&. This includes the point when the widget is realized and the page number is initialized\&. The callback structure is \fBXmNotebookCallbackStruct\fR\&. The reason is \fBXmCR_MAJOR_TAB\fP, \fBXmCR_MINOR_TAB\fP, \fBXmCR_PAGE_SCROLLER_INCREMENT\fP, \fBXmCR_PAGE_SCROLLER_DECREMENT\fP, or \fBXmCR_NONE\fP, depending upon what action caused the Notebook to display a new page\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmNotebook Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNnotebookChildTypeXmCNotebookChildTypeunsigned chardynamicCG _____ XmNpageNumberXmCPageNumberintdynamicCSG _____ XmNresizableXmCResizableBooleanTrueCSG _____ .TE .IP "\fBXmNnotebookChildType\fP" 10 Specifies the child type of the Notebook\&. It can be one of the following types: .RS .IP "\fBXmPAGE\fP" 10 The child is a page of the Notebook\&. This is the default when the child does not have the \fBXmQTactivatable\fP, \fBXmQTaccessTextual\fP, or \fBXmQTnavigator\fP trait\&. .IP "\fBXmMAJOR_TAB\fP" 10 The child is a major tab\&. This is the default when the child has the \fBXmQTactivatable\fP trait\&. .IP "\fBXmMINOR_TAB\fP" 10 The child is a minor tab\&. .IP "\fBXmSTATUS_AREA\fP" 10 The child is a status area\&. This is the default when the child has the \fBXmQTaccessTextual\fP trait and does not have the \fBXmQTactivatable\fP trait\&. .IP "\fBXmPAGE_SCROLLER\fP" 10 The child is the page scroller\&. The default page scroller is destroyed, if it exists\&. Any previously created page scrollers are unmanaged\&. This is the default when the child has the \fBXmQTnavigator\fP trait and does have the \fBXmQTactivatable\fP trait or the \fBXmQTaccessTextual\fP trait\&. .RE .IP "\fBXmNpageNumber\fP" 10 Specifies the page number associated with the widget\&. If the widget is a page, the number specifies the page number of the widget\&. If the widget is not a page, the number specifies the page number of the associated page\&. If none is supplied by the application, Notebook generates the smallest unallocated page number when the child is managed\&. This resource is ignored for the page scroller\&. .IP "\fBXmNresizable\fP" 10 Specifies whether this child can request a resize\&. .SS "Inherited Resources" .PP Notebook inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback" .PP A pointer to the following structure is passed to callbacks for \fBXmNpageChangedCallback\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent \fI*event\fP; int \fIpage_number\fP; Widget \fIpage_widget\fP; int \fIprev_page_number\fP; Widget \fIprev_page_widget\fP; } XmNotebookCallbackStruct; .fi .IP "\fIreason\fP" 10 Specifies the reason for the callback\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIpage_number\fP" 10 Indicates the page number to be displayed\&. .IP "\fIpage_widget\fP" 10 Indicates the page widget that has the new page number\&. It is NULL if no page widget with the page number is found\&. .IP "\fIprev_page_number\fP" 10 Indicates the page number of the currently displayed page\&. If the callback procedure is being called at widget initialization, this page number will be returned as \fBXmUNSPECIFIED_PAGE_NUMBER\fP\&. .IP "\fIprev_page_widget\fP" 10 Indicates the currently displayed page widget\&. If the callback procedure is being called at widget initialization, NULL will be returned\&. .SS "Translations" .PP Notebook inherits translations from Manager\&. .SS "Accelerators" .PP Notebook accelerators are added to all major tab and minor tab children of XmNotebook\&. Notebook accelerators are listed below\&. These accelerators might not directly correspond to a translation table\&. .IP "\fB\fP\fB:\fP" 10 TraverseTab(\fBHome\fP) .IP "\fB\fP\fB:\fP" 10 TraverseTab(\fBEnd\fP) .IP "\fB\fP\fB:\fP" 10 TraverseTab(\fBPrevious\fP) .IP "\fB\fP\fB:\fP" 10 TraverseTab(\fBNext\fP) .IP "\fB\fP\fB:\fP" 10 TraverseTab(\fBPrevious\fP) .IP "\fB\fP\fB:\fP" 10 TraverseTab(\fBNext\fP) .SS "Action Routines" .PP Notebook action routines are described below: .IP "TraverseTab(\fBHome|End|Next|Previous\fP)" 10 Moves the focus on major or minor tabs\&. .SS "Additional Behavior" .PP The Notebook widget has the additional behavior described below: .IP "\fB\fP" 10 Notebook intercepts tab group traversal when traversal is entering or leaving major or minor tabs\&. It does this to support major tabs and minor tabs as two separate tab groups when they are actually treated as one by traversal\&. If a minor tab has keyboard focus and a user or program action specifies \fBXmTRAVERSE_PREV_TAB_GROUP\fP, keyboard focus will go to a major tab\&. If a major tab has keyboard focus and a user or program action specifies \fBXmTRAVERSE_NEXT_TAB_GROUP\fP, keyboard focus will go to a minor tab\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateNotebook\fP(3), \fBXmManager\fP(3), \fBXmNotebookGetPageInfo\fP(3), \fBXmVaCreateNotebook\fP(3), and \fBXmVaCreateManagedNotebook\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateCascadeButtonGadget.30000644000175000017500000000373512672140200017313 00000000000000'\" t ...\" CreCaB.sgm /main/8 1996/09/08 20:32:30 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateCascadeButtonGadget" "library call" .SH "NAME" \fBXmCreateCascadeButtonGadget\fP \(em The CascadeButtonGadget creation function .iX "XmCreateCascadeButton\\%Gadget" .iX "creation functions" "XmCreateCascadeButton\\%Gadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateCascadeButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateCascadeButtonGadget\fP creates an instance of a CascadeButtonGadget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. The parent must be a RowColumn widget\&. .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of CascadeButtonGadget and its associated resources, see \fBXmCascadeButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the CascadeButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmCascadeButtonGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmRepTypeAddReverse.30000644000175000017500000000465312672140200015671 00000000000000'\" t ...\" RepTypAd.sgm /main/8 1996/09/08 20:58:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeAddReverse" "library call" .SH "NAME" \fBXmRepTypeAddReverse\fP \(em A representation type manager function that installs the reverse converter for a previously registered representation type .iX "XmRepTypeAddReverse" .iX "representation type manager functions" "XmRepTypeAddReverse" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmRepTypeAddReverse\fP\fR( \fBXmRepTypeId \fBrep_type_id\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRepTypeAddReverse\fP installs the reverse converter for a previously registered representation type\&. The reverse converter takes a numerical representation type value and returns its corresponding string value\&. Certain applications may require this capability to obtain a string value to display on a screen or to build a resource file\&. .PP The \fIvalues\fP argument of the \fBXmRepTypeRegister\fP function can be used to register representation types with nonconsecutive values or with duplicate names for the same value\&. If the list of numerical values for a representation type contains duplicate values, the reverse converter uses the first name in the \fIvalue_names\fP list that matches the specified numeric value\&. For example, if a \fIvalue_names\fP array has \fIcancel\fP, \fIproceed\fP, and \fIabort\fP, and the corresponding \fIvalues\fP array contains 0, 1, and 0, the reverse converter will return \fIcancel\fP instead of \fIabort\fP for an input value of 0\&. .IP "\fIrep_type_id\fP" 10 Specifies the identification number of the representation type .SH "RELATED" .PP \fBXmRepTypeGetId\fP(3) and \fBXmRepTypeRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmListDeselectPos.30000644000175000017500000000350312672140200015373 00000000000000'\" t ...\" LstDeseC.sgm /main/7 1996/08/30 15:41:43 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeselectPos" "library call" .SH "NAME" \fBXmListDeselectPos\fP \(em A List function that deselects an item at a specified position in the list .iX "XmListDeselectPos" .iX "List functions" "XmListDeselectPos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeselectPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeselectPos\fP unhighlights the item at the specified position and deletes it from the list of selected items\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIposition\fP" 10 Specifies the position of the item to be deselected\&. A value of 1 indicates that the first item in the list is deselected; a value of 2 indicates that the second item is deselected; and so on\&. A value of 0 (zero) indicates that the last item in the list is deselected\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmStringLength.30000644000175000017500000000336212672140200014740 00000000000000'\" t ...\" StrLen.sgm /main/8 1996/09/08 21:06:04 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringLength" "library call" .SH "NAME" \fBXmStringLength\fP \(em A compound string function that obtains the length of a compound string .iX "XmStringLength" .iX "compound string functions" "XmStringLength" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmStringLength\fP\fR( \fBXmString \fBs1\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmStringByteStreamLength\fP\&. \fBXmStringLength\fP obtains the length of a compound string\&. It returns the number of bytes in \fIs1\fP including all tags, direction indicators, and separators\&. If the compound string has an invalid structure, 0 (zero) is returned\&. .IP "\fIs1\fP" 10 Specifies the compound string .SH "RETURN" .PP Returns the length of the compound string\&. .SH "RELATED" .PP \fBXmStringByteStreamLength\fP(3) and \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmVaCreateManagedLabelGadget.30000644000175000017500000000004112672140200017342 00000000000000.so man3/XmVaCreateLabelGadget.3 motif-2.3.8/doc/man/man3/XmVaCreateTabStack.30000644000175000017500000000270412672140200015436 00000000000000.DT .TH "XmVaCreateTabStack" "library call" .SH "NAME" \fBXmVaCreateTabStack\fP, \fBXmVaCreateManagedTabStack\fP \(em A TabStack widget convenience creation functions\&. .iX "XmVaCreateToggleTabStack" "XmVaCreateManagedTabStack" .iX "creation functions" "XmVaCreateTabStack" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateTabStack\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedTabStack\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateTabStack\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateTabStack\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of TabStack and its associated resources, see \fBXmTabStack\fP(3)\&. .SH "RETURN" .PP Returns the TabStack widget ID\&. .SH "RELATED" .PP \fBXmTabStack\fP(3), \fBXmCreateTabStack\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmScrollBarGetValues.30000644000175000017500000000510312672140200016026 00000000000000'\" t ...\" ScrollBB.sgm /main/8 1996/09/08 21:00:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScrollBarGetValues" "library call" .SH "NAME" \fBXmScrollBarGetValues\fP \(em A ScrollBar function that returns the ScrollBar\&'s increment values .iX "XmScrollBarGetValues" .iX "ScrollBar functions" "XmScrollBarGetValues" .SH "SYNOPSIS" .PP .nf #include void XmScrollBarGetValues (\fIwidget, value_return, slider_size_return, increment_return, page_increment_return\fP) Widget \fIwidget\fP; int \fI* value_return\fP; int \fI* slider_size_return\fP; int \fI* increment_return\fP; int \fI* page_increment_return\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmScrollBarGetValues\fP returns the the ScrollBar\&'s increment values\&. The scroll region is overlaid with a slider bar that is adjusted in size and position using the main ScrollBar or set slider function attributes\&. .IP "\fIwidget\fP" 10 Specifies the ScrollBar widget ID\&. .IP "\fIvalue_return\fP" 10 Returns the ScrollBar\&'s slider position between the \fBXmNminimum\fP and \fBXmNmaximum\fP resources\&. Specify NULL to prevent the return of a particular value\&. .IP "\fIslider_size_return\fP" 10 Returns the size of the slider as a value between 0 (zero) and the absolute value of \fBXmNmaximum\fP minus \fBXmNminimum\fP\&. The size of the slider varies, depending on how much of the slider scroll area it represents\&. .IP "\fIincrement_return\fP" 10 Returns the amount of increment and decrement\&. .IP "\fIpage_increment_return\fP" 10 Returns the amount of page increment and decrement\&. .PP For a complete definition of ScrollBar and its associated resources, see \fBXmScrollBar\fP(3)\&. .SH "RETURN" .PP Returns the ScrollBar\&'s increment values\&. .SH "RELATED" .PP \fBXmScrollBar\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmPrintShell.30000644000175000017500000002451312672140200014415 00000000000000'\" t ...\" PrtShell.sgm /main/12 1996/10/25 10:33:08 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPrintShell" "library call" .SH "NAME" \fBXmPrintShell\fR \(em a shell widget class used for printing in Motif .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmIsPrintShell\fP\fR( \fBWidget\fR); .fi .SH "DESCRIPTION" .PP The \fBXmPrintShell\fP provides the Motif application programmer with an Xt widget oriented API to some of the X Print resources and a callback to drive the pagination\&. .PP The \fBXmPrintShell\fP provides a simple callback to handle the pagination logic, and a set of resources to get and set common printer attributes\&. .PP If not created on an \fBXPrint\fP connection, \fBXmPrintShell\fP behaves as a regular applicationShell\&. .PP The \fBXmPrintShell\fP also initializes the \fBXp\fP extension event handling mechanism, by registering an extension selector that calls \fBXpSelectInput\fP and event dispatcher for print and attributes \fBXp\fP events, so applications can use \fBXtInsertEventTypeHandler\fP to register their own handler with the \fBXp\fP events\&. .SS "Arguments" .PP No \fBXmCreate\fP function is provided, since this is a toplevel shell, most likely created thru some \fBXt\fP shell creation routine or \fBXmPrintSetup\fP\&. .SS "Classes" .PP \fBXmPrintShell\fP is a subclass of \fBApplicationShell\fP; it inherits behavior, resources and traits from all its superclasses\&. The class pointer is \fBXmPrintShellWidgetClass\fP\&. .SS "New Resources" .TS tab(); cw(1.3) sw(1.3) sw(1.3) sw(1.0) sw(0.5) lw(1.3) lw(1.3) lw(1.3) lw(1.0) lw(0.5). \fBXmPrintShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP \fBXmNstartJobCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fP\fBNULL\fP\fBCSG\fP \fBXmNendJobCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fP\fBNULL\fP\fBCSG\fP \fBXmNpageSetupCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fP\fBNULL\fP\fBCSG\fP \fBXmNminX\fP\fBXmCMinX\fP\fBDimension\fP\fBdynamic\fP\fBG\fP \fBXmNminY\fP\fBXmCMinY\fP\fBDimension\fP\fBdynamic\fP\fBG\fP \fBXmNmaxX\fP\fBXmCMaxX\fP\fBDimension\fP\fBdynamic\fP\fBG\fP \fBXmNmaxY\fP\fBXmCMaxY\fP\fBDimension\fP\fBdynamic\fP\fBG\fP \fBXmNdefaultPixmapResolution\fP\fBXmCDefaultPixmapResolution\fP\fBunsigned short\fR\fB100\fP\fBCSG\fP \fBXmNpdmNotificationCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fP\fBNULL\fP\fBCSG\fP .TE .IP "\fIXmNstartJobCallback\fP" 10 Specifies the callback driving the beginning of rendering\&. It is safe for an application to start rendering after this callback has been activated\&. \fBXpStartJob\fP must be called to trigger this callback\&. .IP "\fIXmNendJobCallback\fP" 10 Specifies the callback driving the end of rendering\&. Notify the client that all rendering has been processed (whether on print-to-file or regular spool)\&. \fBXpEndJob\fP is called by the print shell to trigger this callback\&. .IP "\fIXmNpageSetupCallback\fP" 10 Specifies the callback driving the page layout\&. It is safe for an app to start rendering from this callback even if the \fBXmNstartJobCallback\fP is not used\&. .IP "\fIXmNminX, XmNminY, XmNmaxX, XmNmaxY\fP" 10 Specify the imageable area of the page in the current print context\&. \fBXmPrintShell\fP also maintains a proper size at all times by updating its own widget dimension whenever an attribute, such as resolution or orientation, changes\&. It is sized in its \fBInitialize\fP routine so that the application can rely on a proper size before the first \fBStartPage\fP call is issued\&. .IP "\fIXmNdefaultPixmapResolution\fP" 10 Indicates the resolution in dpi (dot per inch) of the image files read and converted by Motif for the widget descendants of this shell\&. It is used to determine a scaling ratio to be applied to pixmap created thru regular pixmap/icon conversion of the following Widget resources: .RS .IP " \(bu" 6 \fBXmLabel\fP\&.label*Pixmap, \fBXmIconG\fP\&.*IconPixmap \fBXmToggleB\fP\&.selectPixmap, \fBXmPushBG\fP\&.armPixmap, \fBXmIconG\fP\&.*IconMask, \fBXmMessageBox\fP\&.symbolPixmap, \fBXmContainer\fP\&.*StatePixmap, \&.\&.\&. .IP " \(bu" 6 Leaving out the pixmap resources being used for tiling (XmNhighlightPixmap, XmNtopShadowPixmap, XmNbottomShadowPixmap, XmNbackgroundPixmap, \&.\&.\&.) .RE .IP "\fIXmNpdmNotificationCallback\fP" 10 A callback notifying the application about the status of the PDM (see XmPrintPopupPDM)\&. A XmPrintShellCallbackStruct is used, with reason: .RS .IP " \(bu" 6 \fBXmCR_PDM_NONE\fP: no PDM available on this display for the named selection (provided in detail) .IP " \(bu" 6 \fBXmCR_PDM_START_VXAUTH\fP : the PDM is not authorized to connect to the video display\&. .IP " \(bu" 6 \fBXmCR_PDM_START_PXAUTH\fP : the PDM is not authorized to connect to the print display\&. .IP " \(bu" 6 \fBXmCR_PDM_UP\fP : the PDM is up and running .IP " \(bu" 6 \fBXmCR_PDM_OK\fP : the PDM has exited with OK status .IP " \(bu" 6 \fBXmCR_PDM_CANCEL\fP : the PDM has exited with CANCEL .IP " \(bu" 6 \fBXmCR_PDM_START_ERROR\fP : the PDM cannot start due to some error (usually logged) .IP " \(bu" 6 \fBXmCR_PDM_EXIT_ERROR\fP : the PDM has exited with an error .RE .SS "Callback Information" .PP The \fBXmNstartJobCallback\fP, \fBXmNendJobCallback,\fP \fBXmNpageSetupCallback\fP and \fBXmNpdmNotificationCallback\fP operate on a \fBXmPrintShellCallbackStruct\fP, which is defined as follow: .PP .nf \f(CWtypedef struct { int reason; /* XmCR_START_JOB, XmCR_END_JOB, XmCR_PAGE_SETUP, XmCR_PDM_* */ XEvent *event; XPContext print_context; Boolean last_page; /* in_out */ XtPointer detail; } XmPrintShellCallbackStruct;\fR .fi .PP .SS "Additional Behavior" .PP The \fBlast_page\fP field is only meaningful when the reason is \fBXmCR_PAGE_SETUP\fP\&. .PP The page setup callback is called with \fBlast_page\fP \fBFalse\fP to notify the application that it has to get its internal layout state ready for the next page\&. Typically, a widget based application will change the content of a \fBLabel\fP showing the page number, or scroll the content of the \fBText\fP widget\&. .PP When the application has processed its last page, it should set the \fBlast_page\fP field in the callback struct to \fBTrue\fP\&. The callback will be called a last time after that with \fBlast_page\fP \fBFalse\fP to notify the application that it can safely clean-up its internal state (e\&.g\&., destroy widgets)\&. .PP No drawing should occur from within the callback function in the application, this is an Exposure event-driven programming model where widgets render themselves from their expose methods\&. .PP The print shell calls \fBXpStartPage\fP after the \fBpageSetupCallback\fP returns, and \fBXpEndPage\fP upon reception of \fBStartPageNotify\fP\&. .SH "ERRORS/WARNINGS" .PP \fBXmPrintShell\fP can generate the following warnings: .IP " \(bu" 6 \fBNot connected to a valid X Print Server: behavior undefined\&.\fP .IP " \(bu" 6 \fBAttempt to set an invalid resolution on a printer: %s\fP .IP " \(bu" 6 \fBAttempt to set an invalid orientation on a printer: %s\fP .SH "RETURN VALUE" .PP Not applicable .SH "EXAMPLES" .PP .nf \f(CWPrintOnePageCB(Widget pshell, XtPointer npages, /*----------*/ XmPrintSetPageCBStruct psp) { static int cur_page = 0; cur_page++; if (! psp->last_page && curPage > 1) /* no need to scroll for the first page */ { XmTextScroll(ptext, prows); /* get ready for next page */ } else { /**** I\&'m done */ XtDestroyWidget(pshell); XtCloseDisplay(XtDisplay(pshell)); } if (cur_page == (int) n_pages) psp->last_page = True; } PrintOKCallback(\&.\&.\&.) /*-------------*/ { pshell = XmPrintSetup (widget, pbs->print_screen, "Print", NULL, 0); XpStartJob(XtDisplay(pshell), XPSpool); /**** here I get the size of the shell, create my widget hierarchy: a bulleting board, and then a text widget, that I stuff with the video text widget buffer */ /* get the total number of pages to print */ /* same code as previous example to get n_pages */ /**** set up my print callback */ XtAddCallback(pshell, XmNpageSetUpCallback, PrintOnePageCB, n_pages); }\fR .fi .PP .PP Examples of \fBXmNdefaultPixmapResolution\fP usage: .IP " \(bu" 6 An application reuses the same image sources it uses for the video interface, in XBM, XPM, PNG ot JPEG, to layout on its printed pages\&. In this case, scaling is seamless\&. .PP .nf \f(CW ! icon\&.xpm is 30x30 pixels app*dialog\&.pushb\&.labelPixmap:icon\&.xpm ! print is 400dpi app\&.print*form\&.lab\&.labelPixmap:icon\&.xpm ! 120x120 pixels on the paper (auto scaling)\fR .fi .PP .IP " \(bu" 6 An application provides a new set of image files, for a given printer resolution (say 300)\&. It doesn\&'t want automatic scaling by the toolkit for that resolution, it wants scaling based on these 300dpi images for higher resolution\&. It creates its print shell inside using the name "printHiRes" and adds the following in its resource file: .PP .nf \f(CW app\&.printHiRes\&.defaultPixmapResolution:300 ! icon300\&.xpm is 120x120 pixels app\&.printHiRes*form\&.lab\&.labelPixmap:icon300\&.xpm ! 120x120 pixels on the paper (no scaling)\fR .fi .PP .PP This way a printer resolution of 600 will result in a scale of a 300 dpi image by 2 (dpi=600 divided by base=300), while a printer resolution of 150 (using default print shell name "print") will use the 100 dpi icon scaled by 1\&.5 (dpi=150 divided by default base=100)\&. .SH "SEE ALSO" .PP \fBXmPrintSetup\fP(3), \fBXmRedisplayWidget\fP(3), \fBXmPrintToFile\fP(3), \fBXmPrintPopupPDM\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmStringEmpty.30000644000175000017500000000332312672140200014612 00000000000000'\" t ...\" StrEmp.sgm /main/8 1996/09/08 21:04:43 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringEmpty" "library call" .SH "NAME" \fBXmStringEmpty\fP \(em A compound string function that provides information on the existence of non-zero-length text components .iX "XmStringEmpty" .iX "compound string functions" "XmStringEmpty" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringEmpty\fP\fR( \fBXmString \fBs1\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringEmpty\fP returns a Boolean value indicating whether any non-zero-length text components exist in the provided compound string\&. It returns True if there are no text segments in the string\&. If this routine is passed NULL as the string, it returns True\&. .IP "\fIs1\fP" 10 Specifies the compound string .SH "RETURN" .PP Returns True if there are no text segments in the string\&. If this routine is passed NULL as the string, it returns True\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmCreateBulletinBoard.30000644000175000017500000000356112672140200016203 00000000000000'\" t ...\" CreBuA.sgm /main/7 1996/08/30 14:27:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateBulletinBoard" "library call" .SH "NAME" \fBXmCreateBulletinBoard\fP \(em The BulletinBoard widget creation function .iX "XmCreateBulletinBoard" .iX "creation functions" "XmCreateBulletinBoard" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateBulletinBoard\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateBulletinBoard\fP creates an instance of a BulletinBoard widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of BulletinBoard and its associated resources, see \fBXmBulletinBoard\fP(3)\&. .SH "RETURN" .PP Returns the BulletinBoard widget ID\&. .SH "RELATED" .PP \fBXmBulletinBoard\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmTabStackGetSelectedTab.30000644000175000017500000000257712672140200016573 00000000000000'\" t .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabStackGetSelectedTab" "library call" .SH "NAME" \fBXmTabStackGetSelectedTab\fP \(em A TabStack function that returns the widget ID of the currently selectedtab .iX "XmTabStackGetSelectedTab" .iX "TabStack functions" "XmTabStackGetSelectedTab" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmTabStackGetSelectedTab\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabStackGetSelectedTab\fP returns the widget ID of the currently selected tab\&. .IP "\fIwidget\fP" 10 Specifies the TabStack widget ID .SH "RETURN" .PP Returns the widget ID of the currently selected tab\&. .SH "RELATED" .PP \fBXmTabStack\fP(3)\&. motif-2.3.8/doc/man/man3/XmRenditionUpdate.30000644000175000017500000000301712672140200015423 00000000000000'\" t ...\" RendE.sgm /main/7 1996/08/30 15:57:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenditionUpdate" "library call" .SH "NAME" \fBXmRenditionUpdate\fP \(em A convenience function that modifies resources .iX "XmRenditionUpdate" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmRenditionUpdate\fP\fR( \fBXmRendition \fBrendition\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenditionUpdate\fP modifies resources in the specified rendition\&. .IP "\fIrendition\fP" 10 Specifies the rendition\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .SH "RELATED" .PP \fBXmRendition\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmSeparatorGadget.30000644000175000017500000001763412672140200015413 00000000000000'\" t ...\" SeparB.sgm /main/9 1996/09/08 21:01:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSeparatorGadget" "library call" .SH "NAME" \fBXmSeparatorGadget\fP \(em The SeparatorGadget widget class .iX "XmSeparatorGadget" .iX "widget class" "SeparatorGadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP SeparatorGadget separates items in a display\&. Several line drawing styles are provided, as well as horizontal or vertical orientation\&. .PP Lines drawn within the SeparatorGadget are automatically centered within the height of the gadget for a horizontal orientation and centered within the width of the gadget for a vertical orientation\&. An \fBXtSetValues\fP with a new \fBXmNseparatorType\fP resizes the widget to its minimal height (for horizontal orientation) or its minimal width (for vertical orientation) unless height or width is explicitly set in the \fBXtSetValues\fP call\&. .PP SeparatorGadget does not draw shadows around the separator\&. The Gadget resource \fBXmNshadowThickness\fP is used for the SeparatorGadget\&'s thickness when \fBXmNseparatorType\fP is \fBXmSHADOW_ETCHED_IN\fP, \fBXmSHADOW_ETCHED_IN_DASH\fP, \fBXmSHADOW_ETCHED_OUT\fP, or \fBXmSHADOW_ETCHED_OUT_DASH\fP\&. .PP SeparatorGadget does not highlight and allows no traversing\&. The Gadget resource \fBXmNtraversalOn\fP is forced to False\&. SeparatorGadget holds the \fBXmQTmenuSavvy\fP trait\&. .SS "Classes" .PP SeparatorGadget inherits behavior, resources, and traits from \fBObject\fP, \fBRectObj\fP, and \fBXmGadget\fP\&. .PP The class pointer is \fBxmSeparatorGadgetClass\fP\&. .PP The class name is \fBXmSeparatorGadget\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmSeparatorGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNmarginXmCMarginDimension0CSG _____ XmNorientationXmCOrientationunsigned charXmHORIZONTALCSG _____ XmNseparatorTypeXmCSeparatorTypeunsigned charXmSHADOW_ETCHED_INCSG _____ .TE .IP "\fBXmNmargin\fP" 10 For horizontal orientation, specifies the space on the left and right sides between the border of SeparatorGadget and the line drawn\&. For vertical orientation, specifies the space on the top and bottom between the border of SeparatorGadget and the line drawn\&. .IP "\fBXmNorientation\fP" 10 Specifies whether SeparatorGadget is displayed vertically or horizontally\&. This resource can have values of \fBXmVERTICAL\fP and \fBXmHORIZONTAL\fP\&. .IP "\fBXmNseparatorType\fP" 10 Specifies the type of line drawing to be done in the Separator widget\&. .RS .IP "\fBXmSINGLE_LINE\fP" 10 Single line\&. .IP "\fBXmDOUBLE_LINE\fP" 10 Double line\&. .IP "\fBXmSINGLE_DASHED_LINE\fP" 10 Single-dashed line\&. .IP "\fBXmDOUBLE_DASHED_LINE\fP" 10 Double-dashed line\&. .IP "\fBXmNO_LINE\fP" 10 No line\&. .IP "\fBXmSHADOW_ETCHED_IN\fP" 10 A line whose shadows give the effect of a line etched into the window\&. The thickness of the line is equal to the value of \fBXmNshadowThickness\fP\&. For horizontal orientation, the top shadow is drawn in \fBXmNtopShadowColor\fP and the bottom shadow is drawn in \fBXmNbottomShadowColor\fP\&. For vertical orientation, the left edge is drawn in \fBXmNtopShadowColor\fP and the right edge is drawn in \fBXmNbottomShadowColor\fP\&. .IP "\fBXmSHADOW_ETCHED_OUT\fP" 10 A line whose shadows give the effect of an etched line coming out of the window\&. The thickness of the line is equal to the value of \fBXmNshadowThickness\fP\&. For horizontal orientation, the top shadow is drawn in \fBXmNbottomShadowColor\fP and the bottom shadow is drawn in \fBXmNtopShadowColor\fP\&. For vertical orientation, the left edge is drawn in \fBXmNbottomShadowColor\fP and the right edge is drawn in \fBXmNtopShadowColor\fP\&. .IP "\fBXmSHADOW_ETCHED_IN_DASH\fP" 10 Identical to \fBXmSHADOW_ETCHED_IN\fP except a series of lines creates a dashed line\&. .IP "\fBXmSHADOW_ETCHED_OUT_DASH\fP" 10 Identical to \fBXmSHADOW_ETCHED_OUT\fP except a series of lines creates a dashed line\&. .RE .SS "Inherited Resources" .PP SeparatorGadget inherits behavior and resources from the superclasses in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension0CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanFalseG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Behavior" .PP \fBXmSeparatorGadget\fP has no behavior\&. .SH "RELATED" .PP \fBObject\fP(3), \fBRectObj\fP(3), \fBXmCreateSeparatorGadget\fP(3), \fBXmGadget\fP(3), \fBXmVaCreateSeparatorGadget\fP(3), and \fBXmVaCreateManagedSeparatorGadget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCascadeButtonGadgetHighlight.30000644000175000017500000000354312672140200020014 00000000000000'\" t ...\" CascBC.sgm /main/7 1996/08/30 14:05:37 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCascadeButtonGadgetHighlight" "library call" .SH "NAME" \fBXmCascadeButtonGadgetHighlight\fP \(em A CascadeButtonGadget function that sets the highlight state .iX "XmCascadeButtonGadget\\%Highlight" .iX "CascadeButtonGadget functions" "XmCascadeButtonGadget\\%Highlight" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmCascadeButtonGadgetHighlight\fP\fR( \fBWidget \fBcascadeButtonGadget\fR\fR, \fBBoolean \fBhighlight\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCascadeButtonGadgetHighlight\fP either draws or erases the shadow highlight around the CascadeButtonGadget\&. .IP "\fIcascadeButtonGadget\fP" 10 Specifies the CascadeButtonGadget to be highlighted or unhighlighted .IP "\fIhighlight\fP" 10 Specifies whether to highlight (True) or to unhighlight (False) .PP For a complete definition of CascadeButtonGadget and its associated resources, see \fBXmCascadeButtonGadget\fP(3)\&. .SH "RELATED" .PP \fBXmCascadeButton\fP(3), \fBXmCascadeButtonGadget\fP(3), and \fBXmCascadeButtonHighlight\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmOutline.30000644000175000017500000002014312672140200013743 00000000000000.TH "XmOutline" "library call" .SH "NAME" \fBXmOutline\fP \(em The Outline widget class .iX "XmOutline" .iX "widget class" "Outline" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The Outline widget is a container that shows the relationship of its children in a graphical tree-like format. Each child of the Outline widget is a node in the Outline. The parent-child relationships between these nodes are completely distinct from the widget hierarchy. The hierarchy of nodes is created by specifying the tree "parent" of each node as a constraint resource. If a node's parent is NULL then it is assumed to be a root of the tree. Although each widget can only have one parent, the Outline widget supports adding more than one "root" node to a single Outline. .PP Note: The Outline widget assumes that it will be totally responsible for mapping and unmapping its children. Therefore no child of this widget should ever modify its mappedWhenManaged resource. If a child does modify this resource the behavior is undefined. .PP .SS "User Interaction" .PP Each node in the outline can have one of four states: open, closed, always open, and hidden. The state of a node changes how it appears to the user and what actions are available to the user. .PP .ta 15 .HP 15 Open This node will have an open folder shown to its left that may be selected by the user to close this node. When a node is open all of its children will be visible to the user. .ta 15 .HP 15 Closed This node will have a closed folder shown to its left that may be selected by the user to open this node. When a node is closed none of its children will be visible to the user. .ta 15 .HP 15 Always Open This node will have no folder button associated with it. All of its children will be visible to the user. .ta 15 .HP 15 Hidden This node will not be shown to the user and all of its children will appear and act exactly as if they were children of this node's parent. It will appear to the user as if this node does not exist. .PP To maintain consistency of the user interface we have found that it is best to use the node state "Always Open" for nodes with no children. This way the user will only see a folder button next to a node that has children to display. A folder button associated with a node that has no children has no defined semantics. .SS "Classes" Outline inherits behavior and resources from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP, and \fBXmHierarchy\fP classes\&. .PP The class pointer is \fBxmOutlineWidgetClass\fP\&. .PP The class name is \fBXmOutline\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmOutline Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNconnectNodesBooleanBooleanFalseCSG _____ XmNindentSpaceDimensionDimension30CSG _____ .TE .IP "\fBXmNconnectNodes\fP" 10 Specifies whether to draw lines connecting a parent to each of its children nodes. .IP "\fBXmNindentSpace\fP" 10 This resource controls how many pixels divide the outline's levels .SS "Inherited Resources" .PP Outline inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmHierarchy Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNautoCloseXmCAutoCloseBooleanTrueCSG _____ XmNcloseFolderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNhorizontalMarginXmCDimensionDimension2CSG _____ XmNnodeStateCallbackXmCNodeStateCallbackXtCallbackListNULLC _____ XmNopenFolderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNrefigureModeXmCBooleanBooleanTrueCSG _____ XmNverticalMarginXmCDimensionDimension2CSG _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .SS "Geometry Management" .PP The preferred size of the entire outline will be just large enough to contain all nodes in the hierarchy. As the node state changes the outline will attempt to resize itself to just contain its currently visible children. If the outline is forced away from its desired size the children will not be moved and will either be clipped, or appear in the upper left hand corner of the window. For this reason it is usually desirable to put the outline into a Scrolled Window widget. .PP .SH RELATED .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateHierarchy\fP(3), \fBXmHierarchy\fP(3), \fBXmManager\fP(3)\&. motif-2.3.8/doc/man/man3/XmTabListTabCount.30000644000175000017500000000257712672140200015341 00000000000000'\" t ...\" TabLstTa.sgm /main/7 1996/08/30 16:17:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabListTabCount" "library call" .SH "NAME" \fBXmTabListTabCount\fP \(em A convenience function that counts the number of tabs .iX "XmTabListTabCount" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBXmTabListTabCount\fP\fR( \fBXmTabList \fBtablist\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabListTabCount\fP counts the number of tabs in the specified \fItablist\fP\&. .IP "\fItablist\fP" 10 Specifies the tab list\&. .SH "RETURN" .PP Returns the number of tabs in \fItablist\fP\&. .SH "RELATED" .PP \fBXmTabList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmSimpleSpinBoxSetItem.30000644000175000017500000000353712672140200016363 00000000000000'\" t ...\" SpinBoxS.sgm /main/6 1996/09/06 09:24:42 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSimpleSpinBoxSetItem" "library call" .SH "NAME" \fBXmSimpleSpinBoxSetItem\fP \(em set an item in the XmSimpleSpinBox list .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmSimpleSpinBoxSetItem\fP\fR( \fBWidget \fBw\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmSimpleSpinBoxSetItem\fP function selects an item in the list of the given XmSimpleSpinBox widget and makes it the current value\&. .PP The \fIw\fP argument specifies the widget ID\&. .PP The \fIitem\fP argument specifies the \fBXmString\fR for the item to be set in the XmSimpleSpinBox\&. If the \fIitem\fP is not found on the list, \fBXmSimpleSpinBoxSetItem\fP notifies the user via the \fBXtWarning\fP function\&. .SH "RETURN VALUE" .PP The \fBXmSimpleSpinBoxSetItem\fP function returns no value\&. .SH "SEE ALSO" .PP \fBXmSimpleSpinBox\fP(3), .PP \fBXmSimpleSpinBoxAddItem\fP(3), \fBXmSimpleSpinBoxDeletePos\fP(3); \fBXtWarning\fP(3)\&. in the CAE Specification, Window Management: X Toolkit Intrinsics\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmDragContext.30000644000175000017500000012041512672140200014551 00000000000000'\" t ...\" DragCont.sgm /main/12 1996/09/08 20:39:46 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDragContext" "library call" .SH "NAME" \fBXmDragContext\fP \(em The DragContext widget class .iX "XmDragContext" .iX "widget class" "DragContext" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP DragContexts are special widgets used in drag and drop transactions\&. A DragContext is implemented as a widget, but a client does not explicitly create a DragContext widget\&. Instead, a client initiates a drag and drop transaction by calling \fBXmDragStart\fP, and this routine initializes and returns a DragContext widget\&. There is a unique DragContext for each drag operation\&. The toolkit frees a DragContext when a transaction is complete; therefore, an application programmer should not explicitly destroy a DragContext\&. .PP Initiator and receiver clients both use DragContexts to track the state of a transaction\&. When the initiator and receiver of a transaction are in the same client, they share the same DragContext instance\&. If they are in different clients, there are two separate DragContexts\&. In this case, the initiator calls \fBXmDragStart\fP and the toolkit provides a DragContext for the receiver client\&. The only resources pertinent to the receiver are \fBXmNexportTargets\fP and \fBXmNnumExportTargets\fP\&. These can both be passed as arguments to the \fBXmDropSiteRetrieve\fP function to obtain information about the current drop site\&. .PP In general, in order to receive data, a drop site must share at least one target type and operation in common with a drag source\&. The DragContext resource, \fBXmNexportTargets\fP, identifies the selection targets for the drag source\&. These export targets are compared with the \fBXmNimportTargets\fP resource list specified by a drop site\&. The DragContext resource, \fBXmNdragOperations\fP, identifies the valid operations that can be applied to the source data by the initiator\&. The drop site counterpart resource is \fBXmNdropSiteOperations\fP, which indicates a drop site\&'s supported operations\&. .PP A client uses DragIcon widgets to define the drag-over animation effects associated with a given drag and drop transaction\&. An initiator specifies a set of drag icons, selects a blending model, and sets foreground and background cursor colors with DragContext resources\&. .PP The type of drag-over visual used to represent a drag operation depends on the drag protocol style\&. In preregister mode, the server is grabbed, and either a cursor or a pixmap may be used as a drag-over visual\&. In dynamic mode, drag-over visuals must be implemented with the X cursor\&. If the resulting drag protocol style is Drop Only or None and the \fBXmNdragInitiatorProtocolStyle\fP is \fBXmDRAG_DYNAMIC\fP or \fBXmDRAG_PREFER_DYNAMIC\fP, then a dynamic visual style (cursor) is used\&. Otherwise, a preregister visual style is used\&. .SS "Classes" .PP DragContext inherits behavior and resources from \fBCore\fP\&. .PP The class pointer is \fBxmDragContextClass\fP\&. .PP The class name is \fBXmDragContext\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDragContext Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNblendModelXmCBlendModelunsigned charXmBLEND_ALLCG _____ XmNclientDataXmCClientDataXtPointerNULLCSG _____ XmNconvertProcXmCConvertProcXtConvertSelectionIncrProcNULLCSG _____ XmNcursorBackgroundXmCCursorBackgroundPixeldynamicCSG _____ XmNcursorForegroundXmCCursorForegroundPixeldynamicCSG _____ XmNdragDropFinishCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNdragMotionCallbackXmCCallbackXtCallbackListNULLC _____ XmNdragOperationsXmCDragOperationsunsigned charXmDROP_COPY | XmDROP_MOVEC _____ XmNdropFinishCallbackXmCCallbackXtCallbackListNULLC _____ XmNdropSiteEnterCallbackXmCCallbackXtCallbackListNULLC _____ XmNdropSiteLeaveCallbackXmCCallbackXtCallbackListNULLC _____ XmNdropStartCallbackXmCCallbackXtCallbackListNULLC _____ XmNexportTargetsXmCExportTargetsAtom *NULLCSG _____ XmNincrementalXmCIncrementalBooleanFalseCSG _____ XmNinvalidCursorForegroundXmCCursorForegroundPixeldynamicCSG _____ XmNnoneCursorForegroundXmCCursorForegroundPixeldynamicCSG _____ XmNnumExportTargetsXmCNumExportTargetsCardinal0CSG _____ XmNoperationChangedCallbackXmCCallbackXtCallbackListNULLC _____ XmNoperationCursorIconXmCOperationCursorIconWidgetdynamicCSG _____ XmNsourceCursorIconXmCSourceCursorIconWidgetdynamicCSG _____ XmNsourcePixmapIconXmCSourcePixmapIconWidgetdynamicCSG _____ XmNstateCursorIconXmCStateCursorIconWidgetdynamicCSG _____ XmNtopLevelEnterCallbackXmCCallbackXtCallbackListNULLC _____ XmNtopLevelLeaveCallbackXmCCallbackXtCallbackListNULLC _____ XmNvalidCursorForegroundXmCCursorForegroundPixeldynamicCSG _____ .TE .IP "\fBXmNblendModel\fP" 10 Specifies which combination of DragIcons are blended to produce a drag-over visual\&. .RS .IP "\fBXmBLEND_ALL\fP" 10 Blends all three DragIcons: the source, state and operation icons\&. The icons are layered from top to bottom with the operation icon on top and the source icon on the bottom\&. The hotspot is derived from the state icon\&. .IP "\fBXmBLEND_STATE_SOURCE\fP" 10 Blends the state and source icons only\&. The hotspot is derived from the state icon\&. .IP "\fBXmBLEND_JUST_SOURCE\fP" 10 Specifies that only the source icon is used, which the initiator updates as required\&. .IP "\fBXmBLEND_NONE\fP" 10 Specifies that no drag-over visual is generated\&. The client tracks the drop site status through callback routines and updates the drag-over visuals as necessary\&. .RE .IP "\fBXmNclientData\fP" 10 Specifies the client data to be passed to \fBXmNconvertProc\fP when it is invoked\&. .IP "\fBXmNconvertProc\fP" 10 If \fBXmNincremental\fP is True, specifies a procedure of type \fBXtConvertSelectionIncrProc\fP that converts the source data to the format(s) requested by the receiver client\&. The \fIwidget\fP argument passed to this procedure is the DragContext widget\&. The selection atom passed is _MOTIF_DROP\&. If \fBXmNincremental\fP is False, the procedure is an \fBXtConvertSelectionProc\fP, and should ignore the \fImax_length\fP, \fIclient_data\fP, and \fIrequest_id\fP arguments and should handle the conversion atomically\&. Data returned by \fBXmNconvertProc\fP must be allocated using \fBXtMalloc\fP, and will be freed automatically by the toolkit after the transfer\&. For additional information on selection conversion procedures, see \fIX Toolkit Intrinsics\(emC Language Interface\fP\&. .IP "\fBXmNcursorBackground\fP" 10 Specifies the background pixel value of the cursor\&. .IP "\fBXmNcursorForeground\fP" 10 Specifies the foreground pixel value of the cursor when the state icon is not blended\&. This resource defaults to the foreground color of the widget passed to the \fBXmDragStart\fP function\&. .IP "\fBXmNdragDropFinishCallback\fP" 10 Specifies the list of callbacks that are called when the transaction is completed\&. The type of the structure whose address is passed to this callback is \fBXmDragDropFinishCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_DRAG_DROP_FINISH\fP\&. .IP "\fBXmNdragMotionCallback\fP" 10 Specifies the list of callbacks that are invoked when the pointer moves\&. The type of structure whose address is passed to this callback is \fBXmDragMotionCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_DRAG_MOTION\fP\&. .IP "\fBXmNdragOperations\fP" 10 Specifies the set of valid operations associated with an initiator client for a drag transaction\&. This resource is a bit mask that is formed by combining one or more of the following values using a bitwise operation such as inclusive OR (|): \fBXmDROP_COPY\fP, \fBXmDROP_LINK\fP, \fBXmDROP_MOVE\fP\&. The value \fBXmDROP_NOOP\fP for this resource indicates that no operations are valid\&. For Text and TextField widgets, this resource is set to \fBXmDROP_COPY\fP | \fBXmDROP_MOVE\fP; for List widgets, it is set to \fBXmDROP_COPY\fP\&. .IP "\fBXmNdropFinishCallback\fP" 10 Specifies the list of callbacks that are invoked when the drop is completed\&. The type of the structure whose address is passed to this callback is \fBXmDropFinishCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_DROP_FINISH\fP\&. .IP "\fBXmNdropSiteEnterCallback\fP" 10 Specifies the list of callbacks that are invoked when the pointer enters a drop site\&. The type of the structure whose address is passed to this callback is \fBXmDropSiteEnterCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_DROP_SITE_ENTER\fP\&. .IP "\fBXmNdropSiteLeaveCallback\fP" 10 Specifies the list of callbacks that are invoked when the pointer leaves a drop site\&. The type of the structure whose address is passed to this callback is \fBXmDropSiteLeaveCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_DROP_SITE_LEAVE\fP\&. .IP "\fBXmNdropStartCallback\fP" 10 Specifies the list of callbacks that are invoked when a drop is initiated\&. The type of the structure whose address is passed to this callback is \fBXmDropStartCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_DROP_START\fP\&. .IP "\fBXmNexportTargets\fP" 10 Specifies the list of target atoms associated with this source\&. This resource identifies the selection targets this source can be converted to\&. .IP "\fBXmNincremental\fP" 10 Specifies a Boolean value that indicates whether the transfer on the initiator side uses the Xt incremental selection transfer mechanism described in \fIX Toolkit Intrinsics\(emC Language Interface\fP\&. If the value is True, the initiator uses incremental transfer; if the value is False, the initiator uses atomic transfer\&. .IP "\fBXmNinvalidCursorForeground\fP" 10 Specifies the foreground pixel value of the cursor when the state is invalid\&. This resource defaults to the value of the \fBXmNcursorForeground\fP resource\&. .IP "\fBXmNnoneCursorForeground\fP" 10 Specifies the foreground pixel value of the cursor when the state is none\&. This resource defaults to the value of the \fBXmNcursorForeground\fP resource\&. .IP "\fBXmNnumExportTargets\fP" 10 Specifies the number of entries in the list of export targets\&. .IP "\fBXmNoperationChangedCallback\fP" 10 Specifies the list of callbacks that are invoked when the drag is started and when the user requests that a different operation be applied to the drop\&. The type of the structure whose address is passed to this callback is \fBXmOperationChangedCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_OPERATION_CHANGED\fP\&. .IP "\fBXmNoperationCursorIcon\fP" 10 Specifies the cursor icon used to designate the type of operation performed by the drag transaction\&. If NULL, \fBXmScreen\fP resources provide default icons for copy, link, and move operations\&. .IP "\fBXmNsourceCursorIcon\fP" 10 Specifies the cursor icon used to represent the source when a dynamic visual style is used\&. If NULL, the \fBXmNdefaultSourceCursorIcon\fP resource of \fBXmScreen\fP provides a default cursor icon\&. .IP "\fBXmNsourcePixmapIcon\fP" 10 Specifies the pixmap icon used to represent the source when a preregister visual style is used\&. The icon is used in conjunction with the colormap of the widget passed to \fBXmDragStart\fP\&. If NULL, \fBXmNsourceCursorIcon\fP is used\&. .IP "\fBXmNstateCursorIcon\fP" 10 Specifies the cursor icon used to designate the state of a drop site\&. If NULL, \fBXmScreen\fP resources provide default icons for a valid, invalid, and no drop site condition\&. .IP "\fBXmNtopLevelEnterCallback\fP" 10 Specifies the list of callbacks that are called when the pointer enters a top-level window or root window (due to changing screens)\&. The type of the structure whose address is passed to this callback is \fBXmTopLevelEnterCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_TOP_LEVEL_ENTER\fP\&. .IP "\fBXmNtopLevelLeaveCallback\fP" 10 Specifies the list of callbacks that are called when the pointer leaves a top level window or the root window (due to changing screens)\&. The type of the structure whose address is passed to this callback is \fBXmTopLevelLeaveCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_TOP_LEVEL_LEAVE\fP\&. .IP "\fBXmNvalidCursorForeground\fP" 10 Specifies the foreground pixel value of the cursor designated as a valid cursor icon\&. .SS "Inherited Resources" .PP DragContext inherits behavior and resources from the superclass described in the following table\&. For a complete description of each resource, refer to the \fBCore\fP reference page\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP Each of the DragContext callbacks has an associated callback structure\&. .PP A pointer to the following structure is passed to the \fBXmNdragDropFinishCallback\fP callback: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; }XmDragDropFinishCallbackStruct, *XmDragDropFinishCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fBtimeStamp\fP" 10 Specifies the time at which either the drag or the drop was completed .PP A pointer to the following structure is passed to callbacks for \fBXmNdragMotionCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; unsigned char \fIoperation\fP; unsigned char \fIoperations\fP; unsigned char \fIdropSiteStatus\fP; Position \fIx\fP; Position \fIy\fP; }XmDragMotionCallbackStruct, *XmDragMotionCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the timestamp of the logical event\&. .IP "\fIoperation\fP" 10 Identifies an operation\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fIoperation\fP to the value of the \fIoperation\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP and the pointer is within an active drop site, the toolkit initializes \fIoperation\fP by selecting an operation from the bitwise AND of the initial value of the \fIoperations\fP member and the value of the DropSite\&'s \fBXmNdropSiteOperations\fP resource\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If the toolkit finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP and the pointer is not within an active drop site, the toolkit initializes \fIoperation\fP by selecting an operation from the initial value of the \fIoperations\fP member\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If the toolkit finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "\fIoperations\fP" 10 Indicates the set of operations supported for the source data\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fIoperations\fP to the bitwise AND of the DropSite\&'s \fBXmNdropOperations\fP and the value of the \fIoperations\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP and the user does not select an operation (by pressing a modifier key), the toolkit initializes \fIoperations\fP to the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP and the user does select an operation, the toolkit initializes \fIoperations\fP to the bitwise AND of the corresponding operation and the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "\fBdropSiteStatus\fP" 10 Indicates whether or not a drop site is valid\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fBdropSiteStatus\fP to the value of the \fBdropSiteStatus\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP, it initializes \fBdropSiteStatus\fP as follows: the toolkit initializes \fBdropSiteStatus\fP to \fBXmNO_DROP_SITE\fP if the pointer is over an inactive drop site or is not over a drop site\&. The toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_VALID\fP if all the following conditions are met: .RS .IP " \(bu" 6 The pointer is over an active drop site\&. .IP " \(bu" 6 The DragContext\&'s \fBXmNexportTargets\fP and the DropSite\&'s \fBXmNimportTargets\fP are compatible\&. .IP " \(bu" 6 The initial value of the \fIoperation\fP member is not \fBXmDROP_NOOP\fP\&. .RE .IP "" 10 Otherwise, the toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_INVALID\fP\&. .PP A pointer to the following structure is passed for the \fBXmNdropFinishCallback\fP callback: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; unsigned char \fIoperation\fP; unsigned char \fIoperations\fP; unsigned char \fIdropSiteStatus\fP; unsigned char \fIdropAction\fP; unsigned char \fIcompletionStatus\fP; }XmDropFinishCallbackStruct, *XmDropFinishCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the time at which the drop was completed\&. .IP "\fIoperation\fP" 10 Identifies an operation\&. .IP "" 10 If the pointer is over an active drop site when the drop begins, the toolkit initializes \fIoperation\fP to the value of the \fIoperation\fP member of the \fBXmDropProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdropProc\fP returns\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins, the toolkit initializes \fIoperation\fP by selecting an operation from the initial value of the \fIoperations\fP member\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If it finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "\fIoperations\fP" 10 Indicates the set of operations supported for the source data\&. .IP "" 10 If the pointer is over an active drop site when the drop begins, the toolkit initializes \fIoperations\fP to the bitwise AND of the DropSite\&'s \fBXmNdropOperations\fP and the value of the \fIoperations\fP member of the \fBXmDropProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdropProc\fP returns\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins and if the user does not select an operation (by pressing a modifier key), the toolkit initializes \fIoperations\fP to the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins and if the user does select an operation, the toolkit initializes \fIoperations\fP to the bitwise AND of the corresponding operation and the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "\fBdropSiteStatus\fP" 10 Indicates whether or not a drop site is valid\&. .IP "" 10 If the pointer is over an active drop site when the drop begins, the toolkit initializes \fBdropSiteStatus\fP to the value of the \fBdropSiteStatus\fP member of the \fBXmDropProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdropProc\fP returns\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins, the toolkit initializes \fBdropSiteStatus\fP to \fBXmNO_DROP_SITE\fP\&. .IP "\fBdropAction\fP" 10 Identifies the drop action\&. The values are \fBXmDROP\fP, \fBXmDROP_CANCEL\fP, \fBXmDROP_HELP\fP, and \fBXmDROP_INTERRUPT\fP\&. The \fBXmDROP_INTERRUPT\fP value is currently unsupported; if specified, it will be interpreted as an \fBXmDROP_CANCEL\fP\&. .IP "\fBcompletionStatus\fP" 10 An IN/OUT member that indicates the status of the drop action\&. After the last callback procedure has returned, the final value of this member determines what visual transition effects will be applied\&. There are two values: .RS .IP "\fBXmDROP_SUCCESS\fP" 10 The drop was successful\&. .IP "\fBXmDROP_FAILURE\fP" 10 The drop was unsuccessful\&. .RE .PP A pointer to the following structure is passed to callbacks for \fBXmNdropSiteEnterCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; unsigned char \fIoperation\fP; unsigned char \fIoperations\fP; unsigned char \fIdropSiteStatus\fP; Position \fIx\fP; Position \fIy\fP; }XmDropSiteEnterCallbackStruct, *XmDropSiteEnterCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the time the crossing event occurred\&. .IP "\fIoperation\fP" 10 Identifies an operation\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fIoperation\fP to the value of the \fIoperation\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP, it initializes \fIoperation\fP by selecting an operation from the bitwise AND of the initial value of the \fIoperations\fP member and the value of the DropSite\&'s \fBXmNdropSiteOperations\fP resource\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If the toolkit finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "\fIoperations\fP" 10 Indicates the set of operations supported for the source data\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fIoperations\fP to the bitwise AND of the DropSite\&'s \fBXmNdropOperations\fP and the value of the \fIoperations\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP and the user does not select an operation (by pressing a modifier key), the toolkit initializes \fIoperations\fP to the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP and the user does select an operation, the toolkit initializes \fIoperations\fP to the bitwise AND of the corresponding operation and the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "\fBdropSiteStatus\fP" 10 Indicates whether or not a drop site is valid\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fBdropSiteStatus\fP to the value of the \fBdropSiteStatus\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. .IP "" 10 If the toolkit has not called \fBXmNdragProc\fP, it initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_VALID\fP if the DragContext\&'s \fBXmNexportTargets\fP and the DropSite\&'s \fBXmNimportTargets\fP are compatible and if the initial value of the \fIoperation\fP member is not \fBXmDROP_NOOP\fP\&. Otherwise, the toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_INVALID\fP\&. .IP "\fIx\fP" 10 Indicates the x-coordinate of the pointer in root window coordinates\&. .IP "\fIy\fP" 10 Indicates the y-coordinate of the pointer in root window coordinates\&. .PP A pointer to the following structure is passed to callbacks for \fBXmNdropSiteLeaveCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; }XmDropSiteLeaveCallbackStruct, *XmDropSiteLeaveCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fBtimeStamp\fP" 10 Specifies the timestamp of the logical event .PP A pointer to the following structure is passed for the \fBXmNdropStartCallback\fP callback: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; unsigned char \fIoperation\fP; unsigned char \fIoperations\fP; unsigned char \fIdropSiteStatus\fP; unsigned char \fIdropAction\fP; Position \fIx\fP; Position \fIy\fP; }XmDropStartCallbackStruct, *XmDropStartCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the time at which the drag was completed\&. .IP "\fIoperation\fP" 10 Identifies an operation\&. .IP "" 10 If the pointer is over an active drop site when the drop begins, the toolkit initializes \fIoperation\fP to the value of the \fIoperation\fP member of the \fBXmDropProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdropProc\fP returns\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins, the toolkit initializes \fIoperation\fP by selecting an operation from the initial value of the \fIoperations\fP member\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If it finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "\fIoperations\fP" 10 Indicates the set of operations supported for the source data\&. .IP "" 10 If the pointer is over an active drop site when the drop begins, the toolkit initializes \fIoperations\fP to the bitwise AND of the DropSite\&'s \fBXmNdropOperations\fP and the value of the \fIoperations\fP member of the \fBXmDropProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdropProc\fP returns\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins and if the user does not select an operation (by pressing a modifier key), the toolkit initializes \fIoperations\fP to the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins and if the user does select an operation, the toolkit initializes \fIoperations\fP to the bitwise AND of the corresponding operation and the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "\fBdropSiteStatus\fP" 10 Indicates whether or not a drop site is valid\&. .IP "" 10 If the pointer is over an active drop site when the drop begins, the toolkit initializes \fBdropSiteStatus\fP to the value of the \fBdropSiteStatus\fP member of the \fBXmDropProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdropProc\fP returns\&. .IP "" 10 If the pointer is not over an active drop site when the drop begins, the toolkit initializes \fBdropSiteStatus\fP to \fBXmNO_DROP_SITE\fP\&. .IP "" 10 This field is invalid if the \fBdropAction\fP field is set to \fBXmDROP_CANCEL\fP\&. .IP "\fBdropAction\fP" 10 An IN/OUT member that identifies the drop action\&. The values are \fBXmDROP\fP, \fBXmDROP_CANCEL\fP, \fBXmDROP_HELP\fP, and \fBXmDROP_INTERRUPT\fP\&. The value of \fBdropAction\fP can be modified to change the action actually initiated\&. The value \fBXmDROP_INTERRUPT\fP is currently unsupported; if specified, it will be interpreted as an \fBXmDROP_CANCEL\fP\&. .IP "\fIx\fP" 10 Indicates the x-coordinate of the pointer in root window coordinates\&. .IP "\fIy\fP" 10 Indicates the y-coordinate of the pointer in root window coordinates\&. .PP A pointer to the following structure is passed to the \fBXmNoperationChangedCallback\fP callback: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; unsigned char \fIoperation\fP; unsigned char \fIoperations\fP; unsigned char \fIdropSiteStatus\fP; }XmOperationChangedCallbackStruct, *XmOperationChangedCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the time at which the crossing event occurred\&. .IP "\fIoperation\fP" 10 Identifies an operation\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fIoperation\fP to the value of the \fIoperation\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP, and the pointer is within an active drop site, the toolkit initializes \fIoperation\fP by selecting an operation from the bitwise AND of the initial value of the \fIoperations\fP member and the value of the DropSite\&'s \fBXmNdropSiteOperations\fP resource\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If the toolkit finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP, and the pointer is not within an active drop site, the toolkit initializes \fIoperation\fP by selecting an operation from the initial value of the \fIoperations\fP member\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If the toolkit finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "\fIoperations\fP" 10 Indicates the set of operations supported for the source data\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fIoperations\fP to the bitwise AND of the DropSite\&'s \fBXmNdropOperations\fP and the value of the \fIoperations\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP, and the user does not select an operation (by pressing a modifier key), the toolkit initializes \fIoperations\fP to the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP, and the user does select an operation, the toolkit initializes \fIoperations\fP to the bitwise AND of the corresponding operation and the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "\fBdropSiteStatus\fP" 10 Indicates whether or not a drop site is valid\&. .IP "" 10 If the toolkit has just called a DropSite\&'s \fBXmNdragProc\fP, the toolkit initializes \fBdropSiteStatus\fP to the value of the \fBdropSiteStatus\fP member of the \fBXmDragProcCallbackStruct\fR at the time the DropSite\&'s \fBXmNdragProc\fP returns\&. .IP "" 10 If the toolkit has not called an \fBXmNdragProc\fP it initializes \fBdropSiteStatus\fP to \fBXmNO_DROP_SITE\fP if the pointer is over an inactive drop site or is not over a drop site\&. The toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_VALID\fP if all the following conditions are met: .RS .IP " \(bu" 6 The pointer is over an active drop site .IP " \(bu" 6 The DragContext\&'s \fBXmNexportTargets\fP and the DropSite\&'s \fBXmNimportTargets\fP are compatible .IP " \(bu" 6 The initial value of the \fIoperation\fP member is not \fBXmDROP_NOOP\fP .RE .IP "" 10 Otherwise, the toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_INVALID\fP\&. .PP A pointer to the following structure is passed to callbacks for \fBXmNtopLevelEnterCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; Screen \fIscreen\fP; Window \fIwindow\fP; Position \fIx\fP; Position \fIy\fP; unsigned char \fIdragProtocolStyle\fP; }XmTopLevelEnterCallbackStruct, *XmTopLevelEnterCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the timestamp of the logical event\&. .IP "\fIscreen\fP" 10 Specifies the screen associated with the top-level window or root window being entered\&. .IP "\fIwindow\fP" 10 Specifies the ID of the top-level window or root window being entered\&. .IP "\fIx\fP" 10 Indicates the x-coordinate of the pointer in root window coordinates\&. .IP "\fIy\fP" 10 Indicates the y-coordinate of the pointer in root window coordinates\&. .IP "\fBdragProtocolStyle\fP" 10 Specifies the protocol style adopted by the initiator\&. The values are \fBXmDRAG_DROP_ONLY\fP, \fBXmDRAG_DYNAMIC\fP, \fBXmDRAG_NONE\fP, and \fBXmDRAG_PREREGISTER\fP\&. .PP A pointer to the following structure is passed to callbacks for \fBXmNtopLevelLeaveCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; Screen \fIscreen\fP; Window \fIwindow\fP; }XmTopLevelLeaveCallbackStruct, *XmTopLevelLeaveCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fBtimeStamp\fP" 10 Specifies the timestamp of the logical event .IP "\fIscreen\fP" 10 Specifies a screen associated with the top-level window or root window being left .IP "\fIwindow\fP" 10 Specifies the ID of the top-level window or root window being left .PP .SS "Translations" .PP The XmDragContext translations are described in the following list\&. The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fBButton1\fP:" 10 DragMotion() .IP "\fBButton1\fP:" 10 DragMotion() .IP "\fBButton1\fP:" 10 DragMotion() .IP "\fBButton2\fP:" 10 DragMotion() .IP "\fBButton2\fP:" 10 DragMotion() .IP "\fBButton2\fP:" 10 DragMotion() .IP "\fB\fP:" 10 FinishDrag() .IP "\fB\fP:" 10 FinishDrag() .IP "\fB\fP\fBReturn\fP:" 10 FinishDrag() .IP "\fB\fP\fB\fP:" 10 FinishDrag() .IP "\fB\fP:" 10 IgnoreButtons() .IP "\fB\fP:" 10 IgnoreButtons() .IP "\fB:\fP\fB\fP\fB\fP:" 10 CancelDrag() .IP "\fB:\fP\fB\fP\fB\fP:" 10 HelpDrag() .IP "\fB:\fP\fB\fP\fB\fP:" 10 DragKey(\fBUp\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 DragKey(\fBDown\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 DragKey(\fBLeft\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 DragKey(\fBRight\fP) .IP "\fB:\fP:" 10 DragKey(\fBUpdate\fP) .IP "\fB:\fP:" 10 DragKey(\fBUpdate\fP) .SS "Action Routines" .PP The XmDragContext action routines are .IP "CancelDrag():" 10 Cancels the drag operation and frees the associated DragContext\&. .IP "DragKey(\fBString\fR\fB)\fP" 10 If the value of \fBString\fR is \fBLeft\fP, \fBRight\fP, \fBUp\fP, or \fBDown\fP, this action moves the dragged object in the corresponding location\&. Any other values of \fBString\fR are ignored\&. .IP "DragMotion():" 10 Drags the selected data as the pointer is moved\&. .IP "FinishDrag():" 10 Finishes the drag operation and starts the drop operation\&. .IP "HelpDrag():" 10 Initiates a conditional drop that enables the receiver to provide help information to the user\&. The user can cancel or continue the drop operation in response to this information\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED INFORMATION" .PP \fBCore\fP(3), \fBXmDisplay\fP(3), \fBXmDragCancel\fP(3), \fBXmDragIcon\fP(3), \fBXmDragStart\fP(3), \fBXmDropSite\fP(3), \fBXmDropTransfer\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmCreateSimpleMenuBar.30000644000175000017500000000500012672140200016146 00000000000000'\" t ...\" CreSiB.sgm /main/8 1996/09/08 20:36:19 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSimpleMenuBar" "library call" .SH "NAME" \fBXmCreateSimpleMenuBar\fP \(em A RowColumn widget convenience creation function .iX "XmCreateSimpleMenuBar" .iX "creation functions" "XmCreateSimpleMenuBar" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSimpleMenuBar\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSimpleMenuBar\fP creates an instance of a RowColumn widget of type \fBXmMENU_BAR\fP and returns the associated widget ID\&. .PP This routine creates a MenuBar and its CascadeButtonGadget children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. Buttons are named and created in the order they are specified in the RowColumn simple menu creation resources supplied in the argument list\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. The only button type allowed in the \fBXmNbuttonType\fP resource is \fBXmCASCADEBUTTON\fP\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateMenuBar\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimpleMenuBar\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmClipboardRegisterFormat.30000644000175000017500000000621412672140200017104 00000000000000'\" t ...\" ClipbK.sgm /main/10 1996/09/25 10:24:50 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardRegisterFormat" "library call" .SH "NAME" \fBXmClipboardRegisterFormat\fP \(em A clipboard function that registers a new format .iX "XmClipboardRegisterFormat" .iX "clipboard functions" "XmClipboardRegisterFormat" .SH "SYNOPSIS" .PP .nf #include int XmClipboardRegisterFormat (\fIdisplay, format_name, format_length\fP) Display \fI* display\fP; char \fI* format_name\fP; int \fIformat_length\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardRegisterFormat\fP registers a new format\&. Each format stored on the clipboard should have a length associated with it; this length must be known to the clipboard routines\&. Formats are known as targets in the \fIInter-Client Communication Conventions Manual\fP (ICCCM)\&. All of the formats specified by version 1\&.1 of the ICCCM conventions are preregistered\&. Any other format that the application wants to use must either be 8-bit data or be registered via this routine\&. Failure to register the length of the data results in incompatible applications across platforms having different byte-swapping orders\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIformat_name\fP" 10 Specifies the string name for the new format (target)\&. .IP "\fIformat_length\fP" 10 Specifies the format length in bits (8, 16, or 32)\&. .SH "RETURN" .IP "\fBXmClipboardBadFormat\fP" 10 The \fIformat_name\fP must not be NULL, and the \fIformat_length\fP must be 8, 16, or 32\&. .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardFail\fP" 10 The function failed because the specified format was already registered with a different length from that specified now\&. If a specified format was already registered with the same length as that specified now, \fBXmClipboardSuccess\fP is returned\&. .SH "RELATED" .PP \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTransferValue.30000644000175000017500000001262612672140200015114 00000000000000'\" t ...\" TransfV.sgm /main/11 1996/08/31 18:08:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTransferValue" "library call" .SH "NAME" \fBXmTransferValue\fP \(em A toolkit function that transfers data to a destination .iX "XmTransferValue" .iX "toolkit functions" "XmTransferValue" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBXmTransferValue\fP\fR( \fBXtPointer \fBtransfer_id\fR\fR, \fBAtom \fBtarget\fR\fR, \fBXtCallbackProc \fBproc\fR\fR, \fBXtPointer \fBclient_data\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTransferValue\fP converts a selection, transferring any data from the selection owner, in the context of an already-initiated data transfer operation\&. An application can call this routine from an \fBXmNdestinationCallback\fP procedure or any function called as a result\&. .PP The caller of \fBXmTransferValue\fP supplies the target to which the selection is converted\&. The caller also supplies a callback procedure to handle the data that results from the conversion\&. .IP "\fBtransfer_id\fP" 10 Specifies a unique indentifier for the data transfer operation\&. The value must be the same as the value of the \fBtransfer_id\fP member of the \fBXmDestinationCallbackStruct\fR passed to the \fBXmNdestinationCallback\fP procedure\&. .IP "\fItarget\fP" 10 Specifies the target to which the selection is to be converted\&. .IP "\fIproc\fP" 10 Specifies a callback procedure to be invoked when the selection has been converted and the data, if any, is available\&. This procedure is responsible for inserting or otherwise handling any data transferred\&. The procedure can also terminate the data transfer by calling \fBXmTransferDone\fP\&. The \fIproc\fP receives three arguments: .RS .IP " \(bu" 6 The widget that requested the conversion .IP " \(bu" 6 The value of the \fIclient_data\fP argument .IP " \(bu" 6 A pointer to an \fBXmSelectionCallbackStruct\fR .RE .IP "" 10 This procedure can be called before or after \fBXmTransferValue\fP returns\&. .IP "\fIclient_data\fP" 10 Specifies data to be passed to the callback procedure (the value of the \fIproc\fP argument) when the selection has been converted\&. .IP "\fItime\fP" 10 Specifies the time of the \fBXEvent\fP that triggered the data transfer\&. You should typically set this field to \fBXtLastTimestampProcessed\fP\&. .PP The callback procedure (the value of the \fIproc\fP argument) receives a pointer to an \fBXmSelectionCallbackStruct\fR, which has the following definition: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; Atom \fItarget\fP; Atom \fItype\fP; XtPointer \fItransfer_id\fP; int \fIflags\fP; int \fIremaining\fP; XtPointer \fIvalue\fP; unsigned long \fIlength\fP; int \fIformat\fP; } XmSelectionCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Specifies the selection that has been converted\&. .IP "\fItarget\fP" 10 Specifies the target to which \fBXmTransferValue\fP requested conversion\&. The value is the same as the value of the \fItarget\fP argument to \fBXmTransferValue\fP\&. .IP "\fItype\fP" 10 Specifies the type of the selection value\&. This is not the target, but the type used to represent the target\&. The value \fBXT_CONVERT_FAIL\fP means that the selection owner did not respond to the conversion request within the Intrinsics selection timeout interval\&. .IP "\fBtransfer_id\fP" 10 Specifies a unique indentifier for the data transfer operation\&. The value is the same as the value of the \fBtransfer_id\fP argument to \fBXmTransferValue\fP\&. .IP "\fIflags\fP" 10 This member is currently unused\&. The value is always \fBXmSELECTION_DEFAULT\fP\&. .IP "\fIremaining\fP" 10 Indicates the number of transfers remaining for the operation specified by \fBtransfer_id\fP\&. .IP "\fIvalue\fP" 10 Represents the data transferred by this request\&. The application is responsible for freeing the value by calling \fBXtFree\fP\&. .IP "\fIlength\fP" 10 Indicates the number of elements of data in \fIvalue\fP, where each element has the size symbolized by \fIformat\fP\&. If \fIvalue\fP is NULL, \fIlength\fP is 0\&. .IP "\fIformat\fP" 10 Indicates whether the data in \fIvalue\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. Possible values are 8 (for a list of \fIchar\fP), 16 (for a list of \fIshort\fP), or 32 (for a list of \fIlong\fP)\&. .SH "RELATED" .PP \fBXmTransferSetParameters\fP(3), \fBXmTransferSendRequest\fP(3), and \fBXmTransferStartRequest\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmDataFieldSetAddMode.30000644000175000017500000000331112672140200016031 00000000000000'\" t ...\" TxtFieAZ.sgm /main/8 1996/09/08 21:15:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldSetAddMode" "library call" .SH "NAME" \fBXmDataFieldSetAddMode\fP \(em A DataField function that sets the state of Add mode .iX "XmDataFieldSetAddMode" .iX "DataField functions" "XmDataFieldSetAddMode" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDataFieldSetAddMode\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBstate\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldSetAddMode\fP controls whether or not the DataField widget is in Add mode\&. When the widget is in Add mode, the insert cursor can be moved without disturbing the primary selection\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIstate\fP" 10 Specifies whether or not the widget is in Add mode\&. A value of True turns on Add mode; a value of False turns off Add mode\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. motif-2.3.8/doc/man/man3/XmStringTableParseStringArray.30000644000175000017500000000630512672140200017727 00000000000000'\" t ...\" StrTaB.sgm /main/9 1996/09/08 21:07:19 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringTableParseStringArray" "library call" .SH "NAME" \fBXmStringTableParseStringArray\fP \(em A convenience function that converts an array of strings to a compound string table .iX "XmStringTableParseStringArray" .SH "SYNOPSIS" .PP .nf #include \fBXmStringTable \fBXmStringTableParseStringArray\fP\fR( \fBXtPointer \fB*strings\fR\fR, \fBCardinal \fBcount\fR\fR, \fBXmStringTag \fBtag\fR\fR, \fBXmTextType \fBtype\fR\fR, \fBXmParseTable \fBparse\fR\fR, \fBCardinal \fBparse_count\fR\fR, \fBXtPointer \fBcall_data\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringTableParseStringArray\fP takes an array of strings, allocates an \fBXmStringTable\fR with an equal number of slots, calls \fBXmStringParseText\fP on each string in \fIstrings\fP, and inserts the resulting \fBXmString\fR in the corresponding slot in the \fBXmStringTable\fR\&. .IP "\fIstrings\fP" 10 Specifies an array of strings of characters as determined by \fItype\fP\&. .IP "\fIcount\fP" 10 Specifies the number of strings in \fIstrings\fP\&. .IP "\fItag\fP" 10 Specifies the tag to be used in creating the result\&. The type of tag created (charset or locale) depends on the type of the text and the value given\&. If the value specified is NULL, and \fItype\fP indicates that a charset tag should be created, then the tag will have the value of \fBXmFONTLIST_DEFAULT_TAG\fP\&. If \fItype\fP indicates a locale tag, then the tag will have the value of \fBXmFONTLIST_DEFAULT_TAG\fP\&. .IP "\fItype\fP" 10 Specifies the type of text to be passed in and the type of tag\&. If the type is either \fBXmMULTIBYTE_TEXT\fP or \fBXmWIDECHAR_TEXT\fP, a locale tag should be created\&. If the type is \fBXmCHARSET_TEXT\fP, a charset tag will be created\&. .IP "\fIparse\fP" 10 Specifies the parse table to be used\&. .IP "\fIparse_count\fP" 10 Specifies the number of entries in the parse table\&. .IP "\fIcall_data\fP" 10 Specifies data to be passed to the parse procedures\&. .SH "RETURN" .PP Returns a new \fBXmStringTable\fR\&. The function allocates space to hold the \fBXmStringTable\fR\&. When the application no longer needs the returned \fBXmStringTable\fR, the application should call \fBXmStringFree\fP \fIcount\fP times (that is, one time for each returned compound string) and then call \fBXtFree\fP to deallocate the \fBXmStringTable\fR itself\&. .SH "RELATED" .PP \fBXmStringFree\fP(3) and \fBXmTabList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmMultiListGetSelectedRows.30000644000175000017500000000175112672140200017242 00000000000000.TH "XmMultiListGetSelectedRows" "library call" .SH "NAME" \fBXmMultiListGetSelectedRows\fP \(em an MultiList function that returns the rows that currently are selected. .iX "XmMultiListGetSelectedRows" .iX "List functions" "XmMultiListGetSelectedRows" .SH "SYNOPSIS" .PP .nf #include \fBXmMultiListRowInfo ** \fBXmMultiListGetSelectedRows\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP .PP Use this routine to find the rows that currently are selected in an MultiList widget. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RETURN" .PP The XmMultiListRowInfo ** returned by this function contains a NULL terminated array of XmMultiListRowInfo pointers\&. The calling routine is responsible for freeing the returned pointer with XtFree()\&. The function will return NULL if no elements are selected\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmMessageBoxGetChild.30000644000175000017500000000471112672140200015770 00000000000000'\" t ...\" MsgBB.sgm /main/8 1996/09/08 20:54:29 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMessageBoxGetChild" "library call" .SH "NAME" \fBXmMessageBoxGetChild\fP \(em A MessageBox function that is used to access a component .iX "XmMessageBoxGetChild" .iX "MessageBox functions" "XmMessageBoxGetChild" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmMessageBoxGetChild\fP\fR( \fBWidget \fBwidget\fR\fR, \fBunsigned char \fBchild\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMessageBoxGetChild\fP is used to access a component within a MessageBox\&. The parameters given to the function are the MessageBox widget and a value indicating which component to access\&. .PP NOTE: This routine is obsolete and exists for compatibility with previous releases\&. Instead of calling \fBXmMessageBoxGetChild\fP, you should call \fBXtNameToWidget\fP as described in the \fBXmMessageBox\fP(3) reference page\&. .IP "\fIwidget\fP" 10 Specifies the MessageBox widget ID\&. .IP "\fIchild\fP" 10 Specifies a component within the MessageBox\&. The following are legal values for this parameter: .RS .IP " \(bu" 6 \fBXmDIALOG_CANCEL_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_DEFAULT_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_HELP_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_MESSAGE_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_OK_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_SEPARATOR\fP .IP " \(bu" 6 \fBXmDIALOG_SYMBOL_LABEL\fP .RE .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the specified MessageBox component\&. An application should not assume that the returned widget will be of any particular class\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmListPosSelected.30000644000175000017500000000361212672140200015374 00000000000000'\" t ...\" LstPosSe.sgm /main/9 1996/09/08 20:50:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListPosSelected" "library call" .SH "NAME" \fBXmListPosSelected\fP \(em A List function that determines if the list item at a specified position is selected .iX "XmListPosSelected" .iX "List functions" "XmListPosSelected" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmListPosSelected\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmPosSelected\fP determines if the list item at the specified position is selected or not\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIposition\fP" 10 Specifies the position of the list item\&. A value of 1 indicates the first item in the list; a value of 2 indicates the second item; and so on\&. A value of 0 (zero) specifies the last item in the list\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns True if the list item is selected; otherwise, returns False if the item is not selected or the specified position is invalid\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmVaCreateCascadeButtonGadget.30000644000175000017500000000312712672140200017575 00000000000000.DT .TH "XmVaCreateCascadeButtonGadget" "library call" .SH "NAME" \fBXmVaCreateCascadeButtonGadget\fP, \fBXmVaCreateManagedCascadeButtonGadget\fP \(em A CascadeButtonGadget widget convenience creation functions\&. .iX "XmVaCreateCascadeButtonGadget" "XmVaCreateManagedCascadeButtonGadget" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateCascadeButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedCascadeButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a CascadeButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateCascadeButtonGadget\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedCascadeButtonGadget\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of CascadeButtonGadget and its associated resources, see \fBXmCascadeButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the CascadeButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmCascadeButtonGadget\fP(3), \fBXmCreateCascadeButtonGadget\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/OverrideShell.30000644000175000017500000001165512672140200014576 00000000000000'\" t ...\" Override.sgm /main/9 1996/09/08 21:42:10 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "OverrideShell" "library call" .SH "NAME" \fBOverrideShell\fP \(em The OverrideShell widget class .iX "OverrideShell" .iX "widget class" "OverrideShell" .SH "SYNOPSIS" .PP .nf #include #include .fi .SH "DESCRIPTION" .PP OverrideShell is used for shell windows that completely bypass the window manager, for example, PopupMenu shells\&. .SS "Classes" .PP OverrideShell inherits behavior and resources from \fBCore\fP, \fBComposite\fP, and \fBShell\fP\&. .PP The class pointer is \fBoverrideShellWidgetClass\fP\&. .PP The class name is \fBOverrideShell\fP\&. .SS "New Resources" .PP OverrideShell defines no new resources, but overrides the \fBXmNoverrideRedirect\fP and \fBXmNsaveUnder\fP resources in the \fBShell\fP class\&. .SS "Inherited Resources" .PP OverrideShell inherits behavior and resources from the following superclasses\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanTrueCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanTrueCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for OverrideShell\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), and \fBShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmCreateText.30000644000175000017500000000340012672140200014371 00000000000000'\" t ...\" CreTeB.sgm /main/7 1996/08/30 14:57:13 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateText" "library call" .SH "NAME" \fBXmCreateText\fP \(em The Text widget creation function .iX "XmCreateText" .iX "creation functions" "XmCreateText" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateText\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateText\fP creates an instance of a Text widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns the Text widget ID\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmTransferSetParameters.30000644000175000017500000000535612672140200016621 00000000000000'\" t ...\" TransfC.sgm /main/8 1996/08/30 16:20:38 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTransferSetParameters" "library call" .SH "NAME" \fBXmTransferSetParameters\fP \(em A toolkit function that establishes parameters to be passed by the next call to XmTransferValue .iX "XmTransferSetParameters" .iX "toolkit functions" "XmTransferSetParameters" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBXmTransferSetParameters\fP\fR( \fBXtPointer \fBtransfer_id\fR\fR, \fBXtPointer \fBparm\fR\fR, \fBint \fBparm_fmt\fR\fR, \fBunsigned long \fBparm_length\fR\fR, \fBAtom \fBparm_type\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTransferSetParameters\fP establishes a parameter definition\&. Your application calls \fBXmTransferSetParameters\fP just before calling \fBXmTransferValue\fP, and only if \fBXmTransferValue\fP needs to transfer a value containing a parameter\&. .IP "\fBtransfer_id\fP" 10 Specifies a unique indentifier for the data transfer operation\&. The value must be the same as the value of the \fBtransfer_id\fP member of the \fBXmDestinationCallbackStruct\fR passed to the \fBXmNdestinationCallback\fP procedure\&. .IP "\fIparm\fP" 10 Specifies parameters to be passed to the conversion routine (and the \fBXmNconvertCallback\fP procedures, if any) of the widget that owns the selection\&. The type and length of parameters are target-specific\&. If the target takes no parameters, the value is NULL\&. .IP "\fIparm_fmt\fP" 10 Specifies whether the data in \fIparm\fP should be viewed as a list of 8-bit, 16-bit, or 32-bit quantities\&. Possible values are 0 (when \fIparm\fP is NULL), 8, 16, and 32\&. .IP "\fIparm_length\fP" 10 Specifies the number of elements of data in \fIparm\fP, where each element has the number of bits specified by \fIparm_fmt\fP\&. When \fIparm\fP is NULL, the value is 0\&. .IP "\fIparm_type\fP" 10 Specifies the type of \fIparm\fP\&. .SH "RELATED" .PP \fBXmTransferSendRequest\fP(3), \fBXmTransferStartRequest\fP(3), and \fBXmTransferValue\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmVaCreateFrame.30000644000175000017500000000256312672140200014777 00000000000000.DT .TH "XmVaCreateFrame" "library call" .SH "NAME" \fBXmVaCreateFrame\fP, \fBXmVaCreateManagedFrame\fP \(em A Frame widget convenience creation functions\&. .iX "XmVaCreateFrame" "XmVaCreateManagedFrame" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateFrame\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedFrame\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Frame widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateFrame\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedFrame\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Frame and its associated resources, see \fBXmFrame\fP(3)\&. .SH "RETURN" .PP Returns the Frame widget ID\&. .SH "RELATED" .PP \fBXmFrame\fP(3), \fBXmCreateFrame\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCvtCTToXmString.30000644000175000017500000000432112672140200015306 00000000000000'\" t ...\" CvtCTTXm.sgm /main/8 1996/08/31 15:21:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCvtCTToXmString" "library call" .SH "NAME" \fBXmCvtCTToXmString\fP \(em A compound string function that converts compound text to a compound string .iX "XmCvtCTToXmString" .iX "compound string functions" "XmCvtCTToXmString" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmCvtCTToXmString\fP\fR( \fBchar \fB* text\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCvtCTToXmString\fP converts a (\fBchar *\fR) string in compound text format to a compound string\&. The application must call \fBXtAppInitialize\fP before calling this function\&. Conversion of compound text to compound strings is implementation dependent\&. .IP "\fItext\fP" 10 Specifies a string in compound text format to be converted to a compound string\&. .SH "RETURN" .PP Returns a compound string derived from the compound text\&. The function allocates space to hold the returned compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. The compound text is assumed to be NULL-terminated; NULLs within the compound text are handled correctly\&. The handling of HORIZONTAL TABULATION (HT) control characters within the compound text is undefined\&. The compound text format is described in the X Consortium Standard \fICompound Text Encoding\fP\&. .SH "RELATED" .PP \fBXmCvtXmStringToCT\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmSeparator.30000644000175000017500000002136412672140200014272 00000000000000'\" t ...\" SeparA.sgm /main/9 1996/09/08 21:01:35 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSeparator" "library call" .SH "NAME" \fBXmSeparator\fP \(em The Separator widget class .iX "XmSeparator" .iX "widget class" "Separator" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Separator is a primitive widget that separates items in a display\&. Several different line drawing styles are provided, as well as horizontal or vertical orientation\&. .PP The Separator line drawing is automatically centered within the height of the widget for a horizontal orientation and centered within the width of the widget for a vertical orientation\&. An \fBXtSetValues\fP with a new \fBXmNseparatorType\fP resizes the widget to its minimal height (for horizontal orientation) or its minimal width (for vertical orientation) unless height or width is explicitly set in the \fBXtSetValues\fP call\&. .PP Separator does not draw shadows around the separator\&. The Primitive resource \fBXmNshadowThickness\fP is used for the Separator\&'s thickness when \fBXmNseparatorType\fP is \fBXmSHADOW_ETCHED_IN\fP, \fBXmSHADOW_ETCHED_IN_DASH\fP, \fBXmSHADOW_ETCHED_OUT\fP, or \fBXmSHADOW_ETCHED_OUT_DASH\fP\&. .PP Separator does not highlight and allows no traversing\&. The primitive resource \fBXmNtraversalOn\fP is forced to False\&. .PP The \fBXmNseparatorType\fP of \fBXmNO_LINE\fP provides an escape to the application programmer who needs a different style of drawing\&. A pixmap the height of the widget can be created and used as the background pixmap by building an argument list using the \fBXmNbackgroundPixmap\fP argument type as defined by \fBCore\fP\&. Whenever the widget is redrawn, its background is displayed containing the desired separator drawing\&. Separator holds the \fBXmQTmenuSavvy\fP trait\&. .SS "Classes" .PP Separator inherits behavior, resources, and traits from \fBCore\fP and \fBXmPrimitive\fP\&. .PP The class pointer is \fBxmSeparatorWidgetClass\fP\&. .PP The class name is \fBXmSeparator\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix anduse the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmSeparator Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNmarginXmCMarginDimension0CSG _____ XmNorientationXmCOrientationunsigned charXmHORIZONTALCSG _____ XmNseparatorTypeXmCSeparatorTypeunsigned charXmSHADOW_ETCHED_INCSG _____ .TE .IP "\fBXmNmargin\fP" 10 For horizontal orientation, specifies the space on the left and right sides between the border of the Separator and the line drawn\&. For vertical orientation, specifies the space on the top and bottom between the border of the Separator and the line drawn\&. .IP "\fBXmNorientation\fP" 10 Displays Separator vertically or horizontally\&. This resource can have values of \fBXmVERTICAL\fP and \fBXmHORIZONTAL\fP\&. .IP "\fBXmNseparatorType\fP" 10 Specifies the type of line drawing to be done in the Separator widget\&. .RS .IP "\fBXmSINGLE_LINE\fP" 10 Single line .IP "\fBXmDOUBLE_LINE\fP" 10 Double line .IP "\fBXmSINGLE_DASHED_LINE\fP" 10 Single-dashed line .IP "\fBXmDOUBLE_DASHED_LINE\fP" 10 Double-dashed line .IP "\fBXmNO_LINE\fP" 10 No line .IP "\fBXmSHADOW_ETCHED_IN\fP" 10 A line whose shadows give the effect of a line etched into the window\&. The thickness of the line is equal to the value of \fBXmNshadowThickness\fP\&. For horizontal orientation, the top shadow is drawn in \fBXmNtopShadowColor\fP and the bottom shadow is drawn in \fBXmNbottomShadowColor\fP\&. For vertical orientation, the left edge is drawn in \fBXmNtopShadowColor\fP and the right edge is drawn in \fBXmNbottomShadowColor\fP\&. .IP "\fBXmSHADOW_ETCHED_OUT\fP" 10 A line whose shadows give the effect of an etched line coming out of the window\&. The thickness of the line is equal to the value of \fBXmNshadowThickness\fP\&. For horizontal orientation, the top shadow is drawn in \fBXmNbottomShadowColor\fP and the bottom shadow is drawn in \fBXmNtopShadowColor\fP\&. For vertical orientation, the left edge is drawn in \fBXmNbottomShadowColor\fP and the right edge is drawn in \fBXmNtopShadowColor\fP\&. .IP "\fBXmSHADOW_ETCHED_IN_DASH\fP" 10 Identical to \fBXmSHADOW_ETCHED_IN\fP except a series of lines creates a dashed line\&. .IP "\fBXmSHADOW_ETCHED_OUT_DASH\fP" 10 Identical to \fBXmSHADOW_ETCHED_OUT\fP except a series of lines creates a dashed line\&. .RE .SS "Inherited Resources" .PP Separator inherits behavior and resources from the superclasses in the following table\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension0CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanFalseG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for \fBXmSeparator\fP\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateSeparator\fP(3), \fBXmVaCreateSeparator\fP(3), and \fBXmVaCreateManagedSeparator\fP(3)\&. motif-2.3.8/doc/man/man3/XmStringHasSubstring.30000644000175000017500000000345012672140200016131 00000000000000'\" t ...\" StrHas.sgm /main/7 1996/08/30 16:11:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringHasSubstring" "library call" .SH "NAME" \fBXmStringHasSubstring\fP \(em A compound string function that indicates whether one compound string is contained within another .iX "XmStringHasSubstring" .iX "compound string functions" "XmStringHasSubstring" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringHasSubstring\fP\fR( \fBXmString \fBstring\fR\fR, \fBXmString \fBsubstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringHasSubstring\fP indicates whether or not one compound string is contained within another\&. .IP "\fIstring\fP" 10 Specifies the compound string to be searched .IP "\fIsubstring\fP" 10 Specifies the compound string to be searched for .SH "RETURN" .PP Returns True if \fIsubstring\fP has a single text component and if its text is completely contained within any single text component of \fIstring\fP; otherwise, it returns False\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringCreateLocalized\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmAddProtocolCallback.30000644000175000017500000000467512672140200016167 00000000000000'\" t ...\" AddProtA.sgm /main/9 1996/09/25 10:11:01 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmAddProtocolCallback" "library call" .SH "NAME" \fBXmAddProtocolCallback\fP \(em A VendorShell function that adds client callbacks for a protocol .iX "XmAddProtocolCallback" .iX "VendorShell functions" "XmAddProtocolCallback" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmAddProtocolCallback\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBproperty\fR\fR, \fBAtom \fBprotocol\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR, \fBXtPointer \fBclosure\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmAddProtocolCallback\fP adds client callbacks for a protocol\&. It checks if the protocol is registered, and if it is not, calls \fBXmAddProtocols\fP\&. It then adds the callback to the internal list\&. These callbacks are called when the corresponding client message is received\&. .PP \fBXmAddWMProtocolCallback\fP is a convenience interface\&. It calls \fBXmAddProtocolCallback\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIproperty\fP" 10 Specifies the protocol property .IP "\fIprotocol\fP" 10 Specifies the protocol \fBAtom\fP .IP "\fIcallback\fP" 10 Specifies the procedure to call when a protocol message is received .IP "\fIclosure\fP" 10 Specifies the client data to be passed to the callback when it is invoked .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddWMProtocolCallback\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveProtocolCallback\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmClipboardUndoCopy.30000644000175000017500000000513412672140200015707 00000000000000'\" t ...\" ClipbO.sgm /main/10 1996/09/25 10:25:20 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardUndoCopy" "library call" .SH "NAME" \fBXmClipboardUndoCopy\fP \(em A clipboard function that deletes the last item placed on the clipboard .iX "XmClipboardUndoCopy" .iX "clipboard functions" "XmClipboardUndoCopy" .SH "SYNOPSIS" .PP .nf #include int XmClipboardUndoCopy (\fIdisplay, window\fP) Display \fI* display\fP; Window \fIwindow\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardUndoCopy\fP deletes the last item placed on the clipboard if the item was placed there by an application with the passed \fIdisplay\fP and \fIwindow\fP arguments\&. Any data item deleted from the clipboard by the original call to \fBXmClipboardCopy\fP is restored\&. If the \fIdisplay\fP or \fIwindow\fP IDs do not match the last copied item, no action is taken, and this function has no effect\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each clipboard function it calls\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardLock\fP(3) and \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmGetAtomName.30000644000175000017500000000353112672140200014467 00000000000000'\" t ...\" GetAtomN.sgm /main/7 1996/09/08 20:45:30 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetAtomName" "library call" .SH "NAME" \fBXmGetAtomName\fP \(em A function that returns the string representation for an atom .iX "XmGetAtomName" .iX "atoms" .SH "SYNOPSIS" .PP .nf #include #include \fBString \fBXmGetAtomName\fP\fR( \fBDisplay \fB* display\fR\fR, \fBAtom \fBatom\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetAtomName\fP returns the string representation for an atom\&. It mirrors the \fIXlib\fP interfaces for atom management but provides client-side caching\&. When and where caching is provided in \fIXlib\fP, the routines will become pseudonyms for the \fIXlib\fP routines\&. .IP "\fIdisplay\fP" 10 Specifies the connection to the X server .IP "\fIatom\fP" 10 Specifies the atom for the property name you want returned .SH "RETURN" .PP Returns a string\&. The function allocates space to hold the returned string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXFree\fP\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmStringTableToXmString.30000644000175000017500000000504012672140200016540 00000000000000'\" t ...\" StrTaD.sgm /main/9 1996/09/08 21:07:35 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringTableToXmString" "library call" .SH "NAME" \fBXmStringTableToXmString\fP \(em A convenience function that converts a compound string table to a single compound string .iX "XmStringTableToXmString" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringTableToXmString\fP\fR( \fBXmStringTable \fBtable\fR\fR, \fBCardinal \fBcount\fR\fR, \fBXmString \fBbreak_component\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringTableToXmString\fP takes as input \fItable\fP of compound strings and a specified string component (such as a tab) and returns a single compound string consisting of each of the elements of \fItable\fP concatenated together with a single copy of \fIbreak_component\fP inserted between each element\&. .IP "\fItable\fP" 10 Specifies an \fBXmStringTable\fR containing the compound strings to be converted\&. .IP "\fIcount\fP" 10 Specifies the number of compound strings in \fItable\fP\&. .IP "\fIbreak_component\fP" 10 Specifies the \fBXmStringComponent\fP that will be inserted in the result to separate the individual elements of \fItable\fP\&. The most useful types will be \fBXmSTRING_COMPONENT_SEPARATOR\fP and \fBXmSTRING_COMPONENT_TAB\fP\&. Refer to the \fBXmStringComponentType\fP(3) reference page for a complete list of possible component types\&. Note, however, that the \fBXmSTRING_COMPONENT_UNKNOWN\fP component is not a possible type\&. .SH "RETURN" .PP Returns a new \fBXmString\fR\&. The function will allocate space to hold the returned compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .SH "RELATED" .PP \fBXmString\fP(3), \fBXmStringComponentType\fP(3), and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmScrolledWindowSetAreas.30000644000175000017500000000560212672140200016716 00000000000000'\" t ...\" ScrollB.sgm /main/8 1996/09/08 21:00:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScrolledWindowSetAreas" "library call" .SH "NAME" \fBXmScrolledWindowSetAreas\fP \(em A ScrolledWindow function that adds or changes a window work region and a horizontal or vertical ScrollBar widget to the ScrolledWindow widget .iX "XmScrolledWindowSetAreas" .iX "ScrolledWindow functions" "XmScrolledWindowSetAreas" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmScrolledWindowSetAreas\fP\fR( \fBWidget \fBwidget\fR\fR, \fBWidget \fBhorizontal_scrollbar\fR\fR, \fBWidget \fBvertical_scrollbar\fR\fR, \fBWidget \fBwork_region\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmScrolledWindowSetAreas\fP adds or changes a window work region and a horizontal or vertical ScrollBar widget to the ScrolledWindow widget for the application\&. Each widget is optional and may be passed as NULL\&. This function is obsolete and exists for compatibility with other releases\&. Use the \fBXmNscrolledWindowChildType\fP resource of \fBXmScrolledWindow\fP instead\&. .IP "\fIwidget\fP" 10 Specifies the ScrolledWindow widget ID\&. .IP "\fIhorizontal_scrollbar\fP" 10 Specifies the ScrollBar widget ID for the horizontal ScrollBar to be associated with the ScrolledWindow widget\&. Set this ID only after creating an instance of the ScrolledWindow widget\&. The resource name associated with this argument is \fBXmNhorizontalScrollBar\fP\&. .IP "\fIvertical_scrollbar\fP" 10 Specifies the ScrollBar widget ID for the vertical ScrollBar to be associated with the ScrolledWindow widget\&. Set this ID only after creating an instance of the ScrolledWindow widget\&. The resource name associated with this argument is \fBXmNverticalScrollBar\fP\&. .IP "\fIwork_region\fP" 10 Specifies the widget ID for the work window to be associated with the ScrolledWindow widget\&. Set this ID only after creating an instance of the ScrolledWindow widget\&. The attribute name associated with this argument is \fBXmNworkWindow\fP\&. .PP For a complete definition of ScrolledWindow and its associated resources, see \fBXmScrolledWindow\fP(3)\&. .SH "RELATED" .PP \fBXmScrolledWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmTextGetCenterline.30000644000175000017500000000355012672140200015724 00000000000000'\" t ...\" TxtGetCl.sgm /main/7 1996/10/02 11:49:21 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetCenterline" "library call" .SH "NAME" \fBXmTextGetCenterline\fP \(em Return the height (length) of a character string when the writing direction is vertical .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextGetCenterline\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetCenterline\fP accesses the x position of the centerline in the \fBText\fP widget, relative to the x position of the top of the widget\&. .IP "\fIwidget\fP" 10 Specifies the \fBText\fP widget ID\&. .SH "RETURN VALUE" .PP In the case of horizontal writing, this function accesses 0\&. .PP In the case of vertical writing, this function accesses the x position of the first centerline in the Text widget, relative to the x position of the left of the widget\&. The calculation takes into account the margin width, shadow thickness, highlight thickness, and a half of font width of the first font(set) in the fontlist used for drawing text\&. .SH "SEE ALSO" .PP \fBXmText\fP(3), \fBXmTextGetBaseline\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmCreateOutline.30000644000175000017500000000334512672140200015074 00000000000000'\" t ...\" CreFoA.sgm /main/7 1996/08/30 14:37:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateOutline" "library call" .SH "NAME" \fBXmCreateOutline\fP \(em The Outline widget creation function .iX "XmCreateOutline" .iX "creation functions" "XmCreateOutline" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateOutline\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateOutline\fP creates an instance of a Outline widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Outline and its associated resources, see \fBXmOutline\fP(3)\&. .SH "RETURN" .PP Returns the Outline widget ID\&. .SH "RELATED" .PP \fBXmOutline\fP(3)\&. motif-2.3.8/doc/man/man3/XmListGetSelectedPos.30000644000175000017500000000452212672140200016035 00000000000000'\" t ...\" LstGetSe.sgm /main/8 1996/09/08 20:50:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListGetSelectedPos" "library call" .SH "NAME" \fBXmListGetSelectedPos\fP \(em A List function that returns the position of every selected item in the list .iX "XmListGetSelectedPos" .iX "List functions" "XmListGetSelectedPos" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmListGetSelectedPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint **\fBposition_list\fR\fR, \fBint *\fBposition_count\fR\fR); .fi .SH "DESCRIPTION" .PP This routine is obsolete\&. It is replaced by calling \fBXtGetValues\fP for the List resources \fBXmNselectedPositions\fP and \fBXmNselectedPositionCount\fP\&. \fBXmListGetSelectedPos\fP is a Boolean function that returns an array of the positions of the selected items in a List\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIposition_list\fP" 10 Returns an array of the positions of the selected items in the List\&. The position of the first item in the list is 1; the position of the second item is 2; and so on\&. When the return value is True, \fBXmListGetSelectedPos\fP allocates memory for this array\&. The caller is responsible for freeing this memory\&. The caller can recover the allocated memory by calling \fBXtFree\fP\&. .IP "\fIposition_count\fP" 10 Returns the number of elements in the \fIposition_list\fP\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns True if the list has any selected items, and False if it does not\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmDragStart.30000644000175000017500000000462412672140200014225 00000000000000'\" t ...\" DragSt.sgm /main/9 1996/09/08 20:40:10 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDragStart" "library call" .SH "NAME" \fBXmDragStart\fP \(em A Drag and Drop function that initiates a drag and drop transaction .iX "XmDragStart" .iX "Drag and Drop functions" "XmDragStart" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmDragStart\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXEvent *\fBevent\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDragStart\fP initiates a drag operation\&. This routine returns the DragContext widget that it initializes for the associated drag transaction\&. The toolkit is responsible for freeing the DragContext when the drag and drop transaction is complete\&. .IP "\fIwidget\fP" 10 Specifies the ID of the smallest widget and/or gadget that encloses the source elements selected for a drag operation\&. .IP "\fIevent\fP" 10 Specifies the \fBXEvent\fP that triggered the drag operation\&. This event must be a ButtonPress event\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. Any \fBXmDragContext\fP resources not specified in the argument list are obtained from the resource database or are set to their default values\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of DragContext and its associated resources, see \fBXmDragContext\fP(3)\&. .SH "RETURN" .PP Returns the ID of the DragContext widget that controls this drag and drop transaction\&. Returns NULL if the drag cannot be initiated\&. .SH "RELATED" .PP \fBXmDragCancel\fP(3) and \fBXmDragContext\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmVaCreateCascadeButton.30000644000175000017500000000276612672140200016471 00000000000000.DT .TH "XmVaCreateCascadeButton" "library call" .SH "NAME" \fBXmVaCreateCascadeButton\fP, \fBXmVaCreateManagedCascadeButton\fP \(em A CascadeButton widget convenience creation functions\&. .iX "XmVaCreateCascadeButton" "XmVaCreateManagedCascadeButton" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateCascadeButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedCascadeButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a CascadeButton widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateCascadeButton\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedCascadeButton\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of CascadeButton and its associated resources, see \fBXmCascadeButton\fP(3)\&. .SH "RETURN" .PP Returns the CascadeButton widget ID\&. .SH "RELATED" .PP \fBXmCascadeButton\fP(3), \fBXmCreateCascadeButton\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmFontListCreate.30000644000175000017500000000433612672140200015220 00000000000000'\" t ...\" FontLstJ.sgm /main/8 1996/09/08 20:43:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListCreate" "library call" .SH "NAME" \fBXmFontListCreate\fP \(em A font list function that creates a font list .iX "XmFontListCreate" .iX "font list functions" "XmFontListCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmFontList \fBXmFontListCreate\fP\fR( \fBXFontStruct \fB* font\fR\fR, \fBXmStringCharSet \fBcharset\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListCreate\fP creates a new font list with a single element specified by the provided font and character set\&. It also allocates the space for the font list\&. .PP \fBNOTE:\fP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmFontListAppendEntry\fP\&. .IP "\fIfont\fP" 10 Specifies a pointer to a font structure for which the new font list is generated\&. This is the structure returned by the XLib \fBXLoadQueryFont\fP function\&. .IP "\fIcharset\fP" 10 Specifies the character set identifier for the font\&. This can be \fBXmSTRING_DEFAULT_CHARSET\fP, but this value does not comply with the AES, and it may be removed in future versions of Motif\&. If the value is \fBXmSTRING_DEFAULT_CHARSET\fP, the routine derives the character set from the current language environment\&. .SH "RETURN" .PP Returns NULL if \fIfont\fP or \fIcharset\fP is NULL; otherwise, returns a new font list\&. .SH "RELATED" .PP \fBXmFontList\fP(3) and \fBXmFontListAppendEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmTextFieldShowPosition.30000644000175000017500000000366512672140200016614 00000000000000'\" t ...\" TxtFieBH.sgm /main/8 1996/09/08 21:16:10 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldShowPosition" "library call" .SH "NAME" \fBXmTextFieldShowPosition\fP \(em A TextField function that forces text at a given position to be displayed .iX "XmTextFieldShowPosition" .iX "TextField functions" "XmTextFieldShowPosition" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldShowPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldShowPosition\fP forces text at the specified position to be displayed\&. The cursor position is not updated nor is the cursor shown at this position\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIposition\fP" 10 Specifies the character position to be displayed\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. See \fBXmTextPosition\fP(3) for details on the \fBXmTextPosition\fR data type\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextPosition\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmTextFieldSetMaxLength.30000644000175000017500000000412112672140200016476 00000000000000'\" t ...\" TxtFieBD.sgm /main/8 1996/09/08 21:15:38 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetMaxLength" "library call" .SH "NAME" \fBXmTextFieldSetMaxLength\fP \(em A TextField function that sets the value of the current maximum allowable length of a text string entered from the keyboard .iX "XmTextFieldSetMaxLength" .iX "TextField functions" "XmTextFieldSetMaxLength" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetMaxLength\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBmax_length\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetMaxLength\fP sets the value of the current maximum allowable length of the text string in the TextField widget\&. The maximum allowable length prevents the user from entering a text string from the keyboard that is larger than this limit\&. Strings that are entered using the \fBXmNvalue\fP (or \fBXmNvalueWcs\fP) resource, or the \fBXmTextFieldSetString\fP (or \fBXmTextFieldSetStringWcs\fP) function ignore this resource\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fImax_length\fP" 10 Specifies the maximum allowable length of the text string .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3), \fBXmTextFieldSetString\fP(3), and \fBXmTextFieldSetStringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmColorSelector.30000644000175000017500000001076412672140200015113 00000000000000.DT .TH XmColorSelector 3X "" .SH NAME The Color Selector widget .SH SYNOPSIS #include .SH DESCRIPTION .PP .TS tab(%); l l. .TE .PP The Color Selector widget allows users to choose a color by using either a set of RGB sliders or choosing from a list of all colors available in the rgb database. The name or rgb value, as well as the color selected, are dynamically displayed to the user as they pick and choose different colors. .PP .SH Normal Resources .PP .TS tab (%); l l l l. Name%Class%Type%Initial Value blueSliderLabel%SliderLabel%XmString%"Blue" colorListTogLabel%TogLabel%XmString%"Color List" colorMode%ColorMode%XiColorMode%XmScaleMode colorName%String%String%White fileReadError%FileReadError%XmString%"Could not read %%% RGB.txt file" greenSliderLabel%SliderLabel%XmString%"Green" marginHeight%MarginHeight%VerticalDimension%2 marginWidth%MarginWidth%HorizontalDimension%2 noCellError%NoCellError%XmString%"No Color Cell %%% Available" redSliderLabel%SliderLabel%XmString%"Red" rgbFile%String%String%/usr/lib/X11/rgb.txt sliderTogLabel%TogLabel%XmString%"Color Sliders" .TE .PP All resource names begin with XmN and all resource class names begin with XmC. .SH blueSliderLabel .PP The string appearing for the label of the blue slider .PP .SH colorListTogLabel .PP The string appearing for the label of the color list toggle .PP .SH colorMode .PP The color list can be used in either slider or list mode. Acceptable values are XmListMode and XmScaleMode. This resource allows the application to determine the mode that the color selector should use when it is created. After this point, the user may freely change modes by utilizing a pair of radio buttons in the color selector. A type converter is registered to convert the strings "ScaleMode" and "ListMode" to color modes for use with the resource database. .PP .SH colorName .PP This resource controls the color name that is currently displayed to the user. This value can be modified to change the color displayed in the color selector or queried to find the color the user has selected. The string returned here is either a color name or a pound sign (#) followed by a set of rgb values as specified in the Xlib specification. .PP .SH fileReadError .PP The message which is displayed when the Color Selector cannot read the rgb.txt file. The message is displayed at the top of the window in which the color list would normally appear. .PP .SH greenSliderLabel .PP The string appearing for the label of the green slider .PP .SH marginHeight .PP .SH marginWidth .PP This is the amount of space left between each of the children in the color selector and between the outside children and the edge of the color selector widget. .PP .SH noCellError .PP This resource controls the message which is displayed in the sample color field when the Color Selector cannot allocate a read/write color cell .PP .SH redSliderLabel .PP The string appearing for the label of the red slider .PP .SH rgbFile This is the name of the file to be loaded, which contains the valid color names. Each of these names is sorted and the duplicates removed before being shown to the user. .PP .SH sliderTogLabel .PP The string appearing for the label of the color slider toggle .PP .SH Convenience Routine .PP .SH .HP 5 .SH XmCreateColorSelector - Widget creation convenience routine .nf Widget XmCreateColorSelector( Widget parent, /* Widget id of parent for ColorSelector */ String name, /* Name of the created widget */ ArgList args, /* argument list */ Cardinal num_args /* number of items in argument list */ ) .nf .PP .SH Children .PP The color selector is composed of many sub-widgets. As with all widgets, most values are passed to this widget through the argument list at creation time or via set values and are passed to each of this widget's children, although get values requests must be made on a child-by-child basis. The children of the color selector are listed below. The documentation for each of the children should be consulted for a list of resources for each child. .ta 5,10,15,20,25,30,35 .df XmColorSelector XmScrolledWindow scrolled XmScrollBar ListvScrollBar XmScrollBar ListhScrollBar XmList list XmButtonBox buttonBox XmScale scale XmLabelGadget scale_title XmScrollBar scale_scrollbar XmRowColumn radioBox XmToggleButton colorListToggle XmToggleButton colorSlidersToggle XmFrame colorFrame XmLabel colorWindow .fi .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmScale.30000644000175000017500000010016212672140200013353 00000000000000'\" t ...\" Scale.sgm /main/13 1996/09/30 13:14:06 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScale" "library call" .SH "NAME" \fBXmScale\fP \(em The Scale widget class .iX "XmScale" .iX "widget class" "Scale" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Scale is used by an application to indicate a value from within a range of values, and it allows the user to input or modify a value from the same range\&. .PP A Scale has an elongated rectangular region similar to a ScrollBar\&. A slider inside this region indicates the current value along the Scale\&. The user can also modify the Scale\&'s value by moving the slider within the rectangular region of the Scale\&. A Scale can also include a label set located outside the Scale region\&. These can indicate the relative value at various positions along the scale\&. The placement of this label depends on the \fBXmNlayoutDirection\fP resource of the widget\&. .PP A Scale can be either input/output or output only\&. An input/output Scale\&'s value can be set by the application and also modified by the user with the slider\&. An output-only Scale is used strictly as an indicator of the current value of something and cannot be modified interactively by the user\&. The \fBXmScale\fP resource \fBXmNeditable\fP specifies whether the user can interactively modify the Scale\&'s value\&. .PP The user can specify resources in a resource file for the automatically created gadget that contains the title of the Scale widget\&. The name of the gadget is \fBTitle\fP\&. The placement of the title depends on the \fBXmNlayoutDirection\fP resource of the widget\&. The direction of the title is based on the widget\&'s layout direction\&. .PP Scale uses the \fBXmQTspecifyRenderTable\fP trait, and holds the \fBXmQTtransfer\fP trait\&. .SS "Data Transfer Behavior" .PP Scale supports dragging of the representation of the Scale value from the Scale when the value is displayed and when the value of the \fBXmNenableUnselectableDrag\fP resource of \fBXmDisplay\fP is set to True\&. .PP As a source of data, Scale supports the following targets and associated conversions of data to these targets: .IP "\fBCOMPOUND_TEXT\fP" 10 The widget transfers a string representation of \fBXmNvalue\fP as type \fBCOMPOUND_TEXT\fP\&. .IP "\fBUTF8_STRING\fP" 10 The widget transfers a string representation of \fBXmNvalue\fP as type \fBUTF8_STRING\fP\&. .IP "\fBSTRING\fP" 10 The widget transfers a string representation of \fBXmNvalue\fP as type \fBSTRING\fP\&. .IP "\fB_MOTIF_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for the \fBCLIPBOARD\fP selection\&. These include \fBSTRING\fP, \fBCOMPOUND_TEXT\fP and \fBUTF8_STRING\fP\&. .IP "\fB_MOTIF_EXPORT_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to be used as the value of the DragContext\&'s \fBXmNexportTargets\fP in a drag-and-drop transfer\&. These include \fBSTRING\fP, \fBCOMPOUND_TEXT\fP and \fBUTF8_STRING\fP\&. .PP As a source of data, Scale also supports the following standard Motif targets: .IP "\fBBACKGROUND\fP" 10 The widget transfers \fBXmNbackground\fP as type \fBPIXEL\fP\&. .IP "\fBCLASS\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_CLASS\fP property and transfers the contents as text in the current locale\&. .IP "\fBCLIENT_WINDOW\fP" 10 The widget finds the first shell in the widget hierarchy and transfers its window as type \fBWINDOW\fP\&. .IP "\fBCOLORMAP\fP" 10 The widget transfers \fBXmNcolormap\fP as type \fBCOLORMAP\fP\&. .IP "\fBFOREGROUND\fP" 10 The widget transfers \fBXmNforeground\fP as type \fBPIXEL\fP\&. .IP "\fBNAME\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_NAME\fP property and transfers the contents as text in the current locale\&. .IP "\fBTARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports\&. These include the standard targets in this list\&. These also include \fBSTRING\fP, \fBCOMPOUND_TEXT\fP and \fBUTF8_STRING\fP\&. .IP "\fBTIMESTAMP\fP" 10 The widget transfers the timestamp used to acquire the selection as type \fBINTEGER\fP\&. .IP "\fB_MOTIF_RENDER_TABLE\fP" 10 The widget transfers \fBXmNrenderTable\fP if it exists, or else the default text render table, as type \fBSTRING\fP\&. .IP "\fB_MOTIF_ENCODING_REGISTRY\fP" 10 The widget transfers its encoding registry as type \fBSTRING\fP\&. The value is a list of NULL separated items in the form of tag encoding pairs\&. This target symbolizes the transfer target for the Motif Segment Encoding Registry\&. Widgets and applications can use this Registry to register text encoding formats for specified render table tags\&. Applications access this Registry by calling \fBXmRegisterSegmentEncoding\fP and \fBXmMapSegmentEncoding\fP\&. .SS "Descendants" .PP Scale automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBScrollbar\fP\fBXmScrollBar\fPscroll bar ___ \fBTitle\fP\fBXmLabelGadget\fPtitle of scale ___ .TE .SS "Classes" .PP Scale inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmScaleWidgetClass\fP\&. .PP The class name is \fBXmScale\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmScale Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNdecimalPointsXmCDecimalPointsshort0CSG _____ XmNdragCallbackXmCCallbackXtCallbackListNULLC _____ XmNeditableXmCEditableBooleanTrueCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNmaximumXmCMaximumint100CSG _____ XmNminimumXmCMinimumint0CSG _____ XmNorientationXmCOrientationunsigned charXmVERTICALCSG _____ XmNprocessingDirectionXmCProcessingDirectionunsigned chardynamicCSG _____ XmNscaleHeightXmCScaleHeightDimension0CSG _____ XmNscaleMultipleXmCScaleMultipleintdynamicCSG _____ XmNscaleWidthXmCScaleWidthDimension0CSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNshowArrowsXmCShowArrowsXtEnumXmNONECSG _____ XmNshowValueXmCShowValueXtEnumXmNONECSG _____ XmNsliderMarkXmCSliderMarkXtEnumdynamicCSG _____ XmNsliderVisualXmCSliderVisualXtEnumdynamicCSG _____ XmNslidingModeXmCSlidingModeXtEnumXmSLIDERCSG _____ XmNtitleStringXmCTitleStringXmStringNULLCSG _____ XmNvalueXmCValueintdynamicCSG _____ XmNvalueChangedCallbackXmCCallbackXtCallbackListNULLC _____ .TE .IP "\fBXmNconvertCallback\fP" 10 Specifies a list of callbacks called when the Scale is asked to convert a selection\&. The type of the structure whose address is passed to these callbacks is \fBXmConvertCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNdecimalPoints\fP" 10 Specifies the number of decimal points to shift the slider value when displaying it\&. For example, a slider value of 2,350 and an \fBXmdecimalPoints\fP value of 2 results in a display value of 23\&.50\&. The value must not be negative\&. .IP "\fBXmNdragCallback\fP" 10 Specifies the list of callbacks that is called when the slider position changes as the slider is being dragged\&. The reason sent by the callback is \fBXmCR_DRAG\fP\&. .IP "\fBXmNeditable\fP" 10 Specifies how the Scale scrollbar will react to user input\&. This resource can be True or False values, as follows: .RS .IP "\fBTrue\fP" 10 Allows the scrollbar to be sensitive to user input\&. This is the default value\&. .IP "\fBFalse\fP" 10 Makes the Scale scrollbar insensitive to user input\&. The visual is not greyed out\&. This value would mostly be used in \fBXmTHERMOMETER\fP mode\&. .RE .IP "" 10 When \fBXmNeditable\fP is used on a widget it sets the dropsite to \fBXmDROP_SITE_ACTIVE\fP\&. .IP "\fBXmNfontList\fP" 10 Specifies the font list to use for the title text string specified by \fBXmNtitleString\fP, and the label displayed when \fBXmNshowValue\fP is True\&. The font list is an obsolete structure, and is retained only for compatibility with earlier releases of Motif\&. See the \fBXmNrenderTable\fP resource\&. .IP "\fBXmNhighlightOnEnter\fP" 10 Specifies whether the highlighting rectangle is drawn when the cursor moves into the widget\&. If the shell\&'s focus policy is \fBXmEXPLICIT\fP, this resource is ignored, and the widget is highlighted when it has the focus\&. If the shell\&'s focus policy is \fBXmPOINTER\fP and if this resource is True, the highlighting rectangle is drawn when the the cursor moves into the widget\&. If the shell\&'s focus policy is \fBXmPOINTER\fP and if this resource is False, the highlighting rectangle is not drawn when the the cursor moves into the widget\&. The default is False\&. .IP "\fBXmNhighlightThickness\fP" 10 Specifies the size of the slider\&'s border drawing rectangle used for enter window and traversal highlight drawing\&. .IP "\fBXmNmaximum\fP" 10 Specifies the slider\&'s maximum value\&. \fBXmNmaximum\fP must be greater than \fBXmNminimum\fP\&. .IP "\fBXmNminimum\fP" 10 Specifies the slider\&'s minimum value\&. \fBXmNmaximum\fP must be greater than \fBXmNminimum\fP\&. .IP "\fBXmNorientation\fP" 10 Displays Scale vertically or horizontally\&. This resource can have values of \fBXmVERTICAL\fP and \fBXmHORIZONTAL\fP\&. .IP "\fBXmNprocessingDirection\fP" 10 Specifies whether the value for \fBXmNmaximum\fP is on the right or left side of \fBXmNminimum\fP for horizontal Scales or above or below \fBXmNminimum\fP for vertical Scales\&. This resource can have values of \fBXmMAX_ON_TOP, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT\fP, and \fBXmMAX_ON_RIGHT\fP\&. If the Scale is oriented vertically, the default value is \fBXmMAX_ON_TOP\fP\&. If the XmScale is oriented horizontally, the default value depends on the \fBXmNlayoutDirection\fP resource of the widget\&. .IP "\fBXmNrenderTable\fP" 10 Specifies the render table to use for the title text string specified by \fBXmNtitleString\fP, and the label displayed when \fBXmNshowValue\fP is True\&. If this value is NULL at initialization, the parent hierarchy is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the render table is initialized to the \fBXmLABEL_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. If a font list (\fBXmNfontList\fP) and a render table are both specified, the render table will take precedence\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNscaleHeight\fP" 10 Specifies the height of the slider area\&. The value should be in the specified unit type (the default is pixels)\&. If no value is specified a default height is computed\&. .IP "\fBXmNscaleMultiple\fP" 10 Specifies the amount to move the slider when the user takes an action that moves the slider by a multiple increment\&. The default is (\fBXmNmaximum\fP - \fBXmNminimum\fP) divided by 10, with a minimum of 1\&. .IP "\fBXmNscaleWidth\fP" 10 Specifies the width of the slider area\&. The value should be in the specified unit type (the default is pixels)\&. If no value is specified a default width is computed\&. .IP "\fBXmNshowArrows\fP" 10 Specifies whether the arrows are displayed and how they are to be displayed\&. This resource can take the following values: .RS .IP "\fBXmEACH_SIDE\fP" 10 Indicates that one arrow is displayed on each end of the ScrollBar slider\&. .IP "\fBXmMAX_SIDE\fP" 10 Indicates that one arrow is displayed on the \fBXmNmaximum\fP side of the ScrollBar slider\&. .IP "\fBXmMIN_SIDE\fP" 10 Indicates that one arrow is displayed on the \fBXmNminimum\fP side of the ScrollBar slider\&. .IP "\fBXmNONE\fP" 10 Indicates that no arrows are displayed\&. .RE .IP "" 10 \fBXmNONE\fP is the default value\&. .IP "\fBXmNshowValue\fP" 10 Specifies whether a label for the current slider value should be displayed next to the slider\&. If the value is \fBXmNEAR_SLIDER\fP, the current slider value is displayed\&. If the value is \fBXmNONE\fP, no slider value is displayed\&. If the value is \fBXmNEAR_BORDER\fP, the current slider value is displayed near the border\&. .IP "\fBXmNsliderMark\fP" 10 Specifies the shape the slider is to be displayed in\&. This resource can take the following values: .RS .IP "\fBXmETCHED_LINE\fP" 10 Specifies the slider as an etched line\&. This is the default when \fBXmNslidingMode\fP is \fBXmSLIDER\fP\&. .IP "\fBXmNONE\fP" 10 Specifies the slider as a foregrounded rectangle\&. This is the default when \fBXmNslidingMode\fP is \fBXmTHERMOMETER\fP and the Scale scrollbar is insensitive to user input (\fBXmNeditable\fP is \fBFalse\fP\&. .IP "\fBXmROUND_MARK\fP" 10 Specifies the slider as a shadowed circle\&. This is the default when \fBXmNslidingMode\fP is \fBXmTHERMOMETER\fP and the Scale scrollbar is sensitive to user input (\fBXmNeditable\fP is \fBTrue\fP\&. .IP "\fBXmTHUMB_MARK\fP" 10 Specifies the slider as a series of three etched lines centered in the middle of the slider\&. .RE .IP "\fBXmNslidingMode\fP" 10 Specifies the mode the slider works in\&. There are two possible modes: .RS .IP "\fBXmSLIDER\fP" 10 Allows the slider to move freely between the minimum and maximum ends of the scale\&. This is the default value\&. .IP "\fBXmTHERMOMETER\fP" 10 Forces the slider to be anchored to one side of the trough area\&. .RE .IP "\fBXmNsliderVisual\fP" 10 Specifies the color of the slider visual\&. This resource can take the following values: .RS .IP "\fBXmBACKGROUND_COLOR\fP" 10 Specifies that the slider visual is in the background color\&. .IP "\fBXmFOREGROUND_COLOR\fP" 10 Specifies that the slider visual is in the foreground color\&. .IP "\fBXmSHADOWED_BACKGROUND\fP" 10 Specifies that the slider visual is in the background color, with a shadow\&. This is the default when the \fBXmNslidingModel\fP resource is \fBXmSLIDER\fP\&. .IP "\fBXmTROUGH_COLOR\fP" 10 Specifies that the slider visual is in the trough color\&. This is the default when the \fBXmNslidingModel\fP resource is \fBXmTHERMOMETER\fP\&. .RE .IP "\fBXmNtitleString\fP" 10 Specifies the title text string to appear in the Scale widget window\&. .IP "\fBXmNvalue\fP" 10 Specifies the slider\&'s current position along the scale, between \fBXmNminimum\fP and \fBXmNmaximum\fP\&. The value is constrained to be within these inclusive bounds\&. The initial value of this resource is the larger of 0 (zero) and \fBXmNminimum\fP\&. .IP "\fBXmNvalueChangedCallback\fP" 10 Specifies the list of callbacks that is called when the value of the slider has changed\&. The reason sent by the callback is \fBXmCR_VALUE_CHANGED\fP\&. .SS "Inherited Resources" .PP Scale inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to the \fBXmNdragCallback\fP and \fBXmNvalueChangedCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIvalue\fP; } XmScaleCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fIvalue\fP" 10 Is the new slider value .PP A pointer to the following structure is passed to the \fBXmNconvertCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; Atom \fItarget\fP; XtPointer \fIsource_data\fP; XtPointer \fIlocation_data\fP; int \fIflags\fP; XtPointer \fIparm\fP; int \fIparm_format\fP; unsigned long \fIparm_length\fP; int \fIstatus\fP; XtPointer \fIvalue\fP; Atom \fItype\fP; int \fIformat\fP; unsigned long \fIlength\fP; } XmConvertCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which conversion is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fItarget\fP" 10 Indicates the conversion target\&. .IP "\fIsource_data\fP" 10 Contains information about the selection source\&. When the selection is \fB_MOTIF_DROP\fP, \fIsource_data\fP is the DragContext\&. Otherwise, it is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location of data to be converted\&. If the value is NULL, the data to be transferred consists of the widget\&'s current selection\&. .IP "\fIflags\fP" 10 Indicates the status of the conversion\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 This flag is currently unused\&. .IP "\fBXmCONVERTING_PARTIAL\fP" 10 The target widget was able to be converted, but some data was lost\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The conversion target is the source of the data to be transferred\&. .IP "\fBXmCONVERTING_TRANSACT\fP" 10 This flag is currently unused\&. .RE .IP "\fIparm\fP" 10 Contains parameter data for this target\&. If no parameter data exists, the value is NULL\&. .IP "" 10 When \fIselection\fP is \fBCLIPBOARD\fP and \fItarget\fP is \fB_MOTIF_CLIPBOARD_TARGETS\fP or \fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP, the value is the requested operation (\fBXmCOPY\fP, \fBXmMOVE\fP, or \fBXmLINK\fP)\&. .IP "\fIparm_format\fP" 10 Specifies whether the data in \fIparm\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. Possible values are 0 (when \fIparm\fP is NULL), 8 (when the data in \fIparm\fP should be viewed as a list of \fIchar\fPs), 16 (when the data in \fIparm\fP should be viewed as a list of \fIshort\fPs), or 32 (when the data in \fIparm\fP should be viewed as a list of \fIlong\fPs)\&. Note that \fIparm_format\fP symbolizes a data type, not the number of bits in each list element\&. For example, on some machines, a \fIparm_format\fP of 32 means that the data in \fIparm\fP should be viewed as a list of 64-bit quantities, not 32-bit quantities\&. .IP "\fIparm_length\fP" 10 Specifies the number of elements of data in \fIparm\fP, where each element has the size specified by \fIparm_format\fP\&. When \fIparm\fP is NULL, the value is 0\&. .IP "\fIstatus\fP" 10 An IN/OUT member that specifies the status of the conversion\&. The initial value is \fBXmCONVERT_DEFAULT\fP\&. The callback procedure can set this member to one of the following values: .RS .IP "\fBXmCONVERT_DEFAULT\fP" 10 This value means that the widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it overwrites the data provided by the callback procedures in the \fIvalue\fP member\&. .IP "\fBXmCONVERT_MERGE\fP" 10 This value means that the widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it appends its data to the data provided by the callback procedures in the \fIvalue\fP member\&. This value is intended for use with targets that result in lists of data, such as \fBTARGETS\fP\&. .IP "\fBXmCONVERT_DONE\fP" 10 This value means that the callback procedure has successfully finished the conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .IP "\fBXmCONVERT_REFUSE\fP" 10 This value means that the callback procedure has terminated the conversion process without completing the requested conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .RE .IP "\fIvalue\fP" 10 An IN/OUT parameter that contains any data that the callback procedure produces as a result of the conversion\&. The initial value is NULL\&. If the callback procedure sets this member, it must ensure that the \fItype\fP, \fIformat\fP, and \fIlength\fP members correspond to the data in \fIvalue\fP\&. The callback procedure is responsible for allocating, but not for freeing, memory when it sets this member\&. .IP "\fItype\fP" 10 An IN/OUT parameter that indicates the type of the data in the \fIvalue\fP member\&. The initial value is \fBINTEGER\fP\&. .IP "\fIformat\fP" 10 An IN/OUT parameter that specifies whether the data in \fIvalue\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. The initial value is 8\&. The callback procedure can set this member to 8 (for a list of \fIchar\fP), 16 (for a list of \fIshort\fP), or 32 (for a list of \fIlong\fP)\&. .IP "\fIlength\fP" 10 An IN/OUT member that specifies the number of elements of data in \fIvalue\fP, where each element has the size symbolized by \fIformat\fP\&. The initial value is 0\&. .SS "Behavior" .PP XmScale has the following behavior: .IP "\fB\fP\ or\ \fB\fP:" 10 \fBIn the region between an end of the Scale and the slider\fP: Moves the slider by one multiple increment in the direction of the end of the Scale and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement toward the right or bottom increments the Scale value, and movement toward the left or top decrements the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement toward the right or bottom decrements the Scale value, and movement toward the left or top increments the Scale value\&. If the button is held down longer than a delay period, the slider is moved again by the same increment and the same callbacks are called\&. .IP "" 10 \fBIn slider:\fP Activates the interactive dragging of the slider\&. .IP "\fB\fP\ in\ value\ label:" 10 Drags the contents of the label showing the current slider value\&. This action sets the \fBXmNconvertProc\fP of the DragContext to a function that calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fB_MOTIF_DROP\fP selection\&. .IP "\fB\fP\ or\ \fB\fP:" 10 If the button press occurs within the slider, the subsequent motion events move the slider to the position of the pointer and call the callbacks for \fBXmNdragCallback\fP\&. .IP "\fB\fP\ or\ \fB\fP:" 10 If the button press occurs within the slider and the slider position is changed, the callbacks for \fBXmNvalueChangedCallback\fP are called\&. .IP "\fB\fP\fB\fP:" 10 \fBIn the region between an end of the Scale and the slider\fP: Moves the slider to that end of the Scale and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement toward the right or bottom increments the Scale value, and movement toward the left or top decrements the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement toward the right or bottom decrements the Scale value, and movement toward the left or top increments the Scale value\&. .IP "\fB\fP\fB\fP:" 10 For vertical Scales, moves the slider up one increment and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_TOP\fP, movement toward the top increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_BOTTOM\fP, movement toward the top decrements the Scale value\&. .IP "\fB\fP\fB\fP:" 10 For vertical Scales, moves the slider down one increment and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_BOTTOM\fP, movement toward the bottom increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_TOP\fP, movement toward the bottom decrements the Scale value\&. .IP "\fB\fP\fB\fP:" 10 For horizontal Scales, moves the slider one increment to the left and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP, movement toward the left increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP, movement toward the left decrements the Scale value\&. .IP "\fB\fP\fB\fP:" 10 For horizontal Scales, moves the slider one increment to the right and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP, movement toward the right increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP, movement toward the right decrements the Scale value\&. .IP "\fB\fP\fB\fP\fB\fP\ or\ \fB\fP\fB\fP:" 10 For vertical Scales, moves the slider up one multiple increment and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_TOP\fP, movement toward the top increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_BOTTOM\fP, movement toward the top decrements the Scale value\&. .IP "\fB\fP\fB\fP\fB\fP\ or\ \fB\fP\fB\fP:" 10 For vertical Scales, moves the slider down one multiple increment and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_BOTTOM\fP, movement toward the bottom increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_TOP\fP, movement toward the bottom decrements the Scale value\&. .IP "\fB\fP\fB\fP\fB\fP\ or\ \fB\fP\fB\fP:" 10 For horizontal Scales, moves the slider one multiple increment to the left and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP, movement toward the left increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP, movement toward the left decrements the Scale value\&. .IP "\fB\fP\fB\fP\fB\fP\ or\ \fB\fP\fB\fP:" 10 For horizontal Scales, moves the slider one multiple increment to the right and calls the \fBXmNvalueChangedCallback\fP callbacks\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP, movement toward the right increments the Scale value\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP, movement toward the right decrements the Scale value\&. .IP "\fB\fP\fB\fP\ or\ \fB\fP\fB\fP:" 10 Moves the slider to the minimum value and calls the \fBXmNvalueChangedCallback\fP callbacks\&. .IP "\fB\fP\fB\fP\ or\ \fB\fP\fB\fP:" 10 Moves the slider to the maximum value and calls the \fBXmNvalueChangedCallback\fP callbacks\&. .IP "\fB\fP\fB\fP:" 10 Traverses to the first item in the next tab group\&. If the current tab group is the last entry in the tab group list, it wraps to the beginning of the tab group list\&. .IP "\fB\fP\fB\fP:" 10 Traverses to the first item in the previous tab group\&. If the beginning of the tab group list is reached, it wraps to the end of the tab group list\&. .IP "\fB\fP\fB\fP:" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateScale\fP(3), \fBXmManager\fP(3), \fBXmScaleGetValue\fP(3), \fBXmScaleSetValue\fP(3), \fBXmVaCreateScale\fP(3), and \fBXmVaCreateManagedScale\fP(3)\&. motif-2.3.8/doc/man/man3/XmTabList.30000644000175000017500000000554312672140200013675 00000000000000'\" t ...\" TabList.sgm /main/8 1996/09/08 21:08:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabList" "library call" .SH "NAME" \fBXmTabList\fR \(em Data type for a tab list .iX "XmTabList" .SH "SYNOPSIS" .PP .nf #include XmTabList .fi .SH "DESCRIPTION" .PP \fBXmTabList\fR is the data type for a tab list\&. A tab list consists of tab stop list entries (\fBXmTab\fRs)\&. Whenever a tab component is encountered while an \fBXmString\fR is being rendered, the origin of the next X draw depends on the next \fBXmTab\fR\&. If a tab stop would cause text to overlap, the x position for the segment is reset to follow immediately after the end of the previous segment\&. .PP Tab lists are specified in resource files with the following syntax: .PP .nf \fIresource_spec\fP\fB:\fP \fItab\fP WHITESPACE [, WHITESPACE \fItab\fP ]* .fi .PP The resource value string consists of one or more tabs separated by commas\&. Each \fItab\fP identifies the value of the tab, the unit type, and whether the offset is relative or absolute\&. For example: .PP .nf \fItab\fP := \fIfloat\fP [ WHITESPACE \fIunits\fP ] \fIfloat\fP := [ \fIsign\fP ] [[ DIGIT]*\&. ]DIGIT+ \fIsign\fP := + .fi .PP where the presence or absence of \fIsign\fP indicates, respectively, a relative offset or an absolute offset\&. Note that negative tab values are not allowed\&. \fIunits\fP indicates the unitType to use as described in the \fBXmConvertUnits\fP reference page\&. .PP For example, the following specifies a tab list consisting of a one inch absolute tab followed by a one inch relative tab: .PP .nf \f(CW*tabList: 1in, +1in\fR .fi .PP .PP For resources of type, dimension, or position, you can specify units as described in the \fBXmNunitType\fP resource of the \fBXmGadget\fP, \fBXmManager\fP, or \fBXmPrimitive\fP reference page\&. .SH "RELATED" .PP Refer to the \fIMotif Programmer\&'s Guide\fP for more information about tabs and tab lists\&. \fBXmTabListCopy\fP(3), \fBXmTabListFree\fP(3), \fBXmTabListGetTab\fP(3), \fBXmTabListInsertTabs\fP(3), \fBXmTabListRemoveTabs\fP(3), \fBXmTabListReplacePositions\fP(3), and \fBXmTabListTabCount\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmTextFieldGetMaxLength.30000644000175000017500000000375312672140200016474 00000000000000'\" t ...\" TxtFieAJ.sgm /main/8 1996/09/08 21:13:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetMaxLength" "library call" .SH "NAME" \fBXmTextFieldGetMaxLength\fP \(em A TextField function that accesses the value of the current maximum allowable length of a text string entered from the keyboard .iX "XmTextFieldGetMaxLength" .iX "TextField functions" "XmTextFieldGetMaxLength" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextFieldGetMaxLength\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetMaxLength\fP accesses the value of the current maximum allowable length of the text string in the TextField widget entered from the keyboard\&. The maximum allowable length prevents the user from entering a text string larger than this limit\&. Note that the maximum allowable length is the same as the value of the widget\&'s \fBXmNmaxLength\fP resource\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns the integer value that indicates the string\&'s maximum allowable length that can be entered from the keyboard\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmStringNCopy.30000644000175000017500000000426112672140200014546 00000000000000'\" t ...\" StrNCB.sgm /main/8 1996/09/08 21:06:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringNCopy" "library call" .SH "NAME" \fBXmStringNCopy\fP \(em A compound string function that creates a copy of a compound string .iX "XmStringNCopy" .iX "compound string functions" "XmStringNCopy" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringNCopy\fP\fR( \fBXmString \fBs1\fR\fR, \fBint \fBnum_bytes\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. \fBXmStringNCopy\fP creates a copy of \fIs1\fP that contains a specified number of bytes, including tags, directional indicators, and separators\&. It then returns the resulting compound string\&. The original strings are preserved\&. The function allocates space for the resulting compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fIs1\fP" 10 Specifies the compound string\&. .IP "\fInum_bytes\fP" 10 Specifies the number of bytes of \fIs1\fP to copy\&. If this value is less than the length of \fIs1\fP, as many bytes as possible, but possibly fewer than this value, will be appended to \fIs1\fP such that the resulting string is still a valid compound string\&. .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmCreatePromptDialog.30000644000175000017500000000526112672140200016055 00000000000000'\" t ...\" CrePro.sgm /main/10 1996/09/08 20:34:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreatePromptDialog" "library call" .SH "NAME" \fBXmCreatePromptDialog\fP \(em The SelectionBox PromptDialog convenience creation function .iX "XmCreatePromptDialog" .iX "creation functions" "XmCreatePromptDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreatePromptDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreatePromptDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged SelectionBox child of the DialogShell\&. A PromptDialog prompts the user for text input\&. It includes a message, a text input region, and three managed buttons\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. An additional button, with \fBApply\fP as the default label, is created unmanaged; it may be explicitly managed if needed\&. One additional \fBWorkArea\fP child may be added to the SelectionBox after creation\&. .PP \fBXmCreatePromptDialog\fP forces the value of the SelectionBox resource \fBXmNdialogType\fP to \fBXmDIALOG_PROMPT\fP\&. .PP Use \fBXtManageChild\fP to pop up the PromptDialog (passing the SelectionBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreatePromptDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of SelectionBox and its associated resources, see \fBXmSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the SelectionBox widget ID\&. .SH "RELATED" .PP \fBXmSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmStringCopy.30000644000175000017500000000302112672140200014421 00000000000000'\" t ...\" StrCop.sgm /main/7 1996/08/30 16:08:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringCopy" "library call" .SH "NAME" \fBXmStringCopy\fP \(em A compound string function that makes a copy of a string .iX "XmStringCopy" .iX "compound string functions" "XmStringCopy" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringCopy\fP\fR( \fBXmString \fBs1\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringCopy\fP makes a copy of an existing compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .IP "\fIs1\fP" 10 Specifies the compound string to be copied .SH "RETURN" .PP Returns a compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmImMbLookupString.30000644000175000017500000000745712672140200015546 00000000000000'\" t ...\" ImMbLook.sgm /main/8 1996/09/08 20:47:50 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImMbLookupString" "library call" .SH "NAME" \fBXmImMbLookupString\fP \(em An input manager function that retrieves a composed string from an input method .iX "XmImMbLookupString" .iX "input manager functions" "XmImMbLookupString" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmImMbLookupString\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXKeyPressedEvent *\fBevent\fR\fR, \fBchar *\fBbuffer_return\fR\fR, \fBint \fBbytes_buffer\fR\fR, \fBKeySym *\fBkeysym_return\fR\fR, \fBint *\fBstatus_return\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImMbLookupString\fP returns a string composed in the locale associated with the widget\&'s input method and a KeySym that is currently mapped to the keycode in a KeyPress event\&. The KeySym is obtained by using the standard interpretation of Shift, Lock and Group modifiers as defined in the X Protocol specification\&. .PP An XIM will be created, but an XIC will not be created\&. One of the functions, \fBXmImSetValues\fP, \fBXmImVaSetValues\fP, or \fBXmImGetXIC\fP, needs to be called to create an XIC\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget registered with the input manager .IP "\fIevent\fP" 10 Specifies the key press event .IP "\fIbuffer_return\fP" 10 Specifies the buffer in which the string is returned .IP "\fIbytes_buffer\fP" 10 Specifies the size of the buffer in bytes .IP "\fIkeysym_return\fP" 10 Specifies a pointer to the KeySym returned if one exists .IP "\fIstatus_return\fP" 10 Specifies the status values returned by the function\&. These status values are the same as those for the \fBXmbLookupString\fP function\&. The possible status values are: .RS .IP "\fBXBufferOverflow\fP" 10 The size of the buffer was insufficient to handle the returned string\&. The contents of \fIbuffer_return\fP and \fIkeysym_return\fP are not modified\&. The required buffer size is returned as a value of the function\&. The client should repeat the call with a larger buffer size to receive the string\&. .IP "\fBXLookupNone\fP" 10 No consistent input was composed\&. The contents of \fIbuffer_return\fP and \fIkeysym_return\fP are not modified and the function returns a value of 0\&. .IP "\fBXLookupChars\fP" 10 Some input characters were composed and returned in \fIbuffer_return\fP\&. The content of \fIkeysym_return\fP is not modified\&. The function returns the length of the string in bytes\&. .IP "\fBXLookupKeysym\fP" 10 A keysym value was returned instead of a string\&. The content of \fIbuffer_return\fP is not modified and the function returns a value of 0\&. .IP "\fBXLookupBoth\fP" 10 A keysym value and a string were returned\&. The keysym value may not necessarily correspond to the string returned\&. The function returns the length of the string in bytes\&. .RE .SH "RETURN" .PP Return values depend on the status returned by the function\&. Refer to the description of status values above\&. .SH "RELATED" .PP \fBXmImGetXIM\fP(3), \fBXmImGetXIC\fP(3), \fBXmImRegister\fP(3), \fBXmImSetValues\fP(3), and \fBXmImUnregister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmClipboardEndCopy.30000644000175000017500000000605712672140200015515 00000000000000'\" t ...\" ClipbD.sgm /main/10 1996/09/25 10:23:58 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardEndCopy" "library call" .SH "NAME" \fBXmClipboardEndCopy\fP \(em A clipboard function that completes the copying of data to the clipboard .iX "XmClipboardEndCopy" .iX "clipboard functions" "XmClipboardEndCopy" .SH "SYNOPSIS" .PP .nf #include int XmClipboardEndCopy (\fIdisplay, window, item_id\fP) Display \fI* display\fP; Window \fIwindow\fP; long \fIitem_id\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardEndCopy\fP locks the clipboard from access by other applications, places data in the clipboard data structure, and unlocks the clipboard\&. Data items copied to the clipboard by \fBXmClipboardCopy\fP are not actually entered in the clipboard data structure until the call to \fBXmClipboardEndCopy\fP\&. .PP This function also frees up temporary storage that was allocated by \fBXmClipboardStartCopy\fP, which must be called before \fBXmClipboardEndCopy\fP\&. The latter function should not be called if \fBXmClipboardCancelCopy\fP has been called\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each clipboard function it calls\&. .IP "\fIitem_id\fP" 10 Specifies the number assigned to this data item, which was returned by a previous call to \fBXmClipboardStartCopy\fP\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardFail\fP" 10 The function failed because \fBXmClipboardStartCopy\fP was not called\&. .SH "RELATED" .PP \fBXmClipboardCancelCopy\fP(3), \fBXmClipboardCopy\fP(3) and \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmStringParseText.30000644000175000017500000001133012672140200015430 00000000000000'\" t ...\" StrPar.sgm /main/8 1996/09/08 21:06:36 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringParseText" "library call" .SH "NAME" \fBXmStringParseText\fP \(em A function that converts a character string to a compound string .iX "XmStringParseText" .iX "compound string functions" "XmStringParseText" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringParseText\fP\fR( \fBXtPointer \fBtext\fR\fR, \fBXtPointer *\fBtext_end\fR\fR, \fBXmStringTag \fBtag\fR\fR, \fBXmTextType \fBtype\fR\fR, \fBXmParseTable \fBparse_table\fR\fR, \fBCardinal \fBparse_count\fR\fR, \fBXtPointer \fBcall_data\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringParseText\fP converts characters specified in \fItext\fP to corresponding components in the returned compound string\&. The resulting compound string consists of at least one locale or charset tag component and a series of \fBXmString\fR text components and other components\&. The conversion proceeds according to the parse information contained in \fIparse_table\fP\&. See the \fIMotif Programmer\&'s Guide\fP for more information about parsing and parse tables\&. .IP " \(bu" 6 If \fItype\fP is \fBXmCHARSET_TEXT\fP, the associated \fItag\fP is interpreted as a charset name\&. If \fItag\fP has a value of NULL, a charset component whose value is the result of mapping \fBXmFONTLIST_DEFAULT_TAG\fP is created\&. .IP " \(bu" 6 If \fItype\fP is \fBXmMULTIBYTE_TEXT\fP or \fBXmWIDECHAR_TEXT\fP, the associated \fItag\fP is interpreted as a language environment name\&. If \fItag\fP has a value of NULL, a locale component with a value of \fB_MOTIF_DEFAULT_LOCALE\fP is created\&. If \fItype\fP is \fBXmMULTIBYTE_TEXT\fP or \fBXmWIDECHAR_TEXT\fP, \fItag\fP must be NULL or \fB_MOTIF_DEFAULT_LOCALE\fP\&. .PP \fBXmStringParseText\fP also scans the string for characters that have matches in \fIparse_table\fP\&. Whenever a match is found, the text up to that point is concatenated with the mapped component\&. .IP "\fItext\fP" 10 Specifies the NULL-terminated string containing characters of a type determined by \fItype\fP\&. This is updated to point to after the last character scanned\&. .IP "\fItext_end\fP" 10 Specifies a pointer into \fItext\fP\&. If a NULL is supplied to the \fItext_end\fP parameter, then \fBXmStringParseText\fP parses \fItext\fP until NULL is encountered, or until it reaches a point in \fItext\fP where it is directed to stop (for example, by a \fBparse_proc\fP)\&. Otherwise, the value supplied to the \fItext_end\fP parameter is the pointer into \fItext\fP where parsing is to stop, and the returned character is the one where parsing did stop\&. .IP "\fItag\fP" 10 Specifies the tag to be used in creating the result\&. The type of string tag created (charset or locale) depends on the text type and the passed in \fItag\fP value\&. If the \fItag\fP value is NULL and if \fItype\fP indicates that a charset string tag should be created, the string tag has the value that is the result of mapping \fBXmFONTLIST_DEFAULT_TAG\fP\&. If \fItype\fP indicates a locale string tag, the string tag has the value \fB_MOTIF_DEFAULT_LOCALE\fP\&. .IP "\fItype\fP" 10 Specifies the type of text and the tag type\&. If a locale tag should be created, \fItype\fP has a value of either \fBXmMULTIBYTE_TEXT\fP or \fBXmWIDECHAR_TEXT\fP\&. If \fItype\fP has value of \fBXmCHARSET_TEXT\fP, a charset tag will be created\&. .IP "\fIparse_table\fP" 10 Specifies the parse table to be used in scanning for characters to be converted to other compound string components\&. .IP "\fIparse_count\fP" 10 Specifies the number of entries in \fIparse_table\fP\&. .IP "\fIcall_data\fP" 10 Specifies data to be passed to the parse procedures\&. .SH "RETURN" .PP Returns a new compound string\&. The function allocates space to hold the returned compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .SH "RELATED" .PP \fBXmString\fP(3), \fBXmStringFree\fP(3), \fBXmParseTable\fP(3), \fBXmParseMapping\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmVaCreateScrollBar.30000644000175000017500000000272512672140200015630 00000000000000.DT .TH "XmVaCreateScrollBar" "library call" .SH "NAME" \fBXmVaCreateScrollBar\fP, \fBXmVaCreateManagedScrollBar\fP \(em A ScrollBar widget convenience creation functions\&. .iX "XmVaCreateToggleScrollBar" "XmVaCreateManagedScrollBar" .iX "creation functions" "XmVaCreateScrollBar" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateScrollBar\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedScrollBar\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateScrollBar\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateScrollBar\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ScrollBar and its associated resources, see \fBXmScrollBar\fP(3)\&. .SH "RETURN" .PP Returns the ScrollBar widget ID\&. .SH "RELATED" .PP \fBXmScrollBar\fP(3), \fBXmCreateScrollBar\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/Constraint.30000644000175000017500000001063412672140200014147 00000000000000'\" t ...\" Constrai.sgm /main/9 1996/09/08 21:41:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "Constraint" "library call" .SH "NAME" \fBConstraint\fP \(em The Constraint widget class .iX "Constraint" .iX "widget class" "Constraint" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Constraint widgets maintain additional state data for each child\&. For example, client-defined constraints on the child\&'s geometry may be specified\&. .PP When a constrained composite widget defines constraint resources, all of that widget\&'s children inherit all of those resources as their own\&. These constraint resources are set and read just the same as any other resources defined for the child\&. This resource inheritance extends exactly one generation down, which means only the first-generation children of a constrained composite widget inherit the parent widget\&'s constraint resources\&. .PP Because constraint resources are defined by the parent widgets and not the children, the child widgets never directly use the constraint resource data\&. Instead, the parents use constraint resource data to attach child-specific data to children\&. .SS "Classes" .PP Constraint inherits behavior and resources from \fBComposite\fP and \fBCore\fP\&. .PP The class pointer is \fBconstraintWidgetClass\fP\&. .PP The class name is \fBConstraint\fP\&. .SS "New Resources" .PP Constraint defines no new resources\&. .SS "Inherited Resources" .PP Constraint inherits behavior and resources from \fBComposite\fP and \fBCore\fP\&. The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension1CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for Constraint\&. .SH "RELATED" .PP \fBComposite\fP(3) and \fBCore\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmListDeleteItems.30000644000175000017500000000354112672140200015367 00000000000000'\" t ...\" LstDeleC.sgm /main/7 1996/08/30 15:39:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeleteItems" "library call" .SH "NAME" \fBXmListDeleteItems\fP \(em A List function that deletes items from the list .iX "XmListDeleteItems" .iX "List functions" "XmListDeleteItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeleteItems\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString *\fBitems\fR\fR, \fBint \fBitem_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeleteItems\fP deletes the specified items from the list\&. For each element of \fIitems\fP, the first item in the list that matches that element is deleted\&. A warning message appears if any of the items do not exist\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List from whose list an item is deleted .IP "\fIitems\fP" 10 Specifies a pointer to items to be deleted from the list .IP "\fIitem_count\fP" 10 Specifies the number of elements in \fIitems\fP This number must be nonnegative\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmTextFieldSetStringWcs.30000644000175000017500000000423512672140200016540 00000000000000'\" t ...\" TxtFieBG.sgm /main/8 1996/09/08 21:16:02 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetStringWcs" "library call" .SH "NAME" \fBXmTextFieldSetStringWcs\fP \(em A TextField function that sets a wide character string value .iX "XmTextFieldSetStringWcs" .iX "TextField functions" "XmTextFieldSetStringWcs" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetStringWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBwchar_t *\fBwcstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetStringWcs\fP sets the wide character string value of the TextField widget\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. It also sets the insertion cursor position to the beginning of the string and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIwcstring\fP" 10 Specifies the wide character string value .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldSetString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmVaCreateManagedMessageBox.30000644000175000017500000000004012672140200017243 00000000000000.so man3/XmVaCreateMessageBox.3 motif-2.3.8/doc/man/man3/XmRepTypeGetId.30000644000175000017500000000340212672140200014630 00000000000000'\" t ...\" RepTypGA.sgm /main/8 1996/09/08 20:58:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeGetId" "library call" .SH "NAME" \fBXmRepTypeGetId\fP \(em A representation type manager function that retrieves the identification number of a representation type .iX "XmRepTypeGetId" .iX "representation type manager functions" "XmRepTypeGetId" .SH "SYNOPSIS" .PP .nf #include \fBXmRepTypeId \fBXmRepTypeGetId\fP\fR( \fBString \fBrep_type\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRepTypeGetId\fP searches the registration list for the specified representation type and returns the associated identification number\&. .IP "\fIrep_type\fP" 10 Specifies the representation type for which an identification number is requested .SH "RETURN" .PP Returns the identification number of the specified representation type\&. If the representation type is not registered, the function returns \fBXmREP_TYPE_INVALID\fP\&. .SH "RELATED" .PP \fBXmRepTypeGetRegistered\fP(3) and \fBXmRepTypeRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmProcessTraversal.30000644000175000017500000003537712672140200015645 00000000000000'\" t ...\" ProcessT.sgm /main/8 1996/09/08 20:55:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmProcessTraversal" "library call" .SH "NAME" \fBXmProcessTraversal\fP \(em A function that determines which component receives keyboard events when a widget has the focus .iX "XmProcessTraversal" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmProcessTraversal\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTraversalDirection \fBdirection\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmProcessTraversal\fP determines which component of a hierarchy receives keyboard events when the hierarchy that contains the given widget has keyboard focus\&. .PP \fBXmProcessTraversal\fP changes focus only when the keyboard focus policy of the widget hierarchy is explicit\&. If the \fBXmNkeyboardFocusPolicy\fP of the nearest shell ancestor of the given widget is not \fBXmEXPLICIT\fP, \fBXmProcessTraversal\fP returns False without making any focus changes\&. .IP "\fIwidget\fP" 10 Specifies the widget ID of the widget whose hierarchy is to be traversed .IP "\fIdirection\fP" 10 Specifies the direction of traversal .SS "DEFINITIONS" .PP In order to be eligible to receive keyboard focus when the shell\&'s \fBXmNkeyboardFocusPolicy\fP is \fBXmEXPLICIT\fP, a widget or gadget must meet the following conditions: .IP " \(bu" 6 The widget and its ancestors are not in the process of being destroyed\&. .IP " \(bu" 6 The widget and its ancestors are \fIsensitive\fP\&. A widget is sensitive when its \fBXmNsensitive\fP and \fBXmNancestorSensitive\fP resources are both True\&. .IP " \(bu" 6 The \fBXmNtraversalOn\fP resource for the widget and its ancestors is True\&. .IP " \(bu" 6 The widget is viewable\&. This means that the widget and its ancestors are managed, realized, and (except for gadgets) mapped\&. Furthermore, in general, some part of the widget\&'s rectangular area must be unobscured by the widget\&'s ancestors\&. If an application unmaps a widget that has its \fBXmNmappedWhenManaged\fP resource set to True, the result is undefined\&. .IP "" 10 In a ScrolledWindow with an \fBXmNscrollingPolicy\fP of \fBXmAUTOMATIC\fP, a widget that is obscured because it is not within the clip window may be able to receive focus if some part of the widget is within the work area and if an \fBXmNtraverseObscuredCallback\fP routine can make the widget at least partially visible by scrolling the window\&. .PP In general only primitives, gadgets, and Drawing Area are eligible to receive focus\&. Most managers cannot receive focus even if they meet all these conditions\&. .PP The \fIdirection\fP argument identifies the kind of traversal action to take\&. The descriptions of these actions below refer to traversable non-tab-group widgets and traversable tab groups\&. .IP " \(bu" 6 A traversable non-tab-group widget is a widget that is not a tab group and that meets all the conditions for receiving focus described above\&. .IP " \(bu" 6 A traversable tab group widget is a tab group widget that meets the same conditions, except that a manager that is a tab group and meets the other conditions is also eligible for traversal as long as it contains a descendant that can receive focus\&. .PP A tab group is a widget whose \fBXmNnavigationType\fP is: .IP " \(bu" 6 \fBXmTAB_GROUP\fP or \fBXmSTICKY_TAB_GROUP\fP, if the hierarchy (up to the nearest shell ancestor) that contains the widget has no widget whose \fBXmNnavigationType\fP is \fBXmEXCLUSIVE_TAB_GROUP\fP .IP " \(bu" 6 \fBXmEXCLUSIVE_TAB_GROUP\fP or \fBXmSTICKY_TAB_GROUP\fP, if the hierarchy (up to the nearest shell ancestor) that contains the widget has any widget whose \fBXmNnavigationType\fP is \fBXmEXCLUSIVE_TAB_GROUP\fP .SS "TRAVERSAL ACTIONS" .PP The hierarchy to be traversed is that containing the \fIwidget\fP argument\&. This hierarchy is traversed only up to the nearest shell; \fBXmProcessTraversal\fP does not move focus from one shell to another\&. If the shell containing \fIwidget\fP does not currently have the focus, any change that \fBXmProcessTraversal\fP makes to the element with focus within that shell does not take effect until the next time the shell receives focus\&. .PP \fBXmProcessTraversal\fP begins the traversal action from the widget in the hierarchy that currently has keyboard focus or that last had focus when the user traversed away from the shell hierarchy\&. .PP The value of the \fIdirection\fP argument determines which of three kinds of traversal action to take: .IP " \(bu" 6 Traversal to a non-tab-group widget\&. This kind of traversal is possible only when the widget that currently has focus is not a tab group; otherwise, \fBXmProcessTraversal\fP returns False for these actions\&. .IP "" 10 These actions do not move focus from one tab group to another\&. The actions first determine the containing tab group\&. This is the tab group containing the widget that currently has focus\&. The actions traverse only to a non-tab-group widget within the containing tab group\&. .IP "" 10 A non-tab-group widget is eligible for this kind of traversal if the widget is traversable and has no tab group ancestors up to the containing tab group\&. If the tab group contains no traversable non-tab-group widgets, \fBXmProcessTraversal\fP returns False\&. .IP "" 10 Following are the possible values of the \fIdirection\fP argument\&. Note that when actions wrap, wrapping occurs in the traversal direction\&. The following describes what happens in a left to right environment: .RS .IP " \(bu" 6 \fBXmTRAVERSE_RIGHT\fP\(emIf the \fBXmNnavigationType\fP of the containing tab group is not \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the next traversable non-tab-group widget to the right of the widget that currently has focus\&. In a left to right environment, at the right side of the tab group this action wraps to the non-tab-group widget at the left side and next toward the bottom\&. At the rightmost widget in the bottom row of the tab group this action wraps to the non-tab-group widget at the leftmost widget in the upper row\&. .IP "" 10 In a right to left environment, at the right side of the tab group, this action wraps to the non-tab-group widget at the left side and next toward the top\&. At the rightmost widget in the upper row of the tab group this action wraps to the non-tab-group widget at the leftmost widget in the bottom row\&. .IP "" 10 If the \fBXmNnavigationType\fP of the containing tab group is \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the next traversable non-tab-group widget in the tab group, proceeding in the order in which the widgets appear in their parents\&' \fBXmNchildren\fP lists\&. After the last widget in the tab group, this action wraps to the first non-tab-group widget\&. .IP " \(bu" 6 \fBXmTRAVERSE_LEFT\fP\(emIf the \fBXmNnavigationType\fP of the containing tab group is not \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the next traversable non-tab-group widget to the left of the widget that currently has focus\&. In a left to right environment, at the left side of the tab group this action wraps to the non-tab-group widget at the right side and next toward the top\&. At the leftmost widget in the upper row of the tab group this action wraps to the non-tab-group widget at the rightmost widget in the bottom row\&. .IP "" 10 In a right to left environment, at the left side of the tab group this action wraps to the non-tab-group widget at the right side and next toward the bottom\&. At the leftmost widget in the bottom row of the tab group this action wraps to the non-tab-group widget at the rightmost widget in the upper row\&. .IP "" 10 If the \fBXmNnavigationType\fP of the containing tab group is \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the previous traversable non-tab-group widget in the tab group, proceeding in the reverse order in which the widgets appear in their parents\&' \fBXmNchildren\fP lists\&. After the first widget in the tab group, this action wraps to the last non-tab-group widget\&. .IP " \(bu" 6 \fBXmTRAVERSE_DOWN\fP\(emIf the \fBXmNnavigationType\fP of the containing tab group is not \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the next traversable non-tab-group widget below the widget that currently has focus\&. In a left to right environment, at the bottom of the tab group this action wraps to the non-tab-group widget at the top and next toward the right\&. At the bottom widget in the rightmost column of the tab group this action wraps to the non-tab-group widget at the top widget in the leftmost column\&. .IP "" 10 In a right to left environment, at the bottom of the tab group this action wraps to the non-tab-group widget at the top and next toward the left\&. At the bottom widget of the leftmost widget of the tab group this action wraps to the non-tab-group widget at the top widget of the rightmost column\&. .IP "" 10 If the \fBXmNnavigationType\fP of the containing tab group is \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the next traversable non-tab-group widget in the tab group, proceeding in the order in which the widgets appear in their parents\&' \fBXmNchildren\fP lists\&. After the last widget in the tab group, this action wraps to the first non-tab-group widget\&. .IP " \(bu" 6 \fBXmTRAVERSE_UP\fP\(emIf the \fBXmNnavigationType\fP of the containing tab group is not \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the next traversable non-tab-group widget above the widget that currently has focus\&. In a left to right environment, at the top of the tab group this action wraps to the non-tab-group widget at the bottom and next toward the left\&. At the top widget of the leftmost column of the tab group this action wraps to the non-tab-group widget at the bottom widget of the rightmost column\&. .IP "" 10 In a right to left environment, at the top of the tab group this action wraps to the non-tab-group widget at the bottom and next toward the right\&. At the top widget of the right most column of the tab group this action wraps to the non-tab-group widget at the bottom widget of the leftmost column\&. .IP "" 10 If the \fBXmNnavigationType\fP of the containing tab group is \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the previous traversable non-tab-group widget in the tab group, proceeding in the reverse order in which the widgets appear in their parents\&' \fBXmNchildren\fP lists\&. After the first widget in the tab group, this action wraps to the last non-tab-group widget\&. .IP " \(bu" 6 \fBXmTRAVERSE_NEXT\fP\(emFocus moves to the next traversable non-tab-group widget in the tab group, proceeding in the order in which the widgets appear in their parents\&' \fBXmNchildren\fP lists\&. After the last widget in the tab group, this action wraps to the first non-tab-group widget\&. .IP " \(bu" 6 \fBXmTRAVERSE_PREV\fP\(emFocus moves to the previous traversable non-tab-group widget in the tab group, proceeding in the reverse order in which the widgets appear in their parents\&' \fBXmNchildren\fP lists\&. After the first widget in the tab group, this action wraps to the last non-tab-group widget\&. .IP " \(bu" 6 \fBXmTRAVERSE_HOME\fP\(emIf the \fBXmNnavigationType\fP of the containing tab group is not \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the first traversable non-tab-group widget at the initial focus of the tab group\&. .IP "" 10 If the \fBXmNnavigationType\fP of the containing tab group is \fBXmEXCLUSIVE_TAB_GROUP\fP, focus moves to the first traversable non-tab-group widget in the tab group, according to the order in which the widgets appear in their parents\&' \fBXmNchildren\fP lists\&. .RE .IP " \(bu" 6 Traversal to a tab group\&. These actions first determine the current widget hierarchy and the containing tab group\&. The current widget hierarchy is the widget hierarchy whose root is the nearest shell ancestor of the widget that currently has focus\&. The containing tab group is is the tab group containing the widget that currently has focus\&. If the current widget hierarchy contains no traversable tab groups, \fBXmProcessTraversal\fP returns False\&. .IP "" 10 Following are the possible values of the \fIdirection\fP argument\&. If any tab group in the current widget hierarchy has an \fBXmNnavigationType\fP of \fBXmEXCLUSIVE_TAB_GROUP\fP, traversal of tab groups in the hierarchy proceeds to widgets in the order in which their \fBXmNnavigationType\fP resources were specified as \fBXmEXCLUSIVE_TAB_GROUP\fP or \fBXmSTICKY_TAB_GROUP\fP\&.: .RS .IP " \(bu" 6 \fBXmTRAVERSE_NEXT_TAB_GROUP\fP\(emFinds the hierarchy that contains \fIwidget\fP, finds the active tab group (if any), and makes the next tab group the active tab group in the hierarchy\&. .IP " \(bu" 6 \fBXmTRAVERSE_PREV_TAB_GROUP\fP\(emFinds the hierarchy that contains \fIwidget\fP, finds the active tab group (if any), and makes the previous tab group the active tab group in the hierarchy\&. .RE .IP " \(bu" 6 Traversal to any widget\&. In this case the \fIwidget\fP argument is the widget to which \fBXmProcessTraversal\fP tries to give focus\&. If the widget is not traversable, \fBXmProcessTraversal\fP returns False\&. .IP "" 10 Following are the possible values of the \fIdirection\fP argument: .RS .IP " \(bu" 6 \fBXmTRAVERSE_CURRENT\fP\(emFinds the hierarchy and the tab group that contain \fIwidget\fP\&. If this tab group is not the active tab group, this action makes it the active tab group\&. If \fIwidget\fP is an item in the active tab group, this action makes it the active item\&. If \fIwidget\fP is the active tab group, this action makes the first traversable item in the tab group the active item\&. .RE .SS "CAUTIONS" .PP Using \fBXmProcessTraversal\fP to traverse to MenuBars, Pulldown menu panes, or Popup menu panes is not supported\&. .PP \fBXmProcessTraversal\fP cannot be called recursively\&. In particular, an application cannot call this routine from an \fBXmNfocusCallback\fP or \fBXmNlosingFocusCallback\fP procedure\&. .SH "RETURN" .PP Returns True if the traversal action succeeded\&. Returns False if the \fBXmNkeyboardFocusPolicy\fP of the nearest shell ancestor of \fIwidget\fP is not \fBXmEXPLICIT\fP, if the traversal action finds no traversable widget to receive focus, or if the call to the routine has invalid arguments\&. .SH "RELATED" .PP \fBXmGetVisibility\fP(3) and \fBXmIsTraversable\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmTabGetValues.30000644000175000017500000000447612672140200014665 00000000000000'\" t ...\" TabGetV.sgm /main/8 1996/09/08 21:08:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabGetValues" "library call" .SH "NAME" \fBXmTabGetValues\fP \(em A convenience function that returns tab values .iX "XmTabGetValues" .SH "SYNOPSIS" .PP .nf #include \fBfloat \fBXmTabGetValues\fP\fR( \fBXmTab \fBtab\fR\fR, \fBunsigned char \fB*units\fR\fR, \fBXmOffsetModel \fB*offset\fR\fR, \fBunsigned char \fB*alignment\fR\fR, \fBchar \fB**decimal\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabGetValues\fP takes an \fBXmTab\fR structure, returns the floating point number that is set as the value of the tab, and then sets values for the \fIunits\fP, \fIoffset\fP, \fIalignment\fP, and \fIdecimal\fP arguments where they are not NULL\&. The returned floating point number represents the distance that the rendering of the \fBXmString\fR segment associated with \fItab\fP will be offset\&. The offset is from either the beginning of the rendering or from the previous tab stop, depending on the setting for the \fIoffset\fP model\&. The distance will use the unit type pointed at by \fIunit\fP\&. .IP "\fItab\fP" 10 Specifies the tab to get the value from\&. .IP "\fIunits\fP" 10 Specifies a pointer to the unit type\&. .IP "\fIoffset\fP" 10 Specifies a pointer to the offset model\&. .IP "\fIalignment\fP" 10 Specifies a pointer to the alignment type\&. .IP "\fIdecimal\fP" 10 Specifies a pointer to the multibyte character used as the decimal point\&. .SH "RETURN" .PP Returns a floating point number that is set as the value of the tab\&. .SH "RELATED" .PP \fBXmTab\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmRenderTableRemoveRenditions.30000644000175000017500000000450012672140200017727 00000000000000'\" t ...\" RendTaJ.sgm /main/8 1996/09/08 20:58:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableRemoveRenditions" "library call" .SH "NAME" \fBXmRenderTableRemoveRenditions\fP \(em A convenience function that removes renditions .iX "XmRenderTableRemoveRenditions" .SH "SYNOPSIS" .PP .nf #include \fBXmRenderTable \fBXmRenderTableRemoveRenditions\fP\fR( \fBXmRenderTable \fBoldtable\fR\fR, \fBXmStringTag \fB*tags\fR\fR, \fBint \fBtag_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableRemoveRenditions\fP removes from \fIoldtable\fP the renditions whose tags match the tags specified in \fItags\fP, then places the remaining renditions in a newly created render table\&. .IP "\fIoldtable\fP" 10 Specifies the render table from which renditions are to be removed\&. This function deallocates the original render table and the matching renditions after extracting the required information\&. .IP "\fItags\fP" 10 Specifies an array of tags, whose corresponding renditions are to be removed from \fIoldtable\fP\&. .IP "\fItag_count\fP" 10 Specifies the number of tags in \fItags\fP\&. .SH "RETURN" .PP If \fIoldtable\fP or \fItags\fP is NULL, or \fItag_count\fP is 0 (zero), or no renditions are removed from \fIoldtable\fP, this function returns \fIoldtable\fP\&. Otherwise, it returns a newly allocated \fBXmRenderTable\fR\&. The application is responsible for managing this allocated render table\&. The application can recover this allocated space by calling \fBXmRenderTableFree\fP\&. .SH "RELATED" .PP \fBXmRendition\fP(3) and \fBXmRenderTableFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmStringToXmStringTable.30000644000175000017500000000517312672140200016547 00000000000000'\" t ...\" StrToX.sgm /main/10 1996/09/08 21:07:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringToXmStringTable" "library call" .SH "NAME" \fBXmStringToXmStringTable\fP \(em A convenience function that converts a single compound string to a table of compound strings .iX "XmStringTableToXmString" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBXmStringToXmStringTable\fP\fR( \fBXmString \fBstring\fR\fR, \fBXmString \fBbreak_component\fR\fR, \fBXmStringTable \fB*table\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringToXmStringTable\fP takes as input a single compound string and a specified string component (such as a tab) and returns a table of compound strings consisting of portions of \fIstring\fP delimited by components matching \fIbreak_component\fP\&. The components marking breaks will not appear in the resulting table\&. .IP "\fIstring\fP" 10 Specifies the \fBXmString\fR to be converted\&. .IP "\fIbreak_component\fP" 10 Specifies the \fBXmStringComponent\fP that will be used to indicate where to split \fIstring\fP to form the individual elements of \fItable\fP\&. The most useful types will be \fBXmSTRING_COMPONENT_SEPARATOR\fP and \fBXmSTRING_COMPONENT_TAB\fP\&. Refer to the \fBXmStringComponentType\fP(3) reference page for a complete list of possible component types\&. Note, however, that the \fBXmSTRING_COMPONENT_UNKNOWN\fP component is not a possible type\&. .IP "\fItable\fP" 10 Returns the equivalent \fBXmStringTable\fR\&. The function will allocate space to hold the returned \fBXmStringTable\fR\&. When the applicaiton no longer needs the returned \fBXmStringTable\fR, the application should call \fBXmStringFree\fP once for each compound string in the table, and then calling \fBXtFree\fP to deallocate the \fBXmStringTable\fR itself\&. .SH "RETURN" .PP Returns the number of compound strings in \fItable\fP\&. .SH "RELATED" .PP \fBXmStringTable\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmDestroyPixmap.30000644000175000017500000000330212672140200015132 00000000000000'\" t ...\" DestroyP.sgm /main/7 1996/08/30 15:05:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDestroyPixmap" "library call" .SH "NAME" \fBXmDestroyPixmap\fP \(em A pixmap caching function that removes a pixmap from the pixmap cache .iX "XmDestroyPixmap" .iX "pixmaps" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmDestroyPixmap\fP\fR( \fBScreen \fB* screen\fR\fR, \fBPixmap \fBpixmap\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDestroyPixmap\fP removes pixmaps that are no longer used\&. Pixmaps are completely freed only when there is no further reference to them\&. .IP "\fIscreen\fP" 10 Specifies the display screen for which the pixmap was requested .IP "\fIpixmap\fP" 10 Specifies the pixmap to be destroyed .SH "RETURN" .PP Returns True when successful; returns False if there is no matching screen and pixmap in the pixmap cache\&. .SH "RELATED" .PP \fBXmInstallImage\fP(3), \fBXmUninstallImage\fP(3), and \fBXmGetPixmap\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmCvtXmStringToByteStream.30000644000175000017500000000535412672140200017066 00000000000000'\" t ...\" CvtXmStB.sgm /main/7 1996/08/30 15:03:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCvtXmStringToByteStream" "library call" .SH "NAME" \fBXmCvtXmStringToByteStream\fP \(em A compound string function that converts a compound string to a Byte Stream format .iX "XmCvtXmStringToByteStream" .iX "compound string functions" "XmCvtXmStringToByteStream" .SH "SYNOPSIS" .PP .nf #include \fBunsigned int \fBXmCvtXmStringToByteStream\fP\fR( \fBXmString \fBstring\fR\fR, \fBunsigned char **\fBprop_return\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCvtXmStringToByteStream\fP converts a compound string to a string of bytes representing the compound string in Byte Stream format\&. This routine is typically used by the source of a data transfer operation to produce a Byte Stream representation for transferring a compound string to a destination\&. .PP If \fIprop_return\fP is not NULL, this function creates a string of characters in Byte Stream format and returns it in \fIprop_return\fP\&. The function also returns the number of bytes in \fIprop_return\fP\&. If \fIprop_return\fP is NULL, the function does not return the Byte Stream format string, but it does calculate and return the number of bytes that would appear in the Byte Stream format string\&. .IP "\fIstring\fP" 10 Specifies a compound string to be converted to Byte Stream format .IP "\fIprop_return\fP" 10 Specifies a pointer to a string in Byte Stream format that is created and returned by this function\&. If \fIprop_return\fP is NULL, no Byte Stream format string is returned\&. When a Byte Stream format string is returned, the function allocates space to hold it\&. The application is responsible for managing this allocated space\&. The application can recover the allocated space by calling \fBXtFree\fP\&. .SH "RETURN" .PP Returns the number of bytes in the Byte Stream representation (whether or not the Byte Stream representation is returned)\&. .SH "RELATED" .PP \fBXmString\fP(3) and \fBXmCvtByteStreamToXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmVaCreateManagedHierarchy.30000644000175000017500000000003712672140200017132 00000000000000.so man3/XmVaCreateHierarchy.3 motif-2.3.8/doc/man/man3/XmChangeColor.30000644000175000017500000000364412672140200014517 00000000000000'\" t ...\" ChangeCo.sgm /main/8 1996/09/08 20:26:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmChangeColor" "library call" .SH "NAME" \fBXmChangeColor\fP \(em Recalculates all associated colors of a widget .iX "XmChangeColor" .iX "Color functions" "XmChangeColor" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmChangeColor\fP\fR( \fBWidget \fBwidget\fR\fR, \fBPixel \fBbackground\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmChangeColor\fP handles all color modifications for the specified widget when a new background pixel value is specified\&. This function recalculates the foreground, select, and shadow colors based on the new background color and sets the corresponding resources for the widget\&. If a color calculation procedure has been set by a call to \fBXmSetColorCalculation\fP, \fBXmChangeColor\fP uses that procedure to calculate the new colors\&. Otherwise, the routine uses a default procedure\&. .IP "\fIwidget\fP" 10 Specifies the widget ID whose colors will be updated .IP "\fIbackground\fP" 10 Specifies the background color pixel value .SH "RELATED" .PP \fBXmGetColorCalculation\fP(3), \fBXmGetColors\fP(3), and \fBXmSetColorCalculation\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmVaCreateDrawingArea.30000644000175000017500000000272612672140200016132 00000000000000.DT .TH "XmVaCreateDrawingArea" "library call" .SH "NAME" \fBXmVaCreateDrawingArea\fP, \fBXmVaCreateManagedDrawingArea\fP \(em A DrawingArea widget convenience creation functions\&. .iX "XmVaCreateDrawingArea" "XmVaCreateManagedDrawingArea" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateDrawingArea\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedDrawingArea\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a DrawingArea widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateDrawingArea\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedDrawingArea\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of DrawingArea and its associated resources, see \fBXmDrawingArea\fP(3)\&. .SH "RETURN" .PP Returns the DrawingArea widget ID\&. .SH "RELATED" .PP \fBXmDrawingArea\fP(3), \fBXmCreateDrawingArea\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextReplace.30000644000175000017500000000565312672140200014555 00000000000000'\" t ...\" TxtReplA.sgm /main/8 1996/09/08 21:19:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextReplace" "library call" .SH "NAME" \fBXmTextReplace\fP \(em A Text function that replaces part of a text string .iX "XmTextReplace" .iX "Text functions" "XmTextReplace" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextReplace\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBfrom_pos\fR\fR, \fBXmTextPosition \fBto_pos\fR\fR, \fBchar \fB* value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextReplace\fP replaces part of the text string in the Text widget\&. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text\&. .PP An example text replacement would be to replace the second and third characters in the text string\&. To accomplish this, the parameter \fIfrom_pos\fP must be 1 and \fIto_pos\fP must be 3\&. To insert a string after the fourth character, both parameters, \fIfrom_pos\fP and \fIto_pos\fP, must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. The \fBXmNmotionVerifyCallback\fP is generated if \fIto_pos\fP is less than or equal to the cursor position and the length of \fIvalue\fP is not the same as the length of the text being replaced, or if the cursor position is between \fIfrom_pos\fP and \fIto_pos\fP, and the distance from the cursor position to \fIfrom_pos\fP is greater than the length of \fIvalue\fP\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIfrom_pos\fP" 10 Specifies the start position of the text to be replaced .IP "\fIto_pos\fP" 10 Specifies the end position of the text to be replaced .IP "\fIvalue\fP" 10 Specifies the character string value to be added to the text widget .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextReplaceWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmDrawnButton.30000644000175000017500000003637412672140200014610 00000000000000'\" t ...\" DrawnBut.sgm /main/11 1996/09/08 20:40:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDrawnButton" "library call" .SH "NAME" \fBXmDrawnButton\fP \(em The DrawnButton widget class .iX "XmDrawnButton" .iX "widget class" "DrawnButton" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The DrawnButton widget consists of an empty widget window surrounded by a shadow border\&. It provides the application developer with a graphics area that can have PushButton input semantics\&. .PP Callback types are defined for widget exposure and widget resize to allow the application to redraw or reposition its graphics\&. If the DrawnButton widget has a highlight and shadow thickness, the application should not draw in that area\&. To avoid drawing in the highlight and shadow area, create the graphics context with a clipping rectangle for drawing in the widget\&. The clipping rectangle should take into account the size of the widget\&'s highlight thickness and shadow\&. DrawnButton uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits, and holds the \fBXmQTactivatable\fP trait\&. .SS "Classes" .PP DrawnButton inherits behavior, resources, and traits from the \fBCore\fP, \fBPrimitive\fP, and \fBXmLabel\fP classes\&. .PP The class pointer is \fBxmDrawnButtonWidgetClass\fP\&. .PP The class name is \fBXmDrawnButton\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDrawnButton Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNdisarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNexposeCallbackXmCCallbackXtCallbackListNULLC _____ XmNmultiClickXmCMultiClickunsigned chardynamicCSG _____ XmNpushButtonEnabledXmCPushButtonEnabledBooleanFalseCSG _____ XmNresizeCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_ETCHED_INCSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when the widget becomes selected\&. The reason sent by the callback is \fBXmCR_ACTIVATE\fP\&. This callback uses the \fBXmQTactivatable\fP trait\&. .IP "\fBXmNarmCallback\fP" 10 Specifies the list of callbacks that is called when the widget becomes armed\&. The reason sent by the callback is \fBXmCR_ARM\fP\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies the list of callbacks that is called when the widget becomes disarmed\&. The reason sent by the callback is \fBXmCR_DISARM\fP\&. .IP "\fBXmNexposeCallback\fP" 10 Specifies the list of callbacks that is called when the widget receives an exposure event\&. The reason sent by the callback is \fBXmCR_EXPOSE\fP\&. .IP "\fBXmNmultiClick\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time, and this resource is set to \fBXmMULTICLICK_DISCARD\fP, the second click is not processed\&. If this resource is set to \fBXmMULTICLICK_KEEP\fP, the event is processed and \fIclick_count\fP is incremented in the callback structure\&. When the button is not in a menu, the default value is \fBXmMULTICLICK_KEEP\fP\&. .IP "\fBXmNpushButtonEnabled\fP" 10 Enables or disables the 3-dimensional shadow drawing as in PushButton\&. .IP "\fBXmNresizeCallback\fP" 10 Specifies the list of callbacks that is called when the widget receives a resize event\&. The reason sent by the callback is \fBXmCR_RESIZE\fP\&. The event returned for this callback is NULL\&. .IP "\fBXmNshadowType\fP" 10 Describes the drawing style for the DrawnButton\&. This resource can have the following values: .RS .IP "\fBXmSHADOW_IN\fP" 10 Draws the DrawnButton so that the shadow appears inset\&. This means that the bottom shadow visuals and top shadow visuals are reversed\&. .IP "\fBXmSHADOW_OUT\fP" 10 Draws the DrawnButton so that the shadow appears outset\&. .IP "\fBXmSHADOW_ETCHED_IN\fP" 10 Draws the DrawnButton using a double line\&. This gives the effect of a line etched into the window\&. The thickness of the double line is equal to the value of \fBXmNshadowThickness\fP\&. .IP "\fBXmSHADOW_ETCHED_OUT\fP" 10 Draws the DrawnButton using a double line\&. This gives the effect of a line coming out of the window\&. The thickness of the double line is equal to the value of \fBXmNshadowThickness\fP\&. .RE .SS "Inherited Resources" .PP DrawnButton inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabel Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLN/A _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLN/A _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmString"\e0"CSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimension0CSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimension0CSG _____ XmNmarginRightXmCMarginRightDimension0CSG _____ XmNmarginTopXmCMarginTopDimension0CSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLN/A _____ XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGN/A _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Window \fIwindow\fP; int \fIclick_count\fP; } XmDrawnButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. This is NULL for \fBXmNresizeCallback\fP\&. .IP "\fIwindow\fP" 10 Is set to the window ID in which the event occurred\&. .IP "\fIclick_count\fP" 10 Contains the number of clicks in the last multiclick sequence if the \fBXmNmultiClick\fP resource is set to \fBXmMULTICLICK_KEEP\fP, otherwise it contains 1\&. The activate callback is invoked for each click if \fBXmNmultiClick\fP is set to \fBXmMULTICLICK_KEEP\fP\&. .SS "Translations" .PP XmDrawnButton includes translations from Primitive\&. Additional XmDrawnButton translations are described in the following list\&. The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fBc\fP:" 10 ButtonTakeFocus() .IP "\fB\(apc\fP\fB\fP:" 10 Arm() .IP "\fB\(apc\fP\fB\fP\fB,\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiArm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiActivate() .IP "\fB\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ArmAndActivate() .SS "Action Routines" .PP The \fBXmDrawnButton\fP action routines are .IP "Activate():" 10 If \fBXmNpushButtonEnabled\fP is True, redraws the shadow in the unselected state; otherwise, redraws the shadow according to \fBXmNshadowType\fP\&. If the pointer is within the DrawnButton, calls the \fBXmNactivateCallback\fP callbacks\&. .IP "Arm():" 10 If \fBXmNpushButtonEnabled\fP is True, redraws the shadow in the selected state; otherwise, redraws the shadow according to \fBXmNshadowType\fP\&. Calls the callbacks for \fBXmNarmCallback\fP\&. .IP "ArmAndActivate():" 10 If \fBXmNpushButtonEnabled\fP is True, redraws the shadow in the selected state; otherwise, redraws the shadow according to \fBXmNshadowType\fP\&. Calls the callbacks for \fBXmNarmCallback\fP\&. .IP "" 10 If \fBXmNpushButtonEnabled\fP is True, the shadow is redrawn in the unselected state; otherwise, the shadow is redrawn according to \fBXmNshadowType\fP\&. The callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP are called\&. These actions happen either immediately or at a later time\&. .IP "ButtonTakeFocus():" 10 Causes the PushButton to take keyboard focus when \fBCtrl\fP is pressed, without activating the widget\&. .IP "Disarm():" 10 Marks the DrawnButton as unselected and calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "MultiActivate():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action increments \fIclick_count\fP in the callback structure\&. If \fBXmNpushButtonEnabled\fP is True, this action redraws the shadow in the unselected state; otherwise, it redraws the shadow according to \fBXmNshadowType\fP\&. If the pointer is within the DrawnButton, this action calls the \fBXmNactivateCallback\fP callbacks and calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "MultiArm():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP and if \fBXmNpushButtonEnabled\fP is True, this action redraws the shadow in the selected state; otherwise, it redraws the shadow according to \fBXmNshadowType\fP and calls the callbacks for \fBXmNarmCallback\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 Draws the shadow in its selected state if \fBXmNpushButtonEnabled\fP is True and if the cursor leaves and re-enters the window while \fBBSelect\fP is pressed\&. .IP "\fB\fP:" 10 Draws the shadow in its unselected state if \fBXmNpushButtonEnabled\fP is True and if the cursor leaves the window while \fBBSelect\fP is pressed\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateDrawnButton\fP, \fBXmLabel\fP(3), \fBXmPrimitive\fP(3), \fBXmPushButton\fP, \fBXmSeparator\fP(3), \fBXmVaCreateDrawnButton\fP, \fBXmVaCreateManagedDrawnButton\fP\&. motif-2.3.8/doc/man/man3/XmTabSetValue.30000644000175000017500000000373412672140200014512 00000000000000'\" t ...\" TabSetV.sgm /main/8 1996/09/08 21:09:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabSetValue" "library call" .SH "NAME" \fBXmTabSetValue\fP \(em A convenience function that sets a tab stop .iX "XmTabSetValue" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTabSetValue\fP\fR( \fBXmTab \fBtab\fR\fR, \fBfloat \fBvalue\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabSetValue\fP sets the \fIvalue\fP field of the \fBXmTab\fR structure associated with \fItab\fP\&. .IP "\fItab\fP" 10 Specifies the tab to set the value of\&. .IP "\fIvalue\fP" 10 Specifies the floating point number which represents the distance that the rendering of the \fBXmString\fR segment associated with \fItab\fP will be offset\&. The offset is from either the beginning of the rendering or from the previous tab stop, depending on the setting for the \fIoffset\fP model\&. The distance depends on the tab\&'s unit type\&. Note that negative values are not permitted, and that if a tab stop would cause text to overlap, the x position for the segment is set immediately after the end of the previous segment\&. .SH "RELATED" .PP See also the \fIMotif Programmer\&'s Guide\fP for more information about tabs and tab lists\&. \fBXmTab\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmVaCreateManagedColumn.30000644000175000017500000000003412672140200016446 00000000000000.so man3/XmVaCreateColumn.3 motif-2.3.8/doc/man/man3/XmDataField.30000644000175000017500000002343012672140200014143 00000000000000.TH "XmDataField" "library call" .SH NAME \fBXmDataField\fP \(em The DataField widget class .SH SYNOPSIS .nf #include .fi .SH DESCRIPTION The DataField widget is a Data Presentation widget that handles display and entry of data as text. The DataField widget is a subclass of the XmTextField widget intended for data entry applications. In addition to all of the normal XmTextField functionality, it supports regular expression-based parsing and acceptance/rejection of its input through the XmNpicture resource, and right justification through the XmNalignment resource. .PP The DataField widget provides added capability by supporting several types of validation: a DataField widget containing an invalid value will not give-up focus; the user must enter a correct value before proceeding to another field. .SS "Classes" .PP DataField inherits behavior, resources, and traits from \fBCore\fP, \fBXmPrimitive\fP, and \fBXmTextField\fP\&. .PP The class pointer is \fBxmDataFieldWidgetClass\fP\&. .PP The class name is \fBXmDataField\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDataField Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNalignmentXmCAlignmentunsigned charXmALIGNMENT_BEGINNINGCSG _____ XmNautoFillXmCAutoFillBooleanTrueCSG _____ XmNpictureXmCPictureStringNULLCSG _____ XmNpictureErrorCallbackXmCCallbackXtCallbackListNULLC _____ XmNvalidateCallbackXmCCallbackXtCallbackListNULLC _____ .TE .IP "\fBXmNalignment\fP" 10 When set to XmALIGNMENT_END, the widget aligns all its text with the right hand side of the input area. .IP "\fBXmNautoFill\fP" 10 When set to True, the widget "auto-fills" its contents when it can determine that the next character in the string must be a particular literal\&. For instance, the picture "###-####" automatically inserts a '-' character after receiving three numeric digits as input\&. .IP "\fBXmNpicture\fP" 10 Specifies a picture for data entry in the widget. A picture acts as a template that formats the value you enter in a field. An example would be the US Phone Number picture: (###)###-####. The picture is used to convert characters entered into the field to a formatted value\&. .RS .IP "\fBCharacter interpretations\fP" 10 .PP The following lists and defines the characters you can use in a picture, and how the DataField widget interprets them. .IP \fI#\fP Any numeric digit .IP \fI?\fP Case insensitive letter .IP \fI&\fP Uppercase letter (forces lowercase to uppercase) .IP \fI@\fP Case insensitive character .IP \fI!\fP Uppercase character .IP \fI;\fP Interpret the following character literally .IP \fI*\fP Repeat the following character some number of times .IP \fI[]\fP Characters within brackets are optional .IP \fI{}\fP Characters within braces are grouped .IP \fI,\fP Alternative values .IP "" Other characters are interpreted literally. .IP "" Set XmNpicture to NULL to disable regular expression processing. The DataField widget is cleared whenever the XmNpicture resource is changed. .RE .IP "\fBXmNpictureErrorCallback\fP" 10 Specifies a list of callbacks to be called when the XmDataField widget determines that data is being entered that does not match the format specified by the XmNpicture resource. .IP "\fBXmNvalidateCallback\fP" 10 Specifies a list of callbacks to be called when data has been entered in the XmDataField widget and the user has moved out of the XmDataField widget (usually by pressing the Tab key). The callbacks can reject the movement of focus. .PP .SS "Inherited Resources" .PP DataField inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmTextFieldResource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNblinkRateXmCBlinkRateint500CSG _____ XmNcolumnsXmCColumnsshortdynamicCSG _____ XmNcursorPositionXmCCursorPositionXmTextPosition0CSG _____ XmNcursorPositionVisibleXmCCursorPositionVisibleBooleandynamicCSG _____ XmNdestinationCallbackXmCCallbackXtCallbackListNULLC _____ XmNeditableXmCEditableBooleanTrueCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNgainPrimaryCallbackXmCCallbackXtCallbackListNULLC _____ XmNlosePrimaryCallbackXmCCallbackXtCallbackListNULLC _____ XmNlosingFocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension5CSG _____ XmNmarginWidthXmCMarginWidthDimension5CSG _____ XmNmaxLengthXmCMaxLengthintlargest integerCSG _____ XmNmodifyVerifyCallbackXmCCallbackXtCallbackListNULLC _____ XmNmodifyVerifyCallbackWcsXmCCallbackXtCallbackListNULLC _____ XmNmotionVerifyCallbackXmCCallbackXtCallbackListNULLC _____ XmNpendingDeleteXmCPendingDeleteBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNresizeWidthXmCResizeWidthBooleanFalseCSG _____ XmNselectionArrayXmCSelectionArrayXtPointerdefault arrayCSG _____ XmNselectionArrayCountXmCSelectionArrayCountint3CSG _____ XmNselectThresholdXmCSelectThresholdint5CSG _____ XmNvalueXmCValueString""CSG _____ XmNvalueChangedCallbackXmCCallbackXtCallbackListNULLC _____ XmNvalueWcsXmCValueWcswchar_t *(wchar_t *)""CSG _____ XmNverifyBellXmCVerifyBellBooleandynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP XmDataField inherits translations from XmTextField\&. .PP .SH Callback Routines A pointer to the following structure is passed to the list of routines for the XmNvalidateCallback: .nf typedef struct _XmDataFieldCallbackStruct { Widget w; /* The XmDataField */ String text; /* Proposed string */ Boolean accept; /* Accept return value, for validation */ } XmDataFieldCallbackStruct; .fi .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateDataField\fP(3), \fBXmPrimitive\fP(3), \fBXmTextFieldSetString\fP(3), \fBXmTextFieldSetStringWcs\fP(3), \fBXmVaCreateDataField\fP(3), and \fBXmVaCreateManagedDataField\fP(3)\&. .SH VERSION This manual page documents the XmDataField widget shipped in Motif version 2.2 .SH AUTHOR .br (c) 2002 by Integrated Computer Solutions, Inc. .LP Edited by Kevin Cook. .PP motif-2.3.8/doc/man/man3/XmResolvePartOffsets.30000644000175000017500000001161112672140200016124 00000000000000'\" t ...\" ResolveP.sgm /main/9 1996/09/25 10:05:19 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmResolvePartOffsets" "library call" .SH "NAME" \fBXmResolvePartOffsets\fP \(em A function that allows writing of upward-compatible applications and widgets .iX "XmResolvePartOffsets" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmResolvePartOffsets\fP\fR( \fBWidgetClass \fBwidget_class\fR\fR, \fBXmOffsetPtr \fB* offset\fR\fR); .fi .SH "DESCRIPTION" .PP The use of offset records requires one extra global variable per widget class\&. The variable consists of a pointer to an array of offsets into the widget record for each part of the widget structure\&. The \fBXmResolvePartOffsets\fP function allocates the offset records needed by an application to guarantee upward-compatible access to widget instance records by applications and widgets\&. These offset records are used by the widget to access all of the widget\&'s variables\&. A widget needs to take the steps described in the following paragraphs\&. .PP Instead of creating a resource list, the widget creates an offset resource list\&. To accomplish this, use the \fBXmPartResource\fR structure and the \fBXmPartOffset\fP macro\&. The \fBXmPartResource\fR data structure looks just like a resource list, but instead of having one integer for its offset, it has two shorts\&. This structure is put into the class record as if it were a normal resource list\&. Instead of using \fBXtOffset\fP for the offset, the widget uses \fBXmPartOffset\fP\&. .PP .nf \f(CWXmPartResource resources[] = { { BarNxyz, BarCXyz, XmRBoolean, sizeof(Boolean), XmPartOffset(Bar,xyz), XmRImmediate, (XtPointer)False } };\fR .fi .PP .PP Instead of putting the widget size in the class record, the widget puts the widget part size in the same field\&. .PP Instead of putting \fBXtVersion\fP in the class record, the widget puts \fBXtVersionDontCheck\fP in the class record\&. .PP The widget defines a variable, of type \fBXmOffsetPtr\fR, to point to the offset record\&. This can be part of the widget\&'s class record or a separate global variable\&. .PP In class initialization, the widget calls \fBXmResolvePartOffsets\fP, passing it a pointer to contain the address of the offset record and the class record\&. This does several things: .IP " \(bu" 6 Adds the superclass (which, by definition, has already been initialized) size field to the part size field .IP " \(bu" 6 Allocates an array based upon the number of superclasses .IP " \(bu" 6 Fills in the offsets of all the widget parts with the appropriate values, determined by examining the size fields of all superclass records .IP " \(bu" 6 Uses the part offset array to modify the offset entries in the resource list to be real offsets, in place .PP The widget defines a constant that will be the index to its part structure in the offsets array\&. The value should be 1 greater than the index of the widget\&'s superclass\&. Constants defined for all \fBXm\fP widgets can be found in \fBXmP\&.h\fP\&. .PP .nf \f(CW#define BarIndex (XmBulletinBIndex + 1)\fR .fi .PP .PP Instead of accessing fields directly, the widget must always go through the offset table\&. The \fBXmField\fP macro helps you access these fields\&. Because the \fBXmPartOffset\fP and \fBXmField\fP macros concatenate things together, you must ensure that there is no space after the part argument\&. For example, the following macros do not work because of the space after the part (Label) argument: .PP .nf \f(CWXmField(w, offset, Label, text, char *) XmPartOffset(Label, text)\fR .fi .PP .PP Therefore, you must not have any spaces after the part (Label) argument, as illustrated here: .PP .nf \f(CWXmField(w, offset, Label, text, char *)\fR .fi .PP .PP You can define macros for each field to make this easier\&. Assume an integer field \fIxyz\fP: .PP .nf \f(CW#define BarXyz(w) (*(int *)(((char *) w) + \e offset[BarIndex] + XtOffset(BarPart,xyz)))\fR .fi .PP .PP The parameters for \fBXmResolvePartOffsets\fP are .IP "\fIwidget_class\fP" 10 Specifies the widget class pointer for the created widget .IP "\fIoffset\fP" 10 Returns the offset record .SH "RELATED INFORMATION" .PP \fBXmResolveAllPartOffsets\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmGetSecondaryResourceData.30000644000175000017500000001005012672140200017211 00000000000000'\" t ...\" GetSec.sgm /main/8 1996/09/08 20:46:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetSecondaryResourceData" "library call" .SH "NAME" \fBXmGetSecondaryResourceData\fP \(em A function that provides access to secondary widget resource data .iX "XmGetSecondaryResourceData" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBXmGetSecondaryResourceData\fP\fR( \fBWidgetClass \fBwidget_class\fR\fR, \fBXmSecondaryResourceData **\fBsecondary_data_return\fR\fR); .fi .SH "DESCRIPTION" .PP Some Motif widget classes (such as Gadget, Text, and VendorShell) have resources that are not accessible through the functions \fBXtGetResourceList\fP and \fBXtGetConstraintResourceList\fP\&. In order to retrieve the descriptions of these resources, an application must use \fBXmGetSecondaryResourceData\fP\&. .PP When a widget class has such resources, this function provides descriptions of the resources in one or more data structures\&. \fBXmGetSecondaryResourceData\fP takes a widget class argument and returns the number of these data structures associated with the widget class\&. If the return value is greater than 0 (zero), the function allocates and fills an array of pointers to the corresponding data structures\&. It returns this array at the address that is the value of the \fIsecondary_data_return\fP argument\&. .PP The type \fBXmSecondaryResourceData\fR is a pointer to a structure with two members that are useful to an application: \fIresources\fP, of type \fBXtResourceList\fP, and \fBnum_resources\fP, of type \fBCardinal\fR\&. The \fIresources\fP member is a list of the widget resources that are not accessible using Xt functions\&. The \fBnum_resources\fP member is the length of the \fIresources\fP list\&. .PP If the return value is greater than 0 (zero), \fBXmGetSecondaryResourceData\fP allocates memory that the application must free\&. Use \fBXtFree\fP to free the resource list in each structure (the value of the \fIresources\fP member), the structures themselves, and the array of pointers to the structures (the array whose address is \fIsecondary_data_return\fP)\&. .IP "\fIwidget_class\fP" 10 Specifies the widget class for which secondary resource data is to be retrieved\&. .IP "\fIsecondary_data_return\fP" 10 Specifies a pointer to an array of \fBXmSecondaryResourceData\fR pointers to be returned by this function\&. If the widget class has no secondary resource data, for example, if the value returned by the function is 0 (zero), the function returns no meaningful value for this argument\&. .SH "RETURN" .PP Returns the number of secondary resource data structures associated with this widget class\&. .SH "EXAMPLE" .PP The following example uses \fBXmGetSecondaryResourceData\fP to print the names of the secondary resources of the Motif Text widget and then frees the data allocated by the function: .PP .nf \f(CWXmSecondaryResourceData * block_array; Cardinal num_blocks, i, j; if (num_blocks = XmGetSecondaryResourceData (xmTextWidgetClass, &block_array)) { for (i = 0; i < num_blocks; i++) { for (j = 0; j < block_array[i]->num_resources; j++) { printf("%s\en", block_array[i]->resources[j]\&.resource_name); } XtFree((char*)block_array[i]->resources); XtFree((char*)block_array[i]); } XtFree((char*)block_array); }\fR .fi .PP ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmTextInsert.30000644000175000017500000000511212672140200014434 00000000000000'\" t ...\" TxtInseA.sgm /main/8 1996/09/08 21:18:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextInsert" "library call" .SH "NAME" \fBXmTextInsert\fP \(em A Text function that inserts a character string into a text string .iX "XmTextInsert" .iX "Text functions" "XmTextInsert" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextInsert\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR, \fBchar \fB* value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextInsert\fP inserts a character string into the text string in the Text widget\&. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text\&. For example, to insert a string after the fourth character, the parameter \fIposition\fP must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as \fIposition\fP, the \fBXmNmotionVerifyCallback\fP is called\&. .PP Note that, if \fIvalue\fP is a null string, no callbacks will be generated, since no modifications will have been made\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fIposition\fP" 10 Specifies the position in the text string where the character string is to be inserted\&. .IP "\fIvalue\fP" 10 Specifies the character string value to be added to the text widget\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextInsertWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmTextGetBaseline.30000644000175000017500000000410412672140200015352 00000000000000'\" t ...\" TxtGetBa.sgm /main/12 1996/10/06 18:56:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetBaseline" "library call" .SH "NAME" \fBXmTextGetBaseline\fP \(em A Text function that accesses the y position of the baseline .iX "XmTextGetBaseline" .iX "Text functions" "XmTextGetBaseline" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextGetBaseline\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetBaseline\fP accesses the \fIy\fP position of the baseline in the Text widget, relative to the \fIy\fP position of the top of the widget\&. .PP In vertical mode (when the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP) this function returns 0 and the program should use \fBXmTextGetCenterline\fP .PP .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns an integer value that indicates the \fIy\fP position of the baseline in the Text widget\&. The calculation takes into account the margin height, shadow thickness, highlight thickness, and font ascent of the first font (set) in the fontlist used for drawing text\&. In this calculation, the \fIy\fP position of the top of the widget is 0 (zero)\&. .SH "RELATED" .PP \fBXmText\fP(3), \fBXmTextGetCenterline\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmStringTableProposeTablist.30000644000175000017500000000634012672140200017440 00000000000000'\" t ...\" StrTaC.sgm /main/8 1996/09/08 21:07:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringTableProposeTablist" "library call" .SH "NAME" \fBXmStringTableProposeTablist\fP \(em A convenience function that returns a tab list .iX "XmStringTableProposeTablist" .SH "SYNOPSIS" .PP .nf #include \fBXmTabList \fBXmStringTableProposeTablist\fP\fR( \fBXmStringTable \fBstrings\fR\fR, \fBCardinal \fBnum_strings\fR\fR, \fBWidget \fBwidget\fR\fR, \fBfloat \fBpad_value\fR\fR, \fBXmOffsetModel \fBoffset_model\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringTableProposeTablist\fP takes an \fBXmStringTable\fR structure containing tabbed compound strings, information on padding between columns, and rendering information and returns a tab list that, if used to render the strings in the table, would cause the strings to line up in columns with no overlap and with the specified amount of padding between the widest item in each column and the start of the next column\&. Each tab in the tablist would have the same unit type as \fIunits\fP, an offset model of \fIoffset_model\fP, and an alignment type of \fBXmALIGNMENT_BEGINNING\fP\&. .IP "\fIstrings\fP" 10 Specifies an array of compound strings\&. .IP "\fInum_strings\fP" 10 Specifies the number of compound strings in \fIstrings\fP\&. .IP "\fIwidget\fP" 10 Specifies the widget used for deriving any necessary information for creating the rendition\&. In particular, the \fBXmNunitType\fP of \fIwidget\fP will be used to specify the unit type to be used in determining the amount of padding separating columns and for the tabs in the proposed tab list\&. Also, \fIwidget\fP\&'s render table will be used in interpreting rendition tags within the strings\&. .IP "\fIpad_value\fP" 10 Specifies the value of the amount of padding to be used to separate columns\&. The units for this parameter are specified as the \fBXmNunitType\fP set for the \fIwidget\fP parameter\&. Refer to the \fBXmNunitType\fP resource of the \fBXmGadget\fP, \fBXmManager\fP, or \fBXmPrimitive\fP reference page\&. .IP "\fIoffset_model\fP" 10 Specifies the offset model to be used in creating the tabs\&. Can be \fBXmABSOLUTE\fP or \fBXmRELATIVE\fP\&. .SH "RETURN" .PP Returns a new \fBXmTabList\fR\&. The function allocates space to hold the returned tab list\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmTabListFree\fP\&. .SH "RELATED" .PP \fBXmTabList\fP(3) and \fBXmTabListFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmListUpdateSelectedList.30000644000175000017500000000334012672140200016707 00000000000000'\" t ...\" LstUpdat.sgm /main/8 1996/09/08 20:52:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListUpdateSelectedList" "library call" .SH "NAME" \fBXmListUpdateSelectedList\fP \(em A List function that updates the XmNselectedItems resource .iX "XmListUpdateSelectedList" .iX "List functions" "XmListUpdateSelectedList" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListUpdateSelectedList\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListUpdateSelectedList\fP frees the contents of the current \fBXmNselectedItems\fP list\&. The routine traverses the \fBXmNitems\fP list and adds each currently selected item to the \fBXmNselectedItems\fP list\&. For each selected item, there is a corresponding entry in the updated \fBXmNselectedItems\fP list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget to update .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmVaCreateManagedForm.30000644000175000017500000000003212672140200016112 00000000000000.so man3/XmVaCreateForm.3 motif-2.3.8/doc/man/man3/XmVaCreateScale.30000644000175000017500000000262112672140200014767 00000000000000.DT .TH "XmVaCreateScale" "library call" .SH "NAME" \fBXmVaCreateScale\fP, \fBXmVaCreateManagedScale\fP \(em A Scale widget convenience creation functions\&. .iX "XmVaCreateToggleScale" "XmVaCreateManagedScale" .iX "creation functions" "XmVaCreateScale" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateScale\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedScale\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateScale\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateScale\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Scale and its associated resources, see \fBXmScale\fP(3)\&. .SH "RETURN" .PP Returns the Scale widget ID\&. .SH "RELATED" .PP \fBXmScale\fP(3), \fBXmCreateScale\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateMenuShell.30000644000175000017500000000350112672140200015343 00000000000000'\" t ...\" CreMeB.sgm /main/7 1996/08/30 14:43:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateMenuShell" "library call" .SH "NAME" \fBXmCreateMenuShell\fP \(em The MenuShell widget creation function .iX "XmCreateMenuShell" .iX "creation functions" "XmCreateMenuShell" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateMenuShell\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateMenuShell\fP creates an instance of a MenuShell widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MenuShell and its associated resources, see \fBXmMenuShell\fP(3)\&. .SH "RETURN" .PP Returns the MenuShell widget ID\&. .SH "RELATED" .PP \fBXmMenuShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmFontList.30000644000175000017500000001163712672140200014076 00000000000000'\" t ...\" FontList.sgm /main/8 1996/09/08 20:43:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontList" "library call" .SH "NAME" \fBXmFontList\fR \(em Data type for a font list .iX "XmFontList" .iX "data types" "XmFontList" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmFontList\fR is the data type for a font list\&. A font list consists of font list entries\&. Each entry contains a font or a font set (a group of fonts) and is identified with a tag, which is optional\&. If this tag is NULL, the tag is set to \fBXmFONTLIST_DEFAULT_TAG\fP\&. .PP The value of \fBXmFONTLIST_DEFAULT_TAG\fP is \fBXmFONTLIST_DEFAULT_TAG_STRING\fP\&. .PP When a compound string is displayed, the font list element tag of the compound string segment is matched with a font list entry tag in the font list and the matching font list entry is used to display the compound string\&. A font list entry is chosen as follows: .IP " \(bu" 6 The first font list entry whose tag matches the tag of the compound string segment is used\&. .IP " \(bu" 6 If no match has been found and if the tag of the compound string segment is \fBXmFONTLIST_DEFAULT_TAG\fP, the first font list entry whose tag matches the tag that would result from creating an entry with \fBXmSTRING_DEFAULT_CHARSET\fP is used\&. For example, if creating an entry with \fBXmSTRING_DEFAULT_CHARSET\fP would result in the tag \fBISO8859-1\fP, the compound string segment tag \fBXmFONTLIST_DEFAULT_TAG\fP matches the font list entry tag \fBISO8859-1\fP\&. .IP " \(bu" 6 If no match has been found and if the tag of the compound string segment matches the tag that would result from creating a segment with \fBXmSTRING_DEFAULT_CHARSET\fP, the first font list entry whose tag is \fBXmFONTLIST_DEFAULT_TAG\fP is used\&. .IP " \(bu" 6 If no match has been found, the first entry in the font list is used\&. .PP The font list interface consists of the routines listed in \fBRelated Information\fP\&. .PP Font lists are specified in resource files with the following syntax: .PP .nf \fIresource_spec\fP\fB:\fP \fIfont_entry\fP [, \fIfont_entry\fP ]+ .fi .PP The resource value string consists of one or more font list entries separated by commas\&. Each \fIfont_entry\fP identifies a font or font set and an optional font list entry tag\&. A tag specified for a single font follows the font name and is separated by = (equals sign); otherwise, in a font set the tag is separated by a colon\&. The colon is required whether a tag is specified or not\&. A font entry uses the following syntax to specify a single font: .PP .nf \fIfont_name\fP [ \&'=\&' \fItag\fP ] .fi .PP For example, the following entry specifies a 10 point Times Italic font without a font list entry tag; .PP .nf \f(CW*fontList: -Adobe-Times-Medium-I-Normal--10*\fR .fi .PP .PP A font entry containing a font set is similar, except a semicolon separates multiple font names and the specification ends with a colon followed by an optional tag: .PP .nf \fIfont_name\fP [ \&';\&' \fIfont_name\fP ]+ \&':\&' [ \fItag\fP ] .fi .PP A \fIfont_name\fP is an X Logical Font Description (XLFD) string and \fItag\fP is any set of characters from ISO646IRV except space, comma, colon, equal sign and semicolon\&. Following is an example of a font set entry\&. It consists of three fonts (except for charsets), and an explicit font list entry tag\&. .PP .nf \f(CW*fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;\ -JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;\ -JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG\fR .fi .PP .PP Note that the \fBXmRenderTable\fR is another data type that can be used for font lists\&. Refer to the \fBXmRenderTable\fP(3) for details\&. .SH "RELATED" .PP \fBXmFontListAdd\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmFontListCopy\fP(3), \fBXmFontListCreate\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryFree\fP(3), \fBXmFontListEntryGetFont\fP(3), \fBXmFontListEntryGetTag\fP(3), \fBXmFontListEntryLoad\fP(3), \fBXmFontListFree\fP(3), \fBXmFontListFreeFontContext\fP(3), \fBXmFontListGetNextFont\fP(3), \fBXmFontListInitFontContext\fP(3), \fBXmFontListNextEntry\fP(3), \fBXmFontListRemoveEntry\fP(3), \fBXmRenderTable\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmRepTypeValidValue.30000644000175000017500000000424112672140200015672 00000000000000'\" t ...\" RepTypVa.sgm /main/8 1996/09/08 20:58:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeValidValue" "library call" .SH "NAME" \fBXmRepTypeValidValue\fP \(em A representation type manager function that tests the validity of a numerical value of a representation type resource .iX "XmRepTypeValidValue" .iX "representation type manager functions" "XmRepTypeValidValue" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmRepTypeValidValue\fP\fR( \fBXmRepTypeId \fBrep_type_id\fR\fR, \fBunsigned char \fBtest_value\fR\fR, \fBWidget \fBenable_default_warning\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRepTypeValidValue\fP tests the validity of a numerical value for a given representation type resource\&. The function generates a default warning message if the value is invalid and the \fIenable_default_warning\fP argument is non-NULL\&. .IP "\fIrep_type_id\fP" 10 Specifies the identification number of the representation type\&. .IP "\fItest_value\fP" 10 Specifies the numerical value to test\&. .IP "\fIenable_default_warning\fP" 10 Specifies the ID of the widget that contains a default warning message\&. If this parameter is NULL, no default warning message is generated and the application must provide its own error handling\&. .SH "RETURN" .PP Returns True if the specified value is valid; otherwise, returns False\&. .SH "RELATED" .PP \fBXmRepTypeGetId\fP(3) and \fBXmRepTypeRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmListItemPos.30000644000175000017500000000344412672140200014545 00000000000000'\" t ...\" LstItemP.sgm /main/8 1996/09/08 20:50:50 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListItemPos" "library call" .SH "NAME" \fBXmListItemPos\fP \(em A List function that returns the position of an item in the list .iX "XmListItemPos" .iX "List functions" "XmListItemPos" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmListItemPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListItemPos\fP returns the position of the first instance of the specified item in a list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIitem\fP" 10 Specifies the item whose position is returned .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns the position in the list of the first instance of the specified item\&. The position of the first item in the list is 1; the position of the second item is 2; and so on\&. This function returns 0 (zero) if the item is not found\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmFontListEntryLoad.30000644000175000017500000000740012672140200015711 00000000000000'\" t ...\" FontLstP.sgm /main/8 1996/09/08 20:44:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListEntryLoad" "library call" .SH "NAME" \fBXmFontListEntryLoad\fP \(em A font list function that loads a font or creates a font set and creates an accompanying font list entry .iX "XmFontListEntryLoad" .iX "font list functions" "XmFontListEntryLoad" .SH "SYNOPSIS" .PP .nf #include \fBXmFontListEntry \fBXmFontListEntryLoad\fP\fR( \fBDisplay *\fBdisplay\fR\fR, \fBchar *\fBfont_name\fR\fR, \fBXmFontType \fBtype\fR\fR, \fBchar *\fBtag\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListEntryLoad\fP loads a font or creates a font set based on the value of the \fItype\fP argument\&. It creates and returns a font list entry that contains the font or font set and the specified tag\&. .PP If the value of \fItype\fP is \fBXmFONT_IS_FONT\fP, the function uses the \fBXtCvtStringToFontStruct\fP routine to convert the value of \fIfont_name\fP to a font struct\&. If the value of \fItype\fP is \fBXmFONT_IS_FONTSET\fP, the function uses the \fBXtCvtStringToFontSet\fP converter to create a font set in the current locale\&. \fBXmFontListEntryLoad\fP creates a font list entry that contains the font or font set derived from the converter\&. For more information about \fBXtCvtStringToFontStruct\fP and \fBXtCvtStringToFontSet\fP, see \fIX Toolkit Intrinsics\(emC Language Interface\&.\fP .PP .IP "\fIdisplay\fP" 10 Specifies the display where the font list will be used\&. .IP "\fIfont_name\fP" 10 Specifies an X Logical Font Description (XLFD) string, which is interpreted either as a font name or as a base font name list\&. A base font name list is a comma-separated and NULL-terminated string\&. .IP "\fItype\fP" 10 Specifies whether the \fIfont_name\fP argument refers to a font name or to a base font name list\&. Valid values are \fBXmFONT_IS_FONT\fP and \fBXmFONT_IS_FONTSET\fP\&. .IP "\fItag\fP" 10 Specifies the tag of the font list entry to be created\&. The tag may be specified as \fBXmFONTLIST_DEFAULT_TAG\fP, which is used to identify the default font list element in a font list when specified as part of a resource\&. .SH "RETURN" .PP If the specified font is not found, or if the specified font set cannot be created, then either an implementation-defined font will be opened or a font set will be created, and a warning messge will be generated\&. If no suitable font can be found or a font set cannot be created, then another message will be generated and the function will return NULL; otherwise the function returns a font list entry\&. If the function returns a font list entry, the function allocates space to hold the font list entry\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmFontListEntryFree\fP\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryFree\fP(3), \fBXmFontListEntryGetFont\fP(3), \fBXmFontListEntryGetTag\fP(3), and \fBXmFontListRemoveEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmListAddItems.30000644000175000017500000000440012672140200014650 00000000000000'\" t ...\" LstAddIC.sgm /main/7 1996/08/30 15:38:50 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListAddItems" "library call" .SH "NAME" \fBXmListAddItems\fP \(em A List function that adds items to the list .iX "XmListAddItems" .iX "List functions" "XmListAddItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListAddItems\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString *\fBitems\fR\fR, \fBint \fBitem_count\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListAddItems\fP adds the specified items to the list at the given position\&. The first \fIitem_count\fP items of the \fIitems\fP array are added to the list\&. When the items are inserted into the list, they are compared with the current \fBXmNselectedItems\fP list\&. If any of the new items matches an item on the selected list, it appears selected\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List to which an item is added\&. .IP "\fIitems\fP" 10 Specifies a pointer to the items to be added to the list\&. .IP "\fIitem_count\fP" 10 Specifies the number of items in \fIitems\fP\&. This number must be nonnegative\&. .IP "\fIposition\fP" 10 Specifies the position of the first new item in the list\&. A value of 1 makes the first new item the first item in the list; a value of 2 makes it the second item; and so on\&. A value of 0 (zero) makes the first new item follow the last item in the list\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmStringDraw.30000644000175000017500000000642712672140200014421 00000000000000'\" t ...\" StrDrA.sgm /main/8 1996/09/08 21:04:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringDraw" "library call" .SH "NAME" \fBXmStringDraw\fP \(em A compound string function that draws a compound string in an X window .iX "XmStringDraw" .iX "compound string functions" "XmStringDraw" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmStringDraw\fP\fR( \fBDisplay \fB* d\fR\fR, \fBWindow \fBw\fR\fR, \fBXmRenderTable \fBrendertable\fR\fR, \fBXmString \fBstring\fR\fR, \fBGC \fBgc\fR\fR, \fBPosition \fBx\fR\fR, \fBPosition \fBy\fR\fR, \fBDimension \fBwidth\fR\fR, \fBunsigned char \fBalignment\fR\fR, \fBunsigned char \fBlayout_direction\fR\fR, \fBXRectangle \fB* clip\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringDraw\fP draws a compound string in an X Window\&. If a compound string segment uses a rendition that contains a font set, the graphic context passed to this routine will have the GC font member left in an undefined state\&. The underlying \fBXmbStringDraw\fP function called by this routine modifies the font ID field of the GC passed into it and does not attempt to restore the font ID to the incoming value\&. If the compound string segment is not drawn using a font set, the graphic context must contain a valid font member\&. Graphic contexts created by \fBXtGetGC\fP are not valid for this routine; instead, use \fBXtAllocateGC\fP to create a graphic context\&. .IP "\fId\fP" 10 Specifies the display\&. .IP "\fIw\fP" 10 Specifies the window\&. .IP "\fIrendertable\fP" 10 Specifies the render table\&. .IP "\fIstring\fP" 10 Specifies the string\&. .IP "\fIgc\fP" 10 Specifies the graphics context to use\&. .IP "\fIx\fP" 10 Specifies a coordinate of the rectangle that will contain the displayed compound string\&. .IP "\fIy\fP" 10 Specifies a coordinate of the rectangle that will contain the displayed compound string\&. .IP "\fIwidth\fP" 10 Specifies the width of the rectangle that will contain the displayed compound string\&. .IP "\fIalignment\fP" 10 Specifies how the string will be aligned within the specified rectangle\&. It is either \fBXmALIGNMENT_BEGINNING\fP, \fBXmALIGNMENT_CENTER\fP, or \fBXmALIGNMENT_END\fP\&. .IP "\fIlayout_direction\fP" 10 Controls the direction in which the segments of the compound string will be laid out\&. It also determines the meaning of the \fIalignment\fP parameter\&. .IP "\fIclip\fP" 10 Allows the application to restrict the area into which the compound string will be drawn\&. If the value is NULL, clipping will be determined by the GC\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmCreateMessageBox.30000644000175000017500000000441612672140200015512 00000000000000'\" t ...\" CreMeC.sgm /main/8 1996/09/08 20:33:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateMessageBox" "library call" .SH "NAME" \fBXmCreateMessageBox\fP \(em The MessageBox widget creation function .iX "XmCreateMessageBox" .iX "creation functions" "XmCreateMessageBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateMessageBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateMessageBox\fP creates an unmanaged MessageBox\&. A MessageBox is used for common interaction tasks, which include giving information, asking questions, and reporting errors\&. It includes an optional symbol, a message, and three buttons\&. .PP By default, there is no symbol\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. .PP If the parent of the MessageBox is a DialogShell, use \fBXtManageChild\fP to pop up the MessageBox (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmVaCreateComboBox.30000644000175000017500000000264612672140200015457 00000000000000.DT .TH "XmVaCreateComboBox" "library call" .SH "NAME" \fBXmVaCreateComboBox\fP, \fBXmVaCreateManagedComboBox\fP \(em A ComboBox widget convenience creation functions\&. .iX "XmVaCreateComboBox" "XmVaCreateManagedComboBox" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateComboBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedComboBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ComboBox widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateComboBox\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedComboBox\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ComboBox and its associated resources, see \fBXmComboBox\fP(3)\&. .SH "RETURN" .PP Returns the ComboBox widget ID\&. .SH "RELATED" .PP \fBXmComboBox\fP(3), \fBXmCreateComboBox\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmHierarchyOpenAllAncestors.30000644000175000017500000000277312672140200017410 00000000000000'\" t ...\" LstAddIA.sgm /main/7 1996/08/30 15:38:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmHierarchyOpenAllAncestors" "library call" .SH "NAME" \fBXmHierarchyOpenAllAncestors\fP \(em A Hierarchy function that opens all ancestors of the Hierarchy .iX "XmListAddItem" .iX "List functions" "XmListAddItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmHierarchyOpenAllAncestors\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmHierarchyOpenAllAncestors\fP opens all ancestors of a given node assuring that the node will be visible to the user\&. .IP "\fIwidget\fP" 10 Specifies the ID of the node widget that would like to be shown\&. .PP For a complete definition of Hierarchy and its associated resources, see \fBXmHierarchy\fP(3)\&. .SH "RELATED" .PP \fBXmHierarchy\fP(3)\&. motif-2.3.8/doc/man/man3/XmStringByteStreamLength.30000644000175000017500000000314712672140200016741 00000000000000'\" t ...\" StrByB.sgm /main/6 1996/08/25 22:22:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringByteStreamLength" "library call" .SH "NAME" \fBXmStringByteStreamLength\fP \(em A function that returns the size of a string .iX "XmStringByteStreamLength" .SH "SYNOPSIS" .PP .nf #include unsigned int XmStringByteStreamLength (\fIstring\fP) unsigned char *\fIstring\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmStringByteStreamLength\fP receives a byte stream format string and returns the size, in bytes, of that stream, including the header\&. Because of this header information, even a NULL \fIstring\fP will cause \fBXmStringByteStreamLength\fP to return a non-zero value\&. .IP "\fIstring\fP" 10 Specifies the byte stream format string\&. .SH "RETURN VALUES" .PP Returns the size of \fIstring\fP, including the header\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmCreateToggleButton.30000644000175000017500000000354312672140200016072 00000000000000'\" t ...\" CreToA.sgm /main/7 1996/08/30 14:57:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateToggleButton" "library call" .SH "NAME" \fBXmCreateToggleButton\fP \(em The ToggleButton widget creation function .iX "XmCreateToggleButton" .iX "creation functions" "XmCreateToggleButton" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateToggleButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateToggleButton\fP creates an instance of a ToggleButton widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ToggleButton and its associated resources, see \fBXmToggleButton\fP(3)\&. .SH "RETURN" .PP Returns the ToggleButton widget ID\&. .SH "RELATED" .PP \fBXmToggleButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmContainer.30000644000175000017500000023032212672140200014250 00000000000000'\" t ...\" ContainA.sgm /main/12 1996/09/08 20:31:35 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainer" "library call" .SH "NAME" \fBXmContainer\fP \(em The Container widget class .iX "XmContainer" .iX "container" "Container" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Container manages child widgets that have the \fBContainerItem\fP trait\&. These child widgets can be viewed in several different layout formats, selected using different selection types and techniques, and directly manipulated by the user\&. .PP Three different formats or views are supported by the Container\&. They are specified via the \fBXmNentryViewType\fP resource: .IP " \(bu" 6 \fBXmLARGE_ICON\fP .IP " \(bu" 6 \fBXmSMALL_ICON\fP .IP " \(bu" 6 \fBXmANY_ICON\fP .PP Three different layout types are supported by the Container\&. They are specified by the \fBXmNlayoutType\fP resource: .IP " \(bu" 6 \fBXmSPATIAL\fP .IP " \(bu" 6 \fBXmOUTLINE\fP .IP " \(bu" 6 \fBXmDETAIL\fP .PP In the \fBXmSPATIAL\fP layout type, several other resources (\fBXmNspatialStyle\fP, \fBXmNspatialIncludeModel\fP, \fBXmNspatialSnapModel\fP) control the positioning of the items within the Container; an application programmer can specify these resources so that the Container strictly enforces the position of each item or so that the Container positions items according to constraint resources specified for each item\&. The user, however, can alter the position of an item in the \fBXmSPATIAL\fP layout type within the Container by direct manipulation; for example, by pressing \fBBTransfer\fP over the item and then dragging and releasing \fBBTransfer\fP over some location within the Container\&. .PP In the \fBXmOUTLINE\fP layout type, the Container controls the positioning of the items\&. Items within the Container can have parent-child relationships between them\&. Each item\&'s \fBXmNentryParent\fP resource can specify another item in the same Container as its parent; items with a non-NULL value for \fBXmNentryParent\fP can only be displayed in the \fBXmOUTLINE\fP layout type\&. In the \fBXmOUTLINE\fP layout type, items are positioned in a tree configuration with connecting lines drawn to illustrate the relationships\&. Items are positioned top to bottom in the order specified by \fBXmNpositionIndex\fP within their parent\&. Container positions a PushButton next to each item that has a parent relationship to other items\&. The PushButton contains a pixmap to illustrate whether the child items are shown or not; the user can activate the PushButton to toggle between showing or hiding the child items\&. Direct manipulation to alter the position of the item is not supported in the \fBXmOUTLINE\fP layout type\&. Note that the \fBXmNtraversalOn\fP resource of the PushButtons created by Container are set to False\&. .PP The \fBXmDETAIL\fP layout type is the same as \fBXmOUTLINE\fP, except that each item can also display additional information as rows in columns with column headers specified in the \fBXmNdetailColumnHeading\fP resources\&. In each item row, the item\&'s detail information (see the reference page on \fBXmIconGadget\fR for a description of the \fBXmNentryDetail\fP resource) is displayed\&. Items are positioned top to bottom in the order specified by \fBXmNpositionIndex\fP within the parent\&. .SS "Selection" .PP When a child widget of the container is selected, the container specifies that the item should display the appropriate visual information to the user via the \fBContainerItem\fP trait\&. The application program is notified of selection changes through \fBXmNselectionCallback\fP\&. .PP The container uses four selection policies: .IP " \(bu" 6 Single .IP " \(bu" 6 Browse .IP " \(bu" 6 Multiple .IP " \(bu" 6 Extended .PP In Single Select and Browse Select modes, only one item can be selected at a time\&. Pressing \fBBSelect\fP on an item selects it and deselects any other selected item\&. Pressing \fBBSelect\fP over an empty space in the Container deselects all items\&. In Browse Select, dragging \fBBSelect\fP moves the selection as the pointer is moved\&. .PP In Multiple Select and Extended Select modes, any number of items can be selected at the same time\&. In Multiple Select, pressing and dragging \fBBSelect\fP or \fBBExtend\fP to specify an item, range of items, or group of discontiguous items causes the selection states of those items to be toggled\&. In Extended Select, pressing and dragging \fBBSelect\fP to indicate an item, range of items, or group of discontiguous items selects those items and deselects all others\&. Pressing and dragging \fBBExtend\fP in Extended Select to indicate an item, range of items, or discontiguous group of items causes the selection states of those items to be toggled\&. .PP Several techniques are available to indicate an item, range of items, or group of discontiguous items in the Multiple Select and Extended Select modes\&. .PP In the \fBXmSPATIAL\fP and \fBXmOUTLINE\fP layout types, the \fBXmNselectionTechnique\fP resource specifies the techniques to be used to indicate items\&. The default specification of \fBXmTOUCH_OVER\fP allows both the Random-Swipe and Marquee techniques to be used when \fBXmNlayoutStyle\fP is \fBXmSPATIAL\fP\&. The default specification of \fBXmTOUCH_OVER\fP allows the Range-Swipe, Range-Click, and Marquee techniques to be used when \fBXmNlayoutStyle\fP is \fBXmOUTLINE\fP\&. .PP Discontiguous groups of items can be selected using the Random-Swipe technique\&. In the Random-Swipe technique, pressing \fBBSelect\fP (or \fBBExtend\fP) over an item and dragging \fBBSelect\fP over other items selects all of those items\&. Only those items that pointer passed over are selected\&. .PP In the Range-Swipe technique, the user presses \fBBSelect\fP (or \fBBExtend\fP) over the first item and releases \fBBSelect\fP over the last item; all items within the range between the first and last item are selected whether the pointer actually passed over them or not\&. In the Range-Click technique, the user presses and releases \fBBSelect\fP (or \fBBExtend\fP) over the first item and then presses and releases \fBBExtend\fP over the last item\&. .PP In the Marquee technique, pressing \fBBSelect\fP (or \fBBExtend\fP) over a blank space within the Container indicates the starting point of a Marquee rectangle\&. Dragging \fBBSelect\fP draws a Marquee rectangle (rubberband line) between the starting point and current pointer\&. All items completely within the Marquee rectangle are selected\&. .PP Specifying \fBXmTOUCH_ONLY\fP for \fBXmNselectionTechnique\fP enforces the Random-Swipe technique even when \fBBSelect\fP (or \fBBExtend\fP) is pressed over a blank space\&. Similarly, specifying \fBXmMARQUEE\fP enforces the Marquee technique even when \fBBSelect\fP (or \fBBExtend\fP) is pressed over an item; since the item over which the press occurs is only partially included in the Marquee rectangle, it is not selected\&. \fBXmMARQUEE_EXTEND_START\fP and \fBXmMARQUEE_EXTEND_BOTH\fP enforce the Marquee technique and also cause the rectangle to extend automatically around the first item indicated and, for \fBXmMARQUEE_EXTEND_BOTH\fP, the last item\&. .PP In the \fBXmDETAIL\fP layout type, the Range-Swipe and Range-Click techniques are available to indicate a range of items for selection\&. .PP Container uses the \fBXmQTcontainerItem\fP, \fBXmQTscrollFrame\fP, and \fBXmQTspecifyRenderTable\fP traits and holds the \fBXmQTcontainer\fP and \fBXmQTtransfer\fP traits\&. .SS "Data Transfer Behavior" .PP Container supports dragging of selected items from the widget\&. Depending on the value of \fBXmNprimaryOwnership\fP, Container can also support primary selection\&. .PP As a source of data, Container supports the following targets and associated conversions of data to these targets: .IP "\fIlocale\fP" 10 If the \fIlocale\fP target matches the widget\&'s locale, the widget transfers the selected items in the encoding of the locale\&. The value for each item transferred, except the last, includes a trailing separator\&. Each item value is the \fBXmNlabelString\fP of the item\&. .IP "\fBCOMPOUND_TEXT\fP" 10 The widget transfers the selected items as type \fBCOMPOUND_TEXT\fP\&. The value for each item transferred, except the last, includes a trailing separator\&. Each item value is the \fBXmNlabelString\fP of the item\&. .IP "\fBDELETE\fP" 10 The widget deletes the selected items\&. .IP "\fBPIXMAP\fP" 10 The widget transfers a list of the pixmap IDs of the selected items as type \fBDRAWABLE\fP\&. .IP "\fBSTRING\fP" 10 The widget transfers the selected items as type \fBSTRING\fP\&. The value for each item transferred, except the last, includes a trailing separator\&. Each item value is the \fBXmNlabelString\fP of the item\&. .IP "\fBTEXT\fP" 10 If the selected items are fully convertible to the encoding of the locale, the widget transfers the selected items in the encoding of the locale\&. Otherwise, the widget transfers the selected items as type \fBCOMPOUND_TEXT\fP\&. The value for each item transferred, except the last, includes a trailing separator\&. Each item value is the \fBXmNlabelString\fP of the item\&. .IP "\fB_MOTIF_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for immediate transfer for the \fBCLIPBOARD\fP selection\&. These include \fB_MOTIF_COMPOUND_STRING\fP and \fBPIXMAP\fP\&. If the selected items are fully convertible to \fBSTRING\fP, these also include \fBSTRING\fP; otherwise, they also include \fBCOMPOUND_TEXT\fP and \fBUTF8_STRING\fP\&. .IP "\fB_MOTIF_COMPOUND_STRING\fP" 10 The widget transfers the selected items as a compound string in Byte Stream format\&. The value for each item transferred, except the last, includes a trailing separator\&. Each item value is the \fBXmNlabelString\fP of the item\&. .IP "\fBUTF8_STRING\fP" 10 The widget transfers the selected items as type \fBUTF8_STRING\fP\&. The value for each item transferred, except the last, includes a trailing separator\&. Each item value is the \fBXmNlabelString\fP of the item\&. .IP "\fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for delayed transfer for the \fBCLIPBOARD\fP selection\&. This widget currently supplies no targets for \fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP\&. .IP "\fB_MOTIF_DRAG_OFFSET\fP" 10 The widget transfers a list of two 16-bit numbers, of type \fBINTEGER\fP, representing an x and y offset for an item being dragged\&. This offset is calculated so that, if the offset were added to the x and y coordinates at the drop site, and the dragged pixmap placed at that position, it would correspond to the position the user would expect the pixmap to placed at, based on the drag icon used at the drop site\&. .IP "\fB_MOTIF_EXPORT_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to be used as the value of the DragContext\&'s \fBXmNexportTargets\fP in a drag-and-drop transfer\&. These include \fB_MOTIF_COMPOUND_STRING\fP, \fBPIXMAP\fP, \fBCOMPOUND_TEXT\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP, \fBBACKGROUND\fP, \fBFOREGROUND\fP, and \fBUTF8_STRING\fP\&. .PP As a source of data, Container also supports the following standard Motif targets: .IP "\fBBACKGROUND\fP" 10 The widget transfers \fBXmNbackground\fP as type \fBPIXEL\fP\&. .IP "\fBCLASS\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_CLASS\fP property and transfers the contents as text in the current locale\&. .IP "\fBCLIENT_WINDOW\fP" 10 The widget finds the first shell in the widget hierarchy and transfers its window as type \fBWINDOW\fP\&. .IP "\fBCOLORMAP\fP" 10 The widget transfers \fBXmNcolormap\fP as type \fBCOLORMAP\fP\&. .IP "\fBFOREGROUND\fP" 10 The widget transfers \fBXmNforeground\fP as type \fBPIXEL\fP\&. .IP "\fBNAME\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_NAME\fP property and transfers the contents as text in the current locale\&. .IP "\fBTARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports\&. These include the standard targets in this list\&. These also include \fB_MOTIF_COMPOUND_STRING\fP, \fBPIXMAP\fP, \fBCOMPOUND_TEXT\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP, and \fBUTF8_STRING\fP\&. .IP "\fBTIMESTAMP\fP" 10 The widget transfers the timestamp used to acquire the selection as type \fBINTEGER\fP\&. .IP "\fB_MOTIF_RENDER_TABLE\fP" 10 The widget transfers \fBXmNrenderTable\fP if it exists, or else the default text render table, as type \fBSTRING\fP\&. .IP "\fB_MOTIF_ENCODING_REGISTRY\fP" 10 The widget transfers its encoding registry as type \fBSTRING\fP\&. The value is a list of NULL separated items in the form of tag encoding pairs\&. This target symbolizes the transfer target for the Motif Segment Encoding Registry\&. Widgets and applications can use this Registry to register text encoding formats for specified render table tags\&. Applications access this Registry by calling \fBXmRegisterSegmentEncoding\fP and \fBXmMapSegmentEncoding\fP\&. .PP As a destination for data, Container supports only the dropping of items being dragged from the same widget\&. Subclasses and the \fBXmNdestinationCallback\fP procedures are responsible for any other data transfers to the widget\&. .SS "Classes" .PP Container inherits behavior, resources, and traits from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmContainerWidgetClass\fP\&. .PP The class name is \fBXmContainer\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate whether the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmContainer Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNautomaticSelectionXmCAutomaticSelectionunsigned charXmAUTO_SELECTCSG _____ XmNcollapsedStatePixmapXmCCollapsedStatePixmapPixmapdynamicCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNdefaultActionCallbackXmCCallbackXtCallbackListNULLC _____ XmNdestinationCallbackXmCCallbackXtCallbackListNULLC _____ XmNdetailColumnHeadingXmCDetailColumnHeadingXmStringTableNULLCSG _____ XmNdetailColumnHeadingCountXmCDetailColumnHeadingCountCardinal0CSG _____ XmNdetailOrderXmCDetailOrderCardinal *NULLCSG _____ XmNdetailOrderCountXmCDetailOrderCountCardinaldynamicCSG _____ XmNdetailTabListXmCDetailTabListXmTabListNULLCSG _____ XmNentryViewTypeXmCEntryViewTypeunsigned charXmANY_ICONCSG _____ XmNexpandedStatePixmapXmCExpandedStatePixmapPixmapdynamicCSG _____ XmNfontListXmCFontListXmFontListNULLCSG _____ XmNlargeCellHeightXmCCellHeightDimensiondynamicCSG _____ XmNlargeCellWidthXmCCellWidthDimensiondynamicCSG _____ XmNlayoutTypeXmCLayoutTypeunsigned charXmSPATIALCSG _____ XmNmarginHeightXmCMarginHeightDimension0CSG _____ XmNmarginWidthXmCMarginWidthDimension0CSG _____ XmNoutlineButtonPolicyXmCOutlineButtonPolicyunsigned charXmOUTLINE_BUTTON_PRESENTCSG _____ XmNoutlineChangedCallbackXmCCallbackXtCallbackListNULLC _____ XmNoutlineColumnWidthXmCOutlineColumnWidthDimensiondynamicCSG _____ XmNoutlineIndentationXmCOutlineIndentationDimension40CSG _____ XmNoutlineLineStyleXmCLineStyleunsigned charXmSINGLECSG _____ XmNprimaryOwnershipXmCprimaryOwnershipunsigned charXmOWN_POSSIBLE_MULTIPLECSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNselectColorXmCSelectColorPixeldynamicCSG _____ XmNselectedObjectsXmCSelectedObjectsWidgetListNULLSG _____ XmNselectedObjectCountXmCSelectedObjectCountunsigned int0SG _____ XmNselectionCallbackXmCCallbackXtCallbackListNULLC _____ XmNselectionPolicyXmCSelectionPolicyunsigned charXmEXTENDED_SELECTCSG _____ XmNselectionTechniqueXmCSelectionTechniqueunsigned charXmTOUCH_OVERCSG _____ XmNsmallCellHeightXmCCellHeightDimensiondynamicCSG _____ XmNsmallCellWidthXmCCellWidthDimensiondynamicCSG _____ XmNspatialIncludeModelXmCSpatialIncludeModelunsigned charXmAPPENDCSG _____ XmNspatialResizeModelXmCSpatialResizeModelunsigned charXmGROW_MINORCSG _____ XmNspatialSnapModelXmCSpatialSnapModelunsigned charXmNONECSG _____ XmNspatialStyleXmCSpatialStyleunsigned charXmGRIDCSG _____ .TE .IP "\fBXmNautomaticSelection\fP" 10 Indicates whether the Container invokes selection callbacks when each item is selected (or toggled) or whether selection callbacks are not invoked until the user has completed selection actions (for example, the user has released the mouse button)\&. It can have one of the following values: .RS .IP "\fBXmAUTO_SELECT\fP" 10 Makes selection callbacks automatically when each item is selected or toggled\&. This may also be the value \fBTRUE\fP\&. .IP "\fBXmNO_AUTO_SELECT\fP" 10 Delays selection callbacks until the user has finished selection actions\&. This may also be the value \fBFALSE\fP\&. .RE .IP "\fBXmNcollapsedStatePixmap\fP" 10 Specifies the pixmap to display on a PushButton next to a Container item with child items, when \fBXmNoutlineButtonPolicy\fP is \fBXmOUTLINE_BUTTON_PRESENT\fP\&. \fBXmNcollapsedStatePixmap\fP indicates that the child items are not displayed\&. If set to \fBXmUNSPECIFIED_PIXMAP\fP, a default pixmap showing an arrow pointing up is used\&. .IP "\fBXmNconvertCallback\fP" 10 Specifies a list of callbacks called when the Container is asked to convert a selection\&. The type of the structure whose address is passed to these callbacks is \fBXmConvertCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNdefaultActionCallback\fP" 10 Specifies a list of callbacks to call when the user double-clicks an item or presses \fB\fP or \fB\fP over an item\&. The callback structure is \fBXmContainerSelectCallbackStruct\fR\&. The reason is \fBXmCR_DEFAULT_ACTION\fP\&. .IP "\fBXmNdestinationCallback\fP" 10 Specifies a list of callbacks called when the Container is the destination of a transfer operation\&. The type of the structure whose address is passed to these callbacks is \fBXmDestinationCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNdetailColumnHeading\fP" 10 Specifies a table of \fBXmString\fRs to display as the headings to columns\&. If NULL, or if \fBXmNlayoutType\fP is not \fBXmDETAIL\fP, no heading is displayed\&. .IP "\fBXmNdetailColumnHeadingCount\fP" 10 Specifies a count of \fBXmString\fRs in the table specified for \fBXmNdetailColumnHeading\fP\&. .IP "\fBXmNdetailOrder\fP" 10 Specifies an array of \fBCardinal\fRs that indicate which column detail information, and in which order, each Container child will display its detail information\&. This resource is ignored if \fBXmNlayoutType\fP is not \fBXmDETAIL\fP\&. If NULL, the the default behavior is determined by \fBXmNdetailOrderCount\fP\&. .IP "\fBXmNdetailOrderCount\fP" 10 Specifies a count of \fBCardinal\fRs in the array specified for \fBXmNdetailOrder\fP\&. If \fBXmNdetailOrder\fP is NULL and \fBXmNdetailOrderCount\fP is not 0, then each Container child displays its detail information in order from column 1 to the \fBXmNdetailOrderCount\fP column number\&. If \fBXmNdetailOrderCount\fP is 0, then a default is calculated from the detail order count information of each item accessed via the \fBContainerItem\fP trait\&. .IP "\fBXmNdetailTabList\fP" 10 Indicates an \fBXmTabList\fR specifying the start of each column in the \fBXmDETAIL\fP layout\&. If this resource is set to NULL, then Container calculates an \fBXmTabList\fR\&. This resource is ignored if \fBXmNlayoutType\fP is not \fBXmDETAIL\fP\&. .IP "\fBXmNentryViewType\fP" 10 Specifies the view type for all Container children\&. The view type is specified for each item via the \fBContainerItem\fP trait\&. It can have one of the following values: .RS .IP "\fBXmANY_ICON\fP" 10 No specification is made for Container children\&. Children use their own default specifications\&. .IP "\fBXmLARGE_ICON\fP" 10 The view type for all children is \fBXmLARGE_ICON\fP\&. .IP "\fBXmSMALL_ICON\fP" 10 The view type for all children is \fBXmSMALL_ICON\fP\&. .RE .IP "\fBXmNexpandedStatePixmap\fP" 10 Specifies the pixmap to display on a PushButton next to a Container item with child items, when \fBXmNoutlineButtonPolicy\fP is \fBXmOUTLINE_BUTTON_PRESENT\fP\&. \fBXmNexpandedStatePixmap\fP indicates that the child items are displayed\&. If set to \fBXmUNSPECIFIED_PIXMAP\fP, a default pixmap showing an arrow pointing down is used\&. .IP "\fBXmNfontList\fP" 10 Specifies the fontlist associated with \fBXmContainer\fP\&. The fontlist is an obsolete construct and has been superseded by the render table\&. It is included for compatibility with earlier versions of Motif, and for applications that do not easily support render tables\&. The default fontlist is derived from the default render table; and if both a fontlist and a render table are specified, the render table takes precedence\&. .IP "\fBXmNlargeCellHeight\fP" 10 Specifies the height of a cell for \fBXmGRID\fP or \fBXmCELLS\fP spatial style when \fBXmNentryViewType\fP is \fBXmLARGE_ICON\fP or \fBXmANY_ICON\fP\&. .IP "\fBXmNlargeCellWidth\fP" 10 Specifies the width of a cell for \fBXmGRID\fP or \fBXmCELLS\fP spatial style when \fBXmNentryViewType\fP is \fBXmLARGE_ICON\fP or \fBXmANY_ICON\fP\&. .IP "\fBXmNlayoutType\fP" 10 Specifies the policy for laying out child widgets within the Container\&. It can have one of the following values: .RS .IP "\fBXmDETAIL\fP" 10 Displays items in the same manner as when the resource is \fBXmOUTLINE\fP, except that each item displays detail information next to it\&. .IP "\fBXmOUTLINE\fP" 10 Displays items in a tree configuration, in \fBXmNpositionIndex\fP within \fBXmNentryParent\fP order, with connecting lines drawn to show their parent-child relationships\&. .IP "\fBXmSPATIAL\fP" 10 Displays items according to \fBXmNspatialStyle\fP\&. Items with \fBXmNentryParent\fP values are not displayed\&. .RE .IP "\fBXmNmarginHeight\fP" 10 Specifies the margin spacing at the top and bottom of the Container\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the margin spacing at the left and right sides of the Container\&. .IP "\fBXmNoutlineButtonPolicy\fP" 10 Specifies whether or not to display buttons for users to expand and collapse the display of items\&. It can have one of the following values: .RS .IP "\fBXmOUTLINE_BUTTON_ABSENT\fP" 10 Do not display the outline buttons\&. .IP "\fBXmOUTLINE_BUTTON_PRESENT\fP" 10 Display the outline buttons\&. .RE .IP "\fBXmNoutlineChangedCallback\fP" 10 Specifies a list of callbacks to call when an item\&'s \fBXmNoutlineState\fP is changed\&. The callback structure is \fBXmContainerOutlineCallbackStruct\fR\&. The reason is \fBXmCR_COLLAPSED\fP or \fBXmCR_EXPANDED\fP, depending on the new value of \fBXmNoutlineState\fP\&. .IP "\fBXmNoutlineColumnWidth\fP" 10 Specifies the width of the first column displayed when \fBXmNlayoutType\fP is \fBXmDETAIL\fP\&. Specifies the preferred width of the Container (without the margins) when \fBXmNlayoutType\fP is \fBXmOUTLINE\fP\&. If not specified, Container will determine a default value equal to the widest space necessary to display an item\&'s pixmap and \fBXmNoutlineIndentation\fP\&. .IP "\fBXmNoutlineIndentation\fP" 10 Specifies the distance to indent for the display of child items when \fBXmNlayoutType\fP is \fBXmOUTLINE\fP or \fBXmDETAIL\fP\&. .IP "\fBXmNoutlineLineStyle\fP" 10 Specifies whether to draw lines between items with parent-child relationships when \fBXmNlayoutType\fP is \fBXmOUTLINE\fP or \fBXmDETAIL\fP\&. It can have one of the following values: .RS .IP "\fBXmNO_LINE\fP" 10 Draws no line\&. .IP "\fBXmSINGLE\fP" 10 Draws a line one pixel wide\&. .RE .IP "\fBXmNprimaryOwnership\fP" 10 Specifies whether Container takes ownership of the primary selection when a selection is made inside it\&. This resource can take the following values: .RS .IP "\fBXmOWN_NEVER\fP" 10 Never takes ownership\&. .IP "\fBXmOWN_ALWAYS\fP" 10 Always takes ownership\&. .IP "\fBXmOWN_MULTIPLE\fP" 10 Only takes ownership if more than one element has been selected\&. .IP "\fBXmOWN_POSSIBLE_MULTIPLE\fP" 10 Only takes ownership if more than one element can be selected at a time\&. .RE .IP "\fBXmNrenderTable\fP" 10 Specifies the \fBXmRenderTable\fR that is inherited by all children of the Container\&. The default is implementation dependent\&. If both a render table and a fontlist are specified, the render table will take precedence\&. .IP "\fBXmNselectColor\fP" 10 Specifies a Pixel that can be accessed by children of the Container and used to indicate that the child is in a selected state\&. In addition to a Pixel value, the following symbolic values can be specified: .RS .IP "\fBXmDEFAULT_SELECT_COLOR\fP" 10 Specifies a color between the background and the bottom shadow color\&. .IP "\fBXmREVERSED_GROUND_COLORS\fP" 10 Forces the select color to the foreground color and causes the default color of any text rendered over the select color to be the background color\&. .IP "\fBHIGHLIGHT_COLOR\fP" 10 Forces the fill color to use the highlight color\&. .RE .IP "\fBXmNselectedObjectCount\fP" 10 Specifies the number of widgets in the selected items list\&. The value must be the number of items in \fBXmNselectedObjects\fP\&. .IP "\fBXmNselectedObjects\fP" 10 An array of widgets that represents the Container items that are currently selected, either by the user or by the application\&. .IP "" 10 If the application sets \fBXmNselectedObjects\fP to an array of widgets, those array elements that are valid Container items are selected\&. .IP "\fBXmNselectionCallback\fP" 10 Specifies a list of callbacks to call when an item is selected\&. The callback structure is \fBXmContainerSelectCallbackStruct\fR\&. The reason is \fBXmCR_SINGLE_SELECT\fP, \fBXmCR_BROWSE_SELECT\fP, \fBXmCR_MULTIPLE_SELECT\fP, or \fBXmCR_EXTENDED_MULTIPLE\fP, depending on \fBXmNselectionPolicy\fP\&. .IP "\fBXmNselectionPolicy\fP" 10 Defines the interpretation of the selection action\&. This can be one of the following values: .RS .IP "\fBXmSINGLE_SELECT\fP" 10 Allows only single selections\&. .IP "\fBXmBROWSE_SELECT\fP" 10 Allows "drag and browse" selections\&. .IP "\fBXmMULTIPLE_SELECT\fP" 10 Allows multiple selections\&. .IP "\fBXmEXTENDED_SELECT\fP" 10 Allows extended selections\&. .RE .IP "\fBXmNselectionTechnique\fP" 10 Specifies the selection technique to use when the Container displays items in a 2-dimensional layout (\fBXmNentryViewType\fP is \fBXmLARGE_ICON\fP or \fBXmSMALL_ICON\fP)\&. In the \fBXmDETAIL\fP layout, the \fBXmNselectionTechnique\fP resource is treated as \fBXmTOUCH_ONLY\fP\&. In either case, it can have one of the following values: .RS .IP "\fBXmMARQUEE\fP" 10 Uses the Marquee technique only\&. .IP "\fBXmMARQUEE_EXTEND_START\fP" 10 Uses the Marquee technique only and extends the Marquee rectangle around any item under the Marquee start point\&. .IP "\fBXmMARQUEE_EXTEND_BOTH\fP" 10 Uses the Marquee technique only and extends the Marquee rectangle around any items under the Marquee start and end points\&. .IP "\fBXmTOUCH_ONLY\fP" 10 Uses the Random-Swipe technique only if \fBXmNlayoutType\fP is \fBXmSPATIAL\fP\&. Otherwise, uses the Range-Swipe and Range-Click techniques\&. .IP "\fBXmTOUCH_OVER\fP" 10 If the selection action begins over an item and \fBXmNlayoutType\fP is \fBXmSPATIAL\fP, uses the Random-Swipe technique\&. If the selection action begins over an item and \fBXmNlayoutType\fP is \fBXmOUTLINE\fP or \fBXmDETAIL\fP, uses the Range-Swipe and Range-Click techniques\&. Uses the Marquee technique if the select action begins over an unoccupied area in the Container\&. .RE .IP "\fBXmNsmallCellHeight\fP" 10 Specifies the height of a cell for \fBXmGRID\fP or \fBXmCELLS\fP spatial style when \fBXmNentryViewType\fP is \fBXmSMALL_ICON\fP\&. .IP "\fBXmNsmallCellWidth\fP" 10 Specifies the width of a cell for \fBXmGRID\fP or \fBXmCELLS\fP spatial style when \fBXmNentryViewType\fP is \fBXmSMALL_ICON\fP\&. .IP "\fBXmNspatialIncludeModel\fP" 10 Specifies the layout of an item when the item is managed in the Container when \fBXmNlayoutType\fP is \fBXmSPATIAL\fP and \fBXmNspatialStyle\fP is \fBXmGRID\fP or \fBXmCELLS\fP\&. It can have one of the following values: .RS .IP "\fBXmAPPEND\fP" 10 Places the item after the last occupied cell according to \fBXmNlayoutDirection\fP\&. .IP "\fBXmCLOSEST\fP" 10 Places the item in the free cell closest to the position specified by \fBXmNx\fP and \fBXmNy\fP\&. .IP "\fBXmFIRST_FIT\fP" 10 Places the item in the first free cell according to \fBXmNlayoutDirection\fP\&. .RE .IP "\fBXmNspatialResizeModel\fP" 10 Specifies how Container will attempt to grow its dimensions when \fBXmNlayoutType\fP is \fBXmSPATIAL\fP and \fBXmNspatialStyle\fP is \fBXmGRID\fP or \fBXmCELLS\fP and there are not enough cells to contain a new Container item\&. It can have one of the following values: .RS .IP "\fBXmGROW_BALANCED\fP" 10 Container will request both width and height growth from its parent\&. .IP "\fBXmGROW_MAJOR\fP" 10 Container will request growth in its major dimension from its parent\&. Container\&'s major dimension is width when the precedence of \fBXmNlayoutDirection\fP is horizontal, and height when vertical\&. .IP "\fBXmGROW_MINOR\fP" 10 Container will request growth in its minor dimension from its parent\&. Container\&'s minor dimension is height when the precedence of \fBXmNlayoutDirection\fP is horizontal, and width when vertical\&. .RE .IP "\fBXmNspatialSnapModel\fP" 10 Specifies how Container will position an item within the cell layout when \fBXmNlayoutType\fP is \fBXmSPATIAL\fP and \fBXmNspatialStyle\fP is \fBXmGRID\fP or \fBXmCELLS\fP\&. It can have one of the following values: .RS .IP "\fBXmCENTER\fP" 10 Center the items as follows, depending on the value of \fBXmNentryViewType\fP: .RS .IP "\fBXmLARGE_ICON\fP" 10 The child is centered in the cell horizontally and baseline-aligned vertically\&. .IP "\fBXmSMALL_ICON\fP" 10 The child is centered in the cell vertically on its baseline and aligned with the left or right of the cell horizontally, depending on the value of \fBXmNlayoutDirection\fP\&. .RE .IP "\fBXmSNAP_TO_GRID\fP" 10 Position the item at the upper-left or upper-right corner of the cell(s), depending on the value of \fBXmNlayoutDirection\fP\&. .IP "\fBXmNONE\fP" 10 Position the item according to the position specified by \fBXmNx\fP and \fBXmNy\fP\&. If the position is not within the coordinates of the cell(s), then position the item at the upper-left or upper-right corner of the cell(s), depending on the value of \fBXmNlayoutDirection\fP\&. .RE .IP "\fBXmNspatialStyle\fP" 10 Specifies the layout of Container items when \fBXmNlayoutType\fP is \fBXmSPATIAL\fP\&. It can have one of the following values: .RS .IP "\fBXmCELLS\fP" 10 Lays out items within a grid of same-size cells\&. Each item occupies as many cells as required to contain the item dimensions\&. .IP "\fBXmGRID\fP" 10 Lays out items within a grid of same-size cells\&. Each item occupies only one cell\&. Items that are larger than the cell size may overlap other items\&. .IP "\fBXmNONE\fP" 10 Lays out items according to \fBXmNx\fP and \fBXmNy\fP\&. .RE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmContainer Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNentryParentXmCWidgetWidgetNULLCSG _____ XmNoutlineStateXmCOutlineStateunsigned charXmCOLLAPSEDCSG _____ XmNpositionIndexXmCPositionIndexintdynamicCSG _____ .TE .IP "\fBXmNentryParent\fP" 10 Specifies the widget that is this item\&'s logical parent\&. A value of NULL indicates that this is a root-level item\&. Parent-child information is displayed only when the \fBXmNlayoutPolicy\fP is \fBXmOUTLINE\fP or \fBXmDETAIL\fP\&. .IP "\fBXmNoutlineState\fP" 10 Specifies whether to display child items when \fBXmNlayoutPolicy\fP is \fBXmOUTLINE\fP or \fBXmDETAIL\fP\&. It can have one of the following values: .RS .IP "\fBXmCOLLAPSED\fP" 10 Does not display child items\&. .IP "\fBXmEXPANDED\fP" 10 Displays child items\&. .RE .IP "\fBXmNpositionIndex\fP" 10 Specifies the order of items in the Container for display\&. When \fBXmNlayoutType\fP is \fBXmOUTLINE\fP or \fBXmDETAIL\fP, items are displayed in \fBXmNpositionIndex\fP order within \fBXmNentryParent\fP\&. Items that have an \fBXmNentryParent\fP resource are ignored when \fBXmNlayoutType\fP is \fBXmSPATIAL\fP\&. If \fBXmNpositionIndex\fP is not specified, it defaults to the \fBXmNpositionIndex\fP value plus 1 of the item with the highest \fBXmNpositionIndex\fP that has the same \fBXmNentryParent\fP if such an item exists; otherwise, it defaults to 0\&. .SS "Inherited Resources" .PP Container inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to callbacks for \fBXmNoutlineChangedCallback\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Widget \fIitem\fP; unsigned char \fInew_outline_state\fP; } XmContainerOutlineCallbackStruct; .fi .IP "\fIreason\fP" 10 Specifies the reason for the callback\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIitem\fP" 10 Specifies the container item affected by the event\&. .IP "\fInew_outline_state\fP" 10 Specifies the next \fBXmNoutlineState\fP for \fIitem\fP\&. The user can change this value in the callback\&. .PP A pointer to the following structure is passed to callbacks for \fBXmNdefaultActionCallback\fP and \fBXmNselectionCallback\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; WidgetList \fIselected_items\fP; int \fIselected_item_count\fP; unsigned char \fIauto_selection_type\fP; } XmContainerSelectCallbackStruct; .fi .IP "\fIreason\fP" 10 Specifies the reason for the callback\&. It corresponds to the \fBXmNselectionPolicy\fP at the time the selection was made, or indicates that the default action should be taken\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselected_items\fP" 10 Specifies a list of items selected at the time of the \fIevent\fP that caused the callback\&. The \fIselected_items\fP field points to a temporary storage space that is reused after the callback is finished\&. Therefore, if an application needs to save the selected list, it should copy the list into its own data space\&. .IP "\fIselected_item_count\fP" 10 Specifies the number of items in the \fIselected_items\fP list\&. This number must be positive or 0 (zero)\&. .IP "\fBauto_selection_type\fP" 10 Indicates the cause of the selection when \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP\&. Valid values are the following: .RS .IP "\fBXmAUTO_UNSET\fP" 10 Returned when \fBXmNautomaticSelection\fP is \fBXmNO_AUTO_SELECT\fP\&. .IP "\fBXmAUTO_BEGIN\fP" 10 Indicates the beginning of automatic selection\&. .IP "\fBXmAUTO_MOTION\fP" 10 Indicates that there is a button drag selection\&. .IP "\fBXmAUTO_CANCEL\fP" 10 Indicates that the new selection is canceled\&. .IP "\fBXmAUTO_NO_CHANGE\fP" 10 Indicates that the currently selected item matches the initial item\&. .IP "\fBXmAUTO_CHANGE\fP" 10 Indicates that the currently selected item does not match the initial item\&. .RE .PP A pointer to the following structure is passed to the \fBXmNconvertCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; Atom \fItarget\fP; XtPointer \fIsource_data\fP; XtPointer \fIlocation_data\fP; int \fIflags\fP; XtPointer \fIparm\fP; int \fIparm_format\fP; unsigned long \fIparm_length\fP; int \fIstatus\fP; XtPointer \fIvalue\fP; Atom \fItype\fP; int \fIformat\fP; unsigned long \fIlength\fP; } XmConvertCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which conversion is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fItarget\fP" 10 Indicates the conversion target\&. .IP "\fIsource_data\fP" 10 Contains information about the selection source\&. When the selection is \fB_MOTIF_DROP\fP, \fIsource_data\fP is the DragContext\&. Otherwise, it is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location of data to be converted\&. If the value is NULL, the data to be transferred consists of the widget\&'s current selection\&. Otherwise, it is the widget ID of the item being transferred, or the widget ID of the Container if all items are being transferred\&. .IP "\fIflags\fP" 10 Indicates the status of the conversion\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 This flag is currently unused\&. .IP "\fBXmCONVERTING_PARTIAL\fP" 10 The target widget was able to be converted, but some data was lost\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The conversion target is the source of the data to be transferred\&. .IP "\fBXmCONVERTING_TRANSACT\fP" 10 This flag is currently unused\&. .RE .IP "\fIparm\fP" 10 Contains parameter data for this target\&. If no parameter data exists, the value is NULL\&. .IP "" 10 When \fIselection\fP is \fBCLIPBOARD\fP and \fItarget\fP is \fB_MOTIF_CLIPBOARD_TARGETS\fP or \fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP, the value is the requested operation (\fBXmCOPY\fP, \fBXmMOVE\fP, or \fBXmLINK\fP)\&. .IP "\fIparm_format\fP" 10 Specifies whether the data in \fIparm\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. Possible values are 0 (when \fIparm\fP is NULL), 8 (when the data in \fIparm\fP should be viewed as a list of \fIchar\fPs), 16 (when the data in \fIparm\fP should be viewed as a list of \fIshort\fPs), or 32 (when the data in \fIparm\fP should be viewed as a list of \fIlong\fPs)\&. Note that \fIparm_format\fP symbolizes a data type, not the number of bits in each list element\&. For example, on some machines, a \fIparm_format\fP of 32 means that the data in \fIparm\fP should be viewed as a list of 64-bit quantities, not 32-bit quantities\&. .IP "\fIparm_length\fP" 10 Specifies the number of elements of data in \fIparm\fP, where each element has the size specified by \fIparm_format\fP\&. When \fIparm\fP is NULL, the value is 0\&. .IP "\fIstatus\fP" 10 An IN/OUT member that specifies the status of the conversion\&. The initial value is \fBXmCONVERT_DEFAULT\fP\&. The callback procedure can set this member to one of the following values: .RS .IP "\fBXmCONVERT_DEFAULT\fP" 10 The widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it overwrites the data provided by the callback procedures in the \fIvalue\fP member\&. .IP "\fBXmCONVERT_MERGE\fP" 10 The widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it appends its data to the data provided by the callback procedures in the \fIvalue\fP member\&. This value is intended for use with targets that result in lists of data, such as \fBTARGETS\fP\&. .IP "\fBXmCONVERT_DONE\fP" 10 The callback procedure has successfully finished the conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .IP "\fBXmCONVERT_REFUSE\fP" 10 The callback procedure has terminated the conversion process without completing the requested conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .RE .IP "\fIvalue\fP" 10 An IN/OUT parameter that contains any data that the callback procedure produces as a result of the conversion\&. The initial value is NULL\&. If the callback procedure sets this member, it must ensure that the \fItype\fP, \fIformat\fP, and \fIlength\fP members correspond to the data in \fIvalue\fP\&. The callback procedure is responsible for allocating, but not for freeing, memory when it sets this member\&. .IP "\fItype\fP" 10 An IN/OUT parameter that indicates the type of the data in the \fIvalue\fP member\&. The initial value is \fBINTEGER\fP\&. .IP "\fIformat\fP" 10 An IN/OUT parameter that specifies whether the data in \fIvalue\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. The initial value is 8\&. The callback procedure can set this member to 8 (for a list of \fIchar\fP), 16 (for a list of \fIshort\fP), or 32 (for a list of \fIlong\fP)\&. .IP "\fIlength\fP" 10 An IN/OUT member that specifies the number of elements of data in \fIvalue\fP, where each element has the size symbolized by \fIformat\fP\&. The initial value is 0 (zero)\&. .PP A pointer to the following callback structure is passed to the \fBXmNdestinationCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; XtEnum \fIoperation\fP; int \fIflags\fP; XtPointer \fItransfer_id\fP; XtPointer \fIdestination_data\fP; XtPointer \fIlocation_data\fP; Time \fItime\fP; } XmDestinationCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which data transfer is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fIoperation\fP" 10 Indicates the type of transfer operation requested\&. .RS .IP " \(bu" 6 When the selection is \fBPRIMARY\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fBSECONDARY\fP or \fBCLIPBOARD\fP, possible values are \fBXmCOPY\fP and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fB_MOTIF_DROP\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, \fBXmLINK\fP, and \fBXmOTHER\fP\&. A value of \fBXmOTHER\fP means that the callback procedure must get further information from the \fBXmDropProcCallbackStruct\fR in the \fIdestination_data\fP member\&. .RE .IP "\fIflags\fP" 10 Indicates whether or not the destination widget is also the source of the data to be transferred\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 The destination widget is not the source of the data to be transferred\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The destination widget is the source of the data to be transferred\&. .RE .IP "\fBtransfer_id\fP" 10 Serves as a unique ID to identify the transfer transaction\&. .IP "\fIdestination_data\fP" 10 Contains information about the destination\&. When the selection is \fB_MOTIF_DROP\fP, the callback procedures are called by the drop site\&'s \fBXmNdropProc\fP, and \fIdestination_data\fP is a pointer to the \fBXmDropProcCallbackStruct\fR passed to the \fBXmNdropProc\fP procedure\&. When the selection is \fBSECONDARY\fP, \fIdestination_data\fP is an Atom representing a target recommmended by the selection owner for use in converting the selection\&. Otherwise, \fIdestination_data\fP is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location where data is to be transferred\&. The value is always NULL when the selection is \fBSECONDARY\fP or \fBCLIPBOARD\fP\&. If the value is NULL, the data is to be inserted at the widget\&'s cursor position\&. Otherwise, the value is a pointer to an \fBXPoint\fP structure containing the x and y coordinates at the location where the data is to be transferred\&. Once \fBXmTransferDone\fP procedures start to be called, \fBlocation_data\fP will no longer be stable\&. .IP "\fItime\fP" 10 Indicates the time when the transfer operation began\&. .SS "Translations" .PP The \fBXmContainer\fP translations are listed below\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 ContainerBeginSelect() .IP "\fB\fP:" 10 ContainerButtonMotion() .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 ContainerEndSelect() .IP "\fBc \(aps \(apm \(apa\fP \fB\fP:" 10 ContainerBeginToggle() .IP "\fBc \(aps \(apm \(apa\fP \fB\fP:" 10 ContainerEndToggle() .IP "\fB\(apc s \(apm \(apa\fP \fB\fP:" 10 ContainerBeginExtend() .IP "\fB\(apc s \(apm \(apa\fP \fB\fP:" 10 ContainerEndExtend() .IP "\fBc s \(apm \(apa\fP \fB\fP:" 10 ContainerBeginExtend() .IP "\fBc s \(apm \(apa\fP \fB\fP:" 10 ContainerEndExtend() .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 ContainerStartTransfer(\fBCopy\fP) .IP "\fBc s \(apm \(apa\fP \fB\fP:" 10 ContainerStartTransfer(\fBLink\fP) .IP "\fB\(apc s \(apm \(apa\fP \fB\fP:" 10 ContainerStartTransfer(\fBMove\fP) .IP "\fB\(apm \(apa\fP \fB\fP:" 10 ContainerEndTransfer() .IP "\fB:c s a\fP \fB\fP\fB\fP:" 10 ContainerPrimaryLink() .IP "\fB:c s m\fP \fB\fP\fB\fP:" 10 ContainerPrimaryLink() .IP "\fB:a\fP \fB\fP\fB\fP:" 10 ContainerPrimaryCopy() .IP "\fB:m\fP \fB\fP\fB\fP:" 10 ContainerPrimaryCopy() .IP "\fB:s a\fP \fB\fP\fB\fP:" 10 ContainerPrimaryMove() .IP "\fB:s m\fP \fB\fP\fB\fP:" 10 ContainerPrimaryMove() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerCancel() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ContainerExtend() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerSelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerSelectAll() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerDeselectAll() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerToggleMode() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerActivate() .IP "\fBs \(apc \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ContainerExtend() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ContainerSelect() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 ContainerActivate() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP\fBslash\fP:" 10 ContainerSelectAll() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP\fBbackslash\fP:" 10 ContainerDeselectAll() .IP "\fB:c s\fP \fB\fP\fB\fP:" 10 ContainerExtendCursor(\fBFirst\fP) .IP "\fB:c s\fP \fB\fP\fB\fP:" 10 ContainerExtendCursor(\fBLast\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ContainerMoveCursor(\fBFirst\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ContainerMoveCursor(\fBLast\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ContainerExpandOrCollapse(\fBLeft\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 ContainerExpandOrCollapse(\fBRight\fP) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ContainerExtendCursor(\fBUp\fP) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ContainerExtendCursor(\fBDown\fP) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ContainerExtendCursor(\fBLeft\fP) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 ContainerExtendCursor(\fBRight\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerMoveCursor(\fBUp\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerMoveCursor(\fBDown\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerMoveCursor(\fBLeft\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 ContainerMoveCursor(\fBRight\fP) .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 ManagerGadgetPrevTabGroup() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 ManagerGadgetNextTabGroup() .PP The Container button event translations are modified when Display\&'s \fBXmNenableBtn1Transfer\fP resource does not have a value of \fBXmOFF\fP (in other words, it is either \fBXmBUTTON2_TRANSFER\fP or \fBXmBUTTON2_ADJUST\fP)\&. This option allows the actions for selection and transfer to be integrated on \fB\fP, and the actions for extending the selection can be bound to \fB\fP\&. The actions for \fB\fP that are defined in the preceding list still apply when the \fB\fP event occurs over text that is not selected\&. The following actions apply when the \fB\fP event occurs over text that is selected: .IP "\fB~c ~s ~m ~a\fP \fB\fP\fB:\fP" 10 ContainerHandleBtn1Down(\fBContainerBeginSelect,Copy\fP) .IP "\fBc ~s ~m ~a :\fP" 10 ContainerHandleBtn1Down(\fBContainerBeginToggle,Copy\fP) .IP "\fBc s ~m ~a :\fP" 10 ContainerHandleBtn1Down(\fBContainerNoop,Link\fP) .IP "\fB~c s ~m ~a :\fP" 10 ContainerHandleBtn1Down(\fBContainerBeginExtend,Move\fP) .IP "\fB\fP\fB:\fP" 10 ContainerHandleBtn1Motion(\fBContainerButtonMotion\fP) .IP "\fB~c ~s ~m ~a :\fP" 10 ContainerHandleBtn1Up(\fBContainerEndSelect\fP) .IP "\fBc ~s ~m ~a :\fP" 10 ContainerHandleBtn1Up(\fBContainerEndToggle\fP) .IP "\fB~c s ~m ~a :\fP" 10 ContainerHandleBtn1Up(\fBContainerEndExtend\fP) .IP "\fBc s ~m ~a :\fP" 10 ContainerHandleBtn1Down(\fBContainerBeginExtend\fP) .IP "\fBc s ~m ~a :\fP" 10 ContainerHandleBtn1Up(\fBContainerEndExtend\fP) .PP When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_ADJUST\fP, the following actions apply: .IP "\fB~c ~s ~m ~a :\fP" 10 ContainerHandleBtn2Down(\fBContainerStartTransfer,Copy\fP) .IP "\fBc s ~m ~a :\fP" 10 ContainerHandleBtn2Down(\fBContainerStartTransfer,Link\fP) .IP "\fB~c s ~m ~a :\fP" 10 ContainerHandleBtn2Down(\fBContainerStartTransfer,Move\fP) .IP "\fB\fP\fB:\fP" 10 ContainerHandleBtn2Motion(\fBContainerButtonMotion\fP) .IP "\fB~m ~a :\fP" 10 ContainerHandleBtn2Up(\fBContainerEndTransfer\fP) .SS "Action Routines" .PP The Container action routines are described below\&. The current selections are always shown with the background color specified by the \fBXmNselectColor\fP resource\&. .IP "ContainerActivate():" 10 This action calls \fBXmNdefaultActionCallback\fP with reason \fBXmCR_DEFAULT_ACTION\fP\&. .IP "ContainerBeginExtend():" 10 Simply returns if \fBXmNselectionPolicy\fP is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP\&. Simply returns if \fBXmNlayoutType\fP is \fBXmSPATIAL\fP\&. .IP "" 10 Otherwise, this action sets the selection state of all items between the anchor item and the item under the pointer to the selection state of the anchor item\&. The location cursor is moved to the item under the pointer\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP, the \fBXmNselectionCallback\fP(s) is called with either \fBXmCR_MULTIPLE_SELECT\fP or \fBXmCR_EXTENDED_SELECT\fP as the reason depending on \fBXmNselectionPolicy\fP, and with \fBauto_selection_type\fP \fBXmAUTO_CHANGE\fP\&. .IP "ContainerBeginSelect():" 10 If this is a second ContainerBeginSelect() action that has occurred within the time specified by the display\&'s multiclick time, this action calls \fBXmNdefaultActionCallback\fP with reason \fBXmCR_DEFAULT_ACTION\fP and returns\&. .IP "" 10 Otherwise, processing depends on the value of \fBXmNselectionPolicy\fP as follows: .RS .IP "\fBXmSINGLE_SELECT\fP" 10 This action deselects all items and toggles the item (if any) under the pointer\&. .IP "\fBXmBROWSE_SELECT\fP" 10 This action deselects all items and toggles the item (if any) under the pointer\&. This item is now the anchor item for further selection\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and a change in any item\&'s selection state is made, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_BROWSE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_BEGIN\fP\&. .IP "\fBXmMULTIPLE_SELECT\fP" 10 If the pointer is over an item and \fBXmNselectionTechnique\fP is not \fBXmMARQUEE\fP, this action toggles the selection state of that item\&. The item becomes the anchor item for further selection\&. If \fBXmNselectionTechnique\fP is \fBXmMARQUEE\fP, \fBXmMARQUEE_EXTEND_START\fP, or \fBXmMARQUEE_EXTEND_BOTH\fP, this action sets the start point for the Marquee rectangle\&. If \fBXmNselectionTechnique\fP is \fBXmMARQUEE_EXTEND_START\fP or \fBXmMARQUEE_EXTEND_BOTH\fP and the pointer is over an item, this action draws the Marquee rectangle around the item\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_MULTIPLE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_BEGIN\fP\&. .IP "\fBXmEXTENDED_SELECT\fP" 10 All items are first deselected\&. Processing is then identical to the case where \fBXmNselectionPolicy\fP is \fBXmMULTIPLE_SELECT\fP, except that \fBXmCR_EXTENDED_SELECT\fP is the callback reason given if \fBXmNselectionCallback\fP is called\&. .RE .IP "ContainerBeginToggle():" 10 Simply returns if \fBXmNselectionPolicy\fP is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP\&. .IP "" 10 Otherwise, if the pointer is over an item and \fBXmNselectionTechnique\fP is not \fBXmMARQUEE\fP, this action toggles the selection state of that item\&. The item becomes the anchor item for further selection\&. If \fBXmNselectionTechnique\fP is \fBXmMARQUEE\fP, \fBXmMARQUEE_EXTEND_START\fP, or \fBXmMARQUEE_EXTEND_BOTH\fP this action sets the start point for the Marquee rectangle\&. If \fBXmNselectionTechnique\fP is \fBXmMARQUEE_EXTEND_START\fP or \fBXmMARQUEE_EXTEND_BOTH\fP and the pointer is over an item, this action draws the Marquee rectangle around the item\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP, the \fBXmNselectionCallback\fP(s) is called with either \fBXmCR_MULTIPLE_SELECT\fP or \fBXmCR_EXTENDED_SELECT\fP as the reason, depending on \fBXmNselectionPolicy\fP, and with \fBauto_selection_type\fP \fBXmAUTO_BEGIN\fP\&. .IP "ContainerButtonMotion():" 10 Processing depends on the value of \fBXmNselectionPolicy\fP, as follows: .RS .IP "\fBXmSINGLE_SELECT\fP" 10 This action simply returns to the caller\&. .IP "\fBXmBROWSE_SELECT\fP" 10 Simply returns if this action follows a ContainerBeginExtend() action or ContainerBeginToggle() action\&. .IP "" 10 If the pointer is no longer over the current anchor item, this action toggles the current anchor item and then toggles the item under the pointer (if any) and makes it the new anchor item for further processing\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and a change in any item\&'s selection state is made, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_BROWSE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_MOTION\fP\&. .IP "\fBXmMULTIPLE_SELECT\fP" 10 If a previous action has set a Marquee rectangle start point, this action draws the Marquee rectangle between the current pointer position and the Marquee start point\&. If the \fBXmNselectionTechnique\fP is \fBXmMARQUEE_EXTEND_BOTH\fP and the pointer is over an item, the end point of the Marquee rectangle is extended to include the item\&. The selection states of all items within the Marquee rectangle are toggled to match the state of the anchor item\&. .IP "" 10 If no Marquee rectangle start point is set and the pointer is over an item, processing depends on the \fBXmNlayoutType\fP resource\&. The anchor item from the previous action is used\&. If \fBXmNlayoutType\fP is \fBXmSPATIAL\fP, the selection state of the item under the pointer is toggled to match the selection state of the anchor item\&. If \fBXmNlayoutType\fP is \fBXmOUTLINE\fP or \fBXmDETAIL\fP, the selection state of all items between the anchor item and the item under the pointer are toggled to match the selection state of the anchor item\&. .IP "" 10 If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and a change in any item\&'s selection state is made, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_MULTIPLE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_MOTION\fP\&. .IP "\fBXmEXTENDED_SELECT\fP" 10 Processing is identical to the case where \fBXmNselectionPolicy\fP is \fBXmMULTIPLE_SELECT\fP, except that \fBXmCR_EXTENDED_SELECT\fP is the callback reason given if \fBXmNselectionCallback\fP is called\&. .RE .IP "ContainerCancel():" 10 If a selection is in progress, this action restores selection states of all items to their state before the selection began\&. If \fBXmNautomaticSelection\fP is True and a change in any item\&'s selection state is made, the \fBXmNselectionCallback\fP is called with reason \fBXmCR_BROWSE_SELECT\fP, \fBXmMULTIPLE_SELECT\fP, or \fBXmCR_EXTENDED_SELECT\fP depending on the \fBXmNselectionPolicy\fP resource and \fBauto_selection_type\fP \fBXmAUTO_CANCEL\fP\&. .IP "ContainerDeselectAll():" 10 This action deselects all items and calls \fBXmNselectionCallback\fP with reason depending on \fBXmNselectionPolicy\fP\&. .IP "ContainerEndExtend():" 10 Simply returns if \fBXmNselectionPolicy\fP is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP\&. Simply returns if \fBXmNlayoutType\fP is \fBXmSPATIAL\fP\&. .IP "" 10 Otherwise, if \fBXmNautomaticSelection\fP is \fBXmNO_AUTO_SELECT\fP, \fBXmNselectionCallback\fP(s) is called with either \fBXmCR_MULTIPLE_SELECT\fP or \fBXmCR_EXTENDED_SELECT\fP as the reason depending on \fBXmNselectionPolicy\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and no change is made in any item\&'s selection state by this action, \fBXmNselectionCallback\fP(s) is called with either \fBXmCR_MULTIPLE_SELECT\fP or \fBXmCR_EXTENDED_SELECT\fP as the reason depending on \fBXmNselectionPolicy\fP and \fBauto_selection_type\fP \fBXmAUTO_CHANGE\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and this action makes no change in any item\&'s selection state, \fBXmNselectionCallback\fP(s) is called with either \fBXmCR_MULTIPLE_SELECT\fP or \fBXmCR_EXTENDED_SELECT\fP as the reason depending on \fBXmNselectionPolicy\fP and \fBauto_selection_type\fP \fBXmAUTO_NO_CHANGE\fP\&. .IP "ContainerEndSelect():" 10 Processing depends on the value of \fBXmNselectionPolicy\fP, as follows: .RS .IP "\fBXmSINGLE_SELECT\fP" 10 This action calls \fBXmNselectionCallback\fP with reason \fBXmCR_SINGLE_SELECT\fP\&. .IP "\fBXmBROWSE_SELECT\fP" 10 If the pointer is no longer over the current anchor item, this action toggles the current anchor item and then toggles the item under the pointer (if any)\&. If \fBXmNautomaticSelection\fP is \fBXmNO_AUTO_SELECT\fP, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_BROWSE_SELECT\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and a change in any item\&'s selection state is made, \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_BROWSE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_CHANGE\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and no change is made in any item\&'s selection state by this action, \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_BROWSE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_NO_CHANGE\fP\&. .IP "\fBXmMULTIPLE_SELECT\fP" 10 This action first performs the same processing as the ContainerButtonMotion() action, except that \fBXmNselectionCallback\fP is not called\&. If \fBXmNautomaticSelection\fP is \fBXmNO_AUTO_SELECT\fP, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_MULTIPLE_SELECT\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and a change in any item\&'s selection state is made, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_MULTIPLE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_CHANGE\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and this action makes no change in any item\&'s selection state, \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_MULTIPLE_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_NO_CHANGE\fP\&. .IP "\fBXmEXTENDED_SELECT\fP" 10 This action first performs the same processing as the ContainerButtonMotion() action, except that \fBXmNselectionCallback\fP is not called\&. If \fBXmNautomaticSelection\fP is \fBXmNO_AUTO_SELECT\fP, the \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_EXTENDED_SELECT\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and a change in any item\&'s selection state is made, \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_EXTENDED_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_CHANGE\fP\&. If \fBXmNautomaticSelection\fP is \fBXmAUTO_SELECT\fP and this action makes no change in any item\&'s selection state, \fBXmNselectionCallback\fP(s) is called with reason \fBXmCR_EXTENDED_SELECT\fP and \fBauto_selection_type\fP \fBXmAUTO_NO_CHANGE\fP\&. .RE .IP "ContainerEndToggle():" 10 Simply returns if \fBXmNselectionPolicy\fP is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP\&. If \fBXmNselectionPolicy\fP is \fBXmMULTIPLE_SELECT\fP or \fBXmEXTENDED_SELECT\fP, this action performs the same processing as the ContainerEndSelect() action\&. .IP "ContainerEndTransfer()::" 10 If the elapsed time since a ContainerStartTransfer() action has occurred exceeds the time span specified by the display\&'s multiclick time, this action returns\&. .IP "" 10 Otherwise, the ContainerPrimaryCopy(), ContainerPrimaryLink(), or ContainerPrimaryMove() action is invoked, depending on the value of the operation parameter saved by ContainerStartTransfer()\&. .IP "ContainerExpandOrCollapse(\fBLeft|Right|Collapse|Expand\fP):" 10 This action changes the value of the \fBXmNoutlineState\fP of the current focus widget\&. If the argument value is \fBCollapse\fP or \fBLeft\fP, the \fBXmNoutlineState\fP resource value is set to \fBXmCOLLAPSED\fP\&. If the argument value is \fBExpand\fP or \fBRight\fP, the \fBXmNoutlineState\fP resource value is set to \fBXmEXPANDED\fP\&. .IP "" 10 If the argument is \fBLeft\fP or \fBRight\fP and the layout is right to left, then the setting of the \fBXmNoutlineState\fP value is reversed from that described in the preceding paragraph\&. .IP "" 10 Simply returns if \fBXmNlayoutType\fP is \fBXmSPATIAL\fP\&. .IP "ContainerExtend():" 10 Processing depends on the value of \fBXmNselectionPolicy\fP, as follows: .IP "" 10 If the selection policy is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP, this action returns\&. If \fBXmNlayoutType\fP is \fBXmSPATIAL\fP, this action returns\&. .IP "" 10 If the selection policy is \fBXmMULTIPLE_SELECT\fP, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item\&. .IP "" 10 If the selection policy is \fBXmEXTENDED_SELECT\fP and the Container is in Normal Mode, this action deselects all items and selects all items between the anchor item and the location cursor\&. If the selection policy is \fBXmEXTENDED_SELECT\fP and the Container is in Add Mode, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item\&. .IP "" 10 \fBXmNselectionCallback\fP is called with reason \fBXmCR_MULTIPLE_SELECT\fP or \fBXmCR_EXTENDED_SELECT\fP depending on \fBXmNselectionPolicy\fP\&. .IP "ContainerExtendCursor(\fBLeft|Right|Up|Down\fP):" 10 Processing depends on the value of \fBXmNselectionPolicy\fP, as follows: .IP "" 10 If the selection policy is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP, this action returns\&. If \fBXmNlayoutType\fP is \fBXmSPATIAL\fP, this action returns\&. .IP "" 10 This action moves the location cursor one item in the indicated direction, if possible\&. If the value of the argument string is \fBFirst\fP or \fBLast\fP, this action moves the location cursor to the indicated item\&. For other values of the argument string, the location cursor is not affected\&. .IP "" 10 If the selection policy is \fBXmMULTIPLE_SELECT\fP, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item\&. .IP "" 10 If the selection policy is \fBXmEXTENDED_SELECT\fP and the Container is in Normal Mode, this action deselects all items and selects all items between the anchor item and the location cursor\&. If the selection policy is \fBXmEXTENDED_SELECT\fP and the Container is in Add Mode, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item\&. .IP "" 10 \fBXmNselectionCallback\fP is called with reason \fBXmCR_MULTIPLE_SELECT\fP or \fBXmCR_EXTENDED_SELECT\fP depending on \fBXmNselectionPolicy\fP\&. .IP "ContainerHandleBtn1Down(\fIstring\fP\fB)\fP" 10 When Display\&'s \fBXmNenableBtn1Transfer\fP resource is not \fBXmOFF\fP, the actions for selection and transfer are integrated on \fB\fP\&. If the pointer is over an unselected item or background, the item is first selected before the transfer is started\&. Otherwise, if the item is already selected, the transfer is started\&. The value of \fIstring\fP can be one of the following actions: .RS .IP " \(bu" 6 \fBContainerBeginSelect,Copy\fP .IP " \(bu" 6 \fBContainerBeginToggle,Copy\fP .IP " \(bu" 6 \fBContainerNoop,Link\fP .IP " \(bu" 6 \fBContainerBeginExtend,Move\fP .RE .IP "ContainerHandleBtn1Motion(\fIstring\fP\fB)\fP" 10 When Display\&'s \fBXmNenableBtn1Transfer\fP resource is not \fBXmOFF\fP, the actions for selection and transfer are integrated on \fB\fP\&. When this action is invoked, and a selection is in progress, a drag is performed\&. Otherwise, the default action as specified in \fIstring\fP is performed\&. The value of \fIstring\fP can be \fBContainerButtonMotion\fP\&. .IP "ContainerHandleBtn1Up(\fIstring\fP\fB)\fP" 10 If a Button 1 transfer was in progress, then when this action is invoked, that transfer is cancelled\&. Otherwise, the default action as specified in \fIstring\fP is performed\&. The value of \fIstring\fP can be one of the following actions: .RS .IP " \(bu" 6 \fBContainerEndSelect\fP .IP " \(bu" 6 \fBContainerEndToggle\fP .IP " \(bu" 6 \fBContainerEndExtend\fP .RE .IP "ContainerHandleBtn2Down(\fIstring\fP\fB)\fP" 10 When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_ADJUST\fP, the actions for extending selection are bound on \fB\fP\&. Otherwise, the action that is performed depends on the value of \fIstring\fP, which can be one of the following actions: .RS .IP " \(bu" 6 \fBContainerStartTransfer,Copy\fP .IP " \(bu" 6 \fBContainerStartTransfer,Link\fP .IP " \(bu" 6 \fBContainerStartTransfer,Move\fP .RE .IP "ContainerHandleBtn2Motion(\fIstring\fP\fB)\fP" 10 When Display\&'s \fBXmNenableBtn1Transfer\fP resource is not \fBXmBUTTON2_ADJUST\fP, and a selection is in progress, a drag is performed\&. Otherwise, the default action that is performed depends on the value of \fIstring\fP, which can be \fBContainerButtonMotion\fP\&. .IP "ContainerHandleBtn2Up(\fIstring\fP\fB)\fP" 10 When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_ADJUST\fP, this action ends an extend\&. Otherwise, the action that is performed depends on the value of \fIstring\fP, which can be \fBContainerEndTransfer\fP\&. .IP "ContainerMoveCursor(\fBLeft|Right|Up|Down|First|Last\fP):" 10 If the argument is \fBLeft\fP, \fBRight\fP, \fBUp\fP, or \fBDown\fP, this action moves the location cursor one item in the indicated direction, if possible\&. If the value of the argument string is \fBFirst\fP or \fBLast\fP, this action moves the location cursor to the indicated item\&. Any other arguments are ignored\&. .IP "" 10 If \fBXmNselectionPolicy\fP is \fBXmBROWSE_SELECT\fP, or if \fBXmNselectionPolicy\fP is \fBXmEXTENDED_SELECT\fP and the Container is in Normal Mode, this action deselects all items, selects the item at the location cursor, and calls \fBXmNselectionCallback\fP with the reason depending on \fBXmNselectionPolicy\fP\&. .IP "ContainerPrimaryCopy():" 10 This action requests that primary selection data be copied to the Container\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmCOPY\fP operation\&. By default, the Container does not do any transfer, and copying the selection is the responsibility of the \fBXmNdestinationCallback\fP procedures\&. .IP "ContainerPrimaryLink():" 10 This action requests that primary selection data be linked to the Container\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmLINK\fP operation\&. By default, the Container does not do any transfer, and linking the selection is the responsibility of the \fBXmNdestinationCallback\fP procedures\&. .IP "ContainerPrimaryMove():" 10 This action requests that primary selection data be copied to the Container and deleted from the primary source\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmMOVE\fP operation\&. By default, the Container does not do any transfer, and moving the selection is the responsibility of the \fBXmNdestinationCallback\fP procedures\&. If the transfer is successful, this action then calls the selection owner\&'s \fBXmNconvertCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBDELETE\fP target\&. .IP "ContainerSelect():" 10 Processing depends on the value of \fBXmNselectionPolicy\fP, as follows: .IP "" 10 If the selection policy is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP, this action deselects all items and selects the item at the location cursor\&. .IP "" 10 If the selection policy is \fBXmMULTIPLE_SELECT\fP, this action toggles the selection state of the item at the location cursor\&. This item becomes the anchor item for further selections\&. .IP "" 10 If the selection policy is \fBXmEXTENDED_SELECT\fP and the Container is in Normal Mode, this action deselects all items and selects the item at the location cursor\&. If the selection policy is \fBXmEXTENDED_SELECT\fP and the Container is in Add Mode, this action toggles the selection state of the item at the location cursor\&. The selected/toggled item becomes the anchor item for further selections\&. .IP "" 10 \fBXmNselectionCallback\fP is called with the reason depending on \fBXmNselectionPolicy\fP\&. .IP "ContainerSelectAll():" 10 If \fBXmNselectionPolicy\fP is \fBXmSINGLE_SELECT\fP or \fBXmBROWSE_SELECT\fP, this action deselects all items and selects the item at the location cursor position\&. .IP "" 10 If \fBXmNselectionPolicy\fP is \fBXmMULTIPLE_SELECT\fP or \fBXmEXTENDED_SELECT\fP, this action selects all items\&. .IP "" 10 \fBXmNselectionCallback\fP is called with the reason depending on the value of \fBXmNselectionCallback\fP\&. .IP "ContainerStartTransfer(\fBCopy|Move|Link\fP):" 10 This action saves the event and the operation specified in the argument string for use by subsequent actions\&. If no ContainerEndTransfer() actions occur within the time span specified by the display\&'s multiclick time and if \fBXmNlayoutType\fP is \fBXmSPATIAL\fP, this action creates a DragContext and starts a drag transfer by using \fIstring\fP to specify the transfer operation\&. If no argument string is specified, \fBCopy\fP is the default value\&. .IP "" 10 Unless default drag and drop behavior has been overridden by a \fBXmNconvertCallback\fP procedure, if the drop operation occurs within the Container, then the item(s) being dragged are relocated at the position of the drop operation\&. If the item targeted by the Drag operation is not in the selected state, then only that item is moved\&. If the item is in the selected state, however, all items in the selected state are moved\&. .IP "ContainerToggleMode():" 10 If \fBXmNselectionPolicy\fP is \fBXmEXTENDED_SELECT\fP, this action toggles the Container between Normal Mode and Add Mode\&. .SS "Additional Behavior" .PP The Container widget has the following additional behavior: .IP "\fB\fP\fB(2+)\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time, the Container interprets that as a double-click and calls the \fBXmNdefaultActionCallback\fP callbacks\&. .IP "\fB\fP:" 10 If the focus policy is explicit, sets the focus and draws the location cursor\&. .IP "\fB\fP:" 10 If the focus policy is explicit, removes the focus and erases the location cursor\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmContainerCopy\fP, \fBXmContainerCopyLink\fP, \fBXmContainerCut\fP, \fBXmContainerGetItemChildren\fP, \fBXmContainerPaste\fP, \fBXmContainerPasteLink\fP, \fBXmContainerRelayout\fP(3), \fBXmContainerReorder\fP(3), \fBXmCreateContainer\fP(3), \fBXmCreateIconGadget\fP(3), \fBXmIconGadget\fP(3), \fBXmManager\fP(3), \fBXmVaCreateContainer\fP(3), and \fBXmVaCreateManagedContainer\fP(3)\&. motif-2.3.8/doc/man/man3/XmImCloseXIM.30000644000175000017500000000330612672140200014237 00000000000000'\" t ...\" ImCloXI.sgm /main/8 1996/09/08 20:47:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImCloseXIM" "library call" .SH "NAME" \fBXmImCloseXIM\fP \(em An input manager function that releases the input method associated with a specified widget .iX "XmImCloseXIM" .iX "input manager functions" "XmImCloseXIM" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImCloseXIM\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImCloseXIM\fP closes all input contexts associated with the Input Method (IM) of \fIwidget\fP\&. \fIwidget\fP is used to identify the Display that specifies the Input Method opened for the widget\&. Upon closure, all widgets registered with the input contexts are unregistered\&. Also, the Input Method specified by Display is closed\&. .IP "\fIwidget\fP" 10 Specifies the ID of a widget whose reference Input Method is to be closed\&. .SH "RELATED" .PP \fBXmImGetXIM\fP(3) and \fBXmImRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmTabListReplacePositions.30000644000175000017500000000540412672140200017075 00000000000000'\" t ...\" TabLstRB.sgm /main/9 1996/09/08 21:09:36 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabListReplacePositions" "library call" .SH "NAME" \fBXmTabListReplacePositions\fP \(em A convenience function that creates a new tab list with replacement tabs .iX "XmTabListReplacePositions" .SH "SYNOPSIS" .PP .nf #include \fBXmTabList \fBXmTabListReplacePositions\fP\fR( \fBXmTabList \fBoldlist\fR\fR, \fBCardinal \fB*position_list\fR\fR, \fBXmTab \fB*tabs\fR\fR, \fBCardinal \fBtab_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabListReplacePositions\fP creates a new tab list that contains the contents of \fIoldlist\fP, but with the tabs at the positions in \fIposition_list\fP replaced with copies of the corresponding tabs in \fItabs\fP\&. A warning message is displayed if a specified position is invalid; for example, if the value is a number greater than the number of tabs in the tab list\&. .PP This function deallocates the original tab list after extracting the required information\&. It is the caller\&'s responsibility to free the tabs in \fItabs\fP by using the \fBXmTabFree\fP function\&. .IP "\fIoldlist\fP" 10 Specifies the tab list\&. The function deallocates the tab list after extracting the required information\&. .IP "\fIposition_list\fP" 10 Specifies an array of positions of the tabs to be replaced\&. The position of the first tab is 0 (zero), the position of the second tab is 1, and so on\&. .IP "\fItabs\fP" 10 Specifies an array of the replacement tabs\&. .IP "\fItab_count\fP" 10 Specifies the number of elements in \fIposition_list\fP and \fItabs\fP\&. .SH "RETURN" .PP If \fItabs\fP, \fIoldlist\fP, or \fIposition_list\fP is NULL, or \fItab_count\fP is 0 (zero), returns \fIoldlist\fP\&. Otherwise, this function returns the new tab list\&. The function allocates space to hold the returned tab list\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmTabListFree\fP\&. .SH "RELATED" .PP \fBXmTabList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmFileSelectionDoSearch.30000644000175000017500000000412112672140200016460 00000000000000'\" t ...\" FileSelC.sgm /main/7 1996/08/30 15:17:19 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFileSelectionDoSearch" "library call" .SH "NAME" \fBXmFileSelectionDoSearch\fP \(em A FileSelectionBox function that initiates a directory search .iX "XmFileSelectionDoSearch" .iX "FileSelectionBox functions" "XmFileSelectionDoSearch" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmFileSelectionDoSearch\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBdirmask\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFileSelectionDoSearch\fP initiates a directory and file search in a FileSelectionBox widget\&. For a description of the actions that the FileSelectionBox takes when doing a search, see \fBXmFileSelectionBox\fP(3)\&. .IP "\fIwidget\fP" 10 Specifies the FileSelectionBox widget ID\&. .IP "\fIdirmask\fP" 10 Specifies the directory mask used in determining the directories and files displayed in the FileSelectionBox lists\&. This value is used as the \fImask\fP member of the input data \fBXmFileSelectionBoxCallbackStruct\fR structure passed to the FileSelectionBox\&'s \fBXmNqualifySearchDataProc\fP\&. The \fIdir\fP and \fIpattern\fP members of that structure are NULL\&. .PP For a complete definition of FileSelectionBox and its associated resources, see \fBXmFileSelectionBox\fP(3)\&. .SH "RELATED" .PP \fBXmFileSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmClipboardInquirePendingItems.30000644000175000017500000000710412672140200020071 00000000000000'\" t ...\" ClipbI.sgm /main/10 1996/09/25 10:24:35 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardInquirePendingItems" "library call" .SH "NAME" \fBXmClipboardInquirePendingItems\fP \(em A clipboard function that returns a list of data ID/private ID pairs .iX "XmClipboardInquirePending\\%Items" .iX "clipboard functions" "XmClipboardInquirePending\\%Items" .SH "SYNOPSIS" .PP .nf #include int XmClipboardInquirePendingItems (\fIdisplay, window, format_name, item_list, count\fP) Display \fI* display\fP; Window \fIwindow\fP; char \fI* format_name\fP; XmClipboardPendingList \fI* item_list\fP; unsigned long \fI* count\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardInquirePendingItems\fP returns a list of data ID/private ID pairs for the specified format name\&. A data item is considered pending if the application originally passed it by name, the application has not yet copied the data, and the item has not been deleted from the clipboard\&. The application is responsible for freeing the memory provided by this function to store the list\&. To free the memory, call \fBXtFree\fP\&. .PP This function is used by an application when exiting, to determine if the data that is passed by name should be sent to the clipboard\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIformat_name\fP" 10 Specifies a string that contains the name of the format for which the list of data ID/private ID pairs is to be obtained\&. .IP "\fIitem_list\fP" 10 Specifies the address of the array of data ID/private ID pairs for the specified format name\&. This argument is a type \fBXmClipboardPendingList\fR\&. The application is responsible for freeing the memory provided by this function for storing the list\&. .IP "\fIcount\fP" 10 Specifies the number of items returned in the list\&. If there is no data for the specified format name, or if there is no item on the clipboard, this argument equals 0 (zero)\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmContainerPaste.30000644000175000017500000000374512672140200015254 00000000000000'\" t ...\" ContainF.sgm /main/7 1996/08/30 14:24:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerPaste" "library call" .SH "NAME" \fBXmContainerPaste\fP \(em Container widget function to insert items from the clipboard .iX "XmContainerPaste" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmContainerPaste\fP\fR( \fBWidget \fBcontainer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerPaste\fP requests data transfer from the clipboard selection to the Container\&. This routine calls the widget\&'s \fBXmNdestinationCallback\fP procedures with the \fIselection\fP member of the \fBXmDestinationCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIoperation\fP member set to \fBXmCOPY\fP\&. The Container widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the clipboard selection and for taking any related actions\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP The function returns False if no data transfer takes place\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmRendition.30000644000175000017500000001565212672140200014270 00000000000000'\" t ...\" RendA.sgm /main/10 1996/09/08 20:56:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRendition" "library call" .SH "NAME" \fBXmRendition\fR \(em The Rendition registry .iX "XmRendition" .SH "SYNOPSIS" .PP .nf #include XmRendition .fi .SH "DESCRIPTION" .PP \fBXmRendition\fR is a pseudo widget used for the rendering of \fBXmString\fRs\&. \fBXmRendition\fR has two parts: \fBXmStringTag\fR and rendering information\&. The \fBXmStringTag\fR part can be matched with an \fBXmStringTag\fR associated with a \fBLOCALE\fP, \fBCHARSET\fP, or \fBRENDITION[BEGIN|END]\fP component within \fBXmString\fR\&. The rendering information contains information about the font or fontset, colors, tabs, and lines to be used in rendering a text component\&. .PP If a resource in a rendition is unspecified, usually by setting it to \fBXmAS_IS\fP or \fBXmUNSPECIFIED_PIXEL\fP, then the value to be used for that resource is the value of the immediately preceeding rendition in \fBXmString\fR\&. If that value is unspecified, then the preceding value is used, and so on\&. If no renditions specify a value for a resource, then a default value will be used\&. .SS "Classes" .PP \fBXmRendition\fR does not inherit from any widget class\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXmRenditionUpdate\fP (S), retrieved by using \fBXmRenditionRetrieve\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmRendition Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNrenditionBackgroundXmCRenditionBackgroundPixelXmUNSPECIFIED_PIXELCSG _____ XmNfontXmCFontXtPointerXmAS_ISCSG _____ XmNfontNameXmCFontNameStringXmAS_ISCSG _____ XmNfontTypeXmCFontTypeXmFontTypeXmAS_ISCSG _____ XmNrenditionForegroundXmCRenditionForegroundPixelXmUNSPECIFIED_PIXELCSG _____ XmNloadModelXmCLoadModelunsigned charXmAS_ISCSG _____ XmNstrikethruTypeXmCStrikethruTypeunsigned charXmAS_ISCSG _____ XmNtabListXmCTabListXmTabListXmAS_ISCSG _____ XmNtagXmCTagXmStringTag""G _____ XmNunderlineTypeXmCUnderlineTypeunsigned charXmAS_ISCSG _____ .TE .IP "\fBXmNrenditionBackground\fP" 10 Specifies the background drawing color\&. A value of \fBXmUNSPECIFIED_PIXEL\fP indicates that the background is not specified for this rendition\&. .IP "\fBXmNfont\fP" 10 Specifies the actual font or fontset to be used by this rendition\&. The value of this resource, if set to other than \fBXmAS_IS\fP, will be used regardless of the settings of the other font resources\&. Setting this resource will force \fBXmNloadModel\fP to be \fBXmLOAD_IMMEDIATE\fP\&. If this resource is not initially set, then it will be set subsequently by the rendition whenever the font or fontset specified by \fBXmNfontName\fP is loaded\&. If both \fBXmNfontName\fP and \fBXmNfont\fP are specified in a resource file, the \fBXmNfont\fP specification will take precedence\&. .IP "\fBXmNfontName\fP" 10 Specifies an X Logical Font Description (XLFD) string, which is interpreted either as a font name or as a base font name list\&. A base font name list is a comma-separated and NULL-terminated string\&. A value of \fBXmAS_IS\fP indicates that the font is not specified for this rendition\&. If both \fBXmNfontName\fP and \fBXmNfont\fP are specified in a resource file, the \fBXmNfont\fP specification will take precedence\&. .IP "\fBXmNfontType\fP" 10 Specifies whether the \fBXmNfontName\fP resource refers to a font name or to a base font name list\&. Valid values are \fBXmFONT_IS_FONT\fP and \fBXmFONT_IS_FONTSET\fP\&. .IP "\fBXmNrenditionForeground\fP" 10 Specifies the foreground drawing color\&. A value of \fBXmUNSPECIFIED_PIXEL\fP indicates that the foreground is not specified for this rendition\&. .IP "\fBXmNloadModel\fP" 10 Specifies whether the font or fontset specified by \fBXmNfontName\fP is to be loaded when the rendition is created (\fBXmLOAD_IMMEDIATE\fP) or only when the font is required to render an \fBXmString\fR segment (\fBXmLOAD_DEFERRED\fP)\&. Note that specifying \fBXmLOAD_IMMEDIATE\fP for \fBXmNloadModel\fP is valid only if \fBXmNfontName\fP is specified, in which case the specified font will be loaded on creation, or if \fBXmNfont\fP is specified, in which case the font is already loaded\&. \fBXmLOAD_DEFERRED\fP is only valid when \fBXmNfontName\fP is specified\&. .IP "\fBXmNstrikethruType\fP" 10 Specifies the type of line to be used to strike through a text segment\&. Valid values are \fBXmNO_LINE\fP, \fBXmSINGLE_LINE\fP, \fBXmDOUBLE_LINE\fP, \fBXmSINGLE_DASHED_LINE\fP, and \fBXmDOUBLE_DASHED_LINE\fP\&. A value of \fBXmAS_IS\fP indicates that the strike-through type is not specified for this rendition\&. .IP "\fBXmNtabList\fP" 10 Specifies the tab list to be used in rendering compound strings containing tab components\&. .IP "\fBXmNtag\fP" 10 Specifies the tag string to be used in matching the renditions with other renditions or with \fBXmStringTag\fR components in \fBXmStrings\fP\&. This resource must always be specified\&. That is, NULL is not a legal value but the empty string is\&. This resource is automatically set to the value of the \fItag\fP parameter in the \fBXmRenditionCreate\fP call\&. .IP "\fBXmNunderlineType\fP" 10 Specifies the type of line to be used to underline a text segment\&. Valid values are \fBXmNO_LINE\fP, \fBXmSINGLE_LINE\fP, \fBXmDOUBLE_LINE\fP, \fBXmSINGLE_DASHED_LINE\fP, and \fBXmDOUBLE_DASHED_LINE\fP\&. A value of \fBXmAS_IS\fP indicates that the underline type is not specified for this rendition\&. .SH "RELATED" .PP \fBXmRenditionCreate\fP(3), \fBXmRenditionFree\fP(3), \fBXmRenditionRetrieve\fP(3), \fBXmRenditionUpdate\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmDropSiteQueryStackingOrder.30000644000175000017500000000535012672140200017566 00000000000000'\" t ...\" DropSitQ.sgm /main/8 1996/09/08 20:41:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteQueryStackingOrder" "library call" .SH "NAME" \fBXmDropSiteQueryStackingOrder\fP \(em A Drag and Drop function that returns the parent, a list of children, and the number of children for a specified widget .iX "XmDropSiteQueryStacking\\%Order" .iX "Drag and Drop functions" "XmDropSiteQueryStacking\\%Order" .SH "SYNOPSIS" .PP .nf #include \fBStatus \fBXmDropSiteQueryStackingOrder\fP\fR( \fBWidget \fBwidget\fR\fR, \fBWidget *\fBparent_return\fR\fR, \fBWidget **\fBchild_returns\fR\fR, \fBCardinal *\fBnum_child_returns\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteQueryStackingOrder\fP obtains the parent, a list of children registered as drop sites, and the number of children registered as drop sites for a given widget\&. The children are listed in current stacking order, from bottom-most (first child) to the top-most (last child)\&. This function allocates memory for the returned data that must be freed by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the widget ID\&. For this widget, you obtain the list of its children, its parent, and the number of children\&. .IP "\fIparent_return\fP" 10 Returns the widget ID of the drop site parent of the specified widget\&. .IP "\fIchild_returns\fP" 10 Returns a pointer to the list of drop site children associated with the specified widget\&. The function allocates memory to hold the list\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXtFree\fP\&. .IP "\fInum_child_returns\fP" 10 Returns the number of drop site children for the specified widget\&. .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RETURN" .PP Returns 0 (zero) if the routine fails; returns a nonzero value if it succeeds\&. .SH "RELATED" .PP \fBXmDropSite\fP(3) and \fBXmDropSiteConfigureStackingOrder\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmCascadeButton.30000644000175000017500000004373512672140200015057 00000000000000'\" t ...\" CascBA.sgm /main/11 1996/09/08 20:25:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCascadeButton" "library call" .SH "NAME" \fBXmCascadeButton\fP \(em The CascadeButton widget class .iX "XmCascadeButton" .iX "widget class" "CascadeButton" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP CascadeButton links two menu panes or a MenuBar to a menu pane\&. .PP It is used in menu systems and must have a RowColumn parent with its \fBXmNrowColumnType\fP resource set to \fBXmMENU_BAR\fP, \fBXmMENU_POPUP\fP or \fBXmMENU_PULLDOWN\fP\&. .PP It is the only widget that can have a Pulldown menu pane attached to it as a submenu\&. The submenu is displayed when this widget is activated within a MenuBar, a PopupMenu, or a PulldownMenu\&. Its visuals can include a label or pixmap and a cascading indicator when it is in a Popup or Pulldown menu pane; or it can include only a label or a pixmap when it is in a MenuBar\&. The positioning of the PulldownMenu with respect to the CascadeButton depends on the \fBXmNlayoutDirection\fP resource of the MenuShell\&. .PP The default behavior associated with a CascadeButton depends on the type of menu system in which it resides\&. By default, \fBBSelect\fP controls the behavior of the CascadeButton\&. In addition, \fBBMenu\fP controls the behavior of the CascadeButton if it resides in a PopupMenu system\&. The actual mouse button used is determined by its RowColumn parent\&. \fBBMenu\fP also performs the \fBBSelect\fP actions in all types of menu systems\&. .PP A CascadeButton\&'s visuals differ from most other button gadgets\&. When the button becomes armed, its visuals change from a 2-D to a 3-D look, and it displays the submenu that has been attached to it\&. If no submenu is attached, it simply changes its visuals\&. .PP When a CascadeButton within a Pulldown or Popup menu pane is armed as the result of the user moving the mouse pointer into the widget, it does not immediately display its submenu\&. Instead, it waits a short amount of time to see if the arming was temporary (that is, the user was simply passing through the widget), or whether the user really wanted the submenu posted\&. This time delay is configurable using \fBXmNmappingDelay\fP\&. .PP CascadeButton provides a single mechanism for activating the widget from the keyboard\&. This mechanism is referred to as a keyboard mnemonic\&. If a mnemonic has been specified for the widget, the user may activate the CascadeButton by simply typing the mnemonic while the CascadeButton is visible\&. If the CascadeButton is in a MenuBar and the MenuBar does not have the focus, the \fBMAlt\fP modifier must be pressed with the mnemonic\&. Mnemonics are typically used to interact with a menu using the keyboard interface\&. .PP If the Cascadebutton is in a Pulldown or Popup menu pane and there is a submenu attached, the \fBXmNmarginBottom\fP, \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, and \fBXmNmarginTop\fP resources may enlarge to accommodate \fBXmNcascadePixmap\fP\&. \fBXmNmarginWidth\fP defaults to 6 if this resource is in a MenuBar; otherwise, it takes Label\&'s default, which is 2\&. .PP CascadeButton uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits\&. .SS "Classes" .PP CascadeButton inherits behavior, resources, and traits from \fBCore\fP, \fBXmPrimitive\fP, and \fBXmLabel\fP classes\&. .PP The class pointer is \fBxmCascadeButtonWidgetClass\fP\&. .PP The class name is \fBXmCascadeButton\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmCascadeButton Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNcascadePixmapXmCPixmapPixmapdynamicCSG _____ XmNcascadingCallbackXmCCallbackXtCallbackListNULLC _____ XmNmappingDelayXmCMappingDelayint180 msCSG _____ XmNsubMenuIdXmCMenuWidgetWidgetNULLCSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when the user activates the CascadeButton widget and there is no submenu attached to pop up\&. The activation occurs when a mouse button is released or when the mnemonic associated with the widget is typed\&. The specific mouse button depends on information in the RowColumn parent\&. The reason sent by the callback is \fBXmCR_ACTIVATE\fP\&. .IP "\fBXmNcascadePixmap\fP" 10 Specifies the cascade pixmap displayed on one end of the widget when a CascadeButton is used within a Popup or Pulldown menu pane and a submenu is attached\&. The Label class resources \fBXmNmarginBottom\fP, \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, and \fBXmNmarginTop\fP may be modified to ensure that room is left for the cascade pixmap\&. The default cascade pixmap is an arrow pointing to the side of the menu where the submenu will appear\&. The positioning of the cascade pixmap to either the left of right of the widget, and the direction of the arrow, depend on the \fBXmNlayoutDirection\fP resource of the MenuShell\&. .IP "\fBXmNcascadingCallback\fP" 10 Specifies the list of callbacks that is called just prior to the mapping of the submenu associated with CascadeButton\&. The reason sent by the callback is \fBXmCR_CASCADING\fP\&. .IP "\fBXmNmappingDelay\fP" 10 Specifies the amount of time, in milliseconds, between when a CascadeButton becomes armed and when it maps its submenu\&. This delay is used only when the widget is within a Popup or Pulldown menu pane\&. The value must not be negative\&. .IP "\fBXmNsubMenuId\fP" 10 Specifies the widget ID for the Pulldown menu pane to be associated with this CascadeButton\&. The specified menu pane is displayed when the CascadeButton becomes armed\&. The menu pane must have been created with the appropriate parentage depending on the type of menu used\&. See \fBXmCreateMenuBar\fP(3), \fBXmCreatePulldownMenu\fP(3), and \fBXmCreatePopupMenu\fP(3) for more information on the menu systems\&. .SS "Inherited Resources" .PP CascadeButton inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabel Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLN/A _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLN/A _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimensiondynamicCSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimension0CSG _____ XmNmarginRightXmCMarginRightDimensiondynamicCSG _____ XmNmarginTopXmCMarginTopDimensiondynamicCSG _____ XmNmarginWidthXmCMarginWidthDimensiondynamicCSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGCSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension0CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleandynamicG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback or is NULL if this callback was not triggered due to an \fBXEvent\fP .SS "Translations" .PP \fBXmCascadeButton\fP includes translations from \fBXmPrimitive\fP\&. \fBXmCascadeButton\fP includes the menu traversal translations from \fBXmLabel\fP\&. .PP Note that altering translations in \fB#override\fP or \fB#augment\fP mode is undefined\&. .PP The following list describes the translations for a CascadeButton in a MenuBar\&. The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP\fBNormal\fP:" 10 MenuBarEnter() .IP "\fB\fP\fBNormal\fP:" 10 MenuBarLeave() .IP "\fB\fP:" 10 ProcessDrag() .IP "\fBc\fP:" 10 MenuButtonTakeFocusUp() .IP "\fBc\fP:" 10 MenuButtonTakeFocusUp() .IP "\fB\(apc\fP\fB\fP:" 10 MenuBarSelect() .IP "\fB\(apc\fP\fB\fP:" 10 DoSelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 KeySelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 KeySelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB:\fP\fB\fP\fB\fP:" 10 CleanupMenuBar() .IP "\fB\(aps\fP\fB\fP\fBReturn\fP:" 10 KeySelect() .IP "\fB\(aps\fP\fB\fP\fBspace\fP:" 10 KeySelect() .PP The following list describes the translations for a CascadeButton in a PullDown or Popup MenuPane\&. In a Popup menu system, \fB\fP also performs the \fB\fP actions\&. .IP "\fB\fP:" 10 DelayedArm() .IP "\fB\fP:" 10 CheckDisarm() .IP "\fB\fP:" 10 ProcessDrag() .IP "\fBc\fP:" 10 MenuButtonTakeFocus() .IP "\fBc\fP:" 10 MenuButtonTakeFocusUp() .IP "\fB\(apc\fP\fB\fP:" 10 StartDrag() .IP "\fB\(apc\fP\fB\fP:" 10 DoSelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 KeySelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 KeySelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB:\fP\fB\fP\fB\fP:" 10 CleanupMenuBar() .IP "\fB\(aps\fP\fB\fP\fBReturn\fP:" 10 KeySelect() .IP "\fB\(aps\fP\fB\fP\fBspace\fP:" 10 KeySelect() .SS "Action Routines" .PP The XmCascadeButton action routines are .IP "CleanupMenuBar():" 10 In a MenuBar, disarms the CascadeButton and the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu was entered\&. .IP "" 10 In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, unposts the menu\&. .IP "" 10 In a Popup MenuPane, unposts the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget from which the menu was posted\&. .IP "DoSelect():" 10 Calls the callbacks in \fBXmNcascadingCallback\fP, posts the submenu attached to the CascadeButton and enables keyboard traversal within the menu\&. If the CascadeButton does not have a submenu attached, this action calls the callbacks in \fBXmNactivateCallback\fP, activates the CascadeButton, and unposts all posted menus in the cascade\&. .IP "Help():" 10 Unposts all menus in the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu system was entered\&. Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "KeySelect():" 10 Calls the callbacks in \fBXmNcascadingCallback\fP, and posts the submenu attached to the CascadeButton if keyboard traversal is enabled in the menu\&. If the CascadeButton does not have a submenu attached, this action calls the callbacks in \fBXmNactivateCallback\fP, activates the CascadeButton, and unposts all posted menus in the cascade\&. .IP "MenuBarSelect():" 10 Unposts any menus posted by the parent menu\&. Arms both the CascadeButton and the MenuBar, posts the associated submenu, and enables mouse traversal\&. If the menu is already active, this event disables keyboard traversal for the menu and returns the menu to mouse traversal mode\&. .IP "StartDrag():" 10 Arms the CascadeButton, posts the associated submenu, and enables mouse traversal\&. If the menu is already active, this event disables keyboard traversal for the menu and returns the menu to mouse traversal mode\&. .SS "Additional Behavior" .PP Posting a submenu calls the \fBXmNcascadingCallback\fP callbacks\&. This widget has the following additional behavior: .IP "\fB\fP:" 10 If keyboard traversal is enabled, does nothing\&. Otherwise, in a MenuBar that is armed, unposts any MenuPanes associated with another MenuBar entry, arms the CascadeButton, and posts the associated submenu\&. In other menus, arms the CascadeButton and posts the associated submenu after the delay specified by \fBXmNmappingDelay\fP\&. .IP "\fB\fP:" 10 If keyboard traversal is enabled does nothing\&. Otherwise, in a MenuBar that is armed, disarms the CascadeButton if the submenu associated with the CascadeButton is not currently posted or if there is no submenu associated with the CascadeButton\&. .IP "" 10 In other menus, if the pointer moves anywhere except into a submenu associated with the CascadeButton, the CascadeButton is disarmed and its submenu is unposted\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCascadeButtonHighlight\fP(3), \fBXmCreateCascadeButton\fP(3), \fBXmCreateMenuBar\fP(3), \fBXmCreatePulldownMenu\fP(3), \fBXmCreatePopupMenu\fP(3), \fBXmLabel\fP(3), \fBXmPrimitive\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreateCascadeButton\fP(3), \fBXmVaCreateManagedCascadeButton\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateSimplePulldownMenu.30000644000175000017500000000577512672140200017271 00000000000000'\" t ...\" CreSiE.sgm /main/7 1996/08/30 14:55:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSimplePulldownMenu" "library call" .SH "NAME" \fBXmCreateSimplePulldownMenu\fP \(em A RowColumn widget convenience creation function .iX "XmCreateSimplePulldown\\%Menu" .iX "creation functions" "XmCreateSimplePulldown\\%Menu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSimplePulldownMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSimplePulldownMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_PULLDOWN\fP and returns the associated widget ID\&. .PP This routine creates a Pulldown menu pane and its button children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. The name of each separator is \fBseparator_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of separators in the menu minus 1\&. The name of each title is \fBlabel_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of titles in the menu minus 1\&. Buttons, separators, and titles are named and created in the order they are specified in the RowColumn simple menu creation resources supplied in the argument list\&. .IP "\fIparent\fP" 10 Specifies the widget ID of the parent of the MenuShell .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. The only button types allowed in the \fBXmNbuttonType\fP resource are \fBXmCASCADEBUTTON\fP, \fBXmPUSHBUTTON\fP, \fBXmRADIOBUTTON\fP, \fBXmCHECKBUTTON\fP, \fBXmTITLE\fP, \fBXmSEPARATOR\fP, and \fBXmDOUBLE_SEPARATOR\fP\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreatePulldownMenu\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimplePulldownMenu\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmTextPosition.30000644000175000017500000000340112672140200014773 00000000000000'\" t ...\" TxtPosit.sgm /main/9 1996/09/08 21:18:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextPosition" "library call" .SH "NAME" \fBXmTextPosition\fR \(em Data type for a character position within a text string .iX "XmTextPosition" .iX "data types" "XmTextPosition" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmTextPosition\fR is an integer data type that holds a character\&'s position within a text string for Text and TextField\&. .PP An \fBXmTextPosition\fR value conceptually points to the gap between two characters\&. For example, consider a text string consisting of \fBN\fP characters\&. A value of 0 refers to the position immediately prior to the first character\&. A value of 1 refers to the position in between the first and second characters\&. A value of \fBN\fP refers to the position immediately following the last character\&. Therefore, the text string of \fBN\fP characters actually contains \fBN + 1\fP positions\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmCreateScrolledList.30000644000175000017500000000676012672140200016064 00000000000000'\" t ...\" CreScD.sgm /main/8 1996/09/08 20:35:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateScrolledList" "library call" .SH "NAME" \fBXmCreateScrolledList\fP \(em The List ScrolledList convenience creation function .iX "XmCreateScrolledList" .iX "creation functions" "XmCreateScrolledList" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateScrolledList\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateScrolledList\fP creates an instance of a List widget that is contained within a ScrolledWindow\&. The ScrolledWindow parent is created managed\&. All ScrolledWindow subarea widgets are automatically created by this function\&. The ID returned by this function is that of the List widget (not the ScrolledWindow widget)\&. Use this widget ID for all operations on the List widget\&. Use the widget ID of the List widget\&'s parent for all operations on the ScrolledWindow\&. To obtain the ID of the ScrolledWindow widget associated with the List widget, use the Xt Intrinsics \fBXtParent\fP function\&. The name of the ScrolledWindow created by this function is formed by concatenating \fBSW\fP onto the end of the \fIname\fP specified in the parameter list\&. .PP All arguments to either the List or the ScrolledWindow widget can be specified at creation time using this function\&. Changes to initial position and size are sent only to the ScrolledWindow widget\&. Other resources are sent to the List or the ScrolledWindow widget as appropriate\&. Note that the result of providing the \fBXmNdestroyCallback\fP resource in the creation \fIarglist\fP is unspecified\&. The application should use the \fBXtAddCallback\fP function to add callbacks to the appropriate widget (List or ScrolledWindow) after creating it\&. .PP This function forces the following initial values for ScrolledWindow resources: .IP " \(bu" 6 \fBXmNscrollingPolicy\fP is set to \fBXmAPPLICATION_DEFINED\fP\&. .IP " \(bu" 6 \fBXmNvisualPolicy\fP is set to \fBXmVARIABLE\fP\&. .IP " \(bu" 6 \fBXmNscrollBarDisplayPolicy\fP is set to \fBXmSTATIC\fP\&. (No initial value is forced for the List\&'s \fBXmNscrollBarDisplayPolicy\fP\&.) .IP " \(bu" 6 \fBXmNshadowThickness\fP is set to 0 (zero)\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns the List widget ID\&. .SH "RELATED" .PP \fBXmList\fP(3) and \fBXmScrolledWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmString.30000644000175000017500000001116412672140200013575 00000000000000'\" t ...\" String.sgm /main/8 1996/09/08 21:08:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmString" "library call" .SH "NAME" \fBXmString\fR \(em Data type for a compound string .iX "XmString" .iX "data types" "XmString" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmString\fR is the data type for a compound string\&. Compound strings consist of a sequence of components, including, but not limited to, the following: .IP " \(bu" 6 \fBXmSTRING_COMPONENT_SEPARATOR\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_TAB\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_LAYOUT_POP\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_DIRECTION\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_LAYOUT_PUSH\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_CHARSET\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_FONTLIST_ELEMENT_TAG\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_LOCALE\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_LOCALE_TEXT\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_TAG\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_TEXT\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_END\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_RENDITION_END\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_UNKNOWN\fP .IP " \(bu" 6 \fBXmSTRING_COMPONENT_WIDECHAR_TEXT\fP .PP and also a rendition tags table, text, and text component\&. When a compound string is displayed, the rendition tags and the direction are used to determine how to display the text\&. .PP Calling \fBXtGetValues\fP for a resource whose type is \fBXmString\fR yields a copy of the compound string resource value\&. The application is responsible for using \fBXmStringFree\fP to free the memory allocated for the copy\&. .PP Please see the \fBXmStringComponentType\fR reference page for more detail about compound string components, and for a description of the order in which the components should appear in a compound string\&. Refer to the \fBXmRenderTable\fR reference page for a description of the algorithm that associates the rendition tags used for displaying a compound string text component with a rendition in a render table\&. .SH "RELATED" .PP \fBXmParseMapping\fP(3), \fBXmParseMappingCreate\fP(3), \fBXmParseMappingFree\fP(3), \fBXmParseMappingGetValues\fP(3), \fBXmParseMappingSetValues\fP(3), \fBXmParseTable\fP(3), \fBXmParseTableFree\fP(3), \fBXmStringBaseline\fP(3), \fBXmStringByteCompare\fP(3), \fBXmStringByteStreamLength\fP(3), \fBXmStringCompare\fP(3), \fBXmStringComponentCreate\fP(3), \fBXmStringComponentType\fP(3), \fBXmStringConcat\fP(3), \fBXmStringConcatAndFree\fP(3), \fBXmStringCopy\fP(3), \fBXmStringCreate\fP(3), \fBXmStringCreateLocalized\fP(3), \fBXmStringCreateLtoR\fP(3), \fBXmStringCreateSimple\fP(3), \fBXmStringDirection\fP(3), \fBXmStringDirectionCreate\fP(3), \fBXmStringDirectionToDirection\fP(3), \fBXmStringDraw\fP(3), \fBXmStringDrawImage\fP(3), \fBXmStringDrawUnderline\fP(3), \fBXmStringEmpty\fP(3), \fBXmStringExtent\fP(3), \fBXmStringFree\fP(3), \fBXmStringFreeContext\fP(3), \fBXmStringGenerate\fP(3), \fBXmStringGetLtoR\fP(3), \fBXmStringGetNextComponent\fP(3), \fBXmStringGetNextSegment\fP(3), \fBXmStringGetNextTriple\fP(3), \fBXmStringHasSubstring\fP(3), \fBXmStringHeight\fP(3), \fBXmStringInitContext\fP(3), \fBXmStringIsVoid\fP(3), \fBXmStringLength\fP(3), \fBXmStringLineCount\fP(3), \fBXmStringNConcat\fP(3), \fBXmStringNCopy\fP(3), \fBXmStringParseText\fP(3), \fBXmStringPeekNextComponent\fP(3), \fBXmStringPeekNextTriple\fP(3), \fBXmStringPutRendition\fP(3), \fBXmStringSegmentCreate\fP(3), \fBXmStringSeparatorCreate\fP(3), \fBXmStringTable\fP(3), \fBXmStringTableParseStringArray\fP(3), \fBXmStringTableProposeTablist\fP(3), \fBXmStringTableToXmString\fP(3), \fBXmStringTableUnparse\fP(3), \fBXmStringToXmStringTable\fP(3), \fBXmStringUnparse\fP(3), \fBXmStringWidth\fP(3), \fBXmCvtXmStringToByteStream\fP(3), \fBXmCvtXmStringToCT\fP(3), \fBXmCvtCTToXmString\fP(3), and \fBXmCvtByteStreamToXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmTextFieldGetSelection.30000644000175000017500000000350412672140200016524 00000000000000'\" t ...\" TxtFieAK.sgm /main/8 1996/09/08 21:13:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetSelection" "library call" .SH "NAME" \fBXmTextFieldGetSelection\fP \(em A TextField function that retrieves the value of the primary selection .iX "XmTextFieldGetSelection" .iX "TextField functions" "XmTextFieldGetSelection" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmTextFieldGetSelection\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetSelection\fP retrieves the value of the primary selection\&. It returns a NULL pointer if no text is selected in the widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns a character pointer to the string that is associated with the primary selection\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldGetSelectionWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextField.30000644000175000017500000020570512672140200014225 00000000000000'\" t ...\" TxtFieAA.sgm /main/15 1996/09/25 15:57:20 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextField" "library call" .SH "NAME" \fBXmTextField\fP \(em The TextField class .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The TextField widget provides a single line text editor for customizing both user and programmatic interfaces\&. It is used for single-line string entry, and forms entry with verification procedures\&. It provides an application with a consistent editing system for textual data\&. .PP TextField provides separate callback lists to verify movement of the insert cursor, modification of the text, and changes in input focus\&. Each of these callbacks provides the verification function with the widget instance, the event that caused the callback, and a data structure specific to the verification type\&. From this information, the function can verify if the application considers this to be a legitimate state change and can signal the widget whether to continue with the action\&. .PP The user interface tailors a new set of actions\&. The key bindings have been added for insert cursor movement, deletion, insertion, and selection of text\&. .PP TextField allows the user to select regions of text\&. Selection is based on the model specified in the \fIInter-Client Communication Conventions Manual\fP (ICCCM)\&. TextField supports primary and secondary selection\&. .PP TextField uses the \fBXmQTnavigator\fP, \fBXmQTspecifyRenderTable\fP, and \fBXmQTscrollFrame\fP traits, and holds the \fBXmQTaccessTextual\fP \fBXmQTtransfer\fP traits\&. .PP If an application or widget calls the \fBsetValue\fP trait method of \fBXmQTaccessTextual\fP, then \fBXmTextField\fP will call \fBXmTextFieldSetString\fP to set the string value\&. .SS "Data Transfer Behavior" .PP TextField supports transfer of the primary, secondary, and clipboard selections and dragging of selected text from the widget\&. TextField can also be the destination for the primary, secondary, and clipboard selections, and it supports dropping of data being dragged onto the widget\&. .PP When the \fBXmNconvertCallback\fP procedures are called, the \fBlocation_data\fP member of the \fBXmConvertCallbackStruct\fR member is NULL if the selected text is being transferred\&. If the entire text, not the selected text, is being transferred, the value of this member is the widget ID of the TextField widget\&. .PP As a source of data, TextField supports the following targets and associated conversions of data to these targets: .IP "\fBUTF8_STRING\fP" 10 The widget transfers the selected text as type \fBUTF8_STRING\fP\&. .IP "\fIlocale\fP" 10 If the \fIlocale\fP target matches the widget\&'s locale, the widget transfers the selected text in the encoding of the locale\&. .IP "\fBCOMPOUND_TEXT\fP" 10 The widget transfers the selected text as type \fBCOMPOUND_TEXT\fP\&. .IP "\fBSTRING\fP" 10 The widget transfers the selected text as type \fBSTRING\fP\&. .IP "\fBTEXT\fP" 10 If the selected text is fully convertible to the encoding of the locale, the widget transfers the selected text in the encoding of the locale\&. Otherwise, the widget transfers the selected text as type \fBCOMPOUND_TEXT\fP\&. .IP "\fBDELETE\fP" 10 The widget deletes the selected text\&. .IP "\fB_MOTIF_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to which the widget can convert data to be placed on the clipboard immediately\&. These include the following targets: .RS .IP " \(bu" 6 \fBUTF8_STRING\fP .IP " \(bu" 6 \fBCOMPOUND_TEXT\fP .IP " \(bu" 6 The encoding of the locale, if the selected text is fully convertible to the encoding of the locale .IP " \(bu" 6 \fBSTRING\fP, if the selected text is fully convertible to \fBSTRING\fP .RE .IP "\fB_MOTIF_EXPORT_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to be used as the value of the DragContext\&'s \fBXmNexportTargets\fP in a drag-and-drop transfer\&. These include \fBCOMPOUND_TEXT\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP, \fBUTF8_STRING\fP, \fBBACKGROUND\fP, and \fBFOREGROUND\fP\&. .IP "\fB_MOTIF_LOSE_SELECTION\fP" 10 The widget takes the following actions: .RS .IP " \(bu" 6 When losing the \fBPRIMARY\fP selection, it unhighlights the selected text and calls the \fBXmNlosePrimaryCallback\fP procedures\&. .IP " \(bu" 6 When losing the \fBSECONDARY\fP selection, it removes the secondary selection highlight\&. .IP " \(bu" 6 When losing the \fB_MOTIF_DESTINATION\fP selection, if the widget does not have focus it changes the cursor to indicate that the widget is no longer the destination\&. .RE .PP As a source of data, TextField also supports the following standard Motif targets: .IP "\fBBACKGROUND\fP" 10 The widget transfers \fBXmNbackground\fP as type \fBPIXEL\fP\&. .IP "\fBCLASS\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_CLASS\fP property and transfers the contents as text in the current locale\&. .IP "\fBCLIENT_WINDOW\fP" 10 The widget finds the first shell in the widget hierarchy and transfers its window as type \fBWINDOW\fP\&. .IP "\fBCOLORMAP\fP" 10 The widget transfers \fBXmNcolormap\fP as type \fBCOLORMAP\fP\&. .IP "\fBFOREGROUND\fP" 10 The widget transfers \fBXmNforeground\fP as type \fBPIXEL\fP\&. .IP "\fBNAME\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_NAME\fP property and transfers the contents as text in the current locale\&. .IP "\fBTARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports\&. These include the standard targets in this list\&. These also include \fBCOMPOUND_TEXT\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP and \fBUTF8_STRING\fP\&. .IP "\fBTIMESTAMP\fP" 10 The widget transfers the timestamp used to acquire the selection as type \fBINTEGER\fP\&. .IP "\fB_MOTIF_RENDER_TABLE\fP" 10 The widget transfers \fBXmNrenderTable\fP if it exists, or else the default text render table, as type \fBSTRING\fP\&. .IP "\fB_MOTIF_ENCODING_REGISTRY\fP" 10 The widget transfers its encoding registry as type \fBSTRING\fP\&. The value is a list of NULL separated items in the form of tag encoding pairs\&. This target symbolizes the transfer target for the Motif Segment Encoding Registry\&. Widgets and applications can use this Registry to register text encoding formats for specified render table tags\&. Applications access this Registry by calling \fBXmRegisterSegmentEncoding\fP and \fBXmMapSegmentEncoding\fP\&. .PP As a destination for data, TextField chooses a target and requests conversion of the selection to that target\&. If the encoding of the locale is present in the list of available targets, TextField chooses a requested target from the available targets in the following order of preference: .IP " 1." 6 \fBTEXT\fP .IP " 1." 6 \fBUTF8_STRING\fP .IP " 2." 6 \fBCOMPOUND_TEXT\fP .IP " 3." 6 The encoding of the locale .IP " 4." 6 \fBSTRING\fP .PP If the encoding of the locale is not present in the list of available targets, TextField chooses a requested target from the available targets in the following order of preference: .IP " 1." 6 \fBUTF8_STRING\fP .IP " 1." 6 \fBCOMPOUND_TEXT\fP .IP " 2." 6 \fBSTRING\fP .SS "Classes" .PP TextField widget inherits behavior, resources, and traits from \fBCore\fP and \fIPrimitive\fP\&. .PP The class pointer is \fBxmTextFieldWidgetClass\fP\&. .PP The class name is \fBXmTextField\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lower case or upper case, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmTextFieldResource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNblinkRateXmCBlinkRateint500CSG _____ XmNcolumnsXmCColumnsshortdynamicCSG _____ XmNcursorPositionXmCCursorPositionXmTextPosition0CSG _____ XmNcursorPositionVisibleXmCCursorPositionVisibleBooleandynamicCSG _____ XmNdestinationCallbackXmCCallbackXtCallbackListNULLC _____ XmNeditableXmCEditableBooleanTrueCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNgainPrimaryCallbackXmCCallbackXtCallbackListNULLC _____ XmNlosePrimaryCallbackXmCCallbackXtCallbackListNULLC _____ XmNlosingFocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension5CSG _____ XmNmarginWidthXmCMarginWidthDimension5CSG _____ XmNmaxLengthXmCMaxLengthintlargest integerCSG _____ XmNmodifyVerifyCallbackXmCCallbackXtCallbackListNULLC _____ XmNmodifyVerifyCallbackWcsXmCCallbackXtCallbackListNULLC _____ XmNmotionVerifyCallbackXmCCallbackXtCallbackListNULLC _____ XmNpendingDeleteXmCPendingDeleteBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNresizeWidthXmCResizeWidthBooleanFalseCSG _____ XmNselectionArrayXmCSelectionArrayXtPointerdefault arrayCSG _____ XmNselectionArrayCountXmCSelectionArrayCountint3CSG _____ XmNselectThresholdXmCSelectThresholdint5CSG _____ XmNvalueXmCValueString""CSG _____ XmNvalueChangedCallbackXmCCallbackXtCallbackListNULLC _____ XmNvalueWcsXmCValueWcswchar_t *(wchar_t *)""CSG\u1\d _____ XmNverifyBellXmCVerifyBellBooleandynamicCSG _____ .TE .PP \u1\d This resource cannot be specified in a resource file\&. .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when the user invokes an event that calls the activate() action\&. The type of the structure whose address is passed to this callback is \fBXmAnyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_ACTIVATE\fP\&. .IP "\fBXmNblinkRate\fP" 10 Specifies the blink rate of the text cursor in milliseconds\&. The time indicated in the blink rate relates to the length of time the cursor is visible and the time the cursor is invisible (that is, the time it will take to blink the insertion cursor on and off will be two times the blink rate)\&. The cursor will not blink when the blink rate is set to 0 (zero)\&. The value must not be negative\&. .IP "\fBXmNcolumns\fP" 10 Specifies the initial width of the text window as an integer number of characters\&. The width equals the number of characters specified by this resource multiplied by the width as derived from the specified font\&. If the em-space value is available, it is used\&. If not, the width of the numeral "0" is used\&. If this is not available, the maximum width is used\&. For proportionate fonts, the actual number of characters that fit on a given line may be greater than the value specified\&. .IP "\fBXmNcursorPosition\fP" 10 Indicates the position in the text where the current insert cursor is to be located\&. Position is determined by the number of characters from the beginning of the text\&. .IP "\fBXmNcursorPositionVisible\fP" 10 If the text widget has an \fBXmPrintShell\fP as one of its ancestors (that is, the widget was created on a print server connection) then the default value is \fBFalse\fP; otherwise, it is \fBTrue\fP\&. .IP "\fBXmNdestinationCallback\fP" 10 Specifies a list of callbacks called when the widget is the destination of a transfer operation\&. The type of the structure whose address is passed to these callbacks is \fBXmDestinationCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNeditable\fP" 10 When set to True, indicates that the user can edit the text string\&. A false value will prohibit the user from editing the text\&. .IP "" 10 When \fBXmNeditable\fP is used on a widget it sets the dropsite to \fBXmDROP_SITE_ACTIVE\fP\&. .IP "\fBXmNfocusCallback\fP" 10 Specifies the list of callbacks called when TextField accepts input focus\&. The type of the structure whose address is passed to this callback is \fBXmAnyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_FOCUS\fP\&. .IP "\fBXmNfontList\fP" 10 Specifies the font list to be used for TextField\&. The font list is an obsolete structure, and is retained only for compatibility with earlier releases of Motif\&. Use the render table (\fBXmNrenderTable\fP) instead of font lists wherever possible\&. If both are specified, the render table will take precedence\&. If this value is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the font list is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. .IP "" 10 TextField searches the font list for the first occurrence of a font set that has an \fBXmFONTLIST_DEFAULT_TAG\fP\&. If a default element is not found, the first font set in the font list is used\&. If the list contains no font sets, the first font in the font list will be used\&. Refer to \fBXmFontList\fP(3) for more information on a font list structure\&. .IP "\fBXmNgainPrimaryCallback\fP" 10 Specifies the list of callbacks that are called when the user invokes an event that causes the text widget to gain ownership of the primary selection\&. The callback reason for this callback is \fBXmCR_GAIN_PRIMARY\fP\&. .IP "\fBXmNlosePrimaryCallback\fP" 10 Specifies the list of callbacks that are called when the user invokes an event that cause the text widget to lose ownership of the primary selection\&. The callback reason for this callback is \fBXmCR_LOSE_PRIMARY\fP\&. .IP "\fBXmNlosingFocusCallback\fP" 10 Specifies the list of callbacks that are called before TextField widget loses input focus\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_LOSING_FOCUS\fP\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the distance between the top edge of the widget window and the text, and the bottom edge of the widget window and the text\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the distance between the left edge of the widget window and the text, and the right edge of the widget window and the text\&. .IP "\fBXmNmaxLength\fP" 10 Specifies the maximum length of the text string that can be entered into text from the keyboard\&. This value must be nonnegative\&. Strings that are entered using the \fBXmNvalue\fP resource or the \fBXmTextFieldSetString\fP function ignore this resource\&. .IP "\fBXmNmodifyVerifyCallback\fP" 10 Specifies the list of callbacks that is called before text is deleted from or inserted into TextField\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_MODIFYING_TEXT_VALUE\fP\&. When multiple TextField widgets share the same source, only the widget that initiates the source change will generate the \fBXmNmodifyVerifyCallback\fP\&. .IP "" 10 If both \fBXmNmodifyVerifyCallback\fP and \fBXmNmodifyVerifyCallbackWcs\fP are registered callback lists, the procedure(s) in the \fBXmNmodifyVerifyCallback\fP list is always executed first; and the resulting data, which may have been modified, is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callback routines\&. .IP "\fBXmNmodifyVerifyCallbackWcs\fP" 10 Specifies the list of callbacks called before text is deleted from or inserted into Text\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStructWcs\fR\&. The reason sent by the callback is \fBXmCR_MODIFYING_TEXT_VALUE\fP\&. When multiple TextField widgets share the same source, only the widget that initiates the source change will generate the \fBXmNmodifyVerifyCallbackWcs\fP\&. .IP "" 10 If both \fBXmNmodifyVerifyCallback\fP and \fBXmNmodifyVerifyCallbackWcs\fP are registered callback lists, the procedure(s) in the \fBXmNmodifyVerifyCallback\fP list is always executed first; and the resulting data, which may have been modified, is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callback routines\&. .IP "\fBXmNmotionVerifyCallback\fP" 10 Specifies the list of callbacks that is called before the insert cursor is moved to a new position\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_MOVING_INSERT_CURSOR\fP\&. It is possible for more than one \fBXmNmotionVerifyCallback\fPs to be generated from a single action\&. .IP "\fBXmNpendingDelete\fP" 10 Indicates that pending delete mode is on when the Boolean is True\&. Pending deletion is defined as deletion of the selected text when an insertion is made\&. .IP "\fBXmNrenderTable\fP" 10 Specifies the render table to be used in deriving a font set or font for displaying text\&. If both a render table and a font list are specified, the render table will take precedence\&. If the value of \fBXmNrenderTable\fP is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the font list is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. .IP "" 10 TextField searches the render table for the first occurrence of a rendition that has the tag \fB_MOTIF_DEFAULT_LOCALE\fP\&. If a default element is not found, the first rendition in the table is used\&. Refer to \fBXmRenderTable\fP(3) for more information on the render table structure\&. .IP "\fBXmNresizeWidth\fP" 10 Indicates that the TextField widget will attempt to resize its width to accommodate all the text contained in the widget when Boolean is True\&. .IP "\fBXmNselectionArray\fP" 10 Defines the actions for multiple mouse clicks\&. Each mouse click performed within some time of the previous mouse click will increment the index into this array and perform the defined action for that index\&. (This "multi-click" time is specified by the operating environment, and varies among different systems\&. In general, it is usually set to some fraction of a second\&.) The possible actions are .RS .IP "\fBXmSELECT_POSITION\fP" 10 Resets the insert cursor position .IP "\fBXmSELECT_WORD\fP" 10 Selects a word .IP "\fBXmSELECT_LINE\fP" 10 Selects a line of text .RE .IP "\fBXmNselectionArrayCount\fP" 10 Specifies the number of actions that are defined in the \fBXmNselectionArray\fP resource\&. The value must not be negative\&. .IP "\fBXmNselectThreshold\fP" 10 Specifies the number of pixels of motion that is required to select the next character when selection is performed using the click-drag mode of selection\&. The value must not be negative\&. This resource also specifies whether a drag should be started and the number of pixels to start a drag when \fBBtn2Down\fP and \fBBtn1Down\fP are integrated\&. .IP "\fBXmNvalue\fP" 10 Specifies the string value of the TextField widget as a \fBchar*\fP data value\&. Moves the cursor to position 0 unless a value of \fBXmNcursorPosition\fP was explicitly supplied in the argument list\&. If \fBXmNvalue\fP and \fBXmNvalueWcs\fP are both defined, the value of \fBXmNvalueWcs\fP supersedes that of \fBXmNvalue\fP\&. \fBXtGetValues\fP returns a copy of the value of the internal buffer and \fBXtSetValues\fP copies the string values into the internal buffer\&. .IP "\fBXmNvalueChangedCallback\fP" 10 Specifies the list of callbacks that is called after text is deleted from or inserted into TextField\&. The type of the structure whose address is passed to this callback is \fBXmAnyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_VALUE_CHANGED\fP\&. The \fBXmNvalueChangedCallback\fP should occur only in pairs with a \fBXmNmodifyVerifyCallback\fP, assuming that the \fIdoit\fP flag in the callback structure of the \fBXmNmodifyVerifyCallback\fP is not set to False\&. .IP "\fBXmNvalueWcs\fP" 10 Specifies the string value of the TextField widget as a \fBwchar_t*\fP data value\&. Moves the cursor to position 0 unless a value of \fBXmNcursorPosition\fP was explicitly supplied in the argument list\&. .IP "" 10 This resource cannot be specified in a resource file\&. .IP "" 10 If \fBXmNvalue\fP and \fBXmNvalueWcs\fP are both defined, the value of \fBXmNvalueWcs\fP supersedes that of \fBXmNvalue\fP\&. \fBXtGetValues\fP returns a copy of the value of the internal buffer encoded as a wide character string\&. \fBXtSetValues\fP copies the value of the wide character string into the internal buffer\&. .IP "\fBXmNverifyBell\fP" 10 Specifies whether a bell will sound when an action is reversed during a verification callback\&. The default depends on the value of the ancestor VendorShell\&'s \fBXmNaudibleWarning\fP resource\&. .SS "Inherited Resources" .PP TextField widget inherits behavior and resources from the superclasses in the following tables\&. For a complete description of these resources, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .PP The TextField widget defines a new callback structure for use with verification callbacks\&. Note that not all of the fields are relevant for every callback reason\&. The application must first look at the \fIreason\fP field and use only the structure members that are valid for the particular reason\&. The values \fIstartPos\fP, \fIendPos\fP, and \fItext\fP in the callback structure \fBXmTextVerifyCallbackStruct\fR may be modified upon receiving the callback, and these changes will be reflected as the change made to the source of the TextField widget\&. (For example, all keystrokes can be converted to spaces or NULL characters when a password is entered into a TextField widget\&.) The application programmer should not overwrite the \fItext\fP field, but should attach data to that pointer\&. .PP A pointer to the following structure is passed to the callbacks for \fBXmNlosingFocusCallback\fP, \fBXmNmodifyVerifyCallback\fP, and \fBXmNmotionVerifyCallback\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Boolean \fIdoit\fP; XmTextPosition \fIcurrInsert, newInsert\fP; XmTextPosition \fIstartPos, endPos\fP; XmTextBlock \fItext\fP; } XmTextVerifyCallbackStruct, *XmTextVerifyPtr; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP the triggered the callback\&. It can be NULL\&. For example, changes made to the Text widget programmatically do not have an event that can be passed to the associated callback\&. .IP "\fIdoit\fP" 10 Indicates whether the action that invoked the callback will be performed\&. Setting \fIdoit\fP to False negates the action\&. Note that not all actions may be negated\&. For example, \fBXmCR_LOSING_FOCUS\fP callbacks may be beyond the control of the widget if they are produced by mouse clicks\&. .IP "\fIcurrInsert\fP" 10 Indicates the current position of the insert cursor\&. .IP "\fInewInsert\fP" 10 Indicates the position at which the user attempts to position the insert cursor\&. .IP "\fIstartPos\fP" 10 Indicates the starting position of the text to modify\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fIendPos\fP" 10 Indicates the ending position of the text to modify\&. If no text is replaced or deleted, then the value is the same as \fIstartPos\fP\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fItext\fP" 10 Points to the following structure of type \fBXmTextBlockRec\fR\&. This structure holds the textual information to be inserted\&. .PP .nf typedef struct { char *\fIptr\fP; int \fIlength\fP; XmTextFormat \fIformat\fP } XmTextBlockRec, *XmTextBlock; .fi .RS .IP "\fIptr\fP" 10 The text to be inserted\&. \fIptr\fP points to a temporary storage space that is reused after the callback is finished\&. Therefore, if an application needs to save the text to be inserted, it should copy the text into its own data space\&. .IP "\fIlength\fP" 10 Specifies the length of the text to be inserted\&. .IP "\fIformat\fP" 10 Specifies the format of the text, either \fBXmFMT_8_BIT\fP or \fBXmFMT_16_BIT\fP\&. .RE .PP A pointer to the following structure is passed to callbacks for \fBXmNmodifyVerifyCallbackWcs\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Boolean \fIdoit\fP; XmTextPosition \fIcurrInsert, newInsert\fP; XmTextPosition \fIstartPos, endPos\fP; XmWcsTextBlock \fItext\fP; } XmTextVerifyCallbackStructWcs, *XmTextVerifyPtrWcs; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. For example, changes made to the Text widget programmatically do not have an event that can be passed to the associated callback\&. .IP "\fIdoit\fP" 10 Indicates whether the action that invoked the callback is performed\&. Setting \fIdoit\fP to False negates the action\&. Note that not all actions may be negated\&. For example, \fBXmCR_LOSING_FOCUS\fP callbacks may be beyond the control of the widget if they are produced by mouse clicks\&. .IP "\fIcurrInsert\fP" 10 Indicates the current position of the insert cursor\&. .IP "\fInewInsert\fP" 10 Indicates the position at which the user attempts to position the insert cursor\&. .IP "\fIstartPos\fP" 10 Indicates the starting position of the text to modify\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fIendPos\fP" 10 Indicates the ending position of the text to modify\&. If no text is replaced or deleted, the value is the same as \fIstartPos\fP\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fItext\fP" 10 Points to the following structure of type \fBXmTextBlockRecWcs\fR\&. This structure holds the textual information to be inserted\&. .PP .nf typedef struct { wchar_t *\fIwcsptr\fP; int \fIlength\fP; } XmTextBlockRecWcs, *XmTextBlockWcs; .fi .RS .IP "\fIwcsptr\fP" 10 Points to the wide character text to be inserted .IP "\fIlength\fP" 10 Specifies the number of characters to be inserted .RE .PP The following table describes the reasons for which the individual verification callback structure fields are valid\&. Note that the \fIevent\fP field will never be valid for \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .TS tab() box; l| l. \fBReason\fP\fBValid Fields\fP __ XmCR_LOSING_FOCUS\fIreason, event, doit\fP __ XmCR_MODIFYING_TEXT_VALUET{ \fIreason, event, doit, currInsert, newInsert, startPos, endPos, text\fP T} __ XmCR_MOVING_INSERT_CURSOR\fIreason, doit, currInsert, newInsert\fP __ .TE .PP A pointer to the following callback structure is passed to the \fBXmNdestinationCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; XtEnum \fIoperation\fP; int \fIflags\fP; XtPointer \fItransfer_id\fP; XtPointer \fIdestination_data\fP; XtPointer \fIlocation_data\fP; Time \fItime\fP; } XmDestinationCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which data transfer is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fIoperation\fP" 10 Indicates the type of transfer operation requested\&. .RS .IP " \(bu" 6 When the selection is \fBPRIMARY\fP or \fBSECONDARY\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fBCLIPBOARD\fP, possible values are \fBXmCOPY\fP and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fB_MOTIF_DROP\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, \fBXmLINK\fP, and \fBXmOTHER\fP\&. A value of \fBXmOTHER\fP means that the callback procedure must get further information from the \fBXmDropProcCallbackStruct\fR in the \fIdestination_data\fP member\&. .RE .IP "\fIflags\fP" 10 Indicates whether or not the destination widget is also the source of the data to be transferred\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 The destination widget is not the source of the data to be transferred\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The destination widget is the source of the data to be transferred\&. .RE .IP "\fBtransfer_id\fP" 10 Serves as a unique ID to identify the transfer transaction\&. .IP "\fIdestination_data\fP" 10 Contains information about the destination\&. When the selection is \fB_MOTIF_DROP\fP, the callback procedures are called by the drop site\&'s \fBXmNdropProc\fP, and \fIdestination_data\fP is a pointer to the \fBXmDropProcCallbackStruct\fR passed to the \fBXmNdropProc\fP procedure\&. When the selection is \fBSECONDARY\fP, \fIdestination_data\fP is an Atom representing a target recommmended by the selection owner for use in converting the selection\&. Otherwise, \fIdestination_data\fP is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location where data is to be transferred\&. The value is always NULL when the selection is \fBCLIPBOARD\fP\&. If the value is NULL, the data is to be inserted at the widget\&'s cursor position\&. Otherwise, the value is a pointer to an \fBXPoint\fP structure containing the x and y coordinates at the location where the data is to be transferred\&. Once \fBXmTransferDone\fP procedures start to be called, \fBlocation_data\fP will no longer be stable\&. .IP "\fItime\fP" 10 Indicates the time when the transfer operation began\&. .SS "Translations" .PP The \fBXmTextField\fP translations are described in the following list\&. The actions represent the effective behavior of the associated events, and they may differ in a right-to-left language environment\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\(apc s \(apm \(apa\fP \fB\fP:" 10 extend-start() .IP "\fBc \(aps \(apm \(apa\fP \fB\fP:" 10 move-destination() .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 grab-focus() .IP "\fB\(apc \(apm \(apa\fP \fB\fP:" 10 extend-adjust() .IP "\fB\(apc \(apm \(apa\fP \fB\fP:" 10 extend-end() .IP "\fB\fP:" 10 process-bdrag() .IP "\fBm \(apa\fP \fB\fP:" 10 secondary-adjust() .IP "\fB\(apm a\fP \fB\fP:" 10 secondary-adjust() .IP "\fBs c \fP:" 10 link-to() .IP "\fB\(aps\fP \fB\fP:" 10 copy-to() .IP "\fB\(apc\fP \fB\fP:" 10 move-to() .IP "\fB:m\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:a\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:\fP\fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:m\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:a\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:\fP\fB\fP\fB\fP:" 10 cut-clipboard() .IP "\fB:\fP\fB\fP\fB\fP:" 10 paste-clipboard() .IP "\fB:m\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:a\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:\fP\fB\fP\fB\fP:" 10 copy-clipboard() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 beginning-of-line(\fBextend\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 beginning-of-line() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 end-of-line(\fBextend\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 end-of-line() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 page-left(\fBextend\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 page-left() .IP "\fB:s c\fP\fB\fP\fB\fP:" 10 page-left(\fBextend\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 page-left() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 page-right(\fBextend\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 page-right() .IP "\fBs c\fP \fB\fP\fB\fP:" 10 page-right(\fBextend\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 page-right() .IP "\fB:\fP\fB\fP\fB\fP:" 10 clear-selection() .IP "\fB:\fP\fB\fP\fB\fP:" 10 delete-previous-character() .IP "\fB:s m\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:s a\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 cut-clipboard() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 delete-to-end-of-line() .IP "\fB:\fP\fB\fP\fB\fP:" 10 delete-next-character() .IP "\fB:c m\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:c a\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 paste-clipboard() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 copy-clipboard() .IP "\fB:\fP\fB\fP\fB\fP:" 10 toggle-overstrike() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 key-select() .IP "\fB:\fP\fB\fP\fB\fP:" 10 set-anchor() .IP "\fB:\fP\fB\fP\fB\fP:" 10 select-all() .IP "\fB:\fP\fB\fP\fB\fP:" 10 deselect-all() .IP "\fB:\fP\fB\fP\fB\fP:" 10 activate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 toggle-add-mode() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB:\fP\fB\fP\fB\fP:" 10 process-cancel() .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 backward-word(\fBextend\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 backward-word() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 key-select(\fBleft\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 backward-character() .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 forward-word(\fBextend\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 forward-word() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 key-select(\fBright\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 forward-character() .IP "\fB:\fP\fB\fP\fB\fP:" 10 traverse-prev() .IP "\fB:\fP\fB\fP\fB\fP:" 10 traverse-next() .IP "\fBc \(apm \(apa\fP \fB\fP\fBslash\fP:" 10 select-all() .IP "\fBc \(apm \(apa\fP \fB\fP\fBbackslash\fP:" 10 deselect-all() .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 prev-tab-group() .IP "\fB\(apm \(apa\fP \fB\fP\fBTab\fP:" 10 next-tab-group() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 activate() .IP "\fBc \(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 set-anchor() .IP "\fBc s \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 key-select() .IP "\fBs \(apc \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 self-insert() .IP "\fB\fP:" 10 self-insert() .PP The TextField button event translations are modified when Display\&'s \fBXmNenableBtn1Transfer\fP resource does not have a value of \fBXmOFF\fP (in other words, it is either \fBXmBUTTON2_TRANSFER\fP or \fBXmBUTTON2_ADJUST\fP)\&. This option allows the actions for selection and transfer to be integrated on \fB\fP\&. The actions for \fB\fP that are defined above still apply when the \fB\fP event occurs over text that is not selected\&. The following actions apply when the \fB\fP event occurs over text that is selected: .IP "\fB\fP:" 10 process-bdrag()\&. .IP "\fB\fP\fB\fP:" 10 process-bdrag()\&. .IP "\fB\fP\fB\fP\fB\fP:" 10 grab-focus(), \fBextend-end\fP\&. .IP "\fB\fP\fB\fP\fB\fP\fB\fP:" 10 extend-start(), extend-end()\&. .IP "\fB\fP\fB\fP\fB\fP\fB\fP:" 10 move-destination()\&. .IP "\fB\fP\fB\fP:" 10 process-bdrag()\&. .PP When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_ADJUST\fP, the following actions apply: .IP "\fB\fP:" 10 extend-start()\&. .IP "\fB\fP:" 10 extend-adjust()\&. .IP "\fB\fP:" 10 extend-end()\&. .SS "Action Routines" .PP The \fBXmTextField\fP action routines are .IP "activate():" 10 Calls the callbacks for \fBXmNactivateCallback\fP\&. If the parent is a manager, passes the event to the parent\&. .IP "backward-character(\fBextend\fP):" 10 Moves the insertion cursor one character to the left\&. This action may have different behavior in a right-to-left language environment\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The backward-character() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the backward-character() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "backward-word(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the first non-whitespace character after the first whitespace character to the left or after the beginning of the line\&. If the insertion cursor is already at the beginning of a word, moves the insertion cursor to the beginning of the previous word\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The backward-word() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the backward-word() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "beginning-of-line(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the beginning of the line\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The beginning-of-line() action produces calls to the \fBXmNmotionVerifyCallback\fP with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the beginning-of-line() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "clear-selection():" 10 Clears the current selection by replacing each character except \fB\fP with a \fB\fP character\&. .IP "" 10 The clear-selection() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "copy-clipboard():" 10 If this widget owns the primary selection, this action copies the selection to the clipboard\&. This action calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBCLIPBOARD\fP selection\&. .IP "copy-primary():" 10 Copies the primary selection to just before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmCOPY\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. .IP "" 10 In addition, the copy-primary() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. The copy-primary() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "copy-to():" 10 If a secondary selection exists, this action copies the secondary selection to the insertion position of the destination component\&. If the primary selection is in the destination widget, it will be deselected\&. Otherwise, there is no effect on the primary selection\&. .IP "" 10 This action calls the destination\&'s \fBXmNdestinationCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBXmCOPY\fP operation\&. The destination\&'s \fBXmNdestinationCallback\fP procedures or the destination component itself invokes the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBSECONDARY\fP selection\&. .IP "" 10 If no secondary selection exists, this action copies the primary selection to the pointer position\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmCOPY\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. .IP "" 10 In addition, the copy-to() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If there is no secondary selection, the copy-to() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "cut-clipboard():" 10 If this widget owns the primary selection, this action cuts the selection to the clipboard\&. This action calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBCLIPBOARD\fP selection\&. If the transfer is successful, this action then calls the \fBXmNconvertCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBDELETE\fP target\&. .IP "" 10 In addition, the cut-clipboard() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "cut-primary():" 10 Cuts the primary selection and pastes it just before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmMOVE\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. If the transfer is successful, this action then calls the selection owner\&'s \fBXmNconvertCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBDELETE\fP target\&. .IP "" 10 In addition, the cut-primary() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP, the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-next-character():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the character following the insertion cursor\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the character following the insertion cursor\&. This may impact the selection\&. .IP "" 10 The delete-next-character() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-next-word():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next space, tab or end-of-line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next space, tab or end-of-line character\&. This may impact the selection\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The delete-next-word() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-previous-character():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the character of text immediately preceding the insertion cursor\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the character of text immediately preceding the insertion cursor\&. This may impact the selection\&. .IP "" 10 The delete-previous-character() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "delete-previous-word():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the next space, tab or beginning-of-line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the next space, tab or beginning-of-line character\&. This may impact the selection\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The delete-previous-word() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "delete-selection():" 10 Deletes the current selection\&. .IP "" 10 The delete-selection() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "delete-to-end-of-line():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next end of line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next end of line character\&. This may impact the selection\&. .IP "" 10 The delete-to-end-of-line() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-to-start-of-line():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the previous beginning-of-line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the previous beginning-of-line character\&. This may impact the selection\&. .IP "" 10 The delete-to-start-of-line() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "deselect-all():" 10 Deselects the current selection\&. .IP "" 10 The deselect-all() action produces no callbacks\&. .IP "end-of-line(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the end of the line\&. If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The end-of-line() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the end-of-line() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "extend-adjust():" 10 Selects text from the anchor to the pointer position and deselects text outside that range\&. .IP "" 10 The extend-adjust() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. The extend-adjust() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "extend-end():" 10 Moves the insertion cursor to the position of the pointer\&. The extend-end() action is used to commit the selection\&. After this action has been done, process-cancel() will no longer cancel the selection\&. .IP "" 10 The extend-end() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. The extend-end() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "extend-start():" 10 Adjusts the anchor using the balance-beam method\&. Selects text from the anchor to the pointer position and deselects text outside that range\&. .IP "" 10 The extend-start() action can produce no callbacks, however, it may produce calls to the \fBXmNgainPrimaryCallback\fP and \fBXmNmotionVerifyCallback\fP procedures\&. See callback description for more information\&. .IP "forward-character(\fBextend\fP):" 10 Moves the insertion cursor one character to the right\&. This action may have different behavior in a right-to-left language environment\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The forward-character() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the forward-character() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "forward-word(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the first whitespace character or end-of-line following the next non-whitespace character\&. If the insertion cursor is already at the end of a word, moves the insertion cursor to the end of the next word\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The forward-word() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the forward-word() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "grab-focus():" 10 This key binding performs the action defined in the \fBXmNselectionArray\fP, depending on the number of multiple mouse clicks\&. The default selection array ordering is one click to move the insertion cursor to the pointer position, two clicks to select a word, and three clicks to select a line of text\&. A single click also deselects any selected text and sets the anchor at the pointer position\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The grab-focus() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "key-select(\fBright|left\fP):" 10 If called with an argument of \fIright\fP, moves the insertion cursor one character to the right and extends the current selection\&. If called with an argument of \fIleft\fP, moves the insertion cursor one character to the left and extends the current selection\&. If called with no argument, extends the current selection\&. .IP "" 10 Note that after a \fBkey-select\fP action, the selection will still begin at the original anchor, and will extend to the position indicated in the action call\&. If this new position is on the opposite side of the selection anchor from the previous selection boundary, the original selection will be deselected\&. .IP "" 10 The key-select() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. The key-select() action may also produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "link-primary():" 10 Places a link to the primary selection just before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmLINK\fP operation\&. The TextField widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the link to the primary selection and for taking any related actions\&. .IP "link-to():" 10 If a secondary selection exists, this action places a link to the secondary selection at the insertion position of the destination component\&. This action calls the destination\&'s \fBXmNdestinationCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBXmLINK\fP operation\&. .IP "" 10 If no secondary selection exists, this action places a link to the primary selection at the pointer position\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmLINK\fP operation\&. .IP "" 10 The TextField widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the link to the primary or secondary selection and for taking any related actions\&. .IP "move-destination():" 10 Moves the insertion cursor to the pointer position without changing any existing current selection\&. If there is a current selection, sets the widget as the destination widget\&. This also moves the widget focus to match the insertion cursor\&. .IP "" 10 The move-destination() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "move-to():" 10 If a secondary selection exists, this action moves the secondary selection to the insertion position of the destination component\&. If the secondary selection is in the destination widget, and the secondary selection and the primary selection overlap, the result is undefined\&. This action calls the destination\&'s \fBXmNdestinationCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBXmCOPY\fP operation\&. The destination\&'s \fBXmNdestinationCallback\fP procedures or the destination component itself invokes the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBSECONDARY\fP selection\&. If the transfer is successful, this action then calls the selection owner\&'s \fBXmNconvertCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBDELETE\fP target\&. .IP "" 10 If no secondary selection exists, this action moves the primary selection to the pointer position\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmMOVE\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. If the transfer is successful, this action then calls the selection owner\&'s \fBXmNconvertCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBDELETE\fP target\&. .IP "" 10 In addition, the move-to() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. This action may also produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. .IP "next-tab-group():" 10 Traverses to the next tab group\&. .IP "" 10 The next-tab-group() action produces no callbacks, unless it results in the widget losing focus, in which case, the \fBXmNlosingFocusCallback\fP procedures are called with reason value \fBXmCR_LOSING_FOCUS\fP\&. .IP "page-left():" 10 Scrolls the viewing window left one page of text\&. .IP "" 10 The page-left() action produces no callbacks\&. .IP "page-right():" 10 Scrolls the viewing window right one page of text\&. .IP "" 10 The page-right() action produces no callbacks\&. .IP "paste-clipboard():" 10 Pastes the contents of the clipboard before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBXmCOPY\fP operation\&. .IP "" 10 The paste-clipboard() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "prev-tab-group():" 10 Traverses to the previous tab group\&. .IP "" 10 The prev-tab-group() action produces no callbacks, unless it results in the widget losing focus, in which case, the \fBXmNlosingFocusCallback\fP procedures are called with reason value \fBXmCR_LOSING_FOCUS\fP\&. .IP "process-bdrag()" 10 If the pointer is within the selection, this action starts a drag operation for the selection\&. This action sets the \fBXmNconvertProc\fP of the DragContext to a function that calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fB_MOTIF_DROP\fP selection\&. .IP "" 10 If no selection exists or the pointer is outside the selection, this action prepares to start a secondary selection at the pointer position\&. .IP "process-cancel():" 10 Cancels the current extend-adjust(), secondary-adjust() or process-bdrag() operation and leaves the selection state as it was before the operation; otherwise, and if the parent is a manager, it passes the event to the parent\&. .IP "secondary-adjust():" 10 Extends the secondary selection to the pointer position\&. .IP "" 10 The secondary-adjust() action produces no callbacks\&. .IP "secondary-start():" 10 Marks the beginning of a secondary selection\&. .IP "" 10 The secondary-start() action produces no callbacks\&. .IP "select-all():" 10 Selects all text\&. .IP "" 10 The select-all() action can produce no callbacks, however, it may produce calls to the \fBXmNgainPrimaryCallback\fP and \fBXmNmotionVerifyCallback\fP procedures\&. See callback description for more information\&. .IP "self-insert():" 10 If \fBXmNpendingDelete\fP is True and the cursor is not disjoint from the current selection, deletes the entire selection\&. Inserts the character associated with the key pressed before the insertion cursor\&. .IP "" 10 The self-insert() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "set-anchor():" 10 Resets the anchor point for extended selections\&. Resets the destination of secondary selection actions\&. .IP "" 10 The set-anchor() action produces no callbacks\&. .IP "toggle-add-mode():" 10 Toggles the state of Add Mode\&. .IP "" 10 The toggle-add-mode() action produces no callbacks\&. .IP "toggle-overstrike():" 10 Toggles the state of the text insertion mode\&. By default, characters typed into the TextField widget are inserted before the position of the insertion cursor\&. In overstrike mode, characters entered into the TextField widget replace the characters that directly follow the insertion cursor\&. In overstrike mode, when the end of a line is reached, characters are appended to the end of the line\&. .IP "" 10 The following traversal actions generate no callbacks unless they result in the loss of focus by the widget in question, as when \fBXmNnavigationType\fP is \fBXmNONE\fP\&. In this case, they produce calls to the \fBXmNlosingFocusCallback\fP procedures, with reason value \fBXmCR_FOCUS_MOVED\fP\&. .IP "traverse-home():" 10 Traverses to the first widget in the tab group\&. .IP "traverse-next():" 10 Traverses to the next widget in the tab group\&. .IP "traverse-prev():" 10 Traverses to the previous widget in the tab group\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 Draws the insertion cursor as solid and starts blinking the cursor\&. .IP "\fB\fP:" 10 Displays the insertion cursor as a stippled I-beam unless it is the destination widget\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateTextField\fP(3), \fBXmFontList\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmPrimitive\fP(3), \fBXmTextFieldClearSelection\fP(3), \fBXmTextFieldCopy\fP(3), \fBXmTextFieldCopyLink\fP(3), \fBXmTextFieldCut\fP(3), \fBXmTextFieldGetBaseline\fP(3), \fBXmTextFieldGetEditable\fP(3), \fBXmTextFieldGetInsertionPosition\fP(3), \fBXmTextFieldGetLastPosition\fP(3), \fBXmTextFieldGetMaxLength\fP(3), \fBXmTextFieldGetSelection\fP(3), \fBXmTextFieldGetSelectionPosition\fP(3), \fBXmTextFieldGetSelectionWcs\fP(3), \fBXmTextFieldGetString\fP(3), \fBXmTextFieldGetStringWcs\fP(3), \fBXmTextFieldGetSubstring\fP(3), \fBXmTextFieldGetSubstringWcs\fP(3), \fBXmTextFieldInsert\fP(3), \fBXmTextFieldInsertWcs\fP(3), \fBXmTextFieldPaste\fP(3), \fBXmTextFieldPasteLink\fP(3), \fBXmTextFieldPosToXY\fP(3), \fBXmTextFieldRemove\fP(3), \fBXmTextFieldReplace\fP(3), \fBXmTextFieldReplaceWcs\fP(3), \fBXmTextFieldSetAddMode\fP(3), \fBXmTextFieldSetEditable\fP(3), \fBXmTextFieldSetHighlight\fP(3), \fBXmTextFieldSetInsertionPosition\fP(3), \fBXmTextFieldSetMaxLength\fP(3), \fBXmTextFieldSetSelection\fP(3), \fBXmTextFieldSetString\fP(3), \fBXmTextFieldSetStringWcs\fP(3), \fBXmTextFieldShowPosition\fP(3), \fBXmTextFieldXYToPos\fP(3), \fBXmVaCreateTextField\fP(3), and \fBXmVaCreateManagedTextField\fP(3)\&. motif-2.3.8/doc/man/man3/XmUninstallImage.30000644000175000017500000000305012672140200015236 00000000000000'\" t ...\" Uninstal.sgm /main/7 1996/08/30 16:33:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmUninstallImage" "library call" .SH "NAME" \fBXmUninstallImage\fP \(em A pixmap caching function that removes an image from the image cache .iX "XmUninstallImage" .iX "pixmaps" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmUninstallImage\fP\fR( \fBXImage \fB* image\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmUninstallImage\fP removes an image from the image cache\&. .IP "\fIimage\fP" 10 Points to the image structure given to the XmInstallImage() routine .SH "RETURN" .PP Returns True when successful; returns False if the \fIimage\fP is NULL, or if it cannot be found to be uninstalled\&. .SH "RELATED" .PP \fBXmInstallImage\fP(3), \fBXmGetPixmap\fP(3), and \fBXmDestroyPixmap\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmListDeleteAllItems.30000644000175000017500000000273212672140200016021 00000000000000'\" t ...\" LstDeleA.sgm /main/7 1996/08/30 15:39:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeleteAllItems" "library call" .SH "NAME" \fBXmListDeleteAllItems\fP \(em A List function that deletes all items from the list .iX "XmListDeleteAllItems" .iX "List functions" "XmListDeleteAllItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeleteAllItems\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeleteAllItems\fP deletes all items from the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List from whose list the items are deleted .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmListReplaceItemsPos.30000644000175000017500000000522112672140200016217 00000000000000'\" t ...\" LstReplB.sgm /main/8 1996/09/08 20:51:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListReplaceItemsPos" "library call" .SH "NAME" \fBXmListReplaceItemsPos\fP \(em A List function that replaces the specified elements in the list .iX "XmListReplaceItemsPos" .iX "List functions" "XmListReplaceItemsPos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListReplaceItemsPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString *\fBnew_items\fR\fR, \fBint \fBitem_count\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListReplaceItemsPos\fP replaces the specified number of items of the List with new items, starting at the specified position in the List\&. When the items are inserted into the list, they are compared with the current \fBXmNselectedItems\fP list\&. If any of the new items matches an item on the selected list, it appears selected\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fInew_items\fP" 10 Specifies the replacement items\&. .IP "\fIitem_count\fP" 10 Specifies the number of items in \fInew_items\fP and the number of items in the list to replace\&. This number must be nonnegative\&. .IP "\fIposition\fP" 10 Specifies the position of the first item in the list to be replaced\&. A value of 1 indicates that the first item replaced is the first item in the list; a value of 2 indicates that it is the second item; and so on\&. .IP "" 10 Beginning with the item specified in \fIposition\fP, \fIitem_count\fP items in the list are replaced with the corresponding elements from \fInew_items\fP\&. That is, the item at \fIposition\fP is replaced with the first element of \fInew_items\fP; the item after \fIposition\fP is replaced with the second element of \fInew_items\fP; and so on, until \fIitem_count\fP is reached\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmScreen.30000644000175000017500000004236412672140200013554 00000000000000'\" t ...\" Screen.sgm /main/11 1996/09/08 21:00:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScreen" "library call" .SH "NAME" \fBXmScreen\fP \(em The Screen widget class .iX "XmScreen" .iX "widget class" "XmScreen" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The XmScreen object is used by Motif widgets to store information that is specific to a screen\&. It also allows the toolkit to store certain information on widget hierarchies that would otherwise be unavailable\&. Each client has one XmScreen object for each screen that it accesses\&. .PP An XmScreen object is automatically created when the application creates the first shell on a screen (usually accomplished by a call to \fBXtAppInitialize\fP or \fBXtAppCreateShell\fP)\&. It is not necessary to create an XmScreen object by any other means\&. An application can use the function \fBXmGetXmScreen\fP to obtain the widget ID of the XmScreen object for a given screen\&. .PP An application cannot supply initial values for XmScreen resources as arguments to a call to any function that creates widgets\&. The application or user can supply initial values in a resource file\&. After creating the first shell on the screen, the application can use \fBXmGetXmScreen\fP to obtain the widget ID of the XmScreen object and then call \fBXtSetValues\fP to set the XmScreen resources\&. .SS "Classes" .PP Screen inherits behavior and resources from \fBCore\fP\&. .PP The class pointer is \fBxmScreenClass\fP\&. .PP The class name is \fBXmScreen\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in an \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in an \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmScreen Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbitmapConversionModelXmCBitmapConversionModelXtEnumXmPIXMAPCSG?? _____ XmNcolorAllocationProcXmCColorAllocationProcXtProcNULLCSG?? _____ XmNcolorCalculationProcXmCColorCalculationProcXtProcNULLCSG?? _____ XmNdarkThresholdXmCDarkThresholdintdynamicC _____ XmNdefaultCopyCursorIconXmCDefaultCopyCursorIconWidgetNULLCSG _____ XmNdefaultInvalidCursorIconXmCDefaultInvalidCursorIconWidgetNULLCSG _____ XmNdefaultLinkCursorIconXmCDefaultLinkCursorIconWidgetNULLCSG _____ XmNdefaultMoveCursorIconXmCDefaultMoveCursorIconWidgetNULLCSG _____ XmNdefaultNoneCursorIconXmCDefaultNoneCursorIconWidgetNULLCSG _____ XmNdefaultSourceCursorIconXmCDefaultSourceCursorIconWidgetNULLCSG _____ XmNdefaultValidCursorIconXmCDefaultValidCursorIconWidgetNULLCSG _____ XmNfontXmCFontXFontStruct *NULLCSG _____ XmNforegroundThresholdXmCForegroundThresholdintdynamicC _____ XmNhorizontalFontUnitXmCHorizontalFontUnitintdynamicCSG _____ XmNinsensitiveStippleBitmapXmCinsensitiveStippleBitmapBitmap"50_foreground"CSG _____ XmNlightThresholdXmCLightThresholdintdynamicC _____ XmNmenuCursorXmCCursorCursorarrowC _____ XmNmoveOpaqueXmCMoveOpaqueBooleanFalseCSG _____ XmNunpostBehaviorXmCUnpostBehaviorunsigned charXmUNPOST_AND_REPLAYCSG _____ XmNuseColorObjectXmCUseColorObjectBooleanFalseC _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ XmNverticalFontUnitXmCVerticalFontUnitintdynamicCSG _____ .TE .IP "\fBXmNbitmapConversionModel\fP" 10 Provides a policy for the conversion of xbm and xpm files to the \fBPixmap\fP type\&. This resource takes the following values: .RS .IP "\fBXmMATCH_DEPTH\fP" 10 From a supplied xbm or xpm file, generates a converted pixmap file having the same depth as the widget\&. .IP "\fBXmDYNAMIC_DEPTH\fP" 10 Converts an input xbm file to a \fBPixmap\fP of depth 1, or converts an input xpm file to a \fBPixmap\fP having the same depth as the widget\&. .RE .IP "\fBXmNcolorAllocationProc\fP" 10 Identifies the procedure to be used for color allocation\&. Normally, this procedure is an application-defined color allocation procedure\&. However, if no application-defined color allocation procedure is set, the system uses Motif\&'s predefined color allocation procedure\&. .IP "\fBXmNcolorCalculationProc\fP" 10 Identifies the procedure to be used for per-widget color calculation\&. Normally, this procedure is an application-defined color calculation procedure\&. However, if no application-defined color calculation procedure is set, the system uses Motif\&'s predefined color calculation procedure\&. .IP "\fBXmNdarkThreshold\fP" 10 An integer between 0 (zero) and 100, inclusive, that specifies a level of perceived brightness for a color\&. If the perceived brightness of the background color is below this level, Motif treats the background as "dark" when computing default shadow and select colors\&. If this resource is specified for a particular screen, it applies to widgets created on that screen; otherwise it applies to widgets created on all screens\&. The default value is implementation specific\&. .IP "\fBXmNdefaultCopyCursorIcon\fP" 10 Specifies the DragIcon used during a drag operation when the operation is a copy and no other pixmap is specified by the application\&. If this resource is NULL, a system default icon is used\&. The system default icon is determined by the Display resource \fBXmNenableDragIcon\fP\&. .IP "\fBXmNdefaultInvalidCursorIcon\fP" 10 Specifies the DragIcon used to indicate that the cursor is over an invalid drop site during a drag operation when no other pixmap symbol is specified by the application\&. If this resource is NULL, a system default icon is used\&. The system default icon is determined by the Display resource \fBXmNenableDragIcon\fP\&. .IP "\fBXmNdefaultLinkCursorIcon\fP" 10 Specifies the DragIcon used during a drag operation when the operation is a link and no other pixmap is specified by the application\&. If this resource is NULL, a system default icon is used\&. The system default icon is determined by the Display resource \fBXmNenableDragIcon\fP\&. .IP "\fBXmNdefaultMoveCursorIcon\fP" 10 Specifies the DragIcon used during a drag operation when the operation is a move and no other pixmap is specified by the application\&. If this resource is NULL, a system default icon is used\&. The system default icon is determined by the Display resource \fBXmNenableDragIcon\fP\&. .IP "\fBXmNdefaultNoneCursorIcon\fP" 10 Specifies the DragIcon used to indicate that the cursor is not over a drop site during a drag operation when no other pixmap is specified by the application\&. If this resource is NULL, a system default icon is used\&. The system default icon is determined by the Display resource \fBXmNenableDragIcon\fP\&. .IP "\fBXmNdefaultSourceCursorIcon\fP" 10 Specifies the depth-1 pixmap used as a cursor when an \fBXmNsourceCursorIcon\fP is not provided by the DragContext, or it is not usable\&. If this resource is NULL, a system default icon is used\&. The system default icon is determined by the Display resource \fBXmNenableDragIcon\fP\&. .IP "\fBXmNdefaultValidCursorIcon\fP" 10 Specifies the DragIcon used to indicate that the cursor is over a valid drop site during a drag operation when no other pixmap is specified by the application\&. If this resource is NULL, a system default icon is used\&. The system default icon is determined by the Display resource \fBXmNenableDragIcon\fP\&. .IP "\fBXmNfont\fP" 10 Specifies a font for use in computing values for \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. When an application is initialized, this resource can be supplied in a resource file or through the standard command line options \fB-fn\fP, \fB-font\fP, and \fB-xrm\fP\&. Note that this resource is used only for the calculation of the font unit values\&. To specify a font to be used to display text, use a widget\&'s render table resource (\fBXmNrenderTable\fP)\&. .IP "\fBXmNforegroundThreshold\fP" 10 An integer between 0 (zero) and 100, inclusive, that specifies a level of perceived brightness for a color\&. If the perceived brightness of the background color is equal to or below this level, Motif treats the background as "dark" when computing the default foreground and highlight colors\&. If the perceived brightness of the background color is above this level, Motif treats the background as "light" when computing the default foreground and highlight colors\&. When the background is "dark," the default foreground and highlight is white; when the background is "light," the default foreground and highlight is black\&. If this resource is specified for a particular screen, it applies to widgets created on that screen; otherwise, it applies to widgets created on all screens\&. The default value is implementation specific\&. .IP "\fBXmNhorizontalFontUnit\fP" 10 Specifies the horizontal component of the font units used by \fBXmConvertUnits\fP, and is used to interpret the values of geometry resources when the \fBXmNshellUnitType\fP resource of VendorShell or the \fBXmNunitType\fP resource of Gadget, Manager, or Primitive has the value \fBXm100TH_FONT_UNITS\fP\&. If no initial value is supplied for this resource, the default is computed from the font specified in \fBXmNfont\fP\&. If no initial value is supplied for this resource or for \fBXmNfont\fP, the default is 10\&. .IP "" 10 If a call to \fBXtSetValues\fP specifies a value for \fBXmNhorizontalFontUnit\fP, this resource is set to that value\&. If a call to \fBXtSetValues\fP specifies a value for \fBXmNfont\fP but not for \fBXmNhorizontalFontUnit\fP, this resource is set to a value computed from the new \fBXmNfont\fP\&. .IP "" 10 A horizontal font unit is derived from a font as follows: .RS .IP " \(bu" 6 If the font has an \fBAVERAGE_WIDTH\fP property, the horizontal font unit is the \fBAVERAGE_WIDTH\fP property divided by 10\&. .IP " \(bu" 6 If the font has no \fBAVERAGE_WIDTH\fP property but has a \fBQUAD_WIDTH\fP property, the horizontal font unit is the \fBQUAD_WIDTH\fP property\&. .IP " \(bu" 6 If the font has no \fBAVERAGE_WIDTH\fP or \fBQUAD_WIDTH\fP property, the horizontal font unit is the sum of the font structure\&'s \fImin_bounds\&.width\fP and \fImax_bounds\&.width\fP divided by 2\&.3\&. .RE .IP "\fBXmNinsensitiveStippleBitmap\fP" 10 Provides widgets with the bitmap to use when generating the insensitive visual\&. This bitmap is to be used as the stipple for the rendering of insensitive visuals\&. .IP "\fBXmNlightThreshold\fP" 10 An integer between 0 (zero) and 100, inclusive, that specifies a level of perceived brightness for a color\&. If the perceived brightness of the background color is above this level, Motif treats the background as "light" when computing default shadow and select colors\&. If this resource is specified for a particular screen, it applies to widgets created on that screen; otherwise, it applies to widgets created on all screens\&. The default value is implementation specific\&. .IP "\fBXmNmenuCursor\fP" 10 Sets a variable that controls the cursor used whenever this application posts a menu\&. This resource can be specified only once at application startup time, either by placing it within a defaults file or by using the \fB-xrm\fP command line argument\&. For example: .IP "" 10 \fBmyProg -xrm "*menuCursor: arrow"\fP .IP "" 10 The menu cursor can also be selected in the program through the function \fBXmSetMenuCursor\fP\&. The following list shows acceptable cursor names\&. If the application does not specify a cursor or if an invalid name is supplied, the default cursor (an arrow pointing up and to the right) is used\&. .RS .IP "\fBX_cursor\fP" 10 \fIleftbutton\fP .IP "\fIarrow\fP" 10 \fBll_angle\fP .IP "\fBbased_arrow_down\fP" 10 \fBlr_angle\fP .IP "\fBbased_arrow_up\fP" 10 \fIman\fP .IP "\fIboat\fP" 10 \fImiddlebutton\fP .IP "\fIbogosity\fP" 10 \fImouse\fP .IP "\fBbottom_left_corner\fP" 10 \fIpencil\fP .IP "\fBbottom_right_corner\fP" 10 \fIpirate\fP .IP "\fBbottom_side\fP" 10 \fIplus\fP .IP "\fBbottom_tee\fP" 10 \fBquestion_arrow\fP .IP "\fBbox_spiral\fP" 10 \fBright_ptr\fP .IP "\fBcenter_ptr\fP" 10 \fBright_side\fP .IP "\fIcircle\fP" 10 \fBright_tee\fP .IP "\fIclock\fP" 10 \fIrightbutton\fP .IP "\fBcoffee_mug\fP" 10 \fBrtl_logo\fP .IP "\fIcross\fP" 10 \fIsailboat\fP .IP "\fBcross_reverse\fP" 10 \fBsb_down_arrow\fP .IP "\fIcrosshair\fP" 10 \fBsb_h_double_arrow\fP .IP "\fBdiamond_cross\fP" 10 \fBsb_left_arrow\fP .IP "\fIdot\fP" 10 \fBsb_right_arrow\fP .IP "\fIdotbox\fP" 10 \fBsb_up_arrow\fP .IP "\fBdouble_arrow\fP" 10 \fBsb_v_double_arrow\fP .IP "\fBdraft_large\fP" 10 \fIshuttle\fP .IP "\fBdraft_small\fP" 10 \fIsizing\fP .IP "\fBdraped_box\fP" 10 \fIspider\fP .IP "\fIexchange\fP" 10 \fIspraycan\fP .IP "\fIfleur\fP" 10 \fIstar\fP .IP "\fIgobbler\fP" 10 \fItarget\fP .IP "\fIgumby\fP" 10 \fItcross\fP .IP "\fBhand1\fP" 10 \fBtop_left_arrow\fP .IP "\fBhand2\fP" 10 \fBtop_left_corner\fP .IP "\fIheart\fP" 10 \fBtop_right_corner\fP .IP "\fIicon\fP" 10 \fBtop_side\fP .IP "\fBiron_cross\fP" 10 \fBleft_ptr\fP .IP "\fBleft_side\fP" 10 \fBtop_tee\fP .IP "\fBleft_tee\fP" 10 \fItrek\fP .IP "\fBul_angle\fP" 10 \fIumbrella\fP .IP "\fBur_angle\fP" 10 \fIwatch\fP .IP "\fBxterm\fP" 10 .RE .IP "\fBXmNmoveOpaque\fP" 10 Specifies whether an interactive operation that moves a window, such as tearing off and dragging a tear-off menu or moving a window in MWM, displays an outline of the window or a representation of the window itself during the move\&. If the value is True, the operation displays a representation of the window during the move\&. If the value is False, the operation displays an outline of the window\&. .IP "\fBXmNunpostBehavior\fP" 10 Specifies the behavior of an active menu posted in traversal mode when a subsequent menu button selection is made outside the posted menu\&. When the value is \fBXmUNPOST_AND_REPLAY\fP, the resource unposts the menu hierarchy and causes the server to replay the event to the window in which the pointer is located\&. When the value is \fBXmUNPOST\fP, the resource unposts the hierarchy without replaying the event\&. .IP "\fBXmNuseColorObject\fP" 10 Enables and disables the sharing of colors between widgets, and the dynamic changing of colors\&. A value of False disables this, and a value of True enables it\&. .IP "\fBXmNuserData\fP" 10 Allows the application to attach any necessary specific data to the widget\&. This is an internally unused resource\&. .IP "\fBXmNverticalFontUnit\fP" 10 Specifies the vertical component of the font units used by \fBXmConvertUnits\fP and used to interpret the values of geometry resources when the \fBXmNshellUnitType\fP resource of VendorShell or the \fBXmNunitType\fP resource of Gadget, Manager, or Primitive has the value \fBXm100TH_FONT_UNITS\fP\&. If no initial value is supplied for this resource, the default is computed from the font specified in \fBXmNfont\fP\&. If no initial value is supplied for this resource or for \fBXmNfont\fP, the default is 10\&. .IP "" 10 If a call to \fBXtSetValues\fP specifies a value for \fBXmNverticalFontUnit\fP, this resource is set to that value\&. If a call to \fBXtSetValues\fP specifies a value for \fBXmNfont\fP but not for \fBXmNverticalFontUnit\fP, this resource is set to a value computed from the new \fBXmNfont\fP\&. .IP "" 10 A vertical font unit is derived from a font as follows: .RS .IP " \(bu" 6 If the font has a \fBPIXEL_SIZE\fP property, the vertical font unit is the \fBPIXEL_SIZE\fP property divided by 1\&.8\&. .IP " \(bu" 6 If the font has no \fBPIXEL_SIZE\fP property but has \fBPOINT_SIZE\fP and \fBRESOLUTION_Y\fP properties, the vertical font unit is the product of the \fBPOINT_SIZE\fP and \fBRESOLUTION_Y\fP properties divided by 1400\&. .IP " \(bu" 6 If the font has no \fBPIXEL_SIZE\fP, \fBPOINT_SIZE\fP, or \fBRESOLUTION_Y\fP properties, the vertical font unit is the sum of the font structure\&'s \fImax_bounds\&.ascent\fP and \fImax_bounds\&.descent\fP divided by 2\&.2\&. .RE .SS "Inherited Resources" .PP All of the superclass resources inherited by \fBXmScreen\fP are designated N/A (not applicable)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmDisplay\fP(3), \fBXmGetXmScreen\fP(3), and \fBXmSetMenuCursor\fP(3), ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmVaCreateManagedList.30000644000175000017500000000003212672140200016122 00000000000000.so man3/XmVaCreateList.3 motif-2.3.8/doc/man/man3/XmVaCreateManagedSpinBox.30000644000175000017500000000003512672140200016574 00000000000000.so man3/XmVaCreateSpinBox.3 motif-2.3.8/doc/man/man3/XmScrollBarSetValues.30000644000175000017500000000634012672140200016046 00000000000000'\" t ...\" ScrollBC.sgm /main/9 1996/09/08 21:01:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScrollBarSetValues" "library call" .SH "NAME" \fBXmScrollBarSetValues\fP \(em A ScrollBar function that changes ScrollBar\&'s increment values and the slider\&'s size and position .iX "XmScrollBarSetValues" .iX "ScrollBar functions" "XmScrollBarSetValues" .SH "SYNOPSIS" .PP .nf #include void XmScrollBarSetValues (\fIwidget, value, slider_size, increment, page_increment, notify\fP) Widget \fIwidget\fP; int \fIvalue\fP; int \fIslider_size\fP; int \fIincrement\fP; int \fIpage_increment\fP; Boolean \fInotify\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmSetScrollBarValues\fP changes the ScrollBar\&'s increment values and the slider\&'s size and position\&. The scroll region is overlaid with a slider bar that is adjusted in size and position using the main ScrollBar or set slider function attributes\&. .IP "\fIwidget\fP" 10 Specifies the ScrollBar widget ID\&. .IP "\fIvalue\fP" 10 Specifies the ScrollBar\&'s slider position\&. Refer to the \fBXmNvalue\fP resource described on \fBXmScrollBar\fP(3)\&. .IP "\fIslider_size\fP" 10 Specifies the size of the slider\&. Refer to the \fBXmNsliderSize\fP resource described on \fBXmScrollBar\fP(3)\&. This argument sets that resource\&. Specify a value of 0 (zero) if you do not want to change the value\&. .IP "\fIincrement\fP" 10 Specifies the amount of button increment and decrement\&. Refer to the \fBXmNincrement\fP resource described on \fBXmScrollBar\fP(3)\&. This argument sets that resource\&. Specify a value of 0 (zero) if you do not want to change the value\&. .IP "\fIpage_increment\fP" 10 Specifies the amount of page increment and decrement\&. Refer to the \fBXmNpageIncrement\fP resource described on \fBXmScrollBar\fP(3)\&. This argument sets that resource\&. Specify a value of 0 (zero) if you do not want to change the value\&. .IP "\fInotify\fP" 10 Specifies a Boolean value that, when True, indicates a change in the ScrollBar value and also specifies that the ScrollBar widget automatically activates the \fBXmNvalueChangedCallback\fP with the recent change\&. If it is set to False, it specifies any change that has occurred in the ScrollBar\&'s value, but does not activate \fBXmNvalueChangedCallback\fP\&. .PP For a complete definition of ScrollBar and its associated resources, see \fBXmScrollBar\fP(3)\&. .SH "RELATED" .PP \fBXmScrollBar\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmStringConcat.30000644000175000017500000000355712672140200014734 00000000000000'\" t ...\" StrCoD.sgm /main/8 1996/09/08 21:03:29 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringConcat" "library call" .SH "NAME" \fBXmStringConcat\fP \(em A compound string function that appends one string to another .iX "XmStringConcat" .iX "compound string functions" "XmStringConcat" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringConcat\fP\fR( \fBXmString \fBs1\fR\fR, \fBXmString \fBs2\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringConcat\fP copies \fIs2\fP to the end of \fIs1\fP and returns a copy of the resulting compound string\&. The original strings are preserved\&. The function will allocate space to hold the returned compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fIs1\fP" 10 Specifies the compound string to which a copy of \fIs2\fP is appended .IP "\fIs2\fP" 10 Specifies the compound string that is appended to the end of \fIs1\fP .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmVaCreatePushButton.30000644000175000017500000000274112672140200016056 00000000000000.DT .TH "XmVaCreatePushButton" "library call" .SH "NAME" \fBXmVaCreatePushButton\fP, \fBXmVaCreateManagedPushButton\fP \(em A PushButton widget convenience creation functions\&. .iX "XmVaCreateTogglePushButton" "XmVaCreateManagedPushButton" .iX "creation functions" "XmVaCreatePushButton" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreatePushButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedPushButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreatePushButton\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreatePushButton\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of PushButton and its associated resources, see \fBXmPushButton\fP(3)\&. .SH "RETURN" .PP Returns the PushButton widget ID\&. .SH "RELATED" .PP \fBXmPushButton\fP(3), \fBXmCreatePushButton\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextGetLastPosition.30000644000175000017500000000357712672140200016275 00000000000000'\" t ...\" TxtGetLa.sgm /main/8 1996/09/08 21:16:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetLastPosition" "library call" .SH "NAME" \fBXmTextGetLastPosition\fP \(em A Text function that accesses the last position in the text .iX "XmTextGetLastPosition" .iX "Text functions" "XmTextGetLastPosition" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmTextGetLastPosition\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetLastPosition\fP accesses the last position in the text buffer of the Text widget\&. This is an integer number of characters from the beginning of the buffer, and represents the position that text added to the end of the buffer is placed after\&. The first character position is 0 (zero)\&. The last character position is equal to the number of characters in the text buffer\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns an \fBXmTextPosition\fR value that indicates the last position in the text buffer\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmComboBoxSelectItem.30000644000175000017500000000341012672140200016011 00000000000000'\" t ...\" ComboSel.sgm /main/5 1996/08/30 14:17:37 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmComboBoxSelectItem" "library call" .SH "NAME" \fBXmComboBoxSelectItem\fP \(em select a XmComboBox item .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmComboBoxSelectItem\fP\fR( \fBWidget \fBw\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmComboBoxSelectItem\fP function selects an item in the XmList of the XmComboBox widget\&. .PP The \fIw\fP argument specifies the XmComboBox widget ID\&. .PP The \fIitem\fP argument specifies the \fBXmString\fR of the item to be selected\&. If the \fIitem\fP is not found on the list, \fBXmComboBoxSelectItem\fP notifies the user via the \fBXtWarning\fP function\&. .SH "RETURN VALUE" .PP The \fBXmComboBoxSelectItem\fP function returns no value\&. .SH "SEE ALSO" .PP \fBXmComboBoxAddItem\fP(3), \fBXmComboBoxDeletePos\fP(3), \fBXmComboBoxSetItem\fP(3); \fBXtWarning\fP(3)\&. in the CAE Specification, Window Management: X Toolkit Intrinsics\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTransferSendRequest.30000644000175000017500000000333612672140200016300 00000000000000'\" t ...\" TransfB.sgm /main/10 1996/09/08 21:11:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTransferSendRequest" "library call" .SH "NAME" \fBXmTransferSendRequest\fP \(em A toolkit function that transfers a MULTIPLE request .iX "XmTransferSendRequest" .iX "toolkit functions" "XmTransferSendRequest" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBXmTransferSendRequest\fP\fR( \fBXtPointer \fBtransfer_id\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTransferSendRequest\fP marks the end of a MULTIPLE request started by \fBXmTransferStartRequest\fP\&. .IP "\fBtransfer_id\fP" 10 Specifies a unique indentifier for the data transfer operation\&. .IP "\fItime\fP" 10 Specifies the time of the \fBXEvent\fP that triggered the data transfer\&. You should typically set this field to \fBXtLastTimestampProcessed\fP\&. .SH "RELATED" .PP \fBXmTransferSetParameters\fP(3), \fBXmTransferStartRequest\fP(3), and \fBXmTransferValue\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmIconGadget.30000644000175000017500000002727112672140200014341 00000000000000'\" t ...\" IconGadg.sgm /main/13 1996/09/08 20:47:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmIconGadget" "library call" .SH "NAME" \fBXmIconGadget\fR \(em The IconGadget widget class .iX "XmIconGadget" .iX "iconGadget" "IconGadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP IconGadget is an instantiable widget used to display both text and a pixmap in various combinations\&. Other widgets that hold the \fBXmQTcontainer\fP trait, such as Container, can use IconGadget to represent objects\&. .PP IconGadget text is a compound string\&. If no text is supplied, then the compound string is generated from the gadget name\&. IconGadget text is placed relative to the type of associated pixmap\&. .PP Depending upon the \fBXmNviewType\fP resource, IconGadget can display two views: .IP "\fBXmLARGE_ICON\fP" 10 The IconGadget text string is displayed below the pixmap, and centered\&. .IP "\fBXmSMALL_ICON\fP" 10 The IconGadget text string is placed on the side of the small icon, in the widget\&'s \fBXmNlayoutDirection\fP\&. .PP A bitmap mask can be supplied for each pixmap to clip the pixmap into some shape other than a rectangle\&. The \fBXmNlargeIconMask\fP and \fBXmNsmallIconMask\fP resources specify the large and small bitmap masks respectively\&. Visual emphasis for the IconGadget is provided with the \fBXmNvisualEmphasis\fP resource\&. IconGadget\&'s \fBXmNdetail\fP and \fBXmNdetailCount\fP resources provide a detail view for IconGadgets, enabling the display of Strings alongside the IconGadget\&. The exact layout ordering of the strings depends on the associated containing widget\&. .PP IconGadget uses the \fBXmQTcontainer\fP and \fBXmQTspecifyRenderTable\fP traits, and holds the \fBXmQTcareParentVisual\fP and \fBXmQTcontainerItem\fP traits\&. .SS "Classes" .PP IconGadget inherits behaviour, resources, and traits from \fBObject, RectObject\fP, and \fBXmGadget\fP classes\&. .PP The class pointer is \fBxmIconGadgetClass\fP\&. .PP The class name is \fBXmIconGadget\fR\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate whether the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .TS tab() box; c s s s s l| l| l| l| l. \fBXmIconGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmalignmentXmCAlignmentunsigned charXmALIGNMENT_CENTERCSG _____ XmNdetailXmCDetailXmStringTableNULLCSG _____ XmNdetailCountXmCDetailCountCardinal0CSG _____ XmNfontListXmCFontListXmFontListNULLCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlargeIconMaskXmCIconMaskPixmapdynamicCSG _____ XmNlargeIconPixmapXmCIconPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNsmallIconMaskXmCIconMaskPixmapdynamicCSG _____ XmNsmallIconPixmapXmCIconPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNviewTypeXmCViewTypeunsigned charXmLARGE_ICONCSG _____ XmNvisualEmphasisXmCVisualEmphasisunsigned charXmNOT_SELECTEDCSG _____ XmNspacingXmCSpacingDimension4CSG _____ .TE .IP "\fBXmNalignment\fP" 10 Specifies the horizontal alignment of the pixmap with respect to the label when the icon is in \fBLARGE_ICON\fP view\&. Valid values are \fBXmALIGNMENT_BEGINNING\fP, \fBXmALIGNMENT_CENTER\fP, and \fBXmALIGNMENT_END\fP\&. .IP "\fBXmNdetail\fP" 10 Specifies an array of \fBXmString\fRs that are the detail information associated with the gadget\&. .IP "\fBXmNdetailCount\fP" 10 Specifies the size of the \fBXmNdetail\fP array\&. .IP "\fBXmNfontList\fP" 10 Specifies the font list associated with \fBXmIconGadget\fR\&. The font list is an obsolete construct, and has been superseded by the render table\&. It is included for compatibility with earlier versions of Motif, and for applications that do not easily support render tables\&. The default font list is derived from the default render table, and if both a font list and a render table are specified, the render table takes precedence\&. .IP "\fBXmNlabelString\fP" 10 Specifies the compound string\&. If this value is NULL, it is initialized by converting the name of the gadget to a compound string\&. Refer to \fBXmString\fP(3) for more information on the creation and structure of compound strings\&. .IP "\fBXmNlargeIconMask\fP" 10 Specifies the icon mask used when \fBXmNviewType\fP is \fBXmLARGE_ICON\fP\&. .IP "\fBXmNlargeIconPixmap\fP" 10 Specifies the pixmap when \fBXmNviewType\fP is \fBXmLARGE_ICON\fP\&. If this resource\&'s value is \fBXmUNSPECIFIED_PIXMAP\fP, there is no pixmap\&. If a large icon pixmap is specified, and if during conversion an associated mask can be fetched, then the \fBXmNlargeIconMask\fP resource is set to that mask\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the amount of vertical space between the highlight and the inside (pixmap and label)\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the amount of horizontal space between the highlight and the inside (pixmap and label)\&. .IP "\fBXmNrenderTable\fP" 10 Specifies the \fBXmRenderTable\fR of the text used in the gadget\&. If \fBXmNrenderTable\fP is NULL when the IconGadget is created, the parent\&'s render table resource value is used if there is a render table\&. If the parent does not have a render table, the parent hierarchy of the widget is searched for a widget that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the render table is initialized to the \fBXmLABEL_RENDER_TABLE\fP value of the ancestor widget\&. If no such widget is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a \fBXmRenderTable\fR\&. If both a render table and a font list are specified, the render table will take precedence\&. .IP "\fBXmNsmallIconMask\fP" 10 Specifies the icon mask used when \fBXmNviewType\fP is \fBXmSMALL_ICON\fP\&. .IP "\fBXmNsmallIconPixmap\fP" 10 Specifies the pixmap when \fBXmNviewType\fP is \fBXmSMALL_ICON\fP\&. If this resource\&'s value is \fBXmUNSPECIFIED_PIXMAP\fP, there is no pixmap\&. If a small icon pixmap is specified, and if during conversion an associated mask can be fetched, then the \fBXmNsmallIconMask\fP resource is set to that mask\&. .IP "\fBXmNspacing\fP" 10 Specifies the amount of space between the pixmap and the label parts of the icon\&. .IP "\fBXmNviewType\fP" 10 Specifies the view (combination of pixmaps/text) that will be displayed\&. If the IconGadget is a child of a Container widget, however, then the specification of this resource will be taken from the Container\(em if Container\&'s \fBXmNentryViewType\fP is either \fBXmLARGE_ICON\fP or \fBXmSMALL_ICON\fP, then IconGadget\&'s \fBXmNviewType\fP takes that value; otherwise, the default is \fBXmLARGE_ICON\fP\&. This resource is set to one of the following: .RS .IP "\fBXmLARGE_ICON\fP" 10 The pixmap specified by \fBXmNlargeIconPixmap\fP is displayed with the \fBXmNlabelString\fP beneath it\&. .IP "\fBXmSMALL_ICON\fP" 10 The pixmap specified by \fBXmNsmallIconPixmap\fP is displayed with the \fBXmNlabelString\fP displayed in the direction of the \fBXmNlayoutDirection\fP resource\&. .RE .IP "\fBXmNvisualEmphasis\fP" 10 Specifies the visual state of the IconGadget\&. If the IconGadget is in a selected state all visuals are displayed using the Container \fBXmNselectColor\fP resource\&. It is set to one of the following: .RS .IP "\fBXmSELECTED\fP" 10 The IconGadget is in the selected state and displays the appropriate visuals\&. .IP "\fBXmNOT_SELECTED\fP" 10 The IconGadget is not in the selected state\&. .RE .SS "Inherited Resources" .PP IconGadget inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension0CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanFalseCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Additional Behavior" .PP IconGadget has no behavior\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SS "Errors/Warnings" .PP The toolkit will display a warning if an incorrect value is given for an enumeration resource\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmContainer\fP(3), \fBXmCreateIconGadget\fP(3), \fBXmGadget\fP(3), \fBXmVaCreateIconGadget\fP(3), and \fBXmVaCreateManagedIconGadget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateWorkArea.30000644000175000017500000000406612672140200015171 00000000000000'\" t ...\" CreWoA.sgm /main/7 1996/08/30 14:58:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateWorkArea" "library call" .SH "NAME" \fBXmCreateWorkArea\fP \(em A function that creates a RowColumn WorkArea .iX "XmCreateWorkArea" .iX "creation functions" "XmCreateWorkArea" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateWorkArea\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateWorkArea\fP creates an instance of a RowColumn widget and returns the associated widget ID\&. The widget is created with \fBXmNrowColumnType\fP set to \fBXmWORK_AREA\fP\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateRadioBox\fP(3), \fBXmCreateSimpleCheckBox\fP(3), \fBXmCreateSimpleRadioBox\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreateSimpleCheckBox\fP(3), and \fBXmVaCreateSimpleRadioBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/MrmRegisterNamesInHierarchy.30000644000175000017500000001043312672140200017372 00000000000000'\" t ...\" RegisteC.sgm /main/8 1996/09/08 21:26:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmRegisterNamesInHierarchy" "library call" .SH "NAME" \fBMrmRegisterNamesInHierarchy\fP \(em Registers the values associated with the names referenced in UIL within a single hierarchy (for example, UIL callback function names or UIL identifier names) .iX "MrmRegisterNamesIn\\%Hierarchy" .iX "uil functions" "MrmRegisterNamesIn\\%Hierarchy" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmRegisterNamesInHierarchy\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBMrmRegisterArglist \fBregister_list\fR\fR, \fBMrmCount \fBregister_count\fR\fR); .fi .iX "MRM function" "MrmRegisterNamesIn\\%Hierarchy" .iX "MrmRegisterNamesIn\\%Hierarchy" "definition" .SH "DESCRIPTION" .PP The \fBMrmRegisterNamesInHierarchy\fP function .iX "MrmRegisterNamesIn\\%Hierarchy" "description" registers a vector of names and associated values for access in MRM\&. The values can be callback functions, pointers to user-defined data, or any other values\&. The information provided is used to resolve symbolic references occurring in UID files to their run-time values\&. For callbacks, this information provides the procedure address required by the Motif Toolkit\&. For names used as identifiers in UIL, this information provides any run-time mapping the application needs\&. .PP This function is similar to \fBMrmRegisterNames\fP, except that the scope of the names registered by \fBMrmRegisterNamesInHierarchy\fP is limited to the hierarchy specified by \fIhierarchy_id\fP, whereas the names registered by \fBMrmRegisterNames\fP have global scope\&. When MRM looks up a name, it first tries to find the name among those registered for the given hierarchy\&. If that lookup fails, it tries to find the name among those registered globally\&. .IP "\fIhierarchy_id\fP" 10 Specifies the hierarchy with which the names are to be associated\&. .IP "\fIregister_list\fP" 10 Specifies a list of name/value pairs for the names to be registered\&. Each name is a case-sensitive, NULL-terminated ASCII string\&. Each value is a 32-bit quantity, interpreted as a procedure address if the name is a callback function, and uninterpreted otherwise\&. .IP "\fIregister_count\fP" 10 Specifies the number of entries in \fIregister_list\fP\&. .PP The names in the list are case-sensitive\&. The list can be either ordered or unordered\&. .PP Callback functions registered through \fBMrmRegisterNamesInHierarchy\fP can be either regular or creation callbacks\&. Regular callbacks have declarations determined by Motif Toolkit and user requirements\&. Creation callbacks have the same format as any other callback: .PP .nf \fBvoid \fBCallBackProc\fP\fR( \fBWidget *\fBwidget_id\fR\fR, \fBOpaque \fBtag\fR\fR, \fBXmAnyCallbackStruct *\fBcallback_data\fR\fR); .fi .IP "\fIwidget_id\fP" 10 Specifies the widget ID associated with the widget performing the callback (as in any callback function)\&. .IP "\fItag\fP" 10 Specifies the tag value (as in any callback function)\&. .IP "\fIcallback_data\fP" 10 Specifies a widget-specific data structure\&. This data structure has a minimum of two members: event and reason\&. The reason member is always set to \fBMrmCR_CREATE\fP\&. .PP Note that the widget name and parent are available from the widget record accessible through \fIwidget_id\fP\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmGetMenuCursor.30000644000175000017500000000365612672140200015100 00000000000000'\" t ...\" GetMenuC.sgm /main/8 1996/09/08 20:46:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetMenuCursor" "library call" .SH "NAME" \fBXmGetMenuCursor\fP \(em A function that returns the cursor ID for the current menu cursor .iX "XmGetMenuCursor" .SH "SYNOPSIS" .PP .nf #include \fBCursor \fBXmGetMenuCursor\fP\fR( \fBDisplay \fB* display\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetMenuCursor\fP queries the menu cursor currently being used by this client on the specified display and returns the cursor ID\&. This function returns the menu cursor for the default screen of the display\&. .PP \fBNOTE:\fP \fBXmGetMenuCursor\fP is obsolete and exists for compatibility with previous releases\&. Instead of using this function, call \fBXtGetValues\fP for the XmScreen resource \fBXmNmenuCursor\fP\&. .IP "\fIdisplay\fP" 10 Specifies the display whose menu cursor is to be queried .SH "RETURN" .PP Returns the cursor ID for the current menu cursor or the value None if a cursor is not yet defined\&. A cursor will not be defined if the application makes this call before the client has created any menus on the specified display\&. .SH "RELATED" .PP \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmListSetKbdItemPos.30000644000175000017500000000377212672140200015646 00000000000000'\" t ...\" LstSetKb.sgm /main/8 1996/09/08 20:52:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSetKbdItemPos" "library call" .SH "NAME" \fBXmListSetKbdItemPos\fP \(em A List function that sets the location cursor at a specified position .iX "XmListSetKbdItemPos" .iX "List functions" "XmListSetKbdItemPos" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmListSetKbdItemPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSetKbdItemPos\fP sets the location cursor at the item specified by \fIposition\fP\&. This function does not determine if the item at the specified position is selected or not\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIposition\fP" 10 Specifies the position of the item at which the location cursor is set\&. A value of 1 indicates the first item in the list; a value of 2 indicates the second item; and so on\&. A value of 0 (zero) sets the location cursor at the last item in the list\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns False if no item exists at the specified position or if the list is empty; otherwise, returns True\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmGetScaledPixmap.30000644000175000017500000000531012672140200015335 00000000000000'\" t ...\" ScalePix.sgm /main/7 1996/10/02 11:48:13 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetScaledPixmap" "library call" .SH "NAME" \fBXmGetScaledPixmap\fP \(em read a pixmap file and scale it according to pixmap and print resolution .SH "SYNOPSIS" .PP .nf #include \fBXtEnum \fBXmGetScaledPixmap\fP\fR( \fBWidget \fBwidget\fR\fR, \fBString \fBimage_name\fR\fR, \fBPixel \fBforeground\fR\fR, \fBPixel \fBbackground\fR\fR, \fBint \fBdepth\fR\fR, \fBDouble \fBscaling_ratio\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetScaledPixmap\fP uses its \fBWidget\fP argument to look up for a Print Shell ancestor to get the pixmap resolution and the default printer resolution information to be used if \fBscaling_ratio\fP \fB==0\fP\&. .PP If scaling is 0, and a valid PrintShell is present \fBXmGetScaledPixmap\fP applies a ratio equals to (printer resolution / default pixmap resolution) before creating the Pixmap on the widget\&'s Screen\&. Otherwise, the \fBscaling_ratio\fP is used in scaling both dimensions of the image being converted as a Pixmap\&. .PP \fBXmGetScaledPixmap\fP completes the \fBXmGetPixmapByDepth\fP existing API by making use of the \fBXmNdefaultPixmapResolution\fP of the rooting \fBXmPrintShell\fP\&. Refer to the \fBXmGetPixmapByDepth\fP documentation for details\&. .IP "\fIwidget\fP" 10 Widget used to determine the default pixmap resolution (of the print shell ancestor)\&. .IP "\fIimage_name\fP" 10 See XmGetPixmapByDepth for description\&. .IP "\fIforeground\fP" 10 See XmGetPixmapByDepth for description\&. .IP "\fIbackground\fP" 10 See XmGetPixmapByDepth for description\&. .IP "\fIdepth\fP" 10 See XmGetPixmapByDepth for description\&. .IP "\fIscaling_ratio\fP" 10 Indicate the scaling ratio to be applied, or 0\&. .SH "RETURN VALUE" .PP Returns Pixmap or NULL if failed\&. .SH "ERRORS/WARNINGS" .PP Same as for \fBXmGetPixmapByDepth\fP\&. .SH "SEE ALSO" .PP \fBXmPrintSetup\fP(3), \fBXmPrintShell\fP(3), \fBXmRedisplayWidget\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmStringBaseline.30000644000175000017500000000336212672140200015241 00000000000000'\" t ...\" StrBas.sgm /main/8 1996/09/08 21:02:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringBaseline" "library call" .SH "NAME" \fBXmStringBaseline\fP \(em A compound string function that returns the number of pixels between the top of the character box and the baseline of the first line of text .iX "XmStringBaseline" .iX "compound string functions" "XmStringBaseline" .SH "SYNOPSIS" .PP .nf #include \fBDimension \fBXmStringBaseline\fP\fR( \fBXmRenderTable \fBrendertable\fR\fR, \fBXmString \fBstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringBaseline\fP returns the number of pixels between the top of the character box and the baseline of the first line of text in the provided compound string\&. .IP "\fIrendertable\fP" 10 Specifies the render table .IP "\fIstring\fP" 10 Specifies the string .SH "RETURN" .PP Returns the number of pixels between the top of the character box and the baseline of the first line of text\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextFieldSetString.30000644000175000017500000000424412672140200016063 00000000000000'\" t ...\" TxtFieBF.sgm /main/8 1996/09/08 21:15:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetString" "library call" .SH "NAME" \fBXmTextFieldSetString\fP \(em A TextField function that sets the string value .iX "XmTextFieldSetString" .iX "TextField functions" "XmTextFieldSetString" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetString\fP\fR( \fBWidget \fBwidget\fR\fR, \fBchar \fB* value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetString\fP sets the string value of the TextField widget\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. It also sets the insertion cursor position to the beginning of the string and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIvalue\fP" 10 Specifies the character pointer to the string value and places the string into the text edit window .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldSetStringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmTextGetSubstringWcs.30000644000175000017500000000613712672140200016275 00000000000000'\" t ...\" TxtGetSH.sgm /main/9 1996/09/08 21:18:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetSubstringWcs" "library call" .SH "NAME" \fBXmTextGetSubstringWcs\fP \(em A Text function that retrieves a portion of a wide character internal text buffer .iX "XmTextGetSubstringWcs" .iX "Text functions" "XmTextGetSubstringWcs" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextGetSubstringWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBstart\fR\fR, \fBint \fBnum_chars\fR\fR, \fBint \fBbuffer_size\fR\fR, \fBwchar_t *\fBbuffer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetSubstringWcs\fP retrieves a copy of a portion of the internal text buffer of a Text widget that is stored in a wide character format\&. The function copies a specified number of characters from a given start position in the internal text buffer into a buffer provided by the application\&. A NULL terminator is placed at the end of the copied data\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fIstart\fP" 10 Specifies the beginning character position from which the data will be retrieved\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fInum_chars\fP" 10 Specifies the number of \fBwchar_t\fR characters to be copied into the provided buffer\&. .IP "\fIbuffer_size\fP" 10 Specifies the size of the supplied buffer as a number of \fBwchar_t\fR storage locations\&. The minimum size is \fInum_chars\fP + 1\&. .IP "\fIbuffer\fP" 10 Specifies the wide character buffer into which the internal text buffer will be copied\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .IP "\fBXmCOPY_SUCCEEDED\fP" 10 The function was successful\&. .IP "\fBXmCOPY_FAILED\fP" 10 The function failed because it was unable to copy the specified number of characters into the buffer provided\&. The buffer size may be insufficient\&. The contents of \fIbuffer\fP are undefined\&. .IP "\fBXmCOPY_TRUNCATED\fP" 10 The requested number of characters extended beyond the internal buffer\&. The function copied characters between \fIstart\fP and the end of the widget\&'s buffer and terminated the string with a NULL terminator; fewer than \fInum_chars\fP characters were copied\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextGetSubstring\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmMultiListSelectItems.30000644000175000017500000000260012672140200016412 00000000000000.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMultiListSelectItems" "library call" .SH "NAME" \fBXmMultiListSelectItems\fP \(em A MultiList function that selects items in the list by matching column entries .iX "XmMultiListSelectItems" .iX "List functions" "XmMultiListSelectItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListSelectItems\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR, \fBint \fBcolumn\fR\fR, \fBBoolean \fBnotify\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMultiListSelectItems\fP highlights rows in the list where column number \fIcolumn\fP matches \fIitem\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget from whose list an item is selected\&. .IP "\fIitem\fP" 10 Specifies XmString to use as selection key\&. .IP "\fIcolumn\fP" 10 Specifies a column number (starting from 0) to match, or XmANY_COLUMN for looking for any column\&. .IP "\fInotify\fP" 10 Specifies a Boolean value that when TRUE invokes the selection callback for the current mode\&. From an application interface view, calling this function with \fInotify\fP True is indistinguishable from a user-initiated selection action\&. When \fInotify\fP is FALSE, no callbacks are called\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3) and \fBXmMultiListGetSelectRows\fP(3)\&. motif-2.3.8/doc/man/man3/XmScrolledWindow.30000644000175000017500000005417512672140200015277 00000000000000'\" t ...\" ScrollA.sgm /main/11 1996/09/08 21:00:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScrolledWindow" "library call" .SH "NAME" \fBXmScrolledWindow\fP \(em The ScrolledWindow widget class .iX "XmScrolledWindow" .iX "widget class" "ScrolledWindow" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The ScrolledWindow widget combines one or two ScrollBar widgets and a viewing area to implement a visible window onto some other (usually larger) data display\&. The visible part of the window can be scrolled through the larger display by the use of ScrollBars\&. .PP To use ScrolledWindow, an application first creates a ScrolledWindow widget, any needed ScrollBar widgets, and a widget capable of displaying any desired data as the work area of ScrolledWindow\&. ScrolledWindow positions the work area widget and displays the ScrollBars if so requested\&. When the user performs some action on the ScrollBar, the application is notified through the normal ScrollBar callback interface\&. .PP ScrolledWindow can be configured to operate automatically so that it performs all scrolling and display actions with no need for application program involvement\&. It can also be configured to provide a minimal support framework in which the application is responsible for processing all user input and making all visual changes to the displayed data in response to that input\&. .PP When ScrolledWindow is performing automatic scrolling it creates a clipping window and automatically creates the scroll bars\&. Conceptually, this window becomes the viewport through which the user examines the larger underlying data area\&. The application simply creates the desired data, then makes that data the work area of the ScrolledWindow\&. When the user moves the slider to change the displayed data, the workspace is moved under the viewing area so that a new portion of the data becomes visible\&. .PP Sometimes it is impractical for an application to create a large data space and simply display it through a small clipping window\&. For example, in a text editor, creating a single data area that consisted of a large file would involve an undesirable amount of overhead\&. The application needs to use a ScrolledWindow (a small viewport onto some larger data), but needs to be notified when the user scrolls the viewport so it can bring in more data from storage and update the display area\&. For these cases, the ScrolledWindow can be configured so that it provides only visual layout support\&. No clipping window is created, and the application must maintain the data displayed in the work area, as well as respond to user input on the ScrollBars\&. .PP The user can specify resources in a resource file for the automatically created widgets that contain the horizontal and vertical scrollbars and the clipping area of the ScrolledWindow widget\&. The names of these widgets are \fBHorScrollBar\fP, \fBVertScrollBar\fP, and \fBClipWindow\fP respectively, and remain consistent whether created by \fBXmCreateScrolledList\fP, \fBXmCreateScrolledText\fP or \fBXmCreateScrolledWindow\fP\&. .PP ScrolledWindow uses the \fBXmQTnavigator\fP trait, and holds the \fBXmQTscrollFrame\fP trait\&. .SS "Descendants" .PP ScrolledWindow automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBVertScrollBar\fP\fBXmScrollBar\fPvertical scroll bar ___ \fBHorScrollBar\fP\fBXmScrollBar\fPhorizontal scroll bar ___ \fBClipWindow\fP\fBXmClipWindow\fPclip window ___ .TE .SS "Classes" .PP ScrolledWindow inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP\&. .PP The class pointer is \fBxmScrolledWindowWidgetClass\fP\&. .PP The class name is \fBXmScrolledWindow\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmScrolledWindow Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNautoDragModelXmCAutoDragModelXtEnumXmAUTO_DRAG_ENABLEDCSG _____ XmNclipWindowXmCClipWindowWidgetdynamicG _____ XmNhorizontalScrollBarXmCHorizontalScrollBarWidgetdynamicCSG _____ XmNscrollBarDisplayPolicyXmCScrollBarDisplayPolicyunsigned chardynamicCSG _____ XmNscrollBarPlacementXmCScrollBarPlacementunsigned charXmBOTTOM_RIGHTCSG _____ XmNscrolledWindowMarginHeightXmCScrolledWindowMarginHeightDimension0CSG _____ XmNscrolledWindowMarginWidthXmCScrolledWindowMarginWidthDimension0CSG _____ XmNscrollingPolicyXmCScrollingPolicyunsigned charXmAPPLICATION_DEFINEDCG _____ XmNspacingXmCSpacingDimension4CSG _____ XmNtraverseObscuredCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNverticalScrollBarXmCVerticalScrollBarWidgetdynamicCSG _____ XmNvisualPolicyXmCVisualPolicyunsigned chardynamicG _____ XmNworkWindowXmCWorkWindowWidgetNULLCSG _____ .TE .IP "\fBXmNautoDragModel\fP" 10 Indicates whether automatic drag is enabled (\fBXmAUTO_DRAG_ENABLED\fP or disabled (\fBXmAUTO_DRAG_DISABLED\fP)\&. By default it is enabled\&. .IP "\fBXmNclipWindow\fP" 10 Specifies the widget ID of the clipping area\&. This is automatically created by ScrolledWindow when the \fBXmNvisualPolicy\fP resource is set to \fBXmCONSTANT\fP and can only be read by the application\&. Any attempt to set this resource to a new value causes a warning message to be printed by the scrolled window\&. If the \fBXmNvisualPolicy\fP resource is set to \fBXmVARIABLE\fP, this resource is set to NULL, and no clipping window is created\&. .IP "\fBXmNhorizontalScrollBar\fP" 10 Specifies the widget ID of the horizontal ScrollBar\&. This is automatically created by ScrolledWindow when the \fBXmNscrollingPolicy\fP is initialized to \fBXmAUTOMATIC\fP; otherwise, the default is NULL\&. .IP "\fBXmNscrollBarDisplayPolicy\fP" 10 Controls the automatic placement of the ScrollBars\&. If it is set to \fBXmAS_NEEDED\fP and if \fBXmNscrollingPolicy\fP is set to \fBXmAUTOMATIC\fP, ScrollBars are displayed only if the workspace exceeds the clip area in one or both dimensions\&. A resource value of \fBXmSTATIC\fP causes the ScrolledWindow to display the ScrollBars whenever they are managed, regardless of the relationship between the clip window and the work area\&. This resource must be \fBXmSTATIC\fP when \fBXmNscrollingPolicy\fP is \fBXmAPPLICATION_DEFINED\fP\&. The default is \fBXmAS_NEEDED\fP when \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, and \fBXmSTATIC\fP otherwise\&. .IP "\fBXmNscrollBarPlacement\fP" 10 Specifies the positioning of the ScrollBars in relation to the work window\&. The values are .RS .IP "\fBXmTOP_LEFT\fP" 10 The horizontal ScrollBar is placed above the work window; the vertical ScrollBar to is placed the left\&. .IP "\fBXmBOTTOM_LEFT\fP" 10 The horizontal ScrollBar is placed below the work window; the vertical ScrollBar to is placed the left\&. .IP "\fBXmTOP_RIGHT\fP" 10 The horizontal ScrollBar is placed above the work window; the vertical ScrollBar to is placed the right\&. .IP "\fBXmBOTTOM_RIGHT\fP" 10 The horizontal ScrollBar is placed below the work window; the vertical ScrollBar to is placed the right\&. .RE .IP "" 10 The default value depends on the value of the \fBXmNlayoutDirection\fP resource of the widget\&. .IP "\fBXmNscrolledWindowMarginHeight\fP" 10 Specifies the margin height on the top and bottom of the ScrolledWindow\&. In order to use the autoscroll drag feature of the Motif drag and drop facility, a user must be able to hold a drag icon over the margin of a scrolled window\&. Though drag and drop will work with the default margin size of zero, a user may find it difficult to position the icon precisely enough to use the feature easily\&. The application programmer should ensure that the window margins are set to an adequate size, if the use of the autoscroll drag feature is desired\&. .IP "\fBXmNscrolledWindowMarginWidth\fP" 10 Specifies the margin width on the right and left sides of the ScrolledWindow\&. Please refer to the warning concerning the default margin size for the \fBXmNscrolledWindowMarginHeight\fP resource, above\&. .IP "\fBXmNscrollingPolicy\fP" 10 Performs automatic scrolling of the work area with no application interaction\&. If the value of this resource is \fBXmAUTOMATIC\fP, ScrolledWindow automatically creates the ScrollBars; attaches callbacks to the ScrollBars; sets the visual policy to \fBXmCONSTANT\fP; and automatically moves the work area through the clip window in response to any user interaction with the ScrollBars\&. An application can also add its own callbacks to the ScrollBars\&. This allows the application to be notified of a scroll event without having to perform any layout procedures\&. .IP "" 10 \fBNOTE\fP: Since the ScrolledWindow adds callbacks to the ScrollBars, an application should not perform an \fBXtRemoveAllCallbacks\fP on any of the ScrollBar widgets\&. .IP "" 10 When \fBXmNscrollingPolicy\fP is set to \fBXmAPPLICATION_DEFINED\fP, the application is responsible for all aspects of scrolling\&. The ScrollBars must be created by the application, and it is responsible for performing any visual changes in the work area in response to user input\&. .IP "" 10 This resource must be set to the desired policy at the time the ScrolledWindow is created\&. It cannot be changed through \fBSetValues\fP\&. .IP "\fBXmNspacing\fP" 10 Specifies the distance that separates the ScrollBars from the work window\&. .IP "\fBXmNtraverseObscuredCallback\fP" 10 Specifies a list of callbacks that is called when traversing to a widget or gadget that is obscured due to its position in the work area relative to the location of the ScrolledWindow viewport\&. This resource is valid only when \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP\&. If this resource is NULL, an obscured widget cannot be traversed to\&. The callback reason is \fBXmCR_OBSCURED_TRAVERSAL\fP\&. .IP "\fBXmNverticalScrollBar\fP" 10 Specifies the widget ID of the vertical ScrollBar\&. This is automatically created by ScrolledWindow when the \fBXmNscrollingPolicy\fP is initialized to \fBXmAUTOMATIC\fP; otherwise, the default is NULL\&. .IP "\fBXmNvisualPolicy\fP" 10 Enlarges the ScrolledWindow to match the size of the work area\&. It can also be used as a static viewport onto a larger data space\&. If the visual policy is \fBXmVARIABLE\fP, the ScrolledWindow forces the ScrollBar display policy to \fBXmSTATIC\fP and allows the work area to grow or shrink at any time and adjusts its layout to accommodate the new size\&. When the policy is \fBXmCONSTANT\fP, the work area grows or shrinks as requested, but a clipping window forces the size of the visible portion to remain constant\&. The only time the viewing area can grow is in response to a resize from the ScrolledWindow\&'s parent\&. The default is \fBXmCONSTANT\fP when \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, and \fBXmVARIABLE\fP otherwise\&. .IP "" 10 \fBNOTE\fP: This resource must be set to the desired policy at the time the ScrolledWindow is created\&. It cannot be changed through \fBSetValues\fP\&. .IP "\fBXmNworkWindow\fP" 10 Specifies the widget ID of the viewing area\&. .TS tab() box; c s s s s l| l| l| l| l. T{ \fBXmScrolledWindow Constraint Resource Set\fP T} \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNscrolledWindowChildTypeXmCScrolledWindowChildTypeunsigned charRESOURCE_DEFAULTCSG _____ .TE .IP "\fBXmNscrolledWindowChildType\fP" 10 Specifies what the child is\&. ScrolledWindow supports a number of child types\&. The possible values are: .RS .IP "\fBXmWORK_AREA\fP" 10 Indicates a work area child\&. This specifies that both ScrollBars are limited to moving the child inside the clipping window\&. If the scrolling policy is \fBXmAUTOMATIC\fP, the work area child can move in both directions\&. .IP "\fBXmHOR_SCROLLBAR\fP" 10 Indicates a horizontal child widget; the child must have the \fBXmQTnavigator\fP trait installed\&. For example, the \fBXmScrollBar\fP widget has the \fBXmQTnavigator\fP trait installed\&. .IP "\fBXmVERT_SCROLLBAR\fP" 10 Indicates a vertical child widget; the child must have the \fBXmQTnavigator\fP trait installed\&. .IP "\fBXmSCROLL_HOR\fP" 10 Indicates that only the horizontal ScrollBar moves the child\&. This value is only meaningful if the scrolling policy is \fBXmAUTOMATIC\fP\&. .IP "\fBXmSCROLL_VERT\fP" 10 Indicates that only the vertical ScrollBar moves the child\&. This value is only meaningful if the scrolling policy is \fBXmAUTOMATIC\fP\&. .IP "\fBXmNO_SCROLL\fP" 10 Indicates that the child does not move with the ScrollBars\&. This value is only meaningful if the scrolling policy is \fBXmAUTOMATIC\fP\&. .RE .SS "Inherited Resources" .PP ScrolledWindow inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP The application must use the ScrollBar callbacks to be notified of user input\&. .PP ScrolledWindow defines a callback structure for use with \fBXmNtraverseObscuredCallback\fP callbacks\&. The \fBXmNtraverseObscuredCallback\fP resource provides a mechanism for traversal to obscured widgets (or gadgets) due to their position in the work area of a ScrolledWindow\&. The \fBXmNtraverseObscuredCallback\fP routine has responsibility for adjusting the position of the work area such that the specified traversal destination widget is positioned within the viewport of the ScrolledWindow\&. A NULL \fBXmNtraverseObscuredCallback\fP resource causes obscured widgets within the ScrolledWindow to be nontraversable\&. .PP Traversal to an obscured widget or gadget requires these conditions to be met: the widget or gadget can be obscured only due to its position in the work area of a ScrolledWindow relative to the viewport; the viewport of the associated ScrolledWindow is fully visible, or can be made so by virtue of ancestral \fBXmNtraverseObscuredCallback\fP routines; and the \fBXmNtraverseObscuredCallback\fP resource must be non-NULL\&. .PP When ScrolledWindow widgets are nested, the \fBXmNtraverseObscuredCallback\fP routine for each ScrolledWindow that obscures the traversal destination is called in ascending order within the given hierarchy\&. .PP A pointer to the following structure is passed to callbacks for \fBXmNtraverseObscuredCallback\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP: Widget \fItraversal_destination\fP; XmTraversalDirection \fIdirection\fP; } XmTraverseObscuredCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fItraversal_destination\fP" 10 Specifies the widget or gadget to traverse to, which will be a descendant of the work window\&. .IP "\fIdirection\fP" 10 Specifies the direction of traversal\&. See the description of the \fIdirection\fP parameter in the \fBXmProcessTraversal\fP reference page for an explanation of the valid values\&. .SS "Translations" .PP \fBXmScrolledWindow\fP includes the translations from \fBXmManager\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window up the height of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the vertical ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window down the height of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the vertical ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window left the width of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the horizontal ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window right the width of the viewport\&. The distance scrolled may be reduced to provide some overlap\&. The actual distance scrolled depends on the \fBXmNpageIncrement\fP resource of the horizontal ScrollBar\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window horizontally to the edge corresponding to the horizontal ScrollBar\&'s minimum value\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window horizontally to the edge corresponding to the horizontal ScrollBar\&'s maximum value\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window vertically to the edge corresponding to the vertical ScrollBar\&'s minimum value\&. .IP "\fB\fP\fB\fP:" 10 If \fBXmNscrollingPolicy\fP is \fBXmAUTOMATIC\fP, scrolls the window vertically to the edge corresponding to the vertical ScrollBar\&'s maximum value\&. .PP Certain applications will want to replace the page bindings with ones that are specific to the content of the scrolled area\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateScrolledWindow\fP(3), \fBXmManager\fP(3), \fBXmProcessTraversal\fP(3), \fBXmScrollBar\fP(3), \fBXmScrollVisible\fP(3), \fBXmScrolledWindowSetAreas\fP(3), \fBXmVaCreateScrolledWindow\fP(3), and \fBXmVaCreateManagedScrolledWindow\fP(3)\&. motif-2.3.8/doc/man/man3/XmText.30000644000175000017500000032252612672140200013262 00000000000000'\" t ...\" Text.sgm /main/17 1996/09/25 15:55:18 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmText" "library call" .SH "NAME" \fBXmText\fP \(em The Text widget class .iX "XmText" .iX "widget class" "Text" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Text provides a single-line and multiline text editor for customizing both user and programmatic interfaces\&. It can be used for single-line string entry, forms entry with verification procedures, and full-window editing\&. It provides an application with a consistent editing system for textual data\&. The screen\&'s textual data adjusts to the application writer\&'s needs\&. .PP Text provides separate callback lists to verify movement of the insert cursor, modification of the text, and changes in input focus\&. Each of these callbacks provides the verification function with the widget instance, the event that caused the callback, and a data structure specific to the verification type\&. From this information, the function can verify if the application considers this to be a legitimate state change and can signal the widget whether to continue with the action\&. .PP The user interface tailors a new set of translations\&. The default translations provide key bindings for insert cursor movement, deletion, insertion, and selection of text\&. .PP Text allows the user to select regions of text\&. Selection is based on the model specified in the \fIInter-Client Communication Conventions Manual\fP (ICCCM)\&. Text supports primary and secondary selection\&. .PP In some Asian languages, texts are drawn vertically\&. Also, some characters are displayed with 90-degree clockwise rotation, and other characters are mapped to vertical glyphs that differ from the normal horizaontal glyphs\&. Information about which characters require rotation or mapping to vertical glyphs is specified in the X Locale Database (NLS databases) and handled by X library, depending on \fBXNOrientation\fP \fBXOC\fR values\&. \fBXmText\fP widget should also handle the vertically aligned lines as for editing, entering, or selecting texts\&. .PP The vertical writing feature of the \fBXmText\fP widget is enabled when the \fBXmTOP_TO_BOTTOM\fP value is specified for the \fBXmNlayoutDirection\fP resource of the \fBXmText\fP widget\&. In that case, the horizontal scroll bar is displayed on the bottom of the \fBXmText\fP widget and the vertical scroll bar is displayed on the left side\&. .SS "Mouse Selection" .PP The Text widget allows text to be edited, inserted, and selected\&. The user can cut, copy, and paste text by using the clipboard, primary transfer, or secondary transfer\&. Text also provides a Drag and Drop facility that enables the user to copy or move data within Text or to a different widget\&. When keyboard focus policy is set to EXPLICIT, the widget that receives focus is the destination widget\&. In POINTER mode, any keyboard or mouse operation (except secondary selection) in an editable widget establishes that widget as the destination\&. .PP If a destination widget becomes insensitive or uneditable, it forfeits its destination status\&. In EXPLICIT mode, when a widget becomes insensitive, the focus moves to another widget\&. If that widget is editable, it becomes the destination widget; otherwise, there is no destination widget\&. The text of any insensitive Text widget is stippled, indicating its state to the user\&. .PP The insertion cursor, displayed as an I-beam, shows where input is inserted\&. Input is inserted just before the insertion cursor\&. .PP Text uses the \fBXmQTnavigator\fP, \fBXmQTspecifyRenderTable\fP, and \fBXmQTscrollFrame\fP traits, and holds the \fBXmQTaccessTextual\fP and \fBXmQTtransfer\fP traits\&. The widget checks its parent for the \fBXmQTscrollFrame\fP trait\&. If this trait does not exist, then the widget has no scrolling\&. If the trait does exist, and the ScrollFrame widget has not been initialized, the widget creates two navigators and sets up the scrollbars\&. .PP If an application or widget calls the \fBsetValue\fP trait method of \fBXmQTaccessTextual\fP, then \fBXmText\fP will call \fBXmTextSetString\fP to set the string value\&. .SS "Classes" .PP Text inherits behavior, resources, and traits from \fBCore\fP and \fBXmPrimitive\fP\&. .PP The class pointer is \fBxmTextWidgetClass\fP\&. .PP The class name is \fBXmText\fP\&. .SS "Data Transfer Behavior" .PP Text supports transfer of the primary, secondary, and clipboard selections and dragging of selected text from the widget\&. Text can also be the destination for the primary, secondary, and clipboard selections, and it supports dropping of data being dragged onto the widget\&. .PP When the \fBXmNconvertCallback\fP procedures are called, the \fBlocation_data\fP member of the \fBXmConvertCallbackStruct\fR member is NULL if the selected text is being transferred\&. If the entire text, not the selected text, is being transferred, the value of this member is the widget ID of the Text widget\&. .PP As a source of data, Text supports the following targets and associated conversions of data to these targets: .IP "\fIlocale\fP" 10 If the \fIlocale\fP target matches the widget\&'s locale, the widget transfers the selected text in the encoding of the locale\&. .IP "\fBCOMPOUND_TEXT\fP" 10 The widget transfers the selected text as type \fBCOMPOUND_TEXT\fP\&. .IP "\fBSTRING\fP" 10 The widget transfers the selected text as type \fBSTRING\fP\&. .IP "\fBTEXT\fP" 10 If the selected text is fully convertible to the encoding of the locale, the widget transfers the selected text in the encoding of the locale\&. Otherwise, the widget transfers the selected text as type \fBCOMPOUND_TEXT\fP\&. .IP "\fBUTF8_STRING\fP" 10 The widget transfers the selected text as type \fBUTF8_STRING\fP\&. .IP "\fBDELETE\fP" 10 The widget deletes the selected text\&. .IP "\fB_MOTIF_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to which the widget can convert data to be placed on the clipboard immediately\&. If the selected text is fully convertible to \fBSTRING\fP, these include \fBSTRING\fP; otherwise, they include \fBCOMPOUND_TEXT\fP\&. .IP "\fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for delayed transfer for the \fBCLIPBOARD\fP selection\&. This widget currently supplies no targets for \fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP\&. .IP "\fB_MOTIF_EXPORT_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to be used as the value of the DragContext\&'s \fBXmNexportTargets\fP in a drag-and-drop transfer\&. These include \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP, \fBBACKGROUND\fP, and \fBFOREGROUND\fP\&. .IP "\fB_MOTIF_LOSE_SELECTION\fP" 10 The widget takes the following actions: .RS .IP " \(bu" 6 When losing the \fBPRIMARY\fP selection, it unhighlights the selected text and calls the \fBXmNlosePrimaryCallback\fP procedures\&. .IP " \(bu" 6 When losing the \fBSECONDARY\fP selection, it removes the secondary selection highlight\&. .IP " \(bu" 6 When losing the \fB_MOTIF_DESTINATION\fP selection, if the widget does not have focus, it changes the cursor to indicate that the widget is no longer the destination\&. .RE .PP As a source of data, Text also supports the following standard Motif targets: .IP "\fBBACKGROUND\fP" 10 The widget transfers \fBXmNbackground\fP as type \fBPIXEL\fP\&. .IP "\fBCLASS\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_CLASS\fP property and transfers the contents as text in the current locale\&. .IP "\fBCLIENT_WINDOW\fP" 10 The widget finds the first shell in the widget hierarchy and transfers its window as type \fBWINDOW\fP\&. .IP "\fBCOLORMAP\fP" 10 The widget transfers \fBXmNcolormap\fP as type \fBCOLORMAP\fP\&. .IP "\fBFOREGROUND\fP" 10 The widget transfers \fBXmNforeground\fP as type \fBPIXEL\fP\&. .IP "\fBNAME\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_NAME\fP property and transfers the contents as text in the current locale\&. .IP "\fBTARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports\&. These include the standard targets in this list\&. These also include \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP, the encoding of the locale, \fBSTRING\fP, and \fBTEXT\fP\&. .IP "\fBTIMESTAMP\fP" 10 The widget transfers the timestamp used to acquire the selection as type \fBINTEGER\fP\&. .IP "\fB_MOTIF_RENDER_TABLE\fP" 10 The widget transfers \fBXmNrenderTable\fP if it exists, or else the default text render table, as type \fBSTRING\fP\&. .IP "\fB_MOTIF_ENCODING_REGISTRY\fP" 10 The widget transfers its encoding registry as type \fBSTRING\fP\&. The value is a list of NULL separated items in the form of tag encoding pairs\&. This target symbolizes the transfer target for the Motif Segment Encoding Registry\&. Widgets and applications can use this Registry to register text encoding formats for specified render table tags\&. Applications access this Registry by calling \fBXmRegisterSegmentEncoding\fP and \fBXmMapSegmentEncoding\fP\&. .PP As a destination for data, Text chooses a target and requests conversion of the selection to that target\&. If the encoding of the locale is present in the list of available targets, Text chooses a requested target from the available targets in the following order of preference: .IP " 1." 6 The encoding of the locale .IP " 2." 6 \fBTEXT\fP .IP " 4." 6 \fBUTF8_STRING\fP .IP " 3." 6 \fBCOMPOUND_TEXT\fP .IP " 4." 6 \fBSTRING\fP .PP If the encoding of the locale is not present in the list of available targets, Text chooses a requested target from the available targets in the following order of preference: .IP " 4." 6 \fBUTF8_STRING\fP .IP " 1." 6 \fBCOMPOUND_TEXT\fP .IP " 2." 6 \fBSTRING\fP .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmText Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNautoShowCursorPositionXmCAutoShowCursorPositionBooleanTrueCSG _____ XmNcursorPositionXmCCursorPositionXmTextPosition0CSG _____ XmNcursorPositionVisibleXmCCursorPositionVisibleBooleandynamicCSG _____ XmNdestinationCallbackXmCCallbackXtCallbackListNULLC _____ XmNeditableXmCEditableBooleanTrueCSG _____ XmNeditModeXmCEditModeintXmSINGLE_LINE_EDITCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNgainPrimaryCallbackXmCCallbackXtCallbackListNULLC _____ XmNlosePrimaryCallbackXmCCallbackXtCallbackListNULLC _____ XmNlosingFocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension5CSG _____ XmNmarginWidthXmCMarginWidthDimension5CSG _____ XmNmaxLengthXmCMaxLengthintlargest integerCSG _____ XmNmodifyVerifyCallbackXmCCallbackXtCallbackListNULLC _____ XmNmodifyVerifyCallbackWcsXmCCallbackXtCallbackListNULLC _____ XmNmotionVerifyCallbackXmCCallbackXtCallbackListNULLC _____ XmtotalLinesXmCTotalLinesintdynamicC _____ XmNsourceXmCSourceXmTextSourceDefault sourceCSG _____ XmNtopCharacterXmCTopCharacterXmTextPosition0CSG _____ XmNvalueXmCValueString""CSG _____ XmNvalueChangedCallbackXmCCallbackXtCallbackListNULLC _____ XmNvalueWcsXmCvalueWcswchar_t *(wchar_t *)""CSG\u1\d _____ XmNverifyBellXmCVerifyBellBooleandynamicCSG .TE .PP \u1\d This resource cannot be set in a resource file\&. .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when the user invokes an event that calls the activate() action\&. The type of the structure whose address is passed to this callback is \fBXmAnyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_ACTIVATE\fP\&. .IP "\fBXmNautoShowCursorPosition\fP" 10 Ensures that the visible text contains the insert cursor when set to True\&. If the insert cursor changes, the contents of Text may scroll in order to bring the insertion point into the window\&. Setting this resource to False, however, does not ensure that Text will not scroll\&. .IP "\fBXmNcursorPosition\fP" 10 Indicates the position in the text where the current insert cursor is to be located\&. Position is determined by the number of characters from the beginning of the text\&. The first character position is 0 (zero)\&. .IP "\fBXmNcursorPositionVisible\fP" 10 If the widget has an \fBXmPrintShell\fP as one of its ancestors, then the default value is \fBFalse\fP; otherwise, it is \fBTrue\fP\&. .IP "\fBXmNdestinationCallback\fP" 10 Specifies a list of callbacks called when the widget is the destination of a transfer operation\&. The type of the structure whose address is passed to these callbacks is \fBXmDestinationCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNeditable\fP" 10 When set to True, indicates that the user can edit the text string\&. Prohibits the user from editing the text when set to False\&. .IP "" 10 When \fBXmNeditable\fP is used on a widget it sets the dropsite to \fBXmDROP_SITE_ACTIVE\fP\&. .IP "\fBXmNeditMode\fP" 10 Specifies the set of keyboard bindings used in Text\&. The default, \fBXmSINGLE_LINE_EDIT\fP, provides the set of key bindings to be used in editing single-line text\&. \fBXmMULTI_LINE_EDIT\fP provides the set of key bindings to be used in editing multiline text\&. .IP "" 10 The results of placing a Text widget inside a ScrolledWindow when the Text\&'s \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP are undefined\&. .IP "\fBXmNfocusCallback\fP" 10 Specifies the list of callbacks called when Text accepts input focus\&. The type of the structure whose address is passed to this callback is \fBXmAnyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_FOCUS\fP\&. .IP "\fBXmNgainPrimaryCallback\fP" 10 Specifies the list of callbacks called when an event causes the Text widget to gain ownership of the primary selection\&. The reason sent by the callback is \fBXmCR_GAIN_PRIMARY\fP\&. .IP "\fBXmNlosePrimaryCallback\fP" 10 Specifies the list of callbacks called when an event causes the Text widget to lose ownership of the primary selection\&. The reason sent by the callback is \fBXmCR_LOSE_PRIMARY\fP\&. .IP "\fBXmNlosingFocusCallback\fP" 10 Specifies the list of callbacks called before Text loses input focus\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_LOSING_FOCUS\fP\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the distance between the top edge of the widget window and the text, and between the bottom edge of the widget window and the text\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the distance between the left edge of the widget window and the text, and between the right edge of the widget window and the text\&. .IP "\fBXmNmaxLength\fP" 10 Specifies the maximum length of the text string that can be entered into text from the keyboard\&. This value must be nonnegative\&. Strings that are entered by using the \fBXmNvalue\fP resource or the \fBXmTextSetString\fP function ignore this resource\&. .IP "\fBXmNmodifyVerifyCallback\fP" 10 Specifies the list of callbacks called before text is deleted from or inserted into Text\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_MODIFYING_TEXT_VALUE\fP\&. When multiple Text widgets share the same source, only the widget that initiates the source change will generate \fBXmNmodifyVerifyCallback\fP\&. .IP "" 10 If both \fBXmNmodifyVerifyCallback\fP and \fBXmNmodifyVerifyCallbackWcs\fP are registered callback lists, the procedure(s) in the \fBXmNmodifyVerifyCallback\fP list is always executed first; and the resulting data, which may have been modified, is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callback routines\&. .IP "\fBXmNmodifyVerifyCallbackWcs\fP" 10 Specifies the list of callbacks called before text is deleted from or inserted into Text\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStructWcs\fR\&. The reason sent by the callback is \fBXmCR_MODIFYING_TEXT_VALUE\fP\&. When multiple Text widgets share the same source, only the widget that initiates the source change will generate the \fBXmNmodifyVerifyCallbackWcs\fP\&. .IP "" 10 If both \fBXmNmodifyVerifyCallback\fP and \fBXmNmodifyVerifyCallbackWcs\fP are registered callback lists, the procedure(s) in the \fBXmNmodifyVerifyCallback\fP list is always executed first; and the resulting data, which may have been modified, is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callback routines\&. .IP "\fBXmNmotionVerifyCallback\fP" 10 Specifies the list of callbacks called before the insert cursor is moved to a new position\&. The type of the structure whose address is passed to this callback is \fBXmTextVerifyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_MOVING_INSERT_CURSOR\fP\&. It is possible for more than one \fBXmNmotionVerifyCallback\fP to be generated from a single action\&. .IP "\fBXmNsource\fP" 10 Specifies the source with which the widget displays text\&. If no source is specified, the widget creates a default string source\&. This resource can be used to share text sources between Text widgets\&. .IP "\fBXmNtopCharacter\fP" 10 Displays the position of text at the top of the window\&. Position is determined by the number of characters from the beginning of the text\&. The first character position is 0 (zero)\&. .IP "" 10 If the \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, the line of text that contains the top character is displayed at the top of the widget without shifting the text left or right\&. \fBXtGetValues\fP for \fBXmNtopCharacter\fP returns the position of the first character in the line that is displayed at the top of the widget\&. .IP "\fBXmNtotalLines\fP" 10 Indicates the number of lines in the text widget buffer (not necessarily visible)\&. The initial value 1 means the text buffer is empty\&. The number of lines reported takes into account the \fBwordWrap\fP policy (that is, it\&'s not simply the number of newline characters\&. .IP "\fBXmNvalue\fP" 10 Specifies the string value of the Text widget as a \fBchar*\fP data value\&. Moves the cursor to position 0 unless a value of \fBXmNcursorPosition\fP was explicitly supplied in the argument list\&. If \fBXmNvalue\fP and \fBXmNvalueWcs\fP are both defined, the value of \fBXmNvalueWcs\fP supersedes that of \fBXmNvalue\fP\&. \fBXtGetValues\fP returns a copy of the value of the internal buffer and \fBXtSetValues\fP copies the string values into the internal buffer\&. .IP "\fBXmNvalueChangedCallback\fP" 10 Specifies the list of callbacks called after text is deleted from or inserted into Text\&. The type of the structure whose address is passed to this callback is \fBXmAnyCallbackStruct\fR\&. The reason sent by the callback is \fBXmCR_VALUE_CHANGED\fP\&. When multiple Text widgets share the same source, only the widget that initiates the source change will generate the \fBXmNvalueChangedCallback\fP\&. This callback represents a change in the source in the Text, not in the Text widget\&. The \fBXmNvalueChangedCallback\fP should occur only in pairs with an \fBXmNmodifyVerifyCallback\fP, assuming that the \fIdoit\fP flag in the callback structure of the \fBXmNmodifyVerifyCallback\fP is not set to False\&. .IP "\fBXmNvalueWcs\fP" 10 Specifies the string value of the Text widget as a \fBwchar_t*\fP data value\&. Moves the cursor to position 0 unless a value of \fBXmNcursorPosition\fP was explicitly supplied in the argument list\&. .IP "" 10 This resource cannot be specified in a resource file\&. .IP "" 10 If \fBXmNvalue\fP and \fBXmNvalueWcs\fP are both defined, the value of \fBXmNvalueWcs\fP supersedes that of \fBXmNvalue\fP\&. \fBXtGetValues\fP returns a copy of the value of the internal buffer encoded as a wide character string\&. \fBXtSetValues\fP copies the value of the wide character string into the internal buffer\&. .IP "\fBXmNverifyBell\fP" 10 Specifies whether the bell should sound when the verification returns without continuing the action\&. The default depends on the value of the ancestor VendorShell\&'s \fBXmNaudibleWarning\fP resource\&. .TS tab() box; c s s s s l l l l l. \fBXmText Input Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNpendingDeleteXmCPendingDeleteBooleanTrueCSG XmNselectionArrayXmCSelectionArrayXtPointerdefault arrayCSG XmNselectionArrayCountXmCSelectionArrayCountint4CSG XmNselectThresholdXmCSelectThresholdint5CSG .TE .IP "\fBXmNpendingDelete\fP" 10 Indicates that pending delete mode is on when the Boolean value is True\&. Pending deletion is defined as deletion of the selected text when an insertion is made\&. .IP "\fBXmNselectionArray\fP" 10 Defines the actions for multiple mouse clicks\&. The value of the resource is an array of \fBXmTextScanType\fR elements\&. \fBXmTextScanType\fR is an enumeration indicating possible actions\&. Each mouse click performed within some time of the previous mouse click increments the index into this array and performs the defined action for that index\&. (This "multiclick" time is specified by the operating environment, and varies among different systems\&. In general, it is usually set to some fraction of a second\&.) The possible actions in the order they occur in the default array are as follows: .RS .IP " 3." 6 \fBXmSELECT_POSITION\fP, which resets the insert cursor position\&. .IP " 4." 6 \fBXmSELECT_WORD\fP, which selects a word\&. .IP " 5." 6 \fBXmSELECT_LINE\fP, which selects a line of text\&. This action sees a line as delimited by \fIhard\fP newline characters\&. In other words, if the word wrap feature is on (\fBXmNwordWrap\fP is True), this will ignore the newlines automatically inserted by the widget\&. This is the default\&. .IP " 6." 6 \fBXmSELECT_OUT_LINE\fP, which selects a line of text\&. This action sees a line as delimited by \fIhard\fP or \fIsoft\fP newline characters\&. In other words, if the word wrap feature is on (\fBXmNwordWrap\fP is True), the newlines automatically inserted by the widget will be treated as delimiting lines\&. .IP " 7." 6 \fBXmSELECT_ALL\fP, which selects all of the text\&. .RE .IP "\fBXmNselectionArrayCount\fP" 10 Indicates the number of elements in the \fBXmNselectionArray\fP resource\&. The value must not be negative\&. .IP "\fBXmNselectThreshold\fP" 10 Specifies the number of pixels of motion that is required to select the next character when selection is performed using the click-drag mode of selection\&. The value must not be negative\&. This resource also specifies whether a drag should be started and the number of pixels to start a drag when \fBBtn2Down\fP and \fBBtn1Down\fP are integrated\&. .TS tab() box; cw(1.3) sw(1.3) sw(1.3) sw(1.3) sw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3). \fBXmText Output Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNblinkRateXmCBlinkRateint500CSG XmNcolumnsXmCColumnsshortdynamicCSG XmNcursorPositionVisibleXmCCursorPositionVisibleBooleanTrueCSG XmNfontListXmCFontListXmFontListdynamicCSG XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG XmNresizeHeightXmCResizeHeightBooleanFalseCSG XmNresizeWidthXmCResizeWidthBooleanFalseCSG XmNrowsXmCRowsshortdynamicCSG XmNwordWrapXmCWordWrapBooleanFalseCSG .TE .IP "\fBXmNblinkRate\fP" 10 Specifies the blink rate of the text cursor in milliseconds\&. The time indicated in the blink rate relates to the time the cursor is visible and the time the cursor is invisible (that is, the time it takes to blink the insertion cursor on and off is twice the blink rate)\&. The cursor does not blink when the blink rate is set to 0 (zero)\&. The value must not be negative\&. .IP "\fBXmNcolumns\fP" 10 Specifies the initial width of the text window as an integer number of characters\&. The width equals the number of characters specified by this resource multiplied by the width as derived from the specified font\&. If the em-space value is available, it is used\&. If not, the width of the numeral "0" is used\&. If this is not available, the maximum width is used\&. For proportionate fonts, the actual number of characters that fit on a given line may be greater than the value specified\&. The value must be greater than 0 (zero)\&. The default value depends on the value of the \fBXmNwidth\fP resource\&. If no width is specified the default is 20\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, and if the \fBXmText\fP widget resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP, this attribute is ignored\&. If no width is specified, the default is 1\&. .IP "\fBXmNcursorPositionVisible\fP" 10 Indicates that the insert cursor position is marked by a text cursor when the Boolean value is True\&. .IP "\fBXmNfontList\fP" 10 Specifies the font list to be used for Text\&. The font list is an obsolete structure and is retained only for compatibility with earlier releases of Motif\&. Use the render table (\fBXmNrenderTable\fP) instead of font lists wherever possible\&. If both are specified, the render table will take precedence\&. If this value is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the font list is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. .IP "" 10 Text searches the font list for the first occurrence of a font set that has \fBXmFONTLIST_DEFAULT_TAG\fP\&. If a default element is not found, the first font set in the font list is used\&. If the list contains no font sets, the first font in the font list will be used\&. Refer to \fBXmFontList\fP(3) for more information on a font list structure\&. .IP "\fBXmNrenderTable\fP" 10 Specifies the render table to be used in deriving a font set or font for rendering text\&. If both a render table and a font list are specified, the render table will take precedence\&. If the value of \fBXmNrenderTable\fP is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, the font list is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. .IP "" 10 Text searches the render table for the first occurrence of a rendition that has the tag \fB_MOTIF_DEFAULT_LOCALE\fP\&. If a default element is not found, the first rendition in the table is used\&. Refer to \fBXmRenderTable\fP(3) for more information on the render table structure\&. .IP "\fBXmNresizeHeight\fP" 10 Indicates that Text will attempt to resize its height to accommodate all the text contained in the widget when the Boolean value is True\&. If the Boolean value is set to True, the text is always displayed, starting from the first position in the source, even if instructed otherwise\&. This attribute is ignored when the application uses a Text widget whose parent is a ScrolledWindow and when \fBXmNscrollVertical\fP is True\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, this resource indicates that the text attempts to resize its height to accommodate all the text contained in the widget when the Boolean value is \fBTrue\fP\&. This attribute is ignored if \fBXmNwordWrap\fP is \fBTrue\fP\&. .IP "\fBXmNresizeWidth\fP" 10 Indicates that Text attempts to resize its width to accommodate all the text contained in the widget when the Boolean value is True\&. This attribute is ignored if \fBXmNwordWrap\fP is True\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, this attribute is still effective even if \fBXmNwordWrap\fP is \fBTrue\fP\&. Also, this attribute is ignored when the application uses a text widget whose parent is a \fBScrolledWindow\fP and \fBXmNscrollHorizaontal\fP is \fBTrue\fP\&. .IP "\fBXmNrows\fP" 10 Specifies the initial height of the text window measured in character heights\&. This attribute is ignored if the text widget resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. The value must be greater than 0 (zero)\&. The default value depends on the value of the \fBXmNheight\fP resource\&. If no height is specified, the default is 1\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, this attribute is still effective, even if the \fBXmText\fP widget resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. If no height is specified, the default is 20\&. .IP "\fBXmNwordWrap\fP" 10 Indicates that lines are to be broken at word breaks (that is, the text does not go off the right edge of the window) when the Boolean value is True\&. Words are defined as a sequence of characters separated by whitespace\&. Whitespace is defined as a space, tab, or newline\&. This attribute is ignored if the text widget resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. Note that this resource is only valid when the widget is not a scroll one, or, if the widget is a scroll widget, that the \fBXmNscrollHorizontal\fP resource is False\&. .IP "" 10 Indicates that lines are to be broken at word breaks (that is, when the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, the text does not go off the bottom edge of the window) when the Boolean value is \fBTrue\fP\&. .PP The following resources are used only when text is created in a ScrolledWindow\&. See the reference page for \fBXmCreateScrolledText\fP\&. .TS tab() box; cw(1.3) sw(1.3) sw(1.3) sw(1.3) sw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3). \fBXmText Scrolling Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNscrollHorizontalXmCScrollBooleanTrueCG XmNscrollLeftSideXmCScrollSideBooleanFalseCG XmNscrollTopSideXmCScrollSideBooleanFalseCG XmNscrollVerticalXmCScrollBooleanTrueCG .TE .PP Note in connection with this table that if the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, the default is \fBTrue\fP\&. .IP "\fBXmNscrollHorizontal\fP" 10 Adds a ScrollBar that allows the user to scroll horizontally through text when the Boolean value is True\&. This resource is forced to False when the Text widget is placed in a ScrolledWindow with \fBXmNscrollingPolicy\fP set to \fBXmAUTOMATIC\fP\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, this attribute is ignored if the \fBXmText\fP widget resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. .IP "\fBXmNscrollLeftSide\fP" 10 Indicates that the vertical ScrollBar should be placed on the left side of the scrolled text window when the Boolean value is True\&. This attribute is ignored if \fBXmNscrollVertical\fP is False or the Text resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, this resource is still effective, even if the XmText widget resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. .IP "\fBXmNscrollTopSide\fP" 10 Indicates that the horizontal ScrollBar should be placed on the top side of the scrolled text window when the Boolean value is True\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, this attribute is ignored if \fBXmNscrollHorizontal\fP is \fBFalse\fP or the \fBXmtext\fP resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. .IP "\fBXmNscrollVertical\fP" 10 Adds a ScrollBar that allows the user to scroll vertically through text when the Boolean value is True\&. This attribute is ignored if the Text resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. This resource is forced to False when the Text widget is placed in a ScrolledWindow with \fBXmNscrollingPolicy\fP set to \fBXmAUTOMATIC\fP\&. .IP "" 10 When the \fBXmNlayoutDirection\fP resource is \fBXmTOP_TO_BOTTOM\fP, this resource is still effective, even if the \fBXmText\fP widget resource \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP\&. .SS "Inherited Resources" .PP Text inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .TS tab() box; cw(1.3) sw(1.3) sw(1.3) sw(1.3) sw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3). \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG XmNconvertCallbackXmCCallbackXtCallbackListNULLC XmNforegroundXmCForegroundPixeldynamicCSG XmNhelpCallbackXmCCallbackXtCallbackListNULLC XmNhighlightColorXmCHighlightColorPixeldynamicCSG XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG XmNhighlightThicknessXmCHighlightThicknessDimension2CSG XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC XmNshadowThicknessXmCShadowThicknessDimension2CSG XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG XmNtraversalOnXmCTraversalOnBooleanTrueCSG XmNunitTypeXmCUnitTypeunsigned chardynamicCSG XmNuserDataXmCUserDataXtPointerNULLCSG .TE .TS tab() box; cw(1.3) sw(1.3) sw(1.3) sw(1.3) sw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3) lw(1.3). \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG XmNancestorSensitiveXmCSensitiveBooleandynamicG XmNbackgroundXmCBackgroundPixeldynamicCSG XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG XmNborderWidthXmCBorderWidthDimension0CSG XmNcolormapXmCColormapColormapdynamicCG XmNdepthXmCDepthintdynamicCG XmNdestroyCallbackXmCCallbackXtCallbackListNULLC XmNheightXmCHeightDimensiondynamicCSG XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG XmNscreenXmCScreenScreen *dynamicCG XmNsensitiveXmCSensitiveBooleanTrueCSG XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG XmNwidthXmCWidthDimensiondynamicCSG XmNxXmCPositionPosition0CSG XmNyXmCPositionPosition0CSG .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .PP The Text widget defines a new callback structure for use with verification callbacks\&. Note that not all fields are relevant for every callback reason\&. The application must first look at the \fIreason\fP field and use only the structure members that are valid for the particular reason\&. The values \fIstartPos\fP, \fIendPos\fP, and \fItext\fP in the callback structure \fBXmTextVerifyCallbackStruct\fR may be modified when the callback is received, and these changes will be reflected as changes made to the source of the Text widget\&. (For example, all keystrokes can be converted to spaces or NULL characters when a password is entered into a Text widget\&.) The application programmer should not overwrite the \fItext\fP field, but should attach data to that pointer\&. .PP A pointer to the following structure is passed to callbacks for \fBXmNlosingFocusCallback\fP, \fBXmNmodifyVerifyCallback\fP, and \fBXmNmotionVerifyCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Boolean \fIdoit\fP; XmTextPosition \fIcurrInsert, newInsert\fP; XmTextPosition \fIstartPos, endPos\fP; XmTextBlock \fItext\fP; } XmTextVerifyCallbackStruct, *XmTextVerifyPtr; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. For example, changes made to the Text widget programmatically do not have an event that can be passed to the associated callback\&. .IP "\fIdoit\fP" 10 Indicates whether the action that invoked the callback is performed\&. Setting \fIdoit\fP to False negates the action\&. Note that not all actions may be negated\&. For example, \fBXmCR_LOSING_FOCUS\fP callbacks may be beyond the control of the widget if they are produced by mouse clicks\&. .IP "\fIcurrInsert\fP" 10 Indicates the current position of the insert cursor\&. .IP "\fInewInsert\fP" 10 Indicates the position at which the user attempts to position the insert cursor\&. .IP "\fIstartPos\fP" 10 Indicates the starting position of the text to modify\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fIendPos\fP" 10 Indicates the ending position of the text to modify\&. If no text is replaced or deleted, the value is the same as \fIstartPos\fP\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fItext\fP" 10 Points to a structure of type \fBXmTextBlockRec\fR\&. This structure holds the textual information to be inserted\&. .PP .nf typedef struct { char *\fIptr\fP; int \fIlength\fP; XmTextFormat \fIformat\fP; } XmTextBlockRec, *XmTextBlock; .fi .RS .IP "\fIptr\fP" 10 Points to the text to be inserted\&. .IP "\fIlength\fP" 10 Specifies the length of the text to be inserted\&. .IP "\fIformat\fP" 10 Specifies the format of the text, either \fBXmFMT_8_BIT\fP or \fBXmFMT_16_BIT\fP\&. .RE .PP A pointer to the following structure is passed to callbacks for \fBXmNmodifyVerifyCallbackWcs\fP\&. .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Boolean \fIdoit\fP; XmTextPosition \fIcurrInsert, newInsert\fP; XmTextPosition \fIstartPos, endPos\fP; XmTextBlockWcs \fItext\fP; } XmTextVerifyCallbackStructWcs, *XmTextVerifyPtrWcs; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. For example, changes made to the Text widget programmatically do not have an event that can be passed to the associated callback\&. .IP "\fIdoit\fP" 10 Indicates whether the action that invoked the callback is performed\&. Setting \fIdoit\fP to False negates the action\&. Note that not all actions may be negated\&. For example, \fBXmCR_LOSING_FOCUS\fP callbacks may be beyond the control of the widget if they are produced by mouse clicks\&. .IP "\fIcurrInsert\fP" 10 Indicates the current position of the insert cursor\&. .IP "\fInewInsert\fP" 10 Indicates the position at which the user attempts to position the insert cursor\&. .IP "\fIstartPos\fP" 10 Indicates the starting position of the text to modify\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fIendPos\fP" 10 Indicates the ending position of the text to modify\&. If no text is replaced or deleted, the value is the same as \fIstartPos\fP\&. If the callback is not a modify verification callback, this value is the same as \fIcurrInsert\fP\&. .IP "\fItext\fP" 10 Points to the following structure of type \fBXmTextBlockRecWcs\fR\&. This structure holds the textual information to be inserted\&. .PP .nf typedef struct { wchar_t *\fIwcsptr\fP; int \fIlength\fP; } XmTextBlockRecWcs, *XmTextBlockWcs; .fi .RS .IP "\fIwcsptr\fP" 10 Points to the wide character text to be inserted\&. .IP "\fIlength\fP" 10 Specifies the number of characters to be inserted\&. .RE .PP The following table describes the reasons for which the individual verification callback structure fields are valid\&. Note that the \fIevent\fP field will never be valid for \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .TS tab() box; l l. \fBReason\fP\fBValid Fields\fP XmCR_LOSING_FOCUST{ \fIreason, event, doit, currInsert, newInsert, startPos, endPos\fP T} XmCR_MODIFYING_TEXT_VALUET{ \fIreason, event, doit, currInsert, newInsert, startPos, endPos, text\fP T} XmCR_MOVING_INSERT_CURSOR\fIreason, doit, currInsert, newInsert\fP .TE .PP A pointer to the following callback structure is passed to the \fBXmNdestinationCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; XtEnum \fIoperation\fP; int \fIflags\fP; XtPointer \fItransfer_id\fP; XtPointer \fIdestination_data\fP; XtPointer \fIlocation_data\fP; Time \fItime\fP; } XmDestinationCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which data transfer is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fIoperation\fP" 10 Indicates the type of transfer operation requested\&. .RS .IP " \(bu" 6 When the selection is \fBPRIMARY\fP or \fBSECONDARY\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fBCLIPBOARD\fP, possible values are \fBXmCOPY\fP and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fB_MOTIF_DROP\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, \fBXmLINK\fP, and \fBXmOTHER\fP\&. A value of \fBXmOTHER\fP means that the callback procedure must get further information from the \fBXmDropProcCallbackStruct\fR structure in the \fIdestination_data\fP member\&. .RE .IP "\fIflags\fP" 10 Indicates whether or not the destination widget is also the source of the data to be transferred\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 The destination widget is not the source of the data to be transferred\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The destination widget is the source of the data to be transferred\&. .RE .IP "\fBtransfer_id\fP" 10 Serves as a unique ID to identify the transfer transaction\&. .IP "\fIdestination_data\fP" 10 Contains information about the destination\&. When the selection is \fB_MOTIF_DROP\fP, the callback procedures are called by the drop site\&'s \fBXmNdropProc\fP, and \fIdestination_data\fP is a pointer to the \fBXmDropProcCallbackStruct\fR structure passed to the \fBXmNdropProc\fP procedure\&. When the selection is \fBSECONDARY\fP, \fIdestination_data\fP is an Atom representing a target recommmended by the selection owner for use in converting the selection\&. Otherwise, \fIdestination_data\fP is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location where data is to be transferred\&. The value is always NULL when the selection is \fBCLIPBOARD\fP\&. If the value is NULL, the data is to be inserted at the widget\&'s cursor position\&. Otherwise, the value is a pointer to an \fBXPoint\fP structure containing the x- and y- coordinates at the location where the data is to be transferred\&. Once \fBXmTransferDone\fP procedures start to be called, \fBlocation_data\fP will no longer be stable\&. .IP "\fItime\fP" 10 Indicates the time when the transfer operation began\&. .SS "Translations" .PP The \fBXmText\fP translations are described in the following list\&. The actions represent the effective behavior of the associated events, and they may differ in a right-to-left language environment\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\(apc s \(apm \(apa\fP \fB\fP:" 10 extend-start() .IP "\fBc \(aps \(apm \(apa\fP \fB\fP:" 10 move-destination() .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 grab-focus() .IP "\fB\(apc \(apm \(apa\fP \fB\fP:" 10 extend-adjust() .IP "\fB\(apc \(apm \(apa\fP \fB\fP:" 10 extend-end() .IP "\fB\fP:" 10 process-bdrag() .IP "\fBm \(apa\fP \fB\fP:" 10 secondary-adjust() .IP "\fB\(apm a\fP \fB\fP:" 10 secondary-adjust() .IP "\fBs c \fP:" 10 link-to() .IP "\fB\(aps\fP \fB\fP:" 10 copy-to() .IP "\fB\(apc\fP \fB\fP:" 10 move-to() .IP "\fB:m\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:a\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:\fP\fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:m\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:a\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:\fP\fB\fP\fB\fP:" 10 cut-clipboard() .IP "\fB:\fP\fB\fP\fB\fP:" 10 paste-clipboard() .IP "\fB:m\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:a\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:\fP\fB\fP\fB\fP:" 10 copy-clipboard() .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 beginning-of-file(\fBextend\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 beginning-of-file() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 beginning-of-line(\fBextend\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 beginning-of-line() .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 end-of-file(\fBextend\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 end-of-file() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 end-of-line(\fBextend\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 end-of-line() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 page-left(\fBextend\fP) (ignored in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 page-left() (next-page() in vertical writing) .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 page-left(\fBextend\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 page-left() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 previous-page(\fBextend\fP) (ignored in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 previous-page() (page-up() in vertical writing) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 page-right(\fBextend\fP) (ignored in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 page-right() (previous-page() in vertical writing) .IP "\fBs c\fP \fB\fP\fB\fP:" 10 page-right(\fBextend\fP) (ignored in vertical writing) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 page-right() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 next-page(\fBextend\fP) (ignored in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 next-page() (page-down() in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 clear-selection() .IP "\fB:\fP\fB\fP\fB\fP:" 10 delete-previous-character() .IP "\fB:s m\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:s a\fP \fB\fP\fB\fP:" 10 cut-primary() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 cut-clipboard() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 delete-to-end-of-line() .IP "\fB:\fP\fB\fP\fB\fP:" 10 delete-next-character() .IP "\fB:c m\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:c a\fP \fB\fP\fB\fP:" 10 copy-primary() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 paste-clipboard() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 copy-clipboard() .IP "\fB:s\fP \fB\fP\fB\fP:" 10 key-select() .IP "\fB:\fP\fB\fP\fB\fP:" 10 set-anchor() .IP "\fB:\fP\fB\fP\fB\fP:" 10 select-all() .IP "\fB:\fP\fB\fP\fB\fP:" 10 deselect-all() .IP "\fB:\fP\fB\fP\fB\fP:" 10 activate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 toggle-add-mode() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB:\fP\fB\fP\fB\fP:" 10 process-cancel() .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 backward-word(\fBextend\fP) ( forward-paragraph(\fBextend\fP) in vertical writing) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 backward-word() (forward-paragraph() in vertical writing) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 key-select(\fBleft\fP) (process-shift-left() in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 backward-character() (process-left() in vertical writing) .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 forward-word(\fBextend\fP) (backward-paragraph(\fBextend\fP) in vertical writing) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 forward-word() (backward-paragraph() in vertical writing) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 key-select(\fBright\fP) (process-shift-right in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 forward-character() (process-right() in vertical writing) .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 backward-paragraph(\fBextend\fP) (backward-word(\fBextend\fP) in vertical writing) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 backward-paragraph() (backward-word() in vertical writing) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 process-shift-up() (key-select(\fBup\fP) in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 process-up() (backward-character() in vertical writing) .IP "\fB:s c\fP \fB\fP\fB\fP:" 10 forward-paragraph(\fBextend\fP) (forward-word(\fBextend\fP) in vertical writing) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 forward-paragraph() (forward-word() in vertical writing) .IP "\fB:s\fP \fB\fP\fB\fP:" 10 process-shift-down() (key-select(\fBdown\fP) in vertical writing) .IP "\fB:\fP\fB\fP\fB\fP:" 10 process-down() (forward-character() in vertical writing) .IP "\fBc \(apm \(apa\fP \fB\fP\fBslash\fP:" 10 select-all() .IP "\fBc \(apm \(apa\fP \fB\fP\fBbackslash\fP:" 10 deselect-all() .IP "\fBs c \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 prev-tab-group() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 next-tab-group() .IP "\fBs \(apc \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 process-tab(\fBPrev\fP) .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 process-tab(\fBNext\fP) .IP "\fB\(aps c \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 activate() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 process-return() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 set-anchor() .IP "\fBs c \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 key-select() .IP "\fBs \(apc \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 self-insert() .IP "\fB\fP:" 10 self-insert() .PP The Text button event translations are modified when Display\&'s \fBXmNenableBtn1Transfer\fP resource does not have a value of \fBXmOFF\fP (in other words, it is either \fBXmBUTTON2_TRANSFER\fP or \fBXmBUTTON2_ADJUST\fP)\&. This option allows the actions for selection and transfer to be integrated on \fB\fP, and the actions for extending the selection can be bound to \fB\fP\&. The actions for \fB\fP that are defined above still apply when the \fB\fP event occurs over text that is not selected\&. The following actions apply when the \fB\fP event occurs over text that is selected: .IP "\fB\fP:" 10 process-bdrag()\&. .IP "\fB\fP\fB\fP:" 10 process-bdrag()\&. .IP "\fB\fP\fB\fP:" 10 process-bdrag()\&. .IP "\fB\fP\fB\fP\fB\fP:" 10 grab-focus(), \fBextend-end\fP\&. .IP "\fB\fP\fB\fP\fB\fP\fB\fP:" 10 extend-start(), extend-end()\&. .IP "\fB\fP\fB\fP\fB\fP\fB\fP:" 10 move-destination()\&. .PP When Display\&'s \fBXmNenableBtn1Transfer\fP resource has a value of \fBXmBUTTON2_ADJUST\fP, the following actions apply: .IP "\fB\fP:" 10 extend-start()\&. .IP "\fB\fP:" 10 extend-adjust()\&. .IP "\fB\fP:" 10 extend-end()\&. .SS "Action Routines" .PP The \fBXmText\fP action routines are .IP "activate():" 10 Calls the callbacks for \fBXmNactivateCallback\fP\&. Passes the event to the parent\&. .IP "backward-character(\fBextend\fP):" 10 Moves the insertion cursor one character to the left\&. This action may have different behavior in a right-to-left language environment\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The backward-character() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the backward-character() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "" 10 In vertical writing, if \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP and \fBXmNnavigationType\fP is \fBXmNONE\fP, traverses to the widget to the left in the tab group\&. If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor to the next line in the same column\&. .IP "backward-paragraph(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with no argument, moves the insertion cursor to the first non-whitespace character following the first previous blank line or beginning of the text\&. If the insertion cursor is already at the beginning of a paragraph, moves the insertion cursor to the beginning of the previous paragraph\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The backward-paragraph() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the backward-paragraph() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "backward-word(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the first non-whitespace character after the first whitespace character to the left or after the beginning of the line\&. If the insertion cursor is already at the beginning of a word, moves the insertion cursor to the beginning of the previous word\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The backward-word() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the backward-word() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "beep():" 10 Causes the terminal to beep\&. The beep() action produces no callbacks\&. .IP "beginning-of-file(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the beginning of the text\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The beginning-of-file() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the beginning-of-file() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "beginning-of-line(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the beginning of the line\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The beginning-of-line() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the beginning-of-line() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "clear-selection():" 10 Clears the current selection by replacing each character except \fB\fP with a \fB\fP character\&. .IP "" 10 The clear-selection() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "copy-clipboard():" 10 If this widget owns the primary selection, this action copies the selection to the clipboard\&. This action calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBCLIPBOARD\fP selection\&. .IP "copy-primary():" 10 Copies the primary selection to just before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmCOPY\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. .IP "" 10 In addition, the copy-primary() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, to the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "copy-to():" 10 If a secondary selection exists, this action copies the secondary selection to the insertion position of the destination component\&. If the primary selection is in the destination widget, it will be deselected\&. Otherwise, there is no effect on the primary selection\&. .IP "" 10 This action calls the destination\&'s \fBXmNdestinationCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBXmCOPY\fP operation\&. The destination\&'s \fBXmNdestinationCallback\fP procedures or the destination component itself invokes the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBSECONDARY\fP selection\&. .IP "" 10 If no secondary selection exists, this action copies the primary selection to the pointer position\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmCOPY\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. .IP "" 10 In addition, the copy-to() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, to the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If there is no secondary selection, the copy-to() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "cut-clipboard():" 10 If this widget owns the primary selection, this action cuts the selection to the clipboard\&. This action calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBCLIPBOARD\fP selection\&. If the transfer is successful, this action then calls the \fBXmNconvertCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBDELETE\fP target\&. .IP "" 10 In addition, the cut-clipboard() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "cut-primary():" 10 Cuts the primary selection and pastes it just before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmMOVE\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. If the transfer is successful, this action then calls the selection owner\&'s \fBXmNconvertCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBDELETE\fP target\&. The cut-primary() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "" 10 In addition, the cut-primary() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP, the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-next-character():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the character following the insertion cursor\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the character following the insertion cursor\&. This may impact the selection\&. .IP "" 10 The delete-next-character() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-next-word():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next space, tab or end-of-line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next space, tab or end-of-line character\&. This may impact the selection\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The delete-next-word() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-previous-character():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the character of text immediately preceding the insertion cursor\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the character of text immediately preceding the insertion cursor\&. This may impact the selection\&. .IP "" 10 The delete-previous-character() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "delete-previous-word():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the next space, tab or beginning-of-line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the next space, tab or beginning-of-line character\&. This may impact the selection\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The delete-previous-word() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "delete-selection():" 10 Deletes the current selection\&. .IP "" 10 The delete-selection() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "delete-to-end-of-line():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next end of line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next end of line character\&. This may impact the selection\&. .IP "" 10 The \fBdelete-to-end-of-line()\fP action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "delete-to-start-of-line():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the previous beginning-of-line character\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the previous beginning-of-line character\&. This may impact the selection\&. .IP "" 10 The delete-to-start-of-line() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "deselect-all():" 10 Deselects the current selection\&. The deselect-all() action produces no callbacks\&. .IP "end-of-file(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the end of the text\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The end-of-file() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the end-of-file() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "end-of-line(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the end of the line\&. If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The end-of-line() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the end-of-line() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "extend-adjust():" 10 Selects text from the anchor to the pointer position and deselects text outside that range\&. Moving the pointer over several lines selects text from the anchor to the end of each line the pointer moves over and up to the pointer position on the current line\&. .IP "" 10 The extend-adjust() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. The extend-adjust() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "extend-end():" 10 Moves the insertion cursor to the position of the pointer\&. The extend-end() action is used to commit the selection\&. After this action has been done, process-cancel() will no longer cancel the selection\&. .IP "" 10 The extend-end() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. The extend-end() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "extend-start():" 10 Adjusts the anchor using the balance-beam method\&. Selects text from the anchor to the pointer position and deselects text outside that range\&. The extend-start() action may produce no callbacks, however, the extend-start() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "forward-character(\fBextend\fP):" 10 Moves the insertion cursor one character to the right\&. This action may have different behavior in a right-to-left language environment\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The forward-character() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the forward-character() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "" 10 In vertical writing, if \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP and \fBXmNnavigationType\fP is \fBXmNONE\fP, traverses to the widget to the right in the tab group\&. If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor to the previous line in the same column\&. .IP "forward-paragraph(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, and this action is called with no argument, moves the insertion cursor to the first non-whitespace character following the next blank line\&. If the insertion cursor is already at the beginning of a paragraph, moves the insertion cursor to the beginning of the next paragraph\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The forward-paragraph() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the forward-paragraph() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "forward-word(\fBextend\fP):" 10 If this action is called with no argument, moves the insertion cursor to the first whitespace character or end-of-line following the next non-whitespace character\&. If the insertion cursor is already at the end of a word, moves the insertion cursor to the end of the next word\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 If called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The forward-word() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the forward-word() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "grab-focus():" 10 This key binding performs the action defined in the \fBXmNselectionArray\fP, depending on the number of multiple mouse clicks\&. The default selection array ordering is one click to move the insertion cursor to the pointer position, two clicks to select a word, three clicks to select a line of text, and four clicks to select all text\&. A single click also deselects any selected text and sets the anchor at the pointer position\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The grab-focus() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "insert-string(\fIstring\fP\fB)\fP:" 10 If \fBXmNpendingDelete\fP is True and the cursor is not disjoint from the current selection, deletes the entire selection\&. Inserts \fIstring\fP before the insertion cursor\&. .IP "" 10 The insert-string() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. Note that, in the case of an empty string, no callbacks will be called, since no modification will have been done\&. However, if the insertion position is inside the current selection, \fBinsert-string\fP with an empty string will cause the selection to be deselected, and the \fBXmNmotionVerifyCallback\fP procedures to be called with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP, \fBXmCR_MODIFYING_TEXT_VALUE\fP, and \fBXmCR_VALUE_CHANGED\fP\&. .IP "key-select(\fBright|left\fP):" 10 If called with an argument of \fIright\fP, moves the insertion cursor one character to the right and extends the current selection\&. If called with an argument of \fIleft\fP, moves the insertion cursor one character to the left and extends the current selection\&. If called with no argument, extends the current selection\&. .IP "" 10 Note that after a \fBkey-select\fP action, the selection will still begin at the original anchor, and will extend to the position indicated in the action call\&. If this new position is on the opposite side of the selection anchor from the previous selection boundary, the original selection will be deselected\&. .IP "" 10 The key-select() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. The key-select() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "" 10 In vertical writing, if called with the argument \fBleft\fP, and if \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor to the next line in the same column\&. In vertical writing, if called with the argument \fBright\fP, and if \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor to the previous line in the same column\&.) .IP "kill-next-character():" 10 In normal mode, if there is a nonnull selection, kills the selection; otherwise, kills the character following the insertion cursor and stores the character in the cut buffer\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, kills the character following the insertion cursor and stores the character in the cut buffer\&. This may impact the selection\&. .IP "" 10 The killed text is stored in \fBCUT_BUFFER0\fP\&. .IP "" 10 The kill-next-character() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "kill-next-word():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, kills the characters following the insertion cursor to the next space, tab or end-of-line character, and stores the characters in the cut buffer\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, kills the characters following the insertion cursor to the next space, tab or end-of-line character, and stores the characters in the cut buffer\&. This may impact the selection\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The killed text is stored in \fBCUT_BUFFER0\fP\&. .IP "" 10 The kill-next-word() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "kill-previous-character():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, kills the character immediately preceding the insertion cursor and stores the character in the cut buffer\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, kills the character immediately preceding the insertion cursor and stores the character in the cut buffer\&. This may impact the selection\&. .IP "" 10 The killed text is stored in \fBCUT_BUFFER0\fP\&. .IP "" 10 The kill-previous-character() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "kill-previous-word():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, kills the characters preceding the insertion cursor up to the next space, tab or beginning-of-line character, and stores the characters in the cut buffer\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, kills the characters preceding the insertion cursor up to the next space, tab or beginning-of-line character, and stores the characters in the cut buffer\&. This may impact the selection\&. This action may have different behavior in a locale other than the C locale\&. .IP "" 10 The killed text is stored in \fBCUT_BUFFER0\fP\&. .IP "" 10 The kill-previous-word() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "kill-selection():" 10 Kills the currently selected text and stores the text in the cut buffer\&. .IP "" 10 The killed text is stored in \fBCUT_BUFFER0\fP\&. .IP "" 10 The kill-selection() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "kill-to-end-of-line():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, kills the characters following the insertion cursor to the next end-of-line character and stores the characters in the cut buffer\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, kills the characters following the insertion cursor to the next end of line character and stores the characters in the cut buffer\&. This may impact the selection\&. .IP "" 10 The killed text is stored in \fBCUT_BUFFER0\fP\&. .IP "" 10 The kill-to-end-of-line() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. In the case where there is a non-null selection to be deleted, this action may also produce calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "kill-to-start-of-line():" 10 In normal mode, if there is a nonnull selection, deletes the selection; otherwise, kills the characters preceding the insertion cursor to the next beginning-of-line character and stores the characters in the cut buffer\&. In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and \fBXmNpendingDelete\fP is set to True, deletes the selection; otherwise, kills the characters preceding the insertion cursor to the next beginning-of-line character and stores the characters in the cut buffer\&. This may impact the selection\&. .IP "" 10 The killed text is stored in \fBCUT_BUFFER0\fP\&. .IP "" 10 The kill-to-start-of-line() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "link-primary():" 10 Places a link to the primary selection just before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmLINK\fP operation\&. The Text widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the link to the primary selection and for taking any related actions\&. .IP "link-to():" 10 If a secondary selection exists, this action places a link to the secondary selection at the insertion position of the destination component\&. This action calls the destination\&'s \fBXmNdestinationCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBXmLINK\fP operation\&. .IP "" 10 If no secondary selection exists, this action places a link to the primary selection at the pointer position\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmLINK\fP operation\&. .IP "" 10 The Text widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the link to the primary or secondary selection and for taking any related actions\&. .IP "move-destination():" 10 Moves the insertion cursor to the pointer position without changing any existing current selection\&. If there is a current selection, sets the widget as the destination widget\&. This also moves the widget focus to match the insertion cursor\&. .IP "" 10 The move-destination() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "move-to():" 10 If a secondary selection exists, this action moves the secondary selection to the insertion position of the destination component\&. If the secondary selection is in the destination widget, and the secondary selection and the primary selection overlap, the result is undefined\&. This action calls the destination\&'s \fBXmNdestinationCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBXmMOVE\fP operation\&. The destination\&'s \fBXmNdestinationCallback\fP procedures or the destination component itself invokes the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBSECONDARY\fP selection\&. If the transfer is successful, this action then calls the selection owner\&'s \fBXmNconvertCallback\fP procedures for the \fBSECONDARY\fP selection and the \fBDELETE\fP target\&. .IP "" 10 If no secondary selection exists, this action moves the primary selection to the pointer position\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBXmMOVE\fP operation\&. It calls the selection owner\&'s \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fBPRIMARY\fP selection\&. If the transfer is successful, this action then calls the selection owner\&'s \fBXmNconvertCallback\fP procedures for the \fBPRIMARY\fP selection and the \fBDELETE\fP target\&. .IP "" 10 The move-to() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If there is no secondary selection, the move-to() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "newline():" 10 If \fBXmNpendingDelete\fP is True and the cursor is not disjoint from the current selection, deletes the entire selection\&. Inserts a newline before the insertion cursor\&. .IP "" 10 The newline() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "newline-and-backup():" 10 If \fBXmNpendingDelete\fP is True and the cursor is not disjoint from the current selection, deletes the entire selection\&. Inserts a newline just before the insertion cursor and repositions the insertion cursor to the end of the line before the newline\&. .IP "" 10 The newline-and-backup() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "newline-and-indent():" 10 If \fBXmNpendingDelete\fP is True and the cursor is not disjoint from the current selection, deletes the entire selection\&. Inserts a newline and then the same number of whitespace characters as at the beginning of the previous line\&. .IP "" 10 The newline-and-indent() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "next-line():" 10 Moves the insertion cursor to the next line\&. .IP "" 10 The next-line() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "next-page(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with no argument, moves the insertion cursor forward one page\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, it moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The next-page() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the next-page() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "" 10 In vertical writing, scrolls the viewing window down one page of text\&. .IP "next-tab-group():" 10 Traverses to the next tab group\&. .IP "" 10 The next-tab-group() action produces no callbacks, unless it results in the widget losing focus, in which case, the \fBXmNlosingFocusCallback\fP procedures are called with reason value \fBXmCR_LOSING_FOCUS\fP\&. .IP "page-left(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with no argument, moves the insertion cursor back one page\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, it moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The page-left() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the page-left() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "page-right(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with no argument, moves the insertion cursor forward one page\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, it moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The page-right() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the page-right() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "paste-clipboard():" 10 Pastes the contents of the clipboard before the insertion cursor\&. This action calls the \fBXmNdestinationCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBXmCOPY\fP operation\&. .IP "" 10 The paste-clipboard() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "prev-tab-group():" 10 Traverses to the previous tab group\&. .IP "" 10 The prev-tab-group() action produces no callbacks, unless it results in the widget losing focus, in which case, the \fBXmNlosingFocusCallback\fP procedures are called with reason value \fBXmCR_LOSING_FOCUS\fP\&. .IP "previous-line():" 10 Moves the insertion cursor to the previous line\&. .IP "" 10 The previous-line() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "previous-page(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with no argument, moves the insertion cursor back one page\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, it moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The previous-page() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. If called with the \fIextend\fP argument, the previous-page() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "" 10 In vertical writing, if called without an argument, scrolls the viewing window up one page of text\&. .IP "process-bdrag()" 10 If the pointer is within the selection, this action starts a drag operation for the selection\&. This action sets the \fBXmNconvertProc\fP of the DragContext to a function that calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fB_MOTIF_DROP\fP selection\&. .IP "" 10 If no selection exists or the pointer is outside the selection, this action prepares to start a secondary selection at the pointer position\&. .PP .RS \fBNote: .IP "" 10 Note that when dragging a secondary selection to a different widget, focus will shift momentarily to the second widget, and then back to the original widget\&. This will generate callbacks to the \fBXmNlosingFocusCallback\fP procedures as focus is lost (by each widget) as well as callbacks to the \fBXmNfocusCallback\fP procedures as focus is regained\&. .RE .IP "process-cancel():" 10 Cancels the current extend-adjust(), secondary-adjust() or process-bdrag() operation and leaves the selection state as it was before the operation; otherwise, and if the parent is a manager, passes the event to the parent\&. .IP "process-down(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP, and \fBXmNnavigationType\fP is \fBXmNONE\fP, traverses to the widget below the current one in the tab group\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 In this case, the action will produce the \fBXmNlosingFocusCallback\fP callbacks with reason value \fBXmCR_LOSING_FOCUS\fP\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor down one line\&. .IP "" 10 The process-down() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "" 10 In vertical writing, moves the insertion cursor one character down\&. .IP "process-home():" 10 Moves the insertion cursor to the beginning of the line\&. .IP "" 10 The process-home() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "process-return():" 10 If \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP, calls the callbacks for \fBXmNactivateCallback\fP, and if the parent is a manager, passes the event to the parent\&. If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, inserts a newline\&. .IP "" 10 The process-return() action during single-line edit produces calls to the \fBXmNactivateCallback\fP procedures with reason value \fBXmCR_ACTIVATE\fP\&. During multi-line editing, the process-return() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "process-shift-down():" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor down one line and selects\&. If \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP, this action behaves like process-up() in \fBXmSINGLE_LINE_EDIT\fP\&. Refer to the process-up() action\&. .IP "" 10 The process-shift-down() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "" 10 In vertical writing, if called with the argument \fBup\fP, moves the insertion cursor one character up and extends the current selection\&. If called with the argument \fBdown\fP, moves the insertion cursor one character down and extends the current selection\&. .IP "process-shift-up():" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor up one line and selects\&. If \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP, this action behaves like process-up() in \fBXmSINGLE_LINE_EDIT\fP\&. Refer to the process-up() action\&. .IP "" 10 The process-shift-up() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "" 10 In vertical writing, if called with the argument \fBup\fP, moves the insertion cursor one character up and extends the current selection\&. If called with the argument \fBdown\fP, moves the insertion cursor one character down and extends the current selection\&. .IP "process-tab(\fBPrev|Next\fP):" 10 If \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP, traverses to the next tab group if the direction argument is \fBNext\fP, or to the previous tab group if the direction is \fBPrev\fP\&. If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, and the direction is \fBNext\fP, the action inserts a tab\&. The \fBPrev\fP direction has no effect with \fBXmMULTI_LINE_EDIT\fP\&. In the Text widget, there is a preset tab stop at every eighth columns\&. .IP "" 10 The process-tab() action under multi-line editing produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. Under single-line editing, the action produces no callbacks, unless it results in the widget losing focus, in which case, the \fBXmNlosingFocusCallback\fP procedures are called with reason value \fBXmCR_LOSING_FOCUS\fP\&. .IP "process-up(\fBextend\fP):" 10 If \fBXmNeditMode\fP is \fBXmSINGLE_LINE_EDIT\fP and \fBXmNnavigationType\fP is \fBXmNONE\fP, traverses to the widget above the current one in the tab group\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, moves the insertion cursor up one line\&. .IP "" 10 If \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP and this action is called with an argument of \fIextend\fP, moves the insertion cursor as in the case of no argument and extends the current selection\&. .IP "" 10 The process-up() action under multi-line editing produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. Under single-line editing, the action produces no callbacks unless it results in the widget losing focus, in which case, the \fBXmNlosingFocusCallback\fP procedures are called with reason value \fBXmCR_LOSING_FOCUS\fP\&. .IP "" 10 In vertical writing, moves the insertion cursor one character up\&. .IP "redraw-display():" 10 Redraws the contents of the text window\&. .IP "" 10 The redraw-display() action produces no callbacks\&. .IP "scroll-cursor-vertically(\fIpercentage\fP\fB)\fP:" 10 Scrolls the line containing the insertion cursor vertically to an intermediate position in the visible window based on an input percentage\&. A value of 0 indicates the top of the window; a value of 100, the bottom of the window\&. If this action is called with no argument, the line containing the insertion cursor is scrolled vertically to a new position designated by the \fIy\fP position of the event passed to the routine\&. .IP "" 10 The \fBscroll-cursor-vertically\fP action produces no callbacks\&. .IP "scroll-one-line-down():" 10 Scrolls the text area down one line\&. .IP "" 10 The scroll-one-line-down() action produces no callbacks\&. .IP "scroll-one-line-up():" 10 Scrolls the text area up one line\&. .IP "" 10 The scroll-one-line-up() action produces no callbacks\&. .IP "secondary-adjust():" 10 Extends the secondary selection to the pointer position\&. .IP "" 10 The secondary-adjust() action produces no callbacks\&. .IP "secondary-notify():" 10 Copies the secondary selection to the insertion cursor of the destination widget\&. .IP "" 10 The secondary-notify() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, and the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP\&. .IP "secondary-start():" 10 Marks the beginning of a secondary selection\&. .IP "" 10 The secondary-start() action produces no callbacks\&. .IP "select-adjust():" 10 Moves the current selection\&. The amount of text selected depends on the number of mouse clicks, as specified by the \fBXmNselectionArray\fP resource\&. .IP "" 10 The select-adjust() action may produce no callbacks, however, it may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. See callback description for more information\&. .IP "select-all():" 10 Selects all text\&. .IP "" 10 The select-all() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. .IP "select-end():" 10 Moves the current selection\&. The amount of text selected depends on the number of mouse clicks, as specified by the \fBXmNselectionArray\fP resource\&. .IP "" 10 The select-end() action produces no callbacks\&. .IP "select-start():" 10 Marks the beginning of a new selection region\&. .IP "" 10 The select-start() action may produce calls to the \fBXmNgainPrimaryCallback\fP procedures\&. .IP "self-insert():" 10 If \fBXmNpendingDelete\fP is True and the cursor is not disjoint from the current selection, deletes the entire selection\&. Inserts the character associated with the key pressed at the insertion cursor\&. .IP "" 10 The self-insert() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .IP "set-anchor():" 10 Resets the anchor point for extended selections\&. Resets the destination of secondary selection actions\&. .IP "" 10 The set-anchor() action produces no callbacks\&. .IP "set-insertion-point():" 10 Sets the insertion position to the position of the mouse pointer\&. .IP "" 10 The set-insertion-point() action produces calls to the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. Note that if the mouse pointer is already over the position of the insertion cursor, the cursor will not be moved, and no callbacks will be produced\&. .IP "set-selection-hint():" 10 Sets the text source and location of the current selection\&. .IP "" 10 The set-selection-hint() action produces no callbacks\&. .IP "toggle-add-mode():" 10 Toggles the state of Add Mode\&. .IP "" 10 The toggle-add-mode() action produces no callbacks\&. .IP "toggle-overstrike():" 10 Toggles the state of the text insertion mode\&. By default, characters typed into the Text widget are inserted at the position of the insertion cursor\&. In overstrike mode, characters entered into the Text widget replace the characters that directly follow the insertion cursor\&. In overstrike mode, when the end of a line is reached, characters are appended to the end of the line\&. .IP "" 10 The following traversal actions generate no callbacks unless they result in the loss of focus by the widget in question, as when \fBXmNnavigationType\fP is \fBXmNONE\fP\&. In this case, they produce calls to the \fBXmNlosingFocusCallback\fP procedures, with reason value \fBXmCR_FOCUS_MOVED\fP\&. .IP "traverse-home():" 10 Traverses to the first widget in the tab group\&. .IP "traverse-next():" 10 Traverses to the next widget in the tab group\&. .IP "traverse-prev():" 10 Traverses to the previous widget in the tab group\&. .IP "unkill():" 10 Restores last killed text to the position of the insertion cursor (or whatever is currently in the \fBCUT_BUFFER0\fP)\&. The inserted text appears before the insertion cursor\&. .IP "" 10 The unkill() action produces calls to the \fBXmNmodifyVerifyCallback\fP procedures with reason value \fBXmCR_MODIFYING_TEXT_VALUE\fP, the \fBXmNvalueChangedCallback\fP procedures with reason value \fBXmCR_VALUE_CHANGED\fP, and the \fBXmNmotionVerifyCallback\fP procedures with reason value \fBXmCR_MOVING_INSERT_CURSOR\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 Draws the insertion cursor as solid and starts blinking the cursor\&. .IP "\fB\fP:" 10 Displays the insertion cursor as a stippled I-beam unless it is the destination widget and stops the cursor from blinking\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateScrolledText\fP(3), \fBXmCreateText\fP(3), \fBXmFontList\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmPrimitive\fP(3), \fBXmTextClearSelection\fP(3), \fBXmTextCopy\fP(3), \fBXmTextCopyLink\fP(3), \fBXmTextCut\fP(3), \fBXmTextEnableRedisplay\fP(3), \fBXmTextDisableRedisplay\fP(3), \fBXmTextField\fP(3), \fBXmTextFindString\fP(3), \fBXmTextFindStringWcs\fP(3), \fBXmTextGetBaseline\fP(3), \fBXmTextGetEditable\fP(3), \fBXmTextGetInsertionPosition\fP(3), \fBXmTextGetLastPosition\fP(3), \fBXmTextGetMaxLength\fP(3), \fBXmTextGetSelection\fP(3), \fBXmTextGetSelectionWcs\fP(3), \fBXmTextGetSelectionPosition\fP(3), \fBXmTextGetSource\fP(3), \fBXmTextGetString\fP(3), \fBXmTextGetStringWcs\fP(3), \fBXmTextGetSubstring\fP(3), \fBXmTextGetSubstringWcs\fP(3), \fBXmTextGetTopCharacter\fP(3), \fBXmTextInsert\fP(3), \fBXmTextInsertWcs\fP(3), \fBXmTextPaste\fP(3), \fBXmTextPasteLink\fP(3), \fBXmTextPosToXY\fP(3), \fBXmTextPosition\fP(3), \fBXmTextRemove\fP(3), \fBXmTextReplace\fP(3), \fBXmTextReplaceWcs\fP(3), \fBXmTextScroll\fP(3), \fBXmTextSetAddMode\fP(3), \fBXmTextSetEditable\fP(3), \fBXmTextSetHighlight\fP(3), \fBXmTextSetInsertionPosition\fP(3), \fBXmTextSetMaxLength\fP(3), \fBXmTextSetSelection\fP(3), \fBXmTextSetSource\fP(3), \fBXmTextSetString\fP(3), \fBXmTextSetStringWcs\fP(3), \fBXmTextSetTopCharacter\fP(3), \fBXmTextShowPosition\fP(3), \fBXmTextXYToPos\fP(3), \fBXmVaCreateText\fP(3), and \fBXmVaCreateManagedText\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateFrame.30000644000175000017500000000341512672140200014505 00000000000000'\" t ...\" CreFra.sgm /main/7 1996/08/30 14:38:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateFrame" "library call" .SH "NAME" \fBXmCreateFrame\fP \(em The Frame widget creation function .iX "XmCreateFrame" .iX "creation functions" "XmCreateFrame" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateFrame\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateFrame\fP creates an instance of a Frame widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Frame and its associated resources, see \fBXmFrame\fP(3)\&. .SH "RETURN" .PP Returns the Frame widget ID\&. .SH "RELATED" .PP \fBXmFrame\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmParseMappingGetValues.30000644000175000017500000000423512672140200016536 00000000000000'\" t ...\" ParMapD.sgm /main/7 1996/08/30 15:52:43 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmParseMappingGetValues" "library call" .SH "NAME" \fBXmParseMappingGetValues\fP \(em A compound string function to retrieve attributes of a parse mapping .iX "XmParseMappingGetValues" .iX "compound string functions" "XmParseMappingGetValues" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmParseMappingGetValues\fP\fR( \fBXmParseMapping \fBparse_mapping\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmParseMappingGetValues\fP retrieves attributes of an \fBXmParseMapping\fR object, using a resource-style argument list\&. If the \fBXmNsubstitute\fP resource is in the \fIarglist\fP, the function will allocate space to hold the returned \fBXmString\fR value\&. The application is responsible for managing this allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of \fBXmParseMapping\fR and its associated resources, see \fBXmParseMapping\fP(3)\&. .SH "RELATED" .PP \fBXmParseMapping\fP(3), \fBXmParseMappingCreate\fP(3), \fBXmParseMappingFree\fP(3), \fBXmParseMappingSetValues\fP(3), \fBXmParseTable\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmDropTransferAdd.30000644000175000017500000000374212672140200015354 00000000000000'\" t ...\" DropTrB.sgm /main/7 1996/08/30 15:15:13 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropTransferAdd" "library call" .SH "NAME" \fBXmDropTransferAdd\fP \(em A Drag and Drop function that enables additional drop transfer entries to be processed after initiating a drop transfer .iX "XmDropTransferAdd" .iX "Drag and Drop functions" "XmDropTransferAdd" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropTransferAdd\fP\fR( \fBWidget \fBdrop_transfer\fR\fR, \fBXmDropTransferEntryRec *\fBtransfers\fR\fR, \fBCardinal \fBnum_transfers\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropTransferAdd\fP identifies a list of additional drop transfer entries to be processed after a drop transfer is started\&. .IP "\fIdrop_transfer\fP" 10 Specifies the ID of the DropTransfer widget returned by \fBXmDropTransferStart\fP .IP "\fItransfers\fP" 10 Specifies the additional drop transfer entries that the receiver wants processed .IP "\fInum_transfers\fP" 10 Specifies the number of items in the \fItransfers\fP array .PP For a complete definition of DropTransfer and its associated resources, see \fBXmDropTransfer\fP(3)\&. .SH "RELATED" .PP \fBXmDragContext\fP(3), \fBXmDropTransfer\fP(3), and \fBXmDropTransferStart\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmVaCreateSimpleRadioBox.30000644000175000017500000001145512672140200016626 00000000000000'\" t ...\" VaCreF.sgm /main/9 1996/09/08 21:21:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmVaCreateSimpleRadioBox" "library call" .SH "NAME" \fBXmVaCreateSimpleRadioBox\fP \(em A RowColumn widget convenience creation function .iX "XmVaCreateSimpleRadioBox" .iX "creation functions" "XmVaCreateSimpleRadioBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmVaCreateSimpleRadioBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBint \fBbutton_set\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmVaCreateSimpleRadioBox\fP creates an instance of a RowColumn widget of type \fBXmWORK_AREA\fP and returns the associated widget ID\&. This routine uses the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP This routine creates a RadioBox and its ToggleButtonGadget children\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIbutton_set\fP" 10 Specifies which button is initially set\&. The value is the integer \fIn\fP in the button name \fBbutton_\fP\fIn\fP\&. .IP "\fIcallback\fP" 10 Specifies a callback procedure to be called when a button\&'s value changes\&. This callback function is added to each button after creation as the button\&'s \fBXmNvalueChangedCallback\fP\&. The callback function is called when a button\&'s value changes, and the button number is returned in the \fIclient_data\fP field\&. .PP The variable portion of the argument list consists of groups of arguments\&. The first argument in each group is a constant or a string and determines which arguments follow in that group\&. The last argument in the list must be NULL\&. Following are the possible first arguments in each group of \fIvarargs\fP: .IP "\fBXmVaRADIOBUTTON\fP" 10 This is followed by four additional arguments\&. The set specifies one button in the RadioBox and some of its resource values\&. Following are the additional four arguments, in order: .RS .IP "\fIlabel\fP" 10 The label string, of type \fBXmString\fR\&. .IP "\fImnemonic\fP" 10 The mnemonic, of type \fBKeySym\fP\&. This is ignored in this release\&. .IP "\fIaccelerator\fP" 10 The accelerator, of type \fBString\fR\&. This is ignored in this release\&. .IP "\fIaccelerator_text\fP" 10 The accelerator text, of type \fBXmString\fR\&. This is ignored in this release\&. .RE .IP "\fIresource_name\fP" 10 This is followed by one additional argument, the value of the resource, of type \fBXtArgVal\fP\&. The pair specifies a resource and its value for the RowColumn widget\&. .IP "\fBXtVaTypedArg\fP" 10 This is followed by four additional arguments\&. The set specifies a resource and its value for the RowColumn widget\&. A resource type conversion is performed if necessary\&. Following are the additional four arguments, in this order: .RS .IP "\fIname\fP" 10 The resource name, of type \fBString\fR .IP "\fItype\fP" 10 The type of the resource value supplied, of type \fBString\fR .IP "\fIvalue\fP" 10 The resource value (or a pointer to the resource value, depending on the type and size of the value), of type \fBXtArgVal\fP .IP "\fIsize\fP" 10 The size of the resource value in bytes, of type \fIint\fP .RE .IP "\fBXtVaNestedList\fP" 10 This is followed by one additional argument of type \fBXtVarArgsList\fP\&. This argument is a nested list of \fIvarargs\fP returned by \fBXtVaCreateArgsList\fP\&. .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateRadioBox\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleCheckBox\fP(3), \fBXmCreateSimpleRadioBox\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimpleCheckBox\fP(3), ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmRemoveProtocols.30000644000175000017500000000440512672140200015471 00000000000000'\" t ...\" RemPrB.sgm /main/8 1996/09/08 20:56:46 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRemoveProtocols" "library call" .SH "NAME" \fBXmRemoveProtocols\fP \(em A VendorShell function that removes the protocols from the protocol manager and deallocates the internal tables .iX "XmRemoveProtocols" .iX "VendorShell functions" "XmRemoveProtocols" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmRemoveProtocols\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBproperty\fR\fR, \fBAtom \fB* protocols\fR\fR, \fBCardinal \fBnum_protocols\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRemoveProtocols\fP removes the protocols from the protocol manager and deallocates the internal tables\&. If any of the protocols are active, it will update the handlers and update the property if \fIshell\fP is realized\&. .PP \fBXmRemoveWMProtocols\fP is a convenience interface\&. It calls \fBXmRemoveProtocols\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIproperty\fP" 10 Specifies the protocol property .IP "\fIprotocols\fP" 10 Specifies the protocol atoms .IP "\fInum_protocols\fP" 10 Specifies the number of elements in protocols .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddProtocols\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveWMProtocols\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmRenderTableCvtFromProp.30000644000175000017500000000425012672140200016656 00000000000000'\" t ...\" RendTaD.sgm /main/7 1996/08/30 15:58:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableCvtFromProp" "library call" .SH "NAME" \fBXmRenderTableCvtFromProp\fP \(em A render table function that converts from a string representation to a render table .iX "XmRenderTableCvtFromProp" .iX "render table functions" "XmRenderTableCvtFromProp" .SH "SYNOPSIS" .PP .nf #include \fBXmRenderTable \fBXmRenderTableCvtFromProp\fP\fR( \fBWidget \fBwidget\fR\fR, \fBchar *\fBproperty\fR\fR, \fBunsigned int \fBlength\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableCvtFromProp\fP converts a string of characters representing a render table to a render table\&. This routine is typically used by the destination of a data transfer operation to produce a render table from a transferred representation\&. .IP "\fIwidget\fP" 10 Specifies the widget that is the destination for the render table .IP "\fIproperty\fP" 10 Specifies a string of characters representing a render table .IP "\fIlength\fP" 10 Specifies the number of bytes in \fIproperty\fP .SH "RETURN" .PP Returns a render table\&. The function allocates space to hold the returned render table\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXmRenderTableFree\fP\&. .SH "RELATED" .PP \fBXmRenderTable\fP(3), \fBXmRenderTableCvtToProp\fP(3), and \fBXmRenderTableFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/MrmFetchSetValues.30000644000175000017500000001042512672140200015362 00000000000000'\" t ...\" FetchSet.sgm /main/9 1996/09/08 21:25:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmFetchSetValues" "library call" .SH "NAME" \fBMrmFetchSetValues\fP \(em Fetches the values to be set from literals stored in UID files .iX "MrmFetchSetValues" .iX "uil functions" "MrmFetchSetValues" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmFetchSetValues\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBWidget \fBwidget\fR\fR, \fBArgList \fBargs\fR\fR, \fBCardinal \fBnum_args\fR\fR); .fi .iX "MRM function" "MrmFetchSetValues" .iX "MrmFetchSetValues" "definition" .SH "DESCRIPTION" .PP The \fBMrmFetchSetValues\fP function is similar to \fBXtSetValues\fP, except that the values to be set are defined by the UIL named values that are stored in the UID hierarchy\&. .iX "MrmFetchSetValues" "description" \fBMrmFetchSetValues\fP fetches the values to be set from literals stored in UID files\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of the UID hierarchy that contains the specified literal\&. The value of \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIwidget\fP" 10 Specifies the widget that is modified\&. .IP "\fIargs\fP" 10 Specifies an argument list that identifies the widget arguments to be modified as well as the index (UIL name) of the literal that defines the value for that argument\&. The name part of each argument (\fIargs[n]\&.name\fP) must begin with the string \fBXmN\fP followed by the name that uniquely identifies this attribute tag\&. For example, \fBXmNwidth\fP is the attribute name associated with the core argument \fIwidth\fP\&. The value part (\fIargs[n]\&.value\fP) must be a string that gives the index (UIL name) of the literal\&. You must define all literals in UIL as exported values\&. .IP "\fInum_args\fP" 10 Specifies the number of entries in \fIargs\fP\&. .PP This function sets the values on a widget, evaluating the values as public literal resource references resolvable from a UID hierarchy\&. Each literal is fetched from the hierarchy, and its value is modified and converted as required\&. This value is then placed in the argument list and used as the actual value for an \fBXtSetValues\fP call\&. \fBMrmFetchSetValues\fP allows a widget to be modified after creation using UID file values the same way creation values are used in \fBMrmFetchWidget\fP\&. .PP As in \fBMrmFetchWidget\fP, each argument whose value can be evaluated from the UID hierarchy is set in the widget\&. Values that are not found or values in which conversion errors occur are not modified\&. .PP Each entry in the argument list identifies an argument to be modified in the widget\&. The name part identifies the tag, which begins with \fBXmN\fP\&. The value part must be a string whose value is the index of the literal\&. Thus, the following code would modify the label resource of the widget to have the value of the literal accessed by the index \fBOK_button_label\fP in the hierarchy: .PP .nf \f(CWargs[n]\&.name = XmNlabel; args[n]\&.value = "OK_button_label";\fR .fi .PP .SH "RETURN VALUE" .iX "MrmSUCCESS" .iX "MrmPARTIAL_SUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmPARTIAL_SUCCESS\fP" 10 At least one literal was successfully fetched\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmOpenHierarchyPerDisplay\fP(3), \fBXtSetValues\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmStringComponentType.30000644000175000017500000001355412672140200016327 00000000000000'\" t ...\" StrCoC.sgm /main/9 1996/09/08 21:03:21 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringComponentType" "library call" .SH "NAME" \fBXmStringComponentType\fR \(em Data type for compound string components .iX "XmStringComponentType" .iX "data types" "XmStringComponentType" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmStringComponentType\fR is the data type specifying compound string component types\&. A compound string component identifies some part of a compound string, and can have a value and length\&. A compound string component can be one of the following types\&. These component types are grouped according to their length and value types\&. .PP The following components have values of NULL and lengths of 0 (zero)\&. .IP "\fBXmSTRING_COMPONENT_SEPARATOR\fP" 10 This component usually maps to a newline or carriage return in displayed text\&. .IP "\fBXmSTRING_COMPONENT_TAB\fP" 10 This component may be thought of as a text component containing only a single tab\&. .IP "\fBXmSTRING_COMPONENT_LAYOUT_POP\fP" 10 The layout direction is kept on a stack, with the current direction kept on top of the stack\&. When this component is read, the most recently read layout direction is popped off the stack and replaced by the direction immediately before it\&. .IP "\fBXmSTRING_COMPONENT_END\fP" 10 This component marks the end of a compound string\&. No other components should follow\&. If an application does not place an \fBXmSTRING_COMPONENT_END\fP component at the end of an \fBXmString\fR, Motif automatically does it for the application\&. .PP The following component has a value of \fBXmDirection\fR and the length of that direction\&. .IP "\fBXmSTRING_COMPONENT_LAYOUT_PUSH\fP" 10 The layout direction is kept on a stack, with the current direction kept on top of the stack\&. This component replaces the current layout direction, and causes another to be pushed onto the top of this stack\&. .PP The following component has a value of \fBXmStringDirection\fR and the length of that direction\&. .IP "\fBXmSTRING_COMPONENT_DIRECTION\fP" 10 This component sets the string direction by overriding the previous string direction\&. .PP The following components have values of type \fBchar *\fR or some equivalent type, and the lengths of these types\&. .IP "\fBXmSTRING_COMPONENT_LOCALE_TEXT\fP" 10 This component contains the multibyte text of a compound string\&. .IP "\fBXmSTRING_COMPONENT_WIDECHAR_TEXT\fP" 10 This component contains the widechar text of a compound string\&. .IP "\fBXmSTRING_COMPONENT_TEXT\fP" 10 This component contains the charset text of a compound string\&. Note that a compound string cannot contain both charset and locale (multibyte or widechar) text\&. .IP "\fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP" 10 This component marks the beginning of a new rendition\&. All text following this component will be rendered using this rendition as the primary one\&. If there is already a rendition in effect, it is kept in memory and used to fill in any unspecified values in the primary rendition\&. Renditions are kept until a corresponding \fBXmSTRING_COMPONENT_RENDITION_END\fP component is encountered\&. .IP "\fBXmSTRING_COMPONENT_RENDITION_END\fP" 10 This component signifies that the specified rendition will no longer be used to render text, and will not be available to fill in unspecified values of newer renditions\&. .IP "\fBXmSTRING_COMPONENT_UNKNOWN\fP" 10 This component type signifies that the component contents belong to an unknown component type\&. .IP "\fBXmSTRING_COMPONENT_LOCALE\fP" 10 Use this component to specify the locale in which an internationalized application is to execute\&. The only valid character string for this component is \fB_MOTIF_DEFAULT_LOCALE\fP\&. .IP "\fBXmSTRING_COMPONENT_TAG\fP" 10 For charset text, this is the tag of the font to be used to display the text\&. This tag is sometimes referred to as the charset tag or the fontlist tag\&. .IP "\fBXmSTRING_COMPONENT_CHARSET\fP" 10 This component is obsolete and remains for compatibility with previous releases\&. It has been replaced by \fBXmSTRING_COMPONENT_TAG\fP\&. .IP "\fBXmSTRING_COMPONENT_FONTLIST_ELEMENT_TAG\fP" 10 This component is obsolete and remains for compatibility with previous releases\&. It has been replaced by \fBXmSTRING_COMPONENT_TAG\fP\&. .PP Some compound string components depend on values defined in other components\&. The \fBXmSTRING_COMPONENT_TAB\fP component definition, for example, depends on information in the \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP\&. To account for these dependencies, a typical compound string will have its member components in the following order: .PP .nf [ [ \fBXmSTRING_COMPONENT_LAYOUT_PUSH\fP ] [ \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP ]* [ \fBXmSTRING_COMPONENT_TAG\fP | \fBXmSTRING_COMPONENT_LOCALE\fP ] [ \fBXmSTRING_COMPONENT_TAB\fP ]* [ \fBXmSTRING_COMPONENT_DIRECTION\fP ] [ \fBXmSTRING_COMPONENT_TEXT\fP | \fBXmSTRING_COMPONENT_LOCALE_TEXT\fP | \fBXmSTRING_COMPONENT_WIDECHAR_TEXT\fP ] [ \fBXmSTRING_COMPONENT_RENDITION_END\fP ]* [ \fBXmSTRING_COMPONENT_LAYOUT_POP\fP ] [ \fBXmSTRING_COMPONENT_SEPARATOR\fP ] ]* \fBXmSTRING_COMPONENT_END\fP .fi ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmCreateDropDown.30000644000175000017500000000171212672140200015205 00000000000000.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateDropDown" "library call" .SH "NAME" \fBXmCreateDropDown\fP \(em The default DropDown widget creation function .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateDropDown\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBarg_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateDropDown\fP creates an instance of a DropDown widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fBarg_count\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of DropDown and its associated resources, see \fBXmDropDown\fP(3)\&. .SH "RETURN" .PP Returns the DropDown widget ID\&. .SH "RELATED" .PP \fBXmDropDown\fP(3)\&. motif-2.3.8/doc/man/man3/XmListSetBottomItem.30000644000175000017500000000317412672140200015724 00000000000000'\" t ...\" LstSetBA.sgm /main/7 1996/08/30 15:46:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSetBottomItem" "library call" .SH "NAME" \fBXmListSetBottomItem\fP \(em A List function that makes an existing item the last visible item in the list .iX "XmListSetBottomItem" .iX "List functions" "XmListSetBottomItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSetBottomItem\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSetBottomItem\fP makes the first item in the list that matches \fIitem\fP the last visible item in the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget from whose list an item is made the last visible .IP "\fIitem\fP" 10 Specifies the item .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmClipboardStartRetrieve.30000644000175000017500000000725312672140200016756 00000000000000'\" t ...\" ClipbN.sgm /main/10 1996/09/25 10:25:13 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardStartRetrieve" "library call" .SH "NAME" \fBXmClipboardStartRetrieve\fP \(em A clipboard function that prepares to retrieve data from the clipboard .iX "XmClipboardStartRetrieve" .iX "clipboard functions" "XmClipboardStartRetrieve" .SH "SYNOPSIS" .PP .nf #include int XmClipboardStartRetrieve (\fIdisplay, window, timestamp\fP) Display \fI* display\fP; Window \fIwindow\fP; Time \fItimestamp\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardStartRetrieve\fP tells the clipboard routines that the application is ready to start copying an item from the clipboard\&. The clipboard is locked by this routine and stays locked until \fBXmClipboardEndRetrieve\fP is called\&. Between a call to \fBXmClipboardStartRetrieve\fP and a call to \fBXmClipboardEndRetrieve\fP, multiple calls to \fBXmClipboardRetrieve\fP with the same format name result in data being incrementally copied from the clipboard until the data in that format has all been retrieved\&. .PP A return value of \fBXmClipboardTruncate\fP from calls to \fBXmClipboardRetrieve\fP indicates that more data remains to be copied in the given format\&. It is recommended that any calls to the \fBInquire\fP functions that the application needs to make to complete the copy from the clipboard be made between the call to \fBXmClipboardStartRetrieve\fP and the first call to \fBXmClipboardRetrieve\fP\&. This way, the application does not need to call \fBXmClipboardLock\fP and \fBXmClipboardUnlock\fP\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fItimestamp\fP" 10 Specifies the time of the event that triggered the copy\&. A valid timestamp must be supplied; it is not sufficient to use \fBCurrentTime\fP\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function is successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardEndRetrieve\fP(3), \fBXmClipboardInquireCount\fP(3), \fBXmClipboardInquireFormat\fP(3), \fBXmClipboardInquireLength\fP(3), \fBXmClipboardInquirePendingItems\fP(3), \fBXmClipboardLock\fP(3), \fBXmClipboardRetrieve\fP(3), \fBXmClipboardStartCopy\fP(3), and \fBXmClipboardUnlock\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTextGetString.30000644000175000017500000000344312672140200015103 00000000000000'\" t ...\" TxtGetSE.sgm /main/8 1996/09/08 21:17:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetString" "library call" .SH "NAME" \fBXmTextGetString\fP \(em A Text function that accesses the string value .iX "XmTextGetString" .iX "Text functions" "XmTextGetString" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmTextGetString\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetString\fP accesses the string value of the Text widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns a character pointer to the string value of the text widget\&. This returned value is a copy of the value of the \fBXmNvalue\fP resource\&. Returns an empty string if the length of the Text widget\&'s string is 0 (zero)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextGetStringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmVaCreateManagedOutline.30000644000175000017500000000003512672140200016631 00000000000000.so man3/XmVaCreateOutline.3 motif-2.3.8/doc/man/man3/XmPushButton.30000644000175000017500000005472012672140200014447 00000000000000'\" t ...\" PushButA.sgm /main/12 1996/09/08 20:56:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPushButton" "library call" .SH "NAME" \fBXmPushButton\fP \(em The PushButton widget class .iX "XmPushButton" .iX "widget class" "PushButton" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP PushButton issues commands within an application\&. It consists of a text label or pixmap surrounded by a border shadow\&. When a PushButton is selected, the shadow changes to give the appearance that it has been pressed in\&. When a PushButton is unselected, the shadow changes to give the appearance that it is out\&. .PP The default behavior associated with a PushButton in a menu depends on the type of menu system in which it resides\&. By default, \fB\fP controls the behavior of the PushButton\&. In addition, \fB\fP controls the behavior of the PushButton if it resides in a PopupMenu system\&. The actual mouse button used is determined by its RowColumn parent\&. .PP Thickness for a second shadow, used when the PushButton is the default button, may be specified with the \fBXmNshowAsDefault\fP resource\&. If it has a nonzero value, the Label\&'s resources \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and \fBXmNmarginBottom\fP may be modified to accommodate the second shadow\&. .PP If an initial value is specified for \fBXmNarmPixmap\fP but not for \fBXmNlabelPixmap\fP, the \fBXmNarmPixmap\fP value is used for \fBXmNlabelPixmap\fP\&. .PP PushButton uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits, and holds the \fBXmQactivatable\fP, \fBXmQTmenuSavvy\fP, and \fBXmQTtakesDefault\fP traits\&. .SS "Classes" .PP PushButton inherits behavior, resources, and traits from \fBCore\fP, \fBXmPrimitive\fP, and \fBXmLabel\fP\&. .PP The class pointer is \fBxmPushButtonWidgetClass\fP\&. .PP The class name is \fBXmPushButton\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPushButton Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmColorXmCArmColorPixeldynamicCSG _____ XmNarmPixmapXmCArmPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNdefaultButtonShadowThicknessXmCDefaultButtonShadowThicknessDimensiondynamicCSG _____ XmNdisarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNfillOnArmXmCFillOnArmBooleanTrueCSG _____ XmNmultiClickXmCMultiClickunsigned chardynamicCSG _____ XmNshowAsDefaultXmCShowAsDefaultDimension0CSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when PushButton is activated\&. PushButton is activated when the user presses and releases the active mouse button while the pointer is inside that widget\&. Activating the PushButton also disarms it\&. For this callback, the reason is \fBXmCR_ACTIVATE\fP\&. This callback uses the \fBXmQTactivatable\fP trait\&. .IP "\fBXmNarmCallback\fP" 10 Specifies the list of callbacks that is called when PushButton is armed\&. PushButton is armed when the user presses the active mouse button while the pointer is inside that widget\&. For this callback, the reason is \fBXmCR_ARM\fP\&. .IP "\fBXmNarmColor\fP" 10 Specifies the color with which to fill the armed button\&. \fBXmNfillOnArm\fP must be set to True for this resource to have an effect\&. The default for a color display is a color between the background and the bottom shadow color\&. For a monochrome display, the default is set to the foreground color, and any text in the label appears in the background color when the button is armed\&. .IP "" 10 This resource is also used when the button is armed in a menu and the \fBXmNenableEtchedInMenu\fP resource is \fBTrue\fP\&. .IP "\fBXmNarmPixmap\fP" 10 Specifies the pixmap to be used as the button face if \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP and PushButton is armed\&. This resource is disabled when the PushButton is in a menu\&. .IP "\fBXmNdefaultButtonShadowThickness\fP" 10 This resource specifies the width of the default button indicator shadow\&. If this resource is 0 (zero), the width of the shadow comes from the value of the \fBXmNshowAsDefault\fP resource\&. If this resource is greater than 0, the \fBXmNshowAsDefault\fP resource is only used to specify whether this button is the default\&. The default value is the initial value of \fBXmNshowAsDefault\fP\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies the list of callbacks that is called when PushButton is disarmed\&. PushButton is disarmed when the user presses and releases the active mouse button while the pointer is inside that widget\&. For this callback, the reason is \fBXmCR_DISARM\fP\&. .IP "\fBXmNfillOnArm\fP" 10 Forces the PushButton to fill the background of the button with the color specified by \fBXmNarmColor\fP when the button is armed and when this resource is set to True\&. If False, only the top and bottom shadow colors are switched\&. When the PushButton is in a menu, this resource is ignored and assumed to be False\&. .IP "\fBXmNmultiClick\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time, and this resource is set to \fBXmMULTICLICK_DISCARD\fP, do not process the second click\&. If this resource is set to \fBXmMULTICLICK_KEEP\fP, process the event and increment \fIclick_count\fP in the callback structure\&. When the button is in a menu, the default is \fBXmMULTICLICK_DISCARD\fP; otherwise, for a button not in a menu, \fBXmMULTICLICK_KEEP\fP is the default value\&. .IP "\fBXmNshowAsDefault\fP" 10 If \fBXmNdefaultButtonShadowThickness\fP is greater than 0 (zero), a value greater than 0 in this resource specifies to mark this button as the default button\&. If \fBXmNdefaultButtonShadowThickness\fP is 0, a value greater than 0 in this resource specifies to mark this button as the default button with the shadow thickness specified by this resource\&. When the Display resource \fBXmNdefaultButtonEmphasis\fP has a value of \fBXmEXTERNAL_HIGHLIGHT\fP (the default), PushButton draws the location cursor outside of the outer shadow\&. When this resource has a value of \fBXmINTERNAL_HIGHLIGHT\fP, the highlight is drawn between the inner and outer shadows\&. The space between the shadow and the default shadow is equal to the sum of both shadows\&. The default value is 0\&. When this value is not 0, the Label resources \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and \fBXmNmarginBottom\fP may be modified to accommodate the second shadow\&. This resource is disabled when the PushButton is in a menu\&. .SS "Inherited Resources" .PP PushButton inherits behavior and resources from the superclasses described the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabel Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLCSG _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLCSG _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapdynamicCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimensiondynamicCSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimensiondynamicCSG _____ XmNmarginRightXmCMarginRightDimensiondynamicCSG _____ XmNmarginTopXmCMarginTopDimensiondynamicCSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGCSG _____ XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG _____ XmNpixmapTextPaddingXmCSpaceDimension2CSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIclick_count\fP; } XmPushButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fIclick_count\fP" 10 This value is valid only when the reason is \fBXmCR_ACTIVATE\fP\&. It contains the number of clicks in the last multiclick sequence if the \fBXmNmultiClick\fP resource is set to \fBXmMULTICLICK_KEEP\fP, otherwise it contains 1\&. The activate callback is invoked for each click if \fBXmNmultiClick\fP is set to \fBXmMULTICLICK_KEEP\fP\&. .SS "Translations" .PP \fBXmPushButton\fP includes translations from \fIPrimitive\fP\&. .PP Note that altering translations in \fB#override\fP or \fB#augment\fP mode is undefined\&. .PP Additional \fBXmPushButton\fP translations for \fBXmPushButtons\fP not in a menu system are described in the following list\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fBc\fP:" 10 ButtonTakeFocus() .IP "\fB\(apc\fP\fB\fP:" 10 Arm() .IP "\fB\(apc\fP\fB\fP\fB,\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiArm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiActivate() .IP "\fB\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB\(apc\fP\fB\fP:" 10 ProcessDrag() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ArmAndActivate() .PP \fBXmPushButton\fP inherits menu traversal translations from \fBXmLabel\fP\&. Additional XmPushButton translations for PushButtons in a menu system are described in the following list\&. In a Popup menu system, \fB\fP also performs the \fB\fP actions\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 ProcessDrag() .IP "\fBc\fP:" 10 MenuButtonTakeFocus() .IP "\fBc\fP:" 10 MenuButtonTakeFocusUp() .IP "\fB\(apc\fP\fB\fP:" 10 BtnDown() .IP "\fB\(apc\fP\fB\fP:" 10 BtnUp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuEscape() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 ArmAndActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ArmAndActivate() .SS "Action Routines" .PP The \fBXmPushButton\fP action routines are .IP "Activate():" 10 This action draws the shadow in the unarmed state\&. If the button is not in a menu and if \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, \fBXmNlabelPixmap\fP is used for the button face\&. If the pointer is still within the button, this action calls the callbacks for \fBXmNactivateCallback\fP\&. .IP "Arm():" 10 This action arms the PushButton\&. It draws the shadow in the armed state\&. If the button is not in a menu and if \fBXmNfillOnArm\fP is set to True, it fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNarmPixmap\fP is used for the button face\&. It calls the \fBXmNarmCallback\fP callbacks\&. .IP "ArmAndActivate():" 10 In a menu, unposts all menus in the menu hierarchy and, unless the button is already armed, calls the \fBXmNarmCallback\fP callbacks\&. This action calls the \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, draws the shadow in the armed state and, if \fBXmNfillOnArm\fP is set to True, fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, \fBXmNarmPixmap\fP is used for the button face\&. This action calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, this action also arranges for the following to happen, either immediately or at a later time: the shadow is drawn in the unarmed state and, if \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, \fBXmNlabelPixmap\fP is used for the button face\&. The \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP callbacks are called\&. .IP "BtnDown():" 10 This action unposts any menus posted by the PushButton\&'s parent menu, disables keyboard traversal for the menu, and enables mouse traversal for the menu\&. It draws the shadow in the armed state and, unless the button is already armed, calls the \fBXmNarmCallback\fP callbacks\&. .IP "BtnUp():" 10 This action unposts all menus in the menu hierarchy and activates the PushButton\&. It calls the \fBXmNactivateCallback\fP callbacks and then the \fBXmNdisarmCallback\fP callbacks\&. .IP "ButtonTakeFocus():" 10 Causes the PushButton to take keyboard focus when \fBCtrl\fP is pressed, without activating the widget\&. .IP "Disarm():" 10 Calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "Help():" 10 In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu system was entered\&. This action calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "MenuShellPopdownOne():" 10 In a top-level Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar; and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, it unposts the menu\&. .IP "" 10 In a Popup MenuPane, this action unposts the menu and restores keyboard focus to the widget from which the menu was posted\&. .IP "MultiActivate():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action increments \fIclick_count\fP in the callback structure and draws the shadow in the unarmed state\&. If the button is not in a menu and if \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP, the \fBXmNlabelPixmap\fP is used for the button face\&. If the pointer is within the PushButton, calls the callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP\&. .IP "MultiArm():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action draws the shadow in the armed state\&. If the button is not in a menu and if \fBXmNfillOnArm\fP is set to True, this action fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP, the \fBXmNarmPixmap\fP is used for the button face\&. This action calls the \fBXmNarmCallback\fP callbacks\&. .IP "ProcessDrag():" 10 Drags the contents of a PushButton label, identified when \fBBTransfer\fP is pressed\&. This action sets the \fBXmNconvertProc\fP of the DragContext to a function that calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, for the \fB_MOTIF_DROP\fP selection\&. This action is undefined for PushButtons used in a menu system\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the armed state and calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 If the PushButton is not in a menu and the cursor leaves and then reenters the PushButton\&'s window while the button is pressed, this action draws the shadow in the armed state\&. If \fBXmNfillOnArm\fP is set to True, it also fills the button with the color specified by \fBXmNarmColor\fP\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, \fBXmNarmPixmap\fP is used for the button face\&. .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the unarmed state and calls the \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 If the PushButton is not in a menu and the cursor leaves the PushButton\&'s window while the button is pressed, this action draws the shadow in the unarmed state\&. If \fBXmNfillOnArm\fP is set to True, the background color reverts to the unarmed color\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used for the button face\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreatePushButton\fP(3), \fBXmLabel\fP(3), \fBXmPrimitive\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreatePushButton\fP(3), and \fBXmVaCreateManagedPushButton\fP(3)\&. motif-2.3.8/doc/man/man3/XmManager.30000644000175000017500000006117112672140200013704 00000000000000'\" t ...\" Manager.sgm /main/12 1996/09/08 20:53:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmManager" "library call" .SH "NAME" \fBXmManager\fP \(em The Manager widget class .iX "XmManager" .iX "widget class" "Manager" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Manager is a widget class used as a supporting superclass for other widget classes\&. It supports the visual resources, graphics contexts, and traversal resources necessary for the graphics and traversal mechanisms\&. .SS "Classes" .PP Manager inherits behavior and resources from \fBCore\fP, \fBComposite\fP, and \fBConstraint\fP\&. .PP The class pointer is \fBxmManagerWidgetClass\fP\&. .PP The class name is \fBXmManager\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .IP "\fBXmNbottomShadowColor\fP" 10 Specifies the color to use to draw the bottom and right sides of the border shadow\&. This color is used if the \fBXmNbottomShadowPixmap\fP resource is NULL\&. .IP "\fBXmNbottomShadowPixmap\fP" 10 Specifies the pixmap to use to draw the bottom and right sides of the border shadow\&. .IP "\fBXmNforeground\fP" 10 Specifies the foreground drawing color used by manager widgets\&. .IP "\fBXmNhelpCallback\fP" 10 Specifies the list of callbacks that are called when the help key sequence is pressed\&. The reason sent by this callback is \fBXmCR_HELP\fP\&. .IP "\fBXmNhighlightColor\fP" 10 Specifies the color of the highlighting rectangle\&. This color is used if the highlight pixmap resource is \fBXmUNSPECIFIED_PIXMAP\fP\&. .IP "\fBXmNhighlightPixmap\fP" 10 Specifies the pixmap used to draw the highlighting rectangle\&. .IP "\fBXmNinitialFocus\fP" 10 Specifies the ID of a widget descendant of the manager\&. The widget must meet these conditions: .RS .IP " \(bu" 6 The widget must be either a tab group or a non-tab-group widget that can receive keyboard focus\&. For the definition of a tab group, see the description of the Manager, Primitive, and Gadget \fBXmNnavigationType\fP resources\&. In general a widget can receive keyboard focus when it is a primitive, a gadget, or a manager (such as a DrawingArea with no traversable children) that acts as a primitive\&. .IP " \(bu" 6 The widget must not be a descendant of a tab group that is itself a descendant of the manager\&. That is, the widget cannot be contained within a tab group that is nested inside the manager\&. .IP " \(bu" 6 The widget and its ancestors must have a value of True for their \fBXmNtraversalOn\fP resources\&. .RE .IP "" 10 If the widget does not meet these conditions, \fBXmNinitialFocus\fP is treated as if the value were NULL\&. .IP "" 10 This resource is meaningful only when the nearest shell ancestor\&'s \fBXmNkeyboardFocusPolicy\fP is \fBXmEXPLICIT\fP\&. It is used to determine which widget receives focus in these situations: .RS .IP " \(bu" 6 When the manager is the child of a shell and the shell hierarchy receives focus for the first time .IP " \(bu" 6 When focus is inside the shell hierarchy, the manager is a composite tab group, and the user traverses to the manager via the keyboard .RE .IP "" 10 Focus is then determined as follows: .RS .IP " \(bu" 6 If \fBXmNinitialFocus\fP is a traversable non-tab-group widget, that widget receives focus\&. .IP " \(bu" 6 If \fBXmNinitialFocus\fP is a traversable tab group, that tab group receives focus\&. If that tab group is a composite with descendant tab groups or traversable non-tab-group widgets, these procedures are used recursively to assign focus to a descendant of that tab group\&. .IP " \(bu" 6 If \fBXmNinitialFocus\fP is NULL, the first traversable non-tab-group widget that is not contained within a nested tab group receives focus\&. .IP " \(bu" 6 If \fBXmNinitialFocus\fP is NULL and no traversable non-tab-group widget exists, the first traversable tab group that is not contained within a nested tab group receives focus\&. If that tab group is a composite with descendant tab groups or traversable non-tab-group widgets, these procedures are used recursively to assign focus to a descendant of that tab group\&. .RE .IP "" 10 If a shell hierarchy regains focus after losing it, focus returns to the widget that had the focus at the time it left the hierarchy\&. .IP "" 10 The use of \fBXmNinitialFocus\fP is undefined if the manager is a MenuBar, PulldownMenu, PopupMenu, or OptionMenu\&. .IP "\fBXmNlayoutDirection\fP" 10 Specifies the direction in which components of the manager (including strings) are laid out\&. The values are of type \fBXmDirection\fR\&. If the widget\&'s parent is a manager or shell, the value is inherited from the widget\&'s parent\&. Otherwise, it is inherited from the closest ancestor vendor or menu shell\&. Refer to the \fBXmDirection\fP(3) reference page for the possible direction values\&. .IP "\fBXmNnavigationType\fP" 10 Determines whether the widget is a tab group\&. .RS .IP "\fBXmNONE\fP" 10 Indicates that the widget is not a tab group\&. .IP "\fBXmTAB_GROUP\fP" 10 Indicates that the widget is a tab group, unless the \fBXmNnavigationType\fP of another widget in the hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP\&. .IP "\fBXmSTICKY_TAB_GROUP\fP" 10 Indicates that the widget is a tab group, even if the \fBXmNnavigationType\fP of another widget in the hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP\&. .IP "\fBXmEXCLUSIVE_TAB_GROUP\fP" 10 Indicates that the widget is a tab group and that widgets in the hierarchy whose \fBXmNnavigationType\fP is \fBXmTAB_GROUP\fP are not tab groups\&. .IP "" 10 When a parent widget has an \fBXmNnavigationType\fP of \fBXmEXCLUSIVE_TAB_GROUP\fP, traversal of non-tab-group widgets within the group is based on the order of those widgets in their parent\&'s \fBXmNchildren\fP list\&. .IP "" 10 When the \fBXmNnavigationType\fP of any widget in a hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP, traversal of tab groups in the hierarchy proceeds to widgets in the order in which their \fBXmNnavigationType\fP resources were specified as \fBXmEXCLUSIVE_TAB_GROUP\fP or \fBXmSTICKY_TAB_GROUP\fP, whether by creating the widgets with that value, by calling \fBXtSetValues\fP, or by calling \fBXmAddTabGroup\fP\&. .RE .IP "\fBXmNpopupHandlerCallback\fP" 10 Allows the application to control which popup menu will be automatically posted\&. The reason can either be \fBXmCR_POST\fP or \fBXmCR_REPOST:\fP .RS .IP "\fBXmCR_POST\fP" 10 Indicates that this is a regular posting request\&. .IP "\fBXmCR_REPOST\fP" 10 Indicates that the menu was just unposted and that this callback was invoked on a replay\&. .RE .IP "" 10 This callback uses the \fBXmPopupHandlerCallbackStruct\fR structure to pass information\&. .IP "\fBXmNshadowThickness\fP" 10 Specifies the thickness of the drawn border shadow\&. \fBXmBulletinBoard\fP and its descendants set this value dynamically\&. If the widget is a top-level window, this value is set to 1\&. If it is not a top-level window, this value is set to 0 (zero)\&. .IP "\fBXmNstringDirection\fP" 10 Is a synthetic resource for setting \fBXmNlayoutDirection\fP\&. The values for this resource are \fBXmSTRING_DIRECTION_L_TO_R\fP and \fBXmSTRING_DIRECTION_R_TO_L\fP\&. Refer to the \fBXmNlayoutDirection\fP resource description\&. The \fBXmNstringDirection\fP resource is obsoleted by \fBXmNlayoutDirection\fP, but is kept here for backward compatibility\&. .IP "\fBXmNtopShadowColor\fP" 10 Specifies the color to use to draw the top and left sides of the border shadow\&. This color is used if the \fBXmNtopShadowPixmap\fP resource is NULL\&. .IP "\fBXmNtopShadowPixmap\fP" 10 Specifies the pixmap to use to draw the top and left sides of the border shadow\&. .IP "\fBXmNtraversalOn\fP" 10 Specifies whether traversal is activated for this widget\&. .IP "\fBXmNunitType\fP" 10 Provides the basic support for resolution independence\&. It defines the type of units a widget uses with sizing and positioning resources\&. If the widget\&'s parent is a subclass of \fBXmManager\fP and if the \fBXmNunitType\fP resource is not explicitly set, it defaults to the unit type of the parent widget\&. If the widget\&'s parent is not a subclass of \fBXmManager\fP, the resource has a default unit type of \fBXmPIXELS\fP\&. .IP "" 10 The unit type can also be specified in resource files, with the following format: .PP .nf \f(CW\fI\fP\fR .fi .PP .IP "" 10 where: .RS .IP "\fIunit\fP" 10 is <" ", pixels, inches, centimeters, millimeters, points, font units> .IP "\fIpixels\fP" 10 is <\fIpix\fP, \fIpixel\fP, \fIpixels\fP> .IP "\fIinches\fP" 10 is <\fIin\fP, \fIinch\fP, \fIinches\fP> .IP "\fIcentimeter\fP" 10 is <\fIcm\fP, \fIcentimeter\fP, \fIcentimeters\fP> .IP "\fImillimeters\fP" 10 is <\fImm\fP, \fImillimeter\fP, \fImillimeters\fP> .IP "\fBpoints\fP" 10 is <\fIpt\fP, \fIpoint\fP, \fIpoints\fP> .IP "\fBfont units\fP" 10 is <\fIfu\fP, \fBfont_unit\fP, \fBfont_units\fP> .IP "\fIfloat\fP" 10 is {"+"|"-"}{{<"0"-"9">*}\&.}<"0"-"9">* .IP "" 10 Note that the type Dimension must always be positive\&. .RE .IP "" 10 For example, .PP .nf \f(CWxmfonts*XmMainWindow\&.height: 10\&.4cm *PostIn\&.width: 3inches\fR .fi .PP .IP "" 10 \fBXmNunitType\fP can have the following values: .RS .IP "\fBXmPIXELS\fP" 10 All values provided to the widget are treated as normal pixel values\&. .IP "\fBXmMILLIMETERS\fP" 10 All values provided to the widget are treated as normal millimeter values\&. .IP "\fBXm100TH_MILLIMETERS\fP" 10 All values provided to the widget are treated as 1/100 of a millimeter\&. .IP "\fBXmCENTIMETERS\fP" 10 All values provided to the widget are treated as normal centimeter values\&. .IP "\fBXmINCHES\fP" 10 All values provided to the widget are treated as normal inch values\&. .IP "\fBXm1000TH_INCHES\fP" 10 All values provided to the widget are treated as 1/1000 of an inch\&. .IP "\fBXmPOINTS\fP" 10 All values provided to the widget are treated as normal point values\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXm100TH_POINTS\fP" 10 All values provided to the widget are treated as 1/100 of a point\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXmFONT_UNITS\fP" 10 All values provided to the widget are treated as normal font units\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fBXm100TH_FONT_UNITS\fP" 10 All values provided to the widget are treated as 1/100 of a font unit\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .RE .IP "\fBXmNuserData\fP" 10 Allows the application to attach any necessary specific data to the widget\&. This is an internally unused resource\&. .SS "Dynamic Color Defaults" .PP The foreground, background, top shadow, bottom shadow, and highlight color resources are dynamically defaulted\&. If no color data is specified, the colors are automatically generated\&. On a single-plane system, a black and white color scheme is generated\&. Otherwise, four colors are generated, which display the correct shading for the 3-D visuals\&. If the background is the only color specified for a widget, the top shadow and bottom shadow colors are generated to give the 3-D appearance\&. Foreground and highlight colors are generated to provide sufficient contrast with the background color\&. .PP Colors are generated only at creation\&. Resetting the background through \fBXtSetValues\fP does not regenerate the other colors\&. \fBXmChangeColor\fP can be used to recalculate all associated colors based on a new background color\&. .SS "Inherited Resources" .PP Manager inherits resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback for \fBXmNhelpCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. For this callback, \fIreason\fP is set to \fBXmCR_HELP\fP\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .PP A pointer to the following structure is passed to each callback for \fBXmNpopupHandlerCallback\fP: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Widget \fImenuToPost\fP; Boolean \fIpostIt\fP; Widget \fItarget\fP; } XmPopupHandlerCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the handler\&. .IP "\fImenuToPost\fP" 10 Specifies the popup menu that the menu system believes should be posted\&. The application may modify this field\&. .IP "\fIpostIt\fP" 10 Indicates whether the posting process should continue\&. The application may modify this field\&. .IP "\fItarget\fP" 10 Specifies the most specific widget or gadget that the menu sytem found from the event that matches the event\&. .SS "Translations" .PP The following set of translations are used by Manager widgets that have Gadget children\&. Because Gadgets cannot have translations associated with them, it is the responsibility of the Manager widget to intercept the events of interest and pass them to any Gadget child with focus\&. These events are ignored if no Gadget child has the focus\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 ManagerGadgetButtonMotion() .IP "\fBc\fP:" 10 ManagerGadgetTraverseCurrent() .IP "\fB\(apc\fP\fB\fP:" 10 ManagerGadgetArm() .IP "\fB\(apc\fP\fB\fP\fB,\(apc\fP\fB\fP:" 10 ManagerGadgetActivate() .IP "\fB\(apc\fP\fB\fP:" 10 ManagerGadgetActivate() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 ManagerGadgetMultiArm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 ManagerGadgetMultiActivate() .IP "\fB\fP:" 10 ManagerGadgetDrag() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerGadgetSelect() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerGadgetHelp() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 ManagerParentActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ManagerGadgetSelect() .IP "\fB\fP:" 10 ManagerGadgetKeyInput() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerGadgetTraverseHome() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerGadgetTraverseUp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerGadgetTraverseDown() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerGadgetTraverseLeft() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ManagerGadgetTraverseRight() .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 ManagerGadgetPrevTabGroup() .IP "\fB\(apm \(apa\fP \fB\fP\fBTab\fP:" 10 ManagerGadgetNextTabGroup() .SS "Action Routines" .PP The \fBXmManager\fP action routines are .IP "GadgetTakeFocus():" 10 Causes the current gadget to take keyboard focus when \fBCtrl\fP is pressed\&. .IP "ManagerGadgetActivate():" 10 Causes the current gadget to be activated\&. .IP "ManagerGadgetArm():" 10 Causes the current gadget to be armed\&. .IP "ManagerGadgetButtonMotion():" 10 Causes the current gadget to process a mouse motion event\&. .IP "ManagerGadgetDrag():" 10 Causes the current gadget to begin a drag operation\&. This action is undefined for gadgets used in a menu system\&. .IP "ManagerGadgetHelp():" 10 Calls the callbacks for the current gadget\&'s \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "ManagerGadgetKeyInput():" 10 Causes the current gadget to process a keyboard event\&. .IP "ManagerGadgetMultiActivate():" 10 Causes the current gadget to process a multiple mouse click\&. .IP "ManagerGadgetMultiArm():" 10 Causes the current gadget to process a multiple mouse button press\&. .IP "ManagerGadgetNextTabGroup():" 10 This action depends on the value of the Display resource \fBXmNenableButtonTab\fP\&. When \fBXmNenableButtonTab\fP is False (default), this action traverses to the first item in the next tab group\&. If the current tab group is the last entry in the tab group list, it wraps to the beginning of the tab group list\&. .IP "" 10 When \fBXmNenableButtonTab\fP is True, this action moves to the next item within the current tab group, unless it is the last item in the tab group\&. When the item is the last in the group, the action traverses to the first item in the next tab group\&. The \fBXmNenableButtonTab\fP behavior applies only to PushButton, ArrowButton, and DrawnArrow\&. .IP "ManagerGadgetPrevTabGroup():" 10 This action depends on the value of the Display resource \fBXmNenableButtonTab\fP\&. When \fBXmNenableButtonTab\fP is False (default), this action traverses to the first item in the previous tab group\&. If the beginning of the tab group list is reached, it wraps to the end of the tab group list\&. .IP "" 10 When \fBXmNenableButtonTab\fP is True, this action moves to the previous item within the current tab group unless it is the first item in the tab group\&. When the item is the first in the group, the action traverses to the first item in the previous tab group\&. The \fBXmNenableButtonTab\fP behavior applies only PushButton, ArrowButton, and DrawnButton\&. .IP "ManagerGadgetSelect():" 10 Causes the current gadget to be armed and activated\&. .IP "\fBManagerGadgetTraverseCurrent\fP" 10 Causes the current gadget to take keyboard focus when \fBCtrl\fP is pressed\&. Gadget is not activated\&. .IP "ManagerGadgetTraverseDown():" 10 Traverses to the next item below the current gadget in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "ManagerGadgetTraverseHome():" 10 Traverses to the first widget or gadget in the current tab group\&. .IP "ManagerGadgetTraverseLeft():" 10 Traverses to the next item to the left of the current gadget in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "ManagerGadgetTraverseNext():" 10 Traverses to the next item in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "ManagerGadgetTraversePrev():" 10 Traverses to the previous item in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "ManagerGadgetTraverseRight()" 10 Traverses to the next item to the right of the current gadget in the current tab, wrapping if necessary\&. widget tab group\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "ManagerGadgetTraverseUp():" 10 Traverses to the next item above the current gadget in the current tab group, wrapping if necessary\&. The wrapping direction depends on the layout direction of the widget tab group\&. .IP "ManagerParentActivate():" 10 If the parent is a manager, passes the \fB\fP event received by the current widget/gadget to its parent\&. .IP "ManagerParentCancel():" 10 If the parent is a manager, passes the \fB\fP event received by the current widget/gadget to its parent\&. .SS "Additional Behavior" .PP This widget has the additional behavior described below: .IP "\fB\fP:" 10 If the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP and the event occurs in a gadget, causes the gadget to be highlighted and to take the focus\&. .IP "\fB\fP:" 10 If the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP and the event occurs in a gadget, causes the gadget to be unhighlighted and to lose the focus\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmDirection\fP(3), \fBXmChangeColor\fP(3), \fBXmGadget\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/WMShell.30000644000175000017500000003354712672140200013346 00000000000000'\" t ...\" WMShell.sgm /main/10 1996/09/08 21:43:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "WMShell" "library call" .SH "NAME" \fBWMShell\fP \(em The WMShell widget class .iX "WMShell" .iX "widget class" "WMShell" .SH "SYNOPSIS" .PP .nf #include #include .fi .SH "DESCRIPTION" .PP WMShell is a top-level widget that encapsulates the interaction with the window manager\&. .SS "Classes" .PP WMShell inherits behavior and resources from the \fBCore\fP, \fBComposite\fP, and \fBShell\fP classes\&. .PP The class pointer is \fBwmShellWidgetClass\fP\&. .PP The class name is \fBWMShell\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBWMShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbaseHeightXmCBaseHeightintXtUnspecifiedShellIntCSG _____ XmNbaseWidthXmCBaseWidthintXtUnspecifiedShellIntCSG _____ XmNheightIncXmCHeightIncintXtUnspecifiedShellIntCSG _____ XmNiconMaskXmCIconMaskPixmapNULLCSG _____ XmNiconPixmapXmCIconPixmapPixmapNULLCSG _____ XmNiconWindowXmCIconWindowWindowNULLCSG _____ XmNiconXXmCIconXintXtUnspecifiedShellIntCSG _____ XmNiconYXmCIconYintXtUnspecifiedShellIntCSG _____ XmNinitialStateXmCInitialStateintNormalStateCSG _____ XmNinputXmCInputBooleanFalseCSG _____ XmNmaxAspectXXmCMaxAspectXintXtUnspecifiedShellIntCSG _____ XmNmaxAspectYXmCMaxAspectYintXtUnspecifiedShellIntCSG _____ XmNmaxHeightXmCMaxHeightintXtUnspecifiedShellIntCSG _____ XmNmaxWidthXmCMaxWidthintXtUnspecifiedShellIntCSG _____ XmNminAspectXXmCMinAspectXintXtUnspecifiedShellIntCSG _____ XmNminAspectYXmCMinAspectYintXtUnspecifiedShellIntCSG _____ XmNminHeightXmCMinHeightintXtUnspecifiedShellIntCSG _____ XmNminWidthXmCMinWidthintXtUnspecifiedShellIntCSG _____ XmNtitleXmCTitleStringdynamicCSG _____ XmNtitleEncodingXmCTitleEncodingAtomdynamicCSG _____ XmNtransientXmCTransientBooleanFalseCSG _____ XmNwaitForWmXmCWaitForWmBooleanTrueCSG _____ XmNwidthIncXmCWidthIncintXtUnspecifiedShellIntCSG _____ XmNwindowGroupXmCWindowGroupWindowdynamicCSG _____ XmNwinGravityXmCWinGravityintdynamicCSG _____ XmNwmTimeoutXmCWmTimeoutint5000 msCSG _____ .TE .IP "\fBXmNbaseHeight\fP" 10 Specifies the base for a progression of preferred heights for the window manager to use in sizing the widget\&. The preferred heights are \fBXmNbaseHeight\fP plus integral multiples of \fBXmNheightInc\fP, with a minimum of \fBXmNminHeight\fP and a maximum of \fBXmNmaxHeight\fP\&. If an initial value is not supplied for \fBXmNbaseHeight\fP but is supplied for \fBXmNbaseWidth\fP, the value of \fBXmNbaseHeight\fP is set to 0 (zero) when the widget is realized\&. .IP "\fBXmNbaseWidth\fP" 10 Specifies the base for a progression of preferred widths for the window manager to use in sizing the widget\&. The preferred widths are \fBXmNbaseWidth\fP plus integral multiples of \fBXmNwidthInc\fP, with a minimum of \fBXmNminWidth\fP and a maximum of \fBXmNmaxWidth\fP\&. If an initial value is not supplied for \fBXmNbaseWidth\fP but is supplied for \fBXmNbaseHeight\fP, the value of \fBXmNbaseWidth\fP is set to 0 (zero) when the widget is realized\&. .IP "\fBXmNheightInc\fP" 10 Specifies the increment for a progression of preferred heights for the window manager to use in sizing the widget\&. The preferred heights are \fBXmNbaseHeight\fP plus integral multiples of \fBXmNheightInc\fP, with a minimum of \fBXmNminHeight\fP and a maximum of \fBXmNmaxHeight\fP\&. If an initial value is not supplied for \fBXmNheightInc\fP but is supplied for \fBXmNwidthInc\fP, the value of \fBXmNheightInc\fP is set to 1 when the widget is realized\&. .IP "\fBXmNiconMask\fP" 10 Specifies a bitmap that could be used by the window manager to clip the \fBXmNiconPixmap\fP bitmap to make the icon nonrectangular\&. .IP "\fBXmNiconPixmap\fP" 10 Specifies a bitmap that could be used by the window manager as the application\&'s icon\&. .IP "\fBXmNiconWindow\fP" 10 Specifies the ID of a window that could be used by the window manager as the application\&'s icon\&. .IP "\fBXmNiconX\fP" 10 Specifies a suitable place to put the application\&'s icon; this is a hint to the window manager in root window coordinates\&. Because the window manager controls icon placement policy, this resource may be ignored\&. .IP "\fBXmNiconY\fP" 10 Specifies a suitable place to put the application\&'s icon; this is a hint to the window manager in root window coordinates\&. Because the window manager controls icon placement policy, this resource may be ignored\&. .IP "\fBXmNinitialState\fP" 10 Specifies the state the application wants the widget instance to start in\&. It must be one of the constants \fBNormalState\fP or \fBIconicState\fP\&. .IP "\fBXmNinput\fP" 10 Specifies the application\&'s input model for this widget and its descendants\&. The meaning of a True or False value for this resource depends on the presence or absence of a WM_TAKE_FOCUS atom in the WM_PROTOCOLS property: .TS tab() box; l| l| l. \fBInput Model\fP\fBXmNinput\fP\fBWM_TAKE_FOCUS\fP ___ No inputFalseAbsent ___ PassiveTrueAbsent ___ Locally activeTruePresent ___ Globally activeFalsePresent ___ .TE .IP "" 10 For more information on input models, see the X Consortium Standard \fIInter-Client Communication Conventions Manual\fP (ICCCM)\&. .IP "\fBXmNmaxAspectX\fP" 10 Specifies the numerator of the maximum aspect ratio (X/Y) that the application wants the widget instance to have\&. .IP "\fBXmNmaxAspectY\fP" 10 Specifies the denominator of the maximum aspect ratio (X/Y) that the application wants the widget instance to have\&. .IP "\fBXmNmaxHeight\fP" 10 Specifies the maximum height that the application wants the widget instance to have\&. .IP "\fBXmNmaxWidth\fP" 10 Specifies the maximum width that the application wants the widget instance to have\&. .IP "\fBXmNminAspectX\fP" 10 Specifies the numerator of the minimum aspect ratio (X/Y) that the application wants the widget instance to have\&. .IP "\fBXmNminAspectY\fP" 10 Specifies the denominator of the minimum aspect ratio (X/Y) that the application wants the widget instance to have\&. .IP "\fBXmNminHeight\fP" 10 Specifies the minimum height that the application wants the widget instance to have\&. .IP "\fBXmNminWidth\fP" 10 Specifies the minimum width that the application wants the widget instance to have\&. .IP "\fBXmNtitle\fP" 10 Specifies the application name to be displayed by the window manager\&. The default is the icon name, if specified; otherwise, it is the name of the application\&. When \fBXtGetValues\fP is called on this resource, the returned value is a pointer to the actual resource value and should not be freed\&. .IP "\fBXmNtitleEncoding\fP" 10 Specifies a property type that represents the encoding of the \fBXmNtitle\fP string\&. If a language procedure has been set, the default is None; otherwise, the default is \fBXA_STRING\fP\&. When the widget is realized, if the value is None, the corresponding name is assumed to be in the current locale\&. The name is passed to \fBXmbTextListToTextProperty\fP with an encoding style of \fBXStdICCTextStyle\fP\&. The resulting encoding is \fBSTRING\fP if the name is fully convertible to \fBSTRING\fP; otherwise it is \fBCOMPOUND_TEXT\fP\&. The values of the encoding resources are not changed; they remain None\&. .IP "\fBXmNtransient\fP" 10 Specifies a Boolean value that is True if the widget instance is transient, typically a popup on behalf of another widget\&. The window manager may treat a transient widget\&'s window differently from other windows\&. For example, a window manager may not iconify a transient window separately from its associated application\&. Applications and users should not normally alter this resource\&. .IP "\fBXmNwaitForWm\fP" 10 When True, specifies that the Intrinsics waits the length of time given by the \fBXmNwmTimeout\fP resource for the window manager to respond to certain actions before assuming that there is no window manager present\&. This resource is altered by the Intrinsics as it receives, or fails to receive, responses from the window manager\&. .IP "\fBXmNwidthInc\fP" 10 Specifies the base for a progression of preferred widths for the window manager to use in sizing the widget\&. The preferred widths are \fBXmNbaseWidth\fP plus integral multiples of \fBXmNwidthInc\fP, with a minimum of \fBXmNminWidth\fP and a maximum of \fBXmNmaxWidth\fP\&. If an initial value is not supplied for \fBXmNwidthInc\fP but is supplied for \fBXmNheightInc\fP, the value of \fBXmNwidthInc\fP is set to 1 when the widget is realized\&. .IP "\fBXmNwindowGroup\fP" 10 Specifies the ID of a window with which this widget instance is associated\&. By convention, this window is the "leader" of a group of windows\&. A window manager may treat all windows in a group in some way; for example, it may always move or iconify them together\&. .IP "" 10 If no initial value is specified, the value is set to the window of the first realized ancestor widget in the parent hierarchy when the widget is realized\&. If a value of \fBXtUnspecifiedWindowGroup\fP is specified, no window group is set\&. .IP "\fBXmNwinGravity\fP" 10 Specifies the window gravity for use by the window manager in positioning the widget\&. If no initial value is specified, the value is set when the widget is realized\&. If \fBXmNgeometry\fP is not NULL, \fBXmNwinGravity\fP is set to the window gravity returned by \fBXWMGeometry\fP\&. Otherwise, \fBXmNwinGravity\fP is set to \fBNorthWestGravity\fP\&. .IP "\fBXmNwmTimeout\fP" 10 Specifies the length of time that the Intrinsics waits for the window manager to respond to certain actions before assuming that there is no window manager present\&. The value is in milliseconds and must not be negative\&. .SS "Inherited Resources" .PP WMShell inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanFalseCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanFalseCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for WMShell\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), and \fBShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmMultiListUnselectItem.30000644000175000017500000000154112672140200016575 00000000000000.TH "XmMultiListUnselectItem" "library call" .SH "NAME" \fBXmMultiListUnselectItem\fP \(em An MultiList function that deselects the specified item of the list .iX "XmMultiListUnselectItem" .iX "Extended List functions" "XmMultiListUnselectItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListUnselectItem\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmMultiListRowInfo *\fBrow_info\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMultiListUnselectItem\fP unselects the row designated by row_info of the passed MultiList widget\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList from whose list an item is unselected\&. .IP "\fIrow_info\fP" 10 Specified the pointer to the row which is to be unselected\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateDrawnButton.30000644000175000017500000000352612672140200015725 00000000000000'\" t ...\" CreDrC.sgm /main/7 1996/08/30 14:33:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateDrawnButton" "library call" .SH "NAME" \fBXmCreateDrawnButton\fP \(em The DrawnButton widget creation function .iX "XmCreateDrawnButton" .iX "creation functions" "XmCreateDrawnButton" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateDrawnButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateDrawnButton\fP creates an instance of a DrawnButton widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of DrawnButton and its associated resources, see \fBXmDrawnButton\fP(3)\&. .SH "RETURN" .PP Returns the DrawnButton widget ID\&. .SH "RELATED" .PP \fBXmDrawnButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmImVaSetFocusValues.30000644000175000017500000000523512672140200016021 00000000000000'\" t ...\" ImVaSetF.sgm /main/9 1996/09/08 20:48:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImVaSetFocusValues" "library call" .SH "NAME" \fBXmImVaSetFocusValues\fP \(em An input manager function that notifies an input manager that a widget has received input focus and updates the input context attributes .iX "XmImVaSetFocusValues" .iX "input manager functions" "XmImVaSetFocusValues" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImVaSetFocusValues\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImVaSetFocusValues\fP notifies the input manager that the specified widget has received input focus\&. This function also updates the attributes of the input context associated with the widget\&. This function passes the attributes and values to \fBXICSetValues\fP\&. The caller of this routine should pass in only those values that have changed since the last call to any of these functions; \fBXmImVaSetValues\fP, \fBXmImVaSetFocusValues\fP, \fBXmImSetValues\fP, or \fBXmImSetFocusValues\fP\&. See the description in the \fBXmImSetValues\fP(3) reference page for a list of associated resources\&. .PP This routine uses the ANSI C variable-length argument list (varargs) calling conventions\&. The variable-length argument list consists of groups of arguments each of which contains an attribute followed by the value of the attribute\&. The last argument in the list must be NULL .PP Note that the List and TextField widgets call the \fBXmImVaSetFocusValues\fP function when they receive focus\&. Therefore, further calls to the \fBXmImVaSetFocusValues\fP function for these widgets are unnecessary\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget registered with the input manager .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .SH "RELATED" .PP \fBXmImSetFocusValues\fP(3), \fBXmImSetValues\fP(3), and \fBXmImVaSetValues\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmRegisterSegmentEncoding.30000644000175000017500000000506612672140200017111 00000000000000'\" t ...\" RegistS.sgm /main/8 1996/09/08 20:56:29 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRegisterSegmentEncoding" "library call" .SH "NAME" \fBXmRegisterSegmentEncoding\fP \(em A compound string function that registers a compound text encoding format for a specified font list element tag .iX "XmRegisterSegment\\%Encoding" .iX "compound string functions" "XmRegisterSegment\\%Encoding" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmRegisterSegmentEncoding\fP\fR( \fBchar *\fBfontlist_tag\fR\fR, \fBchar *\fBct_encoding\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRegisterSegmentEncoding\fP registers a compound text encoding format with the specified font list element tag\&. The \fBXmCvtXmStringToCT\fP function uses this registry to map the font list tags of compound string segments to compound text encoding formats\&. Registering a font list tag that already exists in the registry overwrites the original entry\&. You can unregister a font list tag by passing a NULL value for the \fIct_encoding\fP parameter\&. .IP "\fIfontlist_tag\fP" 10 Specifies the font list element tag to be registered\&. The tag must be a NULL-terminated ISO8859-1 string\&. .IP "\fIct_encoding\fP" 10 Specifies the compound text character set to be used for segments with the font list tag\&. The value must be a NULL-terminated ISO8859-1 string\&. A value of \fBXmFONTLIST_DEFAULT_TAG\fP maps the specified font list tag to the code set of the locale\&. .SH "RETURN" .PP Returns NULL for a new font list tag or the old \fIct_encoding\fP value for an already registered font list tag\&. The application is responsible for freeing the storage associated with the returned data (if any) by calling \fBXtFree\fP\&. .SH "RELATED" .PP \fBXmCvtXmStringToCT\fP(3), \fBXmFontList\fP(3), \fBXmMapSegmentEncoding\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmDataFieldGetStringWcs.30000644000175000017500000000350612672140200016451 00000000000000'\" t ...\" TxtFieAO.sgm /main/8 1996/09/08 21:13:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldGetStringWcs" "library call" .SH "NAME" \fBXmDataFieldGetStringWcs\fP \(em A DataField function that retrieves a copy of the wide character string value of a DataField widget .iX "XmDataFieldGetStringWcs" .iX "DataField functions" "XmDataFieldGetStringWcs" .SH "SYNOPSIS" .PP .nf #include \fBwchar_t * \fBXmDataFieldGetStringWcs\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldGetStringWcs\fP retrieves a copy of the wide character string value of the DataField widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP Returns the wide character string value of the DataField widget\&. The function returns an empty string if the length of the DataField widget\&'s string is 0 (zero)\&. .SH "RELATED" .PP \fBXmDataField\fP(3) and \fBXmDataFieldGetString\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateCascadeButton.30000644000175000017500000000363412672140200016175 00000000000000'\" t ...\" CreCaA.sgm /main/8 1996/09/08 20:32:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateCascadeButton" "library call" .SH "NAME" \fBXmCreateCascadeButton\fP \(em The CascadeButton widget creation function .iX "XmCreateCascadeButton" .iX "creation functions" "XmCreateCascadeButton" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateCascadeButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateCascadeButton\fP creates an instance of a CascadeButton widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. The parent must be a RowColumn widget\&. .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of CascadeButton and its associated resources, see \fBXmCascadeButton\fP(3)\&. .SH "RETURN" .PP Returns the CascadeButton widget ID\&. .SH "RELATED" .PP \fBXmCascadeButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmTabStackSelectTab.30000644000175000017500000000262312672140200015612 00000000000000'\" t .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabStackSelectTab" "library call" .SH "NAME" \fBXmTabStackSelectTab\fP \(em A TabStack function that sets the currently displayed child .iX "XmTabStackSelecttab" .iX "TabStack functions" "XmTabStackSelectTab" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTabStackSelectTab\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBnotify); .fi .SH "DESCRIPTION" .PP \fBXmTabStackSelectTab\fP sets the currently displayed child of the TabStack\&. .IP "\fIwidget\fP" 10 Specifies the TabStack widget ID .IP "\fInotify\fP" 10 Specifies weather to call XmNtabSelectedCallback as usual in response to the change of state .SH "RELATED" .PP \fBXmTabStack\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedFileSelectionBox.30000644000175000017500000000004612672140200020412 00000000000000.so man3/XmVaCreateFileSelectionBox.3 motif-2.3.8/doc/man/man3/XmListSetAddMode.30000644000175000017500000000361712672140200015140 00000000000000'\" t ...\" LstSetAd.sgm /main/8 1996/09/08 20:52:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSetAddMode" "library call" .SH "NAME" \fBXmListSetAddMode\fP \(em A List function that sets add mode in the list .iX "XmListSetAddMode" .iX "List functions" "XmListSetAddMode" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSetAddMode\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBstate\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSetAddMode\fP allows applications control over Add Mode in the extended selection model\&. This function ensures that the mode it sets is compatible with the selection policy (\fBXmNselectionPolicy\fP) of the widget\&. For example, it cannot put the widget into add mode when the value of \fBXmNselectionPolicy\fP is \fBXmBROWSE_SELECT\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIstate\fP" 10 Specifies whether to activate or deactivate Add Mode\&. If \fIstate\fP is True, Add Mode is activated\&. If \fIstate\fP is False, Add Mode is deactivated\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmMultiListDeselectRow.30000644000175000017500000000154712672140200016422 00000000000000.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMultiListDeselectRow" "library call" .SH "NAME" \fBXmMultiListDeselectRow\fP \(em A MultiList function that deselects a row in the list .iX "XmMultiListSelectRow" .iX "MultiList functions" "XmMultiListSelectRow" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListDeselectRow\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBrow\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMultiListDeselectRow\fP unhighlights the specified row in the MultiList widget\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget from whose list an item is deselected\&. .IP "\fIrow\fP" 10 Specifies the row number (starting from 0) to be deselected in the MultiList widget\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmRepTypeGetRegistered.30000644000175000017500000000542112672140200016374 00000000000000'\" t ...\" RepTypGD.sgm /main/8 1996/09/08 20:58:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeGetRegistered" "library call" .SH "NAME" \fBXmRepTypeGetRegistered\fP \(em A representation type manager function that returns a copy of the registration list .iX "XmRepTypeGetRegistered" .iX "representation type manager functions" "XmRepTypeGetRegistered" .SH "SYNOPSIS" .PP .nf #include \fBXmRepTypeList \fBXmRepTypeGetRegistered\fP\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmRepTypeGetRegistered\fP retrieves information about all representation types that are registered with the representation type manager\&. The registration list is an array of structures, each of which contains information for a representation type entry\&. The end of the registration list is marked with a representation type entry whose \fIrep_type_name\fP field has a NULL pointer\&. This routine allocates memory for the returned data\&. The application must free this memory using \fBXtFree\fP\&. .PP The representation type entry structure contains the following information: .PP .nf typedef struct { String \fIrep_type_name\fP; String *\fIvalue_names\fP; unsigned char *\fIvalues\fP; unsigned char \fInum_values\fP; Boolean \fIreverse_installed\fP; XmRepTypeId \fIrep_type_id\fP; } XmRepTypeEntryRec, *XmRepTypeList; \fB\fR(\fBvoid\fR) .fi .IP "\fIrep_type_name\fP" 10 The name of the representation type .IP "\fIvalue_names\fP" 10 An array of representation type value names .IP "\fIvalues\fP" 10 An array of representation type numerical values .IP "\fInum_values\fP" 10 The number of values associated with the representation type .IP "\fIreverse_installed\fP" 10 A flag that indicates whether or not the reverse converter is installed .IP "\fIrep_type_id\fP" 10 The identification number of the representation type .SH "RETURN" .PP Returns a pointer to the registration list of representation types\&. .SH "RELATED" .PP \fBXmRepTypeRegister\fP(3) and \fBXmRepTypeGetRecord\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmVaCreateManagedArrowButtonGadget.30000644000175000017500000000004712672140200020617 00000000000000.so man3/XmVaCreateArrowButtonGadget.3 motif-2.3.8/doc/man/man3/XmImUnsetFocus.30000644000175000017500000000333112672140200014710 00000000000000'\" t ...\" ImUnsetF.sgm /main/9 1996/09/08 20:48:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImUnsetFocus" "library call" .SH "NAME" \fBXmImUnsetFocus\fP \(em An input manager function that notifies an input method that a widget has lost input focus .iX "XmImUnsetFocus" .iX "input manager functions" "XmImUnsetFocus" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImUnsetFocus\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImUnsetFocus\fP unsets a specified widget\&'s focus, then notifies the input manager that the specified widget has lost its input focus\&. .PP Note that the Text, TextField, and List widgets already call the \fBXmImUnsetFocus\fP internally\&. Therefore, further calls to the \fBXmImUnsetFocus\fP function for those widgets are unnecessary\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget registered with the input manager .SH "RELATED" .PP \fBXmImSetFocusValues\fP(3) and \fBXmImVaSetFocusValues\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmStringCreateLocalized.30000644000175000017500000000376212672140200016555 00000000000000'\" t ...\" StrCrB.sgm /main/7 1996/08/30 16:08:43 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringCreateLocalized" "library call" .SH "NAME" \fBXmStringCreateLocalized\fP \(em A compound string function that creates a compound string in the current locale .iX "XmStringCreateLocalized" .iX "compound string functions" "XmStringCreateLocalized" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringCreateLocalized\fP\fR( \fBchar *\fBtext\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringCreateLocalized\fP creates a compound string containing the specified text in the current language environment\&. An identical compound string would result from the function \fBXmStringCreate\fP called with \fBXmFONTLIST_DEFAULT_TAG\fP explicitly as the tag component\&. .PP The function will allocate space to hold the returned compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fItext\fP" 10 Specifies a NULL-terminated string of text encoded in the current language environment to be used as the text component of the compound string .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/MrmFetchColorLiteral.30000644000175000017500000000603212672140200016041 00000000000000'\" t ...\" FetchCol.sgm /main/11 1996/09/24 15:57:42 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmFetchColorLiteral" "library call" .SH "NAME" \fBMrmFetchColorLiteral\fP \(em Fetches a named color literal from a UID file .iX "MrmFetchColorLiteral" .iX "uil functions" "MrmFetchColorLiteral" .iX "uid file" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmFetchColorLiteral\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBString \fBindex\fR\fR, \fBDisplay *\fBdisplay\fR\fR, \fBColormap \fBcolormap_id\fR\fR, \fBPixel *\fBpixel\fR\fR); .fi .iX "MRM function" "MrmFetchColorLiteral" .iX "MrmFetchColorLiteral" "definition" .SH "DESCRIPTION" .PP The \fBMrmFetchColorLiteral\fP function .iX "MrmFetchColorLiteral" "description" fetches a named color literal from a UID file, and converts the color literal to a pixel color value\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of the UID hierarchy that contains the specified literal\&. The value of \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIindex\fP" 10 Specifies the UIL name of the color literal to fetch\&. You must define this name in UIL as an exported value\&. .IP "\fIdisplay\fP" 10 Specifies the display used for the pixmap\&. The \fIdisplay\fP argument specifies the connection to the X server\&. For more information on the \fBDisplay\fR structure, see the Xlib function \fBXOpenDisplay\fP\&. .IP "\fIcolormap_id\fP" 10 Specifies the ID of the color map\&. If \fIcolormap_id\fP is NULL, the default color map is used\&. .IP "\fIpixel\fP" 10 Returns the ID of the color literal\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmNOT_FOUND\fP" 10 The color literal was not found in the UIL file\&. .IP "\fBMrmWRONG_TYPE\fP" 10 The caller tried to fetch a literal of a type not supported by this function\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmFetchBitmapLiteral\fP(3), \fBMrmOpenHierarchyPerDisplay\fP(3), \fBMrmFetchIconLiteral\fP(3), \fBMrmFetchLiteral\fP(3), and \fBXOpenDisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmTextGetInsertionPosition.30000644000175000017500000000337712672140200017342 00000000000000'\" t ...\" TxtGetIn.sgm /main/8 1996/09/08 21:16:49 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetInsertionPosition" "library call" .SH "NAME" \fBXmTextGetInsertionPosition\fP \(em A Text function that accesses the position of the insert cursor .iX "XmTextGetInsertionPosition" .iX "Text functions" "XmTextGetInsertionPosition" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmTextGetInsertionPosition\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetInsertionPosition\fP accesses the insertion cursor position of the Text widget\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns an \fBXmTextPosition\fR value that indicates the state of the \fBXmNcursorPosition\fP resource\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmVaCreateForm.30000644000175000017500000000256312672140200014650 00000000000000.DT .TH "XmVaCreateForm" "library call" .SH "NAME" \fBXmVaCreateForm\fP, \fBXmVaCreateManagedForm\fP \(em A Form widget convenience creation functions\&. .iX "XmVaCreateForm" "XmVaCreateManagedForm" .iX "creation functions" "XmVaCreateForm" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateForm\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedForm\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Form widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateForm\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedForm\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Form and its associated resources, see \fBXmForm\fP(3)\&. .SH "RETURN" .PP Returns the Form widget ID\&. .SH "RELATED" .PP \fBXmForm\fP(3), \fBXmCreateForm\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextFieldReplace.30000644000175000017500000000576112672140200015521 00000000000000'\" t ...\" TxtFieAX.sgm /main/8 1996/09/08 21:15:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldReplace" "library call" .SH "NAME" \fBXmTextFieldReplace\fP \(em A TextField function that replaces part of a text string .iX "XmTextFieldReplace" .iX "TextField functions" "XmTextFieldReplace" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldReplace\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBfrom_pos\fR\fR, \fBXmTextPosition \fBto_pos\fR\fR, \fBchar \fB* value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldReplace\fP replaces part of the text string in the TextField widget\&. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text\&. .PP An example text replacement would be to replace the second and third characters in the text string\&. To accomplish this, the parameter \fIfrom_pos\fP must be 1 and \fIto_pos\fP must be 3\&. To insert a string after the fourth character, both parameters, \fIfrom_pos\fP and \fIto_pos\fP, must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. The \fBXmNmotionVerifyCallback\fP is generated if \fIto_pos\fP is less than or equal to the cursor position and the length of \fIvalue\fP is not the same as the length of the text being replaced, or if the cursor position is between \fIfrom_pos\fP and \fIto_pos\fP, and the distance from the cursor position to \fIfrom_pos\fP is greater than the length of \fIvalue\fP\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIfrom_pos\fP" 10 Specifies the start position of the text to be replaced .IP "\fIto_pos\fP" 10 Specifies the end position of the text to be replaced .IP "\fIvalue\fP" 10 Specifies the character string value to be added to the text widget .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. \fBXmTextFieldReplaceWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextFieldGetBaseline.30000644000175000017500000000370012672140200016317 00000000000000'\" t ...\" TxtFieAF.sgm /main/7 1996/08/30 16:23:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetBaseline" "library call" .SH "NAME" \fBXmTextFieldGetBaseline\fP \(em A TextField function that accesses the y position of the baseline .iX "XmTextFieldGetBaseline" .iX "TextField functions" "XmTextFieldGetBaseline" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextFieldGetBaseline\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetBaseline\fP accesses the \fIy\fP position of the baseline in the TextField widget, relative to the \fIy\fP position of the top of the widget\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns an integer value that indicates the \fIy\fP position of the baseline in the TextField widget\&. The calculation takes into account the margin height, shadow thickness, highlight thickness, and font ascent of the first font (set) in the fontlist used for drawing text\&. In this calculation, the \fIy\fP position of the top of the widget is 0 (zero)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmClipboardWithdrawFormat.30000644000175000017500000000524512672140200017114 00000000000000'\" t ...\" ClipbQ.sgm /main/10 1996/09/25 10:25:35 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardWithdrawFormat" "library call" .SH "NAME" \fBXmClipboardWithdrawFormat\fP \(em A clipboard function that indicates that the application no longer wants to supply a data item .iX "XmClipboardWithdrawFormat" .iX "clipboard functions" "XmClipboardWithdrawFormat" .SH "SYNOPSIS" .PP .nf #include int XmClipboardWithdrawFormat (\fIdisplay, window, data_id\fP) Display \fI* display\fP; Window \fIwindow\fP; long \fIdata_id\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardWithdrawFormat\fP indicates that the application no longer supplies a data item to the clipboard that the application had previously passed by name\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each clipboard function it calls\&. .IP "\fIdata_id\fP" 10 Specifies an identifying number assigned to the data item, that uniquely identifies the data item and the format\&. This was assigned to the item when it was originally passed by \fBXmClipboardCopy\fP\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardCopy\fP(3) and \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmRedisplayWidget.30000644000175000017500000001122612672140200015426 00000000000000'\" t ...\" RedWidg.sgm /main/9 1996/09/08 20:56:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRedisplayWidget" "library call" .SH "NAME" \fBXmRedisplayWidget\fP \(em Synchronously activates the \fBexpose\fP method of a widget to draw its content .SH "SYNOPSIS" .PP .nf #include \fBvoid\fBXmRedisplayWidget\fP\fR( \fBWidget\fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP This function is a convenience routine that hides the details of the Xt internals to the application programmer by calling the \fBexpose\fP method of the given widget with a well formed \fBExpose\fP event and \fBRegion\fP corresponding to the total area of the widget\&. If the widget doesn\&'t have an \fBExpose\fP method, the function does nothing\&. .PP This is primarily used in the context of X Printing if the programming model chosen by the application is \fIsynchronous\fP; that is, it doesn\&'t rely of X Print events for the driving of page layout but wants to completely control the sequence of rendering requests\&. .PP \fBXmRedisplayWidget\fP doesn\&'t clear the widget window prior to calling the \fBexpose\fP method, since this is handled by calls to \fBXpStartPage\fP \&. .IP "\fIwidget\fP" 10 The widget to redisplay\&. .SH "RETURN VALUE" .PP None\&. .SH "ERRORS/WARNINGS" .PP Not applicable .SH "EXAMPLES" .PP In the following, a simple application wants to print the content of a multi-page text widget (similar to \fBdtpad\fP)\&. .PP .nf \f(CWPrintOKCallback(print_dialog\&.\&.\&.) /*-------------*/ { pshell = XmPrintSetup (print_dialog, pbs->print_screen, "Print", NULL, 0); XpStartJob(XtDisplay(pshell), XPSpool); /**** here I realize the shell, get its size, create my widget hierarchy: a bulletin board, and then a text widget, that I stuff with the video text widget buffer */ /* get the total number of pages to print */ XtVaGetValues(ptext, XmNrows, &prows, XmNtotalLines, n_lines, NULL); n_pages = n_lines / prows; /***** now print the pages in a loop */ for (cur_page=0; cur_page != n_pages; cur_page++) { XpStartPage(XtDisplay(pshell), XtWindow(pshell), False); XmRedisplayWidget(ptext); /* do the drawing */ XpEndPage(XtDisplay(pshell)); XmTextScroll(ptext, prows); /* get ready for next page */ } /***** I\&'m done */ XpEndJob(XtDisplay(pshell)); }\fR .fi .PP .PP Of course, one could change the above code to include it in a \fBfork()\fP branch so that the main program is not blocked while printing is going on\&. Another way to achieve a "print-in-the-background" effect is to use an Xt workproc\&. Using the same sample application, that gives us: .PP .nf \f(CWBoolean PrintOnePageWP(XtPointer npages) /* workproc */ /*-------------*/ { static int cur_page = 0; cur_page++; XpStartPage(XtDisplay(pshell), XtWindow(pshell), False); XmRedisplayWidget(ptext); /* do the drawing */ XpEndPage(XtDisplay(pshell)); XmTextScroll(ptext, prows); /* get ready for next page */ if (cur_page == n_pages) { /***** I\&'m done */ XpEndJob(XtDisplay(pshell)); XtDestroyWidget(pshell); XtCloseDisplay(XtDisplay(pshell)); } return (cur_page == n_pages); } PrintOKCallback(\&.\&.\&.) /*-------------*/ { pshell = XmPrintSetup (widget, pbs->print_screen, "Print", NULL, 0); XpStartJob(XtDisplay(pshell), XPSpool); /**** here I get the size of the shell, create my widget hierarchy: a bulletin board, and then a text widget, that I stuff with the video text widget buffer */ /* get the total number of pages to print */ /* \&.\&.\&. same code as above example */ /***** print the pages in the background */ XtAppAddWorkProc(app_context, PrintOnePageWP, n_pages); }\fR .fi .PP .SH "SEE ALSO" .PP \fBXmPrintSetup\fP(3), \fBXmPrintShell\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmCvtByteStreamToXmString.30000644000175000017500000000403112672140200017055 00000000000000'\" t ...\" CvtByteS.sgm /main/7 1996/08/30 14:59:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCvtByteStreamToXmString" "library call" .SH "NAME" \fBXmCvtByteStreamToXmString\fP \(em A compound string function that converts from a compound string in Byte Stream format to a compound string .iX "XmCvtByteStreamToXmString" .iX "compound string functions" "XmCvtByteStreamToXmString" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmCvtByteStreamToXmString\fP\fR( \fBunsigned char *\fBproperty\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCvtByteStreamToXmString\fP converts a stream of bytes representing a compound string in Byte Stream format to a compound string\&. This routine is typically used by the destination of a data transfer operation to produce a compound string from a transferred Byte Stream representation\&. .IP "\fIproperty\fP" 10 Specifies a compound string representation in Byte Stream format\&. .SH "RETURN" .PP Returns a compound string\&. The function allocates space to hold the returned compound string\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXmStringFree\fP\&. .SH "RELATED" .PP \fBXmString\fP(3), \fBXmCvtXmStringToByteStream\fP(3), and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmTrackingLocate.30000644000175000017500000000432212672140200015217 00000000000000'\" t ...\" TrackL.sgm /main/8 1996/09/08 21:11:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTrackingLocate" "library call" .SH "NAME" \fBXmTrackingLocate\fP \(em A Toolkit function that provides a modal interaction .iX "XmTrackingLocate" .iX "Toolkit functions" "XmTrackingLocate" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmTrackingLocate\fP\fR( \fBWidget \fBwidget\fR\fR, \fBCursor \fBcursor\fR\fR, \fBBoolean \fBconfine_to\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTrackingLocate\fP provides a modal interface for selection of a component\&. It is intended to support context help\&. This function is implemented as \fBXmTrackingEvent\fP\&. .PP \fBNOTE:\fP This function is obsolete and exists for compatibility with previous releases\&. It has been replaced by \fBXmTrackingEvent\fP\&. .IP "\fIwidget\fP" 10 Specifies the widget ID of a widget to use as the basis of the modal interaction\&. That is, the widget within which the interaction must occur, usually a top-level shell\&. .IP "\fIcursor\fP" 10 Specifies the cursor to be used for the pointer during the interaction\&. This is a standard X cursor name\&. .IP "\fIconfine_to\fP" 10 Specifies whether or not the cursor should be confined to \fIwidget\fP .SH "RETURN" .PP Returns the widget or gadget that contains the pointer when \fBBSelect\fP is released or a key is released\&. If no widget or gadget contains the pointer, the function returns NULL\&. .SH "RELATED" .PP \fBXmTrackingEvent\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmClipboardUnlock.30000644000175000017500000000562612672140200015410 00000000000000'\" t ...\" ClipbP.sgm /main/10 1996/09/25 10:25:27 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardUnlock" "library call" .SH "NAME" \fBXmClipboardUnlock\fP \(em A clipboard function that unlocks the clipboard .iX "XmClipboardUnlock" .iX "clipboard functions" "XmClipboardUnlock" .SH "SYNOPSIS" .PP .nf #include int XmClipboardUnlock (\fIdisplay, window, remove_all_locks\fP) Display \fI* display\fP; Window \fIwindow\fP; Boolean \fIremove_all_locks\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardUnlock\fP unlocks the clipboard, enabling it to be accessed by other applications\&. .PP If multiple calls to \fBXmClipboardLock\fP have occurred, the same number of calls to \fBXmClipboardUnlock\fP is necessary to unlock the clipboard, unless \fIremove_all_locks\fP is set to True\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIremove_all_locks\fP" 10 When True, indicates that all nested locks should be removed\&. When False, indicates that only one level of lock should be removed\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardFail\fP" 10 The function failed because the clipboard was not locked or was locked by another application\&. .SH "RELATED" .PP \fBXmClipboardCancelCopy\fP(3), \fBXmClipboardCopy\fP(3), \fBXmClipboardEndCopy\fP(3), \fBXmClipboardEndRetrieve\fP(3), \fBXmClipboardInquireCount\fP(3), \fBXmClipboardInquireFormat\fP(3), \fBXmClipboardInquireLength\fP(3), \fBXmClipboardInquirePendingItems\fP(3), \fBXmClipboardLock\fP(3), \fBXmClipboardRegisterFormat\fP(3), \fBXmClipboardRetrieve\fP(3), \fBXmClipboardStartCopy\fP(3), \fBXmClipboardStartRetrieve\fP(3), \fBXmClipboardUndoCopy\fP(3), and \fBXmClipboardWithdrawFormat\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmVaCreateSeparatorGadget.30000644000175000017500000000306612672140200017020 00000000000000.DT .TH "XmVaCreateSeparatorGadget" "library call" .SH "NAME" \fBXmVaCreateSeparatorGadget\fP, \fBXmVaCreateManagedSeparatorGadget\fP \(em A SeparatorGadget widget convenience creation functions\&. .iX "XmVaCreateToggleSeparatorGadget" "XmVaCreateManagedSeparatorGadget" .iX "creation functions" "XmVaCreateSeparatorGadget" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateSeparatorGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedSeparatorGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateSeparatorGadget\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateSeparatorGadget\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of SeparatorGadget and its associated resources, see \fBXmSeparatorGadget\fP(3)\&. .SH "RETURN" .PP Returns the SeparatorGadget widget ID\&. .SH "RELATED" .PP \fBXmSeparatorGadget\fP(3), \fBXmCreateSeparatorGadget\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmParseMappingFree.30000644000175000017500000000303512672140200015515 00000000000000'\" t ...\" ParMapC.sgm /main/7 1996/08/30 15:52:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmParseMappingFree" "library call" .SH "NAME" \fBXmParseMappingFree\fP \(em A compound string function to free a parse mapping .iX "XmParseMappingFree" .iX "compound string functions" "XmParseMappingFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmParseMappingFree\fP\fR( \fBXmParseMapping \fBparse_mapping\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmParseMappingFree\fP recovers memory used by an \fBXmParseMapping\fR\&. .IP "\fIparse_mapping\fP" 10 Specifies the parse mapping to be freed .SH "RELATED" .PP \fBXmParseMapping\fP(3), \fBXmParseMappingCreate\fP(3), \fBXmParseMappingGetValues\fP(3), \fBXmParseMappingSetValues\fP(3), \fBXmParseTable\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmToggleButtonSetState.30000644000175000017500000000436112672140200016422 00000000000000'\" t ...\" ToggleBF.sgm /main/8 1996/09/08 21:10:50 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmToggleButtonSetState" "library call" .SH "NAME" \fBXmToggleButtonSetState\fP \(em A ToggleButton function that sets or changes the current state .iX "XmToggleButtonSetState" .iX "ToggleButton functions" "XmToggleButtonSetState" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmToggleButtonSetState\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBstate\fR\fR, \fBBoolean \fBnotify\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmToggleButtonSetState\fP sets or changes the ToggleButton\&'s current state\&. .IP "\fIwidget\fP" 10 Specifies the ToggleButton widget ID\&. .IP "\fIstate\fP" 10 Specifies a Boolean value that indicates whether the ToggleButton state is selected or unselected\&. If the value is True, the button state is selected; if it is False, the button state is unselected\&. .IP "\fInotify\fP" 10 Indicates whether \fBXmNvalueChangedCallback\fP is called; it can be either True or False\&. The \fBXmNvalueChangedCallback\fP is only called when this function changes the state of the ToggleButton\&. When this argument is True and the ToggleButton is a child of a RowColumn widget whose \fBXmNradioBehavior\fP is True, setting the ToggleButton causes other ToggleButton and ToggleButtonGadget children of the RowColumn to be unselected\&. .PP For a complete definition of ToggleButton and its associated resources, see \fBXmToggleButton\fP(3)\&. .SH "RELATED" .PP \fBXmToggleButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmSimpleSpinBoxDeletePos.30000644000175000017500000000320512672140200016665 00000000000000'\" t ...\" SpinBoxD.sgm /main/6 1996/09/06 09:24:35 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSimpleSpinBoxDeletePos" "library call" .SH "NAME" \fBXmSimpleSpinBoxDeletePos\fP \(em delete a XmSimpleSpinBox item .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmSimpleSpinBoxDeletePos\fP\fR( \fBWidget \fBw\fR\fR, \fBint \fBpos\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmSimpleSpinBoxDeletePos\fP function deletes a specified item from a XmSimpleSpinBox widget\&. .PP The \fIw\fP argument specifies the widget ID\&. .PP The \fIpos\fP argument specifies the position of the item to be deleted\&. A value of 1 means the first item in the list; zero means the last item\&. .SH "RETURN VALUE" .PP The \fBXmSimpleSpinBoxDeletePos\fP function returns no value\&. .SH "SEE ALSO" .PP \fBXmSimpleSpinBox\fP(3), .PP \fBXmSimpleSpinBoxAddItem\fP(3), \fBXmSimpleSpinBoxSetItem\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmListDeletePos.30000644000175000017500000000351612672140200015051 00000000000000'\" t ...\" LstDeleE.sgm /main/7 1996/08/30 15:40:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeletePos" "library call" .SH "NAME" \fBXmListDeletePos\fP \(em A List function that deletes an item from a list at a specified position .iX "XmListDeletePos" .iX "List functions" "XmListDeletePos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeletePos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeletePos\fP deletes an item at a specified position\&. A warning message appears if the position does not exist\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List from which an item is to be deleted\&. .IP "\fIposition\fP" 10 Specifies the position of the item to be deleted\&. A value of 1 indicates that the first item in the list is deleted; a value of 2 indicates that the second item is deleted; and so on\&. A value of 0 (zero) indicates that the last item in the list is deleted\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmIconBoxIsCellEmpty.30000644000175000017500000000340012672140200015775 00000000000000'\" t .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmIconBoxIsCellEmpty" "library call" .SH "NAME" \fBXmIconBoxIsCellEmpty\fP \(em A function that determines whether a cell in the IconBox is empty .iX "XmIconBoxIsCellEmpty" .iX "IconBox functions" "XmIconBoxIsCellEmpty" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmIconBoxIsCellEmpty\fP\fR( \fBPosition \fBcell_x\fR\fR, \fBPosition \fBcell_y\fR\fR, \fBWidget \fBignore\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmIconBoxIsCellEmpty\fP returns \fBTrue\fR if specified cell contains no child and \fBFalse\fR otherwise\&. .IP "\fIwidget\fP" 10 Specifies the IconBox widget ID .IP "\fIcell_x\fP" 10 Specifies the X location of the cell to check .IP "\fIcell_y\fP" 10 Specifies the Y location of the cell to check .IP "\fIignore\fP" 10 If the widget ID specified by \fBignore\fR is present in the specified cell, it will be ignored and the function will return \fBTrue\fR .SH "RETURN" .PP Returns \fBTrue\fR if the specified cell contains no child, and \fBFalse\fR otherwide\&. .SH "RELATED" .PP \fBXmIconBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmListDeselectItem.30000644000175000017500000000334612672140200015535 00000000000000'\" t ...\" LstDeseB.sgm /main/7 1996/08/30 15:41:21 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeselectItem" "library call" .SH "NAME" \fBXmListDeselectItem\fP \(em A List function that deselects the specified item from the selected list .iX "XmListDeselectItem" .iX "List functions" "XmListDeselectItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeselectItem\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeselectItem\fP unhighlights and removes from the selected list the first item in the list that matches \fIitem\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List from whose list an item is deselected\&. .IP "\fIitem\fP" 10 Specifies the item to be deselected from the list\&. If \fIitem\fP appears more than once in the List, only the first occurrence is matched\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmCreateScrolledWindow.30000644000175000017500000000357512672140200016421 00000000000000'\" t ...\" CreScF.sgm /main/8 1996/08/30 14:51:43 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateScrolledWindow" "library call" .SH "NAME" \fBXmCreateScrolledWindow\fP \(em The ScrolledWindow widget creation function .iX "XmCreateScrolledWindow" .iX "creation functions" "XmCreateScrolledWindow" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateScrolledWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateScrolledWindow\fP creates an instance of a ScrolledWindow widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ScrolledWindow and its associated resources, see \fBXmScrolledWindow\fP(3)\&. .SH "RETURN" .PP Returns the ScrolledWindow widget ID\&. .SH "RELATED" .PP \fBXmScrolledWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/TopLevelShell.30000644000175000017500000002321412672140200014543 00000000000000'\" t ...\" TopLevel.sgm /main/9 1996/09/08 21:42:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "TopLevelShell" "library call" .SH "NAME" \fBTopLevelShell\fP \(em The TopLevelShell widget class .iX "TopLevelShell" .iX "widget class" "TopLevelShell" .SH "SYNOPSIS" .PP .nf #include #include .fi .SH "DESCRIPTION" .PP TopLevelShell is used for normal top-level windows such as any additional top-level widgets an application needs\&. .SS "Classes" .PP TopLevelShell inherits behavior and resources from \fBCore\fP, \fBComposite\fP, \fBShell\fP, \fBWMShell\fP, and \fBVendorShell\fP\&. .PP The class pointer is \fBtopLevelShellWidgetClass\fP\&. .PP The class name is \fBTopLevelShell\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBTopLevelShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNiconicXmCIconicBooleanFalseCSG _____ XmNiconNameXmCIconNameStringNULLCSG _____ XmNiconNameEncodingXmCIconNameEncodingAtomdynamicCSG _____ .TE .IP "\fBXmNiconic\fP" 10 If True when the widget is \fIcreated\fP, specifies that the widget should start as an icon when it is realized\&. A value of False indicates that the widget is not to be realized as an icon\&. This resource will only override the \fBXmNinitialState\fP resource when specified in the call that creates the widget\&. .IP "\fBXmNiconName\fP" 10 Specifies the short form of the application name to be displayed by the window manager when the application is iconified\&. When \fBXtGetValues\fP is called on this resource, the returned value is a pointer to the actual resource value and should not be freed\&. .IP "\fBXmNiconNameEncoding\fP" 10 Specifies a property type that represents the encoding of the \fBXmNiconName\fP string\&. If a language procedure has been set, the default is None; otherwise, the default is \fBXA_STRING\fP\&. When the widget is realized, if the value is None, the corresponding name is assumed to be in the current locale\&. The name is passed to \fBXmbTextListToTextProperty\fP with an encoding style of \fBXStdICCTextStyle\fP\&. The resulting encoding is \fBSTRING\fP if the name is fully convertible to \fBSTRING\fP, otherwise \fBCOMPOUND_TEXT\fP\&. The values of the encoding resources are not changed; they remain None\&. .SS "Inherited Resources" .PP TopLevelShell inherits behavior and resources from the following superclasses\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBVendorShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNaudibleWarningXmCAudibleWarningunsigned charXmBELLCSG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNdefaultFontListXmCDefaultFontListXmFontListdynamicCG _____ XmNdeleteResponseXmCDeleteResponseunsigned charXmDESTROYCSG _____ XmNinputMethodXmCInputMethodStringNULLCSG _____ XmNinputPolicyXmCInputPolicyXmInputPolicyXmPER_SHELLCSG _____ XmNkeyboardFocusPolicyXmCKeyboardFocusPolicyunsigned charXmEXPLICITCSG _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTabelXmRenderTabledynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectionXmLEFT_TO_RIGHTCG _____ XmNmwmDecorationsXmCMwmDecorationsint-1CG _____ XmNmwmFunctionsXmCMwmFunctionsint-1CG _____ XmNmwmInputModeXmCMwmInputModeint-1CG _____ XmNmwmMenuXmCMwmMenuStringNULLCG _____ XmNpreeditTypeXmCPreeditTypeStringdynamicCSG _____ XmNshellUnitTypeXmCShellUnitTypeunsigned charXmPIXELSCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNunitTypeXmCUnitTypeunsigned charXmPIXELSCSG _____ XmNuseAsyncGeometryXmCUseAsyncGeometryBooleanFalseCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBWMShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbaseHeightXmCBaseHeightintXtUnspecifiedShellIntCSG _____ XmNbaseWidthXmCBaseWidthintXtUnspecifiedShellIntCSG _____ XmNheightIncXmCHeightIncintXtUnspecifiedShellIntCSG _____ XmNiconMaskXmCIconMaskPixmapNULLCSG _____ XmNiconPixmapXmCIconPixmapPixmapNULLCSG _____ XmNiconWindowXmCIconWindowWindowNULLCSG _____ XmNiconXXmCIconXintXtUnspecifiedShellIntCSG _____ XmNiconYXmCIconYintXtUnspecifiedShellIntCSG _____ XmNinitialStateXmCInitialStateintNormalStateCSG _____ XmNinputXmCInputBooleanTrueCSG _____ XmNmaxAspectXXmCMaxAspectXintXtUnspecifiedShellIntCSG _____ XmNmaxAspectYXmCMaxAspectYintXtUnspecifiedShellIntCSG _____ XmNmaxHeightXmCMaxHeightintXtUnspecifiedShellIntCSG _____ XmNmaxWidthXmCMaxWidthintXtUnspecifiedShellIntCSG _____ XmNminAspectXXmCMinAspectXintXtUnspecifiedShellIntCSG _____ XmNminAspectYXmCMinAspectYintXtUnspecifiedShellIntCSG _____ XmNminHeightXmCMinHeightintXtUnspecifiedShellIntCSG _____ XmNminWidthXmCMinWidthintXtUnspecifiedShellIntCSG _____ XmNtitleXmCTitleStringdynamicCSG _____ XmNtitleEncodingXmCTitleEncodingAtomdynamicCSG _____ XmNtransientXmCTransientBooleanFalseCSG _____ XmNwaitForWmXmCWaitForWmBooleanTrueCSG _____ XmNwidthIncXmCWidthIncintXtUnspecifiedShellIntCSG _____ XmNwindowGroupXmCWindowGroupWindowdynamicCSG _____ XmNwinGravityXmCWinGravityintdynamicCSG _____ XmNwmTimeoutXmCWmTimeoutint5000 msCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanFalseCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanFalseCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for TopLevelShell\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBShell\fP(3), \fBWMShell\fP(3), and \fBVendorShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/MrmOpenHierarchyFromBuffer.30000644000175000017500000000422312672140200017212 00000000000000'\" t ...\" OpenHieB.sgm /main/9 1996/09/08 21:25:53 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmOpenHierarchyFromBuffer" "library call" .SH "NAME" \fBMrmOpenHierarchyFromBuffer\fP \(em Allocates a hierarchy ID and opens a buffer containing a memory image of a UID file .iX "MrmOpenHierarchyFrom\\%Buffer" .iX "uil functions" "MrmOpenHierarchyFrom\\%Buffer" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBCardinal \fBMrmOpenHierarchyFromBuffer\fP\fR( \fBunsigned char \fBuid_buffer\fR\fR, \fBMrmHierarchy *\fBhierarchy_id\fR\fR); .fi .SH "DESCRIPTION" .PP \fBMrmOpenHierarchyFromBuffer\fP allows you to specify a buffer containing information from UID files that MRM searches in subsequent fetch operations\&. This function also allocates a hierarchy ID and initializes the optimized search lists in the hierarchy\&. .IP "\fIbuffer\fP" 10 Specifies a stream of bytes containing information from UID files .IP "\fIhierarchy_id\fP" 10 Returns the search hierarchy ID\&. The search hierarchy ID identifies the buffer that MRM searches when performing subsequent fetch calls\&. .SH "RETURN" .PP This function returns one of the following status return constants: .iX "MrmSUCCESS" .iX "MrmFAILURE" .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmCloseHierarchy\fP(3) and \fBMrmOpenHierarchyPerDisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmStringUnparse.30000644000175000017500000001000212672140200015121 00000000000000'\" t ...\" StrUnp.sgm /main/8 1996/09/08 21:07:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringUnparse" "library call" .SH "NAME" \fBXmStringUnparse\fP \(em A compound string function that unparses text .iX "XmStringUnparse" .SH "SYNOPSIS" .PP .nf #include \fBXtPointer \fBXmStringUnparse\fP\fR( \fBXmString \fBstring\fR\fR, \fBXmStringTag \fBtag\fR\fR, \fBXmTextType \fBtag_type\fR\fR, \fBXmTextType \fBoutput_type\fR\fR, \fBXmParseTable \fBparse_table\fR\fR, \fBCardinal \fBparse_count\fR\fR, \fBXmParseModel \fBparse_model\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringUnparse\fP looks in the input \fIstring\fP for text segments that are tagged with locale or charset tags that match \fItag\fP\&. The \fItag_type\fP parameter specifies whether the tag is a locale or charset type\&. If \fItag\fP has a value of NULL, all the segments are matched\&. When a text segment is found with a matching tag, it is added to the end of a resulting string\&. The characters in the resulting string are of type \fIoutput_type\fP\&. .PP \fBXmStringUnparse\fP also checks \fIstring\fP for components that match components in \fIparse_table\fP, and also to see if the component matches the condition specified by \fIparse_model\fP\&. If the string component matches in both checks, then the associated character is added to the end of the resulting string\&. .IP "\fIstring\fP" 10 Specifies the \fBXmString\fR to be converted\&. .IP "\fItag\fP" 10 Specifies the tag to be used in matching with text segments\&. Only text segments that match \fItag\fP will be included in the resulting string\&. If \fItag\fP has a value of NULL, all segments are considered as matches, and \fItag_type\fP is ignored\&. .IP "\fItag_type\fP" 10 Specifies the type of tag to be searched for, including \fBXmMULTIBYTE_TEXT\fP, \fBXmWIDECHAR_TEXT\fP, and \fBXmCHARSET_TEXT\fP\&. .IP "\fIoutput_type\fP" 10 Specifies the type of text to be returned in the string, including \fBXmMULTIBYTE_TEXT\fP, \fBXmWIDECHAR_TEXT\fP, and \fBXmCHARSET_TEXT\fP\&. .IP "\fIparse_table\fP" 10 Specifies the parse table to be used in scanning for compound string components to be converted to other characters\&. .IP "\fIparse_count\fP" 10 Specifies how many entries are in \fIparse_table\fP\&. .IP "\fIparse_model\fP" 10 Specifies which non-text components to be considered in matching in \fIparse_table\fP\&. These include: .RS .IP "\fBXmOUTPUT_ALL\fP" 10 Puts out all matching components\&. .IP "\fBXmOUTPUT_BETWEEN\fP" 10 Puts out only those matching components that are between two matching text components\&. .IP "\fBXmOUTPUT_BEGINNING\fP" 10 Puts out only those matching components that are at the beginning of a matching text component\&. .IP "\fBXmOUTPUT_END\fP" 10 Puts out only those matching components that are at the end of a matching text component\&. .IP "\fBXmOUTPUT_BOTH\fP" 10 Puts out only those matching components that are at the beginning or end of a matching text component\&. .RE .SH "RETURN" .PP Returns a newly allocated string containing characters of a type determined by \fIoutput_type\fP\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXtFree\fP\&. .SH "RELATED" .PP \fBXmString\fP(3), \fBXmParseTable\fP(3), \fBXmParseMapping\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/MrmFetchIconLiteral.30000644000175000017500000000711712672140200015660 00000000000000'\" t ...\" FetchIco.sgm /main/11 1996/09/24 15:57:52 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmFetchIconLiteral" "library call" .SH "NAME" \fBMrmFetchIconLiteral\fP \(em Fetches an icon literal from a hierarchy .iX "MrmFetchIconLiteral" .iX "uil functions" "MrmFetchIconLiteral" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmFetchIconLiteral\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBString \fBindex\fR\fR, \fBScreen *\fBscreen\fR\fR, \fBDisplay *\fBdisplay\fR\fR, \fBPixel \fBfgpix\fR\fR, \fBPixel \fBbgpix\fR\fR, \fBPixmap *\fBpixmap\fR\fR); .fi .iX "MRM function" "MrmFetchIconLiteral" .iX "MrmFetchIconLiteral" "definition" .SH "DESCRIPTION" .PP The \fBMrmFetchIconLiteral\fP function .iX "MrmFetchIconLiteral" "description" fetches an icon literal from an MRM hierarchy and converts the icon literal to an X pixmap\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of the UID hierarchy that contains the specified icon literal\&. The \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIindex\fP" 10 Specifies the UIL name of the icon literal to fetch\&. .IP "\fIscreen\fP" 10 Specifies the screen used for the pixmap\&. The \fIscreen\fP argument specifies a pointer to the Xlib structure \fBScreen\fR, which contains the information about that screen and is linked to the \fBDisplay\fR structure\&. For more information on the \fBDisplay\fR and \fBScreen\fR structures, see the Xlib function \fBXOpenDisplay\fP and the associated screen information macros\&. .IP "\fIdisplay\fP" 10 Specifies the display used for the pixmap\&. The \fIdisplay\fP argument specifies the connection to the X server\&. For more information on the \fBDisplay\fR structure, see the Xlib function \fBXOpenDisplay\fP\&. .IP "\fIfgpix\fP" 10 Specifies the foreground color for the pixmap\&. .IP "\fIbgpix\fP" 10 Specifies the background color for the pixmap\&. .IP "\fIpixmap\fP" 10 Returns the resulting X pixmap value\&. The function allocates space for this pixmap\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmDestroyPixmap\fP\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmNOT_FOUND\fP" 10 The icon literal was not found in the hierarchy\&. .IP "\fBMrmWRONG_TYPE\fP" 10 The caller tried to fetch a literal of a type not supported by this function\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmFetchBitmapLiteral\fP(3), \fBMrmOpenHierarchyPerDisplay\fP(3), \fBMrmFetchLiteral\fP(3), \fBMrmFetchColorLiteral\fP(3), and \fBXOpenDisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmStringGetNextComponent.30000644000175000017500000001135112672140200016755 00000000000000'\" t ...\" StrGeC.sgm /main/9 1996/09/08 21:05:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringGetNextComponent" "library call" .SH "NAME" \fBXmStringGetNextComponent\fP \(em A compound string function that returns the type and value of the next component in a compound string .iX "XmStringGetNextComponent" .iX "compound string functions" "XmStringGetNextComponent" .SH "SYNOPSIS" .PP .nf #include \fBXmStringComponentType \fBXmStringGetNextComponent\fP\fR( \fBXmStringContext \fBcontext\fR\fR, \fBchar **\fBtext\fR\fR, \fBXmStringTag *\fBtag\fR\fR, \fBXmStringDirection *\fBdirection\fR\fR, \fBXmStringComponentType *\fBunknown_tag\fR\fR, \fBunsigned short *\fBunknown_length\fR\fR, \fBunsigned char **\fBunknown_value\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmStringGetNextTriple\fP\&. \fBXmStringGetNextComponent\fP returns the type and value of the next component in the compound string identified by \fIcontext\fP\&. Components are returned one at a time\&. On return, only some output parameters will be valid; which ones can be determined by examining the returned component type\&. The following table describes the valid returns for each component type\&. .TS tab() box; lw(2.0i)| l. \fBValid Fields\fP\fBComponent Type\fP __ \fItag\fPT{ \fBXmSTRING_COMPONENT_LOCALE, XmSTRING_COMPONENT_TAG\fP T} __ \fItext\fPT{ \fBXmSTRING_COMPONENT_LOCALE_TEXT, XmSTRING_COMPONENT_TEXT, XmSTRING_COMPONENT_WIDECHAR_TEXT\fP T} __ \fIdirection\fP\fBXmSTRING_COMPONENT_DIRECTION\fP __ T{ \fIunknown_tag, unknown_length, unknown_value\fP T}T{ \fBXmSTRING_COMPONENT_LAYOUT_POP, XmSTRING_COMPONENT_LAYOUT_PUSH, XmSTRING_COMPONENT_TAB, XmSTRING_COMPONENT_RENDITION_BEGIN, XmSTRING_COMPONENT_RENDITION_END\fP T} __ \fIno valid field\fPT{ \fBXmSTRING_COMPONENT_SEPARATOR, XmSTRING_COMPONENT_END, XmSTRING_COMPONENT_UNKNOWN\fP T} __ .TE .PP Note that several components produce a return value of \fBXmSTRING_COMPONENT_UNKNOWN\fP\&. The data returned by these components is returned in the \fIunknown_tag\fP, \fIunknown_length\fP, and \fIunknown_value\fP fields\&. This apparent inconsistency is designed to accomodate older applications that may not be equipped to handle the newer component types of Motif version 2\&.0 and beyond\&. Consequently, the use of this procedure is not recommended\&. Instead, use the \fBXmStringGetNextTriple\fP procedure, which provides all the functionality of \fBXmStringGetNextComponent\fP, and is fully compatible with the newer component types\&. .PP If the function return value is \fBXmSTRING_COMPONENT_LOCALE_TEXT\fP or \fBXmSTRING_COMPONENT_TEXT\fP, the the function allocates space to hold the returned \fItext\fP\&. If the function return value is \fBXmSTRING_COMPONENT_FONTLIST_ELEMENT_TAG\fP, or \fBXmSTRING_COMPONENT_TAG\fP, then the function allocates space to hold the returned \fItag\fP\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXtFree\fP\&. .IP "\fIcontext\fP" 10 Specifies the string context structure that was allocated by the \fBXmStringInitContext\fP function\&. .IP "\fItext\fP" 10 Specifies a pointer to a NULL terminated string\&. .IP "\fItag\fP" 10 Specifies a pointer to the tag component associated with the text\&. The value \fBXmFONTLIST_DEFAULT_TAG\fP identifies a locale text segment\&. .IP "\fIdirection\fP" 10 Specifies a pointer to the direction of the text\&. .IP "\fIunknown_tag\fP" 10 Specifies a pointer to the tag of an unknown component\&. .IP "\fIunknown_length\fP" 10 Specifies a pointer to the length of an unknown component\&. .IP "\fIunknown_value\fP" 10 Specifies a pointer to the value of an unknown component\&. .SH "RETURN" .PP Returns the type of component found\&. Refer to the \fBXmStringComponentType\fP(3) reference page for a list of component types\&. .SH "RELATED" .PP \fBXmStringComponentType\fP(3), \fBXmStringCreate\fP(3), and \fBXmStringInitContext\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmTextFieldInsertWcs.30000644000175000017500000000510312672140200016055 00000000000000'\" t ...\" TxtFieAS.sgm /main/8 1996/09/08 21:14:29 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldInsertWcs" "library call" .SH "NAME" \fBXmTextFieldInsertWcs\fP \(em A TextField function that inserts a wide character string into a TextField widget .iX "XmTextFieldInsertWcs" .iX "TextField functions" "XmTextFieldInsertWcs" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldInsertWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR, \fBwchar_t *\fBwcstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldInsertWcs\fP inserts a wide character string into the TextField widget at a specified location\&. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text\&. For example, to insert a string after the fourth character, the \fIposition\fP parameter must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as \fIposition\fP, the \fBXmNmotionVerifyCallback\fP is called\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIposition\fP" 10 Specifies the position in the text string where the new character string is to be inserted .IP "\fIwcstring\fP" 10 Specifies the wide character string value to be added to the TextField widget .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldInsert\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmCreateTextField.30000644000175000017500000000347512672140200015351 00000000000000'\" t ...\" CreTeC.sgm /main/7 1996/08/30 14:57:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateTextField" "library call" .SH "NAME" \fBXmCreateTextField\fP \(em The TextField widget creation function .iX "XmCreateTextField" .iX "creation functions" "XmCreateTextField" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateTextField\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateTextField\fP creates an instance of a TextField widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns the TextField widget ID\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmImVaSetValues.30000644000175000017500000000462212672140200015020 00000000000000'\" t ...\" ImVaSetV.sgm /main/9 1996/09/08 20:48:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImVaSetValues" "library call" .SH "NAME" \fBXmImVaSetValues\fP \(em An input manager function that updates attributes of an input context .iX "XmImVaSetValues" .iX "input manager functions" "XmImVaSetValues" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImVaSetValues\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImVaSetValues\fP updates attributes of the input context associated with the specified widget\&. This function passes the attributes to \fBXICSetValues\fP\&. The initial call to this routine should pass in all of the input context attributes\&. Thereafter, the application programmer calls \fBXmImVaSetValues\fP only if a value has changed\&. See the description in the \fBXmImSetValues\fP(3) man page for a list of associated resources\&. .PP This routine uses the ANSI C variable-length argument list (varargs) calling convention\&. The variable-length argument list consists of groups of arguments each of which contains an attribute followed by the value of the attribute\&. The last argument in the list must be NULL\&. .PP Note that the List and TextField widgets call the \fBXmImVaSetValues\fP function internally\&. Therefore, further calls to the \fBXmImVaSetValues\fP function for these widgets are unnecessary\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget registered with the input manager .PP For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation\&. .SH "RELATED" .PP \fBXmImSetFocusValues\fP(3), \fBXmImSetValues\fP(3), and \fBXmImVaSetFocusValues\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmDropSite.30000644000175000017500000004712012672140200014061 00000000000000'\" t ...\" DropSit.sgm /main/11 1996/09/08 20:40:45 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSite" "library call" .SH "NAME" \fBXmDropSite\fP \(em The DropSite Registry .iX "XmDropSite" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP A client registers a widget or gadget as a drop site using the \fBXmDropSiteRegister\fP function\&. In addition, this routine defines the behavior and capabilities of a drop site by specifying appropriate resources\&. For example, the \fBXmNimportTargets\fP and \fBXmNnumImportTargets\fP resources identify respectively the selection target types and number of types supported by a drop site\&. The visual animation effects associated with a drop site are also described with DropSite resources\&. .PP Drop site animation effects that occur in response to the pointer entering a valid drop site are called drag-under effects\&. A receiver can select from several animation styles supplied by the toolkit or can provide customized animation effects\&. Drag-under effects supplied by the toolkit include border highlighting, shadow in/out drawing, and pixmap representation\&. .PP When a preregister drag protocol style is used, the toolkit generates drag-under visual effects based on the value of the \fBXmNanimationStyle\fP resource\&. In dynamic mode, if the drop site \fBXmNdragProc\fP resource is NULL, the toolkit also provides animation effects based on the \fBXmNanimationStyle\fP resource\&. Otherwise, if the \fBXmNdragProc\fP routine is specified, the receiver can either assume responsibility for animation effects (through the \fBXmNdragProc\fP routine) or rely on the toolkit to provide animation\&. An application can either handle all or none of the animation effects for a particular drop site\&. That is, an application should never do a partial job of animation on a particular drop site\&. .PP Drop sites may overlap\&. The initial stacking order corresponds to the order in which the drop sites were registered\&. When a drop site overlaps another drop site, the drag-under effects of the drop site underneath are clipped by the obscuring drop site(s)\&. .PP The \fBXmDropSiteUpdate\fP routine sets resources for a widget that is registered as a drop site\&. \fBXmDropSiteRetrieve\fP gets drop site resource values previously specified for a registered widget\&. These routines are used instead of \fBXtSetValues\fP and \fBXtGetValues\fP\&. .SS "Classes" .PP XmDropSite does not inherit from any widget class\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXmDropSiteUpdate\fP (S), retrieved by using \fBXmDropSiteRetrieve\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDropSite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNanimationMaskXmCAnimationMaskPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNanimationPixmapXmCAnimationPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNanimationPixmapDepthXmCAnimationPixmapDepthint0CSG _____ XmNanimationStyleXmCAnimationStyleunsigned charXmDRAG_UNDER_HIGHLIGHTCSG _____ XmNdragProcXmCDragProcXtCallbackProcNULLCSG _____ XmNdropProcXmCDropProcXtCallbackProcNULLCSG _____ XmNdropRectanglesXmCDropRectanglesXRectangle *dynamicCSG _____ XmNdropSiteActivityXmCDropSiteActivityunsigned charXmDROP_SITE_ACTIVECSG _____ XmNdropSiteOperationsXmCDropSiteOperationsunsigned charXmDROP_MOVE | XmDROP_COPYCSG _____ XmNdropSiteTypeXmCDropSiteTypeunsigned charXmDROP_SITE_SIMPLECG _____ XmNimportTargetsXmCImportTargetsAtom *NULLCSG _____ XmNnumDropRectanglesXmCNumDropRectanglesCardinal1CSG _____ XmNnumImportTargetsXmCNumImportTargetsCardinal0CSG _____ .TE .IP "\fBXmNanimationMask\fP" 10 Specifies a mask to use with the pixmap specified by \fBXmNanimationPixmap\fP when the animation style is \fBXmDRAG_UNDER_PIXMAP\fP\&. .IP "\fBXmNanimationPixmap\fP" 10 Specifies a pixmap for drag-under animation when the animation style is \fBXmDRAG_UNDER_PIXMAP\fP\&. The pixmap is drawn with its origin at the upper left corner of the bounding box of the drop site\&. If the drop site window is larger than the animation pixmap, the portion of the window not covered by the pixmap will be tiled with the window\&'s background color\&. .IP "\fBXmNanimationPixmapDepth\fP" 10 Specifies the depth of the pixmap specified by the \fBXmNanimationPixmap\fP resource\&. When the depth is 1, the colors are taken from the foreground and background of the drop site widget\&. For any other value, drop site animation occurs only if the \fBXmNanimationPixmapDepth\fP matches the depth of the drop site window\&. Colors are derived from the current colormap\&. .IP "\fBXmNanimationStyle\fP" 10 Specifies the drag-under animation style used when a drag enters a valid drop site\&. The possible values are .RS .IP "\fBXmDRAG_UNDER_HIGHLIGHT\fP" 10 The drop site uses highlighting effects\&. .IP "\fBXmDRAG_UNDER_SHADOW_OUT\fP" 10 The drop site uses an outset shadow\&. .IP "\fBXmDRAG_UNDER_SHADOW_IN\fP" 10 The drop site uses an inset shadow\&. .IP "\fBXmDRAG_UNDER_PIXMAP\fP" 10 The drop site uses the pixmap specified by \fBXmNanimationPixmap\fP to indicate that it can receive the drop\&. .IP "\fBXmDRAG_UNDER_NONE\fP" 10 The drop site does not use animation effects\&. A client using a dynamic protocol, may provide drag-under effects in its \fBXmNdragProc\fP routine\&. .RE .IP "\fBXmNdragProc\fP" 10 Specifies the procedure that is invoked when the drop site receives a crossing, motion, or operation changed message\&. This procedure is called only when a dynamic protocol is used\&. The type of structure whose address is passed to this procedure is \fBXmDragProcCallbackStruct\fR\&. The reason sent to the procedure is one of the following: .RS .IP " \(bu" 6 \fBXmCR_DROP_SITE_ENTER_MESSAGE\fP .IP " \(bu" 6 \fBXmCR_DROP_SITE_LEAVE_MESSAGE\fP .IP " \(bu" 6 \fBXmCR_DRAG_MOTION\fP .IP " \(bu" 6 \fBXmCR_OPERATION_CHANGED\fP .RE .IP "" 10 The drag procedure may change the values of some members of the \fBXmDragProcCallbackStruct\fR passed to it\&. After the drag procedure returns, the toolkit uses the final values in initializing some members of the callback structure passed to the appropriate callbacks of the initiator (the DragContext\&'s \fBXmNdropSiteEnterCallback\fP, \fBXmNdropSiteLeaveCallback\fP, \fBXmNdragMotionCallback\fP, or \fBXmNoperationChangedCallback\fP callbacks)\&. .IP "\fBXmNdropProc\fP" 10 Specifies the procedure that is invoked when a drop (excluding a cancel or interrupt action) occurs on a drop site regardless of the status of the drop site\&. The type of the structure whose address is passed to this procedure is \fBXmDropProcCallbackStruct\fR\&. The reason sent to the procedure is \fBXmCR_DROP_MESSAGE\fP\&. .IP "" 10 The drop procedure may change the values of some members of the \fBXmDropProcCallbackStruct\fR passed to it\&. After the drop procedure returns, the toolkit uses the final values in initializing some members of the \fBXmDropStartCallbackStruct\fR passed to the initiator\&'s drop start callbacks (the DragContext\&'s \fBXmNdropStartCallback\fP callbacks)\&. .IP "\fBXmNdropRectangles\fP" 10 Specifies a list of rectangles that describe the shape of a drop site\&. The locations of the rectangles are relative to the origin of the enclosing object\&. When \fBXmNdropRectangles\fP is NULL, the drop site is assumed to be the sensitive area of the enclosing widget\&. If \fBXmNdropSiteType\fP is \fBXmDROP_SITE_COMPOSITE\fP, this resource cannot be specified by the application\&. .IP "" 10 Retrieving this resource returns allocated memory that needs to be freed with the \fBXtFree\fP function\&. .IP "\fBXmNdropSiteActivity\fP" 10 Indicates whether a drop site is active or inactive\&. The values are \fBXmDROP_SITE_ACTIVE\fP, \fBXmDROP_SITE_INACTIVE\fP, and \fBXmDROP_SITE_IGNORE\fP\&. An active drop site can receive a drop, whereas an inactive drop site is dormant\&. An inactive drop site is treated as if it was not a registered drop site and any drag-under visuals associated with entering or leaving the drop site do not occur\&. However, it is still used for clipping drag-under effects\&. A value of \fBXmDROP_SITE_IGNORE\fP indicates that a drop site should be ignored for all purposes\&. .IP "\fBXmNdropSiteOperations\fP" 10 Specifies the set of valid operations associated with a drop site\&. This resource is a bit mask that is formed by combining one or more of the following values using a bitwise operation such as inclusive OR (|): \fBXmDROP_COPY\fP, \fBXmDROP_LINK\fP, and \fBXmDROP_MOVE\fP\&. The value \fBXmDROP_NOOP\fP for this resource indicates that no operations are valid\&. .IP "\fBXmNdropSiteType\fP" 10 Specifies the type of the drop site\&. The possible values are .RS .IP "\fBXmDROP_SITE_SIMPLE\fP" 10 The widget does not have any additional children that are registered as drop sites\&. .IP "\fBXmDROP_SITE_COMPOSITE\fP" 10 The widget will have children that are registered as drop sites\&. .RE .IP "\fBXmNimportTargets\fP" 10 Specifies the list of target atoms that this drop site accepts\&. .IP "\fBXmNnumDropRectangles\fP" 10 Specifies the number of rectangles in the \fBXmNdropRectangles\fP list\&. If the drop site type is \fBXmDROP_SITE_COMPOSITE\fP, this resource can not be specified by the application\&. .IP "\fBXmNnumImportTargets\fP" 10 Specifies the number of atoms in the target atom list\&. .SS "Callback Information" .PP A pointer to the following structure is passed to the \fBXmNdragProc\fP routine when the drop site receives crossing, motion, or operation changed messages: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; Widget \fIdragContext\fP; Position \fIx\fP; Position \fIy\fP; unsigned char \fIdropSiteStatus\fP; unsigned char \fIoperation\fP; unsigned char \fIoperations\fP; Boolean \fIanimate\fP; } XmDragProcCallbackStruct, *XmDragProcCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the timestamp of the logical event\&. .IP "\fIdragContext\fP" 10 Specifies the ID of the DragContext widget associated with the transaction\&. .IP "\fIx\fP" 10 Indicates the x-coordinate of the pointer relative to the drop site\&. .IP "\fIy\fP" 10 Indicates the y-coordinate of the pointer relative to the drop site\&. .IP "\fBdropSiteStatus\fP" 10 An IN/OUT member that indicates whether or not a drop site is valid\&. .IP "" 10 When \fIreason\fP is \fBXmCR_DROP_SITE_ENTER_MESSAGE\fP or \fBXmCR_OPERATION_CHANGED\fP, or \fIreason\fP is \fBXmCR_DRAG_MOTION\fP or \fBXmCR_DROP_SITE_LEAVE_MESSAGE\fP and the pointer is not in the same drop site as on the previous invocation of the drag procedure, the toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_VALID\fP if the DragContext\&'s \fBXmNexportTargets\fP and the DropSite\&'s \fBXmNimportTargets\fP are compatible and if the initial value of the \fIoperation\fP member is not \fBXmDROP_NOOP\fP\&. Otherwise, the toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_INVALID\fP\&. .IP "" 10 When the \fIreason\fP is \fBXmCR_DRAG_MOTION\fP or \fBXmCR_DROP_SITE_LEAVE_MESSAGE\fP and the pointer is within the same drop site as on the previous invocation of the drag procedure, the toolkit initializes \fBdropSiteStatus\fP to the value of \fBdropSiteStatus\fP at the time the previous invocation of the drag procedure returns\&. .IP "" 10 The drag procedure may change the value of this member\&. After the drag procedure returns, the toolkit uses the final value in initializing the \fBdropSiteStatus\fP member of the callback struct passed to the appropriate callbacks of the initiator\&. .IP "\fIoperation\fP" 10 An IN/OUT member that identifies an operation\&. .IP "" 10 The toolkit initializes \fIoperation\fP by selecting an operation from the bitwise AND of the initial value of the \fIoperations\fP member and the value of the DropSite\&'s \fBXmNdropSiteOperations\fP resource\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If the toolkit finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 The drag procedure may change the value of this member\&. After the drag procedure returns, the toolkit uses the final value in initializing the \fIoperation\fP member of the callback struct passed to the appropriate callbacks of the initiator\&. .IP "\fIoperations\fP" 10 An IN/OUT member that indicates the set of operations supported for the source data\&. .IP "" 10 If the user does not select an operation (by pressing a modifier key), the toolkit initializes \fIoperations\fP to the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the user does select an operation, the toolkit initializes \fIoperations\fP to the bitwise AND of the corresponding operation and the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 The drag procedure may change the value of this member\&. After the drag procedure returns, the toolkit uses the final value in initializing the \fIoperations\fP member of the callback struct passed to the appropriate callbacks of the initiator\&. .IP "\fIanimate\fP" 10 An OUT member that indicates whether the toolkit or the receiver client provides drag-under effects for a valid drop site\&. If \fIanimate\fP is set to True, the toolkit provides drop site animation per the \fBXmNanimationStyle\fP resource value; if it is set to False, the receiver generates drag-under animation effects\&. .PP A pointer to the following structure is passed to the \fBXmNdropProc\fP routine when the drop site receives a drop message: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Time \fItimeStamp\fP; Widget \fIdragContext\fP; Position \fIx\fP; Position \fIy\fP; unsigned char \fIdropSiteStatus\fP; unsigned char \fIoperation\fP; unsigned char \fIoperations\fP; unsigned char \fIdropAction\fP; } XmDropProcCallbackStruct, *XmDropProcCallback; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Specifies the \fBXEvent\fP that triggered the callback\&. .IP "\fBtimeStamp\fP" 10 Specifies the timestamp of the logical event\&. .IP "\fIdragContext\fP" 10 Specifies the ID of the DragContext widget associated with the transaction\&. .IP "\fIx\fP" 10 Indicates the x-coordinate of the pointer relative to the drop site\&. .IP "\fIy\fP" 10 Indicates the y-coordinate of the pointer relative to the drop site\&. .IP "\fBdropSiteStatus\fP" 10 An IN/OUT member that indicates whether or not a drop site is valid\&. .IP "" 10 The toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_VALID\fP if the DragContext\&'s \fBXmNexportTargets\fP and the DropSite\&'s \fBXmNimportTargets\fP are compatible and if the initial value of the \fIoperation\fP member is not \fBXmDROP_NOOP\fP\&. Otherwise, the toolkit initializes \fBdropSiteStatus\fP to \fBXmDROP_SITE_INVALID\fP\&. .IP "" 10 The drop procedure may change the value of this member\&. After the drop procedure returns, the toolkit uses the final value in initializing the \fBdropSiteStatus\fP member of the \fBXmDropStartCallbackStruct\fR passed to the initiator\&'s drop start callbacks (the DragContext\&'s \fBXmNdropStartCallback\fP callbacks)\&. .IP "\fIoperation\fP" 10 An IN/OUT member that identifies an operation\&. .IP "" 10 The toolkit initializes \fIoperation\fP by selecting an operation from the bitwise AND of the initial value of the \fIoperations\fP member and the value of the DropSite\&'s \fBXmNdropSiteOperations\fP resource\&. The toolkit searches this set first for \fBXmDROP_MOVE\fP, then for \fBXmDROP_COPY\fP, then for \fBXmDROP_LINK\fP, and initializes \fIoperation\fP to the first operation it finds in the set\&. If it finds none of these operations in the set, it initializes \fIoperation\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 The drop procedure may change the value of this member\&. After the drop procedure returns, the toolkit uses the final value in initializing the \fIoperation\fP member of the \fBXmDropStartCallbackStruct\fR passed to the initiator\&'s drop start callbacks (the DragContext\&'s \fBXmNdropStartCallback\fP callbacks)\&. .IP "\fIoperations\fP" 10 An IN/OUT member that indicates the set of operations supported for the source data\&. .IP "" 10 If the user does not select an operation (by pressing a modifier key), the toolkit initializes \fIoperations\fP to the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the user does select an operation, the toolkit initializes \fIoperations\fP to the bitwise AND of the corresponding operation and the value of the DragContext\&'s \fBXmNdragOperations\fP resource\&. If the resulting set of operations is empty, the toolkit initializes \fIoperations\fP to \fBXmDROP_NOOP\fP\&. .IP "" 10 The drop procedure may change the value of this member\&. After the drop procedure returns, the toolkit uses the final value in initializing the \fIoperations\fP member of the \fBXmDropStartCallbackStruct\fR passed to the initiator\&'s drop start callbacks (the DragContext\&'s \fBXmNdropStartCallback\fP callbacks)\&. .IP "\fBdropAction\fP" 10 An IN/OUT member that identifies the action associated with the drop\&. The possible values are .RS .IP "\fBXmDROP\fP" 10 A drop was attempted\&. If the drop site is valid, drop transfer handling proceeds\&. .IP "\fBXmDROP_HELP\fP" 10 The user has requested help on the drop site\&. .RE .IP "" 10 The drop procedure may change the value of this member\&. After the drop procedure returns, the toolkit uses the final value in initializing the \fBdropAction\fP member of the \fBXmDropStartCallbackStruct\fR passed to the initiator\&'s drop start callbacks (the DragContext\&'s \fBXmNdropStartCallback\fP callbacks)\&. .SH "RELATED INFORMATION" .PP \fBXmDragContext\fP(3), \fBXmDragIcon\fP(3), \fBXmDropSiteConfigureStackingOrder\fP(3), \fBXmDropSiteEndUpdate\fP(3), \fBXmDropSiteQueryStackingOrder\fP(3), \fBXmDropSiteRegister\fP(3), \fBXmDropSiteStartUpdate\fP(3), \fBXmDropSiteUpdate\fP(3), \fBXmDropSiteUnregister\fP(3), \fBXmDropTransfer\fP(3), and \fBXmTargetsAreCompatible\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmMultiListDeselectItems.30000644000175000017500000000202112672140200016720 00000000000000.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMultiListDeselectItems" "library call" .SH "NAME" \fBXmMultiListDeselectItems\fP \(em A MultiList function that deselects items in the list by matching column entries .iX "XmMultiListDeselectItems" .iX "List functions" "XmMultiListDeselectItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListDeselectItems\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR, \fBint \fBcolumn\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMultiListDeselectItems\fP unhighlights rows in the list where column number \fIcolumn\fP matches \fIitem\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget from whose list an item is selected\&. .IP "\fIitem\fP" 10 Specifies XmString to use as selection key\&. .IP "\fIcolumn\fP" 10 Specifies a column number (starting from 0) to match, or XmANY_COLUMN for looking for any column\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmClipboardEndRetrieve.30000644000175000017500000000522412672140200016363 00000000000000'\" t ...\" ClipbE.sgm /main/10 1996/09/25 10:24:05 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardEndRetrieve" "library call" .SH "NAME" \fBXmClipboardEndRetrieve\fP \(em A clipboard function that completes retrieval of data from the clipboard .iX "XmClipboardEndRetrieve" .iX "clipboard functions" "XmClipboardEndRetrieve" .SH "SYNOPSIS" .PP .nf #include int XmClipboardEndRetrieve (\fIdisplay, window\fP) Display \fI* display\fP; Window \fIwindow\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardEndRetrieve\fP suspends copying data incrementally from the clipboard\&. It tells the clipboard routines that the application is through copying an item from the clipboard\&. Until this function is called, data items can be retrieved incrementally from the clipboard with \fBXmClipboardRetrieve\fP\&. The act of copying data is started with the \fBXmClipboardStartRetrieve\fP function\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained with \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardRetrieve\fP(3), \fBXmClipboardStartCopy\fP(3), and \fBXmClipboardStartRetrieve\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/Shell.30000644000175000017500000001644212672140200013075 00000000000000'\" t ...\" Shell.sgm /main/10 1996/09/08 21:42:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "Shell" "library call" .SH "NAME" \fBShell\fP \(em The Shell widget class .iX "Shell" .iX "widget class" "Shell" .SH "SYNOPSIS" .PP .nf #include #include .fi .SH "DESCRIPTION" .PP Shell is a top-level widget (with only one managed child) that encapsulates the interaction with the window manager\&. .PP At the time the shell\&'s child is managed, the child\&'s width is used for both widgets if the shell is unrealized and no width has been specified for the shell\&. Otherwise, the shell\&'s width is used for both widgets\&. The same relations hold for the height of the shell and its child\&. .SS "Classes" .PP Shell inherits behavior and resources from \fBComposite\fP and \fBCore\fP\&. .PP The class pointer is \fBshellWidgetClass\fP\&. .PP The class name is \fBShell\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanFalseCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanFalseCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .IP "\fBXmNallowShellResize\fP" 10 Specifies that if this resource is False, the Shell widget instance returns \fBXtGeometryNo\fP to all geometry requests from its children\&. All Motif convenience create dialog functions override this default value and set \fBXmNallowShellResize\fP to True\&. .IP "\fBXmNcreatePopupChildProc\fP" 10 Specifies the pointer to a function that is called when the Shell widget instance is popped up by \fBXtPopup\fP\&. The function creates the child widget when the shell is popped up instead of when the application starts up\&. This can be used if the child needs to be reconfigured each time the shell is popped up\&. The function takes one argument, the popup shell, and returns no result\&. It is called after the popup callbacks specified by \fBXmNpopupCallback\fP\&. .IP "\fBXmNgeometry\fP" 10 Specifies the desired geometry for the widget instance\&. This resource is examined only when the widget instance is unrealized and the number of its managed children is changed\&. It is used to change the values of the \fBXmNx\fP, \fBXmNy\fP, \fBXmNwidth\fP, and \fBXmNheight\fP resources\&. When \fBXtGetValues\fP is called on this resource, the returned value is a pointer to the actual resource value and should not be freed\&. In addition, this resource is not copied on creation or by \fBXtSetValues\fP\&. The application must ensure that the string remains valid until the shell is realized\&. .IP "\fBXmNoverrideRedirect\fP" 10 If True, specifies that the widget instance is a temporary window that should be ignored by the window manager\&. Applications and users should not normally alter this resource\&. .IP "\fBXmNpopdownCallback\fP" 10 Specifies a list of callbacks that is called when the widget instance is popped down by \fBXtPopdown\fP\&. .IP "\fBXmNpopupCallback\fP" 10 Specifies a list of callbacks that is called when the widget instance is popped up by \fBXtPopup\fP\&. The second argument to \fBXtPopup\fP must be \fBXtGrabNone\fP\&. .IP "\fBXmNsaveUnder\fP" 10 If True, specifies that it is desirable to save the contents of the screen beneath this widget instance, avoiding expose events when the instance is unmapped\&. This is a hint, and an implementation may save contents whenever it desires, including always or never\&. .IP "\fBXmNvisual\fP" 10 Specifies the visual used in creating the widget\&. .SS "Inherited Resources" .PP Shell inherits behavior and resources from the superclass described in the following table\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for Shell\&. .SH "RELATED" .PP \fBComposite\fP(3) and \fBCore\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmVaCreateManagedScrolledWindow.30000644000175000017500000000004412672140200020151 00000000000000.so man3/XmVaCreateScrolledWindow.3 motif-2.3.8/doc/man/man3/XmComboBoxAddItem.30000644000175000017500000000401712672140200015266 00000000000000'\" t ...\" ComboAdd.sgm /main/5 1996/08/30 14:15:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmComboBoxAddItem" "library call" .SH "NAME" \fBXmComboBoxAddItem\fP \(em add an item to the ComboBox widget .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmComboBoxAddItem\fP\fR( \fBWidget \fBw\fR\fR, \fBXmString \fBitem\fR\fR, \fBint \fBpos\fR\fR, \fBBoolean \fBunique\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmComboBoxAddItem\fP function adds the given item to the XmComboBox at the given position\&. .PP The \fIw\fP argument specifies the XmComboBox widget ID\&. .PP The \fIitem\fP argument specifies the \fBXmString\fR for the new item\&. .PP The \fIpos\fP argument specifies the position of the new item\&. .PP The \fIunique\fP argument specifies if this item should duplicate an identical item or not\&. .SH "RETURN VALUE" .PP The \fBXmComboBoxAddItem\fP function returns no value\&. .SH "APPLICATION USAGE" .PP The functions \fBXmComboBoxAddItem\fP and \fBXmComboBoxDeletePos\fP have different naming conventions (Item versus Pos) because of the objects they are manipulating\&. The Item is a string to be added, the Pos is a numeric position number\&. .SH "SEE ALSO" .PP \fBXmComboBoxDeletePos\fP(3), \fBXmComboBoxSetItem\fP(3), \fBXmComboBoxSelectItem\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTextPasteLink.30000644000175000017500000000373012672140200015066 00000000000000'\" t ...\" TxtPastB.sgm /main/7 1996/08/30 16:30:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextPasteLink" "library call" .SH "NAME" \fBXmTextPasteLink\fP \(em A Text function that inserts a link to the clipboard selection .iX "XmTextPasteLink" .iX "Text functions" "XmTextPasteLink" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextPasteLink\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextPasteLink\fP inserts a link to the clipboard selection at the insertion cursor\&. This routine calls the widget\&'s \fBXmNdestinationCallback\fP procedures with the \fIselection\fP member of the \fBXmDestinationCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIoperation\fP member set to \fBXmLINK\fP\&. The Text widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the link to the clipboard selection and for taking any related actions\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns False if no transfers take place\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmGetColorCalculation.30000644000175000017500000000305312672140200016222 00000000000000'\" t ...\" GetColC.sgm /main/7 1996/08/30 15:25:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetColorCalculation" "library call" .SH "NAME" \fBXmGetColorCalculation\fP \(em A function to get the procedure used for default color calculation .iX "XmGetColorCalculation" .iX "Color functions" "XmGetColorCalculation" .SH "SYNOPSIS" .PP .nf #include \fBXmColorProc \fBXmGetColorCalculation\fP\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmGetColorCalculation\fP returns the procedure being used to calculate default colors\&. .PP For a description of \fBXmColorProc\fR, see \fBXmSetColorCalculation\fP(3)\&. .SH "RETURN" .PP Returns the procedure used for default color calculation\&. .SH "RELATED" .PP \fBXmChangeColor\fP(3), \fBXmGetColors\fP(3), and \fBXmSetColorCalculation\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmContainerPasteLink.30000644000175000017500000000400512672140200016060 00000000000000'\" t ...\" ContainG.sgm /main/7 1996/08/30 14:25:26 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerPasteLink" "library call" .SH "NAME" \fBXmContainerPasteLink\fP \(em Container widget function to insert links from the clipboard .iX "XmContainerPasteLink" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmContainerPasteLink\fP\fR( \fBWidget \fBcontainer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerPasteLink\fP requests data transfer from the clipboard selection to the Container\&. This routine calls the widget\&'s \fBXmNdestinationCallback\fP procedures with the \fIselection\fP member of the \fBXmDestinationCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIoperation\fP member set to \fBXmLINK\fP\&. The Container widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the link to the clipboard selection and for taking any related actions\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP The function returns False if no data transfer takes place\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmRenditionCreate.30000644000175000017500000000431112672140200015402 00000000000000'\" t ...\" RendB.sgm /main/8 1996/09/08 20:57:03 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenditionCreate" "library call" .SH "NAME" \fBXmRenditionCreate\fP \(em A convenience function that creates a rendition .iX "XmRenditionCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmRendition \fBXmRenditionCreate\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmStringTag \fBtag\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenditionCreate\fP creates a rendition whose resources are set to the values specified in \fIarglist\fP\&. Default values are assigned to resources that are not specified\&. .IP "\fIwidget\fP" 10 Specifies the widget used for deriving any necessary information for creating the rendition\&. In particular, the X display of \fIwidget\fP will be used for loading fonts\&. .IP "\fItag\fP" 10 Specifies the tag for the rendition\&. (This will become the \fBXmNtag\fP resource for the rendition\&.) .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .SH "RETURN" .PP Returns the created rendition\&. The function allocates space to hold the returned rendition\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXmRenditionFree\fP\&. .SH "RELATED" .PP \fBXmRendition\fP(3) and \fBXmRenditionFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmCreateSeparatorGadget.30000644000175000017500000000360212672140200016525 00000000000000'\" t ...\" CreSeD.sgm /main/7 1996/08/30 14:53:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSeparatorGadget" "library call" .SH "NAME" \fBXmCreateSeparatorGadget\fP \(em The SeparatorGadget creation function .iX "XmCreateSeparatorGadget" .iX "creation functions" "XmCreateSeparatorGadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSeparatorGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSeparatorGadget\fP creates an instance of a SeparatorGadget widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of SeparatorGadget and its associated resources, see \fBXmSeparatorGadget\fP(3)\&. .SH "RETURN" .PP Returns the SeparatorGadget widget ID\&. .SH "RELATED" .PP \fBXmSeparatorGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmTabFree.30000644000175000017500000000236512672140200013642 00000000000000'\" t ...\" TabFree.sgm /main/7 1996/08/30 16:16:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabFree" "library call" .SH "NAME" \fBXmTabFree\fP \(em A convenience function that frees a tab .iX "XmTabFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTabFree\fP\fR( \fBXmTab \fBtab\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabFree\fP frees the memory associated with the specified tab\&. .IP "\fItab\fP" 10 Specifies the tab to be freed\&. .SH "RELATED" .PP \fBXmTab\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmVaCreateArrowButtonGadget.30000644000175000017500000000306512672140200017345 00000000000000.DT .TH "XmVaCreateArrowButtonGadget" "library call" .SH "NAME" \fBXmVaCreateArrowButtonGadget\fP, \fBXmVaCreateManagedArrowButtonGadget\fP \(em A ArrowButtonGadget widget convenience creation functions\&. .iX "XmVaCreateArrowButtonGadget" "XmVaCreateManagedArrowButtonGadget" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateArrowButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedArrowButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ArrowButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateArrowButtonGadget\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedArrowButtonGadget\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ArrowButtonGadget and its associated resources, see \fBXmArrowButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the ArrowButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmArrowButtonGadget\fP(3), \fBXmCreateArrowButtonGadget\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/MrmFetchLiteral.30000644000175000017500000000721012672140200015041 00000000000000'\" t ...\" FetchLit.sgm /main/11 1996/09/24 15:58:02 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmFetchLiteral" "library call" .SH "NAME" \fBMrmFetchLiteral\fP \(em Fetches a literal from a UID file .iX "MrmFetchLiteral" .iX "uil functions" "MrmFetchLiteral" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmFetchLiteral\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBString \fBindex\fR\fR, \fBDisplay *\fBdisplay\fR\fR, \fBXtPointer *\fBvalue\fR\fR, \fBMrmCode *\fBtype\fR\fR); .fi .iX "MRM function" "MrmFetchLiteral" .iX "MrmFetchLiteral" "definition" .SH "DESCRIPTION" .PP The \fBMrmFetchLiteral\fP function .iX "MrmFetchLiteral" "description" reads and returns the value and type of a literal (named value) that is stored as a public resource in a single UID file\&. This function returns a pointer to the value of the literal\&. For example, an integer is always returned as a pointer to an integer, and a string is always returned as a pointer to a string\&. .PP Applications should not use \fBMrmFetchLiteral\fP for fetching icon or color literals\&. If this is attempted, \fBMrmFetchLiteral\fP returns an error\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of the UID hierarchy that contains the specified literal\&. The value of \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIindex\fP" 10 Specifies the UIL name of the literal (pixmap) to fetch\&. You must define this name in UIL as an exported value\&. .IP "\fIdisplay\fP" 10 Specifies the display used for the pixmap\&. The \fIdisplay\fP argument specifies the connection to the X server\&. For more information on the \fBDisplay\fR structure, see the Xlib function \fBXOpenDisplay\fP\&. .IP "\fIvalue\fP" 10 Returns the ID of the named literal\&'s value\&. The function allocates space for the returned value\&. The application is responsible for managing the allocated space by calling the appropriate deallocation function\&. For example, if the returned ID symbolizes a pixmap, then the application can recover the allocated space by calling \fBXmDestroyPixmap\fP\&. .IP "\fItype\fP" 10 Returns the named literal\&'s data type\&. Types are defined in the include file \fBMrm/MrmPublic\&.h\fP\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmNOT_FOUND\fP" 10 The literal was not found in the UIL file\&. .IP "\fBMrmWRONG_TYPE\fP" 10 The caller tried to fetch a literal of a type not supported by this function\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmFetchBitmapLiteral\fP(3), \fBMrmOpenHierarchyPerDisplay\fP(3), \fBMrmFetchIconLiteral\fP(3), \fBMrmFetchColorLiteral\fP(3), and \fBXOpenDisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmGetFocusWidget.30000644000175000017500000000331612672140200015212 00000000000000'\" t ...\" GetFocW.sgm /main/8 1996/09/08 20:46:05 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetFocusWidget" "library call" .SH "NAME" \fBXmGetFocusWidget\fP \(em Returns the ID of the widget that has keyboard focus .iX "XmGetFocusWidget" .iX "traversal functions" "XmGetFocusWidget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetFocusWidget\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetFocusWidget\fP examines the hierarchy that contains the specified widget and returns the ID of the widget that has keyboard focus\&. The function extracts the widget ID from the associated Shell widget; therefore, the specified widget can be located anywhere in the hierarchy\&. .IP "\fIwidget\fP" 10 Specifies a widget ID within a given hierarchy .SH "RETURN" .PP Returns the ID of the widget with keyboard focus\&. If no child of the Shell has focus, the function returns NULL\&. .SH "RELATED" .PP \fBXmProcessTraversal\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmDropSiteConfigureStackingOrder.30000644000175000017500000000567612672140200020415 00000000000000'\" t ...\" DropSitC.sgm /main/8 1996/09/08 20:40:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteConfigureStackingOrder" "library call" .SH "NAME" \fBXmDropSiteConfigureStackingOrder\fP \(em A Drag and Drop function that reorders a stack of widgets that are registered drop sites .iX "XmDropSiteConfigureStack\\%ingOrder" .iX "Drag and Drop functions" "XmDropSiteConfigureStack\\%ingOrder" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropSiteConfigureStackingOrder\fP\fR( \fBWidget \fBwidget\fR\fR, \fBWidget \fBsibling\fR\fR, \fBCardinal \fBstack_mode\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteConfigureStackingOrder\fP changes the stacking order of the drop site specified by \fIwidget\fP\&. The stacking order controls the manner in which drag-under effects are clipped by overlapping siblings, regardless of whether they are active\&. The stack mode is relative either to the entire stack, or to another drop site within the stack\&. The stack order can be modified only if the drop sites are siblings in both the widget and drop site hierarchy, and the widget parent of the drop sites is registered as a composite drop site\&. .IP "\fIwidget\fP" 10 Specifies the drop site to be restacked\&. .IP "\fIsibling\fP" 10 Specifies a sibling drop site for stacking operations\&. If specified, then \fIwidget\fP is restacked relative to this drop site\&'s stack position\&. .IP "\fIstack_mode\fP" 10 Specifies the new stack position for the specified widget\&. The values are \fBXmABOVE\fP and \fBXmBELOW\fP\&. If a sibling is specified, then \fIwidget\fP is restacked as follows: .RS .IP "\fBXmABOVE\fP" 10 The widget is placed just above the sibling\&. .IP "\fBXmBELOW\fP" 10 The widget is placed just below the sibling\&. .RE .IP "" 10 If the \fIsibling\fP parameter is not specified, then \fIwidget\fP is restacked as follows: .RS .IP "\fBXmABOVE\fP" 10 The widget is placed at the top of the stack\&. .IP "\fBXmBELOW\fP" 10 The widget is placed at the bottom of the stack\&. .RE .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RELATED" .PP \fBXmDropSite\fP(3), \fBXmDropSiteRetrieve\fP(3), and \fBXmDropSiteQueryStackingOrder\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmVaCreateSelectionBox.30000644000175000017500000000300512672140200016333 00000000000000.DT .TH "XmVaCreateSelectionBox" "library call" .SH "NAME" \fBXmVaCreateSelectionBox\fP, \fBXmVaCreateManagedSelectionBox\fP \(em A SelectionBox widget convenience creation functions\&. .iX "XmVaCreateToggleSelectionBox" "XmVaCreateManagedSelectionBox" .iX "creation functions" "XmVaCreateSelectionBox" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateSelectionBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedSelectionBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateSelectionBox\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateSelectionBox\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of SelectionBox and its associated resources, see \fBXmSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the SelectionBox widget ID\&. .SH "RELATED" .PP \fBXmSelectionBox\fP(3), \fBXmCreateSelectionBox\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/Uil.30000644000175000017500000002145412672140200012556 00000000000000'\" t ...\" Uil.sgm /main/11 1996/09/08 21:42:50 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "Uil" "library call" .SH "NAME" \fBUil\fP \(em Invokes the UIL compiler from within an application .iX "Uil" .iX "uil functions" "Uil" .iX "uil compiler" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBUil_status_type \fBUil\fP\fR( \fBUil_command_type *\fBcommand_desc\fR\fR, \fBUil_compile_desc_type *\fB*compile_desc\fR\fR, \fBUil_continue_type (*\fBmessage_cb\fR) ()\fR, \fBchar *\fBmessage_data\fR\fR, \fBUil_continue_type (*\fBstatus_cb\fR) ()\fR, \fBchar *\fBstatus_data\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBUil\fP function provides a callable entry point for the UIL compiler\&. The \fBUil\fP callable interface can be used to process a UIL source file and to generate UID files, as well as return a detailed description of the UIL source module in the form of a symbol table (parse tree)\&. .IP "\fIcommand_desc\fP" 10 Specifies the \fBuil\fP command line\&. .IP "\fIcompile_desc\fP" 10 Returns the results of the compilation\&. .IP "\fImessage_cb\fP" 10 Specifies a callback function that is called when the compiler encounters errors in the UIL source\&. .IP "\fImessage_data\fP" 10 Specifies user data that is passed to the message callback function (\fImessage_cb)\fP\&. Note that this argument is not interpreted by UIL, and is used exclusively by the calling application\&. .IP "\fIstatus_cb\fP" 10 Specifies a callback function that is called to allow X applications to service X events such as updating the screen\&. This function is called at various check points, which have been hard coded into the UIL compiler\&. The \fIstatus_update_delay\fP argument in \fIcommand_desc\fP specifies the number of check points to be passed before the \fIstatus_cb\fP function is invoked\&. .IP "\fIstatus_data\fP" 10 Specifies user data that is passed to the status callback function (\fIstatus_cb)\&.\fP Note that this argument is not interpreted by the UIL compiler and is used exclusively by the calling application\&. .PP Following are the data structures \fBUil_command_type\fP and \fBUil_compile_desc_type\fP: .PP .nf \f(CWtypedef struct Uil_command_type { char *source_file; /* single source to compile */ char *resource_file; /* name of output file */ char *listing_file; /* name of listing file */ unsigned int *include_dir_count; /* number of dirs\&. in include_dir */ char *((*include_dir) []); /* dir\&. to search for include files */ unsigned listing_file_flag: 1; /* produce a listing */ unsigned resource_file_flag: 1; /* generate UID output */ unsigned machine_code_flag: 1; /* generate machine code */ unsigned report_info_msg_flag: 1; /* report info messages */ unsigned report_warn_msg_flag: 1; /* report warnings */ unsigned parse_tree_flag: 1; /* generate parse tree */ unsigned int status_update_delay; /* number of times a status point is */ /* passed before calling status_cb */ /* function 0 means called every time */ char *database; /* name of database file */ unsigned database_flag: 1; /* read a new database file */ unsigned use_setlocale_flag: 1; /* enable calls to setlocale */ }; typedef struct Uil_compile_desc_type { unsigned int compiler_version; /* version number of compiler */ unsigned int data_version; /* version number of structures */ char *parse_tree_root; /* parse tree output */ unsigned int message_count [Uil_k_max_status+1]; /* array of severity counts */ };\fR .fi .PP .PP Following is a description of the message callback function specified by \fImessage_cb\fP: .PP .nf Uil_continue_type (\fI*message_cb\fP) (\fImessage_data, message_number, severity, msg_buffer, src_buffer, ptr_buffer, loc_buffer, message_count\fP) char \fI*message_data\fP; int \fImessage_number\fP; int \fIseverity\fP; char \fI*msg_buffer\fP, \fI*src_buffer\fP; char \fI*ptr_buffer\fP, \fI*loc_buffer\fP; int \fImessage_count\fP[]; .fi .PP This function specifies a callback function that UIL invokes instead of printing an error message when the compiler encounters an error in the UIL source\&. The callback should return one of the following values: .IP "\fBUil_k_terminate\fP" 10 Terminate processing of the source file .IP "\fBUil_k_continue\fP" 10 Continue processing the source file .PP The arguments are .IP "\fImessage_data\fP" 10 Data supplied by the application as the \fImessage_data\fP argument to the \fBUil\fP function\&. UIL does not interpret this data in any way; it just passes it to the callback\&. .IP "\fImessage_number\fP" 10 An index into a table of error messages and severities for internal use by UIL\&. .IP "\fIseverity\fP" 10 An integer that indicates the severity of the error\&. The possible values are the status constants returned by the \fBUil\fP function\&. See \fBReturn Value\fP for more information\&. .IP "\fImsg_buffer\fP" 10 A string that describes the error\&. .IP "\fIsrc_buffer\fP" 10 A string consisting of the source line where the error occurred\&. This string is not always available\&. In this case, the argument is NULL\&. .IP "\fIptr_buffer\fP" 10 A string consisting of whitespace and a printing character in the character position corresponding to the column of the source line where the error occurred\&. This string may be printed beneath the source line to provide a visual indication of the column where the error occurred\&. This string is not always available\&. In this case, the argument is NULL\&. .IP "\fIloc_buffer\fP" 10 A string identifying the line number and file of the source line where the error occurred\&. This is not always available; the argument is then NULL\&. .IP "\fImessage_count\fP" 10 An array of integers containing the number of diagnostic messages issued thus far for each severity level\&. To find the number of messages issued for the current severity level, use the \fIseverity\fP argument as the index into this array\&. .PP Following is a description of the status callback function specified by \fIstatus_cb\fP: .PP .nf Uil_continue_type (\fI*status_cb\fP) (\fIstatus_data, percent_complete, lines_processed, current_file, message_count\fP) char \fI*status_data\fP; int \fIpercent_complete\fP; int \fIlines_processed\fP; char \fI*current_file\fP; int \fImessage_count\fP[]; .fi .PP This function specifies a callback function that is invoked to allow X applications to service X events such as updating the screen\&. The callback should return one of the following values: .IP "\fBUil_k_terminate\fP" 10 Terminate processing of the source file .IP "\fBUil_k_continue\fP" 10 Continue processing the source file .PP The arguments are .IP "\fIstatus_data\fP" 10 Data supplied by the application as the \fIstatus_data\fP argument to the \fBUil\fP function\&. UIL does not interpret this data in any way; it just passes it to the callback\&. .IP "\fIpercent_complete\fP" 10 An integer indicating what percentage of the current source file has been processed so far\&. .IP "\fIlines_processed\fP" 10 An integer indicating how many lines of the current source file have been read so far\&. .IP "\fIcurrent_file\fP" 10 A string containing the pathname of the current source file\&. .IP "\fImessage_count\fP" 10 An array of integers containing the number of diagnostic messages issued thus far for each severity level\&. To find the number of messages issued for a given severity level, use the severity level as the index into this array\&. The possible severity levels are the status constants returned by the \fBUil\fP function\&. See \fBReturn Value\fP for more information\&. .SH "RETURN" .PP This function returns one of the following status return constants: .IP "\fBUil_k_success_status\fP" 10 The operation succeeded\&. .IP "\fBUil_k_info_status\fP" 10 The operation succeeded\&. An informational message is returned\&. .IP "\fBUil_k_warning_status\fP" 10 The operation succeeded\&. A warning message is returned\&. .IP "\fBUil_k_error_status\fP" 10 The operation failed due to an error\&. .IP "\fBUil_k_severe_status\fP" 10 The operation failed due to an error\&. .SH "RELATED" .PP \fBUilDumpSymbolTable\fP(3) and \fBuil\fP(1)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmCreatePopupMenu.30000644000175000017500000000662112672140200015405 00000000000000'\" t ...\" CrePop.sgm /main/8 1996/09/08 20:34:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreatePopupMenu" "library call" .SH "NAME" \fBXmCreatePopupMenu\fP \(em A RowColumn widget convenience creation function .iX "XmCreatePopupMenu" .iX "creation functions" "XmCreatePopupMenu" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreatePopupMenu\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreatePopupMenu\fP creates an instance of a RowColumn widget of type \fBXmMENU_POPUP\fP and returns the associated widget ID\&. When this function is used to create the Popup menu pane, a MenuShell widget is automatically created as the parent of the menu pane\&. The parent of the MenuShell widget is the widget indicated by the \fIparent\fP parameter\&. .PP \fBXmCreatePopupMenu\fP is provided as a convenience function for creating RowColumn widgets configured to operate as Popup menu panes and is not implemented as a separate widget class\&. .PP The PopupMenu is used as the first menu pane within a PopupMenu system; all other menu panes are of the Pulldown type\&. A Popup menu pane displays a 3-D shadow, unless the feature is disabled by the application\&. The shadow appears around the edge of the menu pane\&. .PP The Popup menu pane must be created as the child of a MenuShell widget in order to function properly when it is incorporated into a menu\&. If the application uses this convenience function for creating a Popup menu pane, the MenuShell is automatically created as the real parent of the menu pane\&. If the application does not use this convenience function to create the RowColumn to function as a Popup menu pane, it is the application\&'s responsibility to create the MenuShell widget\&. .PP To access the PopupMenu, the application must first position the widget using the \fBXmMenuPosition\fP function and then manage it using \fBXtManageChild\fP\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP Popup menu panes support tear-off capabilities for tear-off menus through \fBXmRowColumn\fP resources\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateSimplePopupMenu\fP(3), \fBXmMenuPosition\fP(3), \fBXmMenuShell\fP(3), \fBXmRowColumn\fP(3), and \fBXmVaCreateSimplePopupMenu\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmTabStackXYToWidget.30000644000175000017500000000312112672140200015745 00000000000000'\" t .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabStackXYToWidget" "library call" .SH "NAME" \fBXmTabStackXYToWidget\fP \(em A TabStack function that converts a pixel coordinate to the widget ID of the tab occupying that space .iX "XmTabStackXYToWidget" .iX "TabStack functions" "XmTabStackXYToWidget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmTabStackXYToWidget\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBx, \fBint \fBy); .fi .SH "DESCRIPTION" .PP \fBXmTabStackXYToWidget\fP converts an X/Y pixel coordinate in the window if TabStack to the widget ID of the tab occupying that space\&. .IP "\fIwidget\fP" 10 Specifies the TabStack widget ID .IP "\fIx\fP" 10 Specifies X coordinate to convert .IP "\fIy\fP" 10 Specifies Y coordinate to convert .SH "RETURN" .PP Returns the widget ID of the tab occuring in the cpecified coordinate\&. .SH "RELATED" .PP \fBXmTabStack\fP(3)\&. motif-2.3.8/doc/man/man3/XmClipboardCancelCopy.30000644000175000017500000000627012672140200016171 00000000000000'\" t ...\" ClipbA.sgm /main/10 1996/09/25 10:23:34 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardCancelCopy" "library call" .SH "NAME" \fBXmClipboardCancelCopy\fP \(em A clipboard function that cancels a copy to the clipboard .iX "XmClipboardCancelCopy" .iX "clipboard functions" "XmClipboardCancelCopy" .SH "SYNOPSIS" .PP .nf #include int XmClipboardCancelCopy (\fIdisplay, window, item_id\fP) Display \fI* display\fP; Window \fIwindow\fP; long \fIitem_id\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardCancelCopy\fP cancels the copy to clipboard that is in progress and frees up temporary storage\&. When a copy is to be performed, \fBXmClipboardStartCopy\fP allocates temporary storage for the clipboard data\&. \fBXmClipboardCopy\fP copies the appropriate data into the the temporary storage\&. \fBXmClipboardEndCopy\fP copies the data to the clipboard structure and frees up the temporary storage structures\&. If \fBXmClipboardCancelCopy\fP is called, the \fBXmClipboardEndCopy\fP function does not have to be called\&. A call to \fBXmClipboardCancelCopy\fP is valid only after a call to \fBXmClipboardStartCopy\fP\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies a widget\&'s window ID that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIitem_id\fP" 10 Specifies the number assigned to this data item\&. This number was returned by a previous call to \fBXmClipboardStartCopy\fP\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardFail\fP" 10 The function failed because \fBXmClipboardStartCopy\fP was not called or because the data item contains too many formats\&. .SH "RELATED" .PP \fBXmClipboardCopy\fP(3), \fBXmClipboardEndCopy\fP(3), and \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmListReplaceItemsPosUnselected.30000644000175000017500000000524712672140200020243 00000000000000'\" t ...\" LstReplC.sgm /main/8 1996/09/08 20:51:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListReplaceItemsPosUnselected" "library call" .SH "NAME" \fBXmListReplaceItemsPosUnselected\fP \(em A List function that replaces items in a list without selecting the replacement items .iX "XmListReplaceItemsPosUn\\%selected" .iX "List functions" "XmListReplaceItemsPosUn\\%selected" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListReplaceItemsPosUnselected\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString *\fBnew_items\fR\fR, \fBint \fBitem_count\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListReplaceItemsPosUnselected\fP replaces the specified number of items in the list with new items, starting at the given position\&. The replacement items remain unselected, even if they currently appear in the \fBXmNselectedItems\fP list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget to replace items in\&. .IP "\fInew_items\fP" 10 Specifies a pointer to the replacement items\&. .IP "\fIitem_count\fP" 10 Specifies the number of elements in \fInew_items\fP and the number of items in the list to replace\&. This number must be nonnegative\&. .IP "\fIposition\fP" 10 Specifies the position of the first item in the list to be replaced\&. A value of 1 indicates that the first item replaced is the first item in the list; a value of 2 indicates that it is the second item; and so on\&. .IP "" 10 Beginning with the item specified in \fIposition\fP, \fIitem_count\fP items in the list are replaced with the corresponding elements from \fInew_items\fP\&. That is, the item at \fIposition\fP is replaced with the first element of \fInew_items\fP; the item after \fIposition\fP is replaced with the second element of \fInew_items\fP; and so on, until \fIitem_count\fP is reached\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmConvertStringToUnits.30000644000175000017500000000761612672140200016473 00000000000000'\" t ...\" CvtSt.sgm /main/9 1996/09/08 20:37:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmConvertStringToUnits" "library call" .SH "NAME" \fBXmConvertStringToUnits\fP \(em A function that converts a string specification to a unit value .iX "XmConvertStringToUnits" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmConvertStringToUnits\fP\fR( \fBScreen *\fBscreen\fR\fR, \fBString \fBspec\fR\fR, \fBint \fBorientation\fR\fR, \fBint \fBto_type\fR\fR, \fBXtEnum *\fBparse_error\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmConvertStringToUnits\fP converts a string specification value and returns the converted value as the return value from the function\&. This function uses the specified screen\&'s resolution to compute the number of units for the string specification\&. .IP "\fIscreen\fP" 10 Specifies the screen whose resolution is to be used for the computation\&. .IP "\fIspec\fP" 10 Specifies the string, in \fI\fP format, to be converted\&. .IP "\fIorientation\fP" 10 Specifies whether the converter uses the horizontal or vertical screen resolution when performing the conversion\&. The \fIorientation\fP parameter can have values of \fBXmHORIZONTAL\fP or \fBXmVERTICAL\fP\&. .IP "\fIto_type\fP" 10 Converts the value to the unit type specified\&. Refer to the \fBXmNunitType\fP resource of the \fBXmGadget\fP, \fBXmManager\fP, or \fBXmPrimitive\fP reference page\&. This parameter can have one of the following values: .RS .IP "\fBXmPIXELS\fP" 10 The returned value will be the number of pixels\&. .IP "\fBXmMILLIMETERS\fP" 10 The returned value will be the number of millimeters\&. .IP "\fBXm100TH_MILLIMETERS\fP" 10 The returned values will be the number of 1/100 millimeters\&. .IP "\fBXmCENTIMETERS\fP" 10 The returned values will be the number of centimeters\&. .IP "\fBXmINCHES\fP" 10 The returned values will be the number of inches\&. .IP "\fBXm1000TH_INCHES\fP" 10 The returned values will be the number of 1/100 inches\&. .IP "\fBXmPOINTS\fP" 10 The returned values will be the number of points\&. A point is a text processing unit defined as 1/72 of an inch\&. .IP "\fBXm100TH_POINTS\fP" 10 The returned values will be the number of 1/100 points\&. .IP "\fBXmFONT_UNITS\fP" 10 All values provided to the widget are treated as font units\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fBXm100TH_FONT_UNITS\fP" 10 All values provided to the widget are treated as 1/100 of a font unit\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .RE .IP "\fIparse_error\fP" 10 Specifies if a parsing error occurred\&. This is set to a value of True indicates that an error occurred, a value of False to indicate no error\&. .SH "RETURN" .PP Returns the converted value\&. If a NULL screen, incorrect \fIorientation\fP, or incorrect \fIunit_type\fP is supplied as parameter data, or if a parsing error occurred, 0 (zero) is returned\&. .SH "RELATED" .PP \fBXmConvertUnits\fP(3), \fBXmSetFontUnits\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmVaCreateManagedPanedWindow.30000644000175000017500000000004112672140200017426 00000000000000.so man3/XmVaCreatePanedWindow.3 motif-2.3.8/doc/man/man3/XmCreateLabelGadget.30000644000175000017500000000351712672140200015611 00000000000000'\" t ...\" CreLaB.sgm /main/7 1996/08/30 14:41:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateLabelGadget" "library call" .SH "NAME" \fBXmCreateLabelGadget\fP \(em The LabelGadget creation function .iX "XmCreateLabelGadget" .iX "creation functions" "XmCreateLabelGadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateLabelGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateLabelGadget\fP creates an instance of a LabelGadget widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of LabelGadget and its associated resources, see \fBXmLabelGadget\fP(3)\&. .SH "RETURN" .PP Returns the LabelGadget widget ID\&. .SH "RELATED" .PP \fBXmLabelGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/MrmFetchWidgetOverride.30000644000175000017500000000733012672140200016373 00000000000000'\" t ...\" FetchWiB.sgm /main/10 1996/09/08 21:25:30 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmFetchWidgetOverride" "library call" .SH "NAME" \fBMrmFetchWidgetOverride\fP \(em Fetches any indexed (UIL named) application widget\&. It overrides the arguments specified for this application widget in UIL .iX "MrmFetchWidgetOverride" .iX "uil functions" "MrmFetchWidgetOverride" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmFetchWidgetOverride\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBString \fBindex\fR\fR, \fBWidget \fBparent_widget\fR\fR, \fBString \fBoverride_name\fR\fR, \fBArgList \fBoverride_args\fR\fR, \fBCardinal \fBoverride_num_args\fR\fR, \fBWidget *\fBwidget\fR\fR, \fBMrmType *\fBclass\fR\fR); .fi .iX "MRM function" "MrmFetchWidgetOverride" .iX "MrmFetchWidgetOverride" "definition" .SH "DESCRIPTION" .PP The \fBMrmFetchWidgetOverride\fP function .iX "MrmFetchWidgetOverride" "description" is the extended version of \fBMrmFetchWidget\fP\&. It is identical to \fBMrmFetchWidget\fP, except that it allows the caller to override the widget\&'s name and any arguments that \fBMrmFetchWidget\fP would otherwise retrieve from the UID file or one of the defaulting mechanisms\&. That is, the override argument list is not limited to those arguments in the UID file\&. .PP The override arguments apply only to the widget fetched and returned by this function\&. Its children (subtree) do not receive any override parameters\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of the UID hierarchy that contains the interface definition\&. The value of \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIindex\fP" 10 Specifies the UIL name of the widget to fetch\&. .IP "\fIparent_widget\fP" 10 Specifies the parent widget ID\&. .IP "\fIoverride_name\fP" 10 Specifies the name to override the widget name\&. Use a NULL value if you do not want to override the widget name\&. .IP "\fIoverride_args\fP" 10 Specifies the override argument list, exactly as given to \fBXtCreateWidget\fP (conversion complete and so forth)\&. Use a NULL value if you do not want to override the argument list\&. .IP "\fIoverride_num_args\fP" 10 Specifies the number of arguments in \fIoverride_args\fP\&. .IP "\fIwidget\fP" 10 Returns the widget ID of the created widget\&. .IP "\fIclass\fP" 10 Returns the class code identifying MRM\&'s widget class\&. Literals identifying MRM widget class codes are defined in the include file \fBMrm/MrmPublic\&.h\fP\&. .SH "RETURN VALUE" .iX "MrmSUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmNOT_FOUND\fP" 10 The widget was not found in UID hierarchy\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmOpenHierarchyPerDisplay\fP(3), \fBMrmFetchWidget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmCreateSelectionBox.30000644000175000017500000000464512672140200016057 00000000000000'\" t ...\" CreSeA.sgm /main/8 1996/09/08 20:36:06 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSelectionBox" "library call" .SH "NAME" \fBXmCreateSelectionBox\fP \(em The SelectionBox widget creation function .iX "XmCreateSelectionBox" .iX "creation functions" "XmCreateSelectionBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSelectionBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSelectionBox\fP creates an unmanaged SelectionBox\&. A SelectionBox is used to get a selection from a list of alternatives from the user and includes the following: .IP " \(bu" 6 A scrolling list of alternatives .IP " \(bu" 6 An editable text field for the selected alternative .IP " \(bu" 6 Labels for the list and text field .IP " \(bu" 6 Three or four buttons .PP The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. By default, an \fBApply\fP button is also created\&. If the parent of the SelectionBox is a DialogShell, it is managed; otherwise it is unmanaged\&. Additional work area children may be added to the SelectionBox after creation\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of SelectionBox and its associated resources, see \fBXmSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the SelectionBox widget ID\&. .SH "RELATED" .PP \fBXmSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmListGetMatchPos.30000644000175000017500000000436212672140200015343 00000000000000'\" t ...\" LstGetMa.sgm /main/7 1996/08/30 15:42:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListGetMatchPos" "library call" .SH "NAME" \fBXmListGetMatchPos\fP \(em A List function that returns all instances of an item in the list .iX "XmListGetMatchPos" .iX "List functions" "XmListGetMatchPos" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmListGetMatchPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR, \fBint **\fBposition_list\fR\fR, \fBint *\fBposition_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListGetMatchPos\fP is a Boolean function that returns an array of positions where a specified item is found in a List\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIitem\fP" 10 Specifies the item to search for\&. .IP "\fIposition_list\fP" 10 Returns an array of positions at which the item occurs in the List\&. The position of the first item in the list is 1; the position of the second item is 2; and so on\&. When the return value is True, \fBXmListGetMatchPos\fP allocates memory for this array\&. The caller is responsible for freeing this memory\&. The caller can recover the allocated memory by calling \fBXtFree\fP\&. .IP "\fIposition_count\fP" 10 Returns the number of elements in the \fIposition_list\fP\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns True if the specified item is present in the list, and False if it is not\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmStringPutRendition.30000644000175000017500000000403212672140200016136 00000000000000'\" t ...\" StrPut.sgm /main/8 1996/09/08 21:06:53 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringPutRendition" "library call" .SH "NAME" \fBXmStringPutRendition\fP \(em A convenience function that places renditions around strings .iX "XmStringPutRendition" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringPutRendition\fP\fR( \fBXmString \fBstring\fR\fR, \fBXmStringTag \fBrendition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringPutRendition\fP places matching \fBXm_STRING_COMPONENT_RENDITION_BEGIN\fP and \fBXmSTRING_COMPONENT_RENDITION_END\fP components containing \fIrendition\fP around \fIstring\fP\&. The original string is preserved\&. .IP "\fIstring\fP" 10 Specifies the compound string to which begin and end rendition components should be added\&. .IP "\fIrendition\fP" 10 Specifies the rendition tag to be used in an \fBXmSTRING_COMPONENT_RENDITION_BEGIN\fP component which will begin the returned string and in an \fBXmSTRING_COMPONENT_RENDITION_END\fP component which will end it\&. .SH "RETURN" .PP Returns a new compound string\&. The function allocates space to hold this returned compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .SH "RELATED" .PP \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmRenderTableCvtToProp.30000644000175000017500000000424712672140200016343 00000000000000'\" t ...\" RendTaE.sgm /main/7 1996/08/30 15:58:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableCvtToProp" "library call" .SH "NAME" \fBXmRenderTableCvtToProp\fP \(em A render table function that converts a render table to a string representation .iX "XmRenderTableCvtToProp" .iX "render table functions" "XmRenderTableCvtToProp" .SH "SYNOPSIS" .PP .nf #include \fBunsigned int \fBXmRenderTableCvtToProp\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmRenderTable \fBtable\fR\fR, \fBchar **\fBprop_return\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableCvtToProp\fP converts a render table to a string of characters representing the render table\&. This routine is typically used by the source of a data transfer operation to produce a representation for transferring a render table to a destination\&. .IP "\fIwidget\fP" 10 Specifies the widget that is the source of the render table .IP "\fItable\fP" 10 Specifies a render table to be converted .IP "\fIprop_return\fP" 10 Specifies a pointer to a string that is created and returned by this function\&. The function allocates space to hold the returned string\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXtFree\fP\&. .SH "RETURN" .PP Returns the number of bytes in the string representation\&. .SH "RELATED" .PP \fBXmRenderTable\fP(3) and \fBXmRenderTableCvtFromProp\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmSimpleSpinBoxAddItem.30000644000175000017500000000324112672140200016310 00000000000000'\" t ...\" SSpinBoxA.sgm /main/1 1996/09/06 09:24:28 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSimpleSpinBoxAddItem" "library call" .SH "NAME" \fBXmSimpleSpinBoxAddItem\fP \(em add an item to the XmSimpleSpinBox .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmSimpleSpinBoxAddItem\fP\fR( \fBWidget \fBw\fR\fR, \fBXmString \fBitem\fR\fR, \fBint \fBpos\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmSimpleSpinBoxAddItem\fP function adds the given item to the XmSimpleSpinBox at the given position\&. .PP The \fIw\fP argument specifies the widget ID\&. .PP The \fIitem\fP argument specifies the \fBXmString\fR for the new item\&. .PP The \fIpos\fP argument specifies the position of the new item\&. .SH "RETURN VALUE" .PP The \fBXmSimpleSpinBoxAddItem\fP function returns no value\&. .SH "SEE ALSO" .PP \fBXmSimpleSpinBox\fP(3), .PP \fBXmSimpleSpinBoxDeletePos\fP(3), \fBXmSimpleSpinBoxSetItem\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextReplaceWcs.30000644000175000017500000000542212672140200015224 00000000000000'\" t ...\" TxtReplB.sgm /main/8 1996/09/08 21:19:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextReplaceWcs" "library call" .SH "NAME" \fBXmTextReplaceWcs\fP \(em A Text function that replaces part of a wide character string in a Text widget .iX "XmTextReplaceWcs" .iX "Text functions" "XmTextReplaceWcs" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextReplaceWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBfrom_pos\fR\fR, \fBXmTextPosition \fBto_pos\fR\fR, \fBwchar_t *\fBwcstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextReplaceWcs\fP replaces part of the wide character string in the Text widget\&. The character positions begin at zero and are numbered sequentially from the beginning of the text\&. .PP An example text replacement would be to replace the second and third characters in the text string\&. To accomplish this, the \fIfrom_pos\fP parameter must be 1 and the \fIto_pos\fP parameter must be 3\&. To insert a string after the fourth character, both the \fIfrom_pos\fP and \fIto_pos\fP parameters must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. This routine calls the widget\&'s \fBXmNmotionVerifyCallback\fP callback when \fIfrom_pos\fP is less than or equal to the cursor position\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIfrom_pos\fP" 10 Specifies the start position of the text to be replaced .IP "\fIto_pos\fP" 10 Specifies the end position of the text to be replaced .IP "\fIwcstring\fP" 10 Specifies the wide character string value to be added to the Text widget .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextReplace\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmStringByteCompare.30000644000175000017500000000521612672140200015731 00000000000000'\" t ...\" StrByA.sgm /main/9 1996/09/08 21:02:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringByteCompare" "library call" .SH "NAME" \fBXmStringByteCompare\fP \(em A compound string function that indicates the results of a byte-by-byte comparison .iX "XmStringByteCompare" .iX "compound string functions" "XmStringByteCompare" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringByteCompare\fP\fR( \fBXmString \fBs1\fR\fR, \fBXmString \fBs2\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. \fBXmStringByteCompare\fP returns a Boolean indicating the results of a byte-by-byte comparison of two compound strings\&. .PP In general, if two compound strings are created with the same (\fBchar *\fR) string using \fBXmStringCreateLocalized\fP in the same language environment, the compound strings compare as equal\&. If two compound strings are created with the same (\fBchar\ *\fP) string and the same font list element tag set other than \fBXmFONTLIST_DEFAULT_TAG\fP using \fBXmStringCreate\fP, the strings compare as equal\&. .PP In some cases, once a compound string is put into a widget, that string is converted into an internal form to allow faster processing\&. Part of the conversion process strips out unnecessary or redundant information\&. If an application then does an \fBXtGetValues\fP to retrieve a compound string from a widget (specifically, Label and all of its subclasses), it is not guaranteed that the compound string returned is byte-for-byte the same as the string given to the widget originally\&. .IP "\fIs1\fP" 10 Specifies a compound string to be compared with \fIs2\fP .IP "\fIs2\fP" 10 Specifies a compound string to be compared with \fIs1\fP .SH "RETURN" .PP Returns True if two compound strings are identical byte-by-byte\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringCreateLocalized\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmVaCreateManagedColorSelector.30000644000175000017500000000004312672140200017770 00000000000000.so man3/XmVaCreateColorSelector.3 motif-2.3.8/doc/man/man3/XmWidgetGetDisplayRect.30000644000175000017500000000432312672140200016355 00000000000000'\" t ...\" WidgetGB.sgm /main/8 1996/09/08 21:21:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmWidgetGetDisplayRect" "library call" .SH "NAME" \fBXmWidgetGetDisplayRect\fP \(em Retrieves display rectangle information for a widget .iX "XmWidgetGetDisplayRect" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmWidgetGetDisplayRect\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXRectangle *\fBdisplayrect\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmWidgetGetDisplayRect\fP returns the width, height and the x and y-coordinates of the upper left corner of the display rectangle of the specified widget\&. The display rectangle is the smallest rectangle that encloses either a string or a pixmap\&. .PP If the widget contains a string, the return values specify the x and y-coordinates of the upper left corner of the display rectangle relative to the origin of the widget and the width and height in pixels\&. .PP In the case of a pixmap, the return values specify the x and y-coordinates of the upper left corner of the pixmap relative to the origin, and the width and height of the pixmap in pixels\&. .IP "\fIwidget\fP" 10 Specifies the widget ID .IP "\fIdisplayrect\fP" 10 Specifies a pointer to an XRectangle structure in which the x and y-coordinates, width and height of the display rectangle are returned .SH "RETURN" .PP Returns True if the specified widget has an associated display rectangle; otherwise, returns False\&. .SH "RELATED" .PP \fBXmWidgetGetBaselines\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmStringCreateSimple.30000644000175000017500000000444512672140200016077 00000000000000'\" t ...\" StrCrD.sgm /main/8 1996/09/08 21:04:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringCreateSimple" "library call" .SH "NAME" \fBXmStringCreateSimple\fP \(em A compound string function that creates a compound string in the language environment of a widget .iX "XmStringCreateSimple" .iX "compound string functions" "XmStringCreateSimple" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringCreateSimple\fP\fR( \fBchar \fB* text\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringCreateSimple\fP creates a compound string with a text component and a charset tag\&. It derives the character set from the current language environment\&. .PP The routine attempts to derive a character set from the value of the LANG environment variable\&. If this does not result in a valid character set, the routine uses a vendor-specific default\&. If the vendor has not specified a different value, this default is ISO8859-1\&. .PP The function will allocate space to hold the returned compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .PP \fBNOTE:\fP This routine is obsolete and exists for compatibility with previous releases\&. It has been replaced by \fBXmStringCreateLocalized\fP\&. .IP "\fItext\fP" 10 Specifies a NULL-terminated string to be used as the text component of the compound string\&. .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringCreateLocalized\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmStringDirectionToDirection.30000644000175000017500000000372712672140200017610 00000000000000'\" t ...\" StrDiC.sgm /main/8 1996/09/08 21:04:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringDirectionToDirection" "library call" .SH "NAME" \fBXmStringDirectionToDirection\fP \(em A function that converts from XmStringDirection to XmDirection .iX "XmStringDirectionToDirection" .SH "SYNOPSIS" .PP .nf #include \fBXmDirection \fBXmStringDirectionToDirection\fP\fR( \fBXmStringDirection \fBdirection\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringDirectionToDirection\fP converts the specified \fBXmStringDirection\fR direction value to its equivalent \fBXmDirection\fR value\&. This function provides backward compatibility with the \fBXmStringDirection\fR data type\&. .IP "\fIdirection\fP" 10 Specifies the \fBXmStringDirection\fR value to be converted\&. .SH "RETURN" .PP Returns the following \fBXmDirection\fR values: .IP "\fBXmLEFT_TO_RIGHT\fP" 10 If the \fIdirection\fP argument is \fBXmSTRING_DIRECTION_L_TO_R\fP\&. .IP "\fBXmRIGHT_TO_LEFT\fP" 10 If the \fIdirection\fP argument is \fBXmSTRING_DIRECTION_R_TO_L\fP\&. .IP "\fBXmDEFAULT_DIRECTION\fP" 10 If the \fIdirection\fP argument was not either of the above\&. .SH "RELATED INFORMATION" .PP \fBXmStringDirection\fP(3) and \fBXmDirection\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmStringPeekNextComponent.30000644000175000017500000000374212672140200017127 00000000000000'\" t ...\" StrPeA.sgm /main/8 1996/09/08 21:06:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringPeekNextComponent" "library call" .SH "NAME" \fBXmStringPeekNextComponent\fP \(em A compound string function that returns the component type of the next component to be fetched .iX "XmStringPeekNextComponent" .iX "compound string functions" "XmStringPeekNextComponent" .SH "SYNOPSIS" .PP .nf #include \fBXmStringComponentType \fBXmStringPeekNextComponent\fP\fR( \fBXmStringContext \fBcontext\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmStringPeekNextTriple\fP\&. \fBXmStringPeekNextComponent\fP examines the next component that would be fetched by \fBXmStringGetNextComponent\fP and returns the component type\&. .IP "\fIcontext\fP" 10 Specifies the string context structure that was allocated by the \fBXmStringInitContext\fP function .SH "RETURN" .PP Returns the type of component found\&. Refer to the \fBXmStringComponentType\fP(3) reference page for a list of component types\&. .SH "RELATED" .PP \fBXmStringComponentType\fP(3), \fBXmStringCreate\fP(3), \fBXmStringGetNextComponent\fP(3), and \fBXmStringInitContext\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmListAddItem.30000644000175000017500000000373512672140200014477 00000000000000'\" t ...\" LstAddIA.sgm /main/7 1996/08/30 15:38:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListAddItem" "library call" .SH "NAME" \fBXmListAddItem\fP \(em A List function that adds an item to the list .iX "XmListAddItem" .iX "List functions" "XmListAddItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListAddItem\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListAddItem\fP adds an item to the list at the given position\&. When the item is inserted into the list, it is compared with the current \fBXmNselectedItems\fP list\&. If the new item matches an item on the selected list, it appears selected\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List to which an item is added\&. .IP "\fIitem\fP" 10 Specifies the item to be added to the list\&. .IP "\fIposition\fP" 10 Specifies the position of the new item in the list\&. A value of 1 makes the new item the first item in the list; a value of 2 makes it the second item; and so on\&. A value of 0 (zero) makes the new item the last item in the list\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmCreateRowColumn.30000644000175000017500000000556212672140200015405 00000000000000'\" t ...\" CreRow.sgm /main/8 1996/09/08 20:35:19 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateRowColumn" "library call" .SH "NAME" \fBXmCreateRowColumn\fP \(em The RowColumn widget creation function .iX "XmCreateRowColumn" .iX "creation functions" "XmCreateRowColumn" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateRowColumn\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateRowColumn\fP creates an instance of a RowColumn widget and returns the associated widget ID\&. If \fBXmNrowColumnType\fP is not specified, then it is created with \fBXmWORK_AREA\fP, which is the default\&. .PP If this function is used to create a Popup Menu of type \fBXmMENU_POPUP\fP or a Pulldown Menu of type \fBXmMENU_PULLDOWN\fP, a MenuShell widget is not automatically created as the parent of the menu pane\&. The application must first create the MenuShell by using either \fBXmCreateMenuShell\fP or the standard toolkit create function\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateMenuBar\fP(3), \fBXmCreateMenuShell\fP(3), \fBXmCreateOptionMenu\fP(3), \fBXmCreatePopupMenu\fP(3), \fBXmCreatePulldownMenu\fP(3), \fBXmCreateRadioBox\fP(3), \fBXmCreateSimpleCheckBox\fP(3), \fBXmCreateSimpleMenuBar\fP(3), \fBXmCreateSimpleOptionMenu\fP(3), \fBXmCreateSimplePopupMenu\fP(3), \fBXmCreateSimplePulldownMenu\fP(3), \fBXmCreateSimpleRadioBox\fP(3), \fBXmCreateWorkArea\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreateSimpleCheckBox\fP(3), \fBXmVaCreateSimpleMenuBar\fP(3), \fBXmVaCreateSimpleOptionMenu\fP(3), \fBXmVaCreateSimplePopupMenu\fP(3), \fBXmVaCreateSimplePulldownMenu\fP(3), and \fBXmVaCreateSimpleRadioBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmVaCreateBulletinBoard.30000644000175000017500000000276712672140200016501 00000000000000.DT .TH "XmVaCreateBulletinBoard" "library call" .SH "NAME" \fBXmVaCreateBulletinBoard\fP, \fBXmVaCreateManagedBulletinBoard\fP \(em A BulletinBoard widget convenience creation functions\&. .iX "XmVaCreateBulletinBoard" "XmVaCreateManagedBulletinBoard" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateBulletinBoard\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedBulletinBoard\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a BulletinBoard widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateBulletinBoard\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedBulletinBoard\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of BulletinBoard and its associated resources, see \fBXmBulletinBoard\fP(3)\&. .SH "RETURN" .PP Returns the BulletinBoard widget ID\&. .SH "RELATED" .PP \fBXmBulletinBoard\fP(3), \fBXmCreateBulletinBoard\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmListDeselectAllItems.30000644000175000017500000000305512672140200016346 00000000000000'\" t ...\" LstDeseA.sgm /main/7 1996/08/30 15:41:06 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeselectAllItems" "library call" .SH "NAME" \fBXmListDeselectAllItems\fP \(em A List function that unhighlights and removes all items from the selected list .iX "XmListDeselectAllItems" .iX "List functions" "XmListDeselectAllItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeselectAllItems\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeselectAllItems\fP unhighlights and removes all items from the selected list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget from whose list all selected items are deselected .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmListPosToBounds.30000644000175000017500000000541312672140200015402 00000000000000'\" t ...\" LstPosTo.sgm /main/8 1996/09/08 20:51:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListPosToBounds" "library call" .SH "NAME" \fBXmListPosToBounds\fP \(em A List function that returns the bounding box of an item at a specified position in a list .iX "XmListPosToBounds" .iX "List functions" "XmListPosToBounds" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmListPosToBounds\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR, \fBPosition *\fBx\fR\fR, \fBPosition *\fBy\fR\fR, \fBDimension *\fBwidth\fR\fR, \fBDimension *\fBheight\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListPosToBounds\fP returns the coordinates of an item within a list and the dimensions of its bounding box\&. The function returns the associated x and y-coordinates of the upper left corner of the bounding box relative to the upper left corner of the List widget, as well as the width and the height of the box\&. The caller can pass a NULL value for the \fIx\fP, \fIy\fP, \fIwidth\fP, or \fIheight\fP parameters to indicate that the return value for that parameter is not requested\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIposition\fP" 10 Specifies the position of the specified item\&. A value of 1 indicates the first item in the list; a value of 2 indicates the second item; and so on\&. A value of 0 (zero) specifies the last item in the list\&. .IP "\fIx\fP" 10 Specifies a pointer to the returned x-coordinate of the item\&. .IP "\fIy\fP" 10 Specifies the pointer to the returned y-coordinate of the item\&. .IP "\fIwidth\fP" 10 Specifies the pointer to the returned width of the item\&. .IP "\fIheight\fP" 10 Specifies the pointer to the returned height of the item\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP If the item at the specified position is not visible, returns False, and the returned values (if any) are undefined\&. Otherwise, this function returns True\&. .SH "RELATED" .PP \fBXmList\fP(3) and \fBXmListYToPos\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmCreateNotebook.30000644000175000017500000000347612672140200015242 00000000000000'\" t ...\" CreNot.sgm /main/7 1996/08/30 14:44:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateNotebook" "library call" .SH "NAME" \fBXmCreateNotebook\fP \(em The Notebook widget creation function .iX "XmCreateNotebook" .iX "Notebook functions" "XmCreateNotebook" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmCreateNotebook\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateNotebook\fP creates an instance of a Notebook widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of Notebook and its associated resources, see \fBXmNotebook\fP(3)\&. .SH "RETURN" .PP Returns the Notebook widget ID\&. .SH "RELATED" .PP \fBXmNotebook\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/MrmOpenHierarchyPerDisplay.30000644000175000017500000001736612672140200017245 00000000000000'\" t ...\" OpenHieC.sgm /main/10 1996/09/08 21:26:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmOpenHierarchyPerDisplay" "library call" .SH "NAME" \fBMrmOpenHierarchyPerDisplay\fP \(em Allocates a hierarchy ID and opens all the UID files in the hierarchy .iX "MrmOpenHierarchyPer\\%Display" .iX "uil functions" "MrmOpenHierarchyPer\\%Display" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmOpenHierarchyPerDisplay\fP\fR( \fBDisplay *\fBdisplay\fR\fR, \fBMrmCount \fBnum_files\fR\fR, \fBString \fBfile_names_list\fR[]\fR, \fBMrmOsOpenParamPtr *\fBancillary_structures_list\fR\fR, \fBMrmHierarchy *\fBhierarchy_id\fR\fR); .fi .SH "DESCRIPTION" .PP \fBMrmOpenHierarchyPerDisplay\fP allows you to specify the list of UID files that MRM searches in subsequent fetch operations\&. All subsequent fetch operations return the first occurrence of the named item encountered while traversing the UID hierarchy from the first list element (UID file specification) to the last list element\&. This function also allocates a hierarchy ID and opens all the UID files in the hierarchy\&. It initializes the optimized search lists in the hierarchy\&. If \fBMrmOpenHierarchyPerDisplay\fP encounters any errors during its execution, any files that were opened are closed\&. .PP The application must call \fBXtAppInitialize\fP before calling \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIdisplay\fP" 10 Specifies the connection to the X server and the value to pass to \fBXtResolvePathname\fP\&. For more information on the \fBDisplay\fR structure, see the Xlib function \fBXOpenDisplay\fP\&. .IP "\fInum_files\fP" 10 Specifies the number of files in the name list\&. .IP "\fIfile_names_list\fP" 10 Specifies an array of character strings that identify the UID files\&. .IP "\fIancillary_structures_list\fP" 10 A list of operating-system-dependent ancillary structures corresponding to items such as filenames, clobber flags, and so forth\&. This argument should be NULL for most operations\&. If you need to reference this structure, see the definition of \fBMrmOsOpenParamPtr\fR in the \fBMrmPublic\&.h\fP header file for more information\&. .IP "\fIhierarchy_id\fP" 10 Returns the search hierarchy ID\&. The search hierarchy ID identifies the list of UID files that MRM searches (in order) when performing subsequent fetch calls\&. .PP Each UID file string in \fIfile_names_list\fP can specify either a full pathname or a filename\&. If a UID file string has a leading / (slash), it specifies a full pathname, and MRM opens the file as specified\&. Otherwise, the UID file string specifies a filename\&. In this case MRM looks for the file along a search path specified by the \fBUIDPATH\fP environment variable or by a default search path, which varies depending on whether or not the \fBXAPPLRESDIR\fP environment variable is set\&. .PP The \fBUIDPATH\fP environment variable specifies a search path and naming conventions associated with UID files\&. It can contain the substitution field \fB%U\fP, where the UID file string from the \fIfile_names_list\fP argument to \fBMrmOpenHierarchyPerDisplay\fP is substituted for \fB%U\fP\&. It can also contain the substitution fields accepted by \fBXtResolvePathname\fP\&. The substitution field \fB%T\fP is always mapped to \fIuid\fP\&. The entire path is searched first with \fB%S\fP mapped to \fB\&.uid\fP\&. If no file is found, it is searched again with \fB%S\fP mapped to NULL\&. For example, the following \fBUIDPATH\fP value and \fBMrmOpenHierarchyPerDisplay\fP call cause MRM to open two separate UID files: .PP .nf \f(CWUIDPATH=/uidlib/%L/%U\&.uid:/uidlib/%U/%L static char *uid_files[] = {"/usr/users/me/test\&.uid", "test2"}; MrmHierarchy *Hierarchy_id; MrmOpenHierarchyPerDisplay((MrmCount)2,uid_files, NULL, Hierarchy_id)\fR .fi .PP .PP MRM opens the first file, \fB/usr/users/me/test\&.uid\fP, as specified in the \fIfile_names_list\fP argument to \fBMrmOpenHierarchyPerDisplay\fP, because the UID file string in the \fIfile_names_list\fP argument specifies a full pathname\&. MRM looks for the second file, \fBtest2\fP, first as \fB/uidlib/%L/test2\&.uid\fP and second as \fB/uidlib/test2/%L\fP, where the display\&'s language string is substituted for \fB%L\fP\&. .PP After \fBMrmOpenHierarchyPerDisplay\fP opens the UID hierarchy, you should not delete or modify the UID files until you close the UID hierarchy by calling \fBMrmCloseHierarchy\fP\&. .PP If \fBUIDPATH\fP is not set, but the environment variable \fBXAPPLRESDIR\fP is set, MRM searches the following pathnames: .IP " \(bu" 6 \fB%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/uid/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/uid/%U%S\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/include/X11/uid/%U%S\fP .PP If neither \fBUIDPATH\fP nor \fBXAPPLRESDIR\fP is set, MRM searches the following pathnames: .IP " \(bu" 6 \fB%U%S\fP .IP " \(bu" 6 \fB$HOME/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$HOME/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$HOME/uid/%N/%U%S\fP .IP " \(bu" 6 \fB$HOME/%L/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/%l/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/uid/%U%S\fP .IP " \(bu" 6 \fB$HOME/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%N/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/lib/X11/uid/%U%S\fP .IP " \(bu" 6 \fB/usr/include/X11/uid/%U%S\fP .PP These paths are defaults that vendors may change\&. For example, a vendor may use different directories for \fB/usr/lib/X11\fP and \fB/usr/include/X11\fP\&. .PP The following substitutions are used in these paths: .IP "\fB%U\fP" 10 The UID file string, from the \fIfile_names_list\fP argument\&. .IP "\fB%N\fP" 10 The class name of the application\&. .IP "\fB%L\fP" 10 The display\&'s language string\&. This string is influenced by \fBXtSetLanguageProc\fP\&. The default string is determined by calling setlocale(\fBLC_ALL, NULL\fP)\&. .IP "\fB%l\fP" 10 The language component of the display\&'s language string\&. .IP "\fB%S\fP" 10 The suffix to the filename\&. The entire path is first searched with a suffix of \fB\&.uid\fP\&. If no file is found, it is searched again with a NULL suffix\&. .SH "RETURN" .PP This function returns one of the following status return constants: .iX "MrmSUCCESS" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmNOT_FOUND\fP" 10 File not found\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmCloseHierarchy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmDropSiteUnregister.30000644000175000017500000000323012672140200016123 00000000000000'\" t ...\" DropSitX.sgm /main/8 1996/09/08 20:42:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteUnregister" "library call" .SH "NAME" \fBXmDropSiteUnregister\fP \(em A Drag and Drop function that frees drop site information .iX "XmDropSiteUnregister" .iX "Drag and Drop functions" "XmDropSiteUnregister" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropSiteUnregister\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteUnregister\fP informs the toolkit that the specified widget is no longer a registered drop site\&. The function frees all associated drop site information\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget, registered as a drop site, that is to be unregistered .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RELATED" .PP \fBXmDropSite\fP(3) and \fBXmDropSiteRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmVaCreateMultiList.30000644000175000017500000000272512672140200015673 00000000000000.DT .TH "XmVaCreateMultiList" "library call" .SH "NAME" \fBXmVaCreateMultiList\fP, \fBXmVaCreateManagedMultiList\fP \(em A MultiList widget convenience creation functions\&. .iX "XmVaCreateToggleMultiList" "XmVaCreateManagedMultiList" .iX "creation functions" "XmVaCreateMultiList" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateMultiList\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedMultiList\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateMultiList\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateMultiList\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RETURN" .PP Returns the MultiList widget ID\&. .SH "RELATED" .PP \fBXmMultiList\fP(3), \fBXmCreateMultiList\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmImMbResetIC.30000644000175000017500000000304112672140200014365 00000000000000'\" t ...\" ImMbRese.sgm /main/5 1996/08/25 21:47:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImMbResetIC" "library call" .SH "NAME" \fBXmImMbResetIC\fP \(em An input manager function that resets the input context for a widget .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImMbResetIC\fP\fR( \fBWidget \fBwidget\fR\fR, \fBchar \fB**mb\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImMbResetIC\fP gets the XIC of the widget and resets it\&. It puts a pointer to a string containing the current preedit string to \fImb\fP\&. The caller should free the returned string after use by calling \fBXfree\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget\&. .IP "\fImb\fP" 10 Contains a pointer to the preedit string upon return\&. .SH "RETURN VALUE" .PP None .SH "SEE ALSO" .PP ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmTextGetSubstring.30000644000175000017500000000670012672140200015614 00000000000000'\" t ...\" TxtGetSG.sgm /main/8 1996/09/08 21:18:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetSubstring" "library call" .SH "NAME" \fBXmTextGetSubstring\fP \(em A Text function that retrieves a copy of a portion of the internal text buffer .iX "XmTextGetSubstring" .iX "Text functions" "XmTextGetSubstring" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextGetSubstring\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBstart\fR\fR, \fBint \fBnum_chars\fR\fR, \fBint \fBbuffer_size\fR\fR, \fBchar *\fBbuffer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetSubstring\fP retrieves a copy of a portion of the internal text buffer of a Text widget\&. The function copies a specified number of characters from a given start position in the internal text buffer into a buffer provided by the application\&. A NULL terminator is placed at the end of the copied data\&. .PP The size of the required buffer depends on the maximum number of bytes per character (\fBMB_CUR_MAX\fP) for the current locale\&. \fBMB_CUR_MAX\fP is a macro defined in \fBstdlib\&.h\fP\&. The buffer should be large enough to contain the substring to be copied and a NULL terminator\&. Use the following equation to calculate the size of buffer the application should provide: .PP .nf \fIbuffer_size\fP = (\fInum_chars\fP* MB_CUR_MAX) + 1 \fB\fR(\fBvoid\fR) .fi .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fIstart\fP" 10 Specifies the beginning character position from which the data will be retrieved\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fInum_chars\fP" 10 Specifies the number of characters to be copied into the provided buffer\&. .IP "\fIbuffer_size\fP" 10 Specifies the size of the supplied buffer in bytes\&. This size should account for a NULL terminator\&. .IP "\fIbuffer\fP" 10 Specifies the character buffer into which the internal text buffer will be copied\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .IP "\fBXmCOPY_SUCCEEDED\fP" 10 The function was successful\&. .IP "\fBXmCOPY_FAILED\fP" 10 The function failed because it was unable to copy the specified number of characters into the buffer provided\&. The buffer size may be insufficient\&. The contents of \fIbuffer\fP are undefined\&. .IP "\fBXmCOPY_TRUNCATED\fP" 10 The requested number of characters extended beyond the internal buffer\&. The function copied characters between \fIstart\fP and the end of the widget\&'s buffer and terminated the string with a NULL terminator; fewer than \fInum_chars\fP characters were copied\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextGetSubstringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmSimpleSpinBox.30000644000175000017500000003547112672140200015072 00000000000000'\" t ...\" SSpinBox.sgm /main/10 1996/09/25 16:01:39 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSimpleSpinBox" "library call" .SH "NAME" \fBXmSimpleSpinBox\fP \(em a simple SpinBox widget class .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The XmSimpleSpinBox widget is a user interface control to increment and decrement an arbitrary TextField\&. For example, it can be used to cycle through the months of the year or days of the month\&. .PP Widget subclassing is not supported for the XmSimpleSpinBox widget class\&. .SS "Classes" .PP The XmSimpleSpinBox widget inherits behavior and resources from the \fBCore\fP, \fBComposite\fP and \fBXmManager\fP classes\&. .PP The class pointer is \fBXmSimpleSpinBoxWidgetClass\fP\&. .PP The class name is \fBXmSimpleSpinBoxWidget\fR\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the application to specify data\&. The application can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, the application must remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, the application must remove the \fBXm\fP prefix and use the remaining letters (in either lower case or upper case, but including any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .TS tab(); lw(1.760313i) lw(1.455192i) lw(0.672831i) lw(0.837127i) lw(0.774538i). \fBXmSimpleSpinBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP \fBXmNarrowLayout\fP\fBXmCArrowLayout\fP\fBunsigned char\fRXmARROWS_ENDCSG \fBXmNarrowSensitivity\fP\fBXmCArrowSensitivity\fP\fBunsigned char\fRXmARROWS-_SENSITIVECSG \fBXmNcolumns\fP\fBXmCColumn\fP\fBshort\fR20CSG \fBXmNdecimalPoints\fP\fBXmCDecimalPoints\fP\fBshort\fR0CSG \fBXmNeditable\fP\fBXmCEditable\fP\fBBoolean\fPTrueCSG \fBXmNincrementValue\fP\fBXmCIncrementValue\fP\fBint\fR1CSG \fBXmNinitialDelay\fP\fBXmCInitialDelay\fP\fBunsigned int\fR250CSG \fBXmNmaximumValue\fP\fBXmCMaximumValue\fP\fBint\fR10CSG \fBXmNminimumValue\fP\fBXmCMinimumValue\fP\fBint\fR0CSG \fBXmNmodifyVerifyCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fRNULLC \fBXmNnumValues\fP\fBXmCNumValues\fP\fBint\fR0CSG \fBXmNposition\fP\fBXmCPosition\fP\fBint\fR0CSG \fBXmNrepeatDelay\fP\fBXmCRepeatDelay\fP\fBunsigned int\fR200CSG \fBXmNspinBoxChildType\fP\fBXmCSpinBoxChildType\fP\fBunsigned char\fRXmSTRINGCG \fBXmNtextField\fP\fBXmCTextField\fP\fBWidget\fRdynamicG \fBXmNvalueChangedCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fRNULLC \fBXmNvalues\fP\fBXmCValues\fP\fBXmStringTable\fRNULLCSG .TE .IP "\fBXmNarrowLayout\fP" 10 Specifies the style and position of the SpinBox arrows\&. The following values are supported: .RS .IP "XmARROWS_FLAT_BEGINNING" 10 The arrows are placed side by side to the right of the TextField\&. .IP "XmARROWS_FLAT_END" 10 The arrows are placed side by side to the left of the TextField\&. .IP "XmARROWS_SPLIT" 10 The down arrow is on the left and the up arrow is on the right of the TextField\&. .IP "XmARROWS_BEGINNING" 10 The arrows are stacked and placed on the left of the TextField\&. .IP "XmARROWS_END" 10 The arrows are stacked and placed on the right of the TextField\&. .RE .IP "\fBXmNarrowSensitivity\fP" 10 Specifies the sensitivity of the arrows in the XmSimpleSpinBox\&. The following values are supported: .RS .IP "XmARROWS_SENSITIVE" 10 Both arrows are active to user selection\&. .IP "XmARROWS_DECREMENT_SENSITIVE" 10 The down arrow is active and the up arrow is inactive to user selection\&. .IP "XmARROWS_INCREMENT_SENSITIVE" 10 The up arrow is active and the down arrow is inactive to user selection\&. .IP "XmARROWS_INSENSITIVE" 10 Both arrows are inactive to user selection\&. .RE .IP "\fBXmNcolumns\fP" 10 Specifies the number of columns of the text field\&. .IP "\fBXmNdecimalPoints\fP" 10 Specifies the position of the radix character within the numeric value when \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. This resource is used to allow for floating point values in the XmSimpleSpinBox widget\&. .IP "\fBXmNeditable\fP" 10 Specifies whether the text field can take input\&. .IP "" 10 When \fBXmNeditable\fP is used on a widget it sets the dropsite to \fBXmDROP_SITE_ACTIVE\fP\&. .IP "\fBXmNincrementValue\fP" 10 Specifies the amount to increment or decrement the \fBXmNposition\fP when the \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. When the Up action is activated, the \fBXmNincrementValue\fP is added to the \fBXmNposition\fP value; when the Down action is activated, the \fBXmNincrementValue\fP is subtracted from the \fBXmNposition\fP value\&. When \fBXmNspinBoxChildType\fP is \fBXmSTRING\fP, this resource is ignored\&. .IP "\fBXmNinitialDelay\fP" 10 Specifies the amount of time in milliseconds before the Arrow buttons will begin to spin continuously\&. .IP "\fBXmNnumValues\fP" 10 Specifies the number of items in the \fBXmNvalues\fP list when the \fBXmNspinBoxChildType\fP resource is \fBXmSTRING\fP\&. The value of this resource must be a positive integer\&. The \fBXmNnumValues\fP is maintained by the XmSimpleSpinBox widget when items are added or deleted from the \fBXmNvalues\fP list\&. When \fBXmNspinBoxChildType\fP is not \fBXmSTRING\fP, this resource is ignored\&. .IP "\fBXmNvalues\fP" 10 Supplies the list of strings to cycle through when the \fBXmNspinButtonChildType\fP resource is \fBXmSTRING\fP\&. When \fBXmNspinBoxChildType\fP is not \fBXmSTRING\fP, this resource is ignored\&. .IP "\fBXmNmaximumValue\fP" 10 Specifies the upper bound on the XmSimpleSpinBox\&'s range when \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. .IP "\fBXmNminimumValue\fP" 10 Specifies the lower bound on the XmSimpleSpinBox\&'s range when \fBXmNspinBoxChildType\fP is \fBXmNUMERIC\fP\&. .IP "\fBXmNmodifyVerifyCallback\fP" 10 Specifies the callback to be invoked just before the XmSimpleSpinBox position changes\&. The application can use this callback to implement new application-related logic (including setting new position spinning to, or canceling the impending action)\&. For example, this callback can be used to stop the spinning just before wrapping at the upper and lower position boundaries\&. If the application sets the \fIdoit\fP member of the \fBXmSimpleSpinBoxCallbackStruct\fR to False, nothing happens\&. Otherwise, the position changes\&. Reasons sent by the callback are \fBXmCR_SPIN_NEXT\fP, or \fBXmCR_SPIN_PRIOR\fP\&. .IP "\fBXmNposition\fP" 10 The \fBXmNposition\fP resource has a different value based on the \fBXmNspinBoxChildType\fP resource\&. When \fBXmNspinBoxChildType\fP is \fBXmSTRING\fP, the \fBXmNposition\fP is the index into the \fBXmNvalues\fP list for the current item\&. When the \fBXmNspinBoxChildType\fP resource is \fBXmNUMERIC\fP, the \fBXmNposition\fP is the integer value of the XmSimpleSpinBox that falls within the range of \fBXmNmaximumValue\fP and \fBXmNminimumValue\fP\&. .IP "\fBXmNrepeatDelay\fP" 10 Specifies the number of milliseconds between repeated calls to the \fBXmNvalueChangedCallback\fP while the user is spinning the XmSimpleSpinBox\&. .IP "\fBXmNspinBoxChildType\fP" 10 Specifies the style of the XmSimpleSpinBox\&. The following values are supported: .RS .IP "XmSTRING" 10 The child is a string value that is specified through the \fBXmNvalues\fP resource and incremented and decremented by changing the \fBXmNposition\fP resource\&. .IP "XmNUMERIC" 10 The child is a numeric value that is specified through the \fBXmNposition\fP resource and incremented according to the \fBXmNincrementValue\fP resource\&. .RE .IP "\fBXmtextField\fP" 10 Specifies the textfield widget\&. .IP "\fBXmNvalueChangedCallback\fP" 10 Specifies the callback to be invoked whenever the value of the \fBXmNposition\fP resource is changed through the use of the spinner arrows\&. The \fBXmNvalueChangedCallback\fP passes the \fBXmSimpleSpinBoxCallbackStruct\fR \fIcall_data\fP structure\&. .SS "Inherited Resources" .PP The XmSimpleSpinBox widget inherits behavior and resources from the following named superclasses\&. For a complete description of each resource, see the man page for that superclass\&. .TS tab(); lw(1.573795i) lw(1.565512i) lw(0.894578i) lw(0.712349i) lw(0.753765i). \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP \fBXmNbottomShadowColor\fP\fBXmCBottomShadowColor\fP\fBPixel\fRdynamicCSG \fBXmNbottomShadowPixmap\fP\fBXmCBottomShadowPixmap\fP\fBPixmap\fR\fBXmUNSPECIFIED_PIXMAP\fPCSG \fBXmNforeground\fP\fBXmCForeground\fP\fBPixel\fRdynamicCSG \fBXmNhelpCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fRNULLC \fBXmNhighlightColor\fP\fBXmCHighlightColor\fP\fBPixel\fRdynamicCSG \fBXmNhighlightPixmap\fP\fBXmCHighlightPixmap\fP\fBPixmap\fRdynamicCSG \fBXmNinitialFocus\fP\fBXmCInitialFocus\fP\fBWidget\fRNULLCSG \fBXmNnavigationType\fP\fBXmCNavigationType\fP\fBXmNavigationType\fRdynamicCSG \fBXmNshadowThickness\fP\fBXmCShadowThickness\fP\fBDimension\fRdynamicCSG \fBXmNstringDirection\fP\fBXmCStringDirection\fP\fBXmStringDirection\fRdynamicCG \fBXmNtopShadowColor\fP\fBXmCTopShadowColor\fP\fBPixel\fRdynamicCSG \fBXmNtopShadowPixmap\fP\fBXmCTopShadowPixmap\fP\fBPixmap\fRdynamicCSG \fBXmNtraversalOn\fP\fBXmCTraversalOn\fP\fBBoolean\fRdynamicCSG \fBXmNunitType\fP\fBXmCUnitType\fP\fBunsigned char\fRdynamicCSG \fBXmNuserData\fP\fBXmCUserData\fP\fBXtPointer\fRNULLCSG .TE .TS tab(); lw(1.563813i) lw(1.581583i) lw(0.701939i) lw(0.879645i) lw(0.773021i). \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP \fBXmNchildren\fP\fBXmCReadOnly\fP\fBWidgetList\fRNULLG \fBXmNinsertPosition\fP\fBXmCInsertPosition\fP\fBXtOrderProc\fRdefault procedureCSG \fBXmNnumChildren\fP\fBXmCReadOnly\fP\fBCardinal\fR0G .TE .TS tab(); lw(1.595729i) lw(1.571429i) lw(0.761414i) lw(0.704713i) lw(0.866716i). \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP \fBXmNaccelerators\fP\fBXmCAccelerators\fP\fBXtAccelerators\fRdynamicCSG \fBXmNancestorSensitive\fP\fBXmCSensitive\fP\fBBoolean\fRdynamicG \fBXmNbackground\fP\fBXmCBackground\fP\fBPixel\fRdynamicCSG \fBXmNbackgroundPixmap\fP\fBXmCPixmap\fP\fBPixmap\fR\fBXmUNSPECIFIED_PIXMAP\fPCSG \fBXmNborderColor\fP\fBXmCBorderColor\fP\fBPixel\fRXtDefaultForegroundCSG \fBXmNborderPixmap\fP\fBXmCPixmap\fP\fBPixmap\fR\fBXmUNSPECIFIED_PIXMAP\fPCSG \fBXmNborderWidth\fP\fBXmCBorderWidth\fP\fBDimension\fR0CSG \fBXmNcolormap\fP\fBXmCColormap\fP\fBColormap\fRdynamicCG \fBXmNdepth\fP\fBXmCDepth\fP\fBint\fRdynamicCG \fBXmNdestroyCallback\fP\fBXmCCallback\fP\fBXtCallbackList\fRNULLC \fBXmNheight\fP\fBXmCHeight\fP\fBDimension\fRdynamicCSG \fBXmNinitialResourcesPersistent\fP\fBXmCInitialResourcesPersistent\fP\fBBoolean\fRTrueC \fBXmNmappedWhenManaged\fP\fBXmCMappedWhenManaged\fP\fBBoolean\fRTrueCSG \fBXmNscreen\fP\fBXmCScreen\fP\fBScreen *\fRdynamicCG \fBXmNsensitive\fP\fBXmCSensitive\fP\fBBoolean\fRTrueCSG \fBXmNtranslations\fP\fBXmCTranslations\fP\fBXtTranslations\fRdynamicCSG \fBXmNwidth\fP\fBXmCWidth\fP\fBDimension\fRdynamicCSG \fBXmNx\fP\fBXmCPosition\fP\fBPosition\fR0CSG \fBXmNy\fP\fBXmCPosition\fP\fBPosition\fR0CSG .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each XmSimpleSpinBox callback: .PP .nf \f(CWtypedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Widget \fIwidget\fP; Boolean \fIdoit\fP; int \fIposition\fP; XmString \fIvalue\fP; Boolean \fIcrossed_boundary\fP; } XmSimpleSpinBoxCallbackStruct;\fR .fi .PP .PP The \fIreason\fP argument indicates why the callback was invoked\&. There are three possible reasons for this callback to be issued\&. The reason is \fBXmCR_OK\fP when this is the first call to the callback at the beginning of a spin or if it is a single activation of the spin arrows\&. If the XmSimpleSpinBox is in the process of being continuously spun, then the reason will be \fBXmCR_SPIN_NEXT\fP or \fBXmCR_SPIN_PRIOR\fP, depending on the arrow that is spinning\&. .PP The \fIevent\fP argument points to the \fBXEvent\fR that triggered the callback\&. It can be \fBNULL\fP when the XmSimpleSpinBox is continuously spinning\&. .PP The \fIwidget\fP argument is the widget identifier for the simple spin box widget that has been affected by this callback\&. .PP The \fIdoit\fP argument is set only when the \fIcall_data\fP comes from the \fBXmNmodifyVerifyCallback\fP\&. It indicates that the action that caused the callback to be called should be performed\&. The action is not performed if \fIdoit\fP is set to False\&. .PP The \fIposition\fP argument is the new value of the \fBXmNposition\fP resource as a result of the spin\&. .PP The \fIvalue\fP argument is the new \fBXmString\fR value displayed in the Text widget as a result of the spin\&. The application must copy this string if it is used beyond the scope of the \fIcall_data\fP structure\&. .PP The \fIcrossed_boundary\fP argument is True when the spinbox cycles\&. This is the case when a \fBXmNspinBoxChildType\fP of \fBXmSTRING\fP wraps from the first item to the last or the last item to the first\&. In the case of the \fBXmNspinBoxChildType\fP of \fBXmNUMERIC\fP, the boundary is crossed when the XmSimpleSpinBox cycles from the maximum value to the minimum or vice versa\&. .SH "ERRORS/WARNINGS" .PP The toolkit will display a warning if the application tries to set the value of the \fBXmNtextField\fP resource, which is read-only (marked G in the resource table)\&. .SH "SEE ALSO" .PP \fBXmSpinBox\fP(3), \fBXmCreateSimpleSpinBox\fP(3), \fBXmCreateSpinBox\fP(3), \fBXmSimpleSpinBoxAddItem\fP(3), \fBXmSimpleSpinBoxDeletePos\fP(3), \fBXmSimpleSpinBoxSetItem\fP(3), \fBComposite\fP(3), \fBCore\fP(3), \fBXmManager\fP(3), \fBXmText\fP(3), \fBXmTextField\fP(3), \fBXtGetValues\fP(3), \fBXtSetValues\fP(3), \fBXmVaCreateSimpleSpinBox\fP(3), and \fBXmVaCreateManagedSimpleSpinBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmToggleButtonGadget.30000644000175000017500000006760712672140200016075 00000000000000'\" t ...\" ToggleBB.sgm /main/15 1996/09/25 13:46:27 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmToggleButtonGadget" "library call" .SH "NAME" \fBXmToggleButtonGadget\fP \(em The ToggleButtonGadget widget class .iX "XmToggleButtonGadget" .iX "widget class" "ToggleButtonGadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP ToggleButtonGadget sets nontransitory state data within an application\&. Usually this gadget consists of an indicator (square, diamond, or round) with either text or a pixmap on one side of it\&. However, it can also consist of just text or a pixmap without the indicator\&. .PP The toggle graphics display a \fB1-of-many\fP, \fBN-of-many\fP, or \fBN-of-many-round\fP selection state\&. When a toggle indicator is displayed, a square indicator shows an \fBN-of-many\fP selection state, a diamond-shaped indicator shows a \fB1-of-many\fP selection state, and a circle-shaped indicator shows a \fB1-of-many-round\fP selection state\&. .PP ToggleButtonGadget implies a set or unset state\&. In the case of a label and an indicator, an empty indicator (square, diamond, or round) indicates that ToggleButtonGadget is unset, and a filled indicator shows that it is set\&. The indicator may be filled with a check mark or the select color\&. In the case of a pixmap toggle, different pixmaps are used to display the set/unset states\&. ToggleButtonGadget can also indicate an indeterminate state\&. In the case of a label and an indicator, an indeterminate state is indicated by a stippled flat box\&. In the case of a pixmap toggle, a different pixmap is used to display the indeterminate state\&. .PP The default behavior associated with a ToggleButtonGadget in a menu depends on the type of menu system in which it resides\&. By default, \fB\fP controls the behavior of the ToggleButtonGadget\&. In addition, \fB\fP controls the behavior of the ToggleButtonGadget if it resides in a PopupMenu system\&. The actual mouse button used is determined by its RowColumn parent\&. .PP Label\&'s resource \fBXmNmarginLeft\fP may be increased to accommodate the toggle indicator when it is created\&. .PP ToggleButtonGadget uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits\&. .SS "Classes" .PP ToggleButtonGadget inherits behavior, resources, and traits from \fBObject\fP, \fBRectObj\fP, \fBXmGadget\fP and \fBXmLabelGadget\fP\&. .PP The class pointer is \fBxmToggleButtonGadgetClass\fP\&. .PP The class name is \fBXmToggleButtonGadget\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmToggleButtonGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNarmCallbackXmCArmCallbackXtCallbackListNULLC _____ XmNdetailShadowThicknessXmCDetailShadowThicknessDimension2CSG _____ XmNdisarmCallbackXmCDisarmCallbackXtCallbackListNULLC _____ XmNfillOnSelectXmCFillOnSelectBooleandynamicCSG _____ XmNindeterminatePixmapXmCIndeterminatePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNindicatorOnXmCIndicatorOnunsigned charXmINDICATOR_FILLCSG _____ XmNindicatorSizeXmCIndicatorSizeDimensiondynamicCSG _____ XmNindicatorTypeXmCIndicatorTypeunsigned chardynamicCSG _____ XmNselectColorXmCSelectColorPixeldynamicCSG _____ XmNselectInsensitivePixmapXmCSelectInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNselectPixmapXmCSelectPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNsetXmCSetunsigned charXmUNSETCSG _____ XmNspacingXmCSpacingDimension4CSG _____ XmNtoggleModeXmCToggleModeunsigned charXmTOGGLE_BOOLEANCSG _____ XmNunselectColorXmCUnselectColorPixeldynamicCSG _____ XmNvalueChangedCallbackXmCValueChangedCallbackXtCallbackListNULLC _____ XmNvisibleWhenOffXmCVisibleWhenOffBooleandynamicCSG _____ .TE .IP "\fBXmNarmCallback\fP" 10 Specifies a list of callbacks that is called when the ToggleButtonGadget is armed\&. To arm this gadget, press the active mouse button while the pointer is inside the ToggleButtonGadget\&. For this callback, the reason is \fBXmCR_ARM\fP\&. .IP "\fBXmNdetailShadowThickness\fP" 10 Specifies the thickness of the indicator shadow\&. The default thickness is 2 pixels\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies a list of callbacks called when ToggleButtonGadget is disarmed\&. To disarm this gadget, press and release the active mouse button while the pointer is inside the ToggleButtonGadget\&. The gadget is also disarmed when the user moves out of the gadget and releases the mouse button when the pointer is outside the gadget\&. For this callback, the reason is \fBXmCR_DISARM\fP\&. .IP "\fBXmNfillOnSelect\fP" 10 Fills the indicator with the color specified in \fBXmNselectColor\fP and switches the top and bottom shadow colors when set to True\&. If unset, fills the indicator with the unselect color\&. If indeterminate, fills the indicator with half select color and half unselect color\&. Otherwise, it switches only the top and bottom shadow colors\&. The default is set True only if a box type of indicator (such as a check box) is specified, or if the \fBXmNindicatorType\fP is a \fB1-of\fP type and a toggle indicator is drawn\&. If \fBXmNfillOnSelect\fP is True, \fBXmNset\fP is \fBXmSET\fP, and \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP the ToggleButtonGadget\&'s background is set to \fBXmNselectColor\fP\&. For the other \fBXmNindicatorOn\fP values, only the indicator is filled with \fBXmNselectColor\fP\&. .IP "\fBXmNindeterminateInsensitivePixmap\fP" 10 Specifies the pixmap to be displayed as the button face when the Label \fBXmNlableType\fP resource is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the ToggleButtonGadget \fBXmNset\fP resource is \fBXmINDETERMINATE\fP, and the \fBCore\fP \fBXmNsensitive\fP resource is False\&. .IP "\fBXmNindeterminatePixmap\fP" 10 Specifies the pixmap to be displayed as the button face when the Label \fBXmNlableType\fP resource is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the ToggleButtonGadget \fBXmNset\fP resource is \fBXmINDETERMINATE\fP, and the \fBCore\fP \fBXmNsensitive\fP resource is True\&. .IP "\fBXmNindicatorOn\fP" 10 Specifies that if a toggle indicator is to be drawn, it will be drawn to one side of the toggle text or pixmap, depending on the \fBXmNlayoutDirection\fP resource of the widget\&. The default value is \fBXmINDICATOR_FILL\fP\&. Toggles accept the following values: .RS .IP "\fBXmINDICATOR_NONE\fP" 10 No space is allocated for the indicator, and it is not displayed\&. Any shadows around the entire widget are switched when the toggle is selected or unselected\&. .IP "\fBXmINDICATOR_BOX\fP" 10 The toggle indicator is in the shape of a shadowed box\&. .IP "\fBXmINDICATOR_FILL\fP" 10 If the value of the \fBXmDisplay XmNenableToggleVisual\fP resource is \fBTrue\fP , the visuals are those of \fBXmINDICATOR_CHECK_BOX\fP ; if \fBFalse\fP , the indicator visuals are those of \fBXmINDICATOR_BOX\fP\&. .IP "\fBXmINDICATOR_CHECK\fP" 10 The toggle indicator is in the shape of a checkmark in the foreground color\&. .IP "\fBXmINDICATOR_CHECK_BOX\fP" 10 The toggle indicator is in the shape of a checkmark enclosed in a box\&. This is the default if the \fBXmDisplay XmNenableToggleVisual\fP resource is set\&. .IP "\fBXmINDICATOR_CROSS_BOX\fP" 10 The toggle indicator is in the shape of a cross enclosed in a box\&. .IP "\fBXmINDICATOR_CROSS\fP" 10 The toggle indicator is in the shape of a cross\&. .RE .IP "" 10 All ToggleButton checks and crosses should be drawn in the foreground color\&. .IP "" 10 If this resource is not \fBXmINDICATOR_NONE\fP, it will control the appearance of the toggle visual\&. If \fBXmNset\fP is \fBXmINDETERMINATE\fP and \fBXmNindicatorOn\fP is not \fBXmINDICATOR_NONE\fP, this resource shows a stippled flat box\&. If \fBXmNset\fP is \fBXmINDETERMINATE\fP, \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP, and \fBXmNtoggleMode\fP is \fBXmTOGGLE_INDETERMINATE\fP, the label and the ToggleButton are stippled with a combination of the \fBXmNselectColor\fP and the \fBXmNunselectColor\fP color, and the border is flat\&. .IP "\fBXmNindicatorSize\fP" 10 Sets the size of the indicator\&. If no value is specified, the size of the indicator is based on the size of the label string or pixmap\&. If the label string or pixmap changes, the size of the indicator is recomputed based on the size of the label string or pixmap\&. Once a value has been specified for \fBXmNindicatorSize\fP, the indicator has that size, regardless of the size of the label string or pixmap, until a new value is specified\&. The size of indicators inside menus may differ from those outside of menus\&. Note that a change in this resource may also cause a change in the values of the inherited resources \fBXmNmarginTop\fP, \fBXmNmarginBottom\fP, and \fBXmNmarginLeft\fP\&. .IP "\fBXmNindicatorType\fP" 10 Specifies if the indicator is a \fB1-of\fP or \fBN-of\fP indicator\&. For the \fB1-of\fP indicator, the value can be \fBXmONE_OF_MANY\fP, \fBXmONE_OF_MANY_ROUND\fP, or \fBXmONE_OF_MANY_DIAMOND\fP\&. For the \fBN-of\fP indicator, the value is \fBXmN_OF_MANY\fP\&. This value specifies only the visuals and does not enforce the behavior\&. When the ToggleButton is in a radio box, the default is \fBXmONE_OF_MANY\fP; otherwise, the default is \fBXmN_OF_MANY\fP\&. Legal values are: .RS .IP "\fBXmONE_OF_MANY\fP" 10 When the Display \fBXmNenableToggleVisual\fP resource is set, indicators are drawn with the same appearance as \fBXmONE_OF_MANY_ROUND\fP; otherwise, they appear the same as \fBXmONE_OF_MANY_DIAMOND\fP\&. .IP "\fBXmN_OF_MANY\fP" 10 The indicators are drawn as specified by the \fBXmNindicatorOn\fP resource\&. .IP "\fBXmONE_OF_MANY_ROUND\fP" 10 A shadowed circle\&. .IP "\fBXmONE_OF_MANY_DIAMOND\fP" 10 A shadowed diamond\&. .RE .IP "\fBXmNselectColor\fP" 10 Allows the application to specify what color fills the center of the square, diamond-shaped, or round indicator when it is set\&. If this color is the same as either the top or the bottom shadow color of the indicator, a one-pixel-wide margin is left between the shadows and the fill; otherwise, it is filled completely\&. The results of this resource depend on the value of the Display resource \fBXmNenableToggleColor\fP\&. A value of True causes the fill color to use the \fBXmHIGHLIGHT_COLOR\fP color by default\&. A value of False causes the fill color to use the background color\&. This resource\&'s default for a color display is a color between the background and the bottom shadow color\&. For a monochrome display, the default is set to the foreground color\&. To set the background of the button to \fBXmNselectColor\fP when \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP, the value of \fBXmNfillOnSelect\fP must be explicitly set to True\&. .IP "" 10 This resource can take the following values: .RS .IP "\fBXmDEFAULT_SELECT_COLOR\fP" 10 Is the same as the current dynamic default, which is a color between the background and the bottom shadow color\&. .IP "\fBXmREVERSED_GROUND_COLORS\fP" 10 Forces the select color to the foreground color and causes the default color of any text rendered over the select color to be in the background color\&. .IP "\fBXmHIGHLIGHT_COLOR\fP" 10 Forces the fill color to use the highlight color\&. .RE .IP "\fBXmNselectInsensitivePixmap\fP" 10 Specifies a pixmap used as the button face when the ToggleButtonGadget is selected, the button is insensitive, and the LabelGadget resource \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&. If the ToggleButtonGadget is unselected and the button is insensitive, the pixmap in \fBXmNlabelInsensitivePixmap\fP is used as the button face\&. If no value is specified for \fBXmNlabelInsensitivePixmap\fP, that resource is set to the value specified for \fBXmNselectInsensitivePixmap\fP\&. .IP "\fBXmNselectPixmap\fP" 10 Specifies the pixmap to be used as the button face if \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, and the ToggleButtonGadget is selected\&. When the ToggleButtonGadget is unselected, the pixmap specified in LabelGadget\&'s \fBXmNlabelPixmap\fP is used\&. If no value is specified for \fBXmNlabelPixmap\fP, that resource is set to the value specified for \fBXmNselectPixmap\fP\&. .IP "\fBXmNset\fP" 10 Represents the state of the ToggleButton\&. A value of \fBXmUNSET\fP indicates that the ToggleButton is not set\&. A value of \fBXmSET\fP indicates that the ToggleButton is set\&. A value of \fBXmINDETERMINATE\fP indicates that the ToggleButton is in an indeterminate state (neither set nor unset)\&. The ToggleButton states cycle through in the order of \fBXmSET\fP, \fBXmINDETERMINATE\fP (if \fBXmNtoggleMode\fP is set to \fBXmTOGGLE_INDETERMINATE\fP), and \fBXmUNSET\fP, and then back around to \fBXmSET\fP\&. If \fBXmNtoggleMode\fP is set to \fBXmTOGGLE_BOOLEAN\fP, then the ToggleButton states cycle through in the order of \fBXmSET\fP, then \fBXmUNSET\fP, and then back around to \fBXmSET\fP\&. Setting this resource sets the state of the ToggleButton\&. .IP "\fBXmNspacing\fP" 10 Specifies the amount of spacing between the toggle indicator and the toggle label (text or pixmap)\&. .IP "\fBXmNtoggleMode\fP" 10 Specifies the mode of the ToggleButtonGadget as either \fBXmTOGGLE_BOOLEAN\fP or \fBXmTOGGLE_INDETERMINATE\fP\&. The \fBXmTOGGLE_INDETERMINATE\fP value allows the \fBXmNset\fP resource to be able to accept the values \fBXmINDETERMINATE\fP, \fBXmSET\fP, and \fBXmUNSET\fP\&. The \fBXmNtoggleMode\fP resource is forced to \fBXmTOGGLE_BOOLEAN\fP if the toggle is in an \fBXmRowColumn\fP widget whose radio behavior is \fBXmONE_OF_MANY\fP\&. In \fBXmTOGGLE_BOOLEAN\fP mode, the \fBXmNset\fP resource can only accept \fBXmSET\fP and \fBXmUNSET\fP\&. .IP "\fBXmNunselectColor\fP" 10 Allows the application to specify what color fills the center of the square, diamond-shaped, or round indicator when it is not set\&. If this color is the same as either the top or the bottom shadow color of the indicator, a one-pixel-wide margin is left between the shadows and the fill; otherwise, it is filled completely\&. This resource\&'s default for a color display is \fBXmNbackground\fP\&. For a monochrome display, the default is set to the background color\&. To set the background of the button to \fBXmNunselectColor\fP when \fBXmNindicatorOn\fP is \fBXmINDICATOR_NONE\fP, the value of \fBXmNfillOnSelect\fP must be explicitly set to True\&. This resource acts like the \fBXmNselectColor\fP resource, but for the case when \fBXmNset\fP is \fBXmUNSET\fP\&. .IP "\fBXmNvalueChangedCallback\fP" 10 Specifies a list of callbacks called when the ToggleButtonGadget value is changed\&. To change the value, press and release the active mouse button while the pointer is inside the ToggleButtonGadget\&. This action also causes the gadget to be disarmed\&. For this callback, the reason is \fBXmCR_VALUE_CHANGED\fP\&. .IP "\fBXmNvisibleWhenOff\fP" 10 Indicates that the toggle indicator is visible in the unselected state when the Boolean value is True\&. When the ToggleButtonGadget is in a menu, the default value is False\&. When the ToggleButtonGadget is in a RadioBox, the default value is True\&. .SS "Inherited Resources" .PP ToggleButtonGadget inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabelGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLCSG _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLCSG _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimensiondynamicCSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimensiondynamicCSG _____ XmNmarginRightXmCMarginRightDimension0CSG _____ XmNmarginTopXmCMarginTopDimensiondynamicCSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringdynamicCSG _____ XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG _____ XmNpixmapTextPaddingXmCSpaceDimension2CSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIset\fP; } XmToggleButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fIset\fP" 10 Reflects the ToggleButtonGadget\&'s state, either \fBXmSET\fP (selected), \fBXmUNSET\fP (unselected), or \fBXmINDETERMINATE\fP (neither)\&. Note that the reported state is the state that the ToggleButtonGadget is in after the \fIevent\fP has been processed\&. For example, suppose that a user clicks on a ToggleButtonGadget to change it from the unselected state to the selected state\&. In this case, ToggleButtonGadget changes the value of \fIset\fP from \fBXmUNSET\fP to \fBXmSET\fP prior to calling the callback\&. .SS "Behavior" .PP \fBXmToggleButtonGadget\fP includes behavior from \fBXmGadget\fP\&. \fBXmToggleButtonGadget\fP includes menu traversal behavior from \fBXmLabelGadget\fP\&. Additional \fBXmToggleButtonGadget\fP behavior is described in the following list: .IP "\fB\fP:" 10 Drags the contents of a ToggleButtonGadget label, identified when \fB\fP is pressed\&. This action is undefined for ToggleButtonGadgets used in a menu system\&. .IP "\fB\fP:" 10 In a menu, this action unposts any menus posted by the ToggleButtonGadget\&'s parent menu, disables keyboard traversal for the menu, and enables mouse traversal for the menu\&. It draws the shadow in the armed state and, unless the button is already armed, calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, if the button was previously unset, this action does the following: if \fBXmNindicatorOn\fP is True, it draws the indicator shadow so that the indicator looks pressed; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the color specified by \fBXmNselectColor\fP\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks pressed\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNselectPixmap\fP is used as the button face\&. This resource calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, if the button was previously set, this action does the following: if both \fBXmNindicatorOn\fP and \fBXmNvisibleWhenOff\fP are True, it draws the indicator shadow so that the indicator looks raised; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the background color\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks raised\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used as the button face\&. This resource calls the \fBXmNarmCallback\fP callbacks\&. .IP "\fB\fP:" 10 In a menu, this action unposts all menus in the menu hierarchy\&. If the ToggleButtonGadget was previously set, this action unsets it; if the ToggleButtonGadget was previously unset, this action sets it\&. It calls the \fBXmNvalueChangedCallback\fP callbacks and then the \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 If the button is outside a menu and the pointer is within the button, this action does the following: if the button was previously unset, sets it; if the button was previously set, unsets it\&. This action calls the \fBXmNvalueChangedCallback\fP callbacks\&. .IP "" 10 If the button is outside a menu, this action calls the \fBXmNdisarmCallback\fP callbacks\&. .IP "\fB\fP\fB\fP:" 10 In a Pulldown or Popup MenuPane, unposts all menus in the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu system was entered\&. Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "\fB\fP\fB\fP:" 10 In a menu, this action unposts all menus in the menu hierarchy\&. Unless the button is already armed, this action calls the \fBXmNarmCallback\fP callbacks; and calls the \fBXmNvalueChangedCallback\fP and \fBXmNdisarmCallback\fP callbacks\&. Outside a menu, if the parent is a manager, this action passes the event to the parent\&. .IP "\fB\fP\fB\fP:" 10 If the ToggleButtonGadget was previously set, this action unsets it; if the ToggleButtonGadget was previously unset, this action sets it\&. .IP "" 10 In a menu, this action unposts all menus in the menu hierarchy\&. Unless the button is already armed, this action calls the \fBXmNarmCallback\fP, the \fBXmNvalueChangedCallback\fP, and \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, if the button was previously unset, this action does the following: If \fBXmNindicatorOn\fP is True, it draws the indicator shadow so that the indicator looks pressed; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the color specified by \fBXmNselectColor\fP\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks pressed\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNselectPixmap\fP is used as the button face\&. This action calls the \fBXmNarmCallback\fP, \fBXmNvalueChangedCallback\fP, \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 Outside a menu, if the button was previously set, this action does the following: If both \fBXmNindicatorOn\fP and \fBXmNvisibleWhenOff\fP are True, it draws the indicator shadow so that the indicator looks raised; if \fBXmNfillOnSelect\fP is True, it fills the indicator with the background color\&. If \fBXmNindicatorOn\fP is False, it draws the button shadow so that the button looks raised\&. If \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the \fBXmNlabelPixmap\fP is used as the button face\&. Calls the \fBXmNarmCallback\fP, \fBXmNvalueChangedCallback\fP, and \fBXmNdisarmCallback\fP callbacks\&. .IP "\fB\fP\fB\fP:" 10 In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, this action unposts the menu\&. Outside a menu, if the parent is a manager, this action passes the event to the parent\&. .IP "" 10 In a Popup MenuPane, this action unposts the menu and restores keyboard focus to the widget from which the menu was posted\&. .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the armed state and calls the \fBXmNarmCallback\fP callbacks\&. .IP "" 10 If the ToggleButtonGadget is not in a menu and the cursor leaves and then reenters the ToggleButtonGadget while the button is pressed, this action restores the button\&'s armed appearance\&. .IP "\fB\fP:" 10 In a menu, if keyboard traversal is enabled, this action does nothing\&. Otherwise, it draws the shadow in the unarmed state and calls the \fBXmNdisarmCallback\fP callbacks\&. .IP "" 10 If the ToggleButtonGadget is not in a menu and the cursor leaves the ToggleButtonGadget while the button is pressed, this action restores the button\&'s unarmed appearance\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBObject\fP(3), \fBRectObj\fP(3), \fBXmCreateRadioBox\fP(3), \fBXmCreateToggleButtonGadget\fP(3), \fBXmGadget\fP(3), \fBXmLabelGadget\fP(3), \fBXmRowColumn\fP(3), \fBXmToggleButtonGadgetGetState\fP(3), \fBXmToggleButtonGadgetSetState\fP(3), \fBXmVaCreateToggleButtonGadget\fP(3), and \fBXmVaCreateManagedToggleButtonGadget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateMainWindow.30000644000175000017500000000270312672140200016015 00000000000000.DT .TH "XmVaCreateMainWindow" "library call" .SH "NAME" \fBXmVaCreateMainWindow\fP, \fBXmVaCreateManagedMainWindow\fP \(em A MainWindow widget convenience creation functions\&. .iX "XmVaCreateMainWindow" "XmVaCreateManagedMainWindow" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateMainWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedMainWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a MainWindow widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateMainWindow\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedMainWindow\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of MainWindow and its associated resources, see \fBXmMainWindow\fP(3)\&. .SH "RETURN" .PP Returns the MainWindow widget ID\&. .SH "RELATED" .PP \fBXmMainWindow\fP(3), \fBXmCreateMainWindow\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextFieldSetHighlight.30000644000175000017500000000473612672140200016532 00000000000000'\" t ...\" TxtFieBB.sgm /main/8 1996/09/08 21:15:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetHighlight" "library call" .SH "NAME" \fBXmTextFieldSetHighlight\fP \(em A TextField function that highlights text .iX "XmTextFieldSetHighlight" .iX "TextField functions" "XmTextFieldSetHighlight" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetHighlight\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBleft\fR\fR, \fBXmTextPosition \fBright\fR\fR, \fBXmHighlightMode \fBmode\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetHighlight\fP highlights text between the two specified character positions\&. The \fImode\fP parameter determines the type of highlighting\&. Highlighting text merely changes the visual appearance of the text; it does not set the selection\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIleft\fP" 10 Specifies the position of the left boundary of text to be highlighted\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fIright\fP" 10 Specifies the position of the right boundary of text to be highlighted\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fImode\fP" 10 Specifies the type of highlighting to be done\&. A value of \fBXmHIGHLIGHT_NORMAL\fP removes highlighting\&. A value of \fBXmHIGHLIGHT_SELECTED\fP highlights the test using reverse video\&. A value of \fBXmHIGHLIGHT_SECONDARY_SELECTED\fP highlights the text using underlining\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmCreateButtonBox.30000644000175000017500000000173712672140200015404 00000000000000.TH "XmCreateButtonBox" "library call" .SH "NAME" \fBXmCreateButtonBox\fP \(em The ButtonBox widget creation function .iX "XmCreateButtonBox" .iX "creation functions" "XmCreateButtonBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateButtonBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateButtonBox\fP creates an instance of a ButtonBox widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ButtonBox and its associated resources, see \fBXmButtonBox\fP(3)\&. .SH "RETURN" .PP Returns the BulletinBoard widget ID\&. .SH "RELATED" .PP \fBXmButonBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextInsertWcs.30000644000175000017500000000516012672140200015114 00000000000000'\" t ...\" TxtInseB.sgm /main/8 1996/09/08 21:18:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextInsertWcs" "library call" .SH "NAME" \fBXmTextInsertWcs\fP \(em A Text function that inserts a wide character string into a Text widget .iX "XmTextInsertWcs" .iX "Text functions" "XmTextInsertWcs" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextInsertWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR, \fBwchar_t *\fBwcstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextInsertWcs\fP inserts a wide character string into the Text widget at a specified location\&. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text\&. For example, to insert a string after the fourth character, the \fIposition\fP parameter must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as \fIposition\fP, the \fBXmNmotionVerifyCallback\fP is called\&. .PP Note that, if \fIvalue\fP is a null string, no callbacks will be generated, since no modifications will have been made\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIposition\fP" 10 Specifies the position in the text string where the new character string is to be inserted .IP "\fIwcstring\fP" 10 Specifies the wide character string value to be added to the Text widget .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextInsert\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmContainerCut.30000644000175000017500000000427112672140200014726 00000000000000'\" t ...\" ContainD.sgm /main/8 1996/08/30 14:23:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerCut" "library call" .SH "NAME" \fBXmContainerCut\fP \(em Container widget function to move items to the clipboard .iX "XmContainerCut" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmContainerCut\fP\fR( \fBWidget \fBcontainer\fR\fR, \fBTime \fBtimestamp\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerCut\fP cuts the primary selected items to the clipboard\&. This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmMOVE\fP\&. If the transfer is successful, this routine then calls the \fBXmNconvertCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBDELETE\fP target\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .IP "\fItimestamp\fP" 10 Specifies the server time at which to modify the selection value\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP The function returns False in the following cases: if the primary selection is NULL, if the widget does not own the primary selection, or if the function is unable to gain ownership of the clipboard selection\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmDataFieldCut.30000644000175000017500000000537512672140200014627 00000000000000'\" t ...\" TxtFieAE.sgm /main/8 1996/09/08 21:12:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldCut" "library call" .SH "NAME" \fBXmDataFieldCut\fP \(em A DataField function that copies the primary selection to the clipboard and deletes the selected text .iX "XmDataFieldCut" .iX "DataField functions" "XmDataFieldCut" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmDataFieldCut\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldCut\fP copies the primary selected text to the clipboard and then deletes the primary selected text\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. .PP This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmMOVE\fP\&. If the transfer is successful, this routine then calls the \fBXmNconvertCallback\fP procedures for the \fBCLIPBOARD\fP selection and the \fBDELETE\fP target\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID\&. .IP "\fItime\fP" 10 Specifies the time at which the selection value is to be modified\&. This should be the time of the event that triggered this request\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextSetAddMode.30000644000175000017500000000331112672140200015140 00000000000000'\" t ...\" TxtSetAd.sgm /main/8 1996/09/08 21:19:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetAddMode" "library call" .SH "NAME" \fBXmTextSetAddMode\fP \(em A Text function that sets the state of Add mode .iX "XmTextSetAddMode" .iX "Text functions" "XmTextSetAddMode" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetAddMode\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBstate\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetAddMode\fP controls whether or not the Text widget is in Add mode\&. When the widget is in Add mode, the insert cursor can be moved without disturbing the primary selection\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIstate\fP" 10 Specifies whether or not the widget is in Add mode\&. A value of True turns on Add mode; a value of False turns off Add mode\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmTextGetStringWcs.30000644000175000017500000000346212672140200015561 00000000000000'\" t ...\" TxtGetSF.sgm /main/8 1996/09/08 21:17:51 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetStringWcs" "library call" .SH "NAME" \fBXmTextGetStringWcs\fP \(em A Text function that retrieves a copy of the wide character string value of a Text widget .iX "XmTextGetStringWcs" .iX "Text functions" "XmTextGetStringWcs" .SH "SYNOPSIS" .PP .nf #include \fBwchar_t * \fBXmTextGetStringWcs\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetStringWcs\fP retrieves a copy of the wide character string value of the Text widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns the wide character string value of the Text widget\&. The function returns an empty string if the length of the Text widget\&'s string is 0 (zero)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextGetString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmStringComponentCreate.30000644000175000017500000000446012672140200016605 00000000000000'\" t ...\" StrCoB.sgm /main/8 1996/09/08 21:03:13 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringComponentCreate" "library call" .SH "NAME" \fBXmStringComponentCreate\fP \(em A compound string function that creates arbitrary components .iX "XmStringComponentCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringComponentCreate\fP\fR( \fBXmStringComponentType \fBc_type\fR\fR, \fBunsigned int \fBlength\fR\fR, \fBXtPointer \fBvalue\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringComponentCreate\fP creates a new \fBXmString\fR component of type \fIc_type\fP, containing \fIvalue\fP\&. If \fIvalue\fP is invalid for the particular component type, this function fails and returns NULL\&. .IP "\fIc_type\fP" 10 Specifies the type of component to be created\&. .IP "\fIlength\fP" 10 Specifies the length in bytes of \fIvalue\fP\&. Note that this must be precisely the length of the \fIvalue\fP string, \fInot\fP including any trailing null characters\&. .IP "\fIvalue\fP" 10 Specifies the value to be used in the creation of the component\&. .PP Refer to the \fBXmStringComponentType\fP(3) reference page for a list of the possible \fBXmString\fR component types\&. .SH "RETURN" .PP If \fIvalue\fP is invalid for \fIc_type\fP, fails and returns NULL\&. Otherwise, this function returns a new compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .SH "RELATED" .PP \fBXmString\fP(3), \fBXmStringGetNextTriple\fP, \fBXmStringComponentType\fR, and \fBXmStringFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmDropTransfer.30000644000175000017500000001521312672140200014737 00000000000000'\" t ...\" DropTrA.sgm /main/10 1996/09/08 20:42:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropTransfer" "library call" .SH "NAME" \fBXmDropTransfer\fP \(em The DropTransfer widget class .iX "XmDropSite" .iX "widget class" "DropTransfer" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP DropTransfer provides a set of resources that identifies the procedures and associated information required by the toolkit in order to process and complete a drop transaction\&. Clients should not explicitly create a DropTransfer widget\&. Instead, a client initiates a transfer by calling \fBXmDropTransferStart\fP, which initializes and returns a DropTransfer widget\&. If this function is called within an \fBXmNdropProc\fP callback, the actual transfers are initiated after the callback returns\&. Even if no data needs to be transferred, \fBXmDropTransferStart\fP needs to be called (typically with no arguments, or just setting \fBXmNtransferStatus\fP) to finish the drag and drop transaction\&. .PP The \fBXmNdropTransfers\fP resource specifies a transfer list that describes the requested target types for the source data\&. A transfer list is an array of \fBXmDropTransferEntryRec\fR structures, each of which identifies a target type\&. The transfer list is analogous to the MULTIPLE selections capability defined in the \fIInter-Client Communication Conventions Manual\fP (ICCCM)\&. .PP The DropTransfer resource, \fBXmNtransferProc\fP, specifies a transfer procedure of type XtSelectionCallbackProc that delivers the requested selection data\&. This procedure operates in conjunction with the underlying Xt selection capabilities and is called for each target in the transfer list\&. Additional target types can be requested after a transfer is initiated by calling the \fBXmDropTransferAdd\fP function\&. .SS "Structures" .PP An \fBXmDropTransferEntry\fR is a pointer to the following structure of type \fBXmDropTransferEntryRec\fR, which identifies a selection target associated with a given drop transaction: .PP .nf typedef struct { XtPointer \fIclient_data\fP\fB; Atom\fP \fItarget\fP\fB; } XmDropTransferEntryRec, *XmDropTransferEntry;\fP .fi .IP "\fIclient_data\fP" 10 Specifies any additional information required by this selection target .IP "\fItarget\fP" 10 Specifies a selection target associated with the drop operation .SS "Classes" .PP DropTransfer inherits behavior and a resource from \fBObject\fP\&. .PP The class pointer is \fBxmDropTransferObjectClass\fP\&. .PP The class name is \fBXmDropTransfer\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDropTransfer Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdropTransfersXmCDropTransfersXmDropTransferEntryRec *NULLCG _____ XmNincrementalXmCIncrementalBooleanFalseCSG _____ XmNnumDropTransfersXmCNumDropTransfersCardinal0CSG _____ XmNtransferProcXmCTransferProcXtSelectionCallbackProcNULLCSG _____ XmNtransferStatusXmCTransferStatusunsigned charXmTRANSFER_SUCCESSCSG _____ .TE .IP "\fBXmNdropTransfers\fP" 10 Specifies the address of an array of drop transfer entry records\&. The drop transfer is complete when all the entries in the list have been processed\&. .IP "\fBXmNincremental\fP" 10 Specifies a Boolean value that indicates whether the transfer on the receiver side uses the Xt incremental selection transfer mechanism described in \fIX Toolkit Intrinsics\(emC Language Interface\fP\&. If the value is True, the receiver uses incremental transfer; if the value is False, the receiver uses atomic transfer\&. .IP "\fBXmNnumDropTransfers\fP" 10 Specifies the number of entries in \fBXmNdropTransfers\fP\&. If this resource is set to 0 at any time, the transfer is considered complete\&. The value of \fBXmNtransferStatus\fP determines the completion handshaking process\&. .IP "\fBXmNtransferProc\fP" 10 Specifies a procedure of type \fBXtSelectionCallbackProc\fP that delivers the requested selection values\&. The \fIwidget\fP argument passed to this procedure is the DropTransfer widget\&. The selection atom passed is _MOTIF_DROP\&. For additional information on selection callback procedures, see \fIX Toolkit Intrinsics\(emC Language Interface\fP\&. .IP "\fBXmNtransferStatus\fP" 10 Specifies the current status of the drop transfer\&. The client updates this value when the transfer ends and communicates the value to the initiator\&. The possible values are .RS .IP "\fBXmTRANSFER_SUCCESS\fP" 10 The transfer succeeded\&. .IP "\fBXmTRANSFER_FAILURE\fP" 10 The transfer failed\&. .RE .SS "Inherited Resources" .PP DropTransfer inherits behavior and a resource from \fBObject\fP\&. For a complete description of this resource, refer to the \fBObject\fP reference page\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SH "RELATED INFORMATION" .PP \fBObject\fP(3), \fBXmDisplay\fP(3), \fBXmDragContext\fP(3), \fBXmDragIcon\fP(3), \fBXmDropSite\fP(3), \fBXmDropTransferAdd\fP(3), and \fBXmDropTransferStart\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmListDeleteItem.30000644000175000017500000000333212672140200015202 00000000000000'\" t ...\" LstDeleB.sgm /main/8 1996/08/30 15:39:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeleteItem" "library call" .SH "NAME" \fBXmListDeleteItem\fP \(em A List function that deletes an item from the list .iX "XmListDeleteItem" .iX "List functions" "XmListDeleteItem" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeleteItem\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeleteItem\fP deletes the first item in the list that matches \fIitem\fP\&. A warning message appears if the item does not exist\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List from whose list an item is deleted\&. .IP "\fIitem\fP" 10 Specifies the text of the item to be deleted from the list\&. If \fIitem\fP appears more than once in the List, only the first occurrence is matched\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmIconButton.30000644000175000017500000002045412672140200014415 00000000000000.DT .TH XmIconButton 3X "15 July 1992" .SH NAME The Icon Button widget .SH SYNOPSIS Documents the XmIconButton widget .SH DESCRIPTION .PP .TS tab (%); l l. .TE .PP The Icon Button widget is a selectable area of the screen that contains both a label and a string. When the user selects this button with the OSF/Motif select button its activateCallback is called. This widget can also be used as a Toggle button, although it will have no indicator. The placement of the icon relative to the text can be modified by using the iconPlacement resource. .PP Note: This widget takes a String as its label, not an XmString, so there is no need to use XmStringCreate to get a properly formatted string. Internationalized text is not currently supported. .PP .SH Normal Resources .PP .TS tab (%); l l l l. Name%Class%Type%Initial Value activateCallback%Callback%Callback%NULL alignment%Alignment%Alignment%XmALIGNMENT_ %%% BEGINNING armColor%ArmColor%Pixel% doubleClickCallback%Callback%Callback%NULL fontList%FontList%FontList%fixed horizontalMargin%Space%HorizontalDimension%2 iconTextPadding%Space%VerticalDimension%2 iconPlacement%IconPlacement%IconPlacement%XmIconTop label%Label%String%Widget name labelString%LabelString%XmString%Widget name pixmap%Pixmap%Pixmap%None recomputeSize%Boolean%Boolean%True set%Boolean%Boolean%False stringDirection%StringDirection%StringDirection%XmSTRING_ %%%DIRECTION_L_TO_R verticalMargin%Space%VerticalDimension%2 .TE .PP All resource names begin with XmN and all resource class names begin with XmC. .PP .SH activateCallback .PP This list of callback routines is called whenever the icon button is clicked on by the user. The format of the callback routines is specified below. .PP .SH armColor .PP This is the pixel index that describes the color to fill the widget with when it is set. .PP .SH doubleClickCallback .PP This list of callback routines is called whenever the user double clicks on this widget. The format of the callback routines is specified below. .PP .SH fontList .PP The default font in this list is used to render the label string of the icon button. .PP .SH horizontalMargin .PP .SH verticalMargin .PP The amount of space to be left between the edge of the shadow and the text or pixmap displayed. The vertical and horizontal spacing can be controlled independently. .PP .SH iconTextPadding .PP The amount of space to be left between the pixmap and the label string. .PP .SH iconPlacement .PP The location of the pixmap (icon) with respect to the displayed text. This resource can take one of the following values: XmIconTop, XmIconBottom, XmIconLeft, XmIconRight, XmIconNone, and XmIconOnly. A type converter has been registered that converts the following strings: "top", "bottom", "left", "right", "none", and "iconOnly". .PP If only a string is displayed in the Icon Button, this resource can be used to change the justification of the label. XmIconTop=bottom, XmIconBottom=top, XmIconRight=Left, XmIconLeft=Right, XmIconNone=Center. In order to use these options, pixmap must be set to None. .PP .SH label .PP The string to display in this button. This string can only have one font, but can be any number of lines long. Use the NEW_LINE character ( '\n' ) to separate lines. This resource has been superceded by labelString, but is included for backwards compatibility. If XmNlabelString is set , XmNlabel is ignored .PP .SH labelString .PP Specifies the compound string to be displayed in the button. If this value is NULL, the value of XmNlabel is used. If both are NULL, labelString is initialized by converting the name of the widget to a compound string. Refer to XmString(3X) in the OSD/Motif Programmers' Reference for more information on the creation and structure of compound strings. .SH pixmap .PP The pixmap to display. This pixmap may either be of depth one (1), or the same depth as the screen this widget is being displayed on. If the pixmap is of depth one then XCopyPlane is used to render the pixmap in the foreground and background colors. If the pixmap is not of depth one then XCopyArea is used and all the original colors of the pixmap are preserved. Unlike the Motif PushButton widget the pixmap is automatically stippled when the Icon Button becomes insensitive. .PP .SH recomputeSize .PP If this Boolean value is True then the icon button will ask its parent to resize it to be just large enough to contain the pixmap, label and shadows. If it is False then the icon button will not attempt a resize. .PP .SH set .PP This Boolean value represents the current state of the icon button. If this value is True then the icon button is set and is rendered as depressed. Otherwise it is unset and is rendered normally. .PP .SH stringDirection .PP Specifies the direction in which the string is to be drawn. XmNSTRING_DIRECTION_L_TO_R is drawn left to right, while XmNSTRING_DIRECTION_R_TO_L is drawn right to left. The default for this resource is determined at creation time. If no value is specified for this resource and the widget's parent is a manager, the value is inherited from the parent; otherwise, it defaults to XmNSTRING_DIRECTION_L_TO_R. .PP .SH Callback Routines .PP Whenever the user selects the icon button the activate callbacks will be called. When- ever the user double clicks on this widget the first click will call the activateCallback, and if the second occurs within MultiClickTime it will call the doubleClickCallback.. These callbacks have the following parameters: .HP 20 void (activate_callback)(Widget w, XtPointer client_data, XtPointer call_data) .ta 15 .HP 15 w the Icon Button widget .HP 15 client_data the client data specified by the application .HP 15 call_data a pointer to an XmIconButtonCallbackInfo structure .HP 20 void (double_click_callback)(Widget w, XtPointer client_data, XtPointer call_data) .ta 15 .HP 15 w the Icon Button widget .HP 15 client_data the client data specified by the application .HP 15 call_data a pointer to an XmIconButtonCallbackInfo structure .PP All procedures on the Icon Button's activateCallback and doubleClickCallback lists will have a pointer to an IconButtonCallbackInfo structure passed to them in the call_data field. This structure is defined in the Icon Button widget's public header file as follows: .ta 5,10,15,20,25,30,35 .df typedef struct _XmIconButtonCallbackInfo { Boolean state; /* The current state of the icon button.*/ XEvent * event; /* The event that caused this action.*/ } XmIconButtonCallbackInfo; .ta 15 .HP 15 state the current state of the icon button. When this is used as a push button (the default) the state variable will always be True. .HP 15 event the X Event that caused this action, see Translations and Actions below for details on the events that can cause these callbacks to be called. .PP .SH Convenience Routine .PP .SH .HP 5 .SH XmCreateIconButton - Widget creation convenience routine .nf Widget XmCreateIconButton( Widget parent, /* Widget id of parent for IconButton */ String name, /* Name of the created widget */ ArgList args, /* argument list */ Cardinal num_args /* number of items in argument list */ ) .nf .PP Translations and Actions: .PP The following are the default translation bindings used by the icon button: .PP .TS tab (%); l l. ,:%XmToggle() XmNotify() (2):%XmDoubleNotify() :%XmGetFocus() XmToggle() osfSelect:%XmArmAndActivate() osfActivate:%XmArmAndActivate() Nonespace:%XmArmAndActivate() NoneReturn:%XmArmAndActivate() ,%XmToggle() .TE .PP The following actions are supported by the icon button: .ta 15 .HP 15 XmToggle() Toggles the state of the icon button. .HP 15 XmNotify() Calls all routines on activateCallback list. .HP 15 XmDoubleNotify() Calls all routines on the doubleClickCallback list. .HP 15 XmArmAndActivated() This action will arm the button, call the actions on the activateCallback list, wait a fraction of a second and then disarm the button. .PP To use this button as a toggle button rather than a push button, replace the default translation table with the following table. .PP .TS tab (%); l l. :%XmToggle() XmNotify() (2):%XmDoubleNotify() osfSelect:%XmToggle() XmNotify() osfActivate:%XmToggle() XmNotify() Nonespace:%XmToggle() XmNotify() NoneReturn:%XmToggle() XmNotify() .TE .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/Composite.30000644000175000017500000001450712672140200013770 00000000000000'\" t ...\" Compos.sgm /main/11 1996/09/08 21:41:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "Composite" "library call" .SH "NAME" \fBComposite\fP \(em The Composite widget class .iX "Composite" .iX "widget class" "Composite" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Composite widgets are intended to be containers for other widgets and can have an arbitrary number of children\&. Their responsibilities (implemented either directly by the widget class or indirectly by Intrinsics functions) include: .IP " \(bu" 6 Overall management of children from creation to destruction\&. .IP " \(bu" 6 Destruction of descendants when the composite widget is destroyed\&. .IP " \(bu" 6 Physical arrangement (geometry management) of a displayable subset of managed children\&. .IP " \(bu" 6 Mapping and unmapping of a subset of the managed children\&. Instances of composite widgets need to specify the order in which their children are kept\&. For example, an application may want a set of command buttons in some logical order grouped by function, and it may want buttons that represent filenames to be kept in alphabetical order\&. .SS "Classes" .PP Composite inherits behavior and resources from \fBCore\fP\&. .PP The class pointer is \fBcompositeWidgetClass\fP\&. .PP The class name is \fBComposite\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .IP "\fBXmNchildren\fP" 10 A read-only list of the children of the widget\&. .IP "\fBXmNinsertPosition\fP" 10 Points to the \fBXtOrderProc\fP function described below\&. .IP "\fBXmNnumChildren\fP" 10 A read-only resource specifying the length of the list of children in \fBXmNchildren\fP\&. .PP The following procedure pointer in a composite widget instance is of type \fBXtOrderProc\fP: .PP .nf Cardinal (* XtOrderProc) (Widget \fIw\fP); .fi .IP "\fIw\fP" 10 Specifies the widget\&. .PP Composite widgets that allow clients to order their children (usually homogeneous boxes) can call their widget instance\&'s \fBXmNinsertPosition\fP procedure from the class\&'s \fBinsert_child\fP procedure to determine where a new child should go in its children array\&. Thus, a client of a composite class can apply different sorting criteria to widget instances of the class, passing in a different \fBXmNinsertPosition\fP procedure when it creates each composite widget instance\&. .PP The return value of the \fBXmNinsertPosition\fP procedure indicates how many children should go before the widget\&. A value of 0 (zero) indicates that the widget should go before all other children; returning the value of \fBXmNumChildren\fP indicates that it should go after all other children\&. By default, unless a subclass or an application provides an \fBXmNinsertPosition\fP procedure, each child is inserted at the end of the \fBXmNchildren\fP list\&. The \fBXmNinsertPosition\fP procedure can be overridden by a specific composite widget\&'s resource list or by the argument list provided when the composite widget is created\&. .SS "Inherited Resources" .PP Composite inherits behavior and resources from the superclass described in the following table\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension1CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for Composite\&. .SH "RELATED" .PP \fBCore\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmTextFieldGetString.30000644000175000017500000000356412672140200016053 00000000000000'\" t ...\" TxtFieAN.sgm /main/8 1996/09/08 21:13:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetString" "library call" .SH "NAME" \fBXmTextFieldGetString\fP \(em A TextField function that accesses the string value .iX "XmTextFieldGetString" .iX "TextField functions" "XmTextFieldGetString" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmTextFieldGetString\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetString\fP accesses the string value of the TextField widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns a character pointer to the string value of the TextField widget\&. This returned value is a copy of the value of the \fBXmNvalue\fP resource\&. Returns an empty string if the length of the TextField widget\&'s string is 0 (zero)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldGetStringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/MrmRegisterClass.30000644000175000017500000000567112672140200015256 00000000000000'\" t ...\" RegisteA.sgm /main/8 1996/09/08 21:26:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmRegisterClass" "library call" .SH "NAME" \fBMrmRegisterClass\fP \(em Saves the information needed for MRM to access the widget creation function for user-defined widgets .iX "MrmRegisterClass" .iX "uil functions" "MrmRegisterClass" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmRegisterClass\fP\fR( \fBMrmType \fBclass_code\fR\fR, \fBString \fBclass_name\fR\fR, \fBString \fBcreate_name\fR\fR, \fBWidget (*\fBcreate_proc\fR) ()\fR, \fBWidgetClass \fBclass_record\fR\fR); .fi .iX "MRM function" "MrmRegisterClass" .iX "MrmRegisterClass" "definition" .SH "DESCRIPTION" .PP The \fBMrmRegisterClass\fP function .iX "MrmRegisterClass" "description" allows MRM to access user-defined widget classes\&. This function registers the necessary information for MRM to create widgets of this class\&. You must call \fBMrmRegisterClass\fP prior to fetching any user-defined class widget\&. .PP \fBMrmRegisterClass\fP saves the information needed to access the widget creation function and to do type conversion of argument lists by using the information in MRM databases\&. .IP "\fIclass_code\fP" 10 This argument is ignored; it is present for compatibility with previous releases\&. .IP "\fBclass_name\fP" 10 This argument is ignored; it is present for compatibility with previous releases\&. .IP "\fIcreate_name\fP" 10 Specifies the case-sensitive name of the low-level widget creation function for the class\&. An example from the Motif Toolkit is \fBXmCreateLabel\fP\&. Arguments are \fIparent_widget\fP, \fIname\fP, \fIoverride_arglist\fP, and \fIoverride_argcount\fP\&. .IP "" 10 For user-defined widgets, \fIcreate_name\fP is the creation procedure in the UIL that defines this widget\&. .IP "\fBcreate_proc\fP" 10 Specifies the address of the creation function that you named in \fIcreate_name\fP\&. .IP "\fIclass_record\fP" 10 Specifies a pointer to the class record\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/TransientShell.30000644000175000017500000002316712672140200014767 00000000000000'\" t ...\" Transien.sgm /main/10 1996/09/08 21:42:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "TransientShell" "library call" .SH "NAME" \fBTransientShell\fP \(em The TransientShell widget class .iX "TransientShell" .iX "widget class" "TransientShell" .SH "SYNOPSIS" .PP .nf #include #include .fi .SH "DESCRIPTION" .PP TransientShell is used for shell windows that can be manipulated by the window manager, but are not allowed to be iconified separately\&. For example, DialogBoxes make no sense without their associated application\&. They are iconified by the window manager only if the main application shell is iconified\&. .SS "Classes" .PP TransientShell inherits behavior and resources from \fBCore\fP, \fBComposite\fP, \fBShell\fP, \fBWMShell\fP, and \fBVendorShell\fP\&. .PP The class pointer is \fBtransientShellWidgetClass\fP\&. .PP The class name is \fBTransientShell\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP In addition to these new resources, \fBTransientShell\fP overrides the \fBXmNsaveUnder\fP resource in \fBShell\fP and the \fBXmNtransient\fP resource in \fBWMShell\fP\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBTransientShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNtransientForXmCTransientForWidgetNULLCSG _____ .TE .IP "\fBXmNtransientFor\fP" 10 Specifies a widget that the shell acts as a pop-up for\&. If this resource is NULL or is a widget that has not been realized, the \fBXmNwindowGroup\fP is used instead\&. .SS "Inherited Resources" .PP TransientShell inherits behavior and resources from the superclasses described in the following tables, which define sets of widget resources used by the programmer to specify data\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBVendorShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNaudibleWarningXmCAudibleWarningunsigned charXmBELLCSG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNdefaultFontListXmCDefaultFontListXmFontListdynamicCG _____ XmNdeleteResponseXmCDeleteResponseunsigned charXmDESTROYCSG _____ XmNinputMethodXmCInputMethodStringNULLCSG _____ XmNinputPolicyXmCInputPolicyXmInputPolicyXmPER_SHELLCSG _____ XmNkeyboardFocusPolicyXmCKeyboardFocusPolicyunsigned charXmEXPLICITCSG _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTabelXmRenderTabledynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectionXmLEFT_TO_RIGHTCG _____ XmNmwmDecorationsXmCMwmDecorationsint-1CG _____ XmNmwmFunctionsXmCMwmFunctionsint-1CG _____ XmNmwmInputModeXmCMwmInputModeint-1CG _____ XmNmwmMenuXmCMwmMenuStringNULLCG _____ XmNpreeditTypeXmCPreeditTypeStringdynamicCSG _____ XmNshellUnitTypeXmCShellUnitTypeunsigned charXmPIXELSCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNunitTypeXmCUnitTypeunsigned charXmPIXELSCSG _____ XmNuseAsyncGeometryXmCUseAsyncGeometryBooleanFalseCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBWMShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbaseHeightXmCBaseHeightintXtUnspecifiedShellIntCSG _____ XmNbaseWidthXmCBaseWidthintXtUnspecifiedShellIntCSG _____ XmNheightIncXmCHeightIncintXtUnspecifiedShellIntCSG _____ XmNiconMaskXmCIconMaskPixmapNULLCSG _____ XmNiconPixmapXmCIconPixmapPixmapNULLCSG _____ XmNiconWindowXmCIconWindowWindowNULLCSG _____ XmNiconXXmCIconXintXtUnspecifiedShellIntCSG _____ XmNiconYXmCIconYintXtUnspecifiedShellIntCSG _____ XmNinitialStateXmCInitialStateintNormalStateCSG _____ XmNinputXmCInputBooleanTrueCSG _____ XmNmaxAspectXXmCMaxAspectXintXtUnspecifiedShellIntCSG _____ XmNmaxAspectYXmCMaxAspectYintXtUnspecifiedShellIntCSG _____ XmNmaxHeightXmCMaxHeightintXtUnspecifiedShellIntCSG _____ XmNmaxWidthXmCMaxWidthintXtUnspecifiedShellIntCSG _____ XmNminAspectXXmCMinAspectXintXtUnspecifiedShellIntCSG _____ XmNminAspectYXmCMinAspectYintXtUnspecifiedShellIntCSG _____ XmNminHeightXmCMinHeightintXtUnspecifiedShellIntCSG _____ XmNminWidthXmCMinWidthintXtUnspecifiedShellIntCSG _____ XmNtitleXmCTitleStringdynamicCSG _____ XmNtitleEncodingXmCTitleEncodingAtomdynamicCSG _____ XmNtransientXmCTransientBooleanTrueCSG _____ XmNwaitForWmXmCWaitForWmBooleanTrueCSG _____ XmNwidthIncXmCWidthIncintXtUnspecifiedShellIntCSG _____ XmNwindowGroupXmCWindowGroupWindowdynamicCSG _____ XmNwinGravityXmCWinGravityintdynamicCSG _____ XmNwmTimeoutXmCWmTimeoutint5000 msCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanFalseCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanTrueCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for TransientShell\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBShell\fP(3), \fBVendorShell\fP(3), and \fBWMShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmVaCreateManagedSimpleSpinBox.30000644000175000017500000000004312672140200017745 00000000000000.so man3/XmVaCreateSimpleSpinBox.3 motif-2.3.8/doc/man/man3/XmCreatePushButton.30000644000175000017500000000351112672140200015563 00000000000000'\" t ...\" CrePuB.sgm /main/7 1996/08/30 14:47:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreatePushButton" "library call" .SH "NAME" \fBXmCreatePushButton\fP \(em The PushButton widget creation function .iX "XmCreatePushButton" .iX "creation functions" "XmCreatePushButton" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreatePushButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreatePushButton\fP creates an instance of a PushButton widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of PushButton and its associated resources, see \fBXmPushButton\fP(3)\&. .SH "RETURN" .PP Returns the PushButton widget ID\&. .SH "RELATED" .PP \fBXmPushButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmDropSiteRegistered.30000644000175000017500000000364212672140200016100 00000000000000'\" t ...\" DropSitU.sgm /main/8 1996/09/08 20:41:38 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteRegistered" "library call" .SH "NAME" \fBXmDropSiteRegistered\fP \(em A Drag and Drop function that determines if a drop site has been registered .iX "XmDropSiteRegistered" .iX "Drag and Drop functions" "XmDropSiteRegistered" .iX "register functions" "XmDropSiteRegistered" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmDropSiteRegistered\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteRegistered\fP determines if the specified widget has a drop site registered\&. If a drop site is registered, this function returns True\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget being queried\&. .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RETURN" .PP If the widget is not a registered drop site, this function returns False\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmDisplay\fP(3), \fBXmDropSite\fP(3), \fBXmDropSiteEndUpdate\fP(3), \fBXmDropSiteStartUpdate\fP(3), \fBXmDropSiteUpdate\fP(3), \fBXmDropSiteUnregister\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmListItemExists.30000644000175000017500000000320712672140200015260 00000000000000'\" t ...\" LstItemE.sgm /main/7 1996/08/30 15:43:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListItemExists" "library call" .SH "NAME" \fBXmListItemExists\fP \(em A List function that checks if a specified item is in the list .iX "XmListItemExists" .iX "List functions" "XmListItemExists" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmListItemExists\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListItemExists\fP is a Boolean function that checks if a specified item is present in the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIitem\fP" 10 Specifies the item whose presence is checked .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns True if the specified item is present in the list\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmVaCreateDrawnButton.30000644000175000017500000000272412672140200016213 00000000000000.DT .TH "XmVaCreateDrawnButton" "library call" .SH "NAME" \fBXmVaCreateDrawnButton\fP, \fBXmVaCreateManagedDrawnButton\fP \(em A DrawnButton widget convenience creation functions\&. .iX "XmVaCreateDrawnButton" "XmVaCreateManagedDrawnButton" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateDrawnButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedDrawnButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a DrawnButton widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateDrawnButton\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedDrawnButton\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of DrawnButton and its associated resources, see \fBXmDrawnButton\fP(3)\&. .SH "RETURN" .PP Returns the DrawnButton widget ID\&. .SH "RELATED" .PP \fBXmDrawnButton\fP(3), \fBXmCreateDrawnButton\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateToggleButton.30000644000175000017500000000300312672140200016350 00000000000000.DT .TH "XmVaCreateToggleButton" "library call" .SH "NAME" \fBXmVaCreateToggleButton\fP, \fBXmVaCreateManagedToggleButton\fP \(em A ToggleButton widget convenience creation functions\&. .iX "XmVaCreateToggleToggleButton" "XmVaCreateManagedToggleButton" .iX "creation functions" "XmVaCreateToggleButton" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateToggleButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedToggleButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateToggleButton\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateToggleButton\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ToggleButton and its associated resources, see \fBXmToggleButton\fP(3)\&. .SH "RETURN" .PP Returns the ToggleButton widget ID\&. .SH "RELATED" .PP \fBXmToggleButton\fP(3), \fBXmCreateToggleButton\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmStringGetNextTriple.30000644000175000017500000000444212672140200016255 00000000000000'\" t ...\" StrGeF.sgm /main/9 1996/09/08 21:05:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringGetNextTriple" "library call" .SH "NAME" \fBXmStringGetNextTriple\fP \(em An XmString function that returns the type, length, and value of the next component in the compound string .iX "XmStringGetNextTriple" .SH "SYNOPSIS" .PP .nf #include \fBXmStringComponentType \fBXmStringGetNextTriple\fP\fR( \fBXmStringContext \fBcontext\fR\fR, \fBunsigned int \fB*length\fR\fR, \fBXtPointer \fB*value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringGetNextTriple\fP returns the type, length, and value of the next component in the compound string identified by \fIcontext\fP\&. This function returns one component at a time\&. .IP "\fIcontext\fP" 10 Specifies the string context structure that was allocated by the \fBXmStringInitContext\fP function\&. .IP "\fIlength\fP" 10 Specifies a pointer to the length of the value of the returned component\&. .IP "\fIvalue\fP" 10 Specifies a pointer to the value of the returned component\&. If the returned value is not NULL, the function allocates space to hold the returned value\&. When the application no longer needs the returned compound string, the application should call \fBXtFree\fP\&. .SH "RETURN" .PP Returns the type of the component found\&. Refer to the \fBXmStringComponentType\fP(3) reference page for a list of component types\&. .SH "RELATED" .PP \fBXmDirection\fP(3), \fBXmString\fP(3), \fBXmStringComponentType\fP(3), \fBXmStringGetNextComponent\fP(3), and \fBXmStringPeekNextTriple\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmTextFieldCopyLink.30000644000175000017500000000464512672140200015676 00000000000000'\" t ...\" TxtFieAD.sgm /main/7 1996/08/30 16:22:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldCopyLink" "library call" .SH "NAME" \fBXmTextFieldCopyLink\fP \(em A TextField function that copies a link to the primary selection to the clipboard .iX "XmTextFieldCopyLink" .iX "TextField functions" "XmTextFieldCopyLink" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldCopyLink\fP\fR( \fBWidget \fBwidget\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldCopyLink\fP copies a link to the primary selected text to the clipboard\&. This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmLINK\fP\&. The TextField widget itself does not copy any links; \fBXmNconvertCallback\fP procedures are responsible for copying the link to the clipboard and for taking any related actions\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .IP "\fItime\fP" 10 Specifies the time of the transfer\&. This should be the time of the event which triggered this request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed\fP\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL, if the \fIwidget\fP does not own the primary selection, if the function is unable to gain ownership of the clipboard selection, or if no data is placed on the clipboard\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmPanedWindow.30000644000175000017500000004226712672140200014556 00000000000000'\" t ...\" PanedWin.sgm /main/9 1996/09/08 20:55:13 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPanedWindow" "library call" .SH "NAME" \fBXmPanedWindow\fP \(em The PanedWindow widget class .iX "XmPanedWindow" .iX "widget class" "PanedWindow" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP PanedWindow is a composite widget that lays out children in a vertically tiled format\&. Children appear in top-to-bottom fashion, with the first child inserted appearing at the top of the PanedWindow and the last child inserted appearing at the bottom\&. The PanedWindow grows to match the width of its widest child and all other children are forced to this width\&. The height of the PanedWindow is equal to the sum of the heights of all its children, the spacing between them, and the size of the top and bottom margins\&. .PP The user can also adjust the size of the panes\&. To facilitate this adjustment, a pane control sash is created for most children\&. The sash appears as a square box positioned on the bottom of the pane that it controls\&. The user can adjust the size of a pane by using the mouse or keyboard\&. .PP The PanedWindow is also a constraint widget, which means that it creates and manages a set of constraints for each child\&. You can specify a minimum and maximum size for each pane\&. The PanedWindow does not allow a pane to be resized below its minimum size or beyond its maximum size\&. Also, when the minimum size of a pane is equal to its maximum size, no control sash is presented for that pane or for the lowest pane\&. .PP The default \fBXmNinsertPosition\fP procedure for PanedWindow causes all panes to appear first in the \fBXmNchildren\fP list and all sashes to appear after the panes\&. For a pane child, it returns the value of \fBXmNpositionIndex\fP if one has been specified for the child\&. Otherwise, it returns the number of \fIpanes\fP in the PanedWindow\&'s \fBXmNchildren\fP list\&. Other than the fact that all sashes appear after all panes, the insertion order of sashes is unspecified\&. This procedure also causes nonsash widgets to be inserted after other nonsash children but before any sashes\&. The behavior of PanedWindow is undefined if \fBXmNinsertPosition\fP is set to a procedure other than the default\&. .PP All panes and sashes in a PanedWindow must be tab groups\&. When a pane is inserted as a child of the PanedWindow, if the pane\&'s \fBXmNnavigationType\fP is not \fBXmEXCLUSIVE_TAB_GROUP\fP, PanedWindow sets it to \fBXmSTICKY_TAB_GROUP\fP\&. .SS "Descendants" .PP PanedWindow automatically creates for each paned window the descendants shown in the following table\&. An application can use \fBXtName\fP and the child list information to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBSash\fP\fBsubclass of\fP \fBXmPrimitive\fPsash ___ \fBSeparator\fP\fBXmSeparatorGadget\fPdividing line between window panes ___ .TE .SS "Classes" .PP PanedWindow inherits behavior and resources from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmPanedWindowWidgetClass\fP\&. .PP The class name is \fBXmPanedWindow\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPanedWindow Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNmarginHeightXmCMarginHeightDimension3CSG _____ XmNmarginWidthXmCMarginWidthDimension3CSG _____ XmNorientationXmCOrientationunsigned charXmVERTICALCSG _____ XmNrefigureModeXmCBooleanBooleanTrueCSG _____ XmNsashHeightXmCSashHeightDimension10CSG _____ XmNsashIndentXmCSashIndentPosition-10CSG _____ XmNsashShadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNsashWidthXmCSashWidthDimension10CSG _____ XmNseparatorOnXmCSeparatorOnBooleanTrueCSG _____ XmNspacingXmCSpacingDimension8CSG _____ .TE .IP "\fBXmNmarginHeight\fP" 10 Specifies the distance between the top and bottom edges of the PanedWindow and its children\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the distance between the left and right edges of the PanedWindow and its children\&. .IP "\fBXmNorientation\fP" 10 Specifies the layout as either vertical (with the \fBXmVERTICAL\fP value) or horizontal (with the \fBXmHORIZONTAL\fP value)\&. In the vertical layout, the children are laid out in a vertically tiled format\&. In the horizontal layout, the children are laid out in a horizontal layout, with the sash moveable along the horizontal axis\&. .IP "\fBXmNrefigureMode\fP" 10 Determines whether the panes\&' positions are recomputed and repositioned when programmatic changes are being made to the PanedWindow\&. Setting this resource to True resets the children to their appropriate positions\&. .IP "\fBXmNsashHeight\fP" 10 Specifies the height of the sash\&. .IP "\fBXmNsashIndent\fP" 10 Specifies the horizontal placement of the sash along each pane\&. A positive value causes the sash to be offset from the near (left) side of the PanedWindow, and a negative value causes the sash to be offset from the far (right) side of the PanedWindow\&. If the offset is greater than the width of the PanedWindow minus the width of the sash, the sash is placed flush against the near side of the PanedWindow\&. .IP "" 10 Whether the placement actually corresponds to the left or right side of the PanedWindow depends on the \fBXmNlayoutDirection\fP resource of the widget\&. .IP "\fBXmNsashShadowThickness\fP" 10 Specifies the thickness of the shadows of the sashes\&. .IP "\fBXmNsashWidth\fP" 10 Specifies the width of the sash\&. .IP "\fBXmNseparatorOn\fP" 10 Determines whether a separator is created between each of the panes\&. Setting this resource to True creates a Separator at the midpoint between each of the panes\&. .IP "\fBXmNspacing\fP" 10 Specifies the distance between each child pane\&. .IP "" 10 .TS tab() box; c s s s s l| l| l| l| l. T{ \fBXmPanedWindow Constraint Resource Set\fP T} \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowResizeXmCBooleanBooleanFalseCSG _____ XmNpaneMaximumXmCPaneMaximumDimension1000CSG _____ XmNpaneMinimumXmCPaneMinimumDimension1CSG _____ XmNpositionIndexXmCPositionIndexshortXmLAST_POSITIONCSG _____ XmNskipAdjustXmCBooleanBooleanFalseCSG _____ .TE .IP "\fBXmNallowResize\fP" 10 Allows an application to specify whether the PanedWindow should allow a pane to request to be resized\&. This flag has an effect only after the PanedWindow and its children have been realized\&. If this flag is set to True, the PanedWindow tries to honor requests to alter the height of the pane\&. If False, it always denies pane requests to resize\&. .IP "\fBXmNpaneMaximum\fP" 10 Allows an application to specify the maximum size to which a pane may be resized\&. This value must be greater than the specified minimum\&. .IP "\fBXmNpaneMinimum\fP" 10 Allows an application to specify the minimum size to which a pane may be resized\&. This value must be greater than 0 (zero)\&. .IP "\fBXmNpositionIndex\fP" 10 Specifies the position of the widget in its parent\&'s list of children (the list of pane children, not including sashes)\&. The value is an integer that is no less than 0 (zero) and no greater than the number of children in the list at the time the value is specified\&. A value of 0 means that the child is placed at the beginning of the list\&. The value can also be specified as \fBXmLAST_POSITION\fP (the default), which means that the child is placed at the end of the list\&. Any other value is ignored\&. \fBXtGetValues\fP returns the position of the widget in its parent\&'s child list at the time of the call to \fBXtGetValues\fP\&. .IP "" 10 When a widget is inserted into its parent\&'s child list, the positions of any existing children that are greater than or equal to the specified widget\&'s \fBXmNpositionIndex\fP are increased by 1\&. The effect of a call to \fBXtSetValues\fP for \fBXmNpositionIndex\fP is to remove the specified widget from its parent\&'s child list, decrease by one the positions of any existing children that are greater than the specified widget\&'s former position in the list, and then insert the specified widget into its parent\&'s child list as described in the preceding sentence\&. .IP "\fBXmNskipAdjust\fP" 10 When set to True, this Boolean resource allows an application to specify that the PanedWindow should not automatically resize this pane\&. .SS "Inherited Resources" .PP PanedWindow inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcdefault procedureCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .SS "Translations" .PP \fBXmPanedWindow\fP inherits translations from \fBXmManager\fP\&. .PP The translations for sashes within the PanedWindow are described in the following table\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBStart\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBMove\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBCommit\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBStart\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBMove\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBCommit\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,LargeIncr,Up\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,DefaultIncr,Up\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,LargeIncr,Right\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,DefaultIncr,Right\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,LargeIncr,Down\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,DefaultIncr,Down\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,LargeIncr,Left\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,DefaultIncr,Left\fP) .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrevTabGroup() .IP "\fB\(apm \(apa\fP \fB\fP\fBTab\fP:" 10 NextTabGroup() .SS "Action Routines" .PP The \fBXmPanedWindow\fP action routines are .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "NextTabGroup():" 10 Moves the keyboard focus to the next tab group\&. By default, each pane and sash is a tab group\&. .IP "PrevTabGroup():" 10 Moves the keyboard focus to the previous tab group\&. By default, each pane and sash is a tab group\&. .IP "SashAction(\fIaction\fP\fB)\fP\ or\ SashAction(\fBKey,\fP\fIincrement\fP\fB,\fP\fIdirection\fP\fB)\fP:" 10 The \fBStart\fP action activates the interactive placement of the pane\&'s borders\&. The \fBMove\fP action causes the sash to track the position of the pointer\&. If one of the panes reaches its minimum or maximum size, adjustment continues with the next adjustable pane\&. The \fBCommit\fP action ends sash motion\&. .IP "" 10 When sash action is caused by a keyboard event, the sash with the keyboard focus is moved according to the \fIincrement\fP and \fIdirection\fP specified\&. \fBDefaultIncr\fP adjusts the sash by one line\&. \fBLargeIncr\fP adjusts the sash by one view region\&. The \fIdirection\fP is specified as either \fBUp\fP, \fBDown\fP, \fBLeft\fP, or \fBRight\fP\&. .IP "" 10 Note that the SashAction action routine is not a direct action routine of the \fBXmPanedWindow,\fP but rather an action of the Sash control created by the \fBXmPanedWindow\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 Moves the keyboard focus to the sash and highlights it .IP "\fB\fP:" 10 Unsets the keyboard focus in the sash and unhighlights it .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreatePanedWindow\fP(3), \fBXmManager\fP(3), \fBXmVaCreatePanedWindow\fP(3), and \fBXmVaCreateManagedPanedWindow\fP(3)\&. motif-2.3.8/doc/man/man3/XmListSelectPos.30000644000175000017500000000424312672140200015064 00000000000000'\" t ...\" LstSeleB.sgm /main/8 1996/09/08 20:52:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSelectPos" "library call" .SH "NAME" \fBXmListSelectPos\fP \(em A List function that selects an item at a specified position in the list .iX "XmListSelectPos" .iX "List functions" "XmListSelectPos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSelectPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR, \fBBoolean \fBnotify\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSelectPos\fP highlights a List item at the specified position and adds it to the list of selected items\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIposition\fP" 10 Specifies the position of the item to be selected\&. A value of 1 indicates that the first item in the list is selected; a value of 2 indicates that the second item is selected; and so on\&. A value of 0 (zero) indicates that the last item in the list is selected\&. .IP "\fInotify\fP" 10 Specifies a Boolean value that when TRUE invokes the selection callback for the current mode\&. From an application interface view, calling this function with \fInotify\fP True is indistinguishable from a user-initiated selection action\&. When \fInotify\fP is FALSE, no callbacks are called\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3) and \fBXmListSelectItem\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmExt18List.30000644000175000017500000003041612672140200014075 00000000000000.DT .TH XxExt18LIst 3x "" .SH NAME The Internationalized Extended List widget .SH SYNOPSIS #include .SH DESCRIPTION .PP .TS tab (%); l l. .TE .PP This widget contains a multi-column list with headers along the top and a search area along the bottom. The list has scrollbars along the right and bottom edges that allow vertical and horizontal scrolling both by column and by pixel. The portion of the list data that is currently visible can be altered by scrollbar actions, widget resource setting and the redisplay of the list data after a string search has been successful. The sorting of elements within a particular column is also supported. To sort the list by the elements in a given column, select the column's title. .PP To search for a particular string in the list, type the string value to be searched for in the list's associated text field and then press the "Find" pushbutton. The search for the string begins in the currently selected row, after the location of the previously searched for string, or at the first column and first row if there is no column selected. If the string is not found in that row, then the search continues through all rows after and then before, the currently selected row. If the string is found, the display of the list is adjusted to make the string visible. If the string was not found, or if the string is visible, the application will issue a warning beep. .PP Pointer button one allows the user to select a row or a column for sorting. The callbacks on the doubleClickCallback list are called when the user double clicks pointer button one. If the list data can contain a row pixmap to display at the extreme left of the row. .PP .SH Normal Resources .PP .TS tab (%); l l l l. Name%Class%Type%Default columnTitles%ColumnTitles%String *%NULL doubleClickCallback%Callback%Callback%NULL entryData%EntryData%Xm18RowInfo*%NULL findLabel%XmString%XmString%Find firstColumn%FirstLocation%short%0 firstColumnPixmaps%FirstColumnPixmaps%Boolean%False firstRow%FirstLocation%short%0 fontList%FontList%FontList%"fixed" height%Dimension%VerticalDimension%300 numColumns%NumColumns%short%0 numRows%NumRows%short%0 selectedColumn%SelectedColumn%short%0 selectionPolicy%SelectionPolicy%SelectionPolicy%XmEXTENDED_ %%%SELECT showFind%boolean%boolean%True singleSelection%Callback%Callback%NULL sortFunctions%Function%Function%NULL title%Title%String%name of %%%widget width%Dimension%Horizontal%Dimension%300 .TE .PP All resource names begin with XmN and all resource class names begin with XmC. .PP .SH columnTitles .PP This is an array of length numColumns of strings displayed at the top of each column. The data is allocated and maintained by the client. .PP .SH doubleClickCallback .PP All routines in this list will be called whenever the user double clicks on a row in the list. .PP .SH entryData .PP This resource is the data associated with each row in the list. The data is an array of Xm18RowInfo structures of length numRows allocated by the client. The data is allocated and maintained by the client. The Xm18RowInfo structure is defined below. .PP .SH findLabel .PP The label to be shown on the find button. .PP .SH firstColumn .PP This resource allows the client to adjust the current view of the list data to have a new top left column location. When setting this resource, firstRow should also be updated. .PP .SH firstColumnPixmaps .PP This resource specifies that the pixmap stored in the row info structure should be used instead of Xm18RowInfo values[0]. If pixmaps are present, the rows may be dragged by pressing on the pixmap with pointer button three. If this resource is True, then values[0] is never referenced. If False, then the Xm18RowInfo data pixmap is never referenced. .PP .SH firstRow .PP This resource allows the client to adjust the current view of the list data to have a new top left row location. When setting this resource, firstColumn should also be updated. .PP .SH fontList .PP This is an OSF/Motif style font list. The first font in this list will be used to display all text in the Extended List widget. The Extended List widget currently supports only one font. .PP .SH height .PP This is the overall height value assigned to the Extended List widget. Modifying this resource will affect scrollbar size and location. .PP .SH numColumns .PP .SH numRows .PP These resources specify the number of columns and rows the widget expects to display. These resources are used as the maximum indices for many of the other resources in this widget. Care should be taken when modifying these resources to ensure that the other values have also been modified. .PP .SH selectedColumn .PP This is the index of the currently selected column. This also the column by which the list is being sorted. .PP .SH selectionPolicy .PP Defines the interpretation of the select action. This resource can have the values XmSINGLE_SELECT or XmEXTENDED_SELECT. Other values result in undefined behavior. .PP .SH showFind .PP This boolean manages and unmanages the find button .PP .SH singleSelectionCallback .PP All routines in this list will be called whenever the user clicks on a line in the list. A pointer to the Xm18RowInfo structure corresponding to the line selected is passed as call_data. If in extended select mode the value of call_data is undefined. .PP .SH sortFunctions .PP This is an array of functions, one for each column, called to determine the ordering of the rows in the column, similar to qsort. .PP .SH title .PP This is the title that is displayed at the top of the Extended List widget. If this value is NULL, the title area will not be shown. .PP .SH width .PP This is the overall width value assigned to the Extended List widget. Modifying this resource will affect scrollbar size and location. .PP .SH Specifying Children Resources .PP The Extended List widget is composed of many simple widgets. In order to achieve full functionality of the Toolkit, it is sometimes desirable to set attribute values directly on those widgets. The widget ids of the sub-widgets can be obtained by using the XtNameToWidget() function provided by the Xt Intrinsics. .PP .ta 5,10,15,20,25,30,35 .df XmExt18List XmLabel title XmScrollbar vertBar XmScrollBar horizBar XmFrame frame XmPushButton find XmText findText .PP .SH Using the Resource Database .PP The Extended List widget is actually a collection of pieces. It provides the geometry layout for the collection as well as tying together the pieces to form a consistent package. Many of the resources that are documented as being part of the Extended List widget are really part of the internal list sub-component. The Extended List widget will pass these values through to the proper child when they are set at time of creation or with XtSetValues or XtGetValues. However, when setting a resource via the resource database you must use either the name of the child or the general specification (*) rather than the specific one (.). .PP .SH The Xm18RowInfo Structure .PP The Xm18RowInfo structure is used to contain the entryData associated with each Row in the Extended List. .PP .ta 5,10,15,25,30,35 .df typedef struct _Xm18RowInfo{ /* * Used by the IList widget */ String * values; /* The array of column strings */ Pixmap pixmap; /* mini-icon pixmaps. */ Boolean selected; /* row selected. */ /* * Provided for the convenience of the application programmer */ short * sort_id; XtPointer data; /* * Private to the Extended List widget (do not modify these) */ short pix_width; /* of the pixmap. */ short pix_height; /* of the pixmap. */ short pix_depth; /* of the pixmap. */ Boolean old_sel_state; } Xm18RowInfo; .ta 15 .HP 15 values This is an array of strings of length numColumns which represents the strings displayed in each column of this row. The data is allocated and maintained by the client. If firstColumnPixmaps is True, then value[0] is never referenced. .HP 15 pixmap This is the pixmap displayed to the left of this row. If firstColumnPixmaps is True then this value is never referenced and mayn remain unset. If no pixmap is desired for this row, even though firstColumnPixmaps is True, set the value of pixmap to None. Color pixmaps may be used. .HP 15 sort_id This is provided for the convenience of the client and is expected to be used as a sort index for this row. One value should be specified for each column of the row. See "sortFunctions" below for details. .HP 15 data This is provided for the convenience of the client and may be used for any purpose. It is intended to be used as an identifier for the object pointed to by this row .HP 15 selected This value is True if this row is selected; may be set by the application. .PP Neither sort_id nor data are used by the Extended List widget; they exist solely for the convenience of the programmer. .PP .SH Translations and Actions .PP The following are the default translation bindings used by the icon button: .PP .TS tab (%); l l. ~Ctrl ~Shift :%ButtonDown() Ctrl ~Shift :%ButtonDown(Toggle) ~Ctrl Shift :%ButtonDown(Extend) Button1 :%Motion() :%ButtonUpOrLeave() .TE .PP The following actions are supported by the icon button: .PP .SH ButtonDown(type) .PP Processes a button press action that may begin with either a select or a double click. The type argument can be either Toggle or Extend. These values determine which mode of an extended select will be initiated on this button event. Consult the OSF/Motif Style Guide for details. .PP .SH Motion() .PP Processes motion events to allow the selection region to be modified when in extended selection mode. It is assumed that this action is called between a ButtonDown() and ButtonUpOrLeave() action. .PP .SH ButtonUpOrLeave() .PP Cleans up after ButtonDown() and Motion(). .PP .SH Callback Routines .PP All procedures on the Extended List's singleSelectionCallback and doubleClickCallback lists will have a pointer to a Xm18RowInfo structure passed to them in the call_data field. This structure is defined above. .PP Note: if a single SelectionCallback is registered on an extended list in extended_se- lect_mode, the value of call_data is undefined. .ta 15 .HP 20 void (callback)(Widget w, XtPointer client_data, XtPointer call_data) .HP 15 w the Extended List widget .HP 15 client_data the client data specified by the application .HP 15 call_data a pointer to an Xm18RowInfo structure corrsponding the the row selected .PP .SH Sort Function .HP 20 typedef int (Xm18SortFunction) (short column, Xm18RowInfo * row1, Xm18RowInfo * row2); .ta 15 .HP 15 column the column currently being sorted .HP 15 row1, row2 the two rows being compared. The return value must be an integer less than, equal to, or greater than 0, depending on whether the first argument is less than, equal to, or greater than the second. .PP .SH Convenience Routines .PP .SH .HP 5 .SH XmExt18ListGetSelectedRows Xm18RowInfo ** XmExt18ListGetSelectedRows (Widget w) .PP w extended list widget .PP Use the XmExt18ListGetSelectedRows function to find the rows that currently are selected in an extended list. The Xm18RowInfo ** returned by this function contains a NULL terminated array of Xm18RowInfo pointers. The calling routine is responsible for freeing the returned pointer with XtFree(). The function will return NULL if no elements are selected. .PP .SH XmCreateExtended18List .PP Widget XmCreateExtended18List(Widget parent, String name, ArgList args, Cardinal num_args) .PP parent parent of the extended list widget to be created .br name name of the extended list widget to be created .br args arguments to pass to XtCreateWidget for the extended list .br num_args number of arguments passed .PP This convenience routine simply takes the passed parameters and calls XtCreateWidget, returning the widget created. .PP .SH XmExt18ListUnselectAllItems void XmExt18ListUnselectAllItems( Widget w ) .PP w the extended list widget to be modified .PP Unselects all rows of the passed extended list widget and returns nothing. .PP .SH XmExt18ListUnselectItem void XmExt18ListUnselectItem(Widget w, Xm18RowInfo *row_info) .PP w extended list widget .br row_info pointer to the row which is to be unselected. .PP Unselects the row designated by row_info of the passed extended list widget w .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmStringIsVoid.30000644000175000017500000000334412672140200014714 00000000000000'\" t ...\" StrIsV.sgm /main/8 1996/09/08 21:05:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringIsVoid" "library call" .SH "NAME" \fBXmStringIsVoid\fP \(em A compound string function that provides information on the existence of non-zero-length text components, tab components, or separator components .iX "XmStringIsVoid" .iX "compound string functions" "XmStringIsVoid" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringIsVoid\fP\fR( \fBXmString \fBs1\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringIsVoid\fP returns a Boolean value indicating whether or not string \fIs1\fP is void\&. .IP "\fIs1\fP" 10 Specifies the compound string .SH "RETURN" .PP Returns True if any non-zero-length text components, tab components, or separator components exist in \fIs1\fP\&. That is, the function returns True if the string has no text, tabs, or separators\&. If \fIs1\fP contains the NULL string, the function returns True\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/ApplicationShell.30000644000175000017500000002301012672140200015246 00000000000000'\" t ...\" Applic.sgm /main/9 1996/09/08 21:41:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "ApplicationShell" "library call" .SH "NAME" \fBApplicationShell\fP \(em The ApplicationShell widget class .iX "ApplicationShell" .iX "widget class" "ApplicationShell" .SH "SYNOPSIS" .PP .nf #include #include .fi .SH "DESCRIPTION" .PP ApplicationShell is used as the main top-level window for an application\&. An application should have more than one ApplicationShell only if it implements multiple logical applications\&. .SS "Classes" .PP ApplicationShell inherits behavior and resources from \fBCore\fP, \fBComposite\fP, \fBShell\fP, \fBWMShell\fP, \fBVendorShell\fP, and \fBTopLevelShell\fP\&. .PP The class pointer is \fBapplicationShellWidgetClass\fP\&. .PP The class name is \fBApplicationShell\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBApplicationShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNargcXmCArgcint0CSG _____ XmNargvXmCArgvString *NULLCSG _____ .TE .IP "\fBXmNargc\fP" 10 Specifies the number of arguments given in the \fBXmNargv\fP resource\&. The function \fBXtInitialize\fP sets this resource on the shell widget instance it creates by using its parameters as the values\&. .IP "\fBXmNargv\fP" 10 Specifies the argument list required by a session manager to restart the application if it is killed\&. This list should be updated at appropriate points by the application if a new state has been reached that can be directly restarted\&. The function \fBXtInitialize\fP sets this resource on the shell widget instance it creates by using its parameters as the values\&. When \fBXtGetValues\fP is called on this resource, the returned value is a pointer to the actual resource value and should not be freed\&. .SS "Inherited Resources" .PP ApplicationShell inherits behavior and resources from the following superclasses\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBTopLevelShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNiconicXmCIconicBooleanFalseCSG _____ XmNiconNameXmCIconNameStringNULLCSG _____ XmNiconNameEncodingXmCIconNameEncodingAtomdynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBVendorShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNaudibleWarningXmCAudibleWarningunsigned charXmBELLCSG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNdefaultFontListXmCDefaultFontListXmFontListdynamicCG _____ XmNdeleteResponseXmCDeleteResponseunsigned charXmDESTROYCSG _____ XmNinputMethodXmCInputMethodStringNULLCSG _____ XmNinputPolicyXmCInputPolicyXmInputPolicyXmPER_SHELLCSG _____ XmNkeyboardFocusPolicyXmCKeyboardFocusPolicyunsigned charXmEXPLICITCSG _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTabelXmRenderTabledynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectionXmLEFT_TO_RIGHTCG _____ XmNmwmDecorationsXmCMwmDecorationsint-1CG _____ XmNmwmFunctionsXmCMwmFunctionsint-1CG _____ XmNmwmInputModeXmCMwmInputModeint-1CG _____ XmNmwmMenuXmCMwmMenuStringNULLCG _____ XmNpreeditTypeXmCPreeditTypeStringdynamicCSG _____ XmNshellUnitTypeXmCShellUnitTypeunsigned charXmPIXELSCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNunitTypeXmCUnitTypeunsigned charXmPIXELSCSG _____ XmNuseAsyncGeometryXmCUseAsyncGeometryBooleanFalseCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBWMShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbaseHeightXmCBaseHeightintXtUnspecifiedShellIntCSG _____ XmNbaseWidthXmCBaseWidthintXtUnspecifiedShellIntCSG _____ XmNheightIncXmCHeightIncintXtUnspecifiedShellIntCSG _____ XmNiconMaskXmCIconMaskPixmapNULLCSG _____ XmNiconPixmapXmCIconPixmapPixmapNULLCSG _____ XmNiconWindowXmCIconWindowWindowNULLCSG _____ XmNiconXXmCIconXintXtUnspecifiedShellIntCSG _____ XmNiconYXmCIconYintXtUnspecifiedShellIntCSG _____ XmNinitialStateXmCInitialStateintNormalStateCSG _____ XmNinputXmCInputBooleanTrueCSG _____ XmNmaxAspectXXmCMaxAspectXintXtUnspecifiedShellIntCSG _____ XmNmaxAspectYXmCMaxAspectYintXtUnspecifiedShellIntCSG _____ XmNmaxHeightXmCMaxHeightintXtUnspecifiedShellIntCSG _____ XmNmaxWidthXmCMaxWidthintXtUnspecifiedShellIntCSG _____ XmNminAspectXXmCMinAspectXintXtUnspecifiedShellIntCSG _____ XmNminAspectYXmCMinAspectYintXtUnspecifiedShellIntCSG _____ XmNminHeightXmCMinHeightintXtUnspecifiedShellIntCSG _____ XmNminWidthXmCMinWidthintXtUnspecifiedShellIntCSG _____ XmNtitleXmCTitleStringdynamicCSG _____ XmNtitleEncodingXmCTitleEncodingAtomdynamicCSG _____ XmNtransientXmCTransientBooleanFalseCSG _____ XmNwaitForWmXmCWaitForWmBooleanTrueCSG _____ XmNwidthIncXmCWidthIncintXtUnspecifiedShellIntCSG _____ XmNwindowGroupXmCWindowGroupWindowdynamicCSG _____ XmNwinGravityXmCWinGravityintdynamicCSG _____ XmNwmTimeoutXmCWmTimeoutint5000 msCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanFalseCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanFalseCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for ApplicationShell\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBShell\fP(3), \fBWMShell\fP(3), \fBVendorShell\fP(3), and \fBTopLevelShell\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmTextGetMaxLength.30000644000175000017500000000365112672140200015525 00000000000000'\" t ...\" TxtGetMa.sgm /main/8 1996/09/08 21:17:04 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetMaxLength" "library call" .SH "NAME" \fBXmTextGetMaxLength\fP \(em A Text function that accesses the value of the current maximum allowable length of a text string entered from the keyboard .iX "XmTextGetMaxLength" .iX "Text functions" "XmTextGetMaxLength" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextGetMaxLength\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetMaxLength\fP accesses the value of the current maximum allowable length of the text string in the Text widget entered from the keyboard\&. The maximum allowable length prevents the user from entering a text string larger than this limit\&. Note that the maximum allowable length is the same as the value of the widget\&'s \fBXmNmaxLength\fP resource\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns the integer value that indicates the string\&'s maximum allowable length that can be entered from the keyboard\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmContainerCopy.30000644000175000017500000000406612672140200015107 00000000000000'\" t ...\" ContainB.sgm /main/7 1996/08/30 14:22:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmContainerCopy" "library call" .SH "NAME" \fBXmContainerCopy\fP \(em Container widget function to copy primary selection to the clipboard .iX "XmContainerCopy" .iX "XmContainer" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmContainerCopy\fP\fR( \fBWidget \fBcontainer\fR\fR, \fBTime \fBtimestamp\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmContainerCopy\fP copies the primary selected container items to the clipboard\&. This routine calls the \fBXmNconvertCallback\fP procedures, possibly multiple times, with the \fIselection\fP member of the \fBXmConvertCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIparm\fP member set to \fBXmCOPY\fP\&. .IP "\fIcontainer\fP" 10 Specifies the Container widget ID\&. .IP "\fItimestamp\fP" 10 Specifies the server time at which to modify the selection value\&. .PP For a complete definition of Container and its associated resources, see \fBXmContainer\fP(3)\&. .SH "RETURN" .PP The function returns False in the following cases: if the primary selection is NULL, if the widget does not own the primary selection, or if the function is unable to gain ownership of the clipboard selection\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmContainer\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmMultiListToggleRow.30000644000175000017500000000147712672140200016115 00000000000000.TH "XmMultiListToggleRow" "library call" .SH "NAME" \fBXmMultiListToggleRow\fP \(em An MultiList function that toggles the selection state of a specified row .iX "XmMultiListToggleRow" .iX "Extended List functions" "XmMultiListToggleRow" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListToggleRow\fP\fR( \fBWidget \fBwidget\fR\fR, \fBshort \fBrow\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMultiListToggleRow\fP toggles the selection state of a row designated by row argument of the passed MultiList widget\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList from whose list an item is unselected\&. .IP "\fIrow\fP" 10 Specified the number of row to toggle\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmScaleSetValue.30000644000175000017500000000305512672140200015027 00000000000000'\" t ...\" ScaleSV.sgm /main/7 1996/08/30 16:03:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScaleSetValue" "library call" .SH "NAME" \fBXmScaleSetValue\fP \(em A Scale function that sets a slider value .iX "XmScaleSetValue" .iX "Scale functions" "XmScaleSetValue" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmScaleSetValue\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBvalue\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmScaleSetValue\fP sets the slider \fIvalue\fP within the Scale widget\&. .IP "\fIwidget\fP" 10 Specifies the Scale widget ID\&. .IP "\fIvalue\fP" 10 Specifies the slider position along the scale\&. This sets the \fBXmNvalue\fP resource\&. .PP For a complete definition of Scale and its associated resources, see \fBXmScale\fP(3)\&. .SH "RELATED" .PP \fBXmScale\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmTextFieldGetStringWcs.30000644000175000017500000000361012672140200016520 00000000000000'\" t ...\" TxtFieAO.sgm /main/8 1996/09/08 21:13:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetStringWcs" "library call" .SH "NAME" \fBXmTextFieldGetStringWcs\fP \(em A TextField function that retrieves a copy of the wide character string value of a TextField widget .iX "XmTextFieldGetStringWcs" .iX "TextField functions" "XmTextFieldGetStringWcs" .SH "SYNOPSIS" .PP .nf #include \fBwchar_t * \fBXmTextFieldGetStringWcs\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetStringWcs\fP retrieves a copy of the wide character string value of the TextField widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns the wide character string value of the TextField widget\&. The function returns an empty string if the length of the TextField widget\&'s string is 0 (zero)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldGetString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmToggleButtonSetValue.30000644000175000017500000000443312672140200016416 00000000000000'\" t ...\" ToggleBG.sgm /main/8 1996/09/08 21:10:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmToggleButtonSetValue" "library call" .SH "NAME" \fBXmToggleButtonSetValue\fP \(em A ToggleButton function that sets or changes the current state .iX "XmToggleButtonSetValue" .iX "ToggleButton functions" "XmToggleButtonSetValue" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmToggleButtonSetValue\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmToggleButtonState \fBstate\fR\fR, \fBBoolean \fBnotify\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmToggleButtonSetValue\fP sets or changes the ToggleButton\&'s current state\&. .IP "\fIwidget\fP" 10 Specifies the ToggleButton widget ID\&. .IP "\fIstate\fP" 10 Specifies whether the ToggleButton state is selected or unselected\&. If the value is True, the button state is selected; if it is False, the button state is unselected, if it is \fBXmINDETERMINATE\fP, the button state is neither\&. .IP "\fInotify\fP" 10 Indicates whether \fBXmNvalueChangedCallback\fP is called; it can be either True or False\&. The \fBXmNvalueChangedCallback\fP is only called when this function changes the state of the ToggleButton\&. When this argument is True and the ToggleButton is a child of a RowColumn widget whose \fBXmNradioBehavior\fP is True, setting the ToggleButton causes other ToggleButton and ToggleButtonGadget children of the RowColumn to be unselected\&. .PP For a complete definition of ToggleButton and its associated resources, see \fBXmToggleButton\fP(3)\&. .SH "RELATED" .PP \fBXmToggleButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmTextFieldRemove.30000644000175000017500000000413712672140200015377 00000000000000'\" t ...\" TxtFieAW.sgm /main/8 1996/09/08 21:14:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldRemove" "library call" .SH "NAME" \fBXmTextFieldRemove\fP \(em A TextField function that deletes the primary selection .iX "XmTextFieldRemove" .iX "TextField functions" "XmTextFieldRemove" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldRemove\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldRemove\fP deletes the primary selected text\&. If there is a selection, this routine also calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. This function may also call the \fBXmNmotionVerifyCallback\fP callback\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns False if the primary selection is NULL or if the \fIwidget\fP does not own the primary selection\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/VendorShell.30000644000175000017500000006062412672140200014254 00000000000000'\" t ...\" Vendor.sgm /main/16 1996/10/29 11:40:55 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "VendorShell" "library call" .SH "NAME" \fBVendorShell\fP \(em The VendorShell widget class .iX "VendorShell" .iX "widget class" "VendorShell" .SH "SYNOPSIS" .PP .nf #include #include .fi .SH "DESCRIPTION" .PP VendorShell is a Motif widget class used as a supporting superclass for all shell classes that are visible to the window manager and that are not override redirect\&. It contains resources that describe the MWM-specific look and feel\&. It also manages the MWM-specific communication needed by all VendorShell subclasses\&. See the \fBmwm\fP reference page for more information\&. .PP It is also responsible for managing toolTips. All \fBXmPrimitive\fP and \fBXmGadget\fP subclasses have an \fBXmNtoolTipString\fP resource. If \fBXmNtoolTipEnable\fP is True, and the pointer enters a Primitive or Gadget that has traversal enabled, and the XmNtoolTipString is not NULL, the \fBXmNtoolTipString\fP will be displayed according to the VendorShell resources for controlling toolTips. VendorShell displays the XmNtooTipString in an XmLabel that is a child of a transientShell. The name of the transientShell is TipShell, and the name of the XmLabel is TipLabel. The appearance of the tip can be controlled by specifing resources on these widgets. .PP If an application uses the \fBXmNmwmDecorations\fP, \fBXmNmwmFunctions\fP, or \fBXmNmwmInputMode\fP resource, it should include the file \fBXm/MwmUtil\&.h\fP\&. .PP Setting \fBXmNheight\fP, \fBXmNwidth\fP, or \fBXmNborderWidth\fP for either a VendorShell or its managed child usually sets that resource to the same value in both the parent and the child\&. When an off-the-spot input method exists, the height and width of the shell may be greater than those of the managed child in order to accommodate the input method\&. In this case, setting \fBXmNheight\fP or \fBXmNwidth\fP for the shell does not necessarily set that resource to the same value in the managed child, and setting \fBXmNheight\fP or \fBXmNwidth\fP for the child does not necessarily set that resource to the same value in the shell\&. .PP For the managed child of a VendorShell, regardless of the value of the shell\&'s \fBXmNallowShellResize\fP, setting \fBXmNx\fP or \fBXmNy\fP sets the corresponding resource of the parent but does not change the child\&'s position relative to the parent\&. \fBXtGetValues\fP for the child\&'s \fBXmNx\fP or \fBXmNy\fP yields the value of the corresponding resource in the parent\&. The x and y-coordinates of the child\&'s upper left outside corner relative to the parent\&'s upper left inside corner are both 0 (zero) minus the value of \fBXmNborderWidth\fP\&. .PP Note that the \fIInter-Client Communication Conventions Manual\fP (ICCCM) allows a window manager to change or control the border width of a reparented top-level window\&. .PP VendorShell holds the \fBXmQTspecifyRenderTable\fP trait\&. .SS "Classes" .PP VendorShell inherits behavior, resources, and traits from the \fBCore\fP, \fBComposite\fP, \fBShell\fP, and \fBWMShell\fP classes\&. .PP The class pointer is \fBvendorShellWidgetClass\fP\&. .PP The class name is \fBVendorShell\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a subresource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a subresource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given subresource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .TS tab() box; c s s s s l| l| l| l| l. \fBVendorShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNaudibleWarningXmCAudibleWarningunsigned charXmBELLCSG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNdefaultFontListXmCDefaultFontListXmFontListdynamicCG _____ XmNdeleteResponseXmCDeleteResponseunsigned charXmDESTROYCSG _____ XmNinputMethodXmCInputMethodstringNULLCSG _____ XmNinputPolicyXmCInputPolicyXmInputPolicyXmPER_SHELLCSG _____ XmNkeyboardFocusPolicyXmCKeyboardFocusPolicyunsigned charXmEXPLICITCSG _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTabelXmRenderTabledynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectionXmLEFT_TO_RIGHTCG _____ XmNmwmDecorationsXmCMwmDecorationsint-1CG _____ XmNmwmFunctionsXmCMwmFunctionsint-1CG _____ XmNmwmInputModeXmCMwmInputModeint-1CG _____ XmNmwmMenuXmCMwmMenuStringNULLCG _____ XmNpreeditTypeXmCPreeditTypeStringdynamicCSG _____ XmNverifyPreeditXmCVerifyPreeditBooleanFalseCSG _____ XmNshellUnitTypeXmCShellUnitTypeunsigned charXmPIXELSCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNtoolTipPostDelayXmCToolTipPostDelayint5000CSG _____ XmNtoolTipPostDurationXmCToolTipPostDurationint5000CSG _____ XmNtoolTipEnableXmCToolTipEnableBooleanFalseCSG _____ XmNunitTypeXmCUnitTypeunsigned charXmPIXELSCSG _____ XmNuseAsyncGeometryXmCUseAsyncGeometryBooleanFalseCSG _____ .TE .IP "\fBXmNaudibleWarning\fP" 10 Determines whether an action activates its associated audible cue\&. The possible values are \fBXmBELL\fP and \fBXmNONE\fP\&. .IP "\fBXmNbuttonFontList\fP" 10 Specifies the font list used for button descendants\&. See the \fBXmNbuttonRenderTable\fP resource\&. .IP "\fBXmNbuttonRenderTable\fP" 10 Specifies the render table used for VendorShell\&'s button descendants\&. If this value is NULL at initialization and if the value of \fBXmNdefaultFontList\fP is not NULL, \fBXmNbuttonRenderTable\fP is initialized to the value of \fBXmNdefaultFontList\fP\&. If the value of \fBXmNdefaultFontList\fP is NULL, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, \fBXmNbuttonRenderTable\fP is initialized to the \fBXmBUTTON_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNdefaultFontList\fP" 10 Specifies a default font list for VendorShell\&'s descendants\&. This resource is obsolete and exists for compatibility with earlier releases\&. It has been replaced by \fBXmNbuttonFontList\fP, \fBXmNlabelFontList\fP, and \fBXmNtextFontList\fP\&. .IP "\fBXmNdeleteResponse\fP" 10 Determines what action the shell takes in response to a \fBWM_DELETE_WINDOW\fP message\&. The setting can be one of three values: \fBXmDESTROY\fP, \fBXmUNMAP\fP, and \fBXmDO_NOTHING\fP\&. The resource is scanned, and the appropriate action is taken after the \fBWM_DELETE_WINDOW\fP callback list (if any) that is registered with the Protocol manager has been called\&. .IP "\fBXmNinputMethod\fP" 10 Specifies the string that sets the locale modifier for the input method\&. When \fBXtGetValues\fP is called on this resource, the returned value is a pointer to the actual resource value and should not be freed\&. .IP "\fBXmNinputPolicy\fP" 10 Specifies the policy to follow for creating an Input Context (IC) for this shell\&. This resource can have the following values: .RS .IP "\fBXmPER_SHELL\fP" 10 Specifies that only one XIC is created per shell\&. .IP "\fBXmPER_WIDGET\fP" 10 Specifies that one XIC is created for each widget\&. .RE .IP "\fBXmNkeyboardFocusPolicy\fP" 10 Determines allocation of keyboard focus within the widget hierarchy rooted at this shell\&. The X keyboard focus must be directed to somewhere in the hierarchy for this client-side focus management to take effect\&. Possible values are \fBXmEXPLICIT\fP, specifying a click-to-type policy, and \fBXmPOINTER\fP, specifying a pointer-driven policy\&. .IP "\fBXmNlabelFontList\fP" 10 Specifies the font list used for label descendants\&. See the \fBXmNlabelRenderTable\fP resource\&. .IP "\fBXmNlabelRenderTable\fP" 10 Specifies the font list used for VendorShell\&'s label descendants (Labels and LabelGadgets)\&. If this value is NULL at initialization and if the value of \fBXmNdefaultFontList\fP is not NULL, \fBXmNlabelFontList\fP is initialized to the value of \fBXmNdefaultFontList\fP\&. If the value of \fBXmNdefaultFontList\fP is NULL, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, \fBXmNlabelRenderTable\fP is initialized to the \fBXmLABEL_RENDER_TABLE\fP of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNlayoutDirection\fP" 10 Specifies the direction in which the subwidgets, children of a widget, or other visual components are to be laid out\&. This policy will apply as the default layout policy for all descendants of this VendorShell\&. .IP "\fBXmNmwmDecorations\fP" 10 Specifies the decoration flags (specific decorations to add or remove from the window manager frame) for the \fB_MOTIF_WM_HINTS\fP property\&. If any decoration flags are specified by the \fB_MOTIF_WM_HINTS\fP property, only decorations indicated by both that property and the MWM \fBclientDecoration\fP and \fBtransientDecoration\fP resources are displayed\&. If no decoration flags are specified by the \fB_MOTIF_WM_HINTS\fP property, decorations indicated by the MWM \fBclientDecoration\fP and \fBtransientDecoration\fP resources are displayed\&. The default for the \fBXmNmwmDecorations\fP resource is not to specify any decoration flags for the \fB_MOTIF_WM_HINTS\fP property\&. .IP "" 10 The value of this resource is the bitwise inclusive OR of one or more flag bits\&. The possible flag bit constants, defined in the include file \fBXm/MwmUtil\&.h\fP, are .RS .IP "\fBMWM_DECOR_ALL\fP" 10 All decorations \fIexcept\fP those specified by other flag bits that are set .IP "\fBMWM_DECOR_BORDER\fP" 10 Client window border .IP "\fBMWM_DECOR_RESIZEH\fP" 10 Resize frame handles .IP "\fBMWM_DECOR_TITLE\fP" 10 Title bar .IP "\fBMWM_DECOR_MENU\fP" 10 Window menu button .IP "\fBMWM_DECOR_MINIMIZE\fP" 10 Minimize window button .IP "\fBMWM_DECOR_MAXIMIZE\fP" 10 Maximize window button .RE .IP "\fBXmNmwmFunctions\fP" 10 Specifies the function flags (specific window manager functions to apply or not apply to the client window) for the \fB_MOTIF_WM_HINTS\fP property\&. If any function flags are specified by the \fB_MOTIF_WM_HINTS\fP property, only functions indicated by both that property and the MWM \fBclientFunctions\fP and \fBtransientFunctions\fP resources are applied\&. If no function flags are specified by the \fB_MOTIF_WM_HINTS\fP property, functions indicated by the MWM \fBclientFunctions\fP and \fBtransientFunctions\fP resources are applied\&. The default for the \fBXmNmwmFunctions\fP resource is not to specify any function flags for the \fB_MOTIF_WM_HINTS\fP property\&. .IP "" 10 The value of this resource is the bitwise inclusive OR of one or more flag bits\&. The possible flag bit constants, defined in the include file \fBXm/MwmUtil\&.h\fP, are .RS .IP "\fBMWM_FUNC_ALL\fP" 10 All functions \fIexcept\fP those specified by other flag bits that are set .IP "\fBMWM_FUNC_RESIZE\fP" 10 \fBf\&.resize\fP .IP "\fBMWM_FUNC_MOVE\fP" 10 \fBf\&.move\fP .IP "\fBMWM_FUNC_MINIMIZE\fP" 10 \fBf\&.minimize\fP .IP "\fBMWM_FUNC_MAXIMIZE\fP" 10 \fBf\&.maximize\fP .IP "\fBMWM_FUNC_CLOSE\fP" 10 \fBf\&.kill\fP .RE .IP "\fBXmNmwmInputMode\fP" 10 Specifies the input mode flag (application modal or system modal input constraints) for the \fB_MOTIF_WM_HINTS\fP property\&. If no input mode flag is specified by the \fB_MOTIF_WM_HINTS\fP property, no input constraints are applied, and input goes to any window\&. The default for the \fBXmNmwmInputMode\fP resource is not to specify any input mode flag for the \fB_MOTIF_WM_HINTS\fP property\&. .IP "" 10 An application that sets input constraints on a dialog usually uses the BulletinBoard\&'s \fBXmNdialogStyle\fP resource rather than the parent DialogShell\&'s \fBXmNmwmInputMode\fP resource\&. .IP "" 10 The possible values for this resource, defined in the include file \fBXm/MwmUtil\&.h\fP, are .RS .IP "\fBMWM_INPUT_MODELESS\fP" 10 Input goes to any window\&. .IP "\fBMWM_INPUT_PRIMARY_APPLICATION_MODAL\fP" 10 Input does not go to ancestors of this window\&. .IP "\fBMWM_INPUT_SYSTEM_MODAL\fP" 10 Input goes only to this window\&. .IP "\fBMWM_INPUT_FULL_APPLICATION_MODAL\fP" 10 Input does not go to other windows in this application\&. .RE .IP "\fBXmNmwmMenu\fP" 10 Specifies the menu items that the Motif window manager should add to the end of the window menu\&. The string contains a list of items separated by \fB\n\fP with the following format: .PP .nf \fIlabel [mnemonic] [accelerator] function\fP .fi .IP "" 10 If more than one item is specified, the items should be separated by a newline character\&. .IP "" 10 When \fBXtGetValues\fP is called on this resource, the returned value is a pointer to the actual resource value and should not be freed\&. .IP "\fBXmNpreeditType\fP" 10 Specifies the input method style or styles available to the input manager\&. The resource can be a comma-separated list of the following values: .TS tab() allbox; c s l| l|. \fBPreedit Values\fP \fBPreedit Value\fP\fBXIM Style\fP __ OffTheSpotXIMPreeditArea __ RootXIMPreeditNothing __ NoneXIMPreeditNone __ OverTheSpotXIMPreeditPosition __ OnTheSpotXIMPreeditCallbacks __ .TE .IP "" 10 When \fBXtGetValues\fP is called on this resource, the returned value is a pointer to the actual resource value and should not be freed\&. .IP "\fBXmNshellUnitType\fP" 10 This resource is obsolete, and is included only for compatibility with earlier releases of Motif\&. Use the \fBXmNunitType\fP resource instead\&. .IP "\fBXmNtextFontList\fP" 10 Specifies the font list used for text descendants\&. See the \fBXmNtextRenderTable\fP resource\&. .IP "\fBXmNtextRenderTable\fP" 10 Specifies the render table used for VendorShell\&'s Text and List descendants\&. If this value is NULL at initialization and if the value of \fBXmNdefaultFontList\fP is not NULL, \fBXmNtextRenderTable\fP is initialized to the value of \fBXmNdefaultFontList\fP\&. If the value of \fBXmNdefaultFontList\fP is NULL, the parent hierarchy of the widget is searched for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, \fBXmNtextRenderTable\fP is initialized to the \fBXmTEXT_RENDER_TABLE\fP value of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNtoolTipEnable\fP" 10 Specifies whether toolTips are enabled for this shell or not. .IP "\fBXmNtoolTipPostDelay\fP" 10 Specifies the time, in milliseconds, to wait after the pointer enters a widget before posting the toolTip associated with this widget. .IP "\fBXmNtoolTipPostDuration\fP" 10 Specifies the time, in milliseconds, that the toolTip is displayed. A value of 0 will display the tip indefinitely. .IP "\fBXmNunitType\fP" 10 Provides the basic support for resolution independence\&. It defines the type of units a widget uses with sizing and positioning resources\&. The resource has a default unit type of \fBXmPIXELS\fP\&. .IP "" 10 The unit type can also be specified in resource files, with the following format: .PP .nf \f(CW\fI\fP\fR .fi .PP .IP "" 10 where: .RS .IP "\fIunit\fP" 10 is <" ", pixels, inches, centimeters, millimeters, points, font units> .IP "\fIpixels\fP" 10 is <\fIpix\fP, \fIpixel\fP, \fIpixels\fP> .IP "\fIinches\fP" 10 is <\fIin\fP, \fIinch\fP, \fIinches\fP> .IP "\fIcentimeter\fP" 10 is <\fIcm\fP, \fIcentimeter\fP, \fIcentimeters\fP> .IP "\fImillimeters\fP" 10 is <\fImm\fP, \fImillimeter\fP, \fImillimeters\fP> .IP "\fBpoints\fP" 10 is <\fIpt\fP, \fIpoint\fP, \fIpoints\fP> .IP "\fBfont units\fP" 10 is <\fIfu\fP, \fBfont_unit\fP, \fBfont_units\fP> .IP "\fIfloat\fP" 10 is {"+"|"-"}{{<"0"-"9">*}\&.}<"0"-"9">* .IP "" 10 Note that the type Dimension must always be positive\&. .RE .IP "" 10 For example, .PP .nf \f(CWxmfonts*XmMainWindow\&.height: 10\&.4cm *PostIn\&.width: 3inches\fR .fi .PP .IP "" 10 \fBXmNunitType\fP can have the following values: .RS .IP "\fBXmPIXELS\fP" 10 All values provided to the widget are treated as normal pixel values\&. .IP "\fBXmMILLIMETERS\fP" 10 All values provided to the widget are treated as normal millimeter values\&. .IP "\fBXm100TH_MILLIMETERS\fP" 10 All values provided to the widget are treated as 1/100 of a millimeter\&. .IP "\fBXmCENTIMETERS\fP" 10 All values provided to the widget are treated as normal centimeter values\&. .IP "\fBXmINCHES\fP" 10 All values provided to the widget are treated as normal inch values\&. .IP "\fBXm1000TH_INCHES\fP" 10 All values provided to the widget are treated as 1/1000 of an inch\&. .IP "\fBXmPOINTS\fP" 10 All values provided to the widget are treated as normal point values\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXm100TH_POINTS\fP" 10 All values provided to the widget are treated as 1/100 of a point\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXmFONT_UNITS\fP" 10 All values provided to the widget are treated as normal font units\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fBXm100TH_FONT_UNITS\fP" 10 All values provided to the widget are treated as 1/100 of a font unit\&. A font unit has horizontal and vertical components\&. These are the values of the \fBXmScreen\fP resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .RE .IP "" 10 For more information about units, refer to the \fBXmConvertUnits\fP reference page\&. .IP "\fBXmNuseAsyncGeometry\fP" 10 Specifies whether the geometry manager should wait for confirmation of a geometry request to the window manager\&. When the value of this resource is True, the geometry manager forces \fBXmNwaitForWm\fP to False and \fBXmNwmTimeout\fP to 0, and it relies on asynchronous notification\&. When the value of this resource is False, \fBXmNwaitForWm\fP and \fBXmNwmTimeout\fP are unaffected\&. The default is False\&. .SS "Inherited Resources" .PP VendorShell inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .TS tab() box; c s s s s l| l| l| l| l. \fBWMShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbaseHeightXmCBaseHeightintXtUnspecifiedShellIntCSG _____ XmNbaseWidthXmCBaseWidthintXtUnspecifiedShellIntCSG _____ XmNheightIncXmCHeightIncintXtUnspecifiedShellIntCSG _____ XmNiconMaskXmCIconMaskPixmapNULLCSG _____ XmNiconPixmapXmCIconPixmapPixmapNULLCSG _____ XmNiconWindowXmCIconWindowWindowNULLCSG _____ XmNiconXXmCIconXintXtUnspecifiedShellIntCSG _____ XmNiconYXmCIconYintXtUnspecifiedShellIntCSG _____ XmNinitialStateXmCInitialStateintNormalStateCSG _____ XmNinputXmCInputBooleanTrueCSG _____ XmNmaxAspectXXmCMaxAspectXintXtUnspecifiedShellIntCSG _____ XmNmaxAspectYXmCMaxAspectYintXtUnspecifiedShellIntCSG _____ XmNmaxHeightXmCMaxHeightintXtUnspecifiedShellIntCSG _____ XmNmaxWidthXmCMaxWidthintXtUnspecifiedShellIntCSG _____ XmNminAspectXXmCMinAspectXintXtUnspecifiedShellIntCSG _____ XmNminAspectYXmCMinAspectYintXtUnspecifiedShellIntCSG _____ XmNminHeightXmCMinHeightintXtUnspecifiedShellIntCSG _____ XmNminWidthXmCMinWidthintXtUnspecifiedShellIntCSG _____ XmNtitleXmCTitleStringdynamicCSG _____ XmNtitleEncodingXmCTitleEncodingAtomdynamicCSG _____ XmNtransientXmCTransientBooleanFalseCSG _____ XmNwaitForWmXmCWaitForWmBooleanTrueCSG _____ XmNwidthIncXmCWidthIncintXtUnspecifiedShellIntCSG _____ XmNwindowGroupXmCWindowGroupWindowdynamicCSG _____ mNwinGravityXmCWinGravityintdynamicCSG _____ XmNwmTimeoutXmCWmTimeoutint5000 msCSG _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBShell Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowShellResizeXmCAllowShellResizeBooleanFalseCG _____ XmNcreatePopupChildProcXmCCreatePopupChildProcXtCreatePopupChildProcNULLCSG _____ XmNgeometryXmCGeometryStringNULLCSG _____ XmNoverrideRedirectXmCOverrideRedirectBooleanFalseCSG _____ XmNpopdownCallbackXmCCallbackXtCallbackListNULLC _____ XmNpopupCallbackXmCCallbackXtCallbackListNULLC _____ XmNsaveUnderXmCSaveUnderBooleanFalseCSG _____ XmNvisualXmCVisualVisual *CopyFromParentCSG _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP There are no translations for VendorShell\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBmwm\fP(1), \fBShell\fP(3), \fBWMShell\fP(3), \fBXmActivateProtocol\fP(3), \fBXmActivateWMProtocol\fP(3), \fBXmAddProtocolCallback\fP(3), \fBXmAddWMProtocolCallback\fP(3), \fBXmAddProtocols\fP(3), \fBXmAddWMProtocols\fP(3), \fBXmDeactivateProtocol\fP(3), \fBXmDeactivateWMProtocol\fP(3), \fBXmGetAtomName\fP(3), \fBXmInternAtom\fP(3), \fBXmIsMotifWMRunning\fP(3), \fBXmRemoveProtocolCallback\fP(3), \fBXmRemoveWMProtocolCallback\fP(3), \fBXmRemoveProtocols\fP(3), \fBXmRemoveWMProtocols\fP(3), \fBXmScreen\fP(3), \fBXmSetProtocolHooks\fP(3), and \fBXmSetWMProtocolHooks\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmDrawingArea.30000644000175000017500000005010112672140200014505 00000000000000'\" t ...\" DrawAr.sgm /main/11 1996/09/08 20:40:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDrawingArea" "library call" .SH "NAME" \fBXmDrawingArea\fP \(em The DrawingArea widget class .iX "XmDrawingArea" .iX "widget class" "DrawingArea" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP DrawingArea is an empty widget that is easily adaptable to a variety of purposes\&. It does no drawing and defines no behavior except for invoking callbacks\&. Callbacks notify the application when graphics need to be drawn (exposure events or widget resize) and when the widget receives input from the keyboard or mouse\&. .PP Applications are responsible for defining appearance and behavior as needed in response to DrawingArea callbacks\&. .PP DrawingArea is also a composite widget and subclass of \fBXmManager\fP that supports minimal geometry management for multiple widget or gadget children\&. .PP DrawingArea uses the \fBXmNinitialFocus\fP resource of \fBXmManager\fP to define whether or not DrawingArea will receive focus when it is traversed to, even if it has traversable children\&. If \fBXmNinitialFocus\fP is NULL, DrawingArea receives focus only if it does not have any traversable children\&. If \fBXmNinitialFocus\fP is not NULL, then DrawingArea receives focus when traversed to\&. In the latter case, the application first needs to be able to realize that the DrawingArea will receive focus, then, as appropriate, needs to either call the \fBXmProcessTraversal\fP function for the desired child, or to navigate across the private DrawingArea graphics objects\&. .PP The following resources are not currently used by the DrawingArea widget: \fBXmNshadowThickness\fP, \fBXmNtopShadowPixmap\fP, \fBXmNbottomShadowPixmap\fP, \fBXmNtopShadowColor\fP, and \fBXmNbottomShadowColor\fP .SS "Data Transfer Behavior" .PP DrawingArea has no widget class conversion or destination procedure\&. Subclasses and the \fBXmNconvertCallback\fP procedures are responsible for any conversion of selections\&. Subclasses and the \fBXmNdestinationCallback\fP procedures are responsible for any data transfers to the widget\&. .SS "Classes" .PP DrawingArea inherits behavior and resources from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmDrawingAreaWidgetClass\fP\&. .PP The class name is \fBXmDrawingArea\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDrawingArea Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNdestinationCallbackXmCCallbackXtCallbackListNULLC _____ XmNexposeCallbackXmCCallbackXtCallbackListNULLC _____ XmNinputCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension10CSG _____ XmNmarginWidthXmCMarginWidthDimension10CSG _____ XmNresizeCallbackXmCCallbackXtCallbackListNULLC _____ XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_ANYCSG _____ .TE .IP "\fBXmNconvertCallback\fP" 10 Specifies a list of callbacks called when the DrawingArea is asked to convert a selection\&. The type of the structure whose address is passed to these callbacks is \fBXmConvertCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNdestinationCallback\fP" 10 Specifies a list of callbacks called when the DrawingArea is the destination of a transfer operation\&. The type of the structure whose address is passed to these callbacks is \fBXmDestinationCallbackStruct\fR\&. The reason is \fBXmCR_OK\fP\&. .IP "\fBXmNexposeCallback\fP" 10 Specifies the list of callbacks that is called when DrawingArea receives an exposure event\&. The callback reason is \fBXmCR_EXPOSE\fP\&. The callback structure also includes the exposure event\&. .IP "" 10 The default bit gravity for Manager windows is \fBNorthWestGravity\fP\&. This may cause the \fBXmNexposeCallback\fP procedures not to be invoked when the DrawingArea window is made smaller\&. .IP "\fBXmNinputCallback\fP" 10 Specifies the list of callbacks that is called when the DrawingArea receives a keyboard or mouse event (key or button, up or down)\&. The callback reason is \fBXmCR_INPUT\fP\&. The callback structure also includes the input event\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the minimum spacing in pixels between the top or bottom edge of DrawingArea and any child widget\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the minimum spacing in pixels between the left or right edge of DrawingArea and any child widget\&. .IP "\fBXmNresizeCallback\fP" 10 Specifies the list of callbacks that is called when the DrawingArea is resized\&. The callback reason is \fBXmCR_RESIZE\fP\&. .IP "\fBXmNresizePolicy\fP" 10 Controls the policy for resizing DrawingArea widgets\&. Possible values include \fBXmRESIZE_NONE\fP (fixed size), \fBXmRESIZE_ANY\fP (shrink or grow as needed), and \fBXmRESIZE_GROW\fP (grow only)\&. .SS "Inherited Resources" .PP DrawingArea inherits behavior and resources from the following superclasses\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to the \fBXmNexposeCallback\fP, \fBXmNinputCallback\fP, and \fBXmNresizeCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Window \fIwindow\fP; } XmDrawingAreaCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. This is NULL for the \fBXmNresizeCallback\fP\&. .IP "\fIwindow\fP" 10 Is set to the widget window\&. .PP A pointer to the following structure is passed to the \fBXmNconvertCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; Atom \fItarget\fP; XtPointer \fIsource_data\fP; XtPointer \fIlocation_data\fP; int \fIflags\fP; XtPointer \fIparm\fP; int \fIparm_format\fP; unsigned long \fIparm_length\fP; int \fIstatus\fP; XtPointer \fIvalue\fP; Atom \fItype\fP; int \fIformat\fP; unsigned long \fIlength\fP; } XmConvertCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which conversion is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fItarget\fP" 10 Indicates the conversion target\&. .IP "\fIsource_data\fP" 10 Contains information about the selection source\&. When the selection is \fB_MOTIF_DROP\fP, \fIsource_data\fP is the DragContext\&. Otherwise, it is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location of data to be converted\&. If the value is NULL, the data to be transferred consists of the widget\&'s current selection\&. .IP "\fIflags\fP" 10 Indicates the status of the conversion\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 This flag is currently unused\&. .IP "\fBXmCONVERTING_PARTIAL\fP" 10 The target widget was able to be converted, but some data was lost\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The conversion target is the source of the data to be transferred\&. .IP "\fBXmCONVERTING_TRANSACT\fP" 10 This flag is currently unused\&. .RE .IP "\fIparm\fP" 10 Contains parameter data for this target\&. If no parameter data exists, the value is NULL\&. .IP "" 10 When \fIselection\fP is \fBCLIPBOARD\fP and \fItarget\fP is \fB_MOTIF_CLIPBOARD_TARGETS\fP or \fB_MOTIF_DEFERRED_CLIPBOARD_TARGETS\fP, the value is the requested operation (\fBXmCOPY\fP, \fBXmMOVE\fP, or \fBXmLINK\fP)\&. .IP "\fIparm_format\fP" 10 Specifies whether the data in \fIparm\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. Possible values are 0 (when \fIparm\fP is NULL), 8 (when the data in \fIparm\fP should be viewed as a list of \fIchar\fPs), 16 (when the data in \fIparm\fP should be viewed as a list of \fIshort\fPs), or 32 (when the data in \fIparm\fP should be viewed as a list of \fIlong\fPs)\&. Note that \fIparm_format\fP symbolizes a data type, not the number of bits in each list element\&. For example, on some machines, a \fIparm_format\fP of 32 means that the data in \fIparm\fP should be viewed as a list of 64-bit quantities, not 32-bit quantities\&. .IP "\fIparm_length\fP" 10 Specifies the number of elements of data in \fIparm\fP, where each element has the size specified by \fIparm_format\fP\&. When \fIparm\fP is NULL, the value is 0\&. .IP "\fIstatus\fP" 10 An IN/OUT member that specifies the status of the conversion\&. The initial value is \fBXmCONVERT_DEFAULT\fP\&. The callback procedure can set this member to one of the following values: .RS .IP "\fBXmCONVERT_DEFAULT\fP" 10 This value means that the widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it overwrites the data provided by the callback procedures in the \fIvalue\fP member\&. .IP "\fBXmCONVERT_MERGE\fP" 10 This value means that the widget class conversion procedure, if any, is called after the callback procedures return\&. If the widget class conversion procedure produces any data, it appends its data to the data provided by the callback procedures in the \fIvalue\fP member\&. This value is intended for use with targets that result in lists of data, such as \fBTARGETS\fP\&. .IP "\fBXmCONVERT_DONE\fP" 10 This value means that the callback procedure has successfully finished the conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .IP "\fBXmCONVERT_REFUSE\fP" 10 This value means that the callback procedure has terminated the conversion process without completing the requested conversion\&. The widget class conversion procedure, if any, is not called after the callback procedures return\&. .RE .IP "\fIvalue\fP" 10 An IN/OUT parameter that contains any data that the callback procedure produces as a result of the conversion\&. The initial value is NULL\&. If the callback procedure sets this member, it must ensure that the \fItype\fP, \fIformat\fP, and \fIlength\fP members correspond to the data in \fIvalue\fP\&. The callback procedure is responsible for allocating, but not for freeing, memory when it sets this member\&. .IP "\fItype\fP" 10 An IN/OUT parameter that indicates the type of the data in the \fIvalue\fP member\&. The initial value is \fBINTEGER\fP\&. .IP "\fIformat\fP" 10 An IN/OUT parameter that specifies whether the data in \fIvalue\fP should be viewed as a list of \fIchar\fP, \fIshort\fP, or \fIlong\fP quantities\&. The initial value is 8\&. The callback procedure can set this member to 8 (for a list of \fIchar\fP), 16 (for a list of \fIshort\fP), or 32 (for a list of \fIlong\fP)\&. .IP "\fIlength\fP" 10 An IN/OUT member that specifies the number of elements of data in \fIvalue\fP, where each element has the size symbolized by \fIformat\fP\&. The initial value is 0\&. .PP A pointer to the following callback structure is passed to the \fBXmNdestinationCallback\fP procedures: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Atom \fIselection\fP; XtEnum \fIoperation\fP; int \fIflags\fP; XtPointer \fItransfer_id\fP; XtPointer \fIdestination_data\fP; XtPointer \fIlocation_data\fP; Time \fItime\fP; } XmDestinationCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIselection\fP" 10 Indicates the selection for which data transfer is being requested\&. Possible values are \fBCLIPBOARD\fP, \fBPRIMARY\fP, \fBSECONDARY\fP, and \fB_MOTIF_DROP\fP\&. .IP "\fIoperation\fP" 10 Indicates the type of transfer operation requested\&. .RS .IP " \(bu" 6 When the selection is \fBPRIMARY\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fBSECONDARY\fP or \fBCLIPBOARD\fP, possible values are \fBXmCOPY\fP and \fBXmLINK\fP\&. .IP " \(bu" 6 When the selection is \fB_MOTIF_DROP\fP, possible values are \fBXmMOVE\fP, \fBXmCOPY\fP, \fBXmLINK\fP, and \fBXmOTHER\fP\&. A value of \fBXmOTHER\fP means that the callback procedure must get further information from the \fBXmDropProcCallbackStruct\fR in the \fIdestination_data\fP member\&. .RE .IP "\fIflags\fP" 10 Indicates whether or not the destination widget is also the source of the data to be transferred\&. Following are the possible values: .RS .IP "\fBXmCONVERTING_NONE\fP" 10 The destination widget is not the source of the data to be transferred\&. .IP "\fBXmCONVERTING_SAME\fP" 10 The destination widget is the source of the data to be transferred\&. .RE .IP "\fBtransfer_id\fP" 10 Serves as a unique ID to identify the transfer transaction\&. .IP "\fIdestination_data\fP" 10 Contains information about the destination\&. When the selection is \fB_MOTIF_DROP\fP, the callback procedures are called by the drop site\&'s \fBXmNdropProc\fP, and \fIdestination_data\fP is a pointer to the \fBXmDropProcCallbackStruct\fR passed to the \fBXmNdropProc\fP procedure\&. When the selection is \fBSECONDARY\fP, \fIdestination_data\fP is an Atom representing a target recommmended by the selection owner for use in converting the selection\&. Otherwise, \fIdestination_data\fP is NULL\&. .IP "\fBlocation_data\fP" 10 Contains information about the location where data is to be transferred\&. The value is always NULL when the selection is \fBSECONDARY\fP or \fBCLIPBOARD\fP\&. If the value is NULL, the data is to be inserted at the widget\&'s cursor position\&. \fBlocation_data\fP is only valid for the duration of a transfer\&. Once \fBXmTransferDone\fP procedures start to be called, \fBlocation_data\fP will no longer be stable\&. .IP "\fItime\fP" 10 Indicates the time when the transfer operation began\&. .SS "Translations" .PP XmDrawingArea inherits translations from XmManager\&. Before calling the XmManager actions, all events in the inherited translations except \fB\fP, \fB\fP, \fB\fP, \fB\fP, and \fB\fP also call the DrawingAreaInput() action\&. .PP XmDrawingArea has the following additional translations\&. The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 DrawingAreaInput() .IP "\fB\fP:" 10 DrawingAreaInput() .IP "\fB\fP:" 10 DrawingAreaInput() ManagerGadgetKeyInput() .IP "\fB\fP:" 10 DrawingAreaInput() .SS "Action Routines" .PP The \fBXmDrawingArea\fP action routines are .IP "DrawingAreaInput():" 10 Unless the event takes place in a gadget, calls the callbacks for \fBXmNinputCallback\fP .IP "ManagerGadgetKeyInput():" 10 Causes the current gadget to process a keyboard event .SS "Additional Behavior" .PP The XmDrawingArea widget has the following additional behavior: .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNexposeCallback\fP .IP "\fB\fP:" 10 Calls the callbacks for \fBXmNresizeCallback\fP .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateDrawingArea\fP(3), \fBXmManager\fP(3), \fBXmVaCreateDrawingArea\fP(3), and \fBXmVaCreateManagedDrawingArea\fP(3)\&. motif-2.3.8/doc/man/man3/XmDirection.30000644000175000017500000001114012672140200014241 00000000000000'\" t ...\" DirectA.sgm /main/8 1996/09/08 20:38:49 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDirection" "library call" .SH "NAME" \fBXmDirection\fR \(em Data type for the direction of widget components .iX "XmDirection" .iX "data types" "XmDirection" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmDirection\fR is the data type specifying the direction in which the system displays subwidgets, children of widgets, or other visual components that are to be laid out\&. This data type also affects traversal order within tab groups\&. .PP \fBXmDirection\fR is implemented as an unsigned char bit mask\&. The horizontal and vertical directions can be specified independent of each other\&. \fBXmDirection\fR also specifies the precedence of the horizontal and vertical directions relative to each other\&. For example, a value of \fBXmRIGHT_TO_LEFT_TOP_TO_BOTTOM\fP lays out a component horizontally from right to left first, then vertically top to bottom\&. .PP \fBXmDirection\fR provides the following masks, each of which corresponds to a particular bit in \fBXmDirection\fR: .IP " \(bu" 6 \fBXmRIGHT_TO_LEFT_MASK\fP .IP " \(bu" 6 \fBXmLEFT_TO_RIGHT_MASK\fP .IP " \(bu" 6 \fBXmTOP_TO_BOTTOM_MASK\fP .IP " \(bu" 6 \fBXmBOTTOM_TO_TOP_MASK\fP .IP " \(bu" 6 \fBXmPRECEDENCE_HORIZ_MASK\fP .IP " \(bu" 6 \fBXmPRECEDENCE_VERT_MASK\fP .PP In addition to the preceding single bit masks, \fBXmDirection\fR also provides the following multiple bit masks\&. These multiple bit masks are particularly useful as arguments to \fBXmDirectionMatchPartial\fP: .IP " \(bu" 6 \fBXmHORIZONTAL_MASK\fP .IP " \(bu" 6 \fBXmPRECEDENCE_MASK\fP .IP " \(bu" 6 \fBXmVERTICAL_MASK\fP .PP Motif also provides the following enumerated constants for specifying various combinations of directions: .IP "\fBXmRIGHT_TO_LEFT_TOP_TO_BOTTOM\fP" 10 Specifies that the components are laid out from right to left first, then top to bottom\&. .IP "\fBXmLEFT_TO_RIGHT_TOP_TO_BOTTOM\fP" 10 Specifies that the components are laid out from left to right first, then top to bottom\&. .IP "\fBXmRIGHT_TO_LEFT_BOTTOM_TO_TOP\fP" 10 Specifies that the components are laid out from right to left first, then bottom to top\&. .IP "\fBXmLEFT_TO_RIGHT_BOTTOM_TO_TOP\fP" 10 Specifies that the components are laid out from left to right first, then bottom to top\&. .IP "\fBXmTOP_TO_BOTTOM_RIGHT_TO_LEFT\fP" 10 Specifies that the components are laid out from top to bottom first, then right to left\&. .IP "\fBXmTOP_TO_BOTTOM_LEFT_TO_RIGHT\fP" 10 Specifies that the components are laid out from top to bottom first, then left to right\&. .IP "\fBXmBOTTOM_TO_TOP_RIGHT_TO_LEFT\fP" 10 Specifies that the components are laid out from bottom to top first, then right to left\&. .IP "\fBXmBOTTOM_TO_TOP_LEFT_TO_RIGHT\fP" 10 Specifies that the components are laid out from bottom to top first, then left to right\&. .IP "\fBXmTOP_TO_BOTTOM\fP" 10 Specifies that the components are laid out from top to bottom\&. If horizontal direction is important, do not use this constant\&. .IP "\fBXmBOTTOM_TO_TOP\fP" 10 Specifies that the components are laid out from bottom to top\&. If horizontal direction is important, do not use this constant\&. .IP "\fBXmDEFAULT_DIRECTION\fP" 10 Specifies that the components are laid out according to the default direction\&. (This constant is primarily for widget writers\&.) .IP "\fBXmLEFT_TO_RIGHT\fP" 10 Specifies that the components are laid out from left to right\&. If vertical direction is important, do not use this constant\&. .IP "\fBXmRIGHT_TO_LEFT\fP" 10 Specifies that the components are laid out from right to left\&. If vertical direction is important, do not use this constant\&. .SH "RELATED" .PP \fBXmDirectionMatch\fP(3), \fBXmDirectionMatchPartial\fP(3), \fBXmDirectionToStringDirection\fP(3), \fBXmString\fP(3), \fBXmStringDirection\fP(3), and \fBXmStringDirectionToDirection\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmDataFieldPaste.30000644000175000017500000000502512672140200015140 00000000000000'\" t ...\" TxtFieAT.sgm /main/8 1996/09/08 21:14:36 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldPaste" "library call" .SH "NAME" \fBXmDataFieldPaste\fP \(em A DataField function that inserts the clipboard selection .iX "XmDataFieldPaste" .iX "DataField functions" "XmDataFieldPaste" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmDataFieldPaste\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldPaste\fP inserts the clipboard selection at the insertion cursor of the destination widget\&. If \fBXmNpendingDelete\fP is True and the insertion cursor is inside the current selection, the clipboard selection replaces the selected text\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. .PP This routine calls the widget\&'s \fBXmNdestinationCallback\fP procedures with the \fIselection\fP member of the \fBXmDestinationCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIoperation\fP member set to \fBXmCOPY\fP\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as the position where the selection is to be inserted, the \fBXmNmotionVerifyCallback\fP is called\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP This function returns False if no transfers take place\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmListDeleteItemsPos.30000644000175000017500000000367612672140200016062 00000000000000'\" t ...\" LstDeleD.sgm /main/8 1996/09/08 20:50:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListDeleteItemsPos" "library call" .SH "NAME" \fBXmListDeleteItemsPos\fP \(em A List function that deletes items from the list starting at the given position .iX "XmListDeleteItemsPos" .iX "List functions" "XmListDeleteItemsPos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListDeleteItemsPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBitem_count\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListDeleteItemsPos\fP deletes the specified number of items from the list starting at the specified position\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List from whose list an item is deleted\&. .IP "\fIitem_count\fP" 10 Specifies the number of items to be deleted\&. This number must be nonnegative\&. .IP "\fIposition\fP" 10 Specifies the position in the list of the first item to be deleted\&. A value of 1 indicates that the first deleted item is the first item in the list; a value of 2 indicates that it is the second item; and so on\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmMultiListGetSelectedRowArray.30000644000175000017500000000213612672140200020054 00000000000000.TH "XmMultiListGetSelectedRowArray" "library call" .SH "NAME" \fBXmMultiListGetSelectedRowArray\fP \(em an MultiList function that returns an array of integers which are selected row numbers. .iX "XmMultiListGetSelectedRowArray" .iX "List functions" "XmMultiListGetSelectedRowArray" .SH "SYNOPSIS" .PP .nf #include \fBint * \fBXmMultiListGetSelectedRowArray\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint * \fBnum_rows\fR\fR); .fi .SH "DESCRIPTION" .PP This routine creates an array of integers which are selected row numbers in the MultiList widget. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget\&. .IP "\fInum_rows\fP" 10 Specifies pointer to the integer indicates number of returned row numbers. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RETURN" .PP The \fBint *\fR returned by this function contains a selected rows numbers array. The calling routine is responsible for freeing the returned pointer with XtFree()\&. The function will return NULL if no elements are selected\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedFrame.30000644000175000017500000000003312672140200016242 00000000000000.so man3/XmVaCreateFrame.3 motif-2.3.8/doc/man/man3/XmListAddItemUnselected.30000644000175000017500000000372712672140200016514 00000000000000'\" t ...\" LstAddIB.sgm /main/7 1996/08/30 15:38:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListAddItemUnselected" "library call" .SH "NAME" \fBXmListAddItemUnselected\fP \(em A List function that adds an item to the list .iX "XmListAddItemUnselected" .iX "List functions" "XmListAddItemUnselected" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListAddItemUnselected\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBitem\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListAddItemUnselected\fP adds an item to the list at the given position\&. The item does not appear selected, even if it matches an item in the current \fBXmNselectedItems\fP list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List from whose list an item is added\&. .IP "\fIitem\fP" 10 Specifies the item to be added to the list\&. .IP "\fIposition\fP" 10 Specifies the position of the new item in the list\&. A value of 1 makes the new item the first item in the list; a value of 2 makes it the second item; and so on\&. A value of 0 (zero) makes the new item the last item in the list\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmCreateFileSelectionBox.30000644000175000017500000000525012672140200016650 00000000000000'\" t ...\" CreFiA.sgm /main/8 1996/09/08 20:33:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateFileSelectionBox" "library call" .SH "NAME" \fBXmCreateFileSelectionBox\fP \(em The FileSelectionBox widget creation function .iX "XmCreateFileSelection\\%Box" .iX "creation functions" "XmCreateFileSelection\\%Box" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateFileSelectionBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateFileSelectionBox\fP creates an unmanaged FileSelectionBox\&. A FileSelectionBox is used to select a file and includes the following: .IP " \(bu" 6 An editable text field for the directory mask .IP " \(bu" 6 A scrolling list of filenames .IP " \(bu" 6 An editable text field for the selected file .IP " \(bu" 6 Labels for the list and text fields .IP " \(bu" 6 Four buttons .PP The default button labels are \fBOK\fP, \fBFilter\fP, \fBCancel\fP, and \fBHelp\fP\&. Additional work area children may be added to the FileSelectionBox after creation\&. FileSelectionBox inherits the layout functionality provided by SelectionBox for any additional work area children\&. .PP If the parent of the FileSelectionBox is a DialogShell, use \fBXtManageChild\fP to pop up the FileSelectionDialog (passing the FileSelectionBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of FileSelectionBox and its associated resources, see \fBXmFileSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the FileSelectionBox widget ID\&. .SH "RELATED" .PP \fBXmFileSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmStringDirectionCreate.30000644000175000017500000000373112672140200016563 00000000000000'\" t ...\" StrDiB.sgm /main/7 1996/08/30 16:09:35 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringDirectionCreate" "library call" .SH "NAME" \fBXmStringDirectionCreate\fP \(em A compound string function that creates a compound string .iX "XmStringDirectionCreate" .iX "compound string functions" "XmStringDirectionCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringDirectionCreate\fP\fR( \fBXmStringDirection \fBdirection\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringDirectionCreate\fP creates a compound string with a single component, a direction with the given value\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .IP "\fIdirection\fP" 10 Specifies the value of the direction component\&. The possible values are: .RS .IP "\fBXmSTRING_DIRECTION_L_TO_R\fP" 10 Specifies left to right display\&. .IP "\fBXmSTRING_DIRECTION_R_TO_L\fP" 10 Specifies right to left display\&. .IP "\fBXmSTRING_DIRECTION_DEFAULT\fP" 10 Specifies that the display direction will be set by the widget in which the compound string is to be displayed\&. .RE .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmFontListAppendEntry.30000644000175000017500000000422412672140200016242 00000000000000'\" t ...\" FontLstD.sgm /main/8 1996/09/08 20:43:30 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListAppendEntry" "library call" .SH "NAME" \fBXmFontListAppendEntry\fP \(em A font list function that appends an entry to a font list .iX "XmFontListAppendEntry" .iX "font list functions" "XmFontListAppendEntry" .SH "SYNOPSIS" .PP .nf #include \fBXmFontList \fBXmFontListAppendEntry\fP\fR( \fBXmFontList \fBoldlist\fR\fR, \fBXmFontListEntry \fBentry\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListAppendEntry\fP creates a new font list that contains the contents of \fIoldlist\fP\&. This function copies the contents of the font list entry being added into this new font list\&. If \fIoldlist\fP is NULL, \fBXmFontListAppendEntry\fP creates a new font list containing only the single entry specified\&. .PP This function deallocates the original font list after extracting the required information\&. The caller must free the font list entry by using \fBXmFontListEntryFree\fP\&. .IP "\fIoldlist\fP" 10 Specifies the font list to be added to .IP "\fIentry\fP" 10 Specifies the font list entry to be added .SH "RETURN" .PP If \fIentry\fP is NULL, returns \fIoldlist\fP; otherwise, returns a new font list\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryFree\fP(3), \fBXmFontListEntryLoad\fP(3), \fBXmFontListFree\fP(3), and \fBXmFontListRemoveEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmRenderTableGetTags.30000644000175000017500000000376712672140200016007 00000000000000'\" t ...\" RendTaI.sgm /main/10 1996/09/08 20:57:53 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableGetTags" "library call" .SH "NAME" \fBXmRenderTableGetTags\fP \(em A convenience function that gets rendition tags .iX "XmRenderTableGetTags" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmRenderTableGetTags\fP\fR( \fBXmRenderTable \fBtable\fR\fR, \fBXmStringTag \fB**tag_list\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableGetTags\fP searches the specified \fItable\fP for the \fBXmNtag\fP resources of all the renditions (\fBXmRendition\fRs) entries\&. These tag resources are then composed into an array\&. .IP "\fItable\fP" 10 Specifies the table containing the \fBXmRendition\fRs\&. .IP "\fItag_list\fP" 10 Is the array of \fBXmStringTags\fP generated by this function\&. The function allocates space to hold the returned tags and to hold the \fItag_list\fP itself\&. The application is responsible for managing this allocated space\&. This application can recover this allocated space by calling \fBXtFree\fP once for each of the returned tags, and then calling \fBXtFree\fP on the returned \fItag_list\fP variable itself\&. .SH "RETURN" .PP Returns the number of tags in \fItag_list\fP\&. .SH "RELATED" .PP \fBXmRendition\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmVaCreateManagedCombinationBox2.30000644000175000017500000000004512672140200020210 00000000000000.so man3/XmVaCreateCombinationBox2.3 motif-2.3.8/doc/man/man3/XmStringSeparatorCreate.30000644000175000017500000000300512672140200016575 00000000000000'\" t ...\" StrSep.sgm /main/8 1996/09/08 21:07:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringSeparatorCreate" "library call" .SH "NAME" \fBXmStringSeparatorCreate\fP \(em A compound string function that creates a compound string .iX "XmStringSeparatorCreate" .iX "compound string functions" "XmStringSeparatorCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringSeparatorCreate\fP\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmStringSeparatorCreate\fP creates a compound string with a single component, a separator\&. .SH "RETURN" .PP Returns a new compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmStringCreateLtoR.30000644000175000017500000000467312672140200015531 00000000000000'\" t ...\" StrCrC.sgm /main/8 1996/09/08 21:03:53 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringCreateLtoR" "library call" .SH "NAME" \fBXmStringCreateLtoR\fP \(em A compound string function that creates a compound string .iX "XmStringCreateLtoR" .iX "compound string functions" "XmStringCreateLtoR" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringCreateLtoR\fP\fR( \fBchar *\fBtext\fR\fR, \fBchar *\fBtag\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmStringGenerate\fP\&. \fBXmStringCreateLtoR\fP creates a compound string with two components: text and a tag component\&. This function scans for \fB\en\fP characters in the text\&. When one is found, the text up to that point is put into a segment followed by a separator component\&. No final separator component is appended to the end of the compound string\&. The direction component defaults to left-to-right\&. This function assumes that the encoding is single byte rather than multibyte\&. .PP The function will allocate space to hold the returned compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fItext\fP" 10 Specifies a NULL-terminated string to be used as the text component of the compound string\&. .IP "\fItag\fP" 10 Specifies the tag component to be associated with the given text\&. The value \fBXmFONTLIST_DEFAULT_TAG\fP is retained for compatibility with previous releases\&. .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringGenerate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmStringCreate.30000644000175000017500000000630612672140200014723 00000000000000'\" t ...\" StrCrA.sgm /main/8 1996/09/08 21:03:45 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringCreate" "library call" .SH "NAME" \fBXmStringCreate\fP \(em A compound string function that creates a compound string .iX "XmStringCreate" .iX "compound string functions" "XmStringCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringCreate\fP\fR( \fBchar *\fBtext\fR\fR, \fBchar *\fBtag\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringCreate\fP creates a compound string with two components: text and a font list element tag\&. The function will allocate space to hold the returned compound string\&. When the application no longer needs the returned compound string, the application should call \fBXmStringFree\fP\&. .IP "\fItext\fP" 10 Specifies a NULL-terminated string to be used as the text component of the compound string\&. .IP "\fItag\fP" 10 Specifies the tag component to be associated with the given text\&. The value \fBXmFONTLIST_DEFAULT_TAG\fP identifies a locale text segment\&. .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListAdd\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmFontListCopy\fP(3), \fBXmFontListCreate\fP(3), \fBXmFontListEntryCreate\fP(3), \fBXmFontListEntryFree\fP(3), \fBXmFontListEntryGetFont\fP(3), \fBXmFontListEntryGetTag\fP(3), \fBXmFontListEntryLoad\fP(3), \fBXmFontListFree\fP(3), \fBXmFontListFreeFontContext\fP(3), \fBXmFontListGetNextFont\fP(3), \fBXmFontListInitFontContext\fP(3), \fBXmFontListNextEntry\fP(3), \fBXmFontListRemoveEntry\fP(3), \fBXmString\fP(3), \fBXmStringBaseline\fP(3), \fBXmStringByteCompare\fP(3), \fBXmStringCompare\fP(3), \fBXmStringConcat\fP(3), \fBXmStringCopy\fP(3), \fBXmStringCreateLocalized\fP(3), \fBXmStringCreateLtoR\fP(3), \fBXmStringCreateSimple\fP(3), \fBXmStringDirection\fP(3), \fBXmStringDirectionCreate\fP(3), \fBXmStringDraw\fP(3), \fBXmStringDrawImage\fP(3), \fBXmStringDrawUnderline\fP(3), \fBXmStringEmpty\fP(3), \fBXmStringExtent\fP(3), \fBXmStringFree\fP(3), \fBXmStringFreeContext\fP(3), \fBXmStringGetLtoR\fP(3), \fBXmStringGetNextComponent\fP(3), \fBXmStringGetNextSegment\fP(3), \fBXmStringHasSubstring\fP(3), \fBXmStringHeight\fP(3), \fBXmStringInitContext\fP(3), \fBXmStringLength\fP(3), \fBXmStringLineCount\fP(3), \fBXmStringNConcat\fP(3), \fBXmStringNCopy\fP(3), \fBXmStringPeekNextComponent\fP(3), \fBXmStringSegmentCreate\fP(3), \fBXmStringSeparatorCreate\fP(3), \fBXmStringTable\fP(3), and \fBXmStringWidth\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmDropSiteRetrieve.30000644000175000017500000000411412672140200015563 00000000000000'\" t ...\" DropSitV.sgm /main/8 1996/09/08 20:41:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteRetrieve" "library call" .SH "NAME" \fBXmDropSiteRetrieve\fP \(em A Drag and Drop function that retrieves resource values set on a drop site .iX "XmDropSiteRetrieve" .iX "Drag and Drop functions" "XmDropSiteRetrieve" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropSiteRetrieve\fP\fR( \fBWidget \fBwidget\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteRetrieve\fP extracts values for the given resources from the drop site specified by \fIwidget\fP\&. An initiator can also obtain information about the current drop site by passing the associated DragContext widget as the \fIwidget\fP parameter to this routine\&. The initiator can retrieve all of the drop site resources except \fBXmNdragProc\fP and \fBXmNdropProc\fP using this method\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget that encloses the drop site\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RELATED" .PP \fBXmDropSite\fP(3) and \fBXmDropSiteUpdate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmRenditionFree.30000644000175000017500000000245212672140200015064 00000000000000'\" t ...\" RendC.sgm /main/7 1996/08/30 15:56:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenditionFree" "library call" .SH "NAME" \fBXmRenditionFree\fP \(em A convenience function that frees a rendition .iX "XmRenditionFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmRenditionFree\fP\fR( \fBXmRendition \fBrendition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenditionFree\fP recovers memory used by \fIrendition\fP\&. .IP "\fIrendition\fP" 10 Specifies the rendition to be freed\&. .SH "RELATED" .PP \fBXmRendition\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmGetPostedFromWidget.30000644000175000017500000000403712672140200016216 00000000000000'\" t ...\" GetPost.sgm /main/7 1996/08/30 15:28:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetPostedFromWidget" "library call" .SH "NAME" \fBXmGetPostedFromWidget\fP \(em A RowColumn function that returns the widget from which a menu was posted .iX "XmGetPostedFromWidget" .iX "RowColumn functions" "XmGetPostedFromWidget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetPostedFromWidget\fP\fR( \fBWidget \fBmenu\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetPostedFromWidget\fP returns the widget from which a menu was posted\&. For torn-off menus, this function returns the widget from which the menu was originally torn\&. An application can use this routine during the activate callback to determine the context in which the menu callback should be interpreted\&. .IP "\fImenu\fP" 10 Specifies the widget ID of the menu .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the widget from which the menu was posted\&. If the menu is a Popup Menu, the returned widget is the widget from which the menu was popped up\&. If the menu is a Pulldown Menu, the returned widget is the MenuBar or OptionMenu from which the widget was pulled down\&. .SH "RELATED" .PP \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmFrame.30000644000175000017500000002566312672140200013372 00000000000000'\" t ...\" Frame.sgm /main/9 1996/09/08 20:45:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFrame" "library call" .SH "NAME" \fBXmFrame\fP \(em The Frame widget class .iX "XmFrame" .iX "widget class" "Frame" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Frame is a very simple manager used to enclose a single work area child in a border drawn by Frame\&. It uses the Manager class resources for border drawing and performs geometry management so that its size always matches its child\&'s outer size plus the Frame\&'s margins and shadow thickness\&. .PP Frame is most often used to enclose other managers when the application developer wants the manager to have the same border appearance as the primitive widgets\&. Frame can also be used to enclose primitive widgets that do not support the same type of border drawing\&. This gives visual consistency when you develop applications using diverse widget sets\&. Constraint resources are used to designate a child as the Frame title, align its text, and control its vertical alignment in relation to Frame\&'s top shadow\&. The title appears only at the top of the Frame\&. .PP If the Frame\&'s parent is a Shell widget, the \fBXmNshadowType\fP resource defaults to \fBXmSHADOW_OUT\fP, and the Manager\&'s \fBXmNshadowThickness\fP resource defaults to 1\&. .PP If the Frame\&'s parent is not a Shell widget, the \fBXmNshadowType\fP resouce defaults to \fBXmSHADOW_ETCHED_IN\fP, and the Manager\&'s \fBXmNshadowThickness\fP resource defaults to 2\&. .SS "Classes" .PP Frame inherits behavior and resources from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmFrameWidgetClass\fP\&. .PP The class name is \fBXmFrame\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmFrame Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNmarginWidthXmCMarginWidthDimension0CSG _____ XmNmarginHeightXmCMarginHeightDimension0CSG _____ XmNshadowTypeXmCShadowTypeunsigned chardynamicCSG _____ .TE .IP "\fBXmNmarginWidth\fP" 10 Specifies the padding space on the left and right sides between Frame\&'s child and Frame\&'s shadow drawing\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the padding space on the top and bottom sides between Frame\&'s child and Frame\&'s shadow drawing\&. When a title is present, the top margin equals the value specified by this resource plus the distance (if any) that the title extends below the top shadow\&. .IP "\fBXmNshadowType\fP" 10 Describes the drawing style for Frame\&. This resource can have the following values: .RS .IP "\fBXmSHADOW_IN\fP" 10 Draws Frame so that it appears inset\&. This means that the bottom shadow visuals and top shadow visuals are reversed\&. .IP "\fBXmSHADOW_OUT\fP" 10 Draws Frame so that it appears outset\&. This is the default if Frame\&'s parent is a Shell widget\&. .IP "\fBXmSHADOW_ETCHED_IN\fP" 10 Draws Frame using a double line giving the effect of a line etched into the window\&. The thickness of the double line is equal to the value of \fBXmNshadowThickness\fP\&. This is the default when Frame\&'s parent is not a Shell widget\&. .IP "\fBXmSHADOW_ETCHED_OUT\fP" 10 Draws Frame using a double line giving the effect of a line coming out of the window\&. The thickness of the double line is equal to the value of \fBXmNshadowThickness\fP\&. .RE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmFrame Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildTypeXmCChildTypeunsigned charXmFRAME_WORKAREA_CHILDCSG _____ XmNchildHorizontalAlignmentXmCChildHorizontalAlignmentunsigned charXmALIGNMENT_BEGINNINGCSG _____ XmNchildHorizontalSpacingXmCChildHorizontalSpacingDimensiondynamicCSG _____ XmNchildVerticalAlignmentXmCChildVerticalAlignmentunsigned charXmALIGNMENT_CENTERCSG _____ XmNframeChildTypeXmCFrameChildTypeunsigned charXmFRAME_WORKAREA_CHILDCSG _____ .TE .IP "\fBXmNchildType\fP" 10 Refer to the \fBXmNframeChildType\fP resource description\&. The \fBXmNchildType\fP resource is obsoleted by \fBXmNframeChildType\fP, but is kept here for backward compatibility\&. .IP "\fBXmNchildHorizontalAlignment\fP" 10 Specifies the alignment of the title\&. This resource has the following values: .RS .IP " \(bu" 6 \fBXmALIGNMENT_BEGINNING\fP .IP " \(bu" 6 \fBXmALIGNMENT_CENTER\fP .IP " \(bu" 6 \fBXmALIGNMENT_END\fP .RE .IP "" 10 See the description of \fBXmNalignment\fP in the \fBXmLabel\fP reference page for an explanation of these values\&. .IP "\fBXmNchildHorizontalSpacing\fP" 10 Specifies the minimum distance between either edge of the title text and the inner edge of the Frame shadow\&. Clipping of the title text occurs in order to maintain this spacing\&. The default value is the margin width of the Frame\&. .IP "\fBXmNchildVerticalAlignment\fP" 10 Specifies the vertical alignment of the title text, or the title area in relation to the top shadow of the Frame\&. .RS .IP "\fBXmALIGNMENT_BASELINE_BOTTOM\fP" 10 Causes the baseline of the title to align vertically with the top shadow of the Frame\&. In the case of a multi-line title, the baseline of the last line of text aligns vertically with the top shadow of the Frame\&. .IP "\fBXmALIGNMENT_BASELINE_TOP\fP" 10 Causes the baseline of the first line of the title to align vertically with the top shadow of the Frame\&. .IP "\fBXmALIGNMENT_CHILD_TOP\fP" 10 Causes the top edge of the title area to align vertically with the top shadow of the Frame\&. .IP "\fBXmALIGNMENT_CENTER\fP" 10 Causes the center of the title area to align vertically with the top shadow of the Frame\&. .IP "\fBXmALIGNMENT_CHILD_BOTTOM\fP" 10 Causes the bottom edge of the title area to align vertically with the top shadow of the Frame\&. .RE .IP "\fBXmNframeChildType\fP" 10 Specifies whether a child is a title or work area\&. Frame supports a single title and/or work area child\&. The possible values are .RS .IP " \(bu" 6 \fBXmFRAME_TITLE_CHILD\fP .IP " \(bu" 6 \fBXmFRAME_WORKAREA_CHILD\fP .IP " \(bu" 6 \fBXmFRAME_GENERIC_CHILD\fP .RE .IP "" 10 The Frame geometry manager ignores any child of type \fBXmFRAME_GENERIC_CHILD\fP\&. This resource replaces \fBXmNchildType\fP\&. .SS "Inherited Resources" .PP Frame inherits behavior and resources from the following superclasses\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP XmFrame inherits translations from XmManager\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateFrame\fP(3), \fBXmManager\fP(3), \fBXmVaCreateFrame\fP(3), and \fBXmVaCreateManagedFrame\fP(3)\&. motif-2.3.8/doc/man/man3/XmScaleGetValue.30000644000175000017500000000304712672140200015014 00000000000000'\" t ...\" ScaleGV.sgm /main/7 1996/08/30 16:02:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScaleGetValue" "library call" .SH "NAME" \fBXmScaleGetValue\fP \(em A Scale function that returns the current slider position .iX "XmScaleGetValue" .iX "Scale functions" "XmScaleGetValue" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmScaleGetValue\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fB* value_return\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmScaleGetValue\fP returns the current slider position value displayed in the scale\&. .IP "\fIwidget\fP" 10 Specifies the Scale widget ID .IP "\fIvalue_return\fP" 10 Returns the current slider position value .PP For a complete definition of Scale and its associated resources, see \fBXmScale\fP(3)\&. .SH "RELATED" .PP \fBXmScale\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmDataFieldSetEditable.30000644000175000017500000000313012672140200016244 00000000000000'\" t ...\" TxtFieBA.sgm /main/7 1996/08/30 16:26:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldSetEditable" "library call" .SH "NAME" \fBXmDataFieldSetEditable\fP \(em A DataField function that sets the edit permission .iX "XmDataFieldSetEditable" .iX "DataField functions" "XmDataFieldSetEditable" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDataFieldSetEditable\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBeditable\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldSetEditable\fP sets the edit permission state of the DataField widget\&. When set to True, the text string can be edited\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIeditable\fP" 10 Specifies a Boolean value that when True allows text string edits .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. motif-2.3.8/doc/man/man3/XmRepTypeGetNameList.30000644000175000017500000000416212672140200016014 00000000000000'\" t ...\" RepTypGB.sgm /main/8 1996/09/08 20:58:26 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeGetNameList" "library call" .SH "NAME" \fBXmRepTypeGetNameList\fP \(em A representation type manager function that generates a list of values for a representation type .iX "XmRepTypeGetNameList" .iX "representation type manager functions" "XmRepTypeGetNameList" .SH "SYNOPSIS" .PP .nf #include \fBString * \fBXmRepTypeGetNameList\fP\fR( \fBXmRepTypeId \fBrep_type_id\fR\fR, \fBBoolean \fBuse_uppercase_format\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRepTypeGetNameList\fP generates a NULL-terminated list of the value names associated with the specified representation type\&. Each value name is a NULL-terminated string\&. This routine allocates memory for the returned data\&. The application must free this memory using \fBXtFree\fP\&. .IP "\fIrep_type_id\fP" 10 Specifies the identification number of the representation type\&. .IP "\fIuse_uppercase_format\fP" 10 Specifies a Boolean value that controls the format of the name list\&. If the value is True, each value name is in uppercase characters prefixed by \fBXm\fP; if it is False, the names are in lowercase characters\&. .SH "RETURN" .PP Returns a pointer to an array of the value names\&. .SH "RELATED" .PP \fBXmRepTypeGetId\fP(3), \fBXmRepTypeGetRegistered\fP(3), and \fBXmRepTypeRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmVaCreateManagedBulletinBoard.30000644000175000017500000000004312672140200017737 00000000000000.so man3/XmVaCreateBulletinBoard.3 motif-2.3.8/doc/man/man3/XmMainWindowSep1.30000644000175000017500000000371612672140200015140 00000000000000'\" t ...\" MainWinB.sgm /main/8 1996/09/08 20:53:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMainWindowSep1" "library call" .SH "NAME" \fBXmMainWindowSep1\fP \(em A MainWindow function that returns the widget ID of the first Separator .iX "XmMainWindowSep1" .iX "MainWindow functions" "XmMainWindowSep1" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmMainWindowSep1\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMainWindowSep1\fP returns the widget ID of the first Separator in the MainWindow\&. The first Separator is located between the MenuBar and the Command widget\&. This Separator is visible only when \fBXmNshowSeparator\fP is True\&. .PP \fBNOTE:\fP \fBXmMainWindowSep1\fP is obsolete and exists for compatibility with previous releases\&. Use \fBXtNameToWidget\fP instead\&. Pass a MainWindow variable as the first argument to \fBXtNameToWidget\fP and pass \fBSeparator1\fP as the second argument\&. .IP "\fIwidget\fP" 10 Specifies the MainWindow widget ID .PP For a complete definition of MainWindow and its associated resources, see \fBXmMainWindow\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the first Separator\&. .SH "RELATED" .PP \fBXmMainWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmAddWMProtocols.30000644000175000017500000000370212672140200015167 00000000000000'\" t ...\" AddWMPrB.sgm /main/9 1996/09/25 10:14:47 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmAddWMProtocols" "library call" .SH "NAME" \fBXmAddWMProtocols\fP \(em A VendorShell convenience interface that adds the protocols to the protocol manager and allocates the internal tables .iX "XmAddWMProtocol\\%s" .iX "VendorShell functions" "XmAddWMProtocol\\%s" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmAddWMProtocols\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom *\fBprotocols\fR\fR, \fBCardinal \fBnum_protocols\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmAddWMProtocols\fP is a convenience interface\&. It calls \fBXmAddProtocols\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIprotocols\fP" 10 Specifies the protocol \fBAtoms\fP .IP "\fInum_protocols\fP" 10 Specifies the number of elements in \fIprotocols\fP .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddProtocols\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveWMProtocols\fP\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmLabelGadget.30000644000175000017500000007615012672140200014470 00000000000000'\" t ...\" LabelGad.sgm /main/9 1996/09/08 20:49:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmLabelGadget" "library call" .SH "NAME" \fBXmLabelGadget\fP \(em The LabelGadget widget class .iX "XmLabelGadget" .iX "widget class" "LabelGadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP LabelGadget is an instantiable widget and is also used as a superclass for other button gadgets, such as PushButtonGadget and ToggleButtonGadget\&. .PP LabelGadget can contain either text or a pixmap\&. LabelGadget text is a compound string\&. Refer to the \fIMotif Programmer\&'s\fP Guide for more information on compound strings\&. The text can be multilingual, multiline, and/or multifont\&. When a LabelGadget is insensitive, its text is stippled, or the user-supplied insensitive pixmap is displayed\&. .PP LabelGadget supports both accelerators and mnemonics primarily for use in LabelGadget subclass widgets that are contained in menus\&. Mnemonics are available in a menu system when the button is visible\&. Accelerators in a menu system are accessible even when the button is not visible\&. The LabelGadget displays the mnemonic by underlining the first matching character in the text string\&. The accelerator is displayed as a text string adjacent to the label text or pixmap, depending on the layout direction\&. .PP LabelGadget consists of many margin fields surrounding the text or pixmap\&. These margin fields are resources that may be set by the user, but LabelGadget subclasses and Manager parents also modify some of these fields\&. They tend to modify the \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and \fBXmNmarginBottom\fP resources and leave the \fBXmNmarginWidth\fP and \fBXmNmarginHeight\fP resources as set by the application\&. .PP LabelGadget takes into account \fBXmNshadowThickness\fP in determining its layout but does not draw the shadow\&. That is, if \fBXmNshadowThickness\fP is greater than 0 (zero), LabelGadget leaves space for the shadow, but the shadow does not appear\&. .PP In a LabelGadget, \fBXmNtraversalOn\fP and \fBXmNhighlightOnEnter\fP are forced to False inside Popup menu panes, Pulldown menu panes, and OptionMenus\&. Otherwise these resources default to False\&. .PP LabelGadget uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits, and holds the \fBXmQTaccessTextual\fP, \fBXmQTcareParentVisual\fP, \fBXmQTmenuSavvy\fP, and \fBXmQTtransfer\fP traits\&. .SS "Data Transfer Behavior" .PP LabelGadget and it subclasses, except when used in a menu system, support dragging of the label contents from the LabelGadget\&. However, the label contents are draggable only if the \fBXmNenableUnselectableDrag\fP resource of \fBXmDisplay\fP is set to True\&. .PP As a source of data, LabelGadget and its subclasses support the following targets and associated conversions of data to these targets: .IP "\fIlocale\fP" 10 If the \fIlocale\fP target matches the widget\&'s locale, the widget transfers \fBXmNlabelString\fP in the encoding of the locale\&. This target is supported only when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBCOMPOUND_TEXT\fP" 10 The widget transfers \fBXmNlabelString\fP as type \fBCOMPOUND_TEXT\fP\&. This target is supported only when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\&. .IP "\fBUTF8_STRING\fP" 10 The widget transfers \fBXmNlabelString\fP as type \fBUTF8_STRING\fP\&. This target is supported only when \fBXmNlabelType\fP is \fBXmSTRING\fP of \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBPIXMAP\fP" 10 The widget transfers \fBXmNlabelPixmap\fP as type \fBDRAWABLE\fP\&. This target is supported when \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBSTRING\fP" 10 The widget transfers \fBXmNlabelString\fP as type \fBSTRING\fP\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fBTEXT\fP" 10 If \fBXmNlabelString\fP is fully convertible to the encoding of the locale, the widget transfers \fBXmNlabelString\fP in the encoding of the locale\&. Otherwise, the widget transfers \fBXmNlabelString\fP as type \fBCOMPOUND_TEXT\fP\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fB_MOTIF_CLIPBOARD_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports for the \fBCLIPBOARD\fP selection\&. When \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP, these include the following targets: .RS .IP " \(bu" 6 \fB_MOTIF_COMPOUND_STRING\fP .IP " \(bu" 6 \fBCOMPOUND_TEXT\fP .IP " \(bu" 6 \fBUTF8_STRING\fP .IP " \(bu" 6 The encoding of the locale, if \fBXmNlabelString\fP is fully convertible to the encoding of the locale .IP " \(bu" 6 \fBSTRING\fP, if \fBXmNlabelString\fP is fully convertible to \fBSTRING\fP .RE .IP "" 10 When \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, the targets include \fBPIXMAP\fP\&. .IP "\fB_MOTIF_COMPOUND_STRING\fP" 10 The widget transfers \fBXmNlabelString\fP as a compound string in Byte Stream format\&. This target is supported when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. .IP "\fB_MOTIF_EXPORT_TARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets to be used as the value of the DragContext\&'s \fBXmNexportTargets\fP in a drag-and-drop transfer\&. When \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP, these include \fB_MOTIF_COMPOUND_STRING\fP, \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP, the encoding of the locale, \fBSTRING\fP, \fBTEXT\fP, \fBBACKGROUND\fP, and \fBFOREGROUND\fP\&. When \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, these include \fBPIXMAP\fP, \fBBACKGROUND\fP, and \fBFOREGROUND\fP\&. .PP As a source of data, LabelGadget also supports the following standard Motif targets: .IP "\fBBACKGROUND\fP" 10 The widget transfers the parent\&'s \fBXmNbackground\fP as type \fBPIXEL\fP\&. .IP "\fBCLASS\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_CLASS\fP property and transfers the contents as text in the current locale\&. .IP "\fBCLIENT_WINDOW\fP" 10 The widget finds the first shell in the widget hierarchy and transfers its window as type \fBWINDOW\fP\&. .IP "\fBCOLORMAP\fP" 10 The widget transfers the parent\&'s \fBXmNcolormap\fP as type \fBCOLORMAP\fP\&. .IP "\fBFOREGROUND\fP" 10 The widget transfers the parent\&'s \fBXmNforeground\fP as type \fBPIXEL\fP\&. .IP "\fBNAME\fP" 10 The widget finds the first shell in the widget hierarchy that has a \fBWM_NAME\fP property and transfers the contents as text in the current locale\&. .IP "\fBTARGETS\fP" 10 The widget transfers, as type \fBATOM\fP, a list of the targets it supports\&. These include the standard targets in this list\&. When \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP, these also include \fB_MOTIF_COMPOUND_STRING\fP, \fBCOMPOUND_TEXT\fP, \fBUTF8_STRING\fP, the encoding of the locale, \fBSTRING\fP, and \fBTEXT\fP\&. When \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP, these also include \fBPIXMAP\fP\&. .IP "\fBTIMESTAMP\fP" 10 The widget transfers the timestamp used to acquire the selection as type \fBINTEGER\fP\&. .IP "\fB_MOTIF_RENDER_TABLE\fP" 10 The widget transfers \fBXmNrenderTable\fP if it exists, or else the default text render table, as type \fBSTRING\fP\&. .IP "\fB_MOTIF_ENCODING_REGISTRY\fP" 10 The widget transfers its encoding registry as type \fBSTRING\fP\&. The value is a list of NULL separated items in the form of tag encoding pairs\&. This target symbolizes the transfer target for the Motif Segment Encoding Registry\&. Widgets and applications can use this Registry to register text encoding formats for specified render table tags\&. Applications access this Registry by calling \fBXmRegisterSegmentEncoding\fP and \fBXmMapSegmentEncoding\fP\&. .SS "Classes" .PP LabelGadget inherits behavior, resources, and traits from \fBObject\fP, \fBRectObj\fP and \fBXmGadget\fP\&. .PP The class pointer is \fBxmLabelGadgetClass\fP\&. .PP The class name is \fBXmLabelGadget\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabelGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLCSG _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLCSG _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmStringdynamicCSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimension0CSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimension0CSG _____ XmNmarginRightXmCMarginRightDimension0CSG _____ XmNmarginTopXmCMarginTopDimension0CSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringdynamicCSG _____ XmNpixmapPlacementXmCPixmapPlacementunsigned intXmPIXMAP_LEFTCSG _____ XmNpixmapTextPaddingXmCSpaceDimension2CSG _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .IP "\fBXmNaccelerator\fP" 10 Sets the accelerator on a button widget in a menu, which activates a visible or invisible, but managed, button from the keyboard\&. This resource is a string that describes a set of modifiers and the key that may be used to select the button\&. The format of this string is identical to that used by the translations manager, with the exception that only a single event may be specified and only \fBKeyPress\fP events are allowed\&. .IP "" 10 Accelerators for buttons are supported only for PushButtonGadgets and ToggleButtonGadgets in Pulldown and Popup menus\&. .IP "\fBXmNacceleratorText\fP" 10 Specifies the text displayed for the accelerator\&. The text is displayed adjacent to the label string or pixmap\&. The direction of its layout depends on the \fBXmNlayoutDirection\fP resource of the widget\&. Accelerator text for buttons is displayed only for PushButtonGadgets and ToggleButtonGadgets in Pulldown and Popup Menus\&. .IP "\fBXmNalignment\fP" 10 Specifies the label alignment for text or pixmap\&. .RS .IP "\fBXmALIGNMENT_BEGINNING\fP (left alignment)" 10 Causes the left sides of the lines of text to be vertically aligned with the left edge of the gadget\&. For a pixmap, its left side is vertically aligned with the left edge of the gadget\&. .IP "\fBXmALIGNMENT_CENTER\fP (center alignment)" 10 Causes the centers of the lines of text to be vertically aligned in the center of the gadget\&. For a pixmap, its center is vertically aligned with the center of the gadget\&. .IP "\fBXmALIGNMENT_END\fP (right alignment)" 10 Causes the right sides of the lines of text to be vertically aligned with the right edge of the gadget\&. For a pixmap, its right side is vertically aligned with the right edge of the gadget\&. .RE .IP "" 10 The preceding descriptions for text are correct when \fBXmNlayoutDirection\fP is \fBXmLEFT_TO_RIGHT\fP\&. When that resource is \fBXmRIGHT_TO_LEFT\fP, the descriptions for \fBXmALIGNMENT_BEGINNING\fP and \fBXmALIGNMENT_END\fP are switched\&. .IP "" 10 If the parent is a RowColumn whose \fBXmNisAligned\fP resource is True, \fBXmNalignment\fP is forced to the same value as the RowColumn\&'s \fBXmNentryAlignment\fP if the RowColumn\&'s \fBXmNrowColumnType\fP is \fBXmWORK_AREA\fP or if the gadget is a subclass of \fBXmLabelGadget\fP\&. Otherwise, the default is \fBXmALIGNMENT_CENTER\fP\&. .IP "\fBXmNfontList\fP" 10 Specifies the font of the text used in the gadget\&. \fBXmNfontList\fP is obsolete and exists for compatibility with previous releases\&. You should now use \fBXmNrenderTable\fP instead of \fBXmNfontList\fP\&. If both are specified, the render table will take precedence\&. If \fBXmNfontList\fP is NULL at initialization, the parent hierarchy of the widget is searched for an ancestor that is a subclass of the \fBXmBulletinBoard\fP, \fBVendorShell\fP, or \fBXmMenuShell\fP widget class\&. If such an ancestor is found, the font list is initialized to the \fBXmNbuttonFontList\fP (for button gadget subclasses) or \fBXmNlabelFontList\fP of the ancestor widget\&. If no such ancestor is found, the default is implementation dependent\&. Refer to \fBXmFontList\fP(3) for more information on the creation and structure of a font list\&. .IP "\fBXmNlabelInsensitivePixmap\fP" 10 Specifies a pixmap used as the button face if \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP and the button is insensitive\&. The default value, \fBXmUNSPECIFIED_PIXMAP\fP, displays an empty label\&. .IP "\fBXmNlabelPixmap\fP" 10 Specifies the pixmap when \fBXmNlabelType\fP is \fBXmPIXMAP\fP or \fBXmPIXMAP_AND_STRING\fP\&. The default value, \fBXmUNSPECIFIED_PIXMAP\fP, displays an empty label\&. .IP "\fBXmNlabelString\fP" 10 Specifies the compound string when \fBXmNlabelType\fP is \fBXmSTRING\fP or \fBXmPIXMAP_AND_STRING\fP\&. If the value of this resource is NULL, it is initialized to name of the gadget converted to a compound string\&. Refer to \fBXmString\fP(3) for more information on the creation and the structure of compound strings\&. .IP "\fBXmNlabelType\fP" 10 Specifies the label type\&. .RS .IP "\fBXmSTRING\fP" 10 Text displays \fBXmNlabelString\fP .IP "\fBXmPIXMAP\fP" 10 Icon data in pixmap displays \fBXmNlabelPixmap\fP or \fBXmNlabelInsensitivePixmap\fP \fBXmPIXMAP_AND_STRING\fP Icon data in pixmap displays \fBXmNlabelPixmap\fP or \fBXmNlabelInsensitivePixmap\fP and text displays \fBXmNlabelString\fP .RE .IP "\fBXmNmarginBottom\fP" 10 Specifies the amount of spacing between the bottom of the label text and the top of the bottom margin specified by \fBXmNmarginHeight\fP\&. This may be modified by LabelGadget\&'s subclasses\&. For example, CascadeButtonGadget may increase this field to make room for the cascade pixmap\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies an equal amount of spacing above the margin defined by \fBXmNmarginTop\fP and below the margin defined by \fBXmNmarginBottom\fP\&. \fBXmNmarginHeight\fP specifies the amount of spacing between the top edge of the margin set by \fBXmNmarginTop\fP and the bottom edge of the top shadow, and the amount of spacing between the bottom edge of the margin specified by \fBXmNmarginBottom\fP and the top edge of the bottom shadow\&. .IP "\fBXmNmarginLeft\fP" 10 Specifies the amount of spacing between the left edge of the label text and the right side of the left margin (specified by \fBXmNmarginWidth\fP)\&. This may be modified by LabelGadget\&'s subclasses\&. For example, ToggleButtonGadget may increase this field to make room for the toggle indicator and for spacing between the indicator and label\&. Whether this actually applies to the left or right side of the label depends on the value of \fBXmNlayoutDirection\fP\&. .IP "\fBXmNmarginRight\fP" 10 Specifies the amount of spacing between the right edge of the label text and the left side of the right margin (specified by \fBXmNmarginWidth\fP)\&. This may be modified by LabelGadget\&'s subclasses\&. For example, CascadeButtonGadget may increase this field to make room for the cascade pixmap\&. Whether this actually applies to the left or right side of the label depends on the value of \fBXmNlayoutDirection\fP\&. .IP "\fBXmNmarginTop\fP" 10 Specifies the amount of spacing between the top of the label text and the bottom of the top margin specified by \fBXmNmarginHeight\fP\&. This may be modified by LabelGadget\&'s subclasses\&. For example, CascadeButtonGadget may increase this field to make room for the cascade pixmap\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies an equal amount of spacing to the left of the margin defined by \fBXmNmarginLeft\fP and to the right of the margin defined by \fBXmNmarginRight\fP\&. \fBXmNmarginWidth\fP specifies the amount of spacing between the left edge of the margin set by \fBXmNmarginLeft\fP and the right edge of the left shadow, and the amount of spacing between the right edge of the margin specified by \fBXmNmarginRight\fP and the left edge of the right shadow\&. .IP "\fBXmNmnemonic\fP" 10 Provides the user with an alternate means of activating a button\&. A button in a MenuBar, a Popup menu pane, or a Pulldown menu pane can have a mnemonic\&. .IP "" 10 This resource contains a keysym as listed in the X11 keysym table\&. The first character in the label string that exactly matches the mnemonic in the character set specified in \fBXmNmnemonicCharSet\fP is underlined when the button is displayed\&. .IP "" 10 When a mnemonic has been specified, the user activates the button by pressing the mnemonic key while the button is visible\&. If the button is a CascadeButtonGadget in a MenuBar and the MenuBar does not have the focus, the user must use the \fBMAlt\fP modifier while pressing the mnemonic\&. The user can activate the button by pressing either the shifted or the unshifted mnemonic key\&. .IP "\fBXmNmnemonicCharSet\fP" 10 Specifies the character set of the mnemonic for the label\&. The default is \fBXmFONTLIST_DEFAULT_TAG\fP\&. .IP "\fBXmNpixmapPlacement\fP" 10 The location of the pixmap with respect to the text label. This resource can take one of the following values: \fBXmPIXMAP_TOP\fP, \fBXmPIXMAP_BOTTOM\fP, \fBXmPIXMAP_LEFT\fP, and \fBXmPIXMAP_RIGHT\fP. A type converter has been registered that converts the following strings: "top", "bottom", "left", and "right". .IP "\fBXmNpixmapTextPadding\fP" 10 The amount of space to be left between the pixmap and the label string. .IP "\fBXmNrecomputeSize\fP" 10 Specifies a Boolean value that indicates whether the gadget shrinks or expands to accommodate its contents (label string or pixmap) as a result of an \fBXtSetValues\fP resource value that would change the size of the gadget\&. If True, the gadget shrinks or expands to exactly fit the label string or pixmap\&. If False, the gadget never attempts to change size on its own\&. .IP "\fBXmNrenderTable\fP" 10 Specifies the render table associated with the \fBlabelString\fP\&. If this value is NULL at initialization, Label searches its parent hierarchy for an ancestor that holds the \fBXmQTspecifyRenderTable\fP trait\&. If such an ancestor is found, Label initializes \fBXmNrenderTable\fP to the \fBXmLABEL_RENDER_TABLE\fP value of the ancestor widget\&. Similarly, button subclasses of Label initialize \fBXmNrenderTable\fP to the \fBXmBUTTON_RENDER_TABLE\fP value of the ancestor widget\&. (Note that all current subclasses of Label are button subclasses\&.) If no such ancestor is found, the default is implementation dependent\&. If a font list and a render table are both specified, the render table will take precedence\&. Refer to \fBXmRenderTable\fP(3) for more information on the creation and structure of a render table\&. .IP "\fBXmNstringDirection\fP" 10 Is a synthetic resource for setting \fBXmNlayoutDirection\fP\&. The values for this resource are \fBXmSTRING_DIRECTION_L_TO_R\fP and \fBXmSTRING_DIRECTION_R_TO_L\fP\&. Refer to the \fBXmNlayoutDirection\fP resource description\&. The \fBXmNstringDirection\fP resource is obsoleted by \fBXmNlayoutDirection\fP, but is kept here for backward compatibility\&. .SS "Inherited Resources" .PP LabelGadget inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension0CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanFalseCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Behavior" .PP XmLabelGadget includes behavior from XmGadget\&. Additional XmLabelGadget behavior is described in the following list: .IP "\fB\fP:" 10 Drags the contents of a LabelGadget, identified when \fBBTransfer\fP is pressed\&. This action is undefined for LabelGadgets used in a menu system\&. .IP "\fB\fP\fB\fP:" 10 In a Popup or Pulldown MenuPane, unposts all menus in the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu system was entered\&. Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "\fB\fP\fB\fP:" 10 In a MenuBar, disarms the CascadeButton and the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the menu was entered\&. .IP "" 10 In a toplevel Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, unposts the menu\&. .IP "" 10 In a Popup MenuPane, unposts the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget from which the menu was posted\&. .IP "\fB\fP\fB\fP:" 10 If the current menu item has a submenu and is in a MenuBar, then this action posts the submenu, disarms the current menu item, and arms the submenu\&'s first traversable menu item\&. .IP "" 10 If the current menu item is in a MenuPane, then this action disarms the current menu item and arms the item below it\&. This action wraps within the MenuPane\&. The direction of the wrapping depends on the \fBXmNlayoutDirection\fP resource\&. .IP "\fB\fP\fB\fP:" 10 When the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left\&. If the current menu item is at the left edge of a submenu attached to a MenuBar item, then this action unposts the submenu and traverses to the MenuBar item to the left, wrapping if necessary\&. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu\&. If the current menu item is at the left edge of a submenu not directly attached to a MenuBar item, then this action unposts the current submenu only\&. .IP "" 10 In Popup or Torn-off MenuPanes, when the current menu item is at the left edge, this action wraps within the MenuPane\&. If the current menu item is at the left edge of the MenuPane and not in the top row, this action wraps to the rightmost menu item in the row above\&. If the current menu item is in the upper, leftmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, rightmost menu item in the MenuPane\&. The preceding description applies when the \fBXmNlayoutDirection\fP horizontal direction is \fBXmLEFT_TO_RIGHT\fP\&. If the \fBXmNlayoutDirection\fP horizontal direction is \fBXmRIGHT_TO_LEFT\fP, then the following applies\&. .IP "" 10 If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu\&. If the current menu item is not a CascadeButton and is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left, wrapping if necessary\&. If the current menu item is not a CascadeButton and is at the left edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the left\&. If that MenuBar item has a submenu, it posts the submenu and arms the submenu\&'s first traversable item\&. .IP "" 10 In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the left edge of a row (except the bottom row), this action wraps to the rightmost menu item in the row below\&. If the current menu item is not a CascadeButton and is in the bottom, leftmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, rightmost menu item of the MenuPane\&. .IP "\fB\fP\fB\fP:" 10 If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the right\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu\&. If the current menu item is not a CascadeButton and is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right, wrapping if necessary\&. If the current menu item is not a CascadeButton and is at the right edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the right\&. If that MenuBar item has a submenu, it posts the submenu and arms the submenu\&'s first traversable item\&. .IP "" 10 In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the right edge of a row (except the bottom row), this action wraps to the leftmost menu item in the row below\&. If the current menu item is not a CascadeButton and is in the bottom, rightmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, leftmost menu item of the MenuPane\&. The preceding description applies when the \fBXmNlayoutDirection\fP horizontal direction is \fBXmLEFT_TO_RIGHT\fP\&. If the \fBXmNlayoutDirection\fP horizontal direction is \fBXmRIGHT_TO_LEFT\fP, then the following applies\&. .IP "" 10 When the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the right\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right\&. If the current menu item is at the right edge of a submenu attached to a MenuBar item, then this action unposts the submenu and traverses to the MenuBar item to the right, wrapping if necessary\&. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu\&. If the current menu item is at the right edge of a submenu not directly attached to a MenuBar item, then this action unposts the current submenu only\&. .IP "" 10 In Popup or Torn-off MenuPanes, when the current menu item is at the right edge, this action wraps within the MenuPane\&. If the current menu item is at the right edge of the MenuPane and not in the top row, this action wraps to the leftmost menu item in the row above\&. If the current menu item is in the upper, rightmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, leftmost menu item in the MenuPane\&. .IP "\fB\fP\fB\fP:" 10 When the current menu item is in a MenuPane, then this action disarms the current menu item and arms the item above it\&. This action wraps within the MenuPane\&. The direction of the wrapping depends on the \fBXmNlayoutDirection\fP resource\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBObject\fP(3), \fBRectObj\fP(3), \fBXmCreateLabelGadget\fP(3), \fBXmVaCreateLabelGadget\fP(3), \fBXmVaCreateManagedLabelGadget\fP(3), \fBXmFontListCreate\fP(3), \fBXmStringCreate\fP(3), \fBXmStringCreateLtoR\fP(3), and \fBXmGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmCreateBulletinBoardDialog.30000644000175000017500000000500112672140200017312 00000000000000'\" t ...\" CreBuB.sgm /main/8 1996/09/08 20:32:05 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateBulletinBoardDialog" "library call" .SH "NAME" \fBXmCreateBulletinBoardDialog\fP \(em The BulletinBoard BulletinBoardDialog convenience creation function .iX "XmCreateBulletinBoard\\%Dialog" .iX "creation functions" "XmCreateBulletinBoard\\%Dialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateBulletinBoardDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateBulletinBoardDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged BulletinBoard child of the DialogShell\&. A BulletinBoardDialog is used for interactions not supported by the standard dialog set\&. This function does not automatically create any labels, buttons, or other dialog components\&. Such components should be added by the application after the BulletinBoardDialog is created\&. .PP Use \fBXtManageChild\fP to pop up the BulletinBoardDialog (passing the BulletinBoard as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateBulletinBoardDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of BulletinBoard and its associated resources, see \fBXmBulletinBoard\fP(3)\&. .SH "RETURN" .PP Returns the BulletinBoard widget ID\&. .SH "RELATED" .PP \fBXmBulletinBoard\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmVaCreateLabelGadget.30000644000175000017500000000272412672140200016077 00000000000000.DT .TH "XmVaCreateLabelGadget" "library call" .SH "NAME" \fBXmVaCreateLabelGadget\fP, \fBXmVaCreateManagedLabelGadget\fP \(em A LabelGadget widget convenience creation functions\&. .iX "XmVaCreateLabelGadget" "XmVaCreateManagedLabelGadget" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateLabelGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedLabelGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a LabelGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateLabelGadget\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedLabelGadget\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of LabelGadget and its associated resources, see \fBXmLabelGadget\fP(3)\&. .SH "RETURN" .PP Returns the LabelGadget widget ID\&. .SH "RELATED" .PP \fBXmLabelGadget\fP(3), \fBXmCreateLabelGadget\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedIconGadget.30000644000175000017500000000004012672140200017212 00000000000000.so man3/XmVaCreateIconGadget.3 motif-2.3.8/doc/man/man3/XmVaCreateManagedRowColumn.30000644000175000017500000000003712672140200017141 00000000000000.so man3/XmVaCreateRowColumn.3 motif-2.3.8/doc/man/man3/XmParseTable.30000644000175000017500000000372612672140200014356 00000000000000'\" t ...\" ParTabA.sgm /main/7 1996/08/30 15:53:05 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmParseTable" "library call" .SH "NAME" \fBXmParseTable\fR \(em Data type for a compound string parse table .iX "XmParseTable" .iX "data types" "XmParseTable" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmParseTable\fR is the data type for an array of parse mappings (objects of type \fBXmParseMapping\fR)\&. .PP A parse table is used by some routines that parse and unparse compound strings\&. The table is an ordered list of parse mappings\&. A parsing routine that uses a parse table scans the input text and searches the parse mappings, in order, for one containing a pattern that matches the input text\&. The matching parse mapping supplies a compound string to be included in the compound string under construction\&. .PP An unparsing routine that uses a parse table searches the parse mappings, in order, for one containing a compound string that matches the input compound string\&. The unparsing routine can then include the parse mapping\&'s text pattern in the output text under construction\&. .SH "RELATED" .PP \fBXmParseMapping\fP(3), \fBXmParseTableFree\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmFontListEntryCreate.30000644000175000017500000000524712672140200016244 00000000000000'\" t ...\" FontLstK.sgm /main/9 1996/09/08 20:43:49 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListEntryCreate" "library call" .SH "NAME" \fBXmFontListEntryCreate\fP \(em A font list function that creates a font list entry .iX "XmFontListEntryCreate" .iX "font list functions" "XmFontListEntryCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmFontListEntry \fBXmFontListEntryCreate\fP\fR( \fBchar *\fBtag\fR\fR, \fBXmFontType \fBtype\fR\fR, \fBXtPointer \fBfont\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListEntryCreate\fP creates a font list entry that contains either a font or font set and is identified by a tag\&. .IP "\fItag\fP" 10 Specifies a NULL terminated string for the tag of the font list entry\&. The tag may be specified as \fBXmFONTLIST_DEFAULT_TAG\fP, which is used to identify the default font list element in a font list\&. .IP "\fItype\fP" 10 Specifies whether the \fIfont\fP argument is a font structure or a font set\&. Valid values are \fBXmFONT_IS_FONT\fP and \fBXmFONT_IS_FONTSET\fP\&. .IP "\fIfont\fP" 10 Specifies either an \fBXFontSet\fP returned by \fBXCreateFontSet\fP or a pointer to an \fBXFontStruct\fP returned by \fBXLoadQueryFont\fP\&. .PP The toolkit does not copy the X Font structure specified by the \fIfont\fP argument\&. Therefore, an application programmer must not free \fBXFontStruct\fP or \fBXFontSet\fP until all font lists and/or font entries that reference it have been freed\&. .SH "RETURN" .PP Returns a font list entry\&. The function allocates space to hold the returned font list entry\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmFontListEntryFree\fP\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListAppendEntry\fP(3), \fBXmFontListEntryFree\fP(3), \fBXmFontListEntryGetFont\fP(3), \fBXmFontListEntryGetTag\fP(3), \fBXmFontListEntryLoad\fP(3), and \fBXmFontListRemoveEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmListReplacePositions.30000644000175000017500000000466612672140200016457 00000000000000'\" t ...\" LstReplE.sgm /main/8 1996/09/08 20:51:50 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListReplacePositions" "library call" .SH "NAME" \fBXmListReplacePositions\fP \(em A List function that replaces items in a list based on position .iX "XmListReplacePositions" .iX "List functions" "XmListReplacePositions" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListReplacePositions\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint *\fBposition_list\fR\fR, \fBXmString *\fBitem_list\fR\fR, \fBint \fBitem_count;\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListReplacePositions\fP replaces noncontiguous items in a list\&. The item at each position specified in \fIposition_list\fP is replaced with the corresponding entry in \fIitem_list\fP\&. When the items are inserted into the list, they are compared with the current \fBXmNselectedItems\fP list\&. Any of the new items that match items on the selected list appear selected\&. A warning message is displayed if a specified position is invalid; that is, the value is 0 (zero), a negative integer, or a number greater than the number of items in the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIposition_list\fP" 10 Specifies an array of the positions of items to be replaced\&. The position of the first item in the list is 1; the position of the second item is 2; and so on\&. .IP "\fIitem_list\fP" 10 Specifies an array of the replacement items\&. .IP "\fIitem_count\fP" 10 Specifies the number of elements in \fIposition_list\fP and \fIitem_list\fP\&. This number must be nonnegative\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmStringLineCount.30000644000175000017500000000323112672140200015412 00000000000000'\" t ...\" StrLin.sgm /main/8 1996/09/08 21:06:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringLineCount" "library call" .SH "NAME" \fBXmStringLineCount\fP \(em A compound string function that returns the number of separators plus one in the provided compound string .iX "XmStringLineCount" .iX "compound string functions" "XmStringLineCount" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmStringLineCount\fP\fR( \fBXmString \fBstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringLineCount\fP returns the number of separators plus one in the provided compound string\&. In effect, it counts the lines of text\&. .IP "\fIstring\fP" 10 Specifies the string .SH "RETURN" .PP Returns the number of lines in the compound string\&. If \fIstring\fP is empty, the function returns 1\&. If NULL is passed into \fIstring\fP, the function returns 0 (zero)\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmCreateToggleButtonGadget.30000644000175000017500000000364412672140200017210 00000000000000'\" t ...\" CreToB.sgm /main/8 1996/08/30 14:58:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateToggleButtonGadget" "library call" .SH "NAME" \fBXmCreateToggleButtonGadget\fP \(em The ToggleButtonGadget creation function .iX "XmCreateToggleButton\\%Gadget" .iX "creation functions" "XmCreateToggleButton\\%Gadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateToggleButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateToggleButtonGadget\fP creates an instance of a ToggleButtonGadget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ToggleButtonGadget and its associated resources, see \fBXmToggleButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the ToggleButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmToggleButtonGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/RectObj.30000644000175000017500000001126012672140200013347 00000000000000'\" t ...\" RectObj.sgm /main/10 1996/09/08 21:42:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "RectObj" "library call" .SH "NAME" \fBRectObj\fP \(em The RectObj widget class .iX "RectObj" .iX "widget class" "RectObj" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP RectObj is never instantiated\&. Its sole purpose is as a supporting superclass for other widget classes\&. .SS "Classes" .PP RectObj inherits behavior and a resource from \fBObject\fP\&. .PP The class pointer is \fBrectObjClass\fP\&. .PP The class name is \fBRectObj\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension1CSG _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .IP "\fBXmNancestorSensitive\fP" 10 Specifies whether the immediate parent of the gadget receives input events\&. Use the function \fBXtSetSensitive\fP if you are changing the argument to preserve data integrity (see \fBXmNsensitive\fP)\&. The default is the bitwise AND of the parent\&'s \fBXmNsensitive\fP and \fBXmNancestorSensitive\fP resources\&. .IP "\fBXmNborderWidth\fP" 10 Specifies the width of the border placed around the RectObj\&'s rectangular display area\&. .IP "\fBXmNheight\fP" 10 Specifies the inside height (excluding the border) of the RectObj\&'s rectangular display area\&. .IP "\fBXmNsensitive\fP" 10 Determines whether a RectObj receives input events\&. If a RectObj is sensitive, the parent dispatches to the gadget all keyboard, mouse button, motion, window enter/leave, and focus events\&. Insensitive gadgets do not receive these events\&. Use the function \fBXtSetSensitive\fP to change the sensitivity argument\&. Using \fBXtSetSensitive\fP ensures that if a parent widget has \fBXmNsensitive\fP set to False, the ancestor-sensitive flag of all its children is appropriately set\&. .IP "\fBXmNwidth\fP" 10 Specifies the inside width (excluding the border) of the RectObj\&'s rectangular display area\&. .IP "\fBXmNx\fP" 10 Specifies the x-coordinate of the upper left outside corner of the RectObj\&'s rectangular display area\&. The value is relative to the upper left inside corner of the parent window\&. .IP "\fBXmNy\fP" 10 Specifies the y-coordinate of the upper left outside corner of the RectObj\&'s rectangular display area\&. The value is relative to the upper left inside corner of the parent window\&. .SS "Inherited Resources" .PP RectObj inherits behavior and a resource from \fBObject\fP\&. For a description of this resource, refer to the \fBObject\fP reference page\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Translations" .PP There are no translations for RectObj\&. .SH "RELATED" .PP \fBObject\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/Object.30000644000175000017500000000462412672140200013233 00000000000000'\" t ...\" Object.sgm /main/8 1996/09/08 21:42:03 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "Object" "library call" .SH "NAME" \fBObject\fP \(em The Object widget class .iX "Object" .iX "widget class" "Object" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Object is never instantiated\&. Its sole purpose is as a supporting superclass for other widget classes\&. .SS "Classes" .PP The class pointer is \fBobjectClass\fP\&. .PP The class name is \fBObject\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .IP "\fBXmNdestroyCallback\fP" 10 Specifies a list of callbacks that is called when the gadget is destroyed\&. .SS "Translations" .PP There are no translation for Object\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmCreateArrowButtonGadget.30000644000175000017500000000363712672140200017063 00000000000000'\" t ...\" CreArB.sgm /main/7 1996/08/30 14:27:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateArrowButtonGadget" "library call" .SH "NAME" \fBXmCreateArrowButtonGadget\fP \(em The ArrowButtonGadget creation function .iX "XmCreateArrowButton\\%Gadget" .iX "creation functions" "XmCreateArrowButton\\%Gadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateArrowButtonGadget\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateArrowButtonGadget\fP creates an instance of an ArrowButtonGadget widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ArrowButtonGadget and its associated resources, see \fBXmArrowButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns the ArrowButtonGadget widget ID\&. .SH "RELATED" .PP \fBXmArrowButtonGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmImSetValues.30000644000175000017500000001114012672140200014522 00000000000000'\" t ...\" ImSetVal.sgm /main/13 1996/09/08 20:48:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImSetValues" "library call" .SH "NAME" \fBXmImSetValues\fP \(em An input manager function that updates attributes of an input context .iX "XmImSetValues" .iX "input manager functions" "XmImSetValues" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImSetValues\fP\fR( \fBWidget \fBwidget\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR, \fB\fR); .fi .SH "DESCRIPTION" .PP \fBXmImSetValues\fP updates attributes of the input context associated with the specified widget\&. The \fIarglist\fP argument is a list of attribute/value pairs for the input context\&. This function passes the attributes and values to \fBXICSetValues\fP\&. The initial call to this routine should pass in all of the input context attributes\&. Thereafter, the application programmer calls \fBXmImSetValues\fP, for an XIC, only if a value has changed\&. .PP If the previous parameters for the widget\&'s XIC do not allow the previously registered XIC to be reused, that XIC will be unregistered, and a new one will be created and registered with the widget\&. Note that sharing of data is preserved\&. .PP Note that the Text and TextField widgets call the \fBXmImSetValues\fP function when they receive focus\&. Therefore, further calls to the \fBXmImSetValues\fP function for these widgets are unnecessary\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget registered with the input manager .IP "\fIarglist\fP" 10 Specifies the list of attribute/value pairs to be passed to \fBXICSetValues\fP; the following attributes are accepted: \fBXmNpreeditStartCallback\fP \fBXmNpreeditDoneCallback\fP \fBXmNpreeditDrawCallback\fP and \fBXmNpreeditCaretCallback\fP\&. These attributes accept an accompanying value of type pointer to structure of type \fBXIMCallback\fP\&. .IP "" 10 These callbacks are used only when the \fBXmNpreeditType\fP resource of the relevant \fBVendorShell\fP has the "onthespot" value, and that the XIM supports \fBXIMPreeditCallbacks\fP input style\&. These values are ignored if the condition is not met\&. .IP "" 10 For each of these callbacks, if the callback value is not set by this function, no action will be taken when the Input Method tries to call this callback\&. Refer to the "Xlib - C Language X Interface, X Version 11, Release 6," Chapter 13 for the detail of these callbacks\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/values pairs in the argument list (\fIarglist)\fP .PP Resources that can be set for the input context include: .IP "\fBXmNbackground\fP" 10 Specifies the pixel value for the background color\&. .IP "\fBXmNbackgroundPixmap\fP" 10 Specifies a pixmap for tiling the background\&. .IP "\fBXmNfontList\fP" 10 Specifies the font list used by the widget\&. The input method uses the first occurrence of a font set tagged with \fBXmFONTLIST_DEFAULT_TAG\fP\&. If no such instance is found, the first font set in the font list is used\&. If the font list does not contain a font set, a value is not passed to \fBXICSetValues\fP\&. .IP "\fBXmNforeground\fP" 10 Specifies the pixel value for the foreground color\&. .IP "\fBXmNlineSpace\fP" 10 Specifies the line spacing used in the pre-edit window\&. .IP "\fBXmNrenderTable\fP" 10 Specifies the render table used by the widget\&. .IP "\fBXmNspotLocation\fP" 10 Specifies the \fIx\fP and \fIy\fP coordinates of the position where text will be inserted in the widget handling input, whose input method style is \fB"OverTheSpot"\fP\&. The \fIy\fP coordinate is the position of the baseline used by the current text line\&. .PP The caller may also pass any other vendor-defined resources to this function\&. For additional information on the internationalization interface, see the Xlib documentation\&. .SH "RELATED" .PP \fBXmImSetFocusValues\fP(3), \fBXmImVaSetFocusValues\fP(3), and \fBXmImVaSetValues\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmDataFieldSetSelection.30000644000175000017500000000431712672140200016470 00000000000000'\" t ...\" TxtFieBE.sgm /main/9 1996/09/08 21:15:46 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldSetSelection" "library call" .SH "NAME" \fBXmDataFieldSetSelection\fP \(em A DataField function that sets the primary selection of the text .iX "XmDataFieldSetSelection" .iX "DataField functions" "XmDataFieldSetSelection" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDataFieldSetSelection\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBfirst\fR\fR, \fBXmTextPosition \fBlast\fR\fR, \fBTime \fBtime\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldSetSelection\fP sets the primary selection of the text in the widget\&. It also sets the insertion cursor position to the last position of the selection and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. \fBXmDataFieldSetSelection\fP always generates an \fBXmNgainPrimaryCallback\fP unless it fails to take ownership of the primary text selection\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIfirst\fP" 10 Marks the first character position of the text to be selected .IP "\fIlast\fP" 10 Marks the last position of the text to be selected .IP "\fItime\fP" 10 Specifies the time at which the selection value is desired\&. This should be the same as the time of the event that triggered this request\&. One source of a valid time stamp is the function \fBXtLastTimestampProcessed\fP\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateCommand.30000644000175000017500000000262512672140200015322 00000000000000.DT .TH "XmVaCreateCommand" "library call" .SH "NAME" \fBXmVaCreateCommand\fP, \fBXmVaCreateManagedCommand\fP \(em A Command widget convenience creation functions\&. .iX "XmVaCreateCommand" "XmVaCreateManagedCommand" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateCommand\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedCommand\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Command widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateCommand\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedCommand\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Command and its associated resources, see \fBXmCommand\fP(3)\&. .SH "RETURN" .PP Returns the Command widget ID\&. .SH "RELATED" .PP \fBXmCommand\fP(3), \fBXmCreateCommand\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedSelectionBox.30000644000175000017500000000004212672140200017606 00000000000000.so man3/XmVaCreateSelectionBox.3 motif-2.3.8/doc/man/man3/UilDumpSymbolTable.30000644000175000017500000000541112672140200015535 00000000000000'\" t ...\" UilDumpS.sgm /main/9 1996/09/08 21:42:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "UilDumpSymbolTable" "library call" .SH "NAME" \fBUilDumpSymbolTable\fP \(em Dumps the contents of a named UIL symbol table to standard output .iX "UilDumpSymbolTable" .iX "uil functions" "UilDumpSymbolTable" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBUilDumpSymbolTable\fP\fR( \fBsym_entry_type *\fBroot_ptr\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBUilDumpSymbolTable\fP function dumps the contents of a UIL symbol table pointer to standard output\&. .IP "\fIroot_ptr\fP" 10 Specifies a pointer to the the symbol table root entry\&. This value can be taken from the \fBparse_tree_root\fP part of the \fBUil_compile_desc_type\fP data structure returned by \fBUil\fP\&. .PP By following the link from the root entry, you can traverse the entire parse tree\&. Symbol table entries are in the following format: .PP \fBhex\&.address\fR \fBsymbol\&.type\fR \fBsymbol\&.data\fR \fBprev\&.source\&.position\fR \fBsource\&.position\fR \fBmodification\&.record\fR .PP where: .IP "\fBhex\&.address\fR" 10 Specifies the hexadecimal address of this entry in the symbol table\&. .IP "\fBsymbol\&.type\fR" 10 Specifies the type of this symbol table entry\&. Some possible types are \fIroot\fP, \fImodule\fP, \fIvalue\fP, \fIprocedure\fP, and \fIwidget\fP\&. .IP "\fBsymbol\&.data\fR" 10 Specifies data for the symbol table entry\&. The data varies with the type of the entry\&. Often it contains pointers to other symbol table entries, or the actual data for the data type\&. .IP "\fBprev\&.source\&.position\fR" 10 Specifies the end point in the source code for the previous source item\&. .IP "\fBsource\&.position\fR" 10 Specifies the range of positions in the source code for this symbol\&. .PP The exact data structures for each symbol type are defined in the include file \fBUilSymDef\&.h\fP\&. Note that this file is automatically included when an application includes the file \fBUilDef\&.h\fP\&. .SH "RELATED" .PP \fBUil\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmStringTableUnparse.30000644000175000017500000000741112672140200016103 00000000000000'\" t ...\" StrTaE.sgm /main/7 1996/09/08 21:07:43 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringTableUnparse" "library call" .SH "NAME" \fBXmStringTableUnparse\fP \(em A convenience function that converts a table of compound strings to an array of text .iX "XmStringTableUnparse" .SH "SYNOPSIS" .PP .nf #include \fBXtPointer * \fBXmStringTableUnparse\fP\fR( \fBXmStringTable \fBtable\fR\fR, \fBCardinal \fBcount\fR\fR, \fBXmStringTag \fBtag\fR\fR, \fBXmTextType \fBtag_type\fR\fR, \fBXmTextType \fBoutput_type\fR\fR, \fBXmParseTable \fBparse\fR\fR, \fBCardinal \fBparse_count\fR\fR, \fBXmParseModel \fBparse_model\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringTableUnparse\fP takes an array of compound strings, allocates a string array for the type of characters determined by \fItype\fP with an equal number of slots, calls \fBXmStringUnparse\fP on each compound string in \fItable\fP, and inserts the resulting string in the corresponding slot in the array\&. .IP "\fItable\fP" 10 Specifies an \fBXmStringTable\fR containing the compound string to be converted\&. .IP "\fIcount\fP" 10 Specifies the number of compound strings in \fItable\fP\&. .IP "\fItag\fP" 10 Specifies the tag to be used in matching with text segments\&. The two types of tag types are \fBXmFONTLIST_DEFAULT_TAG\fP and \fB_MOTIF_DEFAULT_LOCALE\fP\&. Only segments tagged with \fItag\fP will be returned\&. If \fItag\fP is NULL, all segments will be matched\&. .IP "\fItag_type\fP" 10 Specifies the type of tag to be searched for\&. These types include \fBXmMULTIBYTE_TEXT\fP, \fBXmWIDECHAR_TEXT\fP, and \fBXmCHARSET_TEXT\fP\&. .IP "\fIoutput_type\fP" 10 Specifies the type of text to be generated\&. These types include \fBXmMULTIBYTE_TEXT\fP, \fBXmWIDECHAR_TEXT\fP, and \fBXmCHARSET_TEXT\fP\&. .IP "\fIparse\fP" 10 Specifies the parse table to be used\&. .IP "\fIparse_count\fP" 10 Specifies the number of items in \fIparse\fP\&. .IP "\fIparse_model\fP" 10 Specifies which non-text components to be considered in matching in \fIparse_table\fP\&. Possible values are: .RS .IP "\fBXmOUTPUT_ALL\fP" 10 Puts out all matching components\&. .IP "\fBXmOUTPUT_BETWEEN\fP" 10 Puts out only those matching components that are between two matching text components\&. .IP "\fBXmOUTPUT_BEGINNING\fP" 10 Puts out only those matching components that are at the beginning of a matching text component\&. .IP "\fBXmOUTPUT_END\fP" 10 Puts out only those matching components that are at the end of a matching text component\&. .IP "\fBXmOUTPUT_BOTH\fP" 10 Puts out only those matching components that are at the beginning or end of a matching text component\&. .RE .SH "RETURN" .PP Returns an allocated array of allocated strings\&. The application is responsible for managing the allocated space\&. The application can recover the allocated strings space by calling \fBXtFree\fP \fIcount\fP times (that is, one time for each allocated string)\&. The application can then recover the allocated array by calling \fBXtFree\fP on the allocated array itself\&. .SH "RELATED" .PP \fBXmStringTab\&.\fP ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmTextFindString.30000644000175000017500000000562312672140200015246 00000000000000'\" t ...\" TxtFindA.sgm /main/10 1996/09/25 14:51:36 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFindString" "library call" .SH "NAME" \fBXmTextFindString\fP \(em A Text function that finds the beginning position of a text string .iX "XmTextFindString" .iX "Text functions" "XmTextFindString" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFindString\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBstart\fR\fR, \fBchar *\fBstring\fR\fR, \fBXmTextDirection \fBdirection\fR\fR, \fBXmTextPosition *\fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFindString\fP locates the beginning position of a specified text string\&. This routine searches forward or backward for the first occurrence of the string starting from the given start position\&. If it finds a match, the function returns the position of the first character of the string in \fIposition\fP\&. If the match string begins at the current position, this routine returns the current position\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID\&. .IP "\fIstart\fP" 10 Specifies the character position from which the search proceeds\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fIstring\fP" 10 Specifies the search string\&. .IP "\fIdirection\fP" 10 Indicates the search direction\&. It is relative to the primary direction of the text\&. The possible values are .RS .IP "\fBXmTEXT_FORWARD\fP" 10 The search proceeds toward the end of the text buffer\&. .IP "\fBXmTEXT_BACKWARD\fP" 10 The search proceeds toward the beginning of the text buffer\&. .RE .IP "\fIposition\fP" 10 Specifies the pointer in which the first character position of the string match is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. If the function returns False, this value is undefined\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns True if a string match is found; otherwise, returns False\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextFindStringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/MrmFetchWidget.30000644000175000017500000000747412672140200014704 00000000000000'\" t ...\" FetchWiA.sgm /main/9 1996/09/08 21:25:23 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "MrmFetchWidget" "library call" .SH "NAME" \fBMrmFetchWidget\fP \(em Fetches and creates an indexed (UIL named) application widget and its children .iX "MrmFetchWidget" .iX "uil functions" "MrmFetchWidget" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBMrmFetchWidget\fP\fR( \fBMrmHierarchy \fBhierarchy_id\fR\fR, \fBString \fBindex\fR\fR, \fBWidget \fBparent_widget\fR\fR, \fBWidget *\fBwidget\fR\fR, \fBMrmType *\fBclass\fR\fR); .fi .iX "MRM function" "MrmFetchWidget" .iX "MrmFetchWidget" "definition" .SH "DESCRIPTION" .PP The \fBMrmFetchWidget\fP function .iX "MrmFetchWidget" "description" fetches and creates an indexed application widget and its children\&. The indexed application widget is any widget that is named in UIL\&. In fetch operations, the fetched widget\&'s subtree is also fetched and created\&. This widget must not appear as the child of a widget within its own subtree\&. \fBMrmFetchWidget\fP does not execute \fBXtManageChild\fP for the newly created widget\&. .PP All widgets fetched by a call to \fBMrmFetchWidget\fP are not managed at the time of their creation callbacks\&. .IP "\fIhierarchy_id\fP" 10 Specifies the ID of the \fBUID\fP hierarchy that contains the interface definition\&. The value of \fIhierarchy_id\fP was returned in a previous call to \fBMrmOpenHierarchyPerDisplay\fP\&. .IP "\fIindex\fP" 10 Specifies the UIL name of the widget to fetch\&. .IP "\fIparent_widget\fP" 10 Specifies the parent widget ID\&. .IP "\fIwidget\fP" 10 Returns the widget ID of the created widget\&. .IP "\fIclass\fP" 10 This argument must be set to an actual pointer; it cannot be a NULL pointer\&. \fBMrmFetchWidget\fP sets this argument to an implementation dependent value\&. .PP An application can fetch any named widget in the \fBUID\fP hierarchy using \fBMrmFetchWidget\fP\&. \fBMrmFetchWidget\fP can be called at any time to fetch a widget that was not fetched at application startup\&. \fBMrmFetchWidget\fP can be used to defer fetching pop-up widgets until they are first referenced (presumably in a callback), and then used to fetch them once\&. .PP \fBMrmFetchWidget\fP can also create multiple instances of a widget (and its subtree)\&. In this case, the \fBUID\fP definition functions as a template; a widget definition can be fetched any number of times\&. An application can use this template to make multiple instances of a widget, for example, in a dialog box box or menu\&. .PP The index (UIL name) that identifies the widget must be known to the application\&. .SH "RETURN" .iX "MrmSUCCESS" .iX "MrmBAD_HIERARCHY" .iX "MrmNOT_FOUND" .iX "MrmFAILURE" .PP This function returns one of the following status return constants: .IP "\fBMrmSUCCESS\fP" 10 The function executed successfully\&. .IP "\fBMrmBAD_HIERARCHY\fP" 10 The hierarchy ID was invalid\&. .IP "\fBMrmNOT_FOUND\fP" 10 The widget was not found in UID hierarchy\&. .IP "\fBMrmFAILURE\fP" 10 The function failed\&. .SH "RELATED" .PP \fBMrmOpenHierarchyPerDisplay\fP(3), \fBMrmFetchWidgetOverride\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/Core.30000644000175000017500000002101412672140200012705 00000000000000'\" t ...\" Core.sgm /main/9 1996/09/08 21:41:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "Core" "library call" .SH "NAME" \fBCore\fP \(em The Core widget class .iX "Core" .iX "widget class" "Core" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Core is the Xt Intrinsic base class for windowed widgets\&. The \fBObject\fP and \fBRectObj\fP classes provide support for windowless widgets\&. .SS "Classes" .PP All widgets are built from \fBCore\fP\&. .PP The class pointer is \fBwidgetClass\fP\&. .PP The class name is \fBCore\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension1CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .IP "\fBXmNaccelerators\fP" 10 Specifies a translation table that is bound with its actions in the context of a particular widget\&. The accelerator table can then be installed on some destination widget\&. Note that the default accelerators for any widget will always be installed, no matter whether this resource is specified or not\&. .IP "\fBXmNancestorSensitive\fP" 10 Specifies whether the immediate parent of the widget receives input events\&. Use the function \fBXtSetSensitive\fP to change the argument to preserve data integrity (see \fBXmNsensitive\fP)\&. For shells, the default is copied from the parent\&'s \fBXmNancestorSensitive\fP resource if there is a parent; otherwise, it is True\&. For other widgets, the default is the bitwise AND of the parent\&'s \fBXmNsensitive\fP and \fBXmNancestorSensitive\fP resources\&. .IP "\fBXmNbackground\fP" 10 Specifies the background color for the widget\&. .IP "\fBXmNbackgroundPixmap\fP" 10 Specifies a pixmap for tiling the background\&. The first tile is placed at the upper left corner of the widget\&'s window\&. .IP "\fBXmNborderColor\fP" 10 Specifies the color of the border in a pixel value\&. .IP "\fBXmNborderPixmap\fP" 10 Specifies a pixmap to be used for tiling the border\&. The first tile is placed at the upper left corner of the border\&. .IP "\fBXmNborderWidth\fP" 10 Specifies the width of the border that surrounds the widget\&'s window on all four sides\&. The width is specified in pixels\&. A width of 0 (zero) means that no border shows\&. Note that you should use resources like \fBXmNshadowThickness\fP and \fBXmNhighlightThickness\fP instead of \fBXmNborderWidth\fP to specify border widths\&. .IP "\fBXmNcolormap\fP" 10 Specifies the colormap that is used for conversions to the type \fBPixel\fP for this widget instance\&. When this resource is changed, previously generated pixel values are not affected, but newly generated values are in the new colormap\&. For shells without parents, the default is the default colormap of the widget\&'s screen\&. Otherwise, the default is copied from the parent\&. .IP "\fBXmNdepth\fP" 10 Specifies the number of bits that can be used for each pixel in the widget\&'s window\&. Applications should not change or set the value of this resource as it is set by the Xt Intrinsics when the widget is created\&. For shells without parents, the default is the default depth of the widget\&'s screen\&. Otherwise, the default is copied from the parent\&. .IP "\fBXmNdestroyCallback\fP" 10 Specifies a list of callbacks that is called when the widget is destroyed\&. .IP "\fBXmNheight\fP" 10 Specifies the inside height (excluding the border) of the widget\&'s window\&. .IP "\fBXmNinitialResourcesPersistent\fP" 10 Specifies whether or not resources are reference counted\&. If the value is True when the widget is created, the resources referenced by the widget are not reference counted, regardless of how the resource type converter is registered\&. An application that expects to destroy the widget and wants to have resources deallocated should specify a value of False\&. The default is True, implying an assumption that the widget will not be destroyed during the life of the application\&. .IP "\fBXmNmappedWhenManaged\fP" 10 If this resource is set to True, it maps the widget (makes it visible) as soon as it is both realized and managed\&. If this resource is set to False, the client is responsible for mapping and unmapping the widget\&. If the value is changed from True to False after the widget has been realized and managed, the widget is unmapped\&. .IP "\fBXmNscreen\fP" 10 Specifies the screen on which a widget instance resides\&. It is read only\&. When the Toolkit is initialized, the top-level widget obtains its default value from the default screen of the display\&. Otherwise, the default is copied from the parent\&. .IP "\fBXmNsensitive\fP" 10 Determines whether a widget receives input events\&. If a widget is sensitive, the Xt Intrinsics\&' Event Manager dispatches to the widget all keyboard, mouse button, motion, window enter/leave, and focus events\&. Insensitive widgets do not receive these events\&. Use the function \fBXtSetSensitive\fP to change the sensitivity argument\&. Using \fBXtSetSensitive\fP ensures that if a parent widget has \fBXmNsensitive\fP set to False, the ancestor-sensitive flag of all its children is appropriately set\&. .IP "\fBXmNtranslations\fP" 10 Points to a translations list\&. A translations list is a list of events and actions that are to be performed when the events occur\&. Note that the default translations for any widget will always be installed, no matter whether this resource is specified or not\&. .IP "\fBXmNwidth\fP" 10 Specifies the inside width (excluding the border) of the widget\&'s window\&. .IP "\fBXmNx\fP" 10 Specifies the x-coordinate of the upper left outside corner of the widget\&'s window\&. The value is relative to the upper left inside corner of the parent window\&. .IP "\fBXmNy\fP" 10 Specifies the y-coordinate of the upper left outside corner of the widget\&'s window\&. The value is relative to the upper left inside corner of the parent window\&. .SS "Translations" .PP There are no translations for Core\&. .SH "RELATED" .PP \fBObject\fP(3) and \fBRectObj\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmFontListCopy.30000644000175000017500000000326512672140200014727 00000000000000'\" t ...\" FontLstH.sgm /main/7 1996/08/30 15:19:21 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListCopy" "library call" .SH "NAME" \fBXmFontListCopy\fP \(em A font list function that copies a font list .iX "XmFontListCopy" .iX "font list functions" "XmFontListCopy" .SH "SYNOPSIS" .PP .nf #include \fBXmFontList \fBXmFontListCopy\fP\fR( \fBXmFontList \fBfontlist\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListCopy\fP creates a new font list consisting of the contents of the \fIfontlist\fP argument\&. .IP "\fIfontlist\fP" 10 Specifies a font list to be copied .SH "RETURN" .PP Returns NULL if \fIfontlist\fP is NULL; otherwise, returns a new font list and allocates space to hold the font list\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmFontListFree\fP\&. .SH "RELATED" .PP \fBXmFontList\fP(3) and \fBXmFontListFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmMainWindowSetAreas.30000644000175000017500000000724312672140200016036 00000000000000'\" t ...\" MainWinE.sgm /main/8 1996/09/08 20:53:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMainWindowSetAreas" "library call" .SH "NAME" \fBXmMainWindowSetAreas\fP \(em A MainWindow function that identifies manageable children for each area .iX "XmMainWindowSetAreas" .iX "MainWindow functions" "XmMainWindowSetAreas" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMainWindowSetAreas\fP\fR( \fBWidget \fBwidget\fR\fR, \fBWidget \fBmenu_bar\fR\fR, \fBWidget \fBcommand_window\fR\fR, \fBWidget \fBhorizontal_scrollbar\fR\fR, \fBWidget \fBvertical_scrollbar\fR\fR, \fBWidget \fBwork_region\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMainWindowSetAreas\fP identifies which of the valid children for each area (such as the MenuBar and work region) are to be actively managed by MainWindow\&. This function also sets up or adds the MenuBar, work window, command window, and ScrollBar widgets to the application\&'s main window widget\&. .PP Each area is optional; therefore, the user can pass NULL to one or more of the following arguments\&. The window manager provides the title bar\&. .PP \fBNOTE:\fP \fBXmMainWindowSetAreas\fP is obsolete and exists for compatibility with previous releases\&. The information previously returned by this function can now be obtained through a call to \fBXtGetValues\fP on the \fBXmNscrolledWindowChildType\fP resource\&. .IP "\fIwidget\fP" 10 Specifies the MainWindow widget ID\&. .IP "\fImenu_bar\fP" 10 Specifies the widget ID for the MenuBar to be associated with the MainWindow widget\&. Set this ID only after creating an instance of the MainWindow widget\&. The attribute name associated with this argument is \fBXmNmenuBar\fP\&. .IP "\fIcommand_window\fP" 10 Specifies the widget ID for the command window to be associated with the MainWindow widget\&. Set this ID only after creating an instance of the MainWindow widget\&. The attribute name associated with this argument is \fBXmNcommandWindow\fP\&. .IP "\fIhorizontal_scrollbar\fP" 10 Specifies the ScrollBar widget ID for the horizontal ScrollBar to be associated with the MainWindow widget\&. Set this ID only after creating an instance of the MainWindow widget\&. The attribute name associated with this argument is \fBXmNhorizontalScrollBar\fP\&. .IP "\fIvertical_scrollbar\fP" 10 Specifies the ScrollBar widget ID for the vertical ScrollBar to be associated with the MainWindow widget\&. Set this ID only after creating an instance of the MainWindow widget\&. The attribute name associated with this argument is \fBXmNverticalScrollBar\fP\&. .IP "\fIwork_region\fP" 10 Specifies the widget ID for the work window to be associated with the MainWindow widget\&. Set this ID only after creating an instance of the MainWindow widget\&. The attribute name associated with this argument is \fBXmNworkWindow\fP\&. .PP For a complete definition of MainWindow and its associated resources, see \fBXmMainWindow\fP(3)\&. .SH "RELATED" .PP \fBXmMainWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmParseTableFree.30000644000175000017500000000303412672140200015150 00000000000000'\" t ...\" ParTabB.sgm /main/7 1996/08/30 15:53:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmParseTableFree" "library call" .SH "NAME" \fBXmParseTableFree\fP \(em A compound string function that recovers memory .iX "XmParseTableFree" .iX "compound string functions" "XmParseTableFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmParseTableFree\fP\fR( \fBXmParseTable \fBparse_table\fR\fR, \fBCardinal \fBcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmParseTableFree\fP recovers memory used by an \fBXmParseTable\fR and its constituent \fBXmParseMapping\fRs\&. .IP "\fIparse_table\fP" 10 Specifies the parse table to be freed .IP "\fIcount\fP" 10 Specifies the number of parse mappings in the parse table .SH "RELATED" .PP \fBXmParseTable\fP(3) and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmTextFieldGetEditable.30000644000175000017500000000314712672140200016313 00000000000000'\" t ...\" TxtFieAG.sgm /main/7 1996/08/30 16:23:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetEditable" "library call" .SH "NAME" \fBXmTextFieldGetEditable\fP \(em A TextField function that accesses the edit permission state .iX "XmTextFieldGetEditable" .iX "TextField functions" "XmTextFieldGetEditable" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldGetEditable\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetEditable\fP accesses the edit permission state of the TextField widget\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns a Boolean value that indicates the state of the \fBXmNeditable\fP resource\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmCreateDragIcon.30000644000175000017500000000414012672140200015135 00000000000000'\" t ...\" CreDrA.sgm /main/8 1996/09/08 20:32:43 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateDragIcon" "library call" .SH "NAME" \fBXmCreateDragIcon\fP \(em A Drag and Drop function that creates a DragIcon widget .iX "XmCreateDragIcon" .iX "Drag and Drop functions" "XmCreateDragIcon" .iX "creation functions" "XmCreateDragIcon" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateDragIcon\fP\fR( \fBWidget \fBwidget\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateDragIcon\fP creates a DragIcon and returns the associated widget ID\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget that the function uses to access default values for visual attributes of the DragIcon\&. This widget may be different than the actual parent of the DragIcon\&. .IP "\fIname\fP" 10 Specifies the name of the DragIcon widget\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of DragIcon and its associated resources, see \fBXmDragIcon\fP(3)\&. .SH "RETURN" .PP The function creates a DragIcon and returns the associated widget ID\&. .SH "RELATED" .PP \fBXmDragContext\fP(3), \fBXmDragIcon\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmTextFieldPaste.30000644000175000017500000000502512672140200015213 00000000000000'\" t ...\" TxtFieAT.sgm /main/8 1996/09/08 21:14:36 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldPaste" "library call" .SH "NAME" \fBXmTextFieldPaste\fP \(em A TextField function that inserts the clipboard selection .iX "XmTextFieldPaste" .iX "TextField functions" "XmTextFieldPaste" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldPaste\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldPaste\fP inserts the clipboard selection at the insertion cursor of the destination widget\&. If \fBXmNpendingDelete\fP is True and the insertion cursor is inside the current selection, the clipboard selection replaces the selected text\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. .PP This routine calls the widget\&'s \fBXmNdestinationCallback\fP procedures with the \fIselection\fP member of the \fBXmDestinationCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIoperation\fP member set to \fBXmCOPY\fP\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as the position where the selection is to be inserted, the \fBXmNmotionVerifyCallback\fP is called\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns False if no transfers take place\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmStringHeight.30000644000175000017500000000314412672140200014725 00000000000000'\" t ...\" StrHei.sgm /main/8 1996/09/08 21:05:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringHeight" "library call" .SH "NAME" \fBXmStringHeight\fP \(em A compound string function that returns the line height of the given compound string .iX "XmStringHeight" .iX "compound string functions" "XmStringHeight" .SH "SYNOPSIS" .PP .nf #include \fBDimension \fBXmStringHeight\fP\fR( \fBXmRenderTable \fBrendertable\fR\fR, \fBXmString \fBstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringHeight\fP returns the height, in pixels, of the sum of all the line heights of the given compound string\&. Separator components delimit lines\&. .IP "\fIrendertable\fP" 10 Specifies the render table .IP "\fIstring\fP" 10 Specifies the string .SH "RETURN" .PP Returns the height of the specified string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmCommandGetChild.30000644000175000017500000000405312672140200015310 00000000000000'\" t ...\" CommGe.sgm /main/8 1996/09/08 20:31:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCommandGetChild" "library call" .SH "NAME" \fBXmCommandGetChild\fP \(em A Command function that is used to access a component .iX "XmCommandGetChild" .iX "Command functions" "XmCommandGetChild" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCommandGetChild\fP\fR( \fBWidget \fBwidget\fR\fR, \fBunsigned char \fBchild\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCommandGetChild\fP is used to access a component within a Command\&. The parameters given to the function are the Command widget and a value indicating which component to access\&. .IP "\fIwidget\fP" 10 Specifies the Command widget ID\&. .IP "\fIchild\fP" 10 Specifies a component within the Command\&. The following values are legal for this parameter: .RS .IP " \(bu" 6 \fBXmDIALOG_COMMAND_TEXT\fP .IP " \(bu" 6 \fBXmDIALOG_PROMPT_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_HISTORY_LIST\fP .IP " \(bu" 6 \fBXmDIALOG_WORK_AREA\fP .RE .PP For a complete definition of Command and its associated resources, see \fBXmCommand\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the specified Command component\&. An application should not assume that the returned widget will be of any particular class\&. .SH "RELATED" .PP \fBXmCommand\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTextFieldGetSubstring.30000644000175000017500000000700712672140200016561 00000000000000'\" t ...\" TxtFieAP.sgm /main/8 1996/09/08 21:14:04 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldGetSubstring" "library call" .SH "NAME" \fBXmTextFieldGetSubstring\fP \(em A TextField function that retrieves a copy of a portion of the internal text buffer .iX "XmTextFieldGetSubstring" .iX "TextField functions" "XmTextFieldGetSubstring" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmTextFieldGetSubstring\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBstart\fR\fR, \fBint \fBnum_chars\fR\fR, \fBint \fBbuffer_size\fR\fR, \fBchar *\fBbuffer\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldGetSubstring\fP retrieves a copy of a portion of the internal text buffer of a TextField widget\&. The function copies a specified number of characters from a given start position in the internal text buffer into a buffer provided by the application\&. A NULL terminator is placed at the end of the copied data\&. .PP The size of the required buffer depends on the maximum number of bytes per character (\fBMB_CUR_MAX\fP) for the current locale\&. \fBMB_CUR_MAX\fP is a macro defined in \fBstdlib\&.h\fP\&. The buffer should be large enough to contain the substring to be copied and a NULL terminator\&. Use the following equation to calculate the size of buffer the application should provide: .PP .nf \fIbuffer_size\fP = (\fInum_chars\fP* MB_CUR_MAX) + 1 \fB\fR(\fBvoid\fR) .fi .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .IP "\fIstart\fP" 10 Specifies the beginning character position from which the data will be retrieved\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .IP "\fInum_chars\fP" 10 Specifies the number of characters to be copied into the provided buffer\&. .IP "\fIbuffer_size\fP" 10 Specifies the size of the supplied buffer in bytes\&. This size should account for a NULL terminator\&. .IP "\fIbuffer\fP" 10 Specifies the character buffer into which the internal text buffer will be copied\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .IP "\fBXmCOPY_SUCCEEDED\fP" 10 The function was successful\&. .IP "\fBXmCOPY_FAILED\fP" 10 The function failed because it was unable to copy the specified number of characters into the buffer provided\&. The buffer size may be insufficient\&. The contents of \fIbuffer\fP are undefined\&. .IP "\fBXmCOPY_TRUNCATED\fP" 10 The requested number of characters extended beyond the internal buffer\&. The function copied characters between \fIstart\fP and the end of the widget\&'s buffer and terminated the string with a NULL terminator; fewer than \fInum_chars\fP characters were copied\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldGetSubstringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmGetPixmap.30000644000175000017500000001655412672140200014235 00000000000000'\" t ...\" GetPixA.sgm /main/10 1996/10/29 16:10:26 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetPixmap" "library call" .SH "NAME" \fBXmGetPixmap\fP \(em A pixmap caching function that generates a pixmap, stores it in a pixmap cache, and returns the pixmap .iX "XmGetPixmap" .iX "pixmaps" .SH "SYNOPSIS" .PP .nf #include \fBPixmap \fBXmGetPixmap\fP\fR( \fBScreen *\fBscreen\fR\fR, \fBchar *\fBimage_name\fR\fR, \fBPixel \fBforeground\fR\fR, \fBPixel \fBbackground\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetPixmap\fP uses the parameter data to perform a lookup in the pixmap cache to see if a pixmap has already been generated that matches the data\&. If one is found, a reference count is incremented and the pixmap is returned\&. Applications should use \fBXmDestroyPixmap\fP when the pixmap is no longer needed\&. .IP "\fIscreen\fP" 10 Specifies the display screen on which the pixmap is to be drawn\&. The depth of the pixmap is the default depth for this screen\&. .IP "\fIimage_name\fP" 10 Specifies the name of the image to be used to generate the pixmap .IP "\fIforeground\fP" 10 Combines the image with the \fIforeground\fP color to create the pixmap if the image referenced is a bit-per-pixel image .IP "\fIbackground\fP" 10 Combines the image with the \fIbackground\fP color to create the pixmap if the image referenced is a bit-per-pixel image .PP If a pixmap is not found, \fIimage_name\fP is used to perform a lookup in the image cache\&. If an image is found, it is used to generate the pixmap, which is then cached and returned\&. .PP If an image is not found, the \fIimage_name\fP is used as a filename, and a search is made for an \fBX10\fP or \fBX11\fP bitmap file\&. If it is found, the file is read, converted into an image, and cached in the image cache\&. The image is then used to generate a pixmap, which is cached and returned\&. .PP If \fIimage_name\fP has a leading slash (\fB/\fP), it specifies a full pathname, and \fBXmGetPixmap\fP opens the file as specified\&. Otherwise, \fIimage_name\fP specifies a filename\&. In this case, \fBXmGetPixmap\fP looks for the file along a search path specified by the \fBXBMLANGPATH\fP environment variable or by a default search path, which varies depending on whether or not the \fBXAPPLRESDIR\fP environment variable is set\&. The default search path contains a lot of directories\&. Therefore, \fBXmGetPixmap\fP will need a relatively long time to search through all these directories for pixmaps and bitmaps\&. Applications that use a lot of pixmaps and bitmaps will probably run more quickly if \fBXBMLANGPATH\fP is set to a short list of directories\&. In addition to X bitmap files (XBM), Motif also supports XPM (X Pixmap) file formats and, from version 2.3, JPEG and PNG image formats\&. (Note that support of JPEG and PNG image format is an optional feature of Motif, in order to check if current version supports PNG ang JPEG image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked correspondingly.) The \fBXBMLANGPATH\fP specifies the path for both XBM, XPM, PNG and JPEG files\&. Refer to the \fBXmGetPixmapByDepth\fP reference page for further details\&. .PP The \fBXBMLANGPATH\fP environment variable specifies a search path for X bitmap files\&. It can contain the substitution field \fB%B\fP, where the \fIimage_name\fP argument to \fBXmGetPixmap\fP is substituted for \fB%B\fP\&. It can also contain the substitution fields accepted by \fBXtResolvePathname\fP\&. The substitution field \fB%T\fP is always mapped to \fIbitmaps\fP, and \fB%S\fP is always mapped to NULL\&. .PP If \fBXBMLANGPATH\fP is not set but the environment variable \fBXAPPLRESDIR\fP is set, the following pathnames are searched: .IP " \(bu" 6 \fB%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/include/X11/bitmaps/%B\fP .PP If neither \fBXBMLANGPATH\fP nor \fBXAPPLRESDIR\fP is set, the following pathnames are searched: .IP " \(bu" 6 \fB%B\fP .IP " \(bu" 6 \fB$HOME/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/include/X11/bitmaps/%B\fP .PP These paths are defaults that vendors may change\&. For example, a vendor may use different directories for \fB/usr/lib/X11\fP and \fB/usr/include/X11\fP\&. .PP The following substitutions are used in these paths: .IP "\fB%B\fP" 10 The image name, from the \fIimage_name\fP argument .IP "\fB%N\fP" 10 The class name of the application .IP "\fB%L\fP" 10 The display\&'s language string\&. This string is influenced by \fBXtSetLanguageProc\fP\&. The default string is determined by calling setlocale(\fBLC_ALL, NULL\fP)\&. .IP "\fB%l_%t\fP" 10 The language and territory component of the display\&'s language string .IP "\fB%l\fP" 10 The language component of the display\&'s language string .PP The contents of the file must conform to the rules for X11 bitmap files\&. In other words, Motif can read any X11 conformant bitmap file\&. .SH "RETURN" .PP Returns a pixmap when successful; returns \fBXmUNSPECIFIED_PIXMAP\fP if the image corresponding to \fIimage_name\fP cannot be found\&. .SH "RELATED" .PP \fBXmDestroyPixmap\fP(3), \fBXmGetPixmapByDepth\fP(3), \fBXmInstallImage\fP(3), and \fBXmUninstallImage\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmDataFieldSetString.30000644000175000017500000000414212672140200016005 00000000000000'\" t ...\" TxtFieBF.sgm /main/8 1996/09/08 21:15:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldSetString" "library call" .SH "NAME" \fBXmDataFieldSetString\fP \(em A DataField function that sets the string value .iX "XmDataFieldSetString" .iX "DataField functions" "XmDataFieldSetString" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDataFieldSetString\fP\fR( \fBWidget \fBwidget\fR\fR, \fBchar \fB* value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldSetString\fP sets the string value of the DataField widget\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. It also sets the insertion cursor position to the beginning of the string and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIvalue\fP" 10 Specifies the character pointer to the string value and places the string into the text edit window .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RELATED" .PP \fBXmDataField\fP(3) and \fBXmDataFieldSetStringWcs\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateMainWindow.30000644000175000017500000000351112672140200015524 00000000000000'\" t ...\" CreMai.sgm /main/7 1996/08/30 14:42:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateMainWindow" "library call" .SH "NAME" \fBXmCreateMainWindow\fP \(em The MainWindow widget creation function .iX "XmCreateMainWindow" .iX "creation functions" "XmCreateMainWindow" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateMainWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateMainWindow\fP creates an instance of a MainWindow widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MainWindow and its associated resources, see \fBXmMainWindow\fP(3)\&. .SH "RETURN" .PP Returns the MainWindow widget ID\&. .SH "RELATED" .PP \fBXmMainWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmComboBoxSetItem.30000644000175000017500000000350712672140200015334 00000000000000'\" t ...\" ComboSet.sgm /main/5 1996/08/30 14:18:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmComboBoxSetItem" "library call" .SH "NAME" \fBXmComboBoxSetItem\fP \(em set an item in the XmComboBox list .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmComboBoxSetItem\fP\fR( \fBWidget \fBw\fR\fR, \fBXmString \fBitem\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmComboBoxSetItem\fP function selects an item in the XmList of the given XmComboBox widget and makes it the first visible item in the list\&. .PP The \fIw\fP argument specifies the XmComboBox widget ID\&. .PP The \fIitem\fP argument specifies the \fBXmString\fR for the item to be set in the XmComboBox\&. If the \fIitem\fP is not found on the list, \fBXmComboBoxSetItem\fP notifies the user via the \fBXtWarning\fP function\&. .SH "RETURN VALUE" .PP The \fBXmComboBoxSetItem\fP function returns no value\&. .SH "SEE ALSO" .PP \fBXmComboBoxAddItem\fP(3), \fBXmComboBoxDeletePos\fP(3), \fBXmComboBoxSelectItem\fP(3); \fBXtWarning\fP(3)\&. in the CAE Specification, Window Management: X Toolkit Intrinsics\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmSetMenuCursor.30000644000175000017500000000400212672140200015076 00000000000000'\" t ...\" SetMenuC.sgm /main/8 1996/09/08 21:02:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSetMenuCursor" "library call" .SH "NAME" \fBXmSetMenuCursor\fP \(em A function that modifies the menu cursor for a client .iX "XmSetMenuCursor" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmSetMenuCursor\fP\fR( \fBDisplay \fB* display\fR\fR, \fBCursor \fBcursorId\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmSetMenuCursor\fP programmatically modifies the menu cursor for a client; after the cursor has been created by the client, this function registers the cursor with the menu system\&. After calling this function, the specified cursor is displayed whenever this client displays a Motif menu on the indicated display\&. The client can then specify different cursors on different displays\&. .PP This function sets the menu cursor for all screens on the display\&. \fBXmSetMenuCursor\fP is obsolete and exists for compatibility with previous releases\&. Instead of using this function, provide initial values or call \fBXtSetValues\fP for the XmScreen resource \fBXmNmenuCursor\fP\&. .IP "\fIdisplay\fP" 10 Specifies the display to which the cursor is to be associated .IP "\fIcursorId\fP" 10 Specifies the \fBX\fP cursor ID .SH "RELATED" .PP \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmTextPosToXY.30000644000175000017500000000527212672140200014524 00000000000000'\" t ...\" TxtPosTo.sgm /main/11 1996/09/08 21:18:46 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextPosToXY" "library call" .SH "NAME" \fBXmTextPosToXY\fP \(em A Text function that accesses the x and y position of a character position .iX "XmTextPosToXY" .iX "Text functions" "XmTextPosToXY" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextPosToXY\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBposition\fR\fR, \fBPosition \fB*x\fR\fR, \fBPosition \fB*y\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextPosToXY\fP accesses the \fIx\fP and \fIy\fP position, relative to the upper left corner of the Text widget, of a given character position in the text buffer\&. .PP In the case of horizontal writing, the position is the origin of the character\&. In the case of vertical writing, the position is the vertical origin of the character\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIposition\fP" 10 Specifies the character position in the text for which the \fIx\fP and \fIy\fP position is accessed\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .IP "\fIx\fP" 10 Specifies the pointer in which the \fIx\fP position is returned\&. The returned position is the distance from the left side of the widget to the left border of the character\&. This value is meaningful only if the function returns True\&. .IP "\fIy\fP" 10 Specifies the pointer in which the \fIy\fP position is returned\&. The returned position is the distance from the top of the widget to the character\&'s baseline\&. This value is meaningful only if the function returns True\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP This function returns True if the character position is displayed in the Text widget; otherwise, it returns False, and no \fIx\fP or \fIy\fP value is returned\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmDisplay.30000644000175000017500000004763112672140200013744 00000000000000'\" t ...\" Display.sgm /main/17 1996/09/08 20:39:22 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDisplay" "library call" .SH "NAME" \fBXmDisplay\fP \(em The Display widget class .iX "XmDisplay" .iX "widget class" "XmDisplay" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The XmDisplay object is used by the Motif widgets to store information that is specific to a display\&. It also allows the toolkit to access certain information on widget hierarchies that would otherwise be unavailable\&. Each client has one XmDisplay object for each display it accesses\&. .PP An XmDisplay object is automatically created when the application creates the first shell on a display (usually accomplished by a call to \fBXtAppInitialize\fP or \fBXtAppCreateShell\fP)\&. It is not necessary to create an XmDisplay object by any other means\&. An application can use the function \fBXmGetXmDisplay\fP to obtain the widget ID of the XmDisplay object for a given display\&. .PP An application cannot supply initial values for XmDisplay resources as arguments to a call to any function that creates widgets\&. The application or user can supply initial values in a resource file\&. After creating the first shell on the display, the application can use \fBXmGetXmDisplay\fP to obtain the widget ID of the XmDisplay object and then call \fBXtSetValues\fP to set the XmDisplay resources\&. .PP XmDisplay resources specify the drag protocol style for a client participating in drag and drop transactions\&. The two basic protocol types are preregister and dynamic\&. When a preregister protocol is used, the toolkit handles any communication between the initiator and receiver clients and displays the appropriate drag-over and drag-under visual effects\&. A client registers its drop sites in advance and this information is stored in a property for each top-level window\&. When the drag pointer enters a top-level window, the drop site information is read by the initiator\&. A dynamic protocol allows the source and destination clients to dynamically communicate drag and drop state information between each other, and to update their respective visuals accordingly\&. The toolkit provides drop site information as the pointer passes over any given drop site\&. In this mode, a receiver can supply a procedure to generate its own drag-under effects\&. .SS "Classes" .PP Display inherits behavior and resources from \fBCore\fP, \fBComposite\fP, \fBShell\fP, \fBWMShell\fP, \fBVendorShell\fP, \fBTopLevelShell\fP, and \fBApplicationShell\fP classes\&. .PP The class pointer is \fBxmDisplayClass\fP\&. .PP The class name is \fBXmDisplay\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDisplay Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdefaultButtonEmphasisXmCDefaultButtonEmphasisXtEnumXmEXTERNAL_HIGHLIGHTC _____ XmNdefaultVirtualBindingsXmCDefaultVirtualBindingsStringdynamicC _____ XmNdragInitiatorProtocolStyleXmCDragInitiatorProtocolStyleunsigned charXmDRAG_PREFER_RECEIVERCG _____ XmNdragReceiverProtocolStyleXmCDragReceiverProtocolStyleunsigned charXmDRAG_PREFER_DYNAMICCG _____ XmNdragStartCallbackXmCCallbackXtCallbackListNULLC _____ XmNenableBtn1TransferXmCEnableBtn1TransferXtEnumXmOFFC _____ XmNenableButtonTabXmCEnableButtonTabBooleanFalseC _____ XmNenableDragIconXmCEnableDragIconBooleanFalseC _____ XmNenableEtchedInMenuXmCEnableEtchedInMenuBooleanFalseC _____ XmNenableToggleColorXmCEnableToggleColorBooleanFalseC _____ XmNenableToggleVisualXmCEnableToggleVisualBooleanFalseC _____ XmNenableUnselectableDragXmCEnableUnselectableDragBooleanTrueC _____ XmNenableWarpXmCEnableWarpXtEnumTrueCSG _____ XmNmotifVersionXmCMotifVersionintXmVERSIONCSG _____ XmNnoFontCallbackXmCCallbackXtCallbackListNULLC _____ XmNnoRenditionCallbackXmCCallbackXtCallbackListNULLC _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .IP "\fBXmNdefaultButtonEmphasis\fP" 10 Specifies whether to change the look of the PushButton widget and gadget that have the \fBXmNshowAsDefault\fP resource set\&. When the PushButton is the default, it has an etched out button which is enclosed with another etched in border\&. The \fBXmNdefaultButtonEmphasis\fP has the follow possible values, which affect the location cursor: .RS .IP "\fBXmINTERNAL_HIGHLIGHT\fP" 10 Causes the location cursor to appear in between the two etched borders to minimize the space required\&. .IP "\fBXmEXTERNAL_HIGHLIGHT\fP" 10 Causes the PushButton to draw the location cursor outside the second border\&. .RE .IP "\fBXmNdefaultVirtualBindings\fP" 10 Specifies the default virtual bindings for the display\&. Following is an example of a specification for the \fBdefaultVirtualBindings\fP resource in a resource file: .PP .nf \f(CW*defaultVirtualBindings: \e osfBackSpace: BackSpace \en\e osfInsert: InsertChar \en\e osfDelete: DeleteChar \en\e \&.\&.\&. osfLeft: left, CtrlH\fR .fi .PP .IP "\fBXmNdragInitiatorProtocolStyle\fP" 10 Specifies the drag and drop protocol requirements or preference when the client is an initiator\&. The possible values are .RS .IP "\fBXmDRAG_PREREGISTER\fP" 10 As an initiator, this client does not use the dynamic protocol and can only arrange visual effects with receivers who provide preregistered information\&. .IP "\fBXmDRAG_DYNAMIC\fP" 10 As an initiator, this client does not make use of any preregistered drop site information made available by other clients, and can only arrange visual effects with receivers who use the dynamic protocol\&. .IP "\fBXmDRAG_NONE\fP" 10 Specifies that drag and drop is disabled for this client\&. .IP "\fBXmDRAG_DROP_ONLY\fP" 10 As an initiator, this client does not use either the preregistered drop site information or the dynamic protocol\&. It supports dragging, and any time the cursor is over a client that supports drag and drop, valid feedback is provided\&. There are no other visual effects\&. .IP "\fBXmDRAG_PREFER_DYNAMIC\fP" 10 As an initiator, this client can support both the preregister and dynamic protocols, but prefers to use dynamic protocols whenever possible in order to provide high-quality drag-under feedback\&. .IP "\fBXmDRAG_PREFER_PREREGISTER\fP" 10 As an initiator, this client can support both the preregister and dynamic protocols, but prefers to use the preregister protocol whenever possible in order to accommodate performance needs or to provide consistent drag-over feedback\&. .IP "\fBXmDRAG_PREFER_RECEIVER\fP" 10 Indicates that this client can support both preregister and dynamic protocols, but will defer to the preference of the receiver client\&. This value is valid only for the \fBXmNdragInitiatorProtocolStyle\fP resource, and is its default value\&. .RE .IP "\fBXmNdragReceiverProtocolStyle\fP" 10 Specifies the drag and drop protocol requirements or preference when this client is a receiver\&. The values are .RS .IP "\fBXmDRAG_PREREGISTER\fP" 10 As a receiver, this client preregisters drop site information and does not use the dynamic protocol\&. It can only arrange visual effects with initiators who make use of the preregistered information\&. .IP "\fBXmDRAG_DYNAMIC\fP" 10 As a receiver, this client uses the dynamic protocol and does not preregister drop site information\&. It can only arrange visual effects with initiators who use the dynamic protocol\&. .IP "\fBXmDRAG_NONE\fP" 10 Specifies that drag and drop is disabled for this client\&. .IP "\fBXmDRAG_DROP_ONLY\fP" 10 As a receiver, this client neither uses the dynamic protocol nor preregisters drop site information\&. It supports dropping, and when dragging over this client, valid feedback is always provided, but there are no other visual effects\&. .IP "\fBXmDRAG_PREFER_DYNAMIC\fP" 10 As a receiver, this client can support both the preregister and dynamic protocols, but prefers to use the dynamic protocol whenever possible in order to provide high-quality drag-under feedback\&. .IP "\fBXmDRAG_PREFER_PREREGISTER\fP" 10 As a receiver, this client can support both the preregister and dynamic protocols, but prefers to use the preregister protocol whenever possible in order to accommodate performance needs\&. .RE .IP "" 10 The default value of this resource is dependent on the capabilities of the display\&. If the display supports the shape extension, allowing the dynamic protocol to use arbitrarily sized drag cursors, the default of this resource is \fBXmDRAG_PREFER_DYNAMIC\fP, otherwise the default is \fBXmDRAG_PREFER_PREREGISTER\fP\&. .IP "" 10 The actual protocol used between an initiator and a receiver is based on the protocol style of the receiver and initiator\&. The decision matrix is described in the following table\&. .TS tab() box; c| c s s s c ^| l| l| l| l l. \fBDrag Initiator Protocol Style\fP\fBDrag Receiver Protocol Style\fP ______ \fBPreregister\fP\fBPrefer Preregister\fP\fBPrefer Dynamic\fP\fBDynamic\fP ______ \fBPreregister\fPPreregisterPreregisterPreregisterDrop Only ______ \fBPrefer Preregister\fPPreregisterPreregisterPreregisterDynamic ______ \fBPrefer Receiver\fPPreregisterPreregisterDynamicDynamic ______ \fBPrefer Dynamic\fPPreregisterDynamicDynamicDynamic ______ \fBDynamic\fPDrop OnlyDynamicDynamicDynamic .TE .IP "" 10 The value \fBXmDRAG_NONE\fP does not appear in the matrix\&. When specified for either the initiator or receiver side, \fBXmDRAG_NONE\fP implies that drag and drop transactions are not supported\&. A value of \fBXmDRAG_DROP_ONLY\fP (Drop Only) results when an initiator and receiver cannot compromise protocol styles, that is, one client requires dynamic mode while the other can only support preregister mode, or if either explicitly has specified \fBXmDRAG_DROP_ONLY\fP\&. .IP "\fBXmNdragStartCallback\fP" 10 Specifies the list of callbacks that are invoked when the \fBXmDragStart\fP function is called\&. The type of structure whose address is passed to this callback is \fBXmDragStartCallbackStruct\fR\&. The callback reason is \fBXmCR_DRAG_START\fP\&. .IP "\fBXmNenableBtn1Transfer\fP" 10 Specifies if selection and transfer actions are integrated on Btn1 and extend actions are activated on Btn2\&. This resource can take the following values: .RS .IP "\fBXmOFF\fP" 10 Disables integration and selection activation on Btn1\&. .IP "\fBXmBUTTON2_TRANSFER\fP" 10 Enables integration and selection activation on Btn1 and transfer on Btn2\&. .IP "\fBXmBUTTON2_ADJUST\fP" 10 Enables integration and selection activation on Btn1 and adjust on Btn2\&. .RE .IP "" 10 This resource affects the actions of Text, TextField, List, and Container\&. .IP "\fBXmNenableButtonTab\fP" 10 Specifies if the action for the \fB\fP key (\fBKNextField\fP and \fBKPrevField\fP actions) is to be modified\&. A value of True modifies the key to move as an arrow key until the boundary of a tab group is reached\&. Then, at the boundary of the tab group, \fBKNextField\fP and \fBKPrevField\fP will move to the next or previous tab group, respectively\&. A value of False does not cause modification\&. .IP "\fBXmNenableDragIcon\fP" 10 Specifies which set of icons are to be used for system default cursors during drag and drop operations\&. A value of False specifies that earlier versions of Motif release icons are used, a value of True specifies that alternate icons are used\&. This resource affects both the 16x16 and the 32x32 icons that the system defaults for each of the Screen objects associated with this display\&. .IP "\fBXmNenableEtchedInMenu\fP" 10 Specifies the shadowing of the button widgets and gadgets in menus when the control is activated\&. A value of True causes the selected menu to be drawn with the shadow etched in; this shadow style is consistent with the selected appearance of other button widgets outside of menus\&. A value of False causes the selected menu to be draw with the shadow etched out\&. This resource affects the actions of PushButton, ToggleButton, and CascadeButton widgets and gadgets when they are children of Menu\&. .IP "" 10 When this resource is set, the background of a button in a menu uses the \fBXmNselectColor\fP (derived from the \fBXmNselectPixel\fP) when armed as a default\&. A \fBPushButton\fP uses the \fBXmNarmColor\fP if it is defined\&. A \fBToggleButton\fP uses the \fBXmNselectColor\fP if \fBXmNindicatorOn\fP is \fBFalse\fP and \fBXmNfillOnSelect\fP is \fBTrue\fP\&. .IP "\fBXmNenableToggleColor\fP" 10 Specifies how to determine the default value of the \fBXmNselectColor\fP resource of ToggleButton and ToggleButtonGadget\&. A value of True causes the default value of \fBXmNselectColor\fP to be set to the value of \fBXmNhighlightColor\fP\&. A value of False causes the default value of \fBXmNselectColor\fP to be set to the value of \fBXmNbackground\fP\&. This resource only affects the appearance of ToggleButton widgets and gadgets that are in \fBXmONE_OF_MANY\fP or \fBXmONE_OF_MANY_ROUND\fP mode\&. In addition, \fBXmNenableToggleColor\fP only influences the default value of \fBXmNselectColor\fP\&. That is, if the user or application sets a value for \fBXmNselectColor\fP, then \fBXmNenableToggleColor\fP is ignored\&. .IP "\fBXmNenableToggleVisual\fP" 10 Specifies the visual appearance of the ToggleButton widget and/or gadget\&. This resource affects the default value of the ToggleButton[Gadget] \fBXmNindicatorType\fP and \fBXmNindicatorOn\fP resources\&. When the ToggleButton is in a RadioBox, a value of True causes the \fBXmONE_OF_MANY_ROUND\fP (a shadowed circle) to be the default\&. Otherwise, when this resource is True, the ToggleButton \fBXmNindicatorOn\fP resource causes a default of \fBXmN_OF_MANY\fP, which will be a shadowed square with a check mark (check box)\&. .IP "" 10 A value of False causes the following: .RS .IP "\fBXmONE_OF_MANY\fP" 10 Is a shadowed diamond\&. .IP "\fBXmN_OF_MANY\fP" 10 Is a shadowed square\&. .RE .IP "\fBXmNenableUnselectableDrag\fP" 10 Specifies whether or not it is possible to drag from Label and Scale\&. A value of True enables the drag; a value of False disables it\&. .IP "\fBXmNenableWarp\fP" 10 Specifies if an application is allowed to warp the pointer from the user\&. A value of True enables warping, a value of False does not\&. .IP "\fBXmNmotifVersion\fP" 10 Specifies the current version of Motif that the current implementation is supposed to behave like\&. By default, this resource gets its value from release values in \fBXm\&.h\fP\&. .IP "\fBXmNnoFontCallback\fP" 10 This callback is called whenever a rendition attempts to load a font or fontset and fails\&. This can happen on creation if the font is specified as \fBXmLOAD_IMMEDIATE\fP or when an attempt is made to render an \fBXmString\fR using a font specified as \fBXmLOAD_DEFERRED\fP\&. An application can have this callback attempt to remedy this problem by calling \fBXmRenditionUpdate\fP on the input rendition to provide a font for the widget to use\&. This may be done by either providing an an alternative font name to be loaded using the \fBXmNfontName\fP and \fBXmNfontType\fP resources or with an already loaded font using the \fBXmNfont\fP resource\&. The callback reason is \fBXmCR_NO_FONT\fP\&. This callback uses the \fBXmDisplayCallbackStruct\fR structure\&. .IP "\fBXmNnoRenditionCallback\fP" 10 This callback is called whenever an attempt is made to render a segment with a \fBRENDITION\fP tag which does not match any renditions in a given render table\&. The callback reason is \fBXmCR_NO_RENDITION\fP\&. This callback uses the \fBXmDisplayCallbackStruct\fR structure\&. .IP "" 10 An application can have this callback attempt to remedy this problem by creating a new rendition with the given tag and adding it to \fBrender_table\fP\&. .IP "" 10 The \fBXmNnoRenditionCallback\fP should deallocate the render table passed in in the \fBrender_table\fP field of the callback structure\&. Note that the table will automatically be deallocated if the \fBXmRenderTableAddRenditions\fP function is called on it\&. The callback should NOT deallocate the modified render table that is passed back to Motif in the \fBrender_table\fP field\&. If the application wishes to manipulate this render table further, it should make a copy with the \fBXmRenderTableCopy\fP function before returning from the callback\&. .IP "\fBXmNuserData\fP" 10 Specifies a client data pointer for applications\&. An internally unused resource\&. .SS "Inherited Resources" .PP All of the superclass resources inherited by XmDisplay are designated N/A (not applicable)\&. .SS "Callback Information" .PP A pointer to the following structure is passed to the \fBXmNdragStartCallback\fP callback: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; Widget \fItimeStamp\fP; Boolean \fIdoit\fP; }XmDragStartCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fIwidget\fP" 10 Indicates the ID of the widget from which the drag was initiated\&. .IP "\fIdoit\fP" 10 Is an IN/OUT member that allows the callback to determine whether to continue with the drag or cancel\&. Setting \fIdoit\fP to False will cancel the drag\&. The default value is NULL\&. .PP A pointer to the following structure is passed to the \fBXmNnoFontCallback\fP and \fBXmNnoRenditionCallback\fP callbacks: .PP .nf typedef struct { int \fIreason\fP; XEvent *\fIevent\fP; XmRendition \fIrendition\fP; char *\fIfont_name\fP; XmRenderTable \fIrender_table\fP; XmStringTag \fItag\fP; }XmDisplayCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. It can be NULL\&. .IP "\fIrendition\fP" 10 Specifies the rendition with the missing font\&. .IP "\fIfont_name\fP" 10 Specifies the name of the font or font set which could not be loaded\&. .IP "\fBrender_table\fP" 10 Specifies the render table with the missing rendition\&. .IP "\fItag\fP" 10 Specifies the tag of the missing rendition\&. .PP The following table describes the reasons for which the individual callback structure fields are valid\&. .TS tab() box; l| l. \fBReason\fP\fBValid Fields\fP __ XmCR_NO_FONT\fIrendition, font_name\fP __ XmCR_NO_RENDITION\fIrender_table, tag\fP __ .TE .SH "RELATED" .PP \fBApplicationShell\fP(3), \fBComposite\fP(3), \fBCore\fP(3), \fBTopLevelShell\fP(3), \fBVendorShell\fP(3), \fBWMShell\fP(3), \fBXmGetXmDisplay\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmToggleButtonGadgetSetState.30000644000175000017500000000453612672140200017542 00000000000000'\" t ...\" ToggleBD.sgm /main/8 1996/09/08 21:10:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmToggleButtonGadgetSetState" "library call" .SH "NAME" \fBXmToggleButtonGadgetSetState\fP \(em A ToggleButtonGadget function that sets or changes the current state .iX "XmToggleButtonGadgetSet\\%State" .iX "ToggleButtonGadget functions" "XmToggleButtonGadgetSet\\%State" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmToggleButtonGadgetSetState\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBstate\fR\fR, \fBBoolean \fBnotify\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmToggleButtonGadgetSetState\fP sets or changes the ToggleButtonGadget\&'s current state\&. .IP "\fIwidget\fP" 10 Specifies the ToggleButtonGadget widget ID\&. .IP "\fIstate\fP" 10 Specifies a Boolean value that indicates whether the ToggleButtonGadget state is selected or unselected\&. If the value is True, the button state is selected; if it is False, the button state is unselected\&. .IP "\fInotify\fP" 10 Indicates whether \fBXmNvalueChangedCallback\fP is called; it can be either True or False\&. The \fBXmNvalueChangedCallback\fP is only called when this function changes the state of the ToggleButtonGadget\&. When this argument is True and the ToggleButtonGadget is a child of a RowColumn widget whose \fBXmNradioBehavior\fP is True, setting the ToggleButtonGadget causes other ToggleButton and ToggleButtonGadget children of the RowColumn to be unselected\&. .PP For a complete definition of ToggleButtonGadget and its associated resources, see \fBXmToggleButtonGadget\fP(3)\&. .SH "RELATED" .PP \fBXmToggleButtonGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmFontListNextEntry.30000644000175000017500000000447712672140200015763 00000000000000'\" t ...\" FontLstV.sgm /main/8 1996/09/08 20:44:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListNextEntry" "library call" .SH "NAME" \fBXmFontListNextEntry\fP \(em A font list function that returns the next entry in a font list .iX "XmFontListNextEntry" .iX "font list functions" "XmFontListNextEntry" .SH "SYNOPSIS" .PP .nf #include \fBXmFontListEntry \fBXmFontListNextEntry\fP\fR( \fBXmFontContext \fBcontext\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListNextEntry\fP returns the next entry in the font list\&. The application uses the \fBXmFontListInitFontContext\fP routine to create a font list context\&. The first call to \fBXmFontListNextEntry\fP sets the context to the first entry in the font list\&. The application then calls \fBXmFontListNextEntry\fP repeatedly with the same context\&. Each succeeding call accesses the next entry of the font list\&. When finished, the application calls \fBXmFontListFreeFontContext\fP to free the allocated font list context\&. .IP "\fIcontext\fP" 10 Specifies the font list context .SH "RETURN" .PP Returns NULL if the context does not refer to a valid entry or if it is at the end of the font list; otherwise, it returns a font list entry\&. If the function does return a font list entry, the font list entry is not a copy\&. Therefore, the application should not free the returned font list entry\&. .SH "RELATED" .PP \fBXmFontList\fP(3), \fBXmFontListEntryFree\fP(3), \fBXmFontListEntryGetFont\fP(3), \fBXmFontListEntryGetTag\fP(3), \fBXmFontListFreeFontContext\fP(3), and \fBXmFontListInitFontContext\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmFileSelectionBoxGetChild.30000644000175000017500000000557012672140200017135 00000000000000'\" t ...\" FileSelB.sgm /main/8 1996/09/08 20:43:02 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFileSelectionBoxGetChild" "library call" .SH "NAME" \fBXmFileSelectionBoxGetChild\fP \(em A FileSelectionBox function used to access a component .iX "XmFileSelectionBoxGetChild" .iX "FileSelectionBox functions" "XmFileSelectionBoxGetChild" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmFileSelectionBoxGetChild\fP\fR( \fBWidget \fBwidget\fR\fR, \fBunsigned char \fBchild\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFileSelectionBoxGetChild\fP is used to access a component within a FileSelectionBox\&. The parameters given to the function are the FileSelectionBox widget and a value indicating which component to access\&. .PP NOTE: This routine is obsolete and exists for compatibility with previous releases\&. Instead of calling \fBXmFileSelectionBoxGetChild\fP, you should call \fBXtNameToWidget\fP as described in the \fBXmFileSelectionBox\fP(3) reference page\&. .IP "\fIwidget\fP" 10 Specifies the FileSelectionBox widget ID\&. .IP "\fIchild\fP" 10 Specifies a component within the FileSelectionBox\&. The following are legal values for this parameter: .RS .IP " \(bu" 6 \fBXmDIALOG_APPLY_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_CANCEL_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_DEFAULT_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_DIR_LIST\fP .IP " \(bu" 6 \fBXmDIALOG_DIR_LIST_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_FILTER_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_FILTER_TEXT\fP .IP " \(bu" 6 \fBXmDIALOG_HELP_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_LIST\fP .IP " \(bu" 6 \fBXmDIALOG_LIST_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_OK_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_SELECTION_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_SEPARATOR\fP .IP " \(bu" 6 \fBXmDIALOG_TEXT\fP .IP " \(bu" 6 \fBXmDIALOG_WORK_AREA\fP .RE .PP For a complete definition of FileSelectionBox and its associated resources, see \fBXmFileSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the specified FileSelectionBox component\&. An application should not assume that the returned widget will be of any particular class\&. .SH "RELATED" .PP \fBXmFileSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmDropSiteStartUpdate.30000644000175000017500000000410112672140200016232 00000000000000'\" t ...\" DropSitW.sgm /main/10 1996/09/08 20:41:58 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteStartUpdate" "library call" .SH "NAME" \fBXmDropSiteStartUpdate\fP \(em A Drag and Drop function that facilitates processing updates to multiple drop sites .iX "XmDropSiteStartUpdate" .iX "Drag and Drop functions" "XmDropSiteStartUpdate" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropSiteStartUpdate\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteStartUpdate\fP is used in conjunction with \fBXmDropSiteEndUpdate\fP to process updates to multiple drop sites within the same shell widget\&. \fBXmDropSiteStartUpdate\fP and \fBXmDropSiteEndUpdate\fP signal the beginning and the end respectively of a series of calls to \fBXmDropSiteUpdate\fP\&. Calls to \fBXmDropSiteStartUpdate\fP and \fBXmDropSiteEndUpdate\fP can be recursively stacked\&. Using these routines optimizes the processing of update information\&. .IP "\fIwidget\fP" 10 Specifies the ID of any widget within a given hierarchy\&. The function uses this widget to identify the shell that contains the drop sites\&. .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RELATED" .PP \fBXmDropSite\fP(3), \fBXmDropSiteEndUpdate\fP(3), and \fBXmDropSiteUpdate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmStringGetLtoR.30000644000175000017500000000451512672140200015040 00000000000000'\" t ...\" StrGeB.sgm /main/8 1996/09/08 21:05:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringGetLtoR" "library call" .SH "NAME" \fBXmStringGetLtoR\fP \(em A compound string function that searches for a text segment in the input compound string .iX "XmStringGetLtoR" .iX "compound string functions" "XmStringGetLtoR" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringGetLtoR\fP\fR( \fBXmString \fBstring\fR\fR, \fBXmStringCharSet \fBtag\fR\fR, \fBchar **\fBtext\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmStringUnparse\fP\&. \fBXmStringGetLtoR\fP returns the first text component in the input compound string that is tagged with the given tag component\&. The returned text is to be a NULL-terminated sequence of single byte characters\&. If the function returns True, the function will allocate space to hold the returned \fItext\fP\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXtFree\fP\&. .IP "\fIstring\fP" 10 Specifies the compound string\&. .IP "\fItag\fP" 10 Specifies the font list element tag associated with the text\&. A value of \fBXmFONTLIST_DEFAULT_TAG\fP identifies a locale text segment\&. .IP "\fItext\fP" 10 Specifies a pointer to a NULL terminated string\&. .SH "RETURN" .PP Returns True if the matching text segment can be found\&. On return, \fItext\fP will have a NULL terminated byte sequence containing the matched segment\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmListAddItemsUnselected.30000644000175000017500000000421712672140200016672 00000000000000'\" t ...\" LstAddID.sgm /main/8 1996/09/08 20:50:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListAddItemsUnselected" "library call" .SH "NAME" \fBXmListAddItemsUnselected\fP \(em A List function that adds items to a list .iX "XmListAddItemsUnselected" .iX "List functions" "XmListAddItemsUnselected" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListAddItemsUnselected\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString *\fBitems\fR\fR, \fBint \fBitem_count\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListAddItemsUnselected\fP adds the specified items to the list at the given position\&. The inserted items remain unselected, even if they currently appear in the \fBXmNselectedItems\fP list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget to add items to\&. .IP "\fIitems\fP" 10 Specifies a pointer to the items to be added to the list\&. .IP "\fIitem_count\fP" 10 Specifies the number of elements in \fIitems\fP\&. This number must be nonnegative\&. .IP "\fIposition\fP" 10 Specifies the position of the first new item in the list\&. A value of 1 makes the first new item the first item in the list; a value of 2 makes it the second item; and so on\&. A value of 0 (zero) makes the first new item follow the last item of the list\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:25 motif-2.3.8/doc/man/man3/XmActivateWMProtocol.30000644000175000017500000000345412672140200016060 00000000000000'\" t ...\" ActivW.sgm /main/8 1996/09/25 10:07:19 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmActivateWMProtocol" "library call" .SH "NAME" \fBXmActivateWMProtocol\fP \(em A VendorShell convenience interface that activates a protocol .iX "XmActivateWMProtocol" .iX "VendorShell functions" "XmActivateWMProtocol" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmActivateWMProtocol\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBprotocol\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmActivateWMProtocol\fP is a convenience interface\&. It calls \fBXmActivateProtocol\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIprotocol\fP" 10 Specifies the protocol \fBAtom\fP .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmActivateProtocol\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveWMProtocols\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmCreateDrawingArea.30000644000175000017500000000353012672140200015635 00000000000000'\" t ...\" CreDrB.sgm /main/7 1996/08/30 14:33:00 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateDrawingArea" "library call" .SH "NAME" \fBXmCreateDrawingArea\fP \(em The DrawingArea widget creation function .iX "XmCreateDrawingArea" .iX "creation functions" "XmCreateDrawingArea" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateDrawingArea\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateDrawingArea\fP creates an instance of a DrawingArea widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of DrawingArea and its associated resources, see \fBXmDrawingArea\fP(3)\&. .SH "RETURN" .PP Returns the DrawingArea widget ID\&. .SH "RELATED" .PP \fBXmDrawingArea\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmClipboardLock.30000644000175000017500000000575212672140200015045 00000000000000'\" t ...\" ClipbJ.sgm /main/10 1996/09/25 10:24:43 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardLock" "library call" .SH "NAME" \fBXmClipboardLock\fP \(em A clipboard function that locks the clipboard .iX "XmClipboardLock" .iX "clipboard functions" "XmClipboardLock" .SH "SYNOPSIS" .PP .nf #include int XmClipboardLock (\fIdisplay, window\fP) Display \fI* display\fP; Window \fIwindow\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardLock\fP locks the clipboard from access by another application until \fBXmClipboardUnlock\fP is called\&. All clipboard functions lock and unlock the clipboard to prevent simultaneous access\&. This function allows the application to keep the clipboard data from changing between calls to \fBInquire\fP and other clipboard functions\&. The application does not need to lock the clipboard between calls to \fBXmClipboardStartCopy\fP and \fBXmClipboardEndCopy\fP or to \fBXmClipboardStartRetrieve\fP and \fBXmClipboardEndRetrieve\fP\&. .PP If the clipboard is already locked by another application, \fBXmClipboardLock\fP returns an error status\&. Multiple calls to this function by the same application increase the lock level\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardEndCopy\fP(3), \fBXmClipboardEndRetrieve\fP(3), \fBXmClipboardStartCopy\fP(3), \fBXmClipboardStartRetrieve\fP(3), and \fBXmClipboardUnlock\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmIconBox.30000644000175000017500000001703112672140200013667 00000000000000.DT .TH XmIconBox 3X "" .SH NAME \fBXmIconBox\fP \(em The IconBox widget class .SH SYNOPSIS .nf #include .fi .SH DESCRIPTION .PP The Icon Box widget lays out its children on a grid with each child forced to be the same size and with the location of each child specified as an X and Y location on the grid. .PP The size of the Icon Box, its children, and the number of cells displayed are calculated as described below. The general idea is that all children are always be shown and should be given their desired size whenever possible. The user may add or delete cells by resizing this window using the window manager widget. .PP The preferred size is calculated by using the maximum desired child height or width and making sure that these are no smaller than the minimum sizes. This size is multiplied by the number of cells along the axis and properly padded to come up with a preferred size. The number of cells is the maximum of the largest cellX or cellY value and the minimum number of horizontal or vertical cells\&. .PP If the Icon box is forced larger than its preferred size more cells are added at the bottom-right of the widget while the children all remain at their preferred sizes\&. .PP If the Icon box is forced smaller than its preferred size each cell is forced to be smaller in order to allow all children to fit within the Icon Box. All children will be forced to the same smaller size. .SS "Classes" .PP Icon Box inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP\&. .PP The class pointer is \fBxmIconBoxWidgetClass\fP\&. .PP The class name is \fBXmIconBox\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmIconBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNhorizontalMarginXmCMarginDimension4CSG _____ XmNminimumHorizontalCellsXmCDefaultCellsint8CSG _____ XmNminimumVerticalCellsXmCDefaultCellsint4CSG _____ XmNminimumCellHeightXmCMinimumCellSizeDimension10CSG _____ XmNminimumCellWidthXmCMinimumCellSizeDimension20CSG _____ XmNverticalMarginXmCMarginDimension4CSG _____ .TE .IP "\fBXmNhorizontalMargin\fP" 10 .IP "\fBXmNverticalMargin\fP" 10 The amount of space between each cell and its neighbor or the edge of the Icon Box. .IP "\fBXmNminimumHorizontalCells\fP" 10 .IP "\fBXmNminimumVerticalCells\fP" 10 The minimum number of cells to display in the horizontal and vertical directions. This number of cells will always be displayed. .IP "\fBXmNminimumCellWidth\fP" 10 .IP "\fBXmNminimumCellHeight\fP" 10 The smallest size the cells are allowed to be in the direction specified. .PP .SS "Constraint Resources" .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmIconBox Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNcellXXmCCellXShortXmIconBoxAnyCellCSG _____ XmNcellYXmCCellYShortXmIconBoxAnyCellCSG _____ .TE .IP "\fBXmNcellX\fP" 10 .IP "\fBXmNcellY\fP" 10 The location of this cell in cell space. These coordinates may be any positive integer. They determine where this widget will be placed relative to its neighbors. Having two children at the same cell X and cell Y location will result in undefined behavior. To place a cell at any empty cell, set cell X and cell Y to the value XmIconBoxAnyCell. .SS "Inherited Resources" .PP Icon Box inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP XmIconBox inherits translations from XmManager\&. .PP .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateIconBox\fP(3), \fBXmIconBoxIsCellEmpty\fP(3), \fBXmManager\fP(3), \fBXmVaCreateIconBox\fP(3), and \fBXmVaCreateManagedIconBox\fP(3)\&. .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmVaCreateManagedMultiList.30000644000175000017500000000003712672140200017142 00000000000000.so man3/XmVaCreateMultiList.3 motif-2.3.8/doc/man/man3/XmCommandError.30000644000175000017500000000314512672140200014717 00000000000000'\" t ...\" CommEr.sgm /main/8 1996/09/08 20:30:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCommandError" "library call" .SH "NAME" \fBXmCommandError\fP \(em A Command function that displays an error message .iX "XmCommandError" .iX "Command functions" "XmCommandError" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmCommandError\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBerror\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCommandError\fP displays an error message in the history area of the Command widget\&. The \fBXmString\fR error is displayed until the next command entered occurs\&. .IP "\fIwidget\fP" 10 Specifies the Command widget ID .IP "\fIerror\fP" 10 Specifies the passed \fBXmString\fR .PP For a complete definition of Command and its associated resources, see \fBXmCommand\fP(3)\&. .SH "RELATED" .PP \fBXmCommand\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmGetXmScreen.30000644000175000017500000000316412672140200014514 00000000000000'\" t ...\" GetXmScr.sgm /main/8 1996/09/08 20:47:05 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetXmScreen" "library call" .SH "NAME" \fBXmGetXmScreen\fP \(em A Screen function that returns the XmScreen object ID for a specified screen .iX "XmGetXmScreen" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetXmScreen\fP\fR( \fBScreen *\fBscreen\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetXmScreen\fP returns the \fBXmScreen\fP object ID associated with a screen\&. The application can access and manipulate Screen resources with \fBXtGetValues\fP and \fBXtSetValues\fP\&. .IP "\fIscreen\fP" 10 Specifies the screen for which the \fBXmScreen\fP ID is to be returned .PP For a complete definition of Screen and its associated resources, see \fBXmScreen\fP(3)\&. .SH "RETURN" .PP Returns the \fBXmScreen\fP object ID\&. .SH "RELATED" .PP \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmGetTearOffControl.30000644000175000017500000000512312672140200015654 00000000000000'\" t ...\" GetTearO.sgm /main/7 1996/08/30 15:29:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetTearOffControl" "library call" .SH "NAME" \fBXmGetTearOffControl\fP \(em A RowColumn function that obtains the widget ID for the tear-off control in a menu .iX "XmGetTearOffControl" .iX "RowColumn functions" "XmGetTearOffControl" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetTearOffControl\fP\fR( \fBWidget \fBmenu\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetTearOffControl\fP provides the application with the means for obtaining the widget ID of the internally created tear-off control in a tear-off menu\&. .PP RowColumn creates a tear-off control for a PulldownMenu or PopupMenu when the \fBXmNtearOffModel\fP resource is initialized or set to \fBXmTEAR_OFF_ENABLED\fP\&. The tear-off control is a widget that appears as the first element in the menu\&. The user tears off the menu by means of mouse or keyboard events in the tear-off control\&. .PP The tear-off control has Separator-like behavior\&. Once the application has obtained the widget ID of the tear-off control, it can set resources to specify the appearance of the control\&. The application or user can also set these resources in a resource file by using the name of the control, which is \fBTearOffControl\fP\&. For a list of the resources the application or user can set, see \fBXmRowColumn\fP(3)\&. .IP "\fImenu\fP" 10 Specifies the widget ID of the RowColumn PulldownMenu or PopupMenu .PP For more information on tear-off menus and a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the widget ID for the tear-off control, or NULL if no tear-off control exists\&. An application should not assume that the returned widget will be of any particular class\&. .SH "RELATED" .PP \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmTabListInsertTabs.30000644000175000017500000000556112672140200015674 00000000000000'\" t ...\" TabLstIn.sgm /main/8 1996/09/08 21:09:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabListInsertTabs" "library call" .SH "NAME" \fBXmTabListInsertTabs\fP \(em A convenience function that inserts tabs into a tab list .iX "XmTabListInsertTabs" .SH "SYNOPSIS" .PP .nf #include \fBXmTabList \fBXmTabListInsertTabs\fP\fR( \fBXmTabList \fBoldlist\fR\fR, \fBXmTab \fB*tabs\fR\fR, \fBCardinal \fBtab_count\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabListInsertTabs\fP creates a new tab list that includes the tabs in \fIoldlist\fP\&. This function copies specified tabs to the tab list at the given position\&. The first \fItab_count\fP tabs of the \fItabs\fP array are added to the tab list\&. If \fIoldlist\fP is NULL, \fBXmTabListInsertTabs\fP creates a new tab list containing only the tabs specified\&. .IP "\fIoldlist\fP" 10 Specifies the tab list to add the tabs to\&. The function deallocates \fIoldlist\fP after extracting the required information\&. .IP "\fItabs\fP" 10 Specifies a pointer to the tabs to be added to the tab list\&. It is the caller\&'s responsibility to free the tabs in \fItabs\fP by using \fBXmTabFree\fP\&. .IP "\fItab_count\fP" 10 Specifies the number of tabs in \fItabs\fP\&. .IP "\fIposition\fP" 10 Specifies the position of the first new tab in the tab list\&. A value of 0 (zero) makes the first new tab the first tab in the tab list, a value of 1 makes it the second tab, and so on\&. If \fIposition\fP is greater than the number of tabs in \fIoldlist\fP, then the tabs will be inserted at the end\&. If \fIposition\fP is negative, the count will be backwards from the end\&. A value of -1 makes the first new tab the last tab, and so on\&. .SH "RETURN" .PP If \fItabs\fP is NULL or \fItab_count\fP is 0 (zero), this function returns \fIoldlist\fP\&. Otherwise, it returns a new tab list\&. The function allocates space to hold the returned tab list\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmTabListFree\fP\&. .SH "RELATED" .PP \fBXmTabList\fP(3) and \fBXmTabListFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmVaCreateDropDown.30000644000175000017500000000267312672140200015503 00000000000000.DT .TH "XmVaCreateDropDown" "library call" .SH "NAME" \fBXmVaCreateDropDown\fP, \fBXmVaCreateManagedDropDown\fP \(em A DropDown widget convenience creation functions\&. .iX "XmVaCreateDropDown" "XmVaCreateManagedDropDown" .iX "creation functions" "XmVaCreateDropDown" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateDropDown\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedDropDown\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a DropDown widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateDropDown\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedDropDown\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of DropDown and its associated resources, see \fBXmDropDown\fP(3)\&. .SH "RETURN" .PP Returns the DropDown widget ID\&. .SH "RELATED" .PP \fBXmDropDown\fP(3), \fBXmCreateDropDown\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextSetString.30000644000175000017500000000415012672140200015113 00000000000000'\" t ...\" TxtSetSC.sgm /main/8 1996/09/08 21:20:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetString" "library call" .SH "NAME" \fBXmTextSetString\fP \(em A Text function that sets the string value .iX "XmTextSetString" .iX "Text functions" "XmTextSetString" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetString\fP\fR( \fBWidget \fBwidget\fR\fR, \fBchar \fB* value\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetString\fP sets the string value of the Text widget\&. This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. This function also sets the insertion cursor position to the beginning of the string and calls the widget\&'s \fBXmNmotionVerifyCallback\fP callbacks\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fIvalue\fP" 10 Specifies the character pointer to the string value and places the string into the text edit window .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextSetStringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmTextFieldReplaceWcs.30000644000175000017500000000553112672140200016171 00000000000000'\" t ...\" TxtFieAY.sgm /main/8 1996/09/08 21:15:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldReplaceWcs" "library call" .SH "NAME" \fBXmTextFieldReplaceWcs\fP \(em A TextField function that replaces part of a wide character string in a TextField widget .iX "XmTextFieldReplaceWcs" .iX "TextField functions" "XmTextFieldReplaceWcs" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldReplaceWcs\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBfrom_pos\fR\fR, \fBXmTextPosition \fBto_pos\fR\fR, \fBwchar_t *\fBwcstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldReplaceWcs\fP replaces part of the wide character string in the TextField widget\&. The character positions begin at 0 (zero) and are numbered sequentially from the beginning of the text\&. .PP An example text replacement would be to replace the second and third characters in the text string\&. To accomplish this, the parameter \fIfrom_pos\fP must be 1 and \fIto_pos\fP must be 3\&. To insert a string after the fourth character, both parameters, \fIfrom_pos\fP and \fIto_pos\fP, must be 4\&. .PP This routine calls the widget\&'s \fBXmNvalueChangedCallback\fP and verification callbacks, either \fBXmNmodifyVerifyCallback\fP or \fBXmNmodifyVerifyCallbackWcs\fP, or both\&. If both verification callback lists are registered, the procedures of the \fBXmNmodifyVerifyCallback\fP list are executed first and the resulting data is passed to the \fBXmNmodifyVerifyCallbackWcs\fP callbacks\&. If the \fBXmNcursorPosition\fP resource is greater than or is the same value as \fIfrom_pos\fP, the \fBXmNmotionVerifyCallback\fP is called\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIfrom_pos\fP" 10 Specifies the start position of the text to be replaced .IP "\fIto_pos\fP" 10 Specifies the end position of the text to be replaced .IP "\fIwcstring\fP" 10 Specifies the wide character string value to be added to the TextField widget .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3) and \fBXmTextFieldReplace\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmTextSetMaxLength.30000644000175000017500000000400012672140200015526 00000000000000'\" t ...\" TxtSetMa.sgm /main/8 1996/09/08 21:19:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetMaxLength" "library call" .SH "NAME" \fBXmTextSetMaxLength\fP \(em A Text function that sets the value of the current maximum allowable length of a text string entered from the keyboard .iX "XmTextSetMaxLength" .iX "Text functions" "XmTextSetMaxLength" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetMaxLength\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBmax_length\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetMaxLength\fP sets the value of the current maximum allowable length of the text string in the Text widget\&. The maximum allowable length prevents the user from entering a text string from the keyboard that is larger than this limit\&. Strings that are entered using the \fBXmNvalue\fP (or \fBXmNvalueWcs\fP) resource, or the \fBXmTextSetString\fP (or \fBXmTextSetStringWcs\fP) function ignore this resource\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fImax_length\fP" 10 Specifies the maximum allowable length of the text string .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3), \fBXmTextSetString\fP(3), and \fBXmTextSetStringWcs\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmStringSegmentCreate.30000644000175000017500000000501212672140200016237 00000000000000'\" t ...\" StrSeg.sgm /main/8 1996/09/08 21:07:02 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringSegmentCreate" "library call" .SH "NAME" \fBXmStringSegmentCreate\fP \(em A compound string function that creates a compound string .iX "XmStringSegmentCreate" .iX "compound string functions" "XmStringSegmentCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmString \fBXmStringSegmentCreate\fP\fR( \fBchar \fB* text\fR\fR, \fBXmStringTag \fBtag\fR\fR, \fBXmStringDirection \fBdirection\fR\fR, \fBBoolean \fBseparator\fR\fR); .fi .SH "DESCRIPTION" .PP This function is obsolete and exists for compatibility with previous releases\&. It can be replaced by using a combination of \fBXmStringComponentCreate\fP and \fBXmStringConcat\fP\&. \fBXmStringSegmentCreate\fP is a high-level function that assembles a compound string consisting of a font list element tag, a direction component, a text component, and an optional separator component\&. .PP The function allocates space for the returned compound string\&. The application is responsible for managing the allocated space\&. The application can recover the allocated space by calling \fBXmStringFree\fP\&. .IP "\fItext\fP" 10 Specifies a NULL-terminated string to be used as the text component of the compound string\&. .IP "\fItag\fP" 10 Specifies the tag component to be associated with the text\&. The value \fBXmFONTLIST_DEFAULT_TAG\fP is for compatibility with previous releases\&. .IP "\fIdirection\fP" 10 Specifies the direction of the text\&. .IP "\fIseparator\fP" 10 A value of False means the compound string does not have a separator at the end\&. A value of True, means a separator immediately follows the text component\&. .SH "RETURN" .PP Returns a new compound string\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmVaCreateManagedDrawnButton.30000644000175000017500000000004112672140200017456 00000000000000.so man3/XmVaCreateDrawnButton.3 motif-2.3.8/doc/man/man3/XmVaCreateMessageBox.30000644000175000017500000000274412672140200016003 00000000000000.DT .TH "XmVaCreateMessageBox" "library call" .SH "NAME" \fBXmVaCreateMessageBox\fP, \fBXmVaCreateManagedMessageBox\fP \(em A MessageBox widget convenience creation functions\&. .iX "XmVaCreateToggleMessageBox" "XmVaCreateManagedMessageBox" .iX "creation functions" "XmVaCreateMessageBox" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateMessageBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedMessageBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateMessageBox\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateMessageBox\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3), \fBXmCreateMessageBox\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCvtStringToUnitType.30000644000175000017500000000436512672140200016264 00000000000000'\" t ...\" CvtStr.sgm /main/10 1996/09/08 20:37:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCvtStringToUnitType" "library call" .SH "NAME" \fBXmCvtStringToUnitType\fP \(em A function that converts a string to a unit-type value .iX "XmCvtStringToUnitType" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmCvtStringToUnitType\fP\fR( \fBXrmValuePtr \fBargs\fR\fR, \fBCardinal \fB* num_args\fR\fR, \fBXrmValue \fB* from_val\fR\fR, \fBXrmValue \fB* to_val\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCvtStringToUnitType\fP converts a string to a unit type\&. Refer to the reference pages for \fBXmGadget\fP, \fBXmManager\fP, or \fBXmPrimitive\fP for a description of the valid unit types\&. Use of this function as a resource converter is obsolete\&. It has been replaced by a new resource converter that uses the RepType facility\&. .IP "\fIargs\fP" 10 Specifies a list of additional \fBXrmValue\fP arguments to the converter if additional context is needed to perform the conversion\&. For example, the string-to-font converter needs the widget\&'s screen and the string-to-pixel converter needs the widget\&'s screen and color map\&. This argument is often NULL\&. .IP "\fInum_args\fP" 10 Specifies the number of additional \fBXrmValue\fP arguments\&. This argument is often zero\&. .IP "\fIfrom_val\fP" 10 Specifies the value to convert .IP "\fIto_val\fP" 10 Specifies the descriptor to use to return the converted value .SH "RELATED" .PP \fBXmGadget\fP(3), \fBXmManager\fP(3), and \fBXmPrimitive\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmImFreeXIC.30000644000175000017500000000334112672140200014040 00000000000000'\" t ...\" ImFrXIC.sgm /main/7 1996/08/30 15:31:49 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmImFreeXIC" "library call" .SH "NAME" \fBXmImFreeXIC\fP \(em An input manager function that unregisters widgets for an XIC .iX "XmImFreeXIC" .iX "input manager functions" "XmImFreeXIC" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmImFreeXIC\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXIC \fBxic\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmImFreeXIC\fP unregisters all widgets associated with the specified X Input Context (XIC)\&. The specified \fIwidget\fP must be associated with the specified \fIxic\fP\&. .PP After unregistering the associated widgets, this call frees the \fIxic\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of a widget used to identify the \fBVendorShell\fP and \fBXmDisplay\fP that maintain the widget-XIC registry\&. .IP "\fIxic\fP" 10 Specifies the Input Context associated with the widget\&. .SH "RELATED" .PP \fBXmImGetXIC\fP(3) and \fBXmImSetXIC\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmStringDirection.30000644000175000017500000000324012672140200015432 00000000000000'\" t ...\" StrDiA.sgm /main/7 1996/08/30 16:09:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringDirection" "library call" .SH "NAME" \fBXmStringDirection\fR \(em Data type for the direction of display in a string .iX "XmStringDirection" .iX "data types" "XmStringDirection" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmStringDirection\fR is the data type for specifying the direction in which the system displays characters of a string, or characters of a segment of a compound string\&. This is an enumeration with three possible values: .IP "\fBXmSTRING_DIRECTION_L_TO_R\fP" 10 Specifies left to right display .IP "\fBXmSTRING_DIRECTION_R_TO_L\fP" 10 Specifies right to left display .IP "\fBXmSTRING_DIRECTION_DEFAULT\fP" 10 Specifies that the display direction will be set by the widget in which the compound string is to be displayed\&. .SH "RELATED" .PP \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmRenderTableGetRenditions.30000644000175000017500000000444312672140200017217 00000000000000'\" t ...\" RendTaH.sgm /main/9 1996/09/08 20:57:44 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableGetRenditions" "library call" .SH "NAME" \fBXmRenderTableGetRenditions\fP \(em A convenience function that matches rendition tags .iX "XmRenderTableGetRenditions" .SH "SYNOPSIS" .PP .nf #include \fBXmRendition \fB*XmRenderTableGetRenditions\fP\fR( \fBXmRenderTable \fBtable\fR\fR, \fBXmStringTag \fB*tags\fR\fR, \fBCardinal \fBtag_count\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableGetRenditions\fP searches \fItable\fP and returns an array of copies of the renditions whose \fBXmNtag\fP resources match a tag in \fItags\fP\&. If no renditions match, then NULL is returned\&. The size of the returned array is \fItag_count\fP\&. The \fBXmNtag\fP resource of each rendition will match the corresponding tag in \fItags\fP\&. If no match is found for a particular tag, the corresponding slot in the return value will be NULL\&. .PP It is the responsibility of the caller to call the \fBXmRenditionFree\fP function to free the new renditions, and the \fBXtFree\fP function to free the array\&. .IP "\fItable\fP" 10 Specifies the table containing renditions to be searched\&. .IP "\fItags\fP" 10 Specifies the tags to search for\&. .IP "\fItag_count\fP" 10 Specifies the number of tags in \fItags\fP\&. .SH "RETURN" .PP Returns NULL if there is no match; otherwise, this function returns an array of new \fBXmRendition\fRs\&. .SH "RELATED" .PP \fBXmRenderTableGetRendition\fP(3), \fBXmRenderTableGetTags\fP(3), and \fBXmRendition\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmTextSetTopCharacter.30000644000175000017500000000407212672140200016227 00000000000000'\" t ...\" TxtSetTo.sgm /main/8 1996/09/08 21:20:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextSetTopCharacter" "library call" .SH "NAME" \fBXmTextSetTopCharacter\fP \(em A Text function that sets the position of the first character displayed .iX "XmTextSetTopCharacter" .iX "Text functions" "XmTextSetTopCharacter" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextSetTopCharacter\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fBtop_character\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextSetTopCharacter\fP sets the position of the text at the top of the Text widget\&. If the \fBXmNeditMode\fP is \fBXmMULTI_LINE_EDIT\fP, the line of text that contains \fItop_character\fP is displayed at the top of the widget without the text shifting left or right\&. If the edit mode is \fBXmSINGLE_LINE_EDIT\fP, the text moves horizontally so that \fItop_character\fP is the first character displayed\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .IP "\fItop_character\fP" 10 Specifies the position in the text to display at the top of the widget\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:36 motif-2.3.8/doc/man/man3/XmTabCreate.30000644000175000017500000000535512672140200014166 00000000000000'\" t ...\" TabCre.sgm /main/8 1996/09/08 21:08:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabCreate" "library call" .SH "NAME" \fBXmTabCreate\fP \(em A convenience function that creates a tab stop .iX "XmTabCreate" .SH "SYNOPSIS" .PP .nf #include \fBXmTab \fBXmTabCreate\fP\fR( \fBfloat \fBvalue\fR\fR, \fBunsigned char \fBunits\fR\fR, \fBXmOffsetModel \fBoffset_model\fR\fR, \fBunsigned char \fBalignment\fR\fR, \fBchar \fB*decimal\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabCreate\fP creates a tab stop at a position defined by the \fIvalue\fP and \fIunits\fP arguments\&. .IP "\fIvalue\fP" 10 Specifies the floating point value to be used in conjunction with \fIunits\fP to calculate the location of the tab stop\&. Note that negative values are not permitted\&. .IP "\fIunits\fP" 10 Specifies the unit type (for example, \fBXmMILLIMETERS\fP) to be used in conjunction with \fIvalue\fP to calculate the location of the tab stop\&. You can specify any unit described by the \fBXmConvertUnits\fP reference page\&. For resources of type, dimension, or position, you can specify units as described in the \fBXmNunitType\fP resource of the \fBXmGadget\fP, \fBXmManager\fP, or \fBXmPrimitive\fP reference page\&. .IP "\fIoffset_model\fP" 10 Specifies whether the tab value represents an absolute position or a relative offset from the previous tab\&. Valid values are \fBXmABSOLUTE\fP and \fBXmRELATIVE\fP\&. .IP "\fIalignment\fP" 10 Specifies how the text should be aligned relative to this tab stop\&. Valid values are \fBXmALIGNMENT_BEGINNING\fP\&. .IP "\fIdecimal\fP" 10 Specifies the multibyte character in the current language environment to be used as the decimal point for a decimal aligned tab stop\&. This is currently unused\&. .SH "RETURN" .PP Returns a newly allocated \fBXmTab\fR\&. The application is responsible for managing this allocated space\&. The application can recover this allocated space by calling \fBXmTabFree\fP\&. .SH "RELATED" .PP \fBXmTab\fP(3) and \fBXmTabFree\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmListReplaceItems.30000644000175000017500000000456412672140200015546 00000000000000'\" t ...\" LstReplA.sgm /main/8 1996/09/08 20:51:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListReplaceItems" "library call" .SH "NAME" \fBXmListReplaceItems\fP \(em A List function that replaces the specified elements in the list .iX "XmListReplaceItems" .iX "List functions" "XmListReplaceItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListReplaceItems\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString *\fBold_items\fR\fR, \fBint \fBitem_count\fR\fR, \fBXmString *\fBnew_items\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListReplaceItems\fP replaces each specified item of the list with a corresponding new item\&. When the items are inserted into the list, they are compared with the current \fBXmNselectedItems\fP list\&. If any of the new items matches an item on the selected list, it appears selected\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIold_items\fP" 10 Specifies the items to be replaced\&. .IP "\fIitem_count\fP" 10 Specifies the number of items in \fIold_items\fP and \fInew_items\fP\&. This number must be nonnegative\&. .IP "\fInew_items\fP" 10 Specifies the replacement items\&. .PP Every occurrence of each element of \fIold_items\fP is replaced with the corresponding element from \fInew_items\fP\&. That is, the first element of \fIold_items\fP is replaced with the first element of \fInew_items\fP\&. The second element of \fIold_items\fP is replaced with the second element of \fInew_items\fP, and so on until \fIitem_count\fP is reached\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmVaCreateExt18List.30000644000175000017500000000265512672140200015514 00000000000000.DT .TH "XmVaCreateExt18List" "library call" .SH "NAME" \fBXmVaCreateExt18List\fP, \fBXmVaCreateManagedExt18List\fP \(em A Form widget convenience creation functions\&. .iX "XmVaCreateExt18List" "XmVaCreateManagedExt18List" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateExt18List\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedExt18List\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a Ext18List widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateExt18List\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedExt18List\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Form and its associated resources, see \fBXmExt18List\fP(3)\&. .SH "RETURN" .PP Returns the Ext18List widget ID\&. .SH "RELATED" .PP \fBXmCreateExt18List\fP(3), \fBXtCreateManagedWidget\fP(3), \fBXtCreateWidget\fP(3), and \fBXmExt18List\fP(3)\&. motif-2.3.8/doc/man/man3/XmClipboardStartCopy.30000644000175000017500000001442012672140200016075 00000000000000'\" t ...\" ClipbM.sgm /main/10 1996/09/25 10:25:05 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardStartCopy" "library call" .SH "NAME" \fBXmClipboardStartCopy\fP \(em A clipboard function that sets up a storage and data structure .iX "XmClipboardStartCopy" .iX "clipboard functions" "XmClipboardStartCopy" .SH "SYNOPSIS" .PP .nf #include int XmClipboardStartCopy (\fIdisplay, window, clip_label, timestamp, widget, callback, item_id\fP) Display \fI* display\fP; Window \fIwindow\fP; XmString \fIclip_label\fP; Time \fItimestamp\fP; Widget \fIwidget\fP; XmCutPasteProc \fIcallback\fP; long \fI* item_id\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardStartCopy\fP sets up storage and data structures to receive clipboard data\&. An application calls this function during a cut or copy operation\&. The data item that these structures receive then becomes the next data item in the clipboard\&. .PP Copying a large piece of data to the clipboard can take a long time\&. It is possible that, once the data is copied, no application will ever request that data\&. The Motif Toolkit provides a mechanism so that an application does not need to actually pass data to the clipboard until the data has been requested by some application\&. .PP Instead, the application passes format and length information in \fBXmClipboardCopy\fP to the clipboard functions, along with a widget ID and a callback function address that is passed in \fBXmClipboardStartCopy\fP\&. The widget ID is necessary for communications between the clipboard functions in the application that owns the data and the clipboard functions in the application that requests the data\&. .PP The callback functions are responsible for copying the actual data to the clipboard through \fBXmClipboardCopyByName\fP\&. The callback function is also called if the data item is removed from the clipboard and the actual data is no longer needed\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIclip_label\fP" 10 Specifies the label to be associated with the data item\&. This argument is used to identify the data item, as in a clipboard viewer\&. An example of a label is the name of the application that places the data in the clipboard\&. .IP "\fItimestamp\fP" 10 Specifies the time of the event that triggered the copy\&. A valid timestamp must be supplied; it is not sufficient to use \fBCurrentTime\fP\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget that receives messages requesting data previously passed by name\&. This argument must be present in order to pass data by name\&. Any valid widget ID in your application can be used for this purpose and all the message handling is taken care of by the cut and paste functions\&. .IP "\fIcallback\fP" 10 Specifies the address of the callback function that is called when the clipboard needs data that was originally passed by name\&. This is also the callback to receive the \fIdelete\fP message for items that were originally passed by name\&. This argument must be present in order to pass data by name\&. .IP "\fIitem_id\fP" 10 Specifies the number assigned to this data item\&. The application uses this number in calls to \fBXmClipboardCopy\fP, \fBXmClipboardEndCopy\fP, and \fBXmClipboardCancelCopy\fP\&. .PP For more information on passing data by name, see \fBXmClipboardCopy\fP(3) and \fBXmClipboardCopyByName\fP(3)\&. .PP The \fIwidget\fP and \fIcallback\fP arguments must be present in order to pass data by name\&. The callback format is as follows: .PP .nf void (*\fIcallback)\fP (\fIwidget, data_id, private, reason\fP) Widget \fIwidget\fP; long *\fIdata_id\fP; long *\fIprivate\fP; int *\fIreason\fP; \fB\fR(\fBvoid\fR) .fi .IP "\fIwidget\fP" 10 Specifies the ID of the widget passed to this function\&. .IP "\fIdata_id\fP" 10 Specifies the identifying number returned by \fBXmClipboardCopy\fP, which identifies the pass-by-name data\&. .IP "\fIprivate\fP" 10 Specifies the private information passed to \fBXmClipboardCopy\fP\&. .IP "\fIreason\fP" 10 Specifies the reason\&. \fBXmCR_CLIPBOARD_DATA_DELETE\fP or \fBXmCR_CLIPBOARD_DATA_REQUEST\fP are the possible values\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .SH "RELATED" .PP \fBXmClipboardCancelCopy\fP(3), \fBXmClipboardCopy\fP(3), \fBXmClipboardCopyByName\fP(3), \fBXmClipboardEndCopy\fP(3), \fBXmClipboardEndRetrieve\fP(3), \fBXmClipboardInquireCount\fP(3), \fBXmClipboardInquireFormat\fP(3), \fBXmClipboardInquireLength\fP(3), \fBXmClipboardInquirePendingItems\fP(3), \fBXmClipboardLock\fP(3), \fBXmClipboardRegisterFormat\fP(3), \fBXmClipboardRetrieve\fP(3), \fBXmClipboardStartRetrieve\fP(3), \fBXmClipboardUndoCopy\fP(3), \fBXmClipboardUnlock\fP(3), and \fBXmClipboardWithdrawFormat\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmVaCreateDataField.30000644000175000017500000000266312672140200015563 00000000000000.DT .TH "XmVaCreateDataField" "library call" .SH "NAME" \fBXmVaCreateDataField\fP, \fBXmVaCreateManagedDataField\fP \(em A DataField widget convenience creation functions\&. .iX "XmVaCreateDataField" "XmVaCreateManagedDataField" .iX "creation functions" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateDataField\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedDataField\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a DataField widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateDataField\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateManagedDataField\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP Returns the DataField widget ID\&. .SH "RELATED" .PP \fBXmDataField\fP(3), \fBXmCreateDataField\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmComboBoxDeletePos.30000644000175000017500000000345012672140200015643 00000000000000'\" t ...\" ComboDel.sgm /main/5 1996/08/30 14:17:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmComboBoxDeletePos" "library call" .SH "NAME" \fBXmComboBoxDeletePos\fP \(em Delete a XmComboBox item .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmComboBoxDeletePos\fP\fR( \fBWidget \fBw\fR\fR, \fBint \fBpos\fR\fR); .fi .SH "DESCRIPTION" .PP The \fBXmComboBoxDeletePos\fP function deletes a specified item from a XmComboBox widget\&. .PP The \fIw\fP argument specifies the XmComboBox widget ID\&. .PP The \fIpos\fP argument specifies the position of the item to be deleted\&. .SH "RETURN VALUE" .PP The \fBXmComboBoxDeletePos\fP function returns no value\&. .SH "APPLICATION USAGE" .PP The functions \fBXmComboBoxAddItem\fP and \fBXmComboBoxDeletePos\fP have different naming conventions (Item versus Pos) because of the objects they are manipulating\&. The Item is a string to be added, the Pos is a numeric position number\&. .SH "SEE ALSO" .PP \fBXmComboBoxAddItem\fP(3), \fBXmComboBoxSetItem\fP(3), \fBXmComboBoxSelectItem\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmTextGetEditable.30000644000175000017500000000304512672140200015344 00000000000000'\" t ...\" TxtGetEd.sgm /main/7 1996/08/30 16:28:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetEditable" "library call" .SH "NAME" \fBXmTextGetEditable\fP \(em A Text function that accesses the edit permission state .iX "XmTextGetEditable" .iX "Text functions" "XmTextGetEditable" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextGetEditable\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetEditable\fP accesses the edit permission state of the Text widget\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns a Boolean value that indicates the state of the \fBXmNeditable\fP resource\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmCreateInformationDialog.30000644000175000017500000000465512672140200017067 00000000000000'\" t ...\" CreInf.sgm /main/7 1996/08/30 14:39:29 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateInformationDialog" "library call" .SH "NAME" \fBXmCreateInformationDialog\fP \(em The MessageBox InformationDialog convenience creation function .iX "XmCreateInformationDialog" .iX "creation functions" "XmCreateInformationDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateInformationDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateInformationDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged MessageBox child of the DialogShell\&. An InformationDialog gives the user information, such as the status of an action\&. It includes a symbol, a message, and three buttons\&. The default symbol is \fBi\fP\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. .PP Use \fBXtManageChild\fP to pop up the InformationDialog (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateInformationDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmCreateArrowButton.30000644000175000017500000000352712672140200015745 00000000000000'\" t ...\" CreArA.sgm /main/7 1996/08/30 14:27:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateArrowButton" "library call" .SH "NAME" \fBXmCreateArrowButton\fP \(em The ArrowButton widget creation function .iX "XmCreateArrowButton" .iX "creation functions" "XmCreateArrowButton" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateArrowButton\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateArrowButton\fP creates an instance of an ArrowButton widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of ArrowButton and its associated resources, see \fBXmArrowButton\fP(3)\&. .SH "RETURN" .PP Returns the ArrowButton widget ID\&. .SH "RELATED" .PP \fBXmArrowButton\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmFontListGetNextFont.30000644000175000017500000000563512672140200016225 00000000000000'\" t ...\" FontLstT.sgm /main/8 1996/09/08 20:44:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListGetNextFont" "library call" .SH "NAME" \fBXmFontListGetNextFont\fP \(em A font list function that allows applications to access the fonts and character sets in a font list .iX "XmFontListGetNextFont" .iX "font list functions" "XmFontListGetNextFont" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmFontListGetNextFont\fP\fR( \fBXmFontContext \fBcontext\fR\fR, \fBXmStringCharSet *\fBcharset\fR\fR, \fBXFontStruct **\fBfont\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListGetNextFont\fP accesses the character set and font for the next entry of the font list\&. The application first uses the \fBXmFontListInitFontContext\fP routine to create a font list context\&. The application then calls \fBXmFontListGetNextFont\fP repeatedly with the same context\&. Each succeeding call accesses the next element of the font list\&. When finished, the application calls \fBXmFontListFreeFontContext\fP to free the allocated font list context\&. .PP This routine allocates memory for the character set string that must be freed by the application\&. The function allocates memory for \fIcharset\fP\&. The application is responsible for managing the allocated memory\&. The application can recover the allocated memory by calling \fBXtFree\fP\&. .PP This function is obsolete and exists for compatibility with previous releases\&. It is replaced by \fBXmFontListNextEntry\fP\&. If \fBXmFontListGetNextFont\fP is passed a context that contains a font set entry, it will return the first font of the font set\&. The next call to the function will move to the next entry in the font list\&. .IP "\fIcontext\fP" 10 Specifies the font list context .IP "\fIcharset\fP" 10 Specifies a pointer to a character set string; the routine returns the character set for the current font list element .IP "\fIfont\fP" 10 Specifies a pointer to a pointer to a font structure; the routine returns the font for the current font list element .SH "RETURN" .PP Returns True if the returned values are valid; otherwise, returns False\&. .SH "RELATED" .PP \fBXmFontList\fP(3) and \fBXmFontListNextEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmCreateSpinBox.30000644000175000017500000000352412672140200015036 00000000000000'\" t ...\" CreSpi.sgm /main/11 1996/09/08 20:36:42 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSpinBox" "library call" .SH "NAME" \fBXmCreateSpinBox\fP \(em The SpinBox creation function .iX "XmCreateSpinBox" .iX "creation functions" "XmCreateSpinBox" .SH "SYNOPSIS" .PP .nf #include \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmCreateSpinBox\fP creates a SpinBox widget\&. .PP This function creates a SpinBox with two arrows, but without any traversable children (choices to spin)\&. The application can create text children to go with this parent SpinBox using \fBXmCreateTextField\fP or \fBXmCreateText\fP\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of SpinBox and its associated resources, see \fBXmSpinBox\fP(3)\&. .SH "RETURN" .PP Returns the SpinBox widget ID\&. .SH "RELATED" .PP \fBXmSpinBox\fP(3) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmCreateSimpleCheckBox.30000644000175000017500000000525612672140200016320 00000000000000'\" t ...\" CreSiA.sgm /main/7 1996/08/30 14:53:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateSimpleCheckBox" "library call" .SH "NAME" \fBXmCreateSimpleCheckBox\fP \(em A RowColumn widget convenience creation function .iX "XmCreateSimpleCheckBox" .iX "creation functions" "XmCreateSimpleCheckBox" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateSimpleCheckBox\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateSimpleCheckBox\fP creates an instance of a RowColumn widget of type \fBXmWORK_AREA\fP and returns the associated widget ID\&. .PP This routine creates a CheckBox and its ToggleButtonGadget children\&. A CheckBox is similar to a RadioBox, except that more than one button can be selected at a time\&. The name of each button is \fBbutton_\fP\fIn\fP, where \fIn\fP is an integer from 0 (zero) to the number of buttons in the menu minus 1\&. Buttons are named and created in the order they are specified in the RowColumn simple menu creation resources supplied in the argument list\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP A number of resources exist specifically for use with this and other simple menu creation routines\&. The only button type allowed in the \fBXmNbuttonType\fP resource is \fBXmCHECKBUTTON\fP\&. For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmCreateRadioBox\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleRadioBox\fP(3), \fBXmRowColumn\fP(3), \fBXmVaCreateSimpleCheckBox\fP(3), and \fBXmVaCreateSimpleRadioBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmNotebookGetPageInfo.30000644000175000017500000000670412672140200016164 00000000000000'\" t ...\" NotebG.sgm /main/7 1996/08/30 15:51:06 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmNotebookGetPageInfo" "library call" .SH "NAME" \fBXmNotebookGetPageInfo\fP \(em A Notebook function that returns page information .iX "XmNotebookGetPageInfo" .iX "Notebook functions" "XmNotebookGetPageInfo" .SH "SYNOPSIS" .PP .nf #include \fBXmNotebookPageStatus \fBXmNotebookGetPageInfo\fP\fR( \fBWidget \fBnotebook\fR\fR, \fBint \fBpage_number\fR\fR, \fBXmNotebookPageInfo \fB*page_info\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmNotebookGetPageInfo\fP returns status information for the specified Notebook page\&. .IP "\fInotebook\fP" 10 Specifies the Notebook widget\&. .IP "\fIpage_number\fP" 10 Specifies the page number to be queried\&. .IP "\fIpage_info\fP" 10 Points to the structure containing the page information\&. The structure has the following form: .PP .nf typedef struct { int \fIpage_number\fP; Widget \fIpage_widget\fP; Widget \fIstatus_area_widget\fP; Widget \fImajor_tab_widget\fP; Widget \fIminor_tab_widget\fP; } XmNotebookPageInfo; \fB\fR(\fBvoid\fR) .fi .RS .IP "\fIpage_number\fP" 10 Specifies the \fIpage_number\fP passed to the function\&. .IP "\fIpage_widget\fP" 10 Specifies a child widget of the Notebook with a \fBXmNchildType\fP of \fBXmPAGE\fP and a \fBXmNpageNumber\fP equal to \fIpage_number\fP if one exists; otherwise set to NULL\&. .IP "\fIstatus_area_widget\fP" 10 Specifies a child widget of the Notebook with a \fBXmNchildType\fP of \fBXmSTATUS_AREA\fP and a \fBXmNpageNumber\fP equal to \fIpage_number\fP if one exists; otherwise set to NULL\&. .IP "\fImajor_tab_widget\fP" 10 Specifies a child widget of the Notebook with a \fBXmNchildType\fP of \fBXmMAJOR_TAB\fP and the nearest \fBXmNpageNumber\fP equal to or less than \fIpage_number\fP if one exists; otherwise set to NULL\&. .IP "\fIminor_tab_widget\fP" 10 Specifies a child widget of the Notebook with a \fBXmNchildType\fP of \fBXmMINOR_TAB\fP and the nearest \fBXmNpageNumber\fP equal to or less than \fIpage_number\fP if one exists; otherwise set to NULL\&. .RE .PP For a complete definition of Notebook and its associated resources, see \fBXmNotebook\fP(3)\&. .SH "RETURN" .PP Returns one of the following page status values: .IP "\fBXmPAGE_FOUND\fP" 10 The specified page was found\&. .IP "\fBXmPAGE_INVALID\fP" 10 The specified page number is out of the page number range\&. .IP "\fBXmPAGE_EMPTY\fP" 10 The specified page does not have a page widget\&. .IP "\fBXmPAGE_DUPLICATED\fP" 10 There is more than one page widget with the specified page number\&. The more recently managed page widget is used for the page information structure\&. .SH "RELATED" .PP \fBXmNotebook\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmVaCreateManagedPushButtonGadget.30000644000175000017500000000004612672140200020443 00000000000000.so man3/XmVaCreatePushButtonGadget.3 motif-2.3.8/doc/man/man3/XmSetColorCalculation.30000644000175000017500000000645312672140200016245 00000000000000'\" t ...\" SetColC.sgm /main/9 1996/09/08 21:01:53 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSetColorCalculation" "library call" .SH "NAME" \fBXmSetColorCalculation\fP \(em A function to set the procedure used for default color calculation .iX "XmSetColorCalculation" .iX "Color functions" "XmSetColorCalculation" .SH "SYNOPSIS" .PP .nf #include \fBXmColorProc \fBXmSetColorCalculation\fP\fR( \fBXmColorProc \fBcolor_proc\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmSetColorCalculation\fP sets the procedure to calculate default colors\&. This procedure is used to calculate the foreground, top shadow, bottom shadow, and select colors on the basis of a given background color\&. If called with an argument of NULL, it restores the default procedure used to calculate colors\&. .IP "\fIcolor_proc\fP" 10 Specifies the procedure to use for color calculation\&. .PP Following is a description of the \fBXmColorProc\fR type used by \fBXmSetColorCalculation\fP: .PP .nf void (*\fIcolor_proc\fP) (\fIbackground_color, foreground_color, select_color, top_shadow_color, bottom_shadow_color\fP) XColor \fI*background_color\fP; XColor \fI*foreground_color\fP; XColor \fI*select_color\fP; XColor \fI*top_shadow_color\fP; XColor \fI*bottom_shadow_color\fP; \fB\fR(\fBvoid\fR) .fi .PP Specifies the procedure used to calculate default colors\&. The procedure is passed a pointer to an \fBXColor\fP structure representing the background color\&. The \fIpixel\fP, \fIred\fP, \fIgreen\fP, and \fIblue\fP members of this structure are filled in with values that are valid for the current colormap\&. .PP The procedure is passed pointers to \fBXColor\fP structures representing the foreground, select, top shadow, and bottom shadow colors to be calculated\&. The procedure calculates and fills in the \fIred\fP, \fIgreen\fP, and \fIblue\fP members of these structures\&. The procedure should not allocate color cells for any of these colors\&. .IP "\fIbackground_color\fP" 10 Specifies the background color\&. .IP "\fIforeground_color\fP" 10 Specifies the foreground color to be calculated\&. .IP "\fIselect_color\fP" 10 Specifies the select color to be calculated\&. .IP "\fItop_shadow_color\fP" 10 Specifies the top shadow color to be calculated\&. .IP "\fIbottom_shadow_color\fP" 10 Specifies the bottom shadow color to be calculated\&. .SH "RETURN" .PP Returns the color calculation procedure that was used at the time this routine was called\&. .SH "RELATED" .PP \fBXmChangeColor\fP(3), \fBXmGetColors\fP(3), and \fBXmGetColorCalculation\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmRepTypeGetRecord.30000644000175000017500000000527312672140200015522 00000000000000'\" t ...\" RepTypGC.sgm /main/8 1996/09/08 20:58:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeGetRecord" "library call" .SH "NAME" \fBXmRepTypeGetRecord\fP \(em A representation type manager function that returns information about a representation type .iX "XmRepTypeGetRecord" .iX "representation type manager functions" "XmRepTypeGetRecord" .SH "SYNOPSIS" .PP .nf #include \fBXmRepTypeEntry \fBXmRepTypeGetRecord\fP\fR( \fBXmRepTypeId \fBrep_type_id\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRepTypeGetRecord\fP retrieves information about a particular representation type that is registered with the representation type manager\&. This routine allocates memory for the returned data\&. The application must free this memory using \fBXtFree\fP\&. .IP "\fIrep_type_id\fP" 10 The identification number of the representation type .PP The representation type entry structure contains the following information: .PP .nf typedef struct { String \fIrep_type_name\fP; String *\fIvalue_names\fP; unsigned char *\fIvalues\fP; unsigned char \fInum_values\fP; Boolean \fIreverse_installed\fP; XmRepTypeId \fIrep_type_id\fP; } XmRepTypeEntryRec, *XmRepTypeEntry; \fB\fR(\fBvoid\fR) .fi .IP "\fIrep_type_name\fP" 10 The name of the representation type .IP "\fIvalue_names\fP" 10 An array of representation type value names .IP "\fIvalues\fP" 10 An array of representation type numerical values .IP "\fInum_values\fP" 10 The number of values associated with the representation type .IP "\fIreverse_installed\fP" 10 A flag that indicates whether or not the reverse converter is installed .IP "\fIrep_type_id\fP" 10 The identification number of the representation type .SH "RETURN" .PP Returns a pointer to the representation type entry structure that describes the representation type\&. .SH "RELATED" .PP \fBXmRepTypeGetId\fP(3), \fBXmRepTypeGetRegistered\fP(3), and \fBXmRepTypeRegister\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmCreateErrorDialog.30000644000175000017500000000461612672140200015670 00000000000000'\" t ...\" CreErr.sgm /main/8 1996/09/08 20:32:55 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateErrorDialog" "library call" .SH "NAME" \fBXmCreateErrorDialog\fP \(em The MessageBox ErrorDialog convenience creation function .iX "XmCreateErrorDialog" .iX "creation functions" "XmCreateErrorDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateErrorDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateErrorDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged MessageBox child of the DialogShell\&. An ErrorDialog warns the user of an invalid or potentially dangerous condition\&. It includes a symbol, a message, and three buttons\&. The default symbol is an octagon with a diagonal slash\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. .PP Use \fBXtManageChild\fP to pop up the ErrorDialog (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateErrorDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:19 motif-2.3.8/doc/man/man3/XmTextEnableRedisplay.30000644000175000017500000000366312672140200016244 00000000000000'\" t ...\" TxtEnabl.sgm /main/8 1996/09/08 21:12:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextEnableRedisplay" "library call" .SH "NAME" \fBXmTextEnableRedisplay\fP \(em A Text function that forces the visual update of a Text widget .iX "XmTextEnableRedisplay" .iX "Text functions" "XmTextEnableRedisplay" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextEnableRedisplay\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextEnableRedisplay\fP is used in conjunction with \fBXmTextDisableRedisplay\fP, which suppresses visual update of the Text widget\&. When \fBXmTextEnableRedisplay\fP is called, it determines if any visual attributes have been set or modified for the specified widget since \fBXmTextDisableRedisplay\fP was called\&. If so, it forces the widget to update its visual display for all of the intervening changes\&. Any subsequent changes that affect visual appearance cause the widget to update its visual display\&. This function also causes the insertion cursor, which is not shown while redisplay is disabled, to be restored\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .SH "RELATED" .PP \fBXmTextDisableRedisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmMultiListUnselectAllItems.30000644000175000017500000000131412672140200017407 00000000000000.TH "XmMultiListUnselectAllItems" "library call" .SH "NAME" \fBXmMultiListUnselectAllItems\fP \(em an MultiList function that deselects all rows of the list .iX "XmMultiListUnselectAllItems" .iX "MultiList functions" "XmMultiListUnselectAllItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListUnselectAllItems\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP Unselects all rows of the passed MultiList widget and returns nothing\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget from whose list items is deselected\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateTemplateDialog.30000644000175000017500000000522112672140200016343 00000000000000'\" t ...\" CreTeA.sgm /main/8 1996/09/08 20:36:54 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateTemplateDialog" "library call" .SH "NAME" \fBXmCreateTemplateDialog\fP \(em A MessageBox TemplateDialog convenience creation function .iX "XmCreateTemplateDialog" .iX "create functions" "XmCreateTemplateDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateTemplateDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateTemplateDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged MessageBox child of the DialogShell\&. The MessageBox widget\&'s \fBXmNdialogType\fP resource is set to \fBXmDIALOG_TEMPLATE\fP\&. By default, the TemplateDialog widget contains only the separator child\&. You can build a customized dialog by adding children to the TemplateDialog\&. .PP You can create the standard MessageBox pushbuttons, \fBCancel\fP, \fBHelp\fP, and \fBOK\fP, by specifying the associated callback and label string resources\&. Setting \fBXmNsymbolPixmap\fP or \fBXmNmessageString\fP creates a symbol or message label\&. .PP Use \fBXtManageChild\fP to pop up the TemplateDialog (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateTemplateDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmCreateWorkingDialog.30000644000175000017500000000467012672140200016217 00000000000000'\" t ...\" CreWoB.sgm /main/8 1996/09/08 20:37:17 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateWorkingDialog" "library call" .SH "NAME" \fBXmCreateWorkingDialog\fP \(em The MessageBox WorkingDialog convenience creation function .iX "XmCreateWorkingDialog" .iX "creation functions" "XmCreateWorkingDialog" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateWorkingDialog\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateWorkingDialog\fP is a convenience creation function that creates a DialogShell and an unmanaged MessageBox child of the DialogShell\&. A WorkingDialog informs users that there is a time-consuming operation in progress and allows them to cancel the operation\&. It includes a symbol, a message, and three buttons\&. The default symbol is an hourglass\&. The default button labels are \fBOK\fP, \fBCancel\fP, and \fBHelp\fP\&. .PP Use \fBXtManageChild\fP to pop up the WorkingDialog (passing the MessageBox as the widget parameter); use \fBXtUnmanageChild\fP to pop it down\&. .PP \fBXmCreateWorkingDialog\fP forces the value of the Shell resource \fBXmNallowShellResize\fP to True\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of MessageBox and its associated resources, see \fBXmMessageBox\fP(3)\&. .SH "RETURN" .PP Returns the MessageBox widget ID\&. .SH "RELATED" .PP \fBXmMessageBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:21 motif-2.3.8/doc/man/man3/XmMultiListSelectRow.30000644000175000017500000000226012672140200016102 00000000000000.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMultiListSelectRow" "library call" .SH "NAME" \fBXmMultiListSelectRow\fP \(em A MultiList function that selects a row in the list .iX "XmMultiListSelectRow" .iX "MultiList functions" "XmMultiListSelectRow" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListSelectRow\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmString \fBrow\fR\fR, \fBBoolean \fBnotify\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMultiListSelectRow\fP highlights the specified row in the MultiList widget\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget from whose list an item is selected\&. .IP "\fIrow\fP" 10 Specifies the row number (starting from 0) to be selected in the MultiList widget\&. .IP "\fInotify\fP" 10 Specifies a Boolean value that when TRUE invokes the selection callback for the current mode\&. From an application interface view, calling this function with \fInotify\fP True is indistinguishable from a user-initiated selection action\&. When \fInotify\fP is FALSE, no callbacks are called\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateManagedPushButton.30000644000175000017500000000004012672140200017321 00000000000000.so man3/XmVaCreatePushButton.3 motif-2.3.8/doc/man/man3/XmPaned.30000644000175000017500000004155312672140200013363 00000000000000.DT .TH "XmPaned" "library call" .SH "NAME" \fBXmPaned\fP \(em The Paned widget class .iX "XmPaned" .iX "widget class" "Paned Window" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The Paned widget manages children in a vertically or horizontally tiled fashion with each child in a separate pane. The panes may be dynamically resized by the user using "control sashes" that appear between the panes\&. .PP Application programmers have control over whether or not sashes and separators are displayed, the preferred size of each pane, and which pane will be forced to absorb size restrictions imposed by the Paned widget's parent\&. .SS Geometry Management The Paned widget usually resizes its children to their preferred sizes when a new child is managed. It will first attempt to resize itself to contain its panes exactly. If this is not possible then it will hunt through the children, from bottom to top (or right to left), for a pane to resize. .PP The Paned widget will attempt to honor the geometry request of its children. It will first attempt to resize itself to satisfy the request then go through the layout rules below to satisfy the request. Only if all panes are at their min/max values will a geometry request be refused. If the XmNallowResize resource is False for the child then all geometry requests will be denied, of course. .SS Special Considerations .PP When a user resizes a pane with the sashes, the Paned widget assumes that this new size is the preferred size of both the pane above and the pane below, unless the XmNresizeToPreferred constraint resource is True for that pane\&. .SS Layout Semantics .PP In order to make effective use of the Paned widget it is helpful to know the rules it uses to determine which child will be resized in any given situation. There are three rules used to determine which child is resized. While these rules are always the same, the panes that are searched can change depending upon what caused the change of layout. .SS Layout Rules .ta 5 .HP 5 1\&. Do not let a pane grow larger than its max or smaller than its min size\&. In addition do not let a pane without a sash shrink below its preferred size due to a grip movement of another pane\&. .HP 5 2\&. Do not adjust panes with XmNskipAdjust set\&. .HP 5 3\&. Do not adjust panes away from their preferred size, although moving one closer to its preferred size is fine\&. .PP When searching the children the Paned widget looks for panes that satisfy all the rules, and if unsuccessful then it eliminates rule 3 and then 2. Rule 1 is always enforced. .PP If the relayout is due to a resize or change in management then the panes are searched from bottom to top. If space is needed above the current sash the panes are searched from bottom to top beginning with the second pane above the grip that was moved. If space is needed below the current sash the panes are searched from top to bottom beginning with the second pane below the grip that was moved. The Paned widget never wraps its pane resizing. Therefore if space is needed below the sash then no widget above the sash will ever be resized. .PP Note: If the orientation is horizontal then substitute "right" for "bottom" and "left" for "top" in the above paragraph. .SS Resizing Panes .PP When the Paned widget is resized it must determine a new size for each pane. There are two methods of doing this. The Paned widget can either give each pane its preferred size and then resize the panes to fit, or it can use the current sizes and then resize the panes to fit. The XmNresizeToPreferred constraint resource allows the application to tell the Paned widget whether to query the child about its preferred size (subject to the XmNpreferredPaneSize) or to use the current size when refiguring the pane locations after the Paned widget has been resized\&. .PP All panes assume they should resize to their preferred size until the Paned widget becomes visible to the user\&. .SS "Classes" .PP Paned inherits behavior and resources from the \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, abd \fBXmmanager\fP classes\&. .PP The class pointer of \fBxmPanedWidgetClass\fP\&. .PP The class name is \fBXmPaned\fP\&. .SS "New resources" The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPaned Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNcursorXmCursortCursorNoneCSG _____ XmNmarginHeightXmCMarginHeightDimension3CSG _____ XmNmarginWidthXmCMarginWidthDimension3CSG _____ XmNorientationXmCOrientationunsigned charXmVERTICALCSG _____ XmNrefigureModeXmCBooleanBooleanTrueCSG _____ XmNsashHeightXmCSashHeightDimension8CSG _____ XmNsashIndentXmCSashIndentPosition-10CSG _____ XmNsashShadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNsashTranslations%Translations%XtTranslations%see below _____ XmNsashWidthXmCSashWidthDimension10CSG _____ XmNseparatorOnXmCSeparatorOnBooleanTrueCSG _____ XmNspacingXmCSpacingDimension8CSG _____ .TE .IP "\fBXmNcursor\fP" 10 Image that will be displayed as the pointer cursor whenever the pointer is over this widget. If the children do not explicitly set their cursor attribute then this resource will be inherited by each child\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the distance between the top and bottom edges of the Paned widget and its children\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the distance between the left and right edges of the Paned widget and its children\&. .IP "\fBXmNorientation\fP" 10 Specifies the layout as either vertical (with the \fBXmVERTICAL\fP value) or horizontal (with the \fBXmHORIZONTAL\fP value)\&. In the vertical layout, the children are laid out in a vertically tiled format\&. In the horizontal layout, the children are laid out in a horizontal layout, with the sash moveable along the horizontal axis\&. .IP "\fBXmNrefigureMode\fP" 10 Determines whether the panes\&' positions are recomputed and repositioned when programmatic changes are being made to the Paned widget\&. Setting this resource to True resets the children to their appropriate positions\&. .IP "\fBXmNsashHeight\fP" 10 Specifies the height of the sash\&. .IP "\fBXmNsashIndent\fP" 10 Specifies the horizontal placement of the sash along each pane\&. A positive value causes the sash to be offset from the near (left) side of the Paned widget, and a negative value causes the sash to be offset from the far (right) side of the Paned widget\&. If the offset is greater than the width of the Paned widget minus the width of the sash, the sash is placed flush against the near side of the Paned widget\&. .IP "" 10 Whether the placement actually corresponds to the left or right side of the Paned widget depends on the \fBXmNlayoutDirection\fP resource of the widget\&. .IP "\fBXmNsashTranslations\fP" 10 Translation bindings for the sash. See below. .IP "\fBXmNsashShadowThickness\fP" 10 Specifies the thickness of the shadows of the sashes\&. .IP "\fBXmNsashWidth\fP" 10 Specifies the width of the sash\&. .IP "\fBXmNseparatorOn\fP" 10 Determines whether a separator is created between each of the panes\&. Setting this resource to True creates a Separator at the midpoint between each of the panes\&. .IP "\fBXmNspacing\fP" 10 Specifies the distance between each child pane\&. .TS tab() box; c s s s s l| l| l| l| l. T{ \fBXmPaned Constraint Resource Set\fP T} \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowResizeXmCBooleanBooleanFalseCSG _____ XmNpaneMaximumXmCPaneMaximumDimension1000CSG _____ XmNpaneMinimumXmCPaneMinimumDimension1CSG _____ XmNskipAdjustXmCBooleanBooleanFalseCSG _____ XmNpreferredPaneSizeXmCPreferredPaneSizeDimensionXmPanedAskChild _____ XmNresizeToPreferredXmCBooleanBooleanFalse _____ XmNshowSashXmCBooleanBooleanTrue _____ .TE .IP "\fBXmNallowResize\fP" 10 Allows an application to specify whether the Paned widget should allow a pane to request to be resized\&. This flag has an effect only after the Paned widget and its children have been realized\&. If this flag is set to True, the Paned widget tries to honor requests to alter the height of the pane\&. If False, it always denies pane requests to resize\&. .IP "\fBXmNpaneMaximum\fP" 10 Allows an application to specify the maximum size to which a pane may be resized\&. This value must be greater than the specified minimum\&. .IP "\fBXmNpaneMinimum\fP" 10 Allows an application to specify the minimum size to which a pane may be resized\&. This value must be greater than 0 (zero)\&. .IP "\fBXmNskipAdjust\fP" 10 When set to True, this Boolean resource allows an application to specify that the Paned widget should not automatically resize this pane\&. .IP "\fBXmNpreferredPaneSize\fP" 10 Preferred size of the pane. If this value is not set the paned widget will query the child for a preferred size. This resource allows the user or application to provide a new preferred size\&. .IP "\fBXmNresizeToPreferred\fP" 10 Specifies whether to resize each pane to its preferred size when the Paned window is resized. If this is False then only those panes the user has not resized with the sashes will be resized to their preferred size\&. .IP "\fBXmNshowSash\fP" 10 If True show the Sash below or to the right of this pane. .SS "Inherited Resources" .PP Paned widget inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcdefault procedureCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .SS "Translations" .PP \fBXmPaned widget\fP inherits translations from \fBXmManager\fP\&. .PP The translations for sashes within the Paned widget are described in the following table\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBStart\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBMove\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBCommit\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBStart\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBMove\fP) .IP "\fB\(apc \(aps \(apm \(apa\fP \fB\fP:" 10 SashAction(\fBCommit\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,10,Up\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,1,Up\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,10,Right\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,1,Right\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,10,Down\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,1,Down\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 SashAction(\fBKey,10,Left\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 SashAction(\fBKey,1,Left\fP) .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrevTabGroup() .IP "\fB\(apm \(apa\fP \fB\fP\fBTab\fP:" 10 NextTabGroup() .SS "Action Routines" .PP The \fBXmPaned\fP action routines are .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "NextTabGroup():" 10 Moves the keyboard focus to the next tab group\&. By default, each pane and sash is a tab group\&. .IP "PrevTabGroup():" 10 Moves the keyboard focus to the previous tab group\&. By default, each pane and sash is a tab group\&. .IP "SashAction(\fIaction\fP\fB)\fP\ or\ SashAction(\fBKey,\fP\fIincrement\fP\fB,\fP\fIdirection\fP\fB)\fP:" 10 The \fBStart\fP action activates the interactive placement of the pane\&'s borders\&. The \fBMove\fP action causes the sash to track the position of the pointer\&. If one of the panes reaches its minimum or maximum size, adjustment continues with the next adjustable pane\&. The \fBCommit\fP action ends sash motion\&. .IP "" 10 When sash action is caused by a keyboard event, the sash with the keyboard focus is moved according to the \fIincrement\fP and \fIdirection\fP specified\&. \fBDefaultIncr\fP adjusts the sash by one line\&. \fBLargeIncr\fP adjusts the sash by one view region\&. The \fIdirection\fP is specified as either \fBUp\fP, \fBDown\fP, \fBLeft\fP, or \fBRight\fP\&. .IP "" 10 Note that the SashAction action routine is not a direct action routine of the \fBXmPaned,\fP but rather an action of the Sash control created by the \fBXmPaned\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 Moves the keyboard focus to the sash and highlights it .IP "\fB\fP:" 10 Unsets the keyboard focus in the sash and unhighlights it .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreatePaned\fP(3), \fBXmManager\fP(3), \fBXmPaneGetpanes\fP(3), \fBXmVaCreatePaned\fP(3), and \fBXmVaCreateManagedPaned\fP(3)\&. motif-2.3.8/doc/man/man3/XmListSetPos.30000644000175000017500000000355412672140200014404 00000000000000'\" t ...\" LstSetPo.sgm /main/8 1996/09/08 20:52:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSetPos" "library call" .SH "NAME" \fBXmListSetPos\fP \(em A List function that makes the item at the given position the first visible position in the list .iX "XmListSetPos" .iX "List functions" "XmListSetPos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSetPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSetPos\fP makes the item at the given position the first visible position in the list\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget\&. .IP "\fIposition\fP" 10 Specifies the position of the item to be made the first visible item in the list\&. A value of 1 indicates that the first item in the list is the first visible item; a value of 2 indicates that the second item is the first visible item; and so on\&. A value of 0 (zero) indicates that the last item in the list is the first visible item\&. .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmVaCreateManagedCommand.30000644000175000017500000000003512672140200016570 00000000000000.so man3/XmVaCreateCommand.3 motif-2.3.8/doc/man/man3/XmDropSiteEndUpdate.30000644000175000017500000000403712672140200015653 00000000000000'\" t ...\" DropSitE.sgm /main/8 1996/09/08 20:41:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteEndUpdate" "library call" .SH "NAME" \fBXmDropSiteEndUpdate\fP \(em A Drag and Drop function that facilitates processing updates to multiple drop sites .iX "XmDropSiteEndUpdate" .iX "Drag and Drop functions" "XmDropSiteEndUpdate" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropSiteEndUpdate\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteEndUpdate\fP is used in conjunction with \fBXmDropSiteStartUpdate\fP to process updates to multiple drop sites within the same hierarchy\&. \fBXmDropSiteStartUpdate\fP and \fBXmDropSiteEndUpdate\fP signal the beginning and the end respectively of a series of calls to \fBXmDropSiteUpdate\fP\&. Calls to \fBXmDropSiteStartUpdate\fP and \fBXmDropSiteEndUpdate\fP can be recursively stacked\&. Using these routines optimizes the processing of update information\&. .IP "\fIwidget\fP" 10 Specifies the ID of any widget within a given hierarchy\&. The function uses this widget to identify the shell that contains the drop sites\&. .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RELATED" .PP \fBXmDropSiteStartUpdate\fP(3) and \fBXmDropSiteUpdate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmVaCreateManagedArrowButton.30000644000175000017500000000004112672140200017475 00000000000000.so man3/XmVaCreateArrowButton.3 motif-2.3.8/doc/man/man3/XmAddToPostFromList.30000644000175000017500000000551312672140200015651 00000000000000'\" t ...\" AddToPos.sgm /main/9 1996/09/08 20:24:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmAddToPostFromList" "library call" .SH "NAME" \fBXmAddToPostFromList\fP \(em a RowColumn function that makes a menu accessible from more than one widget .iX "XmAddToPostFromList" .iX "RowColumn functions" "XmAddToPostFromList" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBXmAddToPostFromList\fP\fR( \fBWidget \fBmenu\fR\fR, \fBWidget \fBpost_from_widget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmAddToPostFromList\fP makes a menu accessible from more than one widget\&. After a menu is once created, this function may be used to make that menu accessible from a second widget\&. The process may be repeated indefinitely\&. In other words, where an application would use \fBXmCreatePopupMenu\fP or \fBXmCreatePulldownMenu\fP or their equivalent to create a new menu identical to one that already exists, it can use this function to reuse that earlier menu\&. .PP If \fImenu\fP refers to a Popup menu, then the \fIpost_from_widget\fP widget can now pop up the specified menu\&. The actual posting of the menu occurs as it always does, either through an event handler, or the automatic popup menu support (see the \fBXmRowColumn\fP(3) reference page)\&. .PP If \fImenu\fP refers to a Pulldown menu, its ID is placed in the \fBXmNsubMenuId\fP resource of the specified \fIpost_from_widget\fP\&. In this case, the \fIpost_from_widget\fP widget must be either a CascadeButton or a CascadeButtonGadget\&. .PP Note that this function manipulates the internal structures themselves, not a copy of them\&. .IP "\fImenu\fP" 10 Specifies the ID of the RowColumn widget containing the menu (Popup or Pulldown) to be made accessible from the widget\&. .IP "\fIpost_from_widget\fP" 10 Specifies the widget ID of the widget which will now be able to post the menu specified by \fImenu\fP\&. .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RELATED" .PP \fBXmGetPostedFromWidget\fP(3), \fBXmRemoveFromPostFromList\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmVaCreateManagedToggleButtonGadget.30000644000175000017500000000005012672140200020740 00000000000000.so man3/XmVaCreateToggleButtonGadget.3 motif-2.3.8/doc/man/man3/XmMenuPosition.30000644000175000017500000000400212672140200014751 00000000000000'\" t ...\" MenuPos.sgm /main/9 1996/09/08 20:54:01 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMenuPosition" "library call" .SH "NAME" \fBXmMenuPosition\fP \(em A RowColumn function that positions a Popup menu pane .iX "XmMenuPosition" .iX "RowColumn functions" "XmMenuPosition" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMenuPosition\fP\fR( \fBWidget \fBmenu\fR\fR, \fBXButtonPressedEvent \fB* event\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMenuPosition\fP positions a Popup menu pane using the information in the specified event\&. Unless an application is positioning the menu pane itself, it must first invoke this function before managing the PopupMenu\&. The \fIx_root\fP and \fIy_root\fP fields in the specified X event are used to determine the menu position\&. .IP "\fImenu\fP" 10 Specifies the PopupMenu to be positioned .IP "\fIevent\fP" 10 Specifies the event passed to the action procedure which manages the PopupMenu .PP Which corner of the PopupMenu is positioned at the \fIx_root\fP and \fIy_root\fP depends on the \fBXmNlayoutDirection\fP resource of the widget from which popup occurs\&. .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RELATED" .PP \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmRenderTableFree.30000644000175000017500000000250512672140200015317 00000000000000'\" t ...\" RendTaF.sgm /main/8 1996/08/30 15:58:41 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenderTableFree" "library call" .SH "NAME" \fBXmRenderTableFree\fP \(em A render table function that recovers memory .iX "XmRenderTableFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmRenderTableFree\fP\fR( \fBXmRenderTable \fBtable\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenderTableFree\fP frees the memory associated with the specified render \fItable\fP\&. .IP "\fItable\fP" 10 Specifies the table to be freed\&. .SH "RELATED" .PP \fBXmRendition\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmToggleButtonGadgetGetState.30000644000175000017500000000326312672140200017522 00000000000000'\" t ...\" ToggleBC.sgm /main/7 1996/08/30 16:19:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmToggleButtonGadgetGetState" "library call" .SH "NAME" \fBXmToggleButtonGadgetGetState\fP \(em A ToggleButtonGadget function that obtains the state of a ToggleButtonGadget .iX "XmToggleButtonGadgetGet\\%State" .iX "ToggleButtonGadget functions" "XmToggleButtonGadgetGet\\%State" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmToggleButtonGadgetGetState\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmToggleButtonGadgetGetState\fP obtains the state of a ToggleButtonGadget\&. .IP "\fIwidget\fP" 10 Specifies the ToggleButtonGadget ID .PP For a complete definition of ToggleButtonGadget and its associated resources, see \fBXmToggleButtonGadget\fP(3)\&. .SH "RETURN" .PP Returns True if the button is selected and False if the button is unselected\&. .SH "RELATED" .PP \fBXmToggleButtonGadget\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmListSetHorizPos.30000644000175000017500000000355612672140200015422 00000000000000'\" t ...\" LstSetHo.sgm /main/7 1996/08/30 15:47:08 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListSetHorizPos" "library call" .SH "NAME" \fBXmListSetHorizPos\fP \(em A List function that scrolls to the specified position in the list .iX "XmListSetHorizPos" .iX "List functions" "XmListSetHorizPos" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmListSetHorizPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBposition\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListSetHorizPos\fP sets the \fBXmNvalue\fP resource of the horizontal ScrollBar to the specified position and updates the visible portion of the list with the new value if the List widget\&'s \fBXmNlistSizePolicy\fP is set to \fBXmCONSTANT\fP or \fBXmRESIZE_IF_POSSIBLE\fP and the horizontal ScrollBar is currently visible\&. This is equivalent to moving the horizontal ScrollBar to the specified position\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .IP "\fIposition\fP" 10 Specifies the horizontal position .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmMultiList.30000644000175000017500000003730712672140200014264 00000000000000.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH XmMultiList 3x "" .SH NAME \fBXmMultiList\fP \(em The Multi-column List widget .SH SYNOPSIS .nf #include .fi .SH DESCRIPTION .PP This widget contains a multi-column list with headers along the top and a search area along the bottom. The list has scrollbars along the right and bottom edges that allow vertical and horizontal scrolling both by column and by pixel. The portion of the list data that is currently visible can be altered by scrollbar actions, widget resource setting and the redisplay of the list data after a string search has been successful. The sorting of elements within a particular column is also supported. To sort the list by the elements in a given column, select the column's title. .PP To search for a particular string in the list, type the string value to be searched for in the list's associated text field and then press the "Find" pushbutton. The search for the string begins in the currently selected row, after the location of the previously searched for string, or at the first column and first row if there is no column selected. If the string is not found in that row, then the search continues through all rows after and then before, the currently selected row. If the string is found, the display of the list is adjusted to make the string visible. If the string was not found, or if the string is visible, the application will issue a warning beep. .PP Pointer button one allows the user to select a row or a column for sorting. The callbacks on the doubleClickCallback list are called when the user double clicks pointer button one. If the list data can contain a row pixmap to display at the extreme left of the row. .SS "Classes" .PP MultiList inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP\&. .PP The class pointer is \fBxmMultiListWidgetClass\fP\&. .PP The class name is \fBXmMultiList\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmMultiList Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNcolumnTitlesXmCColumnTitlesXmString *NULLCSG _____ XmNdoubleClickCallbackXmCCallbackXtCallbackListNULLC _____ XmNentryDataXmCEntryDataXtPointerNULLCSG _____ XmNfindLabelXmCFindLabelXmStringFindCSG _____ XmNfirstColumnXmCFirstLocationshort0CSG _____ XmNfirstColumnPixmapsXmCFirstColumnPixmapsBooleanFalseCSG _____ XmNfirstRowXmCFirstLocationshort0CSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNheightXmCHeightDimension300CSG _____ XmNnumColumnsXmCNumColumnsshort0CSG _____ XmNnumRowsXmCNumRowsshort0CSG _____ XmNselectedColumnXmCSelectedColumnshort0CSG _____ XmNselectionPolicyXmCSelectionPolicyunsigned charXmEXTENDED_SELECTCSG _____ XmNshowFindXmCShowFindBooleanTrueCSG _____ XmNsingleSelectionCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNsortFunctionsXmCFunctionXmMultiListSortFunction **NULLCSG _____ XmNtitleXmCTitleXmStringNULLCSG _____ XmNwidthXmCWidthDimension300CSG _____ .TE .IP "\fBXmNcolumnTitles\fP" 10 This is an array of length numColumns of strings displayed at the top of each column. The data is allocated and maintained by the client. .IP "\fBXmNdoubleClickCallback\fP" 10 All routines in this list will be called whenever the user double clicks on a row in the list. .IP "\fBXmNentryData\fP" 10 This resource is the data associated with each row in the list. The data is an array of XmMultiListRowInfo structures of length numRows allocated by the client. The data is allocated and maintained by the client. The XmMultiListRowInfo structure is defined below. .IP "\fBXmNfindLabel\fP" 10 The label to be shown on the find button. .IP "\fBXmNfirstColumn\fP" 10 This resource allows the client to adjust the current view of the list data to have a new top left column location. When setting this resource, firstRow should also be updated. .IP "\fBXmNfirstColumnPixmaps\fP" 10 This resource specifies that the pixmap stored in the row info structure should be used instead of XmMultiListRowInfo values[0]. If pixmaps are present, the rows may be dragged by pressing on the pixmap with pointer button three. If this resource is True, then values[0] is never referenced. If False, then the XmMultiListRowInfo data pixmap is never referenced. .IP "\fBXmNfirstRow\fP" 10 This resource allows the client to adjust the current view of the list data to have a new top left row location. When setting this resource, firstColumn should also be updated. .IP "\fBXmNfontList\fP" 10 This is an OSF/Motif style font list. The first font in this list will be used to display all text in the MultiList widget. The MultiList widget currently supports only one font. .IP "\fBXmNheight\fP" 10 This is the overall height value assigned to the MultiList widget. Modifying this resource will affect scrollbar size and location. .IP "\fBXmNnumColumns\fP" 10 .IP "\fBXmNnumRows\fP" 10 These resources specify the number of columns and rows the widget expects to display. These resources are used as the maximum indices for many of the other resources in this widget. Care should be taken when modifying these resources to ensure that the other values have also been modified. .IP "\fBXmNselectedColumn\fP" 10 This is the index of the currently selected column. This also the column by which the list is being sorted. .IP "\fBXmNselectionPolicy\fP" 10 Defines the interpretation of the select action. This resource can have the values XmSINGLE_SELECT or XmEXTENDED_SELECT. Other values result in undefined behavior. .IP "\fBXmNshowFind\fP" 10 This boolean manages and unmanages the find button .IP "\fBXmNsingleSelectionCallback\fP" 10 All routines in this list will be called whenever the user clicks on a line in the list. A pointer to the XmMultiListRowInfo structure corresponding to the line selected is passed as call_data. If in extended select mode the value of call_data is undefined. .IP "\fBXmNsortFunctions\fP" 10 This is an array of functions, one for each column, called to determine the ordering of the rows in the column, similar to qsort. .IP "\fBXmNtitle\fP" 10 This is the title that is displayed at the top of the MultiList widget. If this value is NULL, the title area will not be shown. .IP "\fBXmNwidth\fP" 10 This is the overall width value assigned to the MultiList widget. Modifying this resource will affect scrollbar size and location. .PP .SS "Specifying Children Resources" .PP The MultiList widget is composed of many simple widgets. In order to achieve full functionality of the Toolkit, it is sometimes desirable to set attribute values directly on those widgets. The widget ids of the sub-widgets can be obtained by using the XtNameToWidget() function provided by the Xt Intrinsics. .PP XmMultiList XmLabel title XmScrollbar vertBar XmScrollBar horizBar XmFrame frame XmPushButton find XmText findText .PP .SS "Using the Resource Database" .PP The MultiList widget is actually a collection of pieces. It provides the geometry layout for the collection as well as tying together the pieces to form a consistent package. Many of the resources that are documented as being part of the MultiList widget are really part of the internal list sub-component. The MultiList widget will pass these values through to the proper child when they are set at time of creation or with XtSetValues or XtGetValues. However, when setting a resource via the resource database you must use either the name of the child or the general specification (*) rather than the specific one (.). .PP .SS "The XmMultiListRowInfo Structure" .PP The XmMultiListRowInfo structure is used to contain the entryData associated with each Row in the List. .PP .nf typedef struct { String * values; /* The array of column strings */ Pixmap pixmap; /* mini-icon pixmaps. */ Boolean selected; /* row selected. */ /* * Provided for the convenience of the application programmer */ short * sort_id; XtPointer data; /* * Private to the MultiList widget (do not modify these) */ short pix_width; /* of the pixmap. */ short pix_height; /* of the pixmap. */ short pix_depth; /* of the pixmap. */ Boolean old_sel_state; } XmMultiListRowInfo; .fi .PP \fIvalues\fP This is an array of strings of length numColumns which represents the strings displayed in each column of this row. The data is allocated and maintained by the client. If firstColumnPixmaps is True, then value[0] is never referenced. \fIpixmap\fP This is the pixmap displayed to the left of this row. If firstColumnPixmaps is True then this value is never referenced and mayn remain unset. If no pixmap is desired for this row, even though firstColumnPixmaps is True, set the value of pixmap to None. Color pixmaps may be used. \fIsort_id\fP This is provided for the convenience of the client and is expected to be used as a sort index for this row. One value should be specified for each column of the row. See "sortFunctions" below for details. \fIdata\fP This is provided for the convenience of the client and may be used for any purpose. It is intended to be used as an identifier for the object pointed to by this row .PP \fIselected\fP This value is True if this row is selected; may be set by the application. .PP Neither \fIsort_id\fP nor \fIdata\fP are used by the MultiList widget; they exist solely for the convenience of the programmer. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP The following are the default translation bindings used by the icon button: .PP .TS tab (); l l. ~Ctrl ~Shift :ButtonDown() Ctrl ~Shift :ButtonDown(Toggle) ~Ctrl Shift :ButtonDown(Extend) Button1 :Motion() :ButtonUpOrLeave() .TE .PP The following actions are supported by the MultiList: .RS .IP "\fBButtonDown(type)\fP" 10 Processes a button press action that may begin with either a select or a double click. The type argument can be either Toggle or Extend. These values determine which mode of an extended select will be initiated on this button event. Consult the OSF/Motif Style Guide for details. .IP "\fBMotion()\fP" 10 Processes motion events to allow the selection region to be modified when in extended selection mode. It is assumed that this action is called between a ButtonDown() and ButtonUpOrLeave() action. .IP "\fBButtonUpOrLeave()\fP" 10 Cleans up after ButtonDown() and Motion(). .RE .SH Callback Routines .PP All procedures on the MultiList's singleSelectionCallback and doubleClickCallback lists will have a pointer to a XmMultiListRowInfo structure passed to them in the call_data field. This structure is defined above. .PP Note: if a single SelectionCallback is registered on an MultiList in extended_select_mode, the value of call_data is undefined. .IP "" 10 \fBvoid\fP (callback)(\fBWidget\fP \fIw\fP, \fBXtPointer\fP \fIclient_data\fP, \fBXtPointer\fP \fIcall_data\fP) .IP "\fIw\fP" 10 the MultiList widget .IP "\fIclient_data\fP" 10 the client data specified by the application .IP "\fIcall_data\fP" 10 a pointer to an XmMultiListRowInfo structure corrsponding the the row selected .PP .SH Sort Function .PP typedef \fBint\fP (XmMultiListSortFunction) (\fBshort\fP \fIcolumn\fP, \fBXmMultiRowInfo *\fP \fIrow1\fP, \fBXmMultiRowInfo *\fP \fIrow2\fP); .IP "\fIcolumn\fP" 10 the column currently being sorted .IP "\fIrow1\fP, \fIrow2\fP" 10 the two rows being compared. The return value must be an integer less than, equal to, or greater than 0, depending on whether the first argument is less than, equal to, or greater than the second. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateMultiList\fP(3), \fBXmManager\fP(3), \fBXmMultiListDeselectAllItems\fP(3), \fBXmMultiListDeselectItem\fP(3), \fBXmMultiListDeselectItems\fP(3), \fBXmMultiListDeselectRow\fP(3), \fBXmMultiListGetSelectedRowArray\fP(3), \fBXmMultiListGetSelectedRows\fP(3), \fBXmMultiListMakeRowVisible\fP(3), \fBXmMultiListSelectAllItems\fP(3), \fBXmMultiListSelectItems\fP(3), \fBXmMultiListSelectRow\fP(3), and \fBXmMultiListToggleRow\fP(3)\&. .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmMainWindowSep3.30000644000175000017500000000373512672140200015143 00000000000000'\" t ...\" MainWinD.sgm /main/8 1996/09/08 20:53:25 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMainWindowSep3" "library call" .SH "NAME" \fBXmMainWindowSep3\fP \(em A MainWindow function that returns the widget ID of the third Separator widget .iX "XmMainWindowSep3" .iX "MainWindow functions" "XmMainWindowSep3" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmMainWindowSep3\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmMainWindowSep3\fP returns the widget ID of the third Separator in the MainWindow\&. The third Separator is located between the message window and the widget above it\&. This Separator is visible only when \fBXmNshowSeparator\fP is True\&. .PP \fBNOTE:\fP \fBXmMainWindowSep3\fP is obsolete and exists for compatibility with previous releases\&. Use \fBXtNameToWidget\fP instead\&. Pass a MainWindow variable as the first argument to \fBXtNameToWidget\fP and pass \fBSeparator3\fP as the second argument\&. .IP "\fIwidget\fP" 10 Specifies the MainWindow widget ID .PP For a complete definition of MainWindow and its associated resources, see \fBXmMainWindow\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the third Separator\&. .SH "RELATED" .PP \fBXmMainWindow\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmTextGetTopCharacter.30000644000175000017500000000440212672140200016210 00000000000000'\" t ...\" TxtGetTo.sgm /main/8 1996/09/08 21:18:16 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetTopCharacter" "library call" .SH "NAME" \fBXmTextGetTopCharacter\fP \(em A Text function that accesses the position of the first character displayed .iX "XmTextGetTopCharacter" .iX "Text functions" "XmTextGetTopCharacter" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmTextGetTopCharacter\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetTopCharacter\fP accesses the position of the text at the top of the Text widget\&. If there is no text in the Text widget (in other words, \fBXmNvalue\fP contains an empty string), then \fBXmTextGetTopCharacter\fP returns 0\&. .PP Suppose that the \fBXmNtopCharacter\fP resource has been set to a value greater than the number of characters in the text widget\&. In this case, \fBXmTextGetTopCharacter\fP returns an \fBXmTextPosition\fR value identifying the position of the first character in the last line of text in a multiline case; otherwise, it identifies the position of the last character in the line\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns an \fBXmTextPosition\fR value that indicates the state of the \fBXmNtopCharacter\fP resource\&. This is an integer number of characters from the beginning of the text buffer\&. The first character position is 0 (zero)\&. .SH "RELATED" .PP \fBXmText\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmVaCreateManagedLabel.30000644000175000017500000000003312672140200016227 00000000000000.so man3/XmVaCreateLabel.3 motif-2.3.8/doc/man/man3/XmGetPixmapByDepth.30000644000175000017500000002301412672140200015502 00000000000000'\" t ...\" GetPixB.sgm /main/10 1996/10/29 16:10:37 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetPixmapByDepth" "library call" .SH "NAME" \fBXmGetPixmapByDepth\fP \(em A pixmap caching function that generates a pixmap, stores it in a pixmap cache, and returns the pixmap .iX "XmGetPixmapByDepth" .iX "pixmaps" .SH "SYNOPSIS" .PP .nf #include \fBPixmap \fBXmGetPixmapByDepth\fP\fR( \fBScreen *\fBscreen\fR\fR, \fBchar *\fBimage_name\fR\fR, \fBPixel \fBforeground\fR\fR, \fBPixel \fBbackground\fR\fR, \fBint \fBdepth\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetPixmapByDepth\fP uses the parameter data to perform a lookup in the pixmap cache to see if a pixmap has already been generated that matches the data\&. If one is found, a reference count is incremented and the pixmap is returned\&. Applications should use \fBXmDestroyPixmap\fP when the pixmap is no longer needed\&. .IP "\fIscreen\fP" 10 Specifies the display screen on which the pixmap is to be drawn .IP "\fIimage_name\fP" 10 Specifies the name of the image to be used to generate the pixmap .IP "\fIforeground\fP" 10 Combines the image with the \fIforeground\fP color to create the pixmap if the image referenced is a bit-per-pixel image .IP "\fIbackground\fP" 10 Combines the image with the \fIbackground\fP color to create the pixmap if the image referenced is a bit-per-pixel image .IP "\fIdepth\fP" 10 Specifies the depth of the pixmap .PP If a matching pixmap is not found, \fIimage_name\fP is used to perform a lookup in the image cache\&. If an image is found, it is used to generate the pixmap, which is then cached and returned\&. .PP If an image is not found, \fIimage_name\fP is used as a filename, and a search is made for an \fBX10\fP or \fBX11\fP bitmap file\&. If it is found, the file is read, converted into an image, and cached in the image cache\&. The image is then used to generate a pixmap, which is cached and returned\&. .PP If \fIimage_name\fP has a leading / (slash), it specifies a full pathname, and \fBXmGetPixmapByDepth\fP opens the file as specified\&. Otherwise, \fIimage_name\fP specifies a filename\&. In this case, \fBXmGetPixmapByDepth\fP looks for the file along a search path specified by the \fBXBMLANGPATH\fP environment variable or by a default search path, which varies depending on whether or not the \fBXAPPLRESDIR\fP environment variable is set\&. The default search path contains a lot of directories\&. Therefore, \fBXmGetPixmapByDepth\fP will need a relatively long time to search through all these directories for pixmaps and bitmaps\&. Applications that use a lot of pixmaps and bitmaps will probably run more quickly if \fBXBMLANGPATH\fP is set to a short list of directories\&. In addition to X bitmap files (XBM), Motif also supports XPM (X Pixmap) file formats, and, from version 2.3, JPEG and PNG image formats\&. (Note that support of JPEG and PNG image format is an optional feature of Motif, in order to check if current version supports PNG ang JPEG image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked correspondingly.) The \fBXBMLANGPATH\fP specifies the path for both XBM, XPM, PNG and JPEG files\&. XPM files are described in more detail later in this reference page\&. .PP The \fBXBMLANGPATH\fP environment variable specifies a search path for X bitmap files\&. It can contain the substitution field \fB%B\fP, where the \fIimage_name\fP argument to \fBXmGetPixmapByDepth\fP is substituted for \fB%B\fP\&. It can also contain the substitution fields accepted by \fBXtResolvePathname\fP\&. The substitution field \fB%T\fP is always mapped to \fIbitmaps\fP, and \fB%S\fP is always mapped to NULL\&. .PP If \fBXBMLANGPATH\fP is not set, but the environment variable \fBXAPPLRESDIR\fP is set, the following pathnames are searched: .IP " \(bu" 6 \fB%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB$XAPPLRESDIR/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/include/X11/bitmaps/%B\fP .PP If neither \fBXBMLANGPATH\fP nor \fBXAPPLRESDIR\fP is set, the following pathnames are searched: .IP " \(bu" 6 \fB%B\fP .IP " \(bu" 6 \fB$HOME/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB$HOME/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/bitmaps/%B\fP .IP " \(bu" 6 \fB$HOME/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%N/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%L/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l_%t/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/%l/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/lib/X11/bitmaps/%B\fP .IP " \(bu" 6 \fB/usr/include/X11/bitmaps/%B\fP .PP These paths are defaults that vendors may change\&. For example, a vendor may use different directories for \fB/usr/lib/X11\fP and \fB/usr/include/X11\fP\&. .PP The following substitutions are used in these paths: .IP "\fB%B\fP" 10 The image name, from the \fIimage_name\fP argument .IP "\fB%N\fP" 10 The class name of the application .IP "\fB%L\fP" 10 The display\&'s language string\&. This string is influenced by \fBXtSetLanguageProc\fP\&. The default string is determined by calling setlocale(\fBLC_ALL, NULL\fP)\&. .IP "\fB%l_%t\fP" 10 The language and territory component of the display\&'s language string .IP "\fB%l\fP" 10 The language component of the display\&'s language string .PP The contents of the file must conform to the rules for X11 bitmap files\&. In other words, Motif can read any X11 conformant bitmap file\&. .PP The XPM file format is used for storing or getting back colored X pixmaps from files\&. The XPM library is provided as unsupported with Motif\&. To build applications without XPM, use the \fBNO_XPM\fP macro\&. The following shows both XBM and XPM files, respectively, for a plaid pattern\&. .PP .nf \f(CW/* XBM file */ #define plaid_width 22 #define plaid_height 22 #define plaid_x_hot -1 #define plaid_y_hot -1 static char plaid_bits[] = { 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xff, 0x57, 0x15, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0x20, 0xa8, 0x2b, 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b, 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b, 0xff, 0xff, 0x3f, 0x20, 0xa8, 0x2b, 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b, 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b};\fR .fi .PP .PP .nf \f(CW/* XPM file */ static char * plaid[] = { /* plaid pixmap * width height ncolors chars_per_pixel */ "22 22 4 2 ", /* colors */ " c red m white s light_color ", "Y c green m black s lines_in_mix ", "+ c yellow m white s lines_in_dark ", "x m black s dark_color ", /* pixels */ "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", "Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", " x x x x x x x x x x x x x x x x ", "x x x x x x x x x x x x + x x x x x ", " x x x x Y x x x ", " x x x Y x x ", " x x x x Y x x x ", "x x x x x x x x x x x x x x x x x x x x x x ", " x x x x Y x x x ", " x x x Y x x ", " x x x x Y x x x ", " x x x Y x x ", " x x x x Y x x x " };\fR .fi .PP .SH "RETURN" .PP Returns a pixmap when successful; returns \fBXmUNSPECIFIED_PIXMAP\fP if the image corresponding to \fIimage_name\fP cannot be found\&. .SH "RELATED" .PP \fBXmDestroyPixmap\fP(3), \fBXmInstallImage\fP(3), and \fBXmUninstallImage\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmPanedGetPanes.30000644000175000017500000000301012672140200014774 00000000000000'\" t .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmPanedGetPanes" "library call" .SH "NAME" \fBXmPanedGetPanes\fP \(em A Paned function that returns the number of panes in the paned widget .iX "XmPanedGetPanes" .iX "Paned functions" "XmPanedGetPanes" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmPanedGetPanes\fP\fR( \fBWidget \fBwidget\fR\fR, \fBWidgetList *\fBpanes\fR\fR, \fBint *\fBnum\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmPanedGetPanes\fP Returns the number of panes in the paned widget\&. .IP "\fIwidget\fP" 10 Specifies the Paned widget ID .SH "RETURN" .IP "\fIpanes\fP" 10 Specifies the list of all panes contained in this widget .IP "\fInum\fP" 10 Specifies the number of panes in the paned widget .PP Returns the number of panes in the paned widget\&. .SH "RELATED" .PP \fBXmPaned\fP(3)\&. motif-2.3.8/doc/man/man3/XmHierarchyGetChildNodes.30000644000175000017500000000317612672140200016646 00000000000000'\" t ...\" LstGetMa.sgm /main/7 1996/08/30 15:42:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListGetMatchPos" "library call" .SH "NAME" \fBXmHierarchyGetChildNodes\fP \(em A List function that returns all instances of an item in the list .iX "XmListGetMatchPos" .iX "List functions" "XmListGetMatchPos" .SH "SYNOPSIS" .PP .nf #include \fBWidgetList \fBXmHierarchyGetChildNodes\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmHierarchyGetChildNodes\fP is a function that returns a list of child nodes of a Hierarchy\&. .IP "\fIwidget\fP" 10 Specifies the ID of the Hierarchy widget\&. .PP For a complete definition of List and its associated resources, see \fBXmHierarchy\fP(3)\&. .SH "RETURN" .PP Returns WidgetList with child nodes of the hierachy, or NULL if the hierachy contains no children\&. .SH "RELATED" .PP \fBXmHierarchy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmScaleSetTicks.30000644000175000017500000000546712672140200015041 00000000000000'\" t ...\" ScaleST.sgm /main/9 1996/09/08 21:00:05 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScaleSetTicks" "library call" .SH "NAME" \fBXmScaleSetTicks\fP \(em A Scale function that controls tick marks .iX "XmScaleSetTicks" .iX "Scale functions" "XmScaleSetTicks" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmScaleSetTicks\fP\fR( \fBWidget \fBscale\fR\fR, \fBint \fBbig_every\fR\fR, \fBCardinal \fBnum_medium\fR\fR, \fBCardinal \fBnum_small\fR\fR, \fBDimension \fBsize_big\fR\fR, \fBDimension \fBsize_medium\fR\fR, \fBDimension \fBsize_small\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmScaleSetTicks\fP controls the number, location, and size of the tick marks on a Scale\&. Each tick mark is a SeparatorGadget oriented perpendicular to the Scale\&'s orientation\&. For example, if the Scale is oriented horizontally, the tick marks will be oriented vertically\&. .PP If you specify tick marks for a Scale and then change the Scale\&'s orientation, you will have to do the following: .IP " \(bu" 6 Remove all the tick marks\&. To remove tick marks from a Scale, you must destroy (with \fBXtDestroyChildren\fP) the SeparatorGadget tick marks\&. The first two children of a Scale are its title and scroll bar, and all additional children are tick marks\&. .IP " \(bu" 6 Recreate the tick marks by calling \fBXmScaleSetTicks\fP\&. .IP "\fIscale\fP" 10 Specifies the Scale widget ID that is getting the tick marks\&. .IP "\fIbig_every\fP" 10 Specifies the number of scale values between big ticks\&. .IP "\fInum_medium\fP" 10 Specifies the number of medium ticks between big values\&. .IP "\fInum_small\fP" 10 Specifies the number of small ticks between medium values\&. .IP "\fIsize_big\fP" 10 Specifies the size (either width or height) of the big ticks\&. .IP "\fIsize_medium\fP" 10 Specifies the size (either width or height) of the medium ticks\&. .IP "\fIsize_small\fP" 10 Specifies the size (either width or height) of the small ticks\&. .PP For a complete definition of Scale and its associated resources, see \fBXmScale\fP(3)\&. .SH "RELATED" .PP \fBXmScale\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmRepTypeInstallTearOffModelConverter.30000644000175000017500000000306212672140200021364 00000000000000'\" t ...\" RepTypIn.sgm /main/7 1996/08/30 16:00:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRepTypeInstallTearOffModelConverter" "library call" .SH "NAME" \fBXmRepTypeInstallTearOffModelConverter\fP \(em A representation type manager function that installs the resource converter for XmNtearOffModel\&. .iX "XmRepTypeInstallTearOff\\%ModelConverter" .iX "representation type manager functions" "XmRepTypeInstallTearOff\\%ModelConverter" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmRepTypeInstallTearOffModelConverter\fP\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmRepTypeInstallTearOffModelConverter\fP installs the resource converter that allows values for the \fBXmNtearOffModel\fP resource to be specified in resource default files\&. .SH "RELATED" .PP \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:29 motif-2.3.8/doc/man/man3/XmVaCreateManagedDataField.30000644000175000017500000000003712672140200017031 00000000000000.so man3/XmVaCreateDataField.3 motif-2.3.8/doc/man/man3/XmColumn.30000644000175000017500000001475212672140200013572 00000000000000.TH "XmColumn" "library call" .SH "NAME" \fBXmColumn\fP \(em The XmColumn widget class .iX "XmColumn" .iX "widget class" "Column" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmColumn\fP displays its children stacked in a column, each with an optional associated label: labels appear in one column, and children in another. This is useful for displaying, for example, labeled data-entry fields. It can also display all label-child pairs in a horizontal orientation.This widget offers several constraint resources that allow specification of characteristics of the label, such as displaying text or a pixmap, alignment of text, font to use, and so forth. It also offers several resources for setting defaults for children that specify no specic values. .SH Classes .PP \fBXmColumn\fP inherits behavior and resources from Core, Composite, Constraint, XmManager, and XmBulletinBoard. .PP The class pointer is \fBxmColumnWidgetClass\fP\&. .PP The class name is \fBXmColumn\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\ (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be at createion time (C), or is not applicable (N/A)\&. .TS tab(^) box; c s s s s l| l| l| l| l. \fBXmColumn Resource Set\fP \fBName\fP^\fBClass\fP^\fBType\fP^\fBDefault\fP^\fBAccess\fP _^_^_^_^_^ XmNdefaultEntryLabelAlignment^XmCAlignment^unsigned char^XmALIGNMENT_BEGINNING^CSG _^_^_^_^_^ XmNdefaultEntryLabelFontList^XmCFontList^XmRFontList^dynamic^CGS _^_^_^_^_^ XmNdefaultEntryLabelRenderTable^XmCRendertable^XmRFontList^dynamic^CGS _^_^_^_^_^ XmNdefaultFillStyle^XmCFillStyle^unsigned char^XmFILL_RAGGED^CGS _^_^_^_^_^ XmNdistribution^XmCDistribution^unsigned char^XmDISTRIBUTE_TIGHT^CGS _^_^_^_^_^ XmNitemSpacing^XmCItemSpacing^Dimension^2^CSG _^_^_^_^_^ XmNlabelSpacing^XmCLabelSpacing^Dimentsion^10^CSG _^_^_^_^_^ XmNorientation^XmCOrientation^unsigned char^XmVERTICAL^CSG _^_^_^_^_^ .TE .IP "\fBXmNdefaultEntryLabelAlignment\fP" 10 Specifies the default XmNentryLabelAlignment to use when a child specifies no significant value. Resources that specify Alignment have values of XmALIGNMENT_BEGINNING, .br .B XmALIGNMENT_CENTER, XmALIGNMENT_END, and XmALIGNMENT_UNSPECIFIED. Valid string values that can be used in a resources file are: alignment_unspecified, unspecified, alignment_beginning, beginning, alignment_center, center, alignment_end, end. .IP "\fBXmNdefaultEntryLabelFontList\fP" 10 Specifies the default XmNentryLabelFontList to use when a child specifies no significant value. If unspecified, uses XmNlabelFontList resource of the XmBulletinBoard. .IP "\fBXmNdefaultFillStyle\fP" 10 Specifies the default XmNfillStyle to use when a child specifies no significant value. .IP "\fBXmNdistribution\fP" 10 Specifies whether the spacing between each pair of rows should be increased equally (XmDISTRIBUTE_SPREAD) or remain constant (XmDISTRIBUTE_TIGHT) when the column is resized vertically to be larger than its natural size. This resource has no effect if any child has its .br .B XmNstretchable resource set to True. This resource is valid only when the orientation is vertical. .IP "\fBXmNitemSpacing\fP" 10 Specifies the spacing between each pair of rows (in vertical orientation) or between pairs of labels and children (in horizontal orientation). .IP "\fBXmNlabelSpacing\fP" 10 Specifies the spacing between the column containing the labels and the column containing the XmColumn's children. .IP "\fBXmNorientation\fP" 10 Specifies the layout direction of the XmColumn. When XmVERTICAL, the widgets and their associated labels are laid out in two vertical columns. When XmHORIZONTAL, the widgets and their associated labels are laid out in a single row. .IP "" 10 .PP The visual appearance of columns is affected by setting constraint resources on the children of the XmColumn. These resources are derived from those supported by XmLabel; see the manual page for XmLabel for valid values and usage. .PP .TS tab(^) box; c s s s s l| l| l| l| l. \fBXmColumn Constraint Resource Set\fP \fBName\fP^\fBClass\fP^\fBType\fP^\fBDefault\fP^\fBAccessf\P _^_^_^_^_^ XmNentryLabelAlignment^XmCAlignment^unsigned char^XmALIGNMENT_UNSPECIFIED^CSG _^_^_^_^_^ XmNentryLabelFontList^XmCFontList^XmFontList^dynamic^CSG _^_^_^_^_^ XmNentryLabelRenderTable^XmCRenderTable^XmRenderTable^dynamic^CSG _^_^_^_^_^ XmNentryLabelPixmap^XmCLabelPixmap^Pixmap^XmUNPECIFIED_PIXMAP^CSG _^_^_^_^_^ XmNentryLabelString^XmCLabelString^XmString^NULL^CSG _^_^_^_^_^ XmNentryLabelType^XmCLabelType^unsigned char^XmSTRING^CSG _^_^_^_^_^ XmNfillStyle^XmCFillStyle^unsigned char^XmFILL_UNSPECIFIED^CSG _^_^_^_^_^ XmNshowEntryLabel^XmCShowLabel^Boolean^True^CSG _^_^_^_^_^ XmNstretchable^XmCStretchable^Boolean^False^CG _^_^_^_^_^ .TE .IP "\fBXmNentryLabelAlignment\fP" 10 Specifies justification of text within the child's associated label. Valid values are the same as those for XmNdefaultEntryLabelAlignment. .IP "\fBmNentryLabelFontList\fP" 10 Specifies fontList used to render the text within the child's associated label. .IP "\fBXmNentryLabelPixmap\fP" 10 Specifies the pixmap used in the child's associated label. .IP "\fBXmNentryLabelString\fP" 10 Specifies the text used in the child's associated label. .IP "\fBXmNentryLabelType\fP" 10 Specifies whether to display a string (XmSTRING) or a pixmap (XmPIXMAP) in the child's associated label. .IP "\fBXmNfillStyle\fP" 10 Specifies whether the child should be displayed at its natural size (XmFILL_RAGGED) or stretched to fill the entire width of the column it is displayed within (XmFILL_FLUSH). .br .B XmFILL_UNSPECIFIED uses the value of the XmColumn's XmNdefaultFillStyle. .IP "\fBXmNshowEntryLabel\fP" 10 Specifies whether or not to display the child's associated label. .IP "\fBXmNstretchable\fP" 10 Specifies whether the child should expand in size proportionately when the XmColumn is resized vertically to be larger than its natural size. .SH "RELATED" .PP \fBComposite\fP(3), \fBCore\fP(3), \fBXmBulletinBoard\fP(3), \fBXmCreateColumn\fP(3), \fBXmManager\fP(3), \fBXmVaCreateColumn\fP(3), and \fBXmVaCreateManagedColumn\fP(3)\&. .br .SH VERSION This manual page documents the XmColumn widget shipped in Motif version 2.2 .PP motif-2.3.8/doc/man/man3/XmObjectAtPoint.30000644000175000017500000000533112672140200015033 00000000000000'\" t ...\" ObjectAP.sgm /main/8 1996/09/08 20:54:48 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmObjectAtPoint" "library call" .SH "NAME" \fBXmObjectAtPoint\fP \(em A toolkit function that determines which child intersects or comes closest to a specified point .iX "XmObjectAtPoint" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmObjectAtPoint\fP\fR( \fBWidget \fBwidget\fR\fR, \fBPosition \fBx\fR\fR, \fBPosition \fBy\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmObjectAtPoint\fP searches the child list of the specified manager \fIwidget\fP and returns the child most closely associated with the specified \fIx\fP,\fIy\fP coordinate pair\&. .PP For the typical Motif manager \fIwidget\fP, \fBXmObjectAtPoint\fP uses the following rules to determine the returned object: .IP " \(bu" 6 If one child intersects \fIx,y\fP, \fBXmObjectAtPoint\fP returns the widget ID of that child\&. .IP " \(bu" 6 If more than one child intersects \fIx,y\fP, \fBXmObjectAtPoint\fP returns the widget ID of the visible child\&. .IP " \(bu" 6 If no child intersects \fIx\fP,\fIy\fP, \fBXmObjectAtPoint\fP returns NULL\&. .PP The preceding rules are only general\&. In fact, each manager \fIwidget\fP is free to define "most closely associated" as it desires\&. For example, if no child intersects \fIx,y\fP, a manager might return the child closest to \fIx,y\fP\&. .IP "\fIwidget\fP" 10 Specifies a manager widget\&. .IP "\fIx\fP" 10 Specifies the x-coordinate about which you are seeking child information\&. The x-coordinate must be specified in pixels, relative to the left side of \fImanager\fP\&. .IP "\fIy\fP" 10 Specifies the y-coordinate about which you are seeking child information\&. The y-coordinate must be specified in pixels, relative to the top side of \fImanager\fP\&. .SH "RETURN" .PP Returns the child of \fImanager\fP most closely associated with \fIx,y\fP\&. If none of its children are sufficiently associated with \fIx,y\fP, returns NULL\&. .SH "RELATED" .PP \fBXmManager\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmDataFieldGetSelection.30000644000175000017500000000340212672140200016446 00000000000000'\" t ...\" TxtFieAK.sgm /main/8 1996/09/08 21:13:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldGetSelection" "library call" .SH "NAME" \fBXmDataFieldGetSelection\fP \(em A DataField function that retrieves the value of the primary selection .iX "XmDataFieldGetSelection" .iX "DataField functions" "XmDataFieldGetSelection" .SH "SYNOPSIS" .PP .nf #include \fBchar * \fBXmDataFieldGetSelection\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldGetSelection\fP retrieves the value of the primary selection\&. It returns a NULL pointer if no text is selected in the widget\&. The application is responsible for freeing the storage associated with the string by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP Returns a character pointer to the string that is associated with the primary selection\&. .SH "RELATED" .PP \fBXmDataField\fP(3) and \fBXmDataFieldGetSelectionWcs\fP(3)\&. motif-2.3.8/doc/man/man3/XmFontSelector.30000644000175000017500000002631012672140200014735 00000000000000.DT .TH XmFontSelector 3X "" .SH NAME The Font Selector widget .SH SYNOPSIS #include .SH DESCRIPTION .PP .TS tab (%); l l. .TE .PP The Font Selector widget allows users to easily choose a font by selecting the font family and size of the font. The bold and italic attributes may also be set for any font for which they are available. Any font may be passed to the font selector by the application as the initial value shown to the user. Advanced features greatly extend the widget's functionality. .PP .SH Basic Features .PP The font selector widget presents the user with two combination box widgets, one with a list of choices for the font family, and the other with the choices for the font size. In addition there are two independent toggle buttons that allow the user to make the font bold or italic or bold/italic. Below the font choice area is a text widget that displays sample text of the chosen font to the user. This text area is editable, allowing the user to add or remove text to see how various characters appear in the chosen font. For the novice user this set of features allows access to all standard fonts on the system. The font selector dynamically removes choices that are inappropriate so the user is free to play around with different combinations and can always be assured that once they have selected a font that it will exist on the machine that the font selector is running on. For example if there is no Times Roman 14 point font available, and the user selects a point size of 14, then Times Roman will not be available in the family combination box. Likewise, if the user had chosen Times Roman from the family dialog box then a size of 14 would not be shown. To have all choices available simply choose a size and family of Any. .PP .SH Advanced Features .PP For the advanced user the font selector provides tremendous flexibility in font choices. By activating the options button an additional panel of controls is presented to the user. This allows the user to gain access to non-XLFD fonts, control the resolutions of the fonts chosen, choose from fixed or proportional fonts only, remove the use of font scaling, allow non iso8859-1 fonts to be viewed, and see the XLFD name the font selector is constructing. .PP .SH Non XLFD Fonts .PP By choosing the "Other Fonts" toggle from the option panel, the family and size lists, as well as the bold and italic toggles, are replaced with a combo box containing all non-XLFD fonts available on your system. This feature allows users to select non-XLFD fonts with the FontSelector. The text field of the combination box may be edited by the user and any string entered will be interpreted as a font name. It should be noted that XLFD names can be typed in by hand here. This feature allows the font selector to be used to get any font on the entire system. .PP .SH Resolution Control .PP The font selector finds which of the two standard resolutions the current display is closest to and uses that as its default. To allow a wider range of choices a user may choose to access fonts of a different resolution, or both 75 and 100 dpi resolutions. .PP .SH Fixed or Proportional .PP In most cases the fact that a font is fixed width or proportional is of no great interest to the user. But some applications require a fixed width font, such as terminal emulators, and most people find that proportional fonts look better. The Font selector allows users to limit the font choices to fixed width or proportional or to allow both. .PP .SH Font Scaling .PP The font scaling technology that is available in X11R5 uses bitmap scaling which, although useful in some cases, generally results in very ugly fonts. We noticed that users often wanted to know which fonts are scaled and which ones exist as hand crafted bitmaps. To remove the scaled fonts from the list of choices, toggle the "Use Font Scaling" button off. This value is resource controllable and defaults to on, which uses font scaling. .PP .SH Encoding .PP The programmer can specify which encidings are valid selctions. These encoding choices appear in an option menu. The list of font choices is restricted to those which use the current selected coding. .PP .SH XLFD Name Display .PP Clicking the Show toggle displays the current font's XLFD name is shown at the bottom of the font selector. .PP .SH Normal Resources .PP .TS tab (%); l l l l. Name%Class%Type%InitialValue 100DPIstring%100DPIString%XmString%"100 dpi" 75DPIstring%75DPIString%XmString%"75 dpi" anyLowerString%AnyLowerString%XmString%"any" anyString%AnyString%XmString%"Any" boldString%BoldString%XmString%"Bold" bothString%BothString%XmString%"Both" currentFont%String%String%NULL defaultEncodingString%DefaultEncodingString%String%"iso8859-1" encodingList%EncodingList%StringTable%"iso8859-1" encodingString%EncodingString%XmString%"Encoding" familyString%BothString%XmString%"Family" italicString%ItalicString%XmString%"Italic" marginHeight%Margin%Dimension%0 monoSpaceString%MonoSpaceString%XmString%"Fixed Width %%% Fonts" optionString%OptionString%XmString%"Options ..." otherString%OtherString%XmString%"Other Fonts" propSpaceString%PropSpaceString%XmString%"Proportional %%% Fonts" sampleText%SampleText%XmString%"abcdef..." scalingString%ScalingString%XmString%"Use Font %%% Scaling" showFontName%ShowFontName%Boolean%False showNameString%ShowNameString%XmString%"Show Font %%% Name" sizeString%SizeString%XmSring%"Size" spacing%Spacing%Dimension%2 textRows%TextRows%Dimension%8 useScaling%Boolean%Boolean%True valueChangedCallback%Callback%XtCallbackList%NULL xlfdString%XlfdString%XmString%"Xlfd Fonts" .TE .PP All resource names begin with XmN and all resource class names begin with XmC. .PP .SH 100DPSString .PP The label for the 100 DPI radio button. .PP .SH 75DPSString .PP The label for the 75 DPI radio button. .PP .SH anyLowerString .PP The label for the any button. .PP .SH anyString .PP The label for the Any button. .PP .SH boldString .PP The label for the Bold toggle button. .PP .SH bothString .PP The labels for the Both radio buttons controlling both the dpi and width of the fonts displayed. The same resource is used to ensure consistent labels. .PP .SH currentFont .PP This resource provides the main application input and output to the font selector. If the programmer sets the value at creation time or with XtSetValues then the currently displayed family, size, bold and italic will be changed to correspond to the values shown in the current font. Otherwise, the name of the font will be shown. The Font Selector's mode will be set to correspond to the type of font passed. .PP Note: currentFont must contain 14 hyphens (-) to be considered an XLFD font. This resource is also used to retrieve the font the user has selected from the font selector. The value returned is only valid until the next time XtGetValues is called on this instance of the font selector widget. .PP .SH defaultEncodingString .PP This resource is the default selection from the Encoding options menu. .PP .SH encodingList .PP This resource is the list of encodings available from the FontSelector Encoding options menu. .PP .SH encodingString .PP This resource is the default selection from the Encoding options menu. .PP .SH familyString .PP This resource is the default selection from the Family options menu. .PP .SH isoFontsOnly .PP This resource controls and maintains the state of the iso8859-1 fonts only toggle button. .PP .SH italicString .PP This resource is the default selection from the Italic toggle button. .PP .SH marginHeight .PP The margin height for all subwidgets of the Font Selector. .PP .SH monoSpaceString .PP The label of the Fixed Width Fonts radio button. .PP .SH optionString .PP The label for the Options... push button. .PP .SH otherString .PP The label for the Other Fonts radio button. .PP .SH propSpaceString .PP The label for the Proportional Fonts radio button. .PP .SH sampleText .PP The string which appears in the sample text area. .PP .SH scalingString .PP The label for the Use Font Scaling toggle button. .PP .SH showFontName .PP This boolean resource controls and maintains the state of Show Font Name toggle button. .PP .SH showNameString .PP The label of the Show Font Name toggle button. .PP .SH sizeString .PP The label for the Size option menu. .PP .SH spacing .PP The space between the toggle indicator and the toggle label. .PP .SH textRows .PP This resource controls the number of rows that are shown in the text widget that displays sample text in the currently selected font. Since this is a scrolled text widget it will never dynamically change size, regardless of the font displayed. Unless the initial font is large this value should be at least 4 or the user interaction may be poor. .PP .SH useScaling .PP This resource controls and maintains the state of the Use Font Scaling toggle button. .PP .SH valueChangedCallback .PP The list of callbacks called when the XmNcurrentFont value is changed. .PP .SH xlfdString .PP The label for the Xlfd Fonts radio button. .PP .SH Convenience Routine .PP .SH .HP 5 .SH XmCreateFontSelector - Widget creation convenience routine .nf Widget XmCreateFontSelector( Widget parent, /* Widget id of parent for FontSelector */ String name, /* Name of the created widget */ ArgList args, /* argument list */ Cardinal num_args /* number of items in argument list */ ) .nf .PP .SH Children .PP The font selector is composed of many sub-widgets. As with all widgets, most values passed to this widget through the argument list at creation time or via set values are passed to each of this widget's children. Get values requests must be made on a child by child basis. The children of the font selector are listed below. The documentation for each of the children should be consulted for a list of resources for each child. .ta 5,10,15,20,25,30,35 .df XiFontSelector XiPaned topPane XmComboBox families < See XmComboBox for list of children > XmSeparator separator XiComboBox sizes < See XmComboBox for list of children > XmSeparator separator XmButtonBox boldItalicBox XmToggleButton boldButton XmToggleButton italicButton XmSeparator separator XmToggleButton optionButton XmSeparator separator XmPaned middlePane XmPaned leftPane XmButtonBox choiceBox XmToggleButton xlfdButton XmToggleButton otherButton XmSeparator separator XmButtonBox resolutionBox XmToggleButton dpi75Button XmToggleButton dpi100Button XmToggleButton anyButton XmSeparator separator XmSeparator separator XmButtonBox spacingBox XmToggleButton proportionalButton XmToggleButton monoButton XmToggleButton bothButton XmSeparator separator XmButtonBox otherChoiceBox XmToggleButton scalingButton XmToggleButton isoButton XmToggleButton showNameButton XmRowColum encodingOptionMenu XmLabelGadget OptionLabel XmCascadeButtonGadget OptionButton XmMenuShell menuShell XmRowColum pulldownMenu XmSeparator separator XmSeparator separator XmButtonBox box XmScrolledWindow textSW XmScrollBar vbar XmText text XmSeparator separator XmLabel nameLabel XmSeparator separator .PP .SH COPYRIGHT .PP Copyright (c) 1992 by Integrated Computer Solutions, Inc. motif-2.3.8/doc/man/man3/XmVaCreateNotebook.30000644000175000017500000000270412672140200015522 00000000000000.DT .TH "XmVaCreateNotebook" "library call" .SH "NAME" \fBXmVaCreateNotebook\fP, \fBXmVaCreateManagedNotebook\fP \(em A Notebook widget convenience creation functions\&. .iX "XmVaCreateToggleNotebook" "XmVaCreateManagedNotebook" .iX "creation functions" "XmVaCreateNotebook" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateNotebook\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedNotebook\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateNotebook\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateNotebook\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of Notebook and its associated resources, see \fBXmNotebook\fP(3)\&. .SH "RETURN" .PP Returns the Notebook widget ID\&. .SH "RELATED" .PP \fBXmNotebook\fP(3), \fBXmCreateNotebook\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmGetDestination.30000644000175000017500000000360712672140200015253 00000000000000'\" t ...\" GetDest.sgm /main/6 1996/09/08 20:45:47 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetDestination" "library call" .SH "NAME" \fBXmGetDestination\fP \(em A function that returns the widget ID of the widget to be used as the current destination for quick paste and certain clipboard operations .iX "XmGetDestination" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetDestination\fP\fR( \fBDisplay \fB*display\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetDestination\fP returns the widget that is the current destination on the specified display\&. The destination is generally the last editable widget on which a select, edit, insert, or paste operation was performed and is the destination for quick paste and certain clipboard functions\&. The destination is NULL until a keyboard or mouse operation has been done on an editable widget\&. Refer to the \fIMotif Programmer\&'s Guide\fP for a description of keyboard focus\&. .IP "\fIdisplay\fP" 10 Specifies the display whose destination widget is to be queried .SH "RETURN" .PP Returns the widget ID for the current destination or NULL if there is no current destination\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmRenditionRetrieve.30000644000175000017500000000356212672140200015773 00000000000000'\" t ...\" RendD.sgm /main/7 1996/08/30 15:57:11 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRenditionRetrieve" "library call" .SH "NAME" \fBXmRenditionRetrieve\fP \(em A convenience function that retrieves rendition resources .iX "XmRenditionRetrieve" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmRenditionRetrieve\fP\fR( \fBXmRendition \fBrendition\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRenditionRetrieve\fP extracts values for the given resources (\fIarglist\fP) from the specified rendition\&. Note that the function returns the actual values of the resources, not copies\&. Therefore it is necessary to copy before modifying any resource whose value is an address\&. This will include such resources as \fBXmNfontName\fP, \fBXmNfont\fP, and \fBXmNtabList\fP\&. .IP "\fIrendition\fP" 10 Specifies the rendition\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .SH "RELATED" .PP \fBXmRendition\fP(3) and \fBXmTabListCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmSelectionBoxGetChild.30000644000175000017500000000521512672140200016331 00000000000000'\" t ...\" SelectB.sgm /main/8 1996/09/08 21:01:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmSelectionBoxGetChild" "library call" .SH "NAME" \fBXmSelectionBoxGetChild\fP \(em A SelectionBox function that is used to access a component .iX "XmSelectionBoxGetChild" .iX "SelectionBox functions" "XmSelectionBoxGetChild" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmSelectionBoxGetChild\fP\fR( \fBWidget \fBwidget\fR\fR, \fBunsigned char \fBchild\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmSelectionBoxGetChild\fP is used to access a component within a SelectionBox\&. The parameters given to the function are the SelectionBox widget and a value indicating which component to access\&. .PP NOTE: This routine is obsolete and exists for compatibility with previous releases\&. Instead of calling \fBXmSelectionBoxGetChild\fP, you should call \fBXtNameToWidget\fP as described in the \fBXmSelectionBox\fP(3) reference page\&. .IP "\fIwidget\fP" 10 Specifies the SelectionBox widget ID\&. .IP "\fIchild\fP" 10 Specifies a component within the SelectionBox\&. The following values are legal for this parameter: .RS .IP " \(bu" 6 \fBXmDIALOG_APPLY_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_CANCEL_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_DEFAULT_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_HELP_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_LIST\fP .IP " \(bu" 6 \fBXmDIALOG_LIST_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_OK_BUTTON\fP .IP " \(bu" 6 \fBXmDIALOG_SELECTION_LABEL\fP .IP " \(bu" 6 \fBXmDIALOG_SEPARATOR\fP .IP " \(bu" 6 \fBXmDIALOG_TEXT\fP .IP " \(bu" 6 \fBXmDIALOG_WORK_AREA\fP .RE .PP For a complete definition of SelectionBox and its associated resources, see \fBXmSelectionBox\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the specified SelectionBox component\&. An application should not assume that the returned widget will be of any particular class\&. .SH "RELATED" .PP \fBXmSelectionBox\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmDataFieldGetSelectionPosition.30000644000175000017500000000433212672140200020176 00000000000000'\" t ...\" TxtFieAL.sgm /main/8 1996/09/08 21:13:32 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldGetSelectionPosition" "library call" .SH "NAME" \fBXmDataFieldGetSelectionPosition\fP \(em A DataField function that accesses the position of the primary selection .iX "XmDataFieldGetSelection\\%Position" .iX "DataField functions" "XmDataFieldGetSelection\\%Position" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmDataFieldGetSelectionPosition\fP\fR( \fBWidget \fBwidget\fR\fR, \fBXmTextPosition \fB*left\fR\fR, \fBXmTextPosition \fB*right\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldGetSelectionPosition\fP accesses the left and right position of the primary selection in the text buffer of the DataField widget\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIleft\fP" 10 Specifies the pointer in which the position of the left boundary of the primary selection is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .IP "\fIright\fP" 10 Specifies the pointer in which the position of the right boundary of the primary selection is returned\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP This function returns True if the widget owns the primary selection; otherwise, it returns False\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. motif-2.3.8/doc/man/man3/XmCreateHierarchy.30000644000175000017500000000350112672140200015365 00000000000000'\" t ...\" CreFoA.sgm /main/7 1996/08/30 14:37:12 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCreateHierarchy" "library call" .SH "NAME" \fBXmCreateHierarchy\fP \(em The Hierarchy widget creation function .iX "XmCreateHierarchy" .iX "creation functions" "XmCreateHierarchy" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmCreateHierarchy\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCreateHierarchy\fP creates an instance of a Hierarchy widget and returns the associated widget ID\&. .IP "\fIparent\fP" 10 Specifies the parent widget ID .IP "\fIname\fP" 10 Specifies the name of the created widget .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of Hierarchy and its associated resources, see \fBXmHierarchy\fP(3)\&. .SH "RETURN" .PP Returns the Hierarchy widget ID\&. .SH "RELATED" .PP \fBXmHierarchy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:20 motif-2.3.8/doc/man/man3/XmAddWMProtocolCallback.30000644000175000017500000000414412672140200016422 00000000000000'\" t ...\" AddWMPrA.sgm /main/8 1996/09/25 10:14:39 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmAddWMProtocolCallback" "library call" .SH "NAME" \fBXmAddWMProtocolCallback\fP \(em A VendorShell convenience interface that adds client callbacks for a protocol .iX "XmAddWMProtocol\\%Callback" .iX "VendorShell functions" "XmAddWMProtocol\\%Callback" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmAddWMProtocolCallback\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBprotocol\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR, \fBXtPointer \fBclosure\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmAddWMProtocolCallback\fP is a convenience interface\&. It calls \fBXmAddProtocolCallback\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIprotocol\fP" 10 Specifies the protocol \fBAtom\fP .IP "\fIcallback\fP" 10 Specifies the procedure to call when a protocol message is received .IP "\fIclosure\fP" 10 Specifies the client data to be passed to the callback when it is invoked .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddProtocolCallback\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveWMProtocolCallback\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmDropSiteRegister.30000644000175000017500000000516612672140200015572 00000000000000'\" t ...\" DropSitT.sgm /main/8 1996/09/08 20:41:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropSiteRegister" "library call" .SH "NAME" \fBXmDropSiteRegister\fP \(em A Drag and Drop function that identifies a drop site and assigns resources that specify its behavior .iX "XmDropSiteRegister" .iX "Drag and Drop functions" "XmDropSiteRegister" .iX "register functions" "XmDropSiteRegister" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDropSiteRegister\fP\fR( \fBWidget \fBwidget\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropSiteRegister\fP identifies the specified widget or gadget as a drop site and sets resource values that define the drop site\&'s behavior\&. The routine assigns default values to any resources that are not specified in the argument list\&. The toolkit generates a warning message if a drop site is registered with \fBXmNdropSiteActivity\fP set to \fBXmDROP_SITE_ACTIVE\fP and the \fBXmNdropProc\fP resource is NULL\&. .PP If the drop site is a descendant of a widget that is registered as a drop site, the \fBXmNdropSiteType\fP resource of the ancestor drop site must be specified as \fBXmDROP_SITE_COMPOSITE\fP\&. The ancestor must be registered before the descendant\&. The drop site is stacked above all other sibling drop sites already registered\&. .IP "\fIwidget\fP" 10 Specifies the ID of the widget to be registered\&. .IP "\fIarglist\fP" 10 Specifies the argument list\&. .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP)\&. .PP For a complete definition of DropSite and its associated resources, see \fBXmDropSite\fP(3)\&. .SH "RELATED" .PP \fBXmDisplay\fP(3), \fBXmDropSite\fP(3), \fBXmDropSiteEndUpdate\fP(3), \fBXmDropSiteStartUpdate\fP(3), \fBXmDropSiteUpdate\fP(3), \fBXmDropSiteUnregister\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmDataFieldXYToPos.30000644000175000017500000000377612672140200015424 00000000000000'\" t ...\" TxtFieBI.sgm /main/8 1996/09/08 21:16:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDataFieldXYToPos" "library call" .SH "NAME" \fBXmDataFieldXYToPos\fP \(em A DataField function that accesses the character position nearest an x and y position .iX "XmDataFieldXYToPos" .iX "DataField functions" "XmDataFieldXYToPos" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmDataFieldXYToPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBPosition \fBx\fR\fR, \fBPosition \fBy\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDataFieldXYToPos\fP accesses the character position nearest to the specified \fIx\fP and \fIy\fP position, relative to the upper left corner of the DataField widget\&. .IP "\fIwidget\fP" 10 Specifies the DataField widget ID .IP "\fIx\fP" 10 Specifies the \fIx\fP position, relative to the upper left corner of the widget\&. .IP "\fIy\fP" 10 Specifies the \fIy\fP position, relative to the upper left corner of the widget\&. .PP For a complete definition of DataField and its associated resources, see \fBXmDataField\fP(3)\&. .SH "RETURN" .PP Returns the character position in the text nearest the \fIx\fP and \fIy\fP position specified\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .SH "RELATED" .PP \fBXmDataField\fP(3)\&. motif-2.3.8/doc/man/man3/XmTabListFree.30000644000175000017500000000263712672140200014500 00000000000000'\" t ...\" TabLstFr.sgm /main/8 1996/09/08 21:09:04 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTabListFree" "library call" .SH "NAME" \fBXmTabListFree\fP \(em A convenience function that frees the memory of a new tab list .iX "XmTabListFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTabListFree\fP\fR( \fBXmTabList \fBtablist\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTabListFree\fP recovers memory used by a tab list\&. In addition, this function frees all contained tabs\&. If the \fItablist\fP is NULL, the function returns immediately\&. .IP "\fItablist\fP" 10 Specifies the tab list to be freed\&. .SH "RELATED" .PP \fBXmTabList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/Makefile.am0000644000175000017500000004564313145162623014014 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(man_MANS) man_MANS = ApplicationShell.3 \ Composite.3 \ Constraint.3 \ Core.3 \ MrmCloseHierarchy.3 \ MrmFetchBitmapLiteral.3 \ MrmFetchColorLiteral.3 \ MrmFetchIconLiteral.3 \ MrmFetchLiteral.3 \ MrmFetchSetValues.3 \ MrmFetchWidget.3 \ MrmFetchWidgetOverride.3 \ MrmInitialize.3 \ MrmOpenHierarchy.3 \ MrmOpenHierarchyFromBuffer.3 \ MrmOpenHierarchyPerDisplay.3 \ MrmRegisterClass.3 \ MrmRegisterNames.3 \ MrmRegisterNamesInHierarchy.3 \ Object.3 \ OverrideShell.3 \ RectObj.3 \ Shell.3 \ TopLevelShell.3 \ TransientShell.3 \ Uil.3 \ UilDumpSymbolTable.3 \ VendorShell.3 \ VirtualBindings.3 \ WMShell.3 \ XmActivateProtocol.3 \ XmActivateWMProtocol.3 \ XmAddProtocolCallback.3 \ XmAddProtocols.3 \ XmAddTabGroup.3 \ XmAddToPostFromList.3 \ XmAddWMProtocolCallback.3 \ XmAddWMProtocols.3 \ XmArrowButton.3 \ XmArrowButtonGadget.3 \ XmBulletinBoard.3 \ XmButtonBox.3 \ XmCascadeButton.3 \ XmCascadeButtonGadget.3 \ XmCascadeButtonGadgetHighlight.3 \ XmCascadeButtonHighlight.3 \ XmChangeColor.3 \ XmClipboardCancelCopy.3 \ XmClipboardCopy.3 \ XmClipboardCopyByName.3 \ XmClipboardEndCopy.3 \ XmClipboardEndRetrieve.3 \ XmClipboardInquireCount.3 \ XmClipboardInquireFormat.3 \ XmClipboardInquireLength.3 \ XmClipboardInquirePendingItems.3 \ XmClipboardLock.3 \ XmClipboardRegisterFormat.3 \ XmClipboardRetrieve.3 \ XmClipboardStartCopy.3 \ XmClipboardStartRetrieve.3 \ XmClipboardUndoCopy.3 \ XmClipboardUnlock.3 \ XmClipboardWithdrawFormat.3 \ XmColorSelector.3 \ XmColumn.3 \ XmComboBox.3 \ XmComboBoxAddItem.3 \ XmComboBoxDeletePos.3 \ XmComboBoxSelectItem.3 \ XmComboBoxSetItem.3 \ XmComboBoxUpdate.3 \ XmCommand.3 \ XmCommandAppendValue.3 \ XmCommandError.3 \ XmCommandGetChild.3 \ XmCommandSetValue.3 \ XmContainer.3 \ XmContainerCopy.3 \ XmContainerCopyLink.3 \ XmContainerCut.3 \ XmContainerGetItemChildren.3 \ XmContainerPaste.3 \ XmContainerPasteLink.3 \ XmContainerRelayout.3 \ XmContainerReorder.3 \ XmConvertStringToUnits.3 \ XmConvertUnits.3 \ XmCreateArrowButton.3 \ XmCreateArrowButtonGadget.3 \ XmCreateBulletinBoard.3 \ XmCreateBulletinBoardDialog.3 \ XmCreateButtonBox.3 \ XmCreateCascadeButton.3 \ XmCreateCascadeButtonGadget.3 \ XmCreateDropDown.3 \ XmCreateComboBox.3 \ XmCreateCombinationBox2.3 \ XmCreateCommand.3 \ XmCreateCommandDialog.3 \ XmCreateContainer.3 \ XmCreateDialogShell.3 \ XmCreateDragIcon.3 \ XmCreateDrawingArea.3 \ XmCreateDrawnButton.3 \ XmCreateDropDownComboBox.3 \ XmCreateDropDownList.3 \ XmCreateErrorDialog.3 \ XmCreateFileSelectionBox.3 \ XmCreateFileSelectionDialog.3 \ XmCreateForm.3 \ XmCreateFormDialog.3 \ XmCreateFrame.3 \ XmCreateHierarchy.3 \ XmCreateIconGadget.3 \ XmCreateInformationDialog.3 \ XmCreateLabel.3 \ XmCreateLabelGadget.3 \ XmCreateList.3 \ XmCreateMainWindow.3 \ XmCreateMenuBar.3 \ XmCreateMenuShell.3 \ XmCreateMessageBox.3 \ XmCreateMessageDialog.3 \ XmCreateNotebook.3 \ XmCreateOptionMenu.3 \ XmCreateOutline.3 \ XmCreatePanedWindow.3 \ XmCreatePopupMenu.3 \ XmCreatePromptDialog.3 \ XmCreatePulldownMenu.3 \ XmCreatePushButton.3 \ XmCreatePushButtonGadget.3 \ XmCreateQuestionDialog.3 \ XmCreateRadioBox.3 \ XmCreateRowColumn.3 \ XmCreateScale.3 \ XmCreateScrollBar.3 \ XmCreateScrolledList.3 \ XmCreateScrolledText.3 \ XmCreateScrolledWindow.3 \ XmCreateSelectionBox.3 \ XmCreateSelectionDialog.3 \ XmCreateSeparator.3 \ XmCreateSeparatorGadget.3 \ XmCreateSimpleCheckBox.3 \ XmCreateSimpleMenuBar.3 \ XmCreateSimpleOptionMenu.3 \ XmCreateSimplePopupMenu.3 \ XmCreateSimplePulldownMenu.3 \ XmCreateSimpleRadioBox.3 \ XmCreateSimpleSpinBox.3 \ XmCreateSpinBox.3 \ XmCreateTemplateDialog.3 \ XmCreateText.3 \ XmCreateTextField.3 \ XmCreateToggleButton.3 \ XmCreateToggleButtonGadget.3 \ XmCreateWarningDialog.3 \ XmCreateWorkArea.3 \ XmCreateWorkingDialog.3 \ XmCvtByteStreamToXmString.3 \ XmCvtCTToXmString.3 \ XmCvtStringToUnitType.3 \ XmCvtTextPropertyToXmStringTable.3 \ XmCvtXmStringTableToTextProperty.3 \ XmCvtXmStringToByteStream.3 \ XmCvtXmStringToCT.3 \ XmDataField.3 \ XmDataFieldCopy.3 \ XmDataFieldCut.3 \ XmDataFieldPaste.3 \ XmDataFieldGetSelection.3 \ XmDataFieldGetSelectionPosition.3 \ XmDataFieldGetString.3 \ XmDataFieldGetStringWcs.3 \ XmDataFieldSetAddMode.3 \ XmDataFieldSetEditable.3 \ XmDataFieldSetHighlight.3 \ XmDataFieldSetInsertionPosition.3 \ XmDataFieldSetSelection.3 \ XmDataFieldSetString.3 \ XmDataFieldXYToPos.3 \ XmDeactivateProtocol.3 \ XmDeactivateWMProtocol.3 \ XmDestroyPixmap.3 \ XmDialogShell.3 \ XmDirection.3 \ XmDirectionMatch.3 \ XmDirectionMatchPartial.3 \ XmDirectionToStringDirection.3 \ XmDisplay.3 \ XmDragCancel.3 \ XmDragContext.3 \ XmDragIcon.3 \ XmDragStart.3 \ XmDrawingArea.3 \ XmDrawnButton.3 \ XmDropDown.3 \ XmDropDownGetChild.3 \ XmDropSite.3 \ XmDropSiteConfigureStackingOrder.3 \ XmDropSiteEndUpdate.3 \ XmDropSiteQueryStackingOrder.3 \ XmDropSiteRegister.3 \ XmDropSiteRegistered.3 \ XmDropSiteRetrieve.3 \ XmDropSiteStartUpdate.3 \ XmDropSiteUnregister.3 \ XmDropSiteUpdate.3 \ XmDropTransfer.3 \ XmDropTransferAdd.3 \ XmDropTransferStart.3 \ XmMultiList.3 \ XmMultiListDeselectItems.3 \ XmMultiListDeselectRow.3 \ XmMultiListGetSelectedRowArray.3 \ XmMultiListGetSelectedRows.3 \ XmMultiListMakeRowVisible.3 \ XmMultiListSelectAllItems.3 \ XmMultiListSelectItems.3 \ XmMultiListSelectRow.3 \ XmMultiListToggleRow.3 \ XmMultiListUnselectAllItems.3 \ XmMultiListUnselectItem.3 \ XmExt18List.3 \ XmFileSelectionBox.3 \ XmFileSelectionBoxGetChild.3 \ XmFileSelectionDoSearch.3 \ XmFontList.3 \ XmFontListAdd.3 \ XmFontListAppendEntry.3 \ XmFontListCopy.3 \ XmFontListCreate.3 \ XmFontListEntryCreate.3 \ XmFontListEntryFree.3 \ XmFontListEntryGetFont.3 \ XmFontListEntryGetTag.3 \ XmFontListEntryLoad.3 \ XmFontListFree.3 \ XmFontListFreeFontContext.3 \ XmFontListGetNextFont.3 \ XmFontListInitFontContext.3 \ XmFontListNextEntry.3 \ XmFontListRemoveEntry.3 \ XmFontSelector.3 \ XmForm.3 \ XmFrame.3 \ XmGadget.3 \ XmGetAtomName.3 \ XmGetColorCalculation.3 \ XmGetColors.3 \ XmGetDestination.3 \ XmGetDragContext.3 \ XmGetFocusWidget.3 \ XmGetMenuCursor.3 \ XmGetPixmap.3 \ XmGetPixmapByDepth.3 \ XmGetPostedFromWidget.3 \ XmGetScaledPixmap.3 \ XmGetSecondaryResourceData.3 \ XmGetTabGroup.3 \ XmGetTearOffControl.3 \ XmGetVisibility.3 \ XmGetXmDisplay.3 \ XmGetXmScreen.3 \ XmHierarchy.3 \ XmHierarchyGetChildNodes.3 \ XmHierarchyOpenAllAncestors.3 \ XmIconBox.3 \ XmIconBoxIsCellEmpty.3 \ XmIconButton.3 \ XmIconGadget.3 \ XmImCloseXIM.3 \ XmImFreeXIC.3 \ XmImGetXIC.3 \ XmImGetXIM.3 \ XmImMbLookupString.3 \ XmImMbResetIC.3 \ XmImRegister.3 \ XmImSetFocusValues.3 \ XmImSetValues.3 \ XmImSetXIC.3 \ XmImUnregister.3 \ XmImUnsetFocus.3 \ XmImVaSetFocusValues.3 \ XmImVaSetValues.3 \ XmInstallImage.3 \ XmInternAtom.3 \ XmIsMotifWMRunning.3 \ XmIsTraversable.3 \ XmLabel.3 \ XmLabelGadget.3 \ XmList.3 \ XmListAddItem.3 \ XmListAddItems.3 \ XmListAddItemsUnselected.3 \ XmListAddItemUnselected.3 \ XmListDeleteAllItems.3 \ XmListDeleteItem.3 \ XmListDeleteItems.3 \ XmListDeleteItemsPos.3 \ XmListDeletePos.3 \ XmListDeletePositions.3 \ XmListDeselectAllItems.3 \ XmListDeselectItem.3 \ XmListDeselectPos.3 \ XmListGetKbdItemPos.3 \ XmListGetMatchPos.3 \ XmListGetSelectedPos.3 \ XmListItemExists.3 \ XmListItemPos.3 \ XmListPosSelected.3 \ XmListPosToBounds.3 \ XmListReplaceItems.3 \ XmListReplaceItemsPos.3 \ XmListReplaceItemsPosUnselected.3 \ XmListReplaceItemsUnselected.3 \ XmListReplacePositions.3 \ XmListSelectItem.3 \ XmListSelectPos.3 \ XmListSetAddMode.3 \ XmListSetBottomItem.3 \ XmListSetBottomPos.3 \ XmListSetHorizPos.3 \ XmListSetItem.3 \ XmListSetKbdItemPos.3 \ XmListSetPos.3 \ XmListUpdateSelectedList.3 \ XmListYToPos.3 \ XmMainWindow.3 \ XmMainWindowSep1.3 \ XmMainWindowSep2.3 \ XmMainWindowSep3.3 \ XmMainWindowSetAreas.3 \ XmManager.3 \ XmMapSegmentEncoding.3 \ XmMenuPosition.3 \ XmMenuShell.3 \ XmMessageBox.3 \ XmMessageBoxGetChild.3 \ XmNotebook.3 \ XmNotebookGetPageInfo.3 \ XmObjectAtPoint.3 \ XmOptionButtonGadget.3 \ XmOptionLabelGadget.3 \ XmOutline.3 \ XmPaned.3 \ XmPanedGetPanes.3 \ XmPanedWindow.3 \ XmParseMapping.3 \ XmParseMappingCreate.3 \ XmParseMappingFree.3 \ XmParseMappingGetValues.3 \ XmParseMappingSetValues.3 \ XmParseTable.3 \ XmParseTableFree.3 \ XmPrimitive.3 \ XmPrintPopupPDM.3 \ XmPrintSetup.3 \ XmPrintShell.3 \ XmPrintToFile.3 \ XmProcessTraversal.3 \ XmPushButton.3 \ XmPushButtonGadget.3 \ XmRedisplayWidget.3 \ XmRegisterSegmentEncoding.3 \ XmRemoveFromPostFromList.3 \ XmRemoveProtocolCallback.3 \ XmRemoveProtocols.3 \ XmRemoveTabGroup.3 \ XmRemoveWMProtocolCallback.3 \ XmRemoveWMProtocols.3 \ XmRenderTable.3 \ XmRenderTableAddRenditions.3 \ XmRenderTableCopy.3 \ XmRenderTableCvtFromProp.3 \ XmRenderTableCvtToProp.3 \ XmRenderTableFree.3 \ XmRenderTableGetRendition.3 \ XmRenderTableGetRenditions.3 \ XmRenderTableGetTags.3 \ XmRenderTableRemoveRenditions.3 \ XmRendition.3 \ XmRenditionCreate.3 \ XmRenditionFree.3 \ XmRenditionRetrieve.3 \ XmRenditionUpdate.3 \ XmRepTypeAddReverse.3 \ XmRepTypeGetId.3 \ XmRepTypeGetNameList.3 \ XmRepTypeGetRecord.3 \ XmRepTypeGetRegistered.3 \ XmRepTypeInstallTearOffModelConverter.3 \ XmRepTypeRegister.3 \ XmRepTypeValidValue.3 \ XmResolveAllPartOffsets.3 \ XmResolvePartOffsets.3 \ XmRowColumn.3 \ XmScale.3 \ XmScaleGetValue.3 \ XmScaleSetTicks.3 \ XmScaleSetValue.3 \ XmScreen.3 \ XmScrollBar.3 \ XmScrollBarGetValues.3 \ XmScrollBarSetValues.3 \ XmScrolledWindow.3 \ XmScrolledWindowSetAreas.3 \ XmScrollVisible.3 \ XmSelectionBox.3 \ XmSelectionBoxGetChild.3 \ XmSeparator.3 \ XmSeparatorGadget.3 \ XmSetColorCalculation.3 \ XmSetFontUnit.3 \ XmSetFontUnits.3 \ XmSetMenuCursor.3 \ XmSetProtocolHooks.3 \ XmSetWMProtocolHooks.3 \ XmSimpleSpinBox.3 \ XmSimpleSpinBoxAddItem.3 \ XmSimpleSpinBoxDeletePos.3 \ XmSimpleSpinBoxSetItem.3 \ XmSlideContext.3 \ XmSpinBox.3 \ XmSpinBoxValidatePosition.3 \ XmString.3 \ XmStringBaseline.3 \ XmStringByteCompare.3 \ XmStringByteStreamLength.3 \ XmStringCompare.3 \ XmStringComponentCreate.3 \ XmStringComponentType.3 \ XmStringConcat.3 \ XmStringConcatAndFree.3 \ XmStringCopy.3 \ XmStringCreate.3 \ XmStringCreateLocalized.3 \ XmStringCreateLtoR.3 \ XmStringCreateSimple.3 \ XmStringDirection.3 \ XmStringDirectionCreate.3 \ XmStringDirectionToDirection.3 \ XmStringDraw.3 \ XmStringDrawImage.3 \ XmStringDrawUnderline.3 \ XmStringEmpty.3 \ XmStringExtent.3 \ XmStringFree.3 \ XmStringFreeContext.3 \ XmStringGenerate.3 \ XmStringGetLtoR.3 \ XmStringGetNextComponent.3 \ XmStringGetNextSegment.3 \ XmStringGetNextTriple.3 \ XmStringHasSubstring.3 \ XmStringHeight.3 \ XmStringInitContext.3 \ XmStringIsVoid.3 \ XmStringLength.3 \ XmStringLineCount.3 \ XmStringNConcat.3 \ XmStringNCopy.3 \ XmStringParseText.3 \ XmStringPeekNextComponent.3 \ XmStringPeekNextTriple.3 \ XmStringPutRendition.3 \ XmStringSegmentCreate.3 \ XmStringSeparatorCreate.3 \ XmStringTable.3 \ XmStringTableParseStringArray.3 \ XmStringTableProposeTablist.3 \ XmStringTableToXmString.3 \ XmStringTableUnparse.3 \ XmStringToXmStringTable.3 \ XmStringUnparse.3 \ XmStringWidth.3 \ XmTab.3 \ XmTabCreate.3 \ XmTabFree.3 \ XmTabGetValues.3 \ XmTabList.3 \ XmTabListCopy.3 \ XmTabListFree.3 \ XmTabListGetTab.3 \ XmTabListInsertTabs.3 \ XmTabListRemoveTabs.3 \ XmTabListReplacePositions.3 \ XmTabListTabCount.3 \ XmTabSetValue.3 \ XmTabStack.3 \ XmTabStackGetSelectedTab.3 \ XmTabStackSelectTab.3 \ XmTabStackXYToWidget.3 \ XmTargetsAreCompatible.3 \ XmText.3 \ XmTextClearSelection.3 \ XmTextCopy.3 \ XmTextCopyLink.3 \ XmTextCut.3 \ XmTextDisableRedisplay.3 \ XmTextEnableRedisplay.3 \ XmTextField.3 \ XmTextFieldClearSelection.3 \ XmTextFieldCopy.3 \ XmTextFieldCopyLink.3 \ XmTextFieldCut.3 \ XmTextFieldGetBaseline.3 \ XmTextFieldGetEditable.3 \ XmTextFieldGetInsertionPosition.3 \ XmTextFieldGetLastPosition.3 \ XmTextFieldGetMaxLength.3 \ XmTextFieldGetSelection.3 \ XmTextFieldGetSelectionPosition.3 \ XmTextFieldGetSelectionWcs.3 \ XmTextFieldGetString.3 \ XmTextFieldGetStringWcs.3 \ XmTextFieldGetSubstring.3 \ XmTextFieldGetSubstringWcs.3 \ XmTextFieldInsert.3 \ XmTextFieldInsertWcs.3 \ XmTextFieldPaste.3 \ XmTextFieldPasteLink.3 \ XmTextFieldPosToXY.3 \ XmTextFieldRemove.3 \ XmTextFieldReplace.3 \ XmTextFieldReplaceWcs.3 \ XmTextFieldSetAddMode.3 \ XmTextFieldSetEditable.3 \ XmTextFieldSetHighlight.3 \ XmTextFieldSetInsertionPosition.3 \ XmTextFieldSetMaxLength.3 \ XmTextFieldSetSelection.3 \ XmTextFieldSetString.3 \ XmTextFieldSetStringWcs.3 \ XmTextFieldShowPosition.3 \ XmTextFieldXYToPos.3 \ XmTextFindString.3 \ XmTextFindStringWcs.3 \ XmTextGetBaseline.3 \ XmTextGetCenterline.3 \ XmTextGetEditable.3 \ XmTextGetInsertionPosition.3 \ XmTextGetLastPosition.3 \ XmTextGetMaxLength.3 \ XmTextGetSelection.3 \ XmTextGetSelectionPosition.3 \ XmTextGetSelectionWcs.3 \ XmTextGetSource.3 \ XmTextGetString.3 \ XmTextGetStringWcs.3 \ XmTextGetSubstring.3 \ XmTextGetSubstringWcs.3 \ XmTextGetTopCharacter.3 \ XmTextInsert.3 \ XmTextInsertWcs.3 \ XmTextPaste.3 \ XmTextPasteLink.3 \ XmTextPosition.3 \ XmTextPosToXY.3 \ XmTextRemove.3 \ XmTextReplace.3 \ XmTextReplaceWcs.3 \ XmTextScroll.3 \ XmTextSetAddMode.3 \ XmTextSetEditable.3 \ XmTextSetHighlight.3 \ XmTextSetInsertionPosition.3 \ XmTextSetMaxLength.3 \ XmTextSetSelection.3 \ XmTextSetSource.3 \ XmTextSetString.3 \ XmTextSetStringWcs.3 \ XmTextSetTopCharacter.3 \ XmTextShowPosition.3 \ XmTextXYToPos.3 \ XmToggleButton.3 \ XmToggleButtonGadget.3 \ XmToggleButtonGadgetGetState.3 \ XmToggleButtonGadgetSetState.3 \ XmToggleButtonGetState.3 \ XmToggleButtonSetState.3 \ XmToggleButtonSetValue.3 \ XmTrackingEvent.3 \ XmTrackingLocate.3 \ XmTransferDone.3 \ XmTransferSendRequest.3 \ XmTransferSetParameters.3 \ XmTransferStartRequest.3 \ XmTransferValue.3 \ XmTranslateKey.3 \ XmTree.3 \ XmUninstallImage.3 \ XmUpdateDisplay.3 \ XmVaCreateArrowButton.3 \ XmVaCreateArrowButtonGadget.3 \ XmVaCreateBulletinBoard.3 \ XmVaCreateButtonBox.3 \ XmVaCreateCascadeButton.3 \ XmVaCreateCascadeButtonGadget.3 \ XmVaCreateColorSelector.3 \ XmVaCreateColumn.3 \ XmVaCreateCombinationBox2.3 \ XmVaCreateComboBox.3 \ XmVaCreateCommand.3 \ XmVaCreateContainer.3 \ XmVaCreateDataField.3 \ XmVaCreateDrawingArea.3 \ XmVaCreateDrawnButton.3 \ XmVaCreateDropDown.3 \ XmVaCreateExt18List.3 \ XmVaCreateFileSelectionBox.3 \ XmVaCreateForm.3 \ XmVaCreateFrame.3 \ XmVaCreateHierarchy.3 \ XmVaCreateIconGadget.3 \ XmVaCreateLabel.3 \ XmVaCreateLabelGadget.3 \ XmVaCreateList.3 \ XmVaCreateMainWindow.3 \ XmVaCreateManagedArrowButton.3 \ XmVaCreateManagedArrowButtonGadget.3 \ XmVaCreateManagedBulletinBoard.3 \ XmVaCreateManagedButtonBox.3 \ XmVaCreateManagedCascadeButton.3 \ XmVaCreateManagedCascadeButtonGadget.3 \ XmVaCreateManagedColorSelector.3 \ XmVaCreateManagedColumn.3 \ XmVaCreateManagedComboBox.3 \ XmVaCreateManagedCombinationBox2.3 \ XmVaCreateManagedCommand.3 \ XmVaCreateManagedContainer.3 \ XmVaCreateManagedDataField.3 \ XmVaCreateManagedDrawingArea.3 \ XmVaCreateManagedDrawnButton.3 \ XmVaCreateManagedDropDown.3 \ XmVaCreateManagedExt18List.3 \ XmVaCreateManagedFileSelectionBox.3 \ XmVaCreateManagedForm.3 \ XmVaCreateManagedFrame.3 \ XmVaCreateManagedHierarchy.3 \ XmVaCreateManagedIconGadget.3 \ XmVaCreateManagedLabel.3 \ XmVaCreateManagedLabelGadget.3 \ XmVaCreateManagedList.3 \ XmVaCreateManagedMainWindow.3 \ XmVaCreateManagedMessageBox.3 \ XmVaCreateManagedMultiList.3 \ XmVaCreateManagedNotebook.3 \ XmVaCreateManagedOutline.3 \ XmVaCreateManagedPanedWindow.3 \ XmVaCreateManagedPushButton.3 \ XmVaCreateManagedPushButtonGadget.3 \ XmVaCreateManagedRowColumn.3 \ XmVaCreateManagedScale.3 \ XmVaCreateManagedScrollBar.3 \ XmVaCreateManagedScrolledWindow.3 \ XmVaCreateManagedSelectionBox.3 \ XmVaCreateManagedSeparatorGadget.3 \ XmVaCreateManagedSimpleSpinBox.3 \ XmVaCreateManagedSpinBox.3 \ XmVaCreateManagedTabStack.3 \ XmVaCreateManagedText.3 \ XmVaCreateManagedTextField.3 \ XmVaCreateManagedToggleButton.3 \ XmVaCreateManagedToggleButtonGadget.3 \ XmVaCreateMessageBox.3 \ XmVaCreateMultiList.3 \ XmVaCreateNotebook.3 \ XmVaCreateOutline.3 \ XmVaCreatePanedWindow.3 \ XmVaCreatePushButton.3 \ XmVaCreatePushButtonGadget.3 \ XmVaCreateRowColumn.3 \ XmVaCreateScale.3 \ XmVaCreateScrollBar.3 \ XmVaCreateScrolledWindow.3 \ XmVaCreateSelectionBox.3 \ XmVaCreateSeparatorGadget.3 \ XmVaCreateSimpleCheckBox.3 \ XmVaCreateSimpleMenuBar.3 \ XmVaCreateSimpleOptionMenu.3 \ XmVaCreateSimplePopupMenu.3 \ XmVaCreateSimplePulldownMenu.3 \ XmVaCreateSimpleRadioBox.3 \ XmVaCreateSimpleSpinBox.3 \ XmVaCreateSpinBox.3 \ XmVaCreateTabStack.3 \ XmVaCreateText.3 \ XmVaCreateTextField.3 \ XmVaCreateToggleButton.3 \ XmVaCreateToggleButtonGadget.3 \ XmWidgetGetBaselines.3 \ XmWidgetGetDisplayRect.3 motif-2.3.8/doc/man/man3/XmMultiListSelectAllItems.30000644000175000017500000000127612672140200017053 00000000000000.TH "XmMultiListSelectAllItems" "library call" .SH "NAME" \fBXmMultiListSelectAllItems\fP \(em an MultiList function that selects all rows of the list .iX "XmMultiListSelectAllItems" .iX "MultiList functions" "XmMultiListSelectAllItems" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmMultiListSelectAllItems\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP Selects all rows of the passed MultiList widget and returns nothing\&. .IP "\fIwidget\fP" 10 Specifies the ID of the MultiList widget from whose list items is deselected\&. .PP For a complete definition of MultiList and its associated resources, see \fBXmMultiList\fP(3)\&. .SH "RELATED" .PP \fBXmMultiList\fP(3)\&. motif-2.3.8/doc/man/man3/XmFileSelectionBox.30000644000175000017500000012431612672140200015531 00000000000000'\" t ...\" FileSelA.sgm /main/12 1996/09/26 14:54:48 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFileSelectionBox" "library call" .SH "NAME" \fBXmFileSelectionBox\fP \(em The FileSelectionBox widget class .iX "XmFileSelectionBox" .iX "widget class" "FileSelectionBox" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP FileSelectionBox traverses through directories, views the files and subdirectories in them, and then selects files\&. .PP A FileSelectionBox has five main areas: .IP " \(bu" 6 A text input field for displaying and editing a directory mask used to select the files to be displayed .IP " \(bu" 6 An optional text input field for displaying and editing a filter mask used to select the files to be displayed\&. .IP " \(bu" 6 A scrollable list of filenames .IP " \(bu" 6 A scrollable list of subdirectories .IP " \(bu" 6 A text input field for displaying and editing a filename .IP " \(bu" 6 A group of PushButtons, labeled \fBOK\fP, \fBFilter\fP, \fBCancel\fP, and \fBHelp\fP\&. The layout direction of the buttons depends on the \fBXmNlayoutDirection\fP resource\&. .PP ####Additional children may be added to the FileSelectionBox after creation\&. FileSelectionBox inherits the layout functionality provided by SelectionBox for any additional children\&. To remove the list of filenames, the list of subdirectories, or both from the FileSelectionBox after creation, unmanage the appropriate widgets and their labels\&. The list and label widgets are obtained through a call to the \fBXmFileSelectionBoxGetChild\fP function\&. To remove either the directory list or the file list, unmanage the parent of the appropriate list widget and unmanage the corresponding label\&. .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of FileSelectionBox\&. The following list identifies the names of these widgets (or gadgets) and the associated FileSelectionBox areas: .IP "FilterLabel" 10 \fBFilterText\fP .IP "Filter Text" 10 \fBTextField\fP .IP "Directory List" 10 \fBDirList\fP .IP "Directory List Label" 10 \fBDir\fP .IP "DirL" 10 \fBLabel\fP .IP "DirText" 10 \fBTextField\fP .PP The directory mask is a string specifying the base directory to be examined and a search pattern\&. Ordinarily, the directory list displays the subdirectories of the base directory, as well as the base directory itself and its parent directory\&. The file list ordinarily displays all files and/or subdirectories in the base directory that match the search pattern\&. .PP Optionally, the search pattern mask and the base directory can be displayed in two separate text fields\&. This option is controlled by the \fBXmNpathMode\fP resource\&. Using this alternate display does not change the meaning of resources that control the content of these fields: \fBXmNdirectory\fP, \fBXmNdirMask\fP, \fBXmNpattern\fP\&. .PP A procedure specified by the \fBXmNqualifySearchDataProc\fP resource extracts the base directory and search pattern from the directory mask\&. If the directory specification is empty, the current working directory is used\&. If the search pattern is empty, a pattern that matches all files is used\&. .PP An application can supply its own \fBXmNqualifySearchDataProc\fP as well as its own procedures to search for subdirectories and files\&. The default \fBXmNqualifySearchDataProc\fP works as follows: The directory mask is a pathname that can contain zero or more \fIwildcard\fP characters in its directory portion, its file portion, or both\&. The directory components of the directory mask \(em up to, but not including, the first component with a wildcard character \(em specify the directory to be searched, relative to the current working directory\&. The remaining components specify the search pattern\&. If the directory mask is empty or if its first component contains a wildcard character, the current working directory is searched\&. If no component of the directory mask contains a wildcard character, the entire directory mask is the directory specification, and all files in that directory are matched\&. .PP The user can select a new directory to examine by scrolling through the list of directories and selecting the desired directory or by editing the directory mask\&. Selecting a new directory from the directory list does not change the search pattern\&. A user can select a new search pattern by editing the directory mask or, when the FileSelectionBox has the optional \fBXmNpathMode XmPATH_MODE_RELATIVE\fP display, the filter text field\&. Double clicking or pressing \fBKActivate\fP on a directory in the directory list initiates a search for files and subdirectories in the new directory, using the current search pattern\&. .PP The user can select a file by scrolling through the list of filenames and selecting the desired file or by entering the filename directly into the text edit area\&. Selecting a file from the list causes that filename to appear in the file selection text edit area\&. .PP The user may select a new file as many times as desired\&. The application is not notified until the user takes one of the following actions: .IP " \(bu" 6 Selects the \fBOK\fP PushButton .IP " \(bu" 6 Presses \fBKActivate\fP while the selection text edit area has the keyboard focus .IP " \(bu" 6 Double clicks or presses \fBKActivate\fP on an item in the file list .PP FileSelectionBox initiates a directory and file search when any of the following occurs: .IP " \(bu" 6 The FileSelectionBox is initialized .IP " \(bu" 6 The function \fBXtSetValues\fP is used to change \fBXmNdirMask\fP, \fBXmNdirectory\fP, \fBXmNpattern\fP, or \fBXmNfileTypeMask\fP .IP " \(bu" 6 The user activates the \fBFilter\fP PushButton .IP " \(bu" 6 The user double clicks or presses \fBKActivate\fP on an item in the directory list .IP " \(bu" 6 The application calls \fBXmFileSelectionDoSearch\fP .IP " \(bu" 6 The user presses \fBKActivate\fP while the directory mask text edit area has the keyboard focus .PP When a file search is initiated, the FileSelectionBox takes the following actions: .IP " \(bu" 6 Constructs an \fBXmFileSelectionBoxCallbackStruct\fR structure with values appropriate for the action that initiated the search .IP " \(bu" 6 Calls the \fBXmNqualifySearchDataProc\fP with the callback structure as the data input argument .IP " \(bu" 6 Sets \fBXmNdirectoryValid\fP and \fBXmNlistUpdated\fP to False .IP " \(bu" 6 Calls the \fBXmNdirSearchProc\fP with the qualified data returned by the \fBXmNqualifySearchDataProc\fP .PP If \fBXmNdirectoryValid\fP is True, the FileSelectionBox takes the following additional actions: .IP " \(bu" 6 Sets \fBXmNlistUpdated\fP to False .IP " \(bu" 6 Calls the \fBXmNfileSearchProc\fP with the qualified data returned by the \fBXmNqualifySearchDataProc\fP (and possibly modified by the \fBXmNdirSearchProc\fP) .IP " \(bu" 6 If \fBXmNlistUpdated\fP is True and the file list is empty, displays the \fBXmNnoMatchString\fP in the file list and clears the selection text and \fBXmNdirSpec\fP .IP " \(bu" 6 If \fBXmNlistUpdated\fP is True and the file list is not empty, sets the selection text and \fBXmNdirSpec\fP to the qualified \fIdir\fP returned by the \fBXmNqualifySearchDataProc\fP (and possibly modified by the \fBXmNdirSearchProc\fP) .IP " \(bu" 6 Sets the directory mask text and \fBXmNdirMask\fP to the qualified \fImask\fP returned by the \fBXmNqualifySearchDataProc\fP (and possibly modified by the \fBXmNdirSearchProc\fP) .IP " \(bu" 6 Sets \fBXmNdirectory\fP to the qualified \fIdir\fP returned by the \fBXmNqualifySearchDataProc\fP (and possibly modified by the \fBXmNdirSearchProc\fP) .IP " \(bu" 6 Sets \fBXmNpattern\fP to the qualified \fIpattern\fP returned by the \fBXmNqualifySearchDataProc\fP (and possibly modified by the \fBXmNdirSearchProc\fP) .PP FileSelectionBox uses the \fBXmQTactivatable\fP trait\&. .SS "Data Transfer Behavior" .PP Child widgets of a FileSelectionBox support the data transfer operations and targets associated with their widget classes\&. .PP In addition, if the source of a data transfer is the directory list and if \fBXmNdirSearchProc\fP has its default value, the directory list supports the \fBFILE\fP and \fBFILE_NAME\fP targets\&. .PP If the source of a data transfer is the file list and if \fBXmNfileSearchProc\fP has its default value, the file list supports the \fBFILE\fP and \fBFILE_NAME\fP targets\&. .PP In either case, FileSelectionBox adds an \fBXmNconvertCallback\fP procedure to the appropriate list\&. This procedure adds \fBFILE\fP and \fBFILE_NAME\fP to the \fBTARGETS\fP returned by the list\&. It treats requests for conversion of a selection to \fBFILE\fP and \fBFILE_NAME\fP exactly like requests for conversion to \fBTEXT\fP\&. .PP If an application changes \fBXmNdirSearchProc\fP or \fBXmNfileSearchProc\fP and wants to support the \fBFILE\fP and \fBFILE_NAME\fP targets on the corresponding list, it must provide support itself by adding a procedure to the list\&'s \fBXmNconvertCallback\fP list\&. .SS "Descendants" .PP FileSelectionBox automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBApply\fP\fBXmPushButtonGadget\fPApply button ___ \fBCancel\fP\fBXmPushButtonGadget\fPCancel button ___ \fBDir\fP\fBXmLabelGadget\fPtitle above list of directories ___ \fBDirList\fP\fBXmList\fPlist of directories ___ \fBDirListSW\fP\fBXmScrolledWindow\fPScrolledWindow parent of \fBDirList\fP ___ \fBFilterLabel\fP\fBXmLabelGadget\fPtitle above filter box ___ \fBFilterText\fP\fBXmText\fP or \fBXmTextField\fPtext within filter box ___ \fBHelp\fP\fBXmPushButtonGadget\fPHelp button ___ \fBItems\fP\fBXmLabelGadget\fPtitle above list of filenames ___ \fBItemsList\fP\fBXmList\fPlist of filenames ___ \fBItemsListSW\fP\fBXmScrolledWindow\fPScrolledWindow parent of \fBItemsList\fP ___ \fBOK\fP\fBXmPushButtonGadget\fPOK button ___ \fBSelection\fP\fBXmLabelGadget\fPtitle above selection box ___ \fBSeparator\fP\fBXmSeparatorGadget\fPoptional dividing line ___ \fBText\fP\fBXmText\fP or \fBXmTextField\fPtext within selection box ___ .TE .SS "Classes" .PP FileSelectionBox inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP, \fBXmBulletinBoard\fP, and \fBXmSelectionBox\fP\&. .PP The class pointer is \fBxmFileSelectionBoxWidgetClass\fP\&. .PP The class name is \fBXmFileSelectionBox\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmFileSelectionBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdirectoryXmCDirectoryXmStringdynamicCSG _____ XmNdirectoryValidXmCDirectoryValidBooleandynamicSG _____ XmNdirListItemsXmCDirListItemsXmStringTabledynamicSG _____ XmNdirListItemCountXmCDirListItemCountintdynamicSG _____ XmNdirListLabelStringXmCDirListLabelStringXmStringdynamicCSG _____ XmNdirMaskXmCDirMaskXmStringdynamicCSG _____ XmNdirSearchProcXmCDirSearchProcXmSearchProcdefault procedureCSG _____ XmNdirSpecXmCDirSpecXmStringdynamicCSG _____ XmNdirTextLabelStringXmCDirTextLabelStringXmStringNULLC _____ XmNfileFilterStyleXmCFileFilterStyleXtEnumXmFILTER_NONEC _____ XmNfileListItemsXmCItemsXmStringTabledynamicSG _____ XmNfileListItemCountXmCItemCountintdynamicSG _____ XmNfileListLabelStringXmCFileListLabelStringXmStringdynamicCSG _____ XmNfileSearchProcXmCFileSearchProcXmSearchProcdefault procedureCSG _____ XmNfileTypeMaskXmCFileTypeMaskunsigned charXmFILE_REGULARCSG _____ XmNfilterLabelStringXmCFilterLabelStringXmStringdynamicCSG _____ XmNlistUpdatedXmCListUpdatedBooleandynamicSG _____ XmNnoMatchStringXmCNoMatchStringXmStringT{ "\0[\0\0\0\0]\0" T}CSG _____ XmNpathModeXmCPathModeXtEnumXmPATH_MODE_FULLC _____ XmNpatternXmCPatternXmStringdynamicCSG _____ XmNqualifySearchDataProcXmCQualifySearchDataProcXmQualifyProcdefault procedureCSG _____ .TE .IP "\fBXmNdirectory\fP" 10 Specifies the base directory used in combination with \fBXmNpattern\fP in determining the files and directories to be displayed\&. The default value is determined by the \fBXmNqualifySearchDataProc\fP and depends on the initial values of \fBXmNdirMask\fP, \fBXmNdirectory\fP, and \fBXmNpattern\fP\&. If the default is NULL or empty, the current working directory is used\&. .IP "\fBXmNdirectoryValid\fP" 10 Specifies an attribute that is set only by the directory search procedure\&. The value is set to True if the directory passed to the directory search procedure can actually be searched\&. If this value is False the file search procedure is not called, and \fBXmNdirMask\fP, \fBXmNdirectory\fP, and \fBXmNpattern\fP are not changed\&. .IP "\fBXmNdirListItems\fP" 10 Specifies the items in the directory list\&. \fBXtGetValues\fP for this resource returns the list items themselves, not a copy of the list items\&. The application must not free the returned items\&. .IP "\fBXmNdirListItemCount\fP" 10 Specifies the number of items in the directory list\&. The value must not be negative\&. .IP "\fBXmNdirListLabelString\fP" 10 Specifies the label string of the directory list\&. The default for this resource depends on the locale\&. In the C locale the default is \fBDirectories\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNdirMask\fP" 10 Specifies the directory mask used in determining the files and directories to be displayed\&. The default value is determined by the \fBXmNqualifySearchDataProc\fP and depends on the initial values of \fBXmNdirMask\fP, \fBXmNdirectory\fP, and \fBXmNpattern\fP\&. .IP "\fBXmNdirSearchProc\fP" 10 Specifies a directory search procedure to replace the default directory search procedure\&. FileSelectionBox\&'s default directory search procedure fulfills the needs of most applications\&. Because it is impossible to cover the requirements of all applications, you can replace the default search procedure\&. .IP "" 10 The directory search procedure is called with two arguments: the FileSelectionBox widget and a pointer to an \fBXmFileSelectionBoxCallbackStruct\fR structure\&. The callback structure is generated by the \fBXmNqualifySearchDataProc\fP and contains all information required to conduct a directory search, including the directory mask and a qualified base directory and search pattern\&. Once called, it is up to the search routine to generate a new list of directories and update the FileSelectionBox widget by using \fBXtSetValues\fP\&. .IP "" 10 The search procedure must set \fBXmNdirectoryValid\fP and \fBXmNlistUpdated\fP\&. If it generates a new list of directories, it must also set \fBXmNdirListItems\fP and \fBXmNdirListItemCount\fP\&. .IP "" 10 If the search procedure cannot search the specified directory, it must warn the user and set \fBXmNdirectoryValid\fP and \fBXmNlistUpdated\fP to False, unless it prompts and subsequently obtains a valid directory\&. If the directory is valid but is the same as the current \fBXmNdirectory\fP, the search procedure must set \fBXmNdirectoryValid\fP to True, but it may elect not to generate a new list of directories\&. In this case, it must set \fBXmNlistUpdated\fP to False\&. .IP "" 10 If the search procedure generates a new list of directories, it must set \fBXmNdirListItems\fP to the new list of directories and \fBXmNdirListItemCount\fP to the number of items in the list\&. If there are no directories, it sets \fBXmNdirListItems\fP to NULL and \fBXmNdirListItemCount\fP to 0 (zero)\&. In either case, it must set \fBXmNdirectoryValid\fP and \fBXmNlistUpdated\fP to True\&. .IP "" 10 The search procedure ordinarily should not change the callback structure\&. But if the original directory is not valid, the search procedure may obtain a new directory from the user\&. In this case, it should set the \fIdir\fP member of the callback structure to the new directory, call the \fBXmNqualifySearchDataProc\fP with the callback struct as the input argument, and copy the qualified data returned by the \fBXmNqualifySearchDataProc\fP into the callback struct\&. .IP "\fBXmNdirSpec\fP" 10 Specifies the full file path specification\&. This is the \fBXmNtextString\fP resource in SelectionBox, renamed for FileSelectionBox\&. The default value is determined by the FileSelectionBox after conducting the initial directory and file search\&. .IP "\fBXmNdirTextLabelString\fP" 10 Uses the specified \fBXmString\fR as the label above the TextField directory\&. The resource takes effect when the \fBXmNpathMode\fP resource has a value of \fBXmPATH_MODE_RELATIVE\fP\&. It is ignored when the \fBXmNpathMode\fP resource has a value of \fBXmPATH_MODE_FULL\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNfileFilterStyle\fP" 10 Specifies whether or not the "hidden" files (those whose names begin with . (period) in POSIX systems) will be listed in the file and directory scrolling lists (where the default directory search procedure is used)\&. The possible values are: .RS .IP "\fBXmFILTER_NONE\fP" 10 Does not filter hidden files\&. .IP "\fBXmFILTER_HIDDEN_FILES\fP" 10 Restricts the list of possible file names, such as those beginning with . (period)\&. .RE .IP "\fBXmNfileListItems\fP" 10 Specifies the items in the file list\&. This is the \fBXmNlistItems\fP resource in SelectionBox, renamed for FileSelectionBox\&. \fBXtGetValues\fP for this resource returns the list items themselves, not a copy of the list items\&. The application must not free the returned items\&. .IP "\fBXmNfileListItemCount\fP" 10 Specifies the number of items in the file list\&. This is the \fBXmNlistItemCount\fP resource in SelectionBox, renamed for FileSelectionBox\&. The value must not be negative\&. .IP "\fBXmNfileListLabelString\fP" 10 Specifies the label string of the file list\&. This is the \fBXmNlistLabelString\fP resource in SelectionBox, renamed for FileSelectionBox\&. The default for this resource depends on the locale\&. In the C locale the default is \fBFiles\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNfileSearchProc\fP" 10 Specifies a file search procedure to replace the default file search procedure\&. FileSelectionBox\&'s default file search procedure fulfills the needs of most applications\&. Because it is impossible to cover the requirements of all applications, you can replace the default search procedure\&. .IP "" 10 The file search procedure is called with two arguments: the FileSelectionBox widget and a pointer to an \fBXmFileSelectionBoxCallbackStruct\fR structure\&. The callback structure is generated by the \fBXmNqualifySearchDataProc\fP (and possibly modified by the \fBXmNdirSearchProc\fP)\&. It contains all information required to conduct a file search, including the directory mask and a qualified base directory and search pattern\&. Once this procedure is called, it is up to the search routine to generate a new list of files and update the FileSelectionBox widget by using \fBXtSetValues\fP\&. .IP "" 10 The search procedure must set \fBXmNlistUpdated\fP\&. If it generates a new list of files, it must also set \fBXmNfileListItems\fP and \fBXmNfileListItemCount\fP\&. .IP "" 10 It is recommended that the search procedure always generate a new list of files\&. If the \fImask\fP member of the callback structure is the same as the \fImask\fP member of the callback struct in the preceding call to the search procedure, the procedure may elect not to generate a new list of files\&. In this case it must set \fBXmNlistUpdated\fP to False\&. .IP "" 10 If the search procedure generates a new list of files, it must set \fBXmNfileListItems\fP to the new list of files and \fBXmNfileListItemCount\fP to the number of items in the list\&. If there are no files, it sets \fBXmNfileListItems\fP to NULL and \fBXmNfileListItemCount\fP to 0 (zero)\&. In either case it must set \fBXmNlistUpdated\fP to True\&. .IP "" 10 In constructing the list of files, the search procedure should include only files of the types specified by the widget\&'s \fBXmNfileTypeMask\fP\&. .IP "" 10 Setting \fBXmNdirSpec\fP is optional, but recommended\&. Set this attribute to the full file specification of the directory searched\&. The directory specification is displayed below the directory and file lists\&. .IP "\fBXmNfileTypeMask\fP" 10 Specifies the type of files listed in the file list\&. The possible values are .RS .IP "\fBXmFILE_REGULAR\fP" 10 Restricts the file list to contain only regular files\&. .IP "\fBXmFILE_DIRECTORY\fP" 10 Restricts the file list to contain only directories\&. .IP "\fBXmFILE_ANY_TYPE\fP" 10 Allows the list to contain all file types including directories\&. .RE .IP "\fBXmNfilterLabelString\fP" 10 Specifies the label string for the text entry field for the directory mask\&. The default for this resource depends on the locale\&. In the C locale the default is \fBFilter\fP\&. .IP "" 10 Now that some default localized label strings are provided through message catalogs for the children of composite widgets, the \fBlabelString\fP resources cannot be set on the child through default resource files\&. Instead, the resource provided at the parent level must be used\&. .IP "\fBXmNlistUpdated\fP" 10 Specifies an attribute that is set only by the directory and file search procedures\&. This resource is set to True if the search procedure updated the directory or file list\&. .IP "\fBXmNnoMatchString\fP" 10 Specifies a string to be displayed in the file list if the list of files is empty\&. .IP "\fBXmNpattern\fP" 10 Specifies the search pattern used in combination with \fBXmNdirectory\fP in determining the files and directories to be displayed\&. The default value is determined by \fBXmNqualifySearchDataProc\fP and depends on the initial values of \fBXmNdirMask\fP, \fBXmNdirectory\fP, and \fBXmNpattern\fP\&. If the default is NULL or empty, a pattern that matches all files is used\&. .IP "\fBXmNpathMode\fP" 10 Specifies whether or not an additional text field will be used to display and edit the filter\&. The possible values are .RS .IP "\fBXmPATH_MODE_FULL\fP" 10 Specifies that no additional text field will be used to display the filter\&. There will just be a single text field to display \fBXmNdirMask\fP\&. .IP "\fBXmPATH_MODE_RELATIVE\fP" 10 Specifies that there will be two text field displays, one to display the \fBXmNdirectory\fP and one to display the \fBXmNpattern\fP\&. In this instance, the \fBXmNfilterLabelString\fP resource applies to the text field for \fBXmNpattern\fP and \fBXmNdirTextLabelString\fP applies to the text field for \fBXmNdirectory\fP\&. .RE .IP "\fBXmNqualifySearchDataProc\fP" 10 Specifies a search data qualification procedure to replace the default data qualification procedure\&. FileSelectionBox\&'s default data qualification procedure fulfills the needs of most applications\&. Because it is impossible to cover the requirements of all applications, you can replace the default procedure\&. .IP "" 10 The data qualification procedure is called to generate a qualified directory mask, base directory, and search pattern for use by the directory and file search procedures\&. It is called with three arguments: the FileSelectionBox widget and pointers to two \fBXmFileSelectionBoxCallbackStruct\fR structures\&. The first callback structure contains the input data\&. The second callback structure contains the output data, to be filled in by the data qualification procedure\&. .IP "" 10 If the input \fIdir\fP and \fIpattern\fP members are not NULL, the procedure must copy them to the corresponding members of the output callback structure\&. .IP "" 10 If the input \fIdir\fP is NULL, the procedure constructs the output \fIdir\fP as follows: If the input \fImask\fP member is NULL, the procedure uses the widget\&'s \fBXmNdirectory\fP as the output \fIdir\fP; otherwise, it extracts the output \fIdir\fP from the input \fImask\fP\&. If the resulting output \fIdir\fP is empty, the procedure uses the current working directory instead\&. .IP "" 10 If the input \fIpattern\fP is NULL, the procedure constructs the output \fIpattern\fP as follows: If the input \fImask\fP member is NULL, the procedure uses the widget\&'s \fBXmNpattern\fP as the output \fIpattern\fP; otherwise, it extracts the output \fIpattern\fP from the input \fImask\fP\&. If the resulting output \fIpattern\fP is empty, the procedure uses a pattern that matches all files instead\&. .IP "" 10 The data qualification procedure constructs the output \fImask\fP from the output \fIdir\fP and \fIpattern\fP\&. The procedure must ensure that the output \fIdir\fP, \fIpattern\fP, and \fImask\fP are fully qualified\&. .IP "" 10 If the input \fIvalue\fP member is not NULL, the procedure must copy it to the output \fIvalue\fP member; otherwise, the procedure must copy the widget\&'s \fBXmNdirSpec\fP to the output \fIvalue\fP\&. .IP "" 10 The data qualification procedure must calculate the lengths of the output \fIvalue\fP, \fImask\fP, \fIdir\fP, and \fIpattern\fP members and must fill in the corresponding length members of the output callback struct\&. .IP "" 10 The data qualification procedure must copy the input \fIreason\fP and \fIevent\fP members to the corresponding output members\&. .PP The values of the \fBXmNdirSearchProc\fP and \fBXmNfileSearchProc\fP are procedure pointers of type \fBXmSearchProc\fR, defined as follows: .PP .nf void (* XmSearchProc) (\fIw, search_data\fP) Widget \fIw\fP; XtPointer \fIsearch_data\fP; .fi .IP "\fIw\fP" 10 The FileSelectionBox widget .IP "\fIsearch_data\fP" 10 Pointer to an \fBXmFileSelectionBoxCallbackStruct\fR containing information for conducting a search .PP The value of the \fBXmNqualifySearchDataProc\fP resource is a procedure pointer of type \fBXmQualifyProc\fR, defined as follows: .PP .nf void (* XmQualifyProc) (\fIw, input_data, output_data\fP) Widget \fIw\fP; XtPointer \fIinput_data\fP; XtPointer \fIoutput_data\fP; .fi .IP "\fIw\fP" 10 The FileSelectionBox widget .IP "\fIinput_data\fP" 10 Pointer to an \fBXmFileSelectionBoxCallbackStruct\fR containing input data to be qualified .IP "\fIoutput_data\fP" 10 Pointer to an \fBXmFileSelectionBoxCallbackStruct\fR containing output data to be filled in by the qualification procedure .SS "Inherited Resources" .PP FileSelectionBox inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmSelectionBox Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNapplyCallbackXmCCallbackXtCallbackListNULLC _____ XmNapplyLabelStringXmCApplyLabelStringXmStringdynamicCSG _____ XmNcancelCallbackXmCCallbackXtCallbackListNULLC _____ XmNcancelLabelStringXmCCancelLabelStringXmStringdynamicCSG _____ XmNchildPlacementXmCChildPlacementunsigned charXmPLACE_ABOVE_SELECTIONCSG _____ XmNdialogTypeXmCDialogTypeunsigned charXmDIALOG_FILE_SELECTIONG _____ XmNhelpLabelStringXmCHelpLabelStringXmStringdynamicCSG _____ XmNlistItemCountXmCItemCountintdynamicCSG _____ XmNlistItemsXmCItemsXmStringTabledynamicCSG _____ XmNlistLabelStringXmCListLabelStringXmStringdynamicCSG _____ XmNlistVisibleItemCountXmCVisibleItemCountintdynamicCSG _____ XmNminimizeButtonsXmCMinimizeButtonsBooleanFalseCSG _____ XmNmustMatchXmCMustMatchBooleanFalseCSG _____ XmNnoMatchCallbackXmCCallbackXtCallbackListNULLC _____ XmNokCallbackXmCCallbackXtCallbackListNULLC _____ XmNokLabelStringXmCOkLabelStringXmStringdynamicCSG _____ XmNselectionLabelStringXmCSelectionLabelStringXmStringdynamicCSG _____ XmNtextAcceleratorsXmCTextAcceleratorsXtAcceleratorsdefaultC _____ XmNtextColumnsXmCColumnsshortdynamicCSG _____ XmNtextStringXmCTextStringXmStringdynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmBulletinBoard Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNallowOverlapXmCAllowOverlapBooleanTrueCSG _____ XmNautoUnmanageXmCAutoUnmanageBooleanFalseCG _____ XmNbuttonFontListXmCButtonFontListXmFontListdynamicCSG _____ XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG _____ XmNcancelButtonXmCWidgetWidgetCancel buttonSG _____ XmNdefaultButtonXmCWidgetWidgetOK buttonSG _____ XmNdefaultPositionXmCDefaultPositionBooleanTrueCSG _____ XmNdialogStyleXmCDialogStyleunsigned chardynamicCSG _____ XmNdialogTitleXmCDialogTitleXmStringNULLCSG _____ XmNfocusCallbackXmCCallbackXtCallbackListNULLC _____ XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG _____ XmNlabelRenderTableXmCLabelRenderTableXmRenderTabledynamicCSG _____ XmNmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimension10CSG _____ XmNmarginWidthXmCMarginWidthDimension10CSG _____ XmNnoResizeXmCNoResizeBooleanFalseCSG _____ XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_ANYCSG _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_OUTCSG _____ XmNtextFontListXmCTextFontListXmFontListdynamicCSG _____ XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG _____ XmNtextTranslationsXmCTranslationsXtTranslationsNULLC _____ XmNunmapCallbackXmCCallbackXtCallbackListNULLC _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetdynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; XmString \fIvalue\fP; int \fIlength\fP; XmString \fImask\fP; int \fImask_length\fP; XmString \fIdir\fP; int \fIdir_length\fP; XmString \fIpattern\fP; int \fIpattern_length\fP; } XmFileSelectionBoxCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .IP "\fIvalue\fP" 10 Specifies the current value of \fBXmNdirSpec\fP .IP "\fIlength\fP" 10 Specifies the number of bytes in \fIvalue\fP This member is obsolete and exists for compatibility with earlier releases\&. .IP "\fImask\fP" 10 Specifies the current value of \fBXmNdirMask\fP .IP "\fImask_length\fP" 10 Specifies the number of bytes in \fImask\fP This member is obsolete and exists for compatibility with earlier releases\&. .IP "\fIdir\fP" 10 Specifies the current base directory .IP "\fIdir_length\fP" 10 Specifies the number of bytes in \fIdir\fP This member is obsolete and exists for compatibility with earlier releases\&. .IP "\fIpattern\fP" 10 Specifies the current search pattern .IP "\fIpattern_length\fP" 10 Specifies the number of bytes in \fIpattern\fP This member is obsolete and exists for compatibility with earlier releases\&. .SS "Translations" .PP XmFileSelectionBox inherits translations from XmSelectionBox\&. .SS "Accelerators" .PP The \fBXmNtextAccelerators\fP from XmSelectionBox are added to the selection and directory mask (filter) Text descendants of XmFileSelectionBox\&. .SS "Action Routines" .PP The XmFileSelectionBox action routines are .IP "SelectionBoxUpOrDown(\fBPrevious|Next|First|Last\fP):" 10 If neither the selection text nor the directory mask (filter) text has the focus, this action does nothing\&. .IP "" 10 If the selection text has the focus, the term \fIlist\fP in the following description refers to the file list, and the term \fItext\fP refers to the selection text\&. If the directory mask text has the focus, \fIlist\fP refers to the directory list, and \fItext\fP refers to the directory mask text\&. .IP "" 10 When called with an argument of \fBPrevious\fP, or 0 (zero) for compatibility, this action selects the previous item in the list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBNext\fP, or 1 for compatibility, this action selects the next item in the list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBFirst\fP, or 2 for compatibility, this action selects the first item in the list and replaces the text with that item\&. .IP "" 10 When called with an argument of \fBLast\fP, or 3 for compatibility, this action selects the last item in the list and replaces the text with that item\&. .IP "SelectionBoxRestore():" 10 If neither the selection text nor the directory mask (filter) text has the focus, this action does nothing\&. .IP "" 10 If the selection text has the focus, this action replaces the selection text with the selected item in the file list\&. If no item in the file list is selected, it clears the selection text\&. .IP "" 10 If the directory mask text has the focus, this action replaces the directory mask text with a new directory mask constructed from the \fBXmNdirectory\fP and \fBXmNpattern\fP resources\&. .SS "Additional Behavior" .PP The FileSelectionBox widget has the following additional behavior: .IP "\fB\fP\fB\fP:" 10 Calls the activate callbacks for the cancel button if it is sensitive\&. If no cancel button exists and the parent of the FileSelectionBox is a manager, it passes the event to the parent\&. .IP "\fB\fP\fB\fP\ in\ Selection\ Text:" 10 Calls the selection text widget\&'s \fBXmNactivateCallback\fP callbacks\&. If \fBXmNmustMatch\fP is True and the selection text does not match an item in the file list, it calls the \fBXmNnoMatchCallback\fP callbacks with reason \fBXmCR_NO_MATCH\fP\&. Otherwise, it calls the \fBXmNokCallback\fP callbacks with reason \fBXmCR_OK\fP\&. .IP "\fB\fP\fB\fP\ in\ Directory\ Mask\ Text:" 10 Calls the directory mask text widget\&'s \fBXmNactivateCallback\fP callbacks, initiates a directory and file search, and calls the \fBXmNapplyCallback\fP callbacks with reason \fBXmCR_APPLY\fP\&. .IP "\fB\fP\fB(2+)\fP\ or\ \fB\fP\fB\fP\ in\ Directory\ List:" 10 Calls the directory list widget\&'s \fBXmNdefaultActionCallback\fP callbacks, initiates a directory and file search, and calls the \fBXmNapplyCallback\fP callbacks with reason \fBXmCR_APPLY\fP\&. .IP "\fB\fP\fB(2+)\fP\ or\ \fB\fP\fB\fP\ in\ File\ List:" 10 Calls the file list widget\&'s \fBXmNdefaultActionCallback\fP callbacks and calls the \fBXmNokCallback\fP callbacks with reason \fBXmCR_OK\fP\&. .IP "\fB\fP\fB\fP\ in\ Directory\ List:" 10 Generates a new directory mask, using the selected list item as the directory and the pattern extracted from the current directory mask text as the search pattern\&. If the search pattern is empty, it uses a pattern that matches all files in the directory\&. Replaces the directory mask text with the new directory mask\&. .IP "\fB\fP\fB\fP\ in\ File\ List:" 10 Replaces the selection text with the selected list item\&. .IP "\fB\fP in File List:" 10 Drags the content of one or more selected list items using the drag and drop facility\&. If \fB\fP in Directory List:" 10 Drags the content of one or more selected list items using the drag and drop facility\&. If \fB\fP:" 10 Initiates a directory and file search\&. Calls the \fBXmNapplyCallback\fP callbacks with reason \fBXmCR_APPLY\fP\&. .IP "\fB\fP:" 10 If \fBXmNmustMatch\fP is True and the selection text does not match an item in the file list, calls the \fBXmNnoMatchCallback\fP callbacks with reason \fBXmCR_NO_MATCH\fP\&. Otherwise, calls the \fBXmNokCallback\fP callbacks with reason \fBXmCR_OK\fP\&. .IP "\fB\fP:" 10 Calls the \fBXmNcancelCallback\fP callbacks with reason \fBXmCR_CANCEL\fP\&. .IP "\fB\fP:" 10 Calls the \fBXmNhelpCallback\fP callbacks with reason \fBXmCR_HELP\fP\&. .IP "\fB\fP\fB\fP:" 10 If no button, list widget, or text widget has the keyboard focus, if \fBXmNmustMatch\fP is True and the selection text does not match an item in the file list, it calls the \fBXmNnoMatchCallback\fP callbacks with reason \fBXmCR_NO_MATCH\fP\&. Otherwise, it calls the \fBXmNokCallback\fP callbacks with reason \fBXmCR_OK\fP\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmBulletinBoard\fP(3), \fBXmCreateFileSelectionBox\fP(3), \fBXmCreateFileSelectionDialog\fP(3), \fBXmFileSelectionBoxGetChild\fP(3), \fBXmFileSelectionDoSearch\fP(3), \fBXmManager\fP(3), \fBXmSelectionBox\fP(3) \fBXmVaCreateFileSelectionBox\fP(3), and \fBXmVaCreateManagedFileSelectionBox\fP(3),\&. motif-2.3.8/doc/man/man3/XmTextGetSelectionWcs.30000644000175000017500000000355612672140200016244 00000000000000'\" t ...\" TxtGetSC.sgm /main/8 1996/09/08 21:17:28 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextGetSelectionWcs" "library call" .SH "NAME" \fBXmTextGetSelectionWcs\fP \(em A Text function that retrieves the value of a wide character encoded primary selection .iX "XmTextGetSelectionWcs" .iX "Text functions" "XmTextGetSelectionWcs" .SH "SYNOPSIS" .PP .nf #include \fBwchar_t * \fBXmTextGetSelectionWcs\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextGetSelectionWcs\fP retrieves the value of the primary selection that is encoded in a wide character format\&. It returns a NULL pointer if no text is selected in the widget\&. The application is responsible for freeing the storage associated with the wide character buffer by calling \fBXtFree\fP\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .PP For a complete definition of Text and its associated resources, see \fBXmText\fP(3)\&. .SH "RETURN" .PP Returns the wide character string that is associated with the primary selection in the Text widget\&. .SH "RELATED" .PP \fBXmText\fP(3) and \fBXmTextGetSelection\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmVaCreateManagedScrollBar.30000644000175000017500000000003712672140200017077 00000000000000.so man3/XmVaCreateScrollBar.3 motif-2.3.8/doc/man/man3/XmDeactivateWMProtocol.30000644000175000017500000000354112672140200016366 00000000000000'\" t ...\" DeactivB.sgm /main/7 1996/08/30 15:04:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDeactivateWMProtocol" "library call" .SH "NAME" \fBXmDeactivateWMProtocol\fP \(em A VendorShell convenience interface that deactivates a protocol without removing it .iX "protocols" .iX "XmDeactivateWMProtocol" .iX "VendorShell functions" "XmDeactivateWMProtocol" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmDeactivateWMProtocol\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBprotocol\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDeactivateWMProtocol\fP is a convenience interface\&. It calls \fBXmDeactivateProtocol\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIprotocol\fP" 10 Specifies the protocol atom .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmActivateWMProtocol\fP(3), \fBXmDeactivateProtocol\fP(3), and \fBXmInternAtom\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmFontListFreeFontContext.30000644000175000017500000000317212672140200017067 00000000000000'\" t ...\" FontLstS.sgm /main/7 1996/08/30 15:22:35 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmFontListFreeFontContext" "library call" .SH "NAME" \fBXmFontListFreeFontContext\fP \(em A font list function that instructs the toolkit that the font list context is no longer needed .iX "XmFontListFreeFontContext" .iX "font list functions" "XmFontListFreeFontContext" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmFontListFreeFontContext\fP\fR( \fBXmFontContext \fBcontext\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmFontListFreeFontContext\fP instructs the toolkit that the context is no longer needed and will not be used without reinitialization\&. .IP "\fIcontext\fP" 10 Specifies the font list context structure that was allocated by the \fBXmFontListInitFontContext\fP function .SH "RELATED" .PP \fBXmFontListInitFontContext\fP(3) and \fBXmFontListNextEntry\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:23 motif-2.3.8/doc/man/man3/XmTextFieldPasteLink.30000644000175000017500000000403212672140200016026 00000000000000'\" t ...\" TxtFieAU.sgm /main/7 1996/08/30 16:25:31 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldPasteLink" "library call" .SH "NAME" \fBXmTextFieldPasteLink\fP \(em A TextField function that inserts a link to the clipboard selection .iX "XmTextFieldPasteLink" .iX "TextField functions" "XmTextFieldPasteLink" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmTextFieldPasteLink\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldPasteLink\fP inserts a link to the clipboard selection at the insertion cursor\&. This routine calls the widget\&'s \fBXmNdestinationCallback\fP procedures with the \fIselection\fP member of the \fBXmDestinationCallbackStruct\fR set to \fBCLIPBOARD\fP and with the \fIoperation\fP member set to \fBXmLINK\fP\&. The TextField widget itself performs no transfers; the \fBXmNdestinationCallback\fP procedures are responsible for inserting the link to the clipboard selection and for taking any related actions\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP This function returns False if no transfers take place\&. Otherwise, it returns True\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmRowColumn.30000644000175000017500000016057412672140200014266 00000000000000'\" t ...\" RowCol.sgm /main/11 1996/09/08 20:59:24 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRowColumn" "library call" .SH "NAME" \fBXmRowColumn\fP \(em The RowColumn widget class .iX "XmRowColumn" .iX "widget class" "RowColumn" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The RowColumn widget is a general purpose RowColumn manager capable of containing any widget type as a child\&. In general, it requires no special knowledge about how its children function and provides nothing beyond support for several different layout styles\&. However, it can be configured as a menu, in which case, it expects only certain children, and it configures to a particular layout\&. The menus supported are MenuBar, Pulldown or Popup menu panes, and OptionMenu\&. RowColumn uses the \fBXmQTmenuSavvy\fP trait and holds the \fBXmQTmenuSystem\fP trait\&. .PP The type of layout performed is controlled by how the application has set the various layout resources\&. It can be configured to lay out its children in either rows or columns\&. In addition, the application can specify how the children are laid out, as follows: .IP " \(bu" 6 The children are packed tightly together into either rows or columns .IP " \(bu" 6 Each child is placed in an identically sized box (producing a symmetrical look) .IP " \(bu" 6 A specific layout (the current \fIx\fP and \fIy\fP positions of the children control their location) .PP In addition, the application has control over both the spacing that occurs between each row and column and the margin spacing present between the edges of the RowColumn widget and any children that are placed against it\&. .PP The default \fBXmNinsertPosition\fP procedure for the RowColumn returns the value of \fBXmNpositionIndex\fP if one has been specified for the child\&. Otherwise, this procedure returns the number of children in the RowColumn\&'s \fBXmNnumChildren\fP list\&. In a MenuBar, Pulldown menu pane, or Popup menu pane the default for the \fBXmNshadowThickness\fP resource is 2\&. In an OptionMenu or a WorkArea, (such as a RadioBox or CheckBox) this resource is not applicable and its use is undefined\&. If an application wishes to place a 3-D shadow around an OptionMenu or WorkArea, it can create the RowColumn as a child of a Frame widget\&. .PP In a MenuBar, Pulldown menu pane, or Popup menu pane the \fBXmNnavigationType\fP resource is not applicable and its use is undefined\&. In a WorkArea, the default for \fBXmNnavigationType\fP is \fBXmTAB_GROUP\fP\&. In an OptionMenu the default for \fBXmNnavigationType\fP is \fBXmNONE\fP\&. .PP In a MenuBar, Pulldown menu pane, or Popup menu pane the \fBXmNtraversalOn\fP resource is not applicable and its use is undefined\&. In an OptionMenu or WorkArea, the default for \fBXmNtraversalOn\fP is True\&. .PP If the parent of the RowColumn is a MenuShell, the \fBXmNmappedWhenManaged\fP resource is forced to False when the widget is realized\&. .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of an OptionMenu\&. The following list identifies the names of these widgets (or gadgets) and the associated OptionMenu areas\&. .IP "Option Menu Label Gadget" 10 \fBOptionLabel\fP .IP "Option Menu Cascade Button" 10 \fBOptionButton\fP .PP For the Popup and Pulldown Menupanes, popup and pulldown menus have particular behaviors when the \fB\fP button is pressed outside the menus\&. These behaviors are summarized here\&. .PP When there is already a popped up menu, a user can either press \fB\fP in the same area as the popped up menu, or can press \fB\fP in another area that should have a menu popped up\&. When \fB\fP is pressed in the same area as the already popped up menu, that menu is unposted\&. If \fB\fP is pressed in a different area, the associated popup menu is posted for the new area\&. Note, however, that if the \fBXmNpopupHandlerCallback\fP of either \fBXmManager\fP or \fBXmPrimitive\fP is available, then the callback may override these default behaviors\&. .PP For pulldown menus, a user can press \fB\fP on the Cascade button to post the pulldown menu, then click on it again\&. Upon the second click, the pulldown menu is unposted\&. .PP Popup menus are not allowed to have NULL parents\&. .SS "Tear-off Menus" .PP Pulldown and Popup menu panes support tear-off menus, which enable the user to retain a menu pane on the display to facilitate subsequent menu selections\&. A menu pane that can be torn-off is identified by a tear-off button that spans the width of the menu pane and displays a dashed line\&. A torn-off menu pane contains a window manager system menu icon and a title bar\&. The window title displays the label of the cascade button that initiated the action when the label type is \fBXmSTRING\fP\&. If the label contains a pixmap the window title is empty\&. A tear-off menu from a Popup menu pane also displays an empty title\&. Tear-off menus should not be shared\&. .PP The user can tear off a menu pane using the mouse or keyboard\&. Clicking \fB\fP or pressing \fB\fP (or \fB\fP) on the tear-off button, tears off the menu pane at the current position\&. Pressing \fB\fP on the tear-off button tears off the menu pane and allows the user to drag the torn-off menu to a new position designated by releasing the mouse button\&. Tearing off a menu pane unposts the current active menu\&. Only one tear-off copy for each menu pane is allowed\&. Subsequent tear-off actions of a torn menu pane unpost the existing copy first\&. .PP The name of the tear-off button of a torn-off menu pane is \fBTearOffControl\fP\&. The name can be used to set resources in a resource file\&. An application can also obtain the tear-off button itself using \fBXmGetTearOffControl\fP and then set resource values by calling \fBXtSetValues\fP\&. .PP The tear-off button has Separator-like behavior\&. Its appearance can be specified with the following tear-off button resources: \fBXmNbackground\fP, \fBXmNbackgroundPixmap\fP, \fBXmNbottomShadowColor\fP, \fBXmNforeground\fP, \fBXmNheight\fP, \fBXmNmargin\fP, \fBXmNseparatorType\fP, \fBXmNshadowThickness\fP, and \fBXmNtopShadowColor\fP\&. Refer to the \fBXmSeparator\fP reference page for a complete description of each of these resources\&. .PP The \fBXmNtearOffModel\fP, \fBXmNtearOffMenuActivateCallback\fP, and \fBXmNtearOffMenuDeactivateCallback\fP are RowColumn resources that affect tear-off menu behavior\&. The \fBXmNtearOffTitle\fP resource enables the application to specify the tear-off menu\&'s title if the menu is torn off\&. .PP By default, menus do not tear off\&. Setting the \fBXmNtearOffModel\fP resource to \fBXmTEAR_OFF_ENABLED\fP enables tear-off functionality\&. There is no resource converter preregistered for \fBXmNtearOffModel\fP\&. To allow tear-off functionality to be enabled through the resource database, call the function \fBXmRepTypeInstallTearOffModelConverter\fP\&. .PP Tear-off menu focus policy follows standard window manager policy\&. It is recommended that the \fBstartupKeyFocus\fP and \fBautoKeyFocus\fP \fBmwm\fP resources be set to True\&. .SS "Descendants" .PP RowColumn automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBOptionButton\fP\fBXmCascadeButtonGadget\fPoption menu button ___ \fBOptionLabel\fP\fBXmLabelGadget\fPoption menu label ___ \fBTearOffControl\fPsubclass of \fBXmPrimitive\fPT{ tear-off button of torn-off menu pane T} ___ .TE .SS "Classes" .PP RowColumn inherits behavior, resources, and traits from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, and \fBXmManager\fP classes\&. .PP The class pointer is \fBxmRowColumnWidgetClass\fP\&. .PP The class name is \fBXmRowColumn\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmRowColumn Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNadjustLastXmCAdjustLastBooleanTrueCSG _____ XmNadjustMarginXmCAdjustMarginBooleanTrueCSG _____ XmNentryAlignmentXmCAlignmentunsigned charXmALIGNMENT_BEGINNINGCSG _____ XmNentryBorderXmCEntryBorderDimension0CSG _____ XmNentryCallbackXmCCallbackXtCallbackListNULLC _____ XmNentryClassXmCEntryClassWidgetClassdynamicCSG _____ XmNentryVerticalAlignmentXmCVerticalAlignmentunsigned charXmALIGNMENT_CENTERCSG _____ XmNisAlignedXmCIsAlignedBooleanTrueCSG _____ XmNisHomogeneousXmCIsHomogeneousBooleandynamicCG _____ XmNlabelStringXmCXmStringXmStringNULLC _____ XmNmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNmarginHeightXmCMarginHeightDimensiondynamicCSG _____ XmNmarginWidthXmCMarginWidthDimensiondynamicCSG _____ XmNmenuAcceleratorXmCAcceleratorsStringdynamicCSG _____ XmNmenuHelpWidgetXmCMenuWidgetWidgetNULLCSG _____ XmNmenuHistoryXmCMenuWidgetWidgetNULLCSG _____ XmNmenuPostXmCMenuPostStringNULLCSG _____ XmNmnemonicXmCMnemonicKeySymNULLCSG _____ XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGCSG _____ XmNnumColumnsXmCNumColumnsshort1CSG _____ XmNorientationXmCOrientationunsigned chardynamicCSG _____ XmNpackingXmCPackingunsigned chardynamicCSG _____ XmNpopupEnabledXmCPopupEnabledintXmPOPUP_KEYBOARDCSG _____ XmNradioAlwaysOneXmCRadioAlwaysOneBooleanTrueCSG _____ XmNradioBehaviorXmCRadioBehaviorBooleanFalseCSG _____ XmNresizeHeightXmCResizeHeightBooleanTrueCSG _____ XmNresizeWidthXmCResizeWidthBooleanTrueCSG _____ XmNrowColumnTypeXmCRowColumnTypeunsigned charXmWORK_AREACG _____ XmNspacingXmCSpacingDimensiondynamicCSG _____ XmNsubMenuIdXmCMenuWidgetWidgetNULLCSG _____ XmNtearOffMenuActivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNtearOffMenuDeactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNtearOffModelXmCTearOffModelunsigned charXmTEAR_OFF_DISABLEDCSG _____ XmNtearOffTitleXmCTearOffTitleXmStringNULLCSG _____ XmNunmapCallbackXmCCallbackXtCallbackListNULLC _____ XmNwhichButtonXmCWhichButtonunsigned intdynamicCSG _____ .TE .IP "\fBXmNadjustLast\fP" 10 Extends the last row of children to the bottom edge of RowColumn (when \fBXmNorientation\fP is \fBXmHORIZONTAL\fP) or extends the last column to the right edge of RowColumn (when \fBXmNorientation\fP is \fBXmVERTICAL\fP)\&. Setting \fBXmNadjustLast\fP to False disables this feature\&. .IP "\fBXmNadjustMargin\fP" 10 Specifies whether the inner minor margins of all items contained within the RowColumn widget are forced to the same value\&. The inner minor margin corresponds to the \fBXmNmarginLeft\fP, \fBXmNmarginRight\fP, \fBXmNmarginTop\fP, and \fBXmNmarginBottom\fP resources supported by \fBXmLabel\fP and \fBXmLabelGadget\fP\&. .IP "" 10 A horizontal orientation causes \fBXmNmarginTop\fP and \fBXmNmarginBottom\fP for all items in a particular row to be forced to the same value; the value is the largest margin specified for one of the Label items\&. .IP "" 10 A vertical orientation causes \fBXmNmarginLeft\fP and \fBXmNmarginRight\fP for all items in a particular column to be forced to the same value; the value is the largest margin specified for one of the Label items\&. .IP "" 10 This keeps all text within each row or column lined up with all other text in its row or column\&. If \fBXmNrowColumnType\fP is either \fBXmMENU_POPUP\fP or \fBXmMENU_PULLDOWN\fP and this resource is True, only button children have their margins adjusted\&. .IP "\fBXmNentryAlignment\fP" 10 Specifies the alignment type for children that are subclasses of \fBXmLabel\fP or \fBXmLabelGadget\fP when \fBXmNisAligned\fP is enabled\&. The following are textual alignment types: .RS .IP " \(bu" 6 \fBXmALIGNMENT_BEGINNING\fP (default) .IP " \(bu" 6 \fBXmALIGNMENT_CENTER\fP .IP " \(bu" 6 \fBXmALIGNMENT_END\fP .RE .IP "" 10 See the description of \fBXmNalignment\fP in the \fBXmLabel\fP(3) reference page for an explanation of these actions\&. .IP "\fBXmNentryBorder\fP" 10 Imposes a uniform border width upon all RowColumn\&'s children\&. The default value is 0 (zero), which disables the feature\&. .IP "\fBXmNentryCallback\fP" 10 Disables the \fBXmNactivateCallback\fP and \fBXmNvalueChangedCallback\fP callbacks for all CascadeButton, DrawnButton, PushButton, and ToggleButton widgets and gadgets contained within the RowColumn widget\&. If the application supplies this resource, the \fBXmNactivateCallback\fP and \fBXmNvalueChangedCallback\fP callbacks are then revectored to the \fBXmNentryCallback\fP callbacks\&. This allows an application to supply a single callback routine for handling all items contained in a RowColumn widget\&. The callback reason is \fBXmCR_ACTIVATE\fP\&. If the application does not supply this resource, the \fBXmNactivateCallback\fP and \fBXmNvalueChangedCallback\fP callbacks for each item in the RowColumn widget work as normal\&. .IP "" 10 The application must supply this resource when this widget is created\&. Changing this resource using the \fBXtSetValues\fP is not supported\&. .IP "\fBXmNentryClass\fP" 10 Specifies the only widget class that can be added to the RowColumn widget; this resource is meaningful only when the \fBXmNisHomogeneous\fP resource is set to True\&. Both widget and gadget variants of the specified class may be added to the widget\&. .IP "" 10 When \fBXmCreateRadioBox\fP is called or when \fBXmNrowColumnType\fP is set to \fBXmWORK_AREA\fP and \fBXmNradioBehavior\fP is True, the default value of \fBXmNentryClass\fP is \fBxmToggleButtonGadgetClass\fP\&. When \fBXmNrowColumnType\fP is set to \fBXmMENU_BAR\fP, the value of \fBXmNentryClass\fP is forced to \fBxmCascadeButtonWidgetClass\fP\&. .IP "\fBXmNentryVerticalAlignment\fP" 10 Specifies the type of vertical alignment for children that are subclasses of \fBXmLabel\fP, \fBXmLabelGadget, and\fP \fBXmText\fP\&. This resource is invalid if \fBXmNorientation\fP is \fBXmVERTICAL\fP and \fBXmNpacking\fP is \fBXmPACK_TIGHT\fP, because this layout preserves variable heights among the children\&. The vertical alignment types include: .RS .IP "\fBXmALIGNMENT_BASELINE_BOTTOM\fP" 10 Causes the bottom baseline of all children in a row to be aligned\&. This resource is applicable only when all children in a row contain textual data\&. .IP "\fBXmALIGNMENT_BASELINE_TOP\fP" 10 Causes the top baseline of all children in a row to be aligned\&. This resource is applicable only when all children in a row contain textual data\&. .IP "\fBXmALIGNMENT_CONTENTS_BOTTOM\fP" 10 Causes the bottom of the contents (text or pixmap) of all children in a row to be aligned\&. .IP "\fBXmALIGNMENT_CENTER\fP" 10 Causes the center of all children in a row to be aligned\&. .IP "\fBXmALIGNMENT_CONTENTS_TOP\fP" 10 Causes the top of the contents (text or pixmap) of all children in a row to be aligned\&. .RE .IP "\fBXmNisAligned\fP" 10 Specifies text alignment for each item within the RowColumn widget; this applies only to items that are subclasses of \fBXmLabel\fP or \fBXmLabelGadget\fP\&. However, if the item is a Label widget or gadget and its parent is either a Popup menu pane or a Pulldown menu pane, alignment is not performed; the Label is treated as the title within the menu pane, and the alignment set by the application is not overridden\&. \fBXmNentryAlignment\fP controls the type of textual alignment\&. .IP "\fBXmNisHomogeneous\fP" 10 Indicates whether the RowColumn widget should enforce exact homogeneity among the items it contains; if this resource is set to True, only the widgets that are of the class indicated by \fBXmNentryClass\fP are allowed as children of the RowColumn widget\&. This is most often used when creating a MenuBar\&. Attempting to insert a child that is not a member of the specified class generates a warning message\&. .IP "" 10 In a MenuBar, the value of \fBXmNisHomogeneous\fP is forced to True\&. In an OptionMenu, the value is forced to False\&. When \fBXmCreateRadioBox\fP is called the default value is True\&. Otherwise, the default value is False\&. .IP "\fBXmNlabelString\fP" 10 When \fBXmNrowColumnType\fP is set to \fBXmMENU_OPTION\fP, this resource points to a text string that displays the label with respect to the selection area\&. The positioning of the label relative to the selection area depends on the layout direction in the horizontal orientation\&. This resource is not meaningful for all other RowColumn types\&. If the application wishes to change the label after creation, it must get the LabelGadget ID (\fBXmOptionLabelGadget\fP) and call \fBXtSetValues\fP on the LabelGadget directly\&. The default value is no label\&. .IP "\fBXmNmapCallback\fP" 10 Specifies a widget-specific callback function that is invoked when the window associated with the RowColumn widget is about to be mapped\&. The callback reason is \fBXmCR_MAP\fP\&. .IP "\fBXmNmarginHeight\fP" 10 Specifies the amount of blank space between the top edge of the RowColumn widget and the first item in each column, and the bottom edge of the RowColumn widget and the last item in each column\&. The default value is 0 (zero) for Pulldown and Popup menu panes, and 3 pixels for other RowColumn types\&. .IP "\fBXmNmarginWidth\fP" 10 Specifies the amount of blank space between the left edge of the RowColumn widget and the first item in each row, and the right edge of the RowColumn widget and the last item in each row\&. The default value is 0 (zero) for Pulldown and Popup menu panes, and 3 pixels for other RowColumn types\&. .IP "\fBXmNmenuAccelerator\fP" 10 This resource is useful only when the RowColumn widget has been configured to operate as a Popup menu pane or a MenuBar\&. The format of this resource is similar to the left side specification of a translation string, with the limitation that it must specify a key event\&. For a Popup menu pane, when the accelerator is typed by the user, the Popup menu pane is posted\&. For a MenuBar, when the accelerator is typed by the user, the first item in the MenuBar is highlighted, and traversal is enabled in the MenuBar\&. The default for a Popup menu pane is \fB\fP\&. The default for a MenuBar is \fB\fP\&. Setting the \fBXmNpopupEnabled\fP resource to False disables the accelerator\&. .IP "\fBXmNmenuHelpWidget\fP" 10 Specifies the widget ID for the CascadeButton, which is treated as the Help widget if \fBXmNrowColumnType\fP is set to \fBXmMENU_BAR\fP\&. Which corner of the MenuBar the Help widget is placed at depends on the \fBXmNlayoutDirection\fP resource of the widget\&. If the RowColumn widget is any type other than \fBXmMENU_BAR\fP, this resource is not meaningful\&. .IP "\fBXmNmenuHistory\fP" 10 Specifies the widget ID of the last menu entry to be activated\&. It is also useful for specifying the current selection for an OptionMenu\&. If \fBXmNrowColumnType\fP is set to \fBXmMENU_OPTION\fP, the specified menu item is positioned under the cursor when the menu is displayed\&. .IP "" 10 If the RowColumn widget has the \fBXmNradioBehavior\fP resource set to True, the widget field associated with this resource contains the widget ID of the last ToggleButton or ToggleButtonGadget to change from unselected to selected\&. The default value is the widget ID of the first child in the widget\&. .IP "\fBXmNmenuPost\fP" 10 Specifies an X event description indicating a button event that posts a menu system\&. The default for \fBXmMENU_POPUP\fP is \fBBMenu Press\fP\&. The default for \fBXmMENU_OPTION\fP, \fBXmMENU_BAR\fP, and \fBXmWORK_AREA\fP is \fB\fP \fBPress\fP\&. The \fBXmNmenuPost\fP resource for pulldowns should be consistent with that of the top-level parent menu (although the event type is ignored)\&. Setting this resource to \fBBTransfer Press\fP will conflict with drag and drop operations, which use \fBBTransfer Press\fP as a default button binding\&. Therefore, this resource cannot be \fBBTransfer Press\fP\&. .IP "\fBXmNmnemonic\fP" 10 This resource is useful only when \fBXmNrowColumnType\fP is set to \fBXmMENU_OPTION\fP\&. It specifies a keysym for a key that, when pressed by the user along with the \fBMAlt\fP modifier, posts the associated Pulldown menu pane\&. The first character in the OptionMenu label string that exactly matches the mnemonic in the character set specified in \fBXmNmnemonicCharSet\fP is underlined\&. The user can post the menu by pressing either the shifted or the unshifted mnemonic key\&. The default is no mnemonic\&. .IP "\fBXmNmnemonicCharSet\fP" 10 Specifies the character set of the mnemonic for an OptionMenu\&. The default is \fBXmFONTLIST_DEFAULT_TAG\fP\&. If the RowColumn widget is any type other than \fBXmMENU_OPTION\fP, this resource is not meaningful\&. .IP "\fBXmNnumColumns\fP" 10 Specifies the number of minor dimension extensions that are made to accommodate the entries; this attribute is meaningful only when \fBXmNpacking\fP is set to \fBXmPACK_COLUMN\fP\&. .IP "" 10 For vertically oriented RowColumn widgets, this attribute indicates how many columns are built; the number of entries per column is adjusted to maintain this number of columns, if possible\&. .IP "" 10 For horizontally oriented RowColumn widgets, this attribute indicates how many rows are built\&. .IP "" 10 The default value is 1\&. In an OptionMenu the value is forced to 1\&. The value must be greater than 0 (zero)\&. .IP "\fBXmNorientation\fP" 10 Determines whether RowColumn layouts are row-major or column-major\&. In a column-major layout, the children of the RowColumn are laid out in columns within the widget\&. In a row-major layout the children of the RowColumn are laid out in rows\&. The direction of the horizontal layout in the row-major layout (from left or right), and the wrapping in the column-major layout (vertical), depend on the \fBXmNlayoutDirection\fP resource of the widget\&. The \fBXmVERTICAL\fP resource value selects a column-major layout\&. \fBXmHORIZONTAL\fP selects a row-major layout\&. .IP "" 10 When creating a MenuBar or an OptionMenu, the default is \fBXmHORIZONTAL\fP\&. Otherwise, the default value is \fBXmVERTICAL\fP\&. The results of specifying a value of \fBXmVERTICAL\fP for a MenuBar are undefined\&. .IP "\fBXmNpacking\fP" 10 Specifies how to pack the items contained within a RowColumn widget\&. This can be set to \fBXmPACK_TIGHT, XmPACK_COLUMN\fP or \fBXmPACK_NONE\fP\&. When a RowColumn widget packs the items it contains, it determines its major dimension using the value of the \fBXmNorientation\fP resource\&. .IP "" 10 \fBXmPACK_TIGHT\fP indicates that given the current major dimension (for example, vertical if \fBXmNorientation\fP is \fBXmVERTICAL\fP), entries are placed one after the other until the RowColumn widget must wrap\&. RowColumn wraps when there is no room left for a complete child in that dimension\&. Wrapping occurs by beginning a new row or column in the next available space\&. Wrapping continues, as often as necessary, until all of the children are laid out\&. In the vertical dimension (columns), boxes are set to the same width; in the horizontal dimension (rows), boxes are set to the same depth\&. Each entry\&'s position in the major dimension is left unaltered (for example, \fBXmNy\fP is left unchanged when \fBXmNorientation\fP is \fBXmVERTICAL\fP); its position in the minor dimension is set to the same value as the greatest entry in that particular row or column\&. The position in the minor dimension of any particular row or column is independent of all other rows or columns\&. .IP "" 10 \fBXmPACK_COLUMN\fP indicates that all entries are placed in identically sized boxes\&. The boxes are based on the largest height and width values of all the children widgets\&. The value of the \fBXmNnumColumns\fP resource determines how many boxes are placed in the major dimension, before extending in the minor dimension\&. .IP "" 10 \fBXmPACK_NONE\fP indicates that no packing is performed\&. The \fIx\fP and \fIy\fP attributes of each entry are left alone, and the RowColumn widget attempts to become large enough to enclose all entries\&. .IP "" 10 When \fBXmCreateRadioBox\fP is called or when \fBXmNrowColumnType\fP is set to \fBXmWORK_AREA\fP and \fBXmNradioBehavior\fP is True, the default value of \fBXmNpacking\fP is \fBXmPACK_COLUMN\fP\&. In an OptionMenu the value is initialized to \fBXmPACK_TIGHT\fP\&. Otherwise, the value defaults to \fBXmPACK_TIGHT\fP\&. .IP "\fBXmNpopupEnabled\fP" 10 Allows the menu system to enable keyboard input (accelerators and mnemonics) defined for the Popup menu pane and any of its submenus\&. The Popup menu pane needs to be informed whenever its accessibility to the user changes because posting of the Popup menu pane is controlled by the application\&. This resource can take four values, including: .RS .IP "\fBXmPOPUP_KEYBOARD\fP" 10 Specifies that the keyboard input\(emaccelerators and mnemonics\(emdefined for the Popup menu pane and any of its submenus is enabled\&. This is the default\&. .IP "\fBXmPOPUP_DISABLED\fP" 10 Specifies that the keyboard input is disabled\&. .IP "\fBXmPOPUP_AUTOMATIC\fP" 10 Specifies that the keyboard is enabled for automatic popup menus\&. .IP "\fBXmPOPUP_AUTOMATIC_RECURSIVE\fP" 10 Specifies that the keyboard is enabled for recursive automatic popup menus\&. .RE .IP "\fBXmNradioAlwaysOne\fP" 10 If True, forces the active ToggleButton or ToggleButtonGadget to be automatically selected after having been unselected (if no other toggle was activated)\&. If False, the active toggle may be unselected\&. The default value is True\&. This resource is important only when \fBXmNradioBehavior\fP is True\&. .IP "" 10 The application can always add and subtract toggles from RowColumn regardless of the selected/unselected state of the toggle\&. The application can also manage and unmanage toggle children of RowColumn at any time regardless of state\&. Therefore, the application can sometimes create a RowColumn that has \fBXmNradioAlwaysOne\fP set to True and none of the toggle children selected\&. The result is undefined if the value of this resource is True and the application sets more than one ToggleButton at a time\&. .IP "\fBXmNradioBehavior\fP" 10 Specifies a Boolean value that when True, indicates that the RowColumn widget should enforce a RadioBox-type behavior on all of its children that are ToggleButtons or ToggleButtonGadgets\&. .IP "" 10 When the value of this resource is True, \fBXmNindicatorType\fP defaults to \fBXmONE_OF_MANY\fP for ToggleButton and ToggleButtonGadget children\&. .IP "" 10 RadioBox behavior dictates that when one toggle is selected and the user selects another toggle, the first toggle is unselected automatically\&. The RowColumn usually does not enforce this behavior if the application, rather than the user, changes the state of a toggle\&. The RowColumn does enforce this behavior if a toggle child is selected with \fBXmToggleButtonSetState\fP or \fBXmToggleButtonGadgetSetState\fP with a \fInotify\fP argument of True\&. .IP "" 10 When \fBXmCreateRadioBox\fP is called, the default value of \fBXmNradioBehavior\fP is True\&. Otherwise, the default value is False\&. .IP "\fBXmNresizeHeight\fP" 10 Requests a new height if necessary, when set to True\&. When this resource is set to False, the widget does not request a new height regardless of any changes to the widget or its children\&. .IP "\fBXmNresizeWidth\fP" 10 Requests a new width if necessary, when set to True\&. When set to False, the widget does not request a new width regardless of any changes to the widget or its children\&. .IP "\fBXmNrowColumnType\fP" 10 Specifies the type of RowColumn widget to be created\&. It is a nonstandard resource that cannot be changed after it is set\&. If an application uses any of the convenience routines, except \fBXmCreateRowColumn\fP, this resource is automatically forced to the appropriate value by the convenience routine\&. If an application uses the Xt Intrinsics API to create its RowColumn widgets, it must specify this resource itself\&. The set of possible settings for this resource are .RS .IP " \(bu" 6 \fBXmWORK_AREA\fP (default) .IP " \(bu" 6 \fBXmMENU_BAR\fP .IP " \(bu" 6 \fBXmMENU_PULLDOWN\fP .IP " \(bu" 6 \fBXmMENU_POPUP\fP .IP " \(bu" 6 \fBXmMENU_OPTION\fP .RE .IP "" 10 This resource cannot be changed after the RowColumn widget is created\&. Any changes attempted through \fBXtSetValues\fP are ignored\&. .IP "" 10 The value of this resource is used to determine the value of a number of other resources\&. The descriptions of RowColumn resources explain this when it is the case\&. The resource \fBXmNnavigationType\fP, inherited from \fBXmManager\fP, is changed to \fBXmNONE\fP if \fBXmNrowColumnType\fP is \fBXmMENU_OPTION\fP\&. .IP "\fBXmNspacing\fP" 10 Specifies the horizontal and vertical spacing between items contained within the RowColumn widget\&. The default value is 3 pixels for \fBXmOPTION_MENU\fP and \fBXmWORK_AREA\fP and 0 (zero) for other RowColumn types\&. .IP "\fBXmNsubMenuId\fP" 10 Specifies the widget ID for the Pulldown menu pane to be associated with an OptionMenu\&. This resource is useful only when \fBXmNrowColumnType\fP is set to \fBXmMENU_OPTION\fP\&. The default value is NULL\&. .IP "\fBXmNtearOffMenuActivateCallback\fP" 10 Specifies the callback list that notifies the application when the tear-off menu pane is about to be activated\&. It precedes the tear-off\&'s map callback\&. .IP "" 10 Use this resource when your application has shared menu panes and when the torn-off menu can have two or more parents that can have opposing sensitivity states for the same menu item\&. This resource enables the application to track whether a menu item is sensitive or insensitive and to set the state to the original parent\&'s menu item state when the torn-off menu is reposted\&. The application can use \fBXmGetPostedFromWidget\fP to determine from which parent the menu was torn\&. The callback reason is \fBXmCR_TEAR_OFF_ACTIVATE\fP\&. The default is NULL\&. .IP "\fBXmNtearOffMenuDeactivateCallback\fP" 10 Specifies the callback list that notifies the application when the tear-off menu pane is about to be deactivated\&. It follows the tear-off\&'s unmap callback\&. .IP "" 10 Use this resource when your application has shared menu panes and when the torn-off menu can have two or more parents that can have opposing sensitivity states for the same menu item\&. This resource enables the application to track whether a menu item is sensitive or insensitive and to set the state to the original parent\&'s menu item state when the torn-off menu is reposted\&. The application can use \fBXmGetPostedFromWidget\fP to determine from which parent the menu was torn\&. The callback reason is \fBXmCR_TEAR_OFF_DEACTIVATE\fP\&. The default is NULL\&. .IP "\fBXmNtearOffModel\fP" 10 Indicates whether tear-off functionality is enabled or disabled when \fBXmNrowColumnType\fP is set to \fBXmMENU_PULLDOWN\fP or \fBXmMENU_POPUP\fP\&. The values are \fBXmTEAR_OFF_ENABLED\fP or \fBXmTEAR_OFF_DISABLED\fP (default value)\&. This resource is invalid for type \fBXmMENU_OPTION\fP; however, it does affect any pulldown submenus within an OptionMenu\&. The function \fBXmRepTypeInstallTearOffModelConverter\fP installs a resource converter for this resource\&. .IP "\fBXmNtearoffTitle\fP" 10 Used by the TearOff shell to set the title for the window manager to display\&. .IP "\fBXmNunmapCallback\fP" 10 Specifies a list of callbacks that is called after the window associated with the RowColumn widget has been unmapped\&. The callback reason is \fBXmCR_UNMAP\fP\&. The default value is NULL\&. .IP "\fBXmNwhichButton\fP" 10 This resource is obsolete; it has been replaced by \fBXmNmenuPost\fP and is present for compatibility with older releases of Motif\&. This resource cannot be 2\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmRowColumn Constraint Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNpositionIndexXmCPositionIndexshortXmLAST_POSITIONCSG _____ .TE .IP "\fBXmNpositionIndex\fP" 10 Specifies the position of the widget in its parent\&'s list of children (the value of the \fBXmNchildren\fP resource)\&. The value is an integer that is no less than 0 (zero) and no greater than the number of children in the list at the time the value is specified\&. A value of 0 (zero) means that the child is placed at the beginning of the list\&. The value can also be specified as \fBXmLAST_POSITION\fP (the default), which means that the child is placed at the end of the list\&. Any other value is ignored\&. \fBXtGetValues\fP returns the position of the widget in its parent\&'s child list at the time of the call to \fBXtGetValues\fP\&. .IP "" 10 When a widget is inserted into its parent\&'s child list, the positions of any existing children that are greater than or equal to the specified widget\&'s \fBXmNpositionIndex\fP are increased by 1\&. The effect of a call to \fBXtSetValues\fP for \fBXmNpositionIndex\fP is to remove the specified widget from its parent\&'s child list, decrease by 1 the positions of any existing children that are greater than the specified widget\&'s former position in the list, and then insert the specified widget into its parent\&'s child list as described in the preceding sentence\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBSimple Menu Creation Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbuttonAcceleratorsXmCButtonAcceleratorsStringTableNULLC _____ XmNbuttonAcceleratorTextXmCButtonAcceleratorTextXmStringTableNULLC _____ XmNbuttonCountXmCButtonCountint0C _____ XmNbuttonMnemonicCharSetsXmCButtonMnemonicCharSetsXmStringCharSetTableNULLC _____ XmNbuttonMnemonicsXmCButtonMnemonicsXmKeySymTableNULLC _____ XmNbuttonsXmCButtonsXmStringTableNULLC _____ XmNbuttonSetXmCButtonSetint-1C _____ XmNbuttonTypeXmCButtonTypeXmButtonTypeTableNULLC _____ XmNoptionLabelXmCOptionLabelXmStringNULLC _____ XmNoptionMnemonicXmCOptionMnemonicKeySymNULLC _____ XmNpostFromButtonXmCPostFromButtonint-1C _____ XmNsimpleCallbackXmCCallbackXtCallbackProcNULLC _____ .TE .IP "\fBXmNbuttonAccelerators\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a list of accelerators for the buttons created\&. The list contains one element for each button, separator, and title created\&. .IP "\fBXmNbuttonAcceleratorText\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a list of compound strings to display for the accelerators for the buttons created\&. The list contains one element for each button, separator, and title created\&. .IP "\fBXmNbuttonCount\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies the total number of menu buttons, separators, and titles to create\&. The value must not be negative\&. .IP "\fBXmNbuttonMnemonicCharSets\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a list of character sets with which button mnemonics are to be displayed\&. The list contains one element for each button, separator, and title created\&. The default is determined dynamically depending on the locale of the widget\&. .IP "\fBXmNbuttonMnemonics\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a list of mnemonics for the buttons created\&. The list contains one element for each button, separator, and title created\&. .IP "\fBXmNbuttons\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a list of compound strings to use as labels for the buttons created\&. The list contains one element for each button, separator, and title created\&. .IP "\fBXmNbuttonSet\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies which button of a RadioBox or OptionMenu Pulldown submenu is initially set\&. The value is an integer \fIn\fP indicating the \fIn\fPth ToggleButtonGadget specified for a RadioBox or the \fIn\fPth PushButtonGadget specified for an OptionMenu Pulldown submenu\&. The first button specified is number 0\&. The value must not be negative\&. .IP "\fBXmNbuttonType\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a list of button types associated with the buttons to be created\&. The list contains one element for each button, separator, and title created\&. If this resource is not specified, each button in a MenuBar is a CascadeButtonGadget, each button in a RadioBox or CheckBox is a ToggleButtonGadget, and each button in any other type of RowColumn widget is a PushButtonGadget\&. Each button type is of type \fBXmButtonType\fR, an enumeration with the following possible values: .RS .IP "\fBXmCASCADEBUTTON\fP" 10 Specifies a CascadeButtonGadget for a MenuBar, Popup menu pane, or Pulldown menu pane\&. .IP "\fBXmCHECKBUTTON\fP" 10 Specifies a ToggleButtonGadget for a CheckBox, Popup menu pane, or Pulldown menu pane\&. .IP "\fBXmDOUBLE_SEPARATOR\fP" 10 Specifies a SeparatorGadget for a Popup menu pane, Pulldown menu pane, or OptionMenu Pulldown submenu\&. The separator type is \fBXmDOUBLE_LINE\fP\&. .IP "\fBXmPUSHBUTTON\fP" 10 Specifies a PushButtonGadget for a Popup menu pane, Pulldown menu pane, or OptionMenu Pulldown submenu\&. .IP "\fBXmRADIOBUTTON\fP" 10 Specifies a ToggleButtonGadget for a RadioBox, Popup menu pane, or Pulldown menu pane\&. .IP "\fBXmSEPARATOR\fP" 10 Specifies a SeparatorGadget for a Popup menu pane, Pulldown menu pane, or OptionMenu Pulldown submenu\&. .IP "\fBXmTITLE\fP" 10 Specifies a LabelGadget used as a title for a Popup menu pane or Pulldown menu pane\&. .RE .IP "\fBXmNoptionLabel\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a compound string for the label string to be used on the left side of an OptionMenu\&. .IP "\fBXmNoptionMnemonic\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a keysym for a key that, when pressed by the user along with the \fBMAlt\fP modifier, posts the associated Pulldown menu pane for an OptionMenu\&. .IP "\fBXmNpostFromButton\fP" 10 This resource is for use with the simple menu creation routines\&. For a Pulldown menu pane, it specifies the button in the parent to which the submenu is attached\&. The menu is then posted from this button\&. The value is an integer \fIn\fP indicating the \fIn\fPth CascadeButton or CascadeButtonGadget specified for the parent of the Pulldown menu pane\&. The first button specified is number 0\&. The value must not be negative\&. .IP "\fBXmNsimpleCallback\fP" 10 This resource is for use with the simple menu creation routines\&. It specifies a callback procedure to be called when a button is activated or when its value changes\&. This callback function is added to each button after creation\&. For a CascadeButtonGadget or a PushButtonGadget, the callback is added as the button\&'s \fBXmNactivateCallback\fP, and it is called when the button is activated\&. For a ToggleButtonGadget, the callback is added as the button\&'s \fBXmNvalueChangedCallback\fP, and it is called when the button\&'s value changes\&. The button number is passed in the \fIclient_data\fP field\&. .SS "Inherited Resources" .PP RowColumn inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypedynamicCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleandynamicCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcdefault procedureCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Widget \fIwidget\fP; char \fI* data\fP; char \fI* callbackstruct\fP; } XmRowColumnCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback .PP The following fields apply only when the callback reason is \fBXmCR_ACTIVATE\fP; for all other callback reasons, these fields are set to NULL\&. The \fBXmCR_ACTIVATE\fP callback reason is generated only when the application has supplied an entry callback, which overrides any activation callbacks registered with the individual RowColumn items\&. .IP "\fIwidget\fP" 10 Is set to the widget ID of the RowColumn item that has been activated .IP "\fIdata\fP" 10 Contains the client-data value supplied by the application when the RowColumn item\&'s activation callback was registered .IP "\fIcallbackstruct\fP" 10 Points to the callback structure generated by the RowColumn item\&'s activation callback .SS "Translations" .PP \fBXmRowColumn\fP translations depend on the value of the \fBXmNrowColumnType\fP resource\&. .PP If \fBXmNrowColumnType\fP is set to \fBXmWORK_AREA\fP, \fBXmRowColumn\fP inherits translations from \fBXmManager\fP\&. .PP If \fBXmNrowColumnType\fP is set to \fBXmMENU_OPTION\fP, \fBXmRowColumn\fP inherits traversal, \fB\fP, and \fB\fP translations from \fBXmManager\fP and has the following additional translations\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\fP:" 10 MenuGadgetDrag() .IP "\fBc\fP:" 10 MenuGadgetTraverseCurrent() .IP "\fBc\fP:" 10 MenuGadgetTraverseCurrentUp() .IP "\fB\(apc\fP\fB\fP:" 10 MenuBtnDown() .IP "\fB\(apc\fP\fB\fP:" 10 MenuBtnUp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuHelp() .PP The translations for \fBXmRowColumn\fP if \fBXmNrowColumnType\fP is set to \fBXmMENU_BAR\fP \fBXmMENU_PULLDOWN\fP, or \fBXmMENU_POPUP\fP are described in the following list\&. In a Popup menu system, \fB\fP also performs the \fB\fP actions\&. .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuHelp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuGadgetTraverseLeft() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuGadgetTraverseRight() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuGadgetTraverseUp() .IP "\fB:\fP\fB\fP\fB\fP:" 10 MenuGadgetTraverseDown() .SS "Action Routines" .PP The \fBXmRowColumn\fP action routines are .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "ManagerGadgetSelect():" 10 When a gadget child of the menu has the focus, invokes the gadget child\&'s behavior associated with \fB\fP\&. This generally has the effect of unposting the menu hierarchy and arming and activating the gadget, except that, for a CascadeButtonGadget with a submenu, it posts the submenu\&. .IP "MenuBtnDown():" 10 When a gadget child of the menu has focus, invokes the gadget child\&'s behavior associated with \fB\fP\&. This generally has the effect of unposting any menus posted by the parent menu, enabling mouse traversal in the menu, and arming the gadget\&. For a CascadeButtonGadget with a submenu, it also posts the associated submenu\&. .IP "MenuBtnUp():" 10 When a gadget child of the menu has focus, invokes the gadget child\&'s behavior associated with \fB\fP\&. This generally has the effect of unposting the menu hierarchy and activating the gadget, except that for a CascadeButtonGadget with a submenu, it posts the submenu and enables keyboard traversal in the menu\&. .IP "MenuGadgetEscape():" 10 In a top-level Pulldown MenuPane from a MenuBar, unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget that had the focus before the MenuBar was entered\&. In other Pulldown MenuPanes, unposts the menu\&. .IP "" 10 In a Popup MenuPane, unposts the menu and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores keyboard focus to the widget from which the menu was posted\&. In a TearOff MenuPane that has no submenus posted, dismisses the menu; otherwise, if one or more submenus are posted, unposts the last menu pane\&. .IP "MenuGadgetTraverseDown():" 10 If the current menu item has a submenu and is in a MenuBar, then this action posts the submenu, disarms the current menu item, and arms the submenu\&'s first traversable menu item\&. .IP "" 10 If the current menu item is in a MenuPane, then this action disarms the current menu item and arms the item below it\&. This action wraps within the MenuPane\&. The direction of the wrapping depends on the \fBXmNlayoutDirection\fP resource\&. .IP "MenuGadgetTraverseLeft():" 10 When the current menu item is in a MenuBar, this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left\&. If the current menu item is at the left edge of a submenu attached to a MenuBar item, then this action unposts the submenu and traverses to the MenuBar item to the left, wrapping if necessary\&. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu\&. If the current menu item is at the left edge of a submenu not directly attached to a MenuBar item, then this action unposts the current submenu only\&. .IP "" 10 In Popup or Torn-off MenuPanes, when the current menu item is at the left edge, this action wraps within the MenuPane\&. If the current menu item is at the left edge of the MenuPane and not in the top row, this action wraps to the rightmost menu item in the row above\&. If the current menu item is in the upper, leftmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, rightmost menu item in the MenuPane\&. .IP "" 10 The preceding description applies when the \fBXmNlayoutDirection\fP horizontal direction is \fBXmLEFT_TO_RIGHT\fP\&. If the \fBXmNlayoutDirection\fP horizontal direction is \fBXmRIGHT_TO_LEFT\fP, then the following applies\&. .IP "" 10 If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu\&. If the current menu item is not a CascadeButton and is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left, wrapping if necessary\&. If the current menu item is not a CascadeButton and is at the left edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the left\&. If that MenuBar item has a submenu, it posts the submenu and arms the submenu\&'s first traversable item\&. .IP "" 10 In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the left edge of a row (except the bottom row), this action wraps to the rightmost menu item in the row below\&. If the current menu item is not a CascadeButton and is in the bottom, leftmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, rightmost menu item of the MenuPane\&. .IP "MenuGadgetTraverseRight():" 10 If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the right\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu\&. If the current menu item is not a CascadeButton and is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right, wrapping if necessary\&. If the current menu item is not a CascadeButton and is at the right edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the right\&. If that MenuBar item has a submenu, it posts the submenu and arms the submenu\&'s first traversable item\&. .IP "" 10 In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the right edge of a row (except the bottom row), this action wraps to the leftmost menu item in the row below\&. If the current menu item is not a CascadeButton and is in the bottom, rightmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, leftmost menu item of the MenuPane\&. .IP "" 10 The preceding description applies when the \fBXmNlayoutDirection\fP horizontal direction is \fBXmLEFT_TO_RIGHT\fP\&. If the \fBXmNlayoutDirection\fP horizontal direction is \fBXmRIGHT_TO_LEFT\fP, then the following applies\&. When the current menu item is in a MenuBar, this action disarms the current item and arms the MenuBar item to the left\&. This action wraps within the MenuBar\&. .IP "" 10 In MenuPanes, if the current menu item is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right\&. If the current menu item is at the right edge of a submenu attached to a MenuBar item, then this action unposts the submenu and traverses to the MenuBar item to the right, wrapping if necessary\&. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu\&. If the current menu item is at the right edge of a submenu not directly attached to a MenuBar item, then this action unposts the current submenu only\&. .IP "" 10 In Popup or Torn-off MenuPanes, when the current menu item is at the right edge, this action wraps within the MenuPane\&. If the current menu item is at the right edge of the MenuPane and not in the top row, this action wraps to the leftmost menu item in the row above\&. If the current menu item is in the upper, rightmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, leftmost menu item in the MenuPane\&. .IP "MenuGadgetTraverseUp():" 10 When the current menu item is in a MenuPane, then this action disarms the current menu item and arms the item above it\&. This action wraps within the MenuPane\&. The direction of the wrapping depends on the \fBXmNlayoutDirection\fP resource\&. .SS "Related Behavior" .PP The following menu functions are available: .IP "\fB\fP:" 10 In any non-popup descendant of a MenuBar\&'s parent, excluding the MenuBar itself, this action enables keyboard traversal and moves keyboard focus to the first item in the MenuBar\&. In the MenuBar or any menu cascaded from it, this action unposts the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores focus to the widget that had the focus when the menu system was entered\&. .IP "\fB\fP:" 10 Pops up the menu associated with the control that has the keyboard focus\&. Enables keyboard traversal in the menu\&. In the Popup menu system or any menu cascaded from it, this action unposts the menu hierarchy and, when the shell\&'s keyboard focus policy is \fBXmEXPLICIT\fP, restores focus to the widget that had the focus when the menu system was entered\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateMenuBar\fP(3), \fBXmCreateOptionMenu\fP(3), \fBXmCreatePopupMenu\fP(3), \fBXmCreatePulldownMenu\fP(3), \fBXmCreateRadioBox\fP(3), \fBXmCreateRowColumn\fP(3), \fBXmCreateSimpleCheckBox\fP(3), \fBXmCreateSimpleMenuBar\fP(3), \fBXmCreateSimpleOptionMenu\fP(3), \fBXmCreateSimplePopupMenu\fP(3), \fBXmCreateSimplePulldownMenu\fP(3), \fBXmCreateSimpleRadioBox\fP(3), \fBXmCreateWorkArea\fP(3), \fBXmGetMenuCursor\fP(3), \fBXmGetPostedFromWidget\fP(3), \fBXmGetTearOffControl\fP, \fBXmLabel\fP(3), \fBXmManager\fP(3), \fBXmMenuPosition\fP(3), \fBXmOptionButtonGadget\fP(3), \fBXmOptionLabelGadget\fP(3), \fBXmRepTypeInstallTearOffModelConverter\fP, \fBXmSetMenuCursor\fP(3), \fBXmUpdateDisplay\fP(3), \fBXmVaCreateManagedRowColumn\fP(3), \fBXmVaCreateRowColumn\fP(3), \fBXmVaCreateSimpleCheckBox\fP(3), \fBXmVaCreateSimpleMenuBar\fP(3), \fBXmVaCreateSimpleOptionMenu\fP(3), \fBXmVaCreateSimplePopupMenu\fP(3), \fBXmVaCreateSimplePulldownMenu\fP(3), and \fBXmVaCreateSimpleRadioBox\fP(3)\&. motif-2.3.8/doc/man/man3/XmTextDisableRedisplay.30000644000175000017500000000332512672140200016414 00000000000000'\" t ...\" TxtDisab.sgm /main/8 1996/09/08 21:12:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextDisableRedisplay" "library call" .SH "NAME" \fBXmTextDisableRedisplay\fP \(em A Text function that temporarily prevents visual update of the Text widget .iX "XmTextDisableRedisplay" .iX "Text functions" "XmTextDisableRedisplay" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextDisableRedisplay\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextDisableRedisplay\fP prevents redisplay of the specified Text widget even though its visual attributes have been modified\&. The visual appearance of the widget remains unchanged until \fBXmTextEnableRedisplay\fP is called, although the insertion cursor is not displayed\&. This allows an application to make multiple changes to the widget without causing intermediate visual updates\&. .IP "\fIwidget\fP" 10 Specifies the Text widget ID .SH "RELATED" .PP \fBXmTextEnableRedisplay\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:33 motif-2.3.8/doc/man/man3/XmRemoveWMProtocolCallback.30000644000175000017500000000421012672140200017161 00000000000000'\" t ...\" RemWMA.sgm /main/7 1996/08/30 15:56:14 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRemoveWMProtocolCallback" "library call" .SH "NAME" \fBXmRemoveWMProtocolCallback\fP \(em A VendorShell convenience interface that removes a callback from the internal list .iX "XmRemoveWMProtocol\\%Callback" .iX "VendorShell functions" "XmRemoveWMProtocol\\%Callback" .iX "protocols" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmRemoveWMProtocolCallback\fP\fR( \fBWidget \fBshell\fR\fR, \fBAtom \fBprotocol\fR\fR, \fBXtCallbackProc \fBcallback\fR\fR, \fBXtPointer \fBclosure\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRemoveWMProtocolCallback\fP is a convenience interface\&. It calls \fBXmRemoveProtocolCallback\fP with the property value set to the atom returned by interning \fBWM_PROTOCOLS\fP\&. .IP "\fIshell\fP" 10 Specifies the widget with which the protocol property is associated .IP "\fIprotocol\fP" 10 Specifies the protocol atom .IP "\fIcallback\fP" 10 Specifies the procedure to call when a protocol message is received .IP "\fIclosure\fP" 10 Specifies the client data to be passed to the callback when it is invoked .PP For a complete definition of VendorShell and its associated resources, see \fBVendorShell\fP(3)\&. .SH "RELATED" .PP \fBVendorShell\fP(3), \fBXmAddWMProtocolCallback\fP(3), \fBXmInternAtom\fP(3), and \fBXmRemoveProtocolCallback\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmStringTable.30000644000175000017500000000234312672140200014544 00000000000000'\" t ...\" StrTaA.sgm /main/7 1996/08/30 16:14:07 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringTable" "library call" .SH "NAME" \fBXmStringTable\fR \(em Data type for an array of compound strings .iX "XmStringTable" .iX "data types" "XmStringTable" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP \fBXmStringTable\fR is the data type for an array of compound strings (objects of type \fBXmString\fR)\&. .SH "RELATED" .PP \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:32 motif-2.3.8/doc/man/man3/XmStringFree.30000644000175000017500000000271412672140200014400 00000000000000'\" t ...\" StrFrA.sgm /main/7 1996/08/30 16:10:39 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringFree" "library call" .SH "NAME" \fBXmStringFree\fP \(em A compound string function that conditionally deallocates memory .iX "XmStringFree" .iX "compound string functions" "XmStringFree" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmStringFree\fP\fR( \fBXmString \fBstring\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringFree\fP conditionally recovers memory used by a compound string\&. Applications should call \fBXmStringFree\fP when the application no longer needs \fIstring\fP\&. .IP "\fIstring\fP" 10 Specifies the compound string to be freed .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmClipboardInquireFormat.30000644000175000017500000000711312672140200016733 00000000000000'\" t ...\" ClipbG.sgm /main/10 1996/09/25 10:24:20 cdedoc $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmClipboardInquireFormat" "library call" .SH "NAME" \fBXmClipboardInquireFormat\fP \(em A clipboard function that returns a specified format name .iX "XmClipboardInquireFormat" .iX "clipboard functions" "XmClipboardInquireFormat" .SH "SYNOPSIS" .PP .nf #include int XmClipboardInquireFormat (\fIdisplay, window, index, format_name_buf, buffer_len, copied_len\fP) Display \fI* display\fP; Window \fIwindow\fP; int \fIindex\fP; XtPointer \fIformat_name_buf\fP; unsigned long \fIbuffer_len\fP; unsigned long \fI* copied_len\fP; \fB\fR(\fBvoid\fR) .fi .SH "DESCRIPTION" .PP \fBXmClipboardInquireFormat\fP returns a specified format name for the data item in the clipboard\&. If the name must be truncated, the function returns a warning status\&. .IP "\fIdisplay\fP" 10 Specifies a pointer to the \fBDisplay\fR structure that was returned in a previous call to \fBXOpenDisplay\fP or \fBXtDisplay\fP\&. .IP "\fIwindow\fP" 10 Specifies the window ID of a widget that relates the application window to the clipboard\&. The widget\&'s window ID can be obtained through \fBXtWindow\fP\&. The same application instance should pass the same window ID to each of the clipboard functions that it calls\&. .IP "\fIindex\fP" 10 Specifies which of the ordered format names to obtain\&. If this index is greater than the number of formats for the data item, this function returns a 0 (zero) in the \fIcopied_len\fP argument\&. .IP "\fIformat_name_buf\fP" 10 Specifies the buffer that receives the format name\&. .IP "\fIbuffer_len\fP" 10 Specifies the number of bytes in the format name buffer\&. .IP "\fIcopied_len\fP" 10 Specifies the number of bytes in the data item copied to the buffer\&. If this argument equals 0 (zero), there is no \fIn\fPth format for the data item\&. .SH "RETURN" .IP "\fBXmClipboardSuccess\fP" 10 The function was successful\&. .IP "\fBXmClipboardLocked\fP" 10 The function failed because the clipboard was locked by another application\&. The application can continue to call the function again with the same parameters until the lock goes away\&. This gives the application the opportunity to ask if the user wants to keep trying or to give up on the operation\&. .IP "\fBXmClipboardTruncate\fP" 10 The data returned is truncated because the user did not provide a buffer large enough to hold the data\&. .IP "\fBXmClipboardNoData\fP" 10 The function could not find data on the clipboard corresponding to the format requested\&. This could occur because the clipboard is empty; there is data on the clipboard, but not in the requested format; or the data in the requested format was passed by name and is no longer available\&. .SH "RELATED" .PP \fBXmClipboardStartCopy\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:18 motif-2.3.8/doc/man/man3/XmStringCompare.30000644000175000017500000000412212672140200015100 00000000000000'\" t ...\" StrCoA.sgm /main/9 1996/09/08 21:03:04 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringCompare" "library call" .SH "NAME" \fBXmStringCompare\fP \(em A compound string function that compares two strings .iX "XmStringCompare" .iX "compound string functions" "XmStringCompare" .SH "SYNOPSIS" .PP .nf #include \fBBoolean \fBXmStringCompare\fP\fR( \fBXmString \fBs1\fR\fR, \fBXmString \fBs2\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringCompare\fP returns a Boolean value indicating the results of a semantically equivalent comparison of two compound strings\&. .PP Semantically equivalent means that the strings have the same text components, font list element tags, directions, and separators\&. In general, if two compound strings are created with the same (\fBchar *\fR) string using \fBXmStringCreateLocalized\fP in the same language environment, the compound strings compare as equal\&. If two compound strings are created with the same text and tag argument using \fBXmStringCreate\fP, the strings compare as equal\&. .IP "\fIs1\fP" 10 Specifies a compound string to be compared with \fIs2\fP .IP "\fIs2\fP" 10 Specifies a compound string to be compared with \fIs1\fP .SH "RETURN" .PP Returns True if two compound strings are equivalent\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3) and \fBXmStringCreateLocalized\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:30 motif-2.3.8/doc/man/man3/XmMainWindow.30000644000175000017500000002651412672140200014410 00000000000000'\" t ...\" MainWinA.sgm /main/9 1996/09/08 20:52:59 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmMainWindow" "library call" .SH "NAME" \fBXmMainWindow\fP \(em The MainWindow widget class .iX "XmMainWindow" .iX "widget class" "MainWindow" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP MainWindow provides a standard layout for the primary window of an application\&. This layout includes a MenuBar, a CommandWindow, a work region, a MessageWindow, and ScrollBars\&. Any or all of these areas are optional\&. The work region and ScrollBars in the MainWindow behave identically to the work region and ScrollBars in the ScrolledWindow widget\&. The user can think of the MainWindow as an extended ScrolledWindow with an optional MenuBar and optional CommandWindow and MessageWindow\&. .PP In a fully loaded MainWindow, the MenuBar spans the top of the window horizontally\&. The CommandWindow spans the MainWindow horizontally just below the MenuBar, and the work region lies below the CommandWindow\&. The MessageWindow is below the work region\&. Any space remaining below the MessageWindow is managed in a manner identical to ScrolledWindow\&. The behavior of ScrolledWindow can be controlled by the ScrolledWindow resources\&. To create a MainWindow, first create the work region elements, a MenuBar, a CommandWindow, a MessageWindow, a horizontal ScrollBar, and a vertical ScrollBar widget, and then call \fBXmMainWindowSetAreas\fP with those widget IDs\&. .PP MainWindow can also create three Separator widgets that provide a visual separation of MainWindow\&'s four components\&. The user can specify resources in a resource file for the automatically created gadgets that contain the MainWindow separators\&. The name of the first separator gadget is \fBSeparator1\fP; the second is \fBSeparator2\fP; and the third is \fBSeparator3\fP\&. .PP MainWindow also provides the following three child types for layout at creation time: .IP " \(bu" 6 \fBXmMENU_BAR\fP .IP " \(bu" 6 \fBXmCOMMAND_WINDOW\fP .IP " \(bu" 6 \fBXmMESSAGE_WINDOW\fP .PP MainWindow can use these child types at creation time instead of their associated resource values\&. MainWindow uses the \fBXmQTmenuSystem\fP trait\&. .SS "Descendants" .PP MainWindow automatically creates the descendants shown in the following table\&. An application can use \fBXtNameToWidget\fP to gain access to the named descendant\&. In addition, a user or an application can use the named descendant when specifying resource values\&. .TS tab() box; l| l| l. \fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP ___ = ___ \fBHorScrollBar\fP\fBXmScrollBar\fPhorizontal scroll bar ___ \fBSeparator1\fP\fBXmSeparatorGadget\fPoptional first separator ___ \fBSeparator2\fP\fBXmSeparatorGadget\fPoptional second separator ___ \fBSeparator3\fP\fBXmSeparatorGadget\fPoptional third separator ___ \fBVertScrollBar\fP\fBXmScrollBar\fPvertical scroll bar ___ .TE .SS "Classes" .PP MainWindow inherits behavior and resources from \fBCore\fP, \fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP, and \fBXmScrolledWindow\fP\&. .PP The class pointer is \fBxmMainWindowWidgetClass\fP\&. .PP The class name is \fBXmMainWindow\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmMainWindow Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNcommandWindowXmCCommandWindowWidgetNULLCSG _____ XmNcommandWindowLocationXmCCommandWindowLocationunsigned charABOVE (SeeDesc\&.)CG _____ XmNmainWindowMarginHeightXmCMainWindowMarginHeightDimension0CSG _____ XmNmainWindowMarginWidthXmCMainWindowMarginWidthDimension0CSG _____ XmNmenuBarXmCMenuBarWidgetNULLCSG _____ XmNmessageWindowXmCMessageWindowWidgetNULLCSG _____ XmNshowSeparatorXmCShowSeparatorBooleanFalseCSG _____ .TE .IP "\fBXmNcommandWindow\fP" 10 Specifies the widget to be laid out as the CommandWindow\&. This widget must have been previously created and managed as a child of MainWindow\&. .IP "\fBXmNcommandWindowLocation\fP" 10 Controls the position of the command window\&. \fBXmCOMMAND_ABOVE_WORKSPACE\fP locates the command window between the menu bar and the work window\&. \fBXmCOMMAND_BELOW_WORKSPACE\fP locates the command window between the work window and the message window\&. .IP "\fBXmNmainWindowMarginHeight\fP" 10 Specifies the margin height on the top and bottom of MainWindow\&. This resource overrides any setting of the ScrolledWindow resource \fBXmNscrolledWindowMarginHeight\fP\&. .IP "\fBXmNmainWindowMarginWidth\fP" 10 Specifies the margin width on the right and left sides of MainWindow\&. This resource overrides any setting of the ScrolledWindow resource \fBXmNscrolledWindowMarginWidth\fP\&. .IP "\fBXmNmenuBar\fP" 10 Specifies the widget to be laid out as the MenuBar\&. This widget must have been previously created and managed as a child of MainWindow\&. .IP "\fBXmNmessageWindow\fP" 10 Specifies the widget to be laid out as the MessageWindow\&. This widget must have been previously created and managed as a child of MainWindow\&. The MessageWindow is positioned at the bottom of the MainWindow\&. If this value is NULL, no message window is included in the MainWindow\&. .IP "\fBXmNshowSeparator\fP" 10 Displays separators between the components of the MainWindow when set to True\&. If set to False, no separators are displayed\&. .SS "Inherited Resources" .PP MainWindow inherits behavior and resources from the superclasses described in the following table\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmScrolledWindow Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNautoDragModelXmCAutoDragModelXtEnumXmAUTO_DRAG_ENABLEDCSG _____ XmNclipWindowXmCClipWindowWidgetdynamicG _____ XmNhorizontalScrollBarXmCHorizontalScrollBarWidgetdynamicCSG _____ XmNscrollBarDisplayPolicyXmCScrollBarDisplayPolicyunsigned chardynamicCSG _____ XmNscrollBarPlacementXmCScrollBarPlacementunsigned charXmBOTTOM_RIGHTCSG _____ XmNscrolledWindowMarginHeightXmCScrolledWindowMarginHeightDimension0N/A _____ XmNscrolledWindowMarginWidthXmCScrolledWindowMarginWidthDimension0N/A _____ XmNscrollingPolicyXmCScrollingPolicyunsigned charXmAPPLICATION_DEFINEDCG _____ XmNspacingXmCSpacingDimension4CSG _____ XmNtraverseObscuredCallbackXmCCallbackXtCallbackListNULLCSG _____ XmNverticalScrollBarXmCVerticalScrollBarWidgetdynamicCSG _____ XmNvisualPolicyXmCVisualPolicyunsigned chardynamicG _____ XmNworkWindowXmCWorkWindowWidgetNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmManager Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNinitialFocusXmCInitialFocusWidgetNULLCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension0CSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBComposite Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNchildrenXmCReadOnlyWidgetListNULLG _____ XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG _____ XmNnumChildrenXmCReadOnlyCardinal0G _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Translations" .PP MainWindow inherits translations from ScrolledWindow\&. .SH "RELATED" .PP \fBComposite\fP(3), \fBConstraint\fP(3), \fBCore\fP(3), \fBXmCreateMainWindow\fP(3), \fBXmMainWindowSep1\fP(3), \fBXmMainWindowSep2\fP(3), \fBXmMainWindowSep3\fP(3), \fBXmMainWindowSetAreas\fP(3), \fBXmManager\fP(3), \fBXmScrolledWindow\fP(3) \fBXmVaCreateMainWindow\fP(3), and \fBXmVaCreateManagedMainWindow\fP(3)\&. motif-2.3.8/doc/man/man3/VirtualBindings.30000644000175000017500000003421712672140200015132 00000000000000'\" t ...\" VirtBind.sgm /main/12 1996/09/08 21:43:15 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "VirtualBindings" "library call" .SH "NAME" \fBVirtualBindings\fP \(em Bindings for virtual mouse and key events .iX "VirtualBindings" .iX "default bindings" "VirtualBindings" .SH "DESCRIPTION" .PP The Motif reference pages describe key translations in terms of \fIvirtual bindings\fP, based on those described in the \fIMotif Style Guide\fP\&. .SS "Bindings for osf Keysyms" .PP Keysym strings that begin with \fB\fP are not part of the X server\&'s keyboard mapping\&. Instead, these keysyms are produced on the client side at run time\&. They are interpreted by the routine \fBXmTranslateKey\fP, and are used by the translation manager when the server delivers an actual key event\&. For each application, a mapping is maintained between \fB\fP keysyms and keysyms that correspond to actual keys\&. This mapping is based on information obtained at application startup from one of the following sources, listed in order of precedence: .IP " \(bu" 6 The \fBXmNdefaultVirtualBindings\fP resource from Display\&. .IP " \(bu" 6 A property on the root window, which can be set by \fBmwm\fP on startup, or by the \fBxmbind\fP client, or on prior startup of a Motif application\&. .IP " \(bu" 6 The file \fB\&.motifbind\fP in the user\&'s home directory\&. .IP " \(bu" 6 A set of bindings based on the vendor string and optionally the vendor release of the X server\&. Motif searches for these bindings in the following steps: .RS .IP " 0." 6 If the file \fBxmbind\&.alias\fP exists in the user\&'s home directory, Motif searches this file for a pathname associated with the vendor string or with the vendor string and vendor release\&. If it finds such a pathname and if that file exists, Motif loads the bindings contained in that file\&. .IP " 1." 6 If it has found no bindings, Motif next looks for the file \fBxmbind\&.alias\fP in the directory specified by the environment variable \fBXMBINDDIR\fP, if \fBXMBINDDIR\fP is set, or in the directory \fB/usr/lib/Xm/bindings\fP if \fBXMBINDDIR\fP is not set\&. If this file exists Motif searches it for a pathname associated with the vendor string or with the vendor string and vendor release\&. If it finds such a pathname and if that file exists, Motif loads the bindings contained in that file\&. .IP " 2." 6 If it still has found no bindings, Motif loads a set of hard-coded fallback bindings\&. .RE .PP The \fBxmbind\&.alias\fP file contains zero or more lines of the following form: .PP .nf \f(CW"\fIvendor_string\fP[ \fIvendor_release\fP]" \fIbindings_file\fP\fR .fi .PP .PP where \fIvendor_string\fP is the X server vendor name as returned by the X client \fBxdpyinfo\fP or the Xlib function \fBXServerVendor\fP, and must appear in double quotes\&. If \fIvendor_release\fP is included, it is the X server vendor release number as returned by the X client \fBxdpyinfo\fP or the Xlib function \fBXVendorRelease\fP, and must also be contained within the double quotes separated by one space from \fIvendor_string\fP\&. The \fIvendor_release\fP argument is provided to allow support of changes in keyboard hardware from a vendor, assuming that the vendor increments the release number to flag such changes\&. Alternatively, the vendor may simply use a unique vendor string for each different keyboard\&. .PP The \fIbindings_file\fP argument is the pathname of the file containing the bindings themselves\&. It can be a relative or absolute pathname\&. If it it is a relative pathname, it is relative to the location of the \fBxmbind\&.alias\fP file\&. .PP Comment lines in the \fBxmbind\&.alias\fP file begin with ! (exclamation point)\&. .PP The bindings found in either the \fB\&.motifbind\fP file or the vendor mapping are placed in a property on the root window\&. This property is used to determine the bindings for subsequent Motif applications\&. .PP On startup \fBmwm\fP attempts to load the file \fB\&.motifbind\fP in the user\&'s home directory\&. If this is unsuccessful, it loads the vendor bindings as described previously\&. It places the bindings it loads in a property on the root window for use by subsequent Motif applications\&. .PP The \fBxmbind\fP function loads bindings from a file if that file is specified on the command line\&. If no file is specified on the command line, it attempts to load the file \fB\&.motifbind\fP in the user\&'s home directory\&. If this fails, it loads the vendor bindings as described previously\&. It places the bindings it loads in a property on the root window for use by subsequent Motif applications\&. .PP The format of the specification for mapping \fB\fP keysyms to actual keysyms is similar to that of a specification for an event translation\&. (See below) The syntax is specified (and below) here in EBNF notation using the following conventions: .PP .nf \f(CW[\fIa\fP] Means either nothing or \fIa\fP {\fIa\fP} Means zero or more occurrences of \fIa\fP (\fIa\fP|\fIb\fP) Means either \fIa\fP or \fIb\fP\&.\fR .fi .PP .PP Terminals are enclosed in double quotation marks\&. .PP The syntax of an \fB\fP keysym binding specification is as follows: .PP .nf \f(CWbinding_spec = {line "\en"} [line] line = virtual_keysym ":" list_of_key_event list_of_key_event= key_event { "," key_event} key_event = {modifier_name} "" actual_keysym virtual_keysym = keysym actual_keysym = keysym keysym = A valid X11 keysym name that is mapped by \fBXStringToKeysym\fP\fR .fi .PP .PP As with event translations, more specific event descriptions must precede less specific descriptions\&. For example, an event description for a key with a modifier must precede a description for the same key without the same modifier\&. .PP Following is an example of a specification for the \fBdefaultVirtualBindings\fP resource in a resource file: .PP .nf \f(CW*defaultVirtualBindings: \e osfBackSpace: BackSpace \en\e osfInsert: InsertChar \en\e osfDelete: DeleteChar \en\e \&.\&.\&. osfLeft: left, CtrlH\fR .fi .PP .PP The format of a \fB\&.motifbind\fP file or of a file containing vendor bindings is the same, except that the binding specification for each keysym is placed on a separate line\&. The previous example specification appears as follows in a \fB\&.motifbind\fP or vendor bindings file: .PP .nf \f(CWosfBackSpace: BackSpace osfInsert: InsertChar osfDelete: DeleteChar \&.\&.\&. osfLeft: left, CtrlH\fR .fi .PP .PP The following table lists the fixed fallback default bindings for \fB\fP keysyms\&. .TS tab() box; c s l| l. T{ \fBFallback Default Bindings for osf Keysyms\fP T} \fB\fP\fBFallback Default Binding\fP __ \fB\fP\fB:\fP\fBKP_Enter\fP, \fBExecute\fP __ \fB\fP\fB:\fP\fBShiftF8\fP __ \fB\fP\fB:\fP\fB\fP\fBBackSpace\fP __ \fB\fP\fB:\fP\fBHome\fP, \fBBegin\fP __ \fB\fP\fB:\fP\fBEscape\fP, \fBCancel\fP __ \fB\fP\fB:\fP\fB\fP\fBClear\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fB\fP\fBDelete\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fB\fP\fBDown\fP __ \fB\fP\fB:\fP\fB\fP\fBEnd\fP __ \fB\fP\fB:\fP\fBF1\fP, \fBHelp\fP __ \fB\fP\fB:\fP\fB\fP\fBInsert\fP __ \fB\fP\fB:\fP\fB\fP\fBLeft\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fBShift\fP\fBF10\fP, \fBMenu\fP __ \fB\fP\fB:\fP\fBF10\fP, \fBShift\fP\fBMenu\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fB\fP\fBNext\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fB\fP\fBPrior\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fB\fP\fBRight\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fB\fP\fBSelect\fP __ \fB\fP\fB:\fP\fIunbound\fP __ \fB\fP\fB:\fP\fBAltReturn\fP, \fBAltKP_Enter\fP __ \fB\fP\fB:\fP\fB\fP\fBUndo\fP __ \fB\fP\fB:\fP\fB\fP\fBUp\fP __ .TE .SS "Changes in the Handling of Shifted Keys" .PP In conjunction with MIT X11R5 Patch 24, this version of Motif introduces a change in the way that keys involving the modifier are processed\&. This change allows the numeric keypad to be used to generate numbers using the standard X mechanisms\&. Since the default behavior is now to honor the xmodmap keymap bindings, translations and virtual key bindings that use may behave differently\&. A common symptom is that unshifted keypad and function keys (with or without other modifiers) produce the expected results, but shifted ones do not\&. .PP To obtain the old behavior you can remove the shifted interpretation from problematic keys using the \fBxmodmap\fP utility\&. Each entry in a \fBxmodmap\fP keymap table contains up to four keysym bindings\&. The second and fourth keysyms are for shifted keys\&. If an expression contains only two keysyms, simply remove the second keysym\&. If an entry contains three or more keysyms, replace the second keysym with \fBNoSymbol\fP and remove the fourth keysym\&. .SS "Action Translations" .PP The translation table syntax used by Motif is completely specified in the X11R5 Toolkit Intrinsics Documentation\&. For the complete syntax description, and for general instructions about writing or modifying a translation table, please refer to this document\&. A brief summary of the translation table format, however, is included below\&. .PP The syntax is defined as in the binding syntax specification above\&. Informal descriptions are contained in angle brackets (<>)\&. .PP .nf \f(CWTranslationTable= [ directive ] { production } directive = ( "#replace" | "#override" | "#augment") "\en" production = lhs ":" rhs "\en" lhs = ( event | keyseq) {"," ( event | keyseq) } keyseq = """ keychar { keychar } """ keychar = ( "^" | "$" | "\e\e") event = [ modifier_list ] "<" event_type ">" [ count ] {detail} modifier_list = ( ["!"][":"] { modifier } | "None") modifier = [ "~" ] ( "@" | ) count = "(" [ "+" ] ")" rhs = { action_name "(" [params] ")" } params = string { "," string }\fR .fi .PP The \fIstring\fP field need not be quoted unless it includes a space or tab character, or any comma, newline, or parenthesis\&. The entire list of string values making up the \fIparams\fP field will ba passed to the named action routine\&. .PP The \fIdetails\fP field may be used to specify a keysym that will identify a particular key event\&. For example, \fB\fP is the name of a type of event, but it must be modified by the \fIdetails\fP field to name a specific event, such as \fB\fP\fBA\fP\&. .PP \fBModifier Names\fP The modifier list, which may be empty, consists of a list of modifier keys that must be pressed with the key sequence\&. The modifier keys may abbreviated with single letters, as in the following list of the familiar modifiers: .IP "s" 10 Shift .IP "c\ or\ ^" 10 Ctrl (Control) .IP "m\ or\ $" 10 Meta .IP "a" 10 Alt .PP Other modifiers are available, such as "Mod5" and "Button2\&." These have no abbreviation (although the "Button" modifiers may be abbreviated in combination with events, as outlined below)\&. If a modifier list has no entries, and is not "None", it means the position of the modifier keys is irrelevant\&. If modifiers are listed, the designated keys must be in the specified position, but the unlisted modifier keys are irrelevant\&. If the list begins with an exclamation point (!), however, the unlisted modifiers may not be asserted\&. In addition, if a modifier name is preceded by a tilde (~), the corresponding key must \fInot\fP be pressed\&. .PP If a modifier list begins with a colon (:), X tries to use the standard modifiers (Shift and Lock), if present, to map the key event code into a recognized keysym\&. .PP Event Types These are a few of the recognized event types\&. .IP "Key or KeyDown" 10 A keyboard key was pressed\&. .IP "KeyUp" 10 A keyboard key was released\&. .IP "BtnDown" 10 A mouse button was pressed\&. .IP "BtnUp" 10 A mouse button was released\&. .IP "Motion" 10 The mouse pointer moved\&. .IP "Enter" 10 The pointer entered the widget\&'s window\&. .IP "Leave" 10 The pointer left the widget\&'s window\&. .IP "FocusIn" 10 The widget has received focus\&. .IP "FocusOut" 10 The widget has lost focus\&. .PP There are some event abbreviations available\&. For example, \fB\fP is actually a "Motion" event, modified with the "Button1" modifier (\fBButton1\fP)\&. Similarly, \fB\fP is actually a "BtnUp" event with the "Button3" modifier\&. These abbreviations are used extensively in the Motif translation tables\&. .SH "RELATED" .PP \fBxmbind\fP(1) ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16 motif-2.3.8/doc/man/man3/XmStringDrawUnderline.30000644000175000017500000000727412672140200016270 00000000000000'\" t ...\" StrDrC.sgm /main/8 1996/09/08 21:04:34 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmStringDrawUnderline" "library call" .SH "NAME" \fBXmStringDrawUnderline\fP \(em A compound string function that underlines a string drawn in an X Window .iX "XmStringDrawUnderline" .iX "compound string functions" "XmStringDrawUnderline" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmStringDrawUnderline\fP\fR( \fBDisplay \fB* d\fR\fR, \fBWindow \fBw\fR\fR, \fBXmRenderTable \fBrendertable\fR\fR, \fBXmString \fBstring\fR\fR, \fBGC \fBgc\fR\fR, \fBPosition \fBx\fR\fR, \fBPosition \fBy\fR\fR, \fBDimension \fBwidth\fR\fR, \fBunsigned char \fBalignment\fR\fR, \fBunsigned char \fBlayout_direction\fR\fR, \fBXRectangle \fB* clip\fR\fR, \fBXmString \fBunderline\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmStringDrawUnderline\fP draws a compound string in an X Window\&. If the substring identified by \fIunderline\fP can be matched in \fIstring\fP, the substring will be underlined\&. Once a match has occurred, no further matches or underlining will be done\&. Only the first text component of \fIunderline\fP is used for matching\&. .PP If a compound string segment uses a rendition that contains a font set, the graphic context passed to this routine will have the GC font member left in an undefined state\&. The underlying \fBXmbStringDraw\fP function called by this routine modifies the font ID field of the GC passed into it and does not attempt to restore the font ID to the incoming value\&. If the compound string segment is not drawn using a font set, the graphic context must contain a valid font member\&. Graphic contexts created by \fBXtGetGC\fP are not accepted by this routine; instead, use \fBXtAllocateGC\fP to create a graphic context\&. .IP "\fId\fP" 10 Specifies the display\&. .IP "\fIw\fP" 10 Specifies the window\&. .IP "\fIrendertable\fP" 10 Specifies the render table\&. .IP "\fIstring\fP" 10 Specifies the string\&. .IP "\fIgc\fP" 10 Specifies the graphics context to use\&. .IP "\fIx\fP" 10 Specifies a coordinate of the rectangle that will contain the displayed compound string\&. .IP "\fIy\fP" 10 Specifies a coordinate of the rectangle that will contain the displayed compound string\&. .IP "\fIwidth\fP" 10 Specifies the width of the rectangle that will contain the displayed compound string\&. .IP "\fIalignment\fP" 10 Specifies how the string will be aligned within the specified rectangle\&. It is one of \fBXmALIGNMENT_BEGINNING\fP, \fBXmALIGNMENT_CENTER\fP, or \fBXmALIGNMENT_END\fP\&. .IP "\fIlayout_direction\fP" 10 Controls the direction in which the segments of the compound string will be laid out\&. It also determines the meaning of the \fIalignment\fP parameter\&. .IP "\fIclip\fP" 10 Allows the application to restrict the area into which the compound string will be drawn\&. If it is NULL, clipping will be determined by the GC\&. .IP "\fIunderline\fP" 10 Specifies the substring to be underlined\&. .SH "RELATED" .PP \fBXmStringCreate\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:31 motif-2.3.8/doc/man/man3/XmDragCancel.30000644000175000017500000000322112672140200014305 00000000000000'\" t ...\" DragCanc.sgm /main/8 1996/09/08 20:39:35 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDragCancel" "library call" .SH "NAME" \fBXmDragCancel\fP \(em A Drag and Drop function that terminates a drag transaction .iX "XmDragCancel" .iX "Drag and Drop functions" "XmDragCancel" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmDragCancel\fP\fR( \fBWidget \fBdragcontext\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDragCancel\fP terminates a drag operation and cancels any pending actions of the specified DragContext\&. This routine can only be called by the initiator client\&. .IP "\fIdragcontext\fP" 10 Specifies the ID of the DragContext widget associated with the drag and drop transaction to be terminated .PP For a complete definition of DragContext and its associated resources, see \fBXmDragContext\fP(3)\&. .SH "RELATED" .PP \fBXmDragContext\fP(3) and \fBXmDragStart\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:22 motif-2.3.8/doc/man/man3/XmListGetKbdItemPos.30000644000175000017500000000337612672140200015632 00000000000000'\" t ...\" LstGetKb.sgm /main/9 1996/09/08 20:50:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmListGetKbdItemPos" "library call" .SH "NAME" \fBXmListGetKbdItemPos\fP \(em A List function that returns the position of the item at the location cursor .iX "XmListGetKbdItemPos" .iX "List functions" "XmListGetKbdItemPos" .SH "SYNOPSIS" .PP .nf #include \fBint \fBXmListGetKbdItemPos\fP\fR( \fBWidget \fBwidget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmListGetKbdItemPos\fP returns the position of the list item at the location cursor\&. .IP "\fIwidget\fP" 10 Specifies the ID of the List widget .PP For a complete definition of List and its associated resources, see \fBXmList\fP(3)\&. .SH "RETURN" .PP Returns the position of the current keyboard item\&. A value of 1 indicates that the location cursor is at the first item of the list; a value of 2 indicates that it is at the second item; and so on\&. A value of 0 (zero) indicates the List widget is empty\&. .SH "RELATED" .PP \fBXmList\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:26 motif-2.3.8/doc/man/man3/XmGadget.30000644000175000017500000003047212672140200013525 00000000000000'\" t ...\" Gadget.sgm /main/13 1996/09/08 20:45:20 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGadget" "library call" .SH "NAME" \fBXmGadget\fP \(em The Gadget widget class .iX "XmGadget" .iX "widget class" "Gadget" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP Gadget is a widget class used as a supporting superclass for other gadget classes\&. It handles shadow-border drawing and highlighting, traversal activation and deactivation, and various callback lists needed by gadgets\&. .PP The color and pixmap resources defined by \fBXmManager\fP are directly used by gadgets\&. If \fBXtSetValues\fP is used to change one of the resources for a manager widget, all of the gadget children within the manager also change\&. .SS "Classes" .PP Gadget inherits behavior and resources from \fBObject\fP and \fBRectObj\fP\&. .PP The class pointer is \fBxmGadgetClass\fP\&. .PP The class name is \fBXmGadget\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \&.Xdefaults file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \&.Xdefaults file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmGadget Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapdynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmNCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ XmNtoolTipStringXmCToolTipStringXmStringNULLCSG _____ .TE .IP "\fBXmNbackground\fP" 10 Specifies the background color for the gadget\&. .IP "\fBXmNbackgroundPixmap\fP" 10 Specifies a pixmap for tiling the background\&. The first tile is placed at the upper left corner of the widget\&'s window\&. .IP "\fBXmNbottomShadowColor\fP" 10 Contains the color to use to draw the bottom and right sides of the border shadow\&. .IP "\fBXmNbottomShadowPixmap\fP" 10 Specifies the pixmap to use to draw the bottom and right sides of the border shadow\&. .IP "\fBXmNforeground\fP" 10 Specifies the foreground drawing color used by Primitive widgets\&. .IP "\fBXmNhelpCallback\fP" 10 Specifies the list of callbacks that is called when the help key sequence is pressed\&. The reason sent by the callback is \fBXmCR_HELP\fP\&. .IP "\fBXmNhighlightColor\fP" 10 Contains the color of the highlighting rectangle\&. .IP "\fBXmNhighlightOnEnter\fP" 10 Specifies if the highlighting rectangle is drawn when the cursor moves into the widget\&. If the shell\&'s focus policy is \fBXmEXPLICIT\fP, this resource is ignored, and the widget is highlighted when it has the focus\&. If the shell\&'s focus policy is \fBXmPOINTER\fP and if this resource is True, the highlighting rectangle is drawn when the the cursor moves into the widget\&. If the shell\&'s focus policy is \fBXmPOINTER\fP and if this resource is False, the highlighting rectangle is not drawn when the the cursor moves into the widget\&. The default is False\&. .IP "\fBXmNhighlightPixmap\fP" 10 Specifies the pixmap used to draw the highlighting rectangle\&. .IP "\fBXmNhighlightThickness\fP" 10 Specifies the thickness of the highlighting rectangle\&. .IP "\fBXmNlayoutDirection\fP" 10 Specifies the direction in which components of the manager (including strings) are laid out\&. The values are of type \fBXmDirection\fR\&. If the widget\&'s parent is a manager or shell, the value is inherited from the widget\&'s parent\&. Otherwise, it is inherited from the closest ancestor vendor or menu shell\&. .IP "\fBXmNnavigationType\fP" 10 Determines whether the widget is a tab group\&. .RS .IP "\fBXmNONE\fP" 10 Indicates that the widget is not a tab group\&. .IP "\fBXmTAB_GROUP\fP" 10 Indicates that the widget is a tab group, unless the \fBXmNnavigationType\fP of another widget in the hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP\&. .IP "\fBXmSTICKY_TAB_GROUP\fP" 10 Indicates that the widget is a tab group, even if the \fBXmNnavigationType\fP of another widget in the hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP\&. .IP "\fBXmEXCLUSIVE_TAB_GROUP\fP" 10 Indicates that the widget is a tab group and that widgets in the hierarchy whose \fBXmNnavigationType\fP is \fBXmTAB_GROUP\fP are not tab groups\&. .IP "" 10 When a parent widget has an \fBXmNnavigationType\fP of \fBXmEXCLUSIVE_TAB_GROUP\fP, traversal of non-tab-group widgets within the group is based on the order of those widgets in their parent\&'s \fBXmNchildren\fP list\&. .IP "" 10 When the \fBXmNnavigationType\fP of any widget in a hierarchy is \fBXmEXCLUSIVE_TAB_GROUP\fP, traversal of tab groups in the hierarchy proceeds to widgets in the order in which their \fBXmNnavigationType\fP resources were specified as \fBXmEXCLUSIVE_TAB_GROUP\fP or \fBXmSTICKY_TAB_GROUP\fP, whether by creating the widgets with that value, by calling \fBXtSetValues\fP, or by calling \fBXmAddTabGroup\fP\&. .RE .IP "\fBXmNshadowThickness\fP" 10 Specifies the size of the drawn border shadow\&. .IP "\fBXmNtopShadowColor\fP" 10 Contains the color to use to draw the top and left sides of the border shadow\&. .IP "\fBXmNtopShadowPixmap\fP" 10 Specifies the pixmap to use to draw the top and left sides of the border shadow\&. .IP "\fBXmNtraversalOn\fP" 10 Specifies traversal activation for this gadget\&. .IP "\fBXmNunitType\fP" 10 Provides the basic support for resolution independence\&. It defines the type of units a widget uses with sizing and positioning resources\&. If the widget\&'s parent is a subclass of \fBXmManager\fP and if the \fBXmNunitType\fP resource is not explicitly set, it defaults to the unit type of the parent widget\&. If the widget\&'s parent is not a subclass of \fBXmManager\fP, the resource has a default unit type of \fBXmPIXELS\fP\&. .IP "" 10 The unit type can also be specified in resource files, with the following format: .PP .nf \f(CW\fI\fP\fR .fi .PP .IP "" 10 where: .RS .IP "\fIunit\fP" 10 is <" ", pixels, inches, centimeters, millimeters, points, font units> .IP "\fIpixels\fP" 10 is <\fIpix\fP, \fIpixel\fP, \fIpixels\fP> .IP "\fIinches\fP" 10 is <\fIin\fP, \fIinch\fP, \fIinches\fP> .IP "\fIcentimeter\fP" 10 is <\fIcm\fP, \fIcentimeter\fP, \fIcentimeters\fP> .IP "\fImillimeters\fP" 10 is <\fImm\fP, \fImillimeter\fP, \fImillimeters\fP> .IP "\fBpoints\fP" 10 is <\fIpt\fP, \fIpoint\fP, \fIpoints\fP> .IP "\fBfont units\fP" 10 is <\fIfu\fP, \fBfont_unit\fP, \fBfont_units\fP> .IP "\fIfloat\fP" 10 is {"+"|"-"}{{<"0"-"9">*}\&.}<"0"-"9">* .IP "" 10 Note that the type Dimension must always be positive\&. .RE .IP "" 10 For example, .PP .nf \f(CWxmfonts*XmMainWindow\&.height: 10\&.4cm *PostIn\&.width: 3inches\fR .fi .PP .IP "" 10 \fBXmNunitType\fP can have the following values: .RS .IP "\fBXmPIXELS\fP" 10 All values provided to the widget are treated as normal pixel values\&. .IP "\fBXmMILLIMETERS\fP" 10 All values provided to the widget are treated as normal millimeter values\&. .IP "\fBXm100TH_MILLIMETERS\fP" 10 All values provided to the widget are treated as 1/100 of a millimeter\&. .IP "\fBXmCENTIMETERS\fP" 10 All values provided to the widget are treated as normal centimeter values\&. .IP "\fBXmINCHES\fP" 10 All values provided to the widget are treated as normal inch values\&. .IP "\fBXm1000TH_INCHES\fP" 10 All values provided to the widget are treated as 1/1000 of an inch\&. .IP "\fBXmPOINTS\fP" 10 All values provided to the widget are treated as normal point values\&. A point is a unit used in text processing applications and is defined as 1/72 of an inch\&. .IP "\fBXm100TH_POINTS\fP" 10 All values provided to the widget are treated as 1/100 of a point\&. A point is a unit used in text processing applications and is defined as 1/72 inch\&. .IP "\fBXmFONT_UNITS\fP" 10 All values provided to the widget are treated as normal font units\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .IP "\fBXm100TH_FONT_UNITS\fP" 10 All values provided to the widget are treated as 1/100 of a font unit\&. A font unit has horizontal and vertical components\&. These are the values of the XmScreen resources \fBXmNhorizontalFontUnit\fP and \fBXmNverticalFontUnit\fP\&. .RE .IP "\fBXmNuserData\fP" 10 Allows the application to attach any necessary specific data to the gadget\&. This is an internally unused resource\&. .IP "\fBXmNtoolTipString\fP" 10 The XmString to display as the toolTip. If this resource is NULL, no tip will be displayed. ToolTips are described in VendorShell(3) .SS "Inherited Resources" .PP Gadget inherits resources from the superclass described in the following table\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBRectObj Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNborderWidthXmCBorderWidthDimension0N/A _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBObject Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; } XmAnyCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. For this callback, \fIreason\fP is set to \fBXmCR_HELP\fP\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .SS "Behavior" .PP Gadgets cannot have translations associated with them\&. Because of this, a Gadget\&'s behavior is determined by the Manager widget into which the Gadget is placed\&. If focus is on a Gadget, events are passed to the Gadget by its Manager\&. .SH "RELATED" .PP \fBObject\fP(3), \fBRectObj\fP(3), \fBXmManager\fP(3), and \fBXmScreen\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmVaCreateManagedButtonBox.30000644000175000017500000000003712672140200017140 00000000000000.so man3/XmVaCreateButtonBox.3 motif-2.3.8/doc/man/man3/XmRemoveFromPostFromList.30000644000175000017500000000465512672140200016745 00000000000000'\" t ...\" RemFro.sgm /main/9 1996/09/08 20:56:37 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmRemoveFromPostFromList" "library call" .SH "NAME" \fBXmRemoveFromPostFromList\fP \(em a RowColumn function that disables a menu for a particular widget .iX "XmRemoveFromPostFromList" .iX "RowColumn functions" "XmRemoveFromPostFromList" .SH "SYNOPSIS" .PP .nf #include .sp \n(PDu \fBvoid \fBXmRemoveFromPostFromList\fP\fR( \fBWidget \fBmenu\fR\fR, \fBWidget \fBpost_from_widget\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmRemoveFromPostFromList\fP makes a Popup or Pulldown menu no longer accessible from a widget\&. This function does not destroy a menu, or deallocate the memory associated with it\&. It simply removes the widget from the menu\&'s list of widgets permitted to post that menu\&. .PP If the \fImenu\fP argument refers to a Popup menu, the event handlers are removed from the \fIpost_from_widget\fP widget\&. If the argument refers to a Pulldown menu, its ID is removed from the \fBXmNsubMenuId\fP of the specified \fIpost_from_widget\fP\&. Also, if the menu is a Pulldown menu, the \fIpost_from_widget\fP widget must be either a CascadeButton or a CascadeButtonGadget\&. .IP "\fImenu\fP" 10 Specifies the widget ID of a the Popup or Pulldown menu to be made inaccessible from the \fIpost_from_widget\fP widget\&. .IP "\fIpost_from_widget\fP" 10 Specifies the widget ID of the widget which can no longer post the menu referred to by the \fImenu\fP argument\&.\&. .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RELATED" .PP \fBXmAddToPostFromList\fP(3), \fBXmGetPostedFromWidget\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:28 motif-2.3.8/doc/man/man3/XmDropDownGetChild.30000644000175000017500000000374312672140200015473 00000000000000'\" t ...\" MsgBB.sgm /main/8 1996/09/08 20:54:29 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDropDownGetChild" "library call" .SH "NAME" \fBXmDropDownGetChild\fP \(em A DropDown function that is used to access a component .iX "XmDropDownGetChild" .iX "DropDown functions" "XmDropDownGetChild" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmDropDownGetChild\fP\fR( \fBWidget \fBwidget\fR\fR, \fBint \fBchild\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmDropDownGetChild\fP is used to access a component within a DropDown\&. The parameters given to the function are the DropDown widget and a value indicating which component to access\&. .IP "\fIwidget\fP" 10 Specifies the DropDown widget ID\&. .IP "\fIchild\fP" 10 Specifies a component within the DropDown\&. The following are legal values for this parameter: .RS .IP " \(bu" 6 \fBXmDROPDOWN_LABEL\fP .IP " \(bu" 6 \fBXmDROPDOWN_TEXT\fP .IP " \(bu" 6 \fBXmDROPDOWN_ARROW_BUTTON\fP .IP " \(bu" 6 \fBXmDROPDOWN_LIST\fP .RE .PP For a complete definition of DropDown and its associated resources, see \fBXmDropDown\fP(3)\&. .SH "RETURN" .PP Returns the widget ID of the specified DropDown component\&. An application should not assume that the returned widget will be of any particular class\&. .SH "RELATED" .PP \fBXmDropDown\fP(3)\&. motif-2.3.8/doc/man/man3/XmGetDragContext.30000644000175000017500000000440512672140200015211 00000000000000'\" t ...\" GetDragC.sgm /main/8 1996/09/08 20:45:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetDragContext" "library call" .SH "NAME" \fBXmGetDragContext\fP \(em A Drag and Drop function that retrieves the DragContext widget ID associated with a timestamp .iX "XmGetDragContext" .iX "Drag and Drop functions" "XmGetDragContext" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmGetDragContext\fP\fR( \fBWidget \fBrefwidget\fR\fR, \fBTime \fBtimestamp\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmGetDragContext\fP returns the widget ID of the active DragContext associated with a given display and timestamp\&. A timestamp uniquely identifies which DragContext is active when more than one drag and drop transaction has been initiated on a display\&. If the specified timestamp matches a timestamp processed between the start and finish of a single drag and drop transaction, the function returns the corresponding DragContext ID\&. .IP "\fIrefwidget\fP" 10 Specifies the ID of the widget that the routine uses to identify the intended display\&. The function returns the ID of the DragContext associated with the display value passed by this widget\&. .IP "\fItimestamp\fP" 10 Specifies a timestamp\&. .PP For a complete definition of DragContext and its associated resources, see \fBXmDragContext\fP(3)\&. .SH "RETURN" .PP Returns the ID of the DragContext widget that is active for the specified timestamp\&. Otherwise, returns NULL if no active DragContext is found\&. .SH "RELATED" .PP \fBXmDragContext\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24 motif-2.3.8/doc/man/man3/XmScrollBar.30000644000175000017500000006720212672140200014216 00000000000000'\" t ...\" ScrollBA.sgm /main/13 1996/09/30 13:23:57 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmScrollBar" "library call" .SH "NAME" \fBXmScrollBar\fP \(em The ScrollBar widget class .iX "XmScrollBar" .iX "widget class" "ScrollBar" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP The ScrollBar widget allows the user to view data that is too large to be displayed all at once\&. ScrollBars are usually located inside a ScrolledWindow and adjacent to the widget that contains the data to be viewed\&. When the user interacts with the ScrollBar, the data within the other widget scrolls\&. .PP A ScrollBar consists of two arrows placed at each end of a rectangle\&. The rectangle is called the scroll region\&. A smaller rectangle, called the slider, is placed within the scroll region\&. The data is scrolled by clicking either arrow, selecting on the scroll region, or dragging the slider\&. When an arrow is selected, the slider within the scroll region is moved in the direction of the arrow by an amount supplied by the application\&. If the mouse button is held down, the slider continues to move at a constant rate\&. .PP The ratio of the slider size to the scroll region size typically corresponds to the relationship between the size of the visible data and the total size of the data\&. For example, if 10 percent of the data is visible, the slider typically occupies 10 percent of the scroll region\&. This provides the user with a visual clue to the size of the invisible data\&. .PP If the ScrollBar parent is an automatic ScrolledWindow, the \fBXmNtraversalOn\fP default is True\&. Otherwise, the default is False\&. .PP ScrollBar holds the \fBXmQTnavigator\fP traits\&. .SS "Classes" .PP ScrollBar inherits behavior, resources, and traits from the \fBCore\fP and \fBXmPrimitive\fP classes\&. .PP The class pointer is \fBxmScrollBarWidgetClass\fP\&. .PP The class name is \fBXmScrollBar\fP\&. .SS "New Resources" .PP The following table defines a set of widget resources used by the programmer to specify data\&. The programmer can also set the resource values for the inherited classes to set attributes for this widget\&. To reference a resource by name or by class in a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words)\&. The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmScrollBar Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNdecrementCallbackXmCCallbackXtCallbackListNULLC _____ XmNdragCallbackXmCCallbackXtCallbackListNULLC _____ XmNeditableXmCEditableBooleanTrueCSG _____ XmNincrementXmCIncrementint1CSG _____ XmNincrementCallbackXmCCallbackXtCallbackListNULLC _____ XmNinitialDelayXmCInitialDelayint250 msCSG _____ XmNmaximumXmCMaximumint100CSG _____ XmNminimumXmCMinimumint0CSG _____ XmNorientationXmCOrientationunsigned charXmVERTICALCSG _____ XmNpageDecrementCallbackXmCCallbackXtCallbackListNULLC _____ XmNpageIncrementXmCPageIncrementint10CSG _____ XmNpageIncrementCallbackXmCCallbackXtCallbackListNULLC _____ XmNprocessingDirectionXmCProcessingDirectionunsigned chardynamicCSG _____ XmNrepeatDelayXmCRepeatDelayint50 msCSG _____ XmNshowArrowsXmCShowArrowsXtEnumXmEACH_SIDECSG _____ XmNsliderSizeXmCSliderSizeintdynamicCSG _____ XmNsliderMarkXmCSliderMarkXtEnumdynamicCSG _____ XmNsliderVisualXmCSliderVisualXtEnumXmSHADOWEDCSG _____ XmNslidingModeXmCSlidingModeXtEnumXmSLIDERCSG _____ XmNsnapBackMultipleXmCSnapBackMultipleunsigned shortMaxValueCSG _____ XmNtoBottomCallbackXmCCallbackXtCallbackListNULLC _____ XmNtoTopCallbackXmCCallbackXtCallbackListNULLC _____ XmNtroughColorXmCTroughColorPixeldynamicCSG _____ XmNvalueXmCValueintdynamicCSG _____ XmNvalueChangedCallbackXmCCallbackXtCallbackListNULLC _____ .TE .IP "\fBXmNdecrementCallback\fP" 10 Specifies the list of callbacks that is called when the user takes an action that moves the ScrollBar by one increment and the value decreases\&. The reason passed to the callback is \fBXmCR_DECREMENT\fP\&. .IP "\fBXmNdragCallback\fP" 10 Specifies the list of callbacks that is called on each incremental change of position when the slider is being dragged\&. The reason sent by the callback is \fBXmCR_DRAG\fP\&. .IP "\fBXmNeditable\fP" 10 Specifies how ScrollBar will react to user input\&. This resource can be True or False values, as follows: .RS .IP "\fBTrue\fP" 10 Allows the scrollbar to be sensitive to user input\&. This is the default value\&. .IP "\fBFalse\fP" 10 Makes the Scale scrollbar insensitive to user input\&. The visual is not greyed out\&. This value would mostly be used in \fBXmTHERMOMETER\fP mode\&. .RE .IP "" 10 When \fBXmNeditable\fP is used on a widget it sets the dropsite to \fBXmDROP_SITE_ACTIVE\fP\&. .IP "\fBXmNincrement\fP" 10 Specifies the amount by which the value increases or decreases when the user takes an action that moves the slider by one increment\&. The actual change in value is the lesser of \fBXmNincrement\fP and (previous \fBXmNvalue\fP\ - \fBXmNminimum\fP) when the slider moves to the end of the ScrollBar with the minimum value, and the lesser of \fBXmNincrement\fP and (\fBXmNmaximum\fP- \fBXmNsliderSize\fP\ - previous \fBXmNvalue\fP) when the slider moves to the end of the ScrollBar with the maximum value\&. The value of this resource must be greater than 0 (zero)\&. .IP "\fBXmNincrementCallback\fP" 10 Specifies the list of callbacks that is called when the user takes an action that moves the ScrollBar by one increment and the value increases\&. The reason passed to the callback is \fBXmCR_INCREMENT\fP\&. .IP "\fBXmNinitialDelay\fP" 10 Specifies the amount of time in milliseconds to wait before starting continuous slider movement while a button is pressed in an arrow or the scroll region\&. The value of this resource must be greater than 0 (zero)\&. .IP "\fBXmNmaximum\fP" 10 Specifies the slider\&'s maximum value\&. \fBXmNmaximum\fP must be greater than \fBXmNminimum\fP\&. .IP "\fBXmNminimum\fP" 10 Specifies the slider\&'s minimum value\&. \fBXmNmaximum\fP must be greater than \fBXmNminimum\fP\&. .IP "\fBXmNorientation\fP" 10 Specifies whether the ScrollBar is displayed vertically or horizontally\&. This resource can have values of \fBXmVERTICAL\fP and \fBXmHORIZONTAL\fP\&. .IP "\fBXmNpageDecrementCallback\fP" 10 Specifies the list of callbacks that is called when the user takes an action that moves the ScrollBar by one page increment and the value decreases\&. The reason passed to the callback is \fBXmCR_PAGE_DECREMENT\fP\&. .IP "\fBXmNpageIncrement\fP" 10 Specifies the amount by which the value increases or decreases when the user takes an action that moves the slider by one page increment\&. The actual change in value is the lesser of \fBXmNpageIncrement\fP and (previous \fBXmNvalue\fP\ - \fBXmNminimum\fP) when the slider moves to the end of the ScrollBar with the minimum value, and the lesser of \fBXmNpageIncrement\fP and (\fBXmNmaximum\fP- \fBXmNsliderSize\fP\ - previous \fBXmNvalue\fP) when the slider moves to the end of the ScrollBar with the maximum value\&. The value of this resource must be greater than 0 (zero)\&. .IP "\fBXmNpageIncrementCallback\fP" 10 Specifies the list of callbacks that is called when the user takes an action that moves the ScrollBar by one page increment and the value increases\&. The reason passed to the callback is \fBXmCR_PAGE_INCREMENT\fP\&. .IP "\fBXmNprocessingDirection\fP" 10 Specifies whether the value for \fBXmNmaximum\fP should be on the right or left side of \fBXmNminimum\fP for horizontal ScrollBars or above or below \fBXmNminimum\fP for vertical ScrollBars\&. This resource can have values of \fBXmMAX_ON_TOP, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT\fP, and \fBXmMAX_ON_RIGHT\fP\&. If the ScrollBar is oriented vertically, the default value is \fBXmMAX_ON_BOTTOM\fP\&. If the ScrollBar is oriented horizontally, the default value depends on the \fBXmNlayoutDirection\fP resource of the widget\&. .IP "\fBXmNrepeatDelay\fP" 10 Specifies the amount of time in milliseconds to wait between subsequent slider movements after the \fBXmNinitialDelay\fP has been processed\&. The value of this resource must be greater than 0 (zero)\&. .IP "\fBXmNshowArrows\fP" 10 Specifies whether the arrows are displayed and how they are to be displayed\&. This resource can take the following values: .RS .IP "\fBXmEACH_SIDE\fP" 10 Indicates that one arrow is displayed on each end of the ScrollBar slider\&. This corresponds to a value of True in previous releases\&. .IP "\fBXmMAX_SIDE\fP" 10 Indicates that both arrows are displayed on the \fBXmNmaximum\fP side of the ScrollBar slider\&. .IP "\fBXmMIN_SIDE\fP" 10 Indicates that both arrows are displayed on the \fBXmNminimum\fP side of the ScrollBar slider\&. .IP "\fBXmNONE\fP" 10 Indicates that no arrows are displayed\&. This corresponds to a value of False in previous releases\&. .RE .IP "" 10 \fBXmEACH_SIDE\fP is the default value\&. .IP "\fBXmNsliderMark\fP" 10 Specifies the shape the slider is to be displayed in\&. This resource can take the following values: .RS .IP "\fBXmETCHED_LINE\fP" 10 Specifies the slider as an etched line\&. .IP "\fBXmNONE\fP" 10 Specifies the slider as a foregrounded rectangle\&. This is the default for a regular slider\&. .IP "\fBXmROUND_MARK\fP" 10 Specifies the slider as a shadowed circle\&. This is the default when the slider is a thermometer\&. .IP "\fBXmTHUMB_MARK\fP" 10 Specifies the slider as a series of three etched lines centered in the middle of the slider\&. .RE .IP "\fBXmNslidingMode\fP" 10 Specifies the mode the slider works in\&. There are two possible modes: .RS .IP "\fBXmSLIDER\fP" 10 Allows the slider to move freely between the minimum and maximum ends of the scale\&. This is the default value\&. .IP "\fBXmTHERMOMETER\fP" 10 Forces the slider to be anchored to one side of the trough area\&. .RE .IP "\fBXmNsliderSize\fP" 10 Specifies the length of the slider between the values of 1 and (\fBXmNmaximum\fP\ - \fBXmNminimum\fP)\&. The value is constrained to be within these inclusive bounds\&. The default value is (\fBXmNmaximum\fP\ - \fBXmNminimum\fP) divided by 10, with a minimum of 1\&. .IP "\fBXmNsliderVisual\fP" 10 Specifies the color of the slider visual\&. This resource can take the following values: .RS .IP "\fBXmBACKGROUND_COLOR\fP" 10 Specifies that the slider visual is in the background color\&. .IP "\fBXmFOREGROUND_COLOR\fP" 10 Specifies that the slider visual is in the foreground color\&. .IP "\fBXmSHADOWED_BACKGROUND\fP" 10 Specifies that the slider visual is in the background color, with a shadow\&. This is the default for a regular slider\&. .IP "\fBXmTROUGH_COLOR\fP" 10 Specifies that the slider visual is in the trough color\&. This is the default when the slider is a thermometer\&. .RE .IP "\fBXmNsnapBackMultiple\fP" 10 Specifies the distance over which the scrollbar slider snaps back to its original position when the user drags the mouse outside the ScrollBar edge\&. This distance is defined in terms of multiples of the width of the slider\&. For example, a multiple of 0 (zero) causes the slider to snap back as soon as the pointer moves out of the ScrollBar frame, a multiple of 1 causes the slider to snap back as soon as the pointer moves beyond 1 ScrollBar width of the ScrollBar edge\&. Whenever the slider snaps back, the ScrollBar \fBdragCallback\fP is called if there is one\&. .IP "" 10 The default value is large enough to prevent unwanted snapBack activity if the mouse is moved within the boundaries of any reasonable screen\&. To reset the default, set this resource to a large value, such as 10000\&. .IP "\fBXmNtoBottomCallback\fP" 10 Specifies the list of callbacks that is called when the user takes an action that moves the slider to the end of the ScrollBar with the maximum value\&. The reason passed to the callback is \fBXmCR_TO_BOTTOM\fP\&. .IP "\fBXmNtoTopCallback\fP" 10 Specifies the list of callbacks that is called when the user takes an action that moves the slider to the end of the ScrollBar with the minimum value\&. The reason passed to the callback is \fBXmCR_TO_TOP\fP\&. .IP "\fBXmNtroughColor\fP" 10 Specifies the color of the slider trough\&. This color defaults to the color used for selections\&. .IP "\fBXmNvalue\fP" 10 Specifies the slider\&'s position, between \fBXmNminimum\fP and (\fBXmNmaximum\fP\ - \fBXmNsliderSize\fP)\&. The value is constrained to be within these inclusive bounds\&. The initial value of this resource is the larger of 0 (zero) and \fBXmNminimum\fP\&. .IP "\fBXmNvalueChangedCallback\fP" 10 Specifies the list of callbacks that is called when the slider is released after being dragged\&. These callbacks are also called in place of \fBXmNincrementCallback\fP, \fBXmNdecrementCallback\fP, \fBXmNpageIncrementCallback\fP, \fBXmNpageDecrementCallback\fP, \fBXmNtoTopCallback\fP, or \fBXmNtoBottomCallback\fP when one of these callback lists would normally be called but the value of the corresponding resource is NULL\&. The reason passed to the callback is \fBXmCR_VALUE_CHANGED\fP\&. .SS "Inherited Resources" .PP ScrollBar inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimensiondynamicCSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmSTICKY_TAB_GROUPCSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleandynamicCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; int \fIvalue\fP; int \fIpixel\fP; } XmScrollBarCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. .IP "\fIvalue\fP" 10 Contains the new slider location value\&. .IP "\fIpixel\fP" 10 Is used only for \fBXmNtoTopCallback\fP and \fBXmNtoBottomCallback\fP\&. For horizontal ScrollBars, it contains the \fIx\fP coordinate of where the mouse button selection occurred\&. For vertical ScrollBars, it contains the \fIy\fP coordinate\&. .SS "Translations" .PP \fBXmScrollBar\fP includes translations from Primitive\&. The \fBXmScrollBar\fP translations are described in the following list\&. .PP The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP:" 10 Select() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP:" 10 Release() .IP "\fB\(aps \(apc \(apm \(apa Button1\fP\fB\fP:" 10 Moved() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP:" 10 Select() .IP "\fB\(aps \(apc \(apm \(apa\fP \fB\fP:" 10 Release() .IP "\fB\(aps \(apc \(apm \(apa Button2\fP\fB\fP:" 10 Moved() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP:" 10 TopOrBottom() .IP "\fB\(aps c \(apm \(apa\fP \fB\fP:" 10 Release() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 CancelDrag() .IP "\fB:\fP\fB\fP\fB\fP:" 10 TopOrBottom() .IP "\fB:\fP\fB\fP\fB\fP:" 10 TopOrBottom() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PageUpOrLeft(\fBLeft\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 PageUpOrLeft(\fBLeft\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 PageUpOrLeft(\fBUp\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 PageDownOrRight(\fBRight\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 PageDownOrRight(\fBRight\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 PageDownOrRight(\fBDown\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveHelp() .IP "\fB:c\fP \fB\fP\fB\fP:" 10 PageUpOrLeft(\fBUp\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 IncrementUpOrLeft(\fBUp\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 PageDownOrRight(\fBDown\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 IncrementDownOrRight(\fBDown\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 PageUpOrLeft(\fBLeft\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 IncrementUpOrLeft(\fBLeft\fP) .IP "\fB:c\fP \fB\fP\fB\fP:" 10 PageDownOrRight(\fBRight\fP) .IP "\fB:\fP\fB\fP\fB\fP:" 10 IncrementDownOrRight(\fBRight\fP) .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fBs \(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrimitivePrevTabGroup() .IP "\fB\(apm \(apa\fP \fB\fP\fBTab\fP:" 10 PrimitiveNextTabGroup() .SS "Action Routines" .PP The ScrollBar action routines are .IP "CancelDrag():" 10 If the key press occurs during scrolling, cancels the scroll and returns the slider to its previous location in the scrollbar, otherwise, and if the parent is a manager, it passes the event to the parent\&. .IP "IncrementDownOrRight(\fBDown|Right\fP):" 10 With an argument of \fBDown\fP, or 0 (zero) for compatibility, moves the slider down by one increment\&. With an argument of \fBRight\fP, or 1 for compatibility, it moves the slider right by one increment\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement toward the right or bottom calls the callbacks for \fBXmNincrementCallback\fP\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement toward the right or bottom calls the callbacks for \fBXmNdecrementCallback\fP\&. The \fBXmNvalueChangedCallback\fP is called if the \fBXmNincrementCallback\fP or \fBXmNdecrementCallback\fP is NULL\&. .IP "IncrementUpOrLeft(\fBUp|Left\fP):" 10 With an argument of \fBUp\fP, or 0 (zero) for compatibility, moves the slider up by one increment\&. With an argument of \fBLeft\fP, or 1 for compatibility, it moves the slider left by one increment\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement to the left or top calls the callbacks for \fBXmNdecrementCallback\fP\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement to the left or top calls the callbacks for \fBXmNincrementCallback\fP\&. The \fBXmNvalueChangedCallback\fP is called if the \fBXmNincrementCallback\fP or \fBXmNdecrementCallback\fP is NULL\&. .IP "Moved():" 10 If the button press occurs within the slider, the subsequent motion events move the slider to the position of the pointer and call the callbacks for \fBXmNdragCallback\fP\&. .IP "PageDownOrRight(\fBDown|Right\fP):" 10 With an argument of \fBDown\fP, or 0 (zero) for compatibility, moves the slider down by one page increment\&. With an argument of \fBRight\fP, or 1 for compatibility, moves the slider right by one page increment\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement toward the right or bottom calls the callbacks for \fBXmNpageIncrementCallback\fP\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement toward the right or bottom calls the \fBXmNpageDecrementCallback\fP callbacks\&. The \fBXmNvalueChangedCallback\fP is called if the \fBXmNpageIncrementCallback\fP or \fBXmNpageDecrementCallback\fP is NULL\&. .IP "PageUpOrLeft(\fBUp|Left\fP):" 10 With an argument of \fBUp\fP, or 0 (zero) for compatibility, moves the slider up by one page increment\&. With an argument of \fBLeft\fP, or 1 for compatibility, it moves the slider left by one page increment\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement to the left or top calls the callbacks for \fBXmNpageDecrementCallback\fP\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement to the left or top calls the \fBXmNpageIncrementCallback\fP callbacks\&. The \fBXmNvalueChangedCallback\fP is called if the \fBXmNpageIncrementCallback\fP or \fBXmNpageDecrementCallback\fP is NULL\&. .IP "PrimitiveHelp():" 10 Calls the callbacks for \fBXmNhelpCallback\fP if any exist\&. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them\&. .IP "PrimitiveNextTabGroup():" 10 Traverses to the first item in the next tab group\&. If the current tab group is the last entry in the tab group list, it wraps to the beginning of the tab group list\&. .IP "PrimitiveParentActivate():" 10 If the parent is a manager, passes the event to the parent\&. .IP "PrimitivePrevTabGroup():" 10 Traverses to the first item in the previous tab group\&. If the beginning of the tab group list is reached, it wraps to the end of the tab group list\&. .IP "Release():" 10 If the button press occurs within the slider and the slider position is changed, the callbacks for \fBXmNvalueChangedCallback\fP are called\&. .IP "Select():" 10 \fBIn arrow\fP: Moves the slider by one increment in the direction of the arrow\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement toward the right or bottom calls the callbacks for \fBXmNincrementCallback\fP, and movement to the left or top calls the callbacks for \fBXmNdecrementCallback\fP\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement toward the right or bottom calls the callbacks for \fBXmNdecrementCallback\fP, and movement to the left or top calls the callbacks for \fBXmNincrementCallback\fP\&. The \fBXmNvalueChangedCallback\fP is called if the \fBXmNincrementCallback\fP or \fBXmNdecrementCallback\fP is NULL\&. .IP "" 10 \fBIn scroll region between an arrow and the slider\fP: Moves the slider by one page increment in the direction of the arrow\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement toward the right or bottom calls the callbacks for \fBXmNpageIncrementCallback\fP, and movement to the left or top calls the callbacks for \fBXmNpageDecrementCallback\fP\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement toward the right or bottom calls the callbacks for \fBXmNpageDecrementCallback\fP, and movement to the left or top calls the callbacks for \fBXmNpageIncrementCallback\fP\&. The \fBXmNvalueChangedCallback\fP is called if the \fBXmNpageIncrementCallback\fP or \fBXmNpageDecrementCallback\fP is NULL\&. .IP "" 10 \fBIn slider\fP: Activates the interactive dragging of the slider\&. .IP "" 10 If the button is held down in either the arrows or the scroll region longer than the \fBXmNinitialDelay\fP resource, the slider is moved again by the same increment and the same callbacks are called\&. After the initial delay has been used, the time delay changes to the time defined by the resource \fBXmNrepeatDelay\fP\&. .IP "TopOrBottom():" 10 \fB\fP\fB\fP in an arrow or in the scroll region between an arrow and the slider moves the slider as far as possible in the direction of the arrow\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_RIGHT\fP or \fBXmMAX_ON_BOTTOM\fP, movement toward the right or bottom calls the callbacks for \fBXmNtoBottomCallback\fP, and movement to the left or top calls the callbacks for \fBXmNtoTopCallback\fP\&. If \fBXmNprocessingDirection\fP is \fBXmMAX_ON_LEFT\fP or \fBXmMAX_ON_TOP\fP, movement toward the right or bottom calls the callbacks for \fBXmNtoTopCallback\fP, and movement to the left or top calls the callbacks for \fBXmNtoBottomCallback\fP\&. The \fBXmNvalueChangedCallback\fP is called if the \fBXmNtoTopCallback\fP or \fBXmNtoBottomCallback\fP is NULL\&. Pressing \fB\fP\fB\fP or \fB\fP\fB\fP moves the slider to the minimum value and invokes the \fBXmNtoTopCallback\fP\&. Pressing \fB\fP\fB\fP or \fB\fP\fB\fP moves the slider to the maximum value and invokes the \fBXmNtoBottomCallback\fP\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateScrollBar\fP(3), \fBXmPrimitive\fP(3), \fBXmScrollBarGetValues\fP(3), \fBXmScrollBarSetValues\fP(3), \fBXmVaCreateScrollBar\fP(3), and \fBXmVaCreateManagedScrollBar\fP(3)\&. motif-2.3.8/doc/man/man3/XmOptionButtonGadget.30000644000175000017500000000503212672140200016104 00000000000000'\" t ...\" OptionBu.sgm /main/8 1996/09/08 20:54:56 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmOptionButtonGadget" "library call" .SH "NAME" \fBXmOptionButtonGadget\fP \(em A RowColumn function that obtains the widget ID for the CascadeButtonGadget in an OptionMenu .iX "XmOptionButtonGadget" .iX "RowColumn functions" "XmOptionButtonGadget" .SH "SYNOPSIS" .PP .nf #include \fBWidget \fBXmOptionButtonGadget\fP\fR( \fBWidget \fBoption_menu\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmOptionButtonGadget\fP provides the application with the means for obtaining the widget ID for the internally created CascadeButtonGadget\&. Once the application has obtained the widget ID, it can adjust the visuals for the CascadeButtonGadget, if desired\&. .PP When an application creates an instance of the OptionMenu widget, the widget creates two internal gadgets\&. One is a LabelGadget that is used to display RowColumn\&'s \fBXmNlabelString\fP resource\&. The other is a CascadeButtonGadget that displays the current selection and provides the means for posting the OptionMenu\&'s submenu\&. .PP The user can specify resources in a resource file for the automatically created widgets and gadgets of an OptionMenu\&. The following list identifies the names of these widgets (or gadgets) and the associated OptionMenu areas\&. .IP "Option Menu Label Gadget" 10 \fBOptionLabel\fP .IP "Option Menu Cascade Button" 10 \fBOptionButton\fP .IP "\fIoption_menu\fP" 10 Specifies the OptionMenu widget ID .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the widget ID for the internal button\&. .SH "RELATED" .PP \fBXmCreateOptionMenu\fP(3), \fBXmCascadeButtonGadget\fP(3), \fBXmOptionLabelGadget\fP(3), and \fBXmRowColumn\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/man3/XmVaCreateManagedCascadeButton.30000644000175000017500000000004312672140200017730 00000000000000.so man3/XmVaCreateCascadeButton.3 motif-2.3.8/doc/man/man3/XmTextFieldXYToPos.30000644000175000017500000000410012672140200015455 00000000000000'\" t ...\" TxtFieBI.sgm /main/8 1996/09/08 21:16:18 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldXYToPos" "library call" .SH "NAME" \fBXmTextFieldXYToPos\fP \(em A TextField function that accesses the character position nearest an x and y position .iX "XmTextFieldXYToPos" .iX "TextField functions" "XmTextFieldXYToPos" .SH "SYNOPSIS" .PP .nf #include \fBXmTextPosition \fBXmTextFieldXYToPos\fP\fR( \fBWidget \fBwidget\fR\fR, \fBPosition \fBx\fR\fR, \fBPosition \fBy\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldXYToPos\fP accesses the character position nearest to the specified \fIx\fP and \fIy\fP position, relative to the upper left corner of the TextField widget\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIx\fP" 10 Specifies the \fIx\fP position, relative to the upper left corner of the widget\&. .IP "\fIy\fP" 10 Specifies the \fIy\fP position, relative to the upper left corner of the widget\&. .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RETURN" .PP Returns the character position in the text nearest the \fIx\fP and \fIy\fP position specified\&. This is an integer number of characters from the beginning of the buffer\&. The first character position is 0 (zero)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:35 motif-2.3.8/doc/man/man3/XmTextFieldSetEditable.30000644000175000017500000000323212672140200016322 00000000000000'\" t ...\" TxtFieBA.sgm /main/7 1996/08/30 16:26:27 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmTextFieldSetEditable" "library call" .SH "NAME" \fBXmTextFieldSetEditable\fP \(em A TextField function that sets the edit permission .iX "XmTextFieldSetEditable" .iX "TextField functions" "XmTextFieldSetEditable" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmTextFieldSetEditable\fP\fR( \fBWidget \fBwidget\fR\fR, \fBBoolean \fBeditable\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmTextFieldSetEditable\fP sets the edit permission state of the TextField widget\&. When set to True, the text string can be edited\&. .IP "\fIwidget\fP" 10 Specifies the TextField widget ID .IP "\fIeditable\fP" 10 Specifies a Boolean value that when True allows text string edits .PP For a complete definition of TextField and its associated resources, see \fBXmTextField\fP(3)\&. .SH "RELATED" .PP \fBXmTextField\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:34 motif-2.3.8/doc/man/man3/XmVaCreateRowColumn.30000644000175000017500000000272512672140200015672 00000000000000.DT .TH "XmVaCreateRowColumn" "library call" .SH "NAME" \fBXmVaCreateRowColumn\fP, \fBXmVaCreateManagedRowColumn\fP \(em A RowColumn widget convenience creation functions\&. .iX "XmVaCreateToggleRowColumn" "XmVaCreateManagedRowColumn" .iX "creation functions" "XmVaCreateRowColumn" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateRowColumn\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedRowColumn\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateRowColumn\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateRowColumn\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of RowColumn and its associated resources, see \fBXmRowColumn\fP(3)\&. .SH "RETURN" .PP Returns the RowColumn widget ID\&. .SH "RELATED" .PP \fBXmRowColumn\fP(3), \fBXmCreateRowColumn\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmVaCreateScrolledWindow.30000644000175000017500000000304512672140200016700 00000000000000.DT .TH "XmVaCreateScrolledWindow" "library call" .SH "NAME" \fBXmVaCreateScrolledWindow\fP, \fBXmVaCreateManagedScrolledWindow\fP \(em A ScrolledWindow widget convenience creation functions\&. .iX "XmVaCreateToggleScrolledWindow" "XmVaCreateManagedScrolledWindow" .iX "creation functions" "XmVaCreateScrolledWindow" .SH "SYNOPSIS" .PP .nf #include .PP \fBWidget \fBXmVaCreateScrolledWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .PP \fBWidget \fBXmVaCreateManagedScrolledWindow\fP\fR( \fBWidget \fBparent\fR\fR, \fBString \fBname\fR\fR, \&.\&.\&.); .fi .SH "DESCRIPTION" .PP These functions create an instance of a ToggleButtonGadget widget and returns the associated widget ID\&. These routines use the ANSI C variable-length argument list (\fIvarargs\fP) calling convention\&. .PP The \fBXmVaCreateScrolledWindow\fP function is a convenience routine that calls \fBXtCreateWidget\fP\&. .PP The \fBXmVaCreateScrolledWindow\fP function is a convenience routine that calls \fBXtCreateManagedWidget\fP\&. .PP .IP "\fIparent\fP" 10 Specifies the parent widget ID\&. .IP "\fIname\fP" 10 Specifies the name of the created widget\&. .IP \fI...\fP Specifies the variable argument list to override the resource defaults. .PP For a complete definition of ScrolledWindow and its associated resources, see \fBXmScrolledWindow\fP(3)\&. .SH "RETURN" .PP Returns the ScrolledWindow widget ID\&. .SH "RELATED" .PP \fBXmScrolledWindow\fP(3), \fBXmCreateScrolledWindow\fP(3), \fBXtCreateWidget\fP(3), and \fBXtCreateManagedWidget\fP(3)\&. motif-2.3.8/doc/man/man3/XmCascadeButtonHighlight.30000644000175000017500000000365612672140200016705 00000000000000'\" t ...\" CascBD.sgm /main/7 1996/08/30 14:06:09 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmCascadeButtonHighlight" "library call" .SH "NAME" \fBXmCascadeButtonHighlight\fP \(em A CascadeButton and CascadeButtonGadget function that sets the highlight state .iX "XmCascadeButtonHighlight" .iX "CascadeButton functions" "XmCascadeButtonHighlight" .SH "SYNOPSIS" .PP .nf #include #include \fBvoid \fBXmCascadeButtonHighlight\fP\fR( \fBWidget \fBcascadeButton\fR\fR, \fBBoolean \fBhighlight\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmCascadeButtonHighlight\fP either draws or erases the shadow highlight around the CascadeButton or the CascadeButtonGadget\&. .IP "\fIcascadeButton\fP" 10 Specifies the CascadeButton or CascadeButtonGadget to be highlighted or unhighlighted .IP "\fIhighlight\fP" 10 Specifies whether to highlight (True) or to unhighlight (False) .PP For a complete definition of CascadeButton or CascadeButtonGadget and their associated resources, see \fBXmCascadeButton\fP(3) or \fBXmCascadeButtonGadget\fP(3)\&. .SH "RELATED" .PP \fBXmCascadeButton\fP(3), \fBXmCascadeButtonGadget\fP(3) and \fBXmCascadeButtonGadgetHighlight\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:17 motif-2.3.8/doc/man/man3/XmParseMappingSetValues.30000644000175000017500000000357012672140200016553 00000000000000'\" t ...\" ParMapE.sgm /main/7 1996/08/30 15:52:52 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmParseMappingSetValues" "library call" .SH "NAME" \fBXmParseMappingSetValues\fP \(em A compound string function to set attributes of a parse mapping .iX "XmParseMappingSetValues" .iX "compound string functions" "XmParseMappingSetValues" .SH "SYNOPSIS" .PP .nf #include \fBvoid \fBXmParseMappingSetValues\fP\fR( \fBXmParseMapping \fBparse_mapping\fR\fR, \fBArgList \fBarglist\fR\fR, \fBCardinal \fBargcount\fR\fR); .fi .SH "DESCRIPTION" .PP \fBXmParseMappingSetValues\fP specifies attributes of an \fBXmParseMapping\fR object, using a resource-style argument list\&. .IP "\fIarglist\fP" 10 Specifies the argument list .IP "\fIargcount\fP" 10 Specifies the number of attribute/value pairs in the argument list (\fIarglist\fP) .PP For a complete definition of \fBXmParseMapping\fR and its associated resources, see \fBXmParseMapping\fP(3)\&. .SH "RELATED" .PP \fBXmParseMapping\fP(3), \fBXmParseMappingCreate\fP(3), \fBXmParseMappingFree\fP(3), \fBXmParseMappingGetValues\fP(3), \fBXmParseTable\fP(3), and \fBXmString\fP(3)\&. ...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:27 motif-2.3.8/doc/man/Makefile.am0000644000175000017500000000010212672140200013122 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = man1 man3 man4 man5 motif-2.3.8/doc/Makefile.am0000644000175000017500000000006212672140200012354 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = man motif-2.3.8/ac_image_support.m40000644000175000017500000000470112672140200013342 00000000000000AC_DEFUN([AC_IMAGE_SUPPORT], [ AH_TEMPLATE([JPEG_SUPPORTED], [Use libjpeg library]) AH_TEMPLATE([PNG_SUPPORTED], [Use libpng library]) AC_ARG_ENABLE(jpeg, [ --enable-jpeg Enable JPEG support],,[enable_jpeg=yes]) AC_ARG_WITH(libjpeg_includes, [ --with-libjpeg-includes=DIR Use libjpeg includes in DIR], libjpeg_includes=$withval) AC_ARG_WITH(libjpeg_lib, [ --with-libjpeg-lib=DIR Use libjpeg library in DIR], libjpeg_lib=$withval) AC_ARG_ENABLE(png, [ --enable-png Enable PNG support],,[enable_png=yes]) AC_ARG_WITH(libpng_includes, [ --with-libpng-includes=DIR Use libpng includes in DIR], libpng_includes=$withval) AC_ARG_WITH(libpng_lib, [ --with-libpng-lib=DIR Use libpng library in DIR], libpng_lib=$withval) # # Check libjpeg configuration # if test "$enable_jpeg" = "yes" then if test "$libjpeg_includes" then LIBJPEG_CFLAGS="-I$libjpeg_includes" fi if test "$libjpeg_lib" then LIBJPEG_LIBS="-L$libjpeg_lib -ljpeg" else LIBJPEG_LIBS="-ljpeg" fi saved_LIBS="$LIBS" LIBS="$LIBS $LIBJPEG_LIBS" saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBJPEG_CFLAGS" AC_CHECK_HEADERS(jpeglib.h, libjpeg_headers_present="yes") AC_CHECK_FUNCS(jpeg_start_decompress, libjpeg_present="yes") if test "$libjpeg_present" = "yes" -a "$libjpeg_headers_present" = "yes" then AC_SUBST(LIBS) use_libjpeg=yes AC_DEFINE(JPEG_SUPPORTED, 1, We have discovered the libjpeg library) else CFLAGS="$saved_CFLAGS" LIBS="$saved_LIBS" fi fi AM_CONDITIONAL(OM_LIBJPEG, test "$use_libjpeg" = "yes") # # Check libpng configuration # if test "$enable_png" = "yes" then if test "$libpng_includes" then LIBPNG_CFLAGS="-I$libpng_includes" fi if test "$libpng_lib" then LIBPNG_LIBS="-L$libpng_lib -lpng" else LIBPNG_LIBS="-lpng" fi saved_LIBS="$LIBS" LIBS="$LIBS $LIBPNG_LIBS" saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBPNG_CFLAGS" AC_CHECK_HEADERS(png.h, libpng_headers_present="yes") AC_CHECK_FUNCS(png_create_read_struct, libpng_present="yes") if test "$libpng_present" = "yes" -a "$libpng_headers_present" = "yes" then AC_SUBST(LIBS) use_libpng=yes AC_DEFINE(PNG_SUPPORTED, 1, We have discovered the libpng library) else CFLAGS="$saved_CFLAGS" LIBS="$saved_LIBS" fi fi AM_CONDITIONAL(OM_LIBPNG, test "$use_libpng" = "yes") ]) motif-2.3.8/tools/0000755000175000017500000000000013211513005010772 500000000000000motif-2.3.8/tools/Makefile.in0000644000175000017500000004637413211512767013013 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = SUBDIRS = wml all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/tools/wml/0000755000175000017500000000000013211513006011572 500000000000000motif-2.3.8/tools/wml/UilSymArTa.h0000644000175000017500000123412313211513006013663 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* * Bit vectors for each argument. The entries in the vector correspond * to each class. */ /* sym_k_DtNallowSendEvents_arg */ static unsigned char arg_class_vec1[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNappCursorDefault_arg */ static unsigned char arg_class_vec2[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNappKeypadDefault_arg */ static unsigned char arg_class_vec3[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNautoShowCursorPosition_arg */ static unsigned char arg_class_vec4[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNautoWrap_arg */ static unsigned char arg_class_vec5[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNbackLabelString_arg */ static unsigned char arg_class_vec6[] = { _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNbackgroundIsSelect_arg */ static unsigned char arg_class_vec7[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNbaseHeight_arg */ static unsigned char arg_class_vec8[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNbaseWidth_arg */ static unsigned char arg_class_vec9[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNblinkRate_arg */ static unsigned char arg_class_vec10[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNbuttonFontList_arg */ static unsigned char arg_class_vec11[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNc132_arg */ static unsigned char arg_class_vec12[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcascadePixmap_arg */ static unsigned char arg_class_vec13[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcenterToggleLabel_arg */ static unsigned char arg_class_vec14[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNchangeAllButtonLabel_arg */ static unsigned char arg_class_vec15[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNchangeButtonLabel_arg */ static unsigned char arg_class_vec16[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNchangeFieldLabel_arg */ static unsigned char arg_class_vec17[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcharCursorStyle_arg */ static unsigned char arg_class_vec18[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcloseLabelString_arg */ static unsigned char arg_class_vec19[] = { _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcolumns_arg */ static unsigned char arg_class_vec20[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNconsoleMode_arg */ static unsigned char arg_class_vec21[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcopies_arg */ static unsigned char arg_class_vec22[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcsWidth_arg */ static unsigned char arg_class_vec23[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcurrentLineLabel_arg */ static unsigned char arg_class_vec24[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcursorPosition_arg */ static unsigned char arg_class_vec25[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcursorPositionVisible_arg */ static unsigned char arg_class_vec26[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNdescription_arg */ static unsigned char arg_class_vec27[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNdialogTitle_arg */ static unsigned char arg_class_vec28[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNeditable_arg */ static unsigned char arg_class_vec29[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNemulationId_arg */ static unsigned char arg_class_vec30[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNexecutionPolicy_arg */ static unsigned char arg_class_vec31[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNfileName_arg */ static unsigned char arg_class_vec32[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNfindButtonLabel_arg */ static unsigned char arg_class_vec33[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNfindChangeDialogTitle_arg */ static unsigned char arg_class_vec34[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNfindFieldLabel_arg */ static unsigned char arg_class_vec35[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNformatAllButtonLabel_arg */ static unsigned char arg_class_vec36[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNformatParagraphButtonLabel_arg */ static unsigned char arg_class_vec37[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNformatSettingsDialogTitle_arg */ static unsigned char arg_class_vec38[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNheightInc_arg */ static unsigned char arg_class_vec39[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNhelpFile_arg */ static unsigned char arg_class_vec40[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNhelpLabelString_arg */ static unsigned char arg_class_vec41[] = { _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNhelpOnHelpVolume_arg */ static unsigned char arg_class_vec42[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNhelpPrint_arg */ static unsigned char arg_class_vec43[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNhelpType_arg */ static unsigned char arg_class_vec44[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNhelpVolume_arg */ static unsigned char arg_class_vec45[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNinformationDialogTitle_arg */ static unsigned char arg_class_vec46[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNinsertLabel_arg */ static unsigned char arg_class_vec47[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNjumpScroll_arg */ static unsigned char arg_class_vec48[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNjustifyToggleLabel_arg */ static unsigned char arg_class_vec49[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNkshMode_arg */ static unsigned char arg_class_vec50[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNlabelFontList_arg */ static unsigned char arg_class_vec51[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNleftAlignToggleLabel_arg */ static unsigned char arg_class_vec52[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNleftMarginFieldLabel_arg */ static unsigned char arg_class_vec53[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNlocationId_arg */ static unsigned char arg_class_vec54[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNlogFile_arg */ static unsigned char arg_class_vec55[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNlogInhibit_arg */ static unsigned char arg_class_vec56[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNlogging_arg */ static unsigned char arg_class_vec57[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmanPage_arg */ static unsigned char arg_class_vec58[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmapOnOutput_arg */ static unsigned char arg_class_vec59[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmapOnOutputDelay_arg */ static unsigned char arg_class_vec60[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmarginBell_arg */ static unsigned char arg_class_vec61[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmarginHeight_arg */ static unsigned char arg_class_vec62[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmarginWidth_arg */ static unsigned char arg_class_vec63[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmaxLength_arg */ static unsigned char arg_class_vec64[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNminimizeButtons_arg */ static unsigned char arg_class_vec65[] = { _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmisspelledListLabel_arg */ static unsigned char arg_class_vec66[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNmoreLabelString_arg */ static unsigned char arg_class_vec67[] = { _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNnMarginBell_arg */ static unsigned char arg_class_vec68[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNoverstrike_arg */ static unsigned char arg_class_vec69[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNoverstrikeLabel_arg */ static unsigned char arg_class_vec70[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNpaperSize_arg */ static unsigned char arg_class_vec71[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNpointerBlank_arg */ static unsigned char arg_class_vec72[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNpointerBlankDelay_arg */ static unsigned char arg_class_vec73[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNpointerColor_arg */ static unsigned char arg_class_vec74[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNpointerColorBackground_arg */ static unsigned char arg_class_vec75[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNpointerShape_arg */ static unsigned char arg_class_vec76[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNprintDestination_arg */ static unsigned char arg_class_vec77[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNprintLabelString_arg */ static unsigned char arg_class_vec78[] = { _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNprintSetupMode_arg */ static unsigned char arg_class_vec79[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNprinter_arg */ static unsigned char arg_class_vec80[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNprinterInfoProc_arg */ static unsigned char arg_class_vec81[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNprinterName_arg */ static unsigned char arg_class_vec82[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNreverseVideo_arg */ static unsigned char arg_class_vec83[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNreverseWrap_arg */ static unsigned char arg_class_vec84[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNrightAlignToggleLabel_arg */ static unsigned char arg_class_vec85[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNrightMarginFieldLabel_arg */ static unsigned char arg_class_vec86[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNrows_arg */ static unsigned char arg_class_vec87[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsaveLines_arg */ static unsigned char arg_class_vec88[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNscrollBarPolicy_arg */ static unsigned char arg_class_vec89[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNscrollHorizontal_arg */ static unsigned char arg_class_vec90[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNscrollLeftSide_arg */ static unsigned char arg_class_vec91[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNscrollTopSide_arg */ static unsigned char arg_class_vec92[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNscrollVertical_arg */ static unsigned char arg_class_vec93[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNselectFileProc_arg */ static unsigned char arg_class_vec94[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNselectPrinterProc_arg */ static unsigned char arg_class_vec95[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNshadowType_arg */ static unsigned char arg_class_vec96[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNshowNewWindowButton_arg */ static unsigned char arg_class_vec97[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNshowStatusLine_arg */ static unsigned char arg_class_vec98[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNspellDialogTitle_arg */ static unsigned char arg_class_vec99[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNspellFilter_arg */ static unsigned char arg_class_vec100[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNstickyNextCursor_arg */ static unsigned char arg_class_vec101[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNstickyPrevCursor_arg */ static unsigned char arg_class_vec102[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNstringData_arg */ static unsigned char arg_class_vec103[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubMenuId_arg */ static unsigned char arg_class_vec104[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubprocessArgv_arg */ static unsigned char arg_class_vec105[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubprocessCmd_arg */ static unsigned char arg_class_vec106[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubprocessExec_arg */ static unsigned char arg_class_vec107[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubprocessLoginShell_arg */ static unsigned char arg_class_vec108[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubprocessPid_arg */ static unsigned char arg_class_vec109[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubprocessTerminationCatch_arg */ static unsigned char arg_class_vec110[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsunFunctionKeys_arg */ static unsigned char arg_class_vec111[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtermDevice_arg */ static unsigned char arg_class_vec112[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtermDeviceAllocate_arg */ static unsigned char arg_class_vec113[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtermId_arg */ static unsigned char arg_class_vec114[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtermName_arg */ static unsigned char arg_class_vec115[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtermSlaveName_arg */ static unsigned char arg_class_vec116[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtextBackground_arg */ static unsigned char arg_class_vec117[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtextFontList_arg */ static unsigned char arg_class_vec118[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtextForeground_arg */ static unsigned char arg_class_vec119[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtextTranslations_arg */ static unsigned char arg_class_vec120[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtopCharacter_arg */ static unsigned char arg_class_vec121[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtopicTitle_arg */ static unsigned char arg_class_vec122[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtotalLineCountLabel_arg */ static unsigned char arg_class_vec123[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNttyModes_arg */ static unsigned char arg_class_vec124[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNuserBoldFont_arg */ static unsigned char arg_class_vec125[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNuserFont_arg */ static unsigned char arg_class_vec126[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNverifyPrinterProc_arg */ static unsigned char arg_class_vec127[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNverticalScrollBar_arg */ static unsigned char arg_class_vec128[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNvisiblePathCount_arg */ static unsigned char arg_class_vec129[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNvisualBell_arg */ static unsigned char arg_class_vec130[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNwidthInc_arg */ static unsigned char arg_class_vec131[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNwordWrap_arg */ static unsigned char arg_class_vec132[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNworkAreaLocation_arg */ static unsigned char arg_class_vec133[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmN100DPIstring_arg */ static unsigned char arg_class_vec134[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmN75DPIstring_arg */ static unsigned char arg_class_vec135[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNaccelerator_arg */ static unsigned char arg_class_vec136[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNacceleratorText_arg */ static unsigned char arg_class_vec137[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNaccelerators_arg */ static unsigned char arg_class_vec138[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNadjustLast_arg */ static unsigned char arg_class_vec139[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNadjustMargin_arg */ static unsigned char arg_class_vec140[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNalignment_arg */ static unsigned char arg_class_vec141[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTab_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNallowOverlap_arg */ static unsigned char arg_class_vec142[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNallowResize_arg */ static unsigned char arg_class_vec143[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNallowShellResize_arg */ static unsigned char arg_class_vec144[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNallowUnusedSpace_arg */ static unsigned char arg_class_vec145[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNancestorSensitive_arg */ static unsigned char arg_class_vec146[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNanyLowerString_arg */ static unsigned char arg_class_vec147[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNanyString_arg */ static unsigned char arg_class_vec148[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNapplyLabelString_arg */ static unsigned char arg_class_vec149[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNarmColor_arg */ static unsigned char arg_class_vec150[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNarmPixmap_arg */ static unsigned char arg_class_vec151[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNarrowDirection_arg */ static unsigned char arg_class_vec152[] = { 0, _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNarrowLayout_arg */ static unsigned char arg_class_vec153[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNarrowOrientation_arg */ static unsigned char arg_class_vec154[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNarrowSensitivity_arg */ static unsigned char arg_class_vec155[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNarrowSize_arg */ static unsigned char arg_class_vec156[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNarrowSpacing_arg */ static unsigned char arg_class_vec157[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNaudibleWarning_arg */ static unsigned char arg_class_vec158[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNautoClose_arg */ static unsigned char arg_class_vec159[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNautoDragModel_arg */ static unsigned char arg_class_vec160[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNautoFill_arg */ static unsigned char arg_class_vec161[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNautoShowCursorPosition_arg */ static unsigned char arg_class_vec162[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | 0, 0}; /* sym_k_XmNautoUnmanage_arg */ static unsigned char arg_class_vec163[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNautomaticSelection_arg */ static unsigned char arg_class_vec164[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNbackPageBackground_arg */ static unsigned char arg_class_vec165[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbackPageForeground_arg */ static unsigned char arg_class_vec166[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbackPageNumber_arg */ static unsigned char arg_class_vec167[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbackPagePlacement_arg */ static unsigned char arg_class_vec168[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbackPageSize_arg */ static unsigned char arg_class_vec169[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbackground_arg */ static unsigned char arg_class_vec170[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbackgroundPixmap_arg */ static unsigned char arg_class_vec171[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbaseHeight_arg */ static unsigned char arg_class_vec172[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbaseWidth_arg */ static unsigned char arg_class_vec173[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbindingPixmap_arg */ static unsigned char arg_class_vec174[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbindingType_arg */ static unsigned char arg_class_vec175[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbindingWidth_arg */ static unsigned char arg_class_vec176[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNblinkRate_arg */ static unsigned char arg_class_vec177[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNblueSliderLabel_arg */ static unsigned char arg_class_vec178[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNboldString_arg */ static unsigned char arg_class_vec179[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNborderColor_arg */ static unsigned char arg_class_vec180[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNborderPixmap_arg */ static unsigned char arg_class_vec181[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNborderWidth_arg */ static unsigned char arg_class_vec182[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbothString_arg */ static unsigned char arg_class_vec183[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbottomAttachment_arg */ static unsigned char arg_class_vec184[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbottomOffset_arg */ static unsigned char arg_class_vec185[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbottomPosition_arg */ static unsigned char arg_class_vec186[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbottomShadowColor_arg */ static unsigned char arg_class_vec187[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbottomShadowPixmap_arg */ static unsigned char arg_class_vec188[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbottomWidget_arg */ static unsigned char arg_class_vec189[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbuttonCount_arg */ static unsigned char arg_class_vec190[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNbuttonFontList_arg */ static unsigned char arg_class_vec191[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbuttonRenderTable_arg */ static unsigned char arg_class_vec192[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNbuttons_arg */ static unsigned char arg_class_vec193[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcancelButton_arg */ static unsigned char arg_class_vec194[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNcancelLabelString_arg */ static unsigned char arg_class_vec195[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNcascadePixmap_arg */ static unsigned char arg_class_vec196[] = { 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcellX_arg */ static unsigned char arg_class_vec197[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconBox_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcellY_arg */ static unsigned char arg_class_vec198[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconBox_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNchildHorizontalAlignment_arg */ static unsigned char arg_class_vec199[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmFrame_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNchildHorizontalSpacing_arg */ static unsigned char arg_class_vec200[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmFrame_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNchildPlacement_arg */ static unsigned char arg_class_vec201[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNchildType_arg */ static unsigned char arg_class_vec202[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmFrame_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNchildVerticalAlignment_arg */ static unsigned char arg_class_vec203[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmFrame_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNclipWindow_arg */ static unsigned char arg_class_vec204[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcloseFolderPixmap_arg */ static unsigned char arg_class_vec205[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNcollapsedStatePixmap_arg */ static unsigned char arg_class_vec206[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcolorListTogLabel_arg */ static unsigned char arg_class_vec207[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcolorMode_arg */ static unsigned char arg_class_vec208[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcolorName_arg */ static unsigned char arg_class_vec209[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcolormap_arg */ static unsigned char arg_class_vec210[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNcolumnTitles_arg */ static unsigned char arg_class_vec211[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcolumns_arg */ static unsigned char arg_class_vec212[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNcomboBoxType_arg */ static unsigned char arg_class_vec213[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcomboTranslations_arg */ static unsigned char arg_class_vec214[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcommand_arg */ static unsigned char arg_class_vec215[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcommandWindow_arg */ static unsigned char arg_class_vec216[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcommandWindowLocation_arg */ static unsigned char arg_class_vec217[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcompressStyle_arg */ static unsigned char arg_class_vec218[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNconnectNodes_arg */ static unsigned char arg_class_vec219[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNconnectStyle_arg */ static unsigned char arg_class_vec220[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNconstrainWidth_arg */ static unsigned char arg_class_vec221[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcreatePopupChildProc_arg */ static unsigned char arg_class_vec222[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNcurrentFont_arg */ static unsigned char arg_class_vec223[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcurrentPageNumber_arg */ static unsigned char arg_class_vec224[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcursor_arg */ static unsigned char arg_class_vec225[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcursorPosition_arg */ static unsigned char arg_class_vec226[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNcursorPositionVisible_arg */ static unsigned char arg_class_vec227[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNcustomizedCombinationBox_arg */ static unsigned char arg_class_vec228[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdarkThreshold_arg */ static unsigned char arg_class_vec229[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdecimal_arg */ static unsigned char arg_class_vec230[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTab_object) | 0, 0, 0}; /* sym_k_XmNdecimalPoints_arg */ static unsigned char arg_class_vec231[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNdefaultArrowSensitivity_arg */ static unsigned char arg_class_vec232[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNdefaultButton_arg */ static unsigned char arg_class_vec233[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdefaultButtonShadowThickness_arg */ static unsigned char arg_class_vec234[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNdefaultButtonType_arg */ static unsigned char arg_class_vec235[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdefaultEncodingString_arg */ static unsigned char arg_class_vec236[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdefaultEntryLabelAlignment_arg */ static unsigned char arg_class_vec237[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdefaultEntryLabelFontList_arg */ static unsigned char arg_class_vec238[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdefaultEntryLabelRenderTable_arg */ static unsigned char arg_class_vec239[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdefaultFillStyle_arg */ static unsigned char arg_class_vec240[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdefaultFontList_arg */ static unsigned char arg_class_vec241[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdefaultPosition_arg */ static unsigned char arg_class_vec242[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdeleteResponse_arg */ static unsigned char arg_class_vec243[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdepth_arg */ static unsigned char arg_class_vec244[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdetail_arg */ static unsigned char arg_class_vec245[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdetailColumnHeading_arg */ static unsigned char arg_class_vec246[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdetailColumnHeadingCount_arg */ static unsigned char arg_class_vec247[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdetailCount_arg */ static unsigned char arg_class_vec248[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdetailOrder_arg */ static unsigned char arg_class_vec249[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdetailOrderCount_arg */ static unsigned char arg_class_vec250[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdetailShadowThickness_arg */ static unsigned char arg_class_vec251[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNdetailTabList_arg */ static unsigned char arg_class_vec252[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdialogStyle_arg */ static unsigned char arg_class_vec253[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdialogTitle_arg */ static unsigned char arg_class_vec254[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdialogType_arg */ static unsigned char arg_class_vec255[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdirListItemCount_arg */ static unsigned char arg_class_vec256[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdirListItems_arg */ static unsigned char arg_class_vec257[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdirListLabelString_arg */ static unsigned char arg_class_vec258[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdirMask_arg */ static unsigned char arg_class_vec259[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdirSearchProc_arg */ static unsigned char arg_class_vec260[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdirSpec_arg */ static unsigned char arg_class_vec261[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdirectory_arg */ static unsigned char arg_class_vec262[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdirectoryValid_arg */ static unsigned char arg_class_vec263[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdistribution_arg */ static unsigned char arg_class_vec264[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdoubleClickInterval_arg */ static unsigned char arg_class_vec265[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNeditMode_arg */ static unsigned char arg_class_vec266[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | 0, 0}; /* sym_k_XmNeditable_arg */ static unsigned char arg_class_vec267[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledText_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNencodingList_arg */ static unsigned char arg_class_vec268[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNencodingString_arg */ static unsigned char arg_class_vec269[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryAlignment_arg */ static unsigned char arg_class_vec270[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNentryBackground_arg */ static unsigned char arg_class_vec271[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryBorder_arg */ static unsigned char arg_class_vec272[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNentryClass_arg */ static unsigned char arg_class_vec273[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNentryData_arg */ static unsigned char arg_class_vec274[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryLabelAlignment_arg */ static unsigned char arg_class_vec275[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryLabelFontList_arg */ static unsigned char arg_class_vec276[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryLabelPixmap_arg */ static unsigned char arg_class_vec277[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryLabelRenderTable_arg */ static unsigned char arg_class_vec278[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryLabelString_arg */ static unsigned char arg_class_vec279[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryLabelType_arg */ static unsigned char arg_class_vec280[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryParent_arg */ static unsigned char arg_class_vec281[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNentryVerticalAlignment_arg */ static unsigned char arg_class_vec282[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNentryViewType_arg */ static unsigned char arg_class_vec283[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNequalSize_arg */ static unsigned char arg_class_vec284[] = { 0, _BIT_MASK(sym_k_XmButtonBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNexpandedStatePixmap_arg */ static unsigned char arg_class_vec285[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfamilyString_arg */ static unsigned char arg_class_vec286[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfileListItemCount_arg */ static unsigned char arg_class_vec287[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfileListItems_arg */ static unsigned char arg_class_vec288[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfileListLabelString_arg */ static unsigned char arg_class_vec289[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfileReadError_arg */ static unsigned char arg_class_vec290[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfileSearchProc_arg */ static unsigned char arg_class_vec291[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfileTypeMask_arg */ static unsigned char arg_class_vec292[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfillOnArm_arg */ static unsigned char arg_class_vec293[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNfillOnSelect_arg */ static unsigned char arg_class_vec294[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNfillOption_arg */ static unsigned char arg_class_vec295[] = { 0, _BIT_MASK(sym_k_XmButtonBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfillStyle_arg */ static unsigned char arg_class_vec296[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfilterLabelString_arg */ static unsigned char arg_class_vec297[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfindLabel_arg */ static unsigned char arg_class_vec298[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfirstColumn_arg */ static unsigned char arg_class_vec299[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfirstColumnPixmaps_arg */ static unsigned char arg_class_vec300[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfirstPageNumber_arg */ static unsigned char arg_class_vec301[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfirstRow_arg */ static unsigned char arg_class_vec302[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfont_arg */ static unsigned char arg_class_vec303[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNfontEncoding_arg */ static unsigned char arg_class_vec304[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNfontFoundry_arg */ static unsigned char arg_class_vec305[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNfontList_arg */ static unsigned char arg_class_vec306[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNfontName_arg */ static unsigned char arg_class_vec307[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNfontSize_arg */ static unsigned char arg_class_vec308[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNfontStyle_arg */ static unsigned char arg_class_vec309[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNfontType_arg */ static unsigned char arg_class_vec310[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNforeground_arg */ static unsigned char arg_class_vec311[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNforegroundThreshold_arg */ static unsigned char arg_class_vec312[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNfractionBase_arg */ static unsigned char arg_class_vec313[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNframeBackground_arg */ static unsigned char arg_class_vec314[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNframeChildType_arg */ static unsigned char arg_class_vec315[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmFrame_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNframeShadowThickness_arg */ static unsigned char arg_class_vec316[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNfreeTabPixmap_arg */ static unsigned char arg_class_vec317[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNgeometry_arg */ static unsigned char arg_class_vec318[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNgreenSliderLabel_arg */ static unsigned char arg_class_vec319[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNheight_arg */ static unsigned char arg_class_vec320[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNheightInc_arg */ static unsigned char arg_class_vec321[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNhelpLabelString_arg */ static unsigned char arg_class_vec322[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNhighlightColor_arg */ static unsigned char arg_class_vec323[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNhighlightOnEnter_arg */ static unsigned char arg_class_vec324[] = { _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNhighlightPixmap_arg */ static unsigned char arg_class_vec325[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNhighlightThickness_arg */ static unsigned char arg_class_vec326[] = { _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNhistoryItemCount_arg */ static unsigned char arg_class_vec327[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNhistoryItems_arg */ static unsigned char arg_class_vec328[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNhistoryMaxItems_arg */ static unsigned char arg_class_vec329[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNhistoryVisibleItemCount_arg */ static unsigned char arg_class_vec330[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNhorizontalDelta_arg */ static unsigned char arg_class_vec331[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNhorizontalMargin_arg */ static unsigned char arg_class_vec332[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNhorizontalNodeSpace_arg */ static unsigned char arg_class_vec333[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNhorizontalScrollBar_arg */ static unsigned char arg_class_vec334[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNhorizontalSpacing_arg */ static unsigned char arg_class_vec335[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNiconMask_arg */ static unsigned char arg_class_vec336[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNiconName_arg */ static unsigned char arg_class_vec337[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNiconNameEncoding_arg */ static unsigned char arg_class_vec338[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNiconPixmap_arg */ static unsigned char arg_class_vec339[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNiconPlacement_arg */ static unsigned char arg_class_vec340[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNiconTextPadding_arg */ static unsigned char arg_class_vec341[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNiconWindow_arg */ static unsigned char arg_class_vec342[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNiconX_arg */ static unsigned char arg_class_vec343[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNiconY_arg */ static unsigned char arg_class_vec344[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNiconic_arg */ static unsigned char arg_class_vec345[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNincrement_arg */ static unsigned char arg_class_vec346[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNincrementValue_arg */ static unsigned char arg_class_vec347[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNindentSpace_arg */ static unsigned char arg_class_vec348[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNindeterminateInsensitivePixmap_arg */ static unsigned char arg_class_vec349[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNindeterminatePixmap_arg */ static unsigned char arg_class_vec350[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNindicatorOn_arg */ static unsigned char arg_class_vec351[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNindicatorSize_arg */ static unsigned char arg_class_vec352[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNindicatorType_arg */ static unsigned char arg_class_vec353[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNinitialDelay_arg */ static unsigned char arg_class_vec354[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNinitialFocus_arg */ static unsigned char arg_class_vec355[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNinitialResourcesPersistent_arg */ static unsigned char arg_class_vec356[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNinitialState_arg */ static unsigned char arg_class_vec357[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNinnerMarginHeight_arg */ static unsigned char arg_class_vec358[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNinnerMarginWidth_arg */ static unsigned char arg_class_vec359[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNinput_arg */ static unsigned char arg_class_vec360[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNinputMethod_arg */ static unsigned char arg_class_vec361[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNinputPolicy_arg */ static unsigned char arg_class_vec362[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNinsertBefore_arg */ static unsigned char arg_class_vec363[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNinsertPosition_arg */ static unsigned char arg_class_vec364[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNisAligned_arg */ static unsigned char arg_class_vec365[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNisHomogeneous_arg */ static unsigned char arg_class_vec366[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNitalicString_arg */ static unsigned char arg_class_vec367[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNitemCount_arg */ static unsigned char arg_class_vec368[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNitemSpacing_arg */ static unsigned char arg_class_vec369[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNitems_arg */ static unsigned char arg_class_vec370[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNkeyboardFocusPolicy_arg */ static unsigned char arg_class_vec371[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNlabel_arg */ static unsigned char arg_class_vec372[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlabelFontList_arg */ static unsigned char arg_class_vec373[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNlabelInsensitivePixmap_arg */ static unsigned char arg_class_vec374[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNlabelPixmap_arg */ static unsigned char arg_class_vec375[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNlabelRenderTable_arg */ static unsigned char arg_class_vec376[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNlabelSpacing_arg */ static unsigned char arg_class_vec377[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlabelString_arg */ static unsigned char arg_class_vec378[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNlabelType_arg */ static unsigned char arg_class_vec379[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNlargeCellHeight_arg */ static unsigned char arg_class_vec380[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlargeCellWidth_arg */ static unsigned char arg_class_vec381[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlargeIconMask_arg */ static unsigned char arg_class_vec382[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlargeIconPixmap_arg */ static unsigned char arg_class_vec383[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlargeIconX_arg */ static unsigned char arg_class_vec384[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlargeIconY_arg */ static unsigned char arg_class_vec385[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlastPageNumber_arg */ static unsigned char arg_class_vec386[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlayoutDirection_arg */ static unsigned char arg_class_vec387[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNlayoutType_arg */ static unsigned char arg_class_vec388[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNleftAttachment_arg */ static unsigned char arg_class_vec389[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNleftOffset_arg */ static unsigned char arg_class_vec390[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNleftPosition_arg */ static unsigned char arg_class_vec391[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNleftWidget_arg */ static unsigned char arg_class_vec392[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlightThreshold_arg */ static unsigned char arg_class_vec393[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNlineBackgroundColor_arg */ static unsigned char arg_class_vec394[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNlineColor_arg */ static unsigned char arg_class_vec395[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNlineStyle_arg */ static unsigned char arg_class_vec396[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNlineWidth_arg */ static unsigned char arg_class_vec397[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNlist_arg */ static unsigned char arg_class_vec398[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlistItemCount_arg */ static unsigned char arg_class_vec399[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNlistItems_arg */ static unsigned char arg_class_vec400[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNlistLabelString_arg */ static unsigned char arg_class_vec401[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNlistMarginHeight_arg */ static unsigned char arg_class_vec402[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNlistMarginWidth_arg */ static unsigned char arg_class_vec403[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNlistSizePolicy_arg */ static unsigned char arg_class_vec404[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNlistSpacing_arg */ static unsigned char arg_class_vec405[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNlistUpdated_arg */ static unsigned char arg_class_vec406[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlistVisibleItemCount_arg */ static unsigned char arg_class_vec407[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNloadModel_arg */ static unsigned char arg_class_vec408[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNmainWindowMarginHeight_arg */ static unsigned char arg_class_vec409[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNmainWindowMarginWidth_arg */ static unsigned char arg_class_vec410[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNmajorTabSpacing_arg */ static unsigned char arg_class_vec411[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNmappedWhenManaged_arg */ static unsigned char arg_class_vec412[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmappingDelay_arg */ static unsigned char arg_class_vec413[] = { 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNmargin_arg */ static unsigned char arg_class_vec414[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNmarginBottom_arg */ static unsigned char arg_class_vec415[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNmarginHeight_arg */ static unsigned char arg_class_vec416[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmarginLeft_arg */ static unsigned char arg_class_vec417[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNmarginRight_arg */ static unsigned char arg_class_vec418[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNmarginTop_arg */ static unsigned char arg_class_vec419[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNmarginWidth_arg */ static unsigned char arg_class_vec420[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmatchBehavior_arg */ static unsigned char arg_class_vec421[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNmaxAspectX_arg */ static unsigned char arg_class_vec422[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmaxAspectY_arg */ static unsigned char arg_class_vec423[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmaxHeight_arg */ static unsigned char arg_class_vec424[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmaxLength_arg */ static unsigned char arg_class_vec425[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNmaxWidth_arg */ static unsigned char arg_class_vec426[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmaximum_arg */ static unsigned char arg_class_vec427[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNmaximumValue_arg */ static unsigned char arg_class_vec428[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNmenuAccelerator_arg */ static unsigned char arg_class_vec429[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNmenuBar_arg */ static unsigned char arg_class_vec430[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNmenuHelpWidget_arg */ static unsigned char arg_class_vec431[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNmenuHistory_arg */ static unsigned char arg_class_vec432[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNmenuPost_arg */ static unsigned char arg_class_vec433[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNmessageAlignment_arg */ static unsigned char arg_class_vec434[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmessageString_arg */ static unsigned char arg_class_vec435[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmessageWindow_arg */ static unsigned char arg_class_vec436[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNminAspectX_arg */ static unsigned char arg_class_vec437[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNminAspectY_arg */ static unsigned char arg_class_vec438[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNminHeight_arg */ static unsigned char arg_class_vec439[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNminWidth_arg */ static unsigned char arg_class_vec440[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNminimizeButtons_arg */ static unsigned char arg_class_vec441[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNminimum_arg */ static unsigned char arg_class_vec442[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNminimumCellHeight_arg */ static unsigned char arg_class_vec443[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconBox_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNminimumCellWidth_arg */ static unsigned char arg_class_vec444[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconBox_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNminimumHorizontalCells_arg */ static unsigned char arg_class_vec445[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconBox_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNminimumValue_arg */ static unsigned char arg_class_vec446[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNminimumVerticalCells_arg */ static unsigned char arg_class_vec447[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconBox_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNminorTabSpacing_arg */ static unsigned char arg_class_vec448[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNmnemonic_arg */ static unsigned char arg_class_vec449[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNmnemonicCharSet_arg */ static unsigned char arg_class_vec450[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNmonoSpaceString_arg */ static unsigned char arg_class_vec451[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNmultiClick_arg */ static unsigned char arg_class_vec452[] = { 0, _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNmustMatch_arg */ static unsigned char arg_class_vec453[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNmwmDecorations_arg */ static unsigned char arg_class_vec454[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmwmFunctions_arg */ static unsigned char arg_class_vec455[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmwmInputMode_arg */ static unsigned char arg_class_vec456[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmwmMenu_arg */ static unsigned char arg_class_vec457[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNnavigationType_arg */ static unsigned char arg_class_vec458[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNnewVisualStyle_arg */ static unsigned char arg_class_vec459[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNnoCellError_arg */ static unsigned char arg_class_vec460[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNnoMatchString_arg */ static unsigned char arg_class_vec461[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNnoResize_arg */ static unsigned char arg_class_vec462[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNnodeCloseFolderPixmap_arg */ static unsigned char arg_class_vec463[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNnodeOpenFolderPixmap_arg */ static unsigned char arg_class_vec464[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNnodeState_arg */ static unsigned char arg_class_vec465[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNnotebookChildType_arg */ static unsigned char arg_class_vec466[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNnumColumns_arg */ static unsigned char arg_class_vec467[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNnumRows_arg */ static unsigned char arg_class_vec468[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNnumStacks_arg */ static unsigned char arg_class_vec469[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNnumValues_arg */ static unsigned char arg_class_vec470[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNoffsetModel_arg */ static unsigned char arg_class_vec471[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTab_object) | 0, 0, 0}; /* sym_k_XmNokLabelString_arg */ static unsigned char arg_class_vec472[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNopenClosePadding_arg */ static unsigned char arg_class_vec473[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNopenFolderPixmap_arg */ static unsigned char arg_class_vec474[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNoptionString_arg */ static unsigned char arg_class_vec475[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNorientation_arg */ static unsigned char arg_class_vec476[] = { 0, _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmTabBox_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNotherString_arg */ static unsigned char arg_class_vec477[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNoutlineButtonPolicy_arg */ static unsigned char arg_class_vec478[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNoutlineColumnWidth_arg */ static unsigned char arg_class_vec479[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNoutlineIndentation_arg */ static unsigned char arg_class_vec480[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNoutlineLineStyle_arg */ static unsigned char arg_class_vec481[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNoutlineState_arg */ static unsigned char arg_class_vec482[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNoverrideRedirect_arg */ static unsigned char arg_class_vec483[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNpacking_arg */ static unsigned char arg_class_vec484[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNpageIncrement_arg */ static unsigned char arg_class_vec485[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNpageNumber_arg */ static unsigned char arg_class_vec486[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpaneMaximum_arg */ static unsigned char arg_class_vec487[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpaneMinimum_arg */ static unsigned char arg_class_vec488[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNparentNode_arg */ static unsigned char arg_class_vec489[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNpattern_arg */ static unsigned char arg_class_vec490[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpendingDelete_arg */ static unsigned char arg_class_vec491[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNpicture_arg */ static unsigned char arg_class_vec492[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpixmap_arg */ static unsigned char arg_class_vec493[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpixmapDepth_arg */ static unsigned char arg_class_vec494[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpixmapHeight_arg */ static unsigned char arg_class_vec495[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpixmapPlacement_arg */ static unsigned char arg_class_vec496[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNpixmapTextPadding_arg */ static unsigned char arg_class_vec497[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNpixmapWidth_arg */ static unsigned char arg_class_vec498[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpopupCursor_arg */ static unsigned char arg_class_vec499[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpopupEnabled_arg */ static unsigned char arg_class_vec500[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNpopupOffset_arg */ static unsigned char arg_class_vec501[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpopupShellWidget_arg */ static unsigned char arg_class_vec502[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNposition_arg */ static unsigned char arg_class_vec503[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNpositionIndex_arg */ static unsigned char arg_class_vec504[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNpositionMode_arg */ static unsigned char arg_class_vec505[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpositionType_arg */ static unsigned char arg_class_vec506[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNpreeditType_arg */ static unsigned char arg_class_vec507[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNpreferredPaneSize_arg */ static unsigned char arg_class_vec508[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNprimaryOwnership_arg */ static unsigned char arg_class_vec509[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNprocessingDirection_arg */ static unsigned char arg_class_vec510[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNpromptString_arg */ static unsigned char arg_class_vec511[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpropSpaceString_arg */ static unsigned char arg_class_vec512[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpushButtonEnabled_arg */ static unsigned char arg_class_vec513[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNqualifySearchDataProc_arg */ static unsigned char arg_class_vec514[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNradioAlwaysOne_arg */ static unsigned char arg_class_vec515[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNradioBehavior_arg */ static unsigned char arg_class_vec516[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNrecomputeSize_arg */ static unsigned char arg_class_vec517[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNredSliderLabel_arg */ static unsigned char arg_class_vec518[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNrefigureMode_arg */ static unsigned char arg_class_vec519[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNrenderTable_arg */ static unsigned char arg_class_vec520[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNrenditionBackground_arg */ static unsigned char arg_class_vec521[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNrenditionForeground_arg */ static unsigned char arg_class_vec522[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNrepeatDelay_arg */ static unsigned char arg_class_vec523[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNresizable_arg */ static unsigned char arg_class_vec524[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNresizeHeight_arg */ static unsigned char arg_class_vec525[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNresizePolicy_arg */ static unsigned char arg_class_vec526[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNresizeToPreferred_arg */ static unsigned char arg_class_vec527[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNresizeWidth_arg */ static unsigned char arg_class_vec528[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNrgbFile_arg */ static unsigned char arg_class_vec529[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNrightAttachment_arg */ static unsigned char arg_class_vec530[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNrightOffset_arg */ static unsigned char arg_class_vec531[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNrightPosition_arg */ static unsigned char arg_class_vec532[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNrightWidget_arg */ static unsigned char arg_class_vec533[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNrowColumnType_arg */ static unsigned char arg_class_vec534[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNrows_arg */ static unsigned char arg_class_vec535[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNrubberPositioning_arg */ static unsigned char arg_class_vec536[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsampleText_arg */ static unsigned char arg_class_vec537[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsashHeight_arg */ static unsigned char arg_class_vec538[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsashIndent_arg */ static unsigned char arg_class_vec539[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsashShadowThickness_arg */ static unsigned char arg_class_vec540[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsashTranslations_arg */ static unsigned char arg_class_vec541[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsashWidth_arg */ static unsigned char arg_class_vec542[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsaveUnder_arg */ static unsigned char arg_class_vec543[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNscaleHeight_arg */ static unsigned char arg_class_vec544[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNscaleMultiple_arg */ static unsigned char arg_class_vec545[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNscaleWidth_arg */ static unsigned char arg_class_vec546[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNscalingString_arg */ static unsigned char arg_class_vec547[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNscreen_arg */ static unsigned char arg_class_vec548[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNscrollBarDisplayPolicy_arg */ static unsigned char arg_class_vec549[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNscrollBarPlacement_arg */ static unsigned char arg_class_vec550[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNscrollHorizontal_arg */ static unsigned char arg_class_vec551[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, 0, 0}; /* sym_k_XmNscrollLeftSide_arg */ static unsigned char arg_class_vec552[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, 0, 0}; /* sym_k_XmNscrollTopSide_arg */ static unsigned char arg_class_vec553[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, 0, 0}; /* sym_k_XmNscrollVertical_arg */ static unsigned char arg_class_vec554[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, 0, 0}; /* sym_k_XmNscrolledWindowChildType_arg */ static unsigned char arg_class_vec555[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNscrolledWindowMarginHeight_arg */ static unsigned char arg_class_vec556[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNscrolledWindowMarginWidth_arg */ static unsigned char arg_class_vec557[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNscrollingPolicy_arg */ static unsigned char arg_class_vec558[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNselectColor_arg */ static unsigned char arg_class_vec559[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNselectInsensitivePixmap_arg */ static unsigned char arg_class_vec560[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNselectPixmap_arg */ static unsigned char arg_class_vec561[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNselectThreshold_arg */ static unsigned char arg_class_vec562[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNselectedColumn_arg */ static unsigned char arg_class_vec563[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNselectedItem_arg */ static unsigned char arg_class_vec564[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNselectedItemCount_arg */ static unsigned char arg_class_vec565[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNselectedItems_arg */ static unsigned char arg_class_vec566[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNselectedPosition_arg */ static unsigned char arg_class_vec567[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNselectedPositionCount_arg */ static unsigned char arg_class_vec568[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNselectedPositions_arg */ static unsigned char arg_class_vec569[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNselectionArray_arg */ static unsigned char arg_class_vec570[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNselectionArrayCount_arg */ static unsigned char arg_class_vec571[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNselectionLabelString_arg */ static unsigned char arg_class_vec572[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNselectionMode_arg */ static unsigned char arg_class_vec573[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNselectionPolicy_arg */ static unsigned char arg_class_vec574[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNselectionTechnique_arg */ static unsigned char arg_class_vec575[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsensitive_arg */ static unsigned char arg_class_vec576[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNseparatorOn_arg */ static unsigned char arg_class_vec577[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNseparatorType_arg */ static unsigned char arg_class_vec578[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNset_arg */ static unsigned char arg_class_vec579[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNshadowThickness_arg */ static unsigned char arg_class_vec580[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNshadowType_arg */ static unsigned char arg_class_vec581[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNshellUnitType_arg */ static unsigned char arg_class_vec582[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNshowArrows_arg */ static unsigned char arg_class_vec583[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNshowAsDefault_arg */ static unsigned char arg_class_vec584[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, 0, 0}; /* sym_k_XmNshowEntryLabel_arg */ static unsigned char arg_class_vec585[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNshowFind_arg */ static unsigned char arg_class_vec586[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNshowFontName_arg */ static unsigned char arg_class_vec587[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNshowLabel_arg */ static unsigned char arg_class_vec588[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNshowNameString_arg */ static unsigned char arg_class_vec589[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNshowSash_arg */ static unsigned char arg_class_vec590[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNshowSeparator_arg */ static unsigned char arg_class_vec591[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNshowValue_arg */ static unsigned char arg_class_vec592[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNsizeString_arg */ static unsigned char arg_class_vec593[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNskipAdjust_arg */ static unsigned char arg_class_vec594[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsliderMark_arg */ static unsigned char arg_class_vec595[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNsliderSize_arg */ static unsigned char arg_class_vec596[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNsliderTogLabel_arg */ static unsigned char arg_class_vec597[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsliderVisual_arg */ static unsigned char arg_class_vec598[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNslidingMode_arg */ static unsigned char arg_class_vec599[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNsmallCellHeight_arg */ static unsigned char arg_class_vec600[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsmallCellWidth_arg */ static unsigned char arg_class_vec601[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsmallIconMask_arg */ static unsigned char arg_class_vec602[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsmallIconPixmap_arg */ static unsigned char arg_class_vec603[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsmallIconX_arg */ static unsigned char arg_class_vec604[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsmallIconY_arg */ static unsigned char arg_class_vec605[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsnapBackMultiple_arg */ static unsigned char arg_class_vec606[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNsortFunctions_arg */ static unsigned char arg_class_vec607[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsource_arg */ static unsigned char arg_class_vec608[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | 0, 0}; /* sym_k_XmNspacing_arg */ static unsigned char arg_class_vec609[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNspatialIncludeModel_arg */ static unsigned char arg_class_vec610[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNspatialResizeModel_arg */ static unsigned char arg_class_vec611[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNspatialSnapModel_arg */ static unsigned char arg_class_vec612[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNspatialStyle_arg */ static unsigned char arg_class_vec613[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNspinBoxChildType_arg */ static unsigned char arg_class_vec614[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNstackedEffect_arg */ static unsigned char arg_class_vec615[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNstretchable_arg */ static unsigned char arg_class_vec616[] = { 0, 0, _BIT_MASK(sym_k_XmColumn_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNstrikethruType_arg */ static unsigned char arg_class_vec617[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNstringDirection_arg */ static unsigned char arg_class_vec618[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNsubMenuId_arg */ static unsigned char arg_class_vec619[] = { 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNsymbolPixmap_arg */ static unsigned char arg_class_vec620[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtabAlignment_arg */ static unsigned char arg_class_vec621[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabAutoSelect_arg */ static unsigned char arg_class_vec622[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabBackground_arg */ static unsigned char arg_class_vec623[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabBackgroundPixmap_arg */ static unsigned char arg_class_vec624[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabCornerPercent_arg */ static unsigned char arg_class_vec625[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabEdge_arg */ static unsigned char arg_class_vec626[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | 0, 0, 0}; /* sym_k_XmNtabForeground_arg */ static unsigned char arg_class_vec627[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabLabelPixmap_arg */ static unsigned char arg_class_vec628[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabLabelSpacing_arg */ static unsigned char arg_class_vec629[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabLabelString_arg */ static unsigned char arg_class_vec630[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabList_arg */ static unsigned char arg_class_vec631[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | 0, 0, 0}; /* sym_k_XmNtabMarginHeight_arg */ static unsigned char arg_class_vec632[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabMarginWidth_arg */ static unsigned char arg_class_vec633[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabMode_arg */ static unsigned char arg_class_vec634[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabOffset_arg */ static unsigned char arg_class_vec635[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabOrientation_arg */ static unsigned char arg_class_vec636[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabPixmapPlacement_arg */ static unsigned char arg_class_vec637[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabSelectColor_arg */ static unsigned char arg_class_vec638[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabSelectPixmap_arg */ static unsigned char arg_class_vec639[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabSide_arg */ static unsigned char arg_class_vec640[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabStringDirection_arg */ static unsigned char arg_class_vec641[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabStyle_arg */ static unsigned char arg_class_vec642[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtabValue_arg */ static unsigned char arg_class_vec643[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTab_object) | 0, 0, 0}; /* sym_k_XmNtearOffModel_arg */ static unsigned char arg_class_vec644[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNtearOffTitle_arg */ static unsigned char arg_class_vec645[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNtextAccelerators_arg */ static unsigned char arg_class_vec646[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNtextColumns_arg */ static unsigned char arg_class_vec647[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNtextField_arg */ static unsigned char arg_class_vec648[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | 0, 0, 0}; /* sym_k_XmNtextFontList_arg */ static unsigned char arg_class_vec649[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtextRenderTable_arg */ static unsigned char arg_class_vec650[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtextRows_arg */ static unsigned char arg_class_vec651[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNtextString_arg */ static unsigned char arg_class_vec652[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNtextTranslations_arg */ static unsigned char arg_class_vec653[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtitle_arg */ static unsigned char arg_class_vec654[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtitleEncoding_arg */ static unsigned char arg_class_vec655[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtitleString_arg */ static unsigned char arg_class_vec656[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNtoggleMode_arg */ static unsigned char arg_class_vec657[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNtoolTipEnable_arg */ static unsigned char arg_class_vec658[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtoolTipPostDelay_arg */ static unsigned char arg_class_vec659[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtoolTipPostDuration_arg */ static unsigned char arg_class_vec660[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtoolTipString_arg */ static unsigned char arg_class_vec661[] = { _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNtopAttachment_arg */ static unsigned char arg_class_vec662[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNtopCharacter_arg */ static unsigned char arg_class_vec663[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | 0, 0}; /* sym_k_XmNtopItemPosition_arg */ static unsigned char arg_class_vec664[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNtopOffset_arg */ static unsigned char arg_class_vec665[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNtopPosition_arg */ static unsigned char arg_class_vec666[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNtopShadowColor_arg */ static unsigned char arg_class_vec667[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtopShadowPixmap_arg */ static unsigned char arg_class_vec668[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtopWidget_arg */ static unsigned char arg_class_vec669[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNtransient_arg */ static unsigned char arg_class_vec670[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtransientFor_arg */ static unsigned char arg_class_vec671[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtranslations_arg */ static unsigned char arg_class_vec672[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtraversalOn_arg */ static unsigned char arg_class_vec673[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNtroughColor_arg */ static unsigned char arg_class_vec674[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNunderlineType_arg */ static unsigned char arg_class_vec675[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmNuniformTabSize_arg */ static unsigned char arg_class_vec676[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNunitType_arg */ static unsigned char arg_class_vec677[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTab_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNunpostBehavior_arg */ static unsigned char arg_class_vec678[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNunselectColor_arg */ static unsigned char arg_class_vec679[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNuseAsyncGeometry_arg */ static unsigned char arg_class_vec680[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNuseImageCache_arg */ static unsigned char arg_class_vec681[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNuseScaling_arg */ static unsigned char arg_class_vec682[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNuseTextField_arg */ static unsigned char arg_class_vec683[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNuserData_arg */ static unsigned char arg_class_vec684[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNvalue_arg */ static unsigned char arg_class_vec685[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNvalueWcs_arg */ static unsigned char arg_class_vec686[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNvalues_arg */ static unsigned char arg_class_vec687[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, 0, 0}; /* sym_k_XmNverify_arg */ static unsigned char arg_class_vec688[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNverifyBell_arg */ static unsigned char arg_class_vec689[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNverticalDelta_arg */ static unsigned char arg_class_vec690[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNverticalMargin_arg */ static unsigned char arg_class_vec691[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNverticalNodeSpace_arg */ static unsigned char arg_class_vec692[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNverticalScrollBar_arg */ static unsigned char arg_class_vec693[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNverticalSpacing_arg */ static unsigned char arg_class_vec694[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNviewType_arg */ static unsigned char arg_class_vec695[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNvisibleItemCount_arg */ static unsigned char arg_class_vec696[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNvisibleWhenOff_arg */ static unsigned char arg_class_vec697[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNvisual_arg */ static unsigned char arg_class_vec698[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNvisualEmphasis_arg */ static unsigned char arg_class_vec699[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNvisualPolicy_arg */ static unsigned char arg_class_vec700[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNwaitForWm_arg */ static unsigned char arg_class_vec701[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNwhichButton_arg */ static unsigned char arg_class_vec702[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNwidth_arg */ static unsigned char arg_class_vec703[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNwidthInc_arg */ static unsigned char arg_class_vec704[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNwinGravity_arg */ static unsigned char arg_class_vec705[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNwindowGroup_arg */ static unsigned char arg_class_vec706[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNwmTimeout_arg */ static unsigned char arg_class_vec707[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNwordWrap_arg */ static unsigned char arg_class_vec708[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNworkWindow_arg */ static unsigned char arg_class_vec709[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNwrap_arg */ static unsigned char arg_class_vec710[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNx_arg */ static unsigned char arg_class_vec711[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNxlfdString_arg */ static unsigned char arg_class_vec712[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNy_arg */ static unsigned char arg_class_vec713[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmStringComponent_arg */ static unsigned char arg_class_vec714[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* * Table of bit vectors accessed by sym_k_..._arg */ static unsigned char *allowed_argument_table_vec[] = { NULL, /* UNUSED */ arg_class_vec1, arg_class_vec2, arg_class_vec3, arg_class_vec4, arg_class_vec5, arg_class_vec6, arg_class_vec7, arg_class_vec8, arg_class_vec9, arg_class_vec10, arg_class_vec11, arg_class_vec12, arg_class_vec13, arg_class_vec14, arg_class_vec15, arg_class_vec16, arg_class_vec17, arg_class_vec18, arg_class_vec19, arg_class_vec20, arg_class_vec21, arg_class_vec22, arg_class_vec23, arg_class_vec24, arg_class_vec25, arg_class_vec26, arg_class_vec27, arg_class_vec28, arg_class_vec29, arg_class_vec30, arg_class_vec31, arg_class_vec32, arg_class_vec33, arg_class_vec34, arg_class_vec35, arg_class_vec36, arg_class_vec37, arg_class_vec38, arg_class_vec39, arg_class_vec40, arg_class_vec41, arg_class_vec42, arg_class_vec43, arg_class_vec44, arg_class_vec45, arg_class_vec46, arg_class_vec47, arg_class_vec48, arg_class_vec49, arg_class_vec50, arg_class_vec51, arg_class_vec52, arg_class_vec53, arg_class_vec54, arg_class_vec55, arg_class_vec56, arg_class_vec57, arg_class_vec58, arg_class_vec59, arg_class_vec60, arg_class_vec61, arg_class_vec62, arg_class_vec63, arg_class_vec64, arg_class_vec65, arg_class_vec66, arg_class_vec67, arg_class_vec68, arg_class_vec69, arg_class_vec70, arg_class_vec71, arg_class_vec72, arg_class_vec73, arg_class_vec74, arg_class_vec75, arg_class_vec76, arg_class_vec77, arg_class_vec78, arg_class_vec79, arg_class_vec80, arg_class_vec81, arg_class_vec82, arg_class_vec83, arg_class_vec84, arg_class_vec85, arg_class_vec86, arg_class_vec87, arg_class_vec88, arg_class_vec89, arg_class_vec90, arg_class_vec91, arg_class_vec92, arg_class_vec93, arg_class_vec94, arg_class_vec95, arg_class_vec96, arg_class_vec97, arg_class_vec98, arg_class_vec99, arg_class_vec100, arg_class_vec101, arg_class_vec102, arg_class_vec103, arg_class_vec104, arg_class_vec105, arg_class_vec106, arg_class_vec107, arg_class_vec108, arg_class_vec109, arg_class_vec110, arg_class_vec111, arg_class_vec112, arg_class_vec113, arg_class_vec114, arg_class_vec115, arg_class_vec116, arg_class_vec117, arg_class_vec118, arg_class_vec119, arg_class_vec120, arg_class_vec121, arg_class_vec122, arg_class_vec123, arg_class_vec124, arg_class_vec125, arg_class_vec126, arg_class_vec127, arg_class_vec128, arg_class_vec129, arg_class_vec130, arg_class_vec131, arg_class_vec132, arg_class_vec133, arg_class_vec134, arg_class_vec135, arg_class_vec136, arg_class_vec137, arg_class_vec138, arg_class_vec139, arg_class_vec140, arg_class_vec141, arg_class_vec142, arg_class_vec143, arg_class_vec144, arg_class_vec145, arg_class_vec146, arg_class_vec147, arg_class_vec148, arg_class_vec149, arg_class_vec150, arg_class_vec151, arg_class_vec152, arg_class_vec153, arg_class_vec154, arg_class_vec155, arg_class_vec156, arg_class_vec157, arg_class_vec158, arg_class_vec159, arg_class_vec160, arg_class_vec161, arg_class_vec162, arg_class_vec163, arg_class_vec164, arg_class_vec165, arg_class_vec166, arg_class_vec167, arg_class_vec168, arg_class_vec169, arg_class_vec170, arg_class_vec171, arg_class_vec172, arg_class_vec173, arg_class_vec174, arg_class_vec175, arg_class_vec176, arg_class_vec177, arg_class_vec178, arg_class_vec179, arg_class_vec180, arg_class_vec181, arg_class_vec182, arg_class_vec183, arg_class_vec184, arg_class_vec185, arg_class_vec186, arg_class_vec187, arg_class_vec188, arg_class_vec189, arg_class_vec190, arg_class_vec191, arg_class_vec192, arg_class_vec193, arg_class_vec194, arg_class_vec195, arg_class_vec196, arg_class_vec197, arg_class_vec198, arg_class_vec199, arg_class_vec200, arg_class_vec201, arg_class_vec202, arg_class_vec203, arg_class_vec204, arg_class_vec205, arg_class_vec206, arg_class_vec207, arg_class_vec208, arg_class_vec209, arg_class_vec210, arg_class_vec211, arg_class_vec212, arg_class_vec213, arg_class_vec214, arg_class_vec215, arg_class_vec216, arg_class_vec217, arg_class_vec218, arg_class_vec219, arg_class_vec220, arg_class_vec221, arg_class_vec222, arg_class_vec223, arg_class_vec224, arg_class_vec225, arg_class_vec226, arg_class_vec227, arg_class_vec228, arg_class_vec229, arg_class_vec230, arg_class_vec231, arg_class_vec232, arg_class_vec233, arg_class_vec234, arg_class_vec235, arg_class_vec236, arg_class_vec237, arg_class_vec238, arg_class_vec239, arg_class_vec240, arg_class_vec241, arg_class_vec242, arg_class_vec243, arg_class_vec244, arg_class_vec245, arg_class_vec246, arg_class_vec247, arg_class_vec248, arg_class_vec249, arg_class_vec250, arg_class_vec251, arg_class_vec252, arg_class_vec253, arg_class_vec254, arg_class_vec255, arg_class_vec256, arg_class_vec257, arg_class_vec258, arg_class_vec259, arg_class_vec260, arg_class_vec261, arg_class_vec262, arg_class_vec263, arg_class_vec264, arg_class_vec265, arg_class_vec266, arg_class_vec267, arg_class_vec268, arg_class_vec269, arg_class_vec270, arg_class_vec271, arg_class_vec272, arg_class_vec273, arg_class_vec274, arg_class_vec275, arg_class_vec276, arg_class_vec277, arg_class_vec278, arg_class_vec279, arg_class_vec280, arg_class_vec281, arg_class_vec282, arg_class_vec283, arg_class_vec284, arg_class_vec285, arg_class_vec286, arg_class_vec287, arg_class_vec288, arg_class_vec289, arg_class_vec290, arg_class_vec291, arg_class_vec292, arg_class_vec293, arg_class_vec294, arg_class_vec295, arg_class_vec296, arg_class_vec297, arg_class_vec298, arg_class_vec299, arg_class_vec300, arg_class_vec301, arg_class_vec302, arg_class_vec303, arg_class_vec304, arg_class_vec305, arg_class_vec306, arg_class_vec307, arg_class_vec308, arg_class_vec309, arg_class_vec310, arg_class_vec311, arg_class_vec312, arg_class_vec313, arg_class_vec314, arg_class_vec315, arg_class_vec316, arg_class_vec317, arg_class_vec318, arg_class_vec319, arg_class_vec320, arg_class_vec321, arg_class_vec322, arg_class_vec323, arg_class_vec324, arg_class_vec325, arg_class_vec326, arg_class_vec327, arg_class_vec328, arg_class_vec329, arg_class_vec330, arg_class_vec331, arg_class_vec332, arg_class_vec333, arg_class_vec334, arg_class_vec335, arg_class_vec336, arg_class_vec337, arg_class_vec338, arg_class_vec339, arg_class_vec340, arg_class_vec341, arg_class_vec342, arg_class_vec343, arg_class_vec344, arg_class_vec345, arg_class_vec346, arg_class_vec347, arg_class_vec348, arg_class_vec349, arg_class_vec350, arg_class_vec351, arg_class_vec352, arg_class_vec353, arg_class_vec354, arg_class_vec355, arg_class_vec356, arg_class_vec357, arg_class_vec358, arg_class_vec359, arg_class_vec360, arg_class_vec361, arg_class_vec362, arg_class_vec363, arg_class_vec364, arg_class_vec365, arg_class_vec366, arg_class_vec367, arg_class_vec368, arg_class_vec369, arg_class_vec370, arg_class_vec371, arg_class_vec372, arg_class_vec373, arg_class_vec374, arg_class_vec375, arg_class_vec376, arg_class_vec377, arg_class_vec378, arg_class_vec379, arg_class_vec380, arg_class_vec381, arg_class_vec382, arg_class_vec383, arg_class_vec384, arg_class_vec385, arg_class_vec386, arg_class_vec387, arg_class_vec388, arg_class_vec389, arg_class_vec390, arg_class_vec391, arg_class_vec392, arg_class_vec393, arg_class_vec394, arg_class_vec395, arg_class_vec396, arg_class_vec397, arg_class_vec398, arg_class_vec399, arg_class_vec400, arg_class_vec401, arg_class_vec402, arg_class_vec403, arg_class_vec404, arg_class_vec405, arg_class_vec406, arg_class_vec407, arg_class_vec408, arg_class_vec409, arg_class_vec410, arg_class_vec411, arg_class_vec412, arg_class_vec413, arg_class_vec414, arg_class_vec415, arg_class_vec416, arg_class_vec417, arg_class_vec418, arg_class_vec419, arg_class_vec420, arg_class_vec421, arg_class_vec422, arg_class_vec423, arg_class_vec424, arg_class_vec425, arg_class_vec426, arg_class_vec427, arg_class_vec428, arg_class_vec429, arg_class_vec430, arg_class_vec431, arg_class_vec432, arg_class_vec433, arg_class_vec434, arg_class_vec435, arg_class_vec436, arg_class_vec437, arg_class_vec438, arg_class_vec439, arg_class_vec440, arg_class_vec441, arg_class_vec442, arg_class_vec443, arg_class_vec444, arg_class_vec445, arg_class_vec446, arg_class_vec447, arg_class_vec448, arg_class_vec449, arg_class_vec450, arg_class_vec451, arg_class_vec452, arg_class_vec453, arg_class_vec454, arg_class_vec455, arg_class_vec456, arg_class_vec457, arg_class_vec458, arg_class_vec459, arg_class_vec460, arg_class_vec461, arg_class_vec462, arg_class_vec463, arg_class_vec464, arg_class_vec465, arg_class_vec466, arg_class_vec467, arg_class_vec468, arg_class_vec469, arg_class_vec470, arg_class_vec471, arg_class_vec472, arg_class_vec473, arg_class_vec474, arg_class_vec475, arg_class_vec476, arg_class_vec477, arg_class_vec478, arg_class_vec479, arg_class_vec480, arg_class_vec481, arg_class_vec482, arg_class_vec483, arg_class_vec484, arg_class_vec485, arg_class_vec486, arg_class_vec487, arg_class_vec488, arg_class_vec489, arg_class_vec490, arg_class_vec491, arg_class_vec492, arg_class_vec493, arg_class_vec494, arg_class_vec495, arg_class_vec496, arg_class_vec497, arg_class_vec498, arg_class_vec499, arg_class_vec500, arg_class_vec501, arg_class_vec502, arg_class_vec503, arg_class_vec504, arg_class_vec505, arg_class_vec506, arg_class_vec507, arg_class_vec508, arg_class_vec509, arg_class_vec510, arg_class_vec511, arg_class_vec512, arg_class_vec513, arg_class_vec514, arg_class_vec515, arg_class_vec516, arg_class_vec517, arg_class_vec518, arg_class_vec519, arg_class_vec520, arg_class_vec521, arg_class_vec522, arg_class_vec523, arg_class_vec524, arg_class_vec525, arg_class_vec526, arg_class_vec527, arg_class_vec528, arg_class_vec529, arg_class_vec530, arg_class_vec531, arg_class_vec532, arg_class_vec533, arg_class_vec534, arg_class_vec535, arg_class_vec536, arg_class_vec537, arg_class_vec538, arg_class_vec539, arg_class_vec540, arg_class_vec541, arg_class_vec542, arg_class_vec543, arg_class_vec544, arg_class_vec545, arg_class_vec546, arg_class_vec547, arg_class_vec548, arg_class_vec549, arg_class_vec550, arg_class_vec551, arg_class_vec552, arg_class_vec553, arg_class_vec554, arg_class_vec555, arg_class_vec556, arg_class_vec557, arg_class_vec558, arg_class_vec559, arg_class_vec560, arg_class_vec561, arg_class_vec562, arg_class_vec563, arg_class_vec564, arg_class_vec565, arg_class_vec566, arg_class_vec567, arg_class_vec568, arg_class_vec569, arg_class_vec570, arg_class_vec571, arg_class_vec572, arg_class_vec573, arg_class_vec574, arg_class_vec575, arg_class_vec576, arg_class_vec577, arg_class_vec578, arg_class_vec579, arg_class_vec580, arg_class_vec581, arg_class_vec582, arg_class_vec583, arg_class_vec584, arg_class_vec585, arg_class_vec586, arg_class_vec587, arg_class_vec588, arg_class_vec589, arg_class_vec590, arg_class_vec591, arg_class_vec592, arg_class_vec593, arg_class_vec594, arg_class_vec595, arg_class_vec596, arg_class_vec597, arg_class_vec598, arg_class_vec599, arg_class_vec600, arg_class_vec601, arg_class_vec602, arg_class_vec603, arg_class_vec604, arg_class_vec605, arg_class_vec606, arg_class_vec607, arg_class_vec608, arg_class_vec609, arg_class_vec610, arg_class_vec611, arg_class_vec612, arg_class_vec613, arg_class_vec614, arg_class_vec615, arg_class_vec616, arg_class_vec617, arg_class_vec618, arg_class_vec619, arg_class_vec620, arg_class_vec621, arg_class_vec622, arg_class_vec623, arg_class_vec624, arg_class_vec625, arg_class_vec626, arg_class_vec627, arg_class_vec628, arg_class_vec629, arg_class_vec630, arg_class_vec631, arg_class_vec632, arg_class_vec633, arg_class_vec634, arg_class_vec635, arg_class_vec636, arg_class_vec637, arg_class_vec638, arg_class_vec639, arg_class_vec640, arg_class_vec641, arg_class_vec642, arg_class_vec643, arg_class_vec644, arg_class_vec645, arg_class_vec646, arg_class_vec647, arg_class_vec648, arg_class_vec649, arg_class_vec650, arg_class_vec651, arg_class_vec652, arg_class_vec653, arg_class_vec654, arg_class_vec655, arg_class_vec656, arg_class_vec657, arg_class_vec658, arg_class_vec659, arg_class_vec660, arg_class_vec661, arg_class_vec662, arg_class_vec663, arg_class_vec664, arg_class_vec665, arg_class_vec666, arg_class_vec667, arg_class_vec668, arg_class_vec669, arg_class_vec670, arg_class_vec671, arg_class_vec672, arg_class_vec673, arg_class_vec674, arg_class_vec675, arg_class_vec676, arg_class_vec677, arg_class_vec678, arg_class_vec679, arg_class_vec680, arg_class_vec681, arg_class_vec682, arg_class_vec683, arg_class_vec684, arg_class_vec685, arg_class_vec686, arg_class_vec687, arg_class_vec688, arg_class_vec689, arg_class_vec690, arg_class_vec691, arg_class_vec692, arg_class_vec693, arg_class_vec694, arg_class_vec695, arg_class_vec696, arg_class_vec697, arg_class_vec698, arg_class_vec699, arg_class_vec700, arg_class_vec701, arg_class_vec702, arg_class_vec703, arg_class_vec704, arg_class_vec705, arg_class_vec706, arg_class_vec707, arg_class_vec708, arg_class_vec709, arg_class_vec710, arg_class_vec711, arg_class_vec712, arg_class_vec713, arg_class_vec714, }; externaldef(uil_sym_glbl) unsigned char **allowed_argument_table = allowed_argument_table_vec; motif-2.3.8/tools/wml/UilUrmClas.h0000644000175000017500000005267413211513006013721 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* Define mapping of UIL widget types to convenience functions. */ static char *uil_widget_funcs_vec[] = { "", /* NOT USED */ "DtCreateEditor", "DtCreateHelpDialog", "DtCreateHelpQuickDialog", "DtCreateMenuButton", "DtCreatePrintSetupBox", "DtCreatePrintSetupDialog", "DtCreateTerm", "DtCreateTermPrimitive", "XmCreateArrowButton", "XmCreateArrowButtonGadget", "XmCreateBulletinBoard", "XmCreateBulletinBoardDialog", "XmCreateButtonBox", "XmCreateCascadeButton", "XmCreateCascadeButtonGadget", "XmCreateSimpleCheckBox", "XmCreateColorSelector", "XmCreateColumn", "XmCreateComboBox", "XmCreateCommand", "XmCreateCommandDialog", "XmCreateContainer", "XmCreateDataField", "XmCreateDialogShell", "XmCreateDrawingArea", "XmCreateDrawnButton", "XmCreateDropDown", "XmCreateErrorDialog", "XmCreateFileSelectionBox", "XmCreateFileSelectionDialog", "XmCreateFontSelector", "XmCreateForm", "XmCreateFormDialog", "XmCreateFrame", "XmCreateIconBox", "XmCreateIconButton", "XmCreateIconGadget", "XmCreateInformationDialog", "XmCreateLabel", "XmCreateLabelGadget", "XmCreateList", "XmCreateMainWindow", "XmCreateMenuBar", "XmCreateMenuShell", "XmCreateMessageBox", "XmCreateMessageDialog", "XmCreateMultiList", "XmCreateNotebook", "XmCreateOptionMenu", "XmCreateOutline", "XmCreatePaned", "XmCreatePanedWindow", "XmCreatePopupMenu", "XmCreatePromptDialog", "XmCreatePulldownMenu", "XmCreatePushButton", "XmCreatePushButtonGadget", "XmCreateQuestionDialog", "XmCreateRadioBox", "_XmCreateRenderTable", "_XmCreateRendition", "XmCreateRowColumn", "XmCreateScale", "XmCreateScrollBar", "XmCreateScrolledList", "XmCreateScrolledText", "XmCreateScrolledWindow", "XmCreateSelectionBox", "XmCreateSelectionDialog", "XmCreateSeparator", "XmCreateSeparatorGadget", "XmCreateSimpleSpinBox", "XmCreateSpinBox", "_XmCreateTab", "XmCreateTabBox", "_XmCreateTabList", "XmCreateTabStack", "", "XmCreateTemplateDialog", "XmCreateText", "XmCreateTextField", "XmCreateToggleButton", "XmCreateToggleButtonGadget", "XmCreateTree", "XmCreateWarningDialog", "XmCreateWorkArea", "XmCreateWorkingDialog", "user_defined", }; externaldef(uil_sym_glbl) char **uil_widget_funcs = uil_widget_funcs_vec; /* Define mapping of UIL widget classes to matching gadget class. */ static unsigned short int uil_gadget_variants_vec[] = { 0, /* NOT USED */ 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmArrowButtonGadget_object, 0, 0, 0, 0, sym_k_XmCascadeButtonGadget_object, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmLabelGadget_object, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmPushButtonGadget_object, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmSeparatorGadget_object, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmToggleButtonGadget_object, 0, 0, 0, 0, 0, 0, }; externaldef(uil_sym_glbl) unsigned short int *uil_gadget_variants = uil_gadget_variants_vec; /* Define mapping of dialog types to non-dialog URM widget classes. */ static unsigned short int uil_urm_nondialog_class_vec[] = { 0, /* NOT USED */ 0, sym_k_XmBulletinBoard_object, sym_k_XmBulletinBoard_object, 0, 0, sym_k_DtPrintSetupBox_object, 0, 0, 0, 0, 0, sym_k_XmBulletinBoard_object, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmCommand_object, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmFileSelectionBox_object, 0, 0, sym_k_XmForm_object, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmScrolledWindow_object, 0, 0, 0, sym_k_XmMessageBox_object, 0, 0, 0, 0, 0, 0, sym_k_XmRowColumn_object, sym_k_XmSelectionBox_object, sym_k_XmRowColumn_object, 0, 0, sym_k_XmMessageBox_object, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmSelectionBox_object, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmMessageBox_object, 0, 0, 0, 0, 0, sym_k_XmMessageBox_object, 0, sym_k_XmMessageBox_object, 0, }; externaldef(uil_sym_glbl) unsigned short int *uil_urm_nondialog_class = uil_urm_nondialog_class_vec; /* Define mapping of widget controls to a (subtree) resource. */ static unsigned short int uil_urm_subtree_resource_vec[] = { 0, /* NOT USED */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmNsubMenuId_arg, sym_k_XmNsubMenuId_arg, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, sym_k_XmNsubMenuId_arg, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; externaldef(uil_sym_glbl) unsigned short int *uil_urm_subtree_resource = uil_urm_subtree_resource_vec; /* Define mapping of arguments to toolkit names. */ static char *uil_argument_toolkit_names_vec[] = { "", /* NOT USED */ DtNallowSendEvents, DtNappCursorDefault, DtNappKeypadDefault, DtNautoShowCursorPosition, DtNautoWrap, DtNbackLabelString, DtNbackgroundIsSelect, DtNbaseHeight, DtNbaseWidth, DtNblinkRate, DtNbuttonFontList, DtNc132, DtNcascadePixmap, DtNcenterToggleLabel, DtNchangeAllButtonLabel, DtNchangeButtonLabel, DtNchangeFieldLabel, DtNcharCursorStyle, DtNcloseLabelString, DtNcolumns, DtNconsoleMode, DtNcopies, DtNcsWidth, DtNcurrentLineLabel, DtNcursorPosition, DtNcursorPositionVisible, DtNdescription, DtNdialogTitle, DtNeditable, DtNemulationId, DtNexecutionPolicy, DtNfileName, DtNfindButtonLabel, DtNfindChangeDialogTitle, DtNfindFieldLabel, DtNformatAllButtonLabel, DtNformatParagraphButtonLabel, DtNformatSettingsDialogTitle, DtNheightInc, DtNhelpFile, DtNhelpLabelString, DtNhelpOnHelpVolume, DtNhelpPrint, DtNhelpType, DtNhelpVolume, DtNinformationDialogTitle, DtNinsertLabel, DtNjumpScroll, DtNjustifyToggleLabel, DtNkshMode, DtNlabelFontList, DtNleftAlignToggleLabel, DtNleftMarginFieldLabel, DtNlocationId, DtNlogFile, DtNlogInhibit, DtNlogging, DtNmanPage, DtNmapOnOutput, DtNmapOnOutputDelay, DtNmarginBell, DtNmarginHeight, DtNmarginWidth, DtNmaxLength, DtNminimizeButtons, DtNmisspelledListLabel, DtNmoreLabelString, DtNnMarginBell, DtNoverstrike, DtNoverstrikeLabel, DtNpaperSize, DtNpointerBlank, DtNpointerBlankDelay, DtNpointerColor, DtNpointerColorBackground, DtNpointerShape, DtNprintDestination, DtNprintLabelString, DtNprintSetupMode, DtNprinter, DtNprinterInfoProc, DtNprinterName, DtNreverseVideo, DtNreverseWrap, DtNrightAlignToggleLabel, DtNrightMarginFieldLabel, DtNrows, DtNsaveLines, DtNscrollBarPolicy, DtNscrollHorizontal, DtNscrollLeftSide, DtNscrollTopSide, DtNscrollVertical, DtNselectFileProc, DtNselectPrinterProc, DtNshadowType, DtNshowNewWindowButton, DtNshowStatusLine, DtNspellDialogTitle, DtNspellFilter, DtNstickyNextCursor, DtNstickyPrevCursor, DtNstringData, DtNsubMenuId, DtNsubprocessArgv, DtNsubprocessCmd, DtNsubprocessExec, DtNsubprocessLoginShell, DtNsubprocessPid, DtNsubprocessTerminationCatch, DtNsunFunctionKeys, DtNtermDevice, DtNtermDeviceAllocate, DtNtermId, DtNtermName, DtNtermSlaveName, DtNtextBackground, DtNtextFontList, DtNtextForeground, DtNtextTranslations, DtNtopCharacter, DtNtopicTitle, DtNtotalLineCountLabel, DtNttyModes, DtNuserBoldFont, DtNuserFont, DtNverifyPrinterProc, DtNverticalScrollBar, DtNvisiblePathCount, DtNvisualBell, DtNwidthInc, DtNwordWrap, DtNworkAreaLocation, XmN100DPIstring, XmN75DPIstring, XmNaccelerator, XmNacceleratorText, XmNaccelerators, XmNadjustLast, XmNadjustMargin, XmNalignment, XmNallowOverlap, XmNallowResize, XmNallowShellResize, XmNallowUnusedSpace, XmNancestorSensitive, XmNanyLowerString, XmNanyString, XmNapplyLabelString, XmNarmColor, XmNarmPixmap, XmNarrowDirection, XmNarrowLayout, XmNarrowOrientation, XmNarrowSensitivity, XmNarrowSize, XmNarrowSpacing, XmNaudibleWarning, XmNautoClose, XmNautoDragModel, XmNautoFill, XmNautoShowCursorPosition, XmNautoUnmanage, XmNautomaticSelection, XmNbackPageBackground, XmNbackPageForeground, XmNbackPageNumber, XmNbackPagePlacement, XmNbackPageSize, XmNbackground, XmNbackgroundPixmap, XmNbaseHeight, XmNbaseWidth, XmNbindingPixmap, XmNbindingType, XmNbindingWidth, XmNblinkRate, XmNblueSliderLabel, XmNboldString, XmNborderColor, XmNborderPixmap, XmNborderWidth, XmNbothString, XmNbottomAttachment, XmNbottomOffset, XmNbottomPosition, XmNbottomShadowColor, XmNbottomShadowPixmap, XmNbottomWidget, XmNbuttonCount, XmNbuttonFontList, XmNbuttonRenderTable, XmNbuttons, XmNcancelButton, XmNcancelLabelString, XmNcascadePixmap, XmNcellX, XmNcellY, XmNchildHorizontalAlignment, XmNchildHorizontalSpacing, XmNchildPlacement, XmNchildType, XmNchildVerticalAlignment, XmNclipWindow, XmNcloseFolderPixmap, XmNcollapsedStatePixmap, XmNcolorListTogLabel, XmNcolorMode, XmNcolorName, XmNcolormap, XmNcolumnTitles, XmNcolumns, XmNcomboBoxType, XmNcomboTranslations, XmNcommand, XmNcommandWindow, XmNcommandWindowLocation, XmNcompressStyle, XmNconnectNodes, XmNconnectStyle, XmNconstrainWidth, XmNcreatePopupChildProc, XmNcurrentFont, XmNcurrentPageNumber, XmNcursor, XmNcursorPosition, XmNcursorPositionVisible, XmNcustomizedCombinationBox, XmNdarkThreshold, XmNdecimal, XmNdecimalPoints, XmNdefaultArrowSensitivity, XmNdefaultButton, XmNdefaultButtonShadowThickness, XmNdefaultButtonType, XmNdefaultEncodingString, XmNdefaultEntryLabelAlignment, XmNdefaultEntryLabelFontList, XmNdefaultEntryLabelRenderTable, XmNdefaultFillStyle, XmNdefaultFontList, XmNdefaultPosition, XmNdeleteResponse, XmNdepth, XmNdetail, XmNdetailColumnHeading, XmNdetailColumnHeadingCount, XmNdetailCount, XmNdetailOrder, XmNdetailOrderCount, XmNdetailShadowThickness, XmNdetailTabList, XmNdialogStyle, XmNdialogTitle, XmNdialogType, XmNdirListItemCount, XmNdirListItems, XmNdirListLabelString, XmNdirMask, XmNdirSearchProc, XmNdirSpec, XmNdirectory, XmNdirectoryValid, XmNdistribution, XmNdoubleClickInterval, XmNeditMode, XmNeditable, XmNencodingList, XmNencodingString, XmNentryAlignment, XmNentryBackground, XmNentryBorder, XmNentryClass, XmNentryData, XmNentryLabelAlignment, XmNentryLabelFontList, XmNentryLabelPixmap, XmNentryLabelRenderTable, XmNentryLabelString, XmNentryLabelType, XmNentryParent, XmNentryVerticalAlignment, XmNentryViewType, XmNequalSize, XmNexpandedStatePixmap, XmNfamilyString, XmNfileListItemCount, XmNfileListItems, XmNfileListLabelString, XmNfileReadError, XmNfileSearchProc, XmNfileTypeMask, XmNfillOnArm, XmNfillOnSelect, XmNfillOption, XmNfillStyle, XmNfilterLabelString, XmNfindLabel, XmNfirstColumn, XmNfirstColumnPixmaps, XmNfirstPageNumber, XmNfirstRow, XmNfont, XmNfontEncoding, XmNfontFoundry, XmNfontList, XmNfontName, XmNfontSize, XmNfontStyle, XmNfontType, XmNforeground, XmNforegroundThreshold, XmNfractionBase, XmNframeBackground, XmNframeChildType, XmNframeShadowThickness, XmNfreeTabPixmap, XmNgeometry, XmNgreenSliderLabel, XmNheight, XmNheightInc, XmNhelpLabelString, XmNhighlightColor, XmNhighlightOnEnter, XmNhighlightPixmap, XmNhighlightThickness, XmNhistoryItemCount, XmNhistoryItems, XmNhistoryMaxItems, XmNhistoryVisibleItemCount, XmNhorizontalDelta, XmNhorizontalMargin, XmNhorizontalNodeSpace, XmNhorizontalScrollBar, XmNhorizontalSpacing, XmNiconMask, XmNiconName, XmNiconNameEncoding, XmNiconPixmap, XmNiconPlacement, XmNiconTextPadding, XmNiconWindow, XmNiconX, XmNiconY, XmNiconic, XmNincrement, XmNincrementValue, XmNindentSpace, XmNindeterminateInsensitivePixmap, XmNindeterminatePixmap, XmNindicatorOn, XmNindicatorSize, XmNindicatorType, XmNinitialDelay, XmNinitialFocus, XmNinitialResourcesPersistent, XmNinitialState, XmNinnerMarginHeight, XmNinnerMarginWidth, XmNinput, XmNinputMethod, XmNinputPolicy, XmNinsertBefore, XmNinsertPosition, XmNisAligned, XmNisHomogeneous, XmNitalicString, XmNitemCount, XmNitemSpacing, XmNitems, XmNkeyboardFocusPolicy, XmNlabel, XmNlabelFontList, XmNlabelInsensitivePixmap, XmNlabelPixmap, XmNlabelRenderTable, XmNlabelSpacing, XmNlabelString, XmNlabelType, XmNlargeCellHeight, XmNlargeCellWidth, XmNlargeIconMask, XmNlargeIconPixmap, XmNlargeIconX, XmNlargeIconY, XmNlastPageNumber, XmNlayoutDirection, XmNlayoutType, XmNleftAttachment, XmNleftOffset, XmNleftPosition, XmNleftWidget, XmNlightThreshold, XmNlineBackgroundColor, XmNlineColor, XmNlineStyle, XmNlineWidth, XmNlist, XmNlistItemCount, XmNlistItems, XmNlistLabelString, XmNlistMarginHeight, XmNlistMarginWidth, XmNlistSizePolicy, XmNlistSpacing, XmNlistUpdated, XmNlistVisibleItemCount, XmNloadModel, XmNmainWindowMarginHeight, XmNmainWindowMarginWidth, XmNmajorTabSpacing, XmNmappedWhenManaged, XmNmappingDelay, XmNmargin, XmNmarginBottom, XmNmarginHeight, XmNmarginLeft, XmNmarginRight, XmNmarginTop, XmNmarginWidth, XmNmatchBehavior, XmNmaxAspectX, XmNmaxAspectY, XmNmaxHeight, XmNmaxLength, XmNmaxWidth, XmNmaximum, XmNmaximumValue, XmNmenuAccelerator, XmNmenuBar, XmNmenuHelpWidget, XmNmenuHistory, XmNmenuPost, XmNmessageAlignment, XmNmessageString, XmNmessageWindow, XmNminAspectX, XmNminAspectY, XmNminHeight, XmNminWidth, XmNminimizeButtons, XmNminimum, XmNminimumCellHeight, XmNminimumCellWidth, XmNminimumHorizontalCells, XmNminimumValue, XmNminimumVerticalCells, XmNminorTabSpacing, XmNmnemonic, XmNmnemonicCharSet, XmNmonoSpaceString, XmNmultiClick, XmNmustMatch, XmNmwmDecorations, XmNmwmFunctions, XmNmwmInputMode, XmNmwmMenu, XmNnavigationType, XmNnewVisualStyle, XmNnoCellError, XmNnoMatchString, XmNnoResize, XmNnodeCloseFolderPixmap, XmNnodeOpenFolderPixmap, XmNnodeState, XmNnotebookChildType, XmNnumColumns, XmNnumRows, XmNnumStacks, XmNnumValues, XmNoffsetModel, XmNokLabelString, XmNopenClosePadding, XmNopenFolderPixmap, XmNoptionString, XmNorientation, XmNotherString, XmNoutlineButtonPolicy, XmNoutlineColumnWidth, XmNoutlineIndentation, XmNoutlineLineStyle, XmNoutlineState, XmNoverrideRedirect, XmNpacking, XmNpageIncrement, XmNpageNumber, XmNpaneMaximum, XmNpaneMinimum, XmNparentNode, XmNpattern, XmNpendingDelete, XmNpicture, XmNpixmap, XmNpixmapDepth, XmNpixmapHeight, XmNpixmapPlacement, XmNpixmapTextPadding, XmNpixmapWidth, XmNpopupCursor, XmNpopupEnabled, XmNpopupOffset, XmNpopupShellWidget, XmNposition, XmNpositionIndex, XmNpositionMode, XmNpositionType, XmNpreeditType, XmNpreferredPaneSize, XmNprimaryOwnership, XmNprocessingDirection, XmNpromptString, XmNpropSpaceString, XmNpushButtonEnabled, XmNqualifySearchDataProc, XmNradioAlwaysOne, XmNradioBehavior, XmNrecomputeSize, XmNredSliderLabel, XmNrefigureMode, XmNrenderTable, XmNrenditionBackground, XmNrenditionForeground, XmNrepeatDelay, XmNresizable, XmNresizeHeight, XmNresizePolicy, XmNresizeToPreferred, XmNresizeWidth, XmNrgbFile, XmNrightAttachment, XmNrightOffset, XmNrightPosition, XmNrightWidget, XmNrowColumnType, XmNrows, XmNrubberPositioning, XmNsampleText, XmNsashHeight, XmNsashIndent, XmNsashShadowThickness, XmNsashTranslations, XmNsashWidth, XmNsaveUnder, XmNscaleHeight, XmNscaleMultiple, XmNscaleWidth, XmNscalingString, XmNscreen, XmNscrollBarDisplayPolicy, XmNscrollBarPlacement, XmNscrollHorizontal, XmNscrollLeftSide, XmNscrollTopSide, XmNscrollVertical, XmNscrolledWindowChildType, XmNscrolledWindowMarginHeight, XmNscrolledWindowMarginWidth, XmNscrollingPolicy, XmNselectColor, XmNselectInsensitivePixmap, XmNselectPixmap, XmNselectThreshold, XmNselectedColumn, XmNselectedItem, XmNselectedItemCount, XmNselectedItems, XmNselectedPosition, XmNselectedPositionCount, XmNselectedPositions, XmNselectionArray, XmNselectionArrayCount, XmNselectionLabelString, XmNselectionMode, XmNselectionPolicy, XmNselectionTechnique, XmNsensitive, XmNseparatorOn, XmNseparatorType, XmNset, XmNshadowThickness, XmNshadowType, XmNshellUnitType, XmNshowArrows, XmNshowAsDefault, XmNshowEntryLabel, XmNshowFind, XmNshowFontName, XmNshowLabel, XmNshowNameString, XmNshowSash, XmNshowSeparator, XmNshowValue, XmNsizeString, XmNskipAdjust, XmNsliderMark, XmNsliderSize, XmNsliderTogLabel, XmNsliderVisual, XmNslidingMode, XmNsmallCellHeight, XmNsmallCellWidth, XmNsmallIconMask, XmNsmallIconPixmap, XmNsmallIconX, XmNsmallIconY, XmNsnapBackMultiple, XmNsortFunctions, XmNsource, XmNspacing, XmNspatialIncludeModel, XmNspatialResizeModel, XmNspatialSnapModel, XmNspatialStyle, XmNspinBoxChildType, XmNstackedEffect, XmNstretchable, XmNstrikethruType, XmNstringDirection, XmNsubMenuId, XmNsymbolPixmap, XmNtabAlignment, XmNtabAutoSelect, XmNtabBackground, XmNtabBackgroundPixmap, XmNtabCornerPercent, XmNtabEdge, XmNtabForeground, XmNtabLabelPixmap, XmNtabLabelSpacing, XmNtabLabelString, XmNtabList, XmNtabMarginHeight, XmNtabMarginWidth, XmNtabMode, XmNtabOffset, XmNtabOrientation, XmNtabPixmapPlacement, XmNtabSelectColor, XmNtabSelectPixmap, XmNtabSide, XmNtabStringDirection, XmNtabStyle, XmNtabValue, XmNtearOffModel, XmNtearOffTitle, XmNtextAccelerators, XmNtextColumns, XmNtextField, XmNtextFontList, XmNtextRenderTable, XmNtextRows, XmNtextString, XmNtextTranslations, XmNtitle, XmNtitleEncoding, XmNtitleString, XmNtoggleMode, XmNtoolTipEnable, XmNtoolTipPostDelay, XmNtoolTipPostDuration, XmNtoolTipString, XmNtopAttachment, XmNtopCharacter, XmNtopItemPosition, XmNtopOffset, XmNtopPosition, XmNtopShadowColor, XmNtopShadowPixmap, XmNtopWidget, XmNtransient, XmNtransientFor, XmNtranslations, XmNtraversalOn, XmNtroughColor, XmNunderlineType, XmNuniformTabSize, XmNunitType, XmNunpostBehavior, XmNunselectColor, XmNuseAsyncGeometry, XmNuseImageCache, XmNuseScaling, XmNuseTextField, XmNuserData, XmNvalue, XmNvalueWcs, XmNvalues, XmNverify, XmNverifyBell, XmNverticalDelta, XmNverticalMargin, XmNverticalNodeSpace, XmNverticalScrollBar, XmNverticalSpacing, XmNviewType, XmNvisibleItemCount, XmNvisibleWhenOff, XmNvisual, XmNvisualEmphasis, XmNvisualPolicy, XmNwaitForWm, XmNwhichButton, XmNwidth, XmNwidthInc, XmNwinGravity, XmNwindowGroup, XmNwmTimeout, XmNwordWrap, XmNworkWindow, XmNwrap, XmNx, XmNxlfdString, XmNy, XmStringComponent, }; externaldef(uil_sym_glbl) char **uil_argument_toolkit_names = uil_argument_toolkit_names_vec; /* Define mapping of reasons to toolkit names. */ static char *uil_reason_toolkit_names_vec[] = { "", /* NOT USED */ DtNcancelCallback, DtNcascadingCallback, DtNcloseCallback, DtNclosePrintDisplayCallback, DtNhyperLinkCallback, DtNinputVerifyCallback, DtNoutputLogCallback, DtNprintCallback, DtNsetupCallback, DtNstatusChangeCallback, DtNsubprocessTerminationCallback, DtNtextDeselectCallback, DtNtextSelectCallback, MrmNcreateCallback, XmNactivateCallback, XmNapplyCallback, XmNarmCallback, XmNbrowseSelectionCallback, XmNcancelCallback, XmNcascadingCallback, XmNcommandChangedCallback, XmNcommandEnteredCallback, XmNconvertCallback, XmNdecrementCallback, XmNdefaultActionCallback, XmNdestinationCallback, XmNdestroyCallback, XmNdisarmCallback, XmNdoubleClickCallback, XmNdragCallback, XmNentryCallback, XmNexposeCallback, XmNextendedSelectionCallback, XmNfocusCallback, XmNfocusMovedCallback, XmNgainPrimaryCallback, XmNhelpCallback, XmNincrementCallback, XmNinputCallback, XmNitemFoundCallback, XmNitemNotFoundCallback, XmNlosePrimaryCallback, XmNlosingFocusCallback, XmNmapCallback, XmNmodifyVerifyCallback, XmNmodifyVerifyCallbackWcs, XmNmotionVerifyCallback, XmNmultipleSelectionCallback, XmNnoMatchCallback, XmNnodeStateBegEndCallback, XmNnodeStateCallback, XmNnodeStateChangedCallback, XmNokCallback, XmNoutlineChangedCallback, XmNpageChangedCallback, XmNpageDecrementCallback, XmNpageIncrementCallback, XmNpictureErrorCallback, XmNpopdownCallback, XmNpopupCallback, XmNpopupHandlerCallback, XmNrealizeCallback, XmNresizeCallback, XmNselectCallback, XmNselectionCallback, XmNsimpleCallback, XmNsingleSelectionCallback, XmNtabSelectedCallback, XmNtearOffMenuActivateCallback, XmNtearOffMenuDeactivateCallback, XmNtoBottomCallback, XmNtoTopCallback, XmNtraversalCallback, XmNtraverseObscuredCallback, XmNunmapCallback, XmNunselectCallback, XmNupdateShellCallback, XmNupdateTextCallback, XmNvalidateCallback, XmNvalueChangedCallback, XmNverifyTextCallback, }; externaldef(uil_sym_glbl) char **uil_reason_toolkit_names = uil_reason_toolkit_names_vec; motif-2.3.8/tools/wml/UilSymChTa.h0000644000175000017500000002641513211513006013655 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* * Bit vectors for each child. The entries in the vector correspond * to each class. */ /* sym_k_Xm_Apply_child */ static unsigned char child_class_vec1[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_Xm_Arrow_child */ static unsigned char child_class_vec2[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Cancel_child */ static unsigned char child_class_vec3[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_Xm_ColorListToggle_child */ static unsigned char child_class_vec4[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_ColorSlidersToggle_child */ static unsigned char child_class_vec5[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Dir_child */ static unsigned char child_class_vec6[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_DirList_child */ static unsigned char child_class_vec7[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Filter_child */ static unsigned char child_class_vec8[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_FilterLabel_child */ static unsigned char child_class_vec9[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_FilterText_child */ static unsigned char child_class_vec10[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Find_child */ static unsigned char child_class_vec11[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_FindText_child */ static unsigned char child_class_vec12[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Help_child */ static unsigned char child_class_vec13[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_Xm_HorScrollBar_child */ static unsigned char child_class_vec14[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_Xm_Items_child */ static unsigned char child_class_vec15[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_Xm_ItemsList_child */ static unsigned char child_class_vec16[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_Xm_Label_child */ static unsigned char child_class_vec17[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_List_child */ static unsigned char child_class_vec18[] = { 0, 0, _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmComboBox_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Message_child */ static unsigned char child_class_vec19[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_Xm_OK_child */ static unsigned char child_class_vec20[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_Xm_OptionButton_child */ static unsigned char child_class_vec21[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOptionMenu_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_OptionLabel_child */ static unsigned char child_class_vec22[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOptionMenu_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Selection_child */ static unsigned char child_class_vec23[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_Xm_Separator_child */ static unsigned char child_class_vec24[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_Xm_Separator1_child */ static unsigned char child_class_vec25[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Separator2_child */ static unsigned char child_class_vec26[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Separator3_child */ static unsigned char child_class_vec27[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Symbol_child */ static unsigned char child_class_vec28[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_Xm_TearOffControl_child */ static unsigned char child_class_vec29[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Text_child */ static unsigned char child_class_vec30[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_Xm_TextField_child */ static unsigned char child_class_vec31[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_Xm_Title_child */ static unsigned char child_class_vec32[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, 0, 0, 0, 0}; /* sym_k_Xm_VertScrollBar_child */ static unsigned char child_class_vec33[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* * Table of bit vectors accessed by sym_k_..._child */ static unsigned char *allowed_child_table_vec[] = { NULL, /* UNUSED */ child_class_vec1, child_class_vec2, child_class_vec3, child_class_vec4, child_class_vec5, child_class_vec6, child_class_vec7, child_class_vec8, child_class_vec9, child_class_vec10, child_class_vec11, child_class_vec12, child_class_vec13, child_class_vec14, child_class_vec15, child_class_vec16, child_class_vec17, child_class_vec18, child_class_vec19, child_class_vec20, child_class_vec21, child_class_vec22, child_class_vec23, child_class_vec24, child_class_vec25, child_class_vec26, child_class_vec27, child_class_vec28, child_class_vec29, child_class_vec30, child_class_vec31, child_class_vec32, child_class_vec33, }; externaldef(uil_sym_glbl) unsigned char **allowed_child_table = allowed_child_table_vec; motif-2.3.8/tools/wml/wmloutmm.c0000644000175000017500000001472313145162623013561 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wmloutmm.c /main/9 1995/08/29 11:10:59 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This module contains routines responsible for writing the .mm files * produced by WML. All files are written into the current directory. * * Input: * The resolved objects * * Output: * wml-uil.mm * */ #include "wml.h" #if defined(__STDC__) #include #endif #include /* * Routines used only in this module */ void wmlOutputWmlUilMm (); void wmlOutputWmlUilMmClass (); /* * globals */ int tabno = 1; /* table number */ /* * lists re-used repeatedly to order lists for printing */ DynamicHandleListDef mm_arg; DynamicHandleListDefPtr mm_arg_ptr = &mm_arg; DynamicHandleListDef mm_rsn; DynamicHandleListDefPtr mm_rsn_ptr = &mm_rsn; DynamicHandleListDef mm_ctl; DynamicHandleListDefPtr mm_ctl_ptr = &mm_ctl; /* * Output control routine, which simply outputs each .mm file in turn. */ void wmlOutputMmFiles () { wmlOutputWmlUilMm (); } /* * Routine to write out wml-uil.mm * * This .mm file contains the tables which are to be included as an * appendix to the Uil manual. The tables give the arguments with their * default values, reasons, constraints, and controls for each class * in the class vectors. */ void wmlOutputWmlUilMm () { FILE *outfil; /* output file */ int ndx; /* loop index */ WmlClassDefPtr clsobj; /* class object */ /* * Open the output file. Write the canned header stuff */ outfil = fopen ("wml-uil.mm", "w"); if ( outfil == NULL ) { printf ("\nCouldn't open wml-uil.mm"); return; } /* * Initialize order lists for the tables. */ wmlInitHList (mm_arg_ptr, 200, TRUE); wmlInitHList (mm_rsn_ptr, 200, TRUE); wmlInitHList (mm_ctl_ptr, 200, TRUE); /* * Write out a table for each class, for both widget and gadget variants */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; wmlOutputWmlUilMmClass (outfil, clsobj, clsobj->syndef->name); } /* * close the output file */ printf ("\nCreated wml-uil.mm"); fclose (outfil); } /* * Routine to write a table for a class entry */ void wmlOutputWmlUilMmClass (outfil, clsobj, name) FILE *outfil; WmlClassDefPtr clsobj; char *name; { char *canned1 = ".bp\n\ .ps 12\n"; char *canned2 = ".ps 10\n\ .vs 12\n\ .LP\n\ .TS H\n\ tab(@);\n\ lB lB\n\ l l.\n\ _\n\ .sp 6p\n\ Controls@Reasons\n\ .sp 6p\n\ _\n\ .sp 6p\n\ .TH\n"; char *canned3 = ".TE\n\ .TS H\n\ tab(@);\n\ lB lB lB\n\ l l l.\n\ _\n\ .sp 6p\n\ UIL Argument Name@Argument Type@Default Value\n\ .sp 6p\n\ _\n\ .sp 6p\n\ .TH\n"; char *canned4 = ".TE\n"; WmlClassResDefPtr argref; /* current argument reference */ WmlClassResDefPtr rsnref; /* current reason reference */ WmlClassCtrlDefPtr ctlref; /* current controls reference */ int argndx; /* to access ordered vector */ int rsnndx; /* to access ordered vector */ int ctlndx; /* to access ordered vector */ /* * Write out header information */ fprintf (outfil, canned1); fprintf (outfil, "%s\n", name); fprintf (outfil, canned2); /* * Alphabetize the controls, reason, and argument lists */ wmlClearHList (mm_arg_ptr); wmlClearHList (mm_rsn_ptr); wmlClearHList (mm_ctl_ptr); argref = clsobj->arguments; while ( argref!= NULL ) { while ( argref != NULL && argref->exclude == WmlAttributeTrue ) argref = argref->next; if ( argref != NULL ) { wmlInsertInHList (mm_arg_ptr, argref->act_resource->syndef->name, (ObjectPtr)argref); argref = argref->next; } } rsnref = clsobj->reasons; while ( rsnref!=NULL ) { while ( rsnref != NULL && rsnref->exclude == WmlAttributeTrue ) rsnref = rsnref->next; if ( rsnref != NULL ) { wmlInsertInHList (mm_rsn_ptr, rsnref->act_resource->syndef->name, (ObjectPtr)rsnref); rsnref = rsnref->next; } } ctlref = clsobj->controls; while ( ctlref != NULL ) { wmlInsertInHList (mm_ctl_ptr, ctlref->ctrl->syndef->name, (ObjectPtr)ctlref); ctlref = ctlref->next; } /* * Write out the controls and reason table. */ rsnndx = 0; ctlndx = 0; if ( mm_ctl_ptr->cnt == 0 ) fprintf (outfil, "No children are supported"); while ( rsnndxcnt || ctlndxcnt ) { if ( ctlndx < mm_ctl_ptr->cnt ) { ctlref = (WmlClassCtrlDefPtr) mm_ctl_ptr->hvec[ctlndx].objptr; fprintf (outfil, "%s@", ctlref->ctrl->syndef->name); ctlndx += 1; } else fprintf (outfil, "@"); if ( rsnndx < mm_rsn_ptr->cnt ) { rsnref = (WmlClassResDefPtr) mm_rsn_ptr->hvec[rsnndx].objptr; fprintf (outfil, "%s\n", rsnref->act_resource->syndef->name); rsnndx += 1; } else fprintf (outfil, "\n"); } fprintf (outfil, canned3); /* * Write out the argument table */ argndx = 0; while ( argndx < mm_arg_ptr->cnt ) { argref = (WmlClassResDefPtr) mm_arg_ptr->hvec[argndx].objptr; fprintf (outfil, "%s@%s@", argref->act_resource->syndef->name, argref->act_resource->dtype_def->syndef->name); if ( argref->dflt != NULL ) { if ( strchr(argref->dflt,' ') != 0 ) fprintf (outfil, "T{\n%s\nT}\n", argref->dflt); else fprintf (outfil, "%s\n", argref->dflt); } else { if (argref->act_resource->syndef->dflt != NULL) { if ( strchr(argref->act_resource->syndef->dflt,' ') != 0 ) fprintf (outfil, "T{\n%s\nT}\n", argref->act_resource->syndef->dflt); else fprintf (outfil, "%s\n", argref->act_resource->syndef->dflt); } else fprintf (outfil, " \n"); } argndx += 1; } fprintf (outfil, canned4); } motif-2.3.8/tools/wml/wmlparse.h0000644000175000017500000000211313211513005013511 00000000000000#define CLASS 1 #define RESOURCE 2 #define DATATYPE 3 #define CONTROLLIST 4 #define ENUMERATIONSET 5 #define ENUMERATIONVALUE 6 #define CHARACTERSET 7 #define CHILD 50 #define DOCNAME 8 #define CONVFUNC 9 #define ALIAS 10 #define TYPE 11 #define RESOURCELITERAL 12 #define RELATED 13 #define INTERNALLITERAL 14 #define XRMRESOURCE 15 #define EXCLUDE 16 #define RESOURCES 17 #define SUPERCLASS 18 #define CONTROLS 19 #define WIDGETCLASS 20 #define DIALOGCLASS 21 #define DEFAULT 22 #define ENUMLITERAL 23 #define XMSTRINGCHARSETNAME 24 #define DIRECTION 25 #define PARSEDIRECTION 26 #define CHARACTERSIZE 27 #define CTRLMAPSRESOURCE 28 #define CHILDREN 51 #define PARENTCLASS 52 #define METACLASS 29 #define WIDGET 30 #define GADGET 31 #define ARGUMENT 32 #define REASON 33 #define CONSTRAINT 34 #define SUBRESOURCE 35 #define ATTRTRUE 36 #define ATTRFALSE 37 #define LEFTTORIGHT 38 #define RIGHTTOLEFT 39 #define ONEBYTE 40 #define TWOBYTE 41 #define MIXED1_2BYTE 42 #define COLON 43 #define SEMICOLON 44 #define EQUALS 45 #define LBRACE 46 #define RBRACE 47 #define STRING 48 #define ERRORTOKEN 49 motif-2.3.8/tools/wml/UilSymArTy.h0000644000175000017500000004537613211513006013724 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* Table of the types of arguments The table is indexed by argument with each entry the permitted type for that argument. */ static unsigned char argument_type_table_vec[] = { 0, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_font_table_value, sym_k_bool_value, sym_k_pixmap_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_char_8_value, sym_k_integer_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_char_8_value, sym_k_char_8_value, sym_k_integer_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_font_table_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_char_8_value, sym_k_char_8_value, sym_k_bool_value, sym_k_bool_value, sym_k_char_8_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_color_value, sym_k_color_value, sym_k_any_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_char_8_value, sym_k_any_value, sym_k_char_8_value, sym_k_bool_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_char_8_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_any_value, sym_k_any_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_char_8_value, sym_k_bool_value, sym_k_bool_value, sym_k_char_8_value, sym_k_widget_ref_value, sym_k_any_value, sym_k_char_8_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_char_8_value, sym_k_char_8_value, sym_k_char_8_value, sym_k_color_value, sym_k_font_table_value, sym_k_color_value, sym_k_trans_table_value, sym_k_integer_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_char_8_value, sym_k_font_table_value, sym_k_font_table_value, sym_k_any_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_trans_table_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_color_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_color_value, sym_k_color_value, sym_k_integer_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_color_value, sym_k_pixmap_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_color_value, sym_k_pixmap_value, sym_k_horizontal_float_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_color_value, sym_k_pixmap_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_font_table_value, sym_k_widget_ref_value, sym_k_string_table_value, sym_k_widget_ref_value, sym_k_compound_string_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_pixmap_value, sym_k_pixmap_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_char_8_value, sym_k_identifier_value, sym_k_string_table_value, sym_k_integer_value, sym_k_integer_value, sym_k_trans_table_value, sym_k_compound_string_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_any_value, sym_k_char_8_value, sym_k_integer_value, sym_k_identifier_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_char_8_value, sym_k_integer_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_char_8_value, sym_k_integer_value, sym_k_font_table_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_font_table_value, sym_k_bool_value, sym_k_integer_value, sym_k_identifier_value, sym_k_string_table_value, sym_k_string_table_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_table_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_integer_value, sym_k_string_table_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_any_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_asciz_table_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_color_value, sym_k_horizontal_float_value, sym_k_class_rec_name_value, sym_k_identifier_value, sym_k_integer_value, sym_k_font_table_value, sym_k_pixmap_value, sym_k_widget_ref_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_pixmap_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_string_table_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_any_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_font_value, sym_k_char_8_value, sym_k_char_8_value, sym_k_font_table_value, sym_k_char_8_value, sym_k_integer_value, sym_k_char_8_value, sym_k_integer_value, sym_k_color_value, sym_k_integer_value, sym_k_integer_value, sym_k_color_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_bool_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_vertical_float_value, sym_k_vertical_float_value, sym_k_compound_string_value, sym_k_color_value, sym_k_bool_value, sym_k_pixmap_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_string_table_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_horizontal_float_value, sym_k_pixmap_value, sym_k_char_8_value, sym_k_any_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_integer_value, sym_k_any_value, sym_k_horizontal_float_value, sym_k_vertical_float_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_pixmap_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_bool_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_bool_value, sym_k_char_8_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_identifier_value, sym_k_bool_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_integer_value, sym_k_string_table_value, sym_k_integer_value, sym_k_char_8_value, sym_k_font_table_value, sym_k_pixmap_value, sym_k_pixmap_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_pixmap_value, sym_k_pixmap_value, sym_k_horizontal_float_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_color_value, sym_k_color_value, sym_k_integer_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_string_table_value, sym_k_compound_string_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_vertical_float_value, sym_k_bool_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_vertical_float_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_horizontal_float_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_char_8_value, sym_k_widget_ref_value, sym_k_widget_ref_value, sym_k_widget_ref_value, sym_k_char_8_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_keysym_value, sym_k_char_8_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_char_8_value, sym_k_integer_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_pixmap_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_pixmap_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_horizontal_float_value, sym_k_widget_ref_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_identifier_value, sym_k_bool_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_char_8_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_any_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_widget_ref_value, sym_k_color_value, sym_k_color_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_char_8_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_horizontal_float_value, sym_k_horizontal_float_value, sym_k_horizontal_float_value, sym_k_trans_table_value, sym_k_horizontal_float_value, sym_k_bool_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_compound_string_value, sym_k_identifier_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_color_value, sym_k_pixmap_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_string_table_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_table_value, sym_k_integer_table_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_horizontal_float_value, sym_k_pixmap_value, sym_k_pixmap_value, sym_k_horizontal_float_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_identifier_value, sym_k_any_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_bool_value, sym_k_color_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_integer_value, sym_k_color_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_identifier_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_color_value, sym_k_pixmap_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_float_value, sym_k_integer_value, sym_k_char_8_value, sym_k_trans_table_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_font_table_value, sym_k_widget_ref_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_trans_table_value, sym_k_char_8_value, sym_k_any_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_compound_string_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_color_value, sym_k_pixmap_value, sym_k_widget_ref_value, sym_k_bool_value, sym_k_widget_ref_value, sym_k_trans_table_value, sym_k_bool_value, sym_k_color_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_color_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_bool_value, sym_k_any_value, sym_k_any_value, sym_k_wchar_string_value, sym_k_string_table_value, sym_k_bool_value, sym_k_bool_value, sym_k_integer_value, sym_k_integer_value, sym_k_integer_value, sym_k_widget_ref_value, sym_k_vertical_float_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_any_value, sym_k_integer_value, sym_k_integer_value, sym_k_bool_value, sym_k_integer_value, sym_k_horizontal_float_value, sym_k_horizontal_float_value, sym_k_integer_value, sym_k_any_value, sym_k_integer_value, sym_k_bool_value, sym_k_widget_ref_value, sym_k_bool_value, sym_k_horizontal_float_value, sym_k_compound_string_value, sym_k_vertical_float_value, sym_k_integer_value, }; externaldef(uil_sym_glbl) unsigned char *argument_type_table = argument_type_table_vec; motif-2.3.8/tools/wml/Uil.y0000644000175000017500000012053413145162623012455 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** DECwindows Toolkit User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** YACC Grammar for UIL **-- **/ %{ /* Begin user declarations section */ #ifdef HAVE_CONFIG_H #include #endif #include "UilDefI.h" #include "UilCompGl.h" #define YYSTYPE yystype #define YYDEBUG 1 /* Declare and initialize stack entry for epsilon productions. */ YYSTYPE gz_yynullval = {NULL,0,0,0,0}; /* Declare token to aid in saving source context */ YYSTYPE prev_yylval; /* End user declarations section */ %} /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * token name token value token class * * ---------- ----------- ----------- * *----------------------------------------------------------------------------* */ /* ** terminals of the language ** ** NOTE: the tags which appear in comments at the end of each token ** definition name the token class for the token. These name the ** the .dat file processed by WML while constructing token tables. ** Thus the output of WML and these tags must match, e.g. for ** the token tag 'special' the file 'special.dat' must exist. */ /* end of file indicator */ %token UILEOF 0 /* unused */ /* names */ %token NAME 1 /* identifier */ %token FONT_NAME 2 /* font */ %token COLOR_NAME 3 /* color */ %token ARGUMENT_NAME 4 /* argument */ %token REASON_NAME 5 /* reason */ %token CHARSET_NAME 6 /* charset */ %token ENUMVAL_NAME 7 /* enumval */ %token CLASS_NAME 8 /* class */ %token CHILD_NAME 96 /* child */ /* Literals */ %token UNS_FLOAT_LITERAL 9 /* literal */ %token COMP_STRING 10 /* literal */ %token CHAR_8_LITERAL 11 /* literal */ %token UNS_INT_LITERAL 12 /* literal */ /* Special characters. Treat these as tokens rather than literals, so * that we can assign token numbers to them rather than have YACC use * the ASCII value as the token number. */ %token LEFT_PAREN 13 /* special */ %token RIGHT_PAREN 14 /* special */ %token COLON 15 /* special */ %token SEMICOLON 16 /* special */ %token LEFT_BRACE 17 /* special */ %token RIGHT_BRACE 18 /* special */ %token COMMA 19 /* special */ %token EQUAL_SIGN 20 /* special */ %token NOT 21 /* special */ %token PLUS 22 /* special */ %token MINUS 23 /* special */ %token AND 24 /* special */ %token OR 25 /* special */ %token XOR 26 /* special */ %token MULTIPLY 27 /* special */ %token DIVIDE 28 /* special */ %token LEFT_SHIFT 29 /* special */ %token RIGHT_SHIFT 30 /* special */ /* Reserved words */ %token LIST 31 /* reserved */ %token IDENTIFIER 32 /* reserved */ %token END 33 /* reserved */ %token MODULE 34 /* reserved */ %token UILTRUE 35 /* reserved */ %token UILFALSE 36 /* reserved */ %token INCLUDE 37 /* reserved */ %token MACRO 38 /* reserved */ %token ON 39 /* reserved */ %token OFF 40 /* reserved */ %token VALUE 41 /* reserved */ %token ARGUMENTS 42 /* reserved */ %token CALLBACKS 43 /* reserved */ %token PROCEDURES 44 /* reserved */ %token CONTROLS 45 /* reserved */ %token PROCEDURE 46 /* reserved */ %token OBJECT 47 /* reserved */ /* Declaratives */ %token OBJECTS 48 /* keyword */ %token WIDGET 49 /* reserved */ %token GADGET 50 /* reserved */ %token FONT 51 /* keyword */ %token ARGUMENT 52 /* keyword */ %token REASON 53 /* keyword */ %token PIXMAP 54 /* keyword */ %token COLOR 55 /* keyword */ %token NAMES 56 /* keyword */ %token CHARACTER_SET 57 /* keyword */ %token CASE_SENSITIVE 58 /* keyword */ %token CASE_INSENSITIVE 59 /* keyword */ %token VERSION 60 /* keyword */ %token MANAGED 61 /* keyword */ %token UNMANAGED 62 /* keyword */ %token PRIVATE 63 /* reserved */ %token IMPORTED 64 /* keyword */ %token EXPORTED 65 /* reserved */ %token UILFILE 66 /* keyword */ %token STRING_TABLE 67 /* keyword */ %token TRANSLATION_TABLE 68 /* keyword */ %token COMPOUND_STRING 69 /* keyword */ %token FONT_TABLE 70 /* keyword */ %token ANY 71 /* keyword */ %token STRING 72 /* keyword */ %token BOOLEAN 73 /* keyword */ %token ICON 74 /* keyword */ %token RIGHT_TO_LEFT 75 /* keyword */ %token BACKGROUND 76 /* keyword */ %token FOREGROUND 77 /* keyword */ %token COLOR_TABLE 78 /* keyword */ %token FLOAT 79 /* keyword */ %token INTEGER 80 /* keyword */ %token CLASS_REC_NAME 81 /* keyword */ %token ASCIZ_TABLE 82 /* keyword */ %token INTEGER_TABLE 83 /* keyword */ %token ASCIZ_STRING_TABLE 84 /* keyword */ %token COMPOUND_STRING_TABLE 85 /* keyword */ %token XBITMAPFILE 86 /* keyword */ %token SEPARATE 87 /* keyword */ %token SIXTEEN_BIT 88 /* keyword */ %token POUND 89 /* special */ %token KEYSYM 90 /* keyword */ %token SINGLE_FLOAT 91 /* keyword */ %token RGB 92 /* keyword */ %token WIDE_CHARACTER 93 /* keyword */ %token LOC_STRING 94 /* literal */ /* New for 1.2 */ %token FONTSET 95 /* keyword */ %token COMPOUND_STRING_COMPONENT 97 /* keyword */ %token PIX 115 %token PIXEL 103 %token PIXELS 104 %token IN 98 %token INCH 105 %token INCHES 106 %token CM 99 %token CENTIMETER 107 %token CENTIMETERS 108 %token MM 100 %token MILLIMETER 109 %token MILLIMETERS 110 %token PT 101 %token POINT 111 %token POINTS 112 %token FU 102 %token FONT_UNIT 113 %token FONT_UNITS 114 %start module_block %% /* ** productions of the grammar */ /* module structure */ module_block : module_header { sar_save_module_source (); } module_declaration_list END MODULE SEMICOLON ; module_header : /* empty */ { sar_create_root ( &$$ ); } MODULE id { sar_create_module( &$$, &$3, &$2 ); } opt_module_clauses ; opt_module_clauses : /* empty */ | module_clauses ; module_clauses : module_clause | module_clauses module_clause ; module_clause : VERSION EQUAL_SIGN character_8_value { sar_process_module_version( &$3 , &$1 ); } | NAMES EQUAL_SIGN sensitivity_value { sar_process_module_sensitivity( &$3 , &$1 ); } | CHARACTER_SET EQUAL_SIGN valid_charset { sar_process_module_charset( &$3 , &$1 ); } | OBJECTS { sar_make_def_obj (&$1); } EQUAL_SIGN variant_spec ; sensitivity_value : CASE_SENSITIVE | CASE_INSENSITIVE ; variant_spec : LEFT_BRACE RIGHT_BRACE | LEFT_BRACE variant_list RIGHT_BRACE | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; variant_list : variant_clause SEMICOLON | variant_list variant_clause SEMICOLON | error { lex_issue_error (SEMICOLON); } SEMICOLON ; variant_clause : CLASS_NAME { sar_make_def_obj (&$1); } EQUAL_SIGN variant { sar_process_module_variant (&$1, &$4); $$ = gz_yynullval; } ; variant : WIDGET { $$ = gz_yynullval; $$.b_type = sym_k_widget_entry; } | GADGET { $$ = gz_yynullval; $$.b_type = sym_k_gadget_entry; } ; module_declaration_list : /* empty */ | module_declaration_list module_declaration ; module_declaration : value_declaration | identifier_declaration | procedure_declaration | object_declaration | list_declaration | include_directive ; /* VALUE declaration */ value_declaration : VALUE { $$ = $1; sar_save_section_source (&$1, sym_k_value_section); } value_declaration_list ; value_declaration_list : value_decl | value_declaration_list value_decl | error { lex_issue_error (SEMICOLON); } SEMICOLON ; value_decl : id COLON value_definition SEMICOLON { sar_bind_value_name( &$1, &$3, &$4 ); } ; value_definition : EXPORTED private_value { $$ = $2; $$.b_flags |= sym_m_exported; $$.b_flags &= ~sym_m_private; } | PRIVATE private_value_plus { $$ = $2; $$.b_flags |= sym_m_private; $$.b_flags &= ~sym_m_exported; } | private_value_plus { $$ = $1; $$.b_flags |= sym_m_private; $$.b_flags &= ~sym_m_exported; } | IMPORTED value_type { sar_import_value_entry( &$$, &$2 ); } ; value_type : INTEGER { $$ = $1; $$.b_type = sym_k_integer_value; } | STRING { $$ = $1; $$.b_type = sym_k_char_8_value; } | PIXMAP { $$ = $1; $$.b_type = sym_k_pixmap_value; } | FLOAT { $$ = $1; $$.b_type = sym_k_float_value; } | BOOLEAN { $$ = $1; $$.b_type = sym_k_bool_value; } | FONT { $$ = $1; $$.b_type = sym_k_font_value; } | REASON { $$ = $1; $$.b_type = sym_k_reason_value; } | ARGUMENT { $$ = $1; $$.b_type = sym_k_argument_value; } | COLOR { $$ = $1; $$.b_type = sym_k_color_value; } | string_table_type { $$ = $1; $$.b_type = sym_k_string_table_value; } | asciz_table_type { $$ = $1; $$.b_type = sym_k_asciz_table_value; } | INTEGER_TABLE { $$ = $1; $$.b_type = sym_k_integer_table_value; } | TRANSLATION_TABLE { $$ = $1; $$.b_type = sym_k_trans_table_value; } | FONT_TABLE { $$ = $1; $$.b_type = sym_k_font_table_value; } | ICON { $$ = $1; $$.b_type = sym_k_icon_value; } | COMPOUND_STRING { $$ = $1; $$.b_type = sym_k_compound_string_value; } | COMPOUND_STRING_COMPONENT { $$ = $1; $$.b_type = sym_k_compound_string_value; } | CLASS_REC_NAME { $$ = $1; $$.b_type = sym_k_class_rec_name_value; } | XBITMAPFILE { $$ = $1; $$.b_type = sym_k_xbitmapfile_value; } | KEYSYM { $$ = $1; $$.b_type = sym_k_keysym_value; } | SINGLE_FLOAT { $$ = $1; $$.b_type = sym_k_single_float_value; } | RGB { $$ = $1; $$.b_type = sym_k_rgb_value; } | WIDE_CHARACTER { $$ = $1; $$.b_type = sym_k_wchar_string_value; } | FONTSET { $$ = $1; $$.b_type = sym_k_fontset_value; } | WIDGET { $$ = $1; $$.b_type = sym_k_widget_ref_value; } ; /* Seperately defined for fixing CR 5888 */ arg_value_type : INTEGER { $$ = $1; $$.b_type = sym_k_integer_value; } | STRING { $$ = $1; $$.b_type = sym_k_char_8_value; } | PIXMAP { $$ = $1; $$.b_type = sym_k_pixmap_value; } | FLOAT { $$ = $1; $$.b_type = sym_k_float_value; } | BOOLEAN { $$ = $1; $$.b_type = sym_k_bool_value; } | FONT { $$ = $1; $$.b_type = sym_k_font_value; } | REASON { $$ = $1; $$.b_type = sym_k_reason_value; } | COLOR { $$ = $1; $$.b_type = sym_k_color_value; } | string_table_type { $$ = $1; $$.b_type = sym_k_string_table_value; } | asciz_table_type { $$ = $1; $$.b_type = sym_k_asciz_table_value; } | INTEGER_TABLE { $$ = $1; $$.b_type = sym_k_integer_table_value; } | TRANSLATION_TABLE { $$ = $1; $$.b_type = sym_k_trans_table_value; } | FONT_TABLE { $$ = $1; $$.b_type = sym_k_font_table_value; } | ICON { $$ = $1; $$.b_type = sym_k_icon_value; } | COMPOUND_STRING { $$ = $1; $$.b_type = sym_k_compound_string_value; } | KEYSYM { $$ = $1; $$.b_type = sym_k_keysym_value; } | SINGLE_FLOAT { $$ = $1; $$.b_type = sym_k_single_float_value; } | WIDE_CHARACTER { $$ = $1; $$.b_type = sym_k_wchar_string_value; } | FONTSET { $$ = $1; $$.b_type = sym_k_fontset_value; } | WIDGET { $$ = $1; $$.b_type = sym_k_widget_ref_value; } /* End for fixing CR 5888 */ string_table_type : STRING_TABLE | COMPOUND_STRING_TABLE ; asciz_table_type : ASCIZ_TABLE | ASCIZ_STRING_TABLE ; /* PROCEDURE declaration */ procedure_declaration : PROCEDURE { $$ = $1; sar_save_section_source (&$1, sym_k_procedure_section); } procedure_declaration_list ; procedure_declaration_list : procedure_decl | procedure_declaration_list procedure_decl | error { lex_issue_error (SEMICOLON); } SEMICOLON ; procedure_decl : id opt_formal_parameters opt_class SEMICOLON { sar_create_procedure( &$1, &$2, &$3, &$4 );} ; opt_formal_parameters : /* empty */ { $$ = gz_yynullval; } | LEFT_PAREN formal_parameter_type RIGHT_PAREN { $$ = $2; } ; formal_parameter_type : /* empty */ { $$ = gz_yynullval; $$.b_type = sym_k_no_value; } | value_type | ANY { $$ = $1; $$.b_type = sym_k_any_value; } | CLASS_NAME { YYSTYPE temp[2]; temp[0] = gz_yynullval; sar_create_object(&temp[0], sym_k_widget_entry); temp[1] = $1; sar_set_object_class(&temp[1]); sar_verify_object(&temp[1]); $$ = temp[0]; } ; opt_class : /* empty */ { $$.b_flags = sym_m_private; } /* | EXPORTED { $$.b_flags = sym_m_exported; } | PRIVATE { $$.b_flags = sym_m_private; } | IMPORTED { $$.b_flags = sym_m_imported; } */ ; /* IDENTIFIER declaration */ identifier_declaration : IDENTIFIER { $$ = $1; sar_save_section_source (&$1, sym_k_identifier_section); } identifier_declaration_list ; identifier_declaration_list : identifier_decl | identifier_declaration_list identifier_decl | error { lex_issue_error (SEMICOLON); } SEMICOLON ; identifier_decl : id SEMICOLON { sar_create_identifier ( &$1, &$2 ); } ; /* Directives. */ /* Include Directive */ include_directive : INCLUDE UILFILE character_8_value SEMICOLON { sar_include_file (&$3, &$1, &$4); } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; /* OBJECT declaration */ object_declaration : OBJECT { $$ = $1; sar_save_section_source (&$1, sym_k_object_section); } object_decl_list ; object_decl_list : object_decl SEMICOLON { $$ = $1; sar_save_src_semicolon_pos (&$2 ); } | object_decl_list object_decl SEMICOLON { $$ = $1; sar_save_src_semicolon_pos (&$3 ); } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; object_decl : id { sar_create_object (&$1, sym_k_widget_entry); sar_link_section (&$1); $$ = gz_yynullval;} COLON object_definition { $$ = gz_yynullval; } ; object_definition : EXPORTED { sar_set_object_flags (&$1, sym_m_exported); } object_specification | PRIVATE { sar_set_object_flags (&$1, sym_m_private); } object_specification | epsilon_production { sar_set_object_flags (&$1, sym_m_exported); } object_specification | IMPORTED { sar_set_object_flags (&$1, sym_m_imported); } CLASS_NAME { sar_set_object_class (&$3); } /* * Fix for CR 5440 - Call opt_create_proc_ref to check for creation procedures * for imported user_defined widgets. */ opt_create_proc_ref /* * End fix for CR 5440 */ epsilon_production { sar_verify_object (&$1); } ; control_object_definition : EXPORTED { sar_set_object_flags (&$1, sym_m_exported); } object_specification | PRIVATE { sar_set_object_flags (&$1, sym_m_private); } object_specification | MANAGED { sar_set_object_flags (& $1, (sym_m_managed | sym_m_exported)); } object_specification | UNMANAGED { sar_unset_object_flags (& $1, sym_m_managed), sar_set_object_flags (& $1, sym_m_exported); } object_specification | epsilon_production { sar_set_object_flags (&$1, sym_m_exported); } object_specification | IMPORTED { sar_set_object_flags (&$1, sym_m_imported); } CLASS_NAME { sar_set_object_class (&$3); } epsilon_production { sar_verify_object (&$1); } ; object_specification : CLASS_NAME { sar_set_object_class (&$1); } opt_create_proc_ref opt_variant object_spec { sar_verify_object (&$1); } ; opt_variant : epsilon_production { sar_set_object_variant (&$1); } | variant { sar_set_object_variant (&$1); } ; control_object_specification : CLASS_NAME { sar_set_object_class (&$1); $$ = gz_yynullval;} opt_create_proc_ref opt_variant control_object_spec { sar_verify_object (&$1); } ; opt_create_proc_ref : epsilon_production | PROCEDURE id_ref opt_parens { sar_process_proc_ref (&$2, &gz_yynullval, sym_k_object_proc); sar_save_user_proc_ref_src ( &$1, &$2, &$3 ); } ; opt_parens : epsilon_production | LEFT_PAREN RIGHT_PAREN { $$ = $2; } ; /* object specification. */ object_spec : id_ref { sar_object_reference (&$1); } | LEFT_BRACE RIGHT_BRACE | LEFT_BRACE object_feature_list RIGHT_BRACE | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; control_object_spec : id_ref { sar_object_reference (&$1); } | LEFT_BRACE RIGHT_BRACE epsilon_production { sar_set_object_flags (&$1, sym_m_exported); } | LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production { sar_set_object_flags (&$1, sym_m_exported); } | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; child_object_spec : LEFT_BRACE RIGHT_BRACE epsilon_production { sar_set_object_flags (&$1, sym_m_private); } | LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production { sar_set_object_flags (&$1, sym_m_private); } | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; object_feature_list : object_feature | object_feature_list object_feature ; object_feature : argument_list_def SEMICOLON { sar_save_list_end ( &$2); sar_save_feature (&$1); $$ = gz_yynullval; } | callback_list_def SEMICOLON { sar_save_list_end ( &$2); sar_save_feature (&$1); $$ = gz_yynullval; } | control_list_def SEMICOLON { sar_save_list_end ( &$2); sar_save_feature (&$1); sar_update_parent_list (&$1); $$ = gz_yynullval; } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; epsilon_production : /* empty */ { $$ = gz_yynullval; } ; /* LIST declaration */ list_declaration : LIST { $$ = $1; sar_save_section_source (&$1, sym_k_list_section); } list_decl_list ; list_decl_list : list_decl SEMICOLON { $$ = $1; sar_save_src_semicolon_pos (&$2 ); } | list_decl_list list_decl SEMICOLON { $$ = $1; sar_save_src_semicolon_pos (&$3 ); } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; list_decl : id { sar_create_object (&$1, sym_k_list_entry); sar_link_section (&$1); $$ = gz_yynullval;} COLON list_specification { $$ = gz_yynullval; } ; list_specification : control_list_specification | argument_list_specification | callback_list_specification | procedure_list_specification ; control_list_specification : control_list_type { $$ = gz_yynullval; sar_set_list_type (&$1); } control_list_spec { sar_verify_object (&$1); } ; argument_list_specification : argument_list_type { $$ = gz_yynullval; sar_set_list_type (&$1); } argument_list_spec { sar_verify_object (&$1); } ; callback_list_specification : callback_list_type { $$ = gz_yynullval; sar_set_list_type (&$1); } callback_list_spec { sar_verify_object (&$1); } ; procedure_list_specification : procedure_list_type { $$ = gz_yynullval; sar_set_list_type (&$1); } procedure_list_spec { sar_verify_object (&$1); } ; argument_list_type : ARGUMENTS { $$ = gz_yynullval; $$.b_type = sym_k_argument_list; } ; callback_list_type : CALLBACKS { $$ = gz_yynullval; $$.b_type = sym_k_callback_list; } ; procedure_list_type : PROCEDURES { $$ = gz_yynullval; $$.b_type = sym_k_proc_ref_list; } ; control_list_type : CONTROLS { $$ = gz_yynullval; $$.b_type = sym_k_control_list; } ; argument_list_spec : id_ref { sar_object_reference (&$1); } | LEFT_BRACE RIGHT_BRACE | LEFT_BRACE argument_list_clause_list RIGHT_BRACE | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; callback_list_spec : id_ref { sar_object_reference (&$1); } | LEFT_BRACE RIGHT_BRACE | LEFT_BRACE callback_list_clause_list RIGHT_BRACE | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; procedure_list_spec : id_ref { sar_object_reference (&$1); } | LEFT_BRACE RIGHT_BRACE | LEFT_BRACE procedure_list_clause_list RIGHT_BRACE | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; control_list_spec : id_ref { sar_object_reference (&$1); } | LEFT_BRACE RIGHT_BRACE | LEFT_BRACE control_list_clause_list RIGHT_BRACE | error { lex_issue_error (RIGHT_BRACE); } RIGHT_BRACE ; argument_list_clause_list : argument_list_clause | argument_list_clause_list argument_list_clause ; callback_list_clause_list : callback_list_clause | callback_list_clause_list callback_list_clause ; procedure_list_clause_list : procedure_list_clause | procedure_list_clause_list procedure_list_clause ; control_list_clause_list : control_list_clause | control_list_clause_list control_list_clause ; argument_list_clause : argument_list_def SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | argument_list_item SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; callback_list_clause : callback_list_def SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | callback_list_item SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; procedure_list_clause : procedure_list_def SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | procedure_list_def_ref SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; control_list_clause : control_list_def SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | control_list_item SEMICOLON { sar_save_src_entry_end (&$2, &$1); sar_add_list_entry (&$1); $$ = gz_yynullval; } | error { lex_issue_error (SEMICOLON); } SEMICOLON ; control_list_def : epsilon_production { $$ = gz_yynullval; sar_create_object (&$1, sym_k_list_entry); } control_list_specification { $$ = $1; } ; argument_list_def : epsilon_production { $$ = gz_yynullval; sar_create_object (&$1, sym_k_list_entry); } argument_list_specification { $$ = $1; } ; callback_list_def : epsilon_production { $$ = gz_yynullval; sar_create_object (&$1, sym_k_list_entry); } callback_list_specification { $$ = $1; } ; procedure_list_def : epsilon_production { $$ = gz_yynullval; sar_create_object (&$1, sym_k_list_entry); } procedure_list_specification { $$ = $1; } ; control_list_item /* Control item */ : opt_managed control_item { sar_save_control_item (&$1, &$2); $$ = $1; } | id { sar_create_object (& $1, sym_k_widget_entry); $1.b_flags = sym_m_managed; $$ = gz_yynullval;} COLON control_object_definition { sar_save_control_widget (& $1, & $2); $$ = $1; } /* Child */ | CHILD_NAME opt_child_managed { sar_create_child (& $1); $1.b_flags = sym_m_managed; $$ = gz_yynullval; } child_object_spec { sar_save_control_widget (& $1, & $2); $$ = $1; } | CHILD_NAME UNMANAGED { sar_create_child (& $1); $$ = gz_yynullval; } child_object_spec { sar_save_control_widget (& $1, & $3); $$ = $1; } ; opt_child_managed : epsilon_production | MANAGED ; argument_list_item /* Argument value pair */ : value EQUAL_SIGN value { sar_save_argument_pair (&$1, &$3, &$2); $$ = $1; } /* Argument widget pair */ | value EQUAL_SIGN CLASS_NAME id_ref { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = $3; sar_set_object_class (&temp [1]); temp [1] = $4; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); sar_save_argument_pair (&$1, &temp [0], &$2); $$ = $1; } ; callback_list_item /* Callback reason binding */ : value EQUAL_SIGN procedure_reference { sar_save_reason_binding (&$1, &$3, &$2); $$ = $1; } | value EQUAL_SIGN procedure_list_def { sar_save_reason_binding (&$1, &$3, &$2); $$ = $1; } ; control_item : epsilon_production { sar_create_object (&$1, sym_k_widget_entry); $$ = gz_yynullval; } control_object_specification { $$ = $1; } ; opt_managed : epsilon_production { $$.b_flags = sym_m_managed; } | MANAGED { $$ = gz_yynullval; $$.b_flags = sym_m_managed; } | UNMANAGED { $$ = gz_yynullval; } ; procedure_reference : PROCEDURE id_ref opt_procedure_argument { sar_process_proc_ref (&$2, &$3, sym_k_callback_proc); $$ = $2; } ; procedure_list_def_ref : id_ref opt_procedure_argument { sar_process_proc_ref (&$1, &$2, sym_k_callback_proc); $$ = $1; } ; opt_procedure_argument : epsilon_production | LEFT_PAREN value RIGHT_PAREN { $$ = $2; } | LEFT_PAREN CLASS_NAME id_ref RIGHT_PAREN { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = $2; sar_set_object_class (&temp [1]); temp [1] = $3; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); $$ = temp [0]; } | LEFT_PAREN RIGHT_PAREN { $$ = gz_yynullval; } ; /* definition of an id */ id : NAME | FONT_NAME | COLOR_NAME | ARGUMENT_NAME | REASON_NAME | ENUMVAL_NAME | CHILD_NAME | keyword { sar_map_keyword_to_name( &$$, &$1); } ; /* reference of an id */ id_ref : id { sar_process_id_ref (&$1); $$ = $1; } ; keyword : STRING | BOOLEAN | FLOAT | INTEGER | FONT | ARGUMENT | REASON | PIXMAP | COLOR | NAMES | CASE_SENSITIVE | CASE_INSENSITIVE | VERSION | MANAGED | UNMANAGED | UILFILE | string_table_type | asciz_table_type | INTEGER_TABLE | TRANSLATION_TABLE | COMPOUND_STRING | COMPOUND_STRING_COMPONENT | CLASS_REC_NAME | FONT_TABLE | RIGHT_TO_LEFT | CHARACTER_SET | COLOR_TABLE | ICON | BACKGROUND | FOREGROUND | XBITMAPFILE | SEPARATE | ANY | IMPORTED | OBJECTS | KEYSYM | SINGLE_FLOAT | RGB | WIDE_CHARACTER | FONTSET ; /* values */ character_8_value : value { $$ = $1; if (($$.b_type != sym_k_error_value) && ($$.b_type != sym_k_any_value) && (($$.b_flags &sym_m_forward_ref) == 0)) { if (($$.b_type != sym_k_char_8_value) && ($$.b_type != sym_k_localized_string_value)) sar_value_type_error( &$$, sym_k_char_8_value ); if (($$.b_flags &sym_m_private) == 0) sar_private_error( &$$ ); } } ; private_value : value { $$ = $1; if ($$.b_type != sym_k_error_value) { if ((($$.b_flags &sym_m_private) == 0) && (($$.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &$$ ); } } ; /* BEGIN HaL fix CR 5427 */ private_value_plus : non_export_value { $$ = $1; if ($$.b_type != sym_k_error_value) { if ((($$.b_flags &sym_m_private) == 0) && (($$.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &$$ ); } } | value { $$ = $1; if ($$.b_type != sym_k_error_value) { if ((($$.b_flags &sym_m_private) == 0) && (($$.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &$$ ); } } non_export_value : COLOR_TABLE LEFT_PAREN color_list RIGHT_PAREN { sar_make_color_table( &$$, &$3, &$1); } /* END HaL fix CR 5427 */ value : value_1 | value OR value_1 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } | value XOR value_1 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } ; value_1 : value_2 | value_1 AND value_2 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } ; value_2 : value_3 | value_2 LEFT_SHIFT value_3 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } | value_2 RIGHT_SHIFT value_3 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } ; value_3 : value_4 | value_3 PLUS value_4 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } | value_3 MINUS value_4 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } ; value_4 : value_5 | value_4 MULTIPLY value_5 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } | value_4 DIVIDE value_5 { $$ = $2; sar_binary_op( &$$, &$1, &$3 ); } ; value_5 : value_6 | MINUS value_5 { $$ = $1; sar_unary_op( &$$, &$2 ); } | NOT value_5 { $$ = $1; sar_unary_op( &$$, &$2 ); } | PLUS value_5 { $$ = $1; sar_unary_op( &$$, &$2 ); } ; value_6 : operand | LEFT_PAREN value RIGHT_PAREN { $$ = $2; } ; operand : UNS_INT_LITERAL { sar_make_private_value( &$$, &$1, sym_k_integer_value, &$1, XmPIXELS); } | UNS_INT_LITERAL units_specification { sar_make_private_value( &$$, &$1, sym_k_integer_value, &$1, sar_get_units_type(&$2)); } | optional_charset CHAR_8_LITERAL { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value( &$$, &$2, sym_k_char_8_value, &$2, 0); } | id { sar_process_id( &$$, &$1 );} | UNS_FLOAT_LITERAL { sar_make_private_value( &$$, &$1, sym_k_float_value, &$1, XmPIXELS); } | UNS_FLOAT_LITERAL units_specification { sar_make_private_value( &$$, &$1, sym_k_float_value, &$1, sar_get_units_type(&$2)); } | PIXMAP LEFT_PAREN character_8_value RIGHT_PAREN { sar_value_not_implemented( &$$, &$1, "pixmap literal" ); } | FONT LEFT_PAREN font_spec RIGHT_PAREN { $$ = $3; } | FONTSET LEFT_PAREN fontset_spec RIGHT_PAREN { $$ = $3; } | COLOR LEFT_PAREN color_spec RIGHT_PAREN { $$ = $3; } | REASON LEFT_PAREN character_8_value RIGHT_PAREN { sar_make_private_value(&$$, &$3, sym_k_reason_value, &$1, 0); } | CLASS_REC_NAME LEFT_PAREN character_8_value RIGHT_PAREN { sar_make_private_value(&$$, &$3, sym_k_class_rec_name_value, &$1, 0); } | ARGUMENT LEFT_PAREN character_8_value opt_arg_type RIGHT_PAREN { sar_make_private_value ( &$$, &$3, sym_k_argument_value, &$1, $4.b_type ); } | UILTRUE { sar_make_private_value( &$$, &$1, sym_k_bool_value, &$1, 0); } | UILFALSE { sar_make_private_value( &$$, &$1, sym_k_bool_value, &$1, 0); } | ON { sar_make_private_value( &$$, &$1, sym_k_bool_value, &$1, 0); } | OFF { sar_make_private_value( &$$, &$1, sym_k_bool_value, &$1, 0); } | optional_charset COMP_STRING { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value ( &$$, &$2, sym_k_compound_string_value, &$2, 0); } | string_table_type LEFT_PAREN comp_str_list RIGHT_PAREN { sar_make_private_value( &$$, &$3, sym_k_string_table_value, &$1, 0); } | asciz_table_type LEFT_PAREN asciz_list RIGHT_PAREN { sar_make_private_value( &$$, &$3, sym_k_asciz_table_value, &$1, 0); } | INTEGER_TABLE LEFT_PAREN integer_list RIGHT_PAREN { sar_make_private_value( &$$, &$3, sym_k_integer_table_value, &$1, 0); } | TRANSLATION_TABLE LEFT_PAREN string_list RIGHT_PAREN { sar_make_private_value( &$$, &$3, sym_k_trans_table_value, &$1, 0); } | COMPOUND_STRING LEFT_PAREN comp_str_result RIGHT_PAREN { $$ = $3; } | COMPOUND_STRING_COMPONENT LEFT_PAREN comp_str_comp_result RIGHT_PAREN { $$ = $3; } | FONT_TABLE LEFT_PAREN font_list RIGHT_PAREN { $$ = $3; } | ICON LEFT_PAREN icon_spec RIGHT_PAREN { $$ = $3; } | FLOAT LEFT_PAREN value RIGHT_PAREN { $$ = $1; sar_unary_op( &$$, &$3 ); } | INTEGER LEFT_PAREN value RIGHT_PAREN { $$ = $1; sar_unary_op( &$$, &$3 ); } | XBITMAPFILE LEFT_PAREN character_8_value RIGHT_PAREN { sar_make_private_value(&$$, &$3, sym_k_xbitmapfile_value, &$1, 0); } | KEYSYM LEFT_PAREN character_8_value RIGHT_PAREN { sar_make_private_value(&$$, &$3, sym_k_keysym_value, &$1, 0); } | SINGLE_FLOAT LEFT_PAREN value RIGHT_PAREN { $$ = $1; sar_unary_op( &$$, &$3 ); } | RGB LEFT_PAREN rgb_list RIGHT_PAREN { sar_make_private_value( & $$, & $3, sym_k_rgb_value, &$1, 0); } | WIDE_CHARACTER LEFT_PAREN wchar_str_result RIGHT_PAREN { $$ = $3; } | LOC_STRING { sar_make_private_value(&$$, &$1, sym_k_localized_string_value, &$1, 0); } ; string_list : /* empty */ { $$ = gz_yynullval; } | string_list_2 { $$ = $1; } ; string_list_2 : private_value { sar_append_table_value (&$1, &gz_yynullval, sym_k_trans_table_value, &$1); $$ = $1; } | string_list_2 COMMA private_value { sar_append_table_value (&$3, &$1, sym_k_trans_table_value, &$2); $$ = $3; } ; asciz_list : /* empty */ { $$ = gz_yynullval; } | asciz_list_2 { $$ = $1; } ; asciz_list_2 : private_value { sar_append_table_value (&$1, &gz_yynullval, sym_k_asciz_table_value, &$1); $$ = $1; } | asciz_list_2 COMMA private_value { sar_append_table_value (&$3, &$1, sym_k_asciz_table_value, &$2); $$ = $3; } ; integer_list : /* empty */ { $$ = gz_yynullval; } | integer_list_2 { $$ = $1; } ; integer_list_2 : private_value { sar_append_table_value (&$1, &gz_yynullval, sym_k_integer_table_value, &$1); $$ = $1; } | integer_list_2 COMMA private_value { sar_append_table_value (&$3, &$1, sym_k_integer_table_value, &$2); $$ = $3; } ; /* RAP rgb data type */ rgb_list : private_value COMMA private_value COMMA private_value {sar_append_table_value(&$1, & gz_yynullval, sym_k_integer_table_value, & $1); sar_append_table_value(& $3, & $1, sym_k_integer_table_value, & $2); sar_append_table_value(& $5, & $3, sym_k_integer_table_value, & $4); $$ = $5;} ; comp_str_list : /* empty */ { $$ = gz_yynullval; } | comp_str_list_2 { $$ = $1; } ; comp_str_list_2 : private_value { sar_append_table_value (&$1, &gz_yynullval, sym_k_string_table_value, &$1); $$ = $1; } | comp_str_list_2 COMMA private_value { sar_append_table_value (&$3, &$1, sym_k_string_table_value, &$2); $$ = $3; } ; opt_arg_type : /* empty */ { $$ = gz_yynullval; $$.b_type = sym_k_any_value; } | COMMA arg_value_type { $$ = gz_yynullval; $$.b_type = $2.b_type; } | COMMA ANY { $$ = gz_yynullval; $$.b_type = sym_k_any_value; } ; comp_str_result : private_value { sar_make_comp_str( &$$, &$1, &gz_yynullval, &$-1 ); } | private_value comp_str_attrs { sar_make_comp_str( &$$, &$1, &$2, &$-1 ); } ; comp_str_comp_result : ENUMVAL_NAME { sar_make_comp_str_comp(&$$, &$1, &gz_yynullval, &$-1 ); } | ENUMVAL_NAME COMMA ENUMVAL_NAME { sar_make_comp_str_comp( &$$, &$1, &$3, &$-1 ); } | ENUMVAL_NAME COMMA CHAR_8_LITERAL { sar_make_comp_str_comp( &$$, &$1, &$3, &$-1 ); } | ENUMVAL_NAME COMMA LOC_STRING { sar_make_comp_str_comp( &$$, &$1, &$3, &$-1 ); } | ENUMVAL_NAME COMMA CHARSET_NAME { sar_make_comp_str_comp( &$$, &$1, &$3, &$-1 ); } ; comp_str_attrs : COMMA comp_str_attr { sar_chk_comp_str_attr( &$$, &$2, &gz_yynullval ); } | comp_str_attrs COMMA comp_str_attr { sar_chk_comp_str_attr( &$$, &$3, &$1 ); } ; comp_str_attr : CHARACTER_SET EQUAL_SIGN valid_charset { $$.b_type = $1.b_type; $$.b_tag = $3.b_tag; $$.value.az_keyword_entry = $3.value.az_keyword_entry; $$.value.az_symbol_entry = $3.value.az_symbol_entry; } | RIGHT_TO_LEFT EQUAL_SIGN private_value { $$.b_type = $1.b_type; $$.value.az_symbol_entry = $3.value.az_symbol_entry; } | SEPARATE EQUAL_SIGN private_value { $$.b_type = $1.b_type; $$.value.az_symbol_entry = $3.value.az_symbol_entry; } ; wchar_str_result : private_value { sar_make_wchar_str( &$$, &$1, &gz_yynullval, &$-1 ); } ; font_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset { sar_make_font( &$$, &$5, &$1, &$-1 ); } | character_8_value { sar_make_font( &$$, &gz_yynullval, &$1, &$-1 ); } ; fontset_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset { sar_make_fontset( &$$, &$5, &$1, &$-1 ); } | character_8_value { sar_make_fontset( &$$, &gz_yynullval, &$1, &$-1 ); } ; font_list : font_item { sar_make_font_table( &$$, &$1, &gz_yynullval, &$-1 ); } | font_list COMMA font_item { sar_make_font_table( &$$, &$3, &$1, &$-1 ); } ; /* ** THIS PRODUCTION DOESN'T LOOK RIGHT!!!!!!!!!!!!!!!!!!!!!! */ font_item : valid_charset EQUAL_SIGN private_value { sar_make_font_item( &$$, &$1, &$3 ); } | private_value { sar_make_font_item( &$$, &gz_yynullval, &$1 ); } ; optional_charset : POUND valid_charset { /* Don't use TRUE because it is a token not a Boolean! */ $$ = $2; Uil_lex_l_charset_specified = 1;} | epsilon_production ; valid_charset : CHARSET_NAME { sar_charset_verify (&$1); $$ = $1; } | CHARACTER_SET LEFT_PAREN charset_info RIGHT_PAREN { $$ = $3; } | NAME { sar_make_fallback_charset(&$1); $$ = $1; } ; charset_info : character_8_value { sar_make_private_value(&$$, &$1, sym_k_char_8_value, &$1, 0); sar_make_charset (&$$, &$$, &gz_yynullval, &$1); } | character_8_value charset_attrs { sar_make_private_value(&$$, &$1, sym_k_char_8_value, &$1, 0); sar_make_charset (&$$, &$$, &$2, &$1); } ; charset_attrs : COMMA charset_attr { sar_chk_charset_attr( &$$, &$2, &gz_yynullval ); } | charset_attrs COMMA charset_attr { sar_chk_charset_attr( &$$, &$3, &$1 ); } ; charset_attr : RIGHT_TO_LEFT EQUAL_SIGN private_value { $$.b_type = $1.b_type; if ($3.b_type != sym_k_bool_value) sar_value_type_error( &$3, sym_k_bool_value ); $$.value.az_symbol_entry = $3.value.az_symbol_entry; } | SIXTEEN_BIT EQUAL_SIGN private_value { $$.b_type = $1.b_type; if ($3.b_type != sym_k_bool_value) sar_value_type_error( &$3, sym_k_bool_value ); $$.value.az_symbol_entry = $3.value.az_symbol_entry; } ; color_list : color_item { sar_append_color_item( &$$, &$1, &gz_yynullval ); } | color_list COMMA color_item { sar_append_color_item( &$$, &$3, &$1 ); } ; color_item : BACKGROUND COLOR EQUAL_SIGN character_8_value { sar_make_color_item( &$$, &$1, &$4 ); } | FOREGROUND COLOR EQUAL_SIGN character_8_value { sar_make_color_item( &$$, &$1, &$4 ); } | value EQUAL_SIGN character_8_value { sar_make_color_item( &$$, &$1, &$3 ); } ; color_spec : character_8_value { sar_make_color( &$$, &$1, &gz_yynullval, &$-1 ); } | character_8_value COMMA mono_color_spec { sar_make_color( &$$, &$1, &$3, &$-1 ); } ; mono_color_spec : BACKGROUND | FOREGROUND ; icon_spec : icon_rows { sar_make_icon( &$$, &$1, &gz_yynullval, &$-1); } | COLOR_TABLE EQUAL_SIGN private_value COMMA icon_rows { sar_make_icon( &$$, &$5, &$3, &$-1 ); } ; icon_rows : private_value { sar_append_table_value (&$1, &gz_yynullval, sym_k_icon_value, &$1); $$ = $1; } | icon_rows COMMA private_value { sar_append_table_value (&$3, &$1, sym_k_icon_value, &$2); $$ = $3; } ; units_specification : PIX { $$ = $1; } | PIXEL { $$ = $1; } | PIXELS { $$ = $1; } | IN { $$ = $1; } | INCH { $$ = $1; } | INCHES { $$ = $1; } | CM { $$ = $1; } | CENTIMETER { $$ = $1; } | CENTIMETERS { $$ = $1; } | MM { $$ = $1; } | MILLIMETER { $$ = $1; } | MILLIMETERS { $$ = $1; } | PT { $$ = $1; } | POINT { $$ = $1; } | POINTS { $$ = $1; } | FU { $$ = $1; } | FONT_UNIT { $$ = $1; } | FONT_UNITS { $$ = $1; } ; %% /* Dummy error routine for the parser. We will output our own error messages. */ int yyerror (s) char * s; { return 0; } motif-2.3.8/tools/wml/UilKeyTab.h0000644000175000017500000102233513211513006013522 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* case sensitive keyword table */ static key_keytable_entry_type key_table_vec[] = { {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 3, CHARSET_NAME, "866"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 5, CHARSET_NAME, "88591"}, {tkn_k_class_charset, sym_k_iso_latin2_charset, 5, CHARSET_NAME, "88592"}, {tkn_k_class_charset, sym_k_iso_latin3_charset, 5, CHARSET_NAME, "88593"}, {tkn_k_class_charset, sym_k_iso_latin4_charset, 5, CHARSET_NAME, "88594"}, {tkn_k_class_charset, sym_k_iso_latin5_charset, 5, CHARSET_NAME, "88595"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 5, CHARSET_NAME, "88596"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 5, CHARSET_NAME, "88597"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 5, CHARSET_NAME, "88598"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 9, CHARSET_NAME, "ANSI-1251"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 8, CHARSET_NAME, "ANSI1251"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 5, CHARSET_NAME, "ASCII"}, {tkn_k_class_enumval, sym_k_Always_enumval, 6, ENUMVAL_NAME, "Always"}, {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 5, CHARSET_NAME, "CP866"}, {tkn_k_class_class, sym_k_DtEditor_object, 8, CLASS_NAME, "DtEditor"}, {tkn_k_class_enumval, sym_k_DtHELP_AS_NEEDED_SCROLLBARS_enumval, 27, ENUMVAL_NAME, "DtHELP_AS_NEEDED_SCROLLBARS"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_ALL_enumval, 18, ENUMVAL_NAME, "DtHELP_EXECUTE_ALL"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_NONE_enumval, 19, ENUMVAL_NAME, "DtHELP_EXECUTE_NONE"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_QUERY_ALL_enumval, 24, ENUMVAL_NAME, "DtHELP_EXECUTE_QUERY_ALL"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_QUERY_UNALIASED_enumval, 30, ENUMVAL_NAME, "DtHELP_EXECUTE_QUERY_UNALIASED"}, {tkn_k_class_enumval, sym_k_DtHELP_NO_SCROLLBARS_enumval, 20, ENUMVAL_NAME, "DtHELP_NO_SCROLLBARS"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_A4_enumval, 19, ENUMVAL_NAME, "DtHELP_PAPERSIZE_A4"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_B5_enumval, 19, ENUMVAL_NAME, "DtHELP_PAPERSIZE_B5"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_EXECUTIVE_enumval, 26, ENUMVAL_NAME, "DtHELP_PAPERSIZE_EXECUTIVE"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_LEGAL_enumval, 22, ENUMVAL_NAME, "DtHELP_PAPERSIZE_LEGAL"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_LETTER_enumval, 23, ENUMVAL_NAME, "DtHELP_PAPERSIZE_LETTER"}, {tkn_k_class_enumval, sym_k_DtHELP_STATIC_SCROLLBARS_enumval, 24, ENUMVAL_NAME, "DtHELP_STATIC_SCROLLBARS"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_DYNAMIC_STRING_enumval, 26, ENUMVAL_NAME, "DtHELP_TYPE_DYNAMIC_STRING"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_FILE_enumval, 16, ENUMVAL_NAME, "DtHELP_TYPE_FILE"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_MAN_PAGE_enumval, 20, ENUMVAL_NAME, "DtHELP_TYPE_MAN_PAGE"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_STRING_enumval, 18, ENUMVAL_NAME, "DtHELP_TYPE_STRING"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_TOPIC_enumval, 17, ENUMVAL_NAME, "DtHELP_TYPE_TOPIC"}, {tkn_k_class_class, sym_k_DtHelpDialog_object, 12, CLASS_NAME, "DtHelpDialog"}, {tkn_k_class_class, sym_k_DtHelpQuickDialog_object, 17, CLASS_NAME, "DtHelpQuickDialog"}, {tkn_k_class_enumval, sym_k_DtLONG_NAME_enumval, 11, ENUMVAL_NAME, "DtLONG_NAME"}, {tkn_k_class_enumval, sym_k_DtMEDIUM_NAME_enumval, 13, ENUMVAL_NAME, "DtMEDIUM_NAME"}, {tkn_k_class_class, sym_k_DtMenuButton_object, 12, CLASS_NAME, "DtMenuButton"}, {tkn_k_class_argument, sym_k_DtNallowSendEvents_arg, 18, ARGUMENT_NAME, "DtNallowSendEvents"}, {tkn_k_class_argument, sym_k_DtNappCursorDefault_arg, 19, ARGUMENT_NAME, "DtNappCursorDefault"}, {tkn_k_class_argument, sym_k_DtNappKeypadDefault_arg, 19, ARGUMENT_NAME, "DtNappKeypadDefault"}, {tkn_k_class_argument, sym_k_DtNautoShowCursorPosition_arg, 25, ARGUMENT_NAME, "DtNautoShowCursorPosition"}, {tkn_k_class_argument, sym_k_DtNautoWrap_arg, 11, ARGUMENT_NAME, "DtNautoWrap"}, {tkn_k_class_argument, sym_k_DtNbackLabelString_arg, 18, ARGUMENT_NAME, "DtNbackLabelString"}, {tkn_k_class_argument, sym_k_DtNbackgroundIsSelect_arg, 21, ARGUMENT_NAME, "DtNbackgroundIsSelect"}, {tkn_k_class_argument, sym_k_DtNbaseHeight_arg, 13, ARGUMENT_NAME, "DtNbaseHeight"}, {tkn_k_class_argument, sym_k_DtNbaseWidth_arg, 12, ARGUMENT_NAME, "DtNbaseWidth"}, {tkn_k_class_argument, sym_k_DtNblinkRate_arg, 12, ARGUMENT_NAME, "DtNblinkRate"}, {tkn_k_class_argument, sym_k_DtNbuttonFontList_arg, 17, ARGUMENT_NAME, "DtNbuttonFontList"}, {tkn_k_class_argument, sym_k_DtNc132_arg, 7, ARGUMENT_NAME, "DtNc132"}, {tkn_k_class_reason, sym_k_DtNcancelCallback_reason, 17, REASON_NAME, "DtNcancelCallback"}, {tkn_k_class_argument, sym_k_DtNcascadePixmap_arg, 16, ARGUMENT_NAME, "DtNcascadePixmap"}, {tkn_k_class_reason, sym_k_DtNcascadingCallback_reason, 20, REASON_NAME, "DtNcascadingCallback"}, {tkn_k_class_argument, sym_k_DtNcenterToggleLabel_arg, 20, ARGUMENT_NAME, "DtNcenterToggleLabel"}, {tkn_k_class_argument, sym_k_DtNchangeAllButtonLabel_arg, 23, ARGUMENT_NAME, "DtNchangeAllButtonLabel"}, {tkn_k_class_argument, sym_k_DtNchangeButtonLabel_arg, 20, ARGUMENT_NAME, "DtNchangeButtonLabel"}, {tkn_k_class_argument, sym_k_DtNchangeFieldLabel_arg, 19, ARGUMENT_NAME, "DtNchangeFieldLabel"}, {tkn_k_class_argument, sym_k_DtNcharCursorStyle_arg, 18, ARGUMENT_NAME, "DtNcharCursorStyle"}, {tkn_k_class_reason, sym_k_DtNcloseCallback_reason, 16, REASON_NAME, "DtNcloseCallback"}, {tkn_k_class_argument, sym_k_DtNcloseLabelString_arg, 19, ARGUMENT_NAME, "DtNcloseLabelString"}, {tkn_k_class_reason, sym_k_DtNclosePrintDisplayCallback_reason, 28, REASON_NAME, "DtNclosePrintDisplayCallback"}, {tkn_k_class_argument, sym_k_DtNcolumns_arg, 10, ARGUMENT_NAME, "DtNcolumns"}, {tkn_k_class_argument, sym_k_DtNconsoleMode_arg, 14, ARGUMENT_NAME, "DtNconsoleMode"}, {tkn_k_class_argument, sym_k_DtNcopies_arg, 9, ARGUMENT_NAME, "DtNcopies"}, {tkn_k_class_argument, sym_k_DtNcsWidth_arg, 10, ARGUMENT_NAME, "DtNcsWidth"}, {tkn_k_class_argument, sym_k_DtNcurrentLineLabel_arg, 19, ARGUMENT_NAME, "DtNcurrentLineLabel"}, {tkn_k_class_argument, sym_k_DtNcursorPosition_arg, 17, ARGUMENT_NAME, "DtNcursorPosition"}, {tkn_k_class_argument, sym_k_DtNcursorPositionVisible_arg, 24, ARGUMENT_NAME, "DtNcursorPositionVisible"}, {tkn_k_class_argument, sym_k_DtNdescription_arg, 14, ARGUMENT_NAME, "DtNdescription"}, {tkn_k_class_argument, sym_k_DtNdialogTitle_arg, 14, ARGUMENT_NAME, "DtNdialogTitle"}, {tkn_k_class_argument, sym_k_DtNeditable_arg, 11, ARGUMENT_NAME, "DtNeditable"}, {tkn_k_class_argument, sym_k_DtNemulationId_arg, 14, ARGUMENT_NAME, "DtNemulationId"}, {tkn_k_class_argument, sym_k_DtNexecutionPolicy_arg, 18, ARGUMENT_NAME, "DtNexecutionPolicy"}, {tkn_k_class_argument, sym_k_DtNfileName_arg, 11, ARGUMENT_NAME, "DtNfileName"}, {tkn_k_class_argument, sym_k_DtNfindButtonLabel_arg, 18, ARGUMENT_NAME, "DtNfindButtonLabel"}, {tkn_k_class_argument, sym_k_DtNfindChangeDialogTitle_arg, 24, ARGUMENT_NAME, "DtNfindChangeDialogTitle"}, {tkn_k_class_argument, sym_k_DtNfindFieldLabel_arg, 17, ARGUMENT_NAME, "DtNfindFieldLabel"}, {tkn_k_class_argument, sym_k_DtNformatAllButtonLabel_arg, 23, ARGUMENT_NAME, "DtNformatAllButtonLabel"}, {tkn_k_class_argument, sym_k_DtNformatParagraphButtonLabel_arg, 29, ARGUMENT_NAME, "DtNformatParagraphButtonLabel"}, {tkn_k_class_argument, sym_k_DtNformatSettingsDialogTitle_arg, 28, ARGUMENT_NAME, "DtNformatSettingsDialogTitle"}, {tkn_k_class_argument, sym_k_DtNheightInc_arg, 12, ARGUMENT_NAME, "DtNheightInc"}, {tkn_k_class_argument, sym_k_DtNhelpFile_arg, 11, ARGUMENT_NAME, "DtNhelpFile"}, {tkn_k_class_argument, sym_k_DtNhelpLabelString_arg, 18, ARGUMENT_NAME, "DtNhelpLabelString"}, {tkn_k_class_argument, sym_k_DtNhelpOnHelpVolume_arg, 19, ARGUMENT_NAME, "DtNhelpOnHelpVolume"}, {tkn_k_class_argument, sym_k_DtNhelpPrint_arg, 12, ARGUMENT_NAME, "DtNhelpPrint"}, {tkn_k_class_argument, sym_k_DtNhelpType_arg, 11, ARGUMENT_NAME, "DtNhelpType"}, {tkn_k_class_argument, sym_k_DtNhelpVolume_arg, 13, ARGUMENT_NAME, "DtNhelpVolume"}, {tkn_k_class_reason, sym_k_DtNhyperLinkCallback_reason, 20, REASON_NAME, "DtNhyperLinkCallback"}, {tkn_k_class_argument, sym_k_DtNinformationDialogTitle_arg, 25, ARGUMENT_NAME, "DtNinformationDialogTitle"}, {tkn_k_class_reason, sym_k_DtNinputVerifyCallback_reason, 22, REASON_NAME, "DtNinputVerifyCallback"}, {tkn_k_class_argument, sym_k_DtNinsertLabel_arg, 14, ARGUMENT_NAME, "DtNinsertLabel"}, {tkn_k_class_argument, sym_k_DtNjumpScroll_arg, 13, ARGUMENT_NAME, "DtNjumpScroll"}, {tkn_k_class_argument, sym_k_DtNjustifyToggleLabel_arg, 21, ARGUMENT_NAME, "DtNjustifyToggleLabel"}, {tkn_k_class_argument, sym_k_DtNkshMode_arg, 10, ARGUMENT_NAME, "DtNkshMode"}, {tkn_k_class_argument, sym_k_DtNlabelFontList_arg, 16, ARGUMENT_NAME, "DtNlabelFontList"}, {tkn_k_class_argument, sym_k_DtNleftAlignToggleLabel_arg, 23, ARGUMENT_NAME, "DtNleftAlignToggleLabel"}, {tkn_k_class_argument, sym_k_DtNleftMarginFieldLabel_arg, 23, ARGUMENT_NAME, "DtNleftMarginFieldLabel"}, {tkn_k_class_argument, sym_k_DtNlocationId_arg, 13, ARGUMENT_NAME, "DtNlocationId"}, {tkn_k_class_argument, sym_k_DtNlogFile_arg, 10, ARGUMENT_NAME, "DtNlogFile"}, {tkn_k_class_argument, sym_k_DtNlogInhibit_arg, 13, ARGUMENT_NAME, "DtNlogInhibit"}, {tkn_k_class_argument, sym_k_DtNlogging_arg, 10, ARGUMENT_NAME, "DtNlogging"}, {tkn_k_class_argument, sym_k_DtNmanPage_arg, 10, ARGUMENT_NAME, "DtNmanPage"}, {tkn_k_class_argument, sym_k_DtNmapOnOutput_arg, 14, ARGUMENT_NAME, "DtNmapOnOutput"}, {tkn_k_class_argument, sym_k_DtNmapOnOutputDelay_arg, 19, ARGUMENT_NAME, "DtNmapOnOutputDelay"}, {tkn_k_class_argument, sym_k_DtNmarginBell_arg, 13, ARGUMENT_NAME, "DtNmarginBell"}, {tkn_k_class_argument, sym_k_DtNmarginHeight_arg, 15, ARGUMENT_NAME, "DtNmarginHeight"}, {tkn_k_class_argument, sym_k_DtNmarginWidth_arg, 14, ARGUMENT_NAME, "DtNmarginWidth"}, {tkn_k_class_argument, sym_k_DtNmaxLength_arg, 12, ARGUMENT_NAME, "DtNmaxLength"}, {tkn_k_class_argument, sym_k_DtNminimizeButtons_arg, 18, ARGUMENT_NAME, "DtNminimizeButtons"}, {tkn_k_class_argument, sym_k_DtNmisspelledListLabel_arg, 22, ARGUMENT_NAME, "DtNmisspelledListLabel"}, {tkn_k_class_argument, sym_k_DtNmoreLabelString_arg, 18, ARGUMENT_NAME, "DtNmoreLabelString"}, {tkn_k_class_argument, sym_k_DtNnMarginBell_arg, 14, ARGUMENT_NAME, "DtNnMarginBell"}, {tkn_k_class_reason, sym_k_DtNoutputLogCallback_reason, 20, REASON_NAME, "DtNoutputLogCallback"}, {tkn_k_class_argument, sym_k_DtNoverstrike_arg, 13, ARGUMENT_NAME, "DtNoverstrike"}, {tkn_k_class_argument, sym_k_DtNoverstrikeLabel_arg, 18, ARGUMENT_NAME, "DtNoverstrikeLabel"}, {tkn_k_class_argument, sym_k_DtNpaperSize_arg, 12, ARGUMENT_NAME, "DtNpaperSize"}, {tkn_k_class_argument, sym_k_DtNpointerBlank_arg, 15, ARGUMENT_NAME, "DtNpointerBlank"}, {tkn_k_class_argument, sym_k_DtNpointerBlankDelay_arg, 20, ARGUMENT_NAME, "DtNpointerBlankDelay"}, {tkn_k_class_argument, sym_k_DtNpointerColor_arg, 15, ARGUMENT_NAME, "DtNpointerColor"}, {tkn_k_class_argument, sym_k_DtNpointerColorBackground_arg, 25, ARGUMENT_NAME, "DtNpointerColorBackground"}, {tkn_k_class_argument, sym_k_DtNpointerShape_arg, 15, ARGUMENT_NAME, "DtNpointerShape"}, {tkn_k_class_reason, sym_k_DtNprintCallback_reason, 16, REASON_NAME, "DtNprintCallback"}, {tkn_k_class_argument, sym_k_DtNprintDestination_arg, 19, ARGUMENT_NAME, "DtNprintDestination"}, {tkn_k_class_argument, sym_k_DtNprintLabelString_arg, 19, ARGUMENT_NAME, "DtNprintLabelString"}, {tkn_k_class_argument, sym_k_DtNprintSetupMode_arg, 17, ARGUMENT_NAME, "DtNprintSetupMode"}, {tkn_k_class_argument, sym_k_DtNprinter_arg, 10, ARGUMENT_NAME, "DtNprinter"}, {tkn_k_class_argument, sym_k_DtNprinterInfoProc_arg, 18, ARGUMENT_NAME, "DtNprinterInfoProc"}, {tkn_k_class_argument, sym_k_DtNprinterName_arg, 14, ARGUMENT_NAME, "DtNprinterName"}, {tkn_k_class_argument, sym_k_DtNreverseVideo_arg, 15, ARGUMENT_NAME, "DtNreverseVideo"}, {tkn_k_class_argument, sym_k_DtNreverseWrap_arg, 14, ARGUMENT_NAME, "DtNreverseWrap"}, {tkn_k_class_argument, sym_k_DtNrightAlignToggleLabel_arg, 24, ARGUMENT_NAME, "DtNrightAlignToggleLabel"}, {tkn_k_class_argument, sym_k_DtNrightMarginFieldLabel_arg, 24, ARGUMENT_NAME, "DtNrightMarginFieldLabel"}, {tkn_k_class_argument, sym_k_DtNrows_arg, 7, ARGUMENT_NAME, "DtNrows"}, {tkn_k_class_argument, sym_k_DtNsaveLines_arg, 12, ARGUMENT_NAME, "DtNsaveLines"}, {tkn_k_class_argument, sym_k_DtNscrollBarPolicy_arg, 18, ARGUMENT_NAME, "DtNscrollBarPolicy"}, {tkn_k_class_argument, sym_k_DtNscrollHorizontal_arg, 19, ARGUMENT_NAME, "DtNscrollHorizontal"}, {tkn_k_class_argument, sym_k_DtNscrollLeftSide_arg, 17, ARGUMENT_NAME, "DtNscrollLeftSide"}, {tkn_k_class_argument, sym_k_DtNscrollTopSide_arg, 16, ARGUMENT_NAME, "DtNscrollTopSide"}, {tkn_k_class_argument, sym_k_DtNscrollVertical_arg, 17, ARGUMENT_NAME, "DtNscrollVertical"}, {tkn_k_class_argument, sym_k_DtNselectFileProc_arg, 17, ARGUMENT_NAME, "DtNselectFileProc"}, {tkn_k_class_argument, sym_k_DtNselectPrinterProc_arg, 20, ARGUMENT_NAME, "DtNselectPrinterProc"}, {tkn_k_class_reason, sym_k_DtNsetupCallback_reason, 16, REASON_NAME, "DtNsetupCallback"}, {tkn_k_class_argument, sym_k_DtNshadowType_arg, 13, ARGUMENT_NAME, "DtNshadowType"}, {tkn_k_class_argument, sym_k_DtNshowNewWindowButton_arg, 22, ARGUMENT_NAME, "DtNshowNewWindowButton"}, {tkn_k_class_argument, sym_k_DtNshowStatusLine_arg, 17, ARGUMENT_NAME, "DtNshowStatusLine"}, {tkn_k_class_argument, sym_k_DtNspellDialogTitle_arg, 19, ARGUMENT_NAME, "DtNspellDialogTitle"}, {tkn_k_class_argument, sym_k_DtNspellFilter_arg, 14, ARGUMENT_NAME, "DtNspellFilter"}, {tkn_k_class_reason, sym_k_DtNstatusChangeCallback_reason, 23, REASON_NAME, "DtNstatusChangeCallback"}, {tkn_k_class_argument, sym_k_DtNstickyNextCursor_arg, 19, ARGUMENT_NAME, "DtNstickyNextCursor"}, {tkn_k_class_argument, sym_k_DtNstickyPrevCursor_arg, 19, ARGUMENT_NAME, "DtNstickyPrevCursor"}, {tkn_k_class_argument, sym_k_DtNstringData_arg, 13, ARGUMENT_NAME, "DtNstringData"}, {tkn_k_class_argument, sym_k_DtNsubMenuId_arg, 12, ARGUMENT_NAME, "DtNsubMenuId"}, {tkn_k_class_argument, sym_k_DtNsubprocessArgv_arg, 17, ARGUMENT_NAME, "DtNsubprocessArgv"}, {tkn_k_class_argument, sym_k_DtNsubprocessCmd_arg, 16, ARGUMENT_NAME, "DtNsubprocessCmd"}, {tkn_k_class_argument, sym_k_DtNsubprocessExec_arg, 17, ARGUMENT_NAME, "DtNsubprocessExec"}, {tkn_k_class_argument, sym_k_DtNsubprocessLoginShell_arg, 23, ARGUMENT_NAME, "DtNsubprocessLoginShell"}, {tkn_k_class_argument, sym_k_DtNsubprocessPid_arg, 16, ARGUMENT_NAME, "DtNsubprocessPid"}, {tkn_k_class_reason, sym_k_DtNsubprocessTerminationCallback_reason, 32, REASON_NAME, "DtNsubprocessTerminationCallback"}, {tkn_k_class_argument, sym_k_DtNsubprocessTerminationCatch_arg, 29, ARGUMENT_NAME, "DtNsubprocessTerminationCatch"}, {tkn_k_class_argument, sym_k_DtNsunFunctionKeys_arg, 18, ARGUMENT_NAME, "DtNsunFunctionKeys"}, {tkn_k_class_argument, sym_k_DtNtermDevice_arg, 13, ARGUMENT_NAME, "DtNtermDevice"}, {tkn_k_class_argument, sym_k_DtNtermDeviceAllocate_arg, 21, ARGUMENT_NAME, "DtNtermDeviceAllocate"}, {tkn_k_class_argument, sym_k_DtNtermId_arg, 9, ARGUMENT_NAME, "DtNtermId"}, {tkn_k_class_argument, sym_k_DtNtermName_arg, 11, ARGUMENT_NAME, "DtNtermName"}, {tkn_k_class_argument, sym_k_DtNtermSlaveName_arg, 16, ARGUMENT_NAME, "DtNtermSlaveName"}, {tkn_k_class_argument, sym_k_DtNtextBackground_arg, 17, ARGUMENT_NAME, "DtNtextBackground"}, {tkn_k_class_reason, sym_k_DtNtextDeselectCallback_reason, 23, REASON_NAME, "DtNtextDeselectCallback"}, {tkn_k_class_argument, sym_k_DtNtextFontList_arg, 15, ARGUMENT_NAME, "DtNtextFontList"}, {tkn_k_class_argument, sym_k_DtNtextForeground_arg, 17, ARGUMENT_NAME, "DtNtextForeground"}, {tkn_k_class_reason, sym_k_DtNtextSelectCallback_reason, 21, REASON_NAME, "DtNtextSelectCallback"}, {tkn_k_class_argument, sym_k_DtNtextTranslations_arg, 19, ARGUMENT_NAME, "DtNtextTranslations"}, {tkn_k_class_argument, sym_k_DtNtopCharacter_arg, 15, ARGUMENT_NAME, "DtNtopCharacter"}, {tkn_k_class_argument, sym_k_DtNtopicTitle_arg, 13, ARGUMENT_NAME, "DtNtopicTitle"}, {tkn_k_class_argument, sym_k_DtNtotalLineCountLabel_arg, 22, ARGUMENT_NAME, "DtNtotalLineCountLabel"}, {tkn_k_class_argument, sym_k_DtNttyModes_arg, 11, ARGUMENT_NAME, "DtNttyModes"}, {tkn_k_class_argument, sym_k_DtNuserBoldFont_arg, 15, ARGUMENT_NAME, "DtNuserBoldFont"}, {tkn_k_class_argument, sym_k_DtNuserFont_arg, 11, ARGUMENT_NAME, "DtNuserFont"}, {tkn_k_class_argument, sym_k_DtNverifyPrinterProc_arg, 20, ARGUMENT_NAME, "DtNverifyPrinterProc"}, {tkn_k_class_argument, sym_k_DtNverticalScrollBar_arg, 20, ARGUMENT_NAME, "DtNverticalScrollBar"}, {tkn_k_class_argument, sym_k_DtNvisiblePathCount_arg, 19, ARGUMENT_NAME, "DtNvisiblePathCount"}, {tkn_k_class_argument, sym_k_DtNvisualBell_arg, 13, ARGUMENT_NAME, "DtNvisualBell"}, {tkn_k_class_argument, sym_k_DtNwidthInc_arg, 11, ARGUMENT_NAME, "DtNwidthInc"}, {tkn_k_class_argument, sym_k_DtNwordWrap_arg, 11, ARGUMENT_NAME, "DtNwordWrap"}, {tkn_k_class_argument, sym_k_DtNworkAreaLocation_arg, 19, ARGUMENT_NAME, "DtNworkAreaLocation"}, {tkn_k_class_enumval, sym_k_DtPRINT_CLOSE_CONNECTION_enumval, 24, ENUMVAL_NAME, "DtPRINT_CLOSE_CONNECTION"}, {tkn_k_class_enumval, sym_k_DtPRINT_NO_DESTINATION_enumval, 22, ENUMVAL_NAME, "DtPRINT_NO_DESTINATION"}, {tkn_k_class_enumval, sym_k_DtPRINT_RELEASE_CONNECTION_enumval, 26, ENUMVAL_NAME, "DtPRINT_RELEASE_CONNECTION"}, {tkn_k_class_enumval, sym_k_DtPRINT_SETUP_PLAIN_enumval, 19, ENUMVAL_NAME, "DtPRINT_SETUP_PLAIN"}, {tkn_k_class_enumval, sym_k_DtPRINT_SETUP_XP_enumval, 16, ENUMVAL_NAME, "DtPRINT_SETUP_XP"}, {tkn_k_class_enumval, sym_k_DtPRINT_TO_FILE_enumval, 15, ENUMVAL_NAME, "DtPRINT_TO_FILE"}, {tkn_k_class_enumval, sym_k_DtPRINT_TO_PRINTER_enumval, 18, ENUMVAL_NAME, "DtPRINT_TO_PRINTER"}, {tkn_k_class_class, sym_k_DtPrintSetupBox_object, 15, CLASS_NAME, "DtPrintSetupBox"}, {tkn_k_class_class, sym_k_DtPrintSetupDialog_object, 18, CLASS_NAME, "DtPrintSetupDialog"}, {tkn_k_class_enumval, sym_k_DtSHADOW_ETCHED_IN_enumval, 18, ENUMVAL_NAME, "DtSHADOW_ETCHED_IN"}, {tkn_k_class_enumval, sym_k_DtSHADOW_ETCHED_OUT_enumval, 19, ENUMVAL_NAME, "DtSHADOW_ETCHED_OUT"}, {tkn_k_class_enumval, sym_k_DtSHADOW_IN_enumval, 11, ENUMVAL_NAME, "DtSHADOW_IN"}, {tkn_k_class_enumval, sym_k_DtSHADOW_OUT_enumval, 12, ENUMVAL_NAME, "DtSHADOW_OUT"}, {tkn_k_class_enumval, sym_k_DtSHORT_NAME_enumval, 12, ENUMVAL_NAME, "DtSHORT_NAME"}, {tkn_k_class_enumval, sym_k_DtTERM_CHAR_CURSOR_BAR_enumval, 22, ENUMVAL_NAME, "DtTERM_CHAR_CURSOR_BAR"}, {tkn_k_class_enumval, sym_k_DtTERM_CHAR_CURSOR_BOX_enumval, 22, ENUMVAL_NAME, "DtTERM_CHAR_CURSOR_BOX"}, {tkn_k_class_enumval, sym_k_DtTERM_CHAR_CURSOR_INVISIBLE_enumval, 28, ENUMVAL_NAME, "DtTERM_CHAR_CURSOR_INVISIBLE"}, {tkn_k_class_class, sym_k_DtTerm_object, 6, CLASS_NAME, "DtTerm"}, {tkn_k_class_class, sym_k_DtTermPrimitive_object, 15, CLASS_NAME, "DtTermPrimitive"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_BOTTOM_enumval, 18, ENUMVAL_NAME, "DtWORK_AREA_BOTTOM"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_NONE_enumval, 16, ENUMVAL_NAME, "DtWORK_AREA_NONE"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_TOP_enumval, 15, ENUMVAL_NAME, "DtWORK_AREA_TOP"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_TOP_AND_BOTTOM_enumval, 26, ENUMVAL_NAME, "DtWORK_AREA_TOP_AND_BOTTOM"}, {tkn_k_class_enumval, sym_k_FALSE_enumval, 5, ENUMVAL_NAME, "FALSE"}, {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 7, CHARSET_NAME, "IBM-866"}, {tkn_k_class_charset, sym_k_iso_cyrillic_charset, 10, CHARSET_NAME, "ISO-8859-5"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 9, CHARSET_NAME, "ISOLatin1"}, {tkn_k_class_charset, sym_k_iso_latin2_charset, 9, CHARSET_NAME, "ISOLatin2"}, {tkn_k_class_charset, sym_k_iso_latin3_charset, 9, CHARSET_NAME, "ISOLatin3"}, {tkn_k_class_charset, sym_k_iso_latin4_charset, 9, CHARSET_NAME, "ISOLatin4"}, {tkn_k_class_charset, sym_k_iso_latin5_charset, 9, CHARSET_NAME, "ISOLatin5"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 9, CHARSET_NAME, "ISOLatin6"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 9, CHARSET_NAME, "ISOLatin7"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 9, CHARSET_NAME, "ISOLatin8"}, {tkn_k_class_enumval, sym_k_IconicState_enumval, 11, ENUMVAL_NAME, "IconicState"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 6, CHARSET_NAME, "KOI8-R"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 7, CHARSET_NAME, "KOI8-RU"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 6, CHARSET_NAME, "KOI8-U"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 5, CHARSET_NAME, "KOI8R"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 6, CHARSET_NAME, "KOI8RU"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 5, CHARSET_NAME, "KOI8U"}, {tkn_k_class_enumval, sym_k_LineDoubleDash_enumval, 14, ENUMVAL_NAME, "LineDoubleDash"}, {tkn_k_class_enumval, sym_k_LineOnOffDash_enumval, 13, ENUMVAL_NAME, "LineOnOffDash"}, {tkn_k_class_enumval, sym_k_LineSolid_enumval, 9, ENUMVAL_NAME, "LineSolid"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_ALL_enumval, 13, ENUMVAL_NAME, "MWM_DECOR_ALL"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_BORDER_enumval, 16, ENUMVAL_NAME, "MWM_DECOR_BORDER"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_MAXIMIZE_enumval, 18, ENUMVAL_NAME, "MWM_DECOR_MAXIMIZE"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_MENU_enumval, 14, ENUMVAL_NAME, "MWM_DECOR_MENU"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_MINIMIZE_enumval, 18, ENUMVAL_NAME, "MWM_DECOR_MINIMIZE"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_RESIZEH_enumval, 17, ENUMVAL_NAME, "MWM_DECOR_RESIZEH"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_TITLE_enumval, 15, ENUMVAL_NAME, "MWM_DECOR_TITLE"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_ALL_enumval, 12, ENUMVAL_NAME, "MWM_FUNC_ALL"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_CLOSE_enumval, 14, ENUMVAL_NAME, "MWM_FUNC_CLOSE"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_MOVE_enumval, 13, ENUMVAL_NAME, "MWM_FUNC_MOVE"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_RESIZE_enumval, 15, ENUMVAL_NAME, "MWM_FUNC_RESIZE"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_FULL_APPLICATION_MODAL_enumval, 32, ENUMVAL_NAME, "MWM_INPUT_FULL_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_MODELESS_enumval, 18, ENUMVAL_NAME, "MWM_INPUT_MODELESS"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_PRIMARY_APPLICATION_MODAL_enumval, 35, ENUMVAL_NAME, "MWM_INPUT_PRIMARY_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_SYSTEM_MODAL_enumval, 22, ENUMVAL_NAME, "MWM_INPUT_SYSTEM_MODAL"}, {tkn_k_class_reason, sym_k_MrmNcreateCallback_reason, 18, REASON_NAME, "MrmNcreateCallback"}, {tkn_k_class_enumval, sym_k_NormalState_enumval, 11, ENUMVAL_NAME, "NormalState"}, {tkn_k_class_enumval, sym_k_NotUseful_enumval, 9, ENUMVAL_NAME, "NotUseful"}, {tkn_k_class_enumval, sym_k_TRUE_enumval, 4, ENUMVAL_NAME, "TRUE"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 12, CHARSET_NAME, "WINDOWS-1251"}, {tkn_k_class_enumval, sym_k_WhenMapped_enumval, 10, ENUMVAL_NAME, "WhenMapped"}, {tkn_k_class_enumval, sym_k_Xm1000TH_INCHES_enumval, 15, ENUMVAL_NAME, "Xm1000TH_INCHES"}, {tkn_k_class_enumval, sym_k_Xm100TH_FONT_UNITS_enumval, 18, ENUMVAL_NAME, "Xm100TH_FONT_UNITS"}, {tkn_k_class_enumval, sym_k_Xm100TH_MILLIMETERS_enumval, 19, ENUMVAL_NAME, "Xm100TH_MILLIMETERS"}, {tkn_k_class_enumval, sym_k_Xm100TH_POINTS_enumval, 14, ENUMVAL_NAME, "Xm100TH_POINTS"}, {tkn_k_class_enumval, sym_k_XmABSOLUTE_enumval, 10, ENUMVAL_NAME, "XmABSOLUTE"}, {tkn_k_class_enumval, sym_k_XmADD_MODE_enumval, 10, ENUMVAL_NAME, "XmADD_MODE"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_BASELINE_BOTTOM_enumval, 27, ENUMVAL_NAME, "XmALIGNMENT_BASELINE_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_BASELINE_TOP_enumval, 24, ENUMVAL_NAME, "XmALIGNMENT_BASELINE_TOP"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_BEGINNING_enumval, 21, ENUMVAL_NAME, "XmALIGNMENT_BEGINNING"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_CENTER_enumval, 18, ENUMVAL_NAME, "XmALIGNMENT_CENTER"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_CONTENTS_BOTTOM_enumval, 27, ENUMVAL_NAME, "XmALIGNMENT_CONTENTS_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_CONTENTS_TOP_enumval, 24, ENUMVAL_NAME, "XmALIGNMENT_CONTENTS_TOP"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_END_enumval, 15, ENUMVAL_NAME, "XmALIGNMENT_END"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_UNSPECIFIED_enumval, 23, ENUMVAL_NAME, "XmALIGNMENT_UNSPECIFIED"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_WIDGET_BOTTOM_enumval, 25, ENUMVAL_NAME, "XmALIGNMENT_WIDGET_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_WIDGET_TOP_enumval, 22, ENUMVAL_NAME, "XmALIGNMENT_WIDGET_TOP"}, {tkn_k_class_enumval, sym_k_XmANY_ICON_enumval, 10, ENUMVAL_NAME, "XmANY_ICON"}, {tkn_k_class_enumval, sym_k_XmAPPEND_enumval, 8, ENUMVAL_NAME, "XmAPPEND"}, {tkn_k_class_enumval, sym_k_XmAPPLICATION_DEFINED_enumval, 21, ENUMVAL_NAME, "XmAPPLICATION_DEFINED"}, {tkn_k_class_enumval, sym_k_XmARROWS_BEGINNING_enumval, 18, ENUMVAL_NAME, "XmARROWS_BEGINNING"}, {tkn_k_class_enumval, sym_k_XmARROWS_DECREMENT_SENSITIVE_enumval, 28, ENUMVAL_NAME, "XmARROWS_DECREMENT_SENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_DEFAULT_SENSITIVITY_enumval, 28, ENUMVAL_NAME, "XmARROWS_DEFAULT_SENSITIVITY"}, {tkn_k_class_enumval, sym_k_XmARROWS_END_enumval, 12, ENUMVAL_NAME, "XmARROWS_END"}, {tkn_k_class_enumval, sym_k_XmARROWS_FLAT_BEGINNING_enumval, 23, ENUMVAL_NAME, "XmARROWS_FLAT_BEGINNING"}, {tkn_k_class_enumval, sym_k_XmARROWS_FLAT_END_enumval, 17, ENUMVAL_NAME, "XmARROWS_FLAT_END"}, {tkn_k_class_enumval, sym_k_XmARROWS_HORIZONTAL_enumval, 19, ENUMVAL_NAME, "XmARROWS_HORIZONTAL"}, {tkn_k_class_enumval, sym_k_XmARROWS_INCREMENT_SENSITIVE_enumval, 28, ENUMVAL_NAME, "XmARROWS_INCREMENT_SENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_INSENSITIVE_enumval, 20, ENUMVAL_NAME, "XmARROWS_INSENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_SENSITIVE_enumval, 18, ENUMVAL_NAME, "XmARROWS_SENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_SPLIT_enumval, 14, ENUMVAL_NAME, "XmARROWS_SPLIT"}, {tkn_k_class_enumval, sym_k_XmARROWS_VERTICAL_enumval, 17, ENUMVAL_NAME, "XmARROWS_VERTICAL"}, {tkn_k_class_enumval, sym_k_XmARROW_DOWN_enumval, 12, ENUMVAL_NAME, "XmARROW_DOWN"}, {tkn_k_class_enumval, sym_k_XmARROW_LEFT_enumval, 12, ENUMVAL_NAME, "XmARROW_LEFT"}, {tkn_k_class_enumval, sym_k_XmARROW_RIGHT_enumval, 13, ENUMVAL_NAME, "XmARROW_RIGHT"}, {tkn_k_class_enumval, sym_k_XmARROW_UP_enumval, 10, ENUMVAL_NAME, "XmARROW_UP"}, {tkn_k_class_enumval, sym_k_XmAS_IS_enumval, 7, ENUMVAL_NAME, "XmAS_IS"}, {tkn_k_class_enumval, sym_k_XmAS_NEEDED_enumval, 11, ENUMVAL_NAME, "XmAS_NEEDED"}, {tkn_k_class_enumval, sym_k_XmATTACH_FORM_enumval, 13, ENUMVAL_NAME, "XmATTACH_FORM"}, {tkn_k_class_enumval, sym_k_XmATTACH_NONE_enumval, 13, ENUMVAL_NAME, "XmATTACH_NONE"}, {tkn_k_class_enumval, sym_k_XmATTACH_OPPOSITE_FORM_enumval, 22, ENUMVAL_NAME, "XmATTACH_OPPOSITE_FORM"}, {tkn_k_class_enumval, sym_k_XmATTACH_OPPOSITE_WIDGET_enumval, 24, ENUMVAL_NAME, "XmATTACH_OPPOSITE_WIDGET"}, {tkn_k_class_enumval, sym_k_XmATTACH_POSITION_enumval, 17, ENUMVAL_NAME, "XmATTACH_POSITION"}, {tkn_k_class_enumval, sym_k_XmATTACH_SELF_enumval, 13, ENUMVAL_NAME, "XmATTACH_SELF"}, {tkn_k_class_enumval, sym_k_XmATTACH_WIDGET_enumval, 15, ENUMVAL_NAME, "XmATTACH_WIDGET"}, {tkn_k_class_enumval, sym_k_XmAUTOMATIC_enumval, 11, ENUMVAL_NAME, "XmAUTOMATIC"}, {tkn_k_class_enumval, sym_k_XmAUTO_DRAG_DISABLED_enumval, 20, ENUMVAL_NAME, "XmAUTO_DRAG_DISABLED"}, {tkn_k_class_enumval, sym_k_XmAUTO_DRAG_ENABLED_enumval, 19, ENUMVAL_NAME, "XmAUTO_DRAG_ENABLED"}, {tkn_k_class_enumval, sym_k_XmAUTO_SELECT_enumval, 13, ENUMVAL_NAME, "XmAUTO_SELECT"}, {tkn_k_class_enumval, sym_k_XmAlwaysOpen_enumval, 12, ENUMVAL_NAME, "XmAlwaysOpen"}, {tkn_k_class_class, sym_k_XmArrowButton_object, 13, CLASS_NAME, "XmArrowButton"}, {tkn_k_class_class, sym_k_XmArrowButtonGadget_object, 19, CLASS_NAME, "XmArrowButtonGadget"}, {tkn_k_class_enumval, sym_k_XmBACKGROUND_COLOR_enumval, 18, ENUMVAL_NAME, "XmBACKGROUND_COLOR"}, {tkn_k_class_enumval, sym_k_XmBELL_enumval, 6, ENUMVAL_NAME, "XmBELL"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_LEFT_enumval, 13, ENUMVAL_NAME, "XmBOTTOM_LEFT"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_RIGHT_enumval, 14, ENUMVAL_NAME, "XmBOTTOM_RIGHT"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_TO_TOP_enumval, 15, ENUMVAL_NAME, "XmBOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_TO_TOP_LEFT_TO_RIGHT_enumval, 29, ENUMVAL_NAME, "XmBOTTOM_TO_TOP_LEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_TO_TOP_RIGHT_TO_LEFT_enumval, 29, ENUMVAL_NAME, "XmBOTTOM_TO_TOP_RIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmBROWSE_SELECT_enumval, 15, ENUMVAL_NAME, "XmBROWSE_SELECT"}, {tkn_k_class_class, sym_k_XmBulletinBoard_object, 15, CLASS_NAME, "XmBulletinBoard"}, {tkn_k_class_class, sym_k_XmBulletinBoardDialog_object, 21, CLASS_NAME, "XmBulletinBoardDialog"}, {tkn_k_class_class, sym_k_XmButtonBox_object, 11, CLASS_NAME, "XmButtonBox"}, {tkn_k_class_enumval, sym_k_XmCELLS_enumval, 7, ENUMVAL_NAME, "XmCELLS"}, {tkn_k_class_enumval, sym_k_XmCENTER_enumval, 8, ENUMVAL_NAME, "XmCENTER"}, {tkn_k_class_enumval, sym_k_XmCENTIMETERS_enumval, 13, ENUMVAL_NAME, "XmCENTIMETERS"}, {tkn_k_class_enumval, sym_k_XmCLIP_WINDOW_enumval, 13, ENUMVAL_NAME, "XmCLIP_WINDOW"}, {tkn_k_class_enumval, sym_k_XmCLOSEST_enumval, 9, ENUMVAL_NAME, "XmCLOSEST"}, {tkn_k_class_enumval, sym_k_XmCOLLAPSED_enumval, 11, ENUMVAL_NAME, "XmCOLLAPSED"}, {tkn_k_class_enumval, sym_k_XmCOMBO_BOX_enumval, 11, ENUMVAL_NAME, "XmCOMBO_BOX"}, {tkn_k_class_enumval, sym_k_XmCOMMAND_ABOVE_WORKSPACE_enumval, 25, ENUMVAL_NAME, "XmCOMMAND_ABOVE_WORKSPACE"}, {tkn_k_class_enumval, sym_k_XmCOMMAND_BELOW_WORKSPACE_enumval, 25, ENUMVAL_NAME, "XmCOMMAND_BELOW_WORKSPACE"}, {tkn_k_class_enumval, sym_k_XmCOMMAND_WINDOW_enumval, 16, ENUMVAL_NAME, "XmCOMMAND_WINDOW"}, {tkn_k_class_enumval, sym_k_XmCONSTANT_enumval, 10, ENUMVAL_NAME, "XmCONSTANT"}, {tkn_k_class_class, sym_k_XmCascadeButton_object, 15, CLASS_NAME, "XmCascadeButton"}, {tkn_k_class_class, sym_k_XmCascadeButtonGadget_object, 21, CLASS_NAME, "XmCascadeButtonGadget"}, {tkn_k_class_class, sym_k_XmCheckBox_object, 10, CLASS_NAME, "XmCheckBox"}, {tkn_k_class_enumval, sym_k_XmClosed_enumval, 8, ENUMVAL_NAME, "XmClosed"}, {tkn_k_class_class, sym_k_XmColorSelector_object, 15, CLASS_NAME, "XmColorSelector"}, {tkn_k_class_class, sym_k_XmColumn_object, 8, CLASS_NAME, "XmColumn"}, {tkn_k_class_class, sym_k_XmDropDown_object, 17, CLASS_NAME, "XmCombinationBox2"}, {tkn_k_class_class, sym_k_XmComboBox_object, 10, CLASS_NAME, "XmComboBox"}, {tkn_k_class_class, sym_k_XmCommand_object, 9, CLASS_NAME, "XmCommand"}, {tkn_k_class_class, sym_k_XmCommandDialog_object, 15, CLASS_NAME, "XmCommandDialog"}, {tkn_k_class_class, sym_k_XmContainer_object, 11, CLASS_NAME, "XmContainer"}, {tkn_k_class_enumval, sym_k_XmDEFAULT_DIRECTION_enumval, 19, ENUMVAL_NAME, "XmDEFAULT_DIRECTION"}, {tkn_k_class_enumval, sym_k_XmDESTROY_enumval, 9, ENUMVAL_NAME, "XmDESTROY"}, {tkn_k_class_enumval, sym_k_XmDETAIL_enumval, 8, ENUMVAL_NAME, "XmDETAIL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_APPLICATION_MODAL_enumval, 26, ENUMVAL_NAME, "XmDIALOG_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_CANCEL_BUTTON_enumval, 22, ENUMVAL_NAME, "XmDIALOG_CANCEL_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_COMMAND_enumval, 16, ENUMVAL_NAME, "XmDIALOG_COMMAND"}, {tkn_k_class_enumval, sym_k_XmDIALOG_DEFAULT_BUTTON_enumval, 23, ENUMVAL_NAME, "XmDIALOG_DEFAULT_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_ERROR_enumval, 14, ENUMVAL_NAME, "XmDIALOG_ERROR"}, {tkn_k_class_enumval, sym_k_XmDIALOG_FILE_SELECTION_enumval, 23, ENUMVAL_NAME, "XmDIALOG_FILE_SELECTION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_FULL_APPLICATION_MODAL_enumval, 31, ENUMVAL_NAME, "XmDIALOG_FULL_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_HELP_BUTTON_enumval, 20, ENUMVAL_NAME, "XmDIALOG_HELP_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_INFORMATION_enumval, 20, ENUMVAL_NAME, "XmDIALOG_INFORMATION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_MESSAGE_enumval, 16, ENUMVAL_NAME, "XmDIALOG_MESSAGE"}, {tkn_k_class_enumval, sym_k_XmDIALOG_MESSAGE_LABEL_enumval, 22, ENUMVAL_NAME, "XmDIALOG_MESSAGE_LABEL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_MODELESS_enumval, 17, ENUMVAL_NAME, "XmDIALOG_MODELESS"}, {tkn_k_class_enumval, sym_k_XmDIALOG_OK_BUTTON_enumval, 18, ENUMVAL_NAME, "XmDIALOG_OK_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_PRIMARY_APPLICATION_MODAL_enumval, 34, ENUMVAL_NAME, "XmDIALOG_PRIMARY_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_PROMPT_enumval, 15, ENUMVAL_NAME, "XmDIALOG_PROMPT"}, {tkn_k_class_enumval, sym_k_XmDIALOG_QUESTION_enumval, 17, ENUMVAL_NAME, "XmDIALOG_QUESTION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SELECTION_enumval, 18, ENUMVAL_NAME, "XmDIALOG_SELECTION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SEPARATOR_enumval, 18, ENUMVAL_NAME, "XmDIALOG_SEPARATOR"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SYMBOL_LABEL_enumval, 21, ENUMVAL_NAME, "XmDIALOG_SYMBOL_LABEL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SYSTEM_MODAL_enumval, 21, ENUMVAL_NAME, "XmDIALOG_SYSTEM_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_TEMPLATE_enumval, 17, ENUMVAL_NAME, "XmDIALOG_TEMPLATE"}, {tkn_k_class_enumval, sym_k_XmDIALOG_WARNING_enumval, 16, ENUMVAL_NAME, "XmDIALOG_WARNING"}, {tkn_k_class_enumval, sym_k_XmDIALOG_WORKING_enumval, 16, ENUMVAL_NAME, "XmDIALOG_WORKING"}, {tkn_k_class_enumval, sym_k_XmDIALOG_WORK_AREA_enumval, 18, ENUMVAL_NAME, "XmDIALOG_WORK_AREA"}, {tkn_k_class_enumval, sym_k_XmDISTRIBUTE_SPREAD_enumval, 19, ENUMVAL_NAME, "XmDISTRIBUTE_SPREAD"}, {tkn_k_class_enumval, sym_k_XmDISTRIBUTE_TIGHT_enumval, 18, ENUMVAL_NAME, "XmDISTRIBUTE_TIGHT"}, {tkn_k_class_enumval, sym_k_XmDOUBLE_DASHED_LINE_enumval, 20, ENUMVAL_NAME, "XmDOUBLE_DASHED_LINE"}, {tkn_k_class_enumval, sym_k_XmDOUBLE_LINE_enumval, 13, ENUMVAL_NAME, "XmDOUBLE_LINE"}, {tkn_k_class_enumval, sym_k_XmDO_NOTHING_enumval, 12, ENUMVAL_NAME, "XmDO_NOTHING"}, {tkn_k_class_enumval, sym_k_XmDROP_DOWN_COMBO_BOX_enumval, 21, ENUMVAL_NAME, "XmDROP_DOWN_COMBO_BOX"}, {tkn_k_class_enumval, sym_k_XmDROP_DOWN_LIST_enumval, 16, ENUMVAL_NAME, "XmDROP_DOWN_LIST"}, {tkn_k_class_class, sym_k_XmDataField_object, 11, CLASS_NAME, "XmDataField"}, {tkn_k_class_class, sym_k_XmDialogShell_object, 13, CLASS_NAME, "XmDialogShell"}, {tkn_k_class_class, sym_k_XmDrawingArea_object, 13, CLASS_NAME, "XmDrawingArea"}, {tkn_k_class_class, sym_k_XmDrawnButton_object, 13, CLASS_NAME, "XmDrawnButton"}, {tkn_k_class_class, sym_k_XmDropDown_object, 10, CLASS_NAME, "XmDropDown"}, {tkn_k_class_enumval, sym_k_XmEACH_SIDE_enumval, 11, ENUMVAL_NAME, "XmEACH_SIDE"}, {tkn_k_class_enumval, sym_k_XmETCHED_LINE_enumval, 13, ENUMVAL_NAME, "XmETCHED_LINE"}, {tkn_k_class_enumval, sym_k_XmEXCLUSIVE_TAB_GROUP_enumval, 21, ENUMVAL_NAME, "XmEXCLUSIVE_TAB_GROUP"}, {tkn_k_class_enumval, sym_k_XmEXPANDED_enumval, 10, ENUMVAL_NAME, "XmEXPANDED"}, {tkn_k_class_enumval, sym_k_XmEXPLICIT_enumval, 10, ENUMVAL_NAME, "XmEXPLICIT"}, {tkn_k_class_enumval, sym_k_XmEXTENDED_SELECT_enumval, 17, ENUMVAL_NAME, "XmEXTENDED_SELECT"}, {tkn_k_class_class, sym_k_XmErrorDialog_object, 13, CLASS_NAME, "XmErrorDialog"}, {tkn_k_class_class, sym_k_XmMultiList_object, 11, CLASS_NAME, "XmExt18List"}, {tkn_k_class_enumval, sym_k_XmFILE_ANY_TYPE_enumval, 15, ENUMVAL_NAME, "XmFILE_ANY_TYPE"}, {tkn_k_class_enumval, sym_k_XmFILE_DIRECTORY_enumval, 16, ENUMVAL_NAME, "XmFILE_DIRECTORY"}, {tkn_k_class_enumval, sym_k_XmFILE_REGULAR_enumval, 14, ENUMVAL_NAME, "XmFILE_REGULAR"}, {tkn_k_class_enumval, sym_k_XmFILL_FLUSH_enumval, 12, ENUMVAL_NAME, "XmFILL_FLUSH"}, {tkn_k_class_enumval, sym_k_XmFILL_RAGGED_enumval, 13, ENUMVAL_NAME, "XmFILL_RAGGED"}, {tkn_k_class_enumval, sym_k_XmFILL_UNSPECIFIED_enumval, 18, ENUMVAL_NAME, "XmFILL_UNSPECIFIED"}, {tkn_k_class_enumval, sym_k_XmFIRST_FIT_enumval, 11, ENUMVAL_NAME, "XmFIRST_FIT"}, {tkn_k_class_enumval, sym_k_XmFIRST_POSITION_enumval, 16, ENUMVAL_NAME, "XmFIRST_POSITION"}, {tkn_k_class_charset, sym_k_XmFONTLIST_DEFAULT_TAG_charset, 22, CHARSET_NAME, "XmFONTLIST_DEFAULT_TAG"}, {tkn_k_class_enumval, sym_k_XmFONT_IS_FONT_enumval, 14, ENUMVAL_NAME, "XmFONT_IS_FONT"}, {tkn_k_class_enumval, sym_k_XmFONT_IS_FONTSET_enumval, 17, ENUMVAL_NAME, "XmFONT_IS_FONTSET"}, {tkn_k_class_enumval, sym_k_XmFONT_IS_XFT_enumval, 13, ENUMVAL_NAME, "XmFONT_IS_XFT"}, {tkn_k_class_enumval, sym_k_XmFONT_UNITS_enumval, 12, ENUMVAL_NAME, "XmFONT_UNITS"}, {tkn_k_class_enumval, sym_k_XmFOREGROUND_COLOR_enumval, 18, ENUMVAL_NAME, "XmFOREGROUND_COLOR"}, {tkn_k_class_enumval, sym_k_XmFRAME_GENERIC_CHILD_enumval, 21, ENUMVAL_NAME, "XmFRAME_GENERIC_CHILD"}, {tkn_k_class_enumval, sym_k_XmFRAME_TITLE_CHILD_enumval, 19, ENUMVAL_NAME, "XmFRAME_TITLE_CHILD"}, {tkn_k_class_enumval, sym_k_XmFRAME_WORKAREA_CHILD_enumval, 22, ENUMVAL_NAME, "XmFRAME_WORKAREA_CHILD"}, {tkn_k_class_class, sym_k_XmFileSelectionBox_object, 18, CLASS_NAME, "XmFileSelectionBox"}, {tkn_k_class_class, sym_k_XmFileSelectionDialog_object, 21, CLASS_NAME, "XmFileSelectionDialog"}, {tkn_k_class_enumval, sym_k_XmFillAll_enumval, 9, ENUMVAL_NAME, "XmFillAll"}, {tkn_k_class_enumval, sym_k_XmFillMajor_enumval, 11, ENUMVAL_NAME, "XmFillMajor"}, {tkn_k_class_enumval, sym_k_XmFillMinor_enumval, 11, ENUMVAL_NAME, "XmFillMinor"}, {tkn_k_class_enumval, sym_k_XmFillNone_enumval, 10, ENUMVAL_NAME, "XmFillNone"}, {tkn_k_class_class, sym_k_XmFontSelector_object, 14, CLASS_NAME, "XmFontSelector"}, {tkn_k_class_class, sym_k_XmForm_object, 6, CLASS_NAME, "XmForm"}, {tkn_k_class_class, sym_k_XmFormDialog_object, 12, CLASS_NAME, "XmFormDialog"}, {tkn_k_class_class, sym_k_XmFrame_object, 7, CLASS_NAME, "XmFrame"}, {tkn_k_class_enumval, sym_k_XmGENERIC_CHILD_enumval, 15, ENUMVAL_NAME, "XmGENERIC_CHILD"}, {tkn_k_class_enumval, sym_k_XmGRID_enumval, 6, ENUMVAL_NAME, "XmGRID"}, {tkn_k_class_enumval, sym_k_XmGROW_BALANCED_enumval, 15, ENUMVAL_NAME, "XmGROW_BALANCED"}, {tkn_k_class_enumval, sym_k_XmGROW_MAJOR_enumval, 12, ENUMVAL_NAME, "XmGROW_MAJOR"}, {tkn_k_class_enumval, sym_k_XmGROW_MINOR_enumval, 12, ENUMVAL_NAME, "XmGROW_MINOR"}, {tkn_k_class_enumval, sym_k_XmHORIZONTAL_enumval, 12, ENUMVAL_NAME, "XmHORIZONTAL"}, {tkn_k_class_enumval, sym_k_XmHOR_SCROLLBAR_enumval, 15, ENUMVAL_NAME, "XmHOR_SCROLLBAR"}, {tkn_k_class_enumval, sym_k_XmHidden_enumval, 8, ENUMVAL_NAME, "XmHidden"}, {tkn_k_class_enumval, sym_k_XmINCHES_enumval, 8, ENUMVAL_NAME, "XmINCHES"}, {tkn_k_class_enumval, sym_k_XmINDETERMINATE_enumval, 15, ENUMVAL_NAME, "XmINDETERMINATE"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_BOX_enumval, 15, ENUMVAL_NAME, "XmINDICATOR_BOX"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CHECK_enumval, 17, ENUMVAL_NAME, "XmINDICATOR_CHECK"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CHECK_BOX_enumval, 21, ENUMVAL_NAME, "XmINDICATOR_CHECK_BOX"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CROSS_enumval, 17, ENUMVAL_NAME, "XmINDICATOR_CROSS"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CROSS_BOX_enumval, 21, ENUMVAL_NAME, "XmINDICATOR_CROSS_BOX"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_FILL_enumval, 16, ENUMVAL_NAME, "XmINDICATOR_FILL"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_NONE_enumval, 16, ENUMVAL_NAME, "XmINDICATOR_NONE"}, {tkn_k_class_enumval, sym_k_XmINHERIT_POLICY_enumval, 16, ENUMVAL_NAME, "XmINHERIT_POLICY"}, {tkn_k_class_enumval, sym_k_XmINVALID_MATCH_BEHAVIOR_enumval, 24, ENUMVAL_NAME, "XmINVALID_MATCH_BEHAVIOR"}, {tkn_k_class_enumval, sym_k_XmIconBottom_enumval, 12, ENUMVAL_NAME, "XmIconBottom"}, {tkn_k_class_class, sym_k_XmIconBox_object, 9, CLASS_NAME, "XmIconBox"}, {tkn_k_class_class, sym_k_XmIconButton_object, 12, CLASS_NAME, "XmIconButton"}, {tkn_k_class_class, sym_k_XmIconGadget_object, 12, CLASS_NAME, "XmIconGadget"}, {tkn_k_class_enumval, sym_k_XmIconLeft_enumval, 10, ENUMVAL_NAME, "XmIconLeft"}, {tkn_k_class_enumval, sym_k_XmIconNone_enumval, 10, ENUMVAL_NAME, "XmIconNone"}, {tkn_k_class_enumval, sym_k_XmIconOnly_enumval, 10, ENUMVAL_NAME, "XmIconOnly"}, {tkn_k_class_enumval, sym_k_XmIconRight_enumval, 11, ENUMVAL_NAME, "XmIconRight"}, {tkn_k_class_enumval, sym_k_XmIconTop_enumval, 9, ENUMVAL_NAME, "XmIconTop"}, {tkn_k_class_class, sym_k_XmInformationDialog_object, 19, CLASS_NAME, "XmInformationDialog"}, {tkn_k_class_enumval, sym_k_XmLARGE_ICON_enumval, 12, ENUMVAL_NAME, "XmLARGE_ICON"}, {tkn_k_class_enumval, sym_k_XmLAST_POSITION_enumval, 15, ENUMVAL_NAME, "XmLAST_POSITION"}, {tkn_k_class_enumval, sym_k_XmLEFT_TO_RIGHT_enumval, 15, ENUMVAL_NAME, "XmLEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmLEFT_TO_RIGHT_BOTTOM_TO_TOP_enumval, 29, ENUMVAL_NAME, "XmLEFT_TO_RIGHT_BOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmLEFT_TO_RIGHT_TOP_TO_BOTTOM_enumval, 29, ENUMVAL_NAME, "XmLEFT_TO_RIGHT_TOP_TO_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmLOAD_DEFERRED_enumval, 15, ENUMVAL_NAME, "XmLOAD_DEFERRED"}, {tkn_k_class_enumval, sym_k_XmLOAD_IMMEDIATE_enumval, 16, ENUMVAL_NAME, "XmLOAD_IMMEDIATE"}, {tkn_k_class_class, sym_k_XmLabel_object, 7, CLASS_NAME, "XmLabel"}, {tkn_k_class_class, sym_k_XmLabelGadget_object, 13, CLASS_NAME, "XmLabelGadget"}, {tkn_k_class_class, sym_k_XmList_object, 6, CLASS_NAME, "XmList"}, {tkn_k_class_enumval, sym_k_XmListMode_enumval, 10, ENUMVAL_NAME, "XmListMode"}, {tkn_k_class_enumval, sym_k_XmMAJOR_TAB_enumval, 11, ENUMVAL_NAME, "XmMAJOR_TAB"}, {tkn_k_class_enumval, sym_k_XmMARQUEE_enumval, 9, ENUMVAL_NAME, "XmMARQUEE"}, {tkn_k_class_enumval, sym_k_XmMARQUEE_EXTEND_BOTH_enumval, 21, ENUMVAL_NAME, "XmMARQUEE_EXTEND_BOTH"}, {tkn_k_class_enumval, sym_k_XmMARQUEE_EXTEND_START_enumval, 22, ENUMVAL_NAME, "XmMARQUEE_EXTEND_START"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_BOTTOM_enumval, 15, ENUMVAL_NAME, "XmMAX_ON_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_LEFT_enumval, 13, ENUMVAL_NAME, "XmMAX_ON_LEFT"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_RIGHT_enumval, 14, ENUMVAL_NAME, "XmMAX_ON_RIGHT"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_TOP_enumval, 12, ENUMVAL_NAME, "XmMAX_ON_TOP"}, {tkn_k_class_enumval, sym_k_XmMAX_SIDE_enumval, 10, ENUMVAL_NAME, "XmMAX_SIDE"}, {tkn_k_class_enumval, sym_k_XmMENU_BAR_enumval, 10, ENUMVAL_NAME, "XmMENU_BAR"}, {tkn_k_class_enumval, sym_k_XmMENU_OPTION_enumval, 13, ENUMVAL_NAME, "XmMENU_OPTION"}, {tkn_k_class_enumval, sym_k_XmMENU_POPUP_enumval, 12, ENUMVAL_NAME, "XmMENU_POPUP"}, {tkn_k_class_enumval, sym_k_XmMENU_PULLDOWN_enumval, 15, ENUMVAL_NAME, "XmMENU_PULLDOWN"}, {tkn_k_class_enumval, sym_k_XmMESSAGE_WINDOW_enumval, 16, ENUMVAL_NAME, "XmMESSAGE_WINDOW"}, {tkn_k_class_enumval, sym_k_XmMILLIMETERS_enumval, 13, ENUMVAL_NAME, "XmMILLIMETERS"}, {tkn_k_class_enumval, sym_k_XmMINOR_TAB_enumval, 11, ENUMVAL_NAME, "XmMINOR_TAB"}, {tkn_k_class_enumval, sym_k_XmMIN_SIDE_enumval, 10, ENUMVAL_NAME, "XmMIN_SIDE"}, {tkn_k_class_enumval, sym_k_XmMULTICLICK_DISCARD_enumval, 20, ENUMVAL_NAME, "XmMULTICLICK_DISCARD"}, {tkn_k_class_enumval, sym_k_XmMULTICLICK_KEEP_enumval, 17, ENUMVAL_NAME, "XmMULTICLICK_KEEP"}, {tkn_k_class_enumval, sym_k_XmMULTIPLE_SELECT_enumval, 17, ENUMVAL_NAME, "XmMULTIPLE_SELECT"}, {tkn_k_class_enumval, sym_k_XmMULTI_LINE_EDIT_enumval, 17, ENUMVAL_NAME, "XmMULTI_LINE_EDIT"}, {tkn_k_class_class, sym_k_XmMainWindow_object, 12, CLASS_NAME, "XmMainWindow"}, {tkn_k_class_class, sym_k_XmMenuBar_object, 9, CLASS_NAME, "XmMenuBar"}, {tkn_k_class_class, sym_k_XmMenuShell_object, 11, CLASS_NAME, "XmMenuShell"}, {tkn_k_class_class, sym_k_XmMessageBox_object, 12, CLASS_NAME, "XmMessageBox"}, {tkn_k_class_class, sym_k_XmMessageDialog_object, 15, CLASS_NAME, "XmMessageDialog"}, {tkn_k_class_class, sym_k_XmMultiList_object, 11, CLASS_NAME, "XmMultiList"}, {tkn_k_class_argument, sym_k_XmN100DPIstring_arg, 15, ARGUMENT_NAME, "XmN100DPIstring"}, {tkn_k_class_argument, sym_k_XmN75DPIstring_arg, 14, ARGUMENT_NAME, "XmN75DPIstring"}, {tkn_k_class_enumval, sym_k_XmNEAR_BORDER_enumval, 13, ENUMVAL_NAME, "XmNEAR_BORDER"}, {tkn_k_class_enumval, sym_k_XmNEAR_SLIDER_enumval, 13, ENUMVAL_NAME, "XmNEAR_SLIDER"}, {tkn_k_class_enumval, sym_k_XmNONE_enumval, 6, ENUMVAL_NAME, "XmNONE"}, {tkn_k_class_enumval, sym_k_XmNORMAL_MODE_enumval, 13, ENUMVAL_NAME, "XmNORMAL_MODE"}, {tkn_k_class_enumval, sym_k_XmNOT_SELECTED_enumval, 14, ENUMVAL_NAME, "XmNOT_SELECTED"}, {tkn_k_class_enumval, sym_k_XmNO_AUTO_SELECT_enumval, 16, ENUMVAL_NAME, "XmNO_AUTO_SELECT"}, {tkn_k_class_enumval, sym_k_XmNO_LINE_enumval, 9, ENUMVAL_NAME, "XmNO_LINE"}, {tkn_k_class_enumval, sym_k_XmNO_ORIENTATION_enumval, 16, ENUMVAL_NAME, "XmNO_ORIENTATION"}, {tkn_k_class_enumval, sym_k_XmNO_PACKING_enumval, 12, ENUMVAL_NAME, "XmNO_PACKING"}, {tkn_k_class_enumval, sym_k_XmNO_SCROLL_enumval, 11, ENUMVAL_NAME, "XmNO_SCROLL"}, {tkn_k_class_enumval, sym_k_XmNUMERIC_enumval, 9, ENUMVAL_NAME, "XmNUMERIC"}, {tkn_k_class_enumval, sym_k_XmN_OF_MANY_enumval, 11, ENUMVAL_NAME, "XmN_OF_MANY"}, {tkn_k_class_argument, sym_k_XmNaccelerator_arg, 14, ARGUMENT_NAME, "XmNaccelerator"}, {tkn_k_class_argument, sym_k_XmNacceleratorText_arg, 18, ARGUMENT_NAME, "XmNacceleratorText"}, {tkn_k_class_argument, sym_k_XmNaccelerators_arg, 15, ARGUMENT_NAME, "XmNaccelerators"}, {tkn_k_class_reason, sym_k_XmNactivateCallback_reason, 19, REASON_NAME, "XmNactivateCallback"}, {tkn_k_class_argument, sym_k_XmNadjustLast_arg, 13, ARGUMENT_NAME, "XmNadjustLast"}, {tkn_k_class_argument, sym_k_XmNadjustMargin_arg, 15, ARGUMENT_NAME, "XmNadjustMargin"}, {tkn_k_class_argument, sym_k_XmNalignment_arg, 12, ARGUMENT_NAME, "XmNalignment"}, {tkn_k_class_argument, sym_k_XmNallowOverlap_arg, 15, ARGUMENT_NAME, "XmNallowOverlap"}, {tkn_k_class_argument, sym_k_XmNallowResize_arg, 14, ARGUMENT_NAME, "XmNallowResize"}, {tkn_k_class_argument, sym_k_XmNallowShellResize_arg, 19, ARGUMENT_NAME, "XmNallowShellResize"}, {tkn_k_class_argument, sym_k_XmNallowUnusedSpace_arg, 19, ARGUMENT_NAME, "XmNallowUnusedSpace"}, {tkn_k_class_argument, sym_k_XmNancestorSensitive_arg, 20, ARGUMENT_NAME, "XmNancestorSensitive"}, {tkn_k_class_argument, sym_k_XmNanyLowerString_arg, 17, ARGUMENT_NAME, "XmNanyLowerString"}, {tkn_k_class_argument, sym_k_XmNanyString_arg, 12, ARGUMENT_NAME, "XmNanyString"}, {tkn_k_class_reason, sym_k_XmNapplyCallback_reason, 16, REASON_NAME, "XmNapplyCallback"}, {tkn_k_class_argument, sym_k_XmNapplyLabelString_arg, 19, ARGUMENT_NAME, "XmNapplyLabelString"}, {tkn_k_class_reason, sym_k_XmNarmCallback_reason, 14, REASON_NAME, "XmNarmCallback"}, {tkn_k_class_argument, sym_k_XmNarmColor_arg, 11, ARGUMENT_NAME, "XmNarmColor"}, {tkn_k_class_argument, sym_k_XmNarmPixmap_arg, 12, ARGUMENT_NAME, "XmNarmPixmap"}, {tkn_k_class_argument, sym_k_XmNarrowDirection_arg, 17, ARGUMENT_NAME, "XmNarrowDirection"}, {tkn_k_class_argument, sym_k_XmNarrowLayout_arg, 14, ARGUMENT_NAME, "XmNarrowLayout"}, {tkn_k_class_argument, sym_k_XmNarrowOrientation_arg, 19, ARGUMENT_NAME, "XmNarrowOrientation"}, {tkn_k_class_argument, sym_k_XmNarrowSensitivity_arg, 19, ARGUMENT_NAME, "XmNarrowSensitivity"}, {tkn_k_class_argument, sym_k_XmNarrowSize_arg, 12, ARGUMENT_NAME, "XmNarrowSize"}, {tkn_k_class_argument, sym_k_XmNarrowSpacing_arg, 15, ARGUMENT_NAME, "XmNarrowSpacing"}, {tkn_k_class_argument, sym_k_XmNaudibleWarning_arg, 17, ARGUMENT_NAME, "XmNaudibleWarning"}, {tkn_k_class_argument, sym_k_XmNautoClose_arg, 12, ARGUMENT_NAME, "XmNautoClose"}, {tkn_k_class_argument, sym_k_XmNautoDragModel_arg, 16, ARGUMENT_NAME, "XmNautoDragModel"}, {tkn_k_class_argument, sym_k_XmNautoFill_arg, 11, ARGUMENT_NAME, "XmNautoFill"}, {tkn_k_class_argument, sym_k_XmNautoShowCursorPosition_arg, 25, ARGUMENT_NAME, "XmNautoShowCursorPosition"}, {tkn_k_class_argument, sym_k_XmNautoUnmanage_arg, 15, ARGUMENT_NAME, "XmNautoUnmanage"}, {tkn_k_class_argument, sym_k_XmNautomaticSelection_arg, 21, ARGUMENT_NAME, "XmNautomaticSelection"}, {tkn_k_class_argument, sym_k_XmNbackPageBackground_arg, 21, ARGUMENT_NAME, "XmNbackPageBackground"}, {tkn_k_class_argument, sym_k_XmNbackPageForeground_arg, 21, ARGUMENT_NAME, "XmNbackPageForeground"}, {tkn_k_class_argument, sym_k_XmNbackPageNumber_arg, 17, ARGUMENT_NAME, "XmNbackPageNumber"}, {tkn_k_class_argument, sym_k_XmNbackPagePlacement_arg, 20, ARGUMENT_NAME, "XmNbackPagePlacement"}, {tkn_k_class_argument, sym_k_XmNbackPageSize_arg, 15, ARGUMENT_NAME, "XmNbackPageSize"}, {tkn_k_class_argument, sym_k_XmNbackground_arg, 13, ARGUMENT_NAME, "XmNbackground"}, {tkn_k_class_argument, sym_k_XmNbackgroundPixmap_arg, 19, ARGUMENT_NAME, "XmNbackgroundPixmap"}, {tkn_k_class_argument, sym_k_XmNbaseHeight_arg, 13, ARGUMENT_NAME, "XmNbaseHeight"}, {tkn_k_class_argument, sym_k_XmNbaseWidth_arg, 12, ARGUMENT_NAME, "XmNbaseWidth"}, {tkn_k_class_argument, sym_k_XmNbindingPixmap_arg, 16, ARGUMENT_NAME, "XmNbindingPixmap"}, {tkn_k_class_argument, sym_k_XmNbindingType_arg, 14, ARGUMENT_NAME, "XmNbindingType"}, {tkn_k_class_argument, sym_k_XmNbindingWidth_arg, 15, ARGUMENT_NAME, "XmNbindingWidth"}, {tkn_k_class_argument, sym_k_XmNblinkRate_arg, 12, ARGUMENT_NAME, "XmNblinkRate"}, {tkn_k_class_argument, sym_k_XmNblueSliderLabel_arg, 18, ARGUMENT_NAME, "XmNblueSliderLabel"}, {tkn_k_class_argument, sym_k_XmNboldString_arg, 13, ARGUMENT_NAME, "XmNboldString"}, {tkn_k_class_argument, sym_k_XmNborderColor_arg, 14, ARGUMENT_NAME, "XmNborderColor"}, {tkn_k_class_argument, sym_k_XmNborderPixmap_arg, 15, ARGUMENT_NAME, "XmNborderPixmap"}, {tkn_k_class_argument, sym_k_XmNborderWidth_arg, 14, ARGUMENT_NAME, "XmNborderWidth"}, {tkn_k_class_argument, sym_k_XmNbothString_arg, 13, ARGUMENT_NAME, "XmNbothString"}, {tkn_k_class_argument, sym_k_XmNbottomAttachment_arg, 19, ARGUMENT_NAME, "XmNbottomAttachment"}, {tkn_k_class_argument, sym_k_XmNbottomOffset_arg, 15, ARGUMENT_NAME, "XmNbottomOffset"}, {tkn_k_class_argument, sym_k_XmNbottomPosition_arg, 17, ARGUMENT_NAME, "XmNbottomPosition"}, {tkn_k_class_argument, sym_k_XmNbottomShadowColor_arg, 20, ARGUMENT_NAME, "XmNbottomShadowColor"}, {tkn_k_class_argument, sym_k_XmNbottomShadowPixmap_arg, 21, ARGUMENT_NAME, "XmNbottomShadowPixmap"}, {tkn_k_class_argument, sym_k_XmNbottomWidget_arg, 15, ARGUMENT_NAME, "XmNbottomWidget"}, {tkn_k_class_reason, sym_k_XmNbrowseSelectionCallback_reason, 26, REASON_NAME, "XmNbrowseSelectionCallback"}, {tkn_k_class_argument, sym_k_XmNbuttonCount_arg, 14, ARGUMENT_NAME, "XmNbuttonCount"}, {tkn_k_class_argument, sym_k_XmNbuttonFontList_arg, 17, ARGUMENT_NAME, "XmNbuttonFontList"}, {tkn_k_class_argument, sym_k_XmNbuttonRenderTable_arg, 20, ARGUMENT_NAME, "XmNbuttonRenderTable"}, {tkn_k_class_argument, sym_k_XmNbuttons_arg, 10, ARGUMENT_NAME, "XmNbuttons"}, {tkn_k_class_argument, sym_k_XmNcancelButton_arg, 15, ARGUMENT_NAME, "XmNcancelButton"}, {tkn_k_class_reason, sym_k_XmNcancelCallback_reason, 17, REASON_NAME, "XmNcancelCallback"}, {tkn_k_class_argument, sym_k_XmNcancelLabelString_arg, 20, ARGUMENT_NAME, "XmNcancelLabelString"}, {tkn_k_class_argument, sym_k_XmNcascadePixmap_arg, 16, ARGUMENT_NAME, "XmNcascadePixmap"}, {tkn_k_class_reason, sym_k_XmNcascadingCallback_reason, 20, REASON_NAME, "XmNcascadingCallback"}, {tkn_k_class_argument, sym_k_XmNcellX_arg, 8, ARGUMENT_NAME, "XmNcellX"}, {tkn_k_class_argument, sym_k_XmNcellY_arg, 8, ARGUMENT_NAME, "XmNcellY"}, {tkn_k_class_argument, sym_k_XmNchildHorizontalAlignment_arg, 27, ARGUMENT_NAME, "XmNchildHorizontalAlignment"}, {tkn_k_class_argument, sym_k_XmNchildHorizontalSpacing_arg, 25, ARGUMENT_NAME, "XmNchildHorizontalSpacing"}, {tkn_k_class_argument, sym_k_XmNchildPlacement_arg, 17, ARGUMENT_NAME, "XmNchildPlacement"}, {tkn_k_class_argument, sym_k_XmNchildType_arg, 12, ARGUMENT_NAME, "XmNchildType"}, {tkn_k_class_argument, sym_k_XmNchildVerticalAlignment_arg, 25, ARGUMENT_NAME, "XmNchildVerticalAlignment"}, {tkn_k_class_argument, sym_k_XmNclipWindow_arg, 13, ARGUMENT_NAME, "XmNclipWindow"}, {tkn_k_class_argument, sym_k_XmNcloseFolderPixmap_arg, 20, ARGUMENT_NAME, "XmNcloseFolderPixmap"}, {tkn_k_class_argument, sym_k_XmNcollapsedStatePixmap_arg, 23, ARGUMENT_NAME, "XmNcollapsedStatePixmap"}, {tkn_k_class_argument, sym_k_XmNcolorListTogLabel_arg, 20, ARGUMENT_NAME, "XmNcolorListTogLabel"}, {tkn_k_class_argument, sym_k_XmNcolorMode_arg, 12, ARGUMENT_NAME, "XmNcolorMode"}, {tkn_k_class_argument, sym_k_XmNcolorName_arg, 12, ARGUMENT_NAME, "XmNcolorName"}, {tkn_k_class_argument, sym_k_XmNcolormap_arg, 11, ARGUMENT_NAME, "XmNcolormap"}, {tkn_k_class_argument, sym_k_XmNcolumnTitles_arg, 15, ARGUMENT_NAME, "XmNcolumnTitles"}, {tkn_k_class_argument, sym_k_XmNcolumns_arg, 10, ARGUMENT_NAME, "XmNcolumns"}, {tkn_k_class_argument, sym_k_XmNcomboBoxType_arg, 15, ARGUMENT_NAME, "XmNcomboBoxType"}, {tkn_k_class_argument, sym_k_XmNcomboTranslations_arg, 20, ARGUMENT_NAME, "XmNcomboTranslations"}, {tkn_k_class_argument, sym_k_XmNcommand_arg, 10, ARGUMENT_NAME, "XmNcommand"}, {tkn_k_class_reason, sym_k_XmNcommandChangedCallback_reason, 25, REASON_NAME, "XmNcommandChangedCallback"}, {tkn_k_class_reason, sym_k_XmNcommandEnteredCallback_reason, 25, REASON_NAME, "XmNcommandEnteredCallback"}, {tkn_k_class_argument, sym_k_XmNcommandWindow_arg, 16, ARGUMENT_NAME, "XmNcommandWindow"}, {tkn_k_class_argument, sym_k_XmNcommandWindowLocation_arg, 24, ARGUMENT_NAME, "XmNcommandWindowLocation"}, {tkn_k_class_argument, sym_k_XmNcompressStyle_arg, 16, ARGUMENT_NAME, "XmNcompressStyle"}, {tkn_k_class_argument, sym_k_XmNconnectNodes_arg, 15, ARGUMENT_NAME, "XmNconnectNodes"}, {tkn_k_class_argument, sym_k_XmNconnectStyle_arg, 15, ARGUMENT_NAME, "XmNconnectStyle"}, {tkn_k_class_argument, sym_k_XmNconstrainWidth_arg, 17, ARGUMENT_NAME, "XmNconstrainWidth"}, {tkn_k_class_reason, sym_k_XmNconvertCallback_reason, 18, REASON_NAME, "XmNconvertCallback"}, {tkn_k_class_argument, sym_k_XmNcreatePopupChildProc_arg, 23, ARGUMENT_NAME, "XmNcreatePopupChildProc"}, {tkn_k_class_argument, sym_k_XmNcurrentFont_arg, 14, ARGUMENT_NAME, "XmNcurrentFont"}, {tkn_k_class_argument, sym_k_XmNcurrentPageNumber_arg, 20, ARGUMENT_NAME, "XmNcurrentPageNumber"}, {tkn_k_class_argument, sym_k_XmNcursor_arg, 9, ARGUMENT_NAME, "XmNcursor"}, {tkn_k_class_argument, sym_k_XmNcursorPosition_arg, 17, ARGUMENT_NAME, "XmNcursorPosition"}, {tkn_k_class_argument, sym_k_XmNcursorPositionVisible_arg, 24, ARGUMENT_NAME, "XmNcursorPositionVisible"}, {tkn_k_class_argument, sym_k_XmNcustomizedCombinationBox_arg, 27, ARGUMENT_NAME, "XmNcustomizedCombinationBox"}, {tkn_k_class_argument, sym_k_XmNdarkThreshold_arg, 16, ARGUMENT_NAME, "XmNdarkThreshold"}, {tkn_k_class_argument, sym_k_XmNdecimal_arg, 10, ARGUMENT_NAME, "XmNdecimal"}, {tkn_k_class_argument, sym_k_XmNdecimalPoints_arg, 16, ARGUMENT_NAME, "XmNdecimalPoints"}, {tkn_k_class_reason, sym_k_XmNdecrementCallback_reason, 20, REASON_NAME, "XmNdecrementCallback"}, {tkn_k_class_reason, sym_k_XmNdefaultActionCallback_reason, 24, REASON_NAME, "XmNdefaultActionCallback"}, {tkn_k_class_argument, sym_k_XmNdefaultArrowSensitivity_arg, 26, ARGUMENT_NAME, "XmNdefaultArrowSensitivity"}, {tkn_k_class_argument, sym_k_XmNdefaultButton_arg, 16, ARGUMENT_NAME, "XmNdefaultButton"}, {tkn_k_class_argument, sym_k_XmNdefaultButtonShadowThickness_arg, 31, ARGUMENT_NAME, "XmNdefaultButtonShadowThickness"}, {tkn_k_class_argument, sym_k_XmNdefaultButtonType_arg, 20, ARGUMENT_NAME, "XmNdefaultButtonType"}, {tkn_k_class_argument, sym_k_XmNdefaultEncodingString_arg, 24, ARGUMENT_NAME, "XmNdefaultEncodingString"}, {tkn_k_class_argument, sym_k_XmNdefaultEntryLabelAlignment_arg, 29, ARGUMENT_NAME, "XmNdefaultEntryLabelAlignment"}, {tkn_k_class_argument, sym_k_XmNdefaultEntryLabelFontList_arg, 28, ARGUMENT_NAME, "XmNdefaultEntryLabelFontList"}, {tkn_k_class_argument, sym_k_XmNdefaultEntryLabelRenderTable_arg, 31, ARGUMENT_NAME, "XmNdefaultEntryLabelRenderTable"}, {tkn_k_class_argument, sym_k_XmNdefaultFillStyle_arg, 19, ARGUMENT_NAME, "XmNdefaultFillStyle"}, {tkn_k_class_argument, sym_k_XmNdefaultFontList_arg, 18, ARGUMENT_NAME, "XmNdefaultFontList"}, {tkn_k_class_argument, sym_k_XmNdefaultPosition_arg, 18, ARGUMENT_NAME, "XmNdefaultPosition"}, {tkn_k_class_argument, sym_k_XmNdeleteResponse_arg, 17, ARGUMENT_NAME, "XmNdeleteResponse"}, {tkn_k_class_argument, sym_k_XmNdepth_arg, 8, ARGUMENT_NAME, "XmNdepth"}, {tkn_k_class_reason, sym_k_XmNdestinationCallback_reason, 22, REASON_NAME, "XmNdestinationCallback"}, {tkn_k_class_reason, sym_k_XmNdestroyCallback_reason, 18, REASON_NAME, "XmNdestroyCallback"}, {tkn_k_class_argument, sym_k_XmNdetail_arg, 9, ARGUMENT_NAME, "XmNdetail"}, {tkn_k_class_argument, sym_k_XmNdetailColumnHeading_arg, 22, ARGUMENT_NAME, "XmNdetailColumnHeading"}, {tkn_k_class_argument, sym_k_XmNdetailColumnHeadingCount_arg, 27, ARGUMENT_NAME, "XmNdetailColumnHeadingCount"}, {tkn_k_class_argument, sym_k_XmNdetailCount_arg, 14, ARGUMENT_NAME, "XmNdetailCount"}, {tkn_k_class_argument, sym_k_XmNdetailOrder_arg, 14, ARGUMENT_NAME, "XmNdetailOrder"}, {tkn_k_class_argument, sym_k_XmNdetailOrderCount_arg, 19, ARGUMENT_NAME, "XmNdetailOrderCount"}, {tkn_k_class_argument, sym_k_XmNdetailShadowThickness_arg, 24, ARGUMENT_NAME, "XmNdetailShadowThickness"}, {tkn_k_class_argument, sym_k_XmNdetailTabList_arg, 16, ARGUMENT_NAME, "XmNdetailTabList"}, {tkn_k_class_argument, sym_k_XmNdialogStyle_arg, 14, ARGUMENT_NAME, "XmNdialogStyle"}, {tkn_k_class_argument, sym_k_XmNdialogTitle_arg, 14, ARGUMENT_NAME, "XmNdialogTitle"}, {tkn_k_class_argument, sym_k_XmNdialogType_arg, 13, ARGUMENT_NAME, "XmNdialogType"}, {tkn_k_class_argument, sym_k_XmNdirListItemCount_arg, 19, ARGUMENT_NAME, "XmNdirListItemCount"}, {tkn_k_class_argument, sym_k_XmNdirListItems_arg, 15, ARGUMENT_NAME, "XmNdirListItems"}, {tkn_k_class_argument, sym_k_XmNdirListLabelString_arg, 21, ARGUMENT_NAME, "XmNdirListLabelString"}, {tkn_k_class_argument, sym_k_XmNdirMask_arg, 10, ARGUMENT_NAME, "XmNdirMask"}, {tkn_k_class_argument, sym_k_XmNdirSearchProc_arg, 16, ARGUMENT_NAME, "XmNdirSearchProc"}, {tkn_k_class_argument, sym_k_XmNdirSpec_arg, 10, ARGUMENT_NAME, "XmNdirSpec"}, {tkn_k_class_argument, sym_k_XmNdirectory_arg, 12, ARGUMENT_NAME, "XmNdirectory"}, {tkn_k_class_argument, sym_k_XmNdirectoryValid_arg, 17, ARGUMENT_NAME, "XmNdirectoryValid"}, {tkn_k_class_reason, sym_k_XmNdisarmCallback_reason, 17, REASON_NAME, "XmNdisarmCallback"}, {tkn_k_class_argument, sym_k_XmNdistribution_arg, 15, ARGUMENT_NAME, "XmNdistribution"}, {tkn_k_class_reason, sym_k_XmNdoubleClickCallback_reason, 22, REASON_NAME, "XmNdoubleClickCallback"}, {tkn_k_class_argument, sym_k_XmNdoubleClickInterval_arg, 22, ARGUMENT_NAME, "XmNdoubleClickInterval"}, {tkn_k_class_reason, sym_k_XmNdragCallback_reason, 15, REASON_NAME, "XmNdragCallback"}, {tkn_k_class_argument, sym_k_XmNeditMode_arg, 11, ARGUMENT_NAME, "XmNeditMode"}, {tkn_k_class_argument, sym_k_XmNeditable_arg, 11, ARGUMENT_NAME, "XmNeditable"}, {tkn_k_class_argument, sym_k_XmNencodingList_arg, 15, ARGUMENT_NAME, "XmNencodingList"}, {tkn_k_class_argument, sym_k_XmNencodingString_arg, 17, ARGUMENT_NAME, "XmNencodingString"}, {tkn_k_class_argument, sym_k_XmNentryAlignment_arg, 17, ARGUMENT_NAME, "XmNentryAlignment"}, {tkn_k_class_argument, sym_k_XmNentryBackground_arg, 18, ARGUMENT_NAME, "XmNentryBackground"}, {tkn_k_class_argument, sym_k_XmNentryBorder_arg, 14, ARGUMENT_NAME, "XmNentryBorder"}, {tkn_k_class_reason, sym_k_XmNentryCallback_reason, 16, REASON_NAME, "XmNentryCallback"}, {tkn_k_class_argument, sym_k_XmNentryClass_arg, 13, ARGUMENT_NAME, "XmNentryClass"}, {tkn_k_class_argument, sym_k_XmNentryData_arg, 12, ARGUMENT_NAME, "XmNentryData"}, {tkn_k_class_argument, sym_k_XmNentryLabelAlignment_arg, 22, ARGUMENT_NAME, "XmNentryLabelAlignment"}, {tkn_k_class_argument, sym_k_XmNentryLabelFontList_arg, 21, ARGUMENT_NAME, "XmNentryLabelFontList"}, {tkn_k_class_argument, sym_k_XmNentryLabelPixmap_arg, 19, ARGUMENT_NAME, "XmNentryLabelPixmap"}, {tkn_k_class_argument, sym_k_XmNentryLabelRenderTable_arg, 24, ARGUMENT_NAME, "XmNentryLabelRenderTable"}, {tkn_k_class_argument, sym_k_XmNentryLabelString_arg, 19, ARGUMENT_NAME, "XmNentryLabelString"}, {tkn_k_class_argument, sym_k_XmNentryLabelType_arg, 17, ARGUMENT_NAME, "XmNentryLabelType"}, {tkn_k_class_argument, sym_k_XmNentryParent_arg, 14, ARGUMENT_NAME, "XmNentryParent"}, {tkn_k_class_argument, sym_k_XmNentryVerticalAlignment_arg, 25, ARGUMENT_NAME, "XmNentryVerticalAlignment"}, {tkn_k_class_argument, sym_k_XmNentryViewType_arg, 16, ARGUMENT_NAME, "XmNentryViewType"}, {tkn_k_class_argument, sym_k_XmNequalSize_arg, 12, ARGUMENT_NAME, "XmNequalSize"}, {tkn_k_class_argument, sym_k_XmNexpandedStatePixmap_arg, 22, ARGUMENT_NAME, "XmNexpandedStatePixmap"}, {tkn_k_class_reason, sym_k_XmNexposeCallback_reason, 17, REASON_NAME, "XmNexposeCallback"}, {tkn_k_class_reason, sym_k_XmNextendedSelectionCallback_reason, 28, REASON_NAME, "XmNextendedSelectionCallback"}, {tkn_k_class_argument, sym_k_XmNfamilyString_arg, 15, ARGUMENT_NAME, "XmNfamilyString"}, {tkn_k_class_argument, sym_k_XmNfileListItemCount_arg, 20, ARGUMENT_NAME, "XmNfileListItemCount"}, {tkn_k_class_argument, sym_k_XmNfileListItems_arg, 16, ARGUMENT_NAME, "XmNfileListItems"}, {tkn_k_class_argument, sym_k_XmNfileListLabelString_arg, 22, ARGUMENT_NAME, "XmNfileListLabelString"}, {tkn_k_class_argument, sym_k_XmNfileReadError_arg, 16, ARGUMENT_NAME, "XmNfileReadError"}, {tkn_k_class_argument, sym_k_XmNfileSearchProc_arg, 17, ARGUMENT_NAME, "XmNfileSearchProc"}, {tkn_k_class_argument, sym_k_XmNfileTypeMask_arg, 15, ARGUMENT_NAME, "XmNfileTypeMask"}, {tkn_k_class_argument, sym_k_XmNfillOnArm_arg, 12, ARGUMENT_NAME, "XmNfillOnArm"}, {tkn_k_class_argument, sym_k_XmNfillOnSelect_arg, 15, ARGUMENT_NAME, "XmNfillOnSelect"}, {tkn_k_class_argument, sym_k_XmNfillOption_arg, 13, ARGUMENT_NAME, "XmNfillOption"}, {tkn_k_class_argument, sym_k_XmNfillStyle_arg, 12, ARGUMENT_NAME, "XmNfillStyle"}, {tkn_k_class_argument, sym_k_XmNfilterLabelString_arg, 20, ARGUMENT_NAME, "XmNfilterLabelString"}, {tkn_k_class_argument, sym_k_XmNfindLabel_arg, 12, ARGUMENT_NAME, "XmNfindLabel"}, {tkn_k_class_argument, sym_k_XmNfirstColumn_arg, 14, ARGUMENT_NAME, "XmNfirstColumn"}, {tkn_k_class_argument, sym_k_XmNfirstColumnPixmaps_arg, 21, ARGUMENT_NAME, "XmNfirstColumnPixmaps"}, {tkn_k_class_argument, sym_k_XmNfirstPageNumber_arg, 18, ARGUMENT_NAME, "XmNfirstPageNumber"}, {tkn_k_class_argument, sym_k_XmNfirstRow_arg, 11, ARGUMENT_NAME, "XmNfirstRow"}, {tkn_k_class_reason, sym_k_XmNfocusCallback_reason, 16, REASON_NAME, "XmNfocusCallback"}, {tkn_k_class_reason, sym_k_XmNfocusMovedCallback_reason, 21, REASON_NAME, "XmNfocusMovedCallback"}, {tkn_k_class_argument, sym_k_XmNfont_arg, 7, ARGUMENT_NAME, "XmNfont"}, {tkn_k_class_argument, sym_k_XmNfontEncoding_arg, 15, ARGUMENT_NAME, "XmNfontEncoding"}, {tkn_k_class_argument, sym_k_XmNfontFoundry_arg, 14, ARGUMENT_NAME, "XmNfontFoundry"}, {tkn_k_class_argument, sym_k_XmNfontList_arg, 11, ARGUMENT_NAME, "XmNfontList"}, {tkn_k_class_argument, sym_k_XmNfontName_arg, 11, ARGUMENT_NAME, "XmNfontName"}, {tkn_k_class_argument, sym_k_XmNfontSize_arg, 11, ARGUMENT_NAME, "XmNfontSize"}, {tkn_k_class_argument, sym_k_XmNfontStyle_arg, 12, ARGUMENT_NAME, "XmNfontStyle"}, {tkn_k_class_argument, sym_k_XmNfontType_arg, 11, ARGUMENT_NAME, "XmNfontType"}, {tkn_k_class_argument, sym_k_XmNforeground_arg, 13, ARGUMENT_NAME, "XmNforeground"}, {tkn_k_class_argument, sym_k_XmNforegroundThreshold_arg, 22, ARGUMENT_NAME, "XmNforegroundThreshold"}, {tkn_k_class_argument, sym_k_XmNfractionBase_arg, 15, ARGUMENT_NAME, "XmNfractionBase"}, {tkn_k_class_argument, sym_k_XmNframeBackground_arg, 18, ARGUMENT_NAME, "XmNframeBackground"}, {tkn_k_class_argument, sym_k_XmNframeChildType_arg, 17, ARGUMENT_NAME, "XmNframeChildType"}, {tkn_k_class_argument, sym_k_XmNframeShadowThickness_arg, 23, ARGUMENT_NAME, "XmNframeShadowThickness"}, {tkn_k_class_argument, sym_k_XmNfreeTabPixmap_arg, 16, ARGUMENT_NAME, "XmNfreeTabPixmap"}, {tkn_k_class_reason, sym_k_XmNgainPrimaryCallback_reason, 22, REASON_NAME, "XmNgainPrimaryCallback"}, {tkn_k_class_argument, sym_k_XmNgeometry_arg, 11, ARGUMENT_NAME, "XmNgeometry"}, {tkn_k_class_argument, sym_k_XmNgreenSliderLabel_arg, 19, ARGUMENT_NAME, "XmNgreenSliderLabel"}, {tkn_k_class_argument, sym_k_XmNheight_arg, 9, ARGUMENT_NAME, "XmNheight"}, {tkn_k_class_argument, sym_k_XmNheightInc_arg, 12, ARGUMENT_NAME, "XmNheightInc"}, {tkn_k_class_reason, sym_k_XmNhelpCallback_reason, 15, REASON_NAME, "XmNhelpCallback"}, {tkn_k_class_argument, sym_k_XmNhelpLabelString_arg, 18, ARGUMENT_NAME, "XmNhelpLabelString"}, {tkn_k_class_argument, sym_k_XmNhighlightColor_arg, 17, ARGUMENT_NAME, "XmNhighlightColor"}, {tkn_k_class_argument, sym_k_XmNhighlightOnEnter_arg, 19, ARGUMENT_NAME, "XmNhighlightOnEnter"}, {tkn_k_class_argument, sym_k_XmNhighlightPixmap_arg, 18, ARGUMENT_NAME, "XmNhighlightPixmap"}, {tkn_k_class_argument, sym_k_XmNhighlightThickness_arg, 21, ARGUMENT_NAME, "XmNhighlightThickness"}, {tkn_k_class_argument, sym_k_XmNhistoryItemCount_arg, 19, ARGUMENT_NAME, "XmNhistoryItemCount"}, {tkn_k_class_argument, sym_k_XmNhistoryItems_arg, 15, ARGUMENT_NAME, "XmNhistoryItems"}, {tkn_k_class_argument, sym_k_XmNhistoryMaxItems_arg, 18, ARGUMENT_NAME, "XmNhistoryMaxItems"}, {tkn_k_class_argument, sym_k_XmNhistoryVisibleItemCount_arg, 26, ARGUMENT_NAME, "XmNhistoryVisibleItemCount"}, {tkn_k_class_argument, sym_k_XmNhorizontalDelta_arg, 18, ARGUMENT_NAME, "XmNhorizontalDelta"}, {tkn_k_class_argument, sym_k_XmNhorizontalMargin_arg, 19, ARGUMENT_NAME, "XmNhorizontalMargin"}, {tkn_k_class_argument, sym_k_XmNhorizontalNodeSpace_arg, 22, ARGUMENT_NAME, "XmNhorizontalNodeSpace"}, {tkn_k_class_argument, sym_k_XmNhorizontalScrollBar_arg, 22, ARGUMENT_NAME, "XmNhorizontalScrollBar"}, {tkn_k_class_argument, sym_k_XmNhorizontalSpacing_arg, 20, ARGUMENT_NAME, "XmNhorizontalSpacing"}, {tkn_k_class_argument, sym_k_XmNiconMask_arg, 11, ARGUMENT_NAME, "XmNiconMask"}, {tkn_k_class_argument, sym_k_XmNiconName_arg, 11, ARGUMENT_NAME, "XmNiconName"}, {tkn_k_class_argument, sym_k_XmNiconNameEncoding_arg, 19, ARGUMENT_NAME, "XmNiconNameEncoding"}, {tkn_k_class_argument, sym_k_XmNiconPixmap_arg, 13, ARGUMENT_NAME, "XmNiconPixmap"}, {tkn_k_class_argument, sym_k_XmNiconPlacement_arg, 16, ARGUMENT_NAME, "XmNiconPlacement"}, {tkn_k_class_argument, sym_k_XmNiconTextPadding_arg, 18, ARGUMENT_NAME, "XmNiconTextPadding"}, {tkn_k_class_argument, sym_k_XmNiconWindow_arg, 13, ARGUMENT_NAME, "XmNiconWindow"}, {tkn_k_class_argument, sym_k_XmNiconX_arg, 8, ARGUMENT_NAME, "XmNiconX"}, {tkn_k_class_argument, sym_k_XmNiconY_arg, 8, ARGUMENT_NAME, "XmNiconY"}, {tkn_k_class_argument, sym_k_XmNiconic_arg, 9, ARGUMENT_NAME, "XmNiconic"}, {tkn_k_class_argument, sym_k_XmNincrement_arg, 12, ARGUMENT_NAME, "XmNincrement"}, {tkn_k_class_reason, sym_k_XmNincrementCallback_reason, 20, REASON_NAME, "XmNincrementCallback"}, {tkn_k_class_argument, sym_k_XmNincrementValue_arg, 17, ARGUMENT_NAME, "XmNincrementValue"}, {tkn_k_class_argument, sym_k_XmNindentSpace_arg, 14, ARGUMENT_NAME, "XmNindentSpace"}, {tkn_k_class_argument, sym_k_XmNindeterminateInsensitivePixmap_arg, 33, ARGUMENT_NAME, "XmNindeterminateInsensitivePixmap"}, {tkn_k_class_argument, sym_k_XmNindeterminatePixmap_arg, 22, ARGUMENT_NAME, "XmNindeterminatePixmap"}, {tkn_k_class_argument, sym_k_XmNindicatorOn_arg, 14, ARGUMENT_NAME, "XmNindicatorOn"}, {tkn_k_class_argument, sym_k_XmNindicatorSize_arg, 16, ARGUMENT_NAME, "XmNindicatorSize"}, {tkn_k_class_argument, sym_k_XmNindicatorType_arg, 16, ARGUMENT_NAME, "XmNindicatorType"}, {tkn_k_class_argument, sym_k_XmNinitialDelay_arg, 15, ARGUMENT_NAME, "XmNinitialDelay"}, {tkn_k_class_argument, sym_k_XmNinitialFocus_arg, 15, ARGUMENT_NAME, "XmNinitialFocus"}, {tkn_k_class_argument, sym_k_XmNinitialResourcesPersistent_arg, 29, ARGUMENT_NAME, "XmNinitialResourcesPersistent"}, {tkn_k_class_argument, sym_k_XmNinitialState_arg, 15, ARGUMENT_NAME, "XmNinitialState"}, {tkn_k_class_argument, sym_k_XmNinnerMarginHeight_arg, 20, ARGUMENT_NAME, "XmNinnerMarginHeight"}, {tkn_k_class_argument, sym_k_XmNinnerMarginWidth_arg, 19, ARGUMENT_NAME, "XmNinnerMarginWidth"}, {tkn_k_class_argument, sym_k_XmNinput_arg, 8, ARGUMENT_NAME, "XmNinput"}, {tkn_k_class_reason, sym_k_XmNinputCallback_reason, 16, REASON_NAME, "XmNinputCallback"}, {tkn_k_class_argument, sym_k_XmNinputMethod_arg, 14, ARGUMENT_NAME, "XmNinputMethod"}, {tkn_k_class_argument, sym_k_XmNinputPolicy_arg, 14, ARGUMENT_NAME, "XmNinputPolicy"}, {tkn_k_class_argument, sym_k_XmNinsertBefore_arg, 15, ARGUMENT_NAME, "XmNinsertBefore"}, {tkn_k_class_argument, sym_k_XmNinsertPosition_arg, 17, ARGUMENT_NAME, "XmNinsertPosition"}, {tkn_k_class_argument, sym_k_XmNisAligned_arg, 12, ARGUMENT_NAME, "XmNisAligned"}, {tkn_k_class_argument, sym_k_XmNisHomogeneous_arg, 16, ARGUMENT_NAME, "XmNisHomogeneous"}, {tkn_k_class_argument, sym_k_XmNitalicString_arg, 15, ARGUMENT_NAME, "XmNitalicString"}, {tkn_k_class_argument, sym_k_XmNitemCount_arg, 12, ARGUMENT_NAME, "XmNitemCount"}, {tkn_k_class_reason, sym_k_XmNitemFoundCallback_reason, 20, REASON_NAME, "XmNitemFoundCallback"}, {tkn_k_class_reason, sym_k_XmNitemNotFoundCallback_reason, 23, REASON_NAME, "XmNitemNotFoundCallback"}, {tkn_k_class_argument, sym_k_XmNitemSpacing_arg, 14, ARGUMENT_NAME, "XmNitemSpacing"}, {tkn_k_class_argument, sym_k_XmNitems_arg, 8, ARGUMENT_NAME, "XmNitems"}, {tkn_k_class_argument, sym_k_XmNkeyboardFocusPolicy_arg, 22, ARGUMENT_NAME, "XmNkeyboardFocusPolicy"}, {tkn_k_class_argument, sym_k_XmNlabel_arg, 8, ARGUMENT_NAME, "XmNlabel"}, {tkn_k_class_argument, sym_k_XmNlabelFontList_arg, 16, ARGUMENT_NAME, "XmNlabelFontList"}, {tkn_k_class_argument, sym_k_XmNlabelInsensitivePixmap_arg, 25, ARGUMENT_NAME, "XmNlabelInsensitivePixmap"}, {tkn_k_class_argument, sym_k_XmNlabelPixmap_arg, 14, ARGUMENT_NAME, "XmNlabelPixmap"}, {tkn_k_class_argument, sym_k_XmNlabelRenderTable_arg, 19, ARGUMENT_NAME, "XmNlabelRenderTable"}, {tkn_k_class_argument, sym_k_XmNlabelSpacing_arg, 15, ARGUMENT_NAME, "XmNlabelSpacing"}, {tkn_k_class_argument, sym_k_XmNlabelString_arg, 14, ARGUMENT_NAME, "XmNlabelString"}, {tkn_k_class_argument, sym_k_XmNlabelType_arg, 12, ARGUMENT_NAME, "XmNlabelType"}, {tkn_k_class_argument, sym_k_XmNlargeCellHeight_arg, 18, ARGUMENT_NAME, "XmNlargeCellHeight"}, {tkn_k_class_argument, sym_k_XmNlargeCellWidth_arg, 17, ARGUMENT_NAME, "XmNlargeCellWidth"}, {tkn_k_class_argument, sym_k_XmNlargeIconMask_arg, 16, ARGUMENT_NAME, "XmNlargeIconMask"}, {tkn_k_class_argument, sym_k_XmNlargeIconPixmap_arg, 18, ARGUMENT_NAME, "XmNlargeIconPixmap"}, {tkn_k_class_argument, sym_k_XmNlargeIconX_arg, 13, ARGUMENT_NAME, "XmNlargeIconX"}, {tkn_k_class_argument, sym_k_XmNlargeIconY_arg, 13, ARGUMENT_NAME, "XmNlargeIconY"}, {tkn_k_class_argument, sym_k_XmNlastPageNumber_arg, 17, ARGUMENT_NAME, "XmNlastPageNumber"}, {tkn_k_class_argument, sym_k_XmNlayoutDirection_arg, 18, ARGUMENT_NAME, "XmNlayoutDirection"}, {tkn_k_class_argument, sym_k_XmNlayoutType_arg, 13, ARGUMENT_NAME, "XmNlayoutType"}, {tkn_k_class_argument, sym_k_XmNleftAttachment_arg, 17, ARGUMENT_NAME, "XmNleftAttachment"}, {tkn_k_class_argument, sym_k_XmNleftOffset_arg, 13, ARGUMENT_NAME, "XmNleftOffset"}, {tkn_k_class_argument, sym_k_XmNleftPosition_arg, 15, ARGUMENT_NAME, "XmNleftPosition"}, {tkn_k_class_argument, sym_k_XmNleftWidget_arg, 13, ARGUMENT_NAME, "XmNleftWidget"}, {tkn_k_class_argument, sym_k_XmNlightThreshold_arg, 17, ARGUMENT_NAME, "XmNlightThreshold"}, {tkn_k_class_argument, sym_k_XmNlineBackgroundColor_arg, 22, ARGUMENT_NAME, "XmNlineBackgroundColor"}, {tkn_k_class_argument, sym_k_XmNlineColor_arg, 12, ARGUMENT_NAME, "XmNlineColor"}, {tkn_k_class_argument, sym_k_XmNlineStyle_arg, 12, ARGUMENT_NAME, "XmNlineStyle"}, {tkn_k_class_argument, sym_k_XmNlineWidth_arg, 12, ARGUMENT_NAME, "XmNlineWidth"}, {tkn_k_class_argument, sym_k_XmNlist_arg, 7, ARGUMENT_NAME, "XmNlist"}, {tkn_k_class_argument, sym_k_XmNlistItemCount_arg, 16, ARGUMENT_NAME, "XmNlistItemCount"}, {tkn_k_class_argument, sym_k_XmNlistItems_arg, 12, ARGUMENT_NAME, "XmNlistItems"}, {tkn_k_class_argument, sym_k_XmNlistLabelString_arg, 18, ARGUMENT_NAME, "XmNlistLabelString"}, {tkn_k_class_argument, sym_k_XmNlistMarginHeight_arg, 19, ARGUMENT_NAME, "XmNlistMarginHeight"}, {tkn_k_class_argument, sym_k_XmNlistMarginWidth_arg, 18, ARGUMENT_NAME, "XmNlistMarginWidth"}, {tkn_k_class_argument, sym_k_XmNlistSizePolicy_arg, 17, ARGUMENT_NAME, "XmNlistSizePolicy"}, {tkn_k_class_argument, sym_k_XmNlistSpacing_arg, 14, ARGUMENT_NAME, "XmNlistSpacing"}, {tkn_k_class_argument, sym_k_XmNlistUpdated_arg, 14, ARGUMENT_NAME, "XmNlistUpdated"}, {tkn_k_class_argument, sym_k_XmNlistVisibleItemCount_arg, 23, ARGUMENT_NAME, "XmNlistVisibleItemCount"}, {tkn_k_class_argument, sym_k_XmNloadModel_arg, 12, ARGUMENT_NAME, "XmNloadModel"}, {tkn_k_class_reason, sym_k_XmNlosePrimaryCallback_reason, 22, REASON_NAME, "XmNlosePrimaryCallback"}, {tkn_k_class_reason, sym_k_XmNlosingFocusCallback_reason, 22, REASON_NAME, "XmNlosingFocusCallback"}, {tkn_k_class_argument, sym_k_XmNmainWindowMarginHeight_arg, 25, ARGUMENT_NAME, "XmNmainWindowMarginHeight"}, {tkn_k_class_argument, sym_k_XmNmainWindowMarginWidth_arg, 24, ARGUMENT_NAME, "XmNmainWindowMarginWidth"}, {tkn_k_class_argument, sym_k_XmNmajorTabSpacing_arg, 18, ARGUMENT_NAME, "XmNmajorTabSpacing"}, {tkn_k_class_reason, sym_k_XmNmapCallback_reason, 14, REASON_NAME, "XmNmapCallback"}, {tkn_k_class_argument, sym_k_XmNmappedWhenManaged_arg, 20, ARGUMENT_NAME, "XmNmappedWhenManaged"}, {tkn_k_class_argument, sym_k_XmNmappingDelay_arg, 15, ARGUMENT_NAME, "XmNmappingDelay"}, {tkn_k_class_argument, sym_k_XmNmargin_arg, 9, ARGUMENT_NAME, "XmNmargin"}, {tkn_k_class_argument, sym_k_XmNmarginBottom_arg, 15, ARGUMENT_NAME, "XmNmarginBottom"}, {tkn_k_class_argument, sym_k_XmNmarginHeight_arg, 15, ARGUMENT_NAME, "XmNmarginHeight"}, {tkn_k_class_argument, sym_k_XmNmarginLeft_arg, 13, ARGUMENT_NAME, "XmNmarginLeft"}, {tkn_k_class_argument, sym_k_XmNmarginRight_arg, 14, ARGUMENT_NAME, "XmNmarginRight"}, {tkn_k_class_argument, sym_k_XmNmarginTop_arg, 12, ARGUMENT_NAME, "XmNmarginTop"}, {tkn_k_class_argument, sym_k_XmNmarginWidth_arg, 14, ARGUMENT_NAME, "XmNmarginWidth"}, {tkn_k_class_argument, sym_k_XmNmatchBehavior_arg, 16, ARGUMENT_NAME, "XmNmatchBehavior"}, {tkn_k_class_argument, sym_k_XmNmaxAspectX_arg, 13, ARGUMENT_NAME, "XmNmaxAspectX"}, {tkn_k_class_argument, sym_k_XmNmaxAspectY_arg, 13, ARGUMENT_NAME, "XmNmaxAspectY"}, {tkn_k_class_argument, sym_k_XmNmaxHeight_arg, 12, ARGUMENT_NAME, "XmNmaxHeight"}, {tkn_k_class_argument, sym_k_XmNmaxLength_arg, 12, ARGUMENT_NAME, "XmNmaxLength"}, {tkn_k_class_argument, sym_k_XmNmaxWidth_arg, 11, ARGUMENT_NAME, "XmNmaxWidth"}, {tkn_k_class_argument, sym_k_XmNmaximum_arg, 10, ARGUMENT_NAME, "XmNmaximum"}, {tkn_k_class_argument, sym_k_XmNmaximumValue_arg, 15, ARGUMENT_NAME, "XmNmaximumValue"}, {tkn_k_class_argument, sym_k_XmNmenuAccelerator_arg, 18, ARGUMENT_NAME, "XmNmenuAccelerator"}, {tkn_k_class_argument, sym_k_XmNmenuBar_arg, 10, ARGUMENT_NAME, "XmNmenuBar"}, {tkn_k_class_argument, sym_k_XmNmenuHelpWidget_arg, 17, ARGUMENT_NAME, "XmNmenuHelpWidget"}, {tkn_k_class_argument, sym_k_XmNmenuHistory_arg, 14, ARGUMENT_NAME, "XmNmenuHistory"}, {tkn_k_class_argument, sym_k_XmNmenuPost_arg, 11, ARGUMENT_NAME, "XmNmenuPost"}, {tkn_k_class_argument, sym_k_XmNmessageAlignment_arg, 19, ARGUMENT_NAME, "XmNmessageAlignment"}, {tkn_k_class_argument, sym_k_XmNmessageString_arg, 16, ARGUMENT_NAME, "XmNmessageString"}, {tkn_k_class_argument, sym_k_XmNmessageWindow_arg, 16, ARGUMENT_NAME, "XmNmessageWindow"}, {tkn_k_class_argument, sym_k_XmNminAspectX_arg, 13, ARGUMENT_NAME, "XmNminAspectX"}, {tkn_k_class_argument, sym_k_XmNminAspectY_arg, 13, ARGUMENT_NAME, "XmNminAspectY"}, {tkn_k_class_argument, sym_k_XmNminHeight_arg, 12, ARGUMENT_NAME, "XmNminHeight"}, {tkn_k_class_argument, sym_k_XmNminWidth_arg, 11, ARGUMENT_NAME, "XmNminWidth"}, {tkn_k_class_argument, sym_k_XmNminimizeButtons_arg, 18, ARGUMENT_NAME, "XmNminimizeButtons"}, {tkn_k_class_argument, sym_k_XmNminimum_arg, 10, ARGUMENT_NAME, "XmNminimum"}, {tkn_k_class_argument, sym_k_XmNminimumCellHeight_arg, 20, ARGUMENT_NAME, "XmNminimumCellHeight"}, {tkn_k_class_argument, sym_k_XmNminimumCellWidth_arg, 19, ARGUMENT_NAME, "XmNminimumCellWidth"}, {tkn_k_class_argument, sym_k_XmNminimumHorizontalCells_arg, 25, ARGUMENT_NAME, "XmNminimumHorizontalCells"}, {tkn_k_class_argument, sym_k_XmNminimumValue_arg, 15, ARGUMENT_NAME, "XmNminimumValue"}, {tkn_k_class_argument, sym_k_XmNminimumVerticalCells_arg, 23, ARGUMENT_NAME, "XmNminimumVerticalCells"}, {tkn_k_class_argument, sym_k_XmNminorTabSpacing_arg, 18, ARGUMENT_NAME, "XmNminorTabSpacing"}, {tkn_k_class_argument, sym_k_XmNmnemonic_arg, 11, ARGUMENT_NAME, "XmNmnemonic"}, {tkn_k_class_argument, sym_k_XmNmnemonicCharSet_arg, 18, ARGUMENT_NAME, "XmNmnemonicCharSet"}, {tkn_k_class_reason, sym_k_XmNmodifyVerifyCallback_reason, 23, REASON_NAME, "XmNmodifyVerifyCallback"}, {tkn_k_class_reason, sym_k_XmNmodifyVerifyCallbackWcs_reason, 26, REASON_NAME, "XmNmodifyVerifyCallbackWcs"}, {tkn_k_class_argument, sym_k_XmNmonoSpaceString_arg, 18, ARGUMENT_NAME, "XmNmonoSpaceString"}, {tkn_k_class_reason, sym_k_XmNmotionVerifyCallback_reason, 23, REASON_NAME, "XmNmotionVerifyCallback"}, {tkn_k_class_argument, sym_k_XmNmultiClick_arg, 13, ARGUMENT_NAME, "XmNmultiClick"}, {tkn_k_class_reason, sym_k_XmNmultipleSelectionCallback_reason, 28, REASON_NAME, "XmNmultipleSelectionCallback"}, {tkn_k_class_argument, sym_k_XmNmustMatch_arg, 12, ARGUMENT_NAME, "XmNmustMatch"}, {tkn_k_class_argument, sym_k_XmNmwmDecorations_arg, 17, ARGUMENT_NAME, "XmNmwmDecorations"}, {tkn_k_class_argument, sym_k_XmNmwmFunctions_arg, 15, ARGUMENT_NAME, "XmNmwmFunctions"}, {tkn_k_class_argument, sym_k_XmNmwmInputMode_arg, 15, ARGUMENT_NAME, "XmNmwmInputMode"}, {tkn_k_class_argument, sym_k_XmNmwmMenu_arg, 10, ARGUMENT_NAME, "XmNmwmMenu"}, {tkn_k_class_argument, sym_k_XmNnavigationType_arg, 17, ARGUMENT_NAME, "XmNnavigationType"}, {tkn_k_class_argument, sym_k_XmNnewVisualStyle_arg, 17, ARGUMENT_NAME, "XmNnewVisualStyle"}, {tkn_k_class_argument, sym_k_XmNnoCellError_arg, 14, ARGUMENT_NAME, "XmNnoCellError"}, {tkn_k_class_reason, sym_k_XmNnoMatchCallback_reason, 18, REASON_NAME, "XmNnoMatchCallback"}, {tkn_k_class_argument, sym_k_XmNnoMatchString_arg, 16, ARGUMENT_NAME, "XmNnoMatchString"}, {tkn_k_class_argument, sym_k_XmNnoResize_arg, 11, ARGUMENT_NAME, "XmNnoResize"}, {tkn_k_class_argument, sym_k_XmNnodeCloseFolderPixmap_arg, 24, ARGUMENT_NAME, "XmNnodeCloseFolderPixmap"}, {tkn_k_class_argument, sym_k_XmNnodeOpenFolderPixmap_arg, 23, ARGUMENT_NAME, "XmNnodeOpenFolderPixmap"}, {tkn_k_class_argument, sym_k_XmNnodeState_arg, 12, ARGUMENT_NAME, "XmNnodeState"}, {tkn_k_class_reason, sym_k_XmNnodeStateBegEndCallback_reason, 26, REASON_NAME, "XmNnodeStateBegEndCallback"}, {tkn_k_class_reason, sym_k_XmNnodeStateCallback_reason, 20, REASON_NAME, "XmNnodeStateCallback"}, {tkn_k_class_reason, sym_k_XmNnodeStateChangedCallback_reason, 27, REASON_NAME, "XmNnodeStateChangedCallback"}, {tkn_k_class_argument, sym_k_XmNnotebookChildType_arg, 20, ARGUMENT_NAME, "XmNnotebookChildType"}, {tkn_k_class_argument, sym_k_XmNnumColumns_arg, 13, ARGUMENT_NAME, "XmNnumColumns"}, {tkn_k_class_argument, sym_k_XmNnumRows_arg, 10, ARGUMENT_NAME, "XmNnumRows"}, {tkn_k_class_argument, sym_k_XmNnumStacks_arg, 12, ARGUMENT_NAME, "XmNnumStacks"}, {tkn_k_class_argument, sym_k_XmNnumValues_arg, 12, ARGUMENT_NAME, "XmNnumValues"}, {tkn_k_class_argument, sym_k_XmNoffsetModel_arg, 14, ARGUMENT_NAME, "XmNoffsetModel"}, {tkn_k_class_reason, sym_k_XmNokCallback_reason, 13, REASON_NAME, "XmNokCallback"}, {tkn_k_class_argument, sym_k_XmNokLabelString_arg, 16, ARGUMENT_NAME, "XmNokLabelString"}, {tkn_k_class_argument, sym_k_XmNopenClosePadding_arg, 19, ARGUMENT_NAME, "XmNopenClosePadding"}, {tkn_k_class_argument, sym_k_XmNopenFolderPixmap_arg, 19, ARGUMENT_NAME, "XmNopenFolderPixmap"}, {tkn_k_class_argument, sym_k_XmNoptionString_arg, 15, ARGUMENT_NAME, "XmNoptionString"}, {tkn_k_class_argument, sym_k_XmNorientation_arg, 14, ARGUMENT_NAME, "XmNorientation"}, {tkn_k_class_class, sym_k_XmNotebook_object, 10, CLASS_NAME, "XmNotebook"}, {tkn_k_class_argument, sym_k_XmNotherString_arg, 14, ARGUMENT_NAME, "XmNotherString"}, {tkn_k_class_argument, sym_k_XmNoutlineButtonPolicy_arg, 22, ARGUMENT_NAME, "XmNoutlineButtonPolicy"}, {tkn_k_class_reason, sym_k_XmNoutlineChangedCallback_reason, 25, REASON_NAME, "XmNoutlineChangedCallback"}, {tkn_k_class_argument, sym_k_XmNoutlineColumnWidth_arg, 21, ARGUMENT_NAME, "XmNoutlineColumnWidth"}, {tkn_k_class_argument, sym_k_XmNoutlineIndentation_arg, 21, ARGUMENT_NAME, "XmNoutlineIndentation"}, {tkn_k_class_argument, sym_k_XmNoutlineLineStyle_arg, 19, ARGUMENT_NAME, "XmNoutlineLineStyle"}, {tkn_k_class_argument, sym_k_XmNoutlineState_arg, 15, ARGUMENT_NAME, "XmNoutlineState"}, {tkn_k_class_argument, sym_k_XmNoverrideRedirect_arg, 19, ARGUMENT_NAME, "XmNoverrideRedirect"}, {tkn_k_class_argument, sym_k_XmNpacking_arg, 10, ARGUMENT_NAME, "XmNpacking"}, {tkn_k_class_reason, sym_k_XmNpageChangedCallback_reason, 22, REASON_NAME, "XmNpageChangedCallback"}, {tkn_k_class_reason, sym_k_XmNpageDecrementCallback_reason, 24, REASON_NAME, "XmNpageDecrementCallback"}, {tkn_k_class_argument, sym_k_XmNpageIncrement_arg, 16, ARGUMENT_NAME, "XmNpageIncrement"}, {tkn_k_class_reason, sym_k_XmNpageIncrementCallback_reason, 24, REASON_NAME, "XmNpageIncrementCallback"}, {tkn_k_class_argument, sym_k_XmNpageNumber_arg, 13, ARGUMENT_NAME, "XmNpageNumber"}, {tkn_k_class_argument, sym_k_XmNpaneMaximum_arg, 14, ARGUMENT_NAME, "XmNpaneMaximum"}, {tkn_k_class_argument, sym_k_XmNpaneMinimum_arg, 14, ARGUMENT_NAME, "XmNpaneMinimum"}, {tkn_k_class_argument, sym_k_XmNparentNode_arg, 13, ARGUMENT_NAME, "XmNparentNode"}, {tkn_k_class_argument, sym_k_XmNpattern_arg, 10, ARGUMENT_NAME, "XmNpattern"}, {tkn_k_class_argument, sym_k_XmNpendingDelete_arg, 16, ARGUMENT_NAME, "XmNpendingDelete"}, {tkn_k_class_argument, sym_k_XmNpicture_arg, 10, ARGUMENT_NAME, "XmNpicture"}, {tkn_k_class_reason, sym_k_XmNpictureErrorCallback_reason, 23, REASON_NAME, "XmNpictureErrorCallback"}, {tkn_k_class_argument, sym_k_XmNpixmap_arg, 9, ARGUMENT_NAME, "XmNpixmap"}, {tkn_k_class_argument, sym_k_XmNpixmapDepth_arg, 14, ARGUMENT_NAME, "XmNpixmapDepth"}, {tkn_k_class_argument, sym_k_XmNpixmapHeight_arg, 15, ARGUMENT_NAME, "XmNpixmapHeight"}, {tkn_k_class_argument, sym_k_XmNpixmapPlacement_arg, 18, ARGUMENT_NAME, "XmNpixmapPlacement"}, {tkn_k_class_argument, sym_k_XmNpixmapTextPadding_arg, 20, ARGUMENT_NAME, "XmNpixmapTextPadding"}, {tkn_k_class_argument, sym_k_XmNpixmapWidth_arg, 14, ARGUMENT_NAME, "XmNpixmapWidth"}, {tkn_k_class_reason, sym_k_XmNpopdownCallback_reason, 18, REASON_NAME, "XmNpopdownCallback"}, {tkn_k_class_reason, sym_k_XmNpopupCallback_reason, 16, REASON_NAME, "XmNpopupCallback"}, {tkn_k_class_argument, sym_k_XmNpopupCursor_arg, 14, ARGUMENT_NAME, "XmNpopupCursor"}, {tkn_k_class_argument, sym_k_XmNpopupEnabled_arg, 15, ARGUMENT_NAME, "XmNpopupEnabled"}, {tkn_k_class_reason, sym_k_XmNpopupHandlerCallback_reason, 23, REASON_NAME, "XmNpopupHandlerCallback"}, {tkn_k_class_argument, sym_k_XmNpopupOffset_arg, 14, ARGUMENT_NAME, "XmNpopupOffset"}, {tkn_k_class_argument, sym_k_XmNpopupShellWidget_arg, 19, ARGUMENT_NAME, "XmNpopupShellWidget"}, {tkn_k_class_argument, sym_k_XmNposition_arg, 11, ARGUMENT_NAME, "XmNposition"}, {tkn_k_class_argument, sym_k_XmNpositionIndex_arg, 16, ARGUMENT_NAME, "XmNpositionIndex"}, {tkn_k_class_argument, sym_k_XmNpositionMode_arg, 15, ARGUMENT_NAME, "XmNpositionMode"}, {tkn_k_class_argument, sym_k_XmNpositionType_arg, 15, ARGUMENT_NAME, "XmNpositionType"}, {tkn_k_class_argument, sym_k_XmNpreeditType_arg, 14, ARGUMENT_NAME, "XmNpreeditType"}, {tkn_k_class_argument, sym_k_XmNpreferredPaneSize_arg, 20, ARGUMENT_NAME, "XmNpreferredPaneSize"}, {tkn_k_class_argument, sym_k_XmNprimaryOwnership_arg, 19, ARGUMENT_NAME, "XmNprimaryOwnership"}, {tkn_k_class_argument, sym_k_XmNprocessingDirection_arg, 22, ARGUMENT_NAME, "XmNprocessingDirection"}, {tkn_k_class_argument, sym_k_XmNpromptString_arg, 15, ARGUMENT_NAME, "XmNpromptString"}, {tkn_k_class_argument, sym_k_XmNpropSpaceString_arg, 18, ARGUMENT_NAME, "XmNpropSpaceString"}, {tkn_k_class_argument, sym_k_XmNpushButtonEnabled_arg, 20, ARGUMENT_NAME, "XmNpushButtonEnabled"}, {tkn_k_class_argument, sym_k_XmNqualifySearchDataProc_arg, 24, ARGUMENT_NAME, "XmNqualifySearchDataProc"}, {tkn_k_class_argument, sym_k_XmNradioAlwaysOne_arg, 17, ARGUMENT_NAME, "XmNradioAlwaysOne"}, {tkn_k_class_argument, sym_k_XmNradioBehavior_arg, 16, ARGUMENT_NAME, "XmNradioBehavior"}, {tkn_k_class_reason, sym_k_XmNrealizeCallback_reason, 18, REASON_NAME, "XmNrealizeCallback"}, {tkn_k_class_argument, sym_k_XmNrecomputeSize_arg, 16, ARGUMENT_NAME, "XmNrecomputeSize"}, {tkn_k_class_argument, sym_k_XmNredSliderLabel_arg, 17, ARGUMENT_NAME, "XmNredSliderLabel"}, {tkn_k_class_argument, sym_k_XmNrefigureMode_arg, 15, ARGUMENT_NAME, "XmNrefigureMode"}, {tkn_k_class_argument, sym_k_XmNrenderTable_arg, 14, ARGUMENT_NAME, "XmNrenderTable"}, {tkn_k_class_argument, sym_k_XmNrenditionBackground_arg, 22, ARGUMENT_NAME, "XmNrenditionBackground"}, {tkn_k_class_argument, sym_k_XmNrenditionForeground_arg, 22, ARGUMENT_NAME, "XmNrenditionForeground"}, {tkn_k_class_argument, sym_k_XmNrepeatDelay_arg, 14, ARGUMENT_NAME, "XmNrepeatDelay"}, {tkn_k_class_argument, sym_k_XmNresizable_arg, 12, ARGUMENT_NAME, "XmNresizable"}, {tkn_k_class_reason, sym_k_XmNresizeCallback_reason, 17, REASON_NAME, "XmNresizeCallback"}, {tkn_k_class_argument, sym_k_XmNresizeHeight_arg, 15, ARGUMENT_NAME, "XmNresizeHeight"}, {tkn_k_class_argument, sym_k_XmNresizePolicy_arg, 15, ARGUMENT_NAME, "XmNresizePolicy"}, {tkn_k_class_argument, sym_k_XmNresizeToPreferred_arg, 20, ARGUMENT_NAME, "XmNresizeToPreferred"}, {tkn_k_class_argument, sym_k_XmNresizeWidth_arg, 14, ARGUMENT_NAME, "XmNresizeWidth"}, {tkn_k_class_argument, sym_k_XmNrgbFile_arg, 10, ARGUMENT_NAME, "XmNrgbFile"}, {tkn_k_class_argument, sym_k_XmNrightAttachment_arg, 18, ARGUMENT_NAME, "XmNrightAttachment"}, {tkn_k_class_argument, sym_k_XmNrightOffset_arg, 14, ARGUMENT_NAME, "XmNrightOffset"}, {tkn_k_class_argument, sym_k_XmNrightPosition_arg, 16, ARGUMENT_NAME, "XmNrightPosition"}, {tkn_k_class_argument, sym_k_XmNrightWidget_arg, 14, ARGUMENT_NAME, "XmNrightWidget"}, {tkn_k_class_argument, sym_k_XmNrowColumnType_arg, 16, ARGUMENT_NAME, "XmNrowColumnType"}, {tkn_k_class_argument, sym_k_XmNrows_arg, 7, ARGUMENT_NAME, "XmNrows"}, {tkn_k_class_argument, sym_k_XmNrubberPositioning_arg, 20, ARGUMENT_NAME, "XmNrubberPositioning"}, {tkn_k_class_argument, sym_k_XmNsampleText_arg, 13, ARGUMENT_NAME, "XmNsampleText"}, {tkn_k_class_argument, sym_k_XmNsashHeight_arg, 13, ARGUMENT_NAME, "XmNsashHeight"}, {tkn_k_class_argument, sym_k_XmNsashIndent_arg, 13, ARGUMENT_NAME, "XmNsashIndent"}, {tkn_k_class_argument, sym_k_XmNsashShadowThickness_arg, 22, ARGUMENT_NAME, "XmNsashShadowThickness"}, {tkn_k_class_argument, sym_k_XmNsashTranslations_arg, 19, ARGUMENT_NAME, "XmNsashTranslations"}, {tkn_k_class_argument, sym_k_XmNsashWidth_arg, 12, ARGUMENT_NAME, "XmNsashWidth"}, {tkn_k_class_argument, sym_k_XmNsaveUnder_arg, 12, ARGUMENT_NAME, "XmNsaveUnder"}, {tkn_k_class_argument, sym_k_XmNscaleHeight_arg, 14, ARGUMENT_NAME, "XmNscaleHeight"}, {tkn_k_class_argument, sym_k_XmNscaleMultiple_arg, 16, ARGUMENT_NAME, "XmNscaleMultiple"}, {tkn_k_class_argument, sym_k_XmNscaleWidth_arg, 13, ARGUMENT_NAME, "XmNscaleWidth"}, {tkn_k_class_argument, sym_k_XmNscalingString_arg, 16, ARGUMENT_NAME, "XmNscalingString"}, {tkn_k_class_argument, sym_k_XmNscreen_arg, 9, ARGUMENT_NAME, "XmNscreen"}, {tkn_k_class_argument, sym_k_XmNscrollBarDisplayPolicy_arg, 25, ARGUMENT_NAME, "XmNscrollBarDisplayPolicy"}, {tkn_k_class_argument, sym_k_XmNscrollBarPlacement_arg, 21, ARGUMENT_NAME, "XmNscrollBarPlacement"}, {tkn_k_class_argument, sym_k_XmNscrollHorizontal_arg, 19, ARGUMENT_NAME, "XmNscrollHorizontal"}, {tkn_k_class_argument, sym_k_XmNscrollLeftSide_arg, 17, ARGUMENT_NAME, "XmNscrollLeftSide"}, {tkn_k_class_argument, sym_k_XmNscrollTopSide_arg, 16, ARGUMENT_NAME, "XmNscrollTopSide"}, {tkn_k_class_argument, sym_k_XmNscrollVertical_arg, 17, ARGUMENT_NAME, "XmNscrollVertical"}, {tkn_k_class_argument, sym_k_XmNscrolledWindowChildType_arg, 26, ARGUMENT_NAME, "XmNscrolledWindowChildType"}, {tkn_k_class_argument, sym_k_XmNscrolledWindowMarginHeight_arg, 29, ARGUMENT_NAME, "XmNscrolledWindowMarginHeight"}, {tkn_k_class_argument, sym_k_XmNscrolledWindowMarginWidth_arg, 28, ARGUMENT_NAME, "XmNscrolledWindowMarginWidth"}, {tkn_k_class_argument, sym_k_XmNscrollingPolicy_arg, 18, ARGUMENT_NAME, "XmNscrollingPolicy"}, {tkn_k_class_reason, sym_k_XmNselectCallback_reason, 17, REASON_NAME, "XmNselectCallback"}, {tkn_k_class_argument, sym_k_XmNselectColor_arg, 14, ARGUMENT_NAME, "XmNselectColor"}, {tkn_k_class_argument, sym_k_XmNselectInsensitivePixmap_arg, 26, ARGUMENT_NAME, "XmNselectInsensitivePixmap"}, {tkn_k_class_argument, sym_k_XmNselectPixmap_arg, 15, ARGUMENT_NAME, "XmNselectPixmap"}, {tkn_k_class_argument, sym_k_XmNselectThreshold_arg, 18, ARGUMENT_NAME, "XmNselectThreshold"}, {tkn_k_class_argument, sym_k_XmNselectedColumn_arg, 17, ARGUMENT_NAME, "XmNselectedColumn"}, {tkn_k_class_argument, sym_k_XmNselectedItem_arg, 15, ARGUMENT_NAME, "XmNselectedItem"}, {tkn_k_class_argument, sym_k_XmNselectedItemCount_arg, 20, ARGUMENT_NAME, "XmNselectedItemCount"}, {tkn_k_class_argument, sym_k_XmNselectedItems_arg, 16, ARGUMENT_NAME, "XmNselectedItems"}, {tkn_k_class_argument, sym_k_XmNselectedPosition_arg, 19, ARGUMENT_NAME, "XmNselectedPosition"}, {tkn_k_class_argument, sym_k_XmNselectedPositionCount_arg, 24, ARGUMENT_NAME, "XmNselectedPositionCount"}, {tkn_k_class_argument, sym_k_XmNselectedPositions_arg, 20, ARGUMENT_NAME, "XmNselectedPositions"}, {tkn_k_class_argument, sym_k_XmNselectionArray_arg, 17, ARGUMENT_NAME, "XmNselectionArray"}, {tkn_k_class_argument, sym_k_XmNselectionArrayCount_arg, 22, ARGUMENT_NAME, "XmNselectionArrayCount"}, {tkn_k_class_reason, sym_k_XmNselectionCallback_reason, 20, REASON_NAME, "XmNselectionCallback"}, {tkn_k_class_argument, sym_k_XmNselectionLabelString_arg, 23, ARGUMENT_NAME, "XmNselectionLabelString"}, {tkn_k_class_argument, sym_k_XmNselectionMode_arg, 16, ARGUMENT_NAME, "XmNselectionMode"}, {tkn_k_class_argument, sym_k_XmNselectionPolicy_arg, 18, ARGUMENT_NAME, "XmNselectionPolicy"}, {tkn_k_class_argument, sym_k_XmNselectionTechnique_arg, 21, ARGUMENT_NAME, "XmNselectionTechnique"}, {tkn_k_class_argument, sym_k_XmNsensitive_arg, 12, ARGUMENT_NAME, "XmNsensitive"}, {tkn_k_class_argument, sym_k_XmNseparatorOn_arg, 14, ARGUMENT_NAME, "XmNseparatorOn"}, {tkn_k_class_argument, sym_k_XmNseparatorType_arg, 16, ARGUMENT_NAME, "XmNseparatorType"}, {tkn_k_class_argument, sym_k_XmNset_arg, 6, ARGUMENT_NAME, "XmNset"}, {tkn_k_class_argument, sym_k_XmNshadowThickness_arg, 18, ARGUMENT_NAME, "XmNshadowThickness"}, {tkn_k_class_argument, sym_k_XmNshadowType_arg, 13, ARGUMENT_NAME, "XmNshadowType"}, {tkn_k_class_argument, sym_k_XmNshellUnitType_arg, 16, ARGUMENT_NAME, "XmNshellUnitType"}, {tkn_k_class_argument, sym_k_XmNshowArrows_arg, 13, ARGUMENT_NAME, "XmNshowArrows"}, {tkn_k_class_argument, sym_k_XmNshowAsDefault_arg, 16, ARGUMENT_NAME, "XmNshowAsDefault"}, {tkn_k_class_argument, sym_k_XmNshowEntryLabel_arg, 17, ARGUMENT_NAME, "XmNshowEntryLabel"}, {tkn_k_class_argument, sym_k_XmNshowFind_arg, 11, ARGUMENT_NAME, "XmNshowFind"}, {tkn_k_class_argument, sym_k_XmNshowFontName_arg, 15, ARGUMENT_NAME, "XmNshowFontName"}, {tkn_k_class_argument, sym_k_XmNshowLabel_arg, 12, ARGUMENT_NAME, "XmNshowLabel"}, {tkn_k_class_argument, sym_k_XmNshowNameString_arg, 17, ARGUMENT_NAME, "XmNshowNameString"}, {tkn_k_class_argument, sym_k_XmNshowSash_arg, 11, ARGUMENT_NAME, "XmNshowSash"}, {tkn_k_class_argument, sym_k_XmNshowSeparator_arg, 16, ARGUMENT_NAME, "XmNshowSeparator"}, {tkn_k_class_argument, sym_k_XmNshowValue_arg, 12, ARGUMENT_NAME, "XmNshowValue"}, {tkn_k_class_reason, sym_k_XmNsimpleCallback_reason, 17, REASON_NAME, "XmNsimpleCallback"}, {tkn_k_class_reason, sym_k_XmNsingleSelectionCallback_reason, 26, REASON_NAME, "XmNsingleSelectionCallback"}, {tkn_k_class_argument, sym_k_XmNsizeString_arg, 13, ARGUMENT_NAME, "XmNsizeString"}, {tkn_k_class_argument, sym_k_XmNskipAdjust_arg, 13, ARGUMENT_NAME, "XmNskipAdjust"}, {tkn_k_class_argument, sym_k_XmNsliderMark_arg, 13, ARGUMENT_NAME, "XmNsliderMark"}, {tkn_k_class_argument, sym_k_XmNsliderSize_arg, 13, ARGUMENT_NAME, "XmNsliderSize"}, {tkn_k_class_argument, sym_k_XmNsliderTogLabel_arg, 17, ARGUMENT_NAME, "XmNsliderTogLabel"}, {tkn_k_class_argument, sym_k_XmNsliderVisual_arg, 15, ARGUMENT_NAME, "XmNsliderVisual"}, {tkn_k_class_argument, sym_k_XmNslidingMode_arg, 14, ARGUMENT_NAME, "XmNslidingMode"}, {tkn_k_class_argument, sym_k_XmNsmallCellHeight_arg, 18, ARGUMENT_NAME, "XmNsmallCellHeight"}, {tkn_k_class_argument, sym_k_XmNsmallCellWidth_arg, 17, ARGUMENT_NAME, "XmNsmallCellWidth"}, {tkn_k_class_argument, sym_k_XmNsmallIconMask_arg, 16, ARGUMENT_NAME, "XmNsmallIconMask"}, {tkn_k_class_argument, sym_k_XmNsmallIconPixmap_arg, 18, ARGUMENT_NAME, "XmNsmallIconPixmap"}, {tkn_k_class_argument, sym_k_XmNsmallIconX_arg, 13, ARGUMENT_NAME, "XmNsmallIconX"}, {tkn_k_class_argument, sym_k_XmNsmallIconY_arg, 13, ARGUMENT_NAME, "XmNsmallIconY"}, {tkn_k_class_argument, sym_k_XmNsnapBackMultiple_arg, 19, ARGUMENT_NAME, "XmNsnapBackMultiple"}, {tkn_k_class_argument, sym_k_XmNsortFunctions_arg, 16, ARGUMENT_NAME, "XmNsortFunctions"}, {tkn_k_class_argument, sym_k_XmNsource_arg, 9, ARGUMENT_NAME, "XmNsource"}, {tkn_k_class_argument, sym_k_XmNspacing_arg, 10, ARGUMENT_NAME, "XmNspacing"}, {tkn_k_class_argument, sym_k_XmNspatialIncludeModel_arg, 22, ARGUMENT_NAME, "XmNspatialIncludeModel"}, {tkn_k_class_argument, sym_k_XmNspatialResizeModel_arg, 21, ARGUMENT_NAME, "XmNspatialResizeModel"}, {tkn_k_class_argument, sym_k_XmNspatialSnapModel_arg, 19, ARGUMENT_NAME, "XmNspatialSnapModel"}, {tkn_k_class_argument, sym_k_XmNspatialStyle_arg, 15, ARGUMENT_NAME, "XmNspatialStyle"}, {tkn_k_class_argument, sym_k_XmNspinBoxChildType_arg, 19, ARGUMENT_NAME, "XmNspinBoxChildType"}, {tkn_k_class_argument, sym_k_XmNstackedEffect_arg, 16, ARGUMENT_NAME, "XmNstackedEffect"}, {tkn_k_class_argument, sym_k_XmNstretchable_arg, 14, ARGUMENT_NAME, "XmNstretchable"}, {tkn_k_class_argument, sym_k_XmNstrikethruType_arg, 17, ARGUMENT_NAME, "XmNstrikethruType"}, {tkn_k_class_argument, sym_k_XmNstringDirection_arg, 18, ARGUMENT_NAME, "XmNstringDirection"}, {tkn_k_class_argument, sym_k_XmNsubMenuId_arg, 12, ARGUMENT_NAME, "XmNsubMenuId"}, {tkn_k_class_argument, sym_k_XmNsymbolPixmap_arg, 15, ARGUMENT_NAME, "XmNsymbolPixmap"}, {tkn_k_class_argument, sym_k_XmNtabAlignment_arg, 15, ARGUMENT_NAME, "XmNtabAlignment"}, {tkn_k_class_argument, sym_k_XmNtabAutoSelect_arg, 16, ARGUMENT_NAME, "XmNtabAutoSelect"}, {tkn_k_class_argument, sym_k_XmNtabBackground_arg, 16, ARGUMENT_NAME, "XmNtabBackground"}, {tkn_k_class_argument, sym_k_XmNtabBackgroundPixmap_arg, 22, ARGUMENT_NAME, "XmNtabBackgroundPixmap"}, {tkn_k_class_argument, sym_k_XmNtabCornerPercent_arg, 19, ARGUMENT_NAME, "XmNtabCornerPercent"}, {tkn_k_class_argument, sym_k_XmNtabEdge_arg, 10, ARGUMENT_NAME, "XmNtabEdge"}, {tkn_k_class_argument, sym_k_XmNtabForeground_arg, 16, ARGUMENT_NAME, "XmNtabForeground"}, {tkn_k_class_argument, sym_k_XmNtabLabelPixmap_arg, 17, ARGUMENT_NAME, "XmNtabLabelPixmap"}, {tkn_k_class_argument, sym_k_XmNtabLabelSpacing_arg, 18, ARGUMENT_NAME, "XmNtabLabelSpacing"}, {tkn_k_class_argument, sym_k_XmNtabLabelString_arg, 17, ARGUMENT_NAME, "XmNtabLabelString"}, {tkn_k_class_argument, sym_k_XmNtabList_arg, 10, ARGUMENT_NAME, "XmNtabList"}, {tkn_k_class_argument, sym_k_XmNtabMarginHeight_arg, 18, ARGUMENT_NAME, "XmNtabMarginHeight"}, {tkn_k_class_argument, sym_k_XmNtabMarginWidth_arg, 17, ARGUMENT_NAME, "XmNtabMarginWidth"}, {tkn_k_class_argument, sym_k_XmNtabMode_arg, 10, ARGUMENT_NAME, "XmNtabMode"}, {tkn_k_class_argument, sym_k_XmNtabOffset_arg, 12, ARGUMENT_NAME, "XmNtabOffset"}, {tkn_k_class_argument, sym_k_XmNtabOrientation_arg, 17, ARGUMENT_NAME, "XmNtabOrientation"}, {tkn_k_class_argument, sym_k_XmNtabPixmapPlacement_arg, 21, ARGUMENT_NAME, "XmNtabPixmapPlacement"}, {tkn_k_class_argument, sym_k_XmNtabSelectColor_arg, 17, ARGUMENT_NAME, "XmNtabSelectColor"}, {tkn_k_class_argument, sym_k_XmNtabSelectPixmap_arg, 18, ARGUMENT_NAME, "XmNtabSelectPixmap"}, {tkn_k_class_reason, sym_k_XmNtabSelectedCallback_reason, 22, REASON_NAME, "XmNtabSelectedCallback"}, {tkn_k_class_argument, sym_k_XmNtabSide_arg, 10, ARGUMENT_NAME, "XmNtabSide"}, {tkn_k_class_argument, sym_k_XmNtabStringDirection_arg, 21, ARGUMENT_NAME, "XmNtabStringDirection"}, {tkn_k_class_argument, sym_k_XmNtabStyle_arg, 11, ARGUMENT_NAME, "XmNtabStyle"}, {tkn_k_class_argument, sym_k_XmNtabValue_arg, 11, ARGUMENT_NAME, "XmNtabValue"}, {tkn_k_class_reason, sym_k_XmNtearOffMenuActivateCallback_reason, 30, REASON_NAME, "XmNtearOffMenuActivateCallback"}, {tkn_k_class_reason, sym_k_XmNtearOffMenuDeactivateCallback_reason, 32, REASON_NAME, "XmNtearOffMenuDeactivateCallback"}, {tkn_k_class_argument, sym_k_XmNtearOffModel_arg, 15, ARGUMENT_NAME, "XmNtearOffModel"}, {tkn_k_class_argument, sym_k_XmNtearOffTitle_arg, 15, ARGUMENT_NAME, "XmNtearOffTitle"}, {tkn_k_class_argument, sym_k_XmNtextAccelerators_arg, 19, ARGUMENT_NAME, "XmNtextAccelerators"}, {tkn_k_class_argument, sym_k_XmNtextColumns_arg, 14, ARGUMENT_NAME, "XmNtextColumns"}, {tkn_k_class_argument, sym_k_XmNtextField_arg, 12, ARGUMENT_NAME, "XmNtextField"}, {tkn_k_class_argument, sym_k_XmNtextFontList_arg, 15, ARGUMENT_NAME, "XmNtextFontList"}, {tkn_k_class_argument, sym_k_XmNtextRenderTable_arg, 18, ARGUMENT_NAME, "XmNtextRenderTable"}, {tkn_k_class_argument, sym_k_XmNtextRows_arg, 11, ARGUMENT_NAME, "XmNtextRows"}, {tkn_k_class_argument, sym_k_XmNtextString_arg, 13, ARGUMENT_NAME, "XmNtextString"}, {tkn_k_class_argument, sym_k_XmNtextTranslations_arg, 19, ARGUMENT_NAME, "XmNtextTranslations"}, {tkn_k_class_argument, sym_k_XmNtitle_arg, 8, ARGUMENT_NAME, "XmNtitle"}, {tkn_k_class_argument, sym_k_XmNtitleEncoding_arg, 16, ARGUMENT_NAME, "XmNtitleEncoding"}, {tkn_k_class_argument, sym_k_XmNtitleString_arg, 14, ARGUMENT_NAME, "XmNtitleString"}, {tkn_k_class_reason, sym_k_XmNtoBottomCallback_reason, 19, REASON_NAME, "XmNtoBottomCallback"}, {tkn_k_class_reason, sym_k_XmNtoTopCallback_reason, 16, REASON_NAME, "XmNtoTopCallback"}, {tkn_k_class_argument, sym_k_XmNtoggleMode_arg, 13, ARGUMENT_NAME, "XmNtoggleMode"}, {tkn_k_class_argument, sym_k_XmNtoolTipEnable_arg, 16, ARGUMENT_NAME, "XmNtoolTipEnable"}, {tkn_k_class_argument, sym_k_XmNtoolTipPostDelay_arg, 19, ARGUMENT_NAME, "XmNtoolTipPostDelay"}, {tkn_k_class_argument, sym_k_XmNtoolTipPostDuration_arg, 22, ARGUMENT_NAME, "XmNtoolTipPostDuration"}, {tkn_k_class_argument, sym_k_XmNtoolTipString_arg, 16, ARGUMENT_NAME, "XmNtoolTipString"}, {tkn_k_class_argument, sym_k_XmNtopAttachment_arg, 16, ARGUMENT_NAME, "XmNtopAttachment"}, {tkn_k_class_argument, sym_k_XmNtopCharacter_arg, 15, ARGUMENT_NAME, "XmNtopCharacter"}, {tkn_k_class_argument, sym_k_XmNtopItemPosition_arg, 18, ARGUMENT_NAME, "XmNtopItemPosition"}, {tkn_k_class_argument, sym_k_XmNtopOffset_arg, 12, ARGUMENT_NAME, "XmNtopOffset"}, {tkn_k_class_argument, sym_k_XmNtopPosition_arg, 14, ARGUMENT_NAME, "XmNtopPosition"}, {tkn_k_class_argument, sym_k_XmNtopShadowColor_arg, 17, ARGUMENT_NAME, "XmNtopShadowColor"}, {tkn_k_class_argument, sym_k_XmNtopShadowPixmap_arg, 18, ARGUMENT_NAME, "XmNtopShadowPixmap"}, {tkn_k_class_argument, sym_k_XmNtopWidget_arg, 12, ARGUMENT_NAME, "XmNtopWidget"}, {tkn_k_class_argument, sym_k_XmNtransient_arg, 12, ARGUMENT_NAME, "XmNtransient"}, {tkn_k_class_argument, sym_k_XmNtransientFor_arg, 15, ARGUMENT_NAME, "XmNtransientFor"}, {tkn_k_class_argument, sym_k_XmNtranslations_arg, 15, ARGUMENT_NAME, "XmNtranslations"}, {tkn_k_class_reason, sym_k_XmNtraversalCallback_reason, 20, REASON_NAME, "XmNtraversalCallback"}, {tkn_k_class_argument, sym_k_XmNtraversalOn_arg, 14, ARGUMENT_NAME, "XmNtraversalOn"}, {tkn_k_class_reason, sym_k_XmNtraverseObscuredCallback_reason, 27, REASON_NAME, "XmNtraverseObscuredCallback"}, {tkn_k_class_argument, sym_k_XmNtroughColor_arg, 14, ARGUMENT_NAME, "XmNtroughColor"}, {tkn_k_class_argument, sym_k_XmNunderlineType_arg, 16, ARGUMENT_NAME, "XmNunderlineType"}, {tkn_k_class_argument, sym_k_XmNuniformTabSize_arg, 17, ARGUMENT_NAME, "XmNuniformTabSize"}, {tkn_k_class_argument, sym_k_XmNunitType_arg, 11, ARGUMENT_NAME, "XmNunitType"}, {tkn_k_class_reason, sym_k_XmNunmapCallback_reason, 16, REASON_NAME, "XmNunmapCallback"}, {tkn_k_class_argument, sym_k_XmNunpostBehavior_arg, 17, ARGUMENT_NAME, "XmNunpostBehavior"}, {tkn_k_class_reason, sym_k_XmNunselectCallback_reason, 19, REASON_NAME, "XmNunselectCallback"}, {tkn_k_class_argument, sym_k_XmNunselectColor_arg, 16, ARGUMENT_NAME, "XmNunselectColor"}, {tkn_k_class_reason, sym_k_XmNupdateShellCallback_reason, 22, REASON_NAME, "XmNupdateShellCallback"}, {tkn_k_class_reason, sym_k_XmNupdateTextCallback_reason, 21, REASON_NAME, "XmNupdateTextCallback"}, {tkn_k_class_argument, sym_k_XmNuseAsyncGeometry_arg, 19, ARGUMENT_NAME, "XmNuseAsyncGeometry"}, {tkn_k_class_argument, sym_k_XmNuseImageCache_arg, 16, ARGUMENT_NAME, "XmNuseImageCache"}, {tkn_k_class_argument, sym_k_XmNuseScaling_arg, 13, ARGUMENT_NAME, "XmNuseScaling"}, {tkn_k_class_argument, sym_k_XmNuseTextField_arg, 15, ARGUMENT_NAME, "XmNuseTextField"}, {tkn_k_class_argument, sym_k_XmNuserData_arg, 11, ARGUMENT_NAME, "XmNuserData"}, {tkn_k_class_reason, sym_k_XmNvalidateCallback_reason, 19, REASON_NAME, "XmNvalidateCallback"}, {tkn_k_class_argument, sym_k_XmNvalue_arg, 8, ARGUMENT_NAME, "XmNvalue"}, {tkn_k_class_reason, sym_k_XmNvalueChangedCallback_reason, 23, REASON_NAME, "XmNvalueChangedCallback"}, {tkn_k_class_argument, sym_k_XmNvalueWcs_arg, 11, ARGUMENT_NAME, "XmNvalueWcs"}, {tkn_k_class_argument, sym_k_XmNvalues_arg, 9, ARGUMENT_NAME, "XmNvalues"}, {tkn_k_class_argument, sym_k_XmNverify_arg, 9, ARGUMENT_NAME, "XmNverify"}, {tkn_k_class_argument, sym_k_XmNverifyBell_arg, 13, ARGUMENT_NAME, "XmNverifyBell"}, {tkn_k_class_reason, sym_k_XmNverifyTextCallback_reason, 21, REASON_NAME, "XmNverifyTextCallback"}, {tkn_k_class_argument, sym_k_XmNverticalDelta_arg, 16, ARGUMENT_NAME, "XmNverticalDelta"}, {tkn_k_class_argument, sym_k_XmNverticalMargin_arg, 17, ARGUMENT_NAME, "XmNverticalMargin"}, {tkn_k_class_argument, sym_k_XmNverticalNodeSpace_arg, 20, ARGUMENT_NAME, "XmNverticalNodeSpace"}, {tkn_k_class_argument, sym_k_XmNverticalScrollBar_arg, 20, ARGUMENT_NAME, "XmNverticalScrollBar"}, {tkn_k_class_argument, sym_k_XmNverticalSpacing_arg, 18, ARGUMENT_NAME, "XmNverticalSpacing"}, {tkn_k_class_argument, sym_k_XmNviewType_arg, 11, ARGUMENT_NAME, "XmNviewType"}, {tkn_k_class_argument, sym_k_XmNvisibleItemCount_arg, 19, ARGUMENT_NAME, "XmNvisibleItemCount"}, {tkn_k_class_argument, sym_k_XmNvisibleWhenOff_arg, 17, ARGUMENT_NAME, "XmNvisibleWhenOff"}, {tkn_k_class_argument, sym_k_XmNvisual_arg, 9, ARGUMENT_NAME, "XmNvisual"}, {tkn_k_class_argument, sym_k_XmNvisualEmphasis_arg, 17, ARGUMENT_NAME, "XmNvisualEmphasis"}, {tkn_k_class_argument, sym_k_XmNvisualPolicy_arg, 15, ARGUMENT_NAME, "XmNvisualPolicy"}, {tkn_k_class_argument, sym_k_XmNwaitForWm_arg, 12, ARGUMENT_NAME, "XmNwaitForWm"}, {tkn_k_class_argument, sym_k_XmNwhichButton_arg, 14, ARGUMENT_NAME, "XmNwhichButton"}, {tkn_k_class_argument, sym_k_XmNwidth_arg, 8, ARGUMENT_NAME, "XmNwidth"}, {tkn_k_class_argument, sym_k_XmNwidthInc_arg, 11, ARGUMENT_NAME, "XmNwidthInc"}, {tkn_k_class_argument, sym_k_XmNwinGravity_arg, 13, ARGUMENT_NAME, "XmNwinGravity"}, {tkn_k_class_argument, sym_k_XmNwindowGroup_arg, 14, ARGUMENT_NAME, "XmNwindowGroup"}, {tkn_k_class_argument, sym_k_XmNwmTimeout_arg, 12, ARGUMENT_NAME, "XmNwmTimeout"}, {tkn_k_class_argument, sym_k_XmNwordWrap_arg, 11, ARGUMENT_NAME, "XmNwordWrap"}, {tkn_k_class_argument, sym_k_XmNworkWindow_arg, 13, ARGUMENT_NAME, "XmNworkWindow"}, {tkn_k_class_argument, sym_k_XmNwrap_arg, 7, ARGUMENT_NAME, "XmNwrap"}, {tkn_k_class_argument, sym_k_XmNx_arg, 4, ARGUMENT_NAME, "XmNx"}, {tkn_k_class_argument, sym_k_XmNxlfdString_arg, 13, ARGUMENT_NAME, "XmNxlfdString"}, {tkn_k_class_argument, sym_k_XmNy_arg, 4, ARGUMENT_NAME, "XmNy"}, {tkn_k_class_enumval, sym_k_XmONE_BASED_enumval, 11, ENUMVAL_NAME, "XmONE_BASED"}, {tkn_k_class_enumval, sym_k_XmONE_OF_MANY_enumval, 13, ENUMVAL_NAME, "XmONE_OF_MANY"}, {tkn_k_class_enumval, sym_k_XmONE_OF_MANY_DIAMOND_enumval, 21, ENUMVAL_NAME, "XmONE_OF_MANY_DIAMOND"}, {tkn_k_class_enumval, sym_k_XmONE_OF_MANY_ROUND_enumval, 19, ENUMVAL_NAME, "XmONE_OF_MANY_ROUND"}, {tkn_k_class_enumval, sym_k_XmOUTLINE_enumval, 9, ENUMVAL_NAME, "XmOUTLINE"}, {tkn_k_class_enumval, sym_k_XmOUTLINE_BUTTON_ABSENT_enumval, 23, ENUMVAL_NAME, "XmOUTLINE_BUTTON_ABSENT"}, {tkn_k_class_enumval, sym_k_XmOUTLINE_BUTTON_PRESENT_enumval, 24, ENUMVAL_NAME, "XmOUTLINE_BUTTON_PRESENT"}, {tkn_k_class_enumval, sym_k_XmOWN_ALWAYS_enumval, 12, ENUMVAL_NAME, "XmOWN_ALWAYS"}, {tkn_k_class_enumval, sym_k_XmOWN_MULTIPLE_enumval, 14, ENUMVAL_NAME, "XmOWN_MULTIPLE"}, {tkn_k_class_enumval, sym_k_XmOWN_NEVER_enumval, 11, ENUMVAL_NAME, "XmOWN_NEVER"}, {tkn_k_class_enumval, sym_k_XmOWN_POSSIBLE_MULTIPLE_enumval, 23, ENUMVAL_NAME, "XmOWN_POSSIBLE_MULTIPLE"}, {tkn_k_class_enumval, sym_k_XmOpen_enumval, 6, ENUMVAL_NAME, "XmOpen"}, {tkn_k_class_class, sym_k_XmOptionMenu_object, 12, CLASS_NAME, "XmOptionMenu"}, {tkn_k_class_class, sym_k_XmOutline_object, 9, CLASS_NAME, "XmOutline"}, {tkn_k_class_enumval, sym_k_XmPACK_COLUMN_enumval, 13, ENUMVAL_NAME, "XmPACK_COLUMN"}, {tkn_k_class_enumval, sym_k_XmPACK_NONE_enumval, 11, ENUMVAL_NAME, "XmPACK_NONE"}, {tkn_k_class_enumval, sym_k_XmPACK_TIGHT_enumval, 12, ENUMVAL_NAME, "XmPACK_TIGHT"}, {tkn_k_class_enumval, sym_k_XmPAGE_enumval, 6, ENUMVAL_NAME, "XmPAGE"}, {tkn_k_class_enumval, sym_k_XmPAGE_SCROLLER_enumval, 15, ENUMVAL_NAME, "XmPAGE_SCROLLER"}, {tkn_k_class_enumval, sym_k_XmPER_SHELL_enumval, 11, ENUMVAL_NAME, "XmPER_SHELL"}, {tkn_k_class_enumval, sym_k_XmPER_WIDGET_enumval, 12, ENUMVAL_NAME, "XmPER_WIDGET"}, {tkn_k_class_enumval, sym_k_XmPIXELS_enumval, 8, ENUMVAL_NAME, "XmPIXELS"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_enumval, 8, ENUMVAL_NAME, "XmPIXMAP"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_AND_STRING_enumval, 19, ENUMVAL_NAME, "XmPIXMAP_AND_STRING"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_BOTTOM_enumval, 15, ENUMVAL_NAME, "XmPIXMAP_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_LEFT_enumval, 13, ENUMVAL_NAME, "XmPIXMAP_LEFT"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_NONE_enumval, 13, ENUMVAL_NAME, "XmPIXMAP_NONE"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_ONLY_enumval, 13, ENUMVAL_NAME, "XmPIXMAP_ONLY"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_OVERLAP_ONLY_enumval, 21, ENUMVAL_NAME, "XmPIXMAP_OVERLAP_ONLY"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_RIGHT_enumval, 14, ENUMVAL_NAME, "XmPIXMAP_RIGHT"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_TOP_enumval, 12, ENUMVAL_NAME, "XmPIXMAP_TOP"}, {tkn_k_class_enumval, sym_k_XmPLACE_ABOVE_SELECTION_enumval, 23, ENUMVAL_NAME, "XmPLACE_ABOVE_SELECTION"}, {tkn_k_class_enumval, sym_k_XmPLACE_BELOW_SELECTION_enumval, 23, ENUMVAL_NAME, "XmPLACE_BELOW_SELECTION"}, {tkn_k_class_enumval, sym_k_XmPLACE_TOP_enumval, 11, ENUMVAL_NAME, "XmPLACE_TOP"}, {tkn_k_class_enumval, sym_k_XmPOINTER_enumval, 9, ENUMVAL_NAME, "XmPOINTER"}, {tkn_k_class_enumval, sym_k_XmPOINTS_enumval, 8, ENUMVAL_NAME, "XmPOINTS"}, {tkn_k_class_enumval, sym_k_XmPOSITION_INDEX_enumval, 16, ENUMVAL_NAME, "XmPOSITION_INDEX"}, {tkn_k_class_enumval, sym_k_XmPOSITION_VALUE_enumval, 16, ENUMVAL_NAME, "XmPOSITION_VALUE"}, {tkn_k_class_class, sym_k_XmPaned_object, 7, CLASS_NAME, "XmPaned"}, {tkn_k_class_class, sym_k_XmPanedWindow_object, 13, CLASS_NAME, "XmPanedWindow"}, {tkn_k_class_class, sym_k_XmPopupMenu_object, 11, CLASS_NAME, "XmPopupMenu"}, {tkn_k_class_class, sym_k_XmPromptDialog_object, 14, CLASS_NAME, "XmPromptDialog"}, {tkn_k_class_class, sym_k_XmPulldownMenu_object, 14, CLASS_NAME, "XmPulldownMenu"}, {tkn_k_class_class, sym_k_XmPushButton_object, 12, CLASS_NAME, "XmPushButton"}, {tkn_k_class_class, sym_k_XmPushButtonGadget_object, 18, CLASS_NAME, "XmPushButtonGadget"}, {tkn_k_class_enumval, sym_k_XmQUICK_NAVIGATE_enumval, 16, ENUMVAL_NAME, "XmQUICK_NAVIGATE"}, {tkn_k_class_class, sym_k_XmQuestionDialog_object, 16, CLASS_NAME, "XmQuestionDialog"}, {tkn_k_class_enumval, sym_k_XmRELATIVE_enumval, 10, ENUMVAL_NAME, "XmRELATIVE"}, {tkn_k_class_enumval, sym_k_XmRESIZE_ANY_enumval, 12, ENUMVAL_NAME, "XmRESIZE_ANY"}, {tkn_k_class_enumval, sym_k_XmRESIZE_GROW_enumval, 13, ENUMVAL_NAME, "XmRESIZE_GROW"}, {tkn_k_class_enumval, sym_k_XmRESIZE_IF_POSSIBLE_enumval, 20, ENUMVAL_NAME, "XmRESIZE_IF_POSSIBLE"}, {tkn_k_class_enumval, sym_k_XmRESIZE_NONE_enumval, 13, ENUMVAL_NAME, "XmRESIZE_NONE"}, {tkn_k_class_enumval, sym_k_XmRIGHT_TO_LEFT_enumval, 15, ENUMVAL_NAME, "XmRIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmRIGHT_TO_LEFT_BOTTOM_TO_TOP_enumval, 29, ENUMVAL_NAME, "XmRIGHT_TO_LEFT_BOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmRIGHT_TO_LEFT_TOP_TO_BOTTOM_enumval, 29, ENUMVAL_NAME, "XmRIGHT_TO_LEFT_TOP_TO_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmROUND_MARK_enumval, 12, ENUMVAL_NAME, "XmROUND_MARK"}, {tkn_k_class_class, sym_k_XmRadioBox_object, 10, CLASS_NAME, "XmRadioBox"}, {tkn_k_class_class, sym_k_XmRenderTable_object, 13, CLASS_NAME, "XmRenderTable"}, {tkn_k_class_class, sym_k_XmRendition_object, 11, CLASS_NAME, "XmRendition"}, {tkn_k_class_class, sym_k_XmRowColumn_object, 11, CLASS_NAME, "XmRowColumn"}, {tkn_k_class_enumval, sym_k_XmSCROLL_HOR_enumval, 12, ENUMVAL_NAME, "XmSCROLL_HOR"}, {tkn_k_class_enumval, sym_k_XmSCROLL_VERT_enumval, 13, ENUMVAL_NAME, "XmSCROLL_VERT"}, {tkn_k_class_enumval, sym_k_XmSELECTED_enumval, 10, ENUMVAL_NAME, "XmSELECTED"}, {tkn_k_class_enumval, sym_k_XmSELECT_ALL_enumval, 12, ENUMVAL_NAME, "XmSELECT_ALL"}, {tkn_k_class_enumval, sym_k_XmSELECT_LINE_enumval, 13, ENUMVAL_NAME, "XmSELECT_LINE"}, {tkn_k_class_enumval, sym_k_XmSELECT_PARAGRAPH_enumval, 18, ENUMVAL_NAME, "XmSELECT_PARAGRAPH"}, {tkn_k_class_enumval, sym_k_XmSELECT_POSITION_enumval, 17, ENUMVAL_NAME, "XmSELECT_POSITION"}, {tkn_k_class_enumval, sym_k_XmSELECT_WHITESPACE_enumval, 19, ENUMVAL_NAME, "XmSELECT_WHITESPACE"}, {tkn_k_class_enumval, sym_k_XmSELECT_WORD_enumval, 13, ENUMVAL_NAME, "XmSELECT_WORD"}, {tkn_k_class_enumval, sym_k_XmSET_enumval, 5, ENUMVAL_NAME, "XmSET"}, {tkn_k_class_enumval, sym_k_XmSHADOWED_BACKGROUND_enumval, 21, ENUMVAL_NAME, "XmSHADOWED_BACKGROUND"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_IN_enumval, 18, ENUMVAL_NAME, "XmSHADOW_ETCHED_IN"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_IN_DASH_enumval, 23, ENUMVAL_NAME, "XmSHADOW_ETCHED_IN_DASH"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_OUT_enumval, 19, ENUMVAL_NAME, "XmSHADOW_ETCHED_OUT"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_OUT_DASH_enumval, 24, ENUMVAL_NAME, "XmSHADOW_ETCHED_OUT_DASH"}, {tkn_k_class_enumval, sym_k_XmSHADOW_IN_enumval, 11, ENUMVAL_NAME, "XmSHADOW_IN"}, {tkn_k_class_enumval, sym_k_XmSHADOW_OUT_enumval, 12, ENUMVAL_NAME, "XmSHADOW_OUT"}, {tkn_k_class_enumval, sym_k_XmSINGLE_enumval, 8, ENUMVAL_NAME, "XmSINGLE"}, {tkn_k_class_enumval, sym_k_XmSINGLE_DASHED_LINE_enumval, 20, ENUMVAL_NAME, "XmSINGLE_DASHED_LINE"}, {tkn_k_class_enumval, sym_k_XmSINGLE_LINE_enumval, 13, ENUMVAL_NAME, "XmSINGLE_LINE"}, {tkn_k_class_enumval, sym_k_XmSINGLE_LINE_EDIT_enumval, 18, ENUMVAL_NAME, "XmSINGLE_LINE_EDIT"}, {tkn_k_class_enumval, sym_k_XmSINGLE_SELECT_enumval, 15, ENUMVAL_NAME, "XmSINGLE_SELECT"}, {tkn_k_class_enumval, sym_k_XmSLIDER_enumval, 8, ENUMVAL_NAME, "XmSLIDER"}, {tkn_k_class_enumval, sym_k_XmSMALL_ICON_enumval, 12, ENUMVAL_NAME, "XmSMALL_ICON"}, {tkn_k_class_enumval, sym_k_XmSNAP_TO_GRID_enumval, 14, ENUMVAL_NAME, "XmSNAP_TO_GRID"}, {tkn_k_class_enumval, sym_k_XmSOLID_enumval, 7, ENUMVAL_NAME, "XmSOLID"}, {tkn_k_class_enumval, sym_k_XmSPATIAL_enumval, 9, ENUMVAL_NAME, "XmSPATIAL"}, {tkn_k_class_enumval, sym_k_XmSPIRAL_enumval, 8, ENUMVAL_NAME, "XmSPIRAL"}, {tkn_k_class_enumval, sym_k_XmSTATIC_enumval, 8, ENUMVAL_NAME, "XmSTATIC"}, {tkn_k_class_enumval, sym_k_XmSTATUS_AREA_enumval, 13, ENUMVAL_NAME, "XmSTATUS_AREA"}, {tkn_k_class_enumval, sym_k_XmSTICKY_TAB_GROUP_enumval, 18, ENUMVAL_NAME, "XmSTICKY_TAB_GROUP"}, {tkn_k_class_enumval, sym_k_XmSTRING_enumval, 8, ENUMVAL_NAME, "XmSTRING"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_CHARSET_enumval, 26, ENUMVAL_NAME, "XmSTRING_COMPONENT_CHARSET"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_DIRECTION_enumval, 28, ENUMVAL_NAME, "XmSTRING_COMPONENT_DIRECTION"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LAYOUT_POP_enumval, 29, ENUMVAL_NAME, "XmSTRING_COMPONENT_LAYOUT_POP"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LAYOUT_PUSH_enumval, 30, ENUMVAL_NAME, "XmSTRING_COMPONENT_LAYOUT_PUSH"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LOCALE_enumval, 25, ENUMVAL_NAME, "XmSTRING_COMPONENT_LOCALE"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LOCALE_TEXT_enumval, 30, ENUMVAL_NAME, "XmSTRING_COMPONENT_LOCALE_TEXT"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_RENDITION_BEGIN_enumval, 34, ENUMVAL_NAME, "XmSTRING_COMPONENT_RENDITION_BEGIN"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_RENDITION_END_enumval, 32, ENUMVAL_NAME, "XmSTRING_COMPONENT_RENDITION_END"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_SEPARATOR_enumval, 28, ENUMVAL_NAME, "XmSTRING_COMPONENT_SEPARATOR"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_TAB_enumval, 22, ENUMVAL_NAME, "XmSTRING_COMPONENT_TAB"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_TEXT_enumval, 23, ENUMVAL_NAME, "XmSTRING_COMPONENT_TEXT"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_UNKNOWN_enumval, 26, ENUMVAL_NAME, "XmSTRING_COMPONENT_UNKNOWN"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_WIDECHAR_TEXT_enumval, 32, ENUMVAL_NAME, "XmSTRING_COMPONENT_WIDECHAR_TEXT"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_DEFAULT_enumval, 26, ENUMVAL_NAME, "XmSTRING_DIRECTION_DEFAULT"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_L_TO_R_enumval, 25, ENUMVAL_NAME, "XmSTRING_DIRECTION_L_TO_R"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_R_TO_L_enumval, 25, ENUMVAL_NAME, "XmSTRING_DIRECTION_R_TO_L"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_UNSET_enumval, 24, ENUMVAL_NAME, "XmSTRING_DIRECTION_UNSET"}, {tkn_k_class_class, sym_k_XmScale_object, 7, CLASS_NAME, "XmScale"}, {tkn_k_class_enumval, sym_k_XmScaleMode_enumval, 11, ENUMVAL_NAME, "XmScaleMode"}, {tkn_k_class_class, sym_k_XmScrollBar_object, 11, CLASS_NAME, "XmScrollBar"}, {tkn_k_class_class, sym_k_XmScrolledList_object, 14, CLASS_NAME, "XmScrolledList"}, {tkn_k_class_class, sym_k_XmScrolledText_object, 14, CLASS_NAME, "XmScrolledText"}, {tkn_k_class_class, sym_k_XmScrolledWindow_object, 16, CLASS_NAME, "XmScrolledWindow"}, {tkn_k_class_class, sym_k_XmSelectionBox_object, 14, CLASS_NAME, "XmSelectionBox"}, {tkn_k_class_class, sym_k_XmSelectionDialog_object, 17, CLASS_NAME, "XmSelectionDialog"}, {tkn_k_class_class, sym_k_XmSeparator_object, 11, CLASS_NAME, "XmSeparator"}, {tkn_k_class_class, sym_k_XmSeparatorGadget_object, 17, CLASS_NAME, "XmSeparatorGadget"}, {tkn_k_class_class, sym_k_XmSimpleSpinBox_object, 15, CLASS_NAME, "XmSimpleSpinBox"}, {tkn_k_class_class, sym_k_XmSpinBox_object, 9, CLASS_NAME, "XmSpinBox"}, {tkn_k_class_argument, sym_k_XmStringComponent_arg, 17, ARGUMENT_NAME, "XmStringComponent"}, {tkn_k_class_enumval, sym_k_XmTABS_BASIC_enumval, 12, ENUMVAL_NAME, "XmTABS_BASIC"}, {tkn_k_class_enumval, sym_k_XmTABS_BEVELED_enumval, 14, ENUMVAL_NAME, "XmTABS_BEVELED"}, {tkn_k_class_enumval, sym_k_XmTABS_BOTTOM_TO_TOP_enumval, 20, ENUMVAL_NAME, "XmTABS_BOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmTABS_LEFT_TO_RIGHT_enumval, 20, ENUMVAL_NAME, "XmTABS_LEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_BOTTOM_enumval, 16, ENUMVAL_NAME, "XmTABS_ON_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_LEFT_enumval, 14, ENUMVAL_NAME, "XmTABS_ON_LEFT"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_RIGHT_enumval, 15, ENUMVAL_NAME, "XmTABS_ON_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_TOP_enumval, 13, ENUMVAL_NAME, "XmTABS_ON_TOP"}, {tkn_k_class_enumval, sym_k_XmTABS_RIGHT_TO_LEFT_enumval, 20, ENUMVAL_NAME, "XmTABS_RIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmTABS_ROUNDED_enumval, 14, ENUMVAL_NAME, "XmTABS_ROUNDED"}, {tkn_k_class_enumval, sym_k_XmTABS_SQUARED_enumval, 14, ENUMVAL_NAME, "XmTABS_SQUARED"}, {tkn_k_class_enumval, sym_k_XmTABS_STACKED_enumval, 14, ENUMVAL_NAME, "XmTABS_STACKED"}, {tkn_k_class_enumval, sym_k_XmTABS_STACKED_STATIC_enumval, 21, ENUMVAL_NAME, "XmTABS_STACKED_STATIC"}, {tkn_k_class_enumval, sym_k_XmTABS_TOP_TO_BOTTOM_enumval, 20, ENUMVAL_NAME, "XmTABS_TOP_TO_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmTAB_EDGE_BOTTOM_RIGHT_enumval, 23, ENUMVAL_NAME, "XmTAB_EDGE_BOTTOM_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTAB_EDGE_TOP_LEFT_enumval, 19, ENUMVAL_NAME, "XmTAB_EDGE_TOP_LEFT"}, {tkn_k_class_enumval, sym_k_XmTAB_GROUP_enumval, 11, ENUMVAL_NAME, "XmTAB_GROUP"}, {tkn_k_class_enumval, sym_k_XmTAB_ORIENTATION_DYNAMIC_enumval, 25, ENUMVAL_NAME, "XmTAB_ORIENTATION_DYNAMIC"}, {tkn_k_class_enumval, sym_k_XmTEAR_OFF_DISABLED_enumval, 19, ENUMVAL_NAME, "XmTEAR_OFF_DISABLED"}, {tkn_k_class_enumval, sym_k_XmTEAR_OFF_ENABLED_enumval, 18, ENUMVAL_NAME, "XmTEAR_OFF_ENABLED"}, {tkn_k_class_enumval, sym_k_XmTHERMOMETER_enumval, 13, ENUMVAL_NAME, "XmTHERMOMETER"}, {tkn_k_class_enumval, sym_k_XmTHUMB_MARK_enumval, 12, ENUMVAL_NAME, "XmTHUMB_MARK"}, {tkn_k_class_enumval, sym_k_XmTOGGLE_BOOLEAN_enumval, 16, ENUMVAL_NAME, "XmTOGGLE_BOOLEAN"}, {tkn_k_class_enumval, sym_k_XmTOGGLE_INDETERMINATE_enumval, 22, ENUMVAL_NAME, "XmTOGGLE_INDETERMINATE"}, {tkn_k_class_enumval, sym_k_XmTOP_LEFT_enumval, 10, ENUMVAL_NAME, "XmTOP_LEFT"}, {tkn_k_class_enumval, sym_k_XmTOP_RIGHT_enumval, 11, ENUMVAL_NAME, "XmTOP_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTOP_TO_BOTTOM_enumval, 15, ENUMVAL_NAME, "XmTOP_TO_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmTOP_TO_BOTTOM_LEFT_TO_RIGHT_enumval, 29, ENUMVAL_NAME, "XmTOP_TO_BOTTOM_LEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTOP_TO_BOTTOM_RIGHT_TO_LEFT_enumval, 29, ENUMVAL_NAME, "XmTOP_TO_BOTTOM_RIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmTOUCH_ONLY_enumval, 12, ENUMVAL_NAME, "XmTOUCH_ONLY"}, {tkn_k_class_enumval, sym_k_XmTOUCH_OVER_enumval, 12, ENUMVAL_NAME, "XmTOUCH_OVER"}, {tkn_k_class_enumval, sym_k_XmTROUGH_COLOR_enumval, 14, ENUMVAL_NAME, "XmTROUGH_COLOR"}, {tkn_k_class_class, sym_k_XmTab_object, 5, CLASS_NAME, "XmTab"}, {tkn_k_class_class, sym_k_XmTabBox_object, 8, CLASS_NAME, "XmTabBox"}, {tkn_k_class_class, sym_k_XmTabList_object, 9, CLASS_NAME, "XmTabList"}, {tkn_k_class_class, sym_k_XmTabStack_object, 10, CLASS_NAME, "XmTabStack"}, {tkn_k_class_class, sym_k_XmTearOffButton_object, 15, CLASS_NAME, "XmTearOffButton"}, {tkn_k_class_class, sym_k_XmTemplateDialog_object, 16, CLASS_NAME, "XmTemplateDialog"}, {tkn_k_class_class, sym_k_XmText_object, 6, CLASS_NAME, "XmText"}, {tkn_k_class_class, sym_k_XmTextField_object, 11, CLASS_NAME, "XmTextField"}, {tkn_k_class_class, sym_k_XmToggleButton_object, 14, CLASS_NAME, "XmToggleButton"}, {tkn_k_class_class, sym_k_XmToggleButtonGadget_object, 20, CLASS_NAME, "XmToggleButtonGadget"}, {tkn_k_class_class, sym_k_XmTree_object, 6, CLASS_NAME, "XmTree"}, {tkn_k_class_enumval, sym_k_XmTreeCompressLeaves_enumval, 20, ENUMVAL_NAME, "XmTreeCompressLeaves"}, {tkn_k_class_enumval, sym_k_XmTreeCompressNone_enumval, 18, ENUMVAL_NAME, "XmTreeCompressNone"}, {tkn_k_class_enumval, sym_k_XmTreeDirect_enumval, 12, ENUMVAL_NAME, "XmTreeDirect"}, {tkn_k_class_enumval, sym_k_XmTreeLadder_enumval, 12, ENUMVAL_NAME, "XmTreeLadder"}, {tkn_k_class_enumval, sym_k_XmUNMAP_enumval, 7, ENUMVAL_NAME, "XmUNMAP"}, {tkn_k_class_enumval, sym_k_XmUNPOST_enumval, 8, ENUMVAL_NAME, "XmUNPOST"}, {tkn_k_class_enumval, sym_k_XmUNPOST_AND_REPLAY_enumval, 19, ENUMVAL_NAME, "XmUNPOST_AND_REPLAY"}, {tkn_k_class_enumval, sym_k_XmUNSET_enumval, 7, ENUMVAL_NAME, "XmUNSET"}, {tkn_k_class_enumval, sym_k_XmVARIABLE_enumval, 10, ENUMVAL_NAME, "XmVARIABLE"}, {tkn_k_class_enumval, sym_k_XmVERTICAL_enumval, 10, ENUMVAL_NAME, "XmVERTICAL"}, {tkn_k_class_enumval, sym_k_XmVERT_SCROLLBAR_enumval, 16, ENUMVAL_NAME, "XmVERT_SCROLLBAR"}, {tkn_k_class_enumval, sym_k_XmWORK_AREA_enumval, 11, ENUMVAL_NAME, "XmWORK_AREA"}, {tkn_k_class_class, sym_k_XmWarningDialog_object, 15, CLASS_NAME, "XmWarningDialog"}, {tkn_k_class_class, sym_k_XmWorkArea_object, 10, CLASS_NAME, "XmWorkArea"}, {tkn_k_class_class, sym_k_XmWorkingDialog_object, 15, CLASS_NAME, "XmWorkingDialog"}, {tkn_k_class_enumval, sym_k_XmZERO_BASED_enumval, 12, ENUMVAL_NAME, "XmZERO_BASED"}, {tkn_k_class_child, sym_k_Xm_Apply_child, 8, CHILD_NAME, "Xm_Apply"}, {tkn_k_class_child, sym_k_Xm_Arrow_child, 8, CHILD_NAME, "Xm_Arrow"}, {tkn_k_class_child, sym_k_Xm_Cancel_child, 9, CHILD_NAME, "Xm_Cancel"}, {tkn_k_class_child, sym_k_Xm_ColorListToggle_child, 18, CHILD_NAME, "Xm_ColorListToggle"}, {tkn_k_class_child, sym_k_Xm_ColorSlidersToggle_child, 21, CHILD_NAME, "Xm_ColorSlidersToggle"}, {tkn_k_class_child, sym_k_Xm_Dir_child, 6, CHILD_NAME, "Xm_Dir"}, {tkn_k_class_child, sym_k_Xm_DirList_child, 10, CHILD_NAME, "Xm_DirList"}, {tkn_k_class_child, sym_k_Xm_Filter_child, 9, CHILD_NAME, "Xm_Filter"}, {tkn_k_class_child, sym_k_Xm_FilterLabel_child, 14, CHILD_NAME, "Xm_FilterLabel"}, {tkn_k_class_child, sym_k_Xm_FilterText_child, 13, CHILD_NAME, "Xm_FilterText"}, {tkn_k_class_child, sym_k_Xm_Find_child, 7, CHILD_NAME, "Xm_Find"}, {tkn_k_class_child, sym_k_Xm_FindText_child, 11, CHILD_NAME, "Xm_FindText"}, {tkn_k_class_child, sym_k_Xm_Help_child, 7, CHILD_NAME, "Xm_Help"}, {tkn_k_class_child, sym_k_Xm_HorScrollBar_child, 15, CHILD_NAME, "Xm_HorScrollBar"}, {tkn_k_class_child, sym_k_Xm_Items_child, 8, CHILD_NAME, "Xm_Items"}, {tkn_k_class_child, sym_k_Xm_ItemsList_child, 12, CHILD_NAME, "Xm_ItemsList"}, {tkn_k_class_child, sym_k_Xm_Label_child, 8, CHILD_NAME, "Xm_Label"}, {tkn_k_class_child, sym_k_Xm_List_child, 7, CHILD_NAME, "Xm_List"}, {tkn_k_class_child, sym_k_Xm_Message_child, 10, CHILD_NAME, "Xm_Message"}, {tkn_k_class_child, sym_k_Xm_OK_child, 5, CHILD_NAME, "Xm_OK"}, {tkn_k_class_child, sym_k_Xm_OptionButton_child, 15, CHILD_NAME, "Xm_OptionButton"}, {tkn_k_class_child, sym_k_Xm_OptionLabel_child, 14, CHILD_NAME, "Xm_OptionLabel"}, {tkn_k_class_child, sym_k_Xm_Selection_child, 12, CHILD_NAME, "Xm_Selection"}, {tkn_k_class_child, sym_k_Xm_Separator_child, 12, CHILD_NAME, "Xm_Separator"}, {tkn_k_class_child, sym_k_Xm_Separator1_child, 13, CHILD_NAME, "Xm_Separator1"}, {tkn_k_class_child, sym_k_Xm_Separator2_child, 13, CHILD_NAME, "Xm_Separator2"}, {tkn_k_class_child, sym_k_Xm_Separator3_child, 13, CHILD_NAME, "Xm_Separator3"}, {tkn_k_class_child, sym_k_Xm_Symbol_child, 9, CHILD_NAME, "Xm_Symbol"}, {tkn_k_class_child, sym_k_Xm_TearOffControl_child, 17, CHILD_NAME, "Xm_TearOffControl"}, {tkn_k_class_child, sym_k_Xm_Text_child, 7, CHILD_NAME, "Xm_Text"}, {tkn_k_class_child, sym_k_Xm_TextField_child, 12, CHILD_NAME, "Xm_TextField"}, {tkn_k_class_child, sym_k_Xm_Title_child, 8, CHILD_NAME, "Xm_Title"}, {tkn_k_class_child, sym_k_Xm_VertScrollBar_child, 16, CHILD_NAME, "Xm_VertScrollBar"}, {tkn_k_class_charset, sym_k__MOTIF_DEFAULT_LOCALE_charset, 21, CHARSET_NAME, "_MOTIF_DEFAULT_LOCALE"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 13, CHARSET_NAME, "ansi_cyrillic"}, {tkn_k_class_keyword, 0, 3, ANY, "any"}, {tkn_k_class_keyword, 0, 8, ARGUMENT, "argument"}, {tkn_k_class_reserved, 0, 9, ARGUMENTS, "arguments"}, {tkn_k_class_keyword, 0, 18, ASCIZ_STRING_TABLE, "asciz_string_table"}, {tkn_k_class_keyword, 0, 11, ASCIZ_TABLE, "asciz_table"}, {tkn_k_class_keyword, 0, 10, BACKGROUND, "background"}, {tkn_k_class_charset, sym_k_big5_charset, 4, CHARSET_NAME, "big5"}, {tkn_k_class_keyword, 0, 7, BOOLEAN, "boolean"}, {tkn_k_class_reserved, 0, 9, CALLBACKS, "callbacks"}, {tkn_k_class_keyword, 0, 16, CASE_INSENSITIVE, "case_insensitive"}, {tkn_k_class_keyword, 0, 14, CASE_SENSITIVE, "case_sensitive"}, {tkn_k_class_keyword, 0, 10, CENTIMETER, "centimeter"}, {tkn_k_class_keyword, 0, 11, CENTIMETERS, "centimeters"}, {tkn_k_class_keyword, 0, 13, CHARACTER_SET, "character_set"}, {tkn_k_class_keyword, 0, 14, CLASS_REC_NAME, "class_rec_name"}, {tkn_k_class_keyword, 0, 2, CM, "cm"}, {tkn_k_class_keyword, 0, 5, COLOR, "color"}, {tkn_k_class_keyword, 0, 11, COLOR_TABLE, "color_table"}, {tkn_k_class_keyword, 0, 15, COMPOUND_STRING, "compound_string"}, {tkn_k_class_keyword, 0, 25, COMPOUND_STRING_COMPONENT, "compound_string_component"}, {tkn_k_class_keyword, 0, 21, COMPOUND_STRING_TABLE, "compound_string_table"}, {tkn_k_class_reserved, 0, 8, CONTROLS, "controls"}, {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 12, CHARSET_NAME, "dos_cyrillic"}, {tkn_k_class_reserved, 0, 3, END, "end"}, {tkn_k_class_charset, sym_k_euc_charset, 3, CHARSET_NAME, "euc"}, {tkn_k_class_reserved, 0, 8, EXPORTED, "exported"}, {tkn_k_class_reserved, 0, 5, UILFALSE, "false"}, {tkn_k_class_keyword, 0, 4, UILFILE, "file"}, {tkn_k_class_keyword, 0, 5, FLOAT, "float"}, {tkn_k_class_keyword, 0, 4, FONT, "font"}, {tkn_k_class_keyword, 0, 10, FONT_TABLE, "font_table"}, {tkn_k_class_keyword, 0, 9, FONT_UNIT, "font_unit"}, {tkn_k_class_keyword, 0, 10, FONT_UNITS, "font_units"}, {tkn_k_class_keyword, 0, 7, FONTSET, "fontset"}, {tkn_k_class_keyword, 0, 10, FOREGROUND, "foreground"}, {tkn_k_class_keyword, 0, 2, FU, "fu"}, {tkn_k_class_reserved, 0, 6, GADGET, "gadget"}, {tkn_k_class_charset, sym_k_gb_hanzi_charset, 10, CHARSET_NAME, "gb_chinese"}, {tkn_k_class_charset, sym_k_gb_hanzi_charset, 8, CHARSET_NAME, "gb_hanzi"}, {tkn_k_class_charset, sym_k_gb_hanzi_charset, 11, CHARSET_NAME, "gb_hanzi_gl"}, {tkn_k_class_charset, sym_k_gb_hanzi_gr_charset, 11, CHARSET_NAME, "gb_hanzi_gr"}, {tkn_k_class_keyword, 0, 4, ICON, "icon"}, {tkn_k_class_reserved, 0, 10, IDENTIFIER, "identifier"}, {tkn_k_class_keyword, 0, 8, IMPORTED, "imported"}, {tkn_k_class_keyword, 0, 2, IN, "in"}, {tkn_k_class_keyword, 0, 4, INCH, "inch"}, {tkn_k_class_keyword, 0, 6, INCHES, "inches"}, {tkn_k_class_reserved, 0, 7, INCLUDE, "include"}, {tkn_k_class_keyword, 0, 7, INTEGER, "integer"}, {tkn_k_class_keyword, 0, 13, INTEGER_TABLE, "integer_table"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 10, CHARSET_NAME, "iso_arabic"}, {tkn_k_class_charset, sym_k_iso_arabic_lr_charset, 13, CHARSET_NAME, "iso_arabic_lr"}, {tkn_k_class_charset, sym_k_iso_cyrillic_charset, 12, CHARSET_NAME, "iso_cyrillic"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 9, CHARSET_NAME, "iso_greek"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 10, CHARSET_NAME, "iso_hebrew"}, {tkn_k_class_charset, sym_k_iso_hebrew_lr_charset, 13, CHARSET_NAME, "iso_hebrew_lr"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 10, CHARSET_NAME, "iso_ir_111"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 10, CHARSET_NAME, "iso_latin1"}, {tkn_k_class_charset, sym_k_iso_latin2_charset, 10, CHARSET_NAME, "iso_latin2"}, {tkn_k_class_charset, sym_k_iso_latin3_charset, 10, CHARSET_NAME, "iso_latin3"}, {tkn_k_class_charset, sym_k_iso_latin4_charset, 10, CHARSET_NAME, "iso_latin4"}, {tkn_k_class_charset, sym_k_iso_latin5_charset, 10, CHARSET_NAME, "iso_latin5"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 10, CHARSET_NAME, "iso_latin6"}, {tkn_k_class_charset, sym_k_iso_arabic_lr_charset, 13, CHARSET_NAME, "iso_latin6_lr"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 10, CHARSET_NAME, "iso_latin7"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 10, CHARSET_NAME, "iso_latin8"}, {tkn_k_class_charset, sym_k_iso_hebrew_lr_charset, 13, CHARSET_NAME, "iso_latin8_lr"}, {tkn_k_class_charset, sym_k_jis_kanji_charset, 12, CHARSET_NAME, "jis_japanese"}, {tkn_k_class_charset, sym_k_jis_kanji_charset, 9, CHARSET_NAME, "jis_kanji"}, {tkn_k_class_charset, sym_k_jis_kanji_charset, 12, CHARSET_NAME, "jis_kanji_gl"}, {tkn_k_class_charset, sym_k_jis_kanji_gr_charset, 12, CHARSET_NAME, "jis_kanji_gr"}, {tkn_k_class_charset, sym_k_jis_katakana_charset, 12, CHARSET_NAME, "jis_katakana"}, {tkn_k_class_keyword, 0, 6, KEYSYM, "keysym"}, {tkn_k_class_charset, sym_k_ksc_hangul_charset, 10, CHARSET_NAME, "ksc_hangul"}, {tkn_k_class_charset, sym_k_ksc_hangul_charset, 13, CHARSET_NAME, "ksc_hangul_gl"}, {tkn_k_class_charset, sym_k_ksc_hangul_gr_charset, 13, CHARSET_NAME, "ksc_hangul_gr"}, {tkn_k_class_charset, sym_k_ksc_hangul_charset, 10, CHARSET_NAME, "ksc_korean"}, {tkn_k_class_reserved, 0, 4, LIST, "list"}, {tkn_k_class_reserved, 0, 5, MACRO, "macro"}, {tkn_k_class_keyword, 0, 7, MANAGED, "managed"}, {tkn_k_class_keyword, 0, 10, MILLIMETER, "millimeter"}, {tkn_k_class_keyword, 0, 11, MILLIMETERS, "millimeters"}, {tkn_k_class_keyword, 0, 2, MM, "mm"}, {tkn_k_class_reserved, 0, 6, MODULE, "module"}, {tkn_k_class_keyword, 0, 5, NAMES, "names"}, {tkn_k_class_reserved, 0, 6, OBJECT, "object"}, {tkn_k_class_keyword, 0, 7, OBJECTS, "objects"}, {tkn_k_class_reserved, 0, 3, OFF, "off"}, {tkn_k_class_reserved, 0, 2, ON, "on"}, {tkn_k_class_keyword, 0, 3, PIX, "pix"}, {tkn_k_class_keyword, 0, 5, PIXEL, "pixel"}, {tkn_k_class_keyword, 0, 6, PIXELS, "pixels"}, {tkn_k_class_keyword, 0, 6, PIXMAP, "pixmap"}, {tkn_k_class_keyword, 0, 5, POINT, "point"}, {tkn_k_class_keyword, 0, 6, POINTS, "points"}, {tkn_k_class_reserved, 0, 7, PRIVATE, "private"}, {tkn_k_class_reserved, 0, 9, PROCEDURE, "procedure"}, {tkn_k_class_reserved, 0, 10, PROCEDURES, "procedures"}, {tkn_k_class_keyword, 0, 2, PT, "pt"}, {tkn_k_class_keyword, 0, 6, REASON, "reason"}, {tkn_k_class_keyword, 0, 3, RGB, "rgb"}, {tkn_k_class_keyword, 0, 13, RIGHT_TO_LEFT, "right_to_left"}, {tkn_k_class_keyword, 0, 8, SEPARATE, "separate"}, {tkn_k_class_keyword, 0, 12, SINGLE_FLOAT, "single_float"}, {tkn_k_class_keyword, 0, 11, SIXTEEN_BIT, "sixteen_bit"}, {tkn_k_class_keyword, 0, 6, STRING, "string"}, {tkn_k_class_keyword, 0, 12, STRING_TABLE, "string_table"}, {tkn_k_class_keyword, 0, 17, TRANSLATION_TABLE, "translation_table"}, {tkn_k_class_reserved, 0, 4, UILTRUE, "true"}, {tkn_k_class_keyword, 0, 9, UNMANAGED, "unmanaged"}, {tkn_k_class_class, sym_k_user_defined_object, 12, CLASS_NAME, "user_defined"}, {tkn_k_class_charset, sym_k_utf8_charset, 4, CHARSET_NAME, "utf8"}, {tkn_k_class_reserved, 0, 5, VALUE, "value"}, {tkn_k_class_keyword, 0, 7, VERSION, "version"}, {tkn_k_class_keyword, 0, 14, WIDE_CHARACTER, "wide_character"}, {tkn_k_class_reserved, 0, 6, WIDGET, "widget"}, {tkn_k_class_keyword, 0, 11, XBITMAPFILE, "xbitmapfile"}, }; externaldef(uil_sym_glbl) key_keytable_entry_type *key_table = key_table_vec; /* Maximum length of a keyword, and table size */ externaldef(uil_sym_glbl) int key_k_keyword_max_length = 35; externaldef(uil_sym_glbl) int key_k_keyword_count = 1466; /* case insensitive keyword table */ static key_keytable_entry_type key_table_case_ins_vec[] = { {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 3, CHARSET_NAME, "866"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 5, CHARSET_NAME, "88591"}, {tkn_k_class_charset, sym_k_iso_latin2_charset, 5, CHARSET_NAME, "88592"}, {tkn_k_class_charset, sym_k_iso_latin3_charset, 5, CHARSET_NAME, "88593"}, {tkn_k_class_charset, sym_k_iso_latin4_charset, 5, CHARSET_NAME, "88594"}, {tkn_k_class_charset, sym_k_iso_latin5_charset, 5, CHARSET_NAME, "88595"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 5, CHARSET_NAME, "88596"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 5, CHARSET_NAME, "88597"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 5, CHARSET_NAME, "88598"}, {tkn_k_class_enumval, sym_k_Always_enumval, 6, ENUMVAL_NAME, "ALWAYS"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 9, CHARSET_NAME, "ANSI-1251"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 8, CHARSET_NAME, "ANSI1251"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 13, CHARSET_NAME, "ANSI_CYRILLIC"}, {tkn_k_class_keyword, 0, 3, ANY, "ANY"}, {tkn_k_class_keyword, 0, 8, ARGUMENT, "ARGUMENT"}, {tkn_k_class_reserved, 0, 9, ARGUMENTS, "ARGUMENTS"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 5, CHARSET_NAME, "ASCII"}, {tkn_k_class_keyword, 0, 18, ASCIZ_STRING_TABLE, "ASCIZ_STRING_TABLE"}, {tkn_k_class_keyword, 0, 11, ASCIZ_TABLE, "ASCIZ_TABLE"}, {tkn_k_class_keyword, 0, 10, BACKGROUND, "BACKGROUND"}, {tkn_k_class_charset, sym_k_big5_charset, 4, CHARSET_NAME, "BIG5"}, {tkn_k_class_keyword, 0, 7, BOOLEAN, "BOOLEAN"}, {tkn_k_class_reserved, 0, 9, CALLBACKS, "CALLBACKS"}, {tkn_k_class_keyword, 0, 16, CASE_INSENSITIVE, "CASE_INSENSITIVE"}, {tkn_k_class_keyword, 0, 14, CASE_SENSITIVE, "CASE_SENSITIVE"}, {tkn_k_class_keyword, 0, 10, CENTIMETER, "CENTIMETER"}, {tkn_k_class_keyword, 0, 11, CENTIMETERS, "CENTIMETERS"}, {tkn_k_class_keyword, 0, 13, CHARACTER_SET, "CHARACTER_SET"}, {tkn_k_class_keyword, 0, 14, CLASS_REC_NAME, "CLASS_REC_NAME"}, {tkn_k_class_keyword, 0, 2, CM, "CM"}, {tkn_k_class_keyword, 0, 5, COLOR, "COLOR"}, {tkn_k_class_keyword, 0, 11, COLOR_TABLE, "COLOR_TABLE"}, {tkn_k_class_keyword, 0, 15, COMPOUND_STRING, "COMPOUND_STRING"}, {tkn_k_class_keyword, 0, 25, COMPOUND_STRING_COMPONENT, "COMPOUND_STRING_COMPONENT"}, {tkn_k_class_keyword, 0, 21, COMPOUND_STRING_TABLE, "COMPOUND_STRING_TABLE"}, {tkn_k_class_reserved, 0, 8, CONTROLS, "CONTROLS"}, {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 5, CHARSET_NAME, "CP866"}, {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 12, CHARSET_NAME, "DOS_CYRILLIC"}, {tkn_k_class_class, sym_k_DtEditor_object, 8, CLASS_NAME, "DTEDITOR"}, {tkn_k_class_class, sym_k_DtHelpDialog_object, 12, CLASS_NAME, "DTHELPDIALOG"}, {tkn_k_class_class, sym_k_DtHelpQuickDialog_object, 17, CLASS_NAME, "DTHELPQUICKDIALOG"}, {tkn_k_class_enumval, sym_k_DtHELP_AS_NEEDED_SCROLLBARS_enumval, 27, ENUMVAL_NAME, "DTHELP_AS_NEEDED_SCROLLBARS"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_ALL_enumval, 18, ENUMVAL_NAME, "DTHELP_EXECUTE_ALL"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_NONE_enumval, 19, ENUMVAL_NAME, "DTHELP_EXECUTE_NONE"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_QUERY_ALL_enumval, 24, ENUMVAL_NAME, "DTHELP_EXECUTE_QUERY_ALL"}, {tkn_k_class_enumval, sym_k_DtHELP_EXECUTE_QUERY_UNALIASED_enumval, 30, ENUMVAL_NAME, "DTHELP_EXECUTE_QUERY_UNALIASED"}, {tkn_k_class_enumval, sym_k_DtHELP_NO_SCROLLBARS_enumval, 20, ENUMVAL_NAME, "DTHELP_NO_SCROLLBARS"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_A4_enumval, 19, ENUMVAL_NAME, "DTHELP_PAPERSIZE_A4"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_B5_enumval, 19, ENUMVAL_NAME, "DTHELP_PAPERSIZE_B5"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_EXECUTIVE_enumval, 26, ENUMVAL_NAME, "DTHELP_PAPERSIZE_EXECUTIVE"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_LEGAL_enumval, 22, ENUMVAL_NAME, "DTHELP_PAPERSIZE_LEGAL"}, {tkn_k_class_enumval, sym_k_DtHELP_PAPERSIZE_LETTER_enumval, 23, ENUMVAL_NAME, "DTHELP_PAPERSIZE_LETTER"}, {tkn_k_class_enumval, sym_k_DtHELP_STATIC_SCROLLBARS_enumval, 24, ENUMVAL_NAME, "DTHELP_STATIC_SCROLLBARS"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_DYNAMIC_STRING_enumval, 26, ENUMVAL_NAME, "DTHELP_TYPE_DYNAMIC_STRING"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_FILE_enumval, 16, ENUMVAL_NAME, "DTHELP_TYPE_FILE"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_MAN_PAGE_enumval, 20, ENUMVAL_NAME, "DTHELP_TYPE_MAN_PAGE"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_STRING_enumval, 18, ENUMVAL_NAME, "DTHELP_TYPE_STRING"}, {tkn_k_class_enumval, sym_k_DtHELP_TYPE_TOPIC_enumval, 17, ENUMVAL_NAME, "DTHELP_TYPE_TOPIC"}, {tkn_k_class_enumval, sym_k_DtLONG_NAME_enumval, 11, ENUMVAL_NAME, "DTLONG_NAME"}, {tkn_k_class_enumval, sym_k_DtMEDIUM_NAME_enumval, 13, ENUMVAL_NAME, "DTMEDIUM_NAME"}, {tkn_k_class_class, sym_k_DtMenuButton_object, 12, CLASS_NAME, "DTMENUBUTTON"}, {tkn_k_class_argument, sym_k_DtNallowSendEvents_arg, 18, ARGUMENT_NAME, "DTNALLOWSENDEVENTS"}, {tkn_k_class_argument, sym_k_DtNappCursorDefault_arg, 19, ARGUMENT_NAME, "DTNAPPCURSORDEFAULT"}, {tkn_k_class_argument, sym_k_DtNappKeypadDefault_arg, 19, ARGUMENT_NAME, "DTNAPPKEYPADDEFAULT"}, {tkn_k_class_argument, sym_k_DtNautoShowCursorPosition_arg, 25, ARGUMENT_NAME, "DTNAUTOSHOWCURSORPOSITION"}, {tkn_k_class_argument, sym_k_DtNautoWrap_arg, 11, ARGUMENT_NAME, "DTNAUTOWRAP"}, {tkn_k_class_argument, sym_k_DtNbackgroundIsSelect_arg, 21, ARGUMENT_NAME, "DTNBACKGROUNDISSELECT"}, {tkn_k_class_argument, sym_k_DtNbackLabelString_arg, 18, ARGUMENT_NAME, "DTNBACKLABELSTRING"}, {tkn_k_class_argument, sym_k_DtNbaseHeight_arg, 13, ARGUMENT_NAME, "DTNBASEHEIGHT"}, {tkn_k_class_argument, sym_k_DtNbaseWidth_arg, 12, ARGUMENT_NAME, "DTNBASEWIDTH"}, {tkn_k_class_argument, sym_k_DtNblinkRate_arg, 12, ARGUMENT_NAME, "DTNBLINKRATE"}, {tkn_k_class_argument, sym_k_DtNbuttonFontList_arg, 17, ARGUMENT_NAME, "DTNBUTTONFONTLIST"}, {tkn_k_class_argument, sym_k_DtNc132_arg, 7, ARGUMENT_NAME, "DTNC132"}, {tkn_k_class_reason, sym_k_DtNcancelCallback_reason, 17, REASON_NAME, "DTNCANCELCALLBACK"}, {tkn_k_class_argument, sym_k_DtNcascadePixmap_arg, 16, ARGUMENT_NAME, "DTNCASCADEPIXMAP"}, {tkn_k_class_reason, sym_k_DtNcascadingCallback_reason, 20, REASON_NAME, "DTNCASCADINGCALLBACK"}, {tkn_k_class_argument, sym_k_DtNcenterToggleLabel_arg, 20, ARGUMENT_NAME, "DTNCENTERTOGGLELABEL"}, {tkn_k_class_argument, sym_k_DtNchangeAllButtonLabel_arg, 23, ARGUMENT_NAME, "DTNCHANGEALLBUTTONLABEL"}, {tkn_k_class_argument, sym_k_DtNchangeButtonLabel_arg, 20, ARGUMENT_NAME, "DTNCHANGEBUTTONLABEL"}, {tkn_k_class_argument, sym_k_DtNchangeFieldLabel_arg, 19, ARGUMENT_NAME, "DTNCHANGEFIELDLABEL"}, {tkn_k_class_argument, sym_k_DtNcharCursorStyle_arg, 18, ARGUMENT_NAME, "DTNCHARCURSORSTYLE"}, {tkn_k_class_reason, sym_k_DtNcloseCallback_reason, 16, REASON_NAME, "DTNCLOSECALLBACK"}, {tkn_k_class_argument, sym_k_DtNcloseLabelString_arg, 19, ARGUMENT_NAME, "DTNCLOSELABELSTRING"}, {tkn_k_class_reason, sym_k_DtNclosePrintDisplayCallback_reason, 28, REASON_NAME, "DTNCLOSEPRINTDISPLAYCALLBACK"}, {tkn_k_class_argument, sym_k_DtNcolumns_arg, 10, ARGUMENT_NAME, "DTNCOLUMNS"}, {tkn_k_class_argument, sym_k_DtNconsoleMode_arg, 14, ARGUMENT_NAME, "DTNCONSOLEMODE"}, {tkn_k_class_argument, sym_k_DtNcopies_arg, 9, ARGUMENT_NAME, "DTNCOPIES"}, {tkn_k_class_argument, sym_k_DtNcsWidth_arg, 10, ARGUMENT_NAME, "DTNCSWIDTH"}, {tkn_k_class_argument, sym_k_DtNcurrentLineLabel_arg, 19, ARGUMENT_NAME, "DTNCURRENTLINELABEL"}, {tkn_k_class_argument, sym_k_DtNcursorPosition_arg, 17, ARGUMENT_NAME, "DTNCURSORPOSITION"}, {tkn_k_class_argument, sym_k_DtNcursorPositionVisible_arg, 24, ARGUMENT_NAME, "DTNCURSORPOSITIONVISIBLE"}, {tkn_k_class_argument, sym_k_DtNdescription_arg, 14, ARGUMENT_NAME, "DTNDESCRIPTION"}, {tkn_k_class_argument, sym_k_DtNdialogTitle_arg, 14, ARGUMENT_NAME, "DTNDIALOGTITLE"}, {tkn_k_class_argument, sym_k_DtNeditable_arg, 11, ARGUMENT_NAME, "DTNEDITABLE"}, {tkn_k_class_argument, sym_k_DtNemulationId_arg, 14, ARGUMENT_NAME, "DTNEMULATIONID"}, {tkn_k_class_argument, sym_k_DtNexecutionPolicy_arg, 18, ARGUMENT_NAME, "DTNEXECUTIONPOLICY"}, {tkn_k_class_argument, sym_k_DtNfileName_arg, 11, ARGUMENT_NAME, "DTNFILENAME"}, {tkn_k_class_argument, sym_k_DtNfindButtonLabel_arg, 18, ARGUMENT_NAME, "DTNFINDBUTTONLABEL"}, {tkn_k_class_argument, sym_k_DtNfindChangeDialogTitle_arg, 24, ARGUMENT_NAME, "DTNFINDCHANGEDIALOGTITLE"}, {tkn_k_class_argument, sym_k_DtNfindFieldLabel_arg, 17, ARGUMENT_NAME, "DTNFINDFIELDLABEL"}, {tkn_k_class_argument, sym_k_DtNformatAllButtonLabel_arg, 23, ARGUMENT_NAME, "DTNFORMATALLBUTTONLABEL"}, {tkn_k_class_argument, sym_k_DtNformatParagraphButtonLabel_arg, 29, ARGUMENT_NAME, "DTNFORMATPARAGRAPHBUTTONLABEL"}, {tkn_k_class_argument, sym_k_DtNformatSettingsDialogTitle_arg, 28, ARGUMENT_NAME, "DTNFORMATSETTINGSDIALOGTITLE"}, {tkn_k_class_argument, sym_k_DtNheightInc_arg, 12, ARGUMENT_NAME, "DTNHEIGHTINC"}, {tkn_k_class_argument, sym_k_DtNhelpFile_arg, 11, ARGUMENT_NAME, "DTNHELPFILE"}, {tkn_k_class_argument, sym_k_DtNhelpLabelString_arg, 18, ARGUMENT_NAME, "DTNHELPLABELSTRING"}, {tkn_k_class_argument, sym_k_DtNhelpOnHelpVolume_arg, 19, ARGUMENT_NAME, "DTNHELPONHELPVOLUME"}, {tkn_k_class_argument, sym_k_DtNhelpPrint_arg, 12, ARGUMENT_NAME, "DTNHELPPRINT"}, {tkn_k_class_argument, sym_k_DtNhelpType_arg, 11, ARGUMENT_NAME, "DTNHELPTYPE"}, {tkn_k_class_argument, sym_k_DtNhelpVolume_arg, 13, ARGUMENT_NAME, "DTNHELPVOLUME"}, {tkn_k_class_reason, sym_k_DtNhyperLinkCallback_reason, 20, REASON_NAME, "DTNHYPERLINKCALLBACK"}, {tkn_k_class_argument, sym_k_DtNinformationDialogTitle_arg, 25, ARGUMENT_NAME, "DTNINFORMATIONDIALOGTITLE"}, {tkn_k_class_reason, sym_k_DtNinputVerifyCallback_reason, 22, REASON_NAME, "DTNINPUTVERIFYCALLBACK"}, {tkn_k_class_argument, sym_k_DtNinsertLabel_arg, 14, ARGUMENT_NAME, "DTNINSERTLABEL"}, {tkn_k_class_argument, sym_k_DtNjumpScroll_arg, 13, ARGUMENT_NAME, "DTNJUMPSCROLL"}, {tkn_k_class_argument, sym_k_DtNjustifyToggleLabel_arg, 21, ARGUMENT_NAME, "DTNJUSTIFYTOGGLELABEL"}, {tkn_k_class_argument, sym_k_DtNkshMode_arg, 10, ARGUMENT_NAME, "DTNKSHMODE"}, {tkn_k_class_argument, sym_k_DtNlabelFontList_arg, 16, ARGUMENT_NAME, "DTNLABELFONTLIST"}, {tkn_k_class_argument, sym_k_DtNleftAlignToggleLabel_arg, 23, ARGUMENT_NAME, "DTNLEFTALIGNTOGGLELABEL"}, {tkn_k_class_argument, sym_k_DtNleftMarginFieldLabel_arg, 23, ARGUMENT_NAME, "DTNLEFTMARGINFIELDLABEL"}, {tkn_k_class_argument, sym_k_DtNlocationId_arg, 13, ARGUMENT_NAME, "DTNLOCATIONID"}, {tkn_k_class_argument, sym_k_DtNlogFile_arg, 10, ARGUMENT_NAME, "DTNLOGFILE"}, {tkn_k_class_argument, sym_k_DtNlogging_arg, 10, ARGUMENT_NAME, "DTNLOGGING"}, {tkn_k_class_argument, sym_k_DtNlogInhibit_arg, 13, ARGUMENT_NAME, "DTNLOGINHIBIT"}, {tkn_k_class_argument, sym_k_DtNmanPage_arg, 10, ARGUMENT_NAME, "DTNMANPAGE"}, {tkn_k_class_argument, sym_k_DtNmapOnOutput_arg, 14, ARGUMENT_NAME, "DTNMAPONOUTPUT"}, {tkn_k_class_argument, sym_k_DtNmapOnOutputDelay_arg, 19, ARGUMENT_NAME, "DTNMAPONOUTPUTDELAY"}, {tkn_k_class_argument, sym_k_DtNmarginBell_arg, 13, ARGUMENT_NAME, "DTNMARGINBELL"}, {tkn_k_class_argument, sym_k_DtNmarginHeight_arg, 15, ARGUMENT_NAME, "DTNMARGINHEIGHT"}, {tkn_k_class_argument, sym_k_DtNmarginWidth_arg, 14, ARGUMENT_NAME, "DTNMARGINWIDTH"}, {tkn_k_class_argument, sym_k_DtNmaxLength_arg, 12, ARGUMENT_NAME, "DTNMAXLENGTH"}, {tkn_k_class_argument, sym_k_DtNminimizeButtons_arg, 18, ARGUMENT_NAME, "DTNMINIMIZEBUTTONS"}, {tkn_k_class_argument, sym_k_DtNmisspelledListLabel_arg, 22, ARGUMENT_NAME, "DTNMISSPELLEDLISTLABEL"}, {tkn_k_class_argument, sym_k_DtNmoreLabelString_arg, 18, ARGUMENT_NAME, "DTNMORELABELSTRING"}, {tkn_k_class_argument, sym_k_DtNnMarginBell_arg, 14, ARGUMENT_NAME, "DTNNMARGINBELL"}, {tkn_k_class_reason, sym_k_DtNoutputLogCallback_reason, 20, REASON_NAME, "DTNOUTPUTLOGCALLBACK"}, {tkn_k_class_argument, sym_k_DtNoverstrike_arg, 13, ARGUMENT_NAME, "DTNOVERSTRIKE"}, {tkn_k_class_argument, sym_k_DtNoverstrikeLabel_arg, 18, ARGUMENT_NAME, "DTNOVERSTRIKELABEL"}, {tkn_k_class_argument, sym_k_DtNpaperSize_arg, 12, ARGUMENT_NAME, "DTNPAPERSIZE"}, {tkn_k_class_argument, sym_k_DtNpointerBlank_arg, 15, ARGUMENT_NAME, "DTNPOINTERBLANK"}, {tkn_k_class_argument, sym_k_DtNpointerBlankDelay_arg, 20, ARGUMENT_NAME, "DTNPOINTERBLANKDELAY"}, {tkn_k_class_argument, sym_k_DtNpointerColor_arg, 15, ARGUMENT_NAME, "DTNPOINTERCOLOR"}, {tkn_k_class_argument, sym_k_DtNpointerColorBackground_arg, 25, ARGUMENT_NAME, "DTNPOINTERCOLORBACKGROUND"}, {tkn_k_class_argument, sym_k_DtNpointerShape_arg, 15, ARGUMENT_NAME, "DTNPOINTERSHAPE"}, {tkn_k_class_reason, sym_k_DtNprintCallback_reason, 16, REASON_NAME, "DTNPRINTCALLBACK"}, {tkn_k_class_argument, sym_k_DtNprintDestination_arg, 19, ARGUMENT_NAME, "DTNPRINTDESTINATION"}, {tkn_k_class_argument, sym_k_DtNprinter_arg, 10, ARGUMENT_NAME, "DTNPRINTER"}, {tkn_k_class_argument, sym_k_DtNprinterInfoProc_arg, 18, ARGUMENT_NAME, "DTNPRINTERINFOPROC"}, {tkn_k_class_argument, sym_k_DtNprinterName_arg, 14, ARGUMENT_NAME, "DTNPRINTERNAME"}, {tkn_k_class_argument, sym_k_DtNprintLabelString_arg, 19, ARGUMENT_NAME, "DTNPRINTLABELSTRING"}, {tkn_k_class_argument, sym_k_DtNprintSetupMode_arg, 17, ARGUMENT_NAME, "DTNPRINTSETUPMODE"}, {tkn_k_class_argument, sym_k_DtNreverseVideo_arg, 15, ARGUMENT_NAME, "DTNREVERSEVIDEO"}, {tkn_k_class_argument, sym_k_DtNreverseWrap_arg, 14, ARGUMENT_NAME, "DTNREVERSEWRAP"}, {tkn_k_class_argument, sym_k_DtNrightAlignToggleLabel_arg, 24, ARGUMENT_NAME, "DTNRIGHTALIGNTOGGLELABEL"}, {tkn_k_class_argument, sym_k_DtNrightMarginFieldLabel_arg, 24, ARGUMENT_NAME, "DTNRIGHTMARGINFIELDLABEL"}, {tkn_k_class_argument, sym_k_DtNrows_arg, 7, ARGUMENT_NAME, "DTNROWS"}, {tkn_k_class_argument, sym_k_DtNsaveLines_arg, 12, ARGUMENT_NAME, "DTNSAVELINES"}, {tkn_k_class_argument, sym_k_DtNscrollBarPolicy_arg, 18, ARGUMENT_NAME, "DTNSCROLLBARPOLICY"}, {tkn_k_class_argument, sym_k_DtNscrollHorizontal_arg, 19, ARGUMENT_NAME, "DTNSCROLLHORIZONTAL"}, {tkn_k_class_argument, sym_k_DtNscrollLeftSide_arg, 17, ARGUMENT_NAME, "DTNSCROLLLEFTSIDE"}, {tkn_k_class_argument, sym_k_DtNscrollTopSide_arg, 16, ARGUMENT_NAME, "DTNSCROLLTOPSIDE"}, {tkn_k_class_argument, sym_k_DtNscrollVertical_arg, 17, ARGUMENT_NAME, "DTNSCROLLVERTICAL"}, {tkn_k_class_argument, sym_k_DtNselectFileProc_arg, 17, ARGUMENT_NAME, "DTNSELECTFILEPROC"}, {tkn_k_class_argument, sym_k_DtNselectPrinterProc_arg, 20, ARGUMENT_NAME, "DTNSELECTPRINTERPROC"}, {tkn_k_class_reason, sym_k_DtNsetupCallback_reason, 16, REASON_NAME, "DTNSETUPCALLBACK"}, {tkn_k_class_argument, sym_k_DtNshadowType_arg, 13, ARGUMENT_NAME, "DTNSHADOWTYPE"}, {tkn_k_class_argument, sym_k_DtNshowNewWindowButton_arg, 22, ARGUMENT_NAME, "DTNSHOWNEWWINDOWBUTTON"}, {tkn_k_class_argument, sym_k_DtNshowStatusLine_arg, 17, ARGUMENT_NAME, "DTNSHOWSTATUSLINE"}, {tkn_k_class_argument, sym_k_DtNspellDialogTitle_arg, 19, ARGUMENT_NAME, "DTNSPELLDIALOGTITLE"}, {tkn_k_class_argument, sym_k_DtNspellFilter_arg, 14, ARGUMENT_NAME, "DTNSPELLFILTER"}, {tkn_k_class_reason, sym_k_DtNstatusChangeCallback_reason, 23, REASON_NAME, "DTNSTATUSCHANGECALLBACK"}, {tkn_k_class_argument, sym_k_DtNstickyNextCursor_arg, 19, ARGUMENT_NAME, "DTNSTICKYNEXTCURSOR"}, {tkn_k_class_argument, sym_k_DtNstickyPrevCursor_arg, 19, ARGUMENT_NAME, "DTNSTICKYPREVCURSOR"}, {tkn_k_class_argument, sym_k_DtNstringData_arg, 13, ARGUMENT_NAME, "DTNSTRINGDATA"}, {tkn_k_class_argument, sym_k_DtNsubMenuId_arg, 12, ARGUMENT_NAME, "DTNSUBMENUID"}, {tkn_k_class_argument, sym_k_DtNsubprocessArgv_arg, 17, ARGUMENT_NAME, "DTNSUBPROCESSARGV"}, {tkn_k_class_argument, sym_k_DtNsubprocessCmd_arg, 16, ARGUMENT_NAME, "DTNSUBPROCESSCMD"}, {tkn_k_class_argument, sym_k_DtNsubprocessExec_arg, 17, ARGUMENT_NAME, "DTNSUBPROCESSEXEC"}, {tkn_k_class_argument, sym_k_DtNsubprocessLoginShell_arg, 23, ARGUMENT_NAME, "DTNSUBPROCESSLOGINSHELL"}, {tkn_k_class_argument, sym_k_DtNsubprocessPid_arg, 16, ARGUMENT_NAME, "DTNSUBPROCESSPID"}, {tkn_k_class_reason, sym_k_DtNsubprocessTerminationCallback_reason, 32, REASON_NAME, "DTNSUBPROCESSTERMINATIONCALLBACK"}, {tkn_k_class_argument, sym_k_DtNsubprocessTerminationCatch_arg, 29, ARGUMENT_NAME, "DTNSUBPROCESSTERMINATIONCATCH"}, {tkn_k_class_argument, sym_k_DtNsunFunctionKeys_arg, 18, ARGUMENT_NAME, "DTNSUNFUNCTIONKEYS"}, {tkn_k_class_argument, sym_k_DtNtermDevice_arg, 13, ARGUMENT_NAME, "DTNTERMDEVICE"}, {tkn_k_class_argument, sym_k_DtNtermDeviceAllocate_arg, 21, ARGUMENT_NAME, "DTNTERMDEVICEALLOCATE"}, {tkn_k_class_argument, sym_k_DtNtermId_arg, 9, ARGUMENT_NAME, "DTNTERMID"}, {tkn_k_class_argument, sym_k_DtNtermName_arg, 11, ARGUMENT_NAME, "DTNTERMNAME"}, {tkn_k_class_argument, sym_k_DtNtermSlaveName_arg, 16, ARGUMENT_NAME, "DTNTERMSLAVENAME"}, {tkn_k_class_argument, sym_k_DtNtextBackground_arg, 17, ARGUMENT_NAME, "DTNTEXTBACKGROUND"}, {tkn_k_class_reason, sym_k_DtNtextDeselectCallback_reason, 23, REASON_NAME, "DTNTEXTDESELECTCALLBACK"}, {tkn_k_class_argument, sym_k_DtNtextFontList_arg, 15, ARGUMENT_NAME, "DTNTEXTFONTLIST"}, {tkn_k_class_argument, sym_k_DtNtextForeground_arg, 17, ARGUMENT_NAME, "DTNTEXTFOREGROUND"}, {tkn_k_class_reason, sym_k_DtNtextSelectCallback_reason, 21, REASON_NAME, "DTNTEXTSELECTCALLBACK"}, {tkn_k_class_argument, sym_k_DtNtextTranslations_arg, 19, ARGUMENT_NAME, "DTNTEXTTRANSLATIONS"}, {tkn_k_class_argument, sym_k_DtNtopCharacter_arg, 15, ARGUMENT_NAME, "DTNTOPCHARACTER"}, {tkn_k_class_argument, sym_k_DtNtopicTitle_arg, 13, ARGUMENT_NAME, "DTNTOPICTITLE"}, {tkn_k_class_argument, sym_k_DtNtotalLineCountLabel_arg, 22, ARGUMENT_NAME, "DTNTOTALLINECOUNTLABEL"}, {tkn_k_class_argument, sym_k_DtNttyModes_arg, 11, ARGUMENT_NAME, "DTNTTYMODES"}, {tkn_k_class_argument, sym_k_DtNuserBoldFont_arg, 15, ARGUMENT_NAME, "DTNUSERBOLDFONT"}, {tkn_k_class_argument, sym_k_DtNuserFont_arg, 11, ARGUMENT_NAME, "DTNUSERFONT"}, {tkn_k_class_argument, sym_k_DtNverifyPrinterProc_arg, 20, ARGUMENT_NAME, "DTNVERIFYPRINTERPROC"}, {tkn_k_class_argument, sym_k_DtNverticalScrollBar_arg, 20, ARGUMENT_NAME, "DTNVERTICALSCROLLBAR"}, {tkn_k_class_argument, sym_k_DtNvisiblePathCount_arg, 19, ARGUMENT_NAME, "DTNVISIBLEPATHCOUNT"}, {tkn_k_class_argument, sym_k_DtNvisualBell_arg, 13, ARGUMENT_NAME, "DTNVISUALBELL"}, {tkn_k_class_argument, sym_k_DtNwidthInc_arg, 11, ARGUMENT_NAME, "DTNWIDTHINC"}, {tkn_k_class_argument, sym_k_DtNwordWrap_arg, 11, ARGUMENT_NAME, "DTNWORDWRAP"}, {tkn_k_class_argument, sym_k_DtNworkAreaLocation_arg, 19, ARGUMENT_NAME, "DTNWORKAREALOCATION"}, {tkn_k_class_class, sym_k_DtPrintSetupBox_object, 15, CLASS_NAME, "DTPRINTSETUPBOX"}, {tkn_k_class_class, sym_k_DtPrintSetupDialog_object, 18, CLASS_NAME, "DTPRINTSETUPDIALOG"}, {tkn_k_class_enumval, sym_k_DtPRINT_CLOSE_CONNECTION_enumval, 24, ENUMVAL_NAME, "DTPRINT_CLOSE_CONNECTION"}, {tkn_k_class_enumval, sym_k_DtPRINT_NO_DESTINATION_enumval, 22, ENUMVAL_NAME, "DTPRINT_NO_DESTINATION"}, {tkn_k_class_enumval, sym_k_DtPRINT_RELEASE_CONNECTION_enumval, 26, ENUMVAL_NAME, "DTPRINT_RELEASE_CONNECTION"}, {tkn_k_class_enumval, sym_k_DtPRINT_SETUP_PLAIN_enumval, 19, ENUMVAL_NAME, "DTPRINT_SETUP_PLAIN"}, {tkn_k_class_enumval, sym_k_DtPRINT_SETUP_XP_enumval, 16, ENUMVAL_NAME, "DTPRINT_SETUP_XP"}, {tkn_k_class_enumval, sym_k_DtPRINT_TO_FILE_enumval, 15, ENUMVAL_NAME, "DTPRINT_TO_FILE"}, {tkn_k_class_enumval, sym_k_DtPRINT_TO_PRINTER_enumval, 18, ENUMVAL_NAME, "DTPRINT_TO_PRINTER"}, {tkn_k_class_enumval, sym_k_DtSHADOW_ETCHED_IN_enumval, 18, ENUMVAL_NAME, "DTSHADOW_ETCHED_IN"}, {tkn_k_class_enumval, sym_k_DtSHADOW_ETCHED_OUT_enumval, 19, ENUMVAL_NAME, "DTSHADOW_ETCHED_OUT"}, {tkn_k_class_enumval, sym_k_DtSHADOW_IN_enumval, 11, ENUMVAL_NAME, "DTSHADOW_IN"}, {tkn_k_class_enumval, sym_k_DtSHADOW_OUT_enumval, 12, ENUMVAL_NAME, "DTSHADOW_OUT"}, {tkn_k_class_enumval, sym_k_DtSHORT_NAME_enumval, 12, ENUMVAL_NAME, "DTSHORT_NAME"}, {tkn_k_class_class, sym_k_DtTerm_object, 6, CLASS_NAME, "DTTERM"}, {tkn_k_class_class, sym_k_DtTermPrimitive_object, 15, CLASS_NAME, "DTTERMPRIMITIVE"}, {tkn_k_class_enumval, sym_k_DtTERM_CHAR_CURSOR_BAR_enumval, 22, ENUMVAL_NAME, "DTTERM_CHAR_CURSOR_BAR"}, {tkn_k_class_enumval, sym_k_DtTERM_CHAR_CURSOR_BOX_enumval, 22, ENUMVAL_NAME, "DTTERM_CHAR_CURSOR_BOX"}, {tkn_k_class_enumval, sym_k_DtTERM_CHAR_CURSOR_INVISIBLE_enumval, 28, ENUMVAL_NAME, "DTTERM_CHAR_CURSOR_INVISIBLE"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_BOTTOM_enumval, 18, ENUMVAL_NAME, "DTWORK_AREA_BOTTOM"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_NONE_enumval, 16, ENUMVAL_NAME, "DTWORK_AREA_NONE"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_TOP_enumval, 15, ENUMVAL_NAME, "DTWORK_AREA_TOP"}, {tkn_k_class_enumval, sym_k_DtWORK_AREA_TOP_AND_BOTTOM_enumval, 26, ENUMVAL_NAME, "DTWORK_AREA_TOP_AND_BOTTOM"}, {tkn_k_class_reserved, 0, 3, END, "END"}, {tkn_k_class_charset, sym_k_euc_charset, 3, CHARSET_NAME, "EUC"}, {tkn_k_class_reserved, 0, 8, EXPORTED, "EXPORTED"}, {tkn_k_class_reserved, 0, 5, UILFALSE, "FALSE"}, {tkn_k_class_enumval, sym_k_FALSE_enumval, 5, ENUMVAL_NAME, "FALSE"}, {tkn_k_class_keyword, 0, 4, UILFILE, "FILE"}, {tkn_k_class_keyword, 0, 5, FLOAT, "FLOAT"}, {tkn_k_class_keyword, 0, 4, FONT, "FONT"}, {tkn_k_class_keyword, 0, 7, FONTSET, "FONTSET"}, {tkn_k_class_keyword, 0, 10, FONT_TABLE, "FONT_TABLE"}, {tkn_k_class_keyword, 0, 9, FONT_UNIT, "FONT_UNIT"}, {tkn_k_class_keyword, 0, 10, FONT_UNITS, "FONT_UNITS"}, {tkn_k_class_keyword, 0, 10, FOREGROUND, "FOREGROUND"}, {tkn_k_class_keyword, 0, 2, FU, "FU"}, {tkn_k_class_reserved, 0, 6, GADGET, "GADGET"}, {tkn_k_class_charset, sym_k_gb_hanzi_charset, 10, CHARSET_NAME, "GB_CHINESE"}, {tkn_k_class_charset, sym_k_gb_hanzi_charset, 8, CHARSET_NAME, "GB_HANZI"}, {tkn_k_class_charset, sym_k_gb_hanzi_charset, 11, CHARSET_NAME, "GB_HANZI_GL"}, {tkn_k_class_charset, sym_k_gb_hanzi_gr_charset, 11, CHARSET_NAME, "GB_HANZI_GR"}, {tkn_k_class_charset, sym_k_dos_cyrillic_charset, 7, CHARSET_NAME, "IBM-866"}, {tkn_k_class_keyword, 0, 4, ICON, "ICON"}, {tkn_k_class_enumval, sym_k_IconicState_enumval, 11, ENUMVAL_NAME, "ICONICSTATE"}, {tkn_k_class_reserved, 0, 10, IDENTIFIER, "IDENTIFIER"}, {tkn_k_class_keyword, 0, 8, IMPORTED, "IMPORTED"}, {tkn_k_class_keyword, 0, 2, IN, "IN"}, {tkn_k_class_keyword, 0, 4, INCH, "INCH"}, {tkn_k_class_keyword, 0, 6, INCHES, "INCHES"}, {tkn_k_class_reserved, 0, 7, INCLUDE, "INCLUDE"}, {tkn_k_class_keyword, 0, 7, INTEGER, "INTEGER"}, {tkn_k_class_keyword, 0, 13, INTEGER_TABLE, "INTEGER_TABLE"}, {tkn_k_class_charset, sym_k_iso_cyrillic_charset, 10, CHARSET_NAME, "ISO-8859-5"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 9, CHARSET_NAME, "ISOLATIN1"}, {tkn_k_class_charset, sym_k_iso_latin2_charset, 9, CHARSET_NAME, "ISOLATIN2"}, {tkn_k_class_charset, sym_k_iso_latin3_charset, 9, CHARSET_NAME, "ISOLATIN3"}, {tkn_k_class_charset, sym_k_iso_latin4_charset, 9, CHARSET_NAME, "ISOLATIN4"}, {tkn_k_class_charset, sym_k_iso_latin5_charset, 9, CHARSET_NAME, "ISOLATIN5"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 9, CHARSET_NAME, "ISOLATIN6"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 9, CHARSET_NAME, "ISOLATIN7"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 9, CHARSET_NAME, "ISOLATIN8"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 10, CHARSET_NAME, "ISO_ARABIC"}, {tkn_k_class_charset, sym_k_iso_arabic_lr_charset, 13, CHARSET_NAME, "ISO_ARABIC_LR"}, {tkn_k_class_charset, sym_k_iso_cyrillic_charset, 12, CHARSET_NAME, "ISO_CYRILLIC"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 9, CHARSET_NAME, "ISO_GREEK"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 10, CHARSET_NAME, "ISO_HEBREW"}, {tkn_k_class_charset, sym_k_iso_hebrew_lr_charset, 13, CHARSET_NAME, "ISO_HEBREW_LR"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 10, CHARSET_NAME, "ISO_IR_111"}, {tkn_k_class_charset, sym_k_iso_latin1_charset, 10, CHARSET_NAME, "ISO_LATIN1"}, {tkn_k_class_charset, sym_k_iso_latin2_charset, 10, CHARSET_NAME, "ISO_LATIN2"}, {tkn_k_class_charset, sym_k_iso_latin3_charset, 10, CHARSET_NAME, "ISO_LATIN3"}, {tkn_k_class_charset, sym_k_iso_latin4_charset, 10, CHARSET_NAME, "ISO_LATIN4"}, {tkn_k_class_charset, sym_k_iso_latin5_charset, 10, CHARSET_NAME, "ISO_LATIN5"}, {tkn_k_class_charset, sym_k_iso_arabic_charset, 10, CHARSET_NAME, "ISO_LATIN6"}, {tkn_k_class_charset, sym_k_iso_arabic_lr_charset, 13, CHARSET_NAME, "ISO_LATIN6_LR"}, {tkn_k_class_charset, sym_k_iso_greek_charset, 10, CHARSET_NAME, "ISO_LATIN7"}, {tkn_k_class_charset, sym_k_iso_hebrew_charset, 10, CHARSET_NAME, "ISO_LATIN8"}, {tkn_k_class_charset, sym_k_iso_hebrew_lr_charset, 13, CHARSET_NAME, "ISO_LATIN8_LR"}, {tkn_k_class_charset, sym_k_jis_kanji_charset, 12, CHARSET_NAME, "JIS_JAPANESE"}, {tkn_k_class_charset, sym_k_jis_kanji_charset, 9, CHARSET_NAME, "JIS_KANJI"}, {tkn_k_class_charset, sym_k_jis_kanji_charset, 12, CHARSET_NAME, "JIS_KANJI_GL"}, {tkn_k_class_charset, sym_k_jis_kanji_gr_charset, 12, CHARSET_NAME, "JIS_KANJI_GR"}, {tkn_k_class_charset, sym_k_jis_katakana_charset, 12, CHARSET_NAME, "JIS_KATAKANA"}, {tkn_k_class_keyword, 0, 6, KEYSYM, "KEYSYM"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 6, CHARSET_NAME, "KOI8-R"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 7, CHARSET_NAME, "KOI8-RU"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 6, CHARSET_NAME, "KOI8-U"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 5, CHARSET_NAME, "KOI8R"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 6, CHARSET_NAME, "KOI8RU"}, {tkn_k_class_charset, sym_k_iso_ir_111_charset, 5, CHARSET_NAME, "KOI8U"}, {tkn_k_class_charset, sym_k_ksc_hangul_charset, 10, CHARSET_NAME, "KSC_HANGUL"}, {tkn_k_class_charset, sym_k_ksc_hangul_charset, 13, CHARSET_NAME, "KSC_HANGUL_GL"}, {tkn_k_class_charset, sym_k_ksc_hangul_gr_charset, 13, CHARSET_NAME, "KSC_HANGUL_GR"}, {tkn_k_class_charset, sym_k_ksc_hangul_charset, 10, CHARSET_NAME, "KSC_KOREAN"}, {tkn_k_class_enumval, sym_k_LineDoubleDash_enumval, 14, ENUMVAL_NAME, "LINEDOUBLEDASH"}, {tkn_k_class_enumval, sym_k_LineOnOffDash_enumval, 13, ENUMVAL_NAME, "LINEONOFFDASH"}, {tkn_k_class_enumval, sym_k_LineSolid_enumval, 9, ENUMVAL_NAME, "LINESOLID"}, {tkn_k_class_reserved, 0, 4, LIST, "LIST"}, {tkn_k_class_reserved, 0, 5, MACRO, "MACRO"}, {tkn_k_class_keyword, 0, 7, MANAGED, "MANAGED"}, {tkn_k_class_keyword, 0, 10, MILLIMETER, "MILLIMETER"}, {tkn_k_class_keyword, 0, 11, MILLIMETERS, "MILLIMETERS"}, {tkn_k_class_keyword, 0, 2, MM, "MM"}, {tkn_k_class_reserved, 0, 6, MODULE, "MODULE"}, {tkn_k_class_reason, sym_k_MrmNcreateCallback_reason, 18, REASON_NAME, "MRMNCREATECALLBACK"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_ALL_enumval, 13, ENUMVAL_NAME, "MWM_DECOR_ALL"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_BORDER_enumval, 16, ENUMVAL_NAME, "MWM_DECOR_BORDER"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_MAXIMIZE_enumval, 18, ENUMVAL_NAME, "MWM_DECOR_MAXIMIZE"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_MENU_enumval, 14, ENUMVAL_NAME, "MWM_DECOR_MENU"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_MINIMIZE_enumval, 18, ENUMVAL_NAME, "MWM_DECOR_MINIMIZE"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_RESIZEH_enumval, 17, ENUMVAL_NAME, "MWM_DECOR_RESIZEH"}, {tkn_k_class_enumval, sym_k_MWM_DECOR_TITLE_enumval, 15, ENUMVAL_NAME, "MWM_DECOR_TITLE"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_ALL_enumval, 12, ENUMVAL_NAME, "MWM_FUNC_ALL"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_CLOSE_enumval, 14, ENUMVAL_NAME, "MWM_FUNC_CLOSE"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_MOVE_enumval, 13, ENUMVAL_NAME, "MWM_FUNC_MOVE"}, {tkn_k_class_enumval, sym_k_MWM_FUNC_RESIZE_enumval, 15, ENUMVAL_NAME, "MWM_FUNC_RESIZE"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_FULL_APPLICATION_MODAL_enumval, 32, ENUMVAL_NAME, "MWM_INPUT_FULL_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_MODELESS_enumval, 18, ENUMVAL_NAME, "MWM_INPUT_MODELESS"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_PRIMARY_APPLICATION_MODAL_enumval, 35, ENUMVAL_NAME, "MWM_INPUT_PRIMARY_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_MWM_INPUT_SYSTEM_MODAL_enumval, 22, ENUMVAL_NAME, "MWM_INPUT_SYSTEM_MODAL"}, {tkn_k_class_keyword, 0, 5, NAMES, "NAMES"}, {tkn_k_class_enumval, sym_k_NormalState_enumval, 11, ENUMVAL_NAME, "NORMALSTATE"}, {tkn_k_class_enumval, sym_k_NotUseful_enumval, 9, ENUMVAL_NAME, "NOTUSEFUL"}, {tkn_k_class_reserved, 0, 6, OBJECT, "OBJECT"}, {tkn_k_class_keyword, 0, 7, OBJECTS, "OBJECTS"}, {tkn_k_class_reserved, 0, 3, OFF, "OFF"}, {tkn_k_class_reserved, 0, 2, ON, "ON"}, {tkn_k_class_keyword, 0, 3, PIX, "PIX"}, {tkn_k_class_keyword, 0, 5, PIXEL, "PIXEL"}, {tkn_k_class_keyword, 0, 6, PIXELS, "PIXELS"}, {tkn_k_class_keyword, 0, 6, PIXMAP, "PIXMAP"}, {tkn_k_class_keyword, 0, 5, POINT, "POINT"}, {tkn_k_class_keyword, 0, 6, POINTS, "POINTS"}, {tkn_k_class_reserved, 0, 7, PRIVATE, "PRIVATE"}, {tkn_k_class_reserved, 0, 9, PROCEDURE, "PROCEDURE"}, {tkn_k_class_reserved, 0, 10, PROCEDURES, "PROCEDURES"}, {tkn_k_class_keyword, 0, 2, PT, "PT"}, {tkn_k_class_keyword, 0, 6, REASON, "REASON"}, {tkn_k_class_keyword, 0, 3, RGB, "RGB"}, {tkn_k_class_keyword, 0, 13, RIGHT_TO_LEFT, "RIGHT_TO_LEFT"}, {tkn_k_class_keyword, 0, 8, SEPARATE, "SEPARATE"}, {tkn_k_class_keyword, 0, 12, SINGLE_FLOAT, "SINGLE_FLOAT"}, {tkn_k_class_keyword, 0, 11, SIXTEEN_BIT, "SIXTEEN_BIT"}, {tkn_k_class_keyword, 0, 6, STRING, "STRING"}, {tkn_k_class_keyword, 0, 12, STRING_TABLE, "STRING_TABLE"}, {tkn_k_class_keyword, 0, 17, TRANSLATION_TABLE, "TRANSLATION_TABLE"}, {tkn_k_class_reserved, 0, 4, UILTRUE, "TRUE"}, {tkn_k_class_enumval, sym_k_TRUE_enumval, 4, ENUMVAL_NAME, "TRUE"}, {tkn_k_class_keyword, 0, 9, UNMANAGED, "UNMANAGED"}, {tkn_k_class_class, sym_k_user_defined_object, 12, CLASS_NAME, "USER_DEFINED"}, {tkn_k_class_charset, sym_k_utf8_charset, 4, CHARSET_NAME, "UTF8"}, {tkn_k_class_reserved, 0, 5, VALUE, "VALUE"}, {tkn_k_class_keyword, 0, 7, VERSION, "VERSION"}, {tkn_k_class_enumval, sym_k_WhenMapped_enumval, 10, ENUMVAL_NAME, "WHENMAPPED"}, {tkn_k_class_keyword, 0, 14, WIDE_CHARACTER, "WIDE_CHARACTER"}, {tkn_k_class_reserved, 0, 6, WIDGET, "WIDGET"}, {tkn_k_class_charset, sym_k_ansi_cyrillic_charset, 12, CHARSET_NAME, "WINDOWS-1251"}, {tkn_k_class_keyword, 0, 11, XBITMAPFILE, "XBITMAPFILE"}, {tkn_k_class_enumval, sym_k_Xm1000TH_INCHES_enumval, 15, ENUMVAL_NAME, "XM1000TH_INCHES"}, {tkn_k_class_enumval, sym_k_Xm100TH_FONT_UNITS_enumval, 18, ENUMVAL_NAME, "XM100TH_FONT_UNITS"}, {tkn_k_class_enumval, sym_k_Xm100TH_MILLIMETERS_enumval, 19, ENUMVAL_NAME, "XM100TH_MILLIMETERS"}, {tkn_k_class_enumval, sym_k_Xm100TH_POINTS_enumval, 14, ENUMVAL_NAME, "XM100TH_POINTS"}, {tkn_k_class_enumval, sym_k_XmABSOLUTE_enumval, 10, ENUMVAL_NAME, "XMABSOLUTE"}, {tkn_k_class_enumval, sym_k_XmADD_MODE_enumval, 10, ENUMVAL_NAME, "XMADD_MODE"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_BASELINE_BOTTOM_enumval, 27, ENUMVAL_NAME, "XMALIGNMENT_BASELINE_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_BASELINE_TOP_enumval, 24, ENUMVAL_NAME, "XMALIGNMENT_BASELINE_TOP"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_BEGINNING_enumval, 21, ENUMVAL_NAME, "XMALIGNMENT_BEGINNING"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_CENTER_enumval, 18, ENUMVAL_NAME, "XMALIGNMENT_CENTER"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_CONTENTS_BOTTOM_enumval, 27, ENUMVAL_NAME, "XMALIGNMENT_CONTENTS_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_CONTENTS_TOP_enumval, 24, ENUMVAL_NAME, "XMALIGNMENT_CONTENTS_TOP"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_END_enumval, 15, ENUMVAL_NAME, "XMALIGNMENT_END"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_UNSPECIFIED_enumval, 23, ENUMVAL_NAME, "XMALIGNMENT_UNSPECIFIED"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_WIDGET_BOTTOM_enumval, 25, ENUMVAL_NAME, "XMALIGNMENT_WIDGET_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmALIGNMENT_WIDGET_TOP_enumval, 22, ENUMVAL_NAME, "XMALIGNMENT_WIDGET_TOP"}, {tkn_k_class_enumval, sym_k_XmAlwaysOpen_enumval, 12, ENUMVAL_NAME, "XMALWAYSOPEN"}, {tkn_k_class_enumval, sym_k_XmANY_ICON_enumval, 10, ENUMVAL_NAME, "XMANY_ICON"}, {tkn_k_class_enumval, sym_k_XmAPPEND_enumval, 8, ENUMVAL_NAME, "XMAPPEND"}, {tkn_k_class_enumval, sym_k_XmAPPLICATION_DEFINED_enumval, 21, ENUMVAL_NAME, "XMAPPLICATION_DEFINED"}, {tkn_k_class_class, sym_k_XmArrowButton_object, 13, CLASS_NAME, "XMARROWBUTTON"}, {tkn_k_class_class, sym_k_XmArrowButtonGadget_object, 19, CLASS_NAME, "XMARROWBUTTONGADGET"}, {tkn_k_class_enumval, sym_k_XmARROWS_BEGINNING_enumval, 18, ENUMVAL_NAME, "XMARROWS_BEGINNING"}, {tkn_k_class_enumval, sym_k_XmARROWS_DECREMENT_SENSITIVE_enumval, 28, ENUMVAL_NAME, "XMARROWS_DECREMENT_SENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_DEFAULT_SENSITIVITY_enumval, 28, ENUMVAL_NAME, "XMARROWS_DEFAULT_SENSITIVITY"}, {tkn_k_class_enumval, sym_k_XmARROWS_END_enumval, 12, ENUMVAL_NAME, "XMARROWS_END"}, {tkn_k_class_enumval, sym_k_XmARROWS_FLAT_BEGINNING_enumval, 23, ENUMVAL_NAME, "XMARROWS_FLAT_BEGINNING"}, {tkn_k_class_enumval, sym_k_XmARROWS_FLAT_END_enumval, 17, ENUMVAL_NAME, "XMARROWS_FLAT_END"}, {tkn_k_class_enumval, sym_k_XmARROWS_HORIZONTAL_enumval, 19, ENUMVAL_NAME, "XMARROWS_HORIZONTAL"}, {tkn_k_class_enumval, sym_k_XmARROWS_INCREMENT_SENSITIVE_enumval, 28, ENUMVAL_NAME, "XMARROWS_INCREMENT_SENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_INSENSITIVE_enumval, 20, ENUMVAL_NAME, "XMARROWS_INSENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_SENSITIVE_enumval, 18, ENUMVAL_NAME, "XMARROWS_SENSITIVE"}, {tkn_k_class_enumval, sym_k_XmARROWS_SPLIT_enumval, 14, ENUMVAL_NAME, "XMARROWS_SPLIT"}, {tkn_k_class_enumval, sym_k_XmARROWS_VERTICAL_enumval, 17, ENUMVAL_NAME, "XMARROWS_VERTICAL"}, {tkn_k_class_enumval, sym_k_XmARROW_DOWN_enumval, 12, ENUMVAL_NAME, "XMARROW_DOWN"}, {tkn_k_class_enumval, sym_k_XmARROW_LEFT_enumval, 12, ENUMVAL_NAME, "XMARROW_LEFT"}, {tkn_k_class_enumval, sym_k_XmARROW_RIGHT_enumval, 13, ENUMVAL_NAME, "XMARROW_RIGHT"}, {tkn_k_class_enumval, sym_k_XmARROW_UP_enumval, 10, ENUMVAL_NAME, "XMARROW_UP"}, {tkn_k_class_enumval, sym_k_XmAS_IS_enumval, 7, ENUMVAL_NAME, "XMAS_IS"}, {tkn_k_class_enumval, sym_k_XmAS_NEEDED_enumval, 11, ENUMVAL_NAME, "XMAS_NEEDED"}, {tkn_k_class_enumval, sym_k_XmATTACH_FORM_enumval, 13, ENUMVAL_NAME, "XMATTACH_FORM"}, {tkn_k_class_enumval, sym_k_XmATTACH_NONE_enumval, 13, ENUMVAL_NAME, "XMATTACH_NONE"}, {tkn_k_class_enumval, sym_k_XmATTACH_OPPOSITE_FORM_enumval, 22, ENUMVAL_NAME, "XMATTACH_OPPOSITE_FORM"}, {tkn_k_class_enumval, sym_k_XmATTACH_OPPOSITE_WIDGET_enumval, 24, ENUMVAL_NAME, "XMATTACH_OPPOSITE_WIDGET"}, {tkn_k_class_enumval, sym_k_XmATTACH_POSITION_enumval, 17, ENUMVAL_NAME, "XMATTACH_POSITION"}, {tkn_k_class_enumval, sym_k_XmATTACH_SELF_enumval, 13, ENUMVAL_NAME, "XMATTACH_SELF"}, {tkn_k_class_enumval, sym_k_XmATTACH_WIDGET_enumval, 15, ENUMVAL_NAME, "XMATTACH_WIDGET"}, {tkn_k_class_enumval, sym_k_XmAUTOMATIC_enumval, 11, ENUMVAL_NAME, "XMAUTOMATIC"}, {tkn_k_class_enumval, sym_k_XmAUTO_DRAG_DISABLED_enumval, 20, ENUMVAL_NAME, "XMAUTO_DRAG_DISABLED"}, {tkn_k_class_enumval, sym_k_XmAUTO_DRAG_ENABLED_enumval, 19, ENUMVAL_NAME, "XMAUTO_DRAG_ENABLED"}, {tkn_k_class_enumval, sym_k_XmAUTO_SELECT_enumval, 13, ENUMVAL_NAME, "XMAUTO_SELECT"}, {tkn_k_class_enumval, sym_k_XmBACKGROUND_COLOR_enumval, 18, ENUMVAL_NAME, "XMBACKGROUND_COLOR"}, {tkn_k_class_enumval, sym_k_XmBELL_enumval, 6, ENUMVAL_NAME, "XMBELL"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_LEFT_enumval, 13, ENUMVAL_NAME, "XMBOTTOM_LEFT"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_RIGHT_enumval, 14, ENUMVAL_NAME, "XMBOTTOM_RIGHT"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_TO_TOP_enumval, 15, ENUMVAL_NAME, "XMBOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_TO_TOP_LEFT_TO_RIGHT_enumval, 29, ENUMVAL_NAME, "XMBOTTOM_TO_TOP_LEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmBOTTOM_TO_TOP_RIGHT_TO_LEFT_enumval, 29, ENUMVAL_NAME, "XMBOTTOM_TO_TOP_RIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmBROWSE_SELECT_enumval, 15, ENUMVAL_NAME, "XMBROWSE_SELECT"}, {tkn_k_class_class, sym_k_XmBulletinBoard_object, 15, CLASS_NAME, "XMBULLETINBOARD"}, {tkn_k_class_class, sym_k_XmBulletinBoardDialog_object, 21, CLASS_NAME, "XMBULLETINBOARDDIALOG"}, {tkn_k_class_class, sym_k_XmButtonBox_object, 11, CLASS_NAME, "XMBUTTONBOX"}, {tkn_k_class_class, sym_k_XmCascadeButton_object, 15, CLASS_NAME, "XMCASCADEBUTTON"}, {tkn_k_class_class, sym_k_XmCascadeButtonGadget_object, 21, CLASS_NAME, "XMCASCADEBUTTONGADGET"}, {tkn_k_class_enumval, sym_k_XmCELLS_enumval, 7, ENUMVAL_NAME, "XMCELLS"}, {tkn_k_class_enumval, sym_k_XmCENTER_enumval, 8, ENUMVAL_NAME, "XMCENTER"}, {tkn_k_class_enumval, sym_k_XmCENTIMETERS_enumval, 13, ENUMVAL_NAME, "XMCENTIMETERS"}, {tkn_k_class_class, sym_k_XmCheckBox_object, 10, CLASS_NAME, "XMCHECKBOX"}, {tkn_k_class_enumval, sym_k_XmCLIP_WINDOW_enumval, 13, ENUMVAL_NAME, "XMCLIP_WINDOW"}, {tkn_k_class_enumval, sym_k_XmClosed_enumval, 8, ENUMVAL_NAME, "XMCLOSED"}, {tkn_k_class_enumval, sym_k_XmCLOSEST_enumval, 9, ENUMVAL_NAME, "XMCLOSEST"}, {tkn_k_class_enumval, sym_k_XmCOLLAPSED_enumval, 11, ENUMVAL_NAME, "XMCOLLAPSED"}, {tkn_k_class_class, sym_k_XmColorSelector_object, 15, CLASS_NAME, "XMCOLORSELECTOR"}, {tkn_k_class_class, sym_k_XmColumn_object, 8, CLASS_NAME, "XMCOLUMN"}, {tkn_k_class_class, sym_k_XmDropDown_object, 17, CLASS_NAME, "XMCOMBINATIONBOX2"}, {tkn_k_class_class, sym_k_XmComboBox_object, 10, CLASS_NAME, "XMCOMBOBOX"}, {tkn_k_class_enumval, sym_k_XmCOMBO_BOX_enumval, 11, ENUMVAL_NAME, "XMCOMBO_BOX"}, {tkn_k_class_class, sym_k_XmCommand_object, 9, CLASS_NAME, "XMCOMMAND"}, {tkn_k_class_class, sym_k_XmCommandDialog_object, 15, CLASS_NAME, "XMCOMMANDDIALOG"}, {tkn_k_class_enumval, sym_k_XmCOMMAND_ABOVE_WORKSPACE_enumval, 25, ENUMVAL_NAME, "XMCOMMAND_ABOVE_WORKSPACE"}, {tkn_k_class_enumval, sym_k_XmCOMMAND_BELOW_WORKSPACE_enumval, 25, ENUMVAL_NAME, "XMCOMMAND_BELOW_WORKSPACE"}, {tkn_k_class_enumval, sym_k_XmCOMMAND_WINDOW_enumval, 16, ENUMVAL_NAME, "XMCOMMAND_WINDOW"}, {tkn_k_class_enumval, sym_k_XmCONSTANT_enumval, 10, ENUMVAL_NAME, "XMCONSTANT"}, {tkn_k_class_class, sym_k_XmContainer_object, 11, CLASS_NAME, "XMCONTAINER"}, {tkn_k_class_class, sym_k_XmDataField_object, 11, CLASS_NAME, "XMDATAFIELD"}, {tkn_k_class_enumval, sym_k_XmDEFAULT_DIRECTION_enumval, 19, ENUMVAL_NAME, "XMDEFAULT_DIRECTION"}, {tkn_k_class_enumval, sym_k_XmDESTROY_enumval, 9, ENUMVAL_NAME, "XMDESTROY"}, {tkn_k_class_enumval, sym_k_XmDETAIL_enumval, 8, ENUMVAL_NAME, "XMDETAIL"}, {tkn_k_class_class, sym_k_XmDialogShell_object, 13, CLASS_NAME, "XMDIALOGSHELL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_APPLICATION_MODAL_enumval, 26, ENUMVAL_NAME, "XMDIALOG_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_CANCEL_BUTTON_enumval, 22, ENUMVAL_NAME, "XMDIALOG_CANCEL_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_COMMAND_enumval, 16, ENUMVAL_NAME, "XMDIALOG_COMMAND"}, {tkn_k_class_enumval, sym_k_XmDIALOG_DEFAULT_BUTTON_enumval, 23, ENUMVAL_NAME, "XMDIALOG_DEFAULT_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_ERROR_enumval, 14, ENUMVAL_NAME, "XMDIALOG_ERROR"}, {tkn_k_class_enumval, sym_k_XmDIALOG_FILE_SELECTION_enumval, 23, ENUMVAL_NAME, "XMDIALOG_FILE_SELECTION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_FULL_APPLICATION_MODAL_enumval, 31, ENUMVAL_NAME, "XMDIALOG_FULL_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_HELP_BUTTON_enumval, 20, ENUMVAL_NAME, "XMDIALOG_HELP_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_INFORMATION_enumval, 20, ENUMVAL_NAME, "XMDIALOG_INFORMATION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_MESSAGE_enumval, 16, ENUMVAL_NAME, "XMDIALOG_MESSAGE"}, {tkn_k_class_enumval, sym_k_XmDIALOG_MESSAGE_LABEL_enumval, 22, ENUMVAL_NAME, "XMDIALOG_MESSAGE_LABEL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_MODELESS_enumval, 17, ENUMVAL_NAME, "XMDIALOG_MODELESS"}, {tkn_k_class_enumval, sym_k_XmDIALOG_OK_BUTTON_enumval, 18, ENUMVAL_NAME, "XMDIALOG_OK_BUTTON"}, {tkn_k_class_enumval, sym_k_XmDIALOG_PRIMARY_APPLICATION_MODAL_enumval, 34, ENUMVAL_NAME, "XMDIALOG_PRIMARY_APPLICATION_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_PROMPT_enumval, 15, ENUMVAL_NAME, "XMDIALOG_PROMPT"}, {tkn_k_class_enumval, sym_k_XmDIALOG_QUESTION_enumval, 17, ENUMVAL_NAME, "XMDIALOG_QUESTION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SELECTION_enumval, 18, ENUMVAL_NAME, "XMDIALOG_SELECTION"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SEPARATOR_enumval, 18, ENUMVAL_NAME, "XMDIALOG_SEPARATOR"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SYMBOL_LABEL_enumval, 21, ENUMVAL_NAME, "XMDIALOG_SYMBOL_LABEL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_SYSTEM_MODAL_enumval, 21, ENUMVAL_NAME, "XMDIALOG_SYSTEM_MODAL"}, {tkn_k_class_enumval, sym_k_XmDIALOG_TEMPLATE_enumval, 17, ENUMVAL_NAME, "XMDIALOG_TEMPLATE"}, {tkn_k_class_enumval, sym_k_XmDIALOG_WARNING_enumval, 16, ENUMVAL_NAME, "XMDIALOG_WARNING"}, {tkn_k_class_enumval, sym_k_XmDIALOG_WORKING_enumval, 16, ENUMVAL_NAME, "XMDIALOG_WORKING"}, {tkn_k_class_enumval, sym_k_XmDIALOG_WORK_AREA_enumval, 18, ENUMVAL_NAME, "XMDIALOG_WORK_AREA"}, {tkn_k_class_enumval, sym_k_XmDISTRIBUTE_SPREAD_enumval, 19, ENUMVAL_NAME, "XMDISTRIBUTE_SPREAD"}, {tkn_k_class_enumval, sym_k_XmDISTRIBUTE_TIGHT_enumval, 18, ENUMVAL_NAME, "XMDISTRIBUTE_TIGHT"}, {tkn_k_class_enumval, sym_k_XmDOUBLE_DASHED_LINE_enumval, 20, ENUMVAL_NAME, "XMDOUBLE_DASHED_LINE"}, {tkn_k_class_enumval, sym_k_XmDOUBLE_LINE_enumval, 13, ENUMVAL_NAME, "XMDOUBLE_LINE"}, {tkn_k_class_enumval, sym_k_XmDO_NOTHING_enumval, 12, ENUMVAL_NAME, "XMDO_NOTHING"}, {tkn_k_class_class, sym_k_XmDrawingArea_object, 13, CLASS_NAME, "XMDRAWINGAREA"}, {tkn_k_class_class, sym_k_XmDrawnButton_object, 13, CLASS_NAME, "XMDRAWNBUTTON"}, {tkn_k_class_class, sym_k_XmDropDown_object, 10, CLASS_NAME, "XMDROPDOWN"}, {tkn_k_class_enumval, sym_k_XmDROP_DOWN_COMBO_BOX_enumval, 21, ENUMVAL_NAME, "XMDROP_DOWN_COMBO_BOX"}, {tkn_k_class_enumval, sym_k_XmDROP_DOWN_LIST_enumval, 16, ENUMVAL_NAME, "XMDROP_DOWN_LIST"}, {tkn_k_class_enumval, sym_k_XmEACH_SIDE_enumval, 11, ENUMVAL_NAME, "XMEACH_SIDE"}, {tkn_k_class_class, sym_k_XmErrorDialog_object, 13, CLASS_NAME, "XMERRORDIALOG"}, {tkn_k_class_enumval, sym_k_XmETCHED_LINE_enumval, 13, ENUMVAL_NAME, "XMETCHED_LINE"}, {tkn_k_class_enumval, sym_k_XmEXCLUSIVE_TAB_GROUP_enumval, 21, ENUMVAL_NAME, "XMEXCLUSIVE_TAB_GROUP"}, {tkn_k_class_enumval, sym_k_XmEXPANDED_enumval, 10, ENUMVAL_NAME, "XMEXPANDED"}, {tkn_k_class_enumval, sym_k_XmEXPLICIT_enumval, 10, ENUMVAL_NAME, "XMEXPLICIT"}, {tkn_k_class_class, sym_k_XmMultiList_object, 11, CLASS_NAME, "XMEXT18LIST"}, {tkn_k_class_enumval, sym_k_XmEXTENDED_SELECT_enumval, 17, ENUMVAL_NAME, "XMEXTENDED_SELECT"}, {tkn_k_class_class, sym_k_XmFileSelectionBox_object, 18, CLASS_NAME, "XMFILESELECTIONBOX"}, {tkn_k_class_class, sym_k_XmFileSelectionDialog_object, 21, CLASS_NAME, "XMFILESELECTIONDIALOG"}, {tkn_k_class_enumval, sym_k_XmFILE_ANY_TYPE_enumval, 15, ENUMVAL_NAME, "XMFILE_ANY_TYPE"}, {tkn_k_class_enumval, sym_k_XmFILE_DIRECTORY_enumval, 16, ENUMVAL_NAME, "XMFILE_DIRECTORY"}, {tkn_k_class_enumval, sym_k_XmFILE_REGULAR_enumval, 14, ENUMVAL_NAME, "XMFILE_REGULAR"}, {tkn_k_class_enumval, sym_k_XmFillAll_enumval, 9, ENUMVAL_NAME, "XMFILLALL"}, {tkn_k_class_enumval, sym_k_XmFillMajor_enumval, 11, ENUMVAL_NAME, "XMFILLMAJOR"}, {tkn_k_class_enumval, sym_k_XmFillMinor_enumval, 11, ENUMVAL_NAME, "XMFILLMINOR"}, {tkn_k_class_enumval, sym_k_XmFillNone_enumval, 10, ENUMVAL_NAME, "XMFILLNONE"}, {tkn_k_class_enumval, sym_k_XmFILL_FLUSH_enumval, 12, ENUMVAL_NAME, "XMFILL_FLUSH"}, {tkn_k_class_enumval, sym_k_XmFILL_RAGGED_enumval, 13, ENUMVAL_NAME, "XMFILL_RAGGED"}, {tkn_k_class_enumval, sym_k_XmFILL_UNSPECIFIED_enumval, 18, ENUMVAL_NAME, "XMFILL_UNSPECIFIED"}, {tkn_k_class_enumval, sym_k_XmFIRST_FIT_enumval, 11, ENUMVAL_NAME, "XMFIRST_FIT"}, {tkn_k_class_enumval, sym_k_XmFIRST_POSITION_enumval, 16, ENUMVAL_NAME, "XMFIRST_POSITION"}, {tkn_k_class_charset, sym_k_XmFONTLIST_DEFAULT_TAG_charset, 22, CHARSET_NAME, "XMFONTLIST_DEFAULT_TAG"}, {tkn_k_class_class, sym_k_XmFontSelector_object, 14, CLASS_NAME, "XMFONTSELECTOR"}, {tkn_k_class_enumval, sym_k_XmFONT_IS_FONT_enumval, 14, ENUMVAL_NAME, "XMFONT_IS_FONT"}, {tkn_k_class_enumval, sym_k_XmFONT_IS_FONTSET_enumval, 17, ENUMVAL_NAME, "XMFONT_IS_FONTSET"}, {tkn_k_class_enumval, sym_k_XmFONT_IS_XFT_enumval, 13, ENUMVAL_NAME, "XMFONT_IS_XFT"}, {tkn_k_class_enumval, sym_k_XmFONT_UNITS_enumval, 12, ENUMVAL_NAME, "XMFONT_UNITS"}, {tkn_k_class_enumval, sym_k_XmFOREGROUND_COLOR_enumval, 18, ENUMVAL_NAME, "XMFOREGROUND_COLOR"}, {tkn_k_class_class, sym_k_XmForm_object, 6, CLASS_NAME, "XMFORM"}, {tkn_k_class_class, sym_k_XmFormDialog_object, 12, CLASS_NAME, "XMFORMDIALOG"}, {tkn_k_class_class, sym_k_XmFrame_object, 7, CLASS_NAME, "XMFRAME"}, {tkn_k_class_enumval, sym_k_XmFRAME_GENERIC_CHILD_enumval, 21, ENUMVAL_NAME, "XMFRAME_GENERIC_CHILD"}, {tkn_k_class_enumval, sym_k_XmFRAME_TITLE_CHILD_enumval, 19, ENUMVAL_NAME, "XMFRAME_TITLE_CHILD"}, {tkn_k_class_enumval, sym_k_XmFRAME_WORKAREA_CHILD_enumval, 22, ENUMVAL_NAME, "XMFRAME_WORKAREA_CHILD"}, {tkn_k_class_enumval, sym_k_XmGENERIC_CHILD_enumval, 15, ENUMVAL_NAME, "XMGENERIC_CHILD"}, {tkn_k_class_enumval, sym_k_XmGRID_enumval, 6, ENUMVAL_NAME, "XMGRID"}, {tkn_k_class_enumval, sym_k_XmGROW_BALANCED_enumval, 15, ENUMVAL_NAME, "XMGROW_BALANCED"}, {tkn_k_class_enumval, sym_k_XmGROW_MAJOR_enumval, 12, ENUMVAL_NAME, "XMGROW_MAJOR"}, {tkn_k_class_enumval, sym_k_XmGROW_MINOR_enumval, 12, ENUMVAL_NAME, "XMGROW_MINOR"}, {tkn_k_class_enumval, sym_k_XmHidden_enumval, 8, ENUMVAL_NAME, "XMHIDDEN"}, {tkn_k_class_enumval, sym_k_XmHORIZONTAL_enumval, 12, ENUMVAL_NAME, "XMHORIZONTAL"}, {tkn_k_class_enumval, sym_k_XmHOR_SCROLLBAR_enumval, 15, ENUMVAL_NAME, "XMHOR_SCROLLBAR"}, {tkn_k_class_enumval, sym_k_XmIconBottom_enumval, 12, ENUMVAL_NAME, "XMICONBOTTOM"}, {tkn_k_class_class, sym_k_XmIconBox_object, 9, CLASS_NAME, "XMICONBOX"}, {tkn_k_class_class, sym_k_XmIconButton_object, 12, CLASS_NAME, "XMICONBUTTON"}, {tkn_k_class_class, sym_k_XmIconGadget_object, 12, CLASS_NAME, "XMICONGADGET"}, {tkn_k_class_enumval, sym_k_XmIconLeft_enumval, 10, ENUMVAL_NAME, "XMICONLEFT"}, {tkn_k_class_enumval, sym_k_XmIconNone_enumval, 10, ENUMVAL_NAME, "XMICONNONE"}, {tkn_k_class_enumval, sym_k_XmIconOnly_enumval, 10, ENUMVAL_NAME, "XMICONONLY"}, {tkn_k_class_enumval, sym_k_XmIconRight_enumval, 11, ENUMVAL_NAME, "XMICONRIGHT"}, {tkn_k_class_enumval, sym_k_XmIconTop_enumval, 9, ENUMVAL_NAME, "XMICONTOP"}, {tkn_k_class_enumval, sym_k_XmINCHES_enumval, 8, ENUMVAL_NAME, "XMINCHES"}, {tkn_k_class_enumval, sym_k_XmINDETERMINATE_enumval, 15, ENUMVAL_NAME, "XMINDETERMINATE"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_BOX_enumval, 15, ENUMVAL_NAME, "XMINDICATOR_BOX"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CHECK_enumval, 17, ENUMVAL_NAME, "XMINDICATOR_CHECK"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CHECK_BOX_enumval, 21, ENUMVAL_NAME, "XMINDICATOR_CHECK_BOX"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CROSS_enumval, 17, ENUMVAL_NAME, "XMINDICATOR_CROSS"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_CROSS_BOX_enumval, 21, ENUMVAL_NAME, "XMINDICATOR_CROSS_BOX"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_FILL_enumval, 16, ENUMVAL_NAME, "XMINDICATOR_FILL"}, {tkn_k_class_enumval, sym_k_XmINDICATOR_NONE_enumval, 16, ENUMVAL_NAME, "XMINDICATOR_NONE"}, {tkn_k_class_class, sym_k_XmInformationDialog_object, 19, CLASS_NAME, "XMINFORMATIONDIALOG"}, {tkn_k_class_enumval, sym_k_XmINHERIT_POLICY_enumval, 16, ENUMVAL_NAME, "XMINHERIT_POLICY"}, {tkn_k_class_enumval, sym_k_XmINVALID_MATCH_BEHAVIOR_enumval, 24, ENUMVAL_NAME, "XMINVALID_MATCH_BEHAVIOR"}, {tkn_k_class_class, sym_k_XmLabel_object, 7, CLASS_NAME, "XMLABEL"}, {tkn_k_class_class, sym_k_XmLabelGadget_object, 13, CLASS_NAME, "XMLABELGADGET"}, {tkn_k_class_enumval, sym_k_XmLARGE_ICON_enumval, 12, ENUMVAL_NAME, "XMLARGE_ICON"}, {tkn_k_class_enumval, sym_k_XmLAST_POSITION_enumval, 15, ENUMVAL_NAME, "XMLAST_POSITION"}, {tkn_k_class_enumval, sym_k_XmLEFT_TO_RIGHT_enumval, 15, ENUMVAL_NAME, "XMLEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmLEFT_TO_RIGHT_BOTTOM_TO_TOP_enumval, 29, ENUMVAL_NAME, "XMLEFT_TO_RIGHT_BOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmLEFT_TO_RIGHT_TOP_TO_BOTTOM_enumval, 29, ENUMVAL_NAME, "XMLEFT_TO_RIGHT_TOP_TO_BOTTOM"}, {tkn_k_class_class, sym_k_XmList_object, 6, CLASS_NAME, "XMLIST"}, {tkn_k_class_enumval, sym_k_XmListMode_enumval, 10, ENUMVAL_NAME, "XMLISTMODE"}, {tkn_k_class_enumval, sym_k_XmLOAD_DEFERRED_enumval, 15, ENUMVAL_NAME, "XMLOAD_DEFERRED"}, {tkn_k_class_enumval, sym_k_XmLOAD_IMMEDIATE_enumval, 16, ENUMVAL_NAME, "XMLOAD_IMMEDIATE"}, {tkn_k_class_class, sym_k_XmMainWindow_object, 12, CLASS_NAME, "XMMAINWINDOW"}, {tkn_k_class_enumval, sym_k_XmMAJOR_TAB_enumval, 11, ENUMVAL_NAME, "XMMAJOR_TAB"}, {tkn_k_class_enumval, sym_k_XmMARQUEE_enumval, 9, ENUMVAL_NAME, "XMMARQUEE"}, {tkn_k_class_enumval, sym_k_XmMARQUEE_EXTEND_BOTH_enumval, 21, ENUMVAL_NAME, "XMMARQUEE_EXTEND_BOTH"}, {tkn_k_class_enumval, sym_k_XmMARQUEE_EXTEND_START_enumval, 22, ENUMVAL_NAME, "XMMARQUEE_EXTEND_START"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_BOTTOM_enumval, 15, ENUMVAL_NAME, "XMMAX_ON_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_LEFT_enumval, 13, ENUMVAL_NAME, "XMMAX_ON_LEFT"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_RIGHT_enumval, 14, ENUMVAL_NAME, "XMMAX_ON_RIGHT"}, {tkn_k_class_enumval, sym_k_XmMAX_ON_TOP_enumval, 12, ENUMVAL_NAME, "XMMAX_ON_TOP"}, {tkn_k_class_enumval, sym_k_XmMAX_SIDE_enumval, 10, ENUMVAL_NAME, "XMMAX_SIDE"}, {tkn_k_class_class, sym_k_XmMenuBar_object, 9, CLASS_NAME, "XMMENUBAR"}, {tkn_k_class_class, sym_k_XmMenuShell_object, 11, CLASS_NAME, "XMMENUSHELL"}, {tkn_k_class_enumval, sym_k_XmMENU_BAR_enumval, 10, ENUMVAL_NAME, "XMMENU_BAR"}, {tkn_k_class_enumval, sym_k_XmMENU_OPTION_enumval, 13, ENUMVAL_NAME, "XMMENU_OPTION"}, {tkn_k_class_enumval, sym_k_XmMENU_POPUP_enumval, 12, ENUMVAL_NAME, "XMMENU_POPUP"}, {tkn_k_class_enumval, sym_k_XmMENU_PULLDOWN_enumval, 15, ENUMVAL_NAME, "XMMENU_PULLDOWN"}, {tkn_k_class_class, sym_k_XmMessageBox_object, 12, CLASS_NAME, "XMMESSAGEBOX"}, {tkn_k_class_class, sym_k_XmMessageDialog_object, 15, CLASS_NAME, "XMMESSAGEDIALOG"}, {tkn_k_class_enumval, sym_k_XmMESSAGE_WINDOW_enumval, 16, ENUMVAL_NAME, "XMMESSAGE_WINDOW"}, {tkn_k_class_enumval, sym_k_XmMILLIMETERS_enumval, 13, ENUMVAL_NAME, "XMMILLIMETERS"}, {tkn_k_class_enumval, sym_k_XmMINOR_TAB_enumval, 11, ENUMVAL_NAME, "XMMINOR_TAB"}, {tkn_k_class_enumval, sym_k_XmMIN_SIDE_enumval, 10, ENUMVAL_NAME, "XMMIN_SIDE"}, {tkn_k_class_enumval, sym_k_XmMULTICLICK_DISCARD_enumval, 20, ENUMVAL_NAME, "XMMULTICLICK_DISCARD"}, {tkn_k_class_enumval, sym_k_XmMULTICLICK_KEEP_enumval, 17, ENUMVAL_NAME, "XMMULTICLICK_KEEP"}, {tkn_k_class_class, sym_k_XmMultiList_object, 11, CLASS_NAME, "XMMULTILIST"}, {tkn_k_class_enumval, sym_k_XmMULTIPLE_SELECT_enumval, 17, ENUMVAL_NAME, "XMMULTIPLE_SELECT"}, {tkn_k_class_enumval, sym_k_XmMULTI_LINE_EDIT_enumval, 17, ENUMVAL_NAME, "XMMULTI_LINE_EDIT"}, {tkn_k_class_argument, sym_k_XmN100DPIstring_arg, 15, ARGUMENT_NAME, "XMN100DPISTRING"}, {tkn_k_class_argument, sym_k_XmN75DPIstring_arg, 14, ARGUMENT_NAME, "XMN75DPISTRING"}, {tkn_k_class_argument, sym_k_XmNaccelerator_arg, 14, ARGUMENT_NAME, "XMNACCELERATOR"}, {tkn_k_class_argument, sym_k_XmNaccelerators_arg, 15, ARGUMENT_NAME, "XMNACCELERATORS"}, {tkn_k_class_argument, sym_k_XmNacceleratorText_arg, 18, ARGUMENT_NAME, "XMNACCELERATORTEXT"}, {tkn_k_class_reason, sym_k_XmNactivateCallback_reason, 19, REASON_NAME, "XMNACTIVATECALLBACK"}, {tkn_k_class_argument, sym_k_XmNadjustLast_arg, 13, ARGUMENT_NAME, "XMNADJUSTLAST"}, {tkn_k_class_argument, sym_k_XmNadjustMargin_arg, 15, ARGUMENT_NAME, "XMNADJUSTMARGIN"}, {tkn_k_class_argument, sym_k_XmNalignment_arg, 12, ARGUMENT_NAME, "XMNALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNallowOverlap_arg, 15, ARGUMENT_NAME, "XMNALLOWOVERLAP"}, {tkn_k_class_argument, sym_k_XmNallowResize_arg, 14, ARGUMENT_NAME, "XMNALLOWRESIZE"}, {tkn_k_class_argument, sym_k_XmNallowShellResize_arg, 19, ARGUMENT_NAME, "XMNALLOWSHELLRESIZE"}, {tkn_k_class_argument, sym_k_XmNallowUnusedSpace_arg, 19, ARGUMENT_NAME, "XMNALLOWUNUSEDSPACE"}, {tkn_k_class_argument, sym_k_XmNancestorSensitive_arg, 20, ARGUMENT_NAME, "XMNANCESTORSENSITIVE"}, {tkn_k_class_argument, sym_k_XmNanyLowerString_arg, 17, ARGUMENT_NAME, "XMNANYLOWERSTRING"}, {tkn_k_class_argument, sym_k_XmNanyString_arg, 12, ARGUMENT_NAME, "XMNANYSTRING"}, {tkn_k_class_reason, sym_k_XmNapplyCallback_reason, 16, REASON_NAME, "XMNAPPLYCALLBACK"}, {tkn_k_class_argument, sym_k_XmNapplyLabelString_arg, 19, ARGUMENT_NAME, "XMNAPPLYLABELSTRING"}, {tkn_k_class_reason, sym_k_XmNarmCallback_reason, 14, REASON_NAME, "XMNARMCALLBACK"}, {tkn_k_class_argument, sym_k_XmNarmColor_arg, 11, ARGUMENT_NAME, "XMNARMCOLOR"}, {tkn_k_class_argument, sym_k_XmNarmPixmap_arg, 12, ARGUMENT_NAME, "XMNARMPIXMAP"}, {tkn_k_class_argument, sym_k_XmNarrowDirection_arg, 17, ARGUMENT_NAME, "XMNARROWDIRECTION"}, {tkn_k_class_argument, sym_k_XmNarrowLayout_arg, 14, ARGUMENT_NAME, "XMNARROWLAYOUT"}, {tkn_k_class_argument, sym_k_XmNarrowOrientation_arg, 19, ARGUMENT_NAME, "XMNARROWORIENTATION"}, {tkn_k_class_argument, sym_k_XmNarrowSensitivity_arg, 19, ARGUMENT_NAME, "XMNARROWSENSITIVITY"}, {tkn_k_class_argument, sym_k_XmNarrowSize_arg, 12, ARGUMENT_NAME, "XMNARROWSIZE"}, {tkn_k_class_argument, sym_k_XmNarrowSpacing_arg, 15, ARGUMENT_NAME, "XMNARROWSPACING"}, {tkn_k_class_argument, sym_k_XmNaudibleWarning_arg, 17, ARGUMENT_NAME, "XMNAUDIBLEWARNING"}, {tkn_k_class_argument, sym_k_XmNautoClose_arg, 12, ARGUMENT_NAME, "XMNAUTOCLOSE"}, {tkn_k_class_argument, sym_k_XmNautoDragModel_arg, 16, ARGUMENT_NAME, "XMNAUTODRAGMODEL"}, {tkn_k_class_argument, sym_k_XmNautoFill_arg, 11, ARGUMENT_NAME, "XMNAUTOFILL"}, {tkn_k_class_argument, sym_k_XmNautomaticSelection_arg, 21, ARGUMENT_NAME, "XMNAUTOMATICSELECTION"}, {tkn_k_class_argument, sym_k_XmNautoShowCursorPosition_arg, 25, ARGUMENT_NAME, "XMNAUTOSHOWCURSORPOSITION"}, {tkn_k_class_argument, sym_k_XmNautoUnmanage_arg, 15, ARGUMENT_NAME, "XMNAUTOUNMANAGE"}, {tkn_k_class_argument, sym_k_XmNbackground_arg, 13, ARGUMENT_NAME, "XMNBACKGROUND"}, {tkn_k_class_argument, sym_k_XmNbackgroundPixmap_arg, 19, ARGUMENT_NAME, "XMNBACKGROUNDPIXMAP"}, {tkn_k_class_argument, sym_k_XmNbackPageBackground_arg, 21, ARGUMENT_NAME, "XMNBACKPAGEBACKGROUND"}, {tkn_k_class_argument, sym_k_XmNbackPageForeground_arg, 21, ARGUMENT_NAME, "XMNBACKPAGEFOREGROUND"}, {tkn_k_class_argument, sym_k_XmNbackPageNumber_arg, 17, ARGUMENT_NAME, "XMNBACKPAGENUMBER"}, {tkn_k_class_argument, sym_k_XmNbackPagePlacement_arg, 20, ARGUMENT_NAME, "XMNBACKPAGEPLACEMENT"}, {tkn_k_class_argument, sym_k_XmNbackPageSize_arg, 15, ARGUMENT_NAME, "XMNBACKPAGESIZE"}, {tkn_k_class_argument, sym_k_XmNbaseHeight_arg, 13, ARGUMENT_NAME, "XMNBASEHEIGHT"}, {tkn_k_class_argument, sym_k_XmNbaseWidth_arg, 12, ARGUMENT_NAME, "XMNBASEWIDTH"}, {tkn_k_class_argument, sym_k_XmNbindingPixmap_arg, 16, ARGUMENT_NAME, "XMNBINDINGPIXMAP"}, {tkn_k_class_argument, sym_k_XmNbindingType_arg, 14, ARGUMENT_NAME, "XMNBINDINGTYPE"}, {tkn_k_class_argument, sym_k_XmNbindingWidth_arg, 15, ARGUMENT_NAME, "XMNBINDINGWIDTH"}, {tkn_k_class_argument, sym_k_XmNblinkRate_arg, 12, ARGUMENT_NAME, "XMNBLINKRATE"}, {tkn_k_class_argument, sym_k_XmNblueSliderLabel_arg, 18, ARGUMENT_NAME, "XMNBLUESLIDERLABEL"}, {tkn_k_class_argument, sym_k_XmNboldString_arg, 13, ARGUMENT_NAME, "XMNBOLDSTRING"}, {tkn_k_class_argument, sym_k_XmNborderColor_arg, 14, ARGUMENT_NAME, "XMNBORDERCOLOR"}, {tkn_k_class_argument, sym_k_XmNborderPixmap_arg, 15, ARGUMENT_NAME, "XMNBORDERPIXMAP"}, {tkn_k_class_argument, sym_k_XmNborderWidth_arg, 14, ARGUMENT_NAME, "XMNBORDERWIDTH"}, {tkn_k_class_argument, sym_k_XmNbothString_arg, 13, ARGUMENT_NAME, "XMNBOTHSTRING"}, {tkn_k_class_argument, sym_k_XmNbottomAttachment_arg, 19, ARGUMENT_NAME, "XMNBOTTOMATTACHMENT"}, {tkn_k_class_argument, sym_k_XmNbottomOffset_arg, 15, ARGUMENT_NAME, "XMNBOTTOMOFFSET"}, {tkn_k_class_argument, sym_k_XmNbottomPosition_arg, 17, ARGUMENT_NAME, "XMNBOTTOMPOSITION"}, {tkn_k_class_argument, sym_k_XmNbottomShadowColor_arg, 20, ARGUMENT_NAME, "XMNBOTTOMSHADOWCOLOR"}, {tkn_k_class_argument, sym_k_XmNbottomShadowPixmap_arg, 21, ARGUMENT_NAME, "XMNBOTTOMSHADOWPIXMAP"}, {tkn_k_class_argument, sym_k_XmNbottomWidget_arg, 15, ARGUMENT_NAME, "XMNBOTTOMWIDGET"}, {tkn_k_class_reason, sym_k_XmNbrowseSelectionCallback_reason, 26, REASON_NAME, "XMNBROWSESELECTIONCALLBACK"}, {tkn_k_class_argument, sym_k_XmNbuttonCount_arg, 14, ARGUMENT_NAME, "XMNBUTTONCOUNT"}, {tkn_k_class_argument, sym_k_XmNbuttonFontList_arg, 17, ARGUMENT_NAME, "XMNBUTTONFONTLIST"}, {tkn_k_class_argument, sym_k_XmNbuttonRenderTable_arg, 20, ARGUMENT_NAME, "XMNBUTTONRENDERTABLE"}, {tkn_k_class_argument, sym_k_XmNbuttons_arg, 10, ARGUMENT_NAME, "XMNBUTTONS"}, {tkn_k_class_argument, sym_k_XmNcancelButton_arg, 15, ARGUMENT_NAME, "XMNCANCELBUTTON"}, {tkn_k_class_reason, sym_k_XmNcancelCallback_reason, 17, REASON_NAME, "XMNCANCELCALLBACK"}, {tkn_k_class_argument, sym_k_XmNcancelLabelString_arg, 20, ARGUMENT_NAME, "XMNCANCELLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNcascadePixmap_arg, 16, ARGUMENT_NAME, "XMNCASCADEPIXMAP"}, {tkn_k_class_reason, sym_k_XmNcascadingCallback_reason, 20, REASON_NAME, "XMNCASCADINGCALLBACK"}, {tkn_k_class_argument, sym_k_XmNcellX_arg, 8, ARGUMENT_NAME, "XMNCELLX"}, {tkn_k_class_argument, sym_k_XmNcellY_arg, 8, ARGUMENT_NAME, "XMNCELLY"}, {tkn_k_class_argument, sym_k_XmNchildHorizontalAlignment_arg, 27, ARGUMENT_NAME, "XMNCHILDHORIZONTALALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNchildHorizontalSpacing_arg, 25, ARGUMENT_NAME, "XMNCHILDHORIZONTALSPACING"}, {tkn_k_class_argument, sym_k_XmNchildPlacement_arg, 17, ARGUMENT_NAME, "XMNCHILDPLACEMENT"}, {tkn_k_class_argument, sym_k_XmNchildType_arg, 12, ARGUMENT_NAME, "XMNCHILDTYPE"}, {tkn_k_class_argument, sym_k_XmNchildVerticalAlignment_arg, 25, ARGUMENT_NAME, "XMNCHILDVERTICALALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNclipWindow_arg, 13, ARGUMENT_NAME, "XMNCLIPWINDOW"}, {tkn_k_class_argument, sym_k_XmNcloseFolderPixmap_arg, 20, ARGUMENT_NAME, "XMNCLOSEFOLDERPIXMAP"}, {tkn_k_class_argument, sym_k_XmNcollapsedStatePixmap_arg, 23, ARGUMENT_NAME, "XMNCOLLAPSEDSTATEPIXMAP"}, {tkn_k_class_argument, sym_k_XmNcolorListTogLabel_arg, 20, ARGUMENT_NAME, "XMNCOLORLISTTOGLABEL"}, {tkn_k_class_argument, sym_k_XmNcolormap_arg, 11, ARGUMENT_NAME, "XMNCOLORMAP"}, {tkn_k_class_argument, sym_k_XmNcolorMode_arg, 12, ARGUMENT_NAME, "XMNCOLORMODE"}, {tkn_k_class_argument, sym_k_XmNcolorName_arg, 12, ARGUMENT_NAME, "XMNCOLORNAME"}, {tkn_k_class_argument, sym_k_XmNcolumns_arg, 10, ARGUMENT_NAME, "XMNCOLUMNS"}, {tkn_k_class_argument, sym_k_XmNcolumnTitles_arg, 15, ARGUMENT_NAME, "XMNCOLUMNTITLES"}, {tkn_k_class_argument, sym_k_XmNcomboBoxType_arg, 15, ARGUMENT_NAME, "XMNCOMBOBOXTYPE"}, {tkn_k_class_argument, sym_k_XmNcomboTranslations_arg, 20, ARGUMENT_NAME, "XMNCOMBOTRANSLATIONS"}, {tkn_k_class_argument, sym_k_XmNcommand_arg, 10, ARGUMENT_NAME, "XMNCOMMAND"}, {tkn_k_class_reason, sym_k_XmNcommandChangedCallback_reason, 25, REASON_NAME, "XMNCOMMANDCHANGEDCALLBACK"}, {tkn_k_class_reason, sym_k_XmNcommandEnteredCallback_reason, 25, REASON_NAME, "XMNCOMMANDENTEREDCALLBACK"}, {tkn_k_class_argument, sym_k_XmNcommandWindow_arg, 16, ARGUMENT_NAME, "XMNCOMMANDWINDOW"}, {tkn_k_class_argument, sym_k_XmNcommandWindowLocation_arg, 24, ARGUMENT_NAME, "XMNCOMMANDWINDOWLOCATION"}, {tkn_k_class_argument, sym_k_XmNcompressStyle_arg, 16, ARGUMENT_NAME, "XMNCOMPRESSSTYLE"}, {tkn_k_class_argument, sym_k_XmNconnectNodes_arg, 15, ARGUMENT_NAME, "XMNCONNECTNODES"}, {tkn_k_class_argument, sym_k_XmNconnectStyle_arg, 15, ARGUMENT_NAME, "XMNCONNECTSTYLE"}, {tkn_k_class_argument, sym_k_XmNconstrainWidth_arg, 17, ARGUMENT_NAME, "XMNCONSTRAINWIDTH"}, {tkn_k_class_reason, sym_k_XmNconvertCallback_reason, 18, REASON_NAME, "XMNCONVERTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNcreatePopupChildProc_arg, 23, ARGUMENT_NAME, "XMNCREATEPOPUPCHILDPROC"}, {tkn_k_class_argument, sym_k_XmNcurrentFont_arg, 14, ARGUMENT_NAME, "XMNCURRENTFONT"}, {tkn_k_class_argument, sym_k_XmNcurrentPageNumber_arg, 20, ARGUMENT_NAME, "XMNCURRENTPAGENUMBER"}, {tkn_k_class_argument, sym_k_XmNcursor_arg, 9, ARGUMENT_NAME, "XMNCURSOR"}, {tkn_k_class_argument, sym_k_XmNcursorPosition_arg, 17, ARGUMENT_NAME, "XMNCURSORPOSITION"}, {tkn_k_class_argument, sym_k_XmNcursorPositionVisible_arg, 24, ARGUMENT_NAME, "XMNCURSORPOSITIONVISIBLE"}, {tkn_k_class_argument, sym_k_XmNcustomizedCombinationBox_arg, 27, ARGUMENT_NAME, "XMNCUSTOMIZEDCOMBINATIONBOX"}, {tkn_k_class_argument, sym_k_XmNdarkThreshold_arg, 16, ARGUMENT_NAME, "XMNDARKTHRESHOLD"}, {tkn_k_class_argument, sym_k_XmNdecimal_arg, 10, ARGUMENT_NAME, "XMNDECIMAL"}, {tkn_k_class_argument, sym_k_XmNdecimalPoints_arg, 16, ARGUMENT_NAME, "XMNDECIMALPOINTS"}, {tkn_k_class_reason, sym_k_XmNdecrementCallback_reason, 20, REASON_NAME, "XMNDECREMENTCALLBACK"}, {tkn_k_class_reason, sym_k_XmNdefaultActionCallback_reason, 24, REASON_NAME, "XMNDEFAULTACTIONCALLBACK"}, {tkn_k_class_argument, sym_k_XmNdefaultArrowSensitivity_arg, 26, ARGUMENT_NAME, "XMNDEFAULTARROWSENSITIVITY"}, {tkn_k_class_argument, sym_k_XmNdefaultButton_arg, 16, ARGUMENT_NAME, "XMNDEFAULTBUTTON"}, {tkn_k_class_argument, sym_k_XmNdefaultButtonShadowThickness_arg, 31, ARGUMENT_NAME, "XMNDEFAULTBUTTONSHADOWTHICKNESS"}, {tkn_k_class_argument, sym_k_XmNdefaultButtonType_arg, 20, ARGUMENT_NAME, "XMNDEFAULTBUTTONTYPE"}, {tkn_k_class_argument, sym_k_XmNdefaultEncodingString_arg, 24, ARGUMENT_NAME, "XMNDEFAULTENCODINGSTRING"}, {tkn_k_class_argument, sym_k_XmNdefaultEntryLabelAlignment_arg, 29, ARGUMENT_NAME, "XMNDEFAULTENTRYLABELALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNdefaultEntryLabelFontList_arg, 28, ARGUMENT_NAME, "XMNDEFAULTENTRYLABELFONTLIST"}, {tkn_k_class_argument, sym_k_XmNdefaultEntryLabelRenderTable_arg, 31, ARGUMENT_NAME, "XMNDEFAULTENTRYLABELRENDERTABLE"}, {tkn_k_class_argument, sym_k_XmNdefaultFillStyle_arg, 19, ARGUMENT_NAME, "XMNDEFAULTFILLSTYLE"}, {tkn_k_class_argument, sym_k_XmNdefaultFontList_arg, 18, ARGUMENT_NAME, "XMNDEFAULTFONTLIST"}, {tkn_k_class_argument, sym_k_XmNdefaultPosition_arg, 18, ARGUMENT_NAME, "XMNDEFAULTPOSITION"}, {tkn_k_class_argument, sym_k_XmNdeleteResponse_arg, 17, ARGUMENT_NAME, "XMNDELETERESPONSE"}, {tkn_k_class_argument, sym_k_XmNdepth_arg, 8, ARGUMENT_NAME, "XMNDEPTH"}, {tkn_k_class_reason, sym_k_XmNdestinationCallback_reason, 22, REASON_NAME, "XMNDESTINATIONCALLBACK"}, {tkn_k_class_reason, sym_k_XmNdestroyCallback_reason, 18, REASON_NAME, "XMNDESTROYCALLBACK"}, {tkn_k_class_argument, sym_k_XmNdetail_arg, 9, ARGUMENT_NAME, "XMNDETAIL"}, {tkn_k_class_argument, sym_k_XmNdetailColumnHeading_arg, 22, ARGUMENT_NAME, "XMNDETAILCOLUMNHEADING"}, {tkn_k_class_argument, sym_k_XmNdetailColumnHeadingCount_arg, 27, ARGUMENT_NAME, "XMNDETAILCOLUMNHEADINGCOUNT"}, {tkn_k_class_argument, sym_k_XmNdetailCount_arg, 14, ARGUMENT_NAME, "XMNDETAILCOUNT"}, {tkn_k_class_argument, sym_k_XmNdetailOrder_arg, 14, ARGUMENT_NAME, "XMNDETAILORDER"}, {tkn_k_class_argument, sym_k_XmNdetailOrderCount_arg, 19, ARGUMENT_NAME, "XMNDETAILORDERCOUNT"}, {tkn_k_class_argument, sym_k_XmNdetailShadowThickness_arg, 24, ARGUMENT_NAME, "XMNDETAILSHADOWTHICKNESS"}, {tkn_k_class_argument, sym_k_XmNdetailTabList_arg, 16, ARGUMENT_NAME, "XMNDETAILTABLIST"}, {tkn_k_class_argument, sym_k_XmNdialogStyle_arg, 14, ARGUMENT_NAME, "XMNDIALOGSTYLE"}, {tkn_k_class_argument, sym_k_XmNdialogTitle_arg, 14, ARGUMENT_NAME, "XMNDIALOGTITLE"}, {tkn_k_class_argument, sym_k_XmNdialogType_arg, 13, ARGUMENT_NAME, "XMNDIALOGTYPE"}, {tkn_k_class_argument, sym_k_XmNdirectory_arg, 12, ARGUMENT_NAME, "XMNDIRECTORY"}, {tkn_k_class_argument, sym_k_XmNdirectoryValid_arg, 17, ARGUMENT_NAME, "XMNDIRECTORYVALID"}, {tkn_k_class_argument, sym_k_XmNdirListItemCount_arg, 19, ARGUMENT_NAME, "XMNDIRLISTITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNdirListItems_arg, 15, ARGUMENT_NAME, "XMNDIRLISTITEMS"}, {tkn_k_class_argument, sym_k_XmNdirListLabelString_arg, 21, ARGUMENT_NAME, "XMNDIRLISTLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNdirMask_arg, 10, ARGUMENT_NAME, "XMNDIRMASK"}, {tkn_k_class_argument, sym_k_XmNdirSearchProc_arg, 16, ARGUMENT_NAME, "XMNDIRSEARCHPROC"}, {tkn_k_class_argument, sym_k_XmNdirSpec_arg, 10, ARGUMENT_NAME, "XMNDIRSPEC"}, {tkn_k_class_reason, sym_k_XmNdisarmCallback_reason, 17, REASON_NAME, "XMNDISARMCALLBACK"}, {tkn_k_class_argument, sym_k_XmNdistribution_arg, 15, ARGUMENT_NAME, "XMNDISTRIBUTION"}, {tkn_k_class_reason, sym_k_XmNdoubleClickCallback_reason, 22, REASON_NAME, "XMNDOUBLECLICKCALLBACK"}, {tkn_k_class_argument, sym_k_XmNdoubleClickInterval_arg, 22, ARGUMENT_NAME, "XMNDOUBLECLICKINTERVAL"}, {tkn_k_class_reason, sym_k_XmNdragCallback_reason, 15, REASON_NAME, "XMNDRAGCALLBACK"}, {tkn_k_class_enumval, sym_k_XmNEAR_BORDER_enumval, 13, ENUMVAL_NAME, "XMNEAR_BORDER"}, {tkn_k_class_enumval, sym_k_XmNEAR_SLIDER_enumval, 13, ENUMVAL_NAME, "XMNEAR_SLIDER"}, {tkn_k_class_argument, sym_k_XmNeditable_arg, 11, ARGUMENT_NAME, "XMNEDITABLE"}, {tkn_k_class_argument, sym_k_XmNeditMode_arg, 11, ARGUMENT_NAME, "XMNEDITMODE"}, {tkn_k_class_argument, sym_k_XmNencodingList_arg, 15, ARGUMENT_NAME, "XMNENCODINGLIST"}, {tkn_k_class_argument, sym_k_XmNencodingString_arg, 17, ARGUMENT_NAME, "XMNENCODINGSTRING"}, {tkn_k_class_argument, sym_k_XmNentryAlignment_arg, 17, ARGUMENT_NAME, "XMNENTRYALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNentryBackground_arg, 18, ARGUMENT_NAME, "XMNENTRYBACKGROUND"}, {tkn_k_class_argument, sym_k_XmNentryBorder_arg, 14, ARGUMENT_NAME, "XMNENTRYBORDER"}, {tkn_k_class_reason, sym_k_XmNentryCallback_reason, 16, REASON_NAME, "XMNENTRYCALLBACK"}, {tkn_k_class_argument, sym_k_XmNentryClass_arg, 13, ARGUMENT_NAME, "XMNENTRYCLASS"}, {tkn_k_class_argument, sym_k_XmNentryData_arg, 12, ARGUMENT_NAME, "XMNENTRYDATA"}, {tkn_k_class_argument, sym_k_XmNentryLabelAlignment_arg, 22, ARGUMENT_NAME, "XMNENTRYLABELALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNentryLabelFontList_arg, 21, ARGUMENT_NAME, "XMNENTRYLABELFONTLIST"}, {tkn_k_class_argument, sym_k_XmNentryLabelPixmap_arg, 19, ARGUMENT_NAME, "XMNENTRYLABELPIXMAP"}, {tkn_k_class_argument, sym_k_XmNentryLabelRenderTable_arg, 24, ARGUMENT_NAME, "XMNENTRYLABELRENDERTABLE"}, {tkn_k_class_argument, sym_k_XmNentryLabelString_arg, 19, ARGUMENT_NAME, "XMNENTRYLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNentryLabelType_arg, 17, ARGUMENT_NAME, "XMNENTRYLABELTYPE"}, {tkn_k_class_argument, sym_k_XmNentryParent_arg, 14, ARGUMENT_NAME, "XMNENTRYPARENT"}, {tkn_k_class_argument, sym_k_XmNentryVerticalAlignment_arg, 25, ARGUMENT_NAME, "XMNENTRYVERTICALALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNentryViewType_arg, 16, ARGUMENT_NAME, "XMNENTRYVIEWTYPE"}, {tkn_k_class_argument, sym_k_XmNequalSize_arg, 12, ARGUMENT_NAME, "XMNEQUALSIZE"}, {tkn_k_class_argument, sym_k_XmNexpandedStatePixmap_arg, 22, ARGUMENT_NAME, "XMNEXPANDEDSTATEPIXMAP"}, {tkn_k_class_reason, sym_k_XmNexposeCallback_reason, 17, REASON_NAME, "XMNEXPOSECALLBACK"}, {tkn_k_class_reason, sym_k_XmNextendedSelectionCallback_reason, 28, REASON_NAME, "XMNEXTENDEDSELECTIONCALLBACK"}, {tkn_k_class_argument, sym_k_XmNfamilyString_arg, 15, ARGUMENT_NAME, "XMNFAMILYSTRING"}, {tkn_k_class_argument, sym_k_XmNfileListItemCount_arg, 20, ARGUMENT_NAME, "XMNFILELISTITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNfileListItems_arg, 16, ARGUMENT_NAME, "XMNFILELISTITEMS"}, {tkn_k_class_argument, sym_k_XmNfileListLabelString_arg, 22, ARGUMENT_NAME, "XMNFILELISTLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNfileReadError_arg, 16, ARGUMENT_NAME, "XMNFILEREADERROR"}, {tkn_k_class_argument, sym_k_XmNfileSearchProc_arg, 17, ARGUMENT_NAME, "XMNFILESEARCHPROC"}, {tkn_k_class_argument, sym_k_XmNfileTypeMask_arg, 15, ARGUMENT_NAME, "XMNFILETYPEMASK"}, {tkn_k_class_argument, sym_k_XmNfillOnArm_arg, 12, ARGUMENT_NAME, "XMNFILLONARM"}, {tkn_k_class_argument, sym_k_XmNfillOnSelect_arg, 15, ARGUMENT_NAME, "XMNFILLONSELECT"}, {tkn_k_class_argument, sym_k_XmNfillOption_arg, 13, ARGUMENT_NAME, "XMNFILLOPTION"}, {tkn_k_class_argument, sym_k_XmNfillStyle_arg, 12, ARGUMENT_NAME, "XMNFILLSTYLE"}, {tkn_k_class_argument, sym_k_XmNfilterLabelString_arg, 20, ARGUMENT_NAME, "XMNFILTERLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNfindLabel_arg, 12, ARGUMENT_NAME, "XMNFINDLABEL"}, {tkn_k_class_argument, sym_k_XmNfirstColumn_arg, 14, ARGUMENT_NAME, "XMNFIRSTCOLUMN"}, {tkn_k_class_argument, sym_k_XmNfirstColumnPixmaps_arg, 21, ARGUMENT_NAME, "XMNFIRSTCOLUMNPIXMAPS"}, {tkn_k_class_argument, sym_k_XmNfirstPageNumber_arg, 18, ARGUMENT_NAME, "XMNFIRSTPAGENUMBER"}, {tkn_k_class_argument, sym_k_XmNfirstRow_arg, 11, ARGUMENT_NAME, "XMNFIRSTROW"}, {tkn_k_class_reason, sym_k_XmNfocusCallback_reason, 16, REASON_NAME, "XMNFOCUSCALLBACK"}, {tkn_k_class_reason, sym_k_XmNfocusMovedCallback_reason, 21, REASON_NAME, "XMNFOCUSMOVEDCALLBACK"}, {tkn_k_class_argument, sym_k_XmNfont_arg, 7, ARGUMENT_NAME, "XMNFONT"}, {tkn_k_class_argument, sym_k_XmNfontEncoding_arg, 15, ARGUMENT_NAME, "XMNFONTENCODING"}, {tkn_k_class_argument, sym_k_XmNfontFoundry_arg, 14, ARGUMENT_NAME, "XMNFONTFOUNDRY"}, {tkn_k_class_argument, sym_k_XmNfontList_arg, 11, ARGUMENT_NAME, "XMNFONTLIST"}, {tkn_k_class_argument, sym_k_XmNfontName_arg, 11, ARGUMENT_NAME, "XMNFONTNAME"}, {tkn_k_class_argument, sym_k_XmNfontSize_arg, 11, ARGUMENT_NAME, "XMNFONTSIZE"}, {tkn_k_class_argument, sym_k_XmNfontStyle_arg, 12, ARGUMENT_NAME, "XMNFONTSTYLE"}, {tkn_k_class_argument, sym_k_XmNfontType_arg, 11, ARGUMENT_NAME, "XMNFONTTYPE"}, {tkn_k_class_argument, sym_k_XmNforeground_arg, 13, ARGUMENT_NAME, "XMNFOREGROUND"}, {tkn_k_class_argument, sym_k_XmNforegroundThreshold_arg, 22, ARGUMENT_NAME, "XMNFOREGROUNDTHRESHOLD"}, {tkn_k_class_argument, sym_k_XmNfractionBase_arg, 15, ARGUMENT_NAME, "XMNFRACTIONBASE"}, {tkn_k_class_argument, sym_k_XmNframeBackground_arg, 18, ARGUMENT_NAME, "XMNFRAMEBACKGROUND"}, {tkn_k_class_argument, sym_k_XmNframeChildType_arg, 17, ARGUMENT_NAME, "XMNFRAMECHILDTYPE"}, {tkn_k_class_argument, sym_k_XmNframeShadowThickness_arg, 23, ARGUMENT_NAME, "XMNFRAMESHADOWTHICKNESS"}, {tkn_k_class_argument, sym_k_XmNfreeTabPixmap_arg, 16, ARGUMENT_NAME, "XMNFREETABPIXMAP"}, {tkn_k_class_reason, sym_k_XmNgainPrimaryCallback_reason, 22, REASON_NAME, "XMNGAINPRIMARYCALLBACK"}, {tkn_k_class_argument, sym_k_XmNgeometry_arg, 11, ARGUMENT_NAME, "XMNGEOMETRY"}, {tkn_k_class_argument, sym_k_XmNgreenSliderLabel_arg, 19, ARGUMENT_NAME, "XMNGREENSLIDERLABEL"}, {tkn_k_class_argument, sym_k_XmNheight_arg, 9, ARGUMENT_NAME, "XMNHEIGHT"}, {tkn_k_class_argument, sym_k_XmNheightInc_arg, 12, ARGUMENT_NAME, "XMNHEIGHTINC"}, {tkn_k_class_reason, sym_k_XmNhelpCallback_reason, 15, REASON_NAME, "XMNHELPCALLBACK"}, {tkn_k_class_argument, sym_k_XmNhelpLabelString_arg, 18, ARGUMENT_NAME, "XMNHELPLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNhighlightColor_arg, 17, ARGUMENT_NAME, "XMNHIGHLIGHTCOLOR"}, {tkn_k_class_argument, sym_k_XmNhighlightOnEnter_arg, 19, ARGUMENT_NAME, "XMNHIGHLIGHTONENTER"}, {tkn_k_class_argument, sym_k_XmNhighlightPixmap_arg, 18, ARGUMENT_NAME, "XMNHIGHLIGHTPIXMAP"}, {tkn_k_class_argument, sym_k_XmNhighlightThickness_arg, 21, ARGUMENT_NAME, "XMNHIGHLIGHTTHICKNESS"}, {tkn_k_class_argument, sym_k_XmNhistoryItemCount_arg, 19, ARGUMENT_NAME, "XMNHISTORYITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNhistoryItems_arg, 15, ARGUMENT_NAME, "XMNHISTORYITEMS"}, {tkn_k_class_argument, sym_k_XmNhistoryMaxItems_arg, 18, ARGUMENT_NAME, "XMNHISTORYMAXITEMS"}, {tkn_k_class_argument, sym_k_XmNhistoryVisibleItemCount_arg, 26, ARGUMENT_NAME, "XMNHISTORYVISIBLEITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNhorizontalDelta_arg, 18, ARGUMENT_NAME, "XMNHORIZONTALDELTA"}, {tkn_k_class_argument, sym_k_XmNhorizontalMargin_arg, 19, ARGUMENT_NAME, "XMNHORIZONTALMARGIN"}, {tkn_k_class_argument, sym_k_XmNhorizontalNodeSpace_arg, 22, ARGUMENT_NAME, "XMNHORIZONTALNODESPACE"}, {tkn_k_class_argument, sym_k_XmNhorizontalScrollBar_arg, 22, ARGUMENT_NAME, "XMNHORIZONTALSCROLLBAR"}, {tkn_k_class_argument, sym_k_XmNhorizontalSpacing_arg, 20, ARGUMENT_NAME, "XMNHORIZONTALSPACING"}, {tkn_k_class_argument, sym_k_XmNiconic_arg, 9, ARGUMENT_NAME, "XMNICONIC"}, {tkn_k_class_argument, sym_k_XmNiconMask_arg, 11, ARGUMENT_NAME, "XMNICONMASK"}, {tkn_k_class_argument, sym_k_XmNiconName_arg, 11, ARGUMENT_NAME, "XMNICONNAME"}, {tkn_k_class_argument, sym_k_XmNiconNameEncoding_arg, 19, ARGUMENT_NAME, "XMNICONNAMEENCODING"}, {tkn_k_class_argument, sym_k_XmNiconPixmap_arg, 13, ARGUMENT_NAME, "XMNICONPIXMAP"}, {tkn_k_class_argument, sym_k_XmNiconPlacement_arg, 16, ARGUMENT_NAME, "XMNICONPLACEMENT"}, {tkn_k_class_argument, sym_k_XmNiconTextPadding_arg, 18, ARGUMENT_NAME, "XMNICONTEXTPADDING"}, {tkn_k_class_argument, sym_k_XmNiconWindow_arg, 13, ARGUMENT_NAME, "XMNICONWINDOW"}, {tkn_k_class_argument, sym_k_XmNiconX_arg, 8, ARGUMENT_NAME, "XMNICONX"}, {tkn_k_class_argument, sym_k_XmNiconY_arg, 8, ARGUMENT_NAME, "XMNICONY"}, {tkn_k_class_argument, sym_k_XmNincrement_arg, 12, ARGUMENT_NAME, "XMNINCREMENT"}, {tkn_k_class_reason, sym_k_XmNincrementCallback_reason, 20, REASON_NAME, "XMNINCREMENTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNincrementValue_arg, 17, ARGUMENT_NAME, "XMNINCREMENTVALUE"}, {tkn_k_class_argument, sym_k_XmNindentSpace_arg, 14, ARGUMENT_NAME, "XMNINDENTSPACE"}, {tkn_k_class_argument, sym_k_XmNindeterminateInsensitivePixmap_arg, 33, ARGUMENT_NAME, "XMNINDETERMINATEINSENSITIVEPIXMAP"}, {tkn_k_class_argument, sym_k_XmNindeterminatePixmap_arg, 22, ARGUMENT_NAME, "XMNINDETERMINATEPIXMAP"}, {tkn_k_class_argument, sym_k_XmNindicatorOn_arg, 14, ARGUMENT_NAME, "XMNINDICATORON"}, {tkn_k_class_argument, sym_k_XmNindicatorSize_arg, 16, ARGUMENT_NAME, "XMNINDICATORSIZE"}, {tkn_k_class_argument, sym_k_XmNindicatorType_arg, 16, ARGUMENT_NAME, "XMNINDICATORTYPE"}, {tkn_k_class_argument, sym_k_XmNinitialDelay_arg, 15, ARGUMENT_NAME, "XMNINITIALDELAY"}, {tkn_k_class_argument, sym_k_XmNinitialFocus_arg, 15, ARGUMENT_NAME, "XMNINITIALFOCUS"}, {tkn_k_class_argument, sym_k_XmNinitialResourcesPersistent_arg, 29, ARGUMENT_NAME, "XMNINITIALRESOURCESPERSISTENT"}, {tkn_k_class_argument, sym_k_XmNinitialState_arg, 15, ARGUMENT_NAME, "XMNINITIALSTATE"}, {tkn_k_class_argument, sym_k_XmNinnerMarginHeight_arg, 20, ARGUMENT_NAME, "XMNINNERMARGINHEIGHT"}, {tkn_k_class_argument, sym_k_XmNinnerMarginWidth_arg, 19, ARGUMENT_NAME, "XMNINNERMARGINWIDTH"}, {tkn_k_class_argument, sym_k_XmNinput_arg, 8, ARGUMENT_NAME, "XMNINPUT"}, {tkn_k_class_reason, sym_k_XmNinputCallback_reason, 16, REASON_NAME, "XMNINPUTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNinputMethod_arg, 14, ARGUMENT_NAME, "XMNINPUTMETHOD"}, {tkn_k_class_argument, sym_k_XmNinputPolicy_arg, 14, ARGUMENT_NAME, "XMNINPUTPOLICY"}, {tkn_k_class_argument, sym_k_XmNinsertBefore_arg, 15, ARGUMENT_NAME, "XMNINSERTBEFORE"}, {tkn_k_class_argument, sym_k_XmNinsertPosition_arg, 17, ARGUMENT_NAME, "XMNINSERTPOSITION"}, {tkn_k_class_argument, sym_k_XmNisAligned_arg, 12, ARGUMENT_NAME, "XMNISALIGNED"}, {tkn_k_class_argument, sym_k_XmNisHomogeneous_arg, 16, ARGUMENT_NAME, "XMNISHOMOGENEOUS"}, {tkn_k_class_argument, sym_k_XmNitalicString_arg, 15, ARGUMENT_NAME, "XMNITALICSTRING"}, {tkn_k_class_argument, sym_k_XmNitemCount_arg, 12, ARGUMENT_NAME, "XMNITEMCOUNT"}, {tkn_k_class_reason, sym_k_XmNitemFoundCallback_reason, 20, REASON_NAME, "XMNITEMFOUNDCALLBACK"}, {tkn_k_class_reason, sym_k_XmNitemNotFoundCallback_reason, 23, REASON_NAME, "XMNITEMNOTFOUNDCALLBACK"}, {tkn_k_class_argument, sym_k_XmNitems_arg, 8, ARGUMENT_NAME, "XMNITEMS"}, {tkn_k_class_argument, sym_k_XmNitemSpacing_arg, 14, ARGUMENT_NAME, "XMNITEMSPACING"}, {tkn_k_class_argument, sym_k_XmNkeyboardFocusPolicy_arg, 22, ARGUMENT_NAME, "XMNKEYBOARDFOCUSPOLICY"}, {tkn_k_class_argument, sym_k_XmNlabel_arg, 8, ARGUMENT_NAME, "XMNLABEL"}, {tkn_k_class_argument, sym_k_XmNlabelFontList_arg, 16, ARGUMENT_NAME, "XMNLABELFONTLIST"}, {tkn_k_class_argument, sym_k_XmNlabelInsensitivePixmap_arg, 25, ARGUMENT_NAME, "XMNLABELINSENSITIVEPIXMAP"}, {tkn_k_class_argument, sym_k_XmNlabelPixmap_arg, 14, ARGUMENT_NAME, "XMNLABELPIXMAP"}, {tkn_k_class_argument, sym_k_XmNlabelRenderTable_arg, 19, ARGUMENT_NAME, "XMNLABELRENDERTABLE"}, {tkn_k_class_argument, sym_k_XmNlabelSpacing_arg, 15, ARGUMENT_NAME, "XMNLABELSPACING"}, {tkn_k_class_argument, sym_k_XmNlabelString_arg, 14, ARGUMENT_NAME, "XMNLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNlabelType_arg, 12, ARGUMENT_NAME, "XMNLABELTYPE"}, {tkn_k_class_argument, sym_k_XmNlargeCellHeight_arg, 18, ARGUMENT_NAME, "XMNLARGECELLHEIGHT"}, {tkn_k_class_argument, sym_k_XmNlargeCellWidth_arg, 17, ARGUMENT_NAME, "XMNLARGECELLWIDTH"}, {tkn_k_class_argument, sym_k_XmNlargeIconMask_arg, 16, ARGUMENT_NAME, "XMNLARGEICONMASK"}, {tkn_k_class_argument, sym_k_XmNlargeIconPixmap_arg, 18, ARGUMENT_NAME, "XMNLARGEICONPIXMAP"}, {tkn_k_class_argument, sym_k_XmNlargeIconX_arg, 13, ARGUMENT_NAME, "XMNLARGEICONX"}, {tkn_k_class_argument, sym_k_XmNlargeIconY_arg, 13, ARGUMENT_NAME, "XMNLARGEICONY"}, {tkn_k_class_argument, sym_k_XmNlastPageNumber_arg, 17, ARGUMENT_NAME, "XMNLASTPAGENUMBER"}, {tkn_k_class_argument, sym_k_XmNlayoutDirection_arg, 18, ARGUMENT_NAME, "XMNLAYOUTDIRECTION"}, {tkn_k_class_argument, sym_k_XmNlayoutType_arg, 13, ARGUMENT_NAME, "XMNLAYOUTTYPE"}, {tkn_k_class_argument, sym_k_XmNleftAttachment_arg, 17, ARGUMENT_NAME, "XMNLEFTATTACHMENT"}, {tkn_k_class_argument, sym_k_XmNleftOffset_arg, 13, ARGUMENT_NAME, "XMNLEFTOFFSET"}, {tkn_k_class_argument, sym_k_XmNleftPosition_arg, 15, ARGUMENT_NAME, "XMNLEFTPOSITION"}, {tkn_k_class_argument, sym_k_XmNleftWidget_arg, 13, ARGUMENT_NAME, "XMNLEFTWIDGET"}, {tkn_k_class_argument, sym_k_XmNlightThreshold_arg, 17, ARGUMENT_NAME, "XMNLIGHTTHRESHOLD"}, {tkn_k_class_argument, sym_k_XmNlineBackgroundColor_arg, 22, ARGUMENT_NAME, "XMNLINEBACKGROUNDCOLOR"}, {tkn_k_class_argument, sym_k_XmNlineColor_arg, 12, ARGUMENT_NAME, "XMNLINECOLOR"}, {tkn_k_class_argument, sym_k_XmNlineStyle_arg, 12, ARGUMENT_NAME, "XMNLINESTYLE"}, {tkn_k_class_argument, sym_k_XmNlineWidth_arg, 12, ARGUMENT_NAME, "XMNLINEWIDTH"}, {tkn_k_class_argument, sym_k_XmNlist_arg, 7, ARGUMENT_NAME, "XMNLIST"}, {tkn_k_class_argument, sym_k_XmNlistItemCount_arg, 16, ARGUMENT_NAME, "XMNLISTITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNlistItems_arg, 12, ARGUMENT_NAME, "XMNLISTITEMS"}, {tkn_k_class_argument, sym_k_XmNlistLabelString_arg, 18, ARGUMENT_NAME, "XMNLISTLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNlistMarginHeight_arg, 19, ARGUMENT_NAME, "XMNLISTMARGINHEIGHT"}, {tkn_k_class_argument, sym_k_XmNlistMarginWidth_arg, 18, ARGUMENT_NAME, "XMNLISTMARGINWIDTH"}, {tkn_k_class_argument, sym_k_XmNlistSizePolicy_arg, 17, ARGUMENT_NAME, "XMNLISTSIZEPOLICY"}, {tkn_k_class_argument, sym_k_XmNlistSpacing_arg, 14, ARGUMENT_NAME, "XMNLISTSPACING"}, {tkn_k_class_argument, sym_k_XmNlistUpdated_arg, 14, ARGUMENT_NAME, "XMNLISTUPDATED"}, {tkn_k_class_argument, sym_k_XmNlistVisibleItemCount_arg, 23, ARGUMENT_NAME, "XMNLISTVISIBLEITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNloadModel_arg, 12, ARGUMENT_NAME, "XMNLOADMODEL"}, {tkn_k_class_reason, sym_k_XmNlosePrimaryCallback_reason, 22, REASON_NAME, "XMNLOSEPRIMARYCALLBACK"}, {tkn_k_class_reason, sym_k_XmNlosingFocusCallback_reason, 22, REASON_NAME, "XMNLOSINGFOCUSCALLBACK"}, {tkn_k_class_argument, sym_k_XmNmainWindowMarginHeight_arg, 25, ARGUMENT_NAME, "XMNMAINWINDOWMARGINHEIGHT"}, {tkn_k_class_argument, sym_k_XmNmainWindowMarginWidth_arg, 24, ARGUMENT_NAME, "XMNMAINWINDOWMARGINWIDTH"}, {tkn_k_class_argument, sym_k_XmNmajorTabSpacing_arg, 18, ARGUMENT_NAME, "XMNMAJORTABSPACING"}, {tkn_k_class_reason, sym_k_XmNmapCallback_reason, 14, REASON_NAME, "XMNMAPCALLBACK"}, {tkn_k_class_argument, sym_k_XmNmappedWhenManaged_arg, 20, ARGUMENT_NAME, "XMNMAPPEDWHENMANAGED"}, {tkn_k_class_argument, sym_k_XmNmappingDelay_arg, 15, ARGUMENT_NAME, "XMNMAPPINGDELAY"}, {tkn_k_class_argument, sym_k_XmNmargin_arg, 9, ARGUMENT_NAME, "XMNMARGIN"}, {tkn_k_class_argument, sym_k_XmNmarginBottom_arg, 15, ARGUMENT_NAME, "XMNMARGINBOTTOM"}, {tkn_k_class_argument, sym_k_XmNmarginHeight_arg, 15, ARGUMENT_NAME, "XMNMARGINHEIGHT"}, {tkn_k_class_argument, sym_k_XmNmarginLeft_arg, 13, ARGUMENT_NAME, "XMNMARGINLEFT"}, {tkn_k_class_argument, sym_k_XmNmarginRight_arg, 14, ARGUMENT_NAME, "XMNMARGINRIGHT"}, {tkn_k_class_argument, sym_k_XmNmarginTop_arg, 12, ARGUMENT_NAME, "XMNMARGINTOP"}, {tkn_k_class_argument, sym_k_XmNmarginWidth_arg, 14, ARGUMENT_NAME, "XMNMARGINWIDTH"}, {tkn_k_class_argument, sym_k_XmNmatchBehavior_arg, 16, ARGUMENT_NAME, "XMNMATCHBEHAVIOR"}, {tkn_k_class_argument, sym_k_XmNmaxAspectX_arg, 13, ARGUMENT_NAME, "XMNMAXASPECTX"}, {tkn_k_class_argument, sym_k_XmNmaxAspectY_arg, 13, ARGUMENT_NAME, "XMNMAXASPECTY"}, {tkn_k_class_argument, sym_k_XmNmaxHeight_arg, 12, ARGUMENT_NAME, "XMNMAXHEIGHT"}, {tkn_k_class_argument, sym_k_XmNmaximum_arg, 10, ARGUMENT_NAME, "XMNMAXIMUM"}, {tkn_k_class_argument, sym_k_XmNmaximumValue_arg, 15, ARGUMENT_NAME, "XMNMAXIMUMVALUE"}, {tkn_k_class_argument, sym_k_XmNmaxLength_arg, 12, ARGUMENT_NAME, "XMNMAXLENGTH"}, {tkn_k_class_argument, sym_k_XmNmaxWidth_arg, 11, ARGUMENT_NAME, "XMNMAXWIDTH"}, {tkn_k_class_argument, sym_k_XmNmenuAccelerator_arg, 18, ARGUMENT_NAME, "XMNMENUACCELERATOR"}, {tkn_k_class_argument, sym_k_XmNmenuBar_arg, 10, ARGUMENT_NAME, "XMNMENUBAR"}, {tkn_k_class_argument, sym_k_XmNmenuHelpWidget_arg, 17, ARGUMENT_NAME, "XMNMENUHELPWIDGET"}, {tkn_k_class_argument, sym_k_XmNmenuHistory_arg, 14, ARGUMENT_NAME, "XMNMENUHISTORY"}, {tkn_k_class_argument, sym_k_XmNmenuPost_arg, 11, ARGUMENT_NAME, "XMNMENUPOST"}, {tkn_k_class_argument, sym_k_XmNmessageAlignment_arg, 19, ARGUMENT_NAME, "XMNMESSAGEALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNmessageString_arg, 16, ARGUMENT_NAME, "XMNMESSAGESTRING"}, {tkn_k_class_argument, sym_k_XmNmessageWindow_arg, 16, ARGUMENT_NAME, "XMNMESSAGEWINDOW"}, {tkn_k_class_argument, sym_k_XmNminAspectX_arg, 13, ARGUMENT_NAME, "XMNMINASPECTX"}, {tkn_k_class_argument, sym_k_XmNminAspectY_arg, 13, ARGUMENT_NAME, "XMNMINASPECTY"}, {tkn_k_class_argument, sym_k_XmNminHeight_arg, 12, ARGUMENT_NAME, "XMNMINHEIGHT"}, {tkn_k_class_argument, sym_k_XmNminimizeButtons_arg, 18, ARGUMENT_NAME, "XMNMINIMIZEBUTTONS"}, {tkn_k_class_argument, sym_k_XmNminimum_arg, 10, ARGUMENT_NAME, "XMNMINIMUM"}, {tkn_k_class_argument, sym_k_XmNminimumCellHeight_arg, 20, ARGUMENT_NAME, "XMNMINIMUMCELLHEIGHT"}, {tkn_k_class_argument, sym_k_XmNminimumCellWidth_arg, 19, ARGUMENT_NAME, "XMNMINIMUMCELLWIDTH"}, {tkn_k_class_argument, sym_k_XmNminimumHorizontalCells_arg, 25, ARGUMENT_NAME, "XMNMINIMUMHORIZONTALCELLS"}, {tkn_k_class_argument, sym_k_XmNminimumValue_arg, 15, ARGUMENT_NAME, "XMNMINIMUMVALUE"}, {tkn_k_class_argument, sym_k_XmNminimumVerticalCells_arg, 23, ARGUMENT_NAME, "XMNMINIMUMVERTICALCELLS"}, {tkn_k_class_argument, sym_k_XmNminorTabSpacing_arg, 18, ARGUMENT_NAME, "XMNMINORTABSPACING"}, {tkn_k_class_argument, sym_k_XmNminWidth_arg, 11, ARGUMENT_NAME, "XMNMINWIDTH"}, {tkn_k_class_argument, sym_k_XmNmnemonic_arg, 11, ARGUMENT_NAME, "XMNMNEMONIC"}, {tkn_k_class_argument, sym_k_XmNmnemonicCharSet_arg, 18, ARGUMENT_NAME, "XMNMNEMONICCHARSET"}, {tkn_k_class_reason, sym_k_XmNmodifyVerifyCallback_reason, 23, REASON_NAME, "XMNMODIFYVERIFYCALLBACK"}, {tkn_k_class_reason, sym_k_XmNmodifyVerifyCallbackWcs_reason, 26, REASON_NAME, "XMNMODIFYVERIFYCALLBACKWCS"}, {tkn_k_class_argument, sym_k_XmNmonoSpaceString_arg, 18, ARGUMENT_NAME, "XMNMONOSPACESTRING"}, {tkn_k_class_reason, sym_k_XmNmotionVerifyCallback_reason, 23, REASON_NAME, "XMNMOTIONVERIFYCALLBACK"}, {tkn_k_class_argument, sym_k_XmNmultiClick_arg, 13, ARGUMENT_NAME, "XMNMULTICLICK"}, {tkn_k_class_reason, sym_k_XmNmultipleSelectionCallback_reason, 28, REASON_NAME, "XMNMULTIPLESELECTIONCALLBACK"}, {tkn_k_class_argument, sym_k_XmNmustMatch_arg, 12, ARGUMENT_NAME, "XMNMUSTMATCH"}, {tkn_k_class_argument, sym_k_XmNmwmDecorations_arg, 17, ARGUMENT_NAME, "XMNMWMDECORATIONS"}, {tkn_k_class_argument, sym_k_XmNmwmFunctions_arg, 15, ARGUMENT_NAME, "XMNMWMFUNCTIONS"}, {tkn_k_class_argument, sym_k_XmNmwmInputMode_arg, 15, ARGUMENT_NAME, "XMNMWMINPUTMODE"}, {tkn_k_class_argument, sym_k_XmNmwmMenu_arg, 10, ARGUMENT_NAME, "XMNMWMMENU"}, {tkn_k_class_argument, sym_k_XmNnavigationType_arg, 17, ARGUMENT_NAME, "XMNNAVIGATIONTYPE"}, {tkn_k_class_argument, sym_k_XmNnewVisualStyle_arg, 17, ARGUMENT_NAME, "XMNNEWVISUALSTYLE"}, {tkn_k_class_argument, sym_k_XmNnoCellError_arg, 14, ARGUMENT_NAME, "XMNNOCELLERROR"}, {tkn_k_class_argument, sym_k_XmNnodeCloseFolderPixmap_arg, 24, ARGUMENT_NAME, "XMNNODECLOSEFOLDERPIXMAP"}, {tkn_k_class_argument, sym_k_XmNnodeOpenFolderPixmap_arg, 23, ARGUMENT_NAME, "XMNNODEOPENFOLDERPIXMAP"}, {tkn_k_class_argument, sym_k_XmNnodeState_arg, 12, ARGUMENT_NAME, "XMNNODESTATE"}, {tkn_k_class_reason, sym_k_XmNnodeStateBegEndCallback_reason, 26, REASON_NAME, "XMNNODESTATEBEGENDCALLBACK"}, {tkn_k_class_reason, sym_k_XmNnodeStateCallback_reason, 20, REASON_NAME, "XMNNODESTATECALLBACK"}, {tkn_k_class_reason, sym_k_XmNnodeStateChangedCallback_reason, 27, REASON_NAME, "XMNNODESTATECHANGEDCALLBACK"}, {tkn_k_class_reason, sym_k_XmNnoMatchCallback_reason, 18, REASON_NAME, "XMNNOMATCHCALLBACK"}, {tkn_k_class_argument, sym_k_XmNnoMatchString_arg, 16, ARGUMENT_NAME, "XMNNOMATCHSTRING"}, {tkn_k_class_argument, sym_k_XmNnoResize_arg, 11, ARGUMENT_NAME, "XMNNORESIZE"}, {tkn_k_class_argument, sym_k_XmNnotebookChildType_arg, 20, ARGUMENT_NAME, "XMNNOTEBOOKCHILDTYPE"}, {tkn_k_class_argument, sym_k_XmNnumColumns_arg, 13, ARGUMENT_NAME, "XMNNUMCOLUMNS"}, {tkn_k_class_argument, sym_k_XmNnumRows_arg, 10, ARGUMENT_NAME, "XMNNUMROWS"}, {tkn_k_class_argument, sym_k_XmNnumStacks_arg, 12, ARGUMENT_NAME, "XMNNUMSTACKS"}, {tkn_k_class_argument, sym_k_XmNnumValues_arg, 12, ARGUMENT_NAME, "XMNNUMVALUES"}, {tkn_k_class_argument, sym_k_XmNoffsetModel_arg, 14, ARGUMENT_NAME, "XMNOFFSETMODEL"}, {tkn_k_class_reason, sym_k_XmNokCallback_reason, 13, REASON_NAME, "XMNOKCALLBACK"}, {tkn_k_class_argument, sym_k_XmNokLabelString_arg, 16, ARGUMENT_NAME, "XMNOKLABELSTRING"}, {tkn_k_class_enumval, sym_k_XmNONE_enumval, 6, ENUMVAL_NAME, "XMNONE"}, {tkn_k_class_argument, sym_k_XmNopenClosePadding_arg, 19, ARGUMENT_NAME, "XMNOPENCLOSEPADDING"}, {tkn_k_class_argument, sym_k_XmNopenFolderPixmap_arg, 19, ARGUMENT_NAME, "XMNOPENFOLDERPIXMAP"}, {tkn_k_class_argument, sym_k_XmNoptionString_arg, 15, ARGUMENT_NAME, "XMNOPTIONSTRING"}, {tkn_k_class_argument, sym_k_XmNorientation_arg, 14, ARGUMENT_NAME, "XMNORIENTATION"}, {tkn_k_class_enumval, sym_k_XmNORMAL_MODE_enumval, 13, ENUMVAL_NAME, "XMNORMAL_MODE"}, {tkn_k_class_class, sym_k_XmNotebook_object, 10, CLASS_NAME, "XMNOTEBOOK"}, {tkn_k_class_argument, sym_k_XmNotherString_arg, 14, ARGUMENT_NAME, "XMNOTHERSTRING"}, {tkn_k_class_enumval, sym_k_XmNOT_SELECTED_enumval, 14, ENUMVAL_NAME, "XMNOT_SELECTED"}, {tkn_k_class_argument, sym_k_XmNoutlineButtonPolicy_arg, 22, ARGUMENT_NAME, "XMNOUTLINEBUTTONPOLICY"}, {tkn_k_class_reason, sym_k_XmNoutlineChangedCallback_reason, 25, REASON_NAME, "XMNOUTLINECHANGEDCALLBACK"}, {tkn_k_class_argument, sym_k_XmNoutlineColumnWidth_arg, 21, ARGUMENT_NAME, "XMNOUTLINECOLUMNWIDTH"}, {tkn_k_class_argument, sym_k_XmNoutlineIndentation_arg, 21, ARGUMENT_NAME, "XMNOUTLINEINDENTATION"}, {tkn_k_class_argument, sym_k_XmNoutlineLineStyle_arg, 19, ARGUMENT_NAME, "XMNOUTLINELINESTYLE"}, {tkn_k_class_argument, sym_k_XmNoutlineState_arg, 15, ARGUMENT_NAME, "XMNOUTLINESTATE"}, {tkn_k_class_argument, sym_k_XmNoverrideRedirect_arg, 19, ARGUMENT_NAME, "XMNOVERRIDEREDIRECT"}, {tkn_k_class_enumval, sym_k_XmNO_AUTO_SELECT_enumval, 16, ENUMVAL_NAME, "XMNO_AUTO_SELECT"}, {tkn_k_class_enumval, sym_k_XmNO_LINE_enumval, 9, ENUMVAL_NAME, "XMNO_LINE"}, {tkn_k_class_enumval, sym_k_XmNO_ORIENTATION_enumval, 16, ENUMVAL_NAME, "XMNO_ORIENTATION"}, {tkn_k_class_enumval, sym_k_XmNO_PACKING_enumval, 12, ENUMVAL_NAME, "XMNO_PACKING"}, {tkn_k_class_enumval, sym_k_XmNO_SCROLL_enumval, 11, ENUMVAL_NAME, "XMNO_SCROLL"}, {tkn_k_class_argument, sym_k_XmNpacking_arg, 10, ARGUMENT_NAME, "XMNPACKING"}, {tkn_k_class_reason, sym_k_XmNpageChangedCallback_reason, 22, REASON_NAME, "XMNPAGECHANGEDCALLBACK"}, {tkn_k_class_reason, sym_k_XmNpageDecrementCallback_reason, 24, REASON_NAME, "XMNPAGEDECREMENTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNpageIncrement_arg, 16, ARGUMENT_NAME, "XMNPAGEINCREMENT"}, {tkn_k_class_reason, sym_k_XmNpageIncrementCallback_reason, 24, REASON_NAME, "XMNPAGEINCREMENTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNpageNumber_arg, 13, ARGUMENT_NAME, "XMNPAGENUMBER"}, {tkn_k_class_argument, sym_k_XmNpaneMaximum_arg, 14, ARGUMENT_NAME, "XMNPANEMAXIMUM"}, {tkn_k_class_argument, sym_k_XmNpaneMinimum_arg, 14, ARGUMENT_NAME, "XMNPANEMINIMUM"}, {tkn_k_class_argument, sym_k_XmNparentNode_arg, 13, ARGUMENT_NAME, "XMNPARENTNODE"}, {tkn_k_class_argument, sym_k_XmNpattern_arg, 10, ARGUMENT_NAME, "XMNPATTERN"}, {tkn_k_class_argument, sym_k_XmNpendingDelete_arg, 16, ARGUMENT_NAME, "XMNPENDINGDELETE"}, {tkn_k_class_argument, sym_k_XmNpicture_arg, 10, ARGUMENT_NAME, "XMNPICTURE"}, {tkn_k_class_reason, sym_k_XmNpictureErrorCallback_reason, 23, REASON_NAME, "XMNPICTUREERRORCALLBACK"}, {tkn_k_class_argument, sym_k_XmNpixmap_arg, 9, ARGUMENT_NAME, "XMNPIXMAP"}, {tkn_k_class_argument, sym_k_XmNpixmapDepth_arg, 14, ARGUMENT_NAME, "XMNPIXMAPDEPTH"}, {tkn_k_class_argument, sym_k_XmNpixmapHeight_arg, 15, ARGUMENT_NAME, "XMNPIXMAPHEIGHT"}, {tkn_k_class_argument, sym_k_XmNpixmapPlacement_arg, 18, ARGUMENT_NAME, "XMNPIXMAPPLACEMENT"}, {tkn_k_class_argument, sym_k_XmNpixmapTextPadding_arg, 20, ARGUMENT_NAME, "XMNPIXMAPTEXTPADDING"}, {tkn_k_class_argument, sym_k_XmNpixmapWidth_arg, 14, ARGUMENT_NAME, "XMNPIXMAPWIDTH"}, {tkn_k_class_reason, sym_k_XmNpopdownCallback_reason, 18, REASON_NAME, "XMNPOPDOWNCALLBACK"}, {tkn_k_class_reason, sym_k_XmNpopupCallback_reason, 16, REASON_NAME, "XMNPOPUPCALLBACK"}, {tkn_k_class_argument, sym_k_XmNpopupCursor_arg, 14, ARGUMENT_NAME, "XMNPOPUPCURSOR"}, {tkn_k_class_argument, sym_k_XmNpopupEnabled_arg, 15, ARGUMENT_NAME, "XMNPOPUPENABLED"}, {tkn_k_class_reason, sym_k_XmNpopupHandlerCallback_reason, 23, REASON_NAME, "XMNPOPUPHANDLERCALLBACK"}, {tkn_k_class_argument, sym_k_XmNpopupOffset_arg, 14, ARGUMENT_NAME, "XMNPOPUPOFFSET"}, {tkn_k_class_argument, sym_k_XmNpopupShellWidget_arg, 19, ARGUMENT_NAME, "XMNPOPUPSHELLWIDGET"}, {tkn_k_class_argument, sym_k_XmNposition_arg, 11, ARGUMENT_NAME, "XMNPOSITION"}, {tkn_k_class_argument, sym_k_XmNpositionIndex_arg, 16, ARGUMENT_NAME, "XMNPOSITIONINDEX"}, {tkn_k_class_argument, sym_k_XmNpositionMode_arg, 15, ARGUMENT_NAME, "XMNPOSITIONMODE"}, {tkn_k_class_argument, sym_k_XmNpositionType_arg, 15, ARGUMENT_NAME, "XMNPOSITIONTYPE"}, {tkn_k_class_argument, sym_k_XmNpreeditType_arg, 14, ARGUMENT_NAME, "XMNPREEDITTYPE"}, {tkn_k_class_argument, sym_k_XmNpreferredPaneSize_arg, 20, ARGUMENT_NAME, "XMNPREFERREDPANESIZE"}, {tkn_k_class_argument, sym_k_XmNprimaryOwnership_arg, 19, ARGUMENT_NAME, "XMNPRIMARYOWNERSHIP"}, {tkn_k_class_argument, sym_k_XmNprocessingDirection_arg, 22, ARGUMENT_NAME, "XMNPROCESSINGDIRECTION"}, {tkn_k_class_argument, sym_k_XmNpromptString_arg, 15, ARGUMENT_NAME, "XMNPROMPTSTRING"}, {tkn_k_class_argument, sym_k_XmNpropSpaceString_arg, 18, ARGUMENT_NAME, "XMNPROPSPACESTRING"}, {tkn_k_class_argument, sym_k_XmNpushButtonEnabled_arg, 20, ARGUMENT_NAME, "XMNPUSHBUTTONENABLED"}, {tkn_k_class_argument, sym_k_XmNqualifySearchDataProc_arg, 24, ARGUMENT_NAME, "XMNQUALIFYSEARCHDATAPROC"}, {tkn_k_class_argument, sym_k_XmNradioAlwaysOne_arg, 17, ARGUMENT_NAME, "XMNRADIOALWAYSONE"}, {tkn_k_class_argument, sym_k_XmNradioBehavior_arg, 16, ARGUMENT_NAME, "XMNRADIOBEHAVIOR"}, {tkn_k_class_reason, sym_k_XmNrealizeCallback_reason, 18, REASON_NAME, "XMNREALIZECALLBACK"}, {tkn_k_class_argument, sym_k_XmNrecomputeSize_arg, 16, ARGUMENT_NAME, "XMNRECOMPUTESIZE"}, {tkn_k_class_argument, sym_k_XmNredSliderLabel_arg, 17, ARGUMENT_NAME, "XMNREDSLIDERLABEL"}, {tkn_k_class_argument, sym_k_XmNrefigureMode_arg, 15, ARGUMENT_NAME, "XMNREFIGUREMODE"}, {tkn_k_class_argument, sym_k_XmNrenderTable_arg, 14, ARGUMENT_NAME, "XMNRENDERTABLE"}, {tkn_k_class_argument, sym_k_XmNrenditionBackground_arg, 22, ARGUMENT_NAME, "XMNRENDITIONBACKGROUND"}, {tkn_k_class_argument, sym_k_XmNrenditionForeground_arg, 22, ARGUMENT_NAME, "XMNRENDITIONFOREGROUND"}, {tkn_k_class_argument, sym_k_XmNrepeatDelay_arg, 14, ARGUMENT_NAME, "XMNREPEATDELAY"}, {tkn_k_class_argument, sym_k_XmNresizable_arg, 12, ARGUMENT_NAME, "XMNRESIZABLE"}, {tkn_k_class_reason, sym_k_XmNresizeCallback_reason, 17, REASON_NAME, "XMNRESIZECALLBACK"}, {tkn_k_class_argument, sym_k_XmNresizeHeight_arg, 15, ARGUMENT_NAME, "XMNRESIZEHEIGHT"}, {tkn_k_class_argument, sym_k_XmNresizePolicy_arg, 15, ARGUMENT_NAME, "XMNRESIZEPOLICY"}, {tkn_k_class_argument, sym_k_XmNresizeToPreferred_arg, 20, ARGUMENT_NAME, "XMNRESIZETOPREFERRED"}, {tkn_k_class_argument, sym_k_XmNresizeWidth_arg, 14, ARGUMENT_NAME, "XMNRESIZEWIDTH"}, {tkn_k_class_argument, sym_k_XmNrgbFile_arg, 10, ARGUMENT_NAME, "XMNRGBFILE"}, {tkn_k_class_argument, sym_k_XmNrightAttachment_arg, 18, ARGUMENT_NAME, "XMNRIGHTATTACHMENT"}, {tkn_k_class_argument, sym_k_XmNrightOffset_arg, 14, ARGUMENT_NAME, "XMNRIGHTOFFSET"}, {tkn_k_class_argument, sym_k_XmNrightPosition_arg, 16, ARGUMENT_NAME, "XMNRIGHTPOSITION"}, {tkn_k_class_argument, sym_k_XmNrightWidget_arg, 14, ARGUMENT_NAME, "XMNRIGHTWIDGET"}, {tkn_k_class_argument, sym_k_XmNrowColumnType_arg, 16, ARGUMENT_NAME, "XMNROWCOLUMNTYPE"}, {tkn_k_class_argument, sym_k_XmNrows_arg, 7, ARGUMENT_NAME, "XMNROWS"}, {tkn_k_class_argument, sym_k_XmNrubberPositioning_arg, 20, ARGUMENT_NAME, "XMNRUBBERPOSITIONING"}, {tkn_k_class_argument, sym_k_XmNsampleText_arg, 13, ARGUMENT_NAME, "XMNSAMPLETEXT"}, {tkn_k_class_argument, sym_k_XmNsashHeight_arg, 13, ARGUMENT_NAME, "XMNSASHHEIGHT"}, {tkn_k_class_argument, sym_k_XmNsashIndent_arg, 13, ARGUMENT_NAME, "XMNSASHINDENT"}, {tkn_k_class_argument, sym_k_XmNsashShadowThickness_arg, 22, ARGUMENT_NAME, "XMNSASHSHADOWTHICKNESS"}, {tkn_k_class_argument, sym_k_XmNsashTranslations_arg, 19, ARGUMENT_NAME, "XMNSASHTRANSLATIONS"}, {tkn_k_class_argument, sym_k_XmNsashWidth_arg, 12, ARGUMENT_NAME, "XMNSASHWIDTH"}, {tkn_k_class_argument, sym_k_XmNsaveUnder_arg, 12, ARGUMENT_NAME, "XMNSAVEUNDER"}, {tkn_k_class_argument, sym_k_XmNscaleHeight_arg, 14, ARGUMENT_NAME, "XMNSCALEHEIGHT"}, {tkn_k_class_argument, sym_k_XmNscaleMultiple_arg, 16, ARGUMENT_NAME, "XMNSCALEMULTIPLE"}, {tkn_k_class_argument, sym_k_XmNscaleWidth_arg, 13, ARGUMENT_NAME, "XMNSCALEWIDTH"}, {tkn_k_class_argument, sym_k_XmNscalingString_arg, 16, ARGUMENT_NAME, "XMNSCALINGSTRING"}, {tkn_k_class_argument, sym_k_XmNscreen_arg, 9, ARGUMENT_NAME, "XMNSCREEN"}, {tkn_k_class_argument, sym_k_XmNscrollBarDisplayPolicy_arg, 25, ARGUMENT_NAME, "XMNSCROLLBARDISPLAYPOLICY"}, {tkn_k_class_argument, sym_k_XmNscrollBarPlacement_arg, 21, ARGUMENT_NAME, "XMNSCROLLBARPLACEMENT"}, {tkn_k_class_argument, sym_k_XmNscrolledWindowChildType_arg, 26, ARGUMENT_NAME, "XMNSCROLLEDWINDOWCHILDTYPE"}, {tkn_k_class_argument, sym_k_XmNscrolledWindowMarginHeight_arg, 29, ARGUMENT_NAME, "XMNSCROLLEDWINDOWMARGINHEIGHT"}, {tkn_k_class_argument, sym_k_XmNscrolledWindowMarginWidth_arg, 28, ARGUMENT_NAME, "XMNSCROLLEDWINDOWMARGINWIDTH"}, {tkn_k_class_argument, sym_k_XmNscrollHorizontal_arg, 19, ARGUMENT_NAME, "XMNSCROLLHORIZONTAL"}, {tkn_k_class_argument, sym_k_XmNscrollingPolicy_arg, 18, ARGUMENT_NAME, "XMNSCROLLINGPOLICY"}, {tkn_k_class_argument, sym_k_XmNscrollLeftSide_arg, 17, ARGUMENT_NAME, "XMNSCROLLLEFTSIDE"}, {tkn_k_class_argument, sym_k_XmNscrollTopSide_arg, 16, ARGUMENT_NAME, "XMNSCROLLTOPSIDE"}, {tkn_k_class_argument, sym_k_XmNscrollVertical_arg, 17, ARGUMENT_NAME, "XMNSCROLLVERTICAL"}, {tkn_k_class_reason, sym_k_XmNselectCallback_reason, 17, REASON_NAME, "XMNSELECTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNselectColor_arg, 14, ARGUMENT_NAME, "XMNSELECTCOLOR"}, {tkn_k_class_argument, sym_k_XmNselectedColumn_arg, 17, ARGUMENT_NAME, "XMNSELECTEDCOLUMN"}, {tkn_k_class_argument, sym_k_XmNselectedItem_arg, 15, ARGUMENT_NAME, "XMNSELECTEDITEM"}, {tkn_k_class_argument, sym_k_XmNselectedItemCount_arg, 20, ARGUMENT_NAME, "XMNSELECTEDITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNselectedItems_arg, 16, ARGUMENT_NAME, "XMNSELECTEDITEMS"}, {tkn_k_class_argument, sym_k_XmNselectedPosition_arg, 19, ARGUMENT_NAME, "XMNSELECTEDPOSITION"}, {tkn_k_class_argument, sym_k_XmNselectedPositionCount_arg, 24, ARGUMENT_NAME, "XMNSELECTEDPOSITIONCOUNT"}, {tkn_k_class_argument, sym_k_XmNselectedPositions_arg, 20, ARGUMENT_NAME, "XMNSELECTEDPOSITIONS"}, {tkn_k_class_argument, sym_k_XmNselectInsensitivePixmap_arg, 26, ARGUMENT_NAME, "XMNSELECTINSENSITIVEPIXMAP"}, {tkn_k_class_argument, sym_k_XmNselectionArray_arg, 17, ARGUMENT_NAME, "XMNSELECTIONARRAY"}, {tkn_k_class_argument, sym_k_XmNselectionArrayCount_arg, 22, ARGUMENT_NAME, "XMNSELECTIONARRAYCOUNT"}, {tkn_k_class_reason, sym_k_XmNselectionCallback_reason, 20, REASON_NAME, "XMNSELECTIONCALLBACK"}, {tkn_k_class_argument, sym_k_XmNselectionLabelString_arg, 23, ARGUMENT_NAME, "XMNSELECTIONLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNselectionMode_arg, 16, ARGUMENT_NAME, "XMNSELECTIONMODE"}, {tkn_k_class_argument, sym_k_XmNselectionPolicy_arg, 18, ARGUMENT_NAME, "XMNSELECTIONPOLICY"}, {tkn_k_class_argument, sym_k_XmNselectionTechnique_arg, 21, ARGUMENT_NAME, "XMNSELECTIONTECHNIQUE"}, {tkn_k_class_argument, sym_k_XmNselectPixmap_arg, 15, ARGUMENT_NAME, "XMNSELECTPIXMAP"}, {tkn_k_class_argument, sym_k_XmNselectThreshold_arg, 18, ARGUMENT_NAME, "XMNSELECTTHRESHOLD"}, {tkn_k_class_argument, sym_k_XmNsensitive_arg, 12, ARGUMENT_NAME, "XMNSENSITIVE"}, {tkn_k_class_argument, sym_k_XmNseparatorOn_arg, 14, ARGUMENT_NAME, "XMNSEPARATORON"}, {tkn_k_class_argument, sym_k_XmNseparatorType_arg, 16, ARGUMENT_NAME, "XMNSEPARATORTYPE"}, {tkn_k_class_argument, sym_k_XmNset_arg, 6, ARGUMENT_NAME, "XMNSET"}, {tkn_k_class_argument, sym_k_XmNshadowThickness_arg, 18, ARGUMENT_NAME, "XMNSHADOWTHICKNESS"}, {tkn_k_class_argument, sym_k_XmNshadowType_arg, 13, ARGUMENT_NAME, "XMNSHADOWTYPE"}, {tkn_k_class_argument, sym_k_XmNshellUnitType_arg, 16, ARGUMENT_NAME, "XMNSHELLUNITTYPE"}, {tkn_k_class_argument, sym_k_XmNshowArrows_arg, 13, ARGUMENT_NAME, "XMNSHOWARROWS"}, {tkn_k_class_argument, sym_k_XmNshowAsDefault_arg, 16, ARGUMENT_NAME, "XMNSHOWASDEFAULT"}, {tkn_k_class_argument, sym_k_XmNshowEntryLabel_arg, 17, ARGUMENT_NAME, "XMNSHOWENTRYLABEL"}, {tkn_k_class_argument, sym_k_XmNshowFind_arg, 11, ARGUMENT_NAME, "XMNSHOWFIND"}, {tkn_k_class_argument, sym_k_XmNshowFontName_arg, 15, ARGUMENT_NAME, "XMNSHOWFONTNAME"}, {tkn_k_class_argument, sym_k_XmNshowLabel_arg, 12, ARGUMENT_NAME, "XMNSHOWLABEL"}, {tkn_k_class_argument, sym_k_XmNshowNameString_arg, 17, ARGUMENT_NAME, "XMNSHOWNAMESTRING"}, {tkn_k_class_argument, sym_k_XmNshowSash_arg, 11, ARGUMENT_NAME, "XMNSHOWSASH"}, {tkn_k_class_argument, sym_k_XmNshowSeparator_arg, 16, ARGUMENT_NAME, "XMNSHOWSEPARATOR"}, {tkn_k_class_argument, sym_k_XmNshowValue_arg, 12, ARGUMENT_NAME, "XMNSHOWVALUE"}, {tkn_k_class_reason, sym_k_XmNsimpleCallback_reason, 17, REASON_NAME, "XMNSIMPLECALLBACK"}, {tkn_k_class_reason, sym_k_XmNsingleSelectionCallback_reason, 26, REASON_NAME, "XMNSINGLESELECTIONCALLBACK"}, {tkn_k_class_argument, sym_k_XmNsizeString_arg, 13, ARGUMENT_NAME, "XMNSIZESTRING"}, {tkn_k_class_argument, sym_k_XmNskipAdjust_arg, 13, ARGUMENT_NAME, "XMNSKIPADJUST"}, {tkn_k_class_argument, sym_k_XmNsliderMark_arg, 13, ARGUMENT_NAME, "XMNSLIDERMARK"}, {tkn_k_class_argument, sym_k_XmNsliderSize_arg, 13, ARGUMENT_NAME, "XMNSLIDERSIZE"}, {tkn_k_class_argument, sym_k_XmNsliderTogLabel_arg, 17, ARGUMENT_NAME, "XMNSLIDERTOGLABEL"}, {tkn_k_class_argument, sym_k_XmNsliderVisual_arg, 15, ARGUMENT_NAME, "XMNSLIDERVISUAL"}, {tkn_k_class_argument, sym_k_XmNslidingMode_arg, 14, ARGUMENT_NAME, "XMNSLIDINGMODE"}, {tkn_k_class_argument, sym_k_XmNsmallCellHeight_arg, 18, ARGUMENT_NAME, "XMNSMALLCELLHEIGHT"}, {tkn_k_class_argument, sym_k_XmNsmallCellWidth_arg, 17, ARGUMENT_NAME, "XMNSMALLCELLWIDTH"}, {tkn_k_class_argument, sym_k_XmNsmallIconMask_arg, 16, ARGUMENT_NAME, "XMNSMALLICONMASK"}, {tkn_k_class_argument, sym_k_XmNsmallIconPixmap_arg, 18, ARGUMENT_NAME, "XMNSMALLICONPIXMAP"}, {tkn_k_class_argument, sym_k_XmNsmallIconX_arg, 13, ARGUMENT_NAME, "XMNSMALLICONX"}, {tkn_k_class_argument, sym_k_XmNsmallIconY_arg, 13, ARGUMENT_NAME, "XMNSMALLICONY"}, {tkn_k_class_argument, sym_k_XmNsnapBackMultiple_arg, 19, ARGUMENT_NAME, "XMNSNAPBACKMULTIPLE"}, {tkn_k_class_argument, sym_k_XmNsortFunctions_arg, 16, ARGUMENT_NAME, "XMNSORTFUNCTIONS"}, {tkn_k_class_argument, sym_k_XmNsource_arg, 9, ARGUMENT_NAME, "XMNSOURCE"}, {tkn_k_class_argument, sym_k_XmNspacing_arg, 10, ARGUMENT_NAME, "XMNSPACING"}, {tkn_k_class_argument, sym_k_XmNspatialIncludeModel_arg, 22, ARGUMENT_NAME, "XMNSPATIALINCLUDEMODEL"}, {tkn_k_class_argument, sym_k_XmNspatialResizeModel_arg, 21, ARGUMENT_NAME, "XMNSPATIALRESIZEMODEL"}, {tkn_k_class_argument, sym_k_XmNspatialSnapModel_arg, 19, ARGUMENT_NAME, "XMNSPATIALSNAPMODEL"}, {tkn_k_class_argument, sym_k_XmNspatialStyle_arg, 15, ARGUMENT_NAME, "XMNSPATIALSTYLE"}, {tkn_k_class_argument, sym_k_XmNspinBoxChildType_arg, 19, ARGUMENT_NAME, "XMNSPINBOXCHILDTYPE"}, {tkn_k_class_argument, sym_k_XmNstackedEffect_arg, 16, ARGUMENT_NAME, "XMNSTACKEDEFFECT"}, {tkn_k_class_argument, sym_k_XmNstretchable_arg, 14, ARGUMENT_NAME, "XMNSTRETCHABLE"}, {tkn_k_class_argument, sym_k_XmNstrikethruType_arg, 17, ARGUMENT_NAME, "XMNSTRIKETHRUTYPE"}, {tkn_k_class_argument, sym_k_XmNstringDirection_arg, 18, ARGUMENT_NAME, "XMNSTRINGDIRECTION"}, {tkn_k_class_argument, sym_k_XmNsubMenuId_arg, 12, ARGUMENT_NAME, "XMNSUBMENUID"}, {tkn_k_class_argument, sym_k_XmNsymbolPixmap_arg, 15, ARGUMENT_NAME, "XMNSYMBOLPIXMAP"}, {tkn_k_class_argument, sym_k_XmNtabAlignment_arg, 15, ARGUMENT_NAME, "XMNTABALIGNMENT"}, {tkn_k_class_argument, sym_k_XmNtabAutoSelect_arg, 16, ARGUMENT_NAME, "XMNTABAUTOSELECT"}, {tkn_k_class_argument, sym_k_XmNtabBackground_arg, 16, ARGUMENT_NAME, "XMNTABBACKGROUND"}, {tkn_k_class_argument, sym_k_XmNtabBackgroundPixmap_arg, 22, ARGUMENT_NAME, "XMNTABBACKGROUNDPIXMAP"}, {tkn_k_class_argument, sym_k_XmNtabCornerPercent_arg, 19, ARGUMENT_NAME, "XMNTABCORNERPERCENT"}, {tkn_k_class_argument, sym_k_XmNtabEdge_arg, 10, ARGUMENT_NAME, "XMNTABEDGE"}, {tkn_k_class_argument, sym_k_XmNtabForeground_arg, 16, ARGUMENT_NAME, "XMNTABFOREGROUND"}, {tkn_k_class_argument, sym_k_XmNtabLabelPixmap_arg, 17, ARGUMENT_NAME, "XMNTABLABELPIXMAP"}, {tkn_k_class_argument, sym_k_XmNtabLabelSpacing_arg, 18, ARGUMENT_NAME, "XMNTABLABELSPACING"}, {tkn_k_class_argument, sym_k_XmNtabLabelString_arg, 17, ARGUMENT_NAME, "XMNTABLABELSTRING"}, {tkn_k_class_argument, sym_k_XmNtabList_arg, 10, ARGUMENT_NAME, "XMNTABLIST"}, {tkn_k_class_argument, sym_k_XmNtabMarginHeight_arg, 18, ARGUMENT_NAME, "XMNTABMARGINHEIGHT"}, {tkn_k_class_argument, sym_k_XmNtabMarginWidth_arg, 17, ARGUMENT_NAME, "XMNTABMARGINWIDTH"}, {tkn_k_class_argument, sym_k_XmNtabMode_arg, 10, ARGUMENT_NAME, "XMNTABMODE"}, {tkn_k_class_argument, sym_k_XmNtabOffset_arg, 12, ARGUMENT_NAME, "XMNTABOFFSET"}, {tkn_k_class_argument, sym_k_XmNtabOrientation_arg, 17, ARGUMENT_NAME, "XMNTABORIENTATION"}, {tkn_k_class_argument, sym_k_XmNtabPixmapPlacement_arg, 21, ARGUMENT_NAME, "XMNTABPIXMAPPLACEMENT"}, {tkn_k_class_argument, sym_k_XmNtabSelectColor_arg, 17, ARGUMENT_NAME, "XMNTABSELECTCOLOR"}, {tkn_k_class_reason, sym_k_XmNtabSelectedCallback_reason, 22, REASON_NAME, "XMNTABSELECTEDCALLBACK"}, {tkn_k_class_argument, sym_k_XmNtabSelectPixmap_arg, 18, ARGUMENT_NAME, "XMNTABSELECTPIXMAP"}, {tkn_k_class_argument, sym_k_XmNtabSide_arg, 10, ARGUMENT_NAME, "XMNTABSIDE"}, {tkn_k_class_argument, sym_k_XmNtabStringDirection_arg, 21, ARGUMENT_NAME, "XMNTABSTRINGDIRECTION"}, {tkn_k_class_argument, sym_k_XmNtabStyle_arg, 11, ARGUMENT_NAME, "XMNTABSTYLE"}, {tkn_k_class_argument, sym_k_XmNtabValue_arg, 11, ARGUMENT_NAME, "XMNTABVALUE"}, {tkn_k_class_reason, sym_k_XmNtearOffMenuActivateCallback_reason, 30, REASON_NAME, "XMNTEAROFFMENUACTIVATECALLBACK"}, {tkn_k_class_reason, sym_k_XmNtearOffMenuDeactivateCallback_reason, 32, REASON_NAME, "XMNTEAROFFMENUDEACTIVATECALLBACK"}, {tkn_k_class_argument, sym_k_XmNtearOffModel_arg, 15, ARGUMENT_NAME, "XMNTEAROFFMODEL"}, {tkn_k_class_argument, sym_k_XmNtearOffTitle_arg, 15, ARGUMENT_NAME, "XMNTEAROFFTITLE"}, {tkn_k_class_argument, sym_k_XmNtextAccelerators_arg, 19, ARGUMENT_NAME, "XMNTEXTACCELERATORS"}, {tkn_k_class_argument, sym_k_XmNtextColumns_arg, 14, ARGUMENT_NAME, "XMNTEXTCOLUMNS"}, {tkn_k_class_argument, sym_k_XmNtextField_arg, 12, ARGUMENT_NAME, "XMNTEXTFIELD"}, {tkn_k_class_argument, sym_k_XmNtextFontList_arg, 15, ARGUMENT_NAME, "XMNTEXTFONTLIST"}, {tkn_k_class_argument, sym_k_XmNtextRenderTable_arg, 18, ARGUMENT_NAME, "XMNTEXTRENDERTABLE"}, {tkn_k_class_argument, sym_k_XmNtextRows_arg, 11, ARGUMENT_NAME, "XMNTEXTROWS"}, {tkn_k_class_argument, sym_k_XmNtextString_arg, 13, ARGUMENT_NAME, "XMNTEXTSTRING"}, {tkn_k_class_argument, sym_k_XmNtextTranslations_arg, 19, ARGUMENT_NAME, "XMNTEXTTRANSLATIONS"}, {tkn_k_class_argument, sym_k_XmNtitle_arg, 8, ARGUMENT_NAME, "XMNTITLE"}, {tkn_k_class_argument, sym_k_XmNtitleEncoding_arg, 16, ARGUMENT_NAME, "XMNTITLEENCODING"}, {tkn_k_class_argument, sym_k_XmNtitleString_arg, 14, ARGUMENT_NAME, "XMNTITLESTRING"}, {tkn_k_class_reason, sym_k_XmNtoBottomCallback_reason, 19, REASON_NAME, "XMNTOBOTTOMCALLBACK"}, {tkn_k_class_argument, sym_k_XmNtoggleMode_arg, 13, ARGUMENT_NAME, "XMNTOGGLEMODE"}, {tkn_k_class_argument, sym_k_XmNtoolTipEnable_arg, 16, ARGUMENT_NAME, "XMNTOOLTIPENABLE"}, {tkn_k_class_argument, sym_k_XmNtoolTipPostDelay_arg, 19, ARGUMENT_NAME, "XMNTOOLTIPPOSTDELAY"}, {tkn_k_class_argument, sym_k_XmNtoolTipPostDuration_arg, 22, ARGUMENT_NAME, "XMNTOOLTIPPOSTDURATION"}, {tkn_k_class_argument, sym_k_XmNtoolTipString_arg, 16, ARGUMENT_NAME, "XMNTOOLTIPSTRING"}, {tkn_k_class_argument, sym_k_XmNtopAttachment_arg, 16, ARGUMENT_NAME, "XMNTOPATTACHMENT"}, {tkn_k_class_argument, sym_k_XmNtopCharacter_arg, 15, ARGUMENT_NAME, "XMNTOPCHARACTER"}, {tkn_k_class_argument, sym_k_XmNtopItemPosition_arg, 18, ARGUMENT_NAME, "XMNTOPITEMPOSITION"}, {tkn_k_class_argument, sym_k_XmNtopOffset_arg, 12, ARGUMENT_NAME, "XMNTOPOFFSET"}, {tkn_k_class_argument, sym_k_XmNtopPosition_arg, 14, ARGUMENT_NAME, "XMNTOPPOSITION"}, {tkn_k_class_argument, sym_k_XmNtopShadowColor_arg, 17, ARGUMENT_NAME, "XMNTOPSHADOWCOLOR"}, {tkn_k_class_argument, sym_k_XmNtopShadowPixmap_arg, 18, ARGUMENT_NAME, "XMNTOPSHADOWPIXMAP"}, {tkn_k_class_argument, sym_k_XmNtopWidget_arg, 12, ARGUMENT_NAME, "XMNTOPWIDGET"}, {tkn_k_class_reason, sym_k_XmNtoTopCallback_reason, 16, REASON_NAME, "XMNTOTOPCALLBACK"}, {tkn_k_class_argument, sym_k_XmNtransient_arg, 12, ARGUMENT_NAME, "XMNTRANSIENT"}, {tkn_k_class_argument, sym_k_XmNtransientFor_arg, 15, ARGUMENT_NAME, "XMNTRANSIENTFOR"}, {tkn_k_class_argument, sym_k_XmNtranslations_arg, 15, ARGUMENT_NAME, "XMNTRANSLATIONS"}, {tkn_k_class_reason, sym_k_XmNtraversalCallback_reason, 20, REASON_NAME, "XMNTRAVERSALCALLBACK"}, {tkn_k_class_argument, sym_k_XmNtraversalOn_arg, 14, ARGUMENT_NAME, "XMNTRAVERSALON"}, {tkn_k_class_reason, sym_k_XmNtraverseObscuredCallback_reason, 27, REASON_NAME, "XMNTRAVERSEOBSCUREDCALLBACK"}, {tkn_k_class_argument, sym_k_XmNtroughColor_arg, 14, ARGUMENT_NAME, "XMNTROUGHCOLOR"}, {tkn_k_class_enumval, sym_k_XmNUMERIC_enumval, 9, ENUMVAL_NAME, "XMNUMERIC"}, {tkn_k_class_argument, sym_k_XmNunderlineType_arg, 16, ARGUMENT_NAME, "XMNUNDERLINETYPE"}, {tkn_k_class_argument, sym_k_XmNuniformTabSize_arg, 17, ARGUMENT_NAME, "XMNUNIFORMTABSIZE"}, {tkn_k_class_argument, sym_k_XmNunitType_arg, 11, ARGUMENT_NAME, "XMNUNITTYPE"}, {tkn_k_class_reason, sym_k_XmNunmapCallback_reason, 16, REASON_NAME, "XMNUNMAPCALLBACK"}, {tkn_k_class_argument, sym_k_XmNunpostBehavior_arg, 17, ARGUMENT_NAME, "XMNUNPOSTBEHAVIOR"}, {tkn_k_class_reason, sym_k_XmNunselectCallback_reason, 19, REASON_NAME, "XMNUNSELECTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNunselectColor_arg, 16, ARGUMENT_NAME, "XMNUNSELECTCOLOR"}, {tkn_k_class_reason, sym_k_XmNupdateShellCallback_reason, 22, REASON_NAME, "XMNUPDATESHELLCALLBACK"}, {tkn_k_class_reason, sym_k_XmNupdateTextCallback_reason, 21, REASON_NAME, "XMNUPDATETEXTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNuseAsyncGeometry_arg, 19, ARGUMENT_NAME, "XMNUSEASYNCGEOMETRY"}, {tkn_k_class_argument, sym_k_XmNuseImageCache_arg, 16, ARGUMENT_NAME, "XMNUSEIMAGECACHE"}, {tkn_k_class_argument, sym_k_XmNuserData_arg, 11, ARGUMENT_NAME, "XMNUSERDATA"}, {tkn_k_class_argument, sym_k_XmNuseScaling_arg, 13, ARGUMENT_NAME, "XMNUSESCALING"}, {tkn_k_class_argument, sym_k_XmNuseTextField_arg, 15, ARGUMENT_NAME, "XMNUSETEXTFIELD"}, {tkn_k_class_reason, sym_k_XmNvalidateCallback_reason, 19, REASON_NAME, "XMNVALIDATECALLBACK"}, {tkn_k_class_argument, sym_k_XmNvalue_arg, 8, ARGUMENT_NAME, "XMNVALUE"}, {tkn_k_class_reason, sym_k_XmNvalueChangedCallback_reason, 23, REASON_NAME, "XMNVALUECHANGEDCALLBACK"}, {tkn_k_class_argument, sym_k_XmNvalues_arg, 9, ARGUMENT_NAME, "XMNVALUES"}, {tkn_k_class_argument, sym_k_XmNvalueWcs_arg, 11, ARGUMENT_NAME, "XMNVALUEWCS"}, {tkn_k_class_argument, sym_k_XmNverify_arg, 9, ARGUMENT_NAME, "XMNVERIFY"}, {tkn_k_class_argument, sym_k_XmNverifyBell_arg, 13, ARGUMENT_NAME, "XMNVERIFYBELL"}, {tkn_k_class_reason, sym_k_XmNverifyTextCallback_reason, 21, REASON_NAME, "XMNVERIFYTEXTCALLBACK"}, {tkn_k_class_argument, sym_k_XmNverticalDelta_arg, 16, ARGUMENT_NAME, "XMNVERTICALDELTA"}, {tkn_k_class_argument, sym_k_XmNverticalMargin_arg, 17, ARGUMENT_NAME, "XMNVERTICALMARGIN"}, {tkn_k_class_argument, sym_k_XmNverticalNodeSpace_arg, 20, ARGUMENT_NAME, "XMNVERTICALNODESPACE"}, {tkn_k_class_argument, sym_k_XmNverticalScrollBar_arg, 20, ARGUMENT_NAME, "XMNVERTICALSCROLLBAR"}, {tkn_k_class_argument, sym_k_XmNverticalSpacing_arg, 18, ARGUMENT_NAME, "XMNVERTICALSPACING"}, {tkn_k_class_argument, sym_k_XmNviewType_arg, 11, ARGUMENT_NAME, "XMNVIEWTYPE"}, {tkn_k_class_argument, sym_k_XmNvisibleItemCount_arg, 19, ARGUMENT_NAME, "XMNVISIBLEITEMCOUNT"}, {tkn_k_class_argument, sym_k_XmNvisibleWhenOff_arg, 17, ARGUMENT_NAME, "XMNVISIBLEWHENOFF"}, {tkn_k_class_argument, sym_k_XmNvisual_arg, 9, ARGUMENT_NAME, "XMNVISUAL"}, {tkn_k_class_argument, sym_k_XmNvisualEmphasis_arg, 17, ARGUMENT_NAME, "XMNVISUALEMPHASIS"}, {tkn_k_class_argument, sym_k_XmNvisualPolicy_arg, 15, ARGUMENT_NAME, "XMNVISUALPOLICY"}, {tkn_k_class_argument, sym_k_XmNwaitForWm_arg, 12, ARGUMENT_NAME, "XMNWAITFORWM"}, {tkn_k_class_argument, sym_k_XmNwhichButton_arg, 14, ARGUMENT_NAME, "XMNWHICHBUTTON"}, {tkn_k_class_argument, sym_k_XmNwidth_arg, 8, ARGUMENT_NAME, "XMNWIDTH"}, {tkn_k_class_argument, sym_k_XmNwidthInc_arg, 11, ARGUMENT_NAME, "XMNWIDTHINC"}, {tkn_k_class_argument, sym_k_XmNwindowGroup_arg, 14, ARGUMENT_NAME, "XMNWINDOWGROUP"}, {tkn_k_class_argument, sym_k_XmNwinGravity_arg, 13, ARGUMENT_NAME, "XMNWINGRAVITY"}, {tkn_k_class_argument, sym_k_XmNwmTimeout_arg, 12, ARGUMENT_NAME, "XMNWMTIMEOUT"}, {tkn_k_class_argument, sym_k_XmNwordWrap_arg, 11, ARGUMENT_NAME, "XMNWORDWRAP"}, {tkn_k_class_argument, sym_k_XmNworkWindow_arg, 13, ARGUMENT_NAME, "XMNWORKWINDOW"}, {tkn_k_class_argument, sym_k_XmNwrap_arg, 7, ARGUMENT_NAME, "XMNWRAP"}, {tkn_k_class_argument, sym_k_XmNx_arg, 4, ARGUMENT_NAME, "XMNX"}, {tkn_k_class_argument, sym_k_XmNxlfdString_arg, 13, ARGUMENT_NAME, "XMNXLFDSTRING"}, {tkn_k_class_argument, sym_k_XmNy_arg, 4, ARGUMENT_NAME, "XMNY"}, {tkn_k_class_enumval, sym_k_XmN_OF_MANY_enumval, 11, ENUMVAL_NAME, "XMN_OF_MANY"}, {tkn_k_class_enumval, sym_k_XmONE_BASED_enumval, 11, ENUMVAL_NAME, "XMONE_BASED"}, {tkn_k_class_enumval, sym_k_XmONE_OF_MANY_enumval, 13, ENUMVAL_NAME, "XMONE_OF_MANY"}, {tkn_k_class_enumval, sym_k_XmONE_OF_MANY_DIAMOND_enumval, 21, ENUMVAL_NAME, "XMONE_OF_MANY_DIAMOND"}, {tkn_k_class_enumval, sym_k_XmONE_OF_MANY_ROUND_enumval, 19, ENUMVAL_NAME, "XMONE_OF_MANY_ROUND"}, {tkn_k_class_enumval, sym_k_XmOpen_enumval, 6, ENUMVAL_NAME, "XMOPEN"}, {tkn_k_class_class, sym_k_XmOptionMenu_object, 12, CLASS_NAME, "XMOPTIONMENU"}, {tkn_k_class_class, sym_k_XmOutline_object, 9, CLASS_NAME, "XMOUTLINE"}, {tkn_k_class_enumval, sym_k_XmOUTLINE_enumval, 9, ENUMVAL_NAME, "XMOUTLINE"}, {tkn_k_class_enumval, sym_k_XmOUTLINE_BUTTON_ABSENT_enumval, 23, ENUMVAL_NAME, "XMOUTLINE_BUTTON_ABSENT"}, {tkn_k_class_enumval, sym_k_XmOUTLINE_BUTTON_PRESENT_enumval, 24, ENUMVAL_NAME, "XMOUTLINE_BUTTON_PRESENT"}, {tkn_k_class_enumval, sym_k_XmOWN_ALWAYS_enumval, 12, ENUMVAL_NAME, "XMOWN_ALWAYS"}, {tkn_k_class_enumval, sym_k_XmOWN_MULTIPLE_enumval, 14, ENUMVAL_NAME, "XMOWN_MULTIPLE"}, {tkn_k_class_enumval, sym_k_XmOWN_NEVER_enumval, 11, ENUMVAL_NAME, "XMOWN_NEVER"}, {tkn_k_class_enumval, sym_k_XmOWN_POSSIBLE_MULTIPLE_enumval, 23, ENUMVAL_NAME, "XMOWN_POSSIBLE_MULTIPLE"}, {tkn_k_class_enumval, sym_k_XmPACK_COLUMN_enumval, 13, ENUMVAL_NAME, "XMPACK_COLUMN"}, {tkn_k_class_enumval, sym_k_XmPACK_NONE_enumval, 11, ENUMVAL_NAME, "XMPACK_NONE"}, {tkn_k_class_enumval, sym_k_XmPACK_TIGHT_enumval, 12, ENUMVAL_NAME, "XMPACK_TIGHT"}, {tkn_k_class_enumval, sym_k_XmPAGE_enumval, 6, ENUMVAL_NAME, "XMPAGE"}, {tkn_k_class_enumval, sym_k_XmPAGE_SCROLLER_enumval, 15, ENUMVAL_NAME, "XMPAGE_SCROLLER"}, {tkn_k_class_class, sym_k_XmPaned_object, 7, CLASS_NAME, "XMPANED"}, {tkn_k_class_class, sym_k_XmPanedWindow_object, 13, CLASS_NAME, "XMPANEDWINDOW"}, {tkn_k_class_enumval, sym_k_XmPER_SHELL_enumval, 11, ENUMVAL_NAME, "XMPER_SHELL"}, {tkn_k_class_enumval, sym_k_XmPER_WIDGET_enumval, 12, ENUMVAL_NAME, "XMPER_WIDGET"}, {tkn_k_class_enumval, sym_k_XmPIXELS_enumval, 8, ENUMVAL_NAME, "XMPIXELS"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_enumval, 8, ENUMVAL_NAME, "XMPIXMAP"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_AND_STRING_enumval, 19, ENUMVAL_NAME, "XMPIXMAP_AND_STRING"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_BOTTOM_enumval, 15, ENUMVAL_NAME, "XMPIXMAP_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_LEFT_enumval, 13, ENUMVAL_NAME, "XMPIXMAP_LEFT"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_NONE_enumval, 13, ENUMVAL_NAME, "XMPIXMAP_NONE"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_ONLY_enumval, 13, ENUMVAL_NAME, "XMPIXMAP_ONLY"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_OVERLAP_ONLY_enumval, 21, ENUMVAL_NAME, "XMPIXMAP_OVERLAP_ONLY"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_RIGHT_enumval, 14, ENUMVAL_NAME, "XMPIXMAP_RIGHT"}, {tkn_k_class_enumval, sym_k_XmPIXMAP_TOP_enumval, 12, ENUMVAL_NAME, "XMPIXMAP_TOP"}, {tkn_k_class_enumval, sym_k_XmPLACE_ABOVE_SELECTION_enumval, 23, ENUMVAL_NAME, "XMPLACE_ABOVE_SELECTION"}, {tkn_k_class_enumval, sym_k_XmPLACE_BELOW_SELECTION_enumval, 23, ENUMVAL_NAME, "XMPLACE_BELOW_SELECTION"}, {tkn_k_class_enumval, sym_k_XmPLACE_TOP_enumval, 11, ENUMVAL_NAME, "XMPLACE_TOP"}, {tkn_k_class_enumval, sym_k_XmPOINTER_enumval, 9, ENUMVAL_NAME, "XMPOINTER"}, {tkn_k_class_enumval, sym_k_XmPOINTS_enumval, 8, ENUMVAL_NAME, "XMPOINTS"}, {tkn_k_class_class, sym_k_XmPopupMenu_object, 11, CLASS_NAME, "XMPOPUPMENU"}, {tkn_k_class_enumval, sym_k_XmPOSITION_INDEX_enumval, 16, ENUMVAL_NAME, "XMPOSITION_INDEX"}, {tkn_k_class_enumval, sym_k_XmPOSITION_VALUE_enumval, 16, ENUMVAL_NAME, "XMPOSITION_VALUE"}, {tkn_k_class_class, sym_k_XmPromptDialog_object, 14, CLASS_NAME, "XMPROMPTDIALOG"}, {tkn_k_class_class, sym_k_XmPulldownMenu_object, 14, CLASS_NAME, "XMPULLDOWNMENU"}, {tkn_k_class_class, sym_k_XmPushButton_object, 12, CLASS_NAME, "XMPUSHBUTTON"}, {tkn_k_class_class, sym_k_XmPushButtonGadget_object, 18, CLASS_NAME, "XMPUSHBUTTONGADGET"}, {tkn_k_class_class, sym_k_XmQuestionDialog_object, 16, CLASS_NAME, "XMQUESTIONDIALOG"}, {tkn_k_class_enumval, sym_k_XmQUICK_NAVIGATE_enumval, 16, ENUMVAL_NAME, "XMQUICK_NAVIGATE"}, {tkn_k_class_class, sym_k_XmRadioBox_object, 10, CLASS_NAME, "XMRADIOBOX"}, {tkn_k_class_enumval, sym_k_XmRELATIVE_enumval, 10, ENUMVAL_NAME, "XMRELATIVE"}, {tkn_k_class_class, sym_k_XmRenderTable_object, 13, CLASS_NAME, "XMRENDERTABLE"}, {tkn_k_class_class, sym_k_XmRendition_object, 11, CLASS_NAME, "XMRENDITION"}, {tkn_k_class_enumval, sym_k_XmRESIZE_ANY_enumval, 12, ENUMVAL_NAME, "XMRESIZE_ANY"}, {tkn_k_class_enumval, sym_k_XmRESIZE_GROW_enumval, 13, ENUMVAL_NAME, "XMRESIZE_GROW"}, {tkn_k_class_enumval, sym_k_XmRESIZE_IF_POSSIBLE_enumval, 20, ENUMVAL_NAME, "XMRESIZE_IF_POSSIBLE"}, {tkn_k_class_enumval, sym_k_XmRESIZE_NONE_enumval, 13, ENUMVAL_NAME, "XMRESIZE_NONE"}, {tkn_k_class_enumval, sym_k_XmRIGHT_TO_LEFT_enumval, 15, ENUMVAL_NAME, "XMRIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmRIGHT_TO_LEFT_BOTTOM_TO_TOP_enumval, 29, ENUMVAL_NAME, "XMRIGHT_TO_LEFT_BOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmRIGHT_TO_LEFT_TOP_TO_BOTTOM_enumval, 29, ENUMVAL_NAME, "XMRIGHT_TO_LEFT_TOP_TO_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmROUND_MARK_enumval, 12, ENUMVAL_NAME, "XMROUND_MARK"}, {tkn_k_class_class, sym_k_XmRowColumn_object, 11, CLASS_NAME, "XMROWCOLUMN"}, {tkn_k_class_class, sym_k_XmScale_object, 7, CLASS_NAME, "XMSCALE"}, {tkn_k_class_enumval, sym_k_XmScaleMode_enumval, 11, ENUMVAL_NAME, "XMSCALEMODE"}, {tkn_k_class_class, sym_k_XmScrollBar_object, 11, CLASS_NAME, "XMSCROLLBAR"}, {tkn_k_class_class, sym_k_XmScrolledList_object, 14, CLASS_NAME, "XMSCROLLEDLIST"}, {tkn_k_class_class, sym_k_XmScrolledText_object, 14, CLASS_NAME, "XMSCROLLEDTEXT"}, {tkn_k_class_class, sym_k_XmScrolledWindow_object, 16, CLASS_NAME, "XMSCROLLEDWINDOW"}, {tkn_k_class_enumval, sym_k_XmSCROLL_HOR_enumval, 12, ENUMVAL_NAME, "XMSCROLL_HOR"}, {tkn_k_class_enumval, sym_k_XmSCROLL_VERT_enumval, 13, ENUMVAL_NAME, "XMSCROLL_VERT"}, {tkn_k_class_enumval, sym_k_XmSELECTED_enumval, 10, ENUMVAL_NAME, "XMSELECTED"}, {tkn_k_class_class, sym_k_XmSelectionBox_object, 14, CLASS_NAME, "XMSELECTIONBOX"}, {tkn_k_class_class, sym_k_XmSelectionDialog_object, 17, CLASS_NAME, "XMSELECTIONDIALOG"}, {tkn_k_class_enumval, sym_k_XmSELECT_ALL_enumval, 12, ENUMVAL_NAME, "XMSELECT_ALL"}, {tkn_k_class_enumval, sym_k_XmSELECT_LINE_enumval, 13, ENUMVAL_NAME, "XMSELECT_LINE"}, {tkn_k_class_enumval, sym_k_XmSELECT_PARAGRAPH_enumval, 18, ENUMVAL_NAME, "XMSELECT_PARAGRAPH"}, {tkn_k_class_enumval, sym_k_XmSELECT_POSITION_enumval, 17, ENUMVAL_NAME, "XMSELECT_POSITION"}, {tkn_k_class_enumval, sym_k_XmSELECT_WHITESPACE_enumval, 19, ENUMVAL_NAME, "XMSELECT_WHITESPACE"}, {tkn_k_class_enumval, sym_k_XmSELECT_WORD_enumval, 13, ENUMVAL_NAME, "XMSELECT_WORD"}, {tkn_k_class_class, sym_k_XmSeparator_object, 11, CLASS_NAME, "XMSEPARATOR"}, {tkn_k_class_class, sym_k_XmSeparatorGadget_object, 17, CLASS_NAME, "XMSEPARATORGADGET"}, {tkn_k_class_enumval, sym_k_XmSET_enumval, 5, ENUMVAL_NAME, "XMSET"}, {tkn_k_class_enumval, sym_k_XmSHADOWED_BACKGROUND_enumval, 21, ENUMVAL_NAME, "XMSHADOWED_BACKGROUND"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_IN_enumval, 18, ENUMVAL_NAME, "XMSHADOW_ETCHED_IN"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_IN_DASH_enumval, 23, ENUMVAL_NAME, "XMSHADOW_ETCHED_IN_DASH"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_OUT_enumval, 19, ENUMVAL_NAME, "XMSHADOW_ETCHED_OUT"}, {tkn_k_class_enumval, sym_k_XmSHADOW_ETCHED_OUT_DASH_enumval, 24, ENUMVAL_NAME, "XMSHADOW_ETCHED_OUT_DASH"}, {tkn_k_class_enumval, sym_k_XmSHADOW_IN_enumval, 11, ENUMVAL_NAME, "XMSHADOW_IN"}, {tkn_k_class_enumval, sym_k_XmSHADOW_OUT_enumval, 12, ENUMVAL_NAME, "XMSHADOW_OUT"}, {tkn_k_class_class, sym_k_XmSimpleSpinBox_object, 15, CLASS_NAME, "XMSIMPLESPINBOX"}, {tkn_k_class_enumval, sym_k_XmSINGLE_enumval, 8, ENUMVAL_NAME, "XMSINGLE"}, {tkn_k_class_enumval, sym_k_XmSINGLE_DASHED_LINE_enumval, 20, ENUMVAL_NAME, "XMSINGLE_DASHED_LINE"}, {tkn_k_class_enumval, sym_k_XmSINGLE_LINE_enumval, 13, ENUMVAL_NAME, "XMSINGLE_LINE"}, {tkn_k_class_enumval, sym_k_XmSINGLE_LINE_EDIT_enumval, 18, ENUMVAL_NAME, "XMSINGLE_LINE_EDIT"}, {tkn_k_class_enumval, sym_k_XmSINGLE_SELECT_enumval, 15, ENUMVAL_NAME, "XMSINGLE_SELECT"}, {tkn_k_class_enumval, sym_k_XmSLIDER_enumval, 8, ENUMVAL_NAME, "XMSLIDER"}, {tkn_k_class_enumval, sym_k_XmSMALL_ICON_enumval, 12, ENUMVAL_NAME, "XMSMALL_ICON"}, {tkn_k_class_enumval, sym_k_XmSNAP_TO_GRID_enumval, 14, ENUMVAL_NAME, "XMSNAP_TO_GRID"}, {tkn_k_class_enumval, sym_k_XmSOLID_enumval, 7, ENUMVAL_NAME, "XMSOLID"}, {tkn_k_class_enumval, sym_k_XmSPATIAL_enumval, 9, ENUMVAL_NAME, "XMSPATIAL"}, {tkn_k_class_class, sym_k_XmSpinBox_object, 9, CLASS_NAME, "XMSPINBOX"}, {tkn_k_class_enumval, sym_k_XmSPIRAL_enumval, 8, ENUMVAL_NAME, "XMSPIRAL"}, {tkn_k_class_enumval, sym_k_XmSTATIC_enumval, 8, ENUMVAL_NAME, "XMSTATIC"}, {tkn_k_class_enumval, sym_k_XmSTATUS_AREA_enumval, 13, ENUMVAL_NAME, "XMSTATUS_AREA"}, {tkn_k_class_enumval, sym_k_XmSTICKY_TAB_GROUP_enumval, 18, ENUMVAL_NAME, "XMSTICKY_TAB_GROUP"}, {tkn_k_class_enumval, sym_k_XmSTRING_enumval, 8, ENUMVAL_NAME, "XMSTRING"}, {tkn_k_class_argument, sym_k_XmStringComponent_arg, 17, ARGUMENT_NAME, "XMSTRINGCOMPONENT"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_CHARSET_enumval, 26, ENUMVAL_NAME, "XMSTRING_COMPONENT_CHARSET"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_DIRECTION_enumval, 28, ENUMVAL_NAME, "XMSTRING_COMPONENT_DIRECTION"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LAYOUT_POP_enumval, 29, ENUMVAL_NAME, "XMSTRING_COMPONENT_LAYOUT_POP"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LAYOUT_PUSH_enumval, 30, ENUMVAL_NAME, "XMSTRING_COMPONENT_LAYOUT_PUSH"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LOCALE_enumval, 25, ENUMVAL_NAME, "XMSTRING_COMPONENT_LOCALE"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_LOCALE_TEXT_enumval, 30, ENUMVAL_NAME, "XMSTRING_COMPONENT_LOCALE_TEXT"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_RENDITION_BEGIN_enumval, 34, ENUMVAL_NAME, "XMSTRING_COMPONENT_RENDITION_BEGIN"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_RENDITION_END_enumval, 32, ENUMVAL_NAME, "XMSTRING_COMPONENT_RENDITION_END"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_SEPARATOR_enumval, 28, ENUMVAL_NAME, "XMSTRING_COMPONENT_SEPARATOR"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_TAB_enumval, 22, ENUMVAL_NAME, "XMSTRING_COMPONENT_TAB"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_TEXT_enumval, 23, ENUMVAL_NAME, "XMSTRING_COMPONENT_TEXT"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_UNKNOWN_enumval, 26, ENUMVAL_NAME, "XMSTRING_COMPONENT_UNKNOWN"}, {tkn_k_class_enumval, sym_k_XmSTRING_COMPONENT_WIDECHAR_TEXT_enumval, 32, ENUMVAL_NAME, "XMSTRING_COMPONENT_WIDECHAR_TEXT"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_DEFAULT_enumval, 26, ENUMVAL_NAME, "XMSTRING_DIRECTION_DEFAULT"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_L_TO_R_enumval, 25, ENUMVAL_NAME, "XMSTRING_DIRECTION_L_TO_R"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_R_TO_L_enumval, 25, ENUMVAL_NAME, "XMSTRING_DIRECTION_R_TO_L"}, {tkn_k_class_enumval, sym_k_XmSTRING_DIRECTION_UNSET_enumval, 24, ENUMVAL_NAME, "XMSTRING_DIRECTION_UNSET"}, {tkn_k_class_class, sym_k_XmTab_object, 5, CLASS_NAME, "XMTAB"}, {tkn_k_class_class, sym_k_XmTabBox_object, 8, CLASS_NAME, "XMTABBOX"}, {tkn_k_class_class, sym_k_XmTabList_object, 9, CLASS_NAME, "XMTABLIST"}, {tkn_k_class_class, sym_k_XmTabStack_object, 10, CLASS_NAME, "XMTABSTACK"}, {tkn_k_class_enumval, sym_k_XmTABS_BASIC_enumval, 12, ENUMVAL_NAME, "XMTABS_BASIC"}, {tkn_k_class_enumval, sym_k_XmTABS_BEVELED_enumval, 14, ENUMVAL_NAME, "XMTABS_BEVELED"}, {tkn_k_class_enumval, sym_k_XmTABS_BOTTOM_TO_TOP_enumval, 20, ENUMVAL_NAME, "XMTABS_BOTTOM_TO_TOP"}, {tkn_k_class_enumval, sym_k_XmTABS_LEFT_TO_RIGHT_enumval, 20, ENUMVAL_NAME, "XMTABS_LEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_BOTTOM_enumval, 16, ENUMVAL_NAME, "XMTABS_ON_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_LEFT_enumval, 14, ENUMVAL_NAME, "XMTABS_ON_LEFT"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_RIGHT_enumval, 15, ENUMVAL_NAME, "XMTABS_ON_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTABS_ON_TOP_enumval, 13, ENUMVAL_NAME, "XMTABS_ON_TOP"}, {tkn_k_class_enumval, sym_k_XmTABS_RIGHT_TO_LEFT_enumval, 20, ENUMVAL_NAME, "XMTABS_RIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmTABS_ROUNDED_enumval, 14, ENUMVAL_NAME, "XMTABS_ROUNDED"}, {tkn_k_class_enumval, sym_k_XmTABS_SQUARED_enumval, 14, ENUMVAL_NAME, "XMTABS_SQUARED"}, {tkn_k_class_enumval, sym_k_XmTABS_STACKED_enumval, 14, ENUMVAL_NAME, "XMTABS_STACKED"}, {tkn_k_class_enumval, sym_k_XmTABS_STACKED_STATIC_enumval, 21, ENUMVAL_NAME, "XMTABS_STACKED_STATIC"}, {tkn_k_class_enumval, sym_k_XmTABS_TOP_TO_BOTTOM_enumval, 20, ENUMVAL_NAME, "XMTABS_TOP_TO_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmTAB_EDGE_BOTTOM_RIGHT_enumval, 23, ENUMVAL_NAME, "XMTAB_EDGE_BOTTOM_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTAB_EDGE_TOP_LEFT_enumval, 19, ENUMVAL_NAME, "XMTAB_EDGE_TOP_LEFT"}, {tkn_k_class_enumval, sym_k_XmTAB_GROUP_enumval, 11, ENUMVAL_NAME, "XMTAB_GROUP"}, {tkn_k_class_enumval, sym_k_XmTAB_ORIENTATION_DYNAMIC_enumval, 25, ENUMVAL_NAME, "XMTAB_ORIENTATION_DYNAMIC"}, {tkn_k_class_class, sym_k_XmTearOffButton_object, 15, CLASS_NAME, "XMTEAROFFBUTTON"}, {tkn_k_class_enumval, sym_k_XmTEAR_OFF_DISABLED_enumval, 19, ENUMVAL_NAME, "XMTEAR_OFF_DISABLED"}, {tkn_k_class_enumval, sym_k_XmTEAR_OFF_ENABLED_enumval, 18, ENUMVAL_NAME, "XMTEAR_OFF_ENABLED"}, {tkn_k_class_class, sym_k_XmTemplateDialog_object, 16, CLASS_NAME, "XMTEMPLATEDIALOG"}, {tkn_k_class_class, sym_k_XmText_object, 6, CLASS_NAME, "XMTEXT"}, {tkn_k_class_class, sym_k_XmTextField_object, 11, CLASS_NAME, "XMTEXTFIELD"}, {tkn_k_class_enumval, sym_k_XmTHERMOMETER_enumval, 13, ENUMVAL_NAME, "XMTHERMOMETER"}, {tkn_k_class_enumval, sym_k_XmTHUMB_MARK_enumval, 12, ENUMVAL_NAME, "XMTHUMB_MARK"}, {tkn_k_class_class, sym_k_XmToggleButton_object, 14, CLASS_NAME, "XMTOGGLEBUTTON"}, {tkn_k_class_class, sym_k_XmToggleButtonGadget_object, 20, CLASS_NAME, "XMTOGGLEBUTTONGADGET"}, {tkn_k_class_enumval, sym_k_XmTOGGLE_BOOLEAN_enumval, 16, ENUMVAL_NAME, "XMTOGGLE_BOOLEAN"}, {tkn_k_class_enumval, sym_k_XmTOGGLE_INDETERMINATE_enumval, 22, ENUMVAL_NAME, "XMTOGGLE_INDETERMINATE"}, {tkn_k_class_enumval, sym_k_XmTOP_LEFT_enumval, 10, ENUMVAL_NAME, "XMTOP_LEFT"}, {tkn_k_class_enumval, sym_k_XmTOP_RIGHT_enumval, 11, ENUMVAL_NAME, "XMTOP_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTOP_TO_BOTTOM_enumval, 15, ENUMVAL_NAME, "XMTOP_TO_BOTTOM"}, {tkn_k_class_enumval, sym_k_XmTOP_TO_BOTTOM_LEFT_TO_RIGHT_enumval, 29, ENUMVAL_NAME, "XMTOP_TO_BOTTOM_LEFT_TO_RIGHT"}, {tkn_k_class_enumval, sym_k_XmTOP_TO_BOTTOM_RIGHT_TO_LEFT_enumval, 29, ENUMVAL_NAME, "XMTOP_TO_BOTTOM_RIGHT_TO_LEFT"}, {tkn_k_class_enumval, sym_k_XmTOUCH_ONLY_enumval, 12, ENUMVAL_NAME, "XMTOUCH_ONLY"}, {tkn_k_class_enumval, sym_k_XmTOUCH_OVER_enumval, 12, ENUMVAL_NAME, "XMTOUCH_OVER"}, {tkn_k_class_class, sym_k_XmTree_object, 6, CLASS_NAME, "XMTREE"}, {tkn_k_class_enumval, sym_k_XmTreeCompressLeaves_enumval, 20, ENUMVAL_NAME, "XMTREECOMPRESSLEAVES"}, {tkn_k_class_enumval, sym_k_XmTreeCompressNone_enumval, 18, ENUMVAL_NAME, "XMTREECOMPRESSNONE"}, {tkn_k_class_enumval, sym_k_XmTreeDirect_enumval, 12, ENUMVAL_NAME, "XMTREEDIRECT"}, {tkn_k_class_enumval, sym_k_XmTreeLadder_enumval, 12, ENUMVAL_NAME, "XMTREELADDER"}, {tkn_k_class_enumval, sym_k_XmTROUGH_COLOR_enumval, 14, ENUMVAL_NAME, "XMTROUGH_COLOR"}, {tkn_k_class_enumval, sym_k_XmUNMAP_enumval, 7, ENUMVAL_NAME, "XMUNMAP"}, {tkn_k_class_enumval, sym_k_XmUNPOST_enumval, 8, ENUMVAL_NAME, "XMUNPOST"}, {tkn_k_class_enumval, sym_k_XmUNPOST_AND_REPLAY_enumval, 19, ENUMVAL_NAME, "XMUNPOST_AND_REPLAY"}, {tkn_k_class_enumval, sym_k_XmUNSET_enumval, 7, ENUMVAL_NAME, "XMUNSET"}, {tkn_k_class_enumval, sym_k_XmVARIABLE_enumval, 10, ENUMVAL_NAME, "XMVARIABLE"}, {tkn_k_class_enumval, sym_k_XmVERTICAL_enumval, 10, ENUMVAL_NAME, "XMVERTICAL"}, {tkn_k_class_enumval, sym_k_XmVERT_SCROLLBAR_enumval, 16, ENUMVAL_NAME, "XMVERT_SCROLLBAR"}, {tkn_k_class_class, sym_k_XmWarningDialog_object, 15, CLASS_NAME, "XMWARNINGDIALOG"}, {tkn_k_class_class, sym_k_XmWorkArea_object, 10, CLASS_NAME, "XMWORKAREA"}, {tkn_k_class_class, sym_k_XmWorkingDialog_object, 15, CLASS_NAME, "XMWORKINGDIALOG"}, {tkn_k_class_enumval, sym_k_XmWORK_AREA_enumval, 11, ENUMVAL_NAME, "XMWORK_AREA"}, {tkn_k_class_enumval, sym_k_XmZERO_BASED_enumval, 12, ENUMVAL_NAME, "XMZERO_BASED"}, {tkn_k_class_child, sym_k_Xm_Apply_child, 8, CHILD_NAME, "XM_APPLY"}, {tkn_k_class_child, sym_k_Xm_Arrow_child, 8, CHILD_NAME, "XM_ARROW"}, {tkn_k_class_child, sym_k_Xm_Cancel_child, 9, CHILD_NAME, "XM_CANCEL"}, {tkn_k_class_child, sym_k_Xm_ColorListToggle_child, 18, CHILD_NAME, "XM_COLORLISTTOGGLE"}, {tkn_k_class_child, sym_k_Xm_ColorSlidersToggle_child, 21, CHILD_NAME, "XM_COLORSLIDERSTOGGLE"}, {tkn_k_class_child, sym_k_Xm_Dir_child, 6, CHILD_NAME, "XM_DIR"}, {tkn_k_class_child, sym_k_Xm_DirList_child, 10, CHILD_NAME, "XM_DIRLIST"}, {tkn_k_class_child, sym_k_Xm_Filter_child, 9, CHILD_NAME, "XM_FILTER"}, {tkn_k_class_child, sym_k_Xm_FilterLabel_child, 14, CHILD_NAME, "XM_FILTERLABEL"}, {tkn_k_class_child, sym_k_Xm_FilterText_child, 13, CHILD_NAME, "XM_FILTERTEXT"}, {tkn_k_class_child, sym_k_Xm_Find_child, 7, CHILD_NAME, "XM_FIND"}, {tkn_k_class_child, sym_k_Xm_FindText_child, 11, CHILD_NAME, "XM_FINDTEXT"}, {tkn_k_class_child, sym_k_Xm_Help_child, 7, CHILD_NAME, "XM_HELP"}, {tkn_k_class_child, sym_k_Xm_HorScrollBar_child, 15, CHILD_NAME, "XM_HORSCROLLBAR"}, {tkn_k_class_child, sym_k_Xm_Items_child, 8, CHILD_NAME, "XM_ITEMS"}, {tkn_k_class_child, sym_k_Xm_ItemsList_child, 12, CHILD_NAME, "XM_ITEMSLIST"}, {tkn_k_class_child, sym_k_Xm_Label_child, 8, CHILD_NAME, "XM_LABEL"}, {tkn_k_class_child, sym_k_Xm_List_child, 7, CHILD_NAME, "XM_LIST"}, {tkn_k_class_child, sym_k_Xm_Message_child, 10, CHILD_NAME, "XM_MESSAGE"}, {tkn_k_class_child, sym_k_Xm_OK_child, 5, CHILD_NAME, "XM_OK"}, {tkn_k_class_child, sym_k_Xm_OptionButton_child, 15, CHILD_NAME, "XM_OPTIONBUTTON"}, {tkn_k_class_child, sym_k_Xm_OptionLabel_child, 14, CHILD_NAME, "XM_OPTIONLABEL"}, {tkn_k_class_child, sym_k_Xm_Selection_child, 12, CHILD_NAME, "XM_SELECTION"}, {tkn_k_class_child, sym_k_Xm_Separator_child, 12, CHILD_NAME, "XM_SEPARATOR"}, {tkn_k_class_child, sym_k_Xm_Separator1_child, 13, CHILD_NAME, "XM_SEPARATOR1"}, {tkn_k_class_child, sym_k_Xm_Separator2_child, 13, CHILD_NAME, "XM_SEPARATOR2"}, {tkn_k_class_child, sym_k_Xm_Separator3_child, 13, CHILD_NAME, "XM_SEPARATOR3"}, {tkn_k_class_child, sym_k_Xm_Symbol_child, 9, CHILD_NAME, "XM_SYMBOL"}, {tkn_k_class_child, sym_k_Xm_TearOffControl_child, 17, CHILD_NAME, "XM_TEAROFFCONTROL"}, {tkn_k_class_child, sym_k_Xm_Text_child, 7, CHILD_NAME, "XM_TEXT"}, {tkn_k_class_child, sym_k_Xm_TextField_child, 12, CHILD_NAME, "XM_TEXTFIELD"}, {tkn_k_class_child, sym_k_Xm_Title_child, 8, CHILD_NAME, "XM_TITLE"}, {tkn_k_class_child, sym_k_Xm_VertScrollBar_child, 16, CHILD_NAME, "XM_VERTSCROLLBAR"}, {tkn_k_class_charset, sym_k__MOTIF_DEFAULT_LOCALE_charset, 21, CHARSET_NAME, "_MOTIF_DEFAULT_LOCALE"}, }; externaldef(uil_sym_glbl) key_keytable_entry_type *key_table_case_ins = key_table_case_ins_vec; motif-2.3.8/tools/wml/UilSymNam.h0000644000175000017500000010173013211513006013543 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* Define mapping of sym_k_..._object codes to widget names. */ externaldef(uil_sym_glbl) int uil_max_object = 88; static char *uil_widget_names_vec[] = { "", /* NOT USED */ "DtEditor", "DtHelpDialog", "DtHelpQuickDialog", "DtMenuButton", "DtPrintSetupBox", "DtPrintSetupDialog", "DtTerm", "DtTermPrimitive", "XmArrowButton", "XmArrowButtonGadget", "XmBulletinBoard", "XmBulletinBoardDialog", "XmButtonBox", "XmCascadeButton", "XmCascadeButtonGadget", "XmCheckBox", "XmColorSelector", "XmColumn", "XmComboBox", "XmCommand", "XmCommandDialog", "XmContainer", "XmDataField", "XmDialogShell", "XmDrawingArea", "XmDrawnButton", "XmDropDown", "XmErrorDialog", "XmFileSelectionBox", "XmFileSelectionDialog", "XmFontSelector", "XmForm", "XmFormDialog", "XmFrame", "XmIconBox", "XmIconButton", "XmIconGadget", "XmInformationDialog", "XmLabel", "XmLabelGadget", "XmList", "XmMainWindow", "XmMenuBar", "XmMenuShell", "XmMessageBox", "XmMessageDialog", "XmMultiList", "XmNotebook", "XmOptionMenu", "XmOutline", "XmPaned", "XmPanedWindow", "XmPopupMenu", "XmPromptDialog", "XmPulldownMenu", "XmPushButton", "XmPushButtonGadget", "XmQuestionDialog", "XmRadioBox", "XmRenderTable", "XmRendition", "XmRowColumn", "XmScale", "XmScrollBar", "XmScrolledList", "XmScrolledText", "XmScrolledWindow", "XmSelectionBox", "XmSelectionDialog", "XmSeparator", "XmSeparatorGadget", "XmSimpleSpinBox", "XmSpinBox", "XmTab", "XmTabBox", "XmTabList", "XmTabStack", "XmTearOffButton", "XmTemplateDialog", "XmText", "XmTextField", "XmToggleButton", "XmToggleButtonGadget", "XmTree", "XmWarningDialog", "XmWorkArea", "XmWorkingDialog", "user_defined", }; externaldef(uil_sym_glbl) char **uil_widget_names = uil_widget_names_vec; /* Define mapping of sym_k_..._arg codes to argument names. */ externaldef(uil_sym_glbl) int uil_max_arg = 714; static char *uil_argument_names_vec[] = { "", /* NOT USED */ "DtNallowSendEvents", "DtNappCursorDefault", "DtNappKeypadDefault", "DtNautoShowCursorPosition", "DtNautoWrap", "DtNbackLabelString", "DtNbackgroundIsSelect", "DtNbaseHeight", "DtNbaseWidth", "DtNblinkRate", "DtNbuttonFontList", "DtNc132", "DtNcascadePixmap", "DtNcenterToggleLabel", "DtNchangeAllButtonLabel", "DtNchangeButtonLabel", "DtNchangeFieldLabel", "DtNcharCursorStyle", "DtNcloseLabelString", "DtNcolumns", "DtNconsoleMode", "DtNcopies", "DtNcsWidth", "DtNcurrentLineLabel", "DtNcursorPosition", "DtNcursorPositionVisible", "DtNdescription", "DtNdialogTitle", "DtNeditable", "DtNemulationId", "DtNexecutionPolicy", "DtNfileName", "DtNfindButtonLabel", "DtNfindChangeDialogTitle", "DtNfindFieldLabel", "DtNformatAllButtonLabel", "DtNformatParagraphButtonLabel", "DtNformatSettingsDialogTitle", "DtNheightInc", "DtNhelpFile", "DtNhelpLabelString", "DtNhelpOnHelpVolume", "DtNhelpPrint", "DtNhelpType", "DtNhelpVolume", "DtNinformationDialogTitle", "DtNinsertLabel", "DtNjumpScroll", "DtNjustifyToggleLabel", "DtNkshMode", "DtNlabelFontList", "DtNleftAlignToggleLabel", "DtNleftMarginFieldLabel", "DtNlocationId", "DtNlogFile", "DtNlogInhibit", "DtNlogging", "DtNmanPage", "DtNmapOnOutput", "DtNmapOnOutputDelay", "DtNmarginBell", "DtNmarginHeight", "DtNmarginWidth", "DtNmaxLength", "DtNminimizeButtons", "DtNmisspelledListLabel", "DtNmoreLabelString", "DtNnMarginBell", "DtNoverstrike", "DtNoverstrikeLabel", "DtNpaperSize", "DtNpointerBlank", "DtNpointerBlankDelay", "DtNpointerColor", "DtNpointerColorBackground", "DtNpointerShape", "DtNprintDestination", "DtNprintLabelString", "DtNprintSetupMode", "DtNprinter", "DtNprinterInfoProc", "DtNprinterName", "DtNreverseVideo", "DtNreverseWrap", "DtNrightAlignToggleLabel", "DtNrightMarginFieldLabel", "DtNrows", "DtNsaveLines", "DtNscrollBarPolicy", "DtNscrollHorizontal", "DtNscrollLeftSide", "DtNscrollTopSide", "DtNscrollVertical", "DtNselectFileProc", "DtNselectPrinterProc", "DtNshadowType", "DtNshowNewWindowButton", "DtNshowStatusLine", "DtNspellDialogTitle", "DtNspellFilter", "DtNstickyNextCursor", "DtNstickyPrevCursor", "DtNstringData", "DtNsubMenuId", "DtNsubprocessArgv", "DtNsubprocessCmd", "DtNsubprocessExec", "DtNsubprocessLoginShell", "DtNsubprocessPid", "DtNsubprocessTerminationCatch", "DtNsunFunctionKeys", "DtNtermDevice", "DtNtermDeviceAllocate", "DtNtermId", "DtNtermName", "DtNtermSlaveName", "DtNtextBackground", "DtNtextFontList", "DtNtextForeground", "DtNtextTranslations", "DtNtopCharacter", "DtNtopicTitle", "DtNtotalLineCountLabel", "DtNttyModes", "DtNuserBoldFont", "DtNuserFont", "DtNverifyPrinterProc", "DtNverticalScrollBar", "DtNvisiblePathCount", "DtNvisualBell", "DtNwidthInc", "DtNwordWrap", "DtNworkAreaLocation", "XmN100DPIstring", "XmN75DPIstring", "XmNaccelerator", "XmNacceleratorText", "XmNaccelerators", "XmNadjustLast", "XmNadjustMargin", "XmNalignment", "XmNallowOverlap", "XmNallowResize", "XmNallowShellResize", "XmNallowUnusedSpace", "XmNancestorSensitive", "XmNanyLowerString", "XmNanyString", "XmNapplyLabelString", "XmNarmColor", "XmNarmPixmap", "XmNarrowDirection", "XmNarrowLayout", "XmNarrowOrientation", "XmNarrowSensitivity", "XmNarrowSize", "XmNarrowSpacing", "XmNaudibleWarning", "XmNautoClose", "XmNautoDragModel", "XmNautoFill", "XmNautoShowCursorPosition", "XmNautoUnmanage", "XmNautomaticSelection", "XmNbackPageBackground", "XmNbackPageForeground", "XmNbackPageNumber", "XmNbackPagePlacement", "XmNbackPageSize", "XmNbackground", "XmNbackgroundPixmap", "XmNbaseHeight", "XmNbaseWidth", "XmNbindingPixmap", "XmNbindingType", "XmNbindingWidth", "XmNblinkRate", "XmNblueSliderLabel", "XmNboldString", "XmNborderColor", "XmNborderPixmap", "XmNborderWidth", "XmNbothString", "XmNbottomAttachment", "XmNbottomOffset", "XmNbottomPosition", "XmNbottomShadowColor", "XmNbottomShadowPixmap", "XmNbottomWidget", "XmNbuttonCount", "XmNbuttonFontList", "XmNbuttonRenderTable", "XmNbuttons", "XmNcancelButton", "XmNcancelLabelString", "XmNcascadePixmap", "XmNcellX", "XmNcellY", "XmNchildHorizontalAlignment", "XmNchildHorizontalSpacing", "XmNchildPlacement", "XmNchildType", "XmNchildVerticalAlignment", "XmNclipWindow", "XmNcloseFolderPixmap", "XmNcollapsedStatePixmap", "XmNcolorListTogLabel", "XmNcolorMode", "XmNcolorName", "XmNcolormap", "XmNcolumnTitles", "XmNcolumns", "XmNcomboBoxType", "XmNcomboTranslations", "XmNcommand", "XmNcommandWindow", "XmNcommandWindowLocation", "XmNcompressStyle", "XmNconnectNodes", "XmNconnectStyle", "XmNconstrainWidth", "XmNcreatePopupChildProc", "XmNcurrentFont", "XmNcurrentPageNumber", "XmNcursor", "XmNcursorPosition", "XmNcursorPositionVisible", "XmNcustomizedCombinationBox", "XmNdarkThreshold", "XmNdecimal", "XmNdecimalPoints", "XmNdefaultArrowSensitivity", "XmNdefaultButton", "XmNdefaultButtonShadowThickness", "XmNdefaultButtonType", "XmNdefaultEncodingString", "XmNdefaultEntryLabelAlignment", "XmNdefaultEntryLabelFontList", "XmNdefaultEntryLabelRenderTable", "XmNdefaultFillStyle", "XmNdefaultFontList", "XmNdefaultPosition", "XmNdeleteResponse", "XmNdepth", "XmNdetail", "XmNdetailColumnHeading", "XmNdetailColumnHeadingCount", "XmNdetailCount", "XmNdetailOrder", "XmNdetailOrderCount", "XmNdetailShadowThickness", "XmNdetailTabList", "XmNdialogStyle", "XmNdialogTitle", "XmNdialogType", "XmNdirListItemCount", "XmNdirListItems", "XmNdirListLabelString", "XmNdirMask", "XmNdirSearchProc", "XmNdirSpec", "XmNdirectory", "XmNdirectoryValid", "XmNdistribution", "XmNdoubleClickInterval", "XmNeditMode", "XmNeditable", "XmNencodingList", "XmNencodingString", "XmNentryAlignment", "XmNentryBackground", "XmNentryBorder", "XmNentryClass", "XmNentryData", "XmNentryLabelAlignment", "XmNentryLabelFontList", "XmNentryLabelPixmap", "XmNentryLabelRenderTable", "XmNentryLabelString", "XmNentryLabelType", "XmNentryParent", "XmNentryVerticalAlignment", "XmNentryViewType", "XmNequalSize", "XmNexpandedStatePixmap", "XmNfamilyString", "XmNfileListItemCount", "XmNfileListItems", "XmNfileListLabelString", "XmNfileReadError", "XmNfileSearchProc", "XmNfileTypeMask", "XmNfillOnArm", "XmNfillOnSelect", "XmNfillOption", "XmNfillStyle", "XmNfilterLabelString", "XmNfindLabel", "XmNfirstColumn", "XmNfirstColumnPixmaps", "XmNfirstPageNumber", "XmNfirstRow", "XmNfont", "XmNfontEncoding", "XmNfontFoundry", "XmNfontList", "XmNfontName", "XmNfontSize", "XmNfontStyle", "XmNfontType", "XmNforeground", "XmNforegroundThreshold", "XmNfractionBase", "XmNframeBackground", "XmNframeChildType", "XmNframeShadowThickness", "XmNfreeTabPixmap", "XmNgeometry", "XmNgreenSliderLabel", "XmNheight", "XmNheightInc", "XmNhelpLabelString", "XmNhighlightColor", "XmNhighlightOnEnter", "XmNhighlightPixmap", "XmNhighlightThickness", "XmNhistoryItemCount", "XmNhistoryItems", "XmNhistoryMaxItems", "XmNhistoryVisibleItemCount", "XmNhorizontalDelta", "XmNhorizontalMargin", "XmNhorizontalNodeSpace", "XmNhorizontalScrollBar", "XmNhorizontalSpacing", "XmNiconMask", "XmNiconName", "XmNiconNameEncoding", "XmNiconPixmap", "XmNiconPlacement", "XmNiconTextPadding", "XmNiconWindow", "XmNiconX", "XmNiconY", "XmNiconic", "XmNincrement", "XmNincrementValue", "XmNindentSpace", "XmNindeterminateInsensitivePixmap", "XmNindeterminatePixmap", "XmNindicatorOn", "XmNindicatorSize", "XmNindicatorType", "XmNinitialDelay", "XmNinitialFocus", "XmNinitialResourcesPersistent", "XmNinitialState", "XmNinnerMarginHeight", "XmNinnerMarginWidth", "XmNinput", "XmNinputMethod", "XmNinputPolicy", "XmNinsertBefore", "XmNinsertPosition", "XmNisAligned", "XmNisHomogeneous", "XmNitalicString", "XmNitemCount", "XmNitemSpacing", "XmNitems", "XmNkeyboardFocusPolicy", "XmNlabel", "XmNlabelFontList", "XmNlabelInsensitivePixmap", "XmNlabelPixmap", "XmNlabelRenderTable", "XmNlabelSpacing", "XmNlabelString", "XmNlabelType", "XmNlargeCellHeight", "XmNlargeCellWidth", "XmNlargeIconMask", "XmNlargeIconPixmap", "XmNlargeIconX", "XmNlargeIconY", "XmNlastPageNumber", "XmNlayoutDirection", "XmNlayoutType", "XmNleftAttachment", "XmNleftOffset", "XmNleftPosition", "XmNleftWidget", "XmNlightThreshold", "XmNlineBackgroundColor", "XmNlineColor", "XmNlineStyle", "XmNlineWidth", "XmNlist", "XmNlistItemCount", "XmNlistItems", "XmNlistLabelString", "XmNlistMarginHeight", "XmNlistMarginWidth", "XmNlistSizePolicy", "XmNlistSpacing", "XmNlistUpdated", "XmNlistVisibleItemCount", "XmNloadModel", "XmNmainWindowMarginHeight", "XmNmainWindowMarginWidth", "XmNmajorTabSpacing", "XmNmappedWhenManaged", "XmNmappingDelay", "XmNmargin", "XmNmarginBottom", "XmNmarginHeight", "XmNmarginLeft", "XmNmarginRight", "XmNmarginTop", "XmNmarginWidth", "XmNmatchBehavior", "XmNmaxAspectX", "XmNmaxAspectY", "XmNmaxHeight", "XmNmaxLength", "XmNmaxWidth", "XmNmaximum", "XmNmaximumValue", "XmNmenuAccelerator", "XmNmenuBar", "XmNmenuHelpWidget", "XmNmenuHistory", "XmNmenuPost", "XmNmessageAlignment", "XmNmessageString", "XmNmessageWindow", "XmNminAspectX", "XmNminAspectY", "XmNminHeight", "XmNminWidth", "XmNminimizeButtons", "XmNminimum", "XmNminimumCellHeight", "XmNminimumCellWidth", "XmNminimumHorizontalCells", "XmNminimumValue", "XmNminimumVerticalCells", "XmNminorTabSpacing", "XmNmnemonic", "XmNmnemonicCharSet", "XmNmonoSpaceString", "XmNmultiClick", "XmNmustMatch", "XmNmwmDecorations", "XmNmwmFunctions", "XmNmwmInputMode", "XmNmwmMenu", "XmNnavigationType", "XmNnewVisualStyle", "XmNnoCellError", "XmNnoMatchString", "XmNnoResize", "XmNnodeCloseFolderPixmap", "XmNnodeOpenFolderPixmap", "XmNnodeState", "XmNnotebookChildType", "XmNnumColumns", "XmNnumRows", "XmNnumStacks", "XmNnumValues", "XmNoffsetModel", "XmNokLabelString", "XmNopenClosePadding", "XmNopenFolderPixmap", "XmNoptionString", "XmNorientation", "XmNotherString", "XmNoutlineButtonPolicy", "XmNoutlineColumnWidth", "XmNoutlineIndentation", "XmNoutlineLineStyle", "XmNoutlineState", "XmNoverrideRedirect", "XmNpacking", "XmNpageIncrement", "XmNpageNumber", "XmNpaneMaximum", "XmNpaneMinimum", "XmNparentNode", "XmNpattern", "XmNpendingDelete", "XmNpicture", "XmNpixmap", "XmNpixmapDepth", "XmNpixmapHeight", "XmNpixmapPlacement", "XmNpixmapTextPadding", "XmNpixmapWidth", "XmNpopupCursor", "XmNpopupEnabled", "XmNpopupOffset", "XmNpopupShellWidget", "XmNposition", "XmNpositionIndex", "XmNpositionMode", "XmNpositionType", "XmNpreeditType", "XmNpreferredPaneSize", "XmNprimaryOwnership", "XmNprocessingDirection", "XmNpromptString", "XmNpropSpaceString", "XmNpushButtonEnabled", "XmNqualifySearchDataProc", "XmNradioAlwaysOne", "XmNradioBehavior", "XmNrecomputeSize", "XmNredSliderLabel", "XmNrefigureMode", "XmNrenderTable", "XmNrenditionBackground", "XmNrenditionForeground", "XmNrepeatDelay", "XmNresizable", "XmNresizeHeight", "XmNresizePolicy", "XmNresizeToPreferred", "XmNresizeWidth", "XmNrgbFile", "XmNrightAttachment", "XmNrightOffset", "XmNrightPosition", "XmNrightWidget", "XmNrowColumnType", "XmNrows", "XmNrubberPositioning", "XmNsampleText", "XmNsashHeight", "XmNsashIndent", "XmNsashShadowThickness", "XmNsashTranslations", "XmNsashWidth", "XmNsaveUnder", "XmNscaleHeight", "XmNscaleMultiple", "XmNscaleWidth", "XmNscalingString", "XmNscreen", "XmNscrollBarDisplayPolicy", "XmNscrollBarPlacement", "XmNscrollHorizontal", "XmNscrollLeftSide", "XmNscrollTopSide", "XmNscrollVertical", "XmNscrolledWindowChildType", "XmNscrolledWindowMarginHeight", "XmNscrolledWindowMarginWidth", "XmNscrollingPolicy", "XmNselectColor", "XmNselectInsensitivePixmap", "XmNselectPixmap", "XmNselectThreshold", "XmNselectedColumn", "XmNselectedItem", "XmNselectedItemCount", "XmNselectedItems", "XmNselectedPosition", "XmNselectedPositionCount", "XmNselectedPositions", "XmNselectionArray", "XmNselectionArrayCount", "XmNselectionLabelString", "XmNselectionMode", "XmNselectionPolicy", "XmNselectionTechnique", "XmNsensitive", "XmNseparatorOn", "XmNseparatorType", "XmNset", "XmNshadowThickness", "XmNshadowType", "XmNshellUnitType", "XmNshowArrows", "XmNshowAsDefault", "XmNshowEntryLabel", "XmNshowFind", "XmNshowFontName", "XmNshowLabel", "XmNshowNameString", "XmNshowSash", "XmNshowSeparator", "XmNshowValue", "XmNsizeString", "XmNskipAdjust", "XmNsliderMark", "XmNsliderSize", "XmNsliderTogLabel", "XmNsliderVisual", "XmNslidingMode", "XmNsmallCellHeight", "XmNsmallCellWidth", "XmNsmallIconMask", "XmNsmallIconPixmap", "XmNsmallIconX", "XmNsmallIconY", "XmNsnapBackMultiple", "XmNsortFunctions", "XmNsource", "XmNspacing", "XmNspatialIncludeModel", "XmNspatialResizeModel", "XmNspatialSnapModel", "XmNspatialStyle", "XmNspinBoxChildType", "XmNstackedEffect", "XmNstretchable", "XmNstrikethruType", "XmNstringDirection", "XmNsubMenuId", "XmNsymbolPixmap", "XmNtabAlignment", "XmNtabAutoSelect", "XmNtabBackground", "XmNtabBackgroundPixmap", "XmNtabCornerPercent", "XmNtabEdge", "XmNtabForeground", "XmNtabLabelPixmap", "XmNtabLabelSpacing", "XmNtabLabelString", "XmNtabList", "XmNtabMarginHeight", "XmNtabMarginWidth", "XmNtabMode", "XmNtabOffset", "XmNtabOrientation", "XmNtabPixmapPlacement", "XmNtabSelectColor", "XmNtabSelectPixmap", "XmNtabSide", "XmNtabStringDirection", "XmNtabStyle", "XmNtabValue", "XmNtearOffModel", "XmNtearOffTitle", "XmNtextAccelerators", "XmNtextColumns", "XmNtextField", "XmNtextFontList", "XmNtextRenderTable", "XmNtextRows", "XmNtextString", "XmNtextTranslations", "XmNtitle", "XmNtitleEncoding", "XmNtitleString", "XmNtoggleMode", "XmNtoolTipEnable", "XmNtoolTipPostDelay", "XmNtoolTipPostDuration", "XmNtoolTipString", "XmNtopAttachment", "XmNtopCharacter", "XmNtopItemPosition", "XmNtopOffset", "XmNtopPosition", "XmNtopShadowColor", "XmNtopShadowPixmap", "XmNtopWidget", "XmNtransient", "XmNtransientFor", "XmNtranslations", "XmNtraversalOn", "XmNtroughColor", "XmNunderlineType", "XmNuniformTabSize", "XmNunitType", "XmNunpostBehavior", "XmNunselectColor", "XmNuseAsyncGeometry", "XmNuseImageCache", "XmNuseScaling", "XmNuseTextField", "XmNuserData", "XmNvalue", "XmNvalueWcs", "XmNvalues", "XmNverify", "XmNverifyBell", "XmNverticalDelta", "XmNverticalMargin", "XmNverticalNodeSpace", "XmNverticalScrollBar", "XmNverticalSpacing", "XmNviewType", "XmNvisibleItemCount", "XmNvisibleWhenOff", "XmNvisual", "XmNvisualEmphasis", "XmNvisualPolicy", "XmNwaitForWm", "XmNwhichButton", "XmNwidth", "XmNwidthInc", "XmNwinGravity", "XmNwindowGroup", "XmNwmTimeout", "XmNwordWrap", "XmNworkWindow", "XmNwrap", "XmNx", "XmNxlfdString", "XmNy", "XmStringComponent", }; externaldef(uil_sym_glbl) char **uil_argument_names = uil_argument_names_vec; /* Define mapping of sym_k_..._reason to reason names. */ externaldef(uil_sym_glbl) int uil_max_reason = 81; static char *uil_reason_names_vec[] = { "", /* NOT USED */ "DtNcancelCallback", "DtNcascadingCallback", "DtNcloseCallback", "DtNclosePrintDisplayCallback", "DtNhyperLinkCallback", "DtNinputVerifyCallback", "DtNoutputLogCallback", "DtNprintCallback", "DtNsetupCallback", "DtNstatusChangeCallback", "DtNsubprocessTerminationCallback", "DtNtextDeselectCallback", "DtNtextSelectCallback", "MrmNcreateCallback", "XmNactivateCallback", "XmNapplyCallback", "XmNarmCallback", "XmNbrowseSelectionCallback", "XmNcancelCallback", "XmNcascadingCallback", "XmNcommandChangedCallback", "XmNcommandEnteredCallback", "XmNconvertCallback", "XmNdecrementCallback", "XmNdefaultActionCallback", "XmNdestinationCallback", "XmNdestroyCallback", "XmNdisarmCallback", "XmNdoubleClickCallback", "XmNdragCallback", "XmNentryCallback", "XmNexposeCallback", "XmNextendedSelectionCallback", "XmNfocusCallback", "XmNfocusMovedCallback", "XmNgainPrimaryCallback", "XmNhelpCallback", "XmNincrementCallback", "XmNinputCallback", "XmNitemFoundCallback", "XmNitemNotFoundCallback", "XmNlosePrimaryCallback", "XmNlosingFocusCallback", "XmNmapCallback", "XmNmodifyVerifyCallback", "XmNmodifyVerifyCallbackWcs", "XmNmotionVerifyCallback", "XmNmultipleSelectionCallback", "XmNnoMatchCallback", "XmNnodeStateBegEndCallback", "XmNnodeStateCallback", "XmNnodeStateChangedCallback", "XmNokCallback", "XmNoutlineChangedCallback", "XmNpageChangedCallback", "XmNpageDecrementCallback", "XmNpageIncrementCallback", "XmNpictureErrorCallback", "XmNpopdownCallback", "XmNpopupCallback", "XmNpopupHandlerCallback", "XmNrealizeCallback", "XmNresizeCallback", "XmNselectCallback", "XmNselectionCallback", "XmNsimpleCallback", "XmNsingleSelectionCallback", "XmNtabSelectedCallback", "XmNtearOffMenuActivateCallback", "XmNtearOffMenuDeactivateCallback", "XmNtoBottomCallback", "XmNtoTopCallback", "XmNtraversalCallback", "XmNtraverseObscuredCallback", "XmNunmapCallback", "XmNunselectCallback", "XmNupdateShellCallback", "XmNupdateTextCallback", "XmNvalidateCallback", "XmNvalueChangedCallback", "XmNverifyTextCallback", }; externaldef(uil_sym_glbl) char **uil_reason_names = uil_reason_names_vec; /* Define mapping of sym_k_..._enumval to enumeration value names. */ externaldef(uil_sym_glbl) int uil_max_enumset = 116; externaldef(uil_sym_glbl) int uil_max_enumval = 399; static char *uil_enumval_names_vec[] = { "", /* NOT USED */ "Always", "DtHELP_AS_NEEDED_SCROLLBARS", "DtHELP_EXECUTE_ALL", "DtHELP_EXECUTE_NONE", "DtHELP_EXECUTE_QUERY_ALL", "DtHELP_EXECUTE_QUERY_UNALIASED", "DtHELP_NO_SCROLLBARS", "DtHELP_PAPERSIZE_A4", "DtHELP_PAPERSIZE_B5", "DtHELP_PAPERSIZE_EXECUTIVE", "DtHELP_PAPERSIZE_LEGAL", "DtHELP_PAPERSIZE_LETTER", "DtHELP_STATIC_SCROLLBARS", "DtHELP_TYPE_DYNAMIC_STRING", "DtHELP_TYPE_FILE", "DtHELP_TYPE_MAN_PAGE", "DtHELP_TYPE_STRING", "DtHELP_TYPE_TOPIC", "DtLONG_NAME", "DtMEDIUM_NAME", "DtPRINT_CLOSE_CONNECTION", "DtPRINT_NO_DESTINATION", "DtPRINT_RELEASE_CONNECTION", "DtPRINT_SETUP_PLAIN", "DtPRINT_SETUP_XP", "DtPRINT_TO_FILE", "DtPRINT_TO_PRINTER", "DtSHADOW_ETCHED_IN", "DtSHADOW_ETCHED_OUT", "DtSHADOW_IN", "DtSHADOW_OUT", "DtSHORT_NAME", "DtTERM_CHAR_CURSOR_BAR", "DtTERM_CHAR_CURSOR_BOX", "DtTERM_CHAR_CURSOR_INVISIBLE", "DtWORK_AREA_BOTTOM", "DtWORK_AREA_NONE", "DtWORK_AREA_TOP", "DtWORK_AREA_TOP_AND_BOTTOM", "FALSE", "IconicState", "LineDoubleDash", "LineOnOffDash", "LineSolid", "MWM_DECOR_ALL", "MWM_DECOR_BORDER", "MWM_DECOR_MAXIMIZE", "MWM_DECOR_MENU", "MWM_DECOR_MINIMIZE", "MWM_DECOR_RESIZEH", "MWM_DECOR_TITLE", "MWM_FUNC_ALL", "MWM_FUNC_CLOSE", "MWM_FUNC_MOVE", "MWM_FUNC_RESIZE", "MWM_INPUT_FULL_APPLICATION_MODAL", "MWM_INPUT_MODELESS", "MWM_INPUT_PRIMARY_APPLICATION_MODAL", "MWM_INPUT_SYSTEM_MODAL", "NormalState", "NotUseful", "TRUE", "WhenMapped", "Xm1000TH_INCHES", "Xm100TH_FONT_UNITS", "Xm100TH_MILLIMETERS", "Xm100TH_POINTS", "XmABSOLUTE", "XmADD_MODE", "XmALIGNMENT_BASELINE_BOTTOM", "XmALIGNMENT_BASELINE_TOP", "XmALIGNMENT_BEGINNING", "XmALIGNMENT_CENTER", "XmALIGNMENT_CONTENTS_BOTTOM", "XmALIGNMENT_CONTENTS_TOP", "XmALIGNMENT_END", "XmALIGNMENT_UNSPECIFIED", "XmALIGNMENT_WIDGET_BOTTOM", "XmALIGNMENT_WIDGET_TOP", "XmANY_ICON", "XmAPPEND", "XmAPPLICATION_DEFINED", "XmARROWS_BEGINNING", "XmARROWS_DECREMENT_SENSITIVE", "XmARROWS_DEFAULT_SENSITIVITY", "XmARROWS_END", "XmARROWS_FLAT_BEGINNING", "XmARROWS_FLAT_END", "XmARROWS_HORIZONTAL", "XmARROWS_INCREMENT_SENSITIVE", "XmARROWS_INSENSITIVE", "XmARROWS_SENSITIVE", "XmARROWS_SPLIT", "XmARROWS_VERTICAL", "XmARROW_DOWN", "XmARROW_LEFT", "XmARROW_RIGHT", "XmARROW_UP", "XmAS_IS", "XmAS_NEEDED", "XmATTACH_FORM", "XmATTACH_NONE", "XmATTACH_OPPOSITE_FORM", "XmATTACH_OPPOSITE_WIDGET", "XmATTACH_POSITION", "XmATTACH_SELF", "XmATTACH_WIDGET", "XmAUTOMATIC", "XmAUTO_DRAG_DISABLED", "XmAUTO_DRAG_ENABLED", "XmAUTO_SELECT", "XmAlwaysOpen", "XmBACKGROUND_COLOR", "XmBELL", "XmBOTTOM_LEFT", "XmBOTTOM_RIGHT", "XmBOTTOM_TO_TOP", "XmBOTTOM_TO_TOP_LEFT_TO_RIGHT", "XmBOTTOM_TO_TOP_RIGHT_TO_LEFT", "XmBROWSE_SELECT", "XmCELLS", "XmCENTER", "XmCENTIMETERS", "XmCLIP_WINDOW", "XmCLOSEST", "XmCOLLAPSED", "XmCOMBO_BOX", "XmCOMMAND_ABOVE_WORKSPACE", "XmCOMMAND_BELOW_WORKSPACE", "XmCOMMAND_WINDOW", "XmCONSTANT", "XmClosed", "XmDEFAULT_DIRECTION", "XmDESTROY", "XmDETAIL", "XmDIALOG_APPLICATION_MODAL", "XmDIALOG_CANCEL_BUTTON", "XmDIALOG_COMMAND", "XmDIALOG_DEFAULT_BUTTON", "XmDIALOG_ERROR", "XmDIALOG_FILE_SELECTION", "XmDIALOG_FULL_APPLICATION_MODAL", "XmDIALOG_HELP_BUTTON", "XmDIALOG_INFORMATION", "XmDIALOG_MESSAGE", "XmDIALOG_MESSAGE_LABEL", "XmDIALOG_MODELESS", "XmDIALOG_OK_BUTTON", "XmDIALOG_PRIMARY_APPLICATION_MODAL", "XmDIALOG_PROMPT", "XmDIALOG_QUESTION", "XmDIALOG_SELECTION", "XmDIALOG_SEPARATOR", "XmDIALOG_SYMBOL_LABEL", "XmDIALOG_SYSTEM_MODAL", "XmDIALOG_TEMPLATE", "XmDIALOG_WARNING", "XmDIALOG_WORKING", "XmDIALOG_WORK_AREA", "XmDISTRIBUTE_SPREAD", "XmDISTRIBUTE_TIGHT", "XmDOUBLE_DASHED_LINE", "XmDOUBLE_LINE", "XmDO_NOTHING", "XmDROP_DOWN_COMBO_BOX", "XmDROP_DOWN_LIST", "XmEACH_SIDE", "XmETCHED_LINE", "XmEXCLUSIVE_TAB_GROUP", "XmEXPANDED", "XmEXPLICIT", "XmEXTENDED_SELECT", "XmFILE_ANY_TYPE", "XmFILE_DIRECTORY", "XmFILE_REGULAR", "XmFILL_FLUSH", "XmFILL_RAGGED", "XmFILL_UNSPECIFIED", "XmFIRST_FIT", "XmFIRST_POSITION", "XmFONT_IS_FONT", "XmFONT_IS_FONTSET", "XmFONT_IS_XFT", "XmFONT_UNITS", "XmFOREGROUND_COLOR", "XmFRAME_GENERIC_CHILD", "XmFRAME_TITLE_CHILD", "XmFRAME_WORKAREA_CHILD", "XmFillAll", "XmFillMajor", "XmFillMinor", "XmFillNone", "XmGENERIC_CHILD", "XmGRID", "XmGROW_BALANCED", "XmGROW_MAJOR", "XmGROW_MINOR", "XmHORIZONTAL", "XmHOR_SCROLLBAR", "XmHidden", "XmINCHES", "XmINDETERMINATE", "XmINDICATOR_BOX", "XmINDICATOR_CHECK", "XmINDICATOR_CHECK_BOX", "XmINDICATOR_CROSS", "XmINDICATOR_CROSS_BOX", "XmINDICATOR_FILL", "XmINDICATOR_NONE", "XmINHERIT_POLICY", "XmINVALID_MATCH_BEHAVIOR", "XmIconBottom", "XmIconLeft", "XmIconNone", "XmIconOnly", "XmIconRight", "XmIconTop", "XmLARGE_ICON", "XmLAST_POSITION", "XmLEFT_TO_RIGHT", "XmLEFT_TO_RIGHT_BOTTOM_TO_TOP", "XmLEFT_TO_RIGHT_TOP_TO_BOTTOM", "XmLOAD_DEFERRED", "XmLOAD_IMMEDIATE", "XmListMode", "XmMAJOR_TAB", "XmMARQUEE", "XmMARQUEE_EXTEND_BOTH", "XmMARQUEE_EXTEND_START", "XmMAX_ON_BOTTOM", "XmMAX_ON_LEFT", "XmMAX_ON_RIGHT", "XmMAX_ON_TOP", "XmMAX_SIDE", "XmMENU_BAR", "XmMENU_OPTION", "XmMENU_POPUP", "XmMENU_PULLDOWN", "XmMESSAGE_WINDOW", "XmMILLIMETERS", "XmMINOR_TAB", "XmMIN_SIDE", "XmMULTICLICK_DISCARD", "XmMULTICLICK_KEEP", "XmMULTIPLE_SELECT", "XmMULTI_LINE_EDIT", "XmNEAR_BORDER", "XmNEAR_SLIDER", "XmNONE", "XmNORMAL_MODE", "XmNOT_SELECTED", "XmNO_AUTO_SELECT", "XmNO_LINE", "XmNO_ORIENTATION", "XmNO_PACKING", "XmNO_SCROLL", "XmNUMERIC", "XmN_OF_MANY", "XmONE_BASED", "XmONE_OF_MANY", "XmONE_OF_MANY_DIAMOND", "XmONE_OF_MANY_ROUND", "XmOUTLINE", "XmOUTLINE_BUTTON_ABSENT", "XmOUTLINE_BUTTON_PRESENT", "XmOWN_ALWAYS", "XmOWN_MULTIPLE", "XmOWN_NEVER", "XmOWN_POSSIBLE_MULTIPLE", "XmOpen", "XmPACK_COLUMN", "XmPACK_NONE", "XmPACK_TIGHT", "XmPAGE", "XmPAGE_SCROLLER", "XmPER_SHELL", "XmPER_WIDGET", "XmPIXELS", "XmPIXMAP", "XmPIXMAP_AND_STRING", "XmPIXMAP_BOTTOM", "XmPIXMAP_LEFT", "XmPIXMAP_NONE", "XmPIXMAP_ONLY", "XmPIXMAP_OVERLAP_ONLY", "XmPIXMAP_RIGHT", "XmPIXMAP_TOP", "XmPLACE_ABOVE_SELECTION", "XmPLACE_BELOW_SELECTION", "XmPLACE_TOP", "XmPOINTER", "XmPOINTS", "XmPOSITION_INDEX", "XmPOSITION_VALUE", "XmQUICK_NAVIGATE", "XmRELATIVE", "XmRESIZE_ANY", "XmRESIZE_GROW", "XmRESIZE_IF_POSSIBLE", "XmRESIZE_NONE", "XmRIGHT_TO_LEFT", "XmRIGHT_TO_LEFT_BOTTOM_TO_TOP", "XmRIGHT_TO_LEFT_TOP_TO_BOTTOM", "XmROUND_MARK", "XmSCROLL_HOR", "XmSCROLL_VERT", "XmSELECTED", "XmSELECT_ALL", "XmSELECT_LINE", "XmSELECT_PARAGRAPH", "XmSELECT_POSITION", "XmSELECT_WHITESPACE", "XmSELECT_WORD", "XmSET", "XmSHADOWED_BACKGROUND", "XmSHADOW_ETCHED_IN", "XmSHADOW_ETCHED_IN_DASH", "XmSHADOW_ETCHED_OUT", "XmSHADOW_ETCHED_OUT_DASH", "XmSHADOW_IN", "XmSHADOW_OUT", "XmSINGLE", "XmSINGLE_DASHED_LINE", "XmSINGLE_LINE", "XmSINGLE_LINE_EDIT", "XmSINGLE_SELECT", "XmSLIDER", "XmSMALL_ICON", "XmSNAP_TO_GRID", "XmSOLID", "XmSPATIAL", "XmSPIRAL", "XmSTATIC", "XmSTATUS_AREA", "XmSTICKY_TAB_GROUP", "XmSTRING", "XmSTRING_COMPONENT_CHARSET", "XmSTRING_COMPONENT_DIRECTION", "XmSTRING_COMPONENT_LAYOUT_POP", "XmSTRING_COMPONENT_LAYOUT_PUSH", "XmSTRING_COMPONENT_LOCALE", "XmSTRING_COMPONENT_LOCALE_TEXT", "XmSTRING_COMPONENT_RENDITION_BEGIN", "XmSTRING_COMPONENT_RENDITION_END", "XmSTRING_COMPONENT_SEPARATOR", "XmSTRING_COMPONENT_TAB", "XmSTRING_COMPONENT_TEXT", "XmSTRING_COMPONENT_UNKNOWN", "XmSTRING_COMPONENT_WIDECHAR_TEXT", "XmSTRING_DIRECTION_DEFAULT", "XmSTRING_DIRECTION_L_TO_R", "XmSTRING_DIRECTION_R_TO_L", "XmSTRING_DIRECTION_UNSET", "XmScaleMode", "XmTABS_BASIC", "XmTABS_BEVELED", "XmTABS_BOTTOM_TO_TOP", "XmTABS_LEFT_TO_RIGHT", "XmTABS_ON_BOTTOM", "XmTABS_ON_LEFT", "XmTABS_ON_RIGHT", "XmTABS_ON_TOP", "XmTABS_RIGHT_TO_LEFT", "XmTABS_ROUNDED", "XmTABS_SQUARED", "XmTABS_STACKED", "XmTABS_STACKED_STATIC", "XmTABS_TOP_TO_BOTTOM", "XmTAB_EDGE_BOTTOM_RIGHT", "XmTAB_EDGE_TOP_LEFT", "XmTAB_GROUP", "XmTAB_ORIENTATION_DYNAMIC", "XmTEAR_OFF_DISABLED", "XmTEAR_OFF_ENABLED", "XmTHERMOMETER", "XmTHUMB_MARK", "XmTOGGLE_BOOLEAN", "XmTOGGLE_INDETERMINATE", "XmTOP_LEFT", "XmTOP_RIGHT", "XmTOP_TO_BOTTOM", "XmTOP_TO_BOTTOM_LEFT_TO_RIGHT", "XmTOP_TO_BOTTOM_RIGHT_TO_LEFT", "XmTOUCH_ONLY", "XmTOUCH_OVER", "XmTROUGH_COLOR", "XmTreeCompressLeaves", "XmTreeCompressNone", "XmTreeDirect", "XmTreeLadder", "XmUNMAP", "XmUNPOST", "XmUNPOST_AND_REPLAY", "XmUNSET", "XmVARIABLE", "XmVERTICAL", "XmVERT_SCROLLBAR", "XmWORK_AREA", "XmZERO_BASED", }; externaldef(uil_sym_glbl) char **uil_enumval_names = uil_enumval_names_vec; /* Define mapping of sym_k_..._charset to enumeration value names. */ externaldef(uil_sym_glbl) int uil_max_charset = 27; static char *uil_charset_names_vec[] = { "", /* NOT USED */ "", "XmFONTLIST_DEFAULT_TAG", "_MOTIF_DEFAULT_LOCALE", "ansi_cyrillic", "big5", "dos_cyrillic", "euc", "gb_hanzi", "gb_hanzi_gr", "iso_arabic", "iso_arabic_lr", "iso_cyrillic", "iso_greek", "iso_hebrew", "iso_hebrew_lr", "iso_ir_111", "iso_latin1", "iso_latin2", "iso_latin3", "iso_latin4", "iso_latin5", "jis_kanji", "jis_kanji_gr", "jis_katakana", "ksc_hangul", "ksc_hangul_gr", "utf8", }; externaldef(uil_sym_glbl) char **uil_charset_names = uil_charset_names_vec; /* Define mapping of sym_k_..._child codes to child names. */ externaldef(uil_sym_glbl) int uil_max_child = 33; static char *uil_child_names_vec[] = { "", /* NOT USED */ "Xm_Apply", "Xm_Arrow", "Xm_Cancel", "Xm_ColorListToggle", "Xm_ColorSlidersToggle", "Xm_Dir", "Xm_DirList", "Xm_Filter", "Xm_FilterLabel", "Xm_FilterText", "Xm_Find", "Xm_FindText", "Xm_Help", "Xm_HorScrollBar", "Xm_Items", "Xm_ItemsList", "Xm_Label", "Xm_List", "Xm_Message", "Xm_OK", "Xm_OptionButton", "Xm_OptionLabel", "Xm_Selection", "Xm_Separator", "Xm_Separator1", "Xm_Separator2", "Xm_Separator3", "Xm_Symbol", "Xm_TearOffControl", "Xm_Text", "Xm_TextField", "Xm_Title", "Xm_VertScrollBar", }; externaldef(uil_sym_glbl) char **uil_child_names = uil_child_names_vec; motif-2.3.8/tools/wml/motif.wml0000644000175000017500000052651613175675251013414 00000000000000! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY ! ! This file defines the Motif UIL language ! ! ! UIL data types ! DataType integer; string { InternalLiteral = char_8; }; boolean { InternalLiteral = bool; }; pixmap; float; font; translation_table { InternalLiteral = trans_table; DocName = "translation table";}; widget_ref { DocName = "widget reference"; }; any; color; compound_string { DocName = "compound string"; }; string_table { DocName = "string table"; }; font_table { DocName = "font table"; }; icon; color_table { DocName = "color table"; }; class_rec_name { DocName = "class record name"; }; argument; reason; identifier; asciz_table { DocName = "asciz table"; }; integer_table { DocName = "integer table"; }; xbitmapfile { DocName = "X bitmap file"; }; single_float { DocName = "Single float"; }; keysym; rgb; localized_string { DocName = "localized string"; }; wide_character { InternalLiteral = wchar_string; DocName = "wide character string"; }; fontset; horizontal_integer; vertical_integer; horizontal_float; vertical_float; ! ! UIL character sets ! CharacterSet iso_latin1 { XmStringCharsetName = "ISO8859-1"; Alias = "ISOLatin1"; Alias = "88591"; Alias = "ASCII"; }; iso_latin2 { XmStringCharsetName = "ISO8859-2"; Alias = "ISOLatin2"; Alias = "88592"; }; iso_latin3 { XmStringCharsetName = "ISO8859-3"; Alias = "ISOLatin3"; Alias = "88593"; }; iso_latin4 { XmStringCharsetName = "ISO8859-4"; Alias = "ISOLatin4"; Alias = "88594"; }; iso_latin5 { XmStringCharsetName = "ISO8859-5"; Alias = "ISOLatin5"; Alias = "88595"; }; iso_cyrillic { XmStringCharsetName = "ISO8859-5"; Alias = "ISO-8859-5"; }; iso_arabic { XmStringCharsetName = "ISO8859-6"; Alias = "iso_latin6"; Alias = "ISOLatin6"; Alias = "88596"; Direction = RightToLeft; }; iso_arabic_lr { XmStringCharsetName = "ISO8859-6"; Alias = "iso_latin6_lr"; Direction = RightToLeft; ParseDirection = LeftToRight; }; iso_greek { XmStringCharsetName = "ISO8859-7"; Alias = "iso_latin7"; Alias = "ISOLatin7"; Alias = "88597"; }; iso_hebrew { XmStringCharsetName = "ISO8859-8"; Alias = "iso_latin8"; Alias = "ISOLatin8"; Alias = "88598"; Direction = RightToLeft; }; iso_hebrew_lr { XmStringCharsetName = "ISO8859-8"; Alias = "iso_latin8_lr"; Direction = RightToLeft; ParseDirection = LeftToRight; }; jis_katakana { XmStringCharsetName = "JISX0201.1976-0"; }; euc { XmStringCharsetName = ""; }; big5 { XmStringCharsetName = ""; }; gb_hanzi { XmStringCharsetName = "GB2312.1980-0"; Alias = "gb_chinese"; Alias = "gb_hanzi_gl"; CharacterSize = TwoByte; }; jis_kanji { XmStringCharsetName = "JISX0208.1983-0"; Alias = "jis_japanese"; Alias = "jis_kanji_gl"; CharacterSize = TwoByte; }; ksc_hangul { XmStringCharsetName = "KSC5601.1987-0"; Alias = "ksc_korean"; Alias = "ksc_hangul_gl"; CharacterSize = TwoByte; }; gb_hanzi_gr { XmStringCharsetName = "GB2312.1980-1"; CharacterSize = TwoByte; }; jis_kanji_gr { XmStringCharsetName = "JISX0208.1983-1"; CharacterSize = TwoByte; }; ksc_hangul_gr { XmStringCharsetName = "KSC5601.1987-1"; CharacterSize = TwoByte; }; utf8 { XmStringCharsetName = "UTF-8"; }; iso_ir_111 { XmStringCharsetName = "ISO-IR-111"; Alias = "KOI8-R"; Alias = "KOI8-U"; Alias = "KOI8-RU"; Alias = "KOI8R"; Alias = "KOI8U"; Alias = "KOI8RU"; }; ansi_cyrillic { XmStringCharsetName = "CP1251"; Alias = "WINDOWS-1251"; Alias = "ANSI-1251"; ! The name of CP1251 in Solaris Alias = "ANSI1251"; }; dos_cyrillic { XmStringCharsetName = "IBM866"; Alias = "IBM-866"; Alias = "CP866"; Alias = "866"; }; XmFONTLIST_DEFAULT_TAG { FontListElementTag = XmFONTLIST_DEFAULT_TAG; }; _MOTIF_DEFAULT_LOCALE { FontListElementTag = _MOTIF_DEFAULT_LOCALE; }; ! ! UIL Enumeration Sets ! EnumerationSet ! This is here to insure that uil compiles correctly because ! of dependencies introduced with boolean -> enum resources BoolValues : integer { FALSE; TRUE; }; ArrowDirection : integer { XmARROW_UP; XmARROW_DOWN; XmARROW_LEFT; XmARROW_RIGHT; }; ResizePolicy : integer { XmRESIZE_NONE; XmRESIZE_ANY; XmRESIZE_GROW; }; DialogStyle : integer { XmDIALOG_SYSTEM_MODAL; XmDIALOG_PRIMARY_APPLICATION_MODAL; XmDIALOG_MODELESS; XmDIALOG_WORK_AREA; XmDIALOG_FULL_APPLICATION_MODAL; XmDIALOG_APPLICATION_MODAL; }; DialogType : integer { XmDIALOG_PROMPT; XmDIALOG_SELECTION; XmDIALOG_WORK_AREA; XmDIALOG_FILE_SELECTION; XmDIALOG_ERROR; XmDIALOG_INFORMATION; XmDIALOG_MESSAGE; XmDIALOG_QUESTION; XmDIALOG_WARNING; XmDIALOG_WORKING; XmDIALOG_TEMPLATE; XmDIALOG_COMMAND; }; ShadowType : integer { XmSHADOW_IN; XmSHADOW_OUT; XmSHADOW_ETCHED_IN; XmSHADOW_ETCHED_OUT; }; LabelType : integer { XmSTRING; XmPIXMAP; XmPIXMAP_AND_STRING; }; StringDirection : integer { XmSTRING_DIRECTION_L_TO_R; XmSTRING_DIRECTION_R_TO_L; }; Alignment : integer { XmALIGNMENT_CENTER; XmALIGNMENT_END; XmALIGNMENT_BEGINNING; }; Attachment : integer { XmATTACH_NONE; XmATTACH_FORM; XmATTACH_OPPOSITE_FORM; XmATTACH_WIDGET; XmATTACH_OPPOSITE_WIDGET; XmATTACH_POSITION; XmATTACH_SELF; }; ColorModeType : integer { XmListMode; XmScaleMode; }; EListSelectionsType : integer { XmSINGLE_SELECT; XmEXTENDED_SELECT; }; FillOptionType : integer { XmFillNone; XmFillMajor; XmFillMinor; XmFillAll; }; IconPlacementType : integer { XmIconTop; XmIconLeft; XmIconRight; XmIconBottom; XmIconOnly; XmIconNone; }; HierarchyNodeStateType : integer { XmAlwaysOpen; XmOpen; XmClosed; XmHidden; }; ConnectStyle : integer { XmTreeLadder; XmTreeDirect; }; XmTabMode : integer { XmTABS_BASIC; XmTABS_STACKED; XmTABS_STACKED_STATIC; }; XmTabStyle : integer { XmTABS_SQUARED; XmTABS_ROUNDED; XmTABS_BEVELED; }; XmTabOrientation : integer { XmTAB_ORIENTATION_DYNAMIC; XmTABS_RIGHT_TO_LEFT; XmTABS_LEFT_TO_RIGHT; XmTABS_TOP_TO_BOTTOM; XmTABS_BOTTOM_TO_TOP; }; XmTabEdge : integer { XmTAB_EDGE_TOP_LEFT; XmTAB_EDGE_BOTTOM_RIGHT; }; XmTabSide : integer { XmTABS_ON_TOP; XmTABS_ON_BOTTOM; XmTABS_ON_RIGHT; XmTABS_ON_LEFT; }; XmPixmapPlacement : integer { XmPIXMAP_TOP; XmPIXMAP_BOTTOM; XmPIXMAP_RIGHT; XmPIXMAP_LEFT; XmPIXMAP_NONE; XmPIXMAP_ONLY; }; BackingStoreType : integer { "NotUseful"; "WhenMapped"; "Always"; }; SelectionPolicy : integer { XmSINGLE_SELECT; XmMULTIPLE_SELECT; XmEXTENDED_SELECT; XmBROWSE_SELECT; }; ScrollingPolicy : integer { XmAUTOMATIC; XmAPPLICATION_DEFINED; }; ScrollBarPlacement : integer { XmTOP_LEFT; XmBOTTOM_LEFT; XmTOP_RIGHT; XmBOTTOM_RIGHT; }; ScrollBarDisplayPolicy : integer { XmAS_NEEDED; XmSTATIC; }; ListSizePolicy : integer { XmCONSTANT; XmVARIABLE; XmRESIZE_IF_POSSIBLE; }; VisualPolicy : integer { XmVARIABLE; XmCONSTANT; }; DefaultButtonType : integer { XmDIALOG_CANCEL_BUTTON; XmDIALOG_DEFAULT_BUTTON; XmDIALOG_HELP_BUTTON; XmDIALOG_MESSAGE_LABEL; XmDIALOG_OK_BUTTON; XmDIALOG_SEPARATOR; XmDIALOG_SYMBOL_LABEL; }; RowColumnType : integer { XmWORK_AREA; XmMENU_BAR; XmMENU_PULLDOWN; XmMENU_POPUP; XmMENU_OPTION; }; Packing : integer { XmNO_PACKING; XmPACK_TIGHT; XmPACK_COLUMN; XmPACK_NONE; }; Orientation : integer { XmNO_ORIENTATION; XmVERTICAL; XmHORIZONTAL; }; ProcessingDirection : integer { XmMAX_ON_TOP; XmMAX_ON_BOTTOM; XmMAX_ON_LEFT; XmMAX_ON_RIGHT; }; SeparatorType : integer { XmSINGLE_LINE; XmDOUBLE_LINE; XmSINGLE_DASHED_LINE; XmDOUBLE_DASHED_LINE; XmNO_LINE; XmSHADOW_ETCHED_IN; XmSHADOW_ETCHED_OUT; XmSHADOW_ETCHED_IN_DASH; XmSHADOW_ETCHED_OUT_DASH;}; EditMode : integer { XmSINGLE_LINE_EDIT; XmMULTI_LINE_EDIT; }; IndicatorType : integer { XmN_OF_MANY; XmONE_OF_MANY; XmONE_OF_MANY_ROUND; XmONE_OF_MANY_DIAMOND; }; ToggleIndicatorOn : integer { XmINDICATOR_NONE; XmINDICATOR_FILL; XmINDICATOR_BOX; XmINDICATOR_CHECK; XmINDICATOR_CHECK_BOX; XmINDICATOR_CROSS; XmINDICATOR_CROSS_BOX; FALSE; TRUE;}; UnitType : integer { XmPIXELS; Xm100TH_MILLIMETERS; Xm1000TH_INCHES; Xm100TH_POINTS; Xm100TH_FONT_UNITS; XmINCHES; XmCENTIMETERS; XmMILLIMETERS; XmPOINTS; XmFONT_UNITS; }; NavigationType : integer { XmNONE; XmTAB_GROUP; XmSTICKY_TAB_GROUP; XmEXCLUSIVE_TAB_GROUP; }; MultiClick : integer { XmMULTICLICK_DISCARD; XmMULTICLICK_KEEP; }; CommandWindowLocation : integer { XmCOMMAND_ABOVE_WORKSPACE; XmCOMMAND_BELOW_WORKSPACE; }; FileTypeMask : integer { XmFILE_REGULAR; XmFILE_DIRECTORY; XmFILE_ANY_TYPE; }; InitialState : integer { NormalState; IconicState; }; DeleteResponse : integer { XmDESTROY; XmUNMAP; XmDO_NOTHING; }; KeyboardFocusPolicy : integer { XmEXPLICIT; XmPOINTER; }; AudibleWarning : integer { XmNONE; XmBELL; }; VerticalAlignment : integer {XmALIGNMENT_BASELINE_TOP; XmALIGNMENT_CENTER; XmALIGNMENT_BASELINE_BOTTOM; XmALIGNMENT_CONTENTS_TOP; XmALIGNMENT_CONTENTS_BOTTOM; }; UnpostBehavior : integer { XmUNPOST_AND_REPLAY; XmUNPOST; }; TearOffModel : integer { XmTEAR_OFF_ENABLED; XmTEAR_OFF_DISABLED; }; PositionIndex : integer { XmLAST_POSITION; XmFIRST_POSITION; }; FrameChildType : integer { XmFRAME_GENERIC_CHILD; XmFRAME_WORKAREA_CHILD; XmFRAME_TITLE_CHILD; }; ChildVerticalAlignment : integer { XmALIGNMENT_BASELINE_TOP; XmALIGNMENT_CENTER; XmALIGNMENT_BASELINE_BOTTOM; XmALIGNMENT_WIDGET_BOTTOM; XmALIGNMENT_WIDGET_TOP;}; ChildPlacement : integer { XmPLACE_TOP; XmPLACE_ABOVE_SELECTION; XmPLACE_BELOW_SELECTION; }; TextScanType : integer { XmSELECT_POSITION; XmSELECT_WHITESPACE; XmSELECT_WORD; XmSELECT_LINE; XmSELECT_ALL; XmSELECT_PARAGRAPH;}; MwmDecorations : integer { MWM_DECOR_ALL; MWM_DECOR_BORDER; MWM_DECOR_RESIZEH; MWM_DECOR_TITLE; MWM_DECOR_MENU; MWM_DECOR_MINIMIZE; MWM_DECOR_MAXIMIZE; }; MwmFunctions : integer { MWM_FUNC_ALL; MWM_FUNC_RESIZE; MWM_FUNC_MOVE; MWM_DECOR_MINIMIZE; MWM_DECOR_MAXIMIZE; MWM_FUNC_CLOSE; }; MwmInputMode : integer { MWM_INPUT_MODELESS; MWM_INPUT_PRIMARY_APPLICATION_MODAL; MWM_INPUT_SYSTEM_MODAL; MWM_INPUT_FULL_APPLICATION_MODAL; }; ToggleMode : integer { XmTOGGLE_BOOLEAN; XmTOGGLE_INDETERMINATE; }; SliderVisual : integer { XmBACKGROUND_COLOR; XmFOREGROUND_COLOR; XmTROUGH_COLOR; XmSHADOWED_BACKGROUND; }; SliderMark : integer { XmNONE; XmETCHED_LINE; XmTHUMB_MARK; XmROUND_MARK; }; SlidingMode : integer { XmSLIDER; XmTHERMOMETER; }; PrimaryOwnership : integer { XmOWN_NEVER; XmOWN_ALWAYS; XmOWN_MULTIPLE; XmOWN_POSSIBLE_MULTIPLE; }; SelectionMode : integer { XmNORMAL_MODE; XmADD_MODE; }; MatchBehavior : integer { XmQUICK_NAVIGATE; XmINVALID_MATCH_BEHAVIOR; }; PositionMode : integer { XmZERO_BASED; XmONE_BASED; }; AutoDragModel : integer { XmAUTO_DRAG_ENABLED; XmAUTO_DRAG_DISABLED; }; ShowArrows : integer { XmEACH_SIDE; XmMAX_SIDE; XmMIN_SIDE; FALSE; TRUE; }; TextPath : integer { XmSTRING_DIRECTION_L_TO_R; XmSTRING_DIRECTION_R_TO_L; XmSTRING_DIRECTION_UNSET; XmSTRING_DIRECTION_DEFAULT; XmDEFAULT_DIRECTION; }; ComboBoxType : integer { XmCOMBO_BOX; XmDROP_DOWN_COMBO_BOX; XmDROP_DOWN_LIST; }; ContainerLineStyle : integer { XmSINGLE; }; EntryViewType : integer { XmLARGE_ICON; XmSMALL_ICON; XmANY_ICON; }; LayoutDirection : integer { XmRIGHT_TO_LEFT_TOP_TO_BOTTOM; XmLEFT_TO_RIGHT_TOP_TO_BOTTOM; XmRIGHT_TO_LEFT_BOTTOM_TO_TOP; XmLEFT_TO_RIGHT_BOTTOM_TO_TOP; XmTOP_TO_BOTTOM_RIGHT_TO_LEFT; XmTOP_TO_BOTTOM_LEFT_TO_RIGHT; XmBOTTOM_TO_TOP_RIGHT_TO_LEFT; XmBOTTOM_TO_TOP_LEFT_TO_RIGHT; XmTOP_TO_BOTTOM; XmBOTTOM_TO_TOP; XmRIGHT_TO_LEFT; XmLEFT_TO_RIGHT; XmDEFAULT_DIRECTION; }; LayoutType : integer { XmOUTLINE; XmSPATIAL; XmDETAIL; }; OutlineButtonPolicy : integer { XmOUTLINE_BUTTON_PRESENT; XmOUTLINE_BUTTON_ABSENT; }; SelectionTechnique : integer { XmMARQUEE; XmMARQUEE_EXTEND_START; XmMARQUEE_EXTEND_BOTH; XmTOUCH_ONLY; XmTOUCH_OVER; }; SpatialIncludeModel : integer { XmAPPEND; XmCLOSEST; XmFIRST_FIT; }; SpatialResizeModel : integer { XmGROW_MINOR; XmGROW_MAJOR; XmGROW_BALANCED; }; SpatialSnapModel : integer { XmNONE; XmSNAP_TO_GRID; XmCENTER; }; SpatialStyle : integer { XmNONE; XmGRID; XmCELLS; }; OutlineState : integer { XmCOLLAPSED; XmEXPANDED; }; IconGadgetViewType : integer { XmLARGE_ICON; XmSMALL_ICON; }; VisualEmphasis : integer { XmSELECTED; XmNOT_SELECTED; }; BindingType : integer { XmSOLID; XmSPIRAL; XmPIXMAP_OVERLAP_ONLY; }; ArrowSensitivity : integer { XmARROWS_INSENSITIVE; XmARROWS_INCREMENT_SENSITIVE; XmARROWS_DECREMENT_SENSITIVE; XmARROWS_SENSITIVE; XmARROWS_DEFAULT_SENSITIVITY; }; ArrowLayout : integer { XmARROWS_END; XmARROWS_BEGINNING; XmARROWS_SPLIT; XmARROWS_FLAT_END; XmARROWS_FLAT_BEGINNING; }; ArrowOrientation : integer { XmARROWS_VERTICAL; XmARROWS_HORIZONTAL; }; NotebookChildType : integer { XmPAGE; XmMAJOR_TAB; XmMINOR_TAB; XmSTATUS_AREA; XmPAGE_SCROLLER; }; ScrolledWindowChildType : integer { XmHOR_SCROLLBAR; XmVERT_SCROLLBAR; XmCOMMAND_WINDOW; XmMESSAGE_WINDOW; XmSCROLL_HOR; XmSCROLL_VERT; XmNO_SCROLL; XmCLIP_WINDOW; XmGENERIC_CHILD; }; PositionType : integer { XmPOSITION_INDEX; XmPOSITION_VALUE; }; SpinBoxChildType : integer { XmSTRING; XmNUMERIC; }; InputPolicy : integer { XmPER_SHELL; XmPER_WIDGET; XmINHERIT_POLICY; }; ToggleSetValue : integer { XmUNSET; XmSET; XmINDETERMINATE; FALSE; TRUE; }; ScaleShowValue : integer { XmNONE; XmNEAR_SLIDER; XmNEAR_BORDER; FALSE; TRUE; }; FontType : integer { XmAS_IS; XmFONT_IS_FONT; XmFONT_IS_FONTSET; XmFONT_IS_XFT; }; LoadModel : integer { XmAS_IS; XmLOAD_IMMEDIATE; XmLOAD_DEFERRED; }; LineType : integer { XmAS_IS; XmSINGLE_LINE; XmDOUBLE_LINE; XmSINGLE_DASHED_LINE; XmDOUBLE_DASHED_LINE; XmNO_LINE; }; OffsetModel : integer { XmABSOLUTE; XmRELATIVE; }; CompoundStringComponent : integer { XmSTRING_COMPONENT_UNKNOWN; XmSTRING_COMPONENT_CHARSET; XmSTRING_COMPONENT_TEXT; XmSTRING_COMPONENT_DIRECTION; XmSTRING_COMPONENT_SEPARATOR; XmSTRING_COMPONENT_LOCALE_TEXT; XmSTRING_COMPONENT_LOCALE; XmSTRING_COMPONENT_WIDECHAR_TEXT; XmSTRING_COMPONENT_LAYOUT_PUSH; XmSTRING_COMPONENT_LAYOUT_POP; XmSTRING_COMPONENT_RENDITION_BEGIN; XmSTRING_COMPONENT_RENDITION_END; XmSTRING_COMPONENT_TAB; }; AutomaticSelection : integer { XmNO_AUTO_SELECT; XmAUTO_SELECT; FALSE; TRUE;}; XmAlignment : integer { XmALIGNMENT_BEGINNING; XmALIGNMENT_CENTER; XmALIGNMENT_END; XmALIGNMENT_UNSPECIFIED;}; XmFillStyle : integer { XmFILL_UNSPECIFIED; XmFILL_FLUSH; XmFILL_RAGGED;}; XmDistribution : integer { XmDISTRIBUTE_TIGHT; XmDISTRIBUTE_SPREAD;}; XmTreeCompressStyle : integer { XmTreeCompressNone; XmTreeCompressLeaves; XmTreeCompressLeaves;}; XmTreeLineStyle : integer { LineSolid; LineOnOffDash; LineDoubleDash;}; ! Define controls list of common aggregates of widgets ControlList AllWidgetsAndGadgets { DtEditor; DtHelpDialog; DtHelpQuickDialog; DtMenuButton; DtPrintSetupBox; DtPrintSetupDialog; DtTerm; XmArrowButton; XmArrowButtonGadget; XmBulletinBoard; XmBulletinBoardDialog; XmButtonBox; XmCascadeButton; XmCascadeButtonGadget; XmCheckBox; XmColumn; XmColorSelector; XmDropDown; XmComboBox; XmCommand; XmCommandDialog; XmContainer; XmDialogShell; XmDrawingArea; XmDrawnButton; XmErrorDialog; XmMultiList; XmFileSelectionBox; XmFileSelectionDialog; XmFontSelector; XmForm; XmFormDialog; XmFrame; XmIconBox; XmIconButton; XmIconGadget; XmInformationDialog; XmLabel; XmLabelGadget; XmList; XmMainWindow; XmMenuBar; XmMenuShell; XmMessageBox; XmMessageDialog; XmNotebook; XmOptionMenu; XmOutline; XmPaned; XmPanedWindow; XmPopupMenu; XmPromptDialog; XmPulldownMenu; XmPushButton; XmPushButtonGadget; XmQuestionDialog; XmRadioBox; XmRenderTable; XmRowColumn; XmScale; XmScrollBar; XmScrolledList; XmScrolledText; XmScrolledWindow; XmSelectionBox; XmSelectionDialog; XmSeparator; XmSeparatorGadget; XmSimpleSpinBox; XmSpinBox; XmTabBox; XmTabStack; XmTemplateDialog; XmText; XmTextField; XmDataField; XmToggleButton; XmToggleButtonGadget; XmTree; XmWarningDialog; XmWorkArea; XmWorkingDialog; user_defined; }; AllWidgets { DtEditor; DtHelpDialog; DtHelpQuickDialog; DtMenuButton; DtPrintSetupBox; DtPrintSetupDialog; DtTerm; XmArrowButton; XmBulletinBoard; XmBulletinBoardDialog; XmButtonBox; XmCascadeButton; XmCheckBox; XmColumn; XmColorSelector; XmDropDown; XmComboBox; XmCommand; XmCommandDialog; XmContainer; XmDialogShell; XmDrawingArea; XmDrawnButton; XmErrorDialog; XmMultiList; XmFileSelectionBox; XmFileSelectionDialog; XmFontSelector; XmForm; XmFormDialog; XmFrame; XmIconButton; XmIconBox; XmInformationDialog; XmLabel; XmList; XmMainWindow; XmMenuBar; XmMenuShell; XmMessageBox; XmMessageDialog; XmNotebook; XmOptionMenu; XmOutline; XmPaned; XmPanedWindow; XmPopupMenu; XmPromptDialog; XmPulldownMenu; XmPushButton; XmQuestionDialog; XmRadioBox; XmRowColumn; XmScale; XmScrollBar; XmScrolledList; XmScrolledText; XmScrolledWindow; XmSelectionBox; XmSelectionDialog; XmSeparator; XmSimpleSpinBox; XmSpinBox; XmTabBox; XmTabStack; XmTemplateDialog; XmText; XmTextField; XmDataField; XmToggleButton; XmTree; XmWarningDialog; XmWorkArea; XmWorkingDialog; user_defined; }; MenuWidgetsAndGadgets { DtMenuButton; XmCascadeButton; XmCascadeButtonGadget; XmDrawnButton; XmLabel; XmLabelGadget; XmPushButton; XmPushButtonGadget; XmSeparator; XmSeparatorGadget; XmToggleButton; XmToggleButtonGadget; user_defined; }; ManagerWidgets { DtEditor; DtHelpDialog; DtHelpQuickDialog; DtPrintSetupBox; DtPrintSetupDialog; XmBulletinBoard; XmButtonBox; XmCheckBox; XmColumn; XmDropDown; XmComboBox; XmContainer; XmDrawingArea; XmForm; XmFrame; XmIconBox; XmNotebook; XmOutline; XmPaned; XmPanedWindow; XmScale; XmScrolledWindow; XmSimpleSpinBox; XmSpinBox; XmRadioBox; XmRowColumn; XmTabBox; XmTabStack; XmTree; XmWorkArea; XmMessageBox; XmSelectionBox; XmFileSelectionBox; }; ! The root metaclasses and their resources. RectObj/Windowobj constitutes ! the Core class as documented in the toolkit manual. Class Object : MetaClass { Resources { ! new resources MrmNcreateCallback; XmNdestroyCallback; ! inherited resources }; }; Resource MrmNcreateCallback : Reason { InternalLiteral = MrmNcreateCallback; }; ! This InternalLiteral is provided so the name can be changed if ! desired. The InternalLiteral must NOT be changed. XmNdestroyCallback : Reason { ResourceLiteral = XmNdestroyCallback; }; ! This ResourceLiteral setting is included as an example ! only. ResourceLiterals are not provided for the rest of ! the Motif toolkit because the UIL names are identical ! to the toolkit literals (the name supplies the default ! literal for each UIL resource). Class RectObj : MetaClass { SuperClass = Object; Resources { ! new resources XmNancestorSensitive; XmNborderWidth; XmNheight; XmNsensitive; XmNwidth; XmNx; XmNy; ! inherited resources }; }; Resource XmNancestorSensitive : Argument { Type = boolean; Default = "True"; }; XmNborderWidth : Argument { Type = horizontal_float; Default = "1"; }; XmNheight : Argument { Type = vertical_float; Default = "0"; }; XmNsensitive : Argument { Type = boolean; Default = "True"; }; XmNwidth : Argument { Type = horizontal_float; Default = "0"; }; XmNx : Argument { Type = horizontal_float; Default = "0"; }; XmNy : Argument { Type = vertical_float; Default = "0"; }; Class WindowObj : MetaClass { SuperClass = RectObj; Resources { ! new resources XmNaccelerators; XmNbackground; XmNbackgroundPixmap; XmNborderColor; XmNborderPixmap; XmNcolormap; XmNdepth; XmNmappedWhenManaged; XmNscreen; XmNtranslations; XmNinitialResourcesPersistent; ! inherited resources }; }; Resource XmNaccelerators : Argument { Type = translation_table; Default = "Null";}; XmNbackground : Argument { Type = color; Default = "White"; }; XmNbackgroundPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNborderColor : Argument { Type = color ; Default = "Black"; }; XmNborderPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNcolormap : Argument { Type = identifier; Default = "XtCopyFromParent"; }; XmNdepth : Argument { Type = identifier; Default = "XtCopyFromParent"; }; XmNmappedWhenManaged : Argument { Type = boolean; Default = "True"; }; XmNscreen : Argument { Type = identifier ; Default = "XtCopyScreen"; }; XmNtranslations : Argument { Type = translation_table; Default = "Null"; }; XmNinitialResourcesPersistent : Argument { Type = boolean; Default = "True"; }; ! Immediate subclasses of WindowObj Class XmPrimitive : MetaClass { SuperClass = WindowObj; Resources { ! new resources XmNbottomShadowColor; XmNbottomShadowPixmap; XmNconvertCallback; XmNforeground; XmNhelpCallback; XmNhighlightColor; XmNhighlightOnEnter; XmNhighlightPixmap; XmNhighlightThickness; XmNnavigationType; XmNpopupHandlerCallback; XmNshadowThickness; XmNtoolTipString; XmNtopShadowColor; XmNtopShadowPixmap; XmNtraversalOn; XmNunitType; XmNuserData; ! inherited resources }; }; Resource XmNbottomShadowColor : Argument { Type = color; Default = "dynamic"; }; XmNbottomShadowPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNforeground : Argument { Type = color; Default = "dynamic"; }; XmNhelpCallback : Reason { }; XmNhighlightColor : Argument { Type = color; Default = "Black"; }; XmNhighlightOnEnter : Argument { Type = boolean; Default = "False"; }; XmNhighlightPixmap : Argument { Type = pixmap; Default = "dynamic"; }; XmNhighlightThickness : Argument { Type = horizontal_float; Default = "0"; }; XmNnavigationType : Argument { Type = integer; EnumerationSet = NavigationType; Default = "XmNONE"; }; XmNshadowThickness : Argument { Type = horizontal_float; Default = "2"; }; XmNtoolTipString : Argument { Type = compound_string; Default= "Null"; }; XmNtopShadowColor : Argument { Type = color; Default = "dynamic"; }; XmNtopShadowPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNtraversalOn : Argument { Type = boolean; Default = "True"; }; XmNunitType : Argument { Type = integer; EnumerationSet = UnitType; Default = "XmPIXELS"; }; XmNuserData : Argument { Type = any; Default = "Null"; }; Class Composite : MetaClass { SuperClass = WindowObj; Resources { ! new resources XmNinsertPosition; ! inherited resources }; }; Resource XmNinsertPosition : Constraint { Type = identifier ; Default = "Null"; }; ! Immediate subclasses of RectObj Class XmGadget : MetaClass { SuperClass = RectObj; Resources { ! new resources XmNbackground; XmNhelpCallback; XmNhighlightOnEnter; XmNhighlightThickness; XmNnavigationType; XmNshadowThickness; XmNtraversalOn; XmNunitType; XmNuserData; XmNtoolTipString; ! inherited resources }; }; ! Immediate sublclasses of XmGadget Class XmArrowButtonGadget : Gadget { SuperClass = XmGadget; ConvenienceFunction = XmCreateArrowButtonGadget; WidgetClass = XmArrowButton; Resources { ! new resources XmNactivateCallback; XmNarmCallback; XmNarrowDirection; XmNbackground; XmNdisarmCallback; XmNmultiClick; ! inherited resources }; }; Resource XmNactivateCallback : Reason { }; XmNarmCallback : Reason { }; XmNarrowDirection : Argument { Type = integer; EnumerationSet = ArrowDirection; Default = "XmDYNAMIC"; }; XmNdisarmCallback : Reason { }; Class XmSeparatorGadget : Gadget { SuperClass = XmGadget; ConvenienceFunction = XmCreateSeparatorGadget; WidgetClass = XmSeparator; Resources { ! new resources XmNbackground; XmNmargin; XmNorientation; XmNseparatorType; ! inherited resources XmNtraversalOn { Default = "False"; }; }; }; Resource XmNmargin : Argument { Type = horizontal_float; Default = "0"; }; XmNorientation : Argument { Type = integer; EnumerationSet = Orientation; Default = "XmHORIZONTAL"; }; XmNseparatorType : Argument { Type = integer; EnumerationSet = SeparatorType; Default = "XmSHADOW_ETCHED_IN"; }; Class XmIconGadget : Gadget { SuperClass = XmGadget; ConvenienceFunction = XmCreateIconGadget; WidgetClass = XmIconGadget; Resources { ! new resources XmNalignment; XmNbackground; XmNdetail; XmNdetailCount; XmNfontList; XmNlabelString; XmNlargeIconMask; XmNlargeIconPixmap; XmNmarginHeight; XmNmarginWidth; XmNrecomputeSize; XmNrenderTable; XmNsmallIconMask; XmNsmallIconPixmap; XmNspacing; XmNviewType; XmNvisualEmphasis; ! undocumented resources ! XmNdotCache; }; Controls { XmRenderTable; }; }; Resource XmNdetail : Argument { Type = string_table; Default = "NULL"; Related = XmNdetailCount; }; XmNdetailCount : Argument { Type = integer; Default = "0"; }; XmNlargeIconMask : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNlargeIconPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNsmallIconMask : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNsmallIconPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNviewType : Argument { Type = integer; EnumerationSet = IconGadgetViewType; }; XmNvisualEmphasis : Argument { Type = integer; EnumerationSet = VisualEmphasis; }; Class XmLabelGadget : Gadget { SuperClass = XmGadget; ConvenienceFunction = XmCreateLabelGadget; WidgetClass = XmLabel; Resources { ! new resources XmNaccelerator; XmNacceleratorText; XmNalignment; XmNbackground; XmNfontList; XmNrenderTable; XmNlabelInsensitivePixmap; XmNlabelPixmap; XmNlabelString; XmNlabelType; XmNmarginBottom; XmNmarginHeight; XmNmarginLeft; XmNmarginRight; XmNmarginTop; XmNmarginWidth; XmNmnemonic; XmNmnemonicCharSet; XmNrecomputeSize; XmNstringDirection; XmNpixmapPlacement; XmNpixmapTextPadding; ! inherited resources XmNshadowThickness {Default = "0"; }; XmNtraversalOn { Default = "False"; }; }; Controls { XmRenderTable; }; }; Resource XmNaccelerator : Argument { Type = string; Default = "Null"; }; XmNacceleratorText : Argument { Type = compound_string; Default = "Null"; }; XmNalignment : Argument { Type = integer; EnumerationSet = Alignment; Default = "XmALIGNMENT_CENTER"; }; XmNfontList : Argument { Type = font_table; Default = "Fixed"; }; XmNrenderTable : Argument { Type = widget_ref; Default = "Fixed"; }; XmNlabelInsensitivePixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNlabelPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNlabelString : Argument { Type = compound_string; Default = "Null"; }; XmNlabelType : Argument { Type = integer; EnumerationSet = LabelType; Default = "XmSTRING"; }; XmNmarginBottom : Argument { Type = vertical_float; Default = "0"; }; XmNmarginHeight : Argument { Type = vertical_float; Default = "2"; }; XmNmarginLeft : Argument { Type = horizontal_float; Default = "0"; }; XmNmarginRight : Argument { Type = horizontal_float; Default = "0"; }; XmNmarginTop : Argument { Type = vertical_float; Default = "0"; }; XmNmarginWidth : Argument { Type = horizontal_float; Default = "2"; }; XmNmnemonic : Argument { Type = keysym; Default = "NULL"; }; XmNmnemonicCharSet : Argument { Type = string; Default = "dynamic"; }; XmNrecomputeSize : Argument { Type = boolean; Default = "True"; }; XmNstringDirection : Argument { Type = integer; EnumerationSet = StringDirection; Default = "XmSTRING_DIRECTION_L_TO_R"; }; XmNpixmapPlacement : Argument { Type = integer; EnumerationSet = XmPixmapPlacement; }; XmNpixmapTextPadding : Argument { Type = integer; Default = "2"; }; Class XmTextField : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateTextField; Resources { ! new resources XmNactivateCallback; XmNcursorPosition; XmNdestinationCallback; XmNeditable; XmNfocusCallback; XmNgainPrimaryCallback; XmNlosePrimaryCallback; XmNlosingFocusCallback; XmNmarginHeight { Default = "3"; }; XmNmarginWidth { Default = "3"; }; XmNmaxLength; XmNmodifyVerifyCallback; XmNmodifyVerifyCallbackWcs; XmNmotionVerifyCallback; XmNvalue; XmNvalueWcs; XmNvalueChangedCallback; XmNverifyBell; ! Input resource set XmNpendingDelete; XmNselectionArray; XmNselectionArrayCount; XmNselectThreshold; ! Output resource set XmNblinkRate; XmNcolumns; XmNfontList; XmNrenderTable; XmNcursorPositionVisible; XmNresizeHeight; XmNresizeWidth; XmNrows; XmNwordWrap; !inherited resources XmNnavigationType { Default = "XmTAB_GROUP"; }; }; Controls { XmPopupMenu; XmRenderTable; }; }; Resource XmNdestinationCallback : Reason { }; ! Immediate subclasses of XmLabelGadget Class XmCascadeButtonGadget : Gadget { SuperClass = XmLabelGadget; ConvenienceFunction = XmCreateCascadeButtonGadget; WidgetClass = XmCascadeButton; ControlsMapToResource = XmNsubMenuId; Resources { ! new resources XmNactivateCallback; XmNcascadePixmap; XmNcascadingCallback; XmNmappingDelay; XmNsubMenuId; ! inherited resources XmNaccelerator { Exclude = True;}; XmNacceleratorText { Exclude = True;}; XmNtraversalOn { Default = "True"; }; }; Controls { XmPulldownMenu; }; }; Resource XmNcascadingCallback : Reason { }; XmNcascadePixmap : Argument { Type = pixmap; Default = "menu-cascade"; }; XmNmappingDelay : Argument { Type = integer; Default = "100"; }; XmNsubMenuId : Argument { Type = widget_ref; Default = "Null"; }; Class XmPushButtonGadget : Gadget { SuperClass = XmLabelGadget; ConvenienceFunction = XmCreatePushButtonGadget; WidgetClass = XmPushButton; Resources { ! new resources XmNactivateCallback; XmNarmCallback; XmNarmColor; XmNarmPixmap; XmNdefaultButtonShadowThickness; XmNdisarmCallback; XmNfillOnArm; XmNmultiClick; XmNshowAsDefault ; ! inherited resources }; }; Resource XmNarmColor : Argument { Type = color; Default = "dynamic"; }; XmNarmPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNdefaultButtonShadowThickness: Argument { Type = horizontal_float; Default = "0"; }; XmNfillOnArm : Argument { Type = boolean; Default = "True"; }; XmNmultiClick : Argument { Type = integer; EnumerationSet = MultiClick; Default = "XmMULTICLICK_DISCARD"; }; XmNshowAsDefault : Argument { Type = integer; Default = "0"; }; Class XmToggleButtonGadget : Gadget { SuperClass = XmLabelGadget; ConvenienceFunction = XmCreateToggleButtonGadget; WidgetClass = XmToggleButton; Resources { ! new resources XmNarmCallback; XmNdetailShadowThickness; XmNdisarmCallback; XmNfillOnSelect; XmNhighlightThickness { Default = "dynamic"; }; XmNindeterminatePixmap; XmNindeterminateInsensitivePixmap; XmNindicatorOn; XmNindicatorSize; XmNindicatorType; XmNselectColor; XmNselectInsensitivePixmap; XmNselectPixmap; XmNset; XmNspacing; XmNtoggleMode; XmNunselectColor; XmNvalueChangedCallback; XmNvisibleWhenOff; ! inherited resources XmNtraversalOn { Default = "True"; }; }; }; Resource XmNdetailShadowThickness : Argument { Type = horizontal_float; Default = "dynamic"; }; XmNfillOnSelect : Argument { Type = boolean; Default = "True"; }; XmNindeterminatePixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNindeterminateInsensitivePixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNindicatorOn : Argument { Type = integer; EnumerationSet = ToggleIndicatorOn; Default = "XmINDICATOR_FILL"; }; XmNindicatorType : Argument { Type = integer; EnumerationSet = IndicatorType; Default = "XmN_OF_MANY"; }; XmNindicatorSize : Argument { Type = horizontal_float; Default = "XmINVALID_DIMENSION"; }; XmNselectColor : Argument { Type = color; Default = "dynamic"; }; XmNselectInsensitivePixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNselectPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNset : Argument { Type = integer; EnumerationSet = ToggleSetValue; Default = "False"; }; XmNspacing : Argument { Type = horizontal_float; Default = "4"; }; XmNtoggleMode : Argument { Type = integer; EnumerationSet = ToggleMode; }; XmNunselectColor : Argument { Type = color; Default = "dynamic"; }; XmNvalueChangedCallback : Reason { }; XmNvisibleWhenOff : Argument { Type = boolean; Default = "True"; }; ! Immediate subclasses of XmPrimitive Class XmArrowButton : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateArrowButton; Resources { ! new resources XmNactivateCallback; XmNarmCallback; XmNarrowDirection; XmNdisarmCallback; XmNmultiClick; ! inherited resources }; Controls { XmPopupMenu; }; }; Class XmScrollBar : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateScrollBar; Resources { ! new resources XmNdecrementCallback; XmNdragCallback; XmNeditable; XmNincrement; XmNincrementCallback; XmNinitialDelay; XmNmaximum; XmNminimum; XmNorientation { Default = "XmVERTICAL"; }; XmNpageDecrementCallback; XmNpageIncrement; XmNpageIncrementCallback; XmNprocessingDirection; XmNrepeatDelay; XmNshowArrows; XmNsliderVisual; XmNsliderMark; XmNsliderSize; XmNslidingMode; XmNsnapBackMultiple; XmNtoBottomCallback; XmNtoTopCallback; XmNtroughColor; XmNvalue; XmNvalueChangedCallback; ! inherited resources XmNnavigationType { Default = "XmSTICKY_TAB_GROUP"; }; XmNtraversalOn { Default = "dynamic"; }; }; Controls { XmPopupMenu; }; }; Resource XmNdecrementCallback : Reason { }; XmNdragCallback : Reason { }; XmNincrement : Argument { Type = integer; Default = "1"; }; XmNincrementCallback : Reason { }; XmNinitialDelay : Argument { Type = integer; Default = "250"; }; XmNmaximum : Argument { Type = integer; Default = "0"; }; XmNminimum : Argument { Type = integer; Default = "0"; }; XmNpageDecrementCallback : Reason { }; XmNpageIncrement : Argument { Type = integer; Default = "10"; }; XmNpageIncrementCallback : Reason { }; XmNprocessingDirection : Argument { Type = integer; EnumerationSet = ProcessingDirection; Default = "XmMAX_ON_BOTTOM"; }; XmNrepeatDelay : Argument { Type = integer; Default = "50"; }; XmNshowArrows : Argument { Type = integer; EnumerationSet = ShowArrows; Default = "XmEACH_SIDE"; }; XmNsliderSize : Argument { Type = integer; Default = "10"; }; XmNsliderVisual : Argument { Type = integer; EnumerationSet = SliderVisual; Default = "dynamic"; }; XmNsliderMark : Argument { Type = integer; EnumerationSet = SliderMark; Default = "dynamic"; }; XmNslidingMode : Argument { Type = integer; EnumerationSet = SlidingMode; Default = "XmSLIDER"; }; XmNsnapBackMultiple : Argument { Type = integer; }; XmNtoBottomCallback : Reason { }; XmNtoTopCallback : Reason { }; XmNtroughColor : Argument { Type = color; Default = "dynamic"; }; XmNvalue : Argument { Type = any; Default = "Null"; }; Class XmSeparator : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateSeparator; Resources { ! new resources XmNmargin; XmNorientation; XmNseparatorType; ! inherited resources XmNtraversalOn { Default = "False"; }; }; Controls { XmPopupMenu; }; }; Class XmLabel : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateLabel; Resources { ! new resources XmNaccelerator; XmNacceleratorText; XmNalignment; XmNfontList; XmNrenderTable; XmNlabelInsensitivePixmap; XmNlabelPixmap; XmNlabelString; XmNlabelType; XmNmarginBottom; XmNmarginHeight; XmNmarginLeft; XmNmarginRight; XmNmarginTop; XmNmarginWidth; XmNmnemonic; XmNmnemonicCharSet; XmNpixmapPlacement; XmNpixmapTextPadding; XmNrecomputeSize; XmNstringDirection; ! inherited resources XmNshadowThickness { Default = "0"; }; XmNtraversalOn { Default = "False"; }; }; Controls { XmPopupMenu; XmRenderTable; }; }; ! Immediate subclass of XmPrimitive. The ScrolledList variant is treated ! as a subclass Class XmList : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateList; Resources { ! new resources XmNautomaticSelection; XmNbrowseSelectionCallback; XmNdefaultActionCallback; XmNdestinationCallback; XmNdoubleClickInterval; XmNextendedSelectionCallback; XmNfontList; XmNrenderTable; XmNitemCount; XmNitems; XmNlistMarginHeight; XmNlistMarginWidth; XmNlistSizePolicy; XmNlistSpacing; XmNmatchBehavior; XmNmultipleSelectionCallback; XmNprimaryOwnership; XmNselectedItemCount; XmNselectedItems; XmNselectedPositions; XmNselectedPositionCount; XmNselectionMode; XmNselectionPolicy; XmNsingleSelectionCallback; XmNstringDirection; XmNtopItemPosition; XmNvisibleItemCount; ! inherited resources XmNnavigationType { Default = "XmTAB_GROUP"; }; }; Controls { XmPopupMenu; XmRenderTable; }; }; Resource XmNautomaticSelection : Argument { Type = integer; EnumerationSet = AutomaticSelection; Default = "FALSE"; }; XmNbrowseSelectionCallback : Reason { }; XmNdefaultActionCallback : Reason { }; XmNdoubleClickInterval : Argument { Type = integer; Default = "250"; }; XmNextendedSelectionCallback : Reason { }; XmNitemCount : Argument { Type = integer; Default = "0"; }; XmNitems : Argument { Type = string_table; Default = "Null"; Related = XmNitemCount; }; XmNlistMarginHeight : Argument { Type = vertical_float; Default = "0"; }; XmNlistMarginWidth : Argument { Type = horizontal_float; Default = "0"; }; XmNlistSpacing : Argument { Type = horizontal_float; Default = "0"; }; XmNmatchBehavior : Argument { Type = integer; EnumerationSet = MatchBehavior; Default = "XmQUICK_NAVIGATE"; }; XmNmultipleSelectionCallback : Reason { }; XmNprimaryOwnership : Argument { Type = integer; EnumerationSet = PrimaryOwnership; Default = "XmOWN_NEVER"; }; XmNselectedItemCount : Argument { Type = integer; Default = "0"; }; XmNselectedItems : Argument { Type = string_table; Default = "Null"; Related = XmNselectedItemCount; }; XmNselectionMode : Argument { Type = integer; EnumerationSet = SelectionMode; Default = "XmNORMAL_MODE"; }; XmNselectionPolicy : Argument { Type = integer; EnumerationSet = SelectionPolicy; Default = "XmBROWSE_SELECT"; }; XmNselectedPositions : Argument { Type = integer_table; Default = "Null"; Related = XmNselectedPositionCount; }; XmNselectedPositionCount : Argument { Type = integer; Default = "0"; }; XmNsingleSelectionCallback : Reason { }; XmNtopItemPosition : Argument { Type = integer; Default = "0"; }; XmNvisibleItemCount : Argument { Type = integer; Default = "1"; }; Class XmScrolledList : Widget { SuperClass = XmList; ParentClass = XmScrolledWindow; ConvenienceFunction = XmCreateScrolledList; Resources { ! new resources XmNautoDragModel; XmNhorizontalScrollBar; XmNlistSizePolicy; XmNscrollBarDisplayPolicy; XmNscrollBarPlacement; XmNscrolledWindowMarginHeight; XmNscrolledWindowMarginWidth; XmNspacing; XmNtraverseObscuredCallback; XmNverticalScrollBar; ! inherited resources }; Controls { XmPopupMenu; XmRenderTable; }; }; Resource XmNautoDragModel : Argument { Type = integer; EnumerationSet = AutoDragModel; Default = "XmAUTO_DRAG_ENABLED"; }; XmNhorizontalScrollBar : Argument { Type = widget_ref; Default = "Null"; }; XmNlistSizePolicy : Argument { Type = integer ; EnumerationSet = ListSizePolicy; Default = "XmVARIABLE"; }; XmNscrollBarDisplayPolicy : Argument { Type = integer ; EnumerationSet = ScrollBarDisplayPolicy; Default = "XmAS_NEEDED"; }; XmNscrollBarPlacement : Argument { Type = integer ; EnumerationSet = ScrollBarPlacement; Default = "XmBOTTOM_RIGHT"; }; XmNscrolledWindowMarginHeight : Argument { Type = integer ; Default = "0"; }; XmNscrolledWindowMarginWidth : Argument { Type = integer ; Default = "0"; }; XmNverticalScrollBar : Argument { Type = widget_ref; Default = "Null"; }; ! Immediate subclass of XmPrimitive. The Scrolled variant is treated ! as a subclass Class XmText : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateText; Resources { ! new resources XmNactivateCallback; XmNautoShowCursorPosition; XmNcursorPosition; XmNdestinationCallback; XmNeditable; XmNeditMode; XmNfocusCallback; XmNgainPrimaryCallback; XmNlosePrimaryCallback; XmNlosingFocusCallback; XmNmarginHeight { Default = "3"; }; XmNmarginWidth { Default = "3"; }; XmNmaxLength; XmNmodifyVerifyCallback; XmNmodifyVerifyCallbackWcs; XmNmotionVerifyCallback; XmNsource; XmNtopCharacter; XmNvalue; XmNvalueWcs; XmNvalueChangedCallback; XmNverifyBell; ! Input resource set XmNpendingDelete; XmNselectionArray; XmNselectionArrayCount; XmNselectThreshold; ! Output resource set XmNblinkRate; XmNcolumns; XmNcursorPositionVisible; XmNfontList; XmNrenderTable; XmNresizeHeight; XmNresizeWidth; XmNrows; XmNwordWrap; ! inherited resources XmNnavigationType { Default = "XmTAB_GROUP"; }; }; Controls { XmPopupMenu; XmRenderTable; }; }; Resource XmNautoShowCursorPosition : Argument { Type = boolean; Default = "True"; }; XmNcursorPosition : Argument { Type = integer; Default = "0"; }; XmNeditable : Argument { Type = boolean; Default = "True"; }; XmNeditMode : Argument { Type = integer; EnumerationSet = EditMode; Default = "XmSINGLE_LINE_EDIT"; }; XmNfocusCallback : Reason { }; XmNgainPrimaryCallback : Reason { }; XmNlosePrimaryCallback : Reason { }; XmNlosingFocusCallback : Reason { }; XmNmaxLength : Argument { Type = integer; Default = "MAXINT"; }; XmNmodifyVerifyCallback : Reason { }; XmNmodifyVerifyCallbackWcs : Reason { }; XmNmotionVerifyCallback : Reason { }; XmNpendingDelete : Argument { Type = boolean; Default = "True"; }; XmNsource : Argument { Type = any; Default = "Default source"; }; XmNselectionArray : Argument { Type = integer_table; Default = "{XmSELECT_POSITION, XmSELECT_WORD, XmSELECT_LINE, XmSELECT_ALL};" ; Related = XmNselectionArrayCount; }; XmNselectionArrayCount : Argument { Type = integer; Default = "4"; }; XmNselectThreshold : Argument { Type = integer; Default = "5"; }; XmNblinkRate : Argument { Type = integer; Default = "500"; }; XmNtopCharacter : Argument { Type = integer; Default = "0"; }; XmNverifyBell : Argument { Type = boolean; Default = "True"; }; XmNcolumns : Argument { Type = integer; Default = "20"; }; XmNcursorPositionVisible : Argument { Type = boolean; Default = "True"; }; XmNresizeHeight : Argument { Type = boolean; Default = "False"; }; XmNresizeWidth : Argument { Type = boolean; Default = "False"; }; XmNrows : Argument { Type = integer; Default = "1"; }; XmNvalueWcs : Argument { Type = wide_character; Default = "Null"; }; XmNwordWrap : Argument { Type = boolean; Default = "False"; }; Class XmScrolledText : Widget { SuperClass = XmText; ParentClass = XmScrolledWindow; ConvenienceFunction = XmCreateScrolledText; Resources { ! new resources XmNautoDragModel; XmNhorizontalScrollBar; XmNscrollBarDisplayPolicy; XmNscrollBarPlacement; XmNscrollHorizontal; XmNscrollLeftSide; XmNscrollTopSide; XmNscrollVertical; XmNscrolledWindowMarginHeight; XmNscrolledWindowMarginWidth; XmNspacing; XmNtraverseObscuredCallback; XmNverticalScrollBar; ! inherited resources }; Controls { XmPopupMenu; XmRenderTable; }; }; Resource XmNscrollHorizontal : Argument { Type = boolean; Default = "True"; }; XmNscrollLeftSide : Argument { Type = boolean; Default = "True"; }; XmNscrollTopSide : Argument { Type = boolean; Default = "False"; }; XmNscrollVertical : Argument { Type = boolean; Default = "False"; }; ! Immediate subclasses of XmLabel Class XmCascadeButton : Widget { SuperClass = XmLabel; ConvenienceFunction = XmCreateCascadeButton; ControlsMapToResource = XmNsubMenuId; Resources { ! new resources XmNactivateCallback; XmNcascadePixmap; XmNcascadingCallback; XmNmappingDelay; XmNsubMenuId; ! inherited resources XmNaccelerator { Exclude = True;}; XmNacceleratorText { Exclude = True;}; XmNtraversalOn { Default = "True"; }; }; Controls { XmPulldownMenu; XmPopupMenu; }; }; Class XmDrawnButton : Widget { SuperClass = XmLabel; ConvenienceFunction = XmCreateDrawnButton; Resources { ! new resources XmNarmCallback; XmNactivateCallback; XmNdisarmCallback; XmNexposeCallback; XmNmultiClick; XmNresizeCallback; XmNpushButtonEnabled; XmNshadowType { Default = "XmSHADOW_ETCHED_IN"; }; ! inherited resources }; Controls { XmPopupMenu; }; }; Resource XmNpushButtonEnabled : Argument { Type = boolean; Default = "False"; }; ! This is a virtual class needed for accessing the automatically created ! TearOffControl for TearOff Menus. It cannot be instantiated directly. Class XmTearOffButton : Widget { SuperClass = XmPushButton; ConvenienceFunction = ""; Resources { ! new resources XmNseparatorType { Default = "XmSHADOW_ETCHED_OUT_DASH"; }; XmNmargin; ! inherited resources }; Controls { XmPopupMenu; }; }; Class XmPushButton : Widget { SuperClass = XmLabel; ConvenienceFunction = XmCreatePushButton; Resources { ! new resources XmNactivateCallback; XmNarmCallback; XmNarmColor; XmNarmPixmap; XmNdefaultButtonShadowThickness; XmNdisarmCallback; XmNfillOnArm; XmNmultiClick; XmNshowAsDefault; ! inherited resources }; Controls { XmPopupMenu; }; }; Class XmToggleButton : Widget { SuperClass = XmLabel; ConvenienceFunction = XmCreateToggleButton; Resources { ! new resources XmNarmCallback; XmNdetailShadowThickness; XmNdisarmCallback; XmNfillOnSelect; XmNhighlightThickness { Default = "dynamic"; }; XmNindeterminateInsensitivePixmap; XmNindeterminatePixmap; XmNindicatorOn; XmNindicatorSize; XmNindicatorType; XmNselectColor; XmNselectInsensitivePixmap; XmNselectPixmap; XmNset; XmNspacing; XmNtoggleMode; XmNunselectColor; XmNvalueChangedCallback; XmNvisibleWhenOff; ! inherited resources XmNtraversalOn { Default = "True"; }; }; Controls { XmPopupMenu; }; }; ! Immediate subclasses of Composite. Class "Constraint" : MetaClass ! Also a keyword, so quote Constraint { SuperClass = Composite; Resources { ! new resources ! inherited resources }; }; Class Shell : MetaClass { SuperClass = Composite; Resources { ! new resources XmNallowShellResize; XmNcreatePopupChildProc; XmNgeometry; XmNoverrideRedirect; XmNpopdownCallback; XmNpopupCallback; XmNsaveUnder; XmNvisual; ! inherited resources }; }; Resource XmNallowShellResize : Argument { Type = boolean; Default = "False"; }; XmNcreatePopupChildProc : Argument { Type = any; Default = "NULL"; }; XmNgeometry : Argument { Type = string; Default = "NULL"; }; XmNoverrideRedirect : Argument { Type = boolean; Default = "False"; }; XmNpopdownCallback : Reason { }; XmNpopupCallback : Reason { }; XmNsaveUnder : Argument { Type = boolean; Default = "False"; }; XmNvisual : Argument { Type = any ; Default = "CopyFromParent"; }; ! Immediate subclasses of Constraint Class XmManager : MetaClass { SuperClass = "Constraint"; Resources { ! new resources XmNbottomShadowColor; XmNbottomShadowPixmap; XmNforeground; XmNhelpCallback; XmNhighlightColor; XmNhighlightPixmap; XmNinitialFocus; XmNlayoutDirection; XmNnavigationType { Default = "XmTAB_GROUP"; }; XmNpopupHandlerCallback; XmNshadowThickness { Default = "0"; }; XmNstringDirection; XmNtopShadowColor; XmNtopShadowPixmap; XmNtraversalOn; XmNunitType; XmNuserData; ! inherited resources }; }; Resource XmNinitialFocus : Argument { Type = widget_ref; Default = "NULL"; }; XmNpopupHandlerCallback : Reason { }; XmNtraversalCallback : Reason { }; XmNtraverseObscuredCallback : Reason { }; ! Immediate subclasses of Shell Class OverrideShell : MetaClass { SuperClass = Shell; Resources { ! new resources ! inherited resources XmNoverrideRedirect { Default = "True"; }; XmNsaveUnder { Default = "True"; }; }; }; Class WMShell : MetaClass { SuperClass = Shell; Resources { ! new resources XmNbaseHeight; XmNbaseWidth; XmNheightInc; XmNiconMask; XmNiconPixmap; XmNiconWindow; XmNiconX; XmNiconY; XmNinitialState; XmNinput; XmNmaxAspectX; XmNmaxAspectY; XmNmaxHeight; XmNmaxWidth; XmNminAspectX; XmNminAspectY; XmNminHeight; XmNminWidth; XmNtitle; XmNtitleEncoding; XmNtransient; XmNwaitForWm; XmNwidthInc; XmNwindowGroup; XmNwinGravity; XmNwmTimeout; }; }; Resource XmNbaseHeight : Argument { Type = vertical_float; Default = "dynamic"; }; XmNbaseWidth : Argument { Type = horizontal_float; Default = "dynamic"; }; XmNheightInc : Argument { Type = vertical_float; Default = "dynamic"; }; XmNiconMask : Argument { Type = pixmap; Default = "NULL"; }; XmNiconPixmap : Argument { Type = pixmap; Default = "NULL"; }; XmNiconWindow : Argument { Type = any; Default = "NULL"; }; XmNiconX : Argument { Type = horizontal_float; Default = "-1"; }; XmNiconY : Argument { Type = vertical_float; Default = "-1"; }; XmNinitialState : Argument { Type = integer; EnumerationSet = InitialState; Default = "NormalState"; }; XmNinput : Argument { Type = boolean; Default = "False"; }; XmNmaxAspectX : Argument { Type = integer; Default = "dynamic"; }; XmNmaxAspectY : Argument { Type = integer; Default = "dynamic"; }; XmNmaxHeight : Argument { Type = vertical_float; Default = "dynamic"; }; XmNmaxWidth : Argument { Type = horizontal_float; Default = "dynamic"; }; XmNminAspectX : Argument { Type = integer; Default = "dynamic"; }; XmNminAspectY : Argument { Type = integer; Default = "dynamic"; }; XmNminHeight : Argument { Type = vertical_float; Default = "dynamic"; }; XmNminWidth : Argument { Type = horizontal_float; Default = "dynamic"; }; XmNtitle : Argument { Type = string; Default = "dynamic"; }; XmNtitleEncoding : Argument { Type = any; Default = "dynamic"; }; XmNtransient : Argument { Type = boolean; Default = "False"; }; XmNwaitForWm : Argument { Type = boolean; Default = "True"; }; XmNwidthInc : Argument { Type = horizontal_float; Default = "dynamic"; }; XmNwindowGroup : Argument { Type = any; Default = "dynamic"; }; XmNwinGravity : Argument { Type = integer; Default = "dynamic"; }; XmNwmTimeout : Argument { Type = integer; Default = "5000"; }; ! Immediate subclasses of WMShell Class VendorShell : MetaClass { SuperClass = WMShell; Resources { ! new resources XmNaudibleWarning; XmNbuttonFontList; XmNlabelFontList; XmNtextFontList; XmNbuttonRenderTable; XmNlabelRenderTable; XmNtextRenderTable; XmNdarkThreshold; XmNdefaultFontList; XmNdeleteResponse; XmNfocusMovedCallback; XmNforegroundThreshold; XmNinputMethod; XmNinputPolicy; XmNkeyboardFocusPolicy; XmNlightThreshold; XmNmwmDecorations; XmNmwmFunctions; XmNmwmInputMode; XmNmwmMenu; XmNpreeditType; XmNrealizeCallback; XmNshellUnitType; XmNtoolTipEnable; XmNtoolTipPostDuration; XmNtoolTipPostDelay; ! This is really a Shell resource XmNuseAsyncGeometry; ! inherited resources }; Controls { XmRenderTable; }; }; Resource XmNtoolTipEnable : Argument { Type = boolean; Default = "False"; }; XmNtoolTipPostDuration : Argument { Type = integer; Default = "1000"; }; XmNtoolTipPostDelay : Argument { Type = integer; Default = "1000"; }; XmNaudibleWarning : Argument { Type = integer; EnumerationSet = AudibleWarning; Default = "XmBELL"; }; XmNdarkThreshold : Argument { Type = integer; }; XmNdefaultFontList : Argument { Type = font_table; Default = "dynamic"; }; XmNdeleteResponse : Argument { Type = integer; EnumerationSet = DeleteResponse; Default = "XmDESTROY"; }; XmNfocusMovedCallback : Reason { }; XmNforegroundThreshold : Argument { Type = integer; }; XmNinputMethod : Argument { Type = string; Default = "Null"; }; XmNinputPolicy : Argument { Type = integer; EnumerationSet = InputPolicy; }; XmNkeyboardFocusPolicy : Argument { Type = integer; EnumerationSet = KeyboardFocusPolicy; Default = "XmEXPLICIT"; }; XmNlightThreshold : Argument { Type = integer; }; XmNmwmDecorations : Argument { Type = integer; EnumerationSet = MwmDecorations; Default = "-1"; }; XmNmwmFunctions : Argument { Type = integer; EnumerationSet = MwmFunctions; Default = "-1"; }; XmNmwmInputMode : Argument { Type = integer; EnumerationSet = MwmInputMode; Default = "-1"; }; XmNmwmMenu : Argument { Type = string; Default = "NULL"; }; XmNrealizeCallback : Reason { }; XmNpreeditType : Argument { Type = string; Default = "OverTheSpot,OffTheSpot,Root"; }; XmNshellUnitType : Argument { Type = integer; EnumerationSet = UnitType; Default = "XmPIXELS"; }; XmNuseAsyncGeometry : Argument { Type = boolean; Default = "False"; }; ! Immediate subclasses of VendorShell Class TopLevelShell : MetaClass { SuperClass = VendorShell; Resources { ! new resources XmNiconic; XmNiconName; XmNiconNameEncoding; ! inherited resources }; }; Resource XmNiconic : Argument { Type = boolean; Default = "False"; }; XmNiconName : Argument { Type = string; Default = "NULL"; }; XmNiconNameEncoding : Argument { Type = any; Default = "dynamic"; }; Class TransientShell : MetaClass { SuperClass = VendorShell; Resources { ! new resources XmNtransientFor; ! inherited resources }; }; Resource XmNtransientFor : Argument { Type = widget_ref; Default = "NULL"; }; ! Immediate subclasses of TransientShell Class XmDialogShell : Widget { SuperClass = TransientShell; ConvenienceFunction = XmCreateDialogShell; Resources { ! new resources ! inherited resources XmNdeleteResponse { Default = "XmUNMAP"; }; }; Controls { ManagerWidgets; }; }; ! Immediate subclasses of OverrideShell Class XmMenuShell : Widget { SuperClass = OverrideShell; ConvenienceFunction = XmCreateMenuShell; Resources { ! new resources XmNbuttonFontList; XmNdefaultFontList; XmNlabelFontList; XmNbuttonRenderTable; XmNlabelRenderTable; XmNtextRenderTable; ! inherited resources XmNallowShellResize { Default = "True"; }; }; Controls { XmRowColumn; XmRenderTable; }; }; ! Immediate subclasses of XmManager Class XmDrawingArea : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateDrawingArea; Resources { ! new resources XmNconvertCallback; XmNdestinationCallback; XmNexposeCallback; XmNinputCallback; XmNmarginHeight { Default = "10"; }; XmNmarginWidth { Default = "10"; }; XmNresizeCallback; XmNresizePolicy; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNconvertCallback : Reason { }; XmNexposeCallback : Reason { }; XmNinputCallback : Reason { }; XmNresizeCallback : Reason { }; XmNresizePolicy : Argument { Type = integer; EnumerationSet = ResizePolicy; Default = "XmRESIZE_ANY"; }; Class XmFrame : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateFrame; Controls { AllWidgetsAndGadgets; }; Resources { ! new resources XmNmarginHeight { Default = "0"; }; XmNmarginWidth { Default = "0"; }; XmNshadowType; ! constraint resources XmNchildHorizontalAlignment; XmNchildHorizontalSpacing; XmNchildType; XmNframeChildType; XmNchildVerticalAlignment; ! inherited resources XmNshadowThickness { Default = "dynamic"; }; }; }; Resource XmNshadowType : Argument { Type = integer; EnumerationSet = ShadowType; Default = "XmSHADOW_ETCHED_IN"; }; ! constraints XmNchildHorizontalAlignment : Constraint { Type = integer; EnumerationSet = Alignment; Default = "XmALIGNMENT_BEGINNING"; }; XmNchildHorizontalSpacing : Constraint { Type = horizontal_float; Default = "dynamic"; }; XmNchildType : Constraint { Type = integer; EnumerationSet = FrameChildType; Default = "XmFRAME_WORKAREA_CHILD"; }; XmNframeChildType : Constraint { Type = integer; EnumerationSet = FrameChildType; Default = "XmFRAME_WORKAREA_CHILD"; }; XmNchildVerticalAlignment : Constraint { Type = integer; EnumerationSet = ChildVerticalAlignment; Default = "XmALIGNMENT_CENTER"; }; Class XmPanedWindow : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreatePanedWindow; Resources { ! new resources XmNmarginHeight { Default = "3"; }; XmNmarginWidth { Default = "3"; }; XmNorientation; XmNrefigureMode; XmNsashHeight; XmNsashIndent; XmNsashShadowThickness; XmNsashWidth; XmNseparatorOn; XmNspacing { Default = "8"; }; ! constraint resources XmNpaneMinimum; XmNpaneMaximum; XmNpositionIndex; XmNskipAdjust; XmNallowResize; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNpositionIndex : Argument { Type = integer; EnumerationSet = PositionIndex; Default = "XmLAST_POSITION"; }; XmNrefigureMode : Argument { Type = boolean; Default = "True"; }; XmNsashHeight : Argument { Type = horizontal_float; Default = "10"; }; XmNsashIndent : Argument { Type = horizontal_float; Default = "-10"; }; XmNsashShadowThickness : Argument { Type = horizontal_float; Default = "2"; }; XmNsashWidth : Argument { Type = horizontal_float; Default = "10"; }; XmNseparatorOn : Argument { Type = boolean; Default = "True"; }; XmNpaneMinimum : Constraint { Type = horizontal_float; Default = "1"; }; XmNpaneMaximum : Constraint { Type = horizontal_float; Default = "1000"; }; XmNskipAdjust : Constraint { Type = boolean; Default = "False"; }; XmNallowResize : Constraint { Type = boolean; Default = "False"; }; Class XmScale : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateScale; Resources { ! new resources XmNconvertCallback; XmNdecimalPoints; XmNdragCallback; XmNeditable; XmNfontList { Default = "Fixed"; }; XmNrenderTable; XmNhighlightOnEnter { Default = "False"; }; XmNhighlightThickness { Default = "0"; }; XmNmaximum { Default = "100"; }; XmNminimum { Default = "0"; }; XmNorientation { Default = "XmVERTICAL"; }; XmNprocessingDirection {Default = "XmMAX_ON_TOP"; }; XmNscaleHeight; XmNscaleMultiple; XmNscaleWidth; XmNshowArrows; XmNshowValue; XmNsliderVisual; XmNslidingMode; XmNtitleString; XmNvalue { Default = "0"; }; XmNvalueChangedCallback; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; Children { Xm_Title; }; }; Resource ! XmNdecimalPoints: Argument ! { Type = integer; ! Default = "0"; }; XmNdecimalPoints: Constraint { Type = integer; Default = "0"; }; XmNscaleHeight: Argument { Type = vertical_float; Default = "0"; }; XmNscaleMultiple: Argument { Type = integer; Default = "1"; }; XmNscaleWidth: Argument { Type = horizontal_float; Default = "0"; }; XmNshowValue: Argument { Type = integer; EnumerationSet = ScaleShowValue; Default = "XmNONE"; }; XmNtitleString: Argument { Type = compound_string; Default = "Null"; }; Class XmScrolledWindow : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateScrolledWindow; Resources { ! new resources XmNautoDragModel; XmNclipWindow { Exclude = True; }; XmNhorizontalScrollBar { Default = "Null"; }; XmNscrollBarDisplayPolicy { Default = "XmSTATIC"; }; XmNscrollBarPlacement { Default = "XmBOTTOM_RIGHT"; }; XmNscrolledWindowMarginHeight; XmNscrolledWindowMarginWidth; XmNscrollingPolicy; XmNspacing { Default = "4"; }; XmNtraverseObscuredCallback; XmNverticalScrollBar { Default = "Null"; }; XmNvisualPolicy; XmNworkWindow; ! inherited resources ! constraint resources XmNscrolledWindowChildType; }; Controls { AllWidgetsAndGadgets; }; Children { Xm_VertScrollBar; Xm_HorScrollBar; }; }; Child Xm_VertScrollBar : XmScrollBar; Xm_HorScrollBar : XmScrollBar; Resource XmNclipWindow : Argument { Type = widget_ref; Default = "Null"; }; XmNscrollingPolicy : Argument { Type = integer; EnumerationSet = ScrollingPolicy; Default = "XmAPPLICATION_DEFINED"; }; XmNvisualPolicy : Argument { Type = integer; EnumerationSet = VisualPolicy; Default = "XmVARIABLE"; }; XmNworkWindow : Argument { Type = widget_ref; Default = "Null"; }; XmNscrolledWindowChildType : Constraint { Type = integer; EnumerationSet = ScrolledWindowChildType; }; Class XmComboBox : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateComboBox; Resources { ! new resources XmNarrowSize; XmNarrowSpacing; XmNcolumns { Default = "XmUNSPECIFIED_COUNT"; }; XmNcomboBoxType; XmNfontList; XmNhighlightThickness; XmNitems { Default = "XmUNSPECIFIED"; }; XmNitemCount { Default = "XmUNSPECIFIED_COUNT"; }; XmNmarginHeight; XmNmarginWidth; XmNmatchBehavior; XmNlist; XmNpositionMode; XmNrenderTable; XmNselectionCallback; XmNselectedItem; XmNselectedPosition; XmNtextField; XmNvisibleItemCount { Default = "XmUNSPECIFIED_COUNT";}; ! inherited resources XmNnavigationType { Default = "XmSTICKY_TAB_GROUP"; }; XmNshadowThickness { Default = "dynamic"; }; }; ! ! Do the XmNtextField and XmNlist need to be defined in the Children/Controls ! Controls { AllWidgetsAndGadgets; }; Children { Xm_List; Xm_Text; Xm_TextField; }; }; Child Xm_List : XmList; Xm_TextField : XmTextField; Resource XmNarrowSize : Argument { Type = horizontal_float; Default = XmINVALID_DIMENSION; }; XmNarrowSpacing : Argument { Type = horizontal_float; Default = XmINVALID_DIMENSION; }; XmNselectionCallback : Reason { }; XmNselectedItem : Argument { Type = compound_string; Default = "NULL"; }; XmNselectedPosition : Argument { Type = integer; Default = "0"; }; XmNcomboBoxType : Argument { Type = integer; EnumerationSet = ComboBoxType; Default = "XmDROP_DOWN_LIST"; }; XmNlist : Argument { Type = widget_ref; Default = "NULL"; }; XmNtextField : Argument { Type = widget_ref; Default = "NULL"; }; XmNpositionMode : Argument { Type = integer; EnumerationSet = PositionMode; Default = "XmZERO_BASED"; }; Class XmContainer : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateContainer; Resources { ! new resources XmNautomaticSelection { Default = "XmAUTO_SELECT"; }; XmNcollapsedStatePixmap; XmNconvertCallback; XmNdefaultActionCallback; XmNdestinationCallback; XmNdetailColumnHeading; XmNdetailColumnHeadingCount; XmNdetailOrder; XmNdetailOrderCount; XmNdetailTabList; XmNentryViewType; XmNexpandedStatePixmap; XmNlargeCellHeight; XmNlargeCellWidth; XmNlayoutType; XmNmarginHeight; XmNmarginWidth; XmNoutlineButtonPolicy; XmNoutlineChangedCallback; XmNoutlineColumnWidth; XmNoutlineIndentation; XmNoutlineLineStyle; XmNprimaryOwnership; XmNrenderTable; XmNresizeHeight; XmNresizeWidth; XmNselectColor; ! Cannot support the next two without ! a widget table data type ! XmNselectedObjects; ! XmNselectedObjectCount; XmNselectionCallback; XmNselectionPolicy; XmNselectionTechnique; XmNsmallCellHeight; XmNsmallCellWidth; XmNspatialIncludeModel; XmNspatialResizeModel; XmNspatialSnapModel; XmNspatialStyle; ! constraint resources XmNentryParent; XmNoutlineState; XmNlargeIconX; XmNlargeIconY; XmNpositionIndex; XmNsmallIconX; XmNsmallIconY; }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNcollapsedStatePixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNdetailColumnHeading : Argument { Type = string_table; Default = "NULL"; Related = XmNdetailColumnHeadingCount; }; XmNdetailColumnHeadingCount : Argument { Type = integer; Default = "0"; }; XmNdetailOrder : Argument { Type = integer_table; Default = "NULL"; Related = XmNdetailOrderCount; }; XmNdetailOrderCount : Argument { Type = integer; Default = "0"; }; XmNdetailTabList : Argument { Type = widget_ref; Default = "NULL"; }; XmNentryViewType : Argument { Type = integer; EnumerationSet = EntryViewType; Default = "XmLARGE_ICON"; }; XmNexpandedStatePixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNlargeCellHeight : Argument { Type = vertical_float; }; XmNlargeCellWidth : Argument { Type = horizontal_float; }; XmNlayoutDirection : Argument { Type = integer; EnumerationSet = LayoutDirection; Default = "XmLEFT_TO_RIGHT_TOP_TO_BOTTOM"; }; XmNlayoutType : Argument { Type = integer; EnumerationSet = LayoutType; Default = "XmSPATIAL"; }; XmNoutlineButtonPolicy : Argument { Type = integer; EnumerationSet = OutlineButtonPolicy; Default = "XmOUTLINE_BUTTON_PRESENT"; }; XmNoutlineChangedCallback : Reason { }; XmNoutlineColumnWidth : Argument { Type = horizontal_float; Default = "0"; }; XmNoutlineIndentation : Argument { Type = horizontal_float; Default = "100"; }; XmNoutlineLineStyle : Argument { Type = integer; EnumerationSet = ContainerLineStyle; Default = "XmSINGLE"; }; XmNselectionTechnique : Argument { Type = integer; EnumerationSet = SelectionTechnique; Default = "XmTOUCH_OVER"; }; XmNsmallCellHeight : Argument { Type = vertical_float; }; XmNsmallCellWidth : Argument { Type = horizontal_float; }; XmNspatialIncludeModel : Argument { Type = integer; EnumerationSet = SpatialIncludeModel; Default = "XmAPPEND"; }; XmNspatialResizeModel : Argument { Type = integer; EnumerationSet = SpatialResizeModel; Default = "XmGROW_MINOR"; }; XmNspatialSnapModel : Argument { Type = integer; EnumerationSet = SpatialSnapModel; Default = "XmNONE"; }; XmNspatialStyle : Argument { Type = integer; EnumerationSet = SpatialStyle; Default = "XmSPECIFIC"; }; ! constraint resources XmNentryParent : Constraint { Type = widget_ref; Default = "NULL"; }; XmNoutlineState : Constraint { Type = integer; EnumerationSet = OutlineState; Default = "XmCOLLAPSED"; }; XmNlargeIconX : Constraint { Type = horizontal_float; }; XmNlargeIconY : Constraint { Type = vertical_float; }; XmNsmallIconX : Constraint { Type = horizontal_float; }; XmNsmallIconY : Constraint { Type = vertical_float; }; Class XmNotebook : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateNotebook; Resources { ! new resources XmNcurrentPageNumber; XmNfirstPageNumber; XmNlastPageNumber; XmNorientation; XmNbackPagePlacement; XmNbackPageNumber; XmNbackPageSize; XmNbackPageForeground; XmNbackPageBackground; XmNframeBackground; XmNbindingType; XmNbindingPixmap; XmNbindingWidth; XmNinnerMarginWidth; XmNinnerMarginHeight; XmNmajorTabSpacing; XmNminorTabSpacing; XmNframeShadowThickness; XmNpageChangedCallback; ! constraint resources XmNnotebookChildType; XmNpageNumber; XmNresizable; }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNcurrentPageNumber : Argument { Type = integer; }; XmNfirstPageNumber : Argument { Type = integer; Default = "1"; }; XmNlastPageNumber : Argument { Type = integer; }; XmNbackPagePlacement : Argument { Type = integer; }; XmNbackPageNumber : Argument { Type = integer; }; XmNbackPageSize : Argument { Type = horizontal_float; }; XmNbackPageForeground : Argument { Type = color; }; XmNbackPageBackground : Argument { Type = color; }; XmNframeBackground : Argument { Type = color; }; XmNbindingType : Argument { Type = integer; EnumerationSet = BindingType; }; XmNbindingPixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; XmNbindingWidth : Argument { Type = horizontal_float; Default = "25"; }; XmNinnerMarginWidth : Argument { Type = horizontal_float; }; XmNinnerMarginHeight : Argument { Type = vertical_float; }; ! I am going out on a limb here, but I think tabs will usually ! be situated vertically up and down the notebook. Therefore, ! let us make the next two resources vertical floats even though ! spacing resources which are used for both vertical and ! horizontal dimensions are type as horizontal float by default. XmNmajorTabSpacing : Argument { Type = vertical_float; }; XmNminorTabSpacing : Argument { Type = vertical_float; }; XmNnotebookChildType : Constraint { Type = integer; EnumerationSet = NotebookChildType; }; XmNframeShadowThickness : Argument { Type = horizontal_float; }; XmNpageChangedCallback : Reason { }; XmNpageNumber : Constraint { Type = integer; }; Class XmSpinBox : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateSpinBox; Resources { ! new resources XmNarrowLayout; XmNarrowOrientation; XmNarrowSize; XmNdefaultArrowSensitivity; XmNinitialDelay; XmNmarginWidth; XmNmarginHeight; XmNmodifyVerifyCallback; XmNrepeatDelay; XmNspacing { Default = "0"; }; XmNvalueChangedCallback; ! inherited resources !XmNactivateCallback; !XmNlosingFocusCallback; !XmNnavigationType; !XmNtraversalOn; ! constraint resources XmNarrowSensitivity; XmNdecimalPoints; XmNincrementValue; XmNmaximumValue; XmNminimumValue; XmNnumValues; XmNposition; XmNpositionType; XmNspinBoxChildType; XmNvalues; ! undocumented resources !XmNwrap; }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNdefaultArrowSensitivity : Argument { Type = integer; EnumerationSet = ArrowSensitivity; Default = "XmARROWS_SENSITIVE"; }; XmNarrowLayout : Argument { Type = integer; EnumerationSet = ArrowLayout; Default = "XmARROWS_END"; }; XmNarrowOrientation : Argument { Type = integer; EnumerationSet = ArrowOrientation; Default = "XmARROWS_VERTICAL"; }; XmNspinBoxChildType : Constraint { Type = integer; EnumerationSet = SpinBoxChildType; }; XmNpositionType : Constraint { Type = integer; EnumerationSet = PositionType; Default = "XmPOSITION_VALUE"; }; XmNposition : Constraint { Type = integer; Default = "0"; }; XmNnumValues : Constraint { Type = integer; Default = "0"; }; XmNvalues : Constraint { Type = string_table; Default = "NULL"; Related = XmNnumValues; }; XmNminimumValue : Constraint { Type = integer; Default = "0"; }; XmNmaximumValue : Constraint { Type = integer; Default = "10"; }; XmNincrementValue : Constraint { Type = integer; Default = "1"; }; XmNarrowSensitivity : Constraint { Type = integer; EnumerationSet = ArrowSensitivity; Default = "XmARROWS_DEFAULT_SENSITIVITY"; }; XmNwrap : Constraint { Type = boolean; Default = "True"; }; Class XmSimpleSpinBox : Widget { SuperClass = XmSpinBox; ConvenienceFunction = XmCreateSimpleSpinBox; Resources { ! inherited resources XmNshadowThickness { Default = "1"; }; ! new resources XmNarrowSensitivity; XmNcolumns; XmNdecimalPoints; XmNeditable; XmNincrementValue; XmNmaximumValue; XmNminimumValue; XmNnumValues; XmNposition; XmNpositionType; XmNspinBoxChildType { Default = "XmSTRING"; }; XmNtextField; XmNvalues; ! undocumented resources !XmNwrap; }; ! ! Does the XmNtextField need to be defined in the Children/Controls ! Controls { XmTextField; }; }; ! Bulletin board inherits from XmManager. Its Dialog variant is treated ! as a subclass Class XmBulletinBoard : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateBulletinBoard; Resources { ! new resources XmNallowOverlap; XmNautoUnmanage; XmNbuttonFontList; XmNcancelButton; XmNdefaultButton; XmNdefaultPosition; XmNdialogStyle; XmNdialogTitle; XmNfocusCallback; XmNlabelFontList; XmNlosingFocusCallback; XmNmapCallback; XmNmarginHeight { Default = "10";}; XmNmarginWidth { Default = "10";}; XmNnoResize; XmNresizePolicy{ Default = "XmRESIZE_ANY"; }; XmNshadowType { Default = "XmSHADOW_OUT";}; XmNtextFontList; XmNtextTranslations; XmNunmapCallback; XmNbuttonRenderTable; XmNlabelRenderTable; XmNtextRenderTable; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNallowOverlap : Argument { Type = boolean; Default = "True"; }; XmNautoUnmanage : Argument { Type = boolean; Default = "True"; }; XmNbuttonFontList : Argument { Type = font_table; Default = "dynamic"; }; XmNcancelButton : Argument { Type = widget_ref; Default = "Null"; }; XmNdefaultButton : Argument { Type = widget_ref; Default = "Null"; }; XmNdefaultPosition: Argument { Type = boolean; Default = "True"; }; XmNdialogStyle : Argument { Type = integer; EnumerationSet = DialogStyle; Default = "dynamic"; }; XmNdialogTitle : Argument { Type = compound_string; Default = "Null"; }; XmNlabelFontList : Argument { Type = font_table; Default = "dynamic"; }; XmNmapCallback : Reason { }; XmNnoResize : Argument { Type = boolean; Default = "False"; }; XmNtextFontList : Argument { Type = font_table; Default = "dynamic"; }; XmNtextTranslations : Argument { Type = translation_table; Default = "Null"; }; XmNunmapCallback : Reason { }; XmNbuttonRenderTable : Argument { Type = widget_ref; Default = "dynamic"; }; XmNlabelRenderTable : Argument { Type = widget_ref; Default = "dynamic"; }; XmNtextRenderTable : Argument { Type = widget_ref; Default = "dynamic"; }; Class XmBulletinBoardDialog : Widget { SuperClass = XmBulletinBoard; ParentClass = XmDialogShell; ConvenienceFunction = XmCreateBulletinBoardDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; ! RowColumn is instantiated as a number of different apparent widget ! classes. There is a UIL widget for each creation routine, which ! appears like a discrete class. All inherit from XmManager in fact, ! but are made to appear as subclasses of RowColumn to make resource ! specification easier Class XmRowColumn : Widget { SuperClass = XmManager; ConvenienceFunction = XmCreateRowColumn; Resources { ! new resources XmNadjustLast; XmNadjustMargin; XmNentryAlignment; XmNentryBorder; XmNentryCallback; XmNentryClass; XmNentryVerticalAlignment; XmNisAligned; XmNisHomogeneous; XmNlabelString { Default = "Null"; }; XmNmapCallback; XmNmarginHeight{ Default = "dynamic";}; XmNmarginWidth { Default = "3";}; XmNmenuAccelerator; XmNmenuHelpWidget; XmNmenuHistory; XmNmenuPost; XmNmnemonic { Default = "dynamic"; }; XmNmnemonicCharSet; XmNnumColumns; XmNorientation { Default = "dynamic"; }; XmNpacking; XmNpopupEnabled; XmNradioAlwaysOne; XmNradioBehavior; XmNresizeHeight { Default = "True"; }; XmNresizeWidth { Default = "True"; }; XmNrowColumnType; XmNspacing { Default = "dynamic"; }; XmNsubMenuId { Default = "Null";}; XmNtearOffMenuActivateCallback; XmNtearOffMenuDeactivateCallback; XmNtearOffModel; XmNtearOffTitle; XmNunmapCallback; XmNwhichButton; ! constraint resources XmNpositionIndex; ! inherited resources XmNborderWidth { Default = "0"; }; XmNheight { Default = "dynamic"; }; XmNnavigationType { Default = "dynamic"; }; XmNwidth { Default = "dynamic"; }; }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNadjustLast : Argument { Type = boolean; Default = "True"; }; XmNadjustMargin : Argument { Type = boolean; Default = "True"; }; XmNentryAlignment : Argument { Type = integer; EnumerationSet = Alignment; Default = "dynamic"; }; XmNentryBorder : Argument { Type = horizontal_float; Default = "dynamic"; }; XmNentryCallback : Reason { }; XmNentryClass : Argument { Type = class_rec_name; Default = "dynamic"; }; XmNentryVerticalAlignment : Argument { Type = integer; EnumerationSet = VerticalAlignment; Default = "XmALIGNMENT_CENTER"; }; XmNisAligned : Argument { Type = boolean; Default = "True"; }; XmNisHomogeneous : Argument { Type = boolean; Default = "dynamic"; }; XmNmenuAccelerator : Argument { Type = string; Default = "dynamic"; }; ! XmNmenuTranslation : Argument ! { Type = translation_table; ! Default = "NULL"; }; XmNmenuHelpWidget : Argument { Type = widget_ref; Default = "Null"; }; XmNmenuHistory : Argument { Type = widget_ref; Default = "Null"; }; XmNmenuPost : Argument { Type = string; Default = "Null"; }; XmNnumColumns : Argument { Type = integer; Default = "dynamic"; }; XmNpacking : Argument { Type = integer; EnumerationSet = Packing; Default = "dynamic"; }; XmNpopupEnabled : Argument { Type = boolean; Default = "True"; }; XmNradioAlwaysOne : Argument { Type = boolean; Default = "True"; }; XmNradioBehavior : Argument { Type = boolean; Default = "False"; }; XmNrowColumnType : Argument { Type = integer; EnumerationSet = RowColumnType; Default = "XmWORK_AREA"; }; XmNtearOffMenuActivateCallback : Reason { }; XmNtearOffMenuDeactivateCallback : Reason { }; XmNtearOffModel : Argument { Type = integer; EnumerationSet = TearOffModel; Default = "XmTEAR_OFF_DISABLED"; }; XmNtearOffTitle : Argument { Type = string; Default = "NULL"; }; XmNunpostBehavior : Argument { Type = integer; EnumerationSet = UnpostBehavior; Default = "XmUNPOST_AND_REPLAY"; }; XmNwhichButton : Argument { Type = integer; Default = "dynamic"; }; Class XmWorkArea : Widget { SuperClass = XmRowColumn; ConvenienceFunction = XmCreateWorkArea; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmMenuBar : Widget { SuperClass = XmRowColumn; ConvenienceFunction = XmCreateMenuBar; Resources { ! new resources ! inherited resources }; Controls { MenuWidgetsAndGadgets; XmPopupMenu; XmPulldownMenu; }; }; Class XmOptionMenu : Widget { SuperClass = XmRowColumn; ConvenienceFunction = XmCreateOptionMenu; ControlsMapToResource = XmNsubMenuId; Resources { ! new resources ! inherited resources }; Controls { XmPulldownMenu; }; Children { Xm_OptionLabel; Xm_OptionButton; }; }; Child Xm_OptionLabel : XmLabelGadget; Xm_OptionButton : XmCascadeButtonGadget; Class XmPopupMenu : Widget { SuperClass = XmRowColumn; ParentClass = XmMenuShell; ConvenienceFunction = XmCreatePopupMenu; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { MenuWidgetsAndGadgets; }; Children { Xm_TearOffControl; }; }; Child Xm_TearOffControl : XmTearOffButton; Class XmPulldownMenu : Widget { SuperClass = XmRowColumn; ParentClass = XmMenuShell; ConvenienceFunction = XmCreatePulldownMenu; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { MenuWidgetsAndGadgets; }; Children { Xm_TearOffControl; }; }; Class XmRadioBox : Widget { SuperClass = XmRowColumn; ConvenienceFunction = XmCreateRadioBox; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; ! ! Fix for CR 5651 - add information for the CheckBox ! Class XmCheckBox : Widget { SuperClass = XmRowColumn; ConvenienceFunction = XmCreateSimpleCheckBox; Resources { XmNbuttonCount; XmNbuttons; XmNsimpleCallback; }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNbuttons : Argument { Type = string_table; Default = "NULL"; Related = XmNbuttonCount; }; XmNbuttonCount : Argument { Type = integer; Default = "0"; }; XmNsimpleCallback : Reason { }; ! ! End Fix for CR 5651 ! ! Immediate subclasses of XmScrolledWindow Class XmMainWindow : Widget { SuperClass = XmScrolledWindow; ConvenienceFunction = XmCreateMainWindow; DialogClass = True; Resources { ! new resources XmNcommandWindow; XmNcommandWindowLocation; XmNmainWindowMarginHeight; XmNmainWindowMarginWidth; XmNmenuBar; XmNmessageWindow; XmNshowSeparator; ! inherited constraint resources XmNscrolledWindowChildType; }; Controls { AllWidgetsAndGadgets; }; Children { Xm_Separator1; Xm_Separator2; Xm_Separator3; }; }; Child Xm_Separator1 : XmSeparator; Xm_Separator2 : XmSeparator; Xm_Separator3 : XmSeparator; Resource XmNcommandWindow : Argument { Type = widget_ref; Default = "Null"; }; XmNcommandWindowLocation : Argument { Type = integer; EnumerationSet = CommandWindowLocation; Default = "XmCOMMAND_ABOVE_WORKSPACE"; }; XmNmainWindowMarginHeight : Argument { Type = vertical_float; Default = "0"; }; XmNmainWindowMarginWidth : Argument { Type = horizontal_float; Default = "0"; }; XmNmenuBar : Argument { Type = widget_ref; Default = "Null"; }; XmNmessageWindow : Argument { Type = widget_ref; Default = "Null"; }; XmNshowSeparator : Argument { Type = boolean; Default = "False"; }; ! Immediate subclasses of XmBulletinBoard ! For each class, the Dialog variant is treated as a subclass Class XmForm : Widget { SuperClass = XmBulletinBoard; ConvenienceFunction = XmCreateForm; Resources { ! new resources XmNfractionBase; XmNhorizontalSpacing; XmNrubberPositioning; XmNverticalSpacing; ! constraint resources XmNbottomAttachment; XmNbottomOffset; XmNbottomPosition; XmNbottomWidget; XmNleftAttachment; XmNleftOffset; XmNleftPosition; XmNleftWidget; XmNresizable; XmNrightAttachment; XmNrightOffset; XmNrightPosition; XmNrightWidget; XmNtopAttachment; XmNtopOffset; XmNtopPosition; XmNtopWidget; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Resource XmNfractionBase : Argument { Type = integer; Default = "100"; }; XmNhorizontalSpacing : Argument { Type = horizontal_float; Default = "0"; }; XmNverticalSpacing : Argument { Type = vertical_float; Default = "0"; }; XmNrubberPositioning : Argument { Type = boolean; Default = "False"; }; ! constraints XmNbottomAttachment : Constraint { Type = integer; EnumerationSet = Attachment; Default = "XmATTACH_NONE"; }; XmNbottomOffset : Constraint { Type = vertical_float; Default = "0"; }; XmNbottomPosition : Constraint { Type = integer; Default = "0"; }; XmNbottomWidget : Constraint { Type = widget_ref; Default = "Null"; }; XmNleftAttachment : Constraint { Type = integer; EnumerationSet = Attachment; Default = "XmATTACH_NONE"; }; XmNleftOffset : Constraint { Type = horizontal_float; Default = "0"; }; XmNleftPosition : Constraint { Type = integer; Default = "0"; }; XmNleftWidget : Constraint { Type = widget_ref; Default = "Null"; }; XmNresizable : Constraint { Type = boolean; Default = "True"; }; XmNrightAttachment : Constraint { Type = integer; EnumerationSet = Attachment; Default = "XmATTACH_NONE"; }; XmNrightOffset : Constraint { Type = horizontal_float; Default = "0"; }; XmNrightPosition : Constraint { Type = integer; Default = "0"; }; XmNrightWidget : Constraint { Type = widget_ref; Default = "Null"; }; XmNtopAttachment : Constraint { Type = integer; EnumerationSet = Attachment; Default = "XmATTACH_NONE"; }; XmNtopOffset : Constraint { Type = vertical_float; Default = "0"; }; XmNtopWidget : Constraint { Type = widget_ref; Default = "Null"; }; XmNtopPosition : Constraint { Type = integer; Default = "0"; }; Class XmFormDialog : Widget { SuperClass = XmForm; ParentClass = XmDialogShell; ConvenienceFunction = XmCreateFormDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; ! Immediate subclass of XmBulletinBoard ! Most Dialogs are variants of MessageBox, and are treated as subclasses. Class XmMessageBox : Widget { SuperClass = XmBulletinBoard; ConvenienceFunction = XmCreateMessageBox; Resources { ! new resources XmNcancelCallback; XmNcancelLabelString; XmNdefaultButtonType; XmNdialogType; XmNhelpLabelString; XmNmessageAlignment; XmNmessageString; XmNminimizeButtons; XmNokCallback; XmNokLabelString; XmNsymbolPixmap; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; Children { Xm_Symbol; Xm_Separator; Xm_Message; Xm_OK; Xm_Cancel; Xm_Help; }; }; Child Xm_Symbol : XmLabel; Xm_Separator : XmSeparator; Xm_Message : XmLabel; Xm_OK : XmPushButton; Xm_Cancel : XmPushButton; Xm_Help : XmPushButton; Resource XmNcancelCallback : Reason { }; XmNcancelLabelString : Argument { Type = compound_string; Default = "Cancel"; }; XmNdefaultButtonType : Argument { Type = integer; EnumerationSet = DefaultButtonType; Default = "XmDIALOG_OK_BUTTON"; }; XmNdialogType : Argument { Type = integer; EnumerationSet = DialogType; Default = "XmDIALOG_MESSAGE"; }; XmNhelpLabelString : Argument { Type = compound_string; Default = "Help"; }; XmNmessageAlignment : Argument { Type = integer; EnumerationSet = Alignment; Default = "XmALIGNMENT_BEGINNING"; }; XmNmessageString : Argument { Type = compound_string; Default = "Null"; }; XmNminimizeButtons : Argument { Type = boolean; Default = "False"; }; XmNokCallback : Reason { }; XmNokLabelString : Argument { Type = compound_string; Default = "OK"; }; XmNsymbolPixmap : Argument { Type = pixmap; Default = "XmDEFAULT_PIXMAP"; }; Class XmMessageDialog : Widget { SuperClass = XmMessageBox; ParentClass = XmDialogShell; ConvenienceFunction = XmCreateMessageDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmErrorDialog : Widget { SuperClass = XmMessageDialog; ConvenienceFunction = XmCreateErrorDialog; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmInformationDialog : Widget { SuperClass = XmMessageDialog; ConvenienceFunction = XmCreateInformationDialog; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmQuestionDialog : Widget { SuperClass = XmMessageDialog; ConvenienceFunction = XmCreateQuestionDialog; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmTemplateDialog : Widget { SuperClass = XmMessageDialog; ConvenienceFunction = XmCreateTemplateDialog; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmWarningDialog : Widget { SuperClass = XmMessageDialog; ConvenienceFunction = XmCreateWarningDialog; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmWorkingDialog : Widget { SuperClass = XmMessageDialog; ConvenienceFunction = XmCreateWorkingDialog; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; ! Immediate subclass of XmBulletinBoard ! Dialog variants are treated as subclasses Class XmSelectionBox : Widget { SuperClass = XmBulletinBoard; ConvenienceFunction = XmCreateSelectionBox; Resources { ! new resources XmNapplyCallback; XmNapplyLabelString; XmNcancelCallback; XmNcancelLabelString { Default = "cancel"; }; XmNdialogType { Default = "dynamic"; }; XmNhelpLabelString { Default = "help"; }; XmNlistItemCount; XmNlistItems; XmNlistLabelString; XmNlistVisibleItemCount; XmNminimizeButtons { Default = "False"; }; XmNmustMatch; XmNnoMatchCallback; XmNokCallback; XmNokLabelString; XmNselectionLabelString; XmNtextAccelerators; XmNtextColumns; XmNtextString; XmNchildPlacement; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; Children { Xm_Items; Xm_ItemsList; Xm_Selection; Xm_Text; Xm_Separator; Xm_OK; Xm_Cancel; Xm_Help; Xm_Apply; }; }; Child Xm_Items : XmLabel; Xm_ItemsList : XmScrolledList; Xm_Selection : XmLabel; Xm_Text : XmText; Xm_Apply : XmPushButton; Resource XmNapplyCallback : Reason { }; XmNapplyLabelString : Argument { Type = compound_string; Default = "Apply"; }; XmNlistItemCount : Argument { Type = integer; Default = "0"; }; XmNlistItems : Argument { Type = string_table; Default = "Null"; Related = XmNlistItemCount; }; XmNlistLabelString : Argument { Type = compound_string; Default = "Null"; }; XmNlistVisibleItemCount : Argument { Type = integer; Default = "8"; }; XmNmustMatch : Argument { Type = boolean; Default = "False"; }; XmNnoMatchCallback: Reason { }; XmNselectionLabelString : Argument { Type = compound_string; Default = "Selection"; }; XmNtextAccelerators : Argument { Type = translation_table; Default = ""; }; XmNtextColumns : Argument { Type = integer; Default = "20"; }; XmNtextString : Argument { Type = compound_string; Default = "Null"; }; XmNchildPlacement : Constraint { Type = integer; EnumerationSet = ChildPlacement; Default = "XmPLACE_ABOVE_SELECTION"; }; Class XmSelectionDialog : Widget { SuperClass = XmSelectionBox; ParentClass = XmDialogShell; ConvenienceFunction = XmCreateSelectionDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class XmPromptDialog : Widget { SuperClass = XmSelectionBox; ParentClass = XmDialogShell; ConvenienceFunction = XmCreatePromptDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; ! Immediate subclasses of XmSelectionBox Class XmCommand : Widget { SuperClass = XmSelectionBox; ConvenienceFunction = XmCreateCommand; Resources { ! new resources XmNcommand; XmNcommandChangedCallback; XmNcommandEnteredCallback; XmNhistoryItems; XmNhistoryItemCount; XmNhistoryMaxItems; XmNhistoryVisibleItemCount; XmNpromptString; ! inherited resources XmNapplyCallback { Exclude = True; }; XmNapplyLabelString { Exclude = True; }; XmNautoUnmanage {Exclude = True;}; XmNcancelCallback { Exclude = True; }; XmNcancelLabelString { Exclude = True; }; XmNhelpLabelString { Exclude = True; }; XmNlistLabelString { Exclude = True; }; XmNminimizeButtons { Exclude = True; }; XmNmustMatch { Exclude = True; }; XmNnoMatchCallback { Exclude = True; }; XmNokCallback { Exclude = True; }; XmNokLabelString { Exclude = True; }; XmNallowOverlap { Exclude = True; }; XmNbuttonFontList { Exclude = True; }; XmNcancelButton { Exclude = True; }; XmNdefaultButton { Exclude = True; }; XmNdialogType { Default = "XmDIALOG_COMMAND"; }; }; Controls { XmPopupMenu; }; }; Resource XmNcommand : Argument { Type = compound_string; Default = "Null"; }; XmNcommandChangedCallback : Reason { }; XmNcommandEnteredCallback : Reason { }; XmNhistoryItems : Argument { Type = string_table; Default = "Null"; Related = XmNhistoryItemCount; }; XmNhistoryItemCount : Argument { Type = integer; Default = "0"; }; XmNhistoryMaxItems : Argument { Type = integer; Default = "100"; }; XmNhistoryVisibleItemCount : Argument { Type = integer; Default = "8"; }; XmNpromptString : Argument { Type = compound_string; Default = ">"; }; Class XmCommandDialog : Widget { SuperClass = XmCommand; ParentClass = XmDialogShell; ConvenienceFunction = XmCreateCommandDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; ! Immediate subclass of SelectionBox ! The Dialog variant is treated as a subclass Class XmFileSelectionBox : Widget { SuperClass = XmSelectionBox; ConvenienceFunction = XmCreateFileSelectionBox; Resources { ! new resources XmNdirMask; XmNdirSpec; XmNfileSearchProc; XmNfileTypeMask; XmNfilterLabelString; XmNlistUpdated; XmNdirectory; XmNdirectoryValid; XmNpattern; XmNdirListLabelString; XmNdirListItems; XmNdirListItemCount; XmNfileListItemCount; XmNfileListItems; XmNnoMatchString; XmNqualifySearchDataProc; XmNdirSearchProc; XmNfileListLabelString; ! inherited resources XmNapplyLabelString { Default = "Filter"; }; XmNlistLabelString { Default = "Files"; }; }; Controls { AllWidgetsAndGadgets; }; Children { Xm_FilterLabel; Xm_FilterText; Xm_DirList; Xm_Dir; Xm_Filter; }; }; Child Xm_FilterLabel : XmLabel; Xm_FilterText : XmText; Xm_DirList : XmScrolledList; Xm_Dir : XmLabel; Xm_Filter : XmPushButton; Resource XmNdirMask : Argument { Type = compound_string; Default = "*"; }; XmNdirSpec : Argument { Type = compound_string; Default = "Null"; }; XmNfileSearchProc : Argument { Type = any; Default = "default"; }; XmNfilterLabelString : Argument { Type = compound_string; Default = "File Filter"; }; XmNlistUpdated : Argument { Type = boolean; Default = "True"; }; XmNfileTypeMask : Argument { Type = integer; EnumerationSet = FileTypeMask; Default = "XmFILE_REGULAR"; }; XmNdirectory: Argument { Type = compound_string; Default = "current working directory"; }; XmNdirectoryValid : Argument { Type = boolean; Default = "True"; }; XmNpattern: Argument { Type = compound_string; Default = "*"; }; XmNdirListLabelString: Argument { Type = compound_string; Default = "Directories"; }; XmNdirListItemCount : Argument { Type = integer; Default = "0"; }; XmNdirListItems : Argument { Type = string_table; Default = "dynamic"; Related = XmNdirListItemCount; }; XmNfileListItemCount : Argument { Type = integer; Default = "0"; }; XmNfileListItems : Argument { Type = string_table; Default = "NULL"; Related = XmNfileListItemCount; }; XmNnoMatchString: Argument { Type = compound_string; Default = " [ ] "; }; XmNqualifySearchDataProc : Argument { Type = any; Default = "default"; }; XmNdirSearchProc : Argument { Type = any; Default = "default"; }; XmNfileListLabelString: Argument { Type = compound_string; Default = "Files"; }; Class XmFileSelectionDialog : Widget { SuperClass = XmFileSelectionBox; ParentClass = XmDialogShell; ConvenienceFunction = XmCreateFileSelectionDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; ! pseudo-classes for renditions Class XmRenderTable : Widget { SuperClass = Object; ConvenienceFunction = _XmCreateRenderTable; Controls { XmRendition; }; }; Class XmRendition : Widget { SuperClass = Object; ConvenienceFunction = _XmCreateRendition; Resources { XmNfontName; XmNfontType; XmNloadModel; XmNfont; XmNrenditionBackground; XmNrenditionForeground; XmNunderlineType; XmNstrikethruType; XmNfontEncoding; XmNfontFoundry; XmNfontSize; XmNfontStyle; }; Controls { XmTabList; }; }; Resource XmNfontName : Argument { Type = string; Default = "XmAS_IS"; }; XmNfontType : Argument { Type = integer; EnumerationSet = FontType; Default = "XmAS_IS"; }; XmNloadModel : Argument { Type = integer; EnumerationSet = LoadModel; Default = "XmAS_IS"; }; XmNfont : Argument { Type = font; Default = "XmAS_IS"; }; XmNrenditionBackground : Argument { Type = color; Default = "XmUNSPECIFIED_PIXEL"; }; XmNrenditionForeground : Argument { Type = color; Default = "XmUNSPECIFIED_PIXEL"; }; XmNunderlineType : Argument { Type = integer; EnumerationSet = LineType; Default = "XmAS_IS"; }; XmNstrikethruType : Argument { Type = integer; EnumerationSet = LineType; Default = "XmAS_IS"; }; XmNfontEncoding : Argument { Type = string; Default = "Null"; }; XmNfontFoundry : Argument { Type = string; Default = "Null"; }; XmNfontSize : Argument { Type = integer; Default = "0"; }; XmNfontStyle : Argument { Type = string; Default = "Null"; }; Class XmTabList : Widget { SuperClass = Object; ConvenienceFunction = _XmCreateTabList; Controls { XmTab; }; }; Class XmTab : Widget { SuperClass = Object; ConvenienceFunction = _XmCreateTab; Resources { XmNtabValue; XmNunitType; XmNoffsetModel; XmNalignment { Default = "XmALIGNMENT_BEGINNING"; }; XmNdecimal; }; }; Resource XmNtabValue : Argument { Type = float; Default = "0.0"; }; XmNoffsetModel : Argument { Type = integer; EnumerationSet = OffsetModel; Default = "XmABSOLUTE"; }; XmNdecimal : Argument { Type = string; Default = "."; }; ! the user-defined class Class user_defined : Widget { ConvenienceFunction = user_defined ; Controls { AllWidgetsAndGadgets; }; }; ! Fake resource for COMPOUND_STRING_COMPONENT Resource XmStringComponent : Argument { Type = integer; EnumerationSet = CompoundStringComponent; }; ! ! Dt Enumeration Sets ! EnumerationSet DtCharCursorStyle : integer { DtTERM_CHAR_CURSOR_BOX; DtTERM_CHAR_CURSOR_BAR; DtTERM_CHAR_CURSOR_INVISIBLE; }; DtExecutionPolicy : integer { DtHELP_EXECUTE_NONE; DtHELP_EXECUTE_QUERY_ALL; DtHELP_EXECUTE_QUERY_UNALIASED; DtHELP_EXECUTE_ALL; }; DtHelpType : integer { DtHELP_TYPE_TOPIC; DtHELP_TYPE_STRING; DtHELP_TYPE_MAN_PAGE; DtHELP_TYPE_FILE; DtHELP_TYPE_DYNAMIC_STRING; }; DtPaperSize : integer { DtHELP_PAPERSIZE_LETTER; DtHELP_PAPERSIZE_LEGAL; DtHELP_PAPERSIZE_EXECUTIVE; DtHELP_PAPERSIZE_A4; DtHELP_PAPERSIZE_B5; }; DtPrintDestination : integer { DtPRINT_NO_DESTINATION; DtPRINT_TO_PRINTER; DtPRINT_TO_FILE; }; DtPrinterNameMode : integer { DtSHORT_NAME; DtMEDIUM_NAME; DtLONG_NAME; }; DtPrinterResetConnectionMode : integer { DtPRINT_CLOSE_CONNECTION; DtPRINT_RELEASE_CONNECTION; }; DtScrollBarPolicy : integer { DtHELP_NO_SCROLLBARS; DtHELP_STATIC_SCROLLBARS; DtHELP_AS_NEEDED_SCROLLBARS; }; DtShadowType : integer { DtSHADOW_IN; DtSHADOW_OUT; DtSHADOW_ETCHED_IN; DtSHADOW_ETCHED_OUT; }; DtSetupMode : integer { DtPRINT_SETUP_PLAIN; DtPRINT_SETUP_XP; }; DtWorkAreaLocation : integer { DtWORK_AREA_NONE; DtWORK_AREA_TOP; DtWORK_AREA_TOP_AND_BOTTOM; DtWORK_AREA_BOTTOM; }; ! ! Dt Widgets ! Class DtEditor : Widget { SuperClass = XmForm; ConvenienceFunction = DtCreateEditor; Resources { ! new resources DtNautoShowCursorPosition; DtNbuttonFontList; DtNblinkRate { Default = "500"; }; DtNcenterToggleLabel; DtNchangeAllButtonLabel; DtNchangeButtonLabel; DtNchangeFieldLabel; DtNcolumns; DtNcurrentLineLabel; DtNcursorPosition; DtNcursorPositionVisible; DtNdialogTitle; DtNeditable; DtNfindButtonLabel; DtNfindChangeDialogTitle; DtNfindFieldLabel; DtNformatAllButtonLabel; DtNformatParagraphButtonLabel; DtNformatSettingsDialogTitle; DtNinformationDialogTitle; DtNinsertLabel; DtNjustifyToggleLabel; DtNlabelFontList; DtNleftAlignToggleLabel; DtNleftMarginFieldLabel; DtNmaxLength; DtNmisspelledListLabel; DtNoverstrike; DtNoverstrikeLabel; DtNrightAlignToggleLabel; DtNrightMarginFieldLabel; DtNrows; DtNscrollHorizontal; DtNscrollLeftSide; DtNscrollTopSide; DtNscrollVertical; DtNshowStatusLine; DtNspellDialogTitle; DtNspellFilter; DtNtextBackground; DtNtextDeselectCallback; DtNtextForeground; DtNtextFontList; DtNtextSelectCallback; DtNtextTranslations; DtNtopCharacter; DtNtotalLineCountLabel; DtNwordWrap; ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class DtHelpDialog : Widget { SuperClass = XmBulletinBoard; ParentClass = XmDialogShell; ConvenienceFunction = DtCreateHelpDialog; DialogClass = True; Resources { ! new resources DtNcloseCallback; DtNcolumns { Default = "70"; }; DtNexecutionPolicy; DtNhelpFile; DtNhelpOnHelpVolume; DtNhelpPrint; DtNhelpType; DtNhelpVolume; DtNhyperLinkCallback; DtNlocationId; DtNmanPage; DtNmarginWidth; DtNmarginHeight; DtNpaperSize; DtNprinter; DtNrows { Default = "25"; }; DtNscrollBarPolicy; DtNshowNewWindowButton; DtNstringData; DtNtopicTitle; DtNvisiblePathCount; ! private resources ! DtNshowTopLevelButton; ! DtNsrchHitPrefixFont; ! inherited resources XmNnavigationType { Default = "dynamic"; }; }; Controls { AllWidgetsAndGadgets; }; }; Class DtHelpQuickDialog : Widget { SuperClass = XmBulletinBoard; ParentClass = XmDialogShell; ConvenienceFunction = DtCreateHelpQuickDialog; DialogClass = True; Resources { ! new resources DtNbackLabelString; DtNcloseCallback; DtNcloseLabelString; DtNcolumns { Default = "50"; }; DtNexecutionPolicy; DtNhelpFile; DtNhelpLabelString; DtNhelpOnHelpVolume; DtNhelpPrint; DtNhelpVolume; DtNhelpType; DtNhyperLinkCallback; DtNlocationId; DtNmanPage; DtNminimizeButtons; DtNmoreLabelString; DtNpaperSize; DtNprinter; DtNprintLabelString; DtNrows { Default = "15"; }; DtNscrollBarPolicy; DtNstringData; DtNtopicTitle; ! inherited resources XmNnavigationType { Default = "dynamic"; }; }; Controls { AllWidgetsAndGadgets; }; }; Class DtMenuButton : Widget { SuperClass = XmLabel; ConvenienceFunction = DtCreateMenuButton; Resources { ! new resources DtNcascadingCallback; DtNcascadePixmap; DtNsubMenuId; ! inherited resources XmNhighlightThickness { Default = "2"; }; XmNmarginWidth { Default = "6"; }; XmNtraversalOn { Default = "True"; }; }; Controls { XmPopupMenu; XmRenderTable; }; }; Class DtPrintSetupBox : Widget { SuperClass = XmBulletinBoard; ConvenienceFunction = DtCreatePrintSetupBox; Resources { ! new resources DtNcancelCallback; DtNclosePrintDisplayCallback; DtNcopies; DtNdescription; DtNfileName; DtNminimizeButtons; DtNprintCallback; DtNprintDestination; DtNprinterInfoProc; DtNprinterName; DtNprintSetupMode; DtNselectFileProc; DtNselectPrinterProc; DtNsetupCallback; DtNverifyPrinterProc; DtNworkAreaLocation; ! inherited resources XmNnoResize { Default = "True"; }; }; Controls { AllWidgetsAndGadgets; }; }; Class DtPrintSetupDialog : Widget { SuperClass = DtPrintSetupBox; ParentClass = XmDialogShell; ConvenienceFunction = DtCreatePrintSetupDialog; DialogClass = True; Resources { ! new resources ! inherited resources }; Controls { AllWidgetsAndGadgets; }; }; Class DtTermPrimitive : Widget { SuperClass = XmPrimitive; ConvenienceFunction = DtCreateTermPrimitive; Resources { ! new resources DtNallowSendEvents; DtNbackgroundIsSelect; DtNblinkRate; DtNbaseWidth; DtNbaseHeight; DtNcharCursorStyle; DtNcolumns { Default = "80"; }; DtNconsoleMode; DtNcsWidth; DtNemulationId; DtNheightInc; DtNinputVerifyCallback; DtNjumpScroll; DtNkshMode; DtNlogging; DtNlogFile; DtNlogInhibit; DtNmapOnOutput; DtNmapOnOutputDelay; DtNmarginBell; DtNmarginHeight { Default = "2"; }; DtNmarginWidth { Default = "2"; }; DtNnMarginBell; DtNoutputLogCallback; DtNpointerBlank; DtNpointerBlankDelay; DtNpointerShape; DtNpointerColor; DtNpointerColorBackground; DtNreverseVideo; DtNrows { Default = "24"; }; DtNsaveLines; DtNshadowType; DtNstatusChangeCallback; DtNsubprocessArgv; DtNsubprocessCmd; DtNsubprocessExec; DtNsubprocessLoginShell; DtNsubprocessPid; DtNsubprocessTerminationCallback; DtNsubprocessTerminationCatch; DtNtermDevice; DtNtermDeviceAllocate; DtNtermId; DtNtermName; DtNtermSlaveName; DtNttyModes; DtNuserBoldFont; DtNuserFont; DtNverticalScrollBar; DtNvisualBell; DtNwidthInc; ! inherited resources XmNhighlightThickness { Default = "2"; }; XmNtraversalOn { Default = "True"; }; }; }; Class DtTerm : Widget { SuperClass = DtTermPrimitive; ConvenienceFunction = DtCreateTerm; Resources { ! new resources DtNappCursorDefault; DtNappKeypadDefault; DtNautoWrap; DtNc132; DtNemulationId { Default = "DtTermWidget"; }; DtNreverseWrap; DtNsunFunctionKeys; DtNtermId { Default = "vt220"; }; DtNtermName { Default = "dtterm"; }; ! commented out ! DtNstickyPrevCursor; ! DtNstickyNextCursor; ! DtNstatusChangeCallback; ! DtNverticalScrollBar; ! inherited resources }; }; Resource DtNallowSendEvents : Argument { Type = boolean; Default = "False"; }; DtNappCursorDefault : Argument { Type = boolean; Default = "False"; }; DtNappKeypadDefault : Argument { Type = boolean; Default = "False"; }; DtNautoShowCursorPosition : Argument { Type = boolean; Default = "True"; }; DtNautoWrap : Argument { Type = boolean; Default = "True"; }; DtNbackLabelString : Argument { Type = compound_string; Default = "Null"; }; DtNbackgroundIsSelect : Argument { Type = boolean; Default = "False"; }; DtNbaseHeight : Argument { Type = integer; Default = "0"; }; DtNbaseWidth : Argument { Type = integer; Default = "0"; }; DtNblinkRate : Argument { Type = integer; Default = "250"; }; DtNbuttonFontList : Argument { Type = font_table; Default = "dynamic"; }; DtNc132 : Argument { Type = boolean; Default = "False"; }; DtNcancelCallback : Reason { }; DtNcascadePixmap : Argument { Type = pixmap; Default = "XmUNSPECIFIED_PIXMAP"; }; DtNcascadingCallback : Reason { }; DtNcenterToggleLabel : Argument { Type = compound_string; Default = "Null"; }; DtNchangeAllButtonLabel : Argument { Type = compound_string; Default = "Null"; }; DtNchangeButtonLabel : Argument { Type = compound_string; Default = "Null"; }; DtNchangeFieldLabel : Argument { Type = compound_string; Default = "Null"; }; DtNcharCursorStyle : Argument { Type = integer; EnumerationSet = DtCharCursorStyle; Default = "DtTERM_CHAR_CURSOR_BOX"; }; DtNcloseCallback : Reason { }; DtNcloseLabelString : Argument { Type = compound_string; Default = "Null"; }; DtNclosePrintDisplayCallback : Reason { }; DtNcolumns : Argument { Type = integer; Default = "DtUNSPECIFIED"; }; DtNconsoleMode : Argument { Type = boolean; Default = "False"; }; DtNcopies : Argument { Type = integer; Default = "1"; }; DtNcsWidth : Argument { Type = string; Default = "Null"; }; DtNcurrentLineLabel : Argument { Type = compound_string; Default = "Null"; }; DtNcursorPosition : Argument { Type = integer; Default = "0"; }; DtNcursorPositionVisible : Argument { Type = boolean; Default = "True"; }; DtNdescription : Argument { Type = compound_string; Default = "Null"; }; DtNdialogTitle : Argument { Type = compound_string; Default = "Null"; }; DtNeditable : Argument { Type = boolean; Default = "True"; }; DtNemulationId : Argument { Type = string; Default = "Null"; }; DtNexecutionPolicy : Argument { Type = integer; EnumerationSet = DtExecutionPolicy; Default = "DtHELP_EXECUTE_QUERY_UNALIASED"; }; DtNfileName : Argument { Type = string; Default = "Null"; }; DtNfindButtonLabel : Argument { Type = compound_string; Default = "Null"; }; DtNfindChangeDialogTitle : Argument { Type = compound_string; Default = "Null"; }; DtNfindFieldLabel : Argument { Type = compound_string; Default = "Null"; }; DtNformatAllButtonLabel : Argument { Type = compound_string; Default = "Null"; }; DtNformatParagraphButtonLabel : Argument { Type = compound_string; Default = "Null"; }; DtNformatSettingsDialogTitle : Argument { Type = compound_string; Default = "Null"; }; DtNheightInc : Argument { Type = integer; Default = "0"; }; DtNhelpFile : Argument { Type = string; Default = "Null"; }; DtNhelpLabelString : Argument { Type = compound_string; Default = "Null"; }; DtNhelpOnHelpVolume : Argument { Type = string; Default = "Null"; }; DtNhelpPrint : Argument { Type = string; Default = "Null"; }; DtNhelpType : Argument { Type = integer; EnumerationSet = DtHelpType; Default = "DtHELP_TYPE_TOPIC"; }; DtNhelpVolume : Argument { Type = string; Default = "Null"; }; DtNhyperLinkCallback : Reason { }; DtNinformationDialogTitle : Argument { Type = compound_string; Default = "Null"; }; DtNinputVerifyCallback : Reason { }; DtNinsertLabel : Argument { Type = compound_string; Default = "Null"; }; DtNjumpScroll : Argument { Type = boolean; Default = "True"; }; DtNjustifyToggleLabel : Argument { Type = compound_string; Default = "Null"; }; DtNkshMode : Argument { Type = boolean; Default = "False"; }; DtNlabelFontList : Argument { Type = font_table; Default = "dynamic"; }; DtNleftAlignToggleLabel : Argument { Type = compound_string; Default = "Null"; }; DtNleftMarginFieldLabel : Argument { Type = compound_string; Default = "Null"; }; DtNlocationId : Argument { Type = string; Default = "Null"; }; DtNlogFile : Argument { Type = string; Default = "Null"; }; DtNlogInhibit : Argument { Type = boolean; Default = "False"; }; DtNlogging : Argument { Type = boolean; Default = "False"; }; DtNmanPage : Argument { Type = string; Default = "Null"; }; DtNmapOnOutput : Argument { Type = boolean; Default = "False"; }; DtNmapOnOutputDelay : Argument { Type = integer; Default = "0"; }; DtNmarginBell : Argument { Type = boolean; Default = "False"; }; DtNmarginHeight : Argument { Type = vertical_float; Default = "4"; }; DtNmarginWidth : Argument { Type = horizontal_float; Default = "1"; }; DtNmaxLength : Argument { Type = integer; Default = "DtUNSPECIFIED"; }; DtNminimizeButtons : Argument { Type = boolean; Default = "False"; }; DtNmisspelledListLabel : Argument { Type = compound_string; Default = "Null"; }; DtNmoreLabelString : Argument { Type = compound_string; Default = "Null"; }; DtNnMarginBell : Argument { Type = integer; Default = "8"; }; DtNoutputLogCallback : Reason { }; DtNoverstrike : Argument { Type = boolean; Default = "False"; }; DtNoverstrikeLabel : Argument { Type = compound_string; Default = "Null"; }; DtNpaperSize : Argument { Type = integer; EnumerationSet = DtPaperSize; Default = "DtHELP_PAPERSIZE_LETTER"; }; DtNpointerBlank : Argument { Type = boolean; Default = "False"; }; DtNpointerBlankDelay : Argument { Type = integer; Default = "2"; }; DtNpointerColor : Argument { Type = color; Default = "XtDefaultForeground"; }; DtNpointerColorBackground : Argument { Type = color; Default = "XtDefaultBackground"; }; DtNpointerShape : Argument { Type = any; Default = "xterm"; }; DtNprintCallback : Reason { }; DtNprintDestination : Argument { Type = integer; EnumerationSet = DtPrintDestination; Default = "DtPRINT_TO_PRINTER"; }; DtNprintLabelString : Argument { Type = compound_string; Default = "Null"; }; DtNprintSetupMode : Argument { Type = integer; EnumerationSet = DtSetupMode; Default = "DtPRINT_SETUP_XP"; }; DtNprinter : Argument { Type = string; Default = "Null"; }; DtNprinterInfoProc : Argument { Type = any; Default = "DtUNSPECIFIED"; }; DtNprinterName : Argument { Type = string; Default = "Null"; }; DtNreverseVideo : Argument { Type = boolean; Default = "False"; }; DtNreverseWrap : Argument { Type = boolean; Default = "False"; }; DtNrightAlignToggleLabel : Argument { Type = compound_string; Default = "Null"; }; DtNrightMarginFieldLabel : Argument { Type = compound_string; Default = "Null"; }; DtNrows : Argument { Type = integer; Default = "DtUNSPECIFIED"; }; DtNsaveLines : Argument { Type = string; Default = "null"; }; DtNscrollBarPolicy : Argument { Type = integer; EnumerationSet = DtScrollBarPolicy; Default = "DtHELP_AS_NEEDED_SCROLLBARS"; }; DtNscrollHorizontal : Argument { Type = boolean; Default = "True"; }; DtNscrollLeftSide : Argument { Type = boolean; Default = "UNSPECIFIED"; }; DtNscrollTopSide : Argument { Type = boolean; Default = "UNSPECIFIED"; }; DtNscrollVertical : Argument { Type = boolean; Default = "True"; }; DtNselectFileProc : Argument { Type = any; Default = "default"; }; DtNselectPrinterProc : Argument { Type = any; Default = "DtUNSPECIFIED"; }; DtNsetupCallback : Reason { }; DtNshadowType : Argument { Type = integer; EnumerationSet = DtShadowType; Default = "DtSHADOW_IN"; }; DtNshowNewWindowButton : Argument { Type = boolean; Default = "False"; }; DtNshowStatusLine : Argument { Type = boolean; Default = "False"; }; ! DtNshowTopLevelButton : Argument ! { Type = boolean; ! Default = "False"; }; DtNspellDialogTitle : Argument { Type = compound_string; Default = "Null"; }; DtNspellFilter : Argument { Type = string; Default = "Null"; }; ! DtNsrchHitPrefixFont : Argument ! { Type = string; ! Default = "dynamic"; }; DtNstatusChangeCallback : Reason { }; DtNstickyNextCursor : Argument { Type = boolean; Default = "False"; }; DtNstickyPrevCursor : Argument { Type = boolean; Default = "False"; }; DtNstringData : Argument { Type = string; Default = "Null"; }; DtNsubMenuId : Argument { Type = widget_ref; Default = "Null"; }; DtNsubprocessArgv : Argument { Type = any; Default = "NULL"; }; DtNsubprocessCmd : Argument { Type = string; Default = "Null"; }; DtNsubprocessExec : Argument { Type = boolean; Default = "True"; }; DtNsubprocessLoginShell : Argument { Type = boolean; Default = "False"; }; DtNsubprocessPid : Argument { Type = integer; Default = "-1"; }; DtNsubprocessTerminationCallback : Reason { }; DtNsubprocessTerminationCatch : Argument { Type = boolean; Default = "True"; }; DtNsunFunctionKeys : Argument { Type = boolean; Default = "False"; }; DtNtermDevice : Argument { Type = integer; Default = "-1"; }; DtNtermDeviceAllocate : Argument { Type = boolean; Default = "True"; }; DtNtermId : Argument { Type = string; Default = "Null"; }; DtNtermName : Argument { Type = string; Default = "Null"; }; DtNtermSlaveName : Argument { Type = string; Default = "Null"; }; DtNtextBackground : Argument { Type = color; Default = "DtUNSPECIFIED"; }; DtNtextDeselectCallback : Reason { }; DtNtextFontList : Argument { Type = font_table; Default = "dynamic"; }; DtNtextForeground : Argument { Type = color; Default = "DtUNSPECIFIED"; }; DtNtextSelectCallback : Reason { }; DtNtextTranslations : Argument { Type = translation_table; Default = "Null"; }; DtNtopCharacter : Argument { Type = integer; Default = "0"; }; DtNtopicTitle : Argument { Type = string; Default = "Null"; }; DtNtotalLineCountLabel : Argument { Type = compound_string; Default = "Null"; }; DtNttyModes : Argument { Type = string; Default = "Null"; }; DtNuserBoldFont : Argument { Type = font_table; Default = "dynamic"; }; DtNuserFont : Argument { Type = font_table; Default = "dynamic"; }; DtNverifyPrinterProc : Argument { Type = any; Default = "DtUNSPECIFIED"; }; DtNverticalScrollBar : Argument { Type = widget_ref; Default = "Null"; }; DtNvisiblePathCount : Argument { Type = integer; Default = "7"; }; DtNvisualBell : Argument { Type = boolean; Default = "False"; }; DtNwidthInc : Argument { Type = integer; Default = "0"; }; DtNwordWrap : Argument { Type = boolean; Default = "False"; }; DtNworkAreaLocation : Argument { Type = integer; EnumerationSet = DtWorkAreaLocation; Default = "DtWORK_AREA_BOTTOM"; }; ! ! Motif 2.2 widgets and resources ! ! --- XmColumn Resources Resource XmNdefaultEntryLabelFontList : Argument { Type = font_table; }; XmNdefaultEntryLabelRenderTable : Argument { Type = widget_ref; }; XmNdefaultEntryLabelAlignment : Argument { Type = integer; EnumerationSet = XmAlignment; }; XmNdefaultFillStyle : Argument { Type = integer; EnumerationSet = XmFillStyle; Default = "XmFILL_RAGGED"; }; XmNitemSpacing : Argument { Type = integer; Default = "2"; }; XmNlabelSpacing : Argument { Type = integer; Default = "10"; }; XmNdistribution : Argument { Type = integer; EnumerationSet = XmDistribution; Default = "XmDISTRIBUTE_TIGHT"; }; ! --- XmColumn Constraints XmNentryLabelFontList : Constraint { Type = font_table; Default = "Null"; }; XmNentryLabelRenderTable : Constraint { Type = widget_ref; Default = "Null"; }; XmNentryLabelAlignment : Constraint { Type = integer; EnumerationSet = XmAlignment; Default = "XmALIGNMENT_UNSPECIFIED"; }; XmNfillStyle : Constraint { Type = integer; EnumerationSet = XmFillStyle; Default = "XmFILL_UNSPECIFIED"; }; XmNentryLabelType : Constraint { Type = integer; ! EnumerationSet = LabelType; Default = "XmSTRING"; }; XmNentryLabelString : Constraint { Type = compound_string; }; XmNentryLabelPixmap : Constraint { Type = pixmap; Default = "Null"; }; XmNshowEntryLabel : Constraint { Type = boolean; Default = "True"; }; XmNstretchable : Constraint { Type = boolean; Default = "True"; }; ! ! --- XmColumn Widget ! Class XmColumn : Widget { SuperClass = "XmBulletinBoard"; ConvenienceFunction = XmCreateColumn; Resources { XmNdefaultEntryLabelFontList; XmNdefaultEntryLabelRenderTable; XmNdefaultEntryLabelAlignment; ! XmNdefaultEntryLabelPosition; XmNdefaultFillStyle; XmNitemSpacing; XmNlabelSpacing; XmNorientation; XmNdistribution; ! -- Constraint Resources XmNentryLabelFontList; XmNentryLabelRenderTable; XmNentryLabelAlignment; ! XmNentryLabelPosition; XmNfillStyle; XmNentryLabelType; XmNentryLabelString; XmNentryLabelPixmap; XmNshowEntryLabel; XmNstretchable; }; Controls { AllWidgets; }; }; !- XmButton Box Resources Resource XmNequalSize : Argument { Type = boolean; }; XmNfillOption : Argument { Type = integer; EnumerationSet = FillOptionType; Default = "XmFillNone"; }; Class XmButtonBox : Widget { SuperClass = "XmManager"; ConvenienceFunction = XmCreateButtonBox; Resources { XmNdefaultButton; XmNequalSize; XmNfillOption; XmNmarginHeight; XmNmarginWidth; XmNorientation; }; Controls { AllWidgets; }; }; ! ! Resources for XmPaned ! Resource XmNcursor : Argument { Type = identifier; }; XmNsashTranslations : Argument { Type = translation_table; }; XmNallowUnusedSpace : Argument { Type = boolean; }; XmNpreferredPaneSize : Constraint { Type = integer; }; XmNresizeToPreferred : Constraint { Type = boolean; }; XmNshowSash : Constraint { Type = boolean; }; Class XmPaned : Widget { SuperClass = "XmManager"; ConvenienceFunction = XmCreatePaned; Resources { XmNallowUnusedSpace; XmNspacing; XmNmarginWidth; XmNmarginHeight; XmNrefigureMode; XmNorientation; XmNseparatorOn; XmNcursor; XmNsashIndent; XmNsashTranslations; XmNsashWidth; XmNsashHeight; XmNsashShadowThickness; XmNallowResize; XmNpaneMinimum; XmNpaneMaximum; XmNpreferredPaneSize; XmNresizeToPreferred; XmNskipAdjust; XmNshowSash; }; Controls { AllWidgets; }; }; Resource XmNshowLabel : Argument { Type = boolean; }; XmNverticalMargin : Argument { Type = integer; }; XmNhorizontalMargin : Argument { Type = integer; }; XmNverify : Argument { Type = boolean; }; XmNcustomizedCombinationBox : Argument { Type = boolean; }; XmNuseTextField : Argument { Type = boolean; }; XmNverifyTextCallback : Reason { }; XmNupdateTextCallback : Reason { }; XmNupdateShellCallback : Reason { }; XmNpopupShellWidget : Argument { Type = widget_ref; }; XmNpopupOffset : Argument { Type = integer; }; XmNpopupCursor : Argument { Type = identifier; }; XmNcomboTranslations : Argument { Type = translation_table; }; XmNnewVisualStyle : Argument { Type = boolean; Default = "True"; }; Class XmDropDown: Widget { SuperClass = "XmManager"; Alias = XmCombinationBox2; ConvenienceFunction = XmCreateDropDown; Resources { XmNhorizontalMargin; XmNverticalMargin; XmNverify; XmNeditable; XmNshadowThickness; XmNcustomizedCombinationBox; XmNverifyTextCallback; XmNupdateTextCallback; XmNupdateShellCallback; XmNpopupShellWidget; XmNshowLabel; XmNpopupOffset; XmNpopupCursor; XmNcomboTranslations; XmNnavigationType; XmNuseTextField; ! Label resources XmNlabelPixmap; XmNlabelString; XmNlabelType; XmNmarginBottom; XmNmarginLeft; XmNmarginRight; XmNmarginTop; XmNrecomputeSize; XmNlabelString; XmNselectionPolicy; XmNnewVisualStyle; XmNitems; XmNitemCount; XmNvisibleItemCount; XmNfontList; XmNmarginHeight; XmNmarginWidth; XmNvalue { Type = string; }; }; Controls { XmPopupMenu; XmLabel; XmTextField; XmArrowButton; XmList; }; Children { Xm_Label; Xm_Text; Xm_Arrow; Xm_List; }; }; Child Xm_Label : XmLabel; Xm_Arrow : XmArrowButton; ! ! Resources for XmIconBox ! Resource XmNminimumHorizontalCells : Argument { Type = integer; }; XmNminimumVerticalCells : Argument { Type = integer; }; XmNminimumCellHeight : Argument { Type = integer; }; XmNminimumCellWidth : Argument { Type = integer; }; XmNcellX : Constraint { Type = integer; }; XmNcellY : Constraint { Type = integer; }; Class XmIconBox : Widget { SuperClass = "XmManager"; ConvenienceFunction = XmCreateIconBox; Resources { XmNhorizontalMargin; XmNverticalMargin; XmNminimumHorizontalCells; XmNminimumVerticalCells; XmNminimumCellWidth; XmNminimumCellHeight; XmNcellX; XmNcellY; }; Controls { AllWidgets; }; }; ! ! Resources for XmIconButton ! Resource XmNlabel : Argument { Type = string; }; XmNpixmap : Argument { Type = pixmap; }; XmNiconPlacement : Argument { Type = integer; EnumerationSet = IconPlacementType; Default = "XmIconTop"; }; XmNiconTextPadding : Argument { Type = integer; }; XmNdoubleClickCallback : Reason { }; XmNpixmapHeight : Argument { Type = vertical_float; Default = "0"; }; XmNpixmapWidth : Argument { Type = horizontal_float; Default = "0"; }; XmNpixmapDepth : Argument { Type = integer; Default = "0"; }; Class XmIconButton : Widget { SuperClass = "XmPrimitive"; ConvenienceFunction = XmCreateIconButton; Resources { XmNalignment; XmNlabel; XmNlabelString; XmNpixmap; XmNfontList; XmNrenderTable; XmNiconPlacement; XmNpixmapWidth; XmNpixmapHeight; XmNpixmapDepth; XmNrecomputeSize; XmNarmColor; XmNset; XmNverticalMargin; XmNhorizontalMargin; XmNiconTextPadding; XmNactivateCallback; XmNdoubleClickCallback; XmNstringDirection; }; Controls { XmPopupMenu; XmDialogShell; }; }; ! ! resources for the XmColorSelector Resource XmNblueSliderLabel : Argument { Type = compound_string; }; XmNcolorName : Argument { Type = string; }; XmNcolorListTogLabel : Argument { Type = compound_string; }; XmNcolorMode : Argument { Type = integer; EnumerationSet = ColorModeType; }; XmNfileReadError : Argument { Type = compound_string; }; XmNgreenSliderLabel : Argument { Type = compound_string; }; XmNnoCellError : Argument { Type = compound_string; }; XmNredSliderLabel : Argument { Type = compound_string; }; XmNrgbFile : Argument { Type = string; }; XmNsliderTogLabel : Argument { Type = compound_string; }; Class XmColorSelector : Widget { SuperClass = "XmManager"; ConvenienceFunction = XmCreateColorSelector; Resources { XmNblueSliderLabel { Default = "Blue"; }; XmNcolorListTogLabel { Default = "Color List"; }; XmNcolorMode; XmNcolorName { Default = "white"; }; XmNfileReadError; XmNfontList; XmNgreenSliderLabel { Default = "Green"; }; XmNmarginWidth; XmNmarginHeight; XmNnavigationType; XmNnoCellError { Default = "\n\nNo Color Cell Available"; }; XmNredSliderLabel { Default = "Red"; }; XmNrgbFile; XmNsliderTogLabel { Default = "Color Sliders"; }; }; Controls { XmList; XmToggleButton; XmPopupMenu; }; Children { Xm_List; Xm_ColorListToggle; Xm_ColorSlidersToggle; }; }; Child Xm_ColorListToggle : XmToggleButton; Xm_ColorSlidersToggle : XmToggleButton; ! ! Resources for the XmFontSelector ! Resource XmN100DPIstring : Argument { Type = compound_string; }; XmN75DPIstring : Argument { Type = compound_string; }; XmNanyLowerString : Argument { Type = compound_string; }; XmNanyString : Argument { Type = compound_string; }; XmNboldString : Argument { Type = compound_string; }; XmNbothString : Argument { Type = compound_string; }; XmNcurrentFont : Argument { Type = string; }; XmNdefaultEncodingString : Argument { Type = string; }; XmNencodingString : Argument { Type = compound_string; }; XmNencodingList : Argument { Type = asciz_table; }; XmNfamilyString : Argument { Type = compound_string; }; XmNitalicString : Argument { Type = compound_string; }; XmNmonoSpaceString : Argument { Type = compound_string; }; XmNoptionString : Argument { Type = compound_string; }; XmNotherString : Argument { Type = compound_string; }; XmNpropSpaceString : Argument { Type = compound_string; }; XmNsampleText : Argument { Type = compound_string; }; XmNscalingString : Argument { Type = compound_string; }; XmNshowFontName : Argument { Type = boolean; }; XmNshowNameString : Argument { Type = compound_string; }; XmNsizeString : Argument { Type = compound_string; }; XmNtextRows : Argument { Type = integer; }; XmNuseScaling : Argument { Type = boolean; }; XmNxlfdString : Argument { Type = compound_string; }; Class XmFontSelector : Widget { SuperClass = "XmPaned"; ConvenienceFunction = XmCreateFontSelector; Resources { XmN100DPIstring { Default = "100 dpi"; }; XmN75DPIstring { Default = "75 dpi"; }; XmNanyString { Default = "Any"; }; XmNanyLowerString { Default = "any"; }; XmNboldString { Default = "Bold"; }; XmNbothString { Default = "Both"; }; XmNcurrentFont; XmNdefaultEncodingString { Default = "iso8859-1"; }; XmNencodingString { Default = "Encoding"; }; XmNencodingList; XmNfamilyString { Default = "Family"; }; XmNitalicString { Default = "Italic"; }; XmNmarginHeight { Default = "0"; }; XmNmonoSpaceString { Default = "Fixed Width Fonts"; }; XmNoptionString { Default = "Options..."; }; XmNotherString { Default = "Other Fonts"; }; XmNpropSpaceString { Default = "Proportional Fonts"; }; XmNsampleText { Default = "adcdef..."; }; XmNscalingString { Default = "Use Font Scaling"; }; XmNshowFontName; XmNshowNameString; XmNsizeString { Default = "Size"; }; XmNspacing ; XmNtextRows; XmNuseScaling; XmNfontList; XmNforeground; ! to prevent shooting foot off XmNnavigationType; XmNorientation; XmNseparatorOn; XmNsashIndent; XmNsashTranslations; XmNsashWidth; XmNsashHeight; XmNsashShadowThickness; XmNvalueChangedCallback; XmNxlfdString { Default = "Xlfd String"; }; }; Controls { XmPopupMenu; }; }; ! ! Resources for the XmTree Widget ! Resource XmNconnectStyle : Argument { Type = integer; EnumerationSet = ConnectStyle; Default = XiTreeDirect; }; XmNopenFolderPixmap : Argument { Type = pixmap; }; XmNcloseFolderPixmap : Argument { Type = pixmap; }; XmNnodeOpenFolderPixmap: Constraint { Type = pixmap; }; XmNnodeCloseFolderPixmap: Constraint { Type = pixmap; }; XmNnodeStateChangedCallback : Reason { }; XmNnodeStateBegEndCallback : Reason { }; XmNverticalDelta : Argument { Type = integer; }; XmNhorizontalDelta : Argument { Type = integer; }; XmNcompressStyle : Argument { Type = integer; EnumerationSet = XmTreeCompressStyle; }; XmNlineBackgroundColor : Constraint { Type = color; }; XmNlineStyle : Constraint { Type = integer; EnumerationSet = XmTreeLineStyle; }; Class XmTree : Widget { SuperClass = "XmManager"; ConvenienceFunction = XmCreateTree; Resources { XmNautoClose; XmNrefigureMode; XmNverticalMargin; XmNhorizontalMargin; XmNnodeStateChangedCallback; XmNnodeStateBegEndCallback; XmNnodeState; XmNparentNode; XmNnodeOpenFolderPixmap; XmNnodeCloseFolderPixmap; XmNinsertBefore; XmNconnectStyle; XmNlineStyle; XmNlineBackgroundColor; XmNopenClosePadding; XmNlineColor; XmNlineWidth; XmNbottomShadowColor; XmNbottomShadowPixmap; XmNforeground; XmNhighlightColor; XmNhighlightPixmap; XmNhorizontalNodeSpace; XmNshadowThickness; XmNtopShadowColor; XmNtopShadowPixmap; XmNverticalNodeSpace; XmNopenFolderPixmap; XmNcloseFolderPixmap; XmNorientation; XmNcompressStyle; XmNverticalDelta; XmNhorizontalDelta; }; Controls { AllWidgets; }; }; ! ! Resources for the XmOutline Widget Resource XmNhorizontalNodeSpace : Argument { Type = integer; }; XmNverticalNodeSpace : Argument { Type = integer; }; XmNopenClosePadding : Constraint { Type = integer; }; XmNlineWidth : Constraint { Type = integer; }; XmNlineColor : Constraint { Type = color; }; XmNautoClose : Argument { Type = boolean; }; XmNconstrainWidth: Argument { Type = boolean; }; XmNconnectNodes: Argument { Type = boolean; }; XmNnodeState : Constraint { Type = integer; EnumerationSet = HierarchyNodeStateType; }; XmNparentNode : Constraint { Type = widget_ref; }; XmNinsertBefore : Constraint { Type = widget_ref; }; XmNindentSpace : Argument { Type = integer; }; XmNnodeStateCallback : Reason { }; Class XmOutline : Widget { SuperClass = "XmManager"; ConvenienceFunction = XmCreateOutline; Resources { XmNconstrainWidth; XmNautoClose; XmNconnectNodes; XmNrefigureMode; XmNverticalMargin; XmNhorizontalMargin; XmNnodeOpenFolderPixmap; XmNnodeCloseFolderPixmap; XmNnodeStateCallback; XmNhorizontalMargin; XmNverticalMargin; XmNnodeState; XmNnodeStateChangedCallback; XmNnodeStateBegEndCallback; XmNparentNode; XmNinsertBefore; XmNbottomShadowColor; XmNbottomShadowPixmap; XmNforeground; XmNhighlightColor; XmNhighlightPixmap; XmNshadowThickness; XmNtopShadowColor; XmNtopShadowPixmap; XmNindentSpace; XmNopenFolderPixmap; XmNcloseFolderPixmap; }; Controls { AllWidgets; }; }; ! resources for the MultiList Widget Resource XmNnumRows : Argument { Type = integer; }; XmNselectedColumn : Argument { Type = integer; }; XmNcolumnTitles : Argument { Type = string_table; Related = XmNnumColumns; }; XmNentryBackground : Argument { Type = color; }; XmNentryData : Argument { Type = identifier; }; XmNfirstColumnPixmaps : Argument { Type = boolean; }; XmNfirstRow : Argument { Type = integer; }; XmNfirstColumn : Argument { Type = integer; }; XmNsortFunctions : Argument { Type = identifier; }; XmNshowFind : Argument { Type = boolean; }; XmNfindLabel : Argument { Type = compound_string; }; XmNitemFoundCallback : Reason { }; XmNitemNotFoundCallback : Reason { }; XmNselectCallback : Reason { }; ! XmNvisibleItemCount : Argument { ! Type = integer; ! }; ! XmNverticalScrollBar : Argument { ! Type = widget; ! }; ! XmNhorizontalScrollBar : Argument { ! Type = widget; ! }; ! Class XmMultiList : Widget { SuperClass = "XmManager"; Alias = XmExt18List; ConvenienceFunction = XmCreateMultiList; Resources { XmNalignment; XmNtitleString; XmNnumColumns; XmNnumRows; XmNselectedColumn; XmNcolumnTitles; XmNentryData; XmNentryBackground; XmNfirstColumnPixmaps; XmNfontList; XmNrenderTable; XmNfirstRow; XmNfirstColumn; XmNsortFunctions; XmNselectionPolicy; XmNselectCallback; XmNdoubleClickCallback; XmNfindLabel; XmNshowFind; XmNitemFoundCallback; XmNitemNotFoundCallback; XmNvisibleItemCount; XmNverticalScrollBar; XmNhorizontalScrollBar; XmNnewVisualStyle; }; Controls { XmLabel; XmPushButton; XmText; XmPopupMenu; }; Children { Xm_Title; Xm_Find; Xm_FindText; }; }; Child Xm_Title : XmLabel; Xm_Find : XmPushButton; Xm_FindText : XmText; ! ! Resources for the XmTabBox Widget Resource XmNtabMode : Argument { Type = integer; EnumerationSet = XmTabMode; }; XmNtabAutoSelect : Argument { Type = boolean; }; XmNtabSelectPixmap : Argument { Type = pixmap; }; XmNtabCornerPercent : Argument { Type = integer; }; XmNuniformTabSize : Argument { Type = boolean; }; XmNstackedEffect : Argument { Type = boolean; }; XmNtabLabelSpacing : Argument { Type = integer; }; XmNunselectCallback : Reason { }; XmNtabMarginHeight : Argument { Type = integer; }; XmNtabEdge : Argument { Type = integer; EnumerationSet = XmTabEdge; }; XmNtabSelectColor : Argument { Type = color; }; XmNtabList : Argument { Type = identifier; }; XmNuseImageCache : Argument { Type = boolean; }; XmNtabOrientation : Argument { Type = integer; EnumerationSet = XmTabOrientation; }; XmNnumStacks : Argument { Type = integer; }; XmNtabOffset : Argument { Type = integer; }; XmNtabStyle : Argument { Type = integer; EnumerationSet = XmTabStyle; }; XmNtabMarginWidth : Argument { Type = integer; }; Class XmTabBox : Widget { SuperClass = XmPrimitive; ConvenienceFunction = XmCreateTabBox; Resources { XmNhighlightThickness; XmNtabMode; XmNtabAutoSelect; XmNtabSelectPixmap; XmNtabCornerPercent; XmNuniformTabSize; XmNstackedEffect; XmNtabLabelSpacing; XmNunselectCallback; XmNtabMarginHeight; XmNtabMarginWidth; XmNselectCallback; XmNtabEdge; XmNtabSelectColor; XmNtabList; XmNuseImageCache; XmNtabOrientation; XmNtabOffset; XmNtabStyle; XmNfontList; XmNrenderTable; XmNorientation; XmNtabMarginWidth; XmNnumStacks; }; Controls { XmPopupMenu; }; }; ! ! Resources for XmTabStack Resource XmNtabSelectedCallback : Reason { }; XmNtabSide : Argument { Type = integer; EnumerationSet = XmTabSide; }; XmNtabLabelPixmap : Constraint { Type = pixmap; }; XmNtabStringDirection : Constraint { Type = integer; EnumerationSet = StringDirection; }; XmNtabLabelString : Constraint { Type = compound_string; }; XmNtabPixmapPlacement : Constraint { Type = integer; EnumerationSet = XmPixmapPlacement; }; XmNtabAlignment : Constraint { Type = integer; EnumerationSet = Alignment; }; XmNfreeTabPixmap : Constraint { Type = boolean; }; XmNtabBackgroundPixmap : Constraint { Type = pixmap; }; XmNtabBackground : Constraint { Type = color; }; XmNtabForeground : Constraint { Type = color; }; Class XmTabStack : Widget { SuperClass = XmBulletinBoard; ConvenienceFunction = XmCreateTabStack; Resources { XmNtabAutoSelect; XmNtabSelectedCallback; XmNhighlightThickness; XmNtabMode; XmNtabSelectPixmap; XmNuniformTabSize; XmNstackedEffect; XmNtabMarginHeight; XmNtabSelectColor; XmNtabOrientation; XmNtabStyle; XmNfontList; XmNrenderTable; XmNtabSide; XmNtabMarginWidth; XmNtabLabelPixmap; XmNtabStringDirection; XmNtabLabelString; XmNtabPixmapPlacement; XmNtabAlignment; XmNtabLabelSpacing; XmNtabCornerPercent; XmNnumStacks; XmNtabOffset; XmNuseImageCache; XmNfreeTabPixmap; XmNtabBackgroundPixmap; XmNtabBackground; XmNtabForeground; }; Controls { AllWidgetsAndGadgets; }; }; ! ! Resources for XmDataField Resource XmNpicture : Argument { Type = compound_string; Default = "Null"; }; XmNautoFill : Argument { Type = boolean; Default = "True"; }; XmNpictureErrorCallback : Reason { }; XmNvalidateCallback : Reason { }; Class XmDataField : Widget { SuperClass = XmTextField; ConvenienceFunction = XmCreateDataField; Resources { XmNpicture; XmNautoFill; XmNalignment; XmNpictureErrorCallback; XmNvalidateCallback; }; }; motif-2.3.8/tools/wml/wmlouth.c0000644000175000017500000014102513145162623013373 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wmlouth.c /main/8 1995/08/29 11:10:46 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This module contains routines responsible for writing the .h files * produced by WML. All files are written into the current directory. * * Input: * The resolved objects * * Output: * UilSymGen.h * UilSymArTy.h * UilSymChCl.h * UilSymRArg.h * UilUrmClas.h * UilConst.h * UilSymReas.h * UilSymArTa.h * UilSymChTa.h * UilSymCtl.h * UilSymNam.h * UilSymEnum.h * UilSymCSet.h */ #include "wml.h" #if defined(__STDC__) #include #endif #include /* * Routines used only in this module */ void wmlOutputUilSymGen (); void wmlOutputUilSymArTy (); void wmlOutputUilSymChCl (); void wmlOutputUilSymRArg (); void wmlOutputUilUrmClas (); void wmlOutputUilConst (); void wmlOutputUilSymReas (); void wmlOutputUilSymArTa (); void wmlOutputUilSymChTa (); void wmlOutputUilSymCtl (); void wmlOutputUilSymNam (); void wmlOutputUilSymEnum (); void wmlOutputUilSymCSet (); int wmlResolveCtlIsMember (WmlClassDefPtr, WmlClassCtrlDefPtr); /* * globals */ static char *canned_warn = "/*\n\ **\tThis file is automatically generated. Do not edit it by hand.\n\ **/\n"; /* * Used to create masks for bytes in bit vectors. Accessed by bit numbers * from 1 - 8. */ static char *bit_masks[] = {"" ," | 1" /* bit 1 */ ," | 2" /* bit 2 */ ," | 4" /* bit 3 */ ," | 8" /* bit 4 */ ," | 16" /* bit 5 */ ," | 32" /* bit 6 */ ," | 64" /* bit 7 */ ," | 128"}; /* bit 8 */ /* * To pick up maximum code values */ static int max_object_code = 0; static int max_reason_code = 0; static int max_arg_code = 0; static int max_enumset_code = 0; static int max_enumval_code = 0; static int max_charset_code = 0; static int max_child_code = 0; /* * Output control routine, which simply outputs each .h file in turn. */ void wmlOutputHFiles () { wmlOutputUilSymGen (); wmlOutputUilSymArTy (); wmlOutputUilSymChCl (); wmlOutputUilSymRArg (); wmlOutputUilUrmClas (); wmlOutputUilConst (); wmlOutputUilSymReas (); wmlOutputUilSymArTa (); wmlOutputUilSymChTa (); wmlOutputUilSymCtl (); wmlOutputUilSymNam (); wmlOutputUilSymEnum (); wmlOutputUilSymCSet (); } /* * Routine to write out UilSymGen.h * * This file defines the sym_k... literals for UIL. Each set of literals * typiclly increases monotonically from 1, with 0 used as en error value. * * sym_k__object * is widget class name in lexicographic order * gadgets are not include. * * bit masks for table access * * sym_k__reason * literals specifying all reasons, lexicographically ordered * * sym_k__arg * literals for all arguments, lexicographically ordered. * Constraints are included, and ordered with the arguments. * * sym_k__child * literals for all automatic children, lexicographically ordered. * * sym_k__enumset * literals naming each enumeration set, lexicographically ordered * * Fixed literals naming character set character sizes * sym_k__charset * literals naming each character set, lexicographically ordered */ void wmlOutputUilSymGen () { char *canned1 = "\n/* Define literals for objects */\n"; char *canned3 = "\n/* Define literals for reasons */\n\n"; char *canned4 = "\n/* Define literals for arguments */\n\n"; char *canned5 = "\n/* Define literals for enumeration sets */\n\n"; char *canned6 = "\n/* Define literals for enumeration values */\n\n"; char *canned7 = "\n/* Define literals for character sets */\n\n"; char *canned8 = "\n/* Define literals for automatic children */\n\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlClassDefPtr clsobj; /* class object */ WmlDataTypeDefPtr datobj; /* data type object */ WmlResourceDefPtr resobj; /* resource object */ WmlEnumSetDefPtr enumsetobj; /* enumeration set object */ WmlEnumValueDefPtr enumvalobj; /* enumeration value object */ WmlCharSetDefPtr charsetobj; /* character set object */ WmlChildDefPtr childobj; /* child object */ /* * Open the output file. Write the canned header stuff */ outfil = fopen ("UilSymGen.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymGen.h"); return; } fprintf (outfil, canned_warn); /* * Write the sym_k..._object literals */ fprintf (outfil, canned1); for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; fprintf (outfil, "#define sym_k_%s_object\t%d\n", clsobj->tkname, clsobj->sym_code); if ( clsobj->sym_code > max_object_code ) max_object_code = clsobj->sym_code; } /* * Define the sym_k_..._reason literals */ fprintf (outfil, canned3); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr; fprintf (outfil, "#define sym_k_%s_reason\t%d\n", resobj->tkname, resobj->sym_code); if ( resobj->sym_code > max_reason_code ) max_reason_code = resobj->sym_code; } /* * Define the sym_k_..._arg literals */ fprintf (outfil, canned4); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; fprintf (outfil, "#define sym_k_%s_arg\t%d\n", resobj->tkname, resobj->sym_code); if ( resobj->sym_code > max_arg_code ) max_arg_code = resobj->sym_code; } /* * Define the sym_k_..._enumset structs and literals */ fprintf (outfil, canned5); for ( ndx=0 ; ndxcnt ; ndx++ ) { enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr; fprintf (outfil, "#define sym_k_%s_enumset\t%d\n", enumsetobj->tkname, enumsetobj->sym_code); if ( enumsetobj->sym_code > max_enumset_code ) max_enumset_code = enumsetobj->sym_code; } /* * Define the sym_k_..._enumval literals */ fprintf (outfil, canned6); for ( ndx=0 ; ndxcnt ; ndx++ ) { enumvalobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr; fprintf (outfil, "#define sym_k_%s_enumval\t%d\n", enumvalobj->syndef->name, enumvalobj->sym_code); if ( enumvalobj->sym_code > max_enumval_code ) max_enumval_code = enumvalobj->sym_code; } /* * Define the sym_k_..._charsize literals * Define the sym_k_..._charset literals */ fprintf (outfil, canned7); for ( ndx=0 ; ndxcnt ; ndx++ ) { charsetobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; fprintf (outfil, "#define sym_k_%s_charset\t%d\n", charsetobj->syndef->name, charsetobj->sym_code); if ( charsetobj->sym_code > max_charset_code ) max_charset_code = charsetobj->sym_code; } /* * Define the sym_k_..._child literals */ fprintf (outfil, canned8); for ( ndx=0 ; ndxcnt ; ndx++ ) { childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr; fprintf (outfil, "#define sym_k_%s_child\t%d\n", childobj->syndef->name, childobj->sym_code); if ( childobj->sym_code > max_child_code ) max_child_code = childobj->sym_code; } /* * close the output file */ printf ("\nCreated UilSymGen.h"); fclose (outfil); } /* * Routine to write out UilSymChCl.h * * A table of classes accessed by child type (sym_k__child, in * the form * ... * sym_k__class, */ void wmlOutputUilSymChCl () { char *canned1 = "/* Table of the class type of children\n\ The table is indexed by child with each entry the\n\ permitted class for that child.\n\ */\n\ \n\ static unsigned char child_class_table_vec[] =\n\ {\n\ 0,\n"; char *canned1a = " };\n\ externaldef(uil_sym_glbl) unsigned char *child_class_table =\n\ \t child_class_table_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlClassDefPtr classobj; /* data type object */ WmlChildDefPtr childobj; /* resource object */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymChCl.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymChCL.h"); return; } fprintf (outfil, canned_warn); /* * Create table entries, similar to writing sym_k... */ fprintf (outfil, canned1); for ( ndx=0 ; ndxcnt ; ndx++ ) { childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr; classobj = childobj->class; fprintf (outfil, " sym_k_%s_object,\n", classobj->tkname); } fprintf (outfil, canned1a); /* * close the output file */ printf ("\nCreated UilSymChCl.h"); fclose (outfil); } /* * Routine to write out UilSymArTy.h * * A table of data types accessed by argument type (sym_k__arg, in * the form * ... * sym_k__value, */ void wmlOutputUilSymArTy () { char *canned1 = "/* Table of the types of arguments\n\ The table is indexed by argument with each entry the\n\ permitted type for that argument.\n\ */\n\ \n\ static unsigned char argument_type_table_vec[] =\n\ {\n\ 0,\n"; char *canned1a = " };\n\ externaldef(uil_sym_glbl) unsigned char *argument_type_table =\n\ \t argument_type_table_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlDataTypeDefPtr datobj; /* data type object */ WmlResourceDefPtr resobj; /* resource object */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymArTy.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymArTy.h"); return; } fprintf (outfil, canned_warn); /* * Create table entries, similar to writing sym_k... */ fprintf (outfil, canned1); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; datobj = resobj->dtype_def; fprintf (outfil, " sym_k_%s_value,\n", datobj->tkname); } fprintf (outfil, canned1a); /* * close the output file */ printf ("\nCreated UilSymArTy.h"); fclose (outfil); } /* * Routine to write out UilSymRArg.h * * Related argument table */ void wmlOutputUilSymRArg () { char *canned1 = "/* Related argument table. Each non-zero entry is the code\n\ of the related argument.\n\ */\n\ \n\ static unsigned short int related_argument_table_vec[] =\n\ {\n\ 0,\n"; char *canned1a = " };\n\ externaldef(uil_sym_glbl) unsigned short int *related_argument_table =\n\ \t\trelated_argument_table_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlResourceDefPtr resobj; /* resource object */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymRArg.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymRArg.h"); return; } fprintf (outfil, canned_warn); /* * Create table entries, similar to writing sym_k... */ fprintf (outfil, canned1); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; fprintf (outfil, " %d,\n", resobj->related_code); } fprintf (outfil, canned1a); /* * close the output file */ printf ("\nCreated UilSymRArg.h"); fclose (outfil); } /* * Routine to write out UilUrmClas.h * * Table of convenience function names indexed by the sym_k_ literal * for both widgets and gadgets * Table of resource names indexed by the sym_k__arg and * sym_k__reason codes. */ void wmlOutputUilUrmClas () { char *canned1 = "\n/* Define mapping of UIL widget types to convenience functions. */\n\ static char *uil_widget_funcs_vec[] = {\n\ \"\",\t /* NOT USED */\n"; char *canned2 = "};\n\ externaldef(uil_sym_glbl) char **uil_widget_funcs = uil_widget_funcs_vec;\n\ \n\ /* Define mapping of UIL widget classes to matching gadget class. */\n\ static unsigned short int uil_gadget_variants_vec[] = {\n\ 0,\t /* NOT USED */\n"; char *canned3 = "};\n\ externaldef(uil_sym_glbl) unsigned short int *uil_gadget_variants =\n\ \t\tuil_gadget_variants_vec;\n\ \n\ /* Define mapping of dialog types to non-dialog URM widget classes. */\n\ static unsigned short int uil_urm_nondialog_class_vec[] = {\n\ 0,\t/* NOT USED */\n"; char *canned4 = "};\n\ externaldef(uil_sym_glbl) unsigned short int *uil_urm_nondialog_class =\n\ \t\tuil_urm_nondialog_class_vec;\n\ \n\ /* Define mapping of widget controls to a (subtree) resource. */\n\ static unsigned short int uil_urm_subtree_resource_vec[] = {\n\ 0,\t/* NOT USED */\n"; char *canned5 = "};\n\ externaldef(uil_sym_glbl) unsigned short int *uil_urm_subtree_resource =\n\ \t\tuil_urm_subtree_resource_vec;\n\ \n\ /* Define mapping of arguments to toolkit names. */\n\ static char *uil_argument_toolkit_names_vec[] = {\n\ \"\",\t /* NOT USED */\n"; char *canned6 = "};\n\ externaldef(uil_sym_glbl) char **uil_argument_toolkit_names =\n\ \t\tuil_argument_toolkit_names_vec;\n\ \n\ /* Define mapping of reasons to toolkit names. */\n\ static char *uil_reason_toolkit_names_vec[] = {\n\ \"\",\t/* NOT USED */\n"; char *canned7 = "};\n\ externaldef(uil_sym_glbl) char **uil_reason_toolkit_names =\n\ \t\tuil_reason_toolkit_names_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlClassDefPtr clsobj; /* class object */ WmlSynClassDefPtr synobj; /* syntactic object */ WmlClassDefPtr varobj; /* variant (widget) class object */ WmlResourceDefPtr resobj; /* argument/reason object */ WmlSynResourceDefPtr synres; /* arg/reason syntactic object */ WmlResourceDefPtr mapresobj; /* controls map to resource object */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilUrmClas.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilUrmClas.h"); return; } fprintf (outfil, canned_warn); /* * Write entries for widgets */ fprintf (outfil, canned1); for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; if ( clsobj->sym_code == 0 ) continue; synobj = clsobj->syndef; if ( synobj->int_lit != NULL ) fprintf (outfil, " \"%s\",\n", synobj->convfunc); else fprintf (outfil, " \"%s\",\t\n", synobj->convfunc); } fprintf (outfil, canned2); /* * Write entries for gadget variants of widget classes */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; if ( clsobj->sym_code == 0 ) continue; varobj = clsobj->variant; synobj = clsobj->syndef; if ( varobj==NULL || synobj->type==WmlClassTypeGadget ) fprintf (outfil, " 0,\n"); else { synobj = varobj->syndef; if ( synobj->int_lit != NULL ) fprintf (outfil, " sym_k_%s_object,\n", synobj->int_lit); else fprintf (outfil, " sym_k_%s_object,\n", synobj->name); } } fprintf (outfil, canned3); /* * Write entries for non-dialog widgets */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; if ( clsobj->sym_code == 0 ) continue; varobj = clsobj->nondialog; synobj = clsobj->syndef; if ( varobj == NULL ) fprintf (outfil, " 0,\n"); else { synobj = varobj->syndef; if ( synobj->int_lit != NULL ) fprintf (outfil, " sym_k_%s_object,\n", synobj->int_lit); else fprintf (outfil, " sym_k_%s_object,\n", synobj->name); } } fprintf (outfil, canned4); /* * Write entries for the resource a widget's controls map to */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; if ( clsobj->sym_code == 0 ) continue; synobj = clsobj->syndef; mapresobj = clsobj->ctrlmapto; if ( mapresobj == NULL ) fprintf (outfil, " 0,\n"); else fprintf (outfil, " sym_k_%s_arg,\n", mapresobj->tkname); } fprintf (outfil, canned5); /* * Write entries for arguments */ for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; synres = resobj->syndef; if ( resobj->sym_code == 0 ) continue; fprintf (outfil, " %s,\n", synres->resliteral); } fprintf (outfil, canned6); /* * Write entries for reasons */ for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr; synres = resobj->syndef; if ( resobj->sym_code == 0 ) continue; fprintf (outfil, " %s,\n", synres->resliteral); } fprintf (outfil, canned7); /* * close the output file */ printf ("\nCreated UilUrmClas.h"); fclose (outfil); } /* * Routine to write out UilConst.h * * A bit vector showing which arguments are constraints. */ void wmlOutputUilConst () { char *canned1 = "/* Table indexed by argument indicating whether\n\ argument is a constraint (TRUE) or a regular\n\ argument (FALSE). Each entry is one bit.\n\ Index and mask macros are defined to simplify\n\ access to the table\n\ */\n\ \n\ static unsigned char constraint_tab_vec[] = {\n"; char *canned1a = "};\n\ externaldef(uil_sym_glbl) unsigned char *constraint_tab =\n\ \t\tconstraint_tab_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlResourceDefPtr resobj; /* resource object */ WmlSynResourceDefPtr synobj; /* syntactic object */ char maskbuf[100]; /* to constuct each mask */ int bitno = 0; /* current bit number, from code */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilConst.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilConst.h"); return; } fprintf (outfil, canned_warn); /* * Process the arguments in code order. We start with 1, and write out * the mask after processing 8 codes. */ fprintf (outfil, canned1); strcpy (maskbuf, "0"); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; synobj = resobj->syndef; bitno = resobj->sym_code % 8; if ( bitno == 0 ) bitno = 8; if ( synobj->type == WmlResourceTypeConstraint ) strcat (maskbuf, bit_masks[bitno]); if ( bitno == 8 ) { fprintf (outfil, "%s,\n", maskbuf); strcpy (maskbuf, "0"); } } if ( bitno != 8 ) fprintf (outfil, "%s", maskbuf); fprintf (outfil, canned1a); /* * close the output file */ printf ("\nCreated UilConst.h"); fclose (outfil); } /* * Routine to write out UilSymReas.h * * This file defines the reasons supported by each class. For each * reason, there is a bit vector with the bit for each supporting class * turned on if the reason is supported. There is then a vector pointing * to these bit vectors for all reasons. This vector is accessed by * sym_k_..._reason to find the reasons bit vector, then by sym_k_..._object * to check the bit. */ void wmlOutputUilSymReas () { char *canned1 = "\n/*\n\ * Bit vectors for each reason. The entries in the vector correspond\n\ * to each class.\n\ */\n"; char *bvechdr = "\n\ /* sym_k_%s_reason */\n\ static unsigned char reason_class_vec%d[] =\n\ {\n"; char *canned2 = "\n/*\n\ * Table of bit vectors accessed by sym_k_..._reason\n\ */\n\ static unsigned char *allowed_reason_table_vec[] =\n\ {\n\ NULL,\t/* UNUSED */\n"; char *canned3 = " };\n\ externaldef(uil_sym_glbl) unsigned char **allowed_reason_table =\n\ \t\tallowed_reason_table_vec;\n"; FILE *outfil; /* output file */ int resndx; /* outer loop index */ WmlResourceDefPtr resobj; /* current reason */ int clsndx; /* inner loop index */ WmlClassDefPtr clsobj; /* current class object */ WmlClassResDefPtr resref; /* class' resource reference */ int itemno = 0; /* item in bye */ char maskbuf[500]; /* current mask buffer */ char itembuf[100]; /* for current item */ int donl; /* TRUE if append \n to mask */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymReas.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymReas.h"); return; } fprintf (outfil, canned_warn); fprintf (outfil, canned1); /* * Generate the bit vectors for each class. Outer loop on the reason code, * inner loop on the class code. */ for ( resndx=0 ; resndxcnt ; resndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr; fprintf (outfil, bvechdr, resobj->tkname, resobj->sym_code); /* * inner loop on widget class. */ strcpy (maskbuf, " "); for ( clsndx=0 ; clsndxcnt ; clsndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[clsndx].objptr; itemno = (clsobj->sym_code+1) % 8; donl = FALSE; resref = wmlResolveResIsMember (resobj, clsobj->reasons); if ( resref != NULL ) if ( resref->exclude != WmlAttributeTrue ) { sprintf (itembuf, " _BIT_MASK(sym_k_%s_object) |", clsobj->tkname); strcat (maskbuf, itembuf); donl = TRUE; } if ( donl ) strcat (maskbuf, "\n "); if ( itemno == 0 ) { fprintf (outfil, "%s 0", maskbuf); strcpy (maskbuf, ","); } } if ( itemno != 0 ) fprintf (outfil, "%s 0};\n", maskbuf); else fprintf (outfil, "};\n"); } /* * Write the vector of vectors. */ fprintf (outfil, canned2); for ( resndx=0 ; resndxcnt ; resndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr; fprintf (outfil, " reason_class_vec%d,\n", resobj->sym_code); } fprintf (outfil, canned3); /* * close the output file */ printf ("\nCreated UilSymReas.h"); fclose (outfil); } /* * Routine to write out UilSymArTa.h * * This file defines the arguments supported by each class. For each * argument, there is a bit vector with the bit for each supporting class * turned on if the argument is supported. There is then a vector pointing * to these bit vectors for all arguments. This vector is accessed by * sym_k_..._arg to find the arguments bit vector, then by sym_k_..._object * to check the bit. */ void wmlOutputUilSymArTa () { char *canned1 = "\n/*\n\ * Bit vectors for each argument. The entries in the vector correspond\n\ * to each class.\n\ */\n"; char *bvechdr = "\n\ /* sym_k_%s_arg */\n\ static unsigned char arg_class_vec%d[] =\n\ {\n"; char *canned2 = "\n/*\n\ * Table of bit vectors accessed by sym_k_..._arg\n\ */\n\ static unsigned char *allowed_argument_table_vec[] =\n\ {\n\ NULL,\t/* UNUSED */\n"; char *canned3 = " };\n\ externaldef(uil_sym_glbl) unsigned char **allowed_argument_table =\n\ \t\tallowed_argument_table_vec;\n"; FILE *outfil; /* output file */ int resndx; /* outer loop index */ WmlResourceDefPtr resobj; /* current argument */ int clsndx; /* inner loop index */ WmlClassDefPtr clsobj; /* current class object */ WmlClassResDefPtr resref; /* class' resource reference */ int itemno = 0; /* item in bye */ char maskbuf[500]; /* current mask buffer */ char itembuf[100]; /* for current item */ int donl; /* TRUE if append \n to mask */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymArTa.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymArTa.h"); return; } fprintf (outfil, canned_warn); fprintf (outfil, canned1); /* * Generate the bit vectors for each class. Outer loop on the argument code, * inner loop on the class code. */ for ( resndx=0 ; resndxcnt ; resndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr; fprintf (outfil, bvechdr, resobj->tkname, resobj->sym_code); /* * inner loop on widget class. */ strcpy (maskbuf, " "); for ( clsndx=0 ; clsndxcnt ; clsndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[clsndx].objptr; itemno = (clsobj->sym_code+1) % 8; donl = FALSE; resref = wmlResolveResIsMember (resobj, clsobj->arguments); if ( resref != NULL ) if ( resref->exclude != WmlAttributeTrue ) { sprintf (itembuf, " _BIT_MASK(sym_k_%s_object) |", clsobj->tkname); strcat (maskbuf, itembuf); donl = TRUE; } if ( donl ) strcat (maskbuf, "\n "); if ( itemno == 0 ) { fprintf (outfil, "%s 0", maskbuf); strcpy (maskbuf, ","); } } if ( itemno != 0 ) fprintf (outfil, "%s 0};\n", maskbuf); else fprintf (outfil, "};\n"); } /* * Write the vector of vectors. */ fprintf (outfil, canned2); for ( resndx=0 ; resndxcnt ; resndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr; fprintf (outfil, " arg_class_vec%d,\n", resobj->sym_code); } fprintf (outfil, canned3); /* * close the output file */ printf ("\nCreated UilSymArTa.h"); fclose (outfil); } /* * Routine to write out UilSymChTa.h * * This file defines the automatic children supported by each class. For each * child, there is a bit vector with the bit for each supporting class * turned on if the child is supported. There is then a vector pointing * to these bit vectors for all children. This vector is accessed by * sym_k_..._child to find the child's bit vector, then by sym_k_..._object * to check the bit. */ void wmlOutputUilSymChTa () { char *canned1 = "\n/*\n\ * Bit vectors for each child. The entries in the vector correspond\n\ * to each class.\n\ */\n"; char *bvechdr = "\n\ /* sym_k_%s_child */\n\ static unsigned char child_class_vec%d[] =\n\ {\n"; char *canned2 = "\n/*\n\ * Table of bit vectors accessed by sym_k_..._child\n\ */\n\ static unsigned char *allowed_child_table_vec[] =\n\ {\n\ NULL,\t/* UNUSED */\n"; char *canned3 = " };\n\ externaldef(uil_sym_glbl) unsigned char **allowed_child_table =\n\ \t\tallowed_child_table_vec;\n"; FILE *outfil; /* output file */ int childndx; /* outer loop index */ WmlChildDefPtr childobj; /* current argument */ int clsndx; /* inner loop index */ WmlClassDefPtr clsobj; /* current class object */ WmlClassChildDefPtr childref; /* class' child reference */ int itemno = 0; /* item in byte */ char maskbuf[500]; /* current mask buffer */ char itembuf[100]; /* for current item */ int donl; /* TRUE if append \n to mask */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymChTa.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymChTa.h"); return; } fprintf (outfil, canned_warn); fprintf (outfil, canned1); /* * Generate the bit vectors for each class. Outer loop on the child code, * inner loop on the class code. */ for ( childndx=0 ; childndxcnt ; childndx++ ) { childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr; fprintf (outfil, bvechdr, childobj->tkname, childobj->sym_code); /* * inner loop on widget class. */ strcpy (maskbuf, " "); for ( clsndx=0 ; clsndxcnt ; clsndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[clsndx].objptr; itemno = (clsobj->sym_code+1) % 8; donl = FALSE; childref = wmlResolveChildIsMember (childobj, clsobj->children); if ( childref != NULL ) { sprintf (itembuf, " _BIT_MASK(sym_k_%s_object) |", clsobj->tkname); strcat (maskbuf, itembuf); donl = TRUE; } if ( donl ) strcat (maskbuf, "\n "); if ( itemno == 0 ) { fprintf (outfil, "%s 0", maskbuf); strcpy (maskbuf, ","); } } if ( itemno != 0 ) fprintf (outfil, "%s 0};\n", maskbuf); else fprintf (outfil, "};\n"); } /* * Write the vector of vectors. */ fprintf (outfil, canned2); for ( childndx=0 ; childndxcnt ; childndx++ ) { childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr; fprintf (outfil, " child_class_vec%d,\n", childobj->sym_code); } fprintf (outfil, canned3); /* * close the output file */ printf ("\nCreated UilSymChTa.h"); fclose (outfil); } /* * Routine to write out UilSymCtl.h * * This file defines the controls supported by each class. For each * object, there is a bit vector with the bit for each supporting class * turned on if the object is supported. There is then a vector pointing * to these bit vectors for all objects. This vector is accessed by * sym_k_..._object to find the objects bit vector, then by sym_k_..._object * to check the bit. */ void wmlOutputUilSymCtl () { char *canned1 = "\n/*\n\ * Bit vectors for each control. The entries in the vector correspond\n\ * to each class.\n\ */\n"; char *bvechdr = "\n\ /* sym_k_%s_object */\n\ static unsigned char object_class_vec%d[] =\n\ {\n"; char *canned2 = "\n/*\n\ * Table of bit vectors accessed by sym_k_..._object\n\ */\n\ static unsigned char *allowed_control_table_vec[] =\n\ {\n\ NULL,\t/* UNUSED */\n"; char *canned3 = " };\n\ externaldef(uil_sym_glbl) unsigned char **allowed_control_table =\n\ \t\tallowed_control_table_vec;\n"; FILE *outfil; /* output file */ int ctlndx; /* outer loop index */ WmlClassDefPtr ctlobj; /* current class allowing controls */ int clsndx; /* inner loop index */ WmlClassDefPtr clsobj; /* current class object */ int itemno = 0; /* item in bye */ char maskbuf[500]; /* current mask buffer */ char itembuf[100]; /* for current item */ int donl; /* TRUE if append \n to mask */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymCtl.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymCtl.h"); return; } fprintf (outfil, canned_warn); fprintf (outfil, canned1); /* * Generate the bit vectors for each class. Outer loop on the class code, * inner loop on the class code. */ for ( ctlndx=0 ; ctlndxcnt ; ctlndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr; fprintf (outfil, bvechdr, clsobj->tkname, clsobj->sym_code); /* * inner loop on widget class. */ strcpy (maskbuf, " "); for ( clsndx=0 ; clsndxcnt ; clsndx++ ) { ctlobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[clsndx].objptr; itemno = (ctlobj->sym_code+1) % 8; donl = FALSE; if ( wmlResolveCtlIsMember(clsobj,ctlobj->controls) == TRUE) { sprintf (itembuf, " _BIT_MASK(sym_k_%s_object) |", ctlobj->tkname); strcat (maskbuf, itembuf); donl = TRUE; } if ( donl ) strcat (maskbuf, "\n "); if ( itemno == 0 ) { fprintf (outfil, "%s 0", maskbuf); strcpy (maskbuf, ","); } } if ( itemno != 0 ) fprintf (outfil, "%s 0};\n", maskbuf); else fprintf (outfil, "};\n"); } /* * Write the vector of vectors. */ fprintf (outfil, canned2); for ( ctlndx=0 ; ctlndxcnt ; ctlndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr; fprintf (outfil, " object_class_vec%d,\n", clsobj->sym_code); } fprintf (outfil, canned3); /* * close the output file */ printf ("\nCreated UilSymCtl.h"); fclose (outfil); } /* * Predicate to indicate if a class object is in a controls list. */ int wmlResolveCtlIsMember (ctlobj, ctlref) WmlClassDefPtr ctlobj; WmlClassCtrlDefPtr ctlref; { while ( ctlref != NULL ) { if ( ctlref->ctrl == ctlobj ) return TRUE; ctlref = ctlref->next; } return FALSE; } /* * Routine to write out UilSymNam.h * * Tables of names of object indexed by their various sym_k_ literals. */ void wmlOutputUilSymNam () { char *canned1 = "/* Define mapping of sym_k_..._object codes to widget names. */\n\ \n\ externaldef(uil_sym_glbl) int uil_max_object = %d;\n\ static char *uil_widget_names_vec[] = {\n\ \"\",\t/* NOT USED */\n"; char *canned2 = "};\n\ externaldef(uil_sym_glbl) char **uil_widget_names =\n\ \t\tuil_widget_names_vec;\n\ \n\n\ /* Define mapping of sym_k_..._arg codes to argument names. */\n\ \n\ externaldef(uil_sym_glbl) int uil_max_arg = %d;\n\ static char *uil_argument_names_vec[] = {\n\ \"\",\t/* NOT USED */\n"; char *canned3 = "};\n\ externaldef(uil_sym_glbl) char **uil_argument_names =\n\ \t\tuil_argument_names_vec;\n\ \n\n\ /* Define mapping of sym_k_..._reason to reason names. */\n\ \n\ externaldef(uil_sym_glbl) int uil_max_reason = %d;\n\ static char *uil_reason_names_vec[] = {\n\ \"\",\t/* NOT USED */\n"; char *canned4 = "};\n\ externaldef(uil_sym_glbl) char **uil_reason_names =\n\ \t\tuil_reason_names_vec;\n\ \n\n\ /* Define mapping of sym_k_..._enumval to enumeration value names. */\n\ \n\ externaldef(uil_sym_glbl) int uil_max_enumset = %d;\n\ externaldef(uil_sym_glbl) int uil_max_enumval = %d;\n\ static char *uil_enumval_names_vec[] = {\n\ \"\",\t/* NOT USED */\n"; char *canned5 = "};\n\ externaldef(uil_sym_glbl) char **uil_enumval_names =\n\ \t\tuil_enumval_names_vec;\n\ \n\n\ /* Define mapping of sym_k_..._charset to enumeration value names. */\n\ \n\ externaldef(uil_sym_glbl) int uil_max_charset = %d;\n\ static char *uil_charset_names_vec[] = {\n\ \"\",\t/* NOT USED */\n\ \"\",\n"; char *canned6 = "};\n\ externaldef(uil_sym_glbl) char **uil_charset_names =\n\ \t\tuil_charset_names_vec;\n\ \n\n\ /* Define mapping of sym_k_..._child codes to child names. */\n\ \n\ externaldef(uil_sym_glbl) int uil_max_child = %d;\n\ static char *uil_child_names_vec[] = {\n\ \"\",\t/* NOT USED */\n"; char *canned7 = "};\n\ externaldef(uil_sym_glbl) char **uil_child_names =\n\ \t\tuil_child_names_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlClassDefPtr clsobj; /* class object */ WmlClassDefPtr varobj; /* gadget class object */ WmlSynClassDefPtr synobj; /* syntactic object */ WmlResourceDefPtr resobj; /* argument/reason object */ WmlSynResourceDefPtr synres; /* arg/reason syntactic object */ WmlEnumValueDefPtr evobj; /* enumeration value object */ WmlSynEnumValueDefPtr synev; /* enumeration value syntactic obj */ WmlCharSetDefPtr csobj; /* character set object */ WmlSynCharSetDefPtr syncs; /* character set syntactic obj */ WmlChildDefPtr chobj; /* child object */ WmlSynChildDefPtr synch; /* child syntactic object */ /* * Open the output file. Write canned header. */ outfil = fopen ( "UilSymNam.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymNam.h"); return; } fprintf (outfil, canned_warn); /* * Write entries for widgets */ fprintf (outfil, canned1, max_object_code); for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; if ( clsobj->sym_code == 0 ) continue; synobj = clsobj->syndef; fprintf (outfil, " \"%s\",\n", synobj->name); } /* * Write entries for arguments */ fprintf (outfil, canned2, max_arg_code); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; synres = resobj->syndef; if ( resobj->sym_code == 0 ) continue; fprintf (outfil, " \"%s\",\n", synres->name); } /* * Write entries for reasons */ fprintf (outfil, canned3, max_reason_code); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr; synres = resobj->syndef; if ( resobj->sym_code == 0 ) continue; fprintf (outfil, " \"%s\",\n", synres->name); } /* * Write entries for enumeration values */ fprintf (outfil, canned4, max_enumset_code, max_enumval_code); for ( ndx=0 ; ndxcnt ; ndx++ ) { evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr; synev = evobj->syndef; if ( evobj->sym_code == 0 ) continue; fprintf (outfil, " \"%s\",\n", synev->name); } /* * Write entries for character sets */ fprintf (outfil, canned5, max_charset_code); for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; syncs = csobj->syndef; if ( csobj->sym_code == 0 ) continue; fprintf (outfil, " \"%s\",\n", syncs->name); } /* * Write entries for children */ fprintf (outfil, canned6, max_child_code); for ( ndx=0 ; ndxcnt ; ndx++ ) { chobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr; synch = chobj->syndef; if ( chobj->sym_code == 0 ) continue; fprintf (outfil, " \"%s\",\n", synch->name); } fprintf (outfil, canned7); /* * close the output file */ printf ("\nCreated UilSymNam.h"); fclose (outfil); } /* * Routine to write out UilSymEnum.h * * This file defines the enumeration sets recognized by UIL. There is an * entry in this file for each enumeration set. The definitions are accessed * by the sym_k_..._enumset code. Each consists of a structure containing * a vector of enumeration value descriptors, each of which is the name * of the value and its value. * * UilSymEnum.h contains: * - Vectors of value descriptors for each table entry * - The table itself. * - A table given the sym_k_..._enumset code for each argument which * has an enumeration set. * - A table accessed by sym_k_..._enumval code giving the actual value * for each enumeration value. * * The typedefs for the tables are in UilSymGen.h */ void wmlOutputUilSymEnum () { char *canned1 = "\n\ /*\n\ * Enumeration value vectors for each enumeration set\n\ */\n\ \n"; char *valhdr = "\n\ static unsigned short int enum_value_vec%d[] =\n\ {\n"; char *canned3 = "\n\ /*\n\ * Enumeration set descriptor table\n\ */\n\ static UilEnumSetDescDef enum_set_table_vec[] =\n\ {\n\ {0,NULL},\n"; char *canned4 = " };\n\ externaldef(uil_sym_glbl) UilEnumSetDescDef *enum_set_table =\n\ \t\tenum_set_table_vec;\n\ /*\n\ * Enumeration set table, accessed by sym_k_..._arg code. Each non-zero entry\n\ * is the sym_k_..._enumset code for the argument's enumeration set.\n\ */\n\ static unsigned short int argument_enumset_table_vec[] =\n\ {\n\ 0,\n"; char *canned5 = " };\n\ externaldef(uil_sym_glbl) unsigned short int *argument_enumset_table =\n\ \t\targument_enumset_table_vec;\n\ /*\n\ * Enumeration value table, accessed by sym_k_..._enumval code. Each entry is\n\ * the actual value associated with the code.\n\ */\n\ static int enumval_values_table_vec[] =\n\ {\n\ 0,\n"; char *canned5a = " };\n\ externaldef(uil_sym_glbl) int *enumval_values_table =\n\ \t\tenumval_values_table_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlEnumSetDefPtr enumsetobj; /* enumeration set object */ WmlEnumSetValDefPtr esvobj; /* current enum set value list element */ WmlEnumValueDefPtr evobj; /* current enumeration value object */ WmlResourceDefPtr resobj; /* resource object */ /* * Open the output file. Write the canned header stuff */ outfil = fopen ("UilSymEnum.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymEnum.h"); return; } fprintf (outfil, canned_warn); /* * Generate the enumeration value vectors for each enumeration set. */ fprintf (outfil, canned1); for ( ndx=0 ; ndxcnt ; ndx++ ) { enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr; fprintf (outfil, valhdr, enumsetobj->sym_code); for ( esvobj=enumsetobj->values ; esvobj!=NULL ; esvobj=esvobj->next ) { evobj = esvobj->value; fprintf (outfil, " %d,\n", evobj->sym_code); } fprintf (outfil, " };\n"); } /* * Generate the enumeration set tables */ fprintf (outfil, canned3); for ( ndx=0 ; ndxcnt ; ndx++ ) { enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr; fprintf (outfil, " {%d,enum_value_vec%d},\n", enumsetobj->values_cnt, enumsetobj->sym_code); } /* * Create enumset table entries for arguments, similar to writing sym_k... */ fprintf (outfil, canned4); for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; if ( resobj->enumset_def == NULL ) fprintf (outfil, " 0,\n"); else fprintf (outfil, " %d,\n", resobj->enumset_def->sym_code); } /* * Create the enumval values table. */ fprintf (outfil, canned5); for ( ndx=0 ; ndxcnt ; ndx++ ) { evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr; fprintf (outfil, " %s,\n", evobj->syndef->enumlit); } fprintf (outfil, canned5a); /* * close the output file */ printf ("\nCreated UilSymEnum.h"); fclose (outfil); } /* * Routine to write out UilSymCSet.h * * This file specifies the various attributes for the character sets * recognized by UIL. There is a table for each of the following * attributes: * - Standards name associated with the character set * - Writing direction, from XmSTRING_DIRECTION_... * - Parsing direction, from XmSTRING_DIRECTION_... * - Bytes per character, from sym_k_..._charsize (in UilSymGen.h) * - A pair of tables for recognizing $LANG settings: * o a table of all names under which a character set might * be legally recognized (upper case). * o the sym_k_..._charset code for each entry * o a variable giving the number of entries in the table * * All tables are accessed by the sym_k_..._charset * */ void wmlOutputUilSymCSet () { char *canned1 = "\n\ /*\n\ * Character set XmString name table, accessed by sym_k_..._charset code.\n\ * Each entry is the name which identifies the character set in a XmString.\n\ */\n\ static char *charset_xmstring_names_table_vec[] =\n\ {\n\ 0,\n\ \"\",\n"; char *canned2 = "};\n\ externaldef(uil_sym_glbl) char **charset_xmstring_names_table =\n\ \t\tcharset_xmstring_names_table_vec;\n\ /*\n\ * Character set writing direction table, accessed by sym_k_..._charset code.\n\ * Each entry is the XmSTRING_DIRECTION_... code which identifies the\n\ * writing direction for the character set in a XmString.\n\ */\n\ static unsigned char charset_wrdirection_table_vec[] =\n\ {\n\ 0,\n\ 0,\t/* userdefined */\n"; char *canned3 = "};\n\ externaldef(uil_sym_glbl) unsigned char *charset_writing_direction_table =\n\ \t\tcharset_wrdirection_table_vec;\n\ /*\n\ * Character set parsing direction table, accessed by sym_k_..._charset code.\n\ * Each entry is the XmSTRING_DIRECTION_... code which identifies the\n\ * parsing direction for the character set in a XmString.\n\ */\n\ static unsigned char charset_parsdirection_table_vec[] =\n\ {\n\ 0,\n\ 0,\t/* userdefined */\n"; char *canned4 = "};\n\ externaldef(uil_sym_glbl) unsigned char *charset_parsing_direction_table =\n\ \t\tcharset_parsdirection_table_vec;\n\ /*\n\ * Character set character size table, accessed by sym_k_..._charset code.\n\ * Each entry is the sym_k_..._charsize literal which names the character\n\ * size for the character set in a XmString.\n\ */\n\ static unsigned char charset_charsize_table_vec[] =\n\ {\n\ 0,\n\ 0,\t/* userdefined */\n"; char *canned5 = "};\n\ externaldef(uil_sym_glbl) unsigned char *charset_character_size_table =\n\ \t\tcharset_charsize_table_vec;\n\ /*\n\ * All the names under which a character set may be legally named in a \n\ * $LANG variable (upper case).\n\ */\n\ static char *charset_lang_names_table_vec[] =\n\ {\n"; char *canned6 = "};\n\ externaldef(uil_sym_glbl) char **charset_lang_names_table =\n\ \t\tcharset_lang_names_table_vec;\n\ /*\n\ * The sym_k_..._charset codes for charset_lang_names\n\ */\n\ static unsigned short int charset_lang_codes_table_vec[] =\n\ {\n"; char *canned7 = "};\n\ externaldef(uil_sym_glbl) unsigned short int *charset_lang_codes_table =\n\ \t\tcharset_lang_codes_table_vec;\n\ /*\n\ * The number of entries in charset_lang_..._table tables\n\ */\n\ externaldef(uil_sym_glbl) unsigned short int charset_lang_table_max = %d;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlCharSetDefPtr csobj; /* character set object */ WmlSynCharSetDefPtr syncs; /* character set syntactic obj */ int lang_max; /* max value for $LANG tables */ int alias_ndx; /* alias loop index */ char uname[200]; /* name converted to upper case */ /* * Open the output file. Write the canned header stuff */ outfil = fopen ("UilSymCSet.h", "w"); if ( outfil == (FILE *) NULL ) { printf ("\nCouldn't open UilSymCSet.h"); return; } fprintf (outfil, canned_warn); /* * Generate the standards name table */ fprintf (outfil, canned1); for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; syncs = csobj->syndef; if ( csobj->sym_code == 0 ) continue; if ((strcmp(syncs->xms_name, "XmFONTLIST_DEFAULT_TAG") == 0) || (strcmp(syncs->xms_name, "_MOTIF_DEFAULT_LOCALE") == 0)) fprintf (outfil, " %s,\t/* %s */\n", syncs->xms_name, syncs->name); else fprintf (outfil, " \"%s\",\t/* %s */\n", syncs->xms_name, syncs->name); } /* * Generate the writing direction table */ fprintf (outfil, canned2); for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; syncs = csobj->syndef; if ( csobj->sym_code == 0 ) continue; switch ( syncs->direction ) { case WmlCharSetDirectionLtoR: fprintf (outfil, " XmSTRING_DIRECTION_L_TO_R,\t/* %s */\n", syncs->name); break; case WmlCharSetDirectionRtoL: fprintf (outfil, " XmSTRING_DIRECTION_R_TO_L,\t/* %s */\n", syncs->name); break; } } /* * Generate the parsing direction table */ fprintf (outfil, canned3); for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; syncs = csobj->syndef; if ( csobj->sym_code == 0 ) continue; switch ( syncs->parsedirection ) { case WmlCharSetDirectionLtoR: fprintf (outfil, " XmSTRING_DIRECTION_L_TO_R,\t/* %s */\n", syncs->name); break; case WmlCharSetDirectionRtoL: fprintf (outfil, " XmSTRING_DIRECTION_R_TO_L,\t/* %s */\n", syncs->name); break; } } /* * Generate the character size table */ fprintf (outfil, canned4); for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; syncs = csobj->syndef; if ( csobj->sym_code == 0 ) continue; switch ( syncs->charsize ) { case WmlCharSizeOneByte: fprintf (outfil, " sym_k_onebyte_charsize,\t/* %s */\n", syncs->name); break; case WmlCharSizeTwoByte: fprintf (outfil, " sym_k_twobyte_charsize,\t/* %s */\n", syncs->name); break; case WmlCharSizeMixed1_2Byte: fprintf (outfil, " sym_k_mixed1_2byte_charsize,\t/* %s */\n", syncs->name); break; } } /* * Generate the $LANG name recognition table */ fprintf (outfil, canned5); lang_max = 0; for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; syncs = csobj->syndef; if ( csobj->sym_code == 0 ) continue; strcpy (uname, syncs->name); wmlUpperCaseString (uname); fprintf (outfil, " \"%s\",\t/* %s */\n", uname, syncs->name); lang_max += 1; strcpy (uname, syncs->xms_name); wmlUpperCaseString (uname); fprintf (outfil, " \"%s\",\t/* %s */\n", uname, syncs->name); lang_max += 1; for ( alias_ndx=0 ; alias_ndxalias_cnt ; alias_ndx++ ) { strcpy (uname, syncs->alias_list[alias_ndx]); wmlUpperCaseString (uname); fprintf (outfil, " \"%s\",\t/* %s */\n", uname, syncs->name); lang_max += 1; } } /* * Generate the $LANG code lookup table, in upper case */ fprintf (outfil, canned6); for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; syncs = csobj->syndef; if ( csobj->sym_code == 0 ) continue; fprintf (outfil, " sym_k_%s_charset,\n", syncs->name); fprintf (outfil, " sym_k_%s_charset,\n", syncs->name); for ( alias_ndx=0 ; alias_ndxalias_cnt ; alias_ndx++ ) fprintf (outfil, " sym_k_%s_charset,\n", syncs->name); } /* * Generate the number of entries in the previous two tables */ fprintf (outfil, canned7, lang_max); /* * close the output file */ printf ("\nCreated UilSymCSet.h"); fclose (outfil); } motif-2.3.8/tools/wml/UilSymCtl.h0000644000175000017500000051661613211513006013567 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* * Bit vectors for each control. The entries in the vector correspond * to each class. */ /* sym_k_DtEditor_object */ static unsigned char object_class_vec1[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_DtHelpDialog_object */ static unsigned char object_class_vec2[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_DtHelpQuickDialog_object */ static unsigned char object_class_vec3[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_DtMenuButton_object */ static unsigned char object_class_vec4[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_DtPrintSetupBox_object */ static unsigned char object_class_vec5[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_DtPrintSetupDialog_object */ static unsigned char object_class_vec6[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_DtTerm_object */ static unsigned char object_class_vec7[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_DtTermPrimitive_object */ static unsigned char object_class_vec8[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmArrowButton_object */ static unsigned char object_class_vec9[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmArrowButtonGadget_object */ static unsigned char object_class_vec10[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmBulletinBoard_object */ static unsigned char object_class_vec11[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmBulletinBoardDialog_object */ static unsigned char object_class_vec12[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmButtonBox_object */ static unsigned char object_class_vec13[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmCascadeButton_object */ static unsigned char object_class_vec14[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmCascadeButtonGadget_object */ static unsigned char object_class_vec15[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmCheckBox_object */ static unsigned char object_class_vec16[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmColorSelector_object */ static unsigned char object_class_vec17[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmColumn_object */ static unsigned char object_class_vec18[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmComboBox_object */ static unsigned char object_class_vec19[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmCommand_object */ static unsigned char object_class_vec20[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmCommandDialog_object */ static unsigned char object_class_vec21[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmContainer_object */ static unsigned char object_class_vec22[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmDataField_object */ static unsigned char object_class_vec23[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmDialogShell_object */ static unsigned char object_class_vec24[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmDrawingArea_object */ static unsigned char object_class_vec25[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmDrawnButton_object */ static unsigned char object_class_vec26[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmDropDown_object */ static unsigned char object_class_vec27[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmErrorDialog_object */ static unsigned char object_class_vec28[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmFileSelectionBox_object */ static unsigned char object_class_vec29[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmFileSelectionDialog_object */ static unsigned char object_class_vec30[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmFontSelector_object */ static unsigned char object_class_vec31[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmForm_object */ static unsigned char object_class_vec32[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmFormDialog_object */ static unsigned char object_class_vec33[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmFrame_object */ static unsigned char object_class_vec34[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmIconBox_object */ static unsigned char object_class_vec35[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmIconButton_object */ static unsigned char object_class_vec36[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmIconGadget_object */ static unsigned char object_class_vec37[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmInformationDialog_object */ static unsigned char object_class_vec38[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmLabel_object */ static unsigned char object_class_vec39[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmLabelGadget_object */ static unsigned char object_class_vec40[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmList_object */ static unsigned char object_class_vec41[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmMainWindow_object */ static unsigned char object_class_vec42[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmMenuBar_object */ static unsigned char object_class_vec43[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmMenuShell_object */ static unsigned char object_class_vec44[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmMessageBox_object */ static unsigned char object_class_vec45[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmMessageDialog_object */ static unsigned char object_class_vec46[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmMultiList_object */ static unsigned char object_class_vec47[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmNotebook_object */ static unsigned char object_class_vec48[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmOptionMenu_object */ static unsigned char object_class_vec49[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmOutline_object */ static unsigned char object_class_vec50[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmPaned_object */ static unsigned char object_class_vec51[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmPanedWindow_object */ static unsigned char object_class_vec52[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmPopupMenu_object */ static unsigned char object_class_vec53[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmPromptDialog_object */ static unsigned char object_class_vec54[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmPulldownMenu_object */ static unsigned char object_class_vec55[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmPushButton_object */ static unsigned char object_class_vec56[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmPushButtonGadget_object */ static unsigned char object_class_vec57[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmQuestionDialog_object */ static unsigned char object_class_vec58[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmRadioBox_object */ static unsigned char object_class_vec59[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmRenderTable_object */ static unsigned char object_class_vec60[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmRendition_object */ static unsigned char object_class_vec61[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRenderTable_object) | 0, 0, 0, 0, 0}; /* sym_k_XmRowColumn_object */ static unsigned char object_class_vec62[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmScale_object */ static unsigned char object_class_vec63[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmScrollBar_object */ static unsigned char object_class_vec64[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmScrolledList_object */ static unsigned char object_class_vec65[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmScrolledText_object */ static unsigned char object_class_vec66[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmScrolledWindow_object */ static unsigned char object_class_vec67[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmSelectionBox_object */ static unsigned char object_class_vec68[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmSelectionDialog_object */ static unsigned char object_class_vec69[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmSeparator_object */ static unsigned char object_class_vec70[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmSeparatorGadget_object */ static unsigned char object_class_vec71[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmSimpleSpinBox_object */ static unsigned char object_class_vec72[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmSpinBox_object */ static unsigned char object_class_vec73[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmTab_object */ static unsigned char object_class_vec74[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabList_object) | 0, 0, 0}; /* sym_k_XmTabBox_object */ static unsigned char object_class_vec75[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmTabList_object */ static unsigned char object_class_vec76[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmRendition_object) | 0, 0, 0, 0, 0}; /* sym_k_XmTabStack_object */ static unsigned char object_class_vec77[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmTearOffButton_object */ static unsigned char object_class_vec78[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmTemplateDialog_object */ static unsigned char object_class_vec79[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmText_object */ static unsigned char object_class_vec80[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmTextField_object */ static unsigned char object_class_vec81[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmToggleButton_object */ static unsigned char object_class_vec82[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmToggleButtonGadget_object */ static unsigned char object_class_vec83[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmTree_object */ static unsigned char object_class_vec84[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmWarningDialog_object */ static unsigned char object_class_vec85[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmWorkArea_object */ static unsigned char object_class_vec86[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_XmWorkingDialog_object */ static unsigned char object_class_vec87[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* sym_k_user_defined_object */ static unsigned char object_class_vec88[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, _BIT_MASK(sym_k_user_defined_object) | 0}; /* * Table of bit vectors accessed by sym_k_..._object */ static unsigned char *allowed_control_table_vec[] = { NULL, /* UNUSED */ object_class_vec1, object_class_vec2, object_class_vec3, object_class_vec4, object_class_vec5, object_class_vec6, object_class_vec7, object_class_vec8, object_class_vec9, object_class_vec10, object_class_vec11, object_class_vec12, object_class_vec13, object_class_vec14, object_class_vec15, object_class_vec16, object_class_vec17, object_class_vec18, object_class_vec19, object_class_vec20, object_class_vec21, object_class_vec22, object_class_vec23, object_class_vec24, object_class_vec25, object_class_vec26, object_class_vec27, object_class_vec28, object_class_vec29, object_class_vec30, object_class_vec31, object_class_vec32, object_class_vec33, object_class_vec34, object_class_vec35, object_class_vec36, object_class_vec37, object_class_vec38, object_class_vec39, object_class_vec40, object_class_vec41, object_class_vec42, object_class_vec43, object_class_vec44, object_class_vec45, object_class_vec46, object_class_vec47, object_class_vec48, object_class_vec49, object_class_vec50, object_class_vec51, object_class_vec52, object_class_vec53, object_class_vec54, object_class_vec55, object_class_vec56, object_class_vec57, object_class_vec58, object_class_vec59, object_class_vec60, object_class_vec61, object_class_vec62, object_class_vec63, object_class_vec64, object_class_vec65, object_class_vec66, object_class_vec67, object_class_vec68, object_class_vec69, object_class_vec70, object_class_vec71, object_class_vec72, object_class_vec73, object_class_vec74, object_class_vec75, object_class_vec76, object_class_vec77, object_class_vec78, object_class_vec79, object_class_vec80, object_class_vec81, object_class_vec82, object_class_vec83, object_class_vec84, object_class_vec85, object_class_vec86, object_class_vec87, object_class_vec88, }; externaldef(uil_sym_glbl) unsigned char **allowed_control_table = allowed_control_table_vec; motif-2.3.8/tools/wml/wmluiltok.l0000644000175000017500000000722113066310437013733 00000000000000%{ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #if defined(__STDC__) #include #include #endif #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ /* * lex program to construct token data for WML to generate token * table data. * * stdin is the file Uil.y * * it is searched for each occurance of a line starting with '%token' * when found various fields are extracted. * * when Uil.y has been scanned the collected data is written * to stdout. */ %} %a 9999 /* transitions */ %{ #include #define TRUE 1 #define FALSE 0 #define MAX_SYN 10 #ifdef yywrap #undef yywrap #endif typedef struct _token { char * name; char * id; char * class; int num_syn; char * syn[MAX_SYN]; } TokenRec, *Token; TokenRec token[1000]; TokenRec temp; void add_token (); int yywrap (); int phase = 0; int keyword_count; int line_num = 0; int in_comment = 0; int in_include = 0; int in_token = 0; int state = 0; int used = 0; %} %% [\n] { if (in_token == TRUE) { add_token (&temp); } in_token = FALSE; line_num++; } [ \t] { /* swallow */ } "/\*" { /* swallow */ } ^%token { in_token = TRUE; state = 0; } [a-zA-Z0-9_]+ { if (in_token == TRUE) { switch (state) { case 0: temp.name = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); temp.num_syn = 0; break; case 1: temp.id = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); break; case 2: temp.class = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); break; case 3: temp.syn[temp.num_syn] = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); temp.num_syn++; if (temp.num_syn > MAX_SYN) printf ( "ERROR, too many synonyms, line %d\n", line_num); break; } state++; } } . { /* swallow */ } %% void add_token (t) /* keep sorted by name */ Token t; { int i, j; for (j=0; jname) > 0) /* goes here */ { for (i=used++; i>j; i--) /* make hole */ token[i] = token[i-1]; token[j] = *t; /* insert it */ return; } } /* * if we get there then it goes at the end of the list */ token[used++] = *t; } int yywrap () { int i; for (i=0; i #endif /* * This module contains routines responsible for writing the .h files which * define the UIL lexer's keyword (token) tables. All files are written * into the current directory. * * Input: * The resolved objects * .dat files required to specify objects defined in Uil.y: * keyword.dat * reserved.dat * * Output: * UilKeyTab.h * */ #include "wml.h" #if defined(__STDC__) #include #include #endif #include /* * Routines used only in this module */ void wmlKeyWBuildTables (); void wmlKeyWClassTokens (); void wmlKeyWGrammarTokens (); int wmlKeyWGrammarClass (); void wmlKeyWArgTokens (); void wmlKeyWReasonTokens (); void wmlKeyWCharsetTokens (); void wmlKeyWEnumvalTokens (); void wmlKeyWChildTokens (); void wmlKeyWMakeTokens (); void wmlOutputUilKeyTab (); void wmlOutputUilKeyTabBody (); void wmlTokenClassString (); void wmlTokenSymKString (); void wmlTokenTokenString (); void wmlOutputUilTokName (); /* * globals */ static char *canned_warn = "/*\n\ **\tThis file is automatically generated. Do not edit it by hand.\n\ **/\n\n"; #define GrTokenMax 200 /* limit on grammar tokens */ static int grtok_max_val = 0; static WmlGrammarTokenPtr grtok_vec[GrTokenMax]; /* * Output control routine */ void wmlOutputKeyWordFiles () { wmlKeyWBuildTables (); wmlOutputUilKeyTab (); wmlOutputUilTokName (); } /* * Routine to construct token tables for building UilKeyTab.h * * This routine constructs token entries for each token class which appears * in UilKeyTab.h (the token classes are defined in UilKeyDef.h). These * tokens are defined both by WML objects in object vectors, and by * tokens defined in Uil.y. */ void wmlKeyWBuildTables () { int ndx; /* * Initialize the token vectors */ wmlInitHList (wml_tok_sens_ptr, 1000, TRUE); wmlInitHList (wml_tok_insens_ptr, 1000, TRUE); for ( ndx=0 ; ndx true/TRUE * UILFALSE -> false/FALSE * UILfile -> file/FILE * UILeof -> eof/EOF */ infil = fopen ("tokens.dat", "r"); if ( infil == NULL ) { printf ("\nCouldn't open tokens.dat"); return; } while ( TRUE ) { scanres = fscanf (infil, "%s %d %s", token, &tokval, class); if ( scanres == EOF ) break; if ( scanres != 3 ) { printf ("\nBadly formatted at line %d in tokens.dat", lineno); continue; } lineno += 1; /* * Convert the token class, and construct a grammar token. */ grtok = (WmlGrammarTokenPtr) malloc(sizeof(WmlGrammarToken)); grtok->class = wmlKeyWGrammarClass (class); grtok->token = wmlAllocateString (token); grtok->val = tokval; /* * Save the token in the grammar token vector, indexed by its value * (for UilTokName.h) */ if ( grtok->val < GrTokenMax ) { grtok_vec[grtok->val] = grtok; if ( grtok->val > grtok_max_val ) grtok_max_val = grtok->val; } else printf ("\nToken id %d for %s exceed GrTokenMax", grtok->val, grtok->token); /* * Enter tokens which appear in the keyword tables as keyword tokens. * These have their lower case names entered as the case-insensitive * keyword token string. Do special token literal mapping. */ switch ( grtok->class ) { case WmlTokenClassKeyword: case WmlTokenClassReserved: strcpy (sens_name, grtok->token); for ( ndx=0 ; ndx<(int)strlen(sens_name) ; ndx++ ) sens_name[ndx] = _lower(sens_name[ndx]); if ( strcmp(sens_name,"uiltrue") == 0 ) strcpy (sens_name, "true"); if ( strcmp(sens_name,"uilfalse") == 0 ) strcpy (sens_name, "false"); if ( strcmp(sens_name,"uilfile") == 0 ) strcpy (sens_name, "file"); if ( strcmp(sens_name,"uileof") == 0 ) strcpy (sens_name, "eof"); wmlKeyWMakeTokens (sens_name, grtok->class, (ObjectPtr)grtok); } } fclose (infil); } /* * This routine translates a string identifying a token class into * its matching internal literal. */ int wmlKeyWGrammarClass (token) char *token; { if ( strcmp(token,"argument") == 0 ) return WmlTokenClassArgument; if ( strcmp(token,"charset") == 0 ) return WmlTokenClassCharset; if ( strcmp(token,"color") == 0 ) return WmlTokenClassColor; if ( strcmp(token,"enumval") == 0 ) return WmlTokenClassEnumval; if ( strcmp(token,"font") == 0 ) return WmlTokenClassFont; if ( strcmp(token,"identifier") == 0 ) return WmlTokenClassIdentifier; if ( strcmp(token,"keyword") == 0 ) return WmlTokenClassKeyword; if ( strcmp(token,"literal") == 0 ) return WmlTokenClassLiteral; if ( strcmp(token,"reason") == 0 ) return WmlTokenClassReason; if ( strcmp(token,"reserved") == 0 ) return WmlTokenClassReserved; if ( strcmp(token,"special") == 0 ) return WmlTokenClassSpecial; if ( strcmp(token,"unused") == 0 ) return WmlTokenClassUnused; if ( strcmp(token,"class") == 0 ) return WmlTokenClassClass; if (strcmp(token,"child") == 0) return WmlTokenClassChild; printf ("\nUnrecognized token class %s", token); return 0; } /* * Routine to process the class objects and enter them in the token tables. * Aliases are also entered, under their own names. */ void wmlKeyWClassTokens () { int ndx; /* loop index */ WmlClassDefPtr clsobj; /* class object */ WmlSynClassDefPtr synobj; /* syntactic object */ int alias_ndx; /* alias loop index */ /* * Make tokens for all class entries */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; synobj = clsobj->syndef; wmlKeyWMakeTokens (synobj->name, WmlTokenClassClass, (ObjectPtr)clsobj); for ( alias_ndx=0 ; alias_ndxalias_cnt ; alias_ndx++ ) wmlKeyWMakeTokens (synobj->alias_list[alias_ndx], WmlTokenClassClass, (ObjectPtr)clsobj); } } /* * Routine to process the argument objects and enter them in the token tables. * Aliases are also entered, under their own names. */ void wmlKeyWArgTokens () { int ndx; /* loop index */ WmlResourceDefPtr resobj; /* resource object */ WmlSynResourceDefPtr synobj; /* syntactic object */ int alias_ndx; /* alias loop index */ /* * Make tokens for all argument entries */ for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; synobj = resobj->syndef; wmlKeyWMakeTokens (synobj->name, WmlTokenClassArgument, (ObjectPtr)resobj); for ( alias_ndx=0 ; alias_ndxalias_cnt ; alias_ndx++ ) wmlKeyWMakeTokens (synobj->alias_list[alias_ndx], WmlTokenClassArgument, (ObjectPtr)resobj); } } /* * Routine to process the reason objects and enter them in the token tables. */ void wmlKeyWReasonTokens () { int ndx; /* loop index */ WmlResourceDefPtr resobj; /* resource object */ WmlSynResourceDefPtr synobj; /* syntactic object */ int alias_ndx; /* alias loop index */ /* * Make tokens for all reason entries */ for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr; synobj = resobj->syndef; wmlKeyWMakeTokens (synobj->name, WmlTokenClassReason, (ObjectPtr)resobj); for ( alias_ndx=0 ; alias_ndxalias_cnt ; alias_ndx++ ) wmlKeyWMakeTokens (synobj->alias_list[alias_ndx], WmlTokenClassReason, (ObjectPtr)resobj); } } /* * Routine to process the child objects and enter them in the token tables. */ void wmlKeyWChildTokens () { int ndx; /* loop index */ WmlChildDefPtr childobj; /* child object */ WmlSynChildDefPtr synobj; /* syntactic object */ /* * Make tokens for all child entries */ for ( ndx=0 ; ndxcnt ; ndx++ ) { childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr; synobj = childobj->syndef; wmlKeyWMakeTokens (synobj->name, WmlTokenClassChild, (ObjectPtr)childobj); } } /* * Routine to process the charset objects and enter them in the token tables. */ void wmlKeyWCharsetTokens () { int ndx; /* loop index */ WmlCharSetDefPtr csobj; /* character set object */ WmlSynCharSetDefPtr synobj; /* syntactic object */ int alias_ndx; /* alias loop index */ /* * Make tokens for all charset entries */ for ( ndx=0 ; ndxcnt ; ndx++ ) { csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; synobj = csobj->syndef; wmlKeyWMakeTokens (synobj->name, WmlTokenClassCharset, (ObjectPtr)csobj); for ( alias_ndx=0 ; alias_ndxalias_cnt ; alias_ndx++ ) wmlKeyWMakeTokens (synobj->alias_list[alias_ndx], WmlTokenClassCharset, (ObjectPtr)csobj); } } /* * Routine to process the enumval objects and enter them in the token tables. */ void wmlKeyWEnumvalTokens () { int ndx; /* loop index */ WmlEnumValueDefPtr esobj; /* enumeration value object */ WmlSynEnumValueDefPtr synobj; /* syntactic object */ /* * Make tokens for all enumval entries */ for ( ndx=0 ; ndxcnt ; ndx++ ) { esobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr; synobj = esobj->syndef; wmlKeyWMakeTokens (synobj->name, WmlTokenClassEnumval, (ObjectPtr)esobj); } } /* * Routine to create tokens and enter them in the token list. * * This routine constructs a case-sensitive and a case-insensitive token * and enters them the token vectors. */ void wmlKeyWMakeTokens (sens_name, class, obj) char *sens_name; int class; ObjectPtr obj; { WmlKeyWTokenPtr senstok; /* case-sensitive token */ WmlKeyWTokenPtr insenstok; /* case-insensitive token */ char insens_name[100]; int ndx; /* * Create both tokens, with one having an upper-case name. The names are * entered only in the order vector, not in the token itself. */ senstok = (WmlKeyWTokenPtr) malloc (sizeof(WmlKeyWToken)); insenstok = (WmlKeyWTokenPtr) malloc (sizeof(WmlKeyWToken)); senstok->class = class; senstok->objdef = obj; insenstok->class = class; insenstok->objdef = obj; strcpy (insens_name, sens_name); for ( ndx=0 ; ndx<(int)strlen(insens_name) ; ndx++ ) insens_name[ndx] = _upper (insens_name[ndx]); wmlInsertInKeyList(wml_tok_sens_ptr, sens_name, senstok); wmlInsertInKeyList(wml_tok_insens_ptr, insens_name, insenstok); } /* * Routine to output UilKeyTab.h * * This routine dumps the tokens defined in the token tables into * UilKeyTab.h. Both the case-sensitive and case-insensitive token * lists are used. */ void wmlOutputUilKeyTab () { char *canned1 = "\n/* case sensitive keyword table */\n\ static key_keytable_entry_type key_table_vec[] =\n\ {\n"; char *canned2 = " };\n\ externaldef(uil_sym_glbl) key_keytable_entry_type *key_table =\n\ \t\tkey_table_vec;\n\n\ /* Maximum length of a keyword, and table size */\n\ externaldef(uil_sym_glbl) int key_k_keyword_max_length = %d;\n\ externaldef(uil_sym_glbl) int key_k_keyword_count = %d;\n\n\ /* case insensitive keyword table */\n\ static key_keytable_entry_type key_table_case_ins_vec[] =\n\ {\n"; char *canned3 = " };\n\ externaldef(uil_sym_glbl) key_keytable_entry_type *key_table_case_ins =\n\ \t\tkey_table_case_ins_vec;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ int maxlen = 0; /* max keyword length */ int maxkey = 0; /* # entries in keyword table */ /* * Open the output file. */ outfil = fopen ("UilKeyTab.h", "w"); if ( outfil == NULL ) { printf ("\nCouldn't open UilKeyTab.h"); return; } fprintf (outfil, canned_warn); /* * Print the case sensitive and insensitive tables */ fprintf (outfil, canned1); wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey); fprintf (outfil, canned2, maxlen, maxkey); wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey); fprintf (outfil, canned3); /* * close the output file */ printf ("\nCreated UilKeyTab.h"); fclose (outfil); } /* * Routine to output the body of a keyword table */ void wmlOutputUilKeyTabBody (outfil, tokvec, maxlen, maxkey) FILE *outfil; DynamicHandleListDefPtr tokvec; int *maxlen; int *maxkey; { int ndx; /* loop index */ WmlKeyWTokenPtr tok; /* current token */ char *tokstg; /* string for token (keyword) */ char tkclass[100]; /* token class string */ char tksym[100]; /* token sym_k string */ char tktoken[100]; /* token tkn_k_num string */ /* * Loop over all tokens, and put out an entry for each. */ for ( ndx=0 ; ndxcnt ; ndx++ ) { tok = (WmlKeyWTokenPtr) tokvec->hvec[ndx].objptr; tokstg = tokvec->hvec[ndx].objname; wmlTokenClassString (tkclass, tok); wmlTokenSymKString (tksym, tok); wmlTokenTokenString (tktoken, tok); fprintf (outfil, " {%s, %s, %d, %s, \"%s\"},\n", tkclass, tksym, strlen(tokstg), tktoken, tokstg); if ( (int)strlen(tokstg) > *maxlen ) *maxlen = strlen (tokstg); *maxkey += 1; } } /* * Routine to return the string for a token class, tkn_k_class_... */ void wmlTokenClassString (dststg, tok) char *dststg; WmlKeyWTokenPtr tok; { switch ( tok->class ) { case WmlTokenClassArgument: strcpy (dststg, "tkn_k_class_argument"); return; case WmlTokenClassCharset: strcpy (dststg, "tkn_k_class_charset"); return; case WmlTokenClassEnumval: strcpy (dststg, "tkn_k_class_enumval"); return; case WmlTokenClassKeyword: strcpy (dststg, "tkn_k_class_keyword"); return; case WmlTokenClassReason: strcpy (dststg, "tkn_k_class_reason"); return; case WmlTokenClassReserved: strcpy (dststg, "tkn_k_class_reserved"); return; case WmlTokenClassClass: strcpy (dststg, "tkn_k_class_class"); return; case WmlTokenClassChild: strcpy (dststg, "tkn_k_class_child"); return; } } /* * Routine to return the string for a sym_k_... for some object */ void wmlTokenSymKString (dststg, tok) char *dststg; WmlKeyWTokenPtr tok; { WmlClassDefPtr clsobj; /* class object */ WmlResourceDefPtr resobj; /* resource object */ WmlCharSetDefPtr csobj; /* character set object */ WmlEnumValueDefPtr esobj; /* enumeration value object */ WmlChildDefPtr chobj; /* child object */ switch ( tok->class ) { case WmlTokenClassArgument: resobj = (WmlResourceDefPtr) tok->objdef; sprintf (dststg, "sym_k_%s_arg", resobj->tkname); return; case WmlTokenClassCharset: csobj = (WmlCharSetDefPtr) tok->objdef; sprintf (dststg, "sym_k_%s_charset", csobj->syndef->name); return; case WmlTokenClassEnumval: esobj = (WmlEnumValueDefPtr) tok->objdef; sprintf (dststg, "sym_k_%s_enumval", esobj->syndef->name); return; case WmlTokenClassKeyword: strcpy (dststg, "0"); return; case WmlTokenClassReason: resobj = (WmlResourceDefPtr) tok->objdef; sprintf (dststg, "sym_k_%s_reason", resobj->tkname); return; case WmlTokenClassReserved: strcpy (dststg, "0"); return; case WmlTokenClassClass: clsobj = (WmlClassDefPtr) tok->objdef; sprintf (dststg, "sym_k_%s_object", clsobj->tkname); return; case WmlTokenClassChild: chobj = (WmlChildDefPtr) tok->objdef; sprintf (dststg, "sym_k_%s_child", chobj->tkname); return; } } /* * Routine to return the string for a token number, tkn_k_num_... */ void wmlTokenTokenString (dststg, tok) char *dststg; WmlKeyWTokenPtr tok; { WmlGrammarTokenPtr grtok; /* grammar token */ switch ( tok->class ) { case WmlTokenClassArgument: strcpy (dststg, "ARGUMENT_NAME"); return; case WmlTokenClassCharset: strcpy (dststg, "CHARSET_NAME"); return; case WmlTokenClassEnumval: strcpy (dststg, "ENUMVAL_NAME"); return; case WmlTokenClassReason: strcpy (dststg, "REASON_NAME"); return; case WmlTokenClassKeyword: case WmlTokenClassReserved: grtok = (WmlGrammarTokenPtr) tok->objdef; strcpy (dststg, grtok->token); return; case WmlTokenClassClass: strcpy (dststg, "CLASS_NAME"); return; case WmlTokenClassChild: strcpy (dststg, "CHILD_NAME"); return; } } /* * routine to output UilTokName.h */ void wmlOutputUilTokName () { char *canned1 = "/*\tToken name table */\n\ static char *tok_token_name_table_vec[] = \n\ {\n"; char *canned2 = " };\n\ externaldef(uil_sym_glbl) char **tok_token_name_table =\n\ \t\ttok_token_name_table_vec;\n\n\ /*\tNumber of entries in table */\n\ externaldef(uil_sym_glbl) int tok_num_tokens = %d;\n"; FILE *outfil; /* output file */ int ndx; /* loop index */ WmlGrammarTokenPtr grtok; /* current grammar token */ /* * Open the output file. */ outfil = fopen ("UilTokName.h", "w"); if ( outfil == NULL ) { printf ("\nCouldn't open UilTokName.h"); return; } fprintf (outfil, canned_warn); fprintf (outfil, canned1); /* * Print the token name entries * Note: vector size is max_val + 1 for zeroth token */ for ( ndx=0 ; ndxtoken); else fprintf (outfil, " \"UNKNOWN_TOKEN\",\n"); } /* * close the output file */ fprintf (outfil, canned2, grtok_max_val+1); printf ("\nCreated UilTokName.h"); fclose (outfil); } motif-2.3.8/tools/wml/Makefile.in0000644000175000017500000006665613211512767013617 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = wml$(EXEEXT) wmluiltok$(EXEEXT) wmldbcreate$(EXEEXT) subdir = tools/wml ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) $(wml_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libwml_a_AR = $(AR) $(ARFLAGS) libwml_a_LIBADD = am_libwml_a_OBJECTS = wmlparse.$(OBJEXT) wml.$(OBJEXT) \ wmloutkey.$(OBJEXT) wmlouth.$(OBJEXT) wmloutmm.$(OBJEXT) \ wmloutp1.$(OBJEXT) wmlresolve.$(OBJEXT) wmlsynbld.$(OBJEXT) \ wmlutils.$(OBJEXT) libwml_a_OBJECTS = $(am_libwml_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) am_wml_OBJECTS = wml.$(OBJEXT) wml_OBJECTS = $(am_wml_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = wmldbcreate_SOURCES = $(srcdir)/wmldbcreate.c wmldbcreate_OBJECTS = wmldbcreate.$(OBJEXT) wmldbcreate_DEPENDENCIES = ../../lib/Xm/libXm.la am_wmluiltok_OBJECTS = wmluiltok.$(OBJEXT) wmluiltok_OBJECTS = $(am_wmluiltok_OBJECTS) wmluiltok_DEPENDENCIES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = SOURCES = $(libwml_a_SOURCES) $(wml_SOURCES) $(srcdir)/wmldbcreate.c \ $(wmluiltok_SOURCES) DIST_SOURCES = $(libwml_a_SOURCES) $(wml_SOURCES) \ $(srcdir)/wmldbcreate.c $(wmluiltok_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(wmldir)" HEADERS = $(noinst_HEADERS) $(wml_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/ylwrap README wmlparse.c wmlparse.h wmluiltok.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README wmllex.c wmllex.l motif.wml Uil.y Uil.c Uil.h UilLexPars.h UilLexPars.c AM_YFLAGS = -d #AM_LFLAGS = -l WMLTARGETS = UilConst.h UilKeyTab.h \ UilSymArTa.h UilSymArTy.h UilSymCSet.h UilSymCtl.h \ UilSymEnum.h UilSymGen.h UilSymNam.h UilSymRArg.h \ UilSymReas.h UilTokName.h UilUrmClas.h UilSymChCl.h \ UilSymChTa.h TABLE = motif.wml WMDTABLE = motif.wmd WMLTOOLS = wml wmluiltok REPORT = wml.report wmldir = $(includedir)/uil wml_HEADERS = UilDBDef.h noinst_HEADERS = wml.h wmlparse.h $(WMLTARGETS) wmluiltok_SOURCES = wmluiltok.l wmluiltok_LDADD = @LEXLIB@ wml_SOURCES = wml.c wml_LDADD = -L. -lwml wml_DEPENDENCIES = libwml.a wmldbcreate_LDADD = ../../lib/Xm/libXm.la INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} noinst_LIBRARIES = libwml.a libwml_a_SOURCES = wmlparse.y wml.c wmloutkey.c wmlouth.c wmloutmm.c wmloutp1.c wmlresolve.c wmlsynbld.c wmlutils.c all: all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/wml/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/wml/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) wmlparse.h: wmlparse.c @if test ! -f $@; then rm -f wmlparse.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) wmlparse.c; else :; fi libwml.a: $(libwml_a_OBJECTS) $(libwml_a_DEPENDENCIES) $(EXTRA_libwml_a_DEPENDENCIES) $(AM_V_at)-rm -f libwml.a $(AM_V_AR)$(libwml_a_AR) libwml.a $(libwml_a_OBJECTS) $(libwml_a_LIBADD) $(AM_V_at)$(RANLIB) libwml.a clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list wml$(EXEEXT): $(wml_OBJECTS) $(wml_DEPENDENCIES) $(EXTRA_wml_DEPENDENCIES) @rm -f wml$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wml_OBJECTS) $(wml_LDADD) $(LIBS) wmldbcreate$(EXEEXT): $(wmldbcreate_OBJECTS) $(wmldbcreate_DEPENDENCIES) $(EXTRA_wmldbcreate_DEPENDENCIES) @rm -f wmldbcreate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wmldbcreate_OBJECTS) $(wmldbcreate_LDADD) $(LIBS) wmluiltok$(EXEEXT): $(wmluiltok_OBJECTS) $(wmluiltok_DEPENDENCIES) $(EXTRA_wmluiltok_DEPENDENCIES) @rm -f wmluiltok$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wmluiltok_OBJECTS) $(wmluiltok_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmldbcreate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmlouth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmloutkey.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmloutmm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmloutp1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmlparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmlresolve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmlsynbld.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmluiltok.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmlutils.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< wmldbcreate.o: $(srcdir)/wmldbcreate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT wmldbcreate.o -MD -MP -MF $(DEPDIR)/wmldbcreate.Tpo -c -o wmldbcreate.o `test -f '$(srcdir)/wmldbcreate.c' || echo '$(srcdir)/'`$(srcdir)/wmldbcreate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wmldbcreate.Tpo $(DEPDIR)/wmldbcreate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/wmldbcreate.c' object='wmldbcreate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o wmldbcreate.o `test -f '$(srcdir)/wmldbcreate.c' || echo '$(srcdir)/'`$(srcdir)/wmldbcreate.c wmldbcreate.obj: $(srcdir)/wmldbcreate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT wmldbcreate.obj -MD -MP -MF $(DEPDIR)/wmldbcreate.Tpo -c -o wmldbcreate.obj `if test -f '$(srcdir)/wmldbcreate.c'; then $(CYGPATH_W) '$(srcdir)/wmldbcreate.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/wmldbcreate.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/wmldbcreate.Tpo $(DEPDIR)/wmldbcreate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/wmldbcreate.c' object='wmldbcreate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o wmldbcreate.obj `if test -f '$(srcdir)/wmldbcreate.c'; then $(CYGPATH_W) '$(srcdir)/wmldbcreate.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/wmldbcreate.c'; fi` .l.c: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-wmlHEADERS: $(wml_HEADERS) @$(NORMAL_INSTALL) @list='$(wml_HEADERS)'; test -n "$(wmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(wmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(wmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(wmldir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(wmldir)" || exit $$?; \ done uninstall-wmlHEADERS: @$(NORMAL_UNINSTALL) @list='$(wml_HEADERS)'; test -n "$(wmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(wmldir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(wmldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f wmlparse.c -rm -f wmlparse.h -rm -f wmluiltok.c -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local \ clean-noinstLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-wmlHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-wmlHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-local clean-noinstLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-wmlHEADERS installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-wmlHEADERS .PRECIOUS: Makefile wmlparse.c: wmllex.c wmllex.c: wmllex.l wmlsynbld.c: wmlparse.h $(srcdir)/wmldbcreate.c: $(WMLTARGETS) UilLexPars.h UilLexPars.h: UilLexPars.c UilLexPars.c: Uil.c $(LN_S) Uil.h UilLexPars.h $(LN_S) Uil.c UilLexPars.c $(WMLTARGETS): wml-uil.mm wml-uil.mm: wmluiltok wml UilLexPars.c $(TABLE) $(RM) $(WMLTARGETS) wml.report wml-uil.mm ./wmluiltok <$(srcdir)/Uil.y >tokens.dat $(RM) wml-uil.mm ./wml $(srcdir)/$(TABLE) $(RM) tokens.dat all: motif.wmd motif.wmd: wmldbcreate ./wmldbcreate -o motif.wmd clean-local: $(RM) $(WMLTARGETS) $(WMDTABLE) $(REPORT) lex.yy.c libwml.a wml \ *.mm *.sdml *.txt wmlparse.c wmlparse.h wmluiltok wmllex.c \ tokens.dat DONE wmluiltok.c Uil.c Uil.h wml.report UilLexPars.[ch] ylwrap # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/tools/wml/UilSymReas.h0000644000175000017500000012712313211513006013726 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* * Bit vectors for each reason. The entries in the vector correspond * to each class. */ /* sym_k_DtNcancelCallback_reason */ static unsigned char reason_class_vec1[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcascadingCallback_reason */ static unsigned char reason_class_vec2[] = { _BIT_MASK(sym_k_DtMenuButton_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNcloseCallback_reason */ static unsigned char reason_class_vec3[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNclosePrintDisplayCallback_reason */ static unsigned char reason_class_vec4[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNhyperLinkCallback_reason */ static unsigned char reason_class_vec5[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNinputVerifyCallback_reason */ static unsigned char reason_class_vec6[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNoutputLogCallback_reason */ static unsigned char reason_class_vec7[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNprintCallback_reason */ static unsigned char reason_class_vec8[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsetupCallback_reason */ static unsigned char reason_class_vec9[] = { _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNstatusChangeCallback_reason */ static unsigned char reason_class_vec10[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNsubprocessTerminationCallback_reason */ static unsigned char reason_class_vec11[] = { _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtextDeselectCallback_reason */ static unsigned char reason_class_vec12[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_DtNtextSelectCallback_reason */ static unsigned char reason_class_vec13[] = { _BIT_MASK(sym_k_DtEditor_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_MrmNcreateCallback_reason */ static unsigned char reason_class_vec14[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRenderTable_object) | _BIT_MASK(sym_k_XmRendition_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTab_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabList_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNactivateCallback_reason */ static unsigned char reason_class_vec15[] = { 0, _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNapplyCallback_reason */ static unsigned char reason_class_vec16[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNarmCallback_reason */ static unsigned char reason_class_vec17[] = { 0, _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNbrowseSelectionCallback_reason */ static unsigned char reason_class_vec18[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNcancelCallback_reason */ static unsigned char reason_class_vec19[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNcascadingCallback_reason */ static unsigned char reason_class_vec20[] = { 0, _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcommandChangedCallback_reason */ static unsigned char reason_class_vec21[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNcommandEnteredCallback_reason */ static unsigned char reason_class_vec22[] = { 0, 0, _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNconvertCallback_reason */ static unsigned char reason_class_vec23[] = { _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | 0, _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | 0, 0}; /* sym_k_XmNdecrementCallback_reason */ static unsigned char reason_class_vec24[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNdefaultActionCallback_reason */ static unsigned char reason_class_vec25[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNdestinationCallback_reason */ static unsigned char reason_class_vec26[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNdestroyCallback_reason */ static unsigned char reason_class_vec27[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRenderTable_object) | _BIT_MASK(sym_k_XmRendition_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTab_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabList_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNdisarmCallback_reason */ static unsigned char reason_class_vec28[] = { 0, _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmDrawnButton_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | 0, 0, _BIT_MASK(sym_k_XmTearOffButton_object) | 0, _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNdoubleClickCallback_reason */ static unsigned char reason_class_vec29[] = { 0, 0, 0, 0, _BIT_MASK(sym_k_XmIconButton_object) | 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNdragCallback_reason */ static unsigned char reason_class_vec30[] = { 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNentryCallback_reason */ static unsigned char reason_class_vec31[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNexposeCallback_reason */ static unsigned char reason_class_vec32[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNextendedSelectionCallback_reason */ static unsigned char reason_class_vec33[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNfocusCallback_reason */ static unsigned char reason_class_vec34[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNfocusMovedCallback_reason */ static unsigned char reason_class_vec35[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNgainPrimaryCallback_reason */ static unsigned char reason_class_vec36[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNhelpCallback_reason */ static unsigned char reason_class_vec37[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmArrowButtonGadget_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | _BIT_MASK(sym_k_XmCascadeButtonGadget_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmIconGadget_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmLabelGadget_object) | _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmPushButtonGadget_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | _BIT_MASK(sym_k_XmSeparatorGadget_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNincrementCallback_reason */ static unsigned char reason_class_vec38[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNinputCallback_reason */ static unsigned char reason_class_vec39[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDrawingArea_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNitemFoundCallback_reason */ static unsigned char reason_class_vec40[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNitemNotFoundCallback_reason */ static unsigned char reason_class_vec41[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNlosePrimaryCallback_reason */ static unsigned char reason_class_vec42[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNlosingFocusCallback_reason */ static unsigned char reason_class_vec43[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmapCallback_reason */ static unsigned char reason_class_vec44[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNmodifyVerifyCallback_reason */ static unsigned char reason_class_vec45[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNmodifyVerifyCallbackWcs_reason */ static unsigned char reason_class_vec46[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNmotionVerifyCallback_reason */ static unsigned char reason_class_vec47[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrolledText_object) | 0, 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | 0, 0}; /* sym_k_XmNmultipleSelectionCallback_reason */ static unsigned char reason_class_vec48[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNnoMatchCallback_reason */ static unsigned char reason_class_vec49[] = { 0, 0, 0, _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, 0, 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, 0, 0, 0}; /* sym_k_XmNnodeStateBegEndCallback_reason */ static unsigned char reason_class_vec50[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNnodeStateCallback_reason */ static unsigned char reason_class_vec51[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNnodeStateChangedCallback_reason */ static unsigned char reason_class_vec52[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmOutline_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTree_object) | 0, 0}; /* sym_k_XmNokCallback_reason */ static unsigned char reason_class_vec53[] = { 0, 0, 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNoutlineChangedCallback_reason */ static unsigned char reason_class_vec54[] = { 0, 0, _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpageChangedCallback_reason */ static unsigned char reason_class_vec55[] = { 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmNotebook_object) | 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpageDecrementCallback_reason */ static unsigned char reason_class_vec56[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNpageIncrementCallback_reason */ static unsigned char reason_class_vec57[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNpictureErrorCallback_reason */ static unsigned char reason_class_vec58[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNpopdownCallback_reason */ static unsigned char reason_class_vec59[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNpopupCallback_reason */ static unsigned char reason_class_vec60[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuShell_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNpopupHandlerCallback_reason */ static unsigned char reason_class_vec61[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtMenuButton_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | _BIT_MASK(sym_k_DtTerm_object) | 0, _BIT_MASK(sym_k_DtTermPrimitive_object) | _BIT_MASK(sym_k_XmArrowButton_object) | _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | _BIT_MASK(sym_k_XmButtonBox_object) | _BIT_MASK(sym_k_XmCascadeButton_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColorSelector_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | _BIT_MASK(sym_k_XmContainer_object) | _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | _BIT_MASK(sym_k_XmDropDown_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | _BIT_MASK(sym_k_XmFontSelector_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmFrame_object) | _BIT_MASK(sym_k_XmIconBox_object) | _BIT_MASK(sym_k_XmIconButton_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | _BIT_MASK(sym_k_XmLabel_object) | 0, _BIT_MASK(sym_k_XmList_object) | _BIT_MASK(sym_k_XmMainWindow_object) | _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | _BIT_MASK(sym_k_XmMultiList_object) | 0, _BIT_MASK(sym_k_XmNotebook_object) | _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmOutline_object) | _BIT_MASK(sym_k_XmPaned_object) | _BIT_MASK(sym_k_XmPanedWindow_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmPushButton_object) | _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | _BIT_MASK(sym_k_XmSeparator_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | _BIT_MASK(sym_k_XmTabBox_object) | _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTearOffButton_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmTree_object) | _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNrealizeCallback_reason */ static unsigned char reason_class_vec62[] = { _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmDialogShell_object) | _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmPromptDialog_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | 0, _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNresizeCallback_reason */ static unsigned char reason_class_vec63[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDrawingArea_object) | _BIT_MASK(sym_k_XmDrawnButton_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNselectCallback_reason */ static unsigned char reason_class_vec64[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMultiList_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | 0, 0, 0}; /* sym_k_XmNselectionCallback_reason */ static unsigned char reason_class_vec65[] = { 0, 0, _BIT_MASK(sym_k_XmComboBox_object) | _BIT_MASK(sym_k_XmContainer_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsimpleCallback_reason */ static unsigned char reason_class_vec66[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNsingleSelectionCallback_reason */ static unsigned char reason_class_vec67[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmList_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | 0, 0, 0, 0}; /* sym_k_XmNtabSelectedCallback_reason */ static unsigned char reason_class_vec68[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabStack_object) | 0, 0, 0}; /* sym_k_XmNtearOffMenuActivateCallback_reason */ static unsigned char reason_class_vec69[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNtearOffMenuDeactivateCallback_reason */ static unsigned char reason_class_vec70[] = { 0, 0, _BIT_MASK(sym_k_XmCheckBox_object) | 0, 0, 0, _BIT_MASK(sym_k_XmMenuBar_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, 0, 0, _BIT_MASK(sym_k_XmWorkArea_object) | 0, 0}; /* sym_k_XmNtoBottomCallback_reason */ static unsigned char reason_class_vec71[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNtoTopCallback_reason */ static unsigned char reason_class_vec72[] = { 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmScrollBar_object) | 0, 0, 0, 0}; /* sym_k_XmNtraversalCallback_reason */ static unsigned char reason_class_vec73[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNtraverseObscuredCallback_reason */ static unsigned char reason_class_vec74[] = { 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmMainWindow_object) | 0, 0, 0, _BIT_MASK(sym_k_XmScrolledList_object) | _BIT_MASK(sym_k_XmScrolledText_object) | _BIT_MASK(sym_k_XmScrolledWindow_object) | 0, 0, 0, 0}; /* sym_k_XmNunmapCallback_reason */ static unsigned char reason_class_vec75[] = { _BIT_MASK(sym_k_DtEditor_object) | _BIT_MASK(sym_k_DtHelpDialog_object) | _BIT_MASK(sym_k_DtHelpQuickDialog_object) | _BIT_MASK(sym_k_DtPrintSetupBox_object) | _BIT_MASK(sym_k_DtPrintSetupDialog_object) | 0, _BIT_MASK(sym_k_XmBulletinBoard_object) | _BIT_MASK(sym_k_XmBulletinBoardDialog_object) | 0, _BIT_MASK(sym_k_XmCheckBox_object) | _BIT_MASK(sym_k_XmColumn_object) | _BIT_MASK(sym_k_XmCommand_object) | _BIT_MASK(sym_k_XmCommandDialog_object) | 0, _BIT_MASK(sym_k_XmErrorDialog_object) | _BIT_MASK(sym_k_XmFileSelectionBox_object) | _BIT_MASK(sym_k_XmFileSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmForm_object) | _BIT_MASK(sym_k_XmFormDialog_object) | _BIT_MASK(sym_k_XmInformationDialog_object) | 0, _BIT_MASK(sym_k_XmMenuBar_object) | _BIT_MASK(sym_k_XmMessageBox_object) | _BIT_MASK(sym_k_XmMessageDialog_object) | 0, _BIT_MASK(sym_k_XmOptionMenu_object) | _BIT_MASK(sym_k_XmPopupMenu_object) | _BIT_MASK(sym_k_XmPromptDialog_object) | _BIT_MASK(sym_k_XmPulldownMenu_object) | 0, _BIT_MASK(sym_k_XmQuestionDialog_object) | _BIT_MASK(sym_k_XmRadioBox_object) | _BIT_MASK(sym_k_XmRowColumn_object) | 0, _BIT_MASK(sym_k_XmSelectionBox_object) | _BIT_MASK(sym_k_XmSelectionDialog_object) | 0, _BIT_MASK(sym_k_XmTabStack_object) | _BIT_MASK(sym_k_XmTemplateDialog_object) | 0, _BIT_MASK(sym_k_XmWarningDialog_object) | _BIT_MASK(sym_k_XmWorkArea_object) | _BIT_MASK(sym_k_XmWorkingDialog_object) | 0, 0}; /* sym_k_XmNunselectCallback_reason */ static unsigned char reason_class_vec76[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, _BIT_MASK(sym_k_XmTabBox_object) | 0, 0, 0}; /* sym_k_XmNupdateShellCallback_reason */ static unsigned char reason_class_vec77[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNupdateTextCallback_reason */ static unsigned char reason_class_vec78[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNvalidateCallback_reason */ static unsigned char reason_class_vec79[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* sym_k_XmNvalueChangedCallback_reason */ static unsigned char reason_class_vec80[] = { 0, 0, _BIT_MASK(sym_k_XmDataField_object) | 0, _BIT_MASK(sym_k_XmFontSelector_object) | 0, 0, 0, 0, _BIT_MASK(sym_k_XmScale_object) | 0, _BIT_MASK(sym_k_XmScrollBar_object) | _BIT_MASK(sym_k_XmScrolledText_object) | 0, _BIT_MASK(sym_k_XmSimpleSpinBox_object) | _BIT_MASK(sym_k_XmSpinBox_object) | 0, _BIT_MASK(sym_k_XmText_object) | _BIT_MASK(sym_k_XmTextField_object) | _BIT_MASK(sym_k_XmToggleButton_object) | _BIT_MASK(sym_k_XmToggleButtonGadget_object) | 0, 0}; /* sym_k_XmNverifyTextCallback_reason */ static unsigned char reason_class_vec81[] = { 0, 0, 0, _BIT_MASK(sym_k_XmDropDown_object) | 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* * Table of bit vectors accessed by sym_k_..._reason */ static unsigned char *allowed_reason_table_vec[] = { NULL, /* UNUSED */ reason_class_vec1, reason_class_vec2, reason_class_vec3, reason_class_vec4, reason_class_vec5, reason_class_vec6, reason_class_vec7, reason_class_vec8, reason_class_vec9, reason_class_vec10, reason_class_vec11, reason_class_vec12, reason_class_vec13, reason_class_vec14, reason_class_vec15, reason_class_vec16, reason_class_vec17, reason_class_vec18, reason_class_vec19, reason_class_vec20, reason_class_vec21, reason_class_vec22, reason_class_vec23, reason_class_vec24, reason_class_vec25, reason_class_vec26, reason_class_vec27, reason_class_vec28, reason_class_vec29, reason_class_vec30, reason_class_vec31, reason_class_vec32, reason_class_vec33, reason_class_vec34, reason_class_vec35, reason_class_vec36, reason_class_vec37, reason_class_vec38, reason_class_vec39, reason_class_vec40, reason_class_vec41, reason_class_vec42, reason_class_vec43, reason_class_vec44, reason_class_vec45, reason_class_vec46, reason_class_vec47, reason_class_vec48, reason_class_vec49, reason_class_vec50, reason_class_vec51, reason_class_vec52, reason_class_vec53, reason_class_vec54, reason_class_vec55, reason_class_vec56, reason_class_vec57, reason_class_vec58, reason_class_vec59, reason_class_vec60, reason_class_vec61, reason_class_vec62, reason_class_vec63, reason_class_vec64, reason_class_vec65, reason_class_vec66, reason_class_vec67, reason_class_vec68, reason_class_vec69, reason_class_vec70, reason_class_vec71, reason_class_vec72, reason_class_vec73, reason_class_vec74, reason_class_vec75, reason_class_vec76, reason_class_vec77, reason_class_vec78, reason_class_vec79, reason_class_vec80, reason_class_vec81, }; externaldef(uil_sym_glbl) unsigned char **allowed_reason_table = allowed_reason_table_vec; motif-2.3.8/tools/wml/UilSymChCl.h0000644000175000017500000000246213211513006013643 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* Table of the class type of children The table is indexed by child with each entry the permitted class for that child. */ static unsigned char child_class_table_vec[] = { 0, sym_k_XmPushButton_object, sym_k_XmArrowButton_object, sym_k_XmPushButton_object, sym_k_XmToggleButton_object, sym_k_XmToggleButton_object, sym_k_XmLabel_object, sym_k_XmScrolledList_object, sym_k_XmPushButton_object, sym_k_XmLabel_object, sym_k_XmText_object, sym_k_XmPushButton_object, sym_k_XmText_object, sym_k_XmPushButton_object, sym_k_XmScrollBar_object, sym_k_XmLabel_object, sym_k_XmScrolledList_object, sym_k_XmLabel_object, sym_k_XmList_object, sym_k_XmLabel_object, sym_k_XmPushButton_object, sym_k_XmCascadeButtonGadget_object, sym_k_XmLabelGadget_object, sym_k_XmLabel_object, sym_k_XmSeparator_object, sym_k_XmSeparator_object, sym_k_XmSeparator_object, sym_k_XmSeparator_object, sym_k_XmLabel_object, sym_k_XmTearOffButton_object, sym_k_XmText_object, sym_k_XmTextField_object, sym_k_XmLabel_object, sym_k_XmScrollBar_object, }; externaldef(uil_sym_glbl) unsigned char *child_class_table = child_class_table_vec; motif-2.3.8/tools/wml/UilLexPars.h0000644000175000017500000000447313211513006013723 00000000000000#define UILEOF 0 #define NAME 1 #define FONT_NAME 2 #define COLOR_NAME 3 #define ARGUMENT_NAME 4 #define REASON_NAME 5 #define CHARSET_NAME 6 #define ENUMVAL_NAME 7 #define CLASS_NAME 8 #define CHILD_NAME 96 #define UNS_FLOAT_LITERAL 9 #define COMP_STRING 10 #define CHAR_8_LITERAL 11 #define UNS_INT_LITERAL 12 #define LEFT_PAREN 13 #define RIGHT_PAREN 14 #define COLON 15 #define SEMICOLON 16 #define LEFT_BRACE 17 #define RIGHT_BRACE 18 #define COMMA 19 #define EQUAL_SIGN 20 #define NOT 21 #define PLUS 22 #define MINUS 23 #define AND 24 #define OR 25 #define XOR 26 #define MULTIPLY 27 #define DIVIDE 28 #define LEFT_SHIFT 29 #define RIGHT_SHIFT 30 #define LIST 31 #define IDENTIFIER 32 #define END 33 #define MODULE 34 #define UILTRUE 35 #define UILFALSE 36 #define INCLUDE 37 #define MACRO 38 #define ON 39 #define OFF 40 #define VALUE 41 #define ARGUMENTS 42 #define CALLBACKS 43 #define PROCEDURES 44 #define CONTROLS 45 #define PROCEDURE 46 #define OBJECT 47 #define OBJECTS 48 #define WIDGET 49 #define GADGET 50 #define FONT 51 #define ARGUMENT 52 #define REASON 53 #define PIXMAP 54 #define COLOR 55 #define NAMES 56 #define CHARACTER_SET 57 #define CASE_SENSITIVE 58 #define CASE_INSENSITIVE 59 #define VERSION 60 #define MANAGED 61 #define UNMANAGED 62 #define PRIVATE 63 #define IMPORTED 64 #define EXPORTED 65 #define UILFILE 66 #define STRING_TABLE 67 #define TRANSLATION_TABLE 68 #define COMPOUND_STRING 69 #define FONT_TABLE 70 #define ANY 71 #define STRING 72 #define BOOLEAN 73 #define ICON 74 #define RIGHT_TO_LEFT 75 #define BACKGROUND 76 #define FOREGROUND 77 #define COLOR_TABLE 78 #define FLOAT 79 #define INTEGER 80 #define CLASS_REC_NAME 81 #define ASCIZ_TABLE 82 #define INTEGER_TABLE 83 #define ASCIZ_STRING_TABLE 84 #define COMPOUND_STRING_TABLE 85 #define XBITMAPFILE 86 #define SEPARATE 87 #define SIXTEEN_BIT 88 #define POUND 89 #define KEYSYM 90 #define SINGLE_FLOAT 91 #define RGB 92 #define WIDE_CHARACTER 93 #define LOC_STRING 94 #define FONTSET 95 #define COMPOUND_STRING_COMPONENT 97 #define PIX 115 #define PIXEL 103 #define PIXELS 104 #define IN 98 #define INCH 105 #define INCHES 106 #define CM 99 #define CENTIMETER 107 #define CENTIMETERS 108 #define MM 100 #define MILLIMETER 109 #define MILLIMETERS 110 #define PT 101 #define POINT 111 #define POINTS 112 #define FU 102 #define FONT_UNIT 113 #define FONT_UNITS 114 motif-2.3.8/tools/wml/wmlparse.y0000644000175000017500000003755312672140200013555 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* "$TOG: wmlparse.y /main/10 1997/04/14 12:56:03 dbl $" */ /* * This file defines the grammar for the Motif Widget Meta Language (WML), * the declarative language which describes the widget, gadgets, and * resources in the UIL language. */ %{ #include "wml.h" #if defined(__STDC__) #include /* for strcpy() */ #endif #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ #if !defined(__STDC__) /* * Undefine NULL, since it is defined in stdio */ #undef NULL #endif %} /* * Tokens defining terminals of the language */ /* * token 0 is EOF, not defined here */ /* * WML statements */ %token CLASS 1 /* CLASS statement */ %token RESOURCE 2 /* RESOURCE statement */ %token DATATYPE 3 /* DATATYPE statement */ %token CONTROLLIST 4 /* CONTROLLIST statement */ %token ENUMERATIONSET 5 /* ENUMERATIONSET statement */ %token ENUMERATIONVALUE 6 /* ENUMERATIONVALUE statement */ %token CHARACTERSET 7 /* CHARACTERSET statement */ %token CHILD 50 /* CHILD statement */ /* * Statement attributes */ %token DOCNAME 8 /* DOCNAME attribute */ %token CONVFUNC 9 /* CONVENIENCEFUNCTION attribute */ %token ALIAS 10 /* ALIAS attribute */ %token TYPE 11 /* TYPE attribute */ %token RESOURCELITERAL 12 /* RESOURCELITERAL attribute */ %token RELATED 13 /* RELATED attribute */ %token INTERNALLITERAL 14 /* INTERNALLITERAL attribute */ %token XRMRESOURCE 15 /* XRMRESOURCE attribute */ %token EXCLUDE 16 /* EXCLUDE attribute */ %token RESOURCES 17 /* RESOURCES attribute */ %token SUPERCLASS 18 /* SUPERCLASS attribute */ %token CONTROLS 19 /* CONTROLS attribute */ %token WIDGETCLASS 20 /* WIDGETCLASS attribute */ %token DIALOGCLASS 21 /* DIALOGCLASS attribute */ %token DEFAULT 22 /* DEFAULT attribute */ %token ENUMLITERAL 23 /* ENUMLITERAL attribute */ %token XMSTRINGCHARSETNAME 24 /* XMSTRINGCHARSETNAME attribute */ %token DIRECTION 25 /* DIRECTION attribute */ %token PARSEDIRECTION 26 /* PARSEDIRECTION attribute */ %token CHARACTERSIZE 27 /* CHARACTERSIZE attribute */ %token CTRLMAPSRESOURCE 28 /* CTRLMAPSRESOURCE attribute */ %token CHILDREN 51 /* CHILDREN attribute */ %token PARENTCLASS 52 /* PARENTCLASS attribute */ /* * Other keywords */ %token METACLASS 29 /* CLASS type */ %token WIDGET 30 /* CLASS type */ %token GADGET 31 /* CLASS type */ %token ARGUMENT 32 /* RESOURCE type */ %token REASON 33 /* RESOURCE type */ %token CONSTRAINT 34 /* RESOURCE type */ %token SUBRESOURCE 35 /* RESOURCE type */ %token ATTRTRUE 36 /* attribute value */ %token ATTRFALSE 37 /* attribute value */ %token LEFTTORIGHT 38 /* DIRECTION attribute */ %token RIGHTTOLEFT 39 /* DIRECTION attribute */ %token ONEBYTE 40 /* CHARACTERSIZE attribute */ %token TWOBYTE 41 /* CHARACTERSIZE attribute */ %token MIXED1_2BYTE 42 /* CHARACTERSIZE attribute */ /* * Special characters */ %token COLON 43 %token SEMICOLON 44 %token EQUALS 45 %token LBRACE 46 %token RBRACE 47 /* * non-terminals */ %token STRING 48 /* Any user literal */ /* * Others */ %token ERRORTOKEN 49 /* Any unrecognized character */ %start statement_block_list %% /* * Productions of the WML grammar. All routines assume that current * data structures are kept in globals. This works as the language has * no recursive elements. */ /* * The language consists of blocks of statements. The blocks may occur * in any order, and blocks of the same kind may be arbitrarily repeated. */ statement_block_list : /* empty */ | statement_block_list statement_block ; statement_block : class_statement_block | resource_statement_block | child_statement_block | datatype_statement_block | ctrlist_statement_block | enumset_statement_block | enumval_statement_block | charset_statement_block | error { LexIssueError(0); } SEMICOLON ; /* * Statement blocks. Each statement block begins with its identifying * keyword, then includes an arbitrary number of statements */ class_statement_block : CLASS class_statement_list ; class_statement_list : class_statement SEMICOLON | class_statement_list class_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; resource_statement_block : RESOURCE resource_statement_list ; resource_statement_list : resource_statement SEMICOLON | resource_statement_list resource_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; child_statement_block : CHILD child_statement_list ; child_statement_list : child_statement SEMICOLON | child_statement_list child_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; datatype_statement_block : DATATYPE datatype_statement_list ; datatype_statement_list : datatype_statement SEMICOLON | datatype_statement_list datatype_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; ctrlist_statement_block : CONTROLLIST ctrlist_statement_list ; ctrlist_statement_list : ctrlist_statement SEMICOLON | ctrlist_statement_list ctrlist_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; enumset_statement_block : ENUMERATIONSET enumset_statement_list ; enumset_statement_list : enumset_statement SEMICOLON | enumset_statement_list enumset_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; enumval_statement_block : ENUMERATIONVALUE enumval_statement_list ; enumval_statement_list : enumval_statement SEMICOLON | enumval_statement_list enumval_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; charset_statement_block : CHARACTERSET charset_statement_list ; charset_statement_list : charset_statement SEMICOLON | charset_statement_list charset_statement SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; /* * The CLASS statement */ class_statement : name COLON class_type { wmlCreateClass (yynameval, yytknval1); } class_definition ; class_type : METACLASS { yytknval1 = METACLASS; } | WIDGET { yytknval1 = WIDGET; } | GADGET { yytknval1 = GADGET; } ; class_definition : /* empty */ | LBRACE RBRACE | LBRACE class_attribute_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; class_attribute_list : class_attribute | class_attribute_list class_attribute ; class_attribute : class_attribute_name EQUALS STRING { wmlAddClassAttribute (yytknval1, yystringval); } SEMICOLON | boolean_class_attribute_name EQUALS boolean_attribute_value { wmlAddClassAttribute (yytknval1, yytknval2); } SEMICOLON | class_resources SEMICOLON | class_controls SEMICOLON | class_children SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; class_attribute_name : SUPERCLASS { yytknval1 = SUPERCLASS; } | PARENTCLASS { yytknval1 = PARENTCLASS; } | INTERNALLITERAL { yytknval1 = INTERNALLITERAL; } | DOCNAME { yytknval1 = DOCNAME; } | CONVFUNC { yytknval1 = CONVFUNC; } | WIDGETCLASS { yytknval1 = WIDGETCLASS; } | CTRLMAPSRESOURCE { yytknval1 = CTRLMAPSRESOURCE; } | ALIAS { yytknval1 = ALIAS; } ; boolean_class_attribute_name : DIALOGCLASS { yytknval1 = DIALOGCLASS; } ; boolean_attribute_value : ATTRTRUE { yytknval2 = ATTRTRUE; } | ATTRFALSE { yytknval2 = ATTRFALSE; } ; class_resources : RESOURCES class_resources_block ; class_resources_block : /* empty */ | LBRACE RBRACE | LBRACE class_resource_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; class_resource_list : class_resource_element | class_resource_list class_resource_element ; class_resource_element : name { wmlAddClassResource (yynameval); } class_resource_attributes SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; class_resource_attributes : /* empty */ | LBRACE RBRACE | LBRACE class_resource_attribute_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; class_resource_attribute_list : class_resource_attribute_element | class_resource_attribute_list class_resource_attribute_element ; class_resource_attribute_element : class_resource_attribute_name EQUALS STRING { wmlAddClassResourceAttribute (yytknval1, yystringval); } SEMICOLON | boolean_class_resource_attribute_name EQUALS boolean_attribute_value { wmlAddClassResourceAttribute (yytknval1, yytknval2); } SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; class_resource_attribute_name : TYPE { yytknval1 = TYPE; } | DEFAULT { yytknval1 = DEFAULT; } ; boolean_class_resource_attribute_name : EXCLUDE { yytknval1 = EXCLUDE; } ; class_controls : CONTROLS class_controls_block ; class_controls_block : /* empty */ | LBRACE RBRACE | LBRACE class_controls_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; class_controls_list : class_controls_element | class_controls_list class_controls_element ; class_controls_element : name { wmlAddClassControl (yynameval); } class_controls_attributes SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; class_controls_attributes : /* empty */ | LBRACE RBRACE | error { LexIssueError(RBRACE); } RBRACE ; class_children : CHILDREN class_children_block ; class_children_block : /* empty */ | LBRACE RBRACE | LBRACE class_children_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; class_children_list : class_children_element | class_children_list class_children_element ; class_children_element : name { wmlAddClassChild (yynameval); } SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; /* * The RESOURCE statement */ resource_statement : name COLON resource_type { wmlCreateResource (yynameval, yytknval1); } resource_definition ; resource_type : ARGUMENT { yytknval1 = ARGUMENT; } | REASON { yytknval1 = REASON; } | CONSTRAINT { yytknval1 = CONSTRAINT; } | SUBRESOURCE { yytknval1 = SUBRESOURCE; } ; resource_definition : /* empty */ | LBRACE RBRACE | LBRACE resource_attribute_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; resource_attribute_list : resource_attribute | resource_attribute_list resource_attribute ; resource_attribute : resource_attribute_name EQUALS STRING { wmlAddResourceAttribute (yytknval1, yystringval); } SEMICOLON | boolean_resource_resource_attribute_name EQUALS boolean_attribute_value { wmlAddResourceAttribute (yytknval1, yytknval2); } SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; resource_attribute_name : TYPE { yytknval1 = TYPE; } | RESOURCELITERAL { yytknval1 = RESOURCELITERAL; } | ENUMERATIONSET { yytknval1 = ENUMERATIONSET; } | INTERNALLITERAL { yytknval1 = INTERNALLITERAL; } | RELATED { yytknval1 = RELATED; } | DOCNAME { yytknval1 = DOCNAME; } | DEFAULT { yytknval1 = DEFAULT; } | ALIAS { yytknval1 = ALIAS; } ; boolean_resource_resource_attribute_name : XRMRESOURCE { yytknval1 = XRMRESOURCE; } ; /* * The CHILD statement */ child_statement : name COLON STRING { wmlCreateChild(yynameval, yystringval); } ; /* * DATATYPE statement */ datatype_statement : name { wmlCreateDatatype (yystringval); } datatype_definition ; datatype_definition : /* empty */ | LBRACE RBRACE | LBRACE datatype_attribute_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; datatype_attribute_list : datatype_attribute | datatype_attribute_list datatype_attribute ; datatype_attribute : datatype_attribute_name EQUALS STRING { wmlAddDatatypeAttribute (yytknval1, yystringval); } SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; datatype_attribute_name : INTERNALLITERAL { yytknval1 = INTERNALLITERAL; } | DOCNAME { yytknval1 = DOCNAME; } | XRMRESOURCE { yytknval1 = XRMRESOURCE; } ; /* * The CONTROLLIST statement */ ctrlist_statement : name { wmlCreateOrAppendCtrlList (yynameval); } ctrlist_definition ; ctrlist_definition : /* empty */ | LBRACE RBRACE | LBRACE ctrlist_controls_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; ctrlist_controls_list : ctrlist_control | ctrlist_controls_list ctrlist_control ; ctrlist_control : name { wmlAddCtrlListControl (yynameval); } ctrlist_controls_attributes SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; ctrlist_controls_attributes : /* empty */ | LBRACE RBRACE | error { LexIssueError(RBRACE); } RBRACE ; /* * The ENUMERATIONSET statement */ enumset_statement : name COLON enumset_data_type { wmlCreateEnumSet (yynameval, yystringval); } enumset_definition ; enumset_data_type : STRING ; enumset_definition : /* empty */ | LBRACE RBRACE | LBRACE enumset_value_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; enumset_value_list : enumset_value | enumset_value_list enumset_value ; enumset_value : name { wmlAddEnumSetValue (yynameval); } SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; /* * The ENUMERATIONVALUE statement */ enumval_statement : name COLON { wmlCreateEnumValue (yynameval); } enumvalue_definition ; enumvalue_definition : /* empty */ | LBRACE RBRACE | LBRACE enumvalue_attributes_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; enumvalue_attributes_list : enumvalue_attribute | enumvalue_attributes_list enumvalue_attribute ; enumvalue_attribute : enumvalue_attribute_name EQUALS STRING { wmlAddEnumValueAttribute (yytknval1, yystringval); } SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; enumvalue_attribute_name : ENUMLITERAL { yytknval1 = ENUMLITERAL; } ; /* * CHARACTERSET statement */ charset_statement : name { wmlCreateCharset (yystringval); } charset_definition ; charset_definition : /* empty */ | LBRACE RBRACE | LBRACE charset_attribute_list RBRACE | error { LexIssueError(RBRACE); } RBRACE ; charset_attribute_list : charset_attribute | charset_attribute_list charset_attribute ; charset_attribute : charset_attribute_name EQUALS STRING { wmlAddCharsetAttribute (yytknval1, yystringval); } SEMICOLON | predefined_charset_attribute_name EQUALS predefined_charset_attribute_value { wmlAddCharsetAttribute (yytknval1, yytknval2); } SEMICOLON | error { LexIssueError(SEMICOLON); } SEMICOLON ; charset_attribute_name : INTERNALLITERAL { yytknval1 = INTERNALLITERAL; } | ALIAS { yytknval1 = ALIAS; } | XMSTRINGCHARSETNAME { yytknval1 = XMSTRINGCHARSETNAME; } ; predefined_charset_attribute_name : DIRECTION { yytknval1 = DIRECTION; } | PARSEDIRECTION { yytknval1 = PARSEDIRECTION; } | CHARACTERSIZE { yytknval1 = CHARACTERSIZE; } ; predefined_charset_attribute_value : LEFTTORIGHT { yytknval2 = LEFTTORIGHT; } | RIGHTTOLEFT { yytknval2 = RIGHTTOLEFT; } | ONEBYTE { yytknval2 = ONEBYTE; } | TWOBYTE { yytknval2 = TWOBYTE; } | MIXED1_2BYTE { yytknval2 = MIXED1_2BYTE; } ; /* * Other productions */ name : STRING { strcpy (yynameval, (XmConst char *)yystringval); } ; %% /* * Dummmy error routine, since we output our own. */ int yyerror (s) char *s; { return 0; } #include "wmllex.c" motif-2.3.8/tools/wml/wml.h0000644000175000017500000005076213145162623012507 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * This file contains the structure and literal definitions required * by the WML processor */ #if defined(__STDC__) #include #else #include #endif #define TRUE 1 #define FALSE 0 #define SUCCESS 1 #define FAILURE 0 /* * Generic object pointer */ typedef char *ObjectPtr; /* * True and False for attributes, so setting is explicit */ #define WmlAttributeUnspecified 0 #define WmlAttributeTrue 1 #define WmlAttributeFalse 2 /* * Values of character set direction */ #define WmlCharSetDirectionLtoR 1 #define WmlCharSetDirectionRtoL 2 /* * Values of character set character size */ #define WmlCharSizeOneByte 1 #define WmlCharSizeTwoByte 2 #define WmlCharSizeMixed1_2Byte 3 /* * Upper case and lower case converters */ #define _upper(c) ((c) >= 'a' && (c) <= 'z' ? (c) & 0x5F:(c)) #define _lower(c) ((c) >= 'A' && (c) <= 'Z' ? (c) | 0x20:(c)) /* * The Uil token classes which are dealt with WML. Matched to definitions * in UilKeyDef.h, although this isn't required. */ #define WmlTokenClassArgument 1 #define WmlTokenClassCharset 2 #define WmlTokenClassColor 3 #define WmlTokenClassEnumval 4 #define WmlTokenClassFont 5 #define WmlTokenClassIdentifier 6 #define WmlTokenClassKeyword 7 #define WmlTokenClassLiteral 8 #define WmlTokenClassReason 9 #define WmlTokenClassReserved 10 #define WmlTokenClassSpecial 11 #define WmlTokenClassUnused 12 #define WmlTokenClassClass 13 #define WmlTokenClassChild 14 /* * Structures for WML objects. Two kinds are created for each object * recognized and built as a WML description is read: * - A syntactic descriptor, which captures the information parse * from the input in pretty much its raw form * - A semantically resolved descriptor, in which pointers to * other descriptors have been resolved, ordering is done, * superclass inheritance is complete, etc. */ /* * Syntactic structures. These are constructred during input parse. */ /* * A dummy holding only a header. Allows access to the validation field. */ typedef struct { int validation; /* a unique validation code */ ObjectPtr rslvdef; /* the resolved object pointer */ } WmlSynDef, *WmlSynDefPtr; /* * A class resource descriptor. This a subset of a full resource descriptor, * which captures those elements which can be overridden in a class declaration */ #define WmlClassResDefValid 871253 typedef struct WmlSynClassResDefStruct { int validation; /* WmlClassResDefValid */ struct WmlSynClassResDefStruct *next; /* next descriptor in chain */ char *name; /* resource name */ char *type; /* override type name */ char *dflt; /* override default value */ short int exclude; /* WmlAttributeTrue if to be excluded */ } WmlSynClassResDef, *WmlSynClassResDefPtr; /* * A class child descriptor. */ #define WmlClassChildDefValid 780344 typedef struct WmlSynClassChildDefStruct { int validation; /* WmlClassChildDefValid */ struct WmlSynClassChildDefStruct *next; /* next descriptor in chain */ char *name; /* child name */ } WmlSynClassChildDef, *WmlSynClassChildDefPtr; /* * A class controls descriptor. It contains elements which can be added * to a controls reference. */ #define WmlClassCtrlDefValid 7132320 typedef struct WmlSynClassCtrlDefStruct { int validation; /* WmlClassCtrlDefValid */ struct WmlSynClassCtrlDefStruct *next; /* next descriptor in chain */ char *name; /* controlled class name */ } WmlSynClassCtrlDef, *WmlSynClassCtrlDefPtr; /* * A class structure. One exists for each Class statement in a WML * description. */ #define WmlClassDefValid 93741 #define WmlClassTypeMetaclass 1 #define WmlClassTypeWidget 2 #define WmlClassTypeGadget 3 typedef struct WmlSynClassDefStruct { int validation; /* WmlClassDefValid */ struct WmlClassDefStruct *rslvdef; /* resolved definition */ short int type; /* from WmlClassType... */ short int dialog; /* TRUE if a dialog class (has window manager decoration, etc) */ char *name; /* class name */ char *superclass; /* superclass name */ char *parentclass; /* parentclass name */ char *widgetclass; /* widget class name */ char *int_lit; /* internal literal name */ char *convfunc; /* convenience function name */ char *docname; /* name for docs */ char *ctrlmapto; /* resource controls map to */ short int alias_cnt; /* alias count */ char **alias_list; /* vector of aliass */ WmlSynClassCtrlDefPtr controls; /* list of controlled classes */ WmlSynClassResDefPtr resources; /* list of resources from input */ WmlSynClassChildDefPtr children; /* list of automatic children */ } WmlSynClassDef, *WmlSynClassDefPtr; /* * A controls list structure. One is created for each ControlsList statement * in a WML description. */ #define WmlCtrlListDefValid 621298 typedef struct WmlSynCtrlListDefStruct { int validation; /* WmlCtrlListDefValid */ struct WmlCtrlListDefStruct *rslvdef; /* resolved definition */ char *name; /* controls list name */ WmlSynClassCtrlDefPtr controls; /* list of controlled classes */ } WmlSynCtrlListDef, *WmlSynCtrlListDefPtr; /* * A resource descriptor. One is created for each Resource statement * in a WML description */ #define WmlResourceDefValid 310538 #define WmlResourceTypeArgument 1 #define WmlResourceTypeReason 2 #define WmlResourceTypeConstraint 3 #define WmlResourceTypeSubResource 4 typedef struct WmlSynResourceDefStruct { int validation; /* WmlResourceDefValid */ struct WmlResourceDefStruct *rslvdef; /* resolved definition */ short int type; /* from WmlResourceType... */ char *name; /* resource name */ char *datatype; /* resource data type */ char *int_lit; /* internal literal name */ char *resliteral; /* resource name literal */ char *enumset; /* enumeration set name */ char *docname; /* name for docs */ char *related; /* names related resource */ char *dflt; /* default value */ short int xrm_support; /* WmlAttributeTrue if can be Xrm resource */ short int alias_cnt; /* alias count */ char **alias_list; /* vector of aliass */ } WmlSynResourceDef, *WmlSynResourceDefPtr; /* * A child descriptor. One is created for each Child statement * in a WML description */ #define WmlChildDefValid 229629 typedef struct WmlSynChildDefStruct { int validation; /* WmlResourceDefValid */ struct WmlChildDefStruct *rslvdef; /* resolved definition */ char *name; /* child name */ char *class; /* child class */ } WmlSynChildDef, *WmlSynChildDefPtr; /* * A datatype descriptor */ #define WmlDataTypeDefValid 714210 typedef struct WmlSynDataTypeDefStruct { int validation; /* WmlDataTypeDefValid */ struct WmlDataTypeDefStruct *rslvdef; /* resolved definition */ char *name; /* data type name */ char *int_lit; /* internal literal name */ char *docname; /* name for docs */ short int xrm_support; /* WmlAttributeTrue if can be Xrm resource */ } WmlSynDataTypeDef, *WmlSynDataTypeDefPtr; /* * An enumeration set values descriptor, as it occurs in the list for * an enumeration set descriptor. */ typedef struct WmlSynEnumSetValDefStruct { int validation; /* WmlEnumValueDefValid */ struct WmlSynEnumSetValDefStruct *next; /* next descriptor in chain */ char *name; /* enumeration value name */ } WmlSynEnumSetValDef, *WmlSynEnumSetValDefPtr; /* * An enumeration set descriptor */ #define WmlEnumSetDefValid 931184 typedef struct WmlSynEnumSetDefStruct { int validation; /* WmlEnumSetDefValid */ struct WmlEnumSetDefStruct *rslvdef; /* resolved definition */ char *name; /* enumeration set name */ char *datatype; /* enumeration set data type */ WmlSynEnumSetValDefPtr values; /* list of values in set */ } WmlSynEnumSetDef, *WmlSynEnumSetDefPtr; /* * An enumeration value descriptor */ #define WmlEnumValueDefValid 172938 typedef struct WmlSynEnumValueDefStruct { int validation; /* WmlEnumValueDefValid */ struct WmlEnumValueDefStruct *rslvdef; /* resolved definition */ char *name; /* enumeration value name */ char *enumlit; /* name of defining literal */ } WmlSynEnumValueDef, *WmlSynEnumValueDefPtr; /* * A charset descriptor */ #define WmlCharSetDefValid 110983 typedef struct WmlSynCharSetDefStruct { int validation; /* WmlCharSetDefValid */ struct WmlCharSetDefStruct *rslvdef; /* resolved definition */ char *name; /* data type name */ char *int_lit; /* internal literal name */ char *xms_name; /* identifying XmString name */ short int direction; /* WmlCharSetDirection... */ short int parsedirection; /* WmlCharSetDirection... */ short int charsize; /* WmlCharSize... */ short int alias_cnt; /* alias count */ char **alias_list; /* vector of aliases */ } WmlSynCharSetDef, *WmlSynCharSetDefPtr; /* * Data structures constructed during semantic validation. Each points * as required to syntactic data structures. These are typically accessed * from ordered pointer vectors. */ /* * A datatype descriptor. It extends the syntactic element by assigning * a code to the descriptor. */ typedef struct WmlDataTypeDefStruct { struct WmlSynDataTypeDefStruct *syndef; /* syntactic definition */ char *tkname; /* name for generating literals */ } WmlDataTypeDef, *WmlDataTypeDefPtr; /* * A charset descriptor. It extends the syntactic element by assigning * a code to the descriptor. */ typedef struct WmlCharSetDefStruct { struct WmlSynCharSetDefStruct *syndef; /* syntactic definition */ char *tkname; /* name for generating literals */ short int sym_code; /* code value for literals */ } WmlCharSetDef, *WmlCharSetDefPtr; /* * A child descriptor. It extends the syntactic element by assigning * a code and a pointer to the class to the descriptor. */ typedef struct WmlChildDefStruct { struct WmlSynChildDefStruct *syndef; /* syntactic definition */ char *tkname; /* name for generating literals */ short int sym_code; /* code value for literals */ struct WmlClassDefStruct *class; /* class structure */ struct WmlClassChildDefStruct *ref_ptr; /* used dynamically for search */ } WmlChildDef, *WmlChildDefPtr; /* * An element in the values list of an enumeration set. These elements have * separate lists in order to deal with the possibility of an enumeration * value which is a member of more than one list. */ typedef struct WmlEnumSetValDefStruct { struct WmlEnumSetValDefStruct *next; /* next value in list */ struct WmlEnumValueDefStruct *value; /* value descriptor for element */ } WmlEnumSetValDef, *WmlEnumSetValDefPtr; /* * A resolved enumeration set descriptor */ typedef struct WmlEnumSetDefStruct { struct WmlSynEnumSetDefStruct *syndef; /* syntactic definition */ char *tkname; /* name for generating literals */ short int sym_code; /* code value for literals */ WmlDataTypeDefPtr dtype_def; /* data type */ short int values_cnt; /* count of # of values in set */ WmlEnumSetValDefPtr values; /* list of values in set */ } WmlEnumSetDef, *WmlEnumSetDefPtr; /* * A resolved enumeration value descriptor */ typedef struct WmlEnumValueDefStruct { struct WmlSynEnumValueDefStruct *syndef; /* syntactic definition */ short int sym_code; /* code value for literals */ } WmlEnumValueDef, *WmlEnumValueDefPtr; /* * A resource descriptor */ typedef struct WmlResourceDefStruct { struct WmlSynResourceDefStruct *syndef; /* syntactic definition */ char *tkname; /* name for generating literals */ short int sym_code; /* code value for literals */ WmlDataTypeDefPtr dtype_def; /* data type for base definition */ WmlEnumSetDefPtr enumset_def; /* enumeration set if specified */ short int related_code; /* if non-0, the sym_code for the related (count) argument */ short int xrm_support; /* if AttributeTrue, then the resource can be set in Xrm. Resolved from either explicit setting or data type setting */ struct WmlClassDefStruct *ref_class; /* used for membership sort */ struct WmlClassResDefStruct *ref_ptr; /* used dynamically for search */ } WmlResourceDef, *WmlResourceDefPtr; /* * A resource descriptor with overrides which is a member of the resource * list of a class descriptor. */ typedef struct WmlClassResDefStruct { struct WmlClassResDefStruct *next; /* next resource in list */ WmlResourceDefPtr act_resource; /* actual resource descriptor */ WmlDataTypeDefPtr over_dtype; /* overriding data type */ char *dflt; /* overriding default */ int exclude; /* WmlAttributeTrue if to be excluded */ } WmlClassResDef, *WmlClassResDefPtr; /* * A child descriptor which is a member of the children * list of a class descriptor. */ typedef struct WmlClassChildDefStruct { struct WmlClassChildDefStruct *next; /* next child in list */ WmlChildDefPtr act_child; /* actual child descriptor */ } WmlClassChildDef, *WmlClassChildDefPtr; /* * An element for the controls list of a resolved class descriptor */ typedef struct WmlClassCtrlDefStruct { struct WmlClassCtrlDefStruct *next; /* next control in list */ struct WmlClassDefStruct *ctrl; /* class being controlled */ } WmlClassCtrlDef, *WmlClassCtrlDefPtr; /* * A resolved class descriptor. It has a pointer to its superclass, and * a resource list consisting of its inherited resources followed by * its own resources. */ typedef struct WmlClassDefStruct { struct WmlSynClassDefStruct *syndef; /* syntactic definition */ struct WmlClassDefStruct *superclass; /* superclass structure */ struct WmlClassDefStruct *parentclass; /* parentclass structure */ char *tkname; /* name to be used in literals. int_lit or name if no int_lit */ short int sym_code; /* code value for literals */ short int inherit_done; /* TRUE when inheritance complete */ WmlClassResDefPtr arguments; /* linked argument list */ WmlClassResDefPtr reasons; /* lined reason list */ WmlClassCtrlDefPtr controls; /* list of controlled classes. Controls list references will be expanded into this list. */ WmlClassChildDefPtr children; /* list of automatic children */ struct WmlClassDefStruct *variant; /* the gadget class for a widget */ struct WmlClassDefStruct *nondialog; /* the non-dialog ancestor of a dialog widget */ WmlResourceDefPtr ctrlmapto; /* the resource controls map to */ struct WmlClassCtrlDefStruct *ref_ptr; /* used dynamically for search */ } WmlClassDef, *WmlClassDefPtr; /* * A resolved controls list descriptor. */ typedef struct WmlCtrlListDefStruct { struct WmlSynCtrlListDefStruct *syndef; /* syntactic definition */ WmlClassCtrlDefPtr controls; /* list of controlled classes */ } WmlCtrlListDef, *WmlCtrlListDefPtr; /* * Data structures used to locate and order objects in various ways. */ /* * Token structure used to create ordered token lists for generation of * UilKeyTab.h. The token string is in the order vector. */ typedef struct WmlKeyWTokenStruct { int class; /* token class, WmlTokenClass... */ ObjectPtr objdef; /* object definition (resolved) */ } WmlKeyWToken, *WmlKeyWTokenPtr; /* * A grammar token as obtained from the UIL grammar file (Uil.y) */ typedef struct WmlGrammarTokenStruct { int class; /* token class, WmlTokenClass... */ char *token; /* token name (literal) */ int val; /* token id as value */ } WmlGrammarToken, *WmlGrammarTokenPtr; /* * A list element which allows association of a name with an object. * Typically used to construct ordered lists. */ typedef struct { char *objname; /* object name */ ObjectPtr objptr; /* the object */ } ObjectHandleDef, *ObjectHandleDefPtr; /* * A dynamic handle element list, extensible by malloc'ing more space. */ typedef struct { int cnt; /* # entries in use */ int max; /* max # entries available */ int ordered; /* TRUE if list is lexicographically ordered by object name */ ObjectHandleDefPtr hvec; /* vector of handle entries */ } DynamicHandleListDef, *DynamicHandleListDefPtr; /* * Global declarations */ /* * Defined in wml.c */ extern int wml_err_count; /* total errors */ extern int wml_line_count; /* lines read from input */ extern DynamicHandleListDefPtr wml_synobj_ptr; /* syntactic object list */ extern DynamicHandleListDefPtr wml_obj_datatype_ptr; extern DynamicHandleListDefPtr wml_obj_enumval_ptr; extern DynamicHandleListDefPtr wml_obj_enumset_ptr; extern DynamicHandleListDefPtr wml_obj_reason_ptr; extern DynamicHandleListDefPtr wml_obj_arg_ptr; extern DynamicHandleListDefPtr wml_obj_child_ptr; extern DynamicHandleListDefPtr wml_obj_allclass_ptr; extern DynamicHandleListDefPtr wml_obj_class_ptr; extern DynamicHandleListDefPtr wml_obj_ctrlist_ptr; extern DynamicHandleListDefPtr wml_obj_charset_ptr; extern DynamicHandleListDefPtr wml_tok_sens_ptr; extern DynamicHandleListDefPtr wml_tok_insens_ptr; /* * Defined in wmlutils.c */ extern char *wmlAllocateString (); /* dynamic string copy */ extern void wmlUpperCaseString (); /* convert to upper case */ extern void wmlInitHList (); /* init dynamic list */ extern void wmlResizeHList (); /* resize a list */ extern void wmlClearHList (); /* clear a list for reuse */ extern int wmlFindInHList (); /* find name in list */ extern void wmlInsertInHList (); /* generic list insert */ extern void wmlInsertInKeyList (); /* specialized list insert */ extern WmlClassResDefPtr wmlResolveResIsMember (); /* is resource in class? */ extern WmlClassChildDefPtr wmlResolveChildIsMember (); /* is child in class? */ /* * Defined in wmlsynbld.c */ extern char yystringval[]; /* any string value */ extern char yynameval[]; /* any name (identifier) */ extern int yytknval1; /* terminal token value 1 */ extern int yytknval2; /* terminal token value 2 */ extern ObjectPtr wml_cur_obj; /* object being constructed */ extern ObjectPtr wml_cur_subobj; /* current subobject */ extern void wmlCreateClass (); extern void wmlAddClassAttribute (); extern void wmlAddClassResource (); extern void wmlAddClassResourceAttribute (); extern void wmlAddClassControl (); extern void wmlAddCtrList (); extern void wmlCreateResource (); extern void wmlCreateDatatype (); extern void wmlAddResourceAttribute (); extern void wmlAddDatatypeAttribute (); extern void wmlAddCtrListControl (); extern void wmlCreateEnumSet (); extern void wmlAddEnumSetValue (); extern void wmlCreateEnumValue (); extern void wmlAddEnumValueAttribute (); extern void wmlCreateCharset (); extern void wmlAddCharsetAttribute (); extern void LexIssueError (); /* May be, declaration of functions must be next: extern void wmlAddClassChild (); extern void wmlCreateChild (); extern void wmlCreateOrAppendCtrlList (); extern void wmlAddCtrlListControl (); But, we are using real function arguments type declaration: */ extern void wmlAddClassChild (char *); extern void wmlCreateChild (char *, char *); extern void wmlCreateOrAppendCtrlList (char *); extern void wmlAddCtrlListControl (char *); /* * Defined in wmlresolve.c */ extern void wmlResolveDescriptors (); extern void wmlMarkReferencePointers (); /* * Defined in wmlouth.c */ extern void wmlOutputHFiles (); /* * Defined in wmloutdat.c */ extern void wmlOutputDatFiles (); /* * Define in wmloutp1 or wmloutp2 */ extern void wmlOutput (); motif-2.3.8/tools/wml/Uil.h0000644000175000017500000000447313211513006012424 00000000000000#define UILEOF 0 #define NAME 1 #define FONT_NAME 2 #define COLOR_NAME 3 #define ARGUMENT_NAME 4 #define REASON_NAME 5 #define CHARSET_NAME 6 #define ENUMVAL_NAME 7 #define CLASS_NAME 8 #define CHILD_NAME 96 #define UNS_FLOAT_LITERAL 9 #define COMP_STRING 10 #define CHAR_8_LITERAL 11 #define UNS_INT_LITERAL 12 #define LEFT_PAREN 13 #define RIGHT_PAREN 14 #define COLON 15 #define SEMICOLON 16 #define LEFT_BRACE 17 #define RIGHT_BRACE 18 #define COMMA 19 #define EQUAL_SIGN 20 #define NOT 21 #define PLUS 22 #define MINUS 23 #define AND 24 #define OR 25 #define XOR 26 #define MULTIPLY 27 #define DIVIDE 28 #define LEFT_SHIFT 29 #define RIGHT_SHIFT 30 #define LIST 31 #define IDENTIFIER 32 #define END 33 #define MODULE 34 #define UILTRUE 35 #define UILFALSE 36 #define INCLUDE 37 #define MACRO 38 #define ON 39 #define OFF 40 #define VALUE 41 #define ARGUMENTS 42 #define CALLBACKS 43 #define PROCEDURES 44 #define CONTROLS 45 #define PROCEDURE 46 #define OBJECT 47 #define OBJECTS 48 #define WIDGET 49 #define GADGET 50 #define FONT 51 #define ARGUMENT 52 #define REASON 53 #define PIXMAP 54 #define COLOR 55 #define NAMES 56 #define CHARACTER_SET 57 #define CASE_SENSITIVE 58 #define CASE_INSENSITIVE 59 #define VERSION 60 #define MANAGED 61 #define UNMANAGED 62 #define PRIVATE 63 #define IMPORTED 64 #define EXPORTED 65 #define UILFILE 66 #define STRING_TABLE 67 #define TRANSLATION_TABLE 68 #define COMPOUND_STRING 69 #define FONT_TABLE 70 #define ANY 71 #define STRING 72 #define BOOLEAN 73 #define ICON 74 #define RIGHT_TO_LEFT 75 #define BACKGROUND 76 #define FOREGROUND 77 #define COLOR_TABLE 78 #define FLOAT 79 #define INTEGER 80 #define CLASS_REC_NAME 81 #define ASCIZ_TABLE 82 #define INTEGER_TABLE 83 #define ASCIZ_STRING_TABLE 84 #define COMPOUND_STRING_TABLE 85 #define XBITMAPFILE 86 #define SEPARATE 87 #define SIXTEEN_BIT 88 #define POUND 89 #define KEYSYM 90 #define SINGLE_FLOAT 91 #define RGB 92 #define WIDE_CHARACTER 93 #define LOC_STRING 94 #define FONTSET 95 #define COMPOUND_STRING_COMPONENT 97 #define PIX 115 #define PIXEL 103 #define PIXELS 104 #define IN 98 #define INCH 105 #define INCHES 106 #define CM 99 #define CENTIMETER 107 #define CENTIMETERS 108 #define MM 100 #define MILLIMETER 109 #define MILLIMETERS 110 #define PT 101 #define POINT 111 #define POINTS 112 #define FU 102 #define FONT_UNIT 113 #define FONT_UNITS 114 motif-2.3.8/tools/wml/wmluiltok.c0000644000175000017500000013741713211513005013721 00000000000000 #line 3 "wmluiltok.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 7 #define YY_END_OF_BUFFER 8 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[18] = { 0, 0, 0, 8, 6, 2, 1, 6, 5, 6, 3, 5, 0, 0, 0, 0, 4, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 5, 1, 1, 1, 1, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 7, 1, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 9, 7, 7, 10, 11, 7, 7, 7, 7, 12, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[13] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2 } ; static yyconst flex_int16_t yy_base[19] = { 0, 0, 17, 20, 22, 22, 22, 14, 0, 6, 22, 0, 6, 7, 7, 4, 22, 22, 11 } ; static yyconst flex_int16_t yy_def[19] = { 0, 17, 1, 17, 17, 17, 17, 17, 18, 17, 17, 18, 17, 17, 17, 17, 17, 0, 17 } ; static yyconst flex_int16_t yy_nxt[35] = { 0, 4, 5, 6, 4, 4, 7, 8, 8, 8, 8, 8, 8, 11, 16, 15, 14, 13, 12, 10, 17, 9, 3, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 } ; static yyconst flex_int16_t yy_chk[35] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 18, 15, 14, 13, 12, 9, 7, 3, 2, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "wmluiltok.l" #line 2 "wmluiltok.l" /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #if defined(__STDC__) #include #include #endif #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ /* * lex program to construct token data for WML to generate token * table data. * * stdin is the file Uil.y * * it is searched for each occurance of a line starting with '%token' * when found various fields are extracted. * * when Uil.y has been scanned the collected data is written * to stdout. */ #line 59 "wmluiltok.l" #include #define TRUE 1 #define FALSE 0 #define MAX_SYN 10 #ifdef yywrap #undef yywrap #endif typedef struct _token { char * name; char * id; char * class; int num_syn; char * syn[MAX_SYN]; } TokenRec, *Token; TokenRec token[1000]; TokenRec temp; void add_token (); int yywrap (); int phase = 0; int keyword_count; int line_num = 0; int in_comment = 0; int in_include = 0; int in_token = 0; int state = 0; int used = 0; #line 560 "wmluiltok.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); yy_size_t yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 100 "wmluiltok.l" #line 781 "wmluiltok.c" while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 18 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 22 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 103 "wmluiltok.l" { if (in_token == TRUE) { add_token (&temp); } in_token = FALSE; line_num++; } YY_BREAK case 2: YY_RULE_SETUP #line 113 "wmluiltok.l" { /* swallow */ } YY_BREAK case 3: YY_RULE_SETUP #line 117 "wmluiltok.l" { /* swallow */ } YY_BREAK case 4: YY_RULE_SETUP #line 121 "wmluiltok.l" { in_token = TRUE; state = 0; } YY_BREAK case 5: YY_RULE_SETUP #line 126 "wmluiltok.l" { if (in_token == TRUE) { switch (state) { case 0: temp.name = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); temp.num_syn = 0; break; case 1: temp.id = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); break; case 2: temp.class = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); break; case 3: temp.syn[temp.num_syn] = (char *) strcpy ((char *) malloc (strlen ((XmConst char *)yytext) + 1), (XmConst char *)yytext); temp.num_syn++; if (temp.num_syn > MAX_SYN) printf ( "ERROR, too many synonyms, line %d\n", line_num); break; } state++; } } YY_BREAK case 6: YY_RULE_SETUP #line 168 "wmluiltok.l" { /* swallow */ } YY_BREAK case 7: YY_RULE_SETUP #line 171 "wmluiltok.l" ECHO; YY_BREAK #line 929 "wmluiltok.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 18 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 18 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 17); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 170 "wmluiltok.l" void add_token (t) /* keep sorted by name */ Token t; { int i, j; for (j=0; jname) > 0) /* goes here */ { for (i=used++; i>j; i--) /* make hole */ token[i] = token[i-1]; token[j] = *t; /* insert it */ return; } } /* * if we get there then it goes at the end of the list */ token[used++] = *t; } int yywrap () { int i; for (i=0; i #endif #include "UilDefI.h" #include "UilCompGl.h" #define YYSTYPE yystype #define YYDEBUG 1 /* Declare and initialize stack entry for epsilon productions. */ YYSTYPE gz_yynullval = {NULL,0,0,0,0}; /* Declare token to aid in saving source context */ YYSTYPE prev_yylval; /* End user declarations section */ #line 45 "Uil.c" #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) /* Default: YYSTYPE is the semantic value type. */ typedef int YYSTYPE; # define YYSTYPE_IS_DECLARED 1 #endif /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #define UILEOF 0 #define NAME 1 #define FONT_NAME 2 #define COLOR_NAME 3 #define ARGUMENT_NAME 4 #define REASON_NAME 5 #define CHARSET_NAME 6 #define ENUMVAL_NAME 7 #define CLASS_NAME 8 #define CHILD_NAME 96 #define UNS_FLOAT_LITERAL 9 #define COMP_STRING 10 #define CHAR_8_LITERAL 11 #define UNS_INT_LITERAL 12 #define LEFT_PAREN 13 #define RIGHT_PAREN 14 #define COLON 15 #define SEMICOLON 16 #define LEFT_BRACE 17 #define RIGHT_BRACE 18 #define COMMA 19 #define EQUAL_SIGN 20 #define NOT 21 #define PLUS 22 #define MINUS 23 #define AND 24 #define OR 25 #define XOR 26 #define MULTIPLY 27 #define DIVIDE 28 #define LEFT_SHIFT 29 #define RIGHT_SHIFT 30 #define LIST 31 #define IDENTIFIER 32 #define END 33 #define MODULE 34 #define UILTRUE 35 #define UILFALSE 36 #define INCLUDE 37 #define MACRO 38 #define ON 39 #define OFF 40 #define VALUE 41 #define ARGUMENTS 42 #define CALLBACKS 43 #define PROCEDURES 44 #define CONTROLS 45 #define PROCEDURE 46 #define OBJECT 47 #define OBJECTS 48 #define WIDGET 49 #define GADGET 50 #define FONT 51 #define ARGUMENT 52 #define REASON 53 #define PIXMAP 54 #define COLOR 55 #define NAMES 56 #define CHARACTER_SET 57 #define CASE_SENSITIVE 58 #define CASE_INSENSITIVE 59 #define VERSION 60 #define MANAGED 61 #define UNMANAGED 62 #define PRIVATE 63 #define IMPORTED 64 #define EXPORTED 65 #define UILFILE 66 #define STRING_TABLE 67 #define TRANSLATION_TABLE 68 #define COMPOUND_STRING 69 #define FONT_TABLE 70 #define ANY 71 #define STRING 72 #define BOOLEAN 73 #define ICON 74 #define RIGHT_TO_LEFT 75 #define BACKGROUND 76 #define FOREGROUND 77 #define COLOR_TABLE 78 #define FLOAT 79 #define INTEGER 80 #define CLASS_REC_NAME 81 #define ASCIZ_TABLE 82 #define INTEGER_TABLE 83 #define ASCIZ_STRING_TABLE 84 #define COMPOUND_STRING_TABLE 85 #define XBITMAPFILE 86 #define SEPARATE 87 #define SIXTEEN_BIT 88 #define POUND 89 #define KEYSYM 90 #define SINGLE_FLOAT 91 #define RGB 92 #define WIDE_CHARACTER 93 #define LOC_STRING 94 #define FONTSET 95 #define COMPOUND_STRING_COMPONENT 97 #define PIX 115 #define PIXEL 103 #define PIXELS 104 #define IN 98 #define INCH 105 #define INCHES 106 #define CM 99 #define CENTIMETER 107 #define CENTIMETERS 108 #define MM 100 #define MILLIMETER 109 #define MILLIMETERS 110 #define PT 101 #define POINT 111 #define POINTS 112 #define FU 102 #define FONT_UNIT 113 #define FONT_UNITS 114 #define YYERRCODE 256 typedef short YYINT; static const YYINT yylhs[] = { -1, 3, 0, 4, 7, 1, 6, 6, 8, 8, 9, 9, 9, 13, 9, 11, 11, 14, 14, 16, 14, 15, 15, 18, 15, 19, 17, 20, 20, 2, 2, 21, 21, 21, 21, 21, 21, 29, 22, 28, 28, 31, 28, 30, 32, 32, 32, 32, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 36, 36, 37, 37, 40, 24, 39, 39, 42, 39, 41, 43, 43, 45, 45, 45, 45, 44, 47, 23, 46, 46, 49, 46, 48, 27, 50, 27, 52, 25, 51, 51, 54, 51, 55, 53, 58, 56, 59, 56, 61, 56, 62, 64, 56, 66, 65, 67, 65, 68, 65, 69, 65, 70, 65, 71, 72, 65, 73, 57, 74, 74, 77, 76, 63, 63, 80, 80, 75, 75, 75, 82, 75, 78, 78, 78, 83, 78, 84, 84, 85, 84, 81, 81, 86, 86, 86, 90, 86, 60, 92, 26, 91, 91, 94, 91, 95, 93, 96, 96, 96, 96, 103, 97, 106, 98, 109, 99, 112, 100, 104, 107, 110, 101, 105, 105, 105, 114, 105, 108, 108, 108, 116, 108, 111, 111, 111, 118, 111, 102, 102, 102, 120, 102, 113, 113, 115, 115, 117, 117, 119, 119, 121, 121, 126, 121, 122, 122, 128, 122, 123, 123, 131, 123, 124, 124, 133, 124, 134, 89, 135, 87, 136, 88, 137, 129, 132, 140, 132, 142, 132, 143, 132, 141, 141, 125, 125, 127, 127, 146, 139, 138, 138, 138, 145, 130, 147, 147, 147, 147, 5, 5, 5, 5, 5, 5, 5, 5, 79, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 10, 33, 34, 34, 149, 144, 144, 144, 151, 151, 152, 152, 152, 153, 153, 153, 154, 154, 154, 155, 155, 155, 155, 156, 156, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 167, 167, 174, 174, 165, 165, 175, 175, 166, 166, 176, 176, 172, 164, 164, 177, 177, 163, 163, 163, 168, 168, 169, 169, 169, 169, 169, 178, 178, 179, 179, 179, 173, 160, 160, 161, 161, 170, 170, 180, 180, 159, 159, 12, 12, 12, 181, 181, 182, 182, 183, 183, 150, 150, 184, 184, 184, 162, 162, 185, 185, 171, 171, 186, 186, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, }; static const YYINT yylen[] = { 2, 0, 6, 0, 0, 5, 0, 1, 1, 2, 3, 3, 3, 0, 4, 1, 1, 2, 3, 0, 3, 2, 3, 0, 3, 0, 4, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 3, 1, 2, 0, 3, 4, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 2, 0, 3, 4, 0, 3, 0, 1, 1, 1, 0, 0, 3, 1, 2, 0, 3, 2, 4, 0, 3, 0, 3, 2, 3, 0, 3, 0, 4, 0, 3, 0, 3, 0, 3, 0, 0, 6, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 0, 5, 0, 5, 1, 1, 0, 5, 1, 3, 1, 2, 1, 2, 3, 0, 3, 1, 3, 4, 0, 3, 3, 4, 0, 3, 1, 2, 2, 2, 2, 0, 3, 0, 0, 3, 2, 3, 0, 3, 0, 4, 1, 1, 1, 1, 0, 3, 0, 3, 0, 3, 0, 3, 1, 1, 1, 1, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 0, 3, 2, 2, 0, 3, 2, 2, 0, 3, 2, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 2, 0, 4, 0, 4, 0, 4, 1, 1, 3, 4, 3, 3, 0, 3, 1, 1, 1, 3, 2, 1, 3, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 1, 1, 2, 4, 4, 4, 4, 4, 4, 5, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 3, 5, 0, 1, 1, 3, 0, 2, 2, 1, 2, 1, 3, 3, 3, 3, 2, 3, 3, 3, 3, 1, 5, 1, 5, 1, 1, 3, 3, 1, 2, 1, 1, 4, 1, 1, 2, 2, 3, 3, 3, 1, 3, 4, 4, 3, 1, 3, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const YYINT yydefred[] = { 3, 0, 1, 0, 29, 0, 0, 283, 284, 285, 286, 287, 288, 289, 326, 296, 297, 298, 299, 300, 301, 317, 302, 303, 304, 305, 306, 325, 307, 93, 311, 312, 315, 324, 292, 293, 319, 316, 320, 321, 318, 294, 295, 314, 95, 310, 96, 94, 322, 323, 327, 328, 329, 330, 331, 313, 4, 308, 309, 290, 119, 183, 111, 0, 0, 37, 97, 121, 30, 31, 32, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 5, 0, 8, 120, 187, 189, 0, 0, 115, 0, 0, 113, 2, 0, 0, 0, 0, 0, 0, 370, 371, 372, 373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 0, 0, 360, 0, 0, 0, 433, 0, 0, 0, 0, 0, 348, 351, 355, 0, 41, 0, 0, 39, 101, 0, 0, 99, 125, 127, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 185, 0, 117, 114, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 362, 358, 0, 353, 354, 352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, 434, 0, 432, 0, 0, 0, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 374, 359, 0, 0, 40, 0, 0, 110, 100, 0, 0, 0, 123, 0, 15, 16, 11, 12, 10, 188, 0, 186, 116, 356, 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 431, 0, 428, 0, 454, 0, 0, 0, 0, 0, 401, 0, 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, 406, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 350, 42, 0, 0, 0, 0, 0, 46, 0, 334, 102, 109, 72, 53, 55, 54, 50, 56, 60, 63, 61, 108, 49, 52, 62, 51, 48, 65, 59, 66, 67, 68, 69, 70, 71, 64, 107, 57, 58, 0, 0, 126, 0, 124, 19, 0, 14, 203, 204, 205, 206, 190, 191, 192, 193, 194, 195, 197, 199, 201, 0, 364, 0, 0, 367, 363, 0, 366, 378, 0, 0, 0, 379, 0, 381, 0, 0, 382, 0, 383, 384, 368, 377, 0, 385, 0, 0, 386, 387, 0, 388, 389, 0, 365, 0, 380, 375, 0, 376, 0, 45, 47, 44, 0, 43, 105, 103, 131, 135, 129, 128, 133, 0, 23, 25, 17, 0, 0, 0, 0, 0, 0, 0, 92, 78, 79, 75, 80, 84, 87, 85, 410, 74, 77, 86, 76, 73, 83, 88, 89, 90, 91, 81, 82, 409, 369, 450, 451, 449, 394, 0, 0, 0, 418, 0, 430, 429, 0, 455, 402, 0, 0, 435, 0, 0, 417, 414, 415, 416, 407, 398, 0, 0, 0, 0, 443, 0, 0, 0, 0, 20, 0, 0, 18, 0, 21, 225, 0, 291, 222, 196, 210, 0, 207, 198, 215, 0, 212, 200, 220, 0, 217, 202, 0, 0, 0, 0, 419, 0, 0, 0, 439, 0, 0, 0, 0, 0, 0, 336, 0, 151, 132, 136, 130, 134, 24, 0, 22, 0, 249, 0, 223, 0, 0, 260, 0, 0, 0, 233, 0, 182, 0, 237, 208, 0, 0, 0, 227, 0, 0, 0, 241, 213, 0, 0, 0, 229, 0, 0, 0, 245, 218, 257, 0, 0, 231, 0, 0, 424, 420, 421, 422, 0, 0, 0, 440, 403, 426, 0, 0, 447, 444, 0, 0, 27, 28, 26, 226, 0, 267, 264, 266, 262, 0, 0, 247, 224, 234, 248, 272, 259, 211, 0, 0, 235, 209, 228, 236, 0, 216, 0, 0, 239, 214, 230, 240, 0, 221, 0, 0, 0, 279, 278, 219, 232, 243, 244, 441, 442, 445, 446, 0, 157, 0, 182, 250, 0, 0, 0, 252, 0, 238, 254, 0, 0, 242, 256, 0, 271, 270, 246, 258, 0, 282, 0, 0, 154, 153, 0, 137, 173, 0, 265, 263, 142, 144, 140, 148, 138, 146, 261, 155, 273, 269, 0, 0, 280, 0, 159, 158, 164, 0, 152, 161, 0, 180, 182, 0, 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 281, 160, 0, 162, 0, 174, 0, 171, 182, 176, 177, 178, 179, 143, 145, 141, 149, 139, 147, 0, 165, 163, 181, 172, 182, 0, 150, 169, 0, 156, 166, 0, 182, 0, 170, 167, 182, 168, }; static const YYINT yydgoto[] = { 1, 2, 6, 4, 3, 133, 88, 75, 89, 90, 134, 247, 270, 159, 356, 426, 422, 427, 491, 492, 666, 68, 69, 70, 71, 72, 73, 74, 149, 81, 150, 233, 316, 271, 317, 346, 135, 136, 454, 153, 82, 154, 236, 238, 350, 349, 98, 78, 99, 168, 76, 157, 83, 158, 240, 241, 420, 531, 488, 486, 137, 489, 487, 643, 593, 680, 707, 705, 703, 704, 708, 706, 735, 592, 668, 692, 682, 709, 740, 573, 689, 698, 713, 742, 672, 694, 699, 700, 701, 702, 717, 94, 77, 95, 164, 165, 361, 362, 363, 364, 365, 366, 500, 428, 367, 504, 429, 368, 508, 430, 369, 512, 431, 556, 551, 565, 560, 574, 569, 547, 538, 557, 566, 575, 548, 558, 612, 567, 620, 576, 577, 628, 549, 598, 604, 613, 621, 629, 550, 610, 603, 602, 647, 646, 263, 659, 650, 632, 59, 319, 484, 139, 140, 141, 142, 143, 144, 145, 189, 146, 256, 293, 261, 373, 297, 300, 282, 264, 267, 295, 272, 276, 289, 291, 265, 301, 283, 298, 381, 463, 273, 396, 471, 521, 485, 458, 277, }; static const YYINT yysindex[] = { 0, 0, 0, 19, 0, 5159, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 50, 2508, 2617, 72, 4771, 2714, 2823, 2920, 0, 88, 140, 144, 0, 120, 0, 0, 0, 0, 5159, 151, 0, 170, 5159, 0, 0, 1192, 1192, 4771, 4771, 4771, 4771, 0, 0, 0, 0, 200, 210, 214, 227, 230, 238, 270, 276, 289, 291, 294, 306, 319, 344, 61, 352, 362, 365, 377, 0, 392, 395, 0, 173, 398, 400, 0, 315, 206, 14, 320, 325, 0, 0, 0, 349, 0, 219, 5159, 0, 0, 402, 5159, 0, 0, 0, 5159, 233, 218, 303, 61, 4771, 0, 281, 401, 283, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4577, 4868, 4771, 4771, 4771, 4771, 4771, 0, 0, 405, 0, 4771, 4771, 4771, 4771, 4771, 412, 0, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 0, 0, 404, 4480, 0, 406, 5214, 0, 0, 413, 419, 420, 0, -12, 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, 423, 407, 425, 431, 434, 442, 448, 0, 315, 449, 446, 447, 453, 0, 405, 450, 0, 205, 0, 451, 0, 455, 457, 131, 167, 458, 0, 465, 461, 468, 4771, 471, 169, 467, 474, 0, 475, 476, 480, 478, 484, 0, 486, 482, 0, 488, 485, 206, 206, 14, 320, 320, 325, 325, 0, 0, 0, 4965, 1116, 4771, 498, 497, 0, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 501, 0, 246, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 433, 0, 625, 506, 0, 0, 287, 0, 0, 4771, -27, 503, 0, 4771, 0, 4577, 4771, 0, 4771, 0, 0, 0, 0, 4771, 0, 507, 513, 0, 0, 4771, 0, 0, 464, 0, 22, 0, 0, 4771, 0, 4771, 0, 0, 0, 5062, 0, 0, 0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 24, 515, 1381, 1478, 1587, 1684, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 516, 519, 520, 0, -27, 0, 0, 522, 0, 0, -34, 525, 0, 526, 528, 0, 0, 0, 0, 0, 0, 491, 495, 221, 217, 0, 527, 544, 527, 527, 0, 537, 535, 0, 542, 0, 0, 1793, 0, 0, 0, 0, 760, 0, 0, 0, 857, 0, 0, 0, 1890, 0, 0, 61, 61, 4771, 4771, 0, 4771, 539, 540, 0, -34, 4771, 61, 541, 543, 4771, 0, 5062, 0, 0, 0, 0, 0, 0, 339, 0, 546, 0, 334, 0, 0, 0, 0, 0, 549, 1999, 0, 551, 0, 550, 0, 0, 0, 554, 966, 0, 555, 243, 556, 0, 0, 0, 557, 1063, 0, 559, 250, 560, 0, 0, 0, 564, 2096, 0, 563, 566, 0, 0, 0, 0, 457, 4771, 4771, 0, 0, 0, 4771, 4771, 0, 0, 534, 534, 0, 0, 0, 0, 568, 0, 0, 0, 0, 547, 548, 0, 0, 0, 0, 0, 0, 0, 569, 530, 0, 0, 0, 0, 4674, 0, 570, 552, 0, 0, 0, 0, 553, 0, 571, 558, 4380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5159, 0, 339, 0, 0, -4, -4, 286, 0, 584, 0, 0, 5159, 315, 0, 0, 5159, 0, 0, 0, 0, 5159, 0, 203, 581, 0, 0, 2205, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 564, 582, 0, 586, 0, 0, 0, -2, 0, 0, 580, 0, 0, 0, -1, 0, 585, 587, 588, 527, 527, 527, 597, 527, 527, 534, 0, 0, 0, 589, 0, 3, 0, 592, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, 2302, 0, 0, 4, 0, 0, 591, 0, 5, 0, 0, 0, 0, }; static const YYINT yyrindex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 138, 0, 0, 0, 141, 0, 0, 298, 427, 388, 388, 388, 388, 0, 0, 0, 0, 3004, 3043, 3082, 3121, 3166, 3205, 3250, 3289, 3328, 3367, 3412, 3451, 3496, 3535, 0, 3574, 3613, 3658, 3697, 0, 3742, 3781, 0, 0, 3820, 3859, 0, 477, 4234, 4150, 4027, 3904, 0, 0, 0, 0, 0, 0, 179, 0, 0, 594, 225, 0, 0, 0, 259, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 388, 388, 388, 388, 129, 388, 388, 388, 388, 388, 388, 274, 388, 0, 0, 0, 0, 388, 388, 388, 388, 388, 0, 0, 284, 323, 388, 388, 388, 388, 388, 388, 388, 388, 388, 0, 0, 0, 388, 0, 0, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 602, 0, 488, 0, 0, 604, 0, 0, 106, 0, 465, 615, 0, 357, 598, 0, 0, 0, 0, 1377, 0, 0, 616, 0, 0, 0, 0, 0, 474, 0, 388, 0, 0, 0, 0, 0, 0, 618, 0, 621, 0, 0, 0, 484, 0, 0, 623, 4273, 4312, 4189, 4066, 4105, 3943, 3988, 0, 0, 0, 388, 860, 388, 969, 0, 0, 595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 626, 0, 388, 0, 388, 388, 0, 388, 0, 0, 0, 0, 388, 0, 627, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 388, 0, 388, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 935, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 60, 0, 0, 0, 95, 0, 0, 0, 600, 0, 0, 0, 0, 388, 388, 0, 388, 0, 0, 0, 0, 388, 0, 0, 0, 388, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 115, 127, 0, 53, 0, 23, 0, 0, 0, 0, 0, 0, 180, 0, 60, 0, 0, 0, 0, 0, 0, 118, 0, 95, 0, 0, 0, 0, 0, 0, 0, 629, 600, 0, 0, 0, 0, 0, 0, 0, 632, 388, 388, 0, 0, 0, 388, 388, 0, 0, 1272, 629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2411, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1175, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 629, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 236, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2411, 0, 0, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 222, 0, 0, 0, 0, }; static const YYINT yygindex[] = { 0, 0, 0, 0, 0, 9, 0, 0, 0, 562, -161, 0, -122, 0, 0, 0, 0, 213, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 504, 0, 0, -106, 342, 343, -5, 2, 0, 0, 0, 505, 0, 0, 0, 0, 0, 0, 567, 0, 0, 0, 0, 518, 0, 0, 0, -335, 0, 0, 41, 0, 0, -575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -70, 0, 0, 0, 0, -420, 0, -664, 0, 0, 21, 0, -579, -482, -466, -478, 0, 0, 0, 575, 0, 0, 0, 57, 59, 52, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 117, 112, 143, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 7, 0, 0, 0, 178, 479, 181, 176, -80, 0, 0, 609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 317, 0, 0, 191, 171, 0, 196, }; #define YYTABLESIZE 5311 static const YYINT yytable[] = { 57, 249, 424, 212, 289, 355, 182, 58, 499, 503, 507, 511, 425, 671, 56, 696, 714, 719, 644, 546, 555, 732, 743, 747, 192, 193, 194, 715, 475, 476, 460, 182, 424, 477, 255, 257, 258, 259, 260, 248, 564, 519, 493, 225, 226, 280, 254, 284, 461, 61, 62, 63, 286, 5, 520, 64, 292, 222, 223, 65, 462, 274, 209, 79, 66, 67, 91, 210, 182, 546, 182, 182, 57, 57, 555, 744, 57, 57, 57, 58, 58, 138, 80, 58, 58, 58, 93, 97, 100, 57, 148, 152, 156, 57, 262, 266, 58, 275, 251, 564, 58, 281, 182, 93, 191, 182, 182, 97, 160, 288, 290, 6, 6, 6, 296, 299, 478, 6, 211, 720, 333, 6, 333, 275, 395, 333, 6, 6, 433, 433, 305, 7, 7, 7, 730, 276, 720, 7, 182, 182, 182, 7, 306, 391, 57, 389, 7, 7, 57, 309, 310, 58, 57, 533, 534, 58, 222, 223, 148, 58, 161, 255, 152, 138, 162, 720, 156, 167, 84, 184, 184, 184, 112, 112, 112, 184, 85, 86, 112, 184, 87, 390, 112, 398, 184, 184, 169, 112, 112, 219, 433, 433, 222, 223, 222, 223, 138, 138, 138, 138, 138, 357, 358, 359, 360, 278, 279, 138, 412, 138, 38, 38, 38, 195, 138, 287, 38, 686, 138, 384, 38, 665, 253, 196, 385, 38, 38, 197, 222, 223, 224, 528, 347, 683, 234, 318, 529, 684, 244, 348, 198, 527, 685, 199, 354, 182, 222, 223, 693, 243, 423, 200, 670, 695, 695, 695, 98, 98, 98, 695, 695, 695, 98, 618, 182, 182, 98, 182, 222, 223, 626, 98, 98, 459, 60, 222, 223, 465, 253, 255, 467, 251, 468, 201, 182, 182, 138, 469, 399, 202, 122, 122, 122, 473, 182, 182, 122, 250, 404, 252, 122, 479, 203, 480, 204, 122, 122, 205, 347, 417, 418, 419, 361, 318, 361, 348, 741, 361, 361, 206, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 207, 182, 182, 361, 6, 395, 253, 361, 222, 223, 227, 228, 361, 361, 361, 674, 675, 676, 677, 678, 229, 230, 361, 361, 7, 208, 361, 231, 232, 245, 246, 456, 457, 213, 590, 452, 724, 725, 726, 283, 728, 729, 453, 214, 283, 436, 215, 283, 283, 283, 283, 283, 283, 283, 283, 283, 594, 595, 216, 578, 579, 421, 184, 599, 600, 112, 182, 182, 302, 303, 587, 307, 308, 217, 305, 306, 218, 580, 581, 220, 275, 221, 483, 237, 251, 586, 285, 294, 311, 371, 320, 57, 57, 57, 57, 639, 640, 351, 58, 58, 58, 58, 352, 38, 353, 498, 498, 498, 498, 357, 370, 357, 372, 374, 357, 357, 375, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 376, 377, 378, 357, 379, 380, 382, 357, 387, 383, 386, 391, 357, 357, 357, 388, 637, 638, 392, 393, 98, 394, 357, 357, 397, 399, 357, 400, 401, 432, 332, 57, 332, 403, 402, 332, 404, 405, 58, 406, 407, 408, 559, 409, 57, 544, 568, 332, 332, 332, 413, 58, 414, 332, 122, 415, 416, 332, 498, 455, 474, 464, 332, 332, 332, 470, 472, 138, 490, 483, 495, 513, 332, 332, 530, 514, 332, 545, 515, 516, 518, 57, 554, 522, 523, 525, 563, 524, 58, 526, 572, 532, 535, 361, 536, 544, 559, 537, 583, 584, 588, 648, 589, 597, 605, 568, 608, 611, 57, 614, 617, 357, 622, 619, 625, 58, 630, 627, 635, 641, 601, 636, 498, 645, 651, 655, 660, 545, 138, 138, 609, 681, 360, 687, 358, 711, 554, 716, 657, 712, 721, 359, 722, 723, 727, 563, 731, 733, 745, 104, 335, 317, 106, 631, 572, 425, 317, 448, 654, 317, 317, 317, 317, 317, 317, 317, 317, 317, 411, 452, 664, 427, 642, 642, 413, 57, 396, 182, 494, 412, 437, 438, 58, 182, 182, 453, 268, 57, 596, 498, 163, 57, 235, 410, 58, 411, 57, 239, 58, 736, 649, 498, 57, 58, 170, 498, 572, 673, 166, 58, 498, 652, 656, 433, 242, 434, 498, 435, 436, 437, 616, 624, 357, 667, 669, 634, 661, 658, 679, 607, 710, 29, 438, 439, 440, 441, 442, 443, 444, 591, 517, 466, 304, 445, 446, 688, 44, 447, 46, 47, 190, 697, 585, 582, 448, 449, 0, 450, 0, 451, 0, 0, 0, 0, 631, 0, 0, 0, 0, 0, 57, 697, 332, 0, 0, 0, 718, 58, 697, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 642, 0, 0, 0, 0, 0, 697, 0, 0, 0, 734, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 667, 102, 103, 0, 0, 737, 0, 553, 0, 697, 104, 105, 106, 746, 697, 0, 0, 748, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 562, 325, 0, 104, 105, 106, 0, 325, 325, 325, 325, 325, 325, 325, 325, 325, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 320, 0, 320, 320, 320, 320, 320, 320, 320, 320, 320, 0, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 615, 318, 0, 104, 105, 106, 0, 318, 318, 318, 318, 318, 318, 318, 318, 318, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 552, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 623, 0, 0, 104, 105, 106, 321, 0, 321, 321, 321, 321, 321, 321, 321, 321, 321, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 561, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 0, 0, 0, 0, 322, 0, 323, 324, 325, 326, 327, 0, 0, 0, 0, 182, 182, 182, 182, 182, 0, 182, 29, 328, 329, 330, 0, 332, 333, 334, 182, 182, 0, 0, 335, 336, 337, 44, 338, 46, 47, 339, 0, 0, 0, 340, 341, 342, 343, 0, 344, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 552, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 174, 177, 180, 183, 186, 172, 173, 175, 176, 178, 179, 181, 182, 184, 185, 187, 188, 171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 561, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 318, 0, 0, 0, 0, 318, 0, 497, 318, 318, 318, 318, 318, 318, 318, 318, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 496, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 501, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 505, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 542, 543, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 540, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 509, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 539, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 542, 543, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 540, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 570, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 539, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 570, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 182, 182, 182, 182, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 690, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 738, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 92, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 96, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 147, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 296, 0, 296, 0, 0, 296, 296, 0, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 0, 0, 0, 296, 0, 0, 0, 296, 0, 0, 0, 0, 296, 296, 296, 0, 0, 0, 0, 297, 0, 297, 296, 296, 297, 297, 296, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 0, 0, 151, 297, 0, 0, 0, 297, 0, 0, 0, 0, 297, 297, 297, 0, 0, 0, 0, 298, 0, 298, 297, 297, 298, 298, 297, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 0, 0, 0, 298, 0, 0, 0, 298, 0, 0, 0, 0, 298, 298, 298, 0, 0, 0, 0, 299, 0, 299, 298, 298, 299, 299, 298, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 0, 0, 0, 299, 0, 0, 0, 299, 0, 0, 0, 0, 299, 299, 299, 0, 0, 0, 0, 0, 0, 155, 299, 299, 0, 300, 299, 300, 0, 0, 300, 300, 0, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 0, 0, 0, 300, 0, 0, 0, 300, 0, 0, 0, 0, 300, 300, 300, 0, 0, 0, 0, 311, 0, 311, 300, 300, 311, 311, 300, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 0, 0, 0, 311, 0, 0, 0, 311, 0, 0, 0, 0, 311, 311, 311, 0, 0, 0, 0, 0, 0, 296, 311, 311, 0, 312, 311, 312, 0, 0, 312, 312, 0, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 0, 0, 0, 312, 0, 0, 0, 312, 0, 0, 0, 0, 312, 312, 312, 297, 0, 0, 0, 315, 0, 315, 312, 312, 315, 315, 312, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 0, 0, 0, 315, 0, 0, 0, 315, 0, 0, 0, 0, 315, 315, 315, 298, 0, 0, 0, 319, 0, 319, 315, 315, 319, 319, 315, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 0, 0, 0, 319, 0, 0, 0, 319, 0, 0, 0, 0, 319, 319, 319, 299, 0, 0, 0, 294, 0, 294, 319, 319, 294, 294, 319, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 0, 0, 0, 294, 0, 0, 0, 294, 0, 0, 0, 0, 294, 294, 294, 0, 0, 0, 0, 0, 0, 300, 294, 294, 0, 295, 294, 295, 0, 0, 295, 295, 0, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 0, 0, 0, 295, 0, 0, 0, 295, 0, 0, 0, 0, 295, 295, 295, 311, 0, 0, 0, 314, 0, 314, 295, 295, 314, 314, 295, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 0, 0, 0, 314, 0, 0, 0, 314, 0, 0, 0, 0, 314, 314, 314, 0, 0, 0, 0, 0, 0, 312, 314, 314, 0, 310, 314, 310, 0, 0, 310, 310, 0, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 0, 0, 0, 310, 0, 0, 0, 310, 0, 0, 0, 0, 310, 310, 310, 315, 0, 0, 0, 322, 0, 322, 310, 310, 322, 322, 310, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 0, 0, 0, 322, 0, 0, 0, 322, 0, 0, 0, 0, 322, 322, 322, 319, 0, 0, 0, 327, 0, 327, 322, 322, 327, 327, 322, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 0, 0, 0, 327, 0, 0, 0, 327, 0, 0, 0, 0, 327, 327, 327, 294, 0, 0, 0, 328, 0, 328, 327, 327, 328, 328, 327, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 0, 0, 0, 328, 0, 0, 0, 328, 0, 0, 0, 0, 328, 328, 328, 0, 0, 0, 0, 0, 0, 295, 328, 328, 0, 329, 328, 329, 0, 0, 329, 329, 0, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 0, 0, 0, 329, 0, 0, 0, 329, 0, 0, 0, 0, 329, 329, 329, 314, 0, 0, 0, 330, 0, 330, 329, 329, 330, 330, 329, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 0, 0, 0, 330, 0, 0, 0, 330, 0, 0, 0, 0, 330, 330, 330, 0, 0, 0, 0, 0, 0, 310, 330, 330, 0, 331, 330, 331, 0, 0, 331, 331, 0, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 0, 0, 0, 331, 0, 0, 0, 331, 0, 0, 0, 0, 331, 331, 331, 322, 0, 0, 0, 313, 0, 313, 331, 331, 313, 313, 331, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 0, 0, 0, 313, 0, 0, 0, 313, 0, 0, 0, 0, 313, 313, 313, 327, 0, 0, 0, 308, 0, 308, 313, 313, 308, 308, 313, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 0, 0, 0, 308, 0, 0, 0, 308, 0, 0, 0, 0, 308, 308, 308, 328, 0, 0, 0, 309, 0, 309, 308, 308, 309, 309, 308, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 0, 0, 0, 309, 0, 0, 0, 309, 0, 0, 0, 0, 309, 309, 309, 0, 0, 0, 0, 0, 0, 329, 309, 309, 0, 345, 309, 345, 0, 0, 345, 345, 0, 345, 345, 345, 345, 345, 0, 0, 345, 345, 345, 345, 345, 0, 0, 0, 345, 0, 0, 0, 345, 0, 0, 0, 0, 345, 345, 345, 330, 0, 0, 0, 346, 0, 346, 345, 345, 346, 346, 345, 346, 346, 346, 346, 346, 0, 0, 346, 346, 346, 346, 346, 0, 0, 0, 346, 0, 0, 0, 346, 0, 0, 0, 0, 346, 346, 346, 0, 0, 0, 0, 0, 0, 331, 346, 346, 0, 347, 346, 347, 0, 0, 347, 347, 0, 347, 347, 347, 347, 347, 0, 0, 347, 347, 347, 347, 347, 0, 0, 0, 347, 0, 0, 0, 347, 0, 0, 0, 0, 347, 347, 347, 313, 0, 0, 0, 342, 0, 342, 347, 347, 342, 342, 347, 0, 0, 342, 342, 342, 0, 0, 342, 342, 342, 342, 342, 0, 0, 0, 342, 0, 0, 0, 342, 0, 0, 0, 0, 342, 342, 342, 308, 0, 0, 0, 343, 0, 343, 342, 342, 343, 343, 342, 0, 0, 343, 343, 343, 0, 0, 343, 343, 343, 343, 343, 0, 0, 0, 343, 0, 0, 0, 343, 0, 0, 0, 0, 343, 343, 343, 309, 0, 0, 0, 344, 0, 344, 343, 343, 344, 344, 343, 0, 0, 344, 344, 344, 0, 0, 344, 344, 344, 344, 344, 0, 0, 0, 344, 0, 0, 0, 344, 0, 0, 0, 0, 344, 344, 344, 0, 0, 0, 0, 0, 0, 345, 344, 344, 0, 340, 344, 340, 0, 0, 340, 340, 0, 0, 0, 340, 340, 340, 0, 0, 0, 0, 340, 340, 340, 0, 0, 0, 340, 0, 0, 0, 340, 0, 0, 0, 0, 340, 340, 340, 346, 0, 0, 0, 341, 0, 341, 340, 340, 341, 341, 340, 0, 0, 341, 341, 341, 0, 0, 0, 0, 341, 341, 341, 0, 0, 0, 341, 0, 0, 0, 341, 0, 0, 0, 0, 341, 341, 341, 0, 0, 0, 0, 0, 0, 347, 341, 341, 0, 337, 341, 337, 0, 0, 337, 337, 0, 0, 0, 0, 337, 337, 0, 0, 0, 0, 337, 337, 337, 0, 0, 0, 337, 0, 0, 0, 337, 0, 0, 0, 0, 337, 337, 337, 342, 0, 0, 0, 338, 0, 338, 337, 337, 338, 338, 337, 0, 0, 0, 338, 338, 0, 0, 0, 0, 338, 338, 338, 0, 0, 0, 338, 0, 0, 0, 338, 0, 0, 0, 0, 338, 338, 338, 343, 0, 0, 0, 339, 0, 339, 338, 338, 339, 339, 338, 0, 0, 0, 339, 339, 0, 0, 0, 0, 339, 339, 339, 0, 0, 0, 339, 0, 0, 0, 339, 0, 0, 0, 0, 339, 339, 339, 344, 0, 0, 0, 0, 0, 0, 339, 339, 0, 0, 339, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 662, 101, 0, 0, 102, 103, 663, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 340, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 341, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 101, 337, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 338, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 312, 313, 314, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 315, 120, 121, 122, 44, 123, 46, 47, 124, 49, 339, 125, 126, 127, 128, 129, 130, 131, 13, 132, 268, 8, 9, 10, 11, 210, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 269, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 653, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 274, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 315, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 481, 482, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 321, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 322, 0, 323, 324, 325, 326, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 328, 329, 330, 331, 332, 333, 334, 0, 0, 0, 0, 335, 336, 337, 44, 338, 46, 47, 339, 0, 0, 0, 340, 341, 342, 343, 0, 344, 0, 345, }; static const YYINT yycheck[] = { 5, 162, 8, 125, 15, 17, 17, 5, 428, 429, 430, 431, 18, 17, 5, 18, 18, 18, 593, 497, 502, 18, 18, 18, 104, 105, 106, 691, 6, 7, 57, 8, 8, 11, 195, 196, 197, 198, 199, 161, 506, 75, 18, 29, 30, 206, 14, 208, 75, 31, 32, 33, 213, 34, 88, 37, 217, 25, 26, 41, 87, 8, 1, 34, 46, 47, 16, 6, 45, 547, 10, 11, 77, 78, 556, 739, 81, 82, 83, 77, 78, 80, 66, 81, 82, 83, 77, 78, 16, 94, 81, 82, 83, 98, 200, 201, 94, 203, 45, 565, 98, 207, 42, 94, 103, 10, 11, 98, 20, 215, 216, 31, 32, 33, 220, 221, 94, 37, 57, 698, 14, 41, 16, 8, 285, 19, 46, 47, 10, 11, 15, 31, 32, 33, 709, 8, 715, 37, 43, 10, 11, 41, 15, 14, 149, 14, 46, 47, 153, 229, 230, 149, 157, 488, 489, 153, 25, 26, 149, 157, 20, 43, 153, 162, 20, 744, 157, 16, 48, 31, 32, 33, 31, 32, 33, 37, 56, 57, 37, 41, 60, 14, 41, 14, 46, 47, 16, 46, 47, 16, 10, 11, 25, 26, 25, 26, 195, 196, 197, 198, 199, 42, 43, 44, 45, 204, 205, 206, 314, 208, 31, 32, 33, 13, 213, 214, 37, 14, 217, 14, 41, 641, 42, 13, 19, 46, 47, 13, 25, 26, 24, 14, 237, 653, 15, 234, 19, 657, 20, 237, 13, 20, 662, 13, 256, 256, 25, 26, 668, 16, 256, 13, 256, 256, 256, 256, 31, 32, 33, 256, 256, 256, 37, 20, 42, 43, 41, 45, 25, 26, 20, 46, 47, 379, 256, 25, 26, 383, 42, 43, 386, 45, 388, 13, 10, 11, 285, 393, 14, 13, 31, 32, 33, 399, 10, 11, 37, 16, 14, 16, 41, 407, 13, 409, 13, 46, 47, 13, 313, 63, 64, 65, 14, 312, 16, 313, 736, 19, 20, 13, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 13, 10, 11, 37, 256, 14, 16, 41, 25, 26, 22, 23, 46, 47, 48, 61, 62, 63, 64, 65, 27, 28, 56, 57, 256, 13, 60, 10, 11, 58, 59, 76, 77, 13, 527, 372, 703, 704, 705, 14, 707, 708, 372, 13, 19, 20, 13, 22, 23, 24, 25, 26, 27, 28, 29, 30, 49, 50, 13, 513, 514, 352, 256, 61, 62, 256, 10, 11, 222, 223, 524, 227, 228, 13, 225, 226, 13, 515, 516, 13, 518, 13, 413, 13, 15, 523, 13, 7, 16, 14, 16, 428, 429, 430, 431, 588, 589, 16, 428, 429, 430, 431, 15, 256, 16, 428, 429, 430, 431, 14, 19, 16, 19, 14, 19, 20, 14, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 19, 14, 14, 37, 19, 19, 14, 41, 14, 20, 20, 14, 46, 47, 48, 19, 583, 584, 14, 19, 256, 14, 56, 57, 14, 19, 60, 14, 14, 57, 14, 497, 16, 14, 19, 19, 19, 14, 497, 14, 19, 14, 502, 19, 510, 497, 506, 31, 32, 33, 13, 510, 16, 37, 256, 14, 16, 41, 510, 14, 57, 19, 46, 47, 48, 19, 14, 527, 18, 529, 16, 20, 56, 57, 8, 20, 60, 497, 20, 20, 19, 547, 502, 19, 19, 55, 506, 20, 547, 55, 510, 8, 16, 256, 20, 547, 556, 16, 20, 20, 20, 15, 20, 18, 16, 565, 16, 18, 574, 16, 16, 42, 16, 18, 16, 574, 13, 18, 16, 46, 540, 16, 574, 16, 16, 16, 16, 547, 588, 589, 550, 8, 45, 13, 43, 14, 556, 18, 46, 14, 16, 44, 16, 16, 8, 565, 18, 16, 18, 16, 16, 14, 14, 573, 574, 14, 19, 14, 618, 22, 23, 24, 25, 26, 27, 28, 29, 30, 14, 14, 630, 14, 592, 593, 14, 641, 14, 8, 426, 14, 14, 14, 641, 44, 16, 14, 16, 653, 536, 641, 89, 657, 149, 312, 653, 313, 662, 153, 657, 730, 604, 653, 668, 662, 98, 657, 626, 647, 94, 668, 662, 613, 621, 49, 157, 51, 668, 53, 54, 55, 556, 565, 256, 643, 644, 574, 629, 626, 648, 547, 684, 67, 68, 69, 70, 71, 72, 73, 74, 529, 464, 385, 224, 79, 80, 665, 82, 83, 84, 85, 102, 671, 522, 518, 90, 91, -1, 93, -1, 95, -1, -1, -1, -1, 684, -1, -1, -1, -1, -1, 736, 691, 256, -1, -1, -1, 696, 736, 698, -1, -1, -1, -1, -1, 736, -1, -1, -1, -1, 709, -1, -1, -1, -1, -1, 715, -1, -1, -1, 719, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, 730, 12, 13, -1, -1, 735, -1, 18, -1, 739, 21, 22, 23, 743, 744, -1, -1, 747, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, 16, -1, 21, 22, 23, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, 16, -1, 21, 22, 23, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, -1, -1, 21, 22, 23, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, -1, -1, -1, -1, 49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, 67, 68, 69, 70, -1, 72, 73, 74, 16, 17, -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, 91, 92, 93, -1, 95, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, 256, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, 14, -1, -1, -1, -1, 19, -1, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 14, -1, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, 256, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, -1, -1, 24, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, -1, -1, -1, 56, 57, -1, -1, 60, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, 8, 9, -1, -1, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, 256, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, 9, 256, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, 256, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 256, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, 6, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, 8, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 8, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, 49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, 91, 92, 93, -1, 95, -1, 97, }; #define YYFINAL 1 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 256 #define YYUNDFTOKEN 445 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) #if YYDEBUG static const char *const yyname[] = { "end-of-file","NAME","FONT_NAME","COLOR_NAME","ARGUMENT_NAME","REASON_NAME", "CHARSET_NAME","ENUMVAL_NAME","CLASS_NAME","UNS_FLOAT_LITERAL","COMP_STRING", "CHAR_8_LITERAL","UNS_INT_LITERAL","LEFT_PAREN","RIGHT_PAREN","COLON", "SEMICOLON","LEFT_BRACE","RIGHT_BRACE","COMMA","EQUAL_SIGN","NOT","PLUS", "MINUS","AND","OR","XOR","MULTIPLY","DIVIDE","LEFT_SHIFT","RIGHT_SHIFT","LIST", "IDENTIFIER","END","MODULE","UILTRUE","UILFALSE","INCLUDE","MACRO","ON","OFF", "VALUE","ARGUMENTS","CALLBACKS","PROCEDURES","CONTROLS","PROCEDURE","OBJECT", "OBJECTS","WIDGET","GADGET","FONT","ARGUMENT","REASON","PIXMAP","COLOR","NAMES", "CHARACTER_SET","CASE_SENSITIVE","CASE_INSENSITIVE","VERSION","MANAGED", "UNMANAGED","PRIVATE","IMPORTED","EXPORTED","UILFILE","STRING_TABLE", "TRANSLATION_TABLE","COMPOUND_STRING","FONT_TABLE","ANY","STRING","BOOLEAN", "ICON","RIGHT_TO_LEFT","BACKGROUND","FOREGROUND","COLOR_TABLE","FLOAT", "INTEGER","CLASS_REC_NAME","ASCIZ_TABLE","INTEGER_TABLE","ASCIZ_STRING_TABLE", "COMPOUND_STRING_TABLE","XBITMAPFILE","SEPARATE","SIXTEEN_BIT","POUND","KEYSYM", "SINGLE_FLOAT","RGB","WIDE_CHARACTER","LOC_STRING","FONTSET","CHILD_NAME", "COMPOUND_STRING_COMPONENT","IN","CM","MM","PT","FU","PIXEL","PIXELS","INCH", "INCHES","CENTIMETER","CENTIMETERS","MILLIMETER","MILLIMETERS","POINT","POINTS", "FONT_UNIT","FONT_UNITS","PIX",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol", }; static const char *const yyrule[] = { "$accept : module_block", "$$1 :", "module_block : module_header $$1 module_declaration_list END MODULE SEMICOLON", "$$2 :", "$$3 :", "module_header : $$2 MODULE id $$3 opt_module_clauses", "opt_module_clauses :", "opt_module_clauses : module_clauses", "module_clauses : module_clause", "module_clauses : module_clauses module_clause", "module_clause : VERSION EQUAL_SIGN character_8_value", "module_clause : NAMES EQUAL_SIGN sensitivity_value", "module_clause : CHARACTER_SET EQUAL_SIGN valid_charset", "$$4 :", "module_clause : OBJECTS $$4 EQUAL_SIGN variant_spec", "sensitivity_value : CASE_SENSITIVE", "sensitivity_value : CASE_INSENSITIVE", "variant_spec : LEFT_BRACE RIGHT_BRACE", "variant_spec : LEFT_BRACE variant_list RIGHT_BRACE", "$$5 :", "variant_spec : error $$5 RIGHT_BRACE", "variant_list : variant_clause SEMICOLON", "variant_list : variant_list variant_clause SEMICOLON", "$$6 :", "variant_list : error $$6 SEMICOLON", "$$7 :", "variant_clause : CLASS_NAME $$7 EQUAL_SIGN variant", "variant : WIDGET", "variant : GADGET", "module_declaration_list :", "module_declaration_list : module_declaration_list module_declaration", "module_declaration : value_declaration", "module_declaration : identifier_declaration", "module_declaration : procedure_declaration", "module_declaration : object_declaration", "module_declaration : list_declaration", "module_declaration : include_directive", "$$8 :", "value_declaration : VALUE $$8 value_declaration_list", "value_declaration_list : value_decl", "value_declaration_list : value_declaration_list value_decl", "$$9 :", "value_declaration_list : error $$9 SEMICOLON", "value_decl : id COLON value_definition SEMICOLON", "value_definition : EXPORTED private_value", "value_definition : PRIVATE private_value_plus", "value_definition : private_value_plus", "value_definition : IMPORTED value_type", "value_type : INTEGER", "value_type : STRING", "value_type : PIXMAP", "value_type : FLOAT", "value_type : BOOLEAN", "value_type : FONT", "value_type : REASON", "value_type : ARGUMENT", "value_type : COLOR", "value_type : string_table_type", "value_type : asciz_table_type", "value_type : INTEGER_TABLE", "value_type : TRANSLATION_TABLE", "value_type : FONT_TABLE", "value_type : ICON", "value_type : COMPOUND_STRING", "value_type : COMPOUND_STRING_COMPONENT", "value_type : CLASS_REC_NAME", "value_type : XBITMAPFILE", "value_type : KEYSYM", "value_type : SINGLE_FLOAT", "value_type : RGB", "value_type : WIDE_CHARACTER", "value_type : FONTSET", "value_type : WIDGET", "arg_value_type : INTEGER", "arg_value_type : STRING", "arg_value_type : PIXMAP", "arg_value_type : FLOAT", "arg_value_type : BOOLEAN", "arg_value_type : FONT", "arg_value_type : REASON", "arg_value_type : COLOR", "arg_value_type : string_table_type", "arg_value_type : asciz_table_type", "arg_value_type : INTEGER_TABLE", "arg_value_type : TRANSLATION_TABLE", "arg_value_type : FONT_TABLE", "arg_value_type : ICON", "arg_value_type : COMPOUND_STRING", "arg_value_type : KEYSYM", "arg_value_type : SINGLE_FLOAT", "arg_value_type : WIDE_CHARACTER", "arg_value_type : FONTSET", "arg_value_type : WIDGET", "string_table_type : STRING_TABLE", "string_table_type : COMPOUND_STRING_TABLE", "asciz_table_type : ASCIZ_TABLE", "asciz_table_type : ASCIZ_STRING_TABLE", "$$10 :", "procedure_declaration : PROCEDURE $$10 procedure_declaration_list", "procedure_declaration_list : procedure_decl", "procedure_declaration_list : procedure_declaration_list procedure_decl", "$$11 :", "procedure_declaration_list : error $$11 SEMICOLON", "procedure_decl : id opt_formal_parameters opt_class SEMICOLON", "opt_formal_parameters :", "opt_formal_parameters : LEFT_PAREN formal_parameter_type RIGHT_PAREN", "formal_parameter_type :", "formal_parameter_type : value_type", "formal_parameter_type : ANY", "formal_parameter_type : CLASS_NAME", "opt_class :", "$$12 :", "identifier_declaration : IDENTIFIER $$12 identifier_declaration_list", "identifier_declaration_list : identifier_decl", "identifier_declaration_list : identifier_declaration_list identifier_decl", "$$13 :", "identifier_declaration_list : error $$13 SEMICOLON", "identifier_decl : id SEMICOLON", "include_directive : INCLUDE UILFILE character_8_value SEMICOLON", "$$14 :", "include_directive : error $$14 SEMICOLON", "$$15 :", "object_declaration : OBJECT $$15 object_decl_list", "object_decl_list : object_decl SEMICOLON", "object_decl_list : object_decl_list object_decl SEMICOLON", "$$16 :", "object_decl_list : error $$16 SEMICOLON", "$$17 :", "object_decl : id $$17 COLON object_definition", "$$18 :", "object_definition : EXPORTED $$18 object_specification", "$$19 :", "object_definition : PRIVATE $$19 object_specification", "$$20 :", "object_definition : epsilon_production $$20 object_specification", "$$21 :", "$$22 :", "object_definition : IMPORTED $$21 CLASS_NAME $$22 opt_create_proc_ref epsilon_production", "$$23 :", "control_object_definition : EXPORTED $$23 object_specification", "$$24 :", "control_object_definition : PRIVATE $$24 object_specification", "$$25 :", "control_object_definition : MANAGED $$25 object_specification", "$$26 :", "control_object_definition : UNMANAGED $$26 object_specification", "$$27 :", "control_object_definition : epsilon_production $$27 object_specification", "$$28 :", "$$29 :", "control_object_definition : IMPORTED $$28 CLASS_NAME $$29 epsilon_production", "$$30 :", "object_specification : CLASS_NAME $$30 opt_create_proc_ref opt_variant object_spec", "opt_variant : epsilon_production", "opt_variant : variant", "$$31 :", "control_object_specification : CLASS_NAME $$31 opt_create_proc_ref opt_variant control_object_spec", "opt_create_proc_ref : epsilon_production", "opt_create_proc_ref : PROCEDURE id_ref opt_parens", "opt_parens : epsilon_production", "opt_parens : LEFT_PAREN RIGHT_PAREN", "object_spec : id_ref", "object_spec : LEFT_BRACE RIGHT_BRACE", "object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE", "$$32 :", "object_spec : error $$32 RIGHT_BRACE", "control_object_spec : id_ref", "control_object_spec : LEFT_BRACE RIGHT_BRACE epsilon_production", "control_object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production", "$$33 :", "control_object_spec : error $$33 RIGHT_BRACE", "child_object_spec : LEFT_BRACE RIGHT_BRACE epsilon_production", "child_object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production", "$$34 :", "child_object_spec : error $$34 RIGHT_BRACE", "object_feature_list : object_feature", "object_feature_list : object_feature_list object_feature", "object_feature : argument_list_def SEMICOLON", "object_feature : callback_list_def SEMICOLON", "object_feature : control_list_def SEMICOLON", "$$35 :", "object_feature : error $$35 SEMICOLON", "epsilon_production :", "$$36 :", "list_declaration : LIST $$36 list_decl_list", "list_decl_list : list_decl SEMICOLON", "list_decl_list : list_decl_list list_decl SEMICOLON", "$$37 :", "list_decl_list : error $$37 SEMICOLON", "$$38 :", "list_decl : id $$38 COLON list_specification", "list_specification : control_list_specification", "list_specification : argument_list_specification", "list_specification : callback_list_specification", "list_specification : procedure_list_specification", "$$39 :", "control_list_specification : control_list_type $$39 control_list_spec", "$$40 :", "argument_list_specification : argument_list_type $$40 argument_list_spec", "$$41 :", "callback_list_specification : callback_list_type $$41 callback_list_spec", "$$42 :", "procedure_list_specification : procedure_list_type $$42 procedure_list_spec", "argument_list_type : ARGUMENTS", "callback_list_type : CALLBACKS", "procedure_list_type : PROCEDURES", "control_list_type : CONTROLS", "argument_list_spec : id_ref", "argument_list_spec : LEFT_BRACE RIGHT_BRACE", "argument_list_spec : LEFT_BRACE argument_list_clause_list RIGHT_BRACE", "$$43 :", "argument_list_spec : error $$43 RIGHT_BRACE", "callback_list_spec : id_ref", "callback_list_spec : LEFT_BRACE RIGHT_BRACE", "callback_list_spec : LEFT_BRACE callback_list_clause_list RIGHT_BRACE", "$$44 :", "callback_list_spec : error $$44 RIGHT_BRACE", "procedure_list_spec : id_ref", "procedure_list_spec : LEFT_BRACE RIGHT_BRACE", "procedure_list_spec : LEFT_BRACE procedure_list_clause_list RIGHT_BRACE", "$$45 :", "procedure_list_spec : error $$45 RIGHT_BRACE", "control_list_spec : id_ref", "control_list_spec : LEFT_BRACE RIGHT_BRACE", "control_list_spec : LEFT_BRACE control_list_clause_list RIGHT_BRACE", "$$46 :", "control_list_spec : error $$46 RIGHT_BRACE", "argument_list_clause_list : argument_list_clause", "argument_list_clause_list : argument_list_clause_list argument_list_clause", "callback_list_clause_list : callback_list_clause", "callback_list_clause_list : callback_list_clause_list callback_list_clause", "procedure_list_clause_list : procedure_list_clause", "procedure_list_clause_list : procedure_list_clause_list procedure_list_clause", "control_list_clause_list : control_list_clause", "control_list_clause_list : control_list_clause_list control_list_clause", "argument_list_clause : argument_list_def SEMICOLON", "argument_list_clause : argument_list_item SEMICOLON", "$$47 :", "argument_list_clause : error $$47 SEMICOLON", "callback_list_clause : callback_list_def SEMICOLON", "callback_list_clause : callback_list_item SEMICOLON", "$$48 :", "callback_list_clause : error $$48 SEMICOLON", "procedure_list_clause : procedure_list_def SEMICOLON", "procedure_list_clause : procedure_list_def_ref SEMICOLON", "$$49 :", "procedure_list_clause : error $$49 SEMICOLON", "control_list_clause : control_list_def SEMICOLON", "control_list_clause : control_list_item SEMICOLON", "$$50 :", "control_list_clause : error $$50 SEMICOLON", "$$51 :", "control_list_def : epsilon_production $$51 control_list_specification", "$$52 :", "argument_list_def : epsilon_production $$52 argument_list_specification", "$$53 :", "callback_list_def : epsilon_production $$53 callback_list_specification", "$$54 :", "procedure_list_def : epsilon_production $$54 procedure_list_specification", "control_list_item : opt_managed control_item", "$$55 :", "control_list_item : id $$55 COLON control_object_definition", "$$56 :", "control_list_item : CHILD_NAME opt_child_managed $$56 child_object_spec", "$$57 :", "control_list_item : CHILD_NAME UNMANAGED $$57 child_object_spec", "opt_child_managed : epsilon_production", "opt_child_managed : MANAGED", "argument_list_item : value EQUAL_SIGN value", "argument_list_item : value EQUAL_SIGN CLASS_NAME id_ref", "callback_list_item : value EQUAL_SIGN procedure_reference", "callback_list_item : value EQUAL_SIGN procedure_list_def", "$$58 :", "control_item : epsilon_production $$58 control_object_specification", "opt_managed : epsilon_production", "opt_managed : MANAGED", "opt_managed : UNMANAGED", "procedure_reference : PROCEDURE id_ref opt_procedure_argument", "procedure_list_def_ref : id_ref opt_procedure_argument", "opt_procedure_argument : epsilon_production", "opt_procedure_argument : LEFT_PAREN value RIGHT_PAREN", "opt_procedure_argument : LEFT_PAREN CLASS_NAME id_ref RIGHT_PAREN", "opt_procedure_argument : LEFT_PAREN RIGHT_PAREN", "id : NAME", "id : FONT_NAME", "id : COLOR_NAME", "id : ARGUMENT_NAME", "id : REASON_NAME", "id : ENUMVAL_NAME", "id : CHILD_NAME", "id : keyword", "id_ref : id", "keyword : STRING", "keyword : BOOLEAN", "keyword : FLOAT", "keyword : INTEGER", "keyword : FONT", "keyword : ARGUMENT", "keyword : REASON", "keyword : PIXMAP", "keyword : COLOR", "keyword : NAMES", "keyword : CASE_SENSITIVE", "keyword : CASE_INSENSITIVE", "keyword : VERSION", "keyword : MANAGED", "keyword : UNMANAGED", "keyword : UILFILE", "keyword : string_table_type", "keyword : asciz_table_type", "keyword : INTEGER_TABLE", "keyword : TRANSLATION_TABLE", "keyword : COMPOUND_STRING", "keyword : COMPOUND_STRING_COMPONENT", "keyword : CLASS_REC_NAME", "keyword : FONT_TABLE", "keyword : RIGHT_TO_LEFT", "keyword : CHARACTER_SET", "keyword : COLOR_TABLE", "keyword : ICON", "keyword : BACKGROUND", "keyword : FOREGROUND", "keyword : XBITMAPFILE", "keyword : SEPARATE", "keyword : ANY", "keyword : IMPORTED", "keyword : OBJECTS", "keyword : KEYSYM", "keyword : SINGLE_FLOAT", "keyword : RGB", "keyword : WIDE_CHARACTER", "keyword : FONTSET", "character_8_value : value", "private_value : value", "private_value_plus : non_export_value", "private_value_plus : value", "non_export_value : COLOR_TABLE LEFT_PAREN color_list RIGHT_PAREN", "value : value_1", "value : value OR value_1", "value : value XOR value_1", "value_1 : value_2", "value_1 : value_1 AND value_2", "value_2 : value_3", "value_2 : value_2 LEFT_SHIFT value_3", "value_2 : value_2 RIGHT_SHIFT value_3", "value_3 : value_4", "value_3 : value_3 PLUS value_4", "value_3 : value_3 MINUS value_4", "value_4 : value_5", "value_4 : value_4 MULTIPLY value_5", "value_4 : value_4 DIVIDE value_5", "value_5 : value_6", "value_5 : MINUS value_5", "value_5 : NOT value_5", "value_5 : PLUS value_5", "value_6 : operand", "value_6 : LEFT_PAREN value RIGHT_PAREN", "operand : UNS_INT_LITERAL", "operand : UNS_INT_LITERAL units_specification", "operand : optional_charset CHAR_8_LITERAL", "operand : id", "operand : UNS_FLOAT_LITERAL", "operand : UNS_FLOAT_LITERAL units_specification", "operand : PIXMAP LEFT_PAREN character_8_value RIGHT_PAREN", "operand : FONT LEFT_PAREN font_spec RIGHT_PAREN", "operand : FONTSET LEFT_PAREN fontset_spec RIGHT_PAREN", "operand : COLOR LEFT_PAREN color_spec RIGHT_PAREN", "operand : REASON LEFT_PAREN character_8_value RIGHT_PAREN", "operand : CLASS_REC_NAME LEFT_PAREN character_8_value RIGHT_PAREN", "operand : ARGUMENT LEFT_PAREN character_8_value opt_arg_type RIGHT_PAREN", "operand : UILTRUE", "operand : UILFALSE", "operand : ON", "operand : OFF", "operand : optional_charset COMP_STRING", "operand : string_table_type LEFT_PAREN comp_str_list RIGHT_PAREN", "operand : asciz_table_type LEFT_PAREN asciz_list RIGHT_PAREN", "operand : INTEGER_TABLE LEFT_PAREN integer_list RIGHT_PAREN", "operand : TRANSLATION_TABLE LEFT_PAREN string_list RIGHT_PAREN", "operand : COMPOUND_STRING LEFT_PAREN comp_str_result RIGHT_PAREN", "operand : COMPOUND_STRING_COMPONENT LEFT_PAREN comp_str_comp_result RIGHT_PAREN", "operand : FONT_TABLE LEFT_PAREN font_list RIGHT_PAREN", "operand : ICON LEFT_PAREN icon_spec RIGHT_PAREN", "operand : FLOAT LEFT_PAREN value RIGHT_PAREN", "operand : INTEGER LEFT_PAREN value RIGHT_PAREN", "operand : XBITMAPFILE LEFT_PAREN character_8_value RIGHT_PAREN", "operand : KEYSYM LEFT_PAREN character_8_value RIGHT_PAREN", "operand : SINGLE_FLOAT LEFT_PAREN value RIGHT_PAREN", "operand : RGB LEFT_PAREN rgb_list RIGHT_PAREN", "operand : WIDE_CHARACTER LEFT_PAREN wchar_str_result RIGHT_PAREN", "operand : LOC_STRING", "string_list :", "string_list : string_list_2", "string_list_2 : private_value", "string_list_2 : string_list_2 COMMA private_value", "asciz_list :", "asciz_list : asciz_list_2", "asciz_list_2 : private_value", "asciz_list_2 : asciz_list_2 COMMA private_value", "integer_list :", "integer_list : integer_list_2", "integer_list_2 : private_value", "integer_list_2 : integer_list_2 COMMA private_value", "rgb_list : private_value COMMA private_value COMMA private_value", "comp_str_list :", "comp_str_list : comp_str_list_2", "comp_str_list_2 : private_value", "comp_str_list_2 : comp_str_list_2 COMMA private_value", "opt_arg_type :", "opt_arg_type : COMMA arg_value_type", "opt_arg_type : COMMA ANY", "comp_str_result : private_value", "comp_str_result : private_value comp_str_attrs", "comp_str_comp_result : ENUMVAL_NAME", "comp_str_comp_result : ENUMVAL_NAME COMMA ENUMVAL_NAME", "comp_str_comp_result : ENUMVAL_NAME COMMA CHAR_8_LITERAL", "comp_str_comp_result : ENUMVAL_NAME COMMA LOC_STRING", "comp_str_comp_result : ENUMVAL_NAME COMMA CHARSET_NAME", "comp_str_attrs : COMMA comp_str_attr", "comp_str_attrs : comp_str_attrs COMMA comp_str_attr", "comp_str_attr : CHARACTER_SET EQUAL_SIGN valid_charset", "comp_str_attr : RIGHT_TO_LEFT EQUAL_SIGN private_value", "comp_str_attr : SEPARATE EQUAL_SIGN private_value", "wchar_str_result : private_value", "font_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset", "font_spec : character_8_value", "fontset_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset", "fontset_spec : character_8_value", "font_list : font_item", "font_list : font_list COMMA font_item", "font_item : valid_charset EQUAL_SIGN private_value", "font_item : private_value", "optional_charset : POUND valid_charset", "optional_charset : epsilon_production", "valid_charset : CHARSET_NAME", "valid_charset : CHARACTER_SET LEFT_PAREN charset_info RIGHT_PAREN", "valid_charset : NAME", "charset_info : character_8_value", "charset_info : character_8_value charset_attrs", "charset_attrs : COMMA charset_attr", "charset_attrs : charset_attrs COMMA charset_attr", "charset_attr : RIGHT_TO_LEFT EQUAL_SIGN private_value", "charset_attr : SIXTEEN_BIT EQUAL_SIGN private_value", "color_list : color_item", "color_list : color_list COMMA color_item", "color_item : BACKGROUND COLOR EQUAL_SIGN character_8_value", "color_item : FOREGROUND COLOR EQUAL_SIGN character_8_value", "color_item : value EQUAL_SIGN character_8_value", "color_spec : character_8_value", "color_spec : character_8_value COMMA mono_color_spec", "mono_color_spec : BACKGROUND", "mono_color_spec : FOREGROUND", "icon_spec : icon_rows", "icon_spec : COLOR_TABLE EQUAL_SIGN private_value COMMA icon_rows", "icon_rows : private_value", "icon_rows : icon_rows COMMA private_value", "units_specification : PIX", "units_specification : PIXEL", "units_specification : PIXELS", "units_specification : IN", "units_specification : INCH", "units_specification : INCHES", "units_specification : CM", "units_specification : CENTIMETER", "units_specification : CENTIMETERS", "units_specification : MM", "units_specification : MILLIMETER", "units_specification : MILLIMETERS", "units_specification : PT", "units_specification : POINT", "units_specification : POINTS", "units_specification : FU", "units_specification : FONT_UNIT", "units_specification : FONT_UNITS", }; #endif int yydebug; int yynerrs; int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 10000 #endif #endif #define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; YYINT *s_base; YYINT *s_mark; YYINT *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; #line 1403 "Uil.y" /* Dummy error routine for the parser. We will output our own error messages. */ int yyerror (s) char * s; { return 0; } #line 2206 "Uil.c" #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; YYINT *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return YYENOMEM; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return YYENOMEM; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; YYERROR_CALL("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == YYEOF) goto yyabort; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 1: #line 239 "Uil.y" { sar_save_module_source (); } break; case 3: #line 244 "Uil.y" { sar_create_root ( &yyval ); } break; case 4: #line 245 "Uil.y" { sar_create_module( &yyval, &yystack.l_mark[0], &yystack.l_mark[-1] ); } break; case 10: #line 260 "Uil.y" { sar_process_module_version( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 11: #line 261 "Uil.y" { sar_process_module_sensitivity( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 12: #line 262 "Uil.y" { sar_process_module_charset( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 13: #line 263 "Uil.y" { sar_make_def_obj (&yystack.l_mark[0]); } break; case 19: #line 274 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 23: #line 280 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 25: #line 284 "Uil.y" { sar_make_def_obj (&yystack.l_mark[0]); } break; case 26: #line 285 "Uil.y" { sar_process_module_variant (&yystack.l_mark[-3], &yystack.l_mark[0]); yyval = gz_yynullval; } break; case 27: #line 289 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_widget_entry; } break; case 28: #line 290 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_gadget_entry; } break; case 37: #line 312 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_value_section); } break; case 41: #line 318 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 43: #line 322 "Uil.y" { sar_bind_value_name( &yystack.l_mark[-3], &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 44: #line 326 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_exported; yyval.b_flags &= ~sym_m_private; } break; case 45: #line 327 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_private; yyval.b_flags &= ~sym_m_exported; } break; case 46: #line 328 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_private; yyval.b_flags &= ~sym_m_exported; } break; case 47: #line 329 "Uil.y" { sar_import_value_entry( &yyval, &yystack.l_mark[0] ); } break; case 48: #line 333 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_value; } break; case 49: #line 334 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_char_8_value; } break; case 50: #line 335 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_pixmap_value; } break; case 51: #line 336 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_float_value; } break; case 52: #line 337 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_bool_value; } break; case 53: #line 338 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_value; } break; case 54: #line 339 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_reason_value; } break; case 55: #line 340 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_argument_value; } break; case 56: #line 341 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_color_value; } break; case 57: #line 342 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_string_table_value; } break; case 58: #line 343 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_asciz_table_value; } break; case 59: #line 344 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_table_value; } break; case 60: #line 345 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_trans_table_value; } break; case 61: #line 346 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_table_value; } break; case 62: #line 347 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_icon_value; } break; case 63: #line 348 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 64: #line 349 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 65: #line 350 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_class_rec_name_value; } break; case 66: #line 351 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_xbitmapfile_value; } break; case 67: #line 352 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_keysym_value; } break; case 68: #line 353 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_single_float_value; } break; case 69: #line 354 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_rgb_value; } break; case 70: #line 355 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_wchar_string_value; } break; case 71: #line 356 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_fontset_value; } break; case 72: #line 357 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_widget_ref_value; } break; case 73: #line 362 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_value; } break; case 74: #line 363 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_char_8_value; } break; case 75: #line 364 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_pixmap_value; } break; case 76: #line 365 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_float_value; } break; case 77: #line 366 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_bool_value; } break; case 78: #line 367 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_value; } break; case 79: #line 368 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_reason_value; } break; case 80: #line 369 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_color_value; } break; case 81: #line 370 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_string_table_value; } break; case 82: #line 371 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_asciz_table_value; } break; case 83: #line 372 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_table_value; } break; case 84: #line 373 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_trans_table_value; } break; case 85: #line 374 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_table_value; } break; case 86: #line 375 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_icon_value; } break; case 87: #line 376 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 88: #line 377 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_keysym_value; } break; case 89: #line 378 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_single_float_value; } break; case 90: #line 379 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_wchar_string_value; } break; case 91: #line 380 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_fontset_value; } break; case 92: #line 381 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_widget_ref_value; } break; case 97: #line 398 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_procedure_section); } break; case 101: #line 404 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 103: #line 408 "Uil.y" { sar_create_procedure( &yystack.l_mark[-3], &yystack.l_mark[-2], &yystack.l_mark[-1], &yystack.l_mark[0] );} break; case 104: #line 412 "Uil.y" { yyval = gz_yynullval; } break; case 105: #line 413 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 106: #line 417 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_no_value; } break; case 108: #line 419 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_any_value; } break; case 109: #line 422 "Uil.y" { YYSTYPE temp[2]; temp[0] = gz_yynullval; sar_create_object(&temp[0], sym_k_widget_entry); temp[1] = yystack.l_mark[0]; sar_set_object_class(&temp[1]); sar_verify_object(&temp[1]); yyval = temp[0]; } break; case 110: #line 432 "Uil.y" { yyval.b_flags = sym_m_private; } break; case 111: #line 445 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_identifier_section); } break; case 115: #line 451 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 117: #line 455 "Uil.y" { sar_create_identifier ( &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 118: #line 465 "Uil.y" { sar_include_file (&yystack.l_mark[-1], &yystack.l_mark[-3], &yystack.l_mark[0]); } break; case 119: #line 466 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 121: #line 474 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_object_section); } break; case 123: #line 478 "Uil.y" { yyval = yystack.l_mark[-1]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 124: #line 479 "Uil.y" { yyval = yystack.l_mark[-2]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 125: #line 480 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 127: #line 485 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_widget_entry); sar_link_section (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 128: #line 488 "Uil.y" { yyval = gz_yynullval; } break; case 129: #line 493 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 131: #line 496 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_private); } break; case 133: #line 499 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 135: #line 502 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_imported); } break; case 136: #line 504 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 137: #line 514 "Uil.y" { sar_verify_object (&yystack.l_mark[-5]); } break; case 138: #line 519 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 140: #line 522 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_private); } break; case 142: #line 525 "Uil.y" { sar_set_object_flags (& yystack.l_mark[0], (sym_m_managed | sym_m_exported)); } break; case 144: #line 528 "Uil.y" { sar_unset_object_flags (& yystack.l_mark[0], sym_m_managed), sar_set_object_flags (& yystack.l_mark[0], sym_m_exported); } break; case 146: #line 531 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 148: #line 534 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_imported); } break; case 149: #line 536 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 150: #line 538 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 151: #line 543 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 152: #line 547 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 153: #line 552 "Uil.y" { sar_set_object_variant (&yystack.l_mark[0]); } break; case 154: #line 554 "Uil.y" { sar_set_object_variant (&yystack.l_mark[0]); } break; case 155: #line 559 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 156: #line 563 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 158: #line 569 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &gz_yynullval, sym_k_object_proc); sar_save_user_proc_ref_src ( &yystack.l_mark[-2], &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 160: #line 575 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 161: #line 585 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 164: #line 588 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 166: #line 593 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 167: #line 596 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-2], sym_m_exported); } break; case 168: #line 599 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-3], sym_m_exported); } break; case 169: #line 600 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 171: #line 606 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-2], sym_m_private); } break; case 172: #line 609 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-3], sym_m_private); } break; case 173: #line 610 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 177: #line 620 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 178: #line 622 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 179: #line 624 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); sar_update_parent_list (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 180: #line 626 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 182: #line 631 "Uil.y" { yyval = gz_yynullval; } break; case 183: #line 639 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_list_section); } break; case 185: #line 644 "Uil.y" { yyval = yystack.l_mark[-1]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 186: #line 645 "Uil.y" { yyval = yystack.l_mark[-2]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 187: #line 646 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 189: #line 651 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_list_entry); sar_link_section (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 190: #line 654 "Uil.y" { yyval = gz_yynullval; } break; case 195: #line 666 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 196: #line 668 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 197: #line 673 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 198: #line 675 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 199: #line 680 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 200: #line 682 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 201: #line 687 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 202: #line 689 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 203: #line 694 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_argument_list; } break; case 204: #line 699 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_callback_list; } break; case 205: #line 704 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_proc_ref_list; } break; case 206: #line 708 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_control_list; } break; case 207: #line 712 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 210: #line 715 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 212: #line 719 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 215: #line 722 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 217: #line 727 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 220: #line 730 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 222: #line 734 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 225: #line 737 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 235: #line 762 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 236: #line 764 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 237: #line 765 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 239: #line 770 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 240: #line 772 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 241: #line 773 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 243: #line 778 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 244: #line 780 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 245: #line 781 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 247: #line 786 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 248: #line 788 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 249: #line 789 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 251: #line 794 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 252: #line 796 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 253: #line 801 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 254: #line 803 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 255: #line 808 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 256: #line 810 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 257: #line 815 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 258: #line 817 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 259: #line 825 "Uil.y" { sar_save_control_item (&yystack.l_mark[-1], &yystack.l_mark[0]); yyval = yystack.l_mark[-1]; } break; case 260: #line 828 "Uil.y" { sar_create_object (& yystack.l_mark[0], sym_k_widget_entry); yystack.l_mark[0].b_flags = sym_m_managed; yyval = gz_yynullval;} break; case 261: #line 831 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 262: #line 834 "Uil.y" { sar_create_child (& yystack.l_mark[-1]); yystack.l_mark[-1].b_flags = sym_m_managed; yyval = gz_yynullval; } break; case 263: #line 837 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 264: #line 839 "Uil.y" { sar_create_child (& yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 265: #line 841 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-1]); yyval = yystack.l_mark[-3]; } break; case 268: #line 855 "Uil.y" { sar_save_argument_pair (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 269: #line 860 "Uil.y" { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = yystack.l_mark[-1]; sar_set_object_class (&temp [1]); temp [1] = yystack.l_mark[0]; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); sar_save_argument_pair (&yystack.l_mark[-3], &temp [0], &yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 270: #line 874 "Uil.y" { sar_save_reason_binding (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 271: #line 876 "Uil.y" { sar_save_reason_binding (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 272: #line 881 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_widget_entry); yyval = gz_yynullval; } break; case 273: #line 883 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 274: #line 888 "Uil.y" { yyval.b_flags = sym_m_managed; } break; case 275: #line 890 "Uil.y" { yyval = gz_yynullval; yyval.b_flags = sym_m_managed; } break; case 276: #line 892 "Uil.y" { yyval = gz_yynullval; } break; case 277: #line 897 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &yystack.l_mark[0], sym_k_callback_proc); yyval = yystack.l_mark[-1]; } break; case 278: #line 902 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &yystack.l_mark[0], sym_k_callback_proc); yyval = yystack.l_mark[-1]; } break; case 280: #line 908 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 281: #line 910 "Uil.y" { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = yystack.l_mark[-2]; sar_set_object_class (&temp [1]); temp [1] = yystack.l_mark[-1]; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); yyval = temp [0]; } break; case 282: #line 918 "Uil.y" { yyval = gz_yynullval; } break; case 290: #line 933 "Uil.y" { sar_map_keyword_to_name( &yyval, &yystack.l_mark[0]); } break; case 291: #line 940 "Uil.y" { sar_process_id_ref (&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 332: #line 998 "Uil.y" { yyval = yystack.l_mark[0]; if ((yyval.b_type != sym_k_error_value) && (yyval.b_type != sym_k_any_value) && ((yyval.b_flags &sym_m_forward_ref) == 0)) { if ((yyval.b_type != sym_k_char_8_value) && (yyval.b_type != sym_k_localized_string_value)) sar_value_type_error( &yyval, sym_k_char_8_value ); if ((yyval.b_flags &sym_m_private) == 0) sar_private_error( &yyval ); } } break; case 333: #line 1014 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 334: #line 1027 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 335: #line 1035 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 336: #line 1045 "Uil.y" { sar_make_color_table( &yyval, &yystack.l_mark[-1], &yystack.l_mark[-3]); } break; case 338: #line 1052 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 339: #line 1053 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 341: #line 1058 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 343: #line 1063 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 344: #line 1064 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 346: #line 1069 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 347: #line 1070 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 349: #line 1075 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 350: #line 1076 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 352: #line 1081 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 353: #line 1082 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 354: #line 1083 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 356: #line 1088 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 357: #line 1092 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_integer_value, &yystack.l_mark[0], XmPIXELS); } break; case 358: #line 1094 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_integer_value, &yystack.l_mark[-1], sar_get_units_type(&yystack.l_mark[0])); } break; case 359: #line 1096 "Uil.y" { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_char_8_value, &yystack.l_mark[0], 0); } break; case 360: #line 1100 "Uil.y" { sar_process_id( &yyval, &yystack.l_mark[0] );} break; case 361: #line 1101 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_float_value, &yystack.l_mark[0], XmPIXELS); } break; case 362: #line 1103 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_float_value, &yystack.l_mark[-1], sar_get_units_type(&yystack.l_mark[0])); } break; case 363: #line 1105 "Uil.y" { sar_value_not_implemented( &yyval, &yystack.l_mark[-3], "pixmap literal" ); } break; case 364: #line 1106 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 365: #line 1107 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 366: #line 1108 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 367: #line 1109 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_reason_value, &yystack.l_mark[-3], 0); } break; case 368: #line 1111 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_class_rec_name_value, &yystack.l_mark[-3], 0); } break; case 369: #line 1114 "Uil.y" { sar_make_private_value ( &yyval, &yystack.l_mark[-2], sym_k_argument_value, &yystack.l_mark[-4], yystack.l_mark[-1].b_type ); } break; case 370: #line 1116 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 371: #line 1118 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 372: #line 1120 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 373: #line 1122 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 374: #line 1124 "Uil.y" { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value ( &yyval, &yystack.l_mark[0], sym_k_compound_string_value, &yystack.l_mark[0], 0); } break; case 375: #line 1128 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_string_table_value, &yystack.l_mark[-3], 0); } break; case 376: #line 1130 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_asciz_table_value, &yystack.l_mark[-3], 0); } break; case 377: #line 1132 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_integer_table_value, &yystack.l_mark[-3], 0); } break; case 378: #line 1134 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_trans_table_value, &yystack.l_mark[-3], 0); } break; case 379: #line 1136 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 380: #line 1137 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 381: #line 1138 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 382: #line 1139 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 383: #line 1140 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 384: #line 1141 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 385: #line 1143 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_xbitmapfile_value, &yystack.l_mark[-3], 0); } break; case 386: #line 1146 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_keysym_value, &yystack.l_mark[-3], 0); } break; case 387: #line 1149 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 388: #line 1151 "Uil.y" { sar_make_private_value( & yyval, & yystack.l_mark[-1], sym_k_rgb_value, &yystack.l_mark[-3], 0); } break; case 389: #line 1153 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 390: #line 1154 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[0], sym_k_localized_string_value, &yystack.l_mark[0], 0); } break; case 391: #line 1160 "Uil.y" { yyval = gz_yynullval; } break; case 392: #line 1162 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 393: #line 1167 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_trans_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 394: #line 1169 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_trans_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 395: #line 1174 "Uil.y" { yyval = gz_yynullval; } break; case 396: #line 1176 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 397: #line 1181 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_asciz_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 398: #line 1183 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_asciz_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 399: #line 1188 "Uil.y" { yyval = gz_yynullval; } break; case 400: #line 1190 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 401: #line 1195 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_integer_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 402: #line 1197 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_integer_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 403: #line 1203 "Uil.y" {sar_append_table_value(&yystack.l_mark[-4], & gz_yynullval, sym_k_integer_table_value, & yystack.l_mark[-4]); sar_append_table_value(& yystack.l_mark[-2], & yystack.l_mark[-4], sym_k_integer_table_value, & yystack.l_mark[-3]); sar_append_table_value(& yystack.l_mark[0], & yystack.l_mark[-2], sym_k_integer_table_value, & yystack.l_mark[-1]); yyval = yystack.l_mark[0];} break; case 404: #line 1212 "Uil.y" { yyval = gz_yynullval; } break; case 405: #line 1214 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 406: #line 1219 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_string_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 407: #line 1221 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_string_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 408: #line 1225 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_any_value; } break; case 409: #line 1226 "Uil.y" { yyval = gz_yynullval; yyval.b_type = yystack.l_mark[0].b_type; } break; case 410: #line 1227 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_any_value; } break; case 411: #line 1231 "Uil.y" { sar_make_comp_str( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 412: #line 1232 "Uil.y" { sar_make_comp_str( &yyval, &yystack.l_mark[-1], &yystack.l_mark[0], &yystack.l_mark[-3] ); } break; case 413: #line 1236 "Uil.y" { sar_make_comp_str_comp(&yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 414: #line 1237 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 415: #line 1238 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 416: #line 1239 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 417: #line 1240 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 418: #line 1244 "Uil.y" { sar_chk_comp_str_attr( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 419: #line 1245 "Uil.y" { sar_chk_comp_str_attr( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 420: #line 1249 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.b_tag = yystack.l_mark[0].b_tag; yyval.value.az_keyword_entry = yystack.l_mark[0].value.az_keyword_entry; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 421: #line 1253 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 422: #line 1255 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 423: #line 1260 "Uil.y" { sar_make_wchar_str( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 424: #line 1265 "Uil.y" { sar_make_font( &yyval, &yystack.l_mark[0], &yystack.l_mark[-4], &yystack.l_mark[-6] ); } break; case 425: #line 1266 "Uil.y" { sar_make_font( &yyval, &gz_yynullval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 426: #line 1271 "Uil.y" { sar_make_fontset( &yyval, &yystack.l_mark[0], &yystack.l_mark[-4], &yystack.l_mark[-6] ); } break; case 427: #line 1272 "Uil.y" { sar_make_fontset( &yyval, &gz_yynullval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 428: #line 1276 "Uil.y" { sar_make_font_table( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 429: #line 1277 "Uil.y" { sar_make_font_table( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2], &yystack.l_mark[-4] ); } break; case 430: #line 1284 "Uil.y" { sar_make_font_item( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 431: #line 1285 "Uil.y" { sar_make_font_item( &yyval, &gz_yynullval, &yystack.l_mark[0] ); } break; case 432: #line 1289 "Uil.y" { /* Don't use TRUE because it is a token not a Boolean! */ yyval = yystack.l_mark[0]; Uil_lex_l_charset_specified = 1;} break; case 434: #line 1297 "Uil.y" { sar_charset_verify (&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 435: #line 1298 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 436: #line 1299 "Uil.y" { sar_make_fallback_charset(&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 437: #line 1305 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[0], sym_k_char_8_value, &yystack.l_mark[0], 0); sar_make_charset (&yyval, &yyval, &gz_yynullval, &yystack.l_mark[0]); } break; case 438: #line 1308 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_char_8_value, &yystack.l_mark[-1], 0); sar_make_charset (&yyval, &yyval, &yystack.l_mark[0], &yystack.l_mark[-1]); } break; case 439: #line 1314 "Uil.y" { sar_chk_charset_attr( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 440: #line 1315 "Uil.y" { sar_chk_charset_attr( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 441: #line 1319 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; if (yystack.l_mark[0].b_type != sym_k_bool_value) sar_value_type_error( &yystack.l_mark[0], sym_k_bool_value ); yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 442: #line 1323 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; if (yystack.l_mark[0].b_type != sym_k_bool_value) sar_value_type_error( &yystack.l_mark[0], sym_k_bool_value ); yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 443: #line 1330 "Uil.y" { sar_append_color_item( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 444: #line 1331 "Uil.y" { sar_append_color_item( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 445: #line 1335 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-3], &yystack.l_mark[0] ); } break; case 446: #line 1336 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-3], &yystack.l_mark[0] ); } break; case 447: #line 1337 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 448: #line 1341 "Uil.y" { sar_make_color( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 449: #line 1342 "Uil.y" { sar_make_color( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 452: #line 1351 "Uil.y" { sar_make_icon( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2]); } break; case 453: #line 1353 "Uil.y" { sar_make_icon( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2], &yystack.l_mark[-6] ); } break; case 454: #line 1358 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_icon_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 455: #line 1360 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_icon_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 456: #line 1365 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 457: #line 1367 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 458: #line 1369 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 459: #line 1371 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 460: #line 1373 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 461: #line 1375 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 462: #line 1377 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 463: #line 1379 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 464: #line 1381 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 465: #line 1383 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 466: #line 1385 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 467: #line 1387 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 468: #line 1389 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 469: #line 1391 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 470: #line 1393 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 471: #line 1395 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 472: #line 1397 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 473: #line 1399 "Uil.y" { yyval = yystack.l_mark[0]; } break; #line 3799 "Uil.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == YYEOF) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } *++yystack.s_mark = (YYINT) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: YYERROR_CALL("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); } motif-2.3.8/tools/wml/UilSymGen.h0000644000175000017500000016307413211513006013552 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* Define literals for objects */ #define sym_k_DtEditor_object 1 #define sym_k_DtHelpDialog_object 2 #define sym_k_DtHelpQuickDialog_object 3 #define sym_k_DtMenuButton_object 4 #define sym_k_DtPrintSetupBox_object 5 #define sym_k_DtPrintSetupDialog_object 6 #define sym_k_DtTerm_object 7 #define sym_k_DtTermPrimitive_object 8 #define sym_k_XmArrowButton_object 9 #define sym_k_XmArrowButtonGadget_object 10 #define sym_k_XmBulletinBoard_object 11 #define sym_k_XmBulletinBoardDialog_object 12 #define sym_k_XmButtonBox_object 13 #define sym_k_XmCascadeButton_object 14 #define sym_k_XmCascadeButtonGadget_object 15 #define sym_k_XmCheckBox_object 16 #define sym_k_XmColorSelector_object 17 #define sym_k_XmColumn_object 18 #define sym_k_XmComboBox_object 19 #define sym_k_XmCommand_object 20 #define sym_k_XmCommandDialog_object 21 #define sym_k_XmContainer_object 22 #define sym_k_XmDataField_object 23 #define sym_k_XmDialogShell_object 24 #define sym_k_XmDrawingArea_object 25 #define sym_k_XmDrawnButton_object 26 #define sym_k_XmDropDown_object 27 #define sym_k_XmErrorDialog_object 28 #define sym_k_XmFileSelectionBox_object 29 #define sym_k_XmFileSelectionDialog_object 30 #define sym_k_XmFontSelector_object 31 #define sym_k_XmForm_object 32 #define sym_k_XmFormDialog_object 33 #define sym_k_XmFrame_object 34 #define sym_k_XmIconBox_object 35 #define sym_k_XmIconButton_object 36 #define sym_k_XmIconGadget_object 37 #define sym_k_XmInformationDialog_object 38 #define sym_k_XmLabel_object 39 #define sym_k_XmLabelGadget_object 40 #define sym_k_XmList_object 41 #define sym_k_XmMainWindow_object 42 #define sym_k_XmMenuBar_object 43 #define sym_k_XmMenuShell_object 44 #define sym_k_XmMessageBox_object 45 #define sym_k_XmMessageDialog_object 46 #define sym_k_XmMultiList_object 47 #define sym_k_XmNotebook_object 48 #define sym_k_XmOptionMenu_object 49 #define sym_k_XmOutline_object 50 #define sym_k_XmPaned_object 51 #define sym_k_XmPanedWindow_object 52 #define sym_k_XmPopupMenu_object 53 #define sym_k_XmPromptDialog_object 54 #define sym_k_XmPulldownMenu_object 55 #define sym_k_XmPushButton_object 56 #define sym_k_XmPushButtonGadget_object 57 #define sym_k_XmQuestionDialog_object 58 #define sym_k_XmRadioBox_object 59 #define sym_k_XmRenderTable_object 60 #define sym_k_XmRendition_object 61 #define sym_k_XmRowColumn_object 62 #define sym_k_XmScale_object 63 #define sym_k_XmScrollBar_object 64 #define sym_k_XmScrolledList_object 65 #define sym_k_XmScrolledText_object 66 #define sym_k_XmScrolledWindow_object 67 #define sym_k_XmSelectionBox_object 68 #define sym_k_XmSelectionDialog_object 69 #define sym_k_XmSeparator_object 70 #define sym_k_XmSeparatorGadget_object 71 #define sym_k_XmSimpleSpinBox_object 72 #define sym_k_XmSpinBox_object 73 #define sym_k_XmTab_object 74 #define sym_k_XmTabBox_object 75 #define sym_k_XmTabList_object 76 #define sym_k_XmTabStack_object 77 #define sym_k_XmTearOffButton_object 78 #define sym_k_XmTemplateDialog_object 79 #define sym_k_XmText_object 80 #define sym_k_XmTextField_object 81 #define sym_k_XmToggleButton_object 82 #define sym_k_XmToggleButtonGadget_object 83 #define sym_k_XmTree_object 84 #define sym_k_XmWarningDialog_object 85 #define sym_k_XmWorkArea_object 86 #define sym_k_XmWorkingDialog_object 87 #define sym_k_user_defined_object 88 /* Define literals for reasons */ #define sym_k_DtNcancelCallback_reason 1 #define sym_k_DtNcascadingCallback_reason 2 #define sym_k_DtNcloseCallback_reason 3 #define sym_k_DtNclosePrintDisplayCallback_reason 4 #define sym_k_DtNhyperLinkCallback_reason 5 #define sym_k_DtNinputVerifyCallback_reason 6 #define sym_k_DtNoutputLogCallback_reason 7 #define sym_k_DtNprintCallback_reason 8 #define sym_k_DtNsetupCallback_reason 9 #define sym_k_DtNstatusChangeCallback_reason 10 #define sym_k_DtNsubprocessTerminationCallback_reason 11 #define sym_k_DtNtextDeselectCallback_reason 12 #define sym_k_DtNtextSelectCallback_reason 13 #define sym_k_MrmNcreateCallback_reason 14 #define sym_k_XmNactivateCallback_reason 15 #define sym_k_XmNapplyCallback_reason 16 #define sym_k_XmNarmCallback_reason 17 #define sym_k_XmNbrowseSelectionCallback_reason 18 #define sym_k_XmNcancelCallback_reason 19 #define sym_k_XmNcascadingCallback_reason 20 #define sym_k_XmNcommandChangedCallback_reason 21 #define sym_k_XmNcommandEnteredCallback_reason 22 #define sym_k_XmNconvertCallback_reason 23 #define sym_k_XmNdecrementCallback_reason 24 #define sym_k_XmNdefaultActionCallback_reason 25 #define sym_k_XmNdestinationCallback_reason 26 #define sym_k_XmNdestroyCallback_reason 27 #define sym_k_XmNdisarmCallback_reason 28 #define sym_k_XmNdoubleClickCallback_reason 29 #define sym_k_XmNdragCallback_reason 30 #define sym_k_XmNentryCallback_reason 31 #define sym_k_XmNexposeCallback_reason 32 #define sym_k_XmNextendedSelectionCallback_reason 33 #define sym_k_XmNfocusCallback_reason 34 #define sym_k_XmNfocusMovedCallback_reason 35 #define sym_k_XmNgainPrimaryCallback_reason 36 #define sym_k_XmNhelpCallback_reason 37 #define sym_k_XmNincrementCallback_reason 38 #define sym_k_XmNinputCallback_reason 39 #define sym_k_XmNitemFoundCallback_reason 40 #define sym_k_XmNitemNotFoundCallback_reason 41 #define sym_k_XmNlosePrimaryCallback_reason 42 #define sym_k_XmNlosingFocusCallback_reason 43 #define sym_k_XmNmapCallback_reason 44 #define sym_k_XmNmodifyVerifyCallback_reason 45 #define sym_k_XmNmodifyVerifyCallbackWcs_reason 46 #define sym_k_XmNmotionVerifyCallback_reason 47 #define sym_k_XmNmultipleSelectionCallback_reason 48 #define sym_k_XmNnoMatchCallback_reason 49 #define sym_k_XmNnodeStateBegEndCallback_reason 50 #define sym_k_XmNnodeStateCallback_reason 51 #define sym_k_XmNnodeStateChangedCallback_reason 52 #define sym_k_XmNokCallback_reason 53 #define sym_k_XmNoutlineChangedCallback_reason 54 #define sym_k_XmNpageChangedCallback_reason 55 #define sym_k_XmNpageDecrementCallback_reason 56 #define sym_k_XmNpageIncrementCallback_reason 57 #define sym_k_XmNpictureErrorCallback_reason 58 #define sym_k_XmNpopdownCallback_reason 59 #define sym_k_XmNpopupCallback_reason 60 #define sym_k_XmNpopupHandlerCallback_reason 61 #define sym_k_XmNrealizeCallback_reason 62 #define sym_k_XmNresizeCallback_reason 63 #define sym_k_XmNselectCallback_reason 64 #define sym_k_XmNselectionCallback_reason 65 #define sym_k_XmNsimpleCallback_reason 66 #define sym_k_XmNsingleSelectionCallback_reason 67 #define sym_k_XmNtabSelectedCallback_reason 68 #define sym_k_XmNtearOffMenuActivateCallback_reason 69 #define sym_k_XmNtearOffMenuDeactivateCallback_reason 70 #define sym_k_XmNtoBottomCallback_reason 71 #define sym_k_XmNtoTopCallback_reason 72 #define sym_k_XmNtraversalCallback_reason 73 #define sym_k_XmNtraverseObscuredCallback_reason 74 #define sym_k_XmNunmapCallback_reason 75 #define sym_k_XmNunselectCallback_reason 76 #define sym_k_XmNupdateShellCallback_reason 77 #define sym_k_XmNupdateTextCallback_reason 78 #define sym_k_XmNvalidateCallback_reason 79 #define sym_k_XmNvalueChangedCallback_reason 80 #define sym_k_XmNverifyTextCallback_reason 81 /* Define literals for arguments */ #define sym_k_DtNallowSendEvents_arg 1 #define sym_k_DtNappCursorDefault_arg 2 #define sym_k_DtNappKeypadDefault_arg 3 #define sym_k_DtNautoShowCursorPosition_arg 4 #define sym_k_DtNautoWrap_arg 5 #define sym_k_DtNbackLabelString_arg 6 #define sym_k_DtNbackgroundIsSelect_arg 7 #define sym_k_DtNbaseHeight_arg 8 #define sym_k_DtNbaseWidth_arg 9 #define sym_k_DtNblinkRate_arg 10 #define sym_k_DtNbuttonFontList_arg 11 #define sym_k_DtNc132_arg 12 #define sym_k_DtNcascadePixmap_arg 13 #define sym_k_DtNcenterToggleLabel_arg 14 #define sym_k_DtNchangeAllButtonLabel_arg 15 #define sym_k_DtNchangeButtonLabel_arg 16 #define sym_k_DtNchangeFieldLabel_arg 17 #define sym_k_DtNcharCursorStyle_arg 18 #define sym_k_DtNcloseLabelString_arg 19 #define sym_k_DtNcolumns_arg 20 #define sym_k_DtNconsoleMode_arg 21 #define sym_k_DtNcopies_arg 22 #define sym_k_DtNcsWidth_arg 23 #define sym_k_DtNcurrentLineLabel_arg 24 #define sym_k_DtNcursorPosition_arg 25 #define sym_k_DtNcursorPositionVisible_arg 26 #define sym_k_DtNdescription_arg 27 #define sym_k_DtNdialogTitle_arg 28 #define sym_k_DtNeditable_arg 29 #define sym_k_DtNemulationId_arg 30 #define sym_k_DtNexecutionPolicy_arg 31 #define sym_k_DtNfileName_arg 32 #define sym_k_DtNfindButtonLabel_arg 33 #define sym_k_DtNfindChangeDialogTitle_arg 34 #define sym_k_DtNfindFieldLabel_arg 35 #define sym_k_DtNformatAllButtonLabel_arg 36 #define sym_k_DtNformatParagraphButtonLabel_arg 37 #define sym_k_DtNformatSettingsDialogTitle_arg 38 #define sym_k_DtNheightInc_arg 39 #define sym_k_DtNhelpFile_arg 40 #define sym_k_DtNhelpLabelString_arg 41 #define sym_k_DtNhelpOnHelpVolume_arg 42 #define sym_k_DtNhelpPrint_arg 43 #define sym_k_DtNhelpType_arg 44 #define sym_k_DtNhelpVolume_arg 45 #define sym_k_DtNinformationDialogTitle_arg 46 #define sym_k_DtNinsertLabel_arg 47 #define sym_k_DtNjumpScroll_arg 48 #define sym_k_DtNjustifyToggleLabel_arg 49 #define sym_k_DtNkshMode_arg 50 #define sym_k_DtNlabelFontList_arg 51 #define sym_k_DtNleftAlignToggleLabel_arg 52 #define sym_k_DtNleftMarginFieldLabel_arg 53 #define sym_k_DtNlocationId_arg 54 #define sym_k_DtNlogFile_arg 55 #define sym_k_DtNlogInhibit_arg 56 #define sym_k_DtNlogging_arg 57 #define sym_k_DtNmanPage_arg 58 #define sym_k_DtNmapOnOutput_arg 59 #define sym_k_DtNmapOnOutputDelay_arg 60 #define sym_k_DtNmarginBell_arg 61 #define sym_k_DtNmarginHeight_arg 62 #define sym_k_DtNmarginWidth_arg 63 #define sym_k_DtNmaxLength_arg 64 #define sym_k_DtNminimizeButtons_arg 65 #define sym_k_DtNmisspelledListLabel_arg 66 #define sym_k_DtNmoreLabelString_arg 67 #define sym_k_DtNnMarginBell_arg 68 #define sym_k_DtNoverstrike_arg 69 #define sym_k_DtNoverstrikeLabel_arg 70 #define sym_k_DtNpaperSize_arg 71 #define sym_k_DtNpointerBlank_arg 72 #define sym_k_DtNpointerBlankDelay_arg 73 #define sym_k_DtNpointerColor_arg 74 #define sym_k_DtNpointerColorBackground_arg 75 #define sym_k_DtNpointerShape_arg 76 #define sym_k_DtNprintDestination_arg 77 #define sym_k_DtNprintLabelString_arg 78 #define sym_k_DtNprintSetupMode_arg 79 #define sym_k_DtNprinter_arg 80 #define sym_k_DtNprinterInfoProc_arg 81 #define sym_k_DtNprinterName_arg 82 #define sym_k_DtNreverseVideo_arg 83 #define sym_k_DtNreverseWrap_arg 84 #define sym_k_DtNrightAlignToggleLabel_arg 85 #define sym_k_DtNrightMarginFieldLabel_arg 86 #define sym_k_DtNrows_arg 87 #define sym_k_DtNsaveLines_arg 88 #define sym_k_DtNscrollBarPolicy_arg 89 #define sym_k_DtNscrollHorizontal_arg 90 #define sym_k_DtNscrollLeftSide_arg 91 #define sym_k_DtNscrollTopSide_arg 92 #define sym_k_DtNscrollVertical_arg 93 #define sym_k_DtNselectFileProc_arg 94 #define sym_k_DtNselectPrinterProc_arg 95 #define sym_k_DtNshadowType_arg 96 #define sym_k_DtNshowNewWindowButton_arg 97 #define sym_k_DtNshowStatusLine_arg 98 #define sym_k_DtNspellDialogTitle_arg 99 #define sym_k_DtNspellFilter_arg 100 #define sym_k_DtNstickyNextCursor_arg 101 #define sym_k_DtNstickyPrevCursor_arg 102 #define sym_k_DtNstringData_arg 103 #define sym_k_DtNsubMenuId_arg 104 #define sym_k_DtNsubprocessArgv_arg 105 #define sym_k_DtNsubprocessCmd_arg 106 #define sym_k_DtNsubprocessExec_arg 107 #define sym_k_DtNsubprocessLoginShell_arg 108 #define sym_k_DtNsubprocessPid_arg 109 #define sym_k_DtNsubprocessTerminationCatch_arg 110 #define sym_k_DtNsunFunctionKeys_arg 111 #define sym_k_DtNtermDevice_arg 112 #define sym_k_DtNtermDeviceAllocate_arg 113 #define sym_k_DtNtermId_arg 114 #define sym_k_DtNtermName_arg 115 #define sym_k_DtNtermSlaveName_arg 116 #define sym_k_DtNtextBackground_arg 117 #define sym_k_DtNtextFontList_arg 118 #define sym_k_DtNtextForeground_arg 119 #define sym_k_DtNtextTranslations_arg 120 #define sym_k_DtNtopCharacter_arg 121 #define sym_k_DtNtopicTitle_arg 122 #define sym_k_DtNtotalLineCountLabel_arg 123 #define sym_k_DtNttyModes_arg 124 #define sym_k_DtNuserBoldFont_arg 125 #define sym_k_DtNuserFont_arg 126 #define sym_k_DtNverifyPrinterProc_arg 127 #define sym_k_DtNverticalScrollBar_arg 128 #define sym_k_DtNvisiblePathCount_arg 129 #define sym_k_DtNvisualBell_arg 130 #define sym_k_DtNwidthInc_arg 131 #define sym_k_DtNwordWrap_arg 132 #define sym_k_DtNworkAreaLocation_arg 133 #define sym_k_XmN100DPIstring_arg 134 #define sym_k_XmN75DPIstring_arg 135 #define sym_k_XmNaccelerator_arg 136 #define sym_k_XmNacceleratorText_arg 137 #define sym_k_XmNaccelerators_arg 138 #define sym_k_XmNadjustLast_arg 139 #define sym_k_XmNadjustMargin_arg 140 #define sym_k_XmNalignment_arg 141 #define sym_k_XmNallowOverlap_arg 142 #define sym_k_XmNallowResize_arg 143 #define sym_k_XmNallowShellResize_arg 144 #define sym_k_XmNallowUnusedSpace_arg 145 #define sym_k_XmNancestorSensitive_arg 146 #define sym_k_XmNanyLowerString_arg 147 #define sym_k_XmNanyString_arg 148 #define sym_k_XmNapplyLabelString_arg 149 #define sym_k_XmNarmColor_arg 150 #define sym_k_XmNarmPixmap_arg 151 #define sym_k_XmNarrowDirection_arg 152 #define sym_k_XmNarrowLayout_arg 153 #define sym_k_XmNarrowOrientation_arg 154 #define sym_k_XmNarrowSensitivity_arg 155 #define sym_k_XmNarrowSize_arg 156 #define sym_k_XmNarrowSpacing_arg 157 #define sym_k_XmNaudibleWarning_arg 158 #define sym_k_XmNautoClose_arg 159 #define sym_k_XmNautoDragModel_arg 160 #define sym_k_XmNautoFill_arg 161 #define sym_k_XmNautoShowCursorPosition_arg 162 #define sym_k_XmNautoUnmanage_arg 163 #define sym_k_XmNautomaticSelection_arg 164 #define sym_k_XmNbackPageBackground_arg 165 #define sym_k_XmNbackPageForeground_arg 166 #define sym_k_XmNbackPageNumber_arg 167 #define sym_k_XmNbackPagePlacement_arg 168 #define sym_k_XmNbackPageSize_arg 169 #define sym_k_XmNbackground_arg 170 #define sym_k_XmNbackgroundPixmap_arg 171 #define sym_k_XmNbaseHeight_arg 172 #define sym_k_XmNbaseWidth_arg 173 #define sym_k_XmNbindingPixmap_arg 174 #define sym_k_XmNbindingType_arg 175 #define sym_k_XmNbindingWidth_arg 176 #define sym_k_XmNblinkRate_arg 177 #define sym_k_XmNblueSliderLabel_arg 178 #define sym_k_XmNboldString_arg 179 #define sym_k_XmNborderColor_arg 180 #define sym_k_XmNborderPixmap_arg 181 #define sym_k_XmNborderWidth_arg 182 #define sym_k_XmNbothString_arg 183 #define sym_k_XmNbottomAttachment_arg 184 #define sym_k_XmNbottomOffset_arg 185 #define sym_k_XmNbottomPosition_arg 186 #define sym_k_XmNbottomShadowColor_arg 187 #define sym_k_XmNbottomShadowPixmap_arg 188 #define sym_k_XmNbottomWidget_arg 189 #define sym_k_XmNbuttonCount_arg 190 #define sym_k_XmNbuttonFontList_arg 191 #define sym_k_XmNbuttonRenderTable_arg 192 #define sym_k_XmNbuttons_arg 193 #define sym_k_XmNcancelButton_arg 194 #define sym_k_XmNcancelLabelString_arg 195 #define sym_k_XmNcascadePixmap_arg 196 #define sym_k_XmNcellX_arg 197 #define sym_k_XmNcellY_arg 198 #define sym_k_XmNchildHorizontalAlignment_arg 199 #define sym_k_XmNchildHorizontalSpacing_arg 200 #define sym_k_XmNchildPlacement_arg 201 #define sym_k_XmNchildType_arg 202 #define sym_k_XmNchildVerticalAlignment_arg 203 #define sym_k_XmNclipWindow_arg 204 #define sym_k_XmNcloseFolderPixmap_arg 205 #define sym_k_XmNcollapsedStatePixmap_arg 206 #define sym_k_XmNcolorListTogLabel_arg 207 #define sym_k_XmNcolorMode_arg 208 #define sym_k_XmNcolorName_arg 209 #define sym_k_XmNcolormap_arg 210 #define sym_k_XmNcolumnTitles_arg 211 #define sym_k_XmNcolumns_arg 212 #define sym_k_XmNcomboBoxType_arg 213 #define sym_k_XmNcomboTranslations_arg 214 #define sym_k_XmNcommand_arg 215 #define sym_k_XmNcommandWindow_arg 216 #define sym_k_XmNcommandWindowLocation_arg 217 #define sym_k_XmNcompressStyle_arg 218 #define sym_k_XmNconnectNodes_arg 219 #define sym_k_XmNconnectStyle_arg 220 #define sym_k_XmNconstrainWidth_arg 221 #define sym_k_XmNcreatePopupChildProc_arg 222 #define sym_k_XmNcurrentFont_arg 223 #define sym_k_XmNcurrentPageNumber_arg 224 #define sym_k_XmNcursor_arg 225 #define sym_k_XmNcursorPosition_arg 226 #define sym_k_XmNcursorPositionVisible_arg 227 #define sym_k_XmNcustomizedCombinationBox_arg 228 #define sym_k_XmNdarkThreshold_arg 229 #define sym_k_XmNdecimal_arg 230 #define sym_k_XmNdecimalPoints_arg 231 #define sym_k_XmNdefaultArrowSensitivity_arg 232 #define sym_k_XmNdefaultButton_arg 233 #define sym_k_XmNdefaultButtonShadowThickness_arg 234 #define sym_k_XmNdefaultButtonType_arg 235 #define sym_k_XmNdefaultEncodingString_arg 236 #define sym_k_XmNdefaultEntryLabelAlignment_arg 237 #define sym_k_XmNdefaultEntryLabelFontList_arg 238 #define sym_k_XmNdefaultEntryLabelRenderTable_arg 239 #define sym_k_XmNdefaultFillStyle_arg 240 #define sym_k_XmNdefaultFontList_arg 241 #define sym_k_XmNdefaultPosition_arg 242 #define sym_k_XmNdeleteResponse_arg 243 #define sym_k_XmNdepth_arg 244 #define sym_k_XmNdetail_arg 245 #define sym_k_XmNdetailColumnHeading_arg 246 #define sym_k_XmNdetailColumnHeadingCount_arg 247 #define sym_k_XmNdetailCount_arg 248 #define sym_k_XmNdetailOrder_arg 249 #define sym_k_XmNdetailOrderCount_arg 250 #define sym_k_XmNdetailShadowThickness_arg 251 #define sym_k_XmNdetailTabList_arg 252 #define sym_k_XmNdialogStyle_arg 253 #define sym_k_XmNdialogTitle_arg 254 #define sym_k_XmNdialogType_arg 255 #define sym_k_XmNdirListItemCount_arg 256 #define sym_k_XmNdirListItems_arg 257 #define sym_k_XmNdirListLabelString_arg 258 #define sym_k_XmNdirMask_arg 259 #define sym_k_XmNdirSearchProc_arg 260 #define sym_k_XmNdirSpec_arg 261 #define sym_k_XmNdirectory_arg 262 #define sym_k_XmNdirectoryValid_arg 263 #define sym_k_XmNdistribution_arg 264 #define sym_k_XmNdoubleClickInterval_arg 265 #define sym_k_XmNeditMode_arg 266 #define sym_k_XmNeditable_arg 267 #define sym_k_XmNencodingList_arg 268 #define sym_k_XmNencodingString_arg 269 #define sym_k_XmNentryAlignment_arg 270 #define sym_k_XmNentryBackground_arg 271 #define sym_k_XmNentryBorder_arg 272 #define sym_k_XmNentryClass_arg 273 #define sym_k_XmNentryData_arg 274 #define sym_k_XmNentryLabelAlignment_arg 275 #define sym_k_XmNentryLabelFontList_arg 276 #define sym_k_XmNentryLabelPixmap_arg 277 #define sym_k_XmNentryLabelRenderTable_arg 278 #define sym_k_XmNentryLabelString_arg 279 #define sym_k_XmNentryLabelType_arg 280 #define sym_k_XmNentryParent_arg 281 #define sym_k_XmNentryVerticalAlignment_arg 282 #define sym_k_XmNentryViewType_arg 283 #define sym_k_XmNequalSize_arg 284 #define sym_k_XmNexpandedStatePixmap_arg 285 #define sym_k_XmNfamilyString_arg 286 #define sym_k_XmNfileListItemCount_arg 287 #define sym_k_XmNfileListItems_arg 288 #define sym_k_XmNfileListLabelString_arg 289 #define sym_k_XmNfileReadError_arg 290 #define sym_k_XmNfileSearchProc_arg 291 #define sym_k_XmNfileTypeMask_arg 292 #define sym_k_XmNfillOnArm_arg 293 #define sym_k_XmNfillOnSelect_arg 294 #define sym_k_XmNfillOption_arg 295 #define sym_k_XmNfillStyle_arg 296 #define sym_k_XmNfilterLabelString_arg 297 #define sym_k_XmNfindLabel_arg 298 #define sym_k_XmNfirstColumn_arg 299 #define sym_k_XmNfirstColumnPixmaps_arg 300 #define sym_k_XmNfirstPageNumber_arg 301 #define sym_k_XmNfirstRow_arg 302 #define sym_k_XmNfont_arg 303 #define sym_k_XmNfontEncoding_arg 304 #define sym_k_XmNfontFoundry_arg 305 #define sym_k_XmNfontList_arg 306 #define sym_k_XmNfontName_arg 307 #define sym_k_XmNfontSize_arg 308 #define sym_k_XmNfontStyle_arg 309 #define sym_k_XmNfontType_arg 310 #define sym_k_XmNforeground_arg 311 #define sym_k_XmNforegroundThreshold_arg 312 #define sym_k_XmNfractionBase_arg 313 #define sym_k_XmNframeBackground_arg 314 #define sym_k_XmNframeChildType_arg 315 #define sym_k_XmNframeShadowThickness_arg 316 #define sym_k_XmNfreeTabPixmap_arg 317 #define sym_k_XmNgeometry_arg 318 #define sym_k_XmNgreenSliderLabel_arg 319 #define sym_k_XmNheight_arg 320 #define sym_k_XmNheightInc_arg 321 #define sym_k_XmNhelpLabelString_arg 322 #define sym_k_XmNhighlightColor_arg 323 #define sym_k_XmNhighlightOnEnter_arg 324 #define sym_k_XmNhighlightPixmap_arg 325 #define sym_k_XmNhighlightThickness_arg 326 #define sym_k_XmNhistoryItemCount_arg 327 #define sym_k_XmNhistoryItems_arg 328 #define sym_k_XmNhistoryMaxItems_arg 329 #define sym_k_XmNhistoryVisibleItemCount_arg 330 #define sym_k_XmNhorizontalDelta_arg 331 #define sym_k_XmNhorizontalMargin_arg 332 #define sym_k_XmNhorizontalNodeSpace_arg 333 #define sym_k_XmNhorizontalScrollBar_arg 334 #define sym_k_XmNhorizontalSpacing_arg 335 #define sym_k_XmNiconMask_arg 336 #define sym_k_XmNiconName_arg 337 #define sym_k_XmNiconNameEncoding_arg 338 #define sym_k_XmNiconPixmap_arg 339 #define sym_k_XmNiconPlacement_arg 340 #define sym_k_XmNiconTextPadding_arg 341 #define sym_k_XmNiconWindow_arg 342 #define sym_k_XmNiconX_arg 343 #define sym_k_XmNiconY_arg 344 #define sym_k_XmNiconic_arg 345 #define sym_k_XmNincrement_arg 346 #define sym_k_XmNincrementValue_arg 347 #define sym_k_XmNindentSpace_arg 348 #define sym_k_XmNindeterminateInsensitivePixmap_arg 349 #define sym_k_XmNindeterminatePixmap_arg 350 #define sym_k_XmNindicatorOn_arg 351 #define sym_k_XmNindicatorSize_arg 352 #define sym_k_XmNindicatorType_arg 353 #define sym_k_XmNinitialDelay_arg 354 #define sym_k_XmNinitialFocus_arg 355 #define sym_k_XmNinitialResourcesPersistent_arg 356 #define sym_k_XmNinitialState_arg 357 #define sym_k_XmNinnerMarginHeight_arg 358 #define sym_k_XmNinnerMarginWidth_arg 359 #define sym_k_XmNinput_arg 360 #define sym_k_XmNinputMethod_arg 361 #define sym_k_XmNinputPolicy_arg 362 #define sym_k_XmNinsertBefore_arg 363 #define sym_k_XmNinsertPosition_arg 364 #define sym_k_XmNisAligned_arg 365 #define sym_k_XmNisHomogeneous_arg 366 #define sym_k_XmNitalicString_arg 367 #define sym_k_XmNitemCount_arg 368 #define sym_k_XmNitemSpacing_arg 369 #define sym_k_XmNitems_arg 370 #define sym_k_XmNkeyboardFocusPolicy_arg 371 #define sym_k_XmNlabel_arg 372 #define sym_k_XmNlabelFontList_arg 373 #define sym_k_XmNlabelInsensitivePixmap_arg 374 #define sym_k_XmNlabelPixmap_arg 375 #define sym_k_XmNlabelRenderTable_arg 376 #define sym_k_XmNlabelSpacing_arg 377 #define sym_k_XmNlabelString_arg 378 #define sym_k_XmNlabelType_arg 379 #define sym_k_XmNlargeCellHeight_arg 380 #define sym_k_XmNlargeCellWidth_arg 381 #define sym_k_XmNlargeIconMask_arg 382 #define sym_k_XmNlargeIconPixmap_arg 383 #define sym_k_XmNlargeIconX_arg 384 #define sym_k_XmNlargeIconY_arg 385 #define sym_k_XmNlastPageNumber_arg 386 #define sym_k_XmNlayoutDirection_arg 387 #define sym_k_XmNlayoutType_arg 388 #define sym_k_XmNleftAttachment_arg 389 #define sym_k_XmNleftOffset_arg 390 #define sym_k_XmNleftPosition_arg 391 #define sym_k_XmNleftWidget_arg 392 #define sym_k_XmNlightThreshold_arg 393 #define sym_k_XmNlineBackgroundColor_arg 394 #define sym_k_XmNlineColor_arg 395 #define sym_k_XmNlineStyle_arg 396 #define sym_k_XmNlineWidth_arg 397 #define sym_k_XmNlist_arg 398 #define sym_k_XmNlistItemCount_arg 399 #define sym_k_XmNlistItems_arg 400 #define sym_k_XmNlistLabelString_arg 401 #define sym_k_XmNlistMarginHeight_arg 402 #define sym_k_XmNlistMarginWidth_arg 403 #define sym_k_XmNlistSizePolicy_arg 404 #define sym_k_XmNlistSpacing_arg 405 #define sym_k_XmNlistUpdated_arg 406 #define sym_k_XmNlistVisibleItemCount_arg 407 #define sym_k_XmNloadModel_arg 408 #define sym_k_XmNmainWindowMarginHeight_arg 409 #define sym_k_XmNmainWindowMarginWidth_arg 410 #define sym_k_XmNmajorTabSpacing_arg 411 #define sym_k_XmNmappedWhenManaged_arg 412 #define sym_k_XmNmappingDelay_arg 413 #define sym_k_XmNmargin_arg 414 #define sym_k_XmNmarginBottom_arg 415 #define sym_k_XmNmarginHeight_arg 416 #define sym_k_XmNmarginLeft_arg 417 #define sym_k_XmNmarginRight_arg 418 #define sym_k_XmNmarginTop_arg 419 #define sym_k_XmNmarginWidth_arg 420 #define sym_k_XmNmatchBehavior_arg 421 #define sym_k_XmNmaxAspectX_arg 422 #define sym_k_XmNmaxAspectY_arg 423 #define sym_k_XmNmaxHeight_arg 424 #define sym_k_XmNmaxLength_arg 425 #define sym_k_XmNmaxWidth_arg 426 #define sym_k_XmNmaximum_arg 427 #define sym_k_XmNmaximumValue_arg 428 #define sym_k_XmNmenuAccelerator_arg 429 #define sym_k_XmNmenuBar_arg 430 #define sym_k_XmNmenuHelpWidget_arg 431 #define sym_k_XmNmenuHistory_arg 432 #define sym_k_XmNmenuPost_arg 433 #define sym_k_XmNmessageAlignment_arg 434 #define sym_k_XmNmessageString_arg 435 #define sym_k_XmNmessageWindow_arg 436 #define sym_k_XmNminAspectX_arg 437 #define sym_k_XmNminAspectY_arg 438 #define sym_k_XmNminHeight_arg 439 #define sym_k_XmNminWidth_arg 440 #define sym_k_XmNminimizeButtons_arg 441 #define sym_k_XmNminimum_arg 442 #define sym_k_XmNminimumCellHeight_arg 443 #define sym_k_XmNminimumCellWidth_arg 444 #define sym_k_XmNminimumHorizontalCells_arg 445 #define sym_k_XmNminimumValue_arg 446 #define sym_k_XmNminimumVerticalCells_arg 447 #define sym_k_XmNminorTabSpacing_arg 448 #define sym_k_XmNmnemonic_arg 449 #define sym_k_XmNmnemonicCharSet_arg 450 #define sym_k_XmNmonoSpaceString_arg 451 #define sym_k_XmNmultiClick_arg 452 #define sym_k_XmNmustMatch_arg 453 #define sym_k_XmNmwmDecorations_arg 454 #define sym_k_XmNmwmFunctions_arg 455 #define sym_k_XmNmwmInputMode_arg 456 #define sym_k_XmNmwmMenu_arg 457 #define sym_k_XmNnavigationType_arg 458 #define sym_k_XmNnewVisualStyle_arg 459 #define sym_k_XmNnoCellError_arg 460 #define sym_k_XmNnoMatchString_arg 461 #define sym_k_XmNnoResize_arg 462 #define sym_k_XmNnodeCloseFolderPixmap_arg 463 #define sym_k_XmNnodeOpenFolderPixmap_arg 464 #define sym_k_XmNnodeState_arg 465 #define sym_k_XmNnotebookChildType_arg 466 #define sym_k_XmNnumColumns_arg 467 #define sym_k_XmNnumRows_arg 468 #define sym_k_XmNnumStacks_arg 469 #define sym_k_XmNnumValues_arg 470 #define sym_k_XmNoffsetModel_arg 471 #define sym_k_XmNokLabelString_arg 472 #define sym_k_XmNopenClosePadding_arg 473 #define sym_k_XmNopenFolderPixmap_arg 474 #define sym_k_XmNoptionString_arg 475 #define sym_k_XmNorientation_arg 476 #define sym_k_XmNotherString_arg 477 #define sym_k_XmNoutlineButtonPolicy_arg 478 #define sym_k_XmNoutlineColumnWidth_arg 479 #define sym_k_XmNoutlineIndentation_arg 480 #define sym_k_XmNoutlineLineStyle_arg 481 #define sym_k_XmNoutlineState_arg 482 #define sym_k_XmNoverrideRedirect_arg 483 #define sym_k_XmNpacking_arg 484 #define sym_k_XmNpageIncrement_arg 485 #define sym_k_XmNpageNumber_arg 486 #define sym_k_XmNpaneMaximum_arg 487 #define sym_k_XmNpaneMinimum_arg 488 #define sym_k_XmNparentNode_arg 489 #define sym_k_XmNpattern_arg 490 #define sym_k_XmNpendingDelete_arg 491 #define sym_k_XmNpicture_arg 492 #define sym_k_XmNpixmap_arg 493 #define sym_k_XmNpixmapDepth_arg 494 #define sym_k_XmNpixmapHeight_arg 495 #define sym_k_XmNpixmapPlacement_arg 496 #define sym_k_XmNpixmapTextPadding_arg 497 #define sym_k_XmNpixmapWidth_arg 498 #define sym_k_XmNpopupCursor_arg 499 #define sym_k_XmNpopupEnabled_arg 500 #define sym_k_XmNpopupOffset_arg 501 #define sym_k_XmNpopupShellWidget_arg 502 #define sym_k_XmNposition_arg 503 #define sym_k_XmNpositionIndex_arg 504 #define sym_k_XmNpositionMode_arg 505 #define sym_k_XmNpositionType_arg 506 #define sym_k_XmNpreeditType_arg 507 #define sym_k_XmNpreferredPaneSize_arg 508 #define sym_k_XmNprimaryOwnership_arg 509 #define sym_k_XmNprocessingDirection_arg 510 #define sym_k_XmNpromptString_arg 511 #define sym_k_XmNpropSpaceString_arg 512 #define sym_k_XmNpushButtonEnabled_arg 513 #define sym_k_XmNqualifySearchDataProc_arg 514 #define sym_k_XmNradioAlwaysOne_arg 515 #define sym_k_XmNradioBehavior_arg 516 #define sym_k_XmNrecomputeSize_arg 517 #define sym_k_XmNredSliderLabel_arg 518 #define sym_k_XmNrefigureMode_arg 519 #define sym_k_XmNrenderTable_arg 520 #define sym_k_XmNrenditionBackground_arg 521 #define sym_k_XmNrenditionForeground_arg 522 #define sym_k_XmNrepeatDelay_arg 523 #define sym_k_XmNresizable_arg 524 #define sym_k_XmNresizeHeight_arg 525 #define sym_k_XmNresizePolicy_arg 526 #define sym_k_XmNresizeToPreferred_arg 527 #define sym_k_XmNresizeWidth_arg 528 #define sym_k_XmNrgbFile_arg 529 #define sym_k_XmNrightAttachment_arg 530 #define sym_k_XmNrightOffset_arg 531 #define sym_k_XmNrightPosition_arg 532 #define sym_k_XmNrightWidget_arg 533 #define sym_k_XmNrowColumnType_arg 534 #define sym_k_XmNrows_arg 535 #define sym_k_XmNrubberPositioning_arg 536 #define sym_k_XmNsampleText_arg 537 #define sym_k_XmNsashHeight_arg 538 #define sym_k_XmNsashIndent_arg 539 #define sym_k_XmNsashShadowThickness_arg 540 #define sym_k_XmNsashTranslations_arg 541 #define sym_k_XmNsashWidth_arg 542 #define sym_k_XmNsaveUnder_arg 543 #define sym_k_XmNscaleHeight_arg 544 #define sym_k_XmNscaleMultiple_arg 545 #define sym_k_XmNscaleWidth_arg 546 #define sym_k_XmNscalingString_arg 547 #define sym_k_XmNscreen_arg 548 #define sym_k_XmNscrollBarDisplayPolicy_arg 549 #define sym_k_XmNscrollBarPlacement_arg 550 #define sym_k_XmNscrollHorizontal_arg 551 #define sym_k_XmNscrollLeftSide_arg 552 #define sym_k_XmNscrollTopSide_arg 553 #define sym_k_XmNscrollVertical_arg 554 #define sym_k_XmNscrolledWindowChildType_arg 555 #define sym_k_XmNscrolledWindowMarginHeight_arg 556 #define sym_k_XmNscrolledWindowMarginWidth_arg 557 #define sym_k_XmNscrollingPolicy_arg 558 #define sym_k_XmNselectColor_arg 559 #define sym_k_XmNselectInsensitivePixmap_arg 560 #define sym_k_XmNselectPixmap_arg 561 #define sym_k_XmNselectThreshold_arg 562 #define sym_k_XmNselectedColumn_arg 563 #define sym_k_XmNselectedItem_arg 564 #define sym_k_XmNselectedItemCount_arg 565 #define sym_k_XmNselectedItems_arg 566 #define sym_k_XmNselectedPosition_arg 567 #define sym_k_XmNselectedPositionCount_arg 568 #define sym_k_XmNselectedPositions_arg 569 #define sym_k_XmNselectionArray_arg 570 #define sym_k_XmNselectionArrayCount_arg 571 #define sym_k_XmNselectionLabelString_arg 572 #define sym_k_XmNselectionMode_arg 573 #define sym_k_XmNselectionPolicy_arg 574 #define sym_k_XmNselectionTechnique_arg 575 #define sym_k_XmNsensitive_arg 576 #define sym_k_XmNseparatorOn_arg 577 #define sym_k_XmNseparatorType_arg 578 #define sym_k_XmNset_arg 579 #define sym_k_XmNshadowThickness_arg 580 #define sym_k_XmNshadowType_arg 581 #define sym_k_XmNshellUnitType_arg 582 #define sym_k_XmNshowArrows_arg 583 #define sym_k_XmNshowAsDefault_arg 584 #define sym_k_XmNshowEntryLabel_arg 585 #define sym_k_XmNshowFind_arg 586 #define sym_k_XmNshowFontName_arg 587 #define sym_k_XmNshowLabel_arg 588 #define sym_k_XmNshowNameString_arg 589 #define sym_k_XmNshowSash_arg 590 #define sym_k_XmNshowSeparator_arg 591 #define sym_k_XmNshowValue_arg 592 #define sym_k_XmNsizeString_arg 593 #define sym_k_XmNskipAdjust_arg 594 #define sym_k_XmNsliderMark_arg 595 #define sym_k_XmNsliderSize_arg 596 #define sym_k_XmNsliderTogLabel_arg 597 #define sym_k_XmNsliderVisual_arg 598 #define sym_k_XmNslidingMode_arg 599 #define sym_k_XmNsmallCellHeight_arg 600 #define sym_k_XmNsmallCellWidth_arg 601 #define sym_k_XmNsmallIconMask_arg 602 #define sym_k_XmNsmallIconPixmap_arg 603 #define sym_k_XmNsmallIconX_arg 604 #define sym_k_XmNsmallIconY_arg 605 #define sym_k_XmNsnapBackMultiple_arg 606 #define sym_k_XmNsortFunctions_arg 607 #define sym_k_XmNsource_arg 608 #define sym_k_XmNspacing_arg 609 #define sym_k_XmNspatialIncludeModel_arg 610 #define sym_k_XmNspatialResizeModel_arg 611 #define sym_k_XmNspatialSnapModel_arg 612 #define sym_k_XmNspatialStyle_arg 613 #define sym_k_XmNspinBoxChildType_arg 614 #define sym_k_XmNstackedEffect_arg 615 #define sym_k_XmNstretchable_arg 616 #define sym_k_XmNstrikethruType_arg 617 #define sym_k_XmNstringDirection_arg 618 #define sym_k_XmNsubMenuId_arg 619 #define sym_k_XmNsymbolPixmap_arg 620 #define sym_k_XmNtabAlignment_arg 621 #define sym_k_XmNtabAutoSelect_arg 622 #define sym_k_XmNtabBackground_arg 623 #define sym_k_XmNtabBackgroundPixmap_arg 624 #define sym_k_XmNtabCornerPercent_arg 625 #define sym_k_XmNtabEdge_arg 626 #define sym_k_XmNtabForeground_arg 627 #define sym_k_XmNtabLabelPixmap_arg 628 #define sym_k_XmNtabLabelSpacing_arg 629 #define sym_k_XmNtabLabelString_arg 630 #define sym_k_XmNtabList_arg 631 #define sym_k_XmNtabMarginHeight_arg 632 #define sym_k_XmNtabMarginWidth_arg 633 #define sym_k_XmNtabMode_arg 634 #define sym_k_XmNtabOffset_arg 635 #define sym_k_XmNtabOrientation_arg 636 #define sym_k_XmNtabPixmapPlacement_arg 637 #define sym_k_XmNtabSelectColor_arg 638 #define sym_k_XmNtabSelectPixmap_arg 639 #define sym_k_XmNtabSide_arg 640 #define sym_k_XmNtabStringDirection_arg 641 #define sym_k_XmNtabStyle_arg 642 #define sym_k_XmNtabValue_arg 643 #define sym_k_XmNtearOffModel_arg 644 #define sym_k_XmNtearOffTitle_arg 645 #define sym_k_XmNtextAccelerators_arg 646 #define sym_k_XmNtextColumns_arg 647 #define sym_k_XmNtextField_arg 648 #define sym_k_XmNtextFontList_arg 649 #define sym_k_XmNtextRenderTable_arg 650 #define sym_k_XmNtextRows_arg 651 #define sym_k_XmNtextString_arg 652 #define sym_k_XmNtextTranslations_arg 653 #define sym_k_XmNtitle_arg 654 #define sym_k_XmNtitleEncoding_arg 655 #define sym_k_XmNtitleString_arg 656 #define sym_k_XmNtoggleMode_arg 657 #define sym_k_XmNtoolTipEnable_arg 658 #define sym_k_XmNtoolTipPostDelay_arg 659 #define sym_k_XmNtoolTipPostDuration_arg 660 #define sym_k_XmNtoolTipString_arg 661 #define sym_k_XmNtopAttachment_arg 662 #define sym_k_XmNtopCharacter_arg 663 #define sym_k_XmNtopItemPosition_arg 664 #define sym_k_XmNtopOffset_arg 665 #define sym_k_XmNtopPosition_arg 666 #define sym_k_XmNtopShadowColor_arg 667 #define sym_k_XmNtopShadowPixmap_arg 668 #define sym_k_XmNtopWidget_arg 669 #define sym_k_XmNtransient_arg 670 #define sym_k_XmNtransientFor_arg 671 #define sym_k_XmNtranslations_arg 672 #define sym_k_XmNtraversalOn_arg 673 #define sym_k_XmNtroughColor_arg 674 #define sym_k_XmNunderlineType_arg 675 #define sym_k_XmNuniformTabSize_arg 676 #define sym_k_XmNunitType_arg 677 #define sym_k_XmNunpostBehavior_arg 678 #define sym_k_XmNunselectColor_arg 679 #define sym_k_XmNuseAsyncGeometry_arg 680 #define sym_k_XmNuseImageCache_arg 681 #define sym_k_XmNuseScaling_arg 682 #define sym_k_XmNuseTextField_arg 683 #define sym_k_XmNuserData_arg 684 #define sym_k_XmNvalue_arg 685 #define sym_k_XmNvalueWcs_arg 686 #define sym_k_XmNvalues_arg 687 #define sym_k_XmNverify_arg 688 #define sym_k_XmNverifyBell_arg 689 #define sym_k_XmNverticalDelta_arg 690 #define sym_k_XmNverticalMargin_arg 691 #define sym_k_XmNverticalNodeSpace_arg 692 #define sym_k_XmNverticalScrollBar_arg 693 #define sym_k_XmNverticalSpacing_arg 694 #define sym_k_XmNviewType_arg 695 #define sym_k_XmNvisibleItemCount_arg 696 #define sym_k_XmNvisibleWhenOff_arg 697 #define sym_k_XmNvisual_arg 698 #define sym_k_XmNvisualEmphasis_arg 699 #define sym_k_XmNvisualPolicy_arg 700 #define sym_k_XmNwaitForWm_arg 701 #define sym_k_XmNwhichButton_arg 702 #define sym_k_XmNwidth_arg 703 #define sym_k_XmNwidthInc_arg 704 #define sym_k_XmNwinGravity_arg 705 #define sym_k_XmNwindowGroup_arg 706 #define sym_k_XmNwmTimeout_arg 707 #define sym_k_XmNwordWrap_arg 708 #define sym_k_XmNworkWindow_arg 709 #define sym_k_XmNwrap_arg 710 #define sym_k_XmNx_arg 711 #define sym_k_XmNxlfdString_arg 712 #define sym_k_XmNy_arg 713 #define sym_k_XmStringComponent_arg 714 /* Define literals for enumeration sets */ #define sym_k_Alignment_enumset 1 #define sym_k_ArrowDirection_enumset 2 #define sym_k_ArrowLayout_enumset 3 #define sym_k_ArrowOrientation_enumset 4 #define sym_k_ArrowSensitivity_enumset 5 #define sym_k_Attachment_enumset 6 #define sym_k_AudibleWarning_enumset 7 #define sym_k_AutoDragModel_enumset 8 #define sym_k_AutomaticSelection_enumset 9 #define sym_k_BackingStoreType_enumset 10 #define sym_k_BindingType_enumset 11 #define sym_k_BoolValues_enumset 12 #define sym_k_ChildPlacement_enumset 13 #define sym_k_ChildVerticalAlignment_enumset 14 #define sym_k_ColorModeType_enumset 15 #define sym_k_ComboBoxType_enumset 16 #define sym_k_CommandWindowLocation_enumset 17 #define sym_k_CompoundStringComponent_enumset 18 #define sym_k_ConnectStyle_enumset 19 #define sym_k_ContainerLineStyle_enumset 20 #define sym_k_DefaultButtonType_enumset 21 #define sym_k_DeleteResponse_enumset 22 #define sym_k_DialogStyle_enumset 23 #define sym_k_DialogType_enumset 24 #define sym_k_DtCharCursorStyle_enumset 25 #define sym_k_DtExecutionPolicy_enumset 26 #define sym_k_DtHelpType_enumset 27 #define sym_k_DtPaperSize_enumset 28 #define sym_k_DtPrintDestination_enumset 29 #define sym_k_DtPrinterNameMode_enumset 30 #define sym_k_DtPrinterResetConnectionMode_enumset 31 #define sym_k_DtScrollBarPolicy_enumset 32 #define sym_k_DtSetupMode_enumset 33 #define sym_k_DtShadowType_enumset 34 #define sym_k_DtWorkAreaLocation_enumset 35 #define sym_k_EListSelectionsType_enumset 36 #define sym_k_EditMode_enumset 37 #define sym_k_EntryViewType_enumset 38 #define sym_k_FileTypeMask_enumset 39 #define sym_k_FillOptionType_enumset 40 #define sym_k_FontType_enumset 41 #define sym_k_FrameChildType_enumset 42 #define sym_k_HierarchyNodeStateType_enumset 43 #define sym_k_IconGadgetViewType_enumset 44 #define sym_k_IconPlacementType_enumset 45 #define sym_k_IndicatorType_enumset 46 #define sym_k_InitialState_enumset 47 #define sym_k_InputPolicy_enumset 48 #define sym_k_KeyboardFocusPolicy_enumset 49 #define sym_k_LabelType_enumset 50 #define sym_k_LayoutDirection_enumset 51 #define sym_k_LayoutType_enumset 52 #define sym_k_LineType_enumset 53 #define sym_k_ListSizePolicy_enumset 54 #define sym_k_LoadModel_enumset 55 #define sym_k_MatchBehavior_enumset 56 #define sym_k_MultiClick_enumset 57 #define sym_k_MwmDecorations_enumset 58 #define sym_k_MwmFunctions_enumset 59 #define sym_k_MwmInputMode_enumset 60 #define sym_k_NavigationType_enumset 61 #define sym_k_NotebookChildType_enumset 62 #define sym_k_OffsetModel_enumset 63 #define sym_k_Orientation_enumset 64 #define sym_k_OutlineButtonPolicy_enumset 65 #define sym_k_OutlineState_enumset 66 #define sym_k_Packing_enumset 67 #define sym_k_PositionIndex_enumset 68 #define sym_k_PositionMode_enumset 69 #define sym_k_PositionType_enumset 70 #define sym_k_PrimaryOwnership_enumset 71 #define sym_k_ProcessingDirection_enumset 72 #define sym_k_ResizePolicy_enumset 73 #define sym_k_RowColumnType_enumset 74 #define sym_k_ScaleShowValue_enumset 75 #define sym_k_ScrollBarDisplayPolicy_enumset 76 #define sym_k_ScrollBarPlacement_enumset 77 #define sym_k_ScrolledWindowChildType_enumset 78 #define sym_k_ScrollingPolicy_enumset 79 #define sym_k_SelectionMode_enumset 80 #define sym_k_SelectionPolicy_enumset 81 #define sym_k_SelectionTechnique_enumset 82 #define sym_k_SeparatorType_enumset 83 #define sym_k_ShadowType_enumset 84 #define sym_k_ShowArrows_enumset 85 #define sym_k_SliderMark_enumset 86 #define sym_k_SliderVisual_enumset 87 #define sym_k_SlidingMode_enumset 88 #define sym_k_SpatialIncludeModel_enumset 89 #define sym_k_SpatialResizeModel_enumset 90 #define sym_k_SpatialSnapModel_enumset 91 #define sym_k_SpatialStyle_enumset 92 #define sym_k_SpinBoxChildType_enumset 93 #define sym_k_StringDirection_enumset 94 #define sym_k_TearOffModel_enumset 95 #define sym_k_TextPath_enumset 96 #define sym_k_TextScanType_enumset 97 #define sym_k_ToggleIndicatorOn_enumset 98 #define sym_k_ToggleMode_enumset 99 #define sym_k_ToggleSetValue_enumset 100 #define sym_k_UnitType_enumset 101 #define sym_k_UnpostBehavior_enumset 102 #define sym_k_VerticalAlignment_enumset 103 #define sym_k_VisualEmphasis_enumset 104 #define sym_k_VisualPolicy_enumset 105 #define sym_k_XmAlignment_enumset 106 #define sym_k_XmDistribution_enumset 107 #define sym_k_XmFillStyle_enumset 108 #define sym_k_XmPixmapPlacement_enumset 109 #define sym_k_XmTabEdge_enumset 110 #define sym_k_XmTabMode_enumset 111 #define sym_k_XmTabOrientation_enumset 112 #define sym_k_XmTabSide_enumset 113 #define sym_k_XmTabStyle_enumset 114 #define sym_k_XmTreeCompressStyle_enumset 115 #define sym_k_XmTreeLineStyle_enumset 116 /* Define literals for enumeration values */ #define sym_k_Always_enumval 1 #define sym_k_DtHELP_AS_NEEDED_SCROLLBARS_enumval 2 #define sym_k_DtHELP_EXECUTE_ALL_enumval 3 #define sym_k_DtHELP_EXECUTE_NONE_enumval 4 #define sym_k_DtHELP_EXECUTE_QUERY_ALL_enumval 5 #define sym_k_DtHELP_EXECUTE_QUERY_UNALIASED_enumval 6 #define sym_k_DtHELP_NO_SCROLLBARS_enumval 7 #define sym_k_DtHELP_PAPERSIZE_A4_enumval 8 #define sym_k_DtHELP_PAPERSIZE_B5_enumval 9 #define sym_k_DtHELP_PAPERSIZE_EXECUTIVE_enumval 10 #define sym_k_DtHELP_PAPERSIZE_LEGAL_enumval 11 #define sym_k_DtHELP_PAPERSIZE_LETTER_enumval 12 #define sym_k_DtHELP_STATIC_SCROLLBARS_enumval 13 #define sym_k_DtHELP_TYPE_DYNAMIC_STRING_enumval 14 #define sym_k_DtHELP_TYPE_FILE_enumval 15 #define sym_k_DtHELP_TYPE_MAN_PAGE_enumval 16 #define sym_k_DtHELP_TYPE_STRING_enumval 17 #define sym_k_DtHELP_TYPE_TOPIC_enumval 18 #define sym_k_DtLONG_NAME_enumval 19 #define sym_k_DtMEDIUM_NAME_enumval 20 #define sym_k_DtPRINT_CLOSE_CONNECTION_enumval 21 #define sym_k_DtPRINT_NO_DESTINATION_enumval 22 #define sym_k_DtPRINT_RELEASE_CONNECTION_enumval 23 #define sym_k_DtPRINT_SETUP_PLAIN_enumval 24 #define sym_k_DtPRINT_SETUP_XP_enumval 25 #define sym_k_DtPRINT_TO_FILE_enumval 26 #define sym_k_DtPRINT_TO_PRINTER_enumval 27 #define sym_k_DtSHADOW_ETCHED_IN_enumval 28 #define sym_k_DtSHADOW_ETCHED_OUT_enumval 29 #define sym_k_DtSHADOW_IN_enumval 30 #define sym_k_DtSHADOW_OUT_enumval 31 #define sym_k_DtSHORT_NAME_enumval 32 #define sym_k_DtTERM_CHAR_CURSOR_BAR_enumval 33 #define sym_k_DtTERM_CHAR_CURSOR_BOX_enumval 34 #define sym_k_DtTERM_CHAR_CURSOR_INVISIBLE_enumval 35 #define sym_k_DtWORK_AREA_BOTTOM_enumval 36 #define sym_k_DtWORK_AREA_NONE_enumval 37 #define sym_k_DtWORK_AREA_TOP_enumval 38 #define sym_k_DtWORK_AREA_TOP_AND_BOTTOM_enumval 39 #define sym_k_FALSE_enumval 40 #define sym_k_IconicState_enumval 41 #define sym_k_LineDoubleDash_enumval 42 #define sym_k_LineOnOffDash_enumval 43 #define sym_k_LineSolid_enumval 44 #define sym_k_MWM_DECOR_ALL_enumval 45 #define sym_k_MWM_DECOR_BORDER_enumval 46 #define sym_k_MWM_DECOR_MAXIMIZE_enumval 47 #define sym_k_MWM_DECOR_MENU_enumval 48 #define sym_k_MWM_DECOR_MINIMIZE_enumval 49 #define sym_k_MWM_DECOR_RESIZEH_enumval 50 #define sym_k_MWM_DECOR_TITLE_enumval 51 #define sym_k_MWM_FUNC_ALL_enumval 52 #define sym_k_MWM_FUNC_CLOSE_enumval 53 #define sym_k_MWM_FUNC_MOVE_enumval 54 #define sym_k_MWM_FUNC_RESIZE_enumval 55 #define sym_k_MWM_INPUT_FULL_APPLICATION_MODAL_enumval 56 #define sym_k_MWM_INPUT_MODELESS_enumval 57 #define sym_k_MWM_INPUT_PRIMARY_APPLICATION_MODAL_enumval 58 #define sym_k_MWM_INPUT_SYSTEM_MODAL_enumval 59 #define sym_k_NormalState_enumval 60 #define sym_k_NotUseful_enumval 61 #define sym_k_TRUE_enumval 62 #define sym_k_WhenMapped_enumval 63 #define sym_k_Xm1000TH_INCHES_enumval 64 #define sym_k_Xm100TH_FONT_UNITS_enumval 65 #define sym_k_Xm100TH_MILLIMETERS_enumval 66 #define sym_k_Xm100TH_POINTS_enumval 67 #define sym_k_XmABSOLUTE_enumval 68 #define sym_k_XmADD_MODE_enumval 69 #define sym_k_XmALIGNMENT_BASELINE_BOTTOM_enumval 70 #define sym_k_XmALIGNMENT_BASELINE_TOP_enumval 71 #define sym_k_XmALIGNMENT_BEGINNING_enumval 72 #define sym_k_XmALIGNMENT_CENTER_enumval 73 #define sym_k_XmALIGNMENT_CONTENTS_BOTTOM_enumval 74 #define sym_k_XmALIGNMENT_CONTENTS_TOP_enumval 75 #define sym_k_XmALIGNMENT_END_enumval 76 #define sym_k_XmALIGNMENT_UNSPECIFIED_enumval 77 #define sym_k_XmALIGNMENT_WIDGET_BOTTOM_enumval 78 #define sym_k_XmALIGNMENT_WIDGET_TOP_enumval 79 #define sym_k_XmANY_ICON_enumval 80 #define sym_k_XmAPPEND_enumval 81 #define sym_k_XmAPPLICATION_DEFINED_enumval 82 #define sym_k_XmARROWS_BEGINNING_enumval 83 #define sym_k_XmARROWS_DECREMENT_SENSITIVE_enumval 84 #define sym_k_XmARROWS_DEFAULT_SENSITIVITY_enumval 85 #define sym_k_XmARROWS_END_enumval 86 #define sym_k_XmARROWS_FLAT_BEGINNING_enumval 87 #define sym_k_XmARROWS_FLAT_END_enumval 88 #define sym_k_XmARROWS_HORIZONTAL_enumval 89 #define sym_k_XmARROWS_INCREMENT_SENSITIVE_enumval 90 #define sym_k_XmARROWS_INSENSITIVE_enumval 91 #define sym_k_XmARROWS_SENSITIVE_enumval 92 #define sym_k_XmARROWS_SPLIT_enumval 93 #define sym_k_XmARROWS_VERTICAL_enumval 94 #define sym_k_XmARROW_DOWN_enumval 95 #define sym_k_XmARROW_LEFT_enumval 96 #define sym_k_XmARROW_RIGHT_enumval 97 #define sym_k_XmARROW_UP_enumval 98 #define sym_k_XmAS_IS_enumval 99 #define sym_k_XmAS_NEEDED_enumval 100 #define sym_k_XmATTACH_FORM_enumval 101 #define sym_k_XmATTACH_NONE_enumval 102 #define sym_k_XmATTACH_OPPOSITE_FORM_enumval 103 #define sym_k_XmATTACH_OPPOSITE_WIDGET_enumval 104 #define sym_k_XmATTACH_POSITION_enumval 105 #define sym_k_XmATTACH_SELF_enumval 106 #define sym_k_XmATTACH_WIDGET_enumval 107 #define sym_k_XmAUTOMATIC_enumval 108 #define sym_k_XmAUTO_DRAG_DISABLED_enumval 109 #define sym_k_XmAUTO_DRAG_ENABLED_enumval 110 #define sym_k_XmAUTO_SELECT_enumval 111 #define sym_k_XmAlwaysOpen_enumval 112 #define sym_k_XmBACKGROUND_COLOR_enumval 113 #define sym_k_XmBELL_enumval 114 #define sym_k_XmBOTTOM_LEFT_enumval 115 #define sym_k_XmBOTTOM_RIGHT_enumval 116 #define sym_k_XmBOTTOM_TO_TOP_enumval 117 #define sym_k_XmBOTTOM_TO_TOP_LEFT_TO_RIGHT_enumval 118 #define sym_k_XmBOTTOM_TO_TOP_RIGHT_TO_LEFT_enumval 119 #define sym_k_XmBROWSE_SELECT_enumval 120 #define sym_k_XmCELLS_enumval 121 #define sym_k_XmCENTER_enumval 122 #define sym_k_XmCENTIMETERS_enumval 123 #define sym_k_XmCLIP_WINDOW_enumval 124 #define sym_k_XmCLOSEST_enumval 125 #define sym_k_XmCOLLAPSED_enumval 126 #define sym_k_XmCOMBO_BOX_enumval 127 #define sym_k_XmCOMMAND_ABOVE_WORKSPACE_enumval 128 #define sym_k_XmCOMMAND_BELOW_WORKSPACE_enumval 129 #define sym_k_XmCOMMAND_WINDOW_enumval 130 #define sym_k_XmCONSTANT_enumval 131 #define sym_k_XmClosed_enumval 132 #define sym_k_XmDEFAULT_DIRECTION_enumval 133 #define sym_k_XmDESTROY_enumval 134 #define sym_k_XmDETAIL_enumval 135 #define sym_k_XmDIALOG_APPLICATION_MODAL_enumval 136 #define sym_k_XmDIALOG_CANCEL_BUTTON_enumval 137 #define sym_k_XmDIALOG_COMMAND_enumval 138 #define sym_k_XmDIALOG_DEFAULT_BUTTON_enumval 139 #define sym_k_XmDIALOG_ERROR_enumval 140 #define sym_k_XmDIALOG_FILE_SELECTION_enumval 141 #define sym_k_XmDIALOG_FULL_APPLICATION_MODAL_enumval 142 #define sym_k_XmDIALOG_HELP_BUTTON_enumval 143 #define sym_k_XmDIALOG_INFORMATION_enumval 144 #define sym_k_XmDIALOG_MESSAGE_enumval 145 #define sym_k_XmDIALOG_MESSAGE_LABEL_enumval 146 #define sym_k_XmDIALOG_MODELESS_enumval 147 #define sym_k_XmDIALOG_OK_BUTTON_enumval 148 #define sym_k_XmDIALOG_PRIMARY_APPLICATION_MODAL_enumval 149 #define sym_k_XmDIALOG_PROMPT_enumval 150 #define sym_k_XmDIALOG_QUESTION_enumval 151 #define sym_k_XmDIALOG_SELECTION_enumval 152 #define sym_k_XmDIALOG_SEPARATOR_enumval 153 #define sym_k_XmDIALOG_SYMBOL_LABEL_enumval 154 #define sym_k_XmDIALOG_SYSTEM_MODAL_enumval 155 #define sym_k_XmDIALOG_TEMPLATE_enumval 156 #define sym_k_XmDIALOG_WARNING_enumval 157 #define sym_k_XmDIALOG_WORKING_enumval 158 #define sym_k_XmDIALOG_WORK_AREA_enumval 159 #define sym_k_XmDISTRIBUTE_SPREAD_enumval 160 #define sym_k_XmDISTRIBUTE_TIGHT_enumval 161 #define sym_k_XmDOUBLE_DASHED_LINE_enumval 162 #define sym_k_XmDOUBLE_LINE_enumval 163 #define sym_k_XmDO_NOTHING_enumval 164 #define sym_k_XmDROP_DOWN_COMBO_BOX_enumval 165 #define sym_k_XmDROP_DOWN_LIST_enumval 166 #define sym_k_XmEACH_SIDE_enumval 167 #define sym_k_XmETCHED_LINE_enumval 168 #define sym_k_XmEXCLUSIVE_TAB_GROUP_enumval 169 #define sym_k_XmEXPANDED_enumval 170 #define sym_k_XmEXPLICIT_enumval 171 #define sym_k_XmEXTENDED_SELECT_enumval 172 #define sym_k_XmFILE_ANY_TYPE_enumval 173 #define sym_k_XmFILE_DIRECTORY_enumval 174 #define sym_k_XmFILE_REGULAR_enumval 175 #define sym_k_XmFILL_FLUSH_enumval 176 #define sym_k_XmFILL_RAGGED_enumval 177 #define sym_k_XmFILL_UNSPECIFIED_enumval 178 #define sym_k_XmFIRST_FIT_enumval 179 #define sym_k_XmFIRST_POSITION_enumval 180 #define sym_k_XmFONT_IS_FONT_enumval 181 #define sym_k_XmFONT_IS_FONTSET_enumval 182 #define sym_k_XmFONT_IS_XFT_enumval 183 #define sym_k_XmFONT_UNITS_enumval 184 #define sym_k_XmFOREGROUND_COLOR_enumval 185 #define sym_k_XmFRAME_GENERIC_CHILD_enumval 186 #define sym_k_XmFRAME_TITLE_CHILD_enumval 187 #define sym_k_XmFRAME_WORKAREA_CHILD_enumval 188 #define sym_k_XmFillAll_enumval 189 #define sym_k_XmFillMajor_enumval 190 #define sym_k_XmFillMinor_enumval 191 #define sym_k_XmFillNone_enumval 192 #define sym_k_XmGENERIC_CHILD_enumval 193 #define sym_k_XmGRID_enumval 194 #define sym_k_XmGROW_BALANCED_enumval 195 #define sym_k_XmGROW_MAJOR_enumval 196 #define sym_k_XmGROW_MINOR_enumval 197 #define sym_k_XmHORIZONTAL_enumval 198 #define sym_k_XmHOR_SCROLLBAR_enumval 199 #define sym_k_XmHidden_enumval 200 #define sym_k_XmINCHES_enumval 201 #define sym_k_XmINDETERMINATE_enumval 202 #define sym_k_XmINDICATOR_BOX_enumval 203 #define sym_k_XmINDICATOR_CHECK_enumval 204 #define sym_k_XmINDICATOR_CHECK_BOX_enumval 205 #define sym_k_XmINDICATOR_CROSS_enumval 206 #define sym_k_XmINDICATOR_CROSS_BOX_enumval 207 #define sym_k_XmINDICATOR_FILL_enumval 208 #define sym_k_XmINDICATOR_NONE_enumval 209 #define sym_k_XmINHERIT_POLICY_enumval 210 #define sym_k_XmINVALID_MATCH_BEHAVIOR_enumval 211 #define sym_k_XmIconBottom_enumval 212 #define sym_k_XmIconLeft_enumval 213 #define sym_k_XmIconNone_enumval 214 #define sym_k_XmIconOnly_enumval 215 #define sym_k_XmIconRight_enumval 216 #define sym_k_XmIconTop_enumval 217 #define sym_k_XmLARGE_ICON_enumval 218 #define sym_k_XmLAST_POSITION_enumval 219 #define sym_k_XmLEFT_TO_RIGHT_enumval 220 #define sym_k_XmLEFT_TO_RIGHT_BOTTOM_TO_TOP_enumval 221 #define sym_k_XmLEFT_TO_RIGHT_TOP_TO_BOTTOM_enumval 222 #define sym_k_XmLOAD_DEFERRED_enumval 223 #define sym_k_XmLOAD_IMMEDIATE_enumval 224 #define sym_k_XmListMode_enumval 225 #define sym_k_XmMAJOR_TAB_enumval 226 #define sym_k_XmMARQUEE_enumval 227 #define sym_k_XmMARQUEE_EXTEND_BOTH_enumval 228 #define sym_k_XmMARQUEE_EXTEND_START_enumval 229 #define sym_k_XmMAX_ON_BOTTOM_enumval 230 #define sym_k_XmMAX_ON_LEFT_enumval 231 #define sym_k_XmMAX_ON_RIGHT_enumval 232 #define sym_k_XmMAX_ON_TOP_enumval 233 #define sym_k_XmMAX_SIDE_enumval 234 #define sym_k_XmMENU_BAR_enumval 235 #define sym_k_XmMENU_OPTION_enumval 236 #define sym_k_XmMENU_POPUP_enumval 237 #define sym_k_XmMENU_PULLDOWN_enumval 238 #define sym_k_XmMESSAGE_WINDOW_enumval 239 #define sym_k_XmMILLIMETERS_enumval 240 #define sym_k_XmMINOR_TAB_enumval 241 #define sym_k_XmMIN_SIDE_enumval 242 #define sym_k_XmMULTICLICK_DISCARD_enumval 243 #define sym_k_XmMULTICLICK_KEEP_enumval 244 #define sym_k_XmMULTIPLE_SELECT_enumval 245 #define sym_k_XmMULTI_LINE_EDIT_enumval 246 #define sym_k_XmNEAR_BORDER_enumval 247 #define sym_k_XmNEAR_SLIDER_enumval 248 #define sym_k_XmNONE_enumval 249 #define sym_k_XmNORMAL_MODE_enumval 250 #define sym_k_XmNOT_SELECTED_enumval 251 #define sym_k_XmNO_AUTO_SELECT_enumval 252 #define sym_k_XmNO_LINE_enumval 253 #define sym_k_XmNO_ORIENTATION_enumval 254 #define sym_k_XmNO_PACKING_enumval 255 #define sym_k_XmNO_SCROLL_enumval 256 #define sym_k_XmNUMERIC_enumval 257 #define sym_k_XmN_OF_MANY_enumval 258 #define sym_k_XmONE_BASED_enumval 259 #define sym_k_XmONE_OF_MANY_enumval 260 #define sym_k_XmONE_OF_MANY_DIAMOND_enumval 261 #define sym_k_XmONE_OF_MANY_ROUND_enumval 262 #define sym_k_XmOUTLINE_enumval 263 #define sym_k_XmOUTLINE_BUTTON_ABSENT_enumval 264 #define sym_k_XmOUTLINE_BUTTON_PRESENT_enumval 265 #define sym_k_XmOWN_ALWAYS_enumval 266 #define sym_k_XmOWN_MULTIPLE_enumval 267 #define sym_k_XmOWN_NEVER_enumval 268 #define sym_k_XmOWN_POSSIBLE_MULTIPLE_enumval 269 #define sym_k_XmOpen_enumval 270 #define sym_k_XmPACK_COLUMN_enumval 271 #define sym_k_XmPACK_NONE_enumval 272 #define sym_k_XmPACK_TIGHT_enumval 273 #define sym_k_XmPAGE_enumval 274 #define sym_k_XmPAGE_SCROLLER_enumval 275 #define sym_k_XmPER_SHELL_enumval 276 #define sym_k_XmPER_WIDGET_enumval 277 #define sym_k_XmPIXELS_enumval 278 #define sym_k_XmPIXMAP_enumval 279 #define sym_k_XmPIXMAP_AND_STRING_enumval 280 #define sym_k_XmPIXMAP_BOTTOM_enumval 281 #define sym_k_XmPIXMAP_LEFT_enumval 282 #define sym_k_XmPIXMAP_NONE_enumval 283 #define sym_k_XmPIXMAP_ONLY_enumval 284 #define sym_k_XmPIXMAP_OVERLAP_ONLY_enumval 285 #define sym_k_XmPIXMAP_RIGHT_enumval 286 #define sym_k_XmPIXMAP_TOP_enumval 287 #define sym_k_XmPLACE_ABOVE_SELECTION_enumval 288 #define sym_k_XmPLACE_BELOW_SELECTION_enumval 289 #define sym_k_XmPLACE_TOP_enumval 290 #define sym_k_XmPOINTER_enumval 291 #define sym_k_XmPOINTS_enumval 292 #define sym_k_XmPOSITION_INDEX_enumval 293 #define sym_k_XmPOSITION_VALUE_enumval 294 #define sym_k_XmQUICK_NAVIGATE_enumval 295 #define sym_k_XmRELATIVE_enumval 296 #define sym_k_XmRESIZE_ANY_enumval 297 #define sym_k_XmRESIZE_GROW_enumval 298 #define sym_k_XmRESIZE_IF_POSSIBLE_enumval 299 #define sym_k_XmRESIZE_NONE_enumval 300 #define sym_k_XmRIGHT_TO_LEFT_enumval 301 #define sym_k_XmRIGHT_TO_LEFT_BOTTOM_TO_TOP_enumval 302 #define sym_k_XmRIGHT_TO_LEFT_TOP_TO_BOTTOM_enumval 303 #define sym_k_XmROUND_MARK_enumval 304 #define sym_k_XmSCROLL_HOR_enumval 305 #define sym_k_XmSCROLL_VERT_enumval 306 #define sym_k_XmSELECTED_enumval 307 #define sym_k_XmSELECT_ALL_enumval 308 #define sym_k_XmSELECT_LINE_enumval 309 #define sym_k_XmSELECT_PARAGRAPH_enumval 310 #define sym_k_XmSELECT_POSITION_enumval 311 #define sym_k_XmSELECT_WHITESPACE_enumval 312 #define sym_k_XmSELECT_WORD_enumval 313 #define sym_k_XmSET_enumval 314 #define sym_k_XmSHADOWED_BACKGROUND_enumval 315 #define sym_k_XmSHADOW_ETCHED_IN_enumval 316 #define sym_k_XmSHADOW_ETCHED_IN_DASH_enumval 317 #define sym_k_XmSHADOW_ETCHED_OUT_enumval 318 #define sym_k_XmSHADOW_ETCHED_OUT_DASH_enumval 319 #define sym_k_XmSHADOW_IN_enumval 320 #define sym_k_XmSHADOW_OUT_enumval 321 #define sym_k_XmSINGLE_enumval 322 #define sym_k_XmSINGLE_DASHED_LINE_enumval 323 #define sym_k_XmSINGLE_LINE_enumval 324 #define sym_k_XmSINGLE_LINE_EDIT_enumval 325 #define sym_k_XmSINGLE_SELECT_enumval 326 #define sym_k_XmSLIDER_enumval 327 #define sym_k_XmSMALL_ICON_enumval 328 #define sym_k_XmSNAP_TO_GRID_enumval 329 #define sym_k_XmSOLID_enumval 330 #define sym_k_XmSPATIAL_enumval 331 #define sym_k_XmSPIRAL_enumval 332 #define sym_k_XmSTATIC_enumval 333 #define sym_k_XmSTATUS_AREA_enumval 334 #define sym_k_XmSTICKY_TAB_GROUP_enumval 335 #define sym_k_XmSTRING_enumval 336 #define sym_k_XmSTRING_COMPONENT_CHARSET_enumval 337 #define sym_k_XmSTRING_COMPONENT_DIRECTION_enumval 338 #define sym_k_XmSTRING_COMPONENT_LAYOUT_POP_enumval 339 #define sym_k_XmSTRING_COMPONENT_LAYOUT_PUSH_enumval 340 #define sym_k_XmSTRING_COMPONENT_LOCALE_enumval 341 #define sym_k_XmSTRING_COMPONENT_LOCALE_TEXT_enumval 342 #define sym_k_XmSTRING_COMPONENT_RENDITION_BEGIN_enumval 343 #define sym_k_XmSTRING_COMPONENT_RENDITION_END_enumval 344 #define sym_k_XmSTRING_COMPONENT_SEPARATOR_enumval 345 #define sym_k_XmSTRING_COMPONENT_TAB_enumval 346 #define sym_k_XmSTRING_COMPONENT_TEXT_enumval 347 #define sym_k_XmSTRING_COMPONENT_UNKNOWN_enumval 348 #define sym_k_XmSTRING_COMPONENT_WIDECHAR_TEXT_enumval 349 #define sym_k_XmSTRING_DIRECTION_DEFAULT_enumval 350 #define sym_k_XmSTRING_DIRECTION_L_TO_R_enumval 351 #define sym_k_XmSTRING_DIRECTION_R_TO_L_enumval 352 #define sym_k_XmSTRING_DIRECTION_UNSET_enumval 353 #define sym_k_XmScaleMode_enumval 354 #define sym_k_XmTABS_BASIC_enumval 355 #define sym_k_XmTABS_BEVELED_enumval 356 #define sym_k_XmTABS_BOTTOM_TO_TOP_enumval 357 #define sym_k_XmTABS_LEFT_TO_RIGHT_enumval 358 #define sym_k_XmTABS_ON_BOTTOM_enumval 359 #define sym_k_XmTABS_ON_LEFT_enumval 360 #define sym_k_XmTABS_ON_RIGHT_enumval 361 #define sym_k_XmTABS_ON_TOP_enumval 362 #define sym_k_XmTABS_RIGHT_TO_LEFT_enumval 363 #define sym_k_XmTABS_ROUNDED_enumval 364 #define sym_k_XmTABS_SQUARED_enumval 365 #define sym_k_XmTABS_STACKED_enumval 366 #define sym_k_XmTABS_STACKED_STATIC_enumval 367 #define sym_k_XmTABS_TOP_TO_BOTTOM_enumval 368 #define sym_k_XmTAB_EDGE_BOTTOM_RIGHT_enumval 369 #define sym_k_XmTAB_EDGE_TOP_LEFT_enumval 370 #define sym_k_XmTAB_GROUP_enumval 371 #define sym_k_XmTAB_ORIENTATION_DYNAMIC_enumval 372 #define sym_k_XmTEAR_OFF_DISABLED_enumval 373 #define sym_k_XmTEAR_OFF_ENABLED_enumval 374 #define sym_k_XmTHERMOMETER_enumval 375 #define sym_k_XmTHUMB_MARK_enumval 376 #define sym_k_XmTOGGLE_BOOLEAN_enumval 377 #define sym_k_XmTOGGLE_INDETERMINATE_enumval 378 #define sym_k_XmTOP_LEFT_enumval 379 #define sym_k_XmTOP_RIGHT_enumval 380 #define sym_k_XmTOP_TO_BOTTOM_enumval 381 #define sym_k_XmTOP_TO_BOTTOM_LEFT_TO_RIGHT_enumval 382 #define sym_k_XmTOP_TO_BOTTOM_RIGHT_TO_LEFT_enumval 383 #define sym_k_XmTOUCH_ONLY_enumval 384 #define sym_k_XmTOUCH_OVER_enumval 385 #define sym_k_XmTROUGH_COLOR_enumval 386 #define sym_k_XmTreeCompressLeaves_enumval 387 #define sym_k_XmTreeCompressNone_enumval 388 #define sym_k_XmTreeDirect_enumval 389 #define sym_k_XmTreeLadder_enumval 390 #define sym_k_XmUNMAP_enumval 391 #define sym_k_XmUNPOST_enumval 392 #define sym_k_XmUNPOST_AND_REPLAY_enumval 393 #define sym_k_XmUNSET_enumval 394 #define sym_k_XmVARIABLE_enumval 395 #define sym_k_XmVERTICAL_enumval 396 #define sym_k_XmVERT_SCROLLBAR_enumval 397 #define sym_k_XmWORK_AREA_enumval 398 #define sym_k_XmZERO_BASED_enumval 399 /* Define literals for character sets */ #define sym_k_XmFONTLIST_DEFAULT_TAG_charset 2 #define sym_k__MOTIF_DEFAULT_LOCALE_charset 3 #define sym_k_ansi_cyrillic_charset 4 #define sym_k_big5_charset 5 #define sym_k_dos_cyrillic_charset 6 #define sym_k_euc_charset 7 #define sym_k_gb_hanzi_charset 8 #define sym_k_gb_hanzi_gr_charset 9 #define sym_k_iso_arabic_charset 10 #define sym_k_iso_arabic_lr_charset 11 #define sym_k_iso_cyrillic_charset 12 #define sym_k_iso_greek_charset 13 #define sym_k_iso_hebrew_charset 14 #define sym_k_iso_hebrew_lr_charset 15 #define sym_k_iso_ir_111_charset 16 #define sym_k_iso_latin1_charset 17 #define sym_k_iso_latin2_charset 18 #define sym_k_iso_latin3_charset 19 #define sym_k_iso_latin4_charset 20 #define sym_k_iso_latin5_charset 21 #define sym_k_jis_kanji_charset 22 #define sym_k_jis_kanji_gr_charset 23 #define sym_k_jis_katakana_charset 24 #define sym_k_ksc_hangul_charset 25 #define sym_k_ksc_hangul_gr_charset 26 #define sym_k_utf8_charset 27 /* Define literals for automatic children */ #define sym_k_Xm_Apply_child 1 #define sym_k_Xm_Arrow_child 2 #define sym_k_Xm_Cancel_child 3 #define sym_k_Xm_ColorListToggle_child 4 #define sym_k_Xm_ColorSlidersToggle_child 5 #define sym_k_Xm_Dir_child 6 #define sym_k_Xm_DirList_child 7 #define sym_k_Xm_Filter_child 8 #define sym_k_Xm_FilterLabel_child 9 #define sym_k_Xm_FilterText_child 10 #define sym_k_Xm_Find_child 11 #define sym_k_Xm_FindText_child 12 #define sym_k_Xm_Help_child 13 #define sym_k_Xm_HorScrollBar_child 14 #define sym_k_Xm_Items_child 15 #define sym_k_Xm_ItemsList_child 16 #define sym_k_Xm_Label_child 17 #define sym_k_Xm_List_child 18 #define sym_k_Xm_Message_child 19 #define sym_k_Xm_OK_child 20 #define sym_k_Xm_OptionButton_child 21 #define sym_k_Xm_OptionLabel_child 22 #define sym_k_Xm_Selection_child 23 #define sym_k_Xm_Separator_child 24 #define sym_k_Xm_Separator1_child 25 #define sym_k_Xm_Separator2_child 26 #define sym_k_Xm_Separator3_child 27 #define sym_k_Xm_Symbol_child 28 #define sym_k_Xm_TearOffControl_child 29 #define sym_k_Xm_Text_child 30 #define sym_k_Xm_TextField_child 31 #define sym_k_Xm_Title_child 32 #define sym_k_Xm_VertScrollBar_child 33 motif-2.3.8/tools/wml/wmlsynbld.c0000644000175000017500000007051113145162623013710 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wmlsynbld.c /main/9 1995/08/29 11:11:12 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This module contains the programs which construct the syntactic * representation of the WML input. All the routines are called as * actions of the grammar productions. * * Since WML is so simple, no stack frame technology is used. Instead, * context is maintained by global pointers and vectors which contain * the intermediate results of parsing a statement. At most, these * contain an object being constructed (for instance a class descriptor) * and a subobject (for instance a resource reference in a class). * * Results are communicated back using the global error count * wml_err_count, and the ordered handle list wml_synobj_ptr. */ #include "wml.h" #include "wmlparse.h" #if defined(__STDC__) #include #endif #include /* * Globals used during WML parsing. */ /* * Character arrays and other variables to hold lexemes * are defined in wmllex.l */ /* * Current principal object being constructed * Current subobject */ ObjectPtr wml_cur_obj; ObjectPtr wml_cur_subobj; /* * Routine to create a class descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the class name * ctype class type, one of METACLASS | WIDGET | GADGET */ void wmlCreateClass (name, ctype) char *name; int ctype; { WmlSynClassDefPtr cdesc; /* new class descriptor */ /* * Initialize the new class descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ cdesc = (WmlSynClassDefPtr) malloc (sizeof(WmlSynClassDef)); cdesc->validation = WmlClassDefValid; cdesc->rslvdef = NULL; switch ( ctype ) { case METACLASS: cdesc->type = WmlClassTypeMetaclass; break; case WIDGET: cdesc->type = WmlClassTypeWidget; break; case GADGET: cdesc->type = WmlClassTypeGadget; break; default: printf ("\nwmlCreateClass: unknown class type %d", ctype); return; break; } cdesc->dialog = FALSE; cdesc->name = wmlAllocateString (name); cdesc->superclass = NULL; cdesc->parentclass = NULL; cdesc->widgetclass = NULL; cdesc->int_lit = NULL; cdesc->convfunc = NULL; cdesc->docname = NULL; cdesc->ctrlmapto = NULL; cdesc->alias_cnt = 0; cdesc->alias_list = NULL; cdesc->controls = NULL; cdesc->resources = NULL; cdesc->children = NULL; if ( wmlFindInHList(wml_synobj_ptr,name) >= 0 ) { printf ("\nDuplicate name %s found", name); return; } wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)cdesc); wml_cur_obj = (ObjectPtr) cdesc; wml_cur_subobj = NULL; return; } /* * Routine to create a resource descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the resource name * rtype resource type, one of * ARGUMENT | REASON | CONSTRAINT | SUBRESOURCE */ void wmlCreateResource (name, rtype) char *name; int rtype; { WmlSynResourceDefPtr rdesc; /* new resource descriptor */ /* * Initialize the new resource descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ rdesc = (WmlSynResourceDefPtr) malloc (sizeof(WmlSynResourceDef)); rdesc->validation = WmlResourceDefValid; rdesc->rslvdef = NULL; switch ( rtype ) { case ARGUMENT: rdesc->type = WmlResourceTypeArgument; rdesc->xrm_support = WmlAttributeTrue; break; case REASON: rdesc->type = WmlResourceTypeReason; rdesc->xrm_support = WmlAttributeFalse; break; case CONSTRAINT: rdesc->type = WmlResourceTypeConstraint; rdesc->xrm_support = WmlAttributeTrue; break; case SUBRESOURCE: rdesc->type = WmlResourceTypeSubResource; rdesc->xrm_support = WmlAttributeTrue; break; default: printf ("\nwmlCreateResource: unknown resource type %d", rtype); return; break; } rdesc->name = wmlAllocateString (name); rdesc->datatype = NULL; rdesc->int_lit = NULL; rdesc->resliteral = wmlAllocateString (name); /* default to name */ rdesc->enumset = NULL; rdesc->docname = NULL; rdesc->related = NULL; rdesc->dflt = NULL; rdesc->alias_cnt = 0; rdesc->alias_list = NULL; if ( wmlFindInHList(wml_synobj_ptr,name) >= 0 ) { printf ("\nDuplicate name %s found", name); return; } wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)rdesc); wml_cur_obj = (ObjectPtr) rdesc; wml_cur_subobj = NULL; return; } /* * Routine to create a datatype descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the datatype name */ void wmlCreateDatatype (name) char *name; { WmlSynDataTypeDefPtr ddesc; /* new datatype descriptor */ /* * Initialize the new datatype descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ ddesc = (WmlSynDataTypeDefPtr) malloc (sizeof(WmlSynDataTypeDef)); ddesc->validation = WmlDataTypeDefValid; ddesc->rslvdef = NULL; ddesc->name = wmlAllocateString (name); ddesc->int_lit = NULL; ddesc->docname = NULL; ddesc->xrm_support = WmlAttributeTrue; if ( wmlFindInHList(wml_synobj_ptr,name) >= 0 ) { printf ("\nDuplicate name %s found", name); return; } wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)ddesc); wml_cur_obj = (ObjectPtr) ddesc; wml_cur_subobj = NULL; return; } /* * Routine to create a child descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the child name * class the class name */ void wmlCreateChild (name, class) char *name; char *class; { WmlSynChildDefPtr chdesc; /* new child descriptor */ /* * Initialize the new child descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ chdesc = (WmlSynChildDefPtr) malloc (sizeof(WmlSynChildDef)); chdesc->validation = WmlChildDefValid; chdesc->rslvdef = NULL; chdesc->name = wmlAllocateString (name); chdesc->class = wmlAllocateString (class); if ( wmlFindInHList(wml_synobj_ptr,name) >= 0 ) { printf ("\nDuplicate name %s found", name); return; } wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)chdesc); wml_cur_obj = (ObjectPtr) chdesc; wml_cur_subobj = NULL; return; } /* * Routine to create a controls list descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the controls list name */ void wmlCreateOrAppendCtrlList (name) char *name; { int idx; WmlSynCtrlListDefPtr cdesc; /* new CtrlList descriptor */ idx = wmlFindInHList(wml_synobj_ptr,name); if (idx < 0 ) { /* Didn't find list */ /* * Initialize the new CtrlList descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ cdesc = (WmlSynCtrlListDefPtr) malloc (sizeof(WmlSynCtrlListDef)); cdesc->validation = WmlCtrlListDefValid; cdesc->rslvdef = NULL; cdesc->name = wmlAllocateString (name); cdesc->controls = NULL; wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)cdesc); } else { cdesc = (WmlSynCtrlListDefPtr) wml_synobj_ptr -> hvec[idx].objptr; printf ("\nAppending to list name %s", name); } wml_cur_obj = (ObjectPtr) cdesc; wml_cur_subobj = NULL; return; } /* * Routine to create an enumeration set descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the enumeration set name * type data type, must match a data type name */ void wmlCreateEnumSet (name, dtype) char *name; char *dtype; { WmlSynEnumSetDefPtr esdesc; /* new enumeration set descriptor */ /* * Initialize the new resource descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ esdesc = (WmlSynEnumSetDefPtr) malloc (sizeof(WmlSynEnumSetDef)); esdesc->validation = WmlEnumSetDefValid; esdesc->rslvdef = NULL; esdesc->name = wmlAllocateString (name); esdesc->datatype = wmlAllocateString (dtype); esdesc->values = NULL; if ( wmlFindInHList(wml_synobj_ptr,name) >= 0 ) { printf ("\nDuplicate name %s found", name); return; } wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)esdesc); wml_cur_obj = (ObjectPtr) esdesc; wml_cur_subobj = NULL; return; } /* * Routine to create an enumeration value descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the enumeration value name */ void wmlCreateEnumValue (name) char *name; { WmlSynEnumValueDefPtr evdesc; /* new enumeration value descriptor */ /* * Initialize the new resource descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ evdesc = (WmlSynEnumValueDefPtr) malloc (sizeof(WmlSynEnumValueDef)); evdesc->validation = WmlEnumValueDefValid; evdesc->rslvdef = NULL; evdesc->name = wmlAllocateString (name); evdesc->enumlit = wmlAllocateString (name); /* defaults to name */ if ( wmlFindInHList(wml_synobj_ptr,name) >= 0 ) { printf ("\nDuplicate name %s found", name); return; } wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)evdesc); wml_cur_obj = (ObjectPtr) evdesc; wml_cur_subobj = NULL; return; } /* * Routine to create a charset descriptor. The result is placed in both * wml_cur_obj and wml_synobj. * * name the charset name */ void wmlCreateCharset (name) char *name; { WmlSynCharSetDefPtr ddesc; /* new charset descriptor */ /* * Initialize the new charset descriptor. Enter it in the object list. * Set the current object global to the descriptor. */ ddesc = (WmlSynCharSetDefPtr) malloc (sizeof(WmlSynCharSetDef)); ddesc->validation = WmlCharSetDefValid; ddesc->rslvdef = NULL; ddesc->name = wmlAllocateString (name); ddesc->int_lit = NULL; ddesc->xms_name = NULL; ddesc->direction = WmlCharSetDirectionLtoR; ddesc->parsedirection = WmlAttributeUnspecified; ddesc->charsize = WmlCharSizeOneByte; ddesc->alias_cnt = 0; ddesc->alias_list = NULL; if ( wmlFindInHList(wml_synobj_ptr,name) >= 0 ) { printf ("\nDuplicate name %s found", name); return; } wmlInsertInHList (wml_synobj_ptr, name, (ObjectPtr)ddesc); wml_cur_obj = (ObjectPtr) ddesc; wml_cur_subobj = NULL; return; } /* * Routine to set an attribute in a class descriptor. * * This routine sets the given attribute in the current object, which * must be a class descriptor. The current object and subobject do not * change. * * attrid oneof SUPERCLASS | INTERNALLITERAL | DOCNAME | * CONVFUNC | WIDGETCLASS | DIALOGCLASS | * CTRLMAPSRESOURCE * val value of the attribute, usually a string */ void wmlAddClassAttribute (attrid, val) int attrid; char *val; { WmlSynClassDefPtr cdesc; /* the class descriptor */ char **synlist; /* ALIAS pointer list */ /* * Acquire the current class descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddClassAttribute: NULL current object"); return; } cdesc = (WmlSynClassDefPtr) wml_cur_obj; if ( cdesc->validation != WmlClassDefValid ) { printf ("\nwmlAddClassAttribute: %d not a class descriptor", cdesc->validation); return; } /* * Set the appropriate resource */ switch ( attrid ) { case SUPERCLASS: cdesc->superclass = wmlAllocateString (val); break; case PARENTCLASS: cdesc->parentclass = wmlAllocateString (val); break; case INTERNALLITERAL: cdesc->int_lit = wmlAllocateString (val); break; case CONVFUNC: cdesc->convfunc = wmlAllocateString (val); break; case DOCNAME: cdesc->docname = wmlAllocateString (val); break; case WIDGETCLASS: cdesc->widgetclass = wmlAllocateString (val); break; case DIALOGCLASS: switch ( (long)val ) { case ATTRTRUE: cdesc->dialog = TRUE; break; } break; case CTRLMAPSRESOURCE: cdesc->ctrlmapto = wmlAllocateString (val); break; case ALIAS: if ( cdesc->alias_cnt == 0 ) synlist = (char **) malloc (sizeof(char *)); else synlist = (char **) realloc (cdesc->alias_list, (cdesc->alias_cnt+1)*sizeof(char **)); synlist[cdesc->alias_cnt] = wmlAllocateString (val); cdesc->alias_cnt += 1; cdesc->alias_list = synlist; break; } return; } /* * Routine to add a control specification to the current class. * The current object must be a class descriptor. The entry name * is added to the controls list. The control specification becomes the * current subobject. * * name the name of the controlled class */ void wmlAddClassControl (name) char *name; { WmlSynClassDefPtr cdesc; /* the class descriptor */ WmlSynClassCtrlDefPtr ctrlelm; /* controls element */ /* * Acquire the current class descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddClassControl: NULL current object"); return; } cdesc = (WmlSynClassDefPtr) wml_cur_obj; if ( cdesc->validation != WmlClassDefValid ) { printf ("\nwmlAddClassControl: %d not a class descriptor", cdesc->validation); return; } /* * Add the control to the control list */ ctrlelm = (WmlSynClassCtrlDefPtr) malloc (sizeof(WmlSynClassCtrlDef)); ctrlelm->validation = WmlClassCtrlDefValid; ctrlelm->next = cdesc->controls; cdesc->controls = ctrlelm; ctrlelm->name = wmlAllocateString (name); /* * This becomes the current subobject */ wml_cur_subobj = (ObjectPtr) ctrlelm; return; } /* * Add a resource descriptor to a class. * The current object must be a class descriptor. Create and add a * resource descriptor, which becomes the current subobject. It is not * entered in the named object list. * * name the resource name */ void wmlAddClassResource (name) char *name; { WmlSynClassDefPtr cdesc; /* the class descriptor */ WmlSynClassResDefPtr rdesc; /* the resource reference descriptor */ /* * Acquire the current class descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddClassResource: NULL current object"); return; } cdesc = (WmlSynClassDefPtr) wml_cur_obj; if ( cdesc->validation != WmlClassDefValid ) { printf ("\nwmlAddClassResource: %d not a class descriptor", cdesc->validation); return; } /* * Add the resource to the resource list */ rdesc = (WmlSynClassResDefPtr) malloc (sizeof(WmlSynClassResDef)); rdesc->validation = WmlClassResDefValid; rdesc->name = wmlAllocateString (name); rdesc->type = NULL; rdesc->dflt = NULL; rdesc->exclude = WmlAttributeUnspecified; rdesc->next = cdesc->resources; cdesc->resources = rdesc; /* * This becomes the current subobject */ wml_cur_subobj = (ObjectPtr) rdesc; return; } /* * Add a child descriptor to a class. * The current object must be a class descriptor. Create and add a * child descriptor, which becomes the current subobject. It is not * entered in the named object list. * * name the resource name */ void wmlAddClassChild (name) char *name; { WmlSynClassDefPtr cdesc; /* the class descriptor */ WmlSynClassChildDefPtr chdesc; /* the child reference descriptor */ /* * Acquire the current class descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddClassResource: NULL current object"); return; } cdesc = (WmlSynClassDefPtr) wml_cur_obj; if ( cdesc->validation != WmlClassDefValid ) { printf ("\nwmlAddClassResource: %d not a class descriptor", cdesc->validation); return; } /* * Add the child to the child list */ chdesc = (WmlSynClassChildDefPtr) malloc (sizeof(WmlSynClassChildDef)); chdesc->validation = WmlClassChildDefValid; chdesc->name = wmlAllocateString (name); chdesc->next = cdesc->children; cdesc->children = chdesc; /* * This becomes the current subobject */ wml_cur_subobj = (ObjectPtr) chdesc; return; } /* * This routine sets an attribute in the current class resource descriptor. * The current subobject must be a class resource descriptor. The * named attribute is set. * * attrid one of TYPE | DEFAULT | EXCLUDE * val attribute value, usually a string. Must be * ATTRTRUE | ATTRFALSE for EXCLUDE. */ void wmlAddClassResourceAttribute (attrid, val) int attrid; char *val; { WmlSynClassResDefPtr rdesc; /* current class resource descriptor */ long excval; /* EXCLUDE value */ /* * Acquire the descriptor from the current subobject. */ if ( wml_cur_subobj == NULL ) { printf ("\nwmlAddClassResourceAttribute: NULL current subobject"); return; } rdesc = (WmlSynClassResDefPtr) wml_cur_subobj; if ( rdesc->validation != WmlClassResDefValid ) { printf ("\nwmlAddClassResourceAttribute: %d not a class resource descriptor", rdesc->validation); return; } switch ( attrid ) { case TYPE: rdesc->type = wmlAllocateString (val); break; case DEFAULT: rdesc->dflt = wmlAllocateString (val); break; case EXCLUDE: excval = (long) val; switch ( excval ) { case ATTRTRUE: rdesc->exclude = WmlAttributeTrue; break; case ATTRFALSE: rdesc->exclude = WmlAttributeFalse; break; default: printf ("\nwmlAddClassResourceAttribute: bad EXCLUDE value %ld", excval); return; break; } break; default: printf ("\nwmlAddClassResourceAttribute: unknown attrid %d", attrid); return; break; } return; } /* * Routine to set an attribute in a resource descriptor. * * This routine sets the given attribute in the current object, which * must be a resource descriptor. The current object and subobject do not * change. * * attrid oneof TYPE | RESOURCELITERAL | INTERNALLITERAL | * RELATED | DOCNAME | DEFAULT | XRMRESOURCE | ALIAS | * ENUMERATIONSET * val value of the attribute, usually a string */ void wmlAddResourceAttribute (attrid, val) int attrid; char *val; { WmlSynResourceDefPtr rdesc; /* the resource descriptor */ long xrmval; /* XRMRESOURCE value */ char **synlist; /* ALIAS pointer list */ /* * Acquire the current resource descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddResourceAttribute: NULL current object"); return; } rdesc = (WmlSynResourceDefPtr) wml_cur_obj; if ( rdesc->validation != WmlResourceDefValid ) { printf ("\nwmlAddResourceAttribute: %d not a resource descriptor", rdesc->validation); return; } /* * Set the appropriate resource */ switch ( attrid ) { case TYPE: rdesc->datatype = wmlAllocateString (val); break; case INTERNALLITERAL: rdesc->int_lit = wmlAllocateString (val); break; case RESOURCELITERAL: rdesc->resliteral = wmlAllocateString (val); break; case ENUMERATIONSET: rdesc->enumset = wmlAllocateString (val); break; case DOCNAME: rdesc->docname = wmlAllocateString (val); break; case RELATED: rdesc->related = wmlAllocateString (val); break; case DEFAULT: rdesc->dflt = wmlAllocateString (val); break; case XRMRESOURCE: xrmval = (long) val; switch ( xrmval ) { case ATTRTRUE: rdesc->xrm_support = WmlAttributeTrue; break; case ATTRFALSE: rdesc->xrm_support = WmlAttributeFalse; break; default: printf ("\nwmlAddResourceAttribute: bad XRMRESOURCE value %ld", xrmval); return; break; } break; case ALIAS: if ( rdesc->alias_cnt == 0 ) synlist = (char **) malloc (sizeof(char *)); else synlist = (char **) realloc (rdesc->alias_list, (rdesc->alias_cnt+1)*sizeof(char **)); synlist[rdesc->alias_cnt] = wmlAllocateString (val); rdesc->alias_cnt += 1; rdesc->alias_list = synlist; break; default: printf ("\nwmlAddResourceAttribute: unknown attrid %d", attrid); return; break; } return; } /* * Routine to set an attribute in a datatype descriptor. * * This routine sets the given attribute in the current object, which * must be a datatype descriptor. The current object and subobject do not * change. * * attrid oneof INTERNALLITERAL | DOCNAME | XRMRESOURCE * val value of the attribute, usually a string */ void wmlAddDatatypeAttribute (attrid, val) int attrid; char *val; { WmlSynDataTypeDefPtr ddesc; /* the datatype descriptor */ long xrmval; /* XRMRESOURCE value */ /* * Acquire the current datatype descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddDatatypeAttribute: NULL current object"); return; } ddesc = (WmlSynDataTypeDefPtr) wml_cur_obj; if ( ddesc->validation != WmlDataTypeDefValid ) { printf ("\nwmlAddDatatypeAttribute: %d not a datatype descriptor", ddesc->validation); return; } /* * Set the appropriate slot */ switch ( attrid ) { case INTERNALLITERAL: ddesc->int_lit = wmlAllocateString (val); break; case DOCNAME: ddesc->docname = wmlAllocateString (val); break; case XRMRESOURCE: xrmval = (long) val; switch ( xrmval ) { case ATTRTRUE: ddesc->xrm_support = WmlAttributeTrue; break; case ATTRFALSE: ddesc->xrm_support = WmlAttributeFalse; break; default: printf ("\nwmlAddDatatypeAttribute: bad XRMRESOURCE value %ld", xrmval); return; break; } break; default: printf ("\nwmlAddDatatypeAttribute: unknown attrid %d", attrid); return; break; } return; } /* * Routine to add a control specification to the current controls list. * The current object must be a controls list descriptor. The entry name * is added to the controls list. The new element becomes the current * subobject. * * name the name of the controlled class */ void wmlAddCtrlListControl (name) char *name; { WmlSynCtrlListDefPtr cdesc; /* the controls list descriptor */ WmlSynClassCtrlDefPtr ctrlelm; /* controls element */ /* * Acquire the current controls list descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddCtrlListControl: NULL current object"); return; } cdesc = (WmlSynCtrlListDefPtr) wml_cur_obj; if ( cdesc->validation != WmlCtrlListDefValid ) { printf ("\nwmlAddCtrlListControl: %d not a controls list descriptor", cdesc->validation); return; } /* * Add the control to the control list */ ctrlelm = (WmlSynClassCtrlDefPtr) malloc (sizeof(WmlSynClassCtrlDef)); ctrlelm->validation = WmlClassCtrlDefValid; ctrlelm->next = cdesc->controls; cdesc->controls = ctrlelm; ctrlelm->name = wmlAllocateString (name); /* * This becomes the current subobject */ wml_cur_subobj = (ObjectPtr) ctrlelm; return; } /* * Routine to add an enumeration value to the current enumeration set * The current object must be an enumeration set descriptor. The entry name * is added to the the enumeration value list. * * name the name of the enumeration value */ void wmlAddEnumSetValue (name) char *name; { WmlSynEnumSetDefPtr esdesc; /* the enumeration set descriptor */ WmlSynEnumSetValDefPtr evelm; /* EnumSet EnumValue element */ /* * Acquire the current enumeration set descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddEnumSetValue: NULL current object"); return; } esdesc = (WmlSynEnumSetDefPtr) wml_cur_obj; if ( esdesc->validation != WmlEnumSetDefValid ) { printf ("\nwmlAddEnumSetValue: %d not an enumeration set descriptor", esdesc->validation); return; } /* * Add the value to the set */ evelm = (WmlSynEnumSetValDefPtr) malloc (sizeof(WmlSynEnumSetValDef)); evelm->validation = WmlEnumValueDefValid; evelm->next = esdesc->values; esdesc->values = evelm; evelm->name = wmlAllocateString (name); /* * Becomes current subobject */ wml_cur_subobj = (ObjectPtr) evelm; } /* * Routine to set an attribute in an enumeration value * * This routine sets the given attribute in the current object, which must * be an enumeration value descriptor. The current object does not change. * * attrid oneof ENUMLITERAL * val value of the attribute, usually a string */ void wmlAddEnumValueAttribute (attrid, val) int attrid; char *val; { WmlSynEnumValueDefPtr evdesc; /* the enumeration value descriptor */ /* * Acquire the current enumeration value descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddEnumValueAttribute: NULL current object"); return; } evdesc = (WmlSynEnumValueDefPtr) wml_cur_obj; if ( evdesc->validation != WmlEnumValueDefValid ) { printf ("\nwmlAddEnumValueAttribute: %d not an enumeration value descriptor", evdesc->validation); return; } /* * Set the appropriate slot */ switch ( attrid ) { case ENUMLITERAL: evdesc->enumlit = wmlAllocateString (val); break; default: printf ("\nwmlAddEnumValueAttribute: unknown attrid %d", attrid); return; break; } return; } /* * Routine to set an attribute in a charset descriptor. * * This routine sets the given attribute in the current object, which * must be a charset descriptor. The current object and subobject do not * change. * * attrid oneof INTERNALLITERAL | ALIAS | XMSTRINGCHARSETNAME | * DIRECTION | PARSEDIRECTION | CHARACTERSIZE * val value of the attribute, usually a string */ void wmlAddCharsetAttribute (attrid, val) int attrid; char *val; { WmlSynCharSetDefPtr ddesc; /* the charset descriptor */ char **synlist; /* ALIAS pointer list */ long atrval; /* attribute value */ /* * Acquire the current charset descriptor */ if ( wml_cur_obj == NULL ) { printf ("\nwmlAddCharSetAttribute: NULL current object"); return; } ddesc = (WmlSynCharSetDefPtr) wml_cur_obj; if ( ddesc->validation != WmlCharSetDefValid ) { printf ("\nwmlAddCharsetAttribute: %d not a CharSet descriptor", ddesc->validation); return; } /* * Set the appropriate slot */ switch ( attrid ) { case INTERNALLITERAL: ddesc->int_lit = wmlAllocateString (val); break; case ALIAS: if ( ddesc->alias_cnt == 0 ) synlist = (char **) malloc (sizeof(char *)); else synlist = (char **) realloc (ddesc->alias_list, (ddesc->alias_cnt+1)*sizeof(char **)); synlist[ddesc->alias_cnt] = wmlAllocateString (val); ddesc->alias_cnt += 1; ddesc->alias_list = synlist; break; case XMSTRINGCHARSETNAME: ddesc->xms_name = wmlAllocateString (val); break; case DIRECTION: atrval = (long) val; switch ( atrval ) { case LEFTTORIGHT: ddesc->direction = WmlCharSetDirectionLtoR; break; case RIGHTTOLEFT: ddesc->direction = WmlCharSetDirectionRtoL; break; default: printf ("\nwmlAddCharsetAttribute: bad DIRECTION value %ld", atrval); return; break; } break; case PARSEDIRECTION: atrval = (long) val; switch ( atrval ) { case LEFTTORIGHT: ddesc->parsedirection = WmlCharSetDirectionLtoR; break; case RIGHTTOLEFT: ddesc->parsedirection = WmlCharSetDirectionRtoL; break; default: printf ("\nwmlAddCharsetAttribute: bad PARSEDIRECTION value %ld", atrval); return; break; } break; case CHARACTERSIZE: atrval = (long) val; switch ( atrval ) { case ONEBYTE: ddesc->charsize = WmlCharSizeOneByte; break; case TWOBYTE: ddesc->charsize = WmlCharSizeTwoByte; break; case MIXED1_2BYTE: ddesc->charsize = WmlCharSizeMixed1_2Byte; break; default: printf ("\nwmlAddCharsetAttribute: bad CHARACTERSIZE value %ld", atrval); return; break; } break; default: printf ("\nwmlAddCharsetAttribute: unknown attrid %d", attrid); return; break; } return; } /* * The error reporting routine. * * For now, issue a very simple error message */ void LexIssueError (tkn) int tkn; { switch ( tkn ) { case SEMICOLON: printf ("\n Syntax error: expected a semicolon"); break; case RBRACE: printf ("\n Syntax error: expected a right brace"); break; case 0: printf ("\nSyntax error: Couldn't recognize a section name, probably fatal"); break; } printf ("\n\tnear name='%s', value='%s', line %d", yynameval, yystringval, wml_line_count); wml_err_count += 1; return; } motif-2.3.8/tools/wml/UilSymCSet.h0000644000175000017500000003136113211513006013670 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* * Character set XmString name table, accessed by sym_k_..._charset code. * Each entry is the name which identifies the character set in a XmString. */ static char *charset_xmstring_names_table_vec[] = { 0, "", XmFONTLIST_DEFAULT_TAG, /* XmFONTLIST_DEFAULT_TAG */ _MOTIF_DEFAULT_LOCALE, /* _MOTIF_DEFAULT_LOCALE */ "CP1251", /* ansi_cyrillic */ "", /* big5 */ "IBM866", /* dos_cyrillic */ "", /* euc */ "GB2312.1980-0", /* gb_hanzi */ "GB2312.1980-1", /* gb_hanzi_gr */ "ISO8859-6", /* iso_arabic */ "ISO8859-6", /* iso_arabic_lr */ "ISO8859-5", /* iso_cyrillic */ "ISO8859-7", /* iso_greek */ "ISO8859-8", /* iso_hebrew */ "ISO8859-8", /* iso_hebrew_lr */ "ISO-IR-111", /* iso_ir_111 */ "ISO8859-1", /* iso_latin1 */ "ISO8859-2", /* iso_latin2 */ "ISO8859-3", /* iso_latin3 */ "ISO8859-4", /* iso_latin4 */ "ISO8859-5", /* iso_latin5 */ "JISX0208.1983-0", /* jis_kanji */ "JISX0208.1983-1", /* jis_kanji_gr */ "JISX0201.1976-0", /* jis_katakana */ "KSC5601.1987-0", /* ksc_hangul */ "KSC5601.1987-1", /* ksc_hangul_gr */ "UTF-8", /* utf8 */ }; externaldef(uil_sym_glbl) char **charset_xmstring_names_table = charset_xmstring_names_table_vec; /* * Character set writing direction table, accessed by sym_k_..._charset code. * Each entry is the XmSTRING_DIRECTION_... code which identifies the * writing direction for the character set in a XmString. */ static unsigned char charset_wrdirection_table_vec[] = { 0, 0, /* userdefined */ XmSTRING_DIRECTION_L_TO_R, /* XmFONTLIST_DEFAULT_TAG */ XmSTRING_DIRECTION_L_TO_R, /* _MOTIF_DEFAULT_LOCALE */ XmSTRING_DIRECTION_L_TO_R, /* ansi_cyrillic */ XmSTRING_DIRECTION_L_TO_R, /* big5 */ XmSTRING_DIRECTION_L_TO_R, /* dos_cyrillic */ XmSTRING_DIRECTION_L_TO_R, /* euc */ XmSTRING_DIRECTION_L_TO_R, /* gb_hanzi */ XmSTRING_DIRECTION_L_TO_R, /* gb_hanzi_gr */ XmSTRING_DIRECTION_R_TO_L, /* iso_arabic */ XmSTRING_DIRECTION_R_TO_L, /* iso_arabic_lr */ XmSTRING_DIRECTION_L_TO_R, /* iso_cyrillic */ XmSTRING_DIRECTION_L_TO_R, /* iso_greek */ XmSTRING_DIRECTION_R_TO_L, /* iso_hebrew */ XmSTRING_DIRECTION_R_TO_L, /* iso_hebrew_lr */ XmSTRING_DIRECTION_L_TO_R, /* iso_ir_111 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin1 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin2 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin3 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin4 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin5 */ XmSTRING_DIRECTION_L_TO_R, /* jis_kanji */ XmSTRING_DIRECTION_L_TO_R, /* jis_kanji_gr */ XmSTRING_DIRECTION_L_TO_R, /* jis_katakana */ XmSTRING_DIRECTION_L_TO_R, /* ksc_hangul */ XmSTRING_DIRECTION_L_TO_R, /* ksc_hangul_gr */ XmSTRING_DIRECTION_L_TO_R, /* utf8 */ }; externaldef(uil_sym_glbl) unsigned char *charset_writing_direction_table = charset_wrdirection_table_vec; /* * Character set parsing direction table, accessed by sym_k_..._charset code. * Each entry is the XmSTRING_DIRECTION_... code which identifies the * parsing direction for the character set in a XmString. */ static unsigned char charset_parsdirection_table_vec[] = { 0, 0, /* userdefined */ XmSTRING_DIRECTION_L_TO_R, /* XmFONTLIST_DEFAULT_TAG */ XmSTRING_DIRECTION_L_TO_R, /* _MOTIF_DEFAULT_LOCALE */ XmSTRING_DIRECTION_L_TO_R, /* ansi_cyrillic */ XmSTRING_DIRECTION_L_TO_R, /* big5 */ XmSTRING_DIRECTION_L_TO_R, /* dos_cyrillic */ XmSTRING_DIRECTION_L_TO_R, /* euc */ XmSTRING_DIRECTION_L_TO_R, /* gb_hanzi */ XmSTRING_DIRECTION_L_TO_R, /* gb_hanzi_gr */ XmSTRING_DIRECTION_R_TO_L, /* iso_arabic */ XmSTRING_DIRECTION_L_TO_R, /* iso_arabic_lr */ XmSTRING_DIRECTION_L_TO_R, /* iso_cyrillic */ XmSTRING_DIRECTION_L_TO_R, /* iso_greek */ XmSTRING_DIRECTION_R_TO_L, /* iso_hebrew */ XmSTRING_DIRECTION_L_TO_R, /* iso_hebrew_lr */ XmSTRING_DIRECTION_L_TO_R, /* iso_ir_111 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin1 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin2 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin3 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin4 */ XmSTRING_DIRECTION_L_TO_R, /* iso_latin5 */ XmSTRING_DIRECTION_L_TO_R, /* jis_kanji */ XmSTRING_DIRECTION_L_TO_R, /* jis_kanji_gr */ XmSTRING_DIRECTION_L_TO_R, /* jis_katakana */ XmSTRING_DIRECTION_L_TO_R, /* ksc_hangul */ XmSTRING_DIRECTION_L_TO_R, /* ksc_hangul_gr */ XmSTRING_DIRECTION_L_TO_R, /* utf8 */ }; externaldef(uil_sym_glbl) unsigned char *charset_parsing_direction_table = charset_parsdirection_table_vec; /* * Character set character size table, accessed by sym_k_..._charset code. * Each entry is the sym_k_..._charsize literal which names the character * size for the character set in a XmString. */ static unsigned char charset_charsize_table_vec[] = { 0, 0, /* userdefined */ sym_k_onebyte_charsize, /* XmFONTLIST_DEFAULT_TAG */ sym_k_onebyte_charsize, /* _MOTIF_DEFAULT_LOCALE */ sym_k_onebyte_charsize, /* ansi_cyrillic */ sym_k_onebyte_charsize, /* big5 */ sym_k_onebyte_charsize, /* dos_cyrillic */ sym_k_onebyte_charsize, /* euc */ sym_k_twobyte_charsize, /* gb_hanzi */ sym_k_twobyte_charsize, /* gb_hanzi_gr */ sym_k_onebyte_charsize, /* iso_arabic */ sym_k_onebyte_charsize, /* iso_arabic_lr */ sym_k_onebyte_charsize, /* iso_cyrillic */ sym_k_onebyte_charsize, /* iso_greek */ sym_k_onebyte_charsize, /* iso_hebrew */ sym_k_onebyte_charsize, /* iso_hebrew_lr */ sym_k_onebyte_charsize, /* iso_ir_111 */ sym_k_onebyte_charsize, /* iso_latin1 */ sym_k_onebyte_charsize, /* iso_latin2 */ sym_k_onebyte_charsize, /* iso_latin3 */ sym_k_onebyte_charsize, /* iso_latin4 */ sym_k_onebyte_charsize, /* iso_latin5 */ sym_k_twobyte_charsize, /* jis_kanji */ sym_k_twobyte_charsize, /* jis_kanji_gr */ sym_k_onebyte_charsize, /* jis_katakana */ sym_k_twobyte_charsize, /* ksc_hangul */ sym_k_twobyte_charsize, /* ksc_hangul_gr */ sym_k_onebyte_charsize, /* utf8 */ }; externaldef(uil_sym_glbl) unsigned char *charset_character_size_table = charset_charsize_table_vec; /* * All the names under which a character set may be legally named in a * $LANG variable (upper case). */ static char *charset_lang_names_table_vec[] = { "XMFONTLIST_DEFAULT_TAG", /* XmFONTLIST_DEFAULT_TAG */ "XMFONTLIST_DEFAULT_TAG", /* XmFONTLIST_DEFAULT_TAG */ "_MOTIF_DEFAULT_LOCALE", /* _MOTIF_DEFAULT_LOCALE */ "_MOTIF_DEFAULT_LOCALE", /* _MOTIF_DEFAULT_LOCALE */ "ANSI_CYRILLIC", /* ansi_cyrillic */ "CP1251", /* ansi_cyrillic */ "WINDOWS-1251", /* ansi_cyrillic */ "ANSI-1251", /* ansi_cyrillic */ "ANSI1251", /* ansi_cyrillic */ "BIG5", /* big5 */ "", /* big5 */ "DOS_CYRILLIC", /* dos_cyrillic */ "IBM866", /* dos_cyrillic */ "IBM-866", /* dos_cyrillic */ "CP866", /* dos_cyrillic */ "866", /* dos_cyrillic */ "EUC", /* euc */ "", /* euc */ "GB_HANZI", /* gb_hanzi */ "GB2312.1980-0", /* gb_hanzi */ "GB_CHINESE", /* gb_hanzi */ "GB_HANZI_GL", /* gb_hanzi */ "GB_HANZI_GR", /* gb_hanzi_gr */ "GB2312.1980-1", /* gb_hanzi_gr */ "ISO_ARABIC", /* iso_arabic */ "ISO8859-6", /* iso_arabic */ "ISO_LATIN6", /* iso_arabic */ "ISOLATIN6", /* iso_arabic */ "88596", /* iso_arabic */ "ISO_ARABIC_LR", /* iso_arabic_lr */ "ISO8859-6", /* iso_arabic_lr */ "ISO_LATIN6_LR", /* iso_arabic_lr */ "ISO_CYRILLIC", /* iso_cyrillic */ "ISO8859-5", /* iso_cyrillic */ "ISO-8859-5", /* iso_cyrillic */ "ISO_GREEK", /* iso_greek */ "ISO8859-7", /* iso_greek */ "ISO_LATIN7", /* iso_greek */ "ISOLATIN7", /* iso_greek */ "88597", /* iso_greek */ "ISO_HEBREW", /* iso_hebrew */ "ISO8859-8", /* iso_hebrew */ "ISO_LATIN8", /* iso_hebrew */ "ISOLATIN8", /* iso_hebrew */ "88598", /* iso_hebrew */ "ISO_HEBREW_LR", /* iso_hebrew_lr */ "ISO8859-8", /* iso_hebrew_lr */ "ISO_LATIN8_LR", /* iso_hebrew_lr */ "ISO_IR_111", /* iso_ir_111 */ "ISO-IR-111", /* iso_ir_111 */ "KOI8-R", /* iso_ir_111 */ "KOI8-U", /* iso_ir_111 */ "KOI8-RU", /* iso_ir_111 */ "KOI8R", /* iso_ir_111 */ "KOI8U", /* iso_ir_111 */ "KOI8RU", /* iso_ir_111 */ "ISO_LATIN1", /* iso_latin1 */ "ISO8859-1", /* iso_latin1 */ "ISOLATIN1", /* iso_latin1 */ "88591", /* iso_latin1 */ "ASCII", /* iso_latin1 */ "ISO_LATIN2", /* iso_latin2 */ "ISO8859-2", /* iso_latin2 */ "ISOLATIN2", /* iso_latin2 */ "88592", /* iso_latin2 */ "ISO_LATIN3", /* iso_latin3 */ "ISO8859-3", /* iso_latin3 */ "ISOLATIN3", /* iso_latin3 */ "88593", /* iso_latin3 */ "ISO_LATIN4", /* iso_latin4 */ "ISO8859-4", /* iso_latin4 */ "ISOLATIN4", /* iso_latin4 */ "88594", /* iso_latin4 */ "ISO_LATIN5", /* iso_latin5 */ "ISO8859-5", /* iso_latin5 */ "ISOLATIN5", /* iso_latin5 */ "88595", /* iso_latin5 */ "JIS_KANJI", /* jis_kanji */ "JISX0208.1983-0", /* jis_kanji */ "JIS_JAPANESE", /* jis_kanji */ "JIS_KANJI_GL", /* jis_kanji */ "JIS_KANJI_GR", /* jis_kanji_gr */ "JISX0208.1983-1", /* jis_kanji_gr */ "JIS_KATAKANA", /* jis_katakana */ "JISX0201.1976-0", /* jis_katakana */ "KSC_HANGUL", /* ksc_hangul */ "KSC5601.1987-0", /* ksc_hangul */ "KSC_KOREAN", /* ksc_hangul */ "KSC_HANGUL_GL", /* ksc_hangul */ "KSC_HANGUL_GR", /* ksc_hangul_gr */ "KSC5601.1987-1", /* ksc_hangul_gr */ "UTF8", /* utf8 */ "UTF-8", /* utf8 */ }; externaldef(uil_sym_glbl) char **charset_lang_names_table = charset_lang_names_table_vec; /* * The sym_k_..._charset codes for charset_lang_names */ static unsigned short int charset_lang_codes_table_vec[] = { sym_k_XmFONTLIST_DEFAULT_TAG_charset, sym_k_XmFONTLIST_DEFAULT_TAG_charset, sym_k__MOTIF_DEFAULT_LOCALE_charset, sym_k__MOTIF_DEFAULT_LOCALE_charset, sym_k_ansi_cyrillic_charset, sym_k_ansi_cyrillic_charset, sym_k_ansi_cyrillic_charset, sym_k_ansi_cyrillic_charset, sym_k_ansi_cyrillic_charset, sym_k_big5_charset, sym_k_big5_charset, sym_k_dos_cyrillic_charset, sym_k_dos_cyrillic_charset, sym_k_dos_cyrillic_charset, sym_k_dos_cyrillic_charset, sym_k_dos_cyrillic_charset, sym_k_euc_charset, sym_k_euc_charset, sym_k_gb_hanzi_charset, sym_k_gb_hanzi_charset, sym_k_gb_hanzi_charset, sym_k_gb_hanzi_charset, sym_k_gb_hanzi_gr_charset, sym_k_gb_hanzi_gr_charset, sym_k_iso_arabic_charset, sym_k_iso_arabic_charset, sym_k_iso_arabic_charset, sym_k_iso_arabic_charset, sym_k_iso_arabic_charset, sym_k_iso_arabic_lr_charset, sym_k_iso_arabic_lr_charset, sym_k_iso_arabic_lr_charset, sym_k_iso_cyrillic_charset, sym_k_iso_cyrillic_charset, sym_k_iso_cyrillic_charset, sym_k_iso_greek_charset, sym_k_iso_greek_charset, sym_k_iso_greek_charset, sym_k_iso_greek_charset, sym_k_iso_greek_charset, sym_k_iso_hebrew_charset, sym_k_iso_hebrew_charset, sym_k_iso_hebrew_charset, sym_k_iso_hebrew_charset, sym_k_iso_hebrew_charset, sym_k_iso_hebrew_lr_charset, sym_k_iso_hebrew_lr_charset, sym_k_iso_hebrew_lr_charset, sym_k_iso_ir_111_charset, sym_k_iso_ir_111_charset, sym_k_iso_ir_111_charset, sym_k_iso_ir_111_charset, sym_k_iso_ir_111_charset, sym_k_iso_ir_111_charset, sym_k_iso_ir_111_charset, sym_k_iso_ir_111_charset, sym_k_iso_latin1_charset, sym_k_iso_latin1_charset, sym_k_iso_latin1_charset, sym_k_iso_latin1_charset, sym_k_iso_latin1_charset, sym_k_iso_latin2_charset, sym_k_iso_latin2_charset, sym_k_iso_latin2_charset, sym_k_iso_latin2_charset, sym_k_iso_latin3_charset, sym_k_iso_latin3_charset, sym_k_iso_latin3_charset, sym_k_iso_latin3_charset, sym_k_iso_latin4_charset, sym_k_iso_latin4_charset, sym_k_iso_latin4_charset, sym_k_iso_latin4_charset, sym_k_iso_latin5_charset, sym_k_iso_latin5_charset, sym_k_iso_latin5_charset, sym_k_iso_latin5_charset, sym_k_jis_kanji_charset, sym_k_jis_kanji_charset, sym_k_jis_kanji_charset, sym_k_jis_kanji_charset, sym_k_jis_kanji_gr_charset, sym_k_jis_kanji_gr_charset, sym_k_jis_katakana_charset, sym_k_jis_katakana_charset, sym_k_ksc_hangul_charset, sym_k_ksc_hangul_charset, sym_k_ksc_hangul_charset, sym_k_ksc_hangul_charset, sym_k_ksc_hangul_gr_charset, sym_k_ksc_hangul_gr_charset, sym_k_utf8_charset, sym_k_utf8_charset, }; externaldef(uil_sym_glbl) unsigned short int *charset_lang_codes_table = charset_lang_codes_table_vec; /* * The number of entries in charset_lang_..._table tables */ externaldef(uil_sym_glbl) unsigned short int charset_lang_table_max = 93; motif-2.3.8/tools/wml/UilDBDef.h0000644000175000017500000003630613145162623013264 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interfaces necessry to the binary ** data base in the WML & UIL compilers. ** **-- **/ #ifndef UilDBDef_h #define UilDBDef_h /*********************************************************************** ****************** From UilDef.h ***************************************/ #define _BIT_INDEX(_type) \ (((unsigned int) (_type)) >> 3) #define _BIT_MASK(_type) \ (1 << (((unsigned int) (_type)) & 0x7)) #define _BIT_SET(table_entry_addr, _type) \ ( _BIT_MASK (_type) & \ ( ((unsigned char *) (table_entry_addr)) \ [ _BIT_INDEX (_type) ] ) ) /******************************************************************* **************** From UilSymDef.h *********************************/ /* ** Hash table size */ #define sym_k_hash_table_limit 127 /* ** Symbol tags. These values are used in the tag field of every object header ** to identify the type of the entry. */ #define sym_k_error_entry (127) /* An error entry is used when compilation errors are detected in the */ /* source program. Its use reduces cascading errors caused by missing */ /* information and allows the compilation to continue and thus */ /* additional errors may be detected */ #define sym_k_value_entry 1 /* A value entry contains information about a UIL literal value */ /* (integer, string, compound string, xbitmapfile, argument, color, */ /* icon, etc.). The b_type field is used to determine the datatype of */ /* this value. */ #define sym_k_name_entry 2 /* A name entry corresponds to a name (identifier) used in the UIL */ /* source. */ #define sym_k_widget_entry 3 /* A widget entry represents a widget declaration. It points off to */ /* the arguments, callbacks, and controls lists for the widget. */ #define sym_k_control_entry 4 /* A control entry hangs off a list entry and identifes an object */ /* (widget or gadget) that is controlled. It also contains the */ /* managed/unmanaged information. */ #define sym_k_forward_ref_entry 5 /* forward reference entries are a linked listed of objects */ /* (widgets/gadgets) that were not defined at the time of the */ /* reference. After all objects have been seen, then this list is */ /* traversed and all objects in it should now be defined and the */ /* specified pointers can be filled-in. */ #define sym_k_external_def_entry 6 /* An external definition entry identifies a name that has been */ /* imported and thus in not declared within this source module. */ #define sym_k_argument_entry 7 /* An argument entry hangs off a list entry and identifies an object */ /* argument. It contains informtation about the argument name and */ /* argument value. */ #define sym_k_callback_entry 8 /* An calllback entry hangs off a list entry and identifies an object */ /* callback. It contains informtation about the callback name, */ /* callback procedure, and callback tag. */ #define sym_k_module_entry 9 /* A module entry contains information specified on the module */ /* statement. */ #define sym_k_proc_def_entry 10 /* A procedure definition entry is created for each procedure listed */ /* in a procedure section. I contains informaion on the number and */ /* types of the arguments. */ #define sym_k_proc_ref_entry 11 /* A procedure reference entry contains information about a the use of */ /* a procedure (e.g. as a callback). It also stores the tag to be */ /* passed to the procedure. */ #define sym_k_list_entry 12 /* A list entry is a typed list of other symbol table entries. It */ /* contains a count and a pointer to the next entry on the list via */ /* the obj_header.az_next field. */ #define sym_k_child_entry 13 /* A child entry represents a declaration for an */ /* automatically created child. It points off to */ /* the arguments, callbacks, and controls lists for the child. Since */ /* the structures for widget and child are the same, the */ /* datastructure for children is really a sym_k_widget_entry_type. */ #define sym_k_identifier_entry 14 /* identifier entry tag is used for diagnostic messages only */ #define sym_k_color_item_entry 15 /* entry describing a color. */ #define sym_k_gadget_entry 16 /* A gadget entry represents a gadget declaration. It points off to */ /* the arguments, callbacks, and controls lists for the gadget. Since */ /* the structures for widget and gadgets are the same, the */ /* datastructure for gadgets is really a sym_k_widget_entry_type. */ #define sym_k_root_entry 17 /* An entry used to group all the other entries together. It is */ /* returned in the parse_tree_root field of the compilation descriptor */ /* when using the callable interface. */ #define sym_k_parent_list_entry 18 /* This is a list of parents of a widget. It is used to check for */ /* constraints provided by the parent that may be used on this widget. */ #define sym_k_nested_list_entry 19 /* This entry occurs as a list entry for a nested list. It occupies */ /* the correct position in the list for the reference to a list, and */ /* points to the actual list entry. */ #define sym_k_include_file_entry 20 /* An include file entry is used to describe the contents of an */ /* include file. It is needed only maintain information about the */ /* source file from which this parse tree was generated. It is not */ /* used by UIL directly. */ #define sym_k_section_entry 21 /* A section entry is used to describe the contents of an source file. */ /* It is needed only maintain information about the structure of */ /* source file from which this parse tree was generated. It is not */ /* used by UIL directly. */ /* */ #define sym_k_def_obj_entry 22 /* This entry corresponds to the default object clause on the module */ /* declaration it is used to store source information about the file */ /* from which this parse tree was generated. It is not used by UIL */ /* directly. */ #define sym_k_UNUSED23_entry 23 #define sym_k_val_forward_ref_entry 24 /* val forward reference entries are a linked listed of values */ /* that were not defined at the time of the */ /* reference. After all values have been seen, then this list is */ /* traversed and all values in it should now be defined and the */ /* specified pointers can be filled-in. */ #define sym_k_max_entry 24 /* this is the largest possible value for an entry constant. */ /* ** Common attribute masks -- These values are used in the b_flags field of ** the object_header. */ #define sym_m_private (1 << 0) /* This item is private to this source module and thus need not be */ /* output into the UID file. */ #define sym_m_exported (1 << 1) /* This is an exported definition and must be put in the UID file. */ #define sym_m_imported (1 << 2) /* This item is a reference external to this source module and thus */ /* will be resolved at runtime by searching the resourec hierarchy. */ #define sym_m_reference (1 << 3) #define sym_m_builtin (1 << 4) /* This item is builtin as oppose to a userdefined item. */ #define sym_m_obj_is_gadget (1 << 5) /* This object is a gadget as oppose to a widget. */ /* ** Output states - order is important */ #define sym_k_not_processed 0 #define sym_k_queued 1 #define sym_k_emitted 2 /* ** Constants to define compiler-recognized data types. It is ** important that the names used in .wml language descriptions ** match these names. These values were once automatically generated ** by WML. They are now maintained by hand to reduce compiler ** dependence on WML artifacts. ** ** We have also separated the values loosely into two classes: ** values which can be used to verify operator legality and values ** which cannot (see UilSemVal.c -- the legal_operand_type table). ** There is a comment below denoting where the separation is. Any ** values above the comment may be used for validation of an operator ** while any values below may not. ** ** The order of the values below is unimportant except that the ** entries in the uil_datatype_names table in UilData.c must be ** ordered the same way. */ #define sym_k_any_value 1 #define sym_k_bool_value 2 #define sym_k_char_8_value 3 #define sym_k_compound_string_value 4 #define sym_k_float_value 5 #define sym_k_integer_value 6 #define sym_k_single_float_value 7 #define sym_k_localized_string_value 8 #define sym_k_wchar_string_value 9 #define sym_k_horizontal_integer_value 10 #define sym_k_vertical_integer_value 11 #define sym_k_horizontal_float_value 12 #define sym_k_vertical_float_value 13 /* Values after here may not be used for operator argument validation */ #define sym_k_argument_value 14 #define sym_k_asciz_table_value 15 #define sym_k_class_rec_name_value 16 #define sym_k_color_value 17 #define sym_k_color_table_value 18 #define sym_k_font_value 19 #define sym_k_font_table_value 20 #define sym_k_icon_value 21 #define sym_k_identifier_value 22 #define sym_k_integer_table_value 23 #define sym_k_keysym_value 24 #define sym_k_pixmap_value 25 #define sym_k_reason_value 26 #define sym_k_rgb_value 27 #define sym_k_string_table_value 28 #define sym_k_trans_table_value 29 #define sym_k_widget_ref_value 30 #define sym_k_xbitmapfile_value 31 #define sym_k_fontset_value 32 #define sym_k_child_value 33 #define sym_k_max_value 33 #define sym_k_no_value (sym_k_max_value+1) /* * Error values for all kind of sym_k_... literal set */ #define sym_k_error_value 0 #define sym_k_error_object 0 #define sym_k_error_charset 0 /* * Literals associated with character sets * * Character set character sizes */ #define sym_k_onebyte_charsize 1 #define sym_k_twobyte_charsize 2 #define sym_k_mixed1_2byte_charsize 3 /* * User-defined character set */ #define sym_k_userdefined_charset 1 /* * XmFONTLIST_DEFAULT_TAG */ #define sym_k_fontlist_default_tag 0 /* ** value sets defining expression operators */ #define sym_k_unspecified_op 0 #define sym_k_not_op 1 #define sym_k_unary_plus_op 2 #define sym_k_unary_minus_op 3 #define sym_k_comp_str_op 4 #define sym_k_wchar_str_op 5 #define sym_k_last_unary_op 5 #define sym_k_multiply_op 6 #define sym_k_divide_op 7 #define sym_k_add_op 8 #define sym_k_subtract_op 9 #define sym_k_left_shift_op 10 #define sym_k_right_shift_op 11 #define sym_k_and_op 12 #define sym_k_xor_op 13 #define sym_k_or_op 14 #define sym_k_cat_op 15 #define sym_k_last_binary_op 15 #define sym_k_valref_op 16 /* az_exp_op1 points to the value node whose value is referenced by this value node. */ #define sym_k_coerce_op 17 /* az_exp_op1 points to the value node whose value is to be coerced to the data type of this node. */ #define sym_k_last_special_op 17 /* * Structure of an enumeration set entry */ typedef struct { short int values_cnt; /* number of values in the enuemration set descriptor */ unsigned short int *values; /* vector of values */ } UilEnumSetDescDef, *UilEnumSetDescDefPtr; /********************************************************************** **************** From UilKeyDef.h ************************************/ /* * Token class literals */ #define tkn_k_class_argument 1 #define tkn_k_class_charset 2 #define tkn_k_class_color 3 #define tkn_k_class_enumval 4 #define tkn_k_class_font 5 #define tkn_k_class_identifier 6 #define tkn_k_class_keyword 7 #define tkn_k_class_literal 8 #define tkn_k_class_reason 9 #define tkn_k_class_reserved 10 #define tkn_k_class_special 11 #define tkn_k_class_unused 12 #define tkn_k_class_class 13 #define tkn_k_class_child 14 /* * Keyword table entry structure */ typedef struct { unsigned char b_class; unsigned short int b_subclass; unsigned char b_length; unsigned char b_token; char *at_name; } key_keytable_entry_type; /************************************************************************* ************************ New Stuff **************************************/ /* For COMPOUND_STRING_COMPONENT */ #define XmStringComponent "XmStringComponent" /* * Names of the tables put in the binary database */ #define Constraint_Tab 1 #define Key_Table 2 #define Key_Table_Case_Ins 3 #define Allowed_Argument_Table 4 #define Argument_Type_Table_Value 5 #define Charset_Xmstring_Names_Table 6 #define Charset_Wrdirection_Table 7 #define Charset_Parsdirection_Table 8 #define Charset_Charsize_Table 9 #define Charset_Lang_Names_Table 10 #define Charset_Lang_Codes_Table 11 #define Allowed_Control_Table 12 #define Enum_Set_Table 13 #define Argument_Enum_Set_Table 14 #define Enumval_Values_Table 15 #define Uil_Widget_Names 16 #define Uil_Argument_Names 17 #define Uil_Reason_Names 18 #define Uil_Enumval_names 19 #define Uil_Charset_Names 20 #define Related_Argument_Table 21 #define Allowed_Reason_Table 22 #define Uil_Widget_Funcs 23 #define Uil_Gadget_Funcs 24 #define Uil_Urm_Nondialog_Class 25 #define Uil_Urm_Subtree_Resource 26 #define Uil_Argument_Toolkit_Names 27 #define Uil_Reason_Toolkit_Names 28 #define Child_Class_Table 29 #define Allowed_Child_Table 30 #define Uil_Children_Names 31 /* * Binary Data Base Work */ #define DB_Compiled_Version 2 typedef struct _db_globals_struct { int version; int uil_max_arg; int uil_max_charset; int charset_lang_table_max; int uil_max_object; int uil_max_reason; int uil_max_enumval; int uil_max_enumset; int key_k_keyword_count; int key_k_keyword_max_length; int uil_max_child; } _db_globals; typedef struct _db_header_struct { int table_id; int num_items; int table_size; } _db_header, *_db_header_ptr; #endif /* UilDBDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/tools/wml/wmlutils.c0000644000175000017500000002164013145162623013554 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wmlutils.c /main/8 1995/08/29 11:11:24 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This file contains utilities used by WML. */ #include "wml.h" #if defined(__STDC__) #include #include #endif #include /* * Utility to allocate dynamic space for a string, and return the * dynamic copy. Produces a NULL on null input. */ char *wmlAllocateString (stg) char *stg; { char *dynstg; /* the dynamic copy */ if ( stg == NULL ) return NULL; dynstg = (char *) malloc (strlen(stg)+1); strcpy (dynstg, stg); return dynstg; } /* * Utility to convert a string to upper case. The conversion happens in * place, destroying the original string. */ void wmlUpperCaseString (stg) char *stg; { int ndx; /* loop index */ if ( stg == NULL ) return; for ( ndx=0 ; ndxcnt = 0; listptr->max = size; listptr->ordered = is_ordered; listptr->hvec = (ObjectHandleDefPtr) malloc(size*sizeof(ObjectHandleDef)); return; } /* * Routine to resize a dynamic handle list. Increases the size if required, * but does nothing if the list is already big enough. * * listptr the dynamic list * new_size new list size */ void wmlResizeHList (listptr, new_size) DynamicHandleListDefPtr listptr; int new_size; { ObjectHandleDefPtr new_vec; /* reallocated vector */ if ( listptr->max >= new_size ) return; listptr->max = new_size; new_vec = (ObjectHandleDefPtr) realloc (listptr->hvec, new_size*sizeof(ObjectHandleDef)); listptr->hvec = new_vec; return; } /* * Routine to clear a dynamic handle list. It leaves the handle vector intact, * but frees all the allocated names. The count is reset to 0. * but does nothing if the list is already big enough. * * listptr the dynamic list */ void wmlClearHList (listptr) DynamicHandleListDefPtr listptr; { int ndx; /* current index in list */ for ( ndx=0 ; ndxcnt ; ndx++ ) { free (listptr->hvec[ndx].objname); listptr->hvec[ndx].objname = NULL; } listptr->cnt = 0; return; } /* * Function to find a name in a dynamic list. This will function on both * ordered and unordered lists. * * listptr the dynamic list * name the name to look up in the list * * returns: * >= 0 name found, index in list * < 0 name not found */ int wmlFindInHList (listptr, name) DynamicHandleListDefPtr listptr; char *name; { int ndx; /* current index in list */ int londx; /* low index */ int hindx; /* high index */ int midndx; /* midpoint index */ int cmpres; /* strcmp result */ /* * Binary search if ordered, brute force otherwise */ if ( listptr->ordered ) { for ( londx=0,hindx=listptr->cnt-1 ; hindx>=londx ; ) { midndx = (londx+hindx) / 2; cmpres = strcmp (name, listptr->hvec[midndx].objname); if ( cmpres < 0 ) hindx = midndx - 1; if ( cmpres > 0 ) londx = midndx + 1; if ( cmpres == 0 ) return midndx; } return -1; } else { for ( ndx=0 ; ndxcnt ; ndx++ ) if ( strcmp(name,listptr->hvec[ndx].objname) == 0 ) return ndx; return -1; } } /* * Routine to insert an entry into a list. The insertion is ordered or * unordered depending on the way the list is marked. Unordered lists * insert at the end. This routine assumes no duplicates will be entered * in the list. * * listptr the list * name the name under which to insert * obj the object to insert */ void wmlInsertInHList (listptr, name, obj) DynamicHandleListDefPtr listptr; char *name; ObjectPtr obj; { int ndx; /* current index in list */ int londx; /* low index */ int hindx; /* high index */ int midndx = 0; /* midpoint index */ int newndx; /* new entry index */ int cmpres = 0; /* strcmp result */ /* * Guarantee enough space in the list */ wmlResizeHList (listptr, listptr->cnt+1); /* * Binary search and insert if ordered, brute force otherwise */ if ( listptr->ordered ) { if ( listptr->cnt == 0 ) { listptr->hvec[0].objname = wmlAllocateString (name); listptr->hvec[0].objptr = obj; listptr->cnt += 1; return; } for ( londx=0,hindx=listptr->cnt-1 ; hindx>=londx ; ) { midndx = (londx+hindx) / 2; cmpres = strcmp (name, listptr->hvec[midndx].objname); if ( cmpres == 0 ) { printf ("\nwmlInsertInHList: duplicate name '%s'found\n", name); return; } if ( londx == hindx ) break; if ( cmpres < 0 ) hindx = midndx - 1; if ( cmpres > 0 ) londx = midndx + 1; } /* * The new entry will go either at midndx or after midndx. Move down * the vector appropriately. */ if ( cmpres < 0 ) newndx = midndx; else newndx = midndx + 1; for ( ndx=listptr->cnt-1 ; ndx>=newndx ; ndx-- ) { listptr->hvec[ndx+1].objname = listptr->hvec[ndx].objname; listptr->hvec[ndx+1].objptr = listptr->hvec[ndx].objptr; } listptr->hvec[newndx].objname = wmlAllocateString (name); listptr->hvec[newndx].objptr = obj; listptr->cnt += 1; return; } else { listptr->hvec[listptr->cnt].objname = wmlAllocateString (name); listptr->hvec[listptr->cnt].objptr = obj; listptr->cnt += 1; return; } } /* * Routine to insert an entry into a token list. The insertion is ordered. * This routine allows duplicates * * listptr the list * name the name under which to insert * obj the object to insert */ void wmlInsertInKeyList (listptr, name, obj) DynamicHandleListDefPtr listptr; char *name; ObjectPtr obj; { int ndx; /* current index in list */ int londx; /* low index */ int hindx; /* high index */ int midndx = 0; /* midpoint index */ int newndx; /* new entry index */ int cmpres = 0; /* strcmp result */ /* * Guarantee enough space in the list */ wmlResizeHList (listptr, listptr->cnt+1); /* * Binary search and insert */ if ( listptr->cnt == 0 ) { listptr->hvec[0].objname = wmlAllocateString (name); listptr->hvec[0].objptr = obj; listptr->cnt += 1; return; } for ( londx=0,hindx=listptr->cnt-1 ; hindx>=londx ; ) { midndx = (londx+hindx) / 2; cmpres = strcmp (name, listptr->hvec[midndx].objname); if ( londx == hindx ) break; if ( cmpres < 0 ) hindx = midndx - 1; if ( cmpres >= 0 ) londx = midndx + 1; } /* * The new entry will go either at midndx or after midndx. Move down * the vector appropriately. */ if ( cmpres < 0 ) newndx = midndx; else newndx = midndx + 1; for ( ndx=listptr->cnt-1 ; ndx>=newndx ; ndx-- ) { listptr->hvec[ndx+1].objname = listptr->hvec[ndx].objname; listptr->hvec[ndx+1].objptr = listptr->hvec[ndx].objptr; } listptr->hvec[newndx].objname = wmlAllocateString (name); listptr->hvec[newndx].objptr = obj; listptr->cnt += 1; return; } /* * Indicate if a resource is in a resource reference list by returning its * reference pointer. */ WmlClassResDefPtr wmlResolveResIsMember (resobj, resref) WmlResourceDefPtr resobj; WmlClassResDefPtr resref; { while ( resref != NULL ) { if ( resref->act_resource == resobj ) return resref; resref = resref->next; } return NULL; } /* * Indicate if a child is in a child reference list by returning its * reference pointer. */ WmlClassChildDefPtr wmlResolveChildIsMember (childobj, childref) WmlChildDefPtr childobj; WmlClassChildDefPtr childref; { while ( childref != NULL ) { if ( childref->act_child == childobj ) return childref; childref = childref->next; } return NULL; } motif-2.3.8/tools/wml/wml.c0000644000175000017500000001506113145162623012473 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: wml.c /main/8 1999/04/16 09:41:47 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This is the main program for WML. It declares all global data structures * used during a compilation, and during output. */ /* * WML is a semi-standard Unix application. It reads its input from * stdin, which is expected to be a stream containing a WML description * of a UIL language. If this stream is successfully parsed and semantically * validated, then WML writes a series of standard .h and .dat files into * the user directory. The .h files will be used directly to construct * the UIL compiler. The .dat files are used by other phases of UIL * table generation. * * The files created by WML are: * * .h files: * UilSymGen.h * UilSymArTy.h * UilSymRArg.h * UilDrmClas.h * UilConst.h * UilSymReas.h * UilSymArTa.h * UilSymCtl.h * UilSymNam.h * .dat files * argument.dat * reason.dat * grammar.dat * .mm files * wml-uil.mm */ #include "wml.h" #ifdef HAVE_FCNTL_H #include #else #include #endif #include #include #include /* * Globals used during WML parsing. * * WML uses globals exclusively to communicate data during parsing. The * current object being constructed is held by these globals, and all * routines called from the parse assume correct setting of these globals. * This simplisitic approach is possible since the WML description language * has no recursive constructs requiring a frame stack. */ /* * Error and other counts */ int wml_err_count = 0; /* total errors */ int wml_line_count = 0; /* lines read from input */ /* * Dynamic ordered vector of all objects encountered during parse. This * is used to detect name collisions, and is the primary order vector * used for all other vectors constructed curing the semantic resolution * phase of processing. */ DynamicHandleListDef wml_synobj; DynamicHandleListDefPtr wml_synobj_ptr = &wml_synobj; /* * Dynamic vectors of vectors partitioned and ordered * as required by the semantic processing and output routines. All * point to resolved objects rather than syntactic objects. */ DynamicHandleListDef wml_obj_datatype; /* datatype objects */ DynamicHandleListDefPtr wml_obj_datatype_ptr = &wml_obj_datatype; DynamicHandleListDef wml_obj_enumval; /* enumeration value objects */ DynamicHandleListDefPtr wml_obj_enumval_ptr = &wml_obj_enumval; DynamicHandleListDef wml_obj_enumset; /* enumeration set objects */ DynamicHandleListDefPtr wml_obj_enumset_ptr = &wml_obj_enumset; DynamicHandleListDef wml_obj_reason; /* reason resource objects */ DynamicHandleListDefPtr wml_obj_reason_ptr = &wml_obj_reason; DynamicHandleListDef wml_obj_arg; /* argument resource objects */ DynamicHandleListDefPtr wml_obj_arg_ptr = &wml_obj_arg; DynamicHandleListDef wml_obj_child; /* argument resource objects */ DynamicHandleListDefPtr wml_obj_child_ptr = &wml_obj_child; DynamicHandleListDef wml_obj_allclass; /* metaclass, widget, gadget */ DynamicHandleListDefPtr wml_obj_allclass_ptr = &wml_obj_allclass; DynamicHandleListDef wml_obj_class; /* widget & gadget objects */ DynamicHandleListDefPtr wml_obj_class_ptr = &wml_obj_class; DynamicHandleListDef wml_obj_ctrlist; /* controls list objects */ DynamicHandleListDefPtr wml_obj_ctrlist_ptr = &wml_obj_ctrlist; DynamicHandleListDef wml_obj_charset; /* charset objects */ DynamicHandleListDefPtr wml_obj_charset_ptr = &wml_obj_charset; DynamicHandleListDef wml_tok_sens; /* case-sensitive tokens */ DynamicHandleListDefPtr wml_tok_sens_ptr = &wml_tok_sens; DynamicHandleListDef wml_tok_insens; /* case-insensitive tokens */ DynamicHandleListDefPtr wml_tok_insens_ptr = &wml_tok_insens; /* * Routines only accessible in this module */ void wmlInit (); /* * External variables */ extern int yyleng; extern int yyparse(); /* * The WML main routine: * * 1. Initialize global storage * 2. Open the input file if there is one * 3. Parse the WML description in stdin. Exit on errors * 4. Perform semantic validation and resolution. Exit on errors. * 5. Output files */ int main (argc, argv) int argc; char **argv; { int done; int fd; /* input file descriptor */ /* * Initialize storage */ wmlInit (); /* * Assume that anything in argv must be an input file. Open it, and * dup it to stdin */ if ( argc > 1 ) { if ( (fd=open(argv[1],O_RDONLY)) == -1 ) printf ("\nCouldn't open file %s", argv[1]); else dup2 (fd, 0); } /* * Process the input */ done = 0; while (!done) { /* * Parse the input stream */ yyleng = 0; /* initialization safety */ yyparse (); if ( wml_err_count > 0 ) break; printf ("\nParse of WML input complete"); /* * Perform semantic validation, and construct resolved data structures */ wmlResolveDescriptors (); if ( wml_err_count > 0 ) break; printf ("\nSemantic validation and resolution complete"); /* * Output */ wmlOutput (); if ( wml_err_count > 0 ) break; printf ("\nWML Uil*.h and wml-uil.mm file creation complete\n"); done = 1; } /* * Report inaction on errors */ if ( wml_err_count > 0 ) { printf ("\nWML found %d errors, no or incomplete output produced\n", wml_err_count); /* Begin fixing the bug CR 4748 */ exit(1); /* End fixing the bug CR 4748 */ } return (0); } /* * Routine to initialize WML. * * The main job is to dynamically allocate any dynamic lists to a reasonable * initial state. */ void wmlInit () { /* * Initialize the list of all syntactic objects */ wmlInitHList (wml_synobj_ptr, 1000, TRUE); } int yywrap() { return(1); } motif-2.3.8/tools/wml/UilLexPars.c0000644000175000017500000046312013211513006013714 00000000000000/* original parser id follows */ /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 #define YYPATCH 20140715 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) #define yyerrok (yyerrflag = 0) #define YYRECOVERING() (yyerrflag != 0) #define YYENOMEM (-2) #define YYEOF 0 #define YYPREFIX "yy" #define YYPURE 0 #line 37 "Uil.y" /* Begin user declarations section */ #ifdef HAVE_CONFIG_H #include #endif #include "UilDefI.h" #include "UilCompGl.h" #define YYSTYPE yystype #define YYDEBUG 1 /* Declare and initialize stack entry for epsilon productions. */ YYSTYPE gz_yynullval = {NULL,0,0,0,0}; /* Declare token to aid in saving source context */ YYSTYPE prev_yylval; /* End user declarations section */ #line 45 "Uil.c" #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) /* Default: YYSTYPE is the semantic value type. */ typedef int YYSTYPE; # define YYSTYPE_IS_DECLARED 1 #endif /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #define UILEOF 0 #define NAME 1 #define FONT_NAME 2 #define COLOR_NAME 3 #define ARGUMENT_NAME 4 #define REASON_NAME 5 #define CHARSET_NAME 6 #define ENUMVAL_NAME 7 #define CLASS_NAME 8 #define CHILD_NAME 96 #define UNS_FLOAT_LITERAL 9 #define COMP_STRING 10 #define CHAR_8_LITERAL 11 #define UNS_INT_LITERAL 12 #define LEFT_PAREN 13 #define RIGHT_PAREN 14 #define COLON 15 #define SEMICOLON 16 #define LEFT_BRACE 17 #define RIGHT_BRACE 18 #define COMMA 19 #define EQUAL_SIGN 20 #define NOT 21 #define PLUS 22 #define MINUS 23 #define AND 24 #define OR 25 #define XOR 26 #define MULTIPLY 27 #define DIVIDE 28 #define LEFT_SHIFT 29 #define RIGHT_SHIFT 30 #define LIST 31 #define IDENTIFIER 32 #define END 33 #define MODULE 34 #define UILTRUE 35 #define UILFALSE 36 #define INCLUDE 37 #define MACRO 38 #define ON 39 #define OFF 40 #define VALUE 41 #define ARGUMENTS 42 #define CALLBACKS 43 #define PROCEDURES 44 #define CONTROLS 45 #define PROCEDURE 46 #define OBJECT 47 #define OBJECTS 48 #define WIDGET 49 #define GADGET 50 #define FONT 51 #define ARGUMENT 52 #define REASON 53 #define PIXMAP 54 #define COLOR 55 #define NAMES 56 #define CHARACTER_SET 57 #define CASE_SENSITIVE 58 #define CASE_INSENSITIVE 59 #define VERSION 60 #define MANAGED 61 #define UNMANAGED 62 #define PRIVATE 63 #define IMPORTED 64 #define EXPORTED 65 #define UILFILE 66 #define STRING_TABLE 67 #define TRANSLATION_TABLE 68 #define COMPOUND_STRING 69 #define FONT_TABLE 70 #define ANY 71 #define STRING 72 #define BOOLEAN 73 #define ICON 74 #define RIGHT_TO_LEFT 75 #define BACKGROUND 76 #define FOREGROUND 77 #define COLOR_TABLE 78 #define FLOAT 79 #define INTEGER 80 #define CLASS_REC_NAME 81 #define ASCIZ_TABLE 82 #define INTEGER_TABLE 83 #define ASCIZ_STRING_TABLE 84 #define COMPOUND_STRING_TABLE 85 #define XBITMAPFILE 86 #define SEPARATE 87 #define SIXTEEN_BIT 88 #define POUND 89 #define KEYSYM 90 #define SINGLE_FLOAT 91 #define RGB 92 #define WIDE_CHARACTER 93 #define LOC_STRING 94 #define FONTSET 95 #define COMPOUND_STRING_COMPONENT 97 #define PIX 115 #define PIXEL 103 #define PIXELS 104 #define IN 98 #define INCH 105 #define INCHES 106 #define CM 99 #define CENTIMETER 107 #define CENTIMETERS 108 #define MM 100 #define MILLIMETER 109 #define MILLIMETERS 110 #define PT 101 #define POINT 111 #define POINTS 112 #define FU 102 #define FONT_UNIT 113 #define FONT_UNITS 114 #define YYERRCODE 256 typedef short YYINT; static const YYINT yylhs[] = { -1, 3, 0, 4, 7, 1, 6, 6, 8, 8, 9, 9, 9, 13, 9, 11, 11, 14, 14, 16, 14, 15, 15, 18, 15, 19, 17, 20, 20, 2, 2, 21, 21, 21, 21, 21, 21, 29, 22, 28, 28, 31, 28, 30, 32, 32, 32, 32, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 36, 36, 37, 37, 40, 24, 39, 39, 42, 39, 41, 43, 43, 45, 45, 45, 45, 44, 47, 23, 46, 46, 49, 46, 48, 27, 50, 27, 52, 25, 51, 51, 54, 51, 55, 53, 58, 56, 59, 56, 61, 56, 62, 64, 56, 66, 65, 67, 65, 68, 65, 69, 65, 70, 65, 71, 72, 65, 73, 57, 74, 74, 77, 76, 63, 63, 80, 80, 75, 75, 75, 82, 75, 78, 78, 78, 83, 78, 84, 84, 85, 84, 81, 81, 86, 86, 86, 90, 86, 60, 92, 26, 91, 91, 94, 91, 95, 93, 96, 96, 96, 96, 103, 97, 106, 98, 109, 99, 112, 100, 104, 107, 110, 101, 105, 105, 105, 114, 105, 108, 108, 108, 116, 108, 111, 111, 111, 118, 111, 102, 102, 102, 120, 102, 113, 113, 115, 115, 117, 117, 119, 119, 121, 121, 126, 121, 122, 122, 128, 122, 123, 123, 131, 123, 124, 124, 133, 124, 134, 89, 135, 87, 136, 88, 137, 129, 132, 140, 132, 142, 132, 143, 132, 141, 141, 125, 125, 127, 127, 146, 139, 138, 138, 138, 145, 130, 147, 147, 147, 147, 5, 5, 5, 5, 5, 5, 5, 5, 79, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 10, 33, 34, 34, 149, 144, 144, 144, 151, 151, 152, 152, 152, 153, 153, 153, 154, 154, 154, 155, 155, 155, 155, 156, 156, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 167, 167, 174, 174, 165, 165, 175, 175, 166, 166, 176, 176, 172, 164, 164, 177, 177, 163, 163, 163, 168, 168, 169, 169, 169, 169, 169, 178, 178, 179, 179, 179, 173, 160, 160, 161, 161, 170, 170, 180, 180, 159, 159, 12, 12, 12, 181, 181, 182, 182, 183, 183, 150, 150, 184, 184, 184, 162, 162, 185, 185, 171, 171, 186, 186, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, }; static const YYINT yylen[] = { 2, 0, 6, 0, 0, 5, 0, 1, 1, 2, 3, 3, 3, 0, 4, 1, 1, 2, 3, 0, 3, 2, 3, 0, 3, 0, 4, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 3, 1, 2, 0, 3, 4, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 2, 0, 3, 4, 0, 3, 0, 1, 1, 1, 0, 0, 3, 1, 2, 0, 3, 2, 4, 0, 3, 0, 3, 2, 3, 0, 3, 0, 4, 0, 3, 0, 3, 0, 3, 0, 0, 6, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 0, 5, 0, 5, 1, 1, 0, 5, 1, 3, 1, 2, 1, 2, 3, 0, 3, 1, 3, 4, 0, 3, 3, 4, 0, 3, 1, 2, 2, 2, 2, 0, 3, 0, 0, 3, 2, 3, 0, 3, 0, 4, 1, 1, 1, 1, 0, 3, 0, 3, 0, 3, 0, 3, 1, 1, 1, 1, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 0, 3, 2, 2, 0, 3, 2, 2, 0, 3, 2, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 2, 0, 4, 0, 4, 0, 4, 1, 1, 3, 4, 3, 3, 0, 3, 1, 1, 1, 3, 2, 1, 3, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 1, 1, 2, 4, 4, 4, 4, 4, 4, 5, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 3, 5, 0, 1, 1, 3, 0, 2, 2, 1, 2, 1, 3, 3, 3, 3, 2, 3, 3, 3, 3, 1, 5, 1, 5, 1, 1, 3, 3, 1, 2, 1, 1, 4, 1, 1, 2, 2, 3, 3, 3, 1, 3, 4, 4, 3, 1, 3, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const YYINT yydefred[] = { 3, 0, 1, 0, 29, 0, 0, 283, 284, 285, 286, 287, 288, 289, 326, 296, 297, 298, 299, 300, 301, 317, 302, 303, 304, 305, 306, 325, 307, 93, 311, 312, 315, 324, 292, 293, 319, 316, 320, 321, 318, 294, 295, 314, 95, 310, 96, 94, 322, 323, 327, 328, 329, 330, 331, 313, 4, 308, 309, 290, 119, 183, 111, 0, 0, 37, 97, 121, 30, 31, 32, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 5, 0, 8, 120, 187, 189, 0, 0, 115, 0, 0, 113, 2, 0, 0, 0, 0, 0, 0, 370, 371, 372, 373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 0, 0, 360, 0, 0, 0, 433, 0, 0, 0, 0, 0, 348, 351, 355, 0, 41, 0, 0, 39, 101, 0, 0, 99, 125, 127, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 185, 0, 117, 114, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 362, 358, 0, 353, 354, 352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, 434, 0, 432, 0, 0, 0, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 374, 359, 0, 0, 40, 0, 0, 110, 100, 0, 0, 0, 123, 0, 15, 16, 11, 12, 10, 188, 0, 186, 116, 356, 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 431, 0, 428, 0, 454, 0, 0, 0, 0, 0, 401, 0, 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, 406, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 350, 42, 0, 0, 0, 0, 0, 46, 0, 334, 102, 109, 72, 53, 55, 54, 50, 56, 60, 63, 61, 108, 49, 52, 62, 51, 48, 65, 59, 66, 67, 68, 69, 70, 71, 64, 107, 57, 58, 0, 0, 126, 0, 124, 19, 0, 14, 203, 204, 205, 206, 190, 191, 192, 193, 194, 195, 197, 199, 201, 0, 364, 0, 0, 367, 363, 0, 366, 378, 0, 0, 0, 379, 0, 381, 0, 0, 382, 0, 383, 384, 368, 377, 0, 385, 0, 0, 386, 387, 0, 388, 389, 0, 365, 0, 380, 375, 0, 376, 0, 45, 47, 44, 0, 43, 105, 103, 131, 135, 129, 128, 133, 0, 23, 25, 17, 0, 0, 0, 0, 0, 0, 0, 92, 78, 79, 75, 80, 84, 87, 85, 410, 74, 77, 86, 76, 73, 83, 88, 89, 90, 91, 81, 82, 409, 369, 450, 451, 449, 394, 0, 0, 0, 418, 0, 430, 429, 0, 455, 402, 0, 0, 435, 0, 0, 417, 414, 415, 416, 407, 398, 0, 0, 0, 0, 443, 0, 0, 0, 0, 20, 0, 0, 18, 0, 21, 225, 0, 291, 222, 196, 210, 0, 207, 198, 215, 0, 212, 200, 220, 0, 217, 202, 0, 0, 0, 0, 419, 0, 0, 0, 439, 0, 0, 0, 0, 0, 0, 336, 0, 151, 132, 136, 130, 134, 24, 0, 22, 0, 249, 0, 223, 0, 0, 260, 0, 0, 0, 233, 0, 182, 0, 237, 208, 0, 0, 0, 227, 0, 0, 0, 241, 213, 0, 0, 0, 229, 0, 0, 0, 245, 218, 257, 0, 0, 231, 0, 0, 424, 420, 421, 422, 0, 0, 0, 440, 403, 426, 0, 0, 447, 444, 0, 0, 27, 28, 26, 226, 0, 267, 264, 266, 262, 0, 0, 247, 224, 234, 248, 272, 259, 211, 0, 0, 235, 209, 228, 236, 0, 216, 0, 0, 239, 214, 230, 240, 0, 221, 0, 0, 0, 279, 278, 219, 232, 243, 244, 441, 442, 445, 446, 0, 157, 0, 182, 250, 0, 0, 0, 252, 0, 238, 254, 0, 0, 242, 256, 0, 271, 270, 246, 258, 0, 282, 0, 0, 154, 153, 0, 137, 173, 0, 265, 263, 142, 144, 140, 148, 138, 146, 261, 155, 273, 269, 0, 0, 280, 0, 159, 158, 164, 0, 152, 161, 0, 180, 182, 0, 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 281, 160, 0, 162, 0, 174, 0, 171, 182, 176, 177, 178, 179, 143, 145, 141, 149, 139, 147, 0, 165, 163, 181, 172, 182, 0, 150, 169, 0, 156, 166, 0, 182, 0, 170, 167, 182, 168, }; static const YYINT yydgoto[] = { 1, 2, 6, 4, 3, 133, 88, 75, 89, 90, 134, 247, 270, 159, 356, 426, 422, 427, 491, 492, 666, 68, 69, 70, 71, 72, 73, 74, 149, 81, 150, 233, 316, 271, 317, 346, 135, 136, 454, 153, 82, 154, 236, 238, 350, 349, 98, 78, 99, 168, 76, 157, 83, 158, 240, 241, 420, 531, 488, 486, 137, 489, 487, 643, 593, 680, 707, 705, 703, 704, 708, 706, 735, 592, 668, 692, 682, 709, 740, 573, 689, 698, 713, 742, 672, 694, 699, 700, 701, 702, 717, 94, 77, 95, 164, 165, 361, 362, 363, 364, 365, 366, 500, 428, 367, 504, 429, 368, 508, 430, 369, 512, 431, 556, 551, 565, 560, 574, 569, 547, 538, 557, 566, 575, 548, 558, 612, 567, 620, 576, 577, 628, 549, 598, 604, 613, 621, 629, 550, 610, 603, 602, 647, 646, 263, 659, 650, 632, 59, 319, 484, 139, 140, 141, 142, 143, 144, 145, 189, 146, 256, 293, 261, 373, 297, 300, 282, 264, 267, 295, 272, 276, 289, 291, 265, 301, 283, 298, 381, 463, 273, 396, 471, 521, 485, 458, 277, }; static const YYINT yysindex[] = { 0, 0, 0, 19, 0, 5159, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 50, 2508, 2617, 72, 4771, 2714, 2823, 2920, 0, 88, 140, 144, 0, 120, 0, 0, 0, 0, 5159, 151, 0, 170, 5159, 0, 0, 1192, 1192, 4771, 4771, 4771, 4771, 0, 0, 0, 0, 200, 210, 214, 227, 230, 238, 270, 276, 289, 291, 294, 306, 319, 344, 61, 352, 362, 365, 377, 0, 392, 395, 0, 173, 398, 400, 0, 315, 206, 14, 320, 325, 0, 0, 0, 349, 0, 219, 5159, 0, 0, 402, 5159, 0, 0, 0, 5159, 233, 218, 303, 61, 4771, 0, 281, 401, 283, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4577, 4868, 4771, 4771, 4771, 4771, 4771, 0, 0, 405, 0, 4771, 4771, 4771, 4771, 4771, 412, 0, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 0, 0, 404, 4480, 0, 406, 5214, 0, 0, 413, 419, 420, 0, -12, 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, 423, 407, 425, 431, 434, 442, 448, 0, 315, 449, 446, 447, 453, 0, 405, 450, 0, 205, 0, 451, 0, 455, 457, 131, 167, 458, 0, 465, 461, 468, 4771, 471, 169, 467, 474, 0, 475, 476, 480, 478, 484, 0, 486, 482, 0, 488, 485, 206, 206, 14, 320, 320, 325, 325, 0, 0, 0, 4965, 1116, 4771, 498, 497, 0, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 501, 0, 246, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 433, 0, 625, 506, 0, 0, 287, 0, 0, 4771, -27, 503, 0, 4771, 0, 4577, 4771, 0, 4771, 0, 0, 0, 0, 4771, 0, 507, 513, 0, 0, 4771, 0, 0, 464, 0, 22, 0, 0, 4771, 0, 4771, 0, 0, 0, 5062, 0, 0, 0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 24, 515, 1381, 1478, 1587, 1684, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 516, 519, 520, 0, -27, 0, 0, 522, 0, 0, -34, 525, 0, 526, 528, 0, 0, 0, 0, 0, 0, 491, 495, 221, 217, 0, 527, 544, 527, 527, 0, 537, 535, 0, 542, 0, 0, 1793, 0, 0, 0, 0, 760, 0, 0, 0, 857, 0, 0, 0, 1890, 0, 0, 61, 61, 4771, 4771, 0, 4771, 539, 540, 0, -34, 4771, 61, 541, 543, 4771, 0, 5062, 0, 0, 0, 0, 0, 0, 339, 0, 546, 0, 334, 0, 0, 0, 0, 0, 549, 1999, 0, 551, 0, 550, 0, 0, 0, 554, 966, 0, 555, 243, 556, 0, 0, 0, 557, 1063, 0, 559, 250, 560, 0, 0, 0, 564, 2096, 0, 563, 566, 0, 0, 0, 0, 457, 4771, 4771, 0, 0, 0, 4771, 4771, 0, 0, 534, 534, 0, 0, 0, 0, 568, 0, 0, 0, 0, 547, 548, 0, 0, 0, 0, 0, 0, 0, 569, 530, 0, 0, 0, 0, 4674, 0, 570, 552, 0, 0, 0, 0, 553, 0, 571, 558, 4380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5159, 0, 339, 0, 0, -4, -4, 286, 0, 584, 0, 0, 5159, 315, 0, 0, 5159, 0, 0, 0, 0, 5159, 0, 203, 581, 0, 0, 2205, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 564, 582, 0, 586, 0, 0, 0, -2, 0, 0, 580, 0, 0, 0, -1, 0, 585, 587, 588, 527, 527, 527, 597, 527, 527, 534, 0, 0, 0, 589, 0, 3, 0, 592, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, 2302, 0, 0, 4, 0, 0, 591, 0, 5, 0, 0, 0, 0, }; static const YYINT yyrindex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 138, 0, 0, 0, 141, 0, 0, 298, 427, 388, 388, 388, 388, 0, 0, 0, 0, 3004, 3043, 3082, 3121, 3166, 3205, 3250, 3289, 3328, 3367, 3412, 3451, 3496, 3535, 0, 3574, 3613, 3658, 3697, 0, 3742, 3781, 0, 0, 3820, 3859, 0, 477, 4234, 4150, 4027, 3904, 0, 0, 0, 0, 0, 0, 179, 0, 0, 594, 225, 0, 0, 0, 259, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 388, 388, 388, 388, 129, 388, 388, 388, 388, 388, 388, 274, 388, 0, 0, 0, 0, 388, 388, 388, 388, 388, 0, 0, 284, 323, 388, 388, 388, 388, 388, 388, 388, 388, 388, 0, 0, 0, 388, 0, 0, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 602, 0, 488, 0, 0, 604, 0, 0, 106, 0, 465, 615, 0, 357, 598, 0, 0, 0, 0, 1377, 0, 0, 616, 0, 0, 0, 0, 0, 474, 0, 388, 0, 0, 0, 0, 0, 0, 618, 0, 621, 0, 0, 0, 484, 0, 0, 623, 4273, 4312, 4189, 4066, 4105, 3943, 3988, 0, 0, 0, 388, 860, 388, 969, 0, 0, 595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 626, 0, 388, 0, 388, 388, 0, 388, 0, 0, 0, 0, 388, 0, 627, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 388, 0, 388, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 935, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 60, 0, 0, 0, 95, 0, 0, 0, 600, 0, 0, 0, 0, 388, 388, 0, 388, 0, 0, 0, 0, 388, 0, 0, 0, 388, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 115, 127, 0, 53, 0, 23, 0, 0, 0, 0, 0, 0, 180, 0, 60, 0, 0, 0, 0, 0, 0, 118, 0, 95, 0, 0, 0, 0, 0, 0, 0, 629, 600, 0, 0, 0, 0, 0, 0, 0, 632, 388, 388, 0, 0, 0, 388, 388, 0, 0, 1272, 629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2411, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1175, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 629, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 236, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2411, 0, 0, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 222, 0, 0, 0, 0, }; static const YYINT yygindex[] = { 0, 0, 0, 0, 0, 9, 0, 0, 0, 562, -161, 0, -122, 0, 0, 0, 0, 213, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 504, 0, 0, -106, 342, 343, -5, 2, 0, 0, 0, 505, 0, 0, 0, 0, 0, 0, 567, 0, 0, 0, 0, 518, 0, 0, 0, -335, 0, 0, 41, 0, 0, -575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -70, 0, 0, 0, 0, -420, 0, -664, 0, 0, 21, 0, -579, -482, -466, -478, 0, 0, 0, 575, 0, 0, 0, 57, 59, 52, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 117, 112, 143, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 7, 0, 0, 0, 178, 479, 181, 176, -80, 0, 0, 609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 317, 0, 0, 191, 171, 0, 196, }; #define YYTABLESIZE 5311 static const YYINT yytable[] = { 57, 249, 424, 212, 289, 355, 182, 58, 499, 503, 507, 511, 425, 671, 56, 696, 714, 719, 644, 546, 555, 732, 743, 747, 192, 193, 194, 715, 475, 476, 460, 182, 424, 477, 255, 257, 258, 259, 260, 248, 564, 519, 493, 225, 226, 280, 254, 284, 461, 61, 62, 63, 286, 5, 520, 64, 292, 222, 223, 65, 462, 274, 209, 79, 66, 67, 91, 210, 182, 546, 182, 182, 57, 57, 555, 744, 57, 57, 57, 58, 58, 138, 80, 58, 58, 58, 93, 97, 100, 57, 148, 152, 156, 57, 262, 266, 58, 275, 251, 564, 58, 281, 182, 93, 191, 182, 182, 97, 160, 288, 290, 6, 6, 6, 296, 299, 478, 6, 211, 720, 333, 6, 333, 275, 395, 333, 6, 6, 433, 433, 305, 7, 7, 7, 730, 276, 720, 7, 182, 182, 182, 7, 306, 391, 57, 389, 7, 7, 57, 309, 310, 58, 57, 533, 534, 58, 222, 223, 148, 58, 161, 255, 152, 138, 162, 720, 156, 167, 84, 184, 184, 184, 112, 112, 112, 184, 85, 86, 112, 184, 87, 390, 112, 398, 184, 184, 169, 112, 112, 219, 433, 433, 222, 223, 222, 223, 138, 138, 138, 138, 138, 357, 358, 359, 360, 278, 279, 138, 412, 138, 38, 38, 38, 195, 138, 287, 38, 686, 138, 384, 38, 665, 253, 196, 385, 38, 38, 197, 222, 223, 224, 528, 347, 683, 234, 318, 529, 684, 244, 348, 198, 527, 685, 199, 354, 182, 222, 223, 693, 243, 423, 200, 670, 695, 695, 695, 98, 98, 98, 695, 695, 695, 98, 618, 182, 182, 98, 182, 222, 223, 626, 98, 98, 459, 60, 222, 223, 465, 253, 255, 467, 251, 468, 201, 182, 182, 138, 469, 399, 202, 122, 122, 122, 473, 182, 182, 122, 250, 404, 252, 122, 479, 203, 480, 204, 122, 122, 205, 347, 417, 418, 419, 361, 318, 361, 348, 741, 361, 361, 206, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 207, 182, 182, 361, 6, 395, 253, 361, 222, 223, 227, 228, 361, 361, 361, 674, 675, 676, 677, 678, 229, 230, 361, 361, 7, 208, 361, 231, 232, 245, 246, 456, 457, 213, 590, 452, 724, 725, 726, 283, 728, 729, 453, 214, 283, 436, 215, 283, 283, 283, 283, 283, 283, 283, 283, 283, 594, 595, 216, 578, 579, 421, 184, 599, 600, 112, 182, 182, 302, 303, 587, 307, 308, 217, 305, 306, 218, 580, 581, 220, 275, 221, 483, 237, 251, 586, 285, 294, 311, 371, 320, 57, 57, 57, 57, 639, 640, 351, 58, 58, 58, 58, 352, 38, 353, 498, 498, 498, 498, 357, 370, 357, 372, 374, 357, 357, 375, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 376, 377, 378, 357, 379, 380, 382, 357, 387, 383, 386, 391, 357, 357, 357, 388, 637, 638, 392, 393, 98, 394, 357, 357, 397, 399, 357, 400, 401, 432, 332, 57, 332, 403, 402, 332, 404, 405, 58, 406, 407, 408, 559, 409, 57, 544, 568, 332, 332, 332, 413, 58, 414, 332, 122, 415, 416, 332, 498, 455, 474, 464, 332, 332, 332, 470, 472, 138, 490, 483, 495, 513, 332, 332, 530, 514, 332, 545, 515, 516, 518, 57, 554, 522, 523, 525, 563, 524, 58, 526, 572, 532, 535, 361, 536, 544, 559, 537, 583, 584, 588, 648, 589, 597, 605, 568, 608, 611, 57, 614, 617, 357, 622, 619, 625, 58, 630, 627, 635, 641, 601, 636, 498, 645, 651, 655, 660, 545, 138, 138, 609, 681, 360, 687, 358, 711, 554, 716, 657, 712, 721, 359, 722, 723, 727, 563, 731, 733, 745, 104, 335, 317, 106, 631, 572, 425, 317, 448, 654, 317, 317, 317, 317, 317, 317, 317, 317, 317, 411, 452, 664, 427, 642, 642, 413, 57, 396, 182, 494, 412, 437, 438, 58, 182, 182, 453, 268, 57, 596, 498, 163, 57, 235, 410, 58, 411, 57, 239, 58, 736, 649, 498, 57, 58, 170, 498, 572, 673, 166, 58, 498, 652, 656, 433, 242, 434, 498, 435, 436, 437, 616, 624, 357, 667, 669, 634, 661, 658, 679, 607, 710, 29, 438, 439, 440, 441, 442, 443, 444, 591, 517, 466, 304, 445, 446, 688, 44, 447, 46, 47, 190, 697, 585, 582, 448, 449, 0, 450, 0, 451, 0, 0, 0, 0, 631, 0, 0, 0, 0, 0, 57, 697, 332, 0, 0, 0, 718, 58, 697, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 642, 0, 0, 0, 0, 0, 697, 0, 0, 0, 734, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 667, 102, 103, 0, 0, 737, 0, 553, 0, 697, 104, 105, 106, 746, 697, 0, 0, 748, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 562, 325, 0, 104, 105, 106, 0, 325, 325, 325, 325, 325, 325, 325, 325, 325, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 320, 0, 320, 320, 320, 320, 320, 320, 320, 320, 320, 0, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 615, 318, 0, 104, 105, 106, 0, 318, 318, 318, 318, 318, 318, 318, 318, 318, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 552, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 623, 0, 0, 104, 105, 106, 321, 0, 321, 321, 321, 321, 321, 321, 321, 321, 321, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 561, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 0, 0, 0, 0, 322, 0, 323, 324, 325, 326, 327, 0, 0, 0, 0, 182, 182, 182, 182, 182, 0, 182, 29, 328, 329, 330, 0, 332, 333, 334, 182, 182, 0, 0, 335, 336, 337, 44, 338, 46, 47, 339, 0, 0, 0, 340, 341, 342, 343, 0, 344, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 552, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 174, 177, 180, 183, 186, 172, 173, 175, 176, 178, 179, 181, 182, 184, 185, 187, 188, 171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 561, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 318, 0, 0, 0, 0, 318, 0, 497, 318, 318, 318, 318, 318, 318, 318, 318, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 496, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 501, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 505, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 542, 543, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 540, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 509, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 539, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 542, 543, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 540, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 570, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 539, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 570, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 182, 182, 182, 182, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 690, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 738, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 92, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 96, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 147, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 296, 0, 296, 0, 0, 296, 296, 0, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 0, 0, 0, 296, 0, 0, 0, 296, 0, 0, 0, 0, 296, 296, 296, 0, 0, 0, 0, 297, 0, 297, 296, 296, 297, 297, 296, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 0, 0, 151, 297, 0, 0, 0, 297, 0, 0, 0, 0, 297, 297, 297, 0, 0, 0, 0, 298, 0, 298, 297, 297, 298, 298, 297, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 0, 0, 0, 298, 0, 0, 0, 298, 0, 0, 0, 0, 298, 298, 298, 0, 0, 0, 0, 299, 0, 299, 298, 298, 299, 299, 298, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 0, 0, 0, 299, 0, 0, 0, 299, 0, 0, 0, 0, 299, 299, 299, 0, 0, 0, 0, 0, 0, 155, 299, 299, 0, 300, 299, 300, 0, 0, 300, 300, 0, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 0, 0, 0, 300, 0, 0, 0, 300, 0, 0, 0, 0, 300, 300, 300, 0, 0, 0, 0, 311, 0, 311, 300, 300, 311, 311, 300, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 0, 0, 0, 311, 0, 0, 0, 311, 0, 0, 0, 0, 311, 311, 311, 0, 0, 0, 0, 0, 0, 296, 311, 311, 0, 312, 311, 312, 0, 0, 312, 312, 0, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 0, 0, 0, 312, 0, 0, 0, 312, 0, 0, 0, 0, 312, 312, 312, 297, 0, 0, 0, 315, 0, 315, 312, 312, 315, 315, 312, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 0, 0, 0, 315, 0, 0, 0, 315, 0, 0, 0, 0, 315, 315, 315, 298, 0, 0, 0, 319, 0, 319, 315, 315, 319, 319, 315, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 0, 0, 0, 319, 0, 0, 0, 319, 0, 0, 0, 0, 319, 319, 319, 299, 0, 0, 0, 294, 0, 294, 319, 319, 294, 294, 319, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 0, 0, 0, 294, 0, 0, 0, 294, 0, 0, 0, 0, 294, 294, 294, 0, 0, 0, 0, 0, 0, 300, 294, 294, 0, 295, 294, 295, 0, 0, 295, 295, 0, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 0, 0, 0, 295, 0, 0, 0, 295, 0, 0, 0, 0, 295, 295, 295, 311, 0, 0, 0, 314, 0, 314, 295, 295, 314, 314, 295, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 0, 0, 0, 314, 0, 0, 0, 314, 0, 0, 0, 0, 314, 314, 314, 0, 0, 0, 0, 0, 0, 312, 314, 314, 0, 310, 314, 310, 0, 0, 310, 310, 0, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 0, 0, 0, 310, 0, 0, 0, 310, 0, 0, 0, 0, 310, 310, 310, 315, 0, 0, 0, 322, 0, 322, 310, 310, 322, 322, 310, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 0, 0, 0, 322, 0, 0, 0, 322, 0, 0, 0, 0, 322, 322, 322, 319, 0, 0, 0, 327, 0, 327, 322, 322, 327, 327, 322, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 0, 0, 0, 327, 0, 0, 0, 327, 0, 0, 0, 0, 327, 327, 327, 294, 0, 0, 0, 328, 0, 328, 327, 327, 328, 328, 327, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 0, 0, 0, 328, 0, 0, 0, 328, 0, 0, 0, 0, 328, 328, 328, 0, 0, 0, 0, 0, 0, 295, 328, 328, 0, 329, 328, 329, 0, 0, 329, 329, 0, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 0, 0, 0, 329, 0, 0, 0, 329, 0, 0, 0, 0, 329, 329, 329, 314, 0, 0, 0, 330, 0, 330, 329, 329, 330, 330, 329, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 0, 0, 0, 330, 0, 0, 0, 330, 0, 0, 0, 0, 330, 330, 330, 0, 0, 0, 0, 0, 0, 310, 330, 330, 0, 331, 330, 331, 0, 0, 331, 331, 0, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 0, 0, 0, 331, 0, 0, 0, 331, 0, 0, 0, 0, 331, 331, 331, 322, 0, 0, 0, 313, 0, 313, 331, 331, 313, 313, 331, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 0, 0, 0, 313, 0, 0, 0, 313, 0, 0, 0, 0, 313, 313, 313, 327, 0, 0, 0, 308, 0, 308, 313, 313, 308, 308, 313, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 0, 0, 0, 308, 0, 0, 0, 308, 0, 0, 0, 0, 308, 308, 308, 328, 0, 0, 0, 309, 0, 309, 308, 308, 309, 309, 308, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 0, 0, 0, 309, 0, 0, 0, 309, 0, 0, 0, 0, 309, 309, 309, 0, 0, 0, 0, 0, 0, 329, 309, 309, 0, 345, 309, 345, 0, 0, 345, 345, 0, 345, 345, 345, 345, 345, 0, 0, 345, 345, 345, 345, 345, 0, 0, 0, 345, 0, 0, 0, 345, 0, 0, 0, 0, 345, 345, 345, 330, 0, 0, 0, 346, 0, 346, 345, 345, 346, 346, 345, 346, 346, 346, 346, 346, 0, 0, 346, 346, 346, 346, 346, 0, 0, 0, 346, 0, 0, 0, 346, 0, 0, 0, 0, 346, 346, 346, 0, 0, 0, 0, 0, 0, 331, 346, 346, 0, 347, 346, 347, 0, 0, 347, 347, 0, 347, 347, 347, 347, 347, 0, 0, 347, 347, 347, 347, 347, 0, 0, 0, 347, 0, 0, 0, 347, 0, 0, 0, 0, 347, 347, 347, 313, 0, 0, 0, 342, 0, 342, 347, 347, 342, 342, 347, 0, 0, 342, 342, 342, 0, 0, 342, 342, 342, 342, 342, 0, 0, 0, 342, 0, 0, 0, 342, 0, 0, 0, 0, 342, 342, 342, 308, 0, 0, 0, 343, 0, 343, 342, 342, 343, 343, 342, 0, 0, 343, 343, 343, 0, 0, 343, 343, 343, 343, 343, 0, 0, 0, 343, 0, 0, 0, 343, 0, 0, 0, 0, 343, 343, 343, 309, 0, 0, 0, 344, 0, 344, 343, 343, 344, 344, 343, 0, 0, 344, 344, 344, 0, 0, 344, 344, 344, 344, 344, 0, 0, 0, 344, 0, 0, 0, 344, 0, 0, 0, 0, 344, 344, 344, 0, 0, 0, 0, 0, 0, 345, 344, 344, 0, 340, 344, 340, 0, 0, 340, 340, 0, 0, 0, 340, 340, 340, 0, 0, 0, 0, 340, 340, 340, 0, 0, 0, 340, 0, 0, 0, 340, 0, 0, 0, 0, 340, 340, 340, 346, 0, 0, 0, 341, 0, 341, 340, 340, 341, 341, 340, 0, 0, 341, 341, 341, 0, 0, 0, 0, 341, 341, 341, 0, 0, 0, 341, 0, 0, 0, 341, 0, 0, 0, 0, 341, 341, 341, 0, 0, 0, 0, 0, 0, 347, 341, 341, 0, 337, 341, 337, 0, 0, 337, 337, 0, 0, 0, 0, 337, 337, 0, 0, 0, 0, 337, 337, 337, 0, 0, 0, 337, 0, 0, 0, 337, 0, 0, 0, 0, 337, 337, 337, 342, 0, 0, 0, 338, 0, 338, 337, 337, 338, 338, 337, 0, 0, 0, 338, 338, 0, 0, 0, 0, 338, 338, 338, 0, 0, 0, 338, 0, 0, 0, 338, 0, 0, 0, 0, 338, 338, 338, 343, 0, 0, 0, 339, 0, 339, 338, 338, 339, 339, 338, 0, 0, 0, 339, 339, 0, 0, 0, 0, 339, 339, 339, 0, 0, 0, 339, 0, 0, 0, 339, 0, 0, 0, 0, 339, 339, 339, 344, 0, 0, 0, 0, 0, 0, 339, 339, 0, 0, 339, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 662, 101, 0, 0, 102, 103, 663, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 340, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 341, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 101, 337, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 338, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 312, 313, 314, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 315, 120, 121, 122, 44, 123, 46, 47, 124, 49, 339, 125, 126, 127, 128, 129, 130, 131, 13, 132, 268, 8, 9, 10, 11, 210, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 269, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 653, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 274, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 315, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 481, 482, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 321, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 322, 0, 323, 324, 325, 326, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 328, 329, 330, 331, 332, 333, 334, 0, 0, 0, 0, 335, 336, 337, 44, 338, 46, 47, 339, 0, 0, 0, 340, 341, 342, 343, 0, 344, 0, 345, }; static const YYINT yycheck[] = { 5, 162, 8, 125, 15, 17, 17, 5, 428, 429, 430, 431, 18, 17, 5, 18, 18, 18, 593, 497, 502, 18, 18, 18, 104, 105, 106, 691, 6, 7, 57, 8, 8, 11, 195, 196, 197, 198, 199, 161, 506, 75, 18, 29, 30, 206, 14, 208, 75, 31, 32, 33, 213, 34, 88, 37, 217, 25, 26, 41, 87, 8, 1, 34, 46, 47, 16, 6, 45, 547, 10, 11, 77, 78, 556, 739, 81, 82, 83, 77, 78, 80, 66, 81, 82, 83, 77, 78, 16, 94, 81, 82, 83, 98, 200, 201, 94, 203, 45, 565, 98, 207, 42, 94, 103, 10, 11, 98, 20, 215, 216, 31, 32, 33, 220, 221, 94, 37, 57, 698, 14, 41, 16, 8, 285, 19, 46, 47, 10, 11, 15, 31, 32, 33, 709, 8, 715, 37, 43, 10, 11, 41, 15, 14, 149, 14, 46, 47, 153, 229, 230, 149, 157, 488, 489, 153, 25, 26, 149, 157, 20, 43, 153, 162, 20, 744, 157, 16, 48, 31, 32, 33, 31, 32, 33, 37, 56, 57, 37, 41, 60, 14, 41, 14, 46, 47, 16, 46, 47, 16, 10, 11, 25, 26, 25, 26, 195, 196, 197, 198, 199, 42, 43, 44, 45, 204, 205, 206, 314, 208, 31, 32, 33, 13, 213, 214, 37, 14, 217, 14, 41, 641, 42, 13, 19, 46, 47, 13, 25, 26, 24, 14, 237, 653, 15, 234, 19, 657, 20, 237, 13, 20, 662, 13, 256, 256, 25, 26, 668, 16, 256, 13, 256, 256, 256, 256, 31, 32, 33, 256, 256, 256, 37, 20, 42, 43, 41, 45, 25, 26, 20, 46, 47, 379, 256, 25, 26, 383, 42, 43, 386, 45, 388, 13, 10, 11, 285, 393, 14, 13, 31, 32, 33, 399, 10, 11, 37, 16, 14, 16, 41, 407, 13, 409, 13, 46, 47, 13, 313, 63, 64, 65, 14, 312, 16, 313, 736, 19, 20, 13, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 13, 10, 11, 37, 256, 14, 16, 41, 25, 26, 22, 23, 46, 47, 48, 61, 62, 63, 64, 65, 27, 28, 56, 57, 256, 13, 60, 10, 11, 58, 59, 76, 77, 13, 527, 372, 703, 704, 705, 14, 707, 708, 372, 13, 19, 20, 13, 22, 23, 24, 25, 26, 27, 28, 29, 30, 49, 50, 13, 513, 514, 352, 256, 61, 62, 256, 10, 11, 222, 223, 524, 227, 228, 13, 225, 226, 13, 515, 516, 13, 518, 13, 413, 13, 15, 523, 13, 7, 16, 14, 16, 428, 429, 430, 431, 588, 589, 16, 428, 429, 430, 431, 15, 256, 16, 428, 429, 430, 431, 14, 19, 16, 19, 14, 19, 20, 14, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 19, 14, 14, 37, 19, 19, 14, 41, 14, 20, 20, 14, 46, 47, 48, 19, 583, 584, 14, 19, 256, 14, 56, 57, 14, 19, 60, 14, 14, 57, 14, 497, 16, 14, 19, 19, 19, 14, 497, 14, 19, 14, 502, 19, 510, 497, 506, 31, 32, 33, 13, 510, 16, 37, 256, 14, 16, 41, 510, 14, 57, 19, 46, 47, 48, 19, 14, 527, 18, 529, 16, 20, 56, 57, 8, 20, 60, 497, 20, 20, 19, 547, 502, 19, 19, 55, 506, 20, 547, 55, 510, 8, 16, 256, 20, 547, 556, 16, 20, 20, 20, 15, 20, 18, 16, 565, 16, 18, 574, 16, 16, 42, 16, 18, 16, 574, 13, 18, 16, 46, 540, 16, 574, 16, 16, 16, 16, 547, 588, 589, 550, 8, 45, 13, 43, 14, 556, 18, 46, 14, 16, 44, 16, 16, 8, 565, 18, 16, 18, 16, 16, 14, 14, 573, 574, 14, 19, 14, 618, 22, 23, 24, 25, 26, 27, 28, 29, 30, 14, 14, 630, 14, 592, 593, 14, 641, 14, 8, 426, 14, 14, 14, 641, 44, 16, 14, 16, 653, 536, 641, 89, 657, 149, 312, 653, 313, 662, 153, 657, 730, 604, 653, 668, 662, 98, 657, 626, 647, 94, 668, 662, 613, 621, 49, 157, 51, 668, 53, 54, 55, 556, 565, 256, 643, 644, 574, 629, 626, 648, 547, 684, 67, 68, 69, 70, 71, 72, 73, 74, 529, 464, 385, 224, 79, 80, 665, 82, 83, 84, 85, 102, 671, 522, 518, 90, 91, -1, 93, -1, 95, -1, -1, -1, -1, 684, -1, -1, -1, -1, -1, 736, 691, 256, -1, -1, -1, 696, 736, 698, -1, -1, -1, -1, -1, 736, -1, -1, -1, -1, 709, -1, -1, -1, -1, -1, 715, -1, -1, -1, 719, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, 730, 12, 13, -1, -1, 735, -1, 18, -1, 739, 21, 22, 23, 743, 744, -1, -1, 747, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, 16, -1, 21, 22, 23, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, 16, -1, 21, 22, 23, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, -1, -1, 21, 22, 23, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, -1, -1, -1, -1, 49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, 67, 68, 69, 70, -1, 72, 73, 74, 16, 17, -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, 91, 92, 93, -1, 95, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, 256, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, 14, -1, -1, -1, -1, 19, -1, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 14, -1, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, 256, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, -1, -1, 24, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, -1, -1, -1, 56, 57, -1, -1, 60, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, 8, 9, -1, -1, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, 256, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, 9, 256, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, 256, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 256, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, 6, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, 8, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 8, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, 49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, 91, 92, 93, -1, 95, -1, 97, }; #define YYFINAL 1 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 256 #define YYUNDFTOKEN 445 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) #if YYDEBUG static const char *const yyname[] = { "end-of-file","NAME","FONT_NAME","COLOR_NAME","ARGUMENT_NAME","REASON_NAME", "CHARSET_NAME","ENUMVAL_NAME","CLASS_NAME","UNS_FLOAT_LITERAL","COMP_STRING", "CHAR_8_LITERAL","UNS_INT_LITERAL","LEFT_PAREN","RIGHT_PAREN","COLON", "SEMICOLON","LEFT_BRACE","RIGHT_BRACE","COMMA","EQUAL_SIGN","NOT","PLUS", "MINUS","AND","OR","XOR","MULTIPLY","DIVIDE","LEFT_SHIFT","RIGHT_SHIFT","LIST", "IDENTIFIER","END","MODULE","UILTRUE","UILFALSE","INCLUDE","MACRO","ON","OFF", "VALUE","ARGUMENTS","CALLBACKS","PROCEDURES","CONTROLS","PROCEDURE","OBJECT", "OBJECTS","WIDGET","GADGET","FONT","ARGUMENT","REASON","PIXMAP","COLOR","NAMES", "CHARACTER_SET","CASE_SENSITIVE","CASE_INSENSITIVE","VERSION","MANAGED", "UNMANAGED","PRIVATE","IMPORTED","EXPORTED","UILFILE","STRING_TABLE", "TRANSLATION_TABLE","COMPOUND_STRING","FONT_TABLE","ANY","STRING","BOOLEAN", "ICON","RIGHT_TO_LEFT","BACKGROUND","FOREGROUND","COLOR_TABLE","FLOAT", "INTEGER","CLASS_REC_NAME","ASCIZ_TABLE","INTEGER_TABLE","ASCIZ_STRING_TABLE", "COMPOUND_STRING_TABLE","XBITMAPFILE","SEPARATE","SIXTEEN_BIT","POUND","KEYSYM", "SINGLE_FLOAT","RGB","WIDE_CHARACTER","LOC_STRING","FONTSET","CHILD_NAME", "COMPOUND_STRING_COMPONENT","IN","CM","MM","PT","FU","PIXEL","PIXELS","INCH", "INCHES","CENTIMETER","CENTIMETERS","MILLIMETER","MILLIMETERS","POINT","POINTS", "FONT_UNIT","FONT_UNITS","PIX",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol", }; static const char *const yyrule[] = { "$accept : module_block", "$$1 :", "module_block : module_header $$1 module_declaration_list END MODULE SEMICOLON", "$$2 :", "$$3 :", "module_header : $$2 MODULE id $$3 opt_module_clauses", "opt_module_clauses :", "opt_module_clauses : module_clauses", "module_clauses : module_clause", "module_clauses : module_clauses module_clause", "module_clause : VERSION EQUAL_SIGN character_8_value", "module_clause : NAMES EQUAL_SIGN sensitivity_value", "module_clause : CHARACTER_SET EQUAL_SIGN valid_charset", "$$4 :", "module_clause : OBJECTS $$4 EQUAL_SIGN variant_spec", "sensitivity_value : CASE_SENSITIVE", "sensitivity_value : CASE_INSENSITIVE", "variant_spec : LEFT_BRACE RIGHT_BRACE", "variant_spec : LEFT_BRACE variant_list RIGHT_BRACE", "$$5 :", "variant_spec : error $$5 RIGHT_BRACE", "variant_list : variant_clause SEMICOLON", "variant_list : variant_list variant_clause SEMICOLON", "$$6 :", "variant_list : error $$6 SEMICOLON", "$$7 :", "variant_clause : CLASS_NAME $$7 EQUAL_SIGN variant", "variant : WIDGET", "variant : GADGET", "module_declaration_list :", "module_declaration_list : module_declaration_list module_declaration", "module_declaration : value_declaration", "module_declaration : identifier_declaration", "module_declaration : procedure_declaration", "module_declaration : object_declaration", "module_declaration : list_declaration", "module_declaration : include_directive", "$$8 :", "value_declaration : VALUE $$8 value_declaration_list", "value_declaration_list : value_decl", "value_declaration_list : value_declaration_list value_decl", "$$9 :", "value_declaration_list : error $$9 SEMICOLON", "value_decl : id COLON value_definition SEMICOLON", "value_definition : EXPORTED private_value", "value_definition : PRIVATE private_value_plus", "value_definition : private_value_plus", "value_definition : IMPORTED value_type", "value_type : INTEGER", "value_type : STRING", "value_type : PIXMAP", "value_type : FLOAT", "value_type : BOOLEAN", "value_type : FONT", "value_type : REASON", "value_type : ARGUMENT", "value_type : COLOR", "value_type : string_table_type", "value_type : asciz_table_type", "value_type : INTEGER_TABLE", "value_type : TRANSLATION_TABLE", "value_type : FONT_TABLE", "value_type : ICON", "value_type : COMPOUND_STRING", "value_type : COMPOUND_STRING_COMPONENT", "value_type : CLASS_REC_NAME", "value_type : XBITMAPFILE", "value_type : KEYSYM", "value_type : SINGLE_FLOAT", "value_type : RGB", "value_type : WIDE_CHARACTER", "value_type : FONTSET", "value_type : WIDGET", "arg_value_type : INTEGER", "arg_value_type : STRING", "arg_value_type : PIXMAP", "arg_value_type : FLOAT", "arg_value_type : BOOLEAN", "arg_value_type : FONT", "arg_value_type : REASON", "arg_value_type : COLOR", "arg_value_type : string_table_type", "arg_value_type : asciz_table_type", "arg_value_type : INTEGER_TABLE", "arg_value_type : TRANSLATION_TABLE", "arg_value_type : FONT_TABLE", "arg_value_type : ICON", "arg_value_type : COMPOUND_STRING", "arg_value_type : KEYSYM", "arg_value_type : SINGLE_FLOAT", "arg_value_type : WIDE_CHARACTER", "arg_value_type : FONTSET", "arg_value_type : WIDGET", "string_table_type : STRING_TABLE", "string_table_type : COMPOUND_STRING_TABLE", "asciz_table_type : ASCIZ_TABLE", "asciz_table_type : ASCIZ_STRING_TABLE", "$$10 :", "procedure_declaration : PROCEDURE $$10 procedure_declaration_list", "procedure_declaration_list : procedure_decl", "procedure_declaration_list : procedure_declaration_list procedure_decl", "$$11 :", "procedure_declaration_list : error $$11 SEMICOLON", "procedure_decl : id opt_formal_parameters opt_class SEMICOLON", "opt_formal_parameters :", "opt_formal_parameters : LEFT_PAREN formal_parameter_type RIGHT_PAREN", "formal_parameter_type :", "formal_parameter_type : value_type", "formal_parameter_type : ANY", "formal_parameter_type : CLASS_NAME", "opt_class :", "$$12 :", "identifier_declaration : IDENTIFIER $$12 identifier_declaration_list", "identifier_declaration_list : identifier_decl", "identifier_declaration_list : identifier_declaration_list identifier_decl", "$$13 :", "identifier_declaration_list : error $$13 SEMICOLON", "identifier_decl : id SEMICOLON", "include_directive : INCLUDE UILFILE character_8_value SEMICOLON", "$$14 :", "include_directive : error $$14 SEMICOLON", "$$15 :", "object_declaration : OBJECT $$15 object_decl_list", "object_decl_list : object_decl SEMICOLON", "object_decl_list : object_decl_list object_decl SEMICOLON", "$$16 :", "object_decl_list : error $$16 SEMICOLON", "$$17 :", "object_decl : id $$17 COLON object_definition", "$$18 :", "object_definition : EXPORTED $$18 object_specification", "$$19 :", "object_definition : PRIVATE $$19 object_specification", "$$20 :", "object_definition : epsilon_production $$20 object_specification", "$$21 :", "$$22 :", "object_definition : IMPORTED $$21 CLASS_NAME $$22 opt_create_proc_ref epsilon_production", "$$23 :", "control_object_definition : EXPORTED $$23 object_specification", "$$24 :", "control_object_definition : PRIVATE $$24 object_specification", "$$25 :", "control_object_definition : MANAGED $$25 object_specification", "$$26 :", "control_object_definition : UNMANAGED $$26 object_specification", "$$27 :", "control_object_definition : epsilon_production $$27 object_specification", "$$28 :", "$$29 :", "control_object_definition : IMPORTED $$28 CLASS_NAME $$29 epsilon_production", "$$30 :", "object_specification : CLASS_NAME $$30 opt_create_proc_ref opt_variant object_spec", "opt_variant : epsilon_production", "opt_variant : variant", "$$31 :", "control_object_specification : CLASS_NAME $$31 opt_create_proc_ref opt_variant control_object_spec", "opt_create_proc_ref : epsilon_production", "opt_create_proc_ref : PROCEDURE id_ref opt_parens", "opt_parens : epsilon_production", "opt_parens : LEFT_PAREN RIGHT_PAREN", "object_spec : id_ref", "object_spec : LEFT_BRACE RIGHT_BRACE", "object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE", "$$32 :", "object_spec : error $$32 RIGHT_BRACE", "control_object_spec : id_ref", "control_object_spec : LEFT_BRACE RIGHT_BRACE epsilon_production", "control_object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production", "$$33 :", "control_object_spec : error $$33 RIGHT_BRACE", "child_object_spec : LEFT_BRACE RIGHT_BRACE epsilon_production", "child_object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production", "$$34 :", "child_object_spec : error $$34 RIGHT_BRACE", "object_feature_list : object_feature", "object_feature_list : object_feature_list object_feature", "object_feature : argument_list_def SEMICOLON", "object_feature : callback_list_def SEMICOLON", "object_feature : control_list_def SEMICOLON", "$$35 :", "object_feature : error $$35 SEMICOLON", "epsilon_production :", "$$36 :", "list_declaration : LIST $$36 list_decl_list", "list_decl_list : list_decl SEMICOLON", "list_decl_list : list_decl_list list_decl SEMICOLON", "$$37 :", "list_decl_list : error $$37 SEMICOLON", "$$38 :", "list_decl : id $$38 COLON list_specification", "list_specification : control_list_specification", "list_specification : argument_list_specification", "list_specification : callback_list_specification", "list_specification : procedure_list_specification", "$$39 :", "control_list_specification : control_list_type $$39 control_list_spec", "$$40 :", "argument_list_specification : argument_list_type $$40 argument_list_spec", "$$41 :", "callback_list_specification : callback_list_type $$41 callback_list_spec", "$$42 :", "procedure_list_specification : procedure_list_type $$42 procedure_list_spec", "argument_list_type : ARGUMENTS", "callback_list_type : CALLBACKS", "procedure_list_type : PROCEDURES", "control_list_type : CONTROLS", "argument_list_spec : id_ref", "argument_list_spec : LEFT_BRACE RIGHT_BRACE", "argument_list_spec : LEFT_BRACE argument_list_clause_list RIGHT_BRACE", "$$43 :", "argument_list_spec : error $$43 RIGHT_BRACE", "callback_list_spec : id_ref", "callback_list_spec : LEFT_BRACE RIGHT_BRACE", "callback_list_spec : LEFT_BRACE callback_list_clause_list RIGHT_BRACE", "$$44 :", "callback_list_spec : error $$44 RIGHT_BRACE", "procedure_list_spec : id_ref", "procedure_list_spec : LEFT_BRACE RIGHT_BRACE", "procedure_list_spec : LEFT_BRACE procedure_list_clause_list RIGHT_BRACE", "$$45 :", "procedure_list_spec : error $$45 RIGHT_BRACE", "control_list_spec : id_ref", "control_list_spec : LEFT_BRACE RIGHT_BRACE", "control_list_spec : LEFT_BRACE control_list_clause_list RIGHT_BRACE", "$$46 :", "control_list_spec : error $$46 RIGHT_BRACE", "argument_list_clause_list : argument_list_clause", "argument_list_clause_list : argument_list_clause_list argument_list_clause", "callback_list_clause_list : callback_list_clause", "callback_list_clause_list : callback_list_clause_list callback_list_clause", "procedure_list_clause_list : procedure_list_clause", "procedure_list_clause_list : procedure_list_clause_list procedure_list_clause", "control_list_clause_list : control_list_clause", "control_list_clause_list : control_list_clause_list control_list_clause", "argument_list_clause : argument_list_def SEMICOLON", "argument_list_clause : argument_list_item SEMICOLON", "$$47 :", "argument_list_clause : error $$47 SEMICOLON", "callback_list_clause : callback_list_def SEMICOLON", "callback_list_clause : callback_list_item SEMICOLON", "$$48 :", "callback_list_clause : error $$48 SEMICOLON", "procedure_list_clause : procedure_list_def SEMICOLON", "procedure_list_clause : procedure_list_def_ref SEMICOLON", "$$49 :", "procedure_list_clause : error $$49 SEMICOLON", "control_list_clause : control_list_def SEMICOLON", "control_list_clause : control_list_item SEMICOLON", "$$50 :", "control_list_clause : error $$50 SEMICOLON", "$$51 :", "control_list_def : epsilon_production $$51 control_list_specification", "$$52 :", "argument_list_def : epsilon_production $$52 argument_list_specification", "$$53 :", "callback_list_def : epsilon_production $$53 callback_list_specification", "$$54 :", "procedure_list_def : epsilon_production $$54 procedure_list_specification", "control_list_item : opt_managed control_item", "$$55 :", "control_list_item : id $$55 COLON control_object_definition", "$$56 :", "control_list_item : CHILD_NAME opt_child_managed $$56 child_object_spec", "$$57 :", "control_list_item : CHILD_NAME UNMANAGED $$57 child_object_spec", "opt_child_managed : epsilon_production", "opt_child_managed : MANAGED", "argument_list_item : value EQUAL_SIGN value", "argument_list_item : value EQUAL_SIGN CLASS_NAME id_ref", "callback_list_item : value EQUAL_SIGN procedure_reference", "callback_list_item : value EQUAL_SIGN procedure_list_def", "$$58 :", "control_item : epsilon_production $$58 control_object_specification", "opt_managed : epsilon_production", "opt_managed : MANAGED", "opt_managed : UNMANAGED", "procedure_reference : PROCEDURE id_ref opt_procedure_argument", "procedure_list_def_ref : id_ref opt_procedure_argument", "opt_procedure_argument : epsilon_production", "opt_procedure_argument : LEFT_PAREN value RIGHT_PAREN", "opt_procedure_argument : LEFT_PAREN CLASS_NAME id_ref RIGHT_PAREN", "opt_procedure_argument : LEFT_PAREN RIGHT_PAREN", "id : NAME", "id : FONT_NAME", "id : COLOR_NAME", "id : ARGUMENT_NAME", "id : REASON_NAME", "id : ENUMVAL_NAME", "id : CHILD_NAME", "id : keyword", "id_ref : id", "keyword : STRING", "keyword : BOOLEAN", "keyword : FLOAT", "keyword : INTEGER", "keyword : FONT", "keyword : ARGUMENT", "keyword : REASON", "keyword : PIXMAP", "keyword : COLOR", "keyword : NAMES", "keyword : CASE_SENSITIVE", "keyword : CASE_INSENSITIVE", "keyword : VERSION", "keyword : MANAGED", "keyword : UNMANAGED", "keyword : UILFILE", "keyword : string_table_type", "keyword : asciz_table_type", "keyword : INTEGER_TABLE", "keyword : TRANSLATION_TABLE", "keyword : COMPOUND_STRING", "keyword : COMPOUND_STRING_COMPONENT", "keyword : CLASS_REC_NAME", "keyword : FONT_TABLE", "keyword : RIGHT_TO_LEFT", "keyword : CHARACTER_SET", "keyword : COLOR_TABLE", "keyword : ICON", "keyword : BACKGROUND", "keyword : FOREGROUND", "keyword : XBITMAPFILE", "keyword : SEPARATE", "keyword : ANY", "keyword : IMPORTED", "keyword : OBJECTS", "keyword : KEYSYM", "keyword : SINGLE_FLOAT", "keyword : RGB", "keyword : WIDE_CHARACTER", "keyword : FONTSET", "character_8_value : value", "private_value : value", "private_value_plus : non_export_value", "private_value_plus : value", "non_export_value : COLOR_TABLE LEFT_PAREN color_list RIGHT_PAREN", "value : value_1", "value : value OR value_1", "value : value XOR value_1", "value_1 : value_2", "value_1 : value_1 AND value_2", "value_2 : value_3", "value_2 : value_2 LEFT_SHIFT value_3", "value_2 : value_2 RIGHT_SHIFT value_3", "value_3 : value_4", "value_3 : value_3 PLUS value_4", "value_3 : value_3 MINUS value_4", "value_4 : value_5", "value_4 : value_4 MULTIPLY value_5", "value_4 : value_4 DIVIDE value_5", "value_5 : value_6", "value_5 : MINUS value_5", "value_5 : NOT value_5", "value_5 : PLUS value_5", "value_6 : operand", "value_6 : LEFT_PAREN value RIGHT_PAREN", "operand : UNS_INT_LITERAL", "operand : UNS_INT_LITERAL units_specification", "operand : optional_charset CHAR_8_LITERAL", "operand : id", "operand : UNS_FLOAT_LITERAL", "operand : UNS_FLOAT_LITERAL units_specification", "operand : PIXMAP LEFT_PAREN character_8_value RIGHT_PAREN", "operand : FONT LEFT_PAREN font_spec RIGHT_PAREN", "operand : FONTSET LEFT_PAREN fontset_spec RIGHT_PAREN", "operand : COLOR LEFT_PAREN color_spec RIGHT_PAREN", "operand : REASON LEFT_PAREN character_8_value RIGHT_PAREN", "operand : CLASS_REC_NAME LEFT_PAREN character_8_value RIGHT_PAREN", "operand : ARGUMENT LEFT_PAREN character_8_value opt_arg_type RIGHT_PAREN", "operand : UILTRUE", "operand : UILFALSE", "operand : ON", "operand : OFF", "operand : optional_charset COMP_STRING", "operand : string_table_type LEFT_PAREN comp_str_list RIGHT_PAREN", "operand : asciz_table_type LEFT_PAREN asciz_list RIGHT_PAREN", "operand : INTEGER_TABLE LEFT_PAREN integer_list RIGHT_PAREN", "operand : TRANSLATION_TABLE LEFT_PAREN string_list RIGHT_PAREN", "operand : COMPOUND_STRING LEFT_PAREN comp_str_result RIGHT_PAREN", "operand : COMPOUND_STRING_COMPONENT LEFT_PAREN comp_str_comp_result RIGHT_PAREN", "operand : FONT_TABLE LEFT_PAREN font_list RIGHT_PAREN", "operand : ICON LEFT_PAREN icon_spec RIGHT_PAREN", "operand : FLOAT LEFT_PAREN value RIGHT_PAREN", "operand : INTEGER LEFT_PAREN value RIGHT_PAREN", "operand : XBITMAPFILE LEFT_PAREN character_8_value RIGHT_PAREN", "operand : KEYSYM LEFT_PAREN character_8_value RIGHT_PAREN", "operand : SINGLE_FLOAT LEFT_PAREN value RIGHT_PAREN", "operand : RGB LEFT_PAREN rgb_list RIGHT_PAREN", "operand : WIDE_CHARACTER LEFT_PAREN wchar_str_result RIGHT_PAREN", "operand : LOC_STRING", "string_list :", "string_list : string_list_2", "string_list_2 : private_value", "string_list_2 : string_list_2 COMMA private_value", "asciz_list :", "asciz_list : asciz_list_2", "asciz_list_2 : private_value", "asciz_list_2 : asciz_list_2 COMMA private_value", "integer_list :", "integer_list : integer_list_2", "integer_list_2 : private_value", "integer_list_2 : integer_list_2 COMMA private_value", "rgb_list : private_value COMMA private_value COMMA private_value", "comp_str_list :", "comp_str_list : comp_str_list_2", "comp_str_list_2 : private_value", "comp_str_list_2 : comp_str_list_2 COMMA private_value", "opt_arg_type :", "opt_arg_type : COMMA arg_value_type", "opt_arg_type : COMMA ANY", "comp_str_result : private_value", "comp_str_result : private_value comp_str_attrs", "comp_str_comp_result : ENUMVAL_NAME", "comp_str_comp_result : ENUMVAL_NAME COMMA ENUMVAL_NAME", "comp_str_comp_result : ENUMVAL_NAME COMMA CHAR_8_LITERAL", "comp_str_comp_result : ENUMVAL_NAME COMMA LOC_STRING", "comp_str_comp_result : ENUMVAL_NAME COMMA CHARSET_NAME", "comp_str_attrs : COMMA comp_str_attr", "comp_str_attrs : comp_str_attrs COMMA comp_str_attr", "comp_str_attr : CHARACTER_SET EQUAL_SIGN valid_charset", "comp_str_attr : RIGHT_TO_LEFT EQUAL_SIGN private_value", "comp_str_attr : SEPARATE EQUAL_SIGN private_value", "wchar_str_result : private_value", "font_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset", "font_spec : character_8_value", "fontset_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset", "fontset_spec : character_8_value", "font_list : font_item", "font_list : font_list COMMA font_item", "font_item : valid_charset EQUAL_SIGN private_value", "font_item : private_value", "optional_charset : POUND valid_charset", "optional_charset : epsilon_production", "valid_charset : CHARSET_NAME", "valid_charset : CHARACTER_SET LEFT_PAREN charset_info RIGHT_PAREN", "valid_charset : NAME", "charset_info : character_8_value", "charset_info : character_8_value charset_attrs", "charset_attrs : COMMA charset_attr", "charset_attrs : charset_attrs COMMA charset_attr", "charset_attr : RIGHT_TO_LEFT EQUAL_SIGN private_value", "charset_attr : SIXTEEN_BIT EQUAL_SIGN private_value", "color_list : color_item", "color_list : color_list COMMA color_item", "color_item : BACKGROUND COLOR EQUAL_SIGN character_8_value", "color_item : FOREGROUND COLOR EQUAL_SIGN character_8_value", "color_item : value EQUAL_SIGN character_8_value", "color_spec : character_8_value", "color_spec : character_8_value COMMA mono_color_spec", "mono_color_spec : BACKGROUND", "mono_color_spec : FOREGROUND", "icon_spec : icon_rows", "icon_spec : COLOR_TABLE EQUAL_SIGN private_value COMMA icon_rows", "icon_rows : private_value", "icon_rows : icon_rows COMMA private_value", "units_specification : PIX", "units_specification : PIXEL", "units_specification : PIXELS", "units_specification : IN", "units_specification : INCH", "units_specification : INCHES", "units_specification : CM", "units_specification : CENTIMETER", "units_specification : CENTIMETERS", "units_specification : MM", "units_specification : MILLIMETER", "units_specification : MILLIMETERS", "units_specification : PT", "units_specification : POINT", "units_specification : POINTS", "units_specification : FU", "units_specification : FONT_UNIT", "units_specification : FONT_UNITS", }; #endif int yydebug; int yynerrs; int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 10000 #endif #endif #define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; YYINT *s_base; YYINT *s_mark; YYINT *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; #line 1403 "Uil.y" /* Dummy error routine for the parser. We will output our own error messages. */ int yyerror (s) char * s; { return 0; } #line 2206 "Uil.c" #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; YYINT *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return YYENOMEM; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return YYENOMEM; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; YYERROR_CALL("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == YYEOF) goto yyabort; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 1: #line 239 "Uil.y" { sar_save_module_source (); } break; case 3: #line 244 "Uil.y" { sar_create_root ( &yyval ); } break; case 4: #line 245 "Uil.y" { sar_create_module( &yyval, &yystack.l_mark[0], &yystack.l_mark[-1] ); } break; case 10: #line 260 "Uil.y" { sar_process_module_version( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 11: #line 261 "Uil.y" { sar_process_module_sensitivity( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 12: #line 262 "Uil.y" { sar_process_module_charset( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 13: #line 263 "Uil.y" { sar_make_def_obj (&yystack.l_mark[0]); } break; case 19: #line 274 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 23: #line 280 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 25: #line 284 "Uil.y" { sar_make_def_obj (&yystack.l_mark[0]); } break; case 26: #line 285 "Uil.y" { sar_process_module_variant (&yystack.l_mark[-3], &yystack.l_mark[0]); yyval = gz_yynullval; } break; case 27: #line 289 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_widget_entry; } break; case 28: #line 290 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_gadget_entry; } break; case 37: #line 312 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_value_section); } break; case 41: #line 318 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 43: #line 322 "Uil.y" { sar_bind_value_name( &yystack.l_mark[-3], &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 44: #line 326 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_exported; yyval.b_flags &= ~sym_m_private; } break; case 45: #line 327 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_private; yyval.b_flags &= ~sym_m_exported; } break; case 46: #line 328 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_private; yyval.b_flags &= ~sym_m_exported; } break; case 47: #line 329 "Uil.y" { sar_import_value_entry( &yyval, &yystack.l_mark[0] ); } break; case 48: #line 333 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_value; } break; case 49: #line 334 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_char_8_value; } break; case 50: #line 335 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_pixmap_value; } break; case 51: #line 336 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_float_value; } break; case 52: #line 337 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_bool_value; } break; case 53: #line 338 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_value; } break; case 54: #line 339 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_reason_value; } break; case 55: #line 340 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_argument_value; } break; case 56: #line 341 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_color_value; } break; case 57: #line 342 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_string_table_value; } break; case 58: #line 343 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_asciz_table_value; } break; case 59: #line 344 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_table_value; } break; case 60: #line 345 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_trans_table_value; } break; case 61: #line 346 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_table_value; } break; case 62: #line 347 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_icon_value; } break; case 63: #line 348 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 64: #line 349 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 65: #line 350 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_class_rec_name_value; } break; case 66: #line 351 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_xbitmapfile_value; } break; case 67: #line 352 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_keysym_value; } break; case 68: #line 353 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_single_float_value; } break; case 69: #line 354 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_rgb_value; } break; case 70: #line 355 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_wchar_string_value; } break; case 71: #line 356 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_fontset_value; } break; case 72: #line 357 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_widget_ref_value; } break; case 73: #line 362 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_value; } break; case 74: #line 363 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_char_8_value; } break; case 75: #line 364 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_pixmap_value; } break; case 76: #line 365 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_float_value; } break; case 77: #line 366 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_bool_value; } break; case 78: #line 367 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_value; } break; case 79: #line 368 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_reason_value; } break; case 80: #line 369 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_color_value; } break; case 81: #line 370 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_string_table_value; } break; case 82: #line 371 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_asciz_table_value; } break; case 83: #line 372 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_table_value; } break; case 84: #line 373 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_trans_table_value; } break; case 85: #line 374 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_table_value; } break; case 86: #line 375 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_icon_value; } break; case 87: #line 376 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 88: #line 377 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_keysym_value; } break; case 89: #line 378 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_single_float_value; } break; case 90: #line 379 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_wchar_string_value; } break; case 91: #line 380 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_fontset_value; } break; case 92: #line 381 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_widget_ref_value; } break; case 97: #line 398 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_procedure_section); } break; case 101: #line 404 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 103: #line 408 "Uil.y" { sar_create_procedure( &yystack.l_mark[-3], &yystack.l_mark[-2], &yystack.l_mark[-1], &yystack.l_mark[0] );} break; case 104: #line 412 "Uil.y" { yyval = gz_yynullval; } break; case 105: #line 413 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 106: #line 417 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_no_value; } break; case 108: #line 419 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_any_value; } break; case 109: #line 422 "Uil.y" { YYSTYPE temp[2]; temp[0] = gz_yynullval; sar_create_object(&temp[0], sym_k_widget_entry); temp[1] = yystack.l_mark[0]; sar_set_object_class(&temp[1]); sar_verify_object(&temp[1]); yyval = temp[0]; } break; case 110: #line 432 "Uil.y" { yyval.b_flags = sym_m_private; } break; case 111: #line 445 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_identifier_section); } break; case 115: #line 451 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 117: #line 455 "Uil.y" { sar_create_identifier ( &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 118: #line 465 "Uil.y" { sar_include_file (&yystack.l_mark[-1], &yystack.l_mark[-3], &yystack.l_mark[0]); } break; case 119: #line 466 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 121: #line 474 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_object_section); } break; case 123: #line 478 "Uil.y" { yyval = yystack.l_mark[-1]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 124: #line 479 "Uil.y" { yyval = yystack.l_mark[-2]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 125: #line 480 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 127: #line 485 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_widget_entry); sar_link_section (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 128: #line 488 "Uil.y" { yyval = gz_yynullval; } break; case 129: #line 493 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 131: #line 496 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_private); } break; case 133: #line 499 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 135: #line 502 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_imported); } break; case 136: #line 504 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 137: #line 514 "Uil.y" { sar_verify_object (&yystack.l_mark[-5]); } break; case 138: #line 519 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 140: #line 522 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_private); } break; case 142: #line 525 "Uil.y" { sar_set_object_flags (& yystack.l_mark[0], (sym_m_managed | sym_m_exported)); } break; case 144: #line 528 "Uil.y" { sar_unset_object_flags (& yystack.l_mark[0], sym_m_managed), sar_set_object_flags (& yystack.l_mark[0], sym_m_exported); } break; case 146: #line 531 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 148: #line 534 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_imported); } break; case 149: #line 536 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 150: #line 538 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 151: #line 543 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 152: #line 547 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 153: #line 552 "Uil.y" { sar_set_object_variant (&yystack.l_mark[0]); } break; case 154: #line 554 "Uil.y" { sar_set_object_variant (&yystack.l_mark[0]); } break; case 155: #line 559 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 156: #line 563 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 158: #line 569 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &gz_yynullval, sym_k_object_proc); sar_save_user_proc_ref_src ( &yystack.l_mark[-2], &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 160: #line 575 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 161: #line 585 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 164: #line 588 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 166: #line 593 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 167: #line 596 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-2], sym_m_exported); } break; case 168: #line 599 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-3], sym_m_exported); } break; case 169: #line 600 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 171: #line 606 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-2], sym_m_private); } break; case 172: #line 609 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-3], sym_m_private); } break; case 173: #line 610 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 177: #line 620 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 178: #line 622 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 179: #line 624 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); sar_update_parent_list (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 180: #line 626 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 182: #line 631 "Uil.y" { yyval = gz_yynullval; } break; case 183: #line 639 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_list_section); } break; case 185: #line 644 "Uil.y" { yyval = yystack.l_mark[-1]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 186: #line 645 "Uil.y" { yyval = yystack.l_mark[-2]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 187: #line 646 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 189: #line 651 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_list_entry); sar_link_section (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 190: #line 654 "Uil.y" { yyval = gz_yynullval; } break; case 195: #line 666 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 196: #line 668 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 197: #line 673 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 198: #line 675 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 199: #line 680 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 200: #line 682 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 201: #line 687 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 202: #line 689 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 203: #line 694 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_argument_list; } break; case 204: #line 699 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_callback_list; } break; case 205: #line 704 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_proc_ref_list; } break; case 206: #line 708 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_control_list; } break; case 207: #line 712 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 210: #line 715 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 212: #line 719 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 215: #line 722 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 217: #line 727 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 220: #line 730 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 222: #line 734 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 225: #line 737 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 235: #line 762 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 236: #line 764 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 237: #line 765 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 239: #line 770 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 240: #line 772 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 241: #line 773 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 243: #line 778 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 244: #line 780 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 245: #line 781 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 247: #line 786 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 248: #line 788 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 249: #line 789 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 251: #line 794 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 252: #line 796 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 253: #line 801 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 254: #line 803 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 255: #line 808 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 256: #line 810 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 257: #line 815 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 258: #line 817 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 259: #line 825 "Uil.y" { sar_save_control_item (&yystack.l_mark[-1], &yystack.l_mark[0]); yyval = yystack.l_mark[-1]; } break; case 260: #line 828 "Uil.y" { sar_create_object (& yystack.l_mark[0], sym_k_widget_entry); yystack.l_mark[0].b_flags = sym_m_managed; yyval = gz_yynullval;} break; case 261: #line 831 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 262: #line 834 "Uil.y" { sar_create_child (& yystack.l_mark[-1]); yystack.l_mark[-1].b_flags = sym_m_managed; yyval = gz_yynullval; } break; case 263: #line 837 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 264: #line 839 "Uil.y" { sar_create_child (& yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 265: #line 841 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-1]); yyval = yystack.l_mark[-3]; } break; case 268: #line 855 "Uil.y" { sar_save_argument_pair (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 269: #line 860 "Uil.y" { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = yystack.l_mark[-1]; sar_set_object_class (&temp [1]); temp [1] = yystack.l_mark[0]; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); sar_save_argument_pair (&yystack.l_mark[-3], &temp [0], &yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 270: #line 874 "Uil.y" { sar_save_reason_binding (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 271: #line 876 "Uil.y" { sar_save_reason_binding (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 272: #line 881 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_widget_entry); yyval = gz_yynullval; } break; case 273: #line 883 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 274: #line 888 "Uil.y" { yyval.b_flags = sym_m_managed; } break; case 275: #line 890 "Uil.y" { yyval = gz_yynullval; yyval.b_flags = sym_m_managed; } break; case 276: #line 892 "Uil.y" { yyval = gz_yynullval; } break; case 277: #line 897 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &yystack.l_mark[0], sym_k_callback_proc); yyval = yystack.l_mark[-1]; } break; case 278: #line 902 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &yystack.l_mark[0], sym_k_callback_proc); yyval = yystack.l_mark[-1]; } break; case 280: #line 908 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 281: #line 910 "Uil.y" { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = yystack.l_mark[-2]; sar_set_object_class (&temp [1]); temp [1] = yystack.l_mark[-1]; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); yyval = temp [0]; } break; case 282: #line 918 "Uil.y" { yyval = gz_yynullval; } break; case 290: #line 933 "Uil.y" { sar_map_keyword_to_name( &yyval, &yystack.l_mark[0]); } break; case 291: #line 940 "Uil.y" { sar_process_id_ref (&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 332: #line 998 "Uil.y" { yyval = yystack.l_mark[0]; if ((yyval.b_type != sym_k_error_value) && (yyval.b_type != sym_k_any_value) && ((yyval.b_flags &sym_m_forward_ref) == 0)) { if ((yyval.b_type != sym_k_char_8_value) && (yyval.b_type != sym_k_localized_string_value)) sar_value_type_error( &yyval, sym_k_char_8_value ); if ((yyval.b_flags &sym_m_private) == 0) sar_private_error( &yyval ); } } break; case 333: #line 1014 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 334: #line 1027 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 335: #line 1035 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 336: #line 1045 "Uil.y" { sar_make_color_table( &yyval, &yystack.l_mark[-1], &yystack.l_mark[-3]); } break; case 338: #line 1052 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 339: #line 1053 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 341: #line 1058 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 343: #line 1063 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 344: #line 1064 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 346: #line 1069 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 347: #line 1070 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 349: #line 1075 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 350: #line 1076 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 352: #line 1081 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 353: #line 1082 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 354: #line 1083 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 356: #line 1088 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 357: #line 1092 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_integer_value, &yystack.l_mark[0], XmPIXELS); } break; case 358: #line 1094 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_integer_value, &yystack.l_mark[-1], sar_get_units_type(&yystack.l_mark[0])); } break; case 359: #line 1096 "Uil.y" { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_char_8_value, &yystack.l_mark[0], 0); } break; case 360: #line 1100 "Uil.y" { sar_process_id( &yyval, &yystack.l_mark[0] );} break; case 361: #line 1101 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_float_value, &yystack.l_mark[0], XmPIXELS); } break; case 362: #line 1103 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_float_value, &yystack.l_mark[-1], sar_get_units_type(&yystack.l_mark[0])); } break; case 363: #line 1105 "Uil.y" { sar_value_not_implemented( &yyval, &yystack.l_mark[-3], "pixmap literal" ); } break; case 364: #line 1106 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 365: #line 1107 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 366: #line 1108 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 367: #line 1109 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_reason_value, &yystack.l_mark[-3], 0); } break; case 368: #line 1111 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_class_rec_name_value, &yystack.l_mark[-3], 0); } break; case 369: #line 1114 "Uil.y" { sar_make_private_value ( &yyval, &yystack.l_mark[-2], sym_k_argument_value, &yystack.l_mark[-4], yystack.l_mark[-1].b_type ); } break; case 370: #line 1116 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 371: #line 1118 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 372: #line 1120 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 373: #line 1122 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 374: #line 1124 "Uil.y" { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value ( &yyval, &yystack.l_mark[0], sym_k_compound_string_value, &yystack.l_mark[0], 0); } break; case 375: #line 1128 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_string_table_value, &yystack.l_mark[-3], 0); } break; case 376: #line 1130 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_asciz_table_value, &yystack.l_mark[-3], 0); } break; case 377: #line 1132 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_integer_table_value, &yystack.l_mark[-3], 0); } break; case 378: #line 1134 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_trans_table_value, &yystack.l_mark[-3], 0); } break; case 379: #line 1136 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 380: #line 1137 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 381: #line 1138 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 382: #line 1139 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 383: #line 1140 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 384: #line 1141 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 385: #line 1143 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_xbitmapfile_value, &yystack.l_mark[-3], 0); } break; case 386: #line 1146 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_keysym_value, &yystack.l_mark[-3], 0); } break; case 387: #line 1149 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 388: #line 1151 "Uil.y" { sar_make_private_value( & yyval, & yystack.l_mark[-1], sym_k_rgb_value, &yystack.l_mark[-3], 0); } break; case 389: #line 1153 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 390: #line 1154 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[0], sym_k_localized_string_value, &yystack.l_mark[0], 0); } break; case 391: #line 1160 "Uil.y" { yyval = gz_yynullval; } break; case 392: #line 1162 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 393: #line 1167 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_trans_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 394: #line 1169 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_trans_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 395: #line 1174 "Uil.y" { yyval = gz_yynullval; } break; case 396: #line 1176 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 397: #line 1181 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_asciz_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 398: #line 1183 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_asciz_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 399: #line 1188 "Uil.y" { yyval = gz_yynullval; } break; case 400: #line 1190 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 401: #line 1195 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_integer_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 402: #line 1197 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_integer_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 403: #line 1203 "Uil.y" {sar_append_table_value(&yystack.l_mark[-4], & gz_yynullval, sym_k_integer_table_value, & yystack.l_mark[-4]); sar_append_table_value(& yystack.l_mark[-2], & yystack.l_mark[-4], sym_k_integer_table_value, & yystack.l_mark[-3]); sar_append_table_value(& yystack.l_mark[0], & yystack.l_mark[-2], sym_k_integer_table_value, & yystack.l_mark[-1]); yyval = yystack.l_mark[0];} break; case 404: #line 1212 "Uil.y" { yyval = gz_yynullval; } break; case 405: #line 1214 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 406: #line 1219 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_string_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 407: #line 1221 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_string_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 408: #line 1225 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_any_value; } break; case 409: #line 1226 "Uil.y" { yyval = gz_yynullval; yyval.b_type = yystack.l_mark[0].b_type; } break; case 410: #line 1227 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_any_value; } break; case 411: #line 1231 "Uil.y" { sar_make_comp_str( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 412: #line 1232 "Uil.y" { sar_make_comp_str( &yyval, &yystack.l_mark[-1], &yystack.l_mark[0], &yystack.l_mark[-3] ); } break; case 413: #line 1236 "Uil.y" { sar_make_comp_str_comp(&yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 414: #line 1237 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 415: #line 1238 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 416: #line 1239 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 417: #line 1240 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 418: #line 1244 "Uil.y" { sar_chk_comp_str_attr( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 419: #line 1245 "Uil.y" { sar_chk_comp_str_attr( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 420: #line 1249 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.b_tag = yystack.l_mark[0].b_tag; yyval.value.az_keyword_entry = yystack.l_mark[0].value.az_keyword_entry; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 421: #line 1253 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 422: #line 1255 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 423: #line 1260 "Uil.y" { sar_make_wchar_str( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 424: #line 1265 "Uil.y" { sar_make_font( &yyval, &yystack.l_mark[0], &yystack.l_mark[-4], &yystack.l_mark[-6] ); } break; case 425: #line 1266 "Uil.y" { sar_make_font( &yyval, &gz_yynullval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 426: #line 1271 "Uil.y" { sar_make_fontset( &yyval, &yystack.l_mark[0], &yystack.l_mark[-4], &yystack.l_mark[-6] ); } break; case 427: #line 1272 "Uil.y" { sar_make_fontset( &yyval, &gz_yynullval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 428: #line 1276 "Uil.y" { sar_make_font_table( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 429: #line 1277 "Uil.y" { sar_make_font_table( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2], &yystack.l_mark[-4] ); } break; case 430: #line 1284 "Uil.y" { sar_make_font_item( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 431: #line 1285 "Uil.y" { sar_make_font_item( &yyval, &gz_yynullval, &yystack.l_mark[0] ); } break; case 432: #line 1289 "Uil.y" { /* Don't use TRUE because it is a token not a Boolean! */ yyval = yystack.l_mark[0]; Uil_lex_l_charset_specified = 1;} break; case 434: #line 1297 "Uil.y" { sar_charset_verify (&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 435: #line 1298 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 436: #line 1299 "Uil.y" { sar_make_fallback_charset(&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 437: #line 1305 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[0], sym_k_char_8_value, &yystack.l_mark[0], 0); sar_make_charset (&yyval, &yyval, &gz_yynullval, &yystack.l_mark[0]); } break; case 438: #line 1308 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_char_8_value, &yystack.l_mark[-1], 0); sar_make_charset (&yyval, &yyval, &yystack.l_mark[0], &yystack.l_mark[-1]); } break; case 439: #line 1314 "Uil.y" { sar_chk_charset_attr( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 440: #line 1315 "Uil.y" { sar_chk_charset_attr( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 441: #line 1319 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; if (yystack.l_mark[0].b_type != sym_k_bool_value) sar_value_type_error( &yystack.l_mark[0], sym_k_bool_value ); yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 442: #line 1323 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; if (yystack.l_mark[0].b_type != sym_k_bool_value) sar_value_type_error( &yystack.l_mark[0], sym_k_bool_value ); yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 443: #line 1330 "Uil.y" { sar_append_color_item( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 444: #line 1331 "Uil.y" { sar_append_color_item( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 445: #line 1335 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-3], &yystack.l_mark[0] ); } break; case 446: #line 1336 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-3], &yystack.l_mark[0] ); } break; case 447: #line 1337 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 448: #line 1341 "Uil.y" { sar_make_color( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 449: #line 1342 "Uil.y" { sar_make_color( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 452: #line 1351 "Uil.y" { sar_make_icon( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2]); } break; case 453: #line 1353 "Uil.y" { sar_make_icon( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2], &yystack.l_mark[-6] ); } break; case 454: #line 1358 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_icon_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 455: #line 1360 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_icon_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 456: #line 1365 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 457: #line 1367 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 458: #line 1369 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 459: #line 1371 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 460: #line 1373 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 461: #line 1375 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 462: #line 1377 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 463: #line 1379 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 464: #line 1381 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 465: #line 1383 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 466: #line 1385 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 467: #line 1387 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 468: #line 1389 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 469: #line 1391 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 470: #line 1393 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 471: #line 1395 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 472: #line 1397 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 473: #line 1399 "Uil.y" { yyval = yystack.l_mark[0]; } break; #line 3799 "Uil.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == YYEOF) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } *++yystack.s_mark = (YYINT) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: YYERROR_CALL("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); } motif-2.3.8/tools/wml/wmllex.l0000644000175000017500000000753613066310437013225 00000000000000%{ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #if defined(__STDC__) #include #endif #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ #ifdef YY_BUFFER_SIZE #define BUF_SIZE YY_BUFFER_SIZE #else #define BUF_SIZE 8192 #endif char yystringval[BUF_SIZE]; /* any string value */ char yynameval[BUF_SIZE]; /* any identifier (name) */ int yytknval1; /* terminal token value 1 */ int yytknval2; /* terminal token value 2 */ %} %p 3000 %% [ \t\f] {} [\n] { wml_line_count += 1; } "Class" { return CLASS; } "Resource" { return RESOURCE; } "DataType" { return DATATYPE; } "ControlList" { return CONTROLLIST; } "EnumerationSet" { return ENUMERATIONSET; } "EnumerationValue" { return ENUMERATIONVALUE; } "CharacterSet" { return CHARACTERSET; } "Child" { return CHILD; } "DocName" { return DOCNAME; } "ConvenienceFunction" { return CONVFUNC; } "Alias" { return ALIAS; } "Type" { return TYPE; } "ResourceLiteral" { return RESOURCELITERAL; } "Related" { return RELATED; } "InternalLiteral" { return INTERNALLITERAL; } "Constraint" { return CONSTRAINT; } "Exclude" { return EXCLUDE;} "Resources" { return RESOURCES; } "SuperClass" { return SUPERCLASS; } "ParentClass" { return PARENTCLASS; } "Controls" { return CONTROLS; } "WidgetClass" { return WIDGETCLASS; } "DialogClass" { return DIALOGCLASS; } "Default" { return DEFAULT; } "EnumLiteral" { return ENUMLITERAL; } "XmStringCharsetName" { return XMSTRINGCHARSETNAME; } "FontListElementTag" { return XMSTRINGCHARSETNAME; } "Direction" { return DIRECTION; } "ParseDirection" { return PARSEDIRECTION; } "CharacterSize" { return CHARACTERSIZE; } "ControlsMapToResource" { return CTRLMAPSRESOURCE; } "Children" { return CHILDREN; } "MetaClass" { return METACLASS;} "Widget" { return WIDGET;} "Gadget" { return GADGET;} "Argument" { return ARGUMENT;} "Reason" { return REASON;} "SubResource" { return SUBRESOURCE;} "True" { return ATTRTRUE; } "False" { return ATTRFALSE; } "LeftToRight" { return LEFTTORIGHT; } "RightToLeft" { return RIGHTTOLEFT; } "OneByte" { return ONEBYTE; } "TwoByte" { return TWOBYTE; } "MixedOneAndTwoByte" { return MIXED1_2BYTE; } ":" { return COLON; } ";" { return SEMICOLON; } "=" { return EQUALS; } "{" { return LBRACE; } "}" { return RBRACE; } "!"[^\n]* {} "#"[^\n]* {} [a-zA-Z_][a-zA-Z0-9$_]* { /* string without quotes */ strcpy (yystringval, (XmConst char *) yytext); return STRING; } \"[^"\n]*\\ { /* escaped character in the string */ yymore(); } \"[^"\n]*\" { /* String in quotes */ strncpy(yystringval, (XmConst char *) yytext+1, yyleng - 2); yystringval[yyleng-2] = '\0' ; return STRING; } \"[^"\n]* { printf ("\nUnterminated string near %s, line %d", yytext, wml_line_count); return ERRORTOKEN; } . { printf ("\nEncountered illegal character '%c', line %d", yytext[0], wml_line_count); return ERRORTOKEN; } motif-2.3.8/tools/wml/README0000644000175000017500000003457212672140200012407 00000000000000/* $XConsortium: README /main/4 1996/07/15 14:38:42 drk $ */ This memo documents the Widget MetaLanguage (WML) facility which generates the Uil compiler language description. 1. Introduction The Uil compiler's language definition has the following components: - Invariant parts of the language grammar. This consists of the basic syntax and keywords, for example, the 'arguments' directive. - Dynamic parts of the language. This consists of the widget/gadget classes supported by the language, including all resources (arguments and reasons), and the definitions of legal relationships among these parts (which classes are legal controls (children) of any given class, default values, and so on). - The data types supported by the compiler. The code which supports the data types is invariant, but the data types must also be declared and made known in WML in order to provide a clean specification. The dynamic parts of the language definition in the compiler are represented as follows. The representation falls into two classes: - Definitions of the language used for validity checking and reporting: o A set of #define literals name all data types, classes, arguments, and reasons in the language. o A set of statically compiled tables defines the names and legal relationships among these entities. - All data types, classes, arguments, and reasons are treated as keywords in the Uil grammar. This is supported by: o A set of #define literals which names all the tokens in the language. Some of these tokens receive identical values to the literals mentioned above (this identity is crucial to the compiler's correct functioning). o A set of statically compiled tables used by lexical analysis to detect and classify the language keywords. o A yacc grammar including these token definitions which generates a compilable Uil language parser. These representations are all contained in .h files except for the parser, which is contained in a .y file and its resulting .c file. The WML system's task is to generate all these literals and tables based on a specification of the dynamic parts of the Uil language - the data types, widget/gadget classes, arguments, and reasons. The components of the system are: - A specification of the of set of widgets to be supported. This specification is an ASCII file containing a WML language specification as described below. The WML language is a simple declarative language whose syntax is similar to Uil itself. - A process named wml, which parses the WML specification and produces the following output: o The .h files which define the first class of language representations - the validity checking and reporting information. o A set of .dat files which are used by succeeding processes to produce the Uil grammar. o A report file which describes the toolkit being supported. o A .mm file to be incorporated in the Uil language documentation, which tabulates the built-in language tables for Uil user reference. - A process named wmluily which generates the Uil grammar. - A process named wmltokens which generates token data - A process named wmlkeyword which generates the token and lexical analysis tables. A shell script is provided which runs the system. The individual processes and inputs can usually be ignored. 2. Environment The generation and use of the WML system requires the following: - The C language compiler and runtime system (cc). - The lexical generator facility (lex) - the compiler compiler facility (yacc) The WML facility is found in directory /wmlsrc. It assumes the following directories also exist: /uilsrc - the directory to which the output files are to be moved /mrmsrc/Mrm - contains MrmCmpr.h and other .h files required to compile the uil compiler. The tables produced by WML must be consistent with the Mrm compression code tables emboded in /mrmsrc/Mrm/MrmCmpr.h and /mrmsrc/Mrm/MrmCmprTbl.h. If in doubt, refer to /mrmsrc/Mrm/urmc.README for details. 3. WML input Input to WML consists of: - A description of the widget set (toolkit) to be suppported in the WML specification language. - Data files supplied with WML facility, and which you will usually not need to modify. These are: o grammar.y - specifies the invariant part of the Uil grammar o charset.dat - specifies the character sets supported by the compiler when handling compound strings Any other .dat files found in /wmlsrc are the result of running the facility, and may be ignored. 3.A. WML specification language The WML specification is a simple declarative language whose syntax is similar to that of Uil itself. It models the widget set to be suppored in a way that is very similar to the Uil language. It differs in having class inheritance similar to Xt widget classes, which minimizes the amount of specification and reduces errors. The properties of the model are: - Class properties o Classes are differentiated into two types - metaclasses and classes. Metaclasses cannot instantiate widgets. Typically, a WML metaclass is generated for each metaclass in the widget set to be supported. o A regular class is defined for every low-level create routine in the widget set. There are typically more WML classes that widget set classes. For instance, there is one XmRowColumn class, with six WML classes (XmRowColumn XmMenuBar, XmOptionMenu, XmPopupMenu, XmPulldownMenu, XmRadioBox). o Gadgets are modelled as variants of a corresponding widget class. o A class may have zero or one superclasses. A class inherits all the resources and controls of its superclass (recursively). An inherited resource may have some of its properties overridden. o A class is given a name which becomes its Uil language keyword (for regular classes). Metaclass names do not appear in Uil. o A class is identified to Mrm by its creation convenience function (low-level create function). Examples are XmCreateLabel, XmCreatePushButtonGadget. - Resource properties o Resources are divided into two classes - arguments and and reasons. This models the Uil language distinction between callbacks and all other resources. o A resource is considered to have universal scope. Once defined, it may be used in any class. Its name and datatype are invariant, but its default value may be overridden. o A resource is included in a class by referencing it. Resources are inherited. Inherited resources may be excluded, which meancs they are not available in the class which provides this override (and its subclasses). This corresponds to the Motif toolkit N/A access value. o A resource is given a name which becomes its Uil language keyword. o A resource is identified to Mrm by the toolkit literal used to name it in arglists. Examples are XmNheight, XmNancestorSensitive, XmNhelpCallback. The resource literal defaults to the resource name, and need not be explicitly specified where they are identical. - Control properties o A control is a class which is permitted as the child of some other class. o Naming the controls of a class is a WML feature which supports validity checking. There is no coresponding explicit feature in any Xt widget set. 3.A.1 WML syntax and semantics The WML syntax can be quickly inferred from the standard input file provided with WML - motif-tables.wml. A quick BNF is provided in section 7. WML semantics are: - '!' introduces a comment. Comments run from '!' to EOL. - A string value may be quoted by enclosing in double quotes '"'. Names as well as values may be quoted. Keywords may not. - All names are case-sensitive. Forward and backward references are allowed. All references to be resolved are to items defined in WML. These are: o Type = o SuperClass = WidgetClass = o Resources { }; o Controls { statements> }; - A convenience function name is required for all classes except Metaclasses. - Datatypes are required for all Arguments, Constraints, and SubResources. - Arguments and SubResources are functionally identical, and are distinguished only because they are different kinds of resources in Xt widget sets. Constraints apply only to the referencing class's children. The same name may not be used for both an Argument and a Constraint (once a Constraint, always a Constraint). - If a resource occurs in the widget set with more than one datatype, the Uil datatype 'any' must be used. - The ResourceLiteral attribute for resources is optional, and need only be specified when the name is not identical to the literal. - The DocName and Default attributes are only used for documentation. They are arbitrary strings. - The WidgetClass attribute identifies the Widget class associated with a Gadget class, and is required. - The DialogClass attribute is optional. - The ControlList statement is a simply macro for lists of controls. It avoids tedious repetition of identical lists. A Controls block in a Class statement allows Class and ControlList names to be freely mixed. 4. WML output - The .h files and parser required by the compiler. These are automatically moved to /uilsrc by the runwml script. - A report describing the supported widget set, always named wml.report. This report is intended to aid in validating the WML source. The report is organized in a way which makes if fairly easy to compare the Uil langauge against widget set documentation as exemplified by the Motif Programmer's Reference Manual. The reported is sorted as follows: - alphabetically by class name - Resources ordered by ancestor (top of tree first). Resources are listed alphabetically, with datatype and default always shown. - Reasons ordered by ancestor (top of tree first), then alphabetically. - Controls listed alphabetically. - A file which provides documentation for the language, intended to be an appendix to a Uil manual as exemplified by the Guide to the Motif User Interface Language Compiler. This file is named wml-uil.mm 5. Generating and running WML The script file /wmlsrc/genwml will build WML. The script file /wmlsrc/runwml will run WML with motif-tables.src as input. 6. Gotchas and problems in current WML implementation The script files genwml and runwml should be replaced by Makefiles. The documentation file ?.mm is relatively untested. The tables should probably be modified, as they are currently too big to print cleanly. The handling of the DocName attribute is incorrect. The specification of the Motif toolkit in motif-tables.wml has not been fully validated against the latest toolkit documentation. We believe there are no or very few errors in the actual resources and the classes which use them. There may be errors in the default values, which will appear in the documentation. 7. WML BNF WML-specification : statement_block_list statement_block_list: statement_block_list statement_block statement_block: class_statement_block | resource_statement_block | datatype_statement_block | control_list_statement_block class_statement_block: 'Class' class_statement_list resource_statement_block: 'Resource' resource_statement_list datatype_statement_block: 'Datatype' datatype_statement_list control_list_statement_block: 'ControlList' control_list_statement_list class_statement_list: class_statement ';' | class_statement_list class_statement ';' resource_statement_list: resource_statement ';' | resource_statement_list resource_statement ';' datatype_statement_list: datatype_statement ';' | datatype_statement_list datatype_statement ';' control_list_statement_list: control_list_statement ';' | control_list_statement_list control_list_statement ';' class_statement: ':' class_type class_definition class_type: 'MetaClass' | 'Widget' | 'Gadget' class_definition: | '{' '}' | '{' class_attribute_list '}' class_attribute_list: class_attribute_name '=' ';' | class_boolean_attribute_name '=' boolean_attribute_value ';' | class_resources ';' | class_controls ';' class_attribute_name: 'SuperClass' | 'Alias' | 'ConvenienceFunction' | 'WidgetClass' | 'DocName' class_boolean_attribute_name: 'DialogClass' boolean_attribute_value: 'True' | 'False' class_resources: 'Resources' class_resources_block class_resources_block: '{' '}' '{' class_resource_list '}' class_resource_list: class_resource_element | class_resource_list class_resource_element class_resource_element: class_resource_attributes ';' class_resource_attributes: '{' '}' ';' '{' class_resource_attribute_list '}' class_resource_attribute_list: class_resource_attribute_element | class_resource_attribute_list class_resource_attribute_element class_attribute_element class_resource_attribute_name '=' ';' | boolean_class_resource_attribute_name '=' boolean_attribute_value ';' class_resource_attribute_name: 'Default' boolean_class_resource_attribute_name: 'Exclude' class_controls: 'Controls' class_controls_block class_controls_block: | '{' '}' ';' | '{' class_controls_list '}' class_controls_list: class_controls_element class_controls_list class_controls_element class_controls_element: ; resource_statement: ':' resource_type resource_definition resource_type: 'Argument' | 'Reason' | 'Constraint' | 'SubResource' resource_definition: '{' '}' '{' resource_attribute_list '}' resource_attribute_list: resource_attribute resource_attribute_list resource_attribute resource_attribute: resource_attribute_name '=' ';' resource_attribute_name: 'Type' | 'ResourceLiteral' | 'Alias' | 'Related' | 'Default' | 'DocName' datatype_statement: datatype_definition datatype_definition: | '{' '}' | '{' datatype_attribute_list '}' datatype_attribute_list: datatype_attribuute datatype_attribute_list datatype_attribute datatype_attribute: datatype-attribute_name '=' ';' datatype_attribute_name: 'Alias' | 'DocName' control_list_statement: control_list_definition control_list_definition: '{' '}' '{' control_list_controls_list '}' control_list_controls_list: control_list_control control_list_controls_list control_list_control control_list_control: ';' motif-2.3.8/tools/wml/wmllex.c0000644000175000017500000017543613211513005013205 00000000000000 #line 3 "wmllex.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ (yytext_ptr) -= (yy_more_len); \ yyleng = (size_t) (yy_cp - (yytext_ptr)); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 60 #define YY_END_OF_BUFFER 61 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[382] = { 0, 0, 0, 61, 59, 1, 2, 53, 58, 54, 48, 49, 50, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 51, 52, 53, 58, 57, 56, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 41, 55, 14, 55, 55, 13, 55, 55, 10, 3, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 42, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 37, 55, 55, 55, 55, 55, 55, 55, 39, 55, 55, 55, 55, 55, 55, 36, 55, 55, 55, 55, 55, 55, 55, 55, 26, 55, 55, 11, 55, 55, 19, 55, 55, 55, 55, 55, 45, 55, 55, 16, 55, 55, 55, 55, 46, 55, 55, 38, 55, 34, 55, 55, 23, 55, 5, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 4, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 30, 55, 55, 55, 55, 55, 35, 55, 55, 55, 55, 20, 55, 55, 55, 55, 55, 55, 18, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 21, 55, 55, 55, 55, 6, 55, 55, 25, 27, 55, 55, 55, 43, 55, 22, 55, 55, 44, 40, 24, 55, 9, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 32, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 7, 55, 55, 55, 55, 31, 55, 55, 55, 55, 55, 55, 17, 55, 15, 55, 55, 55, 8, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 29, 47, 55, 55, 12, 28, 55, 33, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, 1, 10, 1, 1, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 18, 18, 20, 21, 22, 23, 24, 18, 25, 26, 27, 18, 28, 29, 30, 18, 18, 1, 31, 1, 1, 18, 1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 18, 18, 41, 42, 43, 44, 45, 18, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 1, 56, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[57] = { 0, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1 } ; static yyconst flex_int16_t yy_base[386] = { 0, 0, 0, 413, 414, 414, 414, 0, 52, 0, 414, 414, 414, 17, 0, 20, 30, 17, 33, 380, 368, 374, 31, 366, 376, 32, 358, 27, 366, 363, 414, 414, 0, 70, 414, 71, 0, 0, 364, 365, 47, 370, 358, 352, 362, 49, 364, 348, 362, 354, 351, 358, 344, 354, 342, 337, 352, 341, 50, 348, 51, 336, 340, 338, 347, 355, 348, 330, 332, 336, 329, 38, 343, 342, 332, 336, 349, 328, 328, 321, 319, 328, 329, 316, 331, 326, 349, 53, 313, 327, 314, 318, 331, 319, 318, 341, 316, 313, 302, 302, 306, 315, 311, 298, 296, 297, 306, 314, 291, 295, 304, 305, 70, 287, 299, 314, 297, 286, 304, 317, 294, 275, 284, 290, 281, 276, 274, 274, 285, 274, 0, 266, 0, 282, 271, 0, 280, 281, 268, 0, 267, 268, 268, 257, 268, 270, 259, 264, 265, 258, 268, 0, 262, 253, 257, 255, 257, 274, 248, 247, 280, 250, 256, 245, 263, 242, 275, 239, 238, 245, 241, 235, 246, 249, 239, 239, 233, 229, 263, 235, 238, 225, 240, 235, 223, 0, 237, 243, 235, 223, 229, 251, 223, 0, 227, 227, 216, 215, 217, 221, 243, 212, 206, 217, 209, 211, 72, 214, 213, 0, 207, 203, 0, 210, 197, 0, 196, 202, 202, 194, 204, 0, 198, 192, 0, 201, 216, 186, 202, 0, 192, 194, 0, 185, 0, 187, 189, 207, 184, 0, 194, 182, 178, 183, 207, 201, 182, 172, 207, 185, 180, 73, 179, 168, 166, 180, 198, 184, 161, 161, 175, 172, 158, 0, 172, 159, 161, 161, 161, 0, 156, 151, 163, 156, 0, 158, 160, 146, 145, 152, 58, 0, 142, 144, 152, 140, 145, 142, 148, 135, 134, 146, 133, 131, 130, 129, 140, 0, 128, 142, 125, 118, 0, 144, 154, 0, 0, 77, 127, 132, 0, 140, 0, 126, 129, 0, 0, 0, 118, 0, 127, 118, 112, 124, 127, 122, 111, 105, 111, 108, 106, 0, 127, 108, 102, 108, 105, 115, 102, 102, 112, 107, 106, 107, 0, 91, 91, 97, 125, 0, 95, 87, 87, 85, 96, 104, 0, 77, 0, 106, 81, 82, 0, 86, 69, 84, 66, 70, 75, 76, 69, 64, 66, 0, 0, 72, 73, 0, 0, 68, 0, 414, 120, 123, 126, 96 } ; static yyconst flex_int16_t yy_def[386] = { 0, 381, 1, 381, 381, 381, 381, 382, 383, 384, 381, 381, 381, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 381, 381, 382, 383, 381, 383, 384, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 0, 381, 381, 381, 381 } ; static yyconst flex_int16_t yy_nxt[471] = { 0, 4, 5, 6, 7, 8, 9, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 14, 20, 21, 22, 14, 23, 24, 25, 26, 27, 14, 28, 29, 4, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 30, 31, 34, 38, 40, 47, 41, 43, 39, 42, 49, 44, 54, 58, 48, 45, 55, 59, 61, 46, 34, 34, 50, 62, 68, 63, 74, 88, 35, 92, 104, 105, 69, 106, 122, 148, 89, 236, 273, 300, 75, 93, 90, 301, 37, 123, 35, 35, 323, 380, 324, 149, 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, 237, 274, 32, 367, 32, 33, 366, 33, 36, 365, 36, 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 299, 298, 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, 275, 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 91, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 73, 72, 71, 70, 67, 66, 65, 64, 60, 57, 56, 53, 52, 51, 381, 3, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381 } ; static yyconst flex_int16_t yy_chk[471] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 13, 15, 17, 15, 16, 13, 15, 18, 16, 22, 25, 17, 16, 22, 25, 27, 16, 33, 35, 18, 27, 40, 27, 45, 58, 8, 60, 71, 71, 40, 71, 87, 112, 58, 206, 251, 280, 45, 60, 58, 280, 385, 87, 33, 35, 307, 379, 307, 112, 376, 375, 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 206, 251, 382, 361, 382, 383, 360, 383, 384, 359, 384, 357, 355, 354, 353, 352, 351, 350, 348, 347, 346, 345, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 318, 314, 313, 311, 309, 308, 304, 303, 301, 300, 299, 298, 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, 282, 279, 278, 277, 276, 275, 273, 272, 271, 270, 268, 267, 266, 265, 264, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 238, 237, 236, 235, 233, 231, 230, 228, 227, 226, 225, 223, 222, 220, 219, 218, 217, 216, 214, 213, 211, 210, 208, 207, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 192, 191, 190, 189, 188, 187, 186, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, 137, 136, 134, 133, 131, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 59, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 44, 43, 42, 41, 39, 38, 29, 28, 26, 24, 23, 21, 20, 19, 3, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381, 381 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected static int yy_more_flag = 0; static int yy_more_len = 0; #define yymore() ((yy_more_flag) = 1) #define YY_MORE_ADJ (yy_more_len) #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "wmllex.l" #line 2 "wmllex.l" /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #if defined(__STDC__) #include #endif #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ #ifdef YY_BUFFER_SIZE #define BUF_SIZE YY_BUFFER_SIZE #else #define BUF_SIZE 8192 #endif char yystringval[BUF_SIZE]; /* any string value */ char yynameval[BUF_SIZE]; /* any identifier (name) */ int yytknval1; /* terminal token value 1 */ int yytknval2; /* terminal token value 2 */ #line 737 "wmllex.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); yy_size_t yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 53 "wmllex.l" #line 954 "wmllex.c" while ( 1 ) /* loops until end-of-file is reached */ { (yy_more_len) = 0; if ( (yy_more_flag) ) { (yy_more_len) = (yy_c_buf_p) - (yytext_ptr); (yy_more_flag) = 0; } yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 382 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 414 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 55 "wmllex.l" {} YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP #line 57 "wmllex.l" { wml_line_count += 1; } YY_BREAK case 3: YY_RULE_SETUP #line 59 "wmllex.l" { return CLASS; } YY_BREAK case 4: YY_RULE_SETUP #line 60 "wmllex.l" { return RESOURCE; } YY_BREAK case 5: YY_RULE_SETUP #line 61 "wmllex.l" { return DATATYPE; } YY_BREAK case 6: YY_RULE_SETUP #line 62 "wmllex.l" { return CONTROLLIST; } YY_BREAK case 7: YY_RULE_SETUP #line 63 "wmllex.l" { return ENUMERATIONSET; } YY_BREAK case 8: YY_RULE_SETUP #line 64 "wmllex.l" { return ENUMERATIONVALUE; } YY_BREAK case 9: YY_RULE_SETUP #line 65 "wmllex.l" { return CHARACTERSET; } YY_BREAK case 10: YY_RULE_SETUP #line 66 "wmllex.l" { return CHILD; } YY_BREAK case 11: YY_RULE_SETUP #line 68 "wmllex.l" { return DOCNAME; } YY_BREAK case 12: YY_RULE_SETUP #line 69 "wmllex.l" { return CONVFUNC; } YY_BREAK case 13: YY_RULE_SETUP #line 70 "wmllex.l" { return ALIAS; } YY_BREAK case 14: YY_RULE_SETUP #line 71 "wmllex.l" { return TYPE; } YY_BREAK case 15: YY_RULE_SETUP #line 72 "wmllex.l" { return RESOURCELITERAL; } YY_BREAK case 16: YY_RULE_SETUP #line 73 "wmllex.l" { return RELATED; } YY_BREAK case 17: YY_RULE_SETUP #line 74 "wmllex.l" { return INTERNALLITERAL; } YY_BREAK case 18: YY_RULE_SETUP #line 75 "wmllex.l" { return CONSTRAINT; } YY_BREAK case 19: YY_RULE_SETUP #line 76 "wmllex.l" { return EXCLUDE;} YY_BREAK case 20: YY_RULE_SETUP #line 77 "wmllex.l" { return RESOURCES; } YY_BREAK case 21: YY_RULE_SETUP #line 78 "wmllex.l" { return SUPERCLASS; } YY_BREAK case 22: YY_RULE_SETUP #line 79 "wmllex.l" { return PARENTCLASS; } YY_BREAK case 23: YY_RULE_SETUP #line 80 "wmllex.l" { return CONTROLS; } YY_BREAK case 24: YY_RULE_SETUP #line 81 "wmllex.l" { return WIDGETCLASS; } YY_BREAK case 25: YY_RULE_SETUP #line 82 "wmllex.l" { return DIALOGCLASS; } YY_BREAK case 26: YY_RULE_SETUP #line 83 "wmllex.l" { return DEFAULT; } YY_BREAK case 27: YY_RULE_SETUP #line 84 "wmllex.l" { return ENUMLITERAL; } YY_BREAK case 28: YY_RULE_SETUP #line 85 "wmllex.l" { return XMSTRINGCHARSETNAME; } YY_BREAK case 29: YY_RULE_SETUP #line 86 "wmllex.l" { return XMSTRINGCHARSETNAME; } YY_BREAK case 30: YY_RULE_SETUP #line 87 "wmllex.l" { return DIRECTION; } YY_BREAK case 31: YY_RULE_SETUP #line 88 "wmllex.l" { return PARSEDIRECTION; } YY_BREAK case 32: YY_RULE_SETUP #line 89 "wmllex.l" { return CHARACTERSIZE; } YY_BREAK case 33: YY_RULE_SETUP #line 90 "wmllex.l" { return CTRLMAPSRESOURCE; } YY_BREAK case 34: YY_RULE_SETUP #line 91 "wmllex.l" { return CHILDREN; } YY_BREAK case 35: YY_RULE_SETUP #line 93 "wmllex.l" { return METACLASS;} YY_BREAK case 36: YY_RULE_SETUP #line 94 "wmllex.l" { return WIDGET;} YY_BREAK case 37: YY_RULE_SETUP #line 95 "wmllex.l" { return GADGET;} YY_BREAK case 38: YY_RULE_SETUP #line 96 "wmllex.l" { return ARGUMENT;} YY_BREAK case 39: YY_RULE_SETUP #line 97 "wmllex.l" { return REASON;} YY_BREAK case 40: YY_RULE_SETUP #line 98 "wmllex.l" { return SUBRESOURCE;} YY_BREAK case 41: YY_RULE_SETUP #line 99 "wmllex.l" { return ATTRTRUE; } YY_BREAK case 42: YY_RULE_SETUP #line 100 "wmllex.l" { return ATTRFALSE; } YY_BREAK case 43: YY_RULE_SETUP #line 101 "wmllex.l" { return LEFTTORIGHT; } YY_BREAK case 44: YY_RULE_SETUP #line 102 "wmllex.l" { return RIGHTTOLEFT; } YY_BREAK case 45: YY_RULE_SETUP #line 103 "wmllex.l" { return ONEBYTE; } YY_BREAK case 46: YY_RULE_SETUP #line 104 "wmllex.l" { return TWOBYTE; } YY_BREAK case 47: YY_RULE_SETUP #line 105 "wmllex.l" { return MIXED1_2BYTE; } YY_BREAK case 48: YY_RULE_SETUP #line 107 "wmllex.l" { return COLON; } YY_BREAK case 49: YY_RULE_SETUP #line 108 "wmllex.l" { return SEMICOLON; } YY_BREAK case 50: YY_RULE_SETUP #line 109 "wmllex.l" { return EQUALS; } YY_BREAK case 51: YY_RULE_SETUP #line 110 "wmllex.l" { return LBRACE; } YY_BREAK case 52: YY_RULE_SETUP #line 111 "wmllex.l" { return RBRACE; } YY_BREAK case 53: YY_RULE_SETUP #line 113 "wmllex.l" {} YY_BREAK case 54: YY_RULE_SETUP #line 115 "wmllex.l" {} YY_BREAK case 55: YY_RULE_SETUP #line 117 "wmllex.l" { /* string without quotes */ strcpy (yystringval, (XmConst char *) yytext); return STRING; } YY_BREAK case 56: YY_RULE_SETUP #line 122 "wmllex.l" { /* escaped character in the string */ yymore(); } YY_BREAK case 57: YY_RULE_SETUP #line 126 "wmllex.l" { /* String in quotes */ strncpy(yystringval, (XmConst char *) yytext+1, yyleng - 2); yystringval[yyleng-2] = '\0' ; return STRING; } YY_BREAK case 58: YY_RULE_SETUP #line 131 "wmllex.l" { printf ("\nUnterminated string near %s, line %d", yytext, wml_line_count); return ERRORTOKEN; } YY_BREAK case 59: YY_RULE_SETUP #line 137 "wmllex.l" { printf ("\nEncountered illegal character '%c', line %d", yytext[0], wml_line_count); return ERRORTOKEN; } YY_BREAK case 60: YY_RULE_SETUP #line 142 "wmllex.l" ECHO; YY_BREAK #line 1335 "wmllex.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 382 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 382 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 381); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 141 "wmllex.l" motif-2.3.8/tools/wml/UilSymEnum.h0000644000175000017500000006600313211513006013737 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* * Enumeration value vectors for each enumeration set */ static unsigned short int enum_value_vec1[] = { 73, 76, 72, }; static unsigned short int enum_value_vec2[] = { 98, 95, 96, 97, }; static unsigned short int enum_value_vec3[] = { 86, 83, 93, 88, 87, }; static unsigned short int enum_value_vec4[] = { 94, 89, }; static unsigned short int enum_value_vec5[] = { 91, 90, 84, 92, 85, }; static unsigned short int enum_value_vec6[] = { 102, 101, 103, 107, 104, 105, 106, }; static unsigned short int enum_value_vec7[] = { 249, 114, }; static unsigned short int enum_value_vec8[] = { 110, 109, }; static unsigned short int enum_value_vec9[] = { 252, 111, 40, 62, }; static unsigned short int enum_value_vec10[] = { 61, 63, 1, }; static unsigned short int enum_value_vec11[] = { 330, 332, 285, }; static unsigned short int enum_value_vec12[] = { 40, 62, }; static unsigned short int enum_value_vec13[] = { 290, 288, 289, }; static unsigned short int enum_value_vec14[] = { 71, 73, 70, 78, 79, }; static unsigned short int enum_value_vec15[] = { 225, 354, }; static unsigned short int enum_value_vec16[] = { 127, 165, 166, }; static unsigned short int enum_value_vec17[] = { 128, 129, }; static unsigned short int enum_value_vec18[] = { 348, 337, 347, 338, 345, 342, 341, 349, 340, 339, 343, 344, 346, }; static unsigned short int enum_value_vec19[] = { 390, 389, }; static unsigned short int enum_value_vec20[] = { 322, }; static unsigned short int enum_value_vec21[] = { 137, 139, 143, 146, 148, 153, 154, }; static unsigned short int enum_value_vec22[] = { 134, 391, 164, }; static unsigned short int enum_value_vec23[] = { 155, 149, 147, 159, 142, 136, }; static unsigned short int enum_value_vec24[] = { 150, 152, 159, 141, 140, 144, 145, 151, 157, 158, 156, 138, }; static unsigned short int enum_value_vec25[] = { 34, 33, 35, }; static unsigned short int enum_value_vec26[] = { 4, 5, 6, 3, }; static unsigned short int enum_value_vec27[] = { 18, 17, 16, 15, 14, }; static unsigned short int enum_value_vec28[] = { 12, 11, 10, 8, 9, }; static unsigned short int enum_value_vec29[] = { 22, 27, 26, }; static unsigned short int enum_value_vec30[] = { 32, 20, 19, }; static unsigned short int enum_value_vec31[] = { 21, 23, }; static unsigned short int enum_value_vec32[] = { 7, 13, 2, }; static unsigned short int enum_value_vec33[] = { 24, 25, }; static unsigned short int enum_value_vec34[] = { 30, 31, 28, 29, }; static unsigned short int enum_value_vec35[] = { 37, 38, 39, 36, }; static unsigned short int enum_value_vec36[] = { 326, 172, }; static unsigned short int enum_value_vec37[] = { 325, 246, }; static unsigned short int enum_value_vec38[] = { 218, 328, 80, }; static unsigned short int enum_value_vec39[] = { 175, 174, 173, }; static unsigned short int enum_value_vec40[] = { 192, 190, 191, 189, }; static unsigned short int enum_value_vec41[] = { 99, 181, 182, 183, }; static unsigned short int enum_value_vec42[] = { 186, 188, 187, }; static unsigned short int enum_value_vec43[] = { 112, 270, 132, 200, }; static unsigned short int enum_value_vec44[] = { 218, 328, }; static unsigned short int enum_value_vec45[] = { 217, 213, 216, 212, 215, 214, }; static unsigned short int enum_value_vec46[] = { 258, 260, 262, 261, }; static unsigned short int enum_value_vec47[] = { 60, 41, }; static unsigned short int enum_value_vec48[] = { 276, 277, 210, }; static unsigned short int enum_value_vec49[] = { 171, 291, }; static unsigned short int enum_value_vec50[] = { 336, 279, 280, }; static unsigned short int enum_value_vec51[] = { 303, 222, 302, 221, 383, 382, 119, 118, 381, 117, 301, 220, 133, }; static unsigned short int enum_value_vec52[] = { 263, 331, 135, }; static unsigned short int enum_value_vec53[] = { 99, 324, 163, 323, 162, 253, }; static unsigned short int enum_value_vec54[] = { 131, 395, 299, }; static unsigned short int enum_value_vec55[] = { 99, 224, 223, }; static unsigned short int enum_value_vec56[] = { 295, 211, }; static unsigned short int enum_value_vec57[] = { 243, 244, }; static unsigned short int enum_value_vec58[] = { 45, 46, 50, 51, 48, 49, 47, }; static unsigned short int enum_value_vec59[] = { 52, 55, 54, 49, 47, 53, }; static unsigned short int enum_value_vec60[] = { 57, 58, 59, 56, }; static unsigned short int enum_value_vec61[] = { 249, 371, 335, 169, }; static unsigned short int enum_value_vec62[] = { 274, 226, 241, 334, 275, }; static unsigned short int enum_value_vec63[] = { 68, 296, }; static unsigned short int enum_value_vec64[] = { 254, 396, 198, }; static unsigned short int enum_value_vec65[] = { 265, 264, }; static unsigned short int enum_value_vec66[] = { 126, 170, }; static unsigned short int enum_value_vec67[] = { 255, 273, 271, 272, }; static unsigned short int enum_value_vec68[] = { 219, 180, }; static unsigned short int enum_value_vec69[] = { 399, 259, }; static unsigned short int enum_value_vec70[] = { 293, 294, }; static unsigned short int enum_value_vec71[] = { 268, 266, 267, 269, }; static unsigned short int enum_value_vec72[] = { 233, 230, 231, 232, }; static unsigned short int enum_value_vec73[] = { 300, 297, 298, }; static unsigned short int enum_value_vec74[] = { 398, 235, 238, 237, 236, }; static unsigned short int enum_value_vec75[] = { 249, 248, 247, 40, 62, }; static unsigned short int enum_value_vec76[] = { 100, 333, }; static unsigned short int enum_value_vec77[] = { 379, 115, 380, 116, }; static unsigned short int enum_value_vec78[] = { 199, 397, 130, 239, 305, 306, 256, 124, 193, }; static unsigned short int enum_value_vec79[] = { 108, 82, }; static unsigned short int enum_value_vec80[] = { 250, 69, }; static unsigned short int enum_value_vec81[] = { 326, 245, 172, 120, }; static unsigned short int enum_value_vec82[] = { 227, 229, 228, 384, 385, }; static unsigned short int enum_value_vec83[] = { 324, 163, 323, 162, 253, 316, 318, 317, 319, }; static unsigned short int enum_value_vec84[] = { 320, 321, 316, 318, }; static unsigned short int enum_value_vec85[] = { 167, 234, 242, 40, 62, }; static unsigned short int enum_value_vec86[] = { 249, 168, 376, 304, }; static unsigned short int enum_value_vec87[] = { 113, 185, 386, 315, }; static unsigned short int enum_value_vec88[] = { 327, 375, }; static unsigned short int enum_value_vec89[] = { 81, 125, 179, }; static unsigned short int enum_value_vec90[] = { 197, 196, 195, }; static unsigned short int enum_value_vec91[] = { 249, 329, 122, }; static unsigned short int enum_value_vec92[] = { 249, 194, 121, }; static unsigned short int enum_value_vec93[] = { 336, 257, }; static unsigned short int enum_value_vec94[] = { 351, 352, }; static unsigned short int enum_value_vec95[] = { 374, 373, }; static unsigned short int enum_value_vec96[] = { 351, 352, 353, 350, 133, }; static unsigned short int enum_value_vec97[] = { 311, 312, 313, 309, 308, 310, }; static unsigned short int enum_value_vec98[] = { 209, 208, 203, 204, 205, 206, 207, 40, 62, }; static unsigned short int enum_value_vec99[] = { 377, 378, }; static unsigned short int enum_value_vec100[] = { 394, 314, 202, 40, 62, }; static unsigned short int enum_value_vec101[] = { 278, 66, 64, 67, 65, 201, 123, 240, 292, 184, }; static unsigned short int enum_value_vec102[] = { 393, 392, }; static unsigned short int enum_value_vec103[] = { 71, 73, 70, 75, 74, }; static unsigned short int enum_value_vec104[] = { 307, 251, }; static unsigned short int enum_value_vec105[] = { 395, 131, }; static unsigned short int enum_value_vec106[] = { 72, 73, 76, 77, }; static unsigned short int enum_value_vec107[] = { 161, 160, }; static unsigned short int enum_value_vec108[] = { 178, 176, 177, }; static unsigned short int enum_value_vec109[] = { 287, 281, 286, 282, 283, 284, }; static unsigned short int enum_value_vec110[] = { 370, 369, }; static unsigned short int enum_value_vec111[] = { 355, 366, 367, }; static unsigned short int enum_value_vec112[] = { 372, 363, 358, 368, 357, }; static unsigned short int enum_value_vec113[] = { 362, 359, 361, 360, }; static unsigned short int enum_value_vec114[] = { 365, 364, 356, }; static unsigned short int enum_value_vec115[] = { 388, 387, 387, }; static unsigned short int enum_value_vec116[] = { 44, 43, 42, }; /* * Enumeration set descriptor table */ static UilEnumSetDescDef enum_set_table_vec[] = { {0,NULL}, {3,enum_value_vec1}, {4,enum_value_vec2}, {5,enum_value_vec3}, {2,enum_value_vec4}, {5,enum_value_vec5}, {7,enum_value_vec6}, {2,enum_value_vec7}, {2,enum_value_vec8}, {4,enum_value_vec9}, {3,enum_value_vec10}, {3,enum_value_vec11}, {2,enum_value_vec12}, {3,enum_value_vec13}, {5,enum_value_vec14}, {2,enum_value_vec15}, {3,enum_value_vec16}, {2,enum_value_vec17}, {13,enum_value_vec18}, {2,enum_value_vec19}, {1,enum_value_vec20}, {7,enum_value_vec21}, {3,enum_value_vec22}, {6,enum_value_vec23}, {12,enum_value_vec24}, {3,enum_value_vec25}, {4,enum_value_vec26}, {5,enum_value_vec27}, {5,enum_value_vec28}, {3,enum_value_vec29}, {3,enum_value_vec30}, {2,enum_value_vec31}, {3,enum_value_vec32}, {2,enum_value_vec33}, {4,enum_value_vec34}, {4,enum_value_vec35}, {2,enum_value_vec36}, {2,enum_value_vec37}, {3,enum_value_vec38}, {3,enum_value_vec39}, {4,enum_value_vec40}, {4,enum_value_vec41}, {3,enum_value_vec42}, {4,enum_value_vec43}, {2,enum_value_vec44}, {6,enum_value_vec45}, {4,enum_value_vec46}, {2,enum_value_vec47}, {3,enum_value_vec48}, {2,enum_value_vec49}, {3,enum_value_vec50}, {13,enum_value_vec51}, {3,enum_value_vec52}, {6,enum_value_vec53}, {3,enum_value_vec54}, {3,enum_value_vec55}, {2,enum_value_vec56}, {2,enum_value_vec57}, {7,enum_value_vec58}, {6,enum_value_vec59}, {4,enum_value_vec60}, {4,enum_value_vec61}, {5,enum_value_vec62}, {2,enum_value_vec63}, {3,enum_value_vec64}, {2,enum_value_vec65}, {2,enum_value_vec66}, {4,enum_value_vec67}, {2,enum_value_vec68}, {2,enum_value_vec69}, {2,enum_value_vec70}, {4,enum_value_vec71}, {4,enum_value_vec72}, {3,enum_value_vec73}, {5,enum_value_vec74}, {5,enum_value_vec75}, {2,enum_value_vec76}, {4,enum_value_vec77}, {9,enum_value_vec78}, {2,enum_value_vec79}, {2,enum_value_vec80}, {4,enum_value_vec81}, {5,enum_value_vec82}, {9,enum_value_vec83}, {4,enum_value_vec84}, {5,enum_value_vec85}, {4,enum_value_vec86}, {4,enum_value_vec87}, {2,enum_value_vec88}, {3,enum_value_vec89}, {3,enum_value_vec90}, {3,enum_value_vec91}, {3,enum_value_vec92}, {2,enum_value_vec93}, {2,enum_value_vec94}, {2,enum_value_vec95}, {5,enum_value_vec96}, {6,enum_value_vec97}, {9,enum_value_vec98}, {2,enum_value_vec99}, {5,enum_value_vec100}, {10,enum_value_vec101}, {2,enum_value_vec102}, {5,enum_value_vec103}, {2,enum_value_vec104}, {2,enum_value_vec105}, {4,enum_value_vec106}, {2,enum_value_vec107}, {3,enum_value_vec108}, {6,enum_value_vec109}, {2,enum_value_vec110}, {3,enum_value_vec111}, {5,enum_value_vec112}, {4,enum_value_vec113}, {3,enum_value_vec114}, {3,enum_value_vec115}, {3,enum_value_vec116}, }; externaldef(uil_sym_glbl) UilEnumSetDescDef *enum_set_table = enum_set_table_vec; /* * Enumeration set table, accessed by sym_k_..._arg code. Each non-zero entry * is the sym_k_..._enumset code for the argument's enumeration set. */ static unsigned short int argument_enumset_table_vec[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 29, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 0, 0, 7, 0, 8, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 13, 42, 14, 0, 0, 0, 0, 15, 0, 0, 0, 0, 16, 0, 0, 0, 17, 115, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 21, 0, 106, 0, 0, 108, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 107, 0, 37, 0, 0, 0, 1, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 103, 38, 0, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 40, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, 46, 0, 0, 0, 47, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 51, 52, 6, 0, 0, 0, 0, 0, 0, 116, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 58, 59, 60, 0, 61, 0, 0, 0, 0, 0, 0, 43, 62, 0, 0, 0, 0, 63, 0, 0, 0, 0, 64, 0, 65, 0, 0, 20, 66, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, 0, 0, 0, 0, 0, 0, 68, 69, 70, 0, 0, 71, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 6, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 77, 0, 0, 0, 0, 78, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 0, 0, 83, 100, 0, 84, 101, 85, 0, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, 86, 0, 0, 87, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 90, 91, 92, 93, 0, 0, 53, 94, 0, 0, 1, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 111, 0, 112, 109, 0, 0, 113, 94, 114, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 101, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, }; externaldef(uil_sym_glbl) unsigned short int *argument_enumset_table = argument_enumset_table_vec; /* * Enumeration value table, accessed by sym_k_..._enumval code. Each entry is * the actual value associated with the code. */ static int enumval_values_table_vec[] = { 0, Always, DtHELP_AS_NEEDED_SCROLLBARS, DtHELP_EXECUTE_ALL, DtHELP_EXECUTE_NONE, DtHELP_EXECUTE_QUERY_ALL, DtHELP_EXECUTE_QUERY_UNALIASED, DtHELP_NO_SCROLLBARS, DtHELP_PAPERSIZE_A4, DtHELP_PAPERSIZE_B5, DtHELP_PAPERSIZE_EXECUTIVE, DtHELP_PAPERSIZE_LEGAL, DtHELP_PAPERSIZE_LETTER, DtHELP_STATIC_SCROLLBARS, DtHELP_TYPE_DYNAMIC_STRING, DtHELP_TYPE_FILE, DtHELP_TYPE_MAN_PAGE, DtHELP_TYPE_STRING, DtHELP_TYPE_TOPIC, DtLONG_NAME, DtMEDIUM_NAME, DtPRINT_CLOSE_CONNECTION, DtPRINT_NO_DESTINATION, DtPRINT_RELEASE_CONNECTION, DtPRINT_SETUP_PLAIN, DtPRINT_SETUP_XP, DtPRINT_TO_FILE, DtPRINT_TO_PRINTER, DtSHADOW_ETCHED_IN, DtSHADOW_ETCHED_OUT, DtSHADOW_IN, DtSHADOW_OUT, DtSHORT_NAME, DtTERM_CHAR_CURSOR_BAR, DtTERM_CHAR_CURSOR_BOX, DtTERM_CHAR_CURSOR_INVISIBLE, DtWORK_AREA_BOTTOM, DtWORK_AREA_NONE, DtWORK_AREA_TOP, DtWORK_AREA_TOP_AND_BOTTOM, FALSE, IconicState, LineDoubleDash, LineOnOffDash, LineSolid, MWM_DECOR_ALL, MWM_DECOR_BORDER, MWM_DECOR_MAXIMIZE, MWM_DECOR_MENU, MWM_DECOR_MINIMIZE, MWM_DECOR_RESIZEH, MWM_DECOR_TITLE, MWM_FUNC_ALL, MWM_FUNC_CLOSE, MWM_FUNC_MOVE, MWM_FUNC_RESIZE, MWM_INPUT_FULL_APPLICATION_MODAL, MWM_INPUT_MODELESS, MWM_INPUT_PRIMARY_APPLICATION_MODAL, MWM_INPUT_SYSTEM_MODAL, NormalState, NotUseful, TRUE, WhenMapped, Xm1000TH_INCHES, Xm100TH_FONT_UNITS, Xm100TH_MILLIMETERS, Xm100TH_POINTS, XmABSOLUTE, XmADD_MODE, XmALIGNMENT_BASELINE_BOTTOM, XmALIGNMENT_BASELINE_TOP, XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER, XmALIGNMENT_CONTENTS_BOTTOM, XmALIGNMENT_CONTENTS_TOP, XmALIGNMENT_END, XmALIGNMENT_UNSPECIFIED, XmALIGNMENT_WIDGET_BOTTOM, XmALIGNMENT_WIDGET_TOP, XmANY_ICON, XmAPPEND, XmAPPLICATION_DEFINED, XmARROWS_BEGINNING, XmARROWS_DECREMENT_SENSITIVE, XmARROWS_DEFAULT_SENSITIVITY, XmARROWS_END, XmARROWS_FLAT_BEGINNING, XmARROWS_FLAT_END, XmARROWS_HORIZONTAL, XmARROWS_INCREMENT_SENSITIVE, XmARROWS_INSENSITIVE, XmARROWS_SENSITIVE, XmARROWS_SPLIT, XmARROWS_VERTICAL, XmARROW_DOWN, XmARROW_LEFT, XmARROW_RIGHT, XmARROW_UP, XmAS_IS, XmAS_NEEDED, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_OPPOSITE_FORM, XmATTACH_OPPOSITE_WIDGET, XmATTACH_POSITION, XmATTACH_SELF, XmATTACH_WIDGET, XmAUTOMATIC, XmAUTO_DRAG_DISABLED, XmAUTO_DRAG_ENABLED, XmAUTO_SELECT, XmAlwaysOpen, XmBACKGROUND_COLOR, XmBELL, XmBOTTOM_LEFT, XmBOTTOM_RIGHT, XmBOTTOM_TO_TOP, XmBOTTOM_TO_TOP_LEFT_TO_RIGHT, XmBOTTOM_TO_TOP_RIGHT_TO_LEFT, XmBROWSE_SELECT, XmCELLS, XmCENTER, XmCENTIMETERS, XmCLIP_WINDOW, XmCLOSEST, XmCOLLAPSED, XmCOMBO_BOX, XmCOMMAND_ABOVE_WORKSPACE, XmCOMMAND_BELOW_WORKSPACE, XmCOMMAND_WINDOW, XmCONSTANT, XmClosed, XmDEFAULT_DIRECTION, XmDESTROY, XmDETAIL, XmDIALOG_APPLICATION_MODAL, XmDIALOG_CANCEL_BUTTON, XmDIALOG_COMMAND, XmDIALOG_DEFAULT_BUTTON, XmDIALOG_ERROR, XmDIALOG_FILE_SELECTION, XmDIALOG_FULL_APPLICATION_MODAL, XmDIALOG_HELP_BUTTON, XmDIALOG_INFORMATION, XmDIALOG_MESSAGE, XmDIALOG_MESSAGE_LABEL, XmDIALOG_MODELESS, XmDIALOG_OK_BUTTON, XmDIALOG_PRIMARY_APPLICATION_MODAL, XmDIALOG_PROMPT, XmDIALOG_QUESTION, XmDIALOG_SELECTION, XmDIALOG_SEPARATOR, XmDIALOG_SYMBOL_LABEL, XmDIALOG_SYSTEM_MODAL, XmDIALOG_TEMPLATE, XmDIALOG_WARNING, XmDIALOG_WORKING, XmDIALOG_WORK_AREA, XmDISTRIBUTE_SPREAD, XmDISTRIBUTE_TIGHT, XmDOUBLE_DASHED_LINE, XmDOUBLE_LINE, XmDO_NOTHING, XmDROP_DOWN_COMBO_BOX, XmDROP_DOWN_LIST, XmEACH_SIDE, XmETCHED_LINE, XmEXCLUSIVE_TAB_GROUP, XmEXPANDED, XmEXPLICIT, XmEXTENDED_SELECT, XmFILE_ANY_TYPE, XmFILE_DIRECTORY, XmFILE_REGULAR, XmFILL_FLUSH, XmFILL_RAGGED, XmFILL_UNSPECIFIED, XmFIRST_FIT, XmFIRST_POSITION, XmFONT_IS_FONT, XmFONT_IS_FONTSET, XmFONT_IS_XFT, XmFONT_UNITS, XmFOREGROUND_COLOR, XmFRAME_GENERIC_CHILD, XmFRAME_TITLE_CHILD, XmFRAME_WORKAREA_CHILD, XmFillAll, XmFillMajor, XmFillMinor, XmFillNone, XmGENERIC_CHILD, XmGRID, XmGROW_BALANCED, XmGROW_MAJOR, XmGROW_MINOR, XmHORIZONTAL, XmHOR_SCROLLBAR, XmHidden, XmINCHES, XmINDETERMINATE, XmINDICATOR_BOX, XmINDICATOR_CHECK, XmINDICATOR_CHECK_BOX, XmINDICATOR_CROSS, XmINDICATOR_CROSS_BOX, XmINDICATOR_FILL, XmINDICATOR_NONE, XmINHERIT_POLICY, XmINVALID_MATCH_BEHAVIOR, XmIconBottom, XmIconLeft, XmIconNone, XmIconOnly, XmIconRight, XmIconTop, XmLARGE_ICON, XmLAST_POSITION, XmLEFT_TO_RIGHT, XmLEFT_TO_RIGHT_BOTTOM_TO_TOP, XmLEFT_TO_RIGHT_TOP_TO_BOTTOM, XmLOAD_DEFERRED, XmLOAD_IMMEDIATE, XmListMode, XmMAJOR_TAB, XmMARQUEE, XmMARQUEE_EXTEND_BOTH, XmMARQUEE_EXTEND_START, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT, XmMAX_ON_RIGHT, XmMAX_ON_TOP, XmMAX_SIDE, XmMENU_BAR, XmMENU_OPTION, XmMENU_POPUP, XmMENU_PULLDOWN, XmMESSAGE_WINDOW, XmMILLIMETERS, XmMINOR_TAB, XmMIN_SIDE, XmMULTICLICK_DISCARD, XmMULTICLICK_KEEP, XmMULTIPLE_SELECT, XmMULTI_LINE_EDIT, XmNEAR_BORDER, XmNEAR_SLIDER, XmNONE, XmNORMAL_MODE, XmNOT_SELECTED, XmNO_AUTO_SELECT, XmNO_LINE, XmNO_ORIENTATION, XmNO_PACKING, XmNO_SCROLL, XmNUMERIC, XmN_OF_MANY, XmONE_BASED, XmONE_OF_MANY, XmONE_OF_MANY_DIAMOND, XmONE_OF_MANY_ROUND, XmOUTLINE, XmOUTLINE_BUTTON_ABSENT, XmOUTLINE_BUTTON_PRESENT, XmOWN_ALWAYS, XmOWN_MULTIPLE, XmOWN_NEVER, XmOWN_POSSIBLE_MULTIPLE, XmOpen, XmPACK_COLUMN, XmPACK_NONE, XmPACK_TIGHT, XmPAGE, XmPAGE_SCROLLER, XmPER_SHELL, XmPER_WIDGET, XmPIXELS, XmPIXMAP, XmPIXMAP_AND_STRING, XmPIXMAP_BOTTOM, XmPIXMAP_LEFT, XmPIXMAP_NONE, XmPIXMAP_ONLY, XmPIXMAP_OVERLAP_ONLY, XmPIXMAP_RIGHT, XmPIXMAP_TOP, XmPLACE_ABOVE_SELECTION, XmPLACE_BELOW_SELECTION, XmPLACE_TOP, XmPOINTER, XmPOINTS, XmPOSITION_INDEX, XmPOSITION_VALUE, XmQUICK_NAVIGATE, XmRELATIVE, XmRESIZE_ANY, XmRESIZE_GROW, XmRESIZE_IF_POSSIBLE, XmRESIZE_NONE, XmRIGHT_TO_LEFT, XmRIGHT_TO_LEFT_BOTTOM_TO_TOP, XmRIGHT_TO_LEFT_TOP_TO_BOTTOM, XmROUND_MARK, XmSCROLL_HOR, XmSCROLL_VERT, XmSELECTED, XmSELECT_ALL, XmSELECT_LINE, XmSELECT_PARAGRAPH, XmSELECT_POSITION, XmSELECT_WHITESPACE, XmSELECT_WORD, XmSET, XmSHADOWED_BACKGROUND, XmSHADOW_ETCHED_IN, XmSHADOW_ETCHED_IN_DASH, XmSHADOW_ETCHED_OUT, XmSHADOW_ETCHED_OUT_DASH, XmSHADOW_IN, XmSHADOW_OUT, XmSINGLE, XmSINGLE_DASHED_LINE, XmSINGLE_LINE, XmSINGLE_LINE_EDIT, XmSINGLE_SELECT, XmSLIDER, XmSMALL_ICON, XmSNAP_TO_GRID, XmSOLID, XmSPATIAL, XmSPIRAL, XmSTATIC, XmSTATUS_AREA, XmSTICKY_TAB_GROUP, XmSTRING, XmSTRING_COMPONENT_CHARSET, XmSTRING_COMPONENT_DIRECTION, XmSTRING_COMPONENT_LAYOUT_POP, XmSTRING_COMPONENT_LAYOUT_PUSH, XmSTRING_COMPONENT_LOCALE, XmSTRING_COMPONENT_LOCALE_TEXT, XmSTRING_COMPONENT_RENDITION_BEGIN, XmSTRING_COMPONENT_RENDITION_END, XmSTRING_COMPONENT_SEPARATOR, XmSTRING_COMPONENT_TAB, XmSTRING_COMPONENT_TEXT, XmSTRING_COMPONENT_UNKNOWN, XmSTRING_COMPONENT_WIDECHAR_TEXT, XmSTRING_DIRECTION_DEFAULT, XmSTRING_DIRECTION_L_TO_R, XmSTRING_DIRECTION_R_TO_L, XmSTRING_DIRECTION_UNSET, XmScaleMode, XmTABS_BASIC, XmTABS_BEVELED, XmTABS_BOTTOM_TO_TOP, XmTABS_LEFT_TO_RIGHT, XmTABS_ON_BOTTOM, XmTABS_ON_LEFT, XmTABS_ON_RIGHT, XmTABS_ON_TOP, XmTABS_RIGHT_TO_LEFT, XmTABS_ROUNDED, XmTABS_SQUARED, XmTABS_STACKED, XmTABS_STACKED_STATIC, XmTABS_TOP_TO_BOTTOM, XmTAB_EDGE_BOTTOM_RIGHT, XmTAB_EDGE_TOP_LEFT, XmTAB_GROUP, XmTAB_ORIENTATION_DYNAMIC, XmTEAR_OFF_DISABLED, XmTEAR_OFF_ENABLED, XmTHERMOMETER, XmTHUMB_MARK, XmTOGGLE_BOOLEAN, XmTOGGLE_INDETERMINATE, XmTOP_LEFT, XmTOP_RIGHT, XmTOP_TO_BOTTOM, XmTOP_TO_BOTTOM_LEFT_TO_RIGHT, XmTOP_TO_BOTTOM_RIGHT_TO_LEFT, XmTOUCH_ONLY, XmTOUCH_OVER, XmTROUGH_COLOR, XmTreeCompressLeaves, XmTreeCompressNone, XmTreeDirect, XmTreeLadder, XmUNMAP, XmUNPOST, XmUNPOST_AND_REPLAY, XmUNSET, XmVARIABLE, XmVERTICAL, XmVERT_SCROLLBAR, XmWORK_AREA, XmZERO_BASED, }; externaldef(uil_sym_glbl) int *enumval_values_table = enumval_values_table_vec; motif-2.3.8/tools/wml/UilSymRArg.h0000644000175000017500000001236313211513006013666 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* Related argument table. Each non-zero entry is the code of the related argument. */ static unsigned short int related_argument_table_vec[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 247, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 399, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 565, 0, 0, 568, 571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; externaldef(uil_sym_glbl) unsigned short int *related_argument_table = related_argument_table_vec; motif-2.3.8/tools/wml/wmldbcreate.c0000644000175000017500000004250313145162623014166 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: wmldbcreate.c /main/8 1997/04/14 12:55:30 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This is the program creates binary databases from WML output. */ #include #ifndef X_NOT_STDC_ENV #include #endif #include #include #include #include
#include
#include
#include
#include
#include
#include
#include
/* * User supplied widget public.h and/or private.h files are to be added here * #ifdef for automatic use in uilwmdcreate script file */ /* * End of User supplied widget files */ #include "UilDBDef.h" #include "UilLexPars.h" #include "UilSymGen.h" /* from WML */ #include "UilSymArTy.h" /* from WML */ #include "UilSymRArg.h" /* from WML */ #include "UilSymArTa.h" /* from WML */ #include "UilSymReas.h" /* from WML */ #include "UilSymCtl.h" /* from WML */ #include "UilConst.h" /* from WML */ #include "UilSymNam.h" /* from WML */ #include "UilSymEnum.h" /* from WML */ #include "UilSymCSet.h" /* from WML */ #include "UilUrmClas.h" /* from WML */ #include "UilKeyTab.h" /* from WML */ #include "UilSymChCl.h" /* from WML */ #include "UilSymChTa.h" /* from WML */ void emit_globals(); void emit_header(_db_header_ptr header); void emit_chars(int table_id); void emit_ints_and_string( int table_id); void emit_char_table( int table_id); void emit_length_and_string( int table_id); void emit_shorts( int table_id); void emit_int_and_table_shorts( int table_id); void emit_ints( int table_id); FILE *bfile, *afile; int DEBUG=FALSE; char outfilename[80]; char debugfilename[80]; int main(argc, argv) int argc; char **argv; { _db_header header; strcpy(outfilename, "motif.wmd"); strcpy(debugfilename, "motif.dbg"); for (argc--, argv++; argc; argc--, argv++) { if (strcmp("-debug", *argv) == 0) { DEBUG=TRUE; } else if ((strcmp("-o", *argv) == 0)) { strcpy(outfilename, argv[1]); } } bfile = fopen(outfilename, "w"); if (bfile == (FILE *) NULL) { printf("\nCouldnt't open %s", outfilename); exit (1); } if (DEBUG) { afile = fopen(debugfilename, "w"); if (afile == (FILE *) NULL) { printf("\nCouldn't open %s", debugfilename); exit (1); } } emit_globals(); /* * UilConst * UilSymArty * UilSymCset - parts of it * UilSymChCl */ emit_chars(Constraint_Tab); emit_chars(Argument_Type_Table_Value); emit_chars(Charset_Wrdirection_Table); emit_chars(Charset_Parsdirection_Table); emit_chars(Charset_Charsize_Table); emit_chars(Child_Class_Table); /* * UilKeyTab */ emit_ints_and_string (Key_Table); emit_ints_and_string (Key_Table_Case_Ins); /* * UilSymArTa * UilSymCtl * UilSymReas * UilSymChTa */ emit_char_table (Allowed_Argument_Table); emit_char_table (Allowed_Control_Table); emit_char_table (Allowed_Reason_Table); emit_char_table (Allowed_Child_Table); /* * UilSymCset * UilSymNam * UilUrmClas */ emit_length_and_string (Charset_Xmstring_Names_Table); emit_length_and_string (Charset_Lang_Names_Table); emit_length_and_string (Uil_Widget_Names); emit_length_and_string (Uil_Argument_Names); emit_length_and_string (Uil_Reason_Names); emit_length_and_string (Uil_Enumval_names); emit_length_and_string (Uil_Charset_Names); emit_length_and_string (Uil_Widget_Funcs); emit_length_and_string (Uil_Argument_Toolkit_Names); emit_length_and_string (Uil_Reason_Toolkit_Names); emit_length_and_string (Uil_Children_Names); /* * UilSymCset * UilSymEnum * UilSymRArg * UilUrmClas */ emit_shorts (Charset_Lang_Codes_Table); emit_shorts (Argument_Enum_Set_Table); emit_shorts (Related_Argument_Table); emit_shorts (Uil_Gadget_Funcs); emit_shorts (Uil_Urm_Nondialog_Class); emit_shorts (Uil_Urm_Subtree_Resource); /* * UilSymEnum */ emit_int_and_table_shorts(Enum_Set_Table); /* * UilSymEnum */ emit_ints (Enumval_Values_Table); exit (0); return 0; /* make compiler happy */ } void emit_globals() { _db_globals globals; globals.version = DB_Compiled_Version; globals.uil_max_arg = uil_max_arg; globals.uil_max_charset = uil_max_charset; globals.charset_lang_table_max = charset_lang_table_max; globals.uil_max_object = uil_max_object; globals.uil_max_reason = uil_max_reason; globals.uil_max_enumval = uil_max_enumval; globals.uil_max_enumset = uil_max_enumset; globals.key_k_keyword_count = key_k_keyword_count; globals.key_k_keyword_max_length = key_k_keyword_max_length; globals.uil_max_child = uil_max_child; fwrite (&globals, sizeof (_db_globals), 1, bfile); if (DEBUG) fprintf(afile, "%d %d %d %d %d %d %d %d %d %d ", globals.version, globals.uil_max_arg, globals.uil_max_charset, globals.charset_lang_table_max, globals.uil_max_object, globals.uil_max_reason, globals.uil_max_enumval, globals.uil_max_enumset, globals.key_k_keyword_count, globals.key_k_keyword_max_length); } void emit_header(header) _db_header_ptr header; { fwrite (header, sizeof(_db_header), 1, bfile); if (DEBUG) fprintf(afile, "\n\nTableId=%d, NumEntries=%d, TableSize=%d \n", header->table_id, header->num_items, header->table_size); } void emit_chars(table_id) int table_id; { _db_header header; unsigned char *ptr = NULL; int i; switch (table_id) { case Constraint_Tab: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(constraint_tab_vec); header.num_items = header.table_size; header.table_id = Constraint_Tab; ptr = constraint_tab; break; case Argument_Type_Table_Value: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(argument_type_table_vec); header.num_items = header.table_size; header.table_id = Argument_Type_Table_Value; ptr = argument_type_table; break; case Charset_Wrdirection_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_wrdirection_table_vec); header.num_items = header.table_size; header.table_id = Charset_Wrdirection_Table; ptr = charset_writing_direction_table; break; case Charset_Parsdirection_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_parsdirection_table_vec); header.num_items = header.table_size; header.table_id = Charset_Parsdirection_Table; ptr = charset_parsing_direction_table; break; case Charset_Charsize_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_charsize_table_vec); header.num_items = header.table_size; header.table_id = Charset_Charsize_Table; ptr = charset_character_size_table; break; case Child_Class_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(child_class_table_vec); header.num_items = header.table_size; header.table_id = Child_Class_Table; ptr = child_class_table; break; } emit_header(&header); fwrite (ptr, header.table_size, 1, bfile); if (DEBUG) { for (i=0; i<=header.num_items; i++) { fprintf(afile, "%d ", ptr[i]); } } } void emit_ints_and_string(table_id) int table_id; { _db_header header; key_keytable_entry_type *table = NULL; int i; switch (table_id) { /* * All tables are zero based unless otherwise noted */ case Key_Table: header.table_size = sizeof(key_table_vec); header.num_items = key_k_keyword_count; header.table_id = Key_Table; table = key_table; break; case Key_Table_Case_Ins: header.table_size = sizeof(key_table_case_ins_vec); header.num_items = key_k_keyword_count; header.table_id = Key_Table_Case_Ins; table = key_table_case_ins; break; } emit_header(&header); fwrite (table, header.table_size, 1, bfile); for (i=0; i /* for strcpy() */ #endif #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ #if !defined(__STDC__) /* * Undefine NULL, since it is defined in stdio */ #undef NULL #endif #line 44 "wmlparse.c" #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) /* Default: YYSTYPE is the semantic value type. */ typedef int YYSTYPE; # define YYSTYPE_IS_DECLARED 1 #endif /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #define CLASS 1 #define RESOURCE 2 #define DATATYPE 3 #define CONTROLLIST 4 #define ENUMERATIONSET 5 #define ENUMERATIONVALUE 6 #define CHARACTERSET 7 #define CHILD 50 #define DOCNAME 8 #define CONVFUNC 9 #define ALIAS 10 #define TYPE 11 #define RESOURCELITERAL 12 #define RELATED 13 #define INTERNALLITERAL 14 #define XRMRESOURCE 15 #define EXCLUDE 16 #define RESOURCES 17 #define SUPERCLASS 18 #define CONTROLS 19 #define WIDGETCLASS 20 #define DIALOGCLASS 21 #define DEFAULT 22 #define ENUMLITERAL 23 #define XMSTRINGCHARSETNAME 24 #define DIRECTION 25 #define PARSEDIRECTION 26 #define CHARACTERSIZE 27 #define CTRLMAPSRESOURCE 28 #define CHILDREN 51 #define PARENTCLASS 52 #define METACLASS 29 #define WIDGET 30 #define GADGET 31 #define ARGUMENT 32 #define REASON 33 #define CONSTRAINT 34 #define SUBRESOURCE 35 #define ATTRTRUE 36 #define ATTRFALSE 37 #define LEFTTORIGHT 38 #define RIGHTTOLEFT 39 #define ONEBYTE 40 #define TWOBYTE 41 #define MIXED1_2BYTE 42 #define COLON 43 #define SEMICOLON 44 #define EQUALS 45 #define LBRACE 46 #define RBRACE 47 #define STRING 48 #define ERRORTOKEN 49 #define YYERRCODE 256 typedef short YYINT; static const YYINT yylhs[] = { -1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 2, 11, 11, 13, 11, 3, 14, 14, 16, 14, 4, 17, 17, 19, 17, 5, 20, 20, 22, 20, 6, 23, 23, 25, 23, 7, 26, 26, 28, 26, 8, 29, 29, 31, 29, 9, 32, 32, 34, 32, 38, 12, 36, 36, 36, 37, 37, 37, 40, 37, 39, 39, 43, 41, 46, 41, 41, 41, 41, 50, 41, 42, 42, 42, 42, 42, 42, 42, 42, 44, 45, 45, 47, 51, 51, 51, 53, 51, 52, 52, 56, 54, 57, 54, 55, 55, 55, 59, 55, 58, 58, 62, 60, 64, 60, 65, 60, 61, 61, 63, 48, 66, 66, 66, 68, 66, 67, 67, 71, 69, 72, 69, 70, 70, 73, 70, 49, 74, 74, 74, 76, 74, 75, 75, 78, 77, 79, 77, 82, 15, 80, 80, 80, 80, 81, 81, 81, 84, 81, 83, 83, 87, 85, 89, 85, 90, 85, 86, 86, 86, 86, 86, 86, 86, 86, 88, 18, 92, 21, 91, 91, 91, 94, 91, 93, 93, 97, 95, 98, 95, 96, 96, 96, 100, 24, 99, 99, 99, 102, 99, 101, 101, 105, 103, 106, 103, 104, 104, 107, 104, 110, 27, 108, 109, 109, 109, 112, 109, 111, 111, 114, 113, 115, 113, 117, 30, 116, 116, 116, 119, 116, 118, 118, 122, 120, 123, 120, 121, 125, 33, 124, 124, 124, 127, 124, 126, 126, 130, 128, 133, 128, 134, 128, 129, 129, 129, 131, 131, 131, 132, 132, 132, 132, 132, 35, }; static const YYINT yylen[] = { 2, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 2, 2, 3, 0, 3, 2, 2, 3, 0, 3, 2, 2, 3, 0, 3, 2, 2, 3, 0, 3, 2, 2, 3, 0, 3, 2, 2, 3, 0, 3, 2, 2, 3, 0, 3, 2, 2, 3, 0, 3, 0, 5, 1, 1, 1, 0, 2, 3, 0, 3, 1, 2, 0, 5, 0, 5, 2, 2, 2, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, 3, 0, 3, 1, 2, 0, 4, 0, 3, 0, 2, 3, 0, 3, 1, 2, 0, 5, 0, 5, 0, 3, 1, 1, 1, 2, 0, 2, 3, 0, 3, 1, 2, 0, 4, 0, 3, 0, 2, 0, 3, 2, 0, 2, 3, 0, 3, 1, 2, 0, 3, 0, 3, 0, 5, 1, 1, 1, 1, 0, 2, 3, 0, 3, 1, 2, 0, 5, 0, 5, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 3, 0, 2, 3, 0, 3, 1, 2, 0, 5, 0, 3, 1, 1, 1, 0, 3, 0, 2, 3, 0, 3, 1, 2, 0, 4, 0, 3, 0, 2, 0, 3, 0, 5, 1, 0, 2, 3, 0, 3, 1, 2, 0, 3, 0, 3, 0, 4, 0, 2, 3, 0, 3, 1, 2, 0, 5, 0, 3, 1, 0, 3, 0, 2, 3, 0, 3, 1, 2, 0, 5, 0, 5, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const YYINT yydefred[] = { 1, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 16, 257, 0, 0, 0, 21, 0, 0, 0, 31, 0, 0, 170, 36, 0, 0, 186, 41, 0, 0, 0, 46, 0, 0, 0, 51, 0, 0, 231, 26, 0, 0, 0, 12, 0, 0, 14, 0, 0, 0, 19, 0, 0, 0, 29, 0, 0, 0, 34, 0, 0, 0, 39, 0, 0, 0, 44, 217, 0, 0, 49, 0, 0, 0, 24, 0, 17, 15, 55, 56, 57, 53, 22, 20, 143, 144, 145, 146, 141, 32, 30, 175, 0, 171, 37, 35, 191, 0, 187, 42, 40, 205, 203, 47, 45, 0, 52, 50, 236, 0, 232, 27, 25, 169, 0, 0, 0, 181, 184, 183, 185, 173, 0, 177, 0, 0, 197, 189, 195, 0, 193, 0, 222, 0, 218, 0, 244, 247, 246, 248, 249, 250, 251, 234, 0, 238, 0, 0, 61, 0, 54, 150, 0, 142, 176, 0, 174, 178, 0, 192, 0, 0, 190, 194, 209, 0, 204, 0, 228, 230, 220, 0, 224, 0, 237, 0, 235, 239, 0, 0, 0, 72, 77, 78, 81, 76, 0, 74, 0, 79, 82, 80, 0, 75, 59, 0, 63, 0, 0, 0, 0, 0, 0, 158, 162, 165, 167, 160, 161, 164, 163, 168, 166, 148, 0, 152, 0, 0, 182, 179, 198, 201, 0, 0, 0, 215, 207, 213, 0, 211, 223, 0, 221, 225, 0, 245, 240, 252, 253, 254, 255, 256, 242, 62, 0, 89, 0, 85, 117, 0, 113, 133, 0, 129, 60, 64, 0, 0, 69, 70, 71, 151, 0, 149, 153, 0, 0, 0, 0, 200, 196, 210, 0, 0, 208, 212, 229, 226, 0, 0, 73, 0, 95, 87, 93, 0, 91, 0, 123, 115, 121, 0, 119, 0, 139, 131, 137, 0, 135, 65, 83, 84, 67, 159, 154, 156, 180, 202, 216, 214, 0, 241, 243, 90, 0, 0, 88, 92, 118, 0, 0, 116, 120, 134, 0, 0, 132, 136, 0, 0, 0, 0, 227, 96, 100, 0, 0, 124, 127, 0, 0, 140, 138, 66, 68, 155, 157, 0, 108, 110, 112, 111, 98, 0, 102, 0, 0, 94, 0, 126, 122, 101, 0, 99, 103, 0, 0, 128, 109, 104, 106, 0, 0, 105, 107, }; static const YYINT yydgoto[] = { 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 55, 27, 28, 59, 51, 52, 83, 31, 32, 63, 35, 36, 67, 39, 40, 71, 43, 44, 75, 47, 48, 79, 25, 92, 161, 125, 206, 191, 207, 208, 339, 209, 313, 340, 210, 211, 212, 255, 258, 296, 292, 297, 347, 326, 325, 364, 358, 365, 366, 382, 367, 383, 373, 261, 302, 298, 303, 351, 331, 330, 369, 264, 308, 304, 309, 336, 335, 99, 164, 126, 225, 213, 226, 227, 341, 228, 342, 273, 104, 66, 133, 127, 134, 135, 278, 166, 109, 70, 140, 136, 141, 234, 172, 171, 279, 113, 177, 142, 239, 235, 240, 284, 283, 145, 116, 182, 178, 183, 184, 321, 242, 121, 82, 155, 146, 156, 157, 289, 158, 253, 290, 186, }; static const YYINT yysindex[] = { 0, 116, 0, -22, -16, 12, 53, 65, 81, 87, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 0, -20, 2, 100, 0, -20, 108, 110, 0, -20, 114, 0, 0, -20, 121, 0, 0, -20, 156, 169, 0, -20, 175, 170, 0, -20, 184, 0, 0, -20, 185, 190, 0, 188, 202, 0, 193, 205, 208, 0, 248, 214, 216, 0, -17, 218, 221, 0, -9, 222, 240, 0, 213, 241, 242, 0, 0, 243, 244, 0, -8, 245, 246, 0, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, 191, 0, 0, 0, 0, -5, -2, 249, 0, 0, 0, 0, 0, 189, 0, -3, 250, 0, 0, 0, 67, 0, -1, 0, 1, 0, 252, 0, 0, 0, 0, 0, 0, 0, 0, 217, 0, 192, 255, 0, 159, 0, 0, 134, 0, 0, 257, 0, 0, 254, 0, 259, 13, 0, 0, 0, 78, 0, 260, 0, 0, 0, 11, 0, 261, 0, 268, 0, 0, 265, 237, 267, 0, 0, 0, 0, 0, 16, 0, 17, 0, 0, 0, 18, 0, 0, 174, 0, 270, 271, 273, 274, 275, 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 0, 280, 281, 0, 0, 0, 0, 282, 276, 284, 0, 0, 0, 80, 0, 0, 283, 0, 0, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 288, 0, 86, 0, 0, 103, 0, 0, 127, 0, 0, 0, 287, 171, 0, 0, 0, 0, 295, 0, 0, 292, 171, 297, 298, 0, 0, 0, 300, 303, 0, 0, 0, 0, 304, 306, 0, 305, 0, 0, 0, 138, 0, 307, 0, 0, 0, 142, 0, 308, 0, 0, 0, 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309, 0, 0, 0, 312, 52, 0, 0, 0, 313, 54, 0, 0, 0, 314, 316, 0, 0, 318, 319, 320, 321, 0, 0, 0, 14, 322, 0, 0, 323, 324, 0, 0, 0, 0, 0, 0, 326, 0, 0, 0, 0, 0, 198, 0, 329, 330, 0, 331, 0, 0, 0, 325, 0, 0, 328, 171, 0, 0, 0, 0, 327, 333, 0, 0, }; static const YYINT yyrindex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 15, 0, 0, 0, 49, 0, 0, 0, 66, 0, 0, 0, 74, 0, 0, 0, 82, 0, 0, 0, 90, 0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 336, 0, 0, 0, 337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, 0, 0, 0, 0, 341, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 345, 0, 241, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; static const YYINT yygindex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 372, 0, 0, 264, 0, 0, 346, 0, 0, 262, 0, 0, 293, 0, 0, 357, 0, 0, 251, 0, 0, 352, 0, -4, 0, 0, 0, 0, 0, 145, 0, 0, 0, -147, 0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, 0, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, 0, 0, 0, 0, 0, 0, 226, 0, 0, 0, 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, 0, }; #define YYTABLESIZE 473 static const YYINT yytable[] = { 29, 33, 37, 41, 45, 49, 53, 13, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, 18, 18, 18, 18, 18, 29, 180, 360, 22, 33, 22, 103, 361, 37, 22, 54, 180, 41, 362, 108, 120, 45, 144, 160, 169, 49, 163, 176, 57, 53, 181, 28, 28, 28, 28, 28, 28, 28, 28, 13, 243, 233, 22, 363, 257, 260, 263, 18, 33, 33, 33, 33, 33, 33, 33, 33, 38, 38, 38, 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 43, 43, 43, 48, 48, 48, 48, 48, 48, 48, 48, 346, 28, 350, 22, 138, 22, 139, 23, 23, 23, 23, 23, 23, 23, 23, 22, 173, 22, 33, 3, 4, 5, 6, 7, 8, 9, 38, 237, 22, 285, 22, 22, 316, 129, 43, 294, 22, 22, 139, 130, 131, 215, 48, 22, 216, 58, 217, 218, 219, 220, 221, 222, 300, 22, 61, 62, 215, 23, 223, 216, 65, 217, 218, 219, 220, 221, 222, 69, 10, 193, 194, 195, 132, 223, 238, 196, 306, 22, 197, 198, 199, 200, 201, 224, 193, 194, 195, 327, 22, 202, 196, 332, 22, 197, 198, 199, 200, 201, 274, 129, 337, 22, 73, 148, 202, 130, 131, 149, 205, 311, 312, 360, 203, 204, 74, 78, 361, 150, 151, 152, 153, 77, 362, 265, 89, 90, 91, 203, 204, 148, 81, 85, 381, 149, 87, 86, 21, 238, 167, 189, 154, 102, 26, 150, 151, 152, 153, 374, 88, 107, 119, 93, 143, 159, 94, 295, 162, 175, 301, 179, 100, 307, 101, 112, 105, 13, 187, 106, 110, 179, 30, 232, 359, 18, 256, 259, 262, 248, 249, 250, 251, 252, 95, 96, 97, 98, 111, 114, 115, 117, 118, 122, 123, 60, 295, 64, 76, 124, 165, 170, 301, 185, 190, 229, 230, 231, 307, 28, 245, 241, 345, 34, 349, 137, 246, 247, 254, 267, 268, 269, 270, 271, 281, 38, 33, 137, 272, 276, 277, 287, 68, 280, 38, 282, 291, 288, 236, 310, 236, 42, 43, 314, 315, 317, 293, 46, 319, 318, 48, 320, 322, 50, 323, 266, 324, 343, 329, 334, 344, 348, 352, 299, 353, 23, 354, 355, 356, 357, 368, 328, 371, 379, 370, 384, 2, 372, 376, 377, 380, 385, 378, 128, 172, 188, 233, 305, 219, 58, 147, 206, 199, 86, 214, 130, 97, 125, 293, 56, 72, 84, 299, 80, 375, 333, 338, 275, 286, 214, 174, 305, 244, 0, 0, 168, 0, 188, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 147, 0, 0, 0, 0, 0, 0, 359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, }; static const YYINT yycheck[] = { 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 27, 23, 11, 48, 31, 48, 46, 16, 35, 48, 44, 23, 39, 22, 46, 46, 43, 46, 46, 45, 47, 46, 46, 44, 51, 47, 0, 1, 2, 3, 4, 5, 6, 7, 50, 47, 46, 48, 47, 46, 46, 46, 50, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 46, 50, 46, 48, 47, 48, 108, 0, 1, 2, 3, 4, 5, 6, 7, 48, 47, 48, 50, 1, 2, 3, 4, 5, 6, 7, 50, 47, 48, 47, 48, 48, 277, 8, 50, 47, 48, 48, 140, 14, 15, 5, 50, 48, 8, 43, 10, 11, 12, 13, 14, 15, 47, 48, 44, 43, 5, 50, 22, 8, 44, 10, 11, 12, 13, 14, 15, 44, 50, 8, 9, 10, 47, 22, 176, 14, 47, 48, 17, 18, 19, 20, 21, 47, 8, 9, 10, 47, 48, 28, 14, 47, 48, 17, 18, 19, 20, 21, 47, 8, 47, 48, 44, 10, 28, 14, 15, 14, 47, 36, 37, 11, 51, 52, 43, 43, 16, 24, 25, 26, 27, 44, 22, 47, 29, 30, 31, 51, 52, 10, 44, 44, 377, 14, 44, 43, 256, 239, 47, 45, 47, 256, 256, 24, 25, 26, 27, 47, 44, 256, 256, 44, 256, 256, 44, 257, 256, 256, 260, 256, 44, 263, 44, 48, 44, 256, 47, 44, 44, 256, 256, 256, 256, 256, 256, 256, 256, 38, 39, 40, 41, 42, 32, 33, 34, 35, 44, 44, 44, 44, 44, 44, 44, 27, 296, 31, 43, 48, 47, 47, 302, 47, 45, 44, 48, 44, 308, 256, 45, 47, 256, 256, 256, 256, 44, 48, 47, 45, 45, 44, 44, 44, 44, 256, 256, 256, 47, 45, 45, 44, 35, 47, 256, 47, 44, 48, 256, 48, 256, 256, 256, 44, 48, 44, 256, 256, 44, 47, 256, 44, 44, 256, 44, 206, 47, 44, 47, 47, 44, 44, 44, 256, 44, 256, 44, 44, 44, 44, 44, 296, 44, 44, 47, 44, 256, 47, 45, 45, 48, 44, 47, 256, 44, 44, 44, 256, 44, 44, 44, 44, 44, 44, 256, 44, 44, 44, 256, 23, 39, 51, 256, 47, 364, 302, 308, 225, 239, 256, 140, 256, 182, -1, -1, 133, -1, 155, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, 256, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, }; #define YYFINAL 1 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 256 #define YYUNDFTOKEN 393 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) #if YYDEBUG static const char *const yyname[] = { "end-of-file","CLASS","RESOURCE","DATATYPE","CONTROLLIST","ENUMERATIONSET", "ENUMERATIONVALUE","CHARACTERSET","DOCNAME","CONVFUNC","ALIAS","TYPE", "RESOURCELITERAL","RELATED","INTERNALLITERAL","XRMRESOURCE","EXCLUDE", "RESOURCES","SUPERCLASS","CONTROLS","WIDGETCLASS","DIALOGCLASS","DEFAULT", "ENUMLITERAL","XMSTRINGCHARSETNAME","DIRECTION","PARSEDIRECTION", "CHARACTERSIZE","CTRLMAPSRESOURCE","METACLASS","WIDGET","GADGET","ARGUMENT", "REASON","CONSTRAINT","SUBRESOURCE","ATTRTRUE","ATTRFALSE","LEFTTORIGHT", "RIGHTTOLEFT","ONEBYTE","TWOBYTE","MIXED1_2BYTE","COLON","SEMICOLON","EQUALS", "LBRACE","RBRACE","STRING","ERRORTOKEN","CHILD","CHILDREN","PARENTCLASS",0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol", }; static const char *const yyrule[] = { "$accept : statement_block_list", "statement_block_list :", "statement_block_list : statement_block_list statement_block", "statement_block : class_statement_block", "statement_block : resource_statement_block", "statement_block : child_statement_block", "statement_block : datatype_statement_block", "statement_block : ctrlist_statement_block", "statement_block : enumset_statement_block", "statement_block : enumval_statement_block", "statement_block : charset_statement_block", "$$1 :", "statement_block : error $$1 SEMICOLON", "class_statement_block : CLASS class_statement_list", "class_statement_list : class_statement SEMICOLON", "class_statement_list : class_statement_list class_statement SEMICOLON", "$$2 :", "class_statement_list : error $$2 SEMICOLON", "resource_statement_block : RESOURCE resource_statement_list", "resource_statement_list : resource_statement SEMICOLON", "resource_statement_list : resource_statement_list resource_statement SEMICOLON", "$$3 :", "resource_statement_list : error $$3 SEMICOLON", "child_statement_block : CHILD child_statement_list", "child_statement_list : child_statement SEMICOLON", "child_statement_list : child_statement_list child_statement SEMICOLON", "$$4 :", "child_statement_list : error $$4 SEMICOLON", "datatype_statement_block : DATATYPE datatype_statement_list", "datatype_statement_list : datatype_statement SEMICOLON", "datatype_statement_list : datatype_statement_list datatype_statement SEMICOLON", "$$5 :", "datatype_statement_list : error $$5 SEMICOLON", "ctrlist_statement_block : CONTROLLIST ctrlist_statement_list", "ctrlist_statement_list : ctrlist_statement SEMICOLON", "ctrlist_statement_list : ctrlist_statement_list ctrlist_statement SEMICOLON", "$$6 :", "ctrlist_statement_list : error $$6 SEMICOLON", "enumset_statement_block : ENUMERATIONSET enumset_statement_list", "enumset_statement_list : enumset_statement SEMICOLON", "enumset_statement_list : enumset_statement_list enumset_statement SEMICOLON", "$$7 :", "enumset_statement_list : error $$7 SEMICOLON", "enumval_statement_block : ENUMERATIONVALUE enumval_statement_list", "enumval_statement_list : enumval_statement SEMICOLON", "enumval_statement_list : enumval_statement_list enumval_statement SEMICOLON", "$$8 :", "enumval_statement_list : error $$8 SEMICOLON", "charset_statement_block : CHARACTERSET charset_statement_list", "charset_statement_list : charset_statement SEMICOLON", "charset_statement_list : charset_statement_list charset_statement SEMICOLON", "$$9 :", "charset_statement_list : error $$9 SEMICOLON", "$$10 :", "class_statement : name COLON class_type $$10 class_definition", "class_type : METACLASS", "class_type : WIDGET", "class_type : GADGET", "class_definition :", "class_definition : LBRACE RBRACE", "class_definition : LBRACE class_attribute_list RBRACE", "$$11 :", "class_definition : error $$11 RBRACE", "class_attribute_list : class_attribute", "class_attribute_list : class_attribute_list class_attribute", "$$12 :", "class_attribute : class_attribute_name EQUALS STRING $$12 SEMICOLON", "$$13 :", "class_attribute : boolean_class_attribute_name EQUALS boolean_attribute_value $$13 SEMICOLON", "class_attribute : class_resources SEMICOLON", "class_attribute : class_controls SEMICOLON", "class_attribute : class_children SEMICOLON", "$$14 :", "class_attribute : error $$14 SEMICOLON", "class_attribute_name : SUPERCLASS", "class_attribute_name : PARENTCLASS", "class_attribute_name : INTERNALLITERAL", "class_attribute_name : DOCNAME", "class_attribute_name : CONVFUNC", "class_attribute_name : WIDGETCLASS", "class_attribute_name : CTRLMAPSRESOURCE", "class_attribute_name : ALIAS", "boolean_class_attribute_name : DIALOGCLASS", "boolean_attribute_value : ATTRTRUE", "boolean_attribute_value : ATTRFALSE", "class_resources : RESOURCES class_resources_block", "class_resources_block :", "class_resources_block : LBRACE RBRACE", "class_resources_block : LBRACE class_resource_list RBRACE", "$$15 :", "class_resources_block : error $$15 RBRACE", "class_resource_list : class_resource_element", "class_resource_list : class_resource_list class_resource_element", "$$16 :", "class_resource_element : name $$16 class_resource_attributes SEMICOLON", "$$17 :", "class_resource_element : error $$17 SEMICOLON", "class_resource_attributes :", "class_resource_attributes : LBRACE RBRACE", "class_resource_attributes : LBRACE class_resource_attribute_list RBRACE", "$$18 :", "class_resource_attributes : error $$18 RBRACE", "class_resource_attribute_list : class_resource_attribute_element", "class_resource_attribute_list : class_resource_attribute_list class_resource_attribute_element", "$$19 :", "class_resource_attribute_element : class_resource_attribute_name EQUALS STRING $$19 SEMICOLON", "$$20 :", "class_resource_attribute_element : boolean_class_resource_attribute_name EQUALS boolean_attribute_value $$20 SEMICOLON", "$$21 :", "class_resource_attribute_element : error $$21 SEMICOLON", "class_resource_attribute_name : TYPE", "class_resource_attribute_name : DEFAULT", "boolean_class_resource_attribute_name : EXCLUDE", "class_controls : CONTROLS class_controls_block", "class_controls_block :", "class_controls_block : LBRACE RBRACE", "class_controls_block : LBRACE class_controls_list RBRACE", "$$22 :", "class_controls_block : error $$22 RBRACE", "class_controls_list : class_controls_element", "class_controls_list : class_controls_list class_controls_element", "$$23 :", "class_controls_element : name $$23 class_controls_attributes SEMICOLON", "$$24 :", "class_controls_element : error $$24 SEMICOLON", "class_controls_attributes :", "class_controls_attributes : LBRACE RBRACE", "$$25 :", "class_controls_attributes : error $$25 RBRACE", "class_children : CHILDREN class_children_block", "class_children_block :", "class_children_block : LBRACE RBRACE", "class_children_block : LBRACE class_children_list RBRACE", "$$26 :", "class_children_block : error $$26 RBRACE", "class_children_list : class_children_element", "class_children_list : class_children_list class_children_element", "$$27 :", "class_children_element : name $$27 SEMICOLON", "$$28 :", "class_children_element : error $$28 SEMICOLON", "$$29 :", "resource_statement : name COLON resource_type $$29 resource_definition", "resource_type : ARGUMENT", "resource_type : REASON", "resource_type : CONSTRAINT", "resource_type : SUBRESOURCE", "resource_definition :", "resource_definition : LBRACE RBRACE", "resource_definition : LBRACE resource_attribute_list RBRACE", "$$30 :", "resource_definition : error $$30 RBRACE", "resource_attribute_list : resource_attribute", "resource_attribute_list : resource_attribute_list resource_attribute", "$$31 :", "resource_attribute : resource_attribute_name EQUALS STRING $$31 SEMICOLON", "$$32 :", "resource_attribute : boolean_resource_resource_attribute_name EQUALS boolean_attribute_value $$32 SEMICOLON", "$$33 :", "resource_attribute : error $$33 SEMICOLON", "resource_attribute_name : TYPE", "resource_attribute_name : RESOURCELITERAL", "resource_attribute_name : ENUMERATIONSET", "resource_attribute_name : INTERNALLITERAL", "resource_attribute_name : RELATED", "resource_attribute_name : DOCNAME", "resource_attribute_name : DEFAULT", "resource_attribute_name : ALIAS", "boolean_resource_resource_attribute_name : XRMRESOURCE", "child_statement : name COLON STRING", "$$34 :", "datatype_statement : name $$34 datatype_definition", "datatype_definition :", "datatype_definition : LBRACE RBRACE", "datatype_definition : LBRACE datatype_attribute_list RBRACE", "$$35 :", "datatype_definition : error $$35 RBRACE", "datatype_attribute_list : datatype_attribute", "datatype_attribute_list : datatype_attribute_list datatype_attribute", "$$36 :", "datatype_attribute : datatype_attribute_name EQUALS STRING $$36 SEMICOLON", "$$37 :", "datatype_attribute : error $$37 SEMICOLON", "datatype_attribute_name : INTERNALLITERAL", "datatype_attribute_name : DOCNAME", "datatype_attribute_name : XRMRESOURCE", "$$38 :", "ctrlist_statement : name $$38 ctrlist_definition", "ctrlist_definition :", "ctrlist_definition : LBRACE RBRACE", "ctrlist_definition : LBRACE ctrlist_controls_list RBRACE", "$$39 :", "ctrlist_definition : error $$39 RBRACE", "ctrlist_controls_list : ctrlist_control", "ctrlist_controls_list : ctrlist_controls_list ctrlist_control", "$$40 :", "ctrlist_control : name $$40 ctrlist_controls_attributes SEMICOLON", "$$41 :", "ctrlist_control : error $$41 SEMICOLON", "ctrlist_controls_attributes :", "ctrlist_controls_attributes : LBRACE RBRACE", "$$42 :", "ctrlist_controls_attributes : error $$42 RBRACE", "$$43 :", "enumset_statement : name COLON enumset_data_type $$43 enumset_definition", "enumset_data_type : STRING", "enumset_definition :", "enumset_definition : LBRACE RBRACE", "enumset_definition : LBRACE enumset_value_list RBRACE", "$$44 :", "enumset_definition : error $$44 RBRACE", "enumset_value_list : enumset_value", "enumset_value_list : enumset_value_list enumset_value", "$$45 :", "enumset_value : name $$45 SEMICOLON", "$$46 :", "enumset_value : error $$46 SEMICOLON", "$$47 :", "enumval_statement : name COLON $$47 enumvalue_definition", "enumvalue_definition :", "enumvalue_definition : LBRACE RBRACE", "enumvalue_definition : LBRACE enumvalue_attributes_list RBRACE", "$$48 :", "enumvalue_definition : error $$48 RBRACE", "enumvalue_attributes_list : enumvalue_attribute", "enumvalue_attributes_list : enumvalue_attributes_list enumvalue_attribute", "$$49 :", "enumvalue_attribute : enumvalue_attribute_name EQUALS STRING $$49 SEMICOLON", "$$50 :", "enumvalue_attribute : error $$50 SEMICOLON", "enumvalue_attribute_name : ENUMLITERAL", "$$51 :", "charset_statement : name $$51 charset_definition", "charset_definition :", "charset_definition : LBRACE RBRACE", "charset_definition : LBRACE charset_attribute_list RBRACE", "$$52 :", "charset_definition : error $$52 RBRACE", "charset_attribute_list : charset_attribute", "charset_attribute_list : charset_attribute_list charset_attribute", "$$53 :", "charset_attribute : charset_attribute_name EQUALS STRING $$53 SEMICOLON", "$$54 :", "charset_attribute : predefined_charset_attribute_name EQUALS predefined_charset_attribute_value $$54 SEMICOLON", "$$55 :", "charset_attribute : error $$55 SEMICOLON", "charset_attribute_name : INTERNALLITERAL", "charset_attribute_name : ALIAS", "charset_attribute_name : XMSTRINGCHARSETNAME", "predefined_charset_attribute_name : DIRECTION", "predefined_charset_attribute_name : PARSEDIRECTION", "predefined_charset_attribute_name : CHARACTERSIZE", "predefined_charset_attribute_value : LEFTTORIGHT", "predefined_charset_attribute_value : RIGHTTOLEFT", "predefined_charset_attribute_value : ONEBYTE", "predefined_charset_attribute_value : TWOBYTE", "predefined_charset_attribute_value : MIXED1_2BYTE", "name : STRING", }; #endif int yydebug; int yynerrs; int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 10000 #endif #endif #define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; YYINT *s_base; YYINT *s_mark; YYINT *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; #line 735 "wmlparse.y" /* * Dummmy error routine, since we output our own. */ int yyerror (s) char *s; { return 0; } #include "wmllex.c" #line 788 "wmlparse.c" #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; YYINT *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return YYENOMEM; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return YYENOMEM; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; YYERROR_CALL("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == YYEOF) goto yyabort; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 11: #line 174 "wmlparse.y" { LexIssueError(0); } break; case 16: #line 190 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 21: #line 201 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 26: #line 212 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 31: #line 223 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 36: #line 234 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 41: #line 245 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 46: #line 256 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 51: #line 267 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 53: #line 279 "wmlparse.y" { wmlCreateClass (yynameval, yytknval1); } break; case 55: #line 284 "wmlparse.y" { yytknval1 = METACLASS; } break; case 56: #line 285 "wmlparse.y" { yytknval1 = WIDGET; } break; case 57: #line 286 "wmlparse.y" { yytknval1 = GADGET; } break; case 61: #line 293 "wmlparse.y" { LexIssueError(RBRACE); } break; case 65: #line 305 "wmlparse.y" { wmlAddClassAttribute (yytknval1, yystringval); } break; case 67: #line 310 "wmlparse.y" { wmlAddClassAttribute (yytknval1, yytknval2); } break; case 72: #line 315 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 74: #line 319 "wmlparse.y" { yytknval1 = SUPERCLASS; } break; case 75: #line 320 "wmlparse.y" { yytknval1 = PARENTCLASS; } break; case 76: #line 321 "wmlparse.y" { yytknval1 = INTERNALLITERAL; } break; case 77: #line 322 "wmlparse.y" { yytknval1 = DOCNAME; } break; case 78: #line 323 "wmlparse.y" { yytknval1 = CONVFUNC; } break; case 79: #line 324 "wmlparse.y" { yytknval1 = WIDGETCLASS; } break; case 80: #line 325 "wmlparse.y" { yytknval1 = CTRLMAPSRESOURCE; } break; case 81: #line 326 "wmlparse.y" { yytknval1 = ALIAS; } break; case 82: #line 330 "wmlparse.y" { yytknval1 = DIALOGCLASS; } break; case 83: #line 334 "wmlparse.y" { yytknval2 = ATTRTRUE; } break; case 84: #line 335 "wmlparse.y" { yytknval2 = ATTRFALSE; } break; case 89: #line 346 "wmlparse.y" { LexIssueError(RBRACE); } break; case 93: #line 356 "wmlparse.y" { wmlAddClassResource (yynameval); } break; case 95: #line 359 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 100: #line 366 "wmlparse.y" { LexIssueError(RBRACE); } break; case 104: #line 378 "wmlparse.y" { wmlAddClassResourceAttribute (yytknval1, yystringval); } break; case 106: #line 383 "wmlparse.y" { wmlAddClassResourceAttribute (yytknval1, yytknval2); } break; case 108: #line 385 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 110: #line 389 "wmlparse.y" { yytknval1 = TYPE; } break; case 111: #line 390 "wmlparse.y" { yytknval1 = DEFAULT; } break; case 112: #line 394 "wmlparse.y" { yytknval1 = EXCLUDE; } break; case 117: #line 405 "wmlparse.y" { LexIssueError(RBRACE); } break; case 121: #line 415 "wmlparse.y" { wmlAddClassControl (yynameval); } break; case 123: #line 418 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 127: #line 424 "wmlparse.y" { LexIssueError(RBRACE); } break; case 133: #line 435 "wmlparse.y" { LexIssueError(RBRACE); } break; case 137: #line 445 "wmlparse.y" { wmlAddClassChild (yynameval); } break; case 139: #line 447 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 141: #line 459 "wmlparse.y" { wmlCreateResource (yynameval, yytknval1); } break; case 143: #line 464 "wmlparse.y" { yytknval1 = ARGUMENT; } break; case 144: #line 465 "wmlparse.y" { yytknval1 = REASON; } break; case 145: #line 466 "wmlparse.y" { yytknval1 = CONSTRAINT; } break; case 146: #line 467 "wmlparse.y" { yytknval1 = SUBRESOURCE; } break; case 150: #line 474 "wmlparse.y" { LexIssueError(RBRACE); } break; case 154: #line 486 "wmlparse.y" { wmlAddResourceAttribute (yytknval1, yystringval); } break; case 156: #line 491 "wmlparse.y" { wmlAddResourceAttribute (yytknval1, yytknval2); } break; case 158: #line 493 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 160: #line 497 "wmlparse.y" { yytknval1 = TYPE; } break; case 161: #line 498 "wmlparse.y" { yytknval1 = RESOURCELITERAL; } break; case 162: #line 499 "wmlparse.y" { yytknval1 = ENUMERATIONSET; } break; case 163: #line 500 "wmlparse.y" { yytknval1 = INTERNALLITERAL; } break; case 164: #line 501 "wmlparse.y" { yytknval1 = RELATED; } break; case 165: #line 502 "wmlparse.y" { yytknval1 = DOCNAME; } break; case 166: #line 503 "wmlparse.y" { yytknval1 = DEFAULT; } break; case 167: #line 504 "wmlparse.y" { yytknval1 = ALIAS; } break; case 168: #line 508 "wmlparse.y" { yytknval1 = XRMRESOURCE; } break; case 169: #line 517 "wmlparse.y" { wmlCreateChild(yynameval, yystringval); } break; case 170: #line 526 "wmlparse.y" { wmlCreateDatatype (yystringval); } break; case 175: #line 534 "wmlparse.y" { LexIssueError(RBRACE); } break; case 179: #line 546 "wmlparse.y" { wmlAddDatatypeAttribute (yytknval1, yystringval); } break; case 181: #line 548 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 183: #line 552 "wmlparse.y" { yytknval1 = INTERNALLITERAL; } break; case 184: #line 553 "wmlparse.y" { yytknval1 = DOCNAME; } break; case 185: #line 554 "wmlparse.y" { yytknval1 = XRMRESOURCE; } break; case 186: #line 564 "wmlparse.y" { wmlCreateOrAppendCtrlList (yynameval); } break; case 191: #line 572 "wmlparse.y" { LexIssueError(RBRACE); } break; case 195: #line 582 "wmlparse.y" { wmlAddCtrlListControl (yynameval); } break; case 197: #line 585 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 201: #line 591 "wmlparse.y" { LexIssueError(RBRACE); } break; case 203: #line 603 "wmlparse.y" { wmlCreateEnumSet (yynameval, yystringval); } break; case 209: #line 616 "wmlparse.y" { LexIssueError(RBRACE); } break; case 213: #line 626 "wmlparse.y" { wmlAddEnumSetValue (yynameval); } break; case 215: #line 628 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 217: #line 639 "wmlparse.y" { wmlCreateEnumValue (yynameval); } break; case 222: #line 647 "wmlparse.y" { LexIssueError(RBRACE); } break; case 226: #line 659 "wmlparse.y" { wmlAddEnumValueAttribute (yytknval1, yystringval); } break; case 228: #line 661 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 230: #line 665 "wmlparse.y" { yytknval1 = ENUMLITERAL; } break; case 231: #line 675 "wmlparse.y" { wmlCreateCharset (yystringval); } break; case 236: #line 683 "wmlparse.y" { LexIssueError(RBRACE); } break; case 240: #line 695 "wmlparse.y" { wmlAddCharsetAttribute (yytknval1, yystringval); } break; case 242: #line 700 "wmlparse.y" { wmlAddCharsetAttribute (yytknval1, yytknval2); } break; case 244: #line 702 "wmlparse.y" { LexIssueError(SEMICOLON); } break; case 246: #line 706 "wmlparse.y" { yytknval1 = INTERNALLITERAL; } break; case 247: #line 707 "wmlparse.y" { yytknval1 = ALIAS; } break; case 248: #line 708 "wmlparse.y" { yytknval1 = XMSTRINGCHARSETNAME; } break; case 249: #line 712 "wmlparse.y" { yytknval1 = DIRECTION; } break; case 250: #line 713 "wmlparse.y" { yytknval1 = PARSEDIRECTION; } break; case 251: #line 714 "wmlparse.y" { yytknval1 = CHARACTERSIZE; } break; case 252: #line 718 "wmlparse.y" { yytknval2 = LEFTTORIGHT; } break; case 253: #line 719 "wmlparse.y" { yytknval2 = RIGHTTOLEFT; } break; case 254: #line 720 "wmlparse.y" { yytknval2 = ONEBYTE; } break; case 255: #line 721 "wmlparse.y" { yytknval2 = TWOBYTE; } break; case 256: #line 722 "wmlparse.y" { yytknval2 = MIXED1_2BYTE; } break; case 257: #line 731 "wmlparse.y" { strcpy (yynameval, (XmConst char *)yystringval); } break; #line 1398 "wmlparse.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == YYEOF) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } *++yystack.s_mark = (YYINT) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: YYERROR_CALL("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); } motif-2.3.8/tools/wml/wmloutp1.c0000644000175000017500000000307313145162623013464 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wmloutp1.c /main/7 1995/07/13 21:04:31 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This is the standard output module for creating the UIL compiler * .h files. */ #include "wml.h" /* External functions declaraion */ extern void wmlOutputKeyWordFiles (); extern void wmlOutputMmFiles(); void wmlOutput () { /* * Output the .h files */ wmlOutputHFiles (); if ( wml_err_count > 0 ) return; /* * Output the keyword (token) tables */ wmlOutputKeyWordFiles (); if ( wml_err_count > 0 ) return; /* * Output the .mm files */ wmlOutputMmFiles (); if ( wml_err_count > 0 ) return; return; } motif-2.3.8/tools/wml/wmlresolve.c0000644000175000017500000014017213145162623014075 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wmlresolve.c /main/9 1995/08/29 11:11:05 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * This module contains all routines which perform semantic analysis of * the parsed WML specification. It is responsible for building all * ordered structures which can be directly translated into literal * code values for the various .h files. It is responsible for performing * inheritance of resources for all classes. * * Input: * the ordered list of syntactic objects in wml_synobj_ptr * * Output: * */ #include "wml.h" #if defined(__STDC__) #include #endif #include #include /* * Routines used only in this module */ void wmlResolveGenerateSymK (); void wmlResolveValidateClass (); void wmlResolvePrintReport (); void wmlResolveSymKDataType (); void wmlResolveSymKChild (); void wmlResolveSymKEnumVal (); void wmlResolveSymKEnumSet (); void wmlResolveSymKReason (); void wmlResolveSymKArgument (); void wmlResolveSymKRelated (); void wmlResolveSymKClass (); void wmlResolveSymKCtrlList (); void wmlResolveSymKCharSet (); void wmlResolveClassInherit (); void wmlResolveClearRefPointers (); void wmlResolveInitRefObj (); void wmlResolveInitChildRefObj (); void wmlResolvePrintClass (); void wmlResolvePrintClassArgs (); void wmlResolvePrintClassReasons (); ObjectPtr wmlResolveFindObject (); void wmlIssueReferenceError (); void wmlIssueIllegalReferenceError (); void wmlIssueError (); /* * The control routine for semantic analysis. It calls the various phases. */ void wmlResolveDescriptors () { /* * Perform the code assignment pass. This results in assignment of sym_k_... * codes to all entities. Also, all objects and cross-linking are validated. */ wmlResolveGenerateSymK (); printf ("\nInitial validation and reference resolution complete"); /* * Perform class inheritance and validation */ wmlResolveValidateClass (); printf ("\nClass validation and inheritance complete"); /* * Print a report */ if ( wml_err_count > 0 ) return; wmlResolvePrintReport (); } /* * Routine to linearize and assign sym_k... literals for objects. Simply * a dispatching routine. */ void wmlResolveGenerateSymK () { /* * Process the datatype objects */ wmlResolveSymKDataType (); /* * Process the enumeration value and enumeration sets */ wmlResolveSymKEnumVal (); wmlResolveSymKEnumSet (); /* * Process the resources, producing argument and reason vectors. */ wmlResolveSymKReason (); wmlResolveSymKArgument (); /* * Bind related arguments */ wmlResolveSymKRelated (); /* * Process the class definitions */ wmlResolveSymKClass (); /* * Process the controls list definitions */ wmlResolveSymKCtrlList (); /* * Process the charset objects */ wmlResolveSymKCharSet (); /* Process the child definitions. */ wmlResolveSymKChild(); } /* * Routine to linearize data types * * - Generate the wml_obj_datatype... vector of resolved data type objects, * ordered lexicographically. * Do name processing, and acquire links to any other objects named in * the syntactic descriptor. */ void wmlResolveSymKDataType () { WmlSynDataTypeDefPtr cursyn; /* current syntactic object */ WmlDataTypeDefPtr newobj; /* new resolved object */ int ndx; /* loop index */ /* * Initialize the object vector. Then process the syntactic vector, * processing each datatype object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_datatype_ptr, 50, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynDataTypeDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlDataTypeDefValid ) continue; /* * Create and initialize new object. Append to resolved object vector. */ newobj = (WmlDataTypeDefPtr) malloc (sizeof(WmlDataTypeDef)); newobj->syndef = cursyn; cursyn->rslvdef = newobj; if ( cursyn->int_lit != NULL ) newobj->tkname = cursyn->int_lit; else newobj->tkname = cursyn->name; wmlInsertInHList (wml_obj_datatype_ptr, newobj->tkname, (ObjectPtr)newobj); /* * Validate any object references in the syntactic object */ } } /* * Routine to linearize children * * - Generate the wml_obj_child... vector of resolved child objects, * ordered lexicographically. Assign sym_k_... values while doing so. * Link child to its class. */ void wmlResolveSymKChild () { WmlSynChildDefPtr cursyn; /* current syntactic object */ WmlChildDefPtr newobj; /* new resolved object */ int code; /* assigned sym_k code value */ int ndx; /* loop index */ /* * Initialize the object vector. Then process the syntactic vector, * processing each child object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_child_ptr, 50, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynChildDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlChildDefValid ) continue; /* * Create and initialize new object. Append to resolved object vector. */ newobj = (WmlChildDefPtr) malloc (sizeof(WmlChildDef)); newobj->syndef = cursyn; cursyn->rslvdef = newobj; newobj->tkname = cursyn->name; wmlInsertInHList (wml_obj_child_ptr, newobj->tkname, (ObjectPtr)newobj); /* Link class to the resolved object. */ if (cursyn->class != NULL) newobj->class = (WmlClassDefPtr) wmlResolveFindObject(cursyn->class, WmlClassDefValid, cursyn->name); } /* * All objects are in the vector. The order is the code order, so * process it again and assign codes to each object */ code = 1; for ( ndx=0 ; ndxcnt ; ndx++ ) { newobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr; newobj->sym_code = code; code += 1; } } /* * Routine to linearize and assign sym_k values to enumeration values * * - Generate the wml_obj_datatype... vector of resolved data type objects, * ordered lexicographically. No sym_k_... values are needed for * enumeration values, so don't assign any. */ void wmlResolveSymKEnumVal () { WmlSynEnumSetDefPtr cures; /* current enumeration set */ WmlSynEnumSetValDefPtr curesv; /* current enum set value */ WmlSynEnumValueDefPtr cursyn; /* current syntactic object */ WmlEnumValueDefPtr newobj; /* new resolved object */ int ndx; /* loop index */ int code; /* sym_k_... code */ /* * Perform defaulting. Process all the enumeration sets, and define a * syntactic object for every enumeration value named in an enumeration set * which has no syntactic entry. If there is an error in a name, then * this error won't be detected until we attempt to compile the output .h files. */ for ( ndx=0 ; ndxcnt ; ndx++ ) { cures = (WmlSynEnumSetDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cures->validation != WmlEnumSetDefValid ) continue; for (curesv=cures->values ; curesv!=NULL ; curesv=curesv->next) if ( wmlFindInHList(wml_synobj_ptr,curesv->name) < 0 ) wmlCreateEnumValue (curesv->name); } /* * Initialize the object vector. Then process the syntactic vector, * processing each enumeration value object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_enumval_ptr, 50, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynEnumValueDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlEnumValueDefValid ) continue; /* * Create and initialize new object. Append to resolved object vector. */ newobj = (WmlEnumValueDefPtr) malloc (sizeof(WmlEnumValueDef)); newobj->syndef = cursyn; cursyn->rslvdef = newobj; wmlInsertInHList (wml_obj_enumval_ptr, cursyn->name, (ObjectPtr)newobj); } /* * All objects are in the vector. That order is the code order, so * process it again and assign codes to each object */ code = 1; for ( ndx=0 ; ndxcnt ; ndx++ ) { newobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr; newobj->sym_code = code; code += 1; } } /* * Routine to linearize and assign sym_k values to enumeration sets * * - Generate the wml_obj_datatype... vector of resolved data type objects, * ordered lexicographically. No sym_k_... values are needed for * enumeration values, so don't assign any. */ void wmlResolveSymKEnumSet () { WmlSynEnumSetDefPtr cursyn; /* current syntactic object */ WmlEnumSetDefPtr newobj; /* new resolved object */ int ndx; /* loop index */ int code; /* sym_k_... code */ WmlSynEnumSetValDefPtr esvelm; /* current syntactic list element */ WmlEnumValueDefPtr evobj; /* current enumeration value */ WmlEnumSetValDefPtr esvobj; /* current list element */ /* * Initialize the object vector. Then process the syntactic vector, * processing each enumeration set object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_enumset_ptr, 20, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynEnumSetDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlEnumSetDefValid ) continue; /* * Create and initialize new object. Append to resolved object vector. */ newobj = (WmlEnumSetDefPtr) malloc (sizeof(WmlEnumSetDef)); newobj->syndef = cursyn; cursyn->rslvdef = newobj; newobj->tkname = cursyn->name; newobj->dtype_def = (WmlDataTypeDefPtr) wmlResolveFindObject (cursyn->datatype, WmlDataTypeDefValid, cursyn->name); wmlInsertInHList (wml_obj_enumset_ptr, newobj->tkname, (ObjectPtr)newobj); } /* * All objects are in the vector. That order is the code order, so * process it again and assign codes to each object. Simultaneously construct * a vector of resolved enumeration values, and count them. */ code = 1; for ( ndx=0 ; ndxcnt ; ndx++ ) { newobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr; newobj->sym_code = code; code += 1; /* * Validate and construct a resolved enumeration value list */ cursyn = newobj->syndef; newobj->values_cnt = 0; newobj->values = NULL; for ( esvelm=cursyn->values ; esvelm!=NULL ; esvelm=esvelm->next ) { evobj = (WmlEnumValueDefPtr) wmlResolveFindObject (esvelm->name, WmlEnumValueDefValid, cursyn->name); if ( evobj == NULL ) continue; esvobj = (WmlEnumSetValDefPtr) malloc (sizeof(WmlEnumSetValDef)); esvobj->value = evobj; esvobj->next = newobj->values; newobj->values = esvobj; newobj->values_cnt += 1; } } } /* * Routine to linearize and assign sym_k values to reasons. * * - Generate the wml_obj_reason... vector of resolved reason objects, * ordered lexicographically. Assign a sym_k_... value as this is done. * Do name processing, and acquire links to any other objects named in * the syntactic descriptor. */ void wmlResolveSymKReason () { WmlSynResourceDefPtr cursyn; /* current syntactic object */ WmlResourceDefPtr newobj; /* new resolved object */ int ndx; /* loop index */ int code; /* assigned sym_k code value */ char errmsg[300]; /* * Initialize the object vector. Then process the syntactic vector, * processing each reason resource object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_reason_ptr, 100, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynResourceDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlResourceDefValid ) continue; if ( cursyn->type != WmlResourceTypeReason ) continue; newobj = (WmlResourceDefPtr) malloc (sizeof(WmlResourceDef)); /* * Create and initialize new object. Append to resolved object vector. */ newobj->syndef = cursyn; cursyn->rslvdef = newobj; if ( cursyn->int_lit != NULL ) newobj->tkname = cursyn->int_lit; else newobj->tkname = cursyn->name; newobj->dtype_def = NULL; newobj->enumset_def = NULL; newobj->related_code = 0; wmlInsertInHList (wml_obj_reason_ptr, newobj->tkname, (ObjectPtr)newobj); /* * Validate any object references in the syntactic object * Reason can't bind to some objects. */ if ( cursyn->datatype != NULL ) wmlIssueIllegalReferenceError (cursyn->name, "DataType"); } /* * All objects are in the vector. That order is the code order, so * process it again and assign codes to each object */ code = 1; for ( ndx=0 ; ndxcnt ; ndx++ ) { newobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr; newobj->sym_code = code; code += 1; } } /* * Routine to linearize and assign sym_k values to arguments. * * - Generate the wml_obj_arg... vector of resovled reason objects, * ordered lexicographically. Assign a sym_k_... values while doing so. * validate the data type for each argument, and link it to its data type * object. * Do name processing, and acquire links to any other objects named in * the syntactic descriptor. */ void wmlResolveSymKArgument () { WmlSynResourceDefPtr cursyn; /* current syntactic object */ WmlResourceDefPtr newobj; /* new resolved object */ int ndx; /* loop index */ int code; /* assigned sym_k code value */ char errmsg[300]; /* * Initialize the object vector. Then process the syntactic vector, * processing each reason resource object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_arg_ptr, 500, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynResourceDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlResourceDefValid ) continue; if ( cursyn->type == WmlResourceTypeReason ) continue; newobj = (WmlResourceDefPtr) malloc (sizeof(WmlResourceDef)); /* * Create and initialize new object. Append to resolved object vector. */ newobj->syndef = cursyn; cursyn->rslvdef = newobj; if ( cursyn->int_lit != NULL ) newobj->tkname = cursyn->int_lit; else newobj->tkname = cursyn->name; newobj->related_code = 0; newobj->enumset_def = NULL; wmlInsertInHList (wml_obj_arg_ptr, newobj->tkname, (ObjectPtr)newobj); /* * Validate any object references in the syntactic object */ newobj->dtype_def = (WmlDataTypeDefPtr) wmlResolveFindObject (cursyn->datatype, WmlDataTypeDefValid, cursyn->name); if ( cursyn->enumset != NULL ) newobj->enumset_def = (WmlEnumSetDefPtr) wmlResolveFindObject (cursyn->enumset, WmlEnumSetDefValid, cursyn->name); } /* * All objects are in the vector. The order is the code order, so * process it again and assign codes to each object */ code = 1; for ( ndx=0 ; ndxcnt ; ndx++ ) { newobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; newobj->sym_code = code; code += 1; } } /* * Routine to resolve related argument references. * * Search the argument vector for any argument with its related * argument set. Find the related argument, and bind the relation. * The binding only goes one way. */ void wmlResolveSymKRelated () { WmlResourceDefPtr srcobj; /* object with related reference */ WmlResourceDefPtr dstobj; /* other object in binding */ WmlSynResourceDefPtr srcsynobj; /* source syntactic object */ int ndx; /* loop index */ /* * Scan all arguments for related argument bindings. */ for ( ndx=0 ; ndxcnt ; ndx++ ) { srcobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; srcsynobj = srcobj->syndef; if ( srcsynobj->related != NULL ) { dstobj = (WmlResourceDefPtr) wmlResolveFindObject (srcsynobj->related, WmlResourceDefValid, srcsynobj->name); if ( dstobj != NULL ) srcobj->related_code = dstobj->sym_code; } } } /* * Routine to linearize and assign sym_k values to classes * * There are two linearizations of classes: * - all classes in wml_obj_allclass... * - all widgets and gadgets in wml_obj_class... * Create and linearize all class objects into these vectors. Assign sym_k * codes. Link all subclasses to their superclasses. Perform name processing * and link to any other named object. * * Resources are not inherited and linked at this time. */ void wmlResolveSymKClass () { WmlSynClassDefPtr cursyn; /* current syntactic object */ WmlClassDefPtr newobj; /* new resolved object */ int ndx; /* loop index */ int code; /* assigned sym_k code value */ char errmsg[300]; /* * Initialize the object vectors. Then process the syntactic vector, * processing each class object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_allclass_ptr, 200, TRUE); wmlInitHList (wml_obj_class_ptr, 200, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynClassDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlClassDefValid ) continue; /* * Create and initialize new object. Append to resolved object vector. */ newobj = (WmlClassDefPtr) malloc (sizeof(WmlClassDef)); newobj->syndef = cursyn; cursyn->rslvdef = newobj; newobj->superclass = NULL; newobj->parentclass = NULL; if ( cursyn->int_lit != NULL ) newobj->tkname = cursyn->int_lit; else newobj->tkname = cursyn->name; newobj->inherit_done = FALSE; newobj->arguments = NULL; newobj->reasons = NULL; newobj->controls = NULL; newobj->children = NULL; newobj->variant = NULL; newobj->nondialog = NULL; newobj->ctrlmapto = NULL; switch ( cursyn->type ) { case WmlClassTypeMetaclass: wmlInsertInHList (wml_obj_allclass_ptr, newobj->tkname, (ObjectPtr)newobj); break; case WmlClassTypeGadget: case WmlClassTypeWidget: wmlInsertInHList (wml_obj_allclass_ptr, newobj->tkname, (ObjectPtr)newobj); wmlInsertInHList (wml_obj_class_ptr, newobj->tkname, (ObjectPtr)newobj); break; } /* * Require a convenience function name */ if ( cursyn->type != WmlClassTypeMetaclass ) if ( cursyn->convfunc == NULL ) { sprintf (errmsg, "Class %s does not have a convenience function", cursyn->name); wmlIssueError (errmsg); } /* * Validate any object references in the syntactic object */ if ( cursyn->ctrlmapto != NULL ) newobj->ctrlmapto = (WmlResourceDefPtr) wmlResolveFindObject (cursyn->ctrlmapto, WmlResourceDefValid, cursyn->name); } /* * All objects are in the vector. That order is the code order, so * process it again and assign codes to each object */ code = 1; for ( ndx=0 ; ndxcnt ; ndx++ ) { newobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; newobj->sym_code = code; code += 1; } } /* * Routine to validate controls lists * * Construct and linearize resolved controls lists. The linearized list * is used to resolve references. */ void wmlResolveSymKCtrlList () { WmlSynCtrlListDefPtr cursyn; /* current syntactic object */ WmlCtrlListDefPtr newobj; /* new resolved object */ WmlSynClassCtrlDefPtr refptr; /* current controls reference */ WmlClassCtrlDefPtr ctrlobj; /* resolved control reference */ WmlClassDefPtr classobj; /* the controlled class */ int ndx; /* loop index */ /* * Process each control list. Construct a resolved control list for each */ wmlInitHList (wml_obj_ctrlist_ptr, 20, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynCtrlListDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlCtrlListDefValid ) continue; /* * Create and initialize new object. Append to resolved object vector. */ newobj = (WmlCtrlListDefPtr) malloc (sizeof(WmlCtrlListDef)); newobj->syndef = cursyn; cursyn->rslvdef = newobj; newobj->controls = NULL; wmlInsertInHList (wml_obj_ctrlist_ptr, cursyn->name, (ObjectPtr)newobj); /* * Validate and construct a resolved controls reference list. */ for ( refptr=cursyn->controls ; refptr!=NULL ; refptr=refptr->next ) { classobj = (WmlClassDefPtr) wmlResolveFindObject (refptr->name, WmlClassDefValid, cursyn->name); if ( classobj == NULL ) continue; ctrlobj = (WmlClassCtrlDefPtr) malloc (sizeof(WmlClassCtrlDef)); ctrlobj->next = newobj->controls; newobj->controls = ctrlobj; ctrlobj->ctrl = classobj; } } } /* * Routine to linearize and assign sym_k values to character sets * * - Generate the wml_obj_charset... vector of resolved data type objects, * ordered lexicographically. Assign a sym_k... value as this is done. * Do name processing, and acquire links to any other objects named in * the syntactic descriptor. */ void wmlResolveSymKCharSet () { WmlSynCharSetDefPtr cursyn; /* current syntactic object */ WmlCharSetDefPtr newobj; /* new resolved object */ int ndx; /* loop index */ int code; /* assigned sym_k code value */ char errmsg[300]; /* * Initialize the object vector. Then process the syntactic vector, * processing each charset object encountered (the vector is ordered). * create and append a resolved object for each one encountered. This * will be ordered as well. */ wmlInitHList (wml_obj_charset_ptr, 50, TRUE); for ( ndx=0 ; ndxcnt ; ndx++ ) { cursyn = (WmlSynCharSetDefPtr) wml_synobj_ptr->hvec[ndx].objptr; if ( cursyn->validation != WmlCharSetDefValid ) continue; /* * Create and initialize new object. Append to resolved object vector. */ newobj = (WmlCharSetDefPtr) malloc (sizeof(WmlCharSetDef)); newobj->syndef = cursyn; cursyn->rslvdef = newobj; if ( cursyn->int_lit != NULL ) newobj->tkname = cursyn->int_lit; else newobj->tkname = cursyn->name; wmlInsertInHList (wml_obj_charset_ptr, newobj->tkname, (ObjectPtr)newobj); /* * Parsing direction defaults to writing direction if unspecified */ if ( cursyn->parsedirection == WmlAttributeUnspecified ) cursyn->parsedirection = cursyn->direction; /* * Require StandardsName attribute for character set */ if ( cursyn->xms_name == NULL ) { sprintf (errmsg, "CharacterSet %s does not have a StandardsName", cursyn->name); wmlIssueError (errmsg); } } /* * All objects are in the vector. That order is the code order, so * process it again and assign codes to each object. We start at code * 2 since 1 is reserved for sym_k_userdefined_charset */ code = 2; for ( ndx=0 ; ndxcnt ; ndx++ ) { newobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr; newobj->sym_code = code; code += 1; } } /* * Routine to perform class inheritance and validation. * * This routine has two major phases: * - Complete resolution of class references, and expand out * controls list. * - Perform inheritance of resources, partitioning them into * into arguments and reasons. When complete, the class has * a list of all its resources, including copies from a * superclass and possibly a parentclass. * Excluded resources remain in the list, and are simply marked. */ void wmlResolveValidateClass () { int ndx; /* loop index */ int max; /* maximum code value */ WmlClassDefPtr clsobj; /* current class object */ WmlSynClassDefPtr synobj; /* syntactic class object */ WmlClassDefPtr superobj; /* superclass */ WmlClassDefPtr parentobj; /* parentclass */ WmlClassDefPtr widgobj; /* gadget's widget class */ WmlSynClassCtrlDefPtr refptr; /* current controls reference */ WmlClassCtrlDefPtr ctrlobj; /* resolved control reference */ int refndx; /* index in vector */ WmlClassDefPtr refcls; /* referenced class object */ WmlCtrlListDefPtr reflist; /* controls list object */ WmlClassCtrlDefPtr listelem; /* control reference in list */ char errmsg[300]; /* * Acquire the superclass pointer for each widget and gadget class */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_allclass_ptr->hvec[ndx].objptr; synobj = clsobj->syndef; if ( synobj->superclass != NULL ) { superobj = (WmlClassDefPtr) wmlResolveFindObject (synobj->superclass, WmlClassDefValid, synobj->name); if ( superobj == NULL ) continue; clsobj->superclass = superobj; } } /* * Acquire the parentclass pointer (if one exists), * for each widget and gadget class */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_allclass_ptr->hvec[ndx].objptr; synobj = clsobj->syndef; if ( synobj->parentclass != NULL ) { parentobj = (WmlClassDefPtr) wmlResolveFindObject (synobj->parentclass, WmlClassDefValid, synobj->name); if ( parentobj == NULL ) continue; clsobj->parentclass = parentobj; } } /* * Link each gadget class with its widget class (both ways). * Link any class with a non-dialog version to the non-dialog class. */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; synobj = clsobj->syndef; if ( synobj->type == WmlClassTypeGadget ) { if ( synobj->widgetclass == NULL ) { sprintf (errmsg, "Gadget class %s has no widgetclass reference", synobj->name); wmlIssueError (errmsg); } else { widgobj = (WmlClassDefPtr) wmlResolveFindObject (synobj->widgetclass, WmlClassDefValid, synobj->name); if ( widgobj != NULL ) { clsobj->variant = widgobj; widgobj->variant = clsobj; } } } if ( synobj->dialog == TRUE ) { clsobj->nondialog = clsobj->superclass; while ( clsobj->nondialog->syndef->dialog == TRUE ) clsobj->nondialog = clsobj->nondialog->superclass; } else if ( clsobj->superclass != NULL ) { synobj->dialog = clsobj->superclass->syndef->dialog; clsobj->nondialog = clsobj->superclass->nondialog; } } /* * Construct the list of resolved controls. Control lists are expanded * in place. */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; synobj = clsobj->syndef; for ( refptr=synobj->controls ; refptr!= NULL ; refptr=refptr->next ) { refndx = wmlFindInHList (wml_obj_class_ptr, refptr->name); if ( refndx >= 0 ) { refcls = (WmlClassDefPtr) wml_obj_class_ptr->hvec[refndx].objptr; ctrlobj = (WmlClassCtrlDefPtr) malloc (sizeof(WmlClassCtrlDef)); ctrlobj->next = clsobj->controls; clsobj->controls = ctrlobj; ctrlobj->ctrl = refcls; continue; } refndx = wmlFindInHList (wml_obj_ctrlist_ptr, refptr->name); if ( refndx >= 0 ) { reflist = (WmlCtrlListDefPtr) wml_obj_ctrlist_ptr->hvec[refndx].objptr; for ( listelem=reflist->controls ; listelem!=NULL ; listelem=listelem->next) { ctrlobj = (WmlClassCtrlDefPtr) malloc (sizeof(WmlClassCtrlDef)); ctrlobj->next = clsobj->controls; clsobj->controls = ctrlobj; ctrlobj->ctrl = listelem->ctrl; } continue; } wmlIssueReferenceError (synobj->name, refptr->name); continue; } } /* * Perform resource inheritance for each class. This constructs the * arguments and reasons reference vectors. */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_allclass_ptr->hvec[ndx].objptr; wmlResolveClassInherit (clsobj); } } /* * Routine to perform resource inheritance for a class. * * This routine constructs the argument and reason resource and child reference * vectors for a class. It first ensures the superclass (if any) has * been inited. It then makes a copy of the superclass lists. It repeats this * procedure for the parentclass (if any.) Finally, it * merges in the resources from the syntactic object. It uses the * resolved resource or child object to point to the matching reference object * in the list being created as an aid to search doing overrides. This also * detects whether a resource or child is already in the list (if so, it is * assumed to be inherited). */ void wmlResolveClassInherit (clsobj) WmlClassDefPtr clsobj; { WmlClassDefPtr superobj; /* superclass object */ WmlClassDefPtr parentobj; /* parentclass object */ int ndx; /* loop index */ WmlResourceDefPtr resobj; /* current resource object */ WmlClassResDefPtr refobj; /* current resource reference */ WmlClassResDefPtr srcref; /* source of copy */ WmlChildDefPtr childobj; /* current child object */ WmlClassChildDefPtr crefobj; /* current child reference */ WmlClassChildDefPtr csrcref; /* child source of copy */ WmlSynClassDefPtr synobj; /* this class' syntactic object */ WmlSynClassResDefPtr refptr; /* syntactic resource reference */ WmlSynClassChildDefPtr crefptr; /* syntactic child reference */ /* * Done if inheritance previously performed. Ensure the superclass is * done. */ if ( clsobj == NULL ) return; if ( clsobj->inherit_done ) return; superobj = clsobj->superclass; wmlResolveClassInherit (superobj); parentobj = clsobj->parentclass; wmlResolveClassInherit (parentobj); synobj = clsobj->syndef; /* * Clear the active reference pointer in the resolved resource objects. */ wmlResolveClearRefPointers (); /* * Copy the superclass resources, setting the reference pointer as we go. */ if ( superobj != NULL ) { for ( srcref=superobj->arguments ; srcref!=NULL ; srcref=srcref->next ) { refobj = (WmlClassResDefPtr) malloc (sizeof(WmlClassResDef)); refobj->next = clsobj->arguments; clsobj->arguments = refobj; wmlResolveInitRefObj (refobj, srcref); } for ( srcref=superobj->reasons ; srcref!=NULL ; srcref=srcref->next ) { refobj = (WmlClassResDefPtr) malloc (sizeof(WmlClassResDef)); refobj->next = clsobj->reasons; clsobj->reasons = refobj; wmlResolveInitRefObj (refobj, srcref); } for (csrcref = superobj->children ; csrcref!=NULL ; csrcref=csrcref->next) { crefobj = (WmlClassChildDefPtr) malloc (sizeof(WmlClassChildDef)); crefobj->next = clsobj->children; clsobj->children = crefobj; wmlResolveInitChildRefObj (crefobj, csrcref); } } /* * Copy the parentclass resources, setting the reference pointer as we go. */ if ( parentobj != NULL ) { for ( srcref=parentobj->arguments ; srcref!=NULL ; srcref=srcref->next ) { if (srcref->act_resource->ref_ptr == NULL) { refobj = (WmlClassResDefPtr) malloc (sizeof(WmlClassResDef)); refobj->next = clsobj->arguments; clsobj->arguments = refobj; wmlResolveInitRefObj (refobj, srcref); } } for ( srcref=parentobj->reasons ; srcref!=NULL ; srcref=srcref->next ) { if (srcref->act_resource->ref_ptr == NULL) { refobj = (WmlClassResDefPtr) malloc (sizeof(WmlClassResDef)); refobj->next = clsobj->reasons; clsobj->reasons = refobj; wmlResolveInitRefObj (refobj, srcref); } } for (csrcref = parentobj->children ; csrcref!=NULL ; csrcref=csrcref->next) { if (csrcref->act_child->ref_ptr == NULL) { crefobj = (WmlClassChildDefPtr) malloc (sizeof(WmlClassChildDef)); crefobj->next = clsobj->children; clsobj->children = crefobj; wmlResolveInitChildRefObj (crefobj, csrcref); } } } /* * Process the resources belonging to this class. They may either be * new resources, or override ones already in the list. Partition them * into arguments and reasons. */ for ( refptr=synobj->resources ; refptr!=NULL ; refptr=refptr->next ) { resobj = (WmlResourceDefPtr) wmlResolveFindObject (refptr->name, WmlResourceDefValid, synobj->name); if ( resobj == NULL ) continue; /* * Acquire the resolved resource object, and the resource reference. * New references are linked in to the proper list, and have their * defaults set. */ if ( resobj->ref_ptr != NULL ) refobj = resobj->ref_ptr; else { refobj = (WmlClassResDefPtr) malloc (sizeof(WmlClassResDef)); refobj->act_resource = resobj; resobj->ref_ptr = refobj; refobj->over_dtype = NULL; refobj->dflt = NULL; refobj->exclude = WmlAttributeUnspecified; if ( resobj->syndef->type == WmlResourceTypeReason ) { refobj->next = clsobj->reasons; clsobj->reasons = refobj; } else { refobj->next = clsobj->arguments; clsobj->arguments = refobj; } } /* * Override any values in the reference which are explicit in the * syntactic reference. */ if ( refptr->type != NULL ) refobj->over_dtype = (WmlDataTypeDefPtr) wmlResolveFindObject (refptr->type, WmlDataTypeDefValid, synobj->name); if ( refptr->dflt != NULL ) refobj->dflt = refptr->dflt; if ( refptr->exclude != WmlAttributeUnspecified ) refobj->exclude = refptr->exclude; } /* * Process the children belonging to this class. */ for ( crefptr = synobj->children ; crefptr!=NULL ; crefptr = crefptr->next ) { childobj = (WmlChildDefPtr) wmlResolveFindObject (crefptr->name, WmlChildDefValid, synobj->name); if ( childobj == NULL ) continue; /* * Acquire the resolved child object, and the child reference. * New references are linked in to the proper list, and have their * defaults set. */ if ( childobj->ref_ptr != NULL ) crefobj = childobj->ref_ptr; else { crefobj = (WmlClassChildDefPtr) malloc (sizeof(WmlClassChildDef)); crefobj->act_child = childobj; childobj->ref_ptr = crefobj; crefobj->next = clsobj->children; clsobj->children = crefobj; } } /* * inheritance complete */ clsobj->inherit_done = TRUE; } /* * Routine to copy a resource reference */ void wmlResolveInitRefObj (dstobj, srcobj) WmlClassResDefPtr dstobj; WmlClassResDefPtr srcobj; { WmlResourceDefPtr resobj; resobj = srcobj->act_resource; dstobj->act_resource = resobj; resobj->ref_ptr = dstobj; dstobj->over_dtype = srcobj->over_dtype; dstobj->dflt = srcobj->dflt; dstobj->exclude = srcobj->exclude; } /* * Routine to copy a child reference */ void wmlResolveInitChildRefObj (dstobj, srcobj) WmlClassChildDefPtr dstobj; WmlClassChildDefPtr srcobj; { WmlChildDefPtr childobj; childobj = srcobj->act_child; dstobj->act_child = childobj; childobj->ref_ptr = dstobj; } /* * Routine to print a report in a file. * * This routine dumps the developed database into the file 'wml.report' */ void wmlResolvePrintReport () { FILE *outfil; /* output file */ int ndx; /* loop index */ WmlClassDefPtr clsobj; /* current class */ /* * Open the output file. */ outfil = fopen ( "wml.report", "w"); if ( outfil == NULL ) { printf ("\nCouldn't open wml.report"); return; } /* * Go through all classes. Print basic information, then dump their * resources. The main purpose of this report is to show the actual * resources and controls for the class. */ for ( ndx=0 ; ndxcnt ; ndx++ ) { clsobj = (WmlClassDefPtr) wml_obj_allclass_ptr->hvec[ndx].objptr; wmlMarkReferencePointers (clsobj); wmlResolvePrintClass (outfil, clsobj); } /* * close the output file */ fprintf (outfil, "\n\n"); printf ("\nCreated report file wml.report"); fclose (outfil); } /* * Print the information for a class */ void wmlResolvePrintClass (outfil, clsobj) FILE *outfil; WmlClassDefPtr clsobj; { int ndx; /* loop index */ WmlSynClassDefPtr synobj; /* syntactic object */ WmlClassCtrlDefPtr ctrlref; /* controls reference */ WmlClassDefPtr ctrlobj; /* current class in control */ synobj = clsobj->syndef; fprintf (outfil, "\n\n\nClass %s:", synobj->name); switch ( synobj->type ) { case WmlClassTypeMetaclass: fprintf (outfil, "\n Type: Metaclass\t"); if ( synobj->superclass != NULL ) fprintf (outfil, "Superclass: %s\t", synobj->superclass); if ( synobj->parentclass != NULL ) fprintf (outfil, "Parentclass: %s\t", synobj->parentclass); break; case WmlClassTypeWidget: fprintf (outfil, "\n Type: Widget\t"); if ( synobj->superclass != NULL ) fprintf (outfil, "Superclass: %s\t", synobj->superclass); if ( synobj->parentclass != NULL ) fprintf (outfil, "Parentclass: %s\t", synobj->parentclass); if ( clsobj->variant != NULL ) fprintf (outfil, "\n Associated gadget class: %s\t", clsobj->variant->syndef->name); if ( synobj->convfunc != NULL ) fprintf (outfil, "Convenience function: %s", synobj->convfunc); break; case WmlClassTypeGadget: fprintf (outfil, "\n Type: Gadget\t"); if ( synobj->superclass != NULL ) fprintf (outfil, "Superclass: %s\t", synobj->superclass); if ( synobj->parentclass != NULL ) fprintf (outfil, "Parentclass: %s\t", synobj->parentclass); if ( clsobj->variant != NULL ) fprintf (outfil, "\n Associated widget class: %s\t", clsobj->variant->syndef->name); if ( synobj->convfunc != NULL ) fprintf (outfil, "Convenience function: %s", synobj->convfunc); break; } /* * Print associated non-dialog class */ if ( clsobj->nondialog != NULL ) fprintf (outfil, "\n DialogClass: True\tNon-dialog ancestor: %s\t", clsobj->nondialog->syndef->name); /* * Print the arguments valid in the class. First the new resources for the * class are printed, then each ancestor's contribution is printed. This * is intended to match the way resources are printed in the toolkit manual, * so that checking is as easy as possible. */ fprintf (outfil, "\n Arguments:"); wmlResolvePrintClassArgs (outfil, clsobj); /* * Print the reasons valid in the class */ fprintf (outfil, "\n Reasons:"); wmlResolvePrintClassReasons (outfil, clsobj); /* * Print the controls valid in the class */ fprintf (outfil, "\n Controls:"); for ( ndx=0 ; ndxcnt ; ndx++ ) { ctrlobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr; if ( ctrlobj->ref_ptr == NULL ) continue; fprintf (outfil, "\n %s", ctrlobj->syndef->name); } } /* * Routine to print the arguments for a class * * This routine prints out the currently marked arguments which are * present in this class. Each argument which is printed is remarked * so that it won't be printed again. This routine first prints the * superclass arguments, so that the printing order becomes the top-down * inheritance order. */ void wmlResolvePrintClassArgs (outfil, clsobj) FILE *outfil; WmlClassDefPtr clsobj; { int prthdr = TRUE; /* print header line */ int ndx; /* loop index */ WmlSynClassDefPtr synobj; /* syntactic object */ WmlClassResDefPtr resref; /* resource reference */ int constr = FALSE; /* check for constraints */ WmlResourceDefPtr resobj; /* current resource */ WmlSynResourceDefPtr synres; /* syntactic resource object */ /* * Print the superclass arguments */ if ( clsobj->superclass != NULL ) wmlResolvePrintClassArgs (outfil, clsobj->superclass); /* * Print the parentclass arguments */ if ( clsobj->parentclass != NULL ) wmlResolvePrintClassArgs (outfil, clsobj->parentclass); /* * Print the arguments for this class. Unmark the reference so it won't * be printed again. */ synobj = clsobj->syndef; for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; resref = resobj->ref_ptr; if ( resref == NULL ) continue; if ( wmlResolveResIsMember(resobj,clsobj->arguments) == NULL ) continue; synres = resobj->syndef; switch ( synres->type ) { case WmlResourceTypeArgument: case WmlResourceTypeSubResource: break; case WmlResourceTypeConstraint: constr = TRUE; break; default: continue; break; } if ( prthdr ) { fprintf (outfil, "\n %s argument set:", synobj->name); prthdr = FALSE; } fprintf (outfil, "\n %s", synres->name); fprintf (outfil, "\n\tType = %s", resobj->dtype_def->syndef->name); if ( strcmp(synres->name,synres->resliteral) != 0 ) fprintf (outfil, "\tResourceLiteral = %s", synres->resliteral); switch ( resref->exclude ) { case WmlAttributeTrue: fprintf (outfil, "\n\tExclude = True;"); break; case WmlAttributeFalse: fprintf (outfil, "\n\tExclude = False;"); break; } if ( resref->dflt != NULL ) fprintf (outfil, "\n\tDefault = \"%s\"", resref->dflt); else if ( synres->dflt != NULL ) fprintf (outfil, "\n\tDefault = \"%s\"", synres->dflt); resobj->ref_ptr = NULL; } /* * Print the constraints valid in the class */ if ( constr ) { prthdr = TRUE; for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; resref = resobj->ref_ptr; if ( resref == NULL ) continue; if ( wmlResolveResIsMember(resobj,clsobj->arguments) == NULL ) continue; synres = resobj->syndef; switch ( synres->type ) { case WmlResourceTypeConstraint: break; default: continue; break; } if ( prthdr ) { fprintf (outfil, "\n %s constraint set:", synobj->name); prthdr = FALSE; } fprintf (outfil, "\n %s", synres->name); if ( strcmp(synres->name,synres->resliteral) != 0 ) fprintf (outfil, "\tResourceLiteral = %s", synres->resliteral); switch ( resref->exclude ) { case WmlAttributeTrue: fprintf (outfil, "\n\tExclude = True;"); break; case WmlAttributeFalse: fprintf (outfil, "\n\tExclude = False;"); break; } if ( resref->dflt != NULL ) fprintf (outfil, "\n\tDefault = \"%s\"", resref->dflt); else if ( synres->dflt != NULL ) fprintf (outfil, "\n\tDefault = \"%s\"", synres->dflt); resobj->ref_ptr = NULL; } } } /* * Routine to print reasons in a class. * * Like printing arguments, only reasons instead. */ void wmlResolvePrintClassReasons (outfil, clsobj) FILE *outfil; WmlClassDefPtr clsobj; { int prthdr = TRUE; /* print header flag */ int ndx; /* loop index */ WmlSynClassDefPtr synobj; /* syntactic object */ WmlClassResDefPtr resref; /* resource reference */ WmlResourceDefPtr resobj; /* current resource */ WmlSynResourceDefPtr synres; /* syntactic resource object */ /* * Print the superclass reasons */ if ( clsobj->superclass != NULL ) wmlResolvePrintClassReasons (outfil, clsobj->superclass); /* * Print the parentclass reasons */ if ( clsobj->parentclass != NULL ) wmlResolvePrintClassReasons (outfil, clsobj->parentclass); /* * Print the reasons for this class. Unmark the reference so it won't * be printed again. */ synobj = clsobj->syndef; for ( ndx=0 ; ndxcnt ; ndx++ ) { resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr; resref = resobj->ref_ptr; if ( resref == NULL ) continue; if ( wmlResolveResIsMember(resobj,clsobj->reasons) == NULL ) continue; synres = resobj->syndef; if ( prthdr ) { fprintf (outfil, "\n %s reason set:", synobj->name); prthdr = FALSE; } fprintf (outfil, "\n %s", synres->name); if ( strcmp(synres->name,synres->resliteral) != 0 ) fprintf (outfil, "\tResourceLiteral = %s", synres->resliteral); switch ( resref->exclude ) { case WmlAttributeTrue: fprintf (outfil, "\n\tExclude = True;"); break; case WmlAttributeFalse: fprintf (outfil, "\n\tExclude = False;"); break; } resobj->ref_ptr = NULL; } } /* * Routine to mark reference pointers for a class * * This routine clears all reference pointers, then marks the class and * resource objects to flag those contained in the current class. This * allows processing of the widget and resource vectors in order to produce * bit masks or reports. */ void wmlMarkReferencePointers (clsobj) WmlClassDefPtr clsobj; { int ndx; /* loop index */ WmlClassDefPtr mrkcls; /* class object to mark */ WmlResourceDefPtr mrkres; /* resource object to mark */ WmlClassResDefPtr resref; /* resource reference */ WmlClassCtrlDefPtr ctrlref; /* controls reference */ /* * Clear the reference pointers. Then go through the arguments, reasons, * and controls lists, and mark the referenced classes. */ wmlResolveClearRefPointers (); for ( resref=clsobj->arguments ; resref!= NULL ; resref=resref->next ) resref->act_resource->ref_ptr = resref; for ( resref=clsobj->reasons ; resref!= NULL ; resref=resref->next ) resref->act_resource->ref_ptr = resref; for ( ctrlref=clsobj->controls ; ctrlref!=NULL ; ctrlref=ctrlref->next ) ctrlref->ctrl->ref_ptr = ctrlref; } /* * Routine to clear reference pointers */ void wmlResolveClearRefPointers () { int ndx; /* loop index */ WmlClassDefPtr mrkcls; /* class object to mark */ WmlResourceDefPtr mrkres; /* resource object to mark */ WmlChildDefPtr mrkcld; /* child object to mark */ for ( ndx=0 ; ndxcnt ; ndx++ ) { mrkcls = (WmlClassDefPtr) wml_obj_allclass_ptr->hvec[ndx].objptr; mrkcls->ref_ptr = NULL; } for ( ndx=0 ; ndxcnt ; ndx++ ) { mrkres = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr; mrkres->ref_ptr = NULL; } for ( ndx=0 ; ndxcnt ; ndx++ ) { mrkres = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr; mrkres->ref_ptr = NULL; } for ( ndx=0 ; ndxcnt ; ndx++ ) { mrkcld = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr; mrkcld->ref_ptr = NULL; } } /* * Routine to find an object for binding. The name is always looked * in the syntactic object list, since all references made by the * user are in that list (resolved objects may be entered under * an internal literal, and not be found). This routine always attempts to * return a resolved object (which depends on object type). It also guarantees * that the object it finds matches the given type. * * name the object to be found * type type the object should match * requester requester name, for error messages * * Returns: pointer to the object found */ ObjectPtr wmlResolveFindObject (name, type, requester) char *name; int type; char *requester; { int objndx; /* the object index in the list */ WmlSynDefPtr synobj; /* syntactic object */ char errmsg[300]; objndx = wmlFindInHList (wml_synobj_ptr, name); if ( objndx < 0 ) { wmlIssueReferenceError (requester, name); return NULL; } synobj = (WmlSynDefPtr) wml_synobj_ptr ->hvec[objndx].objptr; if ( synobj->validation != type ) { sprintf (errmsg, "Object %s references object %s\n\tin a context where a different type of object is required", requester, name); wmlIssueError (errmsg); return NULL; } switch ( synobj->validation ) { case WmlClassDefValid: case WmlResourceDefValid: case WmlDataTypeDefValid: case WmlCtrlListDefValid: case WmlEnumSetDefValid: case WmlEnumValueDefValid: case WmlChildDefValid: return (ObjectPtr) synobj->rslvdef; break; default: return (ObjectPtr) synobj; } } /* * Report an object reference error * * srcname the object making the reference * badname the missing object */ void wmlIssueReferenceError (srcname, badname) char *srcname; char *badname; { printf ("\nObject %s references undefined object %s", srcname, badname); wml_err_count += 1; } /* * Report an attempt to make a reference which is not supported. */ void wmlIssueIllegalReferenceError (srcname, badname) char *srcname; char *badname; { printf ("\nObject %s cannot reference a %s object", srcname, badname); wml_err_count += 1; } /* * Report an error string. */ void wmlIssueError (errstg) char *errstg; { printf ("\n%s", errstg); wml_err_count += 1; } motif-2.3.8/tools/wml/UilConst.h0000644000175000017500000000205013211513006013420 00000000000000/* ** This file is automatically generated. Do not edit it by hand. **/ /* Table indexed by argument indicating whether argument is a constraint (TRUE) or a regular argument (FALSE). Each entry is one bit. Index and mask macros are defined to simplify access to the table */ static unsigned char constraint_tab_vec[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | 64, 0, 0 | 4, 0, 0, 0 | 128, 0 | 1 | 2 | 16, 0 | 16 | 32 | 64 | 128, 0 | 1 | 2 | 4, 0, 0, 0 | 64, 0, 0, 0, 0, 0, 0 | 4 | 8 | 16 | 32 | 64 | 128, 0 | 1, 0 | 128, 0, 0, 0 | 4 | 16, 0, 0, 0, 0 | 4, 0, 0 | 4 | 8, 0, 0 | 128, 0 | 1 | 16 | 32 | 64 | 128, 0 | 2 | 4 | 8 | 16, 0, 0, 0, 0 | 8, 0, 0 | 32, 0, 0 | 64 | 128, 0 | 1 | 2 | 32, 0 | 1, 0 | 2 | 32 | 64 | 128, 0 | 1, 0 | 64, 0 | 2 | 8, 0, 0 | 8 | 64, 0 | 2 | 4 | 8 | 16, 0, 0, 0 | 4, 0, 0, 0, 0 | 1 | 32, 0 | 2, 0 | 8 | 16, 0 | 32 | 128, 0 | 16 | 64 | 128, 0 | 4 | 8 | 32, 0 | 16, 0 | 1, 0, 0 | 32, 0 | 1 | 2 | 16, 0, 0 | 64, 0, 0, 0 | 32, 0}; externaldef(uil_sym_glbl) unsigned char *constraint_tab = constraint_tab_vec; motif-2.3.8/tools/wml/Makefile.am0000644000175000017500000000332413145162623013563 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README wmllex.c wmllex.l motif.wml Uil.y Uil.c Uil.h UilLexPars.h UilLexPars.c AM_YFLAGS = -d #AM_LFLAGS = -l WMLTARGETS = UilConst.h UilKeyTab.h \ UilSymArTa.h UilSymArTy.h UilSymCSet.h UilSymCtl.h \ UilSymEnum.h UilSymGen.h UilSymNam.h UilSymRArg.h \ UilSymReas.h UilTokName.h UilUrmClas.h UilSymChCl.h \ UilSymChTa.h TABLE = motif.wml WMDTABLE = motif.wmd WMLTOOLS = wml wmluiltok REPORT = wml.report wmldir = $(includedir)/uil wml_HEADERS = UilDBDef.h noinst_HEADERS = wml.h wmlparse.h $(WMLTARGETS) noinst_PROGRAMS = wml wmluiltok wmldbcreate wmluiltok_SOURCES = wmluiltok.l wmluiltok_LDADD = @LEXLIB@ wml_SOURCES = wml.c wml_LDADD = -L. -lwml wml_DEPENDENCIES = libwml.a wmldbcreate_LDADD = ../../lib/Xm/libXm.la INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} noinst_LIBRARIES = libwml.a libwml_a_SOURCES = wmlparse.y wml.c wmloutkey.c wmlouth.c wmloutmm.c wmloutp1.c wmlresolve.c wmlsynbld.c wmlutils.c wmlparse.c: wmllex.c wmllex.c: wmllex.l wmlsynbld.c: wmlparse.h $(srcdir)/wmldbcreate.c: $(WMLTARGETS) UilLexPars.h UilLexPars.h: UilLexPars.c UilLexPars.c: Uil.c $(LN_S) Uil.h UilLexPars.h $(LN_S) Uil.c UilLexPars.c $(WMLTARGETS): wml-uil.mm wml-uil.mm: wmluiltok wml UilLexPars.c $(TABLE) $(RM) $(WMLTARGETS) wml.report wml-uil.mm ./wmluiltok <$(srcdir)/Uil.y >tokens.dat $(RM) wml-uil.mm ./wml $(srcdir)/$(TABLE) $(RM) tokens.dat all: motif.wmd motif.wmd: wmldbcreate ./wmldbcreate -o motif.wmd clean-local: $(RM) $(WMLTARGETS) $(WMDTABLE) $(REPORT) lex.yy.c libwml.a wml \ *.mm *.sdml *.txt wmlparse.c wmlparse.h wmluiltok wmllex.c \ tokens.dat DONE wmluiltok.c Uil.c Uil.h wml.report UilLexPars.[ch] ylwrap motif-2.3.8/tools/Makefile.am0000644000175000017500000000007713145162623012766 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = SUBDIRS = wml motif-2.3.8/ltversion.m40000644000175000017500000000127313011021115012036 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) motif-2.3.8/missing0000755000175000017500000001533013011021645011155 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: motif-2.3.8/libtool.m40000644000175000017500000112507313011021115011463 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 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. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) 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. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname 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 yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS motif-2.3.8/ltoptions.m40000644000175000017500000003426213011021115012050 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) motif-2.3.8/clients/0000755000175000017500000000000013211513006011274 500000000000000motif-2.3.8/clients/uil/0000755000175000017500000000000013211513006012065 500000000000000motif-2.3.8/clients/uil/UilIODef.h0000644000175000017500000000267213145162623013600 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interface to the operating system ** io facilities. ** **-- **/ #ifndef UilIODef_h #define UilIODef_h /* ** Define a UIL File Control Block or FCB. */ #include #ifndef NULL #define NULL 0L #endif typedef struct { FILE *az_file_ptr; char *c_buffer; boolean v_position_before_get; z_key last_key; char expanded_name[ 256 ]; } uil_fcb_type; #endif /* UilIODef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilMessTab.h0000644000175000017500000002131313145162623014201 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** DECwindows Toolkit User Interface Language Compiler (UIL) **-- **/ char XmConst msg0[36] = "duplicate option \"%s\" was ignored"; char XmConst msg1[34] = "unknown option \"%s\" was ignored"; char XmConst msg2[43] = "additional UIL source file: %s was ignored"; char XmConst msg3[30] = "error opening source file: %s"; char XmConst msg4[43] = "error reading next line of source file: %s"; char XmConst msg5[19] = "Internal error: %s"; char XmConst msg6[32] = "line truncated at %d characters"; char XmConst msg7[31] = "value of %s is out of range %s"; char XmConst msg8[21] = "%s not terminated %s"; char XmConst msg9[37] = "unprintable character \\%d\\ ignored"; char XmConst msg10[32] = "unknown sequence \"%s\" ignored"; char XmConst msg11[46] = "unknown escape sequence \"\\%c\" - \\ ignored"; char XmConst msg12[46] = "name exceeds %d characters - truncated to: %s"; char XmConst msg13[35] = "compiler ran out of virtual memory"; char XmConst msg14[56] = "unexpected %s token seen - parsing resumes after \"%c\""; char XmConst msg15[44] = "%s %s must be defined before this reference"; char XmConst msg16[41] = "context requires a %s - %s was specified"; char XmConst msg17[26] = "%s is not implemented yet"; char XmConst msg18[39] = "found %s value when expecting %s value"; char XmConst msg19[45] = "the %s %s is not supported for the %s object"; char XmConst msg20[62] = "this %s %s is superseded by the last definition in this %s %s"; char XmConst msg21[33] = "name %s previously defined as %s"; char XmConst msg22[43] = "value used in this context must be private"; char XmConst msg23[55] = "procedure %s was previously declared with %d arguments"; char XmConst msg24[56] = "found %s value - procedure %s argument must be %s value"; char XmConst msg25[33] = "found %s %s when expecting %s %s"; char XmConst msg26[24] = "%s %s was never defined"; char XmConst msg27[39] = "%s %s already specified for this %s %s"; char XmConst msg28[29] = "%s item not allowed in %s %s"; char XmConst msg29[45] = "compilation terminated - fix previous errors"; char XmConst msg30[38] = "internal error - submit defect report"; char XmConst msg31[2] = " "; char XmConst msg32[35] = "%s missing following \"%s\" option"; char XmConst msg33[31] = "error opening listing file: %s"; char XmConst msg34[34] = "error writing to listing file: %s"; char XmConst msg35[51] = "invalid module structure - check UIL module syntax"; char XmConst msg36[31] = "too many source files open: %s"; char XmConst msg37[38] = "source line contains a null character"; char XmConst msg38[45] = "errors: %d warnings: %d informationals: %d"; char XmConst msg39[27] = "error opening UID file: %s"; char XmConst msg40[25] = "no UID file was produced"; char XmConst msg41[53] = "creation procedure is not supported by the %s widget"; char XmConst msg42[59] = "creation procedure is not allowed in a %s widget reference"; char XmConst msg43[58] = "creation procedure is required in a %s widget declaration"; char XmConst msg44[46] = "a NULL character in a string is not supported"; char XmConst msg45[43] = "widget %s is part of a circular definition"; char XmConst msg46[25] = "no source file specified"; char XmConst msg47[35] = "%s %s supports only a single %s %s"; char XmConst msg48[41] = "%s widget supports only a single control"; char XmConst msg49[22] = "unknown character set"; char XmConst msg50[47] = "place names clause before other module clauses"; char XmConst msg51[47] = "color letter string must be a single character"; char XmConst msg52[48] = "color letter used for prior color in this table"; char XmConst msg53[37] = "row %d must have same width as row 1"; char XmConst msg54[52] = "row %d, column %d: letter \"%c\" not in color table"; char XmConst msg55[32] = "too many %ss in %s, limit is %d"; char XmConst msg56[48] = "Subqualifier not allowed with negated qualifier"; char XmConst msg57[60] = "%s gadget is not supported - %s widget will be used instead"; char XmConst msg58[28] = "%s type is not valid for %s"; char XmConst msg59[66] = "support for this character set may be removed in a future release"; char XmConst msg60[49] = "the %s constraint is not supported for the %s %s"; char XmConst msg61[37] = "too many \"%s\" options, limit is %d"; char XmConst msg62[30] = "error closing source file: %s"; char XmConst msg63[35] = "the %s value is circularly defined"; char XmConst msg64[28] = "overriding built-in name %s"; char XmConst msg65[51] = "the %s argument does not support enumerated values"; char XmConst msg66[57] = "the %s argument does not support the %s enumerated value"; char XmConst msg67[40] = "$LANG contains an unknown character set"; char XmConst msg68[66] = "the %s object's controls hierarchy contains a reference to itself"; char XmConst msg69[41] = "value %s is too large for context buffer"; char XmConst msg70[42] = "forward referencing is not allowed for %s"; char XmConst msg71[34] = "cannot convert %s type to %s type"; char XmConst msg72[14] = "%s is invalid"; char XmConst msg73[30] = "error reading binary database"; char XmConst msg74[47] = "binary database compiled with a future version"; char XmConst msg75[32] = "error opening database file: %s"; char XmConst msg76[27] = "error writing UID file: %s"; char XmConst msg77[45] = "'%s' is an unknown Toolkit class record name"; char XmConst msg78[26] = "invalid include file name"; char XmConst msg79[49] = "incompatible unit types for arithmetic operation"; char XmConst msg80[54] = "%s used as charset name; %s used as charset component"; typedef struct { XmConst int l_severity; char XmConst *ac_text; } diag_rz_msg_entry; XmConst diag_rz_msg_entry diag_rz_msg_table[81] = { { 2, msg0 }, { 2, msg1 }, { 3, msg2 }, { 4, msg3 }, { 4, msg4 }, { 4, msg5 }, { 3, msg6 }, { 3, msg7 }, { 3, msg8 }, { 3, msg9 }, { 3, msg10 }, { 3, msg11 }, { 3, msg12 }, { 4, msg13 }, { 3, msg14 }, { 3, msg15 }, { 3, msg16 }, { 3, msg17 }, { 3, msg18 }, { 2, msg19 }, { 1, msg20 }, { 3, msg21 }, { 3, msg22 }, { 3, msg23 }, { 3, msg24 }, { 3, msg25 }, { 3, msg26 }, { 3, msg27 }, { 3, msg28 }, { 4, msg29 }, { 4, msg30 }, { 1, msg31 }, { 3, msg32 }, { 4, msg33 }, { 4, msg34 }, { 3, msg35 }, { 4, msg36 }, { 3, msg37 }, { 1, msg38 }, { 4, msg39 }, { 1, msg40 }, { 3, msg41 }, { 3, msg42 }, { 3, msg43 }, { 2, msg44 }, { 3, msg45 }, { 4, msg46 }, { 2, msg47 }, { 2, msg48 }, { 3, msg49 }, { 3, msg50 }, { 3, msg51 }, { 3, msg52 }, { 3, msg53 }, { 3, msg54 }, { 3, msg55 }, { 4, msg56 }, { 2, msg57 }, { 3, msg58 }, { 2, msg59 }, { 2, msg60 }, { 2, msg61 }, { 2, msg62 }, { 3, msg63 }, { 2, msg64 }, { 2, msg65 }, { 2, msg66 }, { 3, msg67 }, { 3, msg68 }, { 4, msg69 }, { 4, msg70 }, { 3, msg71 }, { 3, msg72 }, { 4, msg73 }, { 4, msg74 }, { 4, msg75 }, { 4, msg76 }, { 2, msg77 }, { 4, msg78 }, { 4, msg79 }, { 1, msg80 }, }; #ifndef NO_MESSAGE_CATALOG #include #include "UilMsgCatI.h" externalref nl_catd uil_catd; XmConst int msg_cat_table[81] = { UIL_0, UIL_1, UIL_2, UIL_3, UIL_4, UIL_5, UIL_6, UIL_7, UIL_8, UIL_9, UIL_10, UIL_11, UIL_12, UIL_13, UIL_14, UIL_15, UIL_16, UIL_17, UIL_18, UIL_19, UIL_20, UIL_21, UIL_22, UIL_23, UIL_24, UIL_25, UIL_26, UIL_27, UIL_28, UIL_29, UIL_30, UIL_31, UIL_32, UIL_33, UIL_34, UIL_35, UIL_36, UIL_37, UIL_38, UIL_39, UIL_40, UIL_41, UIL_42, UIL_43, UIL_44, UIL_45, UIL_46, UIL_47, UIL_48, UIL_49, UIL_50, UIL_51, UIL_52, UIL_53, UIL_54, UIL_55, UIL_56, UIL_57, UIL_58, UIL_59, UIL_60, UIL_61, UIL_62, UIL_63, UIL_64, UIL_65, UIL_66, UIL_67, UIL_68, UIL_69, UIL_70, UIL_71, UIL_72, UIL_V2_73, UIL_V2_74, UIL_V2_75, UIL_V2_76, UIL_V2_77, UIL_78, UIL_V2_79, UIL_V2_80, }; #endif motif-2.3.8/clients/uil/UilSarDef.h0000644000175000017500000001041313145162623014006 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interface to the UIL parser. ** UIL uses YACC as its parsing tool. ** **-- **/ #ifndef UilSarDef_h #define UilSarDef_h /* ** Format of a value on YACC value stack. This is also the form of a ** token created by the lexical analyzer. */ #define sar_k_null_frame 0 /* tag for an epsilon production */ #define sar_k_token_frame 1 /* tag for a token frame */ #define sar_k_value_frame 2 /* tag for a value frame */ #define sar_k_module_frame 3 /* tag for module frame */ #define sar_k_object_frame 4 /* tag for object frame */ #define sar_k_root_frame 5 /* tag for root frame */ typedef struct { src_source_record_type *az_source_record; /* actual record where token exists */ unsigned char b_source_pos; /* the character in az_source_record where this token begins */ unsigned char b_source_end; /* the character in az_source_record where this token ends */ unsigned char b_tag; /* tag of stack frame */ unsigned char b_type; /* for tokens - token number for value - the data type */ unsigned short b_flags; /* used by value */ unsigned char b_direction; /* used by value */ unsigned char b_charset; /* used by value */ union { /* must be capable of holding a pointer */ long l_integer; /* integer value*/ sym_entry_type *az_symbol_entry; /* symbol entry */ key_keytable_entry_type *az_keyword_entry; /* keyword entry */ } value; } yystype; /* ** Macros for moving source information to and from parse stack frames */ #define _sar_move_source_info( _target, _source ) \ { \ yystype *__target; \ yystype *__source; \ \ __target = (_target); __source = (_source); \ __target->az_source_record = __source->az_source_record;\ __target->b_source_pos = __source->b_source_pos; \ __target->b_source_end = __source->b_source_end; \ } #define _sar_move_source_info_2( _target, _source ) \ { \ sym_entry_header_type *__target; \ sym_entry_header_type *__source; \ \ __target = (_target); __source = (_source); \ \ __target->az_src_rec = __source->az_src_rec; \ __target->b_src_pos = __source->b_src_pos; \ __target->b_end_pos = __source->b_end_pos; \ } #define _sar_save_source_info( _target, _src_beg, _src_end ) \ { \ sym_entry_header_type *__target; \ XmConst yystype *__src_end; \ \ __target = (_target); \ __src_end = (_src_end); \ \ __target->az_src_rec = __src_end->az_source_record; \ __target->b_src_pos = __src_end->b_source_pos; \ __target->b_end_pos = __src_end->b_source_end; \ } #define _sar_save_source_pos( _target, _src ) \ { \ sym_entry_header_type *__target; \ XmConst yystype *__src; \ \ __target = (_target); __src = (_src); \ \ __target->az_src_rec = __src->az_source_record; \ __target->b_src_pos = __src->b_source_pos; \ __target->b_end_pos = __src->b_source_end; \ } #define _sar_source_position( _source ) \ _source->az_source_record, \ _source->b_source_pos #define _sar_source_pos2( _source ) \ _source->header.az_src_rec, \ _source->header.b_src_pos #endif /* UilSarDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilSarExp.c0000644000175000017500000001476213145162623014052 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilSarExp.c /main/11 1995/07/14 09:37:03 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module supports value expressions in UIL. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function processes a binary arithmetic operator in an expression ** ** FORMAL PARAMETERS: ** ** operator_frame: [in-out] frame holding the operator and the ** target frame ** op1_frame: [in] frame holding operand 1 ** op2_frame: [in] frame holding operand 2 ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** op1 or op2 symbol entry may be freed ** **-- **/ void sar_binary_op(operator_frame, op1_frame, op2_frame) yystype *operator_frame; yystype *op1_frame; yystype *op2_frame; { sym_value_entry_type *res_entry; int operator = 0; _assert( operator_frame->b_tag == sar_k_token_frame, "operator missing" ); res_entry = (sym_value_entry_type *) sem_allocate_node( sym_k_value_entry, sym_k_value_entry_size ); res_entry->obj_header.b_flags = sym_m_builtin | sym_m_private; res_entry->b_type = sym_k_any_value; /* res_entry->az_source_rec = op1_frame->az_source_record; */ _sar_save_source_pos (&res_entry->header, op1_frame); /* ** Determine the operator from the operator frame */ switch (operator_frame->b_type) { case AND: operator = sym_k_and_op; break; case PLUS: operator = sym_k_add_op; break; case MINUS: operator = sym_k_subtract_op; break; case MULTIPLY: operator = sym_k_multiply_op; break; case DIVIDE: operator = sym_k_divide_op; break; case LEFT_SHIFT: operator = sym_k_left_shift_op; break; case RIGHT_SHIFT: operator = sym_k_right_shift_op; break; case OR: operator = sym_k_or_op; break; case XOR: operator = sym_k_or_op; break; default: _assert( FALSE, "unknown binary operator" ); } res_entry->b_expr_opr = operator; /* ** If the value is a forward reference, we'll patch in the ** address of the the referenced value between passes. Otherwise, ** just point to the referenced value node. */ if ((op1_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (op1_frame, (char*)&(res_entry->az_exp_op1), sym_k_patch_add); else res_entry->az_exp_op1 = (sym_value_entry_type *) op1_frame->value.az_symbol_entry; if ((op2_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (op2_frame, (char*)&(res_entry->az_exp_op2), sym_k_patch_add); else res_entry->az_exp_op2 = (sym_value_entry_type *) op2_frame->value.az_symbol_entry; operator_frame->b_tag = sar_k_value_frame; operator_frame->b_type = res_entry->b_type; operator_frame->b_flags = res_entry->obj_header.b_flags; operator_frame->value.az_symbol_entry = (sym_entry_type *) res_entry; return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function processes a unary arithmetic operator in an expression ** ** FORMAL PARAMETERS: ** ** operator_frame: [in-out] frame holding the operator and the ** target frame ** op1_frame: [in] frame holding operand 1 ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** op1 symbol entry may be freed ** **-- **/ void sar_unary_op(operator_frame, op1_frame) yystype *operator_frame; yystype *op1_frame; { sym_value_entry_type *res_entry; int operator = 0; int res_type = 0; _assert( operator_frame->b_tag == sar_k_token_frame, "operator missing" ); /* ** Determine the operator from the operator frame */ switch (operator_frame->b_type) { case PLUS: operator = sym_k_unary_plus_op; break; case MINUS: operator = sym_k_unary_minus_op; break; case NOT: operator = sym_k_not_op; break; case INTEGER: res_type = sym_k_integer_value; operator = sym_k_coerce_op; break; case FLOAT: res_type = sym_k_float_value; operator = sym_k_coerce_op; break; case SINGLE_FLOAT: res_type = sym_k_single_float_value; operator = sym_k_coerce_op; break; case KEYSYM: res_type = sym_k_keysym_value; operator = sym_k_coerce_op; break; default: _assert( FALSE, "unknown unary operator" ); } /* ** Create the result */ res_entry = (sym_value_entry_type *) sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size); res_entry->b_expr_opr = operator; /* Begin fixing OSF CR 5691 */ res_entry->b_type = operator; /* End fixing OSF CR 5691 */ res_entry->az_exp_op1 = (sym_value_entry_type *) op1_frame->value.az_symbol_entry; res_entry->obj_header.b_flags = sym_m_builtin | sym_m_private; if (operator == sym_k_coerce_op) res_entry->b_type = res_type; _sar_save_source_pos (&res_entry->header, op1_frame ); operator_frame->b_tag = sar_k_value_frame; operator_frame->b_type = res_entry->b_type; operator_frame->b_flags = res_entry->obj_header.b_flags; operator_frame->value.az_symbol_entry = (sym_entry_type *) res_entry; return; } motif-2.3.8/clients/uil/UilP2Reslv.c0000644000175000017500000001541113145162623014135 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilP2Reslv.c /main/11 1995/07/14 09:36:35 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contain the second pass routines for resolving forward ** references. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function processes forward references from the first pass. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** sym_az_forward_ref_chain ** sym_az_val_forward_ref_chain ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error messages may be issued for objects that are still undefined ** or of the wrong type ** **-- **/ void sem_resolve_forward_refs() { sym_forward_ref_entry_type * fwd_entry; sym_forward_ref_entry_type * next_fwd_entry; sym_val_forward_ref_entry_type * fwd_val_entry; sym_val_forward_ref_entry_type * next_fwd_val_entry; sym_widget_entry_type ** target_obj_entry; sym_value_entry_type ** target_val_entry; sym_parent_list_type * parent_node; sym_parent_list_type * parent_ptr; int found; /* ** Forward references are placed on a chain by the first pass of ** the compiler. This routine walks the chain checking that ** 1) name is now defined ** 2) name points to the correct type of object */ for (fwd_entry = sym_az_forward_ref_chain; fwd_entry != NULL; fwd_entry = next_fwd_entry) { sym_name_entry_type * name_entry; sym_widget_entry_type * object_entry; unsigned short int object_type; /* ** Save the pointer to the next forward entry so we can free the current ** entry after it is processed. */ next_fwd_entry = fwd_entry->az_next_ref; /* ** Call the Status callback routine to report our progress. */ /* %COMPLETE */ Uil_percent_complete = 60; if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL) diag_report_status(); object_type = fwd_entry->header.b_type; name_entry = fwd_entry->az_name; object_entry = (sym_widget_entry_type *) name_entry->az_object; if (object_entry == NULL) { diag_issue_diagnostic ( d_never_def, _sar_source_pos2 (fwd_entry), diag_object_text( object_type ), name_entry->c_text ); continue; } /* ** Make sure object references are to correct type of object. ** A forward reference naming a widget class may be correctly ** resolved by the corresponding gadget class, and vice versa. */ if ((object_entry->header.b_type!=object_type) && (uil_gadget_variants[(int)object_entry->header.b_type]!=object_type) && (uil_gadget_variants[object_type]!=object_entry->header.b_type)) { diag_issue_diagnostic (d_ctx_req, _sar_source_pos2(fwd_entry), diag_object_text(object_type), diag_object_text(object_entry->header.b_type)); continue; } target_obj_entry = (sym_widget_entry_type * *) fwd_entry->a_update_location; *target_obj_entry = object_entry; /* ** Update objects on forward refernce chain so that their parent_lists point ** to the objects which reference them */ if (fwd_entry -> parent != NULL) { found = FALSE; for (parent_ptr = object_entry -> parent_list; ((parent_ptr != NULL) && (found == FALSE)); parent_ptr = parent_ptr -> next) { if (parent_ptr -> parent == fwd_entry -> parent) found = TRUE; } if (found == FALSE) { parent_node = (sym_parent_list_type *) sem_allocate_node (sym_k_parent_list_entry, sym_k_parent_list_size); parent_node -> next = object_entry -> parent_list; object_entry -> parent_list = parent_node; parent_node -> parent = fwd_entry -> parent; } } /* ** Free the Forward reference entry now that it is no longer needed */ sem_free_node(( sym_entry_type *)fwd_entry); } /* ** Now resolve the forward references to values **/ /* ** Forward references are placed on a chain by the first pass of ** the compiler. This routine walks the chain checking that ** 1) name is now defined ** 2) name points to the correct type of value */ for (fwd_val_entry = sym_az_val_forward_ref_chain; fwd_val_entry != NULL; fwd_val_entry = next_fwd_val_entry) { sym_name_entry_type * name_entry; sym_value_entry_type * value_entry; sym_obj_entry_type * obj_entry; /* ** Save the pointer to the next forward entry so we can free the current ** entry after it is processed. */ next_fwd_val_entry = fwd_val_entry->az_next_ref; /* ** Call the Status callback routine to report our progress. */ /* %COMPLETE */ Uil_percent_complete = 60; if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL) diag_report_status(); name_entry = fwd_val_entry->az_name; value_entry = (sym_value_entry_type *) name_entry->az_object; obj_entry = (sym_obj_entry_type *) name_entry->az_object; if (value_entry == NULL) { diag_issue_diagnostic ( d_never_def, _sar_source_pos2 (fwd_val_entry), "value", name_entry->c_text ); continue; } switch (fwd_val_entry->fwd_ref_flags) { case (sym_k_patch_add): case (sym_k_patch_list_add): { target_val_entry = (sym_value_entry_type * *) fwd_val_entry->a_update_location; *target_val_entry = value_entry; break; } default: _assert(FALSE, "Illegal forward reference"); } /* ** Free the Forward reference entry now that it is no longer needed */ sem_free_node(( sym_entry_type *)fwd_val_entry); } } motif-2.3.8/clients/uil/Makefile.in0000644000175000017500000022005113211512765014065 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = uil$(EXEEXT) subdir = clients/uil ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) $(uil_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(uildir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__objects_1 = UilCmd.lo UilDiags.lo UilKeyTab.lo UilLexAna.lo \ UilLexPars.lo UilLstLst.lo UilP2Out.lo UilP2Reslv.lo \ UilSarComp.lo UilSarExp.lo UilSarInc.lo UilSarMod.lo \ UilSarObj.lo UilSarProc.lo UilSarVal.lo UilSrcSrc.lo \ UilSymNam.lo UilSymStor.lo UilData.lo UilLstMac.lo \ UilSemVal.lo UilSemCSet.lo UilDB.lo am__objects_2 = $(am__objects_1) am_libUil_la_OBJECTS = $(am__objects_2) libUil_la_OBJECTS = $(am_libUil_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libUil_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libUil_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am__objects_3 = uil-UilCmd.$(OBJEXT) uil-UilDiags.$(OBJEXT) \ uil-UilKeyTab.$(OBJEXT) uil-UilLexAna.$(OBJEXT) \ uil-UilLexPars.$(OBJEXT) uil-UilLstLst.$(OBJEXT) \ uil-UilP2Out.$(OBJEXT) uil-UilP2Reslv.$(OBJEXT) \ uil-UilSarComp.$(OBJEXT) uil-UilSarExp.$(OBJEXT) \ uil-UilSarInc.$(OBJEXT) uil-UilSarMod.$(OBJEXT) \ uil-UilSarObj.$(OBJEXT) uil-UilSarProc.$(OBJEXT) \ uil-UilSarVal.$(OBJEXT) uil-UilSrcSrc.$(OBJEXT) \ uil-UilSymNam.$(OBJEXT) uil-UilSymStor.$(OBJEXT) \ uil-UilData.$(OBJEXT) uil-UilLstMac.$(OBJEXT) \ uil-UilSemVal.$(OBJEXT) uil-UilSemCSet.$(OBJEXT) \ uil-UilDB.$(OBJEXT) am__objects_4 = $(am__objects_3) uil-UilMain.$(OBJEXT) am_uil_OBJECTS = $(am__objects_4) uil_OBJECTS = $(am_uil_OBJECTS) uil_DEPENDENCIES = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la uil_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(uil_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libUil_la_SOURCES) $(uil_SOURCES) DIST_SOURCES = $(libUil_la_SOURCES) $(uil_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) $(uil_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in Uil.cat UilMsgCatI.h EXTRA_DIST = Uil.msg libUil_la_LDFLAGS = -version-info @CURRENT@:@REVISION@:@AGE@ libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la INCLUDES = -DINCDIR=\"@INCDIR@\" \ -DLIBDIR=\"@LIBDIR@\" \ -I$(srcdir)/../../include \ -I$(srcdir)/../../lib \ -I$(srcdir)/../../tools/wml \ -I../../include \ -I../../lib \ -I../../tools/wml ${X_CFLAGS} BUILT_SOURCES = UilParser.c UilLexPars.c UilDBDef.h CLEANFILES = UilParser.c UilLexPars.c UilDBDef.h COMMON_SRC = UilCmd.c UilDiags.c UilKeyTab.c UilLexAna.c \ UilLexPars.c UilLstLst.c UilP2Out.c UilP2Reslv.c \ UilSarComp.c UilSarExp.c UilSarInc.c UilSarMod.c \ UilSarObj.c UilSarProc.c UilSarVal.c UilSrcSrc.c \ UilSymNam.c UilSymStor.c UilData.c \ UilLstMac.c UilSemVal.c UilSemCSet.c UilDB.c SRCS = $(COMMON_SRC) SRCS2 = $(COMMON_SRC) UilMain.c HEADERS_1 = Uil.h UilSymGl.h UilSymDef.h \ UilDef.h XmAppl.uil uildir = $(includedir)/uil uil_HEADERS = $(HEADERS_1) noinst_HEADERS = UilCmdDef.h \ UilCompGl.h \ UilDefI.h \ UilDiagDef.h \ UilIODef.h \ UilLexDef.h \ UilMess.h \ UilMessTab.h \ UilSarDef.h \ UilSrcDef.h lib_LTLIBRARIES = libUil.la uil_SOURCES = $(SRCS2) uil_CFLAGS = $(AM_CFLAGS) libUil_la_SOURCES = $(SRCS) libUil_la_DEPENDENCIES = UilDBDef.h UilParser.lo @MessageCatalog_TRUE@CAT_FILES = Uil.cat UilMsgCatI.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clients/uil/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign clients/uil/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libUil.la: $(libUil_la_OBJECTS) $(libUil_la_DEPENDENCIES) $(EXTRA_libUil_la_DEPENDENCIES) $(AM_V_CCLD)$(libUil_la_LINK) -rpath $(libdir) $(libUil_la_OBJECTS) $(libUil_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list uil$(EXEEXT): $(uil_OBJECTS) $(uil_DEPENDENCIES) $(EXTRA_uil_DEPENDENCIES) @rm -f uil$(EXEEXT) $(AM_V_CCLD)$(uil_LINK) $(uil_OBJECTS) $(uil_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilCmd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilDB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilDiags.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilKeyTab.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilLexAna.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilLexPars.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilLstLst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilLstMac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilP2Out.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilP2Reslv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSarComp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSarExp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSarInc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSarMod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSarObj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSarProc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSarVal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSemCSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSemVal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSrcSrc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSymNam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UilSymStor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilCmd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilDB.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilData.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilDiags.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilKeyTab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilLexAna.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilLexPars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilLstLst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilLstMac.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilMain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilP2Out.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilP2Reslv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSarComp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSarExp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSarInc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSarMod.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSarObj.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSarProc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSarVal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSemCSet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSemVal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSrcSrc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSymNam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uil-UilSymStor.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< uil-UilCmd.o: UilCmd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilCmd.o -MD -MP -MF $(DEPDIR)/uil-UilCmd.Tpo -c -o uil-UilCmd.o `test -f 'UilCmd.c' || echo '$(srcdir)/'`UilCmd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilCmd.Tpo $(DEPDIR)/uil-UilCmd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilCmd.c' object='uil-UilCmd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilCmd.o `test -f 'UilCmd.c' || echo '$(srcdir)/'`UilCmd.c uil-UilCmd.obj: UilCmd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilCmd.obj -MD -MP -MF $(DEPDIR)/uil-UilCmd.Tpo -c -o uil-UilCmd.obj `if test -f 'UilCmd.c'; then $(CYGPATH_W) 'UilCmd.c'; else $(CYGPATH_W) '$(srcdir)/UilCmd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilCmd.Tpo $(DEPDIR)/uil-UilCmd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilCmd.c' object='uil-UilCmd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilCmd.obj `if test -f 'UilCmd.c'; then $(CYGPATH_W) 'UilCmd.c'; else $(CYGPATH_W) '$(srcdir)/UilCmd.c'; fi` uil-UilDiags.o: UilDiags.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilDiags.o -MD -MP -MF $(DEPDIR)/uil-UilDiags.Tpo -c -o uil-UilDiags.o `test -f 'UilDiags.c' || echo '$(srcdir)/'`UilDiags.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilDiags.Tpo $(DEPDIR)/uil-UilDiags.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilDiags.c' object='uil-UilDiags.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilDiags.o `test -f 'UilDiags.c' || echo '$(srcdir)/'`UilDiags.c uil-UilDiags.obj: UilDiags.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilDiags.obj -MD -MP -MF $(DEPDIR)/uil-UilDiags.Tpo -c -o uil-UilDiags.obj `if test -f 'UilDiags.c'; then $(CYGPATH_W) 'UilDiags.c'; else $(CYGPATH_W) '$(srcdir)/UilDiags.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilDiags.Tpo $(DEPDIR)/uil-UilDiags.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilDiags.c' object='uil-UilDiags.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilDiags.obj `if test -f 'UilDiags.c'; then $(CYGPATH_W) 'UilDiags.c'; else $(CYGPATH_W) '$(srcdir)/UilDiags.c'; fi` uil-UilKeyTab.o: UilKeyTab.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilKeyTab.o -MD -MP -MF $(DEPDIR)/uil-UilKeyTab.Tpo -c -o uil-UilKeyTab.o `test -f 'UilKeyTab.c' || echo '$(srcdir)/'`UilKeyTab.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilKeyTab.Tpo $(DEPDIR)/uil-UilKeyTab.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilKeyTab.c' object='uil-UilKeyTab.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilKeyTab.o `test -f 'UilKeyTab.c' || echo '$(srcdir)/'`UilKeyTab.c uil-UilKeyTab.obj: UilKeyTab.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilKeyTab.obj -MD -MP -MF $(DEPDIR)/uil-UilKeyTab.Tpo -c -o uil-UilKeyTab.obj `if test -f 'UilKeyTab.c'; then $(CYGPATH_W) 'UilKeyTab.c'; else $(CYGPATH_W) '$(srcdir)/UilKeyTab.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilKeyTab.Tpo $(DEPDIR)/uil-UilKeyTab.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilKeyTab.c' object='uil-UilKeyTab.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilKeyTab.obj `if test -f 'UilKeyTab.c'; then $(CYGPATH_W) 'UilKeyTab.c'; else $(CYGPATH_W) '$(srcdir)/UilKeyTab.c'; fi` uil-UilLexAna.o: UilLexAna.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLexAna.o -MD -MP -MF $(DEPDIR)/uil-UilLexAna.Tpo -c -o uil-UilLexAna.o `test -f 'UilLexAna.c' || echo '$(srcdir)/'`UilLexAna.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLexAna.Tpo $(DEPDIR)/uil-UilLexAna.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLexAna.c' object='uil-UilLexAna.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLexAna.o `test -f 'UilLexAna.c' || echo '$(srcdir)/'`UilLexAna.c uil-UilLexAna.obj: UilLexAna.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLexAna.obj -MD -MP -MF $(DEPDIR)/uil-UilLexAna.Tpo -c -o uil-UilLexAna.obj `if test -f 'UilLexAna.c'; then $(CYGPATH_W) 'UilLexAna.c'; else $(CYGPATH_W) '$(srcdir)/UilLexAna.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLexAna.Tpo $(DEPDIR)/uil-UilLexAna.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLexAna.c' object='uil-UilLexAna.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLexAna.obj `if test -f 'UilLexAna.c'; then $(CYGPATH_W) 'UilLexAna.c'; else $(CYGPATH_W) '$(srcdir)/UilLexAna.c'; fi` uil-UilLexPars.o: UilLexPars.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLexPars.o -MD -MP -MF $(DEPDIR)/uil-UilLexPars.Tpo -c -o uil-UilLexPars.o `test -f 'UilLexPars.c' || echo '$(srcdir)/'`UilLexPars.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLexPars.Tpo $(DEPDIR)/uil-UilLexPars.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLexPars.c' object='uil-UilLexPars.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLexPars.o `test -f 'UilLexPars.c' || echo '$(srcdir)/'`UilLexPars.c uil-UilLexPars.obj: UilLexPars.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLexPars.obj -MD -MP -MF $(DEPDIR)/uil-UilLexPars.Tpo -c -o uil-UilLexPars.obj `if test -f 'UilLexPars.c'; then $(CYGPATH_W) 'UilLexPars.c'; else $(CYGPATH_W) '$(srcdir)/UilLexPars.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLexPars.Tpo $(DEPDIR)/uil-UilLexPars.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLexPars.c' object='uil-UilLexPars.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLexPars.obj `if test -f 'UilLexPars.c'; then $(CYGPATH_W) 'UilLexPars.c'; else $(CYGPATH_W) '$(srcdir)/UilLexPars.c'; fi` uil-UilLstLst.o: UilLstLst.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLstLst.o -MD -MP -MF $(DEPDIR)/uil-UilLstLst.Tpo -c -o uil-UilLstLst.o `test -f 'UilLstLst.c' || echo '$(srcdir)/'`UilLstLst.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLstLst.Tpo $(DEPDIR)/uil-UilLstLst.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLstLst.c' object='uil-UilLstLst.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLstLst.o `test -f 'UilLstLst.c' || echo '$(srcdir)/'`UilLstLst.c uil-UilLstLst.obj: UilLstLst.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLstLst.obj -MD -MP -MF $(DEPDIR)/uil-UilLstLst.Tpo -c -o uil-UilLstLst.obj `if test -f 'UilLstLst.c'; then $(CYGPATH_W) 'UilLstLst.c'; else $(CYGPATH_W) '$(srcdir)/UilLstLst.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLstLst.Tpo $(DEPDIR)/uil-UilLstLst.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLstLst.c' object='uil-UilLstLst.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLstLst.obj `if test -f 'UilLstLst.c'; then $(CYGPATH_W) 'UilLstLst.c'; else $(CYGPATH_W) '$(srcdir)/UilLstLst.c'; fi` uil-UilP2Out.o: UilP2Out.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilP2Out.o -MD -MP -MF $(DEPDIR)/uil-UilP2Out.Tpo -c -o uil-UilP2Out.o `test -f 'UilP2Out.c' || echo '$(srcdir)/'`UilP2Out.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilP2Out.Tpo $(DEPDIR)/uil-UilP2Out.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilP2Out.c' object='uil-UilP2Out.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilP2Out.o `test -f 'UilP2Out.c' || echo '$(srcdir)/'`UilP2Out.c uil-UilP2Out.obj: UilP2Out.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilP2Out.obj -MD -MP -MF $(DEPDIR)/uil-UilP2Out.Tpo -c -o uil-UilP2Out.obj `if test -f 'UilP2Out.c'; then $(CYGPATH_W) 'UilP2Out.c'; else $(CYGPATH_W) '$(srcdir)/UilP2Out.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilP2Out.Tpo $(DEPDIR)/uil-UilP2Out.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilP2Out.c' object='uil-UilP2Out.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilP2Out.obj `if test -f 'UilP2Out.c'; then $(CYGPATH_W) 'UilP2Out.c'; else $(CYGPATH_W) '$(srcdir)/UilP2Out.c'; fi` uil-UilP2Reslv.o: UilP2Reslv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilP2Reslv.o -MD -MP -MF $(DEPDIR)/uil-UilP2Reslv.Tpo -c -o uil-UilP2Reslv.o `test -f 'UilP2Reslv.c' || echo '$(srcdir)/'`UilP2Reslv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilP2Reslv.Tpo $(DEPDIR)/uil-UilP2Reslv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilP2Reslv.c' object='uil-UilP2Reslv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilP2Reslv.o `test -f 'UilP2Reslv.c' || echo '$(srcdir)/'`UilP2Reslv.c uil-UilP2Reslv.obj: UilP2Reslv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilP2Reslv.obj -MD -MP -MF $(DEPDIR)/uil-UilP2Reslv.Tpo -c -o uil-UilP2Reslv.obj `if test -f 'UilP2Reslv.c'; then $(CYGPATH_W) 'UilP2Reslv.c'; else $(CYGPATH_W) '$(srcdir)/UilP2Reslv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilP2Reslv.Tpo $(DEPDIR)/uil-UilP2Reslv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilP2Reslv.c' object='uil-UilP2Reslv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilP2Reslv.obj `if test -f 'UilP2Reslv.c'; then $(CYGPATH_W) 'UilP2Reslv.c'; else $(CYGPATH_W) '$(srcdir)/UilP2Reslv.c'; fi` uil-UilSarComp.o: UilSarComp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarComp.o -MD -MP -MF $(DEPDIR)/uil-UilSarComp.Tpo -c -o uil-UilSarComp.o `test -f 'UilSarComp.c' || echo '$(srcdir)/'`UilSarComp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarComp.Tpo $(DEPDIR)/uil-UilSarComp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarComp.c' object='uil-UilSarComp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarComp.o `test -f 'UilSarComp.c' || echo '$(srcdir)/'`UilSarComp.c uil-UilSarComp.obj: UilSarComp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarComp.obj -MD -MP -MF $(DEPDIR)/uil-UilSarComp.Tpo -c -o uil-UilSarComp.obj `if test -f 'UilSarComp.c'; then $(CYGPATH_W) 'UilSarComp.c'; else $(CYGPATH_W) '$(srcdir)/UilSarComp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarComp.Tpo $(DEPDIR)/uil-UilSarComp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarComp.c' object='uil-UilSarComp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarComp.obj `if test -f 'UilSarComp.c'; then $(CYGPATH_W) 'UilSarComp.c'; else $(CYGPATH_W) '$(srcdir)/UilSarComp.c'; fi` uil-UilSarExp.o: UilSarExp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarExp.o -MD -MP -MF $(DEPDIR)/uil-UilSarExp.Tpo -c -o uil-UilSarExp.o `test -f 'UilSarExp.c' || echo '$(srcdir)/'`UilSarExp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarExp.Tpo $(DEPDIR)/uil-UilSarExp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarExp.c' object='uil-UilSarExp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarExp.o `test -f 'UilSarExp.c' || echo '$(srcdir)/'`UilSarExp.c uil-UilSarExp.obj: UilSarExp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarExp.obj -MD -MP -MF $(DEPDIR)/uil-UilSarExp.Tpo -c -o uil-UilSarExp.obj `if test -f 'UilSarExp.c'; then $(CYGPATH_W) 'UilSarExp.c'; else $(CYGPATH_W) '$(srcdir)/UilSarExp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarExp.Tpo $(DEPDIR)/uil-UilSarExp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarExp.c' object='uil-UilSarExp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarExp.obj `if test -f 'UilSarExp.c'; then $(CYGPATH_W) 'UilSarExp.c'; else $(CYGPATH_W) '$(srcdir)/UilSarExp.c'; fi` uil-UilSarInc.o: UilSarInc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarInc.o -MD -MP -MF $(DEPDIR)/uil-UilSarInc.Tpo -c -o uil-UilSarInc.o `test -f 'UilSarInc.c' || echo '$(srcdir)/'`UilSarInc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarInc.Tpo $(DEPDIR)/uil-UilSarInc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarInc.c' object='uil-UilSarInc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarInc.o `test -f 'UilSarInc.c' || echo '$(srcdir)/'`UilSarInc.c uil-UilSarInc.obj: UilSarInc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarInc.obj -MD -MP -MF $(DEPDIR)/uil-UilSarInc.Tpo -c -o uil-UilSarInc.obj `if test -f 'UilSarInc.c'; then $(CYGPATH_W) 'UilSarInc.c'; else $(CYGPATH_W) '$(srcdir)/UilSarInc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarInc.Tpo $(DEPDIR)/uil-UilSarInc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarInc.c' object='uil-UilSarInc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarInc.obj `if test -f 'UilSarInc.c'; then $(CYGPATH_W) 'UilSarInc.c'; else $(CYGPATH_W) '$(srcdir)/UilSarInc.c'; fi` uil-UilSarMod.o: UilSarMod.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarMod.o -MD -MP -MF $(DEPDIR)/uil-UilSarMod.Tpo -c -o uil-UilSarMod.o `test -f 'UilSarMod.c' || echo '$(srcdir)/'`UilSarMod.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarMod.Tpo $(DEPDIR)/uil-UilSarMod.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarMod.c' object='uil-UilSarMod.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarMod.o `test -f 'UilSarMod.c' || echo '$(srcdir)/'`UilSarMod.c uil-UilSarMod.obj: UilSarMod.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarMod.obj -MD -MP -MF $(DEPDIR)/uil-UilSarMod.Tpo -c -o uil-UilSarMod.obj `if test -f 'UilSarMod.c'; then $(CYGPATH_W) 'UilSarMod.c'; else $(CYGPATH_W) '$(srcdir)/UilSarMod.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarMod.Tpo $(DEPDIR)/uil-UilSarMod.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarMod.c' object='uil-UilSarMod.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarMod.obj `if test -f 'UilSarMod.c'; then $(CYGPATH_W) 'UilSarMod.c'; else $(CYGPATH_W) '$(srcdir)/UilSarMod.c'; fi` uil-UilSarObj.o: UilSarObj.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarObj.o -MD -MP -MF $(DEPDIR)/uil-UilSarObj.Tpo -c -o uil-UilSarObj.o `test -f 'UilSarObj.c' || echo '$(srcdir)/'`UilSarObj.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarObj.Tpo $(DEPDIR)/uil-UilSarObj.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarObj.c' object='uil-UilSarObj.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarObj.o `test -f 'UilSarObj.c' || echo '$(srcdir)/'`UilSarObj.c uil-UilSarObj.obj: UilSarObj.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarObj.obj -MD -MP -MF $(DEPDIR)/uil-UilSarObj.Tpo -c -o uil-UilSarObj.obj `if test -f 'UilSarObj.c'; then $(CYGPATH_W) 'UilSarObj.c'; else $(CYGPATH_W) '$(srcdir)/UilSarObj.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarObj.Tpo $(DEPDIR)/uil-UilSarObj.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarObj.c' object='uil-UilSarObj.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarObj.obj `if test -f 'UilSarObj.c'; then $(CYGPATH_W) 'UilSarObj.c'; else $(CYGPATH_W) '$(srcdir)/UilSarObj.c'; fi` uil-UilSarProc.o: UilSarProc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarProc.o -MD -MP -MF $(DEPDIR)/uil-UilSarProc.Tpo -c -o uil-UilSarProc.o `test -f 'UilSarProc.c' || echo '$(srcdir)/'`UilSarProc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarProc.Tpo $(DEPDIR)/uil-UilSarProc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarProc.c' object='uil-UilSarProc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarProc.o `test -f 'UilSarProc.c' || echo '$(srcdir)/'`UilSarProc.c uil-UilSarProc.obj: UilSarProc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarProc.obj -MD -MP -MF $(DEPDIR)/uil-UilSarProc.Tpo -c -o uil-UilSarProc.obj `if test -f 'UilSarProc.c'; then $(CYGPATH_W) 'UilSarProc.c'; else $(CYGPATH_W) '$(srcdir)/UilSarProc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarProc.Tpo $(DEPDIR)/uil-UilSarProc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarProc.c' object='uil-UilSarProc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarProc.obj `if test -f 'UilSarProc.c'; then $(CYGPATH_W) 'UilSarProc.c'; else $(CYGPATH_W) '$(srcdir)/UilSarProc.c'; fi` uil-UilSarVal.o: UilSarVal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarVal.o -MD -MP -MF $(DEPDIR)/uil-UilSarVal.Tpo -c -o uil-UilSarVal.o `test -f 'UilSarVal.c' || echo '$(srcdir)/'`UilSarVal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarVal.Tpo $(DEPDIR)/uil-UilSarVal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarVal.c' object='uil-UilSarVal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarVal.o `test -f 'UilSarVal.c' || echo '$(srcdir)/'`UilSarVal.c uil-UilSarVal.obj: UilSarVal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSarVal.obj -MD -MP -MF $(DEPDIR)/uil-UilSarVal.Tpo -c -o uil-UilSarVal.obj `if test -f 'UilSarVal.c'; then $(CYGPATH_W) 'UilSarVal.c'; else $(CYGPATH_W) '$(srcdir)/UilSarVal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSarVal.Tpo $(DEPDIR)/uil-UilSarVal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSarVal.c' object='uil-UilSarVal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSarVal.obj `if test -f 'UilSarVal.c'; then $(CYGPATH_W) 'UilSarVal.c'; else $(CYGPATH_W) '$(srcdir)/UilSarVal.c'; fi` uil-UilSrcSrc.o: UilSrcSrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSrcSrc.o -MD -MP -MF $(DEPDIR)/uil-UilSrcSrc.Tpo -c -o uil-UilSrcSrc.o `test -f 'UilSrcSrc.c' || echo '$(srcdir)/'`UilSrcSrc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSrcSrc.Tpo $(DEPDIR)/uil-UilSrcSrc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSrcSrc.c' object='uil-UilSrcSrc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSrcSrc.o `test -f 'UilSrcSrc.c' || echo '$(srcdir)/'`UilSrcSrc.c uil-UilSrcSrc.obj: UilSrcSrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSrcSrc.obj -MD -MP -MF $(DEPDIR)/uil-UilSrcSrc.Tpo -c -o uil-UilSrcSrc.obj `if test -f 'UilSrcSrc.c'; then $(CYGPATH_W) 'UilSrcSrc.c'; else $(CYGPATH_W) '$(srcdir)/UilSrcSrc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSrcSrc.Tpo $(DEPDIR)/uil-UilSrcSrc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSrcSrc.c' object='uil-UilSrcSrc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSrcSrc.obj `if test -f 'UilSrcSrc.c'; then $(CYGPATH_W) 'UilSrcSrc.c'; else $(CYGPATH_W) '$(srcdir)/UilSrcSrc.c'; fi` uil-UilSymNam.o: UilSymNam.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSymNam.o -MD -MP -MF $(DEPDIR)/uil-UilSymNam.Tpo -c -o uil-UilSymNam.o `test -f 'UilSymNam.c' || echo '$(srcdir)/'`UilSymNam.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSymNam.Tpo $(DEPDIR)/uil-UilSymNam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSymNam.c' object='uil-UilSymNam.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSymNam.o `test -f 'UilSymNam.c' || echo '$(srcdir)/'`UilSymNam.c uil-UilSymNam.obj: UilSymNam.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSymNam.obj -MD -MP -MF $(DEPDIR)/uil-UilSymNam.Tpo -c -o uil-UilSymNam.obj `if test -f 'UilSymNam.c'; then $(CYGPATH_W) 'UilSymNam.c'; else $(CYGPATH_W) '$(srcdir)/UilSymNam.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSymNam.Tpo $(DEPDIR)/uil-UilSymNam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSymNam.c' object='uil-UilSymNam.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSymNam.obj `if test -f 'UilSymNam.c'; then $(CYGPATH_W) 'UilSymNam.c'; else $(CYGPATH_W) '$(srcdir)/UilSymNam.c'; fi` uil-UilSymStor.o: UilSymStor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSymStor.o -MD -MP -MF $(DEPDIR)/uil-UilSymStor.Tpo -c -o uil-UilSymStor.o `test -f 'UilSymStor.c' || echo '$(srcdir)/'`UilSymStor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSymStor.Tpo $(DEPDIR)/uil-UilSymStor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSymStor.c' object='uil-UilSymStor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSymStor.o `test -f 'UilSymStor.c' || echo '$(srcdir)/'`UilSymStor.c uil-UilSymStor.obj: UilSymStor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSymStor.obj -MD -MP -MF $(DEPDIR)/uil-UilSymStor.Tpo -c -o uil-UilSymStor.obj `if test -f 'UilSymStor.c'; then $(CYGPATH_W) 'UilSymStor.c'; else $(CYGPATH_W) '$(srcdir)/UilSymStor.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSymStor.Tpo $(DEPDIR)/uil-UilSymStor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSymStor.c' object='uil-UilSymStor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSymStor.obj `if test -f 'UilSymStor.c'; then $(CYGPATH_W) 'UilSymStor.c'; else $(CYGPATH_W) '$(srcdir)/UilSymStor.c'; fi` uil-UilData.o: UilData.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilData.o -MD -MP -MF $(DEPDIR)/uil-UilData.Tpo -c -o uil-UilData.o `test -f 'UilData.c' || echo '$(srcdir)/'`UilData.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilData.Tpo $(DEPDIR)/uil-UilData.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilData.c' object='uil-UilData.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilData.o `test -f 'UilData.c' || echo '$(srcdir)/'`UilData.c uil-UilData.obj: UilData.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilData.obj -MD -MP -MF $(DEPDIR)/uil-UilData.Tpo -c -o uil-UilData.obj `if test -f 'UilData.c'; then $(CYGPATH_W) 'UilData.c'; else $(CYGPATH_W) '$(srcdir)/UilData.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilData.Tpo $(DEPDIR)/uil-UilData.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilData.c' object='uil-UilData.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilData.obj `if test -f 'UilData.c'; then $(CYGPATH_W) 'UilData.c'; else $(CYGPATH_W) '$(srcdir)/UilData.c'; fi` uil-UilLstMac.o: UilLstMac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLstMac.o -MD -MP -MF $(DEPDIR)/uil-UilLstMac.Tpo -c -o uil-UilLstMac.o `test -f 'UilLstMac.c' || echo '$(srcdir)/'`UilLstMac.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLstMac.Tpo $(DEPDIR)/uil-UilLstMac.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLstMac.c' object='uil-UilLstMac.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLstMac.o `test -f 'UilLstMac.c' || echo '$(srcdir)/'`UilLstMac.c uil-UilLstMac.obj: UilLstMac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilLstMac.obj -MD -MP -MF $(DEPDIR)/uil-UilLstMac.Tpo -c -o uil-UilLstMac.obj `if test -f 'UilLstMac.c'; then $(CYGPATH_W) 'UilLstMac.c'; else $(CYGPATH_W) '$(srcdir)/UilLstMac.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilLstMac.Tpo $(DEPDIR)/uil-UilLstMac.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilLstMac.c' object='uil-UilLstMac.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilLstMac.obj `if test -f 'UilLstMac.c'; then $(CYGPATH_W) 'UilLstMac.c'; else $(CYGPATH_W) '$(srcdir)/UilLstMac.c'; fi` uil-UilSemVal.o: UilSemVal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSemVal.o -MD -MP -MF $(DEPDIR)/uil-UilSemVal.Tpo -c -o uil-UilSemVal.o `test -f 'UilSemVal.c' || echo '$(srcdir)/'`UilSemVal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSemVal.Tpo $(DEPDIR)/uil-UilSemVal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSemVal.c' object='uil-UilSemVal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSemVal.o `test -f 'UilSemVal.c' || echo '$(srcdir)/'`UilSemVal.c uil-UilSemVal.obj: UilSemVal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSemVal.obj -MD -MP -MF $(DEPDIR)/uil-UilSemVal.Tpo -c -o uil-UilSemVal.obj `if test -f 'UilSemVal.c'; then $(CYGPATH_W) 'UilSemVal.c'; else $(CYGPATH_W) '$(srcdir)/UilSemVal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSemVal.Tpo $(DEPDIR)/uil-UilSemVal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSemVal.c' object='uil-UilSemVal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSemVal.obj `if test -f 'UilSemVal.c'; then $(CYGPATH_W) 'UilSemVal.c'; else $(CYGPATH_W) '$(srcdir)/UilSemVal.c'; fi` uil-UilSemCSet.o: UilSemCSet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSemCSet.o -MD -MP -MF $(DEPDIR)/uil-UilSemCSet.Tpo -c -o uil-UilSemCSet.o `test -f 'UilSemCSet.c' || echo '$(srcdir)/'`UilSemCSet.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSemCSet.Tpo $(DEPDIR)/uil-UilSemCSet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSemCSet.c' object='uil-UilSemCSet.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSemCSet.o `test -f 'UilSemCSet.c' || echo '$(srcdir)/'`UilSemCSet.c uil-UilSemCSet.obj: UilSemCSet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilSemCSet.obj -MD -MP -MF $(DEPDIR)/uil-UilSemCSet.Tpo -c -o uil-UilSemCSet.obj `if test -f 'UilSemCSet.c'; then $(CYGPATH_W) 'UilSemCSet.c'; else $(CYGPATH_W) '$(srcdir)/UilSemCSet.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilSemCSet.Tpo $(DEPDIR)/uil-UilSemCSet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilSemCSet.c' object='uil-UilSemCSet.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilSemCSet.obj `if test -f 'UilSemCSet.c'; then $(CYGPATH_W) 'UilSemCSet.c'; else $(CYGPATH_W) '$(srcdir)/UilSemCSet.c'; fi` uil-UilDB.o: UilDB.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilDB.o -MD -MP -MF $(DEPDIR)/uil-UilDB.Tpo -c -o uil-UilDB.o `test -f 'UilDB.c' || echo '$(srcdir)/'`UilDB.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilDB.Tpo $(DEPDIR)/uil-UilDB.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilDB.c' object='uil-UilDB.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilDB.o `test -f 'UilDB.c' || echo '$(srcdir)/'`UilDB.c uil-UilDB.obj: UilDB.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilDB.obj -MD -MP -MF $(DEPDIR)/uil-UilDB.Tpo -c -o uil-UilDB.obj `if test -f 'UilDB.c'; then $(CYGPATH_W) 'UilDB.c'; else $(CYGPATH_W) '$(srcdir)/UilDB.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilDB.Tpo $(DEPDIR)/uil-UilDB.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilDB.c' object='uil-UilDB.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilDB.obj `if test -f 'UilDB.c'; then $(CYGPATH_W) 'UilDB.c'; else $(CYGPATH_W) '$(srcdir)/UilDB.c'; fi` uil-UilMain.o: UilMain.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilMain.o -MD -MP -MF $(DEPDIR)/uil-UilMain.Tpo -c -o uil-UilMain.o `test -f 'UilMain.c' || echo '$(srcdir)/'`UilMain.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilMain.Tpo $(DEPDIR)/uil-UilMain.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilMain.c' object='uil-UilMain.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilMain.o `test -f 'UilMain.c' || echo '$(srcdir)/'`UilMain.c uil-UilMain.obj: UilMain.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -MT uil-UilMain.obj -MD -MP -MF $(DEPDIR)/uil-UilMain.Tpo -c -o uil-UilMain.obj `if test -f 'UilMain.c'; then $(CYGPATH_W) 'UilMain.c'; else $(CYGPATH_W) '$(srcdir)/UilMain.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uil-UilMain.Tpo $(DEPDIR)/uil-UilMain.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UilMain.c' object='uil-UilMain.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(uil_CFLAGS) $(CFLAGS) -c -o uil-UilMain.obj `if test -f 'UilMain.c'; then $(CYGPATH_W) 'UilMain.c'; else $(CYGPATH_W) '$(srcdir)/UilMain.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-uilHEADERS: $(uil_HEADERS) @$(NORMAL_INSTALL) @list='$(uil_HEADERS)'; test -n "$(uildir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(uildir)'"; \ $(MKDIR_P) "$(DESTDIR)$(uildir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(uildir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(uildir)" || exit $$?; \ done uninstall-uilHEADERS: @$(NORMAL_UNINSTALL) @list='$(uil_HEADERS)'; test -n "$(uildir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(uildir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(uildir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-uilHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ uninstall-uilHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-uilHEADERS installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ uninstall-uilHEADERS .PRECIOUS: Makefile UilParser.lo: UilParser.c $(LTCOMPILE) -DCALLABLE -c UilParser.c UilParser.c: test -f UilParser.c || $(LN_S) $(srcdir)/UilMain.c UilParser.c UilLexPars.c: $(top_builddir)/tools/wml/Uil.c test -f UilLexPars.c || $(LN_S) $(top_builddir)/tools/wml/Uil.c UilLexPars.c UilDBDef.h: $(LN_S) $(srcdir)/../../tools/wml/UilDBDef.h UilDBDef.h @MessageCatalog_TRUE@$(COMMON_SRC): $(CAT_FILES) @MessageCatalog_TRUE@$(CAT_FILES): Uil.msg @MessageCatalog_TRUE@ $(mkinstalldirs) $(top_builddir)/localized/C/msg @MessageCatalog_TRUE@ $(top_builddir)/localized/util/mkcatdefs UilMsgCatI.h $(srcdir)/Uil.msg >$(top_builddir)/localized/C/msg/Uil.msg @MessageCatalog_TRUE@ gencat Uil.cat $(top_builddir)/localized/C/msg/Uil.msg # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/clients/uil/XmAppl.uil0000644000175000017500000000571313145162623013742 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! !****************************************************************************** !++ ! FACILITY: ! ! UIL -- Include file for Xm constant definitions. ! ! ABSTRACT: ! ! This include file contains UIL value definintions corresponding ! to those defined in Xm.h ! !-- /* Version information */ value XmVERSION : 2; value XmREVISION : 3; value XmVersion : (XmVERSION * 1000 + XmREVISION); /* XmString definitions */ value XmSTRING_DIRECTION_REVERT : 2; value XmSTRING_COMPONENT_UNKNOWN : 0; value XmSTRING_COMPONENT_CHARSET : 1; value XmSTRING_COMPONENT_TEXT : 2; value XmSTRING_COMPONENT_DIRECTION : 3; value XmSTRING_COMPONENT_SEPARATOR : 4; /* 5-125 reserved */ value XmSTRING_COMPONENT_END : 126; /* no more comp in string */ value XmSTRING_COMPOUND_STRING : 127; /* tag for whole TCS */ value XmSTRING_COMPONENT_USER_BEGIN : 128; /* 128-255 are user tags */ value XmSTRING_COMPONENT_USER_END : 255; /* Callback reasons */ value XmCR_NONE : 0; value XmCR_HELP : 1; value XmCR_VALUE_CHANGED : 2; value XmCR_INCREMENT : 3; value XmCR_DECREMENT : 4; value XmCR_PAGE_INCREMENT : 5; value XmCR_PAGE_DECREMENT : 6; value XmCR_TO_TOP : 7; value XmCR_TO_BOTTOM : 8; value XmCR_DRAG : 9; value XmCR_ACTIVATE : 10; value XmCR_ARM : 11; value XmCR_DISARM : 12; value XmCR_MAP : 16; value XmCR_UNMAP : 17; value XmCR_FOCUS : 18; value XmCR_LOSING_FOCUS : 19; value XmCR_MODIFYING_TEXT_VALUE : 20; value XmCR_MOVING_INSERT_CURSOR : 21; value XmCR_EXECUTE : 22; value XmCR_SINGLE_SELECT : 23; value XmCR_MULTIPLE_SELECT : 24; value XmCR_EXTENDED_SELECT : 25; value XmCR_BROWSE_SELECT : 26; value XmCR_DEFAULT_ACTION : 27; value XmCR_CLIPBOARD_DATA_REQUEST : 28; value XmCR_CLIPBOARD_DATA_DELETE : 29; value XmCR_CASCADING : 30; value XmCR_OK : 31; value XmCR_ENTER : 31; value XmCR_CANCEL : 32; value XmCR_APPLY : 34; value XmCR_NO_MATCH : 35; value XmCR_COMMAND_ENTERED : 36; value XmCR_COMMAND_CHANGED : 37; value XmCR_EXPOSE : 38; value XmCR_RESIZE : 39; value XmCR_INPUT : 40; motif-2.3.8/clients/uil/UilSemVal.c0000644000175000017500000036775113145162623014050 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSemVal.c /main/18 1997/09/15 14:15:21 cshi $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contains the second pass routines for performing ** semantic validation. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include #include #include #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** ** The order of these constants is significant. The constants lower in ** value than error_arg_type are basically numeric types and various ** conversions may be done on those types. Those constants are compared ** numerically with error_arg_type to determine whether they may be ** converted. Furthermore, the numeric_convert_table is indexed by ** those constants. If you are adding new arg types, add before error_arg_type ** if it is a numeric type, but also remember to update the numeric_ ** convert_table below to have an entry for that type. Add the new type ** after error_arg_type if it is not numeric. lstr_arg_type must be after ** char_arg_type and before cstr_arg_type. When done, update all the constants ** to be sequential. ** **/ #define boolean_arg_type 0 #define integer_arg_type 1 #define single_float_arg_type 2 #define float_arg_type 3 #define horizontal_integer_arg_type 4 #define vertical_integer_arg_type 5 #define horizontal_float_arg_type 6 #define vertical_float_arg_type 7 #define error_arg_type 8 #define char_arg_type 9 #define lstr_arg_type 10 #define cstr_arg_type 11 #define keysym_arg_type 12 #define font_arg_type 13 #define color_arg_type 14 #define xbitmap_arg_type 15 #define reason_arg_type 16 #define argument_arg_type 17 #define font_table_arg_type 18 #define wcstr_arg_type 19 #define fontset_arg_type 20 /* BEGIN HaL fix CR 5429 */ #define classrec_arg_type 21 /* END HaL Fix CR 5429 */ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ static unsigned int ref_chk_value = 0; static short in_expr = 0; static int cycle_id = 1; /* ** This table is indexed by arg_types defined above that are less than ** error_arg_type. **/ static int ( * numeric_convert_table[])() = { 0, sem_convert_to_integer, sem_convert_to_single_float, sem_convert_to_float, sem_convert_to_integer, sem_convert_to_integer, sem_convert_to_float, sem_convert_to_float, sem_convert_to_error }; /* * The next two definitions must match value sets defining * expression operators in UilSymDef.h */ static unsigned int legal_operand_type[ ] = { /* unused */ 0, /* not */ 1 << sym_k_bool_value | 1 << sym_k_integer_value, /* unary plus */ 1 << sym_k_integer_value | 1 << sym_k_horizontal_integer_value | 1 << sym_k_vertical_integer_value | 1 << sym_k_float_value | 1 << sym_k_horizontal_float_value | 1 << sym_k_vertical_float_value | 1 << sym_k_single_float_value, /* unary minus */ 1 << sym_k_integer_value | 1 << sym_k_horizontal_integer_value | 1 << sym_k_vertical_integer_value | 1 << sym_k_float_value | 1 << sym_k_horizontal_float_value | 1 << sym_k_vertical_float_value | 1 << sym_k_single_float_value, /* comp_str */ 1 << sym_k_char_8_value | 1 << sym_k_localized_string_value | 1 << sym_k_compound_string_value, /* wchar_str */ 1 << sym_k_localized_string_value, /* multiply */ 1 << sym_k_integer_value | 1 << sym_k_horizontal_integer_value | 1 << sym_k_vertical_integer_value | 1 << sym_k_float_value | 1 << sym_k_horizontal_float_value | 1 << sym_k_vertical_float_value | 1 << sym_k_single_float_value, /* divide */ 1 << sym_k_integer_value | 1 << sym_k_horizontal_integer_value | 1 << sym_k_vertical_integer_value | 1 << sym_k_float_value | 1 << sym_k_horizontal_float_value | 1 << sym_k_vertical_float_value | 1 << sym_k_single_float_value, /* add */ 1 << sym_k_integer_value | 1 << sym_k_horizontal_integer_value | 1 << sym_k_vertical_integer_value | 1 << sym_k_float_value | 1 << sym_k_horizontal_float_value | 1 << sym_k_vertical_float_value | 1 << sym_k_single_float_value, /* subtract */ 1 << sym_k_integer_value | 1 << sym_k_horizontal_integer_value | 1 << sym_k_vertical_integer_value | 1 << sym_k_float_value | 1 << sym_k_horizontal_float_value | 1 << sym_k_vertical_float_value | 1 << sym_k_single_float_value, /* left shift */ 1 << sym_k_integer_value, /* right shift */ 1 << sym_k_integer_value, /* and */ 1 << sym_k_bool_value | 1 << sym_k_integer_value | 1 << sym_k_char_8_value | 1 << sym_k_localized_string_value | 1 << sym_k_compound_string_value | 1 << sym_k_localized_string_value, /* xor */ 1 << sym_k_bool_value | 1 << sym_k_integer_value, /* or */ 1 << sym_k_bool_value | 1 << sym_k_integer_value, /* cat */ 1 << sym_k_char_8_value | 1 << sym_k_compound_string_value | 1 << sym_k_localized_string_value, /* valref */ 0xFFFFFFFF, /* coerce */ 0xFFFFFFFF }; static char *operator_symbol[ ] = { /* unused */ "** OPERATOR ERROR**", /* not */ "not operator", /* unary plus */ "unary plus operator", /* unary minus */ "unary minus operator", /* comp str */ "compound string function", /* wchar str */ "wide_character string function", /* multiply */ "multiply operator", /* divide */ "divide operator", /* add */ "add operator", /* subtract */ "subtract operator", /* left shift */ "left shift operator", /* right shift */ "right shift operator", /* and */ "and operator", /* xor */ "exclusive or operator", /* or */ "or operator", /* cat */ "concatenate operator", /* coerce */ "coerce operator", }; static char *value_text[ ] = { /* boolean */ "boolean expression", /* integer */ "integer expression", /* float */ "floating point expression", }; static sym_argument_entry_type **arg_seen; static sym_callback_entry_type **reason_seen; /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function walks the entire parse tree for the input, and ** performs semantic validation. It guarantees type matching, ** that arguments and controls and legal, etc. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** sym_az_root_entry ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error messages may be issued for objects that are still undefined ** or of the wrong type ** **-- **/ void sem_validation () { /* * Allocate storage if required */ if ( arg_seen == NULL ) arg_seen = (sym_argument_entry_type **) XtMalloc (sizeof(sym_argument_entry_type *)*(uil_max_arg+1)); if ( reason_seen == NULL ) reason_seen = (sym_callback_entry_type **) XtMalloc (sizeof(sym_argument_entry_type *)*(uil_max_reason+1)); /* * Walk the parse tree, performing validation on each node which * requires it. */ sem_validate_node (( sym_entry_type *)sym_az_root_entry->sections); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine recursively walks through the parse tree. It ** ignores any nodes which require no pass 2 validation, and ** calls a specialized routine for any others. It checks for ** any requests to terminate. ** ** FORMAL PARAMETERS: ** ** node current parse tree node ** ** IMPLICIT INPUTS: ** ** > ** ** IMPLICIT OUTPUTS: ** ** > ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** may terminate processing ** **-- **/ void sem_validate_node (node) sym_entry_type *node; { /* * Local variables */ sym_value_entry_type *value_node; sym_widget_entry_type *widget_node; sym_widget_entry_type *child_node; sym_list_entry_type *list_node; sym_include_file_entry_type *ifile_node; sym_section_entry_type *section_node; sym_obj_entry_type *entry_node; sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_control_entry_type *control_entry; /* * Call the status callback routine to report progress and check status */ /* %COMPLETE */ Uil_percent_complete = 80; if ( Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL ) diag_report_status (); /* * Switch on the node type for validation and recursion. */ if ( node == NULL ) return; switch ( node->header.b_tag ) { case sym_k_value_entry: value_node = (sym_value_entry_type *) node; sem_validate_value_node (value_node); break; case sym_k_widget_entry: case sym_k_gadget_entry: case sym_k_child_entry: widget_node = (sym_widget_entry_type *) node; sem_validate_widget_node (widget_node); /* * Recurse for children and validate all children. Duplicate * validation will not occur since sem_validate_widget_node checks * bflags for validated flag. */ sem_validate_node (( sym_entry_type *)widget_node->az_controls); break; case sym_k_list_entry: /* * recursive entry point for processing controls lists. */ list_node = (sym_list_entry_type *) node; if ( list_node->header.b_type != sym_k_control_list ) break; for (list_member=(sym_obj_entry_type *)list_node->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; sem_validate_node (( sym_entry_type *)nested_list_entry->az_list); break; case sym_k_control_entry: control_entry = (sym_control_entry_type *) list_member; child_node = (sym_widget_entry_type *) control_entry->az_con_obj; sem_validate_node (( sym_entry_type *)child_node); break; } break; case sym_k_include_file_entry: ifile_node = (sym_include_file_entry_type *) node; sem_validate_node (( sym_entry_type *)ifile_node->sections); break; case sym_k_section_entry: section_node = (sym_section_entry_type *) node; sem_validate_node (( sym_entry_type *)section_node->next); switch ( section_node->header.b_type ) { case sym_k_section_tail: break; default: entry_node = (sym_obj_entry_type *) section_node->entries; sem_validate_node (( sym_entry_type *)entry_node); break; } break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine validates a value node ** ** FORMAL PARAMETERS: ** ** value_node the symbol table node to be validated. ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** pointer to the value node resulting from the operation (may be ** different from input) ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ sym_value_entry_type *sem_validate_value_node (value_node) sym_value_entry_type *value_node; { /* * Local variables */ /* * Both evaluation and validation are done by the value evaluation routine */ if ( value_node == NULL ) return NULL; if ( value_node->obj_header.b_flags & sym_m_validated ) return value_node; sem_evaluate_value (value_node); value_node->obj_header.b_flags |= sym_m_validated; return value_node; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine validates a widget node ** ** FORMAL PARAMETERS: ** ** widget_node the symbol table node to be validated. ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ void sem_validate_widget_node (widget_node) sym_widget_entry_type *widget_node; { /* * Local variables */ unsigned int widget_type; sym_list_entry_type *list_entry; /* for various lists */ /* * if this widget has already been validated just return */ if (widget_node->obj_header.b_flags & sym_m_validated) return; /* * Pick up widget parameters */ if (widget_node->header.b_tag == sym_k_child_entry) widget_type = child_class_table[(int)widget_node->header.b_type]; else widget_type = widget_node->header.b_type; /* * Validate the arguments. Each argument in the list is validated * by an argument validation routine. */ if ( widget_node->az_arguments != NULL ) { int ndx; for ( ndx=0 ; ndxaz_arguments, arg_seen); } /* * Validate the callbacks. Each callback is validated by a validation * routine */ if ( widget_node->az_callbacks != NULL ) { int ndx; for ( ndx=0 ; ndxaz_callbacks, reason_seen); } /* * Validate the controls. Each is validated by a validation routine. * Also check the node for cycles. */ if ( widget_node->az_controls != NULL ) { int gadget_count = 0; list_entry = (sym_list_entry_type *) widget_node->az_controls; sem_validate_control_list (widget_node, widget_type, list_entry, &gadget_count); list_entry->w_gadget_count = gadget_count; sem_validate_widget_cycle (list_entry, widget_node->obj_header.az_name); } /* * Mark the widget as validated */ widget_node->obj_header.b_flags |= sym_m_validated; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine validates all the arguments in an argument list. ** It recurse down nested lists. ** ** FORMAL PARAMETERS: ** ** widget_node the current widget ** widget_type the current widget's type ** list_entry list to be validated ** seen flag table to detect duplicate arguments ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** SIDE EFFECTS: ** **-- **/ void sem_validate_argument_list (widget_node, widget_type, list_entry, seen) sym_widget_entry_type *widget_node; unsigned int widget_type; sym_list_entry_type *list_entry; sym_argument_entry_type **seen; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_argument_entry_type *argument_entry; /* For fixing DTS 9540 */ static int nest_count=0; static sym_list_entry_type *nest_head = NULL; /* * loop down the list */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; /* Begin fixing DTS 9540 */ if(!nest_count) nest_head = nested_list_entry->az_list; nest_count++; if(nest_count == 1 || nest_head != nested_list_entry->az_list){ sem_validate_argument_list (widget_node, widget_type, nested_list_entry->az_list, seen); nest_count--; }else diag_issue_diagnostic (d_circular_ref, _sar_source_pos2(list_entry), "argument name"); /* End fixing DTS 9540 */ break; case sym_k_argument_entry: argument_entry = (sym_argument_entry_type *) list_member; sem_validate_argument_entry (widget_node, widget_type, list_entry, argument_entry, seen); break; default: diag_issue_diagnostic ( d_list_item, _sar_source_pos2 ( list_entry ), diag_tag_text (sym_k_argument_entry), diag_tag_text (list_entry->header.b_type), diag_tag_text (list_entry->header.b_tag) ); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine performs validation for a single argument entry ** for the current widget node. ** ** FORMAL PARAMETERS: ** ** widget_node the current widget ** widget_type the current widget's type ** list_entry list entry for current argument entry ** argument_entry the current argument entry ** seen flag table to detect duplicate arguments ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ void sem_validate_argument_entry (widget_node, widget_type, list_entry, argument_entry, seen) sym_widget_entry_type *widget_node; unsigned int widget_type; sym_list_entry_type *list_entry; sym_argument_entry_type *argument_entry; sym_argument_entry_type **seen; { /* * Local variables */ sym_value_entry_type *argname_value_entry; sym_value_entry_type *argvalue_value_entry; key_keytable_entry_type *keytable_entry; sym_argument_entry_type **seen_entry; boolean supported_flag; unsigned char expected_type, actual_type = 0, actual_tag; boolean valid_value; /* * ignore error entries, consistency check */ if ( argument_entry->header.b_tag == sym_k_error_entry ) return; _assert (argument_entry->header.b_tag==sym_k_argument_entry, "unexpected non argument entry"); /* * Validate and evaluate the argument name and argument value entries. */ sem_validate_node (( sym_entry_type *)argument_entry->az_arg_name); /* * There is no need to validate the value if it is a widget since widgets are * validated elsewhere and you can't define widgets in an argument list anyway. */ if ( argument_entry->az_arg_value == NULL ) return; if ((argument_entry->az_arg_value->header.b_tag != sym_k_widget_entry) && (argument_entry->az_arg_value->header.b_tag != sym_k_gadget_entry)) sem_validate_node (( sym_entry_type *)argument_entry->az_arg_value); argname_value_entry = (sym_value_entry_type *) argument_entry->az_arg_name; if ( argname_value_entry == NULL ) { diag_issue_diagnostic (d_bad_argument, _sar_source_pos2(argument_entry), "argument name"); return; } sem_evaluate_value_expr(argname_value_entry); _assert (argname_value_entry->header.b_tag==sym_k_value_entry, "invalid argument name value_entry"); if (argname_value_entry->b_type != sym_k_argument_value) { diag_issue_diagnostic (d_list_item, _sar_source_pos2(argname_value_entry), diag_value_text(argname_value_entry->b_type), diag_tag_text(list_entry->header.b_type), diag_tag_text(list_entry->header.b_tag)); return; } argvalue_value_entry = (sym_value_entry_type *) argument_entry->az_arg_value; /* BEGIN HAL Fix CR 3857 */ if ((argument_entry->az_arg_value->header.b_tag != sym_k_widget_entry) && (argument_entry->az_arg_value->header.b_tag != sym_k_gadget_entry)) /* END HAL Fix CR 3857 */ sem_evaluate_value_expr(argvalue_value_entry); /* * Check for unsupported arguments. Validate constraints. * This check is required for known toolkit arguments in * toolkit widgets. */ if ( (argname_value_entry->obj_header.b_flags&sym_m_builtin) && (widget_type!=uil_sym_user_defined_object) && (argname_value_entry->obj_header.az_name == NULL) ) { /* * Pick up the token keytable entry for the argument. * Fork on whether it is a constraint argument */ keytable_entry = (key_keytable_entry_type *) argname_value_entry->value.az_data; _assert (keytable_entry->b_class==tkn_k_class_argument, "unexpected non-argument keytable entry"); if ( _constraint_check(keytable_entry->b_subclass) ) sem_validate_constraint_entry (widget_node, argument_entry, widget_type); else { supported_flag = sem_argument_allowed (keytable_entry->b_subclass, widget_type); if ( ! supported_flag ) diag_issue_diagnostic (d_unsupported, _sar_source_pos2(argument_entry), keytable_entry->at_name, diag_tag_text(argument_entry->header.b_tag), diag_object_text(widget_type)); } /* * Check for duplicate arguments. A warning is issued, but the * argument is not removed from the list, since it may occur in * an argument list - and the argument list may be referenced in * another context where this argument is not duplicated. */ seen_entry = (sym_argument_entry_type **) &seen[keytable_entry->b_subclass]; if ( *seen_entry != NULL ) { diag_issue_diagnostic (d_supersede, _sar_source_pos2(argument_entry), keytable_entry->at_name, diag_tag_text(argument_entry->header.b_tag), diag_tag_text(list_entry->header.b_type), diag_tag_text(list_entry->header.b_tag)); } else { *seen_entry = argument_entry; } /* * Make sure that any enumeration value reference is valid. */ sem_validate_argument_enumset (argument_entry, keytable_entry->b_subclass, argvalue_value_entry); } /* ** Verify the value type for this argument, if it is a ** built-in argument or a user_defined argument. Check for ** proper enumeration set match */ if ( (argname_value_entry->obj_header.b_flags & sym_m_builtin) && (argname_value_entry->obj_header.az_name == NULL) ) { key_keytable_entry_type * keytable_entry; keytable_entry = (key_keytable_entry_type *) argname_value_entry->value.az_data; _assert (keytable_entry->b_class==tkn_k_class_argument, "name is not an argument"); expected_type = argument_type_table[keytable_entry->b_subclass]; } else expected_type = argname_value_entry->b_arg_type; /* ** Argument value validation ** ** Acquire and evaluate argument value. ** Allow a widget reference as the value of an argument. NOTE: gadgets ** are not allowed as argument values, only controls. ** ** This entry may be absent due to extensive compilation errors. */ if ( argvalue_value_entry == NULL ) return; actual_tag = argvalue_value_entry->header.b_tag; switch ( actual_tag ) { case sym_k_value_entry: actual_type = argvalue_value_entry->b_type; break; case sym_k_widget_entry: actual_type = sym_k_widget_ref_value; break; default: _assert (FALSE, "value entry missing"); break; } valid_value = (actual_type == expected_type); /* ** Coerce actual_type to expected_type for certain special cases. ** We'll do this by creating a new value node for the coerced value with ** the coerce unary operator set. We'll actually perform the coersion ** operation here and set the flag indicating that expression evaluation ** has already taken place. */ if ( expected_type == sym_k_any_value ) valid_value = TRUE; if ( actual_type == sym_k_any_value ) valid_value = TRUE; if ( actual_type == sym_k_identifier_value ) valid_value = TRUE; if (( expected_type == sym_k_pixmap_value ) && ( actual_type == sym_k_icon_value )) valid_value = TRUE; if (( expected_type == sym_k_pixmap_value ) && ( actual_type == sym_k_xbitmapfile_value )) valid_value = TRUE; if (( expected_type == sym_k_color_value) && /* RAP rgb data type */ ( actual_type == sym_k_rgb_value)) valid_value = TRUE; /* BEGIN HaL fix CR 5429 */ if (( expected_type == sym_k_class_rec_name_value) && ( actual_type == sym_k_class_rec_name_value)) valid_value = TRUE; /* END HaL fix CR 5429 */ /* For boolean values converted to enums */ if ((expected_type == sym_k_integer_value) && (actual_type == sym_k_bool_value)) valid_value = TRUE; if (( expected_type == sym_k_char_8_value ) && ( actual_type == sym_k_localized_string_value )) valid_value = TRUE; if (( expected_type == sym_k_compound_string_value ) && ( actual_type == sym_k_char_8_value )) { valid_value = TRUE; if ( (argvalue_value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *cstr_value; cstr_value = (sym_value_entry_type *) sem_create_cstr(); cstr_value->b_expr_opr = sym_k_coerce_op; cstr_value->az_exp_op1 = argvalue_value_entry; sem_evaluate_value_expr (cstr_value); argument_entry->az_arg_value = cstr_value; } } if (( expected_type == sym_k_compound_string_value ) && ( actual_type == sym_k_localized_string_value )) { valid_value = TRUE; if ( (argvalue_value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *cstr_value; cstr_value = (sym_value_entry_type *) sem_create_cstr(); cstr_value->b_expr_opr = sym_k_coerce_op; cstr_value->az_exp_op1 = argvalue_value_entry; sem_evaluate_value_expr (cstr_value); argument_entry->az_arg_value = cstr_value; } } if (( expected_type == sym_k_wchar_string_value ) && ( actual_type == sym_k_localized_string_value )) { valid_value = TRUE; if ( (argvalue_value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *wcstr_value; wcstr_value = (sym_value_entry_type *) sem_create_wchar_str(); wcstr_value->b_expr_opr = sym_k_coerce_op; wcstr_value->az_exp_op1 = argvalue_value_entry; sem_evaluate_value_expr (wcstr_value); argument_entry->az_arg_value = wcstr_value; } } if (( expected_type == sym_k_font_table_value ) && (( actual_type == sym_k_font_value ) || ( actual_type == sym_k_fontset_value ))) { valid_value = TRUE; if ( (argvalue_value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *font_table; font_table = sem_create_value_entry ((char*)&argvalue_value_entry, sizeof(long), sym_k_font_table_value); font_table->b_table_count = 1; font_table->az_first_table_value = argvalue_value_entry; font_table->b_expr_opr = sym_k_coerce_op; font_table->az_exp_op1 = argvalue_value_entry; font_table->b_aux_flags |= sym_m_exp_eval; argument_entry->az_arg_value = sem_evaluate_value (font_table); } } if (( expected_type == sym_k_keysym_value ) && ( actual_type == sym_k_integer_value )) { /* * If an integer is incountered when expecting a keysym then just make the * integer into a keysym if the integer is private. If it isn't give an error * message because Mrm won't be able to handle that problem. * When allocating the space for c_value the size of the string is one since an * integer can only be one character. */ if ( (argvalue_value_entry->obj_header.b_flags & sym_m_private) != 0) { char tmp; valid_value = TRUE; tmp = argument_entry->az_arg_value->value.l_integer; argument_entry->az_arg_value->value.c_value = (char *) XtCalloc(1,2); /* * This is a very strange move. While we Calloc 2 bytes we only need to move * one of those bytes. We calloc 2 bytes for a null termination so HP type * machines will work. It looks wierd but it works. */ _move (argument_entry->az_arg_value->value.c_value, &tmp, 1); argument_entry->az_arg_value->b_type = sym_k_keysym_value; argument_entry->az_arg_value->w_length = 1; } } if ((( expected_type == sym_k_horizontal_integer_value ) || ( expected_type == sym_k_vertical_integer_value )) && (( actual_type == sym_k_integer_value) || ( actual_type == sym_k_float_value))) { /* If the expected type was either a horizontal or vertical integer and we got an integer, then simply make the actual type become the expected type. */ valid_value = TRUE; argument_entry->az_arg_value->b_type = expected_type; /* If the actual_type is a float then coerce it into being an integer */ if (actual_type == sym_k_float_value) argument_entry->az_arg_value->value.l_integer = (long) argument_entry->az_arg_value->value.d_real; /* XmPIXELS currently has a value of 0 so the following isn't really necessary but I suppose it is more robust. */ if (argument_entry->az_arg_value->b_arg_type == 0) argument_entry->az_arg_value->b_arg_type = XmPIXELS; } if ((( expected_type == sym_k_horizontal_float_value ) || ( expected_type == sym_k_vertical_float_value )) && (( actual_type == sym_k_horizontal_integer_value ) || ( actual_type == sym_k_vertical_integer_value ))) { /* If the expected type was either a horizontal or vertical float and we got a horizontal or vertical integer, then make the actual type become a horizontal or vertical integer, respectively. */ valid_value = TRUE; if (expected_type == sym_k_horizontal_float_value) argument_entry->az_arg_value->b_type = sym_k_horizontal_integer_value; else if (expected_type == sym_k_vertical_float_value) argument_entry->az_arg_value->b_type = sym_k_vertical_integer_value; /* Coerce the value into being a float */ argument_entry->az_arg_value->value.d_real = (double) argument_entry->az_arg_value->value.l_integer; /* XmPIXELS currently has a value of 0 so the following isn't really necessary but I suppose it is more robust. */ if (argument_entry->az_arg_value->b_arg_type == 0) argument_entry->az_arg_value->b_arg_type = XmPIXELS; } if ((( expected_type == sym_k_horizontal_integer_value ) || ( expected_type == sym_k_vertical_integer_value )) && (( actual_type == sym_k_horizontal_float_value ) || ( actual_type == sym_k_vertical_float_value ))) { /* If the expected type was either a horizontal or vertical integer and we got a horizontal or vertical float, then make the actual type become a horizontal or vertical float, respectively. */ valid_value = TRUE; if (expected_type == sym_k_horizontal_integer_value) argument_entry->az_arg_value->b_type = sym_k_horizontal_float_value; else if (expected_type == sym_k_vertical_integer_value) argument_entry->az_arg_value->b_type = sym_k_vertical_float_value; /* Coerce the value into being an integer */ argument_entry->az_arg_value->value.l_integer = (long) argument_entry->az_arg_value->value.d_real; /* XmPIXELS currently has a value of 0 so the following isn't really necessary but I suppose it is more robust. */ if (argument_entry->az_arg_value->b_arg_type == 0) argument_entry->az_arg_value->b_arg_type = XmPIXELS; } if ((( expected_type == sym_k_horizontal_float_value ) || ( expected_type == sym_k_vertical_float_value )) && (( actual_type == sym_k_integer_value) || ( actual_type == sym_k_float_value))) { /* If the expected type was either a horizontal or vertical float and we got a float, then simply make the actual type become the expected type. */ valid_value = TRUE; argument_entry->az_arg_value->b_type = expected_type; /* If actual_type is an integer, then coerce into being a float */ if (actual_type == sym_k_integer_value) argument_entry->az_arg_value->value.d_real = (double) argument_entry->az_arg_value->value.l_integer; /* XmPIXELS currently has a value of 0 so the following isn't really necessary but I suppose it is more robust. */ if (argument_entry->az_arg_value->b_arg_type == 0) argument_entry->az_arg_value->b_arg_type = XmPIXELS; } /* It is also possible for us to encounter a horizontal float or int when we are expecting a vertical float or int. When using 'value' defined constants, we coerce the type of the constant the first time it is used. We have to be able to accept the coerced value in a different context later. */ if ((( expected_type == sym_k_horizontal_float_value ) && ( actual_type == sym_k_vertical_float_value )) || (( expected_type == sym_k_horizontal_integer_value ) && ( actual_type == sym_k_vertical_integer_value ))) { /* Leave the actual type and value alone, but flag it as an acceptable value. This will mean that the first orientation the value is coerced to will be the orientation for all occurences of the value. */ valid_value = TRUE; } if (!valid_value) diag_issue_diagnostic (d_obj_type, _sar_source_pos2(argname_value_entry), diag_value_text(actual_type), diag_tag_text(actual_tag), diag_value_text(expected_type), diag_tag_text(sym_k_value_entry) ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine performs enumeration set validation for a single ** argument entry. If it's value is an enumeration set reference, ** then we verify that the value comes from the argument's supported ** enumeration set. ** ** FORMAL PARAMETERS: ** ** argument_entry the current argument entry ** arg_code the sym_k_..._arg code for the argument ** arg_value_entry the value node for the argument value ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ void sem_validate_argument_enumset (argument_entry, arg_code, arg_value_entry) sym_argument_entry_type *argument_entry; int arg_code; sym_value_entry_type *arg_value_entry; { /* * Local variables */ unsigned short int enumval_code; unsigned short int enumset_code; int ndx; /* * No action if value is not an integer enumeration value. Else: * - argument must support enumeration set * - value must be from set */ if ( arg_value_entry == NULL ) return; if ((arg_value_entry->b_type != sym_k_integer_value) && (arg_value_entry->b_type != sym_k_bool_value)) return; enumval_code = arg_value_entry->b_enumeration_value_code; if ( enumval_code == 0 ) return; enumset_code = argument_enumset_table[arg_code]; if ( enumset_code == 0 ) { if (arg_value_entry->b_type != sym_k_bool_value) diag_issue_diagnostic(d_no_enumset, _sar_source_pos2(argument_entry), uil_argument_names[arg_code]); return; } for ( ndx=0 ; ndx ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ void sem_validate_constraint_entry (widget_node, argument_entry, widget_type) sym_widget_entry_type *widget_node; sym_argument_entry_type *argument_entry; unsigned int widget_type; { /* * Local variables */ sym_parent_list_type *parent_entry; sym_widget_entry_type *parent_object; unsigned int parent_type; unsigned int parent_tag; key_keytable_entry_type *keytable_entry; sym_value_entry_type *arg_name_entry; boolean supported_flag; /* * Validate the constraint with each of the referencing widget's parents */ for (parent_entry=widget_node->parent_list; parent_entry!=NULL; parent_entry=parent_entry->next) { /* * Acquire the parent object and its type */ parent_object = parent_entry->parent; parent_type = parent_object->header.b_type; if ( parent_object->obj_header.b_flags & sym_m_obj_is_gadget ) { parent_tag = sym_k_gadget_entry; } else { parent_tag = sym_k_widget_entry; } /* * Acquire the appropriate pointers, and validate the reference */ arg_name_entry = (sym_value_entry_type *)argument_entry->az_arg_name; keytable_entry = (key_keytable_entry_type *)arg_name_entry->value.az_data; supported_flag = sem_argument_allowed(keytable_entry->b_subclass, parent_type); if (!supported_flag) { /* Check for both argument and constraint, e.g. decimalPoints. */ supported_flag = sem_argument_allowed(keytable_entry->b_subclass, widget_type); if (!supported_flag) diag_issue_diagnostic(d_unsupp_const, _sar_source_pos2(argument_entry), keytable_entry->at_name, diag_object_text(parent_type), diag_tag_text(parent_tag)); } } /* * Checks on nodes pointed to by this node * * There is no need to validate the value if it is a widget since widgets are * validated elsewhere and you can't define widgets in an argument list anyway. */ if ((argument_entry->az_arg_value->header.b_tag != sym_k_widget_entry) && (argument_entry->az_arg_value->header.b_tag != sym_k_gadget_entry)) sem_validate_node (( sym_entry_type *)argument_entry->az_arg_value); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine validates all the callbacks in an callback list. ** It recurse down nested lists. ** ** FORMAL PARAMETERS: ** ** widget_node the current widget ** widget_type the current widget's type ** list_entry list to be validated ** seen flag table to detect duplicate callbacks ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** SIDE EFFECTS: ** **-- **/ void sem_validate_callback_list (widget_node, widget_type, list_entry, seen) sym_widget_entry_type *widget_node; unsigned int widget_type; sym_list_entry_type *list_entry; sym_callback_entry_type **seen; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_callback_entry_type *callback_entry; /* * loop down the list */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; sem_validate_callback_list (widget_node, widget_type, nested_list_entry->az_list, seen); break; case sym_k_callback_entry: callback_entry = (sym_callback_entry_type *) list_member; sem_validate_callback_entry (widget_node, widget_type, list_entry, callback_entry, seen); break; default: diag_issue_diagnostic ( d_list_item, _sar_source_pos2 ( list_entry ), diag_tag_text (sym_k_callback_entry), diag_tag_text (list_entry->header.b_type), diag_tag_text (list_entry->header.b_tag) ); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine performs validation for a single callback entry ** for the current widget node. ** ** FORMAL PARAMETERS: ** ** widget_node the current widget ** widget_type the current widget's type ** list_entry list entry for current callback entry ** callback_entry the current callback entry ** seen flag table to detect duplicate callbacks ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ void sem_validate_callback_entry (widget_node, widget_type, list_entry, callback_entry, seen) sym_widget_entry_type *widget_node; unsigned int widget_type; sym_list_entry_type *list_entry; sym_callback_entry_type *callback_entry; sym_callback_entry_type **seen; { /* * Local variables */ sym_value_entry_type *reason_value_entry; key_keytable_entry_type *keytable_entry; sym_callback_entry_type **seen_entry; boolean supported_flag; static sym_value_entry_type *widget_az_arg_value = NULL; /* * ignore error entries, consistency check */ if ( callback_entry->header.b_tag == sym_k_error_entry ) return; _assert (callback_entry->header.b_tag==sym_k_callback_entry, "unexpected non callback entry"); reason_value_entry = (sym_value_entry_type *) callback_entry->az_call_reason_name; /* * Force expression evaluation */ sem_evaluate_value_expr (reason_value_entry); if (reason_value_entry == NULL) return; _assert (reason_value_entry->header.b_tag == sym_k_value_entry, "reason value entry missing"); if (reason_value_entry->b_type != sym_k_reason_value) { diag_issue_diagnostic ( d_list_item, _sar_source_pos2 ( reason_value_entry ), diag_value_text (reason_value_entry->b_type), diag_tag_text (list_entry->header.b_type), diag_tag_text (list_entry->header.b_tag) ); return; } /* * Check for unsupported callbacks. * This check is required for known toolkit callbacks in * toolkit widgets. */ if ( (reason_value_entry->obj_header.b_flags&sym_m_builtin) && (widget_type!=uil_sym_user_defined_object) ) { /* * Pick up the token keytable entry for the callback. * Validate that the reason is supported */ keytable_entry = (key_keytable_entry_type *) reason_value_entry->value.az_data; _assert (keytable_entry->b_class==tkn_k_class_reason, "unexpected non-reason keytable entry"); supported_flag = sem_reason_allowed (keytable_entry->b_subclass, widget_type); if ( ! supported_flag ) diag_issue_diagnostic (d_unsupported, _sar_source_pos2(callback_entry), keytable_entry->at_name, diag_tag_text(callback_entry->header.b_tag), diag_object_text(widget_type)); /* * Check for duplicate callbacks. A warning is issued, but the * callback is not removed from the list, since it may occur in * an callback list - and the callback list may be referenced in * another context where this callback is not duplicated. */ seen_entry = (sym_callback_entry_type **) &seen[keytable_entry->b_subclass]; if ( *seen_entry != NULL ) { diag_issue_diagnostic (d_supersede, _sar_source_pos2(callback_entry), keytable_entry->at_name, diag_tag_text(callback_entry->header.b_tag), diag_tag_text(list_entry->header.b_type), diag_tag_text(list_entry->header.b_tag)); } else { *seen_entry = callback_entry; } } /* * Checks on nodes pointed to by this node */ /* Begin fixing DTS 10391 and OSF CR 8715*/ if(callback_entry->az_call_proc_ref && callback_entry->az_call_proc_ref->az_arg_value && (callback_entry->az_call_proc_ref->az_arg_value->header.b_tag == sym_k_widget_entry || callback_entry->az_call_proc_ref->az_arg_value->header.b_tag == sym_k_gadget_entry) && widget_az_arg_value == callback_entry->az_call_proc_ref->az_arg_value){ diag_issue_diagnostic (d_circular_def, _sar_source_pos2(callback_entry), "callback client_data"); }else{ if(callback_entry->az_call_proc_ref && callback_entry->az_call_proc_ref->az_arg_value && (callback_entry->az_call_proc_ref->az_arg_value->header.b_tag == sym_k_widget_entry || callback_entry->az_call_proc_ref->az_arg_value->header.b_tag == sym_k_gadget_entry) && !widget_az_arg_value) widget_az_arg_value = callback_entry->az_call_proc_ref->az_arg_value; sem_validate_procref_entry (callback_entry->az_call_proc_ref); sem_validate_procref_list (callback_entry->az_call_proc_ref_list); } widget_az_arg_value = NULL; /* End fixing DTS 10391 and OSF CR 8715*/ } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine validates all the controls in an control list. ** It recurse down nested lists. ** ** FORMAL PARAMETERS: ** ** widget_node the current widget ** widget_type the current widget's type ** list_entry list to be validated ** count to return gadget count ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** SIDE EFFECTS: ** **-- **/ void sem_validate_control_list (widget_node, widget_type, list_entry, count) sym_widget_entry_type *widget_node; unsigned int widget_type; sym_list_entry_type *list_entry; int *count; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_control_entry_type *control_entry; /* * loop down the list */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; sem_validate_control_list (widget_node, widget_type, nested_list_entry->az_list, count); break; case sym_k_control_entry: control_entry = (sym_control_entry_type *) list_member; sem_validate_control_entry (widget_node, widget_type, list_entry, control_entry, count); break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine performs validation for a single control entry ** for the current widget node. ** ** FORMAL PARAMETERS: ** ** widget_node the current widget ** widget_type the current widget's type ** list_entry list entry for current control entry ** control_entry the current control entry ** gadget_count to accumulate count of controlled gadgets ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ void sem_validate_control_entry (widget_node, widget_type, list_entry, control_entry, gadget_count) sym_widget_entry_type *widget_node; unsigned int widget_type; sym_list_entry_type *list_entry; sym_control_entry_type *control_entry; int *gadget_count; { /* * Local variables */ sym_widget_entry_type *control_obj_entry; boolean supported_flag; /* * ignore error entries, consistency check */ if ( control_entry->header.b_tag == sym_k_error_entry ) return; _assert (control_entry->header.b_tag==sym_k_control_entry, "unexpected non control entry"); /* * Similar checks for the object being controlled */ control_obj_entry = (sym_widget_entry_type *) control_entry->az_con_obj; if ( control_obj_entry->header.b_tag == sym_k_error_entry ) { control_entry->header.b_tag = sym_k_error_entry; return; } _assert (control_obj_entry->header.b_tag==sym_k_widget_entry || control_obj_entry->header.b_tag==sym_k_gadget_entry || control_obj_entry->header.b_tag==sym_k_child_entry, "unexpected non-control object entry"); if ( control_obj_entry->header.b_tag == sym_k_gadget_entry ) *gadget_count += 1; /* * Check for unsupported controls or automatic children. */ if (control_obj_entry->header.b_tag == sym_k_child_entry) { supported_flag = sem_child_allowed(control_obj_entry->header.b_type, widget_type); if ( ! supported_flag ) diag_issue_diagnostic (d_unsupported, _sar_source_pos2(control_entry), uil_child_names[(int)control_obj_entry->header.b_type], "automatic child", diag_object_text(widget_type)); } else { supported_flag = sem_control_allowed(control_obj_entry->header.b_type, widget_type); if ( ! supported_flag ) diag_issue_diagnostic (d_unsupported, _sar_source_pos2(control_entry), diag_object_text(control_obj_entry->header.b_type), diag_tag_text(control_entry->header.b_tag), diag_object_text(widget_type)); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine recursively checks for cycles in a widget hierarchy. ** A cycle is defined as the appearance of a widget's name in its ** subtree hierarchy. A cycle is detected by setting a unique id ** for this cycle check in each name entry encountered. If this id ** is ever encountered again, there is a cycle. ** ** This is the root routine of the recursion, which is responsible ** for setting flags in the name entry. ** ** FORMAL PARAMETERS: ** ** list_entry list to be validated ** cycle_name if non-NULL, a widget name for cycle check ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** SIDE EFFECTS: ** **-- **/ void sem_validate_widget_cycle (list_entry, cycle_name) sym_list_entry_type *list_entry; sym_name_entry_type *cycle_name; { /* * Local variables */ boolean cycle_res; /* * Acquire a new cycle id value.Call the auxiliary recursion routine, * and set results in the name entry. */ if ( cycle_name == NULL ) return; cycle_id += 1; cycle_name->az_cycle_id = cycle_id; cycle_res = sem_validate_widget_cycle_aux (list_entry, cycle_name); cycle_name->b_flags |= sym_m_cycle_checked; if ( cycle_res ) cycle_name->b_flags |= sym_m_has_cycle; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine recursively checks for cycles in a widget hierarchy. ** A cycle is defined as the appearance of a widget's name in its ** subtree hierarchy. This is the fully recursive auxiliary for ** sem_validate_widget_cycle ** ** Checking is based on the fact that for any named widget, its ** subtree definition is fixed and can be checked exactly once. Once ** checked, it is marked as checked, and also flagged if it contains ** a cycle. Since any tree containing a subtree which has a cycle also ** has a cycle, checking stops immediately if such a subtree is detected, ** and subtrees must always be (recursively) checked in advance of ** the current check. ** ** FORMAL PARAMETERS: ** ** list_entry list to be validated ** cycle_name if non-NULL, a widget name for cycle check ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** TRUE cycle detected ** FALSE no cycle detected ** ** SIDE EFFECTS: ** **-- **/ boolean sem_validate_widget_cycle_aux (list_entry, cycle_name) sym_list_entry_type *list_entry; sym_name_entry_type *cycle_name; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_control_entry_type *control_entry; sym_widget_entry_type *control_obj_entry; sym_name_entry_type *control_obj_name; /* * loop down the list. Check for cycles in each leaf (widget) node. Note * we must step through the az_reference for named widgets. If a cycle is * ever detected, we exit (or we'll recurse forever). Note that an error * node returns TRUE, as if it had a cycle (which inhibits further checking). * * If we encounter a previously visited node, we may have either a cycle * or a legitimate multiple reference. Verify that it is a cycle, and * issue an error message if so. If it is not verified, it need not be * checked again. */ if ( list_entry == NULL ) return FALSE; if ( cycle_name == NULL ) return FALSE; if ( cycle_name->b_flags & sym_m_cycle_checked ) return (cycle_name->b_flags&sym_m_has_cycle) == 1; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; if ( sem_validate_widget_cycle_aux (nested_list_entry->az_list, cycle_name) ) return TRUE; break; case sym_k_control_entry: control_entry = (sym_control_entry_type *) list_member; control_obj_entry = (sym_widget_entry_type *) control_entry->az_con_obj; if ( control_obj_entry->header.b_tag == sym_k_error_entry ) return TRUE; _assert (control_obj_entry->header.b_tag==sym_k_widget_entry || control_obj_entry->header.b_tag==sym_k_gadget_entry || control_obj_entry->header.b_tag==sym_k_child_entry, "unexpected non-control object entry"); if ( control_obj_entry->obj_header.az_reference != NULL ) control_obj_entry = (sym_widget_entry_type *) control_obj_entry->obj_header.az_reference; if ( control_obj_entry->az_controls == NULL ) break; control_obj_name = control_obj_entry->obj_header.az_name; if ( control_obj_name != NULL ) { if ( control_obj_name->az_cycle_id == cycle_id ) { if ( sem_validate_verify_cycle (control_obj_entry, control_obj_entry->az_controls) ) { diag_issue_diagnostic (d_widget_cycle, _sar_source_pos2(control_entry), control_obj_name->c_text); control_obj_name->b_flags |= sym_m_cycle_checked; control_obj_name->b_flags |= sym_m_has_cycle; return TRUE; } else { control_obj_name->b_flags |= sym_m_cycle_checked; break; } } control_obj_name->az_cycle_id = cycle_id; } if ( sem_validate_widget_cycle_aux (control_obj_entry->az_controls, cycle_name) ) return TRUE; break; } return FALSE; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine verifies that a cycle found by widget_cycle_aux is ** really a cycle. widget_cycle_aux may have detected a legitimate ** multiple appearance of a widget in a hierarchy which is not a cycle. ** This routine uses a pointer-marching technique to see if the given ** node is in a real cycle. If the cycle_obj is ever encountered in ** the pointer march, then there is a cycle. Otherwise, the march ** terminates. ** ** ** FORMAL PARAMETERS: ** ** cycle_obj object to be found in cycle ** list_entry current controls list ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** TRUE cycle detected ** FALSE no cycle detected ** ** SIDE EFFECTS: ** **-- **/ boolean sem_validate_verify_cycle (cycle_obj, list_entry) sym_widget_entry_type *cycle_obj; sym_list_entry_type *list_entry; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_control_entry_type *control_entry; sym_widget_entry_type *control_obj_entry; /* * Search all objects in the controls list, and recurse. * objects controlled by the current object. */ if ( list_entry == NULL ) return FALSE; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; if ( sem_validate_verify_cycle (cycle_obj, nested_list_entry->az_list) ) return TRUE; break; case sym_k_control_entry: control_entry = (sym_control_entry_type *) list_member; control_obj_entry = (sym_widget_entry_type *) control_entry->az_con_obj; if ( control_obj_entry->obj_header.az_reference != NULL ) control_obj_entry = (sym_widget_entry_type *) control_obj_entry->obj_header.az_reference; if ( control_obj_entry == cycle_obj ) return TRUE; if ( control_obj_entry->az_controls == NULL ) break; if ( sem_validate_verify_cycle (cycle_obj, control_obj_entry->az_controls) ) return TRUE; break; } return FALSE; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine validates all the procrefs in an procref list. ** It recurses down nested lists. ** ** FORMAL PARAMETERS: ** ** list_entry list to be validated ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** SIDE EFFECTS: ** **-- **/ void sem_validate_procref_list (list_entry) sym_list_entry_type *list_entry; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_proc_ref_entry_type *procref_entry; /* * loop down the list */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; sem_validate_procref_list (nested_list_entry->az_list); break; case sym_k_proc_ref_entry: procref_entry = (sym_proc_ref_entry_type *) list_member; sem_validate_procref_entry (procref_entry); break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine performs validation for a single procref entry. ** ** FORMAL PARAMETERS: ** ** procref_entry the current procref entry ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error reporting ** **-- **/ void sem_validate_procref_entry (procref_entry) sym_proc_ref_entry_type *procref_entry; { /* * Local variables */ sym_value_entry_type *value_entry; sym_proc_def_entry_type *proc_def_entry; int actual_arg_count; int expected_arg_type; int actual_arg_type; int arg_checking; /* * ignore error entries, consistency check */ if ( procref_entry == NULL ) return; if ( procref_entry->header.b_tag == sym_k_error_entry ) return; _assert (procref_entry->header.b_tag==sym_k_proc_ref_entry, "unexpected non procref entry"); /* ** Validate procedure reference argument: ** Correct number of args ** Correct datatype of arg - coerce if necessary */ proc_def_entry = procref_entry->az_proc_def; /* Could be NULL due to previous compilation errors. */ if (proc_def_entry == NULL) return; /* ** if checking is required, check that the values ** agree with the parameters */ arg_checking = proc_def_entry->v_arg_checking; value_entry = procref_entry->az_arg_value; if (arg_checking) { boolean valid_arg; if (value_entry == NULL) { actual_arg_count = 0; actual_arg_type = sym_k_no_value; } else { sem_evaluate_value_expr(value_entry); actual_arg_count = 1; actual_arg_type = value_entry->b_type; } if (actual_arg_count != proc_def_entry->b_arg_count) { diag_issue_diagnostic ( d_arg_count, _sar_source_pos2 (procref_entry), proc_def_entry->obj_header.az_name->c_text, proc_def_entry->b_arg_count ); return; } expected_arg_type = proc_def_entry->b_arg_type; valid_arg = (actual_arg_type == expected_arg_type); if ( expected_arg_type == sym_k_any_value ) valid_arg = TRUE; if ( actual_arg_type == sym_k_identifier_value ) valid_arg = TRUE; if (( expected_arg_type == sym_k_pixmap_value ) && ( actual_arg_type == sym_k_icon_value )) valid_arg = TRUE; if (( expected_arg_type == sym_k_color_value) &&/* RAP rgb data type */ ( actual_arg_type == sym_k_rgb_value)) valid_arg = TRUE; if ((expected_arg_type == sym_k_char_8_value) && (actual_arg_type == sym_k_localized_string_value)) valid_arg = TRUE; if (( expected_arg_type == sym_k_compound_string_value ) && ( actual_arg_type == sym_k_char_8_value )) { valid_arg = TRUE; if ( (value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *cstr_value; cstr_value = (sym_value_entry_type *) sem_create_cstr(); cstr_value->b_expr_opr = sym_k_coerce_op; cstr_value->az_exp_op1 = value_entry; sem_evaluate_value_expr (cstr_value); } } if (( expected_arg_type == sym_k_compound_string_value ) && ( actual_arg_type == sym_k_localized_string_value )) { valid_arg = TRUE; if ( (value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *cstr_value; cstr_value = (sym_value_entry_type *) sem_create_cstr(); cstr_value->b_expr_opr = sym_k_coerce_op; cstr_value->az_exp_op1 = value_entry; sem_evaluate_value_expr (cstr_value); } } if (( expected_arg_type == sym_k_wchar_string_value ) && ( actual_arg_type == sym_k_localized_string_value )) { valid_arg = TRUE; if ( (value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *wcstr_value; wcstr_value = (sym_value_entry_type *) sem_create_wchar_str(); wcstr_value->b_expr_opr = sym_k_coerce_op; wcstr_value->az_exp_op1 = value_entry; sem_evaluate_value_expr (wcstr_value); } } if (( expected_arg_type == sym_k_font_table_value ) && (( actual_arg_type == sym_k_font_value ) || ( actual_arg_type == sym_k_fontset_value ))) { valid_arg = TRUE; if ( (value_entry->obj_header.b_flags & sym_m_private) != 0) { sym_value_entry_type *font_table; font_table = sem_create_value_entry ( (char*)&value_entry, sizeof(long), sym_k_font_table_value ); font_table->b_expr_opr = sym_k_coerce_op; font_table->az_exp_op1 = value_entry; value_entry = sem_evaluate_value (font_table); } } if ((expected_arg_type == sym_k_widget_ref_value) && (value_entry->header.b_tag == sym_k_widget_entry)) { expected_arg_type = proc_def_entry->b_widget_type; actual_arg_type = value_entry->header.b_type; if ((expected_arg_type > uil_max_object) || (actual_arg_type == expected_arg_type)) { valid_arg = TRUE; } else { diag_issue_diagnostic (d_arg_type, _sar_source_pos2(procref_entry), diag_object_text(actual_arg_type), proc_def_entry->obj_header.az_name->c_text, diag_object_text(expected_arg_type)); return; } } if (!valid_arg) { diag_issue_diagnostic ( d_arg_type, _sar_source_pos2 (procref_entry), diag_value_text( actual_arg_type ), proc_def_entry->obj_header.az_name->c_text, diag_value_text( expected_arg_type ) ); return; } } /* * Perform validation of tags */ sem_validate_node (( sym_entry_type *)procref_entry->az_arg_value); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This predicate specifies if an argument is allowed in a class. ** ** FORMAL PARAMETERS: ** ** arg_code The sym_k_..._arg code for the argument ** class_code The sym_k_..._object code for the class ** ** IMPLICIT INPUTS: ** ** allowed_argument_table ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** TRUE argument is allowed ** FALSE argument is not allowed ** ** SIDE EFFECTS: ** **-- **/ boolean sem_argument_allowed (arg_code, class_code) unsigned int arg_code; unsigned int class_code; { unsigned char *entry_vec; unsigned char vec_byte; entry_vec = allowed_argument_table[arg_code]; vec_byte = entry_vec[_BIT_INDEX(class_code)]; return (boolean) vec_byte & _BIT_MASK(class_code); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This predicate specifies if a reason is allowed in a class. ** ** FORMAL PARAMETERS: ** ** rsn_code The sym_k_..._reason code for the reason ** class_code The sym_k_..._object code for the class ** ** IMPLICIT INPUTS: ** ** allowed_reason_table ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** TRUE reason is allowed ** FALSE reason is not allowed ** ** SIDE EFFECTS: ** **-- **/ boolean sem_reason_allowed (rsn_code, class_code) unsigned int rsn_code; unsigned int class_code; { unsigned char *entry_vec; unsigned char vec_byte; entry_vec = allowed_reason_table[rsn_code]; vec_byte = entry_vec[_BIT_INDEX(class_code)]; return (boolean) vec_byte & _BIT_MASK(class_code); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This predicate specifies if a control is allowed in a class. ** ** FORMAL PARAMETERS: ** ** ctl_code The sym_k_..._object code for the control, that is, ** the class of object which is to be a child of ** the class below. ** class_code The sym_k_..._object code for the class ** ** IMPLICIT INPUTS: ** ** allowed_control_table ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** TRUE control is allowed ** FALSE control is not allowed ** ** SIDE EFFECTS: ** **-- **/ boolean sem_control_allowed (ctl_code, class_code) unsigned int ctl_code; unsigned int class_code; { unsigned char *entry_vec; unsigned char vec_byte; entry_vec = allowed_control_table[ctl_code]; vec_byte = entry_vec[_BIT_INDEX(class_code)]; return (boolean) vec_byte & _BIT_MASK(class_code); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This predicate specifies if an automatically create child is ** allowed in a class. ** ** FORMAL PARAMETERS: ** ** ctl_code The sym_k_..._child code for the child, that is, ** the class of child which is to be automatically ** created in the class below. ** class_code The sym_k_..._object code for the class ** ** IMPLICIT INPUTS: ** ** allowed_child_table ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** TRUE child is allowed ** FALSE child is not allowed ** ** SIDE EFFECTS: ** **-- **/ boolean sem_child_allowed (ctl_code, class_code) unsigned int ctl_code; unsigned int class_code; { unsigned char *entry_vec; unsigned char vec_byte; entry_vec = allowed_child_table[ctl_code]; vec_byte = entry_vec[_BIT_INDEX(class_code)]; return (boolean) vec_byte & _BIT_MASK(class_code); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function does evaluation and validation of value nodes. It ** guarantees that a value usable by the output routine or other consumers ** of values is available in the value union of the node, with ** any other corollary fields also set. The result of the operation may ** be a new node, if coercion is required. ** ** FORMAL PARAMETERS: ** ** val_entry pointer to the value node to be evaluated ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** The value node which results from the evaluation/validation operation ** ** SIDE EFFECTS: ** ** The value union and other fields may be modified. ** **-- **/ sym_value_entry_type *sem_evaluate_value (val_entry) sym_value_entry_type *val_entry; { /* * Force expression evaluation */ sem_evaluate_value_expr (val_entry); /* BEGIN HAL Fix CR 4774 */ /* Do not execute case statement if val_entry was previously * a sym_k_valref_op node type. This can be determined by * examining the state of the sym_m_exp_eval flag in the * b_aux_flags field. */ if ((val_entry->b_aux_flags & sym_m_exp_eval) == 0) /* * Perform evaluations which depend on the type of the value */ switch ( val_entry->b_type ) /* END HAL Fix CR 4774 */ { case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: break; case sym_k_compound_string_value: sem_evaluate_value_cs (val_entry); break; /* BEGIN OSF Fix CR 4859 */ /* END OSF Fix CR 4859 */ case sym_k_string_table_value: { sym_value_entry_type *value_segment; for (value_segment=val_entry->az_first_table_value; value_segment!=NULL; value_segment=value_segment->az_next_table_value) { sem_evaluate_value_expr (value_segment); if ((value_segment->b_type == sym_k_char_8_value) || (value_segment->b_type == sym_k_localized_string_value)) { sym_value_entry_type *cstr; sym_value_entry_type *save_next; save_next = (sym_value_entry_type *) (value_segment -> az_next_table_value); cstr = (sym_value_entry_type *) sem_create_cstr(); sem_append_str_to_cstr( cstr, value_segment, FALSE); _sym_copy_entry (value_segment, cstr, sym_k_value_entry_size ); value_segment -> az_next_table_value = save_next; cstr->value.xms_value = NULL; cstr->az_first_table_value = NULL; sem_free_node (( sym_entry_type *)cstr); } if (value_segment->b_type != sym_k_compound_string_value) diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( value_segment ), diag_value_text( value_segment->b_type), diag_value_text( sym_k_compound_string_value ) ); sem_evaluate_value_cs (value_segment); } } break; case sym_k_integer_table_value: { sym_value_entry_type *value_segment; for (value_segment=val_entry->az_first_table_value; value_segment!=NULL; value_segment=value_segment->az_next_table_value) { sem_evaluate_value_expr (value_segment); if (value_segment->b_type != sym_k_integer_value && value_segment->b_type != sym_k_horizontal_integer_value && value_segment->b_type != sym_k_vertical_integer_value) diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( value_segment ), diag_value_text( value_segment->b_type), diag_value_text( sym_k_integer_value ) ); } } break; case sym_k_asciz_table_value: case sym_k_trans_table_value: { sym_value_entry_type *value_segment; for (value_segment=val_entry->az_first_table_value; value_segment!=NULL; value_segment=value_segment->az_next_table_value) { sem_evaluate_value_expr (value_segment); if ((value_segment->b_type != sym_k_char_8_value) && (value_segment->b_type != sym_k_localized_string_value)) diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( value_segment ), diag_value_text( value_segment->b_type), diag_value_text( sym_k_char_8_value ) ); } } break; case sym_k_font_table_value: { sym_value_entry_type *value_segment; for (value_segment=val_entry->az_first_table_value; value_segment!=NULL; value_segment=value_segment->az_next_table_value) { sem_evaluate_value_expr (value_segment); if ((value_segment->b_type != sym_k_char_8_value) && (value_segment->b_type != sym_k_localized_string_value) && (value_segment->b_type != sym_k_font_value) && (value_segment->b_type != sym_k_fontset_value)) diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( value_segment ), diag_value_text( value_segment->b_type), diag_value_text( sym_k_char_8_value ) ); } break; } /* * Fix for CR 5403 - check to make sure each item in the rgb table is an * integer value. If not, print an error message. Treat * this exactly like the integer_table_value section above. */ case sym_k_rgb_value: { sym_value_entry_type *value_segment; for (value_segment=val_entry->az_first_table_value; value_segment!=NULL; value_segment=value_segment->az_next_table_value) { sem_evaluate_value_expr (value_segment); if (value_segment->b_type != sym_k_integer_value && value_segment->b_type != sym_k_identifier_value && value_segment->b_type != sym_k_horizontal_integer_value && value_segment->b_type != sym_k_vertical_integer_value) diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( value_segment ), diag_value_text( value_segment->b_type), diag_value_text( sym_k_integer_value ) ); } } break; /* * End Fix for CR 5403 */ case sym_k_color_table_value: { sym_color_element *colorVec; int ndx; colorVec = val_entry->value.z_color; for ( ndx=0 ; ndx<(int)val_entry->b_table_count ; ndx++ ) if ( (int)colorVec[ndx].b_index > 1 ) /* omit FG, BG */ /* * Fix for CR 5428 - check to make sure that the expression result is a * color value. If not, print diagnostics. */ { sem_evaluate_value_expr (colorVec[ndx].az_color); if ((colorVec[ndx].az_color->b_type != sym_k_color_value) && ( colorVec[ndx].az_color->b_type != sym_k_rgb_value)) diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( colorVec[ndx].az_color ), diag_value_text( colorVec[ndx].az_color->b_type), diag_value_text( sym_k_color_value ) ); } /* * End Fix for CR 5428 */ break; } case sym_k_pixmap_value: case sym_k_icon_value: { sym_icon_element *iconDesc; sym_value_entry_type *cTable; iconDesc = val_entry->value.z_icon; /* BEGIN OSF Fix pir 2869*/ if ( iconDesc == NULL ) break; else cTable = iconDesc->az_color_table; /* END OSF Fix pir 2869 */ if ( cTable == NULL ) break; switch ( cTable->b_type ) { case sym_k_color_table_value: { sym_color_element *colorVec; int vecLen = cTable->b_table_count; int ndx; int i, j; boolean found; char *row; sym_value_entry_type *rowEntry; /* * Find each icon character in the table, and replace its * character by its index. */ colorVec = cTable->value.z_color; rowEntry = iconDesc->az_rows; for ( ndx=0 ; ndx<(int)iconDesc->w_height ; ndx++, rowEntry=rowEntry->az_next_table_value ) for ( row = rowEntry->value.c_value, i = 0 ; i<(int)rowEntry->w_length ; i++) { found = FALSE; for ( j=0 ; jb_type), diag_value_text(sym_k_color_table_value)); break; } break; } } /* * Perform evaluations which depend on evaluating expressions */ return(sem_evaluate_value_expr (val_entry)); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function evaluates a compound string value node, and ** returns the resulting compound string. ** ** FORMAL PARAMETERS: ** ** csval_entry pointer to the value node to be evaluated ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** The value and length fields for the value entry are set. ** **-- **/ sym_value_entry_type *sem_evaluate_value_cs (csval_entry) sym_value_entry_type *csval_entry; { sym_value_entry_type *next_segment; XmString cstr_1; XmString cstr_r; int charset; /* sym_k_..._charset */ char *csetptr; /* charset name string */ _assert( (csval_entry->header.b_tag == sym_k_value_entry) && (csval_entry->b_type == sym_k_compound_string_value), "value not compound string" ); /* ** You can't do anyting about imported compound strings so return. */ if ((csval_entry->obj_header.b_flags & sym_m_imported) != 0) return(csval_entry); /* ** If the pointer to the first segment of the compound string has been ** cleared (az_first_table_value) and there's a pointer to the evaluated ** compound string (value.xms_value), then we must have already evaluated ** this compound string. Leave! */ if ((csval_entry->az_first_table_value == NULL) && (csval_entry->value.xms_value != NULL)) return(csval_entry); /* ** Get the first segment of the compound string and create ** a compound string for it. */ next_segment = csval_entry->az_first_table_value; _assert( next_segment != NULL, "compound string with no segments" ); /* ** If the csval_entry direction is set reset the first segments ** direction (actually it will be the only segments direction). */ if (csval_entry->b_direction != NOSTRING_DIRECTION) { next_segment->b_direction = csval_entry->b_direction; }; /* ** Initial segment: acquire character set, then ** create initial segment. */ charset = sem_map_subclass_to_charset (next_segment->b_charset ); csetptr = sem_charset_name (charset, next_segment->az_charset_value); if (next_segment->b_type == sym_k_localized_string_value) cstr_r = XmStringCreateLocalized(next_segment->value.c_value); else cstr_r = XmStringConcatAndFree(XmStringDirectionCreate(next_segment->b_direction), XmStringCreate(next_segment->value.c_value, csetptr)); if (next_segment->b_aux_flags & sym_m_separate) cstr_r = XmStringConcatAndFree(cstr_r, XmStringSeparatorCreate()); /* ** Loop through the rest of the segments of the string and append ** them to the first segment of the string. */ for (next_segment = next_segment->az_next_table_value; next_segment != NULL; next_segment = next_segment->az_next_table_value) { /* ** Acquire each segment, and set the character set, as for the ** initial segment. */ charset = sem_map_subclass_to_charset (next_segment->b_charset ); csetptr = sem_charset_name (charset, next_segment->az_charset_value); /* ** Create this segment, then concatenate to the result string. ** Free the two inputs now that a concatenated result string ** exists. */ cstr_1 = XmStringConcatAndFree(XmStringDirectionCreate(next_segment->b_direction), XmStringCreate(next_segment->value.c_value, csetptr)); if (next_segment->b_aux_flags & sym_m_separate) cstr_1 = XmStringConcatAndFree(cstr_1, XmStringSeparatorCreate()); cstr_r = XmStringConcatAndFree(cstr_r, cstr_1); } csval_entry->value.xms_value = cstr_r; csval_entry->w_length = XmStringLength (cstr_r); /* ** Now deallocate the nodes for the compound string segments and put a null ** in az_first_table_value */ for (next_segment = csval_entry->az_first_table_value; next_segment != NULL; next_segment = next_segment->az_next_table_value) sem_free_node (( sym_entry_type *)next_segment); csval_entry->az_first_table_value = NULL; _assert( csval_entry->w_length <= MrmMaxResourceSize, "compound string too long" ); return (csval_entry); } /* BEGIN OSF Fix CR 4859 */ /* END OSF Fix CR 4859 */ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function evaluates an expression, placing the resulting value ** in the top-level value node of the expression tree. A flag is set ** in the top-level node to indicate whether the evaluation has taken ** place. The expression tree is left intact so that programs using ** the callable UIL compiler will have access to the expression as well ** as its evalutated value. ** ** FORMAL PARAMETERS: ** ** value_entry the top-level value node of the expression ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** The value node resulting from this operation ** ** SIDE EFFECTS: ** **-- **/ sym_value_entry_type *sem_evaluate_value_expr (value_entry) sym_value_entry_type *value_entry; { /* * Local variables */ char op1_type; char op2_type; char res_type; data_value_type op1_data; data_value_type op2_data; sym_value_entry_type *op1_entry = NULL; sym_value_entry_type *op2_entry = NULL; data_value_type *op1_ptr = NULL; data_value_type *op2_ptr = NULL; data_value_type res_data; sym_value_entry_type *cat_str_entry; /* ** If this isn't an operation or if we've already evaluated it, just ** leave. Also, guard against attempting to deal with NULLs. */ if ( value_entry == NULL ) return value_entry; if ( (value_entry->b_aux_flags & sym_m_exp_eval) != 0 ) return value_entry; if ( value_entry->b_expr_opr == sym_k_unspecified_op ) return value_entry; /* ** If we're just beginning to evaluate a new expression, increment the ** value for checking circular references. */ if (!in_expr) ref_chk_value++; in_expr = TRUE; /* ** Check for circular references. ** Place a value in each node of this expression. If we see the same ** value again as we evaluate the expression, we've been here before ** (kind of like dropping bread crumbs). */ if (value_entry->l_circular_ref_chk == ref_chk_value) { if ( value_entry->obj_header.az_name != NULL ) diag_issue_diagnostic (d_circular_ref, _sar_source_pos2(value_entry), value_entry->obj_header.az_name->c_text); else diag_issue_diagnostic (d_circular_ref, _sar_source_pos2(value_entry), "unnamed value"); return NULL; } value_entry->l_circular_ref_chk = ref_chk_value; /* ** Validate the first argument for the expression. If it is NULL, ** then return with no further processing, since this is usually ** due to previous compilation errors. */ if ( value_entry->az_exp_op1 == NULL ) return NULL; sem_evaluate_value_expr(value_entry->az_exp_op1); in_expr = TRUE; op1_type = validate_arg (value_entry->az_exp_op1, value_entry->b_expr_opr); op1_entry = value_entry->az_exp_op1; res_type = op1_type; /* ** If it's a binary expression, evaluate the second argument and ** perform any necessary conversions */ if (value_entry->az_exp_op2 != NULL) { sem_evaluate_value_expr(value_entry->az_exp_op2); in_expr = TRUE; op2_type = validate_arg (value_entry->az_exp_op2, value_entry->b_expr_opr); /* ** Perform conversions */ op2_entry = value_entry->az_exp_op2; res_type = op1_type; if (res_type < op2_type) res_type = op2_type; if (op1_type != res_type) { op1_ptr = &op1_data; if (res_type <= error_arg_type) op1_type = (* numeric_convert_table[ (int)res_type ]) ( op1_entry, op1_ptr ); else if ((res_type != cstr_arg_type) && (res_type != lstr_arg_type)) { diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( res_type ) ); res_type = error_arg_type; goto continue_after_error; } } else { op1_ptr = (data_value_type *) &(op1_entry->value); } if (op2_type != res_type) { op2_ptr = &op2_data; if (res_type <= error_arg_type) op2_type = (* numeric_convert_table[ (int)res_type ]) ( op2_entry, op2_ptr ); else if ((res_type != cstr_arg_type) && (res_type != lstr_arg_type)) { diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( res_type ) ); res_type = error_arg_type; goto continue_after_error; } } else { op2_ptr = (data_value_type *) &(op2_entry->value); } } /* ** Perform the operation */ switch (value_entry->b_expr_opr) { case sym_k_unary_plus_op: switch (op1_type) { case integer_arg_type: case horizontal_integer_arg_type: case vertical_integer_arg_type: value_entry->value.l_integer = op1_entry->value.l_integer; value_entry->b_arg_type = op1_entry->b_arg_type; break; case float_arg_type: case horizontal_float_arg_type: case vertical_float_arg_type: value_entry->value.d_real = op1_entry->value.d_real; value_entry->b_arg_type = op1_entry->b_arg_type; break; case single_float_arg_type: /* single float data type RAP */ value_entry->value.single_float = op1_entry->value.single_float; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_unary_minus_op: switch (op1_type) { case integer_arg_type: case horizontal_integer_arg_type: case vertical_integer_arg_type: value_entry->value.l_integer = - op1_entry->value.l_integer; value_entry->b_arg_type = op1_entry->b_arg_type; break; case float_arg_type: case horizontal_float_arg_type: case vertical_float_arg_type: value_entry->value.d_real = - op1_entry->value.d_real; value_entry->b_arg_type = op1_entry->b_arg_type; break; case single_float_arg_type: /* single float data type RAP */ value_entry->value.single_float = - op1_entry->value.single_float; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_not_op: switch (op1_type) { case boolean_arg_type: value_entry->value.l_integer = ! op1_entry->value.l_integer; break; case integer_arg_type: value_entry->value.l_integer = ~ op1_entry->value.l_integer; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_comp_str_op: switch (op1_type) { case char_arg_type: /* char_8_type */ case lstr_arg_type: sem_append_str_to_cstr(value_entry, value_entry->az_exp_op1, FALSE); value_entry->az_first_table_value->b_aux_flags = value_entry->b_aux_flags; /* * Fix for CN 16149 (DTS 10023) part 2 -- If it exists, put the * charset info collected by sar_chk_comp_str_attr() onto the * char_8 string data structure. */ if (value_entry->b_charset != sym_k_error_charset) { value_entry->az_first_table_value->b_charset = value_entry->b_charset; if (value_entry->az_charset_value) value_entry->az_first_table_value->az_charset_value = value_entry->az_charset_value; } /* End fix for CN 16149 */ sem_evaluate_value_cs(value_entry); res_type = cstr_arg_type; break; case cstr_arg_type: /* comp_str */; { XmString cstr; /* * If we're dealing with a combination 1-byte, 2-byte * string, then we have to evaluate it first. (if not * already done) */ if (value_entry->az_exp_op1->az_first_table_value != NULL) { sem_evaluate_value_cs(value_entry->az_exp_op1); } /* * If there is a separater invoved, makes sure it gets * concatendated onto the end of the string. Also free * up used memory. */ if ((value_entry->b_aux_flags & sym_m_separate) != 0 ) { cstr = XmStringSeparatorCreate(); value_entry->value.l_integer = (long)XmStringConcatAndFree((XmString)value_entry->az_exp_op1-> value.l_integer, cstr); } else { value_entry->value.l_integer = value_entry->az_exp_op1->value.l_integer; } sem_evaluate_value_cs(value_entry); res_type = cstr_arg_type; }; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_wchar_str_op: switch (op1_type) { case lstr_arg_type: /* localized string type */ sem_append_str_to_cstr(value_entry, value_entry->az_exp_op1, FALSE); value_entry->az_first_table_value->b_aux_flags = value_entry->b_aux_flags; /* BEGIN OSF Fix CR 4859 */ /* END OSF Fix CR 4859 */ res_type = wcstr_arg_type; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_coerce_op: switch (value_entry->b_type) { case sym_k_compound_string_value: switch (op1_entry->b_type) { case sym_k_char_8_value: case sym_k_localized_string_value: sem_append_str_to_cstr (value_entry, op1_entry, FALSE); sem_evaluate_value_cs(value_entry); res_type = cstr_arg_type; break; case sym_k_compound_string_value: _sym_copy_entry (value_entry, op1_entry, sym_k_value_entry_size); res_type = cstr_arg_type; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; break; } break; case sym_k_wchar_string_value: switch (op1_entry->b_type) { case sym_k_localized_string_value: sem_append_str_to_cstr (value_entry, op1_entry, FALSE); /* BEGIN OSF Fix CR 4859 */ /* END OSF Fix CR 4859 */ res_type = wcstr_arg_type; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; break; } break; case sym_k_font_table_value: if ((op1_entry->b_type == sym_k_font_value) || (op1_entry->b_type == sym_k_fontset_value)) { value_entry->b_table_count = 1; value_entry->az_first_table_value = op1_entry; res_type = font_table_arg_type; } else { diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_font_value: if ((op1_entry->b_type == sym_k_char_8_value) || (op1_entry->b_type == sym_k_localized_string_value) || (op1_entry->b_type == sym_k_font_value)) { value_entry->value.c_value = op1_entry->value.c_value; value_entry->w_length = op1_entry->w_length; res_type = font_arg_type; } else { diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_fontset_value: if ((op1_entry->b_type == sym_k_char_8_value) || (op1_entry->b_type == sym_k_localized_string_value) || (op1_entry->b_type == sym_k_fontset_value)) { value_entry->value.c_value = op1_entry->value.c_value; value_entry->w_length = op1_entry->w_length; res_type = fontset_arg_type; } else { diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } case sym_k_color_value: case sym_k_xbitmapfile_value: case sym_k_reason_value: case sym_k_argument_value: case sym_k_keysym_value: case sym_k_class_rec_name_value: switch (value_entry->b_type) { case sym_k_color_value: res_type = color_arg_type; break; case sym_k_xbitmapfile_value: res_type = xbitmap_arg_type; break; case sym_k_reason_value: res_type = reason_arg_type; break; case sym_k_argument_value: res_type = argument_arg_type; break; case sym_k_keysym_value: res_type = keysym_arg_type; break; /* Begin fixing CR 5429 */ case sym_k_class_rec_name_value: res_type = classrec_arg_type; break; /* End fixing CR 5429 */ } switch (op1_entry->b_type) { case sym_k_char_8_value: case sym_k_localized_string_value: value_entry->value.c_value = op1_entry->value.c_value; value_entry->w_length = op1_entry->w_length; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; break; } break; case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: res_type = integer_arg_type; switch (op1_entry->b_type) { case sym_k_bool_value: case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: value_entry->value.l_integer = op1_entry->value.l_integer; value_entry->b_arg_type = op1_entry->b_arg_type; break; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: res_type = sem_convert_to_integer( op1_entry, &res_data ); value_entry->value.l_integer = res_data.integer_value; value_entry->b_arg_type = op1_entry->b_arg_type; break; case sym_k_single_float_value: /* single float data type RAP */ res_type = sem_convert_to_integer( op1_entry, &res_data ); value_entry->value.l_integer = res_data.integer_value; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; break; } break; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: res_type = float_arg_type; switch (op1_entry->b_type) { case sym_k_bool_value: case sym_k_integer_value: case sym_k_single_float_value: /* single float data type RAP */ case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: res_type = sem_convert_to_float( op1_entry, &res_data ); value_entry->value.d_real = res_data.real_value; value_entry->b_arg_type = op1_entry->b_arg_type; break; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: value_entry->value.d_real = op1_entry->value.d_real; value_entry->b_arg_type = op1_entry->b_arg_type; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; break; } break; case sym_k_single_float_value: res_type = single_float_arg_type; switch (op1_entry->b_type) { case sym_k_bool_value: case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: res_type = sem_convert_to_single_float( op1_entry, &res_data ); value_entry->value.single_float = res_data.single_float_value; value_entry->b_arg_type = op1_entry->b_arg_type; break; case sym_k_single_float_value: value_entry->value.single_float = op1_entry->value.single_float; break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; break; } break; case sym_k_error_value: break; default: /* Begin fixing CR 5429 */ if ((op1_entry->b_type != sym_k_char_8_value) && (op1_entry->b_type != sym_k_localized_string_value)) diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( value_entry ), diag_value_text( op1_entry->b_type ), diag_value_text( sym_k_char_8_value ) ); else diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( value_entry ), "wrong", diag_value_text( sym_k_char_8_value ) ); value_entry = sym_az_error_value_entry; res_type = error_arg_type; } break; /* End fixing CR 5429 */ case sym_k_valref_op: { /* ** Copy all the value-related fields from the referenced ** node to the referencing node. All non value-related fields ** are left intact, except that the forward reference flag ** is turned off */ value_entry->obj_header.b_flags &= ~sym_m_forward_ref; value_entry->b_type = op1_entry->b_type; value_entry->w_length = op1_entry->w_length; value_entry->b_table_count = op1_entry->b_table_count; value_entry->b_aux_flags = op1_entry->b_aux_flags; value_entry->b_arg_type = op1_entry->b_arg_type; value_entry->b_data_offset = op1_entry->b_data_offset; value_entry->b_pixel_type = op1_entry->b_pixel_type; value_entry->b_charset = op1_entry->b_charset; value_entry->b_direction = op1_entry->b_direction; value_entry->b_enumeration_value_code = op1_entry->b_enumeration_value_code; value_entry->az_first_table_value = op1_entry->az_first_table_value; value_entry->az_charset_value = op1_entry->az_charset_value; /* ** Because of alignment requirements, we can't just move the largest ** field of the union, but actually have to move the correct value ** field based upon the datatype. */ switch (op1_entry->b_type) { case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: value_entry->value.l_integer = op1_entry->value.l_integer; value_entry->b_arg_type = op1_entry->b_arg_type; break; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: value_entry->value.d_real = op1_entry->value.d_real; value_entry->b_arg_type = op1_entry->b_arg_type; break; case sym_k_char_8_value: case sym_k_localized_string_value: value_entry->value.c_value = op1_entry->value.c_value; break; case sym_k_single_float_value: value_entry->value.single_float = op1_entry->value.single_float; break; case sym_k_color_value: value_entry->value.z_color = op1_entry->value.z_color; break; case sym_k_icon_value: value_entry->value.z_icon = op1_entry->value.z_icon; break; default: value_entry->value.az_data = op1_entry->value.az_data; break; } break; } case sym_k_add_op: switch (res_type) { case integer_arg_type: case horizontal_integer_arg_type: case vertical_integer_arg_type: value_entry->value.l_integer = op1_ptr->integer_value + op2_ptr->integer_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case float_arg_type: case horizontal_float_arg_type: case vertical_float_arg_type: value_entry->value.d_real = op1_ptr->real_value + op2_ptr->real_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case single_float_arg_type: value_entry->value.single_float = op1_ptr->single_float_value + op2_ptr->single_float_value; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_subtract_op: switch (res_type) { case integer_arg_type: case horizontal_integer_arg_type: case vertical_integer_arg_type: value_entry->value.l_integer = op1_ptr->integer_value - op2_ptr->integer_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case float_arg_type: case horizontal_float_arg_type: case vertical_float_arg_type: value_entry->value.d_real = op1_ptr->real_value - op2_ptr->real_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case single_float_arg_type: value_entry->value.single_float = op1_ptr->single_float_value - op2_ptr->single_float_value; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_multiply_op: switch (res_type) { case integer_arg_type: case horizontal_integer_arg_type: case vertical_integer_arg_type: value_entry->value.l_integer = op1_ptr->integer_value * op2_ptr->integer_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case float_arg_type: case horizontal_float_arg_type: case vertical_float_arg_type: value_entry->value.d_real = op1_ptr->real_value * op2_ptr->real_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case single_float_arg_type: value_entry->value.single_float = op1_ptr->single_float_value * op2_ptr->single_float_value; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_divide_op: switch (res_type) { case integer_arg_type: case horizontal_integer_arg_type: case vertical_integer_arg_type: value_entry->value.l_integer = op1_ptr->integer_value / op2_ptr->integer_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case float_arg_type: case horizontal_float_arg_type: case vertical_float_arg_type: value_entry->value.d_real = op1_ptr->real_value / op2_ptr->real_value; if (op1_entry->b_arg_type != op2_entry->b_arg_type) { diag_issue_diagnostic(d_different_units, _sar_source_pos2(value_entry)); res_type = error_arg_type; } else value_entry->b_arg_type = op1_entry->b_arg_type; break; case single_float_arg_type: value_entry->value.single_float = op1_ptr->single_float_value / op2_ptr->single_float_value; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_left_shift_op: switch (res_type) { case integer_arg_type: { int shift_count; shift_count = op2_ptr->integer_value; if ((shift_count < 0) || (shift_count > 32)) goto error_occurred; value_entry->value.l_integer = op1_ptr->integer_value << op2_ptr->integer_value; break; } case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_right_shift_op: switch (res_type) { case integer_arg_type: { int shift_count; shift_count = op2_ptr->integer_value; if ((shift_count < 0) || (shift_count > 32)) goto error_occurred; value_entry->value.l_integer = op1_ptr->integer_value >> op2_ptr->integer_value; break; } case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_and_op: switch (res_type) { case integer_arg_type: case boolean_arg_type: value_entry->value.l_integer = op1_ptr->integer_value & op2_ptr->integer_value; break; case char_arg_type: case lstr_arg_type: sar_cat_value_entry( &cat_str_entry, op1_entry, op2_entry ); value_entry->b_type = cat_str_entry->b_type; if (cat_str_entry->b_type == sym_k_compound_string_value) { res_type = cstr_arg_type; value_entry->az_first_table_value = cat_str_entry->az_first_table_value; } value_entry->b_charset = cat_str_entry->b_charset; value_entry->b_direction = cat_str_entry->b_direction; value_entry->value.c_value = cat_str_entry->value.c_value; value_entry->w_length = cat_str_entry->w_length; cat_str_entry->value.c_value = NULL; sem_free_node (( sym_entry_type *)cat_str_entry); break; case cstr_arg_type: sar_cat_value_entry( &cat_str_entry, op1_entry, op2_entry ); value_entry->b_type = cat_str_entry->b_type; value_entry->b_charset = cat_str_entry->b_charset; value_entry->b_direction = cat_str_entry->b_direction; value_entry->value.xms_value = cat_str_entry->value.xms_value; value_entry->az_first_table_value = cat_str_entry->az_first_table_value; value_entry->w_length = cat_str_entry->w_length; sem_evaluate_value_cs (value_entry); cat_str_entry->value.xms_value = NULL; sem_free_node (( sym_entry_type *)cat_str_entry); break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_or_op: switch (res_type) { case integer_arg_type: case boolean_arg_type: value_entry->value.l_integer = op1_ptr->integer_value | op2_ptr->integer_value; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; case sym_k_xor_op: switch (res_type) { case integer_arg_type: case boolean_arg_type: value_entry->value.l_integer = op1_ptr->integer_value ^ op2_ptr->integer_value; break; case error_arg_type: break; default: diag_issue_diagnostic ( d_cannot_convert, _sar_source_pos2( value_entry), diag_value_text( op1_entry->b_type ), diag_value_text( value_entry->b_type ) ); res_type = error_arg_type; } break; default: _assert( FALSE, "unexpected operator" ); } /* End of switch statement */ continue_after_error: /* ** Set data type for expression value. If binary operation, use res_type ** because conversions may have taken place. Otherwise use b_type from ** the operand of the unary operator. */ if (value_entry->b_expr_opr == sym_k_valref_op) value_entry->b_type = op1_entry->b_type; else switch (res_type) { case boolean_arg_type: value_entry->b_type = sym_k_bool_value; break; case integer_arg_type: value_entry->b_type = sym_k_integer_value; break; case single_float_arg_type: value_entry->b_type = sym_k_single_float_value; break; case float_arg_type: value_entry->b_type = sym_k_float_value; break; case horizontal_integer_arg_type: value_entry->b_type = sym_k_horizontal_integer_value; break; case vertical_integer_arg_type: value_entry->b_type = sym_k_vertical_integer_value; break; case horizontal_float_arg_type: value_entry->b_type = sym_k_horizontal_float_value; break; case vertical_float_arg_type: value_entry->b_type = sym_k_vertical_float_value; break; case keysym_arg_type: value_entry->b_type = sym_k_keysym_value; break; case char_arg_type: case lstr_arg_type: value_entry->b_type = sym_k_char_8_value; break; case cstr_arg_type: value_entry->b_type = sym_k_compound_string_value; break; case wcstr_arg_type: value_entry->b_type = sym_k_wchar_string_value; break; case font_arg_type: value_entry->b_type = sym_k_font_value; break; case fontset_arg_type: value_entry->b_type = sym_k_fontset_value; break; case color_arg_type: value_entry->b_type = sym_k_color_value; break; /* Begin fixing CR 5429 */ case classrec_arg_type: value_entry->b_type = sym_k_class_rec_name_value; break; /* End fixing CR 5429 */ case xbitmap_arg_type: value_entry->b_type = sym_k_xbitmapfile_value; break; case reason_arg_type: value_entry->b_type = sym_k_reason_value; break; case argument_arg_type: value_entry->b_type = sym_k_argument_value; break; case font_table_arg_type: value_entry->b_type = sym_k_font_table_value; break; case error_arg_type: value_entry->b_type = sym_k_error_value; break; default: _assert( FALSE, "unexpected type" ); } /* ** indicate that this expression has been evaluated */ value_entry->b_aux_flags |= sym_m_exp_eval; in_expr = FALSE; return value_entry; /* ** Point where errors are transferred */ error_occurred: diag_issue_diagnostic ( d_out_range, _sar_source_pos2( value_entry ), value_text[ (int)res_type ], "" ); res_type = error_arg_type; diag_reset_overflow_handler(); goto continue_after_error; } int validate_arg( operand_entry, operator) sym_value_entry_type *operand_entry; int operator; { char operand_type; operand_type = operand_entry->b_type; if (operand_type == sym_k_error_value ) return error_arg_type; if ((( 1 << operand_type ) & legal_operand_type[ operator ]) == 0) { diag_issue_diagnostic ( d_operand_type, _sar_source_pos2( operand_entry ), diag_value_text( operand_type ), operator_symbol[ operator ] ); return error_arg_type; } if ((operand_entry->obj_header.b_flags & sym_m_imported) != 0) { sym_value_entry_type *value_entry; value_entry = operand_entry; diag_issue_diagnostic ( d_nonpvt, _sar_source_pos2( operand_entry ), value_entry->obj_header.az_name->c_text ); return error_arg_type; } switch (operand_type) { case sym_k_bool_value: return boolean_arg_type; case sym_k_integer_value: return integer_arg_type; case sym_k_float_value: return float_arg_type; case sym_k_single_float_value: return single_float_arg_type; case sym_k_horizontal_integer_value: return horizontal_integer_arg_type; case sym_k_vertical_integer_value: return vertical_integer_arg_type; case sym_k_horizontal_float_value: return horizontal_float_arg_type; case sym_k_vertical_float_value: return vertical_float_arg_type; case sym_k_char_8_value: return char_arg_type; case sym_k_compound_string_value: return cstr_arg_type; case sym_k_localized_string_value: return lstr_arg_type; case sym_k_wchar_string_value: return wcstr_arg_type; case sym_k_font_value: return font_arg_type; case sym_k_fontset_value: return fontset_arg_type; case sym_k_color_value: return color_arg_type; default: return error_arg_type; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function converts a value to floating point. ** ** FORMAL PARAMETERS: ** ** operand_entry frame of the value to convert ** data_value data structure to hold float result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** float_arg_type if operation succeeds ** error_arg_type if operation fails ** ** SIDE EFFECTS: ** ** none ** **-- **/ int sem_convert_to_float(operand_entry, data_value) sym_value_entry_type *operand_entry; data_value_type *data_value; { switch (operand_entry->b_type) { case sym_k_error_value: return error_arg_type; case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: case sym_k_bool_value: data_value->real_value = operand_entry->value.l_integer; return float_arg_type; case sym_k_single_float_value: /* single float data type RAP */ data_value->real_value = operand_entry->value.single_float; return float_arg_type; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: data_value->real_value = operand_entry->value.d_real; return float_arg_type; default: _assert( FALSE, "unexpected operand type" ); } return error_arg_type; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function converts a value to type integer ** ** FORMAL PARAMETERS: ** ** operand_entry frame of the value to convert ** data_value data structure to hold integer result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** integer_arg_type if operation succeeds ** error_arg_type if operation fails ** ** SIDE EFFECTS: ** ** none ** **-- **/ int sem_convert_to_integer(operand_entry, data_value) sym_value_entry_type *operand_entry; data_value_type *data_value; { int res_type = 0; uil_az_error_env_valid = TRUE; if (setjmp(uil_az_error_env_block) == 0 ) { switch (operand_entry->b_type) { case sym_k_error_value: res_type = error_arg_type; break; case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: case sym_k_bool_value: data_value->integer_value = operand_entry->value.l_integer; res_type = integer_arg_type; break; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: data_value->integer_value = operand_entry->value.d_real; res_type = integer_arg_type; break; case sym_k_single_float_value: /* single float data type RAP */ data_value->integer_value = (int) operand_entry->value.single_float; res_type = integer_arg_type; break; default: _assert( FALSE, "unexpected operand type" ); } uil_az_error_env_valid = FALSE; return res_type; } else { diag_issue_diagnostic ( d_out_range, _sar_source_pos2( operand_entry ), value_text[ integer_arg_type ], "" ); diag_reset_overflow_handler(); uil_az_error_env_valid = FALSE; return error_arg_type; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function converts a value to single floating point. ** (RAP single float data type) ** ** FORMAL PARAMETERS: ** ** operand_entry symbol table entry of the value to convert ** data_value data structure to hold float result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** single_float_arg_type if operation succeeds ** error_arg_type if operation fails ** ** SIDE EFFECTS: ** ** none ** **-- **/ int sem_convert_to_single_float(operand_entry, data_value) sym_value_entry_type *operand_entry; data_value_type *data_value; { switch (operand_entry->b_type) { case sym_k_error_value: return error_arg_type; case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: case sym_k_bool_value: data_value->single_float_value = (float)operand_entry->value.l_integer; return single_float_arg_type; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: data_value->single_float_value = (float)operand_entry->value.d_real; return single_float_arg_type; default: _assert( FALSE, "unexpected operand type" ); } return error_arg_type; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function converts a value to an error - just needed to ** fill a slot in the conversion table. ** ** FORMAL PARAMETERS: ** ** operand_entry frame of the value to convert ** data_value not used ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** error_arg_type ** ** SIDE EFFECTS: ** ** none ** **-- **/ int sem_convert_to_error(operand_entry, data_value) sym_value_entry_type *operand_entry; data_value_type *data_value; { return error_arg_type; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function processes the concatenation of 2 strings. ** ** FORMAL PARAMETERS: ** ** operator_entry [in/out] pointer to resultant value stack frame ** op1_entry [in] pointer to operand 1 value frame ** op2_entry [in] pointer to operand 2 value frame ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error message is issued if value is out of range ** **-- **/ void sar_cat_value_entry( target_entry, op1_entry, op2_entry ) sym_value_entry_type **target_entry; sym_value_entry_type *op1_entry; sym_value_entry_type *op2_entry; { /* ** For pcc conversion, use defines instead of this enum. ** ** enum op_state ** { ** error=0, simple, compound, ** }; */ #define k_op_state_error 0 #define k_op_state_simple 1 #define k_op_state_compound 2 #define k_op_state_localized 4 int target_type; sym_value_entry_type *value1_entry; sym_value_entry_type *value2_entry; unsigned int op1_state; unsigned int op2_state; /* ** The target type is dependent on the type of the sources. If both ** operands are primitive and have the same writing direction and ** charset, the result is still of that type. If both operands are ** localized strings, the result is a localized string. If not, the result ** is a compound string. */ switch (op1_entry->b_type) { case sym_k_char_8_value: op1_state = k_op_state_simple; break; case sym_k_compound_string_value: op1_state = k_op_state_compound; break; case sym_k_localized_string_value: op1_state = k_op_state_localized; break; case sym_k_error_value: op1_state = k_op_state_error; break; default: diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( op1_entry ), diag_value_text( op1_entry->b_type), "string or compound string" ); op1_state = k_op_state_error; } switch (op2_entry->b_type) { case sym_k_char_8_value: op2_state = k_op_state_simple; break; case sym_k_compound_string_value: op2_state = k_op_state_compound; break; case sym_k_localized_string_value: op2_state = k_op_state_localized; break; case sym_k_error_value: op2_state = k_op_state_error; break; default: diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2( op2_entry ), diag_value_text( op2_entry->b_type), "string or compound string" ); op2_state = k_op_state_error; } value1_entry = op1_entry; value2_entry = op2_entry; /* ** Verify that both operands are private values */ /* Begin fixing OSF CR 5509 */ if ((op1_entry->obj_header.b_flags & (sym_m_private|sym_m_exported)) == 0) { op1_state = k_op_state_error; diag_issue_diagnostic (d_nonpvt, _sar_source_pos2 (op1_entry), value1_entry->obj_header.az_name->c_text ); } if ((op2_entry->obj_header.b_flags & (sym_m_private|sym_m_exported)) == 0) { op2_state = k_op_state_error; diag_issue_diagnostic (d_nonpvt, _sar_source_pos2 (op2_entry), value2_entry->obj_header.az_name->c_text ); } /* End fixing OSF CR 5509 */ switch (op1_state + (op2_state<<3)) { /* ** This is the case of appending two simple strings or a simple string ** and a localized string. Just append them ** unless they have different directions or the first one has the separate ** attribute. */ case k_op_state_simple + (k_op_state_simple<<3): case k_op_state_simple + (k_op_state_localized<<3): case k_op_state_localized + (k_op_state_simple<<3): if ((value1_entry->b_charset == value2_entry->b_charset) && ((value1_entry->b_direction) == (value2_entry->b_direction)) && ((value1_entry->b_aux_flags & sym_m_separate) == 0)) { *target_entry = (sym_value_entry_type *) sem_cat_str_to_str (value1_entry, FALSE, value2_entry, FALSE); target_type = sym_k_char_8_value; } else { *target_entry = (sym_value_entry_type *) sem_create_cstr( ); sem_append_str_to_cstr (*target_entry, value1_entry, FALSE); sem_append_str_to_cstr (*target_entry, value2_entry, FALSE); sem_evaluate_value_cs(*target_entry); target_type = sym_k_compound_string_value; } break; /* ** This is the case of one simple/localized and one compound string. ** Change the ** simple/localized to a compound and append them together. Depend on ** the append ** routine to do the right thing. */ case k_op_state_simple + (k_op_state_compound<<3): case k_op_state_localized + (k_op_state_compound<<3): *target_entry = (sym_value_entry_type *) sem_create_cstr( ); sem_append_str_to_cstr (*target_entry, value1_entry, FALSE); sem_evaluate_value_cs(*target_entry); /* * We must evaluate both entries to the XmStringConcat routine so * that it will work properly. However this MAY be a pointer to * a compound string, use that value instead or we will concat a * NULL value and lose part of the string. */ if ((value2_entry->az_first_table_value == NULL) && (value2_entry->value.xms_value == NULL)) value2_entry->value.xms_value = value2_entry->az_exp_op1->value.xms_value; else sem_evaluate_value_cs(value2_entry); (*target_entry)->value.xms_value = XmStringConcat((*target_entry)->value.xms_value, value2_entry->value.xms_value); target_type = sym_k_compound_string_value; break; /* ** This is the case of one simple/localized and one compound string. ** Append the simple/localized to the compound. */ case k_op_state_compound + (k_op_state_simple<<3): case k_op_state_compound + (k_op_state_localized<<3): *target_entry = (sym_value_entry_type *) sem_create_cstr( ); sem_append_str_to_cstr (*target_entry, value2_entry, FALSE); sem_evaluate_value_cs (*target_entry); /* * We must evaluate both entries to the XmStringConcat routine so * that it will work properly. However this MAY be a pointer to * a compound string, use that value instead or we will concat a * NULL value and lose part of the string. */ if ((value1_entry->az_first_table_value == NULL) && (value1_entry->value.xms_value == NULL)) value1_entry->value.xms_value = value1_entry->az_exp_op1->value.xms_value; else sem_evaluate_value_cs(value1_entry); (*target_entry)->value.xms_value = XmStringConcat (value1_entry->value.xms_value, (*target_entry)->value.xms_value); target_type = sym_k_compound_string_value; break; /* ** This is the case of two compound strings. Just let the append routine ** do the right thing. */ case k_op_state_compound + (k_op_state_compound<<3): *target_entry = (sym_value_entry_type *) sem_create_cstr( ); /* * We must evaluate both entries to the XmStringConcat routine so * that it will work properly. However this MAY be a pointer to * a compound string, use that value instead or we will concat a * NULL value and lose part of the string. */ if ((value1_entry->az_first_table_value == NULL) && (value1_entry->value.xms_value == NULL)) value1_entry->value.xms_value = value1_entry->az_exp_op1->value.xms_value; else sem_evaluate_value_cs(value1_entry); if ((value2_entry->az_first_table_value == NULL) && (value2_entry->value.xms_value == NULL)) value2_entry->value.xms_value = value2_entry->az_exp_op1->value.xms_value; else sem_evaluate_value_cs(value2_entry); (*target_entry)->value.xms_value = XmStringConcat(value1_entry->value.xms_value, value2_entry->value.xms_value); target_type = sym_k_compound_string_value; break; /* ** This is the case of two localized strings. Just concatenate them. */ case k_op_state_localized + (k_op_state_localized<<3): *target_entry = (sym_value_entry_type *) sem_cat_str_to_str (value1_entry, FALSE, value2_entry, FALSE); target_type = sym_k_localized_string_value; default: /* some form of error */ target_type = sym_k_error_value; *target_entry = (sym_value_entry_type *) sym_az_error_value_entry; break; } } motif-2.3.8/clients/uil/UilSarMod.c0000644000175000017500000004566313145162623014041 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSarMod.c /main/13 1997/03/12 15:21:36 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contain the routines for processing the module construct. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* ** ** TABLE OF CONTENTS ** */ /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ extern yystype yylval; /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ externaldef(uil_comp_glbl) src_source_record_type *src_az_module_source_record; externaldef(uil_comp_glbl) unsigned short int *uil_urm_variant = NULL; externaldef(uil_comp_glbl) unsigned short int *uil_arg_compr = NULL; externaldef(uil_comp_glbl) unsigned short int *uil_reas_compr = NULL; externaldef(uil_comp_glbl) unsigned short int *uil_widget_compr = NULL; externaldef(uil_comp_glbl) unsigned short int *uil_child_compr = NULL; /* ** ** OWN VARIABLE DECLARATIONS ** **/ unsigned int module_clauses; #define m_version_clause (1<<0) #define m_names_clause (1<<1) #define m_charset_clause (1<<2) #define m_objects_clause (1<<3) #define m_after_names (m_charset_clause) /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function initializes all static data structure for the semantic ** action routines. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** uil_urm_variant ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** global variables are initialized ** **-- **/ void sar_initialize () { int i; /* loop index */ /* BEGIN OSF Fix CR 5443 */ /* Initialize uil_sym_default_charset based on XmFALLBACK_CHARSET */ if (strcmp(XmFALLBACK_CHARSET, "ISO8859-1") != 0) /* Most common case. */ for (i = 0; i < (int)charset_lang_table_max; i++) if (strcmp(XmFALLBACK_CHARSET, charset_lang_names_table[i]) == 0) { uil_sym_default_charset = charset_lang_codes_table[i]; break; } /* END OSF Fix CR 5443 */ /* * Allocate vectors for the variant and usage vectors if they are NULL, */ if ( uil_urm_variant == NULL ) uil_urm_variant = (unsigned short int *) XtMalloc(sizeof(unsigned short int)*(uil_max_object+1)); if ( uil_arg_compr == NULL ) uil_arg_compr = (unsigned short int *) XtMalloc(sizeof(unsigned short int)*(uil_max_arg+1)); if ( uil_reas_compr == NULL ) uil_reas_compr = (unsigned short int *) XtMalloc(sizeof(unsigned short int)*(uil_max_reason+1)); if ( uil_widget_compr == NULL ) uil_widget_compr = (unsigned short int *) XtMalloc(sizeof(unsigned short int)*(uil_max_object+1)); if ( uil_child_compr == NULL ) uil_child_compr = (unsigned short int *) XtMalloc(sizeof(unsigned short int)*(uil_max_child+1)); /* ** Loop throught the array of object variants and set them all to NULL. */ for (i = 0; iheader.b_type = sym_k_section_tail; sym_az_root_entry->sections = sym_az_current_section_entry; sym_az_root_entry->src_record_list = src_az_first_source_record; /* ** Save the file name and the expanded version of it. */ strcpy (sym_az_root_entry->file_name, Uil_cmd_z_command.ac_source_file); strcpy (sym_az_root_entry->full_file_name, src_az_source_file_table[0]->expanded_name); /* ** Save the symbol node in the root frame. */ root_frame->b_tag = sar_k_root_frame; root_frame->b_type = sym_k_root_entry; root_frame->value.az_symbol_entry = (sym_entry_type *)sym_az_root_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function create the module entry symbol node for the compilation. ** ** FORMAL PARAMETERS: ** ** target_frame ptr to module frame that will remain on the stack ** throughout the compilation ** id_frame ptr to token frame for the module name ** ** IMPLICIT INPUTS: ** ** sym_az_root_entry global that points to the root entry ** ** IMPLICIT OUTPUTS: ** ** sym_az_module_entry global that points to module entry ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** set second line of the listing title ** **-- **/ void sar_create_module(target_frame, id_frame, module_frame) yystype *target_frame; yystype *id_frame; yystype *module_frame; { sym_name_entry_type *name_entry; /* ** Call standard routine to check name entry for id_frame. ** This routine handles font name, color names, etc used as ids */ name_entry = (sym_name_entry_type *) sem_dcl_name( id_frame ); /* ** Allocate the module entry and fill it in */ sym_az_module_entry = (sym_module_entry_type *) sem_allocate_node (sym_k_module_entry, sym_k_module_entry_size); sym_az_module_entry->obj_header.az_name = name_entry; _sar_save_source_pos (&sym_az_module_entry->header, module_frame); /* preserve module header comments */ sar_assoc_comment ((sym_obj_entry_type *)sym_az_module_entry); /* ** Hang the module entry off the root entry */ sym_az_root_entry->module_hdr = sym_az_module_entry; /* ** Have name entry point to the module entry too. This stops the ** name from being reused to name another construct. */ name_entry->az_object = (sym_entry_type *) sym_az_module_entry; /* ** Save the source information about module name identifier */ _sar_save_source_info ( &name_entry->header , module_frame , id_frame ); /* ** Set up target frame */ target_frame->b_tag = sar_k_module_frame; /* ** Set up listing title */ if (Uil_cmd_z_command.v_listing_file) sprintf(Uil_lst_c_title2, "Module: %s", name_entry->c_text ); /* ** Set mask to no clauses seen */ module_clauses = 0; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function sets a version string for the module. ** ** FORMAL PARAMETERS: ** ** value_frame ptr to value frame for version string ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** sym_az_module_entry global that point to module entry ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** set up second line of the listing title ** **-- **/ void sar_process_module_version (value_frame, start_frame) yystype *value_frame; yystype *start_frame; { sym_value_entry_type *value_entry = NULL; _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" ); if ((module_clauses & m_version_clause) != 0) diag_issue_diagnostic ( d_single_occur, _sar_source_position( value_frame ), "UIL", "module", "version", "clause" ); /* ** FORWARD REFERENCING OF VERSION NO LONGER ALLOWED ** If it's not a forward reference, verify its length and stick a pointer ** to the value node of the version in the module entry. */ if ((value_frame->b_flags & sym_m_forward_ref) != 0) diag_issue_diagnostic(d_illegal_forward_ref, _sar_source_position(value_frame), "Module Version" ); else { value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; if (value_entry->w_length > 31) { diag_issue_diagnostic ( d_out_range, _sar_source_position( value_frame ), "version string", "0..31 characters" ); value_entry->w_length = 31; } sym_az_module_entry->az_version = value_entry; } /* ** Save source info */ _sar_save_source_info ( &sym_az_module_entry->az_version->header , start_frame , value_frame); /* ** Set up listing title */ if (Uil_cmd_z_command.v_listing_file) sprintf(Uil_lst_c_title2, "Module: %s \t Version: %s", sym_az_module_entry->obj_header.az_name->c_text, value_entry->value.c_value ); module_clauses |= m_version_clause; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function sets the case sensitivity of names for the module. ** ** FORMAL PARAMETERS: ** ** token_frame ptr to token frame for keyword sensitive or insensitive ** ** IMPLICIT INPUTS: ** ** sym_az_module_entry global which points to module entry ** ** IMPLICIT OUTPUTS: ** ** uil_v_case_sensitive global which control case sensitivity of names ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_process_module_sensitivity (token_frame, start_frame) yystype *token_frame; yystype *start_frame; { _assert( token_frame->b_tag == sar_k_token_frame, "token frame missing" ); if ((module_clauses & m_names_clause) != 0) diag_issue_diagnostic ( d_single_occur, _sar_source_position( token_frame ), "UIL", "module", "names", "clause" ); if ((module_clauses & m_after_names) != 0) diag_issue_diagnostic ( d_names, _sar_source_position( token_frame ) ); uil_v_case_sensitive = (token_frame->b_type == CASE_SENSITIVE); sym_az_module_entry->az_case_sense = (sym_value_entry_type *) sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size); sym_az_module_entry->az_case_sense->header.b_type = uil_v_case_sensitive; /* ** Save source info */ _sar_save_source_info ( &sym_az_module_entry->az_case_sense->header , start_frame , token_frame); /* let the keyword table know of the sensitivity change */ key_initialize(); /* ** The default for name sensitivity is SENSITIVE. ** At the point that this semantic routine is called, the only valid ** name seen so far is the module name. */ module_clauses |= m_names_clause; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function sets the default charset for the module. ** ** FORMAL PARAMETERS: ** ** token_frame ptr to token frame for charset ** ** IMPLICIT INPUTS: ** ** sym_az_module_entry global pointer to the module entry ** ** IMPLICIT OUTPUTS: ** ** Uil_lex_l_user_default_charset ** Uil_lex_az_charset_entry ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_process_module_charset(token_frame , start_frame) yystype *token_frame; yystype *start_frame; { sym_value_entry_type *value_entry = NULL; _assert( (token_frame->b_tag == sar_k_token_frame) || (token_frame->b_tag == sar_k_value_frame), "token or value frame missing" ); if ((module_clauses & m_charset_clause) != 0) diag_issue_diagnostic ( d_single_occur, _sar_source_position( token_frame ), "UIL", "module", "character_set", "clause" ); /* ** There are two different ways that the charset info may be specified. ** If the charset_frame is a token frame, then we can just grab the ** token class and map it into a charset value. If it is a value frame ** the it is the result of the CHARACTER_SET function and is a string ** value representing the character set. */ switch (token_frame->b_tag) { case sar_k_token_frame: { key_keytable_entry_type *az_keyword_entry; az_keyword_entry = token_frame->value.az_keyword_entry; Uil_lex_l_user_default_charset = az_keyword_entry->b_subclass; value_entry = sem_create_value_entry ( token_frame->value.az_keyword_entry->at_name, token_frame->value.az_keyword_entry->b_length, sym_k_char_8_value ); break; } case sar_k_value_frame: { Uil_lex_l_user_default_charset = lex_k_userdefined_charset; Uil_lex_az_charset_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry; value_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry; break; } } /* If charset specified for module, then localized strings not allowed */ Uil_lex_l_localized = FALSE; module_clauses |= m_charset_clause; sym_az_module_entry->az_character_set = value_entry; /* ** Save source info */ _sar_save_source_info ( &value_entry->header , start_frame , token_frame); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function saves the source record for the module header ** for possible later use in the machine code listing. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** yylval Current token information from the lexical analyzer ** ** IMPLICIT OUTPUTS: ** ** src_az_module_source_record source record for the module header ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_module_source () { src_az_module_source_record = yylval.az_source_record; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine creates and saves a default object specification ** for the module entry itself. ** ** FORMAL PARAMETERS: ** ** object_frame ptr to token frame for "OBJECT" ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** sym_az_module_entry global pointer to the module entry ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_make_def_obj (object_frame) yystype *object_frame; { sym_def_obj_entry_type *def_obj_entry; /* * Make def_obj entry and link into the chain headed in the module */ def_obj_entry = (sym_def_obj_entry_type *) sem_allocate_node (sym_k_def_obj_entry, sym_k_def_obj_entry_size); _sar_save_source_pos (&def_obj_entry->header, object_frame); def_obj_entry->next = sym_az_module_entry->az_def_obj; sym_az_module_entry->az_def_obj = def_obj_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function sets the default variants for objects which ** are defined in the module. ** ** FORMAL PARAMETERS: ** ** type_frame ptr to token frame for object type ** variant_frame ptr to token frame for variant ** ** IMPLICIT INPUTS: ** ** uil_gadget_variants table to see if the gadget variant is supported ** uil_urm_variant table to see if the object type has been ** specified previously ** sym_az_module_entry global pointing to the module entry ** ** IMPLICIT OUTPUTS: ** ** uil_urm_variant table to contain the default variant for this ** object type. ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_process_module_variant (obj_type_frame, variant_frame) yystype *obj_type_frame; yystype *variant_frame; { unsigned int obj_type, obj_variant; yystype *source_frame; sym_def_obj_entry_type *def_obj_entry; source_frame = & yylval; obj_type = obj_type_frame->value.az_keyword_entry->b_subclass; obj_variant = variant_frame->b_type; /* See if this object type has been specified before. */ if ( uil_urm_variant[obj_type] != 0 ) { diag_issue_diagnostic (d_supersede, _sar_source_position ( source_frame ), diag_object_text (obj_type), diag_tag_text (obj_variant), diag_tag_text (sym_k_module_entry), "" ); } /* See if this object type supports gadgets. */ if ( obj_variant == sym_k_gadget_entry ) { if ( uil_gadget_variants[obj_type] == 0 ) { diag_issue_diagnostic (d_gadget_not_sup, _sar_source_position ( source_frame ), diag_object_text (obj_type), diag_object_text (obj_type) ); obj_variant = sym_k_widget_entry; } } /* Save the default variant information */ uil_urm_variant[obj_type] = obj_variant; /* ** get the latest def_obj entry and fill in */ def_obj_entry = sym_az_module_entry->az_def_obj->next; def_obj_entry->b_object_info = obj_type; def_obj_entry->b_variant_info = obj_variant; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure saves source info for the various sections declaration ** lists in the Uil file (i.e. value, identifier, procedure, object, and ** list). ** ** FORMAL PARAMETERS: ** ** header_frame ptr to token frame for the section declaration ** section_type integer describing what section this is ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** sym_az_root_entry global pointer to the root entry ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- */ void sar_save_section_source (header_frame, section_type) yystype *header_frame; int section_type; { sym_section_entry_type *section_entry; section_entry = (sym_section_entry_type *) sem_allocate_node ( sym_k_section_entry, sym_k_section_entry_size ); section_entry->header.b_type = section_type; /* ** Save source info */ _sar_save_source_info ( §ion_entry->header , header_frame, header_frame); /* ** Link this section into the current section list. */ section_entry->next = (sym_entry_type *) sym_az_current_section_entry; section_entry->prev_section = sym_az_current_section_entry->prev_section; sym_az_current_section_entry = section_entry; } motif-2.3.8/clients/uil/UilDiags.c0000644000175000017500000006133213145162623013672 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilDiags.c /main/15 1996/10/21 11:06:46 cde-osf $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contains the procedures for issuing diagnostics ** for the UIL compiler. ** ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include #include #include #include #include #include #include "UilDefI.h" #include "UilMessTab.h" /* ** ** EXTERNAL Storage ** */ externaldef(uil_comp_glbl) int Uil_message_count[uil_k_max_status+1]; /* ** ** OWN Storage ** */ static boolean issuing_diagnostic; static int Uil_diag_status_delay_count; /* * Fix for CR 5534 - static storage for old signal handlers */ static void (*bus_handler)(); static void (*sys_handler)(); static void (*fpe_handler)(); /* **++ ** FUNCTIONAL DESCRIPTION: ** ** diag_store_handlers saves the signal handlers from the calling ** application in global variables. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the global signal handler variables are changed. ** **-- **/ void diag_store_handlers ( void ) { /* * Fix for CR 5534 - set the file variables for holding previous bus handlers * to NULL and then store the old handlers (if any) when * calling signal for the Uil handlers */ bus_handler = signal( SIGBUS, diag_handler ); /* access violations */ #ifdef SIGSYS sys_handler = signal( SIGSYS, diag_handler ); /* bad arguments to sys calls */ #endif fpe_handler = signal( SIGFPE, diag_handler ); /* overflows */ /* * End Fix for CR 5534 */ } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** diag_issue_diagnostic emits a diagnostic to the listing file if ** there is one and also sends an error to standard error file. ** ** FORMAL PARAMETERS: ** ** d_message_number: index of the error to issue. The indices are ** defined in message.h ** a_src_rec: pointer to the source record to issue the ** diagnostic against. This data structure has ** l_start_column: position within the source line for diagnostic. ** A negative value indicates no position. ** args: a variable length parameter list that holds the ** arguments to be substituted in the diagnositic ** ** IMPLICIT INPUTS: ** ** diag_rz_msg_table: table of messages and their severities defined ** in message_table.h ** diag_rl_external_code: Possible OS-specific external code ** ** IMPLICIT OUTPUTS: ** ** messages emitted ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** message counts updated ** **-- **/ #define buf_size (src_k_max_source_line_length + 1) void diag_issue_diagnostic ( int d_message_number, src_source_record_type *az_src_rec, int l_start_column, ...) { va_list ap; /* ptr to variable length parameter */ int severity; /* severity of message */ int message_number; /* message number */ char msg_buffer[132]; /* buffer to construct message */ char ptr_buffer[buf_size]; /* buffer to construct pointer */ char loc_buffer[132]; /* buffer to construct location */ char src_buffer[buf_size]; /* buffer to hold source line */ /* ** check if we are in a loop issuing errors */ if (issuing_diagnostic) { _debug_output( "nested diagnostics issued" ); Uil_message_count[ uil_k_severe_status ]++; uil_exit( uil_k_severe_status ); } issuing_diagnostic = TRUE; /* ** determine the severity of the error. For d_submit_spr we issue ** the fix previous error diagnostic, if we encountered prior errors; ** otherwise we let it thru. */ message_number = d_message_number; if (message_number == d_submit_spr) if (Uil_message_count[ uil_k_error_status ] > 0) message_number = d_prev_error; severity = diag_rz_msg_table[ message_number ].l_severity; /* ** check if messages of this severity are to be reported. */ switch (severity) { case uil_k_info_status: if (Uil_cmd_z_command.v_report_info_msg) break; issuing_diagnostic = FALSE; return; case uil_k_warning_status: if (Uil_cmd_z_command.v_report_warn_msg) break; issuing_diagnostic = FALSE; return; default: ; } Uil_message_count[ severity ]++; if (severity > uil_l_compile_status) uil_l_compile_status = severity; /* ** Diagnostic format varies considerably ** 1) no source ** message ** 2) source but no column ** source line ** message ** location in source message ** 3) source and column ** source line ** column pointer ** message ** location in source message ** 4) source and column but no access key ** message ** location in source message */ /* ** substitute any parameters into the error message placing the ** resultant string in msg_buffer */ va_start(ap, l_start_column); #ifndef NO_MESSAGE_CATALOG vsnprintf( msg_buffer, sizeof(msg_buffer), catgets(uil_catd, UIL_SET1, msg_cat_table[ message_number ], diag_rz_msg_table[ message_number ].ac_text), ap ); #else vsnprintf( msg_buffer, sizeof(msg_buffer), diag_rz_msg_table[ message_number ].ac_text, ap ); #endif va_end(ap); src_buffer[ 0 ] = 0; loc_buffer[ 0 ] = 0; ptr_buffer[ 0 ] = 0; if (az_src_rec != diag_k_no_source) { if ( !_src_null_access_key(az_src_rec->z_access_key) ) { /* ** create the location line line */ #ifndef NO_MESSAGE_CATALOG sprintf( loc_buffer, catgets(uil_catd, UIL_SET_MISC, UIL_MISC_0, "\t\t line: %d file: %s"), az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); #else sprintf( loc_buffer, "\t\t line: %d file: %s", az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); #endif /* ** retrieve the source line */ src_buffer[ 0 ] = '\t'; src_retrieve_source( az_src_rec, &src_buffer[ 1 ] ); /* ** filter the standard unprintable characters. */ lex_filter_unprintable_chars ( (unsigned char *)src_buffer, strlen( src_buffer ), 0 ); /* ** create the column pointer if a source position was given */ if (l_start_column != diag_k_no_column) { int i; for (i=0; i < l_start_column+1; i++) { if (src_buffer[ i ] == '\t') ptr_buffer[ i ] = '\t'; else ptr_buffer[ i ] = ' '; } ptr_buffer[ i++ ] = '*'; ptr_buffer[ i ] = 0; } } else /* no access key */ { /* ** create the location line line */ if (l_start_column != diag_k_no_column) #ifndef NO_MESSAGE_CATALOG sprintf(loc_buffer, catgets(uil_catd, UIL_SET_MISC, UIL_MISC_1, "\t\t line: %d position: %d file: %s"), az_src_rec->w_line_number, l_start_column + 1, src_get_file_name( az_src_rec ) ); #else sprintf(loc_buffer, "\t\t line: %d position: %d file: %s", az_src_rec->w_line_number, l_start_column + 1, src_get_file_name( az_src_rec ) ); #endif else #ifndef NO_MESSAGE_CATALOG sprintf( loc_buffer, catgets(uil_catd, UIL_SET_MISC, UIL_MISC_0, "\t\t line: %d file: %s"), az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); #else sprintf( loc_buffer, "\t\t line: %d file: %s", az_src_rec->w_line_number, src_get_file_name( az_src_rec ) ); #endif } } /* ** issue the error to standard error file (system specific) */ write_msg_to_standard_error ( message_number, src_buffer, ptr_buffer, msg_buffer, loc_buffer ); /* ** if we have a listing, place message in the source structure */ if (Uil_cmd_z_command.v_listing_file) src_append_diag_info ( az_src_rec, l_start_column, msg_buffer, message_number ); issuing_diagnostic = FALSE; /* ** if there are fatal errors, print the listing file and exit. */ if (Uil_message_count[ uil_k_severe_status] > 0) { lst_output_listing(); uil_exit( uil_k_severe_status ); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** diag_issue_summary emits a diagnostic summary if any diagnostics ** were issued during the compilation ** ** FORMAL PARAMETERS: ** ** void ** ** IMPLICIT INPUTS: ** ** Uil_message_count table of messages issued ** ** IMPLICIT OUTPUTS: ** ** messages optionally emitted ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void diag_issue_summary() { if (uil_l_compile_status == uil_k_success_status) return; Uil_cmd_z_command.v_report_info_msg = TRUE; diag_issue_diagnostic ( d_summary, diag_k_no_source, diag_k_no_column, Uil_message_count[ uil_k_error_status ], Uil_message_count[ uil_k_warning_status ], Uil_message_count[ uil_k_info_status ] ); return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** The major constructs in the UIL language each have a data structure ** and a tag value in the first byte of that data structure. Given ** a tag value, this routine will return a string that can be substituted ** in an error message to describe that construct. ** ** FORMAL PARAMETERS: ** ** b_tag ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** char * text corresponding to tag ** ** SIDE EFFECTS: ** ** none ** **-- **/ char *diag_tag_text( b_tag ) int XmConst b_tag; { switch (b_tag) { case sym_k_value_entry: return "value"; case sym_k_widget_entry: return "widget"; case sym_k_gadget_entry: return "gadget"; case sym_k_child_entry: return "auto child"; case sym_k_module_entry: return "module"; case sym_k_proc_def_entry: case sym_k_proc_ref_entry: return "procedure"; case sym_k_identifier_entry: return "identifier"; /* These are used by the symbol table dumper. */ case sym_k_argument_entry: return "argument"; case sym_k_callback_entry: return "callback"; case sym_k_control_entry: return "control"; case sym_k_name_entry: return "name"; case sym_k_forward_ref_entry: return "forward ref"; case sym_k_external_def_entry: return "external def"; case sym_k_list_entry: return "list"; case sym_k_root_entry: return "root"; case sym_k_include_file_entry: return "include file"; case sym_k_def_obj_entry: return "default variant"; case sym_k_section_entry: return "section"; default: #ifndef NO_MESSAGE_CATALOG return (catgets(uil_catd, UIL_VALUES, UIL_VAL_1, "** unknown **")); #else return "** unknown **"; #endif } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Each widget in the UIL language has a integer value. Given this ** value, this routine will return a string that can be substituted ** in an error message to describe that widget. ** ** FORMAL PARAMETERS: ** ** b_type integer rep of the widget type ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** char * text corresponding to type ** ** SIDE EFFECTS: ** ** none ** **-- **/ char *diag_object_text( b_type ) int XmConst b_type; { if ( b_type <= sym_k_error_object ) #ifndef NO_MESSAGE_CATALOG return (catgets(uil_catd, UIL_VALUES, UIL_VAL_0, "** error **")); #else return "** error **"; #endif if ( b_type <= uil_max_object ) return uil_widget_names[b_type]; #ifndef NO_MESSAGE_CATALOG return (catgets(uil_catd, UIL_VALUES, UIL_VAL_1, "** unknown **")); #else return "** unknown **"; #endif } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Each value in the UIL language has a integer value. Given this ** value, this routine will return a string that can be substituted ** in an error message to describe that value. ** ** FORMAL PARAMETERS: ** ** b_type integer rep of the value type ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** char * text corresponding to type ** ** SIDE EFFECTS: ** ** none ** **-- **/ char *diag_value_text( b_type ) int XmConst b_type; { if ( b_type <= sym_k_error_value ) #ifndef NO_MESSAGE_CATALOG return (catgets(uil_catd, UIL_VALUES, UIL_VAL_0, "** error **")); #else return "** error **"; #endif if ( b_type <= sym_k_max_value ) return uil_datatype_names[b_type]; #ifndef NO_MESSAGE_CATALOG return (catgets(uil_catd, UIL_VALUES, UIL_VAL_1, "** unknown **")); #else return "** unknown **"; #endif } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Each charset supported by UIL has a integer value. Given this ** value, this routine will return a string that can be substituted ** in an error message to describe that charset. ** ** FORMAL PARAMETERS: ** ** b_type integer rep of the charset ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** char * text corresponding to type ** ** SIDE EFFECTS: ** ** none ** **-- **/ char *diag_charset_text( b_type ) int XmConst b_type; { if ( b_type <= sym_k_error_charset ) #ifndef NO_MESSAGE_CATALOG return (catgets(uil_catd, UIL_VALUES, UIL_VAL_0, "** error **")); #else return "** error **"; #endif if ( b_type <= uil_max_charset ) return uil_charset_names[b_type]; #ifndef NO_MESSAGE_CATALOG return (catgets(uil_catd, UIL_VALUES, UIL_VAL_1, "** unknown **")); #else return "** unknown **"; #endif } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine initializes the diagnostic system. This includes ** establishes a handler for catastrophic errors and initializing ** error tables. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** Uil_message_count ** issuing_diagnostic ** Uil_diag_status_delay_count ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error handler is supplied for SIGBUS, SIGFPE and SIGSYS errors ** **-- **/ void diag_initialize_diagnostics() { int i; /* ** Set up a handler to be invoked if access violations or ** bad arguments to sys calls occur. ** Other errors should be processed as is standard for the OS. */ /* * Fix for CR 5534 - call diag_store_handlers to save the old signal handlers. */ diag_store_handlers(); /* * End Fix for CR 5534 */ signal( SIGBUS, diag_handler ); /* access violations */ #ifdef SIGSYS signal( SIGSYS, diag_handler ); /* bad arguments to sys calls */ #endif signal( SIGFPE, diag_handler ); /* overflows */ /* ** Reset the message counts to zero. */ for (i=0; i <= uil_k_max_status; i++) Uil_message_count[ i ] = 0; /* ** Clear the flag that we used to detect recursive error reporinting. */ issuing_diagnostic = FALSE; /* ** Make sure there is no delay before starting to report status. */ Uil_diag_status_delay_count = 0; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine resets the handler for detecting overflows. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error handler is supplied for SIGFPE ** **-- **/ void diag_reset_overflow_handler() { signal( SIGFPE, diag_handler ); /* overflows */ } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine is the handler for internal errors. ** ** FORMAL PARAMETERS: ** ** l_error type of signal being raised ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** image will exit (done by diag_issue_diagnostic) ** **-- **/ void diag_handler( l_error ) int l_error; { /* ** This handler is invoked for access violations, oeverflows or bad ** arguments to sys calls. Other errors are processed as is standard ** for the OS. The handler checks on overflow to see if we are trying ** to catch them at the moment. Otherwise it issues an internal error. */ if (l_error == SIGFPE) { if (uil_az_error_env_valid) { longjmp( uil_az_error_env_block, 1); } } #if debug_version { char *error_text; switch (l_error) { case SIGBUS: error_text = "Access Violation"; break; #ifdef SIGSYS case SIGSYS: error_text = "Bad system call"; break; #endif case SIGFPE: error_text = "Overflow"; break; default: error_text = "Unknown reason"; } diag_issue_internal_error( error_text ); } #else diag_issue_internal_error( NULL ); #endif /* we don't expect to come back */ } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine issues an internal error. ** ** FORMAL PARAMETERS: ** ** error_text In the debug version this parameter holds a ** description of the internal error. In the ** non debug version it is omitted. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** image will exit (done by diag_issue_diagnostic) ** **-- **/ void diag_issue_internal_error( error_text ) char * error_text; { /* ** This routine is a focal point for issuing internal errors. ** In DEBUG mode it takes an argument that gives more information ** about the failure. */ #if debug_version diag_issue_diagnostic ( d_bug_check, diag_k_no_source, diag_k_no_column , error_text ); #else diag_issue_diagnostic( d_submit_spr, diag_k_no_source, diag_k_no_column ); #endif /* we don't expect to come back */ } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** this routine emits a diagnostic to stderr ** ** FORMAL PARAMETERS: ** ** msg_number: message number ** src_buffer: ptr to source buffer for the error ** ptr_buffer: ptr to column buffer locator for the error ** msg_buffer: ptr to message buffer for the error ** loc_buffer: ptr to location buffer for the error ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** messages emitted ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ static char XmConst success_text[1] = ""; static char XmConst info_text[7] = "Info: "; static char XmConst warning_text[10] = "Warning: "; static char XmConst error_text[8] = "Error: "; static char XmConst severe_text[9] = "Severe: "; static char XmConst *severity_table [] = { success_text, info_text, warning_text, error_text, severe_text, }; void write_msg_to_standard_error (message_number, src_buffer, ptr_buffer, msg_buffer, loc_buffer) XmConst int message_number; XmConst char *src_buffer; XmConst char *ptr_buffer; XmConst char *msg_buffer; XmConst char *loc_buffer; { /* ** If message callback was supplied, call it with the description of the ** error instead of writing it to standard output. */ if (Uil_cmd_z_command.message_cb != (Uil_continue_type(*)())NULL) { Uil_status_type return_status; /* * Fix for 5534 - restore the old signal handers before calling message_cb * and restore the Uil signal handlers immediately afterwards */ diag_restore_diagnostics(); return_status = (*Uil_cmd_z_command.message_cb)( Uil_cmd_z_command.message_data, message_number, diag_rz_msg_table[ message_number ].l_severity, msg_buffer, src_buffer, ptr_buffer, loc_buffer, Uil_message_count); diag_store_handlers(); /* * End Fix for 5534 */ /* ** If request is for termination, then longjmp back to main routine ** and set the return status to reflect user abort. */ if (return_status == Uil_k_terminate) uil_exit (uil_k_error_status); else return; } /* print source line */ fprintf ( stderr, "\n" ); if (src_buffer[ 0 ] != 0) { fprintf ( stderr, "%s\n", src_buffer ); } /* print the source column locator line */ if (ptr_buffer[ 0 ] != 0) { fprintf ( stderr, "%s\n", ptr_buffer ); } /* print message line */ #ifndef NO_MESSAGE_CATALOG fprintf ( stderr, "%s%s\n", catgets(uil_catd, UIL_SET_MISC, diag_rz_msg_table[ message_number ].l_severity, severity_table [ diag_rz_msg_table[ message_number ].l_severity ]), msg_buffer ); #else fprintf ( stderr, "%s%s\n", severity_table [ diag_rz_msg_table[ message_number ].l_severity ], msg_buffer ); #endif /* print location line */ if (loc_buffer[ 0 ] != 0) { fprintf ( stderr, "%s\n", loc_buffer ); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** function to return abbreviation for a message number ** ** FORMAL PARAMETERS: ** ** d_message_number message number to look up ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** ptr to text for message number ** ** SIDE EFFECTS: ** ** none ** **-- **/ char XmConst *diag_get_message_abbrev( d_message_number ) int d_message_number; { return severity_table[ diag_rz_msg_table[ d_message_number ].l_severity ]; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Routine to invoke the user-supplied status callback routine. If none ** is supplied this routine returns without error. Otherwise, the user's ** delay information is processed and if the requested criteria is met the ** user's routine is invoked. with parameters to describe the progress of ** the compilation. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** Uil_cmd_z_command_line ** ** IMPLICIT OUTPUTS: ** ** Uil_diag_status_delay_count ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void diag_report_status ( ) { Uil_continue_type return_status; /* ** If no status callback was supplied, just return. */ if (Uil_cmd_z_command.status_cb == (Uil_continue_type(*)())NULL) return; /* ** If delay is used up (less than or equal to zero) then invoke the ** callback, and reset the delay count. */ if (Uil_diag_status_delay_count <= 0) { Uil_diag_status_delay_count = Uil_cmd_z_command.status_update_delay; /* * Fix for CR 5534 - restore the application signal handlers before calling * status_cb and then return the Uil signal handlers * immediately after. */ diag_restore_diagnostics(); return_status = (*Uil_cmd_z_command.status_cb)( Uil_cmd_z_command.status_data, Uil_percent_complete, Uil_lines_processed, Uil_current_file, Uil_message_count); diag_store_handlers(); /* * End Fix for CR 5534 */ /* ** If request is for termination, then longjmp back to main routine ** and set the return status to reflect user abort. */ if (return_status == Uil_k_terminate) { uil_exit (uil_k_error_status); } } /* ** Delay not used-up, so decrement by one. */ else Uil_diag_status_delay_count--; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine restores the old signal handlers that were replaced by ** Uil. This routine is only called by the callable Uil. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error handlers for SIGBUS, SIGFPE and SIGSYS errors are restored to ** pre-Uil condition. ** **-- **/ void diag_restore_diagnostics(void) { /* * Fix for CR 5534 - restore the old signal handlers */ signal( SIGBUS, bus_handler ); #ifdef SIGSYS signal( SIGSYS, sys_handler ); #endif signal( SIGFPE, fpe_handler ); /* * End Fix for CR 5534 */ } motif-2.3.8/clients/uil/UilCmdDef.h0000644000175000017500000000452013145162623013766 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interface to the UIL command line ** processing. ** **-- **/ #ifndef UilCmdDef_h #define UilCmdDef_h /* ** ** INCLUDE FILES ** **/ typedef struct { char *ac_source_file; char *ac_resource_file; char *ac_listing_file; unsigned int include_dir_count; /* number of directories in */ /* ac_include_dir array */ char **ac_include_dir; /* pointer to array of */ /* directories to search for */ /* includes in */ unsigned v_listing_file: 1; unsigned v_resource_file: 1; unsigned v_show_machine_code: 1; unsigned v_report_info_msg: 1; unsigned v_report_warn_msg: 1; unsigned v_parse_tree: 1; /* generate parse tree */ unsigned v_issue_summary: 1; unsigned int status_update_delay; /* Number of times a status */ /* point is passed before */ /* calling statusCB routine */ /* 0 means called every time */ Uil_continue_type (*message_cb)(); char *message_data; Uil_continue_type (*status_cb)(); char *status_data; unsigned v_use_setlocale: 1; /* Allow localized strings */ char *ac_database; unsigned v_database: 1; } cmd_command_line_type; #endif /* UilCmdDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilMain.c0000644000175000017500000003463213145162623013532 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilMain.c /main/14 1996/06/03 15:49:20 pascale $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module is the main procedure of the UIL Compiler. ** **-- **/ /* ** ** INCLUDE FILES ** */ #include /* Sun's locale.h defines ON && OFF, which is also defined in UilLexPars.h */ #ifdef ON #undef ON #endif #ifdef OFF #undef OFF #endif #ifndef X_NOT_STDC_ENV #include #endif #include "UilDefI.h" #include /* ** ** TABLE OF CONTENTS ** */ /* ** FORWARD DECLARATIONS */ extern int main _ARGUMENTS(( int l_argc , char *rac_argv [])); static void common_main _ARGUMENTS(( void )); static void common_cleanup _ARGUMENTS(( void )); #ifdef CALLABLE static void UilWrapup _ARGUMENTS((Uil_compile_desc_type *compile_desc)); #endif /* CALLABLE */ /* ** ** EXTERNAL Definitions ** */ #ifndef NO_MESSAGE_CATALOG #include #if !defined(NL_CAT_LOCALE) #define NL_CAT_LOCALE 0 #endif externaldef(uilmsg) nl_catd uil_catd = NULL; #endif extern int yyparse(); /* ** ** MODULE Definitions ** */ static status return_status = 0; static jmp_buf environment; static unsigned module_flags = 0; static unsigned doing_exit = 0; /* Bit definitions for module_flags */ #define compiler_called (1 << 0) /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This is the common part of the main routine. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** compilation occurs ** **-- **/ static void common_main() { #ifndef NO_MESSAGE_CATALOG if (uil_catd == NULL) uil_catd = catopen("Uil", NL_CAT_LOCALE); #endif /* Initialize the X toolkit. */ XtToolkitInitialize(); /* use the user supplied data base instead */ if (Uil_cmd_z_command.v_database) db_incorporate(); /* initialize the diagnostic system */ diag_initialize_diagnostics(); /* initialize the symbol table */ sym_initialize_storage(); /* initialize the source */ src_initialize_source(); /* open listing file if requested */ if (Uil_cmd_z_command.v_listing_file) lst_open_listing(); /* initialize the lexical analyzer */ lex_initialize_analyzer(); /* initialize the keyword table */ key_initialize(); /* initialize the sar data structures */ sar_initialize(); /* call YACC to parse the source file */ /* return 0 for success, 1 for failure */ /* Make sure the root entry sections pointer is filled in */ if (yyparse() != 0) diag_issue_diagnostic (d_inv_module, diag_k_no_source, diag_k_no_column); sym_az_root_entry->sections = sym_az_current_section_entry; /* call forward reference resolver */ sem_resolve_forward_refs(); /* call semantic validation */ sem_validation (); /* call the output phase if requested */ if (Uil_cmd_z_command.v_resource_file) sem_output_uid_file(); /* call symbol table dumper - if requested */ #if debug_version if (uil_v_dump_symbols == TRUE) sym_dump_symbols(); #endif /* write compilation summary */ diag_issue_summary(); /* write listing file if requested */ if (Uil_cmd_z_command.v_listing_file) lst_output_listing(); /* Storage is not cleaned up, since we will exit */ uil_exit( uil_l_compile_status ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This is the image termination procedure for the UIL compiler. ** ** FORMAL PARAMETERS: ** ** severity status of compilation on exit ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** never return from this procedure ** **-- **/ void uil_exit(severity) int severity; { /* Prevent multiple looping through this routine */ if ( doing_exit ) return; doing_exit = 1; return_status = (severity >= uil_k_error_status); /* Close and remove the uid file if it's still open. */ /* It will only be open if a severe error occurred during the output */ /* of the uid file. */ if (out_az_idbfile_id != NULL) UrmIdbCloseFile (out_az_idbfile_id, FALSE); /* If compiler called, return to calling program rather than */ /* exiting process */ if (module_flags & compiler_called) longjmp (environment, 1); /* RAP FIX for listing files */ common_cleanup(); exit(return_status); } #ifndef CALLABLE /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This is the main routine ** ** FORMAL PARAMETERS: ** ** l_argc: the number of command line arguments ** rac_argv: an array of pointers to character array arguments ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** COMPLETION CODES: ** ** 1 if errors; 0 otherwise ** ** SIDE EFFECTS: ** ** produce possibly a resource file and a listing file **-- **/ int main( l_argc, rac_argv ) int l_argc; char *rac_argv[ ]; { setlocale(LC_ALL, ""); /* call routine to parse the command line */ cmd_decode_command_line( l_argc, rac_argv ); /* call common main routine */ common_main(); return 0; /* make compiler happy */ } #endif /* !CALLABLE */ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This is the dynamic memory cleanup routine. It calls all facility ** provided cleanup routines so that dynamic structures can be released. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** all dynamic memory is freed ** **-- **/ static void common_cleanup() { /* cleanup the source file information */ Uil_src_cleanup_source(); /* cleanup listing facility */ Uil_lst_cleanup_listing(); /* cleanup the lexical analyzer */ Uil_lex_cleanup_analyzer(); return; } #ifdef CALLABLE /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This is the callable entry point for the UIL Compiler. ** ** FORMAL PARAMETERS: ** ** command_desc pointer to data structure defining UIL command line ** ** compile_desc pointer to data structure describing the results of ** the compilation. ** ** message_cb callback routine to process messages ** ** message_data user-data passed to the message_cb ** ** status_cb callback routine to process messages ** ** status_data user-data passed to the status_cb ** ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** COMPLETION CODES: ** ** uil$_normal if no errors; uil$_no_output otherwise ** ** SIDE EFFECTS: ** ** none **-- **/ Uil_status_type Uil (Uil_command_type *command_desc, Uil_compile_desc_type *compile_desc, Uil_continue_type (*message_cb)(), char *message_data, Uil_continue_type (*status_cb)(), char *status_data) { /* Indicate compiler called rather than being started via command line */ module_flags = module_flags | compiler_called; doing_exit = 0; /* Initialize command line data structure */ Uil_cmd_z_command.ac_database = command_desc -> database; Uil_cmd_z_command.v_database = command_desc -> database_flag; Uil_cmd_z_command.ac_source_file = command_desc -> source_file; Uil_cmd_z_command.ac_resource_file = command_desc -> resource_file; Uil_cmd_z_command.ac_listing_file = command_desc -> listing_file; Uil_cmd_z_command.include_dir_count = command_desc -> include_dir_count; Uil_cmd_z_command.ac_include_dir = command_desc -> include_dir; Uil_cmd_z_command.v_listing_file = command_desc -> listing_file_flag; Uil_cmd_z_command.v_resource_file = command_desc -> resource_file_flag; Uil_cmd_z_command.v_show_machine_code = command_desc -> machine_code_flag; Uil_cmd_z_command.v_report_info_msg = command_desc -> report_info_msg_flag; Uil_cmd_z_command.v_report_warn_msg = command_desc -> report_warn_msg_flag; Uil_cmd_z_command.v_parse_tree = command_desc -> parse_tree_flag; Uil_cmd_z_command.v_use_setlocale = command_desc -> use_setlocale_flag; Uil_cmd_z_command.v_issue_summary = command_desc -> issue_summary; Uil_cmd_z_command.status_update_delay = command_desc -> status_update_delay; Uil_cmd_z_command.message_cb = message_cb; Uil_cmd_z_command.message_data = message_data; Uil_cmd_z_command.status_cb = status_cb; Uil_cmd_z_command.status_data = status_data; /* The setjmp function allows us to unwind from a fatal error setjmp is */ /* nonzero if we are returning from a fatal error */ if (setjmp(environment) == 0) { /* use the user supplied data base instead. If no source file is given (this call is only to change the database), return at this point with a success. */ if ( Uil_cmd_z_command.v_database ) { db_incorporate (); if ( Uil_cmd_z_command.ac_source_file == NULL ) uil_exit (uil_k_success_status); } /* initialize the diagnostic system */ uil_l_compile_status = uil_k_success_status; diag_initialize_diagnostics(); /* initialize the symbol table */ sym_initialize_storage(); /* initialize the source */ src_initialize_source(); /* open listing file if requested */ if (Uil_cmd_z_command.v_listing_file) lst_open_listing(); /* initialize the lexical analyzer */ lex_initialize_analyzer(); /* initialize the keyword table */ key_initialize(); /* initialize the sar data structures */ sar_initialize(); /* call YACC to parse the source file */ /* return 0 for success, 1 for failure */ /* Make sure the root entry sections pointer is filled in */ if (yyparse() != 0) diag_issue_diagnostic (d_inv_module, diag_k_no_source, diag_k_no_column); sym_az_root_entry->sections = sym_az_current_section_entry; /* call forward reference resolver */ sem_resolve_forward_refs(); /* call semantic validation */ sem_validation (); /* call the output phase if requested */ if (Uil_cmd_z_command.v_resource_file) sem_output_uid_file(); /* call symbol table dumper - if requested */ #if debug_version if (uil_v_dump_symbols == TRUE) sym_dump_symbols(); #endif /* Perform standard wrapup processing */ UilWrapup (compile_desc); /* * Fix for CR 5534 - call the routine to restore the old signal handlers */ diag_restore_diagnostics(); /* * End Fix for CR 5534 */ /* exit with the compile status */ return uil_l_compile_status; } /* ** longjmp return from setjmp. This is the case of a return via ** uil_exit the value return_status is set by uil_exit. */ else { /* Do standard compiler wrapup */ UilWrapup (compile_desc); /* return the status set by uil_exit */ return uil_l_compile_status; } } /* * Local function to provide compiler wrapup processing. It is called both * from the longjmp and sequential paths in the callable compiler above. */ static void UilWrapup (compile_desc) Uil_compile_desc_type *compile_desc; { int i; /* loop index for copying message counts */ /* write compilation summary if requested */ if ( Uil_cmd_z_command.v_issue_summary ) diag_issue_summary(); /* write listing file if requested */ if (Uil_cmd_z_command.v_listing_file) lst_output_listing(); /* ** fill in the "parse tree root" in the compile descriptor, ** and set the version for the compiler and the symbol table ** structure. */ compile_desc->parse_tree_root = (char *)sym_az_root_entry; compile_desc->data_version = _data_version; compile_desc->compiler_version = _compiler_version_int; /* Fill in the message_summary array in the compile_desc */ for (i = uil_k_min_status; i <= uil_k_max_status; i++) compile_desc->message_count[i] = Uil_message_count[i]; /* If there are any error/severe messages, then don't return */ /* a symbol table for the callable compiler - clean up here */ if ( Uil_message_count[Uil_k_error_status]>0 || Uil_message_count[Uil_k_severe_status]>0 ) { Uil_cmd_z_command.v_parse_tree = FALSE; compile_desc->parse_tree_root = NULL; } /* Call the cleanup routine to free dynamic memory */ common_cleanup(); /* Cleanup storage; what is cleaned up depends on whether compiler */ /* was called or not */ Uil_sym_cleanup_storage (Uil_cmd_z_command.v_parse_tree!=1); } #endif /* CALLABLE */ #ifdef NO_MEMMOVE /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This is a memmove function that explicitly handles ** overlapping memory areas. Written in response to ** CR 4851. ** ** FORMAL PARAMETERS: ** ** same as memcpy ** ** COMPLETION CODES: ** ** same as memcpy ** ** SIDE EFFECTS: ** **-- **/ char *uil_mmove(s1, s2, n) char *s1, *s2; int n; { char *temp; if(s2 == s1) return(s2); if(s2 < s1 && s1 <= s2 + n){ if(temp = (char *)malloc(n)){ memcpy(temp, s2, n); memcpy(s1, temp, n); free(temp); return(s1); } printf("uil_mmove: Memory allocation failed!\n"); exit(-1); } return((char *)memcpy(s1, s2, n)); } #endif /* NO_MEMMOVE */ motif-2.3.8/clients/uil/UilCompGl.h0000644000175000017500000001015413145162623014025 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file contains external declarations of all Uil ** compiler globals excluding those which define the recognized ** language which are declared in UilSymGl.h ** **-- **/ #ifndef UilCompGl_h #define UilCompGl_h #include /* * Defined in UilCmd.c */ externalref cmd_command_line_type Uil_cmd_z_command; /* * Defined in UilData */ externalref boolean uil_v_case_sensitive; externalref jmp_buf uil_az_error_env_block; externalref boolean uil_az_error_env_valid; #if debug_version externalref boolean uil_v_dump_tokens; externalref boolean uil_v_dump_symbols; #endif externalref status uil_l_compile_status; externalref Uil_compile_desc_type *Uil_compile_desc_ptr; externalref int Uil_percent_complete; externalref int Uil_lines_processed; externalref char *Uil_current_file; /* * Defined in UilDiags */ externalref int Uil_message_count[]; /* * Defined in UilLexAna */ externalref int Uil_lex_l_user_default_charset; externalref sym_value_entry_type *Uil_lex_az_charset_entry; externalref int Uil_lex_l_charset_specified; externalref int Uil_lex_l_localized; externalref int Uil_lex_l_literal_charset; externalref sym_value_entry_type *Uil_lex_az_literal_charset; externalref char *comment_text; externalref int comment_size; /* % Complete */ externalref int Uil_characters_read; /* * Defined in UilLstLst */ externalref char Uil_lst_c_title2[]; /* * Defined in UilP2Out */ externalref IDBFile out_az_idbfile_id; /* * Defined in UilSarMod */ externalref src_source_record_type *src_az_module_source_record; externalref unsigned short int *uil_urm_variant; externalref unsigned short int *uil_arg_compr; externalref unsigned short int *uil_reas_compr; externalref unsigned short int *uil_widget_compr; externalref unsigned short int *uil_child_compr; /* * Defined in UilSrcSrc */ externalref src_source_buffer_type *src_az_current_source_buffer; externalref src_source_buffer_type *src_az_avail_source_buffer; externalref src_message_item_type *src_az_orphan_messages; externalref src_source_record_type *src_az_current_source_record; externalref src_source_record_type *src_az_first_source_record; externalref uil_fcb_type *src_az_source_file_table[]; externalref int src_l_last_source_file_number; /* %COMPLETE */ externalref long Uil_file_size; /* * Defined in UilSymStor */ externalref sym_name_entry_type *sym_az_hash_table[]; externalref sym_value_entry_type *sym_az_error_value_entry; externalref sym_external_def_entry_type *sym_az_external_def_chain; externalref sym_forward_ref_entry_type *sym_az_forward_ref_chain; externalref sym_val_forward_ref_entry_type *sym_az_val_forward_ref_chain; externalref sym_module_entry_type *sym_az_module_entry; externalref sym_root_entry_type *sym_az_root_entry; externalref sym_section_entry_type *sym_az_current_section_entry; externalref sym_entry_type *sym_az_entry_list_header; externalref URMPointerListPtr sym_az_allocated_nodes; externalref URMPointerListPtr sym_az_freed_nodes; #endif /* UilCompGl_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilLexAna.c0000644000175000017500000024517213145162623014021 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilLexAna.c /main/14 1997/03/12 15:10:52 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module hold the routines that build tokens for the UIL ** compiler. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include /* I think this one should be public too, it's not the case right now, and I don't want to include XmP.h here - dd */ extern char *_XmStringGetCurrentCharset (); #include /* Need this for MB_CUR_MAX */ #include /* Need this for _MrmOSSetLocale. */ #include "UilDefI.h" #include #ifndef X_NOT_STDC_ENV #include #else double atof(); #endif #include /* needed to support conversion functions */ #ifdef X_NOT_STDC_ENV extern int errno; #endif /* ** ** TABLE OF CONTENTS ** */ /* ** FORWARD DECLARATIONS */ typedef struct _lex_buffer_type { struct _lex_buffer_type *az_next_buffer; unsigned char c_text[ 1 ]; } lex_buffer_type; static lex_buffer_type *get_lex_buffer _ARGUMENTS(( lex_buffer_type *az_current_lex_buffer )); #if debug_version static void dump_token _ARGUMENTS(( lex_buffer_type *az_current_lex_buffer , int l_lex_pos )); #endif /* ** ** EXTERNAL DEFINITIONS ** */ /* These values are set by Lex initiailize routine or if the charset */ /* option is specified on the module declaration */ externaldef(uil_comp_glbl) int Uil_lex_l_user_default_charset; externaldef(uil_comp_glbl) sym_value_entry_type *Uil_lex_az_charset_entry; externaldef(uil_comp_glbl) int Uil_lex_l_localized; /* This is the most recent character set recognized by the grammar. It */ /* allows the use of the CHARACTER_SET function to prefix general string */ /* literals. */ externaldef(uil_comp_glbl) int Uil_lex_l_charset_specified; externaldef(uil_comp_glbl) int Uil_lex_l_literal_charset; externaldef(uil_comp_glbl) sym_value_entry_type *Uil_lex_az_literal_charset; /* %COMPLETE */ externaldef(uil_comp_glbl) int Uil_characters_read; /* For portability, declare all yy* variables as extern. */ extern yystype yylval; extern yystype prev_yylval; /* This stack entry is used as the result of epsilon productions. */ extern yystype gz_yynullval; /* * Retain comments as scanned */ #define INITIAL_COMMENT_SIZE 8000 #define INCR_COMMENT_SIZE 2000 externaldef(uil_comp_glbl) char *comment_text; externaldef(uil_comp_glbl) int comment_size; static int last_token_seen = 0; /* ** ** MACRO DEFINITIONS ** **/ /* ** Each of the 256 possible input characters has an associated class. ** These defines gives names to the classes. */ #define class_blank 0 /* white space */ #define class_punc 1 /* punctuation characters */ #define class_name 2 /* alphabetics - {eEntvbrf} + {$ _} */ #define class_e 3 /* e */ #define class_escape 4 /* n t v b r f */ #define class_ff 5 /* form feed */ #define class_digit 6 /* 0..9 */ #define class_dot 7 /* . */ #define class_sign 8 /* - + */ #define class_quote 9 /* ' */ #define class_bslash 10 /* \ */ #define class_slash 11 /* / */ #define class_star 12 /* * */ #define class_exclam 13 /* ! */ #define class_eol 14 /* end of line - ascii nul */ #define class_rest 15 /* remaining printable characters */ #define class_illegal 16 /* remaining non printable characters */ #define class_pound 17 /* # */ #define class_dquote 18 /* " */ #define class_langle 19 /* < */ #define class_rangle 20 /* > */ #define class_highbit 21 /* high order bit set */ #define max_class 21 /* ** states within the token table */ #define state_initial 0 /* initial state of automaton */ #define state_name 1 /* looking for a name */ #define state_integer 2 /* looking for a integer */ #define state_real_1 3 /* looking for a real */ #define state_real_2 4 /* looking for a real */ #define state_exp_1 5 /* looking for a real with exponent */ #define state_exp_2 6 /* looking for a real with exponent */ #define state_exp_3 7 /* looking for a real with exponent */ #define state_str_1 8 /* looking for a string */ #define state_str_2 9 /* looking for a string */ #define state_str_3 10 /* looking for a string */ #define state_comment_1 11 /* looking for a comment */ #define state_comment_2 12 /* looking for a comment */ #define state_comment_3 13 /* looking for a comment */ #define state_comment_4 14 /* looking for a comment */ #define state_eat_rest 15 /* eat up rest characters */ #define state_gstr_1 16 /* looking for a general string */ #define state_gstr_2 17 /* looking for a general string */ #define state_gstr_3 18 /* looking for a general string */ #define state_gstr_4 19 /* looking for a general string */ #define state_gstr_5 20 /* looking for a general string */ #define state_langle 21 /* looking for << */ #define state_rangle 22 /* looking for >> */ #define max_state 22 /* ** actions in token table ** all actions requiring a move of the current character have ** a negative value */ #define NEGATIVE 0x40 #define min_action 1 #define move_advance (NEGATIVE | 1) /* save character - goto next state */ #define advance 1 /* goto next state */ #define move_final (NEGATIVE | 2) /* save character - found token */ #define final 2 /* found token */ #define move_error (NEGATIVE | 3) /* save character - found error */ #define error 3 /* found error */ #define move_special (NEGATIVE | 4) /* special action */ #define special 4 /* save character - special action */ #define reset 5 /* reset the analyzer */ #define final_comment (NEGATIVE | 6) /* save whole comment RAP */ /* ** errors encoded in the token table */ #define min_error 0 #define bad_prefix 0 /* junk starts a token */ #define error_max 0 /* ** final states in the token table */ #define token_min 1 #define token_punc 1 /* punctuation character */ #define token_eol 2 /* end of line */ #define token_real 3 /* real number */ #define token_integer 4 /* integer */ #define token_name 5 /* identifier */ #define token_ustring 6 /* unterminated string */ #define token_string 7 /* string */ #define token_ff 8 /* form feed */ #define token_ugstr 9 /* unterminated general string */ #define token_gstr 10 /* general string */ #define token_punc2 11 /* 2 character punctuation */ #define token_comment 12 /* comment block RAP */ #define token_lstr 13 /* localized general string */ #define token_max 13 /* ** special actions that take place */ #define control_char 1 /* unprintable character in construct */ #define start_bslash 2 /* start of \ construct in string */ #define ignore_bslash 3 /* \ not followed by correct sequence */ #define found_digit 4 /* digit in \ sequence */ #define end_digits 5 /* end of \digit...\ sequence */ #define insert_char 6 /* end of \x sequence */ #define missing_bslash 7 /* \ at end of \digit...\ missing */ #define string_wrap 8 /* string wraps to next line */ #define comment_wrap 9 /* comment wraps to next line */ #define charset_gstr 10 /* found char set for general string */ #define nocharset_gstr 11 /* default char set for general string */ #define highbit_char 12 /* default char set for general string */ /* ** define backup field values of a token table cell */ #define not_used 0 /* value not defined for this action */ #define backup_0 0 /* no backup required */ #define backup_1 1 /* 1 character backup needed */ #define backup_2 2 /* 2 character backup needed */ #define backup_3 3 /* 3 character backup needed */ /* ** form of each cell in the token table */ typedef struct { char action; /* action to be taken */ char next_state; /* next state */ /* terminal found */ /* error found */ char backup; /* number of character to backup */ /* action for special cases */ char unused; } cell; /* ** ** OWN Storage for TOKEN BUILDER ** */ #define l_max_lex_buffer_pos 127 static lex_buffer_type *az_first_lex_buffer; /* ** the actual token table */ static cell XmConst token_table[ max_state+1][ max_class+1] = { { /* state_initial */ /* class_blank */ { reset, state_initial, not_used }, /* class_punc */ { move_final, token_punc, backup_0 }, /* class_name */ { move_advance, state_name, not_used }, /* class_e */ { move_advance, state_name, not_used }, /* class_escape */ { move_advance, state_name, not_used }, /* class_ff */ { final, token_ff, backup_0 }, /* class_digit */ { move_advance, state_integer, not_used }, /* class_dot */ { move_advance, state_real_1, not_used }, /* class_sign */ { move_final, token_punc, backup_0 }, /* class_quote */ { advance, state_str_1, not_used }, /* class_bslash */ { move_advance, state_eat_rest, not_used }, /* class_slash */ { move_advance, state_comment_1, not_used }, /* class_star */ { move_final, token_punc, backup_0 }, /* class_exclam */ { move_advance, state_comment_4, not_used }, /* class_eol */ { final, token_eol, backup_0 }, /* class_rest */ { move_advance, state_eat_rest, not_used }, /* class_illegal */ { special, state_initial, control_char }, /* class_pound */ { move_final, token_punc, backup_0 }, /* class_dquote */ { special, state_gstr_3, nocharset_gstr }, /* class_langle */ { move_advance, state_langle, not_used }, /* class_rangle */ { move_advance, state_rangle, not_used }, /* class_highbit */ { move_advance, state_eat_rest, not_used }, }, { /* state_name */ /* class_blank */ { final, token_name, backup_0 }, /* class_punc */ { move_final, token_name, backup_1 }, /* class_name */ { move_advance, state_name, not_used }, /* class_e */ { move_advance, state_name, not_used }, /* class_escape */ { move_advance, state_name, not_used }, /* class_ff */ { move_final, token_name, backup_1 }, /* class_digit */ { move_advance, state_name, not_used }, /* class_dot */ { move_final, token_name, backup_1 }, /* class_sign */ { move_final, token_name, backup_1 }, /* class_quote */ { move_final, token_name, backup_1 }, /* class_bslash */ { move_final, token_name, backup_1 }, /* class_slash */ { move_final, token_name, backup_1 }, /* class_star */ { move_final, token_name, backup_1 }, /* class_exclam */ { move_final, token_name, backup_1 }, /* class_eol */ { move_final, token_name, backup_1 }, /* class_rest */ { move_final, token_name, backup_1 }, /* class_illegal */ { move_final, token_name, backup_1 }, /* class_pound */ { move_final, token_name, backup_1 }, /* class_dquote */ { move_final, token_name, backup_1 }, /* class_langle */ { move_final, token_name, backup_1 }, /* class_rangle */ { move_final, token_name, backup_1 }, /* class_highbit */ { move_final, token_name, backup_1 }, }, { /* state_integer */ /* class_blank */ { final, token_integer, backup_0 }, /* class_punc */ { move_final, token_integer, backup_1 }, /* class_name */ { move_final, token_integer, backup_1 }, /* class_e */ { move_final, token_integer, backup_1 }, /* class_escape */ { move_final, token_integer, backup_1 }, /* class_ff */ { move_final, token_integer, backup_1 }, /* class_digit */ { move_advance, state_integer, not_used }, /* class_dot */ { move_advance, state_real_2, not_used }, /* class_sign */ { move_final, token_integer, backup_1 }, /* class_quote */ { move_final, token_integer, backup_1 }, /* class_bslash */ { move_final, token_integer, backup_1 }, /* class_slash */ { move_final, token_integer, backup_1 }, /* class_star */ { move_final, token_integer, backup_1 }, /* class_exclam */ { move_final, token_integer, backup_1 }, /* class_eol */ { move_final, token_integer, backup_1 }, /* class_rest */ { move_final, token_integer, backup_1 }, /* class_illegal */ { move_final, token_integer, backup_1 }, /* class_pound */ { move_final, token_integer, backup_1 }, /* class_dquote */ { move_final, token_integer, backup_1 }, /* class_langle */ { move_final, token_integer, backup_1 }, /* class_rangle */ { move_final, token_integer, backup_1 }, /* class_highbit */ { move_final, token_integer, backup_1 }, }, { /* state_real_1 */ /* class_blank */ { move_advance, state_eat_rest, not_used }, /* class_punc */ { move_error, bad_prefix, backup_1 }, /* class_name */ { move_error, bad_prefix, backup_1 }, /* class_e */ { move_error, bad_prefix, backup_1 }, /* class_escape */ { move_error, bad_prefix, backup_1 }, /* class_ff */ { special, state_real_1, control_char }, /* class_digit */ { move_advance, state_real_2, not_used }, /* class_dot */ { move_error, bad_prefix, backup_1 }, /* class_sign */ { move_error, bad_prefix, backup_1 }, /* class_quote */ { move_error, bad_prefix, backup_1 }, /* class_bslash */ { move_error, bad_prefix, backup_1 }, /* class_slash */ { move_error, bad_prefix, backup_1 }, /* class_star */ { move_error, bad_prefix, backup_1 }, /* class_exclam */ { move_error, bad_prefix, backup_1 }, /* class_eol */ { move_error, bad_prefix, backup_1 }, /* class_rest */ { move_advance, state_eat_rest, not_used }, /* class_illegal */ { special, state_real_1, control_char }, /* class_pound */ { move_error, bad_prefix, backup_1 }, /* class_dquote */ { move_error, bad_prefix, backup_1 }, /* class_langle */ { move_error, bad_prefix, backup_1 }, /* class_rangle */ { move_error, bad_prefix, backup_1 }, /* class_highbit */ { move_advance, state_eat_rest, not_used }, }, { /* state_real_2 */ /* class_blank */ { final, token_real, backup_0 }, /* class_punc */ { move_final, token_real, backup_1 }, /* class_name */ { move_final, token_real, backup_1 }, /* class_e */ { move_advance, state_exp_1, not_used }, /* class_escape */ { move_final, token_real, backup_1 }, /* class_ff */ { move_final, token_real, backup_1 }, /* class_digit */ { move_advance, state_real_2, not_used }, /* class_dot */ { move_final, token_real, backup_1 }, /* class_sign */ { move_final, token_real, backup_1 }, /* class_quote */ { move_final, token_real, backup_1 }, /* class_bslash */ { move_final, token_real, backup_1 }, /* class_slash */ { move_final, token_real, backup_1 }, /* class_star */ { move_final, token_real, backup_1 }, /* class_exclam */ { move_final, token_real, backup_1 }, /* class_eol */ { move_final, token_real, backup_1 }, /* class_rest */ { move_final, token_real, backup_1 }, /* class_illegal */ { move_final, token_real, backup_1 }, /* class_pound */ { move_final, token_real, backup_1 }, /* class_dquote */ { move_final, token_real, backup_1 }, /* class_langle */ { move_final, token_real, backup_1 }, /* class_rangle */ { move_final, token_real, backup_1 }, /* class_highbit */ { move_final, token_real, backup_1 }, }, { /* state_exp_1 */ /* class_blank */ { move_final, token_real, backup_2 }, /* class_punc */ { move_final, token_real, backup_2 }, /* class_name */ { move_final, token_real, backup_2 }, /* class_e */ { move_final, token_real, backup_2 }, /* class_escape */ { move_final, token_real, backup_2 }, /* class_ff */ { move_final, token_real, backup_2 }, /* class_digit */ { move_advance, state_exp_3, not_used }, /* class_dot */ { move_final, token_real, backup_2 }, /* class_sign */ { move_advance, state_exp_2, not_used }, /* class_quote */ { move_final, token_real, backup_2 }, /* class_bslash */ { move_final, token_real, backup_2 }, /* class_slash */ { move_final, token_real, backup_2 }, /* class_star */ { move_final, token_real, backup_2 }, /* class_exclam */ { move_final, token_real, backup_2 }, /* class_eol */ { move_final, token_real, backup_2 }, /* class_rest */ { move_final, token_real, backup_2 }, /* class_illegal */ { move_final, token_real, backup_2 }, /* class_pound */ { move_final, token_real, backup_2 }, /* class_dquote */ { move_final, token_real, backup_2 }, /* class_langle */ { move_final, token_real, backup_2 }, /* class_rangle */ { move_final, token_real, backup_2 }, /* class_highbit */ { move_final, token_real, backup_2 }, }, { /* state_exp_2 */ /* class_blank */ { move_final, token_real, backup_3 }, /* class_punc */ { move_final, token_real, backup_3 }, /* class_name */ { move_final, token_real, backup_3 }, /* class_e */ { move_final, token_real, backup_3 }, /* class_escape */ { move_final, token_real, backup_3 }, /* class_ff */ { move_final, token_real, backup_3 }, /* class_digit */ { move_advance, state_exp_3, not_used }, /* class_dot */ { move_final, token_real, backup_3 }, /* class_sign */ { move_final, token_real, backup_3 }, /* class_quote */ { move_final, token_real, backup_3 }, /* class_bslash */ { move_final, token_real, backup_3 }, /* class_slash */ { move_final, token_real, backup_3 }, /* class_star */ { move_final, token_real, backup_3 }, /* class_exclam */ { move_final, token_real, backup_3 }, /* class_eol */ { move_final, token_real, backup_3 }, /* class_rest */ { move_final, token_real, backup_3 }, /* class_illegal */ { move_final, token_real, backup_3 }, /* class_pound */ { move_final, token_real, backup_3 }, /* class_dquote */ { move_final, token_real, backup_3 }, /* class_langle */ { move_final, token_real, backup_3 }, /* class_rangle */ { move_final, token_real, backup_3 }, /* class_highbit */ { move_final, token_real, backup_3 }, }, { /* state_exp_3 */ /* class_blank */ { final, token_real, backup_0 }, /* class_punc */ { move_final, token_real, backup_1 }, /* class_name */ { move_final, token_real, backup_1 }, /* class_e */ { move_final, token_real, backup_1 }, /* class_escape */ { move_final, token_real, backup_1 }, /* class_ff */ { move_final, token_real, backup_1 }, /* class_digit */ { move_advance, state_exp_3, not_used }, /* class_dot */ { move_final, token_real, backup_1 }, /* class_sign */ { move_final, token_real, backup_1 }, /* class_quote */ { move_final, token_real, backup_1 }, /* class_bslash */ { move_final, token_real, backup_1 }, /* class_slash */ { move_final, token_real, backup_1 }, /* class_star */ { move_final, token_real, backup_1 }, /* class_exclam */ { move_final, token_real, backup_1 }, /* class_eol */ { move_final, token_real, backup_1 }, /* class_rest */ { move_final, token_real, backup_1 }, /* class_illegal */ { move_final, token_real, backup_1 }, /* class_pound */ { move_final, token_real, backup_1 }, /* class_dquote */ { move_final, token_real, backup_1 }, /* class_langle */ { move_final, token_real, backup_1 }, /* class_rangle */ { move_final, token_real, backup_1 }, /* class_highbit */ { move_final, token_real, backup_1 }, }, { /* state_str_1 */ /* class_blank */ { move_advance, state_str_1, not_used }, /* class_punc */ { move_advance, state_str_1, not_used }, /* class_name */ { move_advance, state_str_1, not_used }, /* class_e */ { move_advance, state_str_1, not_used }, /* class_escape */ { move_advance, state_str_1, not_used }, /* class_ff */ { special, state_str_1, control_char }, /* class_digit */ { move_advance, state_str_1, not_used }, /* class_dot */ { move_advance, state_str_1, not_used }, /* class_sign */ { move_advance, state_str_1, not_used }, /* class_quote */ { final, token_string, backup_0 }, /* class_bslash */ { special, state_str_2, start_bslash }, /* class_slash */ { move_advance, state_str_1, not_used }, /* class_star */ { move_advance, state_str_1, not_used }, /* class_exclam */ { move_advance, state_str_1, not_used }, /* class_eol */ { move_final, token_ustring, backup_1 }, /* class_rest */ { move_advance, state_str_1, not_used }, /* class_illegal */ { special, state_str_1, control_char }, /* class_pound */ { move_advance, state_str_1, not_used }, /* class_dquote */ { move_advance, state_str_1, not_used }, /* class_langle */ { move_advance, state_str_1, not_used }, /* class_rangle */ { move_advance, state_str_1, not_used }, /* class_highbit */ { move_advance, state_str_1, not_used }, }, { /* state_str_2 */ /* class_blank */ { move_special, state_str_1, ignore_bslash }, /* class_punc */ { move_special, state_str_1, ignore_bslash }, /* class_name */ { move_special, state_str_1, ignore_bslash }, /* class_e */ { move_special, state_str_1, ignore_bslash }, /* class_escape */ { special, state_str_1, insert_char }, /* class_ff */ { special, state_str_1, control_char }, /* class_digit */ { special, state_str_3, found_digit }, /* class_dot */ { move_special, state_str_1, ignore_bslash }, /* class_sign */ { move_special, state_str_1, ignore_bslash }, /* class_quote */ { special, state_str_1, insert_char }, /* class_bslash */ { special, state_str_1, insert_char }, /* class_slash */ { move_special, state_str_1, ignore_bslash }, /* class_star */ { move_special, state_str_1, ignore_bslash }, /* class_exclam */ { move_special, state_str_1, ignore_bslash }, /* class_eol */ { special, state_str_1, string_wrap }, /* class_rest */ { move_special, state_str_1, ignore_bslash }, /* class_illegal */ { special, state_str_1, control_char }, /* class_pound */ { move_special, state_str_1, ignore_bslash }, /* class_dquote */ { special, state_str_1, insert_char }, /* class_langle */ { move_special, state_str_1, ignore_bslash }, /* class_rangle */ { move_special, state_str_1, ignore_bslash }, /* class_highbit */ { move_special, state_str_1, ignore_bslash }, }, { /* state_str_3 */ /* class_blank */ { move_special, state_str_1, missing_bslash }, /* class_punc */ { move_special, state_str_1, missing_bslash }, /* class_name */ { move_special, state_str_1, missing_bslash }, /* class_e */ { move_special, state_str_1, missing_bslash }, /* class_escape */ { move_special, state_str_1, missing_bslash }, /* class_ff */ { special, state_str_1, control_char }, /* class_digit */ { special, state_str_3, found_digit }, /* class_dot */ { move_special, state_str_1, missing_bslash }, /* class_sign */ { move_special, state_str_1, missing_bslash }, /* class_quote */ { move_special, state_str_1, missing_bslash }, /* class_bslash */ { special, state_str_1, end_digits }, /* class_slash */ { move_special, state_str_1, missing_bslash }, /* class_star */ { move_special, state_str_1, missing_bslash }, /* class_exclam */ { move_special, state_str_1, missing_bslash }, /* class_eol */ { move_final, token_ustring, backup_1 }, /* class_rest */ { move_special, state_str_1, missing_bslash }, /* class_illegal */ { special, state_str_3, control_char }, /* class_pound */ { move_special, state_str_1, missing_bslash }, /* class_dquote */ { move_special, state_str_1, missing_bslash }, /* class_langle */ { move_special, state_str_1, missing_bslash }, /* class_rangle */ { move_special, state_str_1, missing_bslash }, /* class_highbit */ { move_special, state_str_1, missing_bslash }, }, { /* state_comment_1 */ /* class_blank */ { move_final, token_punc, backup_0 }, /* class_punc */ { move_final, token_punc, backup_1 }, /* class_name */ { move_final, token_punc, backup_1 }, /* class_e */ { move_final, token_punc, backup_1 }, /* class_escape */ { move_final, token_punc, backup_1 }, /* class_ff */ { special, state_comment_1,control_char }, /* class_digit */ { move_final, token_punc, backup_1 }, /* class_dot */ { move_final, token_punc, backup_1 }, /* class_sign */ { move_final, token_punc, backup_1 }, /* class_quote */ { move_final, token_punc, backup_1 }, /* class_bslash */ { move_final, token_punc, backup_1 }, /* class_slash */ { move_final, token_punc, backup_1 }, /* class_star */ { move_advance, state_comment_2, not_used }, /* class_exclam */ { move_final, token_punc, backup_1 }, /* class_eol */ { move_final, token_punc, backup_1 }, /* class_rest */ { move_final, token_punc, backup_1 }, /* class_illegal */ { special, state_comment_1,control_char }, /* class_pound */ { move_final, token_punc, backup_1 }, /* class_dquote */ { move_final, token_punc, backup_1 }, /* class_langle */ { move_final, token_punc, backup_1 }, /* class_rangle */ { move_final, token_punc, backup_1 }, /* class_highbit */ { move_final, token_punc, backup_1 }, }, { /* state_comment_2 */ /* class_blank */ { move_advance, state_comment_2, not_used }, /* class_punc */ { move_advance, state_comment_2, not_used }, /* class_name */ { move_advance, state_comment_2, not_used }, /* class_e */ { move_advance, state_comment_2, not_used }, /* class_escape */ { move_advance, state_comment_2, not_used }, /* class_ff */ { move_special, state_comment_2,control_char }, /* class_digit */ { move_advance, state_comment_2, not_used }, /* class_dot */ { move_advance, state_comment_2, not_used }, /* class_sign */ { move_advance, state_comment_2, not_used }, /* class_quote */ { move_advance, state_comment_2, not_used }, /* class_bslash */ { move_advance, state_comment_2, not_used }, /* class_slash */ { move_advance, state_comment_2, not_used }, /* class_star */ { move_advance, state_comment_3, not_used }, /* class_exclam */ { move_advance, state_comment_2, not_used }, /* class_eol */ { move_special, state_comment_2,comment_wrap }, /* class_rest */ { move_advance, state_comment_2, not_used }, /* class_illegal */ { move_special, state_comment_2,control_char }, /* class_pound */ { move_advance, state_comment_2, not_used }, /* class_dquote */ { move_advance, state_comment_2, not_used }, /* class_langle */ { move_advance, state_comment_2, not_used }, /* class_rangle */ { move_advance, state_comment_2, not_used }, /* class_highbit */ { move_advance, state_comment_2, not_used }, }, { /* state_comment_3 */ /* class_blank */ { move_advance, state_comment_2, not_used }, /* class_punc */ { move_advance, state_comment_2, not_used }, /* class_name */ { move_advance, state_comment_2, not_used }, /* class_e */ { move_advance, state_comment_2, not_used }, /* class_escape */ { move_advance, state_comment_2, not_used }, /* class_ff */ { move_special, state_comment_2,control_char }, /* class_digit */ { move_advance, state_comment_2, not_used }, /* class_dot */ { move_advance, state_comment_2, not_used }, /* class_sign */ { move_advance, state_comment_2, not_used }, /* class_quote */ { move_advance, state_comment_2, not_used }, /* class_bslash */ { move_advance, state_comment_2, not_used }, /* class_slash */ { final_comment, token_comment, not_used }, /* class_star */ { move_advance, state_comment_3, not_used }, /* class_exclam */ { move_advance, state_comment_2, not_used }, /* class_eol */ { move_special, state_comment_2,comment_wrap }, /* class_rest */ { move_advance, state_comment_2, not_used }, /* class_illegal */ { move_special, state_comment_2,control_char }, /* class_pound */ { move_advance, state_comment_2, not_used }, /* class_dquote */ { move_advance, state_comment_2, not_used }, /* class_langle */ { move_advance, state_comment_2, not_used }, /* class_rangle */ { move_advance, state_comment_2, not_used }, /* class_highbit */ { move_advance, state_comment_2, not_used }, }, { /* state_comment_4 */ /* class_blank */ { move_advance, state_comment_4, not_used }, /* class_punc */ { move_advance, state_comment_4, not_used }, /* class_name */ { move_advance, state_comment_4, not_used }, /* class_e */ { move_advance, state_comment_4, not_used }, /* class_escape */ { move_advance, state_comment_4, not_used }, /* class_ff */ { move_special, state_comment_4,control_char }, /* class_digit */ { move_advance, state_comment_4, not_used }, /* class_dot */ { move_advance, state_comment_4, not_used }, /* class_sign */ { move_advance, state_comment_4, not_used }, /* class_quote */ { move_advance, state_comment_4, not_used }, /* class_bslash */ { move_advance, state_comment_4, not_used }, /* class_slash */ { move_advance, state_comment_4, not_used }, /* class_star */ { move_advance, state_comment_4, not_used }, /* class_exclam */ { move_advance, state_comment_4, not_used }, /* class_eol */ { final_comment, token_comment, backup_1 }, /* class_rest */ { move_advance, state_comment_4, not_used }, /* class_illegal */ { move_special, state_comment_4,control_char }, /* class_pound */ { move_advance, state_comment_4, not_used }, /* class_dquote */ { move_advance, state_comment_4, not_used }, /* class_langle */ { move_advance, state_comment_4, not_used }, /* class_rangle */ { move_advance, state_comment_4, not_used }, /* class_highbit */ { move_advance, state_comment_4, not_used }, }, { /* state_eat_rest */ /* class_blank */ { move_advance, state_eat_rest, not_used }, /* class_punc */ { move_error, bad_prefix, backup_1 }, /* class_name */ { move_error, bad_prefix, backup_1 }, /* class_e */ { move_error, bad_prefix, backup_1 }, /* class_escape */ { move_error, bad_prefix, backup_1 }, /* class_ff */ { special, state_eat_rest, control_char }, /* class_digit */ { move_error, bad_prefix, backup_1 }, /* class_dot */ { move_error, bad_prefix, backup_1 }, /* class_sign */ { move_error, bad_prefix, backup_1 }, /* class_quote */ { move_error, bad_prefix, backup_1 }, /* class_bslash */ { move_advance, state_eat_rest, not_used }, /* class_slash */ { move_error, bad_prefix, backup_1 }, /* class_star */ { move_advance, state_eat_rest, not_used }, /* class_exclam */ { move_error, bad_prefix, backup_1 }, /* class_eol */ { move_error, bad_prefix, backup_1 }, /* class_rest */ { move_advance, state_eat_rest, not_used }, /* class_illegal */ { special, state_eat_rest, control_char }, /* class_pound */ { move_error, bad_prefix, backup_1 }, /* class_dquote */ { move_error, bad_prefix, backup_1 }, /* class_langle */ { move_error, bad_prefix, backup_1 }, /* class_rangle */ { move_error, bad_prefix, backup_1 }, /* class_highbit */ { move_advance, state_eat_rest, not_used }, }, { /* state_gstr_1 */ /* class_blank */ { move_error, bad_prefix, backup_1 }, /* class_punc */ { move_error, bad_prefix, backup_1 }, /* class_name */ { move_advance, state_gstr_2, not_used }, /* class_e */ { move_advance, state_gstr_2, not_used }, /* class_escape */ { move_advance, state_gstr_2, not_used }, /* class_ff */ { special, state_gstr_1, control_char }, /* class_digit */ { move_error, bad_prefix, backup_1 }, /* class_dot */ { move_error, bad_prefix, backup_1 }, /* class_sign */ { move_error, bad_prefix, backup_1 }, /* class_quote */ { move_error, bad_prefix, backup_1 }, /* class_bslash */ { move_advance, state_eat_rest, not_used }, /* class_slash */ { move_error, bad_prefix, backup_1 }, /* class_star */ { move_advance, state_eat_rest, not_used }, /* class_exclam */ { move_error, bad_prefix, backup_1 }, /* class_eol */ { move_error, bad_prefix, backup_1 }, /* class_rest */ { move_advance, state_eat_rest, not_used }, /* class_illegal */ { special, state_eat_rest, control_char }, /* class_pound */ { move_error, bad_prefix, backup_1 }, /* class_dquote */ { move_error, bad_prefix, backup_1 }, /* class_langle */ { move_error, bad_prefix, backup_1 }, /* class_rangle */ { move_error, bad_prefix, backup_1 }, /* class_highbit */ { move_advance, state_eat_rest, not_used }, }, { /* state_gstr_2 */ /* class_blank */ { move_error, bad_prefix, backup_1 }, /* class_punc */ { move_error, bad_prefix, backup_1 }, /* class_name */ { move_advance, state_gstr_2, not_used }, /* class_e */ { move_advance, state_gstr_2, not_used }, /* class_escape */ { move_advance, state_gstr_2, not_used }, /* class_ff */ { special, state_gstr_2, control_char }, /* class_digit */ { move_advance, state_gstr_2, not_used }, /* class_dot */ { move_error, bad_prefix, backup_1 }, /* class_sign */ { move_error, bad_prefix, backup_1 }, /* class_quote */ { move_error, bad_prefix, backup_1 }, /* class_bslash */ { move_advance, state_eat_rest, not_used }, /* class_slash */ { move_error, bad_prefix, backup_1 }, /* class_star */ { move_advance, state_eat_rest, not_used }, /* class_exclam */ { move_error, bad_prefix, backup_1 }, /* class_eol */ { move_error, bad_prefix, backup_1 }, /* class_rest */ { move_advance, state_eat_rest, not_used }, /* class_illegal */ { special, state_eat_rest, control_char }, /* class_pound */ { move_error, bad_prefix, backup_1 }, /* class_dquote */ { special, state_gstr_3, charset_gstr }, /* class_langle */ { move_error, bad_prefix, backup_1 }, /* class_rangle */ { move_error, bad_prefix, backup_1 }, /* class_highbit */ { move_advance, state_eat_rest, not_used }, }, { /* state_gstr_3 */ /* class_blank */ { move_advance, state_gstr_3, not_used }, /* class_punc */ { move_advance, state_gstr_3, not_used }, /* class_name */ { move_advance, state_gstr_3, not_used }, /* class_e */ { move_advance, state_gstr_3, not_used }, /* class_escape */ { move_advance, state_gstr_3, not_used }, /* class_ff */ { special, state_gstr_3, control_char }, /* class_digit */ { move_advance, state_gstr_3, not_used }, /* class_dot */ { move_advance, state_gstr_3, not_used }, /* class_sign */ { move_advance, state_gstr_3, not_used }, /* class_quote */ { move_advance, state_gstr_3, not_used }, /* class_bslash */ { special, state_gstr_4, start_bslash }, /* class_slash */ { move_advance, state_gstr_3, not_used }, /* class_star */ { move_advance, state_gstr_3, not_used }, /* class_exclam */ { move_advance, state_gstr_3, not_used }, /* class_eol */ { move_final, token_ugstr, backup_1 }, /* class_rest */ { move_advance, state_gstr_3, not_used }, /* class_illegal */ { special, state_gstr_3, control_char }, /* class_pound */ { move_advance, state_gstr_3, not_used }, /* class_dquote */ { final, token_gstr, backup_0 }, /* class_langle */ { move_advance, state_gstr_3, not_used }, /* class_rangle */ { move_advance, state_gstr_3, not_used }, /* class_highbit */ { move_special, state_gstr_3, highbit_char }, }, { /* state_gstr_4 */ /* class_blank */ { move_special, state_gstr_3, ignore_bslash }, /* class_punc */ { move_special, state_gstr_3, ignore_bslash }, /* class_name */ { move_special, state_gstr_3, ignore_bslash }, /* class_e */ { move_special, state_gstr_3, ignore_bslash }, /* class_escape */ { special, state_gstr_3, insert_char }, /* class_ff */ { special, state_gstr_3, control_char }, /* class_digit */ { special, state_gstr_5, found_digit }, /* class_dot */ { move_special, state_gstr_3, ignore_bslash }, /* class_sign */ { move_special, state_gstr_3, ignore_bslash }, /* class_quote */ { special, state_gstr_3, insert_char }, /* class_bslash */ { special, state_gstr_3, insert_char }, /* class_slash */ { move_special, state_gstr_3, ignore_bslash }, /* class_star */ { move_special, state_gstr_3, ignore_bslash }, /* class_exclam */ { move_special, state_gstr_3, ignore_bslash }, /* class_eol */ { move_final, token_ugstr, backup_1 }, /* class_rest */ { move_special, state_gstr_3, ignore_bslash }, /* class_illegal */ { special, state_gstr_3, control_char }, /* class_pound */ { move_special, state_gstr_3, ignore_bslash }, /* class_dquote */ { special, state_gstr_3, insert_char }, /* class_langle */ { move_special, state_gstr_3, ignore_bslash }, /* class_rangle */ { move_special, state_gstr_3, ignore_bslash }, /* class_highbit */ { move_special, state_gstr_3, ignore_bslash }, }, { /* state_gstr_5 */ /* class_blank */ { move_special, state_gstr_3, missing_bslash }, /* class_punc */ { move_special, state_gstr_3, missing_bslash }, /* class_name */ { move_special, state_gstr_3, missing_bslash }, /* class_e */ { move_special, state_gstr_3, missing_bslash }, /* class_escape */ { move_special, state_gstr_3, missing_bslash }, /* class_ff */ { special, state_gstr_3, control_char }, /* class_digit */ { special, state_gstr_5, found_digit }, /* class_dot */ { move_special, state_gstr_3, missing_bslash }, /* class_sign */ { move_special, state_gstr_3, missing_bslash }, /* class_quote */ { move_special, state_gstr_3, missing_bslash }, /* class_bslash */ { special, state_gstr_3, end_digits }, /* class_slash */ { move_special, state_gstr_3, missing_bslash }, /* class_star */ { move_special, state_gstr_3, missing_bslash }, /* class_exclam */ { move_special, state_gstr_3, missing_bslash }, /* class_eol */ { move_final, token_ugstr, backup_1 }, /* class_rest */ { move_special, state_gstr_3, missing_bslash }, /* class_illegal */ { special, state_str_3, control_char }, /* class_pound */ { move_special, state_gstr_3, missing_bslash }, /* class_dquote */ { move_special, state_gstr_3, missing_bslash }, /* class_langle */ { move_special, state_gstr_3, missing_bslash }, /* class_rangle */ { move_special, state_gstr_3, missing_bslash }, /* class_highbit */ { move_special, state_gstr_3, missing_bslash }, }, { /* state_langle */ /* class_blank */ { move_error, bad_prefix, backup_1 }, /* class_punc */ { move_error, bad_prefix, backup_1 }, /* class_name */ { move_error, bad_prefix, backup_1 }, /* class_e */ { move_error, bad_prefix, backup_1 }, /* class_escape */ { move_error, bad_prefix, backup_1 }, /* class_ff */ { special, state_langle, control_char }, /* class_digit */ { move_error, bad_prefix, backup_1 }, /* class_dot */ { move_error, bad_prefix, backup_1 }, /* class_sign */ { move_error, bad_prefix, backup_1 }, /* class_quote */ { move_error, bad_prefix, backup_1 }, /* class_bslash */ { move_error, bad_prefix, backup_1 }, /* class_slash */ { move_error, bad_prefix, backup_1 }, /* class_star */ { move_error, bad_prefix, backup_1 }, /* class_exclam */ { move_error, bad_prefix, backup_1 }, /* class_eol */ { move_final, token_ugstr, backup_1 }, /* class_rest */ { move_advance, state_eat_rest, not_used }, /* class_illegal */ { special, state_langle, control_char }, /* class_pound */ { move_error, bad_prefix, backup_1 }, /* class_dquote */ { move_error, bad_prefix, backup_1 }, /* class_langle */ { move_final, token_punc2, backup_0 }, /* class_rangle */ { move_error, bad_prefix, backup_1 }, /* class_highbit */ { move_error, bad_prefix, backup_1 }, }, { /* state_rangle */ /* class_blank */ { move_error, bad_prefix, backup_1 }, /* class_punc */ { move_error, bad_prefix, backup_1 }, /* class_name */ { move_error, bad_prefix, backup_1 }, /* class_e */ { move_error, bad_prefix, backup_1 }, /* class_escape */ { move_error, bad_prefix, backup_1 }, /* class_ff */ { special, state_langle, control_char }, /* class_digit */ { move_error, bad_prefix, backup_1 }, /* class_dot */ { move_error, bad_prefix, backup_1 }, /* class_sign */ { move_error, bad_prefix, backup_1 }, /* class_quote */ { move_error, bad_prefix, backup_1 }, /* class_bslash */ { move_error, bad_prefix, backup_1 }, /* class_slash */ { move_error, bad_prefix, backup_1 }, /* class_star */ { move_error, bad_prefix, backup_1 }, /* class_exclam */ { move_error, bad_prefix, backup_1 }, /* class_eol */ { move_final, token_ugstr, backup_1 }, /* class_rest */ { move_advance, state_eat_rest, not_used }, /* class_illegal */ { special, state_langle, control_char }, /* class_pound */ { move_error, bad_prefix, backup_1 }, /* class_dquote */ { move_error, bad_prefix, backup_1 }, /* class_langle */ { move_error, bad_prefix, backup_1 }, /* class_rangle */ { move_final, token_punc2, backup_0 }, /* class_highbit */ { move_error, bad_prefix, backup_1 }, }, }; static char class_table[ 256 ] = { /* 00 */ class_eol, class_illegal, class_illegal, class_illegal, /* 04 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 08 */ class_illegal, class_blank, class_illegal, class_illegal, /* 0C */ class_ff, class_illegal, class_illegal, class_illegal, /* 10 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 14 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 18 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 1C */ class_illegal, class_illegal, class_illegal, class_illegal, /* 20 */ class_blank, class_exclam, class_dquote, class_pound, /* 24 */ class_name, class_rest, class_punc, class_quote, /* 28 */ class_punc, class_punc, class_star, class_sign, /* 2C */ class_punc, class_sign, class_dot, class_slash, /* 30 */ class_digit, class_digit, class_digit, class_digit, /* 34 */ class_digit, class_digit, class_digit, class_digit, /* 38 */ class_digit, class_digit, class_punc, class_punc, /* 3C */ class_langle, class_punc, class_rangle, class_rest, /* 40 */ class_rest, class_name, class_name, class_name, /* 44 */ class_name, class_e, class_name, class_name, /* 48 */ class_name, class_name, class_name, class_name, /* 4C */ class_name, class_name, class_name, class_name, /* 50 */ class_name, class_name, class_name, class_name, /* 54 */ class_name, class_name, class_name, class_name, /* 58 */ class_name, class_name, class_name, class_rest, /* 5C */ class_bslash, class_rest, class_punc, class_name, /* 60 */ class_rest, class_name, class_escape, class_name, /* 64 */ class_name, class_e, class_escape, class_name, /* 68 */ class_name, class_name, class_name, class_name, /* 6C */ class_name, class_name, class_escape, class_name, /* 70 */ class_name, class_name, class_escape, class_name, /* 74 */ class_escape, class_name, class_escape, class_name, /* 78 */ class_name, class_name, class_name, class_punc, /* 7C */ class_punc, class_punc, class_punc, class_illegal, /* 80 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 84 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 88 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 8C */ class_illegal, class_illegal, class_illegal, class_illegal, /* 90 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 94 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 98 */ class_illegal, class_illegal, class_illegal, class_illegal, /* 9C */ class_illegal, class_illegal, class_illegal, class_illegal, /* A0 */ class_highbit, class_highbit, class_highbit, class_highbit, /* A4 */ class_highbit, class_highbit, class_highbit, class_highbit, /* A8 */ class_highbit, class_highbit, class_highbit, class_highbit, /* AC */ class_highbit, class_highbit, class_highbit, class_highbit, /* B0 */ class_highbit, class_highbit, class_highbit, class_highbit, /* B4 */ class_highbit, class_highbit, class_highbit, class_highbit, /* B8 */ class_highbit, class_highbit, class_highbit, class_highbit, /* BC */ class_highbit, class_highbit, class_highbit, class_highbit, /* C0 */ class_highbit, class_highbit, class_highbit, class_highbit, /* C4 */ class_highbit, class_highbit, class_highbit, class_highbit, /* C8 */ class_highbit, class_highbit, class_highbit, class_highbit, /* CC */ class_highbit, class_highbit, class_highbit, class_highbit, /* D0 */ class_highbit, class_highbit, class_highbit, class_highbit, /* D4 */ class_highbit, class_highbit, class_highbit, class_highbit, /* D8 */ class_highbit, class_highbit, class_highbit, class_highbit, /* DC */ class_highbit, class_highbit, class_highbit, class_highbit, /* E0 */ class_highbit, class_highbit, class_highbit, class_highbit, /* E4 */ class_highbit, class_highbit, class_highbit, class_highbit, /* E8 */ class_highbit, class_highbit, class_highbit, class_highbit, /* EC */ class_highbit, class_highbit, class_highbit, class_highbit, /* F0 */ class_highbit, class_highbit, class_highbit, class_highbit, /* F4 */ class_highbit, class_highbit, class_highbit, class_highbit, /* F8 */ class_highbit, class_highbit, class_highbit, class_highbit, /* FC */ class_highbit, class_highbit, class_highbit, class_highbit }; /* Tables to correlate token numbers and ASCII values for punctuation characters. Used by yylex and lex_issue_error. */ #define tok_punc_token_num 17 static unsigned char punc_char[tok_punc_token_num] = { '{', '}', '=', ';', '(', ')', ':', '+', '-', ',', '&', '~', '*', '/', '^', '|', '#'}; static int punc_token[tok_punc_token_num] = { LEFT_BRACE, RIGHT_BRACE, EQUAL_SIGN, SEMICOLON, LEFT_PAREN, RIGHT_PAREN, COLON, PLUS, MINUS, COMMA, AND, NOT, MULTIPLY, DIVIDE, XOR, OR, POUND }; /* Tables to correlate token numbers and ASCII value pairs for punctuation characters. Used by yylex and lex_issue_error. */ static unsigned char punc2_char[2] = {'<', '>'}; static int punc2_token[2] = { LEFT_SHIFT, RIGHT_SHIFT }; /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function returns the next token to be built in the UIL source ** program being read by the compiler. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** ** ** IMPLICIT OUTPUTS: ** ** ** ** FUNCTION VALUE: ** ** number of the token generated ** ** SIDE EFFECTS: ** ** ** ** **-- **/ int yylex() { unsigned char c_char; /* current character */ int l_class; /* current character's class */ int l_state; /* current token_table state */ int l_lex_pos; /* next available position in c_lex_buffer*/ cell z_cell; /* local copy of current token_table state*/ int l_bslash_value = 0; /* current value of \digit...\ construct */ int l_start_src_pos; /* starting source position of a token */ int l_charset; /* character set for strings */ int l_write_direction; /* writing direction */ int l_parse_direction; /* parsing direction */ int l_charset_sixteen_bit = FALSE; /* true if charset is 16-bit */ sym_value_entry_type *az_charset_entry; /* value entry for the current charset */ int l_16bit_char_count = 0; /* for strings, count 16-bit chars */ int l_16bit_chars_only; /* True if the gstr we are */ /* processing only has 16-bit chars */ src_source_record_type *az_start_src_record;/* starting source record of a token */ lex_buffer_type *az_current_lex_buffer; /* current lexical buffer */ az_charset_entry = (sym_value_entry_type *) 0; /* ** Call the Status callback routine to report our progress. */ /* %COMPLETE (between 0-50) */ Uil_percent_complete = CEIL((int)( .5 * ((float)Uil_characters_read/(float)Uil_file_size))*100, 50); if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL) diag_report_status(); initialize_token_builder: /* initialize the lexical analyzer by * saving starting source position of the token * resetting the lexical buffer * putting the analyser in its initial state */ az_start_src_record = src_az_current_source_record; l_start_src_pos = src_az_current_source_buffer->w_current_position; az_current_lex_buffer = az_first_lex_buffer; l_lex_pos = 0; l_charset = lex_k_default_charset; l_16bit_chars_only = FALSE; l_state = state_initial; /* start looking for the token */ continue_in_next_state: for (;;) { /* get next input char */ /* advance source too */ c_char = src_az_current_source_buffer->c_text [ src_az_current_source_buffer->w_current_position++ ]; /* %COMPLETE */ Uil_characters_read++; l_class = class_table[ c_char ]; /* determine its class */ z_cell = token_table[ l_state][l_class ]; /* load state cell */ /* pick up the next state, or terminal, or error */ l_state = z_cell.next_state; /* l_state is negative for action states requiring the current * character be saved in the current lexical buffer */ if (z_cell.action & NEGATIVE) { if (l_lex_pos > l_max_lex_buffer_pos ) { az_current_lex_buffer = get_lex_buffer( az_current_lex_buffer ); l_lex_pos = 0; } az_current_lex_buffer->c_text[ l_lex_pos ] = c_char; l_lex_pos++; } /* next step is based on action */ switch (z_cell.action) { case move_advance: case advance: if (l_16bit_chars_only) goto found_16bit_char; continue; case reset: goto initialize_token_builder; case move_final: case final: case final_comment: /* RAP retain comments */ goto found_token; case move_error: case error: goto found_error; case move_special: case special: goto special_processing; default: _assert( FALSE, "unknown token_table action" ); } } /* process special actions */ special_processing: switch (z_cell.backup) /* backup holds special processing code */ { case control_char: /* encountered a control char in a string or * comment - issue a diagnotic and continue */ issue_control_char_diagnostic( c_char ); break; case start_bslash: /* start of a \ construct in a string */ l_bslash_value = 0; /* initialize collection cell */ break; case found_digit: /* next digit in a \digit...\ sequence */ if (l_bslash_value < 256 ) /* if still in range add in next digit */ l_bslash_value = l_bslash_value * 10 + ( c_char - 48 ); break; case end_digits: /* end of \digit...\ sequence */ if (l_bslash_value >= 256 ) /* issue a diagnostic */ { diag_issue_diagnostic ( d_out_range, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, "\\digit...\\ sequence", "0-255" ); l_bslash_value = lex_k_unprint_sub; } if (l_bslash_value == 0 ) /* issue a diagnostic */ { diag_issue_diagnostic ( d_null, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1 ); } if (l_lex_pos > l_max_lex_buffer_pos ) { az_current_lex_buffer = get_lex_buffer( az_current_lex_buffer ); l_lex_pos = 0; } az_current_lex_buffer->c_text[ l_lex_pos++ ] = l_bslash_value; break; case insert_char: /* place special character in lex buffer */ { static unsigned char c_bslash_char[10] = { '\\', '\'', 'n', 't', 'v', 'b', 'r', 'f', '"'}; static unsigned char ab_bslash_value[9] = { 0x5C, 0x27, 0x0A, 0x09, 0x0B, 0x08, 0x0D, 0x0C, 0x22 }; if (l_lex_pos > l_max_lex_buffer_pos ) { az_current_lex_buffer = get_lex_buffer( az_current_lex_buffer ); l_lex_pos = 0; } az_current_lex_buffer->c_text[ l_lex_pos++ ] = ab_bslash_value [ _index( c_char, c_bslash_char, sizeof( c_bslash_char )-1 )]; break; } case missing_bslash: /* \digit...\ sequence not terminated */ diag_issue_diagnostic ( d_unterm_seq, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, "\\digit...\\ sequence", "with \\" ); break; case ignore_bslash: /* \ not followed by valid character */ diag_issue_diagnostic ( d_backslash_ignored, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, c_char ); break; case string_wrap: if (src_get_source_line( ) == src_k_end_source) { diag_issue_diagnostic ( d_unterm_seq, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, "character string", "before end of source" ); src_az_current_source_buffer->w_current_position--; } break; case comment_wrap: if (src_get_source_line( ) == src_k_end_source) { diag_issue_diagnostic ( d_unterm_seq, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, "comment", "before end of source" ); src_az_current_source_buffer->w_current_position--; return UILEOF; } az_current_lex_buffer-> c_text[strlen((char *)az_current_lex_buffer->c_text)] = '\n'; break; case highbit_char: /* check if must accept extra chars */ found_16bit_char: { unsigned char next_char; /* ** If the current character set allows 16-bit characters, then ** process them specially. */ if ( l_charset_sixteen_bit ) { /* need to: ** 1) get next input char and advance the source ** 2) check that the next is not a control character ** 3) place the next character in the lex buffer */ next_char = src_az_current_source_buffer->c_text [ src_az_current_source_buffer->w_current_position++ ]; switch (class_table[ next_char ]) { case class_eol: src_az_current_source_buffer->w_current_position--; case class_illegal: issue_control_char_diagnostic( next_char ); break; default: break; } if (l_lex_pos > l_max_lex_buffer_pos ) { az_current_lex_buffer = get_lex_buffer( az_current_lex_buffer ); l_lex_pos = 0; } az_current_lex_buffer->c_text[ l_lex_pos++ ] = next_char; l_16bit_char_count ++; } break; } case charset_gstr: /* set l_charset with the char set */ { _assert( FALSE, "Should never get to charset_gstr" ); break; } case nocharset_gstr: if (Uil_lex_l_charset_specified) { /* use the specified charset*/ l_charset = Uil_lex_l_literal_charset; az_charset_entry = Uil_lex_az_literal_charset; } else if (Uil_lex_l_localized) goto found_localized_string; else { /* No charset specified, use the default */ l_charset = Uil_lex_l_user_default_charset; az_charset_entry = Uil_lex_az_charset_entry; } /* Get the charset information */ sem_charset_info (l_charset, az_charset_entry, &l_write_direction, &l_parse_direction, &l_charset_sixteen_bit); /* reset 16 bit character count to 0 */ l_16bit_char_count = 0; /* ** if this is a user-defined, 16-bit charset then treat all ** as 16-bit. */ if ((l_charset_sixteen_bit) && (l_charset == lex_k_userdefined_charset)) l_16bit_chars_only = TRUE; break; default: _assert( FALSE, "unknown token_table special action" ); } /* Next state of the token builder is should already be in l_state. * Continue at this point */ goto continue_in_next_state; found_localized_string: { /* Local variables */ int mb_len, i; unsigned char mb_byte; /* Should be looking at the first byte of the string. */ /* Localize... */ _MrmOSSetLocale(""); /* Parse the string. */ while (TRUE) { mb_len = mblen((char *)&src_az_current_source_buffer->c_text [src_az_current_source_buffer->w_current_position], MB_CUR_MAX); mb_byte = src_az_current_source_buffer->c_text [src_az_current_source_buffer->w_current_position]; if (mb_len == 1) switch (class_table[mb_byte]) { case class_eol: z_cell.backup = backup_0; l_state = token_ugstr; if (l_lex_pos > l_max_lex_buffer_pos ) { az_current_lex_buffer = get_lex_buffer( az_current_lex_buffer ); l_lex_pos = 0; } az_current_lex_buffer->c_text[ l_lex_pos++ ] = mb_byte; _MrmOSSetLocale("C"); goto found_token; case class_dquote: z_cell.backup = backup_0; l_state = token_lstr; src_az_current_source_buffer->w_current_position++; _MrmOSSetLocale("C"); goto found_token; default: break; } if (l_lex_pos > l_max_lex_buffer_pos ) { az_current_lex_buffer = get_lex_buffer( az_current_lex_buffer ); l_lex_pos = 0; } for (i = 0; i < mb_len; i++) { if (l_lex_pos > l_max_lex_buffer_pos ) { az_current_lex_buffer = get_lex_buffer(az_current_lex_buffer); l_lex_pos = 0; } az_current_lex_buffer->c_text[l_lex_pos++] = src_az_current_source_buffer->c_text [src_az_current_source_buffer->w_current_position++]; } } } found_token: /* do any backup of the source buffer position and lex buffer */ src_az_current_source_buffer->w_current_position -= z_cell.backup; l_lex_pos -= z_cell.backup; /* put a null at the end of the current lex buffer */ az_current_lex_buffer->c_text[ l_lex_pos ] = 0; /* case on the token found */ switch (l_state) /* l_state holds the token found */ { case token_name: { key_keytable_entry_type *az_keyword; /* check the case sensitivity flag and change case if necessary */ if (! uil_v_case_sensitive) { char * ptr; for ( ptr = (char *)(az_current_lex_buffer->c_text); (* ptr) != 0; (* ptr) = _upper (* ptr), ptr++) {} } /* check if the name is a keyword */ az_keyword = key_find_keyword( l_lex_pos, (char *)az_current_lex_buffer->c_text ); if( az_keyword != NULL) { /* check that the length of the name is in range */ if (l_lex_pos > key_k_keyword_max_length) { l_lex_pos = key_k_keyword_max_length; az_current_lex_buffer->c_text[ l_lex_pos ] = 0; diag_issue_diagnostic ( d_name_too_long, az_start_src_record, l_start_src_pos, az_current_lex_buffer->c_text ); } yylval.value.az_keyword_entry = az_keyword; yylval.b_type = az_keyword->b_token; break; } /* process the name as an identifier */ /* check that the length of the identifier is in range */ /* Added for fix to CR 5566 */ if (l_lex_pos > lex_k_identifier_max_length) { l_lex_pos = lex_k_identifier_max_length; az_current_lex_buffer->c_text[ l_lex_pos ] = 0; diag_issue_diagnostic ( d_name_too_long, az_start_src_record, l_start_src_pos, lex_k_identifier_max_length, az_current_lex_buffer->c_text ); } yylval.value.az_symbol_entry = (sym_entry_type *) sym_insert_name( l_lex_pos, (char *)az_current_lex_buffer->c_text ); yylval.b_type = NAME; break; } case token_punc: { int l_token; /* found a punctuation mark - look up its token number in a table */ l_token = punc_token [ _index( az_current_lex_buffer->c_text[ 0 ], punc_char, sizeof( punc_char )) ]; yylval.b_type = l_token; break; } case token_punc2: { int l_token; /* found a punctuation mark - look up its token number in a table */ l_token = punc2_token [ _index( az_current_lex_buffer->c_text[ 0 ], punc2_char, sizeof( punc2_char )) ]; yylval.b_type = l_token; break; } case token_eol: /* if there is no more source * then return an end of file * otherwise go look for the next token */ if (src_get_source_line( ) == src_k_end_source) return UILEOF; goto initialize_token_builder; case token_integer: { long l_integer; yylval.b_type = UNS_INT_LITERAL; /* convert the text to binary * the sign of the number is applied as part of semantic * analysis; thus we only handle integers in range 0..2**31-1 */ errno = 0; l_integer = cvt_ascii_to_long(az_current_lex_buffer->c_text); if (errno != 0) diag_issue_diagnostic ( d_out_range, az_start_src_record, l_start_src_pos, "integer", " " ); yylval.value.az_symbol_entry = (sym_entry_type *)sem_create_value_entry ( (char *)&l_integer, sizeof( long ), sym_k_integer_value ); break; } case token_ustring: diag_issue_diagnostic ( d_unterm_seq, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, "character string", "before end of line" ); case token_comment: /* RAP preserve comments */ { int size; if (last_token_seen != token_comment) comment_text[0]=0; size = (int)strlen((char *)az_current_lex_buffer->c_text)+1; if ((size + (int)strlen (comment_text)) >= comment_size) { comment_text = XtRealloc(comment_text, INCR_COMMENT_SIZE + strlen(comment_text)); comment_size = INCR_COMMENT_SIZE + strlen (comment_text); } strcat (comment_text, (char *)az_current_lex_buffer->c_text); strcat (comment_text, "\n"); last_token_seen = token_comment; goto initialize_token_builder; } case token_string: found_primitive_string: { int l_length; lex_buffer_type *az_lex_buffer; sym_value_entry_type *az_value; unsigned char *c_char; l_length = l_lex_pos; for (az_lex_buffer = az_first_lex_buffer; az_lex_buffer != az_current_lex_buffer; az_lex_buffer = az_lex_buffer->az_next_buffer) l_length = l_length + l_max_lex_buffer_pos + 1; az_value = create_str_entry( l_length, l_charset, az_charset_entry ); c_char = (unsigned char *)az_value->value.c_value; for (az_lex_buffer = az_first_lex_buffer; az_lex_buffer != az_current_lex_buffer; az_lex_buffer = az_lex_buffer->az_next_buffer) { _move( c_char, az_lex_buffer->c_text, l_max_lex_buffer_pos + 1); c_char = c_char + l_max_lex_buffer_pos + 1; } _move( c_char, az_lex_buffer->c_text, l_lex_pos ); yylval.value.az_symbol_entry = (sym_entry_type *) az_value; yylval.b_type = CHAR_8_LITERAL; break; } case token_real: { double d_real; yylval.b_type = UNS_FLOAT_LITERAL; errno = 0; d_real = atof((char *)az_current_lex_buffer->c_text); if (errno != 0) diag_issue_diagnostic ( d_out_range, az_start_src_record, l_start_src_pos, "real", " " ); yylval.value.az_symbol_entry = (sym_entry_type *)sem_create_value_entry ( (char *)&d_real, sizeof( double ), sym_k_float_value ); break; } case token_ff: if (l_start_src_pos != 0) issue_control_char_diagnostic( c_char ); src_az_current_source_record->b_flags |= src_m_form_feed; goto initialize_token_builder; case token_ugstr: diag_issue_diagnostic ( d_unterm_seq, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, "character string", "before end of line" ); case token_gstr: /* ** Some general strings require special processing. Those ** that do not can go thru the normal string code. */ if ( l_parse_direction == XmSTRING_DIRECTION_R_TO_L ) { int i,j; unsigned char tmp1; unsigned char tmp2; /* assuming the string is confined to a single lex buffer. */ /* just flip the characters around. 16-bit characters need to */ /* be done in groups of two bytes */ if (l_charset_sixteen_bit != TRUE) /* ** Just reverse the bytes from the first to last */ for (i=0, j=l_lex_pos-1; i < (l_lex_pos>>1); i++,j--) { tmp1 = az_current_lex_buffer->c_text[ i ]; az_current_lex_buffer->c_text[ i ] = az_current_lex_buffer->c_text[ j ]; az_current_lex_buffer->c_text[ j ] = tmp1; } /* ** Don't reverse the string if have less than 2 characters (4 bytes) */ else if ((l_lex_pos>>1) > 1) /* ** This reversing doesn't work for mixed 8/16-bit character ** sets, but only built-in character sets allow mixing and ** they are not right-to-left. We do the same copying as in ** the 8-bit case above, but we move two bytes at a time and ** reverse the order as we copy so they end up correct. */ for (i=0, j=l_lex_pos-1; i < (l_lex_pos>>1); i+=2,j-=2) { tmp1 = az_current_lex_buffer->c_text[ i ]; tmp2 = az_current_lex_buffer->c_text[ i + 1 ]; az_current_lex_buffer->c_text[ i ] = az_current_lex_buffer->c_text[ j - 1 ]; az_current_lex_buffer->c_text[ i + 1 ] = az_current_lex_buffer->c_text[ j ]; az_current_lex_buffer->c_text[ j ] = tmp2; az_current_lex_buffer->c_text[ j - 1 ] = tmp1; } } /* ** If the string isn't 16-bit or it is userdefined and thus ** cannot be mixed 8/16-bit then we can just make a primitive ** string. */ if ((l_charset_sixteen_bit != TRUE) || (l_charset == lex_k_userdefined_charset)) goto found_primitive_string; else { sym_value_entry_type *cstr_entry; sym_value_entry_type *str_entry; int a_off, off; /* ** if string consists solely of 8-bit ascii characters, ** l_16bit_char_count will be zero. ** if string consists solely of 16 bit characters, ** l_16bit_char_count*2 will equal l_lex_pos. ** In either of these cases, the result is still a ** primitive string. */ /* ** For KANJI and HANZI treat 8-bit characters as ISO_LATIN1. */ if (l_16bit_char_count == 0) { l_charset = uil_sym_isolatin1_charset; goto found_primitive_string; } /* ** If the string only contains 16-bit characters, ** it still can be stored as a primitive string. */ if ((l_16bit_char_count<<1) == l_lex_pos) goto found_primitive_string; /* ** lex buffer is a mix of 8 and 16 bit characters. ** need to build a compound string. */ cstr_entry = sem_create_cstr(); for ( a_off = 0, off = 0; off < l_lex_pos; ) { for (off = a_off; off < l_lex_pos; off++) if (az_current_lex_buffer->c_text[ off ] > 0x97) break; /* * Create the 8 bit string with iso_latin1 */ if (off > a_off) { str_entry = create_str_entry ( off - a_off, uil_sym_isolatin1_charset, az_charset_entry ); _move( str_entry->value.c_value, &az_current_lex_buffer->c_text[ a_off ], off-a_off ); sem_append_str_to_cstr( cstr_entry, str_entry, TRUE ); } for (a_off = off; a_off < l_lex_pos; a_off += 2) if (az_current_lex_buffer->c_text[ a_off ] <= 0x97) break; /* * Create the 16 bit string with its charset */ if (a_off > off) { str_entry = create_str_entry( a_off - off, l_charset, az_charset_entry ); _move( str_entry->value.c_value, &az_current_lex_buffer->c_text[ off ], a_off-off ); sem_append_str_to_cstr( cstr_entry, str_entry, TRUE ); } } yylval.value.az_symbol_entry = (sym_entry_type *)cstr_entry; yylval.b_type = COMP_STRING; } break; case token_lstr: { int l_length = 0; lex_buffer_type *az_lex_buffer; sym_value_entry_type *str_entry; unsigned char *c_char; l_length = l_lex_pos; for (az_lex_buffer = az_first_lex_buffer; az_lex_buffer != az_current_lex_buffer; az_lex_buffer = az_lex_buffer->az_next_buffer) l_length = l_length + l_max_lex_buffer_pos + 1; str_entry = create_str_entry(l_length, lex_k_fontlist_default_tag, az_charset_entry ); c_char = (unsigned char *)str_entry->value.c_value; for (az_lex_buffer = az_first_lex_buffer; az_lex_buffer != az_current_lex_buffer; az_lex_buffer = az_lex_buffer->az_next_buffer) { _move( c_char, az_lex_buffer->c_text, l_max_lex_buffer_pos + 1); c_char = c_char + l_max_lex_buffer_pos + 1; } _move( c_char, az_lex_buffer->c_text, l_lex_pos ); yylval.value.az_symbol_entry = (sym_entry_type *)str_entry; yylval.b_type = LOC_STRING; break; } default: _assert( FALSE, "unknown token table final state" ); } /* RAP we want to keep track of whether we are appending sequential comments */ last_token_seen = l_state; /* set position information in token value */ yylval.az_source_record = az_start_src_record; yylval.b_source_pos = l_start_src_pos; yylval.b_source_end = src_az_current_source_buffer->w_current_position; /* was "l_start_src_pos + l_lex_pos;" */ yylval.b_tag = sar_k_token_frame; /* dump the token if requested */ #if debug_version if (uil_v_dump_tokens) dump_token( az_current_lex_buffer, l_lex_pos ); #endif /* ** save this token */ prev_yylval = yylval; /* return the token generated */ return yylval.b_type; found_error: /* do any backup of the source buffer position and lex buffer */ src_az_current_source_buffer->w_current_position -= z_cell.backup; l_lex_pos -= z_cell.backup; /* put a null at the end of the current lex buffer */ az_current_lex_buffer->c_text[ l_lex_pos ] = 0; /* case on the type of error */ switch (l_state) /* contains the type of error */ { case bad_prefix: /* printable characters that are not part of a token were found */ diag_issue_diagnostic ( d_unknown_seq, az_start_src_record, l_start_src_pos, az_current_lex_buffer->c_text ); break; default: _assert( FALSE, "unknown token table error state" ); break; } goto initialize_token_builder; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function initializes the lexical analyzer. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** az_first_lex_buffer ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** lexical buffer is allocated ** **-- **/ #define UNSCHAR_MINUS_ONE (unsigned char) 255; void lex_initialize_analyzer( ) { String language; /* RAP preserve comments */ comment_text = (char *) _get_memory(INITIAL_COMMENT_SIZE); comment_size = INITIAL_COMMENT_SIZE; comment_text[0] = '\0'; /* BEGIN OSF Fix CR 4749 */ /* The lex algorithm has the potential to write * into index l_max_lex_buffer_pos + 1, so allocate l_max_lex_buffer_pos * plus 2 positions in buffer. */ az_first_lex_buffer = (lex_buffer_type *) _get_memory (l_max_lex_buffer_pos + 2 + sizeof(lex_buffer_type *)); /* END OSF Fix CR 4749 */ az_first_lex_buffer->az_next_buffer = NULL; /* Initialize the stack frame entry for epsilon productions. */ gz_yynullval.b_tag = sar_k_null_frame; /* Initialize the default character set */ language = (char *) _XmStringGetCurrentCharset(); if ( language == NULL ) Uil_lex_l_user_default_charset = lex_k_default_charset; else { Uil_lex_l_user_default_charset = sem_charset_lang_name (language); if (Uil_lex_l_user_default_charset == sym_k_error_charset) { diag_issue_diagnostic ( d_bad_lang_value, diag_k_no_source, diag_k_no_column); Uil_lex_l_user_default_charset = lex_k_default_charset; } } Uil_lex_az_charset_entry = NULL; /* Determine if localized strings are possible */ if (Uil_cmd_z_command.v_use_setlocale == FALSE) Uil_lex_l_localized = FALSE; else { Uil_lex_l_localized = TRUE; _MrmOSSetLocale("C"); } /* Initialize the current character set */ Uil_lex_l_charset_specified = FALSE; /* Initialize the source position and record */ prev_yylval.b_source_end = UNSCHAR_MINUS_ONE; prev_yylval.az_source_record = src_az_current_source_record; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function performs the cleanup processing of the lexical analyzer. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** az_first_lex_buffer ** ** IMPLICIT OUTPUTS: ** ** az_first_lex_buffer ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** lexical buffer is freed ** **-- **/ void Uil_lex_cleanup_analyzer( ) { /* pointer to next buffer to free */ lex_buffer_type *az_buffer_to_free; /* Loop through the list of buffers freeing them all */ while (az_first_lex_buffer != NULL) { az_buffer_to_free = az_first_lex_buffer; az_first_lex_buffer = az_first_lex_buffer->az_next_buffer; _free_memory((char*)az_buffer_to_free); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function issues a syntax error. It is called from the ** error handling mechanism in the parser. ** ** FORMAL PARAMETERS: ** ** restart_token the token number for the punctuation ** character where parsing will resume after ** this error is issued. ** ** IMPLICIT INPUTS: ** ** current lex buffer ** punc_token and punc_char tables ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** issue a diagnostic ** **-- **/ void lex_issue_error( restart_token ) int restart_token; { int i, token_num; unsigned char c_char = '.'; char * tok_name; /* Find the token number for the restart character in the table. It should be there. Get the corresponding character for this token. */ for ( i = 0 ; i tok_num_tokens) ) tok_name = "UNKNOWN_TOKEN"; else tok_name = tok_token_name_table[token_num]; /* Issue the error. */ diag_issue_diagnostic (d_syntax, yylval.az_source_record, yylval.b_source_pos, tok_name, c_char); } /* ** ** LOCAL FUNCTIONS ** */ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Issue an error for an illegal control character. ** ** FORMAL PARAMETERS: ** ** c_char ** ** IMPLICIT INPUTS: ** ** current source position ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** issue a diagnostic ** **-- **/ void issue_control_char_diagnostic (unsigned char c_char ) { diag_issue_diagnostic ( d_control_char, src_az_current_source_record, src_az_current_source_buffer->w_current_position - 1, c_char ); src_az_current_source_record->b_flags |= src_m_unprintable_chars; return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function obtains another lexical buffer. ** ** FORMAL PARAMETERS: ** ** az_current_lex_buffer ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** address of a new lexical buffer ** ** SIDE EFFECTS: ** ** another lexical buffer may be allocated ** **-- **/ static lex_buffer_type *get_lex_buffer( az_current_lex_buffer ) lex_buffer_type *az_current_lex_buffer; { lex_buffer_type *az_lex_buffer; /* check to see if another buffer is available - if not allocate one */ az_lex_buffer = az_current_lex_buffer->az_next_buffer; if (az_lex_buffer == NULL) { /* BEGIN OSF Fix CR 4749 */ /* The lex algorithm has the potential to write * into index l_max_lex_buffer_pos + 1, so allocate l_max_lex_buffer_pos * plus 2 positions in buffer. */ az_lex_buffer = (lex_buffer_type *)_get_memory( l_max_lex_buffer_pos + 2 + sizeof(lex_buffer_type *)); /* END OSF Fix CR 4749 */ az_current_lex_buffer->az_next_buffer = az_lex_buffer; az_lex_buffer->az_next_buffer = NULL; } return az_lex_buffer; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure will change all the unprintable characters in ** a buffer to lex_k_unprint_sub. ** ** FORMAL PARAMETERS: ** ** buffer buffer to be checked ** length length of the buffer ** flags lex_m_filter_xxx flags to indicate if additional ** characters should be filtered. ** ** IMPLICIT INPUTS: ** ** class_table gives the unprintable characters ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void lex_filter_unprintable_chars (unsigned char *buffer, int length, unsigned long flags ) { int i; for (i=0; iw_line_number, yylval.b_source_pos, src_az_current_source_record->w_line_number, src_az_current_source_buffer->w_current_position ); for (az_lex_buffer = az_first_lex_buffer; ; az_lex_buffer = az_lex_buffer->az_next_buffer) { last_buffer = ( az_lex_buffer == az_current_lex_buffer ); if (last_buffer) last = l_lex_pos; else last = l_max_lex_buffer_pos+1; _move( c_buffer, az_lex_buffer->c_text, last ); lex_filter_unprintable_chars (c_buffer, last, 0); c_buffer[ last ] = 0; _debug_output("%s \n", c_buffer); if (last_buffer) return; } } #endif /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function converts a null terminated string to a ** longword integer in the range 0..2**31-1. If the ascii value is ** outside that range, the external variable errno is set to ERANGE ** and the value returned is 2**31-1 ** ** FORMAL PARAMETERS: ** ** c_text null terminate string holding integer in ascii ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** errno set if overflow occurs ** ** FUNCTION VALUE: ** ** long integer value of c_text ** ** SIDE EFFECTS: ** ** none ** **-- **/ #define k_max_int 2147483647 #define k_max_div_10 214748364 long cvt_ascii_to_long(c_text) unsigned char XmConst *c_text; { unsigned long l_value; int pos; l_value = 0; for (pos = 0; c_text[ pos ] != 0; pos++) { if (l_value >= k_max_div_10) goto potential_overflow; l_value = (l_value * 10) + c_text[ pos ] - '0'; } return l_value; potential_overflow: if (l_value > k_max_div_10) { errno = ERANGE; return k_max_int; } l_value = (l_value * 10) + c_text[ pos ] - '0'; if (l_value > k_max_int) { errno = ERANGE; return k_max_int; } return l_value; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates a symbol entry for a primitive string. ** ** FORMAL PARAMETERS: ** ** l_size number of bytes to allocate ** l_charset charset of the string (token value) ** az_charset_entry charset of the string (symbol table value entry) ** ** IMPLICIT INPUTS: ** ** yylval ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** symbol node created ** ** SIDE EFFECTS: ** ** none ** **-- **/ sym_value_entry_type *create_str_entry (l_size, l_charset, az_charset_entry) int l_size; int l_charset; sym_value_entry_type *az_charset_entry; { sym_value_entry_type *node; int charset; /* from sym_k_..._charset */ unsigned char direction; /* writing direction */ /* * Determine character set and writing direction */ if (l_charset != lex_k_userdefined_charset) { charset = sem_map_subclass_to_charset( l_charset ); direction = charset_writing_direction_table[charset]; } else { charset = sym_k_userdefined_charset; direction = az_charset_entry->b_direction; } /* size of entry * sym_k_value_entry for common part of a value entry * l_size for the string * 1 for the null on string */ node = (sym_value_entry_type *) sem_allocate_node ( sym_k_value_entry, sym_k_value_entry_size ); node->value.c_value = XtCalloc(1, l_size + 1); node->header.az_src_rec = yylval.az_source_record; node->header.b_src_pos = yylval.b_source_pos; node->header.b_end_pos = yylval.b_source_end; node->b_type = sym_k_char_8_value; node->w_length = l_size; node->b_charset = charset; node->b_direction = direction; node->az_charset_value = az_charset_entry; node->obj_header.b_flags = sym_m_private | sym_m_builtin; return node; } motif-2.3.8/clients/uil/UilSrcSrc.c0000644000175000017500000006655113145162623014052 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSrcSrc.c /main/13 1997/03/12 15:21:40 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contains the procedure for managing the UIL source ** files. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* %COMPLETE */ #include /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** define the source buffer data structures */ externaldef(uil_comp_glbl) src_source_buffer_type *src_az_current_source_buffer; externaldef(uil_comp_glbl) src_source_buffer_type *src_az_avail_source_buffer; externaldef(uil_comp_glbl) src_message_item_type *src_az_orphan_messages; /* %COMPLETE */ externaldef(uil_comp_glbl) long Uil_file_size; struct stat stbuf; /* ** define the source record data structures */ externaldef(uil_comp_glbl) src_source_record_type *src_az_current_source_record; externaldef(uil_comp_glbl) src_source_record_type *src_az_first_source_record; externaldef(uil_comp_glbl) uil_fcb_type *src_az_source_file_table[src_k_max_source_files]; externaldef(uil_comp_glbl) int src_l_last_source_file_number; /* ** ** OWN VARIABLE DECLARATIONS ** **/ static uil_fcb_type *main_fcb; static char *include_dir; static unsigned short main_dir_len; /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure initializes the reading of the UIL source program. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** Uil_cmd_z_command ** ** IMPLICIT OUTPUTS: ** ** src_az_first_source_buffer ** src_az_current_source_buffer ** src_l_last_source_file_number ** src_az_source_file_table ** src_az_current_source_record ** main_fcb ** include_dir ** main_dir_len ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** source file is opened ** source buffer structure is setup ** source record structure is setup ** **-- **/ void src_initialize_source(void) { /* initialize source data structures */ src_az_current_source_buffer = NULL; src_az_avail_source_buffer = NULL; src_l_last_source_file_number = -1; src_az_first_source_record = NULL; src_az_current_source_record = (src_source_record_type *) &src_az_first_source_record; /* Initialize Own storage */ main_fcb = NULL; include_dir = NULL; main_dir_len = 0; /* open the source file */ if ( Uil_cmd_z_command.ac_source_file == NULL ) diag_issue_diagnostic (d_src_open, diag_k_no_source, diag_k_no_column, ""); src_open_file ( Uil_cmd_z_command.ac_source_file, NULL ); /* fixes initial filename is NULL bug in callable UIL */ Uil_current_file = Uil_cmd_z_command.ac_source_file; return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure does the cleanup processing of the source files ** structures. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** Uil_cmd_z_command ** src_az_first_source_buffer ** src_az_current_source_buffer ** src_l_last_source_file_number ** src_az_source_file_table ** src_az_current_source_record ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** structures are freed ** **-- **/ void Uil_src_cleanup_source(void) { int i; /* index over fcbs */ src_source_buffer_type *buffer_to_free; src_source_record_type *record_to_free; src_machine_code_type *first_code_item; src_machine_code_type *code_item_to_free; status l_close_status; /* ** Loop through all open files freeing their fcbs */ for (i = 0; i <= src_l_last_source_file_number; i++) { /* it is possible to get an error before the files are open, so check and see if table is NULL before opening */ if (src_az_source_file_table[i] == NULL) continue; l_close_status = close_source_file (src_az_source_file_table[i]); if ( l_close_status == src_k_close_error ) { diag_issue_diagnostic (d_src_close, diag_k_no_source, diag_k_no_column, src_az_source_file_table[i]->expanded_name); } _free_memory ((char*)src_az_source_file_table [i]); src_az_source_file_table[i] = NULL; } /* ** Loop through list of current source buffers, freeing them */ while (src_az_current_source_buffer != NULL) { buffer_to_free = src_az_current_source_buffer; src_az_current_source_buffer = src_az_current_source_buffer->az_prior_source_buffer; _free_memory ((char*)buffer_to_free); } /* ** Loop through list of source records, freeing them */ while (src_az_first_source_record != NULL) { record_to_free = src_az_first_source_record; first_code_item = record_to_free->az_machine_code_list; while (first_code_item != NULL) { code_item_to_free = first_code_item; first_code_item = first_code_item->az_next_machine_code; _free_memory((char *)code_item_to_free); } src_az_first_source_record = src_az_first_source_record->az_next_source_record; _free_memory ((char*)record_to_free); } /* ** Free Own storage */ /* BEGIN OSF FIX pir 2240 */ /* Memory pointed to by main_fcb already freed. */ /* END OSF FIX pir 2240 */ _free_memory (include_dir); return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure opens a file and sets up the static pointers to ** read from this file. ** ** FORMAL PARAMETERS: ** ** c_file_name file to open ** ** IMPLICIT INPUTS: ** ** src_az_first_source_buffer ** src_az_current_source_buffer ** src_l_last_source_file_number ** src_az_source_file_table ** ** IMPLICIT OUTPUTS: ** ** src_az_first_source_buffer ** src_az_current_source_buffer ** src_l_last_source_file_number ** src_az_source_file_table ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** input file is opened ** input buffer structure is setup ** input record structure is setup ** **-- **/ void src_open_file (XmConst char *c_file_name, char *full_file_name) { uil_fcb_type *az_fcb; /* file control block ptr */ status l_open_status; /* status variable */ src_source_buffer_type *az_source_buffer; /* source buffer ptr */ /* allocate fcb and source buffer */ az_fcb = (uil_fcb_type *) _get_memory (sizeof (uil_fcb_type)); if (src_az_avail_source_buffer != NULL) { az_source_buffer = src_az_avail_source_buffer; src_az_avail_source_buffer = src_az_avail_source_buffer->az_prior_source_buffer; } else { az_source_buffer = (src_source_buffer_type *) _get_memory (sizeof (src_source_buffer_type)); } /* Call the OS-specific open file procedure */ l_open_status = open_source_file ( c_file_name, az_fcb, az_source_buffer ); /* If the file is not found, a fatal error is generated. */ if ( l_open_status == src_k_open_error ) { diag_issue_diagnostic( d_src_open, diag_k_no_source, diag_k_no_column, c_file_name ); } /* put fcb in the file table */ src_l_last_source_file_number++; if (src_l_last_source_file_number >= src_k_max_source_files) { diag_issue_diagnostic ( d_src_limit, src_az_current_source_record, src_az_current_source_buffer -> w_current_position - 1, az_fcb->expanded_name ); } src_az_source_file_table[ src_l_last_source_file_number ] = az_fcb; /* Complete the OS-independent initialization. Get the size of the file ** for %complete info then initialize a source ** buffer placing a null in the buffer will cause the lexical analyzer ** to start by reading the first line of the file */ /* %COMPLETE */ if (stat(az_fcb->expanded_name, &stbuf) == -1) { diag_issue_diagnostic( d_src_open, diag_k_no_source, diag_k_no_column, az_fcb->expanded_name ); } Uil_file_size = stbuf.st_size; if (full_file_name != NULL) strcpy (full_file_name, az_fcb->expanded_name); az_fcb->v_position_before_get = FALSE; az_source_buffer->w_current_line_number = 0; az_source_buffer->b_file_number = src_l_last_source_file_number; az_source_buffer->w_current_position = 0; az_source_buffer->c_text[ 0 ] = 0; /* make the source buffer current */ az_source_buffer->az_prior_source_buffer = src_az_current_source_buffer; src_az_current_source_buffer = az_source_buffer; return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure reads the next source line; ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** src_az_source_file_table ** ** IMPLICIT OUTPUTS: ** ** src_az_current_source_buffer ** src_az_current_source_record ** ** FUNCTION VALUE: ** ** src_k_end_source no more source lines ** src_k_read_normal new line in the source buffer ** ** SIDE EFFECTS: ** ** may issue diagnostics if error occurs reading record ** may restore previous source upon reaching end of current source ** **-- **/ status src_get_source_line(void) { uil_fcb_type *az_fcb; src_source_record_type *az_source_record; status l_read_status; /* Return if already at the end of file */ if (src_az_current_source_buffer == NULL) return src_k_end_source; /* Find the current fcb */ az_fcb = src_az_source_file_table [ (int)src_az_current_source_buffer->b_file_number ]; /* Read the next record */ l_read_status = get_line( az_fcb ); /* Increment lines processed count, and update current file */ Uil_lines_processed++; Uil_current_file = az_fcb->expanded_name; if ( (l_read_status == src_k_read_normal) || (l_read_status == src_k_read_truncated) ) { /* Read was successful * Set position to the start of the record */ src_az_current_source_buffer->w_current_position = 0; /* Allocate and initialize a source record */ az_source_record = (src_source_record_type *) _get_memory( sizeof( src_source_record_type ) ); az_source_record->az_next_source_record = NULL; az_source_record->w_line_number = ++src_az_current_source_buffer->w_current_line_number; az_source_record->b_file_number = src_az_current_source_buffer->b_file_number; az_source_record->az_message_list = NULL; az_source_record->az_machine_code_list = NULL; az_source_record->w_machine_code_cnt = 0; az_source_record->z_access_key = az_fcb->last_key; /* was uninitialized; fixes listing problem on HP (RAP) */ az_source_record->b_flags = 0; /* Link the source record to the end of source record list */ src_az_current_source_record->az_next_source_record = az_source_record; src_az_current_source_record = az_source_record; if (l_read_status == src_k_read_truncated) diag_issue_diagnostic( d_src_truncate, src_az_current_source_record, diag_k_no_column, src_k_max_source_line_length ); return src_k_read_normal; } /* Check for end of file */ if (l_read_status == src_k_end_source) { src_source_buffer_type *az_prior_source_buffer; /* get prior source buffer */ az_prior_source_buffer = src_az_current_source_buffer->az_prior_source_buffer; /* place current source buffer on the available list */ src_az_current_source_buffer->az_prior_source_buffer = src_az_avail_source_buffer; src_az_avail_source_buffer = src_az_current_source_buffer; /* if there is no prior source buffer - return end of source */ if (az_prior_source_buffer == NULL) return src_k_end_source; /* restore the prior buffer as current */ src_az_current_source_buffer = az_prior_source_buffer; return src_k_read_normal; } /* must have been an error */ diag_issue_diagnostic( d_src_read, src_az_current_source_record, diag_k_no_column, az_fcb->expanded_name ); _assert( FALSE, "read past source error" ); return(src_k_read_error); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** open the source file. ** ** FORMAL PARAMETERS: ** ** c_file_name source file to open ** az_fcb file control block for the file ** az_source_buffer source buffer for the file ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** src_k_open_normal ** src_k_open_error ** ** SIDE EFFECTS: ** ** file is opened and has a source buffer associated with it ** **-- **/ status open_source_file( XmConst char *c_file_name, uil_fcb_type *az_fcb, src_source_buffer_type *az_source_buffer ) { static unsigned short main_dir_len = 0; boolean main_file; int i; /* loop index through include files */ char buffer[256]; /* place the file name in the expanded_name buffer */ strncpy(buffer, c_file_name, sizeof(buffer)); buffer[sizeof(buffer)-1] = '\0'; /* Determine if this is the main file or an include file. */ main_file = (main_fcb == NULL); if (main_file) { char XmConst * ptr; unsigned short len; /* Save the directory info for the main file. */ for (len = strlen (c_file_name), ptr = & c_file_name [len - 1]; len > 0; len--, ptr--) { if ((* ptr) == '/') { break; } } main_dir_len = len; main_fcb = az_fcb; /* Open the main file. */ az_fcb->az_file_ptr = fopen(c_file_name, "r"); } else { static char XmConst c_include_dir[]= "/usr/include/"; Boolean search_user_include=True; Boolean specific_directory=False; /* See if the file name has a leading slash and set the flag. Look in the specified directory for the include file. If the dir is not specified (leading slash), look in the main file's directory */ if (c_file_name[0] == '/') { specific_directory = True; } if (!specific_directory) { _move (buffer, main_fcb -> expanded_name, main_dir_len); _move (& buffer [main_dir_len], c_file_name, strlen (c_file_name) + 1); /* + NULL */ } else { strcpy (buffer, c_file_name); } /* Open the include file. */ az_fcb->az_file_ptr = fopen (buffer, "r"); /* If a specific directory was specified, or if the file was found, then we are done. */ if ( (specific_directory) || (az_fcb -> az_file_ptr != NULL) ) { goto open_label; } /* Look in the command line specified include directories, if any. */ for (i = 0; i < Uil_cmd_z_command.include_dir_count; i++) { int inc_dir_len; inc_dir_len = strlen (Uil_cmd_z_command.ac_include_dir[i]); if (inc_dir_len == 0) { search_user_include = False; } _move (buffer, Uil_cmd_z_command.ac_include_dir[i], inc_dir_len); /* Add '/' if not specified at end of directory */ if (Uil_cmd_z_command.ac_include_dir[i][inc_dir_len - 1] != '/') { buffer [inc_dir_len] = '/'; inc_dir_len++; }; _move (& buffer [inc_dir_len], c_file_name, strlen (c_file_name) + 1); /* + NULL */ /* Open the include file. If found, we are done. */ az_fcb->az_file_ptr = fopen (buffer, "r"); if (az_fcb -> az_file_ptr != NULL) { goto open_label; } } /* Look in the default include directory. */ if (search_user_include) { _move(buffer, c_include_dir, sizeof c_include_dir - 1); /* no NULL */ _move(&buffer[sizeof c_include_dir - 1], c_file_name, strlen (c_file_name) + 1); /* + NULL */ /* Open the include file. */ az_fcb->az_file_ptr = fopen (buffer, "r"); } } open_label: /* check the open status. */ if (az_fcb->az_file_ptr == NULL) return src_k_open_error; /* open succeeded - place buffer address in fcb */ az_fcb->c_buffer = az_source_buffer->c_text; az_fcb->c_buffer[ src_k_max_source_line_length ] = 0; strcpy(az_fcb->expanded_name, buffer); return src_k_open_normal; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** close the source file. ** ** FORMAL PARAMETERS: ** ** az_fcb file control block for the file ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** src_k_close_normal ** src_k_close_error ** ** SIDE EFFECTS: ** ** none ** **-- **/ status close_source_file( uil_fcb_type *az_fcb ) { status l_close_status; /* ** Close the file */ l_close_status = fclose (az_fcb->az_file_ptr); if ( l_close_status != EOF ) return src_k_close_normal; else return src_k_close_error; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** read line of the source file. ** ** FORMAL PARAMETERS: ** ** az_fcb file control block for the file ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** src_k_read_normal ** src_k_read_error ** src_k_read_truncated ** src_k_end_source ** ** SIDE EFFECTS: ** ** next record in file is read ** **-- **/ status get_line( uil_fcb_type *az_fcb ) { status l_read_status; char *c_new_line; /* ** if v_position_before_get is true, we need to reposition ** before the get because another retrieve has altered the ** current record. */ if (az_fcb->v_position_before_get) { fseek( az_fcb->az_file_ptr, az_fcb->last_key.l_key, 0 ); l_read_status = (status) (fgets(az_fcb->c_buffer, src_k_max_source_line_length, az_fcb->az_file_ptr) != NULL); az_fcb->v_position_before_get = FALSE; } /* get the current offset */ az_fcb->last_key.l_key = ftell(az_fcb->az_file_ptr); /* read the next line */ l_read_status = (status) (fgets(az_fcb->c_buffer, src_k_max_source_line_length, az_fcb->az_file_ptr) != NULL ); if ( l_read_status != 0 ) { /* Read was successful * Find \n character an replace with a null */ c_new_line = (char *) strchr( az_fcb->c_buffer, '\n' ); if (c_new_line == NULL) { /* Fix for CR 3044 -- only return truncated if not at eof */ if (!feof(az_fcb->az_file_ptr)) return src_k_read_truncated; } else { *c_new_line = 0; } return src_k_read_normal; } /* Check for end of file */ if (feof(az_fcb->az_file_ptr)) { if (sym_az_current_section_entry->prev_section != NULL) { sym_include_file_entry_type *include_entry; /* ** This is the end of an include file. Set the pointers so that the sections ** in the include file hang off the previous list correctly. */ include_entry = (sym_include_file_entry_type *) sym_az_current_section_entry->prev_section->entries; include_entry->sections = sym_az_current_section_entry; sym_az_current_section_entry = sym_az_current_section_entry->prev_section; } return src_k_end_source; } /* must have been an error */ return src_k_read_error; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** re-read line of the source file. ** ** FORMAL PARAMETERS: ** ** az_fcb file control block for the file ** c_buffer pointer to buffer to hold the source line ** z_access_key key to retrieve the source line ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** v_position_before_read = TRUE ** ** FUNCTION VALUE: ** ** true if the record can be retrieved ** false if the record cannot be retrieved ** ** SIDE EFFECTS: ** ** change next record for the file ** **-- **/ boolean reget_line( uil_fcb_type *az_fcb, char *c_buffer, XmConst z_key *z_access_key ) { status l_read_status; char *c_new_line; fseek( az_fcb->az_file_ptr, z_access_key->l_key, 0 ); l_read_status = (status) (fgets(c_buffer, src_k_max_source_line_length, az_fcb->az_file_ptr) != NULL ); az_fcb->v_position_before_get = TRUE; if ( l_read_status != 0 ) { /* Read was successful * Find \n character an replace with a null */ c_new_line = (char *) strchr( c_buffer, '\n' ); if (c_new_line == NULL) { /* Fix for CR 3044 -- only return truncated if not at eof */ if (!feof(az_fcb->az_file_ptr)) return src_k_read_truncated; } else { *c_new_line = 0; } return TRUE; } /* must have been an error */ return FALSE; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Given a source record, this function returns the file name of ** the file containing that source record. ** ** FORMAL PARAMETERS: ** ** az_src_rec pointer to a source record structure ** ** IMPLICIT INPUTS: ** ** src_az_source_file_table ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** pointer to the file name string ** ** SIDE EFFECTS: ** ** none ** **-- **/ char *src_get_file_name(XmConst src_source_record_type *az_src_rec) { uil_fcb_type *fcb; /* Find the correct fcb */ fcb = src_az_source_file_table[ az_src_rec->b_file_number ]; /* Return a pointer to file name */ return fcb->expanded_name; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** Given a source record, this function retrieves the text of the ** line corresponding to that source line. ** ** FORMAL PARAMETERS: ** ** az_src_rec pointer to a source record structure ** c_buffer pointer to buffer to hold the text ** ** IMPLICIT INPUTS: ** ** src_az_source_file_table ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** true if there is a source line ** false if there is no source line ** ** SIDE EFFECTS: ** ** buffer is set to the contents of source line ** **-- **/ static char XmConst no_source[] = "[ source not available ]"; boolean src_retrieve_source (XmConst src_source_record_type *az_src_rec, char *c_buffer) { uil_fcb_type *fcb; /* check if there is any source */ if (az_src_rec == diag_k_no_source) { _move( c_buffer, no_source, sizeof no_source ); return FALSE; } /* ** check if we are dealing with the current source record ** in which case we don't need to reread the source */ if ((az_src_rec->b_file_number == src_az_current_source_buffer->b_file_number) && (az_src_rec->w_line_number == src_az_current_source_buffer->w_current_line_number) ) { strcpy( c_buffer, src_az_current_source_buffer->c_text); return TRUE; } /* ** Will have to reread the data from the file. */ /* Find the correct fcb */ fcb = src_az_source_file_table[ az_src_rec->b_file_number ]; /* get the line */ if (reget_line( fcb, c_buffer, (z_key *) &(az_src_rec->z_access_key) )) return TRUE; _move( c_buffer, no_source, sizeof no_source ); return FALSE; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function adds diagnostic information to the source representation. ** This permit diagnostics to be placed in the listing. ** ** FORMAL PARAMETERS: ** ** az_src_rec source line diagnostic issued against ** l_src_pos offset of diagnostic in the source line ** c_msg_text text of diagnostic ** l_msg_number message number for diagnostic ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** diagnostic stuff away in the source structure ** **-- **/ void src_append_diag_info( XmConst src_source_record_type *az_src_rec, XmConst int l_src_pos, XmConst char *c_msg_text, XmConst int l_msg_number ) { src_message_item_type *az_msg_item; int l_msg_length; src_message_item_type *current; src_message_item_type **prior; /* ** create the message item and fill it in. */ l_msg_length = strlen( c_msg_text ) + 1; /* includes null */ az_msg_item = (src_message_item_type *) _get_memory( sizeof( src_message_item_type ) + l_msg_length ); az_msg_item->l_message_number = l_msg_number; az_msg_item->b_source_pos = l_src_pos; _move( (az_msg_item->c_text), c_msg_text, l_msg_length ); /* ** Link the message from its source line ** Messages are in ascending column order for a line with ** messages without column info at the end ** Messages without source are appended to a list of orphans */ if (az_src_rec == diag_k_no_source) prior = &src_az_orphan_messages; else prior = (src_message_item_type **)&(az_src_rec->az_message_list); current = *prior; for (; current != NULL; prior = &(current->az_next_message), current = *prior ) { if (l_src_pos < (int)current->b_source_pos) break; } az_msg_item->az_next_message = current; *prior = az_msg_item; return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function adds machine code information to the source ** representation. This permits machine code to be placed in the listing. ** ** FORMAL PARAMETERS: ** ** az_src_rec source line machine code is associated with. ** l_offset offset in the record for this code element ** l_code_len length of the binary machine code buffer ** c_code buffer containing the machine code in binary form ** c_text_arg text of machine code; optional ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** Machine code stuffed away in the source structure ** **-- **/ void src_append_machine_code ( src_source_record_type *az_src_rec, XmConst int l_offset, XmConst int l_code_len, XmConst char *c_code, XmConst char *c_text_arg ) { src_machine_code_type *az_code_item; int l_text_len; XmConst char *c_text; if (c_text_arg == NULL) { c_text = ""; } else { c_text = c_text_arg; } /* ** create the machine code item and fill it in. */ l_text_len = strlen( c_text ) + 1; /* includes null */ az_code_item = (src_machine_code_type *) _get_memory( sizeof( src_machine_code_type ) + l_text_len + l_code_len ); az_code_item -> w_offset = l_offset; az_code_item -> w_code_len = l_code_len; _move( (az_code_item->data.c_data), c_code, l_code_len ); _move( &(az_code_item->data.c_data [l_code_len]), c_text, l_text_len ); /* ** Link the machine code to its source line, at the head of ** the machine code list. */ az_code_item->az_next_machine_code = az_src_rec->az_machine_code_list; az_src_rec->az_machine_code_list = az_code_item; az_src_rec->w_machine_code_cnt++; return; } motif-2.3.8/clients/uil/UilSrcDef.h0000644000175000017500000001031413145162623014010 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interface to the UIL source ** management procedures in the UIL compiler. ** **-- **/ #ifndef UilSrcDef_h #define UilSrcDef_h /* ** Interface to src_open_source */ #define src_k_open_normal 1 /* open succeeded */ #define src_k_open_error 0 /* open was unsuccessful */ /* ** Close return statuses */ #define src_k_close_normal 1 /* close succeeded */ #define src_k_close_error 0 /* close was unsuccessful */ /* ** Interface to src_get_source_line */ #define src_k_read_truncated 3 /* record truncated */ #define src_k_read_error 2 /* error during read */ #define src_k_read_normal 1 /* record read normally */ #define src_k_end_source 0 /* end of source */ /* ** Source records describe the lines of the source program. The are ** used to retrieve the source file for the listing and diagnostics. ** Diagnostics randomly access these data structures by maintaining ** the address of the corresponding source record in tokens, the parse ** stack and symbol table entries. The listing file walks the source ** records via the linked list provide by ar_next_source_record. */ #define _src_null_access_key( _key ) (_key.l_key == EOF) #define src_k_key_length 4 typedef struct { unsigned long l_key; } z_key; typedef struct _src_message_item_type { struct _src_message_item_type *az_next_message; status l_message_number; unsigned char b_source_pos; char c_text[ 1 ]; } src_message_item_type; #define src_message_item_type_size \ (sizeof(src_message_item_type) -\ sizeof( struct _src_message_item_type.c_text)) typedef struct _src_machine_code_type { struct _src_machine_code_type *az_next_machine_code; unsigned short int w_offset; unsigned short int w_code_len; union { long q_longdata[1]; /* longword alias for data*/ char c_data[ 1 ]; /* byte alias for data */ } data; } src_machine_code_type; #define src_machine_code_type_size \ (sizeof(src_machine_code_type) -\ sizeof( struct _src_machine_code_type.c_text)) /* ** Mask for bits in b_flags of the source record */ #define src_m_form_feed (1<<0) #define src_m_unprintable_chars (1<<1) typedef struct _src_source_record_type { struct _src_source_record_type *az_next_source_record; src_message_item_type *az_message_list; unsigned short w_line_number; unsigned char b_file_number; unsigned char b_flags; z_key z_access_key; src_machine_code_type *az_machine_code_list; unsigned short w_machine_code_cnt; } src_source_record_type; /* ** Source buffers describe the lines of the source program that are ** currently being SCAN. Include files and macros a can cause a program ** to have more than 1 source buffer. These buffers are managed as a ** stack, implemented via a linked list. */ typedef struct _src_source_buffer_type { struct _src_source_buffer_type *az_prior_source_buffer; unsigned short w_current_line_number; unsigned short w_current_position; char b_file_number; char c_text[ src_k_max_source_line_length+1]; } src_source_buffer_type; #endif /* UilSrcDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/Uil.h0000644000175000017500000001041713145162623012725 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the set of definitions for use with ** UIL compiler callable interface. ** **-- **/ #ifndef Uil_h #define Uil_h /* ** ** INCLUDE FILES ** **/ /* ** ** Definition of Compiler Severity Statuses ** */ typedef unsigned int Uil_status_type; #define Uil_k_min_status 0 #define Uil_k_success_status 0 #define Uil_k_info_status 1 #define Uil_k_warning_status 2 #define Uil_k_error_status 3 #define Uil_k_severe_status 4 #define Uil_k_max_status 4 /* ** */ typedef char (*string_array)[]; #define CEIL(a,b) ((a) < (b) ? (a) : (b)) /* ** Uil_command_type -- Input which describes how/what to compile. */ typedef struct _Uil_command_type { char *source_file; /* single source to compile */ char *resource_file; /* name of output file */ char *listing_file; /* name of listing file */ unsigned int include_dir_count; /* number of directories in */ /* include_dir array */ char **include_dir; /* directory to search for */ /* includes files */ unsigned listing_file_flag: 1; /* produce a listing */ unsigned resource_file_flag: 1; /* generate UID output */ unsigned machine_code_flag : 1; /* generate machine code */ unsigned report_info_msg_flag: 1;/* report info messages */ unsigned report_warn_msg_flag: 1;/* report warnings */ unsigned parse_tree_flag: 1; /* generate parse tree */ unsigned issue_summary: 1; /* issue diagnostics summary */ unsigned int status_update_delay; /* Number of times a status */ /* point is passed before */ /* calling statusCB routine */ /* 0 means called every time */ char *database; /* name of database file */ unsigned database_flag: 1; /* read a new database file */ unsigned use_setlocale_flag: 1; /* Enable calls to setlocale */ } Uil_command_type; /* ** Uil_compile_desc_type -- Output information about the compilation including ** the compiler_version, data_structure_version, parse tree, and error counts. */ typedef struct _Uil_comp_desc { unsigned int compiler_version; /* version number of Compiler */ unsigned int data_version; /* version number of structures */ char *parse_tree_root; /* parse tree output */ unsigned int message_count[Uil_k_max_status+1]; /* array of severity counts */ } Uil_compile_desc_type; /* ** Uil_continue_type -- A value returned from a Uil callback routine which ** allows the application to specify whether to terminate or continue the ** compilation. */ typedef unsigned int Uil_continue_type; #define Uil_k_terminate 0 #define Uil_k_continue 1 /* ** ** Entry Points ** */ #ifndef _ARGUMENTS #define _ARGUMENTS(arglist) arglist #endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern Uil_status_type Uil _ARGUMENTS(( Uil_command_type *command_desc , Uil_compile_desc_type *compile_desc , Uil_continue_type (*message_cb )(), char *message_data , Uil_continue_type (*status_cb )(), char *status_data )); #if defined(__cplusplus) || defined(c_plusplus) } #endif #undef _ARGUMENTS #endif /* Uil_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilKeyTab.c0000644000175000017500000001111413145162623014013 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilKeyTab.c /main/11 1995/07/14 09:34:29 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contains the keyword table used by the lexical analyzer ** to look up the keywords in the UIL. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* Keyword table pointer. */ static key_keytable_entry_type * key_keytable_ptr; /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine searches for a symbol in the compiler's keyword table. ** There are two arguments to the routine, the length of the symbol and ** the address of the start of the symbol. The routine returns the ** address of the keyword entry found, or a NULL pointer if the ** symbol is not found in the table. ** ** The search for the symbol is case sensitive depending upon the ** keytable binding that was established by the key_initialize routine. ** ** The require file UilKeyTab.h defines and initializes the keyword ** tables. It is built automatically from other files, thus it should ** not be hand editted. ** ** FORMAL PARAMETERS: ** ** symbol_length.rl.v : length of symbol to look up ** symbol_ptr.ra.v : address of symbol to look up ** ** IMPLICIT INPUTS: ** ** key_keytable_ptr : current keyword table ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** NULL : if the symbol is not in the keyword table ** otherwise : the address of the keyword table entry for ** the specified symbol. ** ** SIDE EFFECTS: ** ** none ** **-- **/ key_keytable_entry_type * key_find_keyword (symbol_length, symbol_ptr) unsigned int symbol_length; char * symbol_ptr; { int lower_limit, upper_limit; /* Check the arguments. */ if (symbol_length > key_k_keyword_max_length) return NULL; /* Initialize region to search. */ lower_limit = 0; upper_limit = key_k_keyword_count-1; /* Perform binary search on keyword index. */ do { int mid_point, result; key_keytable_entry_type * keyword_entry_ptr; mid_point = (lower_limit + upper_limit) >> 1; /* divide by 2 */ keyword_entry_ptr = & key_keytable_ptr [mid_point]; result = strcmp (symbol_ptr, keyword_entry_ptr -> at_name); if (result == 0) { return keyword_entry_ptr; /* Found keyword. */ } else if (result < 0) { upper_limit = mid_point - 1; /* Search lower half. */ } else { lower_limit = mid_point + 1; /* Search upper half. */ } } while (lower_limit <= upper_limit); /* If we fall out of the bottom of the loop, symbol was not found. */ return NULL; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine initializes the keyword lookup facility. It can be ** called multiple times during a single compilation. It must be called ** at least once before the keyword table is accessed. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** uil_v_case_sensitive : case sensitive switch, determines which ** : keyword table to use. ** ** IMPLICIT OUTPUTS: ** ** key_keytable_ptr : pointer to the keyword table to ** use for keyword lookups. ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void key_initialize () { /* Use the correct keyword table based on the global case sensitivity. */ if (uil_v_case_sensitive) { key_keytable_ptr = key_table; } else { key_keytable_ptr = key_table_case_ins; } } motif-2.3.8/clients/uil/UilMess.h0000644000175000017500000000552313145162623013557 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #define d_add_source 2 #define d_arg_count 23 #define d_arg_type 24 #define d_backslash_ignored 11 #define d_bad_argument 72 #define d_bad_database 73 #define d_bad_lang_value 67 #define d_bug_check 5 #define d_cannot_convert 71 #define d_circular_def 45 #define d_circular_ref 63 #define d_control_char 9 #define d_create_proc 41 #define d_create_proc_inv 42 #define d_create_proc_req 43 #define d_ctx_req 16 #define d_default_charset 80 #define d_different_units 79 #define d_dup_letter 52 #define d_dup_list 27 #define d_dupl_opt 0 #define d_future_version 74 #define d_gadget_not_sup 57 #define d_icon_letter 54 #define d_icon_width 53 #define d_illegal_forward_ref 70 #define d_include_file 78 #define d_info 31 #define d_inv_module 35 #define d_invalid_enumval 66 #define d_list_item 28 #define d_listing_open 33 #define d_listing_write 34 #define d_miss_opt_arg 32 #define d_name_too_long 12 #define d_names 50 #define d_never_def 26 #define d_no_enumset 65 #define d_no_source 46 #define d_no_uid 40 #define d_nonpvt 22 #define d_not_impl 17 #define d_null 44 #define d_obj_type 25 #define d_operand_type 58 #define d_out_of_memory 13 #define d_out_range 7 #define d_override_builtin 64 #define d_prev_error 29 #define d_previous_def 21 #define d_single_control 48 #define d_single_letter 51 #define d_single_occur 47 #define d_src_close 62 #define d_src_limit 36 #define d_src_null_char 37 #define d_src_open 3 #define d_src_read 4 #define d_src_truncate 6 #define d_submit_spr 30 #define d_subnotall 56 #define d_summary 38 #define d_supersede 20 #define d_syntax 14 #define d_too_many 55 #define d_too_many_dirs 61 #define d_uid_open 39 #define d_uid_write 76 #define d_undefined 15 #define d_unknown_charset 49 #define d_unknown_classrecnam 77 #define d_unknown_opt 1 #define d_unknown_seq 10 #define d_unsupp_charset 59 #define d_unsupp_const 60 #define d_unsupported 19 #define d_unterm_seq 8 #define d_value_too_large 69 #define d_widget_cycle 68 #define d_wmd_open 75 #define d_wrong_type 18 motif-2.3.8/clients/uil/UilSymDef.h0000644000175000017500000006701513145162623014043 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interface to the UIL symbol table. ** **-- **/ #ifndef UilSymDef_h #define UilSymDef_h /* ** ** INCLUDE FILES ** **/ #include #include /* ** constraint check access macro */ #define _constraint_check(arg) \ (constraint_tab[((arg)-1)/8] & (1 << ((arg)-1)%8)) /* ** Hash table size */ /* MOVED TO DBDef.h */ /* ** Symbol tags. These values are used in the tag field of every object header ** to identify the type of the entry. */ /* MOVED TO DBDef.h */ /* ** Common attribute masks -- These values are used in the b_flags field of ** the object_header. */ /* MOVED TO DBDef.h */ /* ** Output states - order is important */ /* MOVED TO DBDef.h */ /* ** Constants to define compiler-recognized data types. It is ** important that the names used in .wml language descriptions ** match these names. These values were once automatically generated ** by WML. They are now maintained by hand to reduce compiler ** dependence on WML artifacts. */ /* MOVED TO DBDef.h */ /* ** Header for each symbol entry */ typedef struct { char b_tag; /* type of entry The values of this field ia a sym_k_XXX_entry as */ /* defined above. */ char b_type; /* generic subtype field usage depends on value of b_tag field */ /* above (sym_k_value_entry -> b_type is a sym_k_XXX_value as */ /* defined in UilSymGen.h, sym_k_list_entry -> b_type is a */ /* sym_k_XXX_list as defined below, sym_k_widget_entry -> b_type */ /* is a sym_k_XXX_object as defined in UilSymGen.h, */ /* sym_k_child_entry -> b_type is a sym_k_XXX_child as defined in */ /* UilSymGen.h, sym_k_section_entry -> b_type is a */ /* sym_k_XXX_section as defined below). */ /* */ unsigned short w_node_size; /* size of the node in longwords */ int user_data; /* not used directly by the compiler. It is for use by */ /* applications making use of callable UIL only. */ /* ** Fields to save source information about the symbol: We currently save ** five things. The source record where the symbol "begins" (begins is in ** quotes because this may point to just white space before the actual ** symbol), the position (character) within that record where the symbol ** begins, the source record where the symbol ends, the position within ** that record that symbol really begins (i.e. no white space or anything), ** and the position where the symbol definition ends. */ struct _src_source_record_type *az_src_rec; /* Source record where symbol defined */ unsigned char b_src_pos; /* Starting position within the source record */ unsigned char b_end_pos; /* Ending position within the source record */ } sym_entry_header_type; /* ** Common view of a symbol entry */ typedef struct { sym_entry_header_type header; /* common part of all symbol entries. */ char b_value[ 1 ]; /* information specific to each different entry type. */ } sym_entry_type; /* ** Name entry */ /* Flags for name entries */ #define sym_m_referenced (1 << 0) /* Used in the b_flags field of a name entry. Set if this name is */ /* reference elsewhere in this UIL source module. */ #define sym_m_cycle_checked (1 << 1) /* set if the widget entry for this name has been checked for */ /* cyclic references. */ #define sym_m_has_cycle (2 << 1) /* set if a cycle was detected for a widget entry */ #define sym_m_charset (1 << 3) /* set if symbol being used as charset name. */ typedef struct _sym_name_entry_type { sym_entry_header_type header; /* common header */ sym_entry_type *az_object; /* pointer to the object entry with this name */ struct _sym_name_entry_type *az_next_name_entry; /* next name on hash chain */ struct _sym_name_entry_type *az_prev_name_entry; /* prev name on hash chain */ int az_cycle_id; /* unique id for each cycle check */ unsigned char b_flags; /* flags (possible value is sym_m_referenced as declared above) */ char c_text[ 1 ]; /* text of the name */ } sym_name_entry_type; /* ** Size of the fixed part of a name entry */ #define sym_k_name_entry_size (sizeof( sym_name_entry_type)- \ sizeof( char[ 1 ]) ) /* ** Value entry */ /* ** Types of values are included in UilSymDef.h */ /* ** Charsets supported by UIL are defined via WML in UilSymGen.h */ /* ** Common header for each "object" entry. This header is shared by all ** widget, gadget, list, argument, callback, and control node types. It ** always appears immediately following the standard entry header field. Also ** defined here is a prototype node for these types of "object" entries. */ typedef struct { sym_name_entry_type * az_name; /* pointer to the name entry that holds the object name. */ sym_entry_type * az_reference; /* pointer to the entry that references this object. */ sym_entry_type * az_next; /* pointer to next entry in a list, if this entry is linked under */ /* a list entry. */ char * az_comment; /* pointer to comment entry associated with this object. */ unsigned int b_flags; /* object flags. */ } sym_obj_header_type; typedef struct { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ } sym_obj_entry_type; /* ** This structure defines an element in a color table. A color table contains ** an array of such elements. */ typedef struct { unsigned char b_letter; /* letter for this color */ unsigned char b_index; /* index for this color */ unsigned short w_desc_offset; /* descriptor offset at in context */ struct _sym_value_entry_type *az_color; /* pointer to the value entry for this color */ } sym_color_element; /* ** This structure defines the data for an icon. */ typedef struct { unsigned short w_height; /* height in pixels of the icon */ unsigned short w_width; /* width in pixels of the icon */ struct _sym_value_entry_type *az_color_table; /* pointer to the value entry for the color table */ struct _sym_value_entry_type *az_rows; /* pointer to the list of icon rows */ } sym_icon_element; /* ** This structure define an enumeration set entry */ /* MOVED TO DBDef.h */ /* ** Auxiliary sym_k_flags for values stored in b_aux_flags field */ #define sym_m_table_entry (1 << 0) /* This item is a component of table */ #define sym_m_separate (1 << 2) /* add CDA separator to end of string */ #define sym_m_sixteen_bit sym_m_separate /* character set is 16-bit */ #define sym_m_exp_eval (1 << 3) /* if set, indicates that expression has already been evaluated */ /* ** Types of colors - stored in b_arg_type */ #define sym_k_unspecified_color 0 #define sym_k_background_color 1 /* This color should displayed in the background on a monochrome */ /* display. */ #define sym_k_foreground_color 2 /* This color should displayed in the foreground on a monochrome */ /* display. */ /* ** value sets defining expression operators */ /* MOVED TO DBDef.h */ typedef struct _sym_value_entry_type { sym_entry_header_type header; /* common header */ sym_obj_header_type obj_header; /* common header for objects */ unsigned char b_type; /* b_type distinguishes usage. Possible values are sym_k_XXX_value */ /* as defined in UilSymGen.h */ unsigned short w_length; /* length for variable length types */ char output_state; /* output_state (only byte is needed) */ unsigned char b_table_count; /* number of strings in table, colors in a color table, or fonts in */ /* a font table. */ unsigned char b_aux_flags; /* auxiliary flags */ unsigned char b_arg_type; /* type of argument value or monochrome treatment of a color */ unsigned char b_data_offset; /* offset of bits in context for an icon */ unsigned char b_pixel_type; /* pixel size encoding of an icon */ unsigned char b_charset; /* character set of a string */ unsigned char b_direction; /* writing direction of a string, from XmSTRING_DIRECTION_... */ unsigned char b_max_index; /* max index in a color table */ unsigned char b_expr_opr; /* operator for an expression value node */ unsigned int l_circular_ref_chk; /* field to mark when checking for circular references */ unsigned short int b_enumeration_value_code; /* if non-0, the node takes its value from the value of the */ /* sym_k_..._enumval code in this field (currently integer) */ MrmResource_id resource_id; /* resource id for private values. */ /* Structure for different kinds of nodes pointing to other value nodes */ struct _sym_value_entry_type * az_charset_value; /* pointer to value entry describing a userdefined charset. */ /* Valid only when b_charset == sym_k_userdefined_charset */ struct _sym_value_entry_type * az_next_table_value; /* next element for tables. */ struct _sym_value_entry_type *az_first_table_value; /* pointer to first table entry (font, string, etc.) if */ /* value is a table. */ struct _sym_value_entry_type * az_exp_op1; struct _sym_value_entry_type * az_exp_op2; /* pointer to the one or two value operands of an */ /* expression value node. Special operands have an */ /* explicitly state semantic. */ /* Union for the actual value of a value node */ union _sym_value_entry_value_union { /* must be capable of holding a pointer, chs */ long l_integer; /* value if an integer. */ double d_real; /* value if a double float. */ char *c_value; /* value of ASCIZ string */ XmString xms_value; /* value of XmString */ float single_float; /* value if a single float */ sym_color_element *z_color; /* value if color table. */ sym_icon_element *z_icon; /* value if icon */ char *az_data; /* pointer to any other kind of allocated data */ } value; } sym_value_entry_type; /* ** Define the fixed size of the value entry structure */ #define sym_k_value_entry_size (sizeof(sym_value_entry_type)) /* ** List entry */ /* ** The types of lists, values for the header.b_type field of a list entry. */ #define sym_k_error_list sym_k_error_entry #define sym_k_callback_list sym_k_callback_entry #define sym_k_argument_list sym_k_argument_entry #define sym_k_control_list sym_k_control_entry #define sym_k_proc_ref_list sym_k_proc_ref_entry typedef struct _sym_list_entry_type { sym_entry_header_type header; /* common header */ sym_obj_header_type obj_header; /* common header for objects */ unsigned short w_count; /* number of elements in the list. */ unsigned short w_gadget_count; /* number of gadgets in the list. */ } sym_list_entry_type; /* ** Define the size of the list structure */ #define sym_k_list_entry_size (sizeof(sym_list_entry_type)) /* ** Nested List entry */ /* ** A nested list entry appears in a list as the entry specifying a reference ** to another list (a nested list reference). It has its b_type field set ** to the list type (necessarily the same type as the list it is contained ** in, and the list it points to). The az_next field locates the next list ** element, as usual. The az_list field points to the list entry for the ** list which is referenced. */ typedef struct _sym_nested_list_entry_type { sym_entry_header_type header; /* common header */ sym_obj_header_type obj_header; /* common header for objects */ sym_list_entry_type *az_list; /* pointer to the referenced list */ } sym_nested_list_entry_type; /* ** Define the size of the nested_list structure */ #define sym_k_nested_list_entry_size (sizeof(sym_nested_list_entry_type)) /* ** Argument entry */ typedef struct _sym_argument_entry_type { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ sym_value_entry_type * az_arg_name; /* pointer to the value entry containing the argument name. */ sym_value_entry_type * az_arg_value; /* pointer to the value entry containing the argument value. */ } sym_argument_entry_type; #define sym_k_argument_entry_size (sizeof(sym_argument_entry_type)) /* ** Procedure Definition Entry */ typedef struct { sym_entry_header_type header; /* common header. */ sym_obj_header_type obj_header; /* common header for objects */ unsigned char v_arg_checking; /* should argument type be checked. */ unsigned char b_arg_count; /* number of arguments. */ unsigned char b_arg_type; /* The type of single argument (tag) for this procedure. It should */ /* be a sym_k_XXX_value as defined in UilDBDef.h. */ unsigned char b_widget_type; /* If b_arg_type is sym_k_widget_ref_value, then this field should */ /* be a sym_k_XXX_object as defined in UilSymGen.h or */ /* (uil_max_object + 1) if the type is unspecified. */ } sym_proc_def_entry_type; #define sym_k_proc_def_entry_size (sizeof( sym_proc_def_entry_type)) /* ** Procedure Reference Entry */ typedef struct { sym_entry_header_type header; /* common header. */ sym_obj_header_type obj_header; /* common object header. */ sym_proc_def_entry_type *az_proc_def; /* pointer to the procedure definition entry for the procedure to */ /* be called. */ sym_value_entry_type *az_arg_value; /* pointer to the value entry for the argument to be passed as the */ /* callback tag to the procedure. */ } sym_proc_ref_entry_type; #define sym_k_proc_ref_entry_size (sizeof( sym_proc_ref_entry_type)) /* ** These values are passed from the grammar to the semantic action routines ** (SAR) to identify how the procedure is used. */ #define sym_k_callback_proc 1 /* The procedure was used as a callback routine. */ #define sym_k_object_proc 2 /* The procedure was used as a creation routine for a user defined */ /* widget */ /* ** Callback entry */ typedef struct _sym_callback_entry_type { sym_entry_header_type header; /* common entry header. */ sym_obj_header_type obj_header; /* common object header. */ sym_value_entry_type * az_call_reason_name; /* pointer to the value entry containing the reason (callback) name */ sym_proc_ref_entry_type * az_call_proc_ref; /* pointer to the procedure reference to be invoked for this */ /* callback reason. */ sym_list_entry_type * az_call_proc_ref_list; /* list entry of procedure references when multiple callbacks are */ /* used for the callback. */ } sym_callback_entry_type; #define sym_k_callback_entry_size (sizeof(sym_callback_entry_type)) /* ** Parent list for widgets and gadgets ** ** This list contains pointers to each of the widgets and gadgets that ** reference the current widget in their control list. This information is ** required in order to check constraint arguments. */ typedef struct _sym_parent_list_type { sym_entry_header_type header; /* common entry header */ struct _sym_widget_entry_type * parent; /* pointer to a widget entry that references the originating widget */ /* in its controls list. */ struct _sym_parent_list_type * next; /* pointer to next parent list entry. */ } sym_parent_list_type; #define sym_k_parent_list_size (sizeof(sym_parent_list_type)) /* ** Widget entry and Gadget entry ** ** Gadgets have the same form as a widget. They are distinguished ** simply by the setting of sym_m_obj_is_gadget in obj_header.b_flags . */ /* widget and gadget node structure. */ typedef struct _sym_widget_entry_type { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ sym_list_entry_type * az_callbacks; /* pointer to a list entry of type sym_k_callback_list which */ /* contains the callbacks for this widget. */ sym_list_entry_type * az_arguments; /* pointer to a list entry of type sym_k_argument_list which */ /* contains the arguments for this widget. */ sym_list_entry_type * az_controls; /* pointer to a list entry of type sym_k_controls_list which */ /* contains the widgets that are children (are controlled by) this */ /* widget. */ sym_proc_ref_entry_type * az_create_proc; /* for user_defined widgets this points to the procedure reference */ /* entry that specifies the creation routine for the widget. */ sym_parent_list_type * parent_list; /* pointer to a parent list entry that links all objects which */ /* reference this object in there controls lists. It is used to */ /* traverse through the parents to verify that all contraint */ /* arguments specified on this widget are really inherited from one */ /* of its parents. */ int output_state; /* Used when generating the UID file. Possible values: */ /* sym_k_queued, sym_k_emitted, sym_k_not_processed. (only a byte */ /* is needed). */ MrmResource_id resource_id; /* The resource id if the object is private. This is used when */ /* generating the UID file. */ } sym_widget_entry_type; #define sym_k_widget_entry_size (sizeof(sym_widget_entry_type)) /* ** Control entry */ /* ** Control flags -- These are additional values that may occur in the b_flags ** field for control entries. NOTE: Must not overlap common flags defined ** above. */ #define sym_m_def_in_progress (1 << 6) /* used in all lists. */ #define sym_m_managed (1 << 7) /* This bit is set when the controlled object is to be managed. */ #define sym_m_obj_is_reference (1 << 8) #define sym_m_forward_ref (1 << 9) /* This bit is set if the item is a forward reference not yet resolved*/ #define sym_m_validated (1 << 10) /* Used for widgets to indicate if it has been validated */ /* Control node structure. */ typedef struct _sym_control_entry_type { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ sym_widget_entry_type * az_con_obj; /* pointer to the widget entry that is controlled by this widget. */ } sym_control_entry_type; #define sym_k_control_entry_size (sizeof(sym_control_entry_type)) /* ** External Definition Entry */ typedef struct _sym_external_def_entry_type { sym_entry_header_type header; /* common header */ struct _sym_external_def_entry_type *az_next_object; /* pointer next external definition entry. */ sym_name_entry_type *az_name; /* pointer to the name entry for the external object. */ } sym_external_def_entry_type; #define sym_k_external_def_entry_size (sizeof( sym_external_def_entry_type)) /* ** Forward Reference Entry */ typedef struct _sym_forward_ref_entry_type { sym_entry_header_type header; /* common header. The b_type field holds the object type. */ struct _sym_forward_ref_entry_type *az_next_ref; /* pointer to the next forward reference entry. */ char *a_update_location; /* address of the longword field in the referencing entry that */ /* needs to be updated with the address of the widget entry that */ /* this forward reference entry was created for. When this forward */ /* reference entry is processed in UilP2Reslv.c, then the widget */ /* named in the az_name field will be defined and it can be */ /* assigned directly into the a_update_location. */ sym_name_entry_type *az_name; /* pointer to the name entry for the widget being referenced before */ /* it has been defined. */ sym_widget_entry_type *parent; /* pointer to the widget entry of the parent of the forward */ /* referenced object. */ } sym_forward_ref_entry_type; #define sym_k_forward_ref_entry_size (sizeof( sym_forward_ref_entry_type)) /* ** Forward Reference Entry */ #define sym_k_patch_add 1 #define sym_k_bind_value_name 2 #define sym_k_patch_list_add 3 typedef struct _sym_val_forward_ref_entry_type { sym_entry_header_type header; /* common header. The b_type field holds the expected value type. */ struct _sym_val_forward_ref_entry_type *az_next_ref; /* pointer to the next forward reference entry. */ char *a_update_location; /* address of the longword field in the referencing entry that */ /* needs to be updated with the address of the value entry that */ /* this forward reference entry was created for. When this forward */ /* reference entry is processed in UilP2Reslv.c, then the value */ /* named in the az_name field will be defined and it can be */ /* assigned directly into the a_update_location. */ sym_name_entry_type *az_name; /* pointer to the name entry for the value being referenced before */ /* it has been defined. */ unsigned char fwd_ref_flags; /* flags used to indicate how to process entry on forward reference */ /* chain. */ } sym_val_forward_ref_entry_type; #define sym_k_val_forward_ref_entry_size (sizeof( sym_val_forward_ref_entry_type)) /* ** Default object entry. Pointed to from the module entry. The first one in ** the list contains source information for the "OBJECTS = " text. The 'next' ** field is a pointer to a list which contains the data on the actual clauses. */ typedef struct _sym_def_obj_entry_type { sym_entry_header_type header; /* common header */ struct _sym_def_obj_entry_type *next; /* pointer to next default object entry in the list. */ char b_object_info; char b_variant_info; } sym_def_obj_entry_type; #define sym_k_def_obj_entry_size (sizeof( sym_def_obj_entry_type)) /* ** Module entry (only 1 per compilation) */ typedef struct _sym_module_entry_type { sym_entry_header_type header; /* common header */ sym_obj_header_type obj_header; /* common header for objects */ sym_value_entry_type *az_version; /* pointer to the value entry containing version string for the */ /* module (version clause). */ sym_value_entry_type *az_character_set; /* pointer to the value entry containing the default character set */ /* information for the module (character set clause). */ sym_value_entry_type *az_case_sense; /* pointer to the value entry containing the value of the module */ /* case sensitivity clause. */ sym_def_obj_entry_type *az_def_obj; /* pointer to the default object type specified in the module */ /* default object variant clause. */ } sym_module_entry_type; #define sym_k_module_entry_size (sizeof( sym_module_entry_type)) /* ** Section entry */ /* ** Posiblilities for header.b_type when header.b_tag is sym_k_section_entry. */ #define sym_k_list_section 1 /* list section */ #define sym_k_procedure_section 2 /* procedure section */ #define sym_k_value_section 3 /* value section */ #define sym_k_identifier_section 4 /* identifier section */ #define sym_k_object_section 5 /* widget/gadget section */ #define sym_k_include_section 6 /* include directive */ #define sym_k_section_tail 7 /* This section has no corresponding UIL construct and exists only */ /* to aid in saving source information */ typedef struct _sym_section_entry_type { sym_entry_header_type header; /* common header */ struct _sym_section_entry_type *prev_section; /* previous section "LIST". */ sym_entry_type *next; /* pointer to the entry for the next section _OR_ next child. */ sym_entry_type *entries; /* points to entries in the section _OR_ the entry in the symbol */ /* table for this child. */ } sym_section_entry_type; #define sym_k_section_entry_size (sizeof (sym_section_entry_type)) /* ** Include file entry */ typedef struct _sym_include_file_entry_type { sym_entry_header_type header; /* common header */ sym_section_entry_type *sections; /* pointer to a section list; this list is all of the sections that */ /* exist in this include file. */ char file_name[255]; /* the file name as specified in the include statement in the UIL */ /* source. */ char full_file_name[255]; /* the expanded name for the include file actually opened. */ } sym_include_file_entry_type; #define sym_k_include_file_entry_size (sizeof( sym_include_file_entry_type)) /* ** Symbol table root entry (root of symbol table tree) */ typedef struct _sym_root_entry_type { sym_entry_header_type header; /* common header */ struct _src_source_record_type *src_record_list; /* pointer to a list of source records. */ char file_name[255]; /* the main UIL file name as specified on the command line. */ char full_file_name[255]; /* the expanded name for the main UIL file that was actually */ /* opened. */ sym_section_entry_type *sections; /* pointer to section list entry. */ sym_module_entry_type *module_hdr; /* pointer to module header entry. */ } sym_root_entry_type; #define sym_k_root_entry_size (sizeof( sym_root_entry_type)) /* ** Color Item Entry */ typedef struct _sym_color_item_entry_type { sym_entry_header_type header; /* common header */ struct _sym_color_item_entry_type *az_next; /* next item */ unsigned char b_letter; /* letter used for color */ unsigned char b_index; /* color table index */ unsigned char b_spare1; sym_value_entry_type *az_color; /* name or value entry for the color. */ } sym_color_item_entry_type; #define sym_k_color_item_entry_size (sizeof( sym_color_item_entry_type)) /* ** This macro copies the contents of one entry to another without disturbing ** the the linked list of entries used to connect all symbol table entries. */ #define _sym_copy_entry(__dest, __src, __size) _move (__dest, __src, __size) #endif /* UilSymDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilSemCSet.c0000644000175000017500000001277713145162623014157 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSemCSet.c /main/10 1997/03/12 15:21:53 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This file contains and routines related to the semantics of ** character sets. ** semantic validation. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function returns a pointer to a character set name given ** its sym_k_..._charset code and possibly a userdefined charset ** value entry. ** ** FORMAL PARAMETERS: ** ** l_charset charset of the string (token value) ** az_charset_entry charset of the string (symbol table value entry) ** ** IMPLICIT INPUTS: ** ** charset data tables ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** pointer to name (must NOT be freed) ** ** SIDE EFFECTS: ** ** error messages may be issued for objects that are still undefined ** or of the wrong type ** **-- **/ char *sem_charset_name (l_charset, az_charset_entry) int l_charset; sym_value_entry_type *az_charset_entry; { int charset; /* mapped character set */ charset = sem_map_subclass_to_charset (l_charset); switch ( charset ) { case sym_k_fontlist_default_tag: return XmFONTLIST_DEFAULT_TAG; case sym_k_userdefined_charset: /* ** If the charset is user-defined, then fetch info from the symbol ** table entry for it. */ _assert (az_charset_entry!=NULL, "null userdefined charset entry"); return az_charset_entry->value.c_value; default: return charset_xmstring_names_table[charset]; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function returns information about the character set specified ** (writing direction and sixteen_bit properties). ** ** FORMAL PARAMETERS: ** ** l_charset charset of the string (token value) ** az_charset_entry charset of the string (symbol table value entry) ** direction string writing direction ** sixteen_bit Boolean return value ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sem_charset_info (l_charset, az_charset_entry, write_direction, parse_direction, sixteen_bit) int l_charset; sym_value_entry_type *az_charset_entry; int *write_direction; int *parse_direction; int *sixteen_bit; { int charset; /* mapped character set */ charset = sem_map_subclass_to_charset (l_charset); switch (charset) { /* ** If the charset is user-defined, then fetch info from the symbol ** table entry for it. */ case sym_k_userdefined_charset: { *write_direction = az_charset_entry->b_direction; *parse_direction = az_charset_entry->b_direction; *sixteen_bit = (az_charset_entry->b_aux_flags & sym_m_sixteen_bit) != 0; break; } default: { *write_direction = charset_writing_direction_table[charset]; *parse_direction = charset_parsing_direction_table[charset]; if ( charset_character_size_table[charset] != sym_k_onebyte_charsize ) *sixteen_bit = TRUE; else *sixteen_bit = FALSE; break; } } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function returns the charset id corresponding to the ** charset specified in a $LANG variable. User-defined character ** sets are not recognized - it must be one available in the ** the compiler tables. ** ** The name match is case-insensitive. ** ** FORMAL PARAMETERS: ** ** lang_charset string naming a character set ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** 0 no match - character set not found ** >0 character set code from sym_k_..._charset. ** sym_k_userdefined_charset is never returned. ** ** ** SIDE EFFECTS: ** ** none ** **-- **/ int sem_charset_lang_name (lang_charset) char *lang_charset; { char uname[200]; /* upper-case character set name */ int ndx; /* loop index */ /* * Convert name to upper case, then search table (which is already in * upper case). */ strcpy (uname, lang_charset); for ( ndx=0 ; ndx<(int)strlen(uname) ; ndx++ ) uname[ndx] = _upper (uname[ndx]); for ( ndx=0 ; ndx<(int)charset_lang_table_max ; ndx++ ) if ( strcmp(uname,charset_lang_names_table[ndx]) == 0 ) return (int)charset_lang_codes_table[ndx]; return 0; } motif-2.3.8/clients/uil/UilLstLst.c0000644000175000017500000004700513145162623014071 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilLstLst.c /main/20 1999/07/21 09:03:16 vipin $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contains the procedures for managing the UIL listing. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include #include #include "UilDefI.h" /* ** ** EXTERNAL storage used by the listing ** */ /* ** ** OWN storage used by the listing ** */ externaldef(uil_comp_glbl) char Uil_lst_c_title2[132]; static int lst_l_usable_lines; static int lst_l_lines_left; static int lst_l_page_no; static char lst_c_title1[132]; static uil_fcb_type *lst_az_fcb; static boolean lst_v_listing_open = FALSE; /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function opens the UIL listing file to be written and ** initializes OWN storage used by the listing package. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** lst_l_usable_lines number of usable lines per page ** lst_l_lines_left number of lines left on page ** lst_l_page_no current page number ** lst_c_title1 title line 1 ** Uil_lst_c_title2 title line 2 ** lst_v_listing_open can the listing be written to ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** listing file is opened ** **-- **/ void lst_open_listing() { status open_status; _Xctimeparams ctime_buf; /* allocate fcb */ lst_az_fcb = (uil_fcb_type *)_get_memory( sizeof( uil_fcb_type ) ); /* open the listing file */ open_status = create_listing_file( lst_az_fcb ); if ( open_status == src_k_open_error ) { diag_issue_diagnostic( d_listing_open, diag_k_no_source, diag_k_no_column, lst_az_fcb->expanded_name ); /* should never return - error is fatal */ return; } lst_l_lines_left = 0; lst_l_page_no = 0; lst_v_listing_open = TRUE; sprintf(lst_c_title1, "%s %s \t%s\t\t Page ", _host_compiler, _compiler_version, current_time(&ctime_buf)); /* ** Haven't parsed the module yet. ** UilSarMod.c routines will fill it in. */ Uil_lst_c_title2[ 0 ] = 0; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function does the clean up processing for the listing facility. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** lst_c_title1 title line 1 ** Uil_lst_c_title2 title line 2 ** lst_v_listing_open can the listing be written to ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** dynamic memory is freed ** **-- **/ void Uil_lst_cleanup_listing() { /* ** Check that there is a listing file requested and that ** it is not already in error. */ if (!(lst_v_listing_open && Uil_cmd_z_command.v_listing_file)) return; /* ** free fcb */ _free_memory((char*)lst_az_fcb); lst_az_fcb = NULL; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** routine to create the listing file. ** ** FORMAL PARAMETERS: ** ** az_fcb file control block for the file ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** src_k_open_normal ** src_k_open_error ** ** SIDE EFFECTS: ** ** file is created ** **-- **/ status create_listing_file( az_fcb ) uil_fcb_type *az_fcb; { /* place the file name in the expanded_name buffer */ strcpy(az_fcb->expanded_name, Uil_cmd_z_command.ac_listing_file); /* open the file */ az_fcb->az_file_ptr = fopen(Uil_cmd_z_command.ac_listing_file, "w"); if (az_fcb->az_file_ptr == NULL) return src_k_open_error; /* assume 66 lines on a page */ lst_l_usable_lines = 66 - 9; return src_k_open_normal; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** function to write a line to the listing file. ** ** FORMAL PARAMETERS: ** ** ac_line text of the line to output ** ** IMPLICIT INPUTS: ** ** lst_l_lines_left ** lst_l_usable_lines ** lst_az_fcb ** lst_c_title1 ** lst_c_title1 ** ** IMPLICIT OUTPUTS: ** ** lst_l_lines_left ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** line output to file ** **-- **/ void lst_output_line( ac_line, v_new_page ) char *ac_line; boolean v_new_page; { status error_status; if (!lst_v_listing_open) return; /* ** Update the current file and call the Status callback routine to report ** our progress. */ Uil_current_file = lst_az_fcb->expanded_name; if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL) diag_report_status(); if ((lst_l_lines_left <= 0) || v_new_page) { lst_l_page_no ++; lst_l_lines_left = lst_l_usable_lines; fprintf(lst_az_fcb->az_file_ptr, "\f\n%s%d\n%s\n\n", lst_c_title1, lst_l_page_no, Uil_lst_c_title2); } error_status = fprintf(lst_az_fcb->az_file_ptr, "%s\n", ac_line); if (error_status == EOF) { lst_v_listing_open = FALSE; diag_issue_diagnostic( d_listing_write, diag_k_no_source, diag_k_no_column, lst_az_fcb->expanded_name ); } lst_l_lines_left --; return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** function to return ASCII date and time ** ** FORMAL PARAMETERS: ** ** void ** ** IMPLICIT INPUTS: ** ** void ** ** IMPLICIT OUTPUTS: ** ** void ** ** FUNCTION VALUE: ** ** pointer to a null terminated string ** ** SIDE EFFECTS: ** ** none ** **-- **/ char *current_time(_Xctimeparams *ctime_buf) { time_t time_location; char *ascii_time; time_location = time( 0 ); ascii_time = _XCtime( &time_location, *ctime_buf ); ascii_time[24] = 0; return ascii_time; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function outputs the UIL listing file ** ** FORMAL PARAMETERS: ** ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** ** SIDE EFFECTS: ** ** **-- **/ void lst_output_listing() { src_source_record_type *az_src_rec; char src_buffer[ src_k_max_source_line_length+12 ]; char *src_ptr; int i; /* ** Check that there is a listing file requested and that ** it is not already in error. */ if (!(lst_v_listing_open && Uil_cmd_z_command.v_listing_file) ) return; /* ** Walk the list of source records. */ for (az_src_rec = src_az_first_source_record; az_src_rec != NULL; az_src_rec = az_src_rec->az_next_source_record) { /* ** place the line and file number in the output buffer */ sprintf(src_buffer, "%5d (%d)\t", az_src_rec->w_line_number, az_src_rec->b_file_number); src_ptr = &(src_buffer[ strlen( src_buffer ) ]); src_retrieve_source( az_src_rec, src_ptr ); /* ** filter standard unprintable characters if necessary */ if ( az_src_rec->b_flags & src_m_unprintable_chars) lex_filter_unprintable_chars( (unsigned char*)src_ptr, strlen( src_ptr ), 0 ); /* ** replace leading formfeed with a blank */ if ( az_src_rec->b_flags & src_m_form_feed) *src_ptr = ' '; lst_output_line( src_buffer, (az_src_rec->b_flags & src_m_form_feed) != 0 ); /* ** if the line has messages, get them displayed */ if (az_src_rec->az_message_list != NULL) { lst_output_message_ptr_line( az_src_rec, src_ptr ); lst_output_messages( az_src_rec->az_message_list ); } /* ** if the line has machine code, get it displayed if requested */ if ( (Uil_cmd_z_command.v_show_machine_code) && (az_src_rec->w_machine_code_cnt > 0) ) { lst_output_machine_code( az_src_rec ); } } /* ** output the orphan messages */ if (src_az_orphan_messages != NULL) lst_output_messages( src_az_orphan_messages ); /* ** output the file summary */ lst_output_line( " ", FALSE ); for (i = 0; i <= src_l_last_source_file_number; i++) { uil_fcb_type *az_fcb; /* file control block ptr */ char buffer [132]; az_fcb = src_az_source_file_table [i]; sprintf (buffer, " File (%d) %s", i, az_fcb->expanded_name ); lst_output_line( buffer, FALSE ); } lst_output_line( " ", FALSE ); return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function outputs a list of messages to the UIL listing file ** ** FORMAL PARAMETERS: ** ** az_message_item ptr to start of the message list ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** messages are written to the listing file ** **-- **/ void lst_output_messages( az_message_item ) src_message_item_type *az_message_item; { src_message_item_type *az_msg; char buffer[132]; int msg_no; int last_pos; int current_pos; last_pos = -1; msg_no = 9; for (az_msg = az_message_item; az_msg != NULL; az_msg = az_msg->az_next_message) { current_pos = az_msg->b_source_pos; if (last_pos < current_pos) { last_pos = current_pos; if (last_pos == diag_k_no_column) msg_no = 0; else msg_no = (msg_no % 9) + 1; } sprintf(buffer, "%s (%d) %s", diag_get_message_abbrev( az_msg->l_message_number ), msg_no, az_msg->c_text); lst_output_line( buffer, FALSE ); } lst_output_line( " ", FALSE ); return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function outputs a list of machine code items to the ** UIL listing file ** ** FORMAL PARAMETERS: ** ** az_src_rec ptr to a source record ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** machine code is written to the listing file ** **-- **/ void lst_output_machine_code ( az_src_rec ) src_source_record_type *az_src_rec; { static src_machine_code_type * * mc_array = NULL; static unsigned short mc_cnt = 0; src_machine_code_type *az_code; int code_cnt, mc_i; /* Go through the machine code list, and save the entries in the array; traverse them in reverse order. Reuse the vector if it is large enough. */ code_cnt = az_src_rec->w_machine_code_cnt; if ((int)mc_cnt < code_cnt) { if (mc_array != NULL) { _free_memory ((char*)mc_array); } mc_array = (src_machine_code_type * *)_get_memory (sizeof (char *) * code_cnt); mc_cnt = code_cnt; } for (az_code = az_src_rec->az_machine_code_list, mc_i = 0; az_code != NULL; az_code = az_code->az_next_machine_code, mc_i++) { mc_array [mc_i] = az_code; } for (mc_i = code_cnt - 1; mc_i >= 0; mc_i--) { #define BIT_64_LONG ((sizeof(long)*8)==64) #define OFFSET_COL (BIT_64_LONG ? 75 : 43) /*should be 75 on 64 bit mach, 43 on 32*/ #define TEXT_COL (BIT_64_LONG ? 82 : 50) /*82 on 64 bit mach, 50 on 32*/ #define BUF_LEN (BIT_64_LONG ? 164 : 132) /*164 on 64 bit mach. 132 on 32 bit mach.*/ #define HEX_PER_WORD 4 #define HEX_PER_LONG (BIT_64_LONG ? 16 : 8) /*should be 16 on 64 bit mach., 8 on 32 bit mach*/ #define LONG_PER_LINE 4 #define ASCII_PER_LINE (LONG_PER_LINE * sizeof (long)) unsigned short long_cnt, extra_byte_cnt, text_len, code_len, line_cnt, extra_long_cnt, i, j, code_offset; unsigned char buffer[ BUF_LEN + 1 ], * text_ptr, hex_longword [HEX_PER_LONG + 1], line_written; unsigned long * code_ptr; unsigned long temp_long; static unsigned short start_hex_long [4]; /*if 64-bit environment, it should have vals { 55, 38, 21, 4 }; if 32 bit environment, { 31, 22, 13, 4 }; */ start_hex_long[0]=(BIT_64_LONG ? 55 : 31); start_hex_long[1]=(BIT_64_LONG ? 38 : 22); start_hex_long[2]=(BIT_64_LONG ? 21 : 13); start_hex_long[3]=4; az_code = mc_array [mc_i]; code_ptr = (unsigned long *)az_code -> data.c_data; code_len = az_code -> w_code_len; code_offset = az_code -> w_offset; text_ptr = (unsigned char *)(& az_code -> data.c_data [code_len]); text_len = strlen ((char *)text_ptr); if (text_len > (unsigned short) (BUF_LEN - TEXT_COL + 1)) text_len = BUF_LEN - TEXT_COL + 1; long_cnt = code_len / sizeof (char *); line_cnt = long_cnt / LONG_PER_LINE; extra_long_cnt = long_cnt % LONG_PER_LINE; extra_byte_cnt = code_len % sizeof (char *); _fill (buffer, ' ', sizeof buffer - 1); sprintf ((char *)hex_longword, "%04X", code_offset); _move (& buffer [OFFSET_COL - 1], hex_longword, HEX_PER_WORD); _move (& buffer [TEXT_COL - 1], text_ptr, text_len); buffer [TEXT_COL + text_len] = '\0'; line_written = FALSE; /* ** Write out entire lines. Clear the text after the first line. ** Filter all non-printable characters. */ for (i = 0; i < line_cnt; i++) { if (text_len == 0) { _move (& buffer [TEXT_COL - 1], code_ptr, ASCII_PER_LINE); lex_filter_unprintable_chars ((unsigned char*) & buffer [TEXT_COL - 1], ASCII_PER_LINE, lex_m_filter_tab ); buffer [TEXT_COL - 1 + ASCII_PER_LINE] = '\0'; } for (j = 0; j < LONG_PER_LINE; j++, code_ptr++) { if (BIT_64_LONG){ sprintf ((char *)hex_longword, "%lX", (* code_ptr)); } else{ sprintf ((char *)hex_longword, "%08lX", (* code_ptr)); } _move (& buffer [start_hex_long [j]], hex_longword, HEX_PER_LONG); } lst_output_line((char*) buffer, FALSE ); line_written = TRUE; code_offset += LONG_PER_LINE * sizeof (long); sprintf ((char *)hex_longword, "%04X", code_offset); _move (& buffer [OFFSET_COL - 1], hex_longword, HEX_PER_WORD); if (i == 0 && text_len > 0) { _fill (& buffer [TEXT_COL - 1], ' ', text_len); } } /* Write out a partial line. */ if (extra_long_cnt > 0 || extra_byte_cnt > 0) { if (text_len == 0) { int ascii_cnt; ascii_cnt = (extra_long_cnt * sizeof (long)) + extra_byte_cnt; _move (& buffer [TEXT_COL - 1], code_ptr, ascii_cnt); lex_filter_unprintable_chars ((unsigned char*) & buffer [TEXT_COL - 1], ascii_cnt, lex_m_filter_tab ); buffer [TEXT_COL - 1 + ascii_cnt] = '\0'; } /* Clear code from previous lines, keeping the offset and text if it is there. */ _fill (buffer, ' ', OFFSET_COL - 1); if (extra_long_cnt > 0) { /* Format the code longwords. */ for (i = 0; i < extra_long_cnt; i++, code_ptr++) { unsigned long temp_long; if (BIT_64_LONG){ /* _move( (char*) &temp_long, (char*) code_ptr, sizeof(temp_long));*/ sprintf ((char *)hex_longword, "%lX", (* code_ptr)); } else{ sprintf ((char *)hex_longword, "%08lX", (*code_ptr)); } _move (& buffer [start_hex_long [i]], hex_longword, HEX_PER_LONG); } } /* Format the extra code bytes. */ if (extra_byte_cnt > 0) { int l; unsigned char extra_bytes [sizeof (long)]; _move (extra_bytes, code_ptr, extra_byte_cnt); _fill (hex_longword, ' ', HEX_PER_LONG); for (l = extra_byte_cnt - 1; l >= 0; l--) { if (BIT_64_LONG) sprintf ((char *) & hex_longword [HEX_PER_LONG - (2 * (l + 1))], "%02X", extra_bytes [l]); else sprintf ((char *) & hex_longword [HEX_PER_LONG - (2 * (l + 1))], "%02X", extra_bytes [extra_byte_cnt-l-1]); } _move (& buffer [start_hex_long [extra_long_cnt]], hex_longword, HEX_PER_LONG); } /* Output the partial line. */ lst_output_line( (char*)buffer, FALSE ); line_written = TRUE; } if (! line_written) { if (text_len > 0) { lst_output_line((char*) buffer, FALSE ); } else { lst_output_line( " ", FALSE ); } } } return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function outputs a pointer line showing the position of ** diagnostics to the UIL listing file. ** ** FORMAL PARAMETERS: ** ** az_src_rec ptr to a source record ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** message ptr line is written to the listing file ** **-- **/ void lst_output_message_ptr_line( az_src_rec, src_buffer ) src_source_record_type *az_src_rec; char *src_buffer; { src_message_item_type *az_msg; char buffer[ src_k_max_source_line_length + 3 ]; char *ptr_buffer; int msg_no; int pos; int msg_pos; char c_char; boolean v_output_line; if (_src_null_access_key( az_src_rec->z_access_key) ) return; msg_no = 9; buffer[ 0 ] = '\t'; buffer[ 1 ] = '\t'; ptr_buffer = &buffer[ 2 ]; az_msg = az_src_rec->az_message_list; if (az_msg == NULL) return; msg_pos = az_msg->b_source_pos; if (msg_pos == diag_k_no_column) return; v_output_line = FALSE; for (pos = 0; c_char = src_buffer[ pos ], c_char != 0; ) { if (pos < msg_pos) { if (c_char == '\t') ptr_buffer[ pos++ ] = '\t'; else ptr_buffer[ pos++ ] = ' '; continue; } msg_no = (msg_no % 9) + 1; ptr_buffer[ pos++ ] = msg_no + '0'; v_output_line = TRUE; next_message: az_msg = az_msg->az_next_message; if (az_msg == NULL) goto finished_scan; msg_pos = az_msg->b_source_pos; if ((pos-1) == msg_pos) /* pos already advanced */ goto next_message; if (msg_pos == diag_k_no_column) goto finished_scan; } finished_scan: ptr_buffer[ pos ] = 0; if (v_output_line) lst_output_line( buffer, FALSE ); return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** lst_debug_output sends debugging info to the listing file if ** there is one; if not the output goes to standard output. ** ** FORMAL PARAMETERS: ** ** standard Xprintf argument list ** ** IMPLICIT INPUTS: ** ** lst_v_listing_open ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** print lines either in the listing file or to standard output ** **-- **/ static int cur_pos=0; static char buffer[132]; void lst_debug_output (char *format, ...) { va_list ap; /* ptr to variable length parameter */ /* ** establish the start of the parameter list */ va_start(ap,format); /* ** check if the listing file is open for output */ if (lst_v_listing_open) { int count; char *ptr; vsprintf( &(buffer[cur_pos]), format, ap ); for ( ptr=buffer; ptr[0] != '\0'; ptr += (count+1) ) { _assert( ptr <= &(buffer[132]), "Overflowed debug listing buffer" ); count = strcspn( ptr, "\n" ); if (count == strlen( ptr )) { cur_pos = ptr - buffer + count; return; } else { ptr[ count ] = '\0'; } lst_output_line( ptr, FALSE ); } cur_pos = 0; } else vprintf( format, ap ); va_end(ap); } motif-2.3.8/clients/uil/Uil.msg0000644000175000017500000000777412672140200013267 00000000000000$ $XConsortium: Uil.msg /main/4 1996/08/19 11:53:43 pascale $ $set UIL_SET1 UIL_0 duplicate option \"%s\" was ignored UIL_1 unknown option \"%s\" was ignored UIL_2 additional UIL source file: %s was ignored UIL_3 error opening source file: %s UIL_4 error reading next line of source file: %s UIL_5 Internal error: %s UIL_6 line truncated at %d characters UIL_7 value of %s is out of range %s UIL_8 %s not terminated %s UIL_9 unprintable character \\%d\\ ignored UIL_10 unknown sequence \"%s\" ignored UIL_11 unknown escape sequence \"\\%c\" - \\ ignored UIL_12 name exceeds %d characters - truncated to: %s UIL_13 compiler ran out of virtual memory UIL_14 unexpected %s token found - parsing resumes after \"%c\" UIL_15 %s %s must be defined before this reference UIL_16 context requires a %s - %s was specified UIL_17 %s is not implemented yet UIL_18 found %s value when expecting %s value UIL_19 the %s %s is not supported for the %s object UIL_20 this %s %s supersedes a previous definition in this %s %s UIL_21 name %s previously defined as %s UIL_22 value used in this context must be private UIL_23 procedure %s was previously declared with %d arguments UIL_24 found %s value - procedure %s argument must be %s value UIL_25 found %s %s when expecting %s %s UIL_26 %s %s was never defined UIL_27 %s %s already specified for this %s %s UIL_28 %s item not allowed in %s %s UIL_29 compilation terminated - please fix previous errors UIL_30 internal error - please submit defect report UIL_31 UIL_32 %s missing following \"%s\" option UIL_33 error opening listing file: %s UIL_34 error writing to listing file: %s UIL_35 invalid module structure - check UIL module syntax UIL_36 too many source files open: %s UIL_37 source line contains a null character UIL_38 errors: %d warnings: %d informationals: %d UIL_39 error opening UID file: %s UIL_40 no UID file was produced UIL_41 creation procedure is not supported by the %s widget UIL_42 creation procedure is not allowed in a %s widget reference UIL_43 creation procedure is required in a %s widget declaration UIL_44 a NULL character in a string is not supported UIL_45 widget %s is part of a circular definition UIL_46 no source file specified UIL_47 %s %s supports only a single %s %s UIL_48 %s widget supports only a single control UIL_49 unknown character set UIL_50 place names clause before other module clauses UIL_51 color letter string must be a single character UIL_52 color letter used for prior color in this table UIL_53 row %d must have same width as row 1 UIL_54 row %d, column %d: letter \"%c\" not in color table UIL_55 too many %ss in %s, limit is %d UIL_56 Subqualifier not allowed with negated qualifier UIL_57 %s gadget is not supported - %s widget will be used instead UIL_58 %s type is not valid for %s UIL_59 support for this character set may be removed in a future release UIL_60 the %s constraint is not supported for the %s %s UIL_61 too many \"%s\" options, limit is %d UIL_62 error closing source file: %s UIL_63 the %s value is circularly defined UIL_64 overriding built-in name %s UIL_65 the %s argument does not support enumerated values UIL_66 the %s argument does not support the %s enumerated value UIL_67 $LANG contains an unknown character set UIL_68 the %s object's controls hierarchy contains a reference to itself UIL_69 value %s is too large for context buffer UIL_70 forward referencing is not allowed for %s UIL_71 cannot convert %s type to %s type UIL_72 %s is invalid UIL_V2_73 error reading binary database UIL_V2_74 binary database compiled with a future version UIL_V2_75 error opening database file: %s UIL_V2_76 error writing UID file: %s UIL_V2_77 '%s' is an unknown Toolkit class record name UIL_78 invalid include file name UIL_V2_79 incompatible unit types for arithmetic operation UIL_V2_80 %s used as charset name; %s used as charset component $set UIL_VALUES UIL_VAL_0 ** error ** UIL_VAL_1 ** unknown ** $set UIL_SET_MISC UIL_INF Info: UIL_WAR Warning: UIL_ERR Error: UIL_SEV Severe: UIL_MISC_0 \t\t line: %d file: %s UIL_MISC_1 \t\t line: %d position: %d file: %s motif-2.3.8/clients/uil/UilSarComp.c0000644000175000017500000005144313145162623014211 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilSarComp.c /main/11 1995/07/14 09:36:46 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module supports compound strings in UIL. It includes ** the basic operations for creating, copying, and concatenating ** strings. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #ifdef DXM_V11 #include #endif #include "UilDefI.h" /* ** ** TABLE OF CONTENTS ** **/ /* ** ** DEFINE and MACRO DEFINITIONS ** **/ #define clear_class_mask (~(sym_m_private | sym_m_imported | sym_m_exported)) /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ extern yystype yylval; /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates a null compound string. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** a copy of the primitive string may be made ** **-- **/ sym_value_entry_type *sem_create_cstr() { sym_value_entry_type *az_cstr_entry; az_cstr_entry = (sym_value_entry_type *) sem_allocate_node ( sym_k_value_entry, sym_k_value_entry_size + sizeof( char * ) ); az_cstr_entry->obj_header.b_flags = sym_m_builtin | sym_m_private; az_cstr_entry->b_type = sym_k_compound_string_value; az_cstr_entry->w_length = sizeof (char *); az_cstr_entry->b_direction = NOSTRING_DIRECTION; /* Fix for CN 16149 (DTS 10023) part 1 -- initialize charset info */ az_cstr_entry->b_charset = sym_k_error_charset; az_cstr_entry->az_charset_value = NULL; _sar_save_source_pos (&az_cstr_entry->header, &yylval); return az_cstr_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates a null wide_character string. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** a copy of the primitive string may be made ** **-- **/ sym_value_entry_type *sem_create_wchar_str() { sym_value_entry_type *az_wchar_str_entry; az_wchar_str_entry = (sym_value_entry_type *) sem_allocate_node ( sym_k_value_entry, sym_k_value_entry_size + sizeof( char * ) ); az_wchar_str_entry->obj_header.b_flags = sym_m_builtin | sym_m_private; az_wchar_str_entry->b_type = sym_k_wchar_string_value; az_wchar_str_entry->w_length = sizeof (char *); az_wchar_str_entry->b_direction = NOSTRING_DIRECTION; _sar_save_source_pos (&az_wchar_str_entry->header, &yylval); return az_wchar_str_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function appends a primitive or a localized string to a ** compound string. ** ** FORMAL PARAMETERS: ** ** az_cstr_entry compound string ** az_str_entry primitive string or localized string ** op2_temporary true if op2 is not needed after operation ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** a copy of the primitive string may be made ** **-- **/ void sem_append_str_to_cstr(az_cstr_entry, az_str_entry, op2_temporary) sym_value_entry_type *az_cstr_entry; sym_value_entry_type *az_str_entry; boolean op2_temporary; { sym_value_entry_type *last_str_entry; sym_value_entry_type **ptr; sym_value_entry_type *new_str_entry; boolean merge; /* ** A couple of points: ** 1) if op2_temporary = FALSE - we must make a copy ** of it ** 2) if the last string of the compound string has the same attributes ** as the string being appended, the strings are merged into 1 */ /* find the last string of the compound string */ ptr = &(az_cstr_entry->az_first_table_value); last_str_entry = *ptr; merge = FALSE; if (last_str_entry != NULL) { for ( ; last_str_entry->az_next_table_value != NULL; ptr = (sym_value_entry_type * *) &(last_str_entry->az_next_table_value), last_str_entry = *ptr); if ((last_str_entry->b_charset == az_str_entry->b_charset) && ((last_str_entry->b_direction)== (az_str_entry->b_direction)) && ((last_str_entry->b_aux_flags & sym_m_separate) == 0 )) merge = TRUE; else ptr = (sym_value_entry_type * *) &(last_str_entry->az_next_table_value); } if (merge) { new_str_entry = sem_cat_str_to_str( last_str_entry, TRUE, az_str_entry, op2_temporary ); } else { /* ** Append a new segment to the compound string */ if( op2_temporary == FALSE ) { unsigned short old_size; /* must make a copy since user has access to string via name */ new_str_entry = (sym_value_entry_type *) sem_allocate_node( sym_k_value_entry, az_str_entry->header.w_node_size<<2 ); old_size = new_str_entry->header.w_node_size; _sym_copy_entry( new_str_entry, az_str_entry, az_str_entry->header.w_node_size ); new_str_entry->header.w_node_size = old_size; } else new_str_entry = az_str_entry; } /* link to the end of the compound string */ new_str_entry->b_aux_flags |= sym_m_table_entry; new_str_entry->obj_header.b_flags = sym_m_private | sym_m_builtin; new_str_entry->obj_header.az_name = NULL; new_str_entry->az_next_table_value = NULL; *ptr = new_str_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function appends a compound string to a compound string. ** ** FORMAL PARAMETERS: ** ** az_cstr1_entry compound string ** az_cstr2_entry compound string ** op2_temporary true if op2 is not needed after operation ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sem_append_cstr_to_cstr(az_cstr1_entry, az_cstr2_entry, op2_temporary) sym_value_entry_type *az_cstr1_entry; sym_value_entry_type *az_cstr2_entry; boolean op2_temporary; { sym_value_entry_type *last_str_entry; sym_value_entry_type **ptr; sym_value_entry_type *next_str_entry; /* ** A couple of points: ** 1) if op2_temporary = FALSE - we must make a copy of 2nd compound ** string ** 2) if the last string of 1st compound string has the same attributes ** as the 1st string of the 2nd compound string being appended, ** the strings are merged into 1 */ /* find the last string of the 1st compound string */ ptr = &(az_cstr1_entry->az_first_table_value); last_str_entry = *ptr; next_str_entry = az_cstr2_entry->az_first_table_value; if (op2_temporary) sem_free_node(( sym_entry_type *) az_cstr2_entry ); if (next_str_entry == NULL) return; if (last_str_entry != NULL) { for ( ; last_str_entry->az_next_table_value != NULL; ptr = (sym_value_entry_type * *) &(last_str_entry->az_next_table_value), last_str_entry = *ptr); if ((last_str_entry->b_charset == next_str_entry->b_charset) && ((last_str_entry->b_direction)== (next_str_entry->b_direction)) && ((last_str_entry->b_aux_flags & sym_m_separate) == 0 )) { last_str_entry = sem_cat_str_to_str( last_str_entry, TRUE, next_str_entry, op2_temporary ); last_str_entry->b_aux_flags |= sym_m_table_entry; *ptr = last_str_entry; next_str_entry = (sym_value_entry_type *) next_str_entry->az_next_table_value; } ptr = (sym_value_entry_type * *) &(last_str_entry->az_next_table_value); } if (op2_temporary) { *ptr = next_str_entry; return; } for ( ; next_str_entry != NULL; next_str_entry = (sym_value_entry_type *) next_str_entry->az_next_table_value ) { sym_value_entry_type *new_str_entry; unsigned short old_size; new_str_entry = (sym_value_entry_type *) sem_allocate_node( sym_k_value_entry, next_str_entry->header.w_node_size<<2 ); old_size = new_str_entry->header.w_node_size; _sym_copy_entry( new_str_entry, next_str_entry, next_str_entry->header.w_node_size ); new_str_entry->header.w_node_size = old_size; new_str_entry->obj_header.b_flags = sym_m_private | sym_m_builtin; new_str_entry->obj_header.az_name = NULL; new_str_entry->b_aux_flags |= sym_m_table_entry; /* link to the end of the compound string */ *ptr = new_str_entry; ptr = (sym_value_entry_type * *) &(new_str_entry->az_next_table_value); } *ptr = NULL; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function concatenates 2 primitive strings. ** ** FORMAL PARAMETERS: ** ** az_str1_entry primitive string ** op1_temporary op1 is a temporary string ** az_str2_entry primitive string ** op2_temporary op2 is a temporary string ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** ptr to the result string ** ** SIDE EFFECTS: ** ** none ** **-- **/ sym_value_entry_type *sem_cat_str_to_str (az_str1_entry, op1_temporary, az_str2_entry, op2_temporary) sym_value_entry_type *az_str1_entry; boolean op1_temporary; sym_value_entry_type *az_str2_entry; boolean op2_temporary; { sym_value_entry_type *new_str_entry; int l1, l2; /* ** Can only append two simple strings if they have the same direction and ** the first does not have the separate attribute. */ _assert(((az_str1_entry->b_charset == az_str2_entry->b_charset) && ((az_str1_entry->b_direction) == (az_str2_entry->b_direction)) ), "strings with different attrs concatenated" ); l1 = az_str1_entry->w_length; l2 = az_str2_entry->w_length; /* extra 1 is for terminating null */ new_str_entry = (sym_value_entry_type *) sem_allocate_node( sym_k_value_entry, sym_k_value_entry_size ); new_str_entry->value.c_value = XtCalloc(1, l1 + l2 + 1); new_str_entry->obj_header.b_flags = sym_m_builtin | sym_m_private; _sar_move_source_info_2 (&new_str_entry->header, &az_str1_entry->header); new_str_entry->b_charset = az_str1_entry->b_charset; new_str_entry->b_direction = az_str1_entry->b_direction; new_str_entry->b_aux_flags = (az_str1_entry->b_aux_flags & sym_m_separate); new_str_entry->b_type = sym_k_char_8_value; new_str_entry->w_length = l1 + l2; _move( new_str_entry->value.c_value, az_str1_entry->value.c_value, l1 ); _move( &new_str_entry->value.c_value[ l1 ], az_str2_entry->value.c_value, l2+1 ); /* ** if either of the operands is unnamed - free the node */ if (op1_temporary) { _free_memory( az_str1_entry->value.c_value ); sem_free_node(( sym_entry_type *) az_str1_entry ); } if (op2_temporary) { _free_memory( az_str2_entry->value.c_value ); sem_free_node(( sym_entry_type *) az_str2_entry ); } return new_str_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function takes the charset sets understood by the parser ** and maps them to charsets understood by the symbol table and ** toolkit. ** ** FORMAL PARAMETERS: ** ** charset_as_subclass sym_k_..._charset literal naming charset ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** sym_k...charset name for charset ** ** SIDE EFFECTS: ** ** none ** **-- **/ int sem_map_subclass_to_charset(charset_as_subclass) int charset_as_subclass; { switch (charset_as_subclass) { case lex_k_fontlist_default_tag: case sym_k_fontlist_default_tag: return sym_k_fontlist_default_tag; case lex_k_default_charset: return uil_sym_default_charset; case lex_k_userdefined_charset: return sym_k_userdefined_charset; default: _assert (charset_as_subclass!=0, "charset code==0"); _assert (charset_as_subclass<=uil_max_charset, "unknown charset"); return charset_as_subclass; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function verifies the character set indicated by the user. ** ** FORMAL PARAMETERS: ** ** current_frame current stack frame ** charset_frame stack frame of CHARSET token ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_charset_verify ( charset_frame ) yystype *charset_frame; { key_keytable_entry_type *az_keyword_entry; _assert(((charset_frame->b_tag == sar_k_token_frame) || (charset_frame->b_tag == sar_k_value_frame)), "token or value frame missing" ); az_keyword_entry = charset_frame->value.az_keyword_entry; /* ** Store the current charset so it can be used by LEX to processes a ** string literal (if the CHARSET_NAME is used to prefix a string literal) */ Uil_lex_l_literal_charset = az_keyword_entry->b_subclass; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function converts a random NAME into a CHARSET_NAME ** with the default charset. ** ** FORMAL PARAMETERS: ** ** name_frame current stack frame containing NAME ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** modified name_frame ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** name_frame converted from NAME to CHARSET_NAME ** **-- **/ void sar_make_fallback_charset(name_frame) yystype *name_frame; { sym_name_entry_type *symbol_entry; static key_keytable_entry_type *az_keyword_entry = NULL; _assert(((name_frame->b_tag == sar_k_token_frame) || (name_frame->b_tag == sar_k_value_frame)), "token or value frame missing" ); /* Get symbol and check if already used as charset. */ symbol_entry = (sym_name_entry_type *)name_frame->value.az_symbol_entry; if ((symbol_entry->b_flags & sym_m_charset) == 0) { symbol_entry->b_flags |= sym_m_charset; diag_issue_diagnostic(d_default_charset, _sar_source_pos2(symbol_entry), symbol_entry->c_text, DEFAULT_TAG); } /* Get the default charset keyword entry. */ if (az_keyword_entry == NULL) az_keyword_entry = key_find_keyword(strlen(DEFAULT_TAG), DEFAULT_TAG); _assert((az_keyword_entry !=NULL), "default charset keyword missing"); /* Change NAME to CHARSET_NAME */ name_frame->value.az_keyword_entry = az_keyword_entry; name_frame ->b_type = az_keyword_entry->b_token; /* ** Store the current charset so it can be used by LEX to processes a ** string literal (if the NAME is used to prefix a string literal) */ Uil_lex_l_literal_charset = az_keyword_entry->b_subclass; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function checks the attributes of CHARACTER_SET function. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant token stack frame ** value_frame pointer to frame holding keyword and value ** prior_value_frame pointer to previous properties ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** attribute information is stuffed in target frame ** **-- **/ void sar_chk_charset_attr( target_frame, value_frame, prior_value_frame ) yystype *target_frame; yystype *value_frame; yystype *prior_value_frame; { /* ** Set up not specified values in the target frame. ** b_type will hold the sixteen_bit property */ switch (prior_value_frame->b_tag) { case sar_k_null_frame: /* ** no prior values */ target_frame->b_tag = sar_k_token_frame; target_frame->b_direction = NOSTRING_DIRECTION; target_frame->b_charset = uil_sym_default_charset; target_frame->b_type = 0; break; case sar_k_token_frame: case sar_k_value_frame: /* ** prior values - transfer them */ target_frame->b_tag = sar_k_token_frame; target_frame->b_direction = prior_value_frame->b_direction; target_frame->b_charset = prior_value_frame->b_charset; target_frame->b_type = prior_value_frame->b_type; break; default: _assert( FALSE, "prior value frame missing from stack" ); } /* ** Case on the keyword for the attribute given */ switch (value_frame->b_type) { case RIGHT_TO_LEFT: { sym_value_entry_type *value_entry; value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; /* ** If the value is a boolean, then just set the corresponding mask ** accordingly. */ if (value_entry->b_type == sym_k_bool_value) { if (value_entry->value.l_integer == TRUE) target_frame->b_direction = XmSTRING_DIRECTION_R_TO_L; else target_frame->b_direction = XmSTRING_DIRECTION_L_TO_R; } break; } case SIXTEEN_BIT: { sym_value_entry_type *value_entry; value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; /* ** If the value is a boolean, then just set the corresponding mask ** accordingly. */ if (value_entry->b_type == sym_k_bool_value) { if (value_entry->value.l_integer == TRUE) target_frame->b_type |= sym_m_sixteen_bit; else target_frame->b_type &= ~sym_m_sixteen_bit; } break; } default: _assert( FALSE, "keyword missing from stack" ); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function makes a CHARACTER_SET and sets the properties ** of the string. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant token stack frame ** value_frame pointer to string value ** attr_frame pointer to strings attributes ** keyword_frame frame to use as locator for result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_make_charset (target_frame, value_frame, attr_frame, keyword_frame) yystype *target_frame; yystype *value_frame; yystype *attr_frame; yystype *keyword_frame; { sym_value_entry_type *value_entry; _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing from stack" ); /* ** Set the character set information into the symbol table ** entry for the char_8 string that indentifies the name of this ** userdefined character set. */ value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; value_entry->b_charset = sym_k_userdefined_charset; /* BEGIN HaL fix CR 5547 */ sem_evaluate_value (value_entry); if (value_entry->b_type != sym_k_char_8_value) diag_issue_diagnostic (d_wrong_type, _sar_source_pos2( value_entry ), diag_value_text( value_entry->b_type ), "null-terminated string"); /* END HaL fix CR 5547 */ /* ** If the attr_frame is not null, it must be a value frame with contains ** a pointer to the attributes frame for this userdefined charset. */ if (attr_frame->b_tag == sar_k_token_frame) { /* ** Set the attributes of the string, as specified by the options ** to the CHARACTER_SET function, without disturbing any ** existing bits. */ value_entry->b_direction = attr_frame->b_direction; value_entry->b_aux_flags = (attr_frame->b_type & sym_m_sixteen_bit); } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_char_8_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = value_frame->value.az_symbol_entry; /* ** Store the current charset so it can be used by LEX to processes a ** string literal (if the CHARACTER_SET function is used to prefix a ** string literal) */ Uil_lex_l_literal_charset = lex_k_userdefined_charset; Uil_lex_az_literal_charset = value_entry; } motif-2.3.8/clients/uil/UilSymStor.c0000644000175000017500000011627313145162623014270 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSymStor.c /main/15 1997/03/12 15:21:44 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contains the procedures for managing memory for ** the compiler. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ externaldef(uil_comp_glbl) sym_name_entry_type *sym_az_hash_table[ sym_k_hash_table_limit]; externaldef(uil_comp_glbl) sym_value_entry_type *sym_az_error_value_entry = NULL; externaldef(uil_comp_glbl) sym_external_def_entry_type *sym_az_external_def_chain; externaldef(uil_comp_glbl) sym_forward_ref_entry_type *sym_az_forward_ref_chain; externaldef(uil_comp_glbl) sym_val_forward_ref_entry_type *sym_az_val_forward_ref_chain; externaldef(uil_comp_glbl) sym_module_entry_type *sym_az_module_entry; externaldef(uil_comp_glbl) sym_root_entry_type *sym_az_root_entry; externaldef(uil_comp_glbl) sym_section_entry_type *sym_az_current_section_entry; externaldef(uil_comp_glbl) sym_entry_type *sym_az_entry_list_header; /* * These lists save the allocated and freed symbol table nodes. */ externaldef(uil_comp_glbl) URMPointerListPtr sym_az_allocated_nodes; externaldef(uil_comp_glbl) URMPointerListPtr sym_az_freed_nodes; /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine intializes the compiler's memory allocation system. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** sym_az_last_location ptr to last byte avail for allocation ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** first symbol table buffer is allocated ** **-- **/ void sym_initialize_storage(void) { int i; /* * Initialize the name hash table */ for (i=0; ib_type = sym_k_error_value; sym_az_error_value_entry->obj_header.b_flags = (sym_m_private | sym_m_builtin); sym_az_error_value_entry->obj_header.az_name = sym_insert_name( 9, "#error..."); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine cleans up the compiler's memory allocation system, and ** frees all memory used by the symbol table. ** ** FORMAL PARAMETERS: ** ** freealloc TRUE if allocated nodes are to be freed. ** Otherwise, free only freed nodes. ** ** IMPLICIT INPUTS: ** ** sym_az_entry_list_header ptr to list of symbol entries ** ** IMPLICIT OUTPUTS: ** ** sym_az_entry_list_header ptr to list of symbol entries ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** all symbol table memory is freed. ** **-- **/ void Uil_sym_cleanup_storage (boolean freealloc) { if ( freealloc ) { if ( sym_az_allocated_nodes != NULL ) UrmPlistFreeContents (sym_az_allocated_nodes); else if ( sym_az_freed_nodes != NULL ) UrmPlistFreeContents (sym_az_freed_nodes); } if ( sym_az_allocated_nodes != NULL ) UrmPlistFree (sym_az_allocated_nodes); if ( sym_az_freed_nodes != NULL ) UrmPlistFree (sym_az_freed_nodes); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine adds an object to the external definition chain. ** ** FORMAL PARAMETERS: ** ** az_name name of object to be placed on the chain ** ** IMPLICIT INPUTS: ** ** sym_az_external_def_chain head of the external definition chain ** ** IMPLICIT OUTPUTS: ** ** sym_az_external_def_chain head of the external definition chain ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sym_make_external_def( XmConst sym_name_entry_type *az_name ) { sym_external_def_entry_type *external_entry; /* allocate an external definition entry */ external_entry = (sym_external_def_entry_type *) sem_allocate_node (sym_k_external_def_entry, sym_k_external_def_entry_size); /* fill in the entry */ external_entry->az_name = (sym_name_entry_type *)az_name; /* place on the front of the chain */ external_entry->az_next_object = sym_az_external_def_chain; sym_az_external_def_chain = external_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine adds a reference to the forward reference chain. ** This routine is used for widget and gadget forward references only. ** ** ** FORMAL PARAMETERS: ** ** az_id_frame parse stack frame for id being referenced ** l_widget_type type of object being referenced ** az_object ptr to the location that needs to be updated ** when the object is resolved ** ** IMPLICIT INPUTS: ** ** sym_az_forward_ref_chain head of the forward reference chain ** ** IMPLICIT OUTPUTS: ** ** sym_az_forward_ref_chain head of the forward reference chain ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sym_make_forward_ref(XmConst yystype *az_id_frame, XmConst int l_widget_type, XmConst char *a_location) { sym_forward_ref_entry_type *fwd_ref_entry; _assert( (az_id_frame->b_tag == sar_k_token_frame) && (az_id_frame->value.az_symbol_entry->header.b_tag == sym_k_name_entry), "arg1 not an id frame" ); /* allocate an external definition entry */ fwd_ref_entry = (sym_forward_ref_entry_type *) sem_allocate_node (sym_k_forward_ref_entry, sym_k_forward_ref_entry_size); /* fill in the entry */ _sar_save_source_pos (&fwd_ref_entry->header, az_id_frame); fwd_ref_entry->header.b_type = l_widget_type; fwd_ref_entry->az_name = (sym_name_entry_type *) az_id_frame->value.az_symbol_entry; fwd_ref_entry->a_update_location = (char *)a_location; /* place on the front of the chain */ fwd_ref_entry->az_next_ref = sym_az_forward_ref_chain; sym_az_forward_ref_chain = fwd_ref_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine adds a reference to the values forward reference chain. ** This routine is used for value forward references only. ** ** ** FORMAL PARAMETERS: ** ** az_id_frame parse stack frame for id being referenced ** az_object ptr to the location that needs to be updated ** when the object is resolved ** ** IMPLICIT INPUTS: ** ** sym_az_val_forward_ref_chain head of the forward reference chain ** ** IMPLICIT OUTPUTS: ** ** sym_az_val_forward_ref_chain head of the forward reference chain ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sym_make_value_forward_ref (XmConst yystype *az_value_frame, XmConst char *a_location, XmConst unsigned char fwd_ref_flags ) { sym_val_forward_ref_entry_type *fwd_ref_entry; /* allocate an external definition entry */ fwd_ref_entry = (sym_val_forward_ref_entry_type *) sem_allocate_node (sym_k_val_forward_ref_entry, sym_k_val_forward_ref_entry_size); /* fill in the entry */ _sar_save_source_pos (&fwd_ref_entry->header, az_value_frame); switch (fwd_ref_flags) { case sym_k_patch_add: fwd_ref_entry->az_name = ((sym_value_entry_type *) az_value_frame->value.az_symbol_entry)->obj_header.az_name; break; case sym_k_patch_list_add: fwd_ref_entry->az_name = (sym_name_entry_type *)az_value_frame->value.az_symbol_entry; break; default: _assert(FALSE, "Illegal forward reference"); }; fwd_ref_entry->a_update_location = (char *)a_location; fwd_ref_entry->fwd_ref_flags = fwd_ref_flags; /* place on the front of the chain */ fwd_ref_entry->az_next_ref = sym_az_val_forward_ref_chain; sym_az_val_forward_ref_chain = fwd_ref_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure recursively goes through the symbol table, dumping ** each node accessible from the root node. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbol table is dump with the debug output ** **-- **/ void UilDumpSymbolTable ( sym_entry_type *node_entry ) { sym_value_entry_type *val_node; sym_widget_entry_type *widget_node; sym_module_entry_type *module_node; sym_list_entry_type *list_node; sym_obj_entry_type *list_entry; sym_root_entry_type *root_node; sym_include_file_entry_type *ifile_node; sym_section_entry_type *section_node; /* * No action on null node. Else dump and processing is based on the kind * of the current node. */ if ( node_entry == NULL ) return; sym_dump_symbol (node_entry); switch ( node_entry->header.b_tag ) { case sym_k_value_entry: val_node = (sym_value_entry_type *) node_entry; UilDumpSymbolTable ((sym_entry_type *)val_node->az_charset_value); UilDumpSymbolTable ((sym_entry_type *)val_node->az_first_table_value); UilDumpSymbolTable ((sym_entry_type *)val_node->az_next_table_value); UilDumpSymbolTable ((sym_entry_type *)val_node->az_exp_op1); UilDumpSymbolTable ((sym_entry_type *)val_node->az_exp_op2); break; case sym_k_widget_entry: case sym_k_gadget_entry: case sym_k_child_entry: widget_node = (sym_widget_entry_type *) node_entry; UilDumpSymbolTable ((sym_entry_type *)widget_node->az_callbacks); UilDumpSymbolTable ((sym_entry_type *)widget_node->az_arguments); UilDumpSymbolTable ((sym_entry_type *)widget_node->az_controls); UilDumpSymbolTable ((sym_entry_type *)widget_node->az_create_proc); break; case sym_k_module_entry: module_node = (sym_module_entry_type *) node_entry; UilDumpSymbolTable ((sym_entry_type *)module_node->az_version); UilDumpSymbolTable ((sym_entry_type *)module_node->az_character_set); UilDumpSymbolTable ((sym_entry_type *)module_node->az_case_sense); UilDumpSymbolTable ((sym_entry_type *)module_node->az_def_obj); break; case sym_k_list_entry: /* * Sublists (nested lists) are not processed recursively to * pick up definitions, since all named lists are picked up * in their list sections. We assume no list of interest to * us can possibly be encountered only in a nested list reference. */ list_node = (sym_list_entry_type *) node_entry; for (list_entry=(sym_obj_entry_type *) list_node->obj_header.az_next; list_entry!=NULL; list_entry=(sym_obj_entry_type *) list_entry->obj_header.az_next) UilDumpSymbolTable ((sym_entry_type *)list_entry); break; case sym_k_root_entry: root_node = (sym_root_entry_type *) node_entry; UilDumpSymbolTable ((sym_entry_type *)root_node->module_hdr); UilDumpSymbolTable ((sym_entry_type *)root_node->sections); break; case sym_k_include_file_entry: ifile_node = (sym_include_file_entry_type *) node_entry; UilDumpSymbolTable ((sym_entry_type *)ifile_node->sections); break; case sym_k_section_entry: section_node = (sym_section_entry_type *) node_entry; switch ( section_node->header.b_type ) { case sym_k_section_tail: break; default: UilDumpSymbolTable ((sym_entry_type *)section_node->next); UilDumpSymbolTable ((sym_entry_type *)section_node->entries); break; } break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure dumps the symbol table. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbol table is dump with the debug output ** **-- **/ void sym_dump_symbols( void ) { int ndx; sym_entry_type *cur_entry; /* * Loop over all entries which have been allocated. They are in * allocation order (this will include deleted entries). */ _debug_output( "\nSymbol Table Dump: \n\n" ); for ( ndx=0 ; ndxheader.b_tag) { case sym_k_name_entry: sym_dump_name((sym_name_entry_type *) az_symbol_entry ); break; case sym_k_module_entry: sym_dump_module((sym_module_entry_type *) az_symbol_entry ); break; case sym_k_value_entry: sym_dump_value((sym_value_entry_type *) az_symbol_entry ); break; case sym_k_widget_entry: case sym_k_gadget_entry: case sym_k_child_entry: sym_dump_widget((sym_widget_entry_type *) az_symbol_entry ); break; case sym_k_forward_ref_entry: sym_dump_forward_ref((sym_forward_ref_entry_type *) az_symbol_entry ); break; case sym_k_external_def_entry: sym_dump_external_def((sym_external_def_entry_type *) az_symbol_entry ); break; case sym_k_proc_def_entry: sym_dump_proc_def((sym_proc_def_entry_type *) az_symbol_entry ); break; case sym_k_proc_ref_entry: sym_dump_proc_ref((sym_proc_ref_entry_type *) az_symbol_entry ); break; case sym_k_control_entry: sym_dump_control((sym_control_entry_type *) az_symbol_entry ); break; case sym_k_argument_entry: sym_dump_argument((sym_argument_entry_type *) az_symbol_entry ); break; case sym_k_callback_entry: sym_dump_callback((sym_callback_entry_type *) az_symbol_entry ); break; case sym_k_list_entry: sym_dump_list((sym_list_entry_type *) az_symbol_entry ); break; case sym_k_color_item_entry: sym_dump_color_item((sym_color_item_entry_type *) az_symbol_entry ); break; case sym_k_parent_list_entry: sym_dump_parent_list_item((sym_parent_list_type *) az_symbol_entry ); break; case sym_k_include_file_entry: sym_dump_include_file ((sym_include_file_entry_type *)az_symbol_entry); break; case sym_k_section_entry: sym_dump_section ((sym_section_entry_type *)az_symbol_entry); break; case sym_k_def_obj_entry: sym_dump_object_variant ((sym_def_obj_entry_type *)az_symbol_entry); break; case sym_k_root_entry: sym_dump_root_entry ((sym_root_entry_type *)az_symbol_entry); break; default: { int *l_array; int i; _debug_output("%x unknown type: %d size: %d byte: %x\n", (unsigned)az_symbol_entry, az_symbol_entry->header.b_tag, az_symbol_entry->header.w_node_size, az_symbol_entry->header.b_type ); l_array = (int *) az_symbol_entry->b_value; for (i=0; i<(int)(az_symbol_entry->header.w_node_size-1); i++) _debug_output( "\t%x", l_array[ i ] ); _debug_output("\n"); break; } } sym_dump_source_info(( sym_entry_header_type *)az_symbol_entry); _debug_output("\n"); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps an object entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_widget_entry pointer to the object ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the object appears as part of the ** debug output ** **-- **/ void sym_dump_widget( XmConst sym_widget_entry_type *az_widget_entry ) { sym_dump_obj_header ((sym_obj_entry_type *)az_widget_entry); _debug_output ( " %s %s controls: %x callbacks: %x arguments: %x parent_list: %x\n", diag_object_text( az_widget_entry->header.b_type), diag_tag_text( az_widget_entry->header.b_tag ), (unsigned)az_widget_entry->az_controls, (unsigned)az_widget_entry->az_callbacks, (unsigned)az_widget_entry->az_arguments, (unsigned)az_widget_entry->parent_list); if (az_widget_entry->az_create_proc != NULL) { _debug_output (" create proc: %x\n", (unsigned)az_widget_entry->az_create_proc); } /* preserve comments */ _debug_output ("\n Comment: %s\n", az_widget_entry->obj_header.az_comment); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps an argument entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_argument_entry pointer to the argument ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the name appears as part of the ** debug output ** **-- **/ void sym_dump_argument( XmConst sym_argument_entry_type *az_argument_entry ) { sym_dump_obj_header ((sym_obj_entry_type *)az_argument_entry); _debug_output ( " arg name: %x arg value: %x\n", (unsigned)az_argument_entry->az_arg_name, (unsigned)az_argument_entry->az_arg_value ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a control entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_control_entry pointer to the control ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the name appears as part of the ** debug output ** **-- **/ void sym_dump_control( XmConst sym_control_entry_type *az_control_entry ) { sym_dump_obj_header ((sym_obj_entry_type *)az_control_entry); /* These are for control objects only. */ if (az_control_entry->obj_header.b_flags & sym_m_def_in_progress) { _debug_output (" def in progress"); } if (az_control_entry->obj_header.b_flags & sym_m_managed) { _debug_output (" managed"); } else { _debug_output (" unmanaged"); } _debug_output ( " obj: %x\n", (unsigned)az_control_entry->az_con_obj ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a callback entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_callback_entry pointer to the callback ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the name appears as part of the ** debug output ** **-- **/ void sym_dump_callback( XmConst sym_callback_entry_type *az_callback_entry ) { sym_dump_obj_header ((sym_obj_entry_type *)az_callback_entry); _debug_output ( " reason name: %x proc ref: %x proc ref list: %x\n", (unsigned)az_callback_entry->az_call_reason_name, (unsigned)az_callback_entry->az_call_proc_ref, (unsigned)az_callback_entry->az_call_proc_ref_list ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a list entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_list_entry pointer to the list ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the name appears as part of the ** debug output ** **-- **/ void sym_dump_list( XmConst sym_list_entry_type *az_list_entry ) { sym_dump_obj_header ((sym_obj_entry_type *)az_list_entry); _debug_output ( " type: %s count: %d gadget count: %d\n", diag_tag_text( az_list_entry->header.b_type), az_list_entry->w_count, az_list_entry->w_gadget_count ); /* preserve comments */ _debug_output ("\n Comment: %s\n", az_list_entry->obj_header.az_comment); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a name entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_name_entry pointer to the name ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the name appears as part of the ** debug output ** **-- **/ void sym_dump_name( XmConst sym_name_entry_type *az_name_entry ) { _debug_output ( "%x name size: %d next name: %x object: %x", (unsigned)az_name_entry, az_name_entry->header.w_node_size, (unsigned)az_name_entry->az_next_name_entry, (unsigned)az_name_entry->az_object ); if (az_name_entry->b_flags & sym_m_referenced) { _debug_output (" referenced"); } _debug_output ( " name: %s \n", az_name_entry->c_text ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a module entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_module_entry pointer to the module ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the module appears as part of the ** debug output ** **-- **/ void sym_dump_module( XmConst sym_module_entry_type *az_module_entry ) { _debug_output ( "%x module size: %d name: %x version: %x \n", (unsigned)az_module_entry, az_module_entry->header.w_node_size, (unsigned)az_module_entry->obj_header.az_name, (unsigned)az_module_entry->az_version ); /* preserve comments */ _debug_output ("\n Comment: %s\n", az_module_entry->obj_header.az_comment); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a color item entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_color_item_entry pointer to the color_item ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the color item appears as part of the ** debug output ** **-- **/ void sym_dump_color_item( XmConst sym_color_item_entry_type *az_color_item_entry ) { _debug_output ( "%x color_item size: %d letter: %c index: %d color: %x next: %x\n", (unsigned)az_color_item_entry, az_color_item_entry->header.w_node_size, az_color_item_entry->b_letter, az_color_item_entry->b_index, (unsigned)az_color_item_entry->az_color, (unsigned)az_color_item_entry->az_next ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a parent_list entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_parent_list_item pointer to the parent list entry ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sym_dump_parent_list_item ( XmConst sym_parent_list_type *az_parent_list_item ) { _debug_output ( "%x parent_list size: %d parent: %x next: %x \n", (unsigned)az_parent_list_item, az_parent_list_item->header.w_node_size, (unsigned)az_parent_list_item->parent, (unsigned)az_parent_list_item->next); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps an external definition entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_external_def_entry pointer to the external definition ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the name appears as part of the ** debug output ** **-- **/ void sym_dump_external_def( XmConst sym_external_def_entry_type *az_external_def_entry) { _debug_output ( "%x external def size: %d next external: %x object: %x \n", (unsigned)az_external_def_entry, az_external_def_entry->header.w_node_size, (unsigned)az_external_def_entry->az_next_object, (unsigned)az_external_def_entry->az_name ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a procedure definition entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_proc_def_entry pointer to the procedure definition ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the procedure definition appears as ** part of the debug output ** **-- **/ void sym_dump_proc_def( XmConst sym_proc_def_entry_type *az_proc_def_entry ) { char *private_flag; char *imported_flag; char *exported_flag; char *checking_flag; private_flag = ""; imported_flag = ""; exported_flag = ""; checking_flag = " no-check"; if (az_proc_def_entry->v_arg_checking) checking_flag = " check"; if (az_proc_def_entry->obj_header.b_flags & sym_m_private) private_flag = " private"; if (az_proc_def_entry->obj_header.b_flags & sym_m_exported) exported_flag = " exported"; if (az_proc_def_entry->obj_header.b_flags & sym_m_imported) imported_flag = " imported"; _debug_output ( "%x proc def size: %d name: %x %s%s%s%s count: %d %s\n", (unsigned)az_proc_def_entry, az_proc_def_entry->header.w_node_size, (unsigned)az_proc_def_entry->obj_header.az_name, checking_flag, private_flag, exported_flag, imported_flag, az_proc_def_entry->b_arg_count, diag_value_text( az_proc_def_entry->b_arg_type ) ); /* preserve comments */ _debug_output ("\nComment: %s\n",az_proc_def_entry->obj_header.az_comment); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a procedure reference entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_proc_ref_entry pointer to the procedure reference entry ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the procedure reference appears as ** part of the debug output ** **-- **/ void sym_dump_proc_ref( XmConst sym_proc_ref_entry_type *az_proc_ref_entry ) { sym_dump_obj_header ((sym_obj_entry_type *)az_proc_ref_entry); _debug_output ( "%x proc ref size: %d proc def: %x value: %x\n", (unsigned)az_proc_ref_entry, az_proc_ref_entry->header.w_node_size, (unsigned)az_proc_ref_entry->az_proc_def, (unsigned)az_proc_ref_entry->az_arg_value ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps an forward reference entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_forward_ref_entry pointer to the forward reference ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the name appears as part of the ** debug output ** **-- **/ void sym_dump_forward_ref(XmConst sym_forward_ref_entry_type *az_forward_ref_entry) { _debug_output ( "%x forward ref size: %d next ref: %x location: %x %s parent: %x\n", (unsigned)az_forward_ref_entry, az_forward_ref_entry->header.w_node_size, (unsigned)az_forward_ref_entry->az_next_ref, (unsigned)az_forward_ref_entry->a_update_location, diag_object_text( az_forward_ref_entry->header.b_type ), (unsigned)az_forward_ref_entry->parent ); _debug_output ( " name: %x %s\n", (unsigned)az_forward_ref_entry->az_name, az_forward_ref_entry->az_name->c_text ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function dumps a value entry in the symbol table ** ** FORMAL PARAMETERS: ** ** az_value_entry pointer to the value ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** symbolic representation of the value appears as part of the ** debug output ** **-- **/ void sym_dump_value( XmConst sym_value_entry_type *az_value_entry ) { char *private_flag; char *imported_flag; char *exported_flag; char *builtin_flag; char *special_type, *table_type; private_flag = ""; imported_flag = ""; exported_flag = ""; builtin_flag = ""; if (az_value_entry->obj_header.b_flags & sym_m_builtin) builtin_flag = " builtin"; if (az_value_entry->obj_header.b_flags & sym_m_private) private_flag = " private"; if (az_value_entry->obj_header.b_flags & sym_m_exported) exported_flag = " exported"; if (az_value_entry->obj_header.b_flags & sym_m_imported) imported_flag = " imported"; _debug_output ( "%x value size: %d name: %x %s%s%s%s", (unsigned)az_value_entry, az_value_entry->header.w_node_size, (unsigned)az_value_entry->obj_header.az_name, builtin_flag, private_flag, exported_flag, imported_flag ); if (az_value_entry->obj_header.b_flags & sym_m_imported) { _debug_output( " %s \n", diag_value_text( az_value_entry->b_type )); return; } switch (az_value_entry->b_type) { case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: _debug_output(" integer: %ld \n", az_value_entry->value.l_integer ); break; case sym_k_bool_value: _debug_output(" boolean: %ld \n", az_value_entry->value.l_integer ); break; case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: _debug_output(" double: %g \n", az_value_entry->value.d_real); break; case sym_k_color_value: { char *ptr; switch (az_value_entry->b_arg_type) { case sym_k_background_color: ptr = "background"; break; case sym_k_foreground_color: ptr = "foreground"; break; case sym_k_unspecified_color: ptr = "unspecified"; break; default: ptr = "illegal"; } _debug_output(" color type: %s", ptr ); output_text( az_value_entry->w_length, az_value_entry->value.c_value); break; } case sym_k_reason_value: special_type = "reason"; goto common_special_type; case sym_k_argument_value: special_type = "argument"; common_special_type: _debug_output(" %s", special_type ); if (az_value_entry->obj_header.b_flags & sym_m_builtin) _debug_output(" code: %ld \n", az_value_entry->value.l_integer ); else output_text( az_value_entry->w_length, az_value_entry->value.c_value); break; case sym_k_compound_string_value: _debug_output(" compound string\n first component: %x\n", (unsigned)az_value_entry->az_first_table_value ); if ( (az_value_entry->b_aux_flags & sym_m_table_entry) != 0 ) { _debug_output(" next table entry: %x", (unsigned)az_value_entry->az_next_table_value); } break; case sym_k_font_value: case sym_k_fontset_value: if (az_value_entry->b_charset != sym_k_userdefined_charset) _debug_output(" font charset: %s", diag_charset_text( az_value_entry->b_charset ) ); else _debug_output(" font charset: userdefined(%x)", (unsigned)diag_charset_text( (long)az_value_entry->az_charset_value ) ); goto check_for_table_value; case sym_k_char_8_value: case sym_k_localized_string_value: if (az_value_entry->b_charset != sym_k_userdefined_charset) switch ( az_value_entry->b_direction ) { case XmSTRING_DIRECTION_L_TO_R: _debug_output (" string length: %d\n charset: %s L_TO_R", az_value_entry->w_length, diag_charset_text( az_value_entry->b_charset )); break; case XmSTRING_DIRECTION_R_TO_L: _debug_output (" string length: %d\n charset: %s R_TO_L", az_value_entry->w_length, diag_charset_text( az_value_entry->b_charset )); break; } else switch ( az_value_entry->b_direction ) { case XmSTRING_DIRECTION_L_TO_R: _debug_output (" string length: %d\n charset: userdefined(%x) L_TO_R", az_value_entry->w_length, (unsigned)az_value_entry->az_charset_value); break; case XmSTRING_DIRECTION_R_TO_L: _debug_output (" string length: %d\n charset: userdefined(%x) R_TO_L", az_value_entry->w_length, (unsigned)az_value_entry->az_charset_value); break; } /* See if this is an entry in a table. */ check_for_table_value: if ( (az_value_entry->b_aux_flags & sym_m_table_entry) != 0 ) { _debug_output(" next table entry: %x", (unsigned)az_value_entry->az_next_table_value); } output_text ( az_value_entry->w_length, az_value_entry->value.c_value ); break; case sym_k_identifier_value: _debug_output(" identifier: %s", az_value_entry->value.c_value ); break; case sym_k_icon_value: _debug_output(" icon width: %d height: %d colors: %x rows: %x \n", az_value_entry->value.z_icon->w_width, az_value_entry->value.z_icon->w_height, (unsigned)az_value_entry->value.z_icon->az_color_table, (unsigned)az_value_entry->value.z_icon->az_rows ); break; case sym_k_string_table_value: table_type = "string table"; goto common_table; case sym_k_font_table_value: table_type = "font table"; goto common_table; case sym_k_trans_table_value: table_type = "translation table"; common_table: _debug_output(" %s first table entry: %x\n", table_type, (unsigned)az_value_entry->az_first_table_value); break; case sym_k_color_table_value: { int index; _debug_output(" color_table count: %d max_index: %d \n", az_value_entry->b_table_count, az_value_entry->b_max_index ); for (index = 0; index < (int)az_value_entry->b_table_count; index++) { _debug_output( " letter: %c index: %d color: %x\n", az_value_entry->value.z_color[index].b_letter, az_value_entry->value.z_color[index].b_index, (unsigned)az_value_entry->value.z_color[index].az_color ); } break; } case sym_k_error_value: _debug_output(" error \n"); break; default: _debug_output(" unknown type: %d \n", az_value_entry->b_type ); } /* preserve comments */ _debug_output ("\nComment: %s\n",az_value_entry->obj_header.az_comment); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function will output an arbitrarily long amount of text ** with the debug output. ** ** FORMAL PARAMETERS: ** ** length length of the text ** text pointer to the text ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** text is placed in the debug output ** **-- **/ void output_text(XmConst int length, XmConst char *text) { char c_buffer[ 71 ]; XmConst char *c_ptr; int l_length; l_length = length; _debug_output( "\n" ); for (c_ptr = text; l_length > 0; l_length -= 70, c_ptr += 70) { int last; int i; last = ( l_length > 70)? 70: l_length; _move( c_buffer, c_ptr, last ); for (i=0; iaz_src_rec; if (src_rec != NULL) _debug_output (" Source position: file %d, line %d, columns %d through %d\n", src_rec->b_file_number, src_rec->w_line_number, hdr->b_src_pos, hdr->b_end_pos); else _debug_output (" Src source record not present.\n"); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure dumps the common header of "object" entries. ** ** FORMAL PARAMETERS: ** ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** ** SIDE EFFECTS: ** ** **-- **/ void sym_dump_obj_header (XmConst sym_obj_entry_type *az_obj_entry) { _debug_output ( "%x %s size: %d \n", (unsigned)az_obj_entry, diag_tag_text (az_obj_entry->header.b_tag), az_obj_entry->header.w_node_size); if (az_obj_entry->obj_header.az_name != NULL) { _debug_output (" name: %x", (unsigned)az_obj_entry->obj_header.az_name); } if (az_obj_entry->obj_header.az_reference != NULL) { _debug_output (" reference: %x", (unsigned)az_obj_entry->obj_header.az_reference); } if (az_obj_entry->obj_header.az_next != NULL) { _debug_output (" next: %x", (unsigned)az_obj_entry->obj_header.az_next); } if (az_obj_entry->obj_header.b_flags & sym_m_private) { _debug_output (" private"); } if (az_obj_entry->obj_header.b_flags & sym_m_exported) { _debug_output (" exported"); } if (az_obj_entry->obj_header.b_flags & sym_m_imported) { _debug_output (" imported"); } _debug_output ("\n"); } void sym_dump_include_file ( sym_include_file_entry_type *az_symbol_entry ) { _debug_output ("%x include file file name: %s full file name: %s\n", (unsigned)az_symbol_entry, az_symbol_entry->file_name, az_symbol_entry->full_file_name); } void sym_dump_section ( sym_section_entry_type *az_symbol_entry ) { _debug_output ("%x %s section prev section : %x next section: %x entries: %x\n", (unsigned)az_symbol_entry, sym_section_text(az_symbol_entry->header.b_type), (unsigned)az_symbol_entry->prev_section, (unsigned)az_symbol_entry->next, (unsigned)az_symbol_entry->entries); } void sym_dump_object_variant ( sym_def_obj_entry_type * az_symbol_entry ) { _debug_output ("%x default obj var next: %x object info: %d, variant_info: %d\n", (unsigned)az_symbol_entry, (unsigned)az_symbol_entry->next, az_symbol_entry->b_object_info, az_symbol_entry->b_variant_info); } void sym_dump_root_entry ( sym_root_entry_type *az_symbol_entry ) { _debug_output ( "%x root tag: %d module: %x sections: %x\n module tail: ", (unsigned)az_symbol_entry, az_symbol_entry->header.b_tag, (unsigned)az_symbol_entry->module_hdr, (unsigned)az_symbol_entry->sections); } char * sym_section_text (int b_type) { switch (b_type) { case 0: return ""; case sym_k_list_section: return "list"; case sym_k_procedure_section: return "procedure"; case sym_k_value_section: return "value"; case sym_k_identifier_section: return "identifier"; case sym_k_object_section: return "object"; case sym_k_include_section: return "include"; case sym_k_section_tail: return "tail"; default: return "*unknown*"; } } motif-2.3.8/clients/uil/UilSarObj.c0000644000175000017500000014513513145162623014027 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilSarObj.c /main/14 1995/07/14 09:37:30 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contains the semantic action routines for ** object definitions in the UIL. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** This is a fast algorithm for mapping an integer (_size) to ** 0 _size <= 8 ** 1 8 < _size <= 16 ** 2 16 < _size <= 32 ** 3 32 < _size <= 64 ** 4 64 < _size ** The algorithm is based on the notion that the floating pt representation ** of an integer has an exponent that is the log_base2( int ). ** ** This algorithm is specific to the VAX. An alternate layout of the ** internal represention of a floating pt number could be supplied for ** other architectures. */ #define _compute_node_index( _size, _index ) \ { unsigned short j, k; \ j = (_size); \ if (j <= 8) k = 0; \ else if (j <= 16) k = 1; \ else if (j <= 32) k = 2; \ else if (j <= 64) k = 3; \ else k = 4; \ (_index) = k; \ } /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ extern yystype gz_yynullval; extern yystype yylval; /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine associates the latest comment block ** with the current object frame. RAP ** ** FORMAL PARAMETERS: ** ** object_frame address of the parse stack frame for this ** object. ** ** ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the object frame contains the comment for this object. ** **-- **/ void sar_assoc_comment( object ) sym_obj_entry_type *object; { object->obj_header.az_comment = (char *)_get_memory(strlen(comment_text)+1); strcpy(object->obj_header.az_comment, comment_text); comment_text[0] = '\0'; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine creates the symbol node for the object, and ** saves it in the object frame on the parse stack. ** ** FORMAL PARAMETERS: ** ** object_frame address of the parse stack frame for this ** object. ** ** object_type type literal for this object. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the object frame contains the symbol node for this object. ** **-- **/ void sar_create_object ( yystype *object_frame, unsigned char object_type ) { sym_name_entry_type * name_entry; sym_obj_entry_type * obj_entry; int node_size = 0; yystype * source_frame; source_frame = & yylval; if (object_frame->b_tag != sar_k_null_frame) { /* ** First we check on the name to see if it has been previously used. ** This function returns NULL if name cannot be used. */ name_entry = (sym_name_entry_type *) sem_dcl_name (object_frame); } else { name_entry = NULL; } /* Determine the size of the symbol node to allocate. */ switch (object_type) { case sym_k_gadget_entry: case sym_k_widget_entry: node_size = sym_k_widget_entry_size; break; case sym_k_list_entry: node_size = sym_k_list_entry_size; break; default: _assert (FALSE, "unexpected object type"); break; } /* * Allocate the symbol node, connect it to its name, and save source info */ obj_entry = (sym_obj_entry_type *) sem_allocate_node (object_type, node_size); if (name_entry != NULL) { name_entry->az_object = (sym_entry_type *)obj_entry; obj_entry->obj_header.az_name = (sym_name_entry_type *)name_entry; } _sar_save_source_pos (&obj_entry->header, source_frame ); sar_assoc_comment(obj_entry); /* preserve comments */ /* * Set the definition in progress bit. */ obj_entry->obj_header.b_flags |= sym_m_def_in_progress; /* * Save the symbol node in the object frame. */ object_frame->b_tag = sar_k_object_frame; object_frame->b_type = object_type; object_frame->value.az_symbol_entry = (sym_entry_type *)obj_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine creates the symbol node for the child, and ** saves it in the object frame on the parse stack. ** ** FORMAL PARAMETERS: ** ** object_frame address of the parse stack frame for this ** object. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the object frame contains the symbol node for this child. ** **-- **/ void sar_create_child ( yystype *object_frame ) { sym_obj_entry_type * obj_entry; yystype * source_frame; source_frame = & yylval; /* * Allocate the symbol node, set its type, and save source info */ obj_entry = (sym_obj_entry_type *) sem_allocate_node (sym_k_child_entry, sym_k_widget_entry_size); obj_entry->header.b_type = object_frame->value.az_keyword_entry->b_subclass; _sar_save_source_pos (&obj_entry->header, source_frame ); sar_assoc_comment(obj_entry); /* preserve comments */ /* * Indicate in compress table that this child type is used. */ uil_child_compr[(int)obj_entry->header.b_type] = 1; /* * Set the definition in progress bit. */ obj_entry->obj_header.b_flags |= sym_m_def_in_progress; /* * Save the symbol node in the object frame. */ object_frame->b_tag = sar_k_object_frame; object_frame->b_type = sym_k_child_entry; object_frame->value.az_symbol_entry = (sym_entry_type *)obj_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine creates and links a section node into the symbol table ** ** FORMAL PARAMETERS: ** ** id_frame the token frame with the id for this entry. ** ** IMPLICIT INPUTS: ** ** sym_az_current_section_entry global pointer to the "current" section ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void sar_link_section ( id_frame ) yystype * id_frame; { sym_section_entry_type * section_entry; /* * Allocate a section entry. Link this entry of of the current section list */ section_entry = (sym_section_entry_type *) sem_allocate_node (sym_k_section_entry, sym_k_section_entry_size); section_entry->next = (sym_entry_type *) sym_az_current_section_entry->entries; sym_az_current_section_entry->entries = (sym_entry_type *) section_entry; section_entry->entries = id_frame->value.az_symbol_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine saves the source information about where this ** semi-colon entry ends. ** ** FORMAL PARAMETERS: ** ** semi_frame the token frame for the terminating semi-colon ** for this entry. ** ** IMPLICIT INPUTS: ** ** sym_az_current_section_entry global pointer to the ** "current" section list ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_src_semicolon_pos (semi_frame) yystype * semi_frame; { sym_section_entry_type * section_entry; section_entry = (sym_section_entry_type *) sym_az_current_section_entry->entries; _sar_save_source_pos (§ion_entry->entries->header, semi_frame); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function saves the title end source for lists (i.e. "ARGUMENTS", ** "CALLBACKS", "PROCEDURES", and "CONTROLS"). The source saved here ** should be "}" or posibly an id_ref. ** ** PARAMETERS: ** ** close_frame ptr to token frame for the closing source ** ** IMPLICIT INPUTS: ** ** the "current" list on the frame stack as returned by sem_find_object ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none **-- **/ void sar_save_list_end (close_frame) yystype *close_frame; { sym_list_entry_type * list_entry; yystype * list_frame; /* ** Search the syntax stack for the object frame. */ list_frame = sem_find_object (close_frame - 1); list_entry = (sym_list_entry_type *) list_frame->value.az_symbol_entry; _sar_save_source_pos ( &list_entry->header , close_frame ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function saves the end source for just about any type ** of entry. ** ** PARAMETERS: ** ** close_frame ptr to token frame for the closing source (probably ** a semi-colon). ** ** IMPLICIT INPUTS: ** ** the "current" list on the frame stack as returned by sem_find_object ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none **-- **/ void sar_save_src_entry_end (close_frame, entry_frame) yystype *close_frame; yystype *entry_frame; { sym_entry_type * entry; /* ** Extract the entry from the frame. */ entry = (sym_entry_type *) entry_frame->value.az_symbol_entry; /* ** Case on the type of entry (source gets put in a different spot for ** control entries). */ if (entry->header.b_tag == sym_k_control_entry) { sym_control_entry_type *control_entry = (sym_control_entry_type *)entry; _sar_save_source_pos (&control_entry->az_con_obj->header, close_frame); } /* ** Save the source info in the default place */ _sar_save_source_pos ( &entry->header , close_frame ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine sets flags in the stack entry for the object. ** ** FORMAL PARAMETERS: ** ** current_frame address of the current syntax stack frame ** ** mask mask of flags to be set. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_set_object_flags (yystype *current_frame, unsigned char mask ) { sym_obj_entry_type * obj_entry; yystype * object_frame; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (current_frame - 1); obj_entry = (sym_obj_entry_type *) object_frame->value.az_symbol_entry; /* Set the flags for the object entry. */ obj_entry->obj_header.b_flags |= mask; /* If this is an exported or private object and it has a name, ** make an external entry for it. */ if ((mask & (sym_m_exported | sym_m_private)) && (obj_entry->obj_header.az_name != NULL)) { sym_make_external_def (obj_entry->obj_header.az_name); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine unsets flags in the stack entry for the object. ** ** FORMAL PARAMETERS: ** ** current_frame address of the current syntax stack frame ** ** mask mask of flags to be unset. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_unset_object_flags (yystype *current_frame, unsigned char mask ) { yystype * object_frame; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (current_frame - 1); /* Unset the flags for the object entry. */ object_frame->b_flags &= ~mask; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine sets the type in the stack entry for the (list) object. ** ** FORMAL PARAMETERS: ** ** current_frame address of the current syntax stack frame ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_set_list_type ( current_frame ) yystype * current_frame; { sym_obj_entry_type * obj_entry; yystype * list_frame; /* Search the syntax stack for the list frame. */ list_frame = sem_find_object (current_frame-1); obj_entry = (sym_obj_entry_type *) list_frame->value.az_symbol_entry; /* Set the type for the list entry. */ obj_entry->header.b_type = current_frame->b_type; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine sets the type in the stack entry for the (widget) object. ** ** FORMAL PARAMETERS: ** ** current_frame address of the current syntax stack frame ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_set_object_class ( current_frame ) yystype * current_frame; { sym_obj_entry_type * obj_entry; yystype * object_frame; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (current_frame-1); obj_entry = (sym_obj_entry_type *) object_frame->value.az_symbol_entry; /* Set the type for the object entry. */ obj_entry->header.b_type = current_frame->value.az_keyword_entry->b_subclass; /* ** Indicate in compression table that this object type is used. ** Note that user defined widgets don't get compression code entires. ** We always identify user defined widgets as MrmwcUnknown. */ if ( obj_entry->header.b_type != uil_sym_user_defined_object ) uil_widget_compr[(int)obj_entry->header.b_type] = 1; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine sets the variant in the stack entry for the object. ** ** FORMAL PARAMETERS: ** ** current_frame address of the current syntax stack frame ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_set_object_variant ( current_frame ) yystype * current_frame; { sym_obj_entry_type * obj_entry; yystype * object_frame; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (current_frame - 1); obj_entry = (sym_obj_entry_type *) object_frame->value.az_symbol_entry; /* Set the variant for the object entry. */ switch (current_frame->b_type) { /* Use the module default for this object type. */ case 0: { unsigned int obj_type; /* * Pick up gadget variant (or widget variant) as specified * by the module tables and the gadget variants */ obj_type = obj_entry->header.b_type; if (uil_urm_variant[obj_type] == sym_k_gadget_entry) { obj_entry->obj_header.b_flags |= sym_m_obj_is_gadget; obj_entry->header.b_type = uil_gadget_variants [obj_type]; } break; } case sym_k_widget_entry: break; case sym_k_gadget_entry: { unsigned int obj_type; /* * Check if gadgets are supported for this object type. * If so, change the object type to the matching code for * the widget class which is the gadget. */ obj_type = obj_entry->header.b_type; if (uil_gadget_variants[obj_type] == 0) { yystype * source_frame; source_frame = & yylval; diag_issue_diagnostic (d_gadget_not_sup, _sar_source_position (source_frame ), diag_object_text(obj_type), diag_object_text(obj_type) ); } else { obj_entry->obj_header.b_flags |= sym_m_obj_is_gadget; obj_entry->header.b_type = uil_gadget_variants [obj_type]; } break; } default: _assert (FALSE, "unexpected variant type"); break; } /* ** If this object is a gadget, mark that gadgets of this type have been ** used so we can later assign it a compression code. This is a safety ** set against the actual widget class. */ if ((obj_entry->obj_header.b_flags & sym_m_obj_is_gadget) != 0) uil_widget_compr[(int)obj_entry->header.b_type] = 1; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine finds the object frame on the parse stack. ** ** FORMAL PARAMETERS: ** ** current_frame address of the current parse stack frame. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** address of the parse stack frame for this object. ** ** SIDE EFFECTS: ** ** none ** **-- **/ yystype * sem_find_object ( current_frame ) yystype * current_frame; { yystype * object_frame; object_frame = current_frame; /* Search the syntax stack for the object frame. */ while ( (object_frame->b_tag != sar_k_object_frame) && (object_frame->b_tag != sar_k_module_frame) ) object_frame--; if (object_frame->b_tag != sar_k_object_frame) _assert (FALSE, "missing object frame on the parser stack"); return (object_frame); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes a reference to an object in the ** UIL. The reference may be a forward reference. ** ** FORMAL PARAMETERS: ** ** ref_frame address of the parse stack frame for ** the object reference. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_object_reference ( ref_frame ) yystype * ref_frame; { yystype * obj_frame; sym_obj_entry_type * obj_entry; sym_name_entry_type * ref_name; sym_obj_entry_type * ref_entry; sym_value_entry_type * ref_value; boolean invalid_ref; yystype * source_frame; source_frame = & yylval; /* Search the syntax stack for the object frame. */ obj_frame = sem_find_object (ref_frame - 1); obj_entry = (sym_obj_entry_type *) obj_frame->value.az_symbol_entry; ref_name = (sym_name_entry_type *) ref_frame->value.az_symbol_entry; ref_value = (sym_value_entry_type *) ref_name->az_object; ref_entry = (sym_obj_entry_type *) ref_name->az_object; /* Check if this name was previously defined for a different usage. */ if (ref_entry != NULL) { if ( ref_entry->header.b_tag==sym_k_widget_entry || ref_entry->header.b_tag==sym_k_gadget_entry || ref_entry->header.b_tag==sym_k_child_entry ) invalid_ref = (ref_entry->header.b_tag!=obj_entry->header.b_tag) || ((ref_entry->header.b_type!=obj_entry->header.b_type) && (uil_gadget_variants[(int)ref_entry->header.b_type]!= obj_entry->header.b_type) && (uil_gadget_variants[(int)obj_entry->header.b_type]!= ref_entry->header.b_type)); else invalid_ref = (ref_entry->header.b_tag!=obj_entry->header.b_tag) || (ref_entry->header.b_type!=obj_entry->header.b_type); if ( invalid_ref ) { char * expected_type, * found_type; if (ref_entry->header.b_tag == sym_k_list_entry) found_type = diag_tag_text (ref_entry->header.b_type); else if (ref_entry->header.b_tag == sym_k_widget_entry) found_type = diag_object_text (ref_entry->header.b_type); else if (ref_entry->header.b_tag == sym_k_gadget_entry) found_type = diag_object_text (ref_entry->header.b_type); else if (ref_entry->header.b_tag == sym_k_value_entry) found_type = diag_value_text (((sym_value_entry_type *) ref_entry)->b_type); else found_type = ""; if (obj_entry->header.b_tag == sym_k_list_entry) expected_type = diag_tag_text (obj_entry->header.b_type); else expected_type = diag_object_text (obj_entry->header.b_type); diag_issue_diagnostic ( d_obj_type, _sar_source_position ( source_frame ), found_type, diag_tag_text (ref_entry->header.b_tag), expected_type, diag_tag_text (obj_entry->header.b_tag) ); obj_entry->header.b_tag = sym_k_error_entry; return; } } switch (obj_entry->header.b_tag) { case sym_k_list_entry: { /* Add this entry to the list. A copy of the list will be made. */ if ((ref_value != 0) && ((ref_value->obj_header.b_flags & sym_m_forward_ref) == 0)) { ref_frame->value.az_symbol_entry = (sym_entry_type *)ref_entry; sar_add_list_entry (ref_frame); } else sar_add_forward_list_entry (ref_frame); break; } case sym_k_gadget_entry: case sym_k_widget_entry: { int make_fwd_ref; /* Mark the widget as referenced. */ ref_name->b_flags |= sym_m_referenced; /* Mark the referencing object */ obj_entry->obj_header.b_flags |= sym_m_obj_is_reference; /* Forward references are allowed for widgets or gadgets. */ if (ref_entry == NULL) make_fwd_ref = TRUE; else { /* A widget can reference itself; treat it as a forward reference. */ if (ref_entry->obj_header.b_flags & sym_m_def_in_progress) make_fwd_ref = TRUE; else make_fwd_ref = FALSE; } if (make_fwd_ref) { /* Add forward reference entry for this widget. */ sym_make_forward_ref (ref_frame, obj_entry->header.b_type, (char*)& obj_entry->obj_header.az_reference ); } else { /* Save this reference in the widget. */ obj_entry->obj_header.az_reference = (sym_entry_type *)ref_entry; } break; } default: { _assert (FALSE, "unexpected object reference type"); break; } } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine updates the parent list of every object in the controls ** list(s) for this object. Parent lists are required in order to check ** constraint arguments. ** ** FORMAL PARAMETERS: ** ** control_list_frame address of the parse stack frame for ** the control list. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_update_parent_list ( control_list_frame ) yystype * control_list_frame; { yystype * widget_frame; sym_widget_entry_type * widget_entry; sym_list_entry_type * control_list_entry; /* Search the syntax stack for the widget frame. */ widget_frame = sem_find_object (control_list_frame - 1); widget_entry = (sym_widget_entry_type *) widget_frame->value.az_symbol_entry; _assert (widget_entry->header.b_tag == sym_k_widget_entry || widget_entry->header.b_tag == sym_k_gadget_entry || widget_entry->header.b_tag == sym_k_child_entry, "widget missing from the stack"); /* Get the control_list entry from the widget */ control_list_entry = (sym_list_entry_type *) control_list_frame->value.az_symbol_entry; _assert ((control_list_entry->header.b_tag == sym_k_list_entry || control_list_entry->header.b_tag == sym_k_error_entry), "list entry missing"); /* The control list contains control list entries as well as nested lists, ** which in turn contain list entries and nested lists. ** We need to call a recursive routine to traverse all the entries. */ parent_list_traverse(widget_entry, control_list_entry); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine recursively traverses a control_list. Control lists ** may contain control list entries as well as nested control lists. ** ** This routine also updates the parent list of every object in the ** controls list(s) for this object. Parent lists are required in order ** to check constraint arguments. ** ** FORMAL PARAMETERS: ** ** widget_entry the widget to be entered in lists ** control_list_entry A control_list or nested control list ** ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void parent_list_traverse (widget_entry, control_list_entry) sym_widget_entry_type *widget_entry; sym_list_entry_type *control_list_entry; { sym_obj_entry_type *control_list_member; sym_control_entry_type *control_entry; sym_nested_list_entry_type *nested_control_list_entry; sym_widget_entry_type *control_widget; int found; sym_forward_ref_entry_type *fwd_ref_entry; sym_parent_list_type *parent_node; sym_parent_list_type *parent_ptr; for (control_list_member = (sym_obj_entry_type *)control_list_entry -> obj_header.az_next; control_list_member != NULL; control_list_member = (sym_obj_entry_type *)control_list_member -> obj_header.az_next) { switch (control_list_member->header.b_tag) { case sym_k_nested_list_entry: nested_control_list_entry = (sym_nested_list_entry_type *) control_list_member; /* Begin fixing DTS 9497 */ if(nested_control_list_entry->az_list) parent_list_traverse (widget_entry, nested_control_list_entry->az_list); /* End fixing DTS 9497 */ break; case sym_k_control_entry: control_entry = (sym_control_entry_type *) control_list_member; /* Get a pointer to one of the actual widgets in the control list */ control_widget = control_entry->az_con_obj; /* ** If it's a widget reference, go find it. If you can't find it, it must ** be a forward reference. If so, find the forward reference entry for it ** and update it with a pointer to its parent. */ if ( control_widget-> obj_header.b_flags & sym_m_obj_is_reference) if ( control_widget->obj_header.az_reference == NULL ) { /* Forward reference. Update forward reference entry. */ found = FALSE; for (fwd_ref_entry = sym_az_forward_ref_chain; ((fwd_ref_entry != NULL) && (found == FALSE)); fwd_ref_entry = fwd_ref_entry->az_next_ref) { if (fwd_ref_entry->a_update_location == (char *) & control_widget-> obj_header.az_reference) { found = TRUE; fwd_ref_entry->parent = widget_entry; } } } else { /* A widget reference, but already defined. Go update its entry. */ control_widget = (sym_widget_entry_type *) control_widget->obj_header.az_reference; found = FALSE; for (parent_ptr = control_widget->parent_list; ((parent_ptr != NULL) && (found == FALSE)); parent_ptr = parent_ptr->next) { if (parent_ptr->parent == widget_entry) found = TRUE; } if (found == FALSE) { parent_node = (sym_parent_list_type *) sem_allocate_node (sym_k_parent_list_entry, sym_k_parent_list_size); parent_node->next = control_widget->parent_list; control_widget->parent_list = parent_node; parent_node->parent = widget_entry; } } else { /* An inline widget definition. Go update its entry. */ found = FALSE; for (parent_ptr = control_widget->parent_list; ((parent_ptr != NULL) && (found == FALSE)); parent_ptr = parent_ptr->next) { if (parent_ptr->parent == widget_entry) found = TRUE; } if (found == FALSE) { parent_node = (sym_parent_list_type *) sem_allocate_node (sym_k_parent_list_entry, sym_k_parent_list_size); parent_node->next = control_widget->parent_list; control_widget->parent_list = parent_node; parent_node->parent = widget_entry; } } } } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine saves a widget feature in the widget symbol node. ** ** FORMAL PARAMETERS: ** ** feature_frame address of the parse stack frame for ** the widget feature. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_feature ( feature_frame ) yystype * feature_frame; { yystype * widget_frame; sym_widget_entry_type * widget_entry; sym_entry_type * feature_entry; sym_entry_type * * ptr = NULL; yystype * source_frame; source_frame = & yylval; /* Search the syntax stack for the widget frame. */ widget_frame = sem_find_object (feature_frame - 1); widget_entry = (sym_widget_entry_type *) widget_frame->value.az_symbol_entry; _assert (widget_entry->header.b_tag == sym_k_widget_entry || widget_entry->header.b_tag == sym_k_gadget_entry || widget_entry->header.b_tag == sym_k_child_entry, "widget missing from the stack"); feature_entry = feature_frame->value.az_symbol_entry; _assert ((feature_entry->header.b_tag == sym_k_list_entry || feature_entry->header.b_tag == sym_k_error_entry), "list entry missing"); switch (feature_entry->header.b_type) { case sym_k_argument_entry: ptr = (sym_entry_type * *) & widget_entry->az_arguments; break; case sym_k_control_entry: ptr = (sym_entry_type * *) & widget_entry->az_controls; break; case sym_k_callback_entry: ptr = (sym_entry_type * *) & widget_entry->az_callbacks; break; case sym_k_error_entry: return; default: _assert (FALSE, "unexpected widget feature"); break; } /* Check for duplicate features. */ if (* ptr != NULL) { diag_issue_diagnostic ( d_dup_list, _sar_source_position ( source_frame ), diag_tag_text (feature_entry->header.b_type), diag_tag_text (feature_entry->header.b_tag), diag_object_text (widget_entry->header.b_type), diag_tag_text (widget_entry->header.b_tag) ); return; } /* Save the feature in the widget. */ (* ptr) = feature_entry; /* Clear the feature frame from the stack. */ feature_frame->b_tag = sar_k_null_frame; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes an argument pair for an object. ** ** FORMAL PARAMETERS: ** ** argument_frame address of the parse stack frame for ** the argument reference. ** ** value_frame address of the parse stack frame for ** the argument value. ** ** equals_frame address of the parse stack frame for the ** equals sign. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_argument_pair ( argument_frame, value_frame, equals_frame) yystype * argument_frame; yystype * value_frame; yystype * equals_frame; { yystype * object_frame; sym_argument_entry_type * arg_entry; sym_list_entry_type * list_entry; sym_value_entry_type * val_value_entry; sym_value_entry_type * arg_value_entry; unsigned char actual_tag; yystype * source_frame; source_frame = & yylval; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (argument_frame - 1); list_entry = (sym_list_entry_type *) object_frame->value.az_symbol_entry; _assert (list_entry->header.b_tag == sym_k_list_entry, "list entry missing"); arg_value_entry = (sym_value_entry_type *) argument_frame->value.az_symbol_entry; _assert (arg_value_entry->header.b_tag == sym_k_value_entry, "argument value entry missing"); /* ** Save the source information (?) */ _sar_save_source_info ( &arg_value_entry->header , argument_frame , argument_frame ); val_value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; actual_tag = val_value_entry->header.b_tag; /* Create and fill in the argument node. */ arg_entry = (sym_argument_entry_type *) sem_allocate_node ( sym_k_argument_entry, sym_k_argument_entry_size); /* ** If the argument is a forward reference, we'll patch in the ** address of the the referenced arg between passes. Otherwise, ** just point to the referenced arg node. */ if ((argument_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (argument_frame, (char*)&(arg_entry->az_arg_name), sym_k_patch_add); else arg_entry->az_arg_name = (sym_value_entry_type *) argument_frame->value.az_symbol_entry; /* ** If the argument value is a forward reference, we'll patch in the ** address of the the referenced arg value between passes. Otherwise, ** just point to the referenced arg value node. */ if ((value_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (value_frame, (char*)&(arg_entry->az_arg_value), sym_k_patch_add); else arg_entry->az_arg_value = val_value_entry; argument_frame->b_tag = sar_k_null_frame; argument_frame->value.az_symbol_entry = (sym_entry_type *) arg_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes a reason to procedure or procedure list binding ** for a callback object in UIL. ** ** FORMAL PARAMETERS: ** ** reason_frame address of the parse stack frame for ** the reason reference. ** ** proc_ref_frame address of the parse stack frame for ** the procedure reference. ** ** equals_frame address if the parse stack frame for ** the equals sign. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_reason_binding ( reason_frame, proc_ref_frame, equals_frame ) yystype * reason_frame; yystype * proc_ref_frame; yystype * equals_frame; { yystype * object_frame; sym_callback_entry_type * callback_entry; sym_list_entry_type * list_entry; yystype * source_frame; source_frame = & yylval; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (reason_frame - 1); list_entry = (sym_list_entry_type *) object_frame->value.az_symbol_entry; _assert (list_entry->header.b_tag == sym_k_list_entry, "list entry missing"); /* ** Create and fill in the callback node. */ callback_entry = (sym_callback_entry_type *) sem_allocate_node ( sym_k_callback_entry, sym_k_callback_entry_size); /* ** If the reason is a forward reference, we'll patch in the ** address of the the referenced reason between passes. Otherwise, ** just point to the referenced reason node. */ if ((reason_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (reason_frame, (char*)&(callback_entry->az_call_reason_name), sym_k_patch_add); else callback_entry->az_call_reason_name = (sym_value_entry_type *) reason_frame->value.az_symbol_entry; /* ** Save source information */ /* _sar_save_source_info ( &reason_value_entry->header , reason_frame , ** reason_frame ); */ /* ** Note that proc_ref_frame may point to either a procedure reference ** or to a list of procedure reference nodes */ if ( proc_ref_frame->b_type == sym_k_list_entry) callback_entry->az_call_proc_ref_list = (sym_list_entry_type *) proc_ref_frame->value.az_symbol_entry; else callback_entry->az_call_proc_ref = (sym_proc_ref_entry_type *) proc_ref_frame->value.az_symbol_entry; reason_frame->b_tag = sar_k_null_frame; reason_frame->value.az_symbol_entry = (sym_entry_type *) callback_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes a control clause. ** ** FORMAL PARAMETERS: ** ** managed_frame address of the parse stack frame for ** the managed flag for this control. ** ** item_frame address of the parse stack frame for ** the control item object. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_control_item ( managed_frame, item_frame ) yystype * managed_frame; yystype * item_frame; { yystype * object_frame; sym_control_entry_type * control_entry; sym_list_entry_type * list_entry; yystype * source_frame; source_frame = & yylval; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (managed_frame - 1); list_entry = (sym_list_entry_type *) object_frame->value.az_symbol_entry; _assert (list_entry->header.b_tag == sym_k_list_entry, "list entry missing"); /* Verify that this type of item is allowed on this list. */ if (list_entry->header.b_type != sym_k_control_entry) { diag_issue_diagnostic ( d_list_item, _sar_source_position ( source_frame ), diag_tag_text (sym_k_control_entry), diag_tag_text (list_entry->header.b_type), diag_tag_text (list_entry->header.b_tag) ); return; } /* Create and fill in the control node. */ control_entry = (sym_control_entry_type *) sem_allocate_node ( sym_k_control_entry, sym_k_control_entry_size); control_entry->az_con_obj = (sym_widget_entry_type *) item_frame->value.az_symbol_entry; control_entry->obj_header.b_flags = ( item_frame->b_flags | managed_frame->b_flags ); managed_frame->b_tag = item_frame->b_tag = sar_k_null_frame; managed_frame->value.az_symbol_entry = (sym_entry_type *) control_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes a control clause when an id is created in that ** clause. ** ** FORMAL PARAMETERS: ** ** control_frame address of the parse stack frame for ** the control list. ** ** item_frame address of the parse stack frame for ** the control item id. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_control_widget ( control_frame, item_frame ) yystype * control_frame; yystype * item_frame; { yystype * object_frame; sym_control_entry_type * control_entry; sym_list_entry_type * list_entry; yystype * source_frame; yystype temp_frame; /* ** move the item_frame to the control_frame and ** the control_frame to the null_frame. This is done ** because the item_frame needs to be second in the list */ temp_frame = *item_frame; *item_frame = *control_frame; *control_frame = temp_frame; source_frame = & yylval; /* Search the syntax stack for the object frame. */ object_frame = sem_find_object (control_frame - 1); list_entry = (sym_list_entry_type *) object_frame->value.az_symbol_entry; _assert (list_entry->header.b_tag == sym_k_list_entry, "list entry missing"); /* Verify that this type of item is allowed on this list. */ if (list_entry->header.b_type != sym_k_control_entry) { diag_issue_diagnostic ( d_list_item, _sar_source_position ( source_frame ), diag_tag_text (sym_k_control_entry), diag_tag_text (list_entry->header.b_type), diag_tag_text (list_entry->header.b_tag) ); return; } /* Create and fill in the control node. */ control_entry = (sym_control_entry_type *) sem_allocate_node (sym_k_control_entry, sym_k_control_entry_size); control_entry->az_con_obj = (sym_widget_entry_type *) item_frame->value.az_symbol_entry; control_entry->obj_header.b_flags = item_frame->b_flags; control_frame->b_tag = item_frame->b_tag = sar_k_null_frame; control_frame->value.az_symbol_entry = (sym_entry_type *) control_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine saves the source for a user defined create procedure ** ** FORMAL PARAMETERS: ** ** procedure_frame address of the parse stack frame for ** the text "PROCEDURE". ** ** proc_id_frame address of the parse stack frame for ** the procedure reference. ** ** proc_arg_frame address of the parse stack frame for ** the procedure argument value. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_save_user_proc_ref_src ( procedure_frame, proc_id_frame, proc_arg_frame) yystype * procedure_frame; yystype * proc_id_frame; yystype * proc_arg_frame; { sym_proc_ref_entry_type * proc_ref_entry; proc_ref_entry = (sym_proc_ref_entry_type *)proc_id_frame->value.az_symbol_entry; /* ** If the parameter arg clause was ommitted the source info should be null. ** We want to save the source for the "args" if it is there. */ _sar_save_source_info (& proc_ref_entry->header, procedure_frame, proc_arg_frame ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes a procedure reference. ** ** FORMAL PARAMETERS: ** ** proc_id_frame address of the parse stack frame for ** the procedure reference. ** ** proc_arg_frame address of the parse stack frame for ** the procedure argument value. ** ** context indicates whether this is a callback ** or a user-defined procedure reference. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_process_proc_ref ( proc_id_frame, proc_arg_frame, context ) yystype * proc_id_frame; yystype * proc_arg_frame; int context; { /* Call the common routine to get the procedure reference node, and return it in the stack frame. */ proc_id_frame->value.az_symbol_entry = (sym_entry_type *) sem_reference_procedure ( proc_id_frame, proc_arg_frame, context ); /* If this is the create proc for a user_defined widget, save it in the object node. */ if (context == sym_k_object_proc) { yystype * widget_frame; sym_widget_entry_type * widget_entry; /* Search the syntax stack for the widget frame. NOTE: gadgets can not have creation procedures; the grammar enforces this. */ widget_frame = sem_find_object (proc_id_frame - 1); widget_entry = (sym_widget_entry_type *) widget_frame->value.az_symbol_entry; _assert (widget_entry->header.b_tag == sym_k_widget_entry, "widget missing from the stack"); if (widget_entry->header.b_type != uil_sym_user_defined_object) { yystype * source_frame; source_frame = & yylval; diag_issue_diagnostic (d_create_proc, _sar_source_position ( source_frame ), diag_object_text (widget_entry->header.b_type) ); return; } else { widget_entry->az_create_proc = (sym_proc_ref_entry_type *) proc_id_frame->value.az_symbol_entry; } } return; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine adds an entry to a list. ** ** FORMAL PARAMETERS: ** ** entry_frame address of the parse stack frame for ** the entry to be added to the list. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_add_list_entry ( entry_frame ) yystype * entry_frame; { yystype * list_frame; sym_list_entry_type * list_entry; sym_obj_entry_type * entry_entry; yystype * source_frame; source_frame = & yylval; /* Search the syntax stack for the list frame. */ list_frame = sem_find_object (entry_frame - 1); list_entry = (sym_list_entry_type *) list_frame->value.az_symbol_entry; _assert (list_entry->header.b_tag == sym_k_list_entry, "list entry missing"); entry_entry = (sym_obj_entry_type *) entry_frame->value.az_symbol_entry; /* ** If we are including a list within a list, put a nested list entry ** in the list, and point it to the actual list. */ if (entry_entry->header.b_tag == sym_k_list_entry) { sym_nested_list_entry_type *nested_entry; /* ** If this list is a reference to a previously defined list, ** then use the previously defined list. */ if (entry_entry->obj_header.az_reference != NULL) { entry_entry = (sym_obj_entry_type *) entry_entry->obj_header.az_reference; _assert (entry_entry->header.b_tag == sym_k_list_entry, "entry list entry missing"); } /* ** Create a nested list entry to reference the nested list. This ** becomes the entry which will be added to the current list. */ nested_entry = (sym_nested_list_entry_type *) sem_allocate_node (sym_k_nested_list_entry, sym_k_nested_list_entry_size); nested_entry->header.b_type = entry_entry->header.b_type; nested_entry->az_list = (sym_list_entry_type *) entry_entry; entry_entry = (sym_obj_entry_type *) nested_entry; } else if (entry_entry->header.b_tag == sym_k_name_entry) { sym_nested_list_entry_type *nested_entry; /* ** This is a forward reference to a named, nested list. */ nested_entry = (sym_nested_list_entry_type *) sem_allocate_node (sym_k_nested_list_entry, sym_k_nested_list_entry_size); sym_make_value_forward_ref (entry_frame, (char*)&(nested_entry->az_list), sym_k_patch_list_add); entry_entry = (sym_obj_entry_type *) nested_entry; } /* ** Add the entry to front of the list ** The nested entry created above is included in this processing. */ entry_entry->obj_header.az_next = (sym_entry_type *) list_entry->obj_header.az_next; list_entry->obj_header.az_next = (sym_entry_type *) entry_entry; list_entry->w_count++; entry_frame->b_tag = sar_k_null_frame; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine adds a forward referenced list entry to a list. ** ** ** FORMAL PARAMETERS: ** ** entry_frame address of the parse stack frame for ** the entry to be added to the list. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** none ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_add_forward_list_entry ( entry_frame ) yystype * entry_frame; { yystype * list_frame; sym_list_entry_type * list_entry; sym_obj_entry_type * entry_entry; sym_name_entry_type * name_entry; yystype * source_frame; sym_nested_list_entry_type *nested_entry; source_frame = & yylval; /* Search the syntax stack for the list frame. */ list_frame = sem_find_object (entry_frame - 1); list_entry = (sym_list_entry_type *) list_frame->value.az_symbol_entry; _assert (list_entry->header.b_tag == sym_k_list_entry, "list entry missing"); name_entry = (sym_name_entry_type *) entry_frame->value.az_symbol_entry; nested_entry = (sym_nested_list_entry_type *) sem_allocate_node (sym_k_nested_list_entry, sym_k_nested_list_entry_size); sym_make_value_forward_ref (entry_frame, (char*)&(nested_entry->az_list), sym_k_patch_list_add); entry_entry = (sym_obj_entry_type *) nested_entry; /* ** Add the entry to front of the list ** The nested entry created above is included in this processing. */ entry_entry->obj_header.az_next = (sym_entry_type *) list_entry->obj_header.az_next; list_entry->obj_header.az_next = (sym_entry_type *) entry_entry; list_entry->w_count++; entry_frame->b_tag = sar_k_null_frame; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine verifies that the list or widget has been defined ** correctly. Virtually all such validation is actually done in pass 2. ** ** FORMAL PARAMETERS: ** ** current_frame address of the current syntax stack frame ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_verify_object ( current_frame ) yystype * current_frame; { yystype * obj_frame; sym_widget_entry_type * widget_entry; unsigned int widget_type; sym_obj_entry_type * obj_entry; yystype * source_frame; /* * Search the syntax stack for the object frame. */ source_frame = & yylval; obj_frame = sem_find_object (current_frame - 1); obj_entry = (sym_obj_entry_type *) obj_frame->value.az_symbol_entry; switch (obj_entry->header.b_tag) { case sym_k_gadget_entry: case sym_k_widget_entry: /* * Clear the definition in progress bit. */ _assert (obj_entry->obj_header.b_flags & sym_m_def_in_progress, "widget definition not in progress"); obj_entry->obj_header.b_flags &= (~ sym_m_def_in_progress); break; case sym_k_list_entry: /* * Clear the definition in progress bit and return. */ _assert (obj_entry->obj_header.b_flags & sym_m_def_in_progress, "list definition not in progress"); obj_entry->obj_header.b_flags &= (~ sym_m_def_in_progress); return; case sym_k_error_entry: return; default: _assert (FALSE, "list or widget missing from the stack"); break; } /* * If this is a user_defined widget, be sure the create proc was * specified if this is a declaration, and not specified if it * is a reference. */ widget_entry = (sym_widget_entry_type *) obj_entry; widget_type = widget_entry->header.b_type; if (widget_type == uil_sym_user_defined_object) { if ((widget_entry->obj_header.b_flags & sym_m_obj_is_reference) != 0) { if (widget_entry->az_create_proc != NULL) { diag_issue_diagnostic (d_create_proc_inv, _sar_source_pos2(widget_entry), diag_object_text (widget_type) ); widget_entry->header.b_type = sym_k_error_object; } } else { if (widget_entry->az_create_proc == NULL) { diag_issue_diagnostic (d_create_proc_req, _sar_source_pos2(widget_entry), diag_object_text (widget_type) ); widget_entry->header.b_type = sym_k_error_object; } } } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine allocates a symbol node of the specified size ** and type. ** ** FORMAL PARAMETERS: ** ** node_tag tag of node to allocate ** node_size size of node to allocate ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** ** FUNCTION VALUE: ** ** the address of the allocated node ** ** SIDE EFFECTS: ** ** The node is saved in the allocated node list ** **-- **/ sym_entry_type * sem_allocate_node (unsigned char node_tag, unsigned short node_size ) { sym_entry_type * node_ptr; node_ptr = (sym_entry_type *) XtCalloc (1, node_size); node_ptr->header.w_node_size = node_size; node_ptr->header.b_tag = node_tag; UrmPlistAppendPointer (sym_az_allocated_nodes, (XtPointer)node_ptr); return node_ptr; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine puts a symbol node on the free node list. ** ** FORMAL PARAMETERS: ** ** node_ptr address of node to put on the free list ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void sem_free_node ( node_ptr ) sym_entry_type * node_ptr; { UrmPlistAppendPointer (sym_az_freed_nodes, (XtPointer)node_ptr); } motif-2.3.8/clients/uil/UilP2Out.c0000644000175000017500000027530213145162623013620 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilP2Out.c /main/15 1997/03/12 15:17:24 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contain the routines for creating the UID file. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #ifdef DXM_V11 #include #endif #include "UilDefI.h" #include "UilSymGen.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ #ifdef WORD64 #define _shift 3 #else #define _shift 2 #endif #define initial_context_size 2048 /* alpha port note: the original define makes some assumptions on the sizes of the structures when calculating this value. I 'think' I have devined the intent of this and have replaced it with a more generic calculation. */ #define out_k_last_offset \ (((src_k_max_source_line_length +1) / sizeof(sym_entry_type *))) /* #define out_k_last_offset ((sizeof( src_source_buffer_type )>>_shift)-2) */ typedef struct _out_queue_type { struct _out_queue_type *az_prior_queue; sym_entry_type *entry[out_k_last_offset + 1]; } out_queue_type; /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ char *_get_memory(); void _free_memory(); /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ externaldef(uil_comp_glbl) IDBFile out_az_idbfile_id; static URMResourceContext *out_az_context; static out_queue_type *out_az_queue; static int out_l_next_offset; static UidCompressionTable *extern_arg_compr; static UidCompressionTable *extern_class_compr; /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function begins the process of creating the UID file. It ** handles: ** 1) creating the UID file and closing it ** 2) initializing the queue of other objects to be processed ** 3) creating the module widget ** 4) emitting exported literals and procedures ** 5) creating the compression code table for this UID file ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** sym_az_external_def_chain list of exported object ** src_az_avail_source_buffer use source buffers for queue of objects ** requiring further attention ** ** IMPLICIT OUTPUTS: ** ** src_az_avail_source_buffer ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** UID file is created ** **-- **/ void sem_output_uid_file() { sym_external_def_entry_type *ext_entry; char *module_version; char *module_name; status urm_status; sym_entry_type *symbol_entry; int topmost_widget_count; int topmost_index; struct { MrmOsOpenParam os_param; char result_file[256]; } uid_fcb; /* ** No UID file is created if any error severity message has ** been emitted. */ if (uil_l_compile_status >= uil_k_error_status) { diag_issue_diagnostic( d_no_uid, diag_k_no_source, diag_k_no_column ); return; } /* ** Request URM hold error message and report via status rather ** that sending them to stdout. This permits the compiler to ** deal with the messages as it does with others. */ urm_status = Urm__UT_SetErrorReport( URMErrOutMemory ); if( urm_status != MrmSUCCESS) issue_urm_error( "allocating context" ); /* ** Open the UID file */ uid_fcb.os_param.version = MrmOsOpenParamVersion; /* clobber flag lets a.uid replace an existing a.uid */ uid_fcb.os_param.nam_flg.clobber_flg = TRUE; module_version = ""; module_name = sym_az_module_entry->obj_header.az_name->c_text; if (sym_az_module_entry->az_version != NULL) module_version = sym_az_module_entry->az_version->value.c_value; urm_status = UrmIdbOpenFileWrite ( Uil_cmd_z_command.ac_resource_file, & uid_fcb.os_param, _host_compiler, _compiler_version, module_name, module_version, &out_az_idbfile_id, uid_fcb.result_file ); if (urm_status != MrmSUCCESS) { diag_issue_diagnostic( d_uid_open, diag_k_no_source, diag_k_no_column, uid_fcb.result_file ); return; } /* ** Set the name of the file we are accessing as the current file and call ** the Status callback routine to report our progress. */ Uil_current_file = uid_fcb.result_file; if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL) diag_report_status(); /* ** Create a context */ urm_status = UrmGetResourceContext ( _get_memory, _free_memory, initial_context_size, &out_az_context ); if( urm_status != MrmSUCCESS) issue_urm_error( "allocating context" ); /* ** Initialize queue of objects to be processed. */ out_l_next_offset = 0; out_az_queue = (out_queue_type *)src_az_avail_source_buffer; out_az_queue->az_prior_queue = NULL; src_az_avail_source_buffer = src_az_avail_source_buffer->az_prior_source_buffer; /* ** Count the number of topmost widgets by scanning the external list. ** A topmost widget is one that is not referenced. */ topmost_widget_count = 0; for (ext_entry = sym_az_external_def_chain; ext_entry != NULL; ext_entry = ext_entry->az_next_object) { symbol_entry = ext_entry->az_name->az_object; if (symbol_entry->header.b_tag == sym_k_widget_entry) if ((((sym_widget_entry_type *)symbol_entry)-> obj_header.az_name->b_flags & sym_m_referenced) == 0) topmost_widget_count++; } /* ** Initialize the context to build the interface module. */ urm_status = UrmIFMInitModule ( out_az_context, topmost_widget_count, URMaPublic, FALSE ); if( urm_status != MrmSUCCESS) issue_urm_error( "initializing module" ); /* ** Create the compression code table for use with this UID file. */ create_int_compression_codes(); /* ** Exported objects are on a chain that we will now walk. ** They can be of 3 types: widgets, gadgets and values. ** Values, gadgets and widgets are pushed on LIFO queue and processed ** shortly. ** Each widget on the list is top most if it is not referenced. Topmost ** widgets are added to the current context for the interface module. */ topmost_index = 0; for (ext_entry = sym_az_external_def_chain; ext_entry != NULL; ext_entry = ext_entry->az_next_object) { /* ** Call the Status callback routine to report our progress. */ /* %COMPLETE */ Uil_percent_complete=CEIL( 80+ (.20 *((float)topmost_index/(float)(topmost_widget_count+.5)))*100, 80); if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL) diag_report_status(); symbol_entry = ext_entry->az_name->az_object; switch (symbol_entry->header.b_tag) { case sym_k_value_entry: { sym_value_entry_type *value_entry; value_entry = (sym_value_entry_type *)symbol_entry; value_entry->output_state = sym_k_queued; push( (sym_entry_type *)value_entry ); break; } case sym_k_gadget_entry: case sym_k_widget_entry: { sym_widget_entry_type *widget_entry; widget_entry = (sym_widget_entry_type *)symbol_entry; if ((widget_entry->obj_header.az_name->b_flags & sym_m_referenced) == 0) { widget_entry->output_state = sym_k_queued; push((sym_entry_type *) widget_entry ); urm_status = UrmIFMSetTopmost ( out_az_context, topmost_index, widget_entry->obj_header.az_name->c_text ); if( urm_status != MrmSUCCESS) issue_urm_error( "adding topmost widget" ); topmost_index++; } break; } default: _assert( FALSE, "unexpected entry on external chain"); break; } } /* ** Emit the Interface Module */ urm_status = UrmIFMPutModule ( out_az_idbfile_id, module_name, out_az_context ); if( urm_status != MrmSUCCESS) { if (urm_status == MrmEOF) diag_issue_diagnostic ( d_uid_write, diag_k_no_source, diag_k_no_column, Uil_current_file ); else issue_urm_error( "emitting module" ); } if (Uil_cmd_z_command.v_show_machine_code) { save_module_machine_code ( src_az_module_source_record, out_az_context ); } /* ** Start to process the widgets that have been pushed on ** the queue. */ for (symbol_entry = pop(); symbol_entry != NULL; symbol_entry = pop() ) { /* ** Call the Status callback routine to report our progress. */ if (Uil_cmd_z_command.status_cb != (Uil_continue_type(*)())NULL) diag_report_status(); switch (symbol_entry->header.b_tag) { case sym_k_value_entry: out_emit_value(( sym_value_entry_type *) symbol_entry ); break; case sym_k_widget_entry: case sym_k_gadget_entry: case sym_k_child_entry: out_emit_widget(( sym_widget_entry_type *) symbol_entry ); break; default: _assert( FALSE, "unexpected entry popped during output"); break; } } create_ext_compression_codes (); /* ** Close the UID file - if there are errors don't keep the file */ urm_status = (uil_l_compile_status < uil_k_error_status); if (!urm_status) { diag_issue_diagnostic ( d_no_uid, diag_k_no_source, diag_k_no_column ); } urm_status = UrmIdbCloseFile( out_az_idbfile_id, urm_status ); out_az_idbfile_id = NULL; if( urm_status != MrmSUCCESS) diag_issue_diagnostic ( d_uid_write, diag_k_no_source, diag_k_no_column, Uil_current_file ); /* ** Free the context */ urm_status = UrmFreeResourceContext( out_az_context ); if( urm_status != MrmSUCCESS) issue_urm_error( "freeing context" ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function pushes a symbol table entry into a LIFO queue. ** ** FORMAL PARAMETERS: ** ** sym_entry pointer to symbol table to push ** ** IMPLICIT INPUTS: ** ** out_l_next_offset next offset in current queue ** out_az_queue current queue ** src_az_avail_source_buffer ** next available queue buffer ** ** IMPLICIT OUTPUTS: ** ** same as inputs ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** argument is placed on a queue ** **-- **/ void push(sym_entry) sym_entry_type *sym_entry; { out_queue_type *next_queue; /* ** We reuse source buffers for the output queues. */ if (out_l_next_offset > out_k_last_offset) { if (src_az_avail_source_buffer == NULL) { src_az_avail_source_buffer = (src_source_buffer_type *) _get_memory( sizeof( src_source_buffer_type ) ); src_az_avail_source_buffer->az_prior_source_buffer = NULL; } next_queue = (out_queue_type *)src_az_avail_source_buffer; src_az_avail_source_buffer = src_az_avail_source_buffer->az_prior_source_buffer; next_queue->az_prior_queue = out_az_queue; out_az_queue = next_queue; out_l_next_offset = 0; } out_az_queue->entry[out_l_next_offset] = sym_entry; out_l_next_offset++; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function pops a symbol table entry from a LIFO queue. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** out_l_next_offset next offset in current queue ** out_az_queue current queue ** src_az_avail_source_buffer ** next available queue buffer ** ** IMPLICIT OUTPUTS: ** ** same as inputs ** ** FUNCTION VALUE: ** ** sym_entry pointer to symbol table popped ** NULL when no more to pop ** ** SIDE EFFECTS: ** ** none ** **-- **/ sym_entry_type *pop() { src_source_buffer_type *avail_buffer; out_l_next_offset--; if (out_l_next_offset < 0) { avail_buffer = (src_source_buffer_type *)out_az_queue; out_az_queue = out_az_queue->az_prior_queue; avail_buffer->az_prior_source_buffer = src_az_avail_source_buffer; src_az_avail_source_buffer = avail_buffer; if (out_az_queue == NULL) return NULL; out_l_next_offset = out_k_last_offset; } return out_az_queue->entry[out_l_next_offset]; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds the URM record for a widget. ** ** FORMAL PARAMETERS: ** ** widget_entry symbol table pointer for a widget ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** write a widget record to UID file ** push other objects on the queue to be processed ** **-- **/ void out_emit_widget( widget_entry ) sym_widget_entry_type *widget_entry; { char buffer[32]; char *widget_name; char *widget_class_name; unsigned int widget_class; unsigned long widget_variety; int arg_count; int related_arg_count; int arglist_index; sym_list_entry_type *list_entry; MrmCode access_code; status urm_status; MrmCode subtree_code; sym_control_entry_type *subtree_control; _assert( (widget_entry->header.b_tag == sym_k_widget_entry) || (widget_entry->header.b_tag == sym_k_gadget_entry) || (widget_entry->header.b_tag == sym_k_child_entry), "object to be emitted is not an object" ); _assert( (widget_entry->obj_header.b_flags & (sym_m_exported | sym_m_private)), "object being emitted is not exported or private" ); if (widget_entry->header.b_tag == sym_k_child_entry) widget_variety = UilMrmAutoChildVariety; else widget_variety = UilMrmWidgetVariety; /* * Each real widget needs a name. Automatic children just get an * empty string since the name is stored in the compression tables. * For real widgets, we use the user provided name * if there is one; otherwise widgetfile#-line#-col# * For example, widget-1-341-111 was defined in file=1, line=341 * and column=11 */ if (widget_variety == UilMrmAutoChildVariety) widget_name = ""; else if (widget_entry->obj_header.az_name == NULL) { sprintf(buffer, "widget-%d-%d-%d", widget_entry->header.az_src_rec->b_file_number, widget_entry->header.az_src_rec->w_line_number, widget_entry->header.b_src_pos); widget_name = buffer; } else widget_name = widget_entry->obj_header.az_name->c_text; access_code = URMaPublic; if (widget_entry->obj_header.b_flags & sym_m_private) access_code = URMaPrivate; urm_status = UrmCWRInit (out_az_context, widget_name, access_code, FALSE); if( urm_status != MrmSUCCESS) issue_urm_error( "initializing context" ); /* ** Set the class of the widget. */ widget_class_name = NULL; arg_count = 0; related_arg_count = 0; subtree_control = NULL; /* ** Special processing 1: User defined widgets have the class as ** creation routine */ if ( widget_entry->header.b_type == uil_sym_user_defined_object ) { widget_class_name = widget_entry->az_create_proc->az_proc_def->obj_header.az_name->c_text; } /* ** Special processing 2. Widgets which map their (single) control to ** a (subtree) resource. This handles the convention (originally invented ** for the pulldown menu which is the child of a cascade button) that ** subtrees which must be instantiated to serve as a resource value are ** treated as children rather than as widget references. Multiple ** children issue a diagnostic. */ subtree_code = uil_urm_subtree_resource[(int)widget_entry->header.b_type]; if ( subtree_code != 0 ) { int count; list_entry = widget_entry->az_controls; count = 0; extract_subtree_control (list_entry, &subtree_control, &count); switch ( count ) { case 0: break; case 1: arg_count += 1; break; default: arg_count += 1; diag_issue_diagnostic (d_single_control, _sar_source_pos2(subtree_control), diag_object_text(widget_entry->header.b_type)); break; } } /* * Set the class in the widget record */ if (widget_variety == UilMrmAutoChildVariety) widget_class = uil_child_compr[(int)widget_entry->header.b_type]; else widget_class = uil_widget_compr[(int)widget_entry->header.b_type]; /* * User defined widgets don't get compressed. */ if (widget_entry->header.b_type == uil_sym_user_defined_object) widget_class = MrmwcUnknown; urm_status = UrmCWRSetClass( out_az_context, widget_class, widget_class_name, widget_variety ); if( urm_status != MrmSUCCESS) issue_urm_error( "setting class" ); /* ** Check the callback list for the creation reason and process it. ** Do this first since it affects arg_count. */ list_entry = widget_entry->az_callbacks; if (list_entry != NULL) { sym_callback_entry_type *callback_entry; arg_count += compute_list_size (list_entry, sym_k_callback_entry); callback_entry = NULL; extract_create_callback (list_entry, &callback_entry); if ( callback_entry != NULL ) { arglist_index = 0; emit_callback (callback_entry, &arglist_index, TRUE); arg_count -= 1; } } /* ** Output the list of arguments. Arguments are either callbacks ** or arguments. */ if (widget_entry->az_arguments != NULL) arg_count += compute_list_size (widget_entry->az_arguments, sym_k_argument_entry); if (arg_count > 0) { urm_status = UrmCWRInitArglist( out_az_context, arg_count ); if( urm_status != MrmSUCCESS) issue_urm_error( "initializing arglist" ); arglist_index = arg_count - 1; /* ** Process the callbacks, then the arguments */ process_all_callbacks (widget_entry->az_callbacks, &arglist_index); process_all_arguments (widget_entry->az_arguments, &arglist_index, &related_arg_count); /* ** Process a control which is to be entered as a subtree resource. Mark ** the control so it won't be processed again. */ if (subtree_control != NULL) { MrmCode widget_access; MrmCode widget_form; char *widget_index; MrmResource_id widget_id; urm_status = UrmCWRSetCompressedArgTag (out_az_context, arglist_index, uil_arg_compr[subtree_code], 0); if( urm_status != MrmSUCCESS) issue_urm_error( "setting compressed arg" ); widget_form = ref_control( subtree_control, &widget_access, &widget_index, &widget_id ); urm_status = UrmCWRSetArgResourceRef (out_az_context, arglist_index, widget_access, URMgWidget, RGMwrTypeSubTree, widget_form, widget_index, widget_id ); if( urm_status != MrmSUCCESS) issue_urm_error( "setting arg reference" ); subtree_control->header.b_tag = sym_k_error_entry; arglist_index++; } } /* ** Process controls */ list_entry = widget_entry->az_controls; if (list_entry != NULL) { int widget_index; /* ** The list of controls is in reverse order. To correct for ** this, controls are placed in the list from bottom to top. ** Thus widget_index represent the last slot in the list used. */ widget_index = compute_list_size (list_entry, sym_k_control_entry); if (widget_index > 0) { urm_status = UrmCWRInitChildren (out_az_context, widget_index ); if ( urm_status != MrmSUCCESS) issue_urm_error( "initializing children" ); process_all_controls (list_entry, &widget_index); } } /* ** If we have any related arguments, report the number. */ if (related_arg_count > 0) UrmCWRSetExtraArgs( out_az_context, related_arg_count ); /* ** Emit the widget record to UID file ** All widgets are indexed as long as they are named. This is so ** they can be included in module interface structure. */ if (widget_entry->obj_header.az_name == NULL) { if (widget_entry->resource_id == 0 ) { urm_status = UrmIdbGetResourceId ( out_az_idbfile_id, &(widget_entry->resource_id) ); if( urm_status != MrmSUCCESS) issue_urm_error( "obtaining resource id" ); } urm_status = UrmPutRIDWidget (out_az_idbfile_id, widget_entry->resource_id, out_az_context ); } else urm_status = UrmPutIndexedWidget (out_az_idbfile_id, widget_name, out_az_context ); if( urm_status != MrmSUCCESS) { if (urm_status == MrmEOF) diag_issue_diagnostic ( d_uid_write, diag_k_no_source, diag_k_no_column, Uil_current_file ); else issue_urm_error( "emitting widget" ); } if (Uil_cmd_z_command.v_show_machine_code) { save_widget_machine_code (widget_entry, out_az_context); } widget_entry->output_state = sym_k_emitted; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine extracts the controlled widget (top-level) from ** a controls list for subtree resources (those whose subtree must ** be instantiated as part of parent creation, but which are ** implemented as resources, not children). It returns the count of ** the number of such entries found, and a pointer to the last one ** encountered. ** ** FORMAL PARAMETERS: ** ** list_entry the list to be (recursively) searched ** menu_entry to return a ponter to the pulldown menu ** count counts the number of entries found ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void extract_subtree_control (list_entry, menu_entry, count) sym_list_entry_type *list_entry; sym_control_entry_type **menu_entry; int *count; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_control_entry_type *control_entry; /* * Process the list elements, recursing on nested lists. Ignore error entries. */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; extract_subtree_control (nested_list_entry->az_list, menu_entry, count); break; case sym_k_control_entry: control_entry = (sym_control_entry_type *) list_member; *count += 1; *menu_entry = control_entry; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine searches a callbacks list (and any nested lists) ** for the create callback. ** ** FORMAL PARAMETERS: ** ** list_entry the list to be (recursively) searched ** create_entry to return a pointer to the create entry ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void extract_create_callback (list_entry, create_entry) sym_list_entry_type *list_entry; sym_callback_entry_type **create_entry; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_callback_entry_type *callback_entry; sym_value_entry_type *value_entry; key_keytable_entry_type *key_entry; /* * Process the list elements, recursing on nested lists. Ignore error entries. */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; extract_create_callback (nested_list_entry->az_list, create_entry); break; case sym_k_callback_entry: callback_entry = (sym_callback_entry_type *) list_member; value_entry = callback_entry->az_call_reason_name; if (value_entry->obj_header.b_flags & sym_m_builtin) { key_entry = (key_keytable_entry_type *)value_entry->value.l_integer; if ( strcmp(uil_reason_toolkit_names[key_entry->b_subclass], MrmNcreateCallback) == 0 ) { *create_entry = callback_entry; return; } } break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes all valid callbacks in an callbacks list, ** recursing on nested lists. Each valid callback is emitted to ** the output. ** ** FORMAL PARAMETERS: ** ** list_entry the list to be (recursively) processed ** arglist_index the modifiable index of arguments in the ** output argslist. ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void process_all_callbacks (list_entry, arglist_index) sym_list_entry_type *list_entry; int *arglist_index; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_callback_entry_type *callback_entry; /* * Process the list elements, recursing on nested lists. Ignore error entries. */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; process_all_callbacks (nested_list_entry->az_list, arglist_index); break; case sym_k_callback_entry: callback_entry = (sym_callback_entry_type *) list_member; emit_callback (callback_entry, arglist_index, FALSE); break; case sym_k_error_entry: break; default: _assert (FALSE, "unknown entry in callback list"); break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes all valid arguments in an arguments list, ** recursing on nested lists. Each valid argument is emitted to ** the output. ** ** FORMAL PARAMETERS: ** ** list_entry the list to be (recursively) processed ** arglist_index the modifiable index of arguments in the ** output argslist. ** related_count the modifiable count of related args ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void process_all_arguments (list_entry, arglist_index, related_count) sym_list_entry_type *list_entry; int *arglist_index; int *related_count; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_argument_entry_type *argument_entry; /* * Process the list elements, recursing on nested lists. Ignore error entries. */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; process_all_arguments (nested_list_entry->az_list, arglist_index, related_count); break; case sym_k_argument_entry: argument_entry = (sym_argument_entry_type *) list_member; emit_argument (argument_entry, *arglist_index, related_count); *arglist_index -= 1; break; case sym_k_error_entry: break; default: _assert (FALSE, "unknown entry in argument list"); break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine processes all valid controls in an controls list, ** recursing on nested lists. Each valid control is emitted to ** the output. ** ** FORMAL PARAMETERS: ** ** list_entry the list to be (recursively) processed ** widget_index the modifiable index of children ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void process_all_controls (list_entry, widget_index) sym_list_entry_type *list_entry; int *widget_index; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; sym_control_entry_type *control_entry; /* * Process the list elements, recursing on nested lists. Ignore error entries. */ if ( list_entry == NULL ) return; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; process_all_controls (nested_list_entry->az_list, widget_index); break; case sym_k_control_entry: control_entry = (sym_control_entry_type *) list_member; *widget_index -= 1; emit_control (control_entry, *widget_index); break; case sym_k_error_entry: break; default: _assert (FALSE, "unknown entry in control list"); break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds the URM record for a value. ** ** FORMAL PARAMETERS: ** ** value_entry symbol table pointer for a value ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** write a value record to UID file ** **-- **/ void out_emit_value( value_entry ) sym_value_entry_type *value_entry; { MrmCode access; int value_size = 0; MrmType value_type; int value_count = 0; char *buffer; status urm_status; XmString tmp_str; _assert( value_entry->header.b_tag == sym_k_value_entry, "object to be emitted is not a value" ); _assert( (value_entry->obj_header.b_flags & (sym_m_exported | sym_m_private)), "value being emitted is not exported or private" ); access = URMaPublic; if (value_entry->obj_header.b_flags & sym_m_private) { if (value_entry->resource_id == 0 ) { urm_status = UrmIdbGetResourceId ( out_az_idbfile_id, &(value_entry->resource_id) ); if( urm_status != MrmSUCCESS) issue_urm_error( "obtaining resource id" ); } access = URMaPrivate; } /* ** Case on the type of literal. */ value_type = Urm_code_from_uil_type( value_entry->b_type ); switch (value_entry->b_type) { case sym_k_bool_value: case sym_k_integer_value: _assert(access == URMaPublic, "private value should not get resource ids"); value_size = sizeof(long); break; case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: value_size = sizeof(RGMUnitsInteger); break; case sym_k_float_value: _assert(access == URMaPublic, "private floats should not get resource ids"); value_size = sizeof (double); break; case sym_k_horizontal_float_value: case sym_k_vertical_float_value: value_size = sizeof(RGMUnitsFloat); break; case sym_k_single_float_value: _assert(access == URMaPublic, "private single floats should not get resource ids"); value_size = sizeof(float); break; case sym_k_compound_string_value: tmp_str = value_entry->value.xms_value; value_size = XmCvtXmStringToByteStream(tmp_str, (unsigned char **)&(value_entry->value.c_value)); XmStringFree(tmp_str); break; case sym_k_font_value: case sym_k_fontset_value: { /* * Size is FontItem plus size of charset name string and * size of font name string. */ value_size = sizeof(RGMFontItem) + strlen(sem_charset_name(value_entry->b_charset, value_entry->az_charset_value)) + 1 + strlen(value_entry->value.c_value) + 1; break; } case sym_k_color_value: /* null on end of color name accounted for in RGMColorDesc */ value_size = sizeof( RGMColorDesc ) + value_entry->w_length; break; case sym_k_rgb_value: { sym_value_entry_type *value_segment; value_size = sizeof( RGMIntegerVector ); value_count = 0; for (value_segment = value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { value_size += sizeof(long); value_count++; } break; } case sym_k_color_table_value: value_size = compute_color_table_size( value_entry ); break; case sym_k_icon_value: value_size = compute_icon_size( value_entry ); break; case sym_k_char_8_value: case sym_k_reason_value: case sym_k_argument_value: case sym_k_class_rec_name_value: case sym_k_xbitmapfile_value: case sym_k_keysym_value: case sym_k_localized_string_value: /* BEGIN OSF Fix CR 4859 */ /* END OSF Fix CR 4859 */ value_size = value_entry->w_length + 1; /* +1 for the null */ break; /* BEGIN OSF Fix CR 4859 */ case sym_k_wchar_string_value: value_size = sizeof(RGMWCharEntry) + value_entry->az_first_table_value->w_length; break; /* END OSF Fix CR 4859 */ case sym_k_identifier_value: value_size = value_entry->w_length; /* includes the null */ break; case sym_k_string_table_value: { sym_value_entry_type *value_segment; /* value_size accounts for header and null at end of the index */ value_size = sizeof( RGMTextVector ); value_count = 0; /* ** Determine the size of the string table by adding together ** the lengths of component strings. Before the string is a ** table of words. The first word is the number of component ** string. Next comes the word offsets of each of the strings ** from the start of the buffer. */ for (value_segment=value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { value_count++; value_size += XmCvtXmStringToByteStream(value_segment->value.xms_value, NULL) + sizeof( RGMTextEntry ); } break; } case sym_k_asciz_table_value: { sym_value_entry_type *value_segment; /* value_size accounts for header and null at end of the index */ value_size = sizeof( RGMTextVector ); value_count = 0; /* ** Determine the size of the string table by adding together ** the lengths of component strings. Before the string is a ** table of words. The first word is the number of component ** string. Next comes the word offsets of each of the strings ** from the start of the buffer. */ for (value_segment=value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { value_count++; value_size += value_segment->w_length + sizeof(RGMTextEntry) + 1; } break; } case sym_k_integer_table_value: { sym_value_entry_type *value_segment; /* ** The size needed for the vector is the size of the header ** information followed by the the list of integers. Add in ** the header size here. */ value_size = sizeof( RGMIntegerVector ); value_count = 0; /* ** Determine the size of the integer table by adding together ** the lengths of component integers to the header. */ for (value_segment = value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { value_size += sizeof(long); value_count++; } break; } case sym_k_font_table_value: { sym_value_entry_type *font_value; /* * Size is size of basic table, plus strings for all FontItems. * We allocate one fewer FontItems than specified in the structure * definition. */ /* value_size accounts for header and null at end of the index */ value_size = sizeof(RGMFontList) - sizeof(RGMFontItem); value_count = 0; /* ** Determine the size of the font list by adding together ** the lengths of component fonts. Each component is a FontItem ** in the list, plus space for the charset name and font name. */ for (font_value = value_entry->az_first_table_value; font_value != NULL; font_value = font_value->az_next_table_value) { /* Fix for CR 5266 Part 2a -- Pull az_charset_value off of * font_value, rather than value_entry. */ value_count += 1; value_size += sizeof(RGMFontItem) + strlen(sem_charset_name(font_value->b_charset, font_value->az_charset_value)) + 1 + strlen(font_value->value.c_value) + 1; } break; } case sym_k_trans_table_value: { sym_value_entry_type *value_segment; value_size = 0; /* ** Determine the length of the translation table by adding ** together the length of the component strings. */ for (value_segment = value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) value_size += value_segment->w_length + 1; break; } default: _assert( FALSE, "unexpected value type" ); } /* ** Check that the context is large enough to hold the value */ if ((int)(UrmRCSize( out_az_context ) ) < value_size) { if( MrmSUCCESS != UrmResizeResourceContext( out_az_context, value_size )) issue_urm_error( "allocating context" ); urm_status = UrmResizeResourceContext( out_az_context, value_size ); if ( urm_status != MrmSUCCESS) { if (urm_status == MrmTOO_MANY) { diag_issue_diagnostic ( d_value_too_large, (src_source_record_type *)value_entry->header.az_src_rec, diag_k_no_column, value_entry->obj_header.az_name->c_text ); } else issue_urm_error( "allocating context" ); } } /* ** Move the literal to the context. */ UrmRCSetGroup( out_az_context, URMgLiteral ); UrmRCSetType( out_az_context, value_type ); UrmRCSetAccess( out_az_context, access ); UrmRCSetLock( out_az_context, FALSE ); UrmRCSetSize( out_az_context, value_size ); buffer = (char *) UrmRCBuffer( out_az_context ); bzero( buffer, value_size ); switch (value_entry->b_type) { case sym_k_bool_value: case sym_k_integer_value: case sym_k_float_value: case sym_k_reason_value: case sym_k_argument_value: _move( buffer, &value_entry->value.l_integer, value_size ); break; case sym_k_single_float_value: _move( buffer, &value_entry->value.single_float, value_size); break; case sym_k_char_8_value: case sym_k_localized_string_value: case sym_k_identifier_value: case sym_k_class_rec_name_value: case sym_k_xbitmapfile_value: case sym_k_keysym_value: case sym_k_compound_string_value: _move( buffer, value_entry->value.c_value, value_size ); break; /* BEGIN OSF Fix CR 4859 */ case sym_k_wchar_string_value: { RGMWCharEntryPtr wcharentry; wcharentry = (RGMWCharEntryPtr)buffer; wcharentry->wchar_item.count = value_size; _move(wcharentry->wchar_item.bytes, value_entry->az_first_table_value->value.c_value, value_size); break; } /* END OSF Fix CR 4859 */ case sym_k_font_value: case sym_k_fontset_value: { RGMFontItemPtr fontitem; MrmOffset textoffs; char *textptr; char *charset_name; int text_len; fontitem = (RGMFontItemPtr) buffer; textoffs = (MrmOffset) sizeof(RGMFontItem); textptr = (char *)fontitem+textoffs; charset_name = sem_charset_name (value_entry->b_charset, value_entry->az_charset_value); text_len = strlen(charset_name) + 1; fontitem->type = Urm_code_from_uil_type(value_entry->b_type); fontitem->cset.cs_offs = textoffs; strcpy (textptr, charset_name); textoffs += text_len; textptr += text_len; fontitem->font.font_offs = textoffs; strcpy (textptr, value_entry->value.c_value); break; } case sym_k_color_value: { RGMColorDesc *color_buffer; color_buffer = (RGMColorDesc *)buffer; switch (value_entry->b_arg_type) { case sym_k_unspecified_color: color_buffer->mono_state = URMColorMonochromeUnspecified; break; case sym_k_foreground_color: color_buffer->mono_state = URMColorMonochromeForeground; break; case sym_k_background_color: color_buffer->mono_state = URMColorMonochromeBackground; break; } color_buffer->desc_type = URMColorDescTypeName; _move( color_buffer->desc.name, value_entry->value.c_value, value_entry->w_length + 1 ); break; } case sym_k_rgb_value: { sym_value_entry_type *value_segment; RGMColorDesc *color_buffer; int color_vector[3]; int index; color_buffer = (RGMColorDesc *)buffer; index = value_count; index--; for (value_segment=value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { color_vector[index] = (long) value_segment->value.l_integer; index--; } color_buffer->desc_type = URMColorDescTypeRGB; color_buffer->desc.rgb.red = color_vector[0]; color_buffer->desc.rgb.green = color_vector[1]; color_buffer->desc.rgb.blue = color_vector[2]; color_buffer->mono_state = URMColorMonochromeUnspecified; break; } case sym_k_color_table_value: create_color_table( value_entry, buffer ); break; case sym_k_icon_value: create_icon( value_entry, buffer ); break; case sym_k_string_table_value: { sym_value_entry_type *value_segment; int text_offset; int index; int segment_size; RGMTextVector *string_vector; /* ** Value entries are reversed. Need to fill the buffer ** from the end to front. */ text_offset = value_size; string_vector = (RGMTextVector *)buffer; string_vector->validation = URMTextVectorValid; string_vector->count = value_count; index = value_count; string_vector->item[index].pointer = NULL; for (value_segment=value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { tmp_str = value_segment->value.xms_value; segment_size = XmCvtXmStringToByteStream(tmp_str, (unsigned char **)&(value_segment->value.c_value)); XmStringFree(tmp_str); text_offset -= segment_size; _move(&(buffer[text_offset]), value_segment->value.c_value, segment_size); index--; string_vector->item[index].text_item.offset = text_offset; string_vector->item[index].text_item.rep_type = MrmRtypeCString; } break; } case sym_k_asciz_table_value: { sym_value_entry_type *value_segment; int text_offset; int index; int segment_size; RGMTextVector *string_vector; /* ** Value entries are reversed. Need to fill the buffer ** from the end to front. */ text_offset = value_size; string_vector = (RGMTextVector *)buffer; string_vector->validation = URMTextVectorValid; string_vector->count = value_count; index = value_count; string_vector->item[index].pointer = NULL; for (value_segment=value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { segment_size = value_segment->w_length + 1; buffer[text_offset-1] = '\0'; text_offset -= segment_size; _move( &(buffer[text_offset]), value_segment->value.c_value, segment_size - 1); index--; string_vector->item[index].text_item.offset = text_offset; string_vector->item[index].text_item.rep_type = MrmRtypeChar8; } break; } case sym_k_integer_table_value: { sym_value_entry_type *value_segment; int index; RGMIntegerVector *integer_vector; /* ** Fill in the header information */ integer_vector = (RGMIntegerVector *)buffer; integer_vector->validation = URMIntegerVectorValid; integer_vector->count = value_count; /* ** Value entries are reversed. Need to fill the buffer ** from the end to front. */ index = value_count - 1; for (value_segment=value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { integer_vector->item [index] = (long) value_segment->value.l_integer; index--; } break; } case sym_k_font_table_value: { RGMFontListPtr fontlist; RGMFontItemPtr fontitem; sym_value_entry_type *font_value; int textoffs; char *textptr; int index; char *charset_name; int text_len; /* ** Font items are in correct order. */ fontlist = (RGMFontList *)buffer; fontlist->validation = URMFontListValid; fontlist->count = value_count; /* ** textoffs need to be the offset just beyond the last ** FontItem in the list. One FontItem is already allocated, ** so account for it in sizing. */ textoffs = sizeof (RGMFontList) + sizeof(RGMFontItem)*(value_count-1); textptr = (char *)fontlist+textoffs; for (index = 0, font_value = value_entry->az_first_table_value; font_value != NULL; index++, font_value = font_value->az_next_table_value) { fontitem = &fontlist->item[index]; /* * Fix for CR 5266 Part 2b -- Pull az_charset_value off of * font_value, rather than value_entry. */ charset_name = sem_charset_name (font_value->b_charset, font_value->az_charset_value); fontitem->type = Urm_code_from_uil_type(font_value->b_type); fontitem->cset.cs_offs = textoffs; strcpy (textptr, charset_name); text_len = strlen(charset_name) + 1; textoffs += text_len; textptr += text_len; fontitem->font.font_offs = textoffs; strcpy (textptr, font_value->value.c_value); text_len = strlen(font_value->value.c_value) + 1; textoffs += text_len; textptr += text_len; } break; } case sym_k_trans_table_value: { sym_value_entry_type *value_segment; int offset; int segment_size; /* ** Value entries are reversed. Need to fill the buffer ** from the end to front. */ offset = value_size; for (value_segment = value_entry->az_first_table_value; value_segment != NULL; value_segment = value_segment->az_next_table_value) { buffer[offset - 1] = '\n'; segment_size = value_segment->w_length + 1; offset -= segment_size; _move( &(buffer[offset]), value_segment->value.c_value, segment_size-1 ); } buffer[value_size - 1] = 0; break; } case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: { RGMUnitsIntegerPtr uiptr; uiptr = (RGMUnitsIntegerPtr) buffer; uiptr->value = value_entry->value.l_integer; uiptr->units = value_entry->b_arg_type; break; } case sym_k_horizontal_float_value: case sym_k_vertical_float_value: { RGMUnitsFloatPtr ufptr; ufptr = (RGMUnitsFloatPtr) buffer; *((double *)(&ufptr->value[0])) = value_entry->value.d_real; ufptr->units = value_entry->b_arg_type; break; } } /* ** Output the literal */ if (access == URMaPublic) urm_status = UrmPutIndexedLiteral (out_az_idbfile_id, value_entry->obj_header.az_name->c_text, out_az_context); else urm_status = UrmPutRIDLiteral (out_az_idbfile_id, value_entry->resource_id, out_az_context); if( urm_status != MrmSUCCESS) { if (urm_status == MrmEOF) diag_issue_diagnostic ( d_uid_write, diag_k_no_source, diag_k_no_column, Uil_current_file ); else issue_urm_error( "emitting literal" ); } if (Uil_cmd_z_command.v_show_machine_code) save_value_machine_code (value_entry, out_az_context); value_entry->output_state = sym_k_emitted; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds the callback argument for a widget record ** ** FORMAL PARAMETERS: ** ** callback_entry symbol table pointer for the callback ** arglist_index index in arglist to place callback ** (this is an in/out argument) ** emit_create true: emit a create reason ** false: skip create reason ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** callback data is added to out_az_context ** **-- **/ void emit_callback (sym_callback_entry_type *callback_entry, int *arglist_index, boolean emit_create) { sym_value_entry_type *reason_entry; sym_proc_ref_entry_type *proc_ref_entry_next; int proc_ref_index; int proc_count; boolean qcreate = FALSE; MrmOffset callback_offset; status urm_status; /* * Count number of entries in callback list */ if ( callback_entry->az_call_proc_ref != 0 ) proc_count = 1; else proc_count = count_proc (callback_entry->az_call_proc_ref_list, 0); /* ** Reasons can take several forms: ** 1) create reason: value is builtin - keyword Urm value is "created" ** this need special handling ** 2) builtin reasons: value is builtin - keyword Urm value as URM ** compressed equivalent argument ** 3) non-builtin private: value is not builtin but private - ** use an uncompressed argument tag ** 4) non-builtin public: value is not builtin and public - ** not supported yet */ reason_entry = callback_entry->az_call_reason_name; if ( reason_entry->obj_header.b_flags & sym_m_builtin ) { key_keytable_entry_type *key_entry; key_entry = (key_keytable_entry_type *) reason_entry->value.l_integer; qcreate = (strcmp(uil_reason_toolkit_names[key_entry->b_subclass], MrmNcreateCallback) == 0); if ( qcreate ) { /* ** case 1: create reason - return if we are not to emit ** otherwise use special routine to describe */ if ( !emit_create ) return; urm_status = UrmCWRSetCreationCallback (out_az_context, proc_count, &callback_offset); if( urm_status != MrmSUCCESS) { if (urm_status == MrmEOF) diag_issue_diagnostic ( d_uid_write, diag_k_no_source, diag_k_no_column, Uil_current_file ); else issue_urm_error ("emitting creation callback"); } } else { /* ** case 2: builtin case - use a compressed argument */ urm_status = UrmCWRSetCompressedArgTag (out_az_context, *arglist_index, uil_reas_compr[key_entry->b_subclass], 0); if( urm_status != MrmSUCCESS) issue_urm_error( "setting compressed arg" ); } } else { /* ** Non private reasons and arguments are not supported */ if ( reason_entry->obj_header.b_flags & (sym_m_imported|sym_m_exported) ) { diag_issue_diagnostic (d_not_impl, diag_k_no_source, diag_k_no_column, "EXPORTED and IMPORTED arguments and reasons" ); return; } /* ** case 3: private, non-builtin case - use an uncompressed argument */ urm_status = UrmCWRSetUncompressedArgTag (out_az_context, *arglist_index, reason_entry->value.c_value); if( urm_status != MrmSUCCESS) issue_urm_error( "setting uncompressed arg" ); } /* * Create the callback value (this is not done for the create callback) */ if ( ! qcreate ) { urm_status = UrmCWRSetArgCallback (out_az_context, *arglist_index, proc_count, &callback_offset); if( urm_status != MrmSUCCESS) issue_urm_error ("setting callback arg"); } /* * Create the callback procedures */ if (callback_entry->az_call_proc_ref != 0) { proc_ref_index = 0; proc_ref_entry_next = callback_entry->az_call_proc_ref; } else { proc_ref_index = proc_count - 1; proc_ref_entry_next = (sym_proc_ref_entry_type *) callback_entry-> az_call_proc_ref_list->obj_header.az_next; } emit_callback_procedures (proc_ref_entry_next, &proc_ref_index, callback_offset); *arglist_index = *arglist_index - 1; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function counts the number of procedures in a procedure list ** including nested procedure lists. ** ** FORMAL PARAMETERS: ** ** proc_list list of procedures (and nested list entries) ** count count of procedures encountered so far ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** count of procedures in procedure list ** ** SIDE EFFECTS: ** ** none ** **-- **/ int count_proc(proc_list, count) sym_list_entry_type *proc_list; int count; { sym_obj_entry_type *proc_list_next; for (proc_list_next = (sym_obj_entry_type *)proc_list->obj_header.az_next; proc_list_next != 0; proc_list_next = (sym_obj_entry_type *) proc_list_next->obj_header.az_next) { switch (proc_list_next->header.b_tag) { case sym_k_nested_list_entry: count = count_proc(((sym_nested_list_entry_type *) proc_list_next)-> az_list, count); break; case sym_k_proc_ref_entry: count++; break; default: _assert(FALSE, "unknown entry in procedures list"); } } return (count); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function output a procedure list referenced by a callback entry ** ** FORMAL PARAMETERS: ** ** proc_ref_entry_next next procedure reference entry ** proc_ref_index index of procedure in procedure list (for Mrm) ** callback_offset offset of callback (for Mrm) ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ /* * Fix for CR 4772 - Change the proc_ref_index entry from an integer to an * integer pointer to allow for proper construction of * internal callback arrays. */ void emit_callback_procedures (sym_proc_ref_entry_type *proc_ref_entry_next, int *proc_ref_index, MrmOffset callback_offset) { sym_proc_def_entry_type *proc_def_entry; sym_value_entry_type *proc_arg_entry; MrmCode arg_access; MrmCode arg_form; char *arg_index; MrmResource_id arg_id; MrmCode arg_type, arg_group; long arg_value; sym_nested_list_entry_type *nested_proc_list_entry; sym_list_entry_type *proc_list_entry; status urm_status; for ( ; proc_ref_entry_next != 0; proc_ref_entry_next = (sym_proc_ref_entry_type *) proc_ref_entry_next-> obj_header.az_next) { switch (proc_ref_entry_next->header.b_tag) { case sym_k_nested_list_entry: nested_proc_list_entry = (sym_nested_list_entry_type *) proc_ref_entry_next; proc_list_entry = nested_proc_list_entry->az_list; emit_callback_procedures (( sym_proc_ref_entry_type *)proc_list_entry->obj_header.az_next, proc_ref_index, callback_offset); break; case sym_k_proc_ref_entry: proc_def_entry = proc_ref_entry_next->az_proc_def; proc_arg_entry = proc_ref_entry_next->az_arg_value; if (proc_arg_entry == NULL) { arg_type = MrmRtypeNull; arg_value = 0L; arg_form = URMrImmediate; } else { arg_form = ref_value ( proc_arg_entry, &arg_type, &arg_value, &arg_access, &arg_index, &arg_id, &arg_group ); } if (arg_form == URMrImmediate) urm_status = UrmCWRSetCallbackItem ( out_az_context, callback_offset, *proc_ref_index, proc_def_entry->obj_header.az_name->c_text, arg_type, arg_value ); else urm_status = UrmCWRSetCallbackItemRes ( out_az_context, callback_offset, *proc_ref_index, proc_def_entry->obj_header.az_name->c_text, arg_group, arg_access, arg_type, arg_form, arg_index, arg_id ); if( urm_status != MrmSUCCESS) issue_urm_error( "setting callback proc" ); *proc_ref_index = *proc_ref_index - 1; break; case sym_k_error_entry: break; default: _assert (FALSE, "unknown entry in procedures list"); break; } } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds an argument for a widget record ** ** FORMAL PARAMETERS: ** ** argument_entry symbol table pointer for the argument ** arglist_index index in arglist to place argument ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** argument data is added to out_az_context ** **-- **/ void emit_argument( argument_entry, arglist_index, related_arg_count ) sym_argument_entry_type *argument_entry; int arglist_index; int *related_arg_count; { sym_value_entry_type *arg_name_entry; sym_value_entry_type *arg_value_entry; MrmCode arg_access; MrmCode arg_form; char *arg_index; MrmResource_id arg_id; MrmCode arg_type, arg_group; long arg_value; unsigned char expected_type; status urm_status; /* * For an argument, we must: * 1) create the argument * 2) create the argument value */ arg_name_entry = argument_entry->az_arg_name; if (arg_name_entry->obj_header.b_flags & sym_m_builtin) { key_keytable_entry_type *key_entry; key_entry = (key_keytable_entry_type *)arg_name_entry->value.l_integer; urm_status = UrmCWRSetCompressedArgTag (out_az_context, arglist_index, uil_arg_compr[key_entry->b_subclass], uil_arg_compr[related_argument_table[key_entry->b_subclass]]); if ( related_argument_table[key_entry->b_subclass] != 0 ) *related_arg_count += 1; if( urm_status != MrmSUCCESS) issue_urm_error( "setting compressed arg" ); } else { /* ** Non private reasons and arguments are not supported */ if ( arg_name_entry->obj_header.b_flags & (sym_m_imported|sym_m_exported) ) { diag_issue_diagnostic (d_not_impl, diag_k_no_source, diag_k_no_column, "EXPORTED and IMPORTED arguments and reasons" ); return; } /* ** case 3: private, non-builtin case - use an uncompressed argument */ urm_status = UrmCWRSetUncompressedArgTag (out_az_context, arglist_index, arg_name_entry->value.c_value); if( urm_status != MrmSUCCESS) issue_urm_error( "setting uncompressed arg" ); } /* * Acquire the argument parameters. If it is an immediate value, set it. * Else set it up as a literal or widget reference. For literal references, * the expected type must be set up in order to enable coercion in Mrm. */ arg_value_entry = argument_entry->az_arg_value; arg_form = ref_value (arg_value_entry, &arg_type, &arg_value, &arg_access, &arg_index, &arg_id, &arg_group); if (arg_form == URMrImmediate) urm_status = UrmCWRSetArgValue (out_az_context, arglist_index, arg_type, arg_value ); else { switch ( arg_group ) { case URMgLiteral: if ( argument_entry->az_arg_name->obj_header.b_flags & sym_m_builtin ) { key_keytable_entry_type * keytable_entry; keytable_entry = (key_keytable_entry_type *) argument_entry->az_arg_name->value.l_integer; _assert (keytable_entry->b_class == tkn_k_class_argument, "name is not an argument"); expected_type = argument_type_table[keytable_entry->b_subclass]; } else expected_type = argument_entry->az_arg_name->b_arg_type; urm_status = UrmCWRSetArgResourceRef (out_az_context, arglist_index, arg_access, arg_group, Urm_code_from_uil_type(expected_type), arg_form, arg_index, arg_id ); break; case URMgWidget: urm_status = UrmCWRSetArgResourceRef (out_az_context, arglist_index, arg_access, arg_group, RGMwrTypeReference, arg_form, arg_index, arg_id ); break; } } if( urm_status != MrmSUCCESS) issue_urm_error ("setting arg value"); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a control for a widget record ** ** FORMAL PARAMETERS: ** ** control_entry symbol table pointer for the control ** control_offset offset of object in the control list ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** control data is added to out_az_context ** **-- **/ void emit_control( control_entry, control_offset ) sym_control_entry_type *control_entry; int control_offset; { MrmCode access; MrmCode form; char *index; MrmResource_id id; status urm_status; sym_widget_entry_type *widget_entry; Boolean managed; /* ** 1) Process the object reference ** 2) set object as a child of current context */ form = ref_control( control_entry, &access, &index, &id ); /* Truly gross hack. Fix in WML before beta */ #ifndef sym_k_XmRenderTable_object #define sym_k_XmRenderTable_object 0 #endif #ifndef sym_k_XmRendition_object #define sym_k_XmRendition_object 0 #endif #ifndef sym_k_XmTabList_object #define sym_k_XmTabList_object 0 #endif widget_entry = control_entry->az_con_obj; while (widget_entry->obj_header.az_reference != NULL) widget_entry = (sym_widget_entry_type *)widget_entry->obj_header.az_reference; managed = ((widget_entry->header.b_type != sym_k_XmRenderTable_object) && (widget_entry->header.b_type != sym_k_XmRendition_object) && (widget_entry->header.b_type != sym_k_XmTabList_object) && ((control_entry->obj_header.b_flags & sym_m_managed) != 0)); /* ** Add the object as a child. */ urm_status = UrmCWRSetChild ( out_az_context, control_offset, managed, access, form, index, id ); if( urm_status != MrmSUCCESS) issue_urm_error( "setting child" ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function process a reference to a value. ** ** FORMAL PARAMETERS: ** ** arg_value_entry (in) value entry to process ** arg_type (out) URM argument type ** arg_value (out) argument value if immediate ** arg_access (out) private or public ** arg_index (out) index if value is an index ** arg_id (out) resource id if value is a resource id ** arg_group (out) URM group (widget or literal) ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** URMrIndex, URMrRID, URMrImmediate (class of value) ** defines which of the output parameters have meaning ** ** SIDE EFFECTS: ** ** none ** **-- **/ MrmCode ref_value(value_entry, arg_type, arg_value, arg_access, arg_index, arg_id, arg_group) sym_value_entry_type *value_entry; MrmCode *arg_type; long *arg_value; MrmCode *arg_access; char **arg_index; MrmResource_id *arg_id; MrmCode *arg_group; { status urm_status; *arg_value = 0L; *arg_index = NULL; *arg_id = 0; *arg_group = URMgLiteral; /* This value may actually be a widget reference, so check for this case first. */ if (value_entry->header.b_tag == sym_k_widget_entry) { /* Set up a dummy control entry, and process the widget reference. */ sym_control_entry_type control_entry; sym_widget_entry_type * widget_entry; widget_entry = (sym_widget_entry_type *)value_entry; control_entry.header.b_tag = sym_k_control_entry; control_entry.az_con_obj = widget_entry; *arg_group = URMgWidget; *arg_type = RGMwrTypeReference; return ref_control (&control_entry, arg_access, arg_index, arg_id); } *arg_type = Urm_code_from_uil_type( value_entry->b_type ); if (value_entry->obj_header.b_flags & sym_m_private) { *arg_access = URMaPrivate; switch (value_entry->b_type) { case sym_k_bool_value: case sym_k_integer_value: *arg_value = value_entry->value.l_integer; return URMrImmediate; case sym_k_float_value: *arg_value = (long)(&(value_entry->value.d_real)); return URMrImmediate; case sym_k_single_float_value: *arg_value = (long)(value_entry->value.single_float); return URMrImmediate; case sym_k_char_8_value: case sym_k_font_value: case sym_k_fontset_value: case sym_k_color_value: case sym_k_reason_value: case sym_k_argument_value: case sym_k_trans_table_value: case sym_k_asciz_table_value: case sym_k_integer_table_value: case sym_k_string_table_value: case sym_k_color_table_value: case sym_k_icon_value: case sym_k_font_table_value: case sym_k_compound_string_value: case sym_k_identifier_value: case sym_k_class_rec_name_value: case sym_k_xbitmapfile_value: case sym_k_keysym_value: case sym_k_rgb_value: case sym_k_wchar_string_value: case sym_k_localized_string_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: if (value_entry->resource_id == 0 ) { urm_status = UrmIdbGetResourceId (out_az_idbfile_id, &(value_entry->resource_id) ); if ( urm_status != MrmSUCCESS ) issue_urm_error( "obtaining resource id" ); } if (value_entry->output_state == sym_k_not_processed) { value_entry->output_state = sym_k_queued; push((sym_entry_type *) value_entry ); } *arg_id = value_entry->resource_id; return URMrRID; default: _assert( FALSE, "unexpected value type" ); return URMrImmediate; } } /* ** Only Imported and Exported Values reach this point */ *arg_access = URMaPublic; *arg_index = (char *)(value_entry->obj_header.az_name->c_text); if ((value_entry->obj_header.b_flags & sym_m_exported) && (value_entry->output_state == sym_k_not_processed)) { value_entry->output_state = sym_k_queued; push((sym_entry_type *) value_entry ); } return URMrIndex; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function process a reference to a control (widget or gadget) ** ** FORMAL PARAMETERS: ** ** control_entry (in) control entry for widget reference ** access (out) private or public ** index (out) index if widget is an index ** id (out) resource id if widget is a resource id ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** URMrIndex, URMrRID (class of control) ** defines which of the output parameters have meaning ** ** SIDE EFFECTS: ** ** none ** **-- **/ MrmCode ref_control(control_entry, access, index, id) sym_control_entry_type *control_entry; MrmCode *access; char **index; MrmResource_id *id; { sym_widget_entry_type *widget_entry; MrmCode form; status urm_status; _assert( control_entry->header.b_tag == sym_k_control_entry, "expecting a control entry" ); /* ** For a control, we must: ** 1) determine if this is a definition or a reference ** 2) queue the widget to be created if it isn't yet ** 3) get a resource id for the control if unnamed */ widget_entry = control_entry->az_con_obj; /* ** If the reference field is set, this is a reference to a control ** defined elsewhere. Otherwise it is an inline definition. */ while (widget_entry->obj_header.az_reference != NULL) widget_entry = (sym_widget_entry_type *)widget_entry->obj_header.az_reference; /* ** Queue the control to be processed if it has not already been ** emitted or queued for processing. */ if ((widget_entry->obj_header.b_flags & (sym_m_exported | sym_m_private)) && (widget_entry->output_state == sym_k_not_processed) ) { widget_entry->output_state = sym_k_queued; push((sym_entry_type *) widget_entry ); } if (widget_entry->obj_header.az_name == NULL) { /* ** Need a resource id. */ if (widget_entry->resource_id == 0 ) { urm_status = UrmIdbGetResourceId ( out_az_idbfile_id, &(widget_entry->resource_id) ); if( urm_status != MrmSUCCESS) issue_urm_error( "obtaining resource id" ); } form = URMrRID; *id = widget_entry->resource_id; *index = NULL; } else { /* ** Need an index */ form = URMrIndex; *index = widget_entry->obj_header.az_name->c_text; *id = 0 ; } *access = URMaPublic; if (widget_entry->obj_header.b_flags & sym_m_private) *access = URMaPrivate; return form; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function issue a diagnostic for an error detected by URM. ** ** FORMAL PARAMETERS: ** ** problem string indicating what p2_output was trying to do ** ** IMPLICIT INPUTS: ** ** out_az_context context in error (hold further info about error) ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** diagnostic is issued - compilation stops ** **-- **/ void issue_urm_error( problem ) char *problem; { char buffer[132]; sprintf(buffer, "while %s encountered %s", problem, Urm__UT_LatestErrorMessage()); diag_issue_internal_error( buffer ); } /* *++ * * PROCEDURE DESCRIPTION: * * This procedure maps uil literal type to Urm equivalent types * * FORMAL PARAMETERS: * * uil_type uil types sym_k_..._value * * IMPLICIT INPUTS: * * none * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * corresponding RGMrType... code * * SIDE EFFECTS: * * none * *-- */ MrmCode Urm_code_from_uil_type( uil_type ) int uil_type; { switch (uil_type) { case sym_k_integer_value: return MrmRtypeInteger; case sym_k_horizontal_integer_value: return MrmRtypeHorizontalInteger; case sym_k_vertical_integer_value: return MrmRtypeVerticalInteger; case sym_k_bool_value: return MrmRtypeBoolean; case sym_k_char_8_value: return MrmRtypeChar8; case sym_k_localized_string_value: return MrmRtypeChar8; case sym_k_argument_value: return MrmRtypeChar8; case sym_k_reason_value: return MrmRtypeChar8; case sym_k_trans_table_value: return MrmRtypeTransTable; case sym_k_asciz_table_value: return MrmRtypeChar8Vector; case sym_k_string_table_value: return MrmRtypeCStringVector; case sym_k_compound_string_value: return MrmRtypeCString; case sym_k_wchar_string_value: return MrmRtypeWideCharacter; case sym_k_integer_table_value: return MrmRtypeIntegerVector; case sym_k_color_value: return MrmRtypeColor; case sym_k_color_table_value: return MrmRtypeColorTable; case sym_k_icon_value: return MrmRtypeIconImage; case sym_k_float_value: return MrmRtypeFloat; case sym_k_horizontal_float_value: return MrmRtypeHorizontalFloat; case sym_k_vertical_float_value: return MrmRtypeVerticalFloat; case sym_k_font_value: return MrmRtypeFont; case sym_k_fontset_value: return MrmRtypeFontSet; case sym_k_font_table_value: return MrmRtypeFontList; case sym_k_identifier_value: return MrmRtypeAddrName; case sym_k_class_rec_name_value: return MrmRtypeClassRecName; case sym_k_xbitmapfile_value: return MrmRtypeXBitmapFile; case sym_k_widget_ref_value: return MrmRtypeAny; case sym_k_pixmap_value: return MrmRtypeIconImage; case sym_k_any_value: return MrmRtypeAny; case sym_k_keysym_value: return MrmRtypeKeysym; case sym_k_single_float_value: return MrmRtypeSingleFloat; case sym_k_rgb_value: return MrmRtypeColor; default: _assert( FALSE, "unknown value type" ); return 0; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function computes the size of a color table. ** ** FORMAL PARAMETERS: ** ** table_entry value entry for the color table ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** size of the color table ** ** SIDE EFFECTS: ** ** colors within the color table may be allocated ** **-- **/ int compute_color_table_size(table_entry) sym_value_entry_type *table_entry; { sym_value_entry_type *color_entry; int size; int i; MrmCode arg_type; long arg_value; MrmCode arg_access; char *arg_index; MrmResource_id arg_id; MrmCode arg_group; /* ** Compute the size of the ColorTable plus the size of the Color ** table entries (one per color including fore and back ground). ** Multiply entry size by max_index rather than max_index + 1 ** since RGMColorTable includes 1 entry. Note that descriptors ** are sized to consume fullword-aligned blocks of memory in ** to preserve alignment for processors requiring such alignment. */ size = sizeof(RGMColorTable) + sizeof(RGMColorTableEntry)*table_entry->b_max_index; size = _FULLWORD (size); /* ** Compute space needed for resource descriptors for the colors. */ for (i = 0; i < (int)table_entry->b_table_count; i++) { color_entry = table_entry->value.z_color[i].az_color; /* ** Default colors have az_color set to 0=back and 1=fore. ** These require ColorTableEntries but no resource descriptors. */ if ((long)color_entry > 1) { /* ** Call ref_value for each of the colors in the color table. ** This will cause them to be created if necessary and also ** classify the type of resource needed. */ table_entry->value.z_color[i].w_desc_offset = size; switch (ref_value( color_entry, & arg_type, & arg_value, & arg_access, & arg_index, & arg_id, & arg_group ) ) { case URMrRID: size += sizeof (RGMResourceDesc); size = _FULLWORD (size); break; case URMrIndex: size += sizeof(RGMResourceDesc) - sizeof(MrmResource_id) + strlen(arg_index)+1; size = _FULLWORD (size); break; default: _assert( FALSE, "immediate color values not supported" ); } } } table_entry->w_length = size; return size; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates a color table in a context. ** ** FORMAL PARAMETERS: ** ** table_entry value entry for the color table ** buffer pointer to a context buffer ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void create_color_table(table_entry, buffer) sym_value_entry_type *table_entry; char *buffer; { RGMColorTable *table; RGMColorTableEntry *item; RGMResourceDesc *desc; int i; MrmCode arg_form; MrmCode arg_type; long arg_value; MrmCode arg_access; char *arg_index; MrmResource_id arg_id; MrmCode arg_group; /* ** Fill in the Color Table fields */ table = (RGMColorTable *)buffer; table->validation = URMColorTableValid; table->count = table_entry->b_max_index + 1; /* ** Loop thru the colors in the table setting up both the index ** of offset for the colors and their resource descriptors. */ item = table->item; for (i = 0; i < (int)table_entry->b_table_count; i++) { int index; index = table_entry->value.z_color[i].b_index; table->item[index].color_item.coffs = table_entry->value.z_color[i].w_desc_offset; desc = (RGMResourceDesc *) (buffer + table_entry->value.z_color[i].w_desc_offset); /* ** Default colors have b_index set to 0=back and 1=fore. ** These require ColorTableEntries but no resource descriptors. */ if (index > 1) { table->item[index].type = MrmRtypeResource; /* ** Call ref_value for each of the colors in the color table. ** This provide the necessary info to fill in the resource ** descriptor */ arg_form = ref_value( table_entry->value.z_color[i].az_color, & arg_type, & arg_value, & arg_access, & arg_index, & arg_id, & arg_group ); desc->access = arg_access; desc->type = arg_form; desc->res_group = arg_group; desc->cvt_type = arg_type; switch (arg_form) { case URMrRID: desc->size = sizeof( RGMResourceDesc ); desc->key.id = arg_id; break; case URMrIndex: desc->size = strlen( arg_index ) + 1; _move( desc->key.index, arg_index, desc->size ); desc->size += sizeof( RGMResourceDesc ) - sizeof( MrmResource_id ); break; default: _assert( FALSE, "immediate color values not supported" ); } } } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function computes the size of an icon. ** ** FORMAL PARAMETERS: ** ** icon_entry value entry for the icon ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** size of the icon ** ** SIDE EFFECTS: ** ** color table within the icon may be allocated ** **-- **/ int compute_icon_size(icon_entry) sym_value_entry_type *icon_entry; { int size; int pixel_type; MrmCode arg_type; long arg_value; MrmCode arg_access; char *arg_index; MrmResource_id arg_id; MrmCode arg_group; /* ** The size of the icon consist of the size of the RGMIconImage ** structure + the size of the color table resource descriptor ** + the actual data. */ size = sizeof( RGMIconImage ); /* ** Compute space needed for the color table resource descriptor ** ** Call ref_value. ** This will cause the table to be created if necessary and also ** classify the type of resource needed. */ switch (ref_value( icon_entry->value.z_icon->az_color_table, & arg_type, & arg_value, & arg_access, & arg_index, & arg_id, & arg_group ) ) { case URMrRID: size += sizeof( RGMResourceDesc ); break; case URMrIndex: size += sizeof( RGMResourceDesc ) - sizeof( MrmResource_id ) + strlen( arg_index ) + 1; break; default: _assert( FALSE, "immediate color table values not supported" ); } /* ** Save the offset of the data for later. */ icon_entry->b_data_offset = size; /* ** Bits per pixel is based on the number of colors used. ** Pixel_type: ** 0 for 1 bit pixels ** 1 for 2 bit pixels ** 2 for 4 bit pixels ** 3 for 8 bit pixels ** URM's pixels size encoding is pixel_type + 1 ** Pixel_size = 1 << pixel_type */ pixel_type = icon_entry->value.z_icon->az_color_table->b_max_index; if (pixel_type < 2) pixel_type = 0; else if (pixel_type < 4) pixel_type = 1; else if (pixel_type < 16) pixel_type = 2; else pixel_type = 3; icon_entry->b_pixel_type = pixel_type; /* ** Size is width * height - each row must be an even number of bytes */ size += ((int)((icon_entry->value.z_icon->w_width << pixel_type) + 7) / 8) * icon_entry->value.z_icon->w_height; icon_entry->w_length = size; return size; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates an icon in a context buffer ** ** FORMAL PARAMETERS: ** ** icon_entry value entry for the icon ** buffer pointer to context buffer ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** buffer is filled in ** **-- **/ void create_icon(icon_entry,buffer) sym_value_entry_type *icon_entry; char *buffer; { sym_value_entry_type *row_entry; RGMIconImage *icon; RGMResourceDesc *desc; MrmCode arg_form; MrmCode arg_type; long arg_value; MrmCode arg_access; char *arg_index; MrmResource_id arg_id; MrmCode arg_group; unsigned char *sbyte; unsigned char *tbyte; int w_len; int p_len; int i; int j; char pixel_type; char pixel_size; char pixel_per_byte; /* ** Fill in the fixed location fields of the IconImage. */ icon = (RGMIconImage *)buffer; icon->validation = URMIconImageValid; pixel_type = icon_entry->b_pixel_type; icon->pixel_size = pixel_type + 1; icon->width = icon_entry->value.z_icon->w_width; icon->height = icon_entry->value.z_icon->w_height; icon->ct_type = MrmRtypeResource; icon->color_table.ctoff = sizeof( RGMIconImage ); icon->pixel_data.pdoff = icon_entry->b_data_offset; /* ** Place color table resource descriptor in the context. ** ** Call ref_value which will return all info need to complete ** the description. */ arg_form = ref_value( icon_entry->value.z_icon->az_color_table, & arg_type, & arg_value, & arg_access, & arg_index, & arg_id, & arg_group ); desc = (RGMResourceDesc *)(buffer + sizeof( RGMIconImage )); desc->access = arg_access; desc->type = arg_form; desc->res_group = arg_group; desc->cvt_type = MrmRtypeResource; switch (arg_form) { case URMrRID: desc->size = sizeof( RGMResourceDesc ); desc->key.id = arg_id; break; case URMrIndex: desc->size = strlen( arg_index ) + 1; _move( desc->key.index, arg_index, desc->size ); desc->size += sizeof( RGMResourceDesc ) - sizeof( MrmResource_id ); break; default: _assert( FALSE, "immediate color values not supported" ); } /* ** Now move the pixels into the buffer ** Variable usage: ** sbyte: base of source byte stream ** tbyte: current position in target byte stream ** w_len: # of pixels that will go into integral # of bytes ** p_len: # of pixels that will go into final byte */ pixel_per_byte = 8 >> pixel_type; pixel_size = 1 << pixel_type; tbyte = (unsigned char *)(buffer + icon_entry->b_data_offset); for (row_entry = icon_entry->value.z_icon->az_rows, w_len = ((int)row_entry->w_length / (int)pixel_per_byte) * pixel_per_byte, p_len = row_entry->w_length - w_len; row_entry != NULL; row_entry = row_entry->az_next_table_value) { sbyte = (unsigned char *)row_entry->value.c_value; for (i = 0; i < w_len; tbyte++) { for (*tbyte = 0, j = 0; j < 8; j += pixel_size ) { unsigned char t; t = sbyte[i++] << j; *tbyte |= t; } } if (p_len > 0) { for ( *tbyte = 0, j = 0; j < (p_len * pixel_size); j += pixel_size ) { unsigned char t; t = sbyte[i++] << j; *tbyte |= t; } tbyte++; } } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function counts the number of valid, usable entries in a ** list. It simply accumulates all the nodes in the list (recursively) ** which match the given node type. ** ** FORMAL PARAMETERS: ** ** list_entry the list to be counted ** type the node type to match ** ** IMPLICIT INPUTS: ** ** IMPLICIT OUTPUTS: ** ** FUNCTION VALUE: ** ** the number of nodes which matched the type ** ** SIDE EFFECTS: ** **-- **/ int compute_list_size (list_entry, type) sym_list_entry_type *list_entry; int type; { /* * Local variables */ sym_obj_entry_type *list_member; sym_nested_list_entry_type *nested_list_entry; int count = 0; /* * loop down the list */ if ( list_entry == NULL ) return 0; for (list_member=(sym_obj_entry_type *)list_entry->obj_header.az_next; list_member!=NULL; list_member=(sym_obj_entry_type *)list_member->obj_header.az_next) switch ( list_member->header.b_tag ) { case sym_k_nested_list_entry: nested_list_entry = (sym_nested_list_entry_type *) list_member; count += compute_list_size (nested_list_entry->az_list, type); break; default: if ( list_member->header.b_tag == (char)type ) count += 1; break; } return count; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine creates the internal compression code tables. ** ** Upon calling this routine, the internal compression code tables ** (uil_arg_compr, uil_reas_compr, and uil_widget_compr) have zero ** entries for resources which have not been referenced in this UIL ** module and have one entries for resrources which have been referenced. ** ** This routine assigns increasing integers to each non-zero entry in the ** internal compression code tables. ** ** The internal compression code tables are indexed by subclass to yield ** the external compression code values which are written to the UID file. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** uil_arg_compr ** uil_reas_compr ** uil_widget_compr ** ** IMPLICIT OUTPUTS: ** ** uil_arg_compr ** uil_reas_compr ** uil_widget_compr ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** **-- **/ void create_int_compression_codes () { /* * Local variables */ int i; int compression_code = 2; /* ** Request compression codes for all subtree resources. */ for ( i=0 ; ivalidation = UidCompressionTableValid; extern_arg_compr->num_entries = arg_value_count; #ifdef WORD64 text_offset = ((int)&extern_arg_compr->entry[arg_value_count] - (int)extern_arg_compr) * sizeof(int); #else text_offset = (long)&extern_arg_compr->entry[arg_value_count] - (long)extern_arg_compr; #endif comp_code = UilMrmMinValidCode; for ( i = 0 ; i<=uil_max_arg ; i++ ) { if (uil_arg_compr[i] != 0) { _move( &(arg_buffer[text_offset]), uil_argument_toolkit_names[i], strlen(uil_argument_toolkit_names[i]) + 1); extern_arg_compr->entry[comp_code].stoffset = text_offset; text_offset += (strlen(uil_argument_toolkit_names[i]) + 1); comp_code++; } } for ( i = 0 ; i<=uil_max_reason ; i++ ) { if (uil_reas_compr[i] != 0) { _move( &(arg_buffer[text_offset]), uil_reason_toolkit_names[i], strlen(uil_reason_toolkit_names[i]) + 1); extern_arg_compr->entry[comp_code].stoffset = text_offset; text_offset += (strlen(uil_reason_toolkit_names[i]) + 1); comp_code++; } } for ( i = 0 ; i<=uil_max_child ; i++ ) { if (uil_child_compr[i] != 0) { char *name; if (strncmp(uil_child_names[i], AUTO_CHILD_PREFIX, strlen(AUTO_CHILD_PREFIX)) == 0) name = (uil_child_names[i] + strlen(AUTO_CHILD_PREFIX)); else name = uil_child_names[i]; _move( &(arg_buffer[text_offset]), name, strlen(name) + 1); extern_arg_compr->entry[comp_code].stoffset = text_offset; text_offset += (strlen(name) + 1); comp_code++; } } /* ** Finally write the argument compression code table out to the UID file */ urm_status = UrmPutIndexedLiteral (out_az_idbfile_id, UilMrmResourceTableIndex, out_az_context); if (urm_status != MrmSUCCESS) { if (urm_status == MrmEOF) diag_issue_diagnostic ( d_uid_write, diag_k_no_source, diag_k_no_column, Uil_current_file ); else issue_urm_error("emitting literal"); } /* ** Create compression code tables for classes ** ** Determine number of elements in external compression table ** ( extern_class_compr[] ) and size of external ** compression table. ** PROBABL ERROR: WHAT ABOUT GADGETS??? */ class_value_size = sizeof (UidCompressionTable); class_value_count = UilMrmReservedCodeCount; next_code = UilMrmMinValidCode; for (i = 0; i <= uil_max_object; i++) if (uil_widget_compr[i] != 0) { class_value_count++; next_code++; if (uil_widget_funcs[i] == NULL) { _assert (FALSE, "unknown class") } else class_value_size += strlen(uil_widget_funcs[i]) + 1; } /* ** Again, compute the additional size for the vector. */ class_value_size += sizeof(UidCTableEntry) * next_code; /* ** Check that the resource context is large enough to hold the value */ if ( (int)(UrmRCSize(out_az_context)) < class_value_size ) { if( MrmSUCCESS != UrmResizeResourceContext( out_az_context, class_value_size )) issue_urm_error( "allocating context" ); } /* ** Set up the resource context and point extern_class_compr to the resource ** context buffer. */ UrmRCSetGroup( out_az_context, URMgLiteral ); UrmRCSetType( out_az_context, sym_k_asciz_table_value ); UrmRCSetAccess( out_az_context, URMaPublic ); UrmRCSetLock( out_az_context, FALSE ); UrmRCSetSize( out_az_context, class_value_size ); class_buffer = (char *) UrmRCBuffer( out_az_context ); extern_class_compr = (UidCompressionTable *)class_buffer; bzero (class_buffer, class_value_size); /* ** Now fill in the actual value of the external compresion code ** table ( extern_class_compr[] ). */ extern_class_compr->validation = UidCompressionTableValid; extern_class_compr->num_entries = class_value_count; #ifdef WORD64 text_offset = ((int)&extern_class_compr->entry[class_value_count] - (int)extern_class_compr) * sizeof(int); #else text_offset = (long)&extern_class_compr->entry[class_value_count] - (long)extern_class_compr; #endif comp_code = UilMrmMinValidCode; for ( i = 0; i <= uil_max_object; i++) { if (uil_widget_compr[i] != 0) { _move( &(class_buffer[text_offset]), uil_widget_funcs[i], strlen(uil_widget_funcs[i]) + 1); extern_class_compr->entry[comp_code].stoffset = text_offset; text_offset += (strlen(uil_widget_funcs[i]) + 1); comp_code++; } } /* ** Finally write the class compression code table out to the UID file */ urm_status = UrmPutIndexedLiteral (out_az_idbfile_id, UilMrmClassTableIndex, out_az_context); if (urm_status != MrmSUCCESS) { if (urm_status == MrmEOF) diag_issue_diagnostic ( d_uid_write, diag_k_no_source, diag_k_no_column, Uil_current_file ); else issue_urm_error("emitting literal"); } } motif-2.3.8/clients/uil/UilLexPars.c0000644000175000017500000046312013211513006014207 00000000000000/* original parser id follows */ /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 #define YYPATCH 20140715 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) #define yyerrok (yyerrflag = 0) #define YYRECOVERING() (yyerrflag != 0) #define YYENOMEM (-2) #define YYEOF 0 #define YYPREFIX "yy" #define YYPURE 0 #line 37 "Uil.y" /* Begin user declarations section */ #ifdef HAVE_CONFIG_H #include #endif #include "UilDefI.h" #include "UilCompGl.h" #define YYSTYPE yystype #define YYDEBUG 1 /* Declare and initialize stack entry for epsilon productions. */ YYSTYPE gz_yynullval = {NULL,0,0,0,0}; /* Declare token to aid in saving source context */ YYSTYPE prev_yylval; /* End user declarations section */ #line 45 "Uil.c" #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) /* Default: YYSTYPE is the semantic value type. */ typedef int YYSTYPE; # define YYSTYPE_IS_DECLARED 1 #endif /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #define UILEOF 0 #define NAME 1 #define FONT_NAME 2 #define COLOR_NAME 3 #define ARGUMENT_NAME 4 #define REASON_NAME 5 #define CHARSET_NAME 6 #define ENUMVAL_NAME 7 #define CLASS_NAME 8 #define CHILD_NAME 96 #define UNS_FLOAT_LITERAL 9 #define COMP_STRING 10 #define CHAR_8_LITERAL 11 #define UNS_INT_LITERAL 12 #define LEFT_PAREN 13 #define RIGHT_PAREN 14 #define COLON 15 #define SEMICOLON 16 #define LEFT_BRACE 17 #define RIGHT_BRACE 18 #define COMMA 19 #define EQUAL_SIGN 20 #define NOT 21 #define PLUS 22 #define MINUS 23 #define AND 24 #define OR 25 #define XOR 26 #define MULTIPLY 27 #define DIVIDE 28 #define LEFT_SHIFT 29 #define RIGHT_SHIFT 30 #define LIST 31 #define IDENTIFIER 32 #define END 33 #define MODULE 34 #define UILTRUE 35 #define UILFALSE 36 #define INCLUDE 37 #define MACRO 38 #define ON 39 #define OFF 40 #define VALUE 41 #define ARGUMENTS 42 #define CALLBACKS 43 #define PROCEDURES 44 #define CONTROLS 45 #define PROCEDURE 46 #define OBJECT 47 #define OBJECTS 48 #define WIDGET 49 #define GADGET 50 #define FONT 51 #define ARGUMENT 52 #define REASON 53 #define PIXMAP 54 #define COLOR 55 #define NAMES 56 #define CHARACTER_SET 57 #define CASE_SENSITIVE 58 #define CASE_INSENSITIVE 59 #define VERSION 60 #define MANAGED 61 #define UNMANAGED 62 #define PRIVATE 63 #define IMPORTED 64 #define EXPORTED 65 #define UILFILE 66 #define STRING_TABLE 67 #define TRANSLATION_TABLE 68 #define COMPOUND_STRING 69 #define FONT_TABLE 70 #define ANY 71 #define STRING 72 #define BOOLEAN 73 #define ICON 74 #define RIGHT_TO_LEFT 75 #define BACKGROUND 76 #define FOREGROUND 77 #define COLOR_TABLE 78 #define FLOAT 79 #define INTEGER 80 #define CLASS_REC_NAME 81 #define ASCIZ_TABLE 82 #define INTEGER_TABLE 83 #define ASCIZ_STRING_TABLE 84 #define COMPOUND_STRING_TABLE 85 #define XBITMAPFILE 86 #define SEPARATE 87 #define SIXTEEN_BIT 88 #define POUND 89 #define KEYSYM 90 #define SINGLE_FLOAT 91 #define RGB 92 #define WIDE_CHARACTER 93 #define LOC_STRING 94 #define FONTSET 95 #define COMPOUND_STRING_COMPONENT 97 #define PIX 115 #define PIXEL 103 #define PIXELS 104 #define IN 98 #define INCH 105 #define INCHES 106 #define CM 99 #define CENTIMETER 107 #define CENTIMETERS 108 #define MM 100 #define MILLIMETER 109 #define MILLIMETERS 110 #define PT 101 #define POINT 111 #define POINTS 112 #define FU 102 #define FONT_UNIT 113 #define FONT_UNITS 114 #define YYERRCODE 256 typedef short YYINT; static const YYINT yylhs[] = { -1, 3, 0, 4, 7, 1, 6, 6, 8, 8, 9, 9, 9, 13, 9, 11, 11, 14, 14, 16, 14, 15, 15, 18, 15, 19, 17, 20, 20, 2, 2, 21, 21, 21, 21, 21, 21, 29, 22, 28, 28, 31, 28, 30, 32, 32, 32, 32, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 36, 36, 37, 37, 40, 24, 39, 39, 42, 39, 41, 43, 43, 45, 45, 45, 45, 44, 47, 23, 46, 46, 49, 46, 48, 27, 50, 27, 52, 25, 51, 51, 54, 51, 55, 53, 58, 56, 59, 56, 61, 56, 62, 64, 56, 66, 65, 67, 65, 68, 65, 69, 65, 70, 65, 71, 72, 65, 73, 57, 74, 74, 77, 76, 63, 63, 80, 80, 75, 75, 75, 82, 75, 78, 78, 78, 83, 78, 84, 84, 85, 84, 81, 81, 86, 86, 86, 90, 86, 60, 92, 26, 91, 91, 94, 91, 95, 93, 96, 96, 96, 96, 103, 97, 106, 98, 109, 99, 112, 100, 104, 107, 110, 101, 105, 105, 105, 114, 105, 108, 108, 108, 116, 108, 111, 111, 111, 118, 111, 102, 102, 102, 120, 102, 113, 113, 115, 115, 117, 117, 119, 119, 121, 121, 126, 121, 122, 122, 128, 122, 123, 123, 131, 123, 124, 124, 133, 124, 134, 89, 135, 87, 136, 88, 137, 129, 132, 140, 132, 142, 132, 143, 132, 141, 141, 125, 125, 127, 127, 146, 139, 138, 138, 138, 145, 130, 147, 147, 147, 147, 5, 5, 5, 5, 5, 5, 5, 5, 79, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 10, 33, 34, 34, 149, 144, 144, 144, 151, 151, 152, 152, 152, 153, 153, 153, 154, 154, 154, 155, 155, 155, 155, 156, 156, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 167, 167, 174, 174, 165, 165, 175, 175, 166, 166, 176, 176, 172, 164, 164, 177, 177, 163, 163, 163, 168, 168, 169, 169, 169, 169, 169, 178, 178, 179, 179, 179, 173, 160, 160, 161, 161, 170, 170, 180, 180, 159, 159, 12, 12, 12, 181, 181, 182, 182, 183, 183, 150, 150, 184, 184, 184, 162, 162, 185, 185, 171, 171, 186, 186, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, }; static const YYINT yylen[] = { 2, 0, 6, 0, 0, 5, 0, 1, 1, 2, 3, 3, 3, 0, 4, 1, 1, 2, 3, 0, 3, 2, 3, 0, 3, 0, 4, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 3, 1, 2, 0, 3, 4, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 1, 2, 0, 3, 4, 0, 3, 0, 1, 1, 1, 0, 0, 3, 1, 2, 0, 3, 2, 4, 0, 3, 0, 3, 2, 3, 0, 3, 0, 4, 0, 3, 0, 3, 0, 3, 0, 0, 6, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 0, 5, 0, 5, 1, 1, 0, 5, 1, 3, 1, 2, 1, 2, 3, 0, 3, 1, 3, 4, 0, 3, 3, 4, 0, 3, 1, 2, 2, 2, 2, 0, 3, 0, 0, 3, 2, 3, 0, 3, 0, 4, 1, 1, 1, 1, 0, 3, 0, 3, 0, 3, 0, 3, 1, 1, 1, 1, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 3, 0, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 0, 3, 2, 2, 0, 3, 2, 2, 0, 3, 2, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 2, 0, 4, 0, 4, 0, 4, 1, 1, 3, 4, 3, 3, 0, 3, 1, 1, 1, 3, 2, 1, 3, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 1, 1, 2, 4, 4, 4, 4, 4, 4, 5, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 3, 5, 0, 1, 1, 3, 0, 2, 2, 1, 2, 1, 3, 3, 3, 3, 2, 3, 3, 3, 3, 1, 5, 1, 5, 1, 1, 3, 3, 1, 2, 1, 1, 4, 1, 1, 2, 2, 3, 3, 3, 1, 3, 4, 4, 3, 1, 3, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const YYINT yydefred[] = { 3, 0, 1, 0, 29, 0, 0, 283, 284, 285, 286, 287, 288, 289, 326, 296, 297, 298, 299, 300, 301, 317, 302, 303, 304, 305, 306, 325, 307, 93, 311, 312, 315, 324, 292, 293, 319, 316, 320, 321, 318, 294, 295, 314, 95, 310, 96, 94, 322, 323, 327, 328, 329, 330, 331, 313, 4, 308, 309, 290, 119, 183, 111, 0, 0, 37, 97, 121, 30, 31, 32, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 5, 0, 8, 120, 187, 189, 0, 0, 115, 0, 0, 113, 2, 0, 0, 0, 0, 0, 0, 370, 371, 372, 373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 0, 0, 360, 0, 0, 0, 433, 0, 0, 0, 0, 0, 348, 351, 355, 0, 41, 0, 0, 39, 101, 0, 0, 99, 125, 127, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 185, 0, 117, 114, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 362, 358, 0, 353, 354, 352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, 434, 0, 432, 0, 0, 0, 0, 0, 0, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 374, 359, 0, 0, 40, 0, 0, 110, 100, 0, 0, 0, 123, 0, 15, 16, 11, 12, 10, 188, 0, 186, 116, 356, 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 431, 0, 428, 0, 454, 0, 0, 0, 0, 0, 401, 0, 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, 406, 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 350, 42, 0, 0, 0, 0, 0, 46, 0, 334, 102, 109, 72, 53, 55, 54, 50, 56, 60, 63, 61, 108, 49, 52, 62, 51, 48, 65, 59, 66, 67, 68, 69, 70, 71, 64, 107, 57, 58, 0, 0, 126, 0, 124, 19, 0, 14, 203, 204, 205, 206, 190, 191, 192, 193, 194, 195, 197, 199, 201, 0, 364, 0, 0, 367, 363, 0, 366, 378, 0, 0, 0, 379, 0, 381, 0, 0, 382, 0, 383, 384, 368, 377, 0, 385, 0, 0, 386, 387, 0, 388, 389, 0, 365, 0, 380, 375, 0, 376, 0, 45, 47, 44, 0, 43, 105, 103, 131, 135, 129, 128, 133, 0, 23, 25, 17, 0, 0, 0, 0, 0, 0, 0, 92, 78, 79, 75, 80, 84, 87, 85, 410, 74, 77, 86, 76, 73, 83, 88, 89, 90, 91, 81, 82, 409, 369, 450, 451, 449, 394, 0, 0, 0, 418, 0, 430, 429, 0, 455, 402, 0, 0, 435, 0, 0, 417, 414, 415, 416, 407, 398, 0, 0, 0, 0, 443, 0, 0, 0, 0, 20, 0, 0, 18, 0, 21, 225, 0, 291, 222, 196, 210, 0, 207, 198, 215, 0, 212, 200, 220, 0, 217, 202, 0, 0, 0, 0, 419, 0, 0, 0, 439, 0, 0, 0, 0, 0, 0, 336, 0, 151, 132, 136, 130, 134, 24, 0, 22, 0, 249, 0, 223, 0, 0, 260, 0, 0, 0, 233, 0, 182, 0, 237, 208, 0, 0, 0, 227, 0, 0, 0, 241, 213, 0, 0, 0, 229, 0, 0, 0, 245, 218, 257, 0, 0, 231, 0, 0, 424, 420, 421, 422, 0, 0, 0, 440, 403, 426, 0, 0, 447, 444, 0, 0, 27, 28, 26, 226, 0, 267, 264, 266, 262, 0, 0, 247, 224, 234, 248, 272, 259, 211, 0, 0, 235, 209, 228, 236, 0, 216, 0, 0, 239, 214, 230, 240, 0, 221, 0, 0, 0, 279, 278, 219, 232, 243, 244, 441, 442, 445, 446, 0, 157, 0, 182, 250, 0, 0, 0, 252, 0, 238, 254, 0, 0, 242, 256, 0, 271, 270, 246, 258, 0, 282, 0, 0, 154, 153, 0, 137, 173, 0, 265, 263, 142, 144, 140, 148, 138, 146, 261, 155, 273, 269, 0, 0, 280, 0, 159, 158, 164, 0, 152, 161, 0, 180, 182, 0, 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 281, 160, 0, 162, 0, 174, 0, 171, 182, 176, 177, 178, 179, 143, 145, 141, 149, 139, 147, 0, 165, 163, 181, 172, 182, 0, 150, 169, 0, 156, 166, 0, 182, 0, 170, 167, 182, 168, }; static const YYINT yydgoto[] = { 1, 2, 6, 4, 3, 133, 88, 75, 89, 90, 134, 247, 270, 159, 356, 426, 422, 427, 491, 492, 666, 68, 69, 70, 71, 72, 73, 74, 149, 81, 150, 233, 316, 271, 317, 346, 135, 136, 454, 153, 82, 154, 236, 238, 350, 349, 98, 78, 99, 168, 76, 157, 83, 158, 240, 241, 420, 531, 488, 486, 137, 489, 487, 643, 593, 680, 707, 705, 703, 704, 708, 706, 735, 592, 668, 692, 682, 709, 740, 573, 689, 698, 713, 742, 672, 694, 699, 700, 701, 702, 717, 94, 77, 95, 164, 165, 361, 362, 363, 364, 365, 366, 500, 428, 367, 504, 429, 368, 508, 430, 369, 512, 431, 556, 551, 565, 560, 574, 569, 547, 538, 557, 566, 575, 548, 558, 612, 567, 620, 576, 577, 628, 549, 598, 604, 613, 621, 629, 550, 610, 603, 602, 647, 646, 263, 659, 650, 632, 59, 319, 484, 139, 140, 141, 142, 143, 144, 145, 189, 146, 256, 293, 261, 373, 297, 300, 282, 264, 267, 295, 272, 276, 289, 291, 265, 301, 283, 298, 381, 463, 273, 396, 471, 521, 485, 458, 277, }; static const YYINT yysindex[] = { 0, 0, 0, 19, 0, 5159, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 50, 2508, 2617, 72, 4771, 2714, 2823, 2920, 0, 88, 140, 144, 0, 120, 0, 0, 0, 0, 5159, 151, 0, 170, 5159, 0, 0, 1192, 1192, 4771, 4771, 4771, 4771, 0, 0, 0, 0, 200, 210, 214, 227, 230, 238, 270, 276, 289, 291, 294, 306, 319, 344, 61, 352, 362, 365, 377, 0, 392, 395, 0, 173, 398, 400, 0, 315, 206, 14, 320, 325, 0, 0, 0, 349, 0, 219, 5159, 0, 0, 402, 5159, 0, 0, 0, 5159, 233, 218, 303, 61, 4771, 0, 281, 401, 283, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4577, 4868, 4771, 4771, 4771, 4771, 4771, 0, 0, 405, 0, 4771, 4771, 4771, 4771, 4771, 412, 0, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 4771, 0, 0, 404, 4480, 0, 406, 5214, 0, 0, 413, 419, 420, 0, -12, 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, 423, 407, 425, 431, 434, 442, 448, 0, 315, 449, 446, 447, 453, 0, 405, 450, 0, 205, 0, 451, 0, 455, 457, 131, 167, 458, 0, 465, 461, 468, 4771, 471, 169, 467, 474, 0, 475, 476, 480, 478, 484, 0, 486, 482, 0, 488, 485, 206, 206, 14, 320, 320, 325, 325, 0, 0, 0, 4965, 1116, 4771, 498, 497, 0, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 501, 0, 246, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 433, 0, 625, 506, 0, 0, 287, 0, 0, 4771, -27, 503, 0, 4771, 0, 4577, 4771, 0, 4771, 0, 0, 0, 0, 4771, 0, 507, 513, 0, 0, 4771, 0, 0, 464, 0, 22, 0, 0, 4771, 0, 4771, 0, 0, 0, 5062, 0, 0, 0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 24, 515, 1381, 1478, 1587, 1684, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 516, 519, 520, 0, -27, 0, 0, 522, 0, 0, -34, 525, 0, 526, 528, 0, 0, 0, 0, 0, 0, 491, 495, 221, 217, 0, 527, 544, 527, 527, 0, 537, 535, 0, 542, 0, 0, 1793, 0, 0, 0, 0, 760, 0, 0, 0, 857, 0, 0, 0, 1890, 0, 0, 61, 61, 4771, 4771, 0, 4771, 539, 540, 0, -34, 4771, 61, 541, 543, 4771, 0, 5062, 0, 0, 0, 0, 0, 0, 339, 0, 546, 0, 334, 0, 0, 0, 0, 0, 549, 1999, 0, 551, 0, 550, 0, 0, 0, 554, 966, 0, 555, 243, 556, 0, 0, 0, 557, 1063, 0, 559, 250, 560, 0, 0, 0, 564, 2096, 0, 563, 566, 0, 0, 0, 0, 457, 4771, 4771, 0, 0, 0, 4771, 4771, 0, 0, 534, 534, 0, 0, 0, 0, 568, 0, 0, 0, 0, 547, 548, 0, 0, 0, 0, 0, 0, 0, 569, 530, 0, 0, 0, 0, 4674, 0, 570, 552, 0, 0, 0, 0, 553, 0, 571, 558, 4380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5159, 0, 339, 0, 0, -4, -4, 286, 0, 584, 0, 0, 5159, 315, 0, 0, 5159, 0, 0, 0, 0, 5159, 0, 203, 581, 0, 0, 2205, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 564, 582, 0, 586, 0, 0, 0, -2, 0, 0, 580, 0, 0, 0, -1, 0, 585, 587, 588, 527, 527, 527, 597, 527, 527, 534, 0, 0, 0, 589, 0, 3, 0, 592, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, 2302, 0, 0, 4, 0, 0, 591, 0, 5, 0, 0, 0, 0, }; static const YYINT yyrindex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 138, 0, 0, 0, 141, 0, 0, 298, 427, 388, 388, 388, 388, 0, 0, 0, 0, 3004, 3043, 3082, 3121, 3166, 3205, 3250, 3289, 3328, 3367, 3412, 3451, 3496, 3535, 0, 3574, 3613, 3658, 3697, 0, 3742, 3781, 0, 0, 3820, 3859, 0, 477, 4234, 4150, 4027, 3904, 0, 0, 0, 0, 0, 0, 179, 0, 0, 594, 225, 0, 0, 0, 259, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 388, 388, 388, 388, 129, 388, 388, 388, 388, 388, 388, 274, 388, 0, 0, 0, 0, 388, 388, 388, 388, 388, 0, 0, 284, 323, 388, 388, 388, 388, 388, 388, 388, 388, 388, 0, 0, 0, 388, 0, 0, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 602, 0, 488, 0, 0, 604, 0, 0, 106, 0, 465, 615, 0, 357, 598, 0, 0, 0, 0, 1377, 0, 0, 616, 0, 0, 0, 0, 0, 474, 0, 388, 0, 0, 0, 0, 0, 0, 618, 0, 621, 0, 0, 0, 484, 0, 0, 623, 4273, 4312, 4189, 4066, 4105, 3943, 3988, 0, 0, 0, 388, 860, 388, 969, 0, 0, 595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 626, 0, 388, 0, 388, 388, 0, 388, 0, 0, 0, 0, 388, 0, 627, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 388, 0, 388, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 935, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 60, 0, 0, 0, 95, 0, 0, 0, 600, 0, 0, 0, 0, 388, 388, 0, 388, 0, 0, 0, 0, 388, 0, 0, 0, 388, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 115, 127, 0, 53, 0, 23, 0, 0, 0, 0, 0, 0, 180, 0, 60, 0, 0, 0, 0, 0, 0, 118, 0, 95, 0, 0, 0, 0, 0, 0, 0, 629, 600, 0, 0, 0, 0, 0, 0, 0, 632, 388, 388, 0, 0, 0, 388, 388, 0, 0, 1272, 629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2411, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1175, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 629, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 236, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1272, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2411, 0, 0, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 222, 0, 0, 0, 0, }; static const YYINT yygindex[] = { 0, 0, 0, 0, 0, 9, 0, 0, 0, 562, -161, 0, -122, 0, 0, 0, 0, 213, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 504, 0, 0, -106, 342, 343, -5, 2, 0, 0, 0, 505, 0, 0, 0, 0, 0, 0, 567, 0, 0, 0, 0, 518, 0, 0, 0, -335, 0, 0, 41, 0, 0, -575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -70, 0, 0, 0, 0, -420, 0, -664, 0, 0, 21, 0, -579, -482, -466, -478, 0, 0, 0, 575, 0, 0, 0, 57, 59, 52, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 117, 112, 143, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 7, 0, 0, 0, 178, 479, 181, 176, -80, 0, 0, 609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 317, 0, 0, 191, 171, 0, 196, }; #define YYTABLESIZE 5311 static const YYINT yytable[] = { 57, 249, 424, 212, 289, 355, 182, 58, 499, 503, 507, 511, 425, 671, 56, 696, 714, 719, 644, 546, 555, 732, 743, 747, 192, 193, 194, 715, 475, 476, 460, 182, 424, 477, 255, 257, 258, 259, 260, 248, 564, 519, 493, 225, 226, 280, 254, 284, 461, 61, 62, 63, 286, 5, 520, 64, 292, 222, 223, 65, 462, 274, 209, 79, 66, 67, 91, 210, 182, 546, 182, 182, 57, 57, 555, 744, 57, 57, 57, 58, 58, 138, 80, 58, 58, 58, 93, 97, 100, 57, 148, 152, 156, 57, 262, 266, 58, 275, 251, 564, 58, 281, 182, 93, 191, 182, 182, 97, 160, 288, 290, 6, 6, 6, 296, 299, 478, 6, 211, 720, 333, 6, 333, 275, 395, 333, 6, 6, 433, 433, 305, 7, 7, 7, 730, 276, 720, 7, 182, 182, 182, 7, 306, 391, 57, 389, 7, 7, 57, 309, 310, 58, 57, 533, 534, 58, 222, 223, 148, 58, 161, 255, 152, 138, 162, 720, 156, 167, 84, 184, 184, 184, 112, 112, 112, 184, 85, 86, 112, 184, 87, 390, 112, 398, 184, 184, 169, 112, 112, 219, 433, 433, 222, 223, 222, 223, 138, 138, 138, 138, 138, 357, 358, 359, 360, 278, 279, 138, 412, 138, 38, 38, 38, 195, 138, 287, 38, 686, 138, 384, 38, 665, 253, 196, 385, 38, 38, 197, 222, 223, 224, 528, 347, 683, 234, 318, 529, 684, 244, 348, 198, 527, 685, 199, 354, 182, 222, 223, 693, 243, 423, 200, 670, 695, 695, 695, 98, 98, 98, 695, 695, 695, 98, 618, 182, 182, 98, 182, 222, 223, 626, 98, 98, 459, 60, 222, 223, 465, 253, 255, 467, 251, 468, 201, 182, 182, 138, 469, 399, 202, 122, 122, 122, 473, 182, 182, 122, 250, 404, 252, 122, 479, 203, 480, 204, 122, 122, 205, 347, 417, 418, 419, 361, 318, 361, 348, 741, 361, 361, 206, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 207, 182, 182, 361, 6, 395, 253, 361, 222, 223, 227, 228, 361, 361, 361, 674, 675, 676, 677, 678, 229, 230, 361, 361, 7, 208, 361, 231, 232, 245, 246, 456, 457, 213, 590, 452, 724, 725, 726, 283, 728, 729, 453, 214, 283, 436, 215, 283, 283, 283, 283, 283, 283, 283, 283, 283, 594, 595, 216, 578, 579, 421, 184, 599, 600, 112, 182, 182, 302, 303, 587, 307, 308, 217, 305, 306, 218, 580, 581, 220, 275, 221, 483, 237, 251, 586, 285, 294, 311, 371, 320, 57, 57, 57, 57, 639, 640, 351, 58, 58, 58, 58, 352, 38, 353, 498, 498, 498, 498, 357, 370, 357, 372, 374, 357, 357, 375, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 376, 377, 378, 357, 379, 380, 382, 357, 387, 383, 386, 391, 357, 357, 357, 388, 637, 638, 392, 393, 98, 394, 357, 357, 397, 399, 357, 400, 401, 432, 332, 57, 332, 403, 402, 332, 404, 405, 58, 406, 407, 408, 559, 409, 57, 544, 568, 332, 332, 332, 413, 58, 414, 332, 122, 415, 416, 332, 498, 455, 474, 464, 332, 332, 332, 470, 472, 138, 490, 483, 495, 513, 332, 332, 530, 514, 332, 545, 515, 516, 518, 57, 554, 522, 523, 525, 563, 524, 58, 526, 572, 532, 535, 361, 536, 544, 559, 537, 583, 584, 588, 648, 589, 597, 605, 568, 608, 611, 57, 614, 617, 357, 622, 619, 625, 58, 630, 627, 635, 641, 601, 636, 498, 645, 651, 655, 660, 545, 138, 138, 609, 681, 360, 687, 358, 711, 554, 716, 657, 712, 721, 359, 722, 723, 727, 563, 731, 733, 745, 104, 335, 317, 106, 631, 572, 425, 317, 448, 654, 317, 317, 317, 317, 317, 317, 317, 317, 317, 411, 452, 664, 427, 642, 642, 413, 57, 396, 182, 494, 412, 437, 438, 58, 182, 182, 453, 268, 57, 596, 498, 163, 57, 235, 410, 58, 411, 57, 239, 58, 736, 649, 498, 57, 58, 170, 498, 572, 673, 166, 58, 498, 652, 656, 433, 242, 434, 498, 435, 436, 437, 616, 624, 357, 667, 669, 634, 661, 658, 679, 607, 710, 29, 438, 439, 440, 441, 442, 443, 444, 591, 517, 466, 304, 445, 446, 688, 44, 447, 46, 47, 190, 697, 585, 582, 448, 449, 0, 450, 0, 451, 0, 0, 0, 0, 631, 0, 0, 0, 0, 0, 57, 697, 332, 0, 0, 0, 718, 58, 697, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 642, 0, 0, 0, 0, 0, 697, 0, 0, 0, 734, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 667, 102, 103, 0, 0, 737, 0, 553, 0, 697, 104, 105, 106, 746, 697, 0, 0, 748, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 562, 325, 0, 104, 105, 106, 0, 325, 325, 325, 325, 325, 325, 325, 325, 325, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 320, 0, 320, 320, 320, 320, 320, 320, 320, 320, 320, 0, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 615, 318, 0, 104, 105, 106, 0, 318, 318, 318, 318, 318, 318, 318, 318, 318, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 552, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 623, 0, 0, 104, 105, 106, 321, 0, 321, 321, 321, 321, 321, 321, 321, 321, 321, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 561, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 0, 0, 0, 0, 322, 0, 323, 324, 325, 326, 327, 0, 0, 0, 0, 182, 182, 182, 182, 182, 0, 182, 29, 328, 329, 330, 0, 332, 333, 334, 182, 182, 0, 0, 335, 336, 337, 44, 338, 46, 47, 339, 0, 0, 0, 340, 341, 342, 343, 0, 344, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 552, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 174, 177, 180, 183, 186, 172, 173, 175, 176, 178, 179, 181, 182, 184, 185, 187, 188, 171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 561, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 318, 0, 0, 0, 0, 318, 0, 497, 318, 318, 318, 318, 318, 318, 318, 318, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 496, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 510, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 501, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 505, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 542, 543, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 540, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 509, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 539, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 542, 543, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 540, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 570, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 539, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 570, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 182, 182, 182, 182, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, 690, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 182, 0, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 0, 0, 182, 182, 182, 182, 0, 182, 182, 182, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 738, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 182, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 92, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 96, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 147, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 296, 0, 296, 0, 0, 296, 296, 0, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 0, 0, 0, 296, 0, 0, 0, 296, 0, 0, 0, 0, 296, 296, 296, 0, 0, 0, 0, 297, 0, 297, 296, 296, 297, 297, 296, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 0, 0, 151, 297, 0, 0, 0, 297, 0, 0, 0, 0, 297, 297, 297, 0, 0, 0, 0, 298, 0, 298, 297, 297, 298, 298, 297, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 0, 0, 0, 298, 0, 0, 0, 298, 0, 0, 0, 0, 298, 298, 298, 0, 0, 0, 0, 299, 0, 299, 298, 298, 299, 299, 298, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 0, 0, 0, 299, 0, 0, 0, 299, 0, 0, 0, 0, 299, 299, 299, 0, 0, 0, 0, 0, 0, 155, 299, 299, 0, 300, 299, 300, 0, 0, 300, 300, 0, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 0, 0, 0, 300, 0, 0, 0, 300, 0, 0, 0, 0, 300, 300, 300, 0, 0, 0, 0, 311, 0, 311, 300, 300, 311, 311, 300, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, 0, 0, 0, 311, 0, 0, 0, 311, 0, 0, 0, 0, 311, 311, 311, 0, 0, 0, 0, 0, 0, 296, 311, 311, 0, 312, 311, 312, 0, 0, 312, 312, 0, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 0, 0, 0, 312, 0, 0, 0, 312, 0, 0, 0, 0, 312, 312, 312, 297, 0, 0, 0, 315, 0, 315, 312, 312, 315, 315, 312, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 0, 0, 0, 315, 0, 0, 0, 315, 0, 0, 0, 0, 315, 315, 315, 298, 0, 0, 0, 319, 0, 319, 315, 315, 319, 319, 315, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 0, 0, 0, 319, 0, 0, 0, 319, 0, 0, 0, 0, 319, 319, 319, 299, 0, 0, 0, 294, 0, 294, 319, 319, 294, 294, 319, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 0, 0, 0, 294, 0, 0, 0, 294, 0, 0, 0, 0, 294, 294, 294, 0, 0, 0, 0, 0, 0, 300, 294, 294, 0, 295, 294, 295, 0, 0, 295, 295, 0, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 0, 0, 0, 295, 0, 0, 0, 295, 0, 0, 0, 0, 295, 295, 295, 311, 0, 0, 0, 314, 0, 314, 295, 295, 314, 314, 295, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 0, 0, 0, 314, 0, 0, 0, 314, 0, 0, 0, 0, 314, 314, 314, 0, 0, 0, 0, 0, 0, 312, 314, 314, 0, 310, 314, 310, 0, 0, 310, 310, 0, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 0, 0, 0, 310, 0, 0, 0, 310, 0, 0, 0, 0, 310, 310, 310, 315, 0, 0, 0, 322, 0, 322, 310, 310, 322, 322, 310, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 0, 0, 0, 322, 0, 0, 0, 322, 0, 0, 0, 0, 322, 322, 322, 319, 0, 0, 0, 327, 0, 327, 322, 322, 327, 327, 322, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 0, 0, 0, 327, 0, 0, 0, 327, 0, 0, 0, 0, 327, 327, 327, 294, 0, 0, 0, 328, 0, 328, 327, 327, 328, 328, 327, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 0, 0, 0, 328, 0, 0, 0, 328, 0, 0, 0, 0, 328, 328, 328, 0, 0, 0, 0, 0, 0, 295, 328, 328, 0, 329, 328, 329, 0, 0, 329, 329, 0, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 0, 0, 0, 329, 0, 0, 0, 329, 0, 0, 0, 0, 329, 329, 329, 314, 0, 0, 0, 330, 0, 330, 329, 329, 330, 330, 329, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 0, 0, 0, 330, 0, 0, 0, 330, 0, 0, 0, 0, 330, 330, 330, 0, 0, 0, 0, 0, 0, 310, 330, 330, 0, 331, 330, 331, 0, 0, 331, 331, 0, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 0, 0, 0, 331, 0, 0, 0, 331, 0, 0, 0, 0, 331, 331, 331, 322, 0, 0, 0, 313, 0, 313, 331, 331, 313, 313, 331, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 0, 0, 0, 313, 0, 0, 0, 313, 0, 0, 0, 0, 313, 313, 313, 327, 0, 0, 0, 308, 0, 308, 313, 313, 308, 308, 313, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 0, 0, 0, 308, 0, 0, 0, 308, 0, 0, 0, 0, 308, 308, 308, 328, 0, 0, 0, 309, 0, 309, 308, 308, 309, 309, 308, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, 0, 0, 0, 309, 0, 0, 0, 309, 0, 0, 0, 0, 309, 309, 309, 0, 0, 0, 0, 0, 0, 329, 309, 309, 0, 345, 309, 345, 0, 0, 345, 345, 0, 345, 345, 345, 345, 345, 0, 0, 345, 345, 345, 345, 345, 0, 0, 0, 345, 0, 0, 0, 345, 0, 0, 0, 0, 345, 345, 345, 330, 0, 0, 0, 346, 0, 346, 345, 345, 346, 346, 345, 346, 346, 346, 346, 346, 0, 0, 346, 346, 346, 346, 346, 0, 0, 0, 346, 0, 0, 0, 346, 0, 0, 0, 0, 346, 346, 346, 0, 0, 0, 0, 0, 0, 331, 346, 346, 0, 347, 346, 347, 0, 0, 347, 347, 0, 347, 347, 347, 347, 347, 0, 0, 347, 347, 347, 347, 347, 0, 0, 0, 347, 0, 0, 0, 347, 0, 0, 0, 0, 347, 347, 347, 313, 0, 0, 0, 342, 0, 342, 347, 347, 342, 342, 347, 0, 0, 342, 342, 342, 0, 0, 342, 342, 342, 342, 342, 0, 0, 0, 342, 0, 0, 0, 342, 0, 0, 0, 0, 342, 342, 342, 308, 0, 0, 0, 343, 0, 343, 342, 342, 343, 343, 342, 0, 0, 343, 343, 343, 0, 0, 343, 343, 343, 343, 343, 0, 0, 0, 343, 0, 0, 0, 343, 0, 0, 0, 0, 343, 343, 343, 309, 0, 0, 0, 344, 0, 344, 343, 343, 344, 344, 343, 0, 0, 344, 344, 344, 0, 0, 344, 344, 344, 344, 344, 0, 0, 0, 344, 0, 0, 0, 344, 0, 0, 0, 0, 344, 344, 344, 0, 0, 0, 0, 0, 0, 345, 344, 344, 0, 340, 344, 340, 0, 0, 340, 340, 0, 0, 0, 340, 340, 340, 0, 0, 0, 0, 340, 340, 340, 0, 0, 0, 340, 0, 0, 0, 340, 0, 0, 0, 0, 340, 340, 340, 346, 0, 0, 0, 341, 0, 341, 340, 340, 341, 341, 340, 0, 0, 341, 341, 341, 0, 0, 0, 0, 341, 341, 341, 0, 0, 0, 341, 0, 0, 0, 341, 0, 0, 0, 0, 341, 341, 341, 0, 0, 0, 0, 0, 0, 347, 341, 341, 0, 337, 341, 337, 0, 0, 337, 337, 0, 0, 0, 0, 337, 337, 0, 0, 0, 0, 337, 337, 337, 0, 0, 0, 337, 0, 0, 0, 337, 0, 0, 0, 0, 337, 337, 337, 342, 0, 0, 0, 338, 0, 338, 337, 337, 338, 338, 337, 0, 0, 0, 338, 338, 0, 0, 0, 0, 338, 338, 338, 0, 0, 0, 338, 0, 0, 0, 338, 0, 0, 0, 0, 338, 338, 338, 343, 0, 0, 0, 339, 0, 339, 338, 338, 339, 339, 338, 0, 0, 0, 339, 339, 0, 0, 0, 0, 339, 339, 339, 0, 0, 0, 339, 0, 0, 0, 339, 0, 0, 0, 0, 339, 339, 339, 344, 0, 0, 0, 0, 0, 0, 339, 339, 0, 0, 339, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 662, 101, 0, 0, 102, 103, 663, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 340, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 341, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 0, 0, 0, 7, 8, 9, 10, 11, 0, 12, 0, 101, 337, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 338, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 312, 313, 314, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 315, 120, 121, 122, 44, 123, 46, 47, 124, 49, 339, 125, 126, 127, 128, 129, 130, 131, 13, 132, 268, 8, 9, 10, 11, 210, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 269, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 653, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 274, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 38, 39, 315, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 101, 0, 0, 102, 103, 0, 0, 0, 0, 0, 0, 0, 104, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 109, 110, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 111, 112, 113, 114, 115, 20, 21, 22, 23, 24, 25, 26, 0, 27, 0, 28, 29, 116, 117, 118, 33, 34, 35, 119, 37, 481, 482, 40, 120, 121, 122, 44, 123, 46, 47, 124, 49, 0, 125, 126, 127, 128, 129, 130, 131, 13, 132, 7, 8, 9, 10, 11, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 321, 27, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 50, 51, 52, 53, 0, 54, 13, 55, 0, 0, 0, 0, 0, 0, 322, 0, 323, 324, 325, 326, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 328, 329, 330, 331, 332, 333, 334, 0, 0, 0, 0, 335, 336, 337, 44, 338, 46, 47, 339, 0, 0, 0, 340, 341, 342, 343, 0, 344, 0, 345, }; static const YYINT yycheck[] = { 5, 162, 8, 125, 15, 17, 17, 5, 428, 429, 430, 431, 18, 17, 5, 18, 18, 18, 593, 497, 502, 18, 18, 18, 104, 105, 106, 691, 6, 7, 57, 8, 8, 11, 195, 196, 197, 198, 199, 161, 506, 75, 18, 29, 30, 206, 14, 208, 75, 31, 32, 33, 213, 34, 88, 37, 217, 25, 26, 41, 87, 8, 1, 34, 46, 47, 16, 6, 45, 547, 10, 11, 77, 78, 556, 739, 81, 82, 83, 77, 78, 80, 66, 81, 82, 83, 77, 78, 16, 94, 81, 82, 83, 98, 200, 201, 94, 203, 45, 565, 98, 207, 42, 94, 103, 10, 11, 98, 20, 215, 216, 31, 32, 33, 220, 221, 94, 37, 57, 698, 14, 41, 16, 8, 285, 19, 46, 47, 10, 11, 15, 31, 32, 33, 709, 8, 715, 37, 43, 10, 11, 41, 15, 14, 149, 14, 46, 47, 153, 229, 230, 149, 157, 488, 489, 153, 25, 26, 149, 157, 20, 43, 153, 162, 20, 744, 157, 16, 48, 31, 32, 33, 31, 32, 33, 37, 56, 57, 37, 41, 60, 14, 41, 14, 46, 47, 16, 46, 47, 16, 10, 11, 25, 26, 25, 26, 195, 196, 197, 198, 199, 42, 43, 44, 45, 204, 205, 206, 314, 208, 31, 32, 33, 13, 213, 214, 37, 14, 217, 14, 41, 641, 42, 13, 19, 46, 47, 13, 25, 26, 24, 14, 237, 653, 15, 234, 19, 657, 20, 237, 13, 20, 662, 13, 256, 256, 25, 26, 668, 16, 256, 13, 256, 256, 256, 256, 31, 32, 33, 256, 256, 256, 37, 20, 42, 43, 41, 45, 25, 26, 20, 46, 47, 379, 256, 25, 26, 383, 42, 43, 386, 45, 388, 13, 10, 11, 285, 393, 14, 13, 31, 32, 33, 399, 10, 11, 37, 16, 14, 16, 41, 407, 13, 409, 13, 46, 47, 13, 313, 63, 64, 65, 14, 312, 16, 313, 736, 19, 20, 13, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 13, 10, 11, 37, 256, 14, 16, 41, 25, 26, 22, 23, 46, 47, 48, 61, 62, 63, 64, 65, 27, 28, 56, 57, 256, 13, 60, 10, 11, 58, 59, 76, 77, 13, 527, 372, 703, 704, 705, 14, 707, 708, 372, 13, 19, 20, 13, 22, 23, 24, 25, 26, 27, 28, 29, 30, 49, 50, 13, 513, 514, 352, 256, 61, 62, 256, 10, 11, 222, 223, 524, 227, 228, 13, 225, 226, 13, 515, 516, 13, 518, 13, 413, 13, 15, 523, 13, 7, 16, 14, 16, 428, 429, 430, 431, 588, 589, 16, 428, 429, 430, 431, 15, 256, 16, 428, 429, 430, 431, 14, 19, 16, 19, 14, 19, 20, 14, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 19, 14, 14, 37, 19, 19, 14, 41, 14, 20, 20, 14, 46, 47, 48, 19, 583, 584, 14, 19, 256, 14, 56, 57, 14, 19, 60, 14, 14, 57, 14, 497, 16, 14, 19, 19, 19, 14, 497, 14, 19, 14, 502, 19, 510, 497, 506, 31, 32, 33, 13, 510, 16, 37, 256, 14, 16, 41, 510, 14, 57, 19, 46, 47, 48, 19, 14, 527, 18, 529, 16, 20, 56, 57, 8, 20, 60, 497, 20, 20, 19, 547, 502, 19, 19, 55, 506, 20, 547, 55, 510, 8, 16, 256, 20, 547, 556, 16, 20, 20, 20, 15, 20, 18, 16, 565, 16, 18, 574, 16, 16, 42, 16, 18, 16, 574, 13, 18, 16, 46, 540, 16, 574, 16, 16, 16, 16, 547, 588, 589, 550, 8, 45, 13, 43, 14, 556, 18, 46, 14, 16, 44, 16, 16, 8, 565, 18, 16, 18, 16, 16, 14, 14, 573, 574, 14, 19, 14, 618, 22, 23, 24, 25, 26, 27, 28, 29, 30, 14, 14, 630, 14, 592, 593, 14, 641, 14, 8, 426, 14, 14, 14, 641, 44, 16, 14, 16, 653, 536, 641, 89, 657, 149, 312, 653, 313, 662, 153, 657, 730, 604, 653, 668, 662, 98, 657, 626, 647, 94, 668, 662, 613, 621, 49, 157, 51, 668, 53, 54, 55, 556, 565, 256, 643, 644, 574, 629, 626, 648, 547, 684, 67, 68, 69, 70, 71, 72, 73, 74, 529, 464, 385, 224, 79, 80, 665, 82, 83, 84, 85, 102, 671, 522, 518, 90, 91, -1, 93, -1, 95, -1, -1, -1, -1, 684, -1, -1, -1, -1, -1, 736, 691, 256, -1, -1, -1, 696, 736, 698, -1, -1, -1, -1, -1, 736, -1, -1, -1, -1, 709, -1, -1, -1, -1, -1, 715, -1, -1, -1, 719, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, 730, 12, 13, -1, -1, 735, -1, 18, -1, 739, 21, 22, 23, 743, 744, -1, -1, 747, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, 16, -1, 21, 22, 23, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, 16, -1, 21, 22, 23, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, 18, -1, -1, 21, 22, 23, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, -1, -1, -1, -1, 49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, 67, 68, 69, 70, -1, 72, 73, 74, 16, 17, -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, 91, 92, 93, -1, 95, -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, 256, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, 14, -1, -1, -1, -1, 19, -1, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, 256, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, 14, -1, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, 256, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, 29, 30, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, -1, -1, 24, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, 24, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, -1, -1, -1, 256, 56, 57, -1, 14, 60, 16, -1, -1, 19, 20, -1, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, 14, -1, 16, 56, 57, 19, 20, 60, -1, -1, -1, 25, 26, -1, -1, -1, -1, 31, 32, 33, -1, -1, -1, 37, -1, -1, -1, 41, -1, -1, -1, -1, 46, 47, 48, 256, -1, -1, -1, -1, -1, -1, 56, 57, -1, -1, 60, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, 8, 9, -1, -1, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, 256, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, -1, -1, -1, 1, 2, 3, 4, 5, -1, 7, -1, 9, 256, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, 256, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 256, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, 6, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, 8, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, 9, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, 36, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1, 2, 3, 4, 5, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 8, 64, -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, 49, -1, 51, 52, 53, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, 90, 91, 92, 93, -1, 95, -1, 97, }; #define YYFINAL 1 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 256 #define YYUNDFTOKEN 445 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) #if YYDEBUG static const char *const yyname[] = { "end-of-file","NAME","FONT_NAME","COLOR_NAME","ARGUMENT_NAME","REASON_NAME", "CHARSET_NAME","ENUMVAL_NAME","CLASS_NAME","UNS_FLOAT_LITERAL","COMP_STRING", "CHAR_8_LITERAL","UNS_INT_LITERAL","LEFT_PAREN","RIGHT_PAREN","COLON", "SEMICOLON","LEFT_BRACE","RIGHT_BRACE","COMMA","EQUAL_SIGN","NOT","PLUS", "MINUS","AND","OR","XOR","MULTIPLY","DIVIDE","LEFT_SHIFT","RIGHT_SHIFT","LIST", "IDENTIFIER","END","MODULE","UILTRUE","UILFALSE","INCLUDE","MACRO","ON","OFF", "VALUE","ARGUMENTS","CALLBACKS","PROCEDURES","CONTROLS","PROCEDURE","OBJECT", "OBJECTS","WIDGET","GADGET","FONT","ARGUMENT","REASON","PIXMAP","COLOR","NAMES", "CHARACTER_SET","CASE_SENSITIVE","CASE_INSENSITIVE","VERSION","MANAGED", "UNMANAGED","PRIVATE","IMPORTED","EXPORTED","UILFILE","STRING_TABLE", "TRANSLATION_TABLE","COMPOUND_STRING","FONT_TABLE","ANY","STRING","BOOLEAN", "ICON","RIGHT_TO_LEFT","BACKGROUND","FOREGROUND","COLOR_TABLE","FLOAT", "INTEGER","CLASS_REC_NAME","ASCIZ_TABLE","INTEGER_TABLE","ASCIZ_STRING_TABLE", "COMPOUND_STRING_TABLE","XBITMAPFILE","SEPARATE","SIXTEEN_BIT","POUND","KEYSYM", "SINGLE_FLOAT","RGB","WIDE_CHARACTER","LOC_STRING","FONTSET","CHILD_NAME", "COMPOUND_STRING_COMPONENT","IN","CM","MM","PT","FU","PIXEL","PIXELS","INCH", "INCHES","CENTIMETER","CENTIMETERS","MILLIMETER","MILLIMETERS","POINT","POINTS", "FONT_UNIT","FONT_UNITS","PIX",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol", }; static const char *const yyrule[] = { "$accept : module_block", "$$1 :", "module_block : module_header $$1 module_declaration_list END MODULE SEMICOLON", "$$2 :", "$$3 :", "module_header : $$2 MODULE id $$3 opt_module_clauses", "opt_module_clauses :", "opt_module_clauses : module_clauses", "module_clauses : module_clause", "module_clauses : module_clauses module_clause", "module_clause : VERSION EQUAL_SIGN character_8_value", "module_clause : NAMES EQUAL_SIGN sensitivity_value", "module_clause : CHARACTER_SET EQUAL_SIGN valid_charset", "$$4 :", "module_clause : OBJECTS $$4 EQUAL_SIGN variant_spec", "sensitivity_value : CASE_SENSITIVE", "sensitivity_value : CASE_INSENSITIVE", "variant_spec : LEFT_BRACE RIGHT_BRACE", "variant_spec : LEFT_BRACE variant_list RIGHT_BRACE", "$$5 :", "variant_spec : error $$5 RIGHT_BRACE", "variant_list : variant_clause SEMICOLON", "variant_list : variant_list variant_clause SEMICOLON", "$$6 :", "variant_list : error $$6 SEMICOLON", "$$7 :", "variant_clause : CLASS_NAME $$7 EQUAL_SIGN variant", "variant : WIDGET", "variant : GADGET", "module_declaration_list :", "module_declaration_list : module_declaration_list module_declaration", "module_declaration : value_declaration", "module_declaration : identifier_declaration", "module_declaration : procedure_declaration", "module_declaration : object_declaration", "module_declaration : list_declaration", "module_declaration : include_directive", "$$8 :", "value_declaration : VALUE $$8 value_declaration_list", "value_declaration_list : value_decl", "value_declaration_list : value_declaration_list value_decl", "$$9 :", "value_declaration_list : error $$9 SEMICOLON", "value_decl : id COLON value_definition SEMICOLON", "value_definition : EXPORTED private_value", "value_definition : PRIVATE private_value_plus", "value_definition : private_value_plus", "value_definition : IMPORTED value_type", "value_type : INTEGER", "value_type : STRING", "value_type : PIXMAP", "value_type : FLOAT", "value_type : BOOLEAN", "value_type : FONT", "value_type : REASON", "value_type : ARGUMENT", "value_type : COLOR", "value_type : string_table_type", "value_type : asciz_table_type", "value_type : INTEGER_TABLE", "value_type : TRANSLATION_TABLE", "value_type : FONT_TABLE", "value_type : ICON", "value_type : COMPOUND_STRING", "value_type : COMPOUND_STRING_COMPONENT", "value_type : CLASS_REC_NAME", "value_type : XBITMAPFILE", "value_type : KEYSYM", "value_type : SINGLE_FLOAT", "value_type : RGB", "value_type : WIDE_CHARACTER", "value_type : FONTSET", "value_type : WIDGET", "arg_value_type : INTEGER", "arg_value_type : STRING", "arg_value_type : PIXMAP", "arg_value_type : FLOAT", "arg_value_type : BOOLEAN", "arg_value_type : FONT", "arg_value_type : REASON", "arg_value_type : COLOR", "arg_value_type : string_table_type", "arg_value_type : asciz_table_type", "arg_value_type : INTEGER_TABLE", "arg_value_type : TRANSLATION_TABLE", "arg_value_type : FONT_TABLE", "arg_value_type : ICON", "arg_value_type : COMPOUND_STRING", "arg_value_type : KEYSYM", "arg_value_type : SINGLE_FLOAT", "arg_value_type : WIDE_CHARACTER", "arg_value_type : FONTSET", "arg_value_type : WIDGET", "string_table_type : STRING_TABLE", "string_table_type : COMPOUND_STRING_TABLE", "asciz_table_type : ASCIZ_TABLE", "asciz_table_type : ASCIZ_STRING_TABLE", "$$10 :", "procedure_declaration : PROCEDURE $$10 procedure_declaration_list", "procedure_declaration_list : procedure_decl", "procedure_declaration_list : procedure_declaration_list procedure_decl", "$$11 :", "procedure_declaration_list : error $$11 SEMICOLON", "procedure_decl : id opt_formal_parameters opt_class SEMICOLON", "opt_formal_parameters :", "opt_formal_parameters : LEFT_PAREN formal_parameter_type RIGHT_PAREN", "formal_parameter_type :", "formal_parameter_type : value_type", "formal_parameter_type : ANY", "formal_parameter_type : CLASS_NAME", "opt_class :", "$$12 :", "identifier_declaration : IDENTIFIER $$12 identifier_declaration_list", "identifier_declaration_list : identifier_decl", "identifier_declaration_list : identifier_declaration_list identifier_decl", "$$13 :", "identifier_declaration_list : error $$13 SEMICOLON", "identifier_decl : id SEMICOLON", "include_directive : INCLUDE UILFILE character_8_value SEMICOLON", "$$14 :", "include_directive : error $$14 SEMICOLON", "$$15 :", "object_declaration : OBJECT $$15 object_decl_list", "object_decl_list : object_decl SEMICOLON", "object_decl_list : object_decl_list object_decl SEMICOLON", "$$16 :", "object_decl_list : error $$16 SEMICOLON", "$$17 :", "object_decl : id $$17 COLON object_definition", "$$18 :", "object_definition : EXPORTED $$18 object_specification", "$$19 :", "object_definition : PRIVATE $$19 object_specification", "$$20 :", "object_definition : epsilon_production $$20 object_specification", "$$21 :", "$$22 :", "object_definition : IMPORTED $$21 CLASS_NAME $$22 opt_create_proc_ref epsilon_production", "$$23 :", "control_object_definition : EXPORTED $$23 object_specification", "$$24 :", "control_object_definition : PRIVATE $$24 object_specification", "$$25 :", "control_object_definition : MANAGED $$25 object_specification", "$$26 :", "control_object_definition : UNMANAGED $$26 object_specification", "$$27 :", "control_object_definition : epsilon_production $$27 object_specification", "$$28 :", "$$29 :", "control_object_definition : IMPORTED $$28 CLASS_NAME $$29 epsilon_production", "$$30 :", "object_specification : CLASS_NAME $$30 opt_create_proc_ref opt_variant object_spec", "opt_variant : epsilon_production", "opt_variant : variant", "$$31 :", "control_object_specification : CLASS_NAME $$31 opt_create_proc_ref opt_variant control_object_spec", "opt_create_proc_ref : epsilon_production", "opt_create_proc_ref : PROCEDURE id_ref opt_parens", "opt_parens : epsilon_production", "opt_parens : LEFT_PAREN RIGHT_PAREN", "object_spec : id_ref", "object_spec : LEFT_BRACE RIGHT_BRACE", "object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE", "$$32 :", "object_spec : error $$32 RIGHT_BRACE", "control_object_spec : id_ref", "control_object_spec : LEFT_BRACE RIGHT_BRACE epsilon_production", "control_object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production", "$$33 :", "control_object_spec : error $$33 RIGHT_BRACE", "child_object_spec : LEFT_BRACE RIGHT_BRACE epsilon_production", "child_object_spec : LEFT_BRACE object_feature_list RIGHT_BRACE epsilon_production", "$$34 :", "child_object_spec : error $$34 RIGHT_BRACE", "object_feature_list : object_feature", "object_feature_list : object_feature_list object_feature", "object_feature : argument_list_def SEMICOLON", "object_feature : callback_list_def SEMICOLON", "object_feature : control_list_def SEMICOLON", "$$35 :", "object_feature : error $$35 SEMICOLON", "epsilon_production :", "$$36 :", "list_declaration : LIST $$36 list_decl_list", "list_decl_list : list_decl SEMICOLON", "list_decl_list : list_decl_list list_decl SEMICOLON", "$$37 :", "list_decl_list : error $$37 SEMICOLON", "$$38 :", "list_decl : id $$38 COLON list_specification", "list_specification : control_list_specification", "list_specification : argument_list_specification", "list_specification : callback_list_specification", "list_specification : procedure_list_specification", "$$39 :", "control_list_specification : control_list_type $$39 control_list_spec", "$$40 :", "argument_list_specification : argument_list_type $$40 argument_list_spec", "$$41 :", "callback_list_specification : callback_list_type $$41 callback_list_spec", "$$42 :", "procedure_list_specification : procedure_list_type $$42 procedure_list_spec", "argument_list_type : ARGUMENTS", "callback_list_type : CALLBACKS", "procedure_list_type : PROCEDURES", "control_list_type : CONTROLS", "argument_list_spec : id_ref", "argument_list_spec : LEFT_BRACE RIGHT_BRACE", "argument_list_spec : LEFT_BRACE argument_list_clause_list RIGHT_BRACE", "$$43 :", "argument_list_spec : error $$43 RIGHT_BRACE", "callback_list_spec : id_ref", "callback_list_spec : LEFT_BRACE RIGHT_BRACE", "callback_list_spec : LEFT_BRACE callback_list_clause_list RIGHT_BRACE", "$$44 :", "callback_list_spec : error $$44 RIGHT_BRACE", "procedure_list_spec : id_ref", "procedure_list_spec : LEFT_BRACE RIGHT_BRACE", "procedure_list_spec : LEFT_BRACE procedure_list_clause_list RIGHT_BRACE", "$$45 :", "procedure_list_spec : error $$45 RIGHT_BRACE", "control_list_spec : id_ref", "control_list_spec : LEFT_BRACE RIGHT_BRACE", "control_list_spec : LEFT_BRACE control_list_clause_list RIGHT_BRACE", "$$46 :", "control_list_spec : error $$46 RIGHT_BRACE", "argument_list_clause_list : argument_list_clause", "argument_list_clause_list : argument_list_clause_list argument_list_clause", "callback_list_clause_list : callback_list_clause", "callback_list_clause_list : callback_list_clause_list callback_list_clause", "procedure_list_clause_list : procedure_list_clause", "procedure_list_clause_list : procedure_list_clause_list procedure_list_clause", "control_list_clause_list : control_list_clause", "control_list_clause_list : control_list_clause_list control_list_clause", "argument_list_clause : argument_list_def SEMICOLON", "argument_list_clause : argument_list_item SEMICOLON", "$$47 :", "argument_list_clause : error $$47 SEMICOLON", "callback_list_clause : callback_list_def SEMICOLON", "callback_list_clause : callback_list_item SEMICOLON", "$$48 :", "callback_list_clause : error $$48 SEMICOLON", "procedure_list_clause : procedure_list_def SEMICOLON", "procedure_list_clause : procedure_list_def_ref SEMICOLON", "$$49 :", "procedure_list_clause : error $$49 SEMICOLON", "control_list_clause : control_list_def SEMICOLON", "control_list_clause : control_list_item SEMICOLON", "$$50 :", "control_list_clause : error $$50 SEMICOLON", "$$51 :", "control_list_def : epsilon_production $$51 control_list_specification", "$$52 :", "argument_list_def : epsilon_production $$52 argument_list_specification", "$$53 :", "callback_list_def : epsilon_production $$53 callback_list_specification", "$$54 :", "procedure_list_def : epsilon_production $$54 procedure_list_specification", "control_list_item : opt_managed control_item", "$$55 :", "control_list_item : id $$55 COLON control_object_definition", "$$56 :", "control_list_item : CHILD_NAME opt_child_managed $$56 child_object_spec", "$$57 :", "control_list_item : CHILD_NAME UNMANAGED $$57 child_object_spec", "opt_child_managed : epsilon_production", "opt_child_managed : MANAGED", "argument_list_item : value EQUAL_SIGN value", "argument_list_item : value EQUAL_SIGN CLASS_NAME id_ref", "callback_list_item : value EQUAL_SIGN procedure_reference", "callback_list_item : value EQUAL_SIGN procedure_list_def", "$$58 :", "control_item : epsilon_production $$58 control_object_specification", "opt_managed : epsilon_production", "opt_managed : MANAGED", "opt_managed : UNMANAGED", "procedure_reference : PROCEDURE id_ref opt_procedure_argument", "procedure_list_def_ref : id_ref opt_procedure_argument", "opt_procedure_argument : epsilon_production", "opt_procedure_argument : LEFT_PAREN value RIGHT_PAREN", "opt_procedure_argument : LEFT_PAREN CLASS_NAME id_ref RIGHT_PAREN", "opt_procedure_argument : LEFT_PAREN RIGHT_PAREN", "id : NAME", "id : FONT_NAME", "id : COLOR_NAME", "id : ARGUMENT_NAME", "id : REASON_NAME", "id : ENUMVAL_NAME", "id : CHILD_NAME", "id : keyword", "id_ref : id", "keyword : STRING", "keyword : BOOLEAN", "keyword : FLOAT", "keyword : INTEGER", "keyword : FONT", "keyword : ARGUMENT", "keyword : REASON", "keyword : PIXMAP", "keyword : COLOR", "keyword : NAMES", "keyword : CASE_SENSITIVE", "keyword : CASE_INSENSITIVE", "keyword : VERSION", "keyword : MANAGED", "keyword : UNMANAGED", "keyword : UILFILE", "keyword : string_table_type", "keyword : asciz_table_type", "keyword : INTEGER_TABLE", "keyword : TRANSLATION_TABLE", "keyword : COMPOUND_STRING", "keyword : COMPOUND_STRING_COMPONENT", "keyword : CLASS_REC_NAME", "keyword : FONT_TABLE", "keyword : RIGHT_TO_LEFT", "keyword : CHARACTER_SET", "keyword : COLOR_TABLE", "keyword : ICON", "keyword : BACKGROUND", "keyword : FOREGROUND", "keyword : XBITMAPFILE", "keyword : SEPARATE", "keyword : ANY", "keyword : IMPORTED", "keyword : OBJECTS", "keyword : KEYSYM", "keyword : SINGLE_FLOAT", "keyword : RGB", "keyword : WIDE_CHARACTER", "keyword : FONTSET", "character_8_value : value", "private_value : value", "private_value_plus : non_export_value", "private_value_plus : value", "non_export_value : COLOR_TABLE LEFT_PAREN color_list RIGHT_PAREN", "value : value_1", "value : value OR value_1", "value : value XOR value_1", "value_1 : value_2", "value_1 : value_1 AND value_2", "value_2 : value_3", "value_2 : value_2 LEFT_SHIFT value_3", "value_2 : value_2 RIGHT_SHIFT value_3", "value_3 : value_4", "value_3 : value_3 PLUS value_4", "value_3 : value_3 MINUS value_4", "value_4 : value_5", "value_4 : value_4 MULTIPLY value_5", "value_4 : value_4 DIVIDE value_5", "value_5 : value_6", "value_5 : MINUS value_5", "value_5 : NOT value_5", "value_5 : PLUS value_5", "value_6 : operand", "value_6 : LEFT_PAREN value RIGHT_PAREN", "operand : UNS_INT_LITERAL", "operand : UNS_INT_LITERAL units_specification", "operand : optional_charset CHAR_8_LITERAL", "operand : id", "operand : UNS_FLOAT_LITERAL", "operand : UNS_FLOAT_LITERAL units_specification", "operand : PIXMAP LEFT_PAREN character_8_value RIGHT_PAREN", "operand : FONT LEFT_PAREN font_spec RIGHT_PAREN", "operand : FONTSET LEFT_PAREN fontset_spec RIGHT_PAREN", "operand : COLOR LEFT_PAREN color_spec RIGHT_PAREN", "operand : REASON LEFT_PAREN character_8_value RIGHT_PAREN", "operand : CLASS_REC_NAME LEFT_PAREN character_8_value RIGHT_PAREN", "operand : ARGUMENT LEFT_PAREN character_8_value opt_arg_type RIGHT_PAREN", "operand : UILTRUE", "operand : UILFALSE", "operand : ON", "operand : OFF", "operand : optional_charset COMP_STRING", "operand : string_table_type LEFT_PAREN comp_str_list RIGHT_PAREN", "operand : asciz_table_type LEFT_PAREN asciz_list RIGHT_PAREN", "operand : INTEGER_TABLE LEFT_PAREN integer_list RIGHT_PAREN", "operand : TRANSLATION_TABLE LEFT_PAREN string_list RIGHT_PAREN", "operand : COMPOUND_STRING LEFT_PAREN comp_str_result RIGHT_PAREN", "operand : COMPOUND_STRING_COMPONENT LEFT_PAREN comp_str_comp_result RIGHT_PAREN", "operand : FONT_TABLE LEFT_PAREN font_list RIGHT_PAREN", "operand : ICON LEFT_PAREN icon_spec RIGHT_PAREN", "operand : FLOAT LEFT_PAREN value RIGHT_PAREN", "operand : INTEGER LEFT_PAREN value RIGHT_PAREN", "operand : XBITMAPFILE LEFT_PAREN character_8_value RIGHT_PAREN", "operand : KEYSYM LEFT_PAREN character_8_value RIGHT_PAREN", "operand : SINGLE_FLOAT LEFT_PAREN value RIGHT_PAREN", "operand : RGB LEFT_PAREN rgb_list RIGHT_PAREN", "operand : WIDE_CHARACTER LEFT_PAREN wchar_str_result RIGHT_PAREN", "operand : LOC_STRING", "string_list :", "string_list : string_list_2", "string_list_2 : private_value", "string_list_2 : string_list_2 COMMA private_value", "asciz_list :", "asciz_list : asciz_list_2", "asciz_list_2 : private_value", "asciz_list_2 : asciz_list_2 COMMA private_value", "integer_list :", "integer_list : integer_list_2", "integer_list_2 : private_value", "integer_list_2 : integer_list_2 COMMA private_value", "rgb_list : private_value COMMA private_value COMMA private_value", "comp_str_list :", "comp_str_list : comp_str_list_2", "comp_str_list_2 : private_value", "comp_str_list_2 : comp_str_list_2 COMMA private_value", "opt_arg_type :", "opt_arg_type : COMMA arg_value_type", "opt_arg_type : COMMA ANY", "comp_str_result : private_value", "comp_str_result : private_value comp_str_attrs", "comp_str_comp_result : ENUMVAL_NAME", "comp_str_comp_result : ENUMVAL_NAME COMMA ENUMVAL_NAME", "comp_str_comp_result : ENUMVAL_NAME COMMA CHAR_8_LITERAL", "comp_str_comp_result : ENUMVAL_NAME COMMA LOC_STRING", "comp_str_comp_result : ENUMVAL_NAME COMMA CHARSET_NAME", "comp_str_attrs : COMMA comp_str_attr", "comp_str_attrs : comp_str_attrs COMMA comp_str_attr", "comp_str_attr : CHARACTER_SET EQUAL_SIGN valid_charset", "comp_str_attr : RIGHT_TO_LEFT EQUAL_SIGN private_value", "comp_str_attr : SEPARATE EQUAL_SIGN private_value", "wchar_str_result : private_value", "font_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset", "font_spec : character_8_value", "fontset_spec : character_8_value COMMA CHARACTER_SET EQUAL_SIGN valid_charset", "fontset_spec : character_8_value", "font_list : font_item", "font_list : font_list COMMA font_item", "font_item : valid_charset EQUAL_SIGN private_value", "font_item : private_value", "optional_charset : POUND valid_charset", "optional_charset : epsilon_production", "valid_charset : CHARSET_NAME", "valid_charset : CHARACTER_SET LEFT_PAREN charset_info RIGHT_PAREN", "valid_charset : NAME", "charset_info : character_8_value", "charset_info : character_8_value charset_attrs", "charset_attrs : COMMA charset_attr", "charset_attrs : charset_attrs COMMA charset_attr", "charset_attr : RIGHT_TO_LEFT EQUAL_SIGN private_value", "charset_attr : SIXTEEN_BIT EQUAL_SIGN private_value", "color_list : color_item", "color_list : color_list COMMA color_item", "color_item : BACKGROUND COLOR EQUAL_SIGN character_8_value", "color_item : FOREGROUND COLOR EQUAL_SIGN character_8_value", "color_item : value EQUAL_SIGN character_8_value", "color_spec : character_8_value", "color_spec : character_8_value COMMA mono_color_spec", "mono_color_spec : BACKGROUND", "mono_color_spec : FOREGROUND", "icon_spec : icon_rows", "icon_spec : COLOR_TABLE EQUAL_SIGN private_value COMMA icon_rows", "icon_rows : private_value", "icon_rows : icon_rows COMMA private_value", "units_specification : PIX", "units_specification : PIXEL", "units_specification : PIXELS", "units_specification : IN", "units_specification : INCH", "units_specification : INCHES", "units_specification : CM", "units_specification : CENTIMETER", "units_specification : CENTIMETERS", "units_specification : MM", "units_specification : MILLIMETER", "units_specification : MILLIMETERS", "units_specification : PT", "units_specification : POINT", "units_specification : POINTS", "units_specification : FU", "units_specification : FONT_UNIT", "units_specification : FONT_UNITS", }; #endif int yydebug; int yynerrs; int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 10000 #endif #endif #define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; YYINT *s_base; YYINT *s_mark; YYINT *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; #line 1403 "Uil.y" /* Dummy error routine for the parser. We will output our own error messages. */ int yyerror (s) char * s; { return 0; } #line 2206 "Uil.c" #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; YYINT *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return YYENOMEM; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return YYENOMEM; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return YYENOMEM; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; YYERROR_CALL("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == YYEOF) goto yyabort; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 1: #line 239 "Uil.y" { sar_save_module_source (); } break; case 3: #line 244 "Uil.y" { sar_create_root ( &yyval ); } break; case 4: #line 245 "Uil.y" { sar_create_module( &yyval, &yystack.l_mark[0], &yystack.l_mark[-1] ); } break; case 10: #line 260 "Uil.y" { sar_process_module_version( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 11: #line 261 "Uil.y" { sar_process_module_sensitivity( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 12: #line 262 "Uil.y" { sar_process_module_charset( &yystack.l_mark[0] , &yystack.l_mark[-2] ); } break; case 13: #line 263 "Uil.y" { sar_make_def_obj (&yystack.l_mark[0]); } break; case 19: #line 274 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 23: #line 280 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 25: #line 284 "Uil.y" { sar_make_def_obj (&yystack.l_mark[0]); } break; case 26: #line 285 "Uil.y" { sar_process_module_variant (&yystack.l_mark[-3], &yystack.l_mark[0]); yyval = gz_yynullval; } break; case 27: #line 289 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_widget_entry; } break; case 28: #line 290 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_gadget_entry; } break; case 37: #line 312 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_value_section); } break; case 41: #line 318 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 43: #line 322 "Uil.y" { sar_bind_value_name( &yystack.l_mark[-3], &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 44: #line 326 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_exported; yyval.b_flags &= ~sym_m_private; } break; case 45: #line 327 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_private; yyval.b_flags &= ~sym_m_exported; } break; case 46: #line 328 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_flags |= sym_m_private; yyval.b_flags &= ~sym_m_exported; } break; case 47: #line 329 "Uil.y" { sar_import_value_entry( &yyval, &yystack.l_mark[0] ); } break; case 48: #line 333 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_value; } break; case 49: #line 334 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_char_8_value; } break; case 50: #line 335 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_pixmap_value; } break; case 51: #line 336 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_float_value; } break; case 52: #line 337 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_bool_value; } break; case 53: #line 338 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_value; } break; case 54: #line 339 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_reason_value; } break; case 55: #line 340 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_argument_value; } break; case 56: #line 341 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_color_value; } break; case 57: #line 342 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_string_table_value; } break; case 58: #line 343 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_asciz_table_value; } break; case 59: #line 344 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_table_value; } break; case 60: #line 345 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_trans_table_value; } break; case 61: #line 346 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_table_value; } break; case 62: #line 347 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_icon_value; } break; case 63: #line 348 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 64: #line 349 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 65: #line 350 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_class_rec_name_value; } break; case 66: #line 351 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_xbitmapfile_value; } break; case 67: #line 352 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_keysym_value; } break; case 68: #line 353 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_single_float_value; } break; case 69: #line 354 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_rgb_value; } break; case 70: #line 355 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_wchar_string_value; } break; case 71: #line 356 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_fontset_value; } break; case 72: #line 357 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_widget_ref_value; } break; case 73: #line 362 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_value; } break; case 74: #line 363 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_char_8_value; } break; case 75: #line 364 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_pixmap_value; } break; case 76: #line 365 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_float_value; } break; case 77: #line 366 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_bool_value; } break; case 78: #line 367 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_value; } break; case 79: #line 368 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_reason_value; } break; case 80: #line 369 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_color_value; } break; case 81: #line 370 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_string_table_value; } break; case 82: #line 371 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_asciz_table_value; } break; case 83: #line 372 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_integer_table_value; } break; case 84: #line 373 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_trans_table_value; } break; case 85: #line 374 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_font_table_value; } break; case 86: #line 375 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_icon_value; } break; case 87: #line 376 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_compound_string_value; } break; case 88: #line 377 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_keysym_value; } break; case 89: #line 378 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_single_float_value; } break; case 90: #line 379 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_wchar_string_value; } break; case 91: #line 380 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_fontset_value; } break; case 92: #line 381 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_widget_ref_value; } break; case 97: #line 398 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_procedure_section); } break; case 101: #line 404 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 103: #line 408 "Uil.y" { sar_create_procedure( &yystack.l_mark[-3], &yystack.l_mark[-2], &yystack.l_mark[-1], &yystack.l_mark[0] );} break; case 104: #line 412 "Uil.y" { yyval = gz_yynullval; } break; case 105: #line 413 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 106: #line 417 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_no_value; } break; case 108: #line 419 "Uil.y" { yyval = yystack.l_mark[0]; yyval.b_type = sym_k_any_value; } break; case 109: #line 422 "Uil.y" { YYSTYPE temp[2]; temp[0] = gz_yynullval; sar_create_object(&temp[0], sym_k_widget_entry); temp[1] = yystack.l_mark[0]; sar_set_object_class(&temp[1]); sar_verify_object(&temp[1]); yyval = temp[0]; } break; case 110: #line 432 "Uil.y" { yyval.b_flags = sym_m_private; } break; case 111: #line 445 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_identifier_section); } break; case 115: #line 451 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 117: #line 455 "Uil.y" { sar_create_identifier ( &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 118: #line 465 "Uil.y" { sar_include_file (&yystack.l_mark[-1], &yystack.l_mark[-3], &yystack.l_mark[0]); } break; case 119: #line 466 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 121: #line 474 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_object_section); } break; case 123: #line 478 "Uil.y" { yyval = yystack.l_mark[-1]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 124: #line 479 "Uil.y" { yyval = yystack.l_mark[-2]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 125: #line 480 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 127: #line 485 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_widget_entry); sar_link_section (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 128: #line 488 "Uil.y" { yyval = gz_yynullval; } break; case 129: #line 493 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 131: #line 496 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_private); } break; case 133: #line 499 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 135: #line 502 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_imported); } break; case 136: #line 504 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 137: #line 514 "Uil.y" { sar_verify_object (&yystack.l_mark[-5]); } break; case 138: #line 519 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 140: #line 522 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_private); } break; case 142: #line 525 "Uil.y" { sar_set_object_flags (& yystack.l_mark[0], (sym_m_managed | sym_m_exported)); } break; case 144: #line 528 "Uil.y" { sar_unset_object_flags (& yystack.l_mark[0], sym_m_managed), sar_set_object_flags (& yystack.l_mark[0], sym_m_exported); } break; case 146: #line 531 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_exported); } break; case 148: #line 534 "Uil.y" { sar_set_object_flags (&yystack.l_mark[0], sym_m_imported); } break; case 149: #line 536 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 150: #line 538 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 151: #line 543 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); } break; case 152: #line 547 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 153: #line 552 "Uil.y" { sar_set_object_variant (&yystack.l_mark[0]); } break; case 154: #line 554 "Uil.y" { sar_set_object_variant (&yystack.l_mark[0]); } break; case 155: #line 559 "Uil.y" { sar_set_object_class (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 156: #line 563 "Uil.y" { sar_verify_object (&yystack.l_mark[-4]); } break; case 158: #line 569 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &gz_yynullval, sym_k_object_proc); sar_save_user_proc_ref_src ( &yystack.l_mark[-2], &yystack.l_mark[-1], &yystack.l_mark[0] ); } break; case 160: #line 575 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 161: #line 585 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 164: #line 588 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 166: #line 593 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 167: #line 596 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-2], sym_m_exported); } break; case 168: #line 599 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-3], sym_m_exported); } break; case 169: #line 600 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 171: #line 606 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-2], sym_m_private); } break; case 172: #line 609 "Uil.y" { sar_set_object_flags (&yystack.l_mark[-3], sym_m_private); } break; case 173: #line 610 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 177: #line 620 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 178: #line 622 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 179: #line 624 "Uil.y" { sar_save_list_end ( &yystack.l_mark[0]); sar_save_feature (&yystack.l_mark[-1]); sar_update_parent_list (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 180: #line 626 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 182: #line 631 "Uil.y" { yyval = gz_yynullval; } break; case 183: #line 639 "Uil.y" { yyval = yystack.l_mark[0]; sar_save_section_source (&yystack.l_mark[0], sym_k_list_section); } break; case 185: #line 644 "Uil.y" { yyval = yystack.l_mark[-1]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 186: #line 645 "Uil.y" { yyval = yystack.l_mark[-2]; sar_save_src_semicolon_pos (&yystack.l_mark[0] ); } break; case 187: #line 646 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 189: #line 651 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_list_entry); sar_link_section (&yystack.l_mark[0]); yyval = gz_yynullval;} break; case 190: #line 654 "Uil.y" { yyval = gz_yynullval; } break; case 195: #line 666 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 196: #line 668 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 197: #line 673 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 198: #line 675 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 199: #line 680 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 200: #line 682 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 201: #line 687 "Uil.y" { yyval = gz_yynullval; sar_set_list_type (&yystack.l_mark[0]); } break; case 202: #line 689 "Uil.y" { sar_verify_object (&yystack.l_mark[-2]); } break; case 203: #line 694 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_argument_list; } break; case 204: #line 699 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_callback_list; } break; case 205: #line 704 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_proc_ref_list; } break; case 206: #line 708 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_control_list; } break; case 207: #line 712 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 210: #line 715 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 212: #line 719 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 215: #line 722 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 217: #line 727 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 220: #line 730 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 222: #line 734 "Uil.y" { sar_object_reference (&yystack.l_mark[0]); } break; case 225: #line 737 "Uil.y" { lex_issue_error (RIGHT_BRACE); } break; case 235: #line 762 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 236: #line 764 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 237: #line 765 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 239: #line 770 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 240: #line 772 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 241: #line 773 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 243: #line 778 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 244: #line 780 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 245: #line 781 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 247: #line 786 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 248: #line 788 "Uil.y" { sar_save_src_entry_end (&yystack.l_mark[0], &yystack.l_mark[-1]); sar_add_list_entry (&yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 249: #line 789 "Uil.y" { lex_issue_error (SEMICOLON); } break; case 251: #line 794 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 252: #line 796 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 253: #line 801 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 254: #line 803 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 255: #line 808 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 256: #line 810 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 257: #line 815 "Uil.y" { yyval = gz_yynullval; sar_create_object (&yystack.l_mark[0], sym_k_list_entry); } break; case 258: #line 817 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 259: #line 825 "Uil.y" { sar_save_control_item (&yystack.l_mark[-1], &yystack.l_mark[0]); yyval = yystack.l_mark[-1]; } break; case 260: #line 828 "Uil.y" { sar_create_object (& yystack.l_mark[0], sym_k_widget_entry); yystack.l_mark[0].b_flags = sym_m_managed; yyval = gz_yynullval;} break; case 261: #line 831 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 262: #line 834 "Uil.y" { sar_create_child (& yystack.l_mark[-1]); yystack.l_mark[-1].b_flags = sym_m_managed; yyval = gz_yynullval; } break; case 263: #line 837 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 264: #line 839 "Uil.y" { sar_create_child (& yystack.l_mark[-1]); yyval = gz_yynullval; } break; case 265: #line 841 "Uil.y" { sar_save_control_widget (& yystack.l_mark[-3], & yystack.l_mark[-1]); yyval = yystack.l_mark[-3]; } break; case 268: #line 855 "Uil.y" { sar_save_argument_pair (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 269: #line 860 "Uil.y" { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = yystack.l_mark[-1]; sar_set_object_class (&temp [1]); temp [1] = yystack.l_mark[0]; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); sar_save_argument_pair (&yystack.l_mark[-3], &temp [0], &yystack.l_mark[-2]); yyval = yystack.l_mark[-3]; } break; case 270: #line 874 "Uil.y" { sar_save_reason_binding (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 271: #line 876 "Uil.y" { sar_save_reason_binding (&yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-1]); yyval = yystack.l_mark[-2]; } break; case 272: #line 881 "Uil.y" { sar_create_object (&yystack.l_mark[0], sym_k_widget_entry); yyval = gz_yynullval; } break; case 273: #line 883 "Uil.y" { yyval = yystack.l_mark[-2]; } break; case 274: #line 888 "Uil.y" { yyval.b_flags = sym_m_managed; } break; case 275: #line 890 "Uil.y" { yyval = gz_yynullval; yyval.b_flags = sym_m_managed; } break; case 276: #line 892 "Uil.y" { yyval = gz_yynullval; } break; case 277: #line 897 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &yystack.l_mark[0], sym_k_callback_proc); yyval = yystack.l_mark[-1]; } break; case 278: #line 902 "Uil.y" { sar_process_proc_ref (&yystack.l_mark[-1], &yystack.l_mark[0], sym_k_callback_proc); yyval = yystack.l_mark[-1]; } break; case 280: #line 908 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 281: #line 910 "Uil.y" { YYSTYPE temp [2]; temp [0] = gz_yynullval; sar_create_object (&temp [0], sym_k_widget_entry); temp [1] = yystack.l_mark[-2]; sar_set_object_class (&temp [1]); temp [1] = yystack.l_mark[-1]; sar_object_reference (&temp [1]); sar_verify_object (&temp [1]); yyval = temp [0]; } break; case 282: #line 918 "Uil.y" { yyval = gz_yynullval; } break; case 290: #line 933 "Uil.y" { sar_map_keyword_to_name( &yyval, &yystack.l_mark[0]); } break; case 291: #line 940 "Uil.y" { sar_process_id_ref (&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 332: #line 998 "Uil.y" { yyval = yystack.l_mark[0]; if ((yyval.b_type != sym_k_error_value) && (yyval.b_type != sym_k_any_value) && ((yyval.b_flags &sym_m_forward_ref) == 0)) { if ((yyval.b_type != sym_k_char_8_value) && (yyval.b_type != sym_k_localized_string_value)) sar_value_type_error( &yyval, sym_k_char_8_value ); if ((yyval.b_flags &sym_m_private) == 0) sar_private_error( &yyval ); } } break; case 333: #line 1014 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 334: #line 1027 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 335: #line 1035 "Uil.y" { yyval = yystack.l_mark[0]; if (yyval.b_type != sym_k_error_value) { if (((yyval.b_flags &sym_m_private) == 0) && ((yyval.b_flags &sym_m_forward_ref) == 0)) sar_private_error( &yyval ); } } break; case 336: #line 1045 "Uil.y" { sar_make_color_table( &yyval, &yystack.l_mark[-1], &yystack.l_mark[-3]); } break; case 338: #line 1052 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 339: #line 1053 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 341: #line 1058 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 343: #line 1063 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 344: #line 1064 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 346: #line 1069 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 347: #line 1070 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 349: #line 1075 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 350: #line 1076 "Uil.y" { yyval = yystack.l_mark[-1]; sar_binary_op( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 352: #line 1081 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 353: #line 1082 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 354: #line 1083 "Uil.y" { yyval = yystack.l_mark[-1]; sar_unary_op( &yyval, &yystack.l_mark[0] ); } break; case 356: #line 1088 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 357: #line 1092 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_integer_value, &yystack.l_mark[0], XmPIXELS); } break; case 358: #line 1094 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_integer_value, &yystack.l_mark[-1], sar_get_units_type(&yystack.l_mark[0])); } break; case 359: #line 1096 "Uil.y" { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_char_8_value, &yystack.l_mark[0], 0); } break; case 360: #line 1100 "Uil.y" { sar_process_id( &yyval, &yystack.l_mark[0] );} break; case 361: #line 1101 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_float_value, &yystack.l_mark[0], XmPIXELS); } break; case 362: #line 1103 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_float_value, &yystack.l_mark[-1], sar_get_units_type(&yystack.l_mark[0])); } break; case 363: #line 1105 "Uil.y" { sar_value_not_implemented( &yyval, &yystack.l_mark[-3], "pixmap literal" ); } break; case 364: #line 1106 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 365: #line 1107 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 366: #line 1108 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 367: #line 1109 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_reason_value, &yystack.l_mark[-3], 0); } break; case 368: #line 1111 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_class_rec_name_value, &yystack.l_mark[-3], 0); } break; case 369: #line 1114 "Uil.y" { sar_make_private_value ( &yyval, &yystack.l_mark[-2], sym_k_argument_value, &yystack.l_mark[-4], yystack.l_mark[-1].b_type ); } break; case 370: #line 1116 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 371: #line 1118 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 372: #line 1120 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 373: #line 1122 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[0], sym_k_bool_value, &yystack.l_mark[0], 0); } break; case 374: #line 1124 "Uil.y" { /* Don't use FALSE because it is a token not a Boolean! */ Uil_lex_l_charset_specified = 0; sar_make_private_value ( &yyval, &yystack.l_mark[0], sym_k_compound_string_value, &yystack.l_mark[0], 0); } break; case 375: #line 1128 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_string_table_value, &yystack.l_mark[-3], 0); } break; case 376: #line 1130 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_asciz_table_value, &yystack.l_mark[-3], 0); } break; case 377: #line 1132 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_integer_table_value, &yystack.l_mark[-3], 0); } break; case 378: #line 1134 "Uil.y" { sar_make_private_value( &yyval, &yystack.l_mark[-1], sym_k_trans_table_value, &yystack.l_mark[-3], 0); } break; case 379: #line 1136 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 380: #line 1137 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 381: #line 1138 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 382: #line 1139 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 383: #line 1140 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 384: #line 1141 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 385: #line 1143 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_xbitmapfile_value, &yystack.l_mark[-3], 0); } break; case 386: #line 1146 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_keysym_value, &yystack.l_mark[-3], 0); } break; case 387: #line 1149 "Uil.y" { yyval = yystack.l_mark[-3]; sar_unary_op( &yyval, &yystack.l_mark[-1] ); } break; case 388: #line 1151 "Uil.y" { sar_make_private_value( & yyval, & yystack.l_mark[-1], sym_k_rgb_value, &yystack.l_mark[-3], 0); } break; case 389: #line 1153 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 390: #line 1154 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[0], sym_k_localized_string_value, &yystack.l_mark[0], 0); } break; case 391: #line 1160 "Uil.y" { yyval = gz_yynullval; } break; case 392: #line 1162 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 393: #line 1167 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_trans_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 394: #line 1169 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_trans_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 395: #line 1174 "Uil.y" { yyval = gz_yynullval; } break; case 396: #line 1176 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 397: #line 1181 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_asciz_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 398: #line 1183 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_asciz_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 399: #line 1188 "Uil.y" { yyval = gz_yynullval; } break; case 400: #line 1190 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 401: #line 1195 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_integer_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 402: #line 1197 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_integer_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 403: #line 1203 "Uil.y" {sar_append_table_value(&yystack.l_mark[-4], & gz_yynullval, sym_k_integer_table_value, & yystack.l_mark[-4]); sar_append_table_value(& yystack.l_mark[-2], & yystack.l_mark[-4], sym_k_integer_table_value, & yystack.l_mark[-3]); sar_append_table_value(& yystack.l_mark[0], & yystack.l_mark[-2], sym_k_integer_table_value, & yystack.l_mark[-1]); yyval = yystack.l_mark[0];} break; case 404: #line 1212 "Uil.y" { yyval = gz_yynullval; } break; case 405: #line 1214 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 406: #line 1219 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_string_table_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 407: #line 1221 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_string_table_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 408: #line 1225 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_any_value; } break; case 409: #line 1226 "Uil.y" { yyval = gz_yynullval; yyval.b_type = yystack.l_mark[0].b_type; } break; case 410: #line 1227 "Uil.y" { yyval = gz_yynullval; yyval.b_type = sym_k_any_value; } break; case 411: #line 1231 "Uil.y" { sar_make_comp_str( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 412: #line 1232 "Uil.y" { sar_make_comp_str( &yyval, &yystack.l_mark[-1], &yystack.l_mark[0], &yystack.l_mark[-3] ); } break; case 413: #line 1236 "Uil.y" { sar_make_comp_str_comp(&yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 414: #line 1237 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 415: #line 1238 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 416: #line 1239 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 417: #line 1240 "Uil.y" { sar_make_comp_str_comp( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 418: #line 1244 "Uil.y" { sar_chk_comp_str_attr( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 419: #line 1245 "Uil.y" { sar_chk_comp_str_attr( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 420: #line 1249 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.b_tag = yystack.l_mark[0].b_tag; yyval.value.az_keyword_entry = yystack.l_mark[0].value.az_keyword_entry; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 421: #line 1253 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 422: #line 1255 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 423: #line 1260 "Uil.y" { sar_make_wchar_str( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 424: #line 1265 "Uil.y" { sar_make_font( &yyval, &yystack.l_mark[0], &yystack.l_mark[-4], &yystack.l_mark[-6] ); } break; case 425: #line 1266 "Uil.y" { sar_make_font( &yyval, &gz_yynullval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 426: #line 1271 "Uil.y" { sar_make_fontset( &yyval, &yystack.l_mark[0], &yystack.l_mark[-4], &yystack.l_mark[-6] ); } break; case 427: #line 1272 "Uil.y" { sar_make_fontset( &yyval, &gz_yynullval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 428: #line 1276 "Uil.y" { sar_make_font_table( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 429: #line 1277 "Uil.y" { sar_make_font_table( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2], &yystack.l_mark[-4] ); } break; case 430: #line 1284 "Uil.y" { sar_make_font_item( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 431: #line 1285 "Uil.y" { sar_make_font_item( &yyval, &gz_yynullval, &yystack.l_mark[0] ); } break; case 432: #line 1289 "Uil.y" { /* Don't use TRUE because it is a token not a Boolean! */ yyval = yystack.l_mark[0]; Uil_lex_l_charset_specified = 1;} break; case 434: #line 1297 "Uil.y" { sar_charset_verify (&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 435: #line 1298 "Uil.y" { yyval = yystack.l_mark[-1]; } break; case 436: #line 1299 "Uil.y" { sar_make_fallback_charset(&yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 437: #line 1305 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[0], sym_k_char_8_value, &yystack.l_mark[0], 0); sar_make_charset (&yyval, &yyval, &gz_yynullval, &yystack.l_mark[0]); } break; case 438: #line 1308 "Uil.y" { sar_make_private_value(&yyval, &yystack.l_mark[-1], sym_k_char_8_value, &yystack.l_mark[-1], 0); sar_make_charset (&yyval, &yyval, &yystack.l_mark[0], &yystack.l_mark[-1]); } break; case 439: #line 1314 "Uil.y" { sar_chk_charset_attr( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 440: #line 1315 "Uil.y" { sar_chk_charset_attr( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 441: #line 1319 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; if (yystack.l_mark[0].b_type != sym_k_bool_value) sar_value_type_error( &yystack.l_mark[0], sym_k_bool_value ); yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 442: #line 1323 "Uil.y" { yyval.b_type = yystack.l_mark[-2].b_type; if (yystack.l_mark[0].b_type != sym_k_bool_value) sar_value_type_error( &yystack.l_mark[0], sym_k_bool_value ); yyval.value.az_symbol_entry = yystack.l_mark[0].value.az_symbol_entry; } break; case 443: #line 1330 "Uil.y" { sar_append_color_item( &yyval, &yystack.l_mark[0], &gz_yynullval ); } break; case 444: #line 1331 "Uil.y" { sar_append_color_item( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2] ); } break; case 445: #line 1335 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-3], &yystack.l_mark[0] ); } break; case 446: #line 1336 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-3], &yystack.l_mark[0] ); } break; case 447: #line 1337 "Uil.y" { sar_make_color_item( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0] ); } break; case 448: #line 1341 "Uil.y" { sar_make_color( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2] ); } break; case 449: #line 1342 "Uil.y" { sar_make_color( &yyval, &yystack.l_mark[-2], &yystack.l_mark[0], &yystack.l_mark[-4] ); } break; case 452: #line 1351 "Uil.y" { sar_make_icon( &yyval, &yystack.l_mark[0], &gz_yynullval, &yystack.l_mark[-2]); } break; case 453: #line 1353 "Uil.y" { sar_make_icon( &yyval, &yystack.l_mark[0], &yystack.l_mark[-2], &yystack.l_mark[-6] ); } break; case 454: #line 1358 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &gz_yynullval, sym_k_icon_value, &yystack.l_mark[0]); yyval = yystack.l_mark[0]; } break; case 455: #line 1360 "Uil.y" { sar_append_table_value (&yystack.l_mark[0], &yystack.l_mark[-2], sym_k_icon_value, &yystack.l_mark[-1]); yyval = yystack.l_mark[0]; } break; case 456: #line 1365 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 457: #line 1367 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 458: #line 1369 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 459: #line 1371 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 460: #line 1373 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 461: #line 1375 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 462: #line 1377 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 463: #line 1379 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 464: #line 1381 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 465: #line 1383 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 466: #line 1385 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 467: #line 1387 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 468: #line 1389 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 469: #line 1391 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 470: #line 1393 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 471: #line 1395 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 472: #line 1397 "Uil.y" { yyval = yystack.l_mark[0]; } break; case 473: #line 1399 "Uil.y" { yyval = yystack.l_mark[0]; } break; #line 3799 "Uil.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = YYEOF; #if YYDEBUG if (yydebug) { yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == YYEOF) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) { goto yyoverflow; } *++yystack.s_mark = (YYINT) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: YYERROR_CALL("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); } motif-2.3.8/clients/uil/UilDB.c0000644000175000017500000005631013145162623013130 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilDB.c /main/11 1996/11/21 20:03:11 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* *++ * FACILITY: * * UIL Bindary Database : * * ABSTRACT: * *-- */ /* * This file contains routines which change the internal tables of UIL based on * a binary data base parameter in the command line */ /* * * INCLUDE FILES * */ #ifndef X_NOT_STDC_ENV #include #include #endif #include "UilDefI.h" #define X_INCLUDE_PWD_H #define XOS_USE_XT_LOCKING #ifdef HAVE_X11_XOS_R_H #include #else #include #endif #include /* * * TABLE OF CONTENTS * * */ /* * * DEFINE and MACRO DEFINITIONS * */ #define _check_read( __number_returned ) \ if (( (__number_returned) != 1) || (feof(dbfile)) || (ferror(dbfile)) ) \ { diag_issue_diagnostic( d_bad_database, diag_k_no_source, diag_k_no_column ); } /* * * EXTERNAL VARIABLE DECLARATIONS * */ /* * * GLOBAL VARIABLE DECLARATIONS * */ /* * * OWN VARIABLE DECLARATIONS * */ static FILE *dbfile; static int num_bits; void db_incorporate() /* *++ * * PROCEDURE DESCRIPTION: * * This routine incorporate the binary database passed in the command line. * * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ /* * External Functions */ /* * Local variables */ { int return_num_items; _db_header header; _db_globals globals; db_open_file(); return_num_items = fread (&globals, sizeof(_db_globals), 1, dbfile); _check_read (return_num_items); /* * Some heuristics to see if this is a reasonable database. * The magic numbers are about 10 times as big as the DXm database * for DECWindows V3. The diagnostic does a fatal exit. */ if ( globals.uil_max_arg>5000 || globals.uil_max_charset>200 || globals.charset_lang_table_max>1000 || globals.uil_max_object>500 || globals.uil_max_reason>1000 || globals.uil_max_enumval>3000 || globals.uil_max_enumset>1000 || globals.key_k_keyword_count>10000 || globals.key_k_keyword_max_length>200 || globals.uil_max_child>250) diag_issue_diagnostic (d_bad_database, diag_k_no_source, diag_k_no_column); uil_max_arg = globals.uil_max_arg ; uil_max_charset = globals.uil_max_charset ; charset_lang_table_max = globals.charset_lang_table_max ; uil_max_object = globals.uil_max_object ; uil_max_reason = globals.uil_max_reason ; uil_max_enumval = globals.uil_max_enumval ; uil_max_enumset = globals.uil_max_enumset ; key_k_keyword_count = globals.key_k_keyword_count ; key_k_keyword_max_length = globals.key_k_keyword_max_length ; uil_max_child = globals.uil_max_child; num_bits = (uil_max_object +7) / 8; if (globals.version > DB_Compiled_Version) diag_issue_diagnostic( d_future_version, diag_k_no_source, diag_k_no_column ); for (;;) { return_num_items = fread (&header, sizeof(_db_header), 1, dbfile); if (feof(dbfile)) break; _check_read (return_num_items); switch (header.table_id) { case Constraint_Tab: constraint_tab = (unsigned char *) XtMalloc (header.table_size); return_num_items = fread (constraint_tab, sizeof(unsigned char) * header.num_items, 1, dbfile); _check_read (return_num_items); break; case Argument_Type_Table_Value: /* * NOTE: The first entry is not used but we copy it anyway */ argument_type_table = (unsigned char *) XtMalloc (header.table_size); return_num_items = fread (argument_type_table, sizeof(unsigned char) * header.num_items, 1, dbfile); _check_read (return_num_items); break; case Child_Class_Table: /* * NOTE: The first entry is not used but we copy it anyway */ child_class_table = (unsigned char *) XtMalloc (header.table_size); return_num_items = fread (child_class_table, sizeof(unsigned char) * header.num_items, 1, dbfile); _check_read (return_num_items); break; case Charset_Wrdirection_Table: charset_writing_direction_table = (unsigned char *) XtMalloc (header.table_size); return_num_items = fread (charset_writing_direction_table, sizeof(unsigned char) * header.num_items, 1, dbfile); _check_read (return_num_items); break; case Charset_Parsdirection_Table: charset_parsing_direction_table = (unsigned char *) XtMalloc (header.table_size); return_num_items = fread (charset_parsing_direction_table, sizeof(unsigned char) * header.num_items, 1, dbfile); _check_read (return_num_items); break; case Charset_Charsize_Table: charset_character_size_table = (unsigned char *) XtMalloc (header.table_size); return_num_items = fread (charset_character_size_table, sizeof(unsigned char) * header.num_items, 1, dbfile); _check_read (return_num_items); break; case Key_Table: case Key_Table_Case_Ins: db_read_ints_and_string (&header); break; case Allowed_Argument_Table: case Allowed_Child_Table: case Allowed_Control_Table: case Allowed_Reason_Table: db_read_char_table (&header); break; case Charset_Xmstring_Names_Table: case Charset_Lang_Names_Table: case Uil_Widget_Names: case Uil_Children_Names: case Uil_Argument_Names: case Uil_Reason_Names: case Uil_Enumval_names: case Uil_Charset_Names: case Uil_Widget_Funcs: case Uil_Argument_Toolkit_Names: case Uil_Reason_Toolkit_Names: db_read_length_and_string (&header); break; case Charset_Lang_Codes_Table: charset_lang_codes_table = (unsigned short int *) XtMalloc (header.table_size); return_num_items = fread (charset_lang_codes_table, header.table_size, 1, dbfile); _check_read (return_num_items); break; case Argument_Enum_Set_Table: argument_enumset_table = (unsigned short int *) XtMalloc (header.table_size); return_num_items = fread (argument_enumset_table, header.table_size, 1, dbfile); _check_read (return_num_items); break; case Related_Argument_Table: related_argument_table = (unsigned short int *) XtMalloc (header.table_size); return_num_items = fread (related_argument_table, header.table_size, 1, dbfile); _check_read (return_num_items); break; case Uil_Gadget_Funcs: uil_gadget_variants = (unsigned short int *) XtMalloc (header.table_size); return_num_items = fread (uil_gadget_variants, header.table_size, 1, dbfile); _check_read (return_num_items); break; case Uil_Urm_Nondialog_Class: uil_urm_nondialog_class = (unsigned short int *) XtMalloc (header.table_size); return_num_items = fread (uil_urm_nondialog_class, header.table_size, 1, dbfile); _check_read (return_num_items); break; case Uil_Urm_Subtree_Resource: uil_urm_subtree_resource = (unsigned short int *) XtMalloc (header.table_size); return_num_items = fread (uil_urm_subtree_resource, header.table_size, 1, dbfile); _check_read (return_num_items); break; case Enum_Set_Table: db_read_int_and_shorts(&header); break; case Enumval_Values_Table: enumval_values_table = (int *) XtMalloc (header.table_size); return_num_items = fread (enumval_values_table, header.table_size, 1, dbfile); _check_read (return_num_items); break; default: diag_issue_diagnostic( d_bad_database, diag_k_no_source, diag_k_no_column ); } /* end switch */ } /* end for */ fclose (dbfile); return; } void db_read_ints_and_string(header) _db_header_ptr header; /* *++ * * PROCEDURE DESCRIPTION: * * This routine reads in tables of integers and one string unsigned chars and places them into * memory. It will Malloc new space for the table. The tables supported * this routine are: * * Key_Table: * Key_Table_Case_Ins: * * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ { /* * External Functions */ /* * Local variables */ int return_num_items, i, string_size=0; key_keytable_entry_type *table = NULL; char *string_table; switch (header->table_id) { /* * NOTE: Calloc is used here to protect against bad * pointers. */ case Key_Table: key_table = (key_keytable_entry_type *) XtCalloc (1, header->table_size); table = key_table; break; case Key_Table_Case_Ins: key_table_case_ins = (key_keytable_entry_type *) XtCalloc (1, header->table_size); table = key_table_case_ins; break; default: diag_issue_internal_error ("Bad table_id in db_read_ints_and_string"); } /* * Get the entire table with one read. * Then loop through the table and up the length of the strings. * Get all the strings with one read. * Reassign the addresses */ return_num_items = fread(table, header->table_size, 1, dbfile); _check_read (return_num_items); for ( i=0 ; inum_items; i++) { /* * Add one for the null character on the string */ string_size += table[i].b_length + 1; }; string_table = XtMalloc (sizeof (char) * string_size); return_num_items = fread(string_table, sizeof(unsigned char) * string_size, 1, dbfile); _check_read (return_num_items); for ( i=0 ; inum_items; i++) { table[i].at_name = string_table; string_table += table[i].b_length + 1; }; return; } void db_read_char_table(header) _db_header_ptr header; /* *++ * * PROCEDURE DESCRIPTION: * * This routine reads in tables of unsigned chars and places them into * memory. It will Malloc new space for the table. The tables supported * this routine are: * * Allowed_Argument_Table: * Allowed_Child_Table: * Allowed_Control_Table: * Allowed_Reason_Table: * * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ { /* * External Functions */ /* * Local variables */ unsigned char **ptr = NULL; int return_num_items, i; unsigned char *table; switch (header->table_id) { /* * NOTE: Calloc is used here to protect against bad * pointers. */ case Allowed_Argument_Table: allowed_argument_table = (unsigned char **) XtCalloc (1, header->table_size); ptr = allowed_argument_table; break; case Allowed_Child_Table: allowed_child_table = (unsigned char **) XtCalloc (1, header->table_size); ptr = allowed_child_table; break; case Allowed_Control_Table: allowed_control_table = (unsigned char **) XtCalloc (1, header->table_size); ptr = allowed_control_table; break; case Allowed_Reason_Table: allowed_reason_table = (unsigned char **) XtCalloc (1, header->table_size); ptr = allowed_reason_table; break; default: diag_issue_internal_error ("Bad table_id in db_read_char_table"); } /* * Read in the entire table contents in one whack. * Then go through the table and set the addresses */ table = (unsigned char *) XtMalloc (sizeof (unsigned char) * header->num_items * num_bits); return_num_items = fread(table, sizeof(char) * num_bits * header->num_items, 1, dbfile); _check_read (return_num_items); for ( i=1 ; i<=header->num_items; i++ ) { ptr[i] = table; table += num_bits; }; return; } void db_read_length_and_string(header) _db_header_ptr header; /* *++ * * PROCEDURE DESCRIPTION: * * This routine reads in length and strings of unsigned chars and places them into * memory. It will Malloc new space for the table. The tables supported * this routine are: * * Charset_Xmstring_Names_Table: * Charset_Lang_Names_Table: * Uil_Widget_Names: * Uil_Children_Names: * Uil_Argument_Names: * Uil_Reason_Names: * Uil_Enumval_names: * Uil_Charset_Names: * Uil_Widget_Funcs: * Uil_Argument_Toolkit_Names: * Uil_Reason_Toolkit_Names: * * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ { /* * External Functions */ /* * Local variables */ int return_num_items, i, string_size=0; int *lengths; char *string_table; char **table = NULL; switch (header->table_id) { /* * NOTE: Calloc is used here because it might be possible to * have a string of zero length, particularly for the * first record. Ergo we Calloc to protect against bad * pointers. */ case Charset_Xmstring_Names_Table: charset_xmstring_names_table = (char **) XtCalloc (1, header->table_size); table = charset_xmstring_names_table; break; case Charset_Lang_Names_Table: charset_lang_names_table = (char **) XtCalloc (1, header->table_size); table = charset_lang_names_table; break; case Uil_Widget_Names: uil_widget_names = (char **) XtCalloc (1, header->table_size); table = uil_widget_names ; break; case Uil_Children_Names: uil_child_names = (char **) XtCalloc (1, header->table_size); table = uil_child_names ; break; case Uil_Argument_Names: uil_argument_names = (char **) XtCalloc (1, header->table_size); table = uil_argument_names; break; case Uil_Reason_Names: uil_reason_names = (char **) XtCalloc (1, header->table_size); table = uil_reason_names; break; case Uil_Enumval_names: uil_enumval_names = (char **) XtCalloc (1, header->table_size); table = uil_enumval_names; break; case Uil_Charset_Names: uil_charset_names = (char **) XtCalloc (1, header->table_size); table = uil_charset_names; break; case Uil_Widget_Funcs: uil_widget_funcs = (char **) XtCalloc (1, header->table_size); table = uil_widget_funcs; break; case Uil_Argument_Toolkit_Names: uil_argument_toolkit_names = (char **) XtCalloc (1, header->table_size); table = uil_argument_toolkit_names; break; case Uil_Reason_Toolkit_Names: uil_reason_toolkit_names = (char **) XtCalloc (1, header->table_size); table = uil_reason_toolkit_names; break; default: diag_issue_internal_error ("Bad table_id in db_read_length_and_string"); } /* * Get the lengths of all the strings with one read. * Then loop through the table and up the length of the strings. * Get all the strings with one read. * Reassign the addresses using the length table and string table. * Cleanup by Freeing length table. * * NOTE: In some tables the counting starts at 1 not 0 so you * have to be carefull. */ lengths = (int *) XtMalloc (sizeof (int) * (header->num_items + 1)); return_num_items = fread(lengths, sizeof(int) * (header->num_items + 1), 1, dbfile); _check_read (return_num_items); for ( i=0 ; i<=header->num_items; i++) { /* * Add one for the null terminator */ if (lengths[i]) { string_size += lengths[i] + 1; } } string_table = XtMalloc (sizeof (unsigned char) * string_size); return_num_items = fread(string_table, sizeof(unsigned char) * string_size, 1, dbfile); _check_read (return_num_items); for ( i=0 ; i<=header->num_items; i++) { if (lengths[i]) { table[i] = string_table; /* BEGIN HaL Fix CR 5618 */ if ((header->table_id == Uil_Widget_Names) && (strcmp(table[i], "user_defined") == 0)) uil_sym_user_defined_object = i; /* END HaL Fix CR 5618 */ string_table += lengths[i] + 1; } } XtFree ((char *)lengths); return; } void db_read_int_and_shorts(header) _db_header_ptr header; /* *++ * * PROCEDURE DESCRIPTION: * * This routine reads in a structure consisting of one integer and a * pointer to a table of integer and places them into * memory. It will Malloc new space for the table. The tables supported * this routine are: * * Enum_Set_Table: * * * FORMAL PARAMETERS: * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ { /* * External Functions */ /* * Local variables */ int return_num_items, i, int_table_size=0; UilEnumSetDescDef *table = NULL; unsigned short int *int_table; switch (header->table_id) { case Enum_Set_Table: enum_set_table = (UilEnumSetDescDef *) XtCalloc (1, header->table_size); table = enum_set_table; break; default: diag_issue_internal_error ("Bad table_id in db_read_int_shorts"); } /* * Get the entire table with one read. * Then loop through the table and add up the number of ints in each int table. * Get all the integer tables with one read. * Reassign the addresses of the tables. */ return_num_items = fread(table, header->table_size, 1, dbfile); _check_read (return_num_items); for ( i=0 ; i<=header->num_items; i++) { int_table_size += table[i].values_cnt; } int_table = (unsigned short int *) XtCalloc (1, sizeof (short) * int_table_size); return_num_items = fread(int_table, sizeof(short) * int_table_size, 1, dbfile); _check_read (return_num_items); for ( i=0 ; i<=header->num_items; i++) { if (table[i].values_cnt) { table[i].values = int_table; int_table += table[i].values_cnt; } } return; } void db_open_file () /* *++ * * PROCEDURE DESCRIPTION: * * This routine opens the binary database file in a platform-dependent way, * performing i18n language switching in order to do so. * * Per the latest agreement on semantics, this routine does: * - first, try to open in the local directory (that is, with * no switching). * - second, try language switching and open * * FORMAL PARAMETERS: * * name A system-dependent string specifying the IDB file * to be opened. * * IMPLICIT INPUTS: * * IMPLICIT OUTPUTS: * * FUNCTION VALUE: * * SIDE EFFECTS: * *-- */ { /* * External Functions */ /* * Local variables */ char *resolvedname; /* current resolved name */ SubstitutionRec subs[3]; char *wmdPath; /* * Use XtFindFile instead of XtResolvePathName. XtResolvePathName requires a * display which UIL doesn't have. At the current time there is no support for * $LANG in the path string. If such support was deamed necessary, the %L, %l, * %t, %c values would be set up as subs here using globals from the fetch of * LANG variable used to determine the default codeset (or vice versa depending * on which is called first) * * If the last 4 characters of the file name are not .bdb * then pass in the suffix of .bdb. If a file isn't found with the suffix passed * in then try without the suffix. */ /* * Make sure 'S' is the last one so we can remove the suffix for the first pass. */ subs[0].match = 'N'; subs[0].substitution = Uil_cmd_z_command.ac_database; subs[1].match = 'T'; subs[1].substitution = "wmd"; subs[2].match = 'S'; subs[2].substitution = ".wmd"; wmdPath = init_wmd_path(Uil_cmd_z_command.ac_database); resolvedname = 0; /* * Check and see if the .wmd suffix is already on the file. If not then try to * resolve the pathname with .wmd suffix first. If that fails or the suffix is * already on the file then just try to resolve the pathname. */ if ( strcmp (&Uil_cmd_z_command.ac_database[strlen(Uil_cmd_z_command.ac_database)-4],".wmd") != 0 ) resolvedname = XtFindFile(wmdPath, subs, XtNumber(subs), (XtFilePredicate)NULL); /* * No .wmd suffix or a failure to resolve the pathname with the .wmd suffix * Try without the suffix. */ subs[2].substitution = ""; if (resolvedname == 0) resolvedname = XtFindFile(wmdPath, subs, XtNumber(subs), (XtFilePredicate)NULL); if (resolvedname == 0) { diag_issue_diagnostic( d_wmd_open, diag_k_no_source, diag_k_no_column, Uil_cmd_z_command.ac_database); } dbfile = fopen (resolvedname, "r"); /* If the file is not found, a fatal error is generated. */ if (dbfile == NULL) { diag_issue_diagnostic( d_src_open, diag_k_no_source, diag_k_no_column, resolvedname); } return; } String get_root_dir_name() { int uid; _Xgetpwparams pwd_buf; struct passwd *pwd_value; static char *ptr = NULL; char *outptr; if (ptr == NULL) { if((ptr = (char *)getenv("HOME")) == NULL) { if((ptr = (char *)getenv(USER_VAR)) != NULL) { pwd_value = _XGetpwnam(ptr, pwd_buf); } else { uid = getuid(); pwd_value = _XGetpwuid(uid, pwd_buf); } if (pwd_value != NULL) { ptr = pwd_value->pw_dir; } else { ptr = ""; } } } outptr = XtMalloc (strlen(ptr) + 2); strcpy (outptr, ptr); strcat (outptr, "/"); return outptr; } /* * XAPPLRES_DEFAULT and UIDPATH_DEFAULT are intentionally split to support * SCCS. DO NOT reformat the lines else %-N-%-S could be converted by SCCS into * something totally bizarre causing MrmOpenHierarchy failures. */ /* The following are usually defined in the Makefile */ #ifndef LIBDIR #define LIBDIR "/usr/lib/X11" #endif #ifndef INCDIR #define INCDIR "/usr/include/X11" #endif static char libdir[] = LIBDIR; static char incdir[] = INCDIR; static char XAPPLRES_DEFAULT[] = "\ %%N\ %%S:\ %s/%%T/%%N\ %%S:\ %s%%T/%%N\ %%S:\ %s%%N\ %%S:\ %s/%%T/%%N\ %%S:\ %s/%%T/%%N\ %%S"; static char WMDPATH_DEFAULT[] = "\ %%N\ %%S:\ %s%%T/%%N\ %%S:\ %s%%N\ %%S:\ %s/%%L/%%T/%%N\ %%S:\ %s/%%T/%%N\ %%S"; static char ABSOLUTE_PATH[] = "\ %N\ %S"; String init_wmd_path(filename) String filename ; { String path; String old_path; String homedir; String wmd_path; if (filename[0] == '/') { wmd_path = XtMalloc(strlen(ABSOLUTE_PATH)); strcpy (wmd_path, ABSOLUTE_PATH); } else { path = (char *)getenv ("WMDPATH"); if (path == NULL) { homedir = get_root_dir_name(); old_path = (char *)getenv ("XAPPLRESDIR"); if (old_path == NULL) { wmd_path = XtCalloc(1, 2*strlen(homedir) + strlen(libdir) + strlen(incdir) + strlen(WMDPATH_DEFAULT)); sprintf( wmd_path, WMDPATH_DEFAULT, homedir, homedir, libdir, incdir); } else { wmd_path = XtCalloc(1, 1*strlen(old_path) + 2*strlen(homedir) + strlen(libdir) + strlen(incdir) + strlen(XAPPLRES_DEFAULT)); sprintf(wmd_path, XAPPLRES_DEFAULT, old_path, homedir, homedir, libdir, incdir); } XtFree (homedir); } else { wmd_path = XtMalloc(strlen(path) + 1); strcpy (wmd_path, path); free (path); } } return (wmd_path); } motif-2.3.8/clients/uil/UilData.c0000644000175000017500000001047613145162623013517 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilData.c /main/14 1999/04/16 10:41:44 mgreess $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** Global data definitions ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include
#include
#include
#include
#include
#include
#include
#include
#include /* For MWM_*_* defines. */ #include "UilDefI.h" #include "UilSymGen.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* Case sensitivity switch; TRUE if case sensitive. */ externaldef(uil_comp_glbl) boolean uil_v_case_sensitive = TRUE; /* Location to store error type. */ externaldef(uil_comp_glbl) jmp_buf uil_az_error_env_block; externaldef(uil_comp_glbl) boolean uil_az_error_env_valid = FALSE; /* Debugging switches. */ #if debug_version externaldef(uil_comp_glbl) boolean uil_v_dump_tokens = FALSE; externaldef(uil_comp_glbl) boolean uil_v_dump_symbols = FALSE; #endif externaldef(uil_comp_glbl) status uil_l_compile_status = uil_k_success_status; externaldef(uil_comp_glbl) Uil_compile_desc_type *Uil_compile_desc_ptr = NULL; externaldef(uil_comp_glbl) int Uil_percent_complete = 0; externaldef(uil_comp_glbl) int Uil_lines_processed = 0; externaldef(uil_comp_glbl) char *Uil_current_file = ""; /* Define the user-defined object and default character set */ externaldef(uil_sym_glbl) unsigned short int uil_sym_user_defined_object = sym_k_user_defined_object; externaldef(uil_sym_glbl) unsigned short int uil_sym_default_charset = sym_k_iso_latin1_charset; externaldef(uil_sym_glbl) unsigned short int uil_sym_isolatin1_charset = sym_k_iso_latin1_charset; /* argument types, allowed tables, constraints, related arguments */ #include "UilSymArTy.h" #include "UilSymRArg.h" #include "UilSymArTa.h" #include "UilSymReas.h" #include "UilSymCtl.h" #include "UilConst.h" /* Allowed children and child classes */ #include "UilSymChCl.h" #include "UilSymChTa.h" /* sym_k... to name vectors. */ #include "UilSymNam.h" /* Define mapping of sym_k_..._value to data type names. */ externaldef(uil_comp_glbl) int uil_max_value = sym_k_max_value; externaldef(uil_comp_glbl) char *uil_datatype_names [] = { "", /* NOT USED */ "any", "boolean", "string", /* char 8 */ "compound_string", "float", "integer", "single_float", "localized_string", "wchar_string", "horizontal_dimension_integer", "vertical_dimension_integer", "horizontal_dimension_float", "vertical_dimension_float", "argument", "asciz_table", "class_rec_name", "color", "color_table", "font", "font_table", "icon", "identifier", "integer_table", "keysym", "pixmap", "reason", "rgb", "string_table", "translation_table", "widget_ref", "xbitmapfile", "fontset", "child", }; /* Enumeration Set/Value tables */ #include "UilSymEnum.h" /* Character set attribute tables */ #include "UilSymCSet.h" /* Mrm encoding information */ #include "UilUrmClas.h" /* Names of tokens in grammar */ #include "UilTokName.h" /* The keyword tables */ #include "UilKeyTab.h" /* ** ** OWN VARIABLE DECLARATIONS ** **/ motif-2.3.8/clients/uil/UilDef.h0000644000175000017500000000433013145162623013341 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the set of definitions used by the public ** access routines Uil and UilDumpSymbolTable. ** **-- **/ #ifndef UilDef_h #define UilDef_h #if !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus) \ && !defined(FUNCPROTO) && !defined(XTFUNCPROTO) && !defined(XMFUNCPROTO) #define _NO_PROTO #endif /* __STDC__ */ /* ** ** INCLUDE FILES ** **/ /* ** Includes needed by other include files. */ #include /* ** ** Common includes needed by public functions. ** */ #include #include /* This has to be loaded first. */ #include #include /* ** Function declarations not defined elsewhere */ #define _ARGUMENTS(arglist) arglist #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* uilmain.c */ extern Uil_status_type Uil _ARGUMENTS((Uil_command_type *comand_desc,Uil_compile_desc_type *compile_desc,Uil_continue_type (*message_cb)(), char *message_data, Uil_continue_type (*status_cb)(), char *status_data)); /* uilsymstor.c */ extern void UilDumpSymbolTable _ARGUMENTS(( sym_entry_type *node_entry )); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif /* UilDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilSarInc.c0000644000175000017500000001247213145162623014023 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSarInc.c /main/12 1997/03/12 15:21:31 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contain the routines for processing the INCLUDE construct. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine handles the include directive. ** ** FORMAL PARAMETERS: ** ** file_frame parser stack frame that contains the name of the ** file to be included. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_include_file ( file_frame, include_frame, semi_frame ) yystype * file_frame; yystype * include_frame; yystype * semi_frame; { sym_value_entry_type * value_entry; sym_include_file_entry_type * include_entry; sym_section_entry_type * section_entry; sym_section_entry_type * section_tail_entry; char * buffer; unsigned char tmp1; int i,j; value_entry = (sym_value_entry_type *) file_frame -> value . az_symbol_entry; /* * Fix for CR 5465 - If the value_entry is not of type char_8, print an * error message and abort the compilation */ if ((value_entry->b_type != sym_k_char_8_value) && (value_entry->b_type != sym_k_localized_string_value)) diag_issue_diagnostic ( d_include_file, _sar_source_pos2(value_entry)); /* * End Fix for CR 5465 */ /* * If the direction is RtoL then reverse the include file. */ if (value_entry->b_direction == XmSTRING_DIRECTION_R_TO_L) { /* ** Just reverse the bytes from the first to last */ for (i=0, j=value_entry->w_length-1; i < (int)((int)value_entry->w_length>>1); i++,j--) { tmp1 = value_entry->value.c_value[ i ]; value_entry->value.c_value[ i ] = value_entry->value.c_value[ j ]; value_entry->value.c_value[ j ] = tmp1; } } _assert (value_entry -> header . b_tag == sym_k_value_entry, "missing value entry for include"); /* ** Allocate an INCLUDE entry */ include_entry = (sym_include_file_entry_type *) sem_allocate_node ( sym_k_include_file_entry, sym_k_include_file_entry_size ); /* ** Open the include file. Set up a null-terminated name string. */ buffer = (char *) _get_memory (value_entry -> w_length + 1); _move (buffer, value_entry -> value . c_value, value_entry -> w_length); buffer [value_entry -> w_length] = 0 ; src_open_file (buffer, include_entry->full_file_name); /* ** Allocate a section entry for this include "section". ** Store the source info in it */ section_entry = (sym_section_entry_type *) sem_allocate_node ( sym_k_section_entry, sym_k_section_entry_size ); section_entry->header.b_type = sym_k_include_section; _sar_save_source_info ( §ion_entry->header , include_frame , semi_frame ); /* ** Link this section into the current section list. */ section_entry->next = (sym_entry_type *) sym_az_current_section_entry; section_entry->prev_section = sym_az_current_section_entry->prev_section; sym_az_current_section_entry = section_entry; /* ** Link the include intry we created earlier onto the section list */ section_entry->entries = (sym_entry_type *)include_entry; /* ** Save the file name */ _move (include_entry->file_name, buffer, value_entry->w_length); include_entry->file_name [value_entry->w_length] = 0; /* ** Since this is an INCLUDE we want included sections to hang off ** of it so we create a new place holder entry (tail) and change the ** "current" section list to it. */ section_tail_entry = (sym_section_entry_type *) sem_allocate_node ( sym_k_section_entry, sym_k_section_entry_size ); section_tail_entry->header.b_type = sym_k_section_tail; include_entry->sections = section_tail_entry; section_tail_entry->prev_section = sym_az_current_section_entry; sym_az_current_section_entry = section_tail_entry; _free_memory (buffer); } motif-2.3.8/clients/uil/UilSarProc.c0000644000175000017500000002510413145162623014211 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilSarProc.c /main/12 1995/07/14 09:37:43 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contain the routines for processing procedures. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function create the procedure definition entry symbol ** node a procedure declaration. ** ** FORMAL PARAMETERS: ** ** id_frame ptr to token frame for the procedure name ** param_frame ptr to token frame or null frame holding the ** type of the argument ** class_frame ptr to frame whose b_flags holds private, etc. info ** ** IMPLICIT INPUTS: ** ** sym_az_current_section_entry the "current" section list ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** errors may be issued for previously defined name ** **-- **/ void sar_create_procedure(XmConst yystype *id_frame, XmConst yystype *param_frame, XmConst yystype *class_frame, XmConst yystype *semi_frame) { sym_name_entry_type *name_entry; sym_proc_def_entry_type *proc_def_entry; sym_section_entry_type *section_entry; sym_obj_entry_type *obj_entry; /* ** Call standard routine to check name entry for id_frame. ** This routine handles font name, color names, etc used as ids */ name_entry = (sym_name_entry_type *) sem_dcl_name( id_frame ); if (name_entry == NULL) return; /* ** Allocate the procedure definition entry and fill it in */ proc_def_entry = (sym_proc_def_entry_type *) sem_allocate_node (sym_k_proc_def_entry, sym_k_proc_def_entry_size); proc_def_entry->b_widget_type = uil_max_object + 1; proc_def_entry->obj_header.az_name = (sym_name_entry_type *) name_entry; name_entry->az_object = (sym_entry_type *) proc_def_entry; /* ** Parameter frame has 4 cases: ** 1) no argument checking desired ** syntax: PROCEDURE id ** 2) argument checking desired - no argument ** syntax: PROCEDURE id( ) ** 3) argument checking desired - single argument ** syntax: PROCEDURE id( type ) ** 4) argument checking desired - single typed widget argument ** syntax: PROCEDURE id( CLASS_NAME ) ** These cases are distinguished as follows: ** 1) tag = null type = 0 ** 2) tag = null type = sar_k_no_value ** 3) tag = token type = argument type ** 4) tag = object type = widget type */ proc_def_entry->v_arg_checking = TRUE; switch (param_frame->b_tag) { case sar_k_null_frame: if (param_frame->b_type == sym_k_no_value ) { proc_def_entry->b_arg_count = 0; proc_def_entry->b_arg_type = sym_k_no_value; } else proc_def_entry->v_arg_checking = FALSE; break; case sar_k_token_frame: proc_def_entry->b_arg_type = param_frame->b_type; proc_def_entry->b_arg_count = 1; break; case sar_k_object_frame: _assert((param_frame->b_type == sym_k_widget_entry), "object frame not widget entry"); obj_entry = (sym_obj_entry_type *)param_frame->value.az_symbol_entry; proc_def_entry->b_arg_type = sym_k_widget_ref_value; proc_def_entry->b_arg_count = 1; proc_def_entry->b_widget_type = obj_entry->header.b_type; break; default: _assert( FALSE, "param frame in error" ); } /* ** Process the class clause */ switch (class_frame->b_flags) { case sym_m_exported: sym_make_external_def( name_entry ); case sym_m_private: case sym_m_imported: break; default: _assert( FALSE, "class frame in error" ); } proc_def_entry->obj_header.b_flags = class_frame->b_flags; /* ** save the source file info for this procedure entry */ _sar_save_source_info (&proc_def_entry->header, id_frame, semi_frame ); sar_assoc_comment((sym_obj_entry_type *)proc_def_entry); /* preserve comments */ /* ** allocate a section entry to link the proc_def entry into the structure */ section_entry = (sym_section_entry_type *) sem_allocate_node (sym_k_section_entry, sym_k_section_entry_size); /* ** Link this entry off of the current section list */ section_entry->next = (sym_entry_type *) sym_az_current_section_entry->entries; sym_az_current_section_entry->entries = (sym_entry_type *) section_entry; section_entry->entries = (sym_entry_type *) proc_def_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function processes a reference to a procedure. ** ** FORMAL PARAMETERS: ** ** id_frame ptr to token frame for the procedure name ** value_frame ptr to token frame or null frame holding the ** value of the argument to the procedure ** context value indicating how the procedure is being used ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** a procedure reference entry / NULL in case of an illegal reference ** ** SIDE EFFECTS: ** ** errors may be issued ** **-- **/ sym_proc_ref_entry_type *sem_reference_procedure( yystype *id_frame, XmConst yystype *value_frame, XmConst int context ) { sym_value_entry_type *value_entry = NULL; sym_proc_def_entry_type *proc_def_entry; sym_proc_ref_entry_type *proc_ref_entry; /* ** Call standard routine to check name entry for id_frame. ** This routine handles font name, color names, etc used as ids */ proc_def_entry = (sym_proc_def_entry_type *) sem_ref_name( id_frame, sym_k_proc_def_entry ); switch (value_frame->b_tag) { case sar_k_null_frame: value_entry = NULL; break; case sar_k_value_frame: if ((value_frame->b_flags & sym_m_forward_ref) != 0) value_entry = NULL; else value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; break; case sar_k_object_frame: value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; break; default: _assert( FALSE, "actual arg in error" ); } /* ** Allocate the procedure reference entry and fill it in */ proc_ref_entry = (sym_proc_ref_entry_type *) sem_allocate_node (sym_k_proc_ref_entry, sym_k_proc_ref_entry_size); if ((id_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (id_frame, (char*)&(proc_ref_entry->az_proc_def), sym_k_patch_list_add); else proc_ref_entry->az_proc_def = proc_def_entry; if ((value_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (value_frame, (char*)&(proc_ref_entry->az_arg_value), sym_k_patch_add); else proc_ref_entry->az_arg_value = value_entry; /* ** Apply context constraints ** ** If this is a procedure being used as a user object, ** it should not have any arguments. The arguments to such ** a procedure are always a parent widget id and an argument list. ** This constraint is currently inforced by the grammar. ** ** At this time the compiler permits all types of values for callback ** arguments. This may be limited shortly when we see if it is ** reasonable to pass fonts, colors, reasons, etc. */ return proc_ref_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function checks to see if a object is defined with the name ** corresponding to the id given in the first parameter. ** ** FORMAL PARAMETERS: ** ** id_frame ptr to a token frame on the parse stack holding the name ** tag the type of construct needed ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** ptr to a symbol entry for construct or NULL ** ** SIDE EFFECTS: ** ** error message if the name is undefined or for a different construct ** forward_ref bit may be turned on in id_frame **-- **/ sym_entry_type *sem_ref_name(yystype *id_frame, XmConst int tag) { sym_name_entry_type *name_entry; sym_entry_type *symbol_entry; _assert( id_frame->b_tag == sar_k_token_frame, "arg1 not id frame" ); /* ** The id frame may hold a name or the keyword for a font name, color ** name, reason name etc. If it is one of these special name, then ** we must see if the symbol table holds a name for the special type. */ if (id_frame->b_type != NAME) { name_entry = sym_find_name ( id_frame->value.az_keyword_entry->b_length, id_frame->value.az_keyword_entry->at_name ); if (name_entry == NULL) { diag_issue_diagnostic ( d_undefined, _sar_source_position( id_frame ), diag_tag_text( sym_k_proc_def_entry ), id_frame->value.az_keyword_entry->at_name ); return NULL; } } else name_entry = (sym_name_entry_type *) id_frame->value.az_symbol_entry; /* ** If the name entry already has no object linked from it, we are ** referencing an undefined object. */ symbol_entry = name_entry->az_object; if (symbol_entry == NULL ) { id_frame->b_flags |= sym_m_forward_ref; return NULL; } /* ** If the name entry has the wrong type of object, this is also ** an error. */ if (symbol_entry->header.b_tag != tag ) { diag_issue_diagnostic ( d_ctx_req, _sar_source_position( id_frame ), diag_tag_text( tag ), diag_tag_text( symbol_entry->header.b_tag ) ); return NULL; } return symbol_entry; } motif-2.3.8/clients/uil/UilSymGl.h0000644000175000017500000000706013145162623013701 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file contains external declarations of all ** global data defining the language accepted by the Uil compiler. ** This is exactly the global data generated by WML, plus any ** invariant matching definitions. ** **-- **/ #ifndef UilSymGl_h #define UilSymGl_h /* * Defined in files included in UilData.c */ externalref unsigned char *constraint_tab; externalref key_keytable_entry_type *key_table; externalref int key_k_keyword_max_length; externalref int key_k_keyword_count; externalref key_keytable_entry_type *key_table_case_ins; externalref unsigned char **allowed_argument_table; externalref unsigned char *argument_type_table; externalref unsigned char **allowed_child_table; externalref unsigned char *child_class_table; externalref char **charset_xmstring_names_table; externalref unsigned char *charset_writing_direction_table; externalref unsigned char *charset_parsing_direction_table; externalref unsigned char *charset_character_size_table; externalref char **charset_lang_names_table; externalref unsigned short int *charset_lang_codes_table; externalref unsigned short int charset_lang_table_max; externalref unsigned char **allowed_control_table; externalref UilEnumSetDescDef *enum_set_table; externalref unsigned short int *argument_enumset_table; externalref int *enumval_values_table; externalref int uil_max_object; externalref char **uil_widget_names; externalref int uil_max_arg; externalref char **uil_argument_names; externalref int uil_max_child; externalref char **uil_child_names; externalref int uil_max_reason; externalref char **uil_reason_names; externalref int uil_max_enumset; externalref int uil_max_enumval; externalref char **uil_enumval_names; externalref int uil_max_charset; externalref char **uil_charset_names; externalref unsigned short int *related_argument_table; externalref unsigned char **allowed_reason_table; externalref char **tok_token_name_table; externalref int tok_num_tokens; externalref char **uil_widget_funcs; externalref unsigned short int *uil_gadget_variants; externalref unsigned short int *uil_urm_nondialog_class; externalref unsigned short int *uil_urm_subtree_resource; externalref char **uil_argument_toolkit_names; externalref char **uil_reason_toolkit_names; externalref unsigned short int uil_sym_user_defined_object; externalref unsigned short int uil_sym_default_charset; externalref unsigned short int uil_sym_isolatin1_charset; externalref int uil_max_value; externalref char *uil_datatype_names[]; #endif /* UilSymGl_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilDiagDef.h0000644000175000017500000000241113145162623014124 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interface to the UIL diagnostic ** issuing procedures in the UIL compiler. ** **-- **/ #ifndef UilDiagDef_h #define UilDiagDef_h #define diag_k_no_source NULL #define diag_k_no_column 255 #endif /* UilDiagDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilLstMac.c0000644000175000017500000011076113145162623014027 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilLstMac.c /main/15 1997/03/12 15:21:48 dbl $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module contain the routines for creating the machine listing. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include /* For 64-bit architecture dependencies */ #ifdef DXM_V11 #include #endif #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* Holds offset info for machine code listing. */ typedef struct _off_info { unsigned short int w_off_type; unsigned short int w_off_offset; } off_info_type; #define k_name_off 0 #define k_class_off 1 #define k_arglist_off 2 #define k_children_off 3 #define k_comment_off 4 #define k_creation_off 5 #define k_callback_off 6 #define k_resource_off 7 #define k_float_off 8 #define k_unknown_off 9 #define k_resource_id_off 10 #define k_child_off 11 #define k_text_entry_off 12 #define k_null_text_entry_off 13 #define k_single_float_off 14 /* single float data type RAP */ #define k_off_stack_size 300 static off_info_type off_info_stack [k_off_stack_size]; static int off_info_cnt = 0; #define off_stack_empty (off_info_cnt == 0) #define _Offset(type,base,field) \ ((unsigned int)(base + XtOffsetOf(type, field))) #if defined(__STDC__) #define _OffsetArray(type,base,field) \ ((unsigned int)(base + XtOffsetOf(type, field))) #else #define _OffsetArray(type,base,field) \ ((unsigned int)(base + XtOffsetOf(type, field[0]))) #endif #define _Pointer(base,offset) ((char *)(base)+(offset)) #define ASNHEADERLEN 3 #define CSLONGBIT (unsigned char)(0x80) #define ASNstrlen(a) (ASNHEADERLEN+ \ (((unsigned char)(a)[ASNHEADERLEN]&CSLONGBIT)? \ (((unsigned short)((a)[ASNHEADERLEN+1])<<8) | \ (unsigned short)((a)[ASNHEADERLEN+2]))+3 : \ ((unsigned short)((a)[ASNHEADERLEN]))+1)) /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function saves the machine code listing information for widgets. ** ** FORMAL PARAMETERS: ** ** widget_entry Symbol node for this widget ** az_context context containing the URM output information. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the machine code is saved in the source record structure for ** the widget. ** **-- **/ void save_widget_machine_code ( widget_entry, az_context ) sym_widget_entry_type * widget_entry; URMResourceContext * az_context; { RGMWidgetRecordPtr w_rec; char buffer [132]; unsigned short int w_rec_size; src_source_record_type * az_src_rec; #define _WRPointer(w_rec,offset) ((char *)(w_rec)+(offset)) #define _WROffset(field) (_Offset(RGMWidgetRecord,0,field)) az_src_rec = widget_entry->header.az_src_rec; if (widget_entry->resource_id != 0 ) { sprintf (buffer, "Resource ID: %08lX", widget_entry->resource_id); src_append_machine_code ( az_src_rec, 0, 0, 0, buffer ); } else if (widget_entry->obj_header.az_name != NULL) { sprintf (buffer, "Resource index: %s", widget_entry->obj_header.az_name->c_text); src_append_machine_code ( az_src_rec, 0, 0, 0, buffer ); } w_rec = (RGMWidgetRecordPtr) UrmRCBuffer (az_context); src_append_machine_code ( az_src_rec, _WROffset (validation), sizeof (w_rec->validation), (char*)& w_rec->validation, "widget record" ); sprintf (buffer, "size: %d", w_rec->size); src_append_machine_code ( az_src_rec, _WROffset (size), sizeof (w_rec->size), (char*)& w_rec->size, buffer ); w_rec_size = w_rec->size; sprintf (buffer, "access: %s", access_from_code (w_rec->access) ); src_append_machine_code ( az_src_rec, _WROffset (access), sizeof (w_rec->access), (char*)& w_rec->access, buffer ); sprintf (buffer, "locked: "); if (w_rec->lock) { strcat (buffer, "true"); } else { strcat (buffer, "false"); } src_append_machine_code ( az_src_rec, _WROffset (lock), sizeof (w_rec->lock), (char*)& w_rec->lock, buffer ); sprintf (buffer, "type: "); strcat (buffer, class_name_from_code (w_rec->type)); src_append_machine_code ( az_src_rec, _WROffset (type), sizeof (w_rec->type), (char*)& w_rec->type, buffer ); if (w_rec->name_offs == (MrmOffset) 0) { sprintf (buffer, "no name specified"); } else { sprintf (buffer, "name: offset %X (hex)", w_rec->name_offs); off_put (k_name_off, w_rec->name_offs); } src_append_machine_code ( az_src_rec, _WROffset (name_offs), sizeof (w_rec->name_offs), (char*)& w_rec->name_offs, buffer ); if (w_rec->class_offs == (MrmOffset) 0) { sprintf (buffer, "class: builtin"); } else { sprintf (buffer, "class: offset %X (hex)", w_rec->class_offs); off_put (k_class_off, w_rec->class_offs); } src_append_machine_code ( az_src_rec, _WROffset (class_offs), sizeof (w_rec->class_offs), (char*)& w_rec->class_offs, buffer ); if (w_rec->arglist_offs == (MrmOffset) 0) { sprintf (buffer, "no argument list"); } else { sprintf (buffer, "argument list offset: %X (hex)", w_rec->arglist_offs); off_put (k_arglist_off, w_rec->arglist_offs); } src_append_machine_code ( az_src_rec, _WROffset (arglist_offs), sizeof (w_rec->arglist_offs), (char*)& w_rec->arglist_offs, buffer ); if (w_rec->children_offs == (MrmOffset) 0) { sprintf (buffer, "no children"); } else { sprintf (buffer, "children list offset: %X (hex)", w_rec->children_offs); off_put (k_children_off, w_rec->children_offs); } src_append_machine_code ( az_src_rec, _WROffset (children_offs), sizeof (w_rec->children_offs), (char*)& w_rec->children_offs, buffer ); if (w_rec->comment_offs == (MrmOffset) 0) { sprintf (buffer, "no comment specified"); } else { sprintf (buffer, "comment: offset %X (hex)", w_rec->comment_offs); off_put (k_comment_off, w_rec->comment_offs); } src_append_machine_code ( az_src_rec, _WROffset (comment_offs), sizeof (w_rec->comment_offs), (char*)& w_rec->comment_offs, buffer ); if (w_rec->creation_offs == (MrmOffset) 0) { sprintf (buffer, "no creation callback"); } else { sprintf (buffer, "creation callback offset: %X (hex)", w_rec->creation_offs); off_put (k_creation_off, w_rec->creation_offs); } src_append_machine_code ( az_src_rec, _WROffset (creation_offs), sizeof (w_rec->creation_offs), (char*)& w_rec->creation_offs, buffer ); unload_stack(( char *) w_rec, w_rec_size, az_src_rec ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function unloads entries placed on a stack and outputs them ** into the listing. The routine is used by both widgets and gadgets ** to output their argument, control, and callback lists. ** ** FORMAL PARAMETERS: ** ** rec base of the record being annotated ** rec_sizr size of the record being annotated ** az_src_rec address of the source for record being annotated ** ** IMPLICIT INPUTS: ** ** ** IMPLICIT OUTPUTS: ** ** ** SIDE EFFECTS: ** ** **-- **/ void unload_stack( rec, rec_size, az_src_rec ) char *rec; int rec_size; src_source_record_type *az_src_rec; { char buffer [132], * ptr; int child_index = 0; while ( ! off_stack_empty ) { unsigned short off_type, off_offset; off_get (& off_type, & off_offset); switch (off_type) { case k_name_off : case k_class_off : case k_comment_off : { ptr = (char *) _Pointer(rec, off_offset); src_append_machine_code ( az_src_rec, off_offset, strlen (ptr) + 1, ptr, NULL ); break; } case k_unknown_off : { unsigned short int len; /* Write out everything up to the next offset or the end of the record. */ if ( ! off_stack_empty ) { unsigned short int next_type, next_offset; off_get (& next_type, & next_offset); off_put (next_type, next_offset); len = next_offset - off_offset; } else { len = rec_size - off_offset; } ptr = (char *) _Pointer(rec, off_offset); src_append_machine_code ( az_src_rec, off_offset, len, ptr, NULL ); break; } case k_arglist_off : { RGMArgListDescPtr argdesc; RGMArgumentPtr arg_ptr; int j; argdesc = (RGMArgListDescPtr) _Pointer(rec, off_offset); sprintf (buffer, "argument count: %d", argdesc->count); src_append_machine_code ( az_src_rec, _Offset (RGMArgListDesc, off_offset, count), sizeof (argdesc->count), (char*)& argdesc->count, buffer ); sprintf (buffer, "related argument count: %d", argdesc->extra); src_append_machine_code ( az_src_rec, _Offset (RGMArgListDesc, off_offset, extra), sizeof (argdesc->extra), (char*)& argdesc->extra, buffer ); off_offset = _OffsetArray (RGMArgListDesc, off_offset, args); for (j = 0, arg_ptr = argdesc->args; j < argdesc->count; j++, arg_ptr++, off_offset += sizeof (RGMArgument)) { if (arg_ptr->tag_code != UilMrmUnknownCode ) { sprintf (buffer, "(%d) arg type: %s", j, resource_name_from_code(arg_ptr->tag_code)); } else { ptr = (char *) _Pointer(rec,arg_ptr->stg_or_relcode.tag_offs); sprintf (buffer, "(%d) arg type: %s (user defined)", j, ptr); } src_append_machine_code ( az_src_rec, _Offset (RGMArgument, off_offset, tag_code), sizeof (arg_ptr->tag_code), (char*)& arg_ptr->tag_code, buffer ); if (arg_ptr->stg_or_relcode.tag_offs == (MrmOffset) 0) { sprintf (buffer, "(%d) no tag offset", j); } else { sprintf (buffer, "(%d) tag offset: %X (hex)", j, arg_ptr->stg_or_relcode.tag_offs); off_put (k_name_off, arg_ptr->stg_or_relcode.tag_offs); } src_append_machine_code ( az_src_rec, _Offset (RGMArgument, off_offset, stg_or_relcode.tag_offs), sizeof (arg_ptr->stg_or_relcode.tag_offs), (char*)& arg_ptr->stg_or_relcode.tag_offs, buffer ); sprintf (buffer, "(%d) type: %s", j, type_from_code (arg_ptr->arg_val.rep_type) ); src_append_machine_code ( az_src_rec, _Offset (RGMArgument, off_offset, arg_val.rep_type), sizeof (arg_ptr->arg_val.rep_type), (char*)& arg_ptr->arg_val.rep_type, buffer ); sprintf (buffer, "(%d) ", j); format_arg_value (& arg_ptr->arg_val, & buffer [strlen (buffer)]); src_append_machine_code ( az_src_rec, _Offset (RGMArgument, off_offset, arg_val.datum), sizeof (arg_ptr->arg_val.datum), (char*)& arg_ptr->arg_val.datum, buffer ); } break; } case k_float_off : { double * dptr; dptr = (double *) _Pointer (rec, off_offset); sprintf (buffer, "floating point value: %g", (* dptr)); src_append_machine_code ( az_src_rec, off_offset, sizeof (double), (char*)dptr, buffer ); break; } /* single float data type RAP */ case k_single_float_off : { float *fptr; fptr = (float *) _Pointer(rec, off_offset); sprintf(buffer, "Single float value: %g", (* fptr)); src_append_machine_code ( az_src_rec, off_offset, sizeof (float), (char*)fptr, buffer); break; } case k_creation_off : case k_callback_off : { RGMCallbackDescPtr cb_desc_ptr; RGMCallbackItemPtr cb_item_ptr; int j; cb_desc_ptr = (RGMCallbackDescPtr) _Pointer (rec, off_offset); src_append_machine_code ( az_src_rec, _Offset (RGMCallbackDesc, off_offset, validation), sizeof (cb_desc_ptr->validation), (char*)& cb_desc_ptr->validation, "callback descriptor" ); sprintf (buffer, "callback count: %d", cb_desc_ptr->count); src_append_machine_code ( az_src_rec, _Offset (RGMCallbackDesc, off_offset, count), sizeof (cb_desc_ptr->count), (char*)& cb_desc_ptr->count, buffer ); off_offset = _OffsetArray (RGMCallbackDesc, off_offset, item); for (j = 0, cb_item_ptr = cb_desc_ptr->item; j < cb_desc_ptr->count; j++, cb_item_ptr++, off_offset += sizeof (RGMCallbackItem)) { sprintf (buffer, "(%d) routine name offset: %X (hex)", j, cb_item_ptr->cb_item.routine); src_append_machine_code ( az_src_rec, _Offset (RGMCallbackItem, off_offset, cb_item.routine), #ifndef WORD64 sizeof (cb_item_ptr->cb_item.routine), (char*)& cb_item_ptr->cb_item.routine, #else /* 64-bit architecture */ 4, (char*)& cb_item_ptr->cb_item, #endif /* WORD64 */ buffer ); off_put (k_name_off, cb_item_ptr->cb_item.routine); sprintf (buffer, "(%d) routine tag type: %s", j, type_from_code ( cb_item_ptr->cb_item.rep_type) ); src_append_machine_code (az_src_rec, _Offset (RGMCallbackItem, off_offset, cb_item.rep_type), #ifndef WORD64 sizeof (cb_item_ptr->cb_item.rep_type), (char*)& cb_item_ptr->cb_item.rep_type, #else /* 64-bit architecture */ 4, (char*)& cb_item_ptr->cb_item + 4, #endif /* WORD64 */ buffer ); sprintf (buffer, "(%d) value: ", j); src_append_machine_code (az_src_rec, _Offset (RGMCallbackItem, off_offset, cb_item.datum), sizeof (cb_item_ptr->cb_item.datum), (char*)& cb_item_ptr->cb_item.datum, buffer ); } /* for */ break; } case k_resource_off : { RGMResourceDescPtr r_desc_ptr; r_desc_ptr = (RGMResourceDescPtr) _Pointer (rec, off_offset); sprintf (buffer, "resource descriptor, size: %d", r_desc_ptr->size); src_append_machine_code ( az_src_rec, _Offset (RGMResourceDesc, off_offset, size), sizeof (r_desc_ptr->size), (char*)& r_desc_ptr->size, buffer ); sprintf (buffer, "access: %s", access_from_code (r_desc_ptr->access) ); src_append_machine_code ( az_src_rec, _Offset (RGMResourceDesc, off_offset, access), sizeof (r_desc_ptr->access), (char*)& r_desc_ptr->access, buffer ); switch (r_desc_ptr->type) { case URMrIndex: sprintf (buffer, "index, offset: %X (hex)", _Offset (RGMResourceDesc, off_offset, key) ); off_put (k_name_off, _Offset (RGMResourceDesc, off_offset, key) ); break; case URMrRID: sprintf (buffer, "resource ID, offset: %X (hex)", _Offset (RGMResourceDesc, off_offset, key) ); off_put (k_resource_id_off, _Offset (RGMResourceDesc, off_offset, key) ); break; default: sprintf (buffer, "unknown resource type"); break; } src_append_machine_code ( az_src_rec, _Offset (RGMResourceDesc, off_offset, type), sizeof (r_desc_ptr->type), (char*)& r_desc_ptr->type, buffer ); sprintf (buffer, "resource group: %s", group_from_code (r_desc_ptr->res_group) ); src_append_machine_code ( az_src_rec, _Offset (RGMResourceDesc, off_offset, res_group), sizeof (r_desc_ptr->res_group), (char*)& r_desc_ptr->res_group, buffer ); sprintf (buffer, "resource type: %s", (r_desc_ptr->res_group == URMgLiteral) ? type_from_code (r_desc_ptr->cvt_type) : class_name_from_code (r_desc_ptr->cvt_type) ); src_append_machine_code ( az_src_rec, _Offset (RGMResourceDesc, off_offset, cvt_type), sizeof (r_desc_ptr->cvt_type), (char*)& r_desc_ptr->cvt_type, buffer ); break; } case k_resource_id_off : { sprintf (buffer, "resource id"); src_append_machine_code ( az_src_rec, off_offset, sizeof (MrmResource_id), (char *) _Pointer (rec, off_offset), buffer ); break; } case k_children_off : { RGMChildrenDescPtr c_desc_ptr; int j; c_desc_ptr = (RGMChildrenDescPtr) _Pointer(rec, off_offset); sprintf (buffer, "Children count: %d", c_desc_ptr->count); src_append_machine_code ( az_src_rec, _Offset (RGMChildrenDesc, off_offset, count), sizeof (c_desc_ptr->count), (char*)& c_desc_ptr->count, buffer ); off_offset = _OffsetArray (RGMChildrenDesc, off_offset, child); for (j = 0; j < c_desc_ptr->count; j++, off_offset += sizeof (RGMChildDesc)) { off_put (k_child_off, off_offset); } /* for */ child_index = 0; break; } case k_child_off : { RGMChildDescPtr c_ptr; int j; c_ptr = (RGMChildDescPtr) _Pointer(rec, off_offset); j = child_index; child_index++; if (c_ptr->manage) { sprintf (buffer, "(%d) managed", j); } else { sprintf (buffer, "(%d) unmanaged", j); } src_append_machine_code ( az_src_rec, _Offset (RGMChildDesc, off_offset, manage), sizeof (c_ptr->manage), (char*)& c_ptr->manage, buffer ); sprintf (buffer, "(%d) access: %s", j, access_from_code (c_ptr->access) ); src_append_machine_code ( az_src_rec, _Offset (RGMChildDesc, off_offset, access), sizeof (c_ptr->access), (char*)& c_ptr->access, buffer ); switch (c_ptr->type) { case URMrIndex: sprintf (buffer, "(%d) index, offset: %X (hex)", j, c_ptr->key.index_offs); src_append_machine_code ( az_src_rec, _Offset (RGMChildDesc, off_offset, type), sizeof (c_ptr->type) + sizeof (c_ptr->key), (char*)& c_ptr->type, buffer ); off_put (k_name_off, c_ptr->key.index_offs); break; case URMrRID: sprintf (buffer, "(%d) resource ID, offset: %X (hex)", j, _Offset (RGMChildDesc, off_offset, key) ); src_append_machine_code ( az_src_rec, _Offset (RGMChildDesc, off_offset, type), sizeof (c_ptr->type), (char*)& c_ptr->type, buffer ); off_put (k_resource_id_off, _Offset (RGMChildDesc, off_offset, key) ); break; default: sprintf (buffer, "(%d) unknown class", j); src_append_machine_code ( az_src_rec, _Offset (RGMChildDesc, off_offset, type), sizeof (c_ptr->type), (char*)& c_ptr->type, buffer ); break; } break; } default : { break; } } /* switch */ } /* for */ src_append_machine_code ( az_src_rec, 0, 0, 0, 0 ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function saves the machine code listing information for values. ** ** FORMAL PARAMETERS: ** ** value_entry Symbol node for this value ** az_context context containing the URM output information. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the machine code is saved in the source record structure for this ** value. ** **-- **/ void save_value_machine_code ( value_entry, az_context ) sym_value_entry_type * value_entry; URMResourceContext * az_context; { src_source_record_type * az_src_rec; char buffer [132], * rc_buffer; unsigned short int rc_size; az_src_rec = value_entry->header.az_src_rec; if (value_entry->resource_id != 0) { sprintf (buffer, "Resource ID: %08lX", value_entry->resource_id); src_append_machine_code ( az_src_rec, 0, 0, 0, buffer ); } else if (value_entry->obj_header.az_name != NULL) { sprintf (buffer, "Resource index: %s", value_entry->obj_header.az_name->c_text); src_append_machine_code (az_src_rec, 0, 0, 0, buffer); } sprintf (buffer, "size: %d, group: %s", UrmRCSize (az_context), group_from_code (UrmRCGroup (az_context)) ); src_append_machine_code ( az_src_rec, 0, 0, 0, buffer ); sprintf (buffer, "type: %s, access: %s, locked: ", type_from_code (UrmRCType (az_context)), access_from_code (UrmRCAccess (az_context)) ); if (UrmRCLock (az_context)) { strcat (buffer, "true"); } else { strcat (buffer, "false"); } src_append_machine_code ( az_src_rec, 0, 0, 0, buffer ); rc_buffer = UrmRCBuffer (az_context); rc_size = UrmRCSize (az_context); /* ** Case on the type of literal. */ switch (value_entry->b_type) { case sym_k_bool_value: if ( * (unsigned long *) rc_buffer ) sprintf (buffer, "value: true"); else sprintf (buffer, "value: false"); src_append_machine_code ( az_src_rec, 0, rc_size, rc_buffer, buffer ); break; case sym_k_integer_value: case sym_k_horizontal_integer_value: case sym_k_vertical_integer_value: sprintf (buffer, "value: %ld", (* (unsigned long *) rc_buffer) ); src_append_machine_code ( az_src_rec, 0, rc_size, rc_buffer, buffer ); break; case sym_k_integer_table_value: case sym_k_rgb_value: /* rgb data type RAP */ { int index = 0; int offset = 0; for (offset = 0; offset < (int)rc_size; offset += sizeof(int), index++) { sprintf (buffer, "value[%d]: %ld", index, ((unsigned long *) rc_buffer)[index] ); src_append_machine_code (az_src_rec, 0, sizeof(int), (char*)&(((unsigned long *)rc_buffer)[index]), buffer ); } break; } case sym_k_float_value: case sym_k_horizontal_float_value: case sym_k_vertical_float_value: sprintf (buffer, "value: %g", (* (double *) rc_buffer) ); src_append_machine_code ( az_src_rec, 0, rc_size, rc_buffer, buffer ); break; case sym_k_single_float_value: sprintf (buffer, "value: %g", (* (float *) rc_buffer)); src_append_machine_code (az_src_rec, 0, rc_size, rc_buffer, buffer ); break; case sym_k_char_8_value: case sym_k_color_value: case sym_k_color_table_value: case sym_k_icon_value: case sym_k_font_value: case sym_k_fontset_value: case sym_k_font_table_value: case sym_k_reason_value: case sym_k_argument_value: case sym_k_identifier_value: case sym_k_compound_string_value: case sym_k_xbitmapfile_value: case sym_k_keysym_value: src_append_machine_code ( az_src_rec, 0, rc_size, rc_buffer, 0 ); break; case sym_k_asciz_table_value: case sym_k_string_table_value: { RGMTextVectorPtr tv_ptr; unsigned short off_type, off_offset, off_cnt; int i; off_offset = 0; tv_ptr = (RGMTextVectorPtr) rc_buffer; src_append_machine_code ( az_src_rec, _Offset (RGMTextVector, off_offset, validation), sizeof (tv_ptr->validation), (char*)& tv_ptr->validation, "text vector" ); sprintf (buffer, "count: %d", tv_ptr->count); src_append_machine_code ( az_src_rec, _Offset (RGMTextVector, off_offset, count), sizeof (tv_ptr->count), (char*)& tv_ptr->count, buffer ); off_offset = _OffsetArray (RGMTextVector, off_offset, item); for (i = 0; i < tv_ptr->count; i++, off_offset += sizeof (RGMTextEntry)) { off_put (k_text_entry_off, off_offset); } off_put (k_null_text_entry_off, off_offset); off_cnt = 0; while ( ! off_stack_empty ) { RGMTextEntryPtr te_ptr; off_get (& off_type, & off_offset); switch (off_type) { case k_name_off : { char *stringPtr = (char *) _Pointer (rc_buffer,off_offset); src_append_machine_code (az_src_rec, off_offset, ASNstrlen( stringPtr ), stringPtr, NULL ); } break; case k_null_text_entry_off : src_append_machine_code ( az_src_rec, off_offset, sizeof (RGMTextEntry), (char*)_Pointer (rc_buffer, off_offset), "end of text vector" ); break; case k_text_entry_off : te_ptr = (RGMTextEntryPtr) _Pointer (rc_buffer, off_offset); sprintf (buffer, "(%d) type: %s, offset: %X (hex)", off_cnt, type_from_code (te_ptr->text_item.rep_type), te_ptr->text_item.offset ); src_append_machine_code ( az_src_rec, _Offset (RGMTextEntry, off_offset, text_item), sizeof (te_ptr->text_item), (char*)& te_ptr->text_item, buffer ); off_cnt++; off_put (k_name_off, te_ptr->text_item.offset); break; default: sprintf (buffer, "(%d) unknown text entry", i); src_append_machine_code ( az_src_rec, off_offset, 0, 0, buffer ); break; } } break; } case sym_k_trans_table_value: src_append_machine_code ( az_src_rec, 0, rc_size, rc_buffer, NULL ); break; default: { sprintf (buffer, "unknown value"); src_append_machine_code ( az_src_rec, 0, 0, 0, buffer ); break; } } src_append_machine_code ( az_src_rec, 0, 0, 0, 0 ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function saves the machine code listing information for modules. ** ** FORMAL PARAMETERS: ** ** az_src_rec Source record for this machine code info. ** az_context context containing the URM output information. ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the machine code is saved in the source record structure ** **-- **/ void save_module_machine_code ( az_src_rec, az_context ) src_source_record_type * az_src_rec; URMResourceContext * az_context; { RGMModuleDescPtr m_rec; RGMTopmostDescPtr t_rec; char buffer [132]; unsigned short off_offset; int i; off_offset = 0; m_rec = (RGMModuleDescPtr) UrmRCBuffer (az_context); src_append_machine_code ( az_src_rec, _Offset (RGMModuleDesc, off_offset, validation), sizeof (m_rec->validation), (char*)& m_rec->validation, "module record" ); sprintf (buffer, "topmost count: %d", m_rec->count); src_append_machine_code ( az_src_rec, _Offset (RGMModuleDesc, off_offset, count), sizeof (m_rec->count), (char*)& m_rec->count, buffer ); off_offset = _OffsetArray (RGMModuleDesc, off_offset, topmost); for (i = 0, t_rec = m_rec->topmost; i < m_rec->count; i++, t_rec++, off_offset += sizeof (RGMTopmostDesc)) { sprintf (buffer, "(%d) %s", i, t_rec->index); src_append_machine_code ( az_src_rec, _OffsetArray (RGMTopmostDesc, off_offset, index), strlen(t_rec->index), t_rec->index, buffer ); } /* for */ src_append_machine_code ( az_src_rec, 0, 0, 0, 0 ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function adds an offset entry to the offset stack for ** machine code. The entry is inserted in the proper place in ** the stack depending on the offset value. ** ** FORMAL PARAMETERS: ** ** off_type type of offset entry ** off_offset offset value for this offset entry ** ** IMPLICIT INPUTS: ** ** off_info_cnt number of offset stack entries ** off_info_stack stack containing offset entries ** ** IMPLICIT OUTPUTS: ** ** off_info_cnt number of offset stack entries ** off_info_stack stack containing offset entries ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the offset info is saved in the offset stack ** **-- **/ void off_put (unsigned short off_type, unsigned short off_offset) { off_info_type off_info, * off_info_ptr; int i; if (off_info_cnt >= k_off_stack_size) { diag_issue_internal_error ("stack overflow in machine listing"); } off_info.w_off_type = off_type; off_info.w_off_offset = off_offset; /* Insert on the stack before the first entry with a lower offset value */ for (i = 0, off_info_ptr = off_info_stack; i < off_info_cnt; i++, off_info_ptr++) { if (off_info.w_off_offset > off_info_ptr->w_off_offset) { break; } } _move ( & off_info_ptr [1], off_info_ptr, (off_info_cnt - i) * sizeof (off_info_type) ); (* off_info_ptr) = off_info; off_info_cnt++; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function removes an offset entry to the offset stack for ** machine code. ** ** FORMAL PARAMETERS: ** ** off_type address to receive the type of offset entry ** off_offset address to receive the offset value for this ** offset entry ** ** IMPLICIT INPUTS: ** ** off_info_cnt number of offset stack entries ** off_info_stack stack containing offset entries ** ** IMPLICIT OUTPUTS: ** ** off_info_cnt number of offset stack entries ** off_info_stack stack containing offset entries ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** the offset info is retrieved from the offset stack ** **-- **/ void off_get (off_type, off_offset) unsigned short * off_type; unsigned short * off_offset; { off_info_type * off_info_ptr; if (off_info_cnt <= 0) { diag_issue_internal_error ("stack underflow in machine listing"); } /* Remove from the stack the entry with the lowest offset value */ off_info_ptr = & off_info_stack [off_info_cnt - 1]; (* off_type) = off_info_ptr->w_off_type; (* off_offset) = off_info_ptr->w_off_offset; off_info_cnt--; } char * type_from_code (MrmType type_code) /* *++ * * PROCEDURE DESCRIPTION: * * This procedure returns the string corresponding to a URM type code * * FORMAL PARAMETERS: * * type type code from RGMrType... * * IMPLICIT INPUTS: * * none * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * The string corresponding to the type code * * SIDE EFFECTS: * * none * *-- */ { switch (type_code) { case MrmRtypeInteger: return uil_datatype_names[sym_k_integer_value]; case MrmRtypeHorizontalInteger: return uil_datatype_names[sym_k_horizontal_integer_value]; case MrmRtypeVerticalInteger: return uil_datatype_names[sym_k_vertical_integer_value]; case MrmRtypeBoolean: return uil_datatype_names[sym_k_bool_value]; case MrmRtypeChar8: return uil_datatype_names[sym_k_char_8_value]; case MrmRtypeChar8Vector: return uil_datatype_names[sym_k_asciz_table_value]; case MrmRtypeCString: return uil_datatype_names[sym_k_compound_string_value]; case MrmRtypeCStringVector: return uil_datatype_names[sym_k_string_table_value]; case MrmRtypeFloat: return uil_datatype_names[sym_k_float_value]; case MrmRtypeHorizontalFloat: return uil_datatype_names[sym_k_horizontal_float_value]; case MrmRtypeVerticalFloat: return uil_datatype_names[sym_k_vertical_float_value]; case MrmRtypeSingleFloat: /* single float data type RAP */ return uil_datatype_names[sym_k_single_float_value]; case MrmRtypeCallback: return "callback"; case MrmRtypePixmapImage: return "pixmap image"; case MrmRtypePixmapDDIF: return "pixmap DDIF"; case MrmRtypeResource: return "resource"; case MrmRtypeAddrName: return "addr name"; case MrmRtypeIconImage: return uil_datatype_names[sym_k_icon_value]; case MrmRtypeFont: return uil_datatype_names[sym_k_font_value]; case MrmRtypeFontSet: return uil_datatype_names[sym_k_fontset_value]; case MrmRtypeFontList: return uil_datatype_names[sym_k_font_table_value]; case MrmRtypeColor: return uil_datatype_names[sym_k_color_value]; case MrmRtypeColorTable: return uil_datatype_names[sym_k_color_table_value]; case MrmRtypeAny: return uil_datatype_names[sym_k_any_value]; case MrmRtypeTransTable: return uil_datatype_names[sym_k_trans_table_value]; case MrmRtypeClassRecName: return uil_datatype_names[sym_k_class_rec_name_value]; case MrmRtypeIntegerVector: return uil_datatype_names[sym_k_integer_table_value]; case MrmRtypeXBitmapFile: return uil_datatype_names[sym_k_xbitmapfile_value]; case MrmRtypeKeysym: return uil_datatype_names[sym_k_keysym_value]; default: return "unknown"; } } char * access_from_code (MrmFlag access_code) /* *++ * * PROCEDURE DESCRIPTION: * * This procedure returns the string corresponding to a URM access code * * FORMAL PARAMETERS: * * access_code access code * * IMPLICIT INPUTS: * * none * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * The string corresponding to the access code * * SIDE EFFECTS: * * none * *-- */ { switch (access_code) { case URMaPublic: return "public"; case URMaPrivate: return "private"; default: return "unknown"; } } char * group_from_code (MrmGroup group_code) /* *++ * * PROCEDURE DESCRIPTION: * * This procedure returns the string corresponding to a URM group code * * FORMAL PARAMETERS: * * group_code group code * * IMPLICIT INPUTS: * * none * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * The string corresponding to the group code * * SIDE EFFECTS: * * none * *-- */ { switch (group_code) { case URMgWidget: return "widget"; case URMgLiteral: return "literal"; case URMgResourceSet: return "resource set"; default: return "unknown"; } } void format_arg_value (argval_ptr, buffer) RGMArgValuePtr argval_ptr; char * buffer; /* *++ * * FUNCTION PROTOTYPE * * PROCEDURE DESCRIPTION: * * This routine formats a value descriptor into the buffer. * * FORMAL PARAMETERS: * * argval_ptr pointer to the argument value descriptor * buffer buffer to receive the formatted value * * IMPLICIT INPUTS: * * * IMPLICIT OUTPUTS: * * * FUNCTION VALUE: * * SIDE EFFECTS: * * *-- */ { switch ( argval_ptr->rep_type ) { case MrmRtypeInteger: case MrmRtypeHorizontalInteger: case MrmRtypeVerticalInteger: sprintf (buffer, "value: %d", argval_ptr->datum.ival); break; case MrmRtypeBoolean: if (argval_ptr->datum.ival) { sprintf (buffer, "value: true"); } else { sprintf (buffer, "value: false"); } break; case MrmRtypeChar8: case MrmRtypeCStringVector: case MrmRtypePixmapImage: case MrmRtypePixmapDDIF: case MrmRtypeCString: case MrmRtypeAddrName: case MrmRtypeKeysym: sprintf (buffer, "offset: %X (hex)", argval_ptr->datum.offset); off_put (k_unknown_off, argval_ptr->datum.offset); break; case MrmRtypeFloat: case MrmRtypeHorizontalFloat: case MrmRtypeVerticalFloat: sprintf (buffer, "offset: %X (hex)", argval_ptr->datum.offset); off_put (k_float_off, argval_ptr->datum.offset); break; case MrmRtypeSingleFloat: /* single float data type RAP */ sprintf (buffer, "offset: %X (hex)", argval_ptr->datum.offset); off_put (k_single_float_off, argval_ptr->datum.offset); break; case MrmRtypeCallback: sprintf (buffer, "offset: %X (hex)", argval_ptr->datum.offset); off_put (k_callback_off, argval_ptr->datum.offset); break; case MrmRtypeResource: sprintf (buffer, "offset: %X (hex)", argval_ptr->datum.offset); off_put (k_resource_off, argval_ptr->datum.offset); break; default: sprintf (buffer, "value unknown"); break; } } char * class_name_from_code (MrmCode class) /* *++ * * PROCEDURE DESCRIPTION: * * This procedure returns the string corresponding to a URM class code * * FORMAL PARAMETERS: * * class class code from URMwc... * * IMPLICIT INPUTS: * * none * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * The string corresponding to the class code * * SIDE EFFECTS: * * none * *-- */ { int sym_code; /* * Find the sym_k code for the class, then return its name */ for ( sym_code=sym_k_error_object+1; sym_code<=uil_max_object; sym_code++ ) if ( uil_widget_compr[sym_code] == class ) return uil_widget_names[sym_code]; return "unknown"; } char * resource_name_from_code (MrmCode resource) /* *++ * * PROCEDURE DESCRIPTION: * * This procedure returns the string corresponding to a compression code * * FORMAL PARAMETERS: * * resource compression code for argument or reason * * IMPLICIT INPUTS: * * none * * IMPLICIT OUTPUTS: * * none * * FUNCTION VALUE: * * The string corresponding to the resource code * * SIDE EFFECTS: * * none * *-- */ { int sym_code; /* * Find the sym_k code for the resource, then return its name */ for ( sym_code=0 ; sym_code<=uil_max_arg ; sym_code++ ) if ( uil_arg_compr[sym_code] == resource ) return uil_argument_names[sym_code]; for ( sym_code=0 ; sym_code<=uil_max_reason ; sym_code++ ) if ( uil_reas_compr[sym_code] == resource ) return uil_reason_names[sym_code]; for ( sym_code=0 ; sym_code<=uil_max_child ; sym_code++ ) if ( uil_child_compr[sym_code] == resource ) return uil_child_names[sym_code]; return "unknown"; } motif-2.3.8/clients/uil/UilSymNam.c0000644000175000017500000002456713145162623014060 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSymNam.c /main/13 1997/09/08 11:12:50 cshi $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module inserts names into the name table. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" /* ** ** DEFINE and MACRO DEFINITIONS ** **/ /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine searches for a name entry of the same name as its parameters. ** If the entry is found, a pointer to that name node is ** returned as the value of the function. If no entry is found, a NULL ** pointer is returned. ** ** See sym_insert_name for a description of the name lookup alorithm. ** ** FORMAL PARAMETERS: ** ** l_length length of the name not including the null ** c_text pointer to a null terminated string for name ** ** IMPLICIT INPUTS: ** ** sym_az_hash_table the hash table ** ** IMPLICIT OUTPUTS: ** ** sym_az_hash_table may be updated with an additional name ** ** FUNCTION VALUE: ** ** a pointer to a name entry ** ** SIDE EFFECTS: ** ** none ** **-- **/ sym_name_entry_type *sym_find_name(l_length, c_text) int l_length; /* length of name to find */ char *c_text; /* text of the name */ { sym_name_entry_type *az_current_name; int l_hash_code; int l_compare_result; /* obtain the hash code of for the name */ l_hash_code = hash_function( l_length, c_text ); /* ** chain along hash chain looking for symbol - exit loop under 3 condition ** 1) come to the end of the chain: name not found ** 2) find symbol: return this symbol ** 3) find node > symbol: name not found */ for (az_current_name = sym_az_hash_table[ l_hash_code ]; az_current_name != NULL; az_current_name = az_current_name->az_next_name_entry) { l_compare_result = _compare(c_text, az_current_name->c_text); if (l_compare_result == 0) /* c_text = current name */ { /* found the name we are looking for */ return az_current_name; } if (l_compare_result > 0) /* c_text > current name */ { /* return NULL - name should be before this spot in list */ return NULL; } } /* came to end of the list without finding the name */ return NULL; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This routine searches for a name entry of the same name as its parameters. ** If the entry is found, a pointer to that name node is ** returned as the value of the function. If no entry is found, one is ** inserted. In this case the value of the function is a pointer to ** the name entry created. ** ** Name entries are linked off of a hash table. Those ** entries that have the same hash code, are sorted according to the ** collating sequence. Thus the algorithm involves hashing the symbol and ** then following the chain for that hash code until one of the following ** conditions is met. 1) the identifier is found, then return a pointer ** to that name entry. 2) come to the end of the chain or a name ** entry that comes later in the collating sequence than the symbol being ** searched for. In this case the name is inserted just prior to this ** point in the chain. ** ** FORMAL PARAMETERS: ** ** l_length length of the name not including the null ** c_text pointer to a null terminated string for name ** ** IMPLICIT INPUTS: ** ** sym_az_hash_table the hash table ** ** IMPLICIT OUTPUTS: ** ** sym_az_hash_table may be updated with an additional name ** ** FUNCTION VALUE: ** ** a pointer to a name entry ** ** SIDE EFFECTS: ** ** may create a name entry and update the hash table ** **-- **/ sym_name_entry_type *sym_insert_name(l_length, c_text) int l_length; /* length of name to insert */ char *c_text; /* text of the name */ { sym_name_entry_type *az_previous_name; sym_name_entry_type *az_current_name; sym_name_entry_type *az_new_name; int l_hash_code; int l_compare_result; /* ** algorithm keeps 2 pointers, one for the previous name and one ** for the current name. This permits easy insertion of a new name */ /* obtain the hash code of for the name */ l_hash_code = hash_function( l_length, c_text ); /* ** chain along hash chain looking for symbol - exit loop under 3 condition ** 1) come to the end of the chain: insert new node on end ** 2) find symbol: return this symbol ** 3) find node > symbol: insert new node prior to current node */ for (az_current_name = sym_az_hash_table[ l_hash_code ], az_previous_name = NULL; az_current_name != NULL; az_previous_name = az_current_name, az_current_name = az_current_name->az_next_name_entry) { l_compare_result = _compare(c_text, az_current_name->c_text); if (l_compare_result == 0) /* c_text = current name */ { /* found the name we are looking for */ return az_current_name; } if (l_compare_result > 0) /* c_text > current name */ { /* exit the loop to insert just prior to current name */ goto insert_name; } } insert_name: /* ** name is not in the table so it must be inserted between the ** az_previous_name and az_current_name entries. */ /* allocate and initialize the name entry */ az_new_name = (sym_name_entry_type *) sem_allocate_node (sym_k_name_entry, sym_k_name_entry_size + l_length + 1); az_new_name->header.b_type = l_length; /* b_type holds length */ az_new_name->az_object = NULL; az_new_name->az_cycle_id = 0; _move( az_new_name->c_text, c_text, l_length+1 ); /* ** link the name entry into the hash table */ az_new_name->az_next_name_entry = az_current_name; if (az_previous_name == NULL) sym_az_hash_table[ l_hash_code ] = az_new_name; else az_previous_name->az_next_name_entry = (sym_name_entry_type *) az_new_name; return az_new_name; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure is a hashing function. It takes a length and a ** pointer to a value. Using this value as a string, the function ** returns an integer in the range of 0 to sym_k_hash_table_limit-1. ** ** FORMAL PARAMETERS: ** ** l_length length of the value in bytes not including null ** c_value a null terminated string ** ** IMPLICIT INPUTS: ** ** sym_k_hash_table_limit ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** integer (the hash code) in range 0 to sym_k_hash_table_limit-1 ** ** SIDE EFFECTS: ** ** none ** **-- **/ int hash_function(l_length, c_value) int l_length; char *c_value; { #ifdef WORD64 #define _shift 3 static unsigned int XmConst mask[ 8 ] = { 0x00000000000000FF, 0x000000000000FFFF, 0x0000000000FFFFFF, 0x00000000FFFFFFFF, 0x00000000FFFFFFFF, 0x0000FFFFFFFFFFFF, 0x00FFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, }; #elif defined (LONG64) #define _shift 3 static long XmConst mask[ 8 ] = { 0x00000000000000FF, 0x000000000000FFFF, 0x0000000000FFFFFF, 0x00000000FFFFFFFF, 0x00000000FFFFFFFF, 0x0000FFFFFFFFFFFF, 0x00FFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, }; #else #define _shift 2 static unsigned int XmConst mask[ 4 ] = { 0x000000FF, 0x0000FFFF, 0x00FFFFFF, 0xFFFFFFFF }; #endif #ifdef LONG64 long l_hash_code; long al_value[20]; #else int l_hash_code; int al_value[20]; #endif int l_limit; int l_extra; int i; l_limit = (l_length-1) >> _shift; /* divide by wordsize */ l_extra = (l_length-1) & _slm; /* remainder from divide by wordsize */ #ifdef LONG64 bzero((char *)al_value, sizeof(long) * 20); #else bzero((char *)al_value, sizeof(int) * 20); #endif strncpy((char *)al_value, c_value, l_length); l_hash_code = 0; for (i = 0; i < l_limit; i++) { l_hash_code = l_hash_code ^ al_value[ i ]; } l_hash_code = l_hash_code ^ (al_value[ i ] & mask[ l_extra ]); return (int)(l_hash_code % sym_k_hash_table_limit); } #if debug_version /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This debugging routine will dump out the name entries linked ** from the hash table. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** sym_az_hash_table ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** prints out the hash table ** **-- **/ void sym_dump_hash_table() { int i; int total_count; int max_length; int empty_count; total_count = 0; empty_count = 0; max_length = 0; for (i=0; iaz_next_name_entry) { bucket_count++; _debug_output("\t %s \n", az_name->c_text); } total_count += bucket_count; if (bucket_count == 0) empty_count++; max_length = ( max_length > bucket_count )? max_length : bucket_count; _debug_output("bucket: %d length: %d\n", i, bucket_count); } _debug_output("name count: %d \n empty count: %d \n max length: %d", total_count, empty_count, max_length ); } #endif motif-2.3.8/clients/uil/UilSarVal.c0000644000175000017500000027023313145162623014035 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: UilSarVal.c /main/13 1997/12/06 16:14:16 cshi $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This module supports values in UIL. UIL values are ** quite primitive in terms of operators, however, there is a ** concept of a private value that is local to this module ** and a imported or exported value which needs to be ** resolved via a lookup at runtime. The runtime resolved values ** cannot be modified with operators. ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include #include "UilDefI.h" #include "UilSymGen.h" /* For sym_k_[TRUE|FALSE]_enumval */ /* ** ** TABLE OF CONTENTS ** **/ /* ** FORWARD DECLARATIONS */ static sym_value_entry_type *standard_color_table _ARGUMENTS(( void )); /* ** ** DEFINE and MACRO DEFINITIONS ** **/ #define clear_class_mask \ (~(sym_m_private | sym_m_imported | sym_m_exported | sym_m_builtin)) /* ** ** EXTERNAL VARIABLE DECLARATIONS ** **/ extern yystype yylval; /* ** ** GLOBAL VARIABLE DECLARATIONS ** **/ /* ** ** OWN VARIABLE DECLARATIONS ** **/ /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function takes a non-reserved keyword and makes a name ** entry for it. In the context in which the keyword is used, ** it is not being used as a keyword. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant token stack frame ** keyword_frame pointer to token stack frame holding the keyword ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** a name entry is generated ** **-- **/ void sar_map_keyword_to_name( target_frame, keyword_frame ) yystype *target_frame; yystype *keyword_frame; { sym_name_entry_type *name_entry; _assert( keyword_frame->b_tag == sar_k_token_frame, "keyword frame missing from stack" ); /* ** make the target frame a token frame for a name token */ _sar_move_source_info( target_frame, keyword_frame ); target_frame->b_tag = sar_k_token_frame; target_frame->b_type = NAME; /* ** insert the keyword name into the symbol table */ name_entry = sym_insert_name ( keyword_frame->value.az_keyword_entry->b_length, keyword_frame->value.az_keyword_entry->at_name ); target_frame->value.az_symbol_entry = (sym_entry_type *) name_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function processes an id that is being used as an operand ** in a value. It can be either a value or an identifier. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant value stack frame ** id_frame pointer to token stack frame holding the id ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error may be issued for undefined name ** **-- **/ void sar_process_id( target_frame, id_frame ) yystype *target_frame; yystype *id_frame; { sym_name_entry_type *name_entry; sym_value_entry_type *value_entry; int enum_code = 0; _assert( id_frame->b_tag == sar_k_token_frame, "id frame missing from stack" ); /* ** make the target frame an expression frame */ _sar_move_source_info( target_frame, id_frame ); target_frame->b_tag = sar_k_value_frame; /* id frame may be a: ** font_name, color_name, reason_name, argument_name... ** name ** if the font_name, color_name, etc... has a name been defined by ** the user, we use that name, otherwise these special names are ** treated as private values. */ if (id_frame->b_type != NAME) { name_entry = sym_find_name ( id_frame->value.az_keyword_entry->b_length, id_frame->value.az_keyword_entry->at_name ); if (name_entry == NULL) { int source_type = 0; unsigned short int arg_code; unsigned short int rel_code; switch (id_frame->b_type) { case FONT_NAME: source_type = sym_k_font_value; break; case CHILD_NAME: source_type = sym_k_child_value; break; case ARGUMENT_NAME: source_type = sym_k_argument_value; /* ** Indicate that this argument is used so we can later ** generate appropriate compression code for it. ** If this argument has a related argument, also mark it as ** being used so we can later generate its comprssion code. */ arg_code = id_frame->value.az_keyword_entry->b_subclass; uil_arg_compr[arg_code] = 1; rel_code = related_argument_table[arg_code]; if (rel_code != 0) uil_arg_compr[rel_code] = 1; break; case COLOR_NAME: source_type = sym_k_color_value; break; case REASON_NAME: source_type = sym_k_reason_value; uil_reas_compr[id_frame->value.az_keyword_entry->b_subclass] = 1; break; case ENUMVAL_NAME: source_type = sym_k_integer_value; enum_code = id_frame->value.az_keyword_entry->b_subclass; break; default: _assert( FALSE, "unexpected token" ); } value_entry = sem_create_value_entry ( (char*)&(id_frame->value.az_keyword_entry), sizeof(long), source_type ); if ( id_frame->b_type == ENUMVAL_NAME ) { value_entry->b_enumeration_value_code = enum_code; _assert (( (enum_code > 0) && (enum_code <= uil_max_enumval) ), "Enumeration code out of range"); value_entry->value.l_integer = enumval_values_table[enum_code]; } target_frame->b_flags = value_entry->obj_header.b_flags; target_frame->b_type = value_entry->b_type; target_frame->value.az_symbol_entry = (sym_entry_type *) value_entry; return; } id_frame->value.az_symbol_entry = (sym_entry_type *) name_entry; } /* ** first check if the name entry points to a value. ** If the value_entry is NULL, this is a forward reference. */ name_entry = (sym_name_entry_type *) id_frame->value.az_symbol_entry; value_entry = (sym_value_entry_type *) name_entry->az_object; if (value_entry == NULL) { value_entry = sem_create_value_entry ("0", 0, sym_k_any_value); value_entry->obj_header.b_flags = sym_m_forward_ref; value_entry->obj_header.az_name = name_entry; target_frame->b_flags = value_entry->obj_header.b_flags; target_frame->b_type = value_entry->b_type; target_frame->value.az_symbol_entry = (sym_entry_type *) value_entry; return; } if (value_entry->header.b_tag != sym_k_value_entry && value_entry->header.b_tag != sym_k_widget_entry) { diag_issue_diagnostic ( d_ctx_req, _sar_source_position( id_frame ), diag_tag_text( sym_k_value_entry ), diag_tag_text( value_entry->header.b_tag ) ); goto error_path; } /* ** set up the target frame */ target_frame->b_flags = value_entry->obj_header.b_flags; target_frame->b_type = value_entry->b_type; target_frame->value.az_symbol_entry = (sym_entry_type *) value_entry; return; error_path: target_frame->b_flags = sym_m_private; target_frame->b_type = sym_k_error_value; target_frame->value.az_symbol_entry = (sym_entry_type *) sym_az_error_value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function checks an identifier and makes a name ** entry for it if it is not already a name. ** ** FORMAL PARAMETERS: ** ** id_frame pointer to token stack frame holding the identifier ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** a name entry may be generated ** **-- **/ void sar_process_id_ref ( id_frame ) yystype * id_frame; { _assert( id_frame->b_tag == sar_k_token_frame, "id frame missing from stack" ); switch (id_frame->b_type) { /* ** if already a name, then do nothing. */ case NAME: return; /* ** make the keyword into a name and insert it into the symbol table */ case FONT_NAME: case ARGUMENT_NAME: case COLOR_NAME: case REASON_NAME: case CHILD_NAME: id_frame->b_type = NAME; id_frame->value.az_symbol_entry = (sym_entry_type *) sym_insert_name ( id_frame->value.az_keyword_entry->b_length, id_frame->value.az_keyword_entry->at_name ); break; default: _assert( FALSE, "unexpected token" ); break; } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function takes a parse frame, extracts the string for the token ** out of it and converts the string into a units type. ** ** FORMAL PARAMETERS: ** ** parse_frame pointer to parse stack frame holding the value ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** ** **-- **/ int sar_get_units_type ( parse_frame ) yystype *parse_frame; { char *units_name; int units_type; XmParseResult result; units_name = parse_frame->value.az_keyword_entry->at_name; result = XmeParseUnits(units_name, &units_type); switch(result) { case XmPARSE_ERROR: /* I don't expect a parse error since the UIL compiler knows what the valid unit strings are. */ units_type = XmPIXELS; break; case XmPARSE_NO_UNITS: /* For now, just set the units to XmPIXELS when none specified. What we really need is to be able to specify that there were no units and therefore no conversion should be done. We can sort of do that by specifying XmPIXELS here. */ units_type = XmPIXELS; break; case XmPARSE_UNITS_OK: /* Everything is groovy */ break; } return(units_type); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function takes a token frame for a value and converts it ** into a value frame. ** ** FORMAL PARAMETERS: ** ** value_frame pointer to resultant value stack frame ** token_frame pointer to token stack frame holding the value ** value_type type of value being created ** keyword_frame frame to use as locator for the value ** arg_type type of argument value being created - for args only ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** ** **-- **/ void sar_make_private_value ( value_frame, token_frame, value_type, keyword_frame, arg_type ) yystype *value_frame; yystype *token_frame; int value_type; yystype *keyword_frame; int arg_type; { sym_value_entry_type *value_entry = NULL; /* ** This should be a long because the call to sem_create_value_entry passes the sizeof(long). This also ** maps on top of value.l_integer which is a long and is used in sar_chk_comp_str_attr. */ long boolean_value; /* Empty string tables and translation tables can have a null token frame. */ _assert( (token_frame->b_tag == sar_k_token_frame) || (token_frame->b_tag == sar_k_value_frame) || (token_frame->b_tag == sar_k_null_frame), "token or value frame missing from stack" ); /* ** The goal of the routine is to create a value entry in the ** symbol table for each constant and then place a pointer to ** that value entry in a value frame on the parse stack. ** Based on the type of constant, it may or may not already be ** in the symbol table. */ switch (value_type) { case sym_k_char_8_value: case sym_k_compound_string_value: case sym_k_integer_value: case sym_k_float_value: case sym_k_single_float_value: case sym_k_localized_string_value: value_entry = (sym_value_entry_type *) token_frame->value.az_symbol_entry; /* Save the arg_type. This value should be zero for all cases above, except when the integer or float has units specified. In that case, the arg_type is used to store the type of units specified. */ value_entry->b_arg_type = arg_type; value_entry->b_type = value_type; break; case sym_k_font_value: case sym_k_fontset_value: case sym_k_reason_value: case sym_k_argument_value: case sym_k_xbitmapfile_value: case sym_k_keysym_value: case sym_k_class_rec_name_value: /* ** transform the char 8 value entry into one for this ** special type. Before doing this, we need to insure ** that the char 8 value is not in error or non private. */ value_entry = (sym_value_entry_type *) token_frame->value.az_symbol_entry; if (token_frame->b_type == sym_k_error_value) { value_type = sym_k_error_value; } else { sym_value_entry_type *value_save; value_save = value_entry; if ((value_entry->obj_header.az_name != NULL) || (token_frame->b_type == sym_k_any_value)) { value_entry = sem_create_value_entry ("",0,sym_k_any_value); value_entry->b_expr_opr = sym_k_coerce_op; if ((token_frame -> b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (token_frame, (char*)&(value_entry->az_exp_op1), sym_k_patch_add); else value_entry->az_exp_op1 = value_save; } value_entry->b_type = value_type; value_entry->obj_header.b_flags = sym_m_private; /* save the arg type for arguments */ if (value_type == sym_k_argument_value) value_entry->b_arg_type = arg_type; } break; case sym_k_bool_value: boolean_value = 0; if ((token_frame->b_type == UILTRUE) || (token_frame->b_type == ON )) boolean_value = 1; value_entry = sem_create_value_entry ( (char*)&boolean_value, sizeof(long), sym_k_bool_value ); break; case sym_k_integer_table_value: case sym_k_asciz_table_value: case sym_k_trans_table_value: case sym_k_string_table_value: case sym_k_rgb_value: { int count; sym_value_entry_type * table_entry; /* Save the pointer to the table elements */ table_entry = (sym_value_entry_type *) token_frame->value.az_symbol_entry; value_entry = sem_create_value_entry (0, 0, value_type ); value_entry->az_first_table_value = table_entry; /* Get the count of elements in the table. Resets table_entry */ for (table_entry=value_entry->az_first_table_value, count = 0; table_entry != NULL; table_entry = table_entry->az_next_table_value, count++) { } value_entry->b_table_count = count; break; } default: _assert( FALSE, "unexpected value type" ); break; } /* ** make the target frame a value frame */ _sar_move_source_info( value_frame, keyword_frame ); value_frame->b_tag = sar_k_value_frame; value_frame->b_type = value_type; value_frame->b_flags = value_entry->obj_header.b_flags; value_frame->value.az_symbol_entry = (sym_entry_type *) value_entry; } void sar_make_rgb_private_value ( value_frame, token_frame, value_type, keyword_frame, arg_type ) yystype *value_frame; yystype *token_frame; int value_type; yystype *keyword_frame; int arg_type; { /* placeholder RAP for RGB data type */ } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function takes a value frame which is the contents ** of a table of strings and appends it to a value entry which is ** the next entry in that table. It is used by string_table, icon, ** and translation_table value types. ** ** FORMAL PARAMETERS: ** ** value_frame pointer to current table entry stack frame ** table_frame pointer to stack frame holding the table ** table_type dictates the type of table being generated ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** ** **-- **/ void sar_append_table_value( value_frame, table_frame, table_type, comma_frame ) yystype *value_frame; yystype *table_frame; int table_type; yystype *comma_frame; { sym_value_entry_type *value_entry, *table_entry; int value_type; _assert( (value_frame->b_tag == sar_k_value_frame), "value frame missing from stack" ); value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; value_type = value_entry->b_type; if (value_type == sym_k_error_value) return; table_entry = (sym_value_entry_type *) table_frame->value.az_symbol_entry; /* ** Some entries require checking for a forward reference. If the ** table entry is named, than a valref entry linked to it is placed ** in the table. If the new entry is a forward reference, than a ** valref is always required, but we can use the value node which ** is supplied as it is a parser artifact, and has no other use. */ switch (table_type) { case sym_k_icon_value: if ((value_frame->b_flags & sym_m_forward_ref) != 0) { diag_issue_diagnostic (d_undefined, _sar_source_position(value_frame), "icon row", value_entry->obj_header.az_name->c_text); } if (value_entry->obj_header.az_name != NULL) { sym_value_entry_type *value_save; value_save = value_entry; value_entry = sem_create_value_entry (0, 0, value_type); value_entry->b_type = value_type; value_entry->obj_header.b_flags = sym_m_private; value_entry->b_expr_opr = sym_k_valref_op; value_entry->az_exp_op1 = value_save; } break; case sym_k_trans_table_value: case sym_k_asciz_table_value: case sym_k_integer_table_value: case sym_k_rgb_value: if (value_entry->obj_header.az_name != NULL) { sym_value_entry_type *value_save; if ( (value_frame->b_flags & sym_m_forward_ref) != 0) { value_entry->obj_header.b_flags = sym_m_private; value_entry->b_expr_opr = sym_k_valref_op; sym_make_value_forward_ref (value_frame, (char*)&(value_entry->az_exp_op1), sym_k_patch_add); } else { value_save = value_entry; value_entry = sem_create_value_entry (0, 0, value_type); value_entry->b_type = value_type; value_entry->obj_header.b_flags = sym_m_private; value_entry->b_expr_opr = sym_k_valref_op; value_entry->az_exp_op1 = value_save; } } break; case sym_k_string_table_value: /* ** value needs to be a compound string, so a coerce operator is ** inserted as required. We don't need both a coerce and a ** valref entry; if coerce is applied to a name, it also ** functions as the valref. */ if (value_entry->obj_header.az_name != NULL) { sym_value_entry_type *value_save; if ( (value_frame->b_flags & sym_m_forward_ref) != 0) { value_entry->obj_header.b_flags = sym_m_private; value_entry->b_type = sym_k_compound_string_value; value_entry->b_expr_opr = sym_k_coerce_op; sym_make_value_forward_ref (value_frame, (char*)&(value_entry->az_exp_op1), sym_k_patch_add); } else { value_save = value_entry; value_entry = sem_create_value_entry (0, 0, value_type); value_entry->obj_header.b_flags = sym_m_private; value_entry->b_type = sym_k_compound_string_value; value_entry->az_exp_op1 = value_save; if ( value_type == sym_k_compound_string_value ) value_entry->b_expr_opr = sym_k_valref_op; else value_entry->b_expr_opr = sym_k_coerce_op; } } break; default: _assert ( FALSE, "unknown table type found"); } /* ** Prepend the value to the table. The table elements will be ** in reverse order. */ value_entry->b_aux_flags |= sym_m_table_entry; value_entry->az_next_table_value = table_entry; /* ** Save source information */ _sar_save_source_info ( &value_entry->header, comma_frame, value_frame); value_entry->header.b_type = value_frame->b_source_pos; /* ** make the target frame a value frame */ value_frame->b_tag = sar_k_value_frame; value_frame->b_type = value_type; value_frame->b_flags = value_entry->obj_header.b_flags; value_frame->value.az_symbol_entry = (sym_entry_type *) value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function issues an error message saying that a feature is ** not implemented yet. ** ** FORMAL PARAMETERS: ** ** value_frame pointer to resultant value stack frame ** token_frame pointer to source token frame (error position info) ** error_text pointer to text to be substituted in message ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error message is issued ** **-- **/ void sar_value_not_implemented( value_frame, token_frame, error_text ) yystype *value_frame; yystype *token_frame; char *error_text; { /* ** make the target frame an error value frame */ _sar_move_source_info( value_frame, token_frame ); value_frame->b_tag = sar_k_value_frame; value_frame->b_type = sym_k_error_value; value_frame->b_flags = sym_m_private; value_frame->value.az_symbol_entry = (sym_entry_type *) sym_az_error_value_entry; diag_issue_diagnostic ( d_not_impl, _sar_source_position( value_frame ), error_text ); } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function processes the concatenation of 2 strings. ** ** FORMAL PARAMETERS: ** ** operator_frame [in/out] pointer to resultant value stack frame ** op1_frame [in] pointer to operand 1 value frame ** op2_frame [in] pointer to operand 2 value frame ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error message is issued if value is out of range ** **-- **/ void sar_cat_value( operator_frame, op1_frame, op2_frame ) yystype *operator_frame; yystype *op1_frame; yystype *op2_frame; { /* ** For pcc conversion, use defines instead of this enum. ** ** enum op_state ** { ** error=0, simple, compound, localized ** }; */ #define k_op_state_error 0 #define k_op_state_simple 1 #define k_op_state_compound 2 #define k_op_state_localized 4 int target_type; sym_value_entry_type *value1_entry; sym_value_entry_type *value2_entry; sym_value_entry_type *target_entry; unsigned int op1_state; unsigned int op2_state; _assert( (op1_frame->b_tag == sar_k_value_frame) && (op2_frame->b_tag == sar_k_value_frame), "value frame missing" ); /* ** The target type is dependent on the type of the sources. If both ** operands are primitive and have the same writing direction and ** charset, the result is still of that type. If not, the result ** is a compound string. */ switch (op1_frame->b_type) { case sym_k_char_8_value: op1_state = k_op_state_simple; break; case sym_k_compound_string_value: op1_state = k_op_state_compound; break; case sym_k_localized_string_value: op1_state = k_op_state_localized; break; case sym_k_error_value: op1_state = k_op_state_error; break; default: diag_issue_diagnostic (d_wrong_type, _sar_source_position( op1_frame ), diag_value_text( op1_frame->b_type), "string or compound string"); op1_state = k_op_state_error; } switch (op2_frame->b_type) { case sym_k_char_8_value: op2_state = k_op_state_simple; break; case sym_k_compound_string_value: op2_state = k_op_state_compound; break; case sym_k_localized_string_value: op2_state = k_op_state_localized; break; case sym_k_error_value: op2_state = k_op_state_error; break; default: diag_issue_diagnostic (d_wrong_type, _sar_source_position( op2_frame ), diag_value_text( op2_frame->b_type), "string or compound string"); op2_state = k_op_state_error; } value1_entry = (sym_value_entry_type *) op1_frame->value.az_symbol_entry; value2_entry = (sym_value_entry_type *) op2_frame->value.az_symbol_entry; /* ** Verify that both operands are private values */ if ((op1_frame->b_flags & sym_m_private) == 0) { op1_state = k_op_state_error; diag_issue_diagnostic (d_nonpvt, _sar_source_position (op1_frame), value1_entry->obj_header.az_name->c_text ); } if ((op2_frame->b_flags & sym_m_private) == 0) { op2_state = k_op_state_error; diag_issue_diagnostic (d_nonpvt, _sar_source_position (op2_frame), value2_entry->obj_header.az_name->c_text ); } switch (op1_state + (op2_state<<2)) { /* ** This is the case of appending to simple strings. Just append them ** unless they have different directions or the first one has the separate ** attribute. */ case k_op_state_simple + (k_op_state_simple<<2): if ((value1_entry->b_charset == value2_entry->b_charset) && ((value1_entry->b_direction) == (value2_entry->b_direction)) && ((value1_entry->b_aux_flags & sym_m_separate) == 0)) { target_entry = (sym_value_entry_type *) sem_cat_str_to_str (value1_entry, (value1_entry->obj_header.az_name==NULL), value2_entry, (value2_entry->obj_header.az_name==NULL)); target_type = sym_k_char_8_value; } else { target_entry = (sym_value_entry_type *) sem_create_cstr( ); sem_append_str_to_cstr (target_entry, value1_entry, (value1_entry->obj_header.az_name==NULL)); sem_append_str_to_cstr (target_entry, value2_entry, (value2_entry->obj_header.az_name==NULL)); target_type = sym_k_compound_string_value; } break; /* ** This is the case of one simple and one compound string. Change the ** simple to a compound and append them together. Depend on the append ** routine to do the right thing. */ case k_op_state_simple + (k_op_state_compound<<2): target_entry = (sym_value_entry_type *) sem_create_cstr( ); sem_append_str_to_cstr (target_entry, value1_entry, (value1_entry->obj_header.az_name==NULL)); sem_append_cstr_to_cstr (target_entry, value2_entry, (value2_entry->obj_header.az_name==NULL)); target_type = sym_k_compound_string_value; break; /* ** This is the case of one simple and one compound string. Append the ** simple to the compound. Depend on the append routine to do the right ** thing. */ case k_op_state_compound + (k_op_state_simple<<2): target_entry = (sym_value_entry_type *) sem_create_cstr( ); sem_append_cstr_to_cstr (target_entry, value1_entry, (value1_entry->obj_header.az_name==NULL)); sem_append_str_to_cstr (target_entry, value2_entry, (value2_entry->obj_header.az_name==NULL)); target_type = sym_k_compound_string_value; break; /* ** This is the case of two compound strings. Just let the append routine ** do the right thing. */ case k_op_state_compound + (k_op_state_compound<<2): target_entry = (sym_value_entry_type *) sem_create_cstr( ); sem_append_cstr_to_cstr (target_entry, value1_entry, (value1_entry->obj_header.az_name==NULL)); sem_append_cstr_to_cstr (target_entry, value2_entry, (value2_entry->obj_header.az_name==NULL)); target_type = sym_k_compound_string_value; break; default: /* some form of error */ target_type = sym_k_error_value; target_entry = (sym_value_entry_type *) sym_az_error_value_entry; break; } /* ** initialize the target frame */ _sar_save_source_pos ( &target_entry->header, op2_frame); /* target_entry->az_source_rec = op2_frame->az_source_record; */ operator_frame->b_tag = sar_k_value_frame; operator_frame->b_type = target_type; operator_frame->b_flags = sym_m_private; operator_frame->value.az_symbol_entry = (sym_entry_type *) target_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function checks the attributes of COMPOUND_STRING function. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant token stack frame ** value_frame pointer to frame holding keyword and value ** prior_value_frame pointer to previous properties ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** attribute information is stuffed in target frame ** **-- **/ void sar_chk_comp_str_attr( target_frame, value_frame, prior_value_frame ) yystype *target_frame; yystype *value_frame; yystype *prior_value_frame; { sym_value_entry_type *value_entry; /* ** Set up not specified values in the target frame. ** b_type will hold the writing direction and separate propertied ** az_symbol_entry will hold the pointer to the character set. */ switch (prior_value_frame->b_tag) { case sar_k_null_frame: /* ** no prior values */ target_frame->b_tag = sar_k_token_frame; target_frame->b_direction = NOSTRING_DIRECTION; /* Fix for CN 16149 (DTS 10023) part 3 -- flag b_charset as non-existent */ target_frame->b_charset = sym_k_error_charset; target_frame->b_type = 0; target_frame->value.az_symbol_entry = NULL; break; case sar_k_token_frame: case sar_k_value_frame: /* ** prior values - transfer them */ target_frame->b_tag = sar_k_token_frame; target_frame->b_direction = prior_value_frame->b_direction; target_frame->b_charset = prior_value_frame->b_charset; target_frame->b_type = prior_value_frame->b_type; target_frame->value.az_symbol_entry = target_frame->value.az_symbol_entry; break; default: _assert( FALSE, "prior value frame missing from stack" ); } /* ** Case on the keyword for the attribute given */ value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; if ((value_entry != NULL) && (value_frame->b_type != CHARACTER_SET) && (value_entry->obj_header.b_flags & sym_m_forward_ref) != 0) { diag_issue_diagnostic (d_undefined, _sar_source_position(value_frame), "compound string attribute", value_entry->obj_header.az_name->c_text); } switch (value_frame->b_type) { case RIGHT_TO_LEFT: { /* ** If the value is a boolean, then set the b_direction field. */ if (value_entry->b_type == sym_k_bool_value) { if (value_entry->value.l_integer == TRUE) target_frame->b_direction = XmSTRING_DIRECTION_R_TO_L; else target_frame->b_direction = XmSTRING_DIRECTION_L_TO_R; } break; } case SEPARATE: { /* ** If the value is a boolean, then just set the corresponding mask ** accordingly. */ if (value_entry->b_type == sym_k_bool_value) { if (value_entry->value.l_integer == TRUE) target_frame->b_type |= sym_m_separate; else target_frame->b_type &= ~sym_m_separate; } break; } case CHARACTER_SET: { /* ** There are two different kinds of character sets. One is a ** token frame, the other is a value frame which points to a ** char8 string value in the symbol table that represents the charset. */ switch (value_frame->b_tag) { /* ** For token frames, acquire the charset from the keytable entry ** and set frame type so sar_make_comp_str knows how to interpret ** the frame. */ case sar_k_token_frame: { key_keytable_entry_type *keyword_entry; keyword_entry = (key_keytable_entry_type *) value_frame->value.az_keyword_entry; target_frame->b_tag = sar_k_token_frame; target_frame->b_charset = sem_map_subclass_to_charset( keyword_entry->b_subclass ); break; } /* ** For value frames, save the value pointer and mark the ** frame again for correct use by sar_make_comp_str. */ case sar_k_value_frame: target_frame->b_tag = sar_k_value_frame; target_frame->value.az_symbol_entry = value_frame->value.az_symbol_entry; break; } break; } default: _assert( FALSE, "keyword missing from stack" ); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function makes a COMPOUND_STRING and sets the properties ** of the string. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant token stack frame ** value_frame pointer to string value ** attr_frame pointer to strings attributes ** keyword_frame frame to use as locator for result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_make_comp_str ( target_frame, value_frame, attr_frame, keyword_frame ) yystype *target_frame; yystype *value_frame; yystype *attr_frame; yystype *keyword_frame; { sym_value_entry_type *value_entry; sym_value_entry_type *cstr_entry; _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing from stack" ); /* ** Make a compound string operation. The compound string will be created ** during expression evaluation in UilSemVal.c. */ cstr_entry = (sym_value_entry_type *) sem_create_cstr(); cstr_entry->b_expr_opr = sym_k_comp_str_op; if ((value_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (value_frame, (char*)&(cstr_entry->az_exp_op1), sym_k_patch_add); else { value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; cstr_entry->az_exp_op1 = value_entry; } /* ** If the attr_frame is not null, it must be a value frame with contains ** a pointer to the value entry for the userdefined charset, or a token frame ** which contains the charset token subclass. */ switch (attr_frame->b_tag) { case sar_k_value_frame: /* ** Set the attributes of the string, as specified by the options ** to the COMPOUND_STRING function, without disturbing any ** existing bits. */ cstr_entry->b_direction = attr_frame->b_direction; cstr_entry->b_aux_flags |= (attr_frame->b_type & sym_m_separate); /* ** If the symbol_entry pointer is not null then a charset was ** specified for this CS, just copy the b_charset and ** az_charset_value pointers into the value entry for this CS. */ if ((attr_frame->value.az_symbol_entry) != 0) { sym_value_entry_type * az_value_entry; az_value_entry = (sym_value_entry_type *) attr_frame->value.az_symbol_entry; cstr_entry->b_charset = az_value_entry->b_charset; cstr_entry->b_direction = az_value_entry->b_direction; cstr_entry->az_charset_value = az_value_entry; } break; case sar_k_token_frame: if ((attr_frame->b_charset) != 0) cstr_entry->b_charset = sem_map_subclass_to_charset (attr_frame->b_charset); cstr_entry->b_direction = attr_frame->b_direction; cstr_entry->b_aux_flags |= (attr_frame->b_type & sym_m_separate); break; } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); _sar_save_source_pos ( &cstr_entry->header, value_frame ); /* cstr_entry->az_source_rec = value_frame->az_source_record; */ target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_compound_string_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) cstr_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function makes a COMPOUND_STRING_COMPONENT and sets the properties ** of the string. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant token stack frame ** type_frame pointer to type value ** value_frame pointer to component value ** keyword_frame frame to use as locator for result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_make_comp_str_comp ( target_frame, type_frame, value_frame, keyword_frame ) yystype *target_frame; yystype *type_frame; yystype *value_frame; yystype *keyword_frame; { key_keytable_entry_type *type_entry; key_keytable_entry_type *value_entry; sym_value_entry_type *cstr_entry; unsigned short int enumval_code; unsigned short int enumset_code; unsigned short int type; char *cset_name; int i; Boolean found; String str; XmStringDirection dir; XmDirection lay_dir; XmString cstr_r = NULL; _assert(type_frame->b_tag == sar_k_token_frame, "value frame missing from stack" ); /* ** Make a compound string component. */ cstr_entry = (sym_value_entry_type *) sem_create_cstr(); /* Evaluate type. */ type_entry = (key_keytable_entry_type *)type_frame->value.az_keyword_entry; enumval_code = type_entry->b_subclass; enumset_code = argument_enumset_table[sym_k_XmStringComponent_arg]; found = FALSE; for (i = 0; i < enum_set_table[enumset_code].values_cnt; i++) if (enum_set_table[enumset_code].values[i] == enumval_code) { found = TRUE; break; } if (found) type = enumval_values_table[enumval_code]; else { diag_issue_diagnostic(d_arg_type, _sar_source_position(type_frame), uil_enumval_names[enumval_code], "compound_string_component", "XmStringComponentType"); type = XmSTRING_COMPONENT_UNKNOWN; } switch (type) { case XmSTRING_COMPONENT_UNKNOWN: case XmSTRING_COMPONENT_SEPARATOR: case XmSTRING_COMPONENT_LAYOUT_POP: case XmSTRING_COMPONENT_TAB: /* If value_frame is not null, issue diagnostic. */ if (value_frame->b_tag != sar_k_null_frame) diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), "non-NULL", "compound_string_component", "NULL"); cstr_r = XmStringComponentCreate(type, 0, NULL); break; case XmSTRING_COMPONENT_LOCALE: if ((value_frame->b_tag != sar_k_null_frame) && (value_frame->b_type != CHARSET_NAME)) diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), "non-NULL", "compound_string_component", "NULL or _MOTIF_DEFAULT_LOCALE"); else if (value_frame->b_type == CHARSET_NAME) { cset_name = sem_charset_name((value_frame->value.az_keyword_entry)->b_subclass, (sym_value_entry_type *) (value_frame->value.az_keyword_entry)); if (strcmp(cset_name, "_MOTIF_DEFAULT_LOCALE") != 0) diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), cset_name, "compound_string_component", "_MOTIF_DEFAULT_LOCALE"); } cstr_r = XmStringComponentCreate(type, strlen(_MOTIF_DEFAULT_LOCALE), _MOTIF_DEFAULT_LOCALE); break; case XmSTRING_COMPONENT_CHARSET: case XmSTRING_COMPONENT_TEXT: case XmSTRING_COMPONENT_LOCALE_TEXT: case XmSTRING_COMPONENT_WIDECHAR_TEXT: case XmSTRING_COMPONENT_RENDITION_BEGIN: case XmSTRING_COMPONENT_RENDITION_END: str = ""; if (value_frame->b_tag == sar_k_null_frame) diag_issue_diagnostic(d_arg_type, type_frame->az_source_record, type_frame->b_source_end, "NULL", "compound_string_component", diag_value_text(sym_k_char_8_value)); else if ((value_frame->b_type != CHAR_8_LITERAL) && (value_frame->b_type != LOC_STRING) && ((value_frame->b_type != CHARSET_NAME) || (type != XmSTRING_COMPONENT_CHARSET))) diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), tok_token_name_table[value_frame->b_type], "compound_string_component", diag_value_text(sym_k_char_8_value)); else { if (value_frame->b_type == CHARSET_NAME) { cset_name = sem_charset_name((value_frame->value.az_keyword_entry)->b_subclass, (sym_value_entry_type *) (value_frame->value.az_keyword_entry)); if (strcmp(cset_name, "XmFONTLIST_DEFAULT_TAG") == 0) str = XmFONTLIST_DEFAULT_TAG; else str = cset_name; } else /* Extract string */ str = ((sym_value_entry_type *) (value_frame->value.az_symbol_entry))->value.c_value; } cstr_r = XmStringComponentCreate(type, strlen(str), (XtPointer)str); break; case XmSTRING_COMPONENT_DIRECTION: if (value_frame->b_tag == sar_k_null_frame) diag_issue_diagnostic(d_arg_type, type_frame->az_source_record, type_frame->b_source_end, "NULL", "compound_string_component", "XmStringDirection"); else if (value_frame->b_type != ENUMVAL_NAME) diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), diag_value_text(value_frame->b_type), "compound_string_component", "XmStringDirection"); else { /* Extract and validate enumval */ value_entry = (key_keytable_entry_type *)value_frame->value.az_keyword_entry; enumval_code = value_entry->b_subclass; enumset_code = argument_enumset_table[sym_k_XmNstringDirection_arg]; found = FALSE; for (i = 0; i < enum_set_table[enumset_code].values_cnt; i++) if (enum_set_table[enumset_code].values[i] == enumval_code) { found = TRUE; break; } if (found) dir = enumval_values_table[enumval_code]; else { diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), uil_enumval_names[enumval_code], "compound_string_component", "XmStringDirection"); dir = XmSTRING_DIRECTION_L_TO_R; } } cstr_r = XmStringComponentCreate(type, sizeof(XmStringDirection), &dir); break; case XmSTRING_COMPONENT_LAYOUT_PUSH: if (value_frame->b_tag == sar_k_null_frame) diag_issue_diagnostic(d_arg_type, type_frame->az_source_record, type_frame->b_source_end, "NULL", "compound_string_component", "XmDirection"); else if (value_frame->b_type != ENUMVAL_NAME) diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), diag_value_text(value_frame->b_type), "compound_string_component", "XmDirection"); else { /* Extract and validate enumval */ value_entry = (key_keytable_entry_type *)value_frame->value.az_keyword_entry; enumval_code = value_entry->b_subclass; enumset_code = argument_enumset_table[sym_k_XmNlayoutDirection_arg]; found = FALSE; for (i = 0; i < enum_set_table[enumset_code].values_cnt; i++) if (enum_set_table[enumset_code].values[i] == enumval_code) { found = TRUE; break; } if (found) lay_dir = enumval_values_table[enumval_code]; else { diag_issue_diagnostic(d_arg_type, _sar_source_position(value_frame), uil_enumval_names[enumval_code], "compound_string_component", "XmDirection"); lay_dir = XmLEFT_TO_RIGHT; } } cstr_r = XmStringComponentCreate(type, sizeof(XmDirection), &lay_dir); break; } cstr_entry->value.xms_value = cstr_r; cstr_entry->w_length = XmStringLength(cstr_r); cstr_entry->az_first_table_value = NULL; _assert(cstr_entry->w_length <= MrmMaxResourceSize, "compound string too long" ); /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); _sar_save_source_pos ( &cstr_entry->header, type_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_compound_string_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *)cstr_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function makes a WIDE_CHARACTER and sets the properties ** of the string. ** ** FORMAL PARAMETERS: ** ** target_frame pointer to resultant token stack frame ** value_frame pointer to string value ** attr_frame pointer to strings attributes ** keyword_frame frame to use as locator for result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_make_wchar_str ( target_frame, value_frame, attr_frame, keyword_frame ) yystype *target_frame; yystype *value_frame; yystype *attr_frame; yystype *keyword_frame; { sym_value_entry_type *value_entry; sym_value_entry_type *wchar_str_entry; _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing from stack" ); /* ** Make a wide_character string operation. The wide_character string will ** be created during retrieval from the UID file. */ wchar_str_entry = (sym_value_entry_type *) sem_create_wchar_str(); wchar_str_entry->b_expr_opr = sym_k_wchar_str_op; if ((value_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (value_frame, (char*)&(wchar_str_entry->az_exp_op1), sym_k_patch_add); else { value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; value_entry->b_type = value_frame->b_type; wchar_str_entry->az_exp_op1 = value_entry; } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); _sar_save_source_pos ( &wchar_str_entry->header, value_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_wchar_string_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *)wchar_str_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function issues an error message saying that the value is ** the wrong type for this context. ** ** FORMAL PARAMETERS: ** ** value_frame pointer to resultant value stack frame ** expected_type type of constant required by this context ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error message is issued ** **-- **/ void sar_value_type_error( value_frame, expected_type ) yystype *value_frame; int expected_type; { _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" ); /* ** make the target frame an error value frame */ if (value_frame->b_type != sym_k_error_value) diag_issue_diagnostic ( d_wrong_type, _sar_source_position( value_frame ), diag_value_text( value_frame->b_type ), diag_value_text( expected_type ) ); value_frame->b_type = sym_k_error_value; value_frame->b_flags = sym_m_private; value_frame->value.az_symbol_entry = (sym_entry_type *) sym_az_error_value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function issues an error message saying that the value ** must be private. Expect for arguments and argument values, ** values used by UIL need to be private rather than public. ** To make them public would mean that URM would need to perform ** the function at runtime. ** ** FORMAL PARAMETERS: ** ** value_frame pointer to resultant value stack frame ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** error message is issued ** **-- **/ void sar_private_error( value_frame ) yystype *value_frame; { _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" ); /* ** make the target frame an error value frame */ if (value_frame->b_type != sym_k_error_value) { sym_value_entry_type *value_entry; value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; diag_issue_diagnostic ( d_nonpvt, _sar_source_position( value_frame ), value_entry->obj_header.az_name->c_text ); } value_frame->b_type = sym_k_error_value; value_frame->b_flags = sym_m_private; value_frame->value.az_symbol_entry = (sym_entry_type *) sym_az_error_value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates a value entry for an imported value. ** ** FORMAL PARAMETERS: ** ** target_frame ptr to target value frame on parse stack ** token_frame ptr to token frame giving the data type ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_import_value_entry(target_frame, token_frame) yystype *target_frame; yystype *token_frame; { sym_value_entry_type *value_entry; _assert( token_frame->b_tag == sar_k_token_frame, "token frame missing" ); /* ** Need to create a value entry and mark it as imported. ** The b_type field of the token has been set to the type of value ** by a prior grammar reduction */ value_entry = (sym_value_entry_type *) sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size); _sar_save_source_pos ( &value_entry->header, &yylval ); /* value_entry->az_source_rec = yylval.az_source_record; */ value_entry->b_type = token_frame->b_type; value_entry->obj_header.b_flags = sym_m_imported; /* ** set up the target frame */ target_frame->b_tag = sar_k_value_frame; target_frame->b_flags = sym_m_imported; target_frame->b_type = value_entry->b_type; target_frame->value.az_symbol_entry = (sym_entry_type *) value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function binds the name of a value with its value. ** ** FORMAL PARAMETERS: ** ** id_frame ptr to token frame holding the name for the value ** value_frame ptr to value frame ** ** IMPLICIT INPUTS: ** ** sym_az_current_section_entry global pointer to the "current" section list ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** errors if name has previously been used to declare another object ** may be a new value entry ** **-- **/ void sar_bind_value_name(id_frame, value_frame, semi_frame) yystype *id_frame; yystype *value_frame; yystype *semi_frame; { sym_name_entry_type *name_entry; sym_value_entry_type *value_entry; sym_section_entry_type *section_entry; int flags; boolean error; _assert( id_frame->b_tag == sar_k_token_frame, "id frame missing" ); _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" ); /* ** First we check on the name to see if it has been previously used. ** This function returns NULL if name cannot be used, in which case ** processing is over. */ name_entry = sem_dcl_name( id_frame ); if (name_entry == NULL) return; /* ** Processing is now based on where the value is private, imported, or ** exported. */ value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; flags = value_frame->b_flags; error = (value_frame->b_type == sym_k_error_value); if ((flags & sym_m_imported) == 0) { if ((value_entry->obj_header.az_name != NULL) || error) { /* ** Create a new value node for the unary value reference operator. ** az_exp_op1 will point to the node being referenced. */ sym_value_entry_type *saved_value_entry_ptr; saved_value_entry_ptr = value_entry; value_entry = sem_create_value_entry ("",0,sym_k_any_value); value_entry->b_expr_opr = sym_k_valref_op; /* ** If the value is a forward reference, we'll patch in the ** address of the the referenced value between passes. Otherwise, ** just point to the referenced value node. */ if ((value_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (value_frame, (char*)&(value_entry->az_exp_op1), sym_k_patch_add); else value_entry->az_exp_op1 = saved_value_entry_ptr; } if ((flags & sym_m_exported) != 0) sym_make_external_def( name_entry ); } /* ** Place the name and flags in the value entry. */ value_entry->obj_header.az_name = name_entry; value_entry->obj_header.b_flags = (value_entry->obj_header.b_flags & clear_class_mask) | flags; name_entry->az_object = (sym_entry_type *) value_entry; /* ** save the source file info for this value entry */ _sar_save_source_info (&value_entry->header, id_frame, semi_frame ); /* ** allocate a section entry to link the value entry into the structure */ section_entry = (sym_section_entry_type *) sem_allocate_node (sym_k_section_entry, sym_k_section_entry_size); /* ** Link this entry off of the current section list */ section_entry->next = (sym_entry_type *) sym_az_current_section_entry->entries; sym_az_current_section_entry->entries = (sym_entry_type *) section_entry; section_entry->entries = (sym_entry_type *)value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function checks to see if a name is available for naming a ** construct. ** ** FORMAL PARAMETERS: ** ** id_frame ptr to a token frame on the parse stack holding the name ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** ptr to name entry or NULL ** ** SIDE EFFECTS: ** ** name entry may be created ** error message for duplicate declaration may be issued ** **-- **/ sym_name_entry_type *sem_dcl_name(id_frame) XmConst yystype *id_frame; { sym_name_entry_type *name_entry; char * ptr; _assert( id_frame->b_tag == sar_k_token_frame, "arg1 not id frame" ); /* ** The id frame may hold a name or the keyword for a font name, color ** name, reason name etc. If it is one of these special name, then ** we insert the special name in the symbol table as a name. This has ** the effect of creating a name entry if one doesn't existing or finding ** the name entry if one does. */ if (id_frame->b_type != NAME) { diag_issue_diagnostic ( d_override_builtin, _sar_source_position( id_frame ), id_frame->value.az_keyword_entry->at_name); name_entry = sym_insert_name ( id_frame->value.az_keyword_entry->b_length, id_frame->value.az_keyword_entry->at_name ); } else name_entry = (sym_name_entry_type *) id_frame->value.az_symbol_entry; /* ** If the name entry already has an object linked from it, we have an ** duplicate definition of the same name. Otherwise, everything is fine. */ if (name_entry->az_object == NULL ) return name_entry; if (name_entry->az_object->header.b_tag == sym_k_value_entry) { ptr = diag_value_text ( ((sym_value_entry_type *) (name_entry->az_object))->b_type); } else if (name_entry->az_object->header.b_tag == sym_k_widget_entry) { ptr = diag_object_text ( ((sym_widget_entry_type *) (name_entry->az_object)) -> header.b_type); } else { ptr = diag_tag_text( name_entry->az_object->header.b_tag ); } diag_issue_diagnostic ( d_previous_def, _sar_source_position( id_frame ), name_entry->c_text, ptr ); return NULL; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates a value entry for a token that represents ** a value. ** ** FORMAL PARAMETERS: ** ** value pointer to value ** length length of the value in bytes ** value_type type of value to create ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** a value_entry ** ** SIDE EFFECTS: ** ** value entry is created in the symbol table ** **-- **/ sym_value_entry_type *sem_create_value_entry( value, length, value_type ) char *value; int length; int value_type; { sym_value_entry_type *value_entry; /* ** the value can be a string, integer, float, boolean, or ** a font_name, argument_name, color_name, or reason_name */ /* ** the strategy of the function is to determine the contents ** of the value entry, then centrally allocate and initialize it. ** ** Allocate the entry and save the source position. Initialize ** all fields to either default values or call parameters. */ value_entry = (sym_value_entry_type *) sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size); _sar_save_source_pos ( &value_entry->header, &yylval ); sar_assoc_comment ((sym_obj_entry_type *)value_entry); /* preserve comments */ value_entry->b_type = value_type; value_entry->obj_header.b_flags = (sym_m_private | sym_m_builtin); value_entry->w_length = length; value_entry->output_state = 0; value_entry->b_table_count = 0; value_entry->b_aux_flags = 0; value_entry->b_arg_type = 0; value_entry->b_data_offset = 0; value_entry->b_pixel_type = sym_k_unspecified_color; value_entry->b_charset = 0; value_entry->b_direction = NOSTRING_DIRECTION; value_entry->b_max_index = 0; value_entry->b_expr_opr = sym_k_unspecified_op; value_entry->b_enumeration_value_code = 0; value_entry->resource_id = 0; value_entry->obj_header.az_name = NULL; value_entry->az_charset_value = NULL; value_entry->az_next_table_value = NULL; value_entry->value.l_integer = 0; if ((value_type == sym_k_char_8_value || value_type == sym_k_font_value || value_type == sym_k_fontset_value || value_type == sym_k_keysym_value || value_type == sym_k_xbitmapfile_value || value_type == sym_k_class_rec_name_value || value_type == sym_k_identifier_value) && (length > 0)) { value_entry->value.c_value = (char *) XtCalloc(1,length); _move( value_entry->value.c_value, value, length ); } else if (value_type == sym_k_compound_string_value && (length > 0)) { value_entry->value.xms_value = (XmString) XtCalloc(1,length); _move( value_entry->value.xms_value, value, length ); } else if ( length > 0 ) _move( &(value_entry->value.c_value), value, length ); /* For enumerations which accept boolean values */ if (value_type == sym_k_bool_value) value_entry->b_enumeration_value_code = (*value) ? sym_k_TRUE_enumval : sym_k_FALSE_enumval; return value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function creates the value symbol node for an ** identifier declaration. ** ** FORMAL PARAMETERS: ** ** id_frame ptr to token frame for the identifier name ** ** IMPLICIT INPUTS: ** ** sym_az_current_section_entry global that points to the "current" section list ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** errors may be issued for previously defined name ** **-- **/ void sar_create_identifier (id_frame, semi_frame) XmConst yystype *id_frame; XmConst yystype *semi_frame; { sym_name_entry_type *name_entry; sym_value_entry_type *value_entry; sym_section_entry_type *section_entry; int len; char * ptr; /* ** Call standard routine to check name entry for id_frame. ** This routine handles font name, color names, etc used as ids */ name_entry = sem_dcl_name( id_frame ); if (name_entry == NULL) return; /* ** Allocate the value entry and fill it in. The b_type field ** in name entries holds the length of the name. Add one for null. */ len = name_entry->header.b_type + 1; ptr = name_entry->c_text; value_entry = sem_create_value_entry ( ptr, len, sym_k_identifier_value ); _move (value_entry->value.c_value, ptr, len); value_entry->obj_header.b_flags |= sym_m_private; value_entry->obj_header.az_name = name_entry; name_entry->az_object = (sym_entry_type *) value_entry; /* ** save the source file info for this identifier entry */ _sar_save_source_info (&name_entry->header, id_frame, semi_frame ); /* ** allocate a section entry to link the identifier entry into the structure */ section_entry = (sym_section_entry_type *) sem_allocate_node (sym_k_section_entry, sym_k_section_entry_size); /* ** Link this entry off of the current section list */ section_entry->next = (sym_entry_type *) sym_az_current_section_entry->entries; sym_az_current_section_entry->entries = (sym_entry_type *) section_entry; section_entry->entries = (sym_entry_type *)name_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a font table. This font table ** is a list of symbol table entries of font items. ** ** FORMAL PARAMETERS: ** ** target_frame frame holding the font table generated ** font_frame value frame specifying the font value ** prior_target_frame frame holding the font table generated so far ** keyword_frame frame holding the font_table keyword ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** font table symbol entry is generated if prior target is null ** **-- **/ void sar_make_font_table (target_frame, font_frame, prior_target_frame, keyword_frame) yystype *target_frame; yystype *font_frame; yystype *prior_target_frame; yystype *keyword_frame; { sym_value_entry_type *font_table_entry = NULL; sym_value_entry_type *font_item; _assert( font_frame->b_tag == sar_k_value_frame, "font item missing" ); font_item = (sym_value_entry_type *) font_frame->value.az_symbol_entry; /* ** If the prior frame is null, this is the first item in the ** table. We need to generate the font table symbol entry. */ switch (prior_target_frame->b_tag) { case sar_k_null_frame: font_table_entry = sem_create_value_entry ((char*)&font_item, sizeof(long), sym_k_font_table_value); font_table_entry->b_table_count = 1; /* * If we are dealing with an indirect reference in the table, * make it a valref node so we reference it correctly. */ if (font_item->obj_header.az_name != NULL) { sym_value_entry_type *font_save; font_save = font_item; font_item = sem_create_value_entry (0, 0, font_save->b_type); font_item->b_type = font_save->b_type; font_item->obj_header.b_flags = sym_m_private; font_item->b_expr_opr = sym_k_valref_op; font_item->az_exp_op1 = font_save; } font_table_entry->az_first_table_value = font_item; break; case sar_k_value_frame: { int count; sym_value_entry_type *last_font_item; font_table_entry = (sym_value_entry_type *) prior_target_frame->value.az_symbol_entry; for (count = 0, last_font_item = font_table_entry->az_first_table_value; last_font_item->az_next_table_value != NULL; last_font_item = last_font_item->az_next_table_value) count++; if (count >= sym_k_max_list_count) diag_issue_diagnostic (d_too_many, _sar_source_position( font_frame ), diag_value_text( sym_k_font_value ), diag_value_text( sym_k_font_table_value ), sym_k_max_list_count ); else { /* * If we are dealing with an indirect reference in the table, * make it a valref node so we reference it correctly. */ if (font_item->obj_header.az_name != NULL) { sym_value_entry_type *font_save; font_save = font_item; font_item = sem_create_value_entry (0, 0, font_save->b_type); font_item->b_type = font_save->b_type; font_item->obj_header.b_flags = sym_m_private; font_item->b_expr_opr = sym_k_valref_op; font_item->az_exp_op1 = font_save; } last_font_item->az_next_table_value = font_item; font_table_entry->b_table_count = count + 1; } break; } default: _assert( FALSE, "prior frame in error" ); } /* ** font item needs to be marked as a table entry */ font_item->b_aux_flags |= sym_m_table_entry; font_item->az_next_table_value = NULL; /* ** initialize the target frame */ _sar_move_source_info (target_frame, keyword_frame); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_font_table_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) font_table_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a item for a font table. This font table ** is a list of symbol table entries of font items. ** ** FORMAL PARAMETERS: ** ** target_frame frame holding the font item generated ** charset_frame token or null frame holding charset token ** font_frame value frame specifying the font value ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** copy the font value unless it is unnamed ** **-- **/ void sar_make_font_item(target_frame, charset_frame, font_frame) yystype *target_frame; yystype *charset_frame; yystype *font_frame; { sym_value_entry_type *font_value_entry; int item_type; _assert( font_frame->b_tag == sar_k_value_frame, "font exp is missing" ); font_value_entry = (sym_value_entry_type *) font_frame->value.az_symbol_entry; if ((font_frame->b_flags & sym_m_forward_ref) != 0) { diag_issue_diagnostic (d_undefined, _sar_source_position(font_frame), "font entry", font_value_entry->obj_header.az_name->c_text); } item_type = font_value_entry->b_type; switch (item_type) { case sym_k_font_value: case sym_k_fontset_value: { int charset; charset = font_value_entry->b_charset; /* ** If the attr_frame is not null, it must be a value frame with contains ** a pointer to the value entry for the userdefined charset, or a token frame ** which contains the charset token subclass. */ switch (charset_frame->b_tag) { case sar_k_value_frame: { sym_value_entry_type * az_value_entry; az_value_entry = (sym_value_entry_type *)charset_frame->value.az_symbol_entry; font_value_entry->b_charset = az_value_entry->b_charset; font_value_entry->az_charset_value = az_value_entry->az_charset_value; break; } case sar_k_token_frame: { key_keytable_entry_type *keyword_entry; keyword_entry = (key_keytable_entry_type *) charset_frame->value.az_keyword_entry; font_value_entry->b_charset = sem_map_subclass_to_charset( keyword_entry->b_subclass ); break; } } break; } case sym_k_error_value: break; default: diag_issue_diagnostic ( d_wrong_type, _sar_source_position( font_frame ), diag_value_text( item_type ), diag_value_text( sym_k_font_value ) ); item_type = sym_k_error_value; font_value_entry = (sym_value_entry_type *) sym_az_error_value_entry; } /* ** initialize the target frame */ _sar_move_source_info( target_frame, font_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = item_type; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) font_value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a font value. ** ** FORMAL PARAMETERS: ** ** target_frame frame holding the font item generated ** charset_frame token or null frame holding charset token ** value_frame value frame specifying the font value ** keyword_frame frame to use as locator for result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** create a font symbol table entry ** **-- **/ void sar_make_font(target_frame, charset_frame, value_frame, keyword_frame) yystype *target_frame; yystype *charset_frame; yystype *value_frame; yystype *keyword_frame; { sym_value_entry_type *font_value_entry; sym_value_entry_type *value_entry; _assert( value_frame->b_tag == sar_k_value_frame, "font name is missing" ); font_value_entry = sem_create_value_entry ("", 0, sym_k_font_value ); font_value_entry->b_type = sym_k_font_value; font_value_entry->obj_header.b_flags = sym_m_private; font_value_entry->b_expr_opr = sym_k_coerce_op; if ((value_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (value_frame, (char*)&(font_value_entry->az_exp_op1), sym_k_patch_add); else { value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; font_value_entry->az_exp_op1 = value_entry; } /* ** If the attr_frame is not null, it must be a value frame with contains ** a pointer to the value entry for the userdefined charset, or a token frame ** which contains the charset token subclass. */ switch (charset_frame->b_tag) { case sar_k_value_frame: { sym_value_entry_type * az_value_entry; az_value_entry = (sym_value_entry_type *) charset_frame->value.az_symbol_entry; font_value_entry->b_charset = az_value_entry->b_charset; /* BEGIN HAL Fix CR 5266 */ font_value_entry->az_charset_value = az_value_entry; /* END HAL Fix CR 5266 */ break; } case sar_k_token_frame: { key_keytable_entry_type *keyword_entry; keyword_entry = (key_keytable_entry_type *) charset_frame->value.az_keyword_entry; font_value_entry->b_charset = sem_map_subclass_to_charset( keyword_entry->b_subclass ); break; } default: /* BEGIN OSF Fix CR 5443 */ font_value_entry->b_charset = Uil_lex_l_user_default_charset; /* END OSF Fix CR 5443 */ break; } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_font_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) font_value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a fontset value. ** ** FORMAL PARAMETERS: ** ** target_frame frame holding the font item generated ** charset_frame token or null frame holding charset token ** value_frame value frame specifying the font value ** keyword_frame frame to use as locator for result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** create a font symbol table entry ** **-- **/ void sar_make_fontset(target_frame, charset_frame, value_frame, keyword_frame) yystype *target_frame; yystype *charset_frame; yystype *value_frame; yystype *keyword_frame; { sym_value_entry_type *font_value_entry; sym_value_entry_type *value_entry; _assert( value_frame->b_tag == sar_k_value_frame, "font name is missing" ); font_value_entry = sem_create_value_entry ("", 0, sym_k_fontset_value ); font_value_entry->b_type = sym_k_fontset_value; font_value_entry->obj_header.b_flags = sym_m_private; font_value_entry->b_expr_opr = sym_k_coerce_op; if ((value_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (value_frame, (char*)&(font_value_entry->az_exp_op1), sym_k_patch_add); else { value_entry = (sym_value_entry_type *) value_frame->value.az_symbol_entry; font_value_entry->az_exp_op1 = value_entry; } /* ** If the attr_frame is not null, it must be a value frame with contains ** a pointer to the value entry for the userdefined charset, or a token frame ** which contains the charset token subclass. */ switch (charset_frame->b_tag) { case sar_k_value_frame: { sym_value_entry_type * az_value_entry; az_value_entry = (sym_value_entry_type *) charset_frame->value.az_symbol_entry; font_value_entry->b_charset = az_value_entry->b_charset; /* BEGIN HAL Fix CR 5266 */ font_value_entry->az_charset_value = az_value_entry; /* END HAL Fix CR 5266 */ break; } case sar_k_token_frame: { key_keytable_entry_type *keyword_entry; keyword_entry = (key_keytable_entry_type *) charset_frame->value.az_keyword_entry; font_value_entry->b_charset = sem_map_subclass_to_charset( keyword_entry->b_subclass ); break; } default: /* BEGIN OSF Fix CR 5443 */ font_value_entry->b_charset = Uil_lex_l_user_default_charset; /* END OSF Fix CR 5443 */ break; } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_fontset_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) font_value_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a color item which is a temporary respository ** to hold data for a single color to be placed in a color table. The ** color item is deleted when the color table is built by ** sar_make_color_table. ** ** FORMAL PARAMETERS: ** ** target_frame frame holding the color item generated ** color_frame token or value frame giving the color ** letter_frame value frame specifying the letter to use for color ** keyword_frame frame to use as locator for result ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** create a color item symbol table entry ** **-- **/ void sar_make_color_item (target_frame, color_frame, letter_frame ) yystype *target_frame; yystype *color_frame; yystype *letter_frame; { sym_color_item_entry_type *item_entry; sym_value_entry_type *letter_entry; _assert( letter_frame->b_tag == sar_k_value_frame, "letter frame missing" ); /* ** initialize the target frame */ _sar_move_source_info( target_frame, color_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = 0; target_frame->b_flags = 0; target_frame->value.az_symbol_entry = 0; /* ** The color can be either a color value or the keyword background or ** foreground. Want to step up: ** target_frame->b_tag: with either sar_k_value_frame for no error ** or sar_k_null_frame for an error ** color_entry: color value if there is one ** 0 for background ** 1 for foreground */ /* ** Allocate the color item and fill it in */ item_entry = (sym_color_item_entry_type *) sem_allocate_node(sym_k_color_item_entry, sym_k_color_item_entry_size ); _sar_save_source_pos (&item_entry->header, color_frame); item_entry->b_index = 0; item_entry->az_next = NULL; switch (color_frame->b_tag) { case sar_k_token_frame: { key_keytable_entry_type *keyword_entry; /* ** This is the foreground or background case */ keyword_entry = color_frame->value.az_keyword_entry; switch (keyword_entry->b_token) { case BACKGROUND: item_entry->az_color = (sym_value_entry_type *) URMColorTableBG; break; case FOREGROUND: item_entry->az_color = (sym_value_entry_type *) URMColorTableFG; break; default: _assert( FALSE, "missing keyword frame" ); } break; } case sar_k_value_frame: if ((color_frame->b_flags & sym_m_forward_ref) != 0) { sym_value_entry_type *diag_value; diag_value = (sym_value_entry_type *) color_frame->value.az_symbol_entry; diag_issue_diagnostic (d_undefined, _sar_source_position(color_frame), "color entry", diag_value->obj_header.az_name->c_text); } else { item_entry->az_color = (sym_value_entry_type *) color_frame->value.az_symbol_entry; } break; default: _assert( FALSE, "color frame missing" ); } /* ** Letter frame has already been checked in the grammar to be a character ** string. Need to further check that it has a length of 1. */ letter_entry = (sym_value_entry_type *) letter_frame->value.az_symbol_entry; if (letter_entry->w_length != 1) { diag_issue_diagnostic ( d_single_letter, _sar_source_position( letter_frame ) ); target_frame->b_tag = sar_k_null_frame; return; } item_entry->b_letter = letter_entry->value.c_value[0]; /* ** If the tag is in error - return */ if (target_frame->b_tag == sar_k_null_frame) return; /* ** Save source information */ _sar_save_source_info ( &item_entry->header, color_frame, letter_frame); target_frame->value.az_symbol_entry = (sym_entry_type *) item_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a list of the color items that are used to ** produce the color table. Each color is checked to see that ** its letter is unique. The new color item is placed on the ** front of the list. ** ** FORMAL PARAMETERS: ** ** target_frame frame holding the color item list ** item_frame color item to be added to list ** prior_target_frame existing color list ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_append_color_item(target_frame, item_frame, prior_target_frame) yystype *target_frame; yystype *item_frame; yystype *prior_target_frame; { sym_color_item_entry_type *item_entry; sym_color_item_entry_type *prior_item_entry = NULL; /* ** Tag for the prior_target frame indicates if this is the first ** or a subsequent color item on the list. */ switch (prior_target_frame->b_tag) { case sar_k_null_frame: prior_item_entry = NULL; break; case sar_k_value_frame: prior_item_entry = (sym_color_item_entry_type *) prior_target_frame->value.az_symbol_entry; break; default: _assert( FALSE, "prior frame missing" ); } /* ** initialize the target frame */ _sar_move_source_info( target_frame, item_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = 0; target_frame->b_flags = 0; target_frame->value.az_symbol_entry = (sym_entry_type *) prior_item_entry; /* ** Need to verify that the letter associated with the current color ** item is unique. */ switch (item_frame->b_tag) { case sar_k_value_frame: { sym_color_item_entry_type *next_item_entry = NULL; item_entry = (sym_color_item_entry_type *) item_frame->value.az_symbol_entry; for (next_item_entry = prior_item_entry; next_item_entry != NULL; next_item_entry = next_item_entry->az_next) if (next_item_entry->b_letter == item_entry->b_letter) { diag_issue_diagnostic ( d_dup_letter, _sar_source_position( item_frame ) ); return; } item_entry->az_next = prior_item_entry; target_frame->value.az_symbol_entry = (sym_entry_type *) item_entry; return; } case sar_k_null_frame: return; default: _assert( FALSE, "list frame missing" ); } } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a color table. It takes a series of ** color items and repackages them within the color table. ** ** FORMAL PARAMETERS: ** ** target_frame frame for holding the color table ** list_frame frame holding first of color item lists ** keyword_frame frame for COLOR_TABLE keyword ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** none ** **-- **/ void sar_make_color_table(target_frame, list_frame, keyword_frame) yystype *target_frame; yystype *list_frame; yystype *keyword_frame; { sym_color_item_entry_type *next_item_entry; sym_value_entry_type *color_table_entry = NULL; int target_type = 0; /* ** Tag for the list frame indicates if there are any color items. */ switch (list_frame->b_tag) { case sar_k_null_frame: target_type = sym_k_error_value; color_table_entry = sym_az_error_value_entry; break; case sar_k_value_frame: { int count; int index; count = 0; index = 1; for (next_item_entry = (sym_color_item_entry_type *) list_frame->value.az_symbol_entry; next_item_entry != NULL; next_item_entry = next_item_entry->az_next) { count++; switch ((long)next_item_entry->az_color) { case 0: next_item_entry->b_index = URMColorTableBG; break; case 1: next_item_entry->b_index = URMColorTableFG; break; default: next_item_entry->b_index = (unsigned char) ++index; break; } } if (index >= sym_k_max_color_count) { diag_issue_diagnostic (d_too_many, _sar_source_position( keyword_frame ), diag_value_text( sym_k_color_value ), diag_value_text( sym_k_color_table_value ), sym_k_max_color_count ); target_type = sym_k_error_value; color_table_entry = sym_az_error_value_entry; break; } color_table_entry = (sym_value_entry_type *) sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size); color_table_entry->value.z_color = (sym_color_element *) XtCalloc(1,sizeof(sym_color_element)*count); color_table_entry->b_type = sym_k_color_table_value; color_table_entry->b_table_count = (unsigned char) count; color_table_entry->b_max_index = (unsigned char) index; color_table_entry->obj_header.b_flags = sym_m_private; _sar_save_source_pos ( &color_table_entry->header, list_frame); for (index = 0, next_item_entry = (sym_color_item_entry_type *) list_frame->value.az_symbol_entry; next_item_entry != NULL; index++ ) { sym_color_item_entry_type *temp; color_table_entry->value.z_color[index].b_index = next_item_entry->b_index; color_table_entry->value.z_color[index].b_letter = next_item_entry->b_letter; color_table_entry->value.z_color[index].az_color = next_item_entry->az_color; temp = next_item_entry; next_item_entry = next_item_entry->az_next; sem_free_node(( sym_entry_type *) temp ); } target_type = sym_k_color_table_value; break; } default: _assert( FALSE, "list frame missing" ); } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = target_type; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) color_table_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a color value. Input to the function is a ** character string give the color name and an option keyword specifying ** display of the color on a monochrome device. ** ** FORMAL PARAMETERS: ** ** target_frame frame to hold the created color value ** color_frame frame giving the character string specifying the color ** mono_frame frame describing monochrome attribute ** keyword_frame frame pointing to COLOR keyword ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** icon value is created ** **-- **/ void sar_make_color(target_frame, color_frame, mono_frame, keyword_frame) yystype *target_frame; yystype *color_frame; yystype *mono_frame; yystype *keyword_frame; { sym_value_entry_type *color_entry; sym_value_entry_type *value_entry; int state = 0; /* ** Mono frame can point to the keyword FOREGROUND or BACKGROUND ** or be null meaning unspecified. */ switch (mono_frame->b_tag) { case sar_k_null_frame: state = sym_k_unspecified_color; break; case sar_k_token_frame: switch (mono_frame->value.az_keyword_entry->b_token) { case BACKGROUND: state = sym_k_background_color; break; case FOREGROUND: state = sym_k_foreground_color; break; default: _assert( FALSE, "monochrome info missing" ); } break; default: _assert( FALSE, "monochrome info missing" ); } /* ** Transform the char 8 value entry into a color value. ** Before doing this, we need to insure that the string ** is not in error or named. */ _assert( color_frame->b_tag == sar_k_value_frame, "value missing" ); color_entry = sem_create_value_entry ( "", 0, sym_k_color_value ); color_entry->b_type = sym_k_color_value; color_entry->obj_header.b_flags = sym_m_private; color_entry->b_arg_type = state; color_entry->b_expr_opr = sym_k_coerce_op; if ((color_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (color_frame, (char*)&(color_entry->az_exp_op1), sym_k_patch_add); else { value_entry = (sym_value_entry_type *) color_frame->value.az_symbol_entry; color_entry->az_exp_op1 = value_entry; } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = sym_k_color_value; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) color_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function builds a icon value. Input to the function is a ** color table and a list of string that represent the rows of the ** icon. ** ** FORMAL PARAMETERS: ** ** target_frame frame to hold the created icon value ** table_frame frame describing the color table ** list_frame frame pointing to the list of row strings ** keyword_frame frame pointing to the icon keyword ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** target_frame ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** icon value is created ** **-- **/ void sar_make_icon(target_frame, list_frame, table_frame, keyword_frame) yystype *target_frame; yystype *table_frame; yystype *list_frame; yystype *keyword_frame; { sym_value_entry_type *table_entry = NULL; sym_value_entry_type *icon_entry; sym_value_entry_type *head_row_entry = NULL; int target_type; int width; int height; /* ** Table_frame specifies the color table for the icon. If this ** argument is null, use the standard color table. */ target_type = sym_k_icon_value; height = 0; width = 0; switch (table_frame->b_tag) { case sar_k_null_frame: table_entry = standard_color_table(); break; case sar_k_value_frame: table_entry = (sym_value_entry_type *) table_frame->value.az_symbol_entry; /* ** Check that the table is indeed a color table ** Forward references are set up once the icon entry is created */ if ((table_frame->b_flags & sym_m_forward_ref) != 0) table_entry = NULL; else switch (table_entry->b_type) { case sym_k_color_table_value: break; case sym_k_error_value: default: /* BEGIN OSF Fix CR 5421 */ /* * If the value_frame is not a color_table_value, print * a diagnostic to flag it as an error further down the * road. Otherwise, if it is exported, will cause problems. */ diag_issue_diagnostic ( d_wrong_type, _sar_source_position(table_frame), diag_value_text(table_entry->b_type), diag_value_text(sym_k_color_table_value) ); /* END OSF Fix CR 5421 */ target_type = sym_k_error_value; table_entry = standard_color_table(); break; } break; default: _assert( FALSE, "color table missing" ); } /* ** Now start checking the rows of the table. If the tag on list ** frame is null, there are no rows (this is due to prior errors). ** Rows are linked in reverse order. We reorder them at this ** point since it simplifies .uid generation. */ switch (list_frame->b_tag) { case sar_k_null_frame: target_type = sym_k_error_value; break; case sar_k_value_frame: { sym_value_entry_type *row_entry; sym_value_entry_type *temp_row_entry; /* ** Reorder the rows */ for (row_entry = (sym_value_entry_type *) list_frame->value.az_symbol_entry, head_row_entry = NULL; row_entry != NULL; temp_row_entry = row_entry, row_entry = row_entry->az_next_table_value, temp_row_entry->az_next_table_value = head_row_entry, head_row_entry = temp_row_entry) ; for (row_entry = head_row_entry, width = row_entry->w_length; row_entry != NULL; row_entry = row_entry->az_next_table_value) { /* BEGIN OSF Fix CR 5420 */ /* * Check to make sure each row_entry is a character string. * If it isn't, print a diagnostic message indicating an error. */ if ((row_entry->b_type != sym_k_char_8_value) && (row_entry->b_type != sym_k_localized_string_value)) { diag_issue_diagnostic ( d_wrong_type, _sar_source_pos2(row_entry), diag_value_text(row_entry->b_type), diag_value_text(sym_k_char_8_value) ); target_type = sym_k_error_value; } /* END OSF Fix CR 5420 */ height++; if (width != row_entry->w_length) { diag_issue_diagnostic ( d_icon_width, row_entry->header.az_src_rec, /* line info */ row_entry->header.b_type, /* column infor */ height ); target_type = sym_k_error_value; } } break; } default: _assert( FALSE, "row list missing" ); } if (width > sym_k_max_list_count) { diag_issue_diagnostic ( d_too_many, _sar_source_position( keyword_frame ), "column", diag_value_text( sym_k_icon_value ), sym_k_max_list_count ); target_type = sym_k_error_value; } if (height > sym_k_max_list_count) { diag_issue_diagnostic ( d_too_many, _sar_source_position( keyword_frame ), "row", diag_value_text( sym_k_icon_value ), sym_k_max_list_count ); target_type = sym_k_error_value; } /* ** If we have no errors, allocate the icon */ if (target_type == sym_k_error_value) icon_entry = sym_az_error_value_entry; else { icon_entry = (sym_value_entry_type *) sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size); icon_entry->value.z_icon = (sym_icon_element *) XtCalloc(1,sizeof(sym_icon_element)); icon_entry->b_type = sym_k_icon_value; icon_entry->value.z_icon->w_height = height; icon_entry->value.z_icon->w_width = width; icon_entry->value.z_icon->az_color_table = table_entry; icon_entry->value.z_icon->az_rows = head_row_entry; icon_entry->obj_header.b_flags = sym_m_private; _sar_save_source_pos (&icon_entry->header, list_frame ); if ((table_frame->b_flags & sym_m_forward_ref) != 0) sym_make_value_forward_ref (table_frame, (char*)&icon_entry->value.z_icon->az_color_table, sym_k_patch_add); } /* ** initialize the target frame */ _sar_move_source_info( target_frame, keyword_frame ); target_frame->b_tag = sar_k_value_frame; target_frame->b_type = target_type; target_frame->b_flags = sym_m_private; target_frame->value.az_symbol_entry = (sym_entry_type *) icon_entry; } /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This function defines the standard color table. ** ** FORMAL PARAMETERS: ** ** none ** ** IMPLICIT INPUTS: ** ** color_table local static storage ** ** IMPLICIT OUTPUTS: ** ** none ** ** FUNCTION VALUE: ** ** address of standard color table entry ** ** SIDE EFFECTS: ** ** may allocate the standard color table ** **-- **/ static sym_value_entry_type *standard_color_table() { static sym_value_entry_type *color_table = NULL; if (color_table == NULL) { color_table = (sym_value_entry_type *) sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size); color_table->value.z_color = (sym_color_element *) XtCalloc(1,sizeof(sym_color_element)*2); color_table->b_type = sym_k_color_table_value; color_table->b_table_count = 2; color_table->b_max_index = 1; color_table->obj_header.b_flags = sym_m_private; color_table->header.az_src_rec = src_az_module_source_record; color_table->value.z_color[0].b_index = URMColorTableBG; color_table->value.z_color[0].b_letter = ' '; color_table->value.z_color[0].az_color = (sym_value_entry_type *) URMColorTableBG; color_table->value.z_color[1].b_index = URMColorTableFG; color_table->value.z_color[1].b_letter = '*'; color_table->value.z_color[1].az_color = (sym_value_entry_type *) URMColorTableFG; } return color_table; } motif-2.3.8/clients/uil/UilLexDef.h0000644000175000017500000000355013145162623014015 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the interface to the UIL lexical ** analyzer. ** **-- **/ #ifndef UilLexDef_h #define UilLexDef_h /* ** Define flags to indicate whether certain characters are to be ** filtered in text output. */ #define lex_m_filter_tab (1 << 0) /* ** Define the default character set. In Motif, the default character set is ** not isolatin1, but simply the null string, thus we must be able to ** distinguish the two. */ #define lex_k_default_charset -1 #define lex_k_userdefined_charset -2 #define lex_k_fontlist_default_tag -3 /* ** Since key_k_keyword_max_length assumes the length of the longest ** WML generated keyword, we need a new constant to define the ** longest allowable identifier. This length should not exceed ** URMMaxIndexLen. (CR 5566) */ #define lex_k_identifier_max_length 31 #endif /* UilLexDef_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilDefI.h0000644000175000017500000007341513145162623013464 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** This include file defines the set of definitions used by all of ** modules of the UIL compiler. ** **-- **/ #ifndef UilDefI_h #define UilDefI_h /* ** ** INCLUDE FILES ** **/ #define X_INCLUDE_TIME_H #define XOS_USE_XT_LOCKING #ifdef HAVE_X11_XOS_R_H #include #else #include #endif #include #include /* ** ** Universal Definitions ** */ #define _compiler_version "V2.0-000" #define _compiler_version_int 2 #define _data_version 2 #define _host_compiler "Motif Uil Compiler" #ifdef TRUE #undef TRUE #endif #define TRUE 1 #ifdef FALSE #undef FALSE #endif #define FALSE 0 #ifndef debug_version #define debug_version FALSE #endif #define NOSTRING_DIRECTION 2 #define k_normal 1 #define k_error 0 typedef int status; typedef int boolean; /* ** Copy const handling from XmP.h. */ #ifndef XmConst #if defined(__STDC__) || !defined( NO_CONST ) #define XmConst const #else #define XmConst #endif /* __STDC__ */ #endif /* XmConst */ /* Uil will automatically strip this prefix when saving name of automatically * created child. This is used to prevent name conflicts in existing uil * files. Children names without this prefix will be saved as is. */ #define AUTO_CHILD_PREFIX "Xm_" /* ** ** Constants controlling limits in the compiler ** */ #define src_k_max_source_files 101 #define src_k_max_source_line_length 132 #define lex_k_unprint_sub '?' #define sym_k_max_list_count 1000 #define sym_k_max_color_count 256 #define Uil_k_max_include_dir_count 32 /* ** ** Definition of Compiler Termination Statuses ** */ #define uil_k_min_status Uil_k_min_status #define uil_k_success_status Uil_k_success_status #define uil_k_info_status Uil_k_info_status #define uil_k_warning_status Uil_k_warning_status #define uil_k_error_status Uil_k_error_status #define uil_k_severe_status Uil_k_severe_status #define uil_k_max_status Uil_k_max_status /* ** ** Macros to access bit vectors ** */ /* MOVED TO DBDef.h */ /* ** ** Upper and Lower Case Translation Macros ** */ #define _upper(c) ((c) >= 'a' && (c) <= 'z' ? (c) & 0x5F:(c)) #define _lower(c) ((c) >= 'A' && (c) <= 'Z' ? (c) | 0x20:(c)) /* ** ** Assert Macro ** */ #if debug_version #define _assert( __condition, __text ) \ if (!(__condition)) \ { diag_issue_internal_error( (__text)); } #else #define _assert( __condition, __text ) \ if (!(__condition)) \ { diag_issue_internal_error( NULL ); } #endif /* ** ** _error and _okay macro ** */ #define _error( __status ) \ ((__status & 1)==0) #define _success( __status ) \ ((__status & 1)==1) /* ** ** Memory allocation definitions ** */ #define _get_memory XtMalloc #define _free_memory XtFree /* ** ** Move macro ** */ #ifdef NO_MEMMOVE /* For fixing the bug CR 4581 */ extern char* uil_mmove(char*, char*, int); #define _move uil_mmove #else #define _move memmove #endif /* NO_MEMMOVE */ /* ** ** Compare macro ** */ #define _compare strcmp /* ** ** Fill macro ** */ #define _fill( __string, __char, __len ) \ { \ register int i = __len; \ while (--i >= 0) \ (__string)[i] = __char; \ } /* ** ** Index macro ** */ #define _index( __char, __string, __len ) \ ((int)((char *)memchr( __string, __char, __len ) - (char *)__string )) /* ** ** Debug output macro ** */ #if debug_version #define _debug_output lst_debug_output #else #define _debug_output printf #endif /* ** ** Common includes needed by most modules ** */ #include "Uil.h" #include "UilDBDef.h" /* for binary database */ #include "UilMess.h" #include "UilSymDef.h" /* must come before UilKeyDef.h */ #include "UilSrcDef.h" /* must come before UilIODef.h */ #include "UilIODef.h" #include "UilDiagDef.h" #include "UilSarDef.h" #if defined(linux) || defined(__APPLE__) #define YYSTYPE yystype #endif #include "UilLexPars.h" #include "UilCmdDef.h" #include "UilLexDef.h" /* ** Global declarations */ #include "UilSymGl.h" #include "UilCompGl.h" /* Needed for following macro. */ #include "UilSymGen.h" #define DEFAULT_TAG uil_charset_names[sym_k_XmFONTLIST_DEFAULT_TAG_charset] /* ** Function declarations not defined elsewhere */ #define _ARGUMENTS(arglist) arglist /* uilcmd.c */ #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern void diag_issue_diagnostic _ARGUMENTS(( int d_message_number , src_source_record_type *az_src_rec , int l_start_column, ... )); extern void lst_debug_output _ARGUMENTS(( char *format, ... )); void cmd_decode_command_line _ARGUMENTS(( int l_arg_count , char *rac_arg_value [])); /* uildb.c */ extern void db_incorporate _ARGUMENTS(( void )); extern void db_read_ints_and_string _ARGUMENTS((_db_header_ptr header)); extern void db_read_char_table _ARGUMENTS((_db_header_ptr header)); extern void db_read_length_and_string _ARGUMENTS((_db_header_ptr header)); extern void db_read_int_and_shorts _ARGUMENTS((_db_header_ptr header)); extern void db_open_file _ARGUMENTS(( void )); extern String get_root_dir_name _ARGUMENTS(( void )); extern String init_wmd_path _ARGUMENTS((String filename)); /* uildiags.c */ extern void diag_issue_summary _ARGUMENTS(( void )); extern char *diag_tag_text _ARGUMENTS(( int XmConst b_tag )); extern char *diag_object_text _ARGUMENTS(( int XmConst b_type )); extern char *diag_value_text _ARGUMENTS(( int XmConst b_type )); extern char *diag_charset_text _ARGUMENTS(( int XmConst b_type )); extern void diag_initialize_diagnostics _ARGUMENTS(( void )); extern void diag_restore_diagnostics _ARGUMENTS(( void )); extern void diag_reset_overflow_handler _ARGUMENTS(( void )); extern void diag_handler _ARGUMENTS(( int l_error )); extern void diag_issue_internal_error _ARGUMENTS(( char *error_text )); extern void write_msg_to_standard_error _ARGUMENTS(( XmConst int message_number , XmConst char *src_buffer , XmConst char *ptr_buffer , XmConst char *msg_buffer , XmConst char *loc_buffer )); extern char XmConst *diag_get_message_abbrev _ARGUMENTS(( int d_message_number )); extern void diag_report_status _ARGUMENTS(( void )); /* uilkeytab.c */ extern key_keytable_entry_type *key_find_keyword _ARGUMENTS(( unsigned int symbol_length , char *symbol_ptr )); extern void key_initialize _ARGUMENTS(( void )); /* uillexana.c */ extern int yylex _ARGUMENTS(( void )); extern void lex_initialize_analyzer _ARGUMENTS(( void )); extern void Uil_lex_cleanup_analyzer _ARGUMENTS(( void )); extern void lex_issue_error _ARGUMENTS(( int restart_token )); extern void issue_control_char_diagnostic _ARGUMENTS(( unsigned char c_char )); extern void lex_filter_unprintable_chars _ARGUMENTS(( unsigned char *buffer , int length , unsigned long flags )); extern long cvt_ascii_to_long _ARGUMENTS(( unsigned char XmConst *c_text )); extern sym_value_entry_type *create_str_entry _ARGUMENTS(( int l_size , int l_charset , sym_value_entry_type *az_charset_entry )); /* uillstlst.c */ extern void lst_open_listing _ARGUMENTS(( void )); extern void Uil_lst_cleanup_listing _ARGUMENTS(( void )); extern status create_listing_file _ARGUMENTS(( uil_fcb_type *az_fcb )); extern void lst_output_line _ARGUMENTS(( char *ac_line , boolean v_new_page )); extern char *current_time _ARGUMENTS(( _Xctimeparams *ctime_buf )); extern void lst_output_listing _ARGUMENTS(( void )); extern void lst_output_messages _ARGUMENTS(( src_message_item_type *az_message_item )); extern void lst_output_machine_code _ARGUMENTS(( src_source_record_type *az_src_rec )); extern void lst_output_message_ptr_line _ARGUMENTS(( src_source_record_type *az_src_rec , char *src_buffer )); /* uillstmac.c */ extern void save_widget_machine_code _ARGUMENTS(( sym_widget_entry_type *widget_entry , URMResourceContext *az_context )); extern void unload_stack _ARGUMENTS(( char *rec , int rec_size , src_source_record_type *az_src_rec )); extern void save_value_machine_code _ARGUMENTS(( sym_value_entry_type *value_entry , URMResourceContext *az_context )); extern void save_module_machine_code _ARGUMENTS(( src_source_record_type *az_src_rec , URMResourceContext *az_context )); extern void off_put _ARGUMENTS(( unsigned short off_type , unsigned short off_offset )); extern void off_get _ARGUMENTS(( unsigned short *off_type , unsigned short *off_offset )); extern char *type_from_code _ARGUMENTS(( MrmType type_code )); extern char *access_from_code _ARGUMENTS(( MrmFlag access_code )); extern char *group_from_code _ARGUMENTS(( MrmGroup group_code )); extern void format_arg_value _ARGUMENTS(( RGMArgValuePtr argval_ptr , char *buffer )); extern char *class_name_from_code _ARGUMENTS(( MrmCode mrm_class )); extern char *resource_name_from_code _ARGUMENTS(( MrmCode resource )); /* uilmain.c */ extern void uil_exit _ARGUMENTS(( int severity )); extern Uil_status_type Uil _ARGUMENTS((Uil_command_type *comand_desc,Uil_compile_desc_type *compile_desc,Uil_continue_type (*message_cb)(), char *message_data, Uil_continue_type (*status_cb)(), char *status_data)); /* uilp2out.c */ extern void sem_output_uid_file _ARGUMENTS(( void )); extern void push _ARGUMENTS(( sym_entry_type *sym_entry )); extern sym_entry_type *pop _ARGUMENTS(( void )); extern void out_emit_widget _ARGUMENTS(( sym_widget_entry_type *widget_entry )); extern void extract_subtree_control _ARGUMENTS(( sym_list_entry_type *list_entry , sym_control_entry_type **menu_entry , int *count )); extern void extract_create_callback _ARGUMENTS(( sym_list_entry_type *list_entry , sym_callback_entry_type **create_entry )); extern void process_all_callbacks _ARGUMENTS(( sym_list_entry_type *list_entry , int *arglist_index )); extern void process_all_arguments _ARGUMENTS(( sym_list_entry_type *list_entry , int *arglist_index , int *related_count )); extern void process_all_controls _ARGUMENTS(( sym_list_entry_type *list_entry , int *widget_index )); extern void out_emit_value _ARGUMENTS(( sym_value_entry_type *value_entry )); extern void emit_callback _ARGUMENTS(( sym_callback_entry_type *callback_entry , int *arglist_index , boolean emit_create )); extern void emit_callback_procedures _ARGUMENTS(( sym_proc_ref_entry_type *proc_ref_entry_next, int *proc_ref_index, MrmOffset callback_offset )); extern int count_proc _ARGUMENTS(( sym_list_entry_type *proc_list, int count)); extern void emit_argument _ARGUMENTS(( sym_argument_entry_type *argument_entry , int arglist_index , int *related_arg_count )); extern void emit_control _ARGUMENTS(( sym_control_entry_type *control_entry , int control_offset )); extern MrmCode ref_value _ARGUMENTS(( sym_value_entry_type *value_entry , MrmCode *arg_type , long *arg_value , MrmCode *arg_access , char **arg_index , MrmResource_id *arg_id , MrmCode *arg_group )); extern MrmCode ref_control _ARGUMENTS(( sym_control_entry_type *control_entry , MrmCode *access , char **index , MrmResource_id *id )); extern void issue_urm_error _ARGUMENTS(( char *problem )); extern MrmCode Urm_code_from_uil_type _ARGUMENTS(( int uil_type )); extern int compute_color_table_size _ARGUMENTS(( sym_value_entry_type *table_entry )); extern void create_color_table _ARGUMENTS(( sym_value_entry_type *table_entry , char *buffer )); extern int compute_icon_size _ARGUMENTS(( sym_value_entry_type *icon_entry )); extern void create_icon _ARGUMENTS(( sym_value_entry_type *icon_entry , char *buffer )); extern int compute_list_size _ARGUMENTS(( sym_list_entry_type *list_entry , int type )); extern void create_int_compression_codes _ARGUMENTS(( void )); extern void create_ext_compression_codes _ARGUMENTS(( void )); /* uilp2reslv.c */ extern void sem_resolve_forward_refs _ARGUMENTS(( void )); /* uilsarcomp.c */ extern sym_value_entry_type *sem_create_cstr _ARGUMENTS(( void )); extern sym_value_entry_type *sem_create_wchar_str _ARGUMENTS(( void )); extern void sem_append_str_to_cstr _ARGUMENTS(( sym_value_entry_type *az_cstr_entry , sym_value_entry_type *az_str_entry , boolean op2_temporary )); extern void sem_append_cstr_to_cstr _ARGUMENTS(( sym_value_entry_type *az_cstr1_entry , sym_value_entry_type *az_cstr2_entry , boolean op2_temporary )); extern sym_value_entry_type *sem_cat_str_to_str _ARGUMENTS(( sym_value_entry_type *az_str1_entry , boolean op1_temporary , sym_value_entry_type *az_str2_entry , boolean op2_temporary )); extern int sem_map_subclass_to_charset _ARGUMENTS(( int charset_as_subclass )); extern void sar_charset_verify _ARGUMENTS(( yystype *charset_frame )); extern void sar_make_fallback_charset _ARGUMENTS((yystype *name_frame)); extern void sar_chk_charset_attr _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *prior_value_frame )); extern void sar_make_charset _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *attr_frame , yystype *keyword_frame )); /* uilsarexp.c */ extern void sar_binary_op _ARGUMENTS(( yystype *operator_frame , yystype *op1_frame , yystype *op2_frame )); extern void sar_unary_op _ARGUMENTS(( yystype *operator_frame , yystype *op1_frame )); /* uilsarinc.c */ extern void sar_include_file _ARGUMENTS(( yystype *file_frame , yystype *include_frame , yystype *semi_frame )); /* uilsarmod.c */ extern void sar_initialize _ARGUMENTS(( void )); extern void sar_create_root _ARGUMENTS(( yystype *root_frame )); extern void sar_create_module _ARGUMENTS(( yystype *target_frame , yystype *id_frame , yystype *module_frame )); extern void sar_process_module_version _ARGUMENTS(( yystype *value_frame , yystype *start_frame )); extern void sar_process_module_sensitivity _ARGUMENTS(( yystype *token_frame , yystype *start_frame )); extern void sar_process_module_charset _ARGUMENTS(( yystype *token_frame , yystype *start_frame )); extern void sar_save_module_source _ARGUMENTS(( void )); extern void sar_make_def_obj _ARGUMENTS(( yystype *object_frame )); extern void sar_process_module_variant _ARGUMENTS(( yystype *obj_type_frame , yystype *variant_frame )); extern void sar_save_section_source _ARGUMENTS(( yystype *header_frame , int section_type )); /* uilsarobj.c */ extern void sar_assoc_comment _ARGUMENTS(( sym_obj_entry_type *object )); extern void sar_create_object _ARGUMENTS(( yystype *object_frame , unsigned char object_type )); extern void sar_create_child _ARGUMENTS(( yystype *object_frame )); extern void sar_link_section _ARGUMENTS(( yystype *id_frame )); extern void sar_save_src_semicolon_pos _ARGUMENTS(( yystype *semi_frame )); extern void sar_save_list_end _ARGUMENTS(( yystype *close_frame )); extern void sar_save_src_entry_end _ARGUMENTS(( yystype *close_frame , yystype *entry_frame )); extern void sar_set_object_flags _ARGUMENTS(( yystype *current_frame , unsigned char mask )); extern void sar_unset_object_flags _ARGUMENTS(( yystype *current_frame , unsigned char mask )); extern void sar_set_list_type _ARGUMENTS(( yystype *current_frame )); extern void sar_set_object_class _ARGUMENTS(( yystype *current_frame )); extern void sar_set_object_variant _ARGUMENTS(( yystype *current_frame )); extern yystype *sem_find_object _ARGUMENTS(( yystype *current_frame )); extern void sar_object_reference _ARGUMENTS(( yystype *ref_frame )); extern void sar_update_parent_list _ARGUMENTS(( yystype *control_list_frame )); extern void parent_list_traverse _ARGUMENTS(( sym_widget_entry_type *widget_entry , sym_list_entry_type *control_list_entry )); extern void sar_save_feature _ARGUMENTS(( yystype *feature_frame )); extern void sar_save_argument_pair _ARGUMENTS(( yystype *argument_frame , yystype *value_frame , yystype *equals_frame )); extern void sar_save_reason_binding _ARGUMENTS(( yystype *reason_frame , yystype *proc_ref_frame , yystype *equals_frame )); extern void sar_save_control_item _ARGUMENTS(( yystype *managed_frame , yystype *item_frame )); extern void sar_save_control_widget _ARGUMENTS(( yystype *control_frame , yystype *item_frame )); extern void sar_save_user_proc_ref_src _ARGUMENTS(( yystype *procedure_frame , yystype *proc_id_frame , yystype *proc_arg_frame )); extern void sar_process_proc_ref _ARGUMENTS(( yystype *proc_id_frame , yystype *proc_arg_frame , int context )); extern void sar_add_list_entry _ARGUMENTS(( yystype *entry_frame )); extern void sar_add_forward_list_entry _ARGUMENTS(( yystype *entry_frame )); extern void sar_verify_object _ARGUMENTS(( yystype *current_frame )); extern sym_entry_type *sem_allocate_node _ARGUMENTS(( unsigned char node_tag , unsigned short node_size )); extern void sem_free_node _ARGUMENTS(( sym_entry_type *node_ptr )); /* uilsarproc.c */ extern void sar_create_procedure _ARGUMENTS(( XmConst yystype *id_frame , XmConst yystype *param_frame , XmConst yystype *class_frame , XmConst yystype *semi_frame )); extern sym_proc_ref_entry_type *sem_reference_procedure _ARGUMENTS(( yystype *id_frame , XmConst yystype *value_frame , XmConst int context )); extern sym_entry_type *sem_ref_name _ARGUMENTS(( yystype *id_frame , XmConst int tag )); /* uilsarval.c */ extern void sar_map_keyword_to_name _ARGUMENTS(( yystype *target_frame , yystype *keyword_frame )); extern void sar_process_id _ARGUMENTS(( yystype *target_frame , yystype *id_frame )); extern void sar_process_id_ref _ARGUMENTS(( yystype *id_frame )); extern void sar_make_private_value _ARGUMENTS(( yystype *value_frame , yystype *token_frame , int value_type , yystype *keyword_frame , int arg_type )); extern void sar_make_rgb_private_value _ARGUMENTS(( yystype *value_frame , yystype *token_frame , int value_type , yystype *keyword_frame , int arg_type )); extern void sar_append_table_value _ARGUMENTS(( yystype *value_frame , yystype *table_frame , int table_type , yystype *comma_frame )); extern void sar_value_not_implemented _ARGUMENTS(( yystype *value_frame , yystype *token_frame , char *error_text )); extern void sar_cat_value _ARGUMENTS(( yystype *operator_frame , yystype *op1_frame , yystype *op2_frame )); extern void sar_chk_comp_str_attr _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *prior_value_frame )); extern void sar_make_comp_str _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *attr_frame , yystype *keyword_frame )); extern void sar_make_comp_str_comp _ARGUMENTS((yystype *target_frame, yystype *type_frame, yystype *value_frame, yystype *keyword_frame)); extern void sar_make_wchar_str _ARGUMENTS(( yystype *target_frame , yystype *value_frame , yystype *attr_frame , yystype *keyword_frame )); extern void sar_value_type_error _ARGUMENTS(( yystype *value_frame , int expected_type )); extern void sar_private_error _ARGUMENTS(( yystype *value_frame )); extern void sar_import_value_entry _ARGUMENTS(( yystype *target_frame , yystype *token_frame )); extern void sar_bind_value_name _ARGUMENTS(( yystype *id_frame , yystype *value_frame , yystype *semi_frame )); extern sym_name_entry_type *sem_dcl_name _ARGUMENTS(( XmConst yystype *id_frame )); extern sym_value_entry_type *sem_create_value_entry _ARGUMENTS(( char *value , int length , int value_type )); extern void sar_create_identifier _ARGUMENTS(( XmConst yystype *id_frame , XmConst yystype *semi_frame )); extern void sar_make_font_table _ARGUMENTS(( yystype *target_frame , yystype *font_frame , yystype *prior_target_frame , yystype *keyword_frame )); extern void sar_make_font_item _ARGUMENTS(( yystype *target_frame , yystype *charset_frame , yystype *font_frame )); extern void sar_make_font _ARGUMENTS(( yystype *target_frame , yystype *charset_frame , yystype *value_frame , yystype *keyword_frame )); extern void sar_make_fontset _ARGUMENTS(( yystype *target_frame , yystype *charset_frame , yystype *value_frame , yystype *keyword_frame )); extern void sar_make_color_item _ARGUMENTS(( yystype *target_frame , yystype *color_frame , yystype *letter_frame )); extern void sar_append_color_item _ARGUMENTS(( yystype *target_frame , yystype *item_frame , yystype *prior_target_frame )); extern void sar_make_color_table _ARGUMENTS(( yystype *target_frame , yystype *list_frame , yystype *keyword_frame )); extern void sar_make_color _ARGUMENTS(( yystype *target_frame , yystype *color_frame , yystype *mono_frame , yystype *keyword_frame )); extern void sar_make_icon _ARGUMENTS(( yystype *target_frame , yystype *list_frame , yystype *table_frame , yystype *keyword_frame )); /* uilsemcset.c */ extern char *sem_charset_name _ARGUMENTS(( int l_charset , sym_value_entry_type *az_charset_entry )); extern void sem_charset_info _ARGUMENTS(( int l_charset , sym_value_entry_type *az_charset_entry , int *write_direction , int *parse_direction , int *sixteen_bit )); extern int sem_charset_lang_name _ARGUMENTS(( char *lang_charset )); /* uilsemval.c */ typedef union { boolean boolean_value; int integer_value; double real_value; char character_value; /* character data type RAP */ float single_float_value; /* single float data type RAP */ } data_value_type; extern void sem_validation _ARGUMENTS(( void )); extern void sem_validate_node _ARGUMENTS(( sym_entry_type *node )); extern sym_value_entry_type *sem_validate_value_node _ARGUMENTS(( sym_value_entry_type *value_node )); extern void sem_validate_widget_node _ARGUMENTS(( sym_widget_entry_type *widget_node )); extern void sem_validate_argument_list _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_argument_entry_type **seen )); extern void sem_validate_argument_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_argument_entry_type *argument_entry , sym_argument_entry_type **seen )); extern void sem_validate_argument_enumset _ARGUMENTS(( sym_argument_entry_type *argument_entry , int arg_code , sym_value_entry_type *arg_value_entry )); extern void sem_validate_constraint_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , sym_argument_entry_type *argument_entry, unsigned int widget_type )); extern void sem_validate_callback_list _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_callback_entry_type **seen )); extern void sem_validate_callback_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_callback_entry_type *callback_entry , sym_callback_entry_type **seen )); extern void sem_validate_control_list _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , int *count )); extern void sem_validate_control_entry _ARGUMENTS(( sym_widget_entry_type *widget_node , unsigned int widget_type , sym_list_entry_type *list_entry , sym_control_entry_type *control_entry , int *gadget_count )); extern void sem_validate_widget_cycle _ARGUMENTS(( sym_list_entry_type *list_entry , sym_name_entry_type *cycle_name )); extern boolean sem_validate_widget_cycle_aux _ARGUMENTS(( sym_list_entry_type *list_entry , sym_name_entry_type *cycle_name )); extern boolean sem_validate_verify_cycle _ARGUMENTS(( sym_widget_entry_type *cycle_obj , sym_list_entry_type *list_entry )); extern void sem_validate_procref_list _ARGUMENTS(( sym_list_entry_type *list_entry )); extern void sem_validate_procref_entry _ARGUMENTS(( sym_proc_ref_entry_type *procref_entry )); extern boolean sem_argument_allowed _ARGUMENTS(( unsigned int arg_code , unsigned int class_code )); extern boolean sem_reason_allowed _ARGUMENTS(( unsigned int rsn_code , unsigned int class_code )); extern boolean sem_control_allowed _ARGUMENTS(( unsigned int ctl_code , unsigned int class_code )); extern boolean sem_child_allowed _ARGUMENTS(( unsigned int ctl_code , unsigned int class_code )); extern sym_value_entry_type *sem_evaluate_value _ARGUMENTS(( sym_value_entry_type *val_entry )); extern sym_value_entry_type *sem_evaluate_value_cs _ARGUMENTS(( sym_value_entry_type *csval_entry )); /* BEGIN OSF Fix CR 4859 */ /* END OSF Fix CR 4859 */ extern sym_value_entry_type *sem_evaluate_value_expr _ARGUMENTS(( sym_value_entry_type *value_entry )); extern int validate_arg _ARGUMENTS(( sym_value_entry_type *operand_entry , int v_operator )); extern int sem_convert_to_float _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value )); extern int sem_convert_to_integer _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value )); extern int sem_convert_to_single_float _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value )); extern int sem_convert_to_error _ARGUMENTS(( sym_value_entry_type *operand_entry , data_value_type *data_value )); extern void sar_cat_value_entry _ARGUMENTS(( sym_value_entry_type **target_entry , sym_value_entry_type *op1_entry , sym_value_entry_type *op2_entry )); /* uilsrcsrc.c */ extern void src_initialize_source _ARGUMENTS(( void )); extern void Uil_src_cleanup_source _ARGUMENTS(( void )); extern void src_open_file _ARGUMENTS(( XmConst char *c_file_name , char *full_file_name )); extern status src_get_source_line _ARGUMENTS(( void )); extern status open_source_file _ARGUMENTS(( XmConst char *c_file_name , uil_fcb_type *az_fcb , src_source_buffer_type *az_source_buffer )); extern status close_source_file _ARGUMENTS(( uil_fcb_type *az_fcb )); extern status get_line _ARGUMENTS(( uil_fcb_type *az_fcb )); extern boolean reget_line _ARGUMENTS(( uil_fcb_type *az_fcb , char *c_buffer , XmConst z_key *z_access_key )); extern char *src_get_file_name _ARGUMENTS(( XmConst src_source_record_type *az_src_rec )); extern boolean src_retrieve_source _ARGUMENTS(( XmConst src_source_record_type *az_src_rec , char *c_buffer )); extern void src_append_diag_info _ARGUMENTS(( XmConst src_source_record_type *az_src_rec , XmConst int l_src_pos , XmConst char *c_msg_text , XmConst int l_msg_number )); extern void src_append_machine_code _ARGUMENTS(( src_source_record_type *az_src_rec , XmConst int l_offset , XmConst int l_code_len , XmConst char *c_code , XmConst char *c_text_arg )); /* uilsymnam.c */ extern sym_name_entry_type *sym_find_name _ARGUMENTS(( int l_length , char *c_text )); extern sym_name_entry_type *sym_insert_name _ARGUMENTS(( int l_length , char *c_text )); extern int hash_function _ARGUMENTS(( int l_length , char *c_value )); #if debug_version extern void sym_dump_hash_table _ARGUMENTS(( void )); #endif /* uilsymstor.c */ extern void sym_initialize_storage _ARGUMENTS(( void )); extern void Uil_sym_cleanup_storage _ARGUMENTS(( boolean freealloc )); extern void sym_make_external_def _ARGUMENTS(( XmConst sym_name_entry_type *az_name )); extern void sym_make_forward_ref _ARGUMENTS(( XmConst yystype *az_id_frame , XmConst int l_widget_type , XmConst char *a_location )); extern void sym_make_value_forward_ref _ARGUMENTS(( XmConst yystype *az_value_frame , XmConst char *a_location , XmConst unsigned char fwd_ref_flags )); extern void UilDumpSymbolTable _ARGUMENTS(( sym_entry_type *node_entry )); extern void sym_dump_symbols _ARGUMENTS(( void )); extern void sym_dump_symbol _ARGUMENTS(( sym_entry_type *az_symbol_entry )); extern void sym_dump_widget _ARGUMENTS(( XmConst sym_widget_entry_type *az_widget_entry )); extern void sym_dump_argument _ARGUMENTS(( XmConst sym_argument_entry_type *az_argument_entry )); extern void sym_dump_control _ARGUMENTS(( XmConst sym_control_entry_type *az_control_entry )); extern void sym_dump_callback _ARGUMENTS(( XmConst sym_callback_entry_type *az_callback_entry )); extern void sym_dump_list _ARGUMENTS(( XmConst sym_list_entry_type *az_list_entry )); extern void sym_dump_name _ARGUMENTS(( XmConst sym_name_entry_type *az_name_entry )); extern void sym_dump_module _ARGUMENTS(( XmConst sym_module_entry_type *az_module_entry )); extern void sym_dump_color_item _ARGUMENTS(( XmConst sym_color_item_entry_type *az_color_item_entry )); extern void sym_dump_parent_list_item _ARGUMENTS(( XmConst sym_parent_list_type *az_parent_list_item )); extern void sym_dump_external_def _ARGUMENTS(( XmConst sym_external_def_entry_type *az_external_def_entry )); extern void sym_dump_proc_def _ARGUMENTS(( XmConst sym_proc_def_entry_type *az_proc_def_entry )); extern void sym_dump_proc_ref _ARGUMENTS(( XmConst sym_proc_ref_entry_type *az_proc_ref_entry )); extern void sym_dump_forward_ref _ARGUMENTS(( XmConst sym_forward_ref_entry_type *az_forward_ref_entry )); extern void sym_dump_value _ARGUMENTS(( XmConst sym_value_entry_type *az_value_entry )); extern void output_text _ARGUMENTS(( XmConst int length , XmConst char *text )); extern void sym_dump_source_info _ARGUMENTS(( sym_entry_header_type *hdr )); extern void sym_dump_obj_header _ARGUMENTS(( XmConst sym_obj_entry_type *az_obj_entry )); extern void sym_dump_include_file _ARGUMENTS(( sym_include_file_entry_type *az_symbol_entry )); extern void sym_dump_section _ARGUMENTS(( sym_section_entry_type *az_symbol_entry )); extern void sym_dump_object_variant _ARGUMENTS(( sym_def_obj_entry_type *az_symbol_entry )); extern void sym_dump_root_entry _ARGUMENTS(( sym_root_entry_type *az_symbol_entry )); extern char *sym_section_text _ARGUMENTS(( int b_type )); extern void dump_free_list _ARGUMENTS(( void )); extern int sar_get_units_type (yystype *parse_frame); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif /* UilDefI_h */ /* DON'T ADD STUFF AFTER THIS #endif */ motif-2.3.8/clients/uil/UilCmd.c0000644000175000017500000002020013145162623013333 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: UilCmd.c /main/11 1995/07/14 09:32:29 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* **++ ** FACILITY: ** ** User Interface Language Compiler (UIL) ** ** ABSTRACT: ** ** Command line interpreter for the ** **-- **/ /* ** ** INCLUDE FILES ** **/ #include "UilDefI.h" #include "UilCmdDef.h" /* ** ** GLOBAL DECLARATIONS ** **/ externaldef(uil_comp_glbl) cmd_command_line_type Uil_cmd_z_command = { NULL, /* *ac_source_file */ NULL, /* *ac_resource_file */ NULL, /* *ac_listing_file */ 0, /* include_dir_count */ NULL, /* **ac_include_dir */ 1, /* v_listing_file */ 1, /* v_resource_file */ 1, /* v_show_machine_code */ 1, /* v_report_info_msg */ 1, /* v_report_warn_msg */ 1, /* v_parse_tree */ 1, /* v_issue_summary */ 0, /* status_update_delay */ NULL, /* (*message_cb)() */ NULL, /* *message_data */ NULL, /* (*status_cb)() */ NULL, /* *status_data */ 1, /* v_use_setlocal */ NULL, /* *ac_database */ 1 /* v_database */ }; /* **++ ** FUNCTIONAL DESCRIPTION: ** ** This procedure parses the command line and places the ** results of the parse in the global structure "Uil_cmd_z_command". ** ** FORMAL PARAMETERS: ** ** l_arg_count: number of command arguments ** rac_arg_value: array of pointers to null terminated character strings ** each of which is one of the command line arguments ** ** IMPLICIT INPUTS: ** ** none ** ** IMPLICIT OUTPUTS: ** ** Uil_cmd_z_command: respository for command line info ** ** FUNCTION VALUE: ** ** void ** ** SIDE EFFECTS: ** ** Uil_cmd_z_command is set ** **-- **/ void cmd_decode_command_line( l_arg_count, rac_arg_value ) int l_arg_count; char *rac_arg_value[ ]; { static char *include_list [Uil_k_max_include_dir_count]; int i; Uil_cmd_z_command.ac_source_file = NULL; Uil_cmd_z_command.ac_resource_file = NULL; Uil_cmd_z_command.ac_listing_file = NULL; Uil_cmd_z_command.include_dir_count = 0; Uil_cmd_z_command.ac_include_dir = (char **)include_list; Uil_cmd_z_command.v_resource_file = TRUE; Uil_cmd_z_command.v_listing_file = FALSE; Uil_cmd_z_command.v_show_machine_code = FALSE; Uil_cmd_z_command.v_report_info_msg = TRUE; Uil_cmd_z_command.v_report_warn_msg = TRUE; Uil_cmd_z_command.v_parse_tree = FALSE; Uil_cmd_z_command.v_use_setlocale = FALSE; Uil_cmd_z_command.status_update_delay = 0; Uil_cmd_z_command.message_cb = (Uil_continue_type(*)())NULL; Uil_cmd_z_command.status_cb = (Uil_continue_type(*)())NULL; Uil_cmd_z_command.ac_database = NULL; Uil_cmd_z_command.v_database = FALSE; #if debug_version uil_v_dump_tokens = FALSE; uil_v_dump_symbols = FALSE; #endif /* traverse the options on the command line */ for (i = 1; i < l_arg_count; i++) { /* check for an output file */ if ( strcmp("-o", rac_arg_value[ i ]) == 0 ) { /* the next argument is the output file name */ /* check next field is not an option */ if (((i+1) >= l_arg_count) || ( '-' == rac_arg_value[ i+1 ][ 0 ] )) { diag_issue_diagnostic ( d_miss_opt_arg, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ], "output file" ); continue; } if (Uil_cmd_z_command.ac_resource_file == NULL) Uil_cmd_z_command.ac_resource_file = rac_arg_value[ i+1 ]; else diag_issue_diagnostic ( d_dupl_opt, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ] ); i = i + 1; } /* check for a binary database file */ else if ( strcmp("-wmd", rac_arg_value[ i ]) == 0 ) { /* the next argument is the binary database file name */ /* check next field is not an option */ if (((i+1) >= l_arg_count) || ( '-' == rac_arg_value[ i+1 ][ 0 ] )) { diag_issue_diagnostic ( d_miss_opt_arg, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ], "binary database file" ); continue; } if (!Uil_cmd_z_command.v_database) { Uil_cmd_z_command.v_database = TRUE; Uil_cmd_z_command.ac_database = rac_arg_value[ i+1 ]; } else diag_issue_diagnostic ( d_dupl_opt, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ] ); i = i + 1; } /* check for an listing file */ else if ( strcmp("-v", rac_arg_value[ i ]) == 0 ) { /* the next argument is the listing file name */ /* check next field is not an option */ if (((i+1) >= l_arg_count) || ( '-' == rac_arg_value[ i+1 ][ 0 ] )) { diag_issue_diagnostic ( d_miss_opt_arg, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ], "listing file" ); continue; } if (!Uil_cmd_z_command.v_listing_file) { Uil_cmd_z_command.v_listing_file = TRUE; Uil_cmd_z_command.ac_listing_file = rac_arg_value[ i+1 ]; } else diag_issue_diagnostic ( d_dupl_opt, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ] ); i = i + 1; } /* check for the machine code option */ else if ( strcmp("-m", rac_arg_value[ i ]) == 0 ) { Uil_cmd_z_command.v_show_machine_code = TRUE; } /* check if warnings are to be supressed */ else if ( strcmp("-w", rac_arg_value[ i ]) == 0 ) { Uil_cmd_z_command.v_report_info_msg = FALSE; Uil_cmd_z_command.v_report_warn_msg = FALSE; } /* check if setlocale is to be enabled */ else if ( strcmp("-s", rac_arg_value[ i ]) == 0 ) { Uil_cmd_z_command.v_use_setlocale = TRUE; } /* check for an unexpected option */ else if ( '-' == rac_arg_value[ i ][ 0 ] ) { /* check for an include directory */ if ( 'I' == rac_arg_value[ i ][ 1 ] ) { if (Uil_cmd_z_command.include_dir_count < Uil_k_max_include_dir_count) include_list[Uil_cmd_z_command.include_dir_count++] = & rac_arg_value[i] [2]; else diag_issue_diagnostic ( d_too_many_dirs, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ], Uil_k_max_include_dir_count ); } else { diag_issue_diagnostic ( d_unknown_opt, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ] ); } } /* assume it is a UIL source file specification * validation of the file spec is done when file is opened */ else { if (Uil_cmd_z_command.ac_source_file == NULL) Uil_cmd_z_command.ac_source_file = rac_arg_value[ i ]; else diag_issue_diagnostic ( d_add_source, diag_k_no_source, diag_k_no_column, rac_arg_value[ i ] ); } } /* ** Check for a source file - otherwise issue a diagnostic. */ if (Uil_cmd_z_command.ac_source_file == NULL) diag_issue_diagnostic ( d_no_source, diag_k_no_source, diag_k_no_column ); if (Uil_cmd_z_command.ac_resource_file == NULL) { Uil_cmd_z_command.ac_resource_file = XtMalloc (strlen ("a.uid") + 1); strcpy (Uil_cmd_z_command.ac_resource_file,"a.uid"); } /* ** Machine code listing only makes sense if listing is set. */ Uil_cmd_z_command.v_show_machine_code = ( Uil_cmd_z_command.v_listing_file & Uil_cmd_z_command.v_show_machine_code); } motif-2.3.8/clients/uil/Makefile.am0000644000175000017500000000425312672140200014047 00000000000000MAINTAINERCLEANFILES = Makefile.in Uil.cat UilMsgCatI.h EXTRA_DIST = Uil.msg # # I don't seem to have all the pieces to make this thing # bin_PROGRAMS = uil libUil_la_LDFLAGS = -version-info @CURRENT@:@REVISION@:@AGE@ UilParser.lo: UilParser.c $(LTCOMPILE) -DCALLABLE -c UilParser.c libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la INCLUDES = -DINCDIR=\"@INCDIR@\" \ -DLIBDIR=\"@LIBDIR@\" \ -I$(srcdir)/../../include \ -I$(srcdir)/../../lib \ -I$(srcdir)/../../tools/wml \ -I../../include \ -I../../lib \ -I../../tools/wml ${X_CFLAGS} UilParser.c: test -f UilParser.c || $(LN_S) $(srcdir)/UilMain.c UilParser.c UilLexPars.c: $(top_builddir)/tools/wml/Uil.c test -f UilLexPars.c || $(LN_S) $(top_builddir)/tools/wml/Uil.c UilLexPars.c BUILT_SOURCES = UilParser.c UilLexPars.c UilDBDef.h CLEANFILES = UilParser.c UilLexPars.c UilDBDef.h COMMON_SRC = UilCmd.c UilDiags.c UilKeyTab.c UilLexAna.c \ UilLexPars.c UilLstLst.c UilP2Out.c UilP2Reslv.c \ UilSarComp.c UilSarExp.c UilSarInc.c UilSarMod.c \ UilSarObj.c UilSarProc.c UilSarVal.c UilSrcSrc.c \ UilSymNam.c UilSymStor.c UilData.c \ UilLstMac.c UilSemVal.c UilSemCSet.c UilDB.c SRCS = $(COMMON_SRC) SRCS2 = $(COMMON_SRC) UilMain.c HEADERS_1 = Uil.h UilSymGl.h UilSymDef.h \ UilDef.h XmAppl.uil uildir = $(includedir)/uil uil_HEADERS = $(HEADERS_1) noinst_HEADERS = UilCmdDef.h \ UilCompGl.h \ UilDefI.h \ UilDiagDef.h \ UilIODef.h \ UilLexDef.h \ UilMess.h \ UilMessTab.h \ UilSarDef.h \ UilSrcDef.h lib_LTLIBRARIES = libUil.la uil_SOURCES = $(SRCS2) uil_CFLAGS = $(AM_CFLAGS) libUil_la_SOURCES = $(SRCS) libUil_la_DEPENDENCIES = UilDBDef.h UilParser.lo UilDBDef.h: $(LN_S) $(srcdir)/../../tools/wml/UilDBDef.h UilDBDef.h if MessageCatalog $(COMMON_SRC): $(CAT_FILES) CAT_FILES = Uil.cat UilMsgCatI.h $(CAT_FILES): Uil.msg $(mkinstalldirs) $(top_builddir)/localized/C/msg $(top_builddir)/localized/util/mkcatdefs UilMsgCatI.h $(srcdir)/Uil.msg >$(top_builddir)/localized/C/msg/Uil.msg gencat Uil.cat $(top_builddir)/localized/C/msg/Uil.msg endif motif-2.3.8/clients/Makefile.in0000644000175000017500000004637713211512765013315 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = clients ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = xmbind mwm uil all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clients/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign clients/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/clients/mwm/0000755000175000017500000000000013211513006012074 500000000000000motif-2.3.8/clients/mwm/Mwm.msg0000644000175000017500000001272312672140200013273 00000000000000$ $XConsortium: Mwm.msg /main/3 1995/07/19 11:03:31 drk $ $set MS_errors WMCDECOR_MSG_0 Insufficient memory for client window framing WMCDECOR_MSG_1 Error reading Title Elements\n WMERROR_MSG_0 I/O error on display: WMFUNCTION_MSG_0 Cannot restart the window manager WMFUNCTION_MSG_1 Unable to warp to unmanaged screen %d\n WMGRAPHICS_MSG_0 Insufficient memory for graphics data WMIDECOR_MSG_0 Could not make icon to go in icon box WMIDECOR_MSG_1 Insufficient memory for icon creation WMIPLACE_MSG_0 Insufficient memory to create icon box data WMIMAGE_MSG_0 Invalid icon bitmap WMIMAGE_MSG_1 Insufficient memory to bevel icon image WMIMAGE_MSG_2 Can't find bitmap or pixmap file %s WMINITWS_MSG_0 Could not open display. WMINITWS_MSG_1 Insufficient memory for Screen data WMINITWS_MSG_2 Another window manager is running on screen %d WMINITWS_MSG_3 Unable to manage any screens on display. WMINITWS_MSG_4 Cannot configure X connection WMINITWS_MSG_5 WMINITWS_MSG_6 Insufficient memory for Workspace data WMINITWS_MSG_7 Insufficient memory for displayString WMINITWS_MSG_8 Insufficient memory for window manager data WMINITWS_MSG_9 Insufficient memory for screen names WMMENU_MSG_0 Menu specification %s not found\n WMMENU_MSG_1 Insufficient memory for menu %s\n WMMENU_MSG_2 Insufficient memory for menu spec\n WMMENU_MSG_3 Insufficient memory for menu item %s\n WMMENU_MSG_4 Menu recursion detected for %s\n WMPROPERTY_MSG_0 Insufficient memory for window management data WMPROPERTY_MSG_1 Insufficient memory for window manager flags WMPROTOCOL_MSG_0 Insufficient memory to XInternAtom _MOTIF_WM_QUERY_nn WMPROTOCOL_MSG_1 Failed to own _MOTIF_WM_QUERY_nn selection WMPROTOCOL_MSG_2 Lost _MOTIF_WM_QUERY_nn selection WMPROTOCOL_MSG_3 Insufficient memory to convert _MOTIF_WM_QUERY_nn selection WMPROTOCOL_MSG_4 Failed to own WM_nn selection WMPROTOCOL_MSG_5 Got convert request from screen I don't manage! WMPROTOCOL_MSG_6 Conversion request made for unknown target type WMPROTOCOL_MSG_7 Conversion request received for unknown selection WMRESPARSE_MSG_0 Cannot open configuration file WMRESPARSE_MSG_1 Insufficient memory for menu accelerators WMRESPARSE_MSG_2 Insufficient memory to get LANG environment variable. WMRESPARSE_MSG_3 Insufficient memory for menu WMRESPARSE_MSG_4 Expected '{' after menu name WMRESPARSE_MSG_5 Insufficient memory for menu item label WMRESPARSE_MSG_6 Insufficient memory for menu item WMRESPARSE_MSG_7 Invalid mnemonic specification WMRESPARSE_MSG_8 Insufficient memory for accelerator specification WMRESPARSE_MSG_9 Invalid accelerator specification WMRESPARSE_MSG_10 Insufficient memory WMRESPARSE_MSG_11 Missing group specification WMRESPARSE_MSG_12 Invalid group specification WMRESPARSE_MSG_13 Invalid number specification WMRESPARSE_MSG_14 Expected '{' after button set name WMRESPARSE_MSG_15 Insufficient memory for button specification WMRESPARSE_MSG_16 Invalid button specification WMRESPARSE_MSG_17 Invalid button context WMRESPARSE_MSG_18 Expected '{' after key set name WMRESPARSE_MSG_19 Insufficient memory for key specification WMRESPARSE_MSG_20 Invalid key specification WMRESPARSE_MSG_21 Invalid key context WMRESPARSE_MSG_22 %s: %s on line %d of configuration file \"%s\"\n WMRESPARSE_MSG_23 %s: %s on line %d of specification string\n WMRESPARSE_MSG_24 Insufficient memory for screen names WMRESOURCE_MSG_0 failed to load font: %.100s WMRESOURCE_MSG_1 cannot find an appropriate font: %.100s WMRESOURCE_MSG_2 Insufficient memory for window manager data WMRESOURCE_MSG_3 Key bindings %s not found, using builtin key bindings\n WMRESOURCE_MSG_4 Button bindings %s not found, using builtin button bindings\n WMSESSION_MSG_0 Session Manager Error: %s\n WMSESSION_MSG_1 Session Manager Warning: %s\n WMSESSION_MSG_2 Not enough memory to get text property. WMSESSION_MSG_3 No client leader for subwindow. Setting clientLeader field. WMSESSION_MSG_4 Not enough memory to create new orphan. WMSESSION_MSG_5 Not enough memory to create new alien. WMSESSION_MSG_6 Not enough memory to create new missingChild. WMSESSION_MSG_7 Not enough memory to add new client leader. WMSESSION_MSG_8 Not enought memory to create client list. WMSESSION_MSG_9 Insufficient memory to XInternAtom WM_nn WMSESSION_MSG_10 Failed to own WM_nn selection WMSESSION_MSG_11 Missing child found mismarked client leader window. WMWININFO_MSG_0 [XmbTextPropertyToTextList]:\n Locale (%.100s) not supported. (Check $LANG). WMWININFO_MSG_1 Insufficient memory for client data WMWININFO_MSG_2 Couldn't make icon box WMWININFO_MSG_3 mwm cannot convert property %.100s as clientTitle/iconTitle: XmbTextPropertyToTextList. WMWININFO_MSG_4 insufficient memory to convert property %.100s as clientTitle/iconTitle: XmbTextPropertyToTextList. WMWININFO_MSG_5 mwm receives unknown property as clientTitle/iconName : %.100s property ignored. WMWININFO_MSG_6 Retrying - using builtin window menu\n WMWINSTATE_MSG_0 Error: Divide by 0 in SetMwmIconInfo\n WMWSM_MSG_0 Error: The selection owner does not understand the WSM protocol.\n WMWSM_MSG_1 Error: No one owns selection.\n WMWSM_MSG_2 Error: Owner of the WSM selection timed out.\n WMWSM_MSG_3 Error: This request requires configuration format.\n WMWSM_MSG_4 Error: This request cannot be sent after a config format request.\n WMWSM_MSG_5 Internal Error: No reply received.\n WMWSM_MSG_6 Unknown message type\n WMWSM_MSG_7 Error occurred sending message to wsm. CLIENTPROPS_MSG_0 %s: can't open %s.\n CLIENTPROPS_MSG_1 Received %s message: %s\n $set MS_labels WMICONBOX_MSG_0 \"Pack Icons\" _P Shift AltF7 f.pack_icons\n motif-2.3.8/clients/mwm/WmMenu.c0000644000175000017500000037736013145162623013423 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmMenu.c /main/15 1996/11/20 15:20:17 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmCEvent.h" #include "WmResource.h" #include "WmResParse.h" #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # include "WmDebug.h" #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define SHELL_NAME "menu" #define SEPARATOR_NAME "separator" #define TITLE_NAME "title_name" #define CASCADE_BTN_NAME "cascadebutton" #define PUSH_BTN_NAME "pushbutton" #define CHILDREN_CACHE 22 #define MENU_BUTTON_INC 5 /* * include extern functions */ #include "WmMenu.h" #include "WmCDecor.h" #include "WmColormap.h" #include "WmEvent.h" #include "WmFunction.h" #include "WmIconBox.h" #include "WmImage.h" #include "WmError.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ static void UnmapCallback (Widget w, XtPointer client_data, XtPointer call_data); static MenuItem *DuplicateMenuItems (MenuItem *menuItems); #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) static MenuExclusion *DuplicateMenuExclusions(MenuExclusion *exclusions); static Boolean FindClientCommandMatch (MenuSpec *menuSpec, String clientCommand, MenuItem **menuItem); static void InsertTreeOnClient (WmScreenData *pSD, ClientData *pCD, CmdTree *tree, MatchList **client_match_list, MatchList **global_match_list, MenuSpec *menuSpec, MenuItem *template, String command_so_far, Boolean duplicate_globals, Atom selection, Context greyed_context, Boolean inLine); static MenuSpec *MakeMenuSpec (String menuName, CARD32 commandID); static void UnmapPulldownCallback (Widget w, XtPointer client_data, XtPointer call_data); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * MakeMenu (menuName, initialContext, accelContext, moreMenuItems, * fSystemMenu) * * * Description: * ----------- * This function makes a menu widget. * * * Inputs: * ------ * menuName = name of the top-level menu pane for the menu * initialContext = initial context for menuitem sensitivity * accelContext = accelerator context * moreMenuItems = additional menuitems for custom menu. * fSystemMenu = TRUE iff the menu is a client system menu. * * * Outputs: * ------- * Return = pointer to a MenuSpec structure with updated currentContext, * menuWidget, and menuButtons members. * * * Comments: * -------- * If moreMenuItems is nonNULL, a custom MenuSpec will be created, with * menuItem member pointing to moreMenuItems. The menuItems for the * standard MenuSpec of the same name and the moreMenuItems list will be * used to create menubuttons, and the menu widget will be separate from * any existing standard menu widget. * * When the client is destroyed, this custom MenuSpec, its menuItem and * menuButton lists, and its menu widget should be freed. * *************************************<->***********************************/ MenuSpec *MakeMenu (WmScreenData *pSD, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) ClientData *pCD, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ String menuName, Context initialContext, Context accelContext, MenuItem *moreMenuItems, Boolean fSystemMenu) { unsigned int n; MenuSpec *menuSpec; MenuSpec *newMenuSpec; MenuItem *menuItem; KeySpec *accelKeySpec; if ((menuName == NULL) || (pSD == NULL)) { return (NULL); } /* * Look for the menu specification: */ menuSpec = pSD->menuSpecs; while (menuSpec) { if ((menuSpec->name != NULL) && !strcmp (menuSpec->name, menuName)) /* Found the menu pane. */ { break; } menuSpec = menuSpec->nextMenuSpec; } if (menuSpec == NULL) /* the menuSpecs list is exhausted */ { MWarning(((char *)GETMESSAGE(48, 1, "Menu specification %s not found\n")), menuName); return (NULL); } /* * The top-level menu pane specification was found. * Adjust the menu accelerator context? */ if (fSystemMenu) { accelContext = 0; } else if (accelContext & F_CONTEXT_ROOT) /* root context accelerators apply everywhere */ { accelContext = F_CONTEXT_ALL; } /* * If making a custom menu, create a custom copy of the specification with * which to build the custom menu. * Otherwise, if the menu widget exists, possibly modify the accelerator * contexts and return the specification. */ if (moreMenuItems != NULL) { #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) if ((newMenuSpec = DuplicateMenuSpec(menuSpec)) == (MenuSpec *)NULL) return NULL; #else if ((newMenuSpec = (MenuSpec *) XtMalloc (sizeof (MenuSpec))) == NULL) /* Handle insufficent memory */ { MWarning(((char *)GETMESSAGE(48, 2, "Insufficient memory for menu %s\n")), menuName); return (NULL); } newMenuSpec->name = NULL; /* distinguishes this as custom */ newMenuSpec->whichButton = SELECT_BUTTON; newMenuSpec->height = 0; newMenuSpec->menuItems = menuSpec->menuItems; /* temporary */ newMenuSpec->accelContext = menuSpec->accelContext; newMenuSpec->accelKeySpecs = NULL; newMenuSpec->nextMenuSpec = NULL; #endif menuSpec = newMenuSpec; } else if (menuSpec->menuWidget) { /* * OR the accelContext into the accelerators, if necessary. */ if (accelContext != (menuSpec->accelContext & accelContext)) { menuSpec->accelContext |= accelContext; accelKeySpec = menuSpec->accelKeySpecs; while (accelKeySpec) { accelKeySpec->context |= accelContext; accelKeySpec = accelKeySpec->nextKeySpec; } } return (menuSpec); } /* * We have a menu specification with which to build the menu. * Set the initial and accelerator contexts -- they are needed within * CreateMenuWidget. */ menuSpec->currentContext = initialContext; menuSpec->accelContext = accelContext; /* * Scan the toplevel MenuSpec and create its initial menuButtons array * if any of its items will need to be included. This array will be * created or enlarged within CreateMenuWidget below if necessary. */ n = 0; menuItem = menuSpec->menuItems; while (menuItem) { if ((menuItem->greyedContext) || (menuItem->mgtMask)) { n++; } menuItem = menuItem->nextMenuItem; } menuItem = moreMenuItems; while (menuItem) { if ((menuItem->greyedContext) || (menuItem->mgtMask)) { n++; } menuItem = menuItem->nextMenuItem; } if (n) { if ((menuSpec->menuButtons = (MenuButton *) XtMalloc (n * sizeof(MenuButton))) == NULL) /* insufficent memory */ { MWarning(((char *)GETMESSAGE(48, 3, "Insufficient memory for menu %s\n")), menuName); return (NULL); } menuSpec->menuButtonSize = n; } else { menuSpec->menuButtons = NULL; menuSpec->menuButtonSize = 0; } menuSpec->menuButtonCount = 0; /* * Create a PopupShell widget as a child of the workspace manager widget * and a PopupMenu as a child of the shell. * Fill the PopupMenu with the menu items. */ menuSpec->menuWidget = CREATE_MENU_WIDGET (pSD, pCD, menuName, pSD->screenTopLevelW, TRUE, menuSpec, moreMenuItems); if (menuSpec->menuWidget == NULL) { /* * Could not make the top-level menu pane. */ return (NULL); } /* _XmSetPopupMenuClick(menuSpec->menuWidget, False); */ /* Return the top MenuSpec */ return (menuSpec); } /* END OF FUNCTION MakeMenu */ /*************************************<->***********************************/ void CheckTerminalSeparator(menuSpec, buttonWidget, manage) MenuSpec *menuSpec; Widget buttonWidget; Boolean manage; { CompositeWidget cw; WidgetList children; Cardinal wPos; if ((menuSpec == NULL) || (menuSpec->menuWidget == NULL)) { return; } cw = (CompositeWidget)menuSpec->menuWidget; children = cw->composite.children; for (wPos = 0; wPos < cw->composite.num_children; wPos++) { if((Widget)children[wPos] == buttonWidget) { break; } } if(wPos > 0 && XtClass((Widget) children[wPos -1]) == xmSeparatorGadgetClass) { if(manage) { if (!(XtIsManaged((Widget)children[wPos -1]))) { XtManageChild((Widget)children[wPos -1]); } } else { if (XtIsManaged((Widget)children[wPos -1])) { XtUnmanageChild((Widget)children[wPos -1]); } } } } /* END OF FUNCTION CheckTerminalSeparator */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * MakeMenuSpec (menuName, commandID) * * * * Description: * ----------- * This function creates and returns a MenuSpec structure. * * * Inputs: * ------ * menuName = name of the menu specification * commandID = client command id of the menu item to build. * 0 if not for a client command. * * * Outputs: * ------- * Return = pointer to a MenuSpec structure with zero'ed fields. * * * Comments: * -------- * A new MenuSpec structure is allocated. The name is set to the * menuName argument. The menuItems list, menuButtons list and * accelerator related fields are zero'ed out to NULL values. * *************************************<->***********************************/ static MenuSpec * MakeMenuSpec (String menuName, CARD32 commandID) { MenuSpec *menuSpec; if ((menuSpec = (MenuSpec *) XtMalloc (sizeof (MenuSpec))) == NULL) /* Handle insufficent memory */ { MWarning(((char *)GETMESSAGE(48, 2, "Insufficient memory for menu %s\n")), menuName); return (NULL); } menuSpec->name = XtNewString(menuName); menuSpec->currentContext = F_CONTEXT_ALL; menuSpec->menuWidget = (Widget) NULL; menuSpec->whichButton = SELECT_BUTTON; menuSpec->height = 0; menuSpec->menuItems = (MenuItem *) NULL; menuSpec->menuButtons = (MenuButton *) NULL; menuSpec->menuButtonSize = 0; menuSpec->menuButtonCount = 0; menuSpec->accelContext = F_CONTEXT_ALL; menuSpec->accelKeySpecs = (KeySpec *) NULL; menuSpec->exclusions = (MenuExclusion *) NULL; menuSpec->clientLocal = FALSE; menuSpec->commandID = commandID; menuSpec->nextMenuSpec = (MenuSpec *) NULL; return(menuSpec); } #endif /*************************************<->************************************* * * DuplicateMenuItems (menuItems) * * * * Description: * ----------- * This function creates an indentical duplicate of the given menuItems * list. * * * Inputs: * ------ * menuItems = the linked list of menuItems to duplicate * * * Outputs: * ------- * Return = pointer to a new MenuItems list, identical to the original * * * Comments: * -------- * *************************************<->***********************************/ static MenuItem * DuplicateMenuItems (MenuItem *menuItems) { MenuItem *newMenuItem = (MenuItem *) NULL, *returnMenuItem = NULL, *curMenuItem; for (curMenuItem = menuItems; curMenuItem != (MenuItem *) NULL; curMenuItem = curMenuItem->nextMenuItem) { /* If its the first one ... */ if (newMenuItem == (MenuItem *) NULL) { newMenuItem = (MenuItem *)XtMalloc(sizeof(MenuItem)); returnMenuItem = newMenuItem; } else /* ... otherwise, get the next menuItem. */ { newMenuItem->nextMenuItem = (MenuItem *)XtMalloc(sizeof(MenuItem)); newMenuItem = newMenuItem->nextMenuItem; } newMenuItem->labelType = curMenuItem->labelType; if (curMenuItem->label != (String) NULL) newMenuItem->label = XtNewString(curMenuItem->label); else newMenuItem->label = NULL; newMenuItem->labelBitmapIndex = curMenuItem->labelBitmapIndex; newMenuItem->mnemonic = curMenuItem->mnemonic; newMenuItem->accelState = curMenuItem->accelState; newMenuItem->accelKeyCode = curMenuItem->accelKeyCode; if (curMenuItem->accelText != (String) NULL) newMenuItem->accelText = XtNewString(curMenuItem->accelText); else newMenuItem->accelText = NULL; newMenuItem->wmFunction = curMenuItem->wmFunction; if ((curMenuItem->wmFunction == F_Send_Msg) || (curMenuItem->wmFunction == F_Circle_Up) || (curMenuItem->wmFunction == F_Circle_Down) #ifdef WSM || (curMenuItem->wmFunction == F_Set_Context) # ifdef PANELIST /* * NOTE: For now, in dtwm this function is used only * to copy the FrontPanel menu. So, we know that * curMenuItem->wmFuncArgs isn't going anywhere, * so it's safe to simply point at it. If at some * point it becomes possible that curMenuItem->wmFuncArgs * can go away, we'll need to make a (deep) copy of * the WmActionArg. 11/20/96 */ || (curMenuItem->wmFunction == F_Action) # endif /* PANELIST */ #endif /* WSM */ ) newMenuItem->wmFuncArgs = curMenuItem->wmFuncArgs; else if (curMenuItem->wmFuncArgs != (String) NULL) newMenuItem->wmFuncArgs = XtNewString(curMenuItem->wmFuncArgs); else newMenuItem->wmFuncArgs = NULL; newMenuItem->greyedContext = curMenuItem->greyedContext; newMenuItem->mgtMask = curMenuItem->mgtMask; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) newMenuItem->clientCommandName = XtNewString(curMenuItem->clientCommandName); newMenuItem->clientCommandID = curMenuItem->clientCommandID; #endif newMenuItem->nextMenuItem = (MenuItem *) NULL; } return(returnMenuItem); } #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * DuplicateMenuExclusions (exclusions) * * * * Description: * ----------- * This function creates an indentical duplicate of the given menu exclusions * list. * * * Inputs: * ------ * exclusions = the linked list of menu exclusions to duplicate * * * Outputs: * ------- * Return = pointer to a new MenuExclusion list, identical to the original * * * Comments: * -------- * *************************************<->***********************************/ static MenuExclusion * DuplicateMenuExclusions (MenuExclusion *exclusions) { MenuExclusion *newMenuExclusion = (MenuExclusion *) NULL; MenuExclusion *returnMenuExclusion = (MenuExclusion *) NULL; MenuExclusion *curMenuExclusion = (MenuExclusion *) NULL; for (curMenuExclusion = exclusions; curMenuExclusion != (MenuExclusion *) NULL; curMenuExclusion = curMenuExclusion->nextExclusion) { /* If its the first one ... */ if (newMenuExclusion == (MenuExclusion *) NULL) { newMenuExclusion = (MenuExclusion *)XtMalloc(sizeof(MenuExclusion)); returnMenuExclusion = newMenuExclusion; } else /* ... otherwise, get the next menuExclusion. */ { newMenuExclusion->nextExclusion = (MenuExclusion *)XtMalloc(sizeof(MenuExclusion)); newMenuExclusion = newMenuExclusion->nextExclusion; } newMenuExclusion->command_string = XtNewString(curMenuExclusion->command_string); } /* Make sure we properly NULL terminate the list. */ if (newMenuExclusion != (MenuExclusion *) NULL) newMenuExclusion->nextExclusion = (MenuExclusion *) NULL; return(returnMenuExclusion); } #endif /*************************************<->************************************* * * DuplicateMenuSpec (menuSpec) * * * * Description: * ----------- * This function creates an indentical duplicate of the given menuSpec. * The menuItems list in the menuSpec is also duplicated. * * * Inputs: * ------ * menuSpec = the menuSpec to duplicate * * * Outputs: * ------- * Return = pointer to a new MenuSpec structure with the same field * values as the original * * * Comments: * -------- * A new MenuSpec structure is allocated. Most of he fields of the new * structure are set to the same values as the passed in menuSpec. * There are some differences between the two final structures. * One difference: any fields related to push buttons and other * widgets are left blank in the new MenuSpec to be filled in later. * *************************************<->***********************************/ MenuSpec * DuplicateMenuSpec (MenuSpec *menuSpec) { MenuSpec *newMenuSpec; if ((newMenuSpec = (MenuSpec *) XtMalloc (sizeof (MenuSpec))) == NULL) /* Handle insufficent memory */ { Warning((char *)GETMESSAGE(48, 9, "Insufficient memory for menu specification\n")); return (NULL); } newMenuSpec->name = XtNewString(menuSpec->name); newMenuSpec->currentContext = menuSpec->currentContext; newMenuSpec->menuWidget = (Widget) NULL; newMenuSpec->whichButton = menuSpec->whichButton; newMenuSpec->height = menuSpec->height; newMenuSpec->menuItems = DuplicateMenuItems(menuSpec->menuItems); newMenuSpec->menuButtons = (MenuButton *) NULL; newMenuSpec->menuButtonSize = 0; newMenuSpec->menuButtonCount = 0; newMenuSpec->accelContext = menuSpec->accelContext; newMenuSpec->accelKeySpecs = (KeySpec *) NULL; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) newMenuSpec->exclusions = DuplicateMenuExclusions(menuSpec->exclusions); newMenuSpec->clientLocal = TRUE; newMenuSpec->commandID = menuSpec->commandID; #endif newMenuSpec->nextMenuSpec = (MenuSpec *) NULL; return(newMenuSpec); } #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * MakeMenuItem (label, wmFunction, funcArgs, mnemonic, accelText) * * * Description: * ----------- * This function creates and returns a MenuItem structure. * * * Inputs: * ------ * label = the display name of the menu item * wmFunction = the wm function to invoke * funcArgs = the function arguments to pass to the wm function * mnemonic = the mnemonic keysym * accelText = the accelerator text * * Outputs: * ------- * Return = pointer to a new MenuItem structure with fields filled * in as per passed arguments * * * Comments: * -------- * This function is actually used as the underlying mechanism for * MenuItem creation by MakeMenuItemFromTemplate and * MakeClientCommandMenuItem. * * Assumptions: * ----------- * This function assumes that ParseWmAccelerator simply takes a pointer * to a string and parses the accelerator found in it. If ParseWmAccelerator * is ever modified to call GetString to get more text from the parse * stream (as other parse functions do) then this code will break. * *************************************<->***********************************/ static MenuItem * MakeMenuItem (String label, WmFunction wmFunction, String funcArgs, KeySym mnemonic, unsigned int accelState, KeyCode accelKeyCode, String accelText) { MenuItem *menuItem; /* unsigned char *copy_of_accelText; */ if ((menuItem = (MenuItem *) XtMalloc (sizeof (MenuItem))) == NULL) /* Handle insufficent memory */ { MWarning(((char *)GETMESSAGE(48, 10, "Insufficient memory for menu item %s\n")), label); return (NULL); } menuItem->labelType = XmSTRING; menuItem->label = XtNewString(label); menuItem->labelBitmapIndex = -1; menuItem->mnemonic = mnemonic; menuItem->clientCommandName = NULL; menuItem->clientCommandID = 0; /* copy_of_accelText = (unsigned char *)XtNewString(accelText); ParseWmAccelerator(©_of_accelText, menuItem); */ menuItem->accelState = accelState; menuItem->accelKeyCode = accelKeyCode; menuItem->accelText = XtNewString(accelText); menuItem->wmFunction = wmFunction; menuItem->wmFuncArgs = XtNewString(funcArgs); SetGreyedContextAndMgtMask(menuItem, wmFunction); menuItem->nextMenuItem = (MenuItem *) NULL; return(menuItem); } /*************************************<->************************************* * * MakeMenuItemFromTemplate (template, name, funcArgs) * * * Description: * ----------- * This function creates and returns a MenuItem structure. * * * Inputs: * ------ * template = a template menuItem used to fill in fields of the * new menu item * name = the display name this item should have * funcArgs = the function arguments to pass to the wm function * * Outputs: * ------- * Return = pointer to a new MenuItem structure with fields filled * in as per template MenuItem and funcargs * * * Comments: * -------- * This function uses the values in the template MenuItem to create * a new copy of the template with the given funcArgs. * *************************************<->***********************************/ static MenuItem *MakeMenuItemFromTemplate (MenuItem *template, String name, String funcArgs) { if (template->clientCommandName == (String) NULL) return(MakeMenuItem(name, template->wmFunction, funcArgs, template->mnemonic, template->accelState, template->accelKeyCode, template->accelText)); return(MakeMenuItem(template->clientCommandName, template->wmFunction, funcArgs, template->mnemonic, template->accelState, template->accelKeyCode, template->accelText)); } /*************************************<->************************************* * * MakeClientCommandMenuItem (label, funcArgs) * * * Description: * ----------- * This function creates and returns a MenuItem structure filled as * appropriate for client command menu items using the given label * and funcArgs. * * * Inputs: * ------ * label = the display label for this menu item * funcArgs = the function arguments to pass to the wm function * * Outputs: * ------- * Return = pointer to a new MenuItem structure with fields filled * in as per arguments and client command specs * * * Comments: * -------- * This function will fill in a new MenuItem structure as appropriate for * client commands. This function is used when you want to insert a client * command into a menu without using a MenuItem template constructed from * mwmrc. * *************************************<->***********************************/ static MenuItem *MakeClientCommandMenuItem (String label, String funcArgs) { return(MakeMenuItem(label, F_InvokeCommand, funcArgs, (KeySym)(unsigned)NULL, (unsigned int)0, (KeyCode)(unsigned)NULL, (String)NULL)); } /*************************************<->************************************* * * PerformClientCommandMatch (clientCommand, menuItem, bestMatchSoFar) * * * Description: * ----------- * This function determines whether the menuItemCommand specification * matches the clientCommand. * * Inputs: * ------ * clientCommand = the clientCommand that we want to find a specification for * menuItem = the menu item we will look in for a specification * bestMatchSoFar = the menu item we will return if the given menu item is * not a match or not a better match * * Outputs: * ------- * Return = pointer to the given menuItem if it contains a client command * specification and if that specification matches the given * clientCommand *and* if the match is a better match than * the bestMatchSoFar. Otherwise, the bestMatchSoFar is returned, * which could possibly be NULL. * * Comments: * -------- * If the menuItem does match, it also determines whether it is * a better match than the bestMatchSoFar. If so, the menuItemCommand is * returned. Otherwise, bestMatchSoFar is returned. * * Best matching is defined as follows: * 1. A specification with fewer wildcards is considered a better * match than one with more wildcards. * 2. Given two specifications with the same number of wildcards, * the specification with its wildcards more towards the right * than the left is considered a better match. * *************************************<->***********************************/ /* @RGC: This is kind of arbitrary, but I can't imagine there being more than a small number of segments in any given command specification. */ #define MAXSEGMENTS 100 static MenuItem *PerformClientCommandMatch (String clientCommand, MenuItem *menuItem, MenuItem *bestMatchSoFar) { String menuItemCommand, bestMatchStr; int seglength, i; int segments = 0, wildcards = 0, wildcardPositions[MAXSEGMENTS]; int bestSegments = 0, bestWildcards = 0; int bestWildcardPositions[MAXSEGMENTS]; Boolean foundWildcard = FALSE; if (menuItem == (MenuItem *) NULL) return(bestMatchSoFar); menuItemCommand = menuItem->label; /* Skip any modifier characters at the beginning of the menu items client command. */ /* @RGC: This is kind of kludgy. We shouldn't have to know the specifics of command parsing here. */ if (menuItemCommand[0] == '~') ++menuItemCommand; else if (menuItemCommand[0] == '=' && menuItemCommand[1] == '>') menuItemCommand += 2; else if (menuItemCommand[0] == '=') ++menuItemCommand; else if (menuItemCommand[0] == '-' && menuItemCommand[1] == '>') menuItemCommand += 2; /* If the menu item doesn't even contain a client command spec, then just return the existing best match. */ if (*menuItemCommand != '<') return(bestMatchSoFar); /* Run down the clientCommand and the menuItemCommand together, matching along the way. If matching fails at any point, then return the bestMatchSoFar. */ for (segments = 0; *menuItemCommand != '\0' && *clientCommand != '\0'; ++segments) { /* Skip past the '<' at the beginning of the next segment and any whitespace. */ ++menuItemCommand; ++clientCommand; while (isspace(*menuItemCommand)) ++menuItemCommand; while (isspace(*clientCommand)) ++clientCommand; /* First check whether the current menuItemCommand segment is a wildcard. */ if (*menuItemCommand == '*') { /* Since the menuItemCommand segment is a wildcard, skip it and the current segment of the client command since the wildcard has to match at least one segment in the client command. */ wildcardPositions[wildcards++] = segments; ++menuItemCommand; while (isspace(*menuItemCommand)) ++menuItemCommand; while (*clientCommand != '>' && *clientCommand != '\0') ++clientCommand; foundWildcard = TRUE; } else { /* Calculate how long the current segment of the menuItemCommand is */ for (seglength = 0; menuItemCommand[seglength] != '>' && menuItemCommand[seglength] != '\0'; ++seglength) /*EMPTY*/; /* If we are pointing at '\0', then this isn't a match */ if (menuItemCommand[seglength] == '\0') return(bestMatchSoFar); /* Get rid of trailing white space on the segment. */ for (; seglength > 0; --seglength) { if (!isspace(menuItemCommand[seglength - 1])) break; } /* Now string compare this segment with the clientCommand segment, up to the number of characters in the menu item segment. */ if (strncmp(menuItemCommand, clientCommand, seglength) == 0) { /* So far so good. Just make sure clientCommand doesn't have anything but whitespace after its seglength character. */ clientCommand += seglength; while (isspace(*clientCommand)) ++clientCommand; if (*clientCommand != '>') return(bestMatchSoFar); /* We have a match. Clear the foundWildcard since we have sync'ed up and keep trying to match. */ foundWildcard = FALSE; menuItemCommand += seglength; while (isspace(*menuItemCommand)) ++menuItemCommand; } else if (foundWildcard == FALSE) { /* We didn't match and there wasn't wildcard to swallow the discrepancy. Therefore, this is not a match. */ return(bestMatchSoFar); } } /* We finished the current segments, we should be looking at a close bracket and a following period or a close bracket and a following NULL. Skip past the close brackets and optional period. If we don't see those, then this isn't a match. */ if (menuItemCommand[0] == '>' && menuItemCommand[1] == '\0' && clientCommand[0] == '>' && clientCommand[1] == '\0') { ++menuItemCommand; ++clientCommand; } else if (menuItemCommand[0] == '>' && menuItemCommand[1] == '.' && clientCommand[0] == '>' && clientCommand[1] == '.') { menuItemCommand += 2; clientCommand += 2; } else return(bestMatchSoFar); } /* If we terminated the loop because only one of the two commands being compared was empty, then we don't have a complete match. Return the best match so far. */ if (*menuItemCommand != '\0' || *clientCommand != '\0') return(bestMatchSoFar); /* So the menuItemCommand must have matched. If the current best match is NULL, then just return the menuItem. Otherwise calculate some matching quality metrics for the bestMatchSoFar and compare them to the menuItemCommand metrics to decide which of the two to return. */ if (bestMatchSoFar == (MenuItem *) NULL) return(menuItem); bestMatchStr = bestMatchSoFar->label; /* Skip any modifier characters at the beginning of the best match client command. */ /* @RGC: This is kind of kludgy. We shouldn't have to know the specifics of command parsing here. */ if (bestMatchStr[0] == '~') ++bestMatchStr; else if (bestMatchStr[0] == '=' && bestMatchStr[1] == '>') bestMatchStr += 2; else if (bestMatchStr[0] == '=') ++bestMatchStr; else if (bestMatchStr[0] == '-' && bestMatchStr[1] == '>') bestMatchStr += 2; /* If the best match doesn't even contain a client command spec, then just return the new match as the best match. */ if (*bestMatchStr != '<') return(menuItem); for (bestSegments = 0; *bestMatchStr != '\0'; ++bestSegments) { /* Skip past the '<' at the beginning of the next segment and any whitespace. */ ++bestMatchStr; while (isspace(*bestMatchStr)) ++bestMatchStr; /* First check whether the current bestMatchStr segment is a wildcard. @RGC: We are assuming that there is nothing but possible whitespace after the *. */ if (*bestMatchStr == '*') bestWildcardPositions[bestWildcards++] = bestSegments; while (*bestMatchStr != '>' && *bestMatchStr != '\0') ++bestMatchStr; /* Check for the closing > and . or close > and NULL. If they do not both appear then the bestMatch is bad and we should return the menuItem. */ if (bestMatchStr[0] == '>' && bestMatchStr[1] == '\0') ++bestMatchStr; else if (bestMatchStr[0] == '>' && bestMatchStr[1] == '.') bestMatchStr += 2; else return(menuItem); } /* Now compare the best match metrics with the menu item metrics to determine who should be returned. */ if (bestWildcards != wildcards) { /* Return the menuItem with the fewest wildcards. */ return(bestWildcards < wildcards ? bestMatchSoFar : menuItem); } else { /* Find which menu item has the earliest wild card and return the other. */ for (i = 0; i < wildcards; ++i) if (wildcardPositions[i] != bestWildcardPositions[i]) { return(bestWildcardPositions[i] < wildcardPositions[i] ? bestMatchSoFar : menuItem); } /* If we got this far, then the two specifications are too close to call. Return bestMatchSoFar. */ return(bestMatchSoFar); } } /*************************************<->************************************* * * ExcludeClientCommand (menuSpec, clientCommand) * * * Description: * ----------- * * Inputs: * ------ * menuSpec = the menuSpec whose menuItems we want to search through * clientCommand = the clientCommand that we want to find an exclusion for * * Outputs: * ------- * Return = TRUE if the command must be excluded from the menuSpec. * FALSE if there is no exclusion preventing the insertion. * * Comments: * -------- * *************************************<->***********************************/ static Boolean ExcludeClientCommand (MenuSpec *menuSpec, String clientCommand) { MenuItem placeholder; MenuExclusion *curExclusion; /* Search for an exclusion that would cause this command to be excluded, if any such exclusion exists. */ for (curExclusion = menuSpec->exclusions; curExclusion != (MenuExclusion *) NULL; curExclusion = curExclusion->nextExclusion) { /* We don't have menu items for exclusions so just use a bogus placeholder menu item with the label field set to the string found in the exclusion. */ placeholder.label = curExclusion->command_string; /* If we don't get NULL back, then this exclusion matches. */ if (PerformClientCommandMatch(clientCommand, &placeholder, NULL) != (MenuItem *) NULL) { return(TRUE); } } return(FALSE); } /*************************************<->************************************* * * ForceInLineToCascade (menuSpec, clientCommand, bestMatch) * * * Description: * ----------- * * Inputs: * ------ * menuSpec = the menuSpec whose menuItems we want to search through * clientCommand = the clientCommand that we want to find an force for * bestMatch = the best matching menu item that was found * * Outputs: * ------- * Return = TRUE if the command set must be cascaded * FALSE if there is no forced cascade * * Comments: * -------- * *************************************<->***********************************/ static Boolean ForceInLineToCascade (MenuSpec *menuSpec, String clientCommand, MenuItem **bestMatch) { /* First find the best match in the menu spec. */ FindClientCommandMatch(menuSpec, clientCommand, bestMatch); /* If the best match is not NULL, then check whether it forces the client command to cascade. */ if (*bestMatch != (MenuItem *) NULL) { /* If there is a force cascade modifier, then return TRUE. */ if ((strncmp((*bestMatch)->label, "->", 2) == 0) || (strncmp((*bestMatch)->label, "=>", 2) == 0)) return(TRUE); } /* If the best match is NULL, then return FALSE. We have been given no indication that the inLine command should be forced to cascade. */ return(FALSE); } /*************************************<->************************************* * * FindClientCommandMatch (menuSpec, clientCommand, menuItem) * * * Description: * ----------- * This function searches through the list of menuItems in the given * menuSpec, searching for ones which have a client command specification * and, for each one that does, whether that specification matches the * given client. The best matching menuItem out of all that matched * is returned. * * Inputs: * ------ * menuSpec = the menuSpec whose menuItems we want to search through * clientCommand = the clientCommand that we want to find a specification for * menuItem = the best matching menu item * * Outputs: * ------- * Return = TRUE if the command may be inserted into the menuSpec. * FALSE if there is an exclusion preventing the insertion. * Also return the best matching menu item in the menuItem * buffer argument. NULL is returned if no matching MenuItem * can be found. * * Comments: * -------- * Best matching is defined as follows: * 1. A specification with fewer wildcards is considered a better * match than one with more wildcards. * 2. Given two specifications with the same number of wildcards, * the specification with its wildcards more towards the right * than the left is considered a better match. * *************************************<->***********************************/ static Boolean FindClientCommandMatch (MenuSpec *menuSpec, String clientCommand, MenuItem **menuItem) { MenuItem *bestMatch = (MenuItem *) NULL, *curMenuItem, placeholder; MenuItem *bestExclusionItem = (MenuItem *) NULL; MenuExclusion *curExclusion; String bestExclusionStr = (String) NULL; /* First search for a match in the menu items of the menu spec. */ for (curMenuItem = menuSpec->menuItems; curMenuItem != (MenuItem *) NULL; curMenuItem = curMenuItem->nextMenuItem) { bestMatch = PerformClientCommandMatch(clientCommand, curMenuItem, bestMatch); } /* Now search for the best exclusion that would cause this match to be excluded, if any such exclusion exists. */ for (curExclusion = menuSpec->exclusions; curExclusion != (MenuExclusion *) NULL; curExclusion = curExclusion->nextExclusion) { /* We don't have menu items for exclusions so just use a bogus placeholder menu item with the label field set to the string found in the exclusion. */ placeholder.label = curExclusion->command_string; /* Find the best exclusion string in the bunch. */ bestExclusionItem = PerformClientCommandMatch(clientCommand, &placeholder, bestExclusionItem); /* Save the best exclusion string since we are going to reuse the placeholder menu item. */ if (bestExclusionItem != (MenuItem *) NULL) bestExclusionStr = bestExclusionItem->label; } /* Okay, now if we found an exclusion, we need to determine if the exclusion was a better match than the best match that we found. If so, the item is *really* exclude. Otherwise, we return the best match and let the item be included. */ placeholder.label = bestExclusionStr; if (bestExclusionStr == (String) NULL || PerformClientCommandMatch(clientCommand, bestMatch, &placeholder) == bestMatch) { *menuItem = bestMatch; return(TRUE); } else { *menuItem = NULL; return(FALSE); } } /*************************************<->************************************* * * PerformInsertionsOnMatchList (matchlist) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * Return = * * * Comments: * -------- * *************************************<->***********************************/ static void PerformInsertionsOnMatchList (MatchList **matchlist) { MatchList *curmatch; MenuItem *newMenuItem, *curitem; if (*matchlist == (MatchList *) NULL) return; if ((*matchlist)->menuspec == (MenuSpec *) NULL) { /* should never get here, but if we do, then we can't continue in this routine since mwm will dump. This may be caused by the cci code duplicating a global menu for a client when it shouldn't be duplicated. If we skip this routine, the cci command will not be added which is far less disturbing than a dump. */ return; } for (curmatch = *matchlist; curmatch != (MatchList *) NULL; curmatch = curmatch->next) { if (curmatch->menuitem != (MenuItem *) NULL) { /* Find this menu item within the menuspec. */ for (curitem = curmatch->menuspec->menuItems; curitem != curmatch->menuitem && curitem != (MenuItem *) NULL; curitem = curitem->nextMenuItem) /*EMPTY*/; /* If we didn't find the menuitem in the menuspec, then don't do this match. */ if (curitem == (MenuItem *) NULL) continue; newMenuItem = MakeMenuItemFromTemplate(curmatch->menuitem, curmatch->treenode->defaultName, curmatch->funcargs); newMenuItem->wmFunction = curmatch->function; newMenuItem->greyedContext = curmatch->greyed_context; newMenuItem->nextMenuItem = curitem->nextMenuItem; newMenuItem->clientCommandID = curmatch->treenode->commandID; curitem->nextMenuItem = newMenuItem; } else { MenuItem *last = (MenuItem *) NULL; if (curmatch->menuspec != NULL) { /* Find the last menu item in the menuspec */ for (last = curmatch->menuspec->menuItems; last != (MenuItem *) NULL && last->nextMenuItem != (MenuItem *) NULL; last = last->nextMenuItem) { /* If the next item is f.quit and it is the last item, then stop searching now. We don't want to insert after a trailing f.kill (i.e. Close). */ if ((last->nextMenuItem->wmFunction == F_Kill) && (last->nextMenuItem->nextMenuItem == (MenuItem *) NULL)) break; } } /* Create a new client command menu item */ newMenuItem = MakeClientCommandMenuItem (XtNewString(curmatch->treenode->defaultName), XtNewString(curmatch->funcargs)); newMenuItem->wmFunction = curmatch->function; newMenuItem->greyedContext = curmatch->greyed_context; newMenuItem->clientCommandID = curmatch->treenode->commandID; /* Insert the new menu item at the end of the list */ if (last == (MenuItem *) NULL) { newMenuItem->nextMenuItem = (MenuItem *) NULL; if (curmatch->menuspec != NULL) curmatch->menuspec->menuItems = newMenuItem; else { /* again, should never get here... */ return; } } else { newMenuItem->nextMenuItem = last->nextMenuItem; last->nextMenuItem = newMenuItem; } } } } /*************************************<->************************************* * * void * DestroyMenuSpecWidgets (menuSpec) * * * Description: * ----------- * * * Inputs: * ------ * menuSpec = pointer to MenuSpec structure * * * Outputs: * ------- * * Comments: * -------- * Destroys all the menuspec widgets so that we can rebuild the menu from * scratch. * *************************************<->***********************************/ void DestroyMenuSpecWidgets (MenuSpec *menuSpec) { /* check for bad input value - shouldn't happen. */ if (menuSpec == (MenuSpec *) NULL) return; /* Destroy the menu widget */ if (menuSpec->menuWidget != (Widget) NULL) { XtDestroyWidget(XtParent(menuSpec->menuWidget)); menuSpec->menuWidget = (Widget) NULL; } /* Destroy the menu buttons array */ if (menuSpec->menuButtonSize != 0) { XtFree((char *)menuSpec->menuButtons); menuSpec->menuButtons = (MenuButton *) NULL; } /* Reset the counters */ menuSpec->menuButtonSize = 0; menuSpec->menuButtonCount = 0; /* Clear the flag that says we have processed this menu spec for widget creation. (We probably don't need to do this after all since CreateMenuWidgets clears it when done.) */ if (menuSpec->currentContext & CR_MENU_MARK) menuSpec->currentContext &= ~(CR_MENU_MARK); return; } /*************************************<->************************************* * * void * DestroyMenuSpec (pSD, commandID) * * * Description: * ----------- * * * Inputs: * ------ * pSD = screen data pointer of screen with command to remove * commandID = command id of the menuspec to be removed. * if no match is found, then no removal is done. * * Outputs: * ------- * * Comments: * -------- * Destroy the specified menuSpec from the list of menuspecs on the * specified screen. Note, there may be more than one copy of the * spec floating around since duplications may have been done for * some clients. * *************************************<->***********************************/ void DestroyMenuSpec (WmScreenData *pSD, CARD32 commandID) { MenuSpec *msToKill = NULL, *pMS; ClientListEntry *curClient; /* Scan through global menu specs. */ if (pSD != NULL && pSD->menuSpecs != NULL && commandID != 0) { /* Scan through the list of menuSpecs and pull the mathing one * out of the list. */ if (commandID == pSD->menuSpecs->commandID) { /* match at head of menuSpec list. */ msToKill = pSD->menuSpecs; pSD->menuSpecs = pSD->menuSpecs->nextMenuSpec; msToKill->nextMenuSpec = NULL; } else { for (pMS = pSD->menuSpecs; (pMS->nextMenuSpec != NULL && pMS->nextMenuSpec->commandID != commandID); pMS = pMS->nextMenuSpec) ; if (pMS->nextMenuSpec != NULL) { msToKill = pMS->nextMenuSpec; pMS->nextMenuSpec = msToKill->nextMenuSpec; msToKill->nextMenuSpec = NULL; } } /* found it - now remove the menuSpec. */ if (msToKill != NULL) FreeCustomMenuSpec(msToKill); } /* Check each client's menu spec list. Stop searching if global. */ for (curClient = pSD->clientList; curClient != (ClientListEntry *)NULL; curClient = curClient->nextSibling) { /* * Check the first position. * If matched, then we're done with this client. */ if (commandID == pSD->menuSpecs->commandID) { msToKill = curClient->pCD->systemMenuSpec; curClient->pCD->systemMenuSpec = msToKill->nextMenuSpec; msToKill->nextMenuSpec = NULL; } /* Check the rest of the list. */ else { for (pMS = curClient->pCD->systemMenuSpec; (pMS->nextMenuSpec != (MenuSpec *)NULL) && (pMS->nextMenuSpec->commandID != commandID) && pMS->clientLocal; pMS = pMS->nextMenuSpec) ; if ((pMS->nextMenuSpec != (MenuSpec *)NULL) && (pMS->nextMenuSpec->commandID != commandID)) { msToKill = pMS->nextMenuSpec; pMS->nextMenuSpec = msToKill->nextMenuSpec; msToKill->nextMenuSpec = NULL; } else msToKill = NULL; } if (msToKill != NULL) FreeCustomMenuSpec(msToKill); } return; } /*************************************<->************************************* * * ReplaceMenuSpecForClient (menuspec, pCD) * * * Description: * ----------- * Duplicates the given menuspec and replaces the given menuspec if * found in the clients menuspec list with the duplicate. * * Inputs: * ------ * * Outputs: * ------- * Return = the duplicate menuspec * * * Comments: * -------- * *************************************<->***********************************/ static MenuSpec *ReplaceMenuSpecForClient (MenuSpec *menuSpec, ClientData *pCD) { MenuSpec *newMenuSpec, *curMenuSpec; /* Duplicate the menu spec */ newMenuSpec = DuplicateMenuSpec(menuSpec); /* Try to find this menuspec in the list of client menuspecs. If we find it then we want to replace it with the new one. */ if (pCD->systemMenuSpec == menuSpec) { /* It was the head of the list. We need to handle that a little special */ newMenuSpec->nextMenuSpec = pCD->systemMenuSpec->nextMenuSpec; pCD->systemMenuSpec = newMenuSpec; } else { /* Search through the list until we find the menuspec or the end of the list. */ for (curMenuSpec = pCD->systemMenuSpec; curMenuSpec->nextMenuSpec != (MenuSpec *) NULL; curMenuSpec = curMenuSpec->nextMenuSpec) { if (curMenuSpec->nextMenuSpec == menuSpec) { newMenuSpec->nextMenuSpec = curMenuSpec->nextMenuSpec->nextMenuSpec; curMenuSpec->nextMenuSpec = newMenuSpec; /* We found it and replaced it. Now get out of the loop. */ break; } } if (curMenuSpec->nextMenuSpec == (MenuSpec *) NULL) { /* We didn't find it. Just stick it at the end? We should have found it. I'm not sure how to handle this. */ curMenuSpec->nextMenuSpec = newMenuSpec; newMenuSpec = (MenuSpec *) NULL; } } return(newMenuSpec); } /*************************************<->************************************* * * FindLastMenuSpecToModify (menuspec, command_id) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * Return = the last menu spec that would be affected by modifications * to the given command id * * * Comments: * -------- * *************************************<->***********************************/ static MenuSpec * FindLastMenuSpecToModify(MenuSpec *menuSpec, CARD32 command_id) { MenuSpec *curMenuSpec, *lastToModify = (MenuSpec *) NULL; MenuItem *curItem; /* Search through all the menu specs in the list starting with the passed in menuSpec */ for (curMenuSpec = menuSpec; curMenuSpec != (MenuSpec *) NULL; curMenuSpec = curMenuSpec->nextMenuSpec) { /* Try to find a menu item in this menu spec with the command_id that will require modification */ for (curItem = curMenuSpec->menuItems; curItem != (MenuItem *) NULL; curItem = curItem->nextMenuItem) { if (curItem->clientCommandID == command_id) break; } /* If we found a menu item that needs changing, then this menu spec will need changing. Set the lastToModify to point to this menu spec. If we find no other menu spec that needs changing, then this will be the last one in the list that needs changing. */ if (curItem != (MenuItem *) NULL) lastToModify = curMenuSpec; } /* We've looked through all the menu specs starting with menuSpec and we've looked at all the menu items in all of those menu specs. The lastToModify variable should be set to the last menu spec we saw that needed modification. Return it. */ return(lastToModify); } /*************************************<->************************************* * * RecreateMenuWidgets (matchlist) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * Return = * * * Comments: * -------- * *************************************<->***********************************/ static void RecreateMenuWidgets (WmScreenData *pSD, ClientData *pCD, MatchList **matchlist) { MatchList *current; int count = 0, i; MenuSpec **to_change; /* First count how many menu specs we need to recreate widgets for */ for (current = *matchlist; current != (MatchList *) NULL; current = current->next) ++count; /* If there are no affected menuspecs, then just return. */ if (count == 0) return; /* Allocate an array of menuspec pointers that is the size of the number of menu specs we need to recreate widgets for */ to_change = (MenuSpec **)XtMalloc(sizeof(MenuSpec *) * count); for (i = 0; i < count; ++i) to_change[i] = (MenuSpec *) NULL; /* Now run through all the matchlist items, storing menuspecs in that array. If the menuspec is already there, then don't store it again. */ for (current = *matchlist; current != (MatchList *) NULL; current = current->next) { for (i = 0; i < count; ++i) { if (to_change[i] == current->menuspec) break; else if (to_change[i] == (MenuSpec *) NULL) { to_change[i] = current->menuspec; break; } } } /* Run through the array, destroy all existing widgets for each menuspec */ for (i = 0; i < count && to_change[i] != (MenuSpec *) NULL ; ++i) { DestroyMenuSpecWidgets(to_change[i]); } /* Run through the array again creating widgets for all the menuspecs */ for (i = 0; i < count && to_change[i] != (MenuSpec *) NULL; ++i) { to_change[i]->menuWidget = CreateMenuWidget (pSD, pCD, to_change[i]->name, pSD->screenTopLevelW, TRUE, to_change[i], NULL); } /* Free the array. We're done. */ XtFree((char *) to_change); } /*************************************<->************************************* * * FreeMatchList (matchlist) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * Return = * * * Comments: * -------- * *************************************<->***********************************/ static void FreeMatchList (MatchList **matchlist) { MatchList *current, *next; current = *matchlist; while (current != (MatchList *) NULL) { next = current->next; XtFree(current->command_string); XtFree(current->funcargs); XtFree((char *)current); current = next; } *matchlist = (MatchList *) NULL; } /*************************************<->************************************* * * StoreMatchedCommand (matchlist, menuSpec, menuItem, command_string, * treenode, function, funcargs) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * Return = * * * Comments: * -------- * If the existing match has NULL for the menuitem, then get rid of * it and replace with proposed match. * *************************************<->***********************************/ static void StoreMatchedCommand (MatchList **matchlist, MenuSpec *menuSpec, MenuItem *menuItem, String command_string, CmdTree *treenode, WmFunction function, String funcargs, Context greyed_context) { MatchList *current, *new; /* If this entry does not already exist in the match list, then insert it. This implies that we first have to perform a search of the list. The search is very easy. We can simply compare the tuple of with each entry in the matchlist to see if we already have that tuple stored. We can do straight pointer value matching for the menuSpec and strcmp for the command_string */ for (current = *matchlist; current != (MatchList *) NULL; current = current->next) { if (current->menuspec == menuSpec && strcmp(current->command_string, command_string) == 0) { /* If the currently stored menu item is NULL, then replace with the new menuitem and return. */ if (current->menuitem == (MenuItem *) NULL) { current->menuitem = menuItem; return; } /* Otherwise, we have alreay inserted this command into this menuspec so don't allow another insertion. */ else return; } } /* Well, we didn't find a match, so store the entry */ new = (MatchList *)XtMalloc(sizeof(MatchList)); new->menuspec = menuSpec; new->menuitem = menuItem; new->command_string = XtNewString(command_string); new->treenode = treenode; new->function = function; new->funcargs = XtNewString(funcargs); new->greyed_context = greyed_context; new->next = (MatchList *) NULL; /* Stick it at the head of the list. It's easier. */ new->next = *matchlist; *matchlist = new; } /*************************************<->************************************* * * SearchForOtherMatches (pSD, pCD, treenode, * client_match_list, global_match_list, * menuSpec, command_string, * function, funcargs, duplicate_globals, selection, * greyed_context) * * * Description: * ----------- * menuSpec = menu spec to exclude from search * * Inputs: * ------ * * Outputs: * ------- * Return = * * * Comments: * -------- * *************************************<->***********************************/ static void SearchForOtherMatches (WmScreenData *pSD, ClientData *pCD, CmdTree *treenode, MatchList **client_match_list, MatchList **global_match_list, MenuSpec *menuSpec, String command_string, WmFunction function, String funcargs, Boolean duplicate_globals, Atom selection, Context greyed_context, Boolean inLine) { MenuSpec *current, *newMenuSpec; MenuItem *match; /* Search through all of the clients menuspecs first */ for (current = (pCD == NULL ? NULL : pCD->systemMenuSpec); current != (MenuSpec *) NULL; current = current->nextMenuSpec) { /* If the current menu spec is a global, then just quit this loop. Any menu specs from this point on will have a next pointer that is still in the global list. */ if (menuSpec->clientLocal != TRUE) break; FindClientCommandMatch(current, command_string, &match); if (match != (MenuItem *) NULL) { if (treenode->subTrees != (CmdTree *) NULL && inLine && (strncmp(match->label, "->", 2) == 0 || strncmp(match->label, "=>", 2) == 0)) { CmdTree *tree; for (tree = treenode->subTrees; tree != (CmdTree *) NULL; tree = tree->next) { char new_command_str[1024]; char new_funcargs[1024]; WmFunction inLine_function; if (command_string == NULL) sprintf(new_command_str, "<%s>", tree->name); else sprintf(new_command_str, "%s.<%s>", command_string, tree->name); if (tree->subTrees != (CmdTree *) NULL) { /* menu to cascade to */ sprintf(new_funcargs, "<%s>", tree->name); inLine_function = F_Menu; } else { sprintf(new_funcargs, "%d %ld %ld", (int)tree->commandID, pCD->client, selection); inLine_function = F_InvokeCommand; } StoreMatchedCommand(client_match_list, current, match, new_command_str, tree, inLine_function, new_funcargs, greyed_context); } } else { StoreMatchedCommand(client_match_list, current, match, command_string, treenode, function, funcargs, greyed_context); } } } /* Search through all of the global menuspecs also. */ for (current = pSD->menuSpecs; current != (MenuSpec *) NULL; current = current->nextMenuSpec) { FindClientCommandMatch(current, command_string, &match); if (match != (MenuItem *) NULL) { if (duplicate_globals == TRUE) { /* Create a duplicate of the current menuspec and store that away in the client instead of the current menuspec. */ newMenuSpec = ReplaceMenuSpecForClient(current, pCD); /* Now store enough information so that we can actually create the insertion later. */ StoreMatchedCommand(client_match_list, newMenuSpec, NULL, command_string, treenode, function, funcargs, greyed_context); } else /* Change global menu */ { StoreMatchedCommand(global_match_list, current, match, command_string, treenode, function, funcargs, greyed_context); } } } } /*************************************<->************************************* * * InsertTreeOnClient (pSD, pCD, tree, client_match_list, global_match_list, * menuSpec, templateMenuItem, command_so_far, * duplicate_globals, selection, greyed_context, inLine) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * Return = * * * Comments: * -------- * If duplicate_globals is TRUE, then pCD cannot be NULL. * *************************************<->***********************************/ static void InsertTreeOnClient (WmScreenData *pSD, ClientData *pCD, CmdTree *tree, MatchList **client_match_list, MatchList **global_match_list, MenuSpec *menuSpec, MenuItem *template, String command_so_far, Boolean duplicate_globals, Atom selection, Context greyed_context, Boolean inLine) { String new_command_str; int length; char funcarg_buf[256]; MenuSpec *newMenuSpec, *last, *dupMenuSpec; CmdTree *subtree; MenuItem *bestMatch = (MenuItem *) NULL; /* If the menuSpec we were given is NULL, then just return. We need to at least have a starting menuSpec. */ if (menuSpec == (MenuSpec *) NULL) return; /* If we want global menus duplicated for a client, then the pCD had better not be NULL. */ if (duplicate_globals && pCD == (ClientData *) NULL) return; while (tree != (CmdTree *) NULL) { /* The "4" below is to allow for brackets to surround the tree->name, the period to separate it from the command so far and a NULL. */ length = (command_so_far != NULL ? strlen(command_so_far) : 0) + (tree->name != NULL ? strlen(tree->name) : 0) + 4; new_command_str = XtMalloc(sizeof(unsigned char) * length); if (command_so_far != (String) NULL) sprintf(new_command_str, "%s.<%s>", command_so_far, tree->name); else sprintf(new_command_str, "<%s>", tree->name); /* If there is an exclusion preventing this command from being inserted, then just continue the loop. @RGC: This is wrong. We still want to search for other matches if there is an exclusion. We just don't want to allow one of those other matches to be this menuSpec. */ if (ExcludeClientCommand(menuSpec, new_command_str)) { tree = tree->next; XtFree(new_command_str); continue; } /* If tree is a command set and the inLine flag is TRUE then * we need to insert the command sets commands in the current * menu spec instead of creating a cascade. */ if (tree->subTrees != (CmdTree *) NULL && inLine == TRUE && ForceInLineToCascade(menuSpec, new_command_str, &bestMatch) == FALSE) { /* Recursively process subtrees */ for (subtree = tree->subTrees; subtree != (CmdTree *) NULL; subtree = subtree->next) { /* Pass along the bestMatch. If it is a valid menu item then we want the insertion to occur at that menuitem instead of at the end of the menu. */ InsertTreeOnClient(pSD, pCD, subtree, client_match_list, global_match_list, menuSpec, bestMatch, new_command_str, duplicate_globals, selection, greyed_context, inLine); } /* We don't want to search for other matches because we want the items to be inserted inLine. Any other matches will be found in the recursive calls. (??? or am I wrong?) */ } /* If tree is a command set then we need to create a new menuSpec. */ else if (tree->subTrees != (CmdTree *) NULL) { /* Create the name of the menu for the f.menu command. */ sprintf(funcarg_buf, "<%s>", tree->name); /* Store the cascade button information so it can be created later. */ StoreMatchedCommand( (menuSpec->clientLocal ? client_match_list : global_match_list), menuSpec, template, new_command_str, tree, F_Menu, funcarg_buf, greyed_context); /* We need to create a menu spec for the menu that this cascade button will cascade to. Try to find one in the clients menu spec list, stopping the first time we hit a global menu. If we can't find one there and if we are *not* supposed to duplicate globals, then try to find it in the global list. In all other cases, create a new one using the funcarg_buf that we created above as the name of the menuspec. */ for (newMenuSpec = (pCD == NULL ? NULL : pCD->systemMenuSpec); newMenuSpec != (MenuSpec *) NULL; newMenuSpec = newMenuSpec->nextMenuSpec) { if (newMenuSpec->clientLocal == FALSE) { newMenuSpec = (MenuSpec *) NULL; break; } if (strcmp(newMenuSpec->name, funcarg_buf) == 0) break; } /* If we didn't find it in the client list, maybe we should look in the global list. */ if (newMenuSpec == (MenuSpec *) NULL && duplicate_globals == FALSE) { for (newMenuSpec = pSD->menuSpecs; newMenuSpec != (MenuSpec *) NULL; newMenuSpec = newMenuSpec->nextMenuSpec) { if (strcmp(newMenuSpec->name, funcarg_buf) == 0) break; } } /* If we still don't have a menu spec, then create a new one. */ if (newMenuSpec == (MenuSpec *) NULL) { newMenuSpec = MakeMenuSpec(funcarg_buf, tree == NULL ? (CARD32)NULL : tree->commandID); if (duplicate_globals) newMenuSpec->clientLocal = TRUE; else newMenuSpec->clientLocal = FALSE; /* If we are duplicating globals, then add the new menu spec to the client list. Otherwise add it to the global list. */ if (duplicate_globals) last = pCD->systemMenuSpec; else last = pSD->menuSpecs; /* Find the last menu spec in the list. */ while (last != (MenuSpec *) NULL && last->nextMenuSpec != (MenuSpec *) NULL) last = last->nextMenuSpec; /* Put the new menu spec at the end of the list. */ if (last == (MenuSpec *) NULL) { if (duplicate_globals) pCD->systemMenuSpec = newMenuSpec; else pSD->menuSpecs = newMenuSpec; } else last->nextMenuSpec = newMenuSpec; } /* Recursively process subtrees */ for (subtree = tree->subTrees; subtree != (CmdTree *) NULL; subtree = subtree->next) { InsertTreeOnClient(pSD, pCD, subtree, client_match_list, global_match_list, newMenuSpec, NULL, new_command_str, duplicate_globals, selection, greyed_context, inLine); } /* Search for any other matches in the existing menu specs for this command, excluding newMenuSpec. */ SearchForOtherMatches(pSD, pCD, tree, client_match_list, global_match_list, newMenuSpec, new_command_str, F_Menu, funcarg_buf, duplicate_globals, selection, greyed_context, inLine); } else /* the tree is a simple command */ { /* Store away the push button information so it can be created later. */ sprintf(funcarg_buf, "%d %ld %ld", (int)tree->commandID, (pCD == NULL ? None : pCD->client), selection); /* If the menuSpec is global and we are supposed to be duplicating global menu specs, then create a duplicate and replace the menuspec with the duplicate for this client. */ if (duplicate_globals) dupMenuSpec = ReplaceMenuSpecForClient(menuSpec, pCD); else dupMenuSpec = menuSpec; /* Now store the match away in the appropriate match list */ StoreMatchedCommand((dupMenuSpec->clientLocal ? client_match_list : global_match_list), dupMenuSpec, template, new_command_str, tree, F_InvokeCommand, funcarg_buf, greyed_context); /* Search for any other matches in the existing menu specs for this command, excluding newMenuSpec. */ SearchForOtherMatches(pSD, pCD, tree, client_match_list, global_match_list, dupMenuSpec, new_command_str, F_InvokeCommand, funcarg_buf, FALSE, /* Don't duplicate globals not associated with this pCD. CR 9623 */ selection, greyed_context, inLine); } /* Move on to the next tree item at this level */ tree = tree->next; XtFree(new_command_str); } } /*************************************<->************************************* * * InsertTreeOnAllClients (pSD, tree, selection, active_context, inLine) * * * Description: * ----------- * * Inputs: * ------ * pSD = per screen data * tree = command tree * selection = owned by inserting client * * Outputs: * ------- * Return = * * * Comments: * -------- * *************************************<->***********************************/ void InsertTreeOnAllClients (WmScreenData *pSD, CmdTree *tree, Atom selection, Context active_context, Boolean inLine) { ClientListEntry *current; MatchList *global_matchlist = (MatchList *) NULL; MatchList *client_matchlist = (MatchList *) NULL; Context greyed_context = F_CONTEXT_ALL; /* If there aren't any clients, then there's nothing to do. */ if (pSD->clientList == (ClientListEntry *) NULL) return; /* Setup the greyed context based on the active context */ if (active_context & F_CONTEXT_WINDOW) greyed_context &= ~(F_CONTEXT_WINDOW); if (active_context & F_CONTEXT_ICON) greyed_context &= ~(F_CONTEXT_ICON); for (current = pSD->clientList; current != (ClientListEntry *) NULL; current = current->nextSibling) { /* Ignore client list entries for icons. */ if (current->type == MINIMIZED_STATE) continue; InsertTreeOnClient(pSD, current->pCD, tree, &client_matchlist, &global_matchlist, current->pCD->systemMenuSpec, NULL, NULL, FALSE, selection, greyed_context, inLine); PerformInsertionsOnMatchList(&client_matchlist); RecreateMenuWidgets(pSD, current->pCD, &client_matchlist); FreeMatchList(&client_matchlist); } PerformInsertionsOnMatchList(&global_matchlist); RecreateMenuWidgets(pSD, NULL /* no pcd */, &global_matchlist); FreeMatchList(&global_matchlist); } /*************************************<->************************************* * * InsertTreeOnSingleClient (pSD, pCD, tree, selection, inLine) * * * Description: * ----------- * * Inputs: * ------ * pSD = per screen data * tree = command tree * selection = owned by inserting client * * * Outputs: * ------- * Return = * * * Comments: * -------- * *************************************<->***********************************/ void InsertTreeOnSingleClient (WmScreenData *pSD, ClientData *pCD, CmdTree *tree, Atom selection, Context active_context, Boolean inLine) { MatchList *global_matchlist = (MatchList *) NULL; MatchList *client_matchlist = (MatchList *) NULL; Context greyed_context = F_CONTEXT_ALL; /* A quick sanity check */ if (pCD == (ClientData *) NULL) return; /* Setup the greyed context based on the active context */ if (active_context & F_CONTEXT_WINDOW) greyed_context &= ~(F_CONTEXT_WINDOW); if (active_context & F_CONTEXT_ICON) greyed_context &= ~(F_CONTEXT_ICON); InsertTreeOnClient(pSD, pCD, tree, &client_matchlist, &global_matchlist, pCD->systemMenuSpec, NULL, NULL, TRUE, selection, greyed_context, inLine); PerformInsertionsOnMatchList(&client_matchlist); RecreateMenuWidgets(pSD, pCD, &client_matchlist); FreeMatchList(&client_matchlist); } /*************************************<->************************************* * * InsertTreeOnRootMenu (pSD, tree, selection, active_context, inLine) * * * Description: * ----------- * * Inputs: * ------ * pSD = per screen data * tree = command tree * selection = owned by inserting client * * * Outputs: * ------- * Return = * * * Comments: * -------- * *************************************<->***********************************/ void InsertTreeOnRootMenu (WmScreenData *pSD, CmdTree *tree, Atom selection, Boolean inLine) { MatchList *global_matchlist = (MatchList *) NULL; MatchList *client_matchlist = (MatchList *) NULL; Context greyed_context = F_CONTEXT_WINDOW | F_CONTEXT_ICON; MenuSpec *rootMenu; /* Find the root menu spec */ for (rootMenu = pSD->menuSpecs; rootMenu != (MenuSpec *) NULL; rootMenu = rootMenu->nextMenuSpec) { if (strcmp(rootMenu->name, pSD->rootMenu) == 0) break; } /* If we couldn't find the root menu, then do nothing. */ if (rootMenu == (MenuSpec *) NULL) return; InsertTreeOnClient(pSD, NULL, tree, &client_matchlist, &global_matchlist, rootMenu, NULL, NULL, FALSE, selection, greyed_context, inLine); PerformInsertionsOnMatchList(&client_matchlist); RecreateMenuWidgets(pSD, NULL, &client_matchlist); FreeMatchList(&client_matchlist); PerformInsertionsOnMatchList(&global_matchlist); RecreateMenuWidgets(pSD, NULL, &global_matchlist); FreeMatchList(&global_matchlist); } /*************************************<->************************************* * * RemoveClientCommandFromMenuSpec (menuSpec, id) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ static Boolean RemoveClientCommandFromMenuSpec (MenuSpec *menuSpec, CARD32 id) { MenuItem *curMenuItem, *prevMenuItem = (MenuItem *) NULL; MenuItem *tmpMenuItem; Boolean was_changed = FALSE; curMenuItem = menuSpec->menuItems; while (curMenuItem != (MenuItem *) NULL) { if (curMenuItem->clientCommandID == id) { tmpMenuItem = curMenuItem; curMenuItem = curMenuItem->nextMenuItem; if (prevMenuItem == (MenuItem *) NULL) menuSpec->menuItems = tmpMenuItem->nextMenuItem; else prevMenuItem->nextMenuItem = tmpMenuItem->nextMenuItem; FreeMenuItem(tmpMenuItem); was_changed = TRUE; } else { prevMenuItem = curMenuItem; curMenuItem = curMenuItem->nextMenuItem; } } return(was_changed); } /*************************************<->************************************* * * ModifyClientCommandForMenuSpec (menuSpec, id, modifier, context, newname) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ static Boolean ModifyClientCommandForMenuSpec (MenuSpec *menuSpec, CARD32 id, CmdModifier modifier, Context context, String newname) { MenuItem *curMenuItem; Boolean was_changed = FALSE; int i, freebutton, buttoncount; /* If the menuspec doesn't have any buttons or a valid menu widget then we don't want to search it. */ if (menuSpec->menuWidget == (Widget) NULL || menuSpec->menuButtons == (MenuButton *) NULL || menuSpec->menuButtonCount == 0) return(FALSE); /* Search through all the menu buttons of the menuspec for buttons which match the command ID to be removed. */ for (i = 0; i < menuSpec->menuButtonCount; ++i) { curMenuItem = menuSpec->menuButtons[i].menuItem; if ((curMenuItem->clientCommandID == id) && (curMenuItem->wmFunction == F_InvokeCommand)) { switch(modifier) { case ENABLE: /* "context" is an active context */ curMenuItem->greyedContext &= ~(context); /* Adjust the pushbutton to the state it would have had given the last posting context. */ if (menuSpec->currentContext & curMenuItem->greyedContext) XtSetSensitive(menuSpec->menuButtons[i].buttonWidget, FALSE); else XtSetSensitive(menuSpec->menuButtons[i].buttonWidget, TRUE); break; case DISABLE: /* "context" is a greyed context */ curMenuItem->greyedContext |= context; /* Adjust the pushbutton to the state it would have had given the last posting context. */ if (menuSpec->currentContext & curMenuItem->greyedContext) XtSetSensitive(menuSpec->menuButtons[i].buttonWidget, FALSE); else XtSetSensitive(menuSpec->menuButtons[i].buttonWidget, TRUE); break; case RENAME: if (newname != NULL && *newname != '\0') { /* When renaming a command, we shouldn't cause the * entire menu to be recreated. Recreating the menu * will cause problems with tearoffs since the menu * will disappear when it is destroyed. CR 9719 */ XmString labelString; /* Change the label of the menu item */ XtFree(curMenuItem->label); /* Give the menu item the new name */ curMenuItem->label = XtNewString(newname); was_changed = False; /* all taken care of here. */ /* This is needed when changing the label since * mwm will wait for a geometry reply from itself which * it can never service. CR 9719 */ XtVaSetValues(XtParent(XtParent(menuSpec->menuButtons[i].buttonWidget)), XmNuseAsyncGeometry, TRUE, NULL); labelString = XmStringGenerate(curMenuItem->label, XmFONTLIST_DEFAULT_TAG, XmCHARSET_TEXT, NULL); XtVaSetValues(menuSpec->menuButtons[i].buttonWidget, XmNlabelString, labelString, NULL); XmStringFree(labelString); } break; case REMOVE: XtDestroyWidget(menuSpec->menuButtons[i].buttonWidget); menuSpec->menuButtons[i].managed = FALSE; menuSpec->menuButtons[i].menuItem = (MenuItem *) NULL; menuSpec->menuButtons[i].buttonWidget = (Widget) NULL; break; } } } /* If we are being asked to remove a client command, then we need * to search through all the menu items as well as the buttons. * Do the menu items here. */ if (modifier == REMOVE) was_changed = RemoveClientCommandFromMenuSpec(menuSpec, id); /* Compact the menu buttons array. */ buttoncount = menuSpec->menuButtonCount; freebutton = 0; for (i = 0; i < buttoncount; ++i) { if (menuSpec->menuButtons[i].buttonWidget == (Widget) NULL) --menuSpec->menuButtonCount; else { menuSpec->menuButtons[freebutton].menuItem = menuSpec->menuButtons[i].menuItem; menuSpec->menuButtons[freebutton].buttonWidget = menuSpec->menuButtons[i].buttonWidget; menuSpec->menuButtons[freebutton].managed = menuSpec->menuButtons[i].managed; ++freebutton; } } return(was_changed); } /*************************************<->************************************* * * ModifyClientCommandID (pSD, pCD, range, id, modifier, context, newname) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ static void ModifyClientCommandID (WmScreenData *pSD, ClientData *pCD, OpRange range, CARD32 id, CmdModifier modifier, Context context, String newname) { MenuSpec *curMenuSpec; ClientListEntry *curClient; switch(range) { case ALL: /* Search through all the menu specs of all the clients. */ for (curClient = pSD->clientList; curClient != (ClientListEntry *) NULL; curClient = curClient->nextSibling) { for (curMenuSpec = curClient->pCD->systemMenuSpec; curMenuSpec != (MenuSpec *) NULL; curMenuSpec = curMenuSpec->nextMenuSpec) { /* If the menu spec is global then stop searching for this client. */ if (curMenuSpec->clientLocal == FALSE) break; if (ModifyClientCommandForMenuSpec(curMenuSpec, id, modifier, context, newname) == TRUE) { DestroyMenuSpecWidgets(curMenuSpec); curMenuSpec->menuWidget = CreateMenuWidget (pSD, curClient->pCD, curMenuSpec->name, pSD->screenTopLevelW, TRUE, curMenuSpec, NULL); } } } /* Search through all the global menu specs. */ for (curMenuSpec = pSD->menuSpecs; curMenuSpec != (MenuSpec *) NULL; curMenuSpec = curMenuSpec->nextMenuSpec) { if (ModifyClientCommandForMenuSpec(curMenuSpec, id, modifier, context, newname) == TRUE) { DestroyMenuSpecWidgets(curMenuSpec); curMenuSpec->menuWidget = CreateMenuWidget (pSD, NULL, curMenuSpec->name, pSD->screenTopLevelW, TRUE, curMenuSpec, NULL); } } break; case ROOT: { /* * This section was changed to search the entire global menu list. * This was done to allow access to menu entries included using the * cci/.mwmrc interface. Before, only the actual root menu could * be modified; however, the user could still include commands in * other menus specified in the .mwmrc file using the f.cci command. */ MenuSpec *curMenuSpec; /* Search through all the global menu specs. */ for (curMenuSpec = pSD->menuSpecs; curMenuSpec != (MenuSpec *) NULL; curMenuSpec = curMenuSpec->nextMenuSpec) { if (ModifyClientCommandForMenuSpec(curMenuSpec, id, modifier, context, newname) == TRUE) { DestroyMenuSpecWidgets(curMenuSpec); curMenuSpec->menuWidget = CreateMenuWidget (pSD, NULL, curMenuSpec->name, pSD->screenTopLevelW, TRUE, curMenuSpec, NULL); } } } break; case SINGLE: /* If we weren't passed a valid pCD, then just return. */ if (pCD == (ClientData *) NULL) return; /* Search through the clients menu specs. If we find one that is global then stop search if we are ENABLING or DISABLING. If we are REMOVING and we find a global, we may need to perform some menu spec replacing to make the menu spec that needs modification local to the client. */ for (curMenuSpec = pCD->systemMenuSpec; curMenuSpec != (MenuSpec *) NULL; curMenuSpec = curMenuSpec->nextMenuSpec) { if (curMenuSpec->clientLocal == FALSE) { MenuSpec *last, *cur; /* Find the last global menuspec in the clients list that needs to be changed and return it. Replace all menuspecs between the current one and the "last" one that needs changing. All the replaced menuspecs will be marked as local, so that next time clientLocal is FALSE in the enclosing for loop above, there will be no global menu specs needing changes. In other words, all the required menu spec replacing will occur the first time we find a global menu spec. */ last = FindLastMenuSpecToModify(curMenuSpec, id); if (last != (MenuSpec *) NULL) { MenuSpec *newMenuSpec = (MenuSpec *) NULL; MenuSpec *firstMenuSpec = (MenuSpec *) NULL; MenuSpec *lastMenuSpec = (MenuSpec *) NULL; /* Replace all the global menu specs with local ones. */ for (cur = curMenuSpec; cur != (MenuSpec *) NULL && cur != last->nextMenuSpec; cur = cur->nextMenuSpec) { newMenuSpec = ReplaceMenuSpecForClient(cur, pCD); if (cur == curMenuSpec) curMenuSpec = firstMenuSpec = newMenuSpec; /* If there is only one menu spec to change, the first will also be the last. */ if (cur == last) lastMenuSpec = newMenuSpec; } /* Now that we have replaced all the menu specs, recreate all the widgets for the new menu specs. */ for (cur = firstMenuSpec; cur != (MenuSpec *) NULL && cur != lastMenuSpec->nextMenuSpec; cur = cur->nextMenuSpec) { DestroyMenuSpecWidgets(newMenuSpec); newMenuSpec->menuWidget = CreateMenuWidget(pSD, pCD, newMenuSpec->name, pSD->screenTopLevelW, TRUE, newMenuSpec, NULL); } } /* None of the globals need changing. */ else break; } if (ModifyClientCommandForMenuSpec(curMenuSpec, id, modifier, context, newname) == TRUE) { DestroyMenuSpecWidgets(curMenuSpec); curMenuSpec->menuWidget = CreateMenuWidget (pSD, pCD, curMenuSpec->name, pSD->screenTopLevelW, TRUE, curMenuSpec, NULL); } } break; } } /*************************************<->************************************* * * ModifyClientCommandTree (pSD, pCD, range, tree, modifier, context, newname) * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void ModifyClientCommandTree (WmScreenData *pSD, ClientData *pCD, OpRange range, CmdTree *tree, CmdModifier modifier, Context context, String newname) { CmdTree *curTree; CARD32 cmdID; /* Run through the top level of the tree. */ for (curTree = tree; curTree != (CmdTree *) NULL; curTree = curTree->next) { cmdID = curTree->commandID; ModifyClientCommandID(pSD, pCD, range, cmdID, modifier, context, newname); if (curTree->subTrees != (CmdTree *) NULL) ModifyClientCommandTree(pSD, pCD, range, curTree->subTrees, modifier, context, newname); } } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * static Boolean * AdjustPBs (menuSpec, pCD, newContext) * * * Description: * ----------- * This procedure adjusts menu PushButton sensitivities and manage/unmanaged * status for a toplevel menu. * * * Inputs: * ------ * menuSpec = nonNULL toplevel menu specification with gadget * pCD = client data * newContext = context that the menu is to be posted under. * * * Outputs: * ------- * menuSpec = menu specification with modifications * Return = TRUE iff at least one menu item changed manage status. * * * Comments: * -------- * Adjusts PushButton sensitivity according to context and function type. * Manages/Unmanages PushButtons according to clientFunction resource. * *************************************<->***********************************/ static Boolean AdjustPBs (MenuSpec *menuSpec, ClientData *pCD, Context newContext) { MenuButton *menuButton; MenuItem *menuItem; int msgc; unsigned int n; long *pMsg; Boolean fSupported; Boolean fChangeManaged = FALSE; /* * Set PushButton sensitivity. * Set f.send_msg button sensitivity according to context and client * message list. Adjust other button sensitivities only for context. */ /* check for bad input value - shouldn't happen. */ if (menuSpec == NULL) return (FALSE); for (n = 0, menuButton = menuSpec->menuButtons; n < menuSpec->menuButtonCount; n++, menuButton++) { menuItem = menuButton->menuItem; if (menuItem->wmFunction == F_Send_Msg) /* f.send_msg button: set according to context and message. */ { if ((newContext & menuItem->greyedContext) || !(pCD && pCD->mwmMessagesCount && pCD->mwmMessages)) /* insensitive context or empty client message list */ { XtSetSensitive (menuButton->buttonWidget, FALSE); } else /* * Have a context sensitive f.send_msg item and a client with a * nonempty message list. Set sensitive only if the message is * supported by this client. Otherwise set insensitive. */ { msgc = pCD->mwmMessagesCount; pMsg = pCD->mwmMessages; fSupported = FALSE; while (msgc--) /* scan nonempty message list */ { if (*pMsg == (long) menuItem->wmFuncArgs) /* found match */ { fSupported = TRUE; break; } pMsg++; /* next message in list */ } XtSetSensitive (menuButton->buttonWidget, fSupported); } } else /* * Non f.send_msg button: * Adjust sensitivity according to context. * Manage/Unmanage according to clientFunction. */ { if (menuSpec->currentContext & menuItem->greyedContext) /* button is currently insensitive */ { if (!(newContext & menuItem->greyedContext)) /* insensitive -> sensitive */ { XtSetSensitive (menuButton->buttonWidget, TRUE); } } else /* button is currently sensitive */ { if (newContext & menuItem->greyedContext) /* sensitive -> insensitive */ { XtSetSensitive (menuButton->buttonWidget, FALSE); } } #ifdef WSM if (menuItem->wmFunction == F_Remove) { /* * Only allow remove from workspace if the client * is in more than one workspace */ fSupported = (pCD && (pCD->numInhabited > 1)); XtSetSensitive (menuButton->buttonWidget, fSupported); } #endif /* WSM */ if ((menuItem->mgtMask) && pCD) /* PushButton might not apply */ { #ifdef WSM if ((pCD->clientFunctions & menuItem->mgtMask & MWM_MGT_MASK) || (pCD->dtwmFunctions & menuItem->mgtMask & DTWM_MGT_MASK)) #else /* WSM */ if (pCD->clientFunctions & menuItem->mgtMask) #endif /* WSM */ /* function applies -- manage it */ { if (!menuButton->managed) /* unmanaged -> managed */ { XtManageChild (menuButton->buttonWidget); menuButton->managed = TRUE; fChangeManaged = TRUE; if (n == menuSpec->menuButtonCount - 1) { /* * last item, if it has a separator before * it, manage the separator */ CheckTerminalSeparator(menuSpec, menuButton->buttonWidget, True); } } } else /* function does not apply -- unmanage it */ { if (menuButton->managed) /* managed -> unmanaged */ { XtUnmanageChild (menuButton->buttonWidget); menuButton->managed = FALSE; fChangeManaged = TRUE; if (n == menuSpec->menuButtonCount - 1) { /* * last item, if it has a separator before * it, unmanage the separator */ CheckTerminalSeparator(menuSpec, menuButton->buttonWidget, False); } } } } else if (!menuButton->managed) /* unmanaged PushButton applies */ { XtManageChild (menuButton->buttonWidget); menuButton->managed = TRUE; fChangeManaged = TRUE; } } } return (fChangeManaged); } /* END OF FUNCTION AdjustPBs */ /*************************************<->************************************* * * static Boolean * SavePBInfo (topMenuSpec, menuItem, itemW) * * * Description: * ----------- * Fills a MenuButton structure for a PushButton. * If necessary, mallocs or reallocs the menuButtons array in the toplevel * MenuSpec. * * * Inputs: * ------ * topMenuSpec = pointer to toplevel MenuSpec structure * menuItem = pointer to PushButton MenuItem structure * itemW = PushButton gadget * topMenuSpec->menuButtons[] * topMenuSpec->menuButtonSize * topMenuSpec->menuButtonCount * * * Outputs: * ------- * Return = FALSE iff insufficient memory for malloc or realloc * or bad input value forces exit. * topMenuSpec->menuButtons[] * topMenuSpec->menuButtonSize * topMenuSpec->menuButtonCount * * * Comments: * -------- * The initial managed status of PushButtons is TRUE. * *************************************<->***********************************/ static Boolean SavePBInfo (MenuSpec *topMenuSpec, MenuItem *menuItem, Widget itemW) { MenuButton *menuButton; /* check for bad input value - shouldn't happen. */ if (topMenuSpec == NULL) return (FALSE); if (topMenuSpec->menuButtonSize == 0) /* need to create array */ { topMenuSpec->menuButtonSize = MENU_BUTTON_INC; topMenuSpec->menuButtons = (MenuButton *) XtMalloc (MENU_BUTTON_INC * sizeof(MenuButton)); } else if (topMenuSpec->menuButtonCount == topMenuSpec->menuButtonSize) /* need larger array */ { topMenuSpec->menuButtonSize += MENU_BUTTON_INC; topMenuSpec->menuButtons = (MenuButton *) XtRealloc ((char*)topMenuSpec->menuButtons, topMenuSpec->menuButtonSize * sizeof(MenuButton)); } if (topMenuSpec->menuButtons == NULL) /* insufficent memory */ { topMenuSpec->menuButtonSize = 0; topMenuSpec->menuButtonCount = 0; return (FALSE); } menuButton = &(topMenuSpec->menuButtons[topMenuSpec->menuButtonCount]); topMenuSpec->menuButtonCount++; menuButton->menuItem = menuItem; menuButton->buttonWidget = itemW; menuButton->managed = TRUE; return (TRUE); } #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * AdjustTearOffControl (cascade, closure, cbackdata) * * * * * Description: * ----------- * * Inputs: * ------ * * * Outputs: * ------- * returns true iff the tearoff control was enabled or diabled * resulting in a change in height. * * Comments: * -------- * *************************************<->***********************************/ static Boolean AdjustTearOffControl (Widget cascade, XtPointer closure, XtPointer cbackdata) { Widget submenu = (Widget) closure; int argn; Arg args[10]; unsigned char tearoff_model; Boolean isMwmMenu; argn = 0; XtSetArg(args[argn], XmNtearOffModel, &tearoff_model); ++argn; XtGetValues(submenu, args, argn); /* Is this a root menu or a cascade of a root menu? */ /* If cbackdata is not null, then we got here by cascading. */ /* Cascade menus from a tearoff menu-pane are not allowed. */ /* there is no way to know if the cascade is from a tearoff */ /* or from a cascade on a system menu. */ if ((wmGD.menuClient == NULL) && (cbackdata == NULL)) isMwmMenu = True; else isMwmMenu = False; if ((tearoff_model == XmTEAR_OFF_ENABLED) && !isMwmMenu) { PRINT("Disabling the tear off\n"); argn = 0; XtSetArg(args[argn], XmNtearOffModel, XmTEAR_OFF_DISABLED); ++argn; XtSetValues(submenu, args, argn); return (True); } /* If this was invoked as a cascadingCallback and not by hand and if the menuActive field of the global data has not yet been set, then we can safely assume that we have just cascaded off of a torn off menu. In that case, set the menuActive field to be the menu spec of the torn off menu and register an unmap callback on the cascaded menu that will clear the menuActive field. */ if (cbackdata != (XtPointer) NULL && wmGD.menuActive == (MenuSpec *) NULL) { MenuSpec *menuspec; Widget tearoff_widget = XtParent(cascade); for (menuspec = wmGD.Screens[0].menuSpecs; menuspec != (MenuSpec *) NULL; menuspec = menuspec->nextMenuSpec) { if (tearoff_widget == menuspec->menuWidget) { wmGD.menuActive = menuspec; break; } } /* If we can't find a menuspec for the torn off menu, then just take the first menu spec in the list of menuSpecs for the active pSD. NOTE: THIS SHOULD NEVER HAPPEN. In fact if it does, I'm not sure how mwm will behave having been given the wrong menu spec as the active menu. */ if (wmGD.menuActive == (MenuSpec *) NULL) { wmGD.menuActive = ACTIVE_PSD->menuSpecs; PRINT("Couldn't find menu spec for tear off\n"); } /* Add a callback that will clear menuActive when this cascade is unmapped. */ #if 0 XtAddCallback (submenu, XmNunmapCallback, #else XtAddCallback (XtParent(submenu), XmNpopdownCallback, #endif UnmapPulldownCallback, (XtPointer) NULL); } return (False); } /*************************************<->************************************* * * static Boolean * CreateClientCommandSeparator (menuItem, child_position, last_child, * newMenuItem) * * * Description: * ----------- * * Inputs: * ------ * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ static Boolean CreateClientCommandSeparator (MenuItem *menuItem, int child_position, Widget last_child, MenuItem **newMenuItem) { MenuItem *curMenuItem; /* If it is a client command, then we only want to create the * separator under particular circumstances. Specifically, we * want to make sure that: * 1. a separator doesn't directly precede this one * 2. a separator doesn't directly follow this one * 3. this separator won't be the first or last item in the menu * 4. the client command that this separator surrounds actually * matched something and is not an unmatched template */ /* Check if a separator directly precedes this one. */ if (child_position > 0 && last_child != (Widget) NULL && XmIsSeparator(last_child)) return(FALSE); /* Check if a separator directly follows this one. */ if (menuItem->nextMenuItem != (MenuItem *) NULL && menuItem->nextMenuItem->wmFunction == F_Separator && IsClientCommand(menuItem->nextMenuItem->label) == FALSE) return(FALSE); /* Make sure this separator won't be the first item in the menu. */ if (child_position == 0) return(FALSE); /* Make sure this separator won't be the last item in the menu. */ if (menuItem->nextMenuItem == (MenuItem *) NULL) return(FALSE); /* Make sure that the client command this separator surrounds actually matches something. We only do this check if the separator is the TOP separator in the separator pair. If we are looking at a bottom separator then we can safely assume something matched, otherwise we would have passed over it when we look at the corresponding top separator. */ if (menuItem->labelType == TOP_SEPARATOR) { /* If we find a real menu item (not just a template) before we find a bottom separator, then create the separator. */ for (curMenuItem = menuItem; curMenuItem != (MenuItem *) NULL; curMenuItem = curMenuItem->nextMenuItem) { /* If we found the closing separator, then return FALSE and our new menu item position. */ if (curMenuItem->wmFunction == F_Separator && IsClientCommand(curMenuItem->label) && curMenuItem->labelType == BOTTOM_SEPARATOR) { *newMenuItem = curMenuItem; return(FALSE); } /* If we found a real menu item, then return TRUE. */ if (curMenuItem->wmFunction != F_Separator && !IsClientCommand(curMenuItem->label)) { return(TRUE); } } /* If by some bizarre chance we get to the end of the list without finding either, then return FALSE. Something is wrong. */ if (curMenuItem == (MenuItem *) NULL) return(FALSE); } /* Well, nothing failed so let's create it. */ return(TRUE); } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * CreateMenuWidget (pSD, menuName, parent, fTopLevelPane, topMenuSpec, * moreMenuItems) * * * Description: * ----------- * Creates a MenuShell as a child of the specified parent widget, and a * PopupMenu or PulldownMenu as a child of the shell. Fill the menu with * the named menupane items. * * * Inputs: * ------ * pSD ---------- pointer to screen data * menuName ----- the name of the menu specification to be used to create * the menu widget. * parent -------- parent of popup shell * fTopLevelPane - TRUE iff the menupane is a top level one * topMenuSpec --- pointer to the top menu specification. * moreMenuItems - pointer to additional menu items for custom menu. * * * Outputs: * ------- * Return = created PopupMenu or PulldownMenu widget, or NULL. * * * Comments: * -------- * We attach a popdowncallback to the menu to set wmGD.menuActive to NULL, * allowing us to not dispatch key events separately from the toolkit * dispatcher. * *************************************<->***********************************/ typedef struct _StrList { XmString string; struct _StrList *next; } StrList; Widget CreateMenuWidget (WmScreenData *pSD, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) ClientData *pCD, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ String menuName, Widget parent, Boolean fTopLevelPane, MenuSpec *topMenuSpec, MenuItem *moreMenuItems) { int i, n; Arg sepArgs[1]; Arg args[10]; MenuSpec *menuSpec = (MenuSpec *)NULL; MenuItem *menuItem; Widget menuShellW; Widget menuW; Widget subMenuW; Widget children[CHILDREN_CACHE]; Pixmap labelPixmap; KeySpec *accelKeySpec; Dimension menuHeight; Boolean fUseTitleSep = False; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) Boolean labelIsClientCommand = False; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ StrList *stringsToFree = NULL, *sPtr; XmString tmpstr; #ifndef IBM_151913 Screen *scr; #endif /* check for bad input values. */ if ((menuName == NULL) || (pSD == NULL)) { return (NULL); } /* * Find the menu pane specifications for menuName. * The top-level menu specification is passed as an argument (it may * be custom). A submenu specification must be found and might not exist. * Return NULL if a submenu specification is not found. */ if (fTopLevelPane) { menuSpec = topMenuSpec; } else { menuSpec = pSD->menuSpecs; while (menuSpec) { if ((menuSpec->name != NULL) && !strcmp (menuSpec->name, menuName)) { break; /* found menuName's specification */ } menuSpec = menuSpec->nextMenuSpec; /* keep looking */ } } if (menuSpec == NULL) /* (submenu) specification not found */ { MWarning(((char *)GETMESSAGE(48, 4, "Menu specification %s not found\n")), menuName); return (NULL); } /* * If menuSpec is marked, we have menu recursion => fail. * Otherwise, mark it. */ if (menuSpec->currentContext & CR_MENU_MARK) /* marked? */ /* menu recursion */ { MWarning(((char *)GETMESSAGE(48, 5, "Menu recursion detected for %s\n")), menuName); return (NULL); } menuSpec->currentContext |= CR_MENU_MARK; /* no, mark it */ /* * Create a PopupShell widget. * If the parent of the specified parent ("grandparent") is a MenuShell * widget, then use the grandparent as the parent of the PopupShell. * Otherwise, use the specified parent. */ i = 0; XtSetArg (args[i], XmNwidth, (XtArgVal) 5); i++; XtSetArg (args[i], XmNheight, (XtArgVal) 5); i++; XtSetArg (args[i], XmNallowShellResize, (XtArgVal) TRUE); i++; XtSetArg (args[i], XtNoverrideRedirect, (XtArgVal) TRUE); i++; XtSetArg (args[i], XtNdepth, (XtArgVal) DefaultDepth(XtDisplay(parent), pSD->screen)); i++; XtSetArg (args[i], XtNscreen, (XtArgVal) ScreenOfDisplay(XtDisplay(parent), pSD->screen)); i++; if ((XtParent (parent) != NULL) && XmIsMenuShell (XtParent (parent))) { parent = XtParent (parent); } menuShellW = XtCreatePopupShell (SHELL_NAME, xmMenuShellWidgetClass, parent, (ArgList) args, i); /* * Create a RowColumn widget as a child of the shell for the menu pane. * If the menu pane is top-level, create a popup menu for it and attach * the unmap callback to it. * Otherwise, create a pulldown menu for it. */ i = 0; XtSetArg (args[i], XmNborderWidth, (XtArgVal) 0); i++; XtSetArg (args[i], XmNwhichButton, (XtArgVal) SELECT_BUTTON); i++; XtSetArg (args[i], XmNadjustMargin, (XtArgVal) TRUE); i++; if (fTopLevelPane) { XtSetArg (args[i], XmNrowColumnType, (XtArgVal) XmMENU_POPUP); i++; XtSetArg (args[i], XmNpopupEnabled, (XtArgVal) TRUE); i++; menuW = XtCreateWidget (menuName, xmRowColumnWidgetClass, menuShellW, (ArgList) args, i); XtAddCallback (menuW, XmNunmapCallback, UnmapCallback, (XtPointer) menuSpec); } else { XtSetArg (args[i], XmNrowColumnType, (XtArgVal) XmMENU_PULLDOWN); i++; menuW = XtCreateWidget (menuName, xmRowColumnWidgetClass, menuShellW, (ArgList) args, i); } /* * Create the specified menu entries as children of the menupane. * Menus may contain the following widgets: * * Label * Separator * CascadeButton * PushButton * * Add separator gadgets around menu titles. */ XtSetArg (sepArgs[0], XmNseparatorType, (XtArgVal) XmDOUBLE_LINE); n = 0; menuItem = menuSpec->menuItems; if ((menuItem == NULL) && (moreMenuItems != NULL)) /* handle custom menu with empty standard specification */ { menuSpec->menuItems = menuItem = moreMenuItems; moreMenuItems = NULL; } while (menuItem) { i = 0; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) labelIsClientCommand = IsClientCommand(menuItem->label); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ if (menuItem->wmFunction == F_Separator) /* * Add a Separator gadget for a menu separator. * An immediately following title will not have a top separator. */ { #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* If it is a client command, then we only want to create the * separator under particular circumstances. Specifically, we * want to make sure that: * 1. a separator doesn't directly precede this one * 2. a separator doesn't directly follow this one * 3. this separator won't be the first or last item in the menu */ if (labelIsClientCommand) { if (CreateClientCommandSeparator(menuItem, n, (n > 0 ? children[n - 1] : (Widget) NULL), &menuItem)) { /* Increment the counter here because we only increment at the end of the loop if the item is not a client command item (i.e. labelIsClientCommand == FALSE) */ children[n++] = XmCreateSeparatorGadget (menuW, SEPARATOR_NAME, (ArgList)NULL, 0); fUseTitleSep = FALSE; } } else #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ { children[n] = XmCreateSeparatorGadget (menuW, SEPARATOR_NAME, (ArgList)NULL, 0); fUseTitleSep = FALSE; } } /* F_Separator */ else #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) if (!labelIsClientCommand) #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* * We will use one of: * * Label * CascadeButton * PushButton */ { /* * Construct the label */ if ((menuItem->labelType == XmPIXMAP) && (labelPixmap = MakeCachedLabelPixmap (pSD, menuW, menuItem->labelBitmapIndex))) { XtSetArg (args[i], XmNlabelType, (XtArgVal) XmPIXMAP); i++; XtSetArg (args[i], XmNlabelPixmap, (XtArgVal) labelPixmap); i++; XtSetArg (args[i], XmNlabelInsensitivePixmap, (XtArgVal) labelPixmap); i++; } else { XtSetArg (args[i], XmNlabelType, (XtArgVal) XmSTRING); i++; XtSetArg (args[i], XmNlabelString, (XtArgVal) (tmpstr = XmStringCreateLocalized(menuItem->label))); i++; sPtr = (StrList *) XtMalloc(sizeof(StrList)); if (sPtr == NULL) { MWarning(((char *)GETMESSAGE(48, 2, "Insufficient memory for menu %s\n")), menuName); return (NULL); } else { sPtr->string = tmpstr; sPtr->next = stringsToFree; stringsToFree = sPtr; } } if (menuItem->wmFunction == F_Title) /* * Add a centered Label gadget for a menu title. * Include separators above and below the title. * Don't include the top one if the title is the first pane item * or immediately follows a user-supplied separator. */ { if (fUseTitleSep) { children[n] = XmCreateSeparatorGadget (menuW, SEPARATOR_NAME, sepArgs, 1); n++; } XtSetArg (args[i], XmNalignment, XmALIGNMENT_CENTER); i++; children[n] = XmCreateLabelGadget (menuW, TITLE_NAME, (ArgList) args, i); n++; children[n] = XmCreateSeparatorGadget (menuW, SEPARATOR_NAME, sepArgs, 1); /* * A following title will have both separators. */ fUseTitleSep = TRUE; } else /* * We will use one of: * * CascadeButton * PushButton * * Both support mnemonics; only PushButtons support accelerators. */ { /* * Align text on the left. * Set any mnemonic text. */ XtSetArg (args[i], XmNalignment, XmALIGNMENT_BEGINNING); i++; if (menuItem->mnemonic) { XtSetArg (args[i], XmNmnemonic, (XtArgVal) menuItem->mnemonic); i++; } if (menuItem->wmFunction == F_Menu) /* * Create a PopupShell and PulldownMenu for a submenu (the * menushells are linked together). * Create a CascadeButton Widget * The submenu widget is attached to the CascadeButton gadget * using the subMenuId resource. * Make the CascadeButton insensitive if the submenu cannot be * created. */ { subMenuW = CREATE_MENU_WIDGET (pSD, pCD, menuItem->wmFuncArgs, menuW, FALSE, topMenuSpec, (MenuItem *)NULL); if (subMenuW) /* * Attach submenu to cascade button. */ { XtSetArg (args[i], XmNsubMenuId, (XtArgVal) subMenuW); i++; children[n] = XmCreateCascadeButtonGadget (menuW, CASCADE_BTN_NAME, (ArgList) args, i); #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) XtAddCallback(children[n], XmNcascadingCallback, (XtCallbackProc)AdjustTearOffControl, (XtPointer)subMenuW); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ } else /* * Unable to create submenupane: make the entry insensitive. */ { children[n] = XmCreateCascadeButtonGadget (menuW, CASCADE_BTN_NAME, (ArgList) args, i); XtSetSensitive (children[n], FALSE); } /* * A following title will have both separators. */ fUseTitleSep = TRUE; } else /* * Create a PushButton gadget. */ { /* * If an accelerator is specified, set acceleratorText, * then create an accelerator KeySpec and insert it at the * head of the toplevel MenuSpec's list. */ if (menuItem->accelText) { XtSetArg (args[i], XmNacceleratorText, (XtArgVal) (tmpstr = XmStringCreateLocalized(menuItem->accelText))); i++; sPtr = (StrList *) XtMalloc(sizeof(StrList)); if (sPtr == NULL) { MWarning(((char *)GETMESSAGE(48, 2, "Insufficient memory for menu %s\n")), menuName); return (NULL); } else { sPtr->string = tmpstr; sPtr->next = stringsToFree; stringsToFree = sPtr; } if ((accelKeySpec = (KeySpec *) XtMalloc (sizeof (KeySpec ))) == NULL) /* Handle insufficent memory */ { MWarning (((char *)GETMESSAGE(48, 6, "Insufficient memory for menu %s\n")), menuName); menuSpec->currentContext &= ~CR_MENU_MARK; return (NULL); } accelKeySpec->state = menuItem->accelState; accelKeySpec->keycode = menuItem->accelKeyCode; accelKeySpec->context = topMenuSpec->accelContext; accelKeySpec->subContext = 0; accelKeySpec->wmFunction = menuItem->wmFunction; accelKeySpec->wmFuncArgs = menuItem->wmFuncArgs; accelKeySpec->nextKeySpec = topMenuSpec->accelKeySpecs; topMenuSpec->accelKeySpecs = accelKeySpec; } children[n] = XmCreatePushButtonGadget (menuW, PUSH_BTN_NAME, (ArgList) args, i); /* * Set sensitivity. Initially we only consider the context * of the top level menupane. */ if (menuItem->greyedContext & topMenuSpec->currentContext) /* insensitive button in this context*/ { XtSetSensitive (children[n], FALSE); } else /* sensitive button in this context*/ { XtSetSensitive (children[n], TRUE); } /* * If necessary, fill a menuButtons element for this * PushButton. Malloc or Realloc the array if necessary. */ if ((menuItem->greyedContext) || (menuItem->mgtMask)) { if (!SavePBInfo (topMenuSpec, menuItem, children[n])) { MWarning(((char *)GETMESSAGE(48, 7, "Insufficient memory for menu %s\n")), menuName); menuSpec->currentContext &= ~CR_MENU_MARK; return (NULL); } } /* * Set up the function callback. * A following title will have both separators. */ XtAddCallback (children[n], XmNactivateCallback, (XtCallbackProc)ActivateCallback, (XtPointer) menuItem); fUseTitleSep = TRUE; } } } /* * Increment the children array count if we actually * created a new child. */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) if (!labelIsClientCommand) #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ n++; /* * Next menu item: handle custom items and full children[]. */ menuItem = menuItem->nextMenuItem; if ((menuItem == NULL) && (moreMenuItems != NULL)) { menuSpec->menuItems = menuItem = moreMenuItems; moreMenuItems = NULL; } if (n >= CHILDREN_CACHE - 2) /* leave room for title separators */ { XtManageChildren (children, n); n = 0; } } if (n > 0) { XtManageChildren (children, n); } /* * Get the initial height of the top level menu pane shell. * The actual height will change according to clientFunctions. */ if (fTopLevelPane) { i = 0; XtSetArg (args[i], XtNheight, &menuHeight); i++; XtGetValues (menuW, (ArgList)args, i); topMenuSpec->height = (unsigned int) menuHeight; } #ifndef IBM_151913 /* * Check if the menu that's been created is higher than the screen. * If it is, force it to wrap. Taken straight from the 1.1 fix. */ i = 0; XtSetArg (args[i], XtNheight, &menuHeight); i++; XtGetValues (menuW, (ArgList)args, i); scr = XtScreen (menuW); if (menuHeight > (Dimension)scr->height) { i = 0; XtSetArg (args[i], XmNresizeHeight, (XtArgVal) FALSE); i++; XtSetArg (args[i], XmNpacking, (XtArgVal) XmPACK_TIGHT); i++; XtSetArg (args[i], XmNorientation, (XtArgVal) XmVERTICAL); i++; XtSetArg (args[i], XmNheight, scr->height); i++; XtSetValues (menuW, (ArgList)args, i); } #endif /* IBM_151913 */ /* free the string that may have been created earlier. */ for (sPtr = stringsToFree; sPtr != NULL; ) { stringsToFree = stringsToFree->next; XmStringFree(sPtr->string); XtFree((char *)sPtr); sPtr = stringsToFree; } /* Unmark the menu specification and return. */ menuSpec->currentContext &= ~CR_MENU_MARK; return (menuW); } /* END OF FUNCTION CreateMenuWidget */ /*************************************<->************************************* * * PostMenu (menuSpec, pCD, x, y, button, newContext, flags, passedInEvent) * * * Description: * ----------- * This function is used to post a menu at a particular location. * * * Inputs: * ------ * menuSpec = menu specification * pCD = client data * x,y = position to post the menu if (flags & POST_AT_XY) set * button = button number posting the menu or NoButton (WmGlobal.h) if * posted by a key * newContext = context that the menu is to be posted under. * flags = POST_AT_XY bit set iff x,y are valid, else compute from pCD * POST_TRAVERSAL_ON bit set if set traversal on * * Outputs: * ------- * menuSpec = menu specification with modifications * wmGD.menuClient = pCD * wmGD.menuActive = menuSpec * * * Comments: * -------- * Accepts x,y only if POST_AT_XY flag bit set. Otherwise, computes from pCD. * Adjusts PushButton sensitivity according to context and function type. * Manages/Unmanages PushButtons according to clientFunction resource. * Sets traversal on if button==NoButton or POST_TRAVERSAL_ON flag bit set. * *************************************<->***********************************/ void PostMenu (MenuSpec *menuSpec, ClientData *pCD, int x, int y, unsigned int button, Context newContext, long flags, XEvent *passedInEvent) { int i; Arg args[3]; unsigned int whichButton; Dimension menuHeight; XButtonPressedEvent event; Window saveWindow; Display *saveDisplay; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) Boolean menuAdjusted; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ if ((menuSpec == NULL) || (menuSpec->menuWidget == NULL)) { return; } /* * Don't post a menu from an icon in the iconbox if the * icon is not visible */ if((newContext == F_SUBCONTEXT_IB_WICON || newContext == F_SUBCONTEXT_IB_IICON) && (!(IconVisible(pCD)))) { return; } /* * Set grabContext to be used in GrabWin when no event is passed * to GrabWin. */ wmGD.grabContext = newContext; /* * Adjust PushButton sensitivity and manage/unmanage status. * If the manage status of the system menu has changed, * then get the height of the top level menu pane shell and * cache it in its MenuSpec. * * Also... * Adjust the tear off control. If we are posting this menu from * a client then force the tear off to be disabled. NOTE: This must * be done after wmGD.menuClient has been set. * Since turning off the tear-off control could result in a height * change, we may need to remeasure things. (CR 9316) */ #ifdef WSM if(pCD && pCD->clientFlags & ICON_BOX) { newContext |= F_CONTEXT_ICONBOX; } #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) menuAdjusted = AdjustTearOffControl(NULL, (XtPointer) (menuSpec->menuWidget), NULL); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ if (AdjustPBs (menuSpec, pCD, newContext) #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) || menuAdjusted #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ ) { i = 0; XtSetArg (args[i], XtNheight, &menuHeight); i++; XtGetValues (menuSpec->menuWidget, (ArgList)args, i); menuSpec->height = (unsigned int) menuHeight; } menuSpec->currentContext = newContext; /* * Adjust the whichButton resource if necessary. * Use SELECT_BUTTON for NoButton. */ whichButton = (button == NoButton) ? SELECT_BUTTON : button; if (whichButton != menuSpec->whichButton) { i = 0; XtSetArg (args[i], XmNwhichButton, (XtArgVal) whichButton); i++; XtSetValues (menuSpec->menuWidget, args, i); menuSpec->whichButton = whichButton; } /* * Determine the position of the popup menu. * Compute position if necessary (system menu). */ if (!(flags & POST_AT_XY)) /* compute the position */ { GetSystemMenuPosition (pCD, &x, &y, menuSpec->height, newContext); } event.x_root = x; event.y_root = y; XmMenuPosition (menuSpec->menuWidget, &event); wmGD.menuClient = pCD; wmGD.menuActive = menuSpec; /* set to NULL within UnmapCallback() */ /* * Post the menu by managing its top-level RowColumn. * * First dispatch the event to set the time stamp in the toolkit */ if(passedInEvent) { saveWindow = passedInEvent->xany.window; saveDisplay = passedInEvent->xany.display; passedInEvent->xany.window = 0; passedInEvent->xany.display = XtDisplay(menuSpec->menuWidget); XtDispatchEvent(passedInEvent); passedInEvent->xany.window = saveWindow; passedInEvent->xany.display = saveDisplay; /* If menu posted by ButtonPress/ButtonRelease, release grabs. */ if ((passedInEvent->type == ButtonPress) || (passedInEvent->type == ButtonRelease)) XUngrabPointer(passedInEvent->xany.display, passedInEvent->xbutton.time); } #ifndef ALTERNATE_POSTMENU XtManageChild (menuSpec->menuWidget); #else if (flags & POST_STICKY) { _XmSetPopupMenuClick(menuSpec->menuWidget, True); } else { _XmSetPopupMenuClick(menuSpec->menuWidget, False); } /* * Post the menu by calling the convenience routine that verifies * the button event, updates the Xt timestamp, and finally manages * the pane. */ _XmPostPopupMenu( menuSpec->menuWidget, passedInEvent); #endif /* * set the traversal state. */ if ((button == NoButton) || (flags & POST_TRAVERSAL_ON)) /* turn traversal on */ { TraversalOn (menuSpec); } else /* turn traversal off */ { TraversalOff (menuSpec); } } /* END OF FUNCTION PostMenu */ /*************************************<->************************************* * * UnpostMenu (menuSpec) * * * Description: * ----------- * This function is used to unpost a menu. * * * Inputs: * ------ * menuSpec = menu specification * * Outputs: * ------- * None. * * * Comments: * -------- * wmGD.menuActive and wmGD.menuUnpostKey are set to NULL within * UnmapCallback. * *************************************<->***********************************/ void UnpostMenu (MenuSpec *menuSpec) { if (menuSpec && (menuSpec->menuWidget)) /* * Unpost the menu by unmanaging its top-level RowColumn. */ { XtUnmanageChild (menuSpec->menuWidget); #ifndef OLD_COLORMAP ForceColormapFocus (ACTIVE_PSD, ACTIVE_PSD->colormapFocus); #endif } } /* END OF FUNCTION UnpostMenu */ /*************************************<->************************************* * * ActivateCallback (w, client_data, call_data) * * * Description: * ----------- * This function is called whenever a menu item is selected. * * * Inputs: * ------ * w = menubuttonWidget * client_data = pointer to menu button's MenuItem structure * call_data = not used * wmGD.menuClient = pointer to client's ClientData structure * * * Outputs: * ------- * None. * * * Comments: * -------- * None. * *************************************<->***********************************/ void ActivateCallback (Widget w, caddr_t client_data, caddr_t call_data) { WmScreenData *pSD; /* set active screen */ pSD = GetScreenForWindow (XtWindow(w)); if (pSD) SetActiveScreen (pSD); ((MenuItem *)client_data)->wmFunction ( ((MenuItem *)client_data)->wmFuncArgs, wmGD.menuClient, NULL); } /* END OF FUNCTION ActivateCallback */ /*************************************<->************************************* * * UnmapCallback (w, client_data, call_data) * * * Description: * ----------- * This function is called whenever a toplevel RowColumn is unmapped. * * * Inputs: * ------ * w = * client_data = not used * call_data = not used * wmGD.gadgetClient = last client with depressed client * * * Outputs: * ------- * wmGD.menuActive = NULL * wmGD.menuUnpostKeySpec = NULL * wmGD.checkHotspot = FALSE * * * Comments: * -------- * None. * *************************************<->***********************************/ static void UnmapCallback (Widget w, XtPointer client_data, XtPointer call_data) { wmGD.menuActive = NULL; wmGD.menuUnpostKeySpec = NULL; wmGD.checkHotspot = FALSE; if (wmGD.gadgetClient) { PopGadgetOut(wmGD.gadgetClient, FRAME_SYSTEM); } #ifndef OLD_COLORMAP ForceColormapFocus (ACTIVE_PSD, ACTIVE_PSD->colormapFocus); #endif PullExposureEvents(); } /* END OF FUNCTION UnmapCallback */ /*************************************<->************************************* * * MWarning (message) * * * Description: * ----------- * This function lists a message to stderr. * * * Inputs: * ------ * format = pointer to a format string * message = pointer to a message string * *************************************<->***********************************/ void MWarning (char *format, char *message) { if (strlen(format) + strlen(message) < (size_t) MAXWMPATH) { char pch[MAXWMPATH+1]; sprintf (pch, format, message); Warning (pch); } } /* END OF FUNCTION MWarning */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * UnmapPulldownCallback (w, client_data, call_data) * * * Description: * ----------- * * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ static void UnmapPulldownCallback (Widget w, XtPointer client_data, XtPointer call_data) { wmGD.menuActive = (MenuSpec *) NULL; } /* END OF FUNCTION UnmapPulldownCallback */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * TraversalOff (menuSpec) * * * Description: * ----------- * This function turns menu traversal off. * * * Inputs: * ------ * menuSpec = menu specification * * * Outputs: * ------- * None. * * * Comments: * -------- * None. * *************************************<->***********************************/ void TraversalOff (MenuSpec *menuSpec) { if (menuSpec && (menuSpec->menuWidget)) { /* function pointer */ (*((XmRowColumnWidgetClass) XtClass (menuSpec->menuWidget)) ->row_column_class.menuProcedures) /* argument list */ (XmMENU_TRAVERSAL, menuSpec->menuWidget, False, NULL, NULL); } } /* END OF FUNCTION TraversalOff */ /*************************************<->************************************* * * TraversalOn (menuSpec) * * * Description: * ----------- * This function turns menu traversal on. * * * Inputs: * ------ * menuSpec = menu specification * * * Outputs: * ------- * None. * * * Comments: * -------- * None. * *************************************<->***********************************/ void TraversalOn (MenuSpec *menuSpec) { if (menuSpec && (menuSpec->menuWidget)) { /* function pointer */ (*((XmRowColumnWidgetClass) XtClass (menuSpec->menuWidget)) ->row_column_class.menuProcedures) /*argument list */ (XmMENU_TRAVERSAL, menuSpec->menuWidget, True, NULL, NULL); } } /* END OF FUNCTION TraversalOn */ /*************************************<->************************************* * * FreeCustomMenuSpec (menuSpec) * * * Description: * ----------- * This procedure destroys a custom MenuSpec structure and its associated * menu widget, menuItems list, menuButtons array, and menu accelerator list. * * * Inputs: * ------ * menuSpec = MenuSpec structure * * * Outputs: * ------- * None. * * * Comments: * -------- * Assumes that a MenuSpec is custom iff its name is NULL. * * Assumes that ParseWmFuncStr() has parsed a menu item's function * argument only for F_Exec and F_Menu. If it is used for other functions, * be sure to include them here! * *************************************<->***********************************/ void FreeCustomMenuSpec (MenuSpec *menuSpec) { MenuItem *menuItem; MenuItem *nextMenuItem; KeySpec *accelKeySpec; KeySpec *nextAccelKeySpec; /* Fix memory leak: use menuSpec->clientLocal to identify custom menus instead of menuSpec->name */ if ((menuSpec == NULL) || (menuSpec->clientLocal == FALSE)) /* we only destroy custom menus! */ { return; } /* * Fix for CR 5450 - If the custom menu is the same as wmGD.menuActive, call * the UnmapCallback directly to clean things up. Since * the menu is going to be destroyed, this callback will * not get called, leaving MWM in a failure state. */ if (wmGD.menuActive == menuSpec) UnmapCallback((Widget)NULL, (caddr_t)NULL, (caddr_t)NULL); /* * End fix for CR 5450 */ if (menuSpec->name != NULL) XtFree(menuSpec->name); menuItem = menuSpec->menuItems; while (menuItem) { nextMenuItem = menuItem->nextMenuItem; FreeMenuItem (menuItem); menuItem = nextMenuItem; } if (menuSpec->menuButtons) { XtFree ((char *)menuSpec->menuButtons); } accelKeySpec = menuSpec->accelKeySpecs; while (accelKeySpec) { nextAccelKeySpec = accelKeySpec->nextKeySpec; XtFree ((char *)accelKeySpec); accelKeySpec = nextAccelKeySpec; } if (menuSpec->menuWidget) /* destroy all children of the menu's MenuShell parent */ { XtDestroyWidget (XtParent(menuSpec->menuWidget)); } XtFree ((char *)menuSpec); } /* END OF FUNCTION FreeCustomMenuSpec */ motif-2.3.8/clients/mwm/WmIDecor.c0000644000175000017500000014154713145162623013660 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmIDecor.c /main/6 1996/06/20 09:38:43 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include #include /* for XmeClearBorder */ /* * include extern functions */ #include "WmIDecor.h" #include "WmError.h" #include "WmGraphics.h" #include "WmIconBox.h" #include "WmMenu.h" #include "WmWinInfo.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ /* * Global Variables: */ static unsigned int activeIconTextWidth = 1; static unsigned int activeIconTextHeight = 1; static RList *pActiveIconTopRects = NULL; static RList *pActiveIconBotRects = NULL; static int iconShrinkX; static int iconShrinkY; static unsigned int iconShrinkWidth; static unsigned int iconShrinkHeight; /*************************************<->************************************* * * MakeIcon (pWS, pcd) * * * Description: * ----------- * Create an icon frame and fill it in as appropriate for the client. * * * Inputs: * ------ * pWS - pointer to workspace data * pcd - pointer to client data * * * Outputs: * ------- * Return - TRUE if success, FALSE if failure. * * * Comments: * -------- * * *************************************<->***********************************/ Boolean MakeIcon (WmWorkspaceData *pWS, ClientData *pcd) { XSetWindowAttributes window_attribs; unsigned long attr_mask; int xOffset; int yOffset; #ifdef WSM WsClientData *pWsc = GetWsClientData (pWS, pcd); #endif /* WSM */ /* * Common to all icons */ /* compute dimensions of outer icon frame */ /* create icon frame window */ attr_mask = CWEventMask | CWCursor; window_attribs.event_mask = (ButtonPressMask | ButtonReleaseMask | SELECT_BUTTON_MOTION_MASK | DMANIP_BUTTON_MOTION_MASK | ExposureMask | SubstructureRedirectMask | FocusChangeMask); window_attribs.cursor = wmGD.workspaceCursor; if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) || (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER)) { window_attribs.event_mask |= EnterWindowMask | LeaveWindowMask; } /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (ICON_APPEARANCE(pcd).backgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = ICON_APPEARANCE(pcd).backgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = ICON_APPEARANCE(pcd).background; } #ifdef WSM if ((!pcd->pSD->useIconBox) || (pcd->clientFlags & (CLIENT_WM_CLIENTS | FRONT_PANEL_BOX))) #else if ((!pcd->pSD->useIconBox) || (pcd->clientFlags & ICON_BOX)) #endif /* WSM */ { #ifdef WSM pWsc->iconFrameWin = XCreateWindow (DISPLAY, ROOT_FOR_CLIENT(pcd), /* parent */ pWsc->iconX, pWsc->iconY, #else /* WSM */ pcd->iconFrameWin = XCreateWindow (DISPLAY, ROOT_FOR_CLIENT(pcd), /* parent */ pcd->iconX, pcd->iconY, #endif /* WSM */ (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_HEIGHT(pcd), 0, /* border width */ CopyFromParent, /* depth */ InputOutput, /* class */ CopyFromParent, /* visual */ attr_mask, &window_attribs); } else { /* * Insert the icon into the icon box. * Don't make icon in the box for any icon box (or any WM window) * OR any client that doesn't have the MWM_FUNC_MINIMIZE bit set * in pcd->clientFunctions */ if ((pcd->pSD->useIconBox) && #ifdef WSM (!(pcd->clientFlags & CLIENT_WM_CLIENTS)) && #else (!(pcd->clientFlags & ICON_BOX)) && #endif /* WSM */ (pcd->clientFunctions & MWM_FUNC_MINIMIZE) ) { if (!InsertIconIntoBox(pWS->pIconBox, pcd)) Warning(((char *)GETMESSAGE(30, 1, "Could not make icon to go in icon box"))); } } /* make space for the top/bottom changing shadow rectangles */ if ((pcd->piconTopShadows = AllocateRList ((unsigned)NUM_BOTH_TOP_RECTS)) == NULL) { /* Out of memory! */ Warning (((char *)GETMESSAGE(30, 2, "Insufficient memory for icon creation"))); return(FALSE); } if ((pcd->piconBottomShadows = AllocateRList ((unsigned)NUM_BOTH_BOTTOM_RECTS)) == NULL) { /* Out of memory! */ Warning (((char *)GETMESSAGE(30, 3, "Insufficient memory for icon creation"))); return(FALSE); } /* * Adjust for icons in the box * Don't adjust the icon for the icon box itself */ #ifdef PANELIST if (pWS->pIconBox && (pWS->pIconBox->pCD_iconBox != pcd) && !(pcd->clientFlags & FRONT_PANEL_BOX)) #else /* PANELIST */ if (pWS->pIconBox && (pWS->pIconBox->pCD_iconBox != pcd)) #endif /* PANELIST */ { xOffset = IB_MARGIN_WIDTH; yOffset = IB_MARGIN_HEIGHT; } else { xOffset = 0; yOffset = 0; } /* * Reparent the icon window if there is one */ if ((ICON_DECORATION(pcd) & ICON_IMAGE_PART) && (pcd->iconWindow)) { ReparentIconWindow (pcd, xOffset, yOffset); } #ifdef WSM if (pcd->piconTopShadows->used == 0) #endif /* WSM */ MakeIconShadows (pcd, xOffset, yOffset); return(TRUE); } /* END OF FUNCTION MakeIcon */ /*************************************<->************************************* * * MakeIconShadows (pcd, xOffset, yOffset) * * Comments: * -------- * *************************************<->***********************************/ void MakeIconShadows (ClientData *pcd, int xOffset, int yOffset) { /* * Handle different icon styles */ switch (ICON_DECORATION(pcd) & (ICON_LABEL_PART | ICON_IMAGE_PART)) { case ICON_LABEL_PART: BevelRectangle (pcd->piconTopShadows, /* label */ pcd->piconBottomShadows, 0 + xOffset, (int)ICON_IMAGE_HEIGHT(pcd) + yOffset, (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_LABEL_HEIGHT(pcd), ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH); break; case ICON_IMAGE_PART: BevelRectangle (pcd->piconTopShadows, /* image outside */ pcd->piconBottomShadows, 0 + xOffset, 0 + yOffset, (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_IMAGE_HEIGHT(pcd), ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH); if (wmGD.frameStyle == WmRECESSED) BevelRectangle (pcd->piconBottomShadows, /* image inside */ pcd->piconTopShadows, ICON_INNER_X_OFFSET + xOffset, ICON_INNER_Y_OFFSET + yOffset, (unsigned int) (ICON_IMAGE_MAXIMUM(pcd).width + 4*ICON_INTERNAL_SHADOW_WIDTH), (unsigned int) (ICON_IMAGE_MAXIMUM(pcd).height + 4*ICON_INTERNAL_SHADOW_WIDTH), ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH); break; case (ICON_IMAGE_PART | ICON_LABEL_PART): if (wmGD.frameStyle == WmSLAB) { BevelRectangle (pcd->piconTopShadows, /* image outside */ pcd->piconBottomShadows, 0 + xOffset, 0 + yOffset, (unsigned int) ICON_WIDTH(pcd), (unsigned int) (ICON_IMAGE_HEIGHT(pcd) + ICON_LABEL_HEIGHT(pcd)), ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH); } else { BevelRectangle (pcd->piconTopShadows, /* image outside */ pcd->piconBottomShadows, 0 + xOffset, 0 + yOffset, (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_IMAGE_HEIGHT(pcd), ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH); } if (wmGD.frameStyle == WmRECESSED) BevelRectangle (pcd->piconBottomShadows, /* image inside */ pcd->piconTopShadows, ICON_INNER_X_OFFSET + xOffset, ICON_INNER_Y_OFFSET + yOffset, (unsigned int) (ICON_IMAGE_MAXIMUM(pcd).width + 4*ICON_INTERNAL_SHADOW_WIDTH), (unsigned int) (ICON_IMAGE_MAXIMUM(pcd).height + 4*ICON_INTERNAL_SHADOW_WIDTH), ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH); if (wmGD.frameStyle == WmRECESSED) BevelRectangle (pcd->piconTopShadows, /* label */ pcd->piconBottomShadows, 0 + xOffset, (int)ICON_IMAGE_HEIGHT(pcd) + yOffset, (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_LABEL_HEIGHT(pcd), ICON_INTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH); break; } } /* END OF FUNCTION MakeIconShadows */ /*************************************<->************************************* * * IconExposureProc (pcd, expose) * * * Description: * ----------- * Repaint the icon. * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void IconExposureProc (ClientData *pcd, Boolean expose) { Pixmap image; int dest_x, dest_y; int xOffset; int yOffset; unsigned int width, height; GC iconGC, topGC, botGC; static XRectangle shrinkRects[4]; /* * Adjust for icons in the iconBox */ if (P_ICON_BOX(pcd)) { xOffset = IB_MARGIN_WIDTH; yOffset = IB_MARGIN_HEIGHT; } else { xOffset = 0; yOffset = 0; } /* get appropriate GCs */ if ((wmGD.keyboardFocus == pcd) && (pcd->clientState == MINIMIZED_STATE)) { iconGC = ICON_APPEARANCE(pcd).activeGC; topGC = ICON_APPEARANCE(pcd).activeTopShadowGC; botGC = ICON_APPEARANCE(pcd).activeBottomShadowGC; } else { iconGC = ICON_APPEARANCE(pcd).inactiveGC; topGC = ICON_APPEARANCE(pcd).inactiveTopShadowGC; botGC = ICON_APPEARANCE(pcd).inactiveBottomShadowGC; } if (ACTIVE_PSD->useIconBox && P_ICON_BOX(pcd)) { /* draw shadowing */ if (expose) { XClearArea (DISPLAY, ICON_FRAME_WIN(pcd), IB_MARGIN_WIDTH, IB_MARGIN_HEIGHT, (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_HEIGHT(pcd), False); } if (pcd->clientState == MINIMIZED_STATE) { /* * This is the "raised" icon appearance */ if (pcd->piconTopShadows) { XFillRectangles (DISPLAY, ICON_FRAME_WIN(pcd), topGC, pcd->piconTopShadows->prect, pcd->piconTopShadows->used); } if (pcd->piconBottomShadows) { XFillRectangles (DISPLAY, ICON_FRAME_WIN(pcd), botGC, pcd->piconBottomShadows->prect, pcd->piconBottomShadows->used); } } else { shrinkRects[0].x = IB_MARGIN_WIDTH; shrinkRects[0].y = IB_MARGIN_HEIGHT; shrinkRects[0].width = (unsigned int) ICON_WIDTH(pcd); shrinkRects[0].height = iconShrinkY - IB_MARGIN_HEIGHT; shrinkRects[1].x = IB_MARGIN_WIDTH; shrinkRects[1].y = iconShrinkY; shrinkRects[1].width = iconShrinkX - IB_MARGIN_WIDTH; shrinkRects[1].height = iconShrinkHeight; shrinkRects[2].x = iconShrinkX + iconShrinkWidth; shrinkRects[2].y = iconShrinkY; shrinkRects[2].width = iconShrinkX - IB_MARGIN_WIDTH; shrinkRects[2].height = iconShrinkHeight; shrinkRects[3].x = IB_MARGIN_WIDTH; shrinkRects[3].y = iconShrinkY + iconShrinkHeight; shrinkRects[3].width = (unsigned int) ICON_WIDTH(pcd); shrinkRects[3].height = iconShrinkY - IB_MARGIN_HEIGHT; XFillRectangles (DISPLAY, ICON_FRAME_WIN(pcd), SHRINK_WRAP_GC(pcd), &shrinkRects[0], 4); } } else { /* draw shadowing */ if (pcd->clientState == MINIMIZED_STATE) { /* * This is the "raised" icon appearance */ if (pcd->piconTopShadows->prect) { XFillRectangles (DISPLAY, ICON_FRAME_WIN(pcd), topGC, pcd->piconTopShadows->prect, pcd->piconTopShadows->used); } if (pcd->piconBottomShadows->prect) { XFillRectangles (DISPLAY, ICON_FRAME_WIN(pcd), botGC, pcd->piconBottomShadows->prect, pcd->piconBottomShadows->used); } } } /* draw icon text */ /* if ((ICON_DECORATION(pcd) & ICON_LABEL_PART) && (expose || !(ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART))) */ if (ICON_DECORATION(pcd) & ICON_LABEL_PART) { DrawIconTitle (pcd); } /* * Draw image if no icon window (client has to redraw that!) * OR if using the iconbox, draw the default image where * the icon window was. */ if (expose && ((!pcd->iconWindow && (ICON_DECORATION(pcd) & ICON_IMAGE_PART)) || (ACTIVE_PSD->useIconBox && P_ICON_BOX(pcd) && pcd->iconWindow && pcd->clientState != MINIMIZED_STATE && (ICON_DECORATION(pcd) & ICON_IMAGE_PART)))) { if (pcd->iconWindow) { image = DEFAULT_PIXMAP(pcd); } else { image = pcd->iconPixmap; } if (image) { if ((ACTIVE_PSD->useIconBox) && (P_ICON_BOX(pcd))) { if (pcd->clientState != MINIMIZED_STATE) { dest_x = ICON_IMAGE_X_OFFSET + ICON_INTERNAL_SHADOW_WIDTH + xOffset; dest_y = ICON_IMAGE_Y_OFFSET + ICON_INTERNAL_SHADOW_WIDTH + yOffset; if (wmGD.frameStyle == WmSLAB) { /* less beveling in this style */ dest_x -= ICON_INTERNAL_SHADOW_WIDTH; dest_y -= ICON_INTERNAL_SHADOW_WIDTH; } width = ICON_IMAGE_MAXIMUM(pcd).width; height= ICON_IMAGE_MAXIMUM(pcd).height; if (wmGD.frameStyle == WmSLAB) { width += 2; height += 2; } XCopyArea (DISPLAY, image, ICON_FRAME_WIN(pcd), iconGC, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, width, height, dest_x, dest_y); if (FADE_NORMAL_ICON(pcd)) { iconGC = FADE_ICON_GC(pcd); XFillRectangle (DISPLAY, ICON_FRAME_WIN(pcd), iconGC, dest_x, dest_y, width, height); } } else { dest_x = ICON_IMAGE_X_OFFSET + xOffset; dest_y = ICON_IMAGE_Y_OFFSET + yOffset; if (wmGD.frameStyle == WmSLAB) { /* less beveling in this style */ dest_x -= ICON_INTERNAL_SHADOW_WIDTH; dest_y -= ICON_INTERNAL_SHADOW_WIDTH; } width = ICON_IMAGE_MAXIMUM(pcd).width + (2 * ICON_INTERNAL_SHADOW_WIDTH); height= ICON_IMAGE_MAXIMUM(pcd).height + (2 * ICON_INTERNAL_SHADOW_WIDTH); if (wmGD.frameStyle == WmSLAB) { width += 2; height += 2; } XCopyArea (DISPLAY, image, ICON_FRAME_WIN(pcd), iconGC, 0, 0, width, height, dest_x, dest_y); } } else { width = ICON_IMAGE_MAXIMUM(pcd).width + 2 * ICON_INTERNAL_SHADOW_WIDTH; height= ICON_IMAGE_MAXIMUM(pcd).height + 2 * ICON_INTERNAL_SHADOW_WIDTH; if (wmGD.frameStyle == WmSLAB) { dest_x = ICON_INNER_X_OFFSET; dest_y = ICON_INNER_Y_OFFSET; width += 2; height += 2; } else { dest_x = ICON_INNER_X_OFFSET + ICON_INTERNAL_SHADOW_WIDTH; dest_y = ICON_INNER_Y_OFFSET + ICON_INTERNAL_SHADOW_WIDTH; } XCopyArea (DISPLAY, image, ICON_FRAME_WIN(pcd), iconGC, 0, 0, width, height, dest_x, dest_y); } } } } /* END OF FUNCTION IconExposureProc */ /*************************************<->************************************* * * GetIconTitleBox (pcd, pBox) * * * Description: * ----------- * Returns a rectangle containing the icon text box * * * Inputs: * ------ * pcd - pointer to client data * pBox - pointer to an XRectangle structure that gets returned data * * Outputs: * ------- * pBox - returned data * * Comments: * -------- * *************************************<->***********************************/ void GetIconTitleBox (ClientData *pcd, XRectangle *pBox) { int xOffset; int yOffset; /* * Adjust for icons in the iconBox */ if (P_ICON_BOX(pcd)) { xOffset = IB_MARGIN_WIDTH; yOffset = IB_MARGIN_HEIGHT; } else { xOffset = 0; yOffset = 0; } if ((P_ICON_BOX(pcd)) && (pcd->clientState != MINIMIZED_STATE)) { /* move label up to enhance shrink wrap effect */ pBox->x = ICON_EXTERNAL_SHADOW_WIDTH + ICON_IMAGE_LEFT_PAD + (2 * ICON_INTERNAL_SHADOW_WIDTH) + ICON_IMAGE_LEFT_PAD + xOffset; pBox->y = ICON_IMAGE_HEIGHT(pcd) + yOffset + ((ICON_IMAGE_HEIGHT(pcd) > 0) ? - ICON_IMAGE_BOTTOM_PAD : ICON_EXTERNAL_SHADOW_WIDTH) + ((ICON_IMAGE_HEIGHT(pcd) >0) ? 0 : WM_TOP_TITLE_PADDING ); if (wmGD.frameStyle == WmSLAB) { /* account for less beveling in this style */ pBox->x -= ICON_INTERNAL_SHADOW_WIDTH; pBox->y -= ICON_INTERNAL_SHADOW_WIDTH; } pBox->width = ICON_IMAGE_MAXIMUM(pcd).width + ((wmGD.frameStyle == WmSLAB) ? 2 : 0) - ICON_IMAGE_LEFT_PAD - ICON_EXTERNAL_SHADOW_WIDTH; pBox->height = TEXT_HEIGHT(ICON_APPEARANCE(pcd).font); } else if ((P_ICON_BOX(pcd)) && (pcd->clientState == MINIMIZED_STATE)) { pBox->x = ICON_EXTERNAL_SHADOW_WIDTH + ICON_IMAGE_LEFT_PAD + (2 * ICON_INTERNAL_SHADOW_WIDTH) + ICON_IMAGE_LEFT_PAD + xOffset; pBox->y = ICON_IMAGE_HEIGHT(pcd) + yOffset + ((ICON_IMAGE_HEIGHT(pcd) > 0) ? ICON_INTERNAL_SHADOW_WIDTH : ICON_EXTERNAL_SHADOW_WIDTH) + WM_TOP_TITLE_PADDING ; pBox->width = ICON_IMAGE_MAXIMUM(pcd).width + ((wmGD.frameStyle == WmSLAB) ? 2 : 0) - ICON_IMAGE_LEFT_PAD; pBox->height = TEXT_HEIGHT(ICON_APPEARANCE(pcd).font); if (wmGD.frameStyle == WmSLAB) { /* account for less beveling in this style */ pBox->x -= ICON_INTERNAL_SHADOW_WIDTH + 2*ICON_IMAGE_LEFT_PAD; pBox->y -= 3 * ICON_INTERNAL_SHADOW_WIDTH; pBox->width += ICON_IMAGE_LEFT_PAD + 2; } } else { pBox->x = ICON_EXTERNAL_SHADOW_WIDTH + WM_TOP_TITLE_PADDING + xOffset; if (wmGD.frameStyle == WmSLAB) { /* account for less beveling in this style */ yOffset -= ICON_INTERNAL_SHADOW_WIDTH; } pBox->y = ICON_IMAGE_HEIGHT(pcd) + WM_TOP_TITLE_PADDING + yOffset + ((ICON_IMAGE_HEIGHT(pcd) > 0) ? ICON_INTERNAL_SHADOW_WIDTH : ICON_EXTERNAL_SHADOW_WIDTH); pBox->width = ICON_WIDTH(pcd) - 2 * ICON_EXTERNAL_SHADOW_WIDTH - WM_TOP_TITLE_PADDING - WM_BOTTOM_TITLE_PADDING; pBox->height = TEXT_HEIGHT(ICON_APPEARANCE(pcd).font); } } /* END OF FUNCTION GetIconTitleBox */ /*************************************<->************************************* * * DrawIconTitle (pcd) * * * Description: * ----------- * Draws the title in the Icon title area * * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void DrawIconTitle (ClientData *pcd) { XRectangle textBox; GC iconGC; GetIconTitleBox (pcd, &textBox); /* get appropriate GCs */ #ifdef WSM #ifdef PANELIST if ((ACTIVE_PSD->useIconBox && !((pcd->dtwmBehaviors & (DtWM_BEHAVIOR_PANEL)) || (pcd->clientFlags & CLIENT_WM_CLIENTS))) || #else /* PANELIST */ if ((ACTIVE_PSD->useIconBox && !(pcd->clientFlags & CLIENT_WM_CLIENTS)) || #endif /* PANELIST */ #else if ((ACTIVE_PSD->useIconBox && !(pcd->clientFlags & ICON_BOX)) || #endif /* WSM */ !(wmGD.keyboardFocus == pcd)) { iconGC = ICON_APPEARANCE(pcd).inactiveGC; } else { iconGC = ICON_APPEARANCE(pcd).activeGC; } /* * Dim text if this is in the icon box and the client is mapped */ if ((ACTIVE_PSD->useIconBox) && (P_ICON_BOX(pcd)) && (FADE_NORMAL_ICON(pcd)) && (!(pcd->clientState == MINIMIZED_STATE))) { iconGC = FADE_ICON_TEXT_GC(pcd); } /* paint the text */ #ifdef WSM WmDrawXmString(DISPLAY, ICON_FRAME_WIN(pcd), ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, iconGC, textBox.x, textBox.y, textBox.width, &textBox, True); #else /* WSM */ WmDrawXmString(DISPLAY, ICON_FRAME_WIN(pcd), ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, iconGC, textBox.x, textBox.y, textBox.width, &textBox); #endif /* WSM */ } /* END OF FUNCTION DrawIconTitle */ /*************************************<->************************************* * * RedisplayIconTitle (pcd) * * * Description: * ----------- * Draws the title in the Icon title area * * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void RedisplayIconTitle (ClientData *pcd) { XRectangle textBox; GC iconGC; /* * only proceed if we've got the right icon parts to work on */ if (ICON_DECORATION(pcd) & ICON_LABEL_PART && ICON_FRAME_WIN(pcd)) { /* nothing to do if no labels */ if (!(ICON_DECORATION(pcd) & ICON_LABEL_PART)) return; /* get the box that the text sits in */ GetIconTitleBox (pcd, &textBox); /* * Get appropriate GCs * Dim text if this is in the icon box and the client is mapped */ #ifdef WSM if ((ACTIVE_PSD->useIconBox && (P_ICON_BOX(pcd)) && !(pcd->clientFlags & CLIENT_WM_CLIENTS)) || #else if ((ACTIVE_PSD->useIconBox && (P_ICON_BOX(pcd)) && !(pcd->clientFlags & ICON_BOX)) || #endif /* WSM */ !(wmGD.keyboardFocus == pcd)) { iconGC = ICON_APPEARANCE(pcd).inactiveGC; } else { iconGC = ICON_APPEARANCE(pcd).activeGC; } if ((ACTIVE_PSD->useIconBox) && (P_ICON_BOX(pcd)) && (FADE_NORMAL_ICON(pcd)) && (!(pcd->clientState == MINIMIZED_STATE))) { iconGC = FADE_ICON_TEXT_GC(pcd); } /* out with the old */ XClearArea (DISPLAY, ICON_FRAME_WIN(pcd), textBox.x, textBox.y, (unsigned int) textBox.width, (unsigned int) textBox.height, FALSE); /* in with the new */ #ifdef WSM WmDrawXmString(DISPLAY, ICON_FRAME_WIN(pcd), ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, iconGC, textBox.x, textBox.y, textBox.width, &textBox, True); #else /* WSM */ WmDrawXmString(DISPLAY, ICON_FRAME_WIN(pcd), ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, iconGC, textBox.x, textBox.y, textBox.width, &textBox); #endif /* WSM */ /* * Erase & paint text in the active icon text window */ if ((wmGD.keyboardFocus == pcd) && (ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART)) { PaintActiveIconText (pcd, True); } } } /* END OF FUNCTION RedisplayIconTitle */ /*************************************<->************************************* * * GetIconDimensions (pSD, &pWidth, &pLabelHeight, &pImageHeight) * * * Description: * ----------- * returns dimensions of icon frame parts * * * Inputs: * ------ * pSD - pointer to screen data * pWidth - pointer to width of frame * pLabelHeight - pointer to height of label part of icon * pImageHeight - pointer to height of image part of icon * * * Outputs: * ------- * *pWidth - width of frame * *pLabelHeight - height of label part of icon * *pImageHeight - height of image part of icon * * * Comments: * -------- * *************************************<->***********************************/ void GetIconDimensions (WmScreenData *pSD, unsigned int *pWidth, unsigned int *pLabelHeight, unsigned int *pImageHeight) { /* * The icon width is always keyed to the icon image maximum regardless * of whether an icon image part appears or not. */ *pWidth = pSD->iconImageMaximum.width + ((wmGD.frameStyle == WmSLAB) ? 2 : 0) + ICON_IMAGE_LEFT_PAD + ICON_IMAGE_RIGHT_PAD + 2 * ICON_EXTERNAL_SHADOW_WIDTH + 4 * ICON_INTERNAL_SHADOW_WIDTH; if (wmGD.frameStyle == WmSLAB) { /* less beveling in this style */ *pWidth -= 2 * ICON_INTERNAL_SHADOW_WIDTH; } switch (pSD->iconDecoration & (ICON_IMAGE_PART | ICON_LABEL_PART)) { case ICON_LABEL_PART: *pImageHeight = 0; *pLabelHeight = ICON_EXTERNAL_SHADOW_WIDTH + WM_TOP_TITLE_PADDING + TEXT_HEIGHT(pSD->iconAppearance.font) + WM_BOTTOM_TITLE_PADDING + ICON_EXTERNAL_SHADOW_WIDTH; break; case ICON_IMAGE_PART: *pImageHeight = ICON_EXTERNAL_SHADOW_WIDTH + ICON_IMAGE_TOP_PAD + ICON_INTERNAL_SHADOW_WIDTH + ICON_INTERNAL_SHADOW_WIDTH + pSD->iconImageMaximum.height + ((wmGD.frameStyle == WmSLAB) ? 2 : 0) + ICON_INTERNAL_SHADOW_WIDTH + ICON_INTERNAL_SHADOW_WIDTH + ICON_IMAGE_BOTTOM_PAD + ICON_EXTERNAL_SHADOW_WIDTH; if (wmGD.frameStyle == WmSLAB) { /* less beveling in this style */ *pImageHeight -= 2 * ICON_INTERNAL_SHADOW_WIDTH; } *pLabelHeight = 0; break; case (ICON_IMAGE_PART | ICON_LABEL_PART): *pImageHeight = ICON_EXTERNAL_SHADOW_WIDTH + ICON_IMAGE_TOP_PAD + ICON_INTERNAL_SHADOW_WIDTH + ICON_INTERNAL_SHADOW_WIDTH + pSD->iconImageMaximum.height + ((wmGD.frameStyle == WmSLAB) ? 2 : 0) + ICON_INTERNAL_SHADOW_WIDTH + ICON_INTERNAL_SHADOW_WIDTH + ICON_IMAGE_BOTTOM_PAD + ICON_INTERNAL_SHADOW_WIDTH; *pLabelHeight = ICON_INTERNAL_SHADOW_WIDTH + WM_TOP_TITLE_PADDING + TEXT_HEIGHT(pSD->iconAppearance.font) + WM_BOTTOM_TITLE_PADDING + ICON_EXTERNAL_SHADOW_WIDTH; if (wmGD.frameStyle == WmSLAB) { /* * In this style there is less beveling and no * etching between the icon image and label. */ *pImageHeight -= 3 * ICON_INTERNAL_SHADOW_WIDTH; *pLabelHeight -= ICON_INTERNAL_SHADOW_WIDTH; } break; default: *pLabelHeight = *pImageHeight = 0; break; } } /*************************************<->************************************* * * InitIconSize (pSD) * * * Description: * ----------- * set global icon size variables * * * Inputs: * ------ * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void InitIconSize (WmScreenData *pSD) { Cardinal label, image; GetIconDimensions (pSD, (unsigned int *)&(pSD->iconWidth), &label, &image); pSD->iconHeight = label+image; pSD->iconImageHeight = image; pSD->iconLabelHeight = label; iconShrinkX = IB_MARGIN_WIDTH + ICON_EXTERNAL_SHADOW_WIDTH + ICON_IMAGE_LEFT_PAD + 2 * ICON_INTERNAL_SHADOW_WIDTH; iconShrinkY = IB_MARGIN_HEIGHT + ICON_EXTERNAL_SHADOW_WIDTH + ((pSD->iconDecoration & ICON_IMAGE_PART) ? (ICON_IMAGE_TOP_PAD + (2 * ICON_INTERNAL_SHADOW_WIDTH)) : (WM_TOP_TITLE_PADDING)); if (wmGD.frameStyle == WmSLAB) { /* less beveling in this style */ iconShrinkX -= ICON_INTERNAL_SHADOW_WIDTH; iconShrinkY -= ICON_INTERNAL_SHADOW_WIDTH; } iconShrinkWidth = pSD->iconImageMaximum.width ; if (wmGD.frameStyle == WmSLAB) { iconShrinkWidth += 2; } switch (pSD->iconDecoration & (ICON_IMAGE_PART | ICON_LABEL_PART)) { case ICON_LABEL_PART: iconShrinkHeight = TEXT_HEIGHT(pSD->iconAppearance.font); break; case ICON_IMAGE_PART: iconShrinkHeight = pSD->iconImageMaximum.height; break; case (ICON_IMAGE_PART | ICON_LABEL_PART): iconShrinkHeight = pSD->iconHeight - ICON_EXTERNAL_SHADOW_WIDTH - ICON_IMAGE_TOP_PAD - ICON_INTERNAL_SHADOW_WIDTH - ICON_INTERNAL_SHADOW_WIDTH - ICON_IMAGE_BOTTOM_PAD - WM_BOTTOM_TITLE_PADDING - ICON_EXTERNAL_SHADOW_WIDTH; if (wmGD.frameStyle == WmSLAB) { /* adjust for less beveling in this style */ iconShrinkHeight += ICON_INTERNAL_SHADOW_WIDTH; } break; } } /* END OF FUNCTION InitIconSize */ /*************************************<->************************************* * * ShowActiveIcon (pcd) * * * Description: * ----------- * Paint the icon to indicate an "active" state * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * * Comments: * -------- * * *************************************<->***********************************/ void ShowActiveIcon (ClientData *pcd) { unsigned long attr_mask; XSetWindowAttributes window_attribs; if (ICON_FRAME_WIN(pcd)) { /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (ICON_APPEARANCE(pcd).activeBackgroundPixmap) { attr_mask = CWBackPixmap; window_attribs.background_pixmap = ICON_APPEARANCE(pcd).activeBackgroundPixmap; } else { attr_mask = CWBackPixel; window_attribs.background_pixel = ICON_APPEARANCE(pcd).activeBackground; } /* set active window attributes */ XChangeWindowAttributes (DISPLAY, ICON_FRAME_WIN(pcd), attr_mask, &window_attribs); /* clear the frame to the right background */ if ((!ACTIVE_PSD->useIconBox) || (P_ICON_BOX(pcd) == NULL)) { #ifndef MOTIF_ONE_DOT_ONE if (ICON_DECORATION(pcd) & ICON_IMAGE_PART) { Dimension dheight, dwidth; dwidth = ICON_WIDTH(pcd) - 2*ICON_EXTERNAL_SHADOW_WIDTH; if (ICON_DECORATION(pcd) & ICON_LABEL_PART) { dheight = ICON_IMAGE_HEIGHT(pcd) - ICON_EXTERNAL_SHADOW_WIDTH; } else { dheight = ICON_IMAGE_HEIGHT(pcd) - 2*ICON_EXTERNAL_SHADOW_WIDTH; } if (wmGD.frameStyle == WmRECESSED) { dheight -= ICON_INTERNAL_SHADOW_WIDTH; } XmeClearBorder (DISPLAY, ICON_FRAME_WIN(pcd), ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, dwidth, dheight, ICON_IMAGE_TOP_PAD); } if (ICON_DECORATION(pcd) & ICON_LABEL_PART) { XClearArea (DISPLAY, ICON_FRAME_WIN(pcd), 0, ICON_IMAGE_HEIGHT(pcd), (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_HEIGHT(pcd), False); } #else XClearWindow (DISPLAY, ICON_FRAME_WIN(pcd)); #endif } else { /* * clear only area of real frame, not highlight area */ XClearArea (DISPLAY, ICON_FRAME_WIN(pcd), IB_MARGIN_WIDTH, IB_MARGIN_HEIGHT, (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_HEIGHT(pcd), False); } /* * Put up a big icon text label. */ if (ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) { if (wmGD.activeIconTextDisplayed) PaintActiveIconText(pcd, True); else ShowActiveIconText(pcd); } /* simulate exposure of window */ #ifndef MOTIF_ONE_DOT_ONE IconExposureProc(pcd, False); #else IconExposureProc(pcd, True); #endif } } /* END OF FUNCTION ShowActiveIcon */ /*************************************<->************************************* * * ShowInactiveIcon (pcd, refresh) * * * Description: * ----------- * Make the icon appear "inactive" * * * Inputs: * ------ * pcd - pointer to client data * * refresh - if True redraw the icon * *************************************<->***********************************/ void ShowInactiveIcon (ClientData *pcd, Boolean refresh) { unsigned long attr_mask = 0; XSetWindowAttributes window_attribs; /* turn off the active icon text */ if (ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) { /* pass in screen to fix multiscreen bug [P3385] */ HideActiveIconText(pcd->pSD); } if (ICON_FRAME_WIN(pcd)) { /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (ICON_APPEARANCE(pcd).backgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = ICON_APPEARANCE(pcd).backgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = ICON_APPEARANCE(pcd).background; } /* set active window attributes */ XChangeWindowAttributes (DISPLAY, ICON_FRAME_WIN(pcd), attr_mask, &window_attribs); if (refresh) { /* clear the frame to the right background */ if ((!ACTIVE_PSD->useIconBox) || (P_ICON_BOX(pcd) == NULL)) { #ifndef MOTIF_ONE_DOT_ONE XmeClearBorder (DISPLAY, ICON_FRAME_WIN(pcd), 0, 0, ICON_WIDTH(pcd), ICON_IMAGE_HEIGHT(pcd), 4); XClearArea (DISPLAY, ICON_FRAME_WIN(pcd), 0, ICON_IMAGE_HEIGHT(pcd), (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_HEIGHT(pcd), False); #else XClearWindow (DISPLAY, ICON_FRAME_WIN(pcd)); #endif } else { /* * clear only area of real frame, not highlight area */ XClearArea (DISPLAY, ICON_FRAME_WIN(pcd), IB_MARGIN_WIDTH, IB_MARGIN_HEIGHT, (unsigned int) ICON_WIDTH(pcd), (unsigned int) ICON_HEIGHT(pcd), False); } /* simulate exposure of window */ #ifndef MOTIF_ONE_DOT_ONE IconExposureProc(pcd, False); #else IconExposureProc(pcd, True); #endif } } } /* END OF FUNTION ShowInactiveIcon */ /*************************************<->************************************* * * ReparentIconWindow (pcd, xOffset, yOffset) * * * Description: * ----------- * Reparent the icon window in the center of the image area * * * Inputs: * ------ * pcd - pointer to client data * xOffset - adjusts for icons in the iconBox * yOffset - adjusts for icons in the iconBox * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void ReparentIconWindow (ClientData *pcd, int xOffset, int yOffset) { int x, y, rpX, rpY; unsigned int width, height, bw, depth; Window root; XWindowChanges windowChanges; unsigned int mask; #ifdef PANELIST if (!pcd->pECD) { #endif /* PANELIST */ /* * Check if window size is too big */ XGetGeometry (DISPLAY, pcd->iconWindow, &root, &x, &y, &width, &height, &bw, &depth); /* * strip off previous window border and set window geometry to * fit inside icon frame */ if (width != 0) { mask = CWBorderWidth; windowChanges.border_width = 0; } else { mask = 0; } if (width > ((ICON_IMAGE_MAXIMUM(pcd).width) + ((wmGD.frameStyle == WmSLAB) ? 2 : 0))) { width = windowChanges.width = ICON_IMAGE_MAXIMUM(pcd).width + ((wmGD.frameStyle == WmSLAB) ? 2 : 0); mask |= CWWidth; } else if (width < ICON_IMAGE_MINIMUM(pcd).width) { width = windowChanges.width = ICON_IMAGE_MINIMUM(pcd).width; mask |= CWWidth; } if (height > ((ICON_IMAGE_MAXIMUM(pcd).height) + ((wmGD.frameStyle == WmSLAB) ? 2 : 0))) { height = windowChanges.height = ICON_IMAGE_MAXIMUM(pcd).height + ((wmGD.frameStyle == WmSLAB) ? 2 : 0); mask |= CWHeight; } else if (height < ICON_IMAGE_MINIMUM(pcd).height) { height = windowChanges.height = ICON_IMAGE_MINIMUM(pcd).height; mask |= CWHeight; } if (mask) XConfigureWindow (DISPLAY, pcd->iconWindow, mask, &windowChanges); /* * Reparent the icon window to the center of the icon image frame */ if (ICON_DECORATION(pcd) & ICON_LABEL_PART) { yOffset += ICON_INTERNAL_SHADOW_WIDTH; } rpX = ((ICON_WIDTH(pcd) - width)/2) + xOffset; rpY = ((ICON_IMAGE_HEIGHT(pcd) - height)/2) + yOffset; XReparentWindow (DISPLAY, pcd->iconWindow, ICON_FRAME_WIN(pcd), rpX, rpY); pcd->clientFlags |= ICON_REPARENTED; /* * Map the icon window when the icon frame is mapped. */ #ifdef PANELIST } /* END if (!pcd->pECD) */ #endif /* PANELIST */ } /* END OF FUNCTION ReparentIconWindow */ /*************************************<->************************************* * * PutBoxOnScreen (screen, px, py, width, height) * * * Description: * ----------- * Changes the position of the passed box so that it is all on screen * * * Inputs: * ------ * screen - screen we're talking about * px - pointer to x-coord * py - pointer to y-coord * width - width of box * height - height of box * * Outputs: * ------- * *px - new x-coord * *py - new y-coord * * * Comments: * -------- * *************************************<->***********************************/ void PutBoxOnScreen (int screen, int *px, int *py, unsigned int width, unsigned int height) { /* * Place active label text nicely on screen */ if (*px+width+1 > DisplayWidth (DISPLAY, screen)) *px -= (*px+width+1) - DisplayWidth (DISPLAY, screen); if (*py+height+1 > DisplayHeight (DISPLAY, screen)) *py -= (*py+height+1) - DisplayHeight (DISPLAY, screen); if (*px < 1) *px = 1; if (*py < 1) *py = 1; } /* END OF FUNCTION PutBoxOnScreen */ /*************************************<->************************************* * * PutBoxInIconBox (pCD, px, py, width, height) * * * Description: * ----------- * Changes the position of the passed box so that it is not * clipped by the bulletin board * * * * Inputs: * ------ * pCD - pointer to client data * px - pointer to x-coord * py - pointer to y-coord * width - width of box * height - height of box * * Outputs: * ------- * *px - new x-coord * *py - new y-coord * * * Comments: * -------- * *************************************<->***********************************/ void PutBoxInIconBox (ClientData *pCD, int *px, int *py, unsigned int *width, unsigned int *height) { int i; Arg getArgs[3]; Dimension bBoardWidth; Dimension bBoardHeight; int clipWidth; int clipHeight; i=0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &bBoardWidth ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &bBoardHeight ); i++; XtGetValues (P_ICON_BOX(pCD)->bBoardWidget, getArgs, i); clipWidth = (int) bBoardWidth; clipHeight = (int) bBoardHeight; if (*px + *width-1 > clipWidth) *px -= (*px + *width-1) - clipWidth; if (*py + *height-1 > clipHeight) *py -= (*py + *height-1) - clipHeight; if (*px < 0) *px = 0; if (*py < 0) *py = 0; } /* END OF FUNCTION PutBoxInIconBox */ /*************************************<->************************************* * * CreateActiveIconTextWindow (pSD) * * * Description: * ----------- * creates the window that's popped up when an icon is activated * * Inputs: * ------ * pSD - pointer to screen data * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void CreateActiveIconTextWindow (WmScreenData *pSD) { XSetWindowAttributes window_attribs; unsigned long attr_mask; /* create active icon text window */ attr_mask = CWEventMask| CWCursor; window_attribs.event_mask = ExposureMask; window_attribs.cursor = wmGD.workspaceCursor; /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (pSD->iconAppearance.activeBackgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = pSD->iconAppearance.activeBackgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = pSD->iconAppearance.activeBackground; } pSD->activeIconTextWin = XCreateWindow (DISPLAY, pSD->rootWindow, /* parent */ 0, 0, /* x, y */ 1, 1, /* width, height */ 0, /* border width */ CopyFromParent, /* depth */ InputOutput, /* class */ CopyFromParent, /* visual */ attr_mask, &window_attribs); pSD->activeLabelParent = pSD->rootWindow; } /* END OF FUNCTION CreateActiveIconTextWindow */ /*************************************<->************************************* * * PaintActiveIconText (pcd, erase) * * * Description: * ----------- * * * Inputs: * ------ * pcd - pointer to client data * erase - if true, then erase the area before repainting * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void PaintActiveIconText (ClientData *pcd, Boolean erase) { XRectangle textBox; GC iconGC, topGC, botGC; if (!(ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART)) return; /* get appropriate GCs */ iconGC = ICON_APPEARANCE(pcd).activeGC; topGC = ICON_APPEARANCE(pcd).activeTopShadowGC; botGC = ICON_APPEARANCE(pcd).activeBottomShadowGC; /* draw shadowing */ if (pActiveIconTopRects) { XFillRectangles (DISPLAY, pcd->pSD->activeIconTextWin, topGC, pActiveIconTopRects->prect, pActiveIconTopRects->used); } if (pActiveIconBotRects) { XFillRectangles (DISPLAY, pcd->pSD->activeIconTextWin, botGC, pActiveIconBotRects->prect, pActiveIconBotRects->used); } /* paint the text */ textBox.x = ICON_EXTERNAL_SHADOW_WIDTH; textBox.y = ICON_EXTERNAL_SHADOW_WIDTH; textBox.width = activeIconTextWidth - 2*ICON_EXTERNAL_SHADOW_WIDTH; textBox.height = activeIconTextHeight - 2*ICON_EXTERNAL_SHADOW_WIDTH; if (erase) { XClearArea (DISPLAY, pcd->pSD->activeIconTextWin, textBox.x, textBox.y, (unsigned int) textBox.width, (unsigned int) textBox.height, FALSE); } #ifdef WSM WmDrawXmString(DISPLAY, pcd->pSD->activeIconTextWin, ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, iconGC, textBox.x, textBox.y, textBox.width, &textBox, True); #else /* WSM */ WmDrawXmString(DISPLAY, pcd->pSD->activeIconTextWin, ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, iconGC, textBox.x, textBox.y, textBox.width, &textBox); #endif /* WSM */ } /* END OF FUNCTION PaintActiveIconText */ /*************************************<->************************************* * * ShowActiveIconText (pcd) * * * Description: * ----------- * * * Inputs: * ------ * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void ShowActiveIconText (ClientData *pcd) { XWindowAttributes iconFrameAttribs; XSetWindowAttributes window_attribs; XWindowChanges windowChanges; unsigned int mask; int x, y; unsigned int junk; Window root; Dimension dWidth, dHeight; /* * put up a big icon text label */ if (pcd->pSD->activeIconTextWin) { /* copy event mask from icon frame window */ XGetWindowAttributes (DISPLAY, ICON_FRAME_WIN(pcd), &iconFrameAttribs); /* set attributes of window */ window_attribs.event_mask = iconFrameAttribs.your_event_mask; XChangeWindowAttributes (DISPLAY, pcd->pSD->activeIconTextWin, CWEventMask, &window_attribs); /* set up geometry for the window */ XmStringExtent (ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, &dWidth, &dHeight); activeIconTextHeight = (unsigned int) dHeight + WM_BOTTOM_TITLE_PADDING + 2*ICON_EXTERNAL_SHADOW_WIDTH; activeIconTextWidth = (unsigned int) dWidth; if (activeIconTextWidth < (1.2 * ICON_WIDTH(pcd))) { activeIconTextWidth = 1.2 * ICON_WIDTH(pcd); } activeIconTextWidth += 2*ICON_EXTERNAL_SHADOW_WIDTH; XGetGeometry (DISPLAY, (Drawable) ICON_FRAME_WIN(pcd), &root, &x, &y, &junk, &junk, &junk, &junk); y += ICON_IMAGE_HEIGHT(pcd); x -= (activeIconTextWidth - ICON_WIDTH(pcd))/2; if (!(P_ICON_BOX(pcd))) { /* * This is a normal icon */ PutBoxOnScreen (SCREEN_FOR_CLIENT(pcd), &x, &y, activeIconTextWidth, activeIconTextHeight); if (ACTIVE_LABEL_PARENT(pcd) != root) { XReparentWindow(DISPLAY, pcd->pSD->activeIconTextWin , root, x, y ); ACTIVE_LABEL_PARENT(pcd) = root; } } else { /* * This is an icon in an icon box */ x = x + IB_MARGIN_WIDTH; y = y + IB_MARGIN_HEIGHT; if(!(pcd->pSD->iconDecoration & ( ICON_LABEL_PART))) { y -= activeIconTextHeight; } PutBoxInIconBox (pcd, &x, &y, &activeIconTextWidth, &activeIconTextHeight); if (ACTIVE_LABEL_PARENT(pcd) != pcd->client) { XReparentWindow(DISPLAY, pcd->pSD->activeIconTextWin , XtWindow(P_ICON_BOX(pcd)->bBoardWidget), x, y ); ACTIVE_LABEL_PARENT(pcd) = pcd->client; } } mask = CWX | CWY | CWWidth | CWHeight; windowChanges.x = x; windowChanges.y = y; windowChanges.width = activeIconTextWidth; windowChanges.height = activeIconTextHeight; XConfigureWindow (DISPLAY, pcd->pSD->activeIconTextWin, mask, &windowChanges); /* bevel the rectangle around the edges */ if ((pActiveIconTopRects && pActiveIconBotRects) || ((pActiveIconTopRects = AllocateRList((unsigned)4*ICON_EXTERNAL_SHADOW_WIDTH)) && (pActiveIconBotRects = AllocateRList((unsigned)4*ICON_EXTERNAL_SHADOW_WIDTH)))) { pActiveIconTopRects->used = 0; pActiveIconBotRects->used = 0; BevelRectangle (pActiveIconTopRects, pActiveIconBotRects, 0, 0, activeIconTextWidth, activeIconTextHeight, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH, ICON_EXTERNAL_SHADOW_WIDTH); } XMapRaised (DISPLAY, pcd->pSD->activeIconTextWin); wmGD.activeIconTextDisplayed = True; /* save context for this window */ XSaveContext (DISPLAY, pcd->pSD->activeIconTextWin, wmGD.windowContextType, (caddr_t) pcd); } } /* END OF FUNCTION ShowActiveIconText */ /*************************************<->************************************* * * HideActiveIconText () * * * Description: * ----------- * Hides the big label shown over the active icon. * * * Inputs: * ------ * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void HideActiveIconText (WmScreenData *pSD) { if ((pSD && pSD->activeIconTextWin) || ACTIVE_ICON_TEXT_WIN) { /* disassociate the big label window with this client */ XDeleteContext (DISPLAY, pSD ? pSD->activeIconTextWin : ACTIVE_PSD->activeIconTextWin, wmGD.windowContextType); /* hide the big label */ XUnmapWindow (DISPLAY, pSD ? pSD->activeIconTextWin : ACTIVE_PSD->activeIconTextWin); wmGD.activeIconTextDisplayed = False; } } /*************************************<->************************************* * * MoveActiveIconText (pcd) * * * Description: * ----------- * * * Inputs: * ------ * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void MoveActiveIconText (ClientData *pcd) { int x, y; unsigned int junk; Window root; Dimension dWidth, dHeight; /* * put up a big icon text label */ if (pcd->pSD->activeIconTextWin && wmGD.activeIconTextDisplayed) { /* set up geometry for the window */ XmStringExtent (ICON_APPEARANCE(pcd).fontList, pcd->iconTitle, &dWidth, &dHeight); activeIconTextHeight = (unsigned int) dHeight + WM_BOTTOM_TITLE_PADDING + 2 * ICON_EXTERNAL_SHADOW_WIDTH; activeIconTextWidth = (unsigned int) dWidth; if (activeIconTextWidth < (1.2 * ICON_WIDTH(pcd))) { activeIconTextWidth = 1.2 * ICON_WIDTH(pcd); } activeIconTextWidth += 2 * ICON_EXTERNAL_SHADOW_WIDTH; XGetGeometry (DISPLAY, (Drawable) ICON_FRAME_WIN(pcd), &root, &x, &y, &junk, &junk, &junk, &junk); y += ICON_IMAGE_HEIGHT(pcd); x -= (activeIconTextWidth - ICON_WIDTH(pcd))/2; if (!(P_ICON_BOX(pcd))) { /* This is a normal icon */ PutBoxOnScreen (SCREEN_FOR_CLIENT(pcd), &x, &y, activeIconTextWidth, activeIconTextHeight); } else { /* icon box */ x = x + IB_MARGIN_WIDTH; y = y + IB_MARGIN_HEIGHT; if(!(pcd->pSD->iconDecoration & ( ICON_LABEL_PART))) { y -= activeIconTextHeight; } PutBoxInIconBox (pcd, &x, &y, &activeIconTextWidth, &activeIconTextHeight); } XMoveWindow(DISPLAY, pcd->pSD->activeIconTextWin, x, y ); } } /* END OF FUNCTION MoveActiveIconText */ motif-2.3.8/clients/mwm/WmEvent.h0000644000175000017500000000637713145162623013602 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ #ifdef WSM /* Shared Variables */ extern int smAckState; #endif /* WSM */ extern Boolean CheckForButtonAction (XButtonEvent *buttonEvent, Context context, Context subContext, ClientData *pCD); extern Time GetTimestamp (void); #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) extern Time LastTime (void); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ extern Boolean HandleKeyPress (XKeyEvent *keyEvent, KeySpec *keySpecs, Boolean checkContext, Context context, Boolean onlyFirst, ClientData *pCD); extern void HandleWsButtonPress (XButtonEvent *buttonEvent); extern void HandleWsButtonRelease (XButtonEvent *buttonEvent); extern void HandleWsConfigureRequest (XConfigureRequestEvent *configureEvent); extern void HandleWsEnterNotify (XEnterWindowEvent *enterEvent); extern void HandleWsFocusIn (XFocusInEvent *focusEvent); extern Boolean HandleWsKeyPress (XKeyEvent *keyEvent); extern void HandleWsLeaveNotify (XLeaveWindowEvent *leaveEvent); extern void IdentifyEventContext (XButtonEvent *event, ClientData *pCD, Context *pContext, int *pPartContext); extern void InitEventHandling (void); extern void ProcessClickBPress (XButtonEvent *buttonEvent, ClientData *pCD, Context context, Context subContext); extern void ProcessClickBRelease (XButtonEvent *buttonEvent, ClientData *pCD, Context context, Context subContext); extern void PullExposureEvents (void); extern int SetupKeyBindings (KeySpec *keySpecs, Window grabWindow, int keyboardMode, long context); extern Boolean WmDispatchMenuEvent (XButtonEvent *event); extern Boolean WmDispatchWsEvent (XEvent *event); extern void WmGrabButton (Display *display, unsigned int button, unsigned int modifiers, Window grab_window, unsigned int event_mask, Bool owner_events, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor); extern void WmGrabKey (Display *display, int keycode, unsigned int modifiers, Window grab_window, Bool owner_events, int pointer_mode, int keyboard_mode); extern void WmUngrabButton (Display *display, unsigned int button, unsigned int modifiers, Window grab_window); #ifdef WSM extern void HandleDtWmClientMessage (XClientMessageEvent *clientEvent); extern void HandleDtWmRequest (WmScreenData *pSD, XEvent *pev); extern Boolean ReplayedButtonEvent (XButtonEvent *pevB1, XButtonEvent *pevB2); #endif /* WSM */ motif-2.3.8/clients/mwm/WmManage.c0000644000175000017500000020652713145162623013703 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmManage.c /main/11 1998/01/12 16:45:48 cshi $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmICCC.h" /* * include extern functions */ #include "WmCDecor.h" #include "WmCEvent.h" #include "WmColormap.h" #include "WmError.h" #include "WmEvent.h" #include "WmFunction.h" #include "WmGraphics.h" #include "WmIDecor.h" #include "WmIconBox.h" #include "WmImage.h" #include "WmKeyFocus.h" #ifdef PANELIST #include "WmPanelP.h" /* typedef needed in WmManage.h */ #include
#include "WmIPC.h" #endif /* PANELIST */ #include "WmManage.h" #include "WmMenu.h" #include "WmProperty.h" #include "WmProtocol.h" #include "WmWinInfo.h" #include "WmWinList.h" #include "WmWinState.h" #ifdef WSM #include "WmPresence.h" #include "WmWrkspace.h" #endif /* WSM */ #include "WmXSMP.h" /* * Function Declarations: */ #ifdef PANELIST Boolean IsEmbeddedClient ( ClientData *pCD, WmFpEmbeddedClientData **ppECD); Boolean ManageEmbeddedClient ( ClientData *pCD, WmFpEmbeddedClientData *pECD, long manageFlags); Boolean IsPushRecallClient ( ClientData *pCD, WmFpPushRecallClientData **ppPRCD); static void HandleSubstructEvents( Widget w, caddr_t ptr, XEvent *event ); Boolean UpdateEmbeddedClientsProperty( WmScreenData *pSD ); static void ForceSubpanelWMState(Window win); static void ReManageWindow (ClientData *pCD); static void CheckPushRecallClient (ClientData *pCD); #endif /* PANELIST */ /* * Global Variables: */ /*************************************<->************************************* * * AdoptInitialClients (pSD) * * Inputs: * ------- * pSD = pointer to screen data * * * Description: * ----------- * This function is called to find client windows that were mapped prior to * starting (or restarting) the window manager. These windows are included * in the set of windows managed by the window manager. * *************************************<->***********************************/ void AdoptInitialClients (WmScreenData *pSD) { Window root; Window parent; Window *clients; #ifdef WSM int nAncillaries, iAnc; Window *pAncillaryWindows, *pWin1; WmWorkspaceData *pWS0; #endif /* WSM */ unsigned int nclients; ClientData *pcd = NULL; PropWMState *wmStateProp; Boolean manageOnRestart; int i,j; long manageFlags; #ifdef WSM /* * Generate list of ancillary windows (not to be managed) */ nAncillaries = 2 + pSD->numWorkspaces; pAncillaryWindows = (Window *) XtMalloc (sizeof(Window)*(nAncillaries)); if (!pAncillaryWindows) { Warning (((char *)GETMESSAGE(46, 1, "Insufficient memory to adopt initial clients"))); ExitWM (WM_ERROR_EXIT_VALUE); } pWS0 = pSD->pWS; pWin1 = pAncillaryWindows; for (iAnc = 0; iAnc < pSD->numWorkspaces; iAnc++) { *pWin1 = XtWindow((pWS0)->workspaceTopLevelW); pWin1++; pWS0++; } *pWin1++ = XtWindow (pSD->screenTopLevelW); *pWin1 = pSD->activeIconTextWin; #endif /* WSM */ /* * Look for mapped top-level windows and start managing them: */ if (XQueryTree (DISPLAY, pSD->rootWindow, &root, &parent, &clients, &nclients)) { #ifndef DONT_FILTER_ICON_WINDOWS /* * Filter out icon windows so they don't get managed as a client * window. Icon windows will be process in SetupClientIconWindow(). */ XWMHints *tmphint; for (i = 0; i < nclients; i++) { if (clients[i]) { if ((tmphint = XGetWMHints (DISPLAY, clients[i])) != NULL) { if (tmphint->flags & IconWindowHint) { for (j = 0; j < nclients; j++) { if (clients[j] == tmphint->icon_window) { clients[j] = None; break; } } } XFree ((char *) tmphint); } } } #endif for (i = 0; i < nclients; i++) { /* determine if the client window should be managed by wm */ #ifdef WSM if (InWindowList (clients[i], pAncillaryWindows, nAncillaries)) { /* don't manage ancillary window manager windows */ continue; } #else /* WSM */ if ((clients[i] == XtWindow (pSD->screenTopLevelW)) || (clients[i] == XtWindow (pSD->pActiveWS->workspaceTopLevelW)) || (clients[i] == pSD->activeIconTextWin)) { /* don't manage ancillary window manager windows */ continue; } #endif /* WSM */ if (!XFindContext (DISPLAY, clients[i], wmGD.windowContextType, (caddr_t *)&pcd)) { /* don't manage a window we've already established a context for (e.g. icon windows) */ continue; } if (!WmGetWindowAttributes (clients[i])) { /* can't access the window; ignore it */ continue; } /* window attributes are put into the global cache */ /* * Get the window WM_STATE property value to determine the * initial window state if the wm is being restarted. */ manageFlags = MANAGEW_WM_STARTUP; manageOnRestart = True; if (wmGD.wmRestarted) { manageFlags |= MANAGEW_WM_RESTART; if ((wmStateProp = GetWMState (clients[i])) != NULL) { if (wmStateProp->state == IconicState) { manageFlags |= MANAGEW_WM_RESTART_ICON; } else if (wmStateProp->state != NormalState) { manageOnRestart = False; } XFree ((char *)wmStateProp); } else { manageOnRestart = False; } } /* * Don't manage any override_redirect windows (mapped or not). * Manage an unmapped window if it has a WM_STATE property * and it is not Withdrawn. * Manage any window that is mapped. */ if ((wmGD.windowAttributes.override_redirect != True) && ((wmGD.wmRestarted && manageOnRestart) || (wmGD.windowAttributes.map_state != IsUnmapped))) { ManageWindow (pSD, clients[i], manageFlags); } } if (nclients) { XFree ((char *)clients); } } #ifdef WSM if (pAncillaryWindows) { XtFree ((char *) pAncillaryWindows); } #endif /* WSM */ } /* END OF FUNCTION AdoptInitialClients */ /*************************************<->************************************* * * ManageWindow (pSD, clientWindow, manageFlags) * * * Description: * ----------- * This is the highlevel function that is used to include a window in * the set of windows that are managed by the window manager. The window * gets reparented and decorated, gets an icon, is setup for window * management event handling, etc. Client windows that are controlled * by the window manager (e.g., the icon box) are also managed with * this function. * * * Inputs: * ------ * clientWindow = window of the client that we should manage * * manageFlags = additional control information * * * Outputs: * ------- * pCD = initialized client data * *************************************<->***********************************/ void ManageWindow (WmScreenData *pSD, Window clientWindow, long manageFlags) { ClientData *pCD; int initialState; int i; Boolean sendConfigNotify; #ifdef WSM WmWorkspaceData *pwsi; #endif /* WSM */ #ifdef PANELIST WmFpEmbeddedClientData *pECD; #endif /* PANELIST */ /* * Get client information including window attributes and window * property values. Use this information to determine how the window * is to be managed. */ if (!(pCD = GetClientInfo (pSD, clientWindow, manageFlags))) { /* error getting client info; do not manage the client window */ return; } #ifdef PANELIST /* * Handle case of transients that derive from embedded clients. */ if (wmGD.dtSD && (wmGD.dtSD == pCD->pSD)) { if (pCD->transientLeader && pCD->transientLeader->pECD) { WmPanelistObject pPanelist; ClientData *pCDfp = NULL; pPanelist = (WmPanelistObject) pCD->pSD->wPanelist; (void) XFindContext (DISPLAY, XtWindow(O_Shell (pPanelist)), wmGD.windowContextType, (caddr_t *)&pCDfp); pCD->transientLeader = pCDfp; } } if (IsEmbeddedClient (pCD, &pECD)) { /* * This client is embedded in the front panel */ if (ManageEmbeddedClient(pCD, pECD, manageFlags)) { /* * ...then we've embedded it in the front * panel--no further processing required. */ #ifdef WSM if (smAckState == SM_START_ACK) { SendClientMsg( wmGD.dtSmWindow, (long) wmGD.xa_DT_SM_WM_PROTOCOL, (long) wmGD.xa_DT_WM_WINDOW_ACK, CurrentTime, NULL, 0); } #endif /* WSM */ return; } } /* * Handle case of transients that derive from embedded clients. * !!!! */ #if 0 if (pCD->transientLeader && pCD->transientLeader->pAccessPanel) { pCD->transientLeader = pCD->transientLeader->pAccessPanel->pCD_accessPanel; } #endif #endif /* PANELIST */ #ifdef WSM if (pCD->inputMode == MWM_INPUT_SYSTEM_MODAL) { /* * Put system modal windows in all workspaces to * avoid the race condition of the window coming up * just as the user switches workspaces. */ pCD->dtwmFunctions |= DtWM_FUNCTION_OCCUPY_WS; F_AddToAllWorkspaces(0, pCD, 0); pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; } #endif /* WSM */ if (manageFlags & MANAGEW_WM_RESTART) { if (manageFlags & MANAGEW_WM_RESTART_ICON) { pCD->clientState = MINIMIZED_STATE; } else { pCD->clientState = NORMAL_STATE; } } /* * Setup the initial placement of the client window. Do interactive * placement if configured. */ sendConfigNotify = InitClientPlacement (pCD, manageFlags); /* * Make a window frame for the client window and reparent the client * window. */ if (!FrameWindow (pCD)) { /* * Error in framing the window; clean up the wm resources made * up to this point for the client window. Do not manage the * client window. */ UnManageWindow (pCD); return; } /* * Send config notify if the client's been moved/resized */ if (sendConfigNotify) { SendConfigureNotify (pCD); } /* * Send client offset message if: * * 1. The client is interested. * 2. The position we report to the user is not the client's real * position. * 3. There is a client offset to report. */ if ((pCD->protocolFlags & PROTOCOL_MWM_OFFSET) && (wmGD.positionIsFrame) && ((pCD->clientOffset.x != 0) || (pCD->clientOffset.y != 0))) { SendClientOffsetMessage (pCD); } /* * Make an icon for the client window if it is not a valid transient * window. */ #ifdef WSM if ((pCD->clientFunctions & MWM_FUNC_MINIMIZE) && (pCD->transientLeader == NULL)) { /* * Make icons frames * Only make one icon frame for root icons. * Make one per workspace for icon box icons. */ for (i = 0; i < pCD->numInhabited; i++) { if (pwsi = GetWorkspaceData(pCD->pSD, pCD->pWsList[i].wsID)) { if ((pCD->pSD->useIconBox && !(manageFlags & MANAGEW_WM_CLIENTS) && !(pCD->clientFlags & FRONT_PANEL_BOX)) || (i == 0)) { /* * Make icon inside an icon box for non-root case */ if (!MakeIcon (pwsi, pCD)) { /* * Error in making an icon for the client window; * clean up the wm resources; do not manage the * client window. */ UnManageWindow (pCD); return; } else { XSaveContext (DISPLAY, pCD->pWsList[i].iconFrameWin, wmGD.windowContextType, (caddr_t)pCD); if (pCD->iconWindow && pCD->pWsList[i].iconFrameWin) { XGrabButton (DISPLAY, AnyButton, AnyModifier, pCD->pWsList[i].iconFrameWin, True, ButtonPressMask|ButtonReleaseMask| ButtonMotionMask, GrabModeAsync, GrabModeAsync, None, wmGD.workspaceCursor); } } } else { /* * Make root icons for a client */ if ((pCD->clientFunctions & MWM_FUNC_MINIMIZE) && (pCD->transientLeader == NULL)) { if ((i == 0) && (!MakeIcon (pwsi, pCD))) { /* * Error in making an icon for the client * window; clean up the wm resources; do * not manage the client window. */ UnManageWindow (pCD); return; } else { /* copy root icon frame reference to other * workspaces */ pCD->pWsList[i].iconFrameWin = pCD->pWsList[0].iconFrameWin; } } } } } } #else /* WSM */ if ((pCD->clientFunctions & MWM_FUNC_MINIMIZE) && (pCD->transientLeader == NULL) && !MakeIcon (pCD->pSD->pActiveWS, pCD)) { /* * Error in making an icon for the client window; clean up the wm * resources; do not manage the client window. */ UnManageWindow (pCD); return; } #endif /* WSM */ /* * Register window contexts to facilitate event handling: */ XSaveContext (DISPLAY, pCD->clientFrameWin, wmGD.windowContextType, (caddr_t)pCD); XSaveContext (DISPLAY, pCD->clientBaseWin, wmGD.windowContextType, (caddr_t)pCD); if (DECOUPLE_TITLE_APPEARANCE(pCD) && pCD->clientTitleWin) { /* * handle exposures on title bar if it has its own appearance */ XSaveContext (DISPLAY, pCD->clientTitleWin, wmGD.windowContextType, (caddr_t)pCD); } #ifndef WSM if (pCD->iconFrameWin) { XSaveContext (DISPLAY, pCD->iconFrameWin, wmGD.windowContextType, (caddr_t)pCD); } #endif /* WSM */ if (pCD->clientCmapCount > 0) { for (i = 0; i < pCD->clientCmapCount; i++) { if (pCD->cmapWindows[i] != pCD->client) { #ifndef IBM_169380 AddColormapWindowReference(pCD, pCD->cmapWindows[i]); #else XSaveContext (DISPLAY, pCD->cmapWindows[i], wmGD.windowContextType, (caddr_t)pCD); #endif } } } pCD->clientFlags |= CLIENT_CONTEXT_SAVED; /* * Setup button binding handling for actions that apply to the client * window. */ if (BUTTON_SPECS(pCD)) { SetupCButtonBindings (pCD->clientBaseWin, BUTTON_SPECS(pCD)); } #ifndef WSM if (pCD->iconWindow && pCD->iconFrameWin) { XGrabButton (DISPLAY, AnyButton, AnyModifier, pCD->iconFrameWin, True, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, GrabModeAsync, None, wmGD.workspaceCursor); } #endif /* WSM */ /* * Setup key binding handling for system menu accelerators. */ if (pCD->systemMenuSpec && (pCD->systemMenuSpec->accelKeySpecs)) { SetupKeyBindings (pCD->systemMenuSpec->accelKeySpecs, pCD->clientFrameWin, GrabModeSync, F_CONTEXT_ALL); #ifdef WSM for (i = 0; i < pCD->numInhabited; i++) { if (!pCD->pWsList[i].pIconBox && pCD->pWsList[i].iconFrameWin) { SetupKeyBindings (pCD->systemMenuSpec->accelKeySpecs, pCD->pWsList[i].iconFrameWin, GrabModeSync, F_CONTEXT_ALL); } } #else /* WSM */ if (!pCD->pIconBox && pCD->iconFrameWin) { SetupKeyBindings (pCD->systemMenuSpec->accelKeySpecs, pCD->iconFrameWin, GrabModeSync, F_CONTEXT_ALL); } #endif /* WSM */ } #ifdef WSM for (i = 0; i < pCD->numInhabited; i++) { if (!pCD->pWsList[i].pIconBox && pCD->pWsList[i].iconFrameWin) #else /* WSM */ if (!pCD->pIconBox && pCD->iconFrameWin) #endif /* WSM */ { static int iconKeySpec = 1; static int iconAccelSpec = 1; if ((iconKeySpec != 0) && KEY_SPECS(pCD)) { #ifdef WSM iconKeySpec = SetupKeyBindings (KEY_SPECS(pCD), pCD->pWsList[i].iconFrameWin, GrabModeSync, F_CONTEXT_ICON); #else /* WSM */ iconKeySpec = SetupKeyBindings (KEY_SPECS(pCD), pCD->iconFrameWin, GrabModeSync, F_CONTEXT_ICON); #endif /* WSM */ } if ((iconAccelSpec != 0) && ACCELERATOR_MENU_COUNT(pCD)) { int n; iconAccelSpec = 0; for (n= 0; n < pSD->acceleratorMenuCount; n++) { #ifdef WSM iconAccelSpec += SetupKeyBindings ( ACCELERATOR_MENU_SPECS(pCD)[n]->accelKeySpecs, pCD->pWsList[i].iconFrameWin, GrabModeSync, F_CONTEXT_ICON); #else /* WSM */ iconAccelSpec += SetupKeyBindings ( ACCELERATOR_MENU_SPECS(pCD)[n]->accelKeySpecs, pCD->iconFrameWin, GrabModeSync, F_CONTEXT_ICON); #endif /* WSM */ } } } #ifdef WSM } #endif /* WSM */ /* * Setup keyboard focus handling if policy is "explicit". */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { DoExplicitSelectGrab (pCD->clientBaseWin); } #ifdef WSM UpdateWorkspacePresenceProperty(pCD); #endif /* WSM */ /* * Make sure the client window has been reparented ... */ if (!(manageFlags & MANAGEW_WM_CLIENTS)) { XSync (DISPLAY, False); if (pCD->clientFlags & CLIENT_DESTROYED) { UnManageWindow (pCD); return; } } /* * Setup the initial display state for the client window: */ initialState = pCD->clientState; #ifdef WSM if (!ClientInWorkspace (pSD->pActiveWS, pCD)) { initialState |= UNSEEN_STATE; } #endif /* WSM */ pCD->clientState = WITHDRAWN_STATE; pCD->clientFlags &= ~WM_INITIALIZATION; #ifdef WSM /* * Add to stacking list using the client's zero'th workspace * instead of the current one because it may not be in * the current one. */ AddClientToList (GetWorkspaceData (pSD, pCD->pWsList[0].wsID), pCD, True /*on top*/); #else /* WSM */ AddClientToList (pSD->pActiveWS, pCD, True /*on top*/); #endif /* WSM */ SetClientState (pCD, initialState, GetTimestamp()); /* * Set the keyboard input focus to the newly managed window if appropriate: * - focus is automatically set only if the focus policy is explicit * - if there is a system modal window active then set the focus only * if the new window is in the system modal heirarchy * - focus is automatically set if startupKeyFocus is selected or * the new window is a system modal window or the current focus window * has the new window as an application modal subordinate * - don't automatically set the focus if the window is minimized or * is a window that generally doesn't take input */ if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) && ((pCD->inputMode == MWM_INPUT_SYSTEM_MODAL) || ((!wmGD.systemModalActive || (wmGD.systemModalClient == FindTransientTreeLeader (pCD))) && (wmGD.startupKeyFocus || (wmGD.keyboardFocus && (IS_APP_MODALIZED(wmGD.keyboardFocus)))) && !(manageFlags & (MANAGEW_WM_STARTUP | MANAGEW_WM_RESTART | MANAGEW_WM_CLIENTS)) && (pCD->clientState != MINIMIZED_STATE) && #ifdef WSM !(pCD->clientState & UNSEEN_STATE) && #endif /* WSM */ (pCD->inputFocusModel || (pCD->protocolFlags & PROTOCOL_WM_TAKE_FOCUS))))) { Do_Focus_Key (pCD, GetTimestamp() , ALWAYS_SET_FOCUS); } else if ((pCD->inputMode == MWM_INPUT_SYSTEM_MODAL) || (wmGD.keyboardFocus && IS_APP_MODALIZED(wmGD.keyboardFocus))) { Do_Focus_Key ((ClientData *)NULL, GetTimestamp() , ALWAYS_SET_FOCUS); } #ifdef WSM if (smAckState == SM_START_ACK) { SendClientMsg( wmGD.dtSmWindow, (long) wmGD.xa_DT_SM_WM_PROTOCOL, (long) wmGD.xa_DT_WM_WINDOW_ACK, CurrentTime, NULL, 0); } /* * Free the initial property list. This will force * reads of properties that change after the initial * management (see HasProperty() function.) */ DiscardInitialPropertyList (pCD); #endif /* WSM */ #ifdef PANELIST CheckPushRecallClient (pCD); #endif /* PANELIST */ } /* END OF FUNCTION ManageWindow */ /*************************************<->************************************* * * UnManageWindow (pCD) * * * Description: * ----------- * This function removes a top-level client window and it's transients * from the set of windows that is managed by the window manager. * * * Inputs: * ------ * pCD - pointer to client data of window to unmanage * *************************************<->***********************************/ void UnManageWindow (ClientData *pCD) { #ifdef PANELIST if (pCD->pECD) { WmFpEmbeddedClientData *pECD; pECD = (WmFpEmbeddedClientData *) pCD->pECD; XtRemoveEventHandler(XtWindowToWidget (DISPLAY1, pECD->winParent), (SubstructureRedirectMask | SubstructureNotifyMask), False, (XtEventHandler)HandleSubstructEvents, (XtPointer)(pCD)); pECD->pCD = NULL; UpdateEmbeddedClientsProperty (pCD->pSD); } if (pCD->pPRCD) { WmFpPushRecallClientData *pPRCD; int j; pPRCD = (WmFpPushRecallClientData *) pCD->pSD->pPRCD; for (j = 0; j < pCD->pSD->numPushRecallClients; j++, pPRCD++) { /* * Clean out all slots used by this client. */ if ((!strcmp ((char *)pCD->clientName, (char *)(pPRCD->pchResName))) && (pPRCD->pCD == pCD)) { pPRCD->pCD = NULL; } } pCD->pPRCD = NULL; } #endif /* PANELIST */ /* * Withdraw all the transient children of this window. */ if (pCD->transientChildren != NULL) { WithdrawTransientChildren (pCD); } /* * If this is a transient window, then delete it from the leader's * list of transients. */ if (pCD->transientLeader) { DeleteTransient (pCD); /* If this was a modal dialog box, then replay the event. */ if ( wmGD.replayEnterEvent ) { XPutBackEvent( DISPLAY, (XEvent*)&wmGD.savedEnterEvent ); /* Reset event flag to false */ wmGD.replayEnterEvent = False; } } /* * Withdraw this window */ WithdrawWindow (pCD); } /* END OF FUNCTION UnManageWindow */ /*************************************<->************************************* * * WithdrawTransientChildren (pCD) * * * Description: * ----------- * This function withdraws all transient children of the specified window. * * * Inputs: * ------ * pCD = pointer to client data of the leader of the transient tree. * *************************************<->***********************************/ void WithdrawTransientChildren (ClientData *pCD) { ClientData *pcdNext; ClientData *pcdThis; pcdNext = pCD->transientChildren; while (pcdNext) { if (pcdNext->transientChildren) { WithdrawTransientChildren (pcdNext); } pcdThis = pcdNext; pcdNext = pcdThis->transientSiblings; DeleteTransient(pcdThis); WithdrawWindow (pcdThis); } } /* END OF FUNCTION WithdrawTransientChildren */ /*************************************<->************************************* * * WithdrawWindow (pCD) * * * Description: * ----------- * This function removes a top-level client window from the set of windows * that is managed by the window manager. All window manager resources * associtated with the client window are freed up (possibly cached for * reuse). Any custom system menu is destroyed. * * * Inputs: * ------ * pCD - pointer to client data of window to withdraw * *************************************<->***********************************/ void WithdrawWindow (ClientData *pCD) { int x; int y; int i; XWindowChanges xwc; /* * Put the client window into a withdrawn state: * * - remove the icon/client window from the screen * - make sure the input focus no longer is associted with the window * - free the icon placement (if necessary) */ #ifdef WSM SetClientWsIndex (pCD); #endif /* WSM */ if (!(pCD->clientFlags & WM_INITIALIZATION)) { if (!pCD->transientLeader) { DeleteClientFromList (pCD->pSD->pActiveWS, pCD); } ResetWithdrawnFocii (pCD); if (pCD->clientState & MINIMIZED_STATE) { #ifdef WSM if (wmGD.iconAutoPlace && (!(P_ICON_BOX(pCD)))) { WmWorkspaceData *pWsTmp; WsClientData *pWsc; int j; /* * Clean up icon placement data in all inhabited * workspaces */ for (j = 0; j< pCD->numInhabited; j++) { pWsc = &(pCD->pWsList[j]); if (pWsc->iconPlace != NO_ICON_PLACE) { if (pWsTmp=GetWorkspaceData(pCD->pSD, pWsc->wsID)) { pWsTmp->IPData.placeList[pWsc->iconPlace].pCD = NULL; } } } } #else /* WSM */ if (wmGD.iconAutoPlace && (!(P_ICON_BOX(pCD)))) { if (ICON_PLACE(pCD) != NO_ICON_PLACE) { pCD->pSD->pActiveWS->IPData.placeList[ICON_PLACE(pCD)].pCD = NULL; } } #endif /* WSM */ if (ICON_FRAME_WIN(pCD)) { XUnmapWindow (DISPLAY, ICON_FRAME_WIN(pCD)); } XFlush (DISPLAY); } else if ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE)) { XUnmapWindow (DISPLAY, pCD->clientFrameWin); XFlush (DISPLAY); } } #ifdef WSM /* * Clean up the workspace presence dialog if it's * connected to this client. */ if ((pCD->pSD->presence.shellW) && (pCD->pSD->presence.pCDforClient == pCD)) { if (pCD->pSD->presence.onScreen) { HidePresenceBox (pCD->pSD, True); } pCD->pSD->presence.pCDforClient = NULL; } #endif /* WSM */ /* * Check to see if the window is being unmanaged because the window * was destroyed. */ if (!(pCD->clientFlags & CLIENT_DESTROYED)) { XEvent eventReturn; if (XCheckTypedWindowEvent (DISPLAY, pCD->clientBaseWin, DestroyNotify, &eventReturn)) { pCD->clientFlags |= CLIENT_DESTROYED; } } /* * Reparent the client window back to root if the window has been * reparented by the window manager. Remove the window from the * window managers save-set if necessary. */ if ((pCD->clientFlags & CLIENT_REPARENTED) && !(pCD->clientFlags & CLIENT_DESTROYED)) { #ifdef WSM SetWMState (pCD->client, WithdrawnSTATE, pCD->pWsList[0].iconFrameWin); #else /* WSM */ SetWMState (pCD->client, WithdrawnSTATE, ICON_FRAME_WIN(pCD)); #endif /* WSM */ if (pCD->maxConfig) { x = pCD->maxX; y = pCD->maxY; } else { int xoff, yoff; if(wmGD.positionIsFrame) { CalculateGravityOffset (pCD, &xoff, &yoff); x = pCD->clientX - xoff; y = pCD->clientY - yoff; } else { x = pCD->clientX; y = pCD->clientY; } } XUnmapWindow (DISPLAY, pCD->client); XReparentWindow (DISPLAY, pCD->client, ROOT_FOR_CLIENT(pCD), x, y); /* give the window back it's X border */ xwc.border_width = pCD->xBorderWidth; XConfigureWindow(DISPLAY, pCD->client, CWBorderWidth, &xwc); if (pCD->iconWindow && (pCD->clientFlags & ICON_REPARENTED)) { XUnmapWindow (DISPLAY, pCD->iconWindow); #ifdef WSM XReparentWindow (DISPLAY, pCD->iconWindow, ROOT_FOR_CLIENT(pCD), pCD->pWsList[0].iconX, pCD->pWsList[0].iconY); #else /* WSM */ XReparentWindow (DISPLAY, pCD->iconWindow, ROOT_FOR_CLIENT(pCD), ICON_X(pCD), ICON_Y(pCD)); #endif /* WSM */ } } if ((pCD->clientFlags & CLIENT_IN_SAVE_SET) && !(pCD->clientFlags & CLIENT_DESTROYED)) { XRemoveFromSaveSet (DISPLAY, pCD->client); if (pCD->iconWindow && (pCD->clientFlags & ICON_IN_SAVE_SET)) { XRemoveFromSaveSet (DISPLAY, pCD->iconWindow); } } /* * Free a custom system menu if one was created. */ FreeCustomMenuSpec (pCD->systemMenuSpec); /* * Free the client window frame: */ if (pCD->clientFrameWin) { FreeClientFrame (pCD); } /* * Free the icon associated with the client window: */ if (PIXMAP_IS_VALID( pCD->iconPixmap )) { XFreePixmap (DISPLAY, pCD->iconPixmap); } #ifdef WSM if ((pCD->numInhabited > 0) && ICON_FRAME_WIN(pCD)) #else /* WSM */ if (ICON_FRAME_WIN(pCD)) #endif /* WSM */ { FreeIcon (pCD); } /* * Free up the client protocol list: */ if (pCD->clientProtocols) { XtFree ((char *)pCD->clientProtocols); } /* * Free up the mwm messages list: */ if (pCD->mwmMessages) { XtFree ((char *)pCD->mwmMessages); } /* * Delete client window manager timers: */ DeleteClientWmTimers (pCD); /* * Free up window context associations. */ DeleteClientContext (pCD); #ifdef WSM /* * Count backward for efficiency -- * removes from end of list. */ for (i = pCD->numInhabited - 1; i >= 0; i--) { TakeClientOutOfWorkspace ( GetWorkspaceData(pCD->pSD, pCD->pWsList[i].wsID), pCD); } #endif /* WSM */ /* * Free up window manager resources: */ if (!(pCD->clientFlags & CLIENT_WM_CLIENTS)) { if (pCD->clientName) { XFree ((char *) (pCD->clientName)); } if (pCD->clientClass) { XFree ((char *) (pCD->clientClass)); } } if ((pCD->clientFlags & CLIENT_HINTS_TITLE) && pCD->clientTitle) { XmStringFree (pCD->clientTitle); } if ((pCD->iconFlags & ICON_HINTS_TITLE) && pCD->iconTitle) { XmStringFree (pCD->iconTitle); } if (pCD->clientCmapCount > 0) { for (i = 0; i < pCD->clientCmapCount; i++) { if (pCD->cmapWindows[i] != pCD->client) { #ifndef IBM_169380 RemoveColormapWindowReference(pCD, pCD->cmapWindows[i]); #else XDeleteContext (DISPLAY, pCD->cmapWindows[i], wmGD.windowContextType); #endif } } XtFree ((char *) (pCD->cmapWindows)); XtFree ((char *) (pCD->clientCmapList)); #ifndef OLD_COLORMAP /* colormap */ XtFree ((char *) (pCD->clientCmapFlags)); #endif } #ifdef WSM /* * Insure list of initial properties has been freed. */ DiscardInitialPropertyList (pCD); /* * free up list of workspace specific data */ if ((pCD)->pWsList) { XtFree ((char *) (pCD->pWsList)); } /* * free up workspace hints */ if (pCD->pWorkspaceHints) { XtFree ((char *)pCD->pWorkspaceHints); } #endif /* WSM */ if (pCD->smClientID) XFree (pCD->smClientID); /* * Clean up references to this data before we free it. */ if (wmGD.menuClient == pCD) { wmGD.menuClient = NULL; } if (wmGD.gadgetClient == pCD) { wmGD.gadgetClient = NULL; wmGD.gadgetDepressed = 0; } if (wmGD.clickData.pCD == pCD) { wmGD.clickData.pCD = NULL; } if (wmGD.nextKeyboardFocus == pCD) wmGD.nextKeyboardFocus = NULL; if (wmGD.keyboardFocus == pCD) wmGD.keyboardFocus = NULL; /* * Fix for 5325 - Delete reference by dirty stack */ ClearDirtyStackEntry(pCD); XtFree ((char *)pCD); } /* END OF FUNCTION WithdrawWindow */ /*************************************<->************************************* * * DeleteClientContext (pCD) * * * Description: * ----------- * This function deletes the client from the X context manager * * * Inputs: * ------ * pCD - pointer to client data * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void DeleteClientContext (ClientData *pCD) { /* * Free up window context associations. The context for the client * window is always set if there is a client data structure. */ XDeleteContext (DISPLAY, pCD->client, wmGD.windowContextType); if (pCD->clientFlags & CLIENT_CONTEXT_SAVED) { XDeleteContext (DISPLAY, pCD->clientFrameWin, wmGD.windowContextType); XDeleteContext (DISPLAY, pCD->clientBaseWin, wmGD.windowContextType); if (DECOUPLE_TITLE_APPEARANCE(pCD)) { XDeleteContext (DISPLAY, pCD->clientTitleWin, wmGD.windowContextType); } if (ICON_FRAME_WIN(pCD)) { #ifdef WSM int k; for (k=0; k < pCD->numInhabited; k++) { XDeleteContext (DISPLAY, pCD->pWsList[k].iconFrameWin, wmGD.windowContextType); } #else /* WSM */ XDeleteContext (DISPLAY, pCD->iconFrameWin, wmGD.windowContextType); #endif /* WSM */ } pCD->clientFlags &= ~CLIENT_CONTEXT_SAVED; } } /* END OF FUNCTION DeleteClientContext */ /*************************************<->************************************* * * ResetWitdrawnFocii (pCD) * * * Description: * ----------- * This function resets the various types of focus if they are set to a * window being withdrawn. * * * * Inputs: * ------ * pCD - pointer to client data * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void ResetWithdrawnFocii (ClientData *pCD) { if ((wmGD.keyboardFocus == pCD) || /* BEGIN fix for CDExc21090 */ ((wmGD.keyboardFocus == (ClientData *)NULL) && (wmGD.nextKeyboardFocus == pCD) && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT))) /* END fix for CDExc21090 */ { if (wmGD.autoKeyFocus && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)) { /* local hack: if we've already received a map for a new ** focus window, be sure to use wmGD.nextKeyboardFocus; otherwise ** AutoResetKeyFocus chooses an essentially arbitrary window to ** set focus to. */ if (wmGD.nextKeyboardFocus == pCD) AutoResetKeyFocus (pCD, GetTimestamp()); else Do_Focus_Key ((ClientData *)wmGD.nextKeyboardFocus, GetTimestamp(), ALWAYS_SET_FOCUS); } else { /* * Set the focus to the default state if the focus is not in * the process of being set (i.e. a FocusIn event will be * comming along shortly. */ if (wmGD.nextKeyboardFocus == wmGD.keyboardFocus) { Do_Focus_Key ((ClientData *)NULL, GetTimestamp(), ALWAYS_SET_FOCUS | WORKSPACE_IF_NULL); } } SetKeyboardFocus ((ClientData *)NULL, 0); } if (((pCD->inputMode == MWM_INPUT_PRIMARY_APPLICATION_MODAL) || (pCD->inputMode == MWM_INPUT_FULL_APPLICATION_MODAL)) && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER)) { /* * Repair the focus if an application modal dialog went * away. We may not see an enter event and have the focus * set to the wrong place. */ RepairFocus (); } if (wmGD.nextKeyboardFocus == pCD) { wmGD.nextKeyboardFocus = NULL; } if (ACTIVE_PSD->colormapFocus == pCD) { SetColormapFocus (ACTIVE_PSD, (ClientData *)NULL); } } /* END OF FUNCTION ResetWithdrawnFocii */ /*************************************<->************************************* * * FreeClientFrame (pCD) * * * Description: * ----------- * This function frees up frame windows and associated resources. * * * Inputs: * ------ * pCD - pointer to client data * *************************************<->***********************************/ void FreeClientFrame (ClientData *pCD) { if (pCD->pclientTopShadows) { FreeRList (pCD->pclientTopShadows); pCD->pclientTopShadows = NULL; } if (pCD->pclientBottomShadows) { FreeRList (pCD->pclientBottomShadows); pCD->pclientBottomShadows = NULL; } if (pCD->pclientTitleTopShadows) { FreeRList (pCD->pclientTitleTopShadows); pCD->pclientTitleTopShadows = NULL; } if (pCD->pclientTitleBottomShadows) { FreeRList (pCD->pclientTitleBottomShadows); pCD->pclientTitleBottomShadows = NULL; } if (pCD->pclientMatteTopShadows) { FreeRList (pCD->pclientMatteTopShadows); pCD->pclientMatteTopShadows = NULL; } if (pCD->pclientMatteBottomShadows) { FreeRList (pCD->pclientMatteBottomShadows); pCD->pclientMatteBottomShadows = NULL; } if (pCD->pTitleGadgets) { XtFree ((char *)pCD->pTitleGadgets); pCD->pTitleGadgets = NULL; pCD->cTitleGadgets = 0; } if (pCD->pResizeGadgets) { XtFree ((char *)pCD->pResizeGadgets); pCD->pResizeGadgets = NULL; } /* destroy frame window & all children */ XDestroyWindow (DISPLAY, pCD->clientFrameWin); } /* END OF FUNCTION FreeClientFrame */ /*************************************<->************************************* * * FreeIcon (pCD) * * * Description: * ----------- * This function frees up icon windows and associated resources. * * * Inputs: * ------ * pCD - pointer to client data * *************************************<->***********************************/ void FreeIcon (ClientData *pCD) { #ifdef WSM WmWorkspaceData *pWsTmp; int i; #endif /* WSM */ if (pCD->piconTopShadows) { FreeRList (pCD->piconTopShadows); pCD->piconTopShadows = NULL; } if (pCD->piconBottomShadows) { FreeRList (pCD->piconBottomShadows); pCD->piconBottomShadows = NULL; } /* * destroy frame window & all children */ #ifdef WSM if ((pCD->pSD->useIconBox) && pCD->pWsList[0].pIconBox) { /* * We're using icon boxes and it's in at least one ... * Delete from all workspaces we live in */ for (i = 0; i< pCD->numInhabited; i++) { if (pWsTmp = GetWorkspaceData(pCD->pSD, pCD->pWsList[i].wsID)) { DeleteIconFromBox (pWsTmp->pIconBox, pCD); } } } else { /* only one window, so destroying its first reference will * clean it up adequately */ if (pCD->pWsList[0].iconFrameWin) { XDestroyWindow (DISPLAY, pCD->pWsList[0].iconFrameWin); } } #else /* WSM */ if (pCD->pSD->useIconBox && P_ICON_BOX(pCD)) { DeleteIconFromBox (pCD->pSD->pActiveWS->pIconBox, pCD); } else { XDestroyWindow (DISPLAY, pCD->iconFrameWin); } #endif /* WSM */ } /* END OF FUNCTION FreeIcon */ /*************************************<->************************************* * * WithdrawDialog (dialogboxW) * * * Description: * ----------- * This function removes a DialogBox widget "client" from the set of windows * that are managed by the window manager. * * * Inputs: * ------ * dialogboxW = DialogBox widget to withdraw. * * Comments: * -------- * Does not maintain the WM_STATE property on the dialog "client". * *************************************<->***********************************/ void WithdrawDialog (Widget dialogboxW) { #ifdef WSM int i; #endif /* WSM */ ClientData *pCD = NULL; /* * Get the dialog shell window client data. */ if (XFindContext (DISPLAY, XtWindow (XtParent (dialogboxW)), wmGD.windowContextType, (caddr_t *)&pCD)) return; XtUnmanageChild (dialogboxW); DeleteClientFromList (ACTIVE_WS, pCD); #ifdef WSM /* TakeClientOutOfWorkspace (ACTIVE_WS, pCD); */ /* * Count backward for efficiency -- * removes from end of list. */ for (i = pCD->numInhabited - 1; i >= 0; i--) { TakeClientOutOfWorkspace ( GetWorkspaceData(pCD->pSD, pCD->pWsList[i].wsID), pCD); } #endif /* WSM */ ResetWithdrawnFocii (pCD); XUnmapWindow (DISPLAY, pCD->clientFrameWin); } /* END OF FUNCTION WithdrawDialog */ /*************************************<->************************************* * * ReManageDialog (pSD, dialogboxW) * * * Description: * ----------- * This function remanages a DialogBox "client" that was unmanaged via * WithdrawDialog (). * * * Inputs: * ------ * pSD = pointer to screen data * dialogboxW = DialogBox widget to remanage. * * * Outputs: * ------- * Does not maintain the WM_STATE property on the dialog "client". * *************************************<->***********************************/ void ReManageDialog (WmScreenData *pSD, Widget dialogboxW) { ClientData *pCD = NULL; /* * Get the dialog shell window client data. */ if (XFindContext (DISPLAY, XtWindow (XtParent (dialogboxW)), wmGD.windowContextType, (caddr_t *)&pCD)) return; /* * The order is important here: */ #ifdef WSM /* * Put system modal windows in all workspaces to * avoid the race condition of the window coming up * just as the user switches workspaces OR when * the window is up and a user switces workspaces * with a key binding. We may want to eventually short * circuit F_Functions any time there is a modal * window up, but for now, we will just make sure * the modal window appears in all workspaces */ pCD->dtwmFunctions |= DtWM_FUNCTION_OCCUPY_WS; F_AddToAllWorkspaces(0, pCD, 0); pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; #endif /* WSM */ if (pSD->clientList) { StackWindow (pSD->pActiveWS, &pCD->clientEntry, TRUE, (ClientListEntry *) NULL); } AddClientToList (pSD->pActiveWS, pCD, True /*on top*/); XMapWindow (DISPLAY, pCD->clientFrameWin); XtManageChild (dialogboxW); if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)) { Do_Focus_Key (pCD, GetTimestamp() , ALWAYS_SET_FOCUS); } } /* END OF FUNCTION ReManageDialog */ #ifdef PANELIST /*************************************<->************************************* * * RegisterEmbeddedClients (wPanelist, pECD, count) * * * Description: * ----------- * This function registers a list of clients to be embedded in the * front panel subsystem. * * * Inputs: * ------ * wPanelist = front panel object (widget) * pECD = pointer to list of data for clients to embed * count = number of elements in the list * * * Outputs: * ------- * *************************************<->***********************************/ void RegisterEmbeddedClients ( Widget wPanelist, WmFpEmbeddedClientList pECD, int count) { WmScreenData *pSD; int i; for (i= 0; i < wmGD.numScreens; i++) { pSD = &(wmGD.Screens[i]); if (pSD->managed) { if (pSD->wPanelist == wPanelist) break; } } if (i < wmGD.numScreens) { pSD->pECD = (struct _WmFpEmbeddedClientData *) pECD; pSD->numEmbeddedClients = count; } #ifdef DEBUG else { fprintf (stderr, "Couldn't match wPanelist to screen data\n"); } #endif /* DEBUG */ } /* END OF FUNCTION RegisterEmbeddedClients */ #define LTT_INCREMENT 16 /*************************************<->************************************* * * ListTransientSubtree (pCD, ppWins, pSize, pCount) * * * Description: * ----------- * This function returns the list of windows in a transient window * tree. * * * Inputs: * ------ * pCD - pointer to client data of a window. * ppWins - address of a pointer to a list of windows * (this must be in the heap -- XtMalloc). * pSize - address of variable with size of list * pCount - address of variable with number of windows in list * * Outputs: * ------- * *ppWins - may point to a new area of memory if list grows * *pSize - if list has to grow, this may be bigger * *pCount - number of windows in the list * * Comments * -------- * The list should be freed when done with XtFree(). * *************************************<->***********************************/ static void ListTransientSubtree ( ClientData *pCD, Window **ppWins, int *pSize, int *pCount) { /* * Check size */ if (*pCount == *pSize) { *pSize += LTT_INCREMENT; *ppWins = (Window *) XtRealloc ((char *) *ppWins, (*pSize * sizeof(Window))); } /* * Add this window to the list */ (*ppWins)[*pCount] = pCD->client; *pCount += 1; /* * Add siblings */ if (pCD->transientSiblings) ListTransientSubtree (pCD->transientSiblings, ppWins, pSize, pCount); /* * Add children */ if (pCD->transientChildren) ListTransientSubtree (pCD->transientChildren, ppWins, pSize, pCount); } /* END OF FUNCTION ListTransientSubtree */ /*************************************<->************************************* * * ListTransientTree (pCD) * * * Description: * ----------- * This function returns the list of windows in a transient window * tree. * * * Inputs: * ------ * pCD - pointer to client data of a primary window. * * Outputs: * ------- * none * * Comments * -------- * The list should be freed when done with XtFree(). * *************************************<->***********************************/ static Window * ListTransientTree ( ClientData *pCD) { Window *pWins; int count; int iSize; /* * Initial allocation */ iSize = LTT_INCREMENT; pWins = (Window *) XtMalloc (iSize * sizeof(Window)); count = 0; /* * Add this window to the list */ ListTransientSubtree (pCD, &pWins, &iSize, &count); /* * Add terminator to end of window list */ if (count == iSize) { iSize += LTT_INCREMENT; pWins = (Window *) XtRealloc ((char *)pWins, (iSize * sizeof(Window))); } pWins[count++] = None; /* * Return the list of windows found */ return (pWins); } /* END OF FUNCTION ListTransientTree */ /*************************************<->************************************* * * ReManageWindow (pCD) * * * Description: * ----------- * This function unmanages and remanages a window and it's associated * transients. * * * Inputs: * ------ * pCD - pointer to client data of a primary window. * * Outputs: * ------- * none * * Comments * -------- * The pointer pCD is invalid after calling this function -- a * side-effect of unmanaging the client before remanaging it. * *************************************<->***********************************/ static void ReManageWindow ( ClientData *pCD) { long manageFlags = MANAGEW_NORMAL; Window *pWins, *pW; WmScreenData *pSD; /* * Get the list of windows in the transient window tree. */ pWins = ListTransientTree (pCD); pSD = pCD->pSD; /* * Unmanage this window and associated transients */ UnManageWindow (pCD); /*** pCD is no longer a valid pointer!!! ***/ /* * Remanage this window and its secondaries */ pW = pWins; while (*pW != None) { ManageWindow (pSD, *pW, manageFlags); pW++; } XtFree ((char *) pWins); } /* END OF FUNCTION ReManageWindow */ /*************************************<->************************************* * * ScanForEmbeddedClients (pSD) * * * Description: * ----------- * This function scans the managed windows and identifies those that * should be embedded clients in the front panel * * * Inputs: * ------ * pSD - pointer to screen data. * * Outputs: * ------- * *************************************<->***********************************/ void ScanForEmbeddedClients ( WmScreenData *pSD) { ClientData *pCD; ClientListEntry *pCLE; WmFpEmbeddedClientData *pECD; Boolean bReset; long manageFlags = 0L; Window *pWins, *pW; /* * Search through all the windows we're managing right now to * see if any should be embedded in a front/sub panel. */ pCLE = pSD->clientList; bReset = False; while (pCLE != NULL) { /* * See if this is an previously unrecognized embedded client */ pCD = pCLE->pCD; if ((pCD->pECD == NULL ) && IsEmbeddedClient (pCD, &pECD)) { /* * Remanage this window and associated transients */ ReManageWindow (pCD); /* * At this point pCD is no longer valid and the * pSD->clientList has been changed. */ bReset = True; } /* * Test for exit condition */ if (pCLE == pSD->lastClient) { /* * Gone all the way through the list without finding * anything -- time to quit */ break; } else if (bReset) { /* * Remanaging a client restructures the client list. * Start over at the beginning. */ bReset = False; pCLE = pSD->clientList; } else { /* * Move to next client. */ pCLE = pCLE->nextSibling; } } } /* END OF FUNCTION ScanForEmbeddedClients */ /*************************************<->************************************* * * IsEmbeddedClient (pCD, ppECD) * * * Description: * ----------- * This function tests a a client to see if it should be embedded * in the front panel. * * * Inputs: * ------ * pCD = ptr to Client Data * ppECD = ptr to returned embedded client data ptr * * * Outputs: * ------- * *ppECD = ptr to embedded client data * *************************************<->***********************************/ Boolean IsEmbeddedClient (ClientData *pCD, WmFpEmbeddedClientData **ppECD) { WmScreenData *pSD; int i; Boolean bFoundMatch = False; WmFpEmbeddedClientData *pECD; pSD = pCD->pSD; pECD = (WmFpEmbeddedClientData *) pSD->pECD; for (i = 0; i < pSD->numEmbeddedClients && !bFoundMatch; i++, pECD++) { /* * It's an embedded client if * the resource name matches a slot and * it's not a subpanel and * the slot isn't already filled. */ if ((!strcmp ((char *)pCD->clientName, (char *)(pECD->pchResName))) && (!(pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL)) && (!pECD->pCD)) { *ppECD = pECD; bFoundMatch = True; } } return (bFoundMatch); } /* END OF FUNCTION IsEmbeddedClient */ /******************************<->************************************* * * ManageEmbeddedClient (pCD, pECD, manageFlags) * * * Description: * ----------- * This is the function that is used to setup a client window * in the front panel. * * Inputs: * ------ * pCD = initialized client data, including window of client that * we want to manage. * pECD = ptr to embedded client entry for this client * * manageFlags = additional control information * * Outputs: * ------- * Returns False if normal client processing needs to be done. * * Returns True if this client has been embedded directly in the * front panel and is NOT to be managed as a normal top level * window--no further processing required. ******************************<->***********************************/ Boolean ManageEmbeddedClient ( ClientData *pCD, WmFpEmbeddedClientData *pECD, long manageFlags) { int wsIndex; int i; XWindowChanges windowChanges; unsigned int mask; WmFpPushRecallClientData *pPRCD; if (!pECD || !pCD) { return (False); } /* * Add to all workspaces */ pCD->dtwmFunctions |= DtWM_FUNCTION_OCCUPY_WS; F_AddToAllWorkspaces(0, pCD, 0); pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; /* * Set client list entries * (in a list by itself) */ pCD->clientEntry.type = NORMAL_STATE; pCD->clientEntry.pCD = pCD; pCD->clientEntry.nextSibling = NULL; pCD->clientEntry.prevSibling = NULL; pCD->iconEntry.type = MINIMIZED_STATE; pCD->iconEntry.pCD = pCD; pCD->iconEntry.nextSibling = NULL; pCD->iconEntry.prevSibling = NULL; /* * Save context for event processing. * */ XSaveContext (DISPLAY, pCD->client, wmGD.windowContextType, (caddr_t)pCD); if (!(pCD->clientFlags & CLIENT_WM_CLIENTS)) { XChangeSaveSet (DISPLAY, pCD->client, SetModeInsert); XChangeSaveSet (DISPLAY1, pCD->client, SetModeInsert); pCD->clientFlags |= CLIENT_IN_SAVE_SET; } if (!(manageFlags & MANAGEW_WM_CLIENTS)) { XSync (DISPLAY1, False); if (pCD->clientFlags & CLIENT_DESTROYED) { UnManageWindow (pCD); return (True); } } XtAddEventHandler(XtWindowToWidget (DISPLAY1, pECD->winParent), (SubstructureRedirectMask | SubstructureNotifyMask), False, (XtEventHandler)HandleSubstructEvents, (XtPointer)(pCD)); /* * Fill in more client data */ pCD->clientX = pECD->x; pCD->clientY = pECD->y; pCD->clientWidth = pECD->width; pCD->clientHeight = pECD->height; pCD->clientFrameWin = 0; pCD->clientBaseWin = pECD->winParent; pECD->pCD = pCD; pCD->pECD = (void *) pECD; #ifdef WSM SetClientWsIndex(pCD); #endif SetClientWMState (pCD, NormalState, NORMAL_STATE); /* * Set state on subpanel in case it never gets mapped * to prevent session manager from finding an embedded * client on its own. */ ForceSubpanelWMState (pECD->winParent); XReparentWindow (DISPLAY1, pCD->client, pECD->winParent, pECD->x, pECD->y); pCD->clientFlags |= CLIENT_REPARENTED; windowChanges.width = pECD->width; windowChanges.height = pECD->height; windowChanges.border_width = 0; mask = (CWWidth | CWHeight | CWBorderWidth); XConfigureWindow (DISPLAY1, pCD->client, mask, &windowChanges); XMapWindow (DISPLAY1, pCD->client); if (pCD->iconWindow) { XUnmapWindow (DISPLAY, pCD->iconWindow); } UpdateEmbeddedClientsProperty (pCD->pSD); SendConfigureNotify (pCD); if (IsPushRecallClient (pCD, &pPRCD)) { /* * There should only be one instance of this * client started from a front panel button. */ pPRCD->pCD = pCD; pCD->pPRCD = (void *) pPRCD; } WmStopWaiting(); return(True); /* successful embedation */ } /* END OF FUNCTION ManageEmbeddedClient */ /******************************<->************************************* * * ReparentEmbeddedClient (pECD, newControl, newWin, x, y, width, height) * * * Description: * ----------- * * Inputs: * ------ * pECD = ptr to embedded client entry for this client * newControl = widget for new "parent" widget * newWin = window ID of window that this embedded client will be * a parent of. This is needed in case the control is a * gadget. * x = x-coord position within newWin where UL corner of the embedded * client will go. * y = y-coord as described above. * width = desired width of embedded client in this new location * height = desired height as above. * * * Outputs: * ------- * Returns False if embedded client was is not moved to the new * location. * * Returns True if this client has been reparented to the new * control. ******************************<->***********************************/ Boolean ReparentEmbeddedClient ( WmFpEmbeddedClientData *pECD, Widget newControl, Window newWin, int x, int y, unsigned int width, unsigned int height ) { int wsIndex; int i; XWindowChanges windowChanges; unsigned int mask; WmFpPushRecallClientData *pPRCD; ClientData *pCD; /* * If we have bogus data or if we're asked * to reparent to our current parent, then just * say no. */ if ((pECD == NULL) || (pECD->pCD == NULL) || (pECD->winParent == newWin)) { return (False); } pCD=pECD->pCD; /* * Need event handler on new parent window? */ if (newWin != pECD->winParent) { XtRemoveEventHandler(XtWindowToWidget (DISPLAY1, pECD->winParent), (SubstructureRedirectMask | SubstructureNotifyMask), False, (XtEventHandler)HandleSubstructEvents, (XtPointer)(pCD)); XtAddEventHandler(XtWindowToWidget (DISPLAY1, newWin), (SubstructureRedirectMask | SubstructureNotifyMask), False, (XtEventHandler)HandleSubstructEvents, (XtPointer)(pCD)); } /* * Update embedding and client data */ pECD->wControl = newControl; pECD->winParent = newWin; pCD->clientX = pECD->x = x; pCD->clientY = pECD->y = y; pCD->clientWidth = pECD->width = width; pCD->clientHeight = pECD->height = height; pCD->clientBaseWin = pECD->winParent; /* * Set state on subpanel in case it never gets mapped * to prevent session manager from finding an embedded * client on its own. */ ForceSubpanelWMState (pECD->winParent); /* * Do the actual reparent */ XReparentWindow (DISPLAY1, pCD->client, pECD->winParent, pECD->x, pECD->y); /* * Configure the embedded client */ windowChanges.width = pECD->width; windowChanges.height = pECD->height; windowChanges.border_width = 0; mask = (CWWidth | CWHeight | CWBorderWidth); XConfigureWindow (DISPLAY1, pCD->client, mask, &windowChanges); XMapWindow (DISPLAY1, pCD->client); UpdateEmbeddedClientsProperty (pCD->pSD); SendConfigureNotify (pCD); return(True); /* successful reparent */ } /* END OF FUNCTION ReparentEmbeddedClient */ /*************************************<->************************************* * * ForceSubpanelWMState (win) * * * Description: * ----------- * This function forces a WM_STATE property on a subpanel window * so that the session manager doesn't save multiple copies * of embedded clients for subpanels that never get mapped. * * * Inputs: * ------ * win = window ID of a subpanel window (not necessarily the top level!) * * * Outputs: * ------- * *************************************<->***********************************/ static void ForceSubpanelWMState (Window win) { ClientData *pCD = NULL; Window root, parent; Window *children = NULL; unsigned int numChildren; PropWMState *wmStateProp; Boolean bDone = False; while (!bDone) { if (!XQueryTree (DISPLAY, win, &root, &parent, &children, &numChildren)) { break; } if (!XFindContext(DISPLAY, win, wmGD.windowContextType, (caddr_t *)&pCD)) { /* * Only continue if we're not already managing this subpanel. */ bDone = True; } else if (parent == root) { if (wmStateProp = GetWMState (win)) { /* * Already has a WM_STATE. */ XFree ((char *)wmStateProp); } else { /* * Add a dummy WM_STATE to foil the session manager * search. */ SetWMState (win, WITHDRAWN_STATE, 0); } bDone = True; } else { /* continue ascent up to root */ win = parent; } XFree ((char *) children); } } /* END OF FUNCTION ForceSubpanelWMState */ /*************************************<->************************************* * * RegisterPushRecallClients (wPanelist, pPRCD, count) * * * Description: * ----------- * This function registers a list of push_recallclients for the * front panel subsystem. * * * Inputs: * ------ * wPanelist = front panel object (widget) * pPRCD = pointer to list of data for clients * count = number of elements in the list * * * Outputs: * ------- * *************************************<->***********************************/ void RegisterPushRecallClients ( Widget wPanelist, WmFpPushRecallClientList pPRCD, int count) { WmScreenData *pSD; int i; for (i= 0; i < wmGD.numScreens; i++) { pSD = &(wmGD.Screens[i]); if (pSD->managed) { if (pSD->wPanelist == wPanelist) break; } } if (i < wmGD.numScreens) { pSD->pPRCD = (struct _WmFpPushRecallClientData *) pPRCD; pSD->numPushRecallClients = count; } #ifdef DEBUG else { fprintf (stderr, "Couldn't match wPanelist to screen data\n"); } #endif /* DEBUG */ for (i = 0; i < pSD->numPushRecallClients ; i++, pPRCD++) { /* * Initialize data in each slot */ pPRCD->tvTimeout.tv_sec = 0; } } /* END OF FUNCTION RegisterPushRecallClients */ /*************************************<->************************************* * * IsPushRecallClient (pCD, ppPRCD) * * * Description: * ----------- * This function tests a a client to see if it should be embedded * in the front panel. * * * Inputs: * ------ * pCD = ptr to Client Data * ppPRCD = ptr to returned embedded client data ptr * * * Outputs: * ------- * *ppPRCD = ptr to embedded client data * *************************************<->***********************************/ Boolean IsPushRecallClient (ClientData *pCD, WmFpPushRecallClientData **ppPRCD) { WmScreenData *pSD; int i; Boolean bFoundMatch = False; WmFpPushRecallClientData *pPRCD; pSD = pCD->pSD; pPRCD = (WmFpPushRecallClientData *) pSD->pPRCD; for (i = 0; i < pSD->numPushRecallClients && !bFoundMatch; i++, pPRCD++) { /* * It's a push_recall client if the resource name matches * a slot and the slot isn't already filled. */ if ((!strcmp ((char *)pCD->clientName, (char *)(pPRCD->pchResName))) && (!pPRCD->pCD)) { *ppPRCD = pPRCD; bFoundMatch = True; } } return (bFoundMatch); } /* END OF FUNCTION IsPushRecallClient */ /*************************************<->************************************* * * ScanForPushRecallClients (pSD) * * * Description: * ----------- * This function scans the managed windows and identifies those that * should be push recall clients of the front panel * * * Inputs: * ------ * pSD - pointer to screen data. * * Outputs: * ------- * *************************************<->***********************************/ void ScanForPushRecallClients ( WmScreenData *pSD) { ClientData *pCD; ClientListEntry *pCLE; WmFpPushRecallClientData *pPRCD; /* * Search through all the windows we're managing right now */ pCLE = pSD->clientList; while (pCLE != NULL) { /* * See if this is an previously unrecognized push recall client */ pCD = pCLE->pCD; if ((pCD->pPRCD == NULL ) && IsPushRecallClient (pCD, &pPRCD)) { CheckPushRecallClient (pCD); } /* * Test for exit condition */ if (pCLE == pSD->lastClient) { /* * Gone all the way through the list without finding * anything -- time to quit */ break; } else { /* * Move to next client. */ pCLE = pCLE->nextSibling; } } } /* END OF FUNCTION ScanForPushRecallClients */ /******************************<->************************************* * * static void CheckPushRecallClient (pCD) * * * Description: * ----------- * Checks a client against the list of push recall clients to see * if there are any matches. All matches are marked. * * Inputs: * ------ * pCD - pointer to the Client Data structure * * Outputs: * ------- * * Comments: * -------- * ******************************<->***********************************/ static void CheckPushRecallClient( ClientData *pCD) { WmFpPushRecallClientData *pPRCD; while (IsPushRecallClient (pCD, &pPRCD)) { /* * There should only be one instance of this * client started from a front panel button. */ pPRCD->pCD = pCD; pPRCD->tvTimeout.tv_sec = 0; if (!pCD->pPRCD) pCD->pPRCD = (void *) pPRCD; } } /******************************<->************************************* * * static void HandleSubstructEvents (Widget w, caddr_t pCD, XEvent *event) * * * Description: * ----------- * Causes death of embedded clients to run through UnManageWindow() * for proper cleanup. * * Note there is one of these event handlers instantiated for * each live client window in the front panel. Hence, for each * live client window death, each of the event handlers gets called * once. We need to ensure that we've got the right pCD before * calling UnManageWindow() on it. * * * Inputs: * ------ * w - not used * pCD - pointer to the Client Data structure * event - we only care about UnMapNotify * * Outputs: * ------- * * Comments: * -------- * This routine is called LOTS of times, for all types of events. * ******************************<->***********************************/ static void HandleSubstructEvents( Widget w, caddr_t ptr, XEvent *event ) { struct _ClientData *pCD = (struct _ClientData *)ptr; switch (event->type) { case UnmapNotify: { if (pCD->client == event->xunmap.window) { UnManageWindow (pCD); } break; } } } /* END OF FUNCTION HandleSubstructEvents */ /*******************************<->************************************* * * UpdateEmbeddedClientsProperty (pSD) * * Description: * ----------- * * Inputs: * ------ * pSD - pointer to the screen data * * Outputs: * ------- * True if successful, False otherwise. * * Comments: * -------- * The _DT_WORKSPACE_EMBEDDED_CLIENTS property on the * root window for the screen will be updated to reflect the * current contents of the front panel * * ******************************<->***********************************/ Boolean UpdateEmbeddedClientsProperty( WmScreenData *pSD ) { unsigned int numClients = 0; Window *pClients = NULL; Boolean rval = True; int i; WmFpEmbeddedClientData *pECD; pECD = (WmFpEmbeddedClientData *) pSD->pECD; for (i = 0; i < pSD->numEmbeddedClients; i++, pECD++) { if (pECD->pCD) { numClients += 1; if (!pClients) { pClients = (Window *) XtMalloc (sizeof(Window)); } else { pClients = (Window *) XtRealloc ((char *)pClients, (numClients * (sizeof(Window)))); } if (!pClients) { Warning ( ((char *)GETMESSAGE(4, 17, "Insufficient memory to write _DT_WORKSPACE_EMBEDDED_CLIENTS.")) ); rval = False; break; } else { pClients[numClients-1] = pECD->pCD->client; } } } SetEmbeddedClientsProperty (pSD->rootWindow, pClients, numClients); if (pClients != NULL) { XtFree ((char *)pClients); } return (rval); } /* END OF FUNCTION UpdateEmbeddedClientsProperty */ /*******************************<->************************************* * * UnParentControls (pSD, unmap) * * Description: * ----------- * * Inputs: * ------ * pSD - pointer to the screen data * unmap - if True, then unmap the windows after reparenting to root * * Outputs: * ------- * none * * Comments: * -------- * Reparents clients embedded in the front panel back to the * root window * ******************************<->***********************************/ void UnParentControls( WmScreenData *pSD, Boolean unmap ) { int i; ClientData *pCD; WmFpEmbeddedClientData *pECD; if (pSD && pSD->managed) { pECD = (WmFpEmbeddedClientData *) pSD->pECD; for (i = 0; i < pSD->numEmbeddedClients; i++, pECD++) { pCD = pECD->pCD; if (pCD) { if ((pCD->clientFlags & CLIENT_IN_SAVE_SET) && !(pCD->clientFlags & CLIENT_DESTROYED)) { XRemoveFromSaveSet (DISPLAY, pCD->client); XRemoveFromSaveSet (DISPLAY1, pCD->client); } XReparentWindow (DISPLAY, pCD->client, pSD->rootWindow, pCD->clientX, pCD->clientY); if (unmap) { XUnmapWindow (DISPLAY, pCD->client); if (pCD->iconWindow) { if (pCD->clientFlags & ICON_IN_SAVE_SET) { XRemoveFromSaveSet (DISPLAY, pCD->iconWindow); pCD->clientFlags &= ~ICON_IN_SAVE_SET; } XUnmapWindow (DISPLAY, pCD->iconWindow); } } } } } } /* END OF FUNCTION UnParentControl */ /*************************************<->************************************* * * RegisterIconBoxControl (wPanelist) * * * Description: * ----------- * This function registers the icon box control in a front panel * * * Inputs: * ------ * wPanelist = front panel object (widget) * * Outputs: * ------- * *************************************<->***********************************/ void RegisterIconBoxControl (Widget wPanelist) { WmScreenData *pSD; int i; for (i= 0; i < wmGD.numScreens; i++) { pSD = &(wmGD.Screens[i]); if (pSD->managed) { if (pSD->wPanelist == wPanelist) break; } } if (i < wmGD.numScreens) { pSD->iconBoxControl = True; pSD->useIconBox = True; } #ifdef DEBUG else { fprintf (stderr, "Couldn't match wPanelist to screen data\n"); } #endif /* DEBUG */ } /* END OF FUNCTION RegisterIconBoxControl */ #endif /* PANELIST */ motif-2.3.8/clients/mwm/WmGlobal.h0000644000175000017500000022174513145162623013717 00000000000000#ifndef _WmGlobal_h #define _WmGlobal_h #ifdef HAVE_CONFIG_H #include #endif /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ /* ANSI C definitions, This should be the first thing in WmGlobal.h */ #ifdef __STDC__ #define Const const #else #define Const /**/ #endif /* * Included Files: */ #include #include #include #ifndef NO_SHAPE #include #endif /* NO_SHAPE */ #include #include #include #include #include #ifdef WSM #include #include
#include
#include
#include "WmParse.h" #ifdef PANELIST #include
#endif /* PANELIST */ #endif /* WSM */ #if defined(sun) && defined(ALLPLANES) #include #endif /* defined(sun) && defined(ALLPLANES) */ /* * Value definitions and macros: */ #ifdef MOTIF_ONE_DOT_ONE #define XmFONTLIST_DEFAULT_TAG "XmSTRING_DEFAULT_CHARSET" #endif #ifdef WSM extern int WmIdentity; /* * Color server defines */ #define CSERVE_NORMAL 0 #define CSERVE_NOT_AVAILABLE 1 #define CSERVE_FAILURE 2 #endif /* WSM */ /* window manager name and class used to get resources: */ #define WM_RESOURCE_CLASS "Mwm" #define WM_RESOURCE_NAME "mwm" #ifdef WSM #define DT_WM_RESOURCE_CLASS "Dtwm" #define DT_WM_RESOURCE_NAME "dtwm" extern Pixel FPbackground; extern Pixel FPforeground; extern Pixel FPtopshadow; extern Pixel FPbottomshadow; extern Pixel FPselectcolor; #define USE_ACTIVE_PIXELSET 0 #define USE_INACTIVE_PIXELSET 1 #define USE_PRIMARY_PIXELSET 2 #define USE_SECONDARY_PIXELSET 3 #define MWM 0 #define DT_MWM 1 #define MwmBehavior (WmIdentity == MWM) #define DtwmBehavior (WmIdentity == DT_MWM) #else #define MwmBehavior (True) #endif /* WSM */ /* ICCC atom names: */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define _XA_TARGETS "TARGETS" # define _XA_MULTIPLE "MULTIPLE" # define _XA_TIMESTAMP "TIMESTAMP" #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #define _XA_WM_STATE "WM_STATE" #define _XA_WM_PROTOCOLS "WM_PROTOCOLS" #define _XA_WM_CHANGE_STATE "WM_CHANGE_STATE" #define _XA_WM_SAVE_YOURSELF "WM_SAVE_YOURSELF" #define _XA_WM_DELETE_WINDOW "WM_DELETE_WINDOW" #define _XA_WM_TAKE_FOCUS "WM_TAKE_FOCUS" #define _XA_WM_COLORMAP_WINDOWS "WM_COLORMAP_WINDOWS" #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* original set of query targets */ # define _XA_MOTIF_WM_CLIENT_WINDOW "_MOTIF_WM_CLIENT_WINDOW" # define _XA_MOTIF_WM_POINTER_WINDOW "_MOTIF_WM_POINTER_WINDOW" # define _XA_MOTIF_WM_ALL_CLIENTS "_MOTIF_WM_ALL_CLIENTS" /* menu command interface support */ # define _XA_MOTIF_WM_DEFINE_COMMAND "_MOTIF_WM_DEFINE_COMMAND" # define _XA_MOTIF_WM_INCLUDE_COMMAND "_MOTIF_WM_INCLUDE_COMMAND" # define _XA_MOTIF_WM_REMOVE_COMMAND "_MOTIF_WM_REMOVE_COMMAND" # define _XA_MOTIF_WM_ENABLE_COMMAND "_MOTIF_WM_ENABLE_COMMAND" # define _XA_MOTIF_WM_DISABLE_COMMAND "_MOTIF_WM_DISABLE_COMMAND" # define _XA_MOTIF_WM_RENAME_COMMAND "_MOTIF_WM_RENAME_COMMAND" # define _XA_MOTIF_WM_INVOKE_COMMAND "_MOTIF_WM_INVOKE_COMMAND" # define _XA_MOTIF_WM_REQUEST_COMMAND "_MOTIF_WM_REQUEST_COMMAND" # define _XA_MOTIF_WM_WINDOW_FLAGS "_MOTIF_WM_WINDOW_FLAGS" /* automation support */ # define _XA_MOTIF_WM_AUTOMATION "_MOTIF_WM_AUTOMATION" #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* window manager exit value on fatal errors: */ #define WM_ERROR_EXIT_VALUE 1 /* built-in button bindings for window manager actions: */ #define SELECT_BUTTON Button1 #define SELECT_BUTTON_MASK Button1Mask #define SELECT_BUTTON_MOTION_MASK Button1MotionMask #define FOCUS_SELECT_BUTTON SELECT_BUTTON #define FOCUS_SELECT_MODIFIERS 0 /* direct manipulation button */ #define DMANIP_BUTTON Button2 #define DMANIP_BUTTON_MASK Button2Mask #define DMANIP_BUTTON_MOTION_MASK Button2MotionMask /* menu button */ #define BMENU_BUTTON Button3 #define BMENU_BUTTON_MASK Button3Mask /* max number of buttons on a mouse */ #define NUM_BUTTONS 5 /* Needed by PostMenu() to specify key post: */ #define NoButton 0 /* manage window flags: */ #define MANAGEW_WM_STARTUP (1L << 0) #define MANAGEW_WM_RESTART (1L << 1) #define MANAGEW_NORMAL (1L << 2) #define MANAGEW_ICON_BOX (1L << 3) #define MANAGEW_CONFIRM_BOX (1L << 4) #define MANAGEW_WM_RESTART_ICON (1L << 5) #ifdef WSM #define MANAGEW_WM_CLIENTS (MANAGEW_ICON_BOX | \ MANAGEW_CONFIRM_BOX ) #else /* WSM */ #define MANAGEW_WM_CLIENTS (MANAGEW_ICON_BOX | MANAGEW_CONFIRM_BOX) #endif /* WSM */ /* keyboard input focus flag values (for calls to SetKeyboardFocus) */ #define ALWAYS_SET_FOCUS (1L << 0) #define REFRESH_LAST_FOCUS (1L << 1) #define CLIENT_AREA_FOCUS (1L << 2) #define SCREEN_SWITCH_FOCUS (1L << 3) /* special value for use for Do_Focus_Key to set to internal window */ #define WORKSPACE_IF_NULL (1L << 4) /* Menu posting flag values (for calls to PostMenu) */ #define POST_AT_XY (1L << 0) #define POST_TRAVERSAL_ON (1L << 1) #define POST_STICKY (1L << 2) /* feedback box styles */ #define FB_OFF (0) #define FB_SIZE (1L << 0) #define FB_POSITION (1L << 1) /* confirmbox and waitbox indexes */ #define DEFAULT_BEHAVIOR_ACTION 0 #define CUSTOM_BEHAVIOR_ACTION 1 #define RESTART_ACTION 2 #define QUIT_MWM_ACTION 3 /* extract text height in pixels from a (XFontStruct *) */ #define TEXT_HEIGHT(pfs) (((pfs)->ascent)+((pfs)->descent)) /* icon frame shadow widths */ #ifdef WSM #define ICON_EXTERNAL_SHADOW_WIDTH (wmGD.iconExternalShadowWidth) #else /* WSM */ #define ICON_EXTERNAL_SHADOW_WIDTH 2 #endif /* WSM */ #define ICON_INTERNAL_SHADOW_WIDTH 1 /* padding widths */ #define ICON_IMAGE_TOP_PAD 2 #define ICON_IMAGE_BOTTOM_PAD 2 #define ICON_IMAGE_LEFT_PAD 2 #define ICON_IMAGE_RIGHT_PAD 2 /* image offsets */ #define ICON_INNER_X_OFFSET \ (ICON_IMAGE_LEFT_PAD+ICON_EXTERNAL_SHADOW_WIDTH) #define ICON_INNER_Y_OFFSET \ (ICON_IMAGE_TOP_PAD+ICON_EXTERNAL_SHADOW_WIDTH) #define ICON_IMAGE_X_OFFSET ICON_INNER_X_OFFSET+ICON_INTERNAL_SHADOW_WIDTH #define ICON_IMAGE_Y_OFFSET ICON_INNER_Y_OFFSET+ICON_INTERNAL_SHADOW_WIDTH /* number of rectangles to allocate */ #define NUM_MATTE_TS_RECTS (6) #define NUM_MATTE_BS_RECTS (6) #define NUM_IMAGE_TOP_RECTS \ ((2*ICON_EXTERNAL_SHADOW_WIDTH)+(2*ICON_INTERNAL_SHADOW_WIDTH)) #define NUM_IMAGE_BOTTOM_RECTS \ ((2*ICON_EXTERNAL_SHADOW_WIDTH)+(2*ICON_INTERNAL_SHADOW_WIDTH)) #define NUM_LABEL_TOP_RECTS (2*ICON_EXTERNAL_SHADOW_WIDTH) #define NUM_LABEL_BOTTOM_RECTS (2*ICON_EXTERNAL_SHADOW_WIDTH) #define NUM_BOTH_TOP_RECTS \ ((3*ICON_EXTERNAL_SHADOW_WIDTH)+(3*ICON_INTERNAL_SHADOW_WIDTH)) #define NUM_BOTH_BOTTOM_RECTS \ ((3*ICON_EXTERNAL_SHADOW_WIDTH)+(3*ICON_INTERNAL_SHADOW_WIDTH)) #define NUM_STATIC_TOP_RECTS (2*ICON_INTERNAL_SHADOW_WIDTH) #define NUM_STATIC_BOTTOM_RECTS (2*ICON_INTERNAL_SHADOW_WIDTH) /* client frame shadow widths */ #ifdef WSM #define FRAME_EXTERNAL_SHADOW_WIDTH (wmGD.frameExternalShadowWidth) #else /* WSM */ #define FRAME_EXTERNAL_SHADOW_WIDTH 2 #endif /* WSM */ #define FRAME_INTERNAL_SHADOW_WIDTH 1 #define FRAME_CLIENT_SHADOW_WIDTH 1 #define FRAME_MATTE_SHADOW_WIDTH 1 /* padding around text in title bar */ #define WM_TOP_TITLE_PADDING 1 #define WM_BOTTOM_TITLE_PADDING 1 #define WM_TOP_TITLE_SHADOW FRAME_INTERNAL_SHADOW_WIDTH #define WM_BOTTOM_TITLE_SHADOW FRAME_INTERNAL_SHADOW_WIDTH #define WM_TITLE_BAR_PADDING (WM_TOP_TITLE_PADDING \ +WM_BOTTOM_TITLE_PADDING \ +WM_TOP_TITLE_SHADOW \ +WM_BOTTOM_TITLE_SHADOW) /* stretch directions - (starts at NW and goes clockwise) */ #define STRETCH_NO_DIRECTION -1 #define STRETCH_NORTH_WEST 0 #define STRETCH_NORTH 1 #define STRETCH_NORTH_EAST 2 #define STRETCH_EAST 3 #define STRETCH_SOUTH_EAST 4 #define STRETCH_SOUTH 5 #define STRETCH_SOUTH_WEST 6 #define STRETCH_WEST 7 #define STRETCH_COUNT 8 #ifdef WSM /* Workspace allocation granularity */ #define WS_ALLOC_AMOUNT 8 /* Window list allocation granularity */ #define WINDOW_ALLOC_AMOUNT 16 #endif /* WSM */ /* function flag masks */ #define WM_FUNC_DEFAULT MWM_FUNC_ALL #define WM_FUNC_NONE 0 #define WM_FUNC_ALL (MWM_FUNC_RESIZE | MWM_FUNC_MOVE |\ MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE |\ MWM_FUNC_CLOSE) /* decorations flag masks */ #define WM_DECOR_DEFAULT MWM_DECOR_ALL #define WM_DECOR_NONE 0 #define WM_DECOR_BORDER (MWM_DECOR_BORDER) #define WM_DECOR_TITLE (MWM_DECOR_TITLE) #define WM_DECOR_SYSTEM (WM_DECOR_TITLE | MWM_DECOR_MENU) #define WM_DECOR_MINIMIZE (WM_DECOR_TITLE | MWM_DECOR_MINIMIZE) #define WM_DECOR_MAXIMIZE (WM_DECOR_TITLE | MWM_DECOR_MAXIMIZE) #define WM_DECOR_TITLEBAR (WM_DECOR_SYSTEM | WM_DECOR_MINIMIZE |\ WM_DECOR_MAXIMIZE) #define WM_DECOR_RESIZEH (WM_DECOR_BORDER | MWM_DECOR_RESIZEH) #define WM_DECOR_RESIZE (WM_DECOR_RESIZEH) #define WM_DECOR_ALL (WM_DECOR_TITLEBAR | WM_DECOR_RESIZEH) #ifdef PANELIST #define WM_DECOR_PANEL_DEFAULT WM_DECOR_BORDER #endif /* PANELIST */ /* icon box definitions */ #define ICON_BOX_FUNCTIONS (MWM_FUNC_RESIZE | MWM_FUNC_MOVE |\ MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE) #ifdef PANELIST /* accessory panel definitions */ #define WM_FUNC_PANEL_DEFAULT (MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE) #define WM_FUNC_SUBPANEL_DEFAULT (MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE|\ MWM_FUNC_CLOSE) #endif /* PANELIST */ #ifdef WSM /* workspace controller definitions */ #define CONTROL_BOX_FUNCTIONS (MWM_FUNC_MOVE) /* workspace presence definitions */ #define PRESENCE_BOX_FUNCTIONS (MWM_FUNC_MOVE) #endif /* WSM */ /* show feedback definitions */ #define WM_SHOW_FB_BEHAVIOR (1L << 0) #define WM_SHOW_FB_MOVE (1L << 1) #define WM_SHOW_FB_PLACEMENT (1L << 2) #define WM_SHOW_FB_RESIZE (1L << 3) #define WM_SHOW_FB_RESTART (1L << 4) #define WM_SHOW_FB_QUIT (1L << 5) #define WM_SHOW_FB_KILL (1L << 6) #define WM_SHOW_FB_ALL (WM_SHOW_FB_BEHAVIOR | WM_SHOW_FB_MOVE |\ WM_SHOW_FB_PLACEMENT | WM_SHOW_FB_RESIZE |\ WM_SHOW_FB_RESTART | WM_SHOW_FB_QUIT |\ WM_SHOW_FB_KILL) #define WM_SHOW_FB_NONE 0 #define WM_SHOW_FB_DEFAULT WM_SHOW_FB_ALL #ifdef WSM /* flags identifying resources to save */ #define WM_RES_WORKSPACE_LIST (1L << 0) #define WM_RES_BACKDROP_IMAGE (1L << 1) #define WM_RES_WORKSPACE_TITLE (1L << 2) #define WM_RES_INITIAL_WORKSPACE (1L << 3) #define WM_RES_FP_POSITION (1L << 4) #define WM_RES_ICONBOX_GEOMETRY (1L << 5) #define WM_RES_WORKSPACE_COUNT (1L << 6) #endif /* WSM */ /*************************************<->************************************* * * Miscellaneous utility window manager data structures ... * * * Description: * ----------- * These data structures are used in resource processing, ... * *************************************<->***********************************/ typedef struct _WHSize { int width; int height; } WHSize; typedef struct _AspectRatio { int x; int y; } AspectRatio; typedef struct _WmColorData { Screen *screen; Colormap colormap; Pixel background; Pixel foreground; Pixel top_shadow; Pixel bottom_shadow; } WmColorData; #ifdef WSM typedef Atom WorkspaceID; #endif /*************************************<->************************************* * * Event processing data structures ... * * * Description: * ----------- * These data structures are used in saving button and key * specifications that are used in processing events that are used to do * window manager functions (e.g., set the colormap focus). * *************************************<->***********************************/ typedef unsigned long Context; typedef unsigned long Behavior; typedef unsigned long GroupArg; typedef Boolean (*WmFunction) (); #define NO_MODIFIER 0 /* value for state field */ typedef struct _KeySpec { unsigned int state; KeyCode keycode; Context context; Context subContext; WmFunction wmFunction; String wmFuncArgs; struct _KeySpec *nextKeySpec; } KeySpec; typedef struct _ButtonSpec { unsigned int state; unsigned int button; unsigned int eventType; Boolean click; Context context; Context subContext; WmFunction wmFunction; String wmFuncArgs; struct _ButtonSpec *nextButtonSpec; } ButtonSpec; /* * Context field values: */ #define F_CONTEXT_NONE 0 #define F_CONTEXT_ROOT (1L << 0) #define F_CONTEXT_ICON (1L << 1) #define F_CONTEXT_NORMAL (1L << 2) #define F_CONTEXT_MAXIMIZE (1L << 3) #define F_CONTEXT_ICONBOX (1L << 4) #ifdef WSM #define F_CONTEXT_IFKEY (1L << 7) #endif /* WSM */ #define F_CONTEXT_WINDOW (F_CONTEXT_NORMAL|F_CONTEXT_MAXIMIZE) #define F_CONTEXT_ALL (F_CONTEXT_ROOT|F_CONTEXT_ICON|F_CONTEXT_WINDOW) /* * context field mark for catching menu recursion * (tied to F_CONTEXT_... values): */ #define CR_MENU_MARK (1L << 5) /* * Part context defines for event processing. The part context is used * to make a subcontext mask. */ /* window (frame and client) part contexts */ #define WINDOW_PART_NONE 0 #define FRAME_NONE WINDOW_PART_NONE #define FRAME_CLIENT 1 #define FRAME_SYSTEM 2 #define FRAME_TITLE 3 #define FRAME_MINIMIZE 4 #define FRAME_MAXIMIZE 5 #define FRAME_RESIZE_NW 6 #define FRAME_RESIZE_N 7 #define FRAME_RESIZE_NE 8 #define FRAME_RESIZE_E 9 #define FRAME_RESIZE_SE 10 #define FRAME_RESIZE_S 11 #define FRAME_RESIZE_SW 12 #define FRAME_RESIZE_W 13 #define FRAME_NBORDER 14 #define FRAME_MATTE 15 #define FRAME_MISC FRAME_MATTE #ifdef WSM #define FRAME_TITLEBAR 17 #endif /* WSM */ /* icon part contexts */ #define ICON_PART_NONE 0 #define ICON_PART_ALL 16 /* root part contexts */ #define ROOT_PART_NONE 0 #define ROOT_PART_ALL 17 /* iconbox part contexts */ #define ICONBOX_PART_NONE 0 #define ICONBOX_PART_IBOX 18 #define ICONBOX_PART_IICON 19 #define ICONBOX_PART_WICON 20 /* * Subcontext field values: */ #define F_SUBCONTEXT_NONE (1L << WINDOW_PART_NONE) #define F_SUBCONTEXT_I_ALL (1L << ICON_PART_ALL) #define F_SUBCONTEXT_R_ALL (1L << ROOT_PART_ALL) #define F_SUBCONTEXT_IB_IBOX (1L << ICONBOX_PART_IBOX) #define F_SUBCONTEXT_IB_IICON (1L << ICONBOX_PART_IICON) #define F_SUBCONTEXT_IB_WICON (1L << ICONBOX_PART_WICON) #define F_SUBCONTEXT_IB_ICONS (F_SUBCONTEXT_IB_IICON |\ F_SUBCONTEXT_IB_WICON) #define F_SUBCONTEXT_IB_ALL (F_SUBCONTEXT_IB_IBOX |\ F_SUBCONTEXT_IB_IICON |\ F_SUBCONTEXT_IB_WICON) #define F_SUBCONTEXT_W_CLIENT (1L << FRAME_CLIENT) #define F_SUBCONTEXT_W_APP F_SUBCONTEXT_W_CLIENT #define F_SUBCONTEXT_W_SYSTEM (1L << FRAME_SYSTEM) #define F_SUBCONTEXT_W_TITLE (1L << FRAME_TITLE) #define F_SUBCONTEXT_W_MINIMIZE (1L << FRAME_MINIMIZE) #define F_SUBCONTEXT_W_MAXIMIZE (1L << FRAME_MAXIMIZE) #define F_SUBCONTEXT_W_RESIZE_NW (1L << FRAME_RESIZE_NW) #define F_SUBCONTEXT_W_RESIZE_N (1L << FRAME_RESIZE_N) #define F_SUBCONTEXT_W_RESIZE_NE (1L << FRAME_RESIZE_NE) #define F_SUBCONTEXT_W_RESIZE_E (1L << FRAME_RESIZE_E) #define F_SUBCONTEXT_W_RESIZE_SE (1L << FRAME_RESIZE_SE) #define F_SUBCONTEXT_W_RESIZE_S (1L << FRAME_RESIZE_S) #define F_SUBCONTEXT_W_RESIZE_SW (1L << FRAME_RESIZE_SW) #define F_SUBCONTEXT_W_RESIZE_W (1L << FRAME_RESIZE_W) #define F_SUBCONTEXT_W_NBORDER (1L << FRAME_NBORDER) #define F_SUBCONTEXT_W_MATTE (1L << FRAME_MATTE) #define F_SUBCONTEXT_W_MISC F_SUBCONTEXT_W_MATTE #define F_SUBCONTEXT_W_RBORDER (F_SUBCONTEXT_W_RESIZE_NW |\ F_SUBCONTEXT_W_RESIZE_N |\ F_SUBCONTEXT_W_RESIZE_NE |\ F_SUBCONTEXT_W_RESIZE_E |\ F_SUBCONTEXT_W_RESIZE_SE |\ F_SUBCONTEXT_W_RESIZE_S |\ F_SUBCONTEXT_W_RESIZE_SW |\ F_SUBCONTEXT_W_RESIZE_W) #define F_SUBCONTEXT_W_BORDER (F_SUBCONTEXT_W_RBORDER |\ F_SUBCONTEXT_W_NBORDER) #define F_SUBCONTEXT_W_TITLEBAR (F_SUBCONTEXT_W_SYSTEM |\ F_SUBCONTEXT_W_TITLE |\ F_SUBCONTEXT_W_MINIMIZE |\ F_SUBCONTEXT_W_MAXIMIZE) #define F_SUBCONTEXT_W_FRAME (F_SUBCONTEXT_W_BORDER |\ F_SUBCONTEXT_W_TITLEBAR) #define F_SUBCONTEXT_W_ALL (F_SUBCONTEXT_W_FRAME |\ F_SUBCONTEXT_W_MATTE |\ F_SUBCONTEXT_W_CLIENT) /* * Click / double-click processing data: */ typedef struct _ClickData { Boolean clickPending; Boolean doubleClickPending; #ifdef WSM Boolean bReplayed; #endif /* WSM */ unsigned int button; unsigned int state; unsigned int releaseState; struct _ClientData *pCD; Context context; Context subContext; Context clickContext; Context doubleClickContext; Time time; } ClickData; /* * Frame part identification aids: */ typedef struct _Gadget_Rectangle { short id; XRectangle rect; } GadgetRectangle; /* * Behavior function argument field values: */ #define F_BEHAVIOR_DEFAULT (1L << 0) #define F_BEHAVIOR_CUSTOM (1L << 1) #define F_BEHAVIOR_SWITCH (1L << 2) /* * Window/icon group function argument field values: */ #define F_GROUP_WINDOW (1L << 0) #define F_GROUP_ICON (1L << 1) #define F_GROUP_DEFAULT (F_GROUP_WINDOW | F_GROUP_ICON) #define F_GROUP_TRANSIENT (1L << 2) #define F_GROUP_ALL (F_GROUP_DEFAULT | F_GROUP_TRANSIENT) #define F_GROUP_GROUP (1L << 3) #ifdef WSM /*************************************<->************************************* * * Workspace data structures ... * ***************************************************************************/ /* * Specific data for workspacePresence dialog box */ typedef struct _WsPresenceData { XmString title; /* resource */ Widget shellW; Widget formW; Widget windowLabelW; Widget windowNameW; Widget workspaceLabelW; Widget workspaceScrolledListW; Widget workspaceListW; Widget allWsW; Widget sepW; Widget OkW; Widget CancelW; Widget HelpW; struct _ClientData *pCDforClient; Context contextForClient; Boolean *ItemSelected; /* workspaces in list */ XmStringTable ItemStrings; /* workspace names */ int currentWsItem; Boolean onScreen; Boolean userDismissed; int numWorkspaces; } WsPresenceData; #define NUM_WSP_WIDGETS 11 typedef struct _WsPresenceData *PtrWsPresenceData; #ifdef PANELIST /* * Specific data for top level help dialog */ typedef struct _WsDtHelpData { XmString title; /* resource */ Widget shell; Widget dialog; Widget errorDialog; Position xPos; Position yPos; Boolean restored; Boolean onScreen; Boolean userDismissed; Boolean bMapped; struct _ClientData *pCDforClient; } WsDtHelpData; typedef struct _WsDtHelpData *PtrWsDtHelpData; #endif /* PANELIST */ /*************************************<->************************************* * * DtSessionItems * * * Description: * ----------- * *************************************<->***********************************/ typedef struct _DtSessionItem { Boolean processed; int clientState; String workspaces; String clientMachine; String command; int commandArgc; char **commandArgv; struct _SessionGeom *sessionGeom; } DtSessionItem; typedef struct _SessionGeom { int flags; int clientX; int clientY; int clientWidth; int clientHeight; } SessionGeom; /* * Status of Session Manager Contention Management */ #define SM_UNITIALIZED 0 #define SM_START_ACK 1 #define SM_STOP_ACK 2 #endif /* WSM */ /*************************************<->************************************* * * Menu specification data structures ... * * * Description: * ----------- * These data structures are used in creating window manager menus that * are specified using resource files. A list of menu specifications * (MenuSpec) is made when the resource files are parsed. The desktop * menu and system menus are created as needed using the menu specification * list. * *************************************<->***********************************/ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* * Used to denote where the separators belong in a pair of separators * used to surround a client command. */ enum { TOP_SEPARATOR, BOTTOM_SEPARATOR }; /* * Used to denote what kind of change to make to a client command. */ typedef enum { ENABLE, DISABLE, REMOVE, RENAME } CmdModifier; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ typedef struct _MenuItem { int labelType; String label; int labelBitmapIndex; KeySym mnemonic; unsigned int accelState; KeyCode accelKeyCode; String accelText; WmFunction wmFunction; String wmFuncArgs; Context greyedContext; long mgtMask; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) String clientCommandName; /* as specified by the user in his .mwmrc file. */ CARD32 clientCommandID; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ struct _MenuItem *nextMenuItem; } MenuItem; #ifdef WSM /* * We use the top part of mgtMask for workspace function bits. * When OSF MWM outgrows the lower 16 bits, we'll have to * change how we do things. */ #define MWM_MGT_MASK 0x0000FFFF #define DTWM_MGT_MASK 0xFFFF0000 #endif /* WSM */ typedef struct _MenuButton { MenuItem *menuItem; Widget buttonWidget; Boolean managed; } MenuButton; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) typedef struct _MenuExclusion { String command_string; struct _MenuExclusion *nextExclusion; } MenuExclusion; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ typedef struct _MenuSpec { String name; Context currentContext; Widget menuWidget; /* RowColumn widget */ unsigned int whichButton; /* tracks whichButton resource for top menu */ unsigned int height; /* height of top menu */ MenuItem *menuItems; /* linked list of MenuItem structures */ MenuButton *menuButtons; /* array of MenuButton structures */ unsigned int menuButtonSize; /* size of menuButtons array */ unsigned int menuButtonCount; /* number of menuButtons elements in use */ Context accelContext; /* accelerator context */ KeySpec *accelKeySpecs; /* list of accelerator KeySpecs */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) MenuExclusion *exclusions; /* list of client commands to be excluded from this menu. */ Boolean clientLocal; /* this menu is owned by a client and not shared with any other clients */ CARD32 commandID; /* if this is a client command, then this its id value - globally unique. */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ struct _MenuSpec *nextMenuSpec; } MenuSpec; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* The range to which a client command operation should apply. */ typedef enum { SINGLE, ROOT, ALL } OpRange; typedef struct _CmdTree { CARD32 commandID; /* unique identifier for this command. */ CARD32 notifyWindow;/* window to receive InvokeCommand request. */ char *name; /* name of command refered to in .mwmrc. */ char *defaultName; /* default label of menu. */ struct _CmdTree *subTrees; /* list of child commands or command sets. */ struct _CmdTree *next; } CmdTree; typedef struct _matchlist { MenuSpec *menuspec; MenuItem *menuitem; String command_string; CmdTree *treenode; WmFunction function; String funcargs; Context greyed_context; struct _matchlist *next; } MatchList; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * Window and function specification data structures ... * * * Description: * ----------- * *************************************<->***********************************/ typedef struct _WindowItem { String window; struct _WindowItem *nextWindowItem; } WindowItem; typedef struct _WindowSet { String name; WindowItem *windowItems; struct _WindowSet *nextWindowSet; } WindowSet; typedef struct _FunctionItem { WmFunction wmFunction; String wmFuncArgs; struct _FunctionItem *nextFunctionItem; } FunctionItem; typedef struct _FunctionSet { String name; FunctionItem *functionItems; struct _FunctionSet *nextFunctionSet; } FunctionSet; /*************************************<->************************************* * * Window manager timer data structure ... * * * Description: * ----------- * This data stucture is used to keep track of window manager timers. Each * active timer has an instance of the data structure. * *************************************<->***********************************/ typedef struct _WmTimer { XtIntervalId timerId; struct _ClientData *timerCD; unsigned int timerType; struct _WmTimer *nextWmTimer; } WmTimer; /* Timer types: */ #define TIMER_NONE 0 #define TIMER_QUIT 1 #define TIMER_RAISE 2 /*************************************<->************************************* * * Window manager frame component data structures * * * Description: * ----------- * This data stucture is used for drawing frame component graphics. * *************************************<->***********************************/ typedef struct _RList { int allocated; /* number of allocated XRectangles */ int used; /* number currently in use */ XRectangle *prect; /* array of XRectangles */ } RList; /*************************************<->************************************* * * Window manager component appearance data structure ... * * * Description: * ----------- * This structure is used to hold component appearance data for client, * icon, and feedback subparts. * *************************************<->***********************************/ typedef struct _AppearanceData { XmFontList fontList; /* resource */ XFontStruct *font; #ifndef NO_MULTIBYTE unsigned int titleHeight; /* title bar's height */ #endif Boolean saveUnder; /* resource */ Pixel background; /* resource */ Pixel foreground; /* resource */ String backgroundPStr; /* resource */ Pixmap backgroundPixmap; Pixel bottomShadowColor; /* resource */ String bottomShadowPStr; /* resource */ Pixmap bottomShadowPixmap; Pixel topShadowColor; /* resource */ String topShadowPStr; /* resource */ Pixmap topShadowPixmap; Pixel activeBackground; /* resource */ String activeBackgroundPStr; /* resource */ Pixmap activeBackgroundPixmap; Pixel activeBottomShadowColor; /* resource */ String activeBottomShadowPStr; /* resource */ Pixmap activeBottomShadowPixmap; Pixel activeForeground; /* resource */ Pixel activeTopShadowColor; /* resource */ String activeTopShadowPStr; /* resource */ Pixmap activeTopShadowPixmap; GC inactiveGC; GC inactiveTopShadowGC; GC inactiveBottomShadowGC; GC activeGC; GC activeTopShadowGC; GC activeBottomShadowGC; } AppearanceData; typedef struct _AppearanceData *PtrAppearanceData; /*************************************<->************************************* * * IconInfo * * * Description: * ----------- * *************************************<->***********************************/ typedef struct _IconInfo { Widget theWidget; struct _ClientData *pCD; } IconInfo; typedef struct _IconInfo *PtrIconInfo; /*************************************<->************************************* * * IconPlacement * * * Description: * ----------- * *************************************<->***********************************/ typedef struct _IconPlacementData { Boolean onRootWindow; /* true if icons on root window */ unsigned iconPlacement; /* style of placement */ int placementRows; /* number of rows in placement space */ int placementCols; /* number of cols in placement space */ int totalPlaces; /* total number of placment slots */ int iPlaceW; /* width increment (to next place) */ int iPlaceH; /* height increment (to next place) */ IconInfo *placeList; /* list of icon info */ int placeIconX; int placeIconY; int *placementRowY; int *placementColX; } IconPlacementData; /*************************************<->************************************* * * IconBoxData * * * Description: * ----------- * This structure is used to hold window and widget information for * each icon box. * *************************************<->***********************************/ typedef struct _IconBoxData { Widget shellWidget; Widget frameWidget; Widget scrolledWidget; Widget vScrollBar; Widget hScrollBar; Widget bBoardWidget; Widget clipWidget; int numberOfIcons; int currentRow; int currentCol; int lastRow; int lastCol; #ifdef WSM WorkspaceID wsID; /* workspace identifier */ #endif /* WSM */ struct _ClientData *pCD_iconBox; /* ptr to its own clientdata */ struct _IconBoxData *pNextIconBox; /* ptr to next icon box */ struct _IconPlacementData IPD; /* icon placement data */ } IconBoxData; typedef struct _IconBoxData *PtrIconBoxData; #define IB_SPACING 0 #define IB_MARGIN_HEIGHT 3 #define IB_MARGIN_WIDTH 3 #define IB_HIGHLIGHT_BORDER 3 /*************************************<->************************************* * * Bitmap/Pixmap cache data * * * Description: * ----------- * These structures are used for the bitmap and pixmap caches held * on a per-screen basis. (This is per-screen because you can't do * XCopyPlane from one pixmap to another when they have different * roots.) * *************************************<->***********************************/ #define NO_PIXMAP 0 #define LABEL_PIXMAP 1 #define ICON_PIXMAP 2 typedef struct _PixmapCache { unsigned int pixmapType; /* icon or label? */ Pixel foreground; Pixel background; Pixmap pixmap; struct _PixmapCache *next; } PixmapCache; typedef struct _BitmapCache { char *path; Pixmap bitmap; unsigned int width; unsigned int height; PixmapCache *pixmapCache; } BitmapCache; /******************************<->************************************* * * Client window list entry data structure ... * * * Description: * ----------- * This structure provides the data for an entry in the client window list. * The client window list has an entry for each non-transient client * window and each non-iconbox icon. * ******************************<->***********************************/ typedef struct _ClientListEntry { struct _ClientListEntry *nextSibling; struct _ClientListEntry *prevSibling; int type; struct _ClientData *pCD; } ClientListEntry; /*************************************<->************************************* * * Frame information * * * Description: * ----------- * This structure contains geometry information for the window manager * frame. * *************************************<->***********************************/ typedef struct _FrameInfo { int x; int y; unsigned int width; unsigned int height; unsigned int upperBorderWidth; unsigned int lowerBorderWidth; unsigned int cornerWidth; unsigned int cornerHeight; unsigned int titleBarHeight; } FrameInfo; /*************************************<->************************************* * * WmScreenData * * * Description: * ----------- * This is the data structure for holding the window manager's * screen data. There is one instantiation of the structure for * each screen. * *************************************<->***********************************/ typedef struct _WmScreenData { int dataType; int screen; /* number for this screen */ Boolean managed; Window rootWindow; Widget screenTopLevelW; Widget screenTopLevelW1; /* for internal WM components */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) Widget utmShell; /* DrawingArea used for UTM */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ Widget confirmboxW[4]; #ifdef PANELIST Widget wPanelist; /* panel object */ #endif /* PANELIST */ #ifdef WSM WsPresenceData presence; /* workspace presence dialog*/ Widget switcherW; /* workspace switcher */ Widget switcherShellW; /* shell for ws switcher */ #endif /* WSM */ Window wmWorkspaceWin; /* holds wm properties */ Window feedbackWin; Window activeIconTextWin; Window activeLabelParent; String displayString; /* used for putenv in F_Exec */ #ifdef WSM int displayResolutionType; #endif /* WSM */ #ifdef PANELIST struct _WmFpEmbeddedClientData *pECD; /* clients living in front panel */ int numEmbeddedClients; struct _WmFpPushRecallClientData *pPRCD; /* push_recall clients */ int numPushRecallClients; #endif /* PANELIST */ /* wm state info: */ unsigned long clientCounter; long focusPriority; Window inputScreenWindow; struct _ClientData *colormapFocus; Colormap workspaceColormap; Colormap lastInstalledColormap; struct _WmWorkspaceData *pActiveWS; /* for this screen */ #ifdef WSM struct _WmWorkspaceData *pLastWS; /* previously active WS */ #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) CmdTree *cciTree; /* pointer to cci definitions */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* per screen caches */ BitmapCache *bitmapCache; unsigned int bitmapCacheSize; unsigned int bitmapCacheCount; /* per screen icon info */ Boolean fadeNormalIcon; /* resource */ int iconPlacement; /* resource */ int iconPlacementMargin; /* resource */ int iconDecoration; /* resource */ WHSize iconImageMaximum; /* resource */ WHSize iconImageMinimum; /* resource */ Pixmap builtinIconPixmap; int iconWidth; int iconHeight; int iconImageHeight; int iconLabelHeight; GC shrinkWrapGC; GC fadeIconGC; GC fadeIconTextGC; #ifdef WSM /* per screen configuration outline windows */ Window woN; /* North outline window */ Window woS; /* South outline window */ Window woE; /* East outline window */ Window woW; /* West outline window */ #endif /* WSM */ /* per screen feedback data */ unsigned long fbStyle; unsigned int fbWinWidth; unsigned int fbWinHeight; char fbLocation[20]; char fbSize[20]; int fbLocX; int fbLocY; int fbSizeX; int fbSizeY; int fbLastX; int fbLastY; unsigned int fbLastWidth; unsigned int fbLastHeight; RList *fbTop; RList *fbBottom; int actionNbr; /* resource description file data: */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) String rootMenu; /* resource */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ String buttonBindings; /* resource */ ButtonSpec *buttonSpecs; String keyBindings; /* resource */ KeySpec *keySpecs; MenuSpec **acceleratorMenuSpecs; unsigned int acceleratorMenuCount; MenuSpec *menuSpecs; Boolean defaultSystemMenuUseBuiltin; Pixmap defaultPixmap; GC xorGC; /* per screen appearance resources */ Boolean cleanText; /* resource */ Boolean decoupleTitleAppearance; /* see clientTitleAppearance */ int frameBorderWidth; /* resource */ String feedbackGeometry; /* resource */ #ifndef WSM String iconBoxGeometry; /* resource */ #endif /* WSM */ String iconBoxName; /* resource */ String iconBoxSBDisplayPolicy; /* resource */ int iconBoxScheme; /* resource - testing */ XmString iconBoxTitle; /* resource */ int externalBevel; int joinBevel; Boolean limitResize; /* resource */ WHSize maximumMaximumSize; /* resource */ int resizeBorderWidth; /* resource */ Boolean resizeCursors; /* resource */ int transientDecoration; /* resource */ int transientFunctions; /* resource */ Boolean useIconBox; /* resource */ #ifdef PANELIST int subpanelDecoration; /* resource */ String subpanelResources; /*to restore subpanels */ Boolean iconBoxControl; /* FP control for icon box */ #endif /* PANELIST */ Boolean moveOpaque; /* move window not outlines */ #ifdef WSM /* pixel set info (from color object) */ XmPixelSet *pPixelData; /* all pixel data */ XmPixelSet *pActivePixelSet; /* ptr into pPixelData */ XmPixelSet *pInactivePixelSet; /* ptr into pPixelData */ XmPixelSet *pPrimaryPixelSet; /* ptr into pPixelData */ XmPixelSet *pSecondaryPixelSet; /* ptr into pPixelData */ XmPixelSet *pTextPixelSet; /* ptr into pPixelData */ int colorUse; /* indication from color obj */ #endif /* WSM */ /* client frame component appearance resources and data: */ AppearanceData clientAppearance; /* resources ... */ AppearanceData clientTitleAppearance; /* resources ... */ XPoint transientOffset; int Num_Resize_Ts_Elements; int Num_Resize_Bs_Elements; int Num_Title_Ts_Elements; int Num_Title_Bs_Elements; /* icon component appearance resources and data: */ AppearanceData iconAppearance; /* resources ... */ /* feedback component appearance resources and data: */ AppearanceData feedbackAppearance; /* resources ... */ /* client list pointers: */ ClientListEntry *clientList; ClientListEntry *lastClient; #ifdef WSM /* DtSessionHints for clients */ struct _DtSessionItem *pDtSessionItems; int totalSessionItems; int remainingSessionItems; /* workspace list for this screen */ String initialWorkspace; /* private resource */ String workspaceList; /* resource */ int numWorkspaces; int numWsDataAllocated; struct _WmWorkspaceData *pWS; Window lastBackdropWin; struct _WsDtHelpData dtHelp; struct _CacheListStruct *cachedHelp; String helpResources; /* to restore help */ DtSvcHandle hWsm; /* WORKSPACEMGR message handle */ Boolean bMarqueeSelectionInitialized; #else /* WSM */ /* workspace for this screen */ struct _WmWorkspaceData *pWS; #endif /* WSM */ } WmScreenData; typedef struct _WmScreenData *PtrScreenData; /* * Convenience macros for data access */ #define ROOT_FOR_CLIENT(pcd) ((pcd)->pSD->rootWindow) #define SCREEN_FOR_CLIENT(pcd) ((pcd)->pSD->screen) #define PSD_FOR_CLIENT(pcd) ((pcd)->pSD) #define BUTTON_SPECS(pcd) ((pcd)->pSD->buttonSpecs) #define KEY_SPECS(pcd) ((pcd)->pSD->keySpecs) #define ACCELERATOR_MENU_COUNT(pcd) ((pcd)->pSD->acceleratorMenuCount) #define ACCELERATOR_MENU_SPECS(pcd) ((pcd)->pSD->acceleratorMenuSpecs) #define WORKSPACE_COLORMAP(pcd) ((pcd)->pSD->workspaceColormap) #define FADE_NORMAL_ICON(pcd) ((pcd)->pSD->fadeNormalIcon) /* #define ICON_DEFAULT_TITLE(pcd) ((pcd)->iconDefaultTitle) */ #define ICON_DECORATION(pcd) ((pcd)->pSD->iconDecoration) #define ICON_HEIGHT(pcd) ((pcd)->pSD->iconHeight) #define ICON_WIDTH(pcd) ((pcd)->pSD->iconWidth) #define ICON_IMAGE_HEIGHT(pcd) ((pcd)->pSD->iconImageHeight) #define ICON_LABEL_HEIGHT(pcd) ((pcd)->pSD->iconLabelHeight) #define ICON_IMAGE_MAXIMUM(pcd) ((pcd)->pSD->iconImageMaximum) #define ICON_IMAGE_MINIMUM(pcd) ((pcd)->pSD->iconImageMinimum) #define SHRINK_WRAP_GC(pcd) ((pcd)->pSD->shrinkWrapGC) #define FADE_ICON_GC(pcd) ((pcd)->pSD->fadeIconGC) #define FADE_ICON_TEXT_GC(pcd) ((pcd)->pSD->fadeIconTextGC) #define DEFAULT_PIXMAP(pcd) ((pcd)->pSD->defaultPixmap) #ifdef WSM #define ICON_PLACE(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconPlace) #define ICON_X(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconX) #define ICON_Y(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconY) #define P_ICON_BOX(pcd) ((pcd)->pWsList[(pcd)->currentWsc].pIconBox) #define ICON_FRAME_WIN(pcd) ((pcd)->pWsList[(pcd)->currentWsc].iconFrameWin) #else /* WSM */ #define ICON_PLACE(pcd) ((pcd)->iconPlace) #define ICON_X(pcd) ((pcd)->iconX) #define ICON_Y(pcd) ((pcd)->iconY) #define P_ICON_BOX(pcd) ((pcd)->pIconBox) #define ICON_FRAME_WIN(pcd) ((pcd)->iconFrameWin) #endif /* WSM */ #ifdef WSM /* * Definitions for Screen data */ #define MAX_WORKSPACE_COUNT 64 /*************************************<->************************************* * * BackdropData * * * Description: * ----------- * This structure hold information for the workspace background * *************************************<->***********************************/ typedef struct _WmBackdropData { String image; /* resource */ Atom nameAtom; Pixmap imagePixmap; int colorSet; /* resource */ Pixel background; /* resource */ Pixel foreground; /* resource */ unsigned int flags; Window window; } BackdropData; /* * bit definiton for "flags" member of BackdropData */ #define BACKDROP_NONE 0 #define BACKDROP_CLIENT (1L<<1) #define BACKDROP_BITMAP (1L<<2) #define BACKDROP_IMAGE_ALLOCED (1L<<3) /* image string can be freed */ typedef struct _WmBackdropData *PtrBackdropData; #define DEFAULT_BACKDROP_DIR CDE_INSTALLATION_TOP "/backdrops" #ifdef PANELIST /* * direction for slide-out panels */ typedef enum _SlideDirection { SLIDE_NOT, SLIDE_NORTH, SLIDE_EAST, SLIDE_SOUTH, SLIDE_WEST } SlideDirection; /* * Slide out record for subpanels */ typedef struct _SlideOutRec { struct _ClientData *pCD; Window coverWin; Dimension incWidth; Dimension incHeight; Dimension currWidth; Dimension currHeight; Position currX; Position currY; unsigned int interval; SlideDirection direction; Boolean mapping; Widget wSubpanel; } SlideOutRec; /* * Data structure for arguments to f.action */ typedef struct _WmActionArg { String actionName; int numArgs; DtActionArg * aap; String szExecParms; } WmActionArg; #endif /* PANELIST */ #endif /* WSM */ /*************************************<->************************************* * * WmWorkspaceData * * * Description: * ----------- * This is the structure for holding the workspace specific data. * (This has been broken out in anticipation of possible future * enhancements.) * *************************************<->***********************************/ typedef struct _WmWorkspaceData { int dataType; #ifdef WSM WorkspaceID id; int map_state; BackdropData backdrop; Widget buttonW; XmString title; /* resource (visible name) */ String iconBoxGeometry;/* resource */ #endif /* WSM */ String name; /* workspace name */ /* (used for resource fetching) */ WmScreenData *pSD; /* screen data for this workspace */ IconBoxData *pIconBox; /* icon box data for this workspace */ IconPlacementData IPData; Widget workspaceTopLevelW; /* workspace state information */ struct _ClientData *keyboardFocus; /* ptr to client with the key focus */ struct _ClientData *nextKeyboardFocus; /* next client to get focus */ #ifdef WSM struct _ClientData **ppClients; /* list of client data ptrs */ unsigned int numClients; /* number of client in list */ unsigned int sizeClientList; /* size of client list */ #endif /* WSM */ } WmWorkspaceData; typedef struct _WmWorkspaceData *PtrWorkspaceData; /* * Convenience macros for data access */ #define CLIENT_APPEARANCE(pcd) ((pcd)->pSD->clientAppearance) #define CLIENT_TITLE_APPEARANCE(pcd) ((pcd)->pSD->clientTitleAppearance) #define DECOUPLE_TITLE_APPEARANCE(pcd) ((pcd)->pSD->decoupleTitleAppearance) /* #define CLIENT_DEFAULT_TITLE(pcd) ((pcd)->pSD->clientDefaultTitle) */ #define MAX_MAX_SIZE(pcd) ((pcd)->pSD->maximumMaximumSize) #define SHOW_RESIZE_CURSORS(pcd) ((pcd)->pSD->resizeCursors) #define JOIN_BEVEL(pcd) ((pcd)->pSD->joinBevel) #define EXTERNAL_BEVEL(pcd) ((pcd)->pSD->externalBevel) #define FRAME_BORDER_WIDTH(pcd) ((pcd)->pSD->frameBorderWidth) #define RESIZE_BORDER_WIDTH(pcd) ((pcd)->pSD->resizeBorderWidth) #define NUM_TITLE_TS_ELEMENTS(pcd) ((pcd)->pSD->Num_Title_Ts_Elements) #define NUM_TITLE_BS_ELEMENTS(pcd) ((pcd)->pSD->Num_Title_Bs_Elements) #define NUM_RESIZE_TS_ELEMENTS(pcd) ((pcd)->pSD->Num_Resize_Ts_Elements) #define NUM_RESIZE_BS_ELEMENTS(pcd) ((pcd)->pSD->Num_Resize_Bs_Elements) #define ICON_APPEARANCE(pcd) ((pcd)->pSD->iconAppearance) #define ACTIVE_LABEL_PARENT(pcd) ((pcd)->pSD->activeLabelParent) #ifndef WSM #define ICON_BOX_GEOMETRY(pcd) ((pcd)->pSD->iconBoxGeometry) #endif /* WSM */ #define ICON_BOX_TITLE(pcd) ((pcd)->pSD->iconBoxTitle) #define TRANSIENT_DECORATION(pcd) ((pcd)->pSD->transientDecoration) #define TRANSIENT_FUNCTIONS(pcd) ((pcd)->pSD->transientFunctions) /*************************************<->************************************* * * ClientData * * * Description: * ----------- * This data structure is instantiated for every client window that is * managed by the window manager. The information that is saved in the * data structure is specific to the associated client window. * * ClientData is instantiated at the time a client window is intially * managed and is destroyed when the client window is withdrawn from * window management (the ClientData may not be destroyed when a * client window is withdrawn if frame/icons are cached). * *************************************<->***********************************/ typedef struct _ClientData { int dataType; /* client data type */ Window client; long clientFlags; int icccVersion; int clientState; /* WM_HINTS field */ int inputFocusModel; /* WM_HINTS field */ int inputMode; long focusPriority; unsigned long clientID; int wmUnmapCount; #ifdef PANELIST struct _WmFpEmbeddedClientData *pECD; /* embedded client data */ struct _WmFpPushRecallClientData *pPRCD; /* embedded client data */ #endif /* PANELIST */ #ifdef WSM Atom * paInitialProperties; /* initial window properties */ int numInitialProperties; /* number of initial properties */ #endif /* WSM */ /* client supported protocols: */ Atom *clientProtocols; /* WM_PROTOCOLS */ int clientProtocolCount; long protocolFlags; long *mwmMessages; /* _MWM_MESSAGES */ int mwmMessagesCount; /* client colormap data: */ Colormap clientColormap; /* selected client colormap */ Window *cmapWindows; /* from WM_COLORMAP_WINDOWS */ Colormap *clientCmapList; int clientCmapCount; /* len of clientCmapList */ int clientCmapIndex; /* current cmap in list */ #ifndef OLD_COLORMAP /* colormap */ int *clientCmapFlags; /* installed, uninstalled */ Bool clientCmapFlagsInitialized; /* Are clientCmapFlags valid? */ #endif /* associated window data: */ ClientListEntry clientEntry; ClientListEntry iconEntry; XID windowGroup; /* WM_HINTS field */ #ifndef NO_OL_COMPAT Boolean bPseudoTransient; /* transientFor window group */ #endif /* NO_OL_COMPAT */ #ifndef WSM IconBoxData *pIconBox; /* icon box for this win */ #endif /* WSM */ IconBoxData *thisIconBox; /* icon box data for self */ /* if this is an icon box */ Context grabContext; /* used to support icon box */ /* icon key, button, menus */ Window transientFor; /* transient for another win */ struct _ClientData *transientLeader; /* trans leader of this win */ struct _ClientData *transientChildren; /* transients of this win */ struct _ClientData *transientSiblings; /* related transient win's */ #ifdef WSM int primaryStackPosition; /* stack pos'n of primary */ Boolean secondariesOnTop; /* resource */ #endif /* WSM */ int primaryModalCount; /* primary modal win count */ int fullModalCount; /* full modal win count */ /* client resource data */ String clientClass; /* WM_CLASS field */ String clientName; /* WM_CLASS field */ int clientDecoration; /* resource */ int clientFunctions; /* resource */ Boolean focusAutoRaise; /* resource */ Boolean focusAutoRaiseDisabled; /* to support f.lower */ Boolean focusAutoRaiseDisablePending; /* to support f.lower */ String iconImage; /* resource */ Pixel iconImageBackground; /* resource */ Pixel iconImageBottomShadowColor; /* resource */ String iconImageBottomShadowPStr; /* resource */ Pixmap iconImageBottomShadowPixmap; Pixel iconImageForeground; /* resource */ Pixel iconImageTopShadowColor; /* resource */ String iconImageTopShadowPStr; /* resource */ Pixmap iconImageTopShadowPixmap; Boolean ignoreWMSaveHints; /* resource */ int internalBevel; /* resource */ Pixel matteBackground; /* resource */ Pixel matteBottomShadowColor; /* resource */ String matteBottomShadowPStr; /* resource */ Pixmap matteBottomShadowPixmap; Pixel matteForeground; /* resource */ Pixel matteTopShadowColor; /* resource */ String matteTopShadowPStr; /* resource */ Pixmap matteTopShadowPixmap; int matteWidth; /* resource */ WHSize maximumClientSize; /* resource */ String smClientID; /* SM_CLIENT_ID */ String systemMenu; /* resource */ MenuItem *mwmMenuItems; /* custom menu items or NULL */ MenuSpec *systemMenuSpec; Boolean useClientIcon; /* resource */ int wmSaveHintFlags; /* WMSAVE_HINT */ /* client frame data: */ long sizeFlags; /* WM_NORMAL_HINTS field */ long decor; /* client decoration*/ long decorFlags; /* depressed gadgets flags */ int minWidth; /* WM_NORMAL_HINTS field */ int minHeight; /* WM_NORMAL_HINTS field */ Boolean maxConfig; /* True => use max config */ int maxX; /* maximized window X loc */ int maxY; /* maximized window Y loc */ int maxWidthLimit; int maxWidth; /* WM_NORMAL_HINTS field */ int maxHeightLimit; int maxHeight; /* WM_NORMAL_HINTS field */ int oldMaxWidth; /* for good HPterm behavior */ int oldMaxHeight; /* for good HPterm behavior */ int widthInc; /* WM_NORMAL_HINTS field */ int heightInc; /* WM_NORMAL_HINTS field */ AspectRatio minAspect; /* WM_NORMAL_HINTS field */ AspectRatio maxAspect; /* WM_NORMAL_HINTS field */ int baseWidth; /* WM_NORMAL_HINTS field */ int baseHeight; /* WM_NORMAL_HINTS field */ int windowGravity; /* WM_NORMAL_HINTS field */ int clientX; /* normal window X loc */ int clientY; /* normal window Y loc */ int clientWidth; /* normal window width */ int clientHeight; /* normal window height */ XPoint clientOffset; /* frame to client window */ XmString clientTitle; /* WM_NAME field */ Window clientFrameWin; /* top-level, frame window */ Window clientStretchWin[STRETCH_COUNT];/* for resizing border */ Window clientTitleWin; /* for title bar */ Window clientBaseWin; /* for matte & reparenting */ int xBorderWidth; /* original X border width */ FrameInfo frameInfo; /* frame geometry data */ /* client window frame graphic data: */ RList *pclientTopShadows; /* top shadow areas */ RList *pclientBottomShadows; /* bottom shadow areas */ RList *pclientTitleTopShadows; /* top shadow areas */ RList *pclientTitleBottomShadows; /* bottom shadow areas */ RList *pclientMatteTopShadows; /* matte top shadows */ RList *pclientMatteBottomShadows; /* matte bottom shadows */ /* rectangles for client frame gadgets */ XRectangle titleRectangle; /* title bar area */ GadgetRectangle *pTitleGadgets; /* title bar gadgets */ int cTitleGadgets; /* count of title rects */ GadgetRectangle *pResizeGadgets; /* resize areas */ XRectangle matteRectangle; /* matte / base window area */ /* client appearance data: */ GC clientMatteTopShadowGC; GC clientMatteBottomShadowGC; WmScreenData *pSD; /* where visuals come from */ /* icon data: */ long iconFlags; XmString iconTitle; /* WM_ICON_NAME field */ #ifndef WSM int iconX; /* WM_HINTS field */ int iconY; /* WM_HINTS field */ int iconPlace; Window iconFrameWin; #endif /* WSM */ Pixmap iconPixmap; /* WM_HINTS field */ Pixmap iconMask; /* WM_HINTS field */ Window iconWindow; /* WM_HINTS field */ RList *piconTopShadows; /* these change to */ /* to reflect the */ RList *piconBottomShadows; /* depressed icon image */ #ifdef WSM /* workspace data */ int absentMapBehavior; /* resource */ int numInhabited; /* number of WS's inhabited */ int sizeWsList; /* size of wsc data list */ struct _WsClientData *pWsList; /* list of workspace-client data */ int currentWsc; /* index to current wsc data */ WorkspaceID *pWorkspaceHints; /* _DT_WORKSPACE_HINTS */ int numWorkspaceHints; /* size of pWorkspaceHints */ Boolean putInAll; /* persistent window flag */ long dtwmFunctions; /* _DT_WM_HINTS */ long dtwmBehaviors; /* _DT_WM_HINTS */ Window attachWindow; /* _DT_WM_HINTS */ #ifdef PANELIST SlideDirection slideDirection; /* slide-up direction */ SlideOutRec *pSOR; /* slide-out record */ #endif /* PANELIST */ #endif /* WSM */ #ifndef NO_SHAPE short wShaped; /* this window has a bounding shape */ #endif /* NO_SHAPE */ int usePPosition; /* indicate whether to use PPosition */ long window_status; /* used for Tear-off Menus */ } ClientData; typedef struct _ClientData *PtrClientData; /* client data convenience macros */ #define IS_APP_MODALIZED(pcd) \ (((pcd)->primaryModalCount)||((pcd)->fullModalCount)) #define IS_MAXIMIZE_VERTICAL(pcd) \ ((pcd->maximumClientSize.height == BIGSIZE) && \ (pcd->maximumClientSize.width == 0)) #define IS_MAXIMIZE_HORIZONTAL(pcd) \ ((pcd->maximumClientSize.width == BIGSIZE) && \ (pcd->maximumClientSize.height == 0)) /* window management state of client windows (clientState): */ #define WITHDRAWN_STATE 0 #define NORMAL_STATE 1 #define MINIMIZED_STATE 2 #define MAXIMIZED_STATE 3 #ifdef WSM #define UNSEEN_STATE 8 #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define NO_CHANGE -1 # define UNSET 0 # define SET 1 #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* clientFlags field values: */ #define CLIENT_HINTS_TITLE (1L << 0) #define CLIENT_REPARENTED (1L << 1) #define CLIENT_TRANSIENT (1L << 2) #define CLIENT_CONTEXT_SAVED (1L << 3) #define CLIENT_IN_SAVE_SET (1L << 4) #define USERS_MAX_POSITION (1L << 5) #define WM_INITIALIZATION (1L << 6) #define CLIENT_DESTROYED (1L << 7) #define ICON_REPARENTED (1L << 8) #define ICON_IN_SAVE_SET (1L << 9) #define CLIENT_TERMINATING (1L << 10) #define ICON_BOX (1L << 11) /* one of our icon boxes */ #define CONFIRM_BOX (1L << 12) /* a confirmation box */ #ifdef PANELIST #define FRONT_PANEL_BOX (1L << 14) /* a DT 3.0 front panel */ #define GOT_DT_WM_HINTS (1L << 15) #endif /* PANELIST */ #ifdef WSM #define SM_LAUNCHED (1L << 17) /* launched by dtsession */ #endif /* WSM */ #define SM_X (1L << 18) /* X from DB/dtsession */ #define SM_Y (1L << 19) /* Y from DB/dtsession */ #define SM_WIDTH (1L << 20) /* width fm DB/dtsession */ #define SM_HEIGHT (1L << 21) /* height fm DB/dtsession */ #define SM_CLIENT_STATE (1L << 22) /* clientState fm DB/dtsession */ #define SM_ICON_X (1L << 23) /* icon X from DB */ #define SM_ICON_Y (1L << 24) /* icon Y from DB */ #define CLIENT_WM_CLIENTS (ICON_BOX | CONFIRM_BOX) /* decorFlags bit fields */ #define SYSTEM_DEPRESSED (1L << 0) #define TITLE_DEPRESSED (1L << 1) #define MINIMIZE_DEPRESSED (1L << 2) #define MAXIMIZE_DEPRESSED (1L << 3) /* iconFlags field values: */ #define ICON_HINTS_POSITION (1L << 0) #define ICON_HINTS_TITLE (1L << 1) #define ICON_HINTS_PIXMAP (1L << 2) /* client protocol flags and sizes: */ #define PROTOCOL_WM_SAVE_YOURSELF (1L << 0) #define PROTOCOL_WM_DELETE_WINDOW (1L << 1) #define PROTOCOL_WM_TAKE_FOCUS (1L << 2) #define PROTOCOL_MWM_MESSAGES (1L << 3) #define PROTOCOL_MWM_OFFSET (1L << 4) #define MAX_CLIENT_PROTOCOL_COUNT 40 #define MAX_COLORMAP_WINDOWS_COUNT 40 #define MAX_MWM_MESSAGES_COUNT 40 /* bevel width limits between window manager frame and client window */ #define MIN_INTERNAL_BEVEL 0 #define MAX_INTERNAL_BEVEL 2 /* global return buffer */ #define MAXWMPATH 1023 #define MAXBUF (MAXWMPATH+1) #define PIXMAP_IS_VALID(pix) \ ((pix) != XmUNSPECIFIED_PIXMAP && (pix) != None && (pix) != (Pixmap)NULL) #ifdef WSM /*************************************<->************************************* * * WsClientData * * * Description: * ----------- * This datum compartmentalizes client data that must be replicated * on a per workspace basis. * *************************************<->***********************************/ typedef struct _WsClientData { WorkspaceID wsID; /* workspace identifier */ int iconPlace; /* icon placment index */ int iconX; int iconY; Window iconFrameWin; IconBoxData *pIconBox; /* icon box for this win */ } WsClientData; #endif /* WSM */ /* * frame style types */ typedef enum _FrameStyle { WmRECESSED, WmSLAB } FrameStyle; /*************************************<->************************************* * * WmGlobalData * * * Description: * ----------- * This is the main data structure for holding the window manager's * global data. There is one instantiation of the structure for * the window manager. * *************************************<->***********************************/ typedef struct _WmGlobalData { int dataType; char **argv; /* command line argument vector */ char **environ; /* environment vector */ char *mwmName; /* name of our executable */ Widget topLevelW; #ifdef WSM Widget topLevelW1; /* from which WM components hang */ #endif /* WSM */ Boolean confirmDialogMapped; /* confirm dialog is mapped */ XtAppContext mwmAppContext; /* application context for mwm */ XContext windowContextType; /* window context for XSaveContext */ XContext screenContextType; /* screen context for XSaveContext */ #ifndef IBM_169380 XContext cmapWindowContextType; /* list of pCD's in WM_COLORMAP_WINDOWS context for XSaveContext */ #endif #ifdef WSM XContext mwmWindowContextType; /* mwm win context for XSaveContext */ Window dtSmWindow; /* used for contention management */ Window commandWindow; /* WM_SAVE_YOURSELF win for dtwm */ #endif /* WSM */ /* presentation resource id's: */ String displayString; /* used for putenv in F_Exec */ Display *display; /* display we are running to */ #ifdef WSM Display *display1; /* second display connection */ int statusColorServer; /* CSERVE_NORMAL, CSERVE_NOT_AVAILABLE */ DtWmpParseBuf *pWmPB; /* global parse buffer */ #endif /* WSM */ int numScreens; /* number of screens */ unsigned char **screenNames; /* default names for screens */ WmScreenData *Screens; /* array of screen info */ Cursor workspaceCursor; /* basic arrow cursor */ Cursor stretchCursors[STRETCH_COUNT]; Cursor configCursor; Cursor movePlacementCursor; Cursor sizePlacementCursor; #ifndef NO_MESSAGE_CATALOG XmString okLabel; XmString cancelLabel; XmString helpLabel; #endif /* wm state info: */ WmScreenData *pActiveSD; /* with keyfocus window */ Boolean useStandardBehavior; /* behavior flag */ Boolean wmRestarted; /* restart flag */ Boolean errorFlag; /* handle on async errors */ XID errorResource; /* from XErrorEvent */ unsigned char errorRequestCode; /* from XErrorEvent */ /* The following are global because pointer is grabbed */ MenuSpec *menuActive; /* ptr to currently active menu */ KeySpec *menuUnpostKeySpec; /* key to upost current menu */ ClientData *menuClient; /* client for which menu is posted */ KeySpec *F_NextKeySpec; /* used when travering to windows */ KeySpec *F_PrevKeySpec; /* used when travering to windows */ Context grabContext; /* used in GrabWin when no event */ ClickData clickData; /* double-click detection data */ int configAction; /* none, resize, move */ unsigned int configButton; /* button used for config */ unsigned int configPart; /* resize frame part */ Boolean configSet; /* True if configPart set */ Boolean movingIcon; /* True if icon being moved */ Boolean preMove; /* move threshold support */ int preMoveX; int preMoveY; ClientData *gadgetClient; /* last client with */ int gadgetDepressed; /* depressed gadget */ Boolean checkHotspot; /* event hotspot flag */ XRectangle hotspotRectangle; /* event hotspot area */ WmTimer *wmTimers; /* timer data */ Boolean passKeysActive; /* flag for pass keys function */ KeySpec *passKeysKeySpec; /* key for pass keys function */ Boolean activeIconTextDisplayed; /* True if active label up */ Boolean queryScreen; /* True if not sure of active screen */ /* keyboard focus data: */ ClientData *keyboardFocus; /* ptr to client with the key focus */ ClientData *nextKeyboardFocus; /* next client to get focus */ Boolean systemModalActive; ClientData *systemModalClient; Window systemModalWindow; /* Resource database used to restore client geometries, etc. */ XrmDatabase clientResourceDB; #ifndef WSM char *dbFileName; String sessionClientDB; /* resource */ #endif /* atoms used in inter-client communication: */ Atom xa_WM_STATE; Atom xa_WM_PROTOCOLS; Atom xa_WM_CHANGE_STATE; Atom xa_WM_SAVE_YOURSELF; Atom xa_WM_DELETE_WINDOW; Atom xa_WM_TAKE_FOCUS; Atom xa_WM_COLORMAP_WINDOWS; Atom xa_MWM_HINTS; Atom xa_MWM_MESSAGES; Atom xa_MWM_MENU; Atom xa_MWM_INFO; Atom xa_MWM_OFFSET; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) Atom *xa_WM; Atom xa_TARGETS; Atom xa_MULTIPLE; Atom xa_TIMESTAMP; /* original set of query targets */ Atom _MOTIF_WM_CLIENT_WINDOW; Atom _MOTIF_WM_POINTER_WINDOW; Atom _MOTIF_WM_ALL_CLIENTS ; /* menu command interface support */ Atom _MOTIF_WM_DEFINE_COMMAND; Atom _MOTIF_WM_INCLUDE_COMMAND; Atom _MOTIF_WM_REMOVE_COMMAND; Atom _MOTIF_WM_ENABLE_COMMAND; Atom _MOTIF_WM_DISABLE_COMMAND; Atom _MOTIF_WM_RENAME_COMMAND; Atom _MOTIF_WM_INVOKE_COMMAND; Atom _MOTIF_WM_REQUEST_COMMAND; Atom _MOTIF_WM_WINDOW_FLAGS; /* automation support */ Atom _MOTIF_WM_AUTOMATION; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ Atom xa_MOTIF_BINDINGS; Atom xa_COMPOUND_TEXT; Atom xa_SM_CLIENT_ID; Atom xa_WMSAVE_HINT; #ifdef WSM /* atoms used for workspace management: */ Atom xa_DT_WORKSPACE_HINTS; Atom xa_DT_WORKSPACE_PRESENCE; Atom xa_DT_WORKSPACE_INFO; Atom xa_DT_EMBEDDED_CLIENTS; Atom xa_DT_WORKSPACE_LIST; Atom xa_DT_WORKSPACE_CURRENT; Atom xa_ALL_WORKSPACES; Atom xa_DT_SESSION_HINTS; Atom xa_DT_WM_REQUEST; Atom xa_DT_SM_WM_PROTOCOL; Atom xa_DT_SM_START_ACK_WINDOWS; Atom xa_DT_SM_STOP_ACK_WINDOWS; Atom xa_DT_WM_WINDOW_ACK; Atom xa_DT_WM_EXIT_SESSION; Atom xa_DT_WM_LOCK_DISPLAY; Atom xa_DT_WM_READY; #endif /* WSM */ #ifndef NO_OL_COMPAT Atom xa_OL_WIN_ATTR; Atom xa_OL_DECOR_RESIZE; Atom xa_OL_DECOR_HEADER; Atom xa_OL_DECOR_CLOSE; Atom xa_OL_DECOR_PIN; Atom xa_OL_DECOR_ADD; Atom xa_OL_DECOR_DEL; Atom xa_OL_WT_BASE; Atom xa_OL_WT_COMMAND; Atom xa_OL_WT_HELP; Atom xa_OL_WT_NOTICE; Atom xa_OL_WT_OTHER; Atom xa_OL_PIN_IN; Atom xa_OL_PIN_OUT; Atom xa_OL_MENU_LIMITED; Atom xa_OL_MENU_FULL; #endif /* NO_OL_COMPAT */ /* mwm specific appearance and behavior resources and data: */ Boolean autoKeyFocus; /* resource */ int autoRaiseDelay; /* resource */ String bitmapDirectory; /* resource */ #ifdef WSM String backdropDirs; /* resource */ #endif /* WSM */ Boolean clientAutoPlace; /* resource */ int colormapFocusPolicy; /* resource */ String configFile; /* resource */ #ifdef WSM String cppCommand; /* resource */ #endif /* WSM */ Boolean deiconifyKeyFocus; /* resource */ int doubleClickTime; /* resource */ Boolean enableWarp; /* resource */ Boolean enforceKeyFocus; /* resource */ Boolean freezeOnConfig; /* resource - testing */ #ifdef WSM Boolean useWindowOutline; /* resource */ #endif /* WSM */ Boolean iconAutoPlace; /* resource */ Boolean iconClick; /* resource */ Boolean interactivePlacement; /* resource */ int keyboardFocusPolicy; /* resource */ Boolean lowerOnIconify; /* resource */ int moveThreshold; /* resource */ Boolean passButtonsCheck; /* used to override passButtons */ Boolean passButtons; /* resource */ Boolean passSelectButton; /* resource */ Boolean positionIsFrame; /* resource */ Boolean positionOnScreen; /* resource */ int quitTimeout; /* resource */ Boolean raiseKeyFocus; /* resource */ Boolean multiScreen; /* resource */ String screenList; /* resource */ int showFeedback; /* resource */ #ifdef WSM Boolean refreshByClearing; /* resource */ Boolean rootButtonClick; /* resource */ #endif /* WSM */ Boolean startupKeyFocus; /* resource */ Boolean systemButtonClick; /* resource */ Boolean systemButtonClick2; /* resource */ Boolean useLargeCursors; #if defined(PANELIST) Boolean useFrontPanel; /* resource */ #endif /* PANELIST */ #ifdef WSM String helpDirectory; /* resource */ Window requestContextWin; /* for WmRequest f.fcns */ #endif /* WSM */ #ifdef MINIMAL_DT Boolean dtLite; /* resource */ Boolean blinkOnExec; /* resource */ #endif /* MINIMAL_DT */ #ifdef PANELIST WmScreenData *dtSD; /* screen for front panel */ int iSlideUpsInProgress; #endif /*PANELIST */ Boolean waitForClicks; /* resource */ FrameStyle frameStyle; /* resource */ #ifdef WSM Dimension iconExternalShadowWidth; /* resource */ Dimension frameExternalShadowWidth; /* resource */ int marqueeSelectGranularity; /* resource */ XButtonEvent evLastButton; /* for detecting replayed button events */ Boolean bReplayedButton; /* true if button replayed */ Boolean bSuspendSecondaryRestack; /* overrides transient stacking */ #endif /* WSM */ XmString clientDefaultTitle; XmString iconDefaultTitle; Window attributesWindow; XWindowAttributes windowAttributes; #ifndef NO_SHAPE Boolean hasShape; /* server supports Shape extension */ int shapeEventBase, shapeErrorBase; #endif /* NO_SHAPE */ /* Need to replay enter notify events on windows with the pointer that used to be modalized. This is for pointer focus. */ int replayEnterEvent; XEnterWindowEvent savedEnterEvent; unsigned int lockingModMask; /* mask of locking modifier keys */ unsigned int *pLockMaskSequence; unsigned char tmpBuffer[MAXBUF]; /* replaces static buffers used */ /* for large return values */ int numMouseButtons; /* num of mouse buttons available */ unsigned int bMenuButton; /* BMenu binding (button/state) */ #if defined(sun) && defined(ALLPLANES) Bool allplanes; /* is SUN_ALLPLANES available? */ #endif /* defined(sun) && defined(ALLPLANES) */ } WmGlobalData; /* quick references to global data: */ #define DISPLAY wmGD.display #ifdef WSM #define DISPLAY1 wmGD.display1 #endif /* WSM */ #define ACTIVE_PSD (wmGD.pActiveSD) #define ACTIVE_SCREEN (wmGD.pActiveSD->screen) #define ACTIVE_WS (wmGD.pActiveSD->pActiveWS) #define ACTIVE_ROOT (wmGD.pActiveSD->rootWindow) #define ACTIVE_ICON_TEXT_WIN (wmGD.pActiveSD->activeIconTextWin) #define NOLOCKMOD(state) ((state) & ~wmGD.lockingModMask) #ifdef WSM /* absent map behavior policy values (absentMapBehavior): */ #define AMAP_BEHAVIOR_ADD 0 #define AMAP_BEHAVIOR_MOVE 1 #define AMAP_BEHAVIOR_IGNORE 2 #endif /* WSM */ /* colormap focus policy values (colormapFocus): */ #define CMAP_FOCUS_EXPLICIT 0 #define CMAP_FOCUS_POINTER 1 #define CMAP_FOCUS_KEYBOARD 2 /* keyboard input focus policy values (keyboardFocus): */ #define KEYBOARD_FOCUS_EXPLICIT 0 #define KEYBOARD_FOCUS_POINTER 1 /* icon appearance values (iconAppearance): */ #define ICON_LABEL_PART (1L << 0) #define ICON_IMAGE_PART (1L << 1) #define ICON_ACTIVE_LABEL_PART (1L << 2) #define USE_ICON_DEFAULT_APPEARANCE (1L << 3) #define ICON_APPEARANCE_STANDALONE (ICON_LABEL_PART | ICON_IMAGE_PART |\ ICON_ACTIVE_LABEL_PART) #define ICON_APPEARANCE_ICONBOX (ICON_LABEL_PART | ICON_IMAGE_PART) /* icon placement values (iconPlacement, ...): */ #define ICON_PLACE_LEFT_PRIMARY (1L << 0) #define ICON_PLACE_RIGHT_PRIMARY (1L << 1) #define ICON_PLACE_TOP_PRIMARY (1L << 2) #define ICON_PLACE_BOTTOM_PRIMARY (1L << 3) #define ICON_PLACE_LEFT_SECONDARY (1L << 4) #define ICON_PLACE_RIGHT_SECONDARY (1L << 5) #define ICON_PLACE_TOP_SECONDARY (1L << 6) #define ICON_PLACE_BOTTOM_SECONDARY (1L << 7) #define ICON_PLACE_EDGE (1L << 8) #define ICON_PLACE_TIGHT (1L << 9) #define ICON_PLACE_RESERVE (1L << 10) #define NO_ICON_PLACE -1 #define MINIMUM_ICON_SPACING 4 #define MAXIMUM_ICON_MARGIN 128 #define ICON_IMAGE_MAX_WIDTH 128 #define ICON_IMAGE_MAX_HEIGHT 128 #define ICON_IMAGE_MIN_WIDTH 16 #define ICON_IMAGE_MIN_HEIGHT 16 /*default client window title: */ #define DEFAULT_CLIENT_TITLE "*****" #define DEFAULT_ICON_TITLE DEFAULT_CLIENT_TITLE /* client decoration parameters */ #define MAXIMUM_FRAME_BORDER_WIDTH 64 /* configuration action (configAction): */ #define NO_ACTION 0 #define MOVE_CLIENT 1 #define RESIZE_CLIENT 2 #define PLACE_CLIENT 3 #ifdef WSM #define MARQUEE_SELECT 4 #endif /* WSM */ /* Motif input bindings file name */ #define MOTIF_BINDINGS_FILE ".motifbind" /* Data type definitions */ #define GLOBAL_DATA_TYPE 1001 #define CLIENT_DATA_TYPE 1002 #define SCREEN_DATA_TYPE 1003 #define WORKSPACE_DATA_TYPE 1004 #ifndef NO_MESSAGE_CATALOG /*************************************<->************************************* * * NlsStrings * * * Description: * ----------- * This structure is used to hold message strings that used to * be defines * *************************************<->***********************************/ typedef struct _NlsStrings { char *default_icon_box_title; char *builtinSystemMenu; char *defaultKeyBindings; char *builtinKeyBindings; char *defaultButtonBindings; char *defaultVersionTitle; char *defaultDtwmHelpTitle; char *defaultHelpTitle; } NlsStrings; extern NlsStrings wmNLS; #endif /* Stacking functions */ #define STACK_NORMAL 0 #define STACK_WITHIN_FAMILY 1 #define STACK_FREE_FAMILY 2 /* UsePPosition values */ #define USE_PPOSITION_OFF 0 #define USE_PPOSITION_ON 1 #define USE_PPOSITION_NONZERO 2 /* Largest dimension for special casing */ #define BIGSIZE 32767 /* * External references for global data: */ extern WmGlobalData wmGD; extern char defaultSystemMenuName[]; extern char defaultKeyBindings[]; extern char defaultKeyBindingsName[]; #ifndef NO_MESSAGE_CATALOG extern char *builtinSystemMenu; #else extern char builtinSystemMenu[]; #endif extern char builtinKeyBindings[]; extern Const char _75_foreground[]; extern Const char _50_foreground[]; extern Const char _25_foreground[]; extern char *_DtGetMessage(char *filename, int set, int n, char *s); /* * macro to get message catalog strings */ #ifndef NO_MESSAGE_CATALOG # ifdef __ultrix # define _CLIENT_CAT_NAME "dtwm.cat" # else /* __ultrix */ # define _CLIENT_CAT_NAME "dtwm" # endif /* __ultrix */ # ifdef WSM # define GETMESSAGE(set, number, string)\ _DtGetMessage(_CLIENT_CAT_NAME, set, number, string) # else # define GETMESSAGE(set, number, string) (string) # endif /* WSM */ #else # define GETMESSAGE(set, number, string)\ string #endif #endif /* _WmGlobal_h */ motif-2.3.8/clients/mwm/WmResNames.h0000644000175000017500000004236413145162623014232 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ /* * Included Files: */ /* * Value definitions: */ /******************************<->************************************* * * Window manager resource names ... * * * Description: * ----------- * ******************************<->***********************************/ /* mwm specific appearance and behavior resources: */ #ifdef WSM #define WmNall "all" #endif /* WSM */ #define WmNautoKeyFocus "autoKeyFocus" #define WmNautoRaiseDelay "autoRaiseDelay" #ifdef WSM #define WmNbackdropDirectories "backdropDirectories" #endif /* WSM */ #define WmNbitmapDirectory "bitmapDirectory" #ifdef MINIMAL_DT #define WmNblinkOnExec "blinkOnExec" #endif /* MINIMAL_DT */ #define WmNbuttonBindings "buttonBindings" #define WmNcleanText "cleanText" #define WmNclientAutoPlace "clientAutoPlace" #define WmNcolormapFocusPolicy "colormapFocusPolicy" #define WmNconfigFile "configFile" #ifdef WSM #define WmNcppCommand "cppCommand" #endif /* WSM */ #define WmNdeiconifyKeyFocus "deiconifyKeyFocus" #define WmNdoubleClickTime "doubleClickTime" #define WmNenableWarp "enableWarp" #define WmNenforceKeyFocus "enforceKeyFocus" #define WmNfadeNormalIcon "fadeNormalIcon" #define WmNfeedbackGeometry "feedbackGeometry" #define WmNframeBorderWidth "frameBorderWidth" #ifdef WSM #define WmNframeExternalShadowWidth "frameExternalShadowWidth" #endif /* WSM */ #define WmNfreezeOnConfig "freezeOnConfig" #ifdef WSM #define WmNgeometry "geometry" #endif /* WSM */ #define WmNiconAutoPlace "iconAutoPlace" #define WmNiconBoxGeometry "iconBoxGeometry" #define WmNiconBoxLayout "iconBoxLayout" #define WmNiconBoxName "iconBoxName" #define WmNiconBoxSBDisplayPolicy "iconBoxSBDisplayPolicy" #define WmNiconBoxScheme "iconBoxScheme" #define WmNiconBoxTitle "iconBoxTitle" #define WmNiconClick "iconClick" #define WmNiconDecoration "iconDecoration" #ifdef WSM #define WmNiconExternalShadowWidth "iconExternalShadowWidth" #endif /* WSM */ #define WmNiconImageMaximum "iconImageMaximum" #define WmNiconImageMinimum "iconImageMinimum" #define WmNiconPlacement "iconPlacement" #define WmNiconPlacementMargin "iconPlacementMargin" #ifdef WSM #define WmNimage "image" #define WmNimageBackground "imageBackground" #define WmNimageForeground "imageForeground" #endif /* WSM */ #define WmNinteractivePlacement "interactivePlacement" #define WmNkeyBindings "keyBindings" #define WmNkeyboardFocusPolicy "keyboardFocusPolicy" #define WmNlimitResize "limitResize" #define WmNlowerOnIconify "lowerOnIconify" #ifdef WSM #define WmNmarqueeSelectGranularity "marqueeSelectGranularity" #endif /* WSM */ #define WmNmaximumMaximumSize "maximumMaximumSize" #define WmNmoveThreshold "moveThreshold" #define WmNmultiScreen "multiScreen" #define WmNpassButtons "passButtons" #define WmNpassSelectButton "passSelectButton" #define WmNpositionIsFrame "positionIsFrame" #define WmNpositionOnScreen "positionOnScreen" #define WmNquitTimeout "quitTimeout" #define WmNraiseKeyFocus "raiseKeyFocus" #ifdef WSM #define WmNrefreshByClearing "refreshByClearing" #endif #define WmNresizeBorderWidth "resizeBorderWidth" #define WmNresizeCursors "resizeCursors" #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define WmNrootMenu "rootMenu" #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #ifdef WSM #define WmNrootButtonClick "rootButtonClick" #define WmNsecondariesOnTop "secondariesOnTop" #define WmNsessionVersion "sessionVersion" #endif /* WSM */ #ifndef WSM #define WmNsessionClientDB "sessionClientDB" #endif /* ! WSM */ #define WmNshowFeedback "showFeedback" #ifdef WSM #define WmNshowNames "showNames" #endif /* WSM */ #define WmNstartupKeyFocus "startupKeyFocus" #ifdef PANELIST #define WmNsubpanelDecoration "subpanelDecoration" #define WmNsubpanelResources "subpanelResources" #endif /* PANELIST */ #define WmNsystemButtonClick "wMenuButtonClick" #define WmNsystemButtonClick2 "wMenuButtonClick2" #define WmNtransientDecoration "transientDecoration" #define WmNtransientFunctions "transientFunctions" #ifdef PANELIST #define WmNuseFrontPanel "useFrontPanel" #endif /* PANELIST */ #define WmNuseIconBox "useIconBox" #ifdef WSM #define WmNuseWindowOutline "useWindowOutline" #endif /* WSM */ #ifdef MINIMAL_DT #define WmNdtLite "useDtLite" #endif /* MINIMAL_DT */ #define WmNmoveOpaque "moveOpaque" #define WmNframeStyle "frameStyle" /* conponent appearance resources: */ #define WmNactiveBackground "activeBackground" #define WmNactiveBackgroundPixmap "activeBackgroundPixmap" #define WmNactiveBottomShadowColor "activeBottomShadowColor" #define WmNactiveBottomShadowPixmap "activeBottomShadowPixmap" #define WmNactiveForeground "activeForeground" #define WmNactiveTopShadowColor "activeTopShadowColor" #define WmNactiveTopShadowPixmap "activeTopShadowPixmap" #define WmNbackground "background" #define WmNbackgroundPixmap "backgroundPixmap" #define WmNbottomShadowColor "bottomShadowColor" #define WmNbottomShadowPixmap "bottomShadowPixmap" #define WmNfont "font" #define WmNforeground "foreground" #define WmNsaveUnder "saveUnder" #define WmNtopShadowColor "topShadowColor" #define WmNtopShadowPixmap "topShadowPixmap" /* mwm - client specific resources: */ #ifdef WSM #define WmNabsentMapBehavior "absentMapBehavior" #endif /* WSM */ #define WmNclientDecoration "clientDecoration" #define WmNclientFunctions "clientFunctions" #define WmNfocusAutoRaise "focusAutoRaise" #ifdef WSM #define WmNhelpResources "helpResources" #endif /* WSM */ #define WmNiconImage "iconImage" #define WmNiconImageBackground "iconImageBackground" #define WmNiconImageBottomShadowColor "iconImageBottomShadowColor" #define WmNiconImageBottomShadowPixmap "iconImageBottomShadowPixmap" #define WmNiconImageForeground "iconImageForeground" #define WmNiconImageTopShadowColor "iconImageTopShadowColor" #define WmNiconImageTopShadowPixmap "iconImageTopShadowPixmap" #define WmNignoreWMSaveHints "ignoreWMSaveHints" #ifdef WSM #define WmNinitialWorkspace "initialWorkspace" #endif /* WSM */ #define WmNmatteBackground "matteBackground" #define WmNmatteBottomShadowColor "matteBottomShadowColor" #define WmNmatteBottomShadowPixmap "matteBottomShadowPixmap" #define WmNmatteForeground "matteForeground" #define WmNmatteTopShadowColor "matteTopShadowColor" #define WmNmatteTopShadowPixmap "matteTopShadowPixmap" #define WmNmatteWidth "matteWidth" #define WmNmaximumClientSize "maximumClientSize" #define WmNscreenList "screenList" #define WmNscreens "screens" #define WmNsystemMenu "windowMenu" #define WmNuseClientIcon "useClientIcon" #define WmNusePPosition "usePPosition" #ifdef WSM #define WmNworkspaceList "workspaceList" #define WmNworkspaceCount "workspaceCount" #endif /* WSM */ /* window manager part resource names: */ #define WmNclient "client" #define WmNfeedback "feedback" #define WmNicon "icon" #define WmNmenu "menu" #define WmNtitle "title" #define WmNdefaults "defaults" #ifdef WSM #define WmNbackdrop "backdrop" #define WmNcolorSetId "colorSetId" #define WmNfrontPanel "frontPanel" #define WmNworkspaceController "workspaceController" #define WmNworkspacePresence "workspacePresence" #define WmNworkspaceSwitch "workspaceSwitch" #endif /* WSM */ /* window manager client resource names: */ #define WmNiconBox "iconbox" #define WmNconfirmbox "confirmbox" #ifdef WSM #define WmNswitcher "switcher" #endif /* WSM */ /*************************************<->************************************* * * Window manager resource classes ... * * * Description: * ----------- * *************************************<->***********************************/ /* mwm specific appearance and behavior resources: */ #define WmCAutoKeyFocus "AutoKeyFocus" #define WmCAutoRaiseDelay "AutoRaiseDelay" #ifdef WSM #define WmCBackdropDirectories "BackdropDirectories" #endif /* WSM */ #define WmCBitmapDirectory "BitmapDirectory" #ifdef MINIMAL_DT #define WmCBlinkOnExec "BlinkOnExec" #endif /* MINIMAL_DT */ #define WmCButtonBindings "ButtonBindings" #define WmCCleanText "CleanText" #define WmCClientAutoPlace "ClientAutoPlace" #define WmCColormapFocusPolicy "ColormapFocusPolicy" #define WmCConfigFile "ConfigFile" #ifdef WSM #define WmCCppCommand "CppCommand" #endif /* WSM */ #define WmCDeiconifyKeyFocus "DeiconifyKeyFocus" #define WmCDoubleClickTime "DoubleClickTime" #define WmCEnableWarp "EnableWarp" #define WmCEnforceKeyFocus "EnforceKeyFocus" #define WmCFadeNormalIcon "FadeNormalIcon" #define WmCFeedbackGeometry "FeedbackGeometry" #define WmCFrameBorderWidth "FrameBorderWidth" #ifdef WSM #define WmCFrameExternalShadowWidth "FrameExternalShadowWidth" #endif /* WSM */ #define WmCFreezeOnConfig "FreezeOnConfig" #ifdef WSM #define WmCGeometry "Geometry" #endif /* WSM */ #define WmCIconAutoPlace "IconAutoPlace" #define WmCIconBoxGeometry "IconBoxGeometry" #define WmCIconBoxLayout "IconBoxLayout" #define WmCIconBoxName "IconBoxName" #define WmCIconBoxSBDisplayPolicy "IconBoxSBDisplayPolicy" #define WmCIconBoxScheme "IconBoxScheme" #define WmCIconBoxTitle "IconBoxTitle" #define WmCIconClick "IconClick" #define WmCIconDecoration "IconDecoration" #ifdef WSM #define WmCIconExternalShadowWidth "IconExternalShadowWidth" #endif /* WSM */ #define WmCIconImageMaximum "IconImageMaximum" #define WmCIconImageMinimum "IconImageMinimum" #define WmCIconPlacement "IconPlacement" #define WmCIconPlacementMargin "IconPlacementMargin" #ifdef WSM #define WmCImage "Image" #define WmCImageBackground "ImageBackground" #define WmCImageForeground "ImageForeground" #endif /* WSM */ #define WmCInteractivePlacement "InteractivePlacement" #define WmCKeyBindings "KeyBindings" #define WmCKeyboardFocusPolicy "KeyboardFocusPolicy" #define WmCLimitResize "LimitResize" #define WmCLowerOnIconify "LowerOnIconify" #ifdef WSM #define WmCMarqueeSelectGranularity "MarqueeSelectGranularity" #endif /* WSM */ #define WmCMaximumMaximumSize "MaximumMaximumSize" #define WmCMoveThreshold "MoveThreshold" #define WmCMultiScreen "MultiScreen" #define WmCPassButtons "PassButtons" #define WmCPassSelectButton "PassSelectButton" #define WmCPositionIsFrame "PositionIsFrame" #define WmCPositionOnScreen "PositionOnScreen" #define WmCQuitTimeout "QuitTimeout" #define WmCRaiseKeyFocus "RaiseKeyFocus" #ifdef WSM #define WmCRefreshByClearing "RefreshByClearing" #endif #define WmCResizeBorderWidth "ResizeBorderWidth" #define WmCResizeCursors "ResizeCursors" #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define WmCRootMenu "RootMenu" #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #ifdef WSM #define WmCRootButtonClick "RootButtonClick" #define WmCSecondariesOnTop "SecondariesOnTop" #define WmCSessionVersion "SessionVersion" #endif /* WSM */ #ifndef WSM #define WmCSessionClientDB "SessionClientDB" #endif /* ! WSM */ #define WmCScreenList "ScreenList" #define WmCScreens "Screens" #define WmCShowFeedback "ShowFeedback" #ifdef WSM #define WmCShowNames "ShowNames" #endif /* WSM */ #define WmCStartupKeyFocus "StartupKeyFocus" #ifdef PANELIST #define WmCSubpanelDecoration "SubpanelDecoration" #define WmCSubpanelResources "SubpanelResources" #endif /* PANELIST */ #define WmCSystemButtonClick "WMenuButtonClick" #define WmCSystemButtonClick2 "WMenuButtonClick2" #define WmCTransientDecoration "TransientDecoration" #define WmCTransientFunctions "TransientFunctions" #ifdef PANELIST #define WmCUseFrontPanel "UseFrontPanel" #endif /* PANELIST */ #define WmCUseIconBox "UseIconBox" #ifdef WSM #define WmCUseWindowOutline "UseWindowOutline" #endif /* WSM */ #ifdef MINIMAL_DT #define WmCDtLite "UseDtLite" #endif /* MINIMAL_DT */ #define WmCMoveOpaque "MoveOpaque" #define WmCFrameStyle "FrameStyle" #ifdef WSM #define WmCWorkspaceList "WorkspaceList" #define WmCWorkspaceCount "WorkspaceCount" #endif /* WSM */ /* component appearance resources: */ #define WmCActiveBackground "ActiveBackground" #define WmCActiveBackgroundPixmap "ActiveBackgroundPixmap" #define WmCActiveBottomShadowColor "ActiveBottomShadowColor" #define WmCActiveBottomShadowPixmap "ActiveBottomShadowPixmap" #define WmCActiveForeground "ActiveForeground" #define WmCActiveTopShadowColor "ActiveTopShadowColor" #define WmCActiveTopShadowPixmap "ActiveTopShadowPixmap" #define WmCBackground "Background" #define WmCBackgroundPixmap "BackgroundPixmap" #define WmCBottomShadowColor "BottomShadowColor" #define WmCBottomShadowPixmap "BottomShadowPixmap" #define WmCFont "Font" #define WmCForeground "Foreground" #define WmCSaveUnder "SaveUnder" #define WmCTopShadowColor "TopShadowColor" #define WmCTopShadowPixmap "TopShadowPixmap" /* mwm - client specific resources: */ #ifdef WSM #define WmCAbsentMapBehavior "AbsentMapBehavior" #endif /* WSM */ #define WmCClientDecoration "ClientDecoration" #define WmCClientFunctions "ClientFunctions" #define WmCFocusAutoRaise "FocusAutoRaise" #ifdef WSM #define WmCHelpResources "HelpResources" #endif /* WSM */ #define WmCIconImage "IconImage" #define WmCIconImageBackground "IconImageBackground" #define WmCIconImageBottomShadowColor "IconImageBottomShadowColor" #define WmCIconImageBottomShadowPixmap "IconImageBottomShadowPixmap" #define WmCIconImageForeground "IconImageForeground" #define WmCIconImageTopShadowColor "IconImageTopShadowColor" #define WmCIconImageTopShadowPixmap "IconImageTopShadowPixmap" #define WmCIgnoreWMSaveHints "IgnoreWMSaveHints" #ifdef WSM #define WmCInitialWorkspace "InitialWorkspace" #endif /* WSM */ #define WmCMatteBackground "MatteBackground" #define WmCMatteBottomShadowColor "MatteBottomShadowColor" #define WmCMatteBottomShadowPixmap "MatteBottomShadowPixmap" #define WmCMatteForeground "MatteForeground" #define WmCMatteTopShadowColor "MatteTopShadowColor" #define WmCMatteTopShadowPixmap "MatteTopShadowPixmap" #define WmCMatteWidth "MatteWidth" #define WmCMaximumClientSize "MaximumClientSize" #define WmCSystemMenu "WindowMenu" #define WmCUseClientIcon "UseClientIcon" #define WmCUsePPosition "UsePPosition" /* window manager part resource names: */ #define WmCClient "Client" #define WmCFeedback "Feedback" #define WmCIcon "Icon" #define WmCMenu "Menu" #define WmCTitle "Title" #define WmCDefaults "Defaults" #ifdef WSM #define WmCBackdrop "Backdrop" #define WmCColorSetId "ColorSetId" #define WmCFrontPanel "FrontPanel" #define WmCWorkspaceController "WorkspaceController" #define WmCWorkspacePresence "WorkspacePresence" #define WmCWorkspaceSwitch "WorkspaceSwitch" #endif /* WSM */ /* window manager client resource names: */ #define WmCIconBox "Iconbox" #define WmCConfirmbox "Confirmbox" #ifdef WSM #define WmCSwitcher "Switcher" #endif /* WSM */ /*************************************<->************************************* * * Window manager resource converter names ... * * * Description: * ----------- * *************************************<->***********************************/ #ifdef WSM #define WmRAbsentMapBehavior "WmAMBehavior" #endif /* WSM */ #define WmRCFocusPolicy "WmCFocus" #define WmRClientDecor "WmCDecor" #define WmRClientFunction "WmCFunc" #define WmRFrameStyle "WmFrameStyle" #define WmRIconBoxLayout "WmIBLayout" #define WmRIconDecor "WmIDecor" #define WmRIconPlacement "WmIPlace" #define WmRKFocusPolicy "WmKFocus" #define WmRSize "WmSize" #define WmRShowFeedback "WmShowFeedback" #define WmRUsePPosition "WmUsePPosition" /*************************************<->************************************* * * Window manager resource set definitions and default resource values ... * * * Description: * ----------- * *************************************<->***********************************/ /*************************************<->************************************* * * Mwm resource description file definitions ... * * * Description: * ----------- * *************************************<->***********************************/ /* Configuration resource types: */ #define CRS_BUTTON (1L << 0) #define CRS_KEY (1L << 1) #define CRS_MENU (1L << 2) #define CRS_ACCEL (1L << 3) #define CRS_ANY (CRS_BUTTON | CRS_KEY | CRS_MENU | CRS_ACCEL) #ifdef PANELIST #define WmNhelpDirectory "helpDirectory" #define WmCHelpDirectory "HelpDirectory" #endif /* PANELIST */ #ifdef WSM /************************** eof ************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/WmWsm.c0000644000175000017500000000363613145162623013255 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include "WmGlobal.h" #include "WmWsmLib/wsm_proto.h" /*------------------------------------------------------------------* | GetPCD | *------------------------------------------------------------------*/ /*ARGSUSED*/ ClientData * GetPCD ( int scr, /* unused */ Window win) { ClientData *pCD = NULL; Window root, parent, *children; unsigned int nchildren; if (XQueryTree(DISPLAY, win & WIN_MASK, &root, &parent, &children, &nchildren)) if (XFindContext (DISPLAY, parent, wmGD.windowContextType, (XPointer *)&pCD)) { Boolean foundIt = False; while ((parent != root) && (!foundIt)) { win = parent; if (!XQueryTree(DISPLAY, win, &root, &parent, &children, &nchildren)) break; foundIt = (XFindContext (DISPLAY, parent, wmGD.windowContextType, (XPointer *)&pCD) == 0); } if (!foundIt) pCD = NULL; } return (pCD); } motif-2.3.8/clients/mwm/WmBitmap.h0000644000175000017500000001407013145162623013722 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ /* * Global Variables And Definitions: */ /* * Define HOURGLASS cursor */ #ifdef LARGECURSORS #ifdef INTEGRATION_TESTING #include "integCursor.h" #endif /* INTEGRATION_TESTING */ #define time32_width 32 #define time32_height 32 #define time32_x_hot 15 #define time32_y_hot 15 static unsigned char time32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0x8c, 0x00, 0x00, 0x31, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x8c, 0x00, 0x00, 0x31, 0x0c, 0x7f, 0xfe, 0x30, 0x0c, 0xfe, 0x7f, 0x30, 0x0c, 0xfc, 0x3f, 0x30, 0x0c, 0xf8, 0x1f, 0x30, 0x0c, 0xe0, 0x07, 0x30, 0x0c, 0x80, 0x01, 0x30, 0x0c, 0x80, 0x01, 0x30, 0x0c, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x30, 0x0c, 0x04, 0x20, 0x30, 0x0c, 0x02, 0x40, 0x30, 0x0c, 0x01, 0x80, 0x30, 0x8c, 0x00, 0x00, 0x31, 0x4c, 0x80, 0x01, 0x32, 0x4c, 0xc0, 0x03, 0x32, 0x4c, 0xf0, 0x1f, 0x32, 0x4c, 0xff, 0xff, 0x32, 0xcc, 0xff, 0xff, 0x33, 0x8c, 0xff, 0xff, 0x31, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; #define time32m_width 32 #define time32m_height 32 static unsigned char time32m_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0x00, 0x00, 0xf3, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0xce, 0x00, 0x00, 0x73, 0x8e, 0x7f, 0xfe, 0x71, 0x0e, 0xff, 0xff, 0x70, 0x0e, 0xfe, 0x7f, 0x70, 0x0e, 0xfc, 0x3f, 0x70, 0x0e, 0xf8, 0x1f, 0x70, 0x0e, 0xe0, 0x07, 0x70, 0x0e, 0xe0, 0x07, 0x70, 0x0e, 0x78, 0x1e, 0x70, 0x0e, 0x1c, 0x38, 0x70, 0x0e, 0x06, 0x60, 0x70, 0x0e, 0x03, 0xc0, 0x70, 0x8e, 0x01, 0x80, 0x71, 0xce, 0x00, 0x00, 0x73, 0x6e, 0x80, 0x01, 0x76, 0x6e, 0xc0, 0x03, 0x76, 0x6e, 0xf0, 0x1f, 0x76, 0x6e, 0xff, 0xff, 0x76, 0xee, 0xff, 0xff, 0x77, 0xcf, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #endif /* LARGECURSORS */ #ifdef MWM_NEED_TIME16 #define time16_x_hot 7 #define time16_y_hot 7 #define time16_width 16 #define time16_height 16 static unsigned char time16_bits[] = { 0x00, 0x00, 0xfe, 0x7f, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x24, 0x24, 0x44, 0x22, 0x84, 0x21, 0x84, 0x21, 0x44, 0x22, 0x24, 0x24, 0x14, 0x28, 0x94, 0x29, 0xd4, 0x2b, 0xfe, 0x7f, 0x00, 0x00}; #define time16m_width 16 #define time16m_height 16 static unsigned char time16m_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff}; #endif /* MWM_NEED_TIME16 */ /* * Define DO NOT ENTER cursor */ #ifdef LARGECURSORS #define noenter32_width 32 #define noenter32_height 32 #define noenter32_x_hot 15 #define noenter32_y_hot 15 static unsigned char noenter32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00}; static unsigned char noenter32m_bits[] = { 0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0x07, 0x00}; #endif /* LARGECURSORS */ #ifdef MWM_NEED_NOENTER16 #define noenter16_width 16 #define noenter16_height 16 #define noenter16_x_hot 7 #define noenter16_y_hot 7 static unsigned char noenter16_bits[] = { 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0xfe, 0x7f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03, 0x00, 0x00}; static unsigned char noenter16m_bits[] = { 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03}; #endif /* MWM_NEED_NOENTER16 */ motif-2.3.8/clients/mwm/WmIPlace.h0000644000175000017500000000254513145162623013647 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void InitIconPlacement (WmWorkspaceData *pWS); extern int GetNextIconPlace (IconPlacementData *pIPD); extern void CvtIconPlaceToPosition (IconPlacementData *pIPD, int place, int *pX, int *pY); extern int FindIconPlace (ClientData *pCD, IconPlacementData *pIPD, int x, int y); extern int CvtIconPositionToPlace (IconPlacementData *pIPD, int x, int y); extern void PackRootIcons (void); extern void MoveIconInfo (IconPlacementData *pIPD, int p1, int p2); motif-2.3.8/clients/mwm/WmResCvt.c0000644000175000017500000011124713145162623013713 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmResCvt.c /main/4 1995/11/01 11:49:54 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmResNames.h" #include #include #ifndef NO_MULTIBYTE #include #endif #ifndef MOTIF_ONE_DOT_ONE #include #endif /* * include extern functions */ #include "WmResParse.h" /* * Function Declarations: */ unsigned char *NextToken (); long DecStrToL (); #include "WmResCvt.h" /*************************************<->************************************* * * AddWmResourceConverters (args) * * * Description: * ----------- * This function adds resource type converters for mwm specific resource * types to the X Toolkit collection. * * * Inputs: * ------ * XXinput = ... * * XXinput = ... * * * Outputs: * ------- * XXOutput = ... * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void AddWmResourceConverters (void) { #ifdef WSM XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRAbsentMapBehavior, (XtConverter)WmCvtStringToAMBehavior, NULL, 0); #endif /* WSM */ XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRCFocusPolicy, (XtConverter)WmCvtStringToCFocus, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRClientDecor, (XtConverter)WmCvtStringToCDecor, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRClientFunction, (XtConverter)WmCvtStringToCFunc, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRFrameStyle, (XtConverter)WmCvtStringToFrameStyle, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRIconDecor, (XtConverter)WmCvtStringToIDecor, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRIconPlacement, (XtConverter)WmCvtStringToIPlace, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRKFocusPolicy, (XtConverter)WmCvtStringToKFocus, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRSize, (XtConverter)WmCvtStringToSize, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRShowFeedback, (XtConverter)WmCvtStringToShowFeedback, NULL, 0); XtAppAddConverter (wmGD.mwmAppContext, XtRString, WmRUsePPosition, (XtConverter)WmCvtStringToUsePPosition, NULL, 0); } /* END OF FUNCTION AddWmResourceConverters */ #ifdef WSM /*************************************<->************************************* * * WmCvtStringToAMBehavior (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to an absent map behavior description. * * * Inputs: * ------ * args = additional XrmValue arguments to the converter - NULL here * * numArgs = number of XrmValue arguments - 0 here * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToAMBehavior (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; /* * Absent map behavior policies: */ #define AMAP_BEHAVIOR_ADD_STR (unsigned char *)"add" #define AMAP_BEHAVIOR_MOVE_STR (unsigned char *)"move" #define AMAP_BEHAVIOR_IGNORE_STR (unsigned char *)"ignore" /* * Convert the absent map behavior policy resource value: */ if (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'A') || (*pch == 'a')) { if (StringsAreEqual (pch, AMAP_BEHAVIOR_ADD_STR, len)) { cval = AMAP_BEHAVIOR_ADD; fHit = True; } } else if ((*pch == 'M') || (*pch == 'm')) { if (StringsAreEqual (pch, AMAP_BEHAVIOR_MOVE_STR, len)) { cval = AMAP_BEHAVIOR_MOVE; fHit = True; } } else if ((*pch == 'I') || (*pch == 'i')) { if (StringsAreEqual (pch, AMAP_BEHAVIOR_IGNORE_STR, len)) { cval = AMAP_BEHAVIOR_IGNORE; fHit = True; } } } if (!fHit) { cval = AMAP_BEHAVIOR_ADD; } (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t)&cval; } /* END OF FUNCTION WmCvtStringToAMBehavior */ #endif /* WSM */ /*************************************<->************************************* * * WmCvtStringToCFocus (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a colormap focus policy description. * * * Inputs: * ------ * args = additional XrmValue arguments to the converter - NULL here * * numArgs = number of XrmValue arguments - 0 here * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToCFocus (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; /* * Colormap focus policies: */ #define CMAP_FOCUS_EXPLICIT_STR (unsigned char *)"explicit" #define CMAP_FOCUS_KEYBOARD_STR (unsigned char *)"keyboard" #define CMAP_FOCUS_POINTER_STR (unsigned char *)"pointer" /* * Convert the colormap focus policy resource value: */ if (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'E') || (*pch == 'e')) { if (StringsAreEqual (pch, CMAP_FOCUS_EXPLICIT_STR, len)) { cval = CMAP_FOCUS_EXPLICIT; fHit = True; } } else if ((*pch == 'K') || (*pch == 'k')) { if (StringsAreEqual (pch, CMAP_FOCUS_KEYBOARD_STR, len)) { cval = CMAP_FOCUS_KEYBOARD; fHit = True; } } else if ((*pch == 'P') || (*pch == 'p')) { if (StringsAreEqual (pch, CMAP_FOCUS_POINTER_STR, len)) { cval = CMAP_FOCUS_POINTER; fHit = True; } } } if (!fHit) { cval = CMAP_FOCUS_KEYBOARD; } (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t)&cval; } /* END OF FUNCTION WmCvtStringToCFocus */ /*************************************<->************************************* * * WmCvtStringToCDecor (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a mwm client window frame decoration * description. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * * * Comments: * -------- * o Accepts the following syntax: * * CDecor ::= [sign] decor_spec [decor_spec ...] * * sign ::= ['+' | '-'] * * decor_spec ::= [sign] decor_name * * decor_name ::= "all" | "none" | "title" | "titlebar" | * "menu" | "minimize" | "maximize" | "resize" * *************************************<->***********************************/ void WmCvtStringToCDecor (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; Boolean fAddNext = True; /* * Client decoration parts: */ #define WM_DECOR_ALL_STR (unsigned char *)"all" #define WM_DECOR_NONE_STR (unsigned char *)"none" #define WM_DECOR_BORDER_STR (unsigned char *)"border" #define WM_DECOR_RESIZEH_STR (unsigned char *)"resizeh" #define WM_DECOR_TITLE_STR (unsigned char *)"title" #define WM_DECOR_TITLEBAR_STR (unsigned char *)"titlebar" #define WM_DECOR_MINIMIZE_STR (unsigned char *)"minimize" #define WM_DECOR_MAXIMIZE_STR (unsigned char *)"maximize" #define WM_DECOR_MENU_STR (unsigned char *)"menu" #define WM_DECOR_RESIZE_STR (unsigned char *)"resize" /* * Check first token. If '-' we subtract from all decoration. * Otherwise, we start with no decoration and add things in. */ if (*pch && (NextToken (pch, &len, &pchNext)) && (*pch == '-')) { cval = WM_DECOR_ALL; fHit = True; } else { cval = WM_DECOR_NONE; } while (*pch && NextToken(pch, &len, &pchNext)) { /* * Strip off "sign" if prepended to another token, and process * that token the next time through. */ if (*pch == '+') { if (len != 1) { pchNext = pch + 1; } fAddNext = TRUE; } else if (*pch == '-') { if (len != 1) { pchNext = pch + 1; } fAddNext = FALSE; } else if ((*pch == 'A') || (*pch == 'a')) { if (StringsAreEqual(pch, WM_DECOR_ALL_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_ALL) : (cval & ~WM_DECOR_ALL); fHit = True; } } else if ((*pch == 'N') || (*pch == 'n')) { if (StringsAreEqual(pch, WM_DECOR_NONE_STR,len)) { /* don't bother adding or subtracting nothing */ fHit = True; } } else if ((*pch == 'T') || (*pch == 't')) { if (StringsAreEqual(pch, WM_DECOR_TITLE_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_TITLE) : (cval & ~WM_DECOR_TITLEBAR); fHit = True; } else if (StringsAreEqual(pch, WM_DECOR_TITLEBAR_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_TITLEBAR) : (cval & ~WM_DECOR_TITLEBAR); fHit = True; } } else if ((*pch == 'M') || (*pch == 'm')) { if (StringsAreEqual(pch, WM_DECOR_MINIMIZE_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_MINIMIZE) : (cval & ~MWM_DECOR_MINIMIZE); fHit = True; } else if (StringsAreEqual(pch, WM_DECOR_MAXIMIZE_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_MAXIMIZE) : (cval & ~MWM_DECOR_MAXIMIZE); fHit = True; } else if (StringsAreEqual(pch, WM_DECOR_MENU_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_SYSTEM) : (cval & ~MWM_DECOR_MENU); fHit = True; } } else if ((*pch == 'R') || (*pch == 'r')) { if (StringsAreEqual(pch, WM_DECOR_RESIZE_STR,len) || StringsAreEqual(pch, WM_DECOR_RESIZEH_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_RESIZEH) : (cval & ~MWM_DECOR_RESIZEH); fHit = True; } } else if ((*pch == 'B') || (*pch == 'b')) { if (StringsAreEqual(pch, WM_DECOR_BORDER_STR,len)) { cval = fAddNext ? (cval | WM_DECOR_BORDER) : (cval & ~WM_DECOR_BORDER); fHit = True; } } pch = pchNext; } if (!fHit) cval = WM_DECOR_ALL; (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t) &cval; } /* END OF FUNCTION WmCvtStringToCDecor */ /*************************************<->************************************* * * WmCvtStringToCFunc (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a mwm client-applicable function * description. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * * * Comments: * -------- * o Accepts the following syntax: * * CFunc ::= [sign] func_spec [func_spec ...] * * sign ::= ['+' | '-'] * * func_spec ::= [sign] func_name * * func_name ::= "all" | "none" | "resize" | "move" | "minimize" | * "maximize" | "close" * *************************************<->***********************************/ void WmCvtStringToCFunc (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; Boolean fAddNext = True; /* * Client-applicable functions: */ #define WM_FUNC_ALL_STR (unsigned char *)"all" #define WM_FUNC_NONE_STR (unsigned char *)"none" #define WM_FUNC_RESIZE_STR (unsigned char *)"resize" #define WM_FUNC_MOVE_STR (unsigned char *)"move" #define WM_FUNC_MINIMIZE_STR (unsigned char *)"minimize" #define WM_FUNC_MAXIMIZE_STR (unsigned char *)"maximize" #define WM_FUNC_CLOSE_STR (unsigned char *)"close" /* * Check first token. If '-' we subtract from all functions. * Otherwise, we start with no functions and add things in. */ if (*pch && (NextToken (pch, &len, &pchNext)) && (*pch == '-')) { cval = WM_FUNC_ALL; fHit = True; } else { cval = WM_FUNC_NONE; } while (*pch && NextToken(pch, &len, &pchNext)) { /* * Strip off "sign" if prepended to another token, and process * that token the next time through. */ if (*pch == '+') { if (len != 1) { pchNext = pch + 1; } fAddNext = TRUE; } else if (*pch == '-') { if (len != 1) { pchNext = pch + 1; } fAddNext = FALSE; } else if ((*pch == 'A') || (*pch == 'a')) { if (StringsAreEqual(pch, WM_FUNC_ALL_STR,len)) { cval = fAddNext ? (cval | WM_FUNC_ALL) : (cval & ~WM_FUNC_ALL); fHit = True; } } else if ((*pch == 'N') || (*pch == 'n')) { if (StringsAreEqual(pch, WM_FUNC_NONE_STR,len)) { /* don't bother adding or subtracting nothing */ fHit = True; } } else if ((*pch == 'R') || (*pch == 'r')) { if (StringsAreEqual(pch, WM_FUNC_RESIZE_STR,len)) { cval = fAddNext ? (cval | MWM_FUNC_RESIZE) : (cval & ~MWM_FUNC_RESIZE); fHit = True; } } else if ((*pch == 'M') || (*pch == 'm')) { if (StringsAreEqual(pch, WM_FUNC_MINIMIZE_STR,len)) { cval = fAddNext ? (cval | MWM_FUNC_MINIMIZE) : (cval & ~MWM_FUNC_MINIMIZE); fHit = True; } else if (StringsAreEqual(pch, WM_FUNC_MAXIMIZE_STR,len)) { cval = fAddNext ? (cval | MWM_FUNC_MAXIMIZE) : (cval & ~MWM_FUNC_MAXIMIZE); fHit = True; } else if (StringsAreEqual(pch, WM_FUNC_MOVE_STR,len)) { cval = fAddNext ? (cval | MWM_FUNC_MOVE) : (cval & ~MWM_FUNC_MOVE); fHit = True; } } else if ((*pch == 'C') || (*pch == 'c')) { if (StringsAreEqual(pch, WM_FUNC_CLOSE_STR,len)) { cval = fAddNext ? (cval | MWM_FUNC_CLOSE) : (cval & ~MWM_FUNC_CLOSE); fHit = True; } } pch = pchNext; } if (!fHit) cval = WM_FUNC_ALL; (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t) &cval; } /* END OF FUNCTION WmCvtStringToCFunc */ /*************************************<->************************************* * * WmCvtStringToFrameStyle (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a frame style description. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToFrameStyle (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static FrameStyle frameStyle; Boolean fHit = False; #define FRAME_STYLE_RECESSED_STR (unsigned char *)"recessed" #define FRAME_STYLE_SLAB_STR (unsigned char *)"slab" /* * Convert the resource value: */ if (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'R') || (*pch == 'r')) { if (StringsAreEqual (pch, FRAME_STYLE_RECESSED_STR, len)) { frameStyle = WmRECESSED; fHit = True; } } else if (StringsAreEqual (pch, FRAME_STYLE_SLAB_STR, len)) { frameStyle = WmSLAB; fHit = True; } } if (!fHit) { frameStyle = WmRECESSED; } (*toVal).size = sizeof (FrameStyle); (*toVal).addr = (caddr_t)&frameStyle; } /* END OF FUNCTION WmCvtStringToFrameStyle */ /*************************************<->************************************* * * WmCvtStringToIDecor (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to an icon decoration description. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToIDecor (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; /* * Icon decoration parts: */ #define ICON_DECOR_IMAGE_STR (unsigned char *)"image" #define ICON_DECOR_LABEL_STR (unsigned char *)"label" #define ICON_DECOR_ACTIVE_LABEL_STR (unsigned char *)"activelabel" /* * Convert the icon decoration resource value: */ cval = 0; while (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'A') || (*pch == 'a')) { if (StringsAreEqual (pch, ICON_DECOR_ACTIVE_LABEL_STR, len)) { cval |= ICON_ACTIVE_LABEL_PART; fHit = True; } } else if ((*pch == 'I') || (*pch == 'i')) { if (StringsAreEqual (pch, ICON_DECOR_IMAGE_STR, len)) { cval |= ICON_IMAGE_PART; fHit = True; } } else if ((*pch == 'L') || (*pch == 'l')) { if (StringsAreEqual (pch, ICON_DECOR_LABEL_STR, len)) { cval |= ICON_LABEL_PART; fHit = True; } } pch = pchNext; } /* * If we didn't match anything or only have the active label * (which is just a modifier) then give 'em the whole ball of wax. */ if (!fHit || cval == ICON_ACTIVE_LABEL_PART) { cval = ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART; } (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t) &cval; } /* END OF FUNCTION WmCvtStringToIDecor */ /*************************************<->************************************* * * WmCvtStringToIPlace (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to an icon placement scheme description. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToIPlace (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fPrimarySet = False; Boolean fSecondarySet = False; /* * Icon placement layout values: */ #define ICON_PLACE_BOTTOM_STR (unsigned char *)"bottom" #define ICON_PLACE_LEFT_STR (unsigned char *)"left" #define ICON_PLACE_RIGHT_STR (unsigned char *)"right" #define ICON_PLACE_TOP_STR (unsigned char *)"top" #define ICON_PLACE_TIGHT_STR (unsigned char *)"tight" /* * Convert the icon placement resource value: */ cval = 0; while (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'B') || (*pch == 'b')) { if (StringsAreEqual (pch, ICON_PLACE_BOTTOM_STR, len)) { if (!fPrimarySet) { cval |= ICON_PLACE_BOTTOM_PRIMARY; fPrimarySet = True; } else if (!fSecondarySet) { if (!(cval & (ICON_PLACE_BOTTOM_PRIMARY | ICON_PLACE_TOP_PRIMARY))) { cval |= ICON_PLACE_BOTTOM_SECONDARY; fSecondarySet = True; } } } } else if ((*pch == 'L') || (*pch == 'l')) { if (StringsAreEqual (pch, ICON_PLACE_LEFT_STR, len)) { if (!fPrimarySet) { cval |= ICON_PLACE_LEFT_PRIMARY; fPrimarySet = True; } else if (!fSecondarySet) { if (!(cval & (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_RIGHT_PRIMARY))) { cval |= ICON_PLACE_LEFT_SECONDARY; fSecondarySet = True; } } } } else if ((*pch == 'R') || (*pch == 'r')) { if (StringsAreEqual (pch, ICON_PLACE_RIGHT_STR, len)) { if (!fPrimarySet) { cval |= ICON_PLACE_RIGHT_PRIMARY; fPrimarySet = True; } else if (!fSecondarySet) { if (!(cval & (ICON_PLACE_RIGHT_PRIMARY | ICON_PLACE_LEFT_PRIMARY))) { cval |= ICON_PLACE_RIGHT_SECONDARY; fSecondarySet = True; } } } } else if ((*pch == 'T') || (*pch == 't')) { if (StringsAreEqual (pch, ICON_PLACE_TOP_STR, len)) { if (!fPrimarySet) { cval |= ICON_PLACE_TOP_PRIMARY; fPrimarySet = True; } else if (!fSecondarySet) { if (!(cval & (ICON_PLACE_TOP_PRIMARY | ICON_PLACE_BOTTOM_PRIMARY))) { cval |= ICON_PLACE_TOP_SECONDARY; fSecondarySet = True; } } } else if (StringsAreEqual (pch, ICON_PLACE_TIGHT_STR, len)) { cval |= ICON_PLACE_TIGHT; } } pch = pchNext; } if (!fPrimarySet) { cval = ICON_PLACE_LEFT_PRIMARY; } if (!fSecondarySet) { if (cval & (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_RIGHT_PRIMARY)) { cval |= ICON_PLACE_BOTTOM_SECONDARY; } else { cval |= ICON_PLACE_LEFT_SECONDARY; } } (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t) &cval; } /* END OF FUNCTION WmCvtStringToIPlace */ /*************************************<->************************************* * * WmCvtStringToKFocus (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a keyboard focus policy description. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToKFocus (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; /* * Keyboard focus policies: */ #define KEYBOARD_FOCUS_EXPLICIT_STR (unsigned char *)"explicit" #define KEYBOARD_FOCUS_POINTER_STR (unsigned char *)"pointer" /* * Convert the keyboard focus policy resource value: */ if (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'E') || (*pch == 'e')) { if (StringsAreEqual (pch, KEYBOARD_FOCUS_EXPLICIT_STR, len)) { cval = KEYBOARD_FOCUS_EXPLICIT; fHit = True; } } else if ((*pch == 'P') || (*pch == 'p')) { if (StringsAreEqual (pch, KEYBOARD_FOCUS_POINTER_STR, len)) { cval = KEYBOARD_FOCUS_POINTER; fHit = True; } } } if (!fHit) { cval = KEYBOARD_FOCUS_EXPLICIT; } (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t)&cval; } /* END OF FUNCTION WmCvtStringToKFocus */ /*************************************<->************************************* * * WmCvtStringToSize (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a size description (x). * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToSize (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; static WHSize cval; int len; /* * Convenience values for WmSize: */ #define VERTICAL_STR (unsigned char *)"vertical" #define HORIZONTAL_STR (unsigned char *)"horizontal" /* * Convert the size resource value. The syntax is "[xX]" * OR it is the string 'vertical' or 'horizontal'. It's kinda neat that * BIGSIZE is a legal Dimension so that we get vertical and horizontal * for free. */ cval.width = 0; cval.height = 0; if (*pch) { cval.width = (int) DecStrToL (pch, &pchNext); if (!((cval.width == 0) && (pchNext == pch))) { /* * Width was converted. * Check for a delimiter (must be 'x' or 'X'): */ pch = pchNext; if (*pch && ((*pch == 'x') || (*pch == 'X'))) { /* * Delimiter found now get the height: */ pch++; cval.height = (int) DecStrToL (pch, &pchNext); } } else { if (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'V') || (*pch == 'v')) { if (StringsAreEqual (pch, VERTICAL_STR, len)) { cval.height = BIGSIZE; } } else if ((*pch == 'H') || (*pch == 'h')) { if (StringsAreEqual (pch, HORIZONTAL_STR, len)) { cval.width = BIGSIZE; } } } } } /* !!! check for the maximum maximum sizes !!! */ (*toVal).size = sizeof (WHSize); (*toVal).addr = (caddr_t)&cval; } /* END OF FUNCTION WmCvtStringToSize */ /*************************************<->************************************* * * WmCvtStringToShowFeedback (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a value for the showFeedback flag set. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToShowFeedback (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; Boolean fAddNext = True; /* * Names of feedback options */ #define SHOW_FB_ALL_STR (unsigned char *)"all" #define SHOW_FB_BEHAVIOR_STR (unsigned char *)"behavior" #define SHOW_FB_KILL_STR (unsigned char *)"kill" #define SHOW_FB_MOVE_STR (unsigned char *)"move" #define SHOW_FB_NONE_STR (unsigned char *)"none" #define SHOW_FB_PLACEMENT_STR (unsigned char *)"placement" #define SHOW_FB_QUIT_STR (unsigned char *)"quit" #define SHOW_FB_RESIZE_STR (unsigned char *)"resize" #define SHOW_FB_RESTART_STR (unsigned char *)"restart" /* * Check first token. If '-' we subtract from all functions. * Otherwise, we start with no functions and add things in. */ if (*pch && (NextToken (pch, &len, &pchNext)) && (*pch == '-')) { cval = WM_SHOW_FB_DEFAULT; fHit = True; } else { cval = WM_SHOW_FB_NONE; } /* * Convert the feedback option resource value: */ while (*pch && NextToken (pch, &len, &pchNext)) { /* * Strip off "sign" if prepended to another token, and process * that token the next time through. */ if (*pch == '+') { if (len != 1) { pchNext = pch + 1; } fAddNext = TRUE; } else if (*pch == '-') { if (len != 1) { pchNext = pch + 1; } fAddNext = FALSE; } if ((*pch == 'A') || (*pch == 'a')) { if (StringsAreEqual (pch, SHOW_FB_ALL_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_ALL) : (cval & ~WM_SHOW_FB_ALL); fHit = True; } } else if ((*pch == 'B') || (*pch == 'b')) { if (StringsAreEqual (pch, SHOW_FB_BEHAVIOR_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_BEHAVIOR) : (cval & ~WM_SHOW_FB_BEHAVIOR); fHit = True; } } else if ((*pch == 'K') || (*pch == 'k')) { if (StringsAreEqual (pch, SHOW_FB_KILL_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_KILL) : (cval & ~WM_SHOW_FB_KILL); fHit = True; } } else if ((*pch == 'M') || (*pch == 'm')) { if (StringsAreEqual (pch, SHOW_FB_MOVE_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_MOVE) : (cval & ~WM_SHOW_FB_MOVE); fHit = True; } } else if ((*pch == 'N') || (*pch == 'n')) { if (StringsAreEqual (pch, SHOW_FB_NONE_STR, len)) { /* don't bother adding or subtracting nothing */ fHit = True; } } else if ((*pch == 'P') || (*pch == 'p')) { if (StringsAreEqual (pch, SHOW_FB_PLACEMENT_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_PLACEMENT) : (cval & ~WM_SHOW_FB_PLACEMENT); fHit = True; } } else if ((*pch == 'Q') || (*pch == 'q')) { if (StringsAreEqual (pch, SHOW_FB_QUIT_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_QUIT) : (cval & ~WM_SHOW_FB_QUIT); fHit = True; } } else if ((*pch == 'R') || (*pch == 'r')) { if (StringsAreEqual (pch, SHOW_FB_RESIZE_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_RESIZE) : (cval & ~WM_SHOW_FB_RESIZE); fHit = True; } else if (StringsAreEqual (pch, SHOW_FB_RESTART_STR, len)) { cval = fAddNext ? (cval | WM_SHOW_FB_RESTART) : (cval & ~WM_SHOW_FB_RESTART); fHit = True; } } pch = pchNext; } /* * If we didn't match anything then set to default. */ if (!fHit) { cval = WM_SHOW_FB_DEFAULT; } (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t) &cval; } /* END OF FUNCTION WmCvtStringToShowFeedback */ /*************************************<->************************************* * * WmCvtStringToUsePPosition (args, numArgs, fromVal, toVal) * * * Description: * ----------- * This function converts a string to a keyboard focus policy description. * * * Inputs: * ------ * args = NULL (don't care) * * numArgs = 0 (don't care) * * fromVal = resource value to convert * * * Outputs: * ------- * toVal = descriptor to use to return converted value * *************************************<->***********************************/ void WmCvtStringToUsePPosition (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal) { unsigned char *pch = (unsigned char *) (fromVal->addr); unsigned char *pchNext; int len; static int cval; Boolean fHit = False; #define USE_PPOSITION_NONZERO_STR (unsigned char *)"nonzero" #define USE_PPOSITION_ON_STR (unsigned char *)"on" #define USE_PPOSITION_OFF_STR (unsigned char *)"off" /* * Convert the use PPosition resource value: */ if (*pch && NextToken (pch, &len, &pchNext)) { if ((*pch == 'N') || (*pch == 'n')) { if (StringsAreEqual (pch, USE_PPOSITION_NONZERO_STR, len)) { cval = USE_PPOSITION_NONZERO; fHit = True; } } else if (StringsAreEqual (pch, USE_PPOSITION_OFF_STR, len)) { cval = USE_PPOSITION_OFF; fHit = True; } else if (StringsAreEqual (pch, USE_PPOSITION_ON_STR, len)) { cval = USE_PPOSITION_ON; fHit = True; } } if (!fHit) { cval = USE_PPOSITION_NONZERO; } (*toVal).size = sizeof (int); (*toVal).addr = (caddr_t)&cval; } /* END OF FUNCTION WmCvtStringToUsePPosition */ /*************************************<->************************************* * * NextToken (pchIn, pLen, ppchNext) * * * Description: * ----------- * XXDescription ... * * * Inputs: * ------ * pchIn = pointer to start of next token * * * Outputs: * ------- * pLen = pointer to integer containing number of characters in next token * ppchNext = address of pointer to following token * * Return = next token or NULL * * * Comments: * -------- * None. * *************************************<->***********************************/ unsigned char *NextToken (unsigned char *pchIn, int *pLen, unsigned char **ppchNext) { unsigned char *pchR = pchIn; register int i; #ifndef NO_MULTIBYTE register int chlen; for (i = 0; ((chlen = mblen((char *)pchIn, MB_CUR_MAX)) > 0) && (pchIn[0] != '\0'); i++) /* find end of word: requires singlebyte whitespace terminator */ { if ((chlen == 1) && isspace (*pchIn)) { break; } pchIn += chlen; } #else for (i = 0; *pchIn && !isspace (*pchIn); i++, pchIn++) /* find end of word */ { } #endif /* skip to next word */ ScanWhitespace (&pchIn); *ppchNext = pchIn; *pLen = i; if (i) { return(pchR); } else { return(NULL); } } /* END OF FUNCTION NextToken */ /*************************************<->************************************* * * StringsAreEqual (pch1, pch2, len) * * * Description: * ----------- * XXDescription ... * * * Inputs: * ------ * pch1 = * pch2 = * len = * * * Outputs: * ------- * Return = (Boolean) True iff strings match (case insensitive) * * * Comments: * -------- * None. * *************************************<->***********************************/ Boolean StringsAreEqual (unsigned char *pch1, unsigned char *pch2, int len) { #ifndef NO_MULTIBYTE int chlen1; int chlen2; wchar_t wch1; wchar_t wch2; while (len && ((chlen1 = mbtowc (&wch1, (char *) pch1, MB_CUR_MAX)) > 0) && ((chlen2 = mbtowc (&wch2, (char *) pch2, MB_CUR_MAX)) == chlen1) ) { if (chlen1 == 1) /* singlebyte characters -- make case insensitive */ { if ((isupper (*pch1) ? tolower(*pch1) : *pch1) != (isupper (*pch2) ? tolower(*pch2) : *pch2)) { break; } } else /* multibyte characters */ { if (wch1 != wch2) { break; } } pch1 += chlen1; pch2 += chlen2; len--; } #else while (len && *pch1 && *pch2 && ((isupper (*pch1) ? tolower(*pch1++) : *pch1++) == (isupper (*pch2) ? tolower(*pch2++) : *pch2++))) { len--; } #endif return (len == 0); } /* END OF StringsAreEqual */ /*************************************<->************************************* * * long * DecStrToL (str, ptr) * * * Description: * ----------- * Converts a decimal string to a long. * * * Inputs: * ------ * str = character string * * * Outputs: * ------- * *ptr = pointer to character terminating str or str * Return = long value * * * Comments: * -------- * Leading whitespace is ignored. * Returns long value with *ptr pointing at character terminating the decimal * string. * Returns 0 with *ptr == str if no integer can be formed. * *************************************<->***********************************/ long DecStrToL (unsigned char *str, unsigned char **ptr) { long val = 0; *ptr = str; #ifndef NO_MULTIBYTE while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isspace (*str)) #else while (isspace (*str)) #endif /* Ignore leading whitespace */ { str++; } /* If we can start, we will reset *ptr */ #ifndef NO_MULTIBYTE if ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str)) { while ((mblen ((char *)str, MB_CUR_MAX) == 1) && isdigit (*str)) #else if (isdigit (*str)) { while (isdigit (*str)) #endif { val = val * 10 + (*str - '0'); str++; } *ptr = str; } return (val); } /* END OF FUNCTION DecStrToL */ motif-2.3.8/clients/mwm/WmMenu.h0000644000175000017500000000705713145162623013421 00000000000000#ifndef _WM_MENU_H #define _WM_MENU_H /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.2 */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define MAKE_MENU(pSD, pCD, mName, iC, aC, moreItems, sysMenu) \ MakeMenu(pSD, pCD, mName, iC, aC, moreItems, sysMenu) # define CREATE_MENU_WIDGET(pSD, pCD, mName, parent, fTLP, tSpec, moreItems) \ CreateMenuWidget(pSD, pCD, mName, parent, fTLP, tSpec, moreItems) #else # define MAKE_MENU(pSD, pCD, mName, iC, aC, moreItems, sysMenu) \ MakeMenu(pSD, mName, iC, aC, moreItems, sysMenu) # define CREATE_MENU_WIDGET(pSD, pCD, mName, parent, fTLP, tSpec, moreItems) \ CreateMenuWidget(pSD, mName, parent, fTLP, tSpec, moreItems) #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ extern void ActivateCallback (Widget w, caddr_t client_data, caddr_t call_data); extern Widget CreateMenuWidget (WmScreenData *pSD, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) ClientData *pCD, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ String menuName, Widget parent, Boolean fTopLevelPane, MenuSpec *topMenuSpec, MenuItem *moreMenuItems); extern void FreeCustomMenuSpec (MenuSpec *menuSpec); extern void MWarning (char *format, char *message); extern MenuSpec *MakeMenu (WmScreenData *pSD, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) ClientData *pCD, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ String menuName, Context initialContext, Context accelContext, MenuItem *moreMenuItems, Boolean fSystemMenu); extern void PostMenu (MenuSpec *menuSpec, ClientData *pCD, int x, int y, unsigned int button, Context newContext, long flags, XEvent *passedInEvent); extern void TraversalOff (MenuSpec *menuSpec); extern void TraversalOn (MenuSpec *menuSpec); extern void UnpostMenu (MenuSpec *menuSpec); #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) extern void InsertTreeOnAllClients (WmScreenData *pSD, CmdTree *tree, Atom selection, Context active_context, Boolean in_line); extern void InsertTreeOnSingleClient (WmScreenData *pSD, ClientData *pCD, CmdTree *tree, Atom selection, Context active_context, Boolean in_line); extern void InsertTreeOnRootMenu (WmScreenData *pSD, CmdTree *tree, Atom selection, Boolean in_line); extern void ModifyClientCommandTree (WmScreenData *pSD, ClientData *pCD, OpRange range, CmdTree *tree, CmdModifier modifier, Context context, String newname); extern void DestroyMenuSpecWidgets (MenuSpec *menuspec); extern void DestroyMenuSpec (WmScreenData *pSD, CARD32 commandID); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ extern MenuSpec *DuplicateMenuSpec (MenuSpec *menuSpec); #endif /* _WM_MENU_H */ motif-2.3.8/clients/mwm/WmWinList.c0000644000175000017500000020446013145162623014076 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmWinList.c /main/8 1997/06/10 15:50:50 samborn $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #define MWM_NEED_NOENTER16 #include "WmBitmap.h" /* * include extern functions */ #include "WmWinList.h" #include "WmCEvent.h" #include "WmFunction.h" #include "WmKeyFocus.h" #include "WmMenu.h" #include "WmResource.h" #include "WmWinInfo.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ #include "WmEvent.h" /* * Global Variables: */ /*************************************<->************************************* * * AddClientToList (pWS, pCD, onTop) * * * Description: * ----------- * This function adds a client window to the client window list. If it is * a transient window then it is added to the transient window tree that * contains its transient leader. The window stacking order is also * maintained for the cases where there is a system modal window active * or the window is a transient window. If a system modal window is being * added then the system modal "input screen" window is setup. * * * Inputs: * ------ * pCD = pointer to client data for the window to be added to the list * * pWS = pointer to workspace data * * onTop = if True then the window is displayed on top of the window * stack and is added to the beginning of the window list, otherwise * it is added to the end of the window list. * * * Outputs: * ------- * pWS = (clientList, lastClient) * *************************************<->***********************************/ void AddClientToList (WmWorkspaceData *pWS, ClientData *pCD, Boolean onTop) { Boolean belowSystemModal = False; XWindowChanges windowChanges; WmScreenData *pSD = pWS->pSD; #ifdef WSM WsClientData *pWsc = GetWsClientData (pWS, pCD); #endif /* WSM */ if (pCD->inputMode == MWM_INPUT_SYSTEM_MODAL) { /* * Set up the system modal input screen window just below the * system modal window. */ SetupSystemModalState (pCD); if (!wmGD.systemModalActive || (wmGD.systemModalClient != pCD)) { /* * If we failed to setup as system modal, then * back off to MWM_INPUT_FULL_APPLICATION_MODAL. * This will do *something* if this is a transient * window. */ pCD->inputMode = MWM_INPUT_FULL_APPLICATION_MODAL; } } else if (wmGD.systemModalActive && ((FindTransientTreeLeader (pCD))->inputMode != MWM_INPUT_SYSTEM_MODAL)) { /* * If a system modal window is active then place the window below * the system modal input screen window if the window is not a * descendant of the system modal window. */ windowChanges.sibling = pSD->inputScreenWindow; windowChanges.stack_mode = Below; XConfigureWindow (DISPLAY, pCD->clientFrameWin, CWSibling | CWStackMode, &windowChanges); belowSystemModal = True; } if (pCD->transientLeader) { AddTransient (pWS, pCD); } else { pCD->clientEntry.type = NORMAL_STATE; pCD->clientEntry.pCD = pCD; if (belowSystemModal && wmGD.systemModalClient) { AddEntryToList (pWS, &pCD->clientEntry, False /*below*/, pSD->clientList); } else if (onTop) { AddEntryToList (pWS, &pCD->clientEntry, True /*on top*/, NULL); } else { AddEntryToList (pWS, &pCD->clientEntry, False /*on bottom*/, NULL); } #ifdef WSM if (!pWsc->pIconBox && pWsc->iconFrameWin) #else /* WSM */ if (!pCD->pIconBox && pCD->iconFrameWin) #endif /* WSM */ { /* * Put the icon on the bottom of the stack. */ if (pSD->lastClient->type == MINIMIZED_STATE) { #ifdef WSM WsClientData *pWsib; pWsib = &pSD->lastClient->pCD->pWsList[0]; windowChanges.sibling = pWsib->iconFrameWin; #else /* WSM */ windowChanges.sibling = pSD->lastClient->pCD->iconFrameWin; #endif /* WSM */ } else { windowChanges.sibling = pSD->lastClient->pCD->clientFrameWin; } windowChanges.stack_mode = Below; #ifdef WSM XConfigureWindow (DISPLAY, pWsc->iconFrameWin, CWSibling | CWStackMode, &windowChanges); #else /* WSM */ XConfigureWindow (DISPLAY, pCD->iconFrameWin, CWSibling | CWStackMode, &windowChanges); #endif /* WSM */ pCD->iconEntry.type = MINIMIZED_STATE; pCD->iconEntry.pCD = pCD; pCD->iconEntry.nextSibling = NULL; pCD->iconEntry.prevSibling = pSD->lastClient; pSD->lastClient->nextSibling = &pCD->iconEntry; pSD->lastClient = &pCD->iconEntry; } } } /* END OF FUNCTION AddClientToList */ /*************************************<->************************************* * * AddEntryToList (pWS, pEntry, onTop, pStackEntry) * * * Description: * ----------- * This function adds a client list entry to the client window list. * This is usually done as part of the process of changing the ordering * of the window list. * * * Inputs: * ------ * pWS = pointer to workspace data * pEntry = pointer to a client list entry to be added to the client list * * onTop = if True then the client list entry is added on top of the * specified client list stack entry (if the stack entry is not * specified then the entry is added to the front of the list); * otherwise the entry is added after the specified stacking entry * (or to the end of the list if the stacking entry is not specified). * * pStackEntry = pointer to a client list entry to be used as a reference * in adding an entry to the client list. * * Outputs: * ------- * pWS = (clientList, lastClient) * *************************************<->***********************************/ void AddEntryToList (WmWorkspaceData *pWS, ClientListEntry *pEntry, Boolean onTop, ClientListEntry *pStackEntry) { WmScreenData *pSD = pWS->pSD; if (onTop) { if (pStackEntry) { if (pEntry != pStackEntry) { pEntry->nextSibling = pStackEntry; pEntry->prevSibling = pStackEntry->prevSibling; pStackEntry->prevSibling = pEntry; if (pEntry->prevSibling) { pEntry->prevSibling->nextSibling = pEntry; } else { pSD->clientList = pEntry; } } } else { if (pSD->clientList != pEntry) { pEntry->nextSibling = pSD->clientList; pEntry->prevSibling = NULL; if (pSD->clientList) { pSD->clientList->prevSibling = pEntry; } else { pSD->lastClient = pEntry; } pSD->clientList = pEntry; } } } else { if (pStackEntry) { if (pEntry != pStackEntry) { pEntry->nextSibling = pStackEntry->nextSibling; pEntry->prevSibling = pStackEntry; pStackEntry->nextSibling = pEntry; if (pEntry->nextSibling) { pEntry->nextSibling->prevSibling = pEntry; } else { pSD->lastClient = pEntry; } } } else { if (pSD->lastClient != pEntry) { pEntry->nextSibling = NULL; pEntry->prevSibling = pSD->lastClient; if (pSD->clientList) { pSD->lastClient->nextSibling = pEntry; } else { pSD->clientList = pEntry; } pSD->lastClient = pEntry; } } } } /* END OF FUNCTION AddEntryToList */ /*************************************<->************************************* * * MoveEntryInList (pWS, pEntry, onTop, pStackEntry) * * * Description: * ----------- * This function moves a client list entry in the client window list. * * * Inputs: * ------ * pWS = pointer to workspace data * * pEntry = pointer to a client list entry to be moved in the client list * * onTop = if True then the client list entry is moved on top of the * specified client list stack entry (if the stack entry is not * specified then the entry is moved to the front of the list); * otherwise the entry is moved after the specified stacking entry * (or to the end of the list if the stacking entry is not specified). * * pStackEntry = pointer to a client list entry to be used as a reference * in moving an entry in the client list. * * Outputs: * ------- * pWS = (clientList, lastClient) * *************************************<->***********************************/ void MoveEntryInList (WmWorkspaceData *pWS, ClientListEntry *pEntry, Boolean onTop, ClientListEntry *pStackEntry) { DeleteEntryFromList (pWS, pEntry); AddEntryToList (pWS, pEntry, onTop, pStackEntry); } /* END OF FUNCTION MoveEntryInList */ /*************************************<->************************************* * * DeleteEntryFromList (pWS, pListEntry) * * * Description: * ----------- * This function deletes a client list entry from the client window list. * This is usually done as part of the process of changing the ordering * of the window list. * * * Inputs: * ------ * pWS = pointer to workspace data * listEntry = pointer to a client list entry * * Outputs: * ------- * pWS = (clientList, lastClient) * *************************************<->***********************************/ void DeleteEntryFromList (WmWorkspaceData *pWS, ClientListEntry *pListEntry) { if (pListEntry->prevSibling) { pListEntry->prevSibling->nextSibling = pListEntry->nextSibling; } else { pWS->pSD->clientList = pListEntry->nextSibling; } if (pListEntry->nextSibling) { pListEntry->nextSibling->prevSibling = pListEntry->prevSibling; } else { pWS->pSD->lastClient = pListEntry->prevSibling; } } /* END OF FUNCTION DeleteEntryFromList */ /*************************************<->************************************* * * DeleteClientFromList (pWS, pCD) * * * Description: * ----------- * This function deletes a client from the client window list. If this is * a transient window then it is deleted from its transient window tree. * If this is a system modal window then clean up the system modal state. * * * Inputs: * ------ * pCD = pointer to client data for the window to be added to the list * * Outputs: * ------- * pWS = (clientList, lastClient) * *************************************<->***********************************/ void DeleteClientFromList (WmWorkspaceData *pWS, ClientData *pCD) { #ifdef WSM WsClientData *pWsc = GetWsClientData (pWS, pCD); #endif /* WSM */ WmScreenData *pSD = pWS->pSD; if (pCD->transientLeader) { DeleteTransient (pCD); } else { /* * If this is a system modal window then clean up the system modal * state. */ if (pCD->inputMode == MWM_INPUT_SYSTEM_MODAL) { UndoSystemModalState (); } /* * Remove the client and icon entries from the window list. */ #ifdef WSM if (!pWsc->pIconBox && pWsc->iconFrameWin) #else /* WSM */ if (!pCD->pIconBox && pCD->iconFrameWin) #endif /* WSM */ { if (pCD->iconEntry.prevSibling) { pCD->iconEntry.prevSibling->nextSibling = pCD->iconEntry.nextSibling; } else { pSD->clientList = pCD->iconEntry.nextSibling; } if (pCD->iconEntry.nextSibling) { pCD->iconEntry.nextSibling->prevSibling = pCD->iconEntry.prevSibling; } else { pSD->lastClient = pCD->iconEntry.prevSibling; } } if (pCD->clientEntry.prevSibling) { pCD->clientEntry.prevSibling->nextSibling = pCD->clientEntry.nextSibling; } else { pSD->clientList = pCD->clientEntry.nextSibling; } if (pCD->clientEntry.nextSibling) { pCD->clientEntry.nextSibling->prevSibling = pCD->clientEntry.prevSibling; } else { pSD->lastClient = pCD->clientEntry.prevSibling; } } } /* END OF FUNCTION DeleteClientFromList */ /*************************************<->************************************* * * AddTransient (pWS, pCD) * * * Description: * ----------- * This function adds the transient window to the lead window's list of * transients. * * * Inputs: * ------ * pWS = pointer to workspace data * pCD = pointer to client data of a transient window * * * Outputs: * ------- * pCD->transientLeader = (transientChildren, modalCount) * *************************************<->***********************************/ void AddTransient (WmWorkspaceData *pWS, ClientData *pCD) { ClientData *pcdLeader = pCD->transientLeader; ClientData *pcdTop = FindTransientTreeLeader (pCD); Boolean restackTransients; WmScreenData *pSD = pWS->pSD; pCD->transientSiblings = pcdLeader->transientChildren; pcdLeader->transientChildren = pCD; /* * Insure that the new transient window is on top of its siblings * and that the transient window tree is on top of the window * stack (this is the standard behavior for newly mapped and * managed windows). If there is a system modal window that the * transient window is not associated with then don't raise the * transient tree. */ restackTransients = PutTransientOnTop (pCD); /* * Handle application modal transient windows */ if (pCD->inputMode == MWM_INPUT_PRIMARY_APPLICATION_MODAL) { /* * If this is a primary application modal window then increment * the modal count for transient leaders that are directly up * the transient tree. * * (This is the old MWM_INPUT_APPLICATION_MODAL behavior.) */ while (pcdLeader) { MarkModalTransient (pcdLeader, pCD); pcdLeader = pcdLeader->transientLeader; } } else if (pCD->inputMode == MWM_INPUT_FULL_APPLICATION_MODAL) { /* * If this is a full application modal window then increment * the modal count for the rest of the transient tree. */ MarkModalSubtree (pcdTop, pCD); } else if (pcdTop->fullModalCount) { /* * There is already a full application modal window in the tree */ pcdLeader = pCD->transientLeader; if ((pcdLeader->inputMode != MWM_INPUT_FULL_APPLICATION_MODAL) || (IS_APP_MODALIZED(pcdLeader))) { /* * The immediate parent of this transient is not the * current full application modal window. Set the full * modal count to the parent's so that they both become * unmodalized at the same time. This allows a full * app modal window to have active, non-modal transients. */ pCD->fullModalCount = pcdLeader->fullModalCount; } } /* * Do the actual restacking in the X window stack if necessary. */ if ((pSD->clientList != &pcdTop->clientEntry) && !wmGD.systemModalActive) { F_Raise (NULL, pCD, NULL); } else if (restackTransients) { RestackTransientsAtWindow (pCD); } else if (pCD != FindTransientOnTop (pcdTop)) { StackTransientWindow (pCD); } } /* END OF FUNCTION AddTransient */ /*************************************<->************************************* * * MarkModalSubtree (pcdTree, pcdAvoid) * * * Description: * ----------- * This function marks the transient tree with pcdTree as its leader. * If pcdAvoid is in the tree, it is not marked. * * Inputs: * ------ * pcdTree = pointer to client data of the tree to mark * pcdAvoid = pointer to client data to not mark if in tree * * *************************************<->***********************************/ void MarkModalSubtree (ClientData *pcdTree, ClientData *pcdAvoid) { /* Mark children, if any */ if (pcdTree->transientChildren) MarkModalSubtree (pcdTree->transientChildren, pcdAvoid); /* Mark this node */ if (pcdTree != pcdAvoid) { MarkModalTransient (pcdTree, pcdAvoid); } /* Mark siblings */ if (pcdTree->transientSiblings) MarkModalSubtree (pcdTree->transientSiblings, pcdAvoid); } /*************************************<->************************************* * * MarkModalTransient (pcdLeader, pCD) * * * Description: * ----------- * This function marks a transient window for application modal processing. * Grabs are done to eat up pointer button events. * * Inputs: * ------ * pcdLeader = pointer to client data to mark * pCD = pointer to client data of new transient * * *************************************<->***********************************/ void MarkModalTransient (ClientData *pcdLeader, ClientData *pCD) { if (!IS_APP_MODALIZED(pcdLeader)) { /* * Eat pointer button events while application modal. */ XGrabButton (DISPLAY, AnyButton, AnyModifier, pcdLeader->clientBaseWin, True, ButtonPressMask | ButtonMotionMask, GrabModeAsync, GrabModeAsync, None, wmGD.workspaceCursor); } /* bump application modal count */ if (pCD->inputMode == MWM_INPUT_FULL_APPLICATION_MODAL) pcdLeader->fullModalCount++; else pcdLeader->primaryModalCount++; } /*************************************<->************************************* * * DeleteTransient (pCD) * * * Description: * ----------- * This function deletes the transient window from the lead window's list * of transients * * Much of the complication of this code arises from trying to handle * mixtures of both full- and primary-application modal transients. * It also tries to handle the case where a sequence of application * modal transients appear in different places in the transient tree * (i.e. not as descendents of a previously existing full app modal * transient). * * Inputs: * ------ * pCD = pointer to client data of transient. * *************************************<->***********************************/ void DeleteTransient (ClientData *pCD) { ClientData *pcdLeader; ClientData *pcdPrev; int modalCount; /* * Handle primary application modality. * Reset the modal window counts for the leader windows up through the * transient window tree. */ modalCount = pCD->primaryModalCount; if (pCD->inputMode == MWM_INPUT_PRIMARY_APPLICATION_MODAL) { modalCount += 1; } if (modalCount) { pcdLeader = pCD->transientLeader; while (pcdLeader) { if (modalCount) UnMarkModalTransient (pcdLeader, modalCount, pCD); pcdLeader = pcdLeader->transientLeader; } } /* * Handle full application modality. * Undo application modal windows in a depth first manner. */ pcdLeader = FindTransientTreeLeader (pCD); if (pCD->transientChildren) { DeleteFullAppModalChildren (pcdLeader, pCD->transientChildren); } if (pCD->inputMode == MWM_INPUT_FULL_APPLICATION_MODAL) { /* * If this is a full application modal window then decrement * the modal count for the rest of the transient tree. */ FixupFullAppModalCounts (pcdLeader, pCD); } /* * Delete this transient from its parent's list of transient windows. */ pcdPrev = pCD->transientLeader->transientChildren; if(pcdPrev) { if (pcdPrev == pCD) { pCD->transientLeader->transientChildren = pCD->transientSiblings; } else { while (pcdPrev && (pcdPrev->transientSiblings != pCD)) { pcdPrev = pcdPrev->transientSiblings; } if (pcdPrev) pcdPrev->transientSiblings = pCD->transientSiblings; } } } /* END OF FUNCTION DeleteTransient */ /*************************************<->************************************* * * DeleteFullAppModalChildren (pcdLeader, pCD) * * * Description: * ----------- * This function handles the clean-up of nested full application modal * windows. The deletion has to be handled carefully to keep a correct * fullModalCount on the transients that remain in the tree. * * The algorithm is to traverse the transient children depth first and * fix up the tree's fullModalCount for each full application modal * window that's found. * * Inputs: * ------ * pcdLeader = pointer to client data of transient tree root. * pCD = pointer to client data of transient subtree to delete. * *************************************<->***********************************/ void DeleteFullAppModalChildren (ClientData *pcdLeader, ClientData *pCD) { /* recursively do children first */ if (pCD->transientChildren) DeleteFullAppModalChildren (pcdLeader, pCD->transientChildren); /* do fullAppModal fixup for this guy */ FixupFullAppModalCounts (pcdLeader, pCD); /* do siblings of passed transient */ if (pCD->transientSiblings) DeleteFullAppModalChildren (pcdLeader, pCD->transientSiblings); } /* END OF FUNCTION DeleteFullAppModalChildren */ /*************************************<->************************************* * * FixupFullAppModalCounts (pcdLeader, pcdDelete) * * * Description: * ----------- * This function traverses the entire transient tree (pointed to by * pcdLeader) and fixes up the fullModalCounts to reflect the removal * of pcdDelete. * * The fix-up consists of decrementing the count * of the remaining full app modal windows in the tree iff the remaining * window's fullModalCount is greater than the fullModalCount of the * transient being deleted. * * Inputs: * ------ * pcdLeader = pointer to client data for head of transient tree. * pcdDelet = pointer to client data of transient being deleted. * *************************************<->***********************************/ void FixupFullAppModalCounts (ClientData *pcdLeader, ClientData *pcdDelete) { /* fixup children */ if (pcdLeader->transientChildren) { FixupFullAppModalCounts (pcdLeader->transientChildren, pcdDelete); } /* * fixup leader: decrement the count if it is greater than * the transient being deleted. * */ if (pcdLeader->fullModalCount > pcdDelete->fullModalCount) { UnMarkModalTransient (pcdLeader, 1, pcdDelete); } /* fixup siblings */ if (pcdLeader->transientSiblings) { FixupFullAppModalCounts (pcdLeader->transientSiblings, pcdDelete); } } /* END OF FUNCTION FixupFullAppModalCounts */ /*************************************<->************************************* * * UnMarkModalTransient (pcdModee, modalCount, pcdModal) * * * Description: * ----------- * This function unmarks a transient window for application modal processing. * Original grabs are restored. * * Inputs: * ------ * pcdModee = pointer to client data for transient to unmark * pcdModal = pointer to client data for modal transient * modalCount = amount to decrement the client's modal count by * * *************************************<->***********************************/ void UnMarkModalTransient (ClientData *pcdModee, int modalCount, ClientData *pcdModal) { /* decrement application modal count */ if (pcdModal->inputMode == MWM_INPUT_FULL_APPLICATION_MODAL) pcdModee->fullModalCount -= modalCount; else if (pcdModal->inputMode == MWM_INPUT_PRIMARY_APPLICATION_MODAL) pcdModee->primaryModalCount -= modalCount; /* * Restore original button bindings/grabs if not modal anymore */ if (!IS_APP_MODALIZED(pcdModee)) { XUngrabButton (DISPLAY, AnyButton, AnyModifier, pcdModee->clientBaseWin); SetupCButtonBindings (pcdModee->clientBaseWin, BUTTON_SPECS(pcdModee)); if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) && (wmGD.keyboardFocus != pcdModee)) { DoExplicitSelectGrab (pcdModee->clientBaseWin); } } } /*************************************<->************************************* * * PutTransientOnTop (pcd) * * * Description: * ----------- * This function changes the transient window list to insure that the * specified transient window is on top of its siblings and its parent * is on top of its siblings, etc. The sibling list is ordered such * that the first window in the list is on top of second window in the * list, etc. * * * Inputs: * ------ * pcd = pointer to client data of a transient window * * * Outputs: * ------- * pcdLeader = (transientSiblings) * * RETURN = True if the transient tree needs to be restacked * *************************************<->***********************************/ Boolean PutTransientOnTop (ClientData *pcd) { ClientData *pcdLeader; ClientData *pcdPrev; Boolean restack = False; pcdLeader = pcd->transientLeader; if (pcdLeader != NULL) { pcdPrev = pcdLeader->transientChildren; if (pcdPrev != pcd) { while (pcdPrev->transientSiblings != pcd) { pcdPrev = pcdPrev->transientSiblings; } pcdPrev->transientSiblings = pcd->transientSiblings; pcd->transientSiblings = pcdLeader->transientChildren; pcdLeader->transientChildren = pcd; restack = True; } if (PutTransientOnTop (pcdLeader)) { restack = True; } #ifdef WSM if (BumpPrimaryToBottom (pcdLeader)) { restack = True; } #endif /* WSM */ } return (restack); } /* END OF FUNCTION PutTransientOnTop */ /*************************************<->************************************* * * PutTransientBelowSiblings (pcd) * * * Description: * ----------- * This function changes the transient window list to insure that the * specified transient window is below its sibling windows. * * * Inputs: * ------ * pcd = pointer to client data of a transient window * * * Outputs: * ------- * pcdLeader = (transientSiblings) * * RETURN = True if restacking has been done in the transient window tree. * *************************************<->***********************************/ Boolean PutTransientBelowSiblings (ClientData *pcd) { ClientData *pcdLeader; ClientData *pcdNext; Boolean restack = False; pcdLeader = pcd->transientLeader; if (pcdLeader) { if (pcd->transientSiblings || (pcdLeader->transientChildren != pcd)) { restack = True; if (pcdLeader->transientChildren == pcd) { pcdLeader->transientChildren = pcd->transientSiblings; } pcdNext = pcdLeader->transientChildren; while (pcdNext->transientSiblings) { if (pcdNext->transientSiblings == pcd) { pcdNext->transientSiblings = pcd->transientSiblings; } else { pcdNext = pcdNext->transientSiblings; } } pcdNext->transientSiblings = pcd; } pcd->transientSiblings = NULL; } return (restack); } /* END OF FUNCTION PutTransientBelowSiblings */ /*************************************<->************************************* * * RestackTransients (pcd) * * * Description: * ----------- * This function restacks windows in a transient window tree. Secondary * (transient) windows are stacked on top of their associated primary * windows and the first secondary window in the transientSiblings list * is stacked on top of the second window in the list, etc. * * * Inputs: * ------ * pcd = pointer to client data of a window in a transient tree * *************************************<->***********************************/ void RestackTransients (ClientData *pcd) { ClientData *pcdLeader; int count; static int size = 0; static Window *windows = NULL; #ifndef WSM Window *nextWindow; #endif /* WSM */ XWindowChanges windowChanges; int i; int leaderIndex; /* * Build a restacking list and do the restacking. */ pcdLeader = FindTransientTreeLeader (pcd); count = CountTransientChildren (pcdLeader); /* No work to do if no transient children; count includes leader. */ if (count < 2) return; if (count > size) { /* * Expand the (static) windows buffer that is used in restacking. */ if (!(windows = (Window *)WmMalloc ((char*)windows, (count + 5) * sizeof (Window)))) { /* cannot get memory space */ size = 0; return; } size = count + 5; } #ifdef WSM MakeTransientFamilyStackingList (windows, pcdLeader); #else /* WSM */ nextWindow = MakeTransientWindowList (windows, pcdLeader); *nextWindow = pcdLeader->clientFrameWin; #endif /* WSM */ /* * Changes for CDExc19397. * XRestackWindows may move pcdLeader; that messes up the * global window stack. Call XConfigureWindow() instead, * and don't change location of pcdLeader. */ for (leaderIndex = 0; leaderIndex < count; leaderIndex++) { if (windows[leaderIndex] == pcdLeader->clientFrameWin) break; } if (leaderIndex >= count) /* ? Couldn't find leader; should NOT happen. */ leaderIndex = count - 1; windowChanges.stack_mode = Above; for (i = leaderIndex; i > 0; i--) { windowChanges.sibling = windows[i]; XConfigureWindow (DISPLAY, windows[i - 1], CWSibling | CWStackMode, &windowChanges); } windowChanges.stack_mode = Below; for (i = leaderIndex; i < count - 1; i++) { windowChanges.sibling = windows[i]; XConfigureWindow (DISPLAY, windows[i + 1], CWSibling | CWStackMode, &windowChanges); } } /* END OF FUNCTION RestackTransients */ /*************************************<->************************************* * * RestackTransientsAtWindow (pcd) * * * Description: * ----------- * This function restacks windows in a transient window tree. The * "anchor point" in the stack for the transient window tree is the * specified window. * * * Inputs: * ------ * pcd = pointer to client data of a window in a transient tree * *************************************<->***********************************/ void RestackTransientsAtWindow (ClientData *pcd) { ClientData *pcdLeader; XWindowChanges windowChanges; pcdLeader = FindTransientTreeLeader (pcd); if (pcdLeader && (pcdLeader != pcd)) { windowChanges.sibling = pcd->clientFrameWin; windowChanges.stack_mode = Below; XConfigureWindow (DISPLAY, pcdLeader->clientFrameWin, CWSibling | CWStackMode, &windowChanges); } RestackTransients (pcd); } /* END OF FUNCTION RestackTransientsAtWindow */ /*************************************<->************************************* * * FindTransientTreeLeader (pcd) * * * Description: * ----------- * This function identifies the leader of the transient tree that * contains the specified client. * * * Inputs: * ------ * pcd = pointer to client data of a window in a transient tree. * * Outputs: * ------- * RETURN = pointer to the client data for the transient tree leader. * *************************************<->***********************************/ ClientData * FindTransientTreeLeader (ClientData *pcd) { /* * Find the head of the transient window tree. */ while (pcd->transientLeader) { pcd = pcd->transientLeader; } return (pcd); } /* END OF FUNCTION FindTransientTreeLeader */ /*************************************<->************************************* * * CountTransientChildren (pcd) * * * Description: * ----------- * This function returns a count of the number of children in the * transient window tree headed by the specified client window. * * * Inputs: * ------ * pcd = pointer to client data of a window in a transient tree * * Outputs: * ------- * RETURN = count of transient windows in the transient window tree * *************************************<->***********************************/ int CountTransientChildren (ClientData *pcd) { ClientData *pcdNext; int count = 1; pcdNext = pcd->transientChildren; while (pcdNext) { if (pcdNext->transientChildren) { count += CountTransientChildren (pcdNext); } else { count++; } pcdNext = pcdNext->transientSiblings; } return (count); } /* END OF FUNCTION CountTransientChildren */ /*************************************<->************************************* * * MakeTransientWindowList (windows, pcd) * * * Description: * ----------- * This function makes a transient window list of windows in the * transient window tree headed by the specified client. This list is * to be passed to XRestackWindows. * * * Inputs: * ------ * windows = pointer to the windows list to be filled out * * pcd = pointer to client data of a window in a transient tree * * Outputs: * ------- * RETURN = pointer to the next entry in the windows list * *************************************<->***********************************/ Window * MakeTransientWindowList (Window *windows, ClientData *pcd) { ClientData *pcdNext; pcdNext = pcd->transientChildren; while (pcdNext) { if (pcdNext->transientChildren) { windows = MakeTransientWindowList (windows, pcdNext); } *windows = pcdNext->clientFrameWin; windows++; pcdNext = pcdNext->transientSiblings; } return (windows); } /* END OF FUNCTION MakeTransientWindowList */ /*************************************<->************************************* * * FindTransientFocus (pcd) * * * Description: * ----------- * This function identifies a window in the transient tree that is headed * by the specified client that can accept the keyboard input. The * effect of application modal windows is taken into account. * * * Inputs: * ------ * pcd = pointer to client data of a window in a transient tree. * * Outputs: * ------- * RETURN = pointer to the client data for a window that can accept the * keyboard input focus. * *************************************<->***********************************/ ClientData * FindTransientFocus (ClientData *pcd) { ClientData *pcdFocus; /* * Find a window that does not have an application modal subordinate. * First, search descendents */ pcdFocus = pcd; while (pcdFocus->transientChildren && IS_APP_MODALIZED(pcdFocus)) { pcdFocus = pcdFocus->transientChildren; } /* * If (search of descendents FAILS) then search siblings. */ if (IS_APP_MODALIZED(pcdFocus)) { ClientData *pcdSibling; pcdFocus = pcd; while (pcdFocus && IS_APP_MODALIZED(pcdFocus)) { pcdSibling = pcdFocus; while (pcdSibling->transientSiblings && IS_APP_MODALIZED(pcdFocus)) { pcdSibling = pcdSibling->transientSiblings; } if (IS_APP_MODALIZED(pcdSibling)) { pcdFocus = pcdFocus->transientChildren; } else { pcdFocus = pcdSibling; break; } } } return (pcdFocus ? pcdFocus : wmGD.keyboardFocus); } /* END OF FUNCTION FindTransientFocus */ /*************************************<->************************************* * * FindTransientOnTop (pcd) * * * Description: * ----------- * This function identifies the top-most transient window in the * transient window tree that contains the specified client. * * * Inputs: * ------ * pcd = pointer to client data of a window in a transient tree. * * Outputs: * ------- * RETURN = pointer to the client data for the top-most transient window. * *************************************<->***********************************/ ClientData * FindTransientOnTop (ClientData *pcd) { /* * Find the head of the transient window tree. */ pcd = FindTransientTreeLeader (pcd); #ifdef WSM if (!(pcd->secondariesOnTop) && (LeaderOnTop (pcd))) { ClientData *pcdSub; if (LeaderOnTop (pcd)) { /* The primary window is on top! */ return (pcd); } else { pcdSub = FindSubLeaderToTop (pcd); if (pcdSub) return (pcdSub); } } #endif /* WSM */ /* * Find the top-most transient window (the window in the transient tree * that is highest in the window stack). */ while (pcd->transientChildren) { pcd = pcd->transientChildren; } return (pcd); } /* END OF FUNCTION FindTransientOnTop */ /*************************************<->************************************* * * StackWindow (pWS, pEntry, onTop, pStackEntry) * * * Description: * ----------- * This function stacks a window of a particular type (normal or icon) * to the top or botton of the window stack on the screen. * * * Inputs: * ------ * pWS = pointer to workspace data * * pEntry = pointer to the client list entry for the window to be restacked. * * onTop = if True then the window is to be restacked on top of the * specified stack window (if the stack window is not specified then * the entry is added to the top of the window stack) * otherwise the window is stacked below the specified stack window * (or at the bottom of the window stack if the stack window is not * specified). * * pStackEntry = pointer to a client list entry for a window in the window * stack that is to be used as a reference in restacking. * *************************************<->***********************************/ void StackWindow (WmWorkspaceData *pWS, ClientListEntry *pEntry, Boolean onTop, ClientListEntry *pStackEntry) { Window stackWindow; Boolean stackTransientTreeWindows = False; Window activeIconWindow; Window window; XWindowChanges changes; WmScreenData *pSD = pWS->pSD; if (pStackEntry) { if (pStackEntry->type == MINIMIZED_STATE) { stackWindow = ICON_FRAME_WIN(pStackEntry->pCD); } else { stackWindow = pStackEntry->pCD->clientFrameWin; } } else { stackWindow = (Window)0; } if (pEntry->type == MINIMIZED_STATE) { window = ICON_FRAME_WIN(pEntry->pCD); } else { /* * Restack the transient tree if appropriate. */ if (pEntry->pCD->transientLeader || pEntry->pCD->transientChildren) { stackTransientTreeWindows = True; window = (FindTransientOnTop (pEntry->pCD))->clientFrameWin; } else { window = pEntry->pCD->clientFrameWin; } } /* * The active icon text label must be restacked along with the associated * icon. */ if ((pEntry->type == MINIMIZED_STATE) && (pEntry->pCD == wmGD.keyboardFocus) && (ICON_DECORATION(pEntry->pCD) & ICON_ACTIVE_LABEL_PART) && (ACTIVE_ICON_TEXT_WIN)) { activeIconWindow = ACTIVE_ICON_TEXT_WIN; } else { activeIconWindow = (Window)0; } if (onTop) { if ((stackWindow == 0) && (pSD->clientList)) { if (pSD->clientList->type == MINIMIZED_STATE) { stackWindow = ICON_FRAME_WIN(pSD->clientList->pCD); } else { if (pSD->clientList->pCD->transientChildren) { stackWindow = (FindTransientOnTop(pSD->clientList->pCD))->clientFrameWin; } else { stackWindow = pSD->clientList->pCD->clientFrameWin; } } } if (activeIconWindow) { changes.sibling = stackWindow; changes.stack_mode = Above; XConfigureWindow (DISPLAY, activeIconWindow, (CWSibling | CWStackMode), &changes); changes.sibling = activeIconWindow; changes.stack_mode = Below; XConfigureWindow (DISPLAY, window, (CWSibling | CWStackMode), &changes); } else { changes.sibling = stackWindow; changes.stack_mode = Above; XConfigureWindow (DISPLAY, window, (CWSibling | CWStackMode), &changes); if (stackTransientTreeWindows) { /* make sure that the leader is in the correct spot */ changes.sibling = window; changes.stack_mode = Below; XConfigureWindow (DISPLAY, pEntry->pCD->clientFrameWin, (CWSibling | CWStackMode), &changes); RestackTransients (pEntry->pCD); } } } else { #ifdef WSM /* * Adjust stack entry window if we're stacking below a * transient tree. */ if (pStackEntry && pStackEntry->pCD->transientChildren) { stackWindow = LowestWindowInTransientFamily (pStackEntry->pCD); } #endif /* WSM */ if (stackWindow == 0) { if (pSD->lastClient->type == MINIMIZED_STATE) { stackWindow = ICON_FRAME_WIN(pSD->lastClient->pCD); } else { #ifdef WSM if (pSD->lastClient->pCD->transientChildren) { stackWindow = LowestWindowInTransientFamily (pSD->lastClient->pCD); } else #endif /* WSM */ stackWindow = pSD->lastClient->pCD->clientFrameWin; } } if (activeIconWindow) { changes.sibling = stackWindow; changes.stack_mode = Below; XConfigureWindow (DISPLAY, activeIconWindow, (CWSibling | CWStackMode), &changes); changes.sibling = activeIconWindow; changes.stack_mode = Below; XConfigureWindow (DISPLAY, window, (CWSibling | CWStackMode), &changes); } else { changes.sibling = stackWindow; changes.stack_mode = Below; XConfigureWindow (DISPLAY, window, (CWSibling | CWStackMode), &changes); if (stackTransientTreeWindows) { /* make sure that the leader is in the correct spot */ changes.sibling = window; changes.stack_mode = Below; XConfigureWindow (DISPLAY, pEntry->pCD->clientFrameWin, (CWSibling | CWStackMode), &changes); RestackTransients (pEntry->pCD); } } } } /* END OF FUNCTION StackWindow */ /*************************************<->************************************* * * StackTransientWindow (pcd) * * * Description: * ----------- * This function stacks a transient window within its transient window * tree on the screen. The transient window tree should indicate the * intended stacking position. * * * Inputs: * ------ * pcd = pointer to client data of a window in a transient tree * *************************************<->***********************************/ void StackTransientWindow (ClientData *pcd) { XWindowChanges changes; ClientData *pcdPrev; if (pcd->transientLeader->transientChildren == pcd) { if (pcd->transientSiblings) { changes.sibling = pcd->transientSiblings->clientFrameWin; } else { changes.sibling = pcd->transientLeader->clientFrameWin; } changes.stack_mode = Above; } else { pcdPrev = pcd->transientLeader; while (pcdPrev->transientSiblings != pcd) { pcdPrev = pcdPrev->transientSiblings; } changes.sibling = pcdPrev->clientFrameWin; changes.stack_mode = Below; } XConfigureWindow (DISPLAY, pcd->clientFrameWin, (CWSibling | CWStackMode), &changes); } /* END OF FUNCTION StackTransientWindow */ /*************************************<->************************************* * * CheckIfClientObscuring (pcdTop, pcd) * * * Description: * ----------- * This function determines whether a window or a transient window tree * is obscuring (at least partially) a window or a transient window tree * that is below it in the window stack. * * * Inputs: * ------ * pcdTop = pointer to client data for a window (it may be the leader of * a transient tree; this window is the higher in the window stack * than the window it is be checked against. * * pcd = pointer to client data for a window (it may be the leader of * a transient tree. * * * Outputs: * ------- * RETURN = True if the top window(s) overlap the lower window(s) * *************************************<->***********************************/ Boolean CheckIfClientObscuring (ClientData *pcdTop, ClientData *pcd) { Boolean obscuring = False; ClientData *pcdNext; /* * Check only if the top window is visible onscreen. */ if (pcdTop->transientChildren && (pcdTop->clientState != MINIMIZED_STATE)) { pcdNext = pcdTop->transientChildren; while (pcdNext && !obscuring) { obscuring = CheckIfClientObscuring (pcdNext, pcd); pcdNext = pcdNext->transientSiblings; } } if (!obscuring && pcd->transientChildren && (pcd->clientState != MINIMIZED_STATE)) { pcdNext = pcd->transientChildren; while (pcdNext && !obscuring) { obscuring = CheckIfClientObscuring (pcdTop, pcdNext); pcdNext = pcdNext->transientSiblings; } } if (!obscuring) { obscuring = CheckIfObscuring (pcdTop, pcd); } return (obscuring); } /* END OF FUNCTION CheckIfClientObscuring */ /*************************************<->************************************* * * CheckIfObscuring (pcdA, pcdB) * * * Description: * ----------- * This function determines whether a window (not a transient tree) * is obscuring (at least partially) a window (not a transient tree) * that is below it in the window stack. * * * Inputs: * ------ * pcdA = pointer to client data for a window; this window is higher in * the window stack than the window it is be checked against. * * pcdB = pointer to client data for a window. * * * Outputs: * ------- * RETURN = True if the top window overlaps the lower window * *************************************<->***********************************/ Boolean CheckIfObscuring (ClientData *pcdA, ClientData *pcdB) { Boolean obscuring = False; int aX1; int aX2; int aY1; int aY2; int bX1; int bX2; int bY1; int bY2; #ifdef WSM /* * For workspace stuff: if either is unseen, then neither * is obscured. */ if ((pcdA->clientState & UNSEEN_STATE) || (pcdB->clientState & UNSEEN_STATE)) { return (False); } #endif /* WSM */ if (pcdA->clientState == NORMAL_STATE) { aX1 = pcdA->clientX - pcdA->clientOffset.x; aY1 = pcdA->clientY - pcdA->clientOffset.y; aX2 = aX1 + pcdA->clientWidth + (2 * pcdA->clientOffset.x) - 1; aY2 = aY1 + pcdA->clientHeight + pcdA->clientOffset.y + pcdA->clientOffset.x - 1; } else if (pcdA->clientState == MINIMIZED_STATE) { aX1 = ICON_X(pcdA); aY1 = ICON_Y(pcdA); aX2 = aX1 + ICON_WIDTH(pcdA) - 1; aY2 = aY1 + ICON_HEIGHT(pcdA) - 1; } else /* (pcdA->clientState == MAXIMIZED_STATE) */ { aX1 = pcdA->maxX - pcdA->clientOffset.x; aY1 = pcdA->maxY - pcdA->clientOffset.y; aX2 = aX1 + pcdA->maxWidth + (2 * pcdA->clientOffset.x) - 1; aY2 = aY1 + pcdA->maxHeight + pcdA->clientOffset.y + pcdA->clientOffset.x - 1; } if (pcdB->clientState == NORMAL_STATE) { bX1 = pcdB->clientX - pcdB->clientOffset.x; bY1 = pcdB->clientY - pcdB->clientOffset.y; bX2 = bX1 + pcdB->clientWidth + (2 * pcdB->clientOffset.x) - 1; bY2 = bY1 + pcdB->clientHeight + pcdB->clientOffset.y + pcdB->clientOffset.x - 1; } else if (pcdB->clientState == MINIMIZED_STATE) { bX1 = ICON_X(pcdB); bY1 = ICON_Y(pcdB); bX2 = bX1 + ICON_WIDTH(pcdB) - 1; bY2 = bY1 + ICON_HEIGHT(pcdB) - 1; } else /* (pcdB->clientState == MAXIMIZED_STATE) */ { bX1 = pcdB->maxX - pcdB->clientOffset.x; bY1 = pcdB->maxY - pcdB->clientOffset.y; bX2 = bX1 + pcdB->maxWidth + (2 * pcdB->clientOffset.x) - 1; bY2 = bY1 + pcdB->maxHeight + pcdB->clientOffset.y + pcdB->clientOffset.x - 1; } /* * Check if there is overlap in both dimensions. */ if (((aX1 >= bX1) && (aX1 <= bX2)) || ((aX2 >= bX1) && (aX2 <= bX2)) || ((bX1 >= aX1) && (bX1 <= aX2)) || ((bX2 >= aX1) && (bX2 <= aX2))) { if (((aY1 >= bY1) && (aY1 <= bY2)) || ((aY2 >= bY1) && (aY2 <= bY2)) || ((bY1 >= aY1) && (bY1 <= aY2)) || ((bY2 >= aY1) && (bY2 <= aY2))) { obscuring = True; } } return (obscuring); } /* END OF FUNCTION CheckIfObscuring */ /*************************************<->************************************* * * CheckIfClientObscuredByAny (pcd) * * * Description: * ----------- * This function determines whether a window or a transient window tree * is obscured (at least partially) by any other window. * * * Inputs: * ------ * pcd = pointer to client data for a window (it may be the leader of * a transient tree. * * * Outputs: * ------- * RETURN = True if the window(s) are overlapped. * *************************************<->***********************************/ Boolean CheckIfClientObscuredByAny (ClientData *pcd) { Boolean obscured = False; ClientListEntry *pListEntry; pListEntry = ACTIVE_PSD->clientList; while (pListEntry && !obscured) { if (pListEntry->pCD == pcd) { if (((pListEntry->type == MINIMIZED_STATE) && (pListEntry->pCD->clientState == MINIMIZED_STATE)) || ((pListEntry->type != MINIMIZED_STATE) && (pListEntry->pCD->clientState != MINIMIZED_STATE))) { pListEntry = NULL; } } else if (((pListEntry->type == MINIMIZED_STATE) && (pListEntry->pCD->clientState == MINIMIZED_STATE)) || ((pListEntry->type != MINIMIZED_STATE) && (pListEntry->pCD->clientState != MINIMIZED_STATE))) { /* * The window for the entry is visible on screen. See if it * obscures the indicated window. */ obscured = CheckIfClientObscuring (pListEntry->pCD, pcd); } if (pListEntry) { pListEntry = pListEntry->nextSibling; } } return (obscured); } /* END OF FUNCTION CheckIfClientObscuredByAny */ /*************************************<->************************************* * * CheckIfClientObscuringAny (pcd) * * * Description: * ----------- * This function determines whether a window or a transient window tree * is obscuring another window. * * * Inputs: * ------ * pcd = pointer to client data for a window (it may be the leader of * a transient tree. * * * Outputs: * ------- * RETURN = True if the window(s) overlaps anther window. * *************************************<->***********************************/ Boolean CheckIfClientObscuringAny (ClientData *pcd) { Boolean obscuring = False; ClientListEntry *pListEntry; pListEntry = (pcd->clientState == MINIMIZED_STATE) ? &pcd->iconEntry : &pcd->clientEntry; while (pListEntry && !obscuring) { if ((pListEntry->pCD != pcd) && (((pListEntry->type == MINIMIZED_STATE) && (pListEntry->pCD->clientState == MINIMIZED_STATE)) || ((pListEntry->type != MINIMIZED_STATE) && (pListEntry->pCD->clientState != MINIMIZED_STATE)))) { obscuring = CheckIfClientObscuring (pcd, pListEntry->pCD); } pListEntry = pListEntry->nextSibling; } return (obscuring); } /* END OF FUNCTION CheckIfClientObscuringAny */ /*************************************<->************************************* * * SetupSystemModalState (pCD) * * * Description: * ----------- * This function prepares for mapping a system modal window. An input * screen window is mapped below the system modal window to prevent input * to the windows not related to the system modal window. * * * Inputs: * ------ * pCD = pointer to client data for the system modal window; if NULL the * system modal window is a special window manager dialog box * * * Outputs: * ------- * wmGD = changes to system modal state data * *************************************<->***********************************/ void SetupSystemModalState (ClientData *pCD) { XWindowChanges windowChanges; unsigned int width, height; unsigned int x_hot, y_hot; unsigned char *bits; unsigned char *mask_bits; WmScreenData *pSD; int scr; /* * If we've got a menu active, then unpost it first * so that grabs from the menu don't interfere with * the system modal dialog. We want to avoid lock-ups. */ if (wmGD.menuActive != NULL) { UnpostMenu (wmGD.menuActive); XSync (DISPLAY, False); } /* * Try to grab the pointer and keyboard. If either * fails because event processing is frozen by another grab, then * don't do system modal for fear of leaving the system unusable. */ if (XGrabPointer(DISPLAY, ROOT_FOR_CLIENT(pCD), FALSE, /* owner_events */ (unsigned int) 0, /* event mask */ GrabModeAsync, /* pointer_mode */ GrabModeAsync, /* keyboard_mode */ None, /* confine_to window */ None, /* cursor */ CurrentTime) == GrabFrozen) { return; } else { XUngrabPointer (DISPLAY, CurrentTime); } if (XGrabKeyboard(DISPLAY, ROOT_FOR_CLIENT(pCD), FALSE, /* owner_events */ GrabModeAsync, /* pointer_mode */ GrabModeAsync, /* keyboard_mode */ CurrentTime) == GrabFrozen) { return; } else { XUngrabKeyboard (DISPLAY, CurrentTime); } #ifdef LARGECURSORS if (wmGD.useLargeCursors) { width = noenter32_width; height = noenter32_height; x_hot = noenter32_x_hot; y_hot = noenter32_y_hot; bits = noenter32_bits; mask_bits = noenter32m_bits; } else #endif /* LARGECURSORS */ { width = noenter16_width; height = noenter16_height; x_hot = noenter16_x_hot; y_hot = noenter16_y_hot; bits = noenter16_bits; mask_bits = noenter16m_bits; } for (scr=0; scrmanaged && pSD->inputScreenWindow == 0) { XSetWindowAttributes windowAttributes; Pixmap pixmap; Pixmap maskPixmap; XColor xcolors[2]; windowAttributes.event_mask = ButtonPressMask; if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) { windowAttributes.event_mask |= EnterWindowMask; } windowAttributes.override_redirect = True; pixmap = XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)bits, width, height); maskPixmap = XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)mask_bits, width, height); xcolors[0].pixel = BlackPixel (DISPLAY, pSD->screen); xcolors[1].pixel = WhitePixel (DISPLAY, pSD->screen); XQueryColors (DISPLAY, DefaultColormap (DISPLAY, pSD->screen), xcolors, 2); windowAttributes.cursor = XCreatePixmapCursor (DISPLAY, pixmap, maskPixmap, &(xcolors[0]), &(xcolors[1]), x_hot, y_hot); XFreePixmap (DISPLAY, pixmap); XFreePixmap (DISPLAY, maskPixmap); pSD->inputScreenWindow = XCreateWindow (DISPLAY, pSD->rootWindow, 0, 0, DisplayWidth (DISPLAY, pSD->screen), DisplayHeight (DISPLAY, pSD->screen), 0, 0, InputOnly, CopyFromParent, CWEventMask | CWOverrideRedirect | CWCursor, &windowAttributes); } if (pSD->managed && pSD != ACTIVE_PSD) { XMapRaised (DISPLAY, pSD->inputScreenWindow); } } if (pCD) { wmGD.systemModalWindow = pCD->clientFrameWin; } else { /* * ELSE: the system modal window is a special window manager dialog * box and wmGD.systemModalWindow is set prior to the call to * SetupSystemModalState. Set the focus to the special window manager * dialog box. */ SetKeyboardFocus (NULL, REFRESH_LAST_FOCUS); XSetInputFocus (DISPLAY, wmGD.systemModalWindow, RevertToPointerRoot, CurrentTime); } /* * Map the system modal input screen window below the system modal * window. */ windowChanges.sibling = wmGD.systemModalWindow; windowChanges.stack_mode = Below; XConfigureWindow (DISPLAY, ACTIVE_PSD->inputScreenWindow, CWSibling | CWStackMode, &windowChanges); XMapWindow (DISPLAY, ACTIVE_PSD->inputScreenWindow); /* * Setup the system modal global data. */ wmGD.systemModalActive = True; wmGD.systemModalClient = pCD; } /* END OF FUNCTION SetupSystemModalState */ /*************************************<->************************************* * * UndoSystemModalState () * * * Description: * ----------- * This function cleans up after a system modal window goes away. * * * Inputs: * ------ * wmGD = (system modal state data) * * * Outputs: * ------- * wmGD = changes to system modal state data * *************************************<->***********************************/ void UndoSystemModalState (void) { int scr; /* * Unmap the system modal input screen window. */ for (scr = 0; scr < wmGD.numScreens; scr++) { if(wmGD.Screens[scr].managed) { XUnmapWindow (DISPLAY, wmGD.Screens[scr].inputScreenWindow); } } /* * Reset the focus if a window manager system modal dialog box was * being displayed. */ if (!wmGD.systemModalClient) { AutoResetKeyFocus (NULL, GetTimestamp()); } /* * Reset the system modal global data. */ wmGD.systemModalActive = False; wmGD.systemModalClient = NULL; wmGD.systemModalWindow = 0; } /* END OF FUNCTION UndoSystemModalState */ /*************************************<->************************************* * * FindClientNameMatch (pStartingEntry, toNext, clientName, types) * * * Description: * ----------- * This function searches for a client that has a particular name or class. * A match will be indicated if the client with the name or class also * is in a particular state. * * * Inputs: * ------ * pEntry = pointer to the client list entry where the search is * to begin. * * toNext = if True then search client list from first to last; otherwise * search the client list last to first. * * clientName = string that indicates a client name or class. * * type = types of objects (icon, window, ...) that are to be matched. * * * Outputs: * ------- * RETURN = pointer to client list entry for matched client. * *************************************<->***********************************/ ClientListEntry * FindClientNameMatch (ClientListEntry *pEntry, Boolean toNext, String clientName, unsigned long types) { Boolean foundMatch = False; Boolean checkEntry; ClientData *pCD; while (!foundMatch && pEntry) { checkEntry = False; pCD = pEntry->pCD; if (pEntry->type == MINIMIZED_STATE) { if ((pCD->clientState == MINIMIZED_STATE) && (types & F_GROUP_ICON)) { checkEntry = True; } } else { if ((pCD->clientState != MINIMIZED_STATE) && (types & F_GROUP_WINDOW)) { checkEntry = True; } } if (checkEntry && ((pCD->clientName && (strcmp (clientName,pCD->clientName) == 0)) || (pCD->clientClass && (strcmp (clientName,pCD->clientClass) == 0)))) { foundMatch = True; } else { pEntry = (toNext) ? pEntry->nextSibling : pEntry->prevSibling; } } return (pEntry); } /* END OF FUNCTION FindClientNameMatch */ #ifdef WSM /*************************************<->************************************* * * BumpPrimaryToTop (pcdLeader) * * * Description: * ----------- * This function moves the primary window to the "top" of the transient * tree. * * Inputs: * ------ * pcdLeader = pointer to client data of transient tree root. * * Returns: True if stacking order of leader window changed. * False if not stacking change. * * Comments: * --------- * This affects only the clientData structures. There is no immediate * effect on the actual stacking order on the display. That is done * by StackWindow and/or RestackTransients. * *************************************<->***********************************/ Boolean BumpPrimaryToTop (ClientData *pcdLeader) { int count; Boolean rval; count = CountTransientChildren (pcdLeader); if (pcdLeader->primaryStackPosition != (count-1)) { pcdLeader->primaryStackPosition = count - 1; rval = True; } else { rval = False; } return (rval); } /*************************************<->************************************* * * BumpPrimaryToBottom (pcdLeader) * * * Description: * ----------- * This function moves the primary window to the "bottom" of the transient * tree. * * Inputs: * ------ * pcdLeader = pointer to client data of transient tree root. * * Returns: True if stacking order of leader window changed. * False if not stacking change. * * Comments: * --------- * This affects only the clientData structures. There is no immediate * effect on the actual stacking order on the display. That is done * by StackWindow and/or RestackTransients. * *************************************<->***********************************/ Boolean BumpPrimaryToBottom (ClientData *pcdLeader) { Boolean rval; if (pcdLeader->primaryStackPosition != 0) { pcdLeader->primaryStackPosition = 0; rval = True; } else { rval = False; } return (rval); } /*************************************<->************************************* * * LowestWindowInTransientFamily (pcdLeader) * * * Description: * ----------- * This function returns the lowest stacked window in a transient * tree family. * * Inputs: * ------ * pcdLeader = pointer to client data of leader of a transient tree * * Returns: id of lowest window in the transient tree for this family * *************************************<->***********************************/ Window LowestWindowInTransientFamily (ClientData *pcdLeader) { int count; static int size = 0; static Window *windows = NULL; Window wReturn = None; /* * Build a window list */ count = CountTransientChildren (pcdLeader); if (count > size) { /* * Expand the (static) windows buffer */ if (!(windows = (Window *)WmMalloc ((char*)windows, (count + 5) * sizeof (Window)))) { /* cannot get memory space */ size = 0; return; } size = count + 5; } MakeTransientFamilyStackingList (windows, pcdLeader); if (count > 0) { wReturn = windows[count-1]; } else { wReturn = None; } return (wReturn); } /* END OF FUNCTION LowestWindowInTransientFamily */ /*************************************<->************************************* * * FindSubLeaderToTop (pcd) * * * Description: * ----------- * This function identifies a candidate window to top within the * transient tree that is a local transient leader (the window has * transients hanging off of it, too). * * * Inputs: * ------ * pcd = pointer to client data of a transient leader window * * Return: ptr to client data for client that should be topped, or NULL * * * Comments: * -------- * *************************************<->***********************************/ ClientData * FindSubLeaderToTop ( ClientData *pcd) { ClientData *pcdRet = NULL; ClientData *pcdNext; pcdNext = pcd->transientChildren; while (pcdNext && (!pcdRet)) { if (pcdNext->transientChildren) { if (LeaderOnTop (pcdNext)) { pcdRet = pcdNext; } else { pcdRet = FindSubLeaderToTop (pcdNext); } } pcdNext = pcdNext->transientSiblings; } return (pcdRet); } /*************************************<->************************************* * * MakeTransientFamilyStackingList (windows, pcdLeader) * * * Description: * ----------- * This function makes a transient window list of windows in the * transient window tree headed by the specified client. * * * Inputs: * ------ * windows = pointer to the windows list to be filled out * * pcdLeader = pointer to client data of a window in a transient tree * * Outputs: * ------- * The windows array is modified. * * Comments: * -------- * This function puts the transient leader window in the list in the * right place. * *************************************<->***********************************/ void MakeTransientFamilyStackingList ( Window *windows, ClientData *pcdLeader) { ClientData *pcdNext, *pcdSub; Window *nextWindow, wSave, wTemp, wTop; int count = CountTransientChildren (pcdLeader); register int i, j; /* * Construct the transient stacking list according to * normal Motif rules. */ nextWindow = MakeTransientWindowList (windows, pcdLeader); if (!(pcdLeader->secondariesOnTop)) { /* * If the leader window shouldn't be on the bottom , then * adjust the stacking of the list. */ if ((pcdLeader->primaryStackPosition > 0) && (pcdLeader->primaryStackPosition < count)) { for (i=0; iprimaryStackPosition; i++) { j = count - i - 1; windows[j] = windows[j-1]; } j = count - pcdLeader->primaryStackPosition - 1; windows[j] = pcdLeader->clientFrameWin; } else { /* * Put the leader at the bottom. */ *nextWindow = pcdLeader->clientFrameWin; /* * If one of the transients is also a local leader * and wants to be on top, then adjust the list. */ pcdSub = FindSubLeaderToTop (pcdLeader); if (pcdSub && (pcdSub->clientFrameWin != None)) { /* insert this window at top */ wTop = wSave = pcdSub->clientFrameWin; /* shuffle the rest down */ for (i=0; iclientFrameWin; } } /* END OF FUNCTION MakeTransientFamilyStackingList */ /*************************************<->************************************* * * NormalizeTransientTreeStacking (pcdLeader) * * * Description: * ----------- * This function traverses the transient tree and cleans up any * local primary windows that are above their respective secondary * windows. * * * Inputs: * ------ * pcdLeader = pointer to client data of a transient tree leader * * Return: True if any changes in stacking order were made * * * Comments: * -------- * This only touches the data structures. * *************************************<->***********************************/ Boolean NormalizeTransientTreeStacking ( ClientData *pcdLeader) { ClientData *pcdNext; Boolean bChanged = False; pcdNext = pcdLeader->transientChildren; bChanged = BumpPrimaryToBottom (pcdLeader); while (pcdNext) { if (pcdNext->transientChildren) { bChanged |= BumpPrimaryToBottom (pcdNext); bChanged |= NormalizeTransientTreeStacking (pcdNext); } pcdNext = pcdNext->transientSiblings; } return (bChanged); } /*************************************<->************************************* * * LeaderOnTop (pcdLeader) * * * Description: * ----------- * This function tests a leader of a transient (sub) tree to see if * it should be on top of its transient windows. * * * Inputs: * ------ * pcdLeader = pointer to client data of a transient tree leader * * Return: True if this leader is on top of its transients * * * Comments: * -------- * *************************************<->***********************************/ Boolean LeaderOnTop ( ClientData *pcdLeader) { Boolean bOnTop = False; int count = CountTransientChildren (pcdLeader); if ((pcdLeader->primaryStackPosition > 0) && (pcdLeader->primaryStackPosition < count)) { bOnTop = True; } return (bOnTop); } #endif /* WSM */ motif-2.3.8/clients/mwm/WmImage.h0000644000175000017500000000314513145162623013531 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.2 */ extern char *BitmapPathName (char *string); #ifdef WSM extern int GetBitmapIndex (WmScreenData *pSD, char *name, Boolean bReportError); #else /* WSM */ extern int GetBitmapIndex (WmScreenData *pSD, char *name); #endif /* WSM */ extern Pixmap MakeCachedIconPixmap (ClientData *pCD, int bitmapIndex, Pixmap mask); extern Pixmap MakeCachedLabelPixmap (WmScreenData *pSD, Widget menuW, int bitmapIndex); extern Pixmap MakeClientIconPixmap (ClientData *pCD, Pixmap iconBitmap, Pixmap iconMask); extern Pixmap MakeIconPixmap (ClientData *pCD, Pixmap bitmap, Pixmap mask, unsigned int width, unsigned int height, unsigned int depth); extern Pixmap MakeNamedIconPixmap (ClientData *pCD, String iconName); motif-2.3.8/clients/mwm/version.c0000644000175000017500000000235113145162623013661 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: version.c /main/14 1999/10/12 09:32:45 mgreess $" #endif #endif #ifndef lint #define osfversion() \ static char _motif_version[] = "@(#)Motif mwm 2.3.4 Release"; #else /* lint */ #define osfversion() #endif /* lint */ osfversion() motif-2.3.8/clients/mwm/WmIconBox.c0000644000175000017500000025140413145162623014046 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmIconBox.c /main/7 1999/05/20 16:35:12 mgreess $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #ifdef WSM #include "WmHelp.h" #endif /* WSM */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MWM_NEED_IIMAGE #define MWM_NEED_GREYED75 #define MWM_NEED_SLANT2 #include "WmIBitmap.h" #include "WmResNames.h" #include /* * include extern functions */ #include "WmIconBox.h" #include "WmCDInfo.h" #include "WmError.h" #include "WmEvent.h" #include "WmFunction.h" #include "WmIDecor.h" #include "WmIPlace.h" #include "WmImage.h" #ifdef PANELIST #include "WmPanelP.h" /* for typedef in WmManage.h */ #endif /* PANELIST */ #include "WmManage.h" #include "WmMenu.h" #include "WmResParse.h" #include "WmResource.h" #include "WmWinInfo.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif /* * Global Variables: */ Pixel select_color; Pixmap greyedPixmap; int frameShadowThickness; int firstTime = 1; Cardinal insertPosition = 0; #define DEFAULT_ICON_BOX_TITLE "Icons" Const char *szhorizontal = "horizontal"; Const char *szvertical = "vertical"; /*************************************<->************************************* * * InitIconBox (pSD) * * * Description: * ----------- * This function controls creation of icon boxes * * *************************************<->***********************************/ void InitIconBox (WmScreenData *pSD) { #ifdef WSM int iws; #endif /* WSM */ /* * Start the process of making the icon boxes */ #ifdef WSM /* * Manage a separate icon box in every workspace * on this screen. */ for (iws = 0; iws < pSD->numWorkspaces; iws++) { AddIconBoxForWorkspace (&pSD->pWS[iws]); } #else /* WSM */ ManageWindow (pSD, None, MANAGEW_ICON_BOX); #endif /* WSM */ if (pSD->fadeNormalIcon) { MakeFadeIconGC (pSD); } } /* END OF FUNCTION InitIconBox */ #ifdef WSM /*************************************<->************************************* * * AddIconBoxForWorkspace (pWS) * * * Description: * ----------- * This function adds an iconbox to a workspace * * *************************************<->***********************************/ void AddIconBoxForWorkspace (WmWorkspaceData *pWS) { extern WmWorkspaceData *pIconBoxInitialWS; pIconBoxInitialWS = pWS; ManageWindow (pWS->pSD, NULL, MANAGEW_ICON_BOX); } /* END OF FUNCTION AddIconBoxForWorkspace */ #endif /* WSM */ /*************************************<->************************************* * * MakeIconBox (pWS, pCD); * * * Description: * ----------- * * * * Inputs: * ------ * pWS = pointer to workspace data * pCD = a pointer to ClientData * * * Outputs: * ------- * * Return = (Boolean) True iff successful. * * * Comments: * -------- * If fails, frees the ClientData structure pointed to by pCD. * *************************************<->***********************************/ Boolean MakeIconBox (WmWorkspaceData *pWS, ClientData *pCD) { IconBoxData *pIBD; /* * Make an icon box and return the pCD */ if (pCD) { if (!(pIBD = (IconBoxData *)XtMalloc (sizeof (IconBoxData)))) { /* * We need a pointer to icon box data to add to the * list of icon boxes linked to pWS->pIconBox. If * we can't allocate space we need to free the space * allocated for the ClientData structure */ Warning (((char *)GETMESSAGE(36, 1, "Insufficient memory to create icon box data"))); XtFree ((char *)pCD); return (FALSE); } InitializeIconBoxData (pWS, pIBD); InitializeClientData (pCD, pIBD); if (!(pIBD->IPD.placeList = (IconInfo *)XtMalloc (pIBD->IPD.totalPlaces * sizeof (IconInfo)))) { Warning (((char *)GETMESSAGE(36, 2, "Insufficient memory to create icon box data"))); XtFree ((char *)pIBD); XtFree ((char *)pCD); return (FALSE); } memset (pIBD->IPD.placeList, 0, pIBD->IPD.totalPlaces * sizeof (IconInfo)); /* * Make the top level shell for this icon box */ MakeShell (pWS, pIBD); /* * Make the scrolled window for this icon box */ MakeScrolledWindow (pWS, pIBD); /* * Make the row column manager for this icon box */ MakeBulletinBoard (pWS, pIBD); /* * Realize the widget tree and set client data fields */ RealizeIconBox (pWS, pIBD, pCD); /* * Link the new icon box to list of icon boxes */ AddNewBox (pWS, pIBD); } return (TRUE); } /* END OF FUNCTION MakeIconBox */ #ifdef WSM /*************************************<->************************************* * * DestroyIconBox (pWS) * * * Description: * ----------- * Destroys an icon box * * * Inputs: * ------ * pWS = pointer to workspace data * * * Outputs: * ------- * * Return = none * * * Comments: * -------- * Used when deleting a workspace * Should be called AFTER all clients have been removed from the * workspace -- there should be no icons in the icon box. * *************************************<->***********************************/ void DestroyIconBox (WmWorkspaceData *pWS) { IconBoxData *pIBD; pIBD = pWS->pIconBox; XtDestroyWidget (pIBD->shellWidget); UnManageWindow (pIBD->pCD_iconBox); XtFree ((char *) pIBD); } /* END OF FUNCTION DestroyIconBox */ #endif /* WSM */ /*************************************<->************************************* * * MakeShell (pWS, pIBD) * * * Description: * ----------- * * * * Inputs: * ------ * pWS = pointer to workspace data * * pIBD = pointer to IconBoxData * * XXinput = ... * * * Outputs: * ------- * * pIBD->shellWidget * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void MakeShell (WmWorkspaceData *pWS, IconBoxData *pIBD) { Arg setArgs[20]; int i; #ifdef WSM char *pchIBTitle = NULL; #endif /* WSM */ /* * Create top level application shell for icon box */ i=0; XtSetArg (setArgs[i], XmNallowShellResize, (XtArgVal)True); i++; XtSetArg (setArgs[i], XmNborderWidth, (XtArgVal)0); i++; XtSetArg (setArgs[i], XmNkeyboardFocusPolicy, (XtArgVal)XmEXPLICIT); i++; #ifndef WSM if (!(Monochrome (XtScreen (pWS->pSD->screenTopLevelW)))) { XtSetArg (setArgs[i], XmNbackground, (XtArgVal) pWS->pSD->clientAppearance.background ); i++; XtSetArg (setArgs[i], XmNforeground, (XtArgVal) pWS->pSD->clientAppearance.foreground ); i++; } #else /* WSM */ if (pWS->pSD->iconBoxTitle) { pchIBTitle = WmXmStringToString (pWS->pSD->iconBoxTitle); XtSetArg (setArgs[i], XmNtitle, (XtArgVal)pchIBTitle); i++; XtSetArg (setArgs[i], XmNiconName, (XtArgVal)pchIBTitle); i++; } #endif /* WSM */ XtSetArg (setArgs[i], XmNmappedWhenManaged, (XtArgVal)False); i++; XtSetArg (setArgs[i], XmNdialogStyle, (XtArgVal)XmDIALOG_MODELESS); i++; XtSetArg (setArgs[i], XmNdepth, (XtArgVal) DefaultDepth (DISPLAY, pWS->pSD->screen)); i++; XtSetArg (setArgs[i], XmNscreen, (XtArgVal) ScreenOfDisplay (DISPLAY, pWS->pSD->screen)); i++; #ifdef WSM pIBD->shellWidget = (Widget) XtCreatePopupShell (WmNclient, topLevelShellWidgetClass, pWS->workspaceTopLevelW, (ArgList)setArgs, i); if (pchIBTitle != NULL) XtFree (pchIBTitle); #else /* WSM */ pIBD->shellWidget = (Widget) XtCreatePopupShell (WmNiconBox, topLevelShellWidgetClass, pWS->workspaceTopLevelW, (ArgList)setArgs, i); #endif /* WSM */ } /* END OF FUNCTION MakeShell */ /*************************************<->************************************* * * MakeScrolledWindow (pWS, pIBD) * * * Description: * ----------- * * * * Inputs: * ------ * pWS = pointer to workspace data * pIBD = pointer to IconBoxData * XXinput = ... * * * Outputs: * ------- * * Return = pIBD with the pIBD->scrolledWidget set * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void MakeScrolledWindow (WmWorkspaceData *pWS, IconBoxData *pIBD) { Arg setArgs[20]; int i; /* * Create frame widget to give the scrolled window * an external bevel */ i=0; #ifndef WSM /* if (!(Monochrome (XtScreen (pWS->pSD->screenTopLevelW)))) { XtSetArg (setArgs[i], XmNbackground, (XtArgVal) pWS->pSD->clientAppearance.background ); i++; XtSetArg (setArgs[i], XmNforeground, (XtArgVal) pWS->pSD->clientAppearance.foreground ); i++; } */ #endif /* WSM */ XtSetArg (setArgs[i], XmNborderWidth, (XtArgVal) 0 ); i++; XtSetArg (setArgs[i], XmNmarginWidth, (XtArgVal) 0 ); i++; XtSetArg (setArgs[i], XmNmarginHeight, (XtArgVal) 0 ); i++; XtSetArg (setArgs[i], XmNshadowType, (XtArgVal) XmSHADOW_OUT); i++; XtSetArg (setArgs[i], XmNshadowThickness, (XtArgVal) frameShadowThickness); i++; pIBD->frameWidget = XtCreateManagedWidget ("IBframe", xmFrameWidgetClass, pIBD->shellWidget, (ArgList)setArgs, i); #ifdef WSM XtAddCallback (pIBD->frameWidget, XmNhelpCallback, WmDtWmTopicHelpCB, WM_DT_ICONBOX_TOPIC); #endif /* WSM */ /* * Create scrolled window to hold row column manager */ i=0; XtSetArg (setArgs[i], XmNscrollingPolicy , (XtArgVal) XmAUTOMATIC ); i++; XtSetArg (setArgs[i], XmNborderWidth , (XtArgVal) 0 ); i++; XtSetArg (setArgs[i], XmNspacing , (XtArgVal) IB_MARGIN_WIDTH ); i++; #ifndef WSM if (!(Monochrome (XtScreen (pWS->pSD->screenTopLevelW)))) { XtSetArg (setArgs[i], XmNbackground, (XtArgVal) pWS->pSD->clientAppearance.background ); i++; XtSetArg (setArgs[i], XmNforeground, (XtArgVal) pWS->pSD->clientAppearance.foreground ); i++; } #endif /* WSM */ /* * do we want to get these from a resource or set it here * to control the appearance of the iconBox */ XtSetArg (setArgs[i], XmNscrolledWindowMarginWidth, (XtArgVal) 3); i++; XtSetArg (setArgs[i], XmNscrolledWindowMarginHeight, (XtArgVal) 3); i++; XtSetArg (setArgs[i], XmNshadowThickness, (XtArgVal) FRAME_EXTERNAL_SHADOW_WIDTH); i++; XtSetArg (setArgs[i], XmNscrollBarDisplayPolicy,(XtArgVal) XmSTATIC ); i++; XtSetArg (setArgs[i], XmNvisualPolicy, (XtArgVal) XmVARIABLE ); i++; pIBD->scrolledWidget = XtCreateManagedWidget ("IBsWindow", xmScrolledWindowWidgetClass, pIBD->frameWidget, (ArgList)setArgs, i); #ifndef MOTIF_ONE_DOT_ONE XtAddCallback(pIBD->scrolledWidget, XmNtraverseObscuredCallback, (XtCallbackProc) IconScrollVisibleCallback, (caddr_t)NULL); #endif XtAddEventHandler(pIBD->scrolledWidget, StructureNotifyMask, False, (XtEventHandler)UpdateIncrements, (XtPointer) pIBD); } /* END OF FUNCTION MakeScrolledWindow */ /*************************************<->************************************* * * MakeBulletinBoard (pWS, pIBD) * * * Description: * ----------- * * * * Inputs: * ------ * pWS = pointer to workspace data * pIBD = pointer to IconBoxData * * XXinput = ... * * * Outputs: * ------- * * Return = pIBD with the pIBD->bBoardWidget * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void MakeBulletinBoard (WmWorkspaceData *pWS, IconBoxData *pIBD) { int i; Arg setArgs[20]; /* * Create bulletin board to hold icons */ i=0; #ifdef DEBUG_ICON_BOX XtSetArg (setArgs[i], XmNborderWidth , 1); i++; #else XtSetArg (setArgs[i], XmNborderWidth , 0); i++; #endif /* DEBUG_ICON_BOX */ XtSetArg (setArgs[i], XmNshadowThickness,(XtArgVal) 0); i++; #ifndef WSM if (!(Monochrome (XtScreen (pWS->pSD->screenTopLevelW)))) { XtSetArg (setArgs[i], XmNforeground, (XtArgVal) pWS->pSD->clientAppearance.background ); i++; XtSetArg (setArgs[i], XmNbottomShadowColor, (XtArgVal) pWS->pSD->clientAppearance.bottomShadowColor ); i++; XtSetArg (setArgs[i], XmNtopShadowColor, (XtArgVal) pWS->pSD->clientAppearance.topShadowColor ); i++; } #endif /* WSM */ XtSetArg (setArgs[i], XmNspacing , 0); i++; XtSetArg (setArgs[i], XmNmarginHeight , 0); i++; XtSetArg (setArgs[i], XmNmarginWidth , 0); i++; XtSetArg (setArgs[i], XmNdialogStyle, (XtArgVal) XmDIALOG_WORK_AREA); i++; XtSetArg (setArgs[i], XmNresizePolicy, (XtArgVal) XmRESIZE_NONE); i++; XtSetArg (setArgs[i], XmNdefaultPosition , (XtArgVal) False); i++; XtSetArg (setArgs[i], XtNinsertPosition , InsertPosition); i++; pIBD->bBoardWidget = XtCreateManagedWidget ("IBbBoard", xmBulletinBoardWidgetClass, pIBD->scrolledWidget, (ArgList)setArgs, i); } /* END OF FUNCTION MakeBulletinBoard */ /*************************************<->************************************* * * RealizeIconBox (pWS, pIBD, pCD) * * * Description: * ----------- * * * * Inputs: * ------ * pWS = pointer to workspace data * * pIBD = pointer to IconBoxData * * pCD = pointer to ClientData * * * Outputs: * ------- * * Return = pIBD with the pIBD->shellWin set * Return = pIBD with the pIBD->scrolledWin set * Return = pIBD with the pIBD->bBoardWin set * * Return = pCD with appropriate fields set * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void RealizeIconBox (WmWorkspaceData *pWS, IconBoxData *pIBD, ClientData *pCD) { int i; Arg getArgs[10]; Arg setArgs[2]; Widget clipWidget; Pixmap bgPixmap; Pixmap defaultImage; XtRealizeWidget (pIBD->shellWidget); pCD->client = XtWindow (pIBD->shellWidget); /* * This will set the scrolling granularity for the icon box */ SetGeometry (pWS, pCD, pIBD); /* * Point to the iconBox */ pIBD->pCD_iconBox = pCD; pCD->thisIconBox = pIBD; /* * get the background color of the bulletin board for * greyed icon work */ i=0; XtSetArg (setArgs[i], XmNbackground, (XtArgVal) select_color ); i++; XtSetValues (pIBD->bBoardWidget, (ArgList) setArgs, i); i=0; XtSetArg (getArgs[i], XmNbackgroundPixmap, (XtArgVal) &bgPixmap ); i++; XtGetValues (pIBD->bBoardWidget, getArgs, i); i=0; XtSetArg (getArgs[i], XmNclipWindow, (XtArgVal) &clipWidget ); i++; XtGetValues (pIBD->scrolledWidget, getArgs, i); /* * Set the background of the clip window for the scrolled * window so the default widget background doesn't flash */ i = 0; XtSetArg(setArgs[i], XmNbackground, (XtArgVal) select_color); i++; XtSetValues (clipWidget, (ArgList) setArgs, i); /* * Save the clipWidget id to use in constraining icon moves in box */ pIBD->clipWidget = clipWidget; MakeShrinkWrapIconsGC (pWS->pSD, bgPixmap); if (pWS->pSD->iconDecoration & ICON_IMAGE_PART) { /* * Make a pixmap to use when iconWindows are unmapped */ defaultImage = XCreateBitmapFromData (DISPLAY, pWS->pSD->rootWindow, (char*)iImage_bits, iImage_width, iImage_height); pWS->pSD->defaultPixmap = MakeIconPixmap (pCD, defaultImage, None, iImage_width, iImage_height, 1); } } /* END OF FUNCTION RealizeIconBox */ /*************************************<->************************************* * * AddNewBox (pWS, pIBD) * * * Description: * ----------- * * * * Inputs: * ------ * pWS = pointer to workspace data * * pIBD = pointer to IconBoxData * * * Outputs: * ------- * * * Comments: * -------- * Finds the last iconbox on the list starting at pWS->pIconBox and * adds the new icon box to the end of the list. * *************************************<->***********************************/ void AddNewBox (WmWorkspaceData *pWS, IconBoxData *pIBD) { IconBoxData *pibd; if (pWS->pIconBox) { pibd = pWS->pIconBox; while (pibd->pNextIconBox) { pibd = pibd->pNextIconBox; } pibd->pNextIconBox = pIBD; } else { pWS->pIconBox = pIBD; } } /* END OF FUNCTION AddNewBox */ /*************************************<->************************************* * * InitializeIconBoxData (pWS, pIBD) * * * Description: * ----------- * * * * Inputs: * ------ * pWS = pointer to Workspace Data * * pIBD = pointer to IconBoxData * * * Outputs: * ------- * * * Comments: * -------- * Initializes all pIBD fields to NULL * *************************************<->***********************************/ void InitializeIconBoxData (WmWorkspaceData *pWS, IconBoxData *pIBD) { int mask; int X; int Y; unsigned int width; unsigned int height; int sW, sH; frameShadowThickness = FRAME_INTERNAL_SHADOW_WIDTH; pIBD->numberOfIcons = 0; pIBD->currentRow = 0; pIBD->currentCol = 0; pIBD->lastRow = 0; pIBD->lastCol = 0; pIBD->IPD.placeList = NULL; pIBD->scrolledWidget = NULL; pIBD->bBoardWidget = NULL; pIBD->clipWidget = NULL; #ifdef WSM pIBD->wsID = pWS->id; #endif /* WSM */ ToLower ((unsigned char *) pWS->pSD->iconBoxSBDisplayPolicy); if (!((!strcmp(pWS->pSD->iconBoxSBDisplayPolicy , "all")) || (!strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szvertical)) || (!strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szhorizontal)))) { strcpy(pWS->pSD->iconBoxSBDisplayPolicy, "all"); } /* * this will be set by the iconPlacement resource if * iconBoxGeometry width and height are not specified */ #ifdef WSM if (pWS->iconBoxGeometry == NULL) /* not set by user */ #else /* WSM */ if (pWS->pSD->iconBoxGeometry == NULL) /* not set by user */ #endif /* WSM */ { /* * Use the iconPlacement resource */ if (pWS->pSD->iconPlacement & (ICON_PLACE_TOP_PRIMARY | ICON_PLACE_BOTTOM_PRIMARY)) { pIBD->IPD.iconPlacement = ICON_PLACE_TOP_PRIMARY; pIBD->IPD.placementCols = 1; pIBD->IPD.placementRows = 6; } else { pIBD->IPD.iconPlacement = ICON_PLACE_LEFT_PRIMARY; pIBD->IPD.placementCols = 6; pIBD->IPD.placementRows = 1; } } else { #ifdef WSM mask = XParseGeometry(pWS->iconBoxGeometry, &X, &Y, &width, &height); #else /* WSM */ mask = XParseGeometry(pWS->pSD->iconBoxGeometry, &X, &Y, &width, &height); #endif /* WSM */ if ((mask & WidthValue) && (width > 0)) { pIBD->IPD.placementCols = (int)width; } else { pIBD->IPD.placementCols = 6; } if ((mask & HeightValue) && (height > 0)) { pIBD->IPD.placementRows = (int)height; } else { pIBD->IPD.placementRows = 1; } /* * Set orientation */ if (pIBD->IPD.placementRows <= pIBD->IPD.placementCols) { pIBD->IPD.iconPlacement = ICON_PLACE_LEFT_PRIMARY; } else { pIBD->IPD.iconPlacement = ICON_PLACE_TOP_PRIMARY; } } /* * Override orientation if iconBoxSBDisplayPolicy is set to * horizontal or vertical */ if (!(strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szvertical))) { pIBD->IPD.iconPlacement = ICON_PLACE_LEFT_PRIMARY; } else if (!(strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szhorizontal))) { pIBD->IPD.iconPlacement = ICON_PLACE_TOP_PRIMARY; } /* * set initial size of placement space to size of screen */ sW = DisplayWidth (DISPLAY, pWS->pSD->screen) / pWS->pSD->iconWidth; sH = DisplayHeight (DISPLAY, pWS->pSD->screen) / pWS->pSD->iconHeight; pIBD->IPD.totalPlaces = sW * sH; pIBD->IPD.onRootWindow = False; /* * The icon box does not live in an icon box in this version */ pIBD->pNextIconBox =NULL; } /* END OF FUNCTION InitializeIconBoxData */ /*************************************<->************************************* * * SetIconBoxInfo (pWS, pCD) * * * Description: * ----------- * * Inputs: * ------ * pCD * * * Comments: * -------- * *************************************<->***********************************/ void SetIconBoxInfo (WmWorkspaceData *pWS, ClientData *pCD) { pCD->clientClass = WmCIconBox; pCD->clientName = pWS->pSD->iconBoxName; ProcessClientResources (pCD); } /* END OF FUNCTION SetIconBoxInfo */ /*************************************<->************************************* * * InitializeClientData (pCD) * * * Description: * ----------- * * * * Inputs: * ------ * pCD * * * Outputs: * ------- * * * Comments: * -------- * Initializes geometry, etc. fields * *************************************<->***********************************/ void InitializeClientData (ClientData *pCD, IconBoxData *pIBD) { pCD->internalBevel = (wmGD.frameStyle == WmSLAB) ? 0 : FRAME_INTERNAL_SHADOW_WIDTH; pCD->clientX = 0; pCD->clientY = 0; pCD->clientFlags |= ICON_BOX ; pCD->widthInc = pIBD->IPD.iPlaceW = ICON_WIDTH(pCD) + IB_SPACING + (2 * IB_MARGIN_WIDTH); pCD->heightInc = pIBD->IPD.iPlaceH = ICON_HEIGHT(pCD) + IB_SPACING + (2 * IB_MARGIN_HEIGHT); pCD->clientWidth = pIBD->IPD.placementCols * pCD->widthInc; pCD->clientHeight = pIBD->IPD.placementRows * pCD->heightInc; if (!(pCD->pSD->iconBoxTitle)) { #ifndef NO_MESSAGE_CATALOG pCD->pSD->iconBoxTitle = XmStringCreateLocalized(wmNLS.default_icon_box_title); #else pCD->pSD->iconBoxTitle = XmStringCreateLocalized(DEFAULT_ICON_BOX_TITLE); #endif } pCD->clientTitle = pCD->pSD->iconBoxTitle; pCD->iconTitle = pCD->pSD->iconBoxTitle; } /* END OF FUNCTION InitializeClientData */ /*************************************<->************************************* * * MakeShrinkWrapIconsGC (pSD, bgPixmap) * * * Description: * ----------- * Make an graphic context to shrink the icons in the icon box * box that are not in the MINIMIZED_STATE. * * * Inputs: * ------ * pSD - pointer to screen data * * Outputs: * ------- * Modifies global data * * Comments: * -------- * * *************************************<->***********************************/ void MakeShrinkWrapIconsGC (WmScreenData *pSD, Pixmap bgPixmap) { XtGCMask copyMask; if (!pSD->shrinkWrapGC) { pSD->shrinkWrapGC = XCreateGC (DISPLAY, pSD->rootWindow, 0, (XGCValues *) NULL); copyMask = ~0L; XCopyGC (DISPLAY, pSD->iconAppearance.inactiveGC, copyMask, pSD->shrinkWrapGC); if (bgPixmap != XmUNSPECIFIED_PIXMAP) { XSetTile (DISPLAY, pSD->shrinkWrapGC, bgPixmap); XSetFillStyle (DISPLAY, pSD->shrinkWrapGC, FillTiled); XSetBackground (DISPLAY, pSD->shrinkWrapGC, select_color); } else { XSetForeground (DISPLAY, pSD->shrinkWrapGC, select_color); } } } /* END OF FUNCTION MakeShrinkWrapIconsGC */ /*************************************<->************************************* * * MakeFadeIconGC (pSD) * * * Description: * ----------- * Make an graphic context for "greying" the icons in the icon * box that are not in the MINIMIZED_STATE. * * * Inputs: * ------ * pSD = pointer to screen data * * Outputs: * ------- * Modifies global data * * Comments: * -------- * * *************************************<->***********************************/ void MakeFadeIconGC (WmScreenData *pSD) { XtGCMask copyMask; static Pixmap tmpFontClipMask; pSD->fadeIconGC = XCreateGC (DISPLAY, pSD->rootWindow, 0, (XGCValues *) NULL); pSD->fadeIconTextGC = XCreateGC (DISPLAY, pSD->rootWindow, 0, (XGCValues *) NULL); copyMask = ~0L; XCopyGC (DISPLAY, pSD->iconAppearance.inactiveGC, copyMask, pSD->fadeIconGC); XCopyGC (DISPLAY, pSD->iconAppearance.inactiveGC, copyMask, pSD->fadeIconTextGC); tmpFontClipMask = XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char*)greyed75_bits, greyed75_width, greyed75_height); greyedPixmap = XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char*)slant2_bits, slant2_width, slant2_height); XSetStipple (DISPLAY, pSD->fadeIconTextGC, tmpFontClipMask); XSetFillStyle (DISPLAY, pSD->fadeIconTextGC, FillStippled); XSetStipple (DISPLAY, pSD->fadeIconGC, greyedPixmap); XSetFillStyle (DISPLAY, pSD->fadeIconGC, FillStippled); XSetForeground (DISPLAY, pSD->fadeIconGC, select_color); } /* END OF FUNCTION MakeFadeIconGC */ /*************************************<->************************************* * * SetGeometry (pWS, pCD, pIBD) * * * Description: * ----------- * * * * Inputs: * ------ * pIBD = pointer to IconBoxData * pCD = pointer to ClientData * XXinput = ... * * * Outputs: * ------- * * * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void SetGeometry (WmWorkspaceData *pWS, ClientData *pCD, IconBoxData *pIBD) { int i; Arg setArgs[10]; int mask; int X; int Y; unsigned int width; unsigned int height; unsigned int boxdim, tmpMin; int diff; unsigned long decoration; /* * Set horizontal and vertical scrolling granularity */ SetGranularity (pWS, pCD, pIBD ); /* * Set the initial width and height of the icon box bulletin board */ i=0; XtSetArg (setArgs[i], XmNwidth, (XtArgVal) pCD->clientWidth); i++; XtSetArg (setArgs[i], XmNheight, (XtArgVal) pCD->clientHeight); i++; XtSetValues (pIBD->bBoardWidget, (ArgList) setArgs, i); /* * Adjust icon box window height for height of * horizontal scroll bar etc. */ pCD->clientHeight = pCD->clientHeight + pCD->baseHeight; pCD->oldMaxHeight = pCD->maxHeight = pCD->clientHeight; /* * Adjust iconbox window width for width of * vertical scroll bar etc. */ pCD->clientWidth = pCD->clientWidth + pCD->baseWidth; pCD->oldMaxWidth = pCD->maxWidth = pCD->clientWidth; /* * Check that minWidth is large enough to disallow overlap * of title bar gadgets */ /* compute for minimum frame size */ if ((decoration = pCD->decor) & MWM_DECOR_TITLE) { boxdim = InitTitleBarHeight(pCD); /* macro not valid yet */ tmpMin = boxdim + ((decoration & MWM_DECOR_MENU) ? boxdim : 0) + ((decoration & MWM_DECOR_MINIMIZE) ? boxdim : 0) + ((decoration & MWM_DECOR_MAXIMIZE) ? boxdim : 0) - 2*(pCD->matteWidth); } else { tmpMin = 0; } /* Make: * minWidth >= tmpMin * minWidth >= max (baseWidth, widthInc) > 0 * & an integral number of widthInc from baseWidth. */ if (pCD->minWidth < tmpMin) { if ((diff = ((tmpMin - pCD->baseWidth)%pCD->widthInc)) != 0) { pCD->minWidth = tmpMin + pCD->widthInc - diff; } else { pCD->minWidth = tmpMin; } } if (pCD->minWidth < pCD->baseWidth) { pCD->minWidth = pCD->baseWidth; } if (pCD->minWidth == 0) { pCD->minWidth = pCD->widthInc; } else if ((diff = ((pCD->minWidth - pCD->baseWidth)%pCD->widthInc)) != 0) { pCD->minWidth += pCD->widthInc - diff; } if (pCD->clientWidth < pCD->minWidth) { pCD->clientWidth = pCD->minWidth; } pIBD->IPD.placementCols = (int)((pCD->clientWidth - pCD->baseWidth) / pCD->widthInc); /* * Make: * * maxWidth >= minWidth * & an integral number of widthInc from baseWidth. */ if (pCD->maxWidth < pCD->minWidth) { pCD->maxWidth = pCD->minWidth; } pCD->maxWidthLimit = pCD->maxWidth; pCD->maxWidth -= ((pCD->maxWidth - pCD->baseWidth)% pCD->widthInc); pCD->oldMaxWidth = pCD->maxWidth; pCD->maxHeightLimit = pCD->maxHeight; /* * Set the initial width and height of the icon box bulletin board */ i=0; XtSetArg (setArgs[i], XmNwidth, (XtArgVal) pCD->clientWidth - pCD->baseWidth ); i++; XtSetArg (setArgs[i], XmNheight, (XtArgVal) pCD->clientHeight - pCD->baseHeight ); i++; XtSetValues (pIBD->bBoardWidget, (ArgList) setArgs, i); /* * Set the initial width and height of the icon box scrolled Window */ i=0; XtSetArg (setArgs[i], XmNwidth, (XtArgVal) (pCD->clientWidth - (2 * frameShadowThickness))); i++; XtSetArg (setArgs[i], XmNheight, (XtArgVal) (pCD->clientHeight - (2 * frameShadowThickness))); i++; XtSetValues (pIBD->scrolledWidget, (ArgList) setArgs, i); /* * Call SetFrameInfo with fake X and Y so we can get clientOffset */ pCD->xBorderWidth = 0; SetFrameInfo (pCD); /* * Set initial placement of icon box */ #ifdef WSM mask = XParseGeometry(pWS->iconBoxGeometry, &X, &Y, &width, &height); #else /* WSM */ mask = XParseGeometry(pCD->pSD->iconBoxGeometry, &X, &Y, &width, &height); #endif /* WSM */ if (mask & XValue) { if (mask & XNegative) { pCD->clientX = X + DisplayWidth(DISPLAY, SCREEN_FOR_CLIENT(pCD)) - pCD->clientWidth - pCD->clientOffset.x; } else { pCD->clientX = X + pCD->clientOffset.x; } } else { pCD->clientX = pCD->clientOffset.x; } if (mask & YValue) { if (mask & YNegative) { pCD->clientY = Y + DisplayHeight(DISPLAY, SCREEN_FOR_CLIENT(pCD)) - pCD->clientHeight - pCD->clientOffset.x ; } else { pCD->clientY = Y + pCD->clientOffset.y; } } else { pCD->clientY = pCD->clientOffset.x + DisplayHeight(DISPLAY, SCREEN_FOR_CLIENT(pCD)) - pCD->clientHeight; } PlaceFrameOnScreen (pCD, &pCD->clientX, &pCD->clientY, pCD->clientWidth, pCD->clientHeight); pCD->clientX -= (wmGD.positionIsFrame ? pCD->clientOffset.x : 0); pCD->clientY -= (wmGD.positionIsFrame ? pCD->clientOffset.y : 0); i=0; XtSetArg (setArgs[i], XmNx, (XtArgVal) pCD->clientX); i++; XtSetArg (setArgs[i], XmNy, (XtArgVal) pCD->clientY); i++; XtSetValues (pIBD->shellWidget, (ArgList) setArgs, i); pCD->maxX = pCD->clientX; pCD->maxY = pCD->clientY; } /* END OF FUNCTION SetGeometry */ /*************************************<->************************************* * * SetGranularity (pWS, pCD, pIBD ) * * * Description: * ----------- * * * * Inputs: * ------ * pIBD = pointer to IconBoxData * pCD = pointer to ClientData * XXinput = ... * * * Outputs: * ------- * * * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void SetGranularity (WmWorkspaceData *pWS, ClientData *pCD, IconBoxData *pIBD) { int i; Dimension hScrollBarHeight = 0; Dimension hBarHeight = 0; Dimension vScrollBarWidth = 0; Dimension vBarWidth = 0; Dimension spacing; short shadowThickness; short marginWidth; short marginHeight; short hShighlightThickness; short vShighlightThickness; Arg setArgs[10]; Arg getArgs[10]; i=0; XtSetArg(getArgs[i], XmNspacing, (XtArgVal) &spacing ); i++; XtSetArg(getArgs[i], XmNshadowThickness, (XtArgVal) &shadowThickness); i++; XtSetArg(getArgs[i], XmNscrolledWindowMarginWidth, (XtArgVal) &marginWidth); i++; XtSetArg(getArgs[i], XmNscrolledWindowMarginHeight, (XtArgVal) &marginHeight); i++; XtSetArg (getArgs[i], XmNverticalScrollBar, (XtArgVal) &pIBD->vScrollBar); i++; XtSetArg(getArgs[i], XmNhorizontalScrollBar, (XtArgVal) &pIBD->hScrollBar); i++; XtGetValues (pIBD->scrolledWidget, getArgs, i); if (strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szvertical)) { /* * Set horizontal scrolling granularity */ i=0; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &hBarHeight ); i++; XtSetArg (getArgs[i], XmNhighlightThickness, (XtArgVal) &hShighlightThickness); i++; XtGetValues (pIBD->hScrollBar, getArgs, i); i=0; XtSetArg(setArgs[i], XmNincrement, (XtArgVal) pCD->widthInc); i++; XtSetArg (setArgs[i], XmNhighlightThickness , IB_HIGHLIGHT_BORDER); i++; XtSetArg(setArgs[i], XmNheight, (XtArgVal) (hBarHeight - (2 * hShighlightThickness)) + (2 * IB_HIGHLIGHT_BORDER)); i++; XtSetValues (pIBD->hScrollBar, (ArgList) setArgs, i); /* * Get hScrollBarHeight and troughColor */ i=0; XtSetArg (getArgs[i], XmNtroughColor, (XtArgVal) &select_color ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &hScrollBarHeight ); i++; XtGetValues (pIBD->hScrollBar, getArgs, i); } if (strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szhorizontal)) { /* * Set vertical scrolling granularity */ i=0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &vBarWidth ); i++; XtSetArg (getArgs[i], XmNhighlightThickness, (XtArgVal) &vShighlightThickness); i++; XtGetValues (pIBD->vScrollBar, getArgs, i); i=0; XtSetArg (setArgs[i], XmNincrement, (XtArgVal) pCD->heightInc); i++; XtSetArg (setArgs[i], XmNhighlightThickness , IB_HIGHLIGHT_BORDER); i++; XtSetArg(setArgs[i], XmNwidth, (XtArgVal) (vBarWidth - (2 * vShighlightThickness)) + (2 * IB_HIGHLIGHT_BORDER)); i++; XtSetValues (pIBD->vScrollBar, (ArgList) setArgs, i); /* * Get vScrollBarWidth */ i=0; XtSetArg (getArgs[i], XmNtroughColor, (XtArgVal) &select_color ); i++; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &vScrollBarWidth ); i++; XtGetValues (pIBD->vScrollBar, getArgs, i); } if (!strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szvertical)) { XtUnmanageChild(pIBD->hScrollBar); hScrollBarHeight = 0; i=0; XtSetArg (setArgs[i], XmNscrollBarDisplayPolicy, (XtArgVal) XmAS_NEEDED ); i++; XtSetValues (pIBD->scrolledWidget, (ArgList) setArgs, i); } else if (!strcmp(pWS->pSD->iconBoxSBDisplayPolicy , szhorizontal)) { XtUnmanageChild(pIBD->vScrollBar); vScrollBarWidth = 0; i=0; XtSetArg (setArgs[i], XmNscrollBarDisplayPolicy, (XtArgVal) XmAS_NEEDED ); i++; XtSetValues (pIBD->scrolledWidget, (ArgList) setArgs, i); } pCD->baseWidth = IB_SPACING + 2 * IB_HIGHLIGHT_BORDER #ifdef DEBUG_ICON_BOX + 2 + spacing #endif /* DEBUG_ICON_BOX */ + (int) vScrollBarWidth + 2 * frameShadowThickness + (int) 2 * marginWidth + (marginWidth > 0 ? 2 * (int) shadowThickness : shadowThickness); pCD->baseHeight = IB_SPACING + 2 * IB_HIGHLIGHT_BORDER #ifdef DEBUG_ICON_BOX + 2 #endif /* DEBUG_ICON_BOX */ + spacing + (int) hScrollBarHeight + 2 * frameShadowThickness + (int) 2 * marginHeight + (marginHeight > 0 ? 2 * (int) shadowThickness : shadowThickness); pCD->minWidth = pCD->baseWidth + pCD->widthInc; pCD->minHeight = pCD->baseHeight + pCD->heightInc; pCD->oldMaxWidth = pCD->maxWidth = pCD->minWidth; pCD->oldMaxHeight = pCD->maxHeight = pCD->minHeight; } /* END OF FUNCTION SetGranularity */ /*************************************<->************************************* * * GetIconBoxMenuItems () * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ MenuItem *GetIconBoxMenuItems (pSD) WmScreenData *pSD; { return(ParseMwmMenuStr (pSD, (unsigned char *)((char *)GETMESSAGE(36, 3, "\"Pack Icons\" _P Alt ShiftF7 f.pack_icons\n")))); } /* END OF FUNCTION GetIconBoxMenuItems */ /*************************************<->************************************* * * MapIconBoxes () * * * Description: * ----------- * * * * Inputs: * ------ * * * Outputs: * ------- * * * Comments: * -------- * Maps all iconboxes on the list starting at pWS->pIconBox * *************************************<->***********************************/ void MapIconBoxes (WmWorkspaceData *pWS) { IconBoxData *pibd; if (pWS->pIconBox) { pibd = pWS->pIconBox; while (pibd) { XtPopup(pibd->shellWidget, XtGrabNone); #ifndef WSM F_Raise (NULL, pibd->pCD_iconBox, (XEvent *)NULL); XMapWindow (DISPLAY, pibd->pCD_iconBox->clientFrameWin); #endif /* WSM */ pibd = pibd->pNextIconBox; } } } /* END OF FUNCTION MapIconBoxes */ #ifdef WSM /*************************************<->************************************* * * UnmapIconBoxes (pWS) * * * Description: * ----------- * Unmaps all the iconboxes in the specified workspace * * * Inputs: * ------ * pWS = pointer to workspace data * * Outputs: * ------- * * * Comments: * -------- * Unmaps all iconboxes on the list starting at pWS->pIconBox * Does not do anything with icon windows. * *************************************<->***********************************/ void UnmapIconBoxes (WmWorkspaceData *pWS) { IconBoxData *pibd; if (pWS->pIconBox) { pibd = pWS->pIconBox; while (pibd) { XUnmapWindow (DISPLAY, pibd->pCD_iconBox->clientFrameWin); pibd = pibd->pNextIconBox; } } } /* END OF FUNCTION UnmapIconBoxes */ #endif /* WSM */ #if defined(PANELIST) /******************************<->************************************* * * IconBoxShowing () * * Description: * ----------- * Returns True if an icon box tied to a front panel button is * showing. * * Inputs: * ------ * pWS = pointer to workspace data * pCW = pointer to control window data (for front panel button ) * * Outputs: * ------- * Return = True if icon box is up, False if it's invisible * * Comments: * -------- * ******************************<->***********************************/ #ifdef PANELIST Boolean IconBoxShowing (WmWorkspaceData *pWS) #else /* PANELIST */ Boolean IconBoxShowing (WmWorkspaceData *pWS, ControlWindowStruct *pCW) #endif /* PANELIST */ { Boolean rval = False; int wsIndex = GetCurrentWorkspaceIndex (pWS->pSD); #ifdef PANELIST if (pWS->pIconBox && ClientInWorkspace (pWS, pWS->pIconBox->pCD_iconBox)) { rval = True; } #else /* PANELIST */ if (pWS->pIconBox && ClientInWorkspace (pWS, pWS->pIconBox->pCD_iconBox) && (pCW->pWsStatus[wsIndex].wsClientStatus == CLIENT_WINDOW_OPEN)) { rval = True; } #endif /* PANELIST */ return (rval); } /* END OF FUNCTION IconBoxShowing */ /******************************<->************************************* * * IconBoxPopUp (pWS, pCW, up) * * Description: * ----------- * Sets the state of the icon box attached to a front panel control. * * Inputs: * ------ * pWS = pointer to workspace data * pCW = pointer to control window data (for front panel button ) * up = flag, if True, pop the icon box up; if False, hide it. * * Outputs: * ------- * None * * Comments: * -------- * ******************************<->***********************************/ #ifdef PANELIST void IconBoxPopUp (WmWorkspaceData *pWS, Boolean up) #else /* PANELIST */ void IconBoxPopUp (WmWorkspaceData *pWS, ControlWindowStruct *pCW, Boolean up) #endif /* PANELIST */ { IconBoxData *pibd; int wsIndex = GetCurrentWorkspaceIndex (pWS->pSD); if (pWS->pIconBox) { pibd = pWS->pIconBox; while (pibd) { if (up) { if (ClientInWorkspace(pWS, pibd->pCD_iconBox)) { F_Raise (NULL, pibd->pCD_iconBox, (XEvent *)NULL); } else { AddClientToWorkspaces (pibd->pCD_iconBox, &pWS->id, 1); return; } } else if (!up && ClientInWorkspace (pWS, pibd->pCD_iconBox)) { RemoveClientFromWorkspaces (pibd->pCD_iconBox, &pWS->id, 1); return; } pibd = pibd->pNextIconBox; } } } /* END OF FUNCTION IconBoxPopUp */ #endif /* PANELIST */ /******************************<->************************************* * * InsertIconIntoBox * * Inputs * ------ * pCD - pointer to data for client to insert * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ Boolean InsertIconIntoBox (IconBoxData *pIBD, ClientData *pCD) { Boolean rval = False; Arg setArgs[20]; int i; int iconWidth, iconHeight; IconBoxData *tmpPointerToIconBox; Widget iconWidget; IconInfo *pIconInfo; static XmString dummyString = NULL; #ifdef WSM WsClientData *pWsc; WmWorkspaceData *pWS = GetWorkspaceData (pCD->pSD, pIBD->wsID); pWsc = GetWsClientData (pWS, pCD); #endif /* WSM */ /* * If we go to multiple icon boxes, find the box this client * wants to live in. For now, we only have one, so point to * the first one. */ tmpPointerToIconBox = pIBD; if (pCD->client) { #ifdef WSM pWsc->pIconBox = tmpPointerToIconBox; #else /* WSM */ P_ICON_BOX(pCD) = tmpPointerToIconBox; #endif /* WSM */ iconWidth = ICON_WIDTH(pCD) + (2 * IB_MARGIN_WIDTH); iconHeight = ICON_HEIGHT(pCD) + (2 * IB_MARGIN_HEIGHT); #ifdef WSM pIconInfo = InsertIconInfo (pWsc->pIconBox, pCD, (Widget) NULL); #else /* WSM */ pIconInfo = InsertIconInfo (P_ICON_BOX(pCD), pCD, (Widget) NULL); #endif /* WSM */ if (pIconInfo) { #ifdef WSM pWsc->pIconBox->numberOfIcons++; #else /* WSM */ P_ICON_BOX(pCD)->numberOfIcons++; #endif /* WSM */ i = 0; XtSetArg (setArgs[i], XmNbackground, (XtArgVal) ICON_APPEARANCE(pCD).background ); i++; XtSetArg (setArgs[i], XmNforeground, (XtArgVal) ICON_APPEARANCE(pCD).foreground ); i++; #ifdef WSM XtSetArg (setArgs[i], XmNx , (XtArgVal) pWsc->iconX); i++; XtSetArg (setArgs[i], XmNy , (XtArgVal) pWsc->iconY); i++; #else /* WSM */ XtSetArg (setArgs[i], XmNx , (XtArgVal) ICON_X(pCD)); i++; XtSetArg (setArgs[i], XmNy , (XtArgVal) ICON_Y(pCD)); i++; #endif /* WSM */ XtSetArg (setArgs[i], XmNwidth , (XtArgVal) iconWidth); i++; XtSetArg (setArgs[i], XmNheight , (XtArgVal) iconHeight); i++; XtSetArg (setArgs[i], XmNborderWidth , (XtArgVal) 0); i++; XtSetArg (setArgs[i], XmNhighlightThickness , IB_HIGHLIGHT_BORDER); i++; XtSetArg (setArgs[i], XmNmarginHeight , (XtArgVal) 0); i++; XtSetArg (setArgs[i], XmNmarginWidth , (XtArgVal) 0); i++; /* * Use type XmString so we don't get a message from XmLabel */ XtSetArg (setArgs[i], XmNlabelType, (XtArgVal) XmSTRING); i++; XtSetArg (setArgs[i], XmNrecomputeSize, (XtArgVal) False); i++; XtSetArg (setArgs[i], XmNtraversalOn, (XtArgVal) True); i++; XtSetArg (setArgs[i], XmNpushButtonEnabled, (XtArgVal) False); i++; XtSetArg (setArgs[i], XmNshadowThickness, (XtArgVal) 0); i++; iconWidget = XtCreateManagedWidget("iconInIconBox", xmDrawnButtonWidgetClass, #ifdef WSM pWsc->pIconBox->bBoardWidget, #else /* WSM */ P_ICON_BOX(pCD)->bBoardWidget, #endif /* WSM */ (ArgList)setArgs, i); if (dummyString == NULL) { dummyString = XmStringCreateLocalized(""); } i = 0; XtSetArg (setArgs[i], XmNlabelString, (XtArgVal) dummyString); i++; XtSetValues (iconWidget, setArgs, i); pIconInfo->theWidget = iconWidget; #ifdef WSM pWsc->iconFrameWin = XtWindow (iconWidget); #else /* WSM */ ICON_FRAME_WIN(pCD) = XtWindow (iconWidget); #endif /* WSM */ XtAddCallback (iconWidget, XmNactivateCallback, (XtCallbackProc)IconActivateCallback, (XtPointer)NULL); XtAddEventHandler(iconWidget, SELECT_BUTTON_MOTION_MASK, False, (XtEventHandler)HandleIconBoxButtonMotion, (XtPointer)NULL); XtAddEventHandler(iconWidget, DMANIP_BUTTON_MOTION_MASK, False, (XtEventHandler)HandleIconBoxButtonMotion, (XtPointer)NULL); XtAddEventHandler(iconWidget, KeyPressMask, False, (XtEventHandler)HandleIconBoxIconKeyPress, (XtPointer)NULL); if (ICON_DECORATION(pCD) & ICON_ACTIVE_LABEL_PART) { XtAddEventHandler(iconWidget, FocusChangeMask, False, (XtEventHandler)ChangeActiveIconboxIconText, (XtPointer)NULL); if (pCD->pSD->activeLabelParent != pCD->pSD->rootWindow) { XRaiseWindow (DISPLAY, pCD->pSD->activeIconTextWin); } } #ifdef WSM ResetIconBoxMaxSize(pWsc->pIconBox->pCD_iconBox, pWsc->pIconBox->bBoardWidget); ResetArrowButtonIncrements (pWsc->pIconBox->pCD_iconBox); #else /* WSM */ ResetIconBoxMaxSize(P_ICON_BOX(pCD)->pCD_iconBox, P_ICON_BOX(pCD)->bBoardWidget); ResetArrowButtonIncrements (P_ICON_BOX(pCD)->pCD_iconBox); #endif /* WSM */ rval = True; } } return(rval); } /* END FUNCTION InsertIconIntoBox() */ /*************************************<->************************************* * * InsertIconInfo (pIBD, pCD, theWidget) * * * Description: * ----------- * Finds next available spot and inserts the icon * * * Inputs: * ------ * pIBD - pointer to icon box data * pCD - pointer to client data for this client * theWidget - widget containing the icon (may be null) * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ IconInfo *InsertIconInfo (pIBD, pCD, theWidget) IconBoxData *pIBD; ClientData *pCD; Widget theWidget; { IconInfo *pII; int place; int amt, i; Arg setArgs[3]; Arg getArgs[4]; Dimension clipWidth, clipHeight; #ifdef WSM WsClientData *pWsc; #endif /* WSM */ place = GetNextIconPlace (&pIBD->IPD); if (place == NO_ICON_PLACE) { if (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY) { amt = pIBD->IPD.placementCols; /* add a new row */ } else { amt = pIBD->IPD.placementRows; /* add a new column */ } if (!ExtendIconList (pIBD, amt)) { Warning (((char *)GETMESSAGE(36, 4, "Insufficient memory to create icon box data"))); return (NULL); } if (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY) { pIBD->IPD.placementRows++; } else { pIBD->IPD.placementCols++; } place = GetNextIconPlace (&pIBD->IPD); } insertPosition = place; /* * Update icon info values */ pII = &pIBD->IPD.placeList[place]; pII->theWidget = theWidget; pII->pCD = pCD; #ifdef WSM pWsc = GetWsClientData (GetWorkspaceData (pCD->pSD, pIBD->wsID), pCD); pWsc->iconPlace = place; CvtIconPlaceToPosition (&pIBD->IPD, pWsc->iconPlace, &pWsc->iconX, &pWsc->iconY); /* update next free position */ pIBD->currentCol = pWsc->iconX / pIBD->pCD_iconBox->widthInc; pIBD->currentRow = pWsc->iconY / pIBD->pCD_iconBox->heightInc; #else /* WSM */ ICON_PLACE(pCD) = place; CvtIconPlaceToPosition (&pIBD->IPD, ICON_PLACE(pCD), &ICON_X(pCD), &ICON_Y(pCD)); /* update next free position */ pIBD->currentCol = ICON_X(pCD) / pIBD->pCD_iconBox->widthInc; pIBD->currentRow = ICON_Y(pCD) / pIBD->pCD_iconBox->heightInc; #endif /* WSM */ /* * Increase bboard size if necessary */ i = 0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &clipWidth ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &clipHeight ); i++; XtGetValues (pIBD->clipWidget, getArgs, i); i = 0; if (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY) { if (pIBD->currentCol > pIBD->lastCol) { pIBD->lastCol = pIBD->currentCol; } if (pIBD->currentRow > pIBD->lastRow) { pIBD->lastRow = pIBD->currentRow; #ifdef WSM if (clipHeight <= (Dimension) (pWsc->iconY + pIBD->pCD_iconBox->heightInc)) { /* * Increase bulletin board height as needed. */ XtSetArg (setArgs[i], XmNheight, (XtArgVal) pWsc->iconY + pIBD->pCD_iconBox->heightInc); i++; } #else /* WSM */ if (clipHeight <= (pII->pCD->iconY + pIBD->pCD_iconBox->heightInc)) { /* * Increase bulletin board height as needed. */ XtSetArg (setArgs[i], XmNheight, (XtArgVal) pII->pCD->iconY + pIBD->pCD_iconBox->heightInc); i++; } #endif /* WSM */ } } else { if (pIBD->currentCol > pIBD->lastCol) { pIBD->lastCol = pIBD->currentCol; #ifdef WSM if (clipWidth <= (Dimension) (pWsc->iconX + pIBD->pCD_iconBox->widthInc)) { /* * Increase bulletin board width as needed */ XtSetArg (setArgs[i], XmNwidth, (XtArgVal) pWsc->iconX + pIBD->pCD_iconBox->widthInc); i++; } #else /* WSM */ if (clipWidth <= (pII->pCD->iconX + pIBD->pCD_iconBox->widthInc)) { /* * Increase bulletin board width as needed */ XtSetArg (setArgs[i], XmNwidth, (XtArgVal) pII->pCD->iconX + pIBD->pCD_iconBox->widthInc); i++; } #endif /* WSM */ } if (pIBD->currentRow > pIBD->lastRow) { pIBD->lastRow = pIBD->currentRow; } } if (i > 0) { XtSetValues (pIBD->bBoardWidget, setArgs, i); } return(pII); } /* END OF FUNCTION InsertIconInfo */ /*************************************<->************************************* * * DeleteIconFromBox * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ void DeleteIconFromBox (IconBoxData *pIBD, ClientData *pCD) { Widget theChild; ClientData *pCD_tmp; Arg args[4]; Dimension clipWidth, clipHeight; Dimension oldWidth, oldHeight; int newWidth, newHeight; int i, newCols, newRows; #ifdef WSM WmWorkspaceData *pWS = GetWorkspaceData (pCD->pSD, pIBD->wsID); WsClientData *pWsc; pWsc = GetWsClientData (pWS, pCD); #endif /* WSM */ i = 0; XtSetArg (args[i], XmNwidth, (XtArgVal) &oldWidth ); i++; XtSetArg (args[i], XmNheight, (XtArgVal) &oldHeight ); i++; XtGetValues (pIBD->bBoardWidget, args, i); i = 0; XtSetArg (args[i], XmNwidth, (XtArgVal) &clipWidth); i++; XtSetArg (args[i], XmNheight, (XtArgVal) &clipHeight ); i++; XtGetValues (pIBD->clipWidget, args, i); clipHeight /= (Dimension) pIBD->pCD_iconBox->heightInc; clipWidth /= (Dimension) pIBD->pCD_iconBox->widthInc; /* * find context of the activeIconTextWin to get pCD and then * if it is the same as this client, hide it. */ if (!(XFindContext (DISPLAY, pCD->pSD->activeIconTextWin, wmGD.windowContextType, (caddr_t *)&pCD_tmp))) { if (pCD == pCD_tmp) { /* hide activeIconTextWin */ HideActiveIconText ((WmScreenData *)NULL); } } #ifdef WSM DeleteIconInfo (pWsc->pIconBox, pCD); pWsc->pIconBox->numberOfIcons--; theChild = XtWindowToWidget (DISPLAY, pWsc->iconFrameWin); pWsc->pIconBox = NULL; pWsc->iconPlace = NO_ICON_PLACE; #else /* WSM */ DeleteIconInfo (P_ICON_BOX(pCD), pCD); pCD->pIconBox->numberOfIcons--; theChild = XtWindowToWidget (DISPLAY, ICON_FRAME_WIN(pCD)); #endif /* WSM */ XtUnmanageChild (theChild); XtDestroyWidget (theChild); /* update last row and col */ SetNewBounds (pIBD); /* resize Bulletin board (so scroll bars show correctly */ i = 0; if (clipWidth <= (Dimension) (pIBD->lastCol + 1)) { newWidth = (pIBD->lastCol + 1) * pIBD->pCD_iconBox->widthInc; XtSetArg (args[i], XmNwidth, (XtArgVal) newWidth); i++; newCols = newWidth / pIBD->pCD_iconBox->widthInc; } else { newWidth = clipWidth * pIBD->pCD_iconBox->widthInc; XtSetArg (args[i], XmNwidth, (XtArgVal) newWidth); i++; newCols = newWidth / pIBD->pCD_iconBox->widthInc; } if (clipHeight <= (Dimension) (pIBD->lastRow + 1)) { /* set height of bboard */ newHeight = (pIBD->lastRow + 1) * pIBD->pCD_iconBox->heightInc; XtSetArg (args[i], XmNheight, (XtArgVal) newHeight ); i++; newRows = newHeight / pIBD->pCD_iconBox->heightInc; } else { newHeight = clipHeight * pIBD->pCD_iconBox->heightInc; XtSetArg (args[i], XmNheight, (XtArgVal) newHeight ); i++; newRows = newHeight / pIBD->pCD_iconBox->heightInc; } if (i > 0 && ExpandVirtualSpace(pIBD, newWidth, newHeight)) { XtSetValues (pIBD->bBoardWidget, args, i); RealignIconList (pIBD, newCols, newRows); pIBD->IPD.placementCols = newCols; pIBD->IPD.placementRows = newRows; } /* reset max size for icon box */ ResetIconBoxMaxSize(pIBD->pCD_iconBox, pIBD->bBoardWidget); ResetArrowButtonIncrements (pIBD->pCD_iconBox); } /* END FUNCTION DeleteIconFromBox */ /*************************************<->************************************* * * DeleteIconInfo (pIBD, pCD) * * * Description: * ----------- * Deletes an icon info record from the icon box list based on the * client data pointer. * * * Inputs: * ------ * pIBD - pointer to icon box data * pCD - pointer to client data * * Outputs: * ------- * * * Comments: * -------- * o The deleted item is freed * o Is pCD the correct key???? !!! * *************************************<->***********************************/ void DeleteIconInfo (IconBoxData *pIBD, ClientData *pCD) { int ix, count; IconInfo *pII; /* find first matching entry in list */ pII = &pIBD->IPD.placeList[0]; count = pIBD->IPD.totalPlaces; for (ix = 0; ix < count && pII->pCD != pCD; ix++, pII++) { } if (ix < count) { /* found it, zero the entry out */ pII->theWidget = NULL; pII->pCD = NULL; } } /* END FUNCTION DeleteIconInfo */ /*************************************<->************************************* * * ResetIconBoxMaxSize(pCD, bBoardWidget) * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ void ResetIconBoxMaxSize (ClientData *pCD, Widget bBoardWidget) { int i; Arg getArgs[3]; Dimension newWidth; Dimension newHeight; i=0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &newWidth ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &newHeight ); i++; XtGetValues (bBoardWidget, getArgs, i); pCD->oldMaxWidth = pCD->maxWidth = newWidth + pCD->baseWidth; pCD->oldMaxHeight = pCD->maxHeight = newHeight + pCD->baseHeight; pCD->maxX = pCD->clientX; pCD->maxY = pCD->clientY; PlaceFrameOnScreen (pCD, &pCD->maxX, &pCD->maxY, pCD->maxWidth, pCD->maxHeight); } /* END OF FUNCTION ResetIconBoxMaxSize */ /*************************************<->************************************* * * CheckIconBoxSize(pIBD) * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ Boolean CheckIconBoxSize (IconBoxData *pIBD) { int i; Arg getArgs[3]; Arg setArgs[3]; Dimension oldWidth; Dimension oldHeight; Dimension newWidth; Dimension newHeight; int oldCol, oldRow; Boolean rval = True; i=0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &oldWidth ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &oldHeight ); i++; XtGetValues (pIBD->bBoardWidget, getArgs, i); newWidth = oldWidth; newHeight = oldHeight; oldCol = oldWidth / (Dimension) pIBD->pCD_iconBox->widthInc; oldRow = oldHeight / (Dimension) pIBD->pCD_iconBox->heightInc; /* * Increase bboard size if necessary */ i = 0; if (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY) { if (oldRow < pIBD->lastRow + 1) { /* * increase bulletin board height as needed */ newHeight = (pIBD->lastRow * pIBD->pCD_iconBox->heightInc) + pIBD->pCD_iconBox->heightInc; XtSetArg (setArgs[i], XmNheight, (XtArgVal) newHeight); i++; } } else { if (oldCol < pIBD->lastCol + 1) { /* * increase bulletin board width as needed */ newWidth = (pIBD->lastCol * pIBD->pCD_iconBox->widthInc) + pIBD->pCD_iconBox->widthInc; XtSetArg (setArgs[i], XmNwidth, newWidth); i++; } } if (i > 0) { if (! ExpandVirtualSpace(pIBD, newWidth, newHeight)) { /* * The user has resized the iconbox larger than * memory will allow. Don't honor the resize request */ rval = False; return(rval); } XtSetValues (pIBD->bBoardWidget, setArgs, i); } ResetIconBoxMaxSize(pIBD->pCD_iconBox, pIBD->bBoardWidget); return(rval); } /* END OF FUNCTION CheckIconBoxSize */ /*************************************<->************************************* * * CheckIconBoxResize(pCD, changedValues) * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ void CheckIconBoxResize (ClientData *pCD, unsigned int changedValues, int newWidth, int newHeight) { Boolean packVert = False; Boolean packHorz = False; WmScreenData *pSD; IconBoxData *pIBD; IconPlacementData *pIPD; int i, newCols, newRows; Arg getArgs[3]; Arg setArgs[3]; Dimension oldWidth; Dimension oldHeight; pIPD = &pCD->thisIconBox->IPD; pIBD = pCD->thisIconBox; pSD = &(wmGD.Screens[SCREEN_FOR_CLIENT(pCD)]); i=0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &oldWidth ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &oldHeight ); i++; XtGetValues (pIBD->bBoardWidget, getArgs, i); newCols = pIPD->placementCols; newRows = pIPD->placementRows; newWidth = newWidth - pCD->baseWidth; newHeight = newHeight - pCD->baseHeight; i = 0; if (changedValues & CWWidth) { /* * There was a change in Width, see if we need to change the * bulletin board */ if (newWidth > (int) oldWidth) { newCols = newWidth / pCD->widthInc; XtSetArg (setArgs[i], XmNwidth, (XtArgVal) newWidth ); i++; } if (newWidth < (int) oldWidth) { if ((!strcmp(pSD->iconBoxSBDisplayPolicy, szvertical)) && (newWidth / pCD->widthInc < pIBD->lastCol + 1)) { XtSetArg (setArgs[i], XmNwidth, (XtArgVal) newWidth ); i++; newCols = newWidth / pCD->widthInc; packVert = True; } else if (newWidth / pCD->widthInc < pIBD->lastCol + 1) { newWidth = (pIBD->lastCol +1) * pCD->widthInc; XtSetArg (setArgs[i], XmNwidth, (XtArgVal) newWidth ); i++; } else { newCols = newWidth / pCD->widthInc; XtSetArg (setArgs[i], XmNwidth, (XtArgVal) newWidth ); i++; } } } else { newWidth = oldWidth; } if (changedValues & CWHeight) { /* * There was a change in Height, see if we need to change the * bulletin board */ if (newHeight > (int) oldHeight) { newRows = newHeight / pCD->heightInc; XtSetArg (setArgs[i], XmNheight, (XtArgVal) newHeight ); i++; } if (newHeight < (int) oldHeight) { if ((!strcmp(pSD->iconBoxSBDisplayPolicy, szhorizontal)) && (newHeight / pCD->heightInc < pIBD->lastRow + 1)) { XtSetArg (setArgs[i], XmNheight, (XtArgVal) newHeight ); i++; newRows = newHeight / pCD->heightInc; packHorz = True; } else if (newHeight / pCD->heightInc < pIBD->lastRow + 1) { newHeight = (pIBD->lastRow + 1) * pCD->heightInc; XtSetArg (setArgs[i], XmNheight, (XtArgVal) newHeight ); i++; } else { newRows = newHeight / pCD->heightInc; XtSetArg (setArgs[i], XmNheight, (XtArgVal) newHeight ); i++; } } } else { newHeight = oldHeight; } if ( i >0 && ExpandVirtualSpace(pIBD, newWidth, newHeight)) { XtSetValues (pIBD->bBoardWidget, setArgs, i); } RealignIconList (pIBD, newCols, newRows); pIPD->placementCols = newCols; pIPD->placementRows = newRows; ResetIconBoxMaxSize(pCD, pIBD->bBoardWidget); /* * Pack the icon box if there are icons that can no longer * be scrolled to due to iconBoxSBDisplayPolicy. */ if (packVert) { PackIconBox (pIBD, packVert, False , newWidth, 0); } else if (packHorz) { PackIconBox (pIBD, False, packHorz , 0, newHeight); } } /* END OF FUNCTION CheckIconBoxResize */ /*************************************<->************************************* * * ExpandVirtualSpace (pIBD, newWidth, newHeight) * * * Description: * ----------- * Add virtural space (really the icon list ) * * * Inputs: * ------ * pIBD - ptr to icon box data * * * Outputs: * ------- * Return - True if successful, False otherwise * * Comments: * -------- * *************************************<->***********************************/ Boolean ExpandVirtualSpace (IconBoxData *pIBD, int newWidth, int newHeight) { Boolean rval = True; int newSize; int increment; newSize = (newWidth / pIBD->pCD_iconBox->widthInc) * (newHeight / pIBD->pCD_iconBox->heightInc); if (newSize > pIBD->IPD.totalPlaces ) { increment = newSize - pIBD->IPD.totalPlaces; rval = ExtendIconList (pIBD, increment); } return (rval); } /* END OF FUNCTION ExpandVirtualSpace */ /*************************************<->************************************* * * ExtendIconList (pIBD, incr); * * * Description: * ----------- * Add space to the icon list * * * Inputs: * ------ * pIBD - ptr to icon box data * incr - number of cells to add * * * Outputs: * ------- * Return - True if successful, False otherwise * * Comments: * -------- * *************************************<->***********************************/ Boolean ExtendIconList (IconBoxData *pIBD, int incr) { Boolean rval; int newSize; IconInfo *pTmp; newSize = pIBD->IPD.totalPlaces + incr; if ((pTmp = (IconInfo *) XtMalloc (newSize*sizeof(IconInfo))) != NULL) { /* copy data */ memcpy (pTmp, pIBD->IPD.placeList, pIBD->IPD.totalPlaces*sizeof(IconInfo)); memset (&pTmp[pIBD->IPD.totalPlaces], 0, incr*sizeof(IconInfo)); /* out with the old, in with the new */ XtFree ((char *)pIBD->IPD.placeList); pIBD->IPD.placeList = pTmp; pIBD->IPD.totalPlaces = newSize; rval = True; } else { rval = False; } return (rval); } /* END OF FUNCTION ExtendIconList */ /*************************************<->************************************* * * PackIconBox(pIBD, packVert, packHorz, passedInWidth, passedInHeight) * * * Description: * ----------- * Packs the icons in the icon box * * * Inputs: * ------ * pIBD - pointer to icon box data * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void PackIconBox (IconBoxData *pIBD, Boolean packVert, Boolean packHorz, int passedInWidth, int passedInHeight) { IconInfo *pII_2, *pII_1; int ix1, ix2; int count; int newX, newY; ClientData *pCD_tmp, *pMyCD; int hasActiveText = 1; Arg args[4]; Dimension majorDimension, minorDimension; Dimension oldWidth, oldHeight; int newWidth, newHeight; int i; Boolean rippling = False; #ifdef WSM WsClientData *pWsc; WmWorkspaceData *pWS; #endif /* WSM */ i = 0; XtSetArg (args[i], XmNwidth, (XtArgVal) &oldWidth ); i++; XtSetArg (args[i], XmNheight, (XtArgVal) &oldHeight ); i++; XtGetValues (pIBD->bBoardWidget, args, i); /* * packing to visual space, first update IconBoxData */ i = 0; if (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY) { XtSetArg (args[i], XmNwidth, (XtArgVal) &majorDimension ); i++; XtSetArg (args[i], XmNheight, (XtArgVal) &minorDimension ); i++; XtGetValues (pIBD->clipWidget, args, i); if (packVert) { majorDimension = passedInWidth; } minorDimension /= (Dimension) pIBD->pCD_iconBox->heightInc; majorDimension /= (Dimension) pIBD->pCD_iconBox->widthInc; if (majorDimension != pIBD->IPD.placementCols) { pIBD->IPD.placementCols = majorDimension; if (pIBD->IPD.placementCols == 0) pIBD->IPD.placementCols++; } } else { XtSetArg (args[i], XmNheight, (XtArgVal) &majorDimension ); i++; XtSetArg (args[i], XmNwidth, (XtArgVal) &minorDimension ); i++; XtGetValues (pIBD->clipWidget, args, i); if (packHorz) { majorDimension = passedInHeight; } minorDimension /= (Dimension) pIBD->pCD_iconBox->widthInc; majorDimension /= (Dimension) pIBD->pCD_iconBox->heightInc; if (majorDimension != pIBD->IPD.placementRows) { pIBD->IPD.placementRows = majorDimension; if (pIBD->IPD.placementRows == 0) pIBD->IPD.placementRows++; } } /* * find context of the activeIconTextWin to get pCD and then * if it is the same as this client, hide it. */ pMyCD = pIBD->pCD_iconBox; if (ICON_DECORATION(pMyCD) & ICON_ACTIVE_LABEL_PART) { if (XFindContext (DISPLAY, pMyCD->pSD->activeIconTextWin, wmGD.windowContextType, (caddr_t *)&pCD_tmp)) { hasActiveText = 0; } } pII_2 = pII_1 = pIBD->IPD.placeList; ix1 = ix2 = 0; count = pIBD->IPD.totalPlaces; while (ix1 < count) { if (!rippling && (pII_2->pCD != NULL)) { /* * We need to start rippling the icons into new positions if * their (x,y) position changed */ #ifdef WSM pWS = GetWorkspaceData (pII_2->pCD->pSD, pIBD->wsID); pWsc = GetWsClientData (pWS, pII_2->pCD); CvtIconPlaceToPosition (&pIBD->IPD, pWsc->iconPlace, &newX, &newY); rippling = ((newX != pWsc->iconX) || (newY != pWsc->iconY)); #else /* WSM */ CvtIconPlaceToPosition (&pIBD->IPD, pII_2->pCD->iconPlace, &newX, &newY); rippling = ((newX != pII_2->pCD->iconX) || (newY != pII_2->pCD->iconY)); #endif /* WSM */ } if ((pII_2->pCD == NULL) || rippling) { /* find next one to move */ while ((ix1 < count) && (pII_1->pCD == NULL)) { ix1++; pII_1++; } if ((ix1 < count) && (pII_1->pCD != NULL)) { if (ix1 != ix2) { MoveIconInfo (&pIBD->IPD, ix1, ix2); } CvtIconPlaceToPosition (&pIBD->IPD, ix2, &newX, &newY); #ifdef WSM pWS = GetWorkspaceData (pII_2->pCD->pSD, pIBD->wsID); pWsc = GetWsClientData (pWS, pII_2->pCD); pWsc->iconX = newX; pWsc->iconY = newY; #else /* WSM */ pII_2->pCD->iconX = newX; pII_2->pCD->iconY = newY; #endif /* WSM */ if (hasActiveText && (pII_2->pCD == pCD_tmp)) { /* hide activeIconTextWin first */ HideActiveIconText ((WmScreenData *)NULL); XtMoveWidget (pII_2->theWidget, newX, newY); ShowActiveIconText (pII_2->pCD); } else { XtMoveWidget (pII_2->theWidget, newX, newY); } } } if (ix1 < count) { ix2++; pII_2++; } ix1++; pII_1++; } /* update last row and col */ SetNewBounds (pIBD); /* resize Bulletin board (so scroll bars show correctly */ i = 0; if (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY) { if (majorDimension <= (Dimension) (pIBD->lastCol + 1)) { newWidth = (pIBD->lastCol + 1) * pIBD->pCD_iconBox->widthInc; XtSetArg (args[i], XmNwidth, (XtArgVal) newWidth); i++; } else { newWidth = oldWidth; } if (minorDimension <= (Dimension) (pIBD->lastRow + 1)) { /* set height of bboard */ newHeight = (pIBD->lastRow + 1) * pIBD->pCD_iconBox->heightInc; XtSetArg (args[i], XmNheight, (XtArgVal) newHeight ); i++; } else { newHeight = minorDimension * pIBD->pCD_iconBox->heightInc; XtSetArg (args[i], XmNheight, (XtArgVal) newHeight ); i++; } } else { if (majorDimension <= (Dimension) (pIBD->lastRow + 1)) { newHeight = (pIBD->lastRow + 1) * pIBD->pCD_iconBox->heightInc; XtSetArg (args[i], XmNheight, (XtArgVal) newHeight ); i++; } else { newHeight = oldHeight; } if (minorDimension <= (Dimension) (pIBD->lastCol + 1)) { /* set width of bboard */ newWidth = (pIBD->lastCol + 1) * pIBD->pCD_iconBox->widthInc; XtSetArg (args[i], XmNwidth, (XtArgVal) newWidth); i++; } else { newWidth = minorDimension * pIBD->pCD_iconBox->widthInc; XtSetArg (args[i], XmNwidth, (XtArgVal) newWidth); i++; } } if (i > 0 && ExpandVirtualSpace(pIBD, newWidth, newHeight)) { XtSetValues (pIBD->bBoardWidget, args, i); } /* reset max size for icon box */ ResetIconBoxMaxSize (pIBD->pCD_iconBox, pIBD->bBoardWidget); ResetArrowButtonIncrements (pIBD->pCD_iconBox); } /* END FUNCTION PackIconBox */ /*************************************<->************************************* * * RealignIconList (pIBD, newRows, newCols) * * * Description: * ----------- * Realigns the icon list according to the new virtual space dimensions * * * Inputs: * ------ * pIBD - ptr to icon box data * newRows - new number of rows * newCols - new number of columns * * * Outputs: * ------- * * Comments: * -------- * o The placement data structure contains the old values. * *************************************<->***********************************/ void RealignIconList (IconBoxData *pIBD, int newCols, int newRows) { int c1, c2, ix1, ix2; int oldRows, oldCols; IconPlacementData ipdNew; IconInfo *pII; /* * create new icon placement data for ease of calling conversion * routines. */ ipdNew.onRootWindow = pIBD->IPD.onRootWindow; ipdNew.iconPlacement = pIBD->IPD.iconPlacement; ipdNew.placementRows = newRows; ipdNew.placementCols = newCols; ipdNew.iPlaceW = pIBD->IPD.iPlaceW; ipdNew.iPlaceH = pIBD->IPD.iPlaceH; ipdNew.placeList = pIBD->IPD.placeList; ipdNew.totalPlaces = pIBD->IPD.totalPlaces; oldRows = pIBD->IPD.placementRows; oldCols = pIBD->IPD.placementCols; /* * Use the new organization and placement discipline to * determine how to move the icon info data around. */ if (((oldRows < newRows) && (pIBD->IPD.iconPlacement & ICON_PLACE_TOP_PRIMARY)) || ((oldCols < newCols) && (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY))) { /* * work backwards */ for (ix1 = pIBD->IPD.totalPlaces - 1, pII = &pIBD->IPD.placeList[ix1]; ix1 >= 0; ix1--, pII--) { if (pII->pCD != NULL) { CvtIconPlaceToPosition (&pIBD->IPD, ix1, &c1, &c2); ix2 = CvtIconPositionToPlace (&ipdNew, c1, c2); if (ix1 != ix2) { MoveIconInfo (&pIBD->IPD, ix1, ix2); } } } } else if (((oldRows > newRows) && (pIBD->IPD.iconPlacement & ICON_PLACE_TOP_PRIMARY)) || ((oldCols > newCols) && (pIBD->IPD.iconPlacement & ICON_PLACE_LEFT_PRIMARY))) { /* * work forwards */ for (ix1 = 0, pII = &pIBD->IPD.placeList[ix1]; ix1 < pIBD->IPD.totalPlaces; ix1++, pII++) { if (pII->pCD != NULL) { CvtIconPlaceToPosition (&pIBD->IPD, ix1, &c1, &c2); ix2 = CvtIconPositionToPlace (&ipdNew, c1, c2); if (ix1 != ix2) { MoveIconInfo (&pIBD->IPD, ix1, ix2); } } } } /* * update info in placement structure to reflect new reality */ pIBD->IPD.placementRows = newRows; pIBD->IPD.placementCols = newCols; } /* END OF FUNCTION RealignIconList */ /*************************************<->************************************* * * SetNewBounds (pIBD) * * * Description: * ----------- * * * Inputs: * ------ * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void SetNewBounds (IconBoxData *pIBD) { int i; int X = 0; int Y = 0; CompositeWidget cw; WidgetList children; cw = (CompositeWidget) pIBD->bBoardWidget; children = cw->composite.children; for (i = 0; i < cw->composite.num_children; i++) { if (children[i]->core.x > X) { X = children[i]->core.x; } if (children[i]->core.y > Y) { Y = children[i]->core.y; } } pIBD->lastCol = X / pIBD->pCD_iconBox->widthInc; pIBD->lastRow = Y / pIBD->pCD_iconBox->heightInc; } /* END OF FUNCTION SetNewBounds */ /*************************************<->************************************* * * InsertPosition (w) * * * Description: * ----------- * This procedure is passed to the bulletin board at create time * to be used when a child is inserted into the bulletin board * * *************************************<->***********************************/ Cardinal InsertPosition (Widget w) { return (insertPosition); } /* END OF FUNCTION InsertPosition */ /*************************************<->************************************* * * ShowClientIconState (); * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ void ShowClientIconState (ClientData *pCD, int newState) { /* * Changing the appearance of an icon window in the box to * reflect the client's state */ if ((newState == MINIMIZED_STATE) && (pCD->iconWindow)) XMapRaised (DISPLAY, pCD->iconWindow); if (((newState == NORMAL_STATE) || (newState == MAXIMIZED_STATE )) && (pCD->iconWindow)) { XUnmapWindow (DISPLAY, pCD->iconWindow); } } /* END FUNCTION ShowClientIconState */ #ifndef MOTIF_ONE_DOT_ONE /*************************************<->************************************* * * IconScrollVisibleCallback * * * Description: * ----------- * for each icon in the icon box * *************************************<->***********************************/ void IconScrollVisibleCallback (Widget w, caddr_t client_data, XmAnyCallbackStruct *call_data) { XmTraverseObscuredCallbackStruct *vis_data; vis_data = (XmTraverseObscuredCallbackStruct *) call_data; XmScrollVisible(ACTIVE_WS->pIconBox->scrolledWidget, vis_data->traversal_destination, 0,0); /* IB_MARGIN_WIDTH, IB_MARGIN_HEIGHT); */ } /* END OF FUNCTION IconScrollVisibleCallback */ #endif /*************************************<->************************************* * * IconActivateCallback * * * Description: * ----------- * for each icon in the icon box * *************************************<->***********************************/ void IconActivateCallback (Widget w, caddr_t client_data, XmAnyCallbackStruct *call_data) { ClientData *pCD; Window theIcon; theIcon = XtWindow(w); /* * find context to get pCD and then carry out * default action. */ if (!(XFindContext (DISPLAY, theIcon, wmGD.windowContextType, (caddr_t *)&pCD))) { F_Restore_And_Raise ((String)NULL, pCD, (XEvent *)NULL ); /* F_Normalize_And_Raise ((String)NULL, pCD, (XEvent *)NULL ); */ } } /* END OF FUNCTION IconActivateCallback */ /*************************************<->************************************* * * UpdateIncrements * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ void UpdateIncrements (Widget sWidget, IconBoxData *pIBD, XConfigureEvent *event) { ResetArrowButtonIncrements (pIBD->pCD_iconBox); } /* END OF FUNCTION UpdateIncrements */ /*************************************<->************************************* * * ResetArrowButtonIncrements(pCD) * *************************************<->***********************************/ void ResetArrowButtonIncrements (ClientData *pCD) { int i; Arg setArgs[2]; i=0; XtSetArg (setArgs[i], XmNincrement, (XtArgVal) pCD->heightInc); i++; XtSetValues (pCD->thisIconBox->vScrollBar, (ArgList) setArgs, i); i=0; XtSetArg (setArgs[i], XmNincrement, (XtArgVal) pCD->widthInc); i++; XtSetValues (pCD->thisIconBox->hScrollBar, (ArgList) setArgs, i); } /* END OF FUNCTION ResetArrowButtonIncrements */ /*************************************<->************************************* * * ChangeActiveIconboxIconText * * * Description: * ----------- * XXDescription ... * *************************************<->***********************************/ void ChangeActiveIconboxIconText (Widget icon, caddr_t dummy, XFocusChangeEvent *event) { ClientData *pCD; Window theIcon; /* * find context to get pCD and then hide or show active icon text. * Show/hide the active icon text only if the icon box is not * iconified. */ theIcon = XtWindow(icon); if (!(XFindContext (DISPLAY, theIcon, wmGD.windowContextType, (caddr_t *)&pCD)) && P_ICON_BOX(pCD) && P_ICON_BOX(pCD)->pCD_iconBox && P_ICON_BOX(pCD)->pCD_iconBox->clientState != MINIMIZED_STATE) { if (event->type == FocusIn) { if (event->send_event) { ShowActiveIconText (pCD); } } else { if (event->send_event) { HideActiveIconText (pCD->pSD); } } } } /* END OF FUNCTION ChangeActiveIconboxIconText */ /*************************************<->************************************* * * HandleIconBoxIconKeyPress * * * Description: * ----------- * This event handler catches keyevents for icons in the icon box and * passes them on to the standard key handling routine for mwm. * *************************************<->***********************************/ void HandleIconBoxIconKeyPress (Widget icon, caddr_t dummy, XKeyEvent *keyEvent) { Context context; ClientData *pCD; Window theIcon; /* * find context to get pCD and then post menu show active icon text. */ theIcon = XtWindow(icon); if (!(XFindContext (DISPLAY, theIcon, wmGD.windowContextType, (caddr_t *)&pCD))) { #ifdef WSM SetClientWsIndex (pCD); #endif /* WSM */ keyEvent->window = ICON_FRAME_WIN(pCD); if (pCD->clientState == MINIMIZED_STATE) { context = F_SUBCONTEXT_IB_IICON; pCD->grabContext = F_SUBCONTEXT_IB_IICON; } else { context = F_SUBCONTEXT_IB_WICON; pCD->grabContext = F_SUBCONTEXT_IB_WICON; } if(!(HandleKeyPress (keyEvent, ACTIVE_PSD->keySpecs, True, context, False, pCD))) { keyEvent->window = 0; keyEvent->type = 0; } } } /* END OF FUNCTION HandleIconBoxIconKeyPress */ /*************************************<->************************************* * * HandleIconBoxButtonMotion * * * Description: * ----------- * Event handler for button motion events on icon frame window in * in icon box. * * * Inputs: * ------ * icon - widget for icon frame * client_data - extra client data * pev - ptr to event * * * Outputs: * ------- * * * Comments: * -------- * o This is added to make sure that ButtonXMotion gets added to the * event mask for icons in the icon box. * *************************************<->***********************************/ void HandleIconBoxButtonMotion (Widget icon, caddr_t client_data, XEvent *pev) { } /* END OF FUNCTION HandleIconBoxButtonMotion */ /*************************************<->************************************* * * GetIconBoxIconRootXY (pCD, pX, pY) * * * Description: * ----------- * * * Inputs: * ------ * pCD - pointer to client data * pX - pointer to X return value * pY - pointer to Y return value * * Outputs: * ------- * * * Comments: * -------- * o returns root-window coords * *************************************<->***********************************/ void GetIconBoxIconRootXY (ClientData *pCD, int *pX, int *pY) { Window child; #ifdef WSM WsClientData *pWsc = GetWsClientData (pCD->pSD->pActiveWS, pCD); #endif /* WSM */ #ifdef WSM if (pCD->pSD->useIconBox && pWsc->pIconBox) #else /* WSM */ if (pCD->pSD->useIconBox && P_ICON_BOX(pCD)) #endif /* WSM */ { #ifdef WSM XTranslateCoordinates(DISPLAY, XtWindow(pWsc->pIconBox->bBoardWidget), ROOT_FOR_CLIENT(pCD), pWsc->iconX + IB_MARGIN_WIDTH, pWsc->iconY + IB_MARGIN_HEIGHT, pX, pY, &child); #else /* WSM */ XTranslateCoordinates(DISPLAY, XtWindow(P_ICON_BOX(pCD)->bBoardWidget), ROOT_FOR_CLIENT(pCD), ICON_X(pCD) + IB_MARGIN_WIDTH, ICON_Y(pCD) + IB_MARGIN_HEIGHT, pX, pY, &child); #endif /* WSM */ } else { *pX = *pY = 0; } } /* END FUNCTION GetIconBoxIconRootXY */ /*************************************<->************************************* * * IconVisible (pCD) * * * Description: * ----------- * * Inputs: * ------ * pCD - pointer to client data * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ Boolean IconVisible (ClientData *pCD) { /* * May use icon->core.visible field if that gets fixed and * we want to accept the Intrinsics idea of what is visible. */ Boolean rval = True; #ifdef WSM WsClientData *pWsc = GetWsClientData (pCD->pSD->pActiveWS, pCD); #endif /* WSM */ int i; Arg getArgs[5]; Dimension tmpWidth = 0; Dimension tmpHeight = 0; Position clipX = 0; Position clipY = 0; Position tmpX = 0; Position tmpY = 0; int iconX, iconY; i=0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &tmpWidth ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &tmpHeight ); i++; XtSetArg (getArgs[i], XmNx, (XtArgVal) &tmpX ); i++; XtSetArg (getArgs[i], XmNy, (XtArgVal) &tmpY ); i++; #ifdef WSM XtGetValues (pWsc->pIconBox->clipWidget, getArgs, i); XtTranslateCoords(pWsc->pIconBox->scrolledWidget, tmpX, tmpY, &clipX, &clipY); #else /* WSM */ XtGetValues (P_ICON_BOX(pCD)->clipWidget, getArgs, i); XtTranslateCoords(P_ICON_BOX(pCD)->scrolledWidget, tmpX, tmpY, &clipX, &clipY); #endif /* WSM */ GetIconBoxIconRootXY(pCD, &iconX, &iconY); /* * demand at least 2 pixels of the * real icon (not drawnButton) be showing */ if (iconX + 2 > ((int)clipX + (int)tmpWidth)) { return(False); } if (iconY + 2 > ((int)clipY + (int)tmpHeight)) { return(False); } if ((iconX + (ICON_WIDTH(pCD) -2)) < (int)clipX) { return(False); } if ((iconY + (ICON_HEIGHT(pCD) -2)) < (int)clipY) { return(False); } return(rval); } /* END OF FUNCTION IconVisible */ /*************************************<->************************************* * * WmXmStringToString (xmString * * * Description: * ----------- * * * Inputs: * ------ * * Outputs: * ------- * * * Comments: * -------- * Return the ascii part of the first segment of an XmString * If xmString is NULL, then do nothing * *************************************<->***********************************/ String WmXmStringToString (XmString xmString) { XmStringContext xmStrContext; char *asciiString = NULL; XmStringCharSet ibTitleCharset; XmStringDirection ibTitleDirection; Boolean separator; if (xmString) { XmStringInitContext (&xmStrContext, xmString); XmStringGetNextSegment (xmStrContext, &asciiString, &ibTitleCharset, &ibTitleDirection, &separator); if (ibTitleCharset != NULL) { XtFree ((char *)ibTitleCharset); } XmStringFreeContext (xmStrContext); } return(asciiString); } /* END OF FUNCTION WmXmStringToString */ motif-2.3.8/clients/mwm/WmCDInfo.h0000644000175000017500000000474613145162623013621 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ extern int FrameX (ClientData *pcd); extern int FrameY (ClientData *pcd); extern unsigned int FrameWidth (ClientData *pcd); extern unsigned int FrameHeight (ClientData *pcd); extern unsigned int TitleTextHeight (ClientData *pcd); extern unsigned int UpperBorderWidth (ClientData *pcd); extern unsigned int LowerBorderWidth (ClientData *pcd); extern unsigned int CornerWidth (ClientData *pcd); extern unsigned int CornerHeight (ClientData *pcd); extern int BaseWindowX (ClientData *pcd); extern int BaseWindowY (ClientData *pcd); extern unsigned int BaseWindowWidth (ClientData *pcd); extern unsigned int BaseWindowHeight (ClientData *pcd); extern Boolean GetFramePartInfo (ClientData *pcd, int part, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight); extern int IdentifyFramePart (ClientData *pCD, int x, int y); extern int GadgetID (int x, int y, GadgetRectangle *pgadget, unsigned int count); extern void FrameToClient (ClientData *pcd, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight); extern void ClientToFrame (ClientData *pcd, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight); extern Boolean GetDepressInfo (ClientData *pcd, int part, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight, unsigned int *pInvertWidth); extern void SetFrameInfo (ClientData *pcd); extern void SetClientOffset (ClientData *pcd); extern Boolean XBorderIsShowing (ClientData *pcd); extern unsigned int InitTitleBarHeight (ClientData *pcd); /* * TitleBarHeight() is now a simple macro instead of a procedure. */ #define TitleBarHeight(pcd) ((pcd)->frameInfo.titleBarHeight) motif-2.3.8/clients/mwm/WmError.h0000644000175000017500000000311113145162623013571 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ #ifdef WSM #ifdef DEBUGGER extern void PrintFormatted(char *f, char *s0, char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8, char *s9); #endif /* DEBUGGER */ #endif /* WSM */ extern void WmInitErrorHandler (Display *display); extern int WmXErrorHandler (Display *display, XErrorEvent *errorEvent); extern int WmXIOErrorHandler (Display *display); extern void WmXtErrorHandler (char *message); extern void WmXtWarningHandler (char *message); extern void Warning (char *message); #ifndef NO_MESSAGE_CATALOG extern char * GetMessage(int set, int n, char * s); #endif #ifdef WSM /**************************** eof ***************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/WmResource.h0000644000175000017500000000543413145162623014301 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifndef NO_MESSAGE_CATALOG extern void InitBuiltinSystemMenu(void); #endif extern void GetAppearanceGCs (WmScreenData *pSD, Pixel fg, Pixel bg, XFontStruct *font, Pixmap bg_pixmap, Pixel ts_color, Pixmap ts_pixmap, Pixel bs_color, Pixmap bs_pixmap, GC *pGC, GC *ptsGC, GC *pbsGC); extern GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap); extern void MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources); #ifdef WSM extern Boolean Monochrome (Screen *screen); extern void ProcessWmColors (WmScreenData *pSD); #endif /* WSM */ extern void ProcessWmResources (void); extern void SetStdGlobalResourceValues (void); extern void ProcessScreenListResource (void); extern void ProcessAppearanceResources (WmScreenData *pSD); extern void ProcessGlobalScreenResources (void); extern void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName); #ifdef WSM extern void ProcessWorkspaceList (WmScreenData *pSD); #endif /* WSM */ extern void ProcessWorkspaceResources (WmWorkspaceData *pWS); extern void ProcessClientResources (ClientData *pCD); extern void SetStdClientResourceValues (ClientData *pCD); extern void SetStdScreenResourceValues (WmScreenData *pSD); extern char *WmRealloc (char *ptr, unsigned size); extern char *WmMalloc (char *ptr, unsigned size); extern void SetupDefaultResources (WmScreenData *pSD); extern Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2); #ifdef WSM extern String ResCat (String s1, String s2, String s3, String s4); void CheckForNoDither (AppearanceData *pAD); #endif /* WSM */ #ifndef NO_MESSAGE_CATALOG extern char *builtinSystemMenu; #else extern char builtinSystemMenu[]; #endif extern char builtinKeyBindings[]; extern char builtinRootMenu[]; extern char builtinSystemMenuName[]; #ifndef WSM #define Monochrome(screen) ( DefaultDepthOfScreen(screen) == 1 ) #endif /* not WSM */ motif-2.3.8/clients/mwm/WmImage.c0000644000175000017500000006045113145162623013527 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmImage.c /main/7 1996/11/14 13:50:30 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #define MWM_NEED_IIMAGE #include "WmIBitmap.h" #ifdef MOTIF_ONE_DOT_ONE #include #include #define MATCH_CHAR 'P' /* Default match character - defined in Xmos.p */ #else #include /* Copied from XmosI.h */ extern String _XmOSInitPath( String file_name, String env_pathname, Boolean *user_path) ; #endif #ifdef WSM #include #include
#endif #define MATCH_XBM 'B' /* .xbm character: see XmGetPixmap */ #define MATCH_PATH "XBMLANGPATH" /* * include extern functions */ #include "WmImage.h" #include "WmGraphics.h" #include "WmResource.h" #include "WmResParse.h" #include "WmMenu.h" #include "WmError.h" #ifdef MOTIF_ONE_DOT_ONE extern char *getenv (); #endif /******************************<->************************************* * * MakeClientIconPixmap (pCD, iconBitmap, iconMask) * * * Description: * ----------- * This function takes a client supplied icon image pixmap and mask * bitmap and makes it into a colored pixmap suitable for use as an * icon image. * * * Inputs: * ------ * pCD = pointer to client data (icon colors and tiles) * * iconBitmap = icon bitmap * iconMask = mask bitmap * * * Outputs: * ------- * RETURN = icon pixmap (NULL if error) * ******************************<->***********************************/ Pixmap MakeClientIconPixmap ( ClientData *pCD, Pixmap iconBitmap, Pixmap iconMask) { Window root; int x; int y; unsigned int bitmapWidth; unsigned int bitmapHeight; unsigned int border; unsigned int depth; WmScreenData *pSD; if (pCD) pSD = pCD->pSD; else pSD = wmGD.pActiveSD; /* * Get pixmap attributes and ensure that it is usable. */ if (!XGetGeometry (DISPLAY, iconBitmap, &root, &x, &y, &bitmapWidth, &bitmapHeight, &border, &depth)) { Warning (((char *)GETMESSAGE(38, 1, "Invalid icon pixmap"))); return ((Pixmap)NULL); } /* * Color the bitmap, center it in a pixmap .... */ return (MakeIconPixmap (pCD, iconBitmap, iconMask, bitmapWidth, bitmapHeight, depth)); } /* END OF FUNCTION MakeClientIconPixmap */ /*************************************<->************************************* * * GetNamedPixmap (pCD, iconName) * * * Description: * ----------- * This function gets the named pixmap. bitmapDirectory is searched first * then, if not set, /usr/lib/X11/bitmaps is searched. Finally, if that * also fails, XMBLANGPATH is used. * * Inputs: * ------ * iconName = pointer to the icon name (bitmap file path name or NULL) * * * Outputs: * ------- * RETURN = icon pixmap or XmUNSPECIFIED_PIXMAP * *************************************<->***********************************/ Pixmap GetNamedPixmap (Screen *scr, String iconName, Pixel fg, Pixel bg, int depth) { Pixmap pixmap = XmUNSPECIFIED_PIXMAP; if (iconName) { /* * If name is not absolute, then try the bitmapDirectory location. * Note that bitmapDirectory defaults to "/usr/lib/X11/bitmaps" if * not set. The user could have set bitmapDirectory to "" though. */ if ((iconName[0] != '/') && (wmGD.bitmapDirectory)) { char *fullPathName; fullPathName = (char*) XtMalloc(strlen(wmGD.bitmapDirectory) + strlen(iconName) + 2); sprintf(fullPathName, "%s/%s", wmGD.bitmapDirectory, iconName); pixmap = XmGetPixmapByDepth(scr, fullPathName, fg, bg, depth); XtFree(fullPathName); } /* * If failed to get pixmap with bitmapDirectory, try * using XBMLANGPATH. */ if (!PIXMAP_IS_VALID( pixmap )) pixmap = XmGetPixmapByDepth(scr, iconName, fg, bg, depth); /* * Warning message handling on error left to the calling routine. */ } return (pixmap); } /*************************************<->************************************* * * MakeNamedIconPixmap (pCD, iconName) * * * Description: * ----------- * This function makes an icon pixmap for a particular client given the * name of a bitmap file. * * * Inputs: * ------ * pCD = (nonNULL) pointer to client data * iconName = pointer to the icon name (bitmap file path name or NULL) * * * Outputs: * ------- * RETURN = icon pixmap or NULL * *************************************<->***********************************/ Pixmap MakeNamedIconPixmap (ClientData *pCD, String iconName) { Pixmap pixmap; unsigned int width, height; int depth; if (iconName) { pixmap = GetNamedPixmap (ScreenOfDisplay(DISPLAY, pCD->pSD->screen), iconName, pCD->iconImageForeground, pCD->iconImageBackground, DefaultDepth(DISPLAY, pCD->pSD->screen)); if (!PIXMAP_IS_VALID( pixmap )) { Warning (((char *)GETMESSAGE(38, 1, "Invalid icon pixmap"))); } else { XmeGetPixmapData(ScreenOfDisplay(DISPLAY, pCD->pSD->screen), pixmap, NULL, &depth, NULL, NULL, NULL, NULL, &width, &height); pixmap = MakeIconPixmap (pCD, pixmap, XmUNSPECIFIED_PIXMAP, width, height, depth); } } /* * If no name was given or we couldn't find the specified pixmap, * then use the default. */ if (!iconName || (!PIXMAP_IS_VALID( pixmap ))) { pixmap = MakeIconPixmap (pCD, pCD->pSD->builtinIconPixmap, XmUNSPECIFIED_PIXMAP, iImage_width, iImage_height, 1); } return (pixmap); } /* END OF FUNCTION MakeNamedIconPixmap */ /*************************************<->************************************* * * MakeIconPixmap (pCD, bitmap, mask, width, height, depth) * * * Description: * ----------- * Convert the bitmap and mask into an icon pixmap. * * * Inputs: * ------ * pCD - pointer to client data (icon colors and tiles) * pWS - pointer to workspace data * bitmap - bitmap image to be converted * mask - bitmap mask, 1 for bits of "bitmap" to be kept * width - pixel width of bitmap * height - pixel height of bitmap * depth - depth of bitmap (pixmap, really) * * * Outputs: * ------- * RETURN - icon pixmap or NULL * * * Comments: * -------- * o "mask" is not used. * *************************************<->***********************************/ Pixmap MakeIconPixmap (ClientData *pCD, Pixmap bitmap, Pixmap mask, unsigned int width, unsigned int height, unsigned int depth) { Pixmap iconPixmap; GC imageGC, topGC, botGC; XGCValues gcv; #ifdef WSM unsigned long gc_mask; XmPixelSet *pPS = NULL; #endif /* WSM */ unsigned int imageWidth; unsigned int imageHeight; int dest_x, dest_y; #ifndef NO_CLIP_CENTER int src_x, src_y; #endif /* NO_CLIP_CENTER */ Pixel fg; Pixel bg; static RList *top_rects = NULL; static RList *bot_rects = NULL; WmScreenData *pSD; if ((top_rects == NULL) && (top_rects = AllocateRList ((unsigned)2 * ICON_INTERNAL_SHADOW_WIDTH)) == NULL) { /* Out of memory! */ Warning (((char *)GETMESSAGE(38, 3, "Insufficient memory to bevel icon image"))); return ((Pixmap)NULL); } if ((bot_rects == NULL) && (bot_rects = AllocateRList ((unsigned)2 * ICON_INTERNAL_SHADOW_WIDTH)) == NULL) { /* Out of memory! */ Warning (((char *)GETMESSAGE(38, 4, "Insufficient memory to bevel icon image"))); return ((Pixmap)NULL); } if (pCD) { pSD = pCD->pSD; } else { pSD = wmGD.pActiveSD; } /* don't make icon pixmap if bitmap is too small */ if ((width < pSD->iconImageMinimum.width) || (height < pSD->iconImageMinimum.height)) { /* bitmap is too small */ return ((Pixmap)NULL); } #ifndef NO_CLIP_CENTER /* copy the center of the icon if too big */ if (width > pSD->iconImageMaximum.width) { src_x = (width - pSD->iconImageMaximum.width)/2; } else { src_x = 0; } if (height > pSD->iconImageMaximum.height) { src_y = (height - pSD->iconImageMaximum.height)/2; } else { src_y = 0; } #endif /* NO_CLIP_CENTER */ /* * SLAB frameStyle adds a single pixel of background color around * the image to set it off from the beveling. */ imageWidth = pSD->iconImageMaximum.width + 2 * ICON_INTERNAL_SHADOW_WIDTH + ((wmGD.frameStyle == WmSLAB) ? 2 : 0); imageHeight = pSD->iconImageMaximum.height + 2 * ICON_INTERNAL_SHADOW_WIDTH + ((wmGD.frameStyle == WmSLAB) ? 2 : 0); /* create a pixmap (to be returned) */ iconPixmap = XCreatePixmap (DISPLAY, pSD->rootWindow, imageWidth, imageHeight, DefaultDepth(DISPLAY, pSD->screen)); /* * If a client is not specified use icon component colors, otherwise * use the client-specific icon colors. */ if (pCD) { bg = pCD->iconImageBackground; fg = pCD->iconImageForeground; } else { bg = pSD->iconAppearance.background; fg = pSD->iconAppearance.foreground; } /* create a GC to use */ #ifdef WSM gc_mask = GCForeground | GCBackground | GCGraphicsExposures; if (mask) { if (pSD->pPrimaryPixelSet != NULL) { pPS = pSD->pPrimaryPixelSet; gcv.background = pPS->bg; /* set fg to bg color to clear it first */ gcv.foreground = pPS->bg; } else { gcv.background = ICON_APPEARANCE(pCD).background; /* set fg to bg color to clear it first */ gcv.foreground = ICON_APPEARANCE(pCD).background; } } else { gcv.foreground = bg; /* clear it first! */ gcv.background = bg; } gcv.graphics_exposures = False; imageGC = XCreateGC (DISPLAY, iconPixmap, gc_mask, &gcv); #else /* WSM */ gcv.foreground = bg; /* clear it first! */ gcv.background = bg; gcv.graphics_exposures = False; imageGC = XCreateGC (DISPLAY, iconPixmap, (GCForeground|GCBackground), &gcv); #endif /* WSM */ /* * Format the image. */ /* fill in background */ XFillRectangle(DISPLAY, iconPixmap, imageGC, 0, 0, imageWidth, imageHeight); /* center the image */ if (width > pSD->iconImageMaximum.width) { width = pSD->iconImageMaximum.width; } if (height > pSD->iconImageMaximum.height) { height = pSD->iconImageMaximum.height; } /* center the image */ dest_x = (imageWidth - width) / 2; dest_y = (imageHeight - height) / 2; #ifdef WSM if (mask) { if (pPS != NULL) { gcv.foreground = pPS->fg; } else { gcv.foreground = ICON_APPEARANCE(pCD).foreground; } } else { gcv.foreground = fg; } gc_mask = GCForeground; if (mask) { gcv.clip_mask = mask; #ifndef NO_CLIP_CENTER gcv.clip_x_origin = dest_x - src_x; gcv.clip_y_origin = dest_y - src_y; #else /* NO_CLIP_CENTER */ gcv.clip_x_origin = dest_x; gcv.clip_y_origin = dest_y; #endif /* NO_CLIP_CENTER */ gc_mask |= GCClipXOrigin | GCClipYOrigin | GCClipMask; } XChangeGC (DISPLAY, imageGC, gc_mask, &gcv); #else /* WSM */ /* set the foreground */ XSetForeground (DISPLAY, imageGC, fg); #endif /* WSM */ /* copy the bitmap to the pixmap */ #ifndef DISALLOW_DEEP_ICONS if ((depth > 1) && (depth == DefaultDepth(DISPLAY, pSD->screen))) { #ifndef NO_CLIP_CENTER XCopyArea (DISPLAY, bitmap, iconPixmap, imageGC, src_x, src_y, width, height, dest_x, dest_y); #else /* NO_CLIP_CENTER */ XCopyArea (DISPLAY, bitmap, iconPixmap, imageGC, 0, 0, width, height, dest_x, dest_y); #endif /* NO_CLIP_CENTER */ } else #endif /* DISALLOW_DEEP_ICONS */ #ifndef NO_CLIP_CENTER XCopyPlane (DISPLAY, bitmap, iconPixmap, imageGC, src_x, src_y, width, height, dest_x, dest_y, 1L); #else /* NO_CLIP_CENTER */ XCopyPlane (DISPLAY, bitmap, iconPixmap, imageGC, 0, 0, width, height, dest_x, dest_y, 1L); #endif /* NO_CLIP_CENTER */ /* free resources */ XFreeGC (DISPLAY, imageGC); if (pCD) { /* * Shadowing */ #ifdef WSM if (mask && (pPS != NULL)) { topGC = GetHighlightGC (pSD, pPS->ts, pPS->bg, pCD->iconImageTopShadowPixmap); botGC = GetHighlightGC (pSD, pPS->bs, pPS->bg, pCD->iconImageBottomShadowPixmap); } else { #endif /* WSM */ topGC = GetHighlightGC (pSD, pCD->iconImageTopShadowColor, pCD->iconImageBackground, pCD->iconImageTopShadowPixmap); botGC = GetHighlightGC (pSD, pCD->iconImageBottomShadowColor, pCD->iconImageBackground, pCD->iconImageBottomShadowPixmap); #ifdef WSM } #endif /* WSM */ /* * CR5208 - Better fix than from OSF! * Zero out the rectangle count in our * static structures so that BevelRectangle * won't extend the RList causing a memory leak. * Old fix allocated and freed rectangle structure * each time through. */ top_rects->used = 0; /* reset count */ bot_rects->used = 0; BevelRectangle (top_rects, bot_rects, 0, 0, imageWidth, imageHeight, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH, ICON_INTERNAL_SHADOW_WIDTH); XFillRectangles (DISPLAY, iconPixmap, topGC, top_rects->prect, top_rects->used); XFillRectangles (DISPLAY, iconPixmap, botGC, bot_rects->prect, bot_rects->used); } return (iconPixmap); } /* END OF FUNCTION MakeIconPixmap */ /*************************************<->************************************* * * Pixmap * MakeCachedLabelPixmap (pSD, menuW, bitmapIndex) * * * Description: * ----------- * Creates and returns a label pixmap. * * * Inputs: * ------ * pSD = pointer to screen data * menuW = menu widget (for foreground and background colors) * bitmapIndex = bitmap cache index * * * Outputs: * ------- * Return = label pixmap or NULL. * * * Comments: * -------- * Assumes bitmapIndex is valid. * *************************************<->***********************************/ Pixmap MakeCachedLabelPixmap (WmScreenData *pSD, Widget menuW, int bitmapIndex) { BitmapCache *bitmapc; PixmapCache *pixmapc; int i; Arg args[5]; Pixel fg, bg; Pixmap pixmap = (Pixmap)NULL; GC gc; XGCValues gcv; if (bitmapIndex < 0) { return ((Pixmap)NULL); } bitmapc = &(pSD->bitmapCache[bitmapIndex]); /* * Get the foreground and background colors from the menu widget. * Search for a label pixmap matching those colors. */ i = 0; XtSetArg (args[i], XtNforeground, &fg); i++; XtSetArg (args[i], XtNbackground, &bg); i++; XtGetValues (menuW, (ArgList)args, i); pixmapc = bitmapc->pixmapCache; while (pixmapc) { if ((pixmapc->pixmapType == LABEL_PIXMAP) && (pixmapc->foreground == fg) && (pixmapc->background == bg)) { pixmap = pixmapc->pixmap; break; } pixmapc = pixmapc->next; } if (!pixmap) /* * A matching pixmap was not found in the pixmap cache for this bitmap. * Create and save the label pixmap with appropriate colors. */ { /* * Create a pixmap of the appropriate size, root, and depth. * Only BadAlloc error possible; BadDrawable and BadValue are avoided. */ pixmap = XCreatePixmap (DISPLAY, pSD->rootWindow, bitmapc->width, bitmapc->height, DefaultDepth (DISPLAY, pSD->screen)); /* * Create a GC and copy the bitmap to the pixmap. * Only BadAlloc and BadDrawable errors are possible; others are avoided */ gcv.foreground = bg; gcv.background = bg; gcv.graphics_exposures = False; gc = XCreateGC(DISPLAY, pixmap, (GCForeground|GCBackground), &gcv); /* * Fill in the background, set the foreground, copy the bitmap to the * pixmap, and free the gc. */ XFillRectangle (DISPLAY, pixmap, gc, 0, 0, bitmapc->width, bitmapc->height); XSetForeground (DISPLAY, gc, fg); XCopyPlane (DISPLAY, bitmapc->bitmap, pixmap, gc, 0, 0, bitmapc->width, bitmapc->height, 0, 0, 1L); XFreeGC (DISPLAY, gc); /* * If have sufficient memory, save the pixmap info in the pixmapCache. */ if ((pixmapc = (PixmapCache *) XtMalloc(sizeof(PixmapCache))) != NULL) { pixmapc->pixmapType = LABEL_PIXMAP; pixmapc->foreground = fg; pixmapc->background = bg; pixmapc->pixmap = pixmap; pixmapc->next = bitmapc->pixmapCache; bitmapc->pixmapCache = pixmapc; } } return (pixmap); } /* END OF FUNCTION MakeCachedLabelPixmap */ /*************************************<->************************************* * * int * GetBitmapIndex (pSD, name) * * * Description: * ----------- * Retrieve bitmap from cache. * * * Inputs: * ------ * pSD = pointer to screen data * name = bitmap file name or NULL pointer * bitmapCache[] * bitmapCacheSize * bitmapCacheCount * * * Outputs: * ------- * bitmapCache[] * bitmapCacheSize * bitmapCacheCount * Return = bitmap cache index or -1 * * * Comments: * -------- * None * *************************************<->***********************************/ #define BITMAP_CACHE_INC 5 #ifdef WSM int GetBitmapIndex (WmScreenData *pSD, char *name, Boolean bReportError) #else /* WSM */ int GetBitmapIndex (WmScreenData *pSD, char *name) #endif /* WSM */ { char *path; BitmapCache *bitmapc; unsigned int n; int x, y; /* * Search a nonempty bitmap cache for a pathname match. */ path = BitmapPathName (name); for (n = 0, bitmapc = pSD->bitmapCache; n < pSD->bitmapCacheCount; n++, bitmapc++) { if ((!path && !bitmapc->path) || (path && bitmapc->path && !strcmp (path, bitmapc->path))) { return (n); } } /* * The bitmap path name was not found in bitmapCache. * Find the next BitmapCache entry, creating or enlarging bitmapCache if * necessary. */ if (pSD->bitmapCacheSize == 0) /* create */ { pSD->bitmapCacheSize = BITMAP_CACHE_INC; pSD->bitmapCache = (BitmapCache *) XtMalloc (BITMAP_CACHE_INC * sizeof (BitmapCache)); } else if (pSD->bitmapCacheCount == pSD->bitmapCacheSize) /* enlarge */ { pSD->bitmapCacheSize += BITMAP_CACHE_INC; pSD->bitmapCache = (BitmapCache *) XtRealloc ((char*)pSD->bitmapCache, pSD->bitmapCacheSize * sizeof (BitmapCache)); } if (pSD->bitmapCache == NULL) { MWarning (((char *)GETMESSAGE(38, 5, "Insufficient memory for bitmap %s\n")), name); pSD->bitmapCacheSize = 0; pSD->bitmapCacheCount = 0; return (-1); } bitmapc = &(pSD->bitmapCache[pSD->bitmapCacheCount]); /* * Fill the entry with the bitmap info. * A NULL path indicates the builtin icon bitmap. * Indicate that no pixmapCache exists yet. */ if (path) { if ((bitmapc->path = (String) XtMalloc ((unsigned int)(strlen (path) + 1))) == NULL) { MWarning (((char *)GETMESSAGE(38, 6, "Insufficient memory for bitmap %s\n")), name); return (-1); } strcpy (bitmapc->path, path); if (XReadBitmapFile (DISPLAY, pSD->rootWindow, path, &bitmapc->width, &bitmapc->height, &bitmapc->bitmap, &x, &y) != BitmapSuccess) { #ifdef WSM if (bReportError) #endif /* WSM */ MWarning (((char *)GETMESSAGE(38, 7, "Unable to read bitmap file %s\n")), path); XtFree ((char *)bitmapc->path); return (-1); } if (bitmapc->width == 0 || bitmapc->height == 0) { #ifdef WSM if (bReportError) #endif /* WSM */ MWarning (((char *)GETMESSAGE(38, 8, "Invalid bitmap file %s\n")), path); XtFree ((char *)bitmapc->path); return (-1); } } else /* builtin icon bitmap */ { bitmapc->path = NULL; bitmapc->bitmap = pSD->builtinIconPixmap; bitmapc->width = iImage_width; bitmapc->height = iImage_height; } bitmapc->pixmapCache = NULL; return (pSD->bitmapCacheCount++); } /* END OF FUNCTION GetBitmapIndex */ /*************************************<->************************************* * * BitmapPathName (string) * * * Description: * ----------- * Constructs a bitmap file pathname from the bitmap file name and the * bitmapDirectory resource value. * * * Inputs: * ------ * string = bitmap file name or NULL * wmGD.bitmapDirectory = bitmapDirectory resource value * HOME = environment variable for home directory * XBMLANGPATH * XAPPLRESDIR * * * Outputs: * ------- * Return = string containing the bitmap file pathname or NULL. * * * Comments: * -------- * If the bitmap file does not exist, searches using XBMLANGPATH. * Returns NULL path name for a NULL file name. * *************************************<->***********************************/ char *BitmapPathName (string) char *string; { static char fileName[MAXWMPATH+1]; char *retname; SubstitutionRec subs[1]; #ifndef MOTIF_ONE_DOT_ONE char *homeDir = XmeGetHomeDirName(); #endif if (!string || !*string) { return (NULL); } /* * Interpret "~/.." as relative to the user's home directory. * Interpret "/.." as an absolute pathname. * If the bitmapDirectory resource is nonNULL, interpret path as relative * to it. * Else, or if bitmapDirectory has no such file, use a XBMLANGPATH lookup. */ if ((string[0] == '~') && (string[1] == '/')) /* * Handle "~/.." */ { #ifdef MOTIF_ONE_DOT_ONE GetHomeDirName(fileName); #else strcpy (fileName, homeDir); #endif strncat (fileName, &(string[1]), MAXWMPATH - strlen (fileName)); return (fileName); } if (string[0] == '/') { return(string); } if (wmGD.bitmapDirectory && *wmGD.bitmapDirectory) /* * Relative to nonNULL bitmapDirectory (which may have relative to HOME) */ { if ((wmGD.bitmapDirectory[0] == '~') && (wmGD.bitmapDirectory[1] == '/')) { #ifdef MOTIF_ONE_DOT_ONE GetHomeDirName(fileName); #else strcpy (fileName, homeDir); #endif strncat (fileName, &wmGD.bitmapDirectory[1], MAXWMPATH - strlen (fileName)); } else { strcpy (fileName, wmGD.bitmapDirectory); } strncat (fileName, "/", MAXWMPATH - strlen (fileName)); strncat (fileName, string, MAXWMPATH - strlen (fileName)); /* Test file for existence. */ subs[0].substitution = ""; if ((retname = XtFindFile(fileName, subs, 0, (XtFilePredicate) NULL)) != NULL) { XtFree(retname); return (fileName); } } /* Fall back on a path search */ #ifdef MOTIF_ONE_DOT_ONE return (NULL); #else { char *search_path; Boolean user_path; search_path = _XmOSInitPath(string, MATCH_PATH, &user_path); subs[0].match = user_path ? MATCH_XBM : MATCH_CHAR; subs[0].substitution = string; retname = XtResolvePathname(DISPLAY, "bitmaps", NULL, NULL, search_path, subs, XtNumber(subs), (XtFilePredicate)NULL); XtFree(search_path); if (!retname) return (string); strncpy(fileName, retname, MAXWMPATH); XtFree(retname); return (fileName); } #endif } /* END OF FUNCTION BitmapPathName */ #ifdef WSM /**************************** eof ***************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/Makefile.in0000644000175000017500000007621613211512765014110 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = mwm$(EXEEXT) subdir = clients/mwm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(rcdir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = WmCDInfo.$(OBJEXT) WmCDecor.$(OBJEXT) \ WmCEvent.$(OBJEXT) WmCPlace.$(OBJEXT) WmColormap.$(OBJEXT) \ WmError.$(OBJEXT) WmEvent.$(OBJEXT) WmFeedback.$(OBJEXT) \ WmFunction.$(OBJEXT) WmGraphics.$(OBJEXT) WmIDecor.$(OBJEXT) \ WmIPlace.$(OBJEXT) WmIconBox.$(OBJEXT) WmKeyFocus.$(OBJEXT) \ WmMain.$(OBJEXT) WmManage.$(OBJEXT) WmProperty.$(OBJEXT) \ WmResCvt.$(OBJEXT) WmResParse.$(OBJEXT) WmResource.$(OBJEXT) \ WmSignal.$(OBJEXT) WmWinConf.$(OBJEXT) WmWinInfo.$(OBJEXT) \ WmWinList.$(OBJEXT) WmWinState.$(OBJEXT) WmWsm.$(OBJEXT) \ WmXSMP.$(OBJEXT) version.$(OBJEXT) WmCmd.$(OBJEXT) \ WmImage.$(OBJEXT) WmInitWs.$(OBJEXT) WmMenu.$(OBJEXT) \ WmProtocol.$(OBJEXT) am_mwm_OBJECTS = $(am__objects_1) mwm_OBJECTS = $(am_mwm_OBJECTS) mwm_DEPENDENCIES = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mwm_SOURCES) DIST_SOURCES = $(mwm_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(rc_DATA) HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = Mwm.msg $(rc_DATA) SUBDIRS = WmWsmLib rcdir = $(MWMRCDIR) rc_DATA = system.mwmrc mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART \ -DCDE_INSTALLATION_TOP=\"@CDE_INSTALLATION_TOP@\" \ -DCDE_CONFIGURATION_TOP=\"@CDE_CONFIGURATION_TOP@\" \ -DBITMAPDIR=\"@INCDIR@/bitmaps\" \ -DMWMRCDIR=\"$(MWMRCDIR)\" \ -I$(top_builddir)/lib \ -I$(srcdir)/../../lib ${X_CFLAGS} SRCS1 = WmCDInfo.c WmCDecor.c WmCEvent.c\ WmCPlace.c WmColormap.c WmError.c\ WmEvent.c WmFeedback.c \ WmFunction.c WmGraphics.c WmIDecor.c\ WmIPlace.c WmIconBox.c \ WmKeyFocus.c WmMain.c WmManage.c\ WmProperty.c WmResCvt.c\ WmResParse.c WmResource.c WmSignal.c \ WmWinConf.c WmWinInfo.c WmWinList.c WmWinState.c \ WmWsm.c WmXSMP.c version.c WmCmd.c WmImage.c WmInitWs.c WmMenu.c WmProtocol.c noinst_HEADERS = WmBitmap.h \ WmCDInfo.h \ WmCDecor.h \ WmCEvent.h \ WmCPlace.h \ WmCmd.h \ WmColormap.h \ WmDebug.h \ WmError.h \ WmEvent.h \ WmFeedback.h \ WmFunction.h \ WmGlobal.h \ WmGraphics.h \ WmIBitmap.h \ WmICCC.h \ WmIDecor.h \ WmIPlace.h \ WmIconBox.h \ WmImage.h \ WmInitWs.h \ WmKeyFocus.h \ WmManage.h \ WmMenu.h \ WmOL.h \ WmProperty.h \ WmProtocol.h \ WmResCvt.h \ WmResNames.h \ WmResParse.h \ WmResource.h \ WmSignal.h \ WmWinConf.h \ WmWinInfo.h \ WmWinList.h \ WmWinState.h \ WmWsm.h \ WmXSMP.h mwm_SOURCES = $(SRCS1) @MessageCatalog_TRUE@CAT_FILES = Mwm.cat MwmMsgCatI.h all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clients/mwm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign clients/mwm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list mwm$(EXEEXT): $(mwm_OBJECTS) $(mwm_DEPENDENCIES) $(EXTRA_mwm_DEPENDENCIES) @rm -f mwm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mwm_OBJECTS) $(mwm_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmCDInfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmCDecor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmCEvent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmCPlace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmCmd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmColormap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmError.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmEvent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmFeedback.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmFunction.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmGraphics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmIDecor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmIPlace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmIconBox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmImage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmInitWs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmKeyFocus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmMain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmManage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmMenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmProperty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmProtocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmResCvt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmResParse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmResource.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmSignal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmWinConf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmWinInfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmWinList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmWinState.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmWsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WmXSMP.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-rcDATA: $(rc_DATA) @$(NORMAL_INSTALL) @list='$(rc_DATA)'; test -n "$(rcdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(rcdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(rcdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rcdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(rcdir)" || exit $$?; \ done uninstall-rcDATA: @$(NORMAL_UNINSTALL) @list='$(rc_DATA)'; test -n "$(rcdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(rcdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(DATA) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(rcdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-rcDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-rcDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-rcDATA install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-rcDATA .PRECIOUS: Makefile @MessageCatalog_TRUE@$(CAT_FILES): Mwm.msg @MessageCatalog_TRUE@ $(mkinstalldirs) $(top_builddir)/localized/C/msg @MessageCatalog_TRUE@ $(top_builddir)/localized/util/mkcatdefs MwmMsgCatI.h $(srcdir)/Mwm.msg >$(top_builddir)/localized/C/msg/Mwm.msg @MessageCatalog_TRUE@ gencat Mwm.cat $(top_builddir)/localized/C/msg/Mwm.msg # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/clients/mwm/WmFunction.c0000644000175000017500000034356313145162623014302 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmFunction.c /main/19 1998/04/20 13:00:48 mgreess $" #endif #endif #define FIX_1350 1 /* * Included Files: */ #include "WmGlobal.h" #include #ifndef X_NOT_STDC_ENV #include #include #include #else extern int putenv(); extern char *getenv(); extern int atoi(); extern pid_t wait(); #ifndef PORT_NOVFORK extern pid_t vfork(); #endif /* PORT_NOVFORK */ #endif #ifndef WSM #include #endif #include #include #include "WmICCC.h" #ifdef WSM #include "WmWrkspace.h" /* for ClientInWorkspace() test */ #include
/* for restoring **environ before an exec() */ #include "WmResNames.h" #include
#include
#endif /* WSM */ #ifdef PANELIST #include
#include "WmPanelP.h" #include "WmSignal.h" #endif /* PANELIST */ /* * include extern functions */ #include "WmFunction.h" #include "WmCEvent.h" #ifdef WSM #include "WmHelp.h" #endif /* WSM */ #include "WmCDInfo.h" #include "WmColormap.h" #include "WmError.h" #include "WmEvent.h" #include "WmFeedback.h" #ifdef WSM #include "WmIPC.h" #endif /* WSM */ #include "WmIPlace.h" #include "WmIconBox.h" #include "WmKeyFocus.h" #include "WmMenu.h" #ifdef WSM #include "WmPresence.h" #endif /* WSM */ #include "WmProperty.h" #include "WmProtocol.h" #include "WmResParse.h" #include "WmWinConf.h" #include "WmWinInfo.h" #include "WmWinList.h" #include "WmWinState.h" #include "WmXSMP.h" #include "WmCmd.h" #include /* for MS_LastManagedMenuTime */ extern XmMenuState _XmGetMenuState(); static unsigned int GetEventInverseMask(XEvent *event); #ifdef WSM #if (defined(USL) || defined(__uxp__) || defined(linux)) && !defined(_NFILE) #define _NFILE FOPEN_MAX #endif #define CLOSE_FILES_ON_EXEC() \ {int ifx; for (ifx=3; ifx < _NFILE; ifx++) (void) fcntl (ifx, F_SETFD, 1);} #endif /* WSM */ /* * Global Variables: */ /* * The 'dirty' variables are used to keep track of the transient window * that has been lowered via "f.lower freeFamily". */ static ClientData *dirtyStackEntry = NULL; static ClientData *dirtyLeader = NULL; #ifdef WSM /***********************<->************************************* * * F_Action (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for invoking actions. * * * Inputs: * ------ * args = action function and arguments * * pCD = pointer to the ClientData for the whole front panel * * event = X event that invoked the function (key, button, or menu/NULL) * * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * * Comments: * ------- * The pCD->controlWindow is a temporary area used solely for * this function invocation--it stores the pCW of the control * that want the function to happen. ******************************<->***********************************/ Boolean F_Action (String actionName, ClientData *pCD, XEvent *event) { WmActionArg *pAP = (WmActionArg *) actionName; /* make sure the command runs on the right display. */ if (wmGD.pActiveSD->displayString) { putenv(wmGD.pActiveSD->displayString); } if (wmGD.dtSD) { WmFrontPanelSetBusy (True); } DtActionInvoke (wmGD.pActiveSD->screenTopLevelW1, pAP->actionName, pAP->aap, pAP->numArgs, pAP->szExecParms, NULL, NULL, 1, NULL, NULL); /* * Restore original DISPLAY environment variable */ if(wmGD.pActiveSD->displayString && wmGD.displayString) { putenv(wmGD.displayString); } return (True); } /* END OF FUNCTION F_Action */ #endif /* WSM */ /******************************<->************************************* * * F_Beep (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for beeping. * * * Inputs: * ------ * args = function arguments (specified in .mwmrc file) * * pCD = pointer to the client data for the client window to which the * function is to be applied * * event = X event that invoked the function (key, button, or menu/NULL) * * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * ******************************<->***********************************/ Boolean F_Beep (String args, ClientData *pCD, XEvent *event) { /* !!! what is a good value for percent (the second arg) !!! */ XBell (DISPLAY, 0); return (True); } /* END OF FUNCTION F_Beep */ /* * Handle Special case where the dirty window is the top most * transient window. When this is the case, raising the window * that was on top (the window just below the dirty window) will * fail because Mwm stack database is out of sync. So the solution * is to restack the dirty transient relative to the second to the * top transient. This function is used to support freeFamily stacking. */ ClientData * FindSecondToTopTransient (pcd) ClientData *pcd; { ClientData *pcdNext; static ClientData *second; pcdNext = pcd->transientChildren; while (pcdNext) { if (pcdNext->transientChildren) { if (!pcdNext->transientChildren->transientChildren) { second = pcdNext; } FindSecondToTopTransient (pcdNext); } pcdNext = pcdNext->transientSiblings; if (pcdNext && !pcdNext->transientSiblings) { second = pcdNext; } } return (second); } /* END OF FUNCTION */ Boolean ForceLowerWindow (ClientData *pcd) { #if 0 Window stackWindow; WmScreenData *pSD = (ACTIVE_WS)->pSD; #endif XWindowChanges changes; Boolean restack = False; #ifdef WSM Window stackWindow; WmScreenData *pSD = (ACTIVE_WS)->pSD; unsigned int mask; ClientListEntry *pCLE; /* * Find lowest window in this workspace. We'll stack this transient * below it. */ pCLE = pSD->lastClient; stackWindow = None; mask = CWStackMode; while (pCLE != NULL) { if ((pCLE->pCD != pcd) && (ClientInWorkspace (ACTIVE_WS, pCLE->pCD))) { if ((pCLE->type == MINIMIZED_STATE) && (pCLE->pCD->clientState == MINIMIZED_STATE)) { stackWindow = ICON_FRAME_WIN(pCLE->pCD); } else if ((pCLE->type == NORMAL_STATE) && ((pCLE->pCD->clientState == NORMAL_STATE) || (pCLE->pCD->clientState == MAXIMIZED_STATE))) { stackWindow = pCLE->pCD->clientFrameWin; } if (stackWindow != None) { mask |= CWSibling; changes.sibling = stackWindow; break; } } if (stackWindow == None) { pCLE = pCLE->prevSibling; } } #endif /* WSM */ #if 0 if (pSD->lastClient->type == MINIMIZED_STATE) { stackWindow = ICON_FRAME_WIN(pSD->lastClient->pCD); } else { stackWindow = pSD->lastClient->pCD->clientFrameWin; } #endif changes.stack_mode = Below; #ifdef WSM if (mask) { XConfigureWindow (DISPLAY, pcd->clientFrameWin, mask, &changes); } #else /* WSM */ XConfigureWindow (DISPLAY, pcd->clientFrameWin, CWStackMode, &changes); #endif /* WSM */ return (restack); } /*************************************<->************************************* * * F_Lower (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for bottoming a client window * or icon. * * * Inputs: * ------ * args = function arguments (specified in .mwmrc file) * * pCD = pointer to the client data for the client window to which the * function is to be applied * * event = X event that invoked the function (key, button, or menu/NULL) * * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * *************************************<->***********************************/ Boolean F_Lower (String args, ClientData *pCD, XEvent *event) { ClientListEntry *pEntry; ClientListEntry *pNextEntry; ClientListEntry *pStackEntry; String string = args; int flags = STACK_NORMAL; #ifdef WSM WmWorkspaceData *pWS = ACTIVE_WS; #endif /* WSM */ if (string) { /* process '-client' argument */ if (string[0] == '-') { string = &string[1]; string = (String) GetString ((unsigned char **) &string); pStackEntry = NULL; pNextEntry = ACTIVE_PSD->lastClient; while (pNextEntry && (pEntry = FindClientNameMatch (pNextEntry, False, string, F_GROUP_ALL))) { pNextEntry = pEntry->prevSibling; #ifdef WSM if (ClientInWorkspace (pWS, pEntry->pCD)) { #endif /* WSM */ Do_Lower (pEntry->pCD, pStackEntry, STACK_NORMAL); pStackEntry = pEntry; #ifdef WSM } #endif /* WSM */ } } /* process family stacking stuff */ else if (*string) { unsigned int slen, len, index; slen = strlen(args) - 2; /* subtract '\n' and NULL */ for (index = 0; index < slen; string = &args[index+1]) { if ((string = (String) GetString ((unsigned char **) &string)) == NULL) break; len = strlen(string); if (!strcmp(string,"within")) { flags |= STACK_WITHIN_FAMILY; } else if (!strcmp(string,"freeFamily")) { flags |= STACK_FREE_FAMILY; } index += len; } #ifdef WSM if (ClientInWorkspace (pWS, pCD)) { #endif /* WSM */ Do_Lower (pCD, (ClientListEntry *) NULL, flags); #ifdef WSM } #endif /* WSM */ } } else if (pCD) { #ifdef WSM if (ClientInWorkspace (pWS, pCD)) { #endif /* WSM */ Do_Lower (pCD, (ClientListEntry *) NULL, STACK_NORMAL); #ifdef WSM } #endif /* WSM */ } /* * If caused by button press, event may ALSO cause focus to be * passed to this client - prepare to disable focusAutoRaise. */ if (pCD && event && (event->type == ButtonPress)) pCD->focusAutoRaiseDisablePending = True; wmGD.passButtonsCheck = False; return (True); } /* END OF FUNCTION F_Lower */ /*************************************<->************************************* * * Do_Lower (pCD, pStackEntry) * * * Description: * ----------- * This is the window manager function handler for lowering the client window * so that it does not obscure any other window above the stack entry * window. * * * Inputs: * ------ * pCD = pointer to the client data of the window (or icon) to be lowered. * * pStackEntry = pointer to client list entry for window that is to be * below the lowered window (if NULL, window is lowered to the bottom * of the stack). * *************************************<->***********************************/ void Do_Lower (ClientData *pCD, ClientListEntry *pStackEntry, int flags) { Boolean restackTransients; ClientData *pcdLeader; WmWorkspaceData *pWS = ACTIVE_WS; #ifdef WSM Boolean bLeaderRestacked; #endif /* WSM */ #ifdef PANELIST if (pCD->pECD) { /* * Window has been reparented into the front panel. * Don't follow through on window stacking change. */ return; } else #else /* PANELIST */ #endif /* PANELIST */ #ifdef WSM if (ClientInWorkspace(pWS, pCD) && (!pStackEntry || ClientInWorkspace (pWS, pStackEntry->pCD))) { /* * Both clients are in the current workspace. Set * client indices so that the access macros work. */ SetClientWsIndex (pCD); if (pStackEntry) { SetClientWsIndex (pStackEntry->pCD); } } else { /* * One or both of the clients are not in the current workspace * Do nothing. */ return; } #endif /* WSM */ pcdLeader = (pCD->transientLeader) ? FindTransientTreeLeader (pCD) : pCD; if ((pcdLeader->clientState == MINIMIZED_STATE) && !P_ICON_BOX(pcdLeader)) { /* * If a dirtyStackEntry exists, return it to its original place * in the stack (for all stacking types) */ if (dirtyStackEntry) { if (dirtyStackEntry->transientChildren || dirtyStackEntry->transientLeader) RestackTransients (dirtyStackEntry); dirtyStackEntry = NULL; dirtyLeader = NULL; } /* * Only restack the icon if it is not currently lowered. */ if (pStackEntry) { if (pStackEntry->prevSibling != &pcdLeader->iconEntry) { StackWindow (pWS, &pcdLeader->iconEntry, True /*above*/, pStackEntry); MoveEntryInList (pWS, &pcdLeader->iconEntry, True /*above*/, pStackEntry); } } else { if (ACTIVE_PSD->lastClient != &pcdLeader->iconEntry) { StackWindow (pWS, &pcdLeader->iconEntry, False /*on bottom*/, (ClientListEntry *) NULL); MoveEntryInList (pWS, &pcdLeader->iconEntry, False /*on bottom*/, (ClientListEntry *) NULL); } } } else /* NORMAL_STATE, MAXIMIZED_STATE, adoption */ { #ifdef WSM /* * Handle restacking of primary/secondary windows * within the transient window tree. */ bLeaderRestacked = False; if ((pcdLeader->transientChildren) && (!pcdLeader->secondariesOnTop) && (!wmGD.bSuspendSecondaryRestack)) { if (pCD == pcdLeader) { /* * Lower requested on the leader itself, insure it's * at the bottom. */ bLeaderRestacked = BumpPrimaryToBottom (pcdLeader); } else if (pCD->transientChildren) { /* * Lower requested on the leader of a subtree. Insure * that this subtree leader is at the bottom of the * subtree. */ bLeaderRestacked = BumpPrimaryToBottom (pCD); } else if (pCD->transientLeader) { ClientData *pcdLdr; /* * Lower requested on a transient. Insure all the * subtree leaders up to the top are at the bottom * of their respective transient subtrees. */ for (pcdLdr = pCD->transientLeader; pcdLdr; pcdLdr = pcdLdr->transientLeader) { bLeaderRestacked |= BumpPrimaryToBottom (pcdLdr); } } } #endif /* WSM */ /* * If this is a transient window then put it below its * sibling transient windows. */ restackTransients = False; if (pCD->transientLeader) { /* * If freeFamily stacking, then put dirty transient window * (if any) back in place before force lowering current window * to the bottom of the global window stack. Then return. */ if (flags & STACK_FREE_FAMILY) { /* Restore dirty transient if not current window. */ if ((dirtyStackEntry) && (dirtyStackEntry != pCD)) { RestackTransients (dirtyStackEntry); } dirtyStackEntry = pCD; dirtyLeader = pcdLeader; ForceLowerWindow (pCD); return; } /* * Reach here only if NOT doing a f.lower freeFamily (see * return; statement above). Put current transient below * its sibling transient windows. */ restackTransients = PutTransientBelowSiblings (pCD); } /* * If doing a regular f.lower and you have a dirty window, then * clean up dirty transient window. */ if (dirtyStackEntry) { /* * If lowering a window in the same family as the dirty * transient window, then just restack before lowering. * Else, restore the dirty transient in place before * lowering the current window. Clear dirtyStack. */ if (dirtyLeader == pcdLeader) { restackTransients = True; } else { RestackTransients (dirtyStackEntry); } dirtyStackEntry = NULL; } /* * Only restack the window or transient window tree if it is * not currently lowered and the window is not a system * modal window. */ if (pStackEntry) { if ((pStackEntry->prevSibling != &pcdLeader->clientEntry) && !(wmGD.systemModalActive && (pcdLeader == wmGD.systemModalClient))) { StackWindow (pWS, &pcdLeader->clientEntry, True /*above*/, pStackEntry); MoveEntryInList (pWS, &pcdLeader->clientEntry, True /*above*/, pStackEntry); } #ifdef WSM else if ((restackTransients) || (bLeaderRestacked)) #else /* WSM */ else if (restackTransients) #endif /* WSM */ { RestackTransients (pCD); } } else { if ((pWS->pSD->lastClient != &pcdLeader->clientEntry) && !(wmGD.systemModalActive && (pcdLeader == wmGD.systemModalClient)) && !(flags & STACK_WITHIN_FAMILY)) { StackWindow (pWS, &pcdLeader->clientEntry, False /*on bottom*/, (ClientListEntry *) NULL); MoveEntryInList (pWS, &pcdLeader->clientEntry, False /*on bottom*/, (ClientListEntry *) NULL); } #ifdef WSM else if ((restackTransients) || (bLeaderRestacked)) #else /* WSM */ else if (restackTransients) #endif /* WSM */ { RestackTransients (pCD); } } } } /* END OF FUNCTION Do_Lower */ /*************************************<->************************************* * * F_CircleDown (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for moving the client window * on top of stack to the bottom. * * * Inputs: * ------ * args = function arguments (specified in .mwmrc file) * * pCD = pointer to the client data for the client window to which the * function is to be applied * * event = X event that invoked the function (key, button, or menu/NULL) * * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * *************************************<->***********************************/ Boolean F_Circle_Down (String args, ClientData *pCD, XEvent *event) { unsigned long types; unsigned long windowType; ClientListEntry *pNextEntry; ClientData *pcdNext; /* * Go down through the client list looking for a window of an * appropriate type that is obscuring lower windows. */ types = (unsigned long)args; pNextEntry = ACTIVE_PSD->clientList; while (pNextEntry) { /* * Only check out the window if it is onscreen. */ pcdNext = pNextEntry->pCD; if (((pNextEntry->type == NORMAL_STATE) && (pcdNext->clientState != MINIMIZED_STATE)) || ((pNextEntry->type == MINIMIZED_STATE) && (pcdNext->clientState == MINIMIZED_STATE))) { if (pcdNext->clientState == MINIMIZED_STATE) { windowType = F_GROUP_ICON; } else { windowType = F_GROUP_WINDOW; if (pcdNext->transientLeader || pcdNext->transientChildren) { windowType |= F_GROUP_TRANSIENT; } } if (types & windowType) { if (CheckIfClientObscuringAny (pcdNext)) { /* * This window (or window tree) is obscuring another window * on the screen. Lower the window. */ #ifdef WSM wmGD.bSuspendSecondaryRestack = True; #endif /* WSM */ F_Lower (NULL, pcdNext, (XEvent *) NULL); #ifdef WSM wmGD.bSuspendSecondaryRestack = False; #endif /* WSM */ break; } } } pNextEntry = pNextEntry->nextSibling; } return (True); } /* END OF FUNCTION F_Circle_Down */ /*************************************<->************************************* * * F_Circle_Up (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for moving the client window * on the bottom of the stack to the top. * * * Inputs: * ------ * args = function arguments (specified in .mwmrc file) * * pCD = pointer to the client data for the client window to which the * function is to be applied * * event = X event that invoked the function (key, button, or menu/NULL) * * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * *************************************<->***********************************/ Boolean F_Circle_Up (String args, ClientData *pCD, XEvent *event) { unsigned long types; unsigned long windowType; ClientListEntry *pNextEntry; ClientData *pcdNext; /* * Go up through the client list looking for a window of an * appropriate type that is obscured by higher windows. */ types = (unsigned long)args; pNextEntry = ACTIVE_PSD->lastClient; while (pNextEntry) { /* * Only check out the window if it is onscreen. */ pcdNext = pNextEntry->pCD; if (((pNextEntry->type == NORMAL_STATE) && (pcdNext->clientState != MINIMIZED_STATE)) || ((pNextEntry->type == MINIMIZED_STATE) && (pcdNext->clientState == MINIMIZED_STATE))) { if (pcdNext->clientState == MINIMIZED_STATE) { windowType = F_GROUP_ICON; } else { windowType = F_GROUP_WINDOW; if (pcdNext->transientLeader || pcdNext->transientChildren) { windowType |= F_GROUP_TRANSIENT; } } if (types & windowType) { if (CheckIfClientObscuredByAny (pcdNext)) { /* * This window (or window tree) is obscured by another * window on the screen. Raise the window. */ #ifdef WSM wmGD.bSuspendSecondaryRestack = True; #endif /* WSM */ F_Raise (NULL, pcdNext, (XEvent *) NULL); #ifdef WSM wmGD.bSuspendSecondaryRestack = False; #endif /* WSM */ break; } } } pNextEntry = pNextEntry->prevSibling; } return (True); } /* END OF FUNCTION F_Circle_Up */ /*************************************<->************************************* * * F_Focus_Color (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for setting the colormap * focus to a client window or reinstalling the default colormap. * *************************************<->***********************************/ Boolean F_Focus_Color (String args, ClientData *pCD, XEvent *event) { if (wmGD.colormapFocusPolicy == CMAP_FOCUS_EXPLICIT) { if (pCD) { /* * The window selected for the colormap focus is a top-level client * window. If there are subwindow colormaps then determine if the * selection was in one of the subwindows. */ if (pCD->clientState == MINIMIZED_STATE) { /* !!! colormap for client supplied icon window !!! */ pCD = NULL; } } SetColormapFocus (ACTIVE_PSD, pCD); } return (True); } /* END OF FUNCTION F_Focus_Color */ /*************************************<->************************************* * * F_Exec (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for executing a command * (with /bin/sh). * *************************************<->***********************************/ Boolean F_Exec (String args, ClientData *pCD, XEvent *event) { int status; int pid; int w; #ifndef WSM void (*intStat) (); void (*quitStat) (); void (*chldStat) (); #endif /* WSM */ char *shell; char *shellname; /* make sure the f.exec command runs on the right display. */ if (wmGD.pActiveSD->displayString) { putenv(wmGD.pActiveSD->displayString); } #ifdef PANELIST if (wmGD.dtSD) { /* * Start the busy indicator, waiting for a pushbutton window * for the given duration */ WmFrontPanelSetBusy (True); } #endif /* PANELIST */ #ifndef WSM /* For now use only for non WSM code. May integrate to WSM later. */ /* * Disable SIGCHLD while we wait for this child to exit, otherwise * we will go into the ChildProcSignalHandler and will never get the * correct child pid in the while loop below. pgw@ixi 30-5-95 IBIS 20585. * * Moved before fork() to avoid race condition. * Change handler to SIG_DFL, SIG_IGN causes bug. paulsh@sequent 31-08-95. */ chldStat = (void (*)())signal (SIGCHLD, SIG_DFL); #endif /* * Fork a process to exec a shell to run the specified command: */ #ifdef PORT_NOVFORK if ((pid = fork ()) == 0) #else if ((pid = vfork ()) == 0) #endif { #ifndef NO_SETPGRP #if defined(SVR4) || defined(__OSF1__) || defined(__osf__) || defined(_POSIX_JOB_CONTROL) setsid(); #else #ifdef SYSV setpgrp(); #else int tpid; tpid = getpid(); setpgrp(tpid, tpid); #endif /* SYSV */ #endif /* SVR4 */ #endif /* NO_SETPGRP */ #ifdef WSM /* * Clean up window manager resources. * The X file descriptor should be automatically closed. */ /* * Fix up signal handling. */ RestoreDefaultSignalHandlers (); /* * Fix up the child application's environment NOT to * inherit the XFILESEARCHPATH, XBMLANGPATH, NLSPATH, etc. * used by dtwm. */ _DtEnvControl(DT_ENV_RESTORE_PRE_DT); CLOSE_FILES_ON_EXEC(); #endif /* WSM */ /* * Exec the command using $MWMSHELL if set or * $SHELL if set and $MWMSHELL not set or sh. */ if (((shell = getenv ("MWMSHELL")) != NULL) || ((shell = getenv ("SHELL")) != NULL)) { shellname = strrchr (shell, '/'); if (shellname == NULL) { /* If the shell pathname obtained from SHELL or MWMSHELL does not have a "/" in the path and if the user expects this shell to be obtained using the PATH variable rather than the current directory, then we must call execlp and not execl */ shellname = shell; execlp (shell, shellname, "-c", args, NULL); } else { shellname++; execl (shell, shellname, "-c", args, NULL); } } /* * There is no SHELL environment variable or the first execl failed. * Try /bin/sh . */ #ifdef SVR4 execl ("/usr/bin/sh", "sh", "-c", args, NULL); #else execl ("/bin/sh", "sh", "-c", args, NULL); #endif /* * Error - command could not be exec'ed. */ _exit (127); } else if (pid == -1) return(True); /* * Have the window manager wait for the shell to complete. */ #ifndef WSM intStat = (void (*)())signal (SIGINT, SIG_IGN); quitStat = (void (*)())signal (SIGQUIT, SIG_IGN); #endif /* WSM */ #ifdef WSM /* * Don't need to wait because WSM sets SIGCLD handler */ #else /* WSM */ while ((w = wait (&status)) != pid && (w != -1)); /* * Currently the only purpose for setting the local variable "status" * here is as a convenience for setting break points or querying the * value of "status" when using a debugger. * Otherwise the value of "status" is unused beyond this point. */ if (w == -1) { status = -1; } #endif /* WSM */ #ifndef WSM signal (SIGINT, intStat); signal (SIGQUIT, quitStat); signal (SIGCHLD, chldStat); #endif /* WSM */ /* * Restore original DISPLAY environment variable value * so a restart will start on the same screen */ if(wmGD.pActiveSD->displayString && wmGD.displayString) { putenv(wmGD.displayString); } return (True); } /* END OF FUNCTION F_Exec */ /*************************************<->************************************* * * F_Quit_Mwm (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for terminating the window * manager. * *************************************<->***********************************/ Boolean F_Quit_Mwm (String args, ClientData *pCD, XEvent *event) { if (wmGD.showFeedback & WM_SHOW_FB_QUIT) { ConfirmAction (ACTIVE_PSD, QUIT_MWM_ACTION); } else { Do_Quit_Mwm(False); } return (False); } /* END OF FUNCTION F_Quit_Mwm */ /*************************************<->************************************* * * Do_Quit_Mwm (diedOnRestart) * * * Description: * ----------- * Callback to do the f.quit_mwm function. * *************************************<->***********************************/ void Do_Quit_Mwm (Boolean diedOnRestart) { int scr; ClientListEntry *pNextEntry; /* * Close the X connection to get all the X resources cleaned up. * !!! maybe windows should be reparented / rebordered before closing? !!! * !!! clean up the _MOTIF_WM_INFO property on the root window !!! */ if (DISPLAY) { XSetInputFocus(DISPLAY, PointerRoot, RevertToPointerRoot, CurrentTime); for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { #ifdef WSM SaveResources(&wmGD.Screens[scr]); #endif /* WSM */ pNextEntry = wmGD.Screens[scr].lastClient; while (pNextEntry) { if (pNextEntry->type == NORMAL_STATE) { if (!(pNextEntry->pCD->clientFlags & CLIENT_WM_CLIENTS)) { ReBorderClient (pNextEntry->pCD, diedOnRestart); } } pNextEntry = pNextEntry->prevSibling; } #if defined(PANELIST) UnParentControls (&wmGD.Screens[scr], False); #endif /* PANELIST */ #ifndef WSM XDeleteProperty(DISPLAY, wmGD.Screens[scr].rootWindow, wmGD.xa_MWM_INFO); #endif /* WSM */ } } #ifdef WSM /* shut down the messaging connection */ dtCloseIPC(); #endif /* WSM */ ResignFromSM(); XSync (DISPLAY, False); XCloseDisplay (DISPLAY); } if(diedOnRestart) { exit (WM_ERROR_EXIT_VALUE); } else { exit (0); } } /* END OF FUNCTION Do_Quit_Mwm */ /*************************************<->************************************* * * ReBorderClient (pCD, reMapClient) * * * Description: * ----------- * Restores X border for client window and reparents the * window back to the root. * * * Inputs: * ------- * pCD = pointer to the client data for the window to be re-bordered. * *************************************<->***********************************/ void ReBorderClient (ClientData *pCD, Boolean reMapClient) { int x = 0, y = 0; int xoff, yoff; XWindowChanges windowChanges; while (pCD) { if (pCD->iconWindow && (pCD->clientFlags & ICON_REPARENTED) && (!(reMapClient))) { XUnmapWindow (DISPLAY, pCD->iconWindow); #ifdef WSM XReparentWindow (DISPLAY, pCD->iconWindow, ROOT_FOR_CLIENT(pCD), pCD->pWsList->iconX, pCD->pWsList->iconY); #else /* WSM */ XReparentWindow (DISPLAY, pCD->iconWindow, ROOT_FOR_CLIENT(pCD), pCD->iconX, pCD->iconY); #endif /* WSM */ } if (!(reMapClient)) { if (pCD->maxConfig) { x = pCD->maxX; y = pCD->maxY; } else { if(wmGD.positionIsFrame) { CalculateGravityOffset (pCD, &xoff, &yoff); x = pCD->clientX - xoff; y = pCD->clientY - yoff; } else { x = pCD->clientX; y = pCD->clientY; } } XUnmapWindow(DISPLAY, pCD->clientFrameWin); XReparentWindow (DISPLAY, pCD->client, ROOT_FOR_CLIENT(pCD), x, y); } else { XMapWindow(wmGD.display, pCD->client); } if (pCD->transientChildren) { ReBorderClient (pCD->transientChildren, reMapClient); } if (!(reMapClient)) { /* * restore X border */ windowChanges.x = x; windowChanges.y = y; windowChanges.border_width = pCD->xBorderWidth; XConfigureWindow (DISPLAY, pCD->client, CWBorderWidth | CWX | CWY, &windowChanges); } if (pCD->transientLeader) { pCD = pCD->transientSiblings; } else { pCD = NULL; } } } /* END OF FUNCTION ReBorderClient */ /*************************************<->************************************* * * F_Focus_Key (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for setting the keyboard * focus to a particular client window. * * * Inputs: * ------ * args = (immediate value) focus flags * * pCD = pointer to the client data * * event = X event that invoked the function (key, button, or menu/NULL) * *************************************<->***********************************/ Boolean F_Focus_Key (String args, ClientData *pCD, XEvent *event) { long focusFlags = (long)args; if (pCD && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)) { Do_Focus_Key (pCD, GetFunctionTimestamp ((XButtonEvent *)event), (focusFlags | ALWAYS_SET_FOCUS)); } return (True); } /* END OF FUNCTION F_Focus_Key */ /*************************************<->************************************* * * FindSomeReasonableClient * * Description: * ----------- * Find a client, any client to set the focus to, return client or NULL. * This code is ripped off from AutoResetKeyFocus(). * *************************************<->***********************************/ static Window FindSomeReasonableClient(void) { ClientData *pcdNoFocus=NULL; ClientListEntry *pNextEntry; ClientData *pCD; ClientData *pcdLastFocus = (ClientData *) NULL; ClientData *pcdFocus; Window focusWindow = (Window) NULL; /* * Scan through the list of clients to find a window to get the focus. */ pNextEntry = ACTIVE_PSD->clientList; while (pNextEntry) { pCD = pNextEntry->pCD; if (!wmGD.systemModalActive || (wmGD.systemModalClient == pCD)) { if ((pNextEntry->type != MINIMIZED_STATE) && (pCD->clientState != MINIMIZED_STATE) && #ifdef WSM (ClientInWorkspace (ACTIVE_WS, pCD)) && #endif /* WSM */ (pCD != pcdNoFocus)) { if (pCD->transientChildren) { pcdFocus = FindLastTransientTreeFocus (pCD, pcdNoFocus); } else { pcdFocus = pCD; } if (pcdFocus && ((pcdLastFocus == NULL) || (pcdFocus->focusPriority > pcdLastFocus->focusPriority))) { pcdLastFocus = pcdFocus; } } } pNextEntry = pNextEntry->nextSibling; } /* * Set the focus window if one is found */ #ifdef WSM if (pcdLastFocus && ClientInWorkspace (ACTIVE_WS, pcdLastFocus)) #else /* WSM */ if (pcdLastFocus) #endif /* WSM */ focusWindow = pcdLastFocus->client; /* * If a client window could not be found, then just put focus * on any icon. */ if (focusWindow == (Window) NULL) { pNextEntry = ACTIVE_PSD->clientList; while (pNextEntry) { pCD = pNextEntry->pCD; #ifdef WSM if (ClientInWorkspace (ACTIVE_WS, pCD)) { #endif /* WSM */ if ((pNextEntry->type == MINIMIZED_STATE) || (pCD->clientState == MINIMIZED_STATE)) { focusWindow = ICON_FRAME_WIN(pCD); break; } #ifdef WSM } #endif /* WSM */ pNextEntry = pNextEntry->nextSibling; } } return (focusWindow); } /* END OF FUNCTION FindSomeReasonableClient */ /*************************************<->************************************* * * Do_Focus_Key (pCD, focusTime, flags) * * * Description: * ----------- * This function is used to set the focus to a window. The focus indication * is not changed until the FocusIn event is received. * * * Inputs: * ------ * pCD = pointer to the client data * * focusTime = focus change time * * flags = wm focus change flags * *************************************<->***********************************/ void Do_Focus_Key (ClientData *pCD, Time focusTime, long flags) { ClientData *pcdFocus; Window focusWindow; /* Clear the replay flag */ wmGD.replayEnterEvent = False; pcdFocus = pCD; #ifdef WSM /* * Make sure the client is in the current workspace */ if ((pCD) && (ClientInWorkspace (ACTIVE_WS, pCD))) #else /* WSM */ if (pCD) #endif /* WSM */ { if (pCD->clientState == MINIMIZED_STATE) { focusWindow = ICON_FRAME_WIN(pCD); } else if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { /* * Set the keyboard focus to the indicated client window. * If the window has an application modal subordinate then * set the input focus to that window if the focus isn't * already owned by a subordinate. */ if (IS_APP_MODALIZED(pCD)) { ClientData *pcdFocusLeader,*currFocusLeader; /* * Handle case where a modal window exists when Mwm starts up. * wmGD.keyboardFocus is NULL, give focus to the modal dialog. */ if (wmGD.keyboardFocus) { currFocusLeader = wmGD.keyboardFocus->transientLeader; } else { currFocusLeader = (ClientData *) NULL; } /* * Find focus leader for pCD */ pcdFocusLeader = pCD; while (pcdFocusLeader->transientLeader && (pcdFocusLeader != currFocusLeader)) { pcdFocusLeader = pcdFocusLeader->transientLeader; } if (pcdFocusLeader == currFocusLeader) { pcdFocus = wmGD.keyboardFocus; flags = 0; } else { pcdFocus = FindTransientFocus (pcdFocusLeader); } } /* * !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! * We must look at why FindTransientFocus is * returning a NULL pcd. The old code simply set * focusWindow = pcdFocus->client; * !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! * * 11/26/96 rswiston - In tracking down CDExc22816, we * discovered that pCD could get tricked into thinking * it had modal transients when in fact all its transients * had been withdrawn (fixed in WithdrawTransientChildren()). * As a result, FindTransientFocus() returns wmGD.keyboardFocus; * if nobody has the focus, FindTransientFocus() returns NULL. */ if (pcdFocus) { focusWindow = pcdFocus->client; } else { focusWindow = (wmGD.keyboardFocus) ? wmGD.keyboardFocus->client : ACTIVE_PSD->wmWorkspaceWin; } } else { /* * If the focus policy is "pointer" don't set the focus to a * window if it has an application modal subordinate. */ if (IS_APP_MODALIZED(pCD)) { pcdFocus = NULL; focusWindow = ACTIVE_PSD->wmWorkspaceWin; /* Replay this later when the modal window is removed. */ wmGD.replayEnterEvent = True; } else { focusWindow = pcdFocus->client; } } } else { /* * Set up the default (non client specific) keyboard input focus. */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) { focusWindow = PointerRoot; } else { /* * The WORKSPACE_IF_NULL flag is used to prevent client * windows from flashing when deiconifying a client. */ if (WORKSPACE_IF_NULL & flags) { focusWindow = ACTIVE_PSD->wmWorkspaceWin; } else { /* find some reasonable client so that focus is not lost */ focusWindow = FindSomeReasonableClient(); if (focusWindow == (Window)NULL) { focusWindow = ACTIVE_PSD->wmWorkspaceWin; } } } } if ((pcdFocus != wmGD.keyboardFocus) || (flags & ALWAYS_SET_FOCUS)) { if (pcdFocus) { /* * Set the focus and/or send a take focus client message. This * is not done if a client area button press was done to set * set the focus and the window is a globally active input * style window (See ICCCM). */ if ( (flags & CLIENT_AREA_FOCUS) && (pcdFocus->protocolFlags & PROTOCOL_WM_TAKE_FOCUS) && ! pcdFocus->inputFocusModel && (pcdFocus == pCD) && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) && !(pcdFocus->clientState == MINIMIZED_STATE) ) { /* * We get here if: * 1. User clicked in the client area AND * 2. Input model is Globally Active AND * 3. Keyboard focus policy is explicit */ /* this window has WM_TAKE_FOCUS set and InputField false. */ /* just send a message. */ SendClientMsg (pcdFocus->client, (long) wmGD.xa_WM_PROTOCOLS, (long) wmGD.xa_WM_TAKE_FOCUS, focusTime, NULL, 0); } else { if ((pcdFocus->protocolFlags & PROTOCOL_WM_TAKE_FOCUS) && !(pcdFocus->clientState == MINIMIZED_STATE)) { /* * Locally Active Input Model - Send a take focus message to the client. */ SendClientMsg (pcdFocus->client, (long) wmGD.xa_WM_PROTOCOLS, (long) wmGD.xa_WM_TAKE_FOCUS, focusTime, NULL, 0); } /* * Don't set the input focus if the window has input_field set * to False or has expressed an interest in WM_TAKE_FOCUS * (ie. 'No Input', 'Globally Active', or 'Locally Active'), * and the user click in the client area. If the user clicks * on the titlebar or traverses to this window via f.next_key, * set the focus so that the user can access the window menu * and accelerators. */ if ( wmGD.enforceKeyFocus || /* res - default == True. */ (flags & ALWAYS_SET_FOCUS) || !(flags & CLIENT_AREA_FOCUS)|| /* clicked on frame? */ pcdFocus->inputFocusModel || /* Pass.|Glob. Active */ (pcdFocus->clientState == MINIMIZED_STATE) ) { if ( !(flags & CLIENT_AREA_FOCUS) && !pcdFocus->inputFocusModel && !(pcdFocus->clientState == MINIMIZED_STATE)) { /* the window doesn't want the focus - set it to the frame */ /* user clicked on the frame but we don't want the focus */ /* set it to the client's frame */ XSetInputFocus (DISPLAY, pcdFocus->clientBaseWin, RevertToPointerRoot, CurrentTime); } #ifndef FIX_1350 else if ( !(flags & CLIENT_AREA_FOCUS) && !(pcdFocus->protocolFlags & PROTOCOL_WM_TAKE_FOCUS) && pcdFocus->inputFocusModel ) { XSetInputFocus (DISPLAY, focusWindow, RevertToPointerRoot, CurrentTime); } #endif else { XSetInputFocus (DISPLAY, focusWindow, RevertToParent, CurrentTime); } } else { /* * We've decided that the window shouldn't get the focus, * so don't change the focus. */ pcdFocus = wmGD.nextKeyboardFocus; } } } else { XSetInputFocus (DISPLAY, focusWindow, RevertToPointerRoot, focusTime); } wmGD.nextKeyboardFocus = pcdFocus; } } /* END OF FUNCTION Do_Focus_Key */ #ifdef WSM /***********************<->************************************* * * F_Goto_Workspace (args, pCD, event) * * Description: * ----------- * This is the window manager function handler for switching * to another workspace by name. * * Inputs: * ------ * args = action function and arguments * * pCD = pointer to the ClientData * * event = X event that invoked the function (key, button, or menu/NULL) * * Outputs: * ------- * Always False * * Comments: * ------- ******************************<->***********************************/ Boolean F_Goto_Workspace (String args, ClientData *pCD, XEvent *event) { WmScreenData *pSD = ACTIVE_PSD; int iwsx; XmString xms; /* * Compare argument against both resource name * and workspace title, take the first match. */ xms = XmStringCreate (args, XmFONTLIST_DEFAULT_TAG); for (iwsx = 0; iwsx < pSD->numWorkspaces; iwsx++) { if (!strcmp(pSD->pWS[iwsx].name, args) || XmStringCompare (xms, pSD->pWS[iwsx].title)) { break; } } XmStringFree (xms); /* check bounds */ if (iwsx >= pSD->numWorkspaces) { Warning (((char *)GETMESSAGE(26, 4, "Invalid workspace name specified for f.goto_workspace"))); } else { ChangeToWorkspace (&pSD->pWS[iwsx]); } return (False); } /* END OF FUNCTION F_Goto_Workspace */ #endif /* WSM */ #ifdef WSM /******************************<->************************************* * * Boolean F_Help (String args, ClientData *pCD, XEvent *event) * * Description: * ----------- * Invoke help on the workspace manager * * Inputs: * ------ * args - incoming values * pCD - associated client data structure * event - what triggered this call * * Outputs: * ------- * Return - True if the call occurs; false otherwise. * * Comments: * -------- * ******************************<->***********************************/ Boolean F_Help (String args, ClientData *pCD, XEvent *event) { #ifdef PANELIST Boolean rval; rval = WmDtHelp(args); return (rval); #endif /* PANELIST */ } /* END OF FUNCTION F_Help */ /******************************<->************************************* * * Boolean F_Help_Mode (String args, ClientData *pCD, XEvent *event) * * Description: * ----------- * Invoke item help on the frontpanel * * Inputs: * ------ * args - NULL * pCD - associated client data structure ?? * event - what triggered this call * * Outputs: * ------- * Return - True if the call occurs; false otherwise. * * Comments: * -------- * ******************************<->***********************************/ Boolean F_Help_Mode (String args, ClientData *pCD, XEvent *event) { #ifdef PANELIST /* * Help mode event processing interferes * with slide up windows. Don't continue * if windows are sliding. */ if (wmGD.iSlideUpsInProgress == 0) { (void) WmDtHelpMode(); } return (False); #endif /* PANELIST */ } /* END OF FUNCTION F_Help_Mode */ #endif /* WSM */ /******************************<->************************************* * * F_Next_Key (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for setting the keyboard * input focus to the next window in the set of managed windows. * * * Inputs: * ------ * args = (immediate value) window type flags * * pCD = pointer to the client data * * event = X event that invoked the function (key, button, or menu/NULL) * *************************************<->***********************************/ Boolean F_Next_Key (String args, ClientData *pCD, XEvent *event) { #ifdef ROOT_ICON_MENU Boolean focused = False; #endif /* ROOT_ICON_MENU */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { #ifdef ROOT_ICON_MENU focused = #endif /* ROOT_ICON_MENU */ FocusNextWindow ((unsigned long)args, GetFunctionTimestamp ((XButtonEvent *)event)); #ifdef ROOT_ICON_MENU if (focused && wmGD.iconClick && event && event->type == KeyPress && wmGD.nextKeyboardFocus && wmGD.nextKeyboardFocus->clientState == MINIMIZED_STATE && !P_ICON_BOX(wmGD.nextKeyboardFocus)) { /* * Post system menu from the icon */ F_Post_SMenu (args, wmGD.nextKeyboardFocus, event); return (False); } #endif /* ROOT_ICON_MENU */ } return (True); } /* END OF FUNCTION F_Next_Key */ /*************************************<->************************************* * * F_Prev_Cmap (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler installing the previous * colormap in the list of client window colormaps. * *************************************<->***********************************/ Boolean F_Prev_Cmap (String args, ClientData *pCD, XEvent *event) { if (pCD == NULL) { pCD = ACTIVE_PSD->colormapFocus; } if (pCD && (pCD->clientCmapCount > 0) && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { if (--(pCD->clientCmapIndex) < 0) { pCD->clientCmapIndex = pCD->clientCmapCount - 1; } pCD->clientColormap = pCD->clientCmapList[pCD->clientCmapIndex]; if (ACTIVE_PSD->colormapFocus == pCD) { #ifndef OLD_COLORMAP /* colormap */ /* * We just re-ordered the colormaps list, * so we need to re-run the whole thing. */ pCD->clientCmapFlagsInitialized = 0; ProcessColormapList (ACTIVE_PSD, pCD); #else /* OSF original */ WmInstallColormap (ACTIVE_PSD, pCD->clientColormap); #endif } } return (True); } /* END OF FUNCTION F_Prev_Cmap */ /*************************************<->************************************* * * F_Prev_Key (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for setting the keyboard * input focus to the previous window in the set of managed windows. * * * Inputs: * ------ * args = (immediate value) window type flags * * pCD = pointer to the client data * * event = X event that invoked the function (key, button, or menu/NULL) * *************************************<->***********************************/ Boolean F_Prev_Key (String args, ClientData *pCD, XEvent *event) { #ifdef ROOT_ICON_MENU Boolean focused = False; #endif /* ROOT_ICON_MENU */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { #ifdef ROOT_ICON_MENU focused = #endif /* ROOT_ICON_MENU */ FocusPrevWindow ((unsigned long)args, GetFunctionTimestamp ((XButtonEvent *)event)); #ifdef ROOT_ICON_MENU if (focused && wmGD.iconClick && event && event->type == KeyPress && wmGD.nextKeyboardFocus && wmGD.nextKeyboardFocus->clientState == MINIMIZED_STATE && !P_ICON_BOX(wmGD.nextKeyboardFocus)) { /* * Post system menu from the icon */ F_Post_SMenu (args, wmGD.nextKeyboardFocus, event); return (False); } #endif /* ROOT_ICON_MENU */ } return (True); } /* END OF FUNCTION F_Prev_Key */ #ifdef PANELIST /***********************<->************************************* * * F_Post_FpMenu (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for posting * the Front Panel window menu. * * Inputs: * ------ * args = arguments (none) * * pCD = pointer to the FP ClientData * * event = X button press that invoked the function * ******************************<->***********************************/ Boolean F_Post_FpMenu (String args, ClientData *pCD, XEvent *event) { static MenuSpec *fpMenuSpec = (MenuSpec *)NULL; if (event->type != ButtonPress) return False; if (!fpMenuSpec) { WmScreenData *pSD = (pCD) ? PSD_FOR_CLIENT(pCD) : ACTIVE_PSD; MenuSpec *oldSpec; Widget tmpWidget; char *newMenuName; newMenuName = pCD ? pCD->systemMenu : "DtPanelMenu"; for (oldSpec = pSD->menuSpecs; oldSpec != (MenuSpec *)NULL; oldSpec = oldSpec->nextMenuSpec) { if (oldSpec->name && (strcmp(oldSpec->name, newMenuName) == 0)) break; } if (!oldSpec) return False; fpMenuSpec = DuplicateMenuSpec(oldSpec); /* * TEMPORARILY modify pSD so the new menu will be * created on DISPLAY1 instead of DISPLAY. */ fpMenuSpec->nextMenuSpec = pSD->menuSpecs; pSD->menuSpecs = fpMenuSpec; tmpWidget = pSD->screenTopLevelW; pSD->screenTopLevelW = pSD->screenTopLevelW1; (void)MAKE_MENU (pSD, pCD, newMenuName, F_CONTEXT_NORMAL, F_CONTEXT_NORMAL, (MenuItem *) NULL, FALSE); /* Restore pSD */ pSD->screenTopLevelW = tmpWidget; pSD->menuSpecs = fpMenuSpec->nextMenuSpec; } PostMenu (fpMenuSpec, pCD, event->xbutton.x_root, event->xbutton.y_root, event->xbutton.button, F_CONTEXT_NORMAL, POST_AT_XY, event); _XmGetMenuState(XtParent(fpMenuSpec->menuWidget)) ->MS_LastManagedMenuTime = event->xbutton.time; return False; } /***********************<->************************************* * * F_Push_Recall (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for invoking/topping * push_recall clients. * * * Inputs: * ------ * args = arguments * * pCD = pointer to the ClientData * * event = X event that invoked the function (key, button, or menu/NULL) * * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * * Comments: * ------- ******************************<->***********************************/ Boolean F_Push_Recall (String args, ClientData *pCD, XEvent *event) { WmPushRecallArg *pPRP; WmScreenData *pSD; WmFpPushRecallClientData *pPRCD; pPRP = (WmPushRecallArg *) args; pSD = (pCD) ? PSD_FOR_CLIENT(pCD) : ACTIVE_PSD; if (pPRP->ixReg < pSD->numPushRecallClients) { /* get slot for this client */ pPRCD = &(pSD->pPRCD[pPRP->ixReg]); /* * If the client is already running, then top it in this workspace, * else invoke the function to start it. */ if (pPRCD->pCD) { /* Client is managed already. */ if (!(ClientInWorkspace (pSD->pActiveWS, pPRCD->pCD))) { WorkspaceID *wsRemoveList; int sizeRemoveList; /* * Move client to current workspace */ wsRemoveList = GetListOfOccupiedWorkspaces (pPRCD->pCD, &sizeRemoveList); RemoveClientFromWorkspaces (pPRCD->pCD, wsRemoveList, sizeRemoveList); XtFree ((char *)wsRemoveList); AddClientToWorkspaces (pPRCD->pCD, &(pSD->pActiveWS->id), 1); SetClientWsIndex(pPRCD->pCD); SetClientState(pPRCD->pCD, pPRCD->pCD->clientState & ~UNSEEN_STATE, CurrentTime); } /* Make this client visible */ #ifdef WSM wmGD.bSuspendSecondaryRestack = True; #endif /* WSM */ F_Normalize_And_Raise (NULL, pPRCD->pCD, event); #ifdef WSM wmGD.bSuspendSecondaryRestack = False; #endif /* WSM */ } else { struct timeval tvNow; struct timezone tz; Boolean bWaiting = False; if (pPRCD->tvTimeout.tv_sec != 0) { gettimeofday (&tvNow, &tz); if ((pPRCD->tvTimeout.tv_sec > tvNow.tv_sec) || ((pPRCD->tvTimeout.tv_sec == tvNow.tv_sec) && (pPRCD->tvTimeout.tv_usec > tvNow.tv_usec))) { /* still waiting for client to start */ bWaiting = True; } } if (!bWaiting) { long clientTimeout; Arg al[5]; int ac; WmPanelistObject pPanelist; pPanelist = (WmPanelistObject) pSD->wPanelist; /* invoke the function to start the client */ pPRP->wmFunc ( pPRP->pArgs, pCD, event); if (pPanelist && panel.busy_light_data) { /* set timeout value */ ac = 0; XtSetArg (al[ac], XmNclientTimeoutInterval, &clientTimeout); ac++; XtGetValues (panel.busy_light_data->icon, (ArgList)al, ac); } /* * ClientTimeout is in milliseconds, timeval values * are in seconds and microseconds. */ gettimeofday (&(pPRCD->tvTimeout), &tz); pPRCD->tvTimeout.tv_sec += clientTimeout / 1000; pPRCD->tvTimeout.tv_usec += (clientTimeout % 1000) * 1000; pPRCD->tvTimeout.tv_sec += pPRCD->tvTimeout.tv_usec / 1000000; pPRCD->tvTimeout.tv_usec %= 1000000; } } } return (True); } /* END OF FUNCTION F_Push_Recall */ #endif /* PANELIST */ /*************************************<->************************************* * * F_Pass_Key (args, pCD, event) * * * Description: * ----------- * This is a function stub for the f.pass_key window manager function. * * * Inputs: * ------ * args = (immediate value) window type flags * * pCD = pointer to the client data * * event = X event that invoked the function (key, button, or menu/NULL) * *************************************<->***********************************/ Boolean F_Pass_Key (args, pCD, event) String args; ClientData *pCD; XEvent *event; { if (wmGD.passKeysActive) { /* * Get out of pass keys mode. */ wmGD.passKeysActive = False; wmGD.passKeysKeySpec = NULL; } else { /* * Get into pass keys mode. */ wmGD.passKeysActive = True; } return (False); } /* END OF FUNCTION F_Pass_Key */ /*************************************<->************************************* * * F_Maximize (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for maximizing a client * window. * *************************************<->***********************************/ Boolean F_Maximize (String args, ClientData *pCD, XEvent *event) { if (pCD && (pCD->clientFunctions & MWM_FUNC_MAXIMIZE)) { SetClientStateWithEventMask (pCD, MAXIMIZED_STATE, GetFunctionTimestamp ((XButtonEvent *)event), GetEventInverseMask(event)); } return (False); } /* END OF FUNCTION F_Maximize */ /*************************************<->************************************* * * F_Menu (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for posting a menu. * This function can only be invoked by a key or button event. * wmGD.menuUnpostKeySpec is assumed set appropriately; it will be set to * NULL when the menu is unposted. * *************************************<->***********************************/ Boolean F_Menu (String args, ClientData *pCD, XEvent *event) { MenuSpec *menuSpec; Context menuContext; unsigned int button; int x; int y; long flags = POST_AT_XY; WmScreenData *pSD; if (event && ((event->type == ButtonPress) || (event->type == ButtonRelease))) { button = event->xbutton.button; x = event->xbutton.x_root; y = event->xbutton.y_root; if (event->type == ButtonRelease) { flags |= POST_TRAVERSAL_ON; } #ifdef WSM /* * Root menu, if posted with button press, then * set up to handle root menu click to make the menu * sticky. */ else if (wmGD.rootButtonClick && (event->type == ButtonPress)) { if (wmGD.bReplayedButton) { /* This button was replayed, it most likely dismissed a previous sticky menu, don't post a menu here */ return (False); } wmGD.checkHotspot = True; wmGD.hotspotRectangle.x = x - wmGD.moveThreshold/2; wmGD.hotspotRectangle.y = y - wmGD.moveThreshold/2; wmGD.hotspotRectangle.width = wmGD.moveThreshold; wmGD.hotspotRectangle.height = wmGD.moveThreshold; } #endif /* WSM */ } else if (event && ((event->type == KeyPress) || (event->type == KeyRelease))) { button = NoButton; x = event->xkey.x_root; y = event->xkey.y_root; } else { /* * A button or key event must be used to post a menu using this * function. */ return (False); } if (pCD) { if (pCD->clientState == NORMAL_STATE) { menuContext = F_CONTEXT_NORMAL; } else if (pCD->clientState == MAXIMIZED_STATE) { menuContext = F_CONTEXT_MAXIMIZE; } else { menuContext = F_CONTEXT_ICON; } if (P_ICON_BOX(pCD) && event->xany.window == ICON_FRAME_WIN(pCD)) { if (pCD->clientState == MINIMIZED_STATE) { menuContext = F_SUBCONTEXT_IB_IICON; } else { menuContext = F_SUBCONTEXT_IB_WICON; } } } else { menuContext = F_CONTEXT_ROOT; } /* We do not add this MenuSpec to wmGD.acceleratorMenuSpecs. * This should have been done in MakeWmFunctionResources(). */ pSD = (pCD) ? PSD_FOR_CLIENT(pCD) : ACTIVE_PSD; if ((menuSpec = MAKE_MENU (pSD, pCD, args, menuContext, menuContext, (MenuItem *) NULL, FALSE)) != NULL) { PostMenu (menuSpec, pCD, x, y, button, menuContext, flags, event); } return (False); } /* END OF FUNCTION F_Menu */ /*************************************<->************************************* * * F_Minimize (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for minimizing a client * window. * *************************************<->***********************************/ Boolean F_Minimize (String args, ClientData *pCD, XEvent *event) { ClientData *pcdLeader; if (pCD) { /* * If the window is a transient then minimize the entire transient * tree including the transient leader. */ pcdLeader = (pCD->transientLeader) ? FindTransientTreeLeader (pCD) : pCD; if (pcdLeader->clientFunctions & MWM_FUNC_MINIMIZE) { SetClientStateWithEventMask (pCD, MINIMIZED_STATE, GetFunctionTimestamp ((XButtonEvent *)event), GetEventInverseMask(event)); } } return (False); } /* END OF FUNCTION F_Minimize */ /*************************************<->************************************* * * F_Move (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for moving a client window * or icon. * *************************************<->***********************************/ Boolean F_Move (String args, ClientData *pCD, XEvent *event) { if (pCD && (pCD->clientFunctions & MWM_FUNC_MOVE)) { StartClientMove (pCD, event); HandleClientFrameMove (pCD, event); } return (False); } /* END OF FUNCTION F_Move */ /*************************************<->************************************* * * F_Next_Cmap (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler installing the next * colormap in the list of client window colormaps. * *************************************<->***********************************/ Boolean F_Next_Cmap (String args, ClientData *pCD, XEvent *event) { if (pCD == NULL) { pCD = ACTIVE_PSD->colormapFocus; } if (pCD && (pCD->clientCmapCount > 0) && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { if (++(pCD->clientCmapIndex) >= pCD->clientCmapCount) { pCD->clientCmapIndex = 0; } pCD->clientColormap = pCD->clientCmapList[pCD->clientCmapIndex]; if (ACTIVE_PSD->colormapFocus == pCD) { #ifndef OLD_COLORMAP /* colormap */ /* * We just re-ordered the colormaps list, * so we need to re-run the whole thing. */ pCD->clientCmapFlagsInitialized = 0; ProcessColormapList (ACTIVE_PSD, pCD); #else /* OSF original */ WmInstallColormap (ACTIVE_PSD, pCD->clientColormap); #endif } } return (True); } /* END OF FUNCTION F_Next_Cmap */ /*************************************<->************************************* * * F_Nop (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for doing nothing. * *************************************<->***********************************/ Boolean F_Nop (String args, ClientData *pCD, XEvent *event) { return (True); } /* END OF FUNCTION F_Nop */ /*************************************<->************************************* * * F_Normalize (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for putting a client window * in the normal state. * *************************************<->***********************************/ Boolean F_Normalize (String args, ClientData *pCD, XEvent *event) { if (pCD) { SetClientStateWithEventMask (pCD, NORMAL_STATE, GetFunctionTimestamp ((XButtonEvent *)event), GetEventInverseMask(event)); } return (False); } /* END OF FUNCTION F_Normalize */ /*************************************<->************************************* * * F_Normalize_And_Raise (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for putting a client window * in the normal state and raising it from and icon. * *************************************<->***********************************/ Boolean F_Normalize_And_Raise (String args, ClientData *pCD, XEvent *event) { #ifdef PANELIST WmScreenData *pSD; WmWorkspaceData *pWS; if (args) { if (pCD) pSD = PSD_FOR_CLIENT (pCD); else pSD = ACTIVE_PSD; pWS = pSD->pActiveWS; if (pSD->useIconBox && wmGD.useFrontPanel && pSD->iconBoxControl && (!strcmp(args, WmNiconBox))) { /* * There's an icon box in the front panel and this is a * request to pop up the icon box. */ IconBoxPopUp (pWS, True); return (False); } } #endif /* PANELIST */ if (pCD) { if (pCD->clientState == MINIMIZED_STATE) { /* normalize window */ SetClientStateWithEventMask (pCD, NORMAL_STATE, (Time) (event ? GetFunctionTimestamp ((XButtonEvent *)event) : GetTimestamp ()), GetEventInverseMask(event)); } else { /* Make sure we are in NORMAL_STATE */ SetClientStateWithEventMask (pCD, NORMAL_STATE, GetFunctionTimestamp ((XButtonEvent *)event), GetEventInverseMask(event)); /* Raise the window and set the keyboard focus to the window */ #ifdef WSM wmGD.bSuspendSecondaryRestack = True; #endif /* WSM */ F_Raise (NULL, pCD, (XEvent *)NULL); #ifdef WSM wmGD.bSuspendSecondaryRestack = False; #endif /* WSM */ if (wmGD.raiseKeyFocus) { F_Focus_Key (NULL, pCD, (event ? ((XEvent *)event) : ((XEvent *)NULL))); } } wmGD.clickData.clickPending = False; wmGD.clickData.doubleClickPending = False; } return (False); } /* END OF FUNCTION F_Normalize_And_Raise */ /*************************************<->************************************* * * F_Restore (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for putting a client window * in the normal state. * *************************************<->***********************************/ Boolean F_Restore (String args, ClientData *pCD, XEvent *event) { int newState; if (pCD) { /* * If current state is MAXIMIZED state then just go to NORMAL state, * otherwise (you are in MINIMIZED state) return to previous state. */ if (pCD->clientState == MAXIMIZED_STATE) { SetClientStateWithEventMask (pCD, NORMAL_STATE, GetFunctionTimestamp ((XButtonEvent *)event), GetEventInverseMask(event)); } else { if (pCD->maxConfig) { newState = MAXIMIZED_STATE; } else { newState = NORMAL_STATE; } SetClientStateWithEventMask (pCD, newState, GetFunctionTimestamp ((XButtonEvent *)event), GetEventInverseMask(event)); } } return (False); } /* END OF FUNCTION F_Restore */ /*************************************<->************************************* * * F_Restore_And_Raise (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for putting a client window * in the normal state and raising it from and icon. * *************************************<->***********************************/ Boolean F_Restore_And_Raise (String args, ClientData *pCD, XEvent *event) { int newState; if (pCD) { if (pCD->clientState == MINIMIZED_STATE) { /* Restore window */ if (pCD->maxConfig) { newState = MAXIMIZED_STATE; } else { newState = NORMAL_STATE; } SetClientStateWithEventMask (pCD, newState, (Time) (event ? GetFunctionTimestamp ((XButtonEvent *)event) : GetTimestamp ()), GetEventInverseMask(event)); } else { /* Make sure we restore the window first */ F_Restore (NULL, pCD, event); /* Raise the window and set the keyboard focus to the window */ #ifdef WSM wmGD.bSuspendSecondaryRestack = True; #endif /* WSM */ F_Raise (NULL, pCD, (XEvent *)NULL); #ifdef WSM wmGD.bSuspendSecondaryRestack = False; #endif /* WSM */ if (wmGD.raiseKeyFocus) { F_Focus_Key (NULL, pCD, (event ? ((XEvent *)event) : ((XEvent *)NULL))); } } wmGD.clickData.clickPending = False; wmGD.clickData.doubleClickPending = False; } return (False); } /* END OF FUNCTION F_Restore_And_Raise */ /*************************************<->************************************* * * F_Pack_Icons (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for packing icons in the * icon box or on the desktop. * *************************************<->***********************************/ Boolean F_Pack_Icons (String args, ClientData *pCD, XEvent *event) { IconBoxData *pIBD; if (ACTIVE_PSD->useIconBox) { pIBD = ACTIVE_WS->pIconBox; if (pCD) { while (pCD != pIBD->pCD_iconBox) { if (pIBD->pNextIconBox) { pIBD = pIBD->pNextIconBox; } else { pIBD = NULL; break; } } } if (pIBD) { PackIconBox (pIBD, False, False, 0, 0); } else { PackRootIcons (); } } else { PackRootIcons (); } return (True); } /* END OF FUNCTION F_Pack_Icons */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * F_Post_RMenu (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for posting the * root window menu. * This function can only be invoked by a key event. * *************************************<->***********************************/ Boolean F_Post_RMenu (String args, ClientData *pCD, XEvent *event) { MenuSpec *rootMenu; unsigned int button = NoButton; int x, y; long flags = POST_AT_XY; Window rwin, cwin; int winx, winy; unsigned int mask; if ((event->type == KeyPress) || (event->type == KeyRelease)) { /* Find the root menu spec */ for (rootMenu = ACTIVE_PSD->menuSpecs; rootMenu != (MenuSpec *) NULL; rootMenu = rootMenu->nextMenuSpec) { if (strcmp(rootMenu->name, ACTIVE_PSD->rootMenu) == 0) break; } /* If we couldn't find the root menu, then do nothing. */ if (rootMenu == (MenuSpec *) NULL) return (False); else { XQueryPointer(DISPLAY, ACTIVE_ROOT, &rwin, &cwin, &x, &y, &winx, &winy, &mask); PostMenu (rootMenu, NULL, x, y, NoButton, F_CONTEXT_ROOT, flags, event); } } return (False); } /* END OF FUNCTION F_Post_RMenu */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * F_Post_SMenu (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for posting the system menu * for the specified client. * This function can only be invoked by a key or button event. * wmGD.menuUnpostKeySpec is assumed set appropriately; it will be set to * NULL when the menu is unposted. * *************************************<->***********************************/ Boolean F_Post_SMenu (String args, ClientData *pCD, XEvent *event) { Context menuContext; /* * An event must be used to post the system menu using this function. */ if (event && pCD && pCD->systemMenuSpec) { /* * Determine whether the keyboard is posting the menu and post * the menu at an appropriate place. */ if (pCD->clientState == NORMAL_STATE) { menuContext = F_CONTEXT_NORMAL; } else if (pCD->clientState == MAXIMIZED_STATE) { menuContext = F_CONTEXT_MAXIMIZE; } else { menuContext = F_CONTEXT_ICON; } if (P_ICON_BOX(pCD) && event->xany.window == ICON_FRAME_WIN(pCD)) { if (pCD->clientState == MINIMIZED_STATE) { menuContext = F_SUBCONTEXT_IB_IICON; } else { menuContext = F_SUBCONTEXT_IB_WICON; } } if ((event->type == KeyPress) || (event->type == KeyRelease)) { /* * Set up for "sticky" menu processing if specified. */ if (pCD->clientState == MINIMIZED_STATE || menuContext == (F_SUBCONTEXT_IB_IICON | F_SUBCONTEXT_IB_WICON)) { if (wmGD.iconClick) { wmGD.checkHotspot = True; } } else if (wmGD.systemButtonClick && (pCD->decor & MWM_DECOR_MENU)) { wmGD.checkHotspot = True; } PostMenu (pCD->systemMenuSpec, pCD, 0, 0, NoButton, menuContext, 0, event); } else if (event->type == ButtonPress) { #ifdef WSM /* * Root menu, if posted with button press, then * set up to handle root menu click to make the menu * sticky. */ if (wmGD.rootButtonClick && (!wmGD.checkHotspot)) { wmGD.checkHotspot = True; wmGD.hotspotRectangle.x = event->xbutton.x_root - wmGD.moveThreshold/2; wmGD.hotspotRectangle.y = event->xbutton.y_root - wmGD.moveThreshold/2; wmGD.hotspotRectangle.width = wmGD.moveThreshold; wmGD.hotspotRectangle.height = wmGD.moveThreshold; } #endif /* WSM */ PostMenu (pCD->systemMenuSpec, pCD, event->xbutton.x_root, event->xbutton.y_root, event->xbutton.button, menuContext, POST_AT_XY, event); } else if (event->type == ButtonRelease) { PostMenu (pCD->systemMenuSpec, pCD, event->xbutton.x_root, event->xbutton.y_root, event->xbutton.button, menuContext, POST_AT_XY | POST_TRAVERSAL_ON, event); } } return (False); } /* END OF FUNCTION F_PostSMenu */ /*************************************<->************************************* * * F_Kill (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for terminating a client. * Essentially the client connection is shut down. * *************************************<->***********************************/ Boolean F_Kill (String args, ClientData *pCD, XEvent *event) { if (pCD && (pCD->clientFunctions & MWM_FUNC_CLOSE)) { Boolean do_delete_window = pCD->protocolFlags & PROTOCOL_WM_DELETE_WINDOW; Boolean do_save_yourself = pCD->protocolFlags & PROTOCOL_WM_SAVE_YOURSELF; #ifdef PANELIST if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) { Widget wPanel; /* * Get the widget for the subpanel * (Should be only child of the shell!) */ wPanel = WmPanelistWindowToSubpanel (DISPLAY1, pCD->client); if (wPanel) { SlideSubpanelBackIn (pCD, wPanel); } return (False); } if (pCD->clientFlags & ICON_BOX) { /* * When the front panel is used with the icon box, * "Close" hides the icon box into the front panel. */ if ((wmGD.useFrontPanel) && (pCD->pSD->iconBoxControl) && (IconBoxShowing(pCD->pSD->pActiveWS))) { IconBoxPopUp (pCD->pSD->pActiveWS, False); } } else #endif /* PANELIST */ if (!do_delete_window && !do_save_yourself) { XKillClient (DISPLAY, pCD->client); } else { if (do_delete_window) { /* * The client wants to be notified, not killed. */ SendClientMsg (pCD->client, (long) wmGD.xa_WM_PROTOCOLS, (long) wmGD.xa_WM_DELETE_WINDOW, CurrentTime, NULL, 0); } #ifdef WSM /* * HP does not want to send a client message for both * delete_window AND save_yourself. The current OSF * patch did just that. This "else if" returns dtwm * to the behavior of dt 2.01 */ else if (do_save_yourself) #else /* WSM */ if (do_save_yourself) #endif /* WSM */ { /* * Send a WM_SAVE_YOURSELF message and wait for a change to * the WM_COMMAND property. * !!! button and key input should be kept from the window !!! */ if (AddWmTimer (TIMER_QUIT, (unsigned long) wmGD.quitTimeout, pCD)) { SendClientMsg (pCD->client, (long) wmGD.xa_WM_PROTOCOLS, (long) wmGD.xa_WM_SAVE_YOURSELF, CurrentTime, NULL, 0); pCD->clientFlags |= CLIENT_TERMINATING; } else { XKillClient (DISPLAY, pCD->client); } } } } return (False); } /* END OF FUNCTION F_Kill */ #ifdef WSM /*************************************<->************************************* * * F_Marquee_Selection (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for selecting * non-window manager objects on the root window. * *************************************<->***********************************/ Boolean F_Marquee_Selection (String args, ClientData *pCD, XEvent *event) { if (!pCD) { /* * This function only valid in root context */ StartMarqueeSelect (ACTIVE_PSD, event); HandleMarqueeSelect (ACTIVE_PSD, event); } return (False); } /* END OF FUNCTION F_Marquee_Selection */ /*************************************<->************************************* * * RefreshByClearing (win) * * * Description: * ----------- * Recursively refresh this window and its children by doing * XClearAreas * *************************************<->***********************************/ static void RefreshByClearing (Window win) { Status status; int i; Window root, parent; unsigned int nchildren; Window *winChildren; /* clear this window */ XClearArea(DISPLAY, win, 0, 0, 0, 0, True); /* find any children and clear them, too */ status = XQueryTree(DISPLAY, win, &root, &parent, &winChildren, &nchildren); if (status != 0) { /* recurse for each child window */ for (i=0; i 0) XFree((char *)winChildren); } } #endif /* WSM */ /*************************************<->************************************* * * F_Refresh (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for causing all windows * in the workspace to be redrawn. * *************************************<->***********************************/ Boolean F_Refresh (String args, ClientData *pCD, XEvent *event) { Window win; #ifdef WSM if (wmGD.refreshByClearing) { RefreshByClearing (ACTIVE_ROOT); } else { #endif /* WSM */ /* default background_pixmap is None */ win = XCreateWindow (DISPLAY, ACTIVE_ROOT, 0, 0, (unsigned int) DisplayWidth (DISPLAY, ACTIVE_SCREEN), (unsigned int) DisplayHeight (DISPLAY, ACTIVE_SCREEN), 0, 0, InputOutput, CopyFromParent, 0, (XSetWindowAttributes *)NULL); XMapWindow (DISPLAY, win); XDestroyWindow (DISPLAY, win); #ifdef WSM } #endif /* WSM */ XFlush (DISPLAY); return (True); } /* END OF FUNCTION F_Refresh */ /*************************************<->************************************* * * F_Resize (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for resizing a client window. * *************************************<->***********************************/ Boolean F_Resize (String args, ClientData *pCD, XEvent *event) { if (pCD && (pCD->clientFunctions & MWM_FUNC_RESIZE) && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { StartClientResize (pCD, event); HandleClientFrameResize (pCD, event); } return (False); } /* END OF FUNCTION F_Resize */ /*************************************<->************************************* * * F_Restart (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for restarting the window * manager. * *************************************<->***********************************/ Boolean F_Restart (String args, ClientData *pCD, XEvent *event) { #ifdef WSM if (args && *args && !strcmp (args, DTWM_REQP_NO_CONFIRM)) { RestartWm (MWM_INFO_STARTUP_CUSTOM); } else #endif /* WSM */ if (wmGD.showFeedback & WM_SHOW_FB_RESTART) { ConfirmAction (ACTIVE_PSD, RESTART_ACTION); } else { RestartWm (MWM_INFO_STARTUP_CUSTOM); } return (False); } /* END OF FUNCTION F_Restart */ /*************************************<->************************************* * * Do_Restart (dummy) * * * Description: * ----------- * Callback function for restarting the window manager. * *************************************<->***********************************/ void Do_Restart (Boolean dummy) { RestartWm (MWM_INFO_STARTUP_CUSTOM); } /* END OF FUNCTION Do_Restart */ /*************************************<->************************************* * * RestartWm (startupFlags) * * * Description: * ----------- * Actually restarts the window manager. * * * Inputs: * ------ * startupFlags = flags to be put into the Wm_INFO property for restart. * *************************************<->***********************************/ void RestartWm (long startupFlags) { ClientListEntry *pNextEntry; int scr; for (scr=0; scrtype == NORMAL_STATE) { if (pNextEntry->pCD->clientFlags & CLIENT_WM_CLIENTS) { if (pNextEntry->pCD->clientState != MINIMIZED_STATE) { XUnmapWindow (DISPLAY, pNextEntry->pCD->clientFrameWin); } } else { DeFrameClient (pNextEntry->pCD); } } pNextEntry = pNextEntry->prevSibling; } #if defined(PANELIST) UnParentControls (&wmGD.Screens[scr], True); #endif /* PANELIST */ } } #ifdef WSM /* shut down the messaging connection */ dtCloseIPC(); #endif /* WSM */ ResignFromSM(); /* * This fixes restart problem when going from explicit focus to * pointer focus. Window under pointer was not getting focus indication * until pointer was moved to new window, or out of and into the * window. */ XSetInputFocus (DISPLAY, PointerRoot, RevertToPointerRoot, CurrentTime); XSync (DISPLAY, False); #ifdef WSM CLOSE_FILES_ON_EXEC(); _DtEnvControl(DT_ENV_RESTORE_PRE_DT); #endif /* WSM */ /* * Restart the window manager with the initial arguments plus * the restart settings. */ execvp (*(wmGD.argv), wmGD.argv); #ifdef WSM Warning (((char *)GETMESSAGE(26, 1, "The window manager restart failed. The window manager program could not \ be found or could not be executed."))); #else /* WSM */ Warning ("Cannot restart the window manager"); #endif /* WSM */ Do_Quit_Mwm (True); } /* END OF FUNCTION RestartWm */ /*************************************<->************************************* * * DeFrameClient (pCD) * * * Description: * ----------- * Unmaps a client window (and client icon window) and reparents the * window back to the root. * * * Inputs: * ------- * pCD = pointer to the client data for the window to be de-framed. * *************************************<->***********************************/ void DeFrameClient (ClientData *pCD) { int x, y; int xoff, yoff; XWindowChanges windowChanges; while (pCD) { if (pCD->clientState != MINIMIZED_STATE) { XUnmapWindow (DISPLAY, pCD->clientFrameWin); } if (pCD->iconWindow && (pCD->clientFlags & ICON_REPARENTED)) { XUnmapWindow (DISPLAY, pCD->iconWindow); XRemoveFromSaveSet (DISPLAY, pCD->iconWindow); #ifdef WSM XReparentWindow (DISPLAY, pCD->iconWindow, ROOT_FOR_CLIENT(pCD), pCD->pWsList->iconX, pCD->pWsList->iconY); #else /* WSM */ XReparentWindow (DISPLAY, pCD->iconWindow, ROOT_FOR_CLIENT(pCD), pCD->iconX, pCD->iconY); #endif /* WSM */ } if (pCD->maxConfig) { x = pCD->maxX; y = pCD->maxY; } else { if(wmGD.positionIsFrame) { CalculateGravityOffset (pCD, &xoff, &yoff); x = pCD->clientX - xoff; y = pCD->clientY - yoff; } else { x = pCD->clientX; y = pCD->clientY; } } #ifndef UNMAP_ON_RESTART if (pCD->clientState == MINIMIZED_STATE) { XUnmapWindow (DISPLAY, pCD->client); } #else XUnmapWindow (DISPLAY, pCD->client); #endif XRemoveFromSaveSet (DISPLAY, pCD->client); XReparentWindow (DISPLAY, pCD->client, ROOT_FOR_CLIENT(pCD), x, y); if (pCD->transientChildren) { DeFrameClient (pCD->transientChildren); } /* * restore X border */ windowChanges.x = x; windowChanges.y = y; windowChanges.border_width = pCD->xBorderWidth; XConfigureWindow (DISPLAY, pCD->client, CWBorderWidth | CWX | CWY, &windowChanges); if (pCD->transientLeader) { pCD = pCD->transientSiblings; } else { pCD = NULL; } } } /* END OF FUNCTION DeFrameClient */ #if defined(PANELIST) /******************************<->************************************* * * F_Toggle_Front_Panel (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for toggling the * front panel off and on. ******************************<->***********************************/ Boolean F_Toggle_Front_Panel (String args, ClientData *pCD, XEvent *event) { WmPanelistObject pPanelist; if (pCD) { pPanelist = (WmPanelistObject) pCD->pSD->wPanelist; } else { pPanelist = (WmPanelistObject) ACTIVE_PSD->wPanelist; } pCD = NULL; if (pPanelist) { (void) XFindContext (DISPLAY, XtWindow(O_Shell(pPanelist)), wmGD.windowContextType, (caddr_t *)&pCD); } if (pCD) { if (pCD->clientState & MINIMIZED_STATE) { SetClientState (pCD, NORMAL_STATE, GetFunctionTimestamp ((XButtonEvent *)event)); } else { SetClientState (pCD, MINIMIZED_STATE, GetFunctionTimestamp ((XButtonEvent *)event)); } } return(True); } /* END OF FUNCTION F_Toggle_Front_Panel */ /******************************<->************************************* * * Boolean F_Version (String args, ClientData *pCD, XEvent *event) * * Description: * ----------- * Invoke the help on version dialogue. * * Inputs: * ------ * args - incoming values * pCD - associated client data structure * event - what triggered this call * * Outputs: * ------- * Return - True if the call occurs; false otherwise. * * Comments: * -------- * ******************************<->***********************************/ Boolean F_Version (String args, ClientData *pCD, XEvent *event) { WmPanelistObject pPanelist; if (pCD) { pPanelist = (WmPanelistObject) pCD->pSD->wPanelist; } else { pPanelist = (WmPanelistObject) ACTIVE_PSD->wPanelist; } if (pPanelist) { WmDtHelpOnVersion (O_Shell (pPanelist)); } return (True); } /* END OF FUNCTION F_Version */ #endif /* PANELIST */ /******************************<->************************************* * * F_Send_Msg (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for sending a client * message event to a client window. * * * Inputs: * ------ * args = (immediate value) message id * * pCD = pointer to the client data * * event = X event that invoked the function (key, button, or menu/NULL) * * ******************************<->***********************************/ Boolean F_Send_Msg (String args, ClientData *pCD, XEvent *event) { register int i; if (pCD && pCD->mwmMessagesCount) { /* * A message id must be made "active" by being included in the * _MWM_MESSAGES property before the associated message can be sent. */ for (i = 0; i < pCD->mwmMessagesCount; i++) { if (pCD->mwmMessages[i] == (long)args) { SendClientMsg (pCD->client, (long) wmGD.xa_MWM_MESSAGES, (long)args, CurrentTime, NULL, 0); return (True); } } } return (True); } /* END OF FUNCTION F_Send_Msg */ /*************************************<->************************************* * * F_Separator (args, pCD, event) * * * Description: * ----------- * This is a placeholder function; it should never be called. * *************************************<->***********************************/ Boolean F_Separator (String args, ClientData *pCD, XEvent *event) { return (True); } /* END OF FUNCTION F_Separator */ Boolean ForceRaiseWindow (ClientData *pcd) { #if 0 Window stackWindow; WmScreenData *pSD = (ACTIVE_WS)->pSD; #endif XWindowChanges changes; Boolean restack = False; #if 0 if (pSD->clientList->type == MINIMIZED_STATE) { stackWindow = ICON_FRAME_WIN(pSD->clientList->pCD); } else { stackWindow = pSD->clientList->pCD->clientFrameWin; } #endif /* * Windows did not raise on regular f.raise because the raise was * not relative to another window (methinks). */ changes.stack_mode = Above; XConfigureWindow (DISPLAY, pcd->clientFrameWin, CWStackMode, &changes); return (restack); } /*************************************<->************************************* * * F_Raise (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for topping the client window * so that it is unobscured. * *************************************<->***********************************/ Boolean F_Raise (String args, ClientData *pCD, XEvent *event) { ClientListEntry *pEntry; ClientListEntry *pNextEntry; ClientListEntry *pStackEntry; String string = args; int flags = STACK_NORMAL; #ifdef WSM WmWorkspaceData *pWS = ACTIVE_WS; #endif /* WSM */ if (string) { /* process '-client' argument */ if (string[0] == '-') { string = &string[1]; string = (String) GetString ((unsigned char **) &string); pStackEntry = NULL; pNextEntry = ACTIVE_PSD->clientList; while (pNextEntry && (pEntry = FindClientNameMatch (pNextEntry, True, string, F_GROUP_ALL))) { pNextEntry = pEntry->nextSibling; #ifdef WSM if (ClientInWorkspace (pWS, pEntry->pCD)) { #endif /* WSM */ Do_Raise (pEntry->pCD, pStackEntry, STACK_NORMAL); pStackEntry = pEntry; #ifdef WSM } #endif /* WSM */ } } /* process family stacking stuff */ else if (*string) { unsigned int slen, len, index; slen = strlen(args) - 2; /* subtract '\n' and NULL */ for (index = 0; index < slen; string = &args[index+1]) { if ((string = (String) GetString ((unsigned char **) &string)) == NULL) break; len = strlen(string); if (!strcmp(string,"within")) { flags |= STACK_WITHIN_FAMILY; } else if (!strcmp(string,"freeFamily")) { flags |= STACK_FREE_FAMILY; } index += len; } #ifdef WSM if (ClientInWorkspace (pWS, pCD)) { #endif /* WSM */ Do_Raise (pCD, (ClientListEntry *) NULL, flags); #ifdef WSM } #endif /* WSM */ } } else if (pCD) { #ifdef WSM if (ClientInWorkspace (pWS, pCD)) { #endif /* WSM */ Do_Raise (pCD, (ClientListEntry *) NULL, STACK_NORMAL); #ifdef WSM } #endif /* WSM */ } return (True); } /* END OF FUNCTION F_Raise */ /*************************************<->************************************* * * Do_Raise (pCD, pStackEntry) * * * Description: * ----------- * This is the window manager function handler for topping the client window * so that it is unobscured. * * * Inputs: * ------ * pCD = pointer to the client data of the window (or icon) to be raised. * * pStackEntry = pointer to client list entry for window that is to be * above the raised window (if NULL window is raised to the top of the * stack). * *************************************<->***********************************/ void Do_Raise (ClientData *pCD, ClientListEntry *pStackEntry, int flags) { Boolean restackTransients; ClientData *pcdLeader; WmWorkspaceData *pWS = ACTIVE_WS; #ifdef WSM Boolean bLeaderRestacked; #endif /* WSM */ #ifdef PANELIST if (pCD->pECD) { /* * Window has been reparented into the front panel. * Don't follow through on window stacking change. */ return; } else #else /* PANELIST */ #endif /* PANELIST */ #ifdef WSM if (ClientInWorkspace(pWS, pCD) && (!pStackEntry || ClientInWorkspace (pWS, pStackEntry->pCD))) { /* * Both clients are in the current workspace. Set * client indices so that the access macros work. */ SetClientWsIndex (pCD); if (pStackEntry) { SetClientWsIndex (pStackEntry->pCD); } } else { /* * One or both of the clients are not in the current workspace * Do nothing. */ return; } #endif /* WSM */ pcdLeader = (pCD->transientLeader) ? FindTransientTreeLeader (pCD) : pCD; if (wmGD.systemModalActive && (pcdLeader != wmGD.systemModalClient)) { /* * Don't raise the window above the system modal window. */ } else if ((pcdLeader->clientState == MINIMIZED_STATE) && !P_ICON_BOX(pcdLeader)) { /* * If a dirtyStackEntry exists, return it to its original place * in the stack (for all stacking types) */ if (dirtyStackEntry) { if (dirtyStackEntry->transientChildren || dirtyStackEntry->transientLeader) RestackTransients (dirtyStackEntry); dirtyStackEntry = NULL; dirtyLeader = NULL; } /* * Only restack the icon if it is not currently raised. */ if (pStackEntry) { if (pStackEntry->nextSibling != &pcdLeader->iconEntry) { StackWindow (pWS, &pcdLeader->iconEntry, False /*below*/, pStackEntry); MoveEntryInList (pWS, &pcdLeader->iconEntry, False /*below*/, pStackEntry); } } else { if (ACTIVE_PSD->clientList != &pcdLeader->iconEntry) { StackWindow (pWS, &pcdLeader->iconEntry, True /*on top*/, (ClientListEntry *) NULL); MoveEntryInList (pWS, &pcdLeader->iconEntry, True /*on top*/, (ClientListEntry *) NULL); } } } else /* NORMAL_STATE, MAXIMIZED_STATE, adoption */ { #ifdef WSM /* * Handle restacking of primary/secondary windows * within the transient window tree. Don't raise this * window above any modal transients. */ bLeaderRestacked = False; if ((pcdLeader->transientChildren) && (!pCD->secondariesOnTop) && (!wmGD.bSuspendSecondaryRestack) && (!IS_APP_MODALIZED(pCD))) { if (pCD != pcdLeader) { /* * This is not the transient leader, make sure * the transient leader isn't on top. * (Brute force solution) */ bLeaderRestacked = NormalizeTransientTreeStacking (pcdLeader); if (pCD->transientChildren) { /* * This isn't the overall leader of the transient * tree, but it does have transient's of its own. * Move it to the top of its own transient sub-tree. */ bLeaderRestacked |= BumpPrimaryToTop (pCD); } } else { /* * This is the transient leader, move it to the * top. */ bLeaderRestacked = BumpPrimaryToTop (pcdLeader); } } #endif /* WSM */ /* * If this is a transient window then put it on top of its * sibling transient windows. */ restackTransients = False; /* * Fix for 5325 - The following code has been reorganized to cause the * action of F_Raise to match the current documentation. * The new algorithm is as follows: * * if (dirtyStackEntry) * restore dirty tree * if (not withinFamily) * bring window group to the top of global stack * if (freeFamily) * raise the requested window to top of family * else * raise requested window to top of siblings * if (need to restack windows) * restack windows * return */ /* * If a dirtyStackEntry exists, return it to its original place * in the stack (for all stacking types) */ if (dirtyStackEntry) { /* * Check to make sure that the dirty pCD has either transient * children or a transient leader. If not, do not restore * the transients. */ if (dirtyStackEntry->transientChildren || dirtyStackEntry->transientLeader) RestackTransients (dirtyStackEntry); dirtyStackEntry = NULL; dirtyLeader = NULL; } /* * If the flags do not indicate "within", raise the window family * to the top of the window stack. If the window is the primary, * raise it to the top regardless of the flags. */ if (!pCD->transientLeader || !(flags & STACK_WITHIN_FAMILY)) { if (pStackEntry) { if (pStackEntry->nextSibling != &pcdLeader->clientEntry) { StackWindow (pWS, &pcdLeader->clientEntry, False /*below*/, pStackEntry); MoveEntryInList (pWS, &pcdLeader->clientEntry, False /*below*/, pStackEntry); } } else { if (ACTIVE_PSD->clientList != &pcdLeader->clientEntry) { StackWindow (pWS, &pcdLeader->clientEntry, True /*on top*/, (ClientListEntry *) NULL); MoveEntryInList (pWS, &pcdLeader->clientEntry, True /*on top*/, (ClientListEntry *) NULL); } } } /* * If freeFamily stacking is requested, check to make sure that * the window has either a transientChild or Leader. This will * guarantee that windows that form their own family are not * labelled as dirty (what's to dirty it up?). If it has either, * raise the window to the top of the family stack. */ if ((flags & STACK_FREE_FAMILY) && (pCD->transientLeader || pCD->transientChildren)) { dirtyStackEntry = pCD; dirtyLeader = pcdLeader; restackTransients = ForceRaiseWindow (pCD); } /* * If withinFamily stacking is requested, put the current transient * on top of its sibling transient windows. */ else { restackTransients = PutTransientOnTop (pCD); } /* At this point, if doing a regular f.raise the window family has * already been brought to the top of the stack, so nothing further * needs to be done for it. */ /* Restack the transients if needed */ #ifdef WSM if ((restackTransients) || (bLeaderRestacked)) #else /* WSM */ if (restackTransients) #endif /* WSM */ { RestackTransients (pCD); } } } /* END OF FUNCTION Do_Raise */ /*************************************<->************************************* * * F_Raise_Lower (args, pCD, event) * * * Description: * ----------- * This window manager function tops an obscured window or icon and bottoms * a window or icon that is on top of the window stack. * *************************************<->***********************************/ Boolean F_Raise_Lower (String args, ClientData *pCD, XEvent *event) { ClientData *pcdLeader; if (pCD) { pcdLeader = (pCD->transientLeader) ? FindTransientTreeLeader (pCD) : pCD; /* * Treat a raise/lower on a window in a transient tree as if it is * a raise/lower for the whole tree. */ if (CheckIfClientObscuredByAny (pcdLeader)) { /* * The window is obscured by another window, raise the window. */ #ifdef WSM F_Raise (NULL, pCD, (XEvent *)NULL); #else /* WSM */ F_Raise (NULL, pcdLeader, (XEvent *)NULL); #endif /* WSM */ } else if (CheckIfClientObscuringAny (pcdLeader) && !(wmGD.systemModalActive && (pcdLeader == wmGD.systemModalClient))) { /* * The window is obscuring another window and is * not system modal, lower the window. */ F_Lower (NULL, pcdLeader, (XEvent *)NULL); #ifdef WSM if ((pcdLeader->secondariesOnTop == False) && (pCD->transientLeader != NULL) && (!IS_APP_MODALIZED(pcdLeader))) { /* Push transient below primary */ (void) BumpPrimaryToTop (pcdLeader); RestackTransients (pcdLeader); } #endif /* WSM */ } #ifdef WSM else if ((pcdLeader->secondariesOnTop == False) && (pcdLeader->transientChildren != NULL) && (!wmGD.systemModalActive) && (!IS_APP_MODALIZED(pcdLeader))) { if (LeaderOnTop(pcdLeader)) { /* Push primary below transient */ (void) BumpPrimaryToBottom (pcdLeader); RestackTransients (pcdLeader); } else { F_Raise (NULL, pCD, (XEvent *)NULL); /* Push transient below primary */ (void) BumpPrimaryToTop (pcdLeader); RestackTransients (pcdLeader); } } #endif /* WSM */ } return (True); } /* END OF FUNCTION F_Raise_Lower */ /*************************************<->************************************* * * F_Refresh_Win (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for causing a client window * to redisplay itself. * *************************************<->***********************************/ Boolean F_Refresh_Win (String args, ClientData *pCD, XEvent *event) { Window win; unsigned int w, h; if (pCD && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { if (pCD->clientState == NORMAL_STATE) { w = (unsigned int) pCD->clientWidth; h = (unsigned int) pCD->clientHeight; } else { w = (unsigned int) pCD->maxWidth; h = (unsigned int) pCD->maxHeight; } #ifdef WSM if (wmGD.refreshByClearing) { RefreshByClearing (pCD->clientFrameWin); } else { #endif /* WSM */ /* default background_pixmap is None */ win = XCreateWindow (DISPLAY, pCD->clientBaseWin, pCD->matteWidth, pCD->matteWidth, w, h, 0, 0, InputOutput, CopyFromParent, 0, (XSetWindowAttributes *)NULL); XMapWindow (DISPLAY, win); XDestroyWindow (DISPLAY, win); #ifdef WSM } #endif /* WSM */ XFlush (DISPLAY); } return (True); } /* END OF FUNCTION F_Refresh_Win */ /*************************************<->************************************* * * F_Set_Behavior (args, pCD, event) * * * Description: * ----------- * This function is used to switch the window manager configuration between * the built-in configuration (for CXI behavior) and the user's custom * configuration. * *************************************<->***********************************/ Boolean F_Set_Behavior (String args, ClientData *pCD, XEvent *event) { /* * Go system modal in starting to do the set behavior. */ /* !!! grab the server and the pointer !!! */ /* * Confirm that a set_behavior should be done. * Execute restart if so. */ if (wmGD.showFeedback & WM_SHOW_FB_BEHAVIOR) { ConfirmAction (ACTIVE_PSD, (wmGD.useStandardBehavior) ? CUSTOM_BEHAVIOR_ACTION : DEFAULT_BEHAVIOR_ACTION); } else { RestartWm ((long) ((wmGD.useStandardBehavior) ? MWM_INFO_STARTUP_CUSTOM : MWM_INFO_STARTUP_STANDARD)); } return (False); } /* END OF FUNCTION F_Set_Behavior */ /*************************************<->************************************* * * Do_Set_Behavior (dummy) * * * Description: * ----------- * Callback to do the f.set_behavior function. * *************************************<->***********************************/ void Do_Set_Behavior (Boolean dummy) { RestartWm ((long) ((wmGD.useStandardBehavior) ? MWM_INFO_STARTUP_CUSTOM : MWM_INFO_STARTUP_STANDARD)); } /* END OF FUNCTION Do_Set_Behavior */ #ifdef WSM /*************************************<->************************************* * * F_Set_Context (args, pCD, event) * * * Description: * ----------- * This function is used to set a client context for subsequent * WM_REQUESTs * *************************************<->***********************************/ Boolean F_Set_Context (String args, ClientData *pCD, XEvent *event) { wmGD.requestContextWin = (Window) args; return (True); } /* END OF FUNCTION F_Set_Context */ #endif /* WSM */ /*************************************<->************************************* * * F_Title (args, pCD, event) * * * Description: * ----------- * This is a placeholder function; it should never be called. * *************************************<->***********************************/ Boolean F_Title (String args, ClientData *pCD, XEvent *event) { return (True); } /* END OF FUNCTION F_Title */ /******************************<->************************************* * * F_Screen (args, pCD, event) * * * Description: * ----------- * This is the window manager function handler for warping to screens * * * Inputs: * ------ * args = (immediate value) window type flags * * pCD = pointer to the client data * * event = X event that invoked the function (key, button, or menu/NULL) * * NOTE: May want to consider tracking changes in screen because in * managing a new window (ie. in ManageWindow()). * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * *************************************<->***********************************/ Boolean F_Screen (String args, ClientData *pCD, XEvent *event) { Window dumwin; int x, y, dumint; unsigned int dummask; WmScreenData *newscr = NULL; int scr, inc; static int PreviousScreen = -1; char pch[80]; if (PreviousScreen == -1) { PreviousScreen = DefaultScreen(DISPLAY); } if (strcmp (args, "next") == 0) { scr = ACTIVE_PSD->screen + 1; inc = 1; } else if (strcmp (args, "prev") == 0) { scr = ACTIVE_PSD->screen - 1; inc = -1; } else if (strcmp (args, "back") == 0) { scr = PreviousScreen; inc = 0; } else { scr = atoi (args); inc = 0; } while (!newscr) { /* wrap around */ if (scr < 0) scr = wmGD.numScreens - 1; else if (scr >= wmGD.numScreens) scr = 0; newscr = &(wmGD.Screens[scr]); if (!wmGD.Screens[scr].managed) { /* make sure screen is managed */ if (inc) { /* walk around the list */ scr += inc; continue; } sprintf(pch, "Unable to warp to unmanaged screen %d\n", scr); Warning (&pch[0]); XBell (DISPLAY, 0); return (False); } } if (ACTIVE_PSD->screen == scr) return (False); /* already on that screen */ PreviousScreen = ACTIVE_PSD->screen; XQueryPointer (DISPLAY, ACTIVE_ROOT, &dumwin, &dumwin, &x, &y, &dumint, &dumint, &dummask); XWarpPointer (DISPLAY, None, newscr->rootWindow, 0, 0, 0, 0, x, y); if (newscr && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)) { /* * Set the ACTIVE_PSD to the new screen so that Do_Focus_Key can * uses the new screen instead of the old screen. Then call * Do_Focus_Key with a NULL pCD to find a reasonable client to * set focus to. */ SetActiveScreen (newscr); Do_Focus_Key (NULL, GetFunctionTimestamp ((XButtonEvent *)event), ALWAYS_SET_FOCUS); } return (False); } #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * F_InvokeCommand (args, pCD, event) * * * Description: * ----------- * This is the window manager function for invoking client inserted menu * commands. * *************************************<->***********************************/ Boolean F_InvokeCommand (String args, ClientData *pCD, XEvent *event) { CARD32 commandID, clientWindow; Atom notifySelection; if (args == (String) NULL) return(FALSE); if (sscanf(args, "%d %d %ld", (int *)&commandID, (int *)&clientWindow, ¬ifySelection) != 3) return(FALSE); SendInvokeMessage(commandID, (pCD == (ClientData *) NULL ? 0 : pCD->client), notifySelection, LastTime()); return (True); } /* END OF FUNCTION F_InvokeCommand */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * GetFunctionTimestamp (pEvent) * * * Description: * ----------- * This function is used to extract a timestamp from a key or button event. * If the event passed in is not a key or button event then a timestamp * is generated. * * * Inputs: * ------ * event = pointer to an X event * * * Outputs: * ------- * RETURN = a timestamp * *************************************<->***********************************/ Time GetFunctionTimestamp (XButtonEvent *pEvent) { Time time; if (pEvent && (((pEvent->type == ButtonPress) || (pEvent->type == ButtonRelease)) || ((pEvent->type == KeyPress) || (pEvent->type == KeyRelease)))) { time = pEvent->time; } else { time = GetTimestamp (); } return (time); } /* END OF FUNCTION GetFunctionTimestamp */ /* ** name the event mask we need for a grab in order to find the matching ** event for an event; right now handle only button-presses */ static unsigned int GetEventInverseMask(XEvent *event) { if ((XEvent*)NULL == event) return 0; if (ButtonPress == event->type) return ButtonReleaseMask; /* detail ? */ /* expansion further here */ else return 0; } /*************************************<->************************************* * * ClearDirtyStackEntry (pCD) * * * Description: * ----------- * This function is used to clear the static dirtyStackEntry structure and * the dirtyLeader static variable when a pCD is destroyed. This * guarantees that freed memory will not be accessed. * * * Inputs: * ------ * pCD = pointer to clientData being freed * * * Outputs: * ------- * RETURN = void * *************************************<->***********************************/ void ClearDirtyStackEntry (ClientData *pCD) { if (pCD == dirtyStackEntry) { dirtyStackEntry = NULL; dirtyLeader = NULL; } } #if defined(DEBUG) && defined(WSM) /***********************<->************************************* * * F_ZZ_Debug (args, pCD, event) * * * Description: * ----------- * This is the window manager debug (multi) function * * * Inputs: * ------ * args = arguments * * pCD = pointer to the ClientData for the whole front panel * * event = X event that invoked the function (key, button, or menu/NULL) * * * Outputs: * ------- * RETURN = if True then further button binding/function processing can * be done for the event that caused this function to be called. * * Comments: * ------- * Argument 1 determines the debug function to execute: * * Valid arguments: * * "color_server_info" - dump out color server info * ******************************<->***********************************/ Boolean F_ZZ_Debug (String subFcn, ClientData *pCD, XEvent *event) { /* Only do something is sub function is specified */ if (subFcn) { if (!(strcmp(subFcn, "dump_resources"))) { int scr; char szRes[80]; for (scr=0; scr************************************* * * F_Next_Workspace (args, pCD, event) * * * Description: * ----------- * This function switches to the next workspace in the list * *************************************<->***********************************/ Boolean F_Next_Workspace (String args, ClientData *pCD, XEvent *event) { WmScreenData *pSD = ACTIVE_PSD; int iwsx; for (iwsx = 0; iwsx < pSD->numWorkspaces; iwsx++) { if (pSD->pWS[iwsx].id == pSD->pActiveWS->id) { iwsx++; break; } } /* check bounds and wrap */ if (iwsx >= pSD->numWorkspaces) iwsx = 0; ChangeToWorkspace (&pSD->pWS[iwsx]); return (False); } /* END OF FUNCTION F_Next_Workspace */ /*************************************<->************************************* * * F_Prev_Workspace (args, pCD, event) * * * Description: * ----------- * This function switches to the previous workspace in the list * *************************************<->***********************************/ Boolean F_Prev_Workspace (String args, ClientData *pCD, XEvent *event) { WmScreenData *pSD = ACTIVE_PSD; int iwsx; for (iwsx = 0; iwsx < pSD->numWorkspaces; iwsx++) { if (pSD->pWS[iwsx].id == pSD->pActiveWS->id) { iwsx--; break; } } /* check bounds and wrap */ if (iwsx < 0) iwsx = pSD->numWorkspaces - 1; ChangeToWorkspace (&pSD->pWS[iwsx]); return (False); } /* END OF FUNCTION F_Prev_Workspace */ /*************************************<->************************************* * * F_Workspace_Presence (args, pCD, event) * * * Description: * ----------- * This function pops up the workspace presence dialog box * *************************************<->***********************************/ Boolean F_Workspace_Presence (String args, ClientData *pCD, XEvent *event) { Context wsContext = (Context)NULL; if (pCD && (pCD->dtwmFunctions & DtWM_FUNCTION_OCCUPY_WS)) { if (pCD->clientState == NORMAL_STATE) { wsContext = F_CONTEXT_NORMAL; } else if (pCD->clientState == MAXIMIZED_STATE) { wsContext = F_CONTEXT_MAXIMIZE; } else { wsContext = F_CONTEXT_ICON; /* return (False); */ } ShowPresenceBox (pCD, wsContext); } return (False); } /* END OF FUNCTION F_Workspace_Presence */ #ifdef DEBUG void DumpWindowList () { WmScreenData *pSD = (ACTIVE_WS)->pSD; ClientListEntry *pCLE; fprintf (stdout, "Window stacking (bottom to top)\n"); pCLE = pSD->lastClient; while (pCLE) { if (ClientInWorkspace (ACTIVE_WS, pCLE->pCD)) fprintf (stdout, "* "); else fprintf (stdout, " "); fprintf (stdout, "%08lx\t%s\n", pCLE->pCD->client, pCLE->pCD->clientName); pCLE = pCLE->prevSibling; } } #endif /* DEBUG */ #endif /* WSM */ motif-2.3.8/clients/mwm/WmResCvt.h0000644000175000017500000000444113145162623013715 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void AddWmResourceConverters (void); #ifdef WSM extern void WmCvtStringToAMBehavior (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); #endif /* WSM */ extern void WmCvtStringToCFocus (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToCDecor (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToCFunc (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToFrameStyle (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToIDecor (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToIPlace (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToKFocus (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToSize (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToShowFeedback (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern void WmCvtStringToUsePPosition (XrmValue *args, Cardinal numArgs, XrmValue *fromVal, XrmValue *toVal); extern unsigned char *NextToken (unsigned char *pchIn, int *pLen, unsigned char **ppchNext); extern Boolean StringsAreEqual (unsigned char *pch1, unsigned char *pch2, int len); motif-2.3.8/clients/mwm/WmKeyFocus.h0000644000175000017500000000422713145162623014241 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void AutoResetKeyFocus (ClientData *pcdNoFocus, Time focusTime); extern void ClearFocusIndication (ClientData *pCD, Boolean refresh); extern Boolean CheckForKeyFocus (ClientListEntry *pNextEntry, unsigned long type, Boolean focusNext, Time focusTime); extern void DoExplicitSelectGrab (Window window); extern ClientData *FindLastTransientTreeFocus (ClientData *pCD, ClientData *pcdNoFocus); extern ClientData *FindNextTFocusInSeq (ClientData *pCD, unsigned long startAt); extern ClientData *FindPrevTFocusInSeq (ClientData *pCD, unsigned long startAt); extern Boolean FocusNextTransient (ClientData *pCD, unsigned long type, Boolean initiate, Time focusTime); extern Boolean FocusNextWindow (unsigned long type, Time focusTime); extern Boolean FocusPrevTransient (ClientData *pCD, unsigned long type, Boolean initiate, Time focusTime); extern Boolean FocusPrevWindow (unsigned long type, Time focusTime); extern ClientData *GetClientUnderPointer (Boolean *pSameScreen); extern void InitKeyboardFocus (void); extern void RepairFocus (void); extern void ResetExplicitSelectHandling (ClientData *pCD); extern void SetFocusIndication (ClientData *pCD); extern void SetKeyboardFocus (ClientData *pCD, long focusFlags); motif-2.3.8/clients/mwm/WmWinState.h0000644000175000017500000000302613145162623014243 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.1 */ extern void SetClientState (ClientData *pCD, int newState, Time setTime); extern void SetClientStateWithEventMask (ClientData *pCD, int newState, Time setTime, unsigned int event_mask); extern void ConfigureNewState (ClientData *pcd); extern void SetClientWMState (ClientData *pCD, int wmState, int mwmState); extern void MapClientWindows (ClientData *pCD); extern void ShowIconForMinimizedClient (WmWorkspaceData *pWS, ClientData *pCD); #ifdef WSM extern void ShowAllIconsForMinimizedClient (ClientData *pCD); #endif /* WSM */ #ifdef PANELIST extern void SlideSubpanelBackIn (ClientData *pCD, Widget wSubpanel); #endif /* PANELIST */ motif-2.3.8/clients/mwm/WmWinList.h0000644000175000017500000000730213145162623014077 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ extern void AddClientToList (WmWorkspaceData *pWS, ClientData *pCD, Boolean onTop); extern void AddEntryToList (WmWorkspaceData *pWS, ClientListEntry *pEntry, Boolean onTop, ClientListEntry *pStackEntry); extern void AddTransient (WmWorkspaceData *pWS, ClientData *pCD); #ifdef WSM extern Boolean BumpPrimaryToBottom (ClientData *pcdLeader); extern Boolean BumpPrimaryToTop (ClientData *pcdLeader); #endif /* WSM */ extern Boolean CheckIfClientObscuredByAny (ClientData *pcd); extern Boolean CheckIfClientObscuring (ClientData *pcdTop, ClientData *pcd); extern Boolean CheckIfClientObscuringAny (ClientData *pcd); extern Boolean CheckIfObscuring (ClientData *pcdA, ClientData *pcdB); extern int CountTransientChildren (ClientData *pcd); extern void DeleteClientFromList (WmWorkspaceData *pWS, ClientData *pCD); extern void DeleteEntryFromList (WmWorkspaceData *pWS, ClientListEntry *pListEntry); extern void DeleteFullAppModalChildren (ClientData *pcdLeader, ClientData *pCD); extern void DeleteTransient (ClientData *pCD); extern ClientListEntry *FindClientNameMatch (ClientListEntry *pEntry, Boolean toNext, String clientName, unsigned long types); #ifdef WSM extern ClientData *FindSubLeaderToTop (ClientData *pcd); #endif /* WSM */ extern ClientData *FindTransientFocus (ClientData *pcd); extern ClientData *FindTransientOnTop (ClientData *pcd); extern ClientData *FindTransientTreeLeader (ClientData *pcd); extern void FixupFullAppModalCounts (ClientData *pcdLeader, ClientData *pcdDelete); #ifdef WSM extern Boolean LeaderOnTop (ClientData *pcdLeader); extern Window LowestWindowInTransientFamily (ClientData *pcdLeader); extern void MakeTransientFamilyStackingList (Window *windows, ClientData *pcdLeader); #endif /* WSM */ extern Window *MakeTransientWindowList (Window *windows, ClientData *pcd); extern void MarkModalSubtree (ClientData *pcdTree, ClientData *pcdAvoid); extern void MarkModalTransient (ClientData *pcdLeader, ClientData *pCD); extern void MoveEntryInList (WmWorkspaceData *pWS, ClientListEntry *pEntry, Boolean onTop, ClientListEntry *pStackEntry); #ifdef WSM extern Boolean NormalizeTransientTreeStacking (ClientData *pcdLeader); #endif /* WSM */ extern Boolean PutTransientBelowSiblings (ClientData *pcd); extern Boolean PutTransientOnTop (ClientData *pcd); extern void RestackTransients (ClientData *pcd); extern void RestackTransientsAtWindow (ClientData *pcd); extern void SetupSystemModalState (ClientData *pCD); extern void StackTransientWindow (ClientData *pcd); extern void StackWindow (WmWorkspaceData *pWS, ClientListEntry *pEntry, Boolean onTop, ClientListEntry *pStackEntry); extern void UnMarkModalTransient (ClientData *pcdModee, int modalCount, ClientData *pcdModal); extern void UndoSystemModalState (void); motif-2.3.8/clients/mwm/WmIBitmap.h0000644000175000017500000003345413145162623014042 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ /* * Global Variables And Definitions: */ #ifdef MWM_NEED_IIMAGE #ifdef MOTIF_DEFAULT_ICON /* * Default icon image with four buttons: */ #define iImage_width 50 #define iImage_height 50 static unsigned char iImage_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0xe0, 0xff, 0x3f, 0xe0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x7f, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0xe0, 0xff, 0x3f, 0xe0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x7f, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #else /* * Default icon image with X logo: */ #define iImage_width 50 #define iImage_height 50 static unsigned char iImage_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0xe0, 0xff, 0xdf, 0x40, 0x55, 0xd5, 0x00, 0xe0, 0xff, 0xdf, 0xa0, 0xaa, 0xca, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0xe0, 0xff, 0x3f, 0xe0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x7f, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xc0, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x40, 0x55, 0xd5, 0xe0, 0xff, 0xdf, 0x00, 0xa0, 0xaa, 0xca, 0xe0, 0xff, 0xdf, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0xe0, 0xff, 0x3f, 0xe0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x7f, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #endif /* MOTIF_DEFAULT_ICON */ #endif /* MWM_NEED_IIMAGE */ #ifdef MWM_NEED_ICONBOX #define iconBox_width 50 #define iconBox_height 50 static unsigned char iconBox_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0xf9, 0xe3, 0x8f, 0x3f, 0xfe, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0xd1, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0xd1, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0xd1, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0xd1, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0xd1, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0xd1, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0xd1, 0x02, 0xf1, 0xc7, 0x1f, 0x7f, 0xfc, 0xd0, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0xf9, 0xe3, 0x8f, 0x3f, 0xfe, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0x11, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0x11, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0x11, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0x11, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0x11, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0x11, 0x02, 0x09, 0x24, 0x90, 0x40, 0x02, 0x11, 0x02, 0xf1, 0xc7, 0x1f, 0x7f, 0xfc, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0xf9, 0xe3, 0x8f, 0x3f, 0x00, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x00, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x00, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x00, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x00, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x00, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x00, 0x10, 0x02, 0x09, 0x24, 0x90, 0x40, 0x00, 0x10, 0x02, 0xf1, 0xc7, 0x1f, 0x7f, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x09, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0xcf, 0xff, 0xff, 0x01, 0x00, 0x1e, 0x02, 0xcf, 0xff, 0xff, 0x01, 0x00, 0x1e, 0x02, 0x09, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03}; #endif /* MWM_NEED_ICONBOX */ /* * Used to create the stipple for greyed icons */ #ifdef MWM_NEED_GREYED75 #define greyed75_width 16 #define greyed75_height 16 static unsigned char greyed75_bits[] = { 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb}; #endif /* MWM_NEED_GREYED75 */ /* * Used to create the stipple for greyed icons */ #ifdef MWM_NEED_GREYED50 #define greyed50_width 16 #define greyed50_height 16 static unsigned char greyed50_bits[] = { 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa}; #endif /* MWM_NEED_GREYED50 */ /* * Used to create the stipple for greyed icons */ #ifdef MWM_NEED_GREYED25 #define greyed25_width 16 #define greyed25_height 16 static unsigned char greyed25_bits[] = { 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44}; #endif /* MWM_NEED_GREYED25 */ /* * Used to create the stipple for greyed icons */ #ifdef MWM_NEED_SLANT2 #define slant2_width 16 #define slant2_height 16 static unsigned char slant2_bits[] = { 0x99, 0x99, 0xcc, 0xcc, 0x66, 0x66, 0x33, 0x33, 0x99, 0x99, 0xcc, 0xcc, 0x66, 0x66, 0x33, 0x33, 0x99, 0x99, 0xcc, 0xcc, 0x66, 0x66, 0x33, 0x33, 0x99, 0x99, 0xcc, 0xcc, 0x66, 0x66, 0x33, 0x33}; #endif /* MWM_NEED_SLANT2 */ #ifdef PANELIST #ifdef DTWM_NEED_FNTPL #define fntpl_i_bm_width 50 #define fntpl_i_bm_height 50 #define fntpl_i_bm_x_hot 0 #define fntpl_i_bm_y_hot 0 static unsigned char fntpl_i_bm_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0xda, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x00, 0xd4, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x01, 0xda, 0xf1, 0xe4, 0x75, 0x00, 0x83, 0x00, 0xd4, 0xe4, 0xe6, 0x64, 0x00, 0x43, 0x01, 0xda, 0xe4, 0xee, 0xfd, 0xff, 0xa7, 0x00, 0xd4, 0xe6, 0xff, 0xf7, 0xff, 0x57, 0x01, 0xda, 0xe0, 0xff, 0x64, 0x00, 0xa3, 0x00, 0xd4, 0xf1, 0xe0, 0x75, 0x00, 0x53, 0x01, 0xda, 0xff, 0xff, 0xff, 0xff, 0xa9, 0x00, 0xd4, 0xff, 0xff, 0xff, 0xff, 0x55, 0x01, 0x1a, 0x00, 0x00, 0x00, 0x80, 0xa8, 0x00, 0xd4, 0xfb, 0xe1, 0xe1, 0x4f, 0x54, 0x01, 0x5a, 0x02, 0xa0, 0x20, 0x49, 0xaa, 0x00, 0xd4, 0xfb, 0xe1, 0xe1, 0x2f, 0x55, 0x01, 0x1a, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x00, 0xf4, 0xff, 0xff, 0xff, 0x3f, 0x55, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x54, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #endif /* DTWM_NEED_FNTPL */ #endif /* PANELIST */ #ifdef WSM /* * Backdrop bitmap patterns */ #ifdef DTWM_NEED_BACKBITS #define bits0_width 8 #define bits0_height 8 static unsigned char bits0_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #define bits1_width 8 #define bits1_height 8 static unsigned char bits1_bits[] = { 0x11, 0x00, 0x44, 0x00, 0x11, 0x00, 0x44, 0x00}; #define bits2_width 8 #define bits2_height 8 static unsigned char bits2_bits[] = { 0x55, 0x00, 0x55, 0x00, 0x55, 0x00, 0x55, 0x00}; #define bits3_width 8 #define bits3_height 8 static unsigned char bits3_bits[] = { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa}; #define bits4_width 8 #define bits4_height 8 static unsigned char bits4_bits[] = { 0xff, 0xaa, 0xff, 0xaa, 0xff, 0xaa, 0xff, 0xaa}; #define bits5_width 8 #define bits5_height 8 static unsigned char bits5_bits[] = { 0xff, 0xbb, 0xff, 0xee, 0xff, 0xbb, 0xff, 0xee}; #define bits6_width 8 #define bits6_height 8 static unsigned char bits6_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #endif /* DTWM_NEED_BACKBITS */ #endif /* WSM */ #ifdef PANELIST /* * * Used to define the small hourglass and mask used to indicate * a front panel wait state. * */ #ifdef DTWM_NEED_TIME16 #define time16_x_hot 7 #define time16_y_hot 7 #define time16_width 14 #define time16_height 15 static unsigned char time16_bits[] = { 0x00, 0x00, 0xfe, 0x1f, 0xfe, 0x1f, 0x04, 0x0c, 0x54, 0x0d, 0xac, 0x0e, 0x58, 0x07, 0xb0, 0x03, 0x50, 0x03, 0x08, 0x06, 0x44, 0x0c, 0xa4, 0x0c, 0x54, 0x0d, 0xfe, 0x1f, 0xfe, 0x1f}; #define time16m_width 14 #define time16m_height 15 static unsigned char time16m_bits[] = { 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0x06, 0x1c, 0xfe, 0x1f, 0xfe, 0x1f, 0xfc, 0x0f, 0xf8, 0x07, 0x5c, 0x07, 0x0e, 0x0e, 0x66, 0x0c, 0xf6, 0x1c, 0xfe, 0x1f, 0xff, 0x3f, 0xff, 0x3f}; #endif /* DTWM_NEED_TIME16 */ #endif /* PANELIST */ #ifdef WSM /**************************** eof ***************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/WmWinInfo.c0000644000175000017500000031212113145162623014050 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmWinInfo.c /main/18 1999/02/04 15:17:25 mgreess $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmICCC.h" #include "WmResNames.h" #define MWM_NEED_ICONBOX #include "WmIBitmap.h" #include #include #ifdef PANELIST #include "WmPanelP.h" #endif /* PANELIST */ #define makemult(a, b) ((b==1) ? (a) : (((int)((a) / (b))) * (b)) ) /* * include extern functions */ #include "WmWinInfo.h" #include "WmCDInfo.h" #include "WmCDecor.h" #include "WmCPlace.h" #include "WmError.h" #include "WmIDecor.h" #include "WmIPlace.h" #include "WmIconBox.h" #include "WmImage.h" #include "WmManage.h" #include "WmMenu.h" #include "WmProperty.h" #include "WmResource.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ #include "WmWinList.h" #ifdef WSM #include "WmPresence.h" #endif /* WSM */ #include "WmXSMP.h" #ifdef PANELIST static void AdjustSlideOutGeometry (ClientData *pCD); static void FixSubpanelEmbeddedClientGeometry (ClientData *pCD); #endif /* PANELIST */ #ifndef NO_MESSAGE_CATALOG # define LOCALE_MSG GETMESSAGE(70, 7, "[XmbTextPropertyToTextList]:\n Locale (%.100s) not supported. (Check $LANG).") #else # define LOCALE_MSG "[XmbTextPropertyToTextList]:\n Locale (%.100s) not supported. (Check $LANG)." #endif /* * Global Variables: */ #ifdef WSM WmWorkspaceData *pIconBoxInitialWS; #endif /* WSM */ /*************************************<->************************************* * * GetClientInfo (pSD, clientWindow, manageFlags) * * * Description: * ----------- * This function is used to initialize client window data based on the * contents of client window properties and the client window configuration. * * * Inputs: * ------ * pSD = pointer to screen data for screen that client lives in * * clientWindow = window id for the client window that is to be managed * * manageFlags = flags that indicate wm state info * * * Outputs: * ------- * Return = pointer to an initialized client data structure for the * specified client window * *************************************<->***********************************/ ClientData * GetClientInfo (WmScreenData *pSD, Window clientWindow, long manageFlags) { ClientData *pCD; XSetWindowAttributes sAttributes; /* * Allocate and initialize a client data structure: */ if (!(pCD = (ClientData *)XtMalloc (sizeof (ClientData)))) { /* unable to allocate space */ Warning (((char *)GETMESSAGE(70, 1, "Insufficient memory for client data"))); return (NULL); } /* * Initialize the data structure: */ pCD->client = clientWindow; pCD->clientID = ++(pSD->clientCounter); pCD->clientFlags = WM_INITIALIZATION; pCD->iconFlags = 0; #ifndef WSM pCD->pIconBox = NULL; #endif /* WSM */ pCD->thisIconBox = NULL; #ifdef PANELIST pCD->pECD = NULL; pCD->pPRCD = NULL; pCD->pSOR = NULL; #endif /* PANELIST */ pCD->wmUnmapCount = 0; pCD->transientFor = (Window)0L; pCD->transientLeader = NULL; pCD->transientChildren = NULL; pCD->transientSiblings = NULL; #ifdef WSM pCD->primaryStackPosition = 0; #endif /* WSM */ pCD->fullModalCount = 0; pCD->primaryModalCount = 0; pCD->focusPriority = 0; pCD->focusAutoRaiseDisabled = False; pCD->focusAutoRaiseDisablePending = False; pCD->clientClass = NULL; pCD->clientName = NULL; pCD->clientFrameWin = (Window)0L; #ifndef WSM pCD->iconFrameWin = (Window)0L; #endif /* WSM */ pCD->iconWindow = (Window)0L; pCD->iconPixmap = (Pixmap)0L; #ifndef WSM pCD->iconPlace = NO_ICON_PLACE; #endif /* WSM */ pCD->clientProtocols = NULL; pCD->clientProtocolCount = 0; pCD->mwmMessages = NULL; pCD->mwmMessagesCount = 0; pCD->clientCmapCount = 0; pCD->clientCmapIndex = 0; pCD->clientCmapFlagsInitialized = FALSE; pCD->systemMenuSpec = NULL; #ifdef WSM pCD->putInAll = False; pCD->pWorkspaceHints = NULL; pCD->numInhabited = 0; pCD->pWsList = NULL; pCD->dtwmFunctions = DtWM_FUNCTION_OCCUPY_WS; pCD->dtwmBehaviors = 0L; pCD->paInitialProperties = NULL; pCD->numInitialProperties = 0; #endif /* WSM */ pCD->decorFlags = 0L; pCD->pTitleGadgets = NULL; pCD->cTitleGadgets = 0; pCD->pResizeGadgets = NULL; pCD->clientTitleWin = (Window)0L; pCD->pclientTopShadows = NULL; pCD->pclientBottomShadows = NULL; pCD->pclientTitleTopShadows = NULL; pCD->pclientTitleBottomShadows = NULL; pCD->pclientMatteTopShadows = NULL; pCD->pclientMatteBottomShadows = NULL; pCD->piconTopShadows = NULL; pCD->piconBottomShadows = NULL; pCD->internalBevel = (wmGD.frameStyle == WmSLAB) ? 0 : FRAME_INTERNAL_SHADOW_WIDTH; #ifndef NO_OL_COMPAT pCD->bPseudoTransient = False; #endif /* NO_OL_COMPAT */ pCD->maxWidth = pCD->maxWidthLimit = BIGSIZE; pCD->maxHeight = pCD->maxHeightLimit = BIGSIZE; pCD->maxConfig = FALSE; pCD->pSD = pSD; pCD->dataType = CLIENT_DATA_TYPE; pCD->window_status = 0L; pCD->clientEntry.nextSibling = NULL; pCD->clientEntry.prevSibling = NULL; pCD->clientEntry.pCD = NULL; pCD->smClientID = (String)NULL; /* * Do special processing for client windows that are controlled by * the window manager. */ if (manageFlags & MANAGEW_WM_CLIENTS) { #ifdef WSM WmWorkspaceData *pWS; if (manageFlags & MANAGEW_ICON_BOX) { pWS = pIconBoxInitialWS; } else { pWS = pSD->pActiveWS; } return (GetWmClientInfo (pWS, pCD, manageFlags)); #else /* WSM */ return (GetWmClientInfo (pSD->pActiveWS, pCD, manageFlags)); #endif /* WSM */ } /* * Register the client window to facilitate event handling: */ XSaveContext (DISPLAY, clientWindow, wmGD.windowContextType, (caddr_t)pCD); /* * Listen for property change events on the window so that we keep * in sync with the hints. */ sAttributes.event_mask = (PropertyChangeMask | ColormapChangeMask); XChangeWindowAttributes (DISPLAY, pCD->client, CWEventMask, &sAttributes); /* * Get window configuration attributes. WmGetWindowAttributes sets * up the global window attributes cache with the client window * attributes. */ if (!WmGetWindowAttributes (clientWindow)) { /* * Cannot get window attributes. Do not manage window. * (error message within WmGetWindowAttributes) */ UnManageWindow (pCD); return (NULL); } pCD->xBorderWidth = wmGD.windowAttributes.border_width; #ifdef WSM /* * Get the initial list of properties on this window. * Save it to optimize subsequent property fetching. */ GetInitialPropertyList (pCD); #endif /* WSM */ /* * Retrieve and process WM_CLASS hints client window property info: */ ProcessWmClass (pCD); /* * Retrieve and process WM_TRANSIENT_FOR client window property info: */ ProcessWmTransientFor (pCD); /* * Get client window resource data (from resources, .mwmrc): * Moved prior to GetClientWorkspaceInfo() because the * ignoreWMSaveHints resource may affect that function. */ ProcessClientResources (pCD); /* * Retreive and process SM_CLIENT_ID client window property info * and WMSAVE_HINT client window property info: * must be done prior to calling GetClientWorkspaceInfo(). */ ProcessSmClientID (pCD); ProcessWmSaveHint (pCD); #ifdef WSM /* * Set client's workspace information. NOTE: this also may * set the geometry, initial state, etc. For Sm-aware clients, * this info will be in private DB; for older clients, it will * be contained in the screen's pDtSessionItems. */ if (!GetClientWorkspaceInfo (pCD, manageFlags)) { XtFree ((char *)pCD); return (NULL); } /* * Restore client's per-workspace icon information. */ LoadClientIconPositions(pCD); /* * Retrieve and process _DT_WM_HINTS client window property * (results are used in ProcessMwmHints) */ ProcessDtWmHints (pCD); #else /* * For Sm-aware clients, retrieve geometry and initial state * from private DB. */ FindClientDBMatch(pCD, (char **)NULL); #endif /* WSM */ /* * Retrieve and process M_CLIENT_DECOR client window property info: */ ProcessMwmHints (pCD); /* * Retrieve and process WM_HINTS client window property info: */ ProcessWmHints (pCD, True /*first time*/); /* * Set offset from frame of client window */ SetClientOffset (pCD); /* * Retrieve and process WM_NORMAL_HINTS client window property info: * */ ProcessWmNormalHints (pCD, True /*first time*/, manageFlags); /* * Retrieve and process WM_NAME client window property info (this * property contains the window title NOT the window resource name): */ ProcessWmWindowTitle (pCD, TRUE); /* * Retrieve and process WM_ICON_NAME client window property info: */ ProcessWmIconTitle (pCD, TRUE); /* * Retrieve and process the WM_PROTOCOLS property. */ ProcessWmProtocols (pCD); /* * If necessary retrieve and process the _MWM_MESSAGES property. */ if (pCD->protocolFlags & PROTOCOL_MWM_MESSAGES) { ProcessMwmMessages (pCD); } /* * Make or find a system menu for the client. */ if (pCD->systemMenu) { MakeSystemMenu (pCD); } else { pCD->systemMenuSpec = NULL; } /* * Setup the colormap data for the client window. This includes * retrieving and processing client window properties that deal with * subwindow colormaps. */ InitCColormapData (pCD); /* successful return */ return (pCD); } /* END OF FUNCTION GetClientInfo */ /*************************************<->************************************* * * GetWmClientInfo (pWS, pCD, manageFlags) * * * Description: * ----------- * This function is used to initialize client window data for a window * that is controlled by the window manager (e.g., the icon box). The * client window may get made in the process. * * * Inputs: * ------ * pWS = pointer to workspace data * * pCD = pointer to client window data structure * * manageFlags = flags that indicate wm state info * * * Outputs: * ------- * Return = pointer to an initialized client data structure or NULL * if the client data could not be initialized * *************************************<->***********************************/ ClientData * GetWmClientInfo (WmWorkspaceData *pWS, ClientData * pCD, long manageFlags) { Pixmap iconBitmap; #ifdef WSM int i; #endif /* WSM */ /* * Set up the client class and name for resource retrieval. * Get client specific resource data (from resources, .mwmrc). */ if (manageFlags & MANAGEW_ICON_BOX) { SetIconBoxInfo (pWS, pCD); } else if (manageFlags & MANAGEW_CONFIRM_BOX) { pCD->clientClass = WmCConfirmbox; pCD->clientName = WmNconfirmbox; pCD->iconImage = NULL; pCD->useClientIcon = False; pCD->focusAutoRaise = True; pCD->internalBevel = (wmGD.frameStyle == WmSLAB) ? 0 : FRAME_INTERNAL_SHADOW_WIDTH; pCD->matteWidth = 0; pCD->maximumClientSize.width = 0; pCD->maximumClientSize.height = 0; pCD->systemMenu = NULL; } /* * Set up transient for data. */ if (manageFlags & MANAGEW_ICON_BOX) { } /* * Set up WM_HINTS type information. */ pCD->inputFocusModel = True; pCD->clientState = NORMAL_STATE; if (ICON_DECORATION(pCD) & ICON_IMAGE_PART) { if (manageFlags & MANAGEW_ICON_BOX) { pCD->clientFlags |= ICON_BOX; } if (!pCD->useClientIcon && pCD->iconImage) { /* * Make a client supplied icon image. * Do not use the default icon image if iconImage is not found. */ pCD->iconPixmap = MakeNamedIconPixmap (pCD, pCD->iconImage); } if (!pCD->iconPixmap) { /* * Use a built-in icon image for the window manager client. * The image may differ from the default icon image, depending on * the particular client (eg the iconbox). */ if (manageFlags & MANAGEW_ICON_BOX) { /* * Make a default iconBox icon image. */ iconBitmap = XCreateBitmapFromData (DISPLAY, ROOT_FOR_CLIENT(pCD), (char *)iconBox_bits, iconBox_width, iconBox_height); pCD->iconPixmap = MakeIconPixmap (pCD, iconBitmap, (Pixmap)0L, iconBox_width, iconBox_height, 1); } } } #ifdef WSM /* * Allocate initial workspace ID list * fill with NULL IDs */ if ((pCD->pWsList = (WsClientData *) XtMalloc(pCD->pSD->numWorkspaces * sizeof(WsClientData))) == NULL) { Warning (((char *)GETMESSAGE(70, 2, "Insufficient memory for client data"))); return (NULL); } pCD->sizeWsList = pCD->pSD->numWorkspaces; for (i = 0; i < pCD->pSD->numWorkspaces; i++) { pCD->pWsList[i].wsID = NULL; pCD->pWsList[i].iconPlace = NO_ICON_PLACE; pCD->pWsList[i].iconX = 0; pCD->pWsList[i].iconY = 0; pCD->pWsList[i].iconFrameWin = (Window)0L; pCD->pWsList[i].pIconBox = NULL; } /* * Internally managed clients must be specifically inserted * into workspaces the first time by calling * PutClientIntoWorkspace. */ pCD->numInhabited = 0; #else /* WSM */ pCD->iconPlace = NO_ICON_PLACE; pCD->iconX = 0; pCD->iconY = 0; #endif /* WSM */ pCD->windowGroup = 0L; #ifndef NO_OL_COMPAT pCD->bPseudoTransient = False; #endif /* NO_OL_COMPAT */ /* * Set up _MWM_HINTS data. */ /* * Fix the client functions and decorations fields if they have * default resource values. */ if (manageFlags & MANAGEW_CONFIRM_BOX) { pCD->clientFunctions = WM_FUNC_NONE; pCD->clientDecoration = WM_DECOR_BORDER; } else { if (pCD->clientFunctions & WM_FUNC_DEFAULT) { pCD->clientFunctions = WM_FUNC_ALL; } if (pCD->clientDecoration & WM_DECOR_DEFAULT) { pCD->clientDecoration = WM_DECOR_ALL; } if (manageFlags & MANAGEW_ICON_BOX) { pCD->clientFunctions &= ICON_BOX_FUNCTIONS; #ifdef WSM pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; #endif /* WSM */ #ifdef PANELIST if (wmGD.useFrontPanel && pCD->pSD->iconBoxControl) { /* * If there's a front panel button for the icon * box, then use it to "hide" the box on "close" */ pCD->clientFunctions &= ~MWM_FUNC_MINIMIZE; pCD->clientFunctions |= MWM_FUNC_CLOSE; } #else /* PANELIST */ #endif /* PANELIST */ } if (!(pCD->clientFunctions & MWM_FUNC_RESIZE)) { pCD->clientDecoration &= ~MWM_DECOR_RESIZEH; } if (!(pCD->clientFunctions & MWM_FUNC_MINIMIZE)) { pCD->clientDecoration &= ~MWM_DECOR_MINIMIZE; } if (!(pCD->clientFunctions & MWM_FUNC_MAXIMIZE)) { pCD->clientDecoration &= ~MWM_DECOR_MAXIMIZE; } } pCD->decor = pCD->clientDecoration; if (manageFlags & MANAGEW_ICON_BOX) { pCD->inputMode = MWM_INPUT_MODELESS; } else if (manageFlags & MANAGEW_CONFIRM_BOX) { pCD->inputMode = MWM_INPUT_SYSTEM_MODAL; } /* * Set up WM_NORMAL_HINTS data. */ pCD->icccVersion = ICCC_CURRENT; pCD->sizeFlags = US_POSITION | US_SIZE; /* * Any calls to create Window Manager clients should * return with the values for the following fields set. * If it fails, it should free any space allocated and * set pCD = NULL * * pCD->clientX = * pCD->clientY = * pCD->clientWidth = * pCD->clientHeight = * pCD->minWidth = * pCD->minHeight = * pCD->widthInc = * pCD->heightInc = * pCD->baseWidth = * pCD->baseHeight = * pCD->maxWidth = * pCD->maxHeight = * pCD->oldMaxWidth = * pCD->oldMaxHeight = * * AND PROBABLY SHOULD SET * pCD->client = THE_WINDOW_THE_FUNCTION_CREATES */ pCD->windowGravity = NorthWestGravity; /* * Create IconBox window */ if (manageFlags & MANAGEW_ICON_BOX) { if (!MakeIconBox (pWS, pCD)) { /* * May want a more verbose message here */ Warning (((char *)GETMESSAGE(70, 3, "Couldn't make icon box"))); return (NULL); } #ifdef WSM PutClientIntoWorkspace (pWS, pCD); #endif /* WSM */ } else if (manageFlags & MANAGEW_CONFIRM_BOX) { Window root; unsigned int cbWidth, cbHeight; unsigned int depth; XGetGeometry (DISPLAY, pCD->client, &root, &(pCD->clientX), &(pCD->clientY), &cbWidth, &cbHeight, (unsigned int*)&(pCD->xBorderWidth), &depth); pCD->clientWidth = cbWidth; pCD->clientHeight = cbHeight; pCD->minWidth = pCD->baseWidth = pCD->maxWidth = pCD->clientWidth; pCD->minHeight = pCD->baseHeight = pCD->maxHeight = pCD->clientHeight; pCD->oldMaxWidth = pCD->maxWidth; pCD->oldMaxHeight = pCD->maxHeight; pCD->widthInc = 1; pCD->heightInc = 1; pCD->clientFlags |= CONFIRM_BOX; #ifdef WSM PutClientIntoWorkspace (ACTIVE_WS, pCD); #endif /* WSM */ } /* * Set offset from frame of client window (need client size information). */ SetFrameInfo (pCD); /* * Register the client window to facilitate event handling. */ XSaveContext (DISPLAY, pCD->client, wmGD.windowContextType, (caddr_t)pCD); /* * Set up WM_PROTOCOLS data. */ pCD->clientProtocolCount = 0; pCD->protocolFlags = 0; /* * Make the system menu. */ if (manageFlags & MANAGEW_ICON_BOX) { #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /** BEGIN FIX CR 6941 **/ MenuItem *iconBoxMenuItems, *lastItem; /* This MenuSpec is not added to pSD->acceleratorMenuSpecs */ pCD->systemMenuSpec = MAKE_MENU (PSD_FOR_CLIENT(pCD), pCD, pCD->systemMenu, F_CONTEXT_WINDOW, F_CONTEXT_WINDOW|F_CONTEXT_ICON, NULL, TRUE); if (pCD->systemMenuSpec != (MenuSpec *) NULL) { pCD->systemMenuSpec = DuplicateMenuSpec(pCD->systemMenuSpec); XtFree(pCD->systemMenuSpec->name); pCD->systemMenuSpec->name = XtNewString("IconBoxMenu"); iconBoxMenuItems = GetIconBoxMenuItems (PSD_FOR_CLIENT(pCD)); /* Find the last menu item in the menu spec's list. */ for (lastItem = pCD->systemMenuSpec->menuItems; lastItem->nextMenuItem != (MenuItem *) NULL; lastItem = lastItem->nextMenuItem) /*EMPTY*/; lastItem->nextMenuItem = iconBoxMenuItems; /* Now recreate the menu widgets since we've appended the icon box menu items */ DestroyMenuSpecWidgets(pCD->systemMenuSpec); pCD->systemMenuSpec->menuWidget = CreateMenuWidget (PSD_FOR_CLIENT(pCD), pCD, "IconBoxMenu", PSD_FOR_CLIENT(pCD)->screenTopLevelW, TRUE, pCD->systemMenuSpec, NULL); } /** END FIX CR 6941 **/ #else pCD->systemMenuSpec = MAKE_MENU (PSD_FOR_CLIENT(pCD), pCD, pCD->systemMenu, F_CONTEXT_WINDOW, F_CONTEXT_WINDOW|F_CONTEXT_ICON, GetIconBoxMenuItems(PSD_FOR_CLIENT(pCD)), TRUE); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ } /* * Setup the colormap data. */ pCD->clientColormap = PSD_FOR_CLIENT(pCD)->workspaceColormap; /* * Return the pointer to the client data. */ return (pCD); } /* END OF FUNCTION GetWmClientInfo */ /*************************************<->************************************* * * ProcessWmClass (pCD) * * * Description: * ----------- * This function retrieves the contents of the WM_CLASS property on the * cient window. The resource class and the resource name are saved in * the ClientData structure (note that the space for the strings is * allocated using Xmalloc). * * * Inputs: * ------ * pCD - pointer to client data * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void ProcessWmClass (ClientData *pCD) { XClassHint classHint; #ifdef PORT_OLDXLIB classHint.res_class = ""; classHint.res_name = ""; XGetClassHint (DISPLAY, pCD->client, &classHint); #else #ifdef WSM if ((HasProperty (pCD, XA_WM_CLASS)) && (XGetClassHint (DISPLAY, pCD->client, &classHint))) #else /* WSM */ if (XGetClassHint (DISPLAY, pCD->client, &classHint)) #endif /* WSM */ #endif { /* the WM_CLASS property exists for the client window */ pCD->clientClass = classHint.res_class; pCD->clientName = classHint.res_name; } /* else no WM_CLASS property; assume clientClass, clientName are NULL */ } /* END OF FUNCTION ProcessWmClass */ /*************************************<->************************************* * * ProcessSmClientID (pCD) * * * Description: * ----------- * This function retrieves the contents of the SM_CLIENT_ID property on the * cient window. The value is saved in the ClientData structure * (note that the space for the strings is allocated using Xmalloc). * * * Inputs: * ------ * pCD - pointer to client data * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void ProcessSmClientID (ClientData *pCD) { Atom actualType; int actualFormat; unsigned long nitems, leftover; char *clientID; if (pCD->smClientID != (String)NULL) { XFree(pCD->smClientID); pCD->smClientID = (String)NULL; } if ((XGetWindowProperty(DISPLAY, pCD->client, wmGD.xa_SM_CLIENT_ID, 0L, (long)1000000, False, AnyPropertyType, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&clientID) == Success) && (actualType != None) && (actualFormat == 8)) { /* the SM_CLIENT_ID property exists for the client window */ pCD->smClientID = clientID; } } /* END OF FUNCTION ProcessSmClientID */ /*************************************<->************************************* * * ProcessWmSaveHint (pCD) * * * Description: * ----------- * This function retrieves the contents of the WMSAVE_HINT property on the * cient window. The value is saved in the ClientData structure. * * * Inputs: * ------ * pCD - pointer to client data * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void ProcessWmSaveHint (ClientData *pCD) { Atom actualType; int actualFormat; unsigned long nitems, leftover; BITS32 *saveHintFlags = (BITS32 *)NULL; if ((XGetWindowProperty(DISPLAY, pCD->client, wmGD.xa_WMSAVE_HINT, 0L, (long)1000000, False, AnyPropertyType, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&saveHintFlags) == Success) && (actualType != None) && (actualFormat == 32)) { /* the WMSAVE_HINT property exists for the client window */ pCD->wmSaveHintFlags = (int)*saveHintFlags; } else pCD->wmSaveHintFlags = 0; if (saveHintFlags) XFree(saveHintFlags); } /* END OF FUNCTION ProcessWmSaveHint */ /*************************************<->************************************* * * ProcessWmHints (pCD, firstTime) * * * Description: * ----------- * This function retrieves the contents of the WM_HINTS property on the * cient window. * * * Inputs: * ------ * pCD = pointer to client data for the window with the property * * firstTime = if True this is the first time the property has been processed * * * Outputs: * ------- * pCD = initialize various WM_HINTS related fields * * * Comments: * -------- * *************************************<->***********************************/ void ProcessWmHints (ClientData *pCD, Boolean firstTime) { register XWMHints *pXWMHints; register long flags; Pixmap iconPixmap; Pixmap iconMask; #ifdef WSM WmWorkspaceData *pWsTmp; WsClientData *pWsc; int iws; #endif /* WSM */ int tmpIconX, tmpIconY; /* * If the WM_HINTS property does not exist the flags field will be * set to 0. If flags is 0 don't reference the WMHints structure * since they may be none. */ #ifdef WSM if (firstTime && !HasProperty (pCD, XA_WM_HINTS)) pXWMHints = NULL; else #endif /* WSM */ pXWMHints = XGetWMHints (DISPLAY, pCD->client); if (pXWMHints) { flags = pXWMHints->flags; } else { flags = 0; } /* * Parse the WM_HINTS information. If this is the first time the hints * have been processed then parse all fields and set defaults where hint * fields are not set. If this is not the first time do selective * parsing. */ if (firstTime) { #ifndef NO_OL_COMPAT ClientData *leader; Atom *pIDs; unsigned int numIDs = 0; /* * Save the window group. */ if (flags & WindowGroupHint) { pCD->windowGroup = pXWMHints->window_group; /* * Pretend this is a transient window */ if ((pCD->bPseudoTransient) && (pCD->transientFor == (Window)0L)) { pCD->clientFlags |= CLIENT_TRANSIENT; /* * Treat this like a transient window. This is transient * for the window group window. */ if ((pCD->client != pCD->windowGroup) && !XFindContext (DISPLAY, pCD->windowGroup, wmGD.windowContextType, (caddr_t *)&leader)) { pCD->transientFor = pCD->windowGroup; pCD->transientLeader = leader; /* * Insure it is in the same set of workspaces * as the leader. */ if (pCD->transientLeader && GetLeaderPresence(pCD, &pIDs, &numIDs)) { ProcessWorkspaceHintList (pCD, pIDs, numIDs); } } } } else { pCD->windowGroup = 0L; } #endif /* NO_OL_COMPAT */ /* * The window manger does not do anything with the input hint. Input * always goes to the selected window. */ if (flags & InputHint) { pCD->inputFocusModel = pXWMHints->input; } else { pCD->inputFocusModel = True; } /* * The default state is NORMAL_STATE. States other than iconic * (e.g., ZoomState from the R2 ICCC) indicate to the window manager * that the NORMAL_STATE is to be used. */ if (pCD->clientFlags & SM_CLIENT_STATE) { if ((pCD->clientState == MINIMIZED_STATE) && (!(pCD->clientFunctions & MWM_FUNC_MINIMIZE))) { pCD->clientState = NORMAL_STATE; } } else if ((flags & StateHint) && (pXWMHints->initial_state == IconicState) && (pCD->clientFunctions & MWM_FUNC_MINIMIZE)) { pCD->clientState = MINIMIZED_STATE; } else { /* * States other than iconic are treated as normal. */ pCD->clientState = NORMAL_STATE; } #ifdef WSM if (!ClientInWorkspace (PSD_FOR_CLIENT(pCD)->pActiveWS, pCD)) { pCD->clientState |= UNSEEN_STATE; } #endif /* WSM */ /* * If an icon is to be made for the client then ... * save the icon image if useClientIcon is True or there is no * user specified icon image. A client supplied image may be a * pixmap or a window (a client icon window takes precedence over * a pixmap). */ if ((pCD->clientFunctions & MWM_FUNC_MINIMIZE) && (pCD->transientLeader == NULL)) { if ((ICON_DECORATION(pCD) & ICON_IMAGE_PART) && (pCD->useClientIcon || !pCD->iconImage)) { if ((flags & IconWindowHint) && (pXWMHints->icon_window != pCD->client)) { /* * An icon window has been supplied that is different from * the client window. Check out the window and get it * ready to be reparented to the window manager supplied * icon frame. */ if (!SetupClientIconWindow (pCD, pXWMHints->icon_window)) { /* * Cannot use the client supplied icon window. Use * an icon image if specified or a default image. */ } } if (!pCD->iconWindow && (flags & IconPixmapHint)) { iconMask = (flags & IconMaskHint) ? pXWMHints->icon_mask : (Pixmap) NULL; /* * A client supplied icon window is NOT * available so use the client supplied icon image. */ if ((pCD->iconPixmap = MakeClientIconPixmap (pCD, pXWMHints->icon_pixmap, iconMask)) != None) { /* * Indicate that a client supplied icon image is being * used. */ pCD->iconFlags |= ICON_HINTS_PIXMAP; } else { /* * Cannot make a client supplied image. Use a user * specified icon image if it is available or a default * icon image. */ } } } if ((ICON_DECORATION(pCD) & ICON_IMAGE_PART) && !pCD->iconPixmap) { /* * Use a user supplied icon image if it is available or a * default icon image. */ if (pCD->iconImage) { /* * Try to make a user specified icon image. */ pCD->iconPixmap = MakeNamedIconPixmap (pCD, pCD->iconImage); } if (!pCD->iconPixmap) { /* * The icon image was not provided or not available. * Use the default icon image. */ pCD->iconPixmap = MakeNamedIconPixmap (pCD, NULL); } } /* * Save the client (user?) supplied icon position: */ if ((flags & IconPositionHint) || (pCD->clientFlags & (SM_ICON_X | SM_ICON_Y))) { pCD->iconFlags |= ICON_HINTS_POSITION; if (wmGD.iconAutoPlace) #ifdef WSM { /* * Initialize icon placement data in all inhabited * workspaces */ for (iws = 0; iws< pCD->numInhabited; iws++) { pWsc = &(pCD->pWsList[iws]); if (pWsTmp=GetWorkspaceData(pCD->pSD, pWsc->wsID)) { tmpIconX = (pCD->clientFlags & SM_ICON_X) ? pWsc->iconX : pXWMHints->icon_x; tmpIconY = (pCD->clientFlags & SM_ICON_Y) ? pWsc->iconY : pXWMHints->icon_y; pWsc->iconPlace = FindIconPlace (pCD, &(pWsTmp->IPData), tmpIconX, tmpIconY); if (pWsc->iconPlace != NO_ICON_PLACE) { CvtIconPlaceToPosition ( &(pWsTmp->IPData), pWsc->iconPlace, &pWsc->iconX, &pWsc->iconY); } } } } else { for (iws = 0; iws< pCD->numInhabited; iws++) { pWsc = &(pCD->pWsList[iws]); if (pWsTmp=GetWorkspaceData(pCD->pSD, pWsc->wsID)) { if (!(pCD->clientFlags & SM_ICON_X)) pWsc->iconX = pXWMHints->icon_x; if (!(pCD->clientFlags & SM_ICON_Y)) pWsc->iconY = pXWMHints->icon_y; } } } #else /* WSM */ { tmpIconX = (pCD->clientFlags & SM_ICON_X) ? pCD->iconX : pXWMHints->icon_x; tmpIconY = (pCD->clientFlags & SM_ICON_Y) ? pCD->iconY : pXWMHints->icon_y; pCD->iconPlace = FindIconPlace (pCD, &(pCD->pSD->pActiveWS->IPData), tmpIconX, tmpIconY); if (pCD->iconPlace != NO_ICON_PLACE) { CvtIconPlaceToPosition (&(pCD->pSD->pActiveWS->IPData), pCD->iconPlace, &pCD->iconX, &pCD->iconY); } } else { if (!(pCD->clientFlags & SM_ICON_X)) pCD->iconX = pXWMHints->icon_x; if (!(pCD->clientFlags & SM_ICON_Y)) pCD->iconY = pXWMHints->icon_y; } #endif /* WSM */ } else { if (wmGD.iconAutoPlace) { #ifdef WSM /* * Initialize icon placement data in all inhabited * workspaces */ for (iws = 0; iws< pCD->numInhabited; iws++) { pWsc = &(pCD->pWsList[iws]); pWsc->iconPlace = NO_ICON_PLACE; pWsc->iconX = 0; pWsc->iconY = 0; } #else /* WSM */ pCD->iconPlace = NO_ICON_PLACE; pCD->iconX = 0; pCD->iconY = 0; #endif /* WSM */ } } } #ifdef NO_OL_COMPAT /* * Save the window group. */ if (flags & WindowGroupHint) { pCD->windowGroup = pXWMHints->window_group; } else { pCD->windowGroup = 0L; } #endif /* NO_OL_COMPAT */ } else /* not the first time the hints are processed */ { if (flags & IconPixmapHint) { /* * Process an icon image change if the icon image was initially * set up with a client supplied icon image OR, if the client * now wants to supply an image. */ iconMask = (flags & IconMaskHint)? pXWMHints->icon_mask : (Pixmap) NULL; if ((iconPixmap = MakeClientIconPixmap (pCD, pXWMHints->icon_pixmap, iconMask)) != None) { /* * Made new icon image; free up the old image and display * the new image. */ if (pCD->iconFlags & ICON_HINTS_PIXMAP) { /* * ICON_HINTS_PIXMAP was set either initally or * below because a new pixmap was made for the client. * It is now safe to free the previous pixmap since it * is not the shared default iconPixmap */ if (pCD->iconPixmap) { XFreePixmap (DISPLAY, pCD->iconPixmap); } } else { pCD->iconFlags |= ICON_HINTS_PIXMAP; } pCD->iconPixmap = iconPixmap; /* * Display new icon image if the icon is showing: */ if (((pCD->clientState == MINIMIZED_STATE) || ((pCD->pSD->useIconBox) && (P_ICON_BOX(pCD)))) && ICON_FRAME_WIN(pCD)) { IconExposureProc (pCD, True); } } } } if (pXWMHints) { XFree ((char*)pXWMHints); } } /* END OF FUNCTION ProcessWmHints */ /*************************************<->************************************* * * ProcessWmNormalHints (pCD, firstTime, manageFlags) * * * Description: * ----------- * This function retrieves the contents of the WM_NORMAL_HINTS property on * the cient window. There are several versions of the property that must be * handled (currently R2 and CURRENT). * * * Inputs: * ------ * pCD = pointer to client data for the window with the property * * firstTime = if True this is the first time the property has been processed * * manageFlags = flags that indicate wm state information * * * Outputs: * ------- * pCD = client location and size fields set * * * Comments: * -------- * If the hints are being reprocessed (!firstTime) the configuration values * will be ignored. The size constraint values will be processed but the * client configuration will not be changed even if it is not in line with * the new values. Reconfigurations subsequent to the hints changes will * be done with the new constraints. * *************************************<->***********************************/ void ProcessWmNormalHints (ClientData *pCD, Boolean firstTime, long manageFlags) { register SizeHints *pNormalHints; register long flags; int diff; unsigned long decoration; unsigned int boxdim, tmpMin; unsigned int oldWidthInc = 0, oldHeightInc = 0; unsigned int oldBaseWidth = 0, oldBaseHeight = 0; unsigned int incWidth = 0, incHeight = 0; /* * Use a custom verion of the Xlib routine to get WM_NORMAL_HINTS. * A custom version is necessary to handle the different versions * of WM_NORMAL_HINTS that may be encountered. If the WM_NORMAL_HINTS * property does not exist the flags field will be set to 0. */ pNormalHints = GetNormalHints (pCD); pCD->icccVersion = pNormalHints->icccVersion; /* * Parse the WM_NORMAL_HINTS information: */ if (((flags = pNormalHints->flags) == 0) && !firstTime) { return; } /* * Process the size only if this is the first time the hints are * being processed for the window. */ if (firstTime) { /* * Process client window size flags and information: */ pCD->sizeFlags = flags & (US_POSITION | US_SIZE | P_POSITION | P_SIZE); /* * The R2 conventions and Xlib manual indicate that the window size * and position should be taken out of the WM_NORMAL_HINTS property * if they are specified there. The current conventions indicate that * the size and position information should be gotten from the window * configuration. Mwm 1.1 always uses the current conventions. */ #ifdef R2_COMPAT /* * Maintain R2 compatiblity code for CND product xnm */ if ((pNormalHints->icccVersion == ICCC_R2) && (flags & (US_POSITION | P_POSITION)) && !(manageFlags & MANAGEW_WM_RESTART)) { if (!(pCD->clientFlags & SM_X)) pCD->clientX = pNormalHints->x; if (!(pCD->clientFlags & SM_Y)) pCD->clientY = pNormalHints->y; } else { if (!(pCD->clientFlags & SM_X)) pCD->clientX = wmGD.windowAttributes.x; if (!(pCD->clientFlags & SM_Y)) pCD->clientY = wmGD.windowAttributes.y; } #else /* R2_COMPAT */ if (!(pCD->clientFlags & SM_X)) pCD->clientX = wmGD.windowAttributes.x; if (!(pCD->clientFlags & SM_Y)) pCD->clientY = wmGD.windowAttributes.y; #endif /* R2_COMPAT */ /* * Use current conventions for initial window dimensions. */ #ifdef R2_COMPAT /* * Maintain R2 compatiblity code for CND product xnm */ if ((pNormalHints->icccVersion == ICCC_R2) && (flags & (US_SIZE | P_SIZE)) && !(manageFlags & MANAGEW_WM_RESTART)) { if (!(pCD->clientFlags & SM_WIDTH)) pCD->clientWidth = pNormalHints->width; if (!(pCD->clientFlags & SM_HEIGHT)) pCD->clientHeight = pNormalHints->height; } else { if (!(pCD->clientFlags & SM_WIDTH)) pCD->clientWidth = wmGD.windowAttributes.width; if (!(pCD->clientFlags & SM_HEIGHT)) pCD->clientHeight = wmGD.windowAttributes.height; } #else /* R2_COMPAT */ if (!(pCD->clientFlags & SM_WIDTH)) pCD->clientWidth = wmGD.windowAttributes.width; if (!(pCD->clientFlags & SM_HEIGHT)) pCD->clientHeight = wmGD.windowAttributes.height; #endif /* R2_COMPAT */ } /* * Process the minimum size: */ if (flags & P_MIN_SIZE) { pCD->minWidth = (pNormalHints->min_width < 0) ? 0 : pNormalHints->min_width; pCD->minHeight = (pNormalHints->min_height < 0) ? 0 : pNormalHints->min_height; if (pCD->minWidth > MAX_MAX_SIZE(pCD).width) { pCD->minWidth = MAX_MAX_SIZE(pCD).width; } if (pCD->minHeight > MAX_MAX_SIZE(pCD).height) { pCD->minHeight = MAX_MAX_SIZE(pCD).height; } } else if (firstTime) { pCD->minWidth = 0; pCD->minHeight = 0; } /* * Process the resizing increments: */ if (!firstTime) { oldWidthInc = (pCD->widthInc == 0) ? 1 : pCD->widthInc; oldHeightInc = (pCD->heightInc == 0) ? 1 : pCD->heightInc; } if (flags & P_RESIZE_INC) { pCD->widthInc = (pNormalHints->width_inc < 1) ? 1 : pNormalHints->width_inc; pCD->heightInc = (pNormalHints->height_inc < 1) ? 1 : pNormalHints->height_inc; } else if (firstTime) { pCD->widthInc = 1; pCD->heightInc = 1; } /* * Process the base size: */ if (!firstTime) { oldBaseWidth = pCD->baseWidth; oldBaseHeight = pCD->baseHeight; } if (flags & P_BASE_SIZE) { pCD->baseWidth = (pNormalHints->base_width < 0) ? 0 : pNormalHints->base_width; pCD->baseHeight = (pNormalHints->base_height < 0) ? 0 : pNormalHints->base_height; } else if ((pNormalHints->icccVersion == ICCC_R2) && ((firstTime) || (!firstTime && (flags & P_MIN_SIZE)))) { /* * In this version of the hints the minimum size was effectively * the base size. */ pCD->baseWidth = pCD->minWidth; pCD->baseHeight = pCD->minHeight; } else if (firstTime) { if (flags & P_MIN_SIZE) { pCD->baseWidth = pCD->minWidth; pCD->baseHeight = pCD->minHeight; } else { pCD->baseWidth = 0; pCD->baseHeight = 0; } } if (firstTime) { if (pCD->clientFlags & SM_WIDTH) { pCD->clientWidth = ((pCD->clientWidth * pCD->widthInc) + pCD->baseWidth); } if (pCD->clientFlags & SM_HEIGHT) { pCD->clientHeight =((pCD->clientHeight * pCD->heightInc) + pCD->baseHeight); } } /* * Process the maximum width. NOTE: maximumClientSize.width * and maximumClientSize.height will be set to BIGSIZE if * maximumClientSize is either set to 'horizontal' or 'vertical'. */ pCD->oldMaxWidth = pCD->maxWidth; if (pCD->maximumClientSize.width) { /* If maximumClientSize is full 'horizontal' */ if (IS_MAXIMIZE_HORIZONTAL(pCD)) { /* go to min (full screen width, max maximum width) */ pCD->maxWidth = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (2 * pCD->clientOffset.x); /* * Hack to set max client to the current client height, maxHeight * will be kept up to date whenever the window is reconfigured */ pCD->maxHeight = pCD->clientHeight; } else { pCD->maxWidth = (pCD->maximumClientSize.width * pCD->widthInc) + pCD->baseWidth; } } else { if (flags & P_MAX_SIZE) { if (pNormalHints->max_width < 0) { /* go to min (full screen width, max maximum width) */ pCD->maxWidth = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (2 * pCD->clientOffset.x); } else { pCD->maxWidth = pNormalHints->max_width; } } /* Don't reset maxWidth if it has been set earlier */ else if (!IS_MAXIMIZE_VERTICAL(pCD)) { if (firstTime) { /* go to min (full screen width, max maximum width) */ pCD->maxWidth = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (2 * pCD->clientOffset.x); } else { /* reset the maxHeight before further processing */ pCD->maxWidth = pCD->maxWidthLimit; } } else { /* * If the hints changed we need to adjust the maximum * size (if not specified in the hints). */ if (!firstTime && ((oldBaseWidth != pCD->baseWidth) || (oldWidthInc != pCD->widthInc))) { incWidth = (pCD->maxWidth - oldBaseWidth) / oldWidthInc; pCD->maxWidth = (incWidth * pCD->widthInc) + pCD->baseWidth; } else { /* reset the maxHeight before further processing */ pCD->maxWidth = pCD->maxWidthLimit; } } if (pCD->maxWidth > MAX_MAX_SIZE(pCD).width) { pCD->maxWidth = MAX_MAX_SIZE(pCD).width; } } /* * Process the maximum height. */ pCD->oldMaxHeight = pCD->maxHeight; if (pCD->maximumClientSize.height) { /* If maximumClientSize is full 'vertical' */ if (IS_MAXIMIZE_VERTICAL(pCD)) { /* go to min (full screen height, max maximum height) */ pCD->maxHeight = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (pCD->clientOffset.x + pCD->clientOffset.y); /* * Hack to set max client to the current client width, maxWidth * will be kept up to date whenever the window is reconfigured */ pCD->maxWidth = pCD->clientWidth; } else { pCD->maxHeight = (pCD->maximumClientSize.height * pCD->heightInc) + pCD->baseHeight; } } else { if (flags & P_MAX_SIZE) { if (pNormalHints->max_height < 0) { /* go to min (full screen height, max maximum height) */ pCD->maxHeight = DisplayHeight ( DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (pCD->clientOffset.x + pCD->clientOffset.y); } else { pCD->maxHeight = pNormalHints->max_height; } } /* Don't reset maxHeight if it has been set above */ else if (!IS_MAXIMIZE_HORIZONTAL(pCD)) { if (firstTime) { /* go to min (full screen height, max maximum height) */ pCD->maxHeight = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (pCD->clientOffset.x + pCD->clientOffset.y); } else { /* reset the maxHeight before further processing */ pCD->maxHeight = pCD->maxHeightLimit; } } else { /* * If the hints changed we need to adjust the maximum * size (if not specified in the hints). */ if (!firstTime && ((oldBaseHeight != pCD->baseHeight) || (oldHeightInc != pCD->heightInc))) { incHeight = (pCD->maxHeight - oldBaseHeight) / oldHeightInc; pCD->maxHeight = (incHeight * pCD->heightInc) + pCD->baseHeight; } else { /* reset the maxHeight before further processing */ pCD->maxHeight = pCD->maxHeightLimit; } } if (pCD->maxHeight > MAX_MAX_SIZE(pCD).height) { pCD->maxHeight = MAX_MAX_SIZE(pCD).height; } } /* * Make sure not to exceed the maximumMaximumSize (width and height) */ if (pCD->maxWidth > MAX_MAX_SIZE(pCD).width) { pCD->maxWidth = MAX_MAX_SIZE(pCD).width; } if (pCD->maxHeight > MAX_MAX_SIZE(pCD).height) { pCD->maxHeight = MAX_MAX_SIZE(pCD).height; } /* * Get the initial aspect ratios, if available. Only use them if: * * minAspect.y > 0 * maxAspect.y > 0 * 0 <= minAspect.x / minAspect.y <= maxAspect.x / maxAspect.y */ if (flags & P_ASPECT) { pCD->minAspect.x = pNormalHints->min_aspect.x; pCD->minAspect.y = pNormalHints->min_aspect.y; pCD->maxAspect.x = pNormalHints->max_aspect.x; pCD->maxAspect.y = pNormalHints->max_aspect.y; if (pCD->minAspect.y > 0 && pCD->maxAspect.y > 0 && pCD->minAspect.x > 0 && pCD->maxAspect.x > 0 && (pCD->minAspect.x * pCD->maxAspect.y <= pCD->maxAspect.x * pCD->minAspect.y)) { pCD->sizeFlags |= P_ASPECT; } else { pCD->sizeFlags &= ~P_ASPECT; } } /* compute for minimum frame size */ if ((decoration = pCD->decor) & MWM_DECOR_TITLE) { boxdim = TitleBarHeight(pCD); tmpMin = boxdim + ((decoration & MWM_DECOR_MENU) ? boxdim : 0) + ((decoration & MWM_DECOR_MINIMIZE) ? boxdim : 0) + ((decoration & MWM_DECOR_MAXIMIZE) ? boxdim : 0) - 2*(pCD->matteWidth); } else { tmpMin = 0; } /* * Process the window gravity (for positioning): */ if (flags & P_WIN_GRAVITY) { pCD->windowGravity = pNormalHints->win_gravity; } else { if (pNormalHints->icccVersion == ICCC_R2) { pCD->windowGravity = wmGD.windowAttributes.win_gravity; } else { pCD->windowGravity = NorthWestGravity; } } /* * Make sure that all the window sizing constraints are compatible: */ /* * Make: * * minWidth >= tmpMin * minWidth >= max (baseWidth, widthInc) > 0 * & an integral number of widthInc from baseWidth. * minHeight >= max (baseHeight, heightInc) > 0 * & an integral number of heightInc from baseHeight. */ if (pCD->minWidth < tmpMin) { if ((diff = ((tmpMin - pCD->baseWidth)%pCD->widthInc)) != 0) { pCD->minWidth = tmpMin + pCD->widthInc - diff; } else { pCD->minWidth = tmpMin; } } if (pCD->minWidth < pCD->baseWidth) { pCD->minWidth = pCD->baseWidth; } if (pCD->minWidth == 0) { pCD->minWidth = pCD->widthInc; } else if ((diff = ((pCD->minWidth - pCD->baseWidth)%pCD->widthInc)) != 0) { pCD->minWidth += pCD->widthInc - diff; } if (pCD->minHeight < pCD->baseHeight) { pCD->minHeight = pCD->baseHeight; } if (pCD->minHeight == 0) { pCD->minHeight = pCD->heightInc; } else if ((diff = ((pCD->minHeight - pCD->baseHeight) % pCD->heightInc)) !=0) { pCD->minHeight += pCD->heightInc - diff; } /* * Make: * * maxWidth >= minWidth * & an integral number of widthInc from baseWidth. * maxHeight >= minHeight * & an integral number of heightInc from baseHeight. */ if (pCD->maxWidth < pCD->minWidth) { pCD->maxWidth = pCD->minWidth; } /* * Hack to use maxWidthLimit as the real maxWidth when maximumClientSize * set to 'vertical'. */ if (IS_MAXIMIZE_VERTICAL(pCD)) { /* go to min (full screen width, max maximum width) */ pCD->maxWidthLimit = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (2 * pCD->clientOffset.x); } else { pCD->maxWidthLimit = pCD->maxWidth; } pCD->maxWidth -= ((pCD->maxWidth - pCD->baseWidth) % pCD->widthInc); if (firstTime) { pCD->oldMaxWidth = pCD->maxWidth; } if (pCD->maxHeight < pCD->minHeight) { pCD->maxHeight = pCD->minHeight; } /* * Hack to use maxHeightLimit as the real maxHeight when maximumClientSize * set to 'horizontal'. */ if (IS_MAXIMIZE_HORIZONTAL(pCD)) { /* go to min (full screen height, max maximum height) */ pCD->maxHeightLimit = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pCD)) - (pCD->clientOffset.x + pCD->clientOffset.y); } else { pCD->maxHeightLimit = pCD->maxHeight; } pCD->maxHeight -= ((pCD->maxHeight - pCD->baseHeight) % pCD->heightInc); if (firstTime) { pCD->oldMaxHeight = pCD->maxHeight; } if (!firstTime && pCD->maxConfig) { /* * If the hints changed while we were maximized then * we may need to adjust the normalized size of the window. */ if (!firstTime && ((oldBaseWidth != pCD->baseWidth) || (oldBaseHeight != pCD->baseHeight) || (oldWidthInc != pCD->widthInc) || (oldHeightInc != pCD->heightInc))) { incWidth = (pCD->clientWidth - oldBaseWidth) / oldWidthInc; incHeight = (pCD->clientHeight - oldBaseHeight) / oldHeightInc; pCD->clientWidth = (incWidth * pCD->widthInc) + pCD->baseWidth; pCD->clientHeight = (incHeight * pCD->heightInc) + pCD->baseHeight; } } /* * If using aspect ratios, make: * * minWidth / maxHeight <= minAspect.x / minAspect.y * <= maxAspect.x / maxAspect.y * <= maxWidth / minHeight */ if (pCD->sizeFlags & P_ASPECT) { if (pCD->minWidth * pCD->minAspect.y > pCD->minAspect.x * pCD->maxHeight) { pCD->minAspect.x = pCD->minWidth; pCD->minAspect.y = pCD->maxHeight; } if (pCD->maxAspect.x * pCD->minHeight > pCD->maxWidth * pCD->maxAspect.y) { pCD->maxAspect.x = pCD->maxWidth; pCD->maxAspect.y = pCD->minHeight; } FixWindowSize (pCD, (unsigned int *) &(pCD->maxWidth), (unsigned int *) &(pCD->maxHeight), (unsigned int) (pCD->widthInc), (unsigned int) (pCD->heightInc)); } /* * If this is the first time, make sure the client dimensions are within * range and that they satisfy any aspect ratio constraints: * * 0 < minWidth <= clientWidth <= maxWidth * 0 < minHeight <= clientHeight <= maxHeight * * minAspect.x / minAspect.y <= clientWidth / clientHeight * <= maxAspect.x / maxAspect.y * * Initial max width/height are set to max of max size or normal * client size unless a maximumClientSize was specified. */ if (firstTime) { if (!pCD->maximumClientSize.width) { if (pCD->clientWidth > pCD->pSD->maximumMaximumSize.width) { pCD->clientWidth = pCD->pSD->maximumMaximumSize.width; } } if (!pCD->maximumClientSize.height) { if (pCD->clientHeight > pCD->pSD->maximumMaximumSize.height) { pCD->clientHeight = pCD->pSD->maximumMaximumSize.height; } } FixWindowSize (pCD, (unsigned int *) &(pCD->clientWidth), (unsigned int *) &(pCD->clientHeight), (unsigned int) (pCD->widthInc), (unsigned int) (pCD->heightInc)); } } /* END OF FUNCTION ProcessWmNormalHints */ /*************************************<->************************************* * * WmICCCMToXmString (wmNameProp) * * * Description: * ----------- * This function uses a property (WM_NAME or WM_ICON_NAME) that was * retrieved from the window, and converts it to XmString. * * Inputs: * ------ * wmNameProp - the text property * * Outputs: * ------- * Return = new XmString, or NULL if the property didn't have a value. * *************************************<->***********************************/ static XmString WmICCCMToXmString (XTextProperty *wmNameProp) { int status; XmString xms_return; XmStringTable xmsTable; int i, nStrings = -1; char msg[200]; if (wmNameProp->value == 0 || strlen((char *)wmNameProp->value) == 0) { return (XmString)NULL; } if (((status = XmCvtTextPropertyToXmStringTable(DISPLAY, wmNameProp, &xmsTable, &nStrings)) != Success) || (nStrings <= 0)) { switch (status) { case XConverterNotFound: #ifndef MOTIF_ONE_DOT_ONE sprintf(msg, GETMESSAGE (70,5, "Window manager cannot convert property %.100s as clientTitle/iconTitle: XmbTextPropertyToTextList"), XGetAtomName (DISPLAY,wmNameProp->encoding)); Warning(msg); #endif /* MOTIF_ONE_DOT_ONE */ break; case XNoMemory: sprintf(msg, GETMESSAGE (70, 6, "insufficient memory to convert property %.100s as clientTitle/iconTitle: XmbTextPropertyToTextList"), XGetAtomName(DISPLAY,wmNameProp->encoding)); Warning(msg); break; case XLocaleNotSupported: if ((wmNameProp->encoding == XA_STRING) || (wmNameProp->encoding == wmGD.xa_COMPOUND_TEXT)) { sprintf(msg, LOCALE_MSG, setlocale(LC_ALL, NULL)); } else { /* Atom was neither STRING nor COMPOUND_TEXT */ sprintf(msg, GETMESSAGE(70, 8, "Window manager received unknown property as clientTitle/iconTitle: %.100s. Property ignored."), XGetAtomName(DISPLAY, wmNameProp->encoding)); } Warning(msg); break; } /* Couldn't convert using Xm; apply a default */ return XmCvtCTToXmString((char*)wmNameProp->value); } xms_return = xmsTable[0]; for (i = 1; i < nStrings; i++) { #ifdef CONCAT_TEXTLIST xms_return = XmStringConcatAndFree(xms_return, xmsTable[i]); #else XmStringFree(xmsTable[i]); #endif /* CONCAT_TEXTLIST */ } XtFree((char *)xmsTable); return xms_return; } /*************************************<->************************************* * * ProcessWmWindowTitle (pCD, firstTime) * * * Description: * ----------- * This function retrieves the contents of the WM_NAME property on the * cient window. A default name is set if the property does not exist. * * * Inputs: * ------ * pCD - pointer to client data structure * firstTime - false if the window is already managed and the title * is being changed. * * * Outputs: * ------- * pCD - clientTitle, iconTitle * *************************************<->***********************************/ void ProcessWmWindowTitle (ClientData *pCD, Boolean firstTime) { XTextProperty wmNameProp; XmString title_xms = NULL; if ((pCD->clientDecoration & MWM_DECOR_TITLE) && #ifdef WSM (!firstTime || HasProperty (pCD, XA_WM_NAME)) && #endif /* WSM */ XGetWMName(DISPLAY, pCD->client, &wmNameProp)) { title_xms = WmICCCMToXmString(&wmNameProp); if (wmNameProp.value) XFree ((char*)wmNameProp.value); } if (title_xms) { if (!firstTime && (pCD->iconTitle == pCD->clientTitle)) { /* * The client window title is being used for the icon title so * change the icon title with the window title. */ pCD->iconTitle = title_xms; RedisplayIconTitle (pCD); } if ((pCD->clientFlags & CLIENT_HINTS_TITLE) && pCD->clientTitle != wmGD.clientDefaultTitle) { XmStringFree (pCD->clientTitle); } pCD->clientTitle = title_xms; pCD->clientFlags |= CLIENT_HINTS_TITLE; if (!firstTime) { DrawWindowTitle (pCD, True); } } /* * The client frame does not have a place to put the title or the WM_NAME * property does not exist or there was some error in getting * the property information, so use a default value. */ else if (firstTime) { if (pCD->clientName) { pCD->clientTitle = XmStringCreateLocalized(pCD->clientName); } else { pCD->clientTitle = wmGD.clientDefaultTitle; } } /* * If this is a tear-off menu, then make sure title text is not clipped */ #ifdef PANELIST if ((pCD->window_status & MWM_TEAROFF_WINDOW) || (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL)) #else /* PANELIST */ if (pCD->window_status & MWM_TEAROFF_WINDOW) #endif /* PANELIST */ { unsigned int boxdim = TitleBarHeight (pCD); unsigned long decor = pCD->decor; XmFontList fontList; int minWidth; if (DECOUPLE_TITLE_APPEARANCE(pCD)) fontList = CLIENT_TITLE_APPEARANCE(pCD).fontList; else fontList = CLIENT_APPEARANCE(pCD).fontList; /* * Calculations derived from GetTextBox() and GetFramePartInfo() */ minWidth = XmStringWidth(fontList, pCD->clientTitle) + #ifdef PANELIST ((pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) ? 4 : 0) + #endif /* PANELIST */ ((decor & MWM_DECOR_MENU) ? boxdim : 0) + ((decor & MWM_DECOR_MINIMIZE) ? boxdim : 0) + ((decor & MWM_DECOR_MAXIMIZE) ? boxdim : 0) + WM_TOP_TITLE_SHADOW + WM_BOTTOM_TITLE_SHADOW + WM_TOP_TITLE_PADDING + WM_BOTTOM_TITLE_PADDING; if (minWidth > pCD->minWidth) { pCD->minWidth = minWidth; } #ifdef PANELIST if ((pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) && (pCD->clientWidth < pCD->minWidth)) { FixSubpanelEmbeddedClientGeometry (pCD); } #endif /* PANELIST */ } } /* END OF FUNCTION ProcessWmWindowTitle */ #ifdef PANELIST /*************************************<->************************************* * * FixSubpanelEmbeddedClientGeometry ( pCD ) * * * Description: * ----------- * This function adjusts the embedded clients in a subpanel if the * geometry of the subpanel is adjusted. * * * Inputs: * ------ * pCD - pointer to client data structure * * * Outputs: * ------- * * Comment: * ------- * Only handles change in width right now. * *************************************<->***********************************/ static void FixSubpanelEmbeddedClientGeometry (ClientData *pCD) { WmScreenData *pSD = PSD_FOR_CLIENT(pCD); Widget wSubpanel; Arg al[5]; int ac; /* * Get the widget for the subpanel */ wSubpanel = WmPanelistWindowToSubpanel (DISPLAY1, pCD->client); if (pSD->wPanelist && wSubpanel) { WmFpEmbeddedClientData *pECD; int i; /* * set new shell width to minimum width */ if (pCD->clientWidth < pCD->minWidth) { ac = 0; XtSetArg (al[ac], XmNwidth, pCD->minWidth); ac++; XtSetValues (wSubpanel, al, ac); } /* * Cause update of client geometries. */ /* WmPanelistSetClientGeometry (pSD->wPanelist); */ /* * Update all affected reparented controls. */ for (i=0; inumEmbeddedClients; i++) { pECD = &(((WmFpEmbeddedClientData *) pSD->pECD)[i]); if (pECD->pCD) { ClientData *pCD2 = pECD->pCD; if ((pCD2->clientWidth != pECD->width) || (pCD2->clientHeight != pECD->height) || (pCD2->clientX != pECD->x) || (pCD2->clientY != pECD->y)) { pCD2->clientX = pECD->x; pCD2->clientY = pECD->y; pCD2->clientWidth = pECD->width; pCD2->clientHeight = pECD->height; XMoveResizeWindow (DISPLAY1, pCD2->client, pECD->x, pECD->y, pECD->width, pECD->height); } } } } } /* END OF FUNCTION FixEmbeddedClientGeometry */ #endif /* PANELIST */ /*************************************<->************************************* * * ProcessWmIconTitle (pCD, firstTime) * * * Description: * ----------- * This function retrieves the contents of the WM_ICON_NAME property on the * cient window. The value of the property is a string that is used for the * icon title. A default title is set if the property does not exist. * * * Inputs: * ------ * pCD - pointer to client data structure * * firstTime - false if the window is already managed and the title * is being changed. * * * Outputs: * ------- * pCD - iconTitle * *************************************<->***********************************/ void ProcessWmIconTitle (ClientData *pCD, Boolean firstTime) { XTextProperty wmIconNameProp; XmString icon_xms = NULL; if ((pCD->clientFunctions & MWM_FUNC_MINIMIZE) && (pCD->transientLeader == NULL) && #ifdef WSM (!firstTime || HasProperty(pCD, XA_WM_ICON_NAME)) && #endif /* WSM */ XGetWMIconName (DISPLAY, pCD->client, &wmIconNameProp)) { icon_xms = WmICCCMToXmString(&wmIconNameProp); if (wmIconNameProp.value) XFree ((char*)wmIconNameProp.value); } if (icon_xms) { if ((pCD->iconFlags & ICON_HINTS_TITLE) && pCD->iconTitle != wmGD.iconDefaultTitle) { XmStringFree (pCD->iconTitle); } pCD->iconTitle = icon_xms; pCD->iconFlags |= ICON_HINTS_TITLE; if (!firstTime) { RedisplayIconTitle (pCD); } } /* * The WM_ICON_NAME property does not exist (or there was some error * in getting * the property information), so use a default value. */ else if (firstTime) { if (pCD->clientTitle && (pCD->clientTitle != wmGD.clientDefaultTitle)) { pCD->iconTitle = pCD->clientTitle; } else { pCD->iconTitle = wmGD.iconDefaultTitle; } } } /* END OF FUNCTION ProcessWmIconTitle */ /*************************************<->************************************* * * ProcessWmTransientFor (pCD) * * * Description: * ----------- * This function retrieves the contents of the WM_TRANSIENT_FOR property on * the cient window. * * * Inputs: * ------ * pCD = pointer to the client data structure for the window with the property * * * Outputs: * ------- * pCD.transientFor = if tranient then this is the associated main window * * pCD.clientFlags = indicate that this is a transient window * *************************************<->***********************************/ void ProcessWmTransientFor (ClientData *pCD) { Window window; ClientData *leader; #ifdef WSM if ((HasProperty (pCD, XA_WM_TRANSIENT_FOR)) && (XGetTransientForHint (DISPLAY, pCD->client, &window))) #else /* WSM */ if (XGetTransientForHint (DISPLAY, pCD->client, &window)) #endif /* WSM */ { pCD->clientFlags |= CLIENT_TRANSIENT; /* * Only save the (leader) transientFor window if it is NOT the * client window and it is already managed by the window manager. */ if ((pCD->client != window) && !XFindContext (DISPLAY, window, wmGD.windowContextType, (caddr_t *)&leader)) { pCD->transientFor = window; pCD->transientLeader = leader; } } else { /* else this is not a transient window */ pCD->clientFlags &= ~CLIENT_TRANSIENT; pCD->transientFor = (Window)0L; pCD->transientLeader = NULL; } } /* END OF FUNCTION ProcessWmTransientFor */ /*************************************<->************************************* * * MakeSystemMenu (pCD) * * * Description: * ----------- * This function finds or makes a system menu for the client. A check * is made for the _MWM_MENU property and, if present, client-specific * items are added to the custom system menu. Any custom system menu * must be destroyed when the client is unmanaged (or killed). * * * Inputs: * ------ * pCD = pointer to the client data structure for the managed window * * * Outputs: * ------- * pCD.systemMenuSpec = system menu specification for the client, not added * to wmGD.acceleratorMenuSpecs * *************************************<->***********************************/ void MakeSystemMenu (ClientData *pCD) { #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) MenuItem *lastItem; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ pCD->mwmMenuItems = GetMwmMenuItems(pCD); pCD->systemMenuSpec = MAKE_MENU (PSD_FOR_CLIENT(pCD), pCD, pCD->systemMenu, F_CONTEXT_WINDOW, F_CONTEXT_WINDOW|F_CONTEXT_ICON, pCD->mwmMenuItems, TRUE); #ifdef NO_MESSAGE_CATALOG if (pCD->systemMenuSpec == NULL) { /* * As the lookup has failed, let's try just one more time. */ Warning("Retrying - using builtin window menu\n"); pCD->systemMenuSpec = MAKE_MENU(PSD_FOR_CLIENT(pCD), pCD, builtinSystemMenuName, F_CONTEXT_WINDOW, F_CONTEXT_WINDOW|F_CONTEXT_ICON, pCD->mwmMenuItems, TRUE); } #endif #if defined(MWM_QATS_PROTOCOL) /* Added to fix CDExc23338 * Not sure what the MWM_QATS_PROTOCOL is trying to accomplish here, * but this code is causing the system menu to loose it's default * actions whenever client defined actions are added. I thought * it prudent to minimize the changes. It could be that the * #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) * should be * #if ((!defined(WSM)) && defined(MWM_QATS_PROTOCOL)) * throughout the wm code, but I am loath to make such a change * without any documentation. */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /** BEGIN FIX CR 6941 **/ /* if we still don't have a menu spec, then just abort. */ if (pCD->systemMenuSpec == NULL) return; pCD->systemMenuSpec = DuplicateMenuSpec(pCD->systemMenuSpec); XtFree(pCD->systemMenuSpec->name); pCD->systemMenuSpec->name = XtNewString("ProtocolsMenu"); /* Find the last menu item in the menu spec's list. */ for (lastItem = pCD->systemMenuSpec->menuItems; lastItem->nextMenuItem != (MenuItem *) NULL; lastItem = lastItem->nextMenuItem) /*EMPTY*/; lastItem->nextMenuItem = pCD->mwmMenuItems; /* Now recreate the menu widgets since we've appended the protocol menu items */ DestroyMenuSpecWidgets(pCD->systemMenuSpec); pCD->systemMenuSpec->menuWidget = CreateMenuWidget (PSD_FOR_CLIENT(pCD), pCD, "ProtocolsMenu", PSD_FOR_CLIENT(pCD)->screenTopLevelW, TRUE, pCD->systemMenuSpec, NULL); /** END FIX CR 6941 **/ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #endif /* defined(MWM_QATS_PROTOCOL) */ } /* END OF FUNCTION MakeSystemMenu */ /*************************************<->************************************* * * InitCColormapData (pCD) * * * Description: * ----------- * This function initializes colormap data for the client window that is * by the window manager in maintaining the colormap focus. This may * involve retrieving and processing properties that deal with subwindow * colormaps. * * * Inputs: * ------ * pCD = pointer to the client data structure for the managed window * * * Outputs: * ------- * pCD.clientColormap = client colormap to be installed when the client * window gets the colormap focus * * pCD = (cmapWindows, clientCmapList, clientCmapCount, clientCmapIndex) * *************************************<->***********************************/ void InitCColormapData (ClientData *pCD) { if (wmGD.windowAttributes.colormap == None) { pCD->clientColormap = WORKSPACE_COLORMAP(pCD); } else { pCD->clientColormap = wmGD.windowAttributes.colormap; } /* * Process subwindow colormap windows if they are specified. */ ProcessWmColormapWindows (pCD); } /* END OF FUNCTION InitCColormapData */ /*************************************<->************************************* * * CalculateGravityOffset (pCD, xoff, yoff) * * * Description: * ----------- * This function calculates the window offsets based on the window gravity * and the window frame client offset. * * * Inputs: * ------ * pCD = pointer to client data (client window configuration fields) * xoff = pointer to xoffset * yoff = pointer to yoffset * * * Outputs: * ------- * xoff = pointer to xoffset set * yoff = pointer to yoffset set * *************************************<->***********************************/ void CalculateGravityOffset (ClientData *pCD, int *xoff, int *yoff) { int borderWidth = pCD->xBorderWidth; if (pCD->windowGravity < ForgetGravity || pCD->windowGravity > StaticGravity) { *xoff = 0; *yoff = 0; } else { switch (pCD->windowGravity) { case NorthWestGravity: default: { *xoff = pCD->clientOffset.x; *yoff = pCD->clientOffset.y; break; } case NorthGravity: { *xoff = borderWidth; *yoff = pCD->clientOffset.y; break; } case NorthEastGravity: { *xoff = -(pCD->clientOffset.x - (2 * borderWidth)); *yoff = pCD->clientOffset.y; break; } case EastGravity: { *xoff = -(pCD->clientOffset.x - (2 * borderWidth)); *yoff = borderWidth + (pCD->clientOffset.y - pCD->clientOffset.x)/2; break; } case SouthEastGravity: { *xoff = -(pCD->clientOffset.x - (2 * borderWidth)); *yoff = -(pCD->clientOffset.x - (2 * borderWidth)); break; } case SouthGravity: { *xoff = borderWidth; *yoff = -(pCD->clientOffset.x - (2 * borderWidth)); break; } case SouthWestGravity: { *xoff = pCD->clientOffset.x; *yoff = -(pCD->clientOffset.x - (2 * borderWidth)); break; } case WestGravity: { *xoff = pCD->clientOffset.x; *yoff = borderWidth + (pCD->clientOffset.y - pCD->clientOffset.x)/2; break; } case CenterGravity: { *xoff = 0; *yoff = 0; break; } } } } /* END OF FUNCTION CalculateGravityOffset */ /*************************************<->************************************* * * InitClientPlacement (pCD, manageFlags) * * * Description: * ----------- * This function sets up the initial client window placement (for both * the normal and maximized state). * * * Inputs: * ------ * pCD = pointer to client data (client window configuration fields) * * manageFlags = flags that indicate wm state information (e.g. whether * the window manager is starting up or restarting) * * * Outputs: * ------- * Return = True if position changed by this routine. * pCD = changes to the client window configuration fields * *************************************<->***********************************/ Boolean InitClientPlacement (ClientData *pCD, long manageFlags) { Boolean interactivelyPlaced = False; Boolean autoPlaced = False; Boolean rval = False; int xoff, yoff; int origX, origY, origWidth, origHeight; #ifdef WSM int iwsc; #endif /* WSM */ /* * Save initial client values */ origX = pCD->clientX; origY = pCD->clientY; origWidth = pCD->clientWidth; origHeight = pCD->clientHeight; /* * Do interactive placement if... * + the resource is turned on * + the window's coming up on the active screen * * Don't do it if... * + position specified in DB or by Session Manager * + the user has specified a position * + the window is coming up iconic * + the window is transient * + we're system modal */ if (wmGD.interactivePlacement && (!(pCD->clientFlags & (SM_X | SM_Y))) && !(pCD->sizeFlags & US_POSITION) && (pCD->clientState != MINIMIZED_STATE) && (manageFlags == MANAGEW_NORMAL) && !(pCD->clientFlags & CLIENT_TRANSIENT) && (pCD->inputMode != MWM_INPUT_SYSTEM_MODAL) && #ifdef WSM (ClientInWorkspace(PSD_FOR_CLIENT(pCD)->pActiveWS, pCD))) #else /* WSM */ (PSD_FOR_CLIENT(pCD) == ACTIVE_PSD)) #endif /* WSM */ { /* * Interactively place the window on the screen. */ interactivelyPlaced = True; PlaceWindowInteractively (pCD); } /* * Check out the configuration values to insure that they are within * the constraints. */ FixWindowConfiguration (pCD, (unsigned int *) &(pCD->clientWidth), (unsigned int *) &(pCD->clientHeight), (unsigned int) (pCD->widthInc), (unsigned int) (pCD->heightInc)); /* * Do autoplacement of the client window if appropriate. */ if ((manageFlags == MANAGEW_NORMAL) && !interactivelyPlaced && (!(pCD->clientFlags & (SM_X | SM_Y))) && !(pCD->sizeFlags & US_POSITION) && !(pCD->clientFlags & CLIENT_TRANSIENT) && (pCD->inputMode != MWM_INPUT_SYSTEM_MODAL) && wmGD.clientAutoPlace) { /* * if (PPosition is on or nonzero), then use current value for * clientX and clientY which was set to windowAttributes.x,y * by ProcessWmNormalHints(), else autoplace client. */ if ((pCD->sizeFlags & P_POSITION) && ((pCD->usePPosition == USE_PPOSITION_ON) || ((pCD->usePPosition == USE_PPOSITION_NONZERO) && ((pCD->clientX != 0) || (pCD->clientY != 0))))) { /* do nothing */ } else { FindClientPlacement (pCD); autoPlaced = True; } } /* * Do PositionIsFrame processing: * Use window gravity to allow the user to specify the window * position on the screen without having to know the dimensions * of the decoration that mwm is adding. */ if ((wmGD.positionIsFrame) && !interactivelyPlaced && !autoPlaced) { CalculateGravityOffset (pCD, &xoff, &yoff); if (!(pCD->clientFlags & SM_X)) pCD->clientX += xoff; if (!(pCD->clientFlags & SM_Y)) pCD->clientY += yoff; } /* * Do PositionOnScreen processing: */ #ifdef WSM #ifdef PANELIST if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) { if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUB_RESTORED) { SetFrameInfo (pCD); } else { AdjustSlideOutGeometry (pCD); } } else #endif /* PANELIST */ #endif /* WSM */ if (((wmGD.positionOnScreen) && !interactivelyPlaced) && (!(pCD->clientFlags & (SM_X | SM_Y)))) { PlaceFrameOnScreen (pCD, &pCD->clientX, &pCD->clientY, pCD->clientWidth, pCD->clientHeight); } /* * Position the maximized frame: */ pCD->maxX = pCD->clientX; pCD->maxY = pCD->clientY; PlaceFrameOnScreen (pCD, &pCD->maxX, &pCD->maxY, pCD->maxWidth, pCD->maxHeight); if (!wmGD.iconAutoPlace) { #ifdef WSM if (!(pCD->iconFlags & ICON_HINTS_POSITION)) { for (iwsc=0; iwscnumInhabited; iwsc++) { pCD->pWsList[iwsc].iconX = pCD->clientX; pCD->pWsList[iwsc].iconY = pCD->clientY; PlaceIconOnScreen (pCD, &pCD->pWsList[iwsc].iconX, &pCD->pWsList[iwsc].iconY); } } #else /* WSM */ if (!(pCD->iconFlags & ICON_HINTS_POSITION)) { pCD->iconX = pCD->clientX; pCD->iconY = pCD->clientY; } PlaceIconOnScreen (pCD, &pCD->iconX, &pCD->iconY); #endif /* WSM */ } /* * if client size or position has been changed by this routine, * then indicate in return value */ if ((origX != pCD->clientX) || (origY != pCD->clientY) || (origWidth != pCD->clientWidth) || (origHeight != pCD->clientHeight)) { rval = True; } return (rval); } /* END OF FUNCTION InitClientPlacement */ #ifdef PANELIST /******************************<->************************************* * * void AdjustSlideOutGeometry (pCD) * * Description: * ----------- * Adjusts the geometry of the slide out panel * * Inputs: * ------ * pCD = pointer to a client data of slide out * * Outputs: * ------- * * Comments: * -------- * Subpanel is to appear above or below the front panel, centered * on the vertical axis of the spawning control. ******************************<->***********************************/ static void AdjustSlideOutGeometry ( ClientData *pCD) { ClientData *pCD_FP = NULL; WmPanelistObject pPanelist; pCD->slideDirection = SLIDE_NORTH; /* assume up for now */ pPanelist = (WmPanelistObject) pCD->pSD->wPanelist; (void) XFindContext (DISPLAY, XtWindow(O_Shell(pPanelist)), wmGD.windowContextType, (caddr_t *)&pCD_FP); if (pCD_FP) { /* * Adjust slide up position if coming from front * panel. * (Assumes no nesting of panels !!!) * (Assumes horizontal oriented front panel!!!) */ if (pCD->transientLeader == pCD_FP) { /* * Subpanel should be sort-of centered already, * adjust by width of window manager frame. */ pCD->clientX -= pCD->frameInfo.lowerBorderWidth; /* * Adjust to slide up above front panel. */ pCD->clientY = pCD_FP->frameInfo.y - pCD->frameInfo.lowerBorderWidth - pCD->clientHeight + 3; /* RICK -- added the (+ 3) */ if (pCD->clientY < 0) { /* * Adjust to slide down below front panel. */ pCD->clientY = pCD_FP->frameInfo.y + pCD_FP->frameInfo.height + pCD->frameInfo.titleBarHeight + pCD->frameInfo.upperBorderWidth - 3; pCD->slideDirection = SLIDE_SOUTH; /* RICK -- added the (- 3) */ } if ((pCD->clientY + pCD->clientHeight + pCD->frameInfo.lowerBorderWidth) > XDisplayHeight (DISPLAY, pCD->pSD->screen)) { /* * If the bottom of the slide-up is off the bottom * of the screen, then don't slide, just pop it up. */ pCD->slideDirection = SLIDE_NOT; } PlaceFrameOnScreen (pCD, &pCD->clientX, &pCD->clientY, pCD->clientWidth, pCD->clientHeight); } SetFrameInfo (pCD); } } #endif /* PANELIST */ /*************************************<->************************************* * * PlaceFrameOnScreen (pCD, pX, pY, w, h) * * * Description: * ----------- * This function is used to nudge a client window so that it is totally * onscreen if possible. At least the top left corner will be onscreen. * * * Inputs: * ------ * pCD - pointer to client data * pX - pointer to x-coord * pY - pointer to y-coord * w - width of window * h - height of window * * * Outputs: * ------- * *pX - new x-coord * *pY - new y-coord * * * Comments: * -------- * *************************************<->***********************************/ void PlaceFrameOnScreen (ClientData *pCD, int *pX, int *pY, int w, int h) { int clientOffsetX; int clientOffsetY; int frameX; int frameY; int frameWidth; int frameHeight; int screenHeight; int screenWidth; clientOffsetX = pCD->clientOffset.x; clientOffsetY = pCD->clientOffset.y; frameX = *pX - clientOffsetX; frameY = *pY - clientOffsetY; frameWidth = w + (2 * clientOffsetX); frameHeight = h + clientOffsetX + clientOffsetY; screenWidth = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)); screenHeight = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pCD)); if ((frameX + frameWidth) > screenWidth) { frameX -= (frameX + frameWidth) - screenWidth; } if ((frameY + frameHeight) > screenHeight) { frameY -= (frameY + frameHeight) - screenHeight; } if (frameX < 0) { frameX = 0; } if (frameY < 0) { frameY = 0; } *pX = frameX + clientOffsetX; *pY = frameY + clientOffsetY; } /* END OF FUNCTION PlaceFrameOnScreen */ /*************************************<->************************************* * * PlaceIconOnScreen (pCD, pX, pY) * * * Description: * ----------- * This function positions an icon on-screen. * * * Inputs: * ------ * pCD - pointer to client data * pX - pointer to x-coord * pY - pointer to y-coord * * Outputs: * ------- * *pX - new x-coord * *pY - new y-coord * * Comments: * -------- * *************************************<->***********************************/ void PlaceIconOnScreen (ClientData *pCD, int *pX, int *pY) { int screenWidth; int screenHeight; int iconX; int iconY; screenWidth = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)); screenHeight = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pCD)); iconX = *pX; iconY = *pY; if ((iconX + ICON_WIDTH(pCD)) > screenWidth) { iconX = screenWidth - ICON_WIDTH(pCD); } else if (iconX < 0) { iconX = 0; } if ((iconY + ICON_HEIGHT(pCD)) > screenHeight) { iconY = screenHeight - ICON_HEIGHT(pCD); } else if (iconY < 0) { iconY = 0; } *pX = iconX; *pY = iconY; } /* END OF FUNCTION PlaceIconOnScreen */ /*************************************<->************************************* * * FixWindowConfiguration (pCD, pWidth, pHeight, widthInc, heightInc) * * * Description: * ----------- * This function adjusts the configuration for the client window so that * it is in line with the client window's sizing constraints. * * * Inputs: * ------ * pCD = a pointer to the client window data * pWidth, pHeight = pointers to the window configuration values * widthInc, heightInc = window size increment values * * * Outputs: * ------- * pWidth, pHeight = adjusted configuration values are returned here * * *************************************<->***********************************/ void FixWindowConfiguration (ClientData *pCD, unsigned int *pWidth, unsigned int *pHeight, unsigned int widthInc, unsigned int heightInc) { register int delta; /* * Make sure we're on width/height increment boundaries. */ if ((int) *pWidth < pCD->minWidth) { *pWidth = pCD->minWidth; } else if ((delta = (*pWidth - pCD->baseWidth) % pCD->widthInc)) { *pWidth -= delta; } if ((int) *pHeight < pCD->minHeight) { *pHeight = pCD->minHeight; } else if ((delta = (*pHeight - pCD->baseHeight) % pCD->heightInc)) { *pHeight -= delta; } /* * Constrain size within bounds. */ FixWindowSize (pCD, pWidth, pHeight, widthInc, heightInc); } /* END OF FUNCTION FixWindowConfiguration */ /*************************************<->************************************* * * FixWindowSize (pCD, pWidth, pHeight, widthInc, heightInc) * * * Description: * ----------- * This function adjusts the client window width and height so that * it is in line with its sizing constraints. * * * Inputs: * ------ * pCD = a pointer to the client window data * pWidth, pHeight = pointers to the window size values * widthInc, heightInc = window size increment values * pWS->limitResize * * * Outputs: * ------- * pWidth, pHeight = adjusted size values. * * *************************************<->***********************************/ void FixWindowSize (ClientData *pCD, unsigned int *pWidth, unsigned int *pHeight, unsigned int widthInc, unsigned int heightInc) { register int deltaW; register int deltaH; WmScreenData *pSD = pCD->pSD; /* * All occurances of maxHeight and maxWidth in this routing has been * hacked to use maxHeightLimit and maxWidthLimit as the real max when * maximumClientSize is set to 'horizontal' or 'vertical', since * pCD->maxHeight and pCD->maxWidth is fiddle to on reconfiguration. */ if ((int) *pWidth < pCD->minWidth) { *pWidth = pCD->minWidth; } else if (*pWidth > pCD->maxWidthLimit && pSD->limitResize && !(pCD->clientFlags & CLIENT_WM_CLIENTS)) { *pWidth = pCD->maxWidthLimit; } if ((int) *pHeight < pCD->minHeight) { *pHeight = pCD->minHeight; } else if (*pHeight > pCD->maxHeightLimit && pSD->limitResize && !(pCD->clientFlags & CLIENT_WM_CLIENTS)) { *pHeight = pCD->maxHeightLimit; } if ((pCD->sizeFlags & P_ASPECT) && *pWidth * pCD->maxAspect.y > *pHeight * pCD->maxAspect.x) /* * Client aspect is too big. * Candidate height >= client height: * Try to increase the client's height without violating bounds. * If this fails, use maximum height and try to decrease its width. * Candidate height < client height: * Try to decrease the client's width without violating bounds. * If this fails, use minimum width and try to increase its height. */ { if ((*pHeight >= pCD->clientHeight) || (*pWidth > pCD->clientWidth)) /* * Candidate height >= client height: * Try to increase the client's height without violating bounds. * If this fails, use maximum height and try to decrease its width. */ { deltaH = makemult (*pWidth * pCD->maxAspect.y / pCD->maxAspect.x - *pHeight, heightInc); if (*pHeight + deltaH <= pCD->maxHeightLimit || !pSD->limitResize || pCD->clientFlags & CLIENT_WM_CLIENTS) { *pHeight += deltaH; } else { *pHeight = pCD->maxHeightLimit; deltaW = makemult (*pWidth - *pHeight * pCD->maxAspect.x / pCD->maxAspect.y, widthInc); if (*pWidth - deltaW >= pCD->minWidth) { *pWidth -= deltaW; } else { *pWidth = pCD->minWidth; } } } else /* * Candidate height < client height and candidate width <= client width. * Try to decrease the client's width without violating bounds. * If this fails, use minimum width and try to increase its height. */ { deltaW = makemult (*pWidth - *pHeight * pCD->maxAspect.x / pCD->maxAspect.y, widthInc); if (*pWidth - deltaW >= pCD->minWidth) { *pWidth -= deltaW; } else { *pWidth = pCD->minWidth; deltaH = makemult (*pWidth * pCD->maxAspect.y / pCD->maxAspect.x - *pHeight, heightInc); if (*pHeight + deltaH <= pCD->maxHeightLimit || !pSD->limitResize || pCD->clientFlags & CLIENT_WM_CLIENTS) { *pHeight += deltaH; } else { *pHeight = pCD->maxHeightLimit; } } } } else if ((pCD->sizeFlags & P_ASPECT) && *pHeight * pCD->minAspect.x > *pWidth * pCD->minAspect.y) /* * Client aspect is too small. * Candidate width >= client width: * Try to increase the client's width without violating bounds. * If this fails, use maximum width and try to decrease its height. * Candidate width < client width: * Try to decrease the client's height without violating bounds. * If this fails, use minimum height and try to increase its width. */ { if ((*pWidth >= pCD->clientWidth) || (*pHeight > pCD->clientHeight)) /* * Candidate width >= client width: * Try to increase the client's width without violating bounds. * If this fails, use maximum width and try to decrease its height. */ { deltaW = makemult (*pHeight * pCD->minAspect.x / pCD->minAspect.y - *pWidth, widthInc); if (*pWidth + deltaW <= pCD->maxWidthLimit || !pSD->limitResize || pCD->clientFlags & CLIENT_WM_CLIENTS) { *pWidth += deltaW; } else { *pWidth = pCD->maxWidthLimit; deltaH = makemult (*pHeight - *pWidth * pCD->minAspect.y / pCD->minAspect.x, heightInc); if (*pHeight - deltaH >= pCD->minHeight) { *pHeight -= deltaH; } else { *pHeight = pCD->minHeight; } } } else /* * Candidate width < client width and Candidate height <= client height: * Try to decrease the client's height without violating bounds. * If this fails, use minimum height and try to increase its width. */ { deltaH = makemult (*pHeight - *pWidth * pCD->minAspect.y / pCD->minAspect.x, heightInc); if (*pHeight - deltaH >= pCD->minHeight) { *pHeight -= deltaH; } else { *pHeight = pCD->minHeight; deltaW = makemult (*pHeight * pCD->minAspect.x / pCD->minAspect.y - *pWidth, widthInc); if (*pWidth + deltaW <= pCD->maxWidthLimit || !pSD->limitResize || pCD->clientFlags & CLIENT_WM_CLIENTS) { *pWidth += deltaW; } else { *pWidth = pCD->maxWidthLimit; } } } } } /* END OF FUNCTION FixWindowSize */ /*************************************<->************************************* * * FindClientPlacement (pCD) * * * Description: * ----------- * This function finds a position for the client window on the screen. * Windows positions are stepped down the screen. An attempt is made * to keep windows from being clipped by the edge of the screen. * * * Inputs: * ------ * pCD = pointer to client data (client window configuration fields) * * * Outputs: * ------- * pCD = changes to the client window configuration fields * *************************************<->***********************************/ void FindClientPlacement (ClientData *pCD) { static Boolean clientPlacementInitialized = False; static int clientPlacementOffset; static int clientPlacementX; static int clientPlacementY; static int clientPlacementOrigin; static int clientPlacementXOrigin; Boolean placed = False; int frameWidth; int frameHeight; int screenWidth; int screenHeight; int borderWidth = 0; Boolean offScreenX; Boolean offScreenY; if (!clientPlacementInitialized) { if (pCD->clientDecoration & WM_DECOR_RESIZEH) { borderWidth = ((RESIZE_BORDER_WIDTH(pCD) > FRAME_BORDER_WIDTH(pCD)) ? RESIZE_BORDER_WIDTH(pCD) : FRAME_BORDER_WIDTH(pCD)); } else { borderWidth = pCD->matteWidth; } clientPlacementOffset = TitleTextHeight(pCD) + borderWidth; clientPlacementOrigin = clientPlacementOffset; clientPlacementX = clientPlacementOrigin; clientPlacementY = clientPlacementOrigin; clientPlacementXOrigin = clientPlacementX; clientPlacementInitialized = True; } frameWidth = pCD->clientWidth + (2 * pCD->clientOffset.x); frameHeight = pCD->clientHeight + pCD->clientOffset.y + pCD->clientOffset.x; screenWidth = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)); screenHeight = DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pCD)); while (!placed) { if ((clientPlacementX - pCD->clientOffset.x + frameWidth) > screenWidth) { offScreenX = True; } else { offScreenX = False; } if ((clientPlacementY - pCD->clientOffset.y + frameHeight) > screenHeight) { offScreenY = True; } else { offScreenY = False; } if (offScreenX || offScreenY) { if (clientPlacementX == clientPlacementOrigin) { /* * Placement location is already as far to the NW as it is * going to go. */ placed = True; } else if (clientPlacementY == clientPlacementOrigin) { /* * Placement location is as far to the N as it is going to go. * Use the current placement if the window is not off the * screen in the x coordinate otherwise reset the placement * back to the NW origin. */ if (offScreenX) { clientPlacementXOrigin = clientPlacementOrigin; clientPlacementX = clientPlacementXOrigin; } placed = True; } else { /* * If window is off the right edge of screen, just move * window in the X direction onto screen. Process similarly * for windows that are off the bottom of the screen. */ if (offScreenX && !offScreenY) { clientPlacementX = clientPlacementOrigin; } else if (offScreenY && !offScreenX) { clientPlacementY = clientPlacementOrigin; } else { /* * Reset the placement location back to the NW of the * current location. Go as far N as possible and step the * x coordinate to the E. */ clientPlacementXOrigin += clientPlacementOffset; clientPlacementX = clientPlacementXOrigin; clientPlacementY = clientPlacementOrigin; } } } else { placed = True; } } /* * The window has been placed, now update the placement information. */ pCD->clientX = clientPlacementX; pCD->clientY = clientPlacementY; clientPlacementX += clientPlacementOffset; if (clientPlacementX >= screenWidth) { clientPlacementXOrigin = clientPlacementOrigin; clientPlacementX = clientPlacementXOrigin; } clientPlacementY += clientPlacementOffset; /* * Reset Y position to top of screen so that windows start new column of * placement that is offset from the previous column. Previously, the new * column was place right over the old column, obscuring it. * NOTE: column == diagonal */ if (clientPlacementY >= (screenHeight / 3)) { clientPlacementY = clientPlacementOrigin; } } /* END OF FUNCTION FindClientPlacement */ /*************************************<->************************************* * * WmGetWindowAttributes (window) * * * Description: * ----------- * This function gets window attributes if necessary and saves them in the * global window attribute cache. If the window attributes are already * there then no X call is made. * * * Inputs: * ------ * window = get attributes for window with this id * * * Outputs: * ------- * wmGD.attributesWindow = set to window that matches windowAttributes * * wmGD.windowAttributes = XWindowAttributes of window * * * Comments: * -------- * The attributes in the global cache are (known) current only for a * single pass through the wm event processing loop. They (should be) * regularly cleared. * *************************************<->***********************************/ Boolean WmGetWindowAttributes (Window window) { if (wmGD.attributesWindow != window) { if (!XGetWindowAttributes (DISPLAY, window, &wmGD.windowAttributes)) { /* * Cannot get window attributes. */ wmGD.attributesWindow = (Window)0L; return (False); } wmGD.attributesWindow = window; } return (True); } /* END OF FUNCTION WmGetWindowAttributes */ /*************************************<->************************************* * * SetupClientIconWindow (pCD, window) * * * Description: * ----------- * This function prepares a client supplied icon window for insertion into * a window manager icon frame. * * * Inputs: * ------ * pCD = pointer to client data * * window = client supplied icon window * * * Outputs: * ------- * pCD = (iconWindow) * * Return = True if the icon window can be used * *************************************<->***********************************/ Boolean SetupClientIconWindow (ClientData *pCD, Window window) { ClientData *pcd; /* * Check to see if the icon window can be used (i.e there is no conflict * of interest. */ if (!XFindContext (DISPLAY, window, wmGD.windowContextType, (caddr_t *)&pcd)) { if (window == pCD->client) { /* * The proposed icon window is the same as the client! */ return (False); } /* * The proposed icon window is already being managed. * Assume that we managed it by mistake. Unmanage the * window and use it as the icon window for this client. */ UnManageWindow (pcd); } /* update client data */ pCD->iconWindow = window; /* put in window manager's save set */ XChangeSaveSet (DISPLAY, pCD->iconWindow, SetModeInsert); pCD->clientFlags |= ICON_IN_SAVE_SET; return (True); } /* END OF FUNCTION SetupClientIconWindow */ /*************************************<->************************************* * * ProcessMwmHints (pCD) * * * Description: * ----------- * Process the _MWM_HINTS property on the window (if any). Setup the * applicable function and decoration masks. * * * Inputs: * ------ * pCD = pointer to client data * * * Outputs: * ------- * pCD = may be changed. * *************************************<->***********************************/ void ProcessMwmHints (ClientData *pCD) { PropMwmHints *pHints; /* * Fix the client functions and decorations fields if they have * default resource values. */ if (pCD->clientFunctions & WM_FUNC_DEFAULT) { if (pCD->clientFlags & CLIENT_TRANSIENT) { pCD->clientFunctions = TRANSIENT_FUNCTIONS(pCD); } else { pCD->clientFunctions = WM_FUNC_ALL; } #ifdef PANELIST if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) { pCD->clientFunctions &= WM_FUNC_SUBPANEL_DEFAULT; pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; } else if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_PANEL) { pCD->clientFunctions &= WM_FUNC_PANEL_DEFAULT; pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; } #endif /* PANELIST */ } if (pCD->clientDecoration & WM_DECOR_DEFAULT) { if (pCD->clientFlags & CLIENT_TRANSIENT) { pCD->clientDecoration = TRANSIENT_DECORATION(pCD); } else { pCD->clientDecoration = WM_DECOR_ALL; } #ifdef PANELIST if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) { pCD->clientDecoration = pCD->pSD->subpanelDecoration; } else if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_PANEL) { pCD->clientDecoration &= WM_DECOR_PANEL_DEFAULT; } #endif /* PANELIST */ } /* * Retrieve the _MWM_HINTS property if it exists. */ pCD->inputMode = MWM_INPUT_MODELESS; if ((pHints = GetMwmHints (pCD)) != NULL) { if (pHints->flags & MWM_HINTS_FUNCTIONS) { if (pHints->functions & MWM_FUNC_ALL) { /* client indicating inapplicable functions */ pCD->clientFunctions &= ~(pHints->functions); } else { /* client indicating applicable functions */ pCD->clientFunctions &= pHints->functions; } #if 0 if (!(pCD->clientFlags & GOT_DT_WM_HINTS) && !pHints->functions) { /* * !!! Backward compatibility heurisitic !!! * * If client doesn't want any functions and * no DT_WM_HINTS specified, then remove * workspace functions. */ pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; } #endif /* !!! check for some minimal level of functionality? !!! */ } if (pHints->flags & MWM_HINTS_DECORATIONS) { if (pHints->decorations & MWM_DECOR_ALL) { /* client indicating decorations to be removed */ pCD->clientDecoration &= ~(pHints->decorations); } else { /* client indicating decorations to be added */ pCD->clientDecoration &= pHints->decorations; } /* * Fix up decoration configuration. */ if (pCD->clientDecoration & (MWM_DECOR_MENU | MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE)) { pCD->clientDecoration |= MWM_DECOR_TITLE; } if (pCD->clientDecoration & MWM_DECOR_RESIZEH) { pCD->clientDecoration |= MWM_DECOR_BORDER; } } if (pHints->flags & MWM_HINTS_INPUT_MODE) { if ((pHints->inputMode == MWM_INPUT_PRIMARY_APPLICATION_MODAL) || (pHints->inputMode == MWM_INPUT_FULL_APPLICATION_MODAL) || ((pHints->inputMode == MWM_INPUT_SYSTEM_MODAL) && !wmGD.systemModalActive)) { pCD->inputMode = pHints->inputMode; } /* * Don't allow a system modal window to be a secondary window * (except with respect to applicable functions and frame * decorations). Also, don't allow system modal window to * be minimized. */ if (pCD->inputMode == MWM_INPUT_SYSTEM_MODAL) { pCD->transientLeader = NULL; if (pCD->clientFunctions & MWM_FUNC_MINIMIZE) { pCD->clientFunctions &= ~(MWM_FUNC_MINIMIZE); } } } if (pHints->flags & MWM_HINTS_STATUS) { pCD->window_status = pHints->status; } XFree ((char*)pHints); } #ifndef NO_OL_COMPAT else { ProcessOLDecoration (pCD); } #endif /* NO_OL_COMPAT */ #ifdef WSM /* * If primary window can't move between workspaces, then * secondary window shouldn't either. */ if (pCD->transientLeader && !(pCD->transientLeader->dtwmFunctions & DtWM_FUNCTION_OCCUPY_WS)) { pCD->dtwmFunctions &= ~DtWM_FUNCTION_OCCUPY_WS; } #endif /* WSM */ /* * Fix up functions based on system modal settings. System modal * windows and their descendents cannot be minimized. */ if (!((FindTransientTreeLeader (pCD))->clientFunctions&MWM_FUNC_MINIMIZE)) { pCD->clientFunctions &= ~MWM_FUNC_MINIMIZE; } /* * Fix up decoration configuration based on applicable functions. */ if (!(pCD->clientFunctions & MWM_FUNC_RESIZE)) { pCD->clientDecoration &= ~MWM_DECOR_RESIZEH; } if (!(pCD->clientFunctions & MWM_FUNC_MINIMIZE)) { pCD->clientDecoration &= ~MWM_DECOR_MINIMIZE; } if (!(pCD->clientFunctions & MWM_FUNC_MAXIMIZE)) { pCD->clientDecoration &= ~MWM_DECOR_MAXIMIZE; } pCD->decor = pCD->clientDecoration; /* !!! combine decor ... !!! */ } /* END OF ProcessMwmHints */ motif-2.3.8/clients/mwm/WmGraphics.c0000644000175000017500000007261413145162623014251 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmGraphics.c /main/4 1995/11/01 11:38:53 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include #include #include #include #include #include #include #define RLIST_EXTENSION_SIZE 10 #ifndef MIN #define MAX(x,y) ((x)>(y)?(x):(y)) #endif /* * include extern functions */ #include "WmGraphics.h" #include "WmError.h" /* * Global Variables: */ /* * Macros: */ /* test if > 0 and return 1 if true, 0 if false. */ #define GE1(x) ((x)>0?1:0) /*************************************<->************************************* * * Procedure: BevelRectangle (prTop, prBot, x, y, * width, height, top_wid, right_wid, bot_wid, left_wid) * * Description: * ----------- * Generate data for top- and bottom-shadow bevels on a box. * * Inputs: * ------ * prTop - ptr to top shadow RList * prBot - ptr to bottom shadow RList * x,y - position of rectangle to bevel * width - (outside) width of rectangle * height - (outside) height of rectangle * top_wid - width of beveling on top side of rectangle * right_wid - width of beveling on right side of rectangle * bot_wid - width of beveling on bottom side of rectangle * left_wid - width of beveling on left side of rectangle * * Outputs: * ------- * prTop - top shadows for this rectangle added to list * prBot - bottom shadows for this rectangle added to list * * * Comments: * -------- * *************************************<->***********************************/ void BevelRectangle (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height, unsigned int top_wid, unsigned int right_wid, unsigned int bot_wid, unsigned int left_wid) { XRectangle *prect; /* pointer to "current" rectangle */ register int count; /* counter used for beveling operation */ int join1, join2; /* used to compute "good" bevel joints */ int x1, y1, len; /* used to compute bevel parameters */ int *piTop, *piBot; /* build the rectangles to implement the beveling on each side */ /* top side */ if (((prTop->used + (top_wid + left_wid)) > prTop->allocated) && (!ExtendRList (prTop, MAX (top_wid+left_wid, RLIST_EXTENSION_SIZE)))) { return; /* not enough memory */ } piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); join1 = left_wid; join2 = right_wid; x1 = x; y1 = y; len = width; for (count=top_wid; count>0; count--, prect++, (*piTop)++) { prect->x = x1; prect->y = y1; prect->width = len; prect->height = 1; x1 += GE1(--join1); y1 += 1; len -= GE1(join1) + GE1(--join2); } /* left side */ join1 = top_wid; join2 = bot_wid; x1 = x; y1 = y+GE1(join1); len = height-GE1(join1); for (count=left_wid; count >0; count--, prect++, (*piTop)++) { prect->x = x1; prect->y = y1; prect->width = 1; prect->height = len; x1 += 1; y1 += GE1(--join1); len -= GE1(join1) + GE1(--join2); } /* bottom side */ if (((prBot->used + (bot_wid + right_wid)) > prBot->allocated) && (!ExtendRList(prBot, MAX (bot_wid+right_wid, RLIST_EXTENSION_SIZE)))) { return; } piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); join1 = left_wid; join2 = right_wid; x1 = x+GE1(join1); y1 = y+height-1; len = width-GE1(join1); /* fudge fat bottom shadow to overwrite corner of skinny left shadow */ if (GE1(join1) && (bot_wid > left_wid)) { len++; x1--; join1++; } for (count=bot_wid; count >0; count--, prect++, (*piBot)++) { prect->x = x1; prect->y = y1; prect->width = len; prect->height = 1; x1 += GE1(--join1); y1 -= 1; len -= GE1(join1) + GE1(--join2); } /* right side */ join1 = top_wid; join2 = bot_wid; x1 = x+width-1; y1 = y+GE1(join1); len = height - GE1(join1) - GE1(join2); /* fudge fat right shadow to overwrite corner of skinny top shadow */ if (GE1(join1) && (right_wid > top_wid)) { len++; y1--; join1++; } for (count=right_wid; count >0; count--, prect++, (*piBot)++) { prect->x = x1; prect->y = y1; prect->width = 1; prect->height = len; x1 -= 1; y1 += GE1(--join1); len -= GE1(join1) + GE1(--join2); } } /* END OF FUNCTION BevelRectangle */ /*************************************<->************************************* * * Procedure: BevelDepressedRectangle (prTop, prBot, x, y, * width, height, top_wid, right_wid, bot_wid, left_wid * in_wid) * * Description: * ----------- * Generate data for top- and bottom-shadow bevels on a rectangle with * the center part depressed. * * Inputs: * ------ * prTop - ptr to top shadow RList * prBot - ptr to bottom shadow RList * x,y - position of rectangle to bevel * width - (outside) width of rectangle * height - (outside) height of rectangle * top_wid - width of beveling on top side of rectangle * right_wid - width of beveling on right side of rectangle * bot_wid - width of beveling on bottom side of rectangle * left_wid - width of beveling on left side of rectangle * in_wid - width of depressed beveling inside of rectangle * * Outputs: * ------- * prTop - top shadows for this rectangle added to list * prBot - bottom shadows for this rectangle added to list * * * Comments: * -------- * *************************************<->***********************************/ void BevelDepressedRectangle (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height, unsigned int top_wid, unsigned int right_wid, unsigned int bot_wid, unsigned int left_wid, unsigned int in_wid) { XRectangle *prect; /* pointer to "current" rectangle */ register int count; /* counter used for beveling operation */ int join1, join2; /* used to compute "good" bevel joints */ int x1, y1, len; /* used to compute bevel parameters */ int *piTop, *piBot; /* * Build the rectangles to implement the beveling on each side * First, guarantee that there is enough memory. */ if (((prTop->used + (top_wid + left_wid)) > prTop->allocated) && (!ExtendRList (prTop, MAX (top_wid+left_wid, RLIST_EXTENSION_SIZE)))) { return; /* not enough memory */ } if (((prBot->used + (bot_wid + right_wid)) > prBot->allocated) && (!ExtendRList(prBot, MAX (bot_wid+right_wid, RLIST_EXTENSION_SIZE)))) { return; /* not enought memory */ } /* top side (normal beveling) */ piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); join1 = left_wid; join2 = right_wid; x1 = x; y1 = y; len = width; for (count=top_wid - in_wid; count>0; count--, prect++, (*piTop)++) { prect->x = x1; prect->y = y1; prect->width = len; prect->height = 1; x1 += GE1(--join1); y1 += 1; len -= GE1(join1) + GE1(--join2); } /* top side (inverted beveling) */ piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); for (count=in_wid; count>0; count--, prect++, (*piBot)++) { prect->x = x1; prect->y = y1; prect->width = len; prect->height = 1; x1 += GE1(--join1); y1 += 1; len -= GE1(join1) + GE1(--join2); } /* left side (normal beveling) */ piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); join1 = top_wid; join2 = bot_wid; x1 = x; y1 = y+GE1(join1); len = height-GE1(join1); for (count=left_wid-in_wid; count >0; count--, prect++, (*piTop)++) { prect->x = x1; prect->y = y1; prect->width = 1; prect->height = len; x1 += 1; y1 += GE1(--join1); len -= GE1(join1) + GE1(--join2); } /* left side (inverted beveling) */ piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); for (count=in_wid; count >0; count--, prect++, (*piBot)++) { prect->x = x1; prect->y = y1; prect->width = 1; prect->height = len; x1 += 1; y1 += GE1(--join1); len -= GE1(join1) + GE1(--join2); } /* bottom side (normal beveling) */ piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); join1 = left_wid; join2 = right_wid; x1 = x+GE1(join1); y1 = y+height-1; len = width-GE1(join1); /* fudge fat bottom shadow to overwrite corner of skinny left shadow */ if (GE1(join1) && (bot_wid > left_wid)) { len++; x1--; join1++; } for (count=bot_wid-in_wid; count >0; count--, prect++, (*piBot)++) { prect->x = x1; prect->y = y1; prect->width = len; prect->height = 1; x1 += GE1(--join1); y1 -= 1; len -= GE1(join1) + GE1(--join2); } /* bottom side (inverted beveling) */ piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); for (count=in_wid; count >0; count--, prect++, (*piTop)++) { prect->x = x1; prect->y = y1; prect->width = len; prect->height = 1; x1 += GE1(--join1); y1 -= 1; len -= GE1(join1) + GE1(--join2); } /* right side (normal beveling) */ piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); join1 = top_wid; join2 = bot_wid; x1 = x+width-1; y1 = y+GE1(join1); len = height - GE1(join1) - GE1(join2); /* fudge fat right shadow to overwrite corner of skinny top shadow */ if (GE1(join1) && (right_wid > top_wid)) { len++; y1--; join1++; } for (count=right_wid-in_wid; count >0; count--, prect++, (*piBot)++) { prect->x = x1; prect->y = y1; prect->width = 1; prect->height = len; x1 -= 1; y1 += GE1(--join1); len -= GE1(join1) + GE1(--join2); } /* right side (inverted beveling) */ piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); for (count=in_wid; count >0; count--, prect++, (*piTop)++) { prect->x = x1; prect->y = y1; prect->width = 1; prect->height = len; x1 -= 1; y1 += GE1(--join1); len -= GE1(join1) + GE1(--join2); } } /* END OF FUNCTION BevelDepressedRectangle */ /*************************************<->************************************* * * Procedure: StretcherCorner (prTop, prBot, x, y, cnum, * swidth, cwidth, cheight); * * Description: * ----------- * Generate data to draw a corner of the stretcher border. * * Inputs: * ------ * prTop - ptr to top shadow RList * prBot - ptr to bottom shadow RList * x,y - position of rectangle enclosing the cornern * cnum - corner number; which corner to draw * ASSUMES only NW, NE, SE, SW for mwm () * swidth - width (thickness) of border (includes bevels) * cwidth - corner width from corner to end of horizontal run * cheight - corner height from corner to end of vertical run * * Outputs: * ------- * prTop - array filled in for top shadows * prBot - array filledin for bottom shadows * * Comments: * -------- * o Uses only 1 pixel bevels. Beveling is hard coded. * o XFillRectangles assumed as an optimization to take * advantage of the block mover hardware. * *************************************<->***********************************/ void StretcherCorner (RList *prTop, RList *prBot, int x, int y, int cnum, unsigned int swidth, unsigned int cwidth, unsigned int cheight) { XRectangle *prect; /* pointer to "current" rectangle */ int *piTop, *piBot; switch (cnum) { case STRETCH_NORTH_WEST: if (((prTop->used + 4) > prTop->allocated) && (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); prect->x = x; /* top (row 1) */ prect->y = y; prect->width = cwidth; prect->height = 1; prect++; (*piTop)++; prect->x = x+1; /* top (row 2) */ prect->y = y+1; prect->width = cwidth-2; prect->height = 1; prect++; (*piTop)++; prect->x = x; /* left (col 1) */ prect->y = y+1; prect->width = 1; prect->height = cheight-1; prect++; (*piTop)++; prect->x = x+1; /* left (col 2) */ prect->y = y+2; prect->width = 1; prect->height = cheight-3; (*piTop)++; if (((prBot->used + 4) > prBot->allocated) && (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); /* bottom shadow parts */ prect->x = x+1; /* bottom end */ prect->y = y+cheight-1; prect->width = swidth-1; prect->height = 1; prect++; (*piBot)++; if (wmGD.frameStyle == WmRECESSED) { prect->x = x+swidth-1; /* right inside */ prect->y = y+swidth-1; prect->width = 1; prect->height = cheight-swidth; prect++; (*piBot)++; prect->x = x+swidth; /* bottom inside */ prect->y = y+swidth-1; prect->width = cwidth-swidth; prect->height = 1; prect++; (*piBot)++; } prect->x = x+cwidth-1; /* right end */ prect->y = y+1; prect->width = 1; prect->height = swidth-1-((wmGD.frameStyle == WmSLAB)? 0 : 1); (*piBot)++; break; case STRETCH_NORTH_EAST: if (((prTop->used + 4) > prTop->allocated) && (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); prect->x = x; /* top (row 1) */ prect->y = y; prect->width = cwidth; prect->height = 1; prect++; (*piTop)++; prect->x = x+1; /* top (row 2) */ prect->y = y+1; prect->width = cwidth-2; prect->height = 1; prect++; (*piTop)++; prect->x = x; /* left end */ prect->y = y+1; prect->width = 1; prect->height = swidth-1; prect++; (*piTop)++; if (wmGD.frameStyle == WmRECESSED) { prect->x = x+cwidth-swidth; /* left inside (col 1) */ prect->y = y+swidth; prect->width = 1; prect->height = cheight-swidth; (*piTop)++; } if (((prBot->used + 4) > prBot->allocated) && (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); /* bottom shadow parts */ /* bottom end */ prect->x = x+cwidth-swidth+((wmGD.frameStyle == WmSLAB)? 0 : 1); prect->y = y+cheight-1; prect->width = swidth-((wmGD.frameStyle == WmSLAB)? 0 : 1); prect->height = 1; prect++; (*piBot)++; prect->x = x+cwidth-1; /* right (col 2) */ prect->y = y+1; prect->width = 1; prect->height = cheight-2; prect++; (*piBot)++; prect->x = x+cwidth-2; /* right (col 1) */ prect->y = y+2; prect->width = 1; prect->height = cheight-3; prect++; (*piBot)++; if (wmGD.frameStyle == WmRECESSED) { prect->x = x+1; /* bottom inside (row 2) */ prect->y = y+swidth-1; prect->width = cwidth-swidth; prect->height = 1; (*piBot)++; } break; case STRETCH_SOUTH_EAST: if (((prTop->used + 4) > prTop->allocated) && (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); if (wmGD.frameStyle == WmRECESSED) { prect->x = x; /* top inside */ prect->y = y+cheight-swidth; prect->width = cwidth-swidth+1; prect->height = 1; prect++; (*piTop)++; prect->x = x+cwidth-swidth; /* left inside */ prect->y = y; prect->width = 1; prect->height = cheight-swidth; prect++; (*piTop)++; } /* top end */ prect->x = x+cwidth-swidth+ ((wmGD.frameStyle == WmSLAB)? 0 : 1); prect->y = y; prect->width = swidth-2+((wmGD.frameStyle == WmSLAB)? 1 : 0);; prect->height = 1; prect++; (*piTop)++; prect->x = x; /* left end */ prect->y = y+cheight-swidth+ ((wmGD.frameStyle == WmSLAB)? 0 : 1); prect->width = 1; prect->height = swidth-2+((wmGD.frameStyle == WmSLAB)? 1 : 0); (*piTop)++; if (((prBot->used + 4) > prBot->allocated) && (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); /* bottom shadow parts */ prect->x = x+1; /* bottom - row 1 */ prect->y = y+cheight-2; prect->width = cwidth-1; prect->height = 1; prect++; (*piBot)++; prect->x = x; /* bottom - row 2 */ prect->y = y+cheight-1; prect->width = cwidth; prect->height = 1; prect++; (*piBot)++; prect->x = x+cwidth-2; /* right - column 1 */ prect->y = y+1; prect->width = 1; prect->height = cheight-3; prect++; (*piBot)++; prect->x = x+cwidth-1; /* right - column 2 */ prect->y = y; prect->width = 1; prect->height = cheight-2; (*piBot)++; break; case STRETCH_SOUTH_WEST: if (((prTop->used + 4) > prTop->allocated) && (!ExtendRList (prTop, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piTop = &(prTop->used); prect = &(prTop->prect[*piTop]); prect->x = x; /* top end */ prect->y = y; prect->width = swidth; prect->height = 1; prect++; (*piTop)++; prect->x = x; /* left (col 1) */ prect->y = y+1; prect->width = 1; prect->height = cheight-1; prect++; (*piTop)++; prect->x = x+1; /* left (col 2) */ prect->y = y+1; prect->width = 1; prect->height = cheight-2; prect++; (*piTop)++; if (wmGD.frameStyle == WmRECESSED) { prect->x = x+swidth; /* top inside (row 2) */ prect->y = y+cheight-swidth; prect->width = cwidth-swidth; prect->height = 1; (*piTop)++; } if (((prBot->used + 4) > prBot->allocated) && (!ExtendRList (prBot, (unsigned int) RLIST_EXTENSION_SIZE))) { return; } piBot = &(prBot->used); prect = &(prBot->prect[*piBot]); /* bottom shadow parts */ if (wmGD.frameStyle == WmRECESSED) { prect->x = x+swidth-1; /* right inside (col 2) */ prect->y = y+1; prect->width = 1; prect->height = cheight-swidth; prect++; (*piBot)++; } prect->x = x+cwidth-1; /* right end */ prect->y = y+cheight-swidth+ ((wmGD.frameStyle == WmSLAB)? 0 : 1); prect->width = 1; prect->height = swidth-((wmGD.frameStyle == WmSLAB)? 0 : 1); prect++; (*piBot)++; prect->x = x+2; /* bottom (row 1) */ prect->y = y+cheight-2; prect->width = cwidth-3; prect->height = 1; prect++; (*piBot)++; prect->x = x+1; /* bottom (row 2) */ prect->y = y+cheight-1; prect->width = cwidth-2; prect->height = 1; (*piBot)++; break; } } /* END OF FUNCTION StretcherCorner */ /*************************************<->************************************* * * DrawStringInBox (dpy, win, gc, pbox, str) * * * Description: * ----------- * Draws a null-terminated string inside the specified box (rectangle) * * * Inputs: * ------ * dpy - ptr to Display * win - an X Window * gc - graphics context to use * pfs - pointer to XFontStruct for the font in "gc" * pbox - ptr to XRectangle that encloses text * str - String to write * * Outputs: * ------- * none * * Comments: * -------- * o Assumes 8-bit text for now. * o Algorithm: * get length of String * if String is short than box width then * draw string centered in box * otherwise * draw string left justified and clipped to box * o The clip_x_origin, clip_y_origin, and clip_mask are reset to None * upon exit. * o Due to bugs and / or misunderstanding, I gave up on trying to * extract the XFontStruct from the GC. I just made it a separate * parameter. * *************************************<->***********************************/ void DrawStringInBox (Display *dpy, Window win, GC gc, XFontStruct *pfs, XRectangle *pbox, String str) { XGCValues gcv; int textWidth; int xCenter; XRectangle clipBox; /* compute text position */ textWidth = XTextWidth(pfs, str, strlen(str)); if (textWidth < (int) pbox->width) { /* center text if there's room */ xCenter = (int) pbox->x + ((int) pbox->width - textWidth) / 2 ; WmDrawString(dpy, win, gc, xCenter, (pbox->y + pfs->ascent), str, strlen(str)); } else { /* left justify & clip text */ clipBox.x = 0; /* set up clip rectangle */ clipBox.y = 0; clipBox.width = pbox->width; clipBox.height = pbox->height; XSetClipRectangles (dpy, gc, pbox->x, pbox->y, /* put into gc */ &clipBox, 1, Unsorted); WmDrawString(dpy, win, gc, pbox->x, (pbox->y + pfs->ascent), str, strlen(str)); gcv.clip_x_origin = 0; /* erase clip_mask from gc */ gcv.clip_y_origin = 0; gcv.clip_mask = None; XChangeGC (dpy, gc, GCClipXOrigin | GCClipYOrigin | GCClipMask, &gcv); } } /* END OF FUNCTION DrawStringInBox */ /*************************************<->************************************* * * ExtendRList (prl, amt) * * * Description: * ----------- * Extends the size of the RList * * * Inputs: * ------ * prl - ptr to Display * amt - how much to extend it by * * Outputs: * ------- * Returns True if succeeded, false otherwise. * * Comments: * -------- * *************************************<->***********************************/ Boolean ExtendRList (RList *prl, unsigned int amt) { unsigned int total, count; XRectangle *pNewRect; Boolean rval; total = prl->allocated + amt; if ( (pNewRect = (XRectangle *) XtMalloc (total * sizeof(XRectangle))) == NULL) { Warning (((char *)GETMESSAGE(28, 1, "Insufficient memory for graphics data"))); rval = False; } else { prl->allocated = total; rval = True; if (prl->used != 0) { /* copy from old structure */ count = prl->used * sizeof(XRectangle); (void) memcpy ((void *)pNewRect, (void *)prl->prect, count); if (prl->prect != NULL) XtFree ((char *)prl->prect); prl->prect = pNewRect; } } return (rval); } /* END OF FUNCTION ExtendRList */ /*************************************<->************************************* * * AllocateRList (amt) * * * Description: * ----------- * Allocates an RList of size "amt" * * * Inputs: * ------ * amt - number of XRectangles to allocate in list * * Outputs: * ------- * Returns ptr to new RList structure if success, returns NULL ptr otherwise * * Comments: * -------- * *************************************<->***********************************/ RList *AllocateRList (amt) unsigned int amt; { RList *prl; if ((prl = (RList *) XtMalloc (sizeof (RList))) != NULL) { if ( (prl->prect = (XRectangle *) XtMalloc (amt * sizeof(XRectangle))) == NULL) { XtFree ((char *)prl); prl = NULL; } else { prl->allocated = amt; prl->used = 0; } } return (prl); } /* END OF FUNCTION AllocateRList */ /*************************************<->************************************* * * FreeRList (prl) * * * Description: * ----------- * Frees an RList * * * Inputs: * ------ * prl - ptr to RList to free * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void FreeRList (RList *prl) { if (prl) { if (prl->prect) XtFree ((char *)prl->prect); XtFree ((char *)prl); } }/* END OF FUNCTION FreeRList */ /*************************************<->************************************* * * WmDrawString * * * Description: * ----------- * Draws a string * * * Inputs: * ------ * (same parameters used by XDrawString and XDrawImageString) * * Outputs: * ------- * * Comments: * -------- * o If wmGD.cleanText is True, then the text is drawn using * XDrawImageString. This provides some clean space around the text * if the background area is stippled -- especially useful on * B/W displays. * *************************************<->***********************************/ void WmDrawString (Display *dpy, Drawable d, GC gc, int x, int y, char *string, unsigned int length) { if (ACTIVE_PSD->cleanText) { XDrawImageString(dpy, d, gc, x, y, string, length); } else { XDrawString(dpy, d, gc, x, y, string, length); } }/* END OF FUNCTION WmDrawString */ /*************************************<->************************************* * * WmXmDrawString * * * Description: * ----------- * Draws a string * * * Inputs: * ------ * (subset of parameters used by XmStringDraw and XmStringDrawImage) * * Outputs: * ------- * * Comments: * -------- * o If wmGD.cleanText is True, then the text is drawn using * XmStringDrawImage. This provides some clean space around the text * if the background area is stippled -- especially useful on * B/W displays. * *************************************<->***********************************/ #ifdef WSM void WmDrawXmString (Display *dpy, Window w, XmFontList xmfontlist, XmString xmstring, GC gc, Position x, Position y, Dimension width, XRectangle *pbox, Boolean bCenter) #else /* WSM */ void WmDrawXmString (Display *dpy, Window w, XmFontList xmfontlist, XmString xmstring, GC gc, Position x, Position y, Dimension width, XRectangle *pbox) #endif /* WSM */ { Dimension textWidth; #ifdef WSM int alignment; #else /* WSM */ int alignment = XmALIGNMENT_BEGINNING; #endif /* WSM */ textWidth = XmStringWidth(xmfontlist, xmstring); #ifdef WSM alignment = bCenter ? XmALIGNMENT_CENTER : XmALIGNMENT_BEGINNING; if (textWidth >= pbox->width) /* can't center text if no room */ { /* left justify & clip text */ alignment = XmALIGNMENT_BEGINNING; } #else /* WSM */ if (textWidth < pbox->width) { /* center text if there's room */ alignment = XmALIGNMENT_CENTER; } else { /* left justify & clip text */ alignment = XmALIGNMENT_BEGINNING; } #endif /* WSM */ if (ACTIVE_PSD->cleanText) { XmStringDrawImage(dpy, w, xmfontlist, xmstring, gc, x, y, width, alignment, XmSTRING_DIRECTION_L_TO_R, pbox); } else { XmStringDraw (dpy, w, xmfontlist, xmstring, gc, x, y, width, alignment, XmSTRING_DIRECTION_L_TO_R, pbox); } } /* END OF FUNCTION WmDrawXmString */ #ifdef WSM /*************************************<->************************************* * * WmInstallBitmapIntoXmCache (pchName, bitmap, width, height) * * * Description: * ----------- * Installs all or part of a pixmap into the Xm cache. This pixmap * may be retrieved later by a call to XmGetPixmap. * * Inputs: * ------ * pchName = pointer to name of bitmap * bitmap = depth-1 pixmap * width = width of portion to install * height = height of portion to install * * Outputs: * ------- * none * * Comments: * -------- * This always installs the Northwest corner of the passed in bitmap. * If the width and height match the size of the bitmap, then the * whole thing is installed in the cache. * *************************************<->***********************************/ void WmInstallBitmapIntoXmCache (unsigned char *pchName, Pixmap bitmap, unsigned int width, unsigned int height) { XImage *pImage; pImage = XGetImage (DISPLAY, bitmap, 0, 0, width, height, 1L, XYBitmap); XmInstallImage (pImage, (char *)pchName); } /* END OF FUNCTION WmInstallBitmapIntoXmCache */ /*************************************<->************************************* * * WmInstallBitmapDataIntoXmCache (pSD, pchName, pData) * * * Description: * ----------- * Installs built-in bitmap data into the Xm Pixmap cache. The image * may be retrieved later by a call to XmGetPixmap. * * Inputs: * ------ * pSD = pointer to screen data * pchName = pointer to name of bitmap * pData = pointer to the bitmap data * * Outputs: * ------- * none * * Comments: * -------- * This is principally for putting built-in pixmap data into the Xm * cache to allow for uniform access to pixmap creation. * * ***WARNING*** * Do NOT call XmDestroyPixmap on images cached via this routine unless * pData passed in points to malloc'ed memory. XmDestroyPixmap could * try to free this data. * *************************************<->***********************************/ void WmInstallBitmapDataIntoXmCache (WmScreenData *pSD, unsigned char *pchName, char *pData, unsigned int width, unsigned int height) { XImage *pImage; if (pImage = (XImage *) XtMalloc (sizeof (XImage))) { pImage->width = width; pImage->height = height; pImage->xoffset = 0; pImage->data = pData; pImage->format = XYBitmap; pImage->byte_order = MSBFirst; pImage->bitmap_pad = 8; pImage->bitmap_bit_order = LSBFirst; pImage->bitmap_unit = 8; pImage->depth = 1; pImage->bytes_per_line = (width/8) + ((width%8) != 0 ? 1 : 0); pImage->obdata = NULL; XmInstallImage(pImage, (char *)pchName); } } /* END OF FUNCTION WmInstallBitmapDataIntoXmCache */ #endif /* WSM */ motif-2.3.8/clients/mwm/WmProtocol.h0000644000175000017500000000254113145162623014307 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void SetupWmICCC (void); extern void SendConfigureNotify (ClientData *pCD); extern void SendClientOffsetMessage (ClientData *pCD); extern void SendClientMsg (Window window, long type, long data0, Time time, long *pData, int dataLen); extern Boolean AddWmTimer (unsigned int timerType, unsigned long timerInterval, ClientData *pCD); extern void DeleteClientWmTimers (ClientData *pCD); extern void TimeoutProc (caddr_t client_data, XtIntervalId *id); motif-2.3.8/clients/mwm/WmKeyFocus.c0000644000175000017500000010445313145162623014236 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmKeyFocus.c /main/5 1996/05/17 12:53:16 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" /* * include extern functions */ #include "WmKeyFocus.h" #include "WmCDecor.h" #include "WmColormap.h" #include "WmEvent.h" #include "WmCEvent.h" #include "WmFunction.h" #include "WmIDecor.h" #include "WmProtocol.h" #include "WmWinInfo.h" #include "WmWinList.h" /* * Global Variables: */ static Boolean removeSelectGrab = True; /*************************************<->************************************* * * InitKeyboardFocus () * * * Description: * ----------- * This function sets the keyboard input focus to a client window or icon * when the window manager starts up. * * * Inputs: * ------ * wmGD = (keyboardFocusPolicy, colormapFocusPolicy) * *************************************<->***********************************/ void InitKeyboardFocus (void) { ClientData *pCD; Boolean sameScreen; Boolean focusSet = False; int scr; int junk; Window junk_win, root_returned; int currentX, currentY; /* * Set the keyboard focus based on the keyboard focus policy. */ wmGD.keyboardFocus = NULL; wmGD.nextKeyboardFocus = NULL; for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { wmGD.Screens[scr].focusPriority = 0; if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) { /* * Set the keyboard focus to the window that * currently contains the pointer. */ pCD = GetClientUnderPointer (&sameScreen); if (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER) { /* * Do some colormap installation that has been * deferred from the InitColormapFocus routine. */ SetColormapFocus (ACTIVE_PSD, pCD); } if (pCD) { Do_Focus_Key (pCD, GetTimestamp (), ALWAYS_SET_FOCUS); focusSet = True; } } else { ButtonSpec *buttonSpec; /* * Prepare to do explicit selection button grabs. */ buttonSpec = wmGD.Screens[scr].buttonSpecs; while (buttonSpec) { if ((buttonSpec->button == FOCUS_SELECT_BUTTON) && (buttonSpec->context & F_CONTEXT_WINDOW) && (buttonSpec->subContext & F_SUBCONTEXT_W_CLIENT)) { if (buttonSpec->state == 0) { removeSelectGrab = False; } } buttonSpec = buttonSpec->nextButtonSpec; } } } } if (!focusSet) { /* * This is keyboard focus policy is either "explicit" or it it * "pointer" * and there is no window under the pointer. No window currently has * the keyboard input focus. Set the keyboard focus to the window * manager default (non-client) OR to the last client with focus. * * In Mwm 1.1.4 and later, calling Do_Focus_Key with NULL will try * to find a 'reasonable' window to put focus. This means that on * startup and restarts, a Mwm window will have focus! Yeah! */ /* * Set Active Screen First */ if (XQueryPointer(DISPLAY, DefaultRootWindow(DISPLAY), &root_returned, &junk_win, ¤tX, ¤tY, &junk, &junk, (unsigned int *)&junk)) { for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed && wmGD.Screens[scr].rootWindow == root_returned) { SetActiveScreen(&(wmGD.Screens[scr])); break; } } } Do_Focus_Key ((ClientData *)NULL, CurrentTime, ALWAYS_SET_FOCUS); } } /* END OF FUNCTION InitKeyboardFocus */ /*************************************<->************************************* * * SetKeyboardFocus (pCD, focusFlags) * * * Description: * ----------- * This function is used to handle a client window getting the input * focus (as the RESULT of an XSetInput call - probably done by * Do_Focus_Key). * * * Inputs: * ------ * pCD = pointer to client data for window that is to get the focus * * focusFlags = flags that indicate focus change details * {REFRESH_LAST_FOCUS} * * * Outputs: * ------- * wmGD = (keyboardFocus) * *************************************<->***********************************/ void SetKeyboardFocus (ClientData *pCD, long focusFlags) { ClientData *currentFocus; /* * Don't set the keyboard input focus if it is already set to * the client window. */ if (wmGD.keyboardFocus == pCD) { return; } currentFocus = wmGD.keyboardFocus; ACTIVE_PSD->focusPriority++; /* * If the keyboard input focus policy is "explicit" then reset the * selection button event handling. */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { /* * Reset explicit focus selection event tracking on the last focus * window (reset the passive grab on the focus button). */ if (currentFocus) { ResetExplicitSelectHandling (currentFocus); wmGD.keyboardFocus = NULL; } if (pCD && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { /* * The focus is to be set to a client window (not the root). * Stop explicit focus selection event tracking on the new focus * window. */ if (removeSelectGrab) { WmUngrabButton (DISPLAY, FOCUS_SELECT_BUTTON, 0, pCD->clientBaseWin); } } } wmGD.keyboardFocus = pCD; /* * Do focus auto raise if specified. */ if (pCD && pCD->focusAutoRaise) { if (wmGD.autoRaiseDelay && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER)) { AddWmTimer (TIMER_RAISE, (unsigned long)wmGD.autoRaiseDelay, pCD); } else { Boolean sameScreen; if (((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) && (!pCD->focusAutoRaiseDisabled)) || ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) && (pCD == GetClientUnderPointer (&sameScreen)))) { Do_Raise (pCD, (ClientListEntry *)NULL, STACK_NORMAL); } } } /* * Clear the focus indication if it is set for a client window or icon. */ if (currentFocus) { ClearFocusIndication (currentFocus, ((focusFlags & REFRESH_LAST_FOCUS) ? True : False)); } /* * Install the client window colormap if the colormap focus policy is * "keyboard". */ if ((wmGD.colormapFocusPolicy == CMAP_FOCUS_KEYBOARD) && (!(focusFlags & SCREEN_SWITCH_FOCUS))) { SetColormapFocus (ACTIVE_PSD, pCD); } /* * Set the focus window or icon visual indication. */ if (pCD) { pCD->focusPriority = ACTIVE_PSD->focusPriority; SetFocusIndication (pCD); } } /* END OF FUNCTION SetKeyboardFocus */ /*************************************<->************************************* * * ResetExplicitSelectHandling (pCD) * * * Description: * ----------- * This function resets the selection button event handling for a client * window or icon. This applies only if the keyboard focus policy is * "explicit". * * * Inputs: * ------ * pCD = pointer to client data for window that has focus handling reset * *************************************<->***********************************/ void ResetExplicitSelectHandling (ClientData *pCD) { #ifdef WSM Boolean bUnseen; bUnseen = (pCD->clientState & UNSEEN_STATE) ? True : False; if (bUnseen) pCD->clientState &= ~UNSEEN_STATE; #endif /* WSM */ if ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE)) { /* * A client window was selected. */ DoExplicitSelectGrab (pCD->clientBaseWin); } else if (pCD->clientState == MINIMIZED_STATE) { /* * An icon was selected. */ /* !!! grab reset if client icon window? !!! */ } #ifdef WSM if (bUnseen) pCD->clientState |= UNSEEN_STATE; #endif /* WSM */ } /* END OF FUNCTION ResetExplicitSelectHandling */ /*************************************<->************************************* * * DoExplicitSelectGrab (window) * * * Description: * ----------- * This function is used to do a grab button on the specified window. The * grab is intended to catch the keyboard focus select button. * * * Inputs: * ------ * widow = grab widow for the select button * *************************************<->***********************************/ void DoExplicitSelectGrab (Window window) { WmGrabButton (DISPLAY, FOCUS_SELECT_BUTTON, 0, window, False, ButtonReleaseMask, GrabModeSync, GrabModeSync, None, None); } /* END OF FUNCTION DoExplicitSelectGrab */ /*************************************<->************************************* * * SetFocusIndication (pCD) * * * Description: * ----------- * This function changes the client window or icon decoration to have it * indicate that the window or icon has the keyboard input focus. * * * Inputs: * ------ * pCD = pointer to client data for window/icon that is getting the focus * * *************************************<->***********************************/ void SetFocusIndication (ClientData *pCD) { ClientData *saveCD; /* * Set the "focus" to pCD to insure correct display of the frame * This is necessary because the called routines get GCs based * on the current keyboard focus. */ saveCD = wmGD.keyboardFocus; wmGD.keyboardFocus = pCD; if ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE)) { /* * A client window has the input focus. */ ShowActiveClientFrame (pCD); } else if (pCD->clientState == MINIMIZED_STATE) { /* * An icon has the input focus. */ ShowActiveIcon (pCD); } /* restore old keyboard focus */ wmGD.keyboardFocus = saveCD; } /* END OF FUNCTION SetFocusIndication */ /*************************************<->************************************* * * ClearFocusIndication (pCD, refresh) * * * Description: * ----------- * This function changes the client window or icon decoration to have it * indicate that the window or icon does not have the keyboard input focus * (i.e. it is inactive). * * * Inputs: * ------ * pCD = pointer to client data for window/icon that is losing the focus * * refresh = True if window/icon frame is to redrawn * *************************************<->***********************************/ void ClearFocusIndication (ClientData *pCD, Boolean refresh) { ClientData *saveCD; #ifdef WSM Boolean bUnseen; #endif /* WSM */ /* * Set the "focus" to NULL to insure correct display of the frame * This is necessary because the called routines get GCs based * on the current keyboard focus. */ saveCD = wmGD.keyboardFocus; wmGD.keyboardFocus = NULL; #ifdef WSM bUnseen = (pCD->clientState & UNSEEN_STATE) ? True : False; if (bUnseen) pCD->clientState &= ~UNSEEN_STATE; #endif /* WSM */ if ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE)) { /* * A client window no longer has the input focus. */ ShowInactiveClientFrame (pCD); } else if (pCD->clientState == MINIMIZED_STATE) { /* * An icon no longer has the input focus. */ ShowInactiveIcon (pCD, refresh); } #ifdef WSM if (bUnseen) pCD->clientState |= UNSEEN_STATE; #endif /* WSM */ /* restore old keyboard focus */ wmGD.keyboardFocus = saveCD; } /* END OF FUNCTION ClearFocusIndication */ /*************************************<->************************************* * * GetClientUnderPointer (pSameScreen) * * * Description: * ----------- * This function identifies the managed client window or icon that is under * the pointer. * * * Outputs: * ------- * pSameScreen = pointer to flag that indicates if pointer is on the wm screen * * Return = client data pointer for the client window / icon under the * mouse cursor * *************************************<->***********************************/ ClientData *GetClientUnderPointer (pSameScreen) Boolean *pSameScreen; { Window root; Window child; int rootX; int rootY; int winX; int winY; unsigned int mask; ClientData *pCD; if ((*pSameScreen = XQueryPointer (DISPLAY, ACTIVE_ROOT, &root, &child, &rootX, &rootY, &winX, &winY, &mask)) != False) { if (child && !XFindContext (DISPLAY, child, wmGD.windowContextType, (caddr_t *)&pCD)) { /* * There is a client window or icon under the pointer. */ return (pCD); } } return (NULL); } /* END OF FUNCTION GetClientUnderPointer */ /*************************************<->************************************* * * FocusNextWindow (type, focusTime) * * * Description: * ----------- * This function is used to change the focus to the next window in the * window stacking order. The next focus window must be of the specified * type(s). If the focus traversal cannot be done because there is not * an object of the specified type (accepting focus) then don't change the * focus (!!!should the focus be unset in this case!!!). * * * Inputs: * ------ * type = type of objects to change the focus to * * focusTime = timestamp to be used for setting the input focus * *************************************<->***********************************/ Boolean FocusNextWindow (unsigned long type, Time focusTime) { ClientListEntry *pCurrentEntry = NULL; ClientListEntry *pNextEntry = NULL; Boolean focused = False; ClientData *pCD; /* * Identify the window or icon that currently has the focus and start * traversing to the next object. */ if (type & F_GROUP_TRANSIENT) { /* * Move the keyboard input focus around in a transient tree. */ focused = FocusNextTransient (wmGD.keyboardFocus, type, False, focusTime); } if (!focused) { if (wmGD.systemModalActive) { focused = True; } else if (wmGD.keyboardFocus) { if (wmGD.keyboardFocus->transientLeader) { pCD = FindTransientTreeLeader (wmGD.keyboardFocus); } else { pCD = wmGD.keyboardFocus; } if (pCD->clientState == MINIMIZED_STATE) { pCurrentEntry = &pCD->iconEntry; } else { pCurrentEntry = &pCD->clientEntry; } pNextEntry = pCurrentEntry->nextSibling; if (!pNextEntry) { pNextEntry = ACTIVE_PSD->clientList; } } else { pCurrentEntry = ACTIVE_PSD->clientList; pNextEntry = pCurrentEntry; } } while (!focused && pNextEntry) { focused = CheckForKeyFocus (pNextEntry, type, True /*next*/, focusTime); if (!focused) { pNextEntry = pNextEntry->nextSibling; } } if (!focused) { pNextEntry = ACTIVE_PSD->clientList; while ((pNextEntry != pCurrentEntry) && !focused) { focused = CheckForKeyFocus (pNextEntry, type, True/*next*/, focusTime); if (!focused) { pNextEntry = pNextEntry->nextSibling; } } } return (focused); } /* END OF FUNCTION FocusNextWindow */ /*************************************<->************************************* * * FocusNextTransient (pCD, type, initiate, focusTime) * * * Description: * ----------- * This function is used to determine if another window in a transient * tree should get the input focus. * * Inputs: * ------ * pCD = pointer to the client data for the client window that has the focus * * type = type of objects to change the focus to * * initiate = set True if transient focus traversal is to be initiated; * set to False if transient focus traversal is to be continued * * focusTime = timestamp to be used to set the input focus * * * Outputs: * ------- * RETURN = True if the focus window has been identified and the focus * has been set (or is already set) * *************************************<->***********************************/ Boolean FocusNextTransient (ClientData *pCD, unsigned long type, Boolean initiate, Time focusTime) { Boolean focused = False; unsigned long startAt; ClientData *pcdLeader; ClientData *pcdLowerLeader; ClientData *pcdFocus; if (initiate && !(type & F_GROUP_TRANSIENT)) { /* * If in a transient tree focus on the last transient window that * had the focus. */ if (pCD->transientChildren) { pcdFocus = FindLastTransientTreeFocus (pCD, (ClientData *)NULL); if (pcdFocus != wmGD.keyboardFocus) { pcdLeader = FindTransientTreeLeader (pcdFocus); if (wmGD.keyboardFocus && wmGD.keyboardFocus->focusAutoRaise && (wmGD.keyboardFocus != pcdLeader)) { pcdLowerLeader = FindTransientTreeLeader (wmGD.keyboardFocus); if (pcdLowerLeader == pcdLeader) { if (PutTransientBelowSiblings (wmGD.keyboardFocus)) { RestackTransients (pcdLeader); } } else { F_Lower (NULL, wmGD.keyboardFocus, (XEvent *) NULL); } } Do_Focus_Key (pcdFocus, focusTime, ALWAYS_SET_FOCUS); } focused = True; } else { focused = False; } } else if (pCD && (pCD->clientState != MINIMIZED_STATE) && (pCD->transientLeader || pCD->transientChildren)) { startAt = (initiate) ? (ACTIVE_PSD->clientCounter + 1) : pCD->clientID; pcdLeader = FindTransientTreeLeader (pCD); pcdFocus = FindNextTFocusInSeq (pcdLeader, startAt); if ((pcdFocus == NULL) && (type == F_GROUP_TRANSIENT)) { /* * Wrap around and find a focus window. */ pcdFocus = FindNextTFocusInSeq (pcdLeader, (unsigned long) (ACTIVE_PSD->clientCounter + 1)); } if (pcdFocus) { if (pcdFocus != wmGD.keyboardFocus) { if (wmGD.keyboardFocus && wmGD.keyboardFocus->focusAutoRaise && (wmGD.keyboardFocus != pcdLeader)) { pcdLowerLeader = FindTransientTreeLeader (wmGD.keyboardFocus); if (pcdLowerLeader == pcdLeader) { if (PutTransientBelowSiblings (wmGD.keyboardFocus)) { RestackTransients (pcdLeader); } } else { F_Lower (NULL, wmGD.keyboardFocus, (XEvent *)NULL); } } Do_Focus_Key (pcdFocus, focusTime, ALWAYS_SET_FOCUS); } focused = True; } } else { if (type == F_GROUP_TRANSIENT) { /* * Focus only within a transient tree. In this case the current * or prospective focus is not within a transient tree so leave * the focus where it is. */ focused = True; } } return (focused); } /* END OF FUNCTION FocusNextTransient */ /*************************************<->************************************* * * FindLastTransientTreeFocus (pCD, pcdNoFocus) * * * Description: * ----------- * This function is used to scan a transient tree for the last window in * the tree that had the focus. * * Inputs: * ------ * pCD = pointer to the client data for the transient tree (or subtree) * leader. * * pcdNoFocus = pointer to the client data for a client window that is not * to get the input focus (NULL if no client window restriction). * * Outputs: * ------- * RETURN = pointer to the client data of the window that last had the * focus. * *************************************<->***********************************/ ClientData *FindLastTransientTreeFocus (pCD, pcdNoFocus) ClientData *pCD; ClientData *pcdNoFocus; { ClientData *pcdNext; ClientData *pcdFocus; ClientData *pcdLastFocus = NULL; pcdNext = pCD->transientChildren; while (pcdNext) { pcdFocus = FindLastTransientTreeFocus (pcdNext, pcdNoFocus); if (pcdFocus && (!IS_APP_MODALIZED(pcdFocus)) && ((pcdLastFocus == NULL) || (pcdFocus->focusPriority > pcdLastFocus->focusPriority))) { pcdLastFocus = pcdFocus; } pcdNext = pcdNext->transientSiblings; } if ((!IS_APP_MODALIZED(pCD)) && ((pcdLastFocus == NULL) || (pCD->focusPriority > pcdLastFocus->focusPriority))) { pcdLastFocus = pCD; } return (pcdLastFocus); } /* END OF FUNCTION FindLastTransientTreeFocus */ /*************************************<->************************************* * * FindNextTFocusInSeq (pCD, startAt) * * * Description: * ----------- * This function is used to scan a transient tree for the next window that * can accept the focus. * * Inputs: * ------ * pCD = pointer to the client data for the transient tree (or subtree) * leader. * * startAt = focus window should have a lower id then this client id * * * Outputs: * ------- * RETURN = pointer to the client data of the window that should get the * focus. * *************************************<->***********************************/ ClientData *FindNextTFocusInSeq (pCD, startAt) ClientData *pCD; unsigned long startAt; { ClientData *pcdNextFocus = NULL; ClientData *pcdNext; ClientData *pcdFocus; pcdNext = pCD->transientChildren; while (pcdNext) { pcdFocus = FindNextTFocusInSeq (pcdNext, startAt); if (pcdFocus) { if ((pcdNextFocus == NULL) || (pcdFocus->clientID > pcdNextFocus->clientID)) { pcdNextFocus = pcdFocus; } } pcdNext = pcdNext->transientSiblings; } if ((pcdNextFocus == NULL) || (pCD->clientID > pcdNextFocus->clientID)) { if ((!IS_APP_MODALIZED(pCD)) && (pCD->clientID < startAt)) { pcdNextFocus = pCD; } } return (pcdNextFocus); } /* END OF FUNCTION FindNextTFocusInSeq */ /*************************************<->************************************* * * FocusPrevWindow (type, focusTime) * * * Description: * ----------- * This function is used to change the focus to the previous window in the * window stacking order. The next focus window must be of the specified * type(s). If the focus traversal cannot be done because there is not * an object of the specified type (accepting focus) then don't change the * focus (!!!should the focus be unset in this case!!!). * * * Inputs: * ------ * type = type of objects to change the focus to * * focusTime = timestamp to be used to set the input focus * *************************************<->***********************************/ Boolean FocusPrevWindow (unsigned long type, Time focusTime) { ClientListEntry *pCurrentEntry = NULL; ClientListEntry *pNextEntry = NULL; Boolean focused = False; ClientData *pCD; /* * Identify the window or icon that currently has the focus and start * traversing to the previous object. */ if (type & F_GROUP_TRANSIENT) { /* * Move the keyboard input focus around in a transient tree. */ focused = FocusPrevTransient (wmGD.keyboardFocus, type, False, focusTime); } if (!focused) { if (wmGD.systemModalActive) { focused = True; } else if (wmGD.keyboardFocus) { if (wmGD.keyboardFocus->transientLeader) { pCD = FindTransientTreeLeader (wmGD.keyboardFocus); } else { pCD = wmGD.keyboardFocus; } if (pCD->clientState == MINIMIZED_STATE) { pCurrentEntry = &pCD->iconEntry; } else { pCurrentEntry = &pCD->clientEntry; } pNextEntry = pCurrentEntry->prevSibling; if (!pNextEntry) { pNextEntry = ACTIVE_PSD->lastClient; } } else { pCurrentEntry = ACTIVE_PSD->lastClient; pNextEntry = pCurrentEntry; } } while (!focused && pNextEntry) { focused = CheckForKeyFocus (pNextEntry, type, False /*previous*/, focusTime); if (!focused) { pNextEntry = pNextEntry->prevSibling; } } if (!focused) { pNextEntry = ACTIVE_PSD->lastClient; while ((pNextEntry != pCurrentEntry) && !focused) { focused = CheckForKeyFocus (pNextEntry, type, False/*previous*/, focusTime); if (!focused) { pNextEntry = pNextEntry->prevSibling; } } } return (focused); } /* END OF FUNCTION FocusPrevWindow */ /*************************************<->************************************* * * FocusPrevTransient (pCD, type, initiate, focusTime) * * * Description: * ----------- * This function is used to determine if another (previous) window in a * transient tree should get the input focus. * * Inputs: * ------ * pCD = pointer to the client data for the client window that has the focus * * type = type of objects to change the focus to * * initiate = set True if transient focus traversal is to be initiated; * set to False if transient focus traversal is to be continued * * focusTime = timestamp to be used to set the input focus * * * Outputs: * ------- * RETURN = True if the focus window has been identified and the focus * has been set (or is already set) * *************************************<->***********************************/ Boolean FocusPrevTransient (ClientData *pCD, unsigned long type, Boolean initiate, Time focusTime) { Boolean focused = False; unsigned long startAt; ClientData *pcdLeader; ClientData *pcdFocus; if (initiate && !(type & F_GROUP_TRANSIENT)) { /* * If in a transient tree focus on the last transient window that * had the focus. */ if (pCD->transientChildren) { pcdFocus = FindLastTransientTreeFocus (pCD, (ClientData *)NULL); if (pcdFocus != wmGD.keyboardFocus) { Do_Focus_Key (pcdFocus, focusTime, ALWAYS_SET_FOCUS); } focused = True; } else { focused = False; } } else if (pCD && (pCD->clientState != MINIMIZED_STATE) && (pCD->transientLeader || pCD->transientChildren)) { startAt = (initiate) ? 0 : pCD->clientID; pcdLeader = FindTransientTreeLeader (pCD); pcdFocus = FindPrevTFocusInSeq (pcdLeader, startAt); if ((pcdFocus == NULL) && (type == F_GROUP_TRANSIENT)) { /* * Wrap around and find a focus window. */ pcdFocus = FindPrevTFocusInSeq (pcdLeader, 0); } if (pcdFocus) { if (pcdFocus != wmGD.keyboardFocus) { Do_Focus_Key (pcdFocus, focusTime, ALWAYS_SET_FOCUS); } focused = True; } } else { if (type == F_GROUP_TRANSIENT) { /* * Focus only within a transient tree. In this case the current * or prospective focus is not within a transient tree so leave * the focus where it is. */ focused = True; } } return (focused); } /* END OF FUNCTION FocusPrevTransient */ /*************************************<->************************************* * * FindPrevTFocusInSeq (pCD, startAt) * * * Description: * ----------- * This function is used to scan a transient tree for the previous window that * can accept the focus. * * Inputs: * ------ * pCD = pointer to the client data for the transient tree (or subtree) * leader. * * startAt = focus window should have a higher id then this client id * * * Outputs: * ------- * RETURN = pointer to the client data of the window that should get the * focus. * *************************************<->***********************************/ ClientData *FindPrevTFocusInSeq (pCD, startAt) ClientData *pCD; unsigned long startAt; { ClientData *pcdNextFocus = NULL; ClientData *pcdNext; ClientData *pcdFocus; pcdNext = pCD->transientChildren; while (pcdNext) { pcdFocus = FindPrevTFocusInSeq (pcdNext, startAt); if (pcdFocus) { if ((pcdNextFocus == NULL) || (pcdFocus->clientID < pcdNextFocus->clientID)) { pcdNextFocus = pcdFocus; } } pcdNext = pcdNext->transientSiblings; } if ((pcdNextFocus == NULL) || (pCD->clientID < pcdNextFocus->clientID)) { if (!(IS_APP_MODALIZED(pCD)) && (pCD->clientID > startAt)) { pcdNextFocus = pCD; } } return (pcdNextFocus); } /* END OF FUNCTION FindPrevTFocusInSeq */ /*************************************<->************************************* * * CheckForKeyFocus (pNextEntry, type, focusNext, focusTime) * * * Description: * ----------- * This function is used to determine if a window is a worthy candidate for * getting the input focus (it is on-screen and is of the desired type). * If it is, the window gets the keyboard input focus. * * * Inputs: * ------ * pNextEntry = the client list entry to be checked * * type = the desired type of the focus window * * focusNext = if true then focus the next window in the window stack * * focusTime = timestamp to be used to set the input focus * * * Outputs: * ------- * Return = True if the window gets the keyboard input focus otherwise False * *************************************<->***********************************/ Boolean CheckForKeyFocus (ClientListEntry *pNextEntry, unsigned long type, Boolean focusNext, Time focusTime) { ClientData *pCD = pNextEntry->pCD; unsigned long windowType; Boolean focused = False; /* * First check for focusing within a transient tree. */ /* * Make sure the window is being displayed and is of the specified type. */ if (((pNextEntry->type == NORMAL_STATE) && #ifdef WSM (!(pCD->clientState & UNSEEN_STATE)) && #endif /* WSM */ (pCD->clientState != MINIMIZED_STATE)) || ((pNextEntry->type == MINIMIZED_STATE) && (pCD->clientState == MINIMIZED_STATE))) { if (pCD->clientState == MINIMIZED_STATE) { windowType = F_GROUP_ICON; } else { if (focusNext) { focused = FocusNextTransient (pCD, type, True, focusTime); } else { focused = FocusPrevTransient (pCD, type, True, focusTime); } windowType = F_GROUP_WINDOW; if (pCD->transientLeader || pCD->transientChildren) { windowType |= F_GROUP_TRANSIENT; } } if (!focused && (type & windowType)) { focused = True; if (focusNext && wmGD.keyboardFocus && wmGD.keyboardFocus->focusAutoRaise) { F_Lower (NULL, wmGD.keyboardFocus, (XEvent *)NULL); } Do_Focus_Key (pCD, focusTime, ALWAYS_SET_FOCUS); } } return (focused); } /* END OF FUNCTION CheckForKeyFocus */ /*************************************<->************************************* * * RepairFocus () * * * Description: * ----------- * This function sets the keyboard and colormap focus to a client * window or icon when the window manager is recovering from a * configuration action. * * * Inputs: * ------ * * * Comments: * -------- * o we only need to repair keyboard focus policy is "pointer" * *************************************<->***********************************/ void RepairFocus (void) { ClientData *pCD; Boolean sameScreen; XEvent event; /* * Repair the keyboard and colormap focus based on the policies */ if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) || (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER)) { /* * Move old enter and leave events and then get the window that * the pointer is currently in. */ XSync (DISPLAY, False); while (XCheckMaskEvent (DISPLAY, EnterWindowMask | LeaveWindowMask, &event)) { } pCD = GetClientUnderPointer (&sameScreen); /* * Set the keyboard focus to the window that currently contains the * pointer. */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) { /* * This will also set colormap focus if it is CMAP_FOCUS_KEYBOARD. */ Do_Focus_Key (pCD, CurrentTime, ALWAYS_SET_FOCUS); } else if (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER) { SetColormapFocus (ACTIVE_PSD, pCD); } } } /* END OF FUNCTION RepairFocus */ /*************************************<->************************************* * * AutoResetKeyFocus (pcdFocus, focusTime) * * * Description: * ----------- * This function resets the keyboard input focus when a window with the * focus is withdrawn or iconified. The focus is set to the last window * that had the focus. The focus is not set to an icon. * * * Inputs: * ------ * pcdFocus = pointer to the client data of the window with the focus or * the leader of the transient tree that contains the focus window; * the focus should not be set to the pcdFocus window or subordinates. * * focusTime = timestamp to be used in setting the keyboard input focus. * *************************************<->***********************************/ void AutoResetKeyFocus (ClientData *pcdNoFocus, Time focusTime) { ClientListEntry *pNextEntry; ClientData *pCD; ClientData *pcdLastFocus = NULL; ClientData *pcdFocus; /* * Scan through the list of clients to find a window to get the focus. */ pNextEntry = ACTIVE_PSD->clientList; while (pNextEntry) { pCD = pNextEntry->pCD; if (!wmGD.systemModalActive || (wmGD.systemModalClient == pCD)) { if ((pNextEntry->type != MINIMIZED_STATE) && (pCD->clientState != MINIMIZED_STATE) && #ifdef WSM (!(pCD->clientState & UNSEEN_STATE)) && #endif /* WSM */ (pCD != pcdNoFocus)) { if (pCD->transientChildren) { pcdFocus = FindLastTransientTreeFocus (pCD, pcdNoFocus); } else { pcdFocus = pCD; } if (pcdFocus && ((pcdLastFocus == NULL) || (pcdFocus->focusPriority > pcdLastFocus->focusPriority))) { pcdLastFocus = pcdFocus; } } } pNextEntry = pNextEntry->nextSibling; } /* * Set the focus if there is a window that is a good candidate for * getting the focus. */ if (pcdLastFocus) { Do_Focus_Key (pcdLastFocus, focusTime, ALWAYS_SET_FOCUS); } else { /* * !!! Immediately set the focus indication !!! */ Do_Focus_Key ((ClientData *)NULL, focusTime, ALWAYS_SET_FOCUS); } } /* END OF FUNCTION AutoResetKeyFocus */ motif-2.3.8/clients/mwm/WmSignal.h0000644000175000017500000000210513145162623013717 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void SetupWmSignalHandlers (int); extern void QuitWmSignalHandler (int); extern void RestoreDefaultSignalHandlers (void); extern void ChildProcSignalHandler (int); motif-2.3.8/clients/mwm/WmInitWs.h0000644000175000017500000000306313145162623013723 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.2 */ extern void InitWmGlobal (int argc, char *argv [], char *environ []); extern void InitWmScreen (WmScreenData *pSD, int sNum); extern void InitWmWorkspace (WmWorkspaceData *pWS, WmScreenData *pSD); extern void ProcessMotifWmInfo (Window rootWindowOfScreen); extern void SetupWmWorkspaceWindows (void); extern void MakeWorkspaceCursors (void); extern void MakeWmFunctionResources (WmScreenData *pSD); extern void MakeXorGC (WmScreenData *pSD); extern void CopyArgv (int argc, char *argv []); extern void InitScreenNames (void); #ifndef NO_MESSAGE_CATALOG extern void InitNlsStrings( void ) ; #endif #ifdef WSM extern void InitWmDisplayEnv( void ) ; #endif /* WSM */ motif-2.3.8/clients/mwm/WmCDecor.h0000644000175000017500000000467613145162623013660 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern Boolean FrameWindow (ClientData *pcd); extern void FrameExposureProc (ClientData *pcd); extern void BaseWinExposureProc (ClientData *pcd); extern void SetFrameShape (ClientData *pcd); extern Boolean ConstructFrame (ClientData *pcd); extern void GenerateFrameDisplayLists (ClientData *pcd); extern void AdoptClient (ClientData *pcd); extern void GetTextBox (ClientData *pcd, XRectangle *pBox); extern void DrawWindowTitle (ClientData *pcd, Boolean eraseFirst); extern void CreateStretcherWindows (ClientData *pcd); extern void CountFrameRectangles (WmScreenData *pSD); extern Boolean AllocateFrameDisplayLists (ClientData *pcd); extern void InitClientDecoration (WmScreenData *pSD); extern Boolean AllocateGadgetRectangles (ClientData *pcd); extern void ComputeGadgetRectangles (ClientData *pcd); extern void GetSystemMenuPosition (ClientData *pcd, int *px, int *py, unsigned int height, Context context); extern void ShowActiveClientFrame (ClientData *pcd); extern void ShowInactiveClientFrame (ClientData *pcd); extern void RegenerateClientFrame (ClientData *pcd); extern void BevelSystemButton (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height); extern void BevelMinimizeButton (RList *prTop, RList *prBot, int x, int y, unsigned int height); extern void BevelMaximizeButton (RList *prTop, RList *prBot, int x, int y, unsigned int height); extern Boolean DepressGadget (ClientData *pcd, int gadget, Boolean depressed); extern void PushGadgetIn (ClientData *pcd, int gadget); extern void PopGadgetOut (ClientData *pcd, int gadget); motif-2.3.8/clients/mwm/WmProperty.c0000644000175000017500000012652413145162623014335 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmProperty.c /main/7 1997/12/02 10:00:00 bill $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmICCC.h" #include #ifdef WSM #include
#include #endif /* WSM */ /* * include extern functions */ #include "WmColormap.h" #include "WmError.h" #include "WmResParse.h" /* * Function Declarations: */ #include "WmProperty.h" /* * Global Variables: */ static SizeHints sizeHints; /*************************************<->************************************* * * SizeHints * * GetNormalHints (pCD) * * * Description: * ----------- * This function replaces the XGetNormalHints Xlib function. This function * gets the information in the WM_NORMAL_HINTS property on the client window. * The property encoding can be any of the supported versions (R2, R3+). * * * Inputs: * ------ * pCD = (client) * * * Outputs: * ------- * Return = A pointer to a filled out SizeHints structure is returned. * Default values are set if the WM_NORMAL_HINTS property could * not be retrieved. * *************************************<->***********************************/ SizeHints * GetNormalHints( ClientData *pCD ) { PropSizeHints *property = NULL; Atom actualType; int actualFormat; unsigned long leftover; unsigned long nitems; /* * Retrieve the property data. * * ICCC_R2 version: nitems = PROP_SIZE_HINTS_ELEMENTS - 3 * ICCC_CURRENT version: nitems = PROP_SIZE_HINTS_ELEMENTS */ #ifdef WSM if ((!HasProperty (pCD, XA_WM_NORMAL_HINTS)) || ((Success != XGetWindowProperty (DISPLAY, pCD->client, XA_WM_NORMAL_HINTS, 0L, (long)PROP_SIZE_HINTS_ELEMENTS, False, XA_WM_SIZE_HINTS, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&property)) || (actualType != XA_WM_SIZE_HINTS) || (nitems < (PROP_SIZE_HINTS_ELEMENTS - 3)) || (actualFormat != 32))) #else /* WSM */ if ((Success != XGetWindowProperty (DISPLAY, pCD->client, XA_WM_NORMAL_HINTS, 0L, (long)PROP_SIZE_HINTS_ELEMENTS, False, XA_WM_SIZE_HINTS, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&property)) || (actualType != XA_WM_SIZE_HINTS) || (nitems < (PROP_SIZE_HINTS_ELEMENTS - 3)) || (actualFormat != 32)) #endif /* WSM */ { /* * Indicate no property values were retrieved: */ sizeHints.icccVersion = ICCC_UNKNOWN; sizeHints.flags = 0; } else { /* * Parse the hint values out of the property data: */ sizeHints.flags = property->flags; sizeHints.x = property->x; sizeHints.y = property->y; sizeHints.width = property->width; sizeHints.height = property->height; sizeHints.min_width = property->minWidth; sizeHints.min_height = property->minHeight; sizeHints.max_width = property->maxWidth; sizeHints.max_height = property->maxHeight; sizeHints.width_inc = property->widthInc; sizeHints.height_inc = property->heightInc; sizeHints.min_aspect.x = (int)property->minAspectX; sizeHints.min_aspect.y = (int)property->minAspectY; sizeHints.max_aspect.x = (int)property->maxAspectX; sizeHints.max_aspect.y = (int)property->maxAspectY; if (nitems == (PROP_SIZE_HINTS_ELEMENTS - 3)) { /* * This is ICCC_R2. */ sizeHints.icccVersion = ICCC_R2; } else { /* * This is ICCC_CURRENT. */ sizeHints.icccVersion = ICCC_CURRENT; sizeHints.base_width = property->baseWidth; sizeHints.base_height = property->baseHeight; sizeHints.win_gravity = property->winGravity; } } /* * Free the property data buffer: */ if (property) { XFree ((char *)property); } /* * Return the hints values: */ return (&sizeHints); } /* END OF FUNCTION GetNormalHints */ /*************************************<->************************************* * * ProcessWmProtocols (pCD) * * * Description: * ----------- * This function reads and processes the WM_PROTOCOLS property that is * associated with a client window. * * ICCC_COMPLIANT check added to allow older clients to work, for now... * eventually, this code should be removed. * * Inputs: * ------ * pCD = pointer to client data * * * Outputs: * ------- * pCD = (clientProtocols, clientProtocolCount, protocolFlags) * *************************************<->***********************************/ void ProcessWmProtocols (ClientData *pCD) { int rValue; Atom *property = NULL; #ifndef ICCC_COMPLIANT Atom actualType; int actualFormat; unsigned long leftover; unsigned long nitems; #else int nitems; #endif /* ICCC_COMPLIANT */ int i; if (pCD->clientProtocols) { XtFree ((char *)pCD->clientProtocols); pCD->clientProtocols = NULL; } pCD->clientProtocolCount = 0; pCD->protocolFlags = 0; /* * Read the WM_PROTOCOLS property. */ #ifndef ICCC_COMPLIANT #ifdef WSM if (!HasProperty (pCD, wmGD.xa_WM_PROTOCOLS)) rValue = -1; else #endif /* WSM */ rValue = XGetWindowProperty (DISPLAY, pCD->client, wmGD.xa_WM_PROTOCOLS, 0L, (long)MAX_CLIENT_PROTOCOL_COUNT, False, AnyPropertyType, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&property); if ((rValue != Success) || (actualType == None) || (actualFormat != 32)) #else #ifdef WSM if (!HasProperty (pCD, wmGD.xa_WM_PROTOCOLS)) rValue = -1; else #endif /* WSM */ rValue = XGetWMProtocols (DISPLAY, pCD->client, (Atom **)&property, &nitems); if (0 == rValue) #endif /* ICCC_COMPLIANT */ { /* * WM_PROTOCOLS does not exist or it is an invalid type or size. */ pCD->clientProtocols = NULL; } else { if (!(pCD->clientProtocols = (Atom *)XtMalloc (nitems * sizeof (Atom)))) { /* unable to allocate space */ Warning (((char *)GETMESSAGE(54, 1, "Insufficient memory for window management data"))); } else { /* * Save the protocols in the client data and look for predefined * protocols. */ pCD->clientProtocolCount = nitems; for (i = 0; i < nitems; i++) { pCD->clientProtocols[i] = property[i]; if (property[i] == wmGD.xa_WM_SAVE_YOURSELF) { pCD->protocolFlags |= PROTOCOL_WM_SAVE_YOURSELF; } else if (property[i] == wmGD.xa_WM_TAKE_FOCUS) { pCD->protocolFlags |= PROTOCOL_WM_TAKE_FOCUS; } else if (property[i] == wmGD.xa_WM_DELETE_WINDOW) { pCD->protocolFlags |= PROTOCOL_WM_DELETE_WINDOW; } else if (property[i] == wmGD.xa_MWM_MESSAGES) { pCD->protocolFlags |= PROTOCOL_MWM_MESSAGES; } } } } if (property) { XFree ((char *)property); } } /* END OF FUNCTION ProcessWmProtocols */ /*************************************<->************************************* * * ProcessMwmMessages (pCD) * * * Description: * ----------- * This function reads and processes the _MWM_MESSAGES property that is * associated with a client window. * * * Inputs: * ------ * pCD = pointer to client data * * * Outputs: * ------- * pCD = (mwmMessagesCount, mwmMessages) * *************************************<->***********************************/ void ProcessMwmMessages (ClientData *pCD) { int rValue; long *property = NULL; Atom actualType; int actualFormat; unsigned long leftover; unsigned long nitems; int i; if (pCD->mwmMessages) { XtFree ((char *)pCD->mwmMessages); pCD->mwmMessages = NULL; } pCD->mwmMessagesCount = 0; /* * Read the _MWM_MESSAGES property. */ #ifdef WSM if (!HasProperty (pCD, wmGD.xa_MWM_MESSAGES)) rValue = ~Success; else #endif /* WSM */ rValue = XGetWindowProperty (DISPLAY, pCD->client, wmGD.xa_MWM_MESSAGES, 0L, (long)MAX_MWM_MESSAGES_COUNT, False, AnyPropertyType, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&property); if ((rValue != Success) || (actualType == None) || (actualFormat != 32) || (nitems == 0)) { /* * _MWM_MESSAGES does not exist or it is an invalid type. */ pCD->mwmMessages = NULL; } else { if (!(pCD->mwmMessages = (long *)XtMalloc (nitems * sizeof (long)))) { /* unable to allocate space */ Warning (((char *)GETMESSAGE(54, 2, "Insufficient memory for window management data"))); } else { /* * Save the protocols in the client data and look for predefined * protocols. */ pCD->mwmMessagesCount = nitems; for (i = 0; i < nitems; i++) { if ((pCD->mwmMessages[i] = property[i]) == wmGD.xa_MWM_OFFSET) { pCD->protocolFlags |= PROTOCOL_MWM_OFFSET; } } } } if (property) { XFree ((char *)property); } } /* END OF FUNCTION ProcessMwmMessages */ /*************************************<->************************************* * * SetMwmInfo (propWindow, flags, wmWindow) * * * Description: * ----------- * This function sets up the _MOTIF_WM_INFO property on the specified (usually * the root) window. * * * Inputs: * ------ * propWindow = window on which the _MOTIF_WM_INFO property is to be set * * flags = motifWmInfo.flags value * * wmWindow = motifWmInfo.wmWindow value * * * Outputs: * ------- * _MWM_INFO = this property is set on the specified window * *************************************<->***********************************/ void SetMwmInfo (Window propWindow, long flags, Window wmWindow) { PropMwmInfo property; property.flags = flags; property.wmWindow = wmWindow; XChangeProperty (DISPLAY, propWindow, wmGD.xa_MWM_INFO, wmGD.xa_MWM_INFO, 32, PropModeReplace, (unsigned char *)&property, PROP_MWM_INFO_ELEMENTS); } /* END OF FUNCTION SetMwmInfo */ #ifdef WSM /*************************************<->************************************* * * SetMwmSaveSessionInfo (wmWindow) * * * Description: * ----------- * This function sets up the WM_SAVE_YOURSELF property on the wm window * * * Inputs: * ------ * wmWindow = motifWmInfo.wmWindow * * * Outputs: * ------- * WM_SAVE_YOURSELF = this property is set on the wm window * *************************************<->***********************************/ void SetMwmSaveSessionInfo (Window wmWindow) { Atom property; property = wmGD.xa_WM_SAVE_YOURSELF; XChangeProperty (DISPLAY, wmWindow, wmGD.xa_WM_PROTOCOLS, XA_ATOM, 32, PropModeReplace, (unsigned char *) &property, 1); SetWMState(wmWindow, NORMAL_STATE, 0); } /* END OF FUNCTION SetMwmSaveSessionInfo */ #endif /* WSM */ /*************************************<->************************************* * * GetWMState (window) * * * Description: * ----------- * This function gets the WM_STATE property on a client top-level * window. * * * Inputs: * ------ * window = client window from which the WM_STATE property is to be retrieved * * * Outputs: * ------- * RETURN = a pointer to the WM_STATE property value (NULL if not defined) * * * Comments: * -------- * This function will eventually be superceded when WM_STATE support is * added to the official X release. * *************************************<->***********************************/ PropWMState * GetWMState( Window window ) { int ret_val; PropWMState *property = NULL; Atom actual_type; int actual_format; unsigned long nitems; unsigned long leftover; ret_val = XGetWindowProperty (DISPLAY, window, wmGD.xa_WM_STATE, 0L, PROP_WM_STATE_ELEMENTS, False, wmGD.xa_WM_STATE, &actual_type, &actual_format, &nitems, &leftover, (unsigned char **)&property); if (!((ret_val == Success) && (actual_type == wmGD.xa_WM_STATE) && (nitems == PROP_WM_STATE_ELEMENTS))) { /* * The property could not be retrieved or is not correctly set up. */ if (property) { XFree ((char *)property); property = NULL; } } return (property); } /* END OF FUNCTION GetWMState */ /*************************************<->************************************* * * SetWMState (window, state, icon) * * * Description: * ----------- * This function sets up the WM_STATE property on a client top-level * window. * * * Inputs: * ------ * window = client window on which the WM_STATE property is to be set * * state = state of the client application * * icon = window manager's icon window * * * Outputs: * ------- * WM_STATE = this property is set on the client window * * * Comments: * -------- * This function will eventually be superceded when WM_STATE support is * added to the official X release. * *************************************<->***********************************/ void SetWMState (Window window, int state, Window icon) { PropWMState property; property.state = state; property.icon = icon; XChangeProperty (DISPLAY, window, wmGD.xa_WM_STATE, wmGD.xa_WM_STATE, 32, PropModeReplace, (unsigned char *)&property, PROP_WM_STATE_ELEMENTS); } /* END OF FUNCTION SetWMState */ /*************************************<->************************************* * * PropMwmHints * * GetMwmHints (pCD) * * * Description: * ----------- * This function reads any _MWM_HINTS property that is associated with a * client window. * * Inputs: * ------ * pCD = pointer to client data * * Outputs: * ------- * RETURN = ptr to mwm hints property, or NULL ptr if failure * *************************************<->***********************************/ PropMwmHints * GetMwmHints( ClientData *pCD ) { int ret_val; PropMwmHints *property = NULL; Atom actual_type; int actual_format; unsigned long nitems; unsigned long leftover; #ifdef WSM if (!HasProperty(pCD, wmGD.xa_MWM_HINTS)) ret_val = ~Success; else #endif /* WSM */ ret_val = XGetWindowProperty (DISPLAY, pCD->client, wmGD.xa_MWM_HINTS, 0L, PROP_MWM_HINTS_ELEMENTS, False, wmGD.xa_MWM_HINTS, &actual_type, &actual_format, &nitems, &leftover, (unsigned char **)&property); /* * Retrieve the property data. * * Motif 1.1.n clients: nitems = PROP_MWM_HINTS_ELEMENTS * Motif 1.2 clients: nitems = PROP_MWM_HINTS_ELEMENTS + 2 * * NOTES: We don't need to check (nitems == PROP_MWM_HINTS_ELEMENTS) * since... * * If running Motif 1.1.n client with Mwm 1.2, then ignore extra elements * since property.flags won't have extra elements set. * * If running Motif 1.2 client with Mwm 1.1.n, then ignore extra elements * since Mwm 1.1.n won't try to access the extra elements. */ if ((ret_val == Success) && (actual_type == wmGD.xa_MWM_HINTS)) { return (property); /* indicate success */ } /* * The property could not be retrieved or is not correctly set up. */ if (property) { XFree ((char *)property); } return (NULL); /* indicate failure */ } /* END OF FUNCTION GetMwmHints */ /*************************************<->************************************* * * PropMwmInfo * * GetMwmInfo (rootWindowOfScreen) * * * Description: * ----------- * This function reads the _MOTIF_WM_INFO property from the root window if * it is setup. * * Inputs: * ------ * pSD = pointer to screen data * * Outputs: * ------- * RETURN = ptr to motif wm info property, or NULL ptr if no property * *************************************<->***********************************/ PropMwmInfo *GetMwmInfo (Window rootWindowOfScreen) { int ret_val; PropMwmInfo *property = NULL; Atom actual_type; int actual_format; unsigned long nitems; unsigned long leftover; ret_val = XGetWindowProperty (DISPLAY, rootWindowOfScreen, wmGD.xa_MWM_INFO, 0L, PROP_MWM_INFO_ELEMENTS, False, wmGD.xa_MWM_INFO, &actual_type, &actual_format, &nitems, &leftover, (unsigned char **)&property); if ((ret_val == Success) && (actual_type == wmGD.xa_MWM_INFO) && (nitems == PROP_MWM_INFO_ELEMENTS)) { return (property); /* indicate success */ } /* * The property could not be retrieved or is not correctly set up. */ if (property) { XFree ((char *)property); } return (NULL); /* indicate failure */ } /* END OF FUNCTION GetMwmInfo */ /*************************************<->************************************* * * ProcessWmColormapWindows (pCD) * * * Description: * ----------- * This function retrieves and processes the WM_COLORMAP_WINDOWS client * window property. * * * Inputs: * ------ * pCD = pointer to client data * * * Outputs: * ------- * pCD = (cmapWindows, clientCmapList, clientCmapCount, clientCmapIndex) * *************************************<->***********************************/ void ProcessWmColormapWindows (ClientData *pCD) { int rValue; Window *property = NULL; Atom actualType; int actualFormat; unsigned long leftover; unsigned long nitems; int i; Window *pWindows; Colormap *pColormaps; int colormapCount; XWindowAttributes wAttributes; ClientData *pcd; XSetWindowAttributes sAttributes; #ifndef OLD_COLORMAP /* colormaps */ int *pCmapFlags; #endif /* * pCD->clientCmapCount and pCD->clientCmapIndex are initialized in * WmWinInfo.c. */ /* * Read the WM_COLORMAP_WINDOWS property. */ rValue = XGetWindowProperty (DISPLAY, pCD->client, wmGD.xa_WM_COLORMAP_WINDOWS, 0L, (long)MAX_COLORMAP_WINDOWS_COUNT, False, AnyPropertyType, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&property); if ((rValue == Success) && (actualType != None) && (actualFormat == 32) && (nitems > 0)) { /* * WM_COLORMAP_WINDOWS exists and is a valid type. */ if (!(pWindows = (Window *)XtMalloc ((nitems * sizeof (Window)) + 1)) || !(pColormaps = (Colormap *)XtMalloc ((nitems*sizeof(Colormap)) + 1))) { /* unable to allocate space */ Warning (((char *)GETMESSAGE(54, 3, "Insufficient memory for window management data"))); if (pWindows) { XtFree ((char *)pWindows); } } #ifndef OLD_COLORMAP /* colormap */ /* Is the above OSF code a bug -- allocates one extra byte, rather */ /* than one extra element, for the top window if needed? */ else if ( ! (pCmapFlags = (int *)XtCalloc(nitems+1,sizeof(int)))) { /* unable to allocate space */ Warning (((char *)GETMESSAGE(54, 4, "Insufficient memory for window manager flags"))); XtFree ((char *)pWindows); XtFree ((char *)pColormaps); } #endif else { /* * Check to see if the top-level client window is in the list. * If it is not then add it to the head of the list. */ for (i = 0; i < nitems; i++) { if (property[i] == pCD->client) { break; } } colormapCount = 0; if (i == nitems) { /* add the client window to the colormap window list */ pWindows[0] = pCD->client; pColormaps[0] = FindColormap (pCD, pCD->client); colormapCount++; } sAttributes.event_mask = (ColormapChangeMask); for (i = 0; i < nitems; i++) { if ((pColormaps[colormapCount] = FindColormap (pCD, property[i])) != None) { pWindows[colormapCount] = property[i]; colormapCount++; } else if (XFindContext (DISPLAY, property[i], wmGD.windowContextType, (caddr_t *)&pcd)) { /* * The window is not a top level window or a window that * is already being tracked for colormap changes. * Track colormap attribute changes. */ XChangeWindowAttributes (DISPLAY, property[i], CWEventMask, &sAttributes); if (XGetWindowAttributes (DISPLAY, property[i], &wAttributes)) { pWindows[colormapCount] = property[i]; pColormaps[colormapCount] = wAttributes.colormap; colormapCount++; } } } /* * Free up the old colormap window data if it has been set. Set * new window contexts. */ ResetColormapData (pCD, pWindows, colormapCount); /* * Set the colormap window data. */ pCD->clientColormap = pColormaps[0]; if (colormapCount > 1) { /* * The top level window and at least one other window is in * the colormap windows list. */ pCD->clientCmapCount = colormapCount; pCD->cmapWindows = pWindows; pCD->clientCmapList = pColormaps; pCD->clientCmapIndex = 0; #ifndef OLD_COLORMAP /* colormap */ pCD->clientCmapFlags = pCmapFlags; #endif } else { /* * Only the top level window is being tracked for colormap * data. */ pCD->clientCmapCount = 0; XtFree ((char *)pWindows); XtFree ((char *)pColormaps); #ifndef OLD_COLORMAP /* colormap */ XtFree((char *)pCmapFlags); #endif } } } if (property) { XFree ((char *)property); } } /* END OF FUNCTION ProcessWmColormapWindows */ /*************************************<->************************************* * * FindColormap (pCD, window) * * * Description: * ----------- * This function checks colormap information that is currently saved in * the client data for the colormap of the specified window. * * * Inputs: * ------ * pCD = pointer to client data * * window = get the colormap id for this window * * * Outputs: * ------- * RETURN = colormap id for window (NULL if no colormap information) * *************************************<->***********************************/ Colormap FindColormap (ClientData *pCD, Window window) { Colormap colormap = (Colormap)0; int i; if (pCD->clientCmapCount == 0) { /* * If the colormap count is 0 there is no list of colormaps and * clientColormap is the colormap of the top-level window. */ if (window == pCD->client) { colormap = pCD->clientColormap; } } else { for (i = 0; i < pCD->clientCmapCount; i++) { if (pCD->cmapWindows[i] == window) { colormap = pCD->clientCmapList[i]; break; } } } return (colormap); } /* END OF FUNCTION FindColormap */ /*************************************<->************************************* * * GetMwmMenuItems (pCD) * * * Description: * ----------- * This function reads and processes any _MWM_MENU property that is * associated with a client window and returns a list of MenuItem structures * specified by the property, or NULL. * * * Inputs: * ------ * pCD = pointer to client data * * * Outputs: * ------- * Return = MenuItem list or NULL. * *************************************<->***********************************/ MenuItem * GetMwmMenuItems( ClientData *pCD ) { int rValue; XTextProperty textProperty; MenuItem *menuItems; /* * Read the _MWM_MENU property. */ textProperty.value = (unsigned char *)NULL; rValue = XGetTextProperty(DISPLAY, pCD->client, &textProperty, wmGD.xa_MWM_MENU); if ((rValue == 0) || (textProperty.value == (unsigned char *)NULL)) /* _MWM_MENU does not exist or it is an invalid type. */ { menuItems = NULL; } else /* parse the property string */ { char **textList; int nItems; if (XmbTextPropertyToTextList(DISPLAY, &textProperty, &textList, &nItems) != Success) { menuItems = NULL; } else { if(textList) { menuItems = ParseMwmMenuStr (PSD_FOR_CLIENT(pCD), (unsigned char *)textList[0]); XFreeStringList(textList); } else menuItems = NULL; } XFree((void *)textProperty.value); } return (menuItems); } /* END OF FUNCTION GetMwmMenuItems */ #ifdef WSM /*************************************<->************************************* * * GetWorkspaceHints (display, window, ppWsAtoms, pCount, pbAll) * * * Description: * ----------- * Get the contents of the WM_COMMAND property on a window * * * Inputs: * ------ * display - X display * window - window to get hints from * ppWsAtoms - pointer to a list of workspace atoms (to be returned) * pCount - ptr to a number of atoms (to be returned) * pbAll - ptr to a boolean (to be returned) * * * Returns: * -------- * Success if suceeded, otherwise failure code. * * * Outputs: * ------- * *ppWsAtoms - list of workspace atoms * *pCount - number of atoms in *ppWsAtoms * *pbAll - True if should put in all workspaces * * * Comments: * -------- * The caller must XtFree *ppWsAtoms when done!!! * *************************************<->***********************************/ Status GetWorkspaceHints (Display *display, Window window, Atom **ppWsAtoms, unsigned int *pCount, Boolean *pbAll) { int rcode; DtWorkspaceHints *pWsHints; Atom *paWs; rcode = _DtWsmGetWorkspaceHints(display, window, &pWsHints); if (rcode == Success) { if (pWsHints->flags & DT_WORKSPACE_HINTS_WORKSPACES) { paWs = (Atom *) XtMalloc (pWsHints->numWorkspaces * sizeof(Atom)); memcpy (paWs, pWsHints->pWorkspaces, (pWsHints->numWorkspaces * sizeof(Atom))); *pCount = pWsHints->numWorkspaces; *ppWsAtoms = paWs; } else { *pCount = 0; *ppWsAtoms = NULL; } if ((pWsHints->flags & DT_WORKSPACE_HINTS_WSFLAGS) && (pWsHints->wsflags & DT_WORKSPACE_FLAGS_OCCUPY_ALL)) { *pbAll = True; } else { *pbAll = False; } _DtWsmFreeWorkspaceHints (pWsHints); } return(rcode); } /* END OF FUNCTION GetWorkspaceHints */ /*************************************<->************************************* * * SetEmbeddedClientsProperty (propWindow, pEmbeddedClients, * cEmbeddedCLients) * * * Description: * ----------- * This function writes the _DT_WORKSPACE_EMBEDDED_CLIENTS property * * * Inputs: * ------ * propWindow = window on which the property is to be written * pEmbeddedClients = pointer to data (array of window IDs) * cEmbeddedClients = number of window IDs in the array * *************************************<->***********************************/ void SetEmbeddedClientsProperty (Window propWindow, Window *pEmbeddedClients, unsigned long cEmbeddedClients) { XChangeProperty (DISPLAY, propWindow, wmGD.xa_DT_EMBEDDED_CLIENTS, wmGD.xa_DT_EMBEDDED_CLIENTS, 32, PropModeReplace, (unsigned char *)pEmbeddedClients, cEmbeddedClients); } /* END OF FUNCTION SetEmbeddedClientsProperty */ #ifdef HP_VUE /*************************************<->************************************* * * SetWorkspaceInfo (propWindow, pWsInfo, cInfo) * * * Description: * ----------- * This function sets up the _DT_WORKSPACE_INFO property * * * Inputs: * ------ * propWindow = window on which the _DT_WORKSPACE_INFO property is to be set * pWsInfo = pointer to workspace info data * cInfo = size of workspace info data * * *************************************<->***********************************/ void SetWorkspaceInfo (Window propWindow, WorkspaceInfo *pWsInfo, unsigned long cInfo) { XChangeProperty (DISPLAY, propWindow, wmGD.xa_DT_WORKSPACE_INFO, wmGD.xa_DT_WORKSPACE_INFO, 32, PropModeReplace, (unsigned char *)pWsInfo, (cInfo * sizeof(WorkspaceInfo))/sizeof(long)); } /* END OF FUNCTION SetWorkspaceInfo */ #endif /* HP_VUE */ /*************************************<->************************************* * * SetWorkspaceListProperty (pSD) * * * Description: * ----------- * This function sets up the _DT_WORKSPACE_LIST property * * * Inputs: * ------ * pSD = ptr to screen data * * *************************************<->***********************************/ void SetWorkspaceListProperty (WmScreenData *pSD) { WmWorkspaceData *pws; Atom *pWsList; int count; pWsList = (Atom *) XtMalloc (pSD->numWorkspaces * sizeof(Atom)); pws = pSD->pWS; for (count = 0; count < pSD->numWorkspaces; count++) { pWsList[count] = pws->id; pws++; } XChangeProperty (DISPLAY, pSD->wmWorkspaceWin, wmGD.xa_DT_WORKSPACE_LIST, XA_ATOM, 32, PropModeReplace, (unsigned char *)pWsList, (pSD->numWorkspaces * sizeof(Atom))/sizeof(long)); XtFree ((char *) pWsList); } /* END OF FUNCTION SetWorkspaceListProperty */ /*************************************<->************************************* * * SetCurrentWorkspaceProperty (pSD) * * * Description: * ----------- * This function sets up the _DT_WORKSPACE_CURRENT property * * * Inputs: * ------ * pSD = ptr to screen data * * *************************************<->***********************************/ void SetCurrentWorkspaceProperty (WmScreenData *pSD) { Atom aCurrent; aCurrent = pSD->pActiveWS->id; XChangeProperty (DISPLAY, pSD->wmWorkspaceWin, wmGD.xa_DT_WORKSPACE_CURRENT, XA_ATOM, 32, PropModeReplace, (unsigned char *)&aCurrent, (sizeof(Atom))/sizeof(long)); XSync (DISPLAY, False); /* XFlush didn't work here, why? */ } /* END OF FUNCTION SetCurrentWorkspaceProperty */ /*************************************<->************************************* * * SetWorkspaceInfoProperty (pWS) * * * Description: * ----------- * This function sets up the _DT_WORKSPACE_INFO_ property * for a particular workspace * * * Inputs: * ------ * pWS = ptr to workspace data * * *************************************<->***********************************/ void SetWorkspaceInfoProperty (WmWorkspaceData *pWS) { char *pch; Atom aProperty; String sTitle; char **ppchList; int iNumStrings; int count, iwin; int i, ix; Status status; XTextProperty tp; #define WIP_NUMBER_SIZE 16 /* * Construct our property name */ pch = WorkspacePropertyName (pWS); aProperty = XmInternAtom (DISPLAY, pch, FALSE); XtFree ((char *) pch); /* * Determine the number of strings in our vector. One for each of * * workspace title * pixel set id * backdrop background * backdrop foreground * backdrop name * number of backdrop windows * list of backdrop windows */ iNumStrings = 6; /* number of fields minus backdrop window(s) */ count = 1; /* number of backdrop windows */ iNumStrings += count; /* allocate string vector */ ppchList = (char **) XtMalloc (iNumStrings * sizeof (char *)); pch = (char *) XtMalloc (iNumStrings * WIP_NUMBER_SIZE * sizeof(char)); i = 0; /* Convert workspace title to ascii */ sTitle = (String) WmXmStringToString (pWS->title); ppchList[i++] = (char *) sTitle; /* Pixel set id */ ix = (i * WIP_NUMBER_SIZE); sprintf (&pch[ix], "%d", pWS->backdrop.colorSet); ppchList[i++] = &pch[ix]; /* backdrop background */ ix = (i * WIP_NUMBER_SIZE); sprintf (&pch[ix], "0x%lx", pWS->backdrop.background); ppchList[i++] = &pch[ix]; /* backdrop foreground */ ix = (i * WIP_NUMBER_SIZE); sprintf (&pch[ix], "0x%lx", pWS->backdrop.foreground); ppchList[i++] = &pch[ix]; /* backdrop name */ ix = (i * WIP_NUMBER_SIZE); sprintf (&pch[ix], "0x%lx", pWS->backdrop.nameAtom); ppchList[i++] = &pch[ix]; /* number of backdrop windows */ ix = (i * WIP_NUMBER_SIZE); if ((pWS->backdrop.window == None)) { strcpy (&pch[ix], "0"); } else { sprintf (&pch[ix], "%d", count); } ppchList[i++] = &pch[ix]; /* backdrop windows */ /* * One or zero backdrop windows * (NULL written if zero) */ ix = (i * WIP_NUMBER_SIZE); sprintf (&pch[ix], "0x%lx", pWS->backdrop.window); ppchList[i++] = &pch[ix]; /* * Write out the property */ status = XmbTextListToTextProperty (DISPLAY, ppchList, iNumStrings, XStdICCTextStyle, &tp); if ((status == Success) || (status > 0)) { /* * Complete or partial conversion */ XSetTextProperty (DISPLAY, pWS->pSD->wmWorkspaceWin, &tp, aProperty); XFree (tp.value); } XtFree ((char *) ppchList); XtFree (pch); if (sTitle) XtFree ((char *)sTitle); } /* END OF FUNCTION SetWorkspaceInfoProperty */ /*************************************<->************************************* * * DeleteWorkspaceInfoProperty (pWS) * * * Description: * ----------- * This function deletes a _DT_WORKSPACE_INFO_ property * for a particular workspace * * * Inputs: * ------ * pWS = ptr to workspace data * * *************************************<->***********************************/ void DeleteWorkspaceInfoProperty (WmWorkspaceData *pWS) { char *pch; Atom aProperty; /* * Get the atom for the workspace property. */ pch = WorkspacePropertyName (pWS); aProperty = XmInternAtom (DISPLAY, pch, FALSE); XtFree ((char *) pch); /* * Do the property deletion */ XDeleteProperty (DISPLAY, pWS->pSD->wmWorkspaceWin, aProperty); XFlush (DISPLAY); } /* END OF FUNCTION DeleteWorkspaceInfoProperty */ /*************************************<->************************************* * * WorkspacePropertyName (pWS) * * * Description: * ----------- * This function returns a string containing the property name for a * workspace. * * * Inputs: * ------ * pWS = ptr to workspace data * * Returns * ------- * string containing the workspace property name (Free with XtFree) * * *************************************<->***********************************/ char * WorkspacePropertyName (WmWorkspaceData *pWS) { char *pch; char *pchName; int len; Atom aProperty; /* * Construct our property name */ pchName = pWS->name; len = strlen(pchName) + strlen (_XA_DT_WORKSPACE_INFO) + 4; pch = (char *) XtMalloc (len); strcpy (pch, _XA_DT_WORKSPACE_INFO); strcat (pch, "_"); strcat (pch, pchName); return (pch); } /* END OF FUNCTION WorkspacePropertyName */ /*************************************<->************************************* * * SetWorkspacePresence (propWindow, pWsPresence, cPresence) * * * Description: * ----------- * This function sets up the _DT_WORKSPACE_PRESENCE property * * * Inputs: * ------ * propWindow = window on which the _DT_WORKSPACE_PRESENCE property * is to be set * pWsPresence = pointer to workspace presence data * cPresence = size of workspace presence data * * *************************************<->***********************************/ void SetWorkspacePresence (Window propWindow, Atom *pWsPresence, unsigned long cPresence) { XChangeProperty (DISPLAY, propWindow, wmGD.xa_DT_WORKSPACE_PRESENCE, wmGD.xa_DT_WORKSPACE_PRESENCE, 32, PropModeReplace, (unsigned char *)pWsPresence, cPresence); XFlush (DISPLAY); } /* END OF FUNCTION SetWorkspacePresence */ /*************************************<->************************************* * * GetDtSessionHints (pSD, sNum) * * * Description: * ----------- * This function reads and processes _DT_SESSION_HINTS property that is * associated with the root window of each screen managed by dtwm * * * Inputs: * ------ * * * Outputs: * ------- * *************************************<->***********************************/ void GetDtSessionHints (WmScreenData *pSD, int sNum) { int rValue; char *property = NULL; Atom actualType; int actualFormat; unsigned long leftover; unsigned long nitems; /* * Read the property. */ rValue = XGetWindowProperty (DISPLAY, pSD->rootWindow, wmGD.xa_DT_SESSION_HINTS, 0L, (long)1000000, False, AnyPropertyType, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&property); if ((rValue != Success) || (actualType == None) || (actualFormat != 8)) /* _DT_SESSION_HINTS does not exist or it is an invalid type. */ { pSD->pDtSessionItems = NULL; } else /* parse the property string */ { ParseDtSessionHints (pSD, (unsigned char *)property); } if (property) { XFree ((char *)property); } /* * Delete the property so we don't see it if the user * restarts dtwm. */ #ifndef DEBUG_SESSION_HINTS XDeleteProperty (DISPLAY, pSD->rootWindow, wmGD.xa_DT_SESSION_HINTS); #endif /* DEBUG_SESSION_HINTS */ } /* END OF FUNCTION GetDtSessionHints */ /*************************************<->************************************* * * GetDtWmRequest (pSD, pszReq, pmore) * * * Description: * ----------- * This function returns the next request * * * Inputs: * ------ * pSD - pointer to screen data * psdReq - pointer to a char pointer * * * Outputs: * ------- * *pszReq - pointer to null terminated string containing next * request * *pmore - set to true if more data is left in the property * * Comments: * --------- * The data for pszReq is allocated in here. The caller must free up * this space using XtFree. * * *************************************<->***********************************/ void GetDtWmRequest ( WmScreenData *pSD, char **pszReq, Boolean *pmore) { int rValue; char *chRequest = NULL; static char *property = NULL; static int iNext = -1; int i; Atom actualType; int actualFormat; unsigned long leftover; static unsigned long nitems = 0; /* * We need to read the property again if we have no data left * over from last time; */ if (property == NULL) { #ifdef PARANOID /* * Lock down the server to prevent changes to this * property while we "edit" it. */ XGrabServer(DISPLAY); #endif /* PARANOID */ /* * Read the property and delete it. */ rValue = XGetWindowProperty (DISPLAY, pSD->wmWorkspaceWin, wmGD.xa_DT_WM_REQUEST, 0L, (long)1000000, True, AnyPropertyType, &actualType, &actualFormat, &nitems, &leftover, (unsigned char **)&property); #ifdef PARANOID /* Give the server back */ XUngrabServer(DISPLAY); #endif /* PARANOID */ /* * Validate the property that we've read */ if ((rValue != Success) || (actualType == None) || (actualFormat != 8)) { /* The property does not exist or it is an invalid type. */ property = NULL; iNext = -1; nitems = 0; } else { /* the property is fine, set the index of the next char. */ iNext = 0; } } /* * If we've got something, then extract and return the next * request. */ if (property && iNext >= 0) { int len = 0; for (i=iNext; i=nitems) i=nitems; len = i - iNext + 1 + ((property[i] == '\0') ? 0 : 1); chRequest = (char *) XtMalloc (len); if (chRequest == NULL) { Warning (((char *)GETMESSAGE(54, 2, "Insufficient memory for window management data"))); } else { /* dequeue the request */ strncpy (chRequest, &property[iNext], len); if (property[i] != '\0') { chRequest[len-1]='\0'; } iNext = i+1; } if (iNext >= nitems) { /* * Extracted the last request, free up the storage * and reset for next time. */ XFree ((char *)property); iNext = -1; property = NULL; } } *pmore = (property != NULL); *pszReq = chRequest; } /* END OF FUNCTION GetDtWmRequest */ /*************************************<->************************************* * * GetIntialPropertyList (ClientData *) * * * Description: * ----------- * Get the list of initial properties on the window * * * Inputs: * ------ * pCD - pointer to client data * * * Outputs: * ------- * pCD - paInitialProperties member is updated * * * Comments: * -------- * The caller must XFree the paIntialialProperties member! * *************************************<->***********************************/ void GetInitialPropertyList (ClientData *pCD) { Atom *paList; int iProps; paList = XListProperties (DISPLAY, pCD->client, &iProps); if (paList) { pCD->paInitialProperties = paList; pCD->numInitialProperties = iProps; } else { pCD->paInitialProperties = NULL; pCD->numInitialProperties = 0; } } /* END OF FUNCTION GetInitialPropertyList */ /*************************************<->************************************* * * DiscardIntialPropertyList (ClientData *) * * * Description: * ----------- * Tosses out the intial property list for a client, frees data * * * Inputs: * ------ * pCD - pointer to client data * * * Outputs: * ------- * pCD - paInitialProperties member is updated * * * Comments: * -------- * * *************************************<->***********************************/ void DiscardInitialPropertyList (ClientData *pCD) { if (pCD->paInitialProperties) { /* * Free the initial property list. * (see HasProperty() function) */ XFree ((char *) pCD->paInitialProperties); pCD->paInitialProperties = NULL; pCD->numInitialProperties = 0; } } /* END OF FUNCTION DiscardInitialPropertyList */ /*************************************<->************************************* * * HasProperty (pCD, aProperty) * * * Description: * ----------- * Returns True if this client had this property when it was mapped * * * Inputs: * ------ * pCD - pointer to client data * aProperty - atom of property to test for * * * Outputs: * ------- * Return - True if this property was on the initial list for this * client; False otherwise. * * * Comments: * -------- * *************************************<->***********************************/ Boolean HasProperty ( ClientData * pCD, Atom aProperty) { Boolean bFound = False; Atom * paList; int count; paList = pCD->paInitialProperties; if (paList) { count = pCD->numInitialProperties; while ((!bFound) && (count > 0)) { bFound = (*paList == aProperty); count--; paList++; } } else { /* * The property list doesn't exist. Return * True to force a read of this property. The most likely * case is that this property was updated after the * window was managed and needs to be read. */ bFound = True; } return (bFound); } /* END OF FUNCTION HasProperty */ #endif /* WSM */ motif-2.3.8/clients/mwm/WmICCC.h0000644000175000017500000000671513145162623013216 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ /* * Included Files: */ #include #include /* * Value definitions and macros: */ /*************************************<->************************************* * * ICCC property data structures ... * * * Description: * ----------- * These data structures are mwm versions of the window manager data * stuctures that are specified in the ICCCM and the Xlib specification * for client/window manager communication. In general these data * structures correspond to client window property values. * *************************************<->***********************************/ /* mwm version of the xPropSizeHints structure: */ typedef struct _PropSizeHints { unsigned long flags; long x; /* R2 conventions */ long y; /* R2 conventions */ long width; /* R2 conventions */ long height; /* R2 conventions */ long minWidth; long minHeight; long maxWidth; long maxHeight; long widthInc; long heightInc; long minAspectX; long minAspectY; long maxAspectX; long maxAspectY; long baseWidth; /* current conventions */ long baseHeight; /* current conventions */ long winGravity; /* current conventions */ } PropSizeHints; #define PROP_SIZE_HINTS_ELEMENTS 18 /* mwm version of the XSizeHints structure: */ typedef struct _SizeHints { int icccVersion; long flags; int x; /* R2 conventions */ int y; /* R2 conventions */ int width; /* R2 conventions */ int height; /* R2 conventions */ int min_width; int min_height; int max_width; int max_height; int width_inc; int height_inc; AspectRatio min_aspect; AspectRatio max_aspect; int base_width; /* current conventions */ int base_height; /* current conventions */ int win_gravity; /* current conventions */ } SizeHints; /* mwm version of the xPropWMState structure: */ typedef struct _PropWMState { unsigned long state; unsigned long icon; } PropWMState; #define PROP_WM_STATE_ELEMENTS 2 /* ICCC versions (icccVersion): */ #define ICCC_R2 0 #define ICCC_CURRENT 1 #define ICCC_UNKNOWN ICCC_CURRENT /* SizeHints flags field values: */ #define US_POSITION (1L << 0) #define US_SIZE (1L << 1) #define P_POSITION (1L << 2) #define P_SIZE (1L << 3) #define P_MIN_SIZE (1L << 4) #define P_MAX_SIZE (1L << 5) #define P_RESIZE_INC (1L << 6) #define P_ASPECT (1L << 7) #define P_BASE_SIZE (1L << 8) #define P_WIN_GRAVITY (1L << 9) /* PropWMState state field value: */ #define WithdrawnSTATE 0 motif-2.3.8/clients/mwm/WmDebug.h0000644000175000017500000000231113145162623013527 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _WM_DEBUG_ #define _WM_DEBUG_ #ifdef MWM_DEBUG # ifndef PRINT # define PRINT printf # endif #else # ifndef PRINT # ifdef _NO_PROTO static int noop () { return 0; } # else static int noop (char *fmt, ...) { return 0; } # endif # define PRINT noop # endif #endif /* MWM_DEBUG */ #endif /* _WM_DEBUG_ */ motif-2.3.8/clients/mwm/WmProperty.h0000644000175000017500000000474113145162623014336 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ extern SizeHints * GetNormalHints (ClientData *pCD); extern void ProcessWmProtocols (ClientData *pCD); extern void ProcessMwmMessages (ClientData *pCD); extern void SetMwmInfo (Window propWindow, long flags, Window wmWindow); #ifdef WSM void SetMwmSaveSessionInfo (Window wmWindow); #endif /* WSM */ extern PropWMState * GetWMState (Window window); extern void SetWMState (Window window, int state, Window icon); extern PropMwmHints * GetMwmHints (ClientData *pCD); extern PropMwmInfo * GetMwmInfo (Window rootWindowOfScreen); extern void ProcessWmColormapWindows (ClientData *pCD); extern Colormap FindColormap (ClientData *pCD, Window window); extern MenuItem * GetMwmMenuItems (ClientData *pCD); #ifdef WSM extern void GetInitialPropertyList (ClientData *pCD); extern Status GetWorkspaceHints (Display *display, Window window, Atom **ppWsAtoms, unsigned int *pCount, Boolean *pbAll); #ifdef HP_VUE extern void SetWorkspaceInfo (Window propWindow, WorkspaceInfo *pWsInfo, unsigned long cInfo); #endif /* HP_VUE */ extern void SetWorkspacePresence (Window propWindow, Atom *pWsPresence, unsigned long cPresence); extern Boolean HasProperty(ClientData *pCD, Atom property); extern void DiscardInitialPropertyList (ClientData *pCD); extern void GetInitialPropertyList (ClientData *pCD); extern void SetWorkspaceListProperty (WmScreenData *pSD); extern void SetCurrentWorkspaceProperty (WmScreenData *pSD); extern void SetWorkspaceInfoProperty (WmWorkspaceData *pWS); extern void DeleteWorkspaceInfoProperty (WmWorkspaceData *pWS); extern char *WorkspacePropertyName (WmWorkspaceData *pWS); #endif /* WSM */ motif-2.3.8/clients/mwm/WmCDInfo.c0000644000175000017500000010720513145162623013606 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmCDInfo.c /main/4 1995/11/01 11:32:15 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmCDInfo.h" /*************************************<->************************************* * * unsigned int TitleTextHeight (pcd) * * * Description: * ----------- * Returns the height of the title text plus padding * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * TitleTextHeight - Height of title text plus padding * * Comments: * -------- * *************************************<->***********************************/ unsigned int TitleTextHeight (ClientData *pcd) { unsigned int ttextheight; #ifndef NO_MULTIBYTE if (DECOUPLE_TITLE_APPEARANCE(pcd)) { ttextheight = CLIENT_TITLE_APPEARANCE(pcd).titleHeight; } else { ttextheight = CLIENT_APPEARANCE(pcd).titleHeight; } #else XFontStruct *font; if (DECOUPLE_TITLE_APPEARANCE(pcd)) { font = CLIENT_TITLE_APPEARANCE(pcd).font; } else { font = CLIENT_APPEARANCE(pcd).font; } if (font) { ttextheight = TEXT_HEIGHT(font) + WM_TITLE_BAR_PADDING; } else { /* * Failed to load any font! (probably due to error in * font path, toolkit, or resource converter. Set to * arbitrary value for robustness. * */ ttextheight = 16; } #endif return (ttextheight); } /*************************************<->************************************* * * unsigned int InitTitleBarHeight (pcd) * * * Description: * ----------- * Used to initialize pCD->frameInfo.titleBarHeight which is used by the new * macro TitleBarHeight(). Returns the height of the title bar. * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * InitTitleBarHeight - height of title bar, 0 if no title bar. * * Comments: * -------- * *************************************<->***********************************/ unsigned int InitTitleBarHeight (ClientData *pcd) { unsigned int tbarheight; if (pcd->decor & MWM_DECOR_TITLE) { tbarheight = TitleTextHeight(pcd); } else { tbarheight = 0; } return (tbarheight); } /*************************************<->************************************* * * unsigned int UpperBorderWidth (pcd) * * * Description: * ----------- * Returns the width of the upper frame border * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * UpperBorderWidth - width of the upper frame border * * Comments: * -------- * The upper border width is thinner if there is a title bar. The * title bar appears to sit across some of the inside beveling to * make the frame look more integrated. * *************************************<->***********************************/ unsigned int UpperBorderWidth (ClientData *pcd) { unsigned int uswidth; unsigned int decoration = pcd->decor; if (decoration & MWM_DECOR_RESIZEH) { uswidth = RESIZE_BORDER_WIDTH(pcd); } else if (decoration & MWM_DECOR_BORDER) { uswidth = FRAME_BORDER_WIDTH(pcd); #ifdef PANELIST if((pcd->clientFlags & FRONT_PANEL_BOX) && (uswidth > 0)) { uswidth -= 1; } #endif /* PANELIST */ } else if ((decoration & MWM_DECOR_TITLE) || (pcd->matteWidth > 0)) { uswidth = 0; } else { uswidth = pcd->xBorderWidth; } return (uswidth); } /*************************************<->************************************* * * unsigned int LowerBorderWidth (pcd) * * * Description: * ----------- * Returns the width of the lower frame border * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * LowerBorderWidth - width of the lower frame border * * Comments: * -------- * The upper border width is thinner than the lower border if there * is a title bar. The title bar appears to sit across some of the * inside beveling to make the frame look more integrated. * *************************************<->***********************************/ unsigned int LowerBorderWidth (ClientData *pcd) { unsigned int lswidth; unsigned int decoration = pcd->decor; if (decoration & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { if ((pcd->matteWidth == 0) && (decoration & MWM_DECOR_TITLE) && (wmGD.frameStyle == WmRECESSED)) lswidth = UpperBorderWidth (pcd) + (pcd->internalBevel - JOIN_BEVEL(pcd)); else lswidth = UpperBorderWidth (pcd); } else if (pcd->matteWidth > 0) { lswidth = 0; } else { lswidth = pcd->xBorderWidth; } return (lswidth); } /*************************************<->************************************* * * unsigned int FrameWidth (pcd) * * * Description: * ----------- * Returns the width of the frame * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * FrameWidth - width of frame * * Comments: * -------- * *************************************<->***********************************/ unsigned int FrameWidth (ClientData *pcd) { unsigned int frameWidth; frameWidth = ((pcd->maxConfig) ? pcd->maxWidth : pcd->clientWidth) + 2*pcd->matteWidth + 2*LowerBorderWidth (pcd); return (frameWidth); } /*************************************<->************************************* * * unsigned int CornerWidth (pcd) * * * Description: * ----------- * Returns the width of the corner frame resize handle * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * CornerWidth - width of the corner resize handle * * Comments: * -------- * *************************************<->***********************************/ unsigned int CornerWidth (ClientData *pcd) { unsigned int cwidth; unsigned int frameWidth = FrameWidth (pcd); /* adjust for resize border (default border if no resize wanted) */ if (pcd->decor & MWM_DECOR_RESIZEH) { /* corner size is driven by title bar height */ cwidth = TitleTextHeight(pcd) + UpperBorderWidth (pcd); /* scale down corners to make resize pieces proportional */ if (3*cwidth > frameWidth) cwidth = frameWidth / 3; } else { /* no resizing functions */ cwidth = 0; } return (cwidth); } /*************************************<->************************************* * * unsigned int FrameHeight (pcd) * * * Description: * ----------- * Returns the height of the frame * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * FrameHeight - position of frame * * Comments: * -------- * *************************************<->***********************************/ unsigned int FrameHeight (ClientData *pcd) { unsigned int frameHeight; if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { frameHeight = ((pcd->maxConfig) ? pcd->maxHeight : pcd->clientHeight) + 2*pcd->matteWidth + LowerBorderWidth (pcd) + UpperBorderWidth (pcd) + TitleBarHeight(pcd); } else { frameHeight = ((pcd->maxConfig) ? pcd->maxHeight : pcd->clientHeight) + 2*pcd->matteWidth + 2*LowerBorderWidth (pcd) + TitleBarHeight(pcd); } return (frameHeight); } /*************************************<->************************************* * * unsigned int CornerHeight (pcd) * * * Description: * ----------- * Returns the height of the corner frame resize handle * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * CornerHeight - Height of the corner resize handle * * Comments: * -------- * *************************************<->***********************************/ unsigned int CornerHeight (ClientData *pcd) { unsigned int cheight; unsigned int frameHeight = FrameHeight (pcd); /* adjust for resize border (default border if no resize wanted) */ if (pcd->decor & MWM_DECOR_RESIZEH) { /* corner size is driven by title bar height */ cheight = TitleTextHeight(pcd) + UpperBorderWidth (pcd); /* scale down corners to make resize pieces proportional */ if (3*cheight > frameHeight) cheight = frameHeight / 3; } else { /* produce default border with no resizing functions */ cheight = 0; } return (cheight); } /*************************************<->************************************* * * int BaseWindowX (pcd) * * * Description: * ----------- * Returns the X coord of the base window in the frame * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * BaseWindowX * * Comments: * -------- * *************************************<->***********************************/ int BaseWindowX (ClientData *pcd) { int rval; if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) rval = LowerBorderWidth(pcd); else rval = 0; return (rval); } /*************************************<->************************************* * * int BaseWindowY (pcd) * * * Description: * ----------- * Returns the Y coord of the base window in the frame * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * BaseWindowY * * Comments: * -------- * *************************************<->***********************************/ int BaseWindowY (ClientData *pcd) { int rval; if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) rval = UpperBorderWidth (pcd) + TitleBarHeight(pcd); else rval = TitleBarHeight(pcd); return (rval); } /*************************************<->************************************* * * int FrameX (pcd) * * * Description: * ----------- * Returns the X-coordinate of the frame for the window * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * FrameX - X position of frame * * Comments: * -------- * *************************************<->***********************************/ int FrameX (ClientData *pcd) { int frameX; frameX = ((pcd->maxConfig) ? pcd->maxX : pcd->clientX) - LowerBorderWidth (pcd) - pcd->matteWidth; return (frameX); } /*************************************<->************************************* * * int FrameY (pcd) * * * Description: * ----------- * Returns the Y-coordinate of the frame for the window * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * FrameY - Y position of frame * * Comments: * -------- * *************************************<->***********************************/ int FrameY (ClientData *pcd) { int frameY; frameY = ((pcd->maxConfig) ? pcd->maxY : pcd->clientY) - UpperBorderWidth (pcd) - TitleBarHeight (pcd) - pcd->matteWidth; if ((pcd->decor & MWM_DECOR_TITLE) && !(pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) && !(pcd->matteWidth)) { frameY -= pcd->xBorderWidth; } return (frameY); } /*************************************<->************************************* * * unsigned int BaseWindowWidth (pcd) * * * Description: * ----------- * Returns the width of the base window * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * BaseWindowWidth * * Comments: * -------- * o Based on code taken out of FrameWidth to make it a little * more efficient. * *************************************<->***********************************/ unsigned int BaseWindowWidth (ClientData *pcd) { unsigned int rval; if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { /* * rval = FrameWidth(pcd) - 2*LowerBorderWidth(pcd); */ rval = ((pcd->maxConfig) ? pcd->maxWidth : pcd->clientWidth) + 2*pcd->matteWidth; } else { /* * rval = FrameWidth(pcd); */ rval = ((pcd->maxConfig) ? pcd->maxWidth : pcd->clientWidth) + 2*pcd->matteWidth + 2*LowerBorderWidth (pcd); } return (rval); } /*************************************<->************************************* * * unsigned int BaseWindowHeight (pcd) * * * Description: * ----------- * Returns the height of the base window * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * BaseWindowHeight * * Comments: * -------- * o Based on code taken out of FrameHeight to make it a little * more efficient. * *************************************<->***********************************/ unsigned int BaseWindowHeight (ClientData *pcd) { unsigned int rval; if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { /* * rval = FrameHeight(pcd) - LowerBorderWidth(pcd) - * UpperBorderWidth(pcd) - TitleBarHeight(pcd); */ rval = ((pcd->maxConfig) ? pcd->maxHeight : pcd->clientHeight) + 2*pcd->matteWidth; } else { /* * rval = FrameHeight(pcd) - TitleBarHeight(pcd); */ rval = ((pcd->maxConfig) ? pcd->maxHeight : pcd->clientHeight) + 2*pcd->matteWidth + 2*LowerBorderWidth (pcd); } return (rval); } /*************************************<->************************************* * * Boolean GetFramePartInfo (pcd, part, pX, pY, pWidth, pHeight) * * * Description: * ----------- * Gets frame relative position and size of the specified frame part * * * Inputs: * ------ * pcd - pointer to client data * part - part id (e.g. FRAME_TITLE, FRAME_SYSTEM, etc.) * pX - pointer to x-coord return value * pY - pointer to y-coord return value * pWidth - pointer to width return value * pHeight - pointer to width return value * * * Outputs: * ------- * Return - True if values returned, false if no such part for this * frame (values undefined). * * * Comments: * -------- * *************************************<->***********************************/ Boolean GetFramePartInfo (ClientData *pcd, int part, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight) { unsigned int boxdim = TitleBarHeight (pcd); unsigned long decor = pcd->decor; int vert, horiz; Boolean rval = FALSE; switch (part) { case FRAME_SYSTEM: if (decor & MWM_DECOR_MENU) { *pX = pcd->frameInfo.upperBorderWidth; *pY = pcd->frameInfo.upperBorderWidth; *pWidth = boxdim; *pHeight = boxdim; rval = TRUE; } break; case FRAME_TITLE: if (decor & MWM_DECOR_TITLE) { *pX = pcd->frameInfo.upperBorderWidth + ((decor & MWM_DECOR_MENU) ? boxdim : 0); *pY = pcd->frameInfo.upperBorderWidth; *pWidth = pcd->frameInfo.width - 2*pcd->frameInfo.upperBorderWidth - ((decor & MWM_DECOR_MENU) ? boxdim : 0) - ((decor & MWM_DECOR_MINIMIZE) ? boxdim : 0) - ((decor & MWM_DECOR_MAXIMIZE) ? boxdim : 0); *pHeight = boxdim; rval = TRUE; } break; #ifdef WSM case FRAME_TITLEBAR: if (decor & MWM_DECOR_TITLE) { *pX = pcd->frameInfo.upperBorderWidth; *pY = pcd->frameInfo.upperBorderWidth; *pWidth = pcd->frameInfo.width - 2*pcd->frameInfo.upperBorderWidth; *pHeight = boxdim; rval = TRUE; } break; #endif /* WSM */ case FRAME_MINIMIZE: if (decor & MWM_DECOR_MINIMIZE) { *pX = pcd->frameInfo.width - pcd->frameInfo.upperBorderWidth - boxdim - ((decor & MWM_DECOR_MAXIMIZE) ? boxdim : 0); *pY = pcd->frameInfo.upperBorderWidth; *pWidth= boxdim; *pHeight = boxdim; rval = TRUE; } break; case FRAME_MAXIMIZE: if (decor & MWM_DECOR_MAXIMIZE) { *pX = pcd->frameInfo.width - pcd->frameInfo.upperBorderWidth - boxdim; *pY = pcd->frameInfo.upperBorderWidth; *pWidth = boxdim; *pHeight = boxdim; rval = TRUE; } break; /* * For very small windows, the resize pieces will shrink * equally until the corner pieces get within two pixels * of the resize border width. At this point the "side" section * is killed off (by giving it a zero length) and the corner * pieces claim the additional space */ case FRAME_RESIZE_NW: if (decor & MWM_DECOR_RESIZEH) { *pX = 0; *pY = 0; if ((int)pcd->frameInfo.cornerWidth > (int)pcd->frameInfo.lowerBorderWidth+2) { *pWidth = pcd->frameInfo.cornerWidth; } else { horiz = pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth; *pWidth = pcd->frameInfo.cornerWidth + horiz/2 + horiz%2; } if ((int)pcd->frameInfo.cornerHeight > (int)pcd->frameInfo.lowerBorderWidth+2) { *pHeight = pcd->frameInfo.cornerHeight; } else { vert = pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight; *pHeight = pcd->frameInfo.cornerHeight + vert/2 + vert%2; } rval = TRUE; } break; case FRAME_RESIZE_N: if (decor & MWM_DECOR_RESIZEH) { *pX = pcd->frameInfo.cornerWidth; *pY = 0; *pHeight = pcd->frameInfo.upperBorderWidth; if ((int)pcd->frameInfo.cornerWidth > (int)pcd->frameInfo.lowerBorderWidth+2) { *pWidth = pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth; } else { *pWidth = 0; } rval = TRUE; } break; case FRAME_RESIZE_NE: if (decor & MWM_DECOR_RESIZEH) { if ((int)pcd->frameInfo.cornerWidth > (int)pcd->frameInfo.lowerBorderWidth+2) { *pWidth = pcd->frameInfo.cornerWidth; } else { horiz = pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth; *pWidth = pcd->frameInfo.cornerWidth + horiz/2; } *pX = pcd->frameInfo.width - *pWidth; if ((int)pcd->frameInfo.cornerHeight > (int)pcd->frameInfo.lowerBorderWidth+2) { *pHeight = pcd->frameInfo.cornerHeight; } else { vert = pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight; *pHeight = pcd->frameInfo.cornerHeight + vert/2 + vert%2; } *pY = 0; rval = TRUE; } break; case FRAME_RESIZE_E: if (decor & MWM_DECOR_RESIZEH) { *pX = pcd->frameInfo.width - pcd->frameInfo.lowerBorderWidth; *pY = pcd->frameInfo.cornerHeight; *pWidth = pcd->frameInfo.lowerBorderWidth; if ((int)pcd->frameInfo.cornerHeight > (int)pcd->frameInfo.lowerBorderWidth+2) { *pHeight = pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight; } else { *pHeight = 0; } rval = TRUE; } break; case FRAME_RESIZE_SE: if (decor & MWM_DECOR_RESIZEH) { if ((int)pcd->frameInfo.cornerWidth > (int)pcd->frameInfo.lowerBorderWidth+2) { *pWidth = pcd->frameInfo.cornerWidth; } else { horiz = pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth; *pWidth = pcd->frameInfo.cornerWidth + horiz/2; } *pX = pcd->frameInfo.width - *pWidth; if ((int)pcd->frameInfo.cornerHeight > (int)pcd->frameInfo.lowerBorderWidth+2) { *pHeight = pcd->frameInfo.cornerHeight; } else { vert = pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight; *pHeight = pcd->frameInfo.cornerHeight + vert/2; } *pY = pcd->frameInfo.height - *pHeight; rval = TRUE; } break; case FRAME_RESIZE_S: if (decor & MWM_DECOR_RESIZEH) { *pX = pcd->frameInfo.cornerWidth; *pY = pcd->frameInfo.height - pcd->frameInfo.lowerBorderWidth; if ((int)pcd->frameInfo.cornerWidth > (int)pcd->frameInfo.lowerBorderWidth+2) { *pWidth = pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth; } else { *pWidth = 0; } *pHeight = pcd->frameInfo.lowerBorderWidth; rval = TRUE; } break; case FRAME_RESIZE_SW: if (decor & MWM_DECOR_RESIZEH) { if ((int)pcd->frameInfo.cornerWidth > (int)pcd->frameInfo.lowerBorderWidth+2) { *pWidth = pcd->frameInfo.cornerWidth; } else { horiz = pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth; *pWidth = pcd->frameInfo.cornerWidth + horiz/2 + horiz%2; } *pX = 0; if ((int)pcd->frameInfo.cornerHeight > (int)pcd->frameInfo.lowerBorderWidth+2) { *pHeight = pcd->frameInfo.cornerHeight; } else { vert = pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight; *pHeight = pcd->frameInfo.cornerHeight + vert/2; } *pY = pcd->frameInfo.height - *pHeight; rval = TRUE; } break; case FRAME_RESIZE_W: if (decor & MWM_DECOR_RESIZEH) { *pX = 0; *pY = pcd->frameInfo.cornerHeight; *pWidth = pcd->frameInfo.lowerBorderWidth; if ((int)pcd->frameInfo.cornerHeight > (int)pcd->frameInfo.lowerBorderWidth+2) { *pHeight = pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight; } else { *pHeight = 0; } rval = TRUE; } break; default: break; } return(rval); } /*************************************<->************************************* * * IdentifyFramePart (pCD, x, y) * * * Description: * ----------- * Returns an ID representing which part of the frame received the event * * * Inputs: * ------ * pCD - pointer to client data * * x, y - client coordinates of event * * * Outputs: * ------- * Return - ID of frame part where the button event occurred. * * * Comments: * -------- *************************************<->***********************************/ int IdentifyFramePart (ClientData *pCD, int x, int y) { unsigned long decor = pCD->decor; int clientWidth = (pCD->maxConfig) ? pCD->maxWidth : pCD->clientWidth; int clientHeight= (pCD->maxConfig) ? pCD->maxHeight : pCD->clientHeight; int rval; /* check for client window */ if ( (x >= pCD->clientOffset.x) && (x < pCD->clientOffset.x + clientWidth) && (y >= pCD->clientOffset.y) && (y < pCD->clientOffset.y + clientHeight) ) { return (FRAME_CLIENT); } /* check for client matte */ if (pCD->matteWidth) { if ( (x >= pCD->matteRectangle.x) && (x < (int)pCD->matteRectangle.x + (int)pCD->matteRectangle.width) && (y >= pCD->matteRectangle.y) && (y < (int)pCD->matteRectangle.y + (int)pCD->matteRectangle.height) ) { return (FRAME_MATTE); } } /* check title bar */ if (decor & MWM_DECOR_TITLE) { if ( (x >= pCD->titleRectangle.x) && (x < (int)pCD->titleRectangle.x + (int)pCD->titleRectangle.width) && (y >= pCD->titleRectangle.y) && (y < (int)pCD->titleRectangle.y + (int)pCD->titleRectangle.height) ) { return(GadgetID(x, y, pCD->pTitleGadgets, (unsigned int)pCD->cTitleGadgets)); } } /* try resize border */ if (decor & MWM_DECOR_RESIZEH) { rval = GadgetID(x, y, pCD->pResizeGadgets, STRETCH_COUNT); } else { rval = FRAME_NONE; } /* if not a resize border, but still in bounds return FRAME_NBORDER */ if (rval == FRAME_NONE) { if ((x >= 0) && (y >= 0) && (x < FrameWidth (pCD)) && (y < FrameHeight (pCD))) { rval = FRAME_NBORDER; } } return (rval); } /* END OF FUNCTION IdentifyFramePart */ /*************************************<->************************************* * * GadgetID (x, y, pgadget, count) * * * Description: * ----------- * returns the id of the gadget in the list that the event occured in * * * Inputs: * ------ * x - x coordinate of event * y - y coordinate of event * pgadget - pointer to a list of GadgetRectangles * count - number of elements in the pgadget list * * Outputs: * ------- * Return - ID of gadget if found, FRAME_NONE if not found * * * Comments: * -------- * * *************************************<->***********************************/ int GadgetID (int x, int y, GadgetRectangle *pgadget, unsigned int count) { int ix; for (ix = 0; ix < count; ix++, pgadget++) { if ( (x >= pgadget->rect.x) && (x < (int)pgadget->rect.x + (int)pgadget->rect.width) && (y >= pgadget->rect.y) && (y < (int)pgadget->rect.y + (int)pgadget->rect.height) ) { return ((unsigned long) pgadget->id); } } return(FRAME_NONE); } /*************************************<->************************************* * * FrameToClient (pcd, pX, pY, pWidth, pHeight) * * * Description: * ----------- * Converts frame position and size to client position and size * * * Inputs: * ------ * pcd - pointer to client data * pX - pointer to frame x-coord * pY - pointer to frame y-coord * pWidth - pointer to frame width in pixels * pHeight - pointer to frame height in pixels * * Outputs: * ------- * *pX - client x-coord * *pY - client y-coord * *pWidth - client width in pixels * *pHeight - client height in pixels * * * Comments: * -------- * *************************************<->***********************************/ void FrameToClient (ClientData *pcd, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight) { /* compute client window coordinates from frame coordinates */ *pWidth = *pWidth - 2*pcd->clientOffset.x; *pHeight = *pHeight - pcd->clientOffset.x - pcd->clientOffset.y; *pX = *pX + pcd->clientOffset.x; *pY = *pY + pcd->clientOffset.y; } /*************************************<->************************************* * * ClientToFrame (pcd, pX, pY, pWidth, pHeight) * * * Description: * ----------- * Converts frame position and size to client position and size * * * Inputs: * ------ * pcd - pointer to client data * pX - client x-coord * pY - client y-coord * pWidth - client width in pixels * pHeight - client height in pixels * * Outputs: * ------- * *pX - frame x-coord * *pY - frame y-coord * *pWidth - frame width in pixels * *pHeight - frame height in pixels * * * Comments: * -------- * *************************************<->***********************************/ void ClientToFrame (ClientData *pcd, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight) { /* compute client window coordinates from frame coordinates */ *pWidth = *pWidth + 2*pcd->clientOffset.x; *pHeight = *pHeight + pcd->clientOffset.x + pcd->clientOffset.y; *pX = *pX - pcd->clientOffset.x; *pY = *pY - pcd->clientOffset.y; } /*************************************<->************************************* * * Boolean GetDepressInfo (pcd, part, pX, pY, pWidth, pHeight) * * * Description: * ----------- * Gets frame relative position, size, and width of the beveling * to show the gadget in its depressed state. * * * Inputs: * ------ * pcd - pointer to client data * part - part id (e.g. FRAME_TITLE, FRAME_SYSTEM, etc.) * pX - pointer to x-coord return value * pY - pointer to y-coord return value * pWidth - pointer to width return value * pHeight - pointer to width return value * pInverWidth - pointer to inversion width return value * * * Outputs: * ------- * Return - True if values returned, false if no such part for this * frame (values undefined). * * * Comments: * -------- * o The "part" must be a title bar gadget. * *************************************<->***********************************/ Boolean GetDepressInfo (ClientData *pcd, int part, int *pX, int *pY, unsigned int *pWidth, unsigned int *pHeight, unsigned int *pInvertWidth) { Boolean rval; unsigned int exBevel, eBevel; unsigned int wBevel, sBevel; unsigned int insideBevel, meBevel; unsigned int decoration = pcd->decor; unsigned int tmp; switch (part) { case FRAME_SYSTEM: case FRAME_TITLE: case FRAME_MINIMIZE: case FRAME_MAXIMIZE: if ((rval = GetFramePartInfo (pcd, part, pX, pY, pWidth, pHeight))) { /* * set bevel width based on join bevel */ *pInvertWidth = 1 + (JOIN_BEVEL(pcd) / 2); /* bevel between title and client (or matte) */ insideBevel = (pcd->matteWidth > 0) ? JOIN_BEVEL(pcd) : pcd->internalBevel; /* * Compute beveling around the title area of the * title bar. */ if (decoration & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { exBevel = JOIN_BEVEL(pcd); /* north side */ sBevel = insideBevel; /* south side */ eBevel = JOIN_BEVEL(pcd); /* east side */ wBevel = JOIN_BEVEL(pcd); /* west side */ meBevel = JOIN_BEVEL(pcd); /* east of Min */ } else { /* borderless window */ exBevel = EXTERNAL_BEVEL(pcd); sBevel = (pcd->matteWidth > 0) ? insideBevel : EXTERNAL_BEVEL(pcd); eBevel = (decoration & (MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE))? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); wBevel = (decoration & MWM_DECOR_MENU) ? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); meBevel = (decoration & (MWM_DECOR_MAXIMIZE)) ? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); } /* * Adjust height of all title bar gadgets if necessary. * (The bottom bevel is the same for all the pieces.) */ if (sBevel > *pInvertWidth) { *pHeight -= (sBevel - *pInvertWidth); } /* * Adjust the beveling on the other sides of the * gadgets. */ switch (part) { case FRAME_SYSTEM: /* west and north sides */ if (exBevel > *pInvertWidth) { tmp = exBevel - *pInvertWidth; *pX += tmp; *pWidth -= tmp; *pY += tmp; *pHeight -= tmp; } /* east side */ if (wBevel > *pInvertWidth) { *pWidth -= (wBevel - *pInvertWidth); } break; case FRAME_TITLE: /* west side */ if (wBevel > *pInvertWidth) { tmp = wBevel - *pInvertWidth; *pX += tmp; *pWidth -= tmp; } /* north side */ if (exBevel > *pInvertWidth) { tmp = exBevel - *pInvertWidth; *pY += tmp; *pHeight -= tmp; } /* east side */ if (eBevel > *pInvertWidth) { *pWidth -= eBevel - *pInvertWidth; } break; case FRAME_MINIMIZE: /* north side */ if (exBevel > *pInvertWidth) { tmp = exBevel - *pInvertWidth; *pY += tmp; *pHeight -= tmp; } /* west side */ if (eBevel > *pInvertWidth) { tmp = eBevel - *pInvertWidth; *pX += tmp; *pWidth -= tmp; } /* east side */ if (meBevel > *pInvertWidth) { *pWidth -= meBevel - *pInvertWidth; } break; case FRAME_MAXIMIZE: /* north and east sides */ if (exBevel > *pInvertWidth) { tmp = exBevel - *pInvertWidth; *pY += tmp; *pHeight -= tmp; *pWidth -= tmp; } /* west side */ if (eBevel > *pInvertWidth) { tmp = eBevel - *pInvertWidth; *pX += tmp; *pWidth -= tmp; } break; } /* end switch */ } /* end case "title bar part" */ break; default: rval = False; break; } /* end switch */ return (rval); } /*************************************<->************************************* * * SetFrameInfo (pcd) * * * Description: * ----------- * Sets frame information into client data structure for easy access. * * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * Comments: * -------- * o Sets values into the FrameInfo component of the client data structure * *************************************<->***********************************/ void SetFrameInfo (ClientData *pcd) { /* * The title bar height value stored in pcd->frameInfo is used by the * macro TitleBarHeight(pcd). */ pcd->frameInfo.titleBarHeight = InitTitleBarHeight (pcd); pcd->frameInfo.x = FrameX (pcd); pcd->frameInfo.y = FrameY (pcd); pcd->frameInfo.width = FrameWidth (pcd); pcd->frameInfo.height = FrameHeight (pcd); pcd->frameInfo.upperBorderWidth = UpperBorderWidth (pcd); pcd->frameInfo.lowerBorderWidth = LowerBorderWidth (pcd); pcd->frameInfo.cornerWidth = CornerWidth (pcd); pcd->frameInfo.cornerHeight = CornerHeight (pcd); /* set client offset */ if ( (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) || (pcd->matteWidth > 0) ) { /* * The window has a window manager border. */ pcd->clientOffset.x = pcd->frameInfo.lowerBorderWidth + pcd->matteWidth; pcd->clientOffset.y = pcd->frameInfo.upperBorderWidth + pcd->frameInfo.titleBarHeight + pcd->matteWidth; } else { /* * No window manager border, the original X border is showing * through. */ pcd->clientOffset.x = pcd->xBorderWidth + pcd->matteWidth; pcd->clientOffset.y = pcd->xBorderWidth + pcd->frameInfo.titleBarHeight + pcd->matteWidth; } } /*************************************<->************************************* * * SetClientOffset (pcd) * * * Description: * ----------- * Sets the client offset into client data structure * * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * Comments: * -------- * This can be called before SetFrameInfo to set up the client offset * without the danger of using uninitialized variables during * extraneous computation. * *************************************<->***********************************/ void SetClientOffset (ClientData *pcd) { /* * The title bar height value stored in pcd->frameInfo is used by the * macro TitleBarHeight(pcd). */ pcd->frameInfo.titleBarHeight = InitTitleBarHeight (pcd); pcd->frameInfo.upperBorderWidth = UpperBorderWidth (pcd); pcd->frameInfo.lowerBorderWidth = LowerBorderWidth (pcd); /* set client offset */ if ( (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) || (pcd->matteWidth > 0) ) { /* * The window has a window manager border. */ pcd->clientOffset.x = pcd->frameInfo.lowerBorderWidth + pcd->matteWidth; pcd->clientOffset.y = pcd->frameInfo.upperBorderWidth + pcd->frameInfo.titleBarHeight + pcd->matteWidth; } else { /* * No window manager border, the original X border is showing * through. */ pcd->clientOffset.x = pcd->xBorderWidth + pcd->matteWidth; pcd->clientOffset.y = pcd->xBorderWidth + pcd->frameInfo.titleBarHeight + pcd->matteWidth; } } /*************************************<->************************************* * * XBorderIsShowing (pcd) * * * Description: * ----------- * Returns true if the X border is showing. * * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * XBorderIsShowing - True if no window manager border & x border is * visible, False otherwise * * Comments: * -------- * *************************************<->***********************************/ Boolean XBorderIsShowing (ClientData *pcd) { Boolean rval; if ( (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) || (pcd->matteWidth > 0) ) { rval = False; /* hidden by window manager */ } else { rval = True; /* it's showing */ } return(rval); } motif-2.3.8/clients/mwm/WmInitWs.c0000644000175000017500000021135113145162623013717 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmInitWs.c /main/18 1999/09/20 15:18:22 mgreess $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmResNames.h" #ifdef WSM #include "WmHelp.h" #endif /* WSM */ #include "WmICCC.h" #ifdef PANELIST #define DTWM_NEED_FNTPL #include "WmIBitmap.h" #endif /* PANELIST */ #ifndef NO_OL_COMPAT #include "WmOL.h" #endif /* NO_OL_COMPAT */ #include #include #include #include #include #include #include #ifndef NO_HP_KEY_REMAP #include #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # include #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ typedef struct { String default_name ; String new_name ; } str_xref_rec, *str_xref ; #endif /* NO_HP_KEY_REMAP */ #ifdef WSM #include
#include
#include
#include
#include
#endif /* WSM */ /* Busy is also defined in the BMS -> bms.h. This conflicts with * /usr/include/X11/Xasync.h on ibm. */ #ifdef _AIX #ifdef Busy #undef Busy #endif #endif #include /* * include extern functions */ #ifdef WSM #include "WmBackdrop.h" #endif /* WSM */ #include "WmCDInfo.h" #include "WmColormap.h" #include "WmError.h" #include "WmEvent.h" #include "WmFeedback.h" #include "WmFunction.h" #include "WmIDecor.h" #ifdef WSM #include "WmIPC.h" #endif /* WSM */ #include "WmIPlace.h" #include "WmIconBox.h" #include "WmKeyFocus.h" #ifdef PANELIST #include "WmPanelP.h" /* for typedef in WmManage.h */ #endif /* PANELIST */ #include "WmManage.h" #include "WmMenu.h" #ifdef WSM #include "WmPresence.h" #endif /* WSM */ #include "WmProperty.h" #include "WmResCvt.h" #include "WmResource.h" #include "WmSignal.h" #include "WmProtocol.h" #include "WmCDecor.h" #include "stdio.h" #include "WmResParse.h" #ifdef WSM #include #endif /* WSM */ #include "WmXSMP.h" #include "Xm/VirtKeysI.h" /* * Function Declarations: */ #include "WmInitWs.h" #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # include "WmWsmLib/wsm_proto.h" # include "WmWsmLib/utm_send.h" #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #ifdef WSM static void InsureDefaultBackdropDir(char **ppchBackdropDirs); #endif /* WSM */ void InitWmDisplayEnv (void); #ifndef NO_MESSAGE_CATALOG void InitNlsStrings (void); #endif #ifndef NO_HP_KEY_REMAP Boolean VirtKeys4DIN(Display *dpy); #endif /* NO_HP_KEY_REMAP */ #ifdef WSM /* limited to 3 chars max */ #define UNSPECIFIED_SCREEN_NAME "fbk" char **dpy2Argv; /* copy for second display */ int dpy2Argc; #ifndef PANELIST WmScreenData *dtSD; /* for the "DT screen" of the display */ #endif /* PANELIST */ #endif /* WSM */ /* * Global Variables: */ extern int firstTime; #ifndef NO_MESSAGE_CATALOG extern char * pWarningStringFile; extern char * pWarningStringLine; #endif /* * InitMouseBinding * * Special case for a two button mouse; move the BMENU binding * from Button3 to Button2. Fails for one-button mice. */ static void InitMouseBinding(void) { wmGD.numMouseButtons = XGetPointerMapping(DISPLAY, (unsigned char *)0, 0); if (wmGD.numMouseButtons < 3) { wmGD.bMenuButton = Button2; } else { wmGD.bMenuButton = Button3; } } /******************************<->************************************* * * BuildLockMaskSequence () * * Set up the sequence of modifier masks to use to when grabbing * key- and button-bindings. This sequence of masks is NULL * terminated. * * Input: * wmGD.lockingModMask * * Output: * wmGD.pLockMaskSequence * * *************************************<->***********************************/ static void BuildLockMaskSequence(void) { int i, j, k; unsigned int mask; unsigned int thisbit; Boolean bit_on; int num_masks; int num_bits; int bit; int run; /* * Count the bits to determine the number of elements in * the mask sequence. The actual number of masks is * 2^ - 1. We're not interested in the case * where there none of the mask bits are set. */ mask = wmGD.lockingModMask; num_bits=0; while (mask) { if (mask & 0x1) { num_bits++; } mask = mask >> 1; } num_masks = (0x1 << num_bits) - 1; /* * Allocate the space for the mask sequence + terminator. */ wmGD.pLockMaskSequence = (unsigned int *) XtCalloc (num_masks+1, sizeof (unsigned int)); /* * Fill in the mask sequence */ mask = wmGD.lockingModMask; thisbit = 0x1; bit = 0; while (mask && thisbit) { /* find next bit */ while (!(thisbit & mask)) { thisbit = thisbit << 1; } /* clear it from mask */ mask &= ~thisbit; bit++; /* * Set it in the appropriate slots in the * mask sequence. The start of the loop is * funny because we skip the case of all the * bits cleared. */ run = (0x1 << (bit-1)); /* number of consecutive masks to set bits in */ bit_on = False; /* are we setting bits or not? */ for (j=0, k=run-1; j************************************* * * SetupLockingModifierMask () * * Set up the mask used to ignore locking modifier keys (e.g. Shift Lock) * when processing key- and button-bindings. * * We want to try to ignore the set of locking modifers * such as Shift Lock, Num Lock, Kana Lock, etc. This involves * some amount of guessing since these things can be mapped * onto any of the Mod1-Mod5 modifiers. The approach taken is to * identify the mapping of the locking modifier keysyms to * Mod1-Mod5 and build the set of masks needed to ignore them. * *************************************<->***********************************/ /* * This is the set of locking modifiers keysyms that might be * bound to Mod1-Mod5. (Caps Lock is handled independently of * this set.) */ static KeySym pksLockingMods[] = { XK_Scroll_Lock, XK_Kana_Lock, XK_Num_Lock, XK_Mode_switch }; #define NUM_LOCKING_MODS (sizeof(pksLockingMods)/sizeof(KeySym)) static void SetupLockingModifierMask(void) { int i, j, start_index; XModifierKeymap *modifier_map = NULL; static Modifiers mod_masks[] = { None, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask }; Display *dpy = wmGD.display; int pkcLockingMods[NUM_LOCKING_MODS]; int kcq, kc; for (i=0; imax_keypermod * Mod1MapIndex; for (i = start_index; i < modifier_map->max_keypermod * 8; i++) { int this_mod = ((i - start_index) / modifier_map->max_keypermod) + 1; kc = modifier_map->modifiermap[i]; if (kc) { for (j=0; j************************************* * * MappingEventHandler (Widget, XtPointer, XEvent *, Boolean *) * * Catch and handle changes to the mapping of the modifier keys. * *************************************<->***********************************/ static void MappingEventHandler( Widget w, XtPointer client_data, XEvent *event, Boolean *cont_to_dispatch) { if(event->xany.type != MappingNotify || event->xmapping.request == MappingPointer) return; if(event->xmapping.request == MappingModifier) SetupLockingModifierMask(); } /******************************<->************************************* * * InitWmGlobal (argc, argv, environ) * * * Description: * ----------- * This function initializes the workspace manager. * * * Inputs: * ------ * argc = number of command line arguments (+1) * * argv = window manager command line arguments * * environ = window manager environment * * * Outputs: * ------- * wmGD = (initialize the global data structure) * *************************************<->***********************************/ void InitWmGlobal (int argc, char *argv [], char *environ []) { XSetWindowAttributes sAttributes; int scr; int managed = 0; char pch[80]; Boolean activeSet = False; Boolean processedGlobalResources = False; WmScreenData *pSD; Arg args[20]; int argnum; char *res_class; int savedArgc; wmGD.errorFlag = False; #ifdef WSM #ifndef PANELIST dtSD = NULL; #else /* PANELIST */ wmGD.dtSD = NULL; wmGD.iSlideUpsInProgress = 0; #endif /*PANELIST */ #endif /* WSM */ SetupWmSignalHandlers (0); /* dummy paramater */ /* * Do (pre-toolkit) initialization: */ wmGD.windowContextType = XUniqueContext (); wmGD.screenContextType = XUniqueContext (); #ifndef IBM_169380 wmGD.cmapWindowContextType = XUniqueContext (); #endif #ifdef WSM wmGD.mwmWindowContextType = XUniqueContext (); #endif /* WSM */ /* copy argv (the XtInititalize changes the original) for use in restart */ savedArgc = argc; CopyArgv (argc, argv); wmGD.environ = environ; #ifdef WSM wmGD.pWmPB = _DtWmParseNewBuf(); #endif /* WSM */ /* set our name */ if ((wmGD.mwmName = (char*)strrchr (wmGD.argv[0], '/')) != NULL) { wmGD.mwmName++; } else { wmGD.mwmName = wmGD.argv[0]; } #ifdef WSM if (MwmBehavior) { res_class = WM_RESOURCE_CLASS; } else { res_class = DT_WM_RESOURCE_CLASS; } wmGD.statusColorServer = CSERVE_NOT_AVAILABLE; #else /* WSM */ res_class = WM_RESOURCE_CLASS; #endif /* WSM */ wmGD.display = (Display *)NULL; wmGD.topLevelW = (Widget)NULL; /* * Do X Tookit initialization: */ XtToolkitInitialize(); wmGD.mwmAppContext = XtCreateApplicationContext(); AddWmResourceConverters (); wmGD.display = XtOpenDisplay (wmGD.mwmAppContext, NULL, wmGD.mwmName, res_class, NULL, 0, &argc, /* R5 changed from Cardinal to int*/ argv); if (!wmGD.display) { Warning(((char *)GETMESSAGE(40, 1, "Could not open display."))); ExitWM (WM_ERROR_EXIT_VALUE); } #if defined(sun) && defined(ALLPLANES) { int dummy; wmGD.allplanes = XAllPlanesQueryExtension(wmGD.display, &dummy, &dummy); } #endif /* defined(sun) && defined(ALLPLANES) */ /* * Setup error handling: */ WmInitErrorHandler(wmGD.display); /* * Initialize cursor size info and * display the startup cursor. */ InitCursorInfo (); #ifdef WSM InitWmDisplayEnv (); #endif ShowWaitState (TRUE); /* * Initialize support for BMenu virtual mouse binding */ InitMouseBinding(); /* * Set up the _MOTIF_BINDINGS property on the root window * of screen 0. Must do this before we create shells. */ ProcessMotifBindings (); #ifndef NO_HP_KEY_REMAP /* VirtKeys4DIN deals with a shortcoming in the OSF/Motif * mechanism for selecting a virtual key binding table. * When a client connects to a display, code inside of libXm * gets the vendor identifier from the server and uses this * identifier to select a default virtual key binding table * from an internal list of possible tables (provided to * OSF by vendors). A virtual key binding table maps OSF * virtual keysyms to an "appropriate" set of X keysyms for * a particular server vendor. The problem with this * mechanism is that it only allows for a _single_ default * virtual key binding table per server vendor. If a * hardware vendor ships more than one distinct keyboard, * then the single virtual key binding table selected for * that server might not be appropriate for all keyboards. * The HP migration from the "ITF" keyboard to the "PC-style" * keyboard causes this problem to be exposed for Motif * clients. The default HP virtual key binding table maps * osfInsert and osfDelete to hpInsertChar and hpDeleteChar, * respectively. But since hpInsertChar and hpDeleteChar * are absent from the PC-style keyboard, HP servers with * this keyboard do not generate key events that map to the * important osfInsert and osfDelete virtual keys. * The Motif 1.2 version of libXm installs (one or two) * properties on the root window, these properties exporting * the virtual key binding table to be used by all (subsequently * connected) Motif clients. The VirtKeys4DIN routine attempts * to ensure that the virtual key binding table exported by * those properties does not include dependencies on keysyms * that are not available in the server's current modmap. * The routine accomplishes this by searching the keyboard * mapping of the display for the absence of known problematic * keysyms. For those keysyms that are missing from the * keyboard map, the corresponding dependencies in the * virtual key binding table are altered to use pre-determined * substitutes (which are generic X keysyms that are present * on the PC-style keyboard mapping). * The side-effects of this routine are that if there are no * key binding properties on the root window when this routine * is called, there will be a property installed (this occurs * with all Motif 1.2 clients anyway). Since the virtual key * binding table is only altered if it contains a keysym that * is missing from the server's keyboard mapping, there is * little chance of deleterious effects. */ VirtKeys4DIN(DISPLAY); #endif /* NO_HP_KEY_REMAP */ argnum = 0; XtSetArg (args[argnum], XtNgeometry, NULL); argnum++; XtSetArg (args[argnum], XtNx, 10000); argnum++; XtSetArg (args[argnum], XtNy, 0); argnum++; XtSetArg (args[argnum], XtNwidth, 10); argnum++; XtSetArg (args[argnum], XtNheight, 10); argnum++; XtSetArg (args[argnum], XtNmappedWhenManaged, False); argnum++; XtSetArg (args[argnum], XtNjoinSession, True); argnum++; #ifdef WSM XtSetArg (args[argnum], XtNrestartStyle, SmRestartNever); argnum++; #else XtSetArg (args[argnum], XtNrestartStyle, SmRestartIfRunning); argnum++; #endif XtSetArg (args[argnum], XtNargc, savedArgc); argnum++; XtSetArg (args[argnum], XtNargv, wmGD.argv); argnum++; /* create topmost shell (application shell) */ wmGD.topLevelW = XtAppCreateShell (NULL, res_class, sessionShellWidgetClass, DISPLAY, args, argnum); #ifdef __osf__ _XmColorObjCreate ( wmGD.topLevelW, NULL, NULL); _XmColorObjCreate ( wmGD.topLevelW, NULL, NULL); #endif XtAddEventHandler(wmGD.topLevelW, NoEventMask, True, MappingEventHandler, NULL); /* Add callbacks used for communication with Session Manager. */ AddSMCallbacks (); /* allocate namespace for screens */ InitScreenNames(); /* * Determine the screen management policy (all or none) * Process command line arguments that we handle * This could change the number of screens we manage */ ProcessGlobalScreenResources (); ProcessCommandLine (argc, argv); #ifdef WSM /* * Make sure backdrops are in our icon search path. * This call MUST occur before ANY icons are looked up either * explicitly or through resource processing!!! * Uses variables set by ProcessGlobalScreenResources and * ProcessCommandLine. */ { int sNum; Boolean useMaskRtn; Boolean useMultiColorIcons; Boolean useIconFileCacheRtn; String sBdPath; sNum = (wmGD.numScreens == 1) ? DefaultScreen(DISPLAY) : 0; XmeGetIconControlInfo(ScreenOfDisplay(DISPLAY, sNum), &useMaskRtn, &useMultiColorIcons, &useIconFileCacheRtn); sBdPath = wmGD.backdropDirs; InsureDefaultBackdropDir ((char **) &sBdPath); _DtWsmSetBackdropSearchPath(XScreenOfDisplay(DISPLAY, sNum), sBdPath, useMultiColorIcons); XtFree(sBdPath); } #endif /* WSM */ /* * Allocate data and initialize for screens we manage: */ if (!(wmGD.Screens = (WmScreenData *) XtCalloc (wmGD.numScreens, sizeof(WmScreenData)))) { ShowWaitState (FALSE); Warning (((char *)GETMESSAGE(40, 2, "Insufficient memory for Screen data"))); ExitWM (WM_ERROR_EXIT_VALUE); } else { sAttributes.event_mask = SubstructureRedirectMask; for (scr=0; scrmanaged) { #ifdef WSM if (XDefaultScreen (wmGD.display) == pSD->screen) { wmGD.commandWindow = wmGD.Screens[scr].wmWorkspaceWin; } #endif /* WSM */ /* * Initialize workspace colormap data. */ InitWorkspaceColormap (pSD); /* * Process the window manager resource description file (.mwmrc): */ #ifdef PANELIST ProcessWmFile (pSD, False /* not nested */); #else /* PANELIST */ ProcessWmFile (pSD); #endif /* PANELIST */ /* * Setup default resources for the system menu and key bindings: */ SetupDefaultResources (pSD); /* * Make global window manager facilities: */ if(pSD->iconDecoration & ICON_ACTIVE_LABEL_PART) { /* create active icon window */ CreateActiveIconTextWindow(pSD); } /* * Make menus and other resources that are used by window manager * functions that are activated by menus, buttons and keys. */ MakeWmFunctionResources (pSD); } #ifdef WSM /* * * Set root cursor to be a pointer for dtwm * */ # ifdef __osf__ /* Fixes problem on multiscreen where cursor is only * set on primary screen. */ if (DtwmBehavior) { XDefineCursor (DISPLAY, RootWindow (DISPLAY, scr), wmGD.workspaceCursor); } # endif #endif /* WSM */ } #ifdef PANELIST /* * Remove any temp config file we created if we needed to * convert DT 2.0 syntax to DT 3.0 */ DeleteTempConfigFileIfAny(); #endif /* PANELIST */ #ifdef WSM /* * Point second display's resource data base * to the first display's resource data base * so dtwm "clients" change colors dynamically. * * NEW LOCATION */ wmGD.display1->db = wmGD.display->db; #endif /* WSM */ /* * Realize the top level widget, make the window override * redirect so we don't manage it, and then move it out of the way */ XtRealizeWidget (wmGD.topLevelW); #ifdef WSM XtRealizeWidget (wmGD.topLevelW1); /* * Initialize the message handling. * (This must be done after the realize because a window * is required for ICCCM-style messaging). */ dtInitializeMessaging (wmGD.topLevelW); #endif /* WSM */ sAttributes.override_redirect = True; XChangeWindowAttributes (DISPLAY, XtWindow (wmGD.topLevelW), CWOverrideRedirect, &sAttributes); /* setup window manager inter-client communications conventions handling */ SetupWmICCC (); /* * Use the WM_SAVE_YOURSELF protocol * for notification of when to save ourself */ #ifdef WSM SetMwmSaveSessionInfo(wmGD.commandWindow); #endif /* * Initialize window manager event handling: */ InitEventHandling (); /* * Initialize frame component graphics */ { for (scr = 0; scr < wmGD.numScreens; scr++) { pSD = &(wmGD.Screens[scr]); if (pSD->managed) { InitClientDecoration (pSD); /* * Make an icon box if specificed: */ if (pSD->useIconBox) { InitIconBox (pSD); } /* * Adopt client windows that exist before wm startup: */ AdoptInitialClients (pSD); /* * Setup initial keyboard focus and colormap focus: */ InitColormapFocus (pSD); } } for (scr = 0; scr < wmGD.numScreens; scr++) { #ifdef WSM int iws; #endif /* WSM */ pSD = &(wmGD.Screens[scr]); if (pSD->managed) { ACTIVE_PSD = &wmGD.Screens[scr]; #ifdef WSM MapIconBoxes (pSD->pActiveWS); ChangeBackdrop (pSD->pActiveWS); #ifdef HP_VUE UpdateWorkspaceInfoProperty (pSD); /* backward compatible */ #endif /* HP_VUE */ SetCurrentWorkspaceProperty (pSD); SetWorkspaceListProperty (pSD); for (iws=0; iws < pSD->numWorkspaces; iws++) { SetWorkspaceInfoProperty (&(pSD->pWS[iws])); } XFlush (DISPLAY); /* MapWorkspaceBox (); */ #ifdef PANELIST /* * Allocate front panel widgets */ if (wmGD.useFrontPanel && (pSD == wmGD.dtSD)) { Pixmap iconBitmap; Arg al[5]; int ac; Widget wFpShell; WmPanelistObject pPanelist; wmGD.dtSD->wPanelist = WmPanelistAllocate(pSD->screenTopLevelW1, (XtPointer) &wmGD, (XtPointer) pSD); pPanelist = (WmPanelistObject) pSD->wPanelist; if (pPanelist != NULL && O_Shell(pPanelist)) { /* * Make a default front panel icon image. */ iconBitmap = XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *) fntpl_i_bm_bits, fntpl_i_bm_width, fntpl_i_bm_height); ac = 0; XtSetArg (al[ac], XmNiconPixmap, iconBitmap); ac++; XtSetValues (O_Shell(pPanelist), al, ac); } } if (wmGD.useFrontPanel && pSD->wPanelist && (pSD == wmGD.dtSD)) { /* * Make the front panel visible */ WmPanelistShow (pSD->wPanelist); /* * Find special clients associated with the * front panel. This needs to be done after * WmPanelistShow where the data is set up. */ ScanForPushRecallClients (pSD); ScanForEmbeddedClients (pSD); } #endif /* PANELIST */ RestoreHelpDialogs(pSD); #else /* WSM */ MapIconBoxes (pSD->pActiveWS); #endif /* WSM */ } } firstTime = 0; } InitKeyboardFocus (); #ifndef WSM InitWmDisplayEnv (); #endif ShowWaitState (FALSE); #ifdef WSM /* * Tell the rest of DT that we're up */ dtReadyNotification(); #endif /* WSM */ #ifdef DEBUG_RESOURCE_DATABASE XrmPutFileDatabase(wmGD.display->db, "/tmp/dtwm.resDB"); #endif /* DEBUG_RESOURCE_DATABASE */ } /* END OF FUNCTION InitWmGlobal */ /******************************<->************************************* * * InitWmScreen * * * Description: * ----------- * This function initializes a screen data block. * * Inputs: * ------- * pSD = pointer to preallocated screen data block * sNum = screen number for this screen * * Outputs: * ------- *************************************<->***********************************/ void InitWmScreen (WmScreenData *pSD, int sNum) { Arg args[12]; int argnum; #ifdef WSM int wsnum; WmWorkspaceData *pwsI; int buf_size; int i; static int dupnum = 0; int iwsx; #endif /* WSM */ char *pDisplayName; #define LENCBUFFER 256 char buffer[LENCBUFFER]; /* screen name & display name! */ char displayName[LENCBUFFER]; char *token1, *token2; /* * Set screen data values */ pSD->rootWindow = RootWindow (DISPLAY, sNum); pSD->clientCounter = 0; pSD->defaultSystemMenuUseBuiltin = TRUE; pSD->displayString = NULL; pSD->acceleratorMenuCount = 0; pSD->activeIconTextWin = (Window)NULL; pSD->focusPriority = 0; pSD->inputScreenWindow = (Window)NULL; pSD->colormapFocus = NULL; pSD->keySpecs = NULL; pSD->screen = sNum; pSD->confirmboxW[DEFAULT_BEHAVIOR_ACTION] = NULL; pSD->confirmboxW[CUSTOM_BEHAVIOR_ACTION] = NULL; pSD->confirmboxW[RESTART_ACTION] = NULL; pSD->confirmboxW[QUIT_MWM_ACTION] = NULL; pSD->feedbackWin = (Window)NULL; pSD->fbStyle = FB_OFF; pSD->fbWinWidth = 0; pSD->fbWinHeight = 0; pSD->fbLocation[0] = '\0'; pSD->fbSize[0] = '\0'; pSD->fbLocX = 0; pSD->fbLocY = 0; pSD->fbSizeX = 0; pSD->fbSizeY = 0; pSD->fbLastX = -1; pSD->fbLastY = -1; pSD->fbLastWidth = -1; pSD->fbLastHeight = -1; pSD->fbTop = NULL; pSD->fbBottom = NULL; pSD->actionNbr = -1; pSD->clientList = NULL; pSD->lastClient = NULL; pSD->lastInstalledColormap = (Colormap)NULL; pSD->shrinkWrapGC = NULL; pSD->bitmapCache = NULL; pSD->bitmapCacheSize = 0; pSD->bitmapCacheCount = 0; pSD->dataType = SCREEN_DATA_TYPE; pSD->managed = False; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) pSD->cciTree = NULL; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #ifdef WSM pSD->initialWorkspace=NULL; pSD->presence.shellW = NULL; pSD->presence.onScreen = False; pSD->presence.userDismissed = True; pSD->workspaceList = NULL; pSD->numWorkspaces = 0; pSD->numWsDataAllocated = 0; pSD->lastBackdropWin = NULL; pSD->pDtSessionItems = NULL; pSD->totalSessionItems = 0; pSD->remainingSessionItems = 0; pSD->cachedHelp = NULL; pSD->dtHelp.shell = (Widget)NULL; pSD->dtHelp.dialog = (Widget)NULL; pSD->dtHelp.errorDialog = (Widget)NULL; pSD->dtHelp.xPos = 0; pSD->dtHelp.yPos = 0; pSD->dtHelp.restored = False; pSD->dtHelp.onScreen = False; pSD->dtHelp.userDismissed = False; pSD->dtHelp.pCDforClient= NULL; pSD->helpResources=NULL; pSD->bMarqueeSelectionInitialized = False; pSD->woN = (Window) 0L; pSD->woS = (Window) 0L; pSD->woE = (Window) 0L; pSD->woW = (Window) 0L; #endif /* WSM */ #ifdef PANELIST pSD->wPanelist = NULL; pSD->pECD = NULL; pSD->numPushRecallClients = 0; pSD->numEmbeddedClients = 0; pSD->pPRCD = NULL; pSD->iconBoxControl = False; #endif /* PANELIST */ #ifdef WSM pSD->displayResolutionType = _DtGetDisplayResolution(DISPLAY, sNum); /* * We've got display resolution type--now, let's get color * characteristics. */ ProcessWmColors (pSD); if (!(strcmp ((char *)wmGD.screenNames[sNum], UNSPECIFIED_SCREEN_NAME))) { sprintf (buffer, "%d", sNum); buf_size = strlen(buffer) + 1; if ((wmGD.screenNames[sNum] = (unsigned char *)XtRealloc (wmGD.screenNames[sNum], buf_size)) == NULL) { Warning (((char *)GETMESSAGE(40, 7, "Cannot create enough memory for the screen names"))); ExitWM (WM_ERROR_EXIT_VALUE); } else { strcpy((char *)wmGD.screenNames[sNum], buffer); } } /* if wmGD.screenNames[sNum] == UNSPECIFIED_SCREEN_NAME */ #endif /* WSM */ /* * Save screen context */ XSaveContext (DISPLAY, pSD->rootWindow, wmGD.screenContextType, (caddr_t)pSD); /* * Create shell widget for screen resource hierarchy */ argnum = 0; XtSetArg (args[argnum], XtNgeometry, NULL); argnum++; XtSetArg (args[argnum], XtNx, 10000); argnum++; XtSetArg (args[argnum], XtNy, 10000); argnum++; XtSetArg (args[argnum], XtNwidth, 10); argnum++; XtSetArg (args[argnum], XtNheight, 10); argnum++; XtSetArg (args[argnum], XtNoverrideRedirect, True); argnum++; XtSetArg (args[argnum], XtNdepth, DefaultDepth(DISPLAY, sNum)); argnum++; XtSetArg (args[argnum], XtNscreen, ScreenOfDisplay(DISPLAY, sNum)); argnum++; XtSetArg (args[argnum], XtNcolormap, DefaultColormap(DISPLAY, sNum)); argnum++; XtSetArg (args[argnum], XtNvisual, DefaultVisual(DISPLAY, sNum)); argnum++; pSD->screenTopLevelW = XtCreatePopupShell ((String) wmGD.screenNames[sNum], vendorShellWidgetClass, wmGD.topLevelW, args, argnum); #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* Create a DrawingArea as a child of the popupShell. This will be used * to handle UTM traffic relating to cci. We need this * particular widget to get the callbacks from conversion requests made * against Mwm and the requests Mwm makes against other clients. */ pSD->utmShell = XmCreateDrawingArea(pSD->screenTopLevelW, "UTM_Shell", NULL, 0); XtManageChild(pSD->utmShell); /* * Setup the destinationCallback handler to handle conversion * requests made by Mwm against other clients. */ XtAddCallback(pSD->utmShell, XmNdestinationCallback, UTMDestinationProc, NULL); /* Must realize to own WM_i if unmapped, causes mwm to freeze when menu is displayed. */ XtPopup(pSD->screenTopLevelW, XtGrabNone); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #ifdef WSM argnum = 0; XtSetArg (args[argnum], XtNgeometry, NULL); argnum++; XtSetArg (args[argnum], XtNx, 10000); argnum++; XtSetArg (args[argnum], XtNy, 10000); argnum++; XtSetArg (args[argnum], XtNwidth, 10); argnum++; XtSetArg (args[argnum], XtNheight, 10); argnum++; XtSetArg (args[argnum], XtNoverrideRedirect, True); argnum++; XtSetArg (args[argnum], XtNmappedWhenManaged, False); argnum++; XtSetArg (args[argnum], XtNdepth, DefaultDepth(DISPLAY1, sNum)); argnum++; XtSetArg (args[argnum], XtNscreen, ScreenOfDisplay(DISPLAY1, sNum)); argnum++; XtSetArg (args[argnum], XtNcolormap, DefaultColormap(DISPLAY1, sNum)); argnum++; pSD->screenTopLevelW1 = XtCreatePopupShell ((String) wmGD.screenNames[sNum], vendorShellWidgetClass, wmGD.topLevelW1, args, argnum); XtRealizeWidget (pSD->screenTopLevelW1); #endif /* WSM */ /* * Fetch screen based resources */ ProcessScreenResources (pSD, wmGD.screenNames[sNum]); /* * Initialize other screen resources and parameters */ MakeXorGC (pSD); InitIconSize(pSD); #ifdef WSM /* * Complete initialization of workspace structures */ for (wsnum = 0, pwsI = pSD->pWS; wsnum < pSD->numWorkspaces; wsnum++, pwsI++) { /* * Set up workspace for this screen */ InitWmWorkspace (pwsI, pSD); } if (pSD->initialWorkspace) { /* * restore to the last initialWorkspace saved from * Quit, Restart, OR save session */ /* * Compare initialWorkspace against workspace name, * NOT workspace title. */ for (iwsx = 0; iwsx < pSD->numWorkspaces; iwsx++) { if (!strcmp(pSD->pWS[iwsx].name, pSD->initialWorkspace)) { break; } } /* check bounds */ if (iwsx >= pSD->numWorkspaces) { /* make first workspace in list the active one to start with */ pSD->pActiveWS = pSD->pWS; } else { pSD->pActiveWS = &pSD->pWS[iwsx]; } } else { /* make first workspace in list the active one to start with */ pSD->pActiveWS = pSD->pWS; } #else /* WSM */ /* * Allocate and initialize a workspace structure */ if (!(pSD->pWS = (WmWorkspaceData *) XtMalloc (sizeof(WmWorkspaceData)))) { ShowWaitState (FALSE); Warning (((char *)GETMESSAGE(40, 8, "Insufficient memory for Workspace data"))); ExitWM (WM_ERROR_EXIT_VALUE); } /* * Set up workspace for this screen */ InitWmWorkspace (pSD->pWS, pSD); pSD->pActiveWS = pSD->pWS; #endif /* WSM */ pDisplayName = DisplayString (DISPLAY); /* * Construct displayString for this string. * * NOTE: The variable buffer is reused here. It was * used earlier to generate a screen name. */ strcpy(displayName, pDisplayName); token1 = (char*)strtok(displayName, ":"); /* parse of hostname */ if((token2 = (char*)strtok(NULL, ".")) || /* parse off dpy & scr # */ (token2 = (char*)strtok(NULL, "")) || (displayName[0] == ':')) { if (displayName[0] == ':') /* local dpy (special case) */ { if ((token2 = (char*)strtok(token1, ".")) != NULL) /* parse dpy# */ sprintf(buffer, "DISPLAY=:%s.%d", token2, sNum); } else { /* otherwise process normally */ sprintf(buffer, "DISPLAY=%s:%s.%d", token1, token2, sNum); } /* * Allocate space for the display string */ if ((pSD->displayString = (String)XtMalloc ((unsigned int) (strlen(buffer) + 1))) == NULL) { Warning (((char *)GETMESSAGE(40, 9, "Insufficient memory for displayString"))); } else { strcpy(pSD->displayString, buffer); } } } /* END OF FUNCTION InitWmScreen */ /*************************************<->************************************* * * InitWmWorkspace * * * Description: * ----------- * This function initializes a workspace data block. * * Inputs: * ------- * pWS = pointer to preallocated workspace data block * pSD = ptr to parent screen data block * * Outputs: * ------- *************************************<->***********************************/ void InitWmWorkspace (WmWorkspaceData *pWS, WmScreenData *pSD) { Arg args[10]; int argnum; #ifndef WSM #define DEFAULT_WS_NAME "workspace" #endif /* not WSM */ pWS->pSD = pSD; pWS->pIconBox = NULL; pWS->dataType = WORKSPACE_DATA_TYPE; #ifdef WSM pWS->backdrop.window = 0; pWS->backdrop.nameAtom = 0; pWS->backdrop.image = NULL; pWS->numClients = 0; pWS->sizeClientList = 0; pWS->ppClients = 0; pWS->buttonW = NULL; #else /* WSM */ if ((pWS->name = (char *) XtMalloc ((1+strlen(DEFAULT_WS_NAME)) * sizeof (char))) == NULL) { ShowWaitState (FALSE); ExitWM (WM_ERROR_EXIT_VALUE); } strcpy (pWS->name, DEFAULT_WS_NAME); #endif /* WSM */ /* * Create widget for workspace resource hierarchy */ argnum = 0; XtSetArg (args[argnum], XtNdepth, DefaultDepth(DISPLAY, pSD->screen)); argnum++; XtSetArg (args[argnum], XtNscreen, ScreenOfDisplay(DISPLAY, pSD->screen)); argnum++; XtSetArg (args[argnum], XtNcolormap, DefaultColormap(DISPLAY, pSD->screen)); argnum++; XtSetArg (args[argnum], XtNwidth, 5); argnum++; XtSetArg (args[argnum], XtNheight, 5); argnum++; pWS->workspaceTopLevelW = XtCreateWidget ( pWS->name, xmPrimitiveWidgetClass, pSD->screenTopLevelW, args, argnum); #ifdef WSM /* internalize the workspace name */ pWS->id = XInternAtom (DISPLAY, pWS->name, False); #endif /* WSM */ /* * Process workspace based resources */ ProcessWorkspaceResources (pWS); /* setup icon placement */ if (wmGD.iconAutoPlace) { InitIconPlacement (pWS); } } /* END OF FUNCTION InitWmWorkspace */ #ifdef WSM /******************************<->************************************* * * InsureDefaultBackdropDir(char **ppchBackdropDirs) * * * Description: * ----------- * This function checks and edits a directory path to insure * that the system backdrop directroy (/usr/dt/backdrops) is in the * path. If not it adds it to the end. Further, it always adds the user's * backdrop directory ($HOME/.dt/backdrops) to the beginning of the path * and the system admin directory (/etc/dt/backdrops) before the system * directory. * * Inputs: * ------- * ppchBackdropDirs - Pointer to a pointer to a directory path * (must be allocated memory) * * Outputs: * ------- * *ppchBackdropDirs - Directory path may be modified, path * pointer may be realloc'ed. * * Comments: * -------- * Assumes that the default directory does not start with a * multi-byte character. * ******************************<->***********************************/ static void InsureDefaultBackdropDir(char **ppchBackdropDirs) { int len; Boolean bFound = False; char *pch, *pchEnd, *pch2, *tmpptr; char *pchD = DEFAULT_BACKDROP_DIR; unsigned int chlen; char * homeDir; /* * Set up initial stuff */ pch = *ppchBackdropDirs; len = strlen (pchD); pchEnd = pch + strlen(pch); while (!bFound && (pch != NULL) && (*pch != NULL)) { if (strncmp (pch, pchD, len) == 0) { /* found partial match, confirm complete match ... * complete match if char off end of partial match * is a NULL or a colon */ pch2 = pch + len; if ((pch2 <= pchEnd) && ((*pch2 == NULL) || (((mblen (pch2, MB_CUR_MAX) == 1) && (*pch2 == ':'))))) { bFound = True; } } else { /* find next path component */ pch = strchr (pch, (int) ':'); if ((pch != NULL) && (*pch != NULL)) { /* skip path separator */ chlen = mblen (pch, MB_CUR_MAX); pch += chlen; } } } /* * Always add the user's home directory to the beginning of the string */ homeDir = (char *) XmeGetHomeDirName(); /* * If found add the user's home directory ($HOME/.dt/backdrops) and the * admin directory /etc/dt/backdrops to the beginning of the string */ if (bFound) { len = strlen (homeDir) + strlen("/.dt/backdrops") + strlen (*ppchBackdropDirs) + strlen("/etc/dt/backdrops") + 3; tmpptr = XtMalloc (len * sizeof (char *)); strcpy (tmpptr, homeDir); strcat (tmpptr, "/.dt/backdrops"); strcat (tmpptr, ":"); strcat (tmpptr, "/etc/dt/backdrops"); strcat (tmpptr, ":"); strcat (tmpptr, *ppchBackdropDirs); *ppchBackdropDirs = tmpptr; } else /* * If string not found, then add home directory to the beginning of * string and the admin directory and system directory to the end. */ { len = strlen (homeDir) + strlen("/.dt/backdrops") + strlen (*ppchBackdropDirs) + strlen(pchD) + strlen("/etc/dt/backdrops") + 4; tmpptr = XtMalloc (len * sizeof (char *)); strcpy (tmpptr, homeDir); strcat (tmpptr, "/.dt/backdrops"); strcat (tmpptr, ":"); strcat (tmpptr, *ppchBackdropDirs); strcat (tmpptr, ":"); strcat (tmpptr, "/etc/dt/backdrops"); strcat (tmpptr, ":"); strcat (tmpptr, pchD); *ppchBackdropDirs = tmpptr; } } /* END OF FUNCTION InsureDefaultBackdropDirs */ #endif /* WSM */ /*************************************<->************************************* * * ProcessMotifWmInfo (rootWindowOfScreen) * * * Description: * ----------- * This function is used retrieve and save the information in the * _MOTIF_WM_INFO property. If the property does not exist then * the start / restart state is set to initial startup with the * user specified (not standard) configuration. * * * Outputs: * ------- * wmGD.useStandardBehavior = True if set indicated in property * * wmGD.wmRestarted = True if the window manager was restarted * *************************************<->***********************************/ void ProcessMotifWmInfo (Window rootWindowOfScreen) { MwmInfo *pMwmInfo; wmGD.xa_MWM_INFO = XInternAtom (DISPLAY, _XA_MWM_INFO, False); if ((pMwmInfo = (MotifWmInfo *)GetMwmInfo (rootWindowOfScreen)) != NULL) { wmGD.useStandardBehavior = (pMwmInfo->flags & MWM_INFO_STARTUP_STANDARD) ? True : False; wmGD.wmRestarted = True; XFree ((char *)pMwmInfo); } else { wmGD.useStandardBehavior = False; wmGD.wmRestarted = False; } } /* END OF FUNCTION ProcessMotifWmInfo */ /*************************************<->************************************* * * SetupWmWorkspaceWindows () * * * Description: * ----------- * This function is used to setup a window that can be used in doing window * management functions. This window is not visible on the screen. * * * Outputs: * ------- * pSD->wmWorkspaceWin = window that is used to hold wm properties * *************************************<->***********************************/ void SetupWmWorkspaceWindows (void) { int scr; WmScreenData *pSD; XSetWindowAttributes sAttributes; for (scr = 0; scr < wmGD.numScreens; scr++) { pSD = &(wmGD.Screens[scr]); if (pSD->managed) { sAttributes.override_redirect = True; sAttributes.event_mask = FocusChangeMask | PropertyChangeMask; pSD->wmWorkspaceWin = XCreateWindow (DISPLAY, pSD->rootWindow, -100, -100, 10, 10, 0, 0, InputOnly, CopyFromParent, (CWOverrideRedirect |CWEventMask), &sAttributes); XMapWindow (DISPLAY, pSD->wmWorkspaceWin); SetMwmInfo (pSD->rootWindow, (long) ((wmGD.useStandardBehavior) ? MWM_INFO_STARTUP_STANDARD : MWM_INFO_STARTUP_CUSTOM), pSD->wmWorkspaceWin); #ifdef WSM XSaveContext (DISPLAY, pSD->wmWorkspaceWin, wmGD.mwmWindowContextType, (caddr_t)pSD); #endif /* WSM */ } } } /* END OF FUNCTION SetupWmWorkspaceWindow */ /*************************************<->************************************* * * MakeWorkspaceCursors () * * * Description: * ----------- * This function makes the cursors that the window manager uses. * * * Inputs: * ------ * XXinput = ... * * XXinput = ... * * * Outputs: * ------- * wmGD = (stretchCursors ...) * *************************************<->***********************************/ void MakeWorkspaceCursors (void) { wmGD.workspaceCursor = XCreateFontCursor (DISPLAY, XC_left_ptr); wmGD.stretchCursors[STRETCH_NORTH_WEST] = XCreateFontCursor (DISPLAY, XC_top_left_corner); wmGD.stretchCursors[STRETCH_NORTH] = XCreateFontCursor (DISPLAY, XC_top_side); wmGD.stretchCursors[STRETCH_NORTH_EAST] = XCreateFontCursor (DISPLAY, XC_top_right_corner); wmGD.stretchCursors[STRETCH_EAST] = XCreateFontCursor (DISPLAY, XC_right_side); wmGD.stretchCursors[STRETCH_SOUTH_EAST] = XCreateFontCursor (DISPLAY, XC_bottom_right_corner); wmGD.stretchCursors[STRETCH_SOUTH] = XCreateFontCursor (DISPLAY, XC_bottom_side); wmGD.stretchCursors[STRETCH_SOUTH_WEST] = XCreateFontCursor (DISPLAY, XC_bottom_left_corner); wmGD.stretchCursors[STRETCH_WEST] = XCreateFontCursor (DISPLAY, XC_left_side); wmGD.configCursor = XCreateFontCursor (DISPLAY, XC_fleur); wmGD.movePlacementCursor = XCreateFontCursor (DISPLAY, XC_ul_angle); wmGD.sizePlacementCursor = XCreateFontCursor (DISPLAY, XC_lr_angle); } /* END OF FUNCTION MakeWorkspaceCursors */ /*************************************<->************************************* * * MakeWmFunctionResources (pSD) * * * Description: * ----------- * This function makes menus and other resources that are used by window * manager functions. * * * Inputs: * ------ * wmGD = (menuSpecs, keySpecs, buttonSpecs) * * * Outputs: * ------- * wmGD (menuSpecs) = new menu panes, protocol atoms * *************************************<->***********************************/ void MakeWmFunctionResources (WmScreenData *pSD) { ButtonSpec *buttonSpec; KeySpec *keySpec; MenuSpec *menuSpec; Context menuContext; /* * Scan through the menu specifications and make wm protocol atoms. */ /* * Scan through the button binding specifications making menus if the * f.menu function is invoked. */ buttonSpec = pSD->buttonSpecs; while (buttonSpec) { if (buttonSpec->wmFunction == F_Menu) { if (buttonSpec->context & F_CONTEXT_WINDOW) { menuContext = F_CONTEXT_WINDOW; } else if (buttonSpec->context & F_CONTEXT_ICON) { menuContext = F_CONTEXT_ICON; } else { menuContext = F_CONTEXT_ROOT; } menuSpec = MAKE_MENU (pSD, NULL, buttonSpec->wmFuncArgs, menuContext, buttonSpec->context, (MenuItem *) NULL, FALSE); if (menuSpec) /* * If successful, save in pSD->acceleratorMenuSpecs * Note: these accelerators have nonzero contexts. */ { SaveMenuAccelerators (pSD, menuSpec); } else { buttonSpec->wmFunction = F_Nop; } } buttonSpec = buttonSpec->nextButtonSpec; } /* * Scan through the key binding specifications making menus if the * f.menu function is invoked. */ keySpec = pSD->keySpecs; while (keySpec) { if (keySpec->wmFunction == F_Menu) { if (keySpec->context & F_CONTEXT_WINDOW) { menuContext = F_CONTEXT_WINDOW; } else if (keySpec->context & F_CONTEXT_ICON) { menuContext = F_CONTEXT_ICON; } else { menuContext = F_CONTEXT_ROOT; } menuSpec = MAKE_MENU (pSD, NULL, keySpec->wmFuncArgs, menuContext, keySpec->context, (MenuItem *) NULL, FALSE); if (menuSpec) /* * If successful, save in pSD->acceleratorMenuSpecs * Note: these accelerators have nonzero contexts. */ { SaveMenuAccelerators (pSD, menuSpec); } else { keySpec->wmFunction = F_Nop; } } keySpec = keySpec->nextKeySpec; } } /* END OF FUNCTION MakeWmFunctionResources */ /*************************************<->************************************* * * MakeXorGC (pSD) * * * Description: * ----------- * Make an XOR graphic context for resizing and moving * * * Inputs: * ------ * pSD = pointer to screen data * * Outputs: * ------- * Modifies global data * * Comments: * -------- * * *************************************<->***********************************/ void MakeXorGC (WmScreenData *pSD) { XGCValues gcv; XtGCMask mask; mask = GCFunction | GCLineWidth | GCSubwindowMode | GCCapStyle; gcv.function = GXinvert; gcv.line_width = 0; gcv.cap_style = CapNotLast; gcv.subwindow_mode = IncludeInferiors; /* Fix so that the rubberbanding for resize and move will * have more contrasting colors. */ gcv.plane_mask = BlackPixelOfScreen( DefaultScreenOfDisplay( DISPLAY )) ^ WhitePixelOfScreen( DefaultScreenOfDisplay( DISPLAY )); mask = mask | GCPlaneMask; pSD->xorGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv); } /* END OF FUNCTION MakeXorGC */ /*************************************<->************************************* * * CopyArgv (argc, argv) * * * Description: * ----------- * This function makes a copy of the window manager's argv for use by * the f.restart function. A copy must be kept because XtInitialize * changes argv. * * * Inputs: * ------ * argc = the number of strings in argv * * argv = window manager parameters * * * Outputs: * ------- * Return = a copy of argv * *************************************<->***********************************/ void CopyArgv (int argc, char *argv []) { int i; if ((wmGD.argv = (char **)XtMalloc ((argc + 1) * sizeof (char *))) == NULL) { Warning (((char *)GETMESSAGE(40, 10, "Insufficient memory for window manager data"))); wmGD.argv = argv; #ifdef WSM dpy2Argv = argv; #endif /* WSM */ } else { for (i = 0; i < argc; i++) { wmGD.argv[i] = argv[i]; } wmGD.argv[i] = NULL; #ifdef WSM if ((dpy2Argv = (char **)XtMalloc((argc + 1) * sizeof(char *))) == NULL) { Warning (((char *)GETMESSAGE(40, 11, "Insufficient memory for window manager data"))); dpy2Argv = argv; } else { for (i = 0; i < argc; i++) { dpy2Argv[i] = argv[i]; } dpy2Argc = argc; dpy2Argv[i] = NULL; } #endif /* WSM */ } } /* END OF FUNCTION CopyArgv */ /*************************************<->************************************* * * InitScreenNames () * * * Description: * ----------- * Initializes the name space for screen names * * Outputs: * ------- * Modifies global data * + screenNames * * Comments: * -------- * Initializes screenNames to contain a numeric name for each screen * *************************************<->***********************************/ void InitScreenNames (void) { int num, numScreens; numScreens = ScreenCount (wmGD.display); if (!(wmGD.screenNames = (unsigned char **) XtMalloc (numScreens * sizeof(char *)))) { ShowWaitState (FALSE); Warning (((char *)GETMESSAGE(40, 12, "Insufficient memory for screen names"))); ExitWM (WM_ERROR_EXIT_VALUE); } for (num=0; num************************************* * * InitWmDisplayEnv * * * Description: * ----------- * This function saves the display string for putenv in F_Exec. * * Inputs: * ------- * * Outputs: * ------- *************************************<->***********************************/ void InitWmDisplayEnv (void) { char *pDisplayName; char buffer[256]; char displayName[256]; pDisplayName = DisplayString (DISPLAY); /* * Construct displayString for this string. */ strcpy(displayName, pDisplayName); sprintf(buffer, "DISPLAY=%s",displayName); /* * Allocate space for the display string */ if ((wmGD.displayString = (String)XtMalloc ((unsigned int) (strlen(buffer) + 1))) == NULL) { wmGD.displayString = NULL; Warning (((char *)GETMESSAGE(40, 9, "Insufficient memory for displayString"))); } else { strcpy(wmGD.displayString, buffer); #ifdef WSM putenv(wmGD.displayString); #endif /* WSM */ } } /* END OF FUNCTION InitWmDisplayEnv */ #ifndef NO_HP_KEY_REMAP static str_xref GetReplacementList( Display *dsp, str_xref std_xref, int count) { int min_kc ; int max_kc ; int ks_per_kc ; int kc_count ; KeySym *key_map ; unsigned i ; str_xref xref_rtn = NULL ; unsigned num_xref = 0 ; XDisplayKeycodes( dsp, &min_kc, &max_kc) ; kc_count = max_kc + 1 - min_kc ; key_map = XGetKeyboardMapping( dsp, min_kc, kc_count, &ks_per_kc) ; if( key_map == NULL ) { return NULL ; } kc_count *= ks_per_kc ; i = 0 ; while( i < count ) { KeySym ks = XStringToKeysym( std_xref[i].default_name) ; unsigned j = 0 ; while( j < kc_count ) { if( key_map[j] == ks ) { /* Found keysym used in virtkey table in keymap, * so break -> j != kc_count */ break ; } ++j ; } if( j == kc_count ) { /* Didn't find keysym of virtkey table, so add record to * returned list which will later cause replacement in * virtkeys table. */ xref_rtn = (str_xref) XtRealloc( (char *) xref_rtn, sizeof( str_xref_rec) * (num_xref + 2)) ; xref_rtn[num_xref++] = std_xref[i] ; xref_rtn[num_xref].default_name = NULL ; } ++i ; } XFree( (char *) key_map) ; return xref_rtn ; } static Boolean GetBindingsProperty( Display *dsp, Atom property, String *binding) { Atom actual_type ; int actual_format ; unsigned long num_items ; unsigned long bytes_after ; unsigned char *prop = NULL ; XGetWindowProperty( dsp, RootWindow( dsp, 0), property, 0, 1000000L, FALSE, XA_STRING, &actual_type, &actual_format, &num_items, &bytes_after, &prop) ; if( (actual_type != XA_STRING) || (actual_format != 8) || (num_items == 0) ) { if( prop != NULL ) { XFree( prop) ; } return FALSE ; } *binding = (String) prop ; return TRUE ; } static void SetBindingsProperty( Display *dsp, Atom property, String binding) { XChangeProperty( dsp, RootWindow( dsp, 0), property, XA_STRING, 8, PropModeReplace, (unsigned char *) binding, strlen( binding)) ; } static String FixupBindingsString( String bindingsString, str_xref repl_xref) { String fixed_str = XtNewString( bindingsString) ; String ptr_next = fixed_str ; while( repl_xref->default_name != NULL ) { String ks_ptr = strstr( ptr_next, repl_xref->default_name) ; unsigned orig_len = strlen( repl_xref->default_name) ; if( ks_ptr == NULL ) { /* Only increment to next replacement when no other instances * are found in fixed_str. */ ++repl_xref ; ptr_next = fixed_str ; continue ; } if( (strpbrk( (ks_ptr - 1), " \t>") == (ks_ptr - 1)) && (strpbrk( ks_ptr, " \t\n") == (ks_ptr + orig_len)) ) { unsigned new_len = strlen( repl_xref->new_name) ; unsigned suffix_len = strlen( ks_ptr + orig_len) ; if( new_len > orig_len ) { unsigned new_ttl_len = strlen( fixed_str) + new_len - orig_len ; unsigned prefix_len ; *ks_ptr = '\0' ; prefix_len = strlen( fixed_str) ; fixed_str = XtRealloc( fixed_str, (new_ttl_len + 1)) ; ks_ptr = fixed_str + prefix_len ; } memmove( (ks_ptr + new_len), (ks_ptr + orig_len), (suffix_len + 1)) ; memcpy( ks_ptr, repl_xref->new_name, new_len) ; ptr_next = ks_ptr + new_len ; } else { ptr_next = ks_ptr + 1 ; } } return fixed_str ; } Boolean VirtKeys4DIN( Display *dsp) { /* This routine examines the X server's key map table to determine * if certain HP-specific keysyms are missing. If they are, then * the Motif virtual binding table properties are updated to utilize * generic X keysyms instead of the missing HP vendor keysyms. * In particular, this fixes the Motif virtual key binding table for * correct operation on HP systems using the AT2/DIN style keyboard. */ static char *prop_names[] = { "_MOTIF_BINDINGS", "_MOTIF_DEFAULT_BINDINGS" } ; static str_xref_rec std_xref[] = { { "hpInsertChar", "Insert" }, { "hpDeleteChar", "Delete" }, { "End", "F7" }, } ; Boolean PropChanged4DIN = FALSE ; unsigned i ; char *bindingsString ; unsigned prop_existed ; Atom *prop_atoms ; str_xref vkeysym_xref ; unsigned num_props = XtNumber( prop_names) ; vkeysym_xref = GetReplacementList( dsp, std_xref, XtNumber(std_xref)) ; if( vkeysym_xref == NULL ) { return PropChanged4DIN ; } prop_atoms = (Atom *) XtMalloc( sizeof( Atom) * num_props) ; XInternAtoms(dsp, prop_names, num_props, FALSE, prop_atoms); prop_existed = FALSE ; i = 0 ; while( i < num_props ) { if( GetBindingsProperty( dsp, prop_atoms[i], &bindingsString) ) { String new_bstring = FixupBindingsString( bindingsString, vkeysym_xref) ; prop_existed = TRUE ; XFree( bindingsString) ; if( new_bstring != NULL ) { SetBindingsProperty( dsp, prop_atoms[i], new_bstring) ; XtFree( new_bstring) ; } } ++i ; } if( !prop_existed ) { bindingsString = NULL ; _XmVirtKeysLoadFallbackBindings( dsp, &bindingsString) ; XtFree( bindingsString) ; i = 0 ; while( i < num_props ) { if( GetBindingsProperty( dsp, prop_atoms[i], &bindingsString) ) { String new_bstring = FixupBindingsString( bindingsString, vkeysym_xref) ; XtFree( bindingsString) ; if( new_bstring != NULL ) { PropChanged4DIN = TRUE ; SetBindingsProperty( dsp, prop_atoms[i], new_bstring) ; XtFree( new_bstring) ; } XFree( bindingsString) ; } ++i ; } } XtFree( (char *) vkeysym_xref) ; XtFree( (char *) prop_atoms) ; return PropChanged4DIN ; } #endif /* NO_HP_KEY_REMAP */ #ifdef WSM /**************************** eof ***************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/WmXSMP.c0000644000175000017500000010151713145162623013273 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "WmGlobal.h" #include "WmXSMP.h" #ifdef WSM # include "WmWrkspace.h" # include
#endif #define FIX_1193 typedef struct _ProxyClientInfo { int screen; char *wmCommand; char *wmClientMachine; char *clientID; } ProxyClientInfo; #define RESTORE_RESOURCE(pCD, resFlag) \ ((pCD)->ignoreWMSaveHints || !((pCD)->wmSaveHintFlags & (resFlag))) #define SAVE_RESOURCE(pCD, resFlag) RESTORE_RESOURCE(pCD, resFlag) #define MAX_RESOURCE_LEN 1024 #ifdef WSM static char *dtwmFileName = "dtwm.db"; #else static char *dtwmFileName = ".mwmclientdb"; # define EXTRA_FN_CHARS 20 #endif /* Fully-qualified resource names/classes. */ static char *xPositionStr = "%s.position.x"; static char *yPositionStr = "%s.position.y"; static char *widthSizeStr = "%s.size.width"; static char *heightSizeStr = "%s.size.height"; static char *initialStateStr = "%s.initialState"; static char *wmCommandStr = "%s.wmCommand"; static char *wmClientMachineStr = "%s.wmClientMachine"; static char *screenStr = "%s.screen"; #ifdef WSM static char *workspacesStr = "%s.workspaces"; static char *iconXPosStr = "%s.iconPos.x.%s"; static char *iconYPosStr = "%s.iconPos.y.%s"; #else static char *iconXPosStr = "%s.iconPos.x"; static char *iconYPosStr = "%s.iconPos.y"; #endif /* Header for private database. */ static char *dbHeader = "\ ! %s\n\ !\n\ .version: %s\n\ .dtwmID: %s\n"; /* Format for client entries in database. */ static char *dbClientFormat = "\ !\n\ %s.%s: %s\n\ !\n"; static char *intArg = ": %d\n"; static char *strArg = ": %s\n"; static char *normalStateStr = "NormalState"; static char *iconicStateStr = "IconicState"; static char *XSMPClientStr = "Client"; static char *proxyClientStr = "ProxyClient"; #ifndef WSM static char *dbFileArgStr = "-session"; #endif /* Flag to tell us how to treat ProxyClient info. */ static Boolean smClientDBCheckpointed = False; /* * Prototypes */ /* Session mgmt callbacks. */ static void smSaveYourselfCallback(Widget, XtPointer, XtPointer); static void smDieCallback(Widget, XtPointer, XtPointer); /* Build client database file name. */ static void buildDBFileName(char [MAXPATHLEN], Boolean); #ifndef WSM /* *Get clientDB name according to argv; set according to dbFileName. */ static void getClientDBName(void); static void setClientDBName(void); static char **getNewRestartCmd(void); static void freeNewRestartCmd(char **); #endif /* ! WSM */ #ifdef WSM /* Get string of client's workspaces. */ static char *getClientWorkspaces(ClientData *); #endif /* List-of-clients utilities. */ static Boolean addClientToList(ClientData ***, int *, ClientData *); static int clientWorkspaceCompare(const void *, const void *); /* XSMP/Proxy functions to save/restore resources. */ static char *getClientResource(char *, char *); static char *getXSMPResource(ClientData *, int, char *); static void getClientGeometry(ClientData *, int *, int *, unsigned int *, unsigned int *); static Boolean getProxyClientInfo(ClientData *, ProxyClientInfo *); static Bool cmpProxyClientProc(XrmDatabase *, XrmBindingList, XrmQuarkList, XrmRepresentation *, XrmValue *, XPointer); static char *findProxyClientID(ClientData *); static Boolean findXSMPClientDBMatch(ClientData *, char **); static Boolean findProxyClientDBMatch(ClientData *, char **); static Boolean saveXSMPClient(FILE *, ClientData *); static Boolean saveProxyClient(FILE *, ClientData *, int); static void dbRemoveProxyClientEntry(char *); static void smSaveYourselfCallback(Widget w, XtPointer clientData, XtPointer callData) { XtCheckpointToken cpToken = (XtCheckpointToken)callData; XrmDatabase newClientDB; int scr; static Boolean firstTime = True; /* * This callback will be called on connection to the Session Manager. * At that time, we don't want to save any state, and we don't * want to request the second phase. */ if (firstTime) { firstTime = False; return; } /* Only respond to Local and Both save requests. */ if ((cpToken->save_type != SmSaveLocal) && (cpToken->save_type != SmSaveBoth)) return; if (cpToken->shutdown && (cpToken->cancel_shutdown || cpToken->request_cancel || !cpToken->save_success)) return; /* Return, maintaining current state */ /* If first phase, request notification when all other clients saved. */ if (cpToken->phase == 1) { cpToken->request_next_phase = True; return; } #ifdef WSM /* Second phase: all other clients saved; now I can save myself. */ /* Copied from WmEvent.c. */ for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { /* * Write out current workspace, frontpanel * position and iconbox position and size. */ SaveResources(&wmGD.Screens[scr]); } } #endif /* * NEW FOR SESSION MANAGEMENT: Write private client resource database. * Destroy old client database and save new one. */ if ((newClientDB = SaveClientResourceDB()) != (XrmDatabase)NULL) { if (wmGD.clientResourceDB != (XrmDatabase)NULL) XrmDestroyDatabase(wmGD.clientResourceDB); wmGD.clientResourceDB = newClientDB; smClientDBCheckpointed = True; #ifndef WSM /* Set new session properties if wmGD.dbFileName is valid. */ if (wmGD.dbFileName != (char *)NULL) { char **newRestartCmd, **ptr; char *newDiscardCmd[4]; Arg args[10]; int nargs; newDiscardCmd[0] = "rm"; newDiscardCmd[1] = "-f"; newDiscardCmd[2] = wmGD.dbFileName; newDiscardCmd[3] = (char *)NULL; newRestartCmd = getNewRestartCmd(); nargs = 0; XtSetArg(args[nargs], XtNrestartCommand, newRestartCmd); nargs++; XtSetArg(args[nargs], XtNdiscardCommand, newDiscardCmd); nargs++; XtSetValues(wmGD.topLevelW, args, nargs); freeNewRestartCmd(newRestartCmd); } #endif /* ! WSM */ } } static void smDieCallback(Widget w, XtPointer clientData, XtPointer callData) { /* We assume we've saved our state by the time this is called. */ ExitWM(0); } static void buildDBFileName(char fileNameBuf[MAXPATHLEN], Boolean doingSave) { #ifdef WSM char *savePath = (char *)NULL; fileNameBuf[0] = '\0'; if (doingSave) { char *saveFile = (char *)NULL; char *ptr; if (DtSessionSavePath(wmGD.topLevelW, &savePath, &saveFile)) { XtFree(saveFile); if ((ptr = strrchr(savePath, '/')) != (char *)NULL) *ptr = '\0'; if (strlen(savePath) + strlen(dtwmFileName) + 2 < MAXPATHLEN) sprintf(fileNameBuf, "%s/%s", savePath, dtwmFileName); XtFree(savePath); } } else { if (DtSessionRestorePath(wmGD.topLevelW, &savePath, dtwmFileName)) { if ((int)strlen(savePath) < MAXPATHLEN) strcpy(fileNameBuf, savePath); XtFree(savePath); } } if (fileNameBuf[0] == '\0') strcpy(fileNameBuf, dtwmFileName); #else strcpy(fileNameBuf, (wmGD.dbFileName == (char *)NULL) ? dtwmFileName : wmGD.dbFileName); #endif } #ifndef WSM /* * See if dbFileArgStr specified on command line. Save subsequent arg; * if not, see if resource set; if not, put files in user's home directory. * NOTE: we allocate extra space for the filename so we can append numbers * without reallocating in setClientDBName. */ static void getClientDBName(void) { char **argP; /* See if DB filename specified on command line. */ wmGD.dbFileName = (char *)NULL; if (wmGD.argv != (char **)NULL) { for (argP = wmGD.argv; *argP != (char *)NULL; argP++) { if (strcmp(*argP, dbFileArgStr) == 0) { if (*(++argP) != (char *)NULL) { if ((wmGD.dbFileName = (char *)XtMalloc((strlen(*argP) + 1 + EXTRA_FN_CHARS) * sizeof(char))) != (char *)NULL) strcpy(wmGD.dbFileName, *argP); } break; } } } /* Check resource if necessary. */ if (wmGD.dbFileName == (char *)NULL) { if (wmGD.sessionClientDB != (String)NULL) { if ((wmGD.dbFileName = (char *)XtMalloc((strlen(wmGD.sessionClientDB) + 1 + EXTRA_FN_CHARS) * sizeof(char))) != (char *)NULL) strcpy(wmGD.dbFileName, wmGD.sessionClientDB); } } if (wmGD.dbFileName == (char *)NULL) { char *homeDir = XmeGetHomeDirName(); if ((wmGD.dbFileName = (char *)XtMalloc((strlen(homeDir) + strlen(dtwmFileName) + 2 + EXTRA_FN_CHARS) * sizeof(char))) != (char *)NULL) sprintf(wmGD.dbFileName, "%s/%s", homeDir, dtwmFileName); } } /* * See comments above in getClientDBName. */ static void setClientDBName(void) { char *ptr; if (wmGD.dbFileName == (char *)NULL) return; /* Change trailing "." to "." */ if ((ptr = strrchr(wmGD.dbFileName, '.')) != (char *)NULL) { char *p1; for (p1 = ++ptr; *p1 != '\0'; p1++) { if (!isdigit(*p1)) break; } if (*p1 == '\0') { int numSuffix; numSuffix = atoi(ptr) + 1; sprintf(ptr, "%d", numSuffix); /* Success! We're all done here. */ return; } } /* Otherwise, append ".0" to filename. */ strcat(wmGD.dbFileName, ".0"); } static char ** getNewRestartCmd(void) { char **argP; int argc, i; int fileArgIndex = -1; Arg args[10]; int nargs; char **restartCmd; char **newRestartCmd; nargs = 0; XtSetArg(args[nargs], XtNrestartCommand, &restartCmd); nargs++; XtGetValues(wmGD.topLevelW, args, nargs); if (restartCmd == (char **)NULL) return (char **)NULL; for (argc = 0, argP = restartCmd; *argP != (char *)NULL; argP++, argc++) { if (strcmp(*argP, dbFileArgStr) == 0) { if (*(++argP) == (char *)NULL) break; fileArgIndex = argc++; /* Point at dbFileArgStr, not filename */ } } if (fileArgIndex < 0) { fileArgIndex = argc; argc += 2; } if ((newRestartCmd = (char **)XtMalloc((argc + 1) * sizeof(char *))) == (char **)NULL) return (char **)NULL; for (i = 0; i < argc; i++) { if (i != fileArgIndex) { newRestartCmd[i] = XtNewString(restartCmd[i]); } else { newRestartCmd[i++] = XtNewString(dbFileArgStr); newRestartCmd[i] = XtNewString(wmGD.dbFileName); } } newRestartCmd[i] = (char *)NULL; return newRestartCmd; } static void freeNewRestartCmd(char **restartCmd) { #ifdef FIX_1193 if(restartCmd) { char **tmp = restartCmd; while (*restartCmd != (char *)NULL) XtFree(*(restartCmd++)); XtFree((char *)tmp); } #else while (*restartCmd != (char *)NULL) XtFree(*(restartCmd++)); XtFree((char *)restartCmd); #endif } #endif /* ! WSM */ #ifdef WSM static char * getClientWorkspaces(ClientData *pCD) { WmScreenData *pSD = pCD->pSD; WmWorkspaceData *pWS; /* Should we use _DtWmParseMakeQuotedString() when looking at */ /* the name of the workspace, as is done in WmWrkspace.c? */ /* Easy but slow way to do this would be to use XGetAtomName(). */ /* To avoid XServer round trips (and to weed out invalid WS names) */ /* we look through workspaces attached to this screen for ID matches. */ char *cwsP, *tmpP, *wsNameP; int pLen = 0; int i; for (i = 0; i < pCD->numInhabited; i++) { if ((pWS = GetWorkspaceData(pSD, pCD->pWsList[i].wsID)) != (WmWorkspaceData *)NULL) { wsNameP = pWS->name; if (pLen == 0) { pLen = strlen(wsNameP) + 1; /* 1 for null termination */ if ((cwsP = (char *)XtMalloc(pLen * sizeof(char))) == (char *)NULL) return (char *)NULL; strcpy(cwsP, wsNameP); } else { pLen += strlen(wsNameP) + 1; /* 1 for space */ if ((tmpP = (char *)XtRealloc(cwsP, pLen * sizeof(char))) == (char *)NULL) { XtFree((char *)cwsP); return (char *)NULL; } cwsP = tmpP; strcat(cwsP, " "); strcat(cwsP, wsNameP); } } } return cwsP; } #endif /* WSM */ static Boolean addClientToList(ClientData ***cdList, int *nClients, ClientData *pCD) { ClientData **newPtr = (ClientData **) XtRealloc((char *)*cdList, (*nClients + 1) * sizeof(ClientData *)); if (newPtr == (ClientData **)NULL) { if (*cdList != (ClientData **)NULL) XtFree((char *)*cdList); return False; } *cdList = newPtr; newPtr[*nClients] = pCD; (*nClients)++; return True; } static int clientWorkspaceCompare(const void *ppCD1, const void *ppCD2) { ClientData *pCD1 = *(ClientData **)ppCD1; ClientData *pCD2 = *(ClientData **)ppCD2; int screenDiff; /* Sort first by screen. */ if ((screenDiff = pCD1->pSD->screen - pCD2->pSD->screen) != 0) return screenDiff; #ifdef WSM /* If same screen, sort by workspace id. */ /* How do we handle clients that live in more than one workspace? */ /* For now, pick the "current" one - if not in active workspace, */ /* this will simply be the first one in the client's list. */ return (int)(pCD1->pWsList[pCD1->currentWsc].wsID - pCD2->pWsList[pCD2->currentWsc].wsID); #else /* If no WSM, must be in same workspace if screen is same! */ return 0; #endif } /* * Assumes: wmGD.clientResourceDB is non-NULL */ static char * getClientResource(char *clientID, char *fmtStr) { char resourceBuf[MAX_RESOURCE_LEN]; char *resourceType; XrmValue resourceValue; sprintf(resourceBuf, fmtStr, clientID); if (XrmGetResource(wmGD.clientResourceDB, resourceBuf, resourceBuf, &resourceType, &resourceValue)) return (char *)resourceValue.addr; return (char *)NULL; } /* * Assumes: pCD has non-NULL smClientID; * wmGD.clientResourceDB is non-NULL */ static char * getXSMPResource(ClientData *pCD, int resourceFlag, char *fmtStr) { if (RESTORE_RESOURCE(pCD, resourceFlag)) return getClientResource(pCD->smClientID, fmtStr); return (char *)NULL; } /* * Return True if client is XSMP, False otherwise. */ static Boolean findXSMPClientDBMatch(ClientData *pCD, char **workSpaceNamesP) { if (pCD->smClientID != (String)NULL) { if (wmGD.clientResourceDB != (XrmDatabase)NULL) { char *resourcePtr; if ((resourcePtr = getXSMPResource(pCD, WMSAVE_X, xPositionStr)) != (char *)NULL) { pCD->clientX = atoi(resourcePtr); pCD->clientFlags |= SM_X; } if ((resourcePtr = getXSMPResource(pCD, WMSAVE_Y, yPositionStr)) != (char *)NULL) { pCD->clientY = atoi(resourcePtr); pCD->clientFlags |= SM_Y; } #ifndef WSM if ((resourcePtr = getXSMPResource(pCD, WMSAVE_ICON_X, iconXPosStr)) != (char *)NULL) { ICON_X(pCD) = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_X; } if ((resourcePtr = getXSMPResource(pCD, WMSAVE_ICON_Y, iconYPosStr)) != (char *)NULL) { ICON_Y(pCD) = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_Y; } #endif if ((resourcePtr = getXSMPResource(pCD, WMSAVE_WIDTH, widthSizeStr)) != (char *)NULL) { pCD->clientWidth = atoi(resourcePtr); pCD->clientFlags |= SM_WIDTH; } if ((resourcePtr = getXSMPResource(pCD, WMSAVE_HEIGHT, heightSizeStr)) != (char *)NULL) { pCD->clientHeight = atoi(resourcePtr); pCD->clientFlags |= SM_HEIGHT; } if ((resourcePtr = getXSMPResource(pCD, WMSAVE_STATE, initialStateStr)) != (char *)NULL) { pCD->clientState = (strcmp(resourcePtr, normalStateStr) == 0) ? NORMAL_STATE : MINIMIZED_STATE; pCD->clientFlags |= SM_CLIENT_STATE; } #ifdef WSM if ((workSpaceNamesP != (char **)NULL) && ((resourcePtr = getXSMPResource(pCD, WMSAVE_WORKSPACES, workspacesStr)) != (char *)NULL)) { *workSpaceNamesP = XtNewString(resourcePtr); } #endif } /* Always return True for XSMP clients. */ return True; } return False; } static Boolean getProxyClientInfo(ClientData *pCD, ProxyClientInfo *proxyClientInfo) { XTextProperty textProperty; unsigned long i; /* WM_COMMAND is required; WM_CLIENT_MACHINE is optional. */ if (!XGetTextProperty(wmGD.display, pCD->client, &textProperty, XA_WM_COMMAND)) return False; if ((textProperty.encoding != XA_STRING) || (textProperty.format != 8) || (textProperty.value[0] == '\0')) { if (textProperty.value) free((char *)textProperty.value); return False; } /* Convert embedded NULL characters to space characters. */ /* (If last char is NULL, leave it alone) */ for (i = 0; i < textProperty.nitems - 1; i++) { if (textProperty.value[i] == '\0') textProperty.value[i] = ' '; } proxyClientInfo->screen = pCD->pSD->screen; proxyClientInfo->wmCommand = (char *)textProperty.value; /* Since WM_CLIENT_MACHINE is optional, don't fail if not found. */ if (XGetWMClientMachine(wmGD.display, pCD->client, &textProperty)) proxyClientInfo->wmClientMachine = (char *)textProperty.value; else proxyClientInfo->wmClientMachine = (char *)NULL; proxyClientInfo->clientID = (char *)NULL; return True; } /* * IMPORTANT: This function is called by XrmEnumerateDatabase(). * It calls other Xrm*() functions - if dtwm is threaded, THIS * WILL HANG. For now, dtwm is NOT threaded, so no problem. */ static Bool cmpProxyClientProc(XrmDatabase *clientDB, XrmBindingList bindingList, XrmQuarkList quarkList, XrmRepresentation *reps, XrmValue *value, XPointer uData) { char *clientScreen; char *wmCommand; char *wmClientMachine; char *clientID = (char *)value->addr; ProxyClientInfo *proxyClientInfo = (ProxyClientInfo *)uData; if (((wmCommand = getClientResource(clientID, wmCommandStr)) == (char *)NULL) || (strcmp(wmCommand, proxyClientInfo->wmCommand) != 0) || ((clientScreen = getClientResource(clientID, screenStr)) == (char *)NULL) || (atoi(clientScreen) != proxyClientInfo->screen)) return FALSE; /* So far so good. If WM_CLIENT_MACHINE missing from either, */ /* or if it is set in both and it's the same, we've got a match! */ if (!proxyClientInfo->wmClientMachine || ((wmClientMachine = getClientResource(clientID, wmClientMachineStr)) == (char *)NULL) || (strcmp(proxyClientInfo->wmClientMachine, wmClientMachine) == 0)) { proxyClientInfo->clientID = clientID; return TRUE; } return FALSE; } static char * findProxyClientID(ClientData *pCD) { ProxyClientInfo proxyClientInfo; char *clientID = (char *)NULL; static XrmName proxyName[2] = {NULLQUARK, NULLQUARK}; static XrmClass proxyClass[2] = {NULLQUARK, NULLQUARK}; if (proxyName[0] == NULLQUARK) { proxyName[0] = XrmStringToName(proxyClientStr); proxyClass[0] = XrmStringToClass(proxyClientStr); } /* * We need to match the screen and * the WM_COMMAND and WM_CLIENT_MACHINE properties. */ if (!getProxyClientInfo(pCD, &proxyClientInfo)) return clientID; if (XrmEnumerateDatabase(wmGD.clientResourceDB, proxyName, proxyClass, XrmEnumOneLevel, cmpProxyClientProc, (XPointer)&proxyClientInfo)) clientID = proxyClientInfo.clientID; if (proxyClientInfo.wmCommand) free(proxyClientInfo.wmCommand); if (proxyClientInfo.wmClientMachine) free(proxyClientInfo.wmClientMachine); return clientID; } /* * Return True if client is *not* XSMP and is listed in the resource DB * and no checkpoint done yet. Also remove entry from DB if found. */ static Boolean findProxyClientDBMatch(ClientData *pCD, char **workSpaceNamesP) { if ((pCD->smClientID == (String)NULL) && (wmGD.clientResourceDB != (XrmDatabase)NULL) && (!smClientDBCheckpointed)) { char *proxyClientID; if ((proxyClientID = findProxyClientID(pCD)) != (char *)NULL) { char *resourcePtr; if ((resourcePtr = getClientResource(proxyClientID, xPositionStr)) != (char *)NULL) { pCD->clientX = atoi(resourcePtr); pCD->clientFlags |= SM_X; } if ((resourcePtr = getClientResource(proxyClientID, yPositionStr)) != (char *)NULL) { pCD->clientY = atoi(resourcePtr); pCD->clientFlags |= SM_Y; } #ifndef WSM if ((resourcePtr = getClientResource(proxyClientID, iconXPosStr)) != (char *)NULL) { ICON_X(pCD) = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_X; } if ((resourcePtr = getClientResource(proxyClientID, iconYPosStr)) != (char *)NULL) { ICON_Y(pCD) = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_Y; } #endif if ((resourcePtr = getClientResource(proxyClientID, widthSizeStr)) != (char *)NULL) { pCD->clientWidth = atoi(resourcePtr); pCD->clientFlags |= SM_WIDTH; } if ((resourcePtr = getClientResource(proxyClientID, heightSizeStr)) != (char *)NULL) { pCD->clientHeight = atoi(resourcePtr); pCD->clientFlags |= SM_HEIGHT; } if ((resourcePtr = getClientResource(proxyClientID, initialStateStr)) != (char *)NULL) { pCD->clientState = (strcmp(resourcePtr, normalStateStr) == 0) ? NORMAL_STATE : MINIMIZED_STATE; pCD->clientFlags |= SM_CLIENT_STATE; } #ifdef WSM if ((workSpaceNamesP != (char **)NULL) && ((resourcePtr = getClientResource(proxyClientID, workspacesStr)) != (char *)NULL)) { *workSpaceNamesP = XtNewString(resourcePtr); } #endif #ifndef WSM /* This is done in LoadClientIconPositions() if WSM defined. */ dbRemoveProxyClientEntry(proxyClientID); #endif return True; } } return False; } /* * Translate the client geometry into what's needed on restore. */ static void getClientGeometry(ClientData *pCD, int *clientX, int *clientY, unsigned int *clientWd, unsigned int *clientHt) { *clientX = pCD->clientX; *clientY = pCD->clientY; *clientWd = (pCD->widthInc != 0) ? (pCD->clientWidth - pCD->baseWidth) / pCD->widthInc : pCD->clientWidth; *clientHt = (pCD->heightInc != 0) ? (pCD->clientHeight - pCD->baseHeight) / pCD->heightInc : pCD->clientHeight; } /* * Assumes: pCD->smClientID is not NULL */ static Boolean saveXSMPClient(FILE *fp, ClientData *pCD) { int clientX, clientY; unsigned int clientWd, clientHt; char *clientID = pCD->smClientID; fprintf(fp, dbClientFormat, XSMPClientStr, clientID, clientID); getClientGeometry(pCD, &clientX, &clientY, &clientWd, &clientHt); if (SAVE_RESOURCE(pCD, WMSAVE_X)) { fprintf(fp, xPositionStr, clientID); fprintf(fp, intArg, clientX); } if (SAVE_RESOURCE(pCD, WMSAVE_Y)) { fprintf(fp, yPositionStr, clientID); fprintf(fp, intArg, clientY); } if (!pCD->pSD->useIconBox) { #ifdef WSM WmScreenData *pSD = pCD->pSD; WmWorkspaceData *pWS; int i; for (i = 0; i < pCD->numInhabited; i++) { if ((pWS = GetWorkspaceData(pSD, pCD->pWsList[i].wsID)) != (WmWorkspaceData *)NULL) { if (SAVE_RESOURCE(pCD, WMSAVE_ICON_X)) { fprintf(fp, iconXPosStr, clientID, pWS->name); fprintf(fp, intArg, pCD->pWsList[i].iconX); } if (SAVE_RESOURCE(pCD, WMSAVE_ICON_Y)) { fprintf(fp, iconYPosStr, clientID, pWS->name); fprintf(fp, intArg, pCD->pWsList[i].iconY); } } } #else if (SAVE_RESOURCE(pCD, WMSAVE_ICON_X)) { fprintf(fp, iconXPosStr, clientID); fprintf(fp, intArg, ICON_X(pCD)); } if (SAVE_RESOURCE(pCD, WMSAVE_ICON_Y)) { fprintf(fp, iconYPosStr, clientID); fprintf(fp, intArg, ICON_Y(pCD)); } #endif } if (SAVE_RESOURCE(pCD, WMSAVE_WIDTH)) { fprintf(fp, widthSizeStr, clientID); fprintf(fp, intArg, clientWd); } if (SAVE_RESOURCE(pCD, WMSAVE_HEIGHT)) { fprintf(fp, heightSizeStr, clientID); fprintf(fp, intArg, clientHt); } if (SAVE_RESOURCE(pCD, WMSAVE_STATE)) { int clientState; #ifdef WSM clientState = pCD->clientState & ~UNSEEN_STATE; #else clientState = pCD->clientState; #endif fprintf(fp, initialStateStr, clientID); fprintf(fp, strArg, (clientState == NORMAL_STATE) ? normalStateStr : iconicStateStr); } #ifdef WSM if (SAVE_RESOURCE(pCD, WMSAVE_WORKSPACES)) { char *clientWorkspaces = getClientWorkspaces(pCD); if (clientWorkspaces != (char *)NULL) { fprintf(fp, workspacesStr, clientID); fprintf(fp, strArg, clientWorkspaces); XtFree(clientWorkspaces); } } #endif return True; } /* * Assumes: pCD->smClientID is NULL */ static Boolean saveProxyClient(FILE *fp, ClientData *pCD, int clientIDNum) { char clientID[50]; int clientState; ProxyClientInfo proxyClientInfo; int clientX, clientY; unsigned int clientWd, clientHt; #ifdef WSM char *clientWorkspaces; #endif if (!getProxyClientInfo(pCD, &proxyClientInfo)) return False; sprintf(clientID, "%d", clientIDNum); fprintf(fp, dbClientFormat, proxyClientStr, clientID, clientID); fprintf(fp, screenStr, clientID); fprintf(fp, intArg, proxyClientInfo.screen); fprintf(fp, wmCommandStr, clientID); fprintf(fp, strArg, proxyClientInfo.wmCommand); free(proxyClientInfo.wmCommand); if (proxyClientInfo.wmClientMachine != (char *)NULL) { fprintf(fp, wmClientMachineStr, clientID); fprintf(fp, strArg, proxyClientInfo.wmClientMachine); free(proxyClientInfo.wmClientMachine); } getClientGeometry(pCD, &clientX, &clientY, &clientWd, &clientHt); fprintf(fp, xPositionStr, clientID); fprintf(fp, intArg, clientX); fprintf(fp, yPositionStr, clientID); fprintf(fp, intArg, clientY); if (!pCD->pSD->useIconBox) { #ifdef WSM WmScreenData *pSD = pCD->pSD; WmWorkspaceData *pWS; int i; for (i = 0; i < pCD->numInhabited; i++) { if ((pWS = GetWorkspaceData(pSD, pCD->pWsList[i].wsID)) != (WmWorkspaceData *)NULL) { fprintf(fp, iconXPosStr, clientID, pWS->name); fprintf(fp, intArg, pCD->pWsList[i].iconX); fprintf(fp, iconYPosStr, clientID, pWS->name); fprintf(fp, intArg, pCD->pWsList[i].iconY); } } #else fprintf(fp, iconXPosStr, clientID); fprintf(fp, intArg, ICON_X(pCD)); fprintf(fp, iconYPosStr, clientID); fprintf(fp, intArg, ICON_Y(pCD)); #endif } fprintf(fp, widthSizeStr, clientID); fprintf(fp, intArg, clientWd); fprintf(fp, heightSizeStr, clientID); fprintf(fp, intArg, clientHt); #ifdef WSM clientState = pCD->clientState & ~UNSEEN_STATE; #else clientState = pCD->clientState; #endif fprintf(fp, initialStateStr, clientID); fprintf(fp, strArg, (clientState == NORMAL_STATE) ? normalStateStr : iconicStateStr); #ifdef WSM clientWorkspaces = getClientWorkspaces(pCD); if (clientWorkspaces != (char *)NULL) { fprintf(fp, workspacesStr, clientID); fprintf(fp, strArg, clientWorkspaces); XtFree(clientWorkspaces); } #endif return True; } static void dbRemoveProxyClientEntry(char *proxyClientID) { char resourceBuf[MAX_RESOURCE_LEN]; /* Remove entry from DB. Since Xrm does not provide a means */ /* of removing something from the DB, we blank out key info. */ sprintf(resourceBuf, wmCommandStr, proxyClientID); strcat(resourceBuf, ":"); XrmPutLineResource(&wmGD.clientResourceDB, resourceBuf); } /* * Add callbacks used in session management. */ void AddSMCallbacks(void) { XtAddCallback(wmGD.topLevelW, XtNsaveCallback, smSaveYourselfCallback, (XtPointer)NULL); XtAddCallback(wmGD.topLevelW, XtNdieCallback, smDieCallback, (XtPointer)NULL); } /* * Resign from session management, closing any connections made. */ void ResignFromSM(void) { if (wmGD.topLevelW) { XtVaSetValues(wmGD.topLevelW, XtNjoinSession, False, NULL); } } /* * Exit the WM, being polite by first resigning from session mgmt. */ void ExitWM(int exitCode) { ResignFromSM(); exit(exitCode); } /* * Read our private database of client resources. */ XrmDatabase LoadClientResourceDB(void) { char dbFileName[MAXPATHLEN]; #ifndef WSM getClientDBName(); #endif buildDBFileName(dbFileName, False); return XrmGetFileDatabase(dbFileName); } /* * Write our private database of client resources. */ XrmDatabase SaveClientResourceDB(void) { String mySessionID; char dbFileName[MAXPATHLEN]; FILE *fp; int scr; WmScreenData *pSD; ClientData *pCD; int clientIDNum = 0; ClientListEntry *pCL; /* Iterate through client list, saving */ /* appropriate resources for each. */ #ifndef WSM setClientDBName(); #endif buildDBFileName(dbFileName, True); if ((fp = fopen(dbFileName, "w")) == (FILE *)NULL) return (XrmDatabase)NULL; XtVaGetValues(wmGD.topLevelW, XtNsessionID, &mySessionID, NULL); fprintf(fp, dbHeader, dtwmFileName, "dtwm Version XSMP1.0", (mySessionID != (String)NULL) ? mySessionID : ""); for (scr = 0; scr < wmGD.numScreens; scr++) { pSD = &(wmGD.Screens[scr]); for (pCL = pSD->clientList; pCL != (ClientListEntry *)NULL; pCL = pCL->nextSibling) { /* Each client may be in list twice: normal & icon */ if (pCL->type != NORMAL_STATE) continue; pCD = pCL->pCD; if (pCD->smClientID != (String)NULL) { saveXSMPClient(fp, pCD); } else { if (saveProxyClient(fp, pCD, clientIDNum)) clientIDNum++; } } } fclose(fp); /* Retrieve database from file. */ return XrmGetFileDatabase(dbFileName); } /* * As with FindDtSessionMatch(), sets properties and then returns * an allocated string of workspace names. This string must be * freed by the caller using XtFree(). */ Boolean FindClientDBMatch(ClientData *pCD, char **workSpaceNamesP) { return (findXSMPClientDBMatch(pCD, workSpaceNamesP) || findProxyClientDBMatch(pCD, workSpaceNamesP)); } Boolean GetSmClientIdClientList(ClientData ***clients, int *nClients) { int scr; WmScreenData *pSD; ClientData *pCD; ClientListEntry *pCL; *nClients = 0; *clients = (ClientData **)NULL; for (scr = 0; scr < wmGD.numScreens; scr++) { pSD = &(wmGD.Screens[scr]); for (pCL = pSD->clientList; pCL != (ClientListEntry *)NULL; pCL = pCL->nextSibling) { /* Each client may be in list twice: normal & icon */ if (pCL->type != NORMAL_STATE) continue; pCD = pCL->pCD; if (pCD->smClientID != (String)NULL) { /* addClientToList() reclaims memory on failure. */ if (!addClientToList(clients, nClients, pCD)) return False; } } } return True; } void SortClientListByWorkspace(ClientData **clients, int nClients) { if (nClients > 0) { qsort((void *)clients, nClients, sizeof(ClientData *), clientWorkspaceCompare); } } #ifdef WSM /* This needs to be called if WSM defined; if WSM not defined, icon */ /* positions are read at the same time as other resources. */ void LoadClientIconPositions(ClientData *pCD) { char resourceBuf[MAX_RESOURCE_LEN]; WmScreenData *pSD = pCD->pSD; WmWorkspaceData *pWS; int i; char *resourcePtr; if (wmGD.clientResourceDB == (XrmDatabase)NULL) return; if (pCD->smClientID != (String)NULL) { for (i = 0; i < pCD->numInhabited; i++) { if ((pWS = GetWorkspaceData(pSD, pCD->pWsList[i].wsID)) != (WmWorkspaceData *)NULL) { sprintf(resourceBuf, iconXPosStr, "%s", pWS->name); if ((resourcePtr = getXSMPResource(pCD, WMSAVE_ICON_X, resourceBuf)) != (char *)NULL) { pCD->pWsList[i].iconX = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_X; } sprintf(resourceBuf, iconYPosStr, "%s", pWS->name); if ((resourcePtr = getXSMPResource(pCD, WMSAVE_ICON_Y, resourceBuf)) != (char *)NULL) { pCD->pWsList[i].iconY = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_Y; } } } return; } /* Proxy client */ if (!smClientDBCheckpointed) { char *proxyClientID; if ((proxyClientID = findProxyClientID(pCD)) != (char *)NULL) { for (i = 0; i < pCD->numInhabited; i++) { if ((pWS = GetWorkspaceData(pSD, pCD->pWsList[i].wsID)) != (WmWorkspaceData *)NULL) { sprintf(resourceBuf, iconXPosStr, "%s", pWS->name); if ((resourcePtr = getClientResource(proxyClientID, resourceBuf)) != (char *)NULL) { pCD->pWsList[i].iconX = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_X; } sprintf(resourceBuf, iconYPosStr, "%s", pWS->name); if ((resourcePtr = getClientResource(proxyClientID, resourceBuf)) != (char *)NULL) { pCD->pWsList[i].iconY = atoi(resourcePtr); pCD->clientFlags |= SM_ICON_Y; } } } dbRemoveProxyClientEntry(proxyClientID); } } } #endif /* WSM */ motif-2.3.8/clients/mwm/WmCmd.h0000644000175000017500000000370213145162623013211 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _WM_CMD_ #define _WM_CMD_ #include #include "WmWsmLib/wsm_proto.h" #define WINDOW_MASK 0x3fffffff #define ALL_WINDOWS 0x3fffffff #define ICON_ONLY ((unsigned int)1)<<31 #define WINDOW_ONLY 1<<30 extern void DefineCommand (Widget, Atom, MessageData, unsigned long, int); extern void IncludeCommand (Widget, Atom, MessageData, unsigned long, int); extern void EnableCommand (Widget, Atom, MessageData, unsigned long, int); extern void DisableCommand (Widget, Atom, MessageData, unsigned long, int); extern void RenameCommand (Widget, Atom, MessageData, unsigned long, int); extern void RemoveCommand (Widget, Atom, MessageData, unsigned long, int); extern void AddWindowMenuEntry (ClientData *); extern void DeleteCommand (long, CmdTree **); extern void SendInvokeMessage (CARD32, CARD32, Atom, Time); extern void GetAutomationData (XtPointer input, Atom *outputType, XtPointer *output, unsigned long *outputLen, int *outputFmt); #endif /* _WM_CMD_ */ motif-2.3.8/clients/mwm/WmResParse.h0000644000175000017500000001231313145162623014230 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ #include #ifdef PANELIST extern void ProcessWmFile (WmScreenData *pSD, Boolean bNested); #else /* PANELIST */ extern void ProcessWmFile (WmScreenData *pSD); #endif /* PANELIST */ extern void ProcessCommandLine (int argc, char *argv[]); extern void ProcessMotifBindings (void); #ifdef WSM extern Boolean FindDtSessionMatch(int commandArgc, char **commandArgv, ClientData *pCD, WmScreenData *pSD, char **pWorkSpaceList, char *clientMachine); extern void WmDtGetHelprgs(char *args, unsigned char** volume, unsigned char** topic, int *argsCount); extern void GetActionIndex (int tableSize, int *actionIndex); extern void GetFunctionTableValues (int *execIndex, int *nopIndex, int *actionIndex); extern void GetNopIndex (int tableSize, int *nopIndex); extern void GetExecIndex (int tableSize, int *execIndex); extern Boolean GetSessionHintsInfo (WmScreenData *pSD, long numItems); #endif /* WSM */ extern FILE * FopenConfigFile (void); extern void FreeMenuItem (MenuItem *menuItem); #ifndef WSM extern unsigned char * GetNextLine (void); #endif /* not WSM */ #ifdef WSM extern unsigned char * GetStringC (unsigned char **linePP, Boolean SmBehavior); extern void SystemCmd (char *pchCmd); #else /* WSM */ extern unsigned char * GetString (unsigned char **linePP); #endif /* WSM */ extern Boolean ParseBtnEvent (unsigned char **linePP, unsigned int *eventType, unsigned int *button, unsigned int *state, Boolean *fClick); extern void ParseButtonStr (WmScreenData *pSD, unsigned char *buttonStr); extern void ParseKeyStr (WmScreenData *pSD, unsigned char *keyStr); extern Boolean ParseKeyEvent (unsigned char **linePP, unsigned int *eventType, KeyCode *keyCode, unsigned int *state); extern MenuItem * ParseMwmMenuStr (WmScreenData *pSD, unsigned char *menuStr); #ifdef WSM extern void ParseSessionClientState (WmScreenData *pSD, int count, unsigned char *string); extern void ParseSessionCommand (WmScreenData *pSD, int count, unsigned char **commandString); extern void ParseSessionGeometry (WmScreenData *pSD, int count, unsigned char *string); extern void ParseSessionItems (WmScreenData *pSD); extern void ParseSessionWorkspaces (WmScreenData *pSD, int count, unsigned char *string); extern void ParseSessionHost (WmScreenData *pSD, int count, unsigned char *string); extern void ParseDtSessionHints (WmScreenData *pSD, unsigned char *property); #endif /* WSM */ extern int ParseWmFunction (unsigned char **linePP, unsigned int res_spec, WmFunction *pWmFunction); extern void PWarning (char *message); extern void SaveMenuAccelerators (WmScreenData *pSD, MenuSpec *newMenuSpec); extern void ScanAlphanumeric (unsigned char **linePP); #ifndef WSM extern void ScanWhitespace(unsigned char **linePP); #endif /* not WSM */ extern void ToLower (unsigned char *string); extern void SyncModifierStrings(void); #ifdef PANELIST extern void DeleteTempConfigFileIfAny (void); extern Boolean ParseWmFunctionArg ( unsigned char **linePP, int ix, WmFunction wmFunc, void **ppArg, String sClientName, String sTitle); extern Boolean ParseWmFuncMaybeStrArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs); extern Boolean ParseWmFuncStrArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs); extern Boolean ParseWmFuncActionArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs); #endif /* PANELIST */ #ifdef WSM #define ToLower(s) (_DtWmParseToLower (s)) #define GetNextLine() (_DtWmParseNextLine (wmGD.pWmPB)) #define GetSmartSMString(s) (_DtWmParseNextTokenC (s, True)) #define GetSmartString(s) (_DtWmParseNextTokenC (s, False)) #define GetString(s) (_DtWmParseNextTokenC (s, False)) #define ScanWhitespace(s) (_DtWmParseSkipWhitespaceC (s)) #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) extern Boolean IsClientCommand (String); extern Boolean SetGreyedContextAndMgtMask (MenuItem *menuItem, WmFunction wmFunction); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ motif-2.3.8/clients/mwm/WmCDecor.c0000644000175000017500000021755113145162623013651 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.1 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmCDecor.c /main/7 1996/06/20 09:38:16 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmXSMP.h" #include #include /* * Definitions */ /* * include extern functions */ #include "WmCDecor.h" #include "WmCDInfo.h" #include "WmError.h" #include "WmGraphics.h" #include "WmIconBox.h" #include "WmMenu.h" #include "WmWinInfo.h" /* * Global Variables: */ typedef struct { int external; /* bevel from frame to root */ int join; /* bevel between frame components */ int internal; /* bevel from frame to client */ } Single_Bevel_Count; typedef struct { Single_Bevel_Count top; Single_Bevel_Count bottom; } Bevel_Count; /* * "Worst case" bevel counts for frame pieces: this structure is * indexed by definitions in WmGlobal.h. Edit if they change! * * These counts are multiplied by the internal, external, * and join bevel resources to determine the sizes of dynamic * data structures to allocate. * */ static Bevel_Count Bevels[] = { { {0, 0, 0}, {0, 0, 0} }, /* FRAME_NONE */ { {0, 0, 0}, {0, 0, 0} }, /* FRAME_CLIENT */ { {0, 4, 0}, {0, 3, 1} }, /* FRAME_SYSTEM */ { {0, 2, 0}, {0, 1, 1} }, /* FRAME_TITLE */ { {0, 4, 0}, {0, 3, 1} }, /* FRAME_MINIMIZE */ { {0, 4, 0}, {0, 3, 1} }, /* FRAME_MAXIMIZE */ { {2, 0, 0}, {0, 2, 2} }, /* FRAME_RESIZE_NW */ { {1, 1, 0}, {0, 1, 1} }, /* FRAME_RESIZE_N */ { {1, 1, 1}, {1, 1, 1} }, /* FRAME_RESIZE_NE */ { {0, 1, 1}, {1, 1, 0} }, /* FRAME_RESIZE_E */ { {0, 2, 2}, {2, 0, 0} }, /* FRAME_RESIZE_SE */ { {0, 1, 1}, {1, 1, 0} }, /* FRAME_RESIZE_S */ { {1, 1, 1}, {1, 1, 1} }, /* FRAME_RESIZE_SW */ { {1, 1, 0}, {0, 1, 1} } /* FRAME_RESIZE_W */ }; /*************************************<->************************************* * * FrameWindow (pcd) * * * Description: * ----------- * Build a decorated frame for a client window and reparent the client * window to the frame. * * * Inputs: * ------ * pcd - pointer to client data structure for window * * << Need the following member data >> * * client * fields from WM_HINTS property * fields from WM_CLASS property * fields from WM_NORMAL_HINTS property * clientX * clientY * clientWidth * clientHeight * fields from WM_NAME property * * * Outputs: * ------- * * * Comments: * -------- * This will create a top level shell (frame), fill in the appropriate * decoration, and reparent the window (in *pcd) to the frame. * *************************************<->***********************************/ Boolean FrameWindow (ClientData *pcd) { if (!ConstructFrame (pcd)) /* window hierarchy for frame */ { return(FALSE); } GenerateFrameDisplayLists (pcd); /* graphics for frame decoration */ AdoptClient(pcd); /* reparent the window */ #ifndef NO_SHAPE /* shape the frame */ if (wmGD.hasShape && pcd->wShaped) { SetFrameShape (pcd); } #endif /* NO_SHAPE */ return(TRUE); } /* END OF FUNCTION FrameWindow */ /*************************************<->************************************* * * FrameExposureProc (pcd) * * * Description: * ----------- * Repaint the frame graphics * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * none * * Comments: * -------- * Assumes that the display lists for the frame graphics are already * set up. * *************************************<->***********************************/ void FrameExposureProc (ClientData *pcd) { GC topGC, botGC; Window win = pcd->clientFrameWin; /* use "active" GCs if we have keyboard focus */ if (pcd == wmGD.keyboardFocus) { topGC = CLIENT_APPEARANCE(pcd).activeTopShadowGC; botGC = CLIENT_APPEARANCE(pcd).activeBottomShadowGC; } else { topGC = CLIENT_APPEARANCE(pcd).inactiveTopShadowGC; botGC = CLIENT_APPEARANCE(pcd).inactiveBottomShadowGC; } /* draw the frame decoration */ if (pcd->pclientTopShadows) { XFillRectangles (DISPLAY, win, topGC, pcd->pclientTopShadows->prect, pcd->pclientTopShadows->used); } if (pcd->pclientBottomShadows) { XFillRectangles (DISPLAY, win, botGC, pcd->pclientBottomShadows->prect, pcd->pclientBottomShadows->used); } if (DECOUPLE_TITLE_APPEARANCE(pcd) && (pcd->decor & MWM_DECOR_TITLE)) { if (pcd == wmGD.keyboardFocus) { topGC = CLIENT_TITLE_APPEARANCE(pcd).activeTopShadowGC; botGC = CLIENT_TITLE_APPEARANCE(pcd).activeBottomShadowGC; } else { topGC = CLIENT_TITLE_APPEARANCE(pcd).inactiveTopShadowGC; botGC = CLIENT_TITLE_APPEARANCE(pcd).inactiveBottomShadowGC; } if (pcd->pclientTitleTopShadows) { XFillRectangles (DISPLAY, pcd->clientTitleWin, topGC, pcd->pclientTitleTopShadows->prect, pcd->pclientTitleTopShadows->used); } if (pcd->pclientTitleBottomShadows) { XFillRectangles (DISPLAY, pcd->clientTitleWin, botGC, pcd->pclientTitleBottomShadows->prect, pcd->pclientTitleBottomShadows->used); } } /* draw the title bar text */ DrawWindowTitle(pcd, False); } /*************************************<->************************************* * * BaseWinExposureProc (pcd) * * * Description: * ----------- * Repaint the beveled matte graphics if any. * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * none * * Comments: * -------- * Assumes that the display lists for the matte graphics are already * set up. * *************************************<->***********************************/ void BaseWinExposureProc (ClientData *pcd) { /* bevel the matte (if there is one) */ if (pcd->matteWidth > 0) { if (pcd->pclientMatteTopShadows) { XFillRectangles (DISPLAY, pcd->clientBaseWin, pcd->clientMatteTopShadowGC, pcd->pclientMatteTopShadows->prect, pcd->pclientMatteTopShadows->used); } if (pcd->pclientMatteBottomShadows) { XFillRectangles (DISPLAY, pcd->clientBaseWin, pcd->clientMatteBottomShadowGC, pcd->pclientMatteBottomShadows->prect, pcd->pclientMatteBottomShadows->used); } } } /*************************************<->************************************* * * ConstructFrame (pcd) * * * Description: * ----------- * Construct the window hierarchy for the frame * * * Inputs: * ------ * pcd - pointer to client data record * * Outputs: * ------- * pcd - modified * * * Comments: * -------- * *************************************<->***********************************/ Boolean ConstructFrame (ClientData *pcd) { unsigned long decoration = pcd->decor; unsigned int wclass; /* window class */ unsigned long attr_mask; XSetWindowAttributes window_attribs; int frmX, frmY; /* set frame information */ SetFrameInfo (pcd); /* allocate space */ if (!AllocateFrameDisplayLists(pcd)) { return(FALSE); } /* create frame window */ attr_mask = CWEventMask; window_attribs.event_mask = (ButtonPressMask | ButtonReleaseMask | SELECT_BUTTON_MOTION_MASK | DMANIP_BUTTON_MOTION_MASK | ExposureMask); if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) || (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER)) { window_attribs.event_mask |= EnterWindowMask | LeaveWindowMask; } /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (CLIENT_APPEARANCE(pcd).backgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = CLIENT_APPEARANCE(pcd).backgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = CLIENT_APPEARANCE(pcd).background; } attr_mask |= CWCursor; window_attribs.cursor = wmGD.workspaceCursor; frmY = pcd->frameInfo.y; frmX = pcd->frameInfo.x; if (CLIENT_APPEARANCE(pcd).saveUnder && WmGetWindowAttributes (pcd->client) && wmGD.windowAttributes.save_under) { attr_mask |= CWSaveUnder; window_attribs.save_under = True; } pcd->clientFrameWin = XCreateWindow(DISPLAY, RootWindow (DISPLAY, SCREEN_FOR_CLIENT(pcd)), frmX, frmY, pcd->frameInfo.width, pcd->frameInfo.height, 0, CopyFromParent,InputOutput,CopyFromParent, attr_mask, &window_attribs); /* create resizing windows with cursors*/ if (SHOW_RESIZE_CURSORS(pcd) && (decoration & MWM_DECOR_RESIZEH)) { CreateStretcherWindows (pcd); } /* * Create title bar window. If the title bar has its own appearance, * or if there is no border around the client area, * then we need to create an input/output window to draw in. Otherwise * we can use an input-only window (to clip the corner resize windows). */ if (decoration & MWM_DECOR_TITLE) { attr_mask = CWCursor; window_attribs.cursor = wmGD.workspaceCursor; if (DECOUPLE_TITLE_APPEARANCE(pcd)) { /* title bar has a different appearance than rest of frame */ wclass = InputOutput; /* need to handle exposure events */ attr_mask |= CWEventMask; window_attribs.event_mask = ExposureMask; /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (CLIENT_TITLE_APPEARANCE(pcd).backgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = CLIENT_TITLE_APPEARANCE(pcd).backgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = CLIENT_TITLE_APPEARANCE(pcd).background; } } else { /* title bar has same appearance as rest of frame */ wclass = InputOnly; } pcd->clientTitleWin = XCreateWindow(DISPLAY, pcd->clientFrameWin, (int) pcd->frameInfo.upperBorderWidth, (int) pcd->frameInfo.upperBorderWidth, pcd->frameInfo.width - 2*pcd->frameInfo.upperBorderWidth, pcd->frameInfo.titleBarHeight, 0, CopyFromParent,wclass,CopyFromParent, attr_mask, &window_attribs); } /* generate gadget position search structure */ if (!AllocateGadgetRectangles (pcd)) return(FALSE); ComputeGadgetRectangles (pcd); /* * Create base window for reparenting. Save rectangle data for use * in event dispatching. */ window_attribs.event_mask = (SubstructureRedirectMask | SubstructureNotifyMask | FocusChangeMask); if (pcd->matteWidth > 0) { window_attribs.event_mask |= ExposureMask; window_attribs.background_pixel = pcd->matteBackground; } else { window_attribs.background_pixel = CLIENT_TITLE_APPEARANCE(pcd).background; } attr_mask = CWBackPixel | CWEventMask; pcd->clientBaseWin = XCreateWindow(DISPLAY, pcd->clientFrameWin, BaseWindowX (pcd), BaseWindowY (pcd), BaseWindowWidth (pcd), BaseWindowHeight (pcd), 0, CopyFromParent,InputOutput,CopyFromParent, attr_mask, &window_attribs); /* map all subwindows of client frame */ XMapSubwindows(DISPLAY, pcd->clientFrameWin); return(TRUE); } /*************************************<->************************************* * * GenerateFrameDisplayLists (pcd) * * * Description: * ----------- * Set up the graphic decorations for the frame * * * Inputs: * ------ * pcd - pointer to client data record * * * Outputs: * ------- * pcd - modified * * * Comments: * -------- * o This must be called after ConstructFrame to insure that the memory * for the rectangles has been allocated. * o If cnum values for StretcherCorner change, also change * StretcherCorner() in WmGraphics.c * o The variable internalBevel sets the depth of shadowing from the * frame to the client area. * o The variable insideBevel is used to decide how deep the bevel is * immediately inside the frame. This may not be internalBevel if * there's a matte, for example. * o The variable diffBevel stores the difference between insideBevel * and what's needed so the bottom of the title bar is correctly * beveled down to the client. * *************************************<->***********************************/ void GenerateFrameDisplayLists (ClientData *pcd) { unsigned long decoration = pcd->decor; int matte_width = pcd->matteWidth; int insideBevel, inset, diffBevel; unsigned int nTitleBevel, sTitleBevel, eTitleBevel, wTitleBevel; unsigned int meTitleBevel, inWidth; int x, y, xAdj = 0, yAdj = 0; unsigned int width, height; RList *prlTop = NULL, *prlBot = NULL; int jX, jY; unsigned int jW, jH; /* zero out part counts */ if (pcd->pclientTopShadows) pcd->pclientTopShadows->used = 0; if (pcd->pclientBottomShadows) pcd->pclientBottomShadows->used = 0; if (pcd->pclientTitleTopShadows) pcd->pclientTitleTopShadows->used = 0; if (pcd->pclientTitleBottomShadows) pcd->pclientTitleBottomShadows->used = 0; if (pcd->pclientMatteTopShadows) pcd->pclientMatteTopShadows->used = 0; if (pcd->pclientMatteBottomShadows) pcd->pclientMatteBottomShadows->used = 0; /* adjust inside bevel of gadgetry if there's a matte */ if ((wmGD.frameStyle == WmRECESSED) && (matte_width > 0)) insideBevel = JOIN_BEVEL(pcd); else insideBevel = pcd->internalBevel; diffBevel = insideBevel - 1; if (decoration & MWM_DECOR_RESIZEH) { /* adjust part width/heights if no title bar */ if ((pcd->internalBevel > 1) && !(decoration & MWM_DECOR_TITLE)) { inset = 1; } else { inset = 0; } /* * Draw the stretchers. If the horizontal or vertical pieces * get "too small", then don't draw them at all. */ GetFramePartInfo (pcd, FRAME_RESIZE_NW, &x, &y, &width, &height); StretcherCorner (pcd->pclientTopShadows, /* NW */ pcd->pclientBottomShadows, x, y, STRETCH_NORTH_WEST, pcd->frameInfo.upperBorderWidth - inset, width, height); GetFramePartInfo (pcd, FRAME_RESIZE_N, &x, &y, &width, &height); if ((int)width > 0) BevelRectangle (pcd->pclientTopShadows, /* N */ pcd->pclientBottomShadows, x, y, width, height - inset, 2, 1, ((wmGD.frameStyle == WmSLAB) ? 0 : 1), 1); GetFramePartInfo (pcd, FRAME_RESIZE_NE, &x, &y, &width, &height); StretcherCorner (pcd->pclientTopShadows, pcd->pclientBottomShadows, x, y, STRETCH_NORTH_EAST, pcd->frameInfo.upperBorderWidth - inset, width, height); GetFramePartInfo (pcd, FRAME_RESIZE_E, &x, &y, &width, &height); if ((int)height > 0) BevelRectangle (pcd->pclientTopShadows, /* E */ pcd->pclientBottomShadows, x+diffBevel, y, width-diffBevel, height, 1, 2, 1, ((wmGD.frameStyle == WmSLAB) ? 0 : 1)); GetFramePartInfo (pcd, FRAME_RESIZE_SE, &x, &y, &width, &height); StretcherCorner (pcd->pclientTopShadows, /* SE */ pcd->pclientBottomShadows, x, y, STRETCH_SOUTH_EAST, pcd->frameInfo.upperBorderWidth-inset, width, height); GetFramePartInfo (pcd, FRAME_RESIZE_S, &x, &y, &width, &height); if ((int) width > 0) BevelRectangle (pcd->pclientTopShadows, /* S */ pcd->pclientBottomShadows, x, y+diffBevel, width, height-diffBevel, ((wmGD.frameStyle == WmSLAB) ? 0 : 1), 1, 2, 1); GetFramePartInfo (pcd, FRAME_RESIZE_SW, &x, &y, &width, &height); StretcherCorner (pcd->pclientTopShadows, /* SW */ pcd->pclientBottomShadows, x, y, STRETCH_SOUTH_WEST, pcd->frameInfo.upperBorderWidth-inset, width, height); GetFramePartInfo (pcd, FRAME_RESIZE_W, &x, &y, &width, &height); if ((int) height > 0) BevelRectangle (pcd->pclientTopShadows, /* W */ pcd->pclientBottomShadows, x, y, width-diffBevel, height, 1, ((wmGD.frameStyle == WmSLAB) ? 0 : 1), 1, 2); if (diffBevel) { /* * Draw second inside bevel level. This goes just around the * client area under the title bar. */ BevelRectangle (pcd->pclientBottomShadows, /* inside */ pcd->pclientTopShadows, (int) (pcd->frameInfo.lowerBorderWidth-diffBevel), (int) (pcd->clientOffset.y - diffBevel), pcd->frameInfo.width - 2*pcd->frameInfo.lowerBorderWidth + 2*diffBevel, pcd->frameInfo.height - pcd->clientOffset.y - pcd->frameInfo.lowerBorderWidth + 2*diffBevel, (unsigned int) diffBevel, (unsigned int) diffBevel, (unsigned int) diffBevel, (unsigned int) diffBevel); } } else if (decoration & MWM_DECOR_BORDER) { /* produce default border with no resizing functions */ #ifdef WSM BevelRectangle (pcd->pclientTopShadows, /* outside */ pcd->pclientBottomShadows, 0, 0, pcd->frameInfo.width, pcd->frameInfo.height, FRAME_EXTERNAL_SHADOW_WIDTH, FRAME_EXTERNAL_SHADOW_WIDTH, FRAME_EXTERNAL_SHADOW_WIDTH, FRAME_EXTERNAL_SHADOW_WIDTH); #else /* WSM */ BevelRectangle (pcd->pclientTopShadows, /* outside */ pcd->pclientBottomShadows, 0, 0, pcd->frameInfo.width, pcd->frameInfo.height, 2, 2, 2, 2); #endif /* WSM */ if ((pcd->internalBevel > 1) && !matte_width && (decoration & MWM_DECOR_TITLE)) { /* * Need to do special beveling around the inside of the * client area separately from around title area. */ GetFramePartInfo (pcd, FRAME_TITLE, &x, &y, &width, &height); inset = 1 + (pcd->frameInfo.lowerBorderWidth - pcd->frameInfo.upperBorderWidth); BevelRectangle (pcd->pclientBottomShadows, pcd->pclientTopShadows, (int) (pcd->frameInfo.lowerBorderWidth-inset), (int) (pcd->frameInfo.lowerBorderWidth-inset), pcd->frameInfo.width - 2*pcd->frameInfo.lowerBorderWidth + 2*inset, pcd->frameInfo.height - 2*pcd->frameInfo.lowerBorderWidth + 2*inset, 1, 1, 1, 1); BevelRectangle (pcd->pclientBottomShadows, /* inside */ pcd->pclientTopShadows, (int) (pcd->frameInfo.lowerBorderWidth-diffBevel), pcd->clientOffset.y - diffBevel, pcd->frameInfo.width - 2*pcd->frameInfo.lowerBorderWidth + 2*diffBevel, pcd->frameInfo.height - pcd->clientOffset.y - pcd->frameInfo.lowerBorderWidth + 2*diffBevel, (unsigned int)diffBevel, (unsigned int)diffBevel, (unsigned int)diffBevel, (unsigned int)diffBevel); } else { #ifdef PANELIST if((pcd->dtwmBehaviors & DtWM_BEHAVIOR_PANEL) && (pcd->clientDecoration == WM_DECOR_BORDER)) { insideBevel = 0; } #endif /* PANELIST */ BevelRectangle (pcd->pclientBottomShadows, /* inside */ pcd->pclientTopShadows, (int)(pcd->frameInfo.lowerBorderWidth-insideBevel), (int)(pcd->frameInfo.lowerBorderWidth-insideBevel), pcd->frameInfo.width - 2*pcd->frameInfo.lowerBorderWidth + 2*insideBevel, pcd->frameInfo.height - 2*pcd->frameInfo.lowerBorderWidth + 2*insideBevel, (unsigned int)insideBevel, (unsigned int)insideBevel, (unsigned int)insideBevel, (unsigned int)insideBevel); } } /* draw title bar */ /* * set bevels for title bar and parts */ if (decoration & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { nTitleBevel = JOIN_BEVEL(pcd); /* north side of title */ if (wmGD.frameStyle == WmSLAB) { sTitleBevel = JOIN_BEVEL(pcd); /* south side of title */ } else { sTitleBevel = insideBevel; /* south side of title */ } eTitleBevel = JOIN_BEVEL(pcd); /* east side of title */ wTitleBevel = JOIN_BEVEL(pcd); /* west side of title */ meTitleBevel = JOIN_BEVEL(pcd); /* btw Minimize, Maximize */ } else { /* borderless window */ nTitleBevel = EXTERNAL_BEVEL(pcd); if (wmGD.frameStyle == WmSLAB) { sTitleBevel = (matte_width > 0) ? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); } else { sTitleBevel = (matte_width > 0) ? insideBevel : EXTERNAL_BEVEL(pcd); } eTitleBevel = (decoration & (MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE))? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); wTitleBevel = (decoration & MWM_DECOR_MENU) ? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); /* beveling east of minimize */ meTitleBevel = (decoration & (MWM_DECOR_MAXIMIZE)) ? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); } if (decoration & MWM_DECOR_TITLE) { /* * Use a different set of rectangles if title appearance * is different from the rest of the frame. */ if (DECOUPLE_TITLE_APPEARANCE(pcd)) { prlTop = pcd->pclientTitleTopShadows; prlBot = pcd->pclientTitleBottomShadows; xAdj = yAdj = pcd->frameInfo.upperBorderWidth; } else { prlTop = pcd->pclientTopShadows; prlBot = pcd->pclientBottomShadows; xAdj = yAdj = 0; } GetFramePartInfo (pcd, FRAME_TITLE, &x, &y, &width, &height); if (pcd->decorFlags & TITLE_DEPRESSED) { /* show depressed title gadget */ GetDepressInfo (pcd, FRAME_TITLE, &jX, &jY, &jW, &jH, &inWidth); BevelDepressedRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, eTitleBevel, sTitleBevel, wTitleBevel, inWidth); } else { /* show normal title gadget */ BevelRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, eTitleBevel, sTitleBevel, wTitleBevel); } } if (decoration & MWM_DECOR_MENU) { GetFramePartInfo (pcd, FRAME_SYSTEM, &x, &y, &width, &height); if (pcd->decorFlags & SYSTEM_DEPRESSED) { /* show depressed system gadget */ GetDepressInfo (pcd, FRAME_SYSTEM, &jX, &jY, &jW, &jH, &inWidth); BevelDepressedRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, wTitleBevel, sTitleBevel, nTitleBevel, inWidth); } else { /* show normal system gadget */ BevelRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, wTitleBevel, sTitleBevel, nTitleBevel); } /* system icon */ BevelSystemButton (prlTop, prlBot, x-xAdj, y-yAdj, width, height); } if (decoration & MWM_DECOR_MINIMIZE) { GetFramePartInfo (pcd, FRAME_MINIMIZE, &x, &y, &width, &height); if (pcd->decorFlags & MINIMIZE_DEPRESSED) { /* show depressed minimize gadget */ GetDepressInfo (pcd, FRAME_MINIMIZE, &jX, &jY, &jW, &jH, &inWidth); BevelDepressedRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, meTitleBevel, sTitleBevel, eTitleBevel, inWidth); } else { /* show normal minimize gadget */ BevelRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, meTitleBevel, sTitleBevel, eTitleBevel); } BevelMinimizeButton(prlTop, /* minimize icon */ prlBot, x-xAdj, y-yAdj, height); } if (decoration & MWM_DECOR_MAXIMIZE) { GetFramePartInfo (pcd, FRAME_MAXIMIZE, &x, &y, &width, &height); if (pcd->decorFlags & MAXIMIZE_DEPRESSED) { /* show depressed maximize gadget */ GetDepressInfo (pcd, FRAME_MAXIMIZE, &jX, &jY, &jW, &jH, &inWidth); BevelDepressedRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, nTitleBevel, sTitleBevel, eTitleBevel, inWidth); } else { /* show normal maximize gadget */ BevelRectangle (prlTop, prlBot, x-xAdj, y-yAdj, width, height, nTitleBevel, nTitleBevel, sTitleBevel, eTitleBevel); } /* maximize icon - in or out depending on client state */ if (pcd->maxConfig) { BevelMaximizeButton(prlBot, prlTop, x-xAdj, y-yAdj, height); } else { BevelMaximizeButton(prlTop, prlBot, x-xAdj, y-yAdj, height); } } /* draw the client matte (this is in the base window!!!) */ if (matte_width > 0) { unsigned int mWidth, mHeight, exMatteBevel, tMatteBevel; mWidth = BaseWindowWidth (pcd); mHeight = BaseWindowHeight (pcd); if (decoration & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { exMatteBevel = JOIN_BEVEL(pcd); tMatteBevel = JOIN_BEVEL(pcd); } else { exMatteBevel = EXTERNAL_BEVEL(pcd); tMatteBevel = (decoration & MWM_DECOR_TITLE) ? JOIN_BEVEL(pcd) : EXTERNAL_BEVEL(pcd); } /* set up beveling around the edges */ BevelRectangle (pcd->pclientMatteTopShadows, pcd->pclientMatteBottomShadows, 0, 0, mWidth, mHeight, tMatteBevel, exMatteBevel, exMatteBevel, exMatteBevel); /* reversed beveling on inside rectange ! */ BevelRectangle ( pcd->pclientMatteBottomShadows, pcd->pclientMatteTopShadows, matte_width - pcd->internalBevel, matte_width - pcd->internalBevel, mWidth - 2*matte_width + 2*pcd->internalBevel, mHeight - 2*matte_width + 2*pcd->internalBevel, (unsigned int) pcd->internalBevel, (unsigned int) pcd->internalBevel, (unsigned int) pcd->internalBevel, (unsigned int) pcd->internalBevel); } } /*************************************<->************************************* * * AdoptClient (pcd) * * * Description: * ----------- * Reparent the client window to the window frame * * * Inputs: * ------ * pcd - pointer to client data record * * * Outputs: * ------- * None * * * Comments: * -------- * *************************************<->***********************************/ void AdoptClient (ClientData *pcd) { XWindowChanges windowChanges; unsigned int mask; /* Put the window in the window manager's save set */ if (!(pcd->clientFlags & CLIENT_WM_CLIENTS)) { XChangeSaveSet (DISPLAY, pcd->client, SetModeInsert); pcd->clientFlags |= CLIENT_IN_SAVE_SET; } /* * set window geometry to be consistent with what we believe */ mask = CWWidth | CWHeight; windowChanges.width = pcd->clientWidth; windowChanges.height = pcd->clientHeight; /* * strip off previous window border if we're adding our own border * or matte */ if ( (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) || (pcd->matteWidth > 0) ) { mask |= CWBorderWidth; windowChanges.border_width = 0; } XConfigureWindow (DISPLAY, pcd->client, mask, &windowChanges); #ifndef NO_SHAPE /* shape our frame to match that of the client's window */ if (wmGD.hasShape) { int xws, yws, xbs, ybs; unsigned wws, hws, wbs, hbs; int boundingShaped, clipShaped; XShapeSelectInput (DISPLAY, pcd->client, ShapeNotifyMask); XShapeQueryExtents (DISPLAY, pcd->client, &boundingShaped, &xws, &yws, &wws, &hws, &clipShaped, &xbs, &ybs, &wbs, &hbs); pcd->wShaped = boundingShaped; } #endif /* NO_SHAPE */ /* reparent the window to the base window */ XReparentWindow (DISPLAY, pcd->client, pcd->clientBaseWin, pcd->matteWidth, pcd->matteWidth); pcd->clientFlags |= CLIENT_REPARENTED; } /* END OF FUNCTION AdoptClient */ /*************************************<->************************************* * * GetTextBox (pcd, pBox) * * * Description: * ----------- * Gets the rectangle that the text should fit into in the title bar * * * Inputs: * ------ * pcd - pointer to client data * pBox - pointer to an XRectangle structure that gets return data * * Outputs: * ------- * pBox - data is returned here * * Comments: * -------- * *************************************<->***********************************/ void GetTextBox (ClientData *pcd, XRectangle *pBox) { int x,y; unsigned int width,height; #ifdef WSM Dimension textWidth; Dimension offset; XmFontList fontList; #endif /* WSM */ /* get size of title area */ if (!GetFramePartInfo (pcd, FRAME_TITLE, &x, &y, &width, &height)) { /* no title area !!! */ pBox->x = 0; pBox->y = 0; pBox->width = 0; pBox->height = 0; return; } /* adjust for shadowing and allow for some padding around the edges */ x += WM_TOP_TITLE_SHADOW + WM_TOP_TITLE_PADDING; y += WM_TOP_TITLE_SHADOW + WM_TOP_TITLE_PADDING; width -= WM_TOP_TITLE_SHADOW + WM_BOTTOM_TITLE_SHADOW + WM_TOP_TITLE_PADDING + WM_BOTTOM_TITLE_PADDING; height -= WM_TOP_TITLE_SHADOW + WM_BOTTOM_TITLE_SHADOW + WM_TOP_TITLE_PADDING + WM_BOTTOM_TITLE_PADDING; #ifdef DT_LEFT_JUSTIFIED_TITLE if (wmGD.frameStyle == WmSLAB) { /* * We left justify the title in this style. * To keep it a little neat, we offset the title from * the left edge just a little (half the title height). * See if we have room to do this. */ if (DECOUPLE_TITLE_APPEARANCE(pcd)) fontList = CLIENT_TITLE_APPEARANCE(pcd).fontList; else fontList = CLIENT_APPEARANCE(pcd).fontList; textWidth = XmStringWidth(fontList, pcd->clientTitle); offset = TitleBarHeight(pcd)/2; if ((textWidth + offset) <= width) { /* We have plenty of room, do the offset */ x += offset; width -= offset; } else if ((short) (width - textWidth) > 0) { /* We don't have enough room to do our usual offset, * but if we reduce the offset, the text won't get * clipped. */ offset = (width - textWidth) / 2; x += offset; width -= offset; } } #endif /* DT_LEFT_JUSTIFIED_TITLE */ /* return position and size */ pBox->x = x; pBox->y = y; pBox->width = width; pBox->height = height; } /*************************************<->************************************* * * DrawWindowTitle (pcd, eraseFirst) * * * Description: * ----------- * Overwrites or replaces the client's title text in the * title bar of the frame. * * * Inputs: * ------ * pcd - pointer to client data * eraseFirst - if true, then the old title is erased first * * Outputs: * ------- * none * * Comments: * -------- * o Assumes 8-bit text for now. * * *************************************<->***********************************/ void DrawWindowTitle (ClientData *pcd, Boolean eraseFirst) { GC clientGC; unsigned long decoration = pcd->decor; XRectangle textBox; Window win; XmFontList fontList; /* make sure there is a title bar first */ if (!(decoration & MWM_DECOR_TITLE)) return; if (DECOUPLE_TITLE_APPEARANCE(pcd)) { /* use "active" GC if we have keyboard focus */ if (pcd == wmGD.keyboardFocus) { clientGC = CLIENT_TITLE_APPEARANCE(pcd).activeGC; } else { clientGC = CLIENT_TITLE_APPEARANCE(pcd).inactiveGC; } /* get the area that the text must fit in */ GetTextBox (pcd, &textBox); /* adjust position to be relative to titlebar window, not frame */ textBox.x -= (short) pcd->frameInfo.upperBorderWidth; textBox.y -= (short) pcd->frameInfo.upperBorderWidth; win = pcd->clientTitleWin; fontList = CLIENT_TITLE_APPEARANCE(pcd).fontList; } else { /* use "active" GC if we have keyboard focus */ if (pcd == wmGD.keyboardFocus) { clientGC = CLIENT_APPEARANCE(pcd).activeGC; } else { clientGC = CLIENT_APPEARANCE(pcd).inactiveGC; } /* get the area that the text must fit in */ GetTextBox (pcd, &textBox); win = pcd->clientFrameWin; fontList = CLIENT_APPEARANCE(pcd).fontList; } if (eraseFirst) { XClearArea (DISPLAY, win, textBox.x, textBox.y, (unsigned int) textBox.width, (unsigned int) textBox.height, FALSE); } #ifdef DT_LEFT_JUSTIFIED_TITLE WmDrawXmString(DISPLAY, win, fontList, pcd->clientTitle, clientGC, textBox.x, textBox.y, textBox.width, &textBox, ((wmGD.frameStyle == WmSLAB) ? False : True)); #else /* DT_LEFT_JUSTIFIED_TITLE */ #ifdef WSM WmDrawXmString(DISPLAY, win, fontList, pcd->clientTitle, clientGC, textBox.x, textBox.y, textBox.width, &textBox, True); #else WmDrawXmString(DISPLAY, win, fontList, pcd->clientTitle, clientGC, textBox.x, textBox.y, textBox.width, &textBox); #endif #endif /* DT_LEFT_JUSTIFIED_TITLE */ } /* END OF FUNCTION DrawWindowTitle */ /*************************************<->************************************* * * CreateStretcherWindows (pcd) * * * Description: * ----------- * Create the input-only windows that overlay the resize gadgets. * * * Inputs: * ------ * pcd - pointer to client data. * * * Outputs: * ------- * pcd - modified * * Return - none * * * Comments: * -------- * o The windows are sized based upon resizeBorderWidth * o This should be called before creating the title bar, * and reparenting window. Later windows should obscure parts of the * stretchers. * o The stretchers are given special cursors. * *************************************<->***********************************/ void CreateStretcherWindows (ClientData *pcd) { int iWin; int x, y; unsigned int width, height; XSetWindowAttributes win_attribs; unsigned long attr_mask; for (iWin = 0; iWin < STRETCH_COUNT; iWin++) { switch (iWin) { case STRETCH_NORTH_WEST: GetFramePartInfo (pcd, FRAME_RESIZE_NW, &x, &y, &width, &height); break; case STRETCH_NORTH: GetFramePartInfo (pcd, FRAME_RESIZE_N, &x, &y, &width, &height); break; case STRETCH_NORTH_EAST: GetFramePartInfo (pcd, FRAME_RESIZE_NE, &x, &y, &width, &height); break; case STRETCH_EAST: GetFramePartInfo (pcd, FRAME_RESIZE_E, &x, &y, &width, &height); break; case STRETCH_SOUTH_EAST: GetFramePartInfo (pcd, FRAME_RESIZE_SE, &x, &y, &width, &height); break; case STRETCH_SOUTH: GetFramePartInfo (pcd, FRAME_RESIZE_S, &x, &y, &width, &height); break; case STRETCH_SOUTH_WEST: GetFramePartInfo (pcd, FRAME_RESIZE_SW, &x, &y, &width, &height); break; case STRETCH_WEST: GetFramePartInfo (pcd, FRAME_RESIZE_W, &x, &y, &width, &height); break; } attr_mask = CWCursor; win_attribs.cursor = wmGD.stretchCursors[iWin]; pcd->clientStretchWin[iWin] = XCreateWindow(DISPLAY, pcd->clientFrameWin, x, y, width, height, 0, CopyFromParent, InputOnly, CopyFromParent, attr_mask, &win_attribs); } } /* END OF FUNCTION CreateStretcherWindows */ /*************************************<->************************************* * * CountFrameRectangles (pSD) * * * Description: * ----------- * Computes the number of top and bottom shadow rectangles to allocate * per frame. * * Inputs: * ------ * pWS - pointer to workspace data * * Outputs: * ------- * * Comments: * -------- * * *************************************<->***********************************/ void CountFrameRectangles (WmScreenData *pSD) { int i; pSD->Num_Title_Ts_Elements = pSD->Num_Title_Bs_Elements = 0; /* count up rectangles for title bar */ for (i = FRAME_SYSTEM; i <= FRAME_MAXIMIZE; i++) { pSD->Num_Title_Ts_Elements += ((Bevels[i].top.external * pSD->externalBevel) + (Bevels[i].top.internal * MAX_INTERNAL_BEVEL) + (Bevels[i].top.join * pSD->joinBevel)); pSD->Num_Title_Bs_Elements += ((Bevels[i].bottom.external* pSD->externalBevel)+ (Bevels[i].bottom.internal * MAX_INTERNAL_BEVEL) + (Bevels[i].bottom.join * pSD->joinBevel)); } pSD->Num_Resize_Ts_Elements = pSD->Num_Resize_Bs_Elements = 0; /* count up rectangles for resize handles*/ for (i = FRAME_RESIZE_NW; i <= FRAME_RESIZE_W; i++) { pSD->Num_Resize_Ts_Elements += ((Bevels[i].top.external * pSD->externalBevel) + (Bevels[i].top.internal * MAX_INTERNAL_BEVEL) + (Bevels[i].top.join * pSD->joinBevel)); pSD->Num_Resize_Bs_Elements += ((Bevels[i].bottom.external* pSD->externalBevel)+ (Bevels[i].bottom.internal * MAX_INTERNAL_BEVEL) + (Bevels[i].bottom.join * pSD->joinBevel)); } } /* END OF FUNCTION CountFrameRectangles */ /*************************************<->************************************* * * AllocateFrameDisplayLists (pcd) * * * Description: * ----------- * Allocates memory for the graphic display lists for the frame. * * * Inputs: * ------ * pcd - pointer to the client data * * * Outputs: * ------- * pcd - fields modified * * Return - TRUE if successful, FALSE otherwise. * * * Comments: * -------- * * *************************************<->***********************************/ Boolean AllocateFrameDisplayLists (ClientData *pcd) { int frame_top_count, frame_bottom_count; /* * If the title bar has it's own appearance, then allocate * separate display lists for it. */ if (DECOUPLE_TITLE_APPEARANCE(pcd) && (pcd->decor & MWM_DECOR_TITLE)) { if (((pcd->pclientTitleTopShadows = AllocateRList ((unsigned)NUM_TITLE_TS_ELEMENTS(pcd))) == NULL) || ((pcd->pclientTitleBottomShadows = AllocateRList ((unsigned)NUM_TITLE_BS_ELEMENTS(pcd))) == NULL)) { /* out of memory! */ Warning (((char *)GETMESSAGE(8, 1, "Insufficient memory for client window framing"))); return(FALSE); } frame_top_count = NUM_RESIZE_TS_ELEMENTS(pcd); frame_bottom_count = NUM_RESIZE_BS_ELEMENTS(pcd); } else { frame_top_count = NUM_RESIZE_TS_ELEMENTS(pcd) + NUM_TITLE_TS_ELEMENTS(pcd); frame_bottom_count = NUM_RESIZE_BS_ELEMENTS(pcd) + NUM_RESIZE_BS_ELEMENTS(pcd); } /* * Allocate the primary lists for the frame */ if ( (pcd->pclientTopShadows == NULL) && ((pcd->pclientTopShadows = AllocateRList ((unsigned)frame_top_count)) == NULL) ) { /* out of memory! */ Warning (((char *)GETMESSAGE(8, 2, "Insufficient memory for client window framing"))); return(FALSE); } if ( (pcd->pclientBottomShadows == NULL) && ((pcd->pclientBottomShadows = AllocateRList ((unsigned)frame_bottom_count)) == NULL) ) { /* out of memory! */ Warning (((char *)GETMESSAGE(8, 3, "Insufficient memory for client window framing"))); return(FALSE); } /* * Only allocate matte lists if there is a matte. */ if ( (pcd->matteWidth) && (pcd->pclientMatteTopShadows == NULL) && ((pcd->pclientMatteTopShadows = AllocateRList ((unsigned)NUM_MATTE_TS_RECTS)) == NULL)) { /* out of memory! */ Warning (((char *)GETMESSAGE(8, 4, "Insufficient memory for client window framing"))); return(FALSE); } if ( (pcd->matteWidth) && (pcd->pclientMatteBottomShadows == NULL) && ((pcd->pclientMatteBottomShadows = AllocateRList ((unsigned)NUM_MATTE_BS_RECTS)) == NULL)) { /* out of memory! */ Warning (((char *)GETMESSAGE(8, 5, "Insufficient memory for client window framing"))); return(FALSE); } return(TRUE); } /* END OF FUNCTION AllocateFrameDisplayLists */ /*************************************<->************************************* * * InitClientDecoration (pSD) * * * Description: * ----------- * Initializes client decoration routines * * * Inputs: * ------ * pSD - pointer to screen data * * Outputs: * ------- * * * Comments: * -------- * This must be called once before decorating any client frames. *************************************<->***********************************/ void InitClientDecoration (WmScreenData *pSD) { CountFrameRectangles(pSD); } /* END OF FUNCTION InitClientDecoration */ /*************************************<->************************************* * * AllocateGadgetRectangles (pcd) * * * Description: * ----------- * Allocate the memory for event rectangles structures. * * * Inputs: * ------ * pcd - pointer to client data structure * * Outputs: * ------- * pcd - modified * * * Comments: * -------- * *************************************<->***********************************/ Boolean AllocateGadgetRectangles (ClientData *pcd) { int num_rects; unsigned long decor = pcd->decor; GadgetRectangle *pgr; if (decor & MWM_DECOR_TITLE) { /* count how many rectangles to allocate for titlebar */ num_rects = 1; if (decor & MWM_DECOR_MENU) num_rects += 1; if (decor & MWM_DECOR_MINIMIZE) num_rects += 1; if (decor & MWM_DECOR_MAXIMIZE) num_rects += 1; /* allocate memory if no memory is allocated */ if ( pcd->pTitleGadgets == NULL) { /* allocate memory for these guys */ pgr = (GadgetRectangle *) XtMalloc (num_rects * sizeof(GadgetRectangle)); if (pgr == NULL) { /* out of memory! */ Warning (((char *)GETMESSAGE(8, 6, "Insufficient memory for client window framing"))); return (FALSE); } /* update client data */ pcd->pTitleGadgets = pgr; pcd->cTitleGadgets = 0; } } if (decor & MWM_DECOR_RESIZEH) { /* allocate memory if no memory is allocated */ if ( pcd->pResizeGadgets == NULL) { /* allocate memory for these guys */ pgr = (GadgetRectangle *) XtMalloc (STRETCH_COUNT * sizeof(GadgetRectangle)); if (pgr == NULL) { /* out of memory! */ Warning (((char *)GETMESSAGE(8, 7, "Insufficient memory for client window framing"))); return (FALSE); } /* update client data */ pcd->pResizeGadgets = pgr; } } return(TRUE); } /* END OF FUNCTION AllocateGadgetRectangles */ /*************************************<->************************************* * * ComputeGadgetRectangles (pcd) * * * Description: * ----------- * Creates the event rectangles structures to aid in identifying * frame parts when events come in * * * Inputs: * ------ * pcd - pointer to client data structure * * Outputs: * ------- * pcd - modified * * * Comments: * -------- * o assumes gadget rectangles are already allocated. * *************************************<->***********************************/ void ComputeGadgetRectangles (ClientData *pcd) { unsigned long decor = pcd->decor; GadgetRectangle *pgr; int fpX, fpY; unsigned int fpWidth, fpHeight; int igr; int clientWidth = (pcd->maxConfig) ? pcd->maxWidth : pcd->clientWidth; /* title bar */ if (decor & MWM_DECOR_TITLE) { if ( (pgr = pcd->pTitleGadgets) == NULL) { return; /* nothing there !!! */ } /* do title rectangle */ pcd->titleRectangle.x = pcd->frameInfo.upperBorderWidth; pcd->titleRectangle.y = pcd->frameInfo.upperBorderWidth; /* * Fixed bug where last button in title bar did not activate when * the client's X border was showing. */ pcd->titleRectangle.width = clientWidth + (XBorderIsShowing(pcd) ? 2*pcd->xBorderWidth : 2*pcd->matteWidth); pcd->titleRectangle.height = pcd->frameInfo.titleBarHeight; /* fill in title bar rectangles */ igr = 0; pgr[igr].id = FRAME_TITLE; GetFramePartInfo (pcd, FRAME_TITLE, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; if (decor & MWM_DECOR_MENU) { pgr[igr].id = FRAME_SYSTEM; GetFramePartInfo (pcd, FRAME_SYSTEM, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; } if (decor & MWM_DECOR_MINIMIZE) { pgr[igr].id = FRAME_MINIMIZE; GetFramePartInfo (pcd, FRAME_MINIMIZE, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; } if (decor & MWM_DECOR_MAXIMIZE) { pgr[igr].id = FRAME_MAXIMIZE; GetFramePartInfo (pcd, FRAME_MAXIMIZE, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; } /* update client data */ pcd->pTitleGadgets = pgr; pcd->cTitleGadgets = igr; } /* client matte area (actually base window area) */ if (decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) { pcd->matteRectangle.x = pcd->frameInfo.lowerBorderWidth; pcd->matteRectangle.y = pcd->frameInfo.upperBorderWidth + pcd->frameInfo.titleBarHeight; pcd->matteRectangle.width = pcd->frameInfo.width - (2 * pcd->frameInfo.lowerBorderWidth); pcd->matteRectangle.height = pcd->frameInfo.height - pcd->frameInfo.upperBorderWidth - pcd->frameInfo.lowerBorderWidth - pcd->frameInfo.titleBarHeight; } else { pcd->matteRectangle.x = 0; pcd->matteRectangle.y = pcd->frameInfo.titleBarHeight; pcd->matteRectangle.width = pcd->frameInfo.width; pcd->matteRectangle.height = pcd->frameInfo.height - pcd->frameInfo.titleBarHeight; } if (decor & MWM_DECOR_RESIZEH) { if ( (pgr = pcd->pResizeGadgets) == NULL) { return; /* nothing there !!! */ } /* fill in resize rectangles */ igr = 0; if (decor & MWM_DECOR_RESIZEH) { pgr[igr].id = FRAME_RESIZE_NW; GetFramePartInfo (pcd, FRAME_RESIZE_NW, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; pgr[igr].id = FRAME_RESIZE_N; GetFramePartInfo (pcd, FRAME_RESIZE_N, &fpX, &fpY, &fpWidth, &fpHeight); if ((int) fpWidth > 0) { /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; } pgr[igr].id = FRAME_RESIZE_NE; GetFramePartInfo (pcd, FRAME_RESIZE_NE, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; pgr[igr].id = FRAME_RESIZE_W; GetFramePartInfo (pcd, FRAME_RESIZE_W, &fpX, &fpY, &fpWidth, &fpHeight); if ((int)fpHeight > 0) { /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; } pgr[igr].id = FRAME_RESIZE_E; GetFramePartInfo (pcd, FRAME_RESIZE_E, &fpX, &fpY, &fpWidth, &fpHeight); if ((int) fpHeight > 0) { /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; } pgr[igr].id = FRAME_RESIZE_SW; GetFramePartInfo (pcd, FRAME_RESIZE_SW, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; pgr[igr].id = FRAME_RESIZE_S; GetFramePartInfo (pcd, FRAME_RESIZE_S, &fpX, &fpY, &fpWidth, &fpHeight); if ((int) fpWidth > 0) { /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; igr += 1; } pgr[igr].id = FRAME_RESIZE_SE; GetFramePartInfo (pcd, FRAME_RESIZE_SE, &fpX, &fpY, &fpWidth, &fpHeight); /* copy in and convert to shorts */ pgr[igr].rect.x = fpX; pgr[igr].rect.y = fpY; pgr[igr].rect.width = fpWidth; pgr[igr].rect.height = fpHeight; } /* update client data */ pcd->pResizeGadgets = pgr; } } /* END OF FUNCTION ComputeGadgetRectangles */ /*************************************<->************************************* * * GetSystemMenuPosition (pcd, px, py, height, context) * * * Description: * ----------- * Returns the position of where the system menu should be popped up. * The hotspotRectangle in global is also set up to match the icon or * system menu button area. * * * Inputs: * ------ * pcd = pointer to client data * * px = pointer to x location * * py = pointer to y location * * height = height of the system menu * * context = context that the menu is to be posted under. * * * Outputs: * ------- * *px = x location * * *py = y location * * wmGD.hotspotRectangle = system menu button or icon area (root relative) * *************************************<->***********************************/ void GetSystemMenuPosition (ClientData *pcd, int *px, int *py, unsigned int height, Context context) { if ((pcd->clientState == MINIMIZED_STATE) || ((pcd->clientState != MINIMIZED_STATE) && (context == F_SUBCONTEXT_IB_WICON))) { /* * Try to put the menu directly above the icon. * If it would hit the top of the screen then try to put it below * the icon and label. * If it would then hit the bottom of the screen turn of the hotspot * processing. */ if (pcd->pSD->useIconBox && P_ICON_BOX(pcd)) { GetIconBoxIconRootXY (pcd, px, py); wmGD.hotspotRectangle.x = *px; wmGD.hotspotRectangle.y = *py; *py -= height; if (*py < 0) { *py += height + ICON_HEIGHT(pcd); if (*py + height >= DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pcd))) { wmGD.checkHotspot = FALSE; } } } else { *px = ICON_X(pcd); *py = ICON_Y(pcd) - height; if (*py < 0) { *py = ICON_Y(pcd) + ICON_HEIGHT(pcd); if (*py + height >= DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pcd))) { wmGD.checkHotspot = FALSE; } } wmGD.hotspotRectangle.x = ICON_X(pcd); wmGD.hotspotRectangle.y = ICON_Y(pcd); } /* setup the hotspot rectangle data */ wmGD.hotspotRectangle.width = ICON_WIDTH(pcd); wmGD.hotspotRectangle.height = ICON_HEIGHT(pcd); } else { /* * Try to put the menu directly below the SW corner of the * titlebar/border. * If it would hit the bottom of the screen then try to put it directly * above the NW corner of the titlebar/border. * If it would then hit the top of the screen turn of the hotspot * processing. */ if ((pcd->decor & MWM_DECOR_TITLE) && !(pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER))) { *px = pcd->frameInfo.x; *py = pcd->frameInfo.y + pcd->frameInfo.titleBarHeight; } else { *px = pcd->frameInfo.x + pcd->frameInfo.lowerBorderWidth; *py = pcd->frameInfo.y + pcd->frameInfo.upperBorderWidth + pcd->frameInfo.titleBarHeight; } if (*py + height >= DisplayHeight (DISPLAY, SCREEN_FOR_CLIENT(pcd))) { if ((pcd->decor & MWM_DECOR_TITLE) && !(pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER))) { *py = pcd->frameInfo.y - height; } else { *py = pcd->frameInfo.y + pcd->frameInfo.upperBorderWidth - height; } if (*py < 0) { wmGD.checkHotspot = FALSE; } } /* setup the hotspot rectangle data */ wmGD.hotspotRectangle.x = pcd->frameInfo.x + pcd->frameInfo.lowerBorderWidth; wmGD.hotspotRectangle.y = pcd->frameInfo.y + pcd->frameInfo.upperBorderWidth; /* assume square button */ wmGD.hotspotRectangle.width = pcd->frameInfo.titleBarHeight; wmGD.hotspotRectangle.height = pcd->frameInfo.titleBarHeight; } } /* END OF FUNCTION GetSystemMenuPosition */ /*************************************<->************************************* * * ShowActiveClientFrame (pcd) * * * Description: * ----------- * Paint the frame to indicate an "active" window * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * * Comments: * -------- * o This calls the frame exposure procedure, which gets some GCs based * on the current keyboard focus. Thus, wmGD.keyboardFocus == pcd * must be TRUE when this is called for the correct highlighting to * occur. * *************************************<->***********************************/ void ShowActiveClientFrame (ClientData *pcd) { unsigned long attr_mask = 0; XSetWindowAttributes window_attribs; if (DECOUPLE_TITLE_APPEARANCE(pcd) && (pcd->decor & MWM_DECOR_TITLE)) { /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (CLIENT_TITLE_APPEARANCE(pcd).activeBackgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = CLIENT_TITLE_APPEARANCE(pcd).activeBackgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = CLIENT_TITLE_APPEARANCE(pcd).activeBackground; } XChangeWindowAttributes (DISPLAY, pcd->clientTitleWin, attr_mask, &window_attribs); /* clear the frame to the right background */ XClearWindow (DISPLAY, pcd->clientTitleWin); } /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (CLIENT_APPEARANCE(pcd).activeBackgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = CLIENT_APPEARANCE(pcd).activeBackgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = CLIENT_APPEARANCE(pcd).activeBackground; } XChangeWindowAttributes (DISPLAY, pcd->clientFrameWin, attr_mask, &window_attribs); /* clear the frame to the right background */ XClearWindow (DISPLAY, pcd->clientFrameWin); /* simulate exposure of window */ FrameExposureProc (pcd); } /* END OF FUNCTION ShowActiveClient */ /*************************************<->************************************* * * ShowInactiveClientFrame (pcd) * * * Description: * ----------- * Paint the frame to indicate an "inactive" window * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * * Comments: * -------- * o This calls the frame exposure procedure, which gets some GCs based * on the current keyboard focus. Thus, wmGD.keyboardFocus == pcd * must be FALSE when this is called for the correct highlighting to * occur. * * ******************************<->***********************************/ void ShowInactiveClientFrame (ClientData *pcd) { unsigned long attr_mask = 0; XSetWindowAttributes window_attribs; if (DECOUPLE_TITLE_APPEARANCE(pcd) && (pcd->decor & MWM_DECOR_TITLE)) { /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (CLIENT_TITLE_APPEARANCE(pcd).backgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = CLIENT_TITLE_APPEARANCE(pcd).backgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = CLIENT_TITLE_APPEARANCE(pcd).background; } XChangeWindowAttributes (DISPLAY, pcd->clientTitleWin, attr_mask, &window_attribs); /* clear the frame to the right background */ XClearWindow (DISPLAY, pcd->clientTitleWin); /* * attr_mask must be cleared because it is set if * DECOUPLE_TITLE_APPEARANCE(pcd) is true. */ attr_mask = 0; } /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (CLIENT_APPEARANCE(pcd).backgroundPixmap) { attr_mask |= CWBackPixmap; window_attribs.background_pixmap = CLIENT_APPEARANCE(pcd).backgroundPixmap; } else { attr_mask |= CWBackPixel; window_attribs.background_pixel = CLIENT_APPEARANCE(pcd).background; } /* change window attribs so clear does the right thing */ XChangeWindowAttributes (DISPLAY, pcd->clientFrameWin, attr_mask, &window_attribs); /* clear the frame to the right background */ XClearWindow (DISPLAY, pcd->clientFrameWin); /* simulate exposure of window */ FrameExposureProc (pcd); } /* END OF FUNCTION ShowInactiveClientFrame */ /*************************************<->************************************* * * RegenerateClientFrame (pcd) * * * Description: * ----------- * Reconfigure the sizes of all the components of the client frame * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * Comments: * -------- * * *************************************<->***********************************/ void RegenerateClientFrame (ClientData *pcd) { unsigned long decor = pcd->decor; #ifdef PANELIST /* * If an embedded client, there is no frame. */ if (pcd->pECD) { if (!pcd->clientFrameWin) { return; } } #endif /* PANELIST */ /* recompute frame information */ SetFrameInfo (pcd); /* move & resize frame window */ XMoveResizeWindow (DISPLAY, pcd->clientFrameWin, pcd->frameInfo.x, pcd->frameInfo.y, pcd->frameInfo.width, pcd->frameInfo.height); /* resize title bar window */ if (decor & MWM_DECOR_TITLE) { XResizeWindow (DISPLAY, pcd->clientTitleWin, pcd->frameInfo.width - 2*pcd->frameInfo.upperBorderWidth, pcd->frameInfo.titleBarHeight); } /* resize base window */ XResizeWindow (DISPLAY, pcd->clientBaseWin, BaseWindowWidth (pcd), BaseWindowHeight (pcd)); /* resize the stretcher windows */ if (SHOW_RESIZE_CURSORS(pcd) && (decor & MWM_DECOR_RESIZEH)) { XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_NORTH_WEST], 0, 0, pcd->frameInfo.cornerWidth, pcd->frameInfo.cornerHeight); XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_NORTH], (int) pcd->frameInfo.cornerWidth, 0, pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth, pcd->frameInfo.upperBorderWidth); XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_NORTH_EAST], (int) (pcd->frameInfo.width - pcd->frameInfo.cornerWidth), 0, pcd->frameInfo.cornerWidth, pcd->frameInfo.cornerHeight); XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_EAST], (int) (pcd->frameInfo.width - pcd->frameInfo.lowerBorderWidth), (int) (pcd->frameInfo.cornerHeight), pcd->frameInfo.lowerBorderWidth, pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight); XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_SOUTH_EAST], (int) (pcd->frameInfo.width - pcd->frameInfo.cornerWidth), (int) (pcd->frameInfo.height - pcd->frameInfo.cornerHeight), pcd->frameInfo.cornerWidth, pcd->frameInfo.cornerHeight); XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_SOUTH], (int) pcd->frameInfo.cornerWidth, (int) (pcd->frameInfo.height - pcd->frameInfo.lowerBorderWidth), pcd->frameInfo.width - 2*pcd->frameInfo.cornerWidth, pcd->frameInfo.lowerBorderWidth); XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_SOUTH_WEST], 0, (int) (pcd->frameInfo.height - pcd->frameInfo.cornerHeight), pcd->frameInfo.cornerWidth, pcd->frameInfo.cornerHeight); XMoveResizeWindow (DISPLAY, pcd->clientStretchWin[STRETCH_WEST], 0, (int) pcd->frameInfo.cornerHeight, pcd->frameInfo.lowerBorderWidth, pcd->frameInfo.height - 2*pcd->frameInfo.cornerHeight); } /* recreate gadget rectangles */ ComputeGadgetRectangles (pcd); /* regenerate the graphics */ GenerateFrameDisplayLists (pcd); #ifndef NO_SHAPE if (wmGD.hasShape && pcd->wShaped) { SetFrameShape (pcd); } #endif /* NO_SHAPE */ } /* END OF FUNCTION RegenerateClientFrame */ /*************************************<->************************************* * * BevelSystemButton (prTop, prBot, x, y, width, height) * * * Description: * ----------- * Bevels a rectangle for the system button (drawer handle?) * * * Inputs: * ------ * prTop - ptr to top shadow rectangles * prBot - ptr to bottom shadow rectangles * x - x coord of maximize gadget * y - y coord of maximize gadget * width - width of maximize gadget * height - height of maximize gadget * * * Outputs: * ------- * * * Comments: * -------- * o This draws a horizontal "drawer handle" for the system gadget. * Assumptions: the enclosing box is square (width == height) *************************************<->***********************************/ void BevelSystemButton (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height) { int offset1, offset2; unsigned int dim1, dim2; switch (height) { case 5: case 6: offset1 = offset2 = 2; dim1 = dim2 = height-4; break; case 7: offset1 = offset2 = 2; dim1 = 3; dim2 = 2; break; case 8: case 9: offset1 = 2; offset2 = 3; dim1 = width - 4; dim2 = height - 6; break; case 10: case 11: offset1 = 3; offset2 = 4; dim1 = width - 6; dim2 = height - 8; break; case 12: case 13: offset1 = 3; offset2 = (height-3)/2; dim1 = width - 6; dim2 = 3; break; default: offset1 = 4; offset2 = (height - 4)/2; dim1 = width - 8; dim2 = 4; break; } if (height >= 5) { /* system icon */ BevelRectangle (prTop, prBot, /* system icon */ (x+offset1), (y+offset2), dim1, dim2, 1, 1, 1, 1); } } /* END OF FUNCTION BevelSystemButton */ /*************************************<->************************************* * * BevelMinimizeButton (prTop, prBot, x, y, height) * * * Description: * ----------- * Bevels a rectangle for the minimize button * * * Inputs: * ------ * prTop - ptr to top shadow rectangles * prBot - ptr to bottom shadow rectangles * x - x coord of maximize gadget * y - y coord of maximize gadget * height - height of maximize gadget * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void BevelMinimizeButton (RList *prTop, RList *prBot, int x, int y, unsigned int height) { int offset1, offset2; unsigned int dim1, dim2; switch (height) { case 7: case 8: case 9: offset1 = offset2 = 3; dim1 = dim2 = height-6; break; case 10: case 11: case 12: offset1 = offset2 = (height-3)/2; dim1 = dim2 = 3; break; default: offset1 = offset2 = (height-4)/2; dim1 = dim2 = 4; break; } if (height >= 7) { /* minimize icon */ BevelRectangle (prTop, prBot, (x+offset1), (y+offset2), dim1, dim2, 1, 1, 1, 1); } } /* END OF FUNCTION BevelMinimizeButton */ /*************************************<->************************************* * * BevelMaximizeButton (prTop, prBot, x, y, height) * * * Description: * ----------- * Bevels a rectangle for the maximize button * * * Inputs: * ------ * prTop - ptr to top shadow rectangles * prBot - ptr to bottom shadow rectangles * x - x coord of maximize gadget * y - y coord of maximize gadget * height - height of maximize gadget * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void BevelMaximizeButton (RList *prTop, RList *prBot, int x, int y, unsigned int height) { int offset1, offset2; unsigned int dim1, dim2; switch (height) { case 5: case 6: case 7: case 8: case 9: case 10: case 11: offset1 = offset2 = 2; dim1 = dim2 = height-4; break; case 12: case 13: case 14: case 15: offset1 = offset2 = 3; dim1 = dim2 = height-6; break; default: offset1 = offset2 = 4; dim1 = dim2 = height-8; break; } /* maximize icon */ BevelRectangle (prTop, prBot, (x+offset1), (y+offset2), dim1, dim2, 1, 1, 1, 1); } /* END OF FUNCTION BevelMaximizeButton */ /*************************************<->************************************* * * DepressGadget (pcd, gadget, depressed) * * * Description: * ----------- * Show the gadget in a "depressed" state * * * Inputs: * ------ * pcd - pointer to client data * gadget - gadget id * depressed - if True, then gadget is shown depressed, if False it is * shown not depressed * * * Outputs: * ------- * return - true if sucessful * * * Comments: * -------- * o This assumes there is a one-pixel bevel around the gadget. * o This only works on title bar gadgets. * *************************************<->***********************************/ Boolean DepressGadget (ClientData *pcd, int gadget, Boolean depressed) { int x, y; unsigned int width, height, invertWidth; static RList *pTopRect = NULL; static RList *pBotRect = NULL; GC topGC, botGC; Window win; /* get outside dimensions of box we want */ switch (gadget) { case FRAME_TITLE: case FRAME_SYSTEM: case FRAME_MINIMIZE: case FRAME_MAXIMIZE: if (!GetDepressInfo (pcd, gadget, &x, &y, &width, &height, &invertWidth)) return(FALSE); break; default: return(FALSE); /* do nothing on non-title bar gagdets */ } if (DECOUPLE_TITLE_APPEARANCE(pcd) && (pcd->decor & MWM_DECOR_TITLE)) { /* adjust position to be relative to titlebar window, not frame */ x -= (short) pcd->frameInfo.upperBorderWidth; y -= (short) pcd->frameInfo.upperBorderWidth; /* use "active" GCs if we have keyboard focus */ if (pcd == wmGD.keyboardFocus) { topGC = CLIENT_TITLE_APPEARANCE(pcd).activeTopShadowGC; botGC = CLIENT_TITLE_APPEARANCE(pcd).activeBottomShadowGC; } else { topGC = CLIENT_TITLE_APPEARANCE(pcd).inactiveTopShadowGC; botGC = CLIENT_TITLE_APPEARANCE(pcd).inactiveBottomShadowGC; } /* draw into title bar window */ win = pcd->clientTitleWin; } else { /* use "active" GCs if we have keyboard focus */ if (pcd == wmGD.keyboardFocus) { topGC = CLIENT_APPEARANCE(pcd).activeTopShadowGC; botGC = CLIENT_APPEARANCE(pcd).activeBottomShadowGC; } else { topGC = CLIENT_APPEARANCE(pcd).inactiveTopShadowGC; botGC = CLIENT_APPEARANCE(pcd).inactiveBottomShadowGC; } /* draw into client frame window */ win = pcd->clientFrameWin; } /* * Bevel a rectangle for the desired button effect * Allocate the rectangles if necessary. */ if ( (pTopRect && pBotRect) || ((pTopRect = AllocateRList(2)) && (pBotRect = AllocateRList(2)))) { pTopRect->used = 0; pBotRect->used = 0; BevelRectangle (pTopRect, pBotRect, x, y, width, height, invertWidth, invertWidth, invertWidth, invertWidth); } /* draw the gadget border to make it look depressed or normal */ if (depressed) { XFillRectangles (DISPLAY, win, botGC, pTopRect->prect, pTopRect->used); XFillRectangles (DISPLAY, win, topGC, pBotRect->prect, pBotRect->used); } else { XFillRectangles (DISPLAY, win, topGC, pTopRect->prect, pTopRect->used); XFillRectangles (DISPLAY, win, botGC, pBotRect->prect, pBotRect->used); } return(TRUE); } /* END OF FUNCTION DepressGadget */ /*************************************<->************************************* * * PushGadgetIn (pcd, gadget) * * * Description: * ----------- * Shows a title bar gadget in a depressed state * * * Inputs: * ------ * pcd - pointer to client data * gadget - gadget id * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void PushGadgetIn (ClientData *pcd, int gadget) { switch (gadget) { case FRAME_SYSTEM: pcd->decorFlags |= SYSTEM_DEPRESSED; break; case FRAME_TITLE: pcd->decorFlags |= TITLE_DEPRESSED; break; case FRAME_MINIMIZE: pcd->decorFlags |= MINIMIZE_DEPRESSED; break; case FRAME_MAXIMIZE: pcd->decorFlags |= MAXIMIZE_DEPRESSED; break; default: return; } GenerateFrameDisplayLists(pcd); (void) DepressGadget (pcd, gadget, TRUE); wmGD.gadgetClient = pcd; wmGD.gadgetDepressed = gadget; } /* END OF FUNCTION PushGadgetIn */ /*************************************<->************************************* * * PopGadgetOut (pcd, gadget) * * * Description: * ----------- * Shows a title bar gadget in a depressed state * * * Inputs: * ------ * pcd - pointer to client data * gadget - gadget id * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void PopGadgetOut (ClientData *pcd, int gadget) { switch (gadget) { case FRAME_SYSTEM: pcd->decorFlags &= ~SYSTEM_DEPRESSED; break; case FRAME_TITLE: pcd->decorFlags &= ~TITLE_DEPRESSED; break; case FRAME_MINIMIZE: pcd->decorFlags &= ~MINIMIZE_DEPRESSED; break; case FRAME_MAXIMIZE: pcd->decorFlags &= ~MAXIMIZE_DEPRESSED; break; default: return; } GenerateFrameDisplayLists(pcd); (void) DepressGadget (pcd, gadget, FALSE); wmGD.gadgetClient = NULL; wmGD.gadgetDepressed = 0; } /* END OF FUNCTION PopGadgetOut */ #ifndef NO_SHAPE /*************************************<->************************************* * * SetFrameShape (pcd) * * * Description: * ----------- * Shapes the frame and base window to the shape of the client * window. Also ors the title window into the shaped frame * window if present. * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * Comments: * -------- * o currently punt on resize handle around the frame. * *************************************<->***********************************/ void SetFrameShape (ClientData *pcd) { /* * The frame consists of the shape of the contents window offset by * title_height or'ed with the shape of title window (which is always * rectangular). */ int xOffset = 0; int yOffset = 0; if (XBorderIsShowing(pcd)) { xOffset = pcd->xBorderWidth; yOffset = pcd->xBorderWidth; } else if(pcd->matteWidth > 0) { xOffset = pcd->matteWidth; yOffset = pcd->matteWidth; } if (pcd->wShaped) { /* * need to do general case */ XShapeCombineShape (DISPLAY, pcd->clientBaseWin, ShapeBounding, xOffset, yOffset, pcd->client, ShapeBounding, ShapeSet); XShapeCombineShape (DISPLAY, pcd->clientFrameWin, ShapeBounding, BaseWindowX (pcd), BaseWindowY (pcd), pcd->clientBaseWin, ShapeBounding, ShapeSet); if (pcd->decor & MWM_DECOR_TITLE) { XShapeCombineShape (DISPLAY, pcd->clientFrameWin, ShapeBounding, pcd->frameInfo.upperBorderWidth, pcd->frameInfo.upperBorderWidth, pcd->clientTitleWin, ShapeBounding, ShapeUnion); } } else { (void) XShapeCombineMask (DISPLAY, pcd->clientFrameWin, ShapeBounding, 0, 0, None, ShapeSet); (void) XShapeCombineMask (DISPLAY, pcd->clientFrameWin, ShapeClip, 0, 0, None, ShapeSet); (void) XShapeCombineMask (DISPLAY, pcd->clientBaseWin, ShapeBounding, 0, 0, None, ShapeSet); (void) XShapeCombineMask (DISPLAY, pcd->clientBaseWin, ShapeClip, 0, 0, None, ShapeSet); } } /* END OF FUNCTION SetFrameShape */ #endif /* NO_SHAPE */ motif-2.3.8/clients/mwm/WmXSMP.h0000644000175000017500000000356013145162623013277 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _WmXSMP_h #define _WmXSMP_h #include #include "WmGlobal.h" /* Atoms used for session management capabilities. */ #define _XA_DT_SM_CLIENT_ID "SM_CLIENT_ID" #define _XA_DT_WMSAVE_HINT "_DT_WMSAVE_HINT" /* _DT_WMSAVE_HINT flag definitions */ #define WMSAVE_X (1L << 0) #define WMSAVE_Y (1L << 1) #define WMSAVE_WIDTH (1L << 2) #define WMSAVE_HEIGHT (1L << 3) #define WMSAVE_STATE (1L << 4) #ifdef WSM # define WMSAVE_WORKSPACES (1L << 5) #endif #define WMSAVE_ICON_X (1L << 6) #define WMSAVE_ICON_Y (1L << 7) extern void AddSMCallbacks(void); extern void ResignFromSM(void); extern void ExitWM(int exitCode); extern XrmDatabase LoadClientResourceDB(void); extern XrmDatabase SaveClientResourceDB(void); extern Boolean FindClientDBMatch(ClientData *, char **); extern Boolean GetSmClientIdClientList(ClientData ***, int *); extern void SortClientListByWorkspace(ClientData **, int); #ifdef WSM extern void LoadClientIconPositions(ClientData *); #endif #endif /* _WmXSMP_h */ motif-2.3.8/clients/mwm/WmCPlace.h0000644000175000017500000000261513145162623013637 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.2 */ extern void PlaceWindowInteractively (ClientData *pcd); extern void DoPlacement (ClientData *pcd); extern void SetupPlacement (ClientData *pcd); extern void HandlePlacementKeyEvent (ClientData *pcd, XKeyEvent *pev); extern void HandlePlacementButtonEvent (XButtonEvent *pev); extern void HandlePlacementMotionEvent (ClientData *pcd, XMotionEvent *pev); extern void StartInteractiveSizing (ClientData *pcd, Time time); extern Bool IsRepeatedKeyEvent (Display *dpy, XEvent *pEvent, char *pOldEvent); motif-2.3.8/clients/mwm/WmWinConf.c0000644000175000017500000030741713145162623014056 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.2 */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmWinConf.c /main/8 1996/10/30 11:15:17 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * Included Files: */ #include "WmGlobal.h" /* This should be the first include */ #include #define XK_MISCELLANY #include #define MOVE_OUTLINE_WIDTH 2 #define CONFIG_MASK (KeyPressMask|ButtonPressMask|\ ButtonReleaseMask|PointerMotionMask) #define PGRAB_MASK (ButtonPressMask|ButtonReleaseMask|\ PointerMotionMask|PointerMotionHintMask) /* grab types */ #define NotGrabbed 0 #define ResizeGrab 1 #define MoveGrab 2 #ifdef WSM /* Anchors */ #define ANCHOR_NONE 0 #define ANCHOR_NW 1 #define ANCHOR_NE 2 #define ANCHOR_SE 3 #define ANCHOR_SW 4 #ifndef ABS #define ABS(x) ((x)>0?(x):(-(x))) #endif /* ABS */ #endif /* WSM */ /* number of times to poll before blocking on a config event */ #define CONFIG_POLL_COUNT 300 /* mask for all buttons */ #define ButtonMask \ (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask) /* * include extern functions */ #include "WmWinConf.h" #include "WmCDInfo.h" #include "WmCDecor.h" #include "WmCPlace.h" #include "WmEvent.h" #include "WmFeedback.h" #include "WmFunction.h" #include "WmIDecor.h" #include "WmIPlace.h" #include "WmIconBox.h" #include "WmKeyFocus.h" #include "WmProtocol.h" #include "WmWinInfo.h" /* * Global Variables: * * These statics are set up at the initiation of a configuration * operation and used for succeeding events. */ static int pointerX = -1; static int pointerY = -1; static int offsetX = 0; static int offsetY = 0; static int resizeX, resizeY; /* root coords of UL corner of frame */ static unsigned int resizeWidth, resizeHeight; /* size of frame */ static unsigned int resizeBigWidthInc, resizeBigHeightInc; static int startX, startY; static unsigned int startWidth, startHeight; static unsigned int minWidth, minHeight, maxHeight, maxWidth; #ifdef WSM static int marqueeX, marqueeY; /* root coords of UL corner of are */ static long marqueeWidth, marqueeHeight; /* size of area */ static unsigned int marqueeAnchor; /* id of anchor corner */ static long marqueeWidth0, marqueeHeight0; /* old size of area */ #endif /* WSM */ static int opaqueMoveX = 0; /* for cancel request on opaque moves */ static int opaqueMoveY = 0; static int moveX = 0; /* root coords of UL corner of frame */ static int moveY = 0; static int moveIBbbX = 0; /* root coords of icon box bulletin board */ static int moveIBbbY = 0; static unsigned int moveWidth = 0; /* size of frame */ static unsigned int moveHeight = 0; static int moveLastPointerX = 0; /* last pointer position */ static int moveLastPointerY= 0; static Boolean anyMotion = FALSE; static Boolean configGrab = FALSE; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) static Boolean grabServer = TRUE; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ Dimension clipWidth = 0; Dimension clipHeight = 0; Position clipX = 0; Position clipY = 0; /*************************************<->************************************* * * GetClipDimensions (pcd, fromRoot) * * * Description: * ----------- * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * * Comments: * -------- *************************************<->***********************************/ void GetClipDimensions (ClientData *pCD, Boolean fromRoot) { int i; Arg getArgs[5]; Position tmpX, tmpY; i=0; XtSetArg (getArgs[i], XmNwidth, (XtArgVal) &clipWidth ); i++; XtSetArg (getArgs[i], XmNheight, (XtArgVal) &clipHeight ); i++; XtSetArg (getArgs[i], XmNx, (XtArgVal) &tmpX ); i++; XtSetArg (getArgs[i], XmNy, (XtArgVal) &tmpY ); i++; XtGetValues (P_ICON_BOX(pCD)->clipWidget, getArgs, i); if (fromRoot) { XtTranslateCoords(P_ICON_BOX(pCD)->scrolledWidget, tmpX, tmpY, &clipX, &clipY); } else { clipX = tmpX; clipY = tmpY; } } /* END OF FUNCTION GetClipDimensions */ /*************************************<->************************************* * * HandleClientFrameMove (pcd, pev) * * * Description: * ----------- * Provide visual feedback of interactive moving of the window. * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * * Outputs: * ------- * * * Comments: * -------- *************************************<->***********************************/ void HandleClientFrameMove (ClientData *pcd, XEvent *pev) { int tmpX, tmpY, warpX, warpY; Window grab_win; KeySym keysym; Boolean control, moveDone; Boolean firstTime; int big_inc, keyMultiplier; int newX, newY; XEvent event, KeyEvent; if (pev) { firstTime = True; } else { firstTime = False; } big_inc = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pcd)) / 20; /* * Do our grabs and initial setup if we're just starting out */ if (!configGrab) { if (!StartClientMove (pcd, pev)) { /* configuration was not initiated */ return; } } grab_win = GrabWin (pcd, pev); if (pcd->pSD->useIconBox && P_ICON_BOX(pcd)) { GetClipDimensions (pcd, True); } moveDone = False; while (!moveDone) { tmpX = tmpY = 0; if (firstTime) { /* handle the event we were called with first */ firstTime = False; } else { pev = &event; GetConfigEvent(DISPLAY, grab_win, CONFIG_MASK, moveLastPointerX, moveLastPointerY, moveX, moveY, moveWidth, moveHeight, &event); } if (pev->type == KeyPress) { keyMultiplier = 1; while (keyMultiplier <= big_inc && XCheckIfEvent (DISPLAY, &KeyEvent, IsRepeatedKeyEvent, (char *) pev)) { keyMultiplier++; } #ifdef FIX_1611 keysym = WmKeycodeToKeysym (DISPLAY, pev->xkey.keycode); #else keysym = XKeycodeToKeysym (DISPLAY, pev->xkey.keycode, 0); #endif control = (pev->xkey.state & ControlMask) != 0; tmpX = tmpY = 0; switch (keysym) { case XK_Left: tmpX = keyMultiplier * ((control) ? (-big_inc) : (-1)); break; case XK_Up: tmpY = keyMultiplier * ((control) ? (-big_inc) : (-1)); break; case XK_Right: tmpX = keyMultiplier * ((control) ? big_inc : 1); break; case XK_Down: tmpY = keyMultiplier * ((control) ? big_inc : 1); break; case XK_Return: CompleteFrameConfig (pcd, pev); return; case XK_Escape: CancelFrameConfig (pcd); CheckEatButtonRelease (pcd, pev); return; default: break; } if (tmpX || tmpY) { warpX = moveLastPointerX + tmpX; warpY = moveLastPointerY + tmpY; ForceOnScreen(SCREEN_FOR_CLIENT(pcd), &warpX, &warpY); if ((warpX != moveLastPointerX) || (warpY != moveLastPointerY)) { SetPointerPosition (warpX, warpY, &newX, &newY); tmpX = newX - moveLastPointerX; tmpY = newY - moveLastPointerY; moveLastPointerX = newX; moveLastPointerY = newY; moveX += tmpX; moveY += tmpY; } else { /* * make like motion event and move frame. */ moveX += tmpX; moveY += tmpY; } } } else if (pev->type == ButtonRelease) { /* * Update (x,y) to the location of the button release */ moveX += pev->xbutton.x_root - moveLastPointerX; moveY += pev->xbutton.y_root - moveLastPointerY; CompleteFrameConfig (pcd, pev); moveDone = True; } else if (pev->type == MotionNotify) { tmpX = pev->xmotion.x_root - moveLastPointerX; tmpY = pev->xmotion.y_root - moveLastPointerY; moveLastPointerX = pev->xmotion.x_root; moveLastPointerY = pev->xmotion.y_root; moveX += tmpX; moveY += tmpY; anyMotion = True; } /* draw outline if there is something to draw */ if (tmpX || tmpY) { FixFrameValues (pcd, &moveX, &moveY, &moveWidth, &moveHeight, FALSE /* no size checks */); if (pcd->pSD->moveOpaque) { MoveOpaque (pcd, moveX, moveY, moveWidth, moveHeight); } else { MoveOutline(moveX, moveY, moveWidth, moveHeight); } if ( !wmGD.movingIcon && (wmGD.showFeedback & WM_SHOW_FB_MOVE)) { DoFeedback (pcd, moveX, moveY, moveWidth, moveHeight, (unsigned long) 0, FALSE /* no size checks */); } } } } /* END OF FUNCTION HandleClientFrameMove */ /*************************************<->************************************* * * UpdateAndDrawResize () * * * Description: * ----------- * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * * Comments: * -------- *************************************<->***********************************/ void UpdateAndDrawResize (ClientData *pcd) { int tmpHeight, tmpWidth; /* * Handle a motion event or a keypress that's like a motion * event */ /* set height */ switch (wmGD.configPart) { case FRAME_RESIZE_NW: case FRAME_RESIZE_N: case FRAME_RESIZE_NE: tmpHeight = (int) startHeight + (startY - pointerY); if (tmpHeight < (int) minHeight) { resizeHeight = minHeight; resizeY = startY + startHeight - minHeight; } else if (pcd->pSD->limitResize && (tmpHeight > (int) maxHeight) && (!(pcd->clientFlags & ICON_BOX))) { resizeHeight = maxHeight; resizeY = startY + startHeight - maxHeight; } else { resizeHeight = (unsigned int) tmpHeight; resizeY = pointerY; } break; case FRAME_RESIZE_SW: case FRAME_RESIZE_S: case FRAME_RESIZE_SE: resizeY = startY; tmpHeight = pointerY - startY + 1; if (tmpHeight < (int) minHeight) { resizeHeight = minHeight; } else if (pcd->pSD->limitResize && (tmpHeight > (int) maxHeight) && (!(pcd->clientFlags & ICON_BOX))) { resizeHeight = maxHeight; } else { resizeHeight = (unsigned int) tmpHeight; } break; default: resizeY = startY; resizeHeight = startHeight; break; } /* set width */ switch (wmGD.configPart) { case FRAME_RESIZE_NW: case FRAME_RESIZE_W: case FRAME_RESIZE_SW: tmpWidth = (int) startWidth + (startX - pointerX); if (tmpWidth < (int) minWidth) { resizeWidth = minWidth; resizeX = startX + startWidth - minWidth; } else if (pcd->pSD->limitResize && (tmpWidth > (int) maxWidth) && (!(pcd->clientFlags & ICON_BOX))) { resizeWidth = maxWidth; resizeX = startX + startWidth - maxWidth; } else { resizeWidth = (unsigned int) tmpWidth; resizeX = pointerX; } break; case FRAME_RESIZE_NE: case FRAME_RESIZE_E: case FRAME_RESIZE_SE: resizeX = startX; tmpWidth = pointerX - startX + 1; if (tmpWidth < (int) minWidth) { resizeWidth = minWidth; } else if (pcd->pSD->limitResize && (tmpWidth > (int) maxWidth) && (!(pcd->clientFlags & ICON_BOX))) { resizeWidth = maxWidth; } else { resizeWidth = (unsigned int) tmpWidth; } break; default: resizeX = startX; resizeWidth = startWidth; break; } FixFrameValues (pcd, &resizeX, &resizeY, &resizeWidth, &resizeHeight, TRUE /* do size checks */); MoveOutline (resizeX, resizeY, resizeWidth, resizeHeight); if (wmGD.showFeedback & WM_SHOW_FB_RESIZE) { DoFeedback(pcd, resizeX, resizeY, resizeWidth, resizeHeight, (unsigned long) 0, TRUE /* do size checks */); } } /*************************************<->************************************* * * HandleClientFrameResize (pcd, pev) * * * Description: * ----------- * Provide visual feedback of interactive resizing of the window. * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * * Outputs: * ------- * * * Comments: * -------- * o The window sizes refer to the frame, not the client window. * *************************************<->***********************************/ void HandleClientFrameResize (ClientData *pcd, XEvent *pev) { Window grab_win; Boolean resizeDone; XEvent event; /* * Do our grabs the first time through */ if (!configGrab) { if (StartResizeConfig (pcd, pev)) { configGrab = TRUE; } else { /* resize could not be initiated */ return; } } grab_win = GrabWin (pcd, pev); resizeDone = False; while (!resizeDone) { if (!pev) /* first time through will already have event */ { pev = &event; GetConfigEvent(DISPLAY, grab_win, CONFIG_MASK, pointerX, pointerY, resizeX, resizeY, resizeWidth, resizeHeight, &event); } if (pev->type == MotionNotify) { pointerX = pev->xmotion.x_root; pointerY = pev->xmotion.y_root; anyMotion = TRUE; /* * Really start resizing once the pointer hits a resize area * (This only applies to accelerator and keyboard resizing!) */ if (!wmGD.configSet && !SetPointerResizePart (pcd, pev)) { pev = NULL; continue; /* ignore this event */ } } else if (pev->type == KeyPress) { /* * Handle key event. */ resizeDone = HandleResizeKeyPress (pcd, pev); } else if (pev->type == ButtonRelease) { /* * Update (x,y) to the location of the button release */ pointerX = pev->xbutton.x_root; pointerY = pev->xbutton.y_root; UpdateAndDrawResize(pcd); CompleteFrameConfig (pcd, pev); resizeDone = True; } else { pev = NULL; continue; /* ignore this event */ } if (!resizeDone) { UpdateAndDrawResize(pcd); } pev = NULL; /* reset event pointer */ } /* end while */ } /* END OF FUNCTION HandleClientFrameResize */ /*************************************<->************************************* * * HandleResizeKeyPress (pcd, pev) * * * Description: * ----------- * Handles keypress events during resize of window * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * * Outputs: * ------- * Return - True if this event completes (or cancels) resizing * * * Comments: * -------- * *************************************<->***********************************/ Boolean HandleResizeKeyPress (ClientData *pcd, XEvent *pev) { KeySym keysym; Boolean control; int warpX, warpY, currentX, currentY, newX, newY; int junk, keyMult; Window junk_win; XEvent KeyEvent; /* * Compress repeated keys */ keyMult = 1; while (keyMult <= 10 && XCheckIfEvent (DISPLAY, &KeyEvent, IsRepeatedKeyEvent, (char *) pev)) { keyMult++; } #ifdef FIX_1611 keysym = WmKeycodeToKeysym (DISPLAY, pev->xkey.keycode); #else keysym = XKeycodeToKeysym (DISPLAY, pev->xkey.keycode, 0); #endif control = (pev->xkey.state & ControlMask) != 0; switch (keysym) { case XK_Left: switch (wmGD.configPart) { case FRAME_NONE: wmGD.configPart = FRAME_RESIZE_W; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpY = resizeY + resizeHeight/2; warpX = resizeX + ((control) ? (-resizeBigWidthInc) : (-pcd->widthInc)); break; case FRAME_RESIZE_N: wmGD.configPart = FRAME_RESIZE_NW; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = resizeX + ((control) ? (-resizeBigWidthInc) : (-pcd->widthInc)); warpY = pointerY; break; case FRAME_RESIZE_S: wmGD.configPart = FRAME_RESIZE_SW; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = resizeX + ((control) ? (-resizeBigWidthInc) : (-pcd->widthInc)); warpY = pointerY; break; default: warpX = pointerX + ((control) ? (-resizeBigWidthInc * keyMult) : (-pcd->widthInc * keyMult)); warpY = pointerY; break; } break; case XK_Up: switch (wmGD.configPart) { case FRAME_NONE: wmGD.configPart = FRAME_RESIZE_N; warpX = resizeX + resizeWidth/2; warpY = resizeY + ((control) ? (-resizeBigHeightInc) : (-pcd->heightInc)); ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); break; case FRAME_RESIZE_W: wmGD.configPart = FRAME_RESIZE_NW; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = pointerX; warpY = resizeY + ((control) ? (-resizeBigHeightInc) : (-pcd->heightInc)); break; case FRAME_RESIZE_E: wmGD.configPart = FRAME_RESIZE_NE; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = pointerX; warpY = resizeY + ((control) ? (-resizeBigHeightInc) : (-pcd->heightInc)); break; default: warpX = pointerX; warpY = pointerY + ((control) ? (-resizeBigHeightInc * keyMult) : (-pcd->heightInc * keyMult)); break; } break; case XK_Right: switch (wmGD.configPart) { case FRAME_NONE: wmGD.configPart = FRAME_RESIZE_E; warpY = resizeY + resizeHeight/2; warpX = resizeX + resizeWidth - 1 + ((control) ? resizeBigWidthInc : pcd->widthInc); ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); break; case FRAME_RESIZE_N: wmGD.configPart = FRAME_RESIZE_NE; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = resizeX + resizeWidth - 1 + ((control) ? resizeBigWidthInc : pcd->widthInc); warpY = pointerY; break; case FRAME_RESIZE_S: wmGD.configPart = FRAME_RESIZE_SE; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = resizeX + resizeWidth - 1 + ((control) ? resizeBigWidthInc : pcd->widthInc); warpY = pointerY; break; default: warpX = pointerX + ((control) ? (resizeBigWidthInc * keyMult) : (pcd->widthInc * keyMult)); warpY = pointerY; break; } break; case XK_Down: switch (wmGD.configPart) { case FRAME_NONE: wmGD.configPart = FRAME_RESIZE_S; warpX = resizeX + resizeWidth/2; warpY = resizeY + resizeHeight - 1 + ((control) ? resizeBigHeightInc : pcd->heightInc); ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); break; case FRAME_RESIZE_E: wmGD.configPart = FRAME_RESIZE_SE; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = pointerX; warpY = resizeY + resizeHeight - 1 + ((control) ? resizeBigHeightInc : pcd->heightInc); break; case FRAME_RESIZE_W: wmGD.configPart = FRAME_RESIZE_SW; ReGrabPointer(pcd->clientFrameWin, pev->xkey.time); warpX = pointerX; warpY = resizeY + resizeHeight - 1 + ((control) ? resizeBigHeightInc : pcd->heightInc); break; default: warpX = pointerX; warpY = pointerY + ((control) ? (resizeBigHeightInc * keyMult) : (pcd->heightInc * keyMult)); break; } break; case XK_Return: CompleteFrameConfig (pcd, pev); return (True); case XK_Escape: CancelFrameConfig (pcd); CheckEatButtonRelease (pcd, pev); return (True); default: return (False); /* ignore this key */ } /* end switch(keysym) */ /* * Make sure the new pointer position is on screen before doing * the warp. Warp only if the pointer position changes. */ pointerX = warpX; pointerY = warpY; ForceOnScreen(SCREEN_FOR_CLIENT(pcd), &warpX, &warpY); /* * Don't query pointer if enable warp is off. */ if (!wmGD.enableWarp || XQueryPointer (DISPLAY, ROOT_FOR_CLIENT(pcd), &junk_win, &junk_win, ¤tX, ¤tY, &junk, &junk, (unsigned int *)&junk)) { if ( (warpX != currentX) || (warpY != currentY) ) { SetPointerPosition (warpX, warpY, &newX, &newY); return (False); } } return (False); } /* END OF FUNCTION HandleResizeKeyPress */ /*************************************<->************************************* * * DoFeedback (pcd, x, y, width, height, newStyle, resizing) * * * Description: * ----------- * Start or update feedback of size/position info * * * Inputs: * ------ * pcd - pointer to client data * x - * y - * width - * height - * newStyle - style flags. * resizing - check size constraints iff TRUE * * * Outputs: * ------- * * * Comments: * -------- * o If newStyle has FB_POSITION and/or FB_SIZE bits set, then it is * assumed that this is an initial call and a feedback window of the * desired style should be popped up. If newStyle is zero, then it * is assumed that the feedback window is already up and the values * passed in are updates. * *************************************<->***********************************/ void DoFeedback (ClientData *pcd, int x, int y, unsigned int width, unsigned int height, unsigned long newStyle, Boolean resizing) { int cx = x; int cy = y; unsigned int cwidth, cheight; /* compute client window coordinates from frame coordinates */ FrameToClient (pcd, &cx, &cy, &width, &height); /* use frame (not client) position if user wishes it */ if (wmGD.positionIsFrame) { cx = x; cy = y; } /* If resizing, make sure configuration is valid. */ if (resizing) { FixWindowConfiguration (pcd, &width, &height, (unsigned int) pcd->widthInc, (unsigned int) pcd->heightInc); } /* * Put size in client specific units. Do not include base into calculations * when increment is not specified (i.e. = 1). */ cwidth = (width - ((pcd->widthInc==1) ? 0 : pcd->baseWidth)) / pcd->widthInc; cheight = (height - ((pcd->heightInc==1) ? 0 : pcd->baseHeight)) / pcd->heightInc; if (newStyle) { ShowFeedbackWindow (pcd->pSD, cx, cy, cwidth, cheight, newStyle); } else { UpdateFeedbackInfo (pcd->pSD, cx, cy, cwidth, cheight); } } /* END OF FUNCTION DoFeedback */ /*************************************<->************************************* * * CheckVisualPlace * * * Description: * ----------- * Prevents icons in the icon box from being moved outside the clip window * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ Boolean CheckVisualPlace (ClientData *pCD, int tmpX, int tmpY) { Boolean rval = True; Window child; int newX; int newY; GetClipDimensions(pCD, True); /* * Get root coordinates of X and Y for icon. * We use root coordinates of clip window since clipX and * clipY are not 0, but the icon X and Y may be 0 in * local coordinates */ XTranslateCoordinates(DISPLAY, XtWindow(P_ICON_BOX(pCD)->bBoardWidget), ROOT_FOR_CLIENT(pCD), tmpX, tmpY, &newX, &newY, &child); if (newX < clipX) { return(False); } if (newY < clipY) { return(False); } if (((int)newX) > ((int)clipX + (int)clipWidth - ((int)ICON_WIDTH(pCD)))) { return(False); } if (((int)newY) > ((int)clipY + (int)clipHeight - ((int)ICON_HEIGHT(pCD)))) { return(False); } return (rval); } /* END OF FUNCTION CheckVisualPlace */ /*************************************<->************************************* * * CompleteFrameConfig (pcd, pev) * * * Description: * ----------- * Clean up graphic feedback when user stops configuring. * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * * Outputs: * ------- * * * Comments: * -------- * o This routine assumes that it is called in response to a button release * event. * *************************************<->***********************************/ void CompleteFrameConfig (ClientData *pcd, XEvent *pev) { unsigned int tmpWidth, tmpHeight; int tmpX, tmpY; Boolean inIconBox; if (wmGD.configAction == RESIZE_CLIENT) { /* release the grabs */ UndoGrabs(); /* * Honor the implied constrained anchor points on the window * so that the resize doesn't cause the window to move * unexpectedly. */ #ifndef CONFIG_RELATIVE_TO_CLIENT tmpX = resizeX; tmpY = resizeY; /* Use dummy x,y so we don't add frame offset to client location */ FrameToClient (pcd, &tmpX, &tmpY, &resizeWidth, &resizeHeight); #else FrameToClient (pcd, &resizeX, &resizeY, &resizeWidth, &resizeHeight); #endif tmpWidth = resizeWidth; tmpHeight = resizeHeight; FixWindowConfiguration (pcd, &tmpWidth, &tmpHeight, (unsigned int) pcd->widthInc, (unsigned int) pcd->heightInc); AdjustPos (&resizeX, &resizeY, resizeWidth, resizeHeight, tmpWidth, tmpHeight); /* reconfigure the window(s) */ ProcessNewConfiguration (pcd, resizeX, resizeY, resizeWidth, resizeHeight, FALSE); } else if (wmGD.configAction == MOVE_CLIENT) { /* release the grabs */ UndoGrabs(); /* make sure title bar is popped out */ if ((wmGD.configAction == MOVE_CLIENT) && (wmGD.gadgetClient == pcd) && (wmGD.gadgetDepressed == FRAME_TITLE)) { PopGadgetOut (pcd, FRAME_TITLE); FrameExposureProc(pcd); /* repaint frame */ } /* handle both icon and normal frames */ if (wmGD.movingIcon) { inIconBox = (pcd->pSD->useIconBox && P_ICON_BOX(pcd)); /* only need to move the icon */ if (wmGD.iconAutoPlace || inIconBox) { int centerX; int centerY; int place; IconPlacementData *pIPD; /* * Get correct icon placement data */ if (inIconBox) { pIPD = &P_ICON_BOX(pcd)->IPD; moveX -= moveIBbbX; moveY -= moveIBbbY; } else { pIPD = &(ACTIVE_WS->IPData); } /* * Check to make sure that there is an unoccupied place * where the icon is being moved to: */ centerX = moveX + ICON_WIDTH(pcd) / 2; centerY = moveY + ICON_HEIGHT(pcd) / 2; place = CvtIconPositionToPlace (pIPD, centerX, centerY); if (place != ICON_PLACE(pcd)) { if (pIPD->placeList[place].pCD) { /* * Primary place occupied, try to find an unoccupied * place in the proximity. */ place = FindIconPlace (pcd, pIPD, centerX, centerY); if (place == NO_ICON_PLACE) { /* * Can't find an unoccupied icon place. */ F_Beep (NULL, pcd, (XEvent *)NULL); if (pcd->pSD->moveOpaque && !inIconBox) { /* * Replace icon into same place - as if it * didn't move. */ XMoveWindow (DISPLAY, ICON_FRAME_WIN(pcd), ICON_X(pcd), ICON_Y(pcd)); if ((ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) && (wmGD.keyboardFocus == pcd)) { MoveActiveIconText(pcd); ShowActiveIconText(pcd); } } } } if ((place != NO_ICON_PLACE) && (place != ICON_PLACE(pcd))) { if (inIconBox) { CvtIconPlaceToPosition (pIPD, place, &tmpX, &tmpY); if( (CheckIconBoxSize (P_ICON_BOX(pcd))) && (CheckVisualPlace(pcd, tmpX, tmpY))) { /* * Move the icon to the new place. */ MoveIconInfo (pIPD, ICON_PLACE(pcd), place); CvtIconPlaceToPosition (pIPD, place, &ICON_X(pcd), &ICON_Y(pcd)); XtMoveWidget ( pIPD->placeList[ICON_PLACE(pcd)].theWidget, ICON_X(pcd), ICON_Y(pcd)); SetNewBounds (P_ICON_BOX(pcd)); if (ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) { MoveActiveIconText(pcd); } } else { F_Beep (NULL, pcd, (XEvent *)NULL); } } else { /* * Move the icon to the new place. */ MoveIconInfo (pIPD, ICON_PLACE(pcd), place); CvtIconPlaceToPosition (pIPD, place, &ICON_X(pcd), &ICON_Y(pcd)); XMoveWindow (DISPLAY, ICON_FRAME_WIN(pcd), ICON_X(pcd), ICON_Y(pcd)); if (pcd->pSD->moveOpaque && (ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) && (wmGD.keyboardFocus == pcd)) { MoveActiveIconText(pcd); ShowActiveIconText(pcd); } } } } else if (pcd->pSD->moveOpaque && !inIconBox) { /* * Replace icon into same place - as if it * didn't move. */ XMoveWindow (DISPLAY, ICON_FRAME_WIN(pcd), ICON_X(pcd), ICON_Y(pcd)); if ((ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) && (wmGD.keyboardFocus == pcd)) { MoveActiveIconText(pcd); ShowActiveIconText(pcd); } } } else { XMoveWindow (DISPLAY, ICON_FRAME_WIN(pcd), moveX, moveY); ICON_X(pcd) = moveX; ICON_Y(pcd) = moveY; } if ((ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) && (wmGD.keyboardFocus == pcd)) { MoveActiveIconText(pcd); } } else { /* assume normal window frame */ /* reconfigure the window(s) */ ProcessNewConfiguration (pcd, #ifndef CONFIG_RELATIVE_TO_CLIENT moveX, moveY, #else moveX + offsetX, moveY + offsetY, #endif (unsigned int) (moveWidth - 2*offsetX), (unsigned int) (moveHeight - offsetX - offsetY), FALSE); } } #ifdef WSM else if (wmGD.configAction == MARQUEE_SELECT) { WmScreenData *pSD; UndoGrabs(); pSD = pcd ? pcd->pSD : ACTIVE_PSD; dtSendMarqueeSelectionNotification(pSD, DT_MARQUEE_SELECT_END, marqueeX, marqueeY, marqueeWidth, marqueeHeight); } #endif /* WSM */ /* * Clear configuration flags and data. */ wmGD.configAction = NO_ACTION; wmGD.configPart = FRAME_NONE; wmGD.configSet = False; configGrab = FALSE; anyMotion = FALSE; wmGD.movingIcon = FALSE; #ifdef WSM if (pcd) { #endif /* WSM */ /* hide the move/resize config data */ HideFeedbackWindow(pcd->pSD); /* * Set the focus back to something reasonable */ RepairFocus (); #ifdef WSM } #endif /* WSM */ } /* END OF FUNCTION CompleteFrameConfig */ /*************************************<->************************************* * * MoveOpaque (pcd, x, y, width, height) * * * Description: * ----------- * Move a window or icon on the root or icon box. * * * Inputs: * ------ * pcd - client data pointer * x - x coordinate (on root) * y - y coordinate (on root) * width - pixel width of frame * height - pixel height of frame * * Outputs: * ------- * * * Comments: * -------- * o use MoveOutline() for icons in an icon box. * *************************************<->***********************************/ void MoveOpaque (ClientData *pcd, int x, int y, unsigned int width, unsigned int height) { /* Check if moving icon */ if (wmGD.movingIcon) { if (pcd->pSD->useIconBox && P_ICON_BOX(pcd)) { /* * For now just fall back to move outline when the * icon is in the icon box */ MoveOutline (x, y, width, height); } else { XMoveWindow (DISPLAY,ICON_FRAME_WIN(pcd) , x, y); } } else { /* This is a window */ XMoveWindow (DISPLAY, pcd->clientFrameWin, x, y); } /* cleanup exposed frame parts */ PullExposureEvents (); } /* END OF FUNCTION MoveOpaque */ /* thickness of outline */ #define OUTLINE_WIDTH 2 /* number of points to draw outline once */ #define SEGS_PER_DRAW (4*OUTLINE_WIDTH) /* number of points to flash outline (draw then erase) */ #define SEGS_PER_FLASH (2*SEGS_PER_DRAW) /*************************************<->************************************* * * DrawSegments (dpy, win, gc, outline, nsegs) * * Description: * ----------- * Draw segments using either using normal X or using the ALLPLANES * extension, depending on #ifdef ALLPLANES and whether the server actually * supports the extension. This is a thin wrapper around the Xlib * XDrawSegments() call. * * Inputs: * ------ * dpy - the X display * win - the window on which to draw * gc - the gc to use, typically whose function is GXxor * outline - array of segments * nsegs - number of segments in the outline array * * Outputs: * ------- * (none) * * Comments: * -------- * Note: no GC is used when drawing with the ALLPLANES extension; * therefore, the GC parameter is ignored in that case. * *************************************<->***********************************/ static void DrawSegments (Display *dpy, Window win, GC gc, XSegment *outline, int nsegs) { #if defined(sun) && defined(ALLPLANES) if (wmGD.allplanes) XAllPlanesDrawSegments(dpy, win, outline, nsegs); else #endif /* defined(sun) && defined(ALLPLANES) */ XDrawSegments(dpy, win, gc, outline, nsegs); } /* END OF FUNCTION DrawSegments */ /*************************************<->************************************* * * MoveOutline (x, y, width, height) * * * Description: * ----------- * Draw a window outline on the root window. * * * Inputs: * ------ * x - x coordinate (on root) * y - y coordinate (on root) * width - pixel width of frame * height - pixel height of frame * * Outputs: * ------- * * * Comments: * -------- * o get display, root window ID, and xorGC out of global data. * *************************************<->***********************************/ void MoveOutline (int x, int y, unsigned int width, unsigned int height) { if (wmGD.freezeOnConfig) { DrawOutline (x, y, width, height); } else { #ifdef WSM if (wmGD.useWindowOutline) WindowOutline(x,y,width,height); else #endif FlashOutline(x, y, width, height); } } /* END OF FUNCTION MoveOutline */ /*************************************<->************************************* * * FlashOutline () * * * Description: * ----------- * flash a window outline on the root window. * * * Inputs: * ------ * x - x coordinate (on root) * y - y coordinate (on root) * width - pixel width of frame * height - pixel height of frame * * Outputs: * ------- * * * Comments: * -------- * o get display, root window ID, and xorGC out of global data. * o draw on root and erase "atomically" * *************************************<->***********************************/ void FlashOutline (int x, int y, unsigned int width, unsigned int height) { static XSegment outline[SEGS_PER_FLASH]; /* * Do nothing if no box to draw */ if (x == 0 && y == 0 && width == 0 && height == 0) return; /* * Draw outline an even number of times (draw then erase) */ SetOutline (outline, x, y, width, height, OUTLINE_WIDTH); memcpy ( (char *) &outline[SEGS_PER_DRAW], (char *) &outline[0], SEGS_PER_DRAW*sizeof(XSegment)); /* * Flash the outline at least once, then as long as there's * nothing else going on */ DrawSegments(DISPLAY, ACTIVE_ROOT, ACTIVE_PSD->xorGC, outline, SEGS_PER_FLASH); XSync(DISPLAY, FALSE); while (!XtAppPending(wmGD.mwmAppContext)) { DrawSegments(DISPLAY, ACTIVE_ROOT, ACTIVE_PSD->xorGC, outline, SEGS_PER_FLASH); XSync(DISPLAY, FALSE); } } /* END OF FUNCTION FlashOutline */ #ifdef WSM /*************************************<->************************************* * * CreateOutlineWindows (pSD) * * * Description: * ----------- * create the outline windows * * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * variables are affected: * woN * woS * woE * woW * *************************************<->***********************************/ static void CreateOutlineWindows (WmScreenData *pSD) { XSetWindowAttributes xswa; unsigned int xswamask; int x, y, width, height; x = -10; y = -10; width = OUTLINE_WIDTH; height = OUTLINE_WIDTH; xswa.override_redirect = True; xswa.backing_store = NotUseful; xswa.save_under = True; xswa.background_pixmap = XmGetPixmap( XtScreen(pSD->screenTopLevelW), "50_foreground", pSD->clientAppearance.foreground, pSD->clientAppearance.background); xswamask = (CWOverrideRedirect | CWBackingStore | CWBackPixmap | CWSaveUnder); pSD->woN = XCreateWindow(DISPLAY, pSD->rootWindow, x, y, width, height, 0, XDefaultDepth(DISPLAY,pSD->screen), CopyFromParent, CopyFromParent, xswamask, &xswa); pSD->woS = XCreateWindow(DISPLAY, pSD->rootWindow, x, y, width, height, 0, XDefaultDepth(DISPLAY,pSD->screen), CopyFromParent, CopyFromParent, xswamask, &xswa); pSD->woE = XCreateWindow(DISPLAY, pSD->rootWindow, x, y, width, height, 0, XDefaultDepth(DISPLAY,pSD->screen), CopyFromParent, CopyFromParent, xswamask, &xswa); pSD->woW = XCreateWindow(DISPLAY, pSD->rootWindow, x, y, width, height, 0, XDefaultDepth(DISPLAY,pSD->screen), CopyFromParent, CopyFromParent, xswamask, &xswa); } /* END OF FUNCTION CreateOutlineWindows */ /*************************************<->************************************* * * WindowOutline () * * * Description: * ----------- * show an outline on the root window using windows. * * * Inputs: * ------ * x - x coordinate (on root) * y - y coordinate (on root) * width - pixel width of frame * height - pixel height of frame * * Outputs: * ------- * * * Comments: * -------- * Always unmap during move/resize of outline windows to let saveunder * stuff work. HP server's toss saveunder stuff for windows that * configure themselves while mapped. * *************************************<->***********************************/ void WindowOutline (int x, int y, unsigned int width, unsigned int height) { static int lastOutlineX = 0; static int lastOutlineY = 0; static int lastOutlineWidth = 0; static int lastOutlineHeight = 0; WmScreenData *pSD = ACTIVE_PSD; int iX, iY; int iW, iH; if (pSD->woN == (Window)0L) { CreateOutlineWindows(pSD); } if (x == lastOutlineX && y == lastOutlineY && width == lastOutlineWidth && height == lastOutlineHeight) { return; /* no change */ } XUnmapWindow(DISPLAY, pSD->woN); XUnmapWindow(DISPLAY, pSD->woS); XUnmapWindow(DISPLAY, pSD->woE); XUnmapWindow(DISPLAY, pSD->woW); if ((width == 0) && (height == 0)) { lastOutlineWidth = lastOutlineHeight = 0; lastOutlineX = lastOutlineY = 0; } else { /* North */ iX = x; iY = y; iW = (int) width; iH = OUTLINE_WIDTH; if (iW < 0) iW = 1; XMoveResizeWindow (DISPLAY, pSD->woN, iX, iY, iW, iH); /* West */ iX = x; iY = y + OUTLINE_WIDTH; iW = OUTLINE_WIDTH; iH = (int) height - OUTLINE_WIDTH; if (iH < 0) iH = 1; XMoveResizeWindow (DISPLAY, pSD->woW, iX, iY, iW, iH); /* East */ iX = x + (int)width - OUTLINE_WIDTH; iY = y + OUTLINE_WIDTH; iW = OUTLINE_WIDTH; iH = (int)height - OUTLINE_WIDTH; if (iH < 0) iH = 1; XMoveResizeWindow (DISPLAY, pSD->woE, iX, iY, iW, iH); /* South */ iX = x + OUTLINE_WIDTH; iY = y + (int)height - OUTLINE_WIDTH; iW = (int)width - 2*OUTLINE_WIDTH; iH = OUTLINE_WIDTH; if (iW < 0) iW = 1; XMoveResizeWindow (DISPLAY, pSD->woS, iX, iY, iW, iH); lastOutlineX = x; lastOutlineY = y; lastOutlineWidth = width; lastOutlineHeight = height; XMapRaised (DISPLAY, pSD->woN); XMapRaised (DISPLAY, pSD->woS); XMapRaised (DISPLAY, pSD->woE); XMapRaised (DISPLAY, pSD->woW); /* cleanup exposed frame parts */ PullExposureEvents (); } } /* END OF FUNCTION WindowOutline */ #endif /* WSM */ /*************************************<->************************************* * * DrawOutline (x, y, width, height) * * * Description: * ----------- * Draw a window outline on the root window. * * * Inputs: * ------ * x - x coordinate (on root) * y - y coordinate (on root) * width - pixel width of frame * height - pixel height of frame * * Outputs: * ------- * * * Comments: * -------- * o get display, root window ID, and xorGC out of global data. * *************************************<->***********************************/ void DrawOutline (int x, int y, unsigned int width, unsigned int height) { static int lastOutlineX = 0; static int lastOutlineY = 0; static int lastOutlineWidth = 0; static int lastOutlineHeight = 0; XSegment outline[SEGS_PER_DRAW]; if (x == lastOutlineX && y == lastOutlineY && width == lastOutlineWidth && height == lastOutlineHeight) { return; /* no change */ } if (lastOutlineWidth || lastOutlineHeight) { SetOutline (outline, lastOutlineX, lastOutlineY, lastOutlineWidth, lastOutlineHeight, OUTLINE_WIDTH); DrawSegments(DISPLAY, ACTIVE_ROOT, ACTIVE_PSD->xorGC, outline, SEGS_PER_DRAW); } lastOutlineX = x; lastOutlineY = y; lastOutlineWidth = width; lastOutlineHeight = height; if (lastOutlineWidth || lastOutlineHeight) { SetOutline (outline, lastOutlineX, lastOutlineY, lastOutlineWidth, lastOutlineHeight, OUTLINE_WIDTH); DrawSegments(DISPLAY, ACTIVE_ROOT, ACTIVE_PSD->xorGC, outline, SEGS_PER_DRAW); } } /* END OF FUNCTION DrawOutline */ /*************************************<->************************************* * * WindowIsOnScreen (pCD, dx, dy) * * * Description: * ----------- * This function is used to check if a window is atleast partially on the * screen or not. If the window is completely off the screen, dx and dy * will contain the minimum distance to move some part of the window's frame * back onto the screen. * * * Inputs: * ------ * pCD - pointer to client data * * * Outputs: * ------- * dx - minimum x distance to move the window back to the screen * dy - minimum y distance to move the window back to the screen * * * Returns: * -------- * true - if the window has some part on the screen * false - if the window is completely off the screen * * Comments: * -------- * *************************************<->***********************************/ Boolean WindowIsOnScreen (ClientData *pCD, int *dx, int *dy) { int x1 = pCD->clientX; int x2 = pCD->clientX + pCD->clientWidth; int y1 = pCD->clientY; int y2 = pCD->clientY + pCD->clientHeight; int screenW = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pCD)); int screenH = DisplayHeight(DISPLAY, SCREEN_FOR_CLIENT(pCD)); *dx = *dy = 0; if (x2 < 0) /* right frame border off left side of screen. */ *dx = -x2; else if (x1 > screenW) /* left frame border off right side of screen. */ *dx = screenW - x1; if (y2 < 0) /* bottom frame border off top of screen. */ *dy = -y2; else if (y1 > screenH) /* top frame border off bottom of screen. */ *dy = screenH - y1; return ((*dx == 0) && (*dy == 0)); } /*************************************<->************************************* * * ProcessNewConfiguration (pCD, x, y, width, height, clientRequest) * * * Description: * ----------- * This function is used to configure a client window following receipt of * a client request or an interactive configuration action. * * * Inputs: * ------ * pCD - pointer to client data * x - x coord of client window * y - y coord of client window * width - width of client window * height - height of client window * clientRequest - true if configuration requested by client program * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void ProcessNewConfiguration (ClientData *pCD, int x, int y, unsigned int width, unsigned int height, Boolean clientRequest) { unsigned int changedValues = 0; int xoff = 0, yoff = 0; int dx, dy; Boolean originallyOnScreen = WindowIsOnScreen(pCD, &dx, &dy); Boolean newMax = False; Boolean toNewMax = False; /* * Fix the configuration values to be compatible with the configuration * constraints for this class of windows. */ FixWindowConfiguration (pCD, &width, &height, (unsigned int) pCD->widthInc, (unsigned int) pCD->heightInc); if ((pCD->maxWidth != pCD->oldMaxWidth) || (pCD->maxHeight != pCD->oldMaxHeight)) { /* * We've got a new maximum size. */ newMax = True; } /* * If the configuration has changed, update client data * * Changes in width or height cause maximized windows to return to * normal state and update normal geometry (x, y, width, height) */ if (pCD->maxConfig) { if (newMax && (pCD->maxWidth == width) && (pCD->maxHeight == height)) { /* we're changing to the new max size */ toNewMax = True; } changedValues |= (width != pCD->oldMaxWidth) ? CWWidth : 0; changedValues |= (height != pCD->oldMaxHeight) ? CWHeight : 0; if (!toNewMax && (changedValues & CWWidth)) { /* * Hacked to update maxWidth for 'vertical' max clients */ if (IS_MAXIMIZE_VERTICAL(pCD)) { pCD->maxWidth = width; } pCD->clientWidth = width; if (changedValues & CWHeight) { /* * Hacked to update maxHeight for 'horizontal' max client */ if (IS_MAXIMIZE_HORIZONTAL(pCD)) { pCD->maxHeight = height; } pCD->clientHeight = height; } else { pCD->clientHeight = pCD->oldMaxHeight; } } else if (!toNewMax && (changedValues & CWHeight)) { /* * Hacked to update maxHeight for 'horizontal' max client */ if (IS_MAXIMIZE_HORIZONTAL(pCD)) { pCD->maxHeight = height; } pCD->clientHeight = height; pCD->clientWidth = pCD->oldMaxWidth; } } else { if (width != pCD->clientWidth) { /* * Hacked to update maxWidth for 'vertical' max clients */ if (IS_MAXIMIZE_VERTICAL(pCD)) { pCD->maxWidth = width; } changedValues |= CWWidth; pCD->clientWidth = width; } if (height != pCD->clientHeight) { /* * Hacked to update maxHeight for 'horizontal' max client */ if (IS_MAXIMIZE_HORIZONTAL(pCD)) { pCD->maxHeight = height; } changedValues |= CWHeight; pCD->clientHeight = height; } } #ifndef CONFIG_RELATIVE_TO_CLIENT /* * If positionIsFrame or user initiated configuration request, * then adjust client position to by frame_width and frame_height. */ if (wmGD.positionIsFrame || (!clientRequest)) { xoff = pCD->clientOffset.x; yoff = pCD->clientOffset.y; } #endif /* * Changes in position update maximum geometry on maximized windows * if there was no change in size. */ if (pCD->maxConfig) { if (x != pCD->maxX) { changedValues |= CWX; if (!toNewMax && (changedValues & (CWWidth | CWHeight))) pCD->clientX = x + xoff; else pCD->maxX = x + xoff; } else if (!toNewMax && (changedValues & (CWWidth | CWHeight))) { pCD->clientX = pCD->maxX; } if (y != pCD->maxY) { changedValues |= CWY; if (!toNewMax && (changedValues & (CWWidth | CWHeight))) pCD->clientY = y + yoff; else pCD->maxY = y + yoff; } else if (!toNewMax && (changedValues & (CWWidth | CWHeight))) { pCD->clientY = pCD->maxY; } } else { if (x + xoff != pCD->clientX) { changedValues |= CWX; pCD->clientX = x + xoff; } if (y + yoff != pCD->clientY) { changedValues |= CWY; pCD->clientY = y + yoff; } } /* check if the window has reconfigured itself off the screen. */ if (originallyOnScreen && !WindowIsOnScreen(pCD, &dx, &dy)) { if (dx != 0) { changedValues |= CWX; pCD->clientX += dx; } if (dy != 0) { changedValues |= CWY; pCD->clientY += dy; } } /* * Resize the client window if necessary: */ if (changedValues & (CWWidth | CWHeight)) { if (pCD->maxConfig) { if (!toNewMax) { /* maximized window resized, return to normal state */ pCD->maxConfig = FALSE; pCD->clientState = NORMAL_STATE; } } XResizeWindow (DISPLAY, pCD->client, width, height); RegenerateClientFrame(pCD); } if (changedValues & (CWX | CWY)) { if (pCD->maxConfig) { /* * Fix for 5217 - If the request is from the client, use the clients * offsets instead of the static offsets */ if (clientRequest) { XMoveWindow (DISPLAY, pCD->clientFrameWin, pCD->maxX - pCD->clientOffset.x, pCD->maxY - pCD->clientOffset.y); } else { XMoveWindow (DISPLAY, pCD->clientFrameWin, pCD->maxX - offsetX, pCD->maxY - offsetY); } /* End fix 5217 */ } else { if (clientRequest) { XMoveWindow (DISPLAY, pCD->clientFrameWin, pCD->clientX - pCD->clientOffset.x, pCD->clientY - pCD->clientOffset.y); } else { XMoveWindow (DISPLAY, pCD->clientFrameWin, pCD->clientX - offsetX, pCD->clientY - offsetY); } } SetFrameInfo (pCD); #ifdef PANELIST if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) { /* turn off subpanel behavior if moved */ pCD->dtwmBehaviors &= ~DtWM_BEHAVIOR_SUBPANEL; } #endif /* PANELIST */ } /* * Send a configure notify message if appropriate: * 1. rejected client configuration request. * 2. client request and move without resize */ if ((!changedValues && clientRequest) || (changedValues && !(changedValues & (CWWidth | CWHeight)))) { SendConfigureNotify (pCD); } /* * Try to send notice directly to icon box that the window * has changed size */ if ((pCD->clientFlags & ICON_BOX) && (changedValues & (CWWidth | CWHeight))) { CheckIconBoxResize(pCD, changedValues, width, height); } } /* END OF FUNCTION ProcessNewConfiguration */ /*************************************<->************************************* * * StartResizeConfig (pcd, pev) * * * Description: * ----------- * Start resize of client window * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * Outputs: * ------- * return - true if configuration can begin, else false * * * Comments: * -------- * *************************************<->***********************************/ Boolean StartResizeConfig (ClientData *pcd, XEvent *pev) { Window grab_win, junk_win; Boolean grabbed; int big_inc, tmp_inc; int junk, junkX, junkY; /* * Do our grabs */ if (!configGrab) { grab_win = GrabWin (pcd, pev); if (pev) { grabbed = DoGrabs (grab_win, ConfigCursor((int) wmGD.configPart), PGRAB_MASK, pev->xbutton.time, pcd, True); } else { grabbed = DoGrabs (grab_win, ConfigCursor((int) wmGD.configPart), PGRAB_MASK, CurrentTime, pcd, True); } if (!grabbed) { return (False); } configGrab = TRUE; } else { /* continue with the configuration in progress (!!!) */ return (True); } /* * Set up static variables for succeeding events */ if (!XQueryPointer (DISPLAY, ROOT_FOR_CLIENT(pcd), &junk_win, &junk_win, &pointerX, &pointerY, &junk, &junk, (unsigned int *)&junk)) { CancelFrameConfig (pcd); /* release grabs */ return (False); }; wmGD.preMoveX = pointerX; wmGD.preMoveY = pointerY; anyMotion = FALSE; offsetX = pcd->clientOffset.x; offsetY = pcd->clientOffset.y; /* * get window geometry information and convert to frame coordinates */ if (pcd->maxConfig) { resizeX = pcd->maxX; resizeY = pcd->maxY; resizeWidth = pcd->maxWidth; resizeHeight = pcd->maxHeight; } else { resizeX = pcd->clientX; resizeY = pcd->clientY; resizeWidth = pcd->clientWidth; resizeHeight = pcd->clientHeight; } ClientToFrame(pcd, &resizeX, &resizeY, &resizeWidth, &resizeHeight); /* save start values to see where we came from */ startX = resizeX; startY = resizeY; startWidth = resizeWidth; startHeight = resizeHeight; /* get min and max frame sizes */ minWidth = pcd->minWidth; minHeight = pcd->minHeight; junkX = junkY = 0; ClientToFrame(pcd, &junkX, &junkY, &minWidth, &minHeight); /* * Hack to use maxHeightLimit and maxWidthLimit as the real max when * maximumClientSize is set to 'horizontal' or 'vertical', since * pCD->maxHeight and pCD->maxWidth is fiddle to on reconfiguration. */ maxWidth = pcd->maxWidthLimit; maxHeight = pcd->maxHeightLimit; junkX = junkY = 0; ClientToFrame(pcd, &junkX, &junkY, &maxWidth, &maxHeight); /* compute big increment values */ big_inc = DisplayWidth (DISPLAY, SCREEN_FOR_CLIENT(pcd)) / 20; tmp_inc = big_inc - big_inc%pcd->widthInc; if (tmp_inc > 5*pcd->widthInc) resizeBigWidthInc = tmp_inc; else resizeBigWidthInc = 5*pcd->widthInc; tmp_inc = big_inc - big_inc%pcd->heightInc; if (tmp_inc > 5*pcd->heightInc) resizeBigHeightInc = tmp_inc; else resizeBigHeightInc = 5*pcd->heightInc; /* pop up feedback window */ if (wmGD.showFeedback & WM_SHOW_FB_RESIZE) { DoFeedback (pcd, resizeX, resizeY, resizeWidth, resizeHeight, FB_SIZE, TRUE /* do size checks */); } /* set configuring data */ wmGD.configAction = RESIZE_CLIENT; wmGD.configButton = pev ? pev->xbutton.button: 0; return (True); } /* END OF FUNCTION StartResizeConfig */ /*************************************<->************************************* * * StartClientResize (pcd, pev) * * * Description: * ----------- * Start resize of client window as invoked from menu * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * Outputs: * ------- * * * Comments: * -------- * o This should only be called as the result of a Resize function * being selected from the system menu. * *************************************<->***********************************/ void StartClientResize (ClientData *pcd, XEvent *pev) { /* do initial setup for resize */ wmGD.configPart = FRAME_NONE; /* determined by later action */ wmGD.configSet = False; /* don't know what it is yet */ if (!StartResizeConfig (pcd, pev)) { /* resize could not be initiated */ return; } /* * Warp pointer to middle of window if started from the keyboard * or menu (no event). */ if ( !pev || pev->type == KeyPress ) { pointerX = resizeX + resizeWidth/2; pointerY = resizeY + resizeHeight/2; ForceOnScreen(SCREEN_FOR_CLIENT(pcd), &pointerX, &pointerY); if (wmGD.enableWarp) { XWarpPointer(DISPLAY, None, ROOT_FOR_CLIENT(pcd), 0, 0, 0, 0, pointerX, pointerY); } } } /* END OF FUNCTION StartClientResize */ /*************************************<->************************************* * * StartClientMove (pcd, pev) * * * Description: * ----------- * Handle move of client window as invoked from menu * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * Outputs: * ------- * Return - True if configuration was initiated, else False * * * Comments: * -------- * o This should only be called as the result of a Move function * being selected from the system menu. * *************************************<->***********************************/ Boolean StartClientMove (ClientData *pcd, XEvent *pev) { Window grab_win, junk_win; Boolean grabbed; int junk; Window child; /* * Do our grabs if we're just starting out */ if (!configGrab) { grab_win = GrabWin (pcd, pev); if (grab_win == ICON_FRAME_WIN(pcd)) { wmGD.movingIcon = True; } if (pev) { grabbed = DoGrabs (grab_win, wmGD.configCursor, PGRAB_MASK, pev->xbutton.time, pcd, False); } else { grabbed = DoGrabs (grab_win, wmGD.configCursor, PGRAB_MASK, CurrentTime, pcd, False); } if (!grabbed) { wmGD.movingIcon = False; return (False); } configGrab = TRUE; } /* * Set up static variables for succeeding events if we're not * entering with a motion event. If we are, we assume that the * preMove variables have been setup. */ if (pev && ((pev->type == ButtonPress) || (pev->type == ButtonRelease))) { wmGD.preMoveX = pev->xbutton.x_root; wmGD.preMoveY = pev->xbutton.y_root; } else if ((pev && (pev->type != MotionNotify)) || !pev) { if (!XQueryPointer (DISPLAY, ROOT_FOR_CLIENT(pcd), &junk_win, &junk_win, &(wmGD.preMoveX), &(wmGD.preMoveY), &junk, &junk, (unsigned int *)&junk)) { CancelFrameConfig (pcd); return (False); } } offsetX = pcd->clientOffset.x; offsetY = pcd->clientOffset.y; anyMotion = FALSE; moveLastPointerX = wmGD.preMoveX; moveLastPointerY = wmGD.preMoveY; /* get frame window geometry */ if (wmGD.movingIcon) { moveWidth = ICON_WIDTH(pcd); moveHeight = ICON_HEIGHT(pcd); moveX = ICON_X(pcd); moveY = ICON_Y(pcd); if (pcd->pSD->useIconBox && P_ICON_BOX(pcd)) { /* get root coords of icon box bulletin board */ XTranslateCoordinates(DISPLAY, XtWindow(P_ICON_BOX(pcd)->bBoardWidget), ROOT_FOR_CLIENT(pcd), 0, 0, &moveIBbbX, &moveIBbbY, &child); moveX += moveIBbbX; moveY += moveIBbbY; } else if (pcd->pSD->moveOpaque && (ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART) && (wmGD.keyboardFocus == pcd)) { HideActiveIconText ((WmScreenData *)NULL); } } else { if (pcd->maxConfig) { /* maximized */ moveWidth = pcd->maxWidth; moveHeight = pcd->maxHeight; moveX = pcd->maxX; moveY = pcd->maxY; } else { /* normal */ moveWidth = pcd->clientWidth; moveHeight = pcd->clientHeight; moveX = pcd->clientX; moveY = pcd->clientY; } ClientToFrame (pcd, &moveX, &moveY, &moveWidth, &moveHeight); } if (pcd->pSD->moveOpaque) { opaqueMoveX = moveX; opaqueMoveY = moveY; } /* * Warp pointer to middle of window if started from the menu (no event). */ if ( !pev || pev->type == KeyPress ) { moveLastPointerX = moveX + moveWidth/2; moveLastPointerY = moveY + moveHeight/2; ForceOnScreen (SCREEN_FOR_CLIENT(pcd), &moveLastPointerX, &moveLastPointerY); if (wmGD.enableWarp) { XWarpPointer(DISPLAY, None, ROOT_FOR_CLIENT(pcd), 0, 0, 0, 0, moveLastPointerX, moveLastPointerY); } } /* pop up feedback window */ if ( !wmGD.movingIcon && (wmGD.showFeedback & WM_SHOW_FB_MOVE)) { DoFeedback (pcd, moveX, moveY, moveWidth, moveHeight, FB_POSITION, FALSE /* no size checks */); } /* set configuring data */ wmGD.configAction = MOVE_CLIENT; if (pev && pev->type != KeyPress) wmGD.configButton = pev->xbutton.button; else wmGD.configButton = 0; return (True); } /* END OF FUNCTION StartClientMove */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * SetGrabServer () * * * Description: * ----------- * Sets Boolean grabServer to False * * Inputs: * ------ * None * * Outputs: * ------- * None * * Comments * ------- * This will only get called when an automated test is running. The * purpose of this is to prevent mwm from grbbing the server, since * this confuses the automation input synthesis code * *************************************<->***********************************/ void SetGrabServer (void) { grabServer = FALSE; } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * DoGrabs (grab_win, cursor, pmask, grabTime, alwaysGrab) * * * Description: * ----------- * Do the grabs for window configuration * * * Inputs: * ------ * grab_win - window to grab on * cursor - cursor shape to attach to the pointer * pmask - * grabTime - time stamp * alwaysGrab - * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ Boolean DoGrabs (Window grab_win, Cursor cursor, unsigned int pmask, Time grabTime, ClientData *pCD, Boolean alwaysGrab) { #ifdef WSM Window root; if (pCD) root = ROOT_FOR_CLIENT(pCD); else root = RootWindow (DISPLAY, ACTIVE_PSD->screen); if (pCD && pCD->pSD->useIconBox && wmGD.movingIcon && P_ICON_BOX(pCD)) #else if (pCD->pSD->useIconBox && wmGD.movingIcon && P_ICON_BOX(pCD)) #endif { /* * Confine the pointer to the icon box clip window */ if (XGrabPointer(DISPLAY, grab_win, FALSE, /* owner_events */ pmask, GrabModeAsync, /* pointer_mode */ GrabModeAsync, /* keyboard_mode */ /* confine_to window */ XtWindow(P_ICON_BOX(pCD)->clipWidget), cursor, grabTime) != GrabSuccess) { return(FALSE); } } else { /* * Just confine the pointer to the root window */ if (XGrabPointer(DISPLAY, grab_win, FALSE, /* owner_events */ pmask, GrabModeAsync, /* pointer_mode */ GrabModeAsync, /* keyboard_mode */ #ifdef WSM root, #else ROOT_FOR_CLIENT(pCD), /* confine_to window */ #endif cursor, grabTime) != GrabSuccess) { return(FALSE); } } /* * Don't grab keyboard away from menu widget to prevent * hosing of traversal. */ if (!wmGD.menuActive) { if ((XGrabKeyboard(DISPLAY, grab_win, FALSE, /* owner_events */ GrabModeAsync, /* pointer_mode */ GrabModeAsync, /* keyboard_mode */ grabTime)) != GrabSuccess) { XUngrabPointer (DISPLAY, CurrentTime); return(FALSE); } } /* * If running automation version of mwm, do not grab the server, since * this will confuse the automation input synthesis code. */ # if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) if (grabServer == TRUE) # endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ if (wmGD.freezeOnConfig) { #ifdef WSM if (!pCD || ((pCD->pSD->moveOpaque && alwaysGrab) || (!(pCD->pSD->moveOpaque)))) #else /* WSM */ if ((pCD->pSD->moveOpaque && alwaysGrab) || (!(pCD->pSD->moveOpaque))) #endif /* WSM */ { XGrabServer(DISPLAY); } } return(TRUE); } /* END OF FUNCTION DoGrabs */ /*************************************<->************************************* * * UndoGrabs () * * * Description: * ----------- * Release the grabs * * * Inputs: * ------ * * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void UndoGrabs (void) { /* erase outline */ MoveOutline(0, 0, 0, 0); XSync (DISPLAY, FALSE /*don't discard events*/); /* give up grabs */ if (wmGD.freezeOnConfig) { XUngrabServer(DISPLAY); } /* * Don't Ungrab keyboard away from menu widget to prevent * hosing of traversal. */ if (!wmGD.menuActive) XUngrabKeyboard (DISPLAY,CurrentTime); XUngrabPointer (DISPLAY, CurrentTime); /* event time NOT used */ XFlush (DISPLAY); } /* END OF FUNCTION UndoGrabs */ /*************************************<->************************************* * * CancelFrameConfig (pcd) * * * Description: * ----------- * Cance a frame configuration (move/resize) operation. * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void CancelFrameConfig (ClientData *pcd) { /* remove keyboard, pointer, and server grabs */ UndoGrabs(); /* turn off feedback window */ #ifdef WSM if (pcd) { #endif /* WSM */ HideFeedbackWindow(pcd->pSD); /* make sure title bar is popped out */ if ((wmGD.configAction == MOVE_CLIENT) && (wmGD.gadgetClient == pcd) && (wmGD.gadgetDepressed == FRAME_TITLE)) { PopGadgetOut (pcd, FRAME_TITLE); FrameExposureProc(pcd); /* repaint frame */ } if ((pcd->pSD->moveOpaque) && (wmGD.configAction == MOVE_CLIENT)) { if ((pcd->clientState == MINIMIZED_STATE) && (!(pcd->pSD->useIconBox && P_ICON_BOX(pcd)))) { /* * Replace icon into pre-move position */ XMoveWindow (DISPLAY, ICON_FRAME_WIN(pcd), ICON_X(pcd), ICON_Y(pcd)); if ((ICON_DECORATION(pcd) & ICON_ACTIVE_LABEL_PART)) { ShowActiveIconText(pcd); } } else if (! wmGD.movingIcon) /* we are not moving in the iconbox */ { XMoveWindow (DISPLAY, pcd->clientFrameWin, opaqueMoveX, opaqueMoveY); } } #ifdef WSM } if (wmGD.configAction == MARQUEE_SELECT) { dtSendMarqueeSelectionNotification(ACTIVE_PSD, DT_MARQUEE_SELECT_CANCEL, marqueeX, marqueeY, 0, 0); } #endif /* WSM */ /* replace pointer if no motion events received */ #ifdef WSM if (pcd) #endif /* WSM */ if (!anyMotion && wmGD.enableWarp) { XWarpPointer(DISPLAY, None, ROOT_FOR_CLIENT(pcd), 0, 0, 0, 0, wmGD.preMoveX, wmGD.preMoveY); } anyMotion = FALSE; /* Clear configuration flags and data */ wmGD.configAction = NO_ACTION; wmGD.configPart = FRAME_NONE; wmGD.configSet = False; configGrab = FALSE; wmGD.movingIcon = FALSE; /* set the focus back to a reasonable window */ RepairFocus (); } /* END OF FUNCTION CancelFrameConfig */ /*************************************<->************************************* * * CheckEatButtonRelease (pcd, pev) * * * Description: * ----------- * Set up to eat button releases if buttons are down. * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to key event that caused cancel * * Outputs: * ------- * none * * * Comments: * -------- * *************************************<->***********************************/ void CheckEatButtonRelease (ClientData *pcd, XEvent *pev) { Window grab_win; #ifdef WSM Window root; if (pcd != (ClientData *)NULL) root = ROOT_FOR_CLIENT(pcd); else root = RootWindow (DISPLAY, ACTIVE_PSD->screen); #endif /* WSM */ #ifdef WSM if (pcd == (ClientData *) NULL) grab_win = root; else #endif /* WSM */ grab_win = GrabWin(pcd, pev); if ((pev->type == KeyPress || pev->type == KeyRelease) && (pev->xbutton.state & ButtonMask)) { /* * Some buttons are down... * Set up conditions to wait for these buttons to go up. */ if (XGrabPointer(DISPLAY, grab_win, False, /* owner_events */ ButtonReleaseMask, GrabModeAsync, /* pointer_mode */ GrabModeAsync, /* keyboard_mode */ #ifdef WSM root, /* confine_to window */ #else /* WSM */ ROOT_FOR_CLIENT(pcd), /* confine_to window */ #endif /* WSM */ wmGD.configCursor, pev->xbutton.time) == GrabSuccess) { EatButtonRelease (pev->xbutton.state & ButtonMask); } } } /*************************************<->************************************* * * EatButtonRelease (releaseButtons) * * * Description: * ----------- * Eat up button release events * * * Inputs: * ------ * releaseButtons = button mask of button releases to eat * * Outputs: * ------- * none * * * Comments: * -------- * *************************************<->***********************************/ void EatButtonRelease (unsigned int releaseButtons) { unsigned int new_state; XEvent event; while (releaseButtons) { #ifdef WSM PullExposureEvents (); #endif /* WSM */ XMaskEvent (DISPLAY, ButtonReleaseMask, &event); if (event.type == ButtonRelease) { /* look at the state after this button is released */ new_state = event.xbutton.state & ~ButtonStateBit(event.xbutton.button); if (!(new_state & releaseButtons)) { /* all the buttons we were waiting for have been * released. */ XUngrabPointer (DISPLAY, event.xbutton.time); releaseButtons = 0; } } } } /*************************************<->************************************* * * ButtonStateBit (button) * * * Description: * ----------- * Converts a button number to a button state bit * * * Inputs: * ------ * button = button number (Button1, Button2, etc.) * * Outputs: * ------- * Return = bit used in xbutton state field * (Button1Mask, Button2Mask,...) * * * Comments: * -------- * * *************************************<->***********************************/ unsigned int ButtonStateBit (unsigned int button) { #define MAX_BUTTON 5 typedef struct { unsigned int button; unsigned int maskbit; } ButtonAssoc; static ButtonAssoc bmap[MAX_BUTTON] = { {Button1, Button1Mask}, {Button2, Button2Mask}, {Button3, Button3Mask}, {Button4, Button4Mask}, {Button5, Button5Mask}, }; int i; unsigned int rval = 0; for (i = 0; i < MAX_BUTTON; i++) { if (bmap[i].button == button) { rval = bmap[i].maskbit; break; } } return (rval); } /*************************************<->************************************* * * ConfigCursor (frame_part) * * * Description: * ----------- * return the config cursor that goes with the config part specified * * * Inputs: * ------ * frame_part - frame part id * * Outputs: * ------- * return - cursor to use * * * Comments: * -------- * *************************************<->***********************************/ Cursor ConfigCursor (int frame_part) { Cursor cursor; switch (frame_part) { case FRAME_RESIZE_NW: cursor = wmGD.stretchCursors[STRETCH_NORTH_WEST]; break; case FRAME_RESIZE_N: cursor = wmGD.stretchCursors[STRETCH_NORTH]; break; case FRAME_RESIZE_NE: cursor = wmGD.stretchCursors[STRETCH_NORTH_EAST]; break; case FRAME_RESIZE_E: cursor = wmGD.stretchCursors[STRETCH_EAST]; break; case FRAME_RESIZE_SE: cursor = wmGD.stretchCursors[STRETCH_SOUTH_EAST]; break; case FRAME_RESIZE_S: cursor = wmGD.stretchCursors[STRETCH_SOUTH]; break; case FRAME_RESIZE_SW: cursor = wmGD.stretchCursors[STRETCH_SOUTH_WEST]; break; case FRAME_RESIZE_W: cursor = wmGD.stretchCursors[STRETCH_WEST]; break; default: cursor = wmGD.configCursor; } return(cursor); } /* END OF FUNCTION ConfigCursor */ /*************************************<->************************************* * * ReGrabPointer (grab_win, grabTime) * * * Description: * ----------- * Grab the pointer again to change the cursor * * * Inputs: * ------ * grab_win - * grabTime - time stamp * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void ReGrabPointer (Window grab_win, Time grabTime) { XGrabPointer(DISPLAY, grab_win, FALSE, /* owner_events */ PGRAB_MASK, GrabModeAsync, /* pointer_mode */ GrabModeAsync, /* keyboard_mode */ ACTIVE_ROOT, /* confine_to window */ ConfigCursor((int)wmGD.configPart), grabTime); } /* END OF FUNCTION ReGrabPointer */ /*************************************<->************************************* * * SetPointerResizePart (pcd, pev) * * * Description: * ----------- * Sets the global configuration part for resize based on the current * configuration part and the location of the event * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * * Outputs: * ------- * Return - TRUE if wmGD.configPart is a valid resize part * * * Comments: * -------- * o Assumes the static data for resizing has been set up. *************************************<->***********************************/ Boolean SetPointerResizePart (ClientData *pcd, XEvent *pev) { int newPart; Time grabTime; newPart = ResizeType(pcd, pev); /* get part id for this event */ grabTime = (pev) ? pev->xmotion.time : CurrentTime; switch (wmGD.configPart) { case FRAME_NONE: if (newPart == FRAME_NONE) return(FALSE); /* still not valid */ wmGD.configPart = newPart; ReGrabPointer(pcd->clientFrameWin, grabTime); return(TRUE); case FRAME_RESIZE_N: switch (newPart) { case FRAME_RESIZE_W: case FRAME_RESIZE_NW: wmGD.configPart = FRAME_RESIZE_NW; ReGrabPointer(pcd->clientFrameWin, grabTime); break; case FRAME_RESIZE_E: case FRAME_RESIZE_NE: wmGD.configPart = FRAME_RESIZE_NE; ReGrabPointer(pcd->clientFrameWin, grabTime); break; default: break; } break; case FRAME_RESIZE_E: switch (newPart) { case FRAME_RESIZE_N: case FRAME_RESIZE_NE: wmGD.configPart = FRAME_RESIZE_NE; ReGrabPointer(pcd->clientFrameWin, grabTime); break; case FRAME_RESIZE_S: case FRAME_RESIZE_SE: wmGD.configPart = FRAME_RESIZE_SE; ReGrabPointer(pcd->clientFrameWin, grabTime); break; default: break; } break; case FRAME_RESIZE_S: switch (newPart) { case FRAME_RESIZE_E: case FRAME_RESIZE_SE: wmGD.configPart = FRAME_RESIZE_SE; ReGrabPointer(pcd->clientFrameWin, grabTime); break; case FRAME_RESIZE_W: case FRAME_RESIZE_SW: wmGD.configPart = FRAME_RESIZE_SW; ReGrabPointer(pcd->clientFrameWin, grabTime); break; default: break; } break; case FRAME_RESIZE_W: switch (newPart) { case FRAME_RESIZE_N: case FRAME_RESIZE_NW: wmGD.configPart = FRAME_RESIZE_NW; ReGrabPointer(pcd->clientFrameWin, grabTime); break; case FRAME_RESIZE_S: case FRAME_RESIZE_SW: wmGD.configPart = FRAME_RESIZE_SW; ReGrabPointer(pcd->clientFrameWin, grabTime); break; default: break; } break; case FRAME_RESIZE_NW: case FRAME_RESIZE_NE: case FRAME_RESIZE_SW: case FRAME_RESIZE_SE: break; default: return(FALSE); /* not a valid resize part */ } return(TRUE); } /* END OF FUNCTION SetPointerResizePart */ /*************************************<->************************************* * * ResizeType (pcd, pev) * * * Description: * ----------- * Returns a resize part ID for an event outside of the current * resize area. * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to event * * * Outputs: * ------- * * * Comments: * -------- * o Assumes the static data for resizing has been set up. *************************************<->***********************************/ int ResizeType (ClientData *pcd, XEvent *pev) { int x, y; if (!pev) return(FRAME_NONE); x = pev->xmotion.x_root; y = pev->xmotion.y_root; /* if inside all resize areas, then forget it */ if ( (x > resizeX) && (y > resizeY) && (x < (resizeX + resizeWidth - 1)) && (y < (resizeY + resizeHeight - 1)) ) { return(FRAME_NONE); } /* left side */ if (x <= resizeX) { if (y < resizeY + (int)pcd->frameInfo.cornerHeight) return (FRAME_RESIZE_NW); else if (y >= resizeY + resizeHeight -(int)pcd->frameInfo.cornerHeight) return (FRAME_RESIZE_SW); else return (FRAME_RESIZE_W); } /* right side */ if (x >= resizeX + resizeWidth - 1) { if (y < resizeY + (int)pcd->frameInfo.cornerHeight) return (FRAME_RESIZE_NE); else if (y >= resizeY + resizeHeight -(int)pcd->frameInfo.cornerHeight) return (FRAME_RESIZE_SE); else return (FRAME_RESIZE_E); } /* top side */ if (y <= resizeY) { if (x < resizeX + (int)pcd->frameInfo.cornerWidth) return (FRAME_RESIZE_NW); else if (x >= resizeX + resizeWidth - (int)pcd->frameInfo.cornerWidth) return (FRAME_RESIZE_NE); else return (FRAME_RESIZE_N); } /* bottom side */ if (y >= resizeY + resizeHeight - 1) { if (x < resizeX + (int)pcd->frameInfo.cornerWidth) return (FRAME_RESIZE_SW); else if (x >= resizeX + resizeWidth - (int)pcd->frameInfo.cornerWidth) return (FRAME_RESIZE_SE); else return (FRAME_RESIZE_S); } return(FRAME_NONE); } /* END OF FUNCTION ResizeType */ /*************************************<->************************************* * * FixFrameValues (pcd, pfX, pfY, pfWidth, pfHeight, resizing) * * * Description: * ----------- * Fix up the frame values so that they do not exceed maximum or minimum * size and that at least part of the frame is on screen * * * Inputs: * ------ * pcd - pointer to client data * pfX - pointer to frame x-coord * pfY - pointer to frame y-coord * pfWidth - pointer to frame width * pfHeight - pointer to frame height * resizing - check size constraints iff TRUE * * * Outputs: * ------- * *pfX - fixed up frame x-coord * *pfY - fixed up frame y-coord * *pfWidth - fixed up frame width * *pfHeight - fixed up frame height * * * Comments: * -------- * 1. This could be more efficient * 2. Interactive resize with aspect ratio constraints may cause part of the * outline to disappear off screen. The critical case is when the title * bar disappears ABOVE the screen. * *************************************<->***********************************/ void FixFrameValues (ClientData *pcd, int *pfX, int *pfY, unsigned int *pfWidth, unsigned int *pfHeight, Boolean resizing) { unsigned int lswidth; unsigned int oWidth, oHeight; /* * Fix size if resizing and not icon. */ if (resizing && !wmGD.movingIcon) { FrameToClient(pcd, pfX, pfY, pfWidth, pfHeight); oWidth = *pfWidth; oHeight = *pfHeight; FixWindowSize (pcd, pfWidth, pfHeight, 1, 1); AdjustPos (pfX, pfY, oWidth, oHeight, *pfWidth, *pfHeight); ClientToFrame(pcd, pfX, pfY, pfWidth, pfHeight); } /* * Don't move if we'd end up totally offscreen */ if (wmGD.movingIcon) { lswidth = FRAME_BORDER_WIDTH(pcd); } else { lswidth = pcd->frameInfo.lowerBorderWidth; } if (lswidth < 5) lswidth = 5; if (wmGD.movingIcon && P_ICON_BOX(pcd)) { /* * Constrain outline to icon box */ /* left edge of outline */ if (*pfX < clipX) { *pfX = clipX; } /* top of outline */ if (*pfY < clipY) { *pfY = clipY; } /* right edge of outline */ if (((int)*pfX) > ((int)clipX + (int)clipWidth - ((int)*pfWidth))) { *pfX = clipX + clipWidth - *pfWidth; } /* bottom edge of outline */ if (((int)*pfY) > ((int)clipY + (int)clipHeight - ((int)*pfHeight))) { *pfY = clipY + clipHeight - *pfHeight; } } else { /* * keep outline on screen */ /* keep right border on screen */ if (*pfX < ((int) lswidth - (int) *pfWidth)) { *pfX = (int) lswidth - (int) *pfWidth; } /* keep bottom border on screen */ if (*pfY < ((int) lswidth - (int) *pfHeight)) { *pfY = (int) lswidth - (int) *pfHeight; } /* keep left border on screen */ if (*pfX > (DisplayWidth(DISPLAY, SCREEN_FOR_CLIENT(pcd)) - (int) lswidth)) { *pfX = DisplayWidth(DISPLAY, SCREEN_FOR_CLIENT(pcd)) - (int) lswidth; } /* keep top border on screen */ if (*pfY > (DisplayHeight(DISPLAY,SCREEN_FOR_CLIENT(pcd)) - (int) lswidth)) { *pfY = DisplayHeight(DISPLAY, SCREEN_FOR_CLIENT(pcd)) - (int) lswidth; } } } /* END OF FUNCTION FixFrameValues */ /*************************************<->************************************* * * ForceOnScreen (screen, pX, pY) * * * Description: * ----------- * Correct (if necessary) the coords specified to make them on screen * * * Inputs: * ------ * screen - screen number * pX - pointer to x-coord * pY - pointer to y-coord * * Outputs: * ------- * *pX - x-coord (on screen) * *pY - y-coord (on screen) * * * Comments: * -------- * XXComments ... * *************************************<->***********************************/ void ForceOnScreen (int screen, int *pX, int *pY) { if (*pX >= (DisplayWidth(DISPLAY, screen))) *pX = DisplayWidth(DISPLAY, screen) - 1; else if (*pX < 0) *pX = 0; if (*pY >= (DisplayHeight(DISPLAY, screen))) *pY = DisplayHeight(DISPLAY, screen) - 1; else if (*pY < 0) *pY = 0; } /* END OF FUNCTION ForceOnScreen */ /*************************************<->************************************* * * SetPointerPosition (newX, newY, actualX, actualY) * * * Description: * ----------- * Attempt to set the pointer to position at newX, newY. * * * Inputs: * ------ * newX - X-coordinate to set pointer at * newY - Y-coordinate to set pointer at * * * Outputs: * ------- * *actualX - actual X-coord of pointer on return * *actualY - actual Y-coord of pointer on return * * Comments: * -------- * *************************************<->***********************************/ void SetPointerPosition (int newX, int newY, int *actualX, int *actualY) { int junk; Window junk_win; /* * Warp pointer ... */ if (wmGD.enableWarp) { XWarpPointer(DISPLAY, None, ACTIVE_ROOT, 0, 0, 0, 0, newX, newY); } /* * Get pointer position * NOTE: if we are not warping, we don't want to do the Query pointer, * hence enableWarp is tested first. */ if (!wmGD.enableWarp || !XQueryPointer (DISPLAY, ACTIVE_ROOT, &junk_win, &junk_win, actualX, actualY, &junk, &junk, (unsigned int *)&junk)) { /* failed to get pointer position or not warping, return something */ *actualX = newX; *actualY = newY; } } /* END OF FUNCTION SetPointerPositio */ /*************************************<->************************************* * * GetConfigEvent (display, window, mask, curX, curY, oX, oY, * oWidth, oHeight, pev,) * * * Description: * ----------- * Get next configuration event * * * Inputs: * ------ * display - pointer to display * window - window to get event relative to * mask - event mask - acceptable events to return * pev - pointer to a place to put the event * curX - current X value of pointer * curY - current Y value of pointer * oX - X value of outline * oY - Y value of outline * oWidth - width of outline * oHeight - height of outline * * Outputs: * ------- * *pev - event returned. * * Comments: * -------- * *************************************<->***********************************/ void GetConfigEvent (Display *display, Window window, unsigned long mask, int curX, int curY, int oX, int oY, unsigned oWidth, unsigned oHeight, XEvent *pev) { Window root_ret, child_ret; int root_x, root_y, win_x, win_y; unsigned int mask_ret; Boolean polling; int pollCount; Boolean gotEvent; Boolean eventToReturn = False; while (!eventToReturn) { /* * Suck up pointer motion events */ gotEvent = False; while (XCheckWindowEvent(display, window, mask, pev)) { gotEvent = True; if (pev->type != MotionNotify) break; } /* * Only poll if we are warping the pointer. * (uses PointerMotionHints exclusively). */ polling = wmGD.enableWarp; pollCount = CONFIG_POLL_COUNT; if (!gotEvent && (polling || !wmGD.freezeOnConfig)) { /* * poll for events and flash the frame outline * if not move opaque */ while (True) { if (XCheckWindowEvent(display, window, (mask & ~PointerMotionMask), pev)) { gotEvent = True; break; } if (!wmGD.freezeOnConfig && !wmGD.pActiveSD->moveOpaque) { /* flash the outline if server is not grabbed */ MoveOutline (oX, oY, oWidth, oHeight); } if (!XQueryPointer (display, window, &root_ret, &child_ret, &root_x, &root_y, &win_x, &win_y, &mask_ret)) { continue; /* query failed, try again */ } if ((root_x != curX) || (root_y != curY)) { /* * Pointer moved to a new position. * Cobble a motion event together. * NOTE: SOME FIELDS NOT SET !!! */ pev->type = MotionNotify; /* pev->xmotion.serial = ??? */ pev->xmotion.send_event = False; pev->xmotion.display = display; pev->xmotion.window = root_ret; pev->xmotion.subwindow = child_ret; pev->xmotion.time = CurrentTime; /* !!! !!! */ pev->xmotion.x = root_x; pev->xmotion.y = root_y; pev->xmotion.x_root = root_x; pev->xmotion.y_root = root_y; /* pev->xmotion.state = ??? */ /* pev->xmotion.is_hint = ???? */ /* pev->xmotion.same_screen = ??? */ eventToReturn = True; break; /* from while loop */ } else if (wmGD.freezeOnConfig) { if (!(--pollCount)) { /* * No pointer motion in some time. Stop polling * and wait for next event. */ polling = False; break; /* from while loop */ } } } /* end while */ } if (!gotEvent && !polling && wmGD.freezeOnConfig) { /* * Wait for next event on window */ XWindowEvent (display, window, mask, pev); gotEvent = True; } if (gotEvent) { eventToReturn = True; if (pev->type == MotionNotify && pev->xmotion.is_hint == NotifyHint) { /* * "Ack" the motion notify hint */ if ((XQueryPointer (display, window, &root_ret, &child_ret, &root_x, &root_y, &win_x, &win_y, &mask_ret)) && ((root_x != curX) || (root_y != curY))) { /* * The query pointer values say that the pointer * moved to a new location. */ pev->xmotion.window = root_ret; pev->xmotion.subwindow = child_ret; pev->xmotion.x = root_x; pev->xmotion.y = root_y; pev->xmotion.x_root = root_x; pev->xmotion.y_root = root_y; } else { /* * Query failed. Change curX to force position * to be returned on first sucessful query. */ eventToReturn = False; curX++; } } } } /* end while */ } /* END OF FUNCTION GetConfigEvent */ /*************************************<->************************************* * * SetOutline (pOutline, x, y, width, height, fatness) * * * Description: * ----------- * Sets the outline of for config/move/placement operations * * * Inputs: * ------ * pOutline - ptr to outline structure to fill in * x - x of upper-left corner of outline * y - y of upper-left corner of outline * width - width of outline. * height - height of outline. * fatness - pixel-width of outline * * Outputs: * ------- * * Comments: * -------- * o Be sure that pOutline points to a big enough area of memory * for the outline to be set! * *************************************<->***********************************/ void SetOutline (XSegment *pOutline, int x, int y, unsigned int width, unsigned int height, int fatness) { int i; for (i=0; ix1 = x; pOutline->y1 = y; pOutline->x2 = x + width -1; pOutline++->y2 = y; pOutline->x1 = x + width -1; pOutline->y1 = y; pOutline->x2 = x + width -1; pOutline++->y2 = y + height - 1; pOutline->x1 = x + width -1; pOutline->y1 = y + height - 1; pOutline->x2 = x; pOutline++->y2 = y + height - 1; pOutline->x1 = x; pOutline->y1 = y + height - 1; pOutline->x2 = x; pOutline++->y2 = y; /* * Modify values for next pass (if any) * Next outline will be on inside of current one. */ x += 1; y += 1; width -= 2; height -= 2; } } /* END OF FUNCTION SetOutline */ /*************************************<->************************************* * * AdjustPos (pX, pY, oWidth, oHeight, nWidth, nHeight) * * * Description: * ----------- * Adjusts the position according to wmGD.configPart and any change in * client size. * * * Inputs: * ------ * pX, pY -- pointers to positions * oWidth, oHeight -- original dimensions * nWidth, nHeight -- new dimensions * wmGD.configPart * * Outputs: * ------- * pX, pY -- pointers to adjusted positions * * Comments: * -------- * *************************************<->***********************************/ void AdjustPos (int *pX, int *pY, unsigned int oWidth, unsigned int oHeight, unsigned int nWidth, unsigned int nHeight) { switch (wmGD.configPart) { case FRAME_RESIZE_NW: /* anchor lower right corner */ *pX += oWidth - nWidth; *pY += oHeight - nHeight; break; case FRAME_RESIZE_N: /* anchor bottom */ *pY += oHeight - nHeight; break; case FRAME_RESIZE_NE: /* anchor lower left corner */ *pY += oHeight - nHeight; break; case FRAME_RESIZE_E: /* anchor left side */ break; case FRAME_RESIZE_SE: /* anchor upper left corner */ break; case FRAME_RESIZE_S: /* anchor top */ break; case FRAME_RESIZE_SW: /* anchor upper right corner */ *pX += oWidth - nWidth; break; case FRAME_RESIZE_W: /* anchor right side */ *pX += oWidth - nWidth; break; default: break; } } /* END OF FUNCTION AdjustPos */ /*************************************<->************************************* * * GrabWin (pcd, pev) * * * Description: * ----------- * return window to do grab on for config operation * * * Inputs: * ------ * pcd - ptr to client data * pev - ptr to event * * Outputs: * ------- * Return - window * * * Comments: * -------- * *************************************<->***********************************/ Window GrabWin (ClientData *pcd, XEvent *pev) { Window grab_win; /* * The grab window is the icon if the client is minimized * or if the event was on a "normalized" icon in the icon box. */ if ((pcd->clientState == MINIMIZED_STATE) || (pcd->pSD->useIconBox && pev && ((pev->xany.window == ICON_FRAME_WIN(pcd)) || (pev->xany.window == ACTIVE_ICON_TEXT_WIN)))) { grab_win = ICON_FRAME_WIN(pcd); } else if (pev && (pev->xany.window == pcd->clientFrameWin || pev->xany.window == pcd->clientBaseWin )) { grab_win = pcd->clientFrameWin; } else if (pcd->pSD->useIconBox && P_ICON_BOX(pcd) && wmGD.grabContext == F_SUBCONTEXT_IB_WICON) { grab_win = ICON_FRAME_WIN(pcd); } else { grab_win = pcd->clientFrameWin; } return (grab_win); } /* END OF FUNCTION GrabWin */ #ifdef WSM /*************************************<->************************************* * * HandleMarqueeSelect (pSD, event) * * * Description: * ----------- * Does a marquee selection on the root window * * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * Selection info is dumped into a root window property: * _DT_MARQUEE_SELECTION * *************************************<->***********************************/ void HandleMarqueeSelect (WmScreenData *pSD, XEvent *pev) { Window grab_win; Boolean bDone; XEvent event; grab_win = RootWindow (DISPLAY, pSD->screen); bDone = False; while (!bDone && (wmGD.configAction == MARQUEE_SELECT)) { if (!pev) /* first time through will already have event */ { pev = &event; GetConfigEvent(DISPLAY, grab_win, CONFIG_MASK, pointerX, pointerY, resizeX, resizeY, resizeWidth, resizeHeight, &event); } if (pev->type == MotionNotify) { pointerX = pev->xmotion.x_root; pointerY = pev->xmotion.y_root; UpdateMarqueeSelectData (pSD); } else if (pev->type == KeyPress) { /* * Handle key event. */ bDone = HandleMarqueeKeyPress (pSD, pev); } else if (pev->type == ButtonRelease) { /* * Update (x,y) to the location of the button release */ pointerX = pev->xbutton.x_root; pointerY = pev->xbutton.y_root; UpdateMarqueeSelectData (pSD); CompleteFrameConfig ((ClientData *)NULL, pev); bDone = True; } else { pev = NULL; continue; /* ignore this event */ } if (!bDone) { MoveOutline (marqueeX, marqueeY, marqueeWidth, marqueeHeight); } pev = NULL; /* reset event pointer */ } /* end while */ } /* END OF FUNCTION HandleMarqueeSelect */ /*************************************<->************************************* * * StartMarqueeSelect () * * * Description: * ----------- * Start marquee selection on root window * * * Inputs: * ------ * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void StartMarqueeSelect(WmScreenData *pSD, XEvent *pev) { Window grab_win, junk_win; Boolean grabbed; int big_inc; int junk, junkX, junkY; if (!pSD->bMarqueeSelectionInitialized) { /* * If we haven't initialized the marquee selection messaging * then do so here before we do any grabs. Sending a dummy * message will do. * * (If we move off of ICCCM messaging, then this can go away.) */ dtSendMarqueeSelectionNotification(pSD, DT_MARQUEE_SELECT_END, 0, 0, 0, 0); pSD->bMarqueeSelectionInitialized = True; } /* * Do our grabs */ if (!configGrab) { grab_win = RootWindow (DISPLAY, pSD->screen); if (pev) { grabbed = DoGrabs (grab_win, wmGD.configCursor, PGRAB_MASK, pev->xbutton.time, NULL, True); } else { grabbed = DoGrabs (grab_win, wmGD.configCursor, PGRAB_MASK, CurrentTime, NULL, True); } if (!grabbed) { return; } configGrab = TRUE; } else { /* continue with the configuration in progress (!!!) */ return; } /* * Set up static variables for succeeding events */ if ((pev->type == ButtonPress) || (pev->type == ButtonRelease)) { pointerX = pev->xbutton.x_root; pointerY = pev->xbutton.y_root; } else if (!XQueryPointer (DISPLAY, pSD->rootWindow, &junk_win, &junk_win, &pointerX, &pointerY, &junk, &junk, (unsigned int *)&junk)) { CancelFrameConfig ((ClientData *)NULL); /* release grabs */ return; } /* save start values to see where we came from */ marqueeX = startX = pointerX; marqueeY = startY = pointerY; marqueeWidth0 = marqueeWidth = 0; marqueeHeight0 = marqueeHeight = 0; marqueeAnchor = ANCHOR_NW; /* compute increment value for dynamic update */ big_inc = DisplayWidth (DISPLAY, pSD->screen) / 20; /* set configuring data */ wmGD.configAction = MARQUEE_SELECT; wmGD.configButton = pev ? pev->xbutton.button: 0; dtSendMarqueeSelectionNotification(pSD, DT_MARQUEE_SELECT_BEGIN, marqueeX, marqueeY, marqueeWidth, marqueeHeight); } /* END OF FUNCTION StartMarqueeSelect */ /*************************************<->************************************* * * UpdateMarqueeSelectData () * * * Description: * ----------- * * Inputs: * ------ * pSD - pointer to screen data * * Outputs: * ------- * * * Comments: * -------- *************************************<->***********************************/ void UpdateMarqueeSelectData (WmScreenData *pSD) { /* validate and update anchor point and marquee data */ switch (marqueeAnchor) { case ANCHOR_NW: marqueeWidth = pointerX - marqueeX; marqueeHeight = pointerY - marqueeY; if (marqueeWidth < 0) { marqueeWidth = -marqueeWidth; marqueeX = pointerX; if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY; marqueeAnchor = ANCHOR_SE; } else { marqueeAnchor = ANCHOR_NE; } } else if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY; marqueeAnchor = ANCHOR_SW; } break; case ANCHOR_NE: marqueeWidth += marqueeX - pointerX; marqueeHeight = pointerY - marqueeY; marqueeX = pointerX; if (marqueeWidth < 0) { marqueeWidth = -marqueeWidth; marqueeX = pointerX - marqueeWidth; if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY; marqueeAnchor = ANCHOR_SW; } else { marqueeAnchor = ANCHOR_NW; } } else if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY; marqueeAnchor = ANCHOR_SE; } break; case ANCHOR_SE: marqueeWidth += marqueeX - pointerX; marqueeHeight += marqueeY - pointerY; marqueeX = pointerX; marqueeY = pointerY; if (marqueeWidth < 0) { marqueeWidth = -marqueeWidth; marqueeX = pointerX - marqueeWidth; if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY - marqueeHeight; marqueeAnchor = ANCHOR_NW; } else { marqueeAnchor = ANCHOR_SW; } } else if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY - marqueeHeight; marqueeAnchor = ANCHOR_NE; } break; case ANCHOR_SW: marqueeWidth = pointerX - marqueeX; marqueeHeight += marqueeY - pointerY; marqueeY = pointerY; if (marqueeWidth < 0) { marqueeWidth = -marqueeWidth; marqueeX = pointerX; if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY - marqueeHeight; marqueeAnchor = ANCHOR_NE; } else { marqueeAnchor = ANCHOR_SE; } } else if (marqueeHeight < 0) { marqueeHeight = -marqueeHeight; marqueeY = pointerY - marqueeHeight; marqueeAnchor = ANCHOR_NW; } break; } if ((wmGD.marqueeSelectGranularity > 0) && ((ABS(marqueeWidth-marqueeWidth0) > wmGD.marqueeSelectGranularity) || (ABS(marqueeHeight-marqueeHeight0)>wmGD.marqueeSelectGranularity))) { dtSendMarqueeSelectionNotification(pSD, DT_MARQUEE_SELECT_CONTINUE, marqueeX, marqueeY, marqueeWidth, marqueeHeight); marqueeWidth0 = marqueeWidth; marqueeHeight0 = marqueeHeight; } } /*************************************<->************************************* * * HandleMarqueeKeyPress (pSD, pev) * * * Description: * ----------- * Handles keypress events during resize of window * * * Inputs: * ------ * pSD - pointer to screen data * pev - pointer to event * * * Outputs: * ------- * Return - True if this event completes (or cancels) resizing * * * Comments: * -------- * *************************************<->***********************************/ Boolean HandleMarqueeKeyPress (WmScreenData *pSD, XEvent *pev) { KeySym keysym; Boolean control; int keyMult; XEvent KeyEvent; /* * Compress repeated keys */ keyMult = 1; while (keyMult <= 10 && XCheckIfEvent (DISPLAY, &KeyEvent, IsRepeatedKeyEvent, (char *) pev)) { keyMult++; } keysym = XKeycodeToKeysym (DISPLAY, pev->xkey.keycode, 0); control = (pev->xkey.state & ControlMask) != 0; switch (keysym) { case XK_Return: CompleteFrameConfig ((ClientData *)NULL, pev); return (True); case XK_Escape: CancelFrameConfig ((ClientData *)NULL); CheckEatButtonRelease ((ClientData *)NULL, pev); return (True); default: return (False); /* ignore this key */ } /* end switch(keysym) */ } /* END OF FUNCTION HandleResizeKeyPress */ #endif /* WSM */ /*************************************<->************************************* * * WmKeycodeToKeysym () * * * Description: * Used insted of depricated function of Xlib XKeycodeToKeysym. * *************************************<->***********************************/ #ifdef FIX_1611 KeySym WmKeycodeToKeysym(Display *display, KeyCode keycode) { int keysyms_per_keycode = 0; int min_keycode = 0; int max_keycode = 0; /* Allowable keycodes range */ XDisplayKeycodes(display, &min_keycode, &max_keycode); KeySym keysym = NoSymbol; if ((keycode >= min_keycode) && (keycode <= max_keycode)) { KeySym *keysymTab = XGetKeyboardMapping(display, keycode, 1, &keysyms_per_keycode); if ((keysymTab != NULL) && (keysyms_per_keycode > 0)) { keysym = keysymTab[0]; XFree(keysymTab); } } return keysym; } #endif /* FIX_1611 */ motif-2.3.8/clients/mwm/WmOL.h0000644000175000017500000000654413145162623013027 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifndef _WM_OL_H #define _WM_OL_H #ifdef HAVE_CONFIG_H #include #endif #ifndef NO_OL_COMPAT #ifdef REV_INFO #ifndef lint static char rcsid[] = "" #endif #endif /* * Property Names */ #define OL_WIN_ATTR "_OL_WIN_ATTR" #define OL_DECOR_ADD "_OL_DECOR_ADD" #define OL_DECOR_DEL "_OL_DECOR_DEL" /* * Decoration atoms */ #define OL_DECOR_RESIZE "_OL_DECOR_RESIZE" #define OL_DECOR_FOOTER "_OL_DECOR_FOOTER" #define OL_DECOR_HEADER "_OL_DECOR_HEADER" #define OL_DECOR_PIN "_OL_DECOR_PIN" #define OL_DECOR_CLOSE "_OL_DECOR_CLOSE" #define OL_DECOR_ICON_NAME "_OL_DECOR_ICON_NAME" #define OL_PIN_IN "_OL_PIN_IN" #define OL_PIN_OUT "_OL_PIN_OUT" /* * Window types */ #define OL_WT_BASE "_OL_WT_BASE" #define OL_WT_CMD "_OL_WT_CMD" #define OL_WT_NOTICE "_OL_WT_NOTICE" #define OL_WT_HELP "_OL_WT_HELP" #define OL_WT_OTHER "_OL_WT_OTHER" /* * Menu Types */ #define OL_MENU_LIMITED "_OL_MENU_LIMITED" #define OL_MENU_FULL "_OL_MENU_FULL" /* * Structure of Open Look window attribute property */ typedef struct _OLWinAttr { unsigned long flags; Atom win_type; Atom menu_type; unsigned long pin_initial_state; unsigned long cancel; } OLWinAttr; #define OLWINATTRLENGTH (sizeof(OLWinAttr)/sizeof(unsigned long)) typedef struct _old_OLWinAttr { Atom win_type; Atom menu_type; unsigned long pin_initial_state; } old_OLWinAttr; #define OLDOLWINATTRLENGTH (sizeof(old_OLWinAttr)/sizeof(unsigned long)) /* pin states */ #define PIN_OUT 0 #define PIN_IN 1 /* * Values for flags in OLWinAttr */ #define WA_WINTYPE (1<<0) #define WA_MENUTYPE (1<<1) #define WA_PINSTATE (1<<2) #define WA_CANCEL (1<<3) #define ENTIRE_CONTENTS (10000000L) /* * Bit Flags for OL Window Decoration */ #define OLDecorHeader (1L<<0) #define OLDecorFooter (1L<<1) #define OLDecorPushPin (1L<<2) #define OLDecorCloseButton (1L<<3) #define OLDecorResizeable (1L<<4) #define OLDecorIconName (1L<<5) #define OLDecorWarpToPin (1L<<6) /* * Public Functions */ extern Boolean HasOpenLookHints( ClientData *pCD ); extern OLWinAttr * GetOLWinAttr( ClientData *pCD ); extern Boolean GetOLDecorFlags(ClientData *pCD, Atom property, unsigned long *pDecor); /* * Macros (public pseudo-functions) */ #define GetOLDecorAdd(pcd,ptr) (GetOLDecorFlags(pcd,wmGD.xa_OL_DECOR_ADD,ptr)) #define GetOLDecorDel(pcd,ptr) (GetOLDecorFlags(pcd,wmGD.xa_OL_DECOR_DEL,ptr)) #endif /* NO_OL_COMPAT */ /* Do not add anything after the following #endif */ #endif /* _WM_OL_H */ motif-2.3.8/clients/mwm/WmIPlace.c0000644000175000017500000004772013145162623013646 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.1 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmIPlace.c /main/4 1995/11/01 11:41:20 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" /* * include extern functions */ #include "WmError.h" #include "WmIDecor.h" #include "WmIconBox.h" #include "WmWinConf.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ /* * Function Declarations: */ #include "WmIPlace.h" /* * Global Variables: */ extern Dimension clipWidth; extern Dimension clipHeight; extern Position clipX; extern Position clipY; /*************************************<->************************************* * * InitIconPlacement () * * * Description: * ----------- * This function intializes icon placement information. * * * Inputs: * ------ * pWS = pointer to workspace data * * * Outputs: * ------- * IconPlacmementData * *************************************<->***********************************/ void InitIconPlacement (WmWorkspaceData *pWS) { Boolean useMargin; int sW; int sH; int iSpaceX; int iSpaceY; int placementW; int placementH; int extraXSpace; int extraYSpace; int xMargin; int yMargin; int extraPX; int extraPY; int i; xMargin = yMargin = extraPX = extraPY = 0; sW = DisplayWidth (DISPLAY, pWS->pSD->screen); sH = DisplayHeight (DISPLAY, pWS->pSD->screen); useMargin = (pWS->pSD->iconPlacementMargin >= 0); pWS->IPData.iconPlacement = pWS->pSD->iconPlacement; if (useMargin) { pWS->IPData.placementCols = (sW - (2 * pWS->pSD->iconPlacementMargin)) / pWS->pSD->iconWidth; pWS->IPData.placementRows = (sH - (2 * pWS->pSD->iconPlacementMargin)) / pWS->pSD->iconHeight; } else { pWS->IPData.placementCols = sW / pWS->pSD->iconWidth; pWS->IPData.placementRows = sH / pWS->pSD->iconHeight; } if (pWS->IPData.iconPlacement & ICON_PLACE_TIGHT) { iSpaceX = 0; iSpaceY = 0; xMargin = 2; yMargin = 2; } else { do { if (useMargin) { iSpaceX = (sW - (2 * pWS->pSD->iconPlacementMargin) - (pWS->IPData.placementCols * pWS->pSD->iconWidth)) / (pWS->IPData.placementCols - 1); } else { iSpaceX = (sW - (pWS->IPData.placementCols * pWS->pSD->iconWidth)) / pWS->IPData.placementCols; } if (iSpaceX < MINIMUM_ICON_SPACING) { pWS->IPData.placementCols--; } } while (iSpaceX < MINIMUM_ICON_SPACING); do { if (useMargin) { iSpaceY = (sH - (2 * pWS->pSD->iconPlacementMargin) - (pWS->IPData.placementRows * pWS->pSD->iconHeight)) / (pWS->IPData.placementRows - 1); } else { iSpaceY = (sH - (pWS->IPData.placementRows * pWS->pSD->iconHeight)) / pWS->IPData.placementRows; } if (iSpaceY < MINIMUM_ICON_SPACING) { pWS->IPData.placementRows--; } } while (iSpaceY < MINIMUM_ICON_SPACING); } pWS->IPData.iPlaceW = pWS->pSD->iconWidth + iSpaceX; pWS->IPData.iPlaceH = pWS->pSD->iconHeight + iSpaceY; placementW = pWS->IPData.placementCols * pWS->IPData.iPlaceW; placementH = pWS->IPData.placementRows * pWS->IPData.iPlaceH; pWS->IPData.placeIconX = ((pWS->IPData.iPlaceW - pWS->pSD->iconWidth) + 1) / 2; pWS->IPData.placeIconY = ((pWS->IPData.iPlaceH - pWS->pSD->iconHeight) + 1) / 2; /* * Special case margin handling for TIGHT icon placement */ if (pWS->IPData.iconPlacement & ICON_PLACE_TIGHT) { if (useMargin) { xMargin = pWS->pSD->iconPlacementMargin; yMargin = pWS->pSD->iconPlacementMargin; } extraXSpace = 0; extraYSpace = 0; if ((pWS->IPData.iconPlacement & ICON_PLACE_RIGHT_PRIMARY) || (pWS->IPData.iconPlacement & ICON_PLACE_RIGHT_SECONDARY)) xMargin = sW - placementW - xMargin; if ((pWS->IPData.iconPlacement & ICON_PLACE_BOTTOM_PRIMARY) || (pWS->IPData.iconPlacement & ICON_PLACE_BOTTOM_SECONDARY)) yMargin = sH - placementH - yMargin; } else { if (useMargin) { xMargin = pWS->pSD->iconPlacementMargin - pWS->IPData.placeIconX; extraXSpace = sW - (2 * pWS->pSD->iconPlacementMargin) - (placementW - iSpaceX); extraPX = (pWS->IPData.iconPlacement & ICON_PLACE_RIGHT_PRIMARY) ? 1 : (pWS->IPData.placementCols - extraXSpace); yMargin = pWS->pSD->iconPlacementMargin - pWS->IPData.placeIconY; extraYSpace = sH - (2 * pWS->pSD->iconPlacementMargin) - (placementH - iSpaceY); extraPY = (pWS->IPData.iconPlacement & ICON_PLACE_BOTTOM_PRIMARY) ? 1 : (pWS->IPData.placementRows - extraYSpace); } else { xMargin = (sW - placementW + ((pWS->IPData.iPlaceW - pWS->pSD->iconWidth) & 1)) / 2; extraXSpace = 0; yMargin = (sH - placementH + ((pWS->IPData.iPlaceH - pWS->pSD->iconHeight) & 1))/ 2; extraYSpace = 0; if (pWS->IPData.iconPlacement & ICON_PLACE_RIGHT_PRIMARY) { xMargin = sW - placementW - xMargin; pWS->IPData.placeIconX = pWS->IPData.iPlaceW - pWS->pSD->iconWidth - pWS->IPData.placeIconX; } if (pWS->IPData.iconPlacement & ICON_PLACE_BOTTOM_PRIMARY) { yMargin = sH - placementH - yMargin; pWS->IPData.placeIconY = pWS->IPData.iPlaceH - pWS->pSD->iconHeight - pWS->IPData.placeIconY; } } } /* * Setup array of grid row positions and grid column positions: */ if ((pWS->IPData.placementRowY = (int *)XtMalloc ((pWS->IPData.placementRows+2) * sizeof (int))) == NULL) { Warning (((char *)GETMESSAGE(34, 1, "Insufficient memory for icon placement"))); wmGD.iconAutoPlace = False; return; } else if ((pWS->IPData.placementColX = (int *)XtMalloc ((pWS->IPData.placementCols+2) * sizeof (int))) == NULL) { XtFree ((char *)pWS->IPData.placementRowY); Warning (((char *)GETMESSAGE(34, 2, "Insufficient memory for icon placement"))); wmGD.iconAutoPlace = False; return; } pWS->IPData.placementRowY[0] = yMargin; for (i = 1; i <= pWS->IPData.placementRows; i++) { pWS->IPData.placementRowY[i] = pWS->IPData.placementRowY[i - 1] + pWS->IPData.iPlaceH; if ((extraYSpace > 0) && (i >= extraPY)) { (pWS->IPData.placementRowY[i])++; extraYSpace--; } } pWS->IPData.placementColX[0] = xMargin; for (i = 1; i <= pWS->IPData.placementCols; i++) { pWS->IPData.placementColX[i] = pWS->IPData.placementColX[i - 1] + pWS->IPData.iPlaceW; if ((extraXSpace > 0) && (i >= extraPX)) { (pWS->IPData.placementColX[i])++; extraXSpace--; } } /* * Setup an array of icon places. */ pWS->IPData.totalPlaces = pWS->IPData.placementRows * pWS->IPData.placementCols; if ((pWS->IPData.placeList = (IconInfo *)XtMalloc (pWS->IPData.totalPlaces * sizeof (IconInfo))) == NULL) { Warning (((char *)GETMESSAGE(34, 3, "Insufficient memory for icon placement"))); XtFree ((char *)pWS->IPData.placementRowY); XtFree ((char *)pWS->IPData.placementColX); wmGD.iconAutoPlace = False; return; } memset ((char *)pWS->IPData.placeList, 0, pWS->IPData.totalPlaces * sizeof (IconInfo)); pWS->IPData.onRootWindow = True; } /* END OF FUNCTION InitIconPlacement */ /*************************************<->************************************* * * GetNextIconPlace (pIPD) * * * Description: * ----------- * This function identifies and returns the next free icon grid place. * * * Outputs: * ------- * Return = next free place (index) * *************************************<->***********************************/ int GetNextIconPlace (IconPlacementData *pIPD) { int i; for (i = 0; i < pIPD->totalPlaces; i++) { if (pIPD->placeList[i].pCD == (ClientData *)NULL) { return (i); } } /* * All places are filled! Find an alternative place. */ return (NO_ICON_PLACE); } /* END OF FUNCTION GetNextIconPlace */ /*************************************<->************************************* * * CvtIconPlaceToPosition (pIPD, place, pX, pY) * * * Description: * ----------- * This function converts an icon place (index) into an icon position. * * * Inputs: * ------ * pIPD = ptr to icon placement data * * place = place to be converted * * wmGD = (iconPlacement ...) * * * Outputs: * ------- * pX = pointer to icon place X location * * pY = pointer to icon place Y location * *************************************<->***********************************/ void CvtIconPlaceToPosition (IconPlacementData *pIPD, int place, int *pX, int *pY) { int row; int col; if (pIPD->iconPlacement & (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_RIGHT_PRIMARY)) { col = place % pIPD->placementCols; row = place / pIPD->placementCols; } else { col = place / pIPD->placementRows; row = place % pIPD->placementRows; } if (pIPD->iconPlacement & (ICON_PLACE_RIGHT_PRIMARY | ICON_PLACE_RIGHT_SECONDARY)) { col = pIPD->placementCols - col - 1; } if (pIPD->iconPlacement & (ICON_PLACE_BOTTOM_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY)) { row = pIPD->placementRows - row - 1; } if (pIPD->onRootWindow) { *pX = pIPD->placementColX[col] + pIPD->placeIconX; *pY = pIPD->placementRowY[row] + pIPD->placeIconY; } else { *pX = col * pIPD->iPlaceW; *pY = row * pIPD->iPlaceH; } } /* END OF FUNCTION CvtIconPlaceToPosition */ /*************************************<->************************************* * * FindIconPlace (pCD, pIPD, x, y) * * * Description: * ----------- * This function is used to find a free icon place in the proximity of the * specified position. * * * Inputs: * ------ * pIPD = ptr to icon placement data * * x = desired x location of icon place * * y = desired y location of icon place * * * Outputs: * ------- * Return = icon place (index) * * * Comments: * -------- * Look first for a free icon place at the position passed in. If that place * is taken then look at positions that are +- one half the icon width/height * from the postion passed in. If those positions are taken look at * positions that are +- one half icon placement width/height from the * position passed in. * *************************************<->***********************************/ int FindIconPlace (ClientData *pCD, IconPlacementData *pIPD, int x, int y) { int place; int i; int j; int diffX; int diffY; int altX; int altY; int amt; place = CvtIconPositionToPlace (pIPD, x, y); if (place < pIPD->totalPlaces) { if (pIPD->placeList[place].pCD == (ClientData *)NULL) { return (place); } } else { if (pIPD->iconPlacement & ICON_PLACE_LEFT_PRIMARY) { amt = pIPD->placementCols; /* add a new row */ } else { amt = pIPD->placementRows; /* add a new column */ } if (!ExtendIconList (P_ICON_BOX(pCD), amt)) { Warning (((char *)GETMESSAGE(34, 4, "Insufficient memory to create icon box data"))); return (NO_ICON_PLACE); } } /* * The place for the passed in position is in use, look at places for * alternative positions. */ for (i = 0; i < 2; i++) { switch (i) { case 0: { diffX = ICON_WIDTH(pCD) / 2; diffY = ICON_HEIGHT(pCD) / 2; break; } case 1: { diffX = pIPD->iPlaceW / 2; diffY = pIPD->iPlaceH / 2; break; } } for (j = 0; j < 4; j++) { switch (j) { case 0: { if (pIPD->iconPlacement & ICON_PLACE_LEFT_PRIMARY) { altX = x - diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_RIGHT_PRIMARY) { altX = x + diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_TOP_PRIMARY) { altX = x; altY = y - diffY; } else { altX = x; altY = y + diffY; } break; } case 1: { if (pIPD->iconPlacement & ICON_PLACE_LEFT_PRIMARY) { altX = x + diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_RIGHT_PRIMARY) { altX = x - diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_TOP_PRIMARY) { altX = x; altY = y + diffY; } else { altX = x; altY = y - diffY; } break; } case 2: { if (pIPD->iconPlacement & ICON_PLACE_LEFT_SECONDARY) { altX = x - diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_RIGHT_SECONDARY) { altX = x + diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_TOP_SECONDARY) { altX = x; altY = y + diffY; } else { altX = x; altY = y - diffY; } break; } case 3: { if (pIPD->iconPlacement & ICON_PLACE_LEFT_SECONDARY) { altX = x + diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_RIGHT_SECONDARY) { altX = x - diffX; altY = y; } else if (pIPD->iconPlacement & ICON_PLACE_TOP_SECONDARY) { altX = x; altY = y - diffY; } else { altX = x; altY = y + diffY; } break; } } if (P_ICON_BOX(pCD)) { GetClipDimensions(pCD, False); if (altX < clipX) { return (NO_ICON_PLACE); } if (altY < clipY) { return (NO_ICON_PLACE); } if (((int)altX) > ((int)clipX + (int)clipWidth - ((int)ICON_WIDTH(pCD)))) { return (NO_ICON_PLACE); } if (((int)altY) > ((int)clipY + (int)clipHeight - ((int)ICON_HEIGHT(pCD)))) { return (NO_ICON_PLACE); } } place = CvtIconPositionToPlace (pIPD, altX, altY); if ((pIPD->placeList[place].pCD) == NULL) { return (place); } } } /* * Couldn't find an unoccupied place in the proximity of the passed-in * position. */ return (NO_ICON_PLACE); } /* END OF FUNCTION FindIconPlace */ /*************************************<->************************************* * * CvtIconPostionToPlace (pIPD, x, y) * * * Description: * ----------- * This function converts an icon position to an icon place. * * * Inputs: * ------ * pIPD = ptr to icon placement data * * x,y = location to be converted into an icon place * * * Outputs: * ------- * Return = icon place (index) * *************************************<->***********************************/ int CvtIconPositionToPlace (IconPlacementData *pIPD, int x, int y) { int row; int col; if (pIPD->onRootWindow) { /* * Scan through the root window row/column arrays and find the * placement position. */ for (row = 1; row < pIPD->placementRows; row++) { if (y < pIPD->placementRowY[row]) { break; } } row--; for (col = 1; col < pIPD->placementCols; col++) { if (x < pIPD->placementColX[col]) { break; } } col--; if (pIPD->iconPlacement & (ICON_PLACE_RIGHT_PRIMARY | ICON_PLACE_RIGHT_SECONDARY)) { col = pIPD->placementCols - col - 1; } if (pIPD->iconPlacement & (ICON_PLACE_BOTTOM_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY)) { row = pIPD->placementRows - row - 1; } } else { /* * convert icon box coords */ col = x / pIPD->iPlaceW; row = y / pIPD->iPlaceH; } if (pIPD->iconPlacement & (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_RIGHT_PRIMARY)) { return ((row * pIPD->placementCols) + col); } else { return ((col * pIPD->placementRows) + row); } } /* END OF FUNCTION CvtIconPositionToPlace */ /*************************************<->************************************* * * PackRootIcons () * * * Description: * ----------- * This function packs the icons on the root window * * * Inputs: * ------ * * Outputs: * ------- * * Comments: * --------- * *************************************<->***********************************/ void PackRootIcons (void) { int iOld, iNew; ClientData *pCD; ClientData *pCD_active; int hasActiveText = 1; #ifdef WSM WsClientData *pWsc; #endif /* WSM */ /* * find context of the activeIconTextWin to get pCD and then * if it is the same as this client, hide it. */ if (XFindContext (DISPLAY, ACTIVE_PSD->activeIconTextWin, wmGD.windowContextType, (caddr_t *)&pCD_active)) { hasActiveText = 0; } /* * Traverse the list and pack them together */ if (wmGD.iconAutoPlace) { for (iOld = iNew = 0; iOld < ACTIVE_WS->IPData.totalPlaces; iOld++, iNew++) { if (ACTIVE_WS->IPData.placeList[iOld].pCD == NULL) { /* advance to next non-null entry */ while (++iOld < ACTIVE_WS->IPData.totalPlaces && !ACTIVE_WS->IPData.placeList[iOld].pCD) ; } if (iOld < ACTIVE_WS->IPData.totalPlaces && iOld != iNew) { /* move the icon from its old place to the new place */ MoveIconInfo (&ACTIVE_WS->IPData, iOld, iNew); pCD = ACTIVE_WS->IPData.placeList[iNew].pCD; #ifdef WSM pWsc = GetWsClientData (ACTIVE_WS, pCD); pWsc->iconPlace = iNew; CvtIconPlaceToPosition (&ACTIVE_WS->IPData, pWsc->iconPlace, &pWsc->iconX, &pWsc->iconY); #else /* WSM */ pCD->iconPlace = iNew; CvtIconPlaceToPosition (&ACTIVE_WS->IPData, pCD->iconPlace, &pCD->iconX, &pCD->iconY); #endif /* WSM */ if (hasActiveText && (pCD == pCD_active)) { /* hide activeIconTextWin first */ HideActiveIconText ((WmScreenData *)NULL); #ifdef WSM XMoveWindow (DISPLAY, pWsc->iconFrameWin, pWsc->iconX, pWsc->iconY); #else /* WSM */ XMoveWindow (DISPLAY, ICON_FRAME_WIN(pCD), pCD->iconX, pCD->iconY); #endif /* WSM */ ShowActiveIconText (pCD); } else { #ifdef WSM XMoveWindow (DISPLAY, pWsc->iconFrameWin, pWsc->iconX, pWsc->iconY); #else /* WSM */ XMoveWindow (DISPLAY, ICON_FRAME_WIN(pCD), pCD->iconX, pCD->iconY); #endif /* WSM */ } } } } } /* END OF FUNCTION PackRootIcons */ /*************************************<->************************************* * * MoveIconInfo (pIPD, p1, p2) * * * Description: * ----------- * Move icon info from place 1 to place 2 in the placement list. * * * Inputs: * ------ * pIPD - ptr to icon placement data * p1 - placement index 1 (source) * p2 - placement index 2 (destination) * * Outputs: * ------- * * Comments: * -------- * *************************************<->***********************************/ void MoveIconInfo (IconPlacementData *pIPD, int p1, int p2) { #ifdef WSM WsClientData *pWsc; #endif /* WSM */ /* only move if destination is empty */ if (pIPD->placeList[p2].pCD == NULL) { pIPD->placeList[p2].pCD = pIPD->placeList[p1].pCD; pIPD->placeList[p2].theWidget = pIPD->placeList[p1].theWidget; #ifdef WSM pWsc = GetWsClientData (pIPD->placeList[p2].pCD->pSD->pActiveWS, pIPD->placeList[p2].pCD); pWsc->iconPlace = p2; #else /* WSM */ pIPD->placeList[p2].pCD->iconPlace = p2; #endif /* WSM */ pIPD->placeList[p1].pCD = NULL; pIPD->placeList[p1].theWidget = NULL; } } #ifdef WSM /**************************** eof ***************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/WmColormap.c0000644000175000017500000005011313145162623014253 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmColormap.c /main/5 1996/10/30 11:14:44 drk $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" /* * include extern functions */ #include "WmColormap.h" #include "WmKeyFocus.h" static Bool ProcessEvents(Display *dpy, XEvent *Event, char *c_pCD); /* Global variables */ static unsigned long firstRequest, lastRequest; /*************************************<->************************************* * * InitWorkspaceColormap () * * * Description: * ----------- * This function sets up the default workspace colormap and prepares for * workspace colormap processing. * * * Inputs: * ------- * pSD = ptr to screen data * * Outputs: * ------- * wmGD = (workspaceColormap) * *************************************<->***********************************/ void InitWorkspaceColormap (WmScreenData *pSD) { /* * Setup the default (workspace) colormap: * !!! this should be made more general to get the colormap for the !!! * !!! workspace (root) and then track colormap changes !!! */ pSD->workspaceColormap = DefaultColormap (DISPLAY, pSD->screen); } /* END OF FUNCTION InitWorkspaceColormap */ /*************************************<->************************************* * * InitColormapFocus (pSD) * * * Description: * ----------- * This function prepares for managing the colormap focus and sets the * initial colormap focus (if the focus policy is "keyboard" - i.e. the * colormap focus tracks the keyboard focus) the initial colormap * installation is done in InitKeyboardFocus. * * Inputs: * ------- * pSD = pointer to screen data * * Outputs: * ------- * *pSD = (colormapFocus) * *************************************<->***********************************/ void InitColormapFocus (WmScreenData *pSD) { ClientData *pCD; Boolean sameScreen; /* * Set up the initial colormap focus. If the colormapFocusPolicy is * "keyboard" or it is "pointer" and the keyboard input focus policy * is "pointer" then set up the initial colormap focus when the * initial keyboard input focus is set up. */ pSD->colormapFocus = NULL; if (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER) { if (wmGD.keyboardFocusPolicy != KEYBOARD_FOCUS_POINTER) { if ((pCD = GetClientUnderPointer (&sameScreen)) != NULL) { SetColormapFocus (pSD, pCD); } else { WmInstallColormap (pSD, pSD->workspaceColormap); } } } else { WmInstallColormap (pSD, pSD->workspaceColormap); } } /* END OF FUNCTION InitColormapFocus */ #ifndef OLD_COLORMAP /*************************************<->************************************* * * ForceColormapFocus (pSD, pCD) * * * Description: * ----------- * ForceColormapFocus is the working part of the original SetColormapFocus. * This function is used to unconditionally set the colormap focus to a * particular client window or to clear the colormap focus (set focus to * the root window). * * The reason is to permit focus to be dtrced. We need to do this because * we can already have colormap focus, but still need to set the colormaps. * Examples of when this occurs are: * * * after the window manager itself has forced a colormap, * as happens when it draws transients in the overlay planes. * * when WM_COLORMAP_WINDOWS changes. * * when a ColormapNotify (new) event is received. * * * Inputs: * ------ * pSD = pointer to Screen Data * pCD = pointer to client data (clientColormap ...) * *************************************<->***********************************/ void ForceColormapFocus (WmScreenData *pSD, ClientData *pCD) { if (pCD && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { pSD->colormapFocus = pCD; #ifndef OLD_COLORMAP /* colormaps */ ProcessColormapList (pSD, pCD); #else /* OSF original */ WmInstallColormap (pSD, pCD->clientColormap); #endif } else { /* * The default colormap is installed for minimized windows that have * the colormap focus. * !!! should colormaps be installed for icons with client !!! * !!! icon windows? should the client colormap be installed ? !!! */ pSD->colormapFocus = NULL; WmInstallColormap (pSD, pSD->workspaceColormap); } } /* END OF FUNCTION ForceColormapFocus */ #endif /*************************************<->************************************* * * SetColormapFocus (pSD, pCD) * * * Description: * ----------- * This function is used to set the colormap focus to a particular client * window or to clear the colormap focus (set focus to the root window). * * * Inputs: * ------ * pSD = pointer to Screen Data * pCD = pointer to client data (clientColormap ...) * *************************************<->***********************************/ void SetColormapFocus (WmScreenData *pSD, ClientData *pCD) { if (pCD == pSD->colormapFocus) { /* * The focus is already set to the right place. */ return; } #ifndef OLD_COLORMAP ForceColormapFocus (pSD, pCD); #else /* OSF original */ if (pCD && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { pSD->colormapFocus = pCD; #ifndef OLD_COLORMAP /* colormaps */ ProcessColormapList (pSD, pCD); #else /* OSF original */ WmInstallColormap (pSD, pCD->clientColormap); #endif } else { /* * The default colormap is installed for minimized windows that have * the colormap focus. * !!! should colormaps be installed for icons with client !!! * !!! icon windows? should the client colormap be installed ? !!! */ pSD->colormapFocus = NULL; WmInstallColormap (pSD, pSD->workspaceColormap); } #endif } /* END OF FUNCTION SetColormapFocus */ /*************************************<->************************************* * * WmInstallColormap (pSD, colormap) * * * Description: * ----------- * This function installs colormaps for the window manager. It trys to be * intelligent and avoid unnecessary installations. It assumes that no * other program is installing colormaps. * * * Inputs: * ------ * pSD = ptr to screen data * colormap = the id for the colormap to be installed * *************************************<->***********************************/ void WmInstallColormap (WmScreenData *pSD, Colormap colormap) { /* * !!! this could be generalized to work better for systems that !!! * !!! support multiple installed colormaps !!! */ if (colormap != pSD->lastInstalledColormap) { XInstallColormap (DISPLAY, colormap); pSD->lastInstalledColormap = colormap; } } /* END OF FUNCTION WmInstallColormap */ /*************************************<->************************************* * * ResetColormapData (pCD, pWindows, count) * * * Description: * ----------- * This function is used to release old colormap data (contexts, malloc'ed * space). * * * Inputs: * ------ * pCD = pointer to client data (cmapWindows ...) * * pWindows = new list of colormap windows * * count = number of windows in new colormap windows list * *************************************<->***********************************/ void ResetColormapData (ClientData *pCD, Window *pWindows, int count) { int i; if (pCD->clientCmapCount) { if (count == 0) { /* reset the client colormap to the toplevel window colormap */ for (i = 0; i < pCD->clientCmapCount; i++) { if (pCD->cmapWindows[i] == pCD->client) { pCD->clientColormap = pCD->clientCmapList[i]; break; } } } /* * Free up old contexts. */ for (i = 0; i < pCD->clientCmapCount; i++) { if (pCD->cmapWindows[i] != pCD->client) { #ifndef IBM_169380 RemoveColormapWindowReference(pCD, pCD->cmapWindows[i]); #else XDeleteContext (DISPLAY, pCD->cmapWindows[i], wmGD.windowContextType); #endif } } /* * Free up old colormap data. */ XtFree ((char *)(pCD->cmapWindows)); XtFree ((char *)(pCD->clientCmapList)); pCD->clientCmapCount = 0; #ifndef OLD_COLORMAP /* colormap */ XtFree ((char *)(pCD->clientCmapFlags)); pCD->clientCmapFlags = 0; /* DEBUG: */ pCD->clientCmapFlagsInitialized = 0; #endif } if (count) { /* * Set new contexts. */ for (i = 0; i < count; i++) { if (pWindows[i] != pCD->client) { #ifndef IBM_169380 AddColormapWindowReference(pCD, pWindows[i]); #else XSaveContext (DISPLAY, pWindows[i], wmGD.windowContextType, (caddr_t)pCD); #endif } } } } /* END OF FUNCTION ResetColormapData */ #ifndef IBM_169380 /*************************************<->************************************* * * AddColormapWindowReference (pCD, window) * * Description: * ----------- * This function is used to update (or create, if necessary) the structure * that keeps track of all references to a Window from a toplevel window * WM_COLORMAP_DATA property. * *************************************<->***********************************/ void AddColormapWindowReference (ClientData *pCD, Window window) { ClientData **cmap_window_data; Boolean context_exists; int i; ClientData **new_cmap_window_data; context_exists = (!XFindContext (DISPLAY, window, wmGD.cmapWindowContextType, (XPointer *) &cmap_window_data)); if (context_exists) { for (i = 0; cmap_window_data[i] != NULL; i++) { if (cmap_window_data[i] == pCD) { /* Reference already exists - return */ return; } } new_cmap_window_data = (ClientData **) XtMalloc((i + 2 ) * sizeof(ClientData *)); memcpy((void *)new_cmap_window_data,(void *)cmap_window_data, (i + 1) * sizeof(ClientData *)); XtFree((char *) cmap_window_data); XDeleteContext(DISPLAY, window, wmGD.cmapWindowContextType); } else { i = 0; new_cmap_window_data = (ClientData **) XtMalloc(2 * sizeof(ClientData *)); } new_cmap_window_data[i] = pCD; new_cmap_window_data[i + 1] = NULL; XSaveContext (DISPLAY, window, wmGD.cmapWindowContextType, (caddr_t)new_cmap_window_data); } /*************************************<->************************************* * * RemoveColormapWindowReference (pCD, window) * * Description: * ----------- * This function is used to update (or delete, if necessary) the structure * that keeps track of all references to a Window from a toplevel window * WM_COLORMAP_DATA property. * *************************************<->***********************************/ void RemoveColormapWindowReference (ClientData *pCD, Window window) { ClientData **cmap_window_data; Boolean context_exists; int i; int reference_idx = -1; ClientData **new_cmap_window_data; context_exists = (!XFindContext (DISPLAY, window, wmGD.cmapWindowContextType, (XPointer *) &cmap_window_data)); if (context_exists) { for (i = 0; cmap_window_data[i] != NULL; i++) { if (cmap_window_data[i] == pCD) reference_idx = i; } if (reference_idx < 0) return; if (i > 1) { int j,idx; new_cmap_window_data = (ClientData **) XtMalloc(i * sizeof(ClientData *)); idx = 0; for (j = 0; cmap_window_data[j] != NULL; j++) { if (j != reference_idx) { new_cmap_window_data[idx] = cmap_window_data[j]; idx++; } } new_cmap_window_data[idx] = NULL; } XtFree((char *) cmap_window_data); XDeleteContext(DISPLAY, window, wmGD.cmapWindowContextType); if (i > 1) { XSaveContext (DISPLAY, window, wmGD.cmapWindowContextType, (caddr_t)new_cmap_window_data); } } } #endif /* IBM_169380 */ /******************************************************************************* ** ** The rest of this module contains the SGI-added colormap handling. ** ** mwm 1.1.3 didn't even try to deal with multiple colormaps, except to rotate ** them. We need to see that all of the colormaps from WM_COLORMAP_WINDOWS ** are installed when a window gets colormap focus. ** ** The general idea is to keep track of which colormaps bounce which other ** ones, so we only flash the first time (usually not even then). ** ** The conflict record of a window is cleared whenever: ** * WM_COLORMAP_WINDOWS property changes ** * ColormapNotify for a new colormap happens ** * windows are rotated (prev_cmap, next_cmap) ** This is because with a changed colormap list, we need to recalculate ** which ones get bounced out during a full colormap installation. ** ** We don't just lift the twm code because, after carefully looking over ** the twm code, it appears to have some problems of its own. In ** particular, it assumes that if a given colormap displaces another one ** once, it will always do so. This isn't necessarily so for a multiple ** hardware colormaps machine. ** ** We still need to add code to keep track of which color maps are really ** installed at any one time. The current code is ready for this, but it has ** not yet been done. Then we could do two things: ** ** * refrain from installing a colormap if it is already installed ** ** * have a way to restore all installed colormaps after the window ** manager overwrites with it's own. ** ******************************************************************************/ void ProcessColormapList (WmScreenData *pSD, ClientData *pCD) { register int i; XEvent event; /* * If there is no client, return. This can happen when the root gets focus. */ if (!pCD) return; /* * If the window does not have colormap focus, return. We only install * colormaps for windows with focus. We'll get another chance when the * window does get focus. */ if (pCD != pSD->colormapFocus) return; /* * If window is iconified, return. */ if ( (pCD->clientState != NORMAL_STATE) && (pCD->clientState != MAXIMIZED_STATE) ) return; /* * If the list doesn't exist, or has just a single item, no conflicts * exist -- just go ahead and install the indicated colormap. */ if (pCD->clientCmapCount == 0) { WmInstallColormap (pSD, pCD->clientColormap); return; } if (pCD->clientCmapCount == 1) { WmInstallColormap (pSD, pCD->clientCmapList[0]); return; } /* * If the list has already been initialized, we just need to do installs. * Separate out these loops for performance, and because it isn't nice * to grab the server unnecessarily. * * This code should also check for already-installed, once we put in that * capability. */ if (pCD->clientCmapFlagsInitialized) { /* Do the part between the index and zero */ for (i=pCD->clientCmapIndex; --i>=0; ) { if (pCD->clientCmapFlags[i] == ColormapInstalled) { WmInstallColormap (pSD, pCD->clientCmapList[i]); } }; /* Do the part from the end of the list to the index */ for (i=pCD->clientCmapCount; --i>= pCD->clientCmapIndex; ) { if (pCD->clientCmapFlags[i] == ColormapInstalled) { WmInstallColormap (pSD, pCD->clientCmapList[i]); } } /**/ return; } /* * If we get this far, the list has not yet been initialized. * * Stabilize the input queue -- the issue is that we need to know * which colormap notify install and uninstall events are ours. */ XGrabServer (DISPLAY); /* Ensure no one else's events for awhile */ XSync (DISPLAY, FALSE); /* Let pending events settle */ firstRequest = NextRequest (DISPLAY); /* First one that can be ours */ /* * Install the colormaps from last to first -- first is the "highest * priority". "First" is pCD->clientCmapIndex. * * If the list has not been proocessed before, we need to unconditionally * install each colormap. Colormap flashing is possible this once. * * If the list has already been processed once, all conflict checking * was done then. All we need to do this time is to install the colormaps * we know we need. */ /* Do the part between the index and zero */ for (i=pCD->clientCmapIndex; --i>=0; ) { WmInstallColormap (pSD, pCD->clientCmapList[i]); pCD->clientCmapFlags[i] = ColormapInstalled; }; /* Do the part from the end of the list to the index */ for (i=pCD->clientCmapCount; --i>= pCD->clientCmapIndex; ) { WmInstallColormap (pSD, pCD->clientCmapList[i]); pCD->clientCmapFlags[i] = ColormapInstalled; } /* * Stabilize the input queue again -- the issue is that we need to know * which colormap notify install and uninstall events we caused. */ XSync (DISPLAY, FALSE); /* Let pending events settle */ lastRequest = NextRequest (DISPLAY); /* Last one that can be ours */ XUngrabServer (DISPLAY); /* Let others use it again */ /* Process the install & uninstall events */ XCheckIfEvent (DISPLAY, (XEvent *) &event, ProcessEvents, (char *)pCD); /* Set that the list has been processed once */ pCD->clientCmapFlagsInitialized = True; } /* * Look over the queue for install and uninstall events on colormap/window * combinations we care about. We don't actually disturb the queue, so * events can be delivered in undisturbed order to the normal event handling * routines. * * For each appropriate install/uninstall ColormapNotify event that is queued: * *) if uninstall event * *) Set the conflict flag for this colormap window * else if install event * *) Clear the conflict flag for this colormap window */ static Bool ProcessEvents(Display *dpy, XEvent *Event, char *c_pCD) { int i; XColormapEvent *pEvent = (XColormapEvent *) Event; ClientData *pCD = (ClientData *) c_pCD; if ( (pEvent->type == ColormapNotify) && (pEvent->serial >= firstRequest) && (pEvent->serial < lastRequest) && (pEvent->colormap != None) && (!pEvent->new) ) { switch (pEvent->state) { case ColormapInstalled: for (i=0; iclientCmapCount; i++) { if ( (pCD->clientCmapList[i]==pEvent->colormap) &&(pCD->cmapWindows[i]==pEvent->window) ) { pCD->clientCmapFlags[i] = ColormapInstalled; break; } } break; case ColormapUninstalled: for (i=0; iclientCmapCount; i++) { if ( (pCD->clientCmapList[i]==pEvent->colormap) &&(pCD->cmapWindows[i]==pEvent->window) ) { pCD->clientCmapFlags[i] = ColormapUninstalled; break; } } break; default: /* Should never get here */ break; } } /* * Always return false: * * so that we get to search the entire queue -- it isn't very long * * so all events remain on the queue to be handled normally elsewhere */ return False; /* Always, so no events are lost from the queue */ } motif-2.3.8/clients/mwm/WmMain.c0000644000175000017500000001473213145162623013372 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.1 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmMain.c /main/8 1998/04/20 13:01:09 mgreess $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include #ifdef WSM #include
#include
#endif /* WSM */ /* * include extern functions */ #include "WmCEvent.h" #include "WmEvent.h" #include "WmInitWs.h" #ifdef WSM #include "WmIPC.h" #include "WmBackdrop.h" #endif /* WSM */ /* * Function Declarations: */ #ifdef WSM int WmReturnIdentity (int argc, char *argv[], char *environ[]); #define ManagedRoot(w) (!XFindContext (DISPLAY, (w), wmGD.screenContextType, \ (caddr_t *)&pSD) ? (SetActiveScreen (pSD), True) : \ (IsBackdropWindow (ACTIVE_PSD, (w)))) #else /* WSM */ #define ManagedRoot(w) (!XFindContext (DISPLAY, (w), wmGD.screenContextType, \ (caddr_t *)&pSD) ? (SetActiveScreen (pSD), True) : False) #endif /* WSM */ WmScreenData *pSD; /* * Global Variables: */ WmGlobalData wmGD; #ifndef NO_MESSAGE_CATALOG NlsStrings wmNLS; #endif #ifdef WSM int WmIdentity; #endif /* WSM */ /*************************************<->************************************* * * main (argc, argv, environ) * * * Description: * ----------- * This is the main window manager function. It calls window manager * initializtion functions and has the main event processing loop. * * * Inputs: * ------ * argc = number of command line arguments (+1) * * argv = window manager command line arguments * * environ = window manager environment * *************************************<->***********************************/ int main (int argc, char *argv [], char *environ []) { XEvent event; Boolean dispatchEvent; setlocale(LC_ALL, ""); #ifndef NO_MULTIBYTE #ifdef WSM /* * Set up environment variables for this HP DT client */ _DtEnvControl(DT_ENV_SET); /* * Force LANG lookup early. * (Front end may change $LANG to 'C' as part * of string space reduction optimization.) */ { char * foo = ((char *)GETMESSAGE(44, 1, "")); } #endif /* WSM */ XtSetLanguageProc (NULL, (XtLanguageProc)NULL, NULL); #endif #ifdef WSM /* * Get Identity */ WmIdentity = WmReturnIdentity(argc, argv, environ); #endif /* WSM */ /* * Initialize the workspace: */ InitWmGlobal (argc, argv, environ); #ifdef WSM /* * Set up PATH variable if it must run as standalone command * invoker */ if (wmGD.dtLite) { _DtEnvControl(DT_ENV_SET_BIN); } #endif /* WSM */ /* * MAIN EVENT HANDLING LOOP: */ for (;;) { XtAppNextEvent (wmGD.mwmAppContext, &event); /* * Check for, and process non-widget events. The events may be * reported to the root window, to some client frame window, * to an icon window, or to a "special" window management window. * The lock modifier is "filtered" out for window manager processing. */ wmGD.attributesWindow = 0L; #ifdef WSM if ((event.type == ButtonPress) || (event.type == ButtonRelease)) { if ((wmGD.evLastButton.button != 0) && ReplayedButtonEvent (&(wmGD.evLastButton), &(event.xbutton))) { wmGD.bReplayedButton = True; } else { /* save this button for next comparison */ memcpy (&wmGD.evLastButton, &event, sizeof (XButtonEvent)); wmGD.bReplayedButton = False; } } #endif /* WSM */ dispatchEvent = True; if (wmGD.menuActive) { /* * Do special menu event preprocessing. */ if (wmGD.checkHotspot || wmGD.menuUnpostKeySpec || wmGD.menuActive->accelKeySpecs) { dispatchEvent = WmDispatchMenuEvent ((XButtonEvent *) &event); } } if (dispatchEvent) { if (ManagedRoot(event.xany.window)) { dispatchEvent = WmDispatchWsEvent (&event); } else { dispatchEvent = WmDispatchClientEvent (&event); } if (dispatchEvent) { /* * Dispatch widget related event: */ XtDispatchEvent (&event); } } } } /* END OF FUNCTION main */ #ifdef WSM /******************************<->************************************* * * WmReturnIdentity (argc, argv, environ) * * * Description: * ----------- * This function checks the last component of the (path)name * contained in argv[0] and makes a global decision as to whether * it should fetch resources as mwm or dtwm. * * Inputs: * ------ * argc = number of command line arguments (+1) * * argv = window manager command line arguments * * environ = window manager environment * ******************************<->***********************************/ int WmReturnIdentity ( int argc, char *argv[], char *environ[]) { char *tempString; char *origPtr; /* assume it's dtwm until proven differently */ int retVal = DT_MWM; if (!(tempString = (char *)(XtMalloc ((unsigned int)(strlen (argv[0]) + 1))))) { Warning(((char *)GETMESSAGE(44, 2, "Insufficient memory for name of window manager"))); exit(WM_ERROR_EXIT_VALUE); } origPtr = tempString; if (strrchr(argv[0], '/')) { strcpy(tempString, (strrchr(argv[0], '/'))); tempString++; } else strcpy(tempString, argv[0]); if (!(strcmp(tempString, WM_RESOURCE_NAME))) /* * * If it's explicity "mwm", then set our identity anew. * */ { retVal = MWM; } XtFree((char *)origPtr); return(retVal); } /* END OF FUNCTION WmReturnIdentity */ #endif /* WSM */ #ifdef WSM /************************* eof ******************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/WmWinConf.h0000644000175000017500000001017213145162623014050 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void AdjustPos (int *pX, int *pY, unsigned int oWidth, unsigned int oHeight, unsigned int nWidth, unsigned int nHeight); extern unsigned int ButtonStateBit (unsigned int button); extern void CancelFrameConfig (ClientData *pcd); extern void CheckEatButtonRelease (ClientData *pcd, XEvent *pev); extern Boolean CheckVisualPlace (ClientData *pCD, int tmpX, int tmpY); extern void CompleteFrameConfig (ClientData *pcd, XEvent *pev); extern Cursor ConfigCursor (int frame_part); extern void DoFeedback (ClientData *pcd, int x, int y, unsigned int width, unsigned int height, unsigned long newStyle, Boolean resizing); extern Boolean DoGrabs (Window grab_win, Cursor cursor, unsigned int pmask, Time grabTime, ClientData *pCD, Boolean alwaysGrab); extern void DrawOutline (int x, int y, unsigned int width, unsigned int height); extern void EatButtonRelease (unsigned int releaseButtons); extern void FixFrameValues (ClientData *pcd, int *pfX, int *pfY, unsigned int *pfWidth, unsigned int *pfHeight, Boolean resizing); extern void FlashOutline (int x, int y, unsigned int width, unsigned int height); extern void ForceOnScreen (int screen, int *pX, int *pY); extern void GetClipDimensions (ClientData *pCD, Boolean fromRoot); extern void GetConfigEvent (Display *display, Window window, unsigned long mask, int curX, int curY, int oX, int oY, unsigned oWidth, unsigned oHeight, XEvent *pev); extern Window GrabWin (ClientData *pcd, XEvent *pev); extern void HandleClientFrameMove (ClientData *pcd, XEvent *pev); extern void HandleClientFrameResize (ClientData *pcd, XEvent *pev); extern Boolean HandleResizeKeyPress (ClientData *pcd, XEvent *pev); extern void MoveOpaque (ClientData *pcd, int x, int y, unsigned int width, unsigned int height); extern void MoveOutline (int x, int y, unsigned int width, unsigned int height); extern void ProcessNewConfiguration (ClientData *pCD, int x, int y, unsigned int width, unsigned int height, Boolean clientRequest); extern void ReGrabPointer (Window grab_win, Time grabTime); #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) extern void SetGrabServer (void); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ extern void SetOutline (XSegment *pOutline, int x, int y, unsigned int width, unsigned int height, int fatness); extern void SetPointerPosition (int newX, int newY, int *actualX, int *actualY); extern Boolean SetPointerResizePart (ClientData *pcd, XEvent *pev); extern Boolean StartClientMove (ClientData *pcd, XEvent *pev); extern void StartClientResize (ClientData *pcd, XEvent *pev); extern Boolean StartResizeConfig (ClientData *pcd, XEvent *pev); extern int ResizeType (ClientData *pcd, XEvent *pev); extern void UndoGrabs (void); #ifdef WSM extern void HandleMarqueeSelect (WmScreenData *pSD, XEvent *pev); extern void StartMarqueeSelect(WmScreenData *pSD, XEvent *pev); extern void UpdateMarqueeSelectData (WmScreenData *pSD); extern Boolean HandleMarqueeKeyPress (WmScreenData *pSD, XEvent *pev); extern void WindowOutline (int x, int y, unsigned int width, unsigned int height); #endif /* WSM */ extern KeySym WmKeycodeToKeysym(Display *display, KeyCode keycode); /* FIXES */ #define FIX_1611 motif-2.3.8/clients/mwm/WmCEvent.h0000644000175000017500000000631013145162623013670 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void CheckButtonPressBuiltin (XButtonEvent *buttonEvent, Context context, Context subContext, int partContext, ClientData *pCD); extern void CheckButtonReleaseBuiltin (XButtonEvent *buttonEvent, Context context, Context subContext, ClientData *pCD); extern Window GetParentWindow (Window window); extern WmScreenData *GetScreenForWindow (Window win); extern Boolean HandleCButtonPress (ClientData *pCD, XButtonEvent *buttonEvent); extern void HandleCButtonRelease (ClientData *pCD, XButtonEvent *buttonEvent); extern void HandleCColormapNotify (ClientData *pCD, XColormapEvent *colorEvent); extern void HandleCConfigureRequest (ClientData *pCD, XConfigureRequestEvent *configureRequest); extern void HandleCEnterNotify (ClientData *pCD, XEnterWindowEvent *enterEvent); extern void HandleCLeaveNotify (ClientData *pCD, XLeaveWindowEvent *leaveEvent); extern Boolean HandleCFocusIn (ClientData *pCD, XFocusChangeEvent *focusChangeEvent); extern Boolean HandleCFocusOut (ClientData *pCD, XFocusChangeEvent *focusChangeEvent); extern Boolean HandleCKeyPress (ClientData *pCD, XKeyEvent *keyEvent); extern void HandleClientMessage (ClientData *pCD, XClientMessageEvent *clientEvent); extern void HandleCMotionNotify (ClientData *pCD, XMotionEvent *motionEvent); extern void HandleCPropertyNotify (ClientData *pCD, XPropertyEvent *propertyEvent); #ifndef NO_SHAPE extern void HandleCShapeNotify (ClientData *pCD, XShapeEvent *shapeEvent); #endif /* NO_SHAPE */ extern Boolean HandleEventsOnClientWindow (ClientData *pCD, XEvent *pEvent); extern Boolean HandleEventsOnSpecialWindows (XEvent *pEvent); extern void SetupCButtonBindings (Window window, ButtonSpec *buttonSpecs); extern Boolean WmDispatchClientEvent (XEvent *event); extern void HandleIconBoxButtonPress (ClientData *pCD, XButtonEvent *buttonEvent, Context subContext); extern void HandleIconButtonPress (ClientData *pCD, XButtonEvent *buttonEvent); extern void ProcessButtonGrabOnClient (ClientData *pCD, XButtonEvent *buttonEvent, Boolean replayEvent); extern void DetermineActiveScreen (XEvent *pEvent); extern Boolean WmDispatchClientEvent (XEvent *event); #define SetActiveScreen(psd) (ACTIVE_PSD=(psd), wmGD.queryScreen=False) motif-2.3.8/clients/mwm/WmFunction.h0000644000175000017500000001367213145162623014302 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef WSM extern Boolean F_Action (String actionName, ClientData *pCD, XEvent *event); #endif /* WSM */ extern Boolean F_Beep (String args, ClientData *pCD, XEvent *event); extern Boolean F_Lower (String args, ClientData *pCD, XEvent *event); extern void Do_Lower (ClientData *pCD, ClientListEntry *pStackEntry, int flags); extern Boolean F_Circle_Down (String args, ClientData *pCD, XEvent *event); extern Boolean F_Circle_Up (String args, ClientData *pCD, XEvent *event); extern Boolean F_Focus_Color (String args, ClientData *pCD, XEvent *event); extern Boolean F_Exec (String args, ClientData *pCD, XEvent *event); extern Boolean F_Quit_Mwm (String args, ClientData *pCD, XEvent *event); extern void Do_Quit_Mwm (Boolean diedOnRestart); extern Boolean F_Focus_Key (String args, ClientData *pCD, XEvent *event); extern void Do_Focus_Key (ClientData *pCD, Time focusTime, long flags); #ifdef WSM extern Boolean F_Goto_Workspace (String args, ClientData *pCD, XEvent *event); extern Boolean F_Help (String args, ClientData *pCD, XEvent *event); extern Boolean F_Help_Mode (String args, ClientData *pCD, XEvent *event); #endif /* WSM */ extern Boolean F_Next_Key (String args, ClientData *pCD, XEvent *event); extern Boolean F_Prev_Cmap (String args, ClientData *pCD, XEvent *event); extern Boolean F_Prev_Key (String args, ClientData *pCD, XEvent *event); extern Boolean F_Pass_Key (String args, ClientData *pCD, XEvent *event); #ifdef WSM extern Boolean F_Marquee_Selection (String args, ClientData *pCD, XEvent *event); #endif /* WSM */ extern Boolean F_Maximize (String args, ClientData *pCD, XEvent *event); extern Boolean F_Menu (String args, ClientData *pCD, XEvent *event); extern Boolean F_Minimize (String args, ClientData *pCD, XEvent *event); extern Boolean F_Move (String args, ClientData *pCD, XEvent *event); extern Boolean F_Next_Cmap (String args, ClientData *pCD, XEvent *event); extern Boolean F_Nop (String args, ClientData *pCD, XEvent *event); extern Boolean F_Normalize (String args, ClientData *pCD, XEvent *event); extern Boolean F_Normalize_And_Raise (String args, ClientData *pCD, XEvent *event); extern Boolean F_Pack_Icons (String args, ClientData *pCD, XEvent *event); extern Boolean F_Post_SMenu (String args, ClientData *pCD, XEvent *event); #ifdef PANELIST extern Boolean F_Post_FpMenu (String args, ClientData *pCD, XEvent *event); extern Boolean F_Push_Recall (String args, ClientData *pCD, XEvent *event); #endif /* PANELIST */ extern Boolean F_Kill (String args, ClientData *pCD, XEvent *event); extern Boolean F_Refresh (String args, ClientData *pCD, XEvent *event); extern Boolean F_Resize (String args, ClientData *pCD, XEvent *event); extern Boolean F_Restart (String args, ClientData *pCD, XEvent *event); extern Boolean F_Restore (String args, ClientData *pCD, XEvent *event); extern Boolean F_Restore_And_Raise (String args, ClientData *pCD, XEvent *event); extern void Do_Restart (Boolean dummy); extern void RestartWm (long startupFlags); extern void DeFrameClient (ClientData *pCD); #ifdef WSM extern Boolean F_Send (String args, ClientData *pCD, XEvent *event); #endif /* WSM */ extern Boolean F_Send_Msg (String args, ClientData *pCD, XEvent *event); extern Boolean F_Separator (String args, ClientData *pCD, XEvent *event); extern Boolean F_Raise (String args, ClientData *pCD, XEvent *event); extern void Do_Raise (ClientData *pCD, ClientListEntry *pStackEntry, int flags); extern Boolean F_Raise_Lower (String args, ClientData *pCD, XEvent *event); extern Boolean F_Refresh_Win (String args, ClientData *pCD, XEvent *event); extern Boolean F_Set_Behavior (String args, ClientData *pCD, XEvent *event); #ifdef WSM extern Boolean F_Set_Context (String args, ClientData *pCD, XEvent *event); #endif extern void Do_Set_Behavior (Boolean dummy); extern Boolean F_Title (String args, ClientData *pCD, XEvent *event); extern Boolean F_Screen (String args, ClientData *pCD, XEvent *event); #if defined(PANELIST) extern Boolean F_Toggle_Front_Panel (String args, ClientData *pCD, XEvent *event); extern Boolean F_Version (String args, ClientData *pCD, XEvent *event); #endif /* PANELIST */ #ifdef WSM extern Boolean F_Next_Workspace (String args, ClientData *pCD, XEvent *event); extern Boolean F_Prev_Workspace (String args, ClientData *pCD, XEvent *event); extern Boolean F_Workspace_Presence (String args, ClientData *pCD, XEvent *event); #if defined(DEBUG) extern Boolean F_ZZ_Debug (String, ClientData *, XEvent *); #endif /* DEBUG */ #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) extern Boolean F_InvokeCommand (String args, ClientData *pCD, XEvent *event); extern Boolean F_Post_RMenu (String args, ClientData *pCD, XEvent *event); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ extern Time GetFunctionTimestamp (XButtonEvent *pEvent); extern void ReBorderClient (ClientData *pCD, Boolean reMapClient); extern void ClearDirtyStackEntry (ClientData *pCD); /* Fix for 5325 */ #ifdef PANELIST typedef struct _WmPushRecallArg { int ixReg; WmFunction wmFunc; void *pArgs; } WmPushRecallArg; #endif /* PANELIST */ motif-2.3.8/clients/mwm/README0000644000175000017500000000204412672140200012676 00000000000000/* $XConsortium: README /main/2 1996/07/15 13:55:30 drk $ */ Motif 1.1 Window Manager Status (11 May 90) *** Mwm 1.1 BETA + + Notes *** This snapshot of mwm is composed of files that have changed since betaPlus. The following are new since the last tape: * Mwm now checks that an icon is visible before posting a menu for an icon in the icon box. This needs more tuning. * Opaque moves can now be canceled safely * Mwm now restores client X borders on quit and restart. Unfortunately this has introduced a bug on restart with regard to the window position when positionIsFrame: True. This will be fixed soon. * Mwm now removes a terminal separator on a menu if the last menu button is disabled via clientFunctions. * Active label flashing bug in pointer mode is fixed * Misc bug fixes ================================= File list for mwm beta + + WmCEvent.c WmCPlace.c WmFeedback.c WmFunction.c WmIDecor.c WmIconBox.c WmInitWs.c WmManage.c WmMenu.c WmWinConf.c WmWinInfo.c WmWinState.c WmIconBox.h WmResource.h motif-2.3.8/clients/mwm/WmFeedback.c0000644000175000017500000006113213145162623014166 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmFeedback.c /main/6 1996/10/23 17:20:55 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmResNames.h" #define MWM_NEED_TIME16 #include "WmBitmap.h" #include #include #include #include #include #include #define MOVE_OUTLINE_WIDTH 2 #define FEEDBACK_BEVEL 2 #define DEFAULT_POSITION_STRING "(0000x0000)" #define CB_HIGHLIGHT_THICKNESS 3 /* * include extern functions */ #include "WmFeedback.h" #include "WmFunction.h" #include "WmGraphics.h" #ifdef PANELIST #include "WmPanelP.h" /* for typedef in WmManage.h */ #endif /* PANELIST */ #include "WmManage.h" #include "WmColormap.h" #include "stdio.h" /* * Global Variables: */ static Cursor waitCursor = (Cursor)0L; /* see WmGlobal.h for index defines: */ #ifndef NO_MESSAGE_CATALOG static char *confirm_mesg[4] = {"Switch to Default Behavior?", "Switch to Custom Behavior?", "Restart Mwm?", "QUIT Mwm?"}; void initMesg() { char * tmpString; /* * catgets returns a pointer to an area that is over written * on each call to catgets. */ tmpString = ((char *)GETMESSAGE(22, 12, "Switch to Default Behavior?")); if ((confirm_mesg[0] = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(22, 2, "Insufficient memory for local message string"))); confirm_mesg[0] = "Switch to Default Behavior?"; } else { strcpy(confirm_mesg[0], tmpString); } tmpString = ((char *)GETMESSAGE(22, 13, "Switch to Custom Behavior?")); if ((confirm_mesg[1] = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(22, 2, "Insufficient memory for local message string"))); confirm_mesg[1] = "Switch to Custom Behavior?"; } else { strcpy(confirm_mesg[1], tmpString); } if (MwmBehavior) { tmpString = ((char *)GETMESSAGE(22, 3, "Restart Mwm?")); } else { tmpString = ((char *)GETMESSAGE(22, 10, "Restart Workspace Manager?")); } if ((confirm_mesg[2] = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(22, 5, "Insufficient memory for local message string"))); if (MwmBehavior) { confirm_mesg[2] = "Restart Mwm?"; } else { confirm_mesg[2] = "Restart Workspace Manager?"; } } else { strcpy(confirm_mesg[2], tmpString); } if (MwmBehavior) { tmpString = ((char *)GETMESSAGE(22, 6, "QUIT Mwm?")); } else { #ifdef MINIMAL_DT if (wmGD.dtLite) { tmpString = ((char *)GETMESSAGE(22, 9, "Log out?")); } else { tmpString = ((char *)GETMESSAGE(22, 11, "QUIT Workspace Manager?")); } #else /* MINIMAL_DT */ tmpString = ((char *)GETMESSAGE(22, 11, "QUIT Workspace Manager?")); #endif /* MINIMAL_DT */ } if ((confirm_mesg[3] = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(22, 8, "Insufficient memory for local message string"))); if (MwmBehavior) { confirm_mesg[3] = "QUIT Mwm?"; } else #ifdef MINIMAL_DT if (wmGD.dtLite) { confirm_mesg[3] = "Log out?"; } else { confirm_mesg[3] = "QUIT Workspace Manager?"; } #else /* MINIMAL_DT */ tmpString = ((char *)GETMESSAGE(22, 11, "QUIT Workspace Manager?")); #endif /* MINIMAL_DT */ } else { strcpy(confirm_mesg[3], tmpString); } } #else static char *confirm_mesg[4] = {"Toggle to Default Behavior?", "Toggle to Custom Behavior?", "Restart Mwm?", "QUIT Mwm?"}; #endif static char *confirm_widget[4] = {"confirmDefaultBehavior", "confirmCustomBehavior", "confirmRestart", "confirmQuit"}; typedef void (*ConfirmFunc)(Boolean); static ConfirmFunc confirm_func[4] = {Do_Set_Behavior, Do_Set_Behavior, Do_Restart, Do_Quit_Mwm}; /*************************************<->************************************* * * ShowFeedbackWindow(pSD, x, y, width, height, style) * * * Description: * ----------- * Pop up the window for moving and sizing feedback * * * Inputs: * ------ * pSD - pointer to screen data * x - initial x-value * y - initial y-value * width - initial width value * height - initial height value * style - show size, position, or both * * * Outputs: * ------- * * * Comments: * -------- *************************************<->***********************************/ void ShowFeedbackWindow (WmScreenData *pSD, int x, int y, unsigned int width, unsigned int height, unsigned long style) { unsigned long mask = 0; XSetWindowAttributes win_attribs; XWindowChanges win_changes; int direction, ascent, descent; XCharStruct xcsLocation; int winX, winY; int tmpX, tmpY; if ( (pSD->fbStyle = style) == FB_OFF) return; pSD->fbLastX = x; pSD->fbLastY = y; pSD->fbLastWidth = width; pSD->fbLastHeight = height; /* * Derive the size and position of the window from the text extents * Set starting position of each string */ XTextExtents(pSD->feedbackAppearance.font, DEFAULT_POSITION_STRING, strlen(DEFAULT_POSITION_STRING), &direction, &ascent, &descent, &xcsLocation); pSD->fbWinWidth = xcsLocation.width + 4*FEEDBACK_BEVEL; switch (pSD->fbStyle) { case FB_SIZE: pSD->fbSizeY = 2*FEEDBACK_BEVEL + ascent; pSD->fbWinHeight = (ascent + descent) + 4*FEEDBACK_BEVEL; break; case FB_POSITION: pSD->fbLocY = 2*FEEDBACK_BEVEL + ascent; pSD->fbWinHeight = (ascent + descent) + 4*FEEDBACK_BEVEL; break; default: case (FB_SIZE | FB_POSITION): pSD->fbLocY = 2*FEEDBACK_BEVEL + ascent; pSD->fbSizeY = pSD->fbLocY + ascent + descent; pSD->fbWinHeight = 2*(ascent + descent) + 4*FEEDBACK_BEVEL; break; } if (pSD->feedbackGeometry) /* set by user */ { unsigned int junkWidth, junkHeight; mask = XParseGeometry(pSD->feedbackGeometry, &tmpX, &tmpY, &junkWidth, &junkHeight); } if (mask & (XValue|YValue)) { winX = (mask & XNegative) ? DisplayWidth(DISPLAY, pSD->screen) + tmpX - pSD->fbWinWidth : tmpX; winY = (mask & YNegative) ? DisplayHeight(DISPLAY, pSD->screen) + tmpY -pSD->fbWinHeight : tmpY; } else { winX = (DisplayWidth(DISPLAY, pSD->screen) - pSD->fbWinWidth)/2; winY = (DisplayHeight(DISPLAY, pSD->screen) -pSD->fbWinHeight)/2; } /* * Put new text into the feedback strings */ UpdateFeedbackText (pSD, x, y, width, height); /* * bevel the window border for a 3-D look */ if ( (pSD->fbTop && pSD->fbBottom) || ((pSD->fbTop = AllocateRList((unsigned)2*FEEDBACK_BEVEL)) && (pSD->fbBottom = AllocateRList((unsigned)2*FEEDBACK_BEVEL))) ) { pSD->fbTop->used = 0; pSD->fbBottom->used = 0; BevelRectangle (pSD->fbTop, pSD->fbBottom, 0, 0, pSD->fbWinWidth, pSD->fbWinHeight, FEEDBACK_BEVEL, FEEDBACK_BEVEL, FEEDBACK_BEVEL, FEEDBACK_BEVEL); } /* * Create window if not yet created, otherwise fix size and position */ if (!pSD->feedbackWin) { /* * Create the window */ mask = CWEventMask | CWOverrideRedirect | CWSaveUnder; win_attribs.event_mask = ExposureMask; win_attribs.override_redirect = TRUE; win_attribs.save_under = TRUE; /* * Use background pixmap if one is specified, otherwise set the * appropriate background color. */ if (pSD->feedbackAppearance.backgroundPixmap) { mask |= CWBackPixmap; win_attribs.background_pixmap = pSD->feedbackAppearance.backgroundPixmap; } else { mask |= CWBackPixel; win_attribs.background_pixel = pSD->feedbackAppearance.background; } pSD->feedbackWin = XCreateWindow (DISPLAY, pSD->rootWindow, winX, winY, pSD->fbWinWidth, pSD->fbWinHeight, 0, CopyFromParent, InputOutput, CopyFromParent, mask, &win_attribs); } else { win_changes.x = winX; win_changes.y = winY; win_changes.width = pSD->fbWinWidth; win_changes.height = pSD->fbWinHeight; win_changes.stack_mode = Above; mask = CWX | CWY | CWWidth | CWHeight | CWStackMode; XConfigureWindow(DISPLAY, pSD->feedbackWin, (unsigned int) mask, &win_changes); } /* * Make the feedback window visible (map it) */ if (pSD->feedbackWin) { /* Make sure the feedback window doesn't get buried */ XRaiseWindow(DISPLAY, pSD->feedbackWin); XMapWindow (DISPLAY, pSD->feedbackWin); PaintFeedbackWindow(pSD); } } /* END OF FUNCTION ShowFeedbackWindow */ /*************************************<->************************************* * * PaintFeedbackWindow(pSD) * * * Description: * ----------- * Repaints the feedback window in response to exposure events * * * Inputs: * ------ * pSD - pointer to screen data * * Outputs: * ------- * * * Comments: * -------- *************************************<->***********************************/ void PaintFeedbackWindow (WmScreenData *pSD) { if (pSD->feedbackWin) { /* * draw beveling */ if (pSD->fbTop->used > 0) { XFillRectangles (DISPLAY, pSD->feedbackWin, pSD->feedbackAppearance.inactiveTopShadowGC, pSD->fbTop->prect, pSD->fbTop->used); } if (pSD->fbBottom->used > 0) { XFillRectangles (DISPLAY, pSD->feedbackWin, pSD->feedbackAppearance.inactiveBottomShadowGC, pSD->fbBottom->prect, pSD->fbBottom->used); } /* * clear old text */ XClearArea (DISPLAY, pSD->feedbackWin, FEEDBACK_BEVEL, FEEDBACK_BEVEL, pSD->fbWinWidth-2*FEEDBACK_BEVEL, pSD->fbWinHeight-2*FEEDBACK_BEVEL, FALSE); /* * put up new text */ if (pSD->fbStyle & FB_POSITION) { WmDrawString (DISPLAY, pSD->feedbackWin, pSD->feedbackAppearance.inactiveGC, pSD->fbLocX, pSD->fbLocY, pSD->fbLocation, strlen(pSD->fbLocation)); } if (pSD->fbStyle & FB_SIZE) { WmDrawString (DISPLAY, pSD->feedbackWin, pSD->feedbackAppearance.inactiveGC, pSD->fbSizeX, pSD->fbSizeY, pSD->fbSize, strlen(pSD->fbSize)); } } } /*************************************<->************************************* * * HideFeedbackWindow (pSD) * * * Description: * ----------- * Hide the feedback window * * * Inputs: * ------ * pDS - pointer to screen data * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void HideFeedbackWindow (WmScreenData *pSD) { if (pSD->feedbackWin) { XUnmapWindow (DISPLAY, pSD->feedbackWin); #ifndef OLD_COLORMAP ForceColormapFocus (ACTIVE_PSD, ACTIVE_PSD->colormapFocus); #endif } pSD->fbStyle = FB_OFF; } /*************************************<->************************************* * * UpdateFeedbackInfo (pSD, x, y, width, height) * * * Description: * ----------- * Update the information in the feedback window * * * Inputs: * ------ * pSD - pointer to screen info * x - x-value * y - y-value * width - width value * height - height value * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void UpdateFeedbackInfo (WmScreenData *pSD, int x, int y, unsigned int width, unsigned int height) { /* * Currently the feedback window must always be redrawn to (potentially) * repair damage done by moving the configuration outline. The feedback * repainting generally only needs to be done when the information * changes or the feedback window is actually overwritten by the * configuration outline. */ #ifdef NOTDONE /* only update if something changed */ if (((pSD->fbStyle & FB_POSITION) && ((pSD->fbLastX != x) || (pSD->fbLastY != y))) || ((pSD->fbStyle & FB_SIZE) && ((pSD->fbLastWidth != width) || (pSD->fbLastHeight != height)))) #endif /* NOTDONE */ { pSD->fbLastX = x; pSD->fbLastY = y; pSD->fbLastWidth = width; pSD->fbLastHeight = height; UpdateFeedbackText (pSD, x, y, width, height); PaintFeedbackWindow(pSD); } } /*************************************<->************************************* * * UpdateFeedbackText (pSD, x, y, width, height) * * * Description: * ----------- * Update the information in the feedback strings * * * Inputs: * ------ * pSD - pointer to screen data * x - x-value * y - y-value * width - width value * height - height value * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void UpdateFeedbackText (WmScreenData *pSD, int x, int y, unsigned int width, unsigned int height) { int direction, ascent, descent; XCharStruct xcs; if (pSD->fbStyle & FB_POSITION) { sprintf (pSD->fbLocation, "(%4d,%-4d)", x, y); XTextExtents(pSD->feedbackAppearance.font, pSD->fbLocation, strlen(pSD->fbLocation), &direction, &ascent, &descent, &xcs); pSD->fbLocX = (pSD->fbWinWidth - xcs.width)/2; } if (pSD->fbStyle & FB_SIZE) { sprintf (pSD->fbSize, "%4dx%-4d", width, height); XTextExtents(pSD->feedbackAppearance.font, pSD->fbSize, strlen(pSD->fbSize), &direction, &ascent, &descent, &xcs); pSD->fbSizeX = (pSD->fbWinWidth - xcs.width)/2; } } /*************************************<->************************************* * * static void * OkCB (w, client_data, call_data) * * * Description: * ----------- * QuestionBox Ok callback. * * * Inputs: * ------ * None. * * * Outputs: * ------- * None. * * * Comments: * -------- * None. * *************************************<->***********************************/ static void OkCB (w, client_data, call_data) Widget w; caddr_t client_data; caddr_t call_data; { WithdrawDialog (w); confirm_func[((WmScreenData *)client_data)->actionNbr] (False); wmGD.confirmDialogMapped = False; } /* END OF FUNCTION OkCB */ /*************************************<->************************************* * * static void * CancelCB (w, client_data, call_data) * * * Description: * ----------- * QuestionBox Cancel callback. * * * Inputs: * ------ * None. * * * Outputs: * ------- * None. * * * Comments: * -------- * None. * *************************************<->***********************************/ static void CancelCB (w, client_data, call_data) Widget w; caddr_t client_data; caddr_t call_data; { WithdrawDialog (w); wmGD.confirmDialogMapped = False; } /* END OF FUNCTION CancelCB */ /*************************************<->************************************* * * void * ConfirmAction (pSD,nbr) * * * Description: * ----------- * Post a QuestionBox and ask for confirmation. If so, executes the * appropriate action. * * * Inputs: * ------ * nbr = action number * pSD->screen * pSD->screenTopLevel * * * Outputs: * ------- * actionNbr = current QuestionBox widget index. * confirmW[actionNbr] = QuestionBox widget. * * * Comments: * -------- * *************************************<->***********************************/ void ConfirmAction (WmScreenData *pSD, int nbr) { Arg args[8]; register int n; int x, y; Dimension width, height; Widget dialogShellW = NULL; XmString messageString; static XmString defaultMessageString = NULL; /* * If there is a system modal window, don't post another * one. We need to think about a way to let a new system * modal window be posted, and when unposted, restore the * modal state of the current system modal window. */ if(wmGD.systemModalActive) { return ; } if (pSD->confirmboxW[nbr] == NULL) /* First time for this one */ { #ifndef NO_MESSAGE_CATALOG /* * Initialize messages */ initMesg(); #endif /* * Create a dialog popup shell with explicit keyboard policy. */ n = 0; XtSetArg(args[n], XmNx, (XtArgVal) (DisplayWidth (DISPLAY, pSD->screen)/2)); n++; XtSetArg(args[n], XmNy, (XtArgVal) (DisplayHeight (DISPLAY, pSD->screen)/2)); n++; XtSetArg(args[n], XtNallowShellResize, (XtArgVal) TRUE); n++; XtSetArg(args[n], XtNkeyboardFocusPolicy, (XtArgVal) XmEXPLICIT); n++; XtSetArg(args[n], XtNdepth, (XtArgVal) DefaultDepth(DISPLAY, pSD->screen)); n++; XtSetArg(args[n], XtNscreen, (XtArgVal) ScreenOfDisplay(DISPLAY, pSD->screen)); n++; dialogShellW = XtCreatePopupShell ((String) WmNfeedback, transientShellWidgetClass, pSD->screenTopLevelW, args, n); /* * Create a QuestionBox as a child of the popup shell. * Set traversalOn and add callbacks for the OK and CANCEL buttons. * Unmanage the HELP button. */ n = 0; XtSetArg(args[n], XmNdialogType, (XtArgVal) XmDIALOG_QUESTION); n++; XtSetArg(args[n], XmNmessageAlignment, (XtArgVal) XmALIGNMENT_CENTER); n++; XtSetArg(args[n], XmNtraversalOn, (XtArgVal) TRUE); n++; /* * In 1.2 confirmbox's widget name changed from the generic * WmNconfirmbox (ie. 'confirmbox') to a more descriptive name * so that each confirm dialog can be customized separately (e.g. * "Mwm*confirmRestart*messageString: restart it?"). */ pSD->confirmboxW[nbr] = XtCreateManagedWidget (confirm_widget[nbr], xmMessageBoxWidgetClass, dialogShellW, args, n); n = 0; XtSetArg(args[n], XmNmessageString, &messageString); n++; XtGetValues(pSD->confirmboxW[nbr], (ArgList) args, n); if (defaultMessageString == NULL) { defaultMessageString = XmStringCreateLocalized (""); } n = 0; /* * If the message string is the default, then put something * 'reasonable' in instead. */ if (XmStringCompare( messageString, defaultMessageString )) { messageString = XmStringCreateLocalized(confirm_mesg[nbr]); XtSetArg(args[n], XmNmessageString, (XtArgVal) messageString); n++; XtSetValues(pSD->confirmboxW[nbr], (ArgList) args, n); XmStringFree(messageString); } n = 0; XtSetArg (args[n], XmNtraversalOn, (XtArgVal) TRUE); n++; XtSetArg (args[n], XmNhighlightThickness, (XtArgVal) CB_HIGHLIGHT_THICKNESS); n++; #ifndef NO_MESSAGE_CATALOG XtSetArg(args[n], XmNlabelString, wmGD.okLabel); n++; #endif XtSetValues ( XmMessageBoxGetChild (pSD->confirmboxW[nbr], XmDIALOG_OK_BUTTON), args, n); #ifndef NO_MESSAGE_CATALOG n--; XtSetArg(args[n], XmNlabelString, wmGD.cancelLabel); n++; #endif XtSetValues ( XmMessageBoxGetChild (pSD->confirmboxW[nbr], XmDIALOG_CANCEL_BUTTON), args, n); XtAddCallback (pSD->confirmboxW[nbr], XmNokCallback, (XtCallbackProc)OkCB, (XtPointer)pSD); XtAddCallback (pSD->confirmboxW[nbr], XmNcancelCallback, (XtCallbackProc)CancelCB, (XtPointer)NULL); XtUnmanageChild (XmMessageBoxGetChild (pSD->confirmboxW[nbr], XmDIALOG_HELP_BUTTON)); XtRealizeWidget (dialogShellW); /* * Center the DialogShell in the display. */ n = 0; XtSetArg(args[n], XmNheight, &height); n++; XtSetArg(args[n], XmNwidth, &width); n++; XtGetValues (dialogShellW, (ArgList) args, n); x = (DisplayWidth (DISPLAY, pSD->screen) - ((int) width))/2; y = (DisplayHeight (DISPLAY, pSD->screen) - ((int) height))/2; n = 0; XtSetArg(args[n], XmNx, (XtArgVal) x); n++; XtSetArg(args[n], XmNy, (XtArgVal) y); n++; XtSetValues (dialogShellW, (ArgList) args, n); ManageWindow (pSD, XtWindow(dialogShellW), MANAGEW_CONFIRM_BOX); } else { ReManageDialog (pSD, pSD->confirmboxW[nbr]); } pSD->actionNbr = nbr; XFlush(DISPLAY); wmGD.confirmDialogMapped = True; } /* END OF FUNCTION ConfirmAction */ /*************************************<->************************************* * * ShowWaitState (flag) * * * Description: * ----------- * Enter/Leave the wait state. * * * Inputs: * ------ * flag = TRUE for Enter, FALSE for Leave. * * * Outputs: * ------- * None. * * * Comments: * -------- * None. * *************************************<->***********************************/ void ShowWaitState (Boolean flag) { char *bits; char *maskBits; unsigned int width; unsigned int height; unsigned int xHotspot; unsigned int yHotspot; Pixmap pixmap; Pixmap maskPixmap; XColor xcolors[2]; if (!waitCursor) { #ifdef LARGECURSORS if (wmGD.useLargeCursors) { width = time32_width; height = time32_height; bits = (char *)time32_bits; maskBits = (char *)time32m_bits; xHotspot = time32_x_hot; yHotspot = time32_y_hot; } else #endif /* LARGECURSORS */ { width = time16_width; height = time16_height; bits = (char *)time16_bits; maskBits = (char *)time16m_bits; xHotspot = time16_x_hot; yHotspot = time16_y_hot; } pixmap = XCreateBitmapFromData (DISPLAY, DefaultRootWindow(DISPLAY), bits, width, height); maskPixmap = XCreateBitmapFromData (DISPLAY, DefaultRootWindow(DISPLAY), maskBits, width, height); #ifdef INTEGRATION_TESTING_ xcolors[1].pixel = BlackPixelOfScreen(DefaultScreenOfDisplay(DISPLAY)); xcolors[0].pixel = WhitePixelOfScreen(DefaultScreenOfDisplay(DISPLAY)); #else /* INTEGRATION_TESTING */ xcolors[0].pixel = BlackPixelOfScreen(DefaultScreenOfDisplay(DISPLAY)); xcolors[1].pixel = WhitePixelOfScreen(DefaultScreenOfDisplay(DISPLAY)); #endif /* INTEGRATION_TESTING */ XQueryColors (DISPLAY, DefaultColormapOfScreen(DefaultScreenOfDisplay (DISPLAY)), xcolors, 2); waitCursor = XCreatePixmapCursor (DISPLAY, pixmap, maskPixmap, &(xcolors[0]), &(xcolors[1]), xHotspot, yHotspot); XFreePixmap (DISPLAY, pixmap); XFreePixmap (DISPLAY, maskPixmap); } if (flag) { XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), FALSE, 0, GrabModeAsync, GrabModeAsync, None, waitCursor, CurrentTime); XGrabKeyboard (DISPLAY, DefaultRootWindow(DISPLAY), FALSE, GrabModeAsync, GrabModeAsync, CurrentTime); } else { XUngrabPointer (DISPLAY, CurrentTime); XUngrabKeyboard (DISPLAY, CurrentTime); } } /* END OF FUNCTION ShowWaitState */ /*************************************<->************************************* * * InitCursorInfo () * * * Description: * ----------- * This function determines whether a server supports large cursors. It it * does large feedback cursors are used in some cases (wait state and * system modal state); otherwise smaller (16x16) standard cursors are used. * * Outputs: * ------- * wmGD.useLargeCusors = set to True if larger cursors are supported. * *************************************<->***********************************/ void InitCursorInfo (void) { unsigned int cWidth; unsigned int cHeight; wmGD.useLargeCursors = False; if (XQueryBestCursor (DISPLAY, DefaultRootWindow(DISPLAY), 32, 32, &cWidth, &cHeight)) { if ((cWidth >= 32) && (cHeight >= 32)) { wmGD.useLargeCursors = True; } } } /* END OF FUNCTION InitCursorInfo */ motif-2.3.8/clients/mwm/WmCEvent.c0000644000175000017500000021130613145162623013666 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmCEvent.c /main/10 1996/08/09 15:05:39 rswiston $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmICCC.h" #include /* * include extern functions */ #include "WmCEvent.h" #include "WmCDecor.h" #include "WmColormap.h" #include "WmEvent.h" #include "WmFeedback.h" #include "WmFunction.h" #include "WmIDecor.h" #include "WmKeyFocus.h" #ifdef PANELIST #include "WmPanelP.h" #endif /* PANELIST */ #include "WmManage.h" #include "WmMenu.h" #include "WmProperty.h" #include "WmProtocol.h" #include "WmWinConf.h" #include "WmWinInfo.h" #include "WmWinList.h" #include "WmWinState.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ /* * Global Variables: */ extern unsigned int buttonModifierMasks[]; /*************************************<->************************************* * * SetupCButtonBindings (window, buttonSpecs) * * * Description: * ----------- * This function sets up the event handling necessary to support user * specified button bindings for window manager functions that apply to * the client window. * * * Inputs: * ------ * window = grab window id * * buttonSpecs = list of button bindings for window manager functions * *************************************<->***********************************/ void SetupCButtonBindings (Window window, ButtonSpec *buttonSpecs) { ButtonSpec *buttonSpec; unsigned int eventMask; unsigned int grabState; /* * If the context of the button binding includes "window" do button * grabs to get the button events that invoke window manger functions. * !!! don't do redundant grabs !!! */ buttonSpec = buttonSpecs; while (buttonSpec) { if ((buttonSpec->context & F_CONTEXT_WINDOW) && (buttonSpec->subContext & F_SUBCONTEXT_W_CLIENT)) { eventMask = ButtonMotionMask | ButtonReleaseMask; if (buttonSpec->eventType == ButtonRelease) { /* * Don't include the button down in the grab state. */ grabState = buttonSpec->state & ~(buttonModifierMasks[buttonSpec->button]); } else { grabState = buttonSpec->state; } WmGrabButton (DISPLAY, buttonSpec->button, grabState, window, False, eventMask, GrabModeSync, GrabModeAsync, None, None); } /* * If the window context is not "window" a general grab is not * necessary. */ buttonSpec = buttonSpec->nextButtonSpec; } } /* END OF FUNCTION SetupCButtonBindings */ /*************************************<->************************************* * * WmDispatchClientEvent (event) * * * Description: * ----------- * This function detects and dispatches events that are reported to a client * frame or icon window that are not widget-related (i.e. they would not be * dispatched by the Xtk intrinsics). * * * Inputs: * ------ * event = This is an X event that has been retrieved by XtNextEvent. * * * Outputs: * ------- * RETURN = If True the event should be dispatched by the toolkit, * otherwise the event should not be dispatched. * *************************************<->***********************************/ Boolean WmDispatchClientEvent (XEvent *event) { ClientData * pCD = NULL; #ifndef IBM_169380 ClientData **cmap_window_data = NULL; #endif Boolean dispatchEvent = False; /* * Detect and dispatch non-widget events that have been reported to * an icon or a client window frame. */ #ifndef IBM_169380 if ((XFindContext (DISPLAY, event->xany.window, wmGD.windowContextType, (caddr_t *)&pCD)) && (XFindContext (DISPLAY, event->xany.window, wmGD.cmapWindowContextType, (caddr_t *)&cmap_window_data))) #else if (XFindContext (DISPLAY, event->xany.window, wmGD.windowContextType, (caddr_t *)&pCD)) #endif { /* * Set active screen if we're not sure. */ if (wmGD.queryScreen) DetermineActiveScreen (event); /* * Handle events on windows that are made by mwm for * non-client-specific functions. Also handle "leftover" * events on windows that used to be managed by mwm * (e.g. ConfigureRequest events). */ return (HandleEventsOnSpecialWindows (event)); } #ifndef IBM_169380 if (cmap_window_data) /* * Event is on a subwindow that is specified in one or more toplevel * window's WM_COLORMAP_WINDOWS property. (Most likely this is a * ColormapNotify event.) It could have more than one pCD associated * with it, so we have to choose one. If one of the pCD's currently has * the Colormap Focus, then let's use that one. Otherwise, just use * the 1st one. */ { int j; for (j = 0; cmap_window_data[j]; j++) { if (ACTIVE_PSD->colormapFocus == cmap_window_data[j]) { pCD = cmap_window_data[j]; break; } } /* * None of the pCD's in the list have Colormap Focus. So, just * set pCD to the 1st one in the list. */ if (!pCD) pCD = cmap_window_data[0]; } #endif /* * Set active screen if this is not a FocusOut event. * We don't need to set it on focus out AND we use * (SCREEN_FOR_CLIENT(pCD) != ACTIVE_SCREEN) in * in HandleCFocusOut to determine if a new colormap needs * to be installed. */ if (!(event->type == FocusOut)) { SetActiveScreen (PSD_FOR_CLIENT(pCD)); } #ifdef WSM /* Get workspace specific client data */ SetClientWsIndex (pCD); #endif /* WSM */ /* * Handle events on top-level client windows. */ if (event->xany.window == pCD->client) { return (HandleEventsOnClientWindow (pCD, event)); } /* * Handle events on windows created by mwm (for icons and client window * frames) and on non-top-level client windows (e.g., colormap * windows). */ switch (event->type) { case ButtonPress: { dispatchEvent = HandleCButtonPress (pCD, (XButtonEvent *)event); break; } case ButtonRelease: { if (wmGD.menuActive) { dispatchEvent = True; /* have the toolkit dispatch the event */ } else { HandleCButtonRelease (pCD, (XButtonEvent *)event); } break; } case KeyPress: { dispatchEvent = HandleCKeyPress (pCD, (XKeyEvent *)event); break; } case MotionNotify: { HandleCMotionNotify (pCD, (XMotionEvent *)event); break; } case Expose: { /* * If multiple expose events, wait for last one. */ if (event->xexpose.count == 0) { if (event->xexpose.window == ICON_FRAME_WIN(pCD)) { IconExposureProc (pCD, True); if (P_ICON_BOX(pCD)) { dispatchEvent = True; } } else if (event->xexpose.window == pCD->pSD->activeIconTextWin) { PaintActiveIconText (pCD, FALSE); } else if (!(pCD->clientFlags & CLIENT_DESTROYED)) { if ((event->xexpose.window == pCD->clientFrameWin) || (event->xexpose.window == pCD->clientTitleWin)) { FrameExposureProc (pCD); } if (event->xexpose.window == pCD->clientBaseWin) { BaseWinExposureProc (pCD); } } #ifdef PANELIST else if (pCD->clientFlags & FRONT_PANEL_BOX) { /* * * Then this client is the shell for the * front panel and we want the toolkit to repaint * it. * */ dispatchEvent = True; } #endif /* PANELIST */ } break; } case EnterNotify: { HandleCEnterNotify (pCD, (XEnterWindowEvent *)event); break; } case LeaveNotify: { HandleCLeaveNotify (pCD, (XLeaveWindowEvent *)event); break; } case FocusIn: { dispatchEvent = HandleCFocusIn (pCD, (XFocusChangeEvent *)event); break; } case FocusOut: { dispatchEvent = HandleCFocusOut (pCD, (XFocusChangeEvent *)event); break; } case DestroyNotify: { if (((XDestroyWindowEvent *)event)->window == pCD->client) { pCD->clientFlags |= CLIENT_DESTROYED; UnManageWindow (pCD); } break; } case UnmapNotify: { /* * This event is generated when a managed client window is * unmapped by the client or when the window manager unmaps the * client window; check the wmMapCount to determine if this is * the result of a window manager unmap. If this is a client * unmap then the window is to be withdrawn from window manager * control. */ if (((XUnmapEvent *)event)->window == pCD->client) { if (pCD->wmUnmapCount) { pCD->wmUnmapCount--; } else { UnManageWindow (pCD); } } break; } case MapRequest: { /* * This is a request to change the state of the client window from * iconic (minimized) to normal. */ #ifdef WSM if (!ClientInWorkspace (ACTIVE_WS, pCD)) { if (pCD->absentMapBehavior == AMAP_BEHAVIOR_IGNORE) { SetClientState (pCD, NORMAL_STATE|UNSEEN_STATE, GetTimestamp ()); } else { HonorAbsentMapBehavior(pCD); SetClientState (pCD, NORMAL_STATE, GetTimestamp ()); } } else { SetClientState (pCD, NORMAL_STATE, GetTimestamp ()); } #else /* WSM */ SetClientState (pCD, NORMAL_STATE, GetTimestamp ()); #endif /* WSM */ break; } case ConfigureRequest: { HandleCConfigureRequest (pCD, (XConfigureRequestEvent *)event); break; } case ColormapNotify: { /* * Process changes to client window colormaps: */ HandleCColormapNotify (pCD, (XColormapEvent *)event); break; } case ClientMessage: { /* * Handle client message events. */ HandleClientMessage (pCD, (XClientMessageEvent *)event); break; } case ReparentNotify: { if ((((XReparentEvent *)event)->window == pCD->client) && (((XReparentEvent *)event)->parent != pCD->clientBaseWin)) { /* * The window was reparented away from the frame. * Unmanage to clean up the now empty frame. * * Note: We get here when the reparent is done while * the client is unmapped (e.g. iconified). Otherwise * the reparent will generate an UnmapNotify which * will also cause us to unmanage the client. */ UnManageWindow (pCD); } break; } } /* end of event.type switch */ return (dispatchEvent); } /* END OF FUNCTION WmDispatchClientEvent */ /*************************************<->************************************* * * HandleEventsOnSpecialWindows (pEvent) * * * Description: * ----------- * Handles events on special window manager windows and "leftover" events * from destroyed client window frames. * * * Inputs: * ------ * pEvent = pointer to an XEvent structure * * * Outputs: * ------- * RETURN = If True the event should be dispatched by the toolkit, * otherwise the event should not be dispatched. * *************************************<->***********************************/ Boolean HandleEventsOnSpecialWindows (XEvent *pEvent) { Boolean dispatchEvent = True; #ifdef WSM WmScreenData *pSD; #endif /* WSM */ /* * The window is not a root window or a client frame window. Check for * a special window manager window. Have the toolkit dispatch the event * if the event is not on a special window. */ if (pEvent->xany.window == ACTIVE_ROOT) { if (pEvent->type == FocusIn) { SetKeyboardFocus ((ClientData *) NULL, REFRESH_LAST_FOCUS); } } else if (pEvent->xany.window == ACTIVE_PSD->feedbackWin) { if (pEvent->type == Expose) { if (pEvent->xexpose.count == 0) { PaintFeedbackWindow(ACTIVE_PSD); } } dispatchEvent = False; /* don't have the toolkit dispatch the event */ } else if (pEvent->xany.window == ACTIVE_PSD->inputScreenWindow) { if (pEvent->type == ButtonPress) { F_Beep (NULL, (ClientData *) NULL, (XEvent *) NULL); } else if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) && (pEvent->type == EnterNotify)) { HandleWsEnterNotify ((XEnterWindowEvent *)pEvent); } dispatchEvent = False; /* don't have the toolkit dispatch the event */ } #ifdef WSM else if (!XFindContext (DISPLAY, pEvent->xany.window, wmGD.mwmWindowContextType, (caddr_t *)&pSD)) { if ((pEvent->type == PropertyNotify) && (pEvent->xproperty.atom == wmGD.xa_DT_WM_REQUEST) && (pEvent->xproperty.state == PropertyNewValue)) { HandleDtWmRequest (pSD, pEvent); } if (pEvent->type == ClientMessage) { HandleDtWmClientMessage ((XClientMessageEvent *)pEvent); } } #endif /* WSM */ else { /* * Events may come in for a client frame base window that no * longer exists (the client window was just unmanaged but the * the client did some action before the un-reparenting was * actually done). Confirm that this is the case and then * handle the request as if it came in as a root window event. */ switch (pEvent->type) { case ConfigureRequest: { if (GetParentWindow (pEvent->xconfigurerequest.window) == ACTIVE_ROOT) { /* * This is an event for a client base window that * no longer exists. Handle the event as if it is a * root window event. */ dispatchEvent = WmDispatchWsEvent (pEvent); } break; } case MapRequest: { if (GetParentWindow (pEvent->xmaprequest.window) == ACTIVE_ROOT) { /* * This is an event for a client base window that * no longer exists. Handle the event as if it is a * root window event. */ dispatchEvent = WmDispatchWsEvent (pEvent); } break; } } } return (dispatchEvent); } /* END OF FUNCTION HandleEventsOnSpecialWindows */ /*************************************<->************************************* * * HandleEventsOnClientWindow (pCD, pEvent) * * * Description: * ----------- * Handles events on a client top-level window. * * * Inputs: * ------ * pCD = pointer to client data * * pEvent = pointer to an XEvent structure * * * Outputs: * ------- * RETURN = If True the event should be dispatched by the toolkit, * otherwise the event should not be dispatched. * *************************************<->***********************************/ Boolean HandleEventsOnClientWindow (ClientData *pCD, XEvent *pEvent) { Boolean doXtDispatchEvent = True; #ifndef NO_SHAPE if (pEvent->type == (wmGD.shapeEventBase+ShapeNotify)) { HandleCShapeNotify (pCD, (XShapeEvent *)pEvent); } else #endif /* NO_SHAPE */ switch (pEvent->type) { case ColormapNotify: { /* * Process changes to top-level client window colormaps: */ HandleCColormapNotify (pCD, (XColormapEvent *)pEvent); doXtDispatchEvent = False; break; } case PropertyNotify: { /* * Process property changes on managed client windows: */ HandleCPropertyNotify (pCD, (XPropertyEvent *)pEvent); doXtDispatchEvent = False; break; } case ClientMessage: { /* * Handle client message events. */ HandleClientMessage (pCD, (XClientMessageEvent *)pEvent); break; } } return (doXtDispatchEvent); } /* END OF FUNCTION HandleEventsOnClientWindow */ /*************************************<->************************************* * * HandleCPropertyNotify (pCD, propertyEvent) * * * Description: * ----------- * This function handles propertyNotify events (indicating window property * changes) that are reported to the client window. * * * Inputs: * ------ * pCD = pointer to the client data for the client window that got the event * * propertyEvent = propertyNotify event that was received * *************************************<->***********************************/ void HandleCPropertyNotify (ClientData *pCD, XPropertyEvent *propertyEvent) { switch (propertyEvent->atom) { case XA_WM_HINTS: { ProcessWmHints (pCD, FALSE /*not first time*/); break; } case XA_WM_NORMAL_HINTS: { ProcessWmNormalHints (pCD, FALSE /*not first time*/, 0); break; } case XA_WM_NAME: { ProcessWmWindowTitle (pCD, FALSE /*not first time*/); break; } case XA_WM_ICON_NAME: { ProcessWmIconTitle (pCD, FALSE /*not first time*/); break; } case XA_WM_CLASS: { break; } case XA_WM_COMMAND: { if (pCD->clientFlags & CLIENT_TERMINATING) { DeleteClientWmTimers (pCD); XKillClient (DISPLAY, pCD->client); } break; } case XA_WM_TRANSIENT_FOR: { /* * here we handle the special case of dialogs that are * mapped before the windows they are transient for are * mapped. Xm handles this case by waiting for the * transient_for window to appear before setting the * WM_TRANSIENT_FOR property on the dialog. Mwm has to * notice this property change and re-organize things * so the dialog is treated as a transient window. * * Note that we also handle the case of the WM_TRANSIENT_FOR * property being removed. */ DeleteClientFromList (pCD->pSD->pActiveWS, pCD); ProcessWmTransientFor(pCD); AddClientToList(pCD->pSD->pActiveWS, pCD, True); if (pCD->transientLeader != NULL) StackTransientWindow(pCD); break; } default: { if (propertyEvent->atom == wmGD.xa_WM_PROTOCOLS) { ProcessWmProtocols (pCD); } #ifdef WSM else if (propertyEvent->atom == wmGD.xa_DT_WORKSPACE_HINTS) { (void) ProcessWorkspaceHints (pCD); } #endif /* WSM */ else if (propertyEvent->atom == wmGD.xa_MWM_MESSAGES) { if (pCD->protocolFlags & PROTOCOL_MWM_MESSAGES) { ProcessMwmMessages (pCD); } } else if (propertyEvent->atom == wmGD.xa_SM_CLIENT_ID) { ProcessSmClientID(pCD); } else if (propertyEvent->atom == wmGD.xa_WMSAVE_HINT) { ProcessWmSaveHint(pCD); } else if (propertyEvent->atom == wmGD.xa_WM_COLORMAP_WINDOWS) { if (propertyEvent->state == PropertyNewValue) { ProcessWmColormapWindows (pCD); } else { /* property was deleted */ ResetColormapData (pCD, NULL, 0); } if ((ACTIVE_PSD->colormapFocus == pCD) && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { /* * The client window has the colormap focus, install the * colormap. */ #ifndef OLD_COLORMAP /* colormap */ /* * We just changed the colormaps list, * so we need to re-run the whole thing. */ pCD->clientCmapFlagsInitialized = 0; ProcessColormapList (ACTIVE_PSD, pCD); #else /* OSF original */ WmInstallColormap (ACTIVE_PSD, pCD->clientColormap); #endif } } break; } } } /* END OF FUNCTION HandleCPropertyNotify */ /*************************************<->************************************* * * HandleCButtonPress (pCD, buttonEvent) * * * Description: * ----------- * This function does window management actions associated with a button * press event on the client window (including frame) or icon. * * * Inputs: * ------ * pCD = pointer to client data (identifies client window) * * buttonEvent = ButtonPress event on client window * * * Outputs: * ------- * RETURN = True if the event should be dispatched by XtDispatchEvent * *************************************<->***********************************/ Boolean HandleCButtonPress (ClientData *pCD, XButtonEvent *buttonEvent) { Boolean dispatchEvent = False; Boolean replayEvent = True; Context context; int partContext; Context subContext; static Time baseWinTime = 0; static unsigned int baseWinButton = 0; wmGD.passButtonsCheck = True; /* * Find out the event context and process the event accordingly. * If the event is due to a key focus selection grab or an application * modal grab then handle the grab (only these types of grabs are * done on the client window frame base window).. */ if (wmGD.menuActive) { dispatchEvent = True; /* have the toolkit dispatch the event */ } else { IdentifyEventContext (buttonEvent, pCD, &context, &partContext); subContext = (1L << partContext); if (buttonEvent->window == pCD->clientBaseWin) { /* save time of event caught by base window grab */ baseWinTime = buttonEvent->time; baseWinButton = buttonEvent->button; } /* * If this event was caught by the base window grab and * replayed, then don't reprocess if caught by the frame * window. (Replayed events have the same time.) */ if (!((buttonEvent->window == pCD->clientFrameWin) && (buttonEvent->button == baseWinButton) && (buttonEvent->time == baseWinTime))) { #ifndef MOTIF_ONE_DOT_ONE /* * Motif 1.2, ignore replayed events UNPOST_AND_REPLAY events * generated from the menu system (time stamps are exactly * the same for the replayed event) */ if (wmGD.clickData.time == buttonEvent->time) { dispatchEvent = False; } else { ProcessClickBPress (buttonEvent, pCD, context, subContext); } #else ProcessClickBPress (buttonEvent, pCD, context, subContext); #endif if (CheckForButtonAction (buttonEvent, context, subContext, pCD) && pCD) { /* * Button bindings have been processed, now check for bindings * that associated with the built-in semantics of the window * frame decorations. */ CheckButtonPressBuiltin (buttonEvent, context, subContext, partContext, pCD); /* * For case where button action causes lower, but * builtin causes focus - disable auto raise until * we receive focusIn or focusOut. */ pCD->focusAutoRaiseDisablePending = False; } else { /* * Else skip built-in processing due to execution of a function * that does on-going event processing or that has changed the * client state (e.g., f.move or f.minimize). */ replayEvent = False; } } } if (buttonEvent->window == pCD->clientBaseWin) { ProcessButtonGrabOnClient (pCD, buttonEvent, replayEvent); } return (dispatchEvent); } /* END OF FUNCTION HandleCButtonPress */ /*************************************<->************************************* * * ProcessButtonGrabOnClient (pCD, buttonEvent, replayEvent) * * * Description: * ----------- * This function handles an activated button grab on the client window * frame base window. * * * Inputs: * ------ * pCD = pointer to client data of window associated with the grab * * buttonEvent = ButtonPress event on client window * * replayEvent = True if event should be replayed * *************************************<->***********************************/ void ProcessButtonGrabOnClient (ClientData *pCD, XButtonEvent *buttonEvent, Boolean replayEvent) { ButtonSpec *buttonSpec; Boolean passButton; if ((buttonEvent->button == SELECT_BUTTON) && ((buttonEvent->state == 0) || (NOLOCKMOD(buttonEvent->state) == 0))) { passButton = wmGD.passSelectButton; } else { passButton = wmGD.passButtons; } if (IS_APP_MODALIZED(pCD) || !passButton) { replayEvent = False; } else if (replayEvent) { /* * Replay the event as long as there is not another button binding * for the button release. */ buttonSpec = ACTIVE_PSD->buttonSpecs; while (buttonSpec) { if ((buttonSpec->eventType == ButtonRelease) && ((buttonEvent->state == buttonSpec->state) || (NOLOCKMOD(buttonEvent->state) == buttonSpec->state)) && (buttonEvent->button == buttonSpec->button)) { replayEvent = False; break; } buttonSpec = buttonSpec->nextButtonSpec; } } if (replayEvent && wmGD.passButtonsCheck) { XAllowEvents (DISPLAY, ReplayPointer, CurrentTime); } else { if (IS_APP_MODALIZED(pCD)) { /* * The grab is done on a window that has an application modal * secondary window. Beep to indicate no client processing of * the event. */ F_Beep (NULL, pCD, (XEvent *) NULL); } XAllowEvents (DISPLAY, AsyncPointer, CurrentTime); } XAllowEvents (DISPLAY, AsyncKeyboard, CurrentTime); } /* END OF FUNCTION ProcessButtonGrabOnClient */ /*************************************<->************************************* * * CheckButtonPressBuiltin (buttonEvent, context, subContext, partContext, pCD) * * * Description: * ----------- * This function checks to see if a built-in window manager function * has been selected. If yes, then the function is done. * * * Inputs: * ------ * buttonEvent = pointer to button event * * context = button event context (root, icon, window) * * subContext = button event subcontext (title, system button, ...) * * partContext = part context within a window manager component * *************************************<->***********************************/ void CheckButtonPressBuiltin (XButtonEvent *buttonEvent, Context context, Context subContext, int partContext, ClientData *pCD) { /* * All builtin button bindings are based on button 1 with no * modifiers. (Ignore locking modifiers) */ if (((buttonEvent->button != SELECT_BUTTON) && (buttonEvent->button != DMANIP_BUTTON)) || NOLOCKMOD(buttonEvent->state)) { return; } /* * Process the builtin button bindings based on the window manager * component that was selected. */ if (context & F_CONTEXT_ICON) { HandleIconButtonPress (pCD, buttonEvent); } else if (context & F_CONTEXT_ICONBOX) { HandleIconBoxButtonPress (pCD, buttonEvent, subContext); } else if (context & F_CONTEXT_WINDOW) { /* * A client window frame component was selected. */ /* * If the keyboard focus policy is explicit then all window frame * components set the keyboard input focus when selected. */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { /* If we've just done f.lower, disable focusAutoRaise. */ if (pCD && pCD->focusAutoRaiseDisablePending) pCD->focusAutoRaiseDisabled = True; Do_Focus_Key (pCD, buttonEvent->time, (long)((partContext == FRAME_CLIENT) ? CLIENT_AREA_FOCUS : 0)); } /* * Process the builtin button bindings based on the client window * frame component that was selected. */ if ((buttonEvent->button == SELECT_BUTTON) && (subContext == F_SUBCONTEXT_W_SYSTEM)) { int flags = 0; /* * System menu button component: * SELECT_BUTTON Press - post the system menu. * SELECT_BUTTON double-click - close the window. */ PushGadgetIn (pCD, partContext); if ((wmGD.clickData.doubleClickContext == F_SUBCONTEXT_W_SYSTEM) && wmGD.systemButtonClick2 && (pCD->clientFunctions & MWM_FUNC_CLOSE)) { /* * Close the client window. Don't do any of the other * system menu button actions. */ wmGD.clickData.clickPending = False; wmGD.clickData.doubleClickPending = False; F_Kill (NULL, pCD, (XEvent *) buttonEvent); return; } if (pCD->clientState == NORMAL_STATE) { context = F_CONTEXT_NORMAL; } else if (pCD->clientState == MAXIMIZED_STATE) { context = F_CONTEXT_MAXIMIZE; } else { context = F_CONTEXT_ICON; } /* * Set up for "sticky" menu processing if specified. */ if (wmGD.systemButtonClick) { wmGD.checkHotspot = True; flags |= POST_STICKY; } pCD->grabContext = context; PostMenu (pCD->systemMenuSpec, pCD, 0, 0, SELECT_BUTTON, context, flags, (XEvent *)buttonEvent); } else if (subContext == F_SUBCONTEXT_W_TITLE) { /* * Title component: * SELECT_BUTTON or DMANIP_BUTTON Press - * start looking for a move. */ PushGadgetIn (pCD, partContext); /* * Fix for 5075 - Check to make sure that MWM_FUNC_MOVE is set in the * clientFunctions. This is necessary because the title * bar is added based on a number of decorations even if * the resources or the user has specifically requested * that "move" not be one of them. */ if (pCD->clientFunctions & MWM_FUNC_MOVE) { wmGD.preMove = True; wmGD.preMoveX = buttonEvent->x_root; wmGD.preMoveY = buttonEvent->y_root; wmGD.configButton = buttonEvent->button; wmGD.configAction = MOVE_CLIENT; } /* * End fix 5075 */ } else if (subContext & F_SUBCONTEXT_W_RBORDER) { /* * Resize border handle components: * SELECT_BUTTON or DMANIP_BUTTON Press - * start looking for a resize. */ wmGD.preMove = True; wmGD.preMoveX = buttonEvent->x_root; wmGD.preMoveY = buttonEvent->y_root; wmGD.configButton = buttonEvent->button; wmGD.configAction = RESIZE_CLIENT; wmGD.configPart = partContext; wmGD.configSet = True; } else if ((buttonEvent->button == SELECT_BUTTON) && (subContext & (F_SUBCONTEXT_W_MINIMIZE|F_SUBCONTEXT_W_MAXIMIZE))) { /* * Minimize and maximize button components: * SELECT_BUTTON Press - start of a click. */ PushGadgetIn (pCD, partContext); } /* * Other components: no action */ } } /* END OF FUNCTION CheckButtonPressBuiltin */ /*************************************<->************************************* * * HandleIconButtonPress (pCD, buttonEvent) * * * Description: * ----------- * This function handles builtin functions in the icon context. * * * Inputs: * ------ * pCD = pointer to client data of the icon that received the button event * * buttonEvent = pointer to the button event that occurred * *************************************<->***********************************/ void HandleIconButtonPress (ClientData *pCD, XButtonEvent *buttonEvent) { int newState; /* * Do icon component button press actions: * Button 1 press - set the keyboard input focus if policy is explicit * Button 1 double-click - normalize the icon */ if (wmGD.clickData.doubleClickContext == F_SUBCONTEXT_I_ALL) { /* * A double-click was done, normalize the icon. */ if (pCD->maxConfig) { newState = MAXIMIZED_STATE; } else { newState = NORMAL_STATE; } SetClientState (pCD, newState, buttonEvent->time); wmGD.clickData.clickPending = False; wmGD.clickData.doubleClickPending = False; } else { /* * This is a regular button press (it may be the start of a * double-click). Set the focus and top the icon if appropriate. */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { Do_Focus_Key (pCD, buttonEvent->time, ALWAYS_SET_FOCUS); } /* * Indicate that a move may be starting; wait for button motion * events before moving the icon. */ wmGD.preMove = True; wmGD.preMoveX = buttonEvent->x_root; wmGD.preMoveY = buttonEvent->y_root; wmGD.configButton = buttonEvent->button; wmGD.configAction = MOVE_CLIENT; } } /* END OF FUNCTION HandleIconButtonPress */ /*************************************<->************************************* * * HandleIconBoxButtonPress (pCD, buttonEvent, subContext) * * * Description: * ----------- * This function handles builtin functions in the iconbox context. * * * Inputs: * ------ * pCD = pointer to client data of the icon that received the button event * * buttonEvent = pointer to the button event that occurred * * subContext = context id of event location inside icon box * *************************************<->***********************************/ void HandleIconBoxButtonPress (ClientData *pCD, XButtonEvent *buttonEvent, Context subContext) { /* * Do iconbox icon component button press actions: * Button 1 press - select the icon * Button 1 double-click - normalize the icon or raise the window */ if ((wmGD.clickData.doubleClickContext == F_SUBCONTEXT_IB_IICON) || (wmGD.clickData.doubleClickContext == F_SUBCONTEXT_IB_WICON)) { F_Restore_And_Raise ((String)NULL, pCD, (XEvent *)NULL); } else if ((subContext == F_SUBCONTEXT_IB_IICON) || (subContext == F_SUBCONTEXT_IB_WICON)) { /* * Indicate that a move may be starting; wait for button motion * events before moving the icon. */ wmGD.preMove = True; wmGD.preMoveX = buttonEvent->x_root; wmGD.preMoveY = buttonEvent->y_root; wmGD.configButton = buttonEvent->button; wmGD.configAction = MOVE_CLIENT; } /* * Do icon box icon actions: * Button 1 press - select the icon in the icon box */ /* * XmProcessTraversal will move the selection cursor to the * widget that was "boinked" with the mouse */ if ((P_ICON_BOX(pCD)->pCD_iconBox == wmGD.keyboardFocus) || (P_ICON_BOX(pCD)->pCD_iconBox == wmGD.nextKeyboardFocus)) { XmProcessTraversal (XtWindowToWidget(DISPLAY, ICON_FRAME_WIN(pCD)), XmTRAVERSE_CURRENT); } } /* END OF FUNCTION HandleIconBoxButtonPress */ /*************************************<->************************************* * * HandleCButtonRelease (pCD, buttonEvent) * * * Description: * ----------- * This function does window management actions associated with a button * release event on the client window (including frame) or icon. * * * Inputs: * ------ * pCD = pointer to client data for the window/icon that got the event * * buttonEvent = pointer to the button event that occurred * * Comments: * --------- * Skip builtin processing if move or resize button actions were started * due to button-up bindings. * *************************************<->***********************************/ void HandleCButtonRelease (ClientData *pCD, XButtonEvent *buttonEvent) { Context context; Context subContext; int partContext; /* * Find out whether the event was on the client window frame or the icon * and process the event accordingly. */ IdentifyEventContext (buttonEvent, pCD, &context, &partContext); subContext = (1L << partContext); ProcessClickBRelease (buttonEvent, pCD, context, subContext); if (CheckForButtonAction (buttonEvent, context, subContext, pCD) && pCD) { /* * Button bindings have been processed, now check for bindings * that associated with the built-in semantics of the window * frame decorations. */ CheckButtonReleaseBuiltin (buttonEvent, context, subContext, pCD); } /* * Else skip built-in processing due to execution of a function that * does on-going event processing or that has changed the client state * (e.g., f.move or f.minimize). */ /* clear preMove state */ wmGD.preMove = False; } /* END OF FUNCTION HandleCButtonRelease */ /*************************************<->************************************* * * HandleCKeyPress (pCD, keyEvent) * * * Description: * ----------- * This function does window management actions associated with a key * press event on the client window (including frame) or icon. * * * Inputs: * ------ * pCD = pointer to client data for the window/icon that got the event * * keyEvent = pointer to the key event that occurred * * * Outputs: * ------- * RETURN = True if the event should be dispatched by XtDispatchEvent * *************************************<->***********************************/ Boolean HandleCKeyPress (ClientData *pCD, XKeyEvent *keyEvent) { Boolean dispatchEvent = False; Boolean checkKeyEvent = True; if (wmGD.menuActive) { /* * The active menu accelerators have been checked and keyEvent was * not one of them. We will check for an iconbox icon widget key and * for pass keys mode and then have the toolkit dispatch the event, * without rechecking the client accelerator list. */ dispatchEvent = True; checkKeyEvent = False; } /* * If pass keys is active then only check for getting out of the pass * keys mode if the event is on the client frame or icon frame window. * Unfreeze the keyboard and replay the key if pass keys is active. */ if (((keyEvent->window == ICON_FRAME_WIN(pCD)) || (keyEvent->window == pCD->pSD->activeIconTextWin)) && P_ICON_BOX(pCD)) { /* * This is a non-grabbed key that is intended for the icon widget * in the iconbox. */ dispatchEvent = True; /* have the toolkit dispatch the event */ checkKeyEvent = False; if (keyEvent->window == pCD->pSD->activeIconTextWin) { /* * The event is really for the icon, not the active * label, so ... correct the window id */ keyEvent->window = ICON_FRAME_WIN(pCD); } } else if (wmGD.passKeysActive) { if (wmGD.passKeysKeySpec && ((wmGD.passKeysKeySpec->state == keyEvent->state) || (wmGD.passKeysKeySpec->state == NOLOCKMOD(keyEvent->state))) && (wmGD.passKeysKeySpec->keycode == keyEvent->keycode)) { /* * Get out of the pass keys mode. */ F_Pass_Key (NULL, (ClientData *) NULL, (XEvent *) NULL); XAllowEvents (DISPLAY, AsyncKeyboard, CurrentTime); } else { XAllowEvents (DISPLAY, ReplayKeyboard, CurrentTime); } checkKeyEvent = False; } else { XAllowEvents (DISPLAY, AsyncKeyboard, CurrentTime); } /* * Check for a "general" key binding that has been set only for the * icon context. These key bindings are set with the keyBinding * resource or as accelerators in icon context menus. */ if (checkKeyEvent && (keyEvent->window == ICON_FRAME_WIN(pCD))) { if ((checkKeyEvent = HandleKeyPress (keyEvent, ACTIVE_PSD->keySpecs, True, F_CONTEXT_ICON, False, (ClientData *)NULL)) && ACTIVE_PSD->acceleratorMenuCount) { int n; for (n = 0; ((keyEvent->keycode != 0) && (n < ACTIVE_PSD->acceleratorMenuCount)); n++) { if (!HandleKeyPress (keyEvent, ACTIVE_PSD->acceleratorMenuSpecs[n]->accelKeySpecs, True, F_CONTEXT_ICON, True,(ClientData *)NULL)) { checkKeyEvent = False; break; } } } } /* * Check for a key binding that has been set as an accelerator in the * system menu. We only do the first accelerator found. */ if (checkKeyEvent && pCD->systemMenuSpec && (pCD->systemMenuSpec->accelKeySpecs)) { HandleKeyPress (keyEvent, pCD->systemMenuSpec->accelKeySpecs, FALSE, 0, TRUE,(ClientData *)NULL ); } return (dispatchEvent); } /* END OF FUNCTION HandleCKeyPress */ /*************************************<->************************************* * * CheckButtonReleaseBuiltin (buttonEvent, context, subContext, pCD) * * * Description: * ----------- * This function checks to see if a built-in window manager function * has been activated as a result of a button release. If yes, then the * associated function is done. * * * Inputs: * ------ * buttonEvent = pointer to a button release event * * context = button event context (root, icon, window) * * subContext = button event subcontext (title, system button, ...) * * pCD = pointer to client data for the window/icon that got the event * *************************************<->***********************************/ void CheckButtonReleaseBuiltin (XButtonEvent *buttonEvent, Context context, Context subContext, ClientData *pCD) { /* * All builtin button buindings are based on button 1 with no modifiers. * (Ignore locking modifiers). * * Test the event for a ``button up'' transition on buttons we are * interested in. */ if (!((buttonEvent->button == SELECT_BUTTON) && (NOLOCKMOD(buttonEvent->state) == SELECT_BUTTON_MASK)) && !((buttonEvent->button == DMANIP_BUTTON) && (NOLOCKMOD(buttonEvent->state) == DMANIP_BUTTON_MASK))) { return; } /* * Process the builtin button bindings based on the window manager * component that was selected. */ if ((buttonEvent->button == SELECT_BUTTON) && (context & F_CONTEXT_ICON)) { /* * Do the icon component button release actions: * SELECT_BUTTON click - post the system menu if specified. */ if (wmGD.iconClick && (wmGD.clickData.clickContext == F_SUBCONTEXT_I_ALL)) { wmGD.checkHotspot = True; /* * Post the system menu with traversal on (Button 1 should be * used to manipulate the menu). */ pCD->grabContext = F_CONTEXT_ICON; PostMenu (pCD->systemMenuSpec, pCD, 0, 0, NoButton, F_CONTEXT_ICON, POST_STICKY, (XEvent *)buttonEvent); } } /* post menu from icon in iconbox */ else if ((buttonEvent->button == SELECT_BUTTON) && (context & F_CONTEXT_ICONBOX)) { if ((wmGD.iconClick) && (((pCD->clientState == MINIMIZED_STATE) && (wmGD.clickData.clickContext == F_SUBCONTEXT_IB_IICON)) || (wmGD.clickData.clickContext == F_SUBCONTEXT_IB_WICON)) ) { wmGD.checkHotspot = True; /* * Post the system menu with traversal on (Button 1 should be * used to manipulate the menu. */ if ((wmGD.clickData.clickContext == F_SUBCONTEXT_IB_IICON) && (pCD->clientState == MINIMIZED_STATE)) { pCD->grabContext = F_SUBCONTEXT_IB_IICON; PostMenu (pCD->systemMenuSpec, pCD, 0, 0, NoButton, F_SUBCONTEXT_IB_IICON, POST_STICKY, (XEvent *)buttonEvent); } else { pCD->grabContext = F_SUBCONTEXT_IB_WICON; PostMenu (pCD->systemMenuSpec, pCD, 0, 0, NoButton, F_SUBCONTEXT_IB_WICON, POST_STICKY, (XEvent *)buttonEvent); } } } /* end of post menu from icon in iconbox */ else if (context & F_CONTEXT_WINDOW) { /* * The button release is on a client window frame component. */ if ((buttonEvent->button == SELECT_BUTTON) && (subContext == F_SUBCONTEXT_W_MINIMIZE)) { /* * Minimize button: * Button 1 click - minimize the window. */ if (wmGD.clickData.clickContext == F_SUBCONTEXT_W_MINIMIZE) { SetClientState (pCD, MINIMIZED_STATE, buttonEvent->time); } } else if ((buttonEvent->button == SELECT_BUTTON) && (subContext == F_SUBCONTEXT_W_MAXIMIZE)) { /* * Maximize button: * Button 1 click - maximize the window. */ if (wmGD.clickData.clickContext == F_SUBCONTEXT_W_MAXIMIZE) { if (pCD->clientState == NORMAL_STATE) { SetClientState (pCD, MAXIMIZED_STATE, buttonEvent->time); } else { SetClientState (pCD, NORMAL_STATE, buttonEvent->time); } } } } /* * Clear the pre-configuration info that supports the move threshold. */ wmGD.preMove = False; } /* END OF FUNCTION CheckButtonReleaseBuiltin */ /*************************************<->************************************* * * HandleCMotionNotify (pCD, motionEvent) * * * Description: * ----------- * This function does window management actions associated with a motion * notify event on the client window (including frame) or icon. * * * Inputs: * ------ * pCD = pointer to the client data for the window/icon that got the motion * * motionEvent = pointer to the motion event * *************************************<->***********************************/ void HandleCMotionNotify (ClientData *pCD, XMotionEvent *motionEvent) { int diffX; int diffY; /* * Do pre-move processing (to support the move threshold) if appropriate: */ if (wmGD.preMove) { diffX = motionEvent->x_root - wmGD.preMoveX; if (diffX < 0) diffX = -diffX; diffY = motionEvent->y_root - wmGD.preMoveY; if (diffY < 0) diffY = -diffY; if ((diffX >= wmGD.moveThreshold) || (diffY >= wmGD.moveThreshold)) { /* * The move threshold has been exceded; start the config action. */ wmGD.clickData.clickPending = False; wmGD.clickData.doubleClickPending = False; wmGD.preMove = False; if (wmGD.configAction == MOVE_CLIENT) { HandleClientFrameMove (pCD, (XEvent *) motionEvent); } else if (wmGD.configAction == RESIZE_CLIENT) { HandleClientFrameResize (pCD, (XEvent *) motionEvent); } } } } /* END OF FUNCTION HandleCMotionNotify */ /*************************************<->************************************* * * HandleCEnterNotify (pCD, enterEvent) * * * Description: * ----------- * This function does window management actions associated with an enter * window event on the client window. * * * Inputs: * ------ * pCD = pointer to the client data for the window/icon that was entered * * enterEvent = pointer to the enter event * *************************************<->***********************************/ void HandleCEnterNotify (ClientData *pCD, XEnterWindowEvent *enterEvent) { XEvent report; Boolean MatchFound; Window enterWindow; /* * If a client is being configured don't change the keyboard input * focus. The input focus is "fixed" after the configuration has been * completed. */ if (pCD->clientState == MINIMIZED_STATE) { enterWindow = ICON_FRAME_WIN(pCD); } else { enterWindow = pCD->clientFrameWin; } MatchFound = XCheckTypedWindowEvent(DISPLAY, enterWindow, LeaveNotify, &report); /* * NOTE: Handle focus change for when user clicks button in the * process of moving focus the matching event will be NotifyGrab. * * IF (((no_match) || * (another window has focus and button grabbed)) && * pointer_mode) */ if ((enterEvent->detail != NotifyInferior) && (((!MatchFound || (report.xcrossing.detail == NotifyInferior)) && ((enterEvent->mode == NotifyNormal) || (enterEvent->mode == NotifyUngrab)) && !wmGD.menuActive) || (wmGD.keyboardFocus && (wmGD.keyboardFocus->clientFrameWin != enterWindow) && (enterEvent->mode == NotifyGrab))) && ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) || (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER))) { /* * Make sure that EnterNotify is applicable; don't do anything if * the window is minimized (not currently visible) or the event is * associated with an icon in the icon box. */ if (!(((enterEvent->window == pCD->clientFrameWin) && (pCD->clientState == MINIMIZED_STATE)) || (((enterEvent->window == ICON_FRAME_WIN(pCD)) && P_ICON_BOX(pCD)) || (enterEvent->window == pCD->pSD->activeIconTextWin)))) { if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) { /* * Set the focus only if the window does not currently have * or if another window is in the process of getting the * focus (this check avoids redundant focus setting). */ if ((pCD != wmGD.keyboardFocus) || (pCD != wmGD.nextKeyboardFocus)) { Do_Focus_Key (pCD, enterEvent->time, ALWAYS_SET_FOCUS); /* Does the event need to be replayed for modalized windows ? */ if ( wmGD.replayEnterEvent ) /* Yes, save the event. */ memcpy( &wmGD.savedEnterEvent, enterEvent, sizeof( XEnterWindowEvent ) ); /* * The original code counted on getting a focus out event as a result * of setting the input focus in Do_Focus_key. That would cause * SetkeyboardFocus to get called. Unfortunately, you cannot depend on * getting a focus out. You may have already had focus yourself. * * This bug can be produced by: * * bring up a menu and leave it posted * * move to a different window and click * * the menu comes unposted, the new window has input focus, but no * client active decorations are changed. */ #ifdef SGI_FOCUS_PATCH SetKeyboardFocus (pCD, REFRESH_LAST_FOCUS); #endif } } if (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER) { SetColormapFocus (ACTIVE_PSD, pCD); } } } } /* END OF FUNCTION HandleCEnterNotify */ /*************************************<->************************************* * * HandleCLeaveNotify (pCD, leaveEvent) * * * Description: * ----------- * This function does window management actions associated with an leave * window event on the client window. * * * Inputs: * ------ * pCD = pointer to the client data for the window/icon that was leaveed * * leaveEvent = pointer to the leave event * *************************************<->***********************************/ void HandleCLeaveNotify (ClientData *pCD, XLeaveWindowEvent *leaveEvent) { XEvent report; Window leaveWindow; if (pCD->clientState == MINIMIZED_STATE) { leaveWindow = ICON_FRAME_WIN(pCD); } else { leaveWindow = pCD->clientFrameWin; } /* * Don't remove enterEvents when user double clicks on an icon in * an iconbox. Otherwise the window that gets normalized will get * matching enter events and not get the focus. */ if (P_ICON_BOX(pCD) && (P_ICON_BOX(pCD)->pCD_iconBox != wmGD.keyboardFocus) && (P_ICON_BOX(pCD)->pCD_iconBox != wmGD.nextKeyboardFocus)) { XCheckTypedWindowEvent(DISPLAY, leaveWindow, EnterNotify, &report); } } /* END OF FUNCTION HandleCLeaveNotify */ /*************************************<->************************************* * * HandleCFocusIn (pCD, focusChangeEvent) * * * Description: * ----------- * This function does window management actions associated with a focus * in event. * * * Inputs: * ------ * pCD = pointer to the client data for the window/icon that was entered * * enterEvent = pointer to the focus in event * * * Outputs: * ------- * RETURN = True if event is to be dispatched by the toolkit * *************************************<->***********************************/ Boolean HandleCFocusIn (ClientData *pCD, XFocusChangeEvent *focusChangeEvent) { Boolean setupNextFocus; Boolean doXtDispatchEvent = False; /* * Ignore the event if it is for a window that is no longer viewable. * This is the case for a client window FocusIn event that is being * processed for a window that has been minimized. */ if ((focusChangeEvent->window == ICON_FRAME_WIN(pCD)) && P_ICON_BOX(pCD)) { doXtDispatchEvent = True; } else if (((focusChangeEvent->mode == NotifyNormal) || (focusChangeEvent->mode == NotifyWhileGrabbed)) && !((focusChangeEvent->window == pCD->clientBaseWin) && (pCD->clientState == MINIMIZED_STATE)) && !((focusChangeEvent->window == ICON_FRAME_WIN(pCD)) && (pCD->clientState != MINIMIZED_STATE))) { setupNextFocus = (wmGD.keyboardFocus == wmGD.nextKeyboardFocus); if (wmGD.keyboardFocus != pCD) { if ((focusChangeEvent->detail == NotifyNonlinear) || (focusChangeEvent->detail == NotifyNonlinearVirtual)) { SetKeyboardFocus (pCD, REFRESH_LAST_FOCUS); if (setupNextFocus) { wmGD.nextKeyboardFocus = wmGD.keyboardFocus; } } /* Re: CR 4896 */ /* this part added to try and fix the %#$!@!!&* focus bug. */ /* this seems to solve most of the problem. This still leaves */ /* times when clicking on an icon toggles the focus back to the */ /* the previous focus window. */ /* Another patch was added to WmEvent.c to fix that problem. */ else { SetKeyboardFocus (pCD, REFRESH_LAST_FOCUS); if (setupNextFocus) wmGD.nextKeyboardFocus = wmGD.keyboardFocus; } } else if ((focusChangeEvent->detail == NotifyInferior) && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)) { /* * The client window was withdrawn (unmapped or destroyed). * Reset the focus. * !!! pointer focus !!! */ if (wmGD.autoKeyFocus) { /* !!! fix this up to handle transient windows !!! */ AutoResetKeyFocus (wmGD.keyboardFocus, GetTimestamp ()); } else { Do_Focus_Key ((ClientData *) NULL, GetTimestamp (), ALWAYS_SET_FOCUS); } } } pCD->focusAutoRaiseDisabled = False; return (doXtDispatchEvent); } /* END OF FUNCTION HandleCFocusIn */ /*************************************<->************************************* * * HandleCFocusOut (pCD, focusChangeEvent) * * * Description: * ----------- * This function does window management actions associated with a focus * out event that applies to a client window. * * * Inputs: * ------ * pCD = pointer to the client data for the window/icon that was entered * * enterEvent = pointer to the focus out event * * * Outputs: * ------- * RETURN = True if event is to be dispatched by the toolkit * *************************************<->***********************************/ Boolean HandleCFocusOut (ClientData *pCD, XFocusChangeEvent *focusChangeEvent) { Boolean doXtDispatchEvent = False; long focusFlags = REFRESH_LAST_FOCUS ; pCD->focusAutoRaiseDisabled = False; /* * Ignore the event if it is for a window that is no longer viewable. * This is the case for a client window FocusOut event that is being * processed for a window that has been minimized. Also, ignore focus * out events for clients that aren't on the current screen. */ if (((focusChangeEvent->window == ICON_FRAME_WIN(pCD)) && P_ICON_BOX(pCD)) || (SCREEN_FOR_CLIENT(pCD) != ACTIVE_SCREEN)) { doXtDispatchEvent = True; } else if ((wmGD.keyboardFocus == pCD) && (focusChangeEvent->mode == NotifyNormal) && ((focusChangeEvent->detail == NotifyNonlinear) || (focusChangeEvent->detail == NotifyNonlinearVirtual)) && !((focusChangeEvent->window == pCD->clientBaseWin) && (pCD->clientState == MINIMIZED_STATE)) && !((focusChangeEvent->window == ICON_FRAME_WIN(pCD)) && (pCD->clientState != MINIMIZED_STATE))) { /* * The keyboard focus was shifted to another window, maybe on * another screen. Clear the focus indication and reset focus * handling for the client window. */ /* * use SCREEN_SWITCH_FOCUS in SetKeyboardFocus to * not call SetColormapFocus if we are moveing * to another screen */ if (SCREEN_FOR_CLIENT(pCD) != ACTIVE_SCREEN) { focusFlags |= SCREEN_SWITCH_FOCUS; } SetKeyboardFocus ((ClientData *) NULL, focusFlags); if (wmGD.nextKeyboardFocus == pCD) { wmGD.nextKeyboardFocus = NULL; } } return (doXtDispatchEvent); } /* END OF FUNCTION HandleCFocusOut */ /*************************************<->************************************* * * HandleCConfigureRequest (pCD, configureRequest) * * * Description: * ----------- * This functions handles ConfigureRequest events that are for client windows. * * * Inputs: * ------ * pCD = pointer to client data * * configureRequest = a pointer to a ConfigureRequest event * *************************************<->***********************************/ void HandleCConfigureRequest (ClientData *pCD, XConfigureRequestEvent *configureRequest) { unsigned int mask = configureRequest->value_mask; int stackMode = configureRequest->detail; unsigned int changeMask; ClientData *pcdLeader; ClientData *pcdSibling; ClientListEntry *pStackEntry; /* * Call ProcessNewConfiguration to handle window moving and resizing. * Send ConfigureNotify event (based on ICCCM conventions). * Then process the request for stacking. */ if ((configureRequest->window == pCD->client) && (mask & (CWX | CWY | CWWidth | CWHeight | CWBorderWidth))) { if (pCD->maxConfig) { ProcessNewConfiguration (pCD, (mask & CWX) ? configureRequest->x : pCD->maxX, (mask & CWY) ? configureRequest->y : pCD->maxY, (unsigned int) ((mask & CWWidth) ? configureRequest->width : pCD->maxWidth), (unsigned int) ((mask & CWHeight) ? configureRequest->height : pCD->maxHeight), True /*client request*/); } else { int xOff, yOff; /* CDExc21094 - ProcessNewConfiguration() offsets the */ /* x and y positions passed in; in order to keep them */ /* the same, we offset them in the opposite direction. */ if (wmGD.positionIsFrame) { xOff = pCD->clientOffset.x; yOff = pCD->clientOffset.y; } else { xOff = yOff = 0; } ProcessNewConfiguration (pCD, (mask & CWX) ? configureRequest->x : pCD->clientX - xOff, (mask & CWY) ? configureRequest->y : pCD->clientY - yOff, (unsigned int) ((mask & CWWidth) ? configureRequest->width : pCD->clientWidth), (unsigned int) ((mask & CWHeight) ? configureRequest->height : pCD->clientHeight), True /*client request*/); } } if (mask & CWStackMode) { changeMask = mask & (CWSibling | CWStackMode); if (changeMask & CWSibling) { if (XFindContext (DISPLAY, configureRequest->above, wmGD.windowContextType, (caddr_t *)&pcdSibling)) { changeMask &= ~CWSibling; } else { /* * For client requests only primary windows can be * restacked relative to one another. */ pcdLeader = FindTransientTreeLeader (pCD); pcdSibling = FindTransientTreeLeader (pcdSibling); if (pcdLeader == pcdSibling) { changeMask &= ~CWSibling; } else { pStackEntry = &pcdSibling->clientEntry; if ((stackMode == Above) || (stackMode == TopIf)) { /* lower the window to just above the sibling */ Do_Lower (pcdLeader, pStackEntry, STACK_NORMAL); } else if ((stackMode == Below) || (stackMode == BottomIf)) { /* raise the window to just below the sibling */ Do_Raise (pcdLeader, pStackEntry, STACK_NORMAL); } else if (stackMode == Opposite) { F_Raise_Lower (NULL, pCD, (XEvent *)configureRequest); } } } } if (!(changeMask & CWSibling)) { if ((stackMode == Above) || (stackMode == TopIf)) { Do_Raise (pCD, (ClientListEntry *) NULL, STACK_NORMAL); } else if ((stackMode == Below) || (stackMode == BottomIf)) { Do_Lower (pCD, (ClientListEntry *) NULL, STACK_NORMAL); } else if (stackMode == Opposite) { F_Raise_Lower (NULL, pCD, (XEvent *) configureRequest); } } /* !!! should a synthetic ConfigureNotify be sent? !!! */ if ((configureRequest->window == pCD->client) && !(mask & (CWX | CWY | CWWidth | CWHeight | CWBorderWidth))) { SendConfigureNotify (pCD); } } } /* END OF FUNCTION HandleCConfigureRequest */ /*************************************<->************************************* * * HandleCColormapNotify (pCD, colorEvent) * * * Description: * ----------- * This function does window management actions associated with a colormap * notify event on the client window. * * * Inputs: * ------ * pCD = pointer to client data * * colorEvent = a ColormapNotify event * *************************************<->***********************************/ void HandleCColormapNotify (ClientData *pCD, XColormapEvent *colorEvent) { int i; #ifndef IBM_169380 ClientData **cmap_window_data; #endif Boolean newClientColormap = False; /* * The colormap of the top-level client window or one of its subwindows * has been changed. */ if (colorEvent->new) { /* * The colormap has been changed. */ /* * !!! when the server ColormapNotify problem is fixed !!! * !!! use the colormap id from the event !!! */ if (WmGetWindowAttributes (colorEvent->window)) { colorEvent->colormap = wmGD.windowAttributes.colormap; } else { return; } /* * !!! remove the above code when the problem is fixed !!! */ /* * Identify the colormap that the window manager has associated * with the window. */ #ifndef IBM_169380 if ((pCD->clientCmapCount == 0) && (colorEvent->window == pCD->client)) #endif if (pCD->clientCmapCount == 0) { /* no subwindow colormaps; change top-level window colormap */ #ifdef IBM_169380 if (colorEvent->window == pCD->client) { #endif if (colorEvent->colormap == None) { /* use the workspace colormap */ pCD->clientColormap = ACTIVE_PSD->workspaceColormap; } else { pCD->clientColormap = colorEvent->colormap; } newClientColormap = True; #ifdef IBM_169380 } #endif } #ifndef IBM_169380 if (!XFindContext (DISPLAY, colorEvent->window, wmGD.cmapWindowContextType, (caddr_t *)&cmap_window_data)) { /* * The WM_COLORMAP_WINDOWS property of a toplevel window may * specify colorEvent->window. If so, we must update the * colormap information it holds in clientCmapList. */ ClientData *any_pCD; int j; for (j = 0; cmap_window_data[j] != NULL; j++) { any_pCD = cmap_window_data[j]; for (i = 0; i < any_pCD->clientCmapCount; i++) { if (any_pCD->cmapWindows[i] == colorEvent->window) { if (colorEvent->colormap == None) { /* use the workspace colormap */ any_pCD->clientCmapList[i] = ACTIVE_PSD->workspaceColormap; } else { any_pCD->clientCmapList[i] = colorEvent->colormap; } if (i == any_pCD->clientCmapIndex) { any_pCD->clientColormap = any_pCD->clientCmapList[i]; if (any_pCD == pCD) { newClientColormap = True; } } break; } } } } #else else { /* there are subwindow colormaps */ for (i = 0; i < pCD->clientCmapCount; i++) { if (pCD->cmapWindows[i] == colorEvent->window) { if (colorEvent->colormap == None) { /* use the workspace colormap */ pCD->clientCmapList[i] = ACTIVE_PSD->workspaceColormap; } else { pCD->clientCmapList[i] = colorEvent->colormap; } if (i == pCD->clientCmapIndex) { newClientColormap = True; pCD->clientColormap = pCD->clientCmapList[i]; } break; } } } #endif /* IBM_169380 */ if ((ACTIVE_PSD->colormapFocus == pCD) && newClientColormap && ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE))) { /* * The client window has the colormap focus, install the * colormap. */ WmInstallColormap (ACTIVE_PSD, pCD->clientColormap); } } } /* END OF FUNCTION HandleCColormapNotify */ /*************************************<->************************************* * * HandleClientMessage (pCD, clientEvent) * * * Description: * ----------- * This function handles client message events that are sent to the root * window. The window manager action that is taken depends on the * message_type of the event. * * * Inputs: * ------ * pCD = pointer to client data * * clientEvent = pointer to a client message event on the root window * *************************************<->***********************************/ void HandleClientMessage (ClientData *pCD, XClientMessageEvent *clientEvent) { unsigned int newState = 0; /* * Process the client message event based on the message_type. */ if (clientEvent->message_type == wmGD.xa_WM_CHANGE_STATE) { if ((clientEvent->data.l[0] == IconicState) && (pCD->clientFunctions & MWM_FUNC_MINIMIZE)) { newState = MINIMIZED_STATE; } else if (clientEvent->data.l[0] == NormalState) { newState = NORMAL_STATE; } #ifdef WSM if (!ClientInWorkspace (ACTIVE_WS, pCD)) { newState |= UNSEEN_STATE; } #endif /* WSM */ SetClientState (pCD, newState, GetTimestamp ()); } } /* END OF FUNCTION HandleClientMessage */ #ifndef NO_SHAPE /*************************************<->************************************* * * HandleCShapeNotify (pCD, shapeEvent) * * * Description: * ----------- * Handle a shape notify event on a client window. Keeps track of * the shaped state of the client window and calls * SetFrameShape() to reshape the frame accordingly. * * Inputs: * ------ * shapeEvent = pointer to a shape notify in event on the client window. * *************************************<->***********************************/ void HandleCShapeNotify (ClientData *pCD, XShapeEvent *shapeEvent) { if (pCD) { if (shapeEvent->kind != ShapeBounding) { return; } pCD->wShaped = shapeEvent->shaped; SetFrameShape (pCD); } } /* END OF FUNCTION HandleCShapeNotify */ #endif /* NO_SHAPE */ /*************************************<->************************************* * * GetParentWindow (window) * * * Description: * ----------- * This function identifies the parent window of the specified window. * * * Inputs: * ------ * window = find the parent of this window * * Outputs: * ------- * Return = return the window id of the parent of the specified window * *************************************<->***********************************/ Window GetParentWindow (Window window) { Window root; Window parent; Window *children; unsigned int nchildren; if (XQueryTree (DISPLAY, window, &root, &parent, &children, &nchildren)) { if (nchildren) { XFree ((char *)children); } } else { parent = (Window)0L; } return (parent); } /* END OF FUNCTION GetParentWindow */ /*************************************<->************************************* * * DetermineActiveScreen (pEvent) * * * Description: * ----------- * This function determines the currently active screen * * * Inputs: * ------ * pEvent = pointer to an event structure * * Outputs: * ------- * ACTIVE_PSD = set to point to the screen data for the currently * active scree; * wmGD.queryScreen = set to False if we're sure about the ACTIVE_PSD * setting * *************************************<->***********************************/ void DetermineActiveScreen (XEvent *pEvent) { WmScreenData *pSD; switch (pEvent->type) { case NoExpose: case GraphicsExpose: break; /* ignore these events */ default: /* * Get the screen that the event occurred on. */ pSD = GetScreenForWindow (pEvent->xany.window); if (pSD) { /* * Set the ACTIVE_PSD to the event's screen to * make sure the event gets handled correctly. */ SetActiveScreen (pSD); } break; } } /* END OF FUNCTION DetermineActiveScreen */ /*************************************<->************************************* * * GetScreenForWindow (win) * * * Description: * ----------- * This function determines the screen for a window * * * Inputs: * ------ * win = window id * * Outputs: * ------- * value of function = pointer to screen data (pSD) or NULL on failure * *************************************<->***********************************/ WmScreenData * GetScreenForWindow (win) Window win; { XWindowAttributes attribs; WmScreenData *pSD = NULL; /* * Get the screen that the event occurred on. */ if (XGetWindowAttributes (DISPLAY, win, &attribs)) { if (!XFindContext (DISPLAY, attribs.root, wmGD.screenContextType, (caddr_t *)&pSD)) { if (pSD && !pSD->screenTopLevelW) { pSD = NULL; } } } return (pSD); } /* END OF FUNCTION GetScreenForWindow */ motif-2.3.8/clients/mwm/WmCmd.c0000644000175000017500000017662313145162623013221 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "./WmWsmLib/utm_send.h" #include "./WmWsmLib/wsm_proto.h" #include "WmGlobal.h" #include "WmFunction.h" #include "WmCmd.h" #include "WmMenu.h" #include "WmResParse.h" #include "WmWsm.h" #include "WmDebug.h" #include "WmWinConf.h" #include "WmFeedback.h" #define MAX_CLIENT_CMDS 1000 static CARD32 cmdKillList[MAX_CLIENT_CMDS]; static unsigned long cmdKillListIndex; #define ScrNum(w) (XScreenNumberOfScreen(XtScreen(w))) #define CCI_TREE(w) (wmGD.Screens[ScrNum(w)].cciTree) #define CCI_TREE_OF_SCR(scr) (wmGD.Screens[(scr)].cciTree) /*----------------------------------------------------------------------* | NewCommand | *----------------------------------------------------------------------*/ CmdTree * NewCommand ( CARD32 commandID, CARD32 notifyWindow, char *name, char *defaultName) { CmdTree *ptr = (CmdTree *) XtMalloc(sizeof(CmdTree)); ptr->commandID = commandID; ptr->notifyWindow = notifyWindow; if (name != NULL) ptr->name = XtNewString(name); else ptr->name = XtNewString(""); if (defaultName != NULL) ptr->defaultName = XtNewString(defaultName); else ptr->defaultName = NULL; ptr->subTrees = NULL; ptr->next = NULL; return(ptr); } /*---------------------------------------------------------------------------* | FindCmd | *---------------------------------------------------------------------------*/ CmdTree * FindCmd( CARD32 commandID, CmdTree *menuTree) { CmdTree *pCmd; if (menuTree != NULL) PRINT("-> %s\n", menuTree->name); if (menuTree == NULL) { PRINT("<- NULL\n"); return(NULL); } if (menuTree->commandID == commandID) { PRINT("<- %d, %s\n", commandID, menuTree->name); return(menuTree); } if ((pCmd = FindCmd(commandID, menuTree->next)) != NULL) return(pCmd); return(FindCmd(commandID, menuTree->subTrees)); } /*---------------------------------------------------------------------------* | FindDuplicateName | | Scan through commandTree for another defined command with the same name. | | Once found, return the ID of the duplicate. Note that at most one match | | can be found. If no match is found, 0 is returned. This should NEVER be | | the value of a command defined by a client. | *---------------------------------------------------------------------------*/ CARD32 FindDuplicateName( CmdTree *menuTree, char *name) { CmdTree *tmp; CARD32 duplicateID; if (menuTree == NULL) return(0); else if ((menuTree->name != NULL) && (strcmp(menuTree->name, name) == 0)) return(menuTree->commandID); else if ((duplicateID = FindDuplicateName(menuTree->subTrees, name)) != 0) return(duplicateID); else return(FindDuplicateName(menuTree->next, name)); } /*----------------------------------------------------------------------* | AddCommand | | Returns true if the commandSet was found and a new command was added.| | Note that toplevel commands have 0 as their commandSet. This will | | always match the top entry in the command tree since it is 0. | *----------------------------------------------------------------------*/ Boolean AddCommand ( int scr, CARD32 commandSet, CARD32 commandID, CARD32 notifyWindow, char *name, char *defaultName, CmdTree *ptr) { /* * For each subtree of the cmdtree, look for the commandset. * If found, add the element there else keep looking. */ CmdTree *tmp; CARD32 duplicateID; if (ptr == NULL) return (False); else if (ptr->commandID == commandSet) /* FOUND IT */ { if ((duplicateID = FindDuplicateName(CCI_TREE_OF_SCR(scr), name)) != 0) { /* a duplicate menu item already exists here, remove it first. */ if (ptr->subTrees != NULL) DestroyMenuSpec (&(wmGD.Screens[scr]), commandID); DeleteCommand(commandID, &CCI_TREE_OF_SCR(scr)); } tmp = ptr->subTrees; ptr->subTrees = NewCommand(commandID, notifyWindow, name, defaultName); ptr->subTrees->next = tmp; return(True); } else { Boolean found; found = AddCommand(scr, commandSet, commandID, notifyWindow, name, defaultName, ptr->next); if (!found) found = AddCommand(scr, commandSet, commandID, notifyWindow, name, defaultName, ptr->subTrees); return (found); } } /*---------------------------------------------------------------------------* | RemoveCommandBranch | | This routine all commands at the specified node in the command tree. | *---------------------------------------------------------------------------*/ void RemoveCommandBranch (CmdTree *menuTree) { CmdTree *tmp = menuTree; while (menuTree != NULL) { if (menuTree->subTrees != (CmdTree*)NULL) RemoveCommandBranch(menuTree->subTrees); menuTree = menuTree->next; if (tmp->name != NULL) XtFree((char*)tmp->name); XtFree((char*)tmp); } } /*---------------------------------------------------------------------------* | DeleteCommand | | This routine deletes any matching command entries in the Command Tree. | *---------------------------------------------------------------------------*/ void DeleteCommand ( long commandID, CmdTree **pmenuTree) { if ((pmenuTree == NULL) || (*pmenuTree == NULL)) return; else { CmdTree *tmp = *pmenuTree; CmdTree *prev = NULL; while (tmp != (CmdTree *)NULL) if (tmp->commandID == commandID) { RemoveCommandBranch(tmp->subTrees); /* remove all sub-commands. */ if (prev == (CmdTree *)NULL) *pmenuTree = tmp->next; else prev->next = tmp->next; if (tmp->name != NULL) XtFree((char*)tmp->name); XtFree((char *)tmp); tmp = prev; } else { if (tmp->subTrees != (CmdTree *)NULL) DeleteCommand(commandID, &tmp->subTrees); prev = tmp; tmp = tmp->next; } } } /*----------------------------------------------------------------------* | DefineCommand | | hack version - restriction: no spaces allowed in names. | *----------------------------------------------------------------------*/ /*ARGSUSED*/ void DefineCommand ( Widget w, Atom target, MessageData data, unsigned long len, int fmt) { CARD32 commandID, commandSet, selection, duplicateID; String name, defaultLabel; Boolean found = False; Window owner; XWindowAttributes attr; /* * check data to make sure somethings there. */ if ((data == NULL) || (len == 0)) { PRINT("Bad data passed to DefineCommand.\n"); return; } commandID = UnpackCARD32(&data); selection = UnpackCARD32(&data); /* selection to use for invoke cmd */ commandSet = UnpackCARD32(&data); name = UnpackString(&data); defaultLabel = UnpackString(&data); PRINT("Define command: %d, %d, '%s', '%s'\n", commandID, commandSet, name, defaultLabel); /* * Add command to menu structure. */ if (CCI_TREE(w) == NULL) { CCI_TREE(w) = NewCommand(0, 0, NULL, NULL); } if (commandSet != 0) { found = AddCommand(ScrNum(w), commandSet, commandID, selection, name, defaultLabel, CCI_TREE(w)); } else /* * A leaf is being added to the command tree. There should not * be any other entries with the same name since matching with * the mwm resource file is done on names. If a duplicate is * found, remove it first and any menu spec if it is a command * set. */ if ((duplicateID = FindDuplicateName(CCI_TREE(w), name)) != 0) { /* a duplicate menu item already exists here, remove it first. */ DestroyMenuSpec (&(wmGD.Screens[ScrNum(w)]), duplicateID); DeleteCommand(duplicateID, &CCI_TREE(w)); } if (!found || commandSet == 0) { CmdTree *tmp; tmp = NewCommand(commandID, selection, name, defaultLabel); tmp->next = CCI_TREE(w)->next; CCI_TREE(w)->next = tmp; } } /*----------------------------------------------------------------------* | IncludeCommand | *----------------------------------------------------------------------*/ /*ARGSUSED*/ void IncludeCommand ( Widget w, Atom target, MessageData data, unsigned long len, int fmt) { CARD32 inLine, commandID, selection, count; Window *windowIDs = NULL; CmdTree *tPtr, *pNext; int i, win; unsigned long activeContext = 0L; /* * check data to make sure somethings there. */ if ((data == NULL) || (len == 0)) { PRINT("Bad data passed to IncludeCommand.\n"); return; } inLine = UnpackCARD32(&data); commandID = UnpackCARD32(&data); selection = UnpackCARD32(&data); count = UnpackCARD32(&data); if (count > 0) windowIDs = (Window *) XtMalloc(sizeof(Window)*count); for (win=0; winnext; tPtr->next = NULL; InsertTreeOnRootMenu(ACTIVE_PSD, tPtr, selection, inLine); tPtr->next = pNext; } ShowWaitState (FALSE); } /* * Insert on all clients */ else if ((windowIDs[0] & WINDOW_MASK) == ALL_WINDOWS) { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { ShowWaitState (TRUE); activeContext = 0L; if (windowIDs[0] & ICON_ONLY) activeContext |= F_CONTEXT_ICON; if (windowIDs[0] & WINDOW_ONLY) activeContext |= F_CONTEXT_WINDOW; pNext = tPtr->next; tPtr->next = NULL; InsertTreeOnAllClients (ACTIVE_PSD, tPtr, selection, activeContext, inLine); tPtr->next = pNext; PRINT("Inserted commandID %d on all windows.\n", commandID); ShowWaitState (FALSE); } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Insert on specified clients */ else { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { ShowWaitState (TRUE); for (i=0; inext; tPtr->next = NULL; InsertTreeOnSingleClient (pCD->pSD, pCD, tPtr, selection, activeContext, inLine); tPtr->next = pNext; } } ShowWaitState (FALSE); } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } if (count > 0) XtFree((char*)windowIDs); } /*----------------------------------------------------------------------* | EnableCommand | *----------------------------------------------------------------------*/ /*ARGSUSED*/ void EnableCommand ( Widget w, Atom target, MessageData data, unsigned long len, int fmt) { CARD32 commandID, count; Window *windowIDs = NULL; CmdTree *tPtr, *pNext; int i, win; unsigned long activeContext = 0L; /* * check data to make sure somethings there. */ if ((data == NULL) || (len == 0)) { PRINT("Bad data passed to EnableCommand.\n"); return; } commandID = UnpackCARD32(&data); count = UnpackCARD32(&data); if (count > 0) windowIDs = (Window *) XtMalloc(sizeof(Window)*count); for (win=0; winnext; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ROOT, tPtr, ENABLE, activeContext, NULL); tPtr->next = pNext; } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Enable on all clients */ else if ((windowIDs[0] & WINDOW_MASK) == ALL_WINDOWS) { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { activeContext = 0L; if (windowIDs[0] & ICON_ONLY) activeContext |= F_CONTEXT_ICON; if (windowIDs[0] & WINDOW_ONLY) activeContext |= F_CONTEXT_WINDOW; pNext = tPtr->next; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ALL, tPtr, ENABLE, activeContext, NULL); tPtr->next = pNext; PRINT("Enabled commandID %d on all windows.\n", commandID); } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Enable on specified clients */ else { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { for (i=0; inext; tPtr->next = NULL; ModifyClientCommandTree (pCD->pSD, pCD, SINGLE, tPtr, ENABLE, activeContext, NULL); tPtr->next = pNext; } } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } if (count > 0) XtFree((char*)windowIDs); } /*----------------------------------------------------------------------* | DisableCommand | *----------------------------------------------------------------------*/ /*ARGSUSED*/ void DisableCommand ( Widget w, Atom target, MessageData data, unsigned long len, int fmt) { CARD32 commandID, count; Window *windowIDs = NULL; CmdTree *tPtr, *pNext; int i, win; unsigned long activeContext = 0L; /* * check data to make sure somethings there. */ if ((data == NULL) || (len == 0)) { PRINT("Bad data passed to DisableCommand.\n"); return; } commandID = UnpackCARD32(&data); count = UnpackCARD32(&data); if (count > 0) windowIDs = (Window *) XtMalloc(sizeof(Window)*count); for (win=0; winnext; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ROOT, tPtr, DISABLE, activeContext, NULL); tPtr->next = pNext; } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Disable on all clients */ else if ((windowIDs[0] & WINDOW_MASK) == ALL_WINDOWS) { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { activeContext = 0L; if (windowIDs[0] & ICON_ONLY) activeContext |= F_CONTEXT_ICON; if (windowIDs[0] & WINDOW_ONLY) activeContext |= F_CONTEXT_WINDOW; pNext = tPtr->next; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ALL, tPtr, DISABLE, activeContext, NULL); tPtr->next = pNext; PRINT("Disabled commandID %d on all windows.\n", commandID); } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Disable on specified clients */ else { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { for (i=0; inext; tPtr->next = NULL; ModifyClientCommandTree (pCD->pSD, pCD, SINGLE, tPtr, DISABLE, activeContext, NULL); tPtr->next = pNext; } } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } if (count > 0) XtFree((char*)windowIDs); } /*----------------------------------------------------------------------* | RenameCommand | *----------------------------------------------------------------------*/ /*ARGSUSED*/ void RenameCommand ( Widget w, Atom target, MessageData data, unsigned long len, int fmt) { CARD32 commandID, count; Window *windowIDs = NULL; CmdTree *tPtr, *pNext; int i, win; unsigned long activeContext = 0L; String newname; /* * check data to make sure somethings there. */ if ((data == NULL) || (len == 0)) { PRINT("Bad data passed to RenameCommand.\n"); return; } commandID = UnpackCARD32(&data); newname = UnpackString(&data); count = UnpackCARD32(&data); if (count > 0) windowIDs = (Window *) XtMalloc(sizeof(Window)*count); for (win=0; winnext; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ROOT, tPtr, RENAME, activeContext, newname); tPtr->next = pNext; } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Rename on all clients */ else if ((windowIDs[0] & WINDOW_MASK) == ALL_WINDOWS) { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { activeContext = 0L; if (windowIDs[0] & ICON_ONLY) activeContext |= F_CONTEXT_ICON; if (windowIDs[0] & WINDOW_ONLY) activeContext |= F_CONTEXT_WINDOW; pNext = tPtr->next; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ALL, tPtr, RENAME, activeContext, newname); tPtr->next = pNext; PRINT("Renamed commandID %d on all windows.\n", commandID); } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Rename on specified clients */ else { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { for (i=0; inext; tPtr->next = NULL; ModifyClientCommandTree (pCD->pSD, pCD, SINGLE, tPtr, RENAME, activeContext, newname); tPtr->next = pNext; } } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } if (count > 0) XtFree((char*)windowIDs); } /*----------------------------------------------------------------------* | RemoveCommand | *----------------------------------------------------------------------*/ /*ARGSUSED*/ void RemoveCommand ( Widget w, Atom target, MessageData data, unsigned long len, int fmt) { CARD32 commandID, count; Window *windowIDs = NULL; CmdTree *tPtr, *pNext; int i, win; unsigned long activeContext = 0L; /* * check data to make sure somethings there. */ if ((data == NULL) || (len == 0)) { PRINT("Bad data passed to RemoveCommand.\n"); return; } commandID = UnpackCARD32(&data); count = UnpackCARD32(&data); if (count > 0) windowIDs = (Window *) XtMalloc(sizeof(Window)*count); for (win=0; winnext; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ROOT, tPtr, REMOVE, activeContext, NULL); tPtr->next = pNext; } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Remove on all clients */ else if ((windowIDs[0] & WINDOW_MASK) == ALL_WINDOWS) { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { activeContext = 0L; if (windowIDs[0] & ICON_ONLY) activeContext |= F_CONTEXT_ICON; if (windowIDs[0] & WINDOW_ONLY) activeContext |= F_CONTEXT_WINDOW; pNext = tPtr->next; tPtr->next = NULL; ModifyClientCommandTree (ACTIVE_PSD, NULL, ALL, tPtr, REMOVE, activeContext, NULL); tPtr->next = pNext; PRINT("Removed commandID %d on all windows.\n", commandID); } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } /* * Remove on specified clients */ else { tPtr = FindCmd (commandID, CCI_TREE(w)); if (tPtr != NULL) { for (i=0; inext; tPtr->next = NULL; ModifyClientCommandTree (pCD->pSD, pCD, SINGLE, tPtr, REMOVE, activeContext, NULL); tPtr->next = pNext; } } } else PRINT("ERROR - commandID %d not found in command tree.\n", commandID); } if (count > 0) XtFree((char*)windowIDs); } /*---------------------------------------------------------------------------* | RemoveMatchingCommands | | Recursively removes commands that match a given window in the specified | | command tree. | *---------------------------------------------------------------------------*/ /*ARGSUSED*/ void RemoveMatchingCommands ( int scr, Window clientWindow, CmdTree *tree) { if (tree == NULL) return; if (tree->subTrees != NULL) RemoveMatchingCommands(scr, clientWindow, tree->subTrees); if (tree->notifyWindow == clientWindow) { cmdKillList[ cmdKillListIndex++ ] = tree->commandID; } if (tree->next != NULL) RemoveMatchingCommands(scr, clientWindow, tree->next); } /*---------------------------------------------------------------------------* | RemoveCommandsForClient | | This function will remove any command that was inserted by this client. | *---------------------------------------------------------------------------*/ void RemoveCommandsForClient ( int scr, Window clientWindow) { int i; ShowWaitState (TRUE); cmdKillListIndex = 0; RemoveMatchingCommands(scr, clientWindow, CCI_TREE_OF_SCR(scr)); /* * Remove any matching commands on the root menu. */ for (i = 0; i < cmdKillListIndex; i++) { CmdTree *tPtr, *pNext; MenuSpec *pMS; WmScreenData *pSD = ACTIVE_PSD; while ((tPtr = FindCmd (cmdKillList[ i ], CCI_TREE_OF_SCR(scr)))) { /* make sure ModifyClientCommandTree can't muck with cmdTree. */ pNext = tPtr->next; tPtr->next = NULL; ModifyClientCommandTree (pSD, NULL, ALL, tPtr, REMOVE, F_CONTEXT_ALL, NULL); /* restore tree. */ tPtr->next = pNext; /* * if this command caused a menu spec to be created, remove it. */ DestroyMenuSpec(pSD, cmdKillList[i]); /* * Now delete the matching entry in the command tree. */ DeleteCommand(cmdKillList[ i ], &CCI_TREE_OF_SCR(scr)); } } ShowWaitState (FALSE); } /*---------------------------------------------------------------------------* | InvokeMessageReply | *---------------------------------------------------------------------------*/ /*ARGSUSED*/ void InvokeMessageReply (Widget w, XtPointer clientData, XtPointer callData) { PRINT("Invoke message reply received.\n"); } /*---------------------------------------------------------------------------* | SendInvokeMessage | | Send a convert request to the client that owns the menu command. | *---------------------------------------------------------------------------*/ void SendInvokeMessage ( CARD32 commandID, CARD32 clientWindow, Atom selection, Time time) { MessageData msg, fulldata; unsigned long size; size = (unsigned long)(sizeof(CARD32) + sizeof(CARD32)); msg = fulldata = (MessageData)XtMalloc(sizeof(CARD8) * size); msg = PackCARD32(msg, commandID); msg = PackCARD32(msg, clientWindow); UTMSendMessage(ACTIVE_PSD->utmShell, selection, wmGD._MOTIF_WM_INVOKE_COMMAND, (XtPointer)fulldata, size, WSM_PROTO_FMT, InvokeMessageReply, NULL, /* no client data */ time); } /*----------------------------------------------------------------------* | CopyMwmGadget *----------------------------------------------------------------------*/ static void CopyMwmGadget(GadgetRectangle *mwm_gadget, GadgetRectangle *auto_gadget) { auto_gadget->id = mwm_gadget->id; auto_gadget->rect.x = mwm_gadget->rect.x; auto_gadget->rect.y = mwm_gadget->rect.y; auto_gadget->rect.width = mwm_gadget->rect.width; auto_gadget->rect.height = mwm_gadget->rect.height; } /*----------------------------------------------------------------------* | FillInvalidInfo *----------------------------------------------------------------------*/ static void FillInvalidInfo(GadgetRectangle *auto_gadget) { auto_gadget->id = INVALID; auto_gadget->rect.x = auto_gadget->rect.y = auto_gadget->rect.width = auto_gadget->rect.height = INVALID; } /*----------------------------------------------------------------------* | GetMinimizeInfo *----------------------------------------------------------------------*/ static void GetMinimizeInfo(ClientData *pcd, XtPointer reply) { /* * This function packs data about the minimize button in the following * order : 1. gadget count 2. id 3. x position 4. y position 5. width * 6. height */ GadgetRectangle minimize_button; CARD32 filledCount; int i; Window frameWin; Boolean minFound = False; filledCount = pcd->cTitleGadgets; frameWin = pcd->clientFrameWin; for (i=0; i < filledCount; i++) if (pcd->pTitleGadgets[i].id == FRAME_MINIMIZE) { CopyMwmGadget (&(pcd->pTitleGadgets[i]), &minimize_button); minFound = True; } if (minFound == False) FillInvalidInfo (&minimize_button); reply = PackCARD32 (reply, (CARD32)filledCount); reply = PackCARD32(reply, (CARD32)minimize_button.id); reply = PackCARD32 (reply, (CARD32)minimize_button.rect.x); reply = PackCARD32 (reply, (CARD32)minimize_button.rect.y); reply = PackCARD32 (reply, (CARD32)minimize_button.rect.width); reply = PackCARD32 (reply, (CARD32)minimize_button.rect.height); reply = PackCARD32 (reply, (CARD32)frameWin); } /*----------------------------------------------------------------------* | GetMaximizeInfo *----------------------------------------------------------------------*/ static void GetMaximizeInfo(ClientData *pcd, XtPointer reply) { /* * This function packs data about the maximize button in the following * order : 1. gadget count 2. id 3. x position 4. y position 5. width * 6. height 7. event window */ int i; GadgetRectangle maximize_button; CARD32 filledCount; Window frameWin; Boolean maxFound = False; filledCount = pcd->cTitleGadgets; frameWin = pcd->clientFrameWin; for (i=0; i < filledCount; i++) { if (pcd->pTitleGadgets[i].id == FRAME_MAXIMIZE) { CopyMwmGadget (&(pcd->pTitleGadgets[i]),&maximize_button); maxFound = True; } } if (maxFound == False) FillInvalidInfo (&maximize_button); reply = PackCARD32 (reply, (CARD32)filledCount); reply = PackCARD32 (reply, (CARD32)maximize_button.id); reply = PackCARD32 (reply, (CARD32)maximize_button.rect.x); reply = PackCARD32 (reply, (CARD32)maximize_button.rect.y); reply = PackCARD32 (reply, (CARD32)maximize_button.rect.width); reply = PackCARD32 (reply, (CARD32)maximize_button.rect.height); reply = PackCARD32 (reply, (CARD32)frameWin); } /*----------------------------------------------------------------------* | GetIconInfo *----------------------------------------------------------------------*/ static void GetIconInfo(ClientData *pcd, XtPointer reply, Boolean use_icon_box) { IconBoxData *icon_box; XmScrollBarWidget hScrollBar, vScrollBar; Widget frameWidget, scrollWidget, shellWidget; CARD32 iconX, iconY, iconWidth, iconHeight ; CARD32 hMin, hMax, hSliderAreaWidth, hSliderX, hSliderAreaX, vMin, vMax, vSliderAreaHeight, vSliderY, vSliderAreaY; CARD32 rightArrowX, rightArrowY, leftArrowX, leftArrowY, topArrowX, topArrowY, bottomArrowX, bottomArrowY; CARD32 iconBoxX, iconBoxY, iconBoxWidth, iconBoxHeight; Window frameWin, scrollWin, hScrollWin, vScrollWin, iconShellWin, iconFrameWin; CARD32 lastRow, lastCol; CARD32 iPlaceW, iPlaceH; CARD32 useIconBox; icon_box = pcd->pIconBox; useIconBox = pcd->pSD->useIconBox; /* * IconBox info */ if (use_icon_box == True) { hScrollBar = (XmScrollBarWidget)icon_box->hScrollBar; hMin = hScrollBar->scrollBar.minimum; hMax = hScrollBar->scrollBar.maximum; hSliderAreaWidth = hScrollBar->scrollBar.slider_area_width; hSliderX = hScrollBar->scrollBar.slider_x; hSliderAreaX = hScrollBar->scrollBar.slider_area_x; leftArrowX = hScrollBar->core.x + hScrollBar->scrollBar.arrow1_x + (hScrollBar->scrollBar.arrow_width/2); leftArrowY = hScrollBar->core.y + hScrollBar->scrollBar.arrow1_y + (hScrollBar->scrollBar.arrow_height/2); rightArrowX = hScrollBar->core.x + hScrollBar->scrollBar.arrow2_x + (hScrollBar->scrollBar.arrow_width/2); rightArrowY = hScrollBar->core.y + hScrollBar->scrollBar.arrow2_y + (hScrollBar->scrollBar.arrow_height/2); vScrollBar = (XmScrollBarWidget)icon_box->vScrollBar; vMin = vScrollBar->scrollBar.minimum; vMax = vScrollBar->scrollBar.maximum; vSliderAreaHeight = vScrollBar->scrollBar.slider_area_height; vSliderY = vScrollBar->scrollBar.slider_y; vSliderAreaY = vScrollBar->scrollBar.slider_area_y; topArrowX = vScrollBar->core.x + vScrollBar->scrollBar.arrow1_x + (vScrollBar->scrollBar.arrow_width/2); topArrowY = vScrollBar->core.y + vScrollBar->scrollBar.arrow1_y + (vScrollBar->scrollBar.arrow_height/2); bottomArrowX = vScrollBar->core.x + vScrollBar->scrollBar.arrow2_x + (vScrollBar->scrollBar.arrow_width/2); bottomArrowY = hScrollBar->core.y + hScrollBar->scrollBar.arrow2_y + (hScrollBar->scrollBar.arrow_height/2); shellWidget = icon_box->shellWidget; iconBoxX = shellWidget->core.x; iconBoxY = shellWidget->core.y; iconBoxWidth = shellWidget->core.width; iconBoxHeight = shellWidget->core.height; iconShellWin = XtWindow (shellWidget); frameWidget = icon_box->frameWidget; frameWin = XtWindow (frameWidget); scrollWidget = icon_box->scrolledWidget; scrollWin = XtWindow (scrollWidget); hScrollWin = XtWindow (hScrollBar); vScrollWin = XtWindow (vScrollBar); lastCol = icon_box->lastCol; lastRow = icon_box->lastRow; iPlaceW = icon_box->IPD.iPlaceW; iPlaceH = icon_box->IPD.iPlaceH; } /* * icon info */ iconX = pcd->iconX; iconY = pcd->iconY; iconWidth = pcd->pSD->iconWidth; iconHeight = pcd->pSD->iconHeight; iconFrameWin = pcd->iconFrameWin; reply = PackCARD32 (reply,(CARD32)useIconBox); reply = PackCARD32 (reply,(CARD32)iconX); reply = PackCARD32 (reply,(CARD32)iconY); reply = PackCARD32 (reply,(CARD32)iconWidth); reply = PackCARD32 (reply,(CARD32)iconHeight); reply = PackCARD32 (reply,(CARD32)iconFrameWin); if (use_icon_box == True) { reply = PackCARD32 (reply,(CARD32)hMin); reply = PackCARD32 (reply,(CARD32)hMax); reply = PackCARD32 (reply,(CARD32)hSliderAreaWidth); reply = PackCARD32 (reply,(CARD32)hSliderX); reply = PackCARD32 (reply,(CARD32)hSliderAreaX); reply = PackCARD32 (reply,(CARD32)vMin); reply = PackCARD32 (reply,(CARD32)vMax); reply = PackCARD32 (reply,(CARD32)vSliderAreaHeight); reply = PackCARD32 (reply,(CARD32)vSliderY); reply = PackCARD32 (reply,(CARD32)vSliderAreaY); reply = PackCARD32 (reply,(CARD32)rightArrowX); reply = PackCARD32 (reply,(CARD32)rightArrowY); reply = PackCARD32 (reply,(CARD32)leftArrowX); reply = PackCARD32 (reply,(CARD32)leftArrowY); reply = PackCARD32 (reply,(CARD32)topArrowX); reply = PackCARD32 (reply,(CARD32)topArrowY); reply = PackCARD32 (reply,(CARD32)bottomArrowX); reply = PackCARD32 (reply,(CARD32)bottomArrowY); reply = PackCARD32 (reply,(CARD32)iconBoxX); reply = PackCARD32 (reply,(CARD32)iconBoxY); reply = PackCARD32 (reply,(CARD32)iconBoxWidth); reply = PackCARD32 (reply,(CARD32)iconBoxHeight); reply = PackCARD32 (reply,(CARD32)iconShellWin); reply = PackCARD32 (reply,(CARD32)frameWin); reply = PackCARD32 (reply,(CARD32)scrollWin); reply = PackCARD32 (reply,(CARD32)hScrollWin); reply = PackCARD32 (reply,(CARD32)vScrollWin); reply = PackCARD32 (reply,(CARD32)lastCol); reply = PackCARD32 (reply,(CARD32)lastRow); reply = PackCARD32 (reply,(CARD32)iPlaceH); reply = PackCARD32 (reply,(CARD32)iPlaceW); } } /*----------------------------------------------------------------------* | GetMoveInfo *----------------------------------------------------------------------*/ static void GetMoveInfo(ClientData *pcd, XtPointer reply) { int i; GadgetRectangle title; GadgetRectangle menu; CARD32 filledCount; CARD32 upperBorderWidth, lowerBorderWidth; CARD32 windowX, windowY; Window frameWin; Boolean titleFound = False; Boolean system_found = False; filledCount = pcd->cTitleGadgets; upperBorderWidth = pcd->frameInfo.upperBorderWidth; lowerBorderWidth = pcd->frameInfo.lowerBorderWidth; windowX = pcd->clientX; windowY = pcd->clientY; frameWin = pcd->clientFrameWin; for (i=0; i < filledCount; i++) { if (pcd->pTitleGadgets[i].id == FRAME_TITLE) { CopyMwmGadget (&(pcd->pTitleGadgets[i]), &title); titleFound = True; } if (pcd->pTitleGadgets[i].id == FRAME_SYSTEM) { CopyMwmGadget (&(pcd->pTitleGadgets[i]), &menu); system_found = True; } } if (titleFound == False) FillInvalidInfo (&title); if (system_found == False) FillInvalidInfo (&menu); reply = PackCARD32 (reply, (CARD32)filledCount); reply = PackCARD32 (reply, (CARD32)title.id); reply = PackCARD32 (reply, (CARD32)title.rect.x); reply = PackCARD32 (reply, (CARD32)title.rect.y); reply = PackCARD32 (reply, (CARD32)title.rect.width); reply = PackCARD32 (reply, (CARD32)title.rect.height); reply = PackCARD32 (reply, (CARD32)menu.id); reply = PackCARD32 (reply, (CARD32)menu.rect.x); reply = PackCARD32 (reply, (CARD32)menu.rect.y); reply = PackCARD32 (reply, (CARD32)menu.rect.width); reply = PackCARD32 (reply, (CARD32)menu.rect.height); reply = PackCARD32 (reply, (CARD32)upperBorderWidth); reply = PackCARD32 (reply, (CARD32)lowerBorderWidth); reply = PackCARD32 (reply, (CARD32)windowX); reply = PackCARD32 (reply, (CARD32)windowY); reply = PackCARD32 (reply, (CARD32)frameWin); } /*----------------------------------------------------------------------* | GetResizeInfo *----------------------------------------------------------------------*/ static void GetResizeInfo(ClientData *pcd, XtPointer reply, int dir) { int i; GadgetRectangle east_resize = {0, {0, 0, 0, 0}}, west_resize = {0, {0, 0, 0, 0}}, gravity_resize, title; CARD32 upperBorderWidth, lowerBorderWidth; Window frameWin; int filledCount; Boolean titleFound = False; filledCount = pcd->cTitleGadgets; if (!(pcd->decor & MWM_DECOR_RESIZEH)) FillInvalidInfo (&gravity_resize); else { CopyMwmGadget (&pcd->pResizeGadgets[dir], &gravity_resize); CopyMwmGadget (&pcd->pResizeGadgets[WM_WEST], &west_resize); CopyMwmGadget (&pcd->pResizeGadgets[WM_EAST], &east_resize); } for (i=0; i < filledCount; i++) if (pcd->pTitleGadgets[i].id == FRAME_TITLE) { CopyMwmGadget (&(pcd->pTitleGadgets[i]), &title); titleFound = True; } if (titleFound == False) FillInvalidInfo (&title); upperBorderWidth = pcd->frameInfo.upperBorderWidth; lowerBorderWidth = pcd->frameInfo.lowerBorderWidth; frameWin = pcd->clientFrameWin; reply = PackCARD32 (reply, (CARD32)east_resize.id); reply = PackCARD32 (reply, (CARD32)east_resize.rect.width); reply = PackCARD32 (reply, (CARD32)west_resize.id); reply = PackCARD32 (reply, (CARD32)west_resize.rect.width); reply = PackCARD32 (reply, (CARD32)gravity_resize.id); reply = PackCARD32 (reply, (CARD32)gravity_resize.rect.x); reply = PackCARD32 (reply, (CARD32)gravity_resize.rect.y); reply = PackCARD32 (reply, (CARD32)gravity_resize.rect.width); reply = PackCARD32 (reply, (CARD32)gravity_resize.rect.height); reply = PackCARD32 (reply, (CARD32)title.id); reply = PackCARD32 (reply, (CARD32)title.rect.x); reply = PackCARD32 (reply, (CARD32)title.rect.y); reply = PackCARD32 (reply, (CARD32)title.rect.width); reply = PackCARD32 (reply, (CARD32)title.rect.height); reply = PackCARD32 (reply, (CARD32)upperBorderWidth); reply = PackCARD32 (reply, (CARD32)lowerBorderWidth); reply = PackCARD32 (reply, (CARD32)frameWin); } /*----------------------------------------------------------------------* | GetWindowMenuUnpostInfo *----------------------------------------------------------------------*/ static void GetWindowMenuUnpostInfo(ClientData *pcd, XtPointer reply) { MenuSpec *menuSpec; CARD32 clientState; CARD32 menuWin; CARD32 frameWin; menuSpec = pcd->systemMenuSpec; clientState = pcd->clientState; menuWin = XtWindow (menuSpec->menuWidget); frameWin = pcd->clientFrameWin; reply = PackCARD32 (reply,clientState); reply = PackCARD32 (reply,menuWin); reply = PackCARD32 (reply,frameWin); } /*----------------------------------------------------------------------* | GetFocusInfo *----------------------------------------------------------------------*/ static void GetFocusInfo(ClientData *pcd, XtPointer reply) { GadgetRectangle title; CARD32 filledCount; int i; Window frameWin; Boolean titleFound = False; filledCount = pcd->cTitleGadgets; frameWin = pcd->clientFrameWin; for (i=0; i < filledCount; i++) { if (pcd->pTitleGadgets[i].id == FRAME_TITLE) { CopyMwmGadget (&(pcd->pTitleGadgets[i]), &title); titleFound = True; } } if (titleFound == False) FillInvalidInfo (&title); reply = PackCARD32 (reply, (CARD32)filledCount); reply = PackCARD32(reply, (CARD32)title.id); reply = PackCARD32 (reply, (CARD32)title.rect.x); reply = PackCARD32 (reply, (CARD32)title.rect.y); reply = PackCARD32 (reply, (CARD32)title.rect.width); reply = PackCARD32 (reply, (CARD32)title.rect.height); reply = PackCARD32 (reply, (CARD32)frameWin); } /*----------------------------------------------------------------------* | GetWindowMenuPostInfo *----------------------------------------------------------------------*/ static void GetWindowMenuPostInfo(ClientData *pcd, XtPointer reply) { int i; GadgetRectangle title; GadgetRectangle menu; CARD32 filledCount; Window frameWin; Boolean titleFound = False; Boolean systemFound = False; filledCount = pcd->cTitleGadgets; frameWin = pcd->clientFrameWin; for (i=0; i < filledCount; i++) { if (pcd->pTitleGadgets[i].id == FRAME_TITLE) { CopyMwmGadget (&(pcd->pTitleGadgets[i]), &title); titleFound = True; } if (pcd->pTitleGadgets[i].id == FRAME_SYSTEM) { CopyMwmGadget (&(pcd->pTitleGadgets[i]), &menu); systemFound = True; } } if (titleFound == False) FillInvalidInfo (&title); if (systemFound == False) FillInvalidInfo (&menu); reply = PackCARD32 (reply, (CARD32)filledCount); reply = PackCARD32 (reply, (CARD32)title.id); reply = PackCARD32 (reply, (CARD32)title.rect.x); reply = PackCARD32 (reply, (CARD32)title.rect.y); reply = PackCARD32 (reply, (CARD32)title.rect.width); reply = PackCARD32 (reply, (CARD32)title.rect.height); reply = PackCARD32 (reply, (CARD32)menu.id); reply = PackCARD32 (reply, (CARD32)menu.rect.x); reply = PackCARD32 (reply, (CARD32)menu.rect.y); reply = PackCARD32 (reply, (CARD32)menu.rect.width); reply = PackCARD32 (reply, (CARD32)menu.rect.height); reply = PackCARD32 (reply, (CARD32)frameWin); } /*----------------------------------------------------------------------* | GetIconMenuItemSelectInfo *----------------------------------------------------------------------*/ static void GetIconMenuItemSelectInfo(ClientData *pcd, XtPointer reply, Boolean use_icon_box) { MenuSpec *menuSpec; int menuItemCount,sensitiveCount; Window menuWin, frameWin; int sensitive[MAX_MENU_ITEMS]; int itemY[MAX_MENU_ITEMS]; char itemName[MAX_MENU_ITEMS][25]; IconBoxData *icon_box; XmScrollBarWidget hScrollBar, vScrollBar; Widget frameWidget, scrollWidget, shellWidget; MenuButton *NewMenuButton; MenuItem *NewMenuItem; int n; CARD32 iconX, iconY, iconWidth, iconHeight; CARD32 hMin, hMax, hSliderAreaWidth, hSliderX, hSliderAreaX, vMin, vMax, vSliderAreaHeight, vSliderY, vSliderAreaY; CARD32 rightArrowX, rightArrowY, leftArrowX, leftArrowY, topArrowX, topArrowY, bottomArrowX, bottomArrowY; CARD32 iconBoxX, iconBoxY, iconBoxWidth, iconBoxHeight; Window scrollWin, hScrollWin, vScrollWin, iconShellWin, iconFrameWin; CARD32 lastRow, lastCol; CARD32 iPlaceW, iPlaceH; CARD32 clientState; CARD32 useIconBox; useIconBox = pcd->pSD->useIconBox; icon_box = pcd->pIconBox; menuSpec = pcd->systemMenuSpec; if (menuSpec == NULL) return; menuItemCount = menuSpec->menuButtonCount; for (n = 0; n < menuItemCount && n < MAX_MENU_ITEMS; n++) { itemName[n][0] = '\0'; sensitive[n] = FALSE; } menuWin = XtWindow (menuSpec->menuWidget); frameWin = pcd->clientFrameWin; clientState = pcd->clientState; sensitiveCount = 0; for (n = 0, NewMenuButton = menuSpec->menuButtons; n < menuSpec->menuButtonCount; n++, NewMenuButton++) { if (NewMenuButton->managed == FALSE) continue; NewMenuItem = NewMenuButton->menuItem; sensitive[n] = NewMenuButton->buttonWidget->core.sensitive; itemY[n] = NewMenuButton->buttonWidget->core.y + (NewMenuButton->buttonWidget->core.height / 2); strcpy(itemName[n], NewMenuItem->label); if (sensitive[n] == TRUE) sensitiveCount++; } if (use_icon_box == True) { hScrollBar = (XmScrollBarWidget)icon_box->hScrollBar; hMin = hScrollBar->scrollBar.minimum; hMax = hScrollBar->scrollBar.maximum; hSliderAreaWidth = hScrollBar->scrollBar.slider_area_width; hSliderX = hScrollBar->scrollBar.slider_x; hSliderAreaX = hScrollBar->scrollBar.slider_area_x; leftArrowX = hScrollBar->core.x + hScrollBar->scrollBar.arrow1_x + (hScrollBar->scrollBar.arrow_width/2); leftArrowY = hScrollBar->core.y + hScrollBar->scrollBar.arrow1_y + (hScrollBar->scrollBar.arrow_height/2); rightArrowX = hScrollBar->core.x + hScrollBar->scrollBar.arrow2_x + (hScrollBar->scrollBar.arrow_width/2); rightArrowY = hScrollBar->core.y + hScrollBar->scrollBar.arrow2_y + (hScrollBar->scrollBar.arrow_height/2); vScrollBar = (XmScrollBarWidget)icon_box->vScrollBar; vMin = vScrollBar->scrollBar.minimum; vMax = vScrollBar->scrollBar.maximum; vSliderAreaHeight = vScrollBar->scrollBar.slider_area_height; vSliderY = vScrollBar->scrollBar.slider_y; vSliderAreaY = vScrollBar->scrollBar.slider_area_y; topArrowX = vScrollBar->core.x + vScrollBar->scrollBar.arrow1_x + (vScrollBar->scrollBar.arrow_width/2); topArrowY = vScrollBar->core.y + vScrollBar->scrollBar.arrow1_y + (vScrollBar->scrollBar.arrow_height/2); bottomArrowX = vScrollBar->core.x + vScrollBar->scrollBar.arrow2_x + (vScrollBar->scrollBar.arrow_width/2); bottomArrowY = hScrollBar->core.y + hScrollBar->scrollBar.arrow2_y + (hScrollBar->scrollBar.arrow_height/2); shellWidget = icon_box->shellWidget; iconBoxX = shellWidget->core.x; iconBoxY = shellWidget->core.y; iconBoxWidth = shellWidget->core.width; iconBoxHeight = shellWidget->core.height; iconShellWin = XtWindow (shellWidget); frameWidget = icon_box->frameWidget; frameWin = XtWindow (frameWidget); scrollWidget = icon_box->scrolledWidget; scrollWin = XtWindow (scrollWidget); hScrollWin = XtWindow (hScrollBar); vScrollWin = XtWindow (vScrollBar); lastCol = icon_box->lastCol; lastRow = icon_box->lastRow; iPlaceW = icon_box->IPD.iPlaceW; iPlaceH = icon_box->IPD.iPlaceH; } /* * icon info */ iconX = pcd->iconX; iconY = pcd->iconY; iconWidth = pcd->pSD->iconWidth; iconHeight = pcd->pSD->iconHeight; iconFrameWin = pcd->iconFrameWin; reply = PackCARD32 (reply, (CARD32)clientState); reply = PackCARD32 (reply, (CARD32)menuItemCount); reply = PackCARD32 (reply, (CARD32)sensitiveCount); reply = PackCARD32 (reply, (CARD32)menuWin); reply = PackCARD32 (reply, (CARD32)frameWin); for (n=0; n < menuItemCount && n < MAX_MENU_ITEMS; n++) { reply = PackCARD32 (reply, (CARD32)sensitive[n]); reply = PackCARD32 (reply, (CARD32)itemY[n]); reply = PackString (reply, (String)itemName[n]); } reply = PackCARD32 (reply,(CARD32)use_icon_box); reply = PackCARD32 (reply,(CARD32)iconX); reply = PackCARD32 (reply,(CARD32)iconY); reply = PackCARD32 (reply,(CARD32)iconWidth); reply = PackCARD32 (reply,(CARD32)iconHeight); reply = PackCARD32 (reply,(CARD32)iconFrameWin); if (use_icon_box == True) { reply = PackCARD32 (reply,(CARD32)hMin); reply = PackCARD32 (reply,(CARD32)hMax); reply = PackCARD32 (reply,(CARD32)hSliderAreaWidth); reply = PackCARD32 (reply,(CARD32)hSliderX); reply = PackCARD32 (reply,(CARD32)hSliderAreaX); reply = PackCARD32 (reply,(CARD32)vMin); reply = PackCARD32 (reply,(CARD32)vMax); reply = PackCARD32 (reply,(CARD32)vSliderAreaHeight); reply = PackCARD32 (reply,(CARD32)vSliderY); reply = PackCARD32 (reply,(CARD32)vSliderAreaY); reply = PackCARD32 (reply,(CARD32)rightArrowX); reply = PackCARD32 (reply,(CARD32)rightArrowY); reply = PackCARD32 (reply,(CARD32)leftArrowX); reply = PackCARD32 (reply,(CARD32)leftArrowY); reply = PackCARD32 (reply,(CARD32)topArrowX); reply = PackCARD32 (reply,(CARD32)topArrowY); reply = PackCARD32 (reply,(CARD32)bottomArrowX); reply = PackCARD32 (reply,(CARD32)bottomArrowY); reply = PackCARD32 (reply,(CARD32)iconBoxX); reply = PackCARD32 (reply,(CARD32)iconBoxY); reply = PackCARD32 (reply,(CARD32)iconBoxWidth); reply = PackCARD32 (reply,(CARD32)iconBoxHeight); reply = PackCARD32 (reply,(CARD32)iconShellWin); reply = PackCARD32 (reply,(CARD32)frameWin); reply = PackCARD32 (reply,(CARD32)scrollWin); reply = PackCARD32 (reply,(CARD32)hScrollWin); reply = PackCARD32 (reply,(CARD32)vScrollWin); reply = PackCARD32 (reply,(CARD32)lastCol); reply = PackCARD32 (reply,(CARD32)lastRow); reply = PackCARD32 (reply,(CARD32)iPlaceH); reply = PackCARD32 (reply,(CARD32)iPlaceW); } } /*----------------------------------------------------------------------* | GetItemSelectInfo *----------------------------------------------------------------------*/ static void GetWindowItemSelectInfo(ClientData *pcd, XtPointer reply) { MenuSpec *menuSpec; CARD32 menuItemCount,sensitiveCount; Window menuWin, frameWin; CARD32 sensitive[MAX_MENU_ITEMS]; CARD32 itemY[MAX_MENU_ITEMS]; char itemName[MAX_MENU_ITEMS][MAX_NAME_LEN + 1]; MenuButton *NewMenuButton; MenuItem *NewMenuItem; int n; menuSpec = pcd->systemMenuSpec; if (menuSpec == NULL) return; menuItemCount = menuSpec->menuButtonCount; for (n = 0; n < menuItemCount && n < MAX_MENU_ITEMS; n++) { itemName[n][0] = '\0'; sensitive[n] = FALSE; } menuWin = XtWindow (menuSpec->menuWidget); frameWin = pcd->clientFrameWin; sensitiveCount = 0; for (n = 0, NewMenuButton = menuSpec->menuButtons; n < menuSpec->menuButtonCount; n++, NewMenuButton++) { if (NewMenuButton->managed == FALSE) continue; NewMenuItem = NewMenuButton->menuItem; sensitive[n] = NewMenuButton->buttonWidget->core.sensitive; itemY[n] = NewMenuButton->buttonWidget->core.y + (NewMenuButton->buttonWidget->core.height / 2); strcpy(itemName[n], NewMenuItem->label); if (sensitive[n] == TRUE) sensitiveCount++; } reply = PackCARD32 (reply, (CARD32)menuItemCount); reply = PackCARD32 (reply, (CARD32)sensitiveCount); reply = PackCARD32 (reply, (CARD32)menuWin); reply = PackCARD32 (reply, (CARD32)frameWin); for (n=0; n < menuItemCount && n < MAX_MENU_ITEMS; n++) { reply = PackCARD32 (reply, (CARD32)sensitive[n]); reply = PackCARD32 (reply, (CARD32)itemY[n]); reply = PackString (reply, (String)itemName[n]); } } /*----------------------------------------------------------------------* | GetItemCheckInfo *----------------------------------------------------------------------*/ static void GetItemCheckInfo(ClientData *pcd, XtPointer reply) { MenuSpec *menuSpec; int menuItemCount; int clientState; int titleGadgetCount; int titleId, systemId, minimizeId, maximizeId, northwestId; int upperBorderWidth, lowerBorderWidth; Window menuWin; char itemName[MAX_MENU_ITEMS][MAX_NAME_LEN + 1]; MenuButton *NewMenuButton; MenuItem *NewMenuItem; int i,filledCount; Boolean titleFound, systemFound, minimizeFound, maximizeFound = False; menuSpec = pcd->systemMenuSpec; if (menuSpec == NULL) return; menuItemCount = menuSpec->menuButtonCount; for (i = 0; i < menuItemCount && i < MAX_MENU_ITEMS; i++) itemName[i][0] = '\0'; menuWin = XtWindow (menuSpec->menuWidget); for (i = 0, NewMenuButton = menuSpec->menuButtons; i < menuSpec->menuButtonCount; i++, NewMenuButton++) { if (NewMenuButton->managed == FALSE) continue; NewMenuItem = NewMenuButton->menuItem; strcpy (itemName[i],NewMenuItem->label); } filledCount = pcd->cTitleGadgets; for (i=0; i < filledCount; i++) { if (pcd->pTitleGadgets[i].id == FRAME_TITLE) { titleId = FRAME_TITLE; titleFound = True; } else if (pcd->pTitleGadgets[i].id == FRAME_SYSTEM) { systemId = FRAME_SYSTEM; systemFound = True; } else if (pcd->pTitleGadgets[i].id == FRAME_MINIMIZE) { minimizeId = FRAME_MINIMIZE; minimizeFound = True; } else if (pcd->pTitleGadgets[i].id == FRAME_MAXIMIZE) { maximizeId = FRAME_MAXIMIZE; maximizeFound = True; } } if (titleFound == False) titleId = INVALID; if (systemFound == False) systemId = INVALID; if (minimizeFound == False) minimizeId = INVALID; if (maximizeFound == False) maximizeId = INVALID; if (!(pcd->decor & MWM_DECOR_RESIZEH)) northwestId = INVALID; else northwestId = pcd->pResizeGadgets[WM_NORTHWEST].id; upperBorderWidth = pcd->frameInfo.upperBorderWidth; lowerBorderWidth = pcd->frameInfo.lowerBorderWidth; clientState = pcd->clientState; reply = PackCARD32 (reply, (CARD32)clientState); reply = PackCARD32 (reply, (CARD32)menuWin); reply = PackCARD32 (reply, (CARD32)menuItemCount); for (i=0; i < menuItemCount && i < MAX_MENU_ITEMS; i++) reply = PackString (reply, (String)itemName[i]); reply = PackCARD32 (reply, (CARD32)filledCount); reply = PackCARD32 (reply, (CARD32)titleId); reply = PackCARD32 (reply, (CARD32)systemId); reply = PackCARD32 (reply, (CARD32)minimizeId); reply = PackCARD32 (reply, (CARD32)maximizeId); reply = PackCARD32 (reply, (CARD32)northwestId); reply = PackCARD32 (reply, (CARD32)upperBorderWidth); reply = PackCARD32 (reply, (CARD32)lowerBorderWidth); } /*----------------------------------------------------------------------* | GetRaiseInfo *----------------------------------------------------------------------*/ static void GetRaiseInfo(ClientData *pcd, XtPointer reply) { CARD32 state = pcd->clientState; reply = PackCARD32 (reply, (CARD32)state); } /*----------------------------------------------------------------------* | GetAutomationData *----------------------------------------------------------------------*/ void GetAutomationData (XtPointer input, Atom *outputType, XtPointer *output, unsigned long *outputLen, int *outputFmt) { ClientData *pcd; CARD32 infoWanted; Window winId; XtPointer reply; int size; int i, n, menuItemCount = 0; MenuItem *menu_item; winId = UnpackCARD32(&input); infoWanted = UnpackCARD32(&input); /* * Get client data associated with window if the widget making the request. */ if ((pcd = GetPCD (0,winId)) == NULL) { PRINT ("Can't get client data\n"); return; } size = 0; switch (infoWanted) { case WINDOW_MINIMIZE_INFO: size += sizeof(CARD32) * 7; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetMinimizeInfo (pcd,*output); break; case WINDOW_MAXIMIZE_INFO: size += sizeof (CARD32) * 7; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetMaximizeInfo(pcd,*output); break; case WINDOW_RAISE_INFO: size += sizeof (CARD32); *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetRaiseInfo(pcd, *output); break; case WINDOW_MOVE_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 16; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetMoveInfo(pcd,*output); break; case WINDOW_RESIZE_NORTH_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_NORTH); break; case WINDOW_RESIZE_SOUTH_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_SOUTH); break; case WINDOW_RESIZE_EAST_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_EAST); break; case WINDOW_RESIZE_WEST_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_WEST); break; case WINDOW_RESIZE_NORTHEAST_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_NORTHEAST); break; case WINDOW_RESIZE_NORTHWEST_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_NORTHWEST); break; case WINDOW_RESIZE_SOUTHEAST_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_SOUTHEAST); break; case WINDOW_RESIZE_SOUTHWEST_INFO: SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 17; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetResizeInfo(pcd,*output,WM_SOUTHWEST); break; case WINDOW_MENU_ITEM_SELECT_INFO: if (pcd->systemMenuSpec) menuItemCount = pcd->systemMenuSpec->menuButtonCount; size += sizeof(CARD32) * 4; for (n=0; n < menuItemCount && n < MAX_MENU_ITEMS; n++) { menu_item = pcd->systemMenuSpec->menuButtons->menuItem; size += sizeof (CARD32); /* sensitive */ size += sizeof (CARD32); /* itemY */ size += sizeof (CARD16) + ((strlen(menu_item->label) + 1) * sizeof(CARD8)); /*itemName */ } *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetWindowItemSelectInfo(pcd,*output); break; case WINDOW_DEICONIFY_INFO: if (pcd->pSD->useIconBox == True) { size += sizeof (CARD32) * 37; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconInfo(pcd,*output,True); } else { size += sizeof (CARD32) * 6; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconInfo(pcd,*output,False); } break; case WINDOW_MENU_POST_INFO: size += sizeof (CARD32) * 12; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetWindowMenuPostInfo(pcd,*output); break; case WINDOW_FOCUS_INFO: size += sizeof (CARD32) * 7; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetFocusInfo(pcd,*output); break; case WINDOW_MENU_UNPOST_INFO: size += sizeof (CARD32) * 3; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetWindowMenuUnpostInfo(pcd,*output); break; case WINDOW_MENU_ITEM_CHECK_INFO: if (pcd->systemMenuSpec) menuItemCount = pcd->systemMenuSpec->menuButtonCount; size += sizeof(CARD32) * 11; for (n=0; n < menuItemCount && n < MAX_MENU_ITEMS; n++) { menu_item = pcd->systemMenuSpec->menuButtons->menuItem; size += sizeof (CARD16) + (strlen(menu_item->label + 1) * sizeof(CARD8)); /*itemName */ } *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetItemCheckInfo(pcd, *output); break; case ICON_MOVE_INFO: { SetGrabServer(); /* tell mwm not to grab server */ size += sizeof (CARD32) * 6; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconInfo(pcd,*output,False); break; } case ICON_MENU_POST_INFO: if (pcd->pSD->useIconBox == True) { size += sizeof (CARD32) * 37; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconInfo(pcd,*output,True); } else { size += sizeof (CARD32) * 6; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconInfo(pcd,*output,False); } break; case ICON_MENU_UNPOST_INFO: if (pcd->pSD->useIconBox == True) { size += sizeof (CARD32) * 37; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconInfo(pcd,*output,True); } else { size += sizeof (CARD32) * 6; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconInfo(pcd,*output,False); } break; case ICON_MENU_ITEM_SELECT_INFO: if (pcd->systemMenuSpec) menuItemCount = pcd->systemMenuSpec->menuButtonCount; size += sizeof(CARD32) * 11; for (n=0; n < menuItemCount && n < MAX_MENU_ITEMS; n++) { size += sizeof (CARD32); /* sensitive */ size += sizeof (CARD32); /* itemY */ menu_item = pcd->systemMenuSpec->menuButtons->menuItem; size += sizeof (CARD16) + ((strlen(menu_item->label) + 1) * sizeof(CARD8)); /*itemName */ } if (pcd->pSD->useIconBox == True) size += sizeof (CARD32) * 37; else size += sizeof (CARD32) * 6; *output = (XtPointer)XtMalloc(sizeof(CARD8) * size); GetIconMenuItemSelectInfo (pcd,*output,pcd->pSD->useIconBox); break; default: PRINT ("Illegal operation from Automation"); break; } *outputLen = (unsigned long)size; *outputFmt = WSM_PROTO_FMT; } motif-2.3.8/clients/mwm/WmWsmLib/0000755000175000017500000000000013211513006013575 500000000000000motif-2.3.8/clients/mwm/WmWsmLib/wsm_funcs.h0000644000175000017500000000656012672140200015703 00000000000000/* $XConsortium: wsm_funcs.h /main/5 1995/07/15 20:39:08 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _WSM_FUNCS_ #define _WSM_FUNCS_ /************************************************************ * * All function Prototypes for non static functions. * * Those that begin with _WSM are "private" for whatever that * is worth... * ************************************************************/ /* * disp.c */ WSMDispInfo * _WSMGetDispInfo( Display * ); WSMScreenInfo * _WSMGetScreenInfo( Display *, int ); void _WSMClearConfigScreenInfo( Display *, int ); WSMConfigFormatData * _WSMGetConfigFormat( Display *, int, WSMConfigFormatType ); Atom _WSMGetSelectionAtom( Display *, int, WSMClientType ); /* * free.c */ void FreeRequest( WSMRequest *request ); void FreeReply( WSMReply *reply ); /* * pack.c */ MessageData _WSMPackRequest( Display *, int, WSMRequest *, unsigned long *, WSMErrorCode * ); MessageData _WSMPackReply( Display *, int, WSMReply *, unsigned long * ); void _WSMUnpackRequest( Display *, int, MessageData, unsigned long, WSMRequestType, WSMRequest * ); void _WSMUnpackReply( Display *, int, MessageData, unsigned long, WSMRequestType, WSMReply * ); MessageData PackString( MessageData, String ); String UnpackString( MessageData * ); MessageData PackCARD8( MessageData, CARD8 ); CARD8 UnpackCARD8( MessageData * ); MessageData PackCARD16( MessageData, CARD16 ); CARD16 UnpackCARD16( MessageData * ); MessageData PackCARD32( MessageData, CARD32 ); CARD32 UnpackCARD32( MessageData * ); /* * recv.c */ Boolean WSMDefaultOwnSelection( Widget, WSMClientType, WSMRequestCallbackFunc, XtPointer ); void WSMRegisterRequestCallback( Display *, int, WSMRequestCallbackFunc, XtPointer ); Boolean WSMIsKnownTarget( Widget, Atom ); Atom * GetTargetList( Widget, Boolean, unsigned long * ); Boolean WSMProcessProtoTarget( Widget, Atom, XtPointer, unsigned long, int, Atom *, XtPointer *, unsigned long *, int * ); /* * send.c */ Boolean WSMSendMessage( Widget, WSMClientType, WSMRequest *, WSMReplyCallbackFunc, XtPointer ); /* * utils.c */ String _WSMReqTypeToName( WSMRequestType ); WSMRequestType _WSMTargetToReqType( Display *, Atom ); Atom _WSMReqTypeToTarget( Display *, WSMRequestType ); Boolean _WSMRequiresConfigFormat( WSMRequestType ); WSMConfigFormatType _WSMGetConfigFormatType( Window ); WSMAttribute * _WSMGetMatchingAttr( XrmQuark, WSMConfigFormatData * ); WSMWinData * _WSMGetMatchingWinData( WSMWinData *, int, XrmQuark ); #endif /* DO NOT ADD ANYTHING AFTER THIS LINE */ motif-2.3.8/clients/mwm/WmWsmLib/Makefile.in0000644000175000017500000004632213211512765015604 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = clients/mwm/WmWsmLib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libWsm_a_AR = $(AR) $(ARFLAGS) libWsm_a_LIBADD = am__objects_1 = debug.$(OBJEXT) disp.$(OBJEXT) free.$(OBJEXT) \ pack.$(OBJEXT) recv.$(OBJEXT) send.$(OBJEXT) util.$(OBJEXT) \ utm_send.$(OBJEXT) am_libWsm_a_OBJECTS = $(am__objects_1) libWsm_a_OBJECTS = $(am_libWsm_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libWsm_a_SOURCES) DIST_SOURCES = $(libWsm_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SRCS = debug.c disp.c free.c pack.c recv.c send.c util.c utm_send.c noinst_HEADERS = utm_send.h wsm_funcs.h wsm_proto.h INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} libWsm_a_SOURCES = $(SRCS) noinst_LIBRARIES = libWsm.a all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clients/mwm/WmWsmLib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign clients/mwm/WmWsmLib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libWsm.a: $(libWsm_a_OBJECTS) $(libWsm_a_DEPENDENCIES) $(EXTRA_libWsm_a_DEPENDENCIES) $(AM_V_at)-rm -f libWsm.a $(AM_V_AR)$(libWsm_a_AR) libWsm.a $(libWsm_a_OBJECTS) $(libWsm_a_LIBADD) $(AM_V_at)$(RANLIB) libWsm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utm_send.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/clients/mwm/WmWsmLib/utm_send.c0000644000175000017500000001757112672140200015514 00000000000000/* $XConsortium: utm_send.c /main/5 1995/07/15 20:38:59 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include "utm_send.h" /* * The following keeps track of multiple utm requests and * pulls the right data off */ typedef struct _DataQueueRec { XtPointer data; struct _DataQueueRec *next, *prev; } DataQueueRec; static DataQueueRec *dataQueue, *dataQueueTail = NULL; static void EnqueueUtmData( XtPointer ); static XtPointer DequeueUtmData( void ); /*================================================================* | The following functions are used to handle selection/UTM | | requests made from the REQUESTORS side to the owner of the | | selection. | | To send a request, the only function needed is UTMSendMessage. | *================================================================*/ /*----------------------------------------------------------------* | UTMSendMessage | | Send a message with parameters. | | Arguments: | | widget - requestor. MUST have destination callback set | | to UTMDestinationProc below. | selection - selection to convert against. | | target - target to make request against. | | param - data to send to selection owner. | | param_len - length of param in fmt units. | | param_fmt - param format (should be WSM_PROTO_FMT). | | callback - function to invoke when done. | | closure - data to pass to the callback. | | time - timestamp of the event; not CurrentTime. | *----------------------------------------------------------------*/ void UTMSendMessage( Widget w, Atom selection, Atom target, XtPointer param, unsigned long paramLen, int paramFmt, XtCallbackProc doneProc, XtPointer closure, Time time) { UTMPackageRec *pUtmData; /* make sure timestamp is valid if (time == 0) time = GetTimestamp(XtDisplay(w)); */ /* allocates and builds utm package to send. */ pUtmData = (UTMPackageRec *) XtMalloc(sizeof(UTMPackageRec)); pUtmData->fmt = paramFmt; pUtmData->len = paramLen; pUtmData->target = target; pUtmData->param = param; pUtmData->doneProc = doneProc; pUtmData->closure = closure; /* * queue-up the data which is pulled off in the * UTMDestinationProc below. Note that the widget * passed in MUST have its destinationCallback set * to UTMDestionationProc! */ EnqueueUtmData(pUtmData); /* * This causes the DestinationCB to be invoked. * That is where that param data is transfered. */ if (!XmeNamedSink(w, selection, XmCOPY, NULL, /* location_data. holds param data (client data), free in TransferDone proc. */ time)) fprintf(stderr, "UTM Error: UTMSendMessage failed.\n"); } /* UTMSendMessage */ /*----------------------------------------------------------------* | UTMDestinationProc | | Invoked by UTM when a sink has been set-up and a request | | initiated against an owner of a selection. | | Arguments: w - the requestor widget | | clientData - not used. data is in the queue. | | callData - pointer to the data passed in the call | | XmeNamedSink(). This will assume that | | the structure pointed to is a UTMDataRec.| | Returns: none | | | | Comments: | | Xt's selection mechanism will not work if the same time- | | stamp is used. prevTimeStamp contains the time of the last | | conversion and if same (or greater) it is incremented. | *----------------------------------------------------------------*/ void UTMDestinationProc ( Widget w, XtPointer clientData, XtPointer callData) { static Time prevTimestamp = 0; static Time increment = 0; Time time; XmDestinationCallbackStruct *dcs = (XmDestinationCallbackStruct *)callData; UTMPackageRec *pUtmData; if (dcs == NULL) { /* bad data - just return. */ return; } /* if duplicate timestamps are used, then make sure they're different. */ if (prevTimestamp == dcs->time) { time = prevTimestamp + (++increment); } else { increment = 0; prevTimestamp = time = dcs->time; } /* pull off the real client data */ pUtmData = (UTMPackageRec *)DequeueUtmData(); /* if no UTMData, then transfer can't be done. Punt. */ if (pUtmData == NULL) return; /* Setup the parameters to pass. */ XmTransferSetParameters(dcs->transfer_id, pUtmData->param, /* ptr to parameter data. */ pUtmData->fmt, /* param format (8,16,32) */ pUtmData->len, /* size of param in fmt units */ dcs->selection); /* not used */ /* Make the transfer. This invokes the selection owner's ConvertCB. * When done, UTMReplyReceived callback proc is invoked. */ XmTransferValue(dcs->transfer_id, pUtmData->target, /* this is the target to convert against.*/ pUtmData->doneProc, /* an XtCallbackProc called when done. */ pUtmData->closure, /* client data passed to done proc */ time); /* don't need the structure any more. */ XtFree((char*)pUtmData); } /* UTMDestinationProc */ /*----------------------------------------------------------------* | EnqueueUtmData | | Puts data onto the queue between sending messages and having | | the destination callback invoked. | *----------------------------------------------------------------*/ static void EnqueueUtmData(XtPointer data) { DataQueueRec *dataRec = (DataQueueRec *)XtMalloc(sizeof(DataQueueRec)); dataRec->data = data; dataRec->next = dataQueue; dataRec->prev = NULL; if (dataQueue == NULL) dataQueueTail = dataRec; else dataQueue->prev = dataRec; dataQueue = dataRec; return; } /*----------------------------------------------------------------* | DequeueUtmData | | Retreives data from the data queue after the destination proc | | was called. Just grab the last entry in the queue. | *----------------------------------------------------------------*/ static XtPointer DequeueUtmData() { DataQueueRec *ptr = dataQueueTail; XtPointer dataPtr = NULL; if (ptr) { dataQueueTail = ptr->prev; if (ptr->prev != NULL) ptr->prev->next = NULL; else dataQueue = NULL; dataPtr = ptr->data; XtFree((char*)ptr); } else fprintf(stderr, "UTM ERROR: Data not found in queue.\n"); return (dataPtr); } motif-2.3.8/clients/mwm/WmWsmLib/recv.c0000644000175000017500000003361713066310437014645 00000000000000/* $XConsortium: recv.c /main/5 1995/07/15 20:38:46 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" #include "utm_send.h" #include #include /* for XmeNamedSource() */ #ifdef JUNK static Boolean ConvertProc( Widget, Atom *, Atom *, XtPointer, unsigned long, int, Atom *, XtPointer *, unsigned long *, int * ); #endif /* JUNK */ extern Time GetTimestamp (Display *dpy); /* Function Name: WSMDefaultOwnSelection * Description: This is the default routine that owns the proper * selection and the processes incomming messages * from the Wsm protocol. * Arguments: w - A widget on the screen we want to own the * WSM or WM selection for. * NOTE: THIS MUST HAVE A XmNconvertCallback RESOURCE! * client_type - The type of client we are. * request_callback - The callback call when a message * is received. * request_data - Data passed to the request callback. * Returns: True if no one currently owns the selection and I have * taken ownership. * * NOTE: The reply that is filled in by the application programmer is * passed to FreeReply, so that memory may be freed. If you * want to take advantage of this, check wsm_proto.h or free.c * to see what is freed for each type of protocol request, and * then set the reply->any.allocated field to True to activate * automatic memory freeing. */ Boolean WSMDefaultOwnSelection(Widget w, WSMClientType client_type, WSMRequestCallbackFunc request_callback, XtPointer request_data) { Time time; Display *dpy = XtDisplay(w); Atom own_selection = _WSMGetSelectionAtom(dpy, XScreenNumberOfScreen(XtScreen(w)), client_type); if (XGetSelectionOwner(dpy, own_selection) != None) { /* * Someone out there already owns this selection, we should give * up and return. */ fprintf(stderr,"Error - Someone out there already owns this selection.\n"); return(False); } if (!XtIsRealized(w)) { fprintf(stderr, "%s must be realized, and is not.\n", "Programmer Error: Widget passed to WSMDefaultOwnSelection"); return(False); } WSMRegisterRequestCallback(XtDisplay(w), XScreenNumberOfScreen(XtScreen(w)), request_callback, request_data); /* * NOTE - w MUST have its XmNconvertCallback set properly, * otherwise, no conversions will be handled! */ time = GetTimestamp(XtDisplay(w)); /* CurrentTime or Zero is a no-no!*/ XmeNamedSource(w, own_selection, time); return(True); } /* Function Name: WSMRegisterRequestCallback * Description: Registers the callback that will be called when * a request comes in on the WSM protocol. * Arguments: disp - The display. * scr_num - The Screen number. * callback, data - The proc to register and the data * to send to it. * Returns: none. * * NOTE: The reply that is filled in by the application programmer is * passed to FreeReply, so that memory may be freed. If you * want to take advantage of this, check wsm_proto.h or free.c * to see what is freed for each type of protocol request, and * then set the reply->any.allocated field to True to activate * automatic memory freeing. */ void WSMRegisterRequestCallback(Display *disp, int scr_num, WSMRequestCallbackFunc callback, XtPointer data) { WSMScreenInfo *scr_info; scr_info = _WSMGetScreenInfo(disp, scr_num); /* * Since only one client can own a particular selection, we can hang * this data off of the screen data structure. This is necessary because * No data is passed to the ConvertProc by Xm or Xt. * * NOTE: We do not need to have room for one callback for the WSM and * one for the WM, since any given client will be one or the other, * not both. */ scr_info->request_callback = callback; scr_info->request_data = data; } /* Function Name: WSMIsKnownTarget * Description: Returns True if this target is part of the WSM protocol. * Arguments: w - Any widget on the screen of the client * we are talking to. * target - the target to check if part of the protocol. * Returns: True if this target is part of the WSM protocol. * * NOTE: This could be extended to know about extensions. */ Boolean WSMIsKnownTarget(Widget w, Atom target) { WSMDispInfo * disp_info = _WSMGetDispInfo(XtDisplay(w)); /* * Can't switch on dynamic data, sigh... */ if (disp_info->connect == target) return(True); if (disp_info->extensions == target) return(True); if (disp_info->config_fmt == target) return(True); if (disp_info->get_state == target) return(True); if (disp_info->set_state == target) return(True); if (disp_info->reg_window == target) return(True); if (disp_info->get_background == target) return(True); if (disp_info->set_background == target) return(True); if (disp_info->wm_windows == target) return(True); if (disp_info->wm_focus == target) return(True); if (disp_info->wm_pointer == target) return(True); return(False); } /* Function Name: WSMGetTargetList * Description: Returns the list of targets understood by the WSM * protocol. * Arguments: w - Any widget on the same screen as the client we * are talking to. * include_defaults - Whether or not to include the * targets TIMESTAMP, MULTIPLE, and TARGETS. * in the returned list. * RETURNED len_ret - The number of atoms returned. * Returns: The targets atom list. This list has been allocated with * XtMalloc, and must be free'd by the caller. */ Atom * WSMGetTargetList(Widget w, Boolean include_defaults, unsigned long *len_ret) { WSMDispInfo *disp_info = _WSMGetDispInfo(XtDisplay(w)); register int i; Atom *list; *len_ret = NUM_WSM_TARGETS; if (include_defaults) *len_ret += NUM_EXTRA_TARGETS; list = (Atom *) XtMalloc(sizeof(Atom) * (*len_ret)); i = 0; list[i++] = disp_info->connect; list[i++] = disp_info->extensions; list[i++] = disp_info->config_fmt; list[i++] = disp_info->get_state; list[i++] = disp_info->set_state; list[i++] = disp_info->reg_window; list[i++] = disp_info->get_background; list[i++] = disp_info->set_background; list[i++] = disp_info->wm_windows; list[i++] = disp_info->wm_focus; list[i++] = disp_info->wm_pointer; if (include_defaults) { list[i++] = disp_info->targets; list[i++] = disp_info->multiple; list[i++] = disp_info->timestamp; } return(list); } /* Function Name: WSMProcessProtoTarget * Description: Unpacks the data sent across to us that matches the * target, then calls the request_callback proceedure. * Arguments: w - Any widget that is on the same screen as the * client that we are talking to. * target - The target that defines which request this is. * input, input_len, input_fmt - The input data. * return_type - This is always set to the target IFF we * know how to process this request. * output, output_len, output_fmt - The data to send back * to the requester. * Returns: True if we know how to process this message and there * are no errors */ Boolean WSMProcessProtoTarget(Widget w, Atom target, XtPointer input, unsigned long input_len, int input_fmt, Atom *return_type, XtPointer *output, unsigned long *output_len, int *output_fmt) { Display *dpy; int scr_num; WSMScreenInfo *screen_info; WSMRequest request; WSMReply reply; /* * Check the Target to make sure it is valid. * Check the format to make sure it is WSM_PROTO_FMT. */ if (!WSMIsKnownTarget(w, target)) return(False); if (input_fmt != WSM_PROTO_FMT) { fprintf(stderr, "Format of the request must be %d\n", WSM_PROTO_FMT); return(False); } dpy = XtDisplay(w); scr_num = XScreenNumberOfScreen(XtScreen(w)); /* * Unpack up the request from the wire. */ _WSMUnpackRequest(dpy, scr_num, (MessageData) input, input_len, _WSMTargetToReqType(dpy, target), &request); /* * Call the app's callback function to process the request. */ screen_info = _WSMGetScreenInfo(dpy, scr_num); reply.any.type = request.any.type; reply.any.allocated = False; (*screen_info->request_callback)(w, screen_info->request_data, &request, &reply); /* * Pack up the reply and send it back. */ *output = (XtPointer) _WSMPackReply(dpy, scr_num, &reply, output_len); *output_fmt = WSM_PROTO_FMT; *return_type = target; /* Is this the right return type? */ FreeRequest(&request); FreeReply(&reply); return(TRUE); } /************************************************************ * * Internal routines. * ************************************************************/ #ifdef JUNK /*================================================================* | The following functions are used to handle selection/UTM | | conversion requests that are received by the selection OWNER. | *================================================================*/ /*----------------------------------------------------------------* | UTMConvertProc | | This is the UTM conversion proc called when a request comes in | | for the selection owner. | | | | NOTE - This function MUST have been set up as the callback for | | the utm widget's XmNconvertCallback procedure! | | | | Arguments: w - The widget making the request. | | clientData - not used. | | callData - the UTM convert callback structure. | *----------------------------------------------------------------*/ static void UTMConvertProc(Widget w, XtPointer clientData, XtPointer callData) { int scr = XScreenNumberOfScreen(XtScreen(w)); XmConvertCallbackStruct *ccs = (XmConvertCallbackStruct *)callData; Atom lose_sel = XInternAtom(XtDisplay(w), "_MOTIF_LOSE_SELECTION", False); WSMScreenInfo *scrInfo = _WSMGetScreenInfo(XtDisplay(w), scr); /* * Check if the callback was invoked for the right reason. * The reason field is not set to anything interresting by the transfer * code, so check the selection. */ if ((!ccs) || ((ccs->selection != scrInfo->wm_selection) && (ccs->selection != scrInfo->wsm_selection))) return; if (ccs->target == lose_sel) { /* Done with the conversion - free any data used. */ } /* * Handle a conversion request with parameter data. */ else { ConvertProc (w, &(ccs->selection), &(ccs->target), ccs->parm, ccs->parm_length, ccs->parm_format, &(ccs->type), &(ccs->value), &(ccs->length), &(ccs->format)); } } /* Function Name: ConvertProc * Description: This is the conversion proc. called when a request * comes in that we need to process. * Arguments: w - The widget that owns the selection? * selection - The selection to be converted. * target - The target to convert. * return_type - The type of the return stream. * output - The output data stream. * output_len - The length of the output stream. * output_fmt - The format of the output stream. * Returns: True if we can convert the selection, False otherwise. */ /*ARGSUSED*/ static Boolean ConvertProc(Widget w, Atom *selection, Atom *target, XtPointer input, unsigned long input_len, int input_fmt, Atom *return_type, XtPointer *output, unsigned long *output_len, int *output_fmt) { WSMDispInfo *disp_info; /* set up some defaults. selection code doesn't like garbage! */ *output = NULL; *output_len = 0; *output_fmt = 8; disp_info = _WSMGetDispInfo(XtDisplay(w)); /* * Since this function is only registered for one selection, I am going * to assume that the intrinsics didn't give me the wrong thing. */ if (*target == disp_info->targets) { *return_type = XA_STRING; *output = (XtPointer) WSMGetTargetList(w, TRUE, output_len); *output_fmt = 32; return(True); } /* * Intrinsics will handle MULTIPLE and TIMESTAMP for me. */ if (WSMProcessProtoTarget(w, *target, input, input_len, input_fmt, return_type, output, output_len, output_fmt)) { return(TRUE); } return(False); /* unknown type, returning... */ } #endif /*JUNK*/ motif-2.3.8/clients/mwm/WmWsmLib/disp.c0000644000175000017500000002102512672140200014622 00000000000000/* $TOG: disp.c /main/6 1997/06/18 17:34:28 samborn $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" WSMDispInfo * GDispInfo = NULL; /* Function Name: _WSMGetDispInfo * Description: Gets the display information structure associated with * the display passed into this function. * Arguments: dpy - The Display to get the info for. * Returns: a WSMDispInfo structure for the display passed. */ WSMDispInfo * _WSMGetDispInfo(Display *dpy) { enum { XA_WSM_NAME_CONNECT, XA_WSM_NAME_EXTENSIONS, XA_WSM_NAME_CONFIG_FMT, XA_WSM_NAME_GET_STATE, XA_WSM_NAME_SET_STATE, XA_WSM_NAME_REG_WINDOW, XA_WSM_NAME_WM_GET_BACKGROUND_WINDOW, XA_WSM_NAME_WM_SET_BACKGROUND_WINDOW, XA_WSM_NAME_WM_WINDOWS, XA_WSM_NAME_WM_FOCUS, XA_WSM_NAME_WM_POINTER, XA_TARGETS, XA_MULTIPLE, XA_TIMESTAMP, NUM_ATOMS }; static char *atom_names[] = { WSM_NAME_CONNECT, WSM_NAME_EXTENSIONS, WSM_NAME_CONFIG_FMT, WSM_NAME_GET_STATE, WSM_NAME_SET_STATE, WSM_NAME_REG_WINDOW, WSM_NAME_WM_GET_BACKGROUND_WINDOW, WSM_NAME_WM_SET_BACKGROUND_WINDOW, WSM_NAME_WM_WINDOWS, WSM_NAME_WM_FOCUS, WSM_NAME_WM_POINTER, "TARGETS", "MULTIPLE", "TIMESTAMP" }; WSMDispInfo * disp_info; Atom atoms[XtNumber(atom_names)]; if (GDispInfo == NULL) { disp_info = GDispInfo = (WSMDispInfo *) XtMalloc(sizeof(WSMDispInfo)); } else { disp_info = GDispInfo; while (True) { if (disp_info->disp == dpy) return(disp_info); if (disp_info->next == NULL) break; disp_info = disp_info->next; } /* * This display is not on the global list, add it. */ disp_info->next = (WSMDispInfo *) XtMalloc(sizeof(WSMDispInfo)); disp_info = disp_info->next; } disp_info->disp = dpy; /* * These are our names. * * ||| Should use XtConvertAndStore(). */ XInternAtoms(dpy, atom_names, XtNumber(atom_names), False, atoms); disp_info->connect = atoms[XA_WSM_NAME_CONNECT]; disp_info->extensions = atoms[XA_WSM_NAME_EXTENSIONS]; disp_info->config_fmt = atoms[XA_WSM_NAME_CONFIG_FMT]; disp_info->get_state = atoms[XA_WSM_NAME_GET_STATE]; disp_info->set_state = atoms[XA_WSM_NAME_SET_STATE]; disp_info->reg_window = atoms[XA_WSM_NAME_REG_WINDOW]; disp_info->get_background = atoms[XA_WSM_NAME_WM_GET_BACKGROUND_WINDOW]; disp_info->set_background = atoms[XA_WSM_NAME_WM_SET_BACKGROUND_WINDOW]; disp_info->wm_windows = atoms[XA_WSM_NAME_WM_WINDOWS]; disp_info->wm_focus = atoms[XA_WSM_NAME_WM_FOCUS]; disp_info->wm_pointer = atoms[XA_WSM_NAME_WM_POINTER]; /* * These global resources are unlikely to change. */ disp_info->targets = atoms[XA_TARGETS]; disp_info->multiple = atoms[XA_MULTIPLE]; disp_info->timestamp = atoms[XA_TIMESTAMP]; disp_info->screen_info = NULL; disp_info->next = NULL; return(disp_info); } /* Function Name: _WSMGetScreenInfo * Description: Gets the screen information structure associated with * the display and screen passed into this function. * Arguments: dpy - The Display to get the info for. * screen_number - The screen number. * Returns: a WSMScreenInfo structure for the display passed. */ WSMScreenInfo * _WSMGetScreenInfo(Display *dpy, int screen_number) { WSMDispInfo * disp_info = _WSMGetDispInfo(dpy); WSMScreenInfo *screen_info; char temp[BUFSIZ]; if (disp_info->screen_info == NULL) { /* * Didn't find any screen info on this display, allocate it * and then drop down to the code below that fills in the data. */ screen_info = (WSMScreenInfo *) XtMalloc(sizeof(WSMScreenInfo)); disp_info->screen_info = screen_info; } else { screen_info = disp_info->screen_info; /* * Hunt through the screen info structs on this display until we * find one that matches the screen num passed. If we don't find * one then allocate a new one, put it on the end of the list and * drop into the code below that fills in the data. */ while (True) { if (screen_info->screen_num == screen_number) return(screen_info); if (screen_info->next == NULL) break; screen_info = screen_info->next; } /* * This screen is not on the display's screen list, add it. */ screen_info->next = (WSMScreenInfo *) XtMalloc(sizeof(WSMScreenInfo)); screen_info = screen_info->next; } screen_info->screen_num = screen_number; sprintf(temp, WM_SELECTION_FORMAT, screen_number); screen_info->wm_selection = XInternAtom(dpy, temp, False); sprintf(temp, WSM_SELECTION_FORMAT, screen_number); screen_info->wsm_selection = XInternAtom(dpy, temp, False); screen_info->next = NULL; screen_info->global.num_attrs = 0; screen_info->window.num_attrs = 0; screen_info->icon.num_attrs = 0; screen_info->request_callback = NULL; screen_info->request_data = NULL; return(screen_info); } /* Function Name: _WSMClearConfigScreenInfo * Description: Resets the screen information structure associated with * the display and screen passed into this function. * Arguments: dpy - The Display to get the info for. * screen_number - The screen number. * Returns: */ void _WSMClearConfigScreenInfo(Display *dpy, int screen_number) { WSMDispInfo * disp_info = _WSMGetDispInfo(dpy); WSMScreenInfo *screen_info; if (disp_info->screen_info != NULL) { screen_info = disp_info->screen_info; /* * Hunt through the screen info structs on this display until we * find one that matches the screen num passed. */ while (True) { if (screen_info->screen_num == screen_number) break; if (screen_info->next == NULL) return; screen_info = screen_info->next; } if (screen_info->global.num_attrs != 0){ XtFree((XtPointer)screen_info->global.attr_list); screen_info->global.num_attrs = 0; } if (screen_info->window.num_attrs != 0){ XtFree((XtPointer)screen_info->window.attr_list); screen_info->window.num_attrs = 0; } if (screen_info->icon.num_attrs != 0){ XtFree((XtPointer)screen_info->icon.attr_list); screen_info->icon.num_attrs = 0; } } } /* Function Name: _WSMGetConfigFormat * Description: Gets the Configuration format for the dpy, scr and * type specified. * Arguments: dpy - The display. * screen_number - The screen number. * type - The type of format required. * Returns: A pointer to the config format, or NULL if none was * found. */ WSMConfigFormatData * _WSMGetConfigFormat(Display *dpy, int screen_number, WSMConfigFormatType type) { WSMScreenInfo *screen_info = _WSMGetScreenInfo(dpy, screen_number); if (screen_info == NULL) return(NULL); switch(type) { case WSM_GLOBAL_FMT: return(&(screen_info->global)); case WSM_WINDOW_FMT: return(&(screen_info->window)); case WSM_ICON_FMT: return(&(screen_info->icon)); default: break; } return(NULL); } /* Function Name: _WSMGetSelectionAtom * Description: Gets the Selection atom for the manager that we want to * send to. * Arguments: dpy - The display. * screen_number - The screen number. * send_to - Whether to send this to the WM or WSM. * Returns: A pointer to the config format, or NULL if none was * found. */ Atom _WSMGetSelectionAtom(Display *dpy, int screen_num, WSMClientType send_to) { WSMScreenInfo *screen_info = _WSMGetScreenInfo(dpy, screen_num); if (screen_info == NULL) return(None); switch(send_to) { case WSM_WORKSPACE_MANAGER: return(screen_info->wsm_selection); case WSM_WINDOW_MANAGER: return(screen_info->wm_selection); default: break; } return(None); } motif-2.3.8/clients/mwm/WmWsmLib/send.c0000644000175000017500000002014213066310437014624 00000000000000/* $XConsortium: send.c /main/5 1995/07/15 20:38:50 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include "wsm_proto.h" #include "utm_send.h" typedef struct _RequestInfo { WSMReplyCallbackFunc reply_callback; /* The reply callback func */ XtPointer reply_data; /* The user data for the callback func */ WSMRequestType request_type; /* The kind of request for cross check. */ Atom send_atom; /* The atom that we sent this message to. */ } RequestInfo; static void UTMReplyReceived( Widget, XtPointer, XtPointer ); static void ReplyReceived( Widget, XtPointer, Atom *, Atom *, XtPointer, unsigned long *, int * ); extern Time GetTimestamp (Display *dpy); /* Function Name: WSMSendMessage * Description: Sends a message to WSM or WM on the screen * and display specified. * Arguments: w - any widget on this display and screen that * also has destination callback. * Note - This widget MUST have the destination * callback set to UTMDestinationProc that * is defined in utm_send.c. * send_to - either WSMWorkspaceManager or WSMWindowManager * request - the request to send. * reply_callback - The routine to call when the * reply comes in. * reply_data - Client data passed to the reply_callback. * Returns: True if an attempt is made to retrieve the selection, * False if an obvious error occured. * * NOTE: Reply callback will be called with reply == NULL if unable * to convert request. */ Boolean WSMSendMessage(Widget w, WSMClientType send_to, WSMRequest *request, WSMReplyCallbackFunc reply_callback, XtPointer reply_data) { int screen_num = XScreenNumberOfScreen(XtScreen(w)); Display *dpy = XtDisplay(w); Atom send_atom = _WSMGetSelectionAtom(dpy, screen_num, send_to); MessageData msg_data; unsigned long msg_len; RequestInfo *req_info; WSMErrorCode error; Time time = GetTimestamp(dpy); if (send_atom == None) { fprintf(stderr, "%s: Could not get selection atom to send message\n", "Internal Error"); return(False); } /* * Package human-readable request data into protocol package. */ msg_data = _WSMPackRequest(dpy, screen_num, request, &msg_len, &error); if (msg_data == NULL) { (*reply_callback)(w, reply_data, NULL, error); return(False); } req_info = (RequestInfo *) XtMalloc(sizeof(RequestInfo)); req_info->reply_callback = reply_callback; /* The reply callback func */ req_info->reply_data = reply_data; /* user data for the callback func */ req_info->request_type = request->any.type;/*request kind for cross check*/ req_info->send_atom = send_atom; /* Atom we sent this message to. */ if (!XtIsRealized(w)) { fprintf(stderr, "%s WSMSendMessage must be realized, and is not.\n", "Programmer Error: Widget passed to"); return(False); } UTMSendMessage(w, send_atom, _WSMReqTypeToTarget(dpy, request->any.type), (XtPointer) msg_data, msg_len, WSM_PROTO_FMT, UTMReplyReceived, req_info, time); return(True); } /************************************************************ * * Internal Routines. * ************************************************************/ /* Function Name: UTMReplyReceived * Description: Called after the selection owner's convert proc * has finished. * Arguments: w - The widget who initiated the request. * clientData - * callData - * Returns: none */ static void UTMReplyReceived(Widget w, XtPointer clientData, XtPointer callData) { XmSelectionCallbackStruct *scs = (XmSelectionCallbackStruct *) callData; RequestInfo *req_info = (RequestInfo *) clientData; Boolean errorFound = False; Atom type = _WSMReqTypeToTarget(XtDisplay(w), req_info->request_type); /* Let's check some other values just to make sure things are ok. */ if (scs->reason != XmCR_OK) { fprintf(stderr, "ERROR: Bad reason value received in UTMReplyReceived.\n"); errorFound = True; } if (scs->type == XT_CONVERT_FAIL) { fprintf(stderr, "ERROR: Convert failure detected in UTMReplyReceived.\n"); errorFound = True; } if (scs->flags != XmSELECTION_DEFAULT) { fprintf(stderr, "ERROR: Bad flags value received in UTMReplyReceived.\n"); errorFound = True; } if (errorFound) return; ReplyReceived(w, req_info, /* the request info pointer to fill in. */ &scs->selection, &type, /* type of request that was made. */ scs->value, /* data returned from conversion. */ &scs->length, &scs->format); } /* Function Name: ReplyReceived * Description: Called when a reply is received from a request * initiated by a WSMSendMessage. * Arguments: w - The widget who initiated the request. * req_info_ptr - pointer to the request info. * selection - The selection that has been converted. * req_type_atom - The type of request that was made. * length - the amount of message data. * format - the format of the reply. * Returns: none */ static void ReplyReceived(Widget w, XtPointer req_info_ptr, Atom *selection, Atom *req_type_atom, XtPointer value, unsigned long *length, int *format) { RequestInfo *req_info = (RequestInfo *) req_info_ptr; WSMReply reply; Display *dpy = XtDisplay(w); int screen_num; WSMErrorCode fail_code = WSM_SUCCESS; /* * First a few checks to make sure everything is as we expect. */ if (*selection != req_info->send_atom) { fprintf(stderr, "%s, request %d - reply %d\n", "Selection of the reply is not the same as the request", (int) req_info->send_atom, (int) *selection); fail_code = WSM_ERROR_INTERNAL; } if (*req_type_atom != _WSMReqTypeToTarget(dpy, req_info->request_type)) { if (*req_type_atom == None) { if (XGetSelectionOwner(dpy, *selection) == None) { fail_code = WSM_ERROR_NO_SEL_OWNER; fprintf(stderr, "No owner for selection #%d\n", (int)*selection); } else fail_code = WSM_ERROR_CONVERSION_FAILED; } else if (*req_type_atom == XT_CONVERT_FAIL) fail_code = WSM_ERROR_TIMEOUT; else { fprintf(stderr, "%s, request %s - reply %d:%s\n", "Target of the reply is not the same as the request", _WSMReqTypeToName(req_info->request_type), (int) *req_type_atom, _WSMReqTypeToName(_WSMTargetToReqType(dpy, *req_type_atom))); fail_code = WSM_ERROR_INTERNAL; } } if (*format != WSM_PROTO_FMT) { fprintf(stderr, "%s, request %d - reply %d\n", "Format of the reply is not the same as the request", (int) WSM_PROTO_FMT, (int) *format); fail_code = WSM_ERROR_INTERNAL; } if (fail_code != WSM_SUCCESS) { /* * Failure, call callback with NULL reply. */ (*req_info->reply_callback)(w, req_info->reply_data, NULL, fail_code); } else { screen_num = XScreenNumberOfScreen(XtScreen(w)); _WSMUnpackReply(dpy, screen_num, value, *length, req_info->request_type, &reply); (*req_info->reply_callback)(w, req_info->reply_data, &reply,fail_code); FreeReply(&reply); } XtFree((XtPointer) req_info_ptr); } motif-2.3.8/clients/mwm/WmWsmLib/free.c0000644000175000017500000001014212672140200014602 00000000000000/* $XConsortium: free.c /main/5 1995/07/15 20:38:35 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" #include static void FreeWinData( WSMWinData *data, int num ); /* Function Name: FreeRequest * Description: Frees data in the request that has been allocated. * Arguments: request - the request. * Returns: none. */ void FreeRequest(WSMRequest *request) { register int i; if (!request->any.allocated) return; /* Nothing to free. */ switch(request->any.type) { case WSM_CONNECT: XtFree((XtPointer) request->connect.known_versions); break; case WSM_EXTENSIONS: { register int num = request->extensions.num_extensions; register String *ptr; num = request->extensions.num_extensions; ptr = request->extensions.extension_suggestions; for (i = 0; i < num; i++, ptr++) XtFree((XtPointer) *ptr); XtFree((XtPointer) request->extensions.extension_suggestions); } break; case WSM_SET_STATE: { register int num = request->set_state.num_win_info_list; WSMWinInfo *win_info = request->set_state.win_info_list; for (i = 0; i < num; i++, win_info++) FreeWinData(win_info->data_list, win_info->num_data_list); XtFree((XtPointer) request->set_state.win_info_list); } break; default: break; } } /* Function Name: FreeRequest * Description: Frees data in the request that has been allocated. * Arguments: reply - the reply. * Returns: none. */ void FreeReply(WSMReply *reply) { register int i; if (!reply->any.allocated) return; /* Nothing to free. */ switch(reply->any.type) { case WSM_EXTENSIONS: { register int num = reply->extensions.num_extensions; register String *ptr; num = reply->extensions.num_extensions; ptr = reply->extensions.extensions; for (i = 0; i < num; i++, ptr++) XtFree((XtPointer) *ptr); XtFree((XtPointer) reply->extensions.extensions); } break; case WSM_GET_STATE: { WSMWinInfo *win_info = reply->get_state.win_info_list; register int num = reply->get_state.num_win_info_list; for (i = 0; i < num; i++, win_info++) FreeWinData(win_info->data_list, win_info->num_data_list); XtFree((XtPointer) reply->get_state.win_info_list); } break; case WSM_REG_WINDOW: FreeWinData(reply->register_window.window_data, reply->register_window.num_window_data); break; default: break; } } /************************************************************ * * Internal routines * ************************************************************/ /* Function Name: FreeWinData * Description: Frees the data associated with this window. * Arguments: data - The data to free. * num - number of elements in data. * Returns: none. */ static void FreeWinData(WSMWinData *data, int num) { register int i; WSMWinData *top = data; for (i = 0; i < num; i++, data++) { switch (data->type) { case WSM_CHAR_LIST_DATA: XtFree((XtPointer) data->data.char_ptr); break; case WSM_SHORT_LIST_DATA: XtFree((XtPointer) data->data.short_ptr); break; case WSM_LONG_LIST_DATA: XtFree((XtPointer) data->data.long_ptr); break; default: break; } } XtFree((XtPointer) top); } motif-2.3.8/clients/mwm/WmWsmLib/wsm_proto.h0000644000175000017500000003262312672140200015727 00000000000000/* $XConsortium: wsm_proto.h /main/5 1995/07/15 20:39:12 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _WSM_PROTO_ #define _WSM_PROTO_ #include #include #include #include #define WSM_PROTO_FMT 8 /************************************************************ * * Defines * ************************************************************/ #define WSM_NAME_CONNECT "_MOTIF_WSM_CONNECT" #define WSM_NAME_EXTENSIONS "_MOTIF_WM_EXTENSIONS" #define WSM_NAME_CONFIG_FMT "_MOTIF_WM_CONFIG_FORMAT" #define WSM_NAME_GET_STATE "_MOTIF_WSM_GET_STATE" #define WSM_NAME_SET_STATE "_MOTIF_WSM_SET_STATE" #define WSM_NAME_REG_WINDOW "_MOTIF_WSM_REGISTER_WINDOW" #define WSM_NAME_WM_GET_BACKGROUND_WINDOW "_MOTIF_WSM_GET_BACKGROUND_WINDOW" #define WSM_NAME_WM_SET_BACKGROUND_WINDOW "_MOTIF_WSM_SET_BACKGROUND_WINDOW" #define WSM_NAME_WM_WINDOWS "_MOTIF_WSM_WM_WINDOWS" #define WSM_NAME_WM_FOCUS "_MOTIF_WSM_WM_FOCUS" #define WSM_NAME_WM_POINTER "_MOTIF_WSM_WM_POINTER" #define NUM_EXTRA_TARGETS 3 #define NUM_WSM_TARGETS 11 #define WM_SELECTION_FORMAT "WM_S%d" #define WSM_SELECTION_FORMAT "WSM_S%d" #define WIN_MASK 0x1FFFFFFF /************************************************************ * * New enumerated types. * ************************************************************/ typedef enum {WSM_CONNECT, WSM_EXTENSIONS, WSM_CONFIG_FMT, WSM_GET_STATE, WSM_SET_STATE, WSM_REG_WINDOW, WSM_WM_GET_BACKGROUND_WINDOW, WSM_WM_SET_BACKGROUND_WINDOW, WSM_WM_WINDOWS, WSM_WM_FOCUS, WSM_WM_POINTER, WSM_UNKNOWN} WSMRequestType; typedef enum {WSM_WORKSPACE_MANAGER, WSM_WINDOW_MANAGER} WSMClientType; typedef enum {WSM_GLOBAL_FMT = 0, WSM_WINDOW_FMT = 1, WSM_ICON_FMT = 2} WSMConfigFormatType; typedef enum {WSM_VALUE_DATA, WSM_CHAR_LIST_DATA, WSM_SHORT_LIST_DATA, WSM_LONG_LIST_DATA, WSM_NONE} WSMDataType; typedef enum {WSM_SUCCESS, WSM_ERROR_INTERNAL, WSM_ERROR_CONVERSION_FAILED, WSM_ERROR_NO_SEL_OWNER, WSM_ERROR_TIMEOUT, WSM_ERROR_NO_CONFIG_FORMAT, WSM_ERROR_ALREADY_HAVE_CONFIG_FORMAT } WSMErrorCode; typedef enum {WSM_CLIENT_WINDOW, WSM_CLIENT_FRAME, WSM_ICON_FRAME} WSMLocationFlag; typedef XtPointer MessageData; /************************************************************ * * Global structures that are used by calling routines. * ************************************************************/ typedef union _WSMData { long value; char * char_ptr; short * short_ptr; long * long_ptr; } WSMData; typedef struct _WSMAttribute { XrmQuark nameq; /* Name of this attribute, quarkified. */ int size; /* The size of this attribute. */ Boolean is_list; /* True if this attribute is a list. */ } WSMAttribute; typedef struct _WSMConfigFormatData { WSMAttribute *attr_list; int num_attrs; } WSMConfigFormatData; typedef struct _WSMWinData { XrmQuark nameq; /* Name of this data entry, quarkified. */ WSMDataType type; /* The type of data stored in data. */ WSMData data; /* The data associated with this data entry. */ int data_len; /* if a list, then the size. */ } WSMWinData; typedef struct _WSMWinInfo { Window window; WSMWinData * data_list; int num_data_list; } WSMWinInfo; typedef Atom WindowProperty; typedef struct _WSMWinEntry { Window *windows; /* one for each location flag set. */ int num_windows; WindowProperty *match_properties; /* properties the window matched. */ int num_match_properties; } WSMWinEntry; typedef struct _AttributePair { WindowProperty *allowed_attributes; WindowProperty *prohibited_attributes; int num_attributes; } AttributePair; /************************************************************ * * Structures for sending a message for each type of event * ************************************************************/ typedef struct _WSMAnyRequestOrReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ } WSMAnyRequestOrReply; typedef struct _WSMConnect { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the known_versions ptr. */ Boolean allocated; short * known_versions; int num_versions; } WSMConnect; typedef struct _WSMExtensions { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free each string on the extension_suggestions list * as well as the extension_suggestions ptr itself. */ Boolean allocated; String *extension_suggestions; int num_extensions; } WSMExtensions; typedef WSMAnyRequestOrReply WSMConfigFormat; typedef struct _WSMGetState { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ Window window; Boolean diffs_allowed; } WSMGetState; typedef struct _WSMSetState { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the win_data list in each element on the * win_info_list. as well as the win_info_list ptr itself. */ Boolean allocated; WSMWinInfo *win_info_list; int num_win_info_list; } WSMSetState; typedef struct _WSMRegisterWindow { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ Window window; } WSMRegisterWindow; typedef struct _WSMWmGetBackgroundWindow { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; int screen; } WSMWmGetBackgroundWindow; typedef struct _WSMWmSetBackgroundWindow { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmSetBackgroundWindow; typedef struct _WSMWmWindows { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; CARD32 location_flag; WindowProperty *window_properties; int num_window_properties; AttributePair **match_attributes; int num_match_attributes; } WSMWmWindows; typedef WSMAnyRequestOrReply WSMWmFocus; typedef WSMAnyRequestOrReply WSMWmPointer; typedef union _WSMRequest { WSMAnyRequestOrReply any; WSMConnect connect; WSMExtensions extensions; WSMConfigFormat config_format; WSMGetState get_state; WSMSetState set_state; WSMRegisterWindow register_window; WSMWmGetBackgroundWindow get_background; WSMWmSetBackgroundWindow set_background; WSMWmWindows wm_windows; WSMWmFocus wm_focus; WSMWmPointer wm_pointer; } WSMRequest; /************************************************************ * * Structures for recieving a reply message for each type of event. * ************************************************************/ typedef struct _WSMConnectReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ short version; } WSMConnectReply; typedef struct _WSMExtensionsReply { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free each string on the extensions list * as well as the extensions ptr itself. */ Boolean allocated; String *extensions; int num_extensions; } WSMExtensionsReply; typedef struct _WSMConfigFormatReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ Boolean accepts_diffs; WSMAttribute * global_formats; int num_global_formats; WSMAttribute * window_formats; int num_window_formats; WSMAttribute * icon_formats; int num_icon_formats; } WSMConfigFormatReply; typedef struct _WSMGetStateReply { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the win_data list in each element on the * win_info_list. as well as the win_info_list ptr itself. */ Boolean allocated; WSMWinInfo *win_info_list; int num_win_info_list; } WSMGetStateReply; typedef WSMAnyRequestOrReply WSMSetStateReply; typedef struct _WSMRegisterWindowReply { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the window_data pointer. */ Boolean allocated; WSMWinData * window_data; int num_window_data; } WSMRegisterWindowReply; typedef struct _WSMWmGetBackgroundWindowReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmGetBackgroundWindowReply; typedef struct _WSMWmSetBackgroundWindowReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmSetBackgroundWindowReply; typedef struct _WSMWmWindowsReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; WSMWinEntry *win_entry_list; int num_win_entry_list; } WSMWmWindowsReply; typedef struct _WSMWmFocusReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmFocusReply; typedef struct _WSMWmPointerReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; CARD32 location_flag; /* client, frame, icon. */ } WSMWmPointerReply; typedef union _WSMReply { WSMAnyRequestOrReply any; WSMConnectReply connect; WSMExtensionsReply extensions; WSMConfigFormatReply config_format; WSMGetStateReply get_state; WSMSetStateReply set_state; WSMRegisterWindowReply register_window; WSMWmGetBackgroundWindowReply get_background; WSMWmSetBackgroundWindowReply set_background; WSMWmWindowsReply wm_windows; WSMWmFocusReply wm_focus; WSMWmPointerReply wm_pointer; } WSMReply; /************************************************************ * * New function types. * ************************************************************/ typedef void (*WSMReplyCallbackFunc)( Widget, /* A Widget on the same screen as the */ /* client that we are talking to. */ XtPointer, /* The user data. */ WSMReply *, /* The reply structure. */ WSMErrorCode /* The error code, or WSM_SUCCESS. */ ); typedef void (*WSMRequestCallbackFunc) ( Widget, /* A Widget on the same screen as the */ /* client that we are talking to. */ XtPointer, /* The user data. */ WSMRequest *, /* The request made of us. */ WSMReply * /* A reply structure that the user should */ /* fill in with the reply to send back. */ ); /************************************************************ * * These depend on lots of stuff above, and must go last. * ************************************************************/ /* * There is an assumption that there is only one WM and WSM per screen * and therefore the config_data can be stored in the screen info. * This seems pretty safe. */ typedef struct _WSMScreenInfo { int screen_num; Atom wsm_selection; Atom wm_selection; WSMConfigFormatData global; WSMConfigFormatData window; WSMConfigFormatData icon; WSMRequestCallbackFunc request_callback; XtPointer request_data; struct _WSMScreenInfo *next; } WSMScreenInfo; typedef struct _WSMDispInfo { Display *disp; Atom connect; Atom extensions; Atom config_fmt; Atom get_state; Atom set_state; Atom reg_window; Atom get_background; Atom set_background; Atom wm_windows; Atom wm_focus; Atom wm_pointer; Atom targets, multiple, timestamp; /* Required default targets. */ WSMScreenInfo *screen_info; struct _WSMDispInfo *next; } WSMDispInfo; #include "wsm_funcs.h" #endif /* _WSM_PROTO_ --- Do not add anything after this line. */ motif-2.3.8/clients/mwm/WmWsmLib/debug.c0000644000175000017500000002165713066310437014775 00000000000000/* $XConsortium: debug.c /main/5 1995/07/15 20:38:27 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" static void PrintWindowInfo( String, WSMWinInfo * ); static void PrintWindowData( String, String, WSMWinData * ); static void PrintConfigFormat( String, WSMConfigFormatReply * ); #define STRSIZE (BUFSIZ * 10) /************************************************************ * * This file contains routines to ease in debugging. * ************************************************************/ /* Function Name: PrintRequest * Description: Prints out a request in human readable form. * Arguments: request - The request to print. * Returns: str - The string the request is printed to. */ String PrintRequest(WSMRequest *request) { static char str[STRSIZE]; /* The vile hacks we do in debugging code. */ String ptr; register int i; sprintf(str, "Request: %s\n", _WSMReqTypeToName(request->any.type)); ptr = str + strlen(str); switch (request->any.type) { case WSM_CONNECT: sprintf(ptr, "Number of Versions: %d\nVersions: ", request->connect.num_versions); for (i = 0; i < request->connect.num_versions; i++) { ptr += strlen(ptr); sprintf(ptr, "%d", (int) request->connect.known_versions[i]); if ((i + 1) < request->connect.num_versions) strcat(ptr, ", "); } strcat(ptr, "\n"); break; case WSM_EXTENSIONS: sprintf(ptr, "Number of Extension Suggestions: %d\n%s", request->extensions.num_extensions, "Extension Suggestions:\n "); for (i = 0; i < request->extensions.num_extensions; i++) { ptr += strlen(ptr); strcat(ptr, request->extensions.extension_suggestions[i]); if ((i + 1) < request->extensions.num_extensions) strcat(ptr, ", "); } strcat(ptr, "\n"); break; case WSM_CONFIG_FMT: sprintf(ptr, "No other data for this request.\n"); break; case WSM_GET_STATE: sprintf(ptr, "Window: 0x%lX\nDiffs Allowed: %s\n", request->get_state.window, request->get_state.diffs_allowed ? "True" : "False"); break; case WSM_SET_STATE: sprintf(ptr, "Number of Windows with Info: %d\n", request->set_state.num_win_info_list); for (i = 0; i < request->set_state.num_win_info_list; i++) { ptr += strlen(ptr); PrintWindowInfo(ptr, request->set_state.win_info_list + i); } break; case WSM_REG_WINDOW: sprintf(ptr, "Window: 0x%lX\n", request->register_window.window); break; case WSM_WM_GET_BACKGROUND_WINDOW: case WSM_WM_SET_BACKGROUND_WINDOW: case WSM_WM_WINDOWS: case WSM_WM_FOCUS: case WSM_WM_POINTER: case WSM_UNKNOWN: break; } return(str); } /* Function Name: PrintReply * Description: Prints out a reply in human readable form. * Arguments: reply - The reply to print. * Returns: str - The string the reply is printed to. */ String PrintReply(WSMReply *reply) { static char str[STRSIZE]; /* The vile hacks we do in debugging code. */ register int i; String ptr; sprintf(str, "Reply: %s\n", _WSMReqTypeToName(reply->any.type)); ptr = str + strlen(str); switch (reply->any.type) { case WSM_CONNECT: sprintf(ptr, "Version: %d\n", (int) reply->connect.version); break; case WSM_EXTENSIONS: sprintf(ptr, "Number of Extensions: %d\n%s", reply->extensions.num_extensions, "Extensions:\n "); for (i = 0; i < reply->extensions.num_extensions; i++) { ptr += strlen(ptr); strcat(ptr, reply->extensions.extensions[i]); if ((i + 1) < reply->extensions.num_extensions) strcat(ptr, ", "); } strcat(ptr, "\n"); break; case WSM_CONFIG_FMT: PrintConfigFormat(ptr, &(reply->config_format)); break; case WSM_GET_STATE: sprintf(ptr, "Number of Windows with Info: %d\n", reply->get_state.num_win_info_list); for (i = 0; i < reply->get_state.num_win_info_list; i++) { ptr += strlen(ptr); PrintWindowInfo(ptr, reply->get_state.win_info_list + i); } break; case WSM_SET_STATE: sprintf(ptr, "No other data for this reply.\n"); break; case WSM_REG_WINDOW: { int num = reply->register_window.num_window_data; WSMWinData *win_data = reply->register_window.window_data; sprintf(ptr, "Number of Data Attributes: %d\n", num); for (i = 0; i < num; i++, win_data++) { ptr += strlen(ptr); PrintWindowData(ptr, "", win_data); } } break; case WSM_WM_GET_BACKGROUND_WINDOW: case WSM_WM_SET_BACKGROUND_WINDOW: case WSM_WM_WINDOWS: case WSM_WM_FOCUS: case WSM_WM_POINTER: case WSM_UNKNOWN: break; } return(str); } /************************************************************ * * Internal Routines. * ************************************************************/ /* Function Name: PrintWindowInfo * Description: Prints the info about a single window. * Arguments: str - String to stuff it into. * win_info - The window info to print. * Returns: none. */ static void PrintWindowInfo( String str, WSMWinInfo *win_info) { register int i; int num = win_info->num_data_list; WSMWinData *win_data = win_info->data_list; sprintf(str, "Window: 0x%lX\nNumber of Data Attributes: %d\n", win_info->window, num); for (i = 0; i < num; i++, win_data++) { str += strlen(str); PrintWindowData(str, " ", win_data); } } /* Function Name: PrintWindowData * Description: Prints the data about a single window. * Arguments: str - String to stuff it into. * win_data - The window data to print. * Returns: none. */ static void PrintWindowData( String str, String tab_str, WSMWinData *win_data) { register int i; char *type_str = NULL; if (win_data->type == WSM_VALUE_DATA) { sprintf(str, "%sName: %s, Type: Value, Value: %ld\n", tab_str, XrmQuarkToString(win_data->nameq), win_data->data.value); return; } switch(win_data->type) { case WSM_CHAR_LIST_DATA: type_str = "Char List"; break; case WSM_SHORT_LIST_DATA: type_str = "Short List"; break; case WSM_LONG_LIST_DATA: type_str = "Long List"; break; case WSM_VALUE_DATA: case WSM_NONE: type_str = ""; break; } sprintf(str, "%sName: %s, Type: %s, Len: %d\n%s%s", tab_str, XrmQuarkToString(win_data->nameq), type_str, win_data->data_len, tab_str, " "); for (i = 0; i < win_data->data_len; i++) { str += strlen(str); switch(win_data->type) { case WSM_CHAR_LIST_DATA: sprintf(str, "%c(%d)", win_data->data.char_ptr[i], (int) win_data->data.char_ptr[i]); break; case WSM_SHORT_LIST_DATA: sprintf(str, "%d", (int) win_data->data.short_ptr[i]); break; case WSM_LONG_LIST_DATA: sprintf(str, "%ld", win_data->data.long_ptr[i]); break; case WSM_VALUE_DATA: case WSM_NONE: break; } if (i < (win_data->data_len - 1)) strcat(str, ", "); } strcat(str, "\n"); } /* Function Name: PrintConfigFormat * Description: Prints the configuration format. * Arguments: str - The string to print the conf info into. * config_fmt - The configuration format reply. * Returns: none */ static void PrintConfigFormat( String str, WSMConfigFormatReply *config_fmt) { register int i; sprintf("Accepts Diffs: %s\n", (config_fmt->accepts_diffs ? "True" : "False")); for (i = 0; i < 3; i++) { WSMAttribute *fmt; register int j, num; str += strlen(str); switch (i) { case WSM_GLOBAL_FMT: fmt = config_fmt->global_formats; num = config_fmt->num_global_formats; sprintf(str, "Global Formats - Number: %d\n", num); break; case WSM_WINDOW_FMT: fmt = config_fmt->window_formats; num = config_fmt->num_window_formats; sprintf(str, "Window Formats - Number: %d\n", num); break; case WSM_ICON_FMT: fmt = config_fmt->icon_formats; num = config_fmt->num_icon_formats; sprintf(str, "Icon Formats - Number: %d\n", num); break; } for (j = 0; j < num; j++) { str += strlen(str); sprintf(str, " Name: %s, Size: %d, Is_List: %s\n", XrmQuarkToString(fmt[j].nameq), (int) fmt[j].size, fmt[j].is_list ? "True" : "False"); } } } motif-2.3.8/clients/mwm/WmWsmLib/util.c0000644000175000017500000001332212672140200014641 00000000000000/* $XConsortium: util.c /main/5 1995/07/15 20:38:54 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" /************************************************************ * * Routines for converting from targets to names to atoms. * ************************************************************/ /* Function Name: _WSMReqTypeToName * Description: Given a request type, return its name, used mostly * for error messages. * Arguments: req_type - The request type to check. * Returns: a string that is the name of the request. */ String _WSMReqTypeToName(WSMRequestType req_type) { switch (req_type) { case WSM_CONNECT: return("Connect"); case WSM_EXTENSIONS: return("Extensions"); case WSM_CONFIG_FMT: return("Config Format"); case WSM_GET_STATE: return("Get State"); case WSM_SET_STATE: return("Set State"); case WSM_REG_WINDOW: return("Register Window"); default: return("unknown"); } } /* Function Name: _WSMTargetToReqType * Description: Given a target (Atom) and a display, returns the * request type associated with this atom. * Arguments: dpy - The display. * target - The atom that needs to be mapped to a request. * Returns: The request type. */ WSMRequestType _WSMTargetToReqType(Display *dpy, Atom target) { WSMDispInfo *disp_atoms = _WSMGetDispInfo(dpy); if (target == disp_atoms->connect) return(WSM_CONNECT); if (target == disp_atoms->extensions) return(WSM_EXTENSIONS); if (target == disp_atoms->config_fmt) return(WSM_CONFIG_FMT); if (target == disp_atoms->get_state) return(WSM_GET_STATE); if (target == disp_atoms->set_state) return(WSM_SET_STATE); if (target == disp_atoms->reg_window) return(WSM_REG_WINDOW); /* * Atom doesn't match any request, generate error message. */ return(WSM_UNKNOWN); } /* Function Name: _WSMReqTypeToTarget * Description: Given a request type and a display, return the target * (Atom) that maps to it. * Arguments: dpy - The display. * req_type - The request type id. * Returns: The atom that maps to this request type on this display. */ Atom _WSMReqTypeToTarget(Display *dpy, WSMRequestType req_type) { WSMDispInfo *disp_atoms = _WSMGetDispInfo(dpy); switch (req_type) { case WSM_CONNECT: return(disp_atoms->connect); case WSM_EXTENSIONS: return(disp_atoms->extensions); case WSM_CONFIG_FMT: return(disp_atoms->config_fmt); case WSM_GET_STATE: return(disp_atoms->get_state); case WSM_SET_STATE: return(disp_atoms->set_state); case WSM_REG_WINDOW: return(disp_atoms->reg_window); default: break; } return(None); /* Universal null atom. */ } /* Function Name: _WSMRequiresConfigFormat * Description: Returns True if this request requires a valid config * formats. * Arguments: request_type - the request type to check. * Returns: True if config format required for this request. */ Boolean _WSMRequiresConfigFormat(WSMRequestType request_type) { switch (request_type) { case WSM_GET_STATE: case WSM_SET_STATE: case WSM_REG_WINDOW: return(True); default: break; } return(False); } /* Function Name: _WSMGetConfigFormatType * Description: Gets the config format type for this window. * Arguments: win - The window to check. * Returns: The config format type that matches the window passed. */ WSMConfigFormatType _WSMGetConfigFormatType(Window win) { if (win == None) return(WSM_GLOBAL_FMT); if (win & ~WIN_MASK) return(WSM_ICON_FMT); return(WSM_WINDOW_FMT); } /* Function Name: _WSMGetMatchingAttr * Description: Gets the attribute from the format data passed * that matches the the name passed. * Arguments: nameq - The name to match stored as a quark. * fmt_data - the config format data to check against. * Returns: The attribute information that matches the name passed or NULL */ WSMAttribute * _WSMGetMatchingAttr(XrmQuark nameq, WSMConfigFormatData *fmt_data) { register int i; WSMAttribute * attr = fmt_data->attr_list; for (i = 0; i < fmt_data->num_attrs; i++, attr++) { if (nameq == attr->nameq) return(attr); } return(NULL); } /* Function Name: _WSMGetMatchingWinData * Description: Gets the window data in the list passed whose name * matches quark passed. * Arguments: win_data_top - The top of the window data list. * num - The number of items in the window data list. * nameq - The name to match. * Returns: The matching window data or NULL. */ WSMWinData * _WSMGetMatchingWinData(WSMWinData *win_data_top, int num, XrmQuark nameq) { register int i; WSMWinData *local = win_data_top; for (i = 0; i < num; i++, local++) { if (local->nameq == nameq) return(local); } return(NULL); } motif-2.3.8/clients/mwm/WmWsmLib/utm_send.h0000644000175000017500000000267012672140200015513 00000000000000/* $XConsortium: utm_send.h /main/5 1995/07/15 20:39:04 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* * This is used to pass the data from the request * setup routine to the callback routine where the * data is actually transferred. */ typedef struct _UTMPackageRec { int fmt; Atom target; unsigned long len; XtPointer param; XtCallbackProc doneProc; XtPointer closure; } UTMPackageRec; extern void UTMSendMessage( Widget, Atom, Atom, XtPointer, unsigned long, int, XtCallbackProc, XtPointer, Time ); extern void UTMDestinationProc ( Widget, XtPointer, XtPointer ); motif-2.3.8/clients/mwm/WmWsmLib/pack.c0000644000175000017500000012313112672140200014602 00000000000000/* $XConsortium: pack.c /main/5 1995/07/15 20:38:40 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" /* this will redifine bzero to memset if needed. */ #include #define COUNT_SIZE (sizeof(CARD16)) #define BOOL_SIZE 1 /* at least 1 byte for a boolean. */ /* * More intuitive names for various functions. */ #define PackBoolean(d, num) PackCARD8((d), (CARD8) (num)) #define PackListNum(d, num) PackCARD16((d), (CARD16) (num)) #define PackWindow(d, num) PackCARD32((d), (CARD32) (num)) #define PackProperty(d, num) PackCARD32((d), (CARD32) (num)) #define UnpackBoolean(data) ((Boolean) UnpackCARD8(data)) #define UnpackListNum(data) ((int) UnpackCARD16(data)) #define UnpackWindow(data) ((Window) UnpackCARD32(data)) #define UnpackProperty(data) ((WindowProperty) UnpackCARD32(data)) #define START_CHECK_MASK 0x80 /************************************************************ * * Function definitions. * ************************************************************/ /* * Routines for getting the amount of space that a request will take in the * protocol data stream. */ static int WinInfoSizePacked(Display *, int, WSMWinInfo *); static int WinEntrySizePacked(Display *, int, WSMWinEntry *); static int WinDataSizePacked(Display *, int, WSMWinData *, int, WSMConfigFormatType); /* * Routines for packing protocol data stream. */ static MessageData PackConfigFormat(MessageData, WSMConfigFormatReply *); static MessageData PackSingleAttribute(MessageData, WSMAttribute *, int); static MessageData PackWinInfo(Display *, int, MessageData, WSMWinInfo *); static MessageData PackWinEntry(Display *, int, MessageData, WSMWinEntry *); static MessageData PackWinData(Display *, int, MessageData, WSMWinData *, int, WSMConfigFormatType); /* public */ MessageData PackCARD16(MessageData, CARD16); /* public */ MessageData PackCARD8(MessageData, CARD8); /* public */ MessageData PackString(MessageData, String); /* public */ MessageData PackCARD32(MessageData, CARD32); /* * Routines for unpacking protocol data stream. */ static void UnpackWinData(MessageData *, Display *, int, WSMConfigFormatType, WSMWinData **, int *); static void UnpackSingleWinDataRec(MessageData *, WSMAttribute *,WSMWinData *); static void UnpackWinInfo(MessageData *, Display *, int, WSMWinInfo *); static void UnpackWinEntry(MessageData *, Display *, int, WSMWinEntry *); /* public */ String UnpackString(MessageData *); /* public */ CARD32 UnpackCARD32(MessageData *); /* public */ CARD16 UnpackCARD16(MessageData *); /* public */ CARD8 UnpackCARD8(MessageData *); /************************************************************ * * These two routines take data stored in a structure that * humans can understand and pack it down into nice little * protocol requests defined by the OSF WSM Protocol spec. * ************************************************************/ /* Function Name: _WSMPackRequest * Description: Packs up the request passed into an appropriate * message data structure. * Arguments: dpy - the display we will be sending this message on. * screen_num - The screen we will be sending this message to. * request - request to send. * RETURNED msg_data_len - The length of the message data. * RETURNED error - An error code if something went wrong. * Returns: A pointer to a message data struct. * * NOTE: The message data struct must be freed by the calling routine. */ MessageData _WSMPackRequest(Display *dpy, int screen_num, WSMRequest *request, unsigned long *msg_data_len, WSMErrorCode *error) { MessageData data, save; int i; long size; WSMWinInfo *win_info; WSMConfigFormatData *global_attrs, *win_attrs, *icon_attrs; *msg_data_len = 0; /* default value. */ global_attrs = _WSMGetConfigFormat(dpy, screen_num, WSM_GLOBAL_FMT); win_attrs = _WSMGetConfigFormat(dpy, screen_num, WSM_WINDOW_FMT); icon_attrs = _WSMGetConfigFormat(dpy, screen_num, WSM_ICON_FMT); *error = WSM_SUCCESS; if (_WSMRequiresConfigFormat(request->any.type) && (global_attrs->num_attrs == 0) && (win_attrs->num_attrs == 0) && (icon_attrs->num_attrs == 0)) { *error = WSM_ERROR_NO_CONFIG_FORMAT; return(NULL); } if (((request->any.type == WSM_CONNECT) || (request->any.type == WSM_CONFIG_FMT)) && ((global_attrs->num_attrs != 0) || (win_attrs->num_attrs != 0) || (icon_attrs->num_attrs != 0))) { *error = WSM_ERROR_ALREADY_HAVE_CONFIG_FORMAT; return(NULL); } /* before sending extensions make sure screen_info config format is cleared */ /* may want to remove this and leave it up to application writer */ if ((request->any.type == WSM_EXTENSIONS) && ((global_attrs->num_attrs != 0) || (win_attrs->num_attrs != 0) || (icon_attrs->num_attrs != 0))) { _WSMClearConfigScreenInfo(dpy,screen_num); } /* * Calculate the size of the request. */ switch (request->any.type) { case WSM_CONNECT: size = COUNT_SIZE; size += sizeof(CARD8) * request->connect.num_versions; break; case WSM_EXTENSIONS: size = COUNT_SIZE; for (i = 0; i < request->extensions.num_extensions; i++) { size += (strlen(request->extensions.extension_suggestions[i]) + COUNT_SIZE); } break; case WSM_CONFIG_FMT: size = 0; break; case WSM_GET_STATE: size = sizeof(CARD32) + BOOL_SIZE; break; case WSM_SET_STATE: size = COUNT_SIZE; /* The count of window info. */ win_info = request->set_state.win_info_list; for (i = 0; i < request->set_state.num_win_info_list; i++,win_info++) size += WinInfoSizePacked(dpy, screen_num, win_info); break; case WSM_REG_WINDOW: size = sizeof(CARD32); break; case WSM_WM_GET_BACKGROUND_WINDOW: size = sizeof(CARD16); break; case WSM_WM_SET_BACKGROUND_WINDOW: size = sizeof(CARD32); break; case WSM_WM_WINDOWS: size = sizeof(CARD32); /* flag */ size += COUNT_SIZE; /* prop count */ size += request->wm_windows.num_window_properties * sizeof(Window); size += COUNT_SIZE; /* num match attributes */ for (i=0; iwm_windows.num_match_attributes; i++) { size += COUNT_SIZE; /* num attributes */ size += 2 * request->wm_windows.match_attributes[i]->num_attributes * sizeof(WindowProperty); } break; case WSM_WM_FOCUS: size = 0; break; case WSM_WM_POINTER: size = 0; break; default: return(NULL); } save = data = (MessageData) XtMalloc(size); /* * Fill in the message. */ switch (request->any.type) { case WSM_CONNECT: data = PackListNum(data, request->connect.num_versions); for (i = 0; i < request->connect.num_versions; i++) data = PackCARD8(data, (CARD8) request->connect.known_versions[i]); break; case WSM_EXTENSIONS: data = PackListNum(data, request->extensions.num_extensions); for (i = 0; i < request->extensions.num_extensions; i++) data=PackString(data,request->extensions.extension_suggestions[i]); break; case WSM_CONFIG_FMT: break; case WSM_GET_STATE: data = PackWindow(data, request->get_state.window); (void) PackBoolean(data, request->get_state.diffs_allowed); break; case WSM_SET_STATE: win_info = request->set_state.win_info_list; data = PackListNum(data, request->set_state.num_win_info_list); for (i = 0; i < request->set_state.num_win_info_list; i++, win_info++) data = PackWinInfo(dpy, screen_num, data, win_info); break; case WSM_REG_WINDOW: (void) PackWindow(data, request->register_window.window); break; case WSM_WM_GET_BACKGROUND_WINDOW: (void) PackCARD16(data, request->get_background.screen); break; case WSM_WM_SET_BACKGROUND_WINDOW: (void) PackWindow(data, request->set_background.window); break; case WSM_WM_WINDOWS: { int i, j; data = PackCARD32(data, request->wm_windows.location_flag); data = PackListNum(data, request->wm_windows.num_window_properties); for (i=0; iwm_windows.num_window_properties; i++) data = PackProperty(data, request->wm_windows.window_properties[i]); data = PackListNum(data, request->wm_windows.num_match_attributes); for (i = 0; i < request->wm_windows.num_match_attributes; i++) { AttributePair *match_attr; match_attr = request->wm_windows.match_attributes[i]; data = PackListNum(data, match_attr->num_attributes); for (j = 0; j < match_attr->num_attributes; j++) data = PackProperty(data, match_attr->allowed_attributes[j]); for (j = 0; j < match_attr->num_attributes; j++) data = PackProperty(data, match_attr->prohibited_attributes[j]); } } break; case WSM_WM_FOCUS: break; case WSM_WM_POINTER: break; default: break; } *msg_data_len = size; return(save); } /* _WSMPackRequest */ /* Function Name: _WSMPackReply * Description: Packs up the Reply passed into an appropriate * message data structure. * Arguments: dpy - the display we will be sending this message on. * screen_num - The screen we will be sending this message to. * reply - reply to send. * RETURNED msg_data_len - The length of the message data. * Returns: A pointer to a message data struct. * * NOTE: The message data struct must be freed by the calling routine. */ MessageData _WSMPackReply(Display *dpy, int screen_num, WSMReply *reply, unsigned long *msg_data_len) { WSMAttribute *attr; WSMWinInfo *win_info; WSMWinEntry *win_entry; register int i; long size; MessageData data, save; *msg_data_len = 0; /* default value. */ switch (reply->any.type) { case WSM_CONNECT: size = sizeof(CARD8); break; case WSM_EXTENSIONS: size = COUNT_SIZE; for (i = 0; i < reply->extensions.num_extensions; i++) { size += (strlen(reply->extensions.extensions[i]) + COUNT_SIZE); } break; case WSM_CONFIG_FMT: size = BOOL_SIZE; /* accept_diffs. */ size += COUNT_SIZE; /* The count of global attributes. */ attr = reply->config_format.global_formats; for (i = 0; i < reply->config_format.num_global_formats; i++) { /* * Bytes in string */ size += strlen(XrmQuarkToString(attr[i].nameq)) * sizeof(CARD8); /* * len of string + size + is_list. */ size += COUNT_SIZE + sizeof(CARD8) + BOOL_SIZE; } size += COUNT_SIZE; /* The count of window attributes. */ attr = reply->config_format.window_formats; for (i = 0; i < reply->config_format.num_window_formats; i++) { /* * Bytes in string */ size += strlen(XrmQuarkToString(attr[i].nameq)) * sizeof(CARD8); /* * len of string + size + is_list. */ size += COUNT_SIZE + sizeof(CARD8) + BOOL_SIZE; } size += COUNT_SIZE; /* The count of icon attributes. */ attr = reply->config_format.icon_formats; for (i = 0; i < reply->config_format.num_icon_formats; i++) { /* * Bytes in string */ size += strlen(XrmQuarkToString(attr[i].nameq)) * sizeof(CARD8); /* * len of string + size + is_list. */ size += COUNT_SIZE + sizeof(CARD8) + BOOL_SIZE; } break; case WSM_GET_STATE: size = COUNT_SIZE; /* The count of window info. */ win_info = reply->get_state.win_info_list; for (i = 0; i < reply->get_state.num_win_info_list; i++,win_info++) size += WinInfoSizePacked(dpy, screen_num, win_info); break; case WSM_SET_STATE: size = 0; break; case WSM_REG_WINDOW: size = WinDataSizePacked(dpy, screen_num, reply->register_window.window_data, reply->register_window.num_window_data, WSM_WINDOW_FMT); break; case WSM_WM_GET_BACKGROUND_WINDOW: size = sizeof(CARD32); break; case WSM_WM_SET_BACKGROUND_WINDOW: size = sizeof(CARD32); break; case WSM_WM_WINDOWS: size = COUNT_SIZE; /* The count of window entries. */ win_entry = reply->wm_windows.win_entry_list; for (i = 0; i < reply->wm_windows.num_win_entry_list; i++,win_entry++) size += WinEntrySizePacked(dpy, screen_num, win_entry); break; case WSM_WM_FOCUS: size = sizeof(CARD32); break; case WSM_WM_POINTER: size = sizeof(CARD32); /* window */ size += sizeof(CARD32); /* flag */ break; default: /* * ||| Error Message. */ return(NULL); } save = data = (MessageData) XtMalloc(size); switch (reply->any.type) { case WSM_CONNECT: (void) PackCARD8(data, (CARD8) (reply->connect.version & 0xFF)); break; case WSM_EXTENSIONS: data = PackListNum(data, reply->extensions.num_extensions); for (i = 0; i < reply->extensions.num_extensions; i++) data = PackString(data, reply->extensions.extensions[i]); break; case WSM_CONFIG_FMT: PackConfigFormat(data, &(reply->config_format)); break; case WSM_GET_STATE: win_info = reply->get_state.win_info_list; data = PackListNum(data, reply->get_state.num_win_info_list); for (i = 0; i < reply->get_state.num_win_info_list; i++, win_info++) data = PackWinInfo(dpy, screen_num, data, win_info); break; case WSM_SET_STATE: break; case WSM_REG_WINDOW: data = PackWinData(dpy, screen_num, data, reply->register_window.window_data, reply->register_window.num_window_data, WSM_WINDOW_FMT); break; case WSM_WM_GET_BACKGROUND_WINDOW: (void) PackWindow(data, reply->get_background.window); break; case WSM_WM_SET_BACKGROUND_WINDOW: (void) PackWindow(data, reply->set_background.window); break; case WSM_WM_WINDOWS: win_entry = reply->wm_windows.win_entry_list; data = PackListNum(data, reply->wm_windows.num_win_entry_list); for (i = 0; i < reply->wm_windows.num_win_entry_list; i++, win_entry++) data = PackWinEntry(dpy, screen_num, data, win_entry); break; case WSM_WM_FOCUS: (void) PackWindow(data, reply->wm_focus.window); break; case WSM_WM_POINTER: (void) PackWindow(data, reply->wm_pointer.window); (void) PackCARD32(data, reply->wm_pointer.location_flag); break; default: break; } *msg_data_len = size; return(save); }/* _WSMPackReply */ /************************************************************ * * These routines take data on the wire and put it into a structure * that can be manipulated by the app. * ************************************************************/ /* Function Name: _WSMUnpackRequest * Description: Unpacks the byte stream from the wire into a request * message structure. * Arguments: dpy - The Display. * screen_num - The Screen number. * data - The bits from accross the wire. * len - The number of bits sent - Better error checking * makes this more necessary. * type - The type of message received. * RETURNED request - This request structure is filled in with the data * unpacked from the protocol. * Returns: none. */ /*ARGSUSED*/ void _WSMUnpackRequest(Display *dpy, int screen_num, MessageData data, unsigned long len, WSMRequestType type, WSMRequest *request) { register int i; request->any.type = type; /* Save the type. */ request->any.allocated = False; switch (request->any.type) { case WSM_CONNECT: request->connect.num_versions = UnpackListNum(&data); request->connect.known_versions = (short *) XtMalloc(sizeof(short) * request->connect.num_versions); request->connect.allocated = True; for (i = 0; i < request->connect.num_versions; i++) request->connect.known_versions[i] = (short) UnpackCARD8(&data); break; case WSM_EXTENSIONS: { register int num; register String *ptr; num = request->extensions.num_extensions = UnpackListNum(&data); ptr = (String *) XtMalloc(sizeof(String) * num); request->extensions.extension_suggestions = ptr; request->extensions.allocated = True; for (i = 0; i < num; i++, ptr++) *ptr = UnpackString(&data); } break; case WSM_CONFIG_FMT: break; case WSM_GET_STATE: request->get_state.window = UnpackWindow(&data); request->get_state.diffs_allowed = UnpackBoolean(&data); break; case WSM_SET_STATE: { int num = UnpackListNum(&data); request->set_state.num_win_info_list = num; request->set_state.win_info_list = (WSMWinInfo *) XtMalloc(sizeof(WSMWinInfo) * num); request->extensions.allocated = True; for (i = 0; i < num; i++) { UnpackWinInfo(&data, dpy, screen_num, request->set_state.win_info_list + i); } } break; case WSM_REG_WINDOW: request->register_window.window = UnpackWindow(&data); break; case WSM_WM_GET_BACKGROUND_WINDOW: request->get_background.screen = (int)UnpackCARD16(&data); break; case WSM_WM_SET_BACKGROUND_WINDOW: request->set_background.window = UnpackWindow(&data); break; case WSM_WM_WINDOWS: { int num, i, j; request->extensions.allocated = True; request->wm_windows.location_flag = UnpackCARD32(&data); num = request->wm_windows.num_window_properties = UnpackListNum(&data); request->wm_windows.window_properties = (WindowProperty *) XtMalloc(sizeof(WindowProperty) * num); for (i=0; iwm_windows.window_properties[i] = UnpackProperty(&data); num = request->wm_windows.num_match_attributes = UnpackListNum(&data); request->wm_windows.match_attributes = (AttributePair **) XtMalloc(sizeof(AttributePair*) * num); for (i=0; iwm_windows.num_match_attributes; i++) { num = UnpackListNum(&data); request->wm_windows.match_attributes[i] = (AttributePair *) XtMalloc(sizeof(AttributePair) * num * 2 + sizeof(int)); request->wm_windows.match_attributes[i]->num_attributes = num; for (j=0; jwm_windows.match_attributes[i]->allowed_attributes[j] = UnpackProperty(&data); } for (j=0; jwm_windows.match_attributes[i]->prohibited_attributes[j] = UnpackProperty(&data); } } } break; case WSM_WM_FOCUS: break; case WSM_WM_POINTER: break; default: break; } } /* _WSMUnpackRequest */ /* Function Name: _WSMUnpackReply * Description: Unpacks the byte stream from the wire into a reply * message structure. * Arguments: dpy - The Display. * screen_num - The Screen number. * data - the bits from accross the wire. * len - The number of bits sent - Better error checking * makes this more necessary. * type - The type of message received. * RETURNED reply - This reply structure is filled in with the data * unpacked from the protocol. * Returns: none. */ /*ARGSUSED*/ void _WSMUnpackReply(Display *dpy, int screen_num, MessageData data, unsigned long len, WSMRequestType type, WSMReply *reply) { register int i; reply->any.type = type; /* Save the type. */ reply->any.allocated = False; switch (reply->any.type) { case WSM_CONNECT: if (data != NULL) reply->connect.version = (short) UnpackCARD8(&data); else fprintf(stderr, "Error - Connection request reply data is empty!\n"); break; case WSM_EXTENSIONS: { register int num; register String *ptr; num = reply->extensions.num_extensions = UnpackListNum(&data); ptr = (String *) XtMalloc(sizeof(String) * num); reply->extensions.allocated = True; reply->extensions.extensions = ptr; for (i = 0; i < num; i++, ptr++) *ptr = UnpackString(&data); } break; case WSM_CONFIG_FMT: { register int types; WSMConfigFormatReply * config_format = &(reply->config_format); WSMConfigFormatData *fmt; WSMScreenInfo *scr_info = _WSMGetScreenInfo(dpy, screen_num); config_format->accepts_diffs = UnpackBoolean(&data); for (types = 0; types < 3; types++) { switch(types) { case WSM_GLOBAL_FMT: fmt = &(scr_info->global); break; case WSM_WINDOW_FMT: fmt = &(scr_info->window); break; case WSM_ICON_FMT: fmt = &(scr_info->icon); break; } fmt->num_attrs = UnpackListNum(&data); fmt->attr_list = (WSMAttribute *) XtMalloc(sizeof(WSMAttribute) * fmt->num_attrs); for (i = 0; i < fmt->num_attrs; i++) { String str = UnpackString(&data); fmt->attr_list[i].nameq = XrmStringToQuark(str); XtFree(str); fmt->attr_list[i].size = UnpackCARD8(&data); fmt->attr_list[i].is_list = UnpackCARD8(&data); } } /* * No need to allocate this, since they are just pointers * back to global data. */ config_format->global_formats = scr_info->global.attr_list; config_format->num_global_formats = scr_info->global.num_attrs; config_format->window_formats = scr_info->window.attr_list; config_format->num_window_formats = scr_info->window.num_attrs; config_format->icon_formats = scr_info->icon.attr_list; config_format->num_icon_formats = scr_info->icon.num_attrs; } break; case WSM_GET_STATE: { int num =reply->get_state.num_win_info_list = UnpackListNum(&data); reply->get_state.win_info_list = (WSMWinInfo *) XtMalloc(sizeof(WSMWinInfo) * num); reply->get_state.allocated = True; for (i = 0; i < num; i++) UnpackWinInfo(&data, dpy, screen_num, reply->get_state.win_info_list + i); } break; case WSM_SET_STATE: break; case WSM_REG_WINDOW: if (data != NULL) { UnpackWinData(&data, dpy, screen_num, WSM_WINDOW_FMT, &(reply->register_window.window_data), &(reply->register_window.num_window_data)); reply->register_window.allocated = True; } else fprintf(stderr, "Error - Register Window reply data is empty!\n"); break; case WSM_WM_GET_BACKGROUND_WINDOW: reply->get_background.window = UnpackWindow(&data); break; case WSM_WM_SET_BACKGROUND_WINDOW: reply->set_background.window = UnpackWindow(&data); break; case WSM_WM_WINDOWS: { int num; num = reply->wm_windows.num_win_entry_list = UnpackListNum(&data); reply->wm_windows.win_entry_list = (WSMWinEntry *) XtMalloc(sizeof(WSMWinEntry) * num); reply->wm_windows.allocated = True; for (i = 0; i < num; i++) UnpackWinEntry(&data, dpy, screen_num, reply->wm_windows.win_entry_list + i); } break; case WSM_WM_FOCUS: reply->wm_focus.window = UnpackWindow(&data); break; case WSM_WM_POINTER: reply->wm_pointer.location_flag = UnpackCARD32(&data); break; default: break; } } /* _WSMUnpackReply */ /************************************************************ * * Internal Routines for getting size of packed requests. * ************************************************************/ /* Function Name: WinInfoSizePacked * Description: Returns the size this window structure will take * when packed into a protocol data stream. * Arguments: dpy, screen_num - The display and screen of the client we * are talking to. * win_info - The window info whose size me are checking. * Returns: the size (in bytes) */ static int WinInfoSizePacked(Display *dpy, int screen_num, WSMWinInfo *win_info) { int size = sizeof(CARD32); size += WinDataSizePacked(dpy, screen_num, win_info->data_list, win_info->num_data_list, _WSMGetConfigFormatType(win_info->window)); return(size); } /* Function Name: WinEntrySizePacked * Description: Returns the size this window structure will take * when packed into a protocol data stream. * Arguments: dpy, screen_num - The display and screen of the client we * are talking to. * win_entry - The window entry whose size we are checking. * Returns: the size (in bytes) */ static int WinEntrySizePacked(Display *dpy, int screen_num, WSMWinEntry *win_entry) { int size; size = sizeof(CARD32); size += sizeof(CARD32) * win_entry->num_windows; size = sizeof(CARD32); size += sizeof(WindowProperty) * win_entry->num_match_properties; return(size); } /* Function Name: WinDataSizePacked * Description: The size that will be taken up with this window data * once it is packed into the protocol stream. * Arguments: dpy, screen_num - The screen nmuber and display that * we are talking to. * win_data - The data stored in a window data structure list. * num - number of items in the list. * fmt - The type of format to use to pack this data. * Returns: The size. */ static int WinDataSizePacked(Display *dpy, int screen_num, WSMWinData *win_data, int num, WSMConfigFormatType fmt) { register int i, size; WSMConfigFormatData *fmt_data = _WSMGetConfigFormat(dpy, screen_num, fmt); size = fmt_data->num_attrs / 8 + 1; /* Size of header bits. */ for ( i = 0; i < num; i++, win_data++) { WSMAttribute *attr = _WSMGetMatchingAttr(win_data->nameq, fmt_data); if (attr == NULL) { /* * ||| ERROR. */ continue; } switch(win_data->type) { case WSM_VALUE_DATA: size += attr->size/8; break; default: /* All others are lists. */ size += COUNT_SIZE; size += ((attr->size/8) * win_data->data_len); break; } } return(size); } /************************************************************ * * Internal Routines for packing data into the protocol stream. * ************************************************************/ /* Function Name: PackString * Description: Packs a string into the data stream. * Arguments: data - The data stream to pack into. * str - The string to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackString(MessageData data, String str) { register int i, len = strlen(str); data = PackListNum(data, len); for (i = 0; i < len; i++, str++) data = PackCARD8(data, *str); return(data); } /* Function Name: PackConfigFormat * Description: Packs the configuration format into the data stream. * Arguments: data - the datastream. * config - the reply config format message. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackConfigFormat(MessageData data, WSMConfigFormatReply *config) { data = PackBoolean(data, config->accepts_diffs); data = PackSingleAttribute(data, config->global_formats, config->num_global_formats); data = PackSingleAttribute(data, config->window_formats, config->num_window_formats); data = PackSingleAttribute(data, config->icon_formats, config->num_icon_formats); return(data); } /* Function Name: PackSingleAttribute * Description: Packs a single attribute into a the data stream. * Arguments: data - the datastream. * attr_list, num - The attribute list to pack into the stream. * The number of items in the list. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackSingleAttribute(MessageData data, WSMAttribute *attr_list, int num) { register int i; data = PackListNum(data, num); for (i = 0; i < num; i++, attr_list++) { data = PackString(data, XrmQuarkToString(attr_list->nameq)); data = PackCARD8(data, (CARD8) attr_list->size); data = PackBoolean(data, attr_list->is_list); } return(data); } /* Function Name: PackWinInfo * Description: Packs the window information into the data stream. * Arguments: dpy, screen_num - The display and screen of the client * that we are talking to. * data - The message stream. * win_info - The window info list to pack into the data stream. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackWinInfo(Display *dpy, int screen_num, MessageData data, WSMWinInfo *win_info) { data = PackWindow(data, win_info->window); return(PackWinData(dpy, screen_num, data, win_info->data_list, win_info->num_data_list, _WSMGetConfigFormatType(win_info->window))); } /* Function Name: PackWinEntry * Description: Packs the window information into the data stream. * Arguments: dpy, screen_num - The display and screen of the client * that we are talking to. * data - The message stream. * win_info - The window info list to pack into the data stream. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackWinEntry(Display *dpy, int screen_num, MessageData data, WSMWinEntry *win_entry) { int i; data = PackListNum(data, win_entry->num_windows); for (i = 0; i < win_entry->num_windows; i++) data = PackWindow(data, win_entry->windows[i]); data = PackListNum(data, win_entry->num_match_properties); for (i = 0; i < win_entry->num_match_properties; i++) data = PackProperty(data, win_entry->match_properties[i]); return(data); } /* Function Name: PackWinData * Description: Packs the window data into the data stream. * Arguments: dpy, screen_num - The display and screen of the client * that we are talking to. * data - The message stream. * win_data, num - The window data to pack * into the data stream, and its size. * fmt - The type of config format to use. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackWinData(Display *dpy, int screen_num, MessageData data, WSMWinData *win_data, int num, WSMConfigFormatType fmt) { WSMConfigFormatData *conf_fmt = _WSMGetConfigFormat(dpy, screen_num, fmt); MessageData mask_pos = data; WSMAttribute *attr; register int i, size = (conf_fmt->num_attrs / 8) + 1; data = (MessageData) ((char *)data + size); bzero((char *) mask_pos, size); /* Set all bits to zero initially*/ attr = conf_fmt->attr_list; for (i = 0; i < conf_fmt->num_attrs ; i++, attr++) { WSMWinData *this_data; this_data = _WSMGetMatchingWinData(win_data, num, attr->nameq); if (this_data != NULL) { if (this_data->type != WSM_VALUE_DATA) data = PackListNum(data, this_data->data_len); switch(this_data->type) { case WSM_CHAR_LIST_DATA: { register int j; char * ptr = this_data->data.char_ptr; for (j = 0 ; j < this_data->data_len; j++, ptr++) data = PackCARD8(data, (CARD8) *ptr); break; } case WSM_SHORT_LIST_DATA: { register int j; short * ptr = this_data->data.short_ptr; for (j = 0 ; j < this_data->data_len; j++, ptr++) data = PackCARD16(data, (CARD16) *ptr); break; } case WSM_LONG_LIST_DATA: { register int j; long * ptr = this_data->data.long_ptr; for (j = 0 ; j < this_data->data_len; j++, ptr++) data = PackCARD32(data, (CARD32) *ptr); break; } case WSM_VALUE_DATA: switch(attr->size) { case 8: data = PackCARD8(data, (CARD8) this_data->data.value); break; case 16: data = PackCARD16(data, (CARD16) this_data->data.value); break; case 32: data = PackCARD32(data, (CARD32) this_data->data.value); break; } case WSM_NONE: break; } /* * The first item sets the MSBit, the 8th Item sets the LSBit. * The Nineth sets the MSBit in the second byte. The unused * bits are the LSBits of the last byte. */ (*(unsigned char *)mask_pos) |= (char)(1 << (7 - (i % 8))); } /* * When we get to the end of a char, move to the next one. */ if ((i % 8) == 7) mask_pos = ((char *)mask_pos + 1); } return(data); } /* Function Name: PackCARD32 * Description: Packs an 32 bit value into the data stream. * Arguments: data - The data stream to pack into. * val - The 32 bit value to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackCARD32(MessageData data, CARD32 val) { CARD16 bottom = val & (0xFFFF); CARD16 top = val >> 16; data = PackCARD16(data, top); data = PackCARD16(data, bottom); return(data); } /* Function Name: PackCARD16 * Description: Packs an 16 bit value into the data stream. * Arguments: data - The data stream to pack into. * val - The 16 bit value to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackCARD16(MessageData data, CARD16 val) { CARD8 bottom = val & (0xFF); CARD8 top = val >> 8; data = PackCARD8(data, top); data = PackCARD8(data, bottom); return(data); } /* Function Name: PackCARD8 * Description: Packs an 8 bit value into the data stream. * Arguments: data - The data stream to pack into. * val - The 8 bit value to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackCARD8(MessageData data, CARD8 val) { CARD8 *ptr = (CARD8 *) data; *ptr = (CARD8) val; data = ((char*)data) + 1; return(data); } /************************************************************ * * Internal routines for unpacking the data from the * protocol stream. * ************************************************************/ /* Function Name: UnpackWinData * Description: Unpacks the window data from the protocol stream. * Arguments: data_ptr - A pointer to the message data stream. * dpy, screen_num - The display and screen of the client * that we are talking to. * fmt - The window format to use. * RETURNED win_data - The window data information. * RETURNED num - The number of window data structs in "win_data". * Returns: none */ static void UnpackWinData(MessageData *data_ptr, Display *dpy, int screen_num, WSMConfigFormatType fmt, WSMWinData **win_data, int *num) { register int i, size; WSMConfigFormatData *conf_fmt = _WSMGetConfigFormat(dpy, screen_num, fmt); unsigned char *bit_mask, *current_mask, check_mask; WSMAttribute *attr; WSMWinData *ptr; /* * Figure out how many values have been specified so we know how much * memory to allocate. */ size = conf_fmt->num_attrs / 8 + 1; current_mask = bit_mask = (unsigned char *) XtMalloc(size); /* * Unpack the bits from the wire. */ for (i = 0; i < size; i++, current_mask++) *current_mask = UnpackCARD8(data_ptr); current_mask = bit_mask; check_mask = START_CHECK_MASK; for (*num = 0, i = 0; i < conf_fmt->num_attrs; i++) { if (*current_mask & check_mask) (*num)++; check_mask >>= 1; if ((i % 8) == 7) { current_mask++; check_mask = START_CHECK_MASK; } } ptr = *win_data = (WSMWinData *) XtMalloc(*num * sizeof(WSMWinData)); /* * For each value that was specified pack the data into the window * data record. */ current_mask = bit_mask; check_mask = START_CHECK_MASK; attr = conf_fmt->attr_list; for (i = 0; i < conf_fmt->num_attrs; i++, attr++) { if (*current_mask & check_mask) UnpackSingleWinDataRec(data_ptr, attr, ptr++); check_mask >>= 1; if ((i % 8) == 7) { current_mask++; check_mask = START_CHECK_MASK; } } XtFree((XtPointer) bit_mask); } /* Function Name: UnpackSingleWinDataRec * Description: Packs a single window data record. * Arguments: data_ptr - The data pointer. * attr - The attribute record that defines general information * on how to unpack this data. * win_data - the window data struct. * Returns: none */ static void UnpackSingleWinDataRec(MessageData *data_ptr, WSMAttribute *attr, WSMWinData *win_data) { register int i; /* * Set these no matter what the size. */ win_data->nameq = attr->nameq; /* Save the name. */ if (attr->is_list) { win_data->data_len = UnpackListNum(data_ptr); } else { win_data->type = WSM_VALUE_DATA; win_data->data_len = 0; /* unused... */ } /* * Based on the size, and whether or not this is a list, unpack * the data from the wire. */ switch(attr->size) { case 8: if (attr->is_list) { char *local; win_data->type = WSM_CHAR_LIST_DATA; local = win_data->data.char_ptr = (char *) XtMalloc(sizeof(char) * win_data->data_len); for (i = 0; i < win_data->data_len; i++, local++) *local = UnpackCARD8(data_ptr); } else win_data->data.value = UnpackCARD8(data_ptr); break; case 16: if (attr->is_list) { short *local; win_data->type = WSM_SHORT_LIST_DATA; local = win_data->data.short_ptr = (short *) XtMalloc(sizeof(short) * win_data->data_len); for (i = 0; i < win_data->data_len; i++, local++) *local = UnpackCARD16(data_ptr); } else win_data->data.value = UnpackCARD16(data_ptr); break; case 32: if (attr->is_list) { long *local; win_data->type = WSM_LONG_LIST_DATA; local = win_data->data.long_ptr = (long *) XtMalloc(sizeof(long) * win_data->data_len); for (i = 0; i < win_data->data_len; i++, local++) *local = UnpackCARD32(data_ptr); } else win_data->data.value = UnpackCARD32(data_ptr); break; } } /* Function Name: UnpackWinInfo * Description: Unpacks the window information from the protocol stream. * Arguments: data_ptr - A pointer to the message data stream. * dpy, screen_num - The display and screen of the client * that we are talking to. * win_info - The window information. * Returns: none */ static void UnpackWinInfo(MessageData *data, Display *dpy, int screen_num, WSMWinInfo *win_info) { win_info->window = UnpackWindow(data); UnpackWinData(data, dpy, screen_num, _WSMGetConfigFormatType(win_info->window), &(win_info->data_list), &(win_info->num_data_list)); } /* Function Name: UnpackWinEntry * Description: Unpacks the window entry information from the protocol stream. * Arguments: data_ptr - A pointer to the message data stream. * dpy, screen_num - The display and screen of the client * that we are talking to. * win_entry - The window entry information. * Returns: none */ static void UnpackWinEntry(MessageData *data, Display *dpy, int screen_num, WSMWinEntry *win_entry) { int i; win_entry->num_windows = UnpackListNum(data); win_entry->windows = (Window *) XtMalloc(sizeof(Window) * win_entry->num_windows); for (i=0; inum_windows; i++) win_entry->windows[i] = UnpackWindow(data); win_entry->num_match_properties = UnpackListNum(data); win_entry->match_properties = (WindowProperty *) XtMalloc(sizeof(WindowProperty) * win_entry->num_match_properties); for (i=0; inum_match_properties; i++) win_entry->match_properties[i] = UnpackProperty(data); } /* Function Name: UnpackString * Description: Unpacks a string from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the string from the data stream. * * NOTE: Data is modified to point to the next empty location in the stream. */ String UnpackString(MessageData *data_ptr) { register int i; int len = UnpackListNum(data_ptr); char *str, *top = XtMalloc((len + 1) * sizeof(char)); for (str = top, i = 0; i < len; i++, str++) { *str = (char) UnpackCARD8(data_ptr); } *str = '\0'; return((String) top); } /* Function Name: UnpackCARD32 * Description: Unpacks an 32 bit value from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the CARD32 from the data stream. * * NOTE: data is modified to point to the next empty location in the stream. */ CARD32 UnpackCARD32(MessageData *data_ptr) { CARD32 val = UnpackCARD16(data_ptr) << 16; val |= UnpackCARD16(data_ptr); return(val); } /* Function Name: UnpackCARD16 * Description: Unpacks an 16 bit value from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the CARD16 from the data stream. * * NOTE: data is modified to point to the next empty location in the stream. */ CARD16 UnpackCARD16(MessageData *data_ptr) { CARD16 val = UnpackCARD8(data_ptr) << 8; val |= UnpackCARD8(data_ptr); return(val); } /* Function Name: UnpackCARD8 * Description: Unpacks an 8 bit value from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the CARD8 from the data stream. * * NOTE: data is modified to point to the next empty location in the stream. */ CARD8 UnpackCARD8(MessageData *data_ptr) { CARD8 ret_val = *((char *) *data_ptr); *data_ptr = ((char *) *data_ptr) + 1; return(ret_val); } motif-2.3.8/clients/mwm/WmWsmLib/Makefile.am0000644000175000017500000000043612672140200015556 00000000000000MAINTAINERCLEANFILES = Makefile.in SRCS = debug.c disp.c free.c pack.c recv.c send.c util.c utm_send.c noinst_HEADERS = utm_send.h wsm_funcs.h wsm_proto.h INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} libWsm_a_SOURCES = $(SRCS) noinst_LIBRARIES = libWsm.a motif-2.3.8/clients/mwm/WmWsm.h0000644000175000017500000000175113145162623013256 00000000000000#ifndef _WM_WSM_H #define _WM_WSM_H /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ extern ClientData *GetPCD (int scr, Window win); #endif /* _WM_WSM_H */ motif-2.3.8/clients/mwm/WmColormap.h0000644000175000017500000000306013145162623014257 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void InitWorkspaceColormap (WmScreenData *pSD); extern void InitColormapFocus (WmScreenData *pSD); #ifndef OLD_COLORMAP extern void ForceColormapFocus (WmScreenData *pSD, ClientData *pCD); #endif extern void SetColormapFocus (WmScreenData *pSD, ClientData *pCD); extern void WmInstallColormap (WmScreenData *pSD, Colormap colormap); extern void ResetColormapData (ClientData *pCD, Window *pWindows, int count); #ifndef IBM_169380 extern void AddColormapWindowReference (ClientData *pCD, Window window); extern void RemoveColormapWindowReference (ClientData *pCD, Window window); #endif extern void ProcessColormapList (WmScreenData *pSD, ClientData *pCD); motif-2.3.8/clients/mwm/WmCPlace.c0000644000175000017500000003533513145162623013637 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmCPlace.c /main/5 1996/08/09 15:18:04 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #define XK_MISCELLANY #define XK_LATIN1 #include /* absolute value macro */ #ifndef ABS #define ABS(x) (((x) > 0) ? (x) : (-(x))) #endif #define GRAB_MASK (KeyPressMask | ButtonPressMask | ButtonReleaseMask |\ PointerMotionMask) #define PGRAB_MASK (ButtonPressMask | ButtonReleaseMask |\ PointerMotionMask | PointerMotionHintMask) #define NOFRZ_GRAB_MASK (KeyPressMask | ButtonPressMask |\ ButtonReleaseMask) #define NOFRZ_PGRAB_MASK (ButtonPressMask | ButtonReleaseMask) /* * include extern functions */ #include "WmCDInfo.h" #include "WmCDecor.h" #include "WmFeedback.h" #include "WmWinConf.h" /* * Global Variables: */ static int placeX; static int placeY; static unsigned int placeWidth; static unsigned int placeHeight; static Boolean placeResize; static Boolean placementDone; static int placePointerX; static int placePointerY; static int placeKeyMultiplier; static int placeOffsetX; static int placeOffsetY; /*************************************<->************************************* * * SetupPlacement (pcd) * * * Description: * ----------- * Perform the initialization for interactive placement * * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * * Comments: * -------- * o sets up global data and puts initial display on the screen * *************************************<->***********************************/ void SetupPlacement (ClientData *pcd) { int cX, cY, junk; Window junk_win; /* * Restore the state of the last "depressed" frame gadget */ if (wmGD.gadgetClient && wmGD.gadgetDepressed) { PopGadgetOut(wmGD.gadgetClient, wmGD.gadgetDepressed); } /* get offset of frame origin from window origin */ placeOffsetX = pcd->clientOffset.x; placeOffsetY = pcd->clientOffset.y; XQueryPointer (DISPLAY, ACTIVE_ROOT, &junk_win, &junk_win, &cX, &cY, &junk, &junk, (unsigned int *)&junk); /* convert to frame coordinates */ placePointerX = placeX = cX; placePointerY = placeY = cY; placeWidth = pcd->clientWidth; placeHeight = pcd->clientHeight; ClientToFrame (pcd, &cX, &cY, &placeWidth, &placeHeight); /* in "position" mode to start with */ placeResize = FALSE; wmGD.preMove = FALSE; /* normal window being dealt with, not icon */ wmGD.movingIcon = FALSE; if (wmGD.showFeedback & WM_SHOW_FB_PLACEMENT) { DoFeedback (pcd, placeX, placeY, placeWidth, placeHeight, (FB_SIZE | FB_POSITION), placeResize); } /* set up initial visual feedback */ MoveOutline (placeX, placeY, placeWidth, placeHeight); } /* END OF FUNCTION SetupPlacement */ /*************************************<->************************************* * * IsRepeatedKeyEvent (dpy, pEvent, pOldEvent) * * * Description: * ----------- * Returns TRUE if the event passed in is a repeat of the key event * indicated in pOldEvent * * * Inputs: * ------ * dpy - display * pEvent - pointer to this event * pOldEvent - pointer to previous event (cast to the correct type) * * * Outputs: * ------- * IsRepeatedKeyEvent - True if the events are "the same," * False otherwise. * * * Comments: * -------- * *************************************<->***********************************/ Bool IsRepeatedKeyEvent (Display *dpy, XEvent *pEvent, char *pOldEvent) { XEvent *pOld = (XEvent *) pOldEvent; if ((pEvent->type == KeyPress) && /* key press event */ (pEvent->type == pOld->type) && /* same event type */ (pEvent->xkey.keycode == pOld->xkey.keycode) && /* same key code */ (pEvent->xkey.state == pOld->xkey.state) && /* same modifiers */ (pEvent->xkey.window == pOld->xkey.window) && /* same window */ (pEvent->xkey.root == pOld->xkey.root)) /* same root */ { return (True); } else { return (False); } } /*************************************<->************************************* * * StartInteractiveSizing (pcd, time) * * * Description: * ----------- * Switch from "position" mode to "resize" mode * * * Inputs: * ------ * pcd - pointer to client data * time - time stamp of event for pointer regrab * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void StartInteractiveSizing (ClientData *pcd, Time time) { unsigned int gmask; /* regrab pointer to change cursor */ gmask = (wmGD.freezeOnConfig)? PGRAB_MASK : NOFRZ_PGRAB_MASK; XChangeActivePointerGrab (DISPLAY, gmask, wmGD.sizePlacementCursor, time); /* put cursor at lower-right corner */ if (wmGD.enableWarp) { XWarpPointer (DISPLAY, None, ACTIVE_ROOT, 0, 0, 0, 0, (int) (placeX+placeWidth-1), (int) (placeY+placeHeight-1)); } /* * Don't go into resize mode if resize is turned off. */ if (pcd->clientFunctions & MWM_FUNC_RESIZE) { /* update flags */ placeResize = TRUE; wmGD.preMove = FALSE; } } /*************************************<->************************************* * * HandlePlacementKeyEvent (pcd, pev) * * * Description: * ----------- * Handle key presses during interactive placement * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to key press event * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void HandlePlacementKeyEvent (ClientData *pcd, XKeyEvent *pev) { XEvent KeyEvent; KeySym keysym; Boolean control, valid; int big_inc; int tmpX = 0; int tmpY = 0; int warpX, warpY, newX, newY; int keyPlaceX = placeX; int keyPlaceY = placeY; unsigned int keyPlaceWidth = placeWidth; unsigned int keyPlaceHeight = placeHeight; /* filter out repeating keys */ placeKeyMultiplier = 1; if (pev->type == KeyPress) { while (placeKeyMultiplier <= 10 && XCheckIfEvent (DISPLAY, &KeyEvent, IsRepeatedKeyEvent, (char *) pev)) { placeKeyMultiplier++; } } /* convert event data to useful key data */ #ifdef FIX_1611 keysym = WmKeycodeToKeysym(DISPLAY, pev->keycode); #else keysym = XKeycodeToKeysym (DISPLAY, pev->keycode, 0); #endif control = (pev->state & ControlMask) != 0; big_inc = DisplayWidth(DISPLAY, ACTIVE_PSD->screen) / 20; /* interpret key data */ valid = FALSE; switch (keysym) { case XK_Left: tmpX = (control) ? (-big_inc) : -1; valid = TRUE; break; case XK_Up: tmpY = (control) ? (-big_inc) : -1; valid = TRUE; break; case XK_Right: tmpX = (control) ? (big_inc) : 1; valid = TRUE; break; case XK_Down: tmpY = (control) ? (big_inc) : 1; valid = TRUE; break; case XK_space: StartInteractiveSizing(pcd, pev->time); break; case XK_Return: placementDone = TRUE; /* global "done" flag */ break; default: break; } /* if a valid key was pressed, then react to it */ if (valid) { tmpX *= placeKeyMultiplier; tmpY *= placeKeyMultiplier; if (placeResize) { keyPlaceWidth += tmpX; /* change size of outline */ keyPlaceHeight += tmpY; FixFrameValues(pcd, &keyPlaceX, &keyPlaceY, &keyPlaceWidth, &keyPlaceHeight, placeResize); warpX = keyPlaceX+keyPlaceWidth-1; warpY = keyPlaceY+keyPlaceHeight-1; SetPointerPosition (warpX, warpY, &newX, &newY); if ((warpX == newX) && (warpY == newY)) { placeWidth = keyPlaceWidth; placeHeight = keyPlaceHeight; } else { placeWidth = newX - keyPlaceX + 1; placeHeight = newY - keyPlaceY + 1; } } else { keyPlaceX += tmpX; /* change position of outline */ keyPlaceY += tmpY; FixFrameValues(pcd, &keyPlaceX, &keyPlaceY, &keyPlaceWidth, &keyPlaceHeight, placeResize); warpX = keyPlaceX; warpY = keyPlaceY; SetPointerPosition (warpX, warpY, &newX, &newY); placeX = newX; placeY = newY; } placePointerX = newX; placePointerY = newY; } FixFrameValues (pcd, &placeX, &placeY, &placeWidth, &placeHeight, placeResize); MoveOutline (placeX, placeY, placeWidth, placeHeight); if (wmGD.showFeedback & WM_SHOW_FB_PLACEMENT) { DoFeedback (pcd, placeX, placeY, placeWidth, placeHeight, 0, placeResize); } } /* END OF FUNCTION HandlePlacementKeyEvent */ /*************************************<->************************************* * * HandlePlacementButtonEvent (pev) * * * Description: * ----------- * XXDescription ... * * * Inputs: * ------ * pev - pointer to button event * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void HandlePlacementButtonEvent (XButtonEvent *pev) { /* * Only listen to button 1 */ if (pev->button == 1) { /* * Complete interactive placement on button release */ if (pev->type == ButtonRelease) { placementDone = TRUE; /* global done flag */ } else if (pev->type == ButtonPress) { /* * Button press, go to pre-resize mode */ wmGD.preMoveX = pev->x_root; wmGD.preMoveY = pev->y_root; wmGD.preMove = TRUE; } } } /*************************************<->************************************* * * HandlePlacementMotionEvent (pcd, pev) * * * Description: * ----------- * Handles pointer motion events during interactive placement * * * Inputs: * ------ * pcd - pointer to client data * pev - pointer to mouse motion event * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void HandlePlacementMotionEvent (ClientData *pcd, XMotionEvent *pev) { int diffx, diffy; /* * If in pre-resize mode, check for motion crossing threshhold before * switching modes */ if (wmGD.preMove) { diffx = pev->x_root - wmGD.preMoveX; diffy = pev->y_root - wmGD.preMoveY; if ((ABS(diffx) > wmGD.moveThreshold) || (ABS(diffy) > wmGD.moveThreshold)) { StartInteractiveSizing(pcd, pev->time); } return; } if (placeResize) { /* * Track lower right corner */ if (pev->x_root > placeX) placeWidth = pev->x_root - placeX + 1; if (pev->y_root > placeY) placeHeight = pev->y_root - placeY + 1; } else { /* * track window position */ placeX = pev->x_root; placeY = pev->y_root; } placePointerX = pev->x_root; placePointerY = pev->y_root; FixFrameValues (pcd, &placeX, &placeY, &placeWidth, &placeHeight, placeResize); MoveOutline (placeX, placeY, placeWidth, placeHeight); if (wmGD.showFeedback & WM_SHOW_FB_PLACEMENT) { DoFeedback (pcd, placeX, placeY, placeWidth, placeHeight, 0, placeResize); } } /* END OF FUNCTION HandlePlacementMotionEvent */ /*************************************<->************************************* * * DoPlacement (pcd) * * * Description: * ----------- * Gets window configuration from the user via pointer/keyboard interaction * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * pcd - clientX, clientY, clientWidth, and clientHeight members * could be changed * * Comments: * -------- * We try to be careful only to remove events that we need from the * event queue while we're in our own event processing loop. * *************************************<->***********************************/ void DoPlacement (ClientData *pcd) { XEvent event; /* * Initialization */ SetupPlacement (pcd); /* * Process events */ placementDone = FALSE; while (!placementDone) { GetConfigEvent (DISPLAY, ACTIVE_ROOT, GRAB_MASK, placePointerX, placePointerY, placeX, placeY, placeWidth, placeHeight, &event); switch (event.type) { case KeyPress: HandlePlacementKeyEvent(pcd, (XKeyEvent *)&event); break; case ButtonPress: HandlePlacementButtonEvent((XButtonEvent *)&event); break; case ButtonRelease: HandlePlacementButtonEvent((XButtonEvent *)&event); break; case MotionNotify: HandlePlacementMotionEvent(pcd, (XMotionEvent *)&event); break; } } /* copy back the configuration information */ pcd->clientX = placeX + placeOffsetX; pcd->clientY = placeY + placeOffsetY; pcd->clientWidth = placeWidth - 2*placeOffsetX; pcd->clientHeight = placeHeight - placeOffsetX - placeOffsetY; /* clean up */ MoveOutline (0,0,0,0); HideFeedbackWindow(pcd->pSD); } /* END OF FUNCTION DoPlacement */ /*************************************<->************************************* * * PlaceWindowInteractively(pcd) * * * Description: * ----------- * Gets the clients size and position information interactively from the * user. * * * Inputs: * ------ * pcd - pointer to client data * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void PlaceWindowInteractively (ClientData *pcd) { unsigned int gmask; gmask = (wmGD.freezeOnConfig)? PGRAB_MASK : NOFRZ_PGRAB_MASK; /* * Return if config is in progress or if grabs fail */ if (!DoGrabs (ACTIVE_ROOT, wmGD.movePlacementCursor, gmask, CurrentTime, pcd, True)) { return; } /* * Get the size and position of the window from the user. * Do our own event processing until a button-up event occurs */ DoPlacement(pcd); /* * Finish up and return the data */ UndoGrabs(); wmGD.preMove = FALSE; } motif-2.3.8/clients/mwm/system.mwmrc0000644000175000017500000000672212672140200014420 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! $XConsortium: system.mwmrc /main/9 1996/10/25 11:45:42 drk $ ! ! HISTORY ! !! !! DEFAULT Mwm RESOURCE DESCRIPTION FILE (system.mwmrc) !! !! NOTE: To personalize this file, copy this file before editing it. !! Personalize copies of the Mwm resource file typically !! reside as: !! !! $HOME/.mwmrc !! !! !! Root Menu Description (this menu must be explicitly posted via f.menu) !! Menu DefaultRootMenu { "Root Menu" f.title "New Window" f.exec "xterm &" "Shuffle Up" f.circle_up "Shuffle Down" f.circle_down "Refresh" f.refresh "Pack Icons" f.pack_icons ! "Toggle Behavior..." f.set_behavior no-label f.separator "Restart..." f.restart "Quit..." f.quit_mwm } Menu RootMenu_1.1 { "Root Menu" f.title "New Window" f.exec "xterm &" "Shuffle Up" f.circle_up "Shuffle Down" f.circle_down "Refresh" f.refresh ! "Pack Icons" f.pack_icons ! "Toggle Behavior" f.set_behavior no-label f.separator "Restart..." f.restart } !! !! Default Window Menu Description !! Menu DefaultWindowMenu { Restore _R AltF5 f.restore Move _M AltF7 f.move Size _S AltF8 f.resize Minimize _n AltF9 f.minimize Maximize _x AltF10 f.maximize Lower _L AltF3 f.lower no-label f.separator Close _C AltF4 f.kill } !! !! Key Binding Description !! Keys DefaultKeyBindings { ShiftEscape window|icon f.post_wmenu Altspace window|icon f.post_wmenu AltTab root|icon|window f.next_key Alt ShiftTab root|icon|window f.prev_key AltEscape root|icon|window f.circle_down Alt ShiftEscape root|icon|window f.circle_up Alt Shift Ctrlexclam root|icon|window f.set_behavior AltF6 window f.next_key transient Alt ShiftF6 window f.prev_key transient ShiftF10 icon f.post_wmenu ! Alt ShiftDelete root|icon|window f.restart } !! !! Button Binding Description(s) !! Buttons DefaultButtonBindings { icon|frame f.raise icon|frame f.post_wmenu root f.menu DefaultRootMenu } Buttons ExplicitButtonBindings { frame|icon f.raise frame|icon f.post_wmenu root f.menu DefaultRootMenu ! icon f.restore Alt window|icon f.lower ! Alt window|icon f.resize ! Alt window|icon f.move } Buttons PointerButtonBindings { frame|icon f.raise frame|icon f.post_wmenu root f.menu DefaultRootMenu window f.raise ! icon f.restore Alt window|icon f.lower ! Alt window|icon f.resize ! Alt window|icon f.move } !! !! END OF mwm RESOURCE DESCRIPTION FILE !! motif-2.3.8/clients/mwm/WmManage.h0000644000175000017500000000416113145162623013676 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void AdoptInitialClients (WmScreenData *pSD); extern void DeleteClientContext (ClientData *pCD); extern void ManageWindow (WmScreenData *pSD, Window clientWindow, long manageFlags); extern void UnManageWindow (ClientData *pCD); extern void WithdrawTransientChildren (ClientData *pCD); extern void WithdrawWindow (ClientData *pCD); extern void ResetWithdrawnFocii (ClientData *pCD); extern void FreeClientFrame (ClientData *pCD); extern void FreeIcon (ClientData *pCD); extern void WithdrawDialog (Widget dialogboxW); extern void ReManageDialog (WmScreenData *pSD, Widget dialogboxW); #ifdef PANELIST extern void RegisterEmbeddedClients ( Widget wPanelist, WmFpEmbeddedClientList pECD, int count); extern void RegisterPushRecallClients ( Widget wPanelist, WmFpPushRecallClientList pPRCD, int count); extern void UnParentControls(WmScreenData *pSD, Boolean unmap); extern void RegisterIconBoxControl (Widget wPanelist); extern Boolean ReparentEmbeddedClient ( WmFpEmbeddedClientData *pECD, Widget newControl, Window newWin, int x, int y, unsigned int width, unsigned int height); extern void ScanForEmbeddedClients (WmScreenData *pSD); extern void ScanForPushRecallClients (WmScreenData *pSD); #endif /* PANELIST */ motif-2.3.8/clients/mwm/WmFeedback.h0000644000175000017500000000276313145162623014200 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void ConfirmAction (WmScreenData *pSD, int nbr); extern void HideFeedbackWindow (WmScreenData *pSD); extern void InitCursorInfo (void); extern void PaintFeedbackWindow (WmScreenData *pSD); extern void ShowFeedbackWindow (WmScreenData *pSD, int x, int y, unsigned int width, unsigned int height, unsigned long style); extern void ShowWaitState (Boolean flag); extern void UpdateFeedbackInfo (WmScreenData *pSD, int x, int y, unsigned int width, unsigned int height); extern void UpdateFeedbackText (WmScreenData *pSD, int x, int y, unsigned int width, unsigned int height); motif-2.3.8/clients/mwm/WmGraphics.h0000644000175000017500000000467013145162623014253 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern RList *AllocateRList (unsigned int amt); extern void BevelDepressedRectangle (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height, unsigned int top_wid, unsigned int right_wid, unsigned int bot_wid, unsigned int left_wid, unsigned int in_wid); extern void BevelRectangle (RList *prTop, RList *prBot, int x, int y, unsigned int width, unsigned int height, unsigned int top_wid, unsigned int right_wid, unsigned int bot_wid, unsigned int left_wid); extern void DrawStringInBox (Display *dpy, Window win, GC gc, XFontStruct *pfs, XRectangle *pbox, String str); extern Boolean ExtendRList (RList *prl, unsigned int amt); extern void FreeRList (RList *prl); extern void StretcherCorner (RList *prTop, RList *prBot, int x, int y, int cnum, unsigned int swidth, unsigned int cwidth, unsigned int cheight); extern void WmDrawString (Display *dpy, Drawable d, GC gc, int x, int y, char *string, unsigned int length); #ifdef WSM extern void WmDrawXmString (Display *dpy, Window w, XmFontList xmfontlist, XmString xmstring, GC gc, Position x, Position y, Dimension width, XRectangle *pbox, Boolean bCenter); #else /* WSM */ extern void WmDrawXmString (Display *dpy, Window w, XmFontList xmfontlist, XmString xmstring, GC gc, Position x, Position y, Dimension width, XRectangle *pbox); #endif /* WSM */ extern GC WmGetGC (WmScreenData *pSD, unsigned long gc_mask, XGCValues *pGcv); motif-2.3.8/clients/mwm/WmIDecor.h0000644000175000017500000000420113145162623013646 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void CreateActiveIconTextWindow (WmScreenData *pSD); extern void DrawIconTitle (ClientData *pcd); extern void GetIconDimensions (WmScreenData *pSD, unsigned int *pWidth, unsigned int *pLabelHeight, unsigned int *pImageHeight); extern void GetIconTitleBox (ClientData *pcd, XRectangle *pBox); extern void HideActiveIconText (WmScreenData *pSD); extern void IconExposureProc (ClientData *pcd, Boolean clearFirst); extern void InitIconSize (WmScreenData *pSD); extern Boolean MakeIcon (WmWorkspaceData *pWS, ClientData *pcd); extern void MakeIconShadows (ClientData *pcd, int xOffset, int yOffset); extern void MoveActiveIconText (ClientData *pcd); extern void PaintActiveIconText (ClientData *pcd, Boolean erase); extern void PutBoxInIconBox (ClientData *pCD, int *px, int *py, unsigned int *width, unsigned int *height); extern void PutBoxOnScreen (int screen, int *px, int *py, unsigned int width, unsigned int height); extern void RedisplayIconTitle (ClientData *pcd); extern void ReparentIconWindow (ClientData *pcd, int xOffset, int yOffset); extern void ShowActiveIcon (ClientData *pcd); extern void ShowActiveIconText (ClientData *pcd); extern void ShowInactiveIcon (ClientData *pcd, Boolean refresh); motif-2.3.8/clients/mwm/WmSignal.c0000644000175000017500000001733313145162623013723 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmSignal.c /main/6 1996/10/17 16:20:07 drk $" #endif #endif #ifdef HAVE_CONFIG_H #include #endif /* * Included Files: */ #include "WmGlobal.h" /* This should be the first include */ #include #include #include /* * include extern functions */ #include "WmFeedback.h" #include "WmFunction.h" /* * Function Declarations: */ #include "WmSignal.h" /* * Global Variables: */ #ifdef WSM /*************************************<->************************************* * * AbortWmSignalHandler () * * * Description: * ----------- * This function is called on receipt of a fatal signal. We reset * the keyboard focus to pointer root before aborting. * *************************************<->***********************************/ static void AbortWmSignalHandler (int sig) { struct sigaction sa; /* * Set input focus back to pointer root */ XSetInputFocus(DISPLAY, PointerRoot, RevertToPointerRoot, CurrentTime); XSync (DISPLAY, False); XCloseDisplay (DISPLAY); /* * Invoke the default handler */ (void) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_DFL; (void) sigaction (sig, &sa, (struct sigaction *) 0); kill (getpid(), sig); } /* END OF FUNCTION AbortSignalHandler */ /*************************************<->************************************* * * RestoreDefaultSignalHandlers () * * * Description: * ----------- * This function sets up the signal handlers for the window manager. * *************************************<->***********************************/ void RestoreDefaultSignalHandlers (void) { struct sigaction sa; struct sigaction osa; /* * Restore default action for signals we're interested in. */ (void) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_DFL; if ((sigaction (SIGINT, (struct sigaction *) 0, &osa) != 0) || (osa.sa_handler != SIG_IGN)) { (void) sigaction (SIGINT, &sa, (struct sigaction *) 0); } if ((sigaction (SIGHUP, (struct sigaction *) 0, &osa) != 0) || (osa.sa_handler != SIG_IGN)) { (void) sigaction (SIGHUP, &sa, (struct sigaction *) 0); } (void) sigaction (SIGQUIT, &sa, (struct sigaction *) 0); (void) sigaction (SIGTERM, &sa, (struct sigaction *) 0); (void) sigaction (SIGPIPE, &sa, (struct sigaction *) 0); (void) sigaction (SIGCHLD, &sa, (struct sigaction *) 0); (void) sigaction (SIGILL, &sa, (struct sigaction *) 0); (void) sigaction (SIGFPE, &sa, (struct sigaction *) 0); (void) sigaction (SIGBUS, &sa, (struct sigaction *) 0); (void) sigaction (SIGSEGV, &sa, (struct sigaction *) 0); #ifdef SIGSYS (void) sigaction (SIGSYS, &sa, (struct sigaction *) 0); #endif } #endif /* WSM */ /*************************************<->************************************* * * SetupWmSignalHandlers () * * * Description: * ----------- * This function sets up the signal handlers for the window manager. * *************************************<->***********************************/ void SetupWmSignalHandlers (int dummy) { void (*signalHandler) (); #ifdef WSM struct sigaction sa; struct sigaction osa; /* * Catch software signals that we ask the user about * before quitting. */ (void) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = QuitWmSignalHandler; if ((sigaction (SIGINT, (struct sigaction *) 0, &osa) != 0) || (osa.sa_handler != SIG_IGN)) { (void) sigaction (SIGINT, &sa, (struct sigaction *) 0); } if ((sigaction (SIGHUP, (struct sigaction *) 0, &osa) != 0) || (osa.sa_handler != SIG_IGN)) { (void) sigaction (SIGHUP, &sa, (struct sigaction *) 0); } (void) sigaction (SIGQUIT, &sa, (struct sigaction *) 0); (void) sigaction (SIGTERM, &sa, (struct sigaction *) 0); /* * Ignore child death */ #ifdef SA_NOCLDWAIT sa.sa_flags = SA_NOCLDWAIT; /* Don't create zombies */ #else sa.sa_flags = 0; #endif sa.sa_handler = SIG_IGN; (void) sigaction (SIGCHLD, &sa, (struct sigaction *) 0); sa.sa_flags = 0; /* * Catch other fatal signals so we can reset the * keyboard focus to pointer root before aborting */ sa.sa_handler = AbortWmSignalHandler; (void) sigaction (SIGILL, &sa, (struct sigaction *) 0); (void) sigaction (SIGFPE, &sa, (struct sigaction *) 0); (void) sigaction (SIGBUS, &sa, (struct sigaction *) 0); (void) sigaction (SIGSEGV, &sa, (struct sigaction *) 0); #ifdef SIGSYS (void) sigaction (SIGSYS, &sa, (struct sigaction *) 0); #endif #else /* not WSM - original mwm code*/ signalHandler = (void (*)())signal (SIGINT, SIG_IGN); if (signalHandler != (void (*)())SIG_IGN) { signal (SIGINT, QuitWmSignalHandler); } signalHandler = (void (*)())signal (SIGHUP, SIG_IGN); if (signalHandler != (void (*)())SIG_IGN) { signal (SIGHUP, QuitWmSignalHandler); } signal (SIGQUIT, QuitWmSignalHandler); signal (SIGTERM, QuitWmSignalHandler); signal (SIGCHLD, ChildProcSignalHandler); #endif /* WSM */ } /* END OF FUNCTION SetupWmSignalHandlers */ /*************************************<->************************************* * * QuitWmSignalHandler () * * * Description: * ----------- * This function is called on receipt of a signal that is to terminate the * window manager. * *************************************<->***********************************/ void QuitWmSignalHandler (int dummy) { if (wmGD.showFeedback & WM_SHOW_FB_KILL) { ConfirmAction (ACTIVE_PSD, QUIT_MWM_ACTION); XFlush(DISPLAY); } else { Do_Quit_Mwm(False); } } /* END OF FUNCTION QuitWmSignalHandler */ /*************************************<->************************************* * * ChildProcSignalHandler () * * * Description: * ----------- * This function is called on receipt of a signal that the child of the * window manager has terminated. * This child signal handler is primarily used to wait() for child * processes that were inherited from the user's .xsession if the last * command in the .xsession is a "exec mwm". These inherited child * processes were not spawned the WmFunction.c:F_Exec() routine and * therefore would not be reaped by the wait() in that routine until * a menu item using F_Exec() was invoked by the user. * *************************************<->***********************************/ void ChildProcSignalHandler (int dummy) { pid_t pid; int status; void (*intStat) (); void (*quitStat) (); intStat = (void (*)())signal (SIGINT, SIG_IGN); quitStat = (void (*)())signal (SIGQUIT, SIG_IGN); pid = wait(&status); signal(SIGCHLD, ChildProcSignalHandler); signal (SIGINT, intStat); signal (SIGQUIT, quitStat); } motif-2.3.8/clients/mwm/WmResource.c0000644000175000017500000045612013145162623014276 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmResource.c /main/14 1997/04/15 10:30:02 dbl $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmResNames.h" #define MWM_NEED_IIMAGE #include "WmIBitmap.h" #include #include #include #ifndef MOTIF_ONE_DOT_ONE #include /* for XmGetXmScreen and screen.moveOpaque */ #endif /* * include extern functions */ #include "WmResource.h" #include "WmError.h" #include "WmGraphics.h" #include "WmMenu.h" #include "WmResParse.h" #ifdef WSM #include "WmBackdrop.h" #include "WmIconBox.h" #include "WmWrkspace.h" #include
#define cfileP (wmGD.pWmPB->pFile) /* fopen'ed configuration file or NULL */ #endif /* WSM */ #include "WmXSMP.h" /* * Function Declarations: */ XmColorData *_WmGetDefaultColors (); void _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value); void _WmIconImageFDefault (Widget widget, int offset, XrmValue *value); void _WmIconImageBDefault (Widget widget, int offset, XrmValue *value); void _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value); void _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value); void _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value); void _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value); void _WmMatteFDefault (Widget widget, int offset, XrmValue *value); void _WmMatteBDefault (Widget widget, int offset, XrmValue *value); void _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value); void _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value); void _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value); void _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value); void _WmBackgroundDefault (Widget widget, int offset, XrmValue *value); void _WmForegroundDefault (Widget widget, int offset, XrmValue *value); void _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value); void _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value); void _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value); void _WmABackgroundDefault (Widget widget, int offset, XrmValue *value); void _WmAForegroundDefault (Widget widget, int offset, XrmValue *value); void _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value); void _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value); void _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value); void _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value); void _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value); void _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value); void ProcessWmResources (void); void ProcessGlobalScreenResources (void); void SetStdGlobalResourceValues (void); void ProcessScreenListResource (void); void ProcessAppearanceResources (WmScreenData *pSD); void MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources); void GetAppearanceGCs (WmScreenData *pSD, Pixel fg, Pixel bg, XFontStruct *font, Pixmap bg_pixmap, Pixel ts_color, Pixmap ts_pixmap, Pixel bs_color, Pixmap bs_pixmap, GC *pGC, GC *ptsGC, GC *pbsGC); void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName); void ProcessWorkspaceResources (WmWorkspaceData *pWS); void ProcessClientResources (ClientData *pCD); void SetStdClientResourceValues (ClientData *pCD); void SetStdScreenResourceValues (WmScreenData *pSD); GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap); #ifdef WSM static void WriteOutXrmColors (WmScreenData *pSD); #endif /* WSM */ #ifdef WSM void ProcessPresenceResources (WmScreenData *pSD); void ProcessDefaultBackdropImages (WmScreenData *pSD); void _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value); void _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value); void _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value); void _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value); void _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value); int DefaultWsColorSetId (WmWorkspaceData *pWS); #endif /* WSM */ void _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value); Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2); /* * Global Variables: */ /* builtin window menu specification */ #ifndef NO_MESSAGE_CATALOG /* * Use the same name as builtin to let the message catalog menu * take precedence over any menus that might match in sys.mwmrc */ char defaultSystemMenuName[] = "_MwmWindowMenu_"; #else char defaultSystemMenuName[] = "DefaultWindowMenu"; #endif /* NO_MESSAGE_CATALOG */ char builtinSystemMenuName[] = "_MwmWindowMenu_"; #ifndef MCCABE #define BUILTINSYSTEMMENU "_MwmWindowMenu_\n\ {\n\ Restore _R AltF5 f.restore\n\ Move _M AltF7 f.move\n\ Size _S AltF8 f.resize\n\ Minimize _n AltF9 f.minimize\n\ Maximize _x AltF10 f.maximize\n\ Lower _L AltF3 f.lower\n\ no-label f.separator\n\ Close _C AltF4 f.kill\n\ }" #ifdef NO_MESSAGE_CATALOG char builtinSystemMenu[] = BUILTINSYSTEMMENU; #else /* !defined(NO_MESSAGE_CATALOG)*/ char *builtinSystemMenu = BUILTINSYSTEMMENU; #ifdef WSM #define DEFAULT_DTWM_SYSTEMMENU "_MwmWindowMenu_\n\ {\n\ Restore _R f.restore\n\ Move _M f.move\n\ Size _S f.resize\n\ Minimize _n f.minimize\n\ Maximize _x f.maximize\n\ Lower _L f.lower\n\ no-label f.separator\n\ \"Occupy Workspace...\" _O f.workspace_presence\n\ \"Occupy All Workspaces\" _A f.occupy_all\n\ \"Unoccupy Workspace\" _U f.remove\n\ no-label f.separator\n\ Close _C AltF4 f.kill\n\ }" #endif /* WSM */ void InitBuiltinSystemMenu(void) { char * tmpString; char *ResString = NULL; char *MovString = NULL; char *SizString = NULL; char *MinString = NULL; char *MaxString = NULL; char *LowString = NULL; #ifdef WSM char *OcpString = NULL; char *OcaString = NULL; char *RemString = NULL; #endif /* WSM */ char *CloString = NULL; char dsm[2048]; Boolean gotItAll; gotItAll = True; if(gotItAll) { #if 1 tmpString = ((char *)GETMESSAGE(62, 60, "Restore _R AltF5 f.restore")); #else tmpString = ((char *)GETMESSAGE(62, 49, "Restore _R f.restore")); #endif if ((ResString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 2, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(ResString, tmpString); } } if(gotItAll) { #if 1 tmpString = ((char *)GETMESSAGE(62, 61, "Move _M AltF7 f.move")); #else tmpString = ((char *)GETMESSAGE(62, 50, "Move _M f.move")); #endif if ((MovString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 4, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(MovString, tmpString); } } if(gotItAll) { #if 1 tmpString = ((char *)GETMESSAGE(62, 62, "Size _S AltF8 f.resize")); #else tmpString = ((char *)GETMESSAGE(62, 51, "Size _S f.resize")); #endif if ((SizString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 6, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(SizString, tmpString); } } if(gotItAll) { #if 1 tmpString = ((char *)GETMESSAGE(62, 63, "Minimize _n AltF9 f.minimize")); #else tmpString = ((char *)GETMESSAGE(62, 52, "Minimize _n f.minimize")); #endif if ((MinString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 8, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(MinString, tmpString); } } if(gotItAll) { #if 1 tmpString = ((char *)GETMESSAGE(62, 64, "Maximize _x AltF10 f.maximize")); #else tmpString = ((char *)GETMESSAGE(62, 53, "Maximize _x f.maximize")); #endif if ((MaxString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 10, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(MaxString, tmpString); } } if(gotItAll) { #if 1 tmpString = ((char *)GETMESSAGE(62, 65, "Lower _L AltF3 f.lower")); #else tmpString = ((char *)GETMESSAGE(62, 54, "Lower _L f.lower")); #endif if ((LowString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 12, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(LowString, tmpString); } } #ifdef WSM if (DtwmBehavior) { if(gotItAll) { tmpString = ((char *)GETMESSAGE(62, 55, "Occupy\\ Workspace\\.\\.\\. _O f.workspace_presence")); if ((OcpString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 14, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(OcpString, tmpString); } } if(gotItAll) { tmpString = ((char *)GETMESSAGE(62, 56, "Occupy\\ All\\ Workspaces _A f.occupy_all")); if ((OcaString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 16, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(OcaString, tmpString); } } if(gotItAll) { tmpString = ((char *)GETMESSAGE(62, 57, "Unoccupy\\ Workspace _U f.remove")); if ((RemString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 18, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(RemString, tmpString); } } } /* if DTWM */ #endif /* WSM */ if(gotItAll) { tmpString = ((char *)GETMESSAGE(62, 48, "Close _C AltF4 f.kill")); if ((CloString = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 20, "Insufficient memory for local default menu."))); gotItAll = False; } else { strcpy(CloString, tmpString); } } if (!gotItAll) { #ifdef WSM if (DtwmBehavior) { builtinSystemMenu = (char *) XtNewString((String)DEFAULT_DTWM_SYSTEMMENU); } else { builtinSystemMenu = (char *) XtNewString((String)BUILTINSYSTEMMENU); } #else /* WSM */ builtinSystemMenu = (char *) XtNewString((String)BUILTINSYSTEMMENU); #endif /* WSM */ } else { /* put it together */ strcpy(dsm, defaultSystemMenuName); strcat(dsm, "\n{\n"); strcat(dsm, ResString); strcat(dsm, "\n"); strcat(dsm, MovString); strcat(dsm, "\n"); strcat(dsm, SizString); strcat(dsm, "\n"); strcat(dsm, MinString); strcat(dsm, "\n"); strcat(dsm, MaxString); strcat(dsm, "\n"); strcat(dsm, LowString); strcat(dsm, "\n"); strcat(dsm, " no-label f.separator\n"); #ifdef WSM if (DtwmBehavior) { strcat(dsm, OcpString); strcat(dsm, "\n"); strcat(dsm, OcaString); strcat(dsm, "\n"); strcat(dsm, RemString); strcat(dsm, "\n"); strcat(dsm, " no-label f.separator\n"); } #endif /* WSM */ strcat(dsm, CloString); strcat(dsm, "\n}"); if ((builtinSystemMenu = (char *)XtMalloc ((unsigned int) (strlen(dsm) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 21, "Insufficient memory for localized default system menu"))); #ifdef WSM if (DtwmBehavior) { builtinSystemMenu = (char *) XtNewString((String)DEFAULT_DTWM_SYSTEMMENU); } else { builtinSystemMenu = (char *) XtNewString((String)BUILTINSYSTEMMENU); } #else /* WSM */ builtinSystemMenu = (char *) XtNewString((String)BUILTINSYSTEMMENU); #endif /* WSM */ } else { strcpy(builtinSystemMenu, dsm); } } if (ResString != NULL) XtFree(ResString); if (MovString != NULL) XtFree(MovString); if (SizString != NULL) XtFree(SizString); if (MinString != NULL) XtFree(MinString); if (MaxString != NULL) XtFree(MaxString); if (LowString != NULL) XtFree(LowString); #ifdef WSM if (OcpString != NULL) XtFree(OcpString); if (OcaString != NULL) XtFree(OcaString); if (RemString != NULL) XtFree(RemString); #endif /* WSM */ if (CloString != NULL) XtFree(CloString); } /* END OF FUNCTION InitBuiltinSystemMenu */ #endif /* NO_MESSAGE_CATALOG */ #else /* MCCABE */ char builtinSystemMenu[]; #endif /* MCCABE */ #ifdef WSM #define HARD_CODED_PRIMARY 3 #endif /* WSM */ char defaultRootMenuName[] = "DefaultRootMenu"; char builtinRootMenuName[] = "_MwmRootMenu_"; #ifndef MCCABE #define BUILTINROOTMENU "DefaultRootMenu\n\ {\n\ \"Root Menu\" f.title\n\ \"New Window\" f.exec \"xterm &\"\n\ \"Shuffle Up\" f.circle_up\n\ \"Shuffle Down\" f.circle_down\n\ \"Refresh\" f.refresh\n\ \"Pack Icons\" f.pack_icons\n\ no-label f.separator\n\ \"Restart...\" f.restart\n\ }"; char builtinRootMenu[] = BUILTINROOTMENU #else /* MCCABE */ char builtinRootMenu[]; #endif /* MCCABE */ /* builtin key bindings specification */ char defaultKeyBindingsName[] = "DefaultKeyBindings"; char builtinKeyBindingsName[] = "_MwmKeyBindings_"; #ifndef MCCABE #define BUILTINKEYBINDINGS "_MwmKeyBindings_\n\ {\n\ ShiftEscape window|icon f.post_wmenu\n\ Altspace window|icon f.post_wmenu\n\ AltTab root|icon|window f.next_key\n\ Alt ShiftTab root|icon|window f.prev_key\n\ AltEscape root|icon|window f.circle_down\n\ Alt ShiftEscape root|icon|window f.circle_up\n\ Alt Shift Ctrlexclam root|icon|window f.set_behavior\n\ Alt Ctrl1 root|icon|window f.set_behavior\n\ AltF6 window f.next_key transient\n\ Alt ShiftF6 window f.prev_key transient\n\ ShiftF10 icon f.post_wmenu\n\ }"; char builtinKeyBindings[] = BUILTINKEYBINDINGS #else char builtinKeyBindings[]; #endif /* * NOTE: Default Toggle Behavior key bindings. There are TWO key bindings as * of 1.1.4 and 1.2. Make sure you make any modify builtinKeyBindings (above) * whenever modifying behaviorKeyBindings. */ char behaviorKeyBindingName[] = "_MwmBehaviorKey_"; #ifndef MCCABE #define BEHAVIORKEYBINDINGS "_MwmBehaviorKey_\n\ {\n\ Alt Shift Ctrlexclam root|icon|window f.set_behavior\n\ Alt Ctrl1 root|icon|window f.set_behavior\n\ }"; char behaviorKeyBindings[] = BEHAVIORKEYBINDINGS #else char behaviorKeyBindings[]; #endif /* default button bindings specification */ /* note - the %s will be replaced by the real DefaultRootMenu */ char defaultButtonBindingsName[] = "DefaultButtonBindings"; char builtinButtonBindingsName[] = "_MwmButtonBindings_"; #ifndef MCCABE # if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\ {\n\ icon|frame f.raise\n\ icon|frame f.post_wmenu\n\ root f.menu %s\n\ }"; # else # define BUILTINBUTTONBINDINGS "_MwmButtonBindings_\n\ {\n\ icon|frame f.raise\n\ icon|frame f.post_wmenu\n\ root f.menu DefaultRootMenu\n\ }"; # endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ char builtinButtonBindings[] = BUILTINBUTTONBINDINGS #else char builtinButtonBindings[]; #endif static ClientData *_pCD; static String _defaultBackground; static String _defaultActiveBackground; static AppearanceData *_pAppearanceData; #ifdef WSM static WmWorkspaceData *pResWS; static WmScreenData *pResSD; #endif /* WSM */ static char _defaultColor1HEX[] = "#A8A8A8A8A8A8"; static char _defaultColor2HEX[] = "#5F5F92929E9E"; static char _defaultColor1[] = "LightGrey"; static char _defaultColor2[] = "CadetBlue"; #define DEFAULT_COLOR_NONE NULL Const char _foreground[] = "foreground"; Const char _75_foreground[] = "75_foreground"; Const char _50_foreground[] = "50_foreground"; Const char _25_foreground[] = "25_foreground"; #ifdef WSM Const char *_Dither = XmCO_DITHER; Const char *_NoDither = XmCO_NO_DITHER; Const char CLIENT_FRAME_PART[] = "client"; Const char ICON_FRAME_PART[] = "icon"; Const char FEEDBACK_FRAME_PART[] = "feedback"; Const char MENU_ITEM_PART[] = "menu"; #endif /* WSM */ #define WmBGC XmBACKGROUND #define WmFGC XmFOREGROUND #define WmTSC XmTOP_SHADOW #define WmBSC XmBOTTOM_SHADOW #define MAX_SHORT 0xffff #ifndef BITMAPDIR #define BITMAPDIR "/usr/include/X11/bitmaps/" #endif /*************************************<->************************************* * * wmGlobalResources * * * Description: * ----------- * This data structure is used in the processing of mwm general * appearance and behavior resources. These resources are specified * with the following syntax: * * "Mwm*". * *************************************<->***********************************/ XtResource wmGlobalResources[] = { { WmNautoKeyFocus, WmCAutoKeyFocus, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, autoKeyFocus), XtRImmediate, (XtPointer)True }, { WmNautoRaiseDelay, WmCAutoRaiseDelay, XtRInt, sizeof (int), XtOffsetOf(WmGlobalData, autoRaiseDelay), XtRImmediate, (XtPointer)500 }, { WmNbitmapDirectory, WmCBitmapDirectory, XtRString, sizeof (String), XtOffsetOf(WmGlobalData, bitmapDirectory), XtRString, (XtPointer)BITMAPDIR }, #ifdef MINIMAL_DT { WmNblinkOnExec, WmCBlinkOnExec, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, blinkOnExec), XtRImmediate, (XtPointer)False }, #endif /* MINIMAL_DT */ { WmNframeStyle, WmCFrameStyle, WmRFrameStyle, sizeof (FrameStyle), XtOffsetOf(WmGlobalData, frameStyle), XtRImmediate, (XtPointer)WmRECESSED }, { WmNclientAutoPlace, WmCClientAutoPlace, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, clientAutoPlace), XtRImmediate, (XtPointer)True }, { WmNcolormapFocusPolicy, WmCColormapFocusPolicy, WmRCFocusPolicy, sizeof (int), XtOffsetOf(WmGlobalData, colormapFocusPolicy), XtRImmediate, (XtPointer)CMAP_FOCUS_KEYBOARD }, { WmNconfigFile, WmCConfigFile, XtRString, sizeof (String), XtOffsetOf(WmGlobalData, configFile), XtRImmediate, (XtPointer)NULL }, #ifdef WSM { WmNcppCommand, WmCCppCommand, XtRString, sizeof (String), XtOffsetOf(WmGlobalData, cppCommand), XtRImmediate, (XtPointer)NULL }, #endif /* WSM */ { WmNdeiconifyKeyFocus, WmCDeiconifyKeyFocus, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, deiconifyKeyFocus), XtRImmediate, (XtPointer)True }, { WmNdoubleClickTime, WmCDoubleClickTime, XtRInt, sizeof (int), XtOffsetOf(WmGlobalData, doubleClickTime), XtRCallProc, (XtPointer)_WmMultiClickTimeDefault }, { WmNenableWarp, WmCEnableWarp, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, enableWarp), XtRImmediate, (XtPointer)True }, { WmNenforceKeyFocus, WmCEnforceKeyFocus, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, enforceKeyFocus), XtRImmediate, (XtPointer)True }, #ifdef WSM { WmNframeExternalShadowWidth, WmCFrameExternalShadowWidth, XtRDimension, sizeof (Dimension), XtOffsetOf(WmGlobalData, frameExternalShadowWidth), XtRImmediate, (XtPointer)2 }, #endif /* WSM */ { WmNfreezeOnConfig, WmCFreezeOnConfig, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, freezeOnConfig), XtRImmediate, (XtPointer)True }, #ifdef WSM { WmNuseWindowOutline, WmCUseWindowOutline, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, useWindowOutline), XtRImmediate, (XtPointer)False }, #endif /* WSM */ { WmNiconAutoPlace, WmCIconAutoPlace, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, iconAutoPlace), XtRImmediate, (XtPointer)True }, #ifdef WSM { WmNiconExternalShadowWidth, WmCIconExternalShadowWidth, XtRDimension, sizeof (Dimension), XtOffsetOf(WmGlobalData, iconExternalShadowWidth), XtRImmediate, (XtPointer)2 }, #endif /* WSM */ { WmNiconClick, WmCIconClick, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, iconClick), XtRImmediate, (XtPointer)True }, { WmNinteractivePlacement, WmCInteractivePlacement, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, interactivePlacement), XtRImmediate, (XtPointer)False }, { WmNkeyboardFocusPolicy, WmCKeyboardFocusPolicy, WmRKFocusPolicy, sizeof (int), XtOffsetOf(WmGlobalData, keyboardFocusPolicy), XtRImmediate, (XtPointer)KEYBOARD_FOCUS_EXPLICIT }, { WmNlowerOnIconify, WmCLowerOnIconify, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, lowerOnIconify), XtRImmediate, (XtPointer)True }, #ifdef WSM { WmNmarqueeSelectGranularity, WmCMarqueeSelectGranularity, XtRInt, sizeof (int), XtOffsetOf(WmGlobalData, marqueeSelectGranularity), XtRImmediate, (XtPointer)0 }, #endif /* WSM */ { WmNmoveThreshold, WmCMoveThreshold, XtRInt, sizeof (int), XtOffsetOf(WmGlobalData, moveThreshold), XtRImmediate, (XtPointer)4 }, { WmNpassButtons, WmCPassButtons, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, passButtons), XtRImmediate, (XtPointer)False }, { WmNpassSelectButton, WmCPassSelectButton, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, passSelectButton), XtRImmediate, (XtPointer)True }, { WmNpositionIsFrame, WmCPositionIsFrame, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, positionIsFrame), XtRImmediate, (XtPointer)True }, { WmNpositionOnScreen, WmCPositionOnScreen, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, positionOnScreen), XtRImmediate, (XtPointer)True }, { WmNquitTimeout, WmCQuitTimeout, XtRInt, sizeof (int), XtOffsetOf(WmGlobalData, quitTimeout), XtRImmediate, (XtPointer)1000 }, { WmNraiseKeyFocus, WmCRaiseKeyFocus, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, raiseKeyFocus), XtRImmediate, (XtPointer)False }, #ifdef WSM { WmNrefreshByClearing, WmCRefreshByClearing, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, refreshByClearing), XtRImmediate, (XtPointer)True }, { WmNrootButtonClick, WmCRootButtonClick, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, rootButtonClick), XtRImmediate, (XtPointer)True }, #endif /* WSM */ #ifndef WSM { WmNsessionClientDB, WmCSessionClientDB, XtRString, sizeof(String), XtOffsetOf(WmGlobalData, sessionClientDB), XtRImmediate, (XtPointer)NULL }, #endif /* ! WSM */ { WmNshowFeedback, WmCShowFeedback, WmRShowFeedback, sizeof (int), XtOffsetOf(WmGlobalData, showFeedback), XtRImmediate, (XtPointer)(WM_SHOW_FB_DEFAULT) }, { WmNstartupKeyFocus, WmCStartupKeyFocus, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, startupKeyFocus), XtRImmediate, (XtPointer)True }, { WmNsystemButtonClick, WmCSystemButtonClick, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, systemButtonClick), XtRImmediate, (XtPointer)True }, { WmNsystemButtonClick2, WmCSystemButtonClick2, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, systemButtonClick2), XtRImmediate, (XtPointer)True }, #if defined(PANELIST) { WmNuseFrontPanel, WmCUseFrontPanel, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, useFrontPanel), XtRImmediate, (XtPointer)True }, #endif /* PANELIST */ #ifdef WSM { WmNhelpDirectory, WmCHelpDirectory, XtRString, sizeof (String), XtOffsetOf(WmGlobalData, helpDirectory), XtRImmediate, (XtPointer)"DT/Dtwm/" }, #endif /* WSM */ #ifdef MINIMAL_DT { WmNdtLite, WmCDtLite, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, dtLite), XtRImmediate, (XtPointer)False } #endif /* MINIMAL_DT */ }; /* END OF wmGlobalResources[] */ /* * These determine the screens to manage at startup. * These are broken out to enhance startup performance. */ XtResource wmGlobalScreenResources[] = { { WmNmultiScreen, WmCMultiScreen, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, multiScreen), XtRImmediate, #ifdef WSM (XtPointer)True #else /* WSM */ (XtPointer)False #endif /* WSM */ }, { WmNscreens, WmCScreens, XtRString, sizeof (String), XtOffsetOf(WmGlobalData, screenList), XtRImmediate, (XtPointer)NULL }, #ifdef WSM { WmNbackdropDirectories, WmCBackdropDirectories, XmRString, sizeof(char *), XtOffsetOf(WmGlobalData, backdropDirs), XmRString, DEFAULT_BACKDROP_DIR }, #endif /* WSM */ }; /******************************<->************************************* * * wmStdGlobalResources * * * Description: * ----------- * This data structure is used in the processing of mwm general appearance * and behavior resources that are not automatically set for the standard * (default) behavior. These resources are specified with the following * syntax: * * "Mwm*". * ******************************<->***********************************/ XtResource wmStdGlobalResources[] = { { WmNbitmapDirectory, WmCBitmapDirectory, XtRString, sizeof (String), XtOffsetOf(WmGlobalData, bitmapDirectory), XtRString, (XtPointer)BITMAPDIR }, { WmNconfigFile, WmCConfigFile, XtRString, sizeof (String), XtOffsetOf(WmGlobalData, configFile), XtRImmediate, (XtPointer)NULL }, { WmNframeStyle, WmCFrameStyle, WmRFrameStyle, sizeof (FrameStyle), XtOffsetOf(WmGlobalData, frameStyle), XtRImmediate, (XtPointer)WmRECESSED }, { WmNiconAutoPlace, WmCIconAutoPlace, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, iconAutoPlace), XtRImmediate, (XtPointer)True }, { WmNmoveThreshold, WmCMoveThreshold, XtRInt, sizeof (int), XtOffsetOf(WmGlobalData, moveThreshold), XtRImmediate, (XtPointer)4 }, { WmNpositionIsFrame, WmCPositionIsFrame, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, positionIsFrame), XtRImmediate, (XtPointer)True }, { WmNpositionOnScreen, WmCPositionOnScreen, XtRBoolean, sizeof (Boolean), XtOffsetOf(WmGlobalData, positionOnScreen), XtRImmediate, (XtPointer)True }, { WmNquitTimeout, WmCQuitTimeout, XtRInt, sizeof (int), XtOffsetOf(WmGlobalData, quitTimeout), XtRImmediate, (XtPointer)1000 }, { WmNshowFeedback, WmCShowFeedback, WmRShowFeedback, sizeof (int), XtOffsetOf(WmGlobalData, showFeedback), XtRImmediate, (XtPointer)(WM_SHOW_FB_DEFAULT) }, }; /******************************<->************************************* * * wmScreenResources * * * Description: * ----------- * This data structure is used in the processing of mwm screen specific * appearance and behavior resources. These resources are specified * with the following syntax: * * "Mwm*screen<#>*". * ******************************<->***********************************/ XtResource wmScreenResources[] = { { WmNbuttonBindings, WmCButtonBindings, XtRString, sizeof (String), XtOffsetOf (WmScreenData, buttonBindings), XtRString, (XtPointer)defaultButtonBindingsName }, { WmNcleanText, WmCCleanText, XtRBoolean, sizeof (Boolean), XtOffsetOf (WmScreenData, cleanText), XtRImmediate, (XtPointer)True }, { WmNfeedbackGeometry, WmCFeedbackGeometry, XtRString, sizeof (String), XtOffsetOf (WmScreenData, feedbackGeometry), XtRString, (XtPointer)NULL }, { WmNfadeNormalIcon, WmCFadeNormalIcon, XtRBoolean, sizeof (Boolean), XtOffsetOf (WmScreenData, fadeNormalIcon), XtRImmediate, (XtPointer)False }, { WmNiconDecoration, WmCIconDecoration, WmRIconDecor, sizeof (int), XtOffsetOf (WmScreenData, iconDecoration), XtRImmediate, (XtPointer)USE_ICON_DEFAULT_APPEARANCE }, #ifdef WSM { WmNiconImageMaximum, WmCIconImageMaximum, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, iconImageMaximum), XtRCallProc, (XtPointer) _WmIconImageMaximumDefault }, #else /* WSM */ { WmNiconImageMaximum, WmCIconImageMaximum, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, iconImageMaximum), XtRString, "50x50" }, #endif /* WSM */ { WmNiconImageMinimum, WmCIconImageMinimum, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, iconImageMinimum), XtRString, "16x16" }, { WmNiconPlacement, WmCIconPlacement, WmRIconPlacement, sizeof (int), XtOffsetOf (WmScreenData, iconPlacement), XtRImmediate, (XtPointer)(ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY) }, { WmNiconPlacementMargin, WmCIconPlacementMargin, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, iconPlacementMargin), XtRImmediate, (XtPointer)-1 }, { WmNkeyBindings, WmCKeyBindings, XtRString, sizeof (String), XtOffsetOf (WmScreenData, keyBindings), XtRString, (XtPointer)defaultKeyBindingsName }, { WmNframeBorderWidth, WmCFrameBorderWidth, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, frameBorderWidth), XtRImmediate, (XtPointer) BIGSIZE }, #ifndef WSM { WmNiconBoxGeometry, WmCIconBoxGeometry, XtRString, sizeof (String), XtOffsetOf (WmScreenData, iconBoxGeometry), XtRString, (XtPointer)NULL }, #endif /* WSM */ { WmNiconBoxName, WmCIconBoxName, XtRString, sizeof (String), XtOffsetOf (WmScreenData, iconBoxName), XtRString, (XtPointer)"iconbox" }, { WmNiconBoxSBDisplayPolicy, WmCIconBoxSBDisplayPolicy, XtRString, sizeof (String), XtOffsetOf (WmScreenData, iconBoxSBDisplayPolicy), XtRString, (XtPointer)"all" }, { WmNiconBoxScheme, WmCIconBoxScheme, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, iconBoxScheme), XtRImmediate, (XtPointer)0 }, { WmNiconBoxTitle, WmCIconBoxTitle, XmRXmString, sizeof (XmString), XtOffsetOf (WmScreenData, iconBoxTitle), XmRXmString, (XtPointer)NULL }, { WmNlimitResize, WmCLimitResize, XtRBoolean, sizeof (Boolean), XtOffsetOf (WmScreenData, limitResize), XtRImmediate, (XtPointer)True }, { WmNmaximumMaximumSize, WmCMaximumMaximumSize, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, maximumMaximumSize), XtRString, "0x0" }, { WmNresizeBorderWidth, WmCFrameBorderWidth, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, resizeBorderWidth), XtRImmediate, (XtPointer) BIGSIZE }, { WmNresizeCursors, WmCResizeCursors, XtRBoolean, sizeof (Boolean), XtOffsetOf (WmScreenData, resizeCursors), XtRImmediate, (XtPointer)True }, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) { WmNrootMenu, WmCRootMenu, XtRString, sizeof (String), XtOffsetOf (WmScreenData, rootMenu), XtRString, (XtPointer)builtinRootMenuName }, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ { WmNtransientDecoration, WmCTransientDecoration, WmRClientDecor, sizeof (int), XtOffsetOf (WmScreenData, transientDecoration), XtRImmediate, (XtPointer)(WM_DECOR_SYSTEM | WM_DECOR_RESIZEH) }, { WmNtransientFunctions, WmCTransientFunctions, WmRClientFunction, sizeof (int), XtOffsetOf (WmScreenData, transientFunctions), XtRImmediate, (XtPointer)(WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE)) }, #ifdef PANELIST { WmNsubpanelDecoration, WmCSubpanelDecoration, WmRClientDecor, sizeof (int), XtOffsetOf (WmScreenData, subpanelDecoration), XtRImmediate, (XtPointer)(WM_DECOR_SYSTEM) }, { WmNsubpanelResources, WmCSubpanelResources, XtRString, sizeof (String), XtOffsetOf (WmScreenData, subpanelResources), XtRString, (XtPointer)NULL }, #endif /* PANELIST */ { WmNuseIconBox, WmCUseIconBox, XtRBoolean, sizeof (Boolean), XtOffsetOf (WmScreenData, useIconBox), XtRImmediate, (XtPointer)False }, { WmNmoveOpaque, WmCMoveOpaque, XtRBoolean, sizeof (Boolean), XtOffsetOf (WmScreenData, moveOpaque), XtRImmediate, (XtPointer)False #ifdef WSM }, { WmNhelpResources, WmCHelpResources, XtRString, sizeof (String), XtOffsetOf (WmScreenData, helpResources), XtRString, (XtPointer)NULL }, { WmNinitialWorkspace, WmCInitialWorkspace, XtRString, sizeof (String), XtOffsetOf (WmScreenData, initialWorkspace), XtRString, (XtPointer)NULL }, { WmNworkspaceList, WmCWorkspaceList, XtRString, sizeof (String), XtOffsetOf (WmScreenData, workspaceList), XtRImmediate, (XtPointer)NULL }, { WmNworkspaceCount, WmCWorkspaceCount, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, numWorkspaces), XtRImmediate, (XtPointer)0 #endif /* WSM */ } }; /******************************<->************************************* * * wmStdScreenResources * * * Description: * ----------- * This data structure is used in the processing of mwm screen specific * appearance and behavior resources that are not automatically set for * the standard (default) behavior. These resources are specified with * the following syntax: * * "Mwm*screen<#>*". * ******************************<->***********************************/ XtResource wmStdScreenResources[] = { { WmNframeBorderWidth, WmCFrameBorderWidth, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, frameBorderWidth), XtRImmediate, (XtPointer) BIGSIZE }, #ifdef WSM { WmNiconImageMaximum, WmCIconImageMaximum, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, iconImageMaximum), XtRCallProc, (XtPointer) _WmIconImageMaximumDefault }, #else /* WSM */ { WmNiconImageMaximum, WmCIconImageMaximum, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, iconImageMaximum), XtRString, "50x50" }, #endif /* WSM */ { WmNiconImageMinimum, WmCIconImageMinimum, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, iconImageMinimum), XtRString, "32x32" }, { WmNiconPlacementMargin, WmCIconPlacementMargin, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, iconPlacementMargin), XtRImmediate, (XtPointer)-1 }, { WmNmaximumMaximumSize, WmCMaximumMaximumSize, WmRSize, sizeof (WHSize), XtOffsetOf (WmScreenData, maximumMaximumSize), XtRString, "0x0" }, { WmNresizeBorderWidth, WmCFrameBorderWidth, XtRInt, sizeof (int), XtOffsetOf (WmScreenData, resizeBorderWidth), XtRImmediate, (XtPointer) BIGSIZE } }; /******************************<->************************************* * * wmWorkspaceResources * * * Description: * ----------- * This data structure is used in the processing of mwm workspace * specific appearance and behavior resources. These resources are * specified with the following syntax: * * "Mwm*[screen<#>*]*". * ******************************<->***********************************/ #ifdef WSM XtResource wmWorkspaceResources[] = { { WmNiconBoxGeometry, WmCIconBoxGeometry, XtRString, sizeof (String), XtOffsetOf (WmWorkspaceData, iconBoxGeometry), XtRString, (XtPointer)NULL }, { WmNtitle, WmCTitle, XmRXmString, sizeof (XmString), XtOffsetOf (WmWorkspaceData, title), XmRXmString, (XtPointer)NULL } }; #else /* WSM */ XtResource *wmWorkspaceResources = NULL; #endif /* WSM */ /******************************<->************************************* * * wmStdWorkspaceResources * * * Description: * ----------- * This data structure is used in the processing of mwm workspace specific * appearance and behavior resources that are not automatically set for * the standard (default) behavior. These resources are specified with * the following syntax: * * "Mwm*[screen<#>*]*". * *************************************<->***********************************/ #ifdef WSM XtResource wmStdWorkspaceResources[] = { { WmNtitle, WmCTitle, XmRXmString, sizeof (XmString), XtOffsetOf (WmWorkspaceData, title), XmRXmString, (XtPointer)NULL } }; #else /* WSM */ XtResource *wmStdWorkspaceResources = NULL; #endif /* WSM */ #ifdef WSM /*************************************<->************************************* * * wmBackdropResources * * * Description: * ----------- * This data structure is used in the processing of workspace specific * resources that apply to the backdrop. * * These resources are specified with the following syntax: * * "Mwm*[screen*][workspace*]backdrop*:" * * NOTE: The order of these resources is important for correct * dynamic processing!!!! * *************************************<->***********************************/ XtResource wmBackdropResources[] = { { WmNcolorSetId, WmCColorSetId, XtRInt, sizeof (int), XtOffsetOf (BackdropData, colorSet), XtRCallProc, (XtPointer) _WmBackdropColorSetDefault }, { WmNimageBackground, WmCImageBackground, XtRPixel, sizeof (Pixel), XtOffsetOf (BackdropData, background), XtRCallProc, (XtPointer) _WmBackdropBgDefault }, { WmNimageForeground, WmCImageForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (BackdropData, foreground), XtRCallProc, (XtPointer) _WmBackdropFgDefault }, { WmNimage, WmCImage, XtRString, sizeof (String), XtOffsetOf (BackdropData, image), XtRString, (XtPointer)NULL }, }; /*************************************<->************************************* * * wmWsPresenceResources * * * Description: * ----------- * This data structure is used in the processing of specific * resources that apply to the WorkspacePresence dialog. * * These resources are specified with the following syntax: * * "Mwm*[screen*][workspace*]workspacePresence*:" * *************************************<->***********************************/ XtResource wmWsPresenceResources[] = { { WmNtitle, WmCTitle, XmRXmString, sizeof (XmString), XtOffsetOf (WsPresenceData, title), XmRXmString, (XtPointer)NULL } }; #endif /* WSM */ /*************************************<->************************************* * * wmClientResources * * * Description: * ----------- * This data structure is used in the processing of client specific * window manager resources. These resources are specified with the * following syntax: * * "Mwm**" * *************************************<->***********************************/ XtResource wmClientResources[] = { #ifdef WSM { WmNabsentMapBehavior, WmCAbsentMapBehavior, WmRAbsentMapBehavior, sizeof (int), XtOffsetOf (ClientData, absentMapBehavior), XtRImmediate, (XtPointer)(AMAP_BEHAVIOR_ADD) }, #endif /* WSM */ { WmNclientDecoration, WmCClientDecoration, WmRClientDecor, sizeof (int), XtOffsetOf (ClientData, clientDecoration), XtRImmediate, (XtPointer)(WM_DECOR_DEFAULT) }, { WmNclientFunctions, WmCClientFunctions, WmRClientFunction, sizeof (int), XtOffsetOf (ClientData, clientFunctions), XtRImmediate, (XtPointer)(WM_FUNC_DEFAULT) }, { WmNfocusAutoRaise, WmCFocusAutoRaise, XtRBoolean, sizeof (Boolean), XtOffsetOf (ClientData, focusAutoRaise), XtRCallProc, (XtPointer)_WmFocusAutoRaiseDefault }, { WmNiconImage, WmCIconImage, XtRString, sizeof (String), XtOffsetOf (ClientData, iconImage), XtRString, (XtPointer)NULL }, { WmNiconImageBackground, WmCIconImageBackground, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageBackground), XtRCallProc, (XtPointer)_WmIconImageBDefault }, { WmNiconImageForeground, WmCIconImageForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageForeground), XtRCallProc, (XtPointer)_WmIconImageFDefault }, { WmNiconImageBottomShadowColor, WmCIconImageBottomShadowColor, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageBottomShadowColor), XtRCallProc, (XtPointer)_WmIconImageBSCDefault }, { WmNiconImageBottomShadowPixmap, WmCIconImageBottomShadowPixmap, XtRString, sizeof (String), XtOffsetOf (ClientData, iconImageBottomShadowPStr), XtRCallProc, (XtPointer)_WmIconImageBSPDefault }, { WmNiconImageTopShadowColor, WmCIconImageTopShadowColor, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageTopShadowColor), XtRCallProc, (XtPointer)_WmIconImageTSCDefault }, { WmNiconImageTopShadowPixmap, WmCIconImageTopShadowPixmap, XtRString, sizeof (String), XtOffsetOf (ClientData, iconImageTopShadowPStr), XtRCallProc, (XtPointer)_WmIconImageTSPDefault }, { WmNignoreWMSaveHints, WmCIgnoreWMSaveHints, XtRBoolean, sizeof (Boolean), XtOffsetOf (ClientData, ignoreWMSaveHints), XtRImmediate, (XtPointer)True }, { WmNmatteWidth, WmCMatteWidth, XtRInt, sizeof (int), XtOffsetOf (ClientData, matteWidth), XtRImmediate, (XtPointer)0 }, { WmNmaximumClientSize, WmCMaximumClientSize, WmRSize, sizeof (WHSize), XtOffsetOf (ClientData, maximumClientSize), XtRString, "0x0" }, #ifdef WSM { WmNsecondariesOnTop, WmCSecondariesOnTop, XtRBoolean, sizeof (Boolean), XtOffsetOf (ClientData, secondariesOnTop), XtRCallProc, (XtPointer)_WmSecondariesOnTopDefault }, #endif /* WSM */ { WmNsystemMenu, WmCSystemMenu, XtRString, sizeof (String), XtOffsetOf (ClientData, systemMenu), XtRString, (XtPointer)defaultSystemMenuName }, { WmNuseClientIcon, WmCUseClientIcon, XtRBoolean, sizeof (Boolean), XtOffsetOf (ClientData, useClientIcon), XtRImmediate, #ifdef WSM (XtPointer)True #else (XtPointer)False #endif /* WSM */ }, { WmNusePPosition, WmCUsePPosition, WmRUsePPosition, sizeof (int), XtOffsetOf (ClientData, usePPosition), XtRImmediate, (XtPointer)(USE_PPOSITION_NONZERO) } }; /* END OF STRUCTURE wmClientResources */ /*************************************<->************************************* * * wmStdClientResources * * * Description: * ----------- * This data structure is used in the processing of client specific * window manager resources that are not automatically set for the standard * (default) behavior. These resources are specified with the * following syntax: * * "Mwm**" * *************************************<->***********************************/ XtResource wmStdClientResources[] = { { WmNiconImage, WmCIconImage, XtRString, sizeof (String), XtOffsetOf (ClientData, iconImage), XtRString, (XtPointer)NULL }, { WmNiconImageBackground, WmCIconImageBackground, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageBackground), XtRCallProc, (XtPointer)_WmIconImageBDefault }, { WmNiconImageForeground, WmCIconImageForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageForeground), XtRCallProc, (XtPointer)_WmIconImageFDefault }, { WmNiconImageBottomShadowColor, WmCIconImageBottomShadowColor, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageBottomShadowColor), XtRCallProc, (XtPointer)_WmIconImageBSCDefault }, { WmNiconImageBottomShadowPixmap, WmCIconImageBottomShadowPixmap, XtRString, sizeof (String), XtOffsetOf (ClientData, iconImageBottomShadowPStr), XtRCallProc, (XtPointer)_WmIconImageBSPDefault }, { WmNiconImageTopShadowColor, WmCIconImageTopShadowColor, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, iconImageTopShadowColor), XtRCallProc, (XtPointer)_WmIconImageTSCDefault }, { WmNiconImageTopShadowPixmap, WmCIconImageTopShadowPixmap, XtRString, sizeof (String), XtOffsetOf (ClientData, iconImageTopShadowPStr), XtRCallProc, (XtPointer)_WmIconImageTSPDefault }, { WmNmatteWidth, WmCMatteWidth, XtRInt, sizeof (int), XtOffsetOf (ClientData, matteWidth), XtRImmediate, (XtPointer)0 }, { WmNmaximumClientSize, WmCMaximumClientSize, WmRSize, sizeof (WHSize), XtOffsetOf (ClientData, maximumClientSize), XtRString, "0x0" }, #ifdef WSM { WmNsecondariesOnTop, WmCSecondariesOnTop, XtRBoolean, sizeof (Boolean), XtOffsetOf (ClientData, secondariesOnTop), XtRCallProc, (XtPointer)_WmSecondariesOnTopDefault }, #endif /* WSM */ { WmNuseClientIcon, WmCUseClientIcon, XtRBoolean, sizeof (Boolean), XtOffsetOf (ClientData, useClientIcon), XtRImmediate, (XtPointer)False } }; /*************************************<->************************************* * * wmClientResourcesM * * * Description: * ----------- * This data structure is used in the processing of client specific * window manager resources that affect the appearance of the client * matte. These resources are specified with the following syntax: * * "Mwm**" * *************************************<->***********************************/ XtResource wmClientResourcesM[] = { { WmNmatteBackground, WmCMatteBackground, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, matteBackground), XtRCallProc, (XtPointer)_WmMatteBDefault }, { WmNmatteForeground, WmCMatteForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, matteForeground), XtRCallProc, (XtPointer)_WmMatteFDefault }, { WmNmatteBottomShadowColor, WmCMatteBottomShadowColor, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, matteBottomShadowColor), XtRCallProc, (XtPointer)_WmMatteBSCDefault }, { WmNmatteBottomShadowPixmap, WmCMatteBottomShadowPixmap, XtRString, sizeof (String), XtOffsetOf (ClientData, matteBottomShadowPStr), XtRCallProc, (XtPointer)_WmMatteBSPDefault }, { WmNmatteTopShadowColor, WmCMatteTopShadowColor, XtRPixel, sizeof (Pixel), XtOffsetOf (ClientData, matteTopShadowColor), XtRCallProc, (XtPointer)_WmMatteTSCDefault }, { WmNmatteTopShadowPixmap, WmCMatteTopShadowPixmap, XtRString, sizeof (String), XtOffsetOf (ClientData, matteTopShadowPStr), XtRCallProc, (XtPointer)_WmMatteTSPDefault } }; /*************************************<->************************************* * * wmAppearanceResources * * * Description: * ----------- * This data structure is used in the processing of component appearance * resources. These resources are specified with the following syntax: * * "Mwm*" * "Mwm*client*" * "Mwm*icon*" * "Mwm*feedback*" * *************************************<->***********************************/ XtResource wmAppearanceResources[] = { { XmNfontList, XmCFontList, XmRFontList, sizeof (XmFontList), XtOffsetOf (AppearanceData, fontList), XtRString, "fixed" }, { WmNsaveUnder, WmCSaveUnder, XtRBoolean, sizeof (Boolean), XtOffsetOf (AppearanceData, saveUnder), XtRImmediate, (XtPointer)False }, { XtNbackground, XtCBackground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, background), XtRCallProc, (XtPointer)_WmBackgroundDefault }, { XtNforeground, XtCForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, foreground), XtRCallProc, (XtPointer)_WmForegroundDefault }, { XmNbottomShadowColor, XtCForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, bottomShadowColor), XtRCallProc, (XtPointer)_WmBottomShadowColorDefault }, { XmNbottomShadowPixmap, XmCBottomShadowPixmap, XtRString, sizeof (String), XtOffsetOf (AppearanceData, bottomShadowPStr), XtRString, (XtPointer)NULL }, { XmNtopShadowColor, XtCForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, topShadowColor), XtRCallProc, (XtPointer)_WmTopShadowColorDefault }, { XmNbackgroundPixmap, XmCBackgroundPixmap, XtRString, sizeof (String), XtOffsetOf (AppearanceData, backgroundPStr), XtRCallProc, (XtPointer)_WmBackgroundPixmapDefault }, { XmNtopShadowPixmap, XmCTopShadowPixmap, XtRString, sizeof (String), XtOffsetOf (AppearanceData, topShadowPStr), XtRCallProc, (XtPointer)_WmTopShadowPixmapDefault }, { WmNactiveBackground, XtCBackground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, activeBackground), XtRCallProc, (XtPointer)_WmABackgroundDefault }, { WmNactiveForeground, XtCForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, activeForeground), XtRCallProc, (XtPointer)_WmAForegroundDefault }, { WmNactiveBottomShadowColor, XtCForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, activeBottomShadowColor), XtRCallProc, (XtPointer)_WmABottomShadowColorDefault }, { WmNactiveBottomShadowPixmap, XmCBottomShadowPixmap, XtRString, sizeof (String), XtOffsetOf (AppearanceData, activeBottomShadowPStr), XtRString, (XtPointer)NULL }, { WmNactiveTopShadowColor, XtCForeground, XtRPixel, sizeof (Pixel), XtOffsetOf (AppearanceData, activeTopShadowColor), XtRCallProc, (XtPointer)_WmATopShadowColorDefault }, { WmNactiveBackgroundPixmap, XmCBackgroundPixmap, XtRString, sizeof (String), XtOffsetOf (AppearanceData, activeBackgroundPStr), XtRCallProc, (XtPointer)_WmABackgroundPixmapDefault }, { WmNactiveTopShadowPixmap, XmCTopShadowPixmap, XtRString, sizeof (String), XtOffsetOf (AppearanceData, activeTopShadowPStr), XtRCallProc, (XtPointer)_WmATopShadowPixmapDefault } }; /*************************************<->************************************* * * _WmIconImageFDefault (widget, offset, value) * _WmIconImageBDefault (widget, offset, value) * _WmIconImageBSCDefault (widget, offset, value) * _WmIconImageBSPDefault (widget, offset, value) * _WmIconImageTSCDefault (widget, offset, value) * _WmIconImageTSPDefault (widget, offset, value) * _WmMatteFDefault (widget, offset, value) * _WmMatteBDefault (widget, offset, value) * _WmMatteBSCDefault (widget, offset, value) * _WmMatteBSPDefault (widget, offset, value) * _WmMatteTSCDefault (widget, offset, value) * _WmMatteTSPDefault (widget, offset, value) * * * Description: * ----------- * These functions are used to generate dynamic defaults for various * client-specific appearance related resources. * * * Inputs: * ------ * widget = this is the parent widget for the wm subpart * * offset = this is the resource offset * * value = this is a pointer to a XrmValue in which to store the result * * _pCD = (static global) pointer to client data associated with resources * * * Outputs: * ------- * value = default resource value and size * *************************************<->***********************************/ void _WmIconImageFDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmFGC, 0, _pCD->iconImageBackground, value); } /* END OF FUNCTION _WmIconImageFDefault */ void _WmIconImageBDefault (Widget widget, int offset, XrmValue *value) { value->addr = (char *)&(_pCD->pSD->iconAppearance.background); value->size = sizeof (Pixel); } /* END OF FUNCTION _WmIconImageBDefault */ void _WmIconImageBSCDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmBSC, 0, _pCD->iconImageBackground, value); } /* END OF FUNCTION _WmIconImageBSCDefault */ void _WmIconImageBSPDefault (Widget widget, int offset, XrmValue *value) { value->addr = (char *)_pCD->pSD->iconAppearance.bottomShadowPStr; value->size = sizeof (String); } /* END OF FUNCTION _WmIconImageBSCDefault */ void _WmIconImageTSCDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmTSC, 0, _pCD->iconImageBackground, value); } /* END OF FUNCTION _WmIconImageTSCDefault */ void _WmIconImageTSPDefault (Widget widget, int offset, XrmValue *value) { value->addr = (char *)_pCD->pSD->iconAppearance.topShadowPStr; value->size = sizeof (String); } /* END OF FUNCTION _WmIconImageTSPDefault */ void _WmMatteFDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmFGC, 0, _pCD->matteBackground, value); } /* END OF FUNCTION _WmMatteFDefault */ void _WmMatteBDefault (Widget widget, int offset, XrmValue *value) { value->addr = (char *)&(_pCD->pSD->clientAppearance.background); value->size = sizeof (Pixel); } /* END OF FUNCTION _WmMatteBDefault */ void _WmMatteBSCDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmBSC, 0, _pCD->matteBackground, value); } /* END OF FUNCTION _WmMatteBSCDefault */ void _WmMatteBSPDefault (Widget widget, int offset, XrmValue *value) { value->addr = (char *)_pCD->pSD->clientAppearance.bottomShadowPStr; value->size = sizeof (String); } /* END OF FUNCTION _WmMatteBSCDefault */ void _WmMatteTSCDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmTSC, 0, _pCD->matteBackground, value); } /* END OF FUNCTION _WmMatteTSCDefault */ void _WmMatteTSPDefault (Widget widget, int offset, XrmValue *value) { value->addr = (char *)_pCD->pSD->clientAppearance.topShadowPStr; value->size = sizeof (String); } /* END OF FUNCTION _WmMatteTSCDefault */ /*************************************<->************************************* * * _WmBackgroundDefault (widget, offset, value) * _WmForegroundDefault (widget, offset, value) * _WmBackgroundPixmapDefault (widget, offset, value) * _WmBottomShadowColorDefault (widget, offset, value) * _WmTopShadowColorDefault (widget, offset, value) * _WmTopShadowPixmapDefault (widget, offset, value) * _WmABackgroundDefault (widget, offset, value) * _WmAForegroundDefault (widget, offset, value) * _WmABackgroundPixmapDefault (widget, offset, value) * _WmABottomShadowColorDefault (widget, offset, value) * _WmRFBackgroundDefault (widget, offset, value) * _WmRFForegroundDefault (widget, offset, value) * _WmATopShadowColorDefault (widget, offset, value) * _WmATopShadowPixmapDefault (widget, offset, value) * * * Description: * ----------- * These functions are used to generate dynamic defaults for various * component appearance related resources (not client-specific). * * * Inputs: * ------ * widget = this is the parent widget for the wm subpart * * offset = this is the resource offset * * value = this is a pointer to a XrmValue in which to store the result * * _defaultBackground = (static global) default background color (inactive) * * _defaultActiveBackground = (static global) default bg color (active) * * _pAppearanceData = (static global) pointer to resouce set structure * * * Outputs: * ------- * value = default resource value and size * *************************************<->***********************************/ void _WmBackgroundDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmBGC, _defaultBackground, 0, value); } /* END OF FUNCTION _WmBackgroundDefault */ void _WmForegroundDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->background, value); } /* END OF FUNCTION _WmForegroundDefault */ void _WmBackgroundPixmapDefault (Widget widget, int offset, XrmValue *value) { static String string; if ((Monochrome (XtScreen (widget))) || (_pAppearanceData->topShadowColor == _pAppearanceData->background)) { string = (String) _25_foreground; } else { string = NULL; } value->addr = (char *)string; value->size = sizeof (String); } /* END OF FUNCTION _WmBackgroundPixmapDefault */ void _WmBottomShadowColorDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->background, value); } /* END OF FUNCTION _WmBottomShadowColorDefault */ void _WmTopShadowColorDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->background, value); } /* END OF FUNCTION _WmTopShadowColorDefault */ void _WmTopShadowPixmapDefault (Widget widget, int offset, XrmValue *value) { static String string; if ((Monochrome (XtScreen (widget))) || (_pAppearanceData->topShadowColor == _pAppearanceData->background)) { /* Fix monochrome 3D appearance */ string = (String) _50_foreground; if (_pAppearanceData->backgroundPStr != NULL) if (!strcmp(_pAppearanceData->backgroundPStr, _25_foreground) || !strcmp(_pAppearanceData->backgroundPStr, _50_foreground)) { string = (String) _foreground; } } else { string = NULL; } value->addr = (char *)string; value->size = sizeof (String); } /* END OF FUNCTION _WmTopShadowPixmapDefault */ void _WmABackgroundDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmBGC, _defaultActiveBackground, 0, value); } /* END OF FUNCTION _WmABackgroundDefault */ void _WmAForegroundDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmFGC, 0, _pAppearanceData->activeBackground, value); } /* END OF FUNCTION _WmAForegroundDefault */ void _WmABackgroundPixmapDefault (Widget widget, int offset, XrmValue *value) { static String string; if ((Monochrome (XtScreen (widget))) || (_pAppearanceData->activeTopShadowColor == _pAppearanceData->activeBackground)) { string = (String) _50_foreground; } else { string = NULL; } value->addr = (char *)string; value->size = sizeof (String); } /* END OF FUNCTION _WmABackgroundPixmapDefault */ void _WmABottomShadowColorDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmBSC, 0, _pAppearanceData->activeBackground, value); } /* END OF FUNCTION _WmABottomShadowColorDefault */ void _WmATopShadowColorDefault (Widget widget, int offset, XrmValue *value) { _WmGetDynamicDefault (widget, WmTSC, 0, _pAppearanceData->activeBackground, value); } /* END OF FUNCTION _WmATopShadowColorDefault */ void _WmATopShadowPixmapDefault (Widget widget, int offset, XrmValue *value) { static String string; if ((Monochrome (XtScreen (widget))) || (_pAppearanceData->activeTopShadowColor == _pAppearanceData->activeBackground)) { /* Fix monochrome 3D appearance */ string = (String) _50_foreground; if (_pAppearanceData->activeBackgroundPStr != NULL) if (!strcmp (_pAppearanceData->activeBackgroundPStr, _25_foreground) || !strcmp (_pAppearanceData->activeBackgroundPStr, _50_foreground)) { string = (String) _foreground; } } else { string = NULL; } value->addr = (char *)string; value->size = sizeof (String); } /* END OF FUNCTION _WmATopShadowPixmapDefault */ #ifdef WSM void _WmBackdropBgDefault (Widget widget, int offset, XrmValue *value) { static Pixel pixValue; unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet; WmScreenData *pSD; if (wmGD.statusColorServer == CSERVE_NORMAL) { if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS)) { colorSetId = (unsigned int) DefaultWsColorSetId (pResWS); } switch (pResWS->pSD->colorUse) { case XmCO_BLACK_WHITE: pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg; break; default: case XmCO_LOW_COLOR: case XmCO_MEDIUM_COLOR: case XmCO_HIGH_COLOR: pixValue = pResWS->pSD->pPixelData[colorSetId-1].bs; break; } } else { /* * Color server is unavailable. Has user specified a colorset? * * If not, go monochrome. * */ pixValue = WhitePixel (DISPLAY, pResWS->pSD->screen); } /* return the dynamic default */ value->addr = (char *) &pixValue; value->size = sizeof (Pixel); } /* END OF FUNCTION _WmBackdropBgDefault */ void _WmBackdropFgDefault (Widget widget, int offset, XrmValue *value) { static Pixel pixValue; unsigned int colorSetId = (unsigned int) pResWS->backdrop.colorSet; WmScreenData *pSD; if (wmGD.statusColorServer == CSERVE_NORMAL) { if ((colorSetId == 0) || (colorSetId > XmCO_MAX_NUM_COLORS)) { colorSetId = (unsigned int) DefaultWsColorSetId (pResWS); } switch (pResWS->pSD->colorUse) { case XmCO_BLACK_WHITE: pixValue = pResWS->pSD->pPixelData[colorSetId-1].fg; break; default: case XmCO_LOW_COLOR: case XmCO_MEDIUM_COLOR: case XmCO_HIGH_COLOR: pixValue = pResWS->pSD->pPixelData[colorSetId-1].bg; break; } } else { /* * Color server is unavailable. Has user specified a colorset? * * If not, go monochrome. * */ pixValue = BlackPixel (DISPLAY, pResWS->pSD->screen); } value->addr = (char *) &pixValue; value->size = sizeof (Pixel); } /* END OF FUNCTION _WmBackdropFgDefault */ void _WmBackdropColorSetDefault (Widget widget, int offset, XrmValue *value) { static unsigned int colorSetId; if (wmGD.statusColorServer == CSERVE_NORMAL) { colorSetId = (unsigned int) DefaultWsColorSetId (pResWS); } else { colorSetId = 0; /* invalid color set */ } value->addr = (char *) &colorSetId; value->size = sizeof (Pixel); } /* END OF FUNCTION _WmBackdropColorSetIdDefault */ void _WmIconImageMaximumDefault (Widget widget, int offset, XrmValue *value) { static WHSize cval; if ((pResSD->displayResolutionType == LOW_RES_DISPLAY) || (pResSD->displayResolutionType == VGA_RES_DISPLAY)) { cval.width = 32; cval.height = 32; } else { cval.width = 48; cval.height = 48; } value->addr = (char *) &cval; value->size = sizeof (WHSize); } /* END OF FUNCTION _WmIconImageMaximumDefault */ /*************************************<->************************************* * * DefaultWsColorSetId (pWS) * * * Description: * ----------- * This function returns the default colorSetId for a given workspace * * * Inputs: * ------ * pWS = ptr to workspace data * * Outputs: * ------- * return = default color set ID. * * "active" and "inactive" color sets are not used. * *************************************<->***********************************/ int DefaultWsColorSetId (WmWorkspaceData *pWS) { static int _ws_high_color_map[] = { 3, 5, 6, 7 }; #define _WS_HIGH_COLOR_COUNT 4 int i; WmScreenData *pSD; int iIndex; int rval = 8; if (pWS) { pSD = pWS->pSD; iIndex = (int) ((unsigned long)(pWS) - (unsigned long)(pSD->pWS))/sizeof(WmWorkspaceData); if (iIndex < 0) iIndex = 0; /* bad pWS or pSD, shouldn't get here */ switch (pSD->colorUse) { case XmCO_BLACK_WHITE: case XmCO_LOW_COLOR: rval = 1 + (pSD->pInactivePixelSet-pSD->pPixelData)/sizeof(XmPixelSet); break; case XmCO_MEDIUM_COLOR: rval = HARD_CODED_PRIMARY; break; case XmCO_HIGH_COLOR: i = iIndex % _WS_HIGH_COLOR_COUNT; rval = _ws_high_color_map[i]; break; } } return (rval); } /* END OF FUNCTION DefaultWsColorSetId */ #endif /* WSM */ /*************************************<->************************************* * * _WmFocusAutoRaiseDefault (widget, offset, value) * * * Description: * ----------- * This function generates a default value for the focusAutoRaise resource. * * * Inputs: * ------ * widget = this is the parent widget for the wm subpart * * offset = this is the resource offset * * value = this is a pointer to a XrmValue in which to store the result * * * Outputs: * ------- * value = default resource value and size * *************************************<->***********************************/ void _WmFocusAutoRaiseDefault (Widget widget, int offset, XrmValue *value) { static Boolean focusAutoRaise; if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { focusAutoRaise = True; } else { focusAutoRaise = False; } value->addr = (char *)&focusAutoRaise; value->size = sizeof (Boolean); } /* END OF FUNCTION _WmFocusAutoRaiseDefault */ /*************************************<->************************************* * * _WmMultiClickTimeDefault (widget, offset, value) * * * Description: * ----------- * This function generates a default value for the doubleClickTime resource. * We dynamically default to the XtR4 multiClickTime value. * * Inputs: * ------ * widget = this is the parent widget for the wm subpart * * offset = this is the resource offset * * value = this is a pointer to a XrmValue in which to store the result * * Outputs: * ------- * value = default resource value and size * *************************************<->***********************************/ void _WmMultiClickTimeDefault (Widget widget, int offset, XrmValue *value) { static int multiClickTime; multiClickTime = XtGetMultiClickTime(XtDisplay(widget)); value->addr = (char *)&multiClickTime; value->size = sizeof (int); } /* END OF FUNCTION _WmMultiClickTimeDefault */ #ifdef WSM /*************************************<->************************************* * * _WmSecondariesOnTopDefault (widget, offset, value) * * * Description: * ----------- * This function generates a default value for the secondariesOnTop * resource. * * Inputs: * ------ * widget = this is the parent widget for the wm subpart * * offset = this is the resource offset * * value = this is a pointer to a XrmValue in which to store the result * * Outputs: * ------- * value = default resource value and size * *************************************<->***********************************/ void _WmSecondariesOnTopDefault (Widget widget, int offset, XrmValue *value) { static Boolean secondariesOnTop; /* * Inherit setting from primary window if this window is * secondary. */ if (_pCD->transientLeader != NULL) secondariesOnTop = _pCD->transientLeader->secondariesOnTop; else secondariesOnTop = True; value->addr = (char *)&secondariesOnTop; value->size = sizeof (Boolean); } /* END OF FUNCTION _WmSecondariesOnTopDefault */ #endif /* WSM */ /******************************<->************************************* * * ProcessWmResources () * * * Description: * ----------- * This function is used to retrieve and process window manager resources * that are not client-specific. * * * Inputs: * ------ * wmGlobalResources = pointer to wm resource list * * * Outputs: * ------- * wmGD = (global data filled out with resource values) * *************************************<->***********************************/ void ProcessWmResources (void) { /* * Process the mwm general appearance and behavior resources. Retrieve * a limited set of resource values if the window manager is starting * up with the standard behavior. */ if (wmGD.useStandardBehavior) { XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD, wmStdGlobalResources, XtNumber (wmStdGlobalResources), NULL, 0); /* * Fill in the standard resource values. */ SetStdGlobalResourceValues (); } else { XtGetApplicationResources (wmGD.topLevelW, (XtPointer) &wmGD, wmGlobalResources, XtNumber (wmGlobalResources), NULL, 0); } if (wmGD.autoRaiseDelay < 0) { wmGD.autoRaiseDelay = 500; Warning (((char *)GETMESSAGE(62, 66, "Out of range autoRaiseDelay resource value. Must be non-negative"))); } } /* END OF FUNCTION ProcessWmResources */ /******************************<->************************************* * * ProcessGlobalScreenResources () * * * Description: * ----------- * This function is used to retrieve window manager resources to * determine the screens to manage. * * * Inputs: * ------ * wmGlobalScreenResources = pointer to wm resource list * * * Outputs: * ------- * wmGD = (global data filled out with resource values) * *************************************<->***********************************/ void ProcessGlobalScreenResources (void) { XtGetApplicationResources (wmGD.topLevelW, &wmGD, wmGlobalScreenResources, XtNumber (wmGlobalScreenResources), NULL, 0); if (wmGD.multiScreen) { wmGD.numScreens = ScreenCount(DISPLAY); } else { wmGD.numScreens = 1; } if (wmGD.screenList != NULL) { ProcessScreenListResource(); } } /*************************************<->************************************* * * SetStdGlobalResourceValues () * * * Description: * ----------- * This function sets resource data to standard values. This setting * is done in place of getting the values from the user settings in * the resource database. * * * Outputs: * ------- * wmGD = (global data filled out with resource values) * *************************************<->***********************************/ void SetStdGlobalResourceValues (void) { wmGD.autoKeyFocus = True; wmGD.clientAutoPlace = True; wmGD.colormapFocusPolicy = CMAP_FOCUS_KEYBOARD; wmGD.deiconifyKeyFocus = True; wmGD.doubleClickTime = 500; wmGD.freezeOnConfig = True; wmGD.iconAutoPlace = True; wmGD.iconClick = True; wmGD.interactivePlacement = False; wmGD.keyboardFocusPolicy = KEYBOARD_FOCUS_EXPLICIT; wmGD.lowerOnIconify = True; wmGD.passSelectButton = True; wmGD.startupKeyFocus = True; wmGD.systemButtonClick = True; wmGD.systemButtonClick2 = True; #if defined(PANELIST) wmGD.useFrontPanel=False; #endif /* PANELIST */ } /* END OF FUNCTION SetStdGlobalResourceValues */ /*************************************<->************************************* * * ProcessScreenListResource () * * * Description: * ----------- * This processes the names in the screenList resource. * * * Inputs: * ------ * wmGlobalResources = pointer to wmGD.screenList * * * Outputs: * ------- * wmGD.screenNames * *************************************<->***********************************/ void ProcessScreenListResource (void) { unsigned char *lineP; unsigned char *string; int sNum = 0; int nameCount = 0; lineP = (unsigned char *)wmGD.screenList; /* * Parse screenList. */ while (((string = GetString(&lineP)) != NULL) && (sNum < ScreenCount(DISPLAY))) { if (!(wmGD.screenNames[sNum] = (unsigned char *) WmRealloc ((char*)wmGD.screenNames[sNum], strlen((char*)string)+1))) { ExitWM(WM_ERROR_EXIT_VALUE); } else { strcpy((char *)wmGD.screenNames[sNum], (char *)string); nameCount++; sNum++; } } /* * If the number of listed screens (sNum) is < screen count, fill in the * remaining screen names with the name of the first screen specified, * if such exists. */ if (nameCount > 0) { string = wmGD.screenNames[0]; /* name of the first screen */ while (sNum < ScreenCount(DISPLAY)) { if (!(wmGD.screenNames[sNum] = (unsigned char *) WmRealloc ((char*)wmGD.screenNames[sNum], strlen((char *)string)+1))) { ExitWM(WM_ERROR_EXIT_VALUE); } else { strcpy((char *)wmGD.screenNames[sNum], (char *)string); sNum++; } } } } /* END OF FUNCTION ProcessScreenListResource */ #ifdef WSM /******************************<->************************************* * * ProcessWmColors () * * * Description: * ----------- * Retrieve the color sets from the colorserver. * * Inputs: * ------ * none * * Outputs: * ------- * modifies parts of global pixel sets * * Comments: * -------- * ******************************<->***********************************/ void ProcessWmColors (WmScreenData *pSD) { short active, inactive, primary, secondary; if ((pSD->pPixelData = (XmPixelSet *) XtMalloc (XmCO_NUM_COLORS * sizeof(XmPixelSet)))) { /* * * * ASSUMPTION: If XmeGetPixelData() returns true, * we have a good color server at our disposal. * * */ if (XmeGetPixelData (pSD->screen, &pSD->colorUse, pSD->pPixelData, &active, &inactive, &primary, &secondary)) { pSD->pActivePixelSet = &(pSD->pPixelData[active]); pSD->pInactivePixelSet = &(pSD->pPixelData[inactive]); pSD->pPrimaryPixelSet = &(pSD->pPixelData[primary]); pSD->pSecondaryPixelSet = &(pSD->pPixelData[secondary]); /* Hack here. The index "4" is the proper array reference. */ /* This is used because XmGetPixelData has not been properly */ /* updated. */ pSD->pTextPixelSet = &(pSD->pPixelData[3]); wmGD.statusColorServer = CSERVE_NORMAL; } else { XtFree((char *)pSD->pPixelData); pSD->pPixelData = NULL; pSD->pActivePixelSet = NULL; pSD->pInactivePixelSet = NULL; pSD->pPrimaryPixelSet = NULL; pSD->pSecondaryPixelSet = NULL; pSD->pTextPixelSet = NULL; } } else { Warning (((char *)GETMESSAGE(62, 22, "Insufficient memory for color data"))); ExitWM (WM_ERROR_EXIT_VALUE); } } /* END OF FUNCTION ProcessWmColors */ /******************************<->************************************* * * WriteOutXrmColors () * * * Description: * ----------- * Update the XRM database with pixel values from the color server. * * Inputs: * ------ * pSD = contains pixel sets * * Outputs: * ------- * updated resource database * * Comments: * -------- * N.B. Must change to write out data on a PER-SCREEN basis. * e.g., "Dtwm*0*background" ******************************<->***********************************/ static void WriteOutXrmColors (WmScreenData *pSD) { XrmDatabase db; XrmValue value; int thisScreen = pSD->screen; XmPixelSet *tpixset, *ppixset; XmPixelSet *spixset; char *res_class; String screen_name; if (MwmBehavior) { res_class = WM_RESOURCE_CLASS; } else { res_class = DT_WM_RESOURCE_CLASS; } screen_name = (String) wmGD.screenNames[pSD->screen]; db = XtScreenDatabase(XScreenOfDisplay(DISPLAY, thisScreen)); /** update the clients database with new colors **/ value.size = sizeof(Pixel); /* * * WM ACTIVE RESOURCES--e.g., for the active frame * */ if (pSD->pActivePixelSet) { tpixset = pSD->pActivePixelSet; spixset = pSD->pSecondaryPixelSet; if (pSD->colorUse == XmCO_BLACK_WHITE) { /* * * Limit ourselves here to the client (frame) * visuals * */ /* activeForeground */ value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveForeground, NULL), XtRPixel, &value); /* activeBackground */ value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveBackground, NULL), XtRPixel, &value); XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNactiveBackgroundPixmap, NULL), _foreground); /* activeTopShadow */ XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNactiveTopShadowPixmap, NULL), _Dither); value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveTopShadowColor, NULL), XtRPixel, &value); /* activeBottomShadow */ value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveBottomShadowColor, NULL), XtRPixel, &value); XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNactiveBottomShadowPixmap, NULL), _foreground); } else /* active colors for non-BW systems */ { value.addr = (XtPointer) &(tpixset->bg); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveBackground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveForeground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->ts); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveTopShadowColor, NULL), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->bs); XrmPutResource (&db, ResCat (res_class, screen_name, WmNactiveBottomShadowColor, NULL), XtRPixel, &value); if (XmCO_DitherTopShadow(DISPLAY, thisScreen, tpixset)) { XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNactiveTopShadowPixmap, NULL), _Dither); } if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, tpixset)) { XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNactiveBottomShadowPixmap, NULL), _Dither); } } } /* * * WM INACTIVE colors--e.g., for dialogues * */ if (pSD->pInactivePixelSet) { tpixset = pSD->pInactivePixelSet; spixset = pSD->pSecondaryPixelSet; if (pSD->colorUse == XmCO_BLACK_WHITE) { /* * * Set colors/pixmaps for the frames--leave the * menus out of it so that their text won't look * unsatisfactory against a dithered background. * */ /* foreground */ value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNforeground), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNforeground), XtRPixel, &value); /* background */ XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNbackgroundPixmap), _Dither); XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNbackgroundPixmap), _Dither); value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNbackground), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNbackground), XtRPixel, &value); /* topshadow */ XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNtopShadowPixmap), _foreground); XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNtopShadowPixmap), _foreground); value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNtopShadowColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNtopShadowColor), XtRPixel, &value); /* bottomshadow */ XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNbottomShadowPixmap), _foreground); XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNbottomShadowPixmap), _foreground); value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNbottomShadowColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNbottomShadowColor), XtRPixel, &value); /* * * Ensure that the icon images have a black foreground and * a white background. * */ value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageForeground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageBackground, NULL), XtRPixel, &value); /* Now deal with XmCO_BLACK_WHITE Menus */ /* XmCO_BLACK_WHITE menu foreground */ value.addr = (XtPointer) &(tpixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNforeground), XtRPixel, &value); /* XmCO_BLACK_WHITE menu background */ value.addr = (XtPointer) &(tpixset->bg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNbackground), XtRPixel, &value); /* XmCO_BLACK_WHITE menu top shadow */ XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNtopShadowPixmap), _50_foreground); /* use foreground color for this pixmap */ value.addr = (XtPointer) &(tpixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNtopShadowColor), XtRPixel, &value); /* XmCO_BLACK_WHITE menu bottom shadow */ XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNbottomShadowPixmap), _75_foreground); /* use foreground color for this pixmap */ value.addr = (XtPointer) &(tpixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNbottomShadowColor), XtRPixel, &value); /* Finally, deal with XmCO_BLACK_WHITE Confirm Boxes */ /* XmCO_BLACK_WHITE confirm box foreground */ value.addr = (XtPointer) &(spixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNforeground), XtRPixel, &value); /* XmCO_BLACK_WHITE confirm box background */ value.addr = (XtPointer) &(spixset->bg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNbackground), XtRPixel, &value); /* XmCO_BLACK_WHITE confirm box top shadow */ XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNtopShadowPixmap), _50_foreground); /* use foreground color */ value.addr = (XtPointer) &(spixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNtopShadowColor), XtRPixel, &value); /* XmCO_BLACK_WHITE confirm box bottom shadow */ XrmPutStringResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNbottomShadowPixmap), _75_foreground); /* use foreground color */ value.addr = (XtPointer) &(spixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNbottomShadowColor), XtRPixel, &value); /* use select color for icon box trough color */ value.addr = (XtPointer) &(tpixset->sc); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, XmNtroughColor), XtRPixel, &value); /* use select color for arm and select colors in dialogs */ value.addr = (XtPointer) &(spixset->sc); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, XmNarmColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, XmNselectColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, XmNtroughColor), XtRPixel, &value); } else /* inactive colors for non-BW systems */ { XmPixelSet *fpixset; /* * Set mwm component colors */ value.addr = (XtPointer) &(tpixset->bg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNbackground), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNbackground), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNbackground), XtRPixel, &value); value.addr = (XtPointer) &(spixset->bg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNbackground), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->ts); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNtopShadowColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNtopShadowColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNtopShadowColor), XtRPixel, &value); value.addr = (XtPointer) &(spixset->ts); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNtopShadowColor), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->bs); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNbottomShadowColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNbottomShadowColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNbottomShadowColor), XtRPixel, &value); value.addr = (XtPointer) &(spixset->bs); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNbottomShadowColor), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, WmNforeground), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)ICON_FRAME_PART, WmNforeground), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, WmNforeground), XtRPixel, &value); value.addr = (XtPointer) &(spixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, WmNforeground), XtRPixel, &value); /* * Set select color only for menus and feedback mwm * parts. Client and Icon parts aren't real widgets. * Set client trough color for icon box. */ value.addr = (XtPointer) &(tpixset->sc); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, XmNselectColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, XmNarmColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)MENU_ITEM_PART, XmNtroughColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)CLIENT_FRAME_PART, XmNtroughColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, XmNselectColor), XtRPixel, &value); value.addr = (XtPointer) &(spixset->sc); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, XmNarmColor), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, (char *)FEEDBACK_FRAME_PART, XmNtroughColor), XtRPixel, &value); /* * Set Dtwm dialog colors */ fpixset = pSD->pSecondaryPixelSet; value.addr = (XtPointer) &(fpixset->bg); XrmPutResource (&db, ResCat (res_class, screen_name, XmNbackground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(fpixset->fg); XrmPutResource (&db, ResCat (res_class, screen_name, XmNforeground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(fpixset->ts); XrmPutResource (&db, ResCat (res_class, screen_name, XmNtopShadowColor, NULL), XtRPixel, &value); value.addr = (XtPointer) &(fpixset->bs); XrmPutResource (&db, ResCat (res_class, screen_name, XmNbottomShadowColor, NULL), XtRPixel, &value); /* * * Set up the select color, as for buttons in the dialogue * boxes. * */ value.addr = (XtPointer) &(fpixset->sc); XrmPutResource (&db, ResCat (res_class, screen_name, XmNselectColor, NULL), XtRPixel, &value); /* value.addr = (XtPointer) &(fpixset->sc); */ XrmPutResource (&db, ResCat (res_class, screen_name, XmNarmColor, NULL), XtRPixel, &value); /* value.addr = (XtPointer) &(fpixset->sc); */ XrmPutResource (&db, ResCat (res_class, screen_name, XmNtroughColor, NULL), XtRPixel, &value); if (XmCO_DitherTopShadow(DISPLAY, thisScreen, fpixset)) { XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNtopShadowPixmap, NULL), _Dither); if (pSD->colorUse == XmCO_BLACK_WHITE) { XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNbottomShadowPixmap, NULL), _NoDither); } } if (XmCO_DitherBottomShadow(DISPLAY, thisScreen, fpixset)) { XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNbottomShadowPixmap, NULL), _Dither); if (pSD->colorUse == XmCO_BLACK_WHITE) { XrmPutStringResource (&db, ResCat (res_class, screen_name, WmNtopShadowPixmap, NULL), _NoDither); } } if (tpixset->bs != tpixset->ts) /* * * If the inactive bottomshadow and topshadow are * different (i.e., valid), then make the icon image * use those colors. */ { value.addr = (XtPointer) &(tpixset->bs); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageForeground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->ts); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageBackground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->bs); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageBottomShadowColor, NULL), XtRPixel, &value); value.addr = (XtPointer) &(tpixset->ts); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageTopShadowColor, NULL), XtRPixel, &value); } else /* * * Ensure that the icon images have a black foreground and * a white background. * */ { value.addr = (XtPointer) &(BlackPixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageForeground, NULL), XtRPixel, &value); value.addr = (XtPointer) &(WhitePixel(DISPLAY, pSD->screen)); XrmPutResource (&db, ResCat (res_class, screen_name, WmNiconImageBackground, NULL), XtRPixel, &value); } } } if (pSD->pTextPixelSet) { value.addr = (XtPointer) &(pSD->pTextPixelSet->bg); XrmPutResource (&db, ResCat (res_class, screen_name, "XmTextField", WmNbackground), XtRPixel, &value); XrmPutResource (&db, ResCat (res_class, screen_name, "XmText", WmNbackground), XtRPixel, &value); } } /******************************<->************************************* * * ResCat (s1,s2,s3,s4) * * * Description: * ----------- * Cats up to four strings together with '*' in between. * * * Inputs: * ------ * s1...s4 = pointers to Strings or NULL pointers (no string) * * Outputs: * ------- * Return = pointer to statically allocated string that has * the passed in string cat'ed together with '*'s * in between. * * Comments: * -------- * Does no limit checking on the static buffer * *************************************<->***********************************/ String ResCat (String s1, String s2, String s3, String s4) { int count; Boolean useResourceClass = True; wmGD.tmpBuffer[0] = '\0'; count = MAXBUF - 1; if (s1) { if ((MwmBehavior) && !strcmp (s1, WM_RESOURCE_CLASS)) /* * * if this routine is called with a class name * ("Mwm" or "Dtwm"), then DON'T use it. * We want our resources to be written out * as: *iconImageForeground: * * as opposed to: Dtwm*iconImageForeground: * */ { useResourceClass = False; } else if (!strcmp (s1, DT_WM_RESOURCE_CLASS)) { useResourceClass = False; } else { strncat((char *)wmGD.tmpBuffer, s1, count); count -= strlen(s1); } if (s2 && (count > 0)) { strncat ((char *)wmGD.tmpBuffer, "*", count); count -= 1; strncat ((char *)wmGD.tmpBuffer, s2, count); count -= strlen (s2); if (s3 && (count > 0)) { strncat ((char *)wmGD.tmpBuffer, "*", count); count -= 1; strncat ((char *)wmGD.tmpBuffer, s3, count); count -= strlen (s3); if (s4) { strncat ((char *)wmGD.tmpBuffer, "*", count); count -= 1; strncat ((char *)wmGD.tmpBuffer, s4, count); } } } } return ((String) wmGD.tmpBuffer); } /* END OF FUNCTION ResCat */ /******************************<->************************************* * * CheckForNoDither (pAD) * * * Description: * ----------- * Checks for reserved string as pixmap name of dither that indicates * no dithering and replaces the string with a NULL. * * * Inputs: * ------ * pAD = pointer to appearance data * * Outputs: * ------- * pAD = pointer to appearance data (may be modified) * * Comments: * --------- * This check is done to avoid repeated calls to XmGetPixmap when * managing windows. XmGetPixmap doesn't cache failures, and the * NoDither string should fail every time. We want to prevent * XmGetPixmap from call XtResolvePathName to rummage through * the file system. * *************************************<->***********************************/ void CheckForNoDither (AppearanceData *pAD) { if (pAD->backgroundPStr && !strcmp(pAD->backgroundPStr, _NoDither)) { pAD->backgroundPStr = NULL; } if (pAD->bottomShadowPStr && !strcmp(pAD->bottomShadowPStr, _NoDither)) { pAD->bottomShadowPStr = NULL; } if (pAD->topShadowPStr && !strcmp(pAD->topShadowPStr, _NoDither)) { pAD->topShadowPStr = NULL; } if (pAD->activeBackgroundPStr && !strcmp(pAD->activeBackgroundPStr, _NoDither)) { pAD->activeBackgroundPStr = NULL; } if (pAD->activeBottomShadowPStr && !strcmp(pAD->activeBottomShadowPStr, _NoDither)) { pAD->activeBottomShadowPStr = NULL; } if (pAD->activeTopShadowPStr && !strcmp(pAD->activeTopShadowPStr, _NoDither)) { pAD->activeTopShadowPStr = NULL; } } /* END OF FUNCTION CheckForNoDither */ #endif /* WSM */ /******************************<->************************************* * * ProcessAppearanceResources (pSD) * * * Description: * ----------- * Retrieve and process the general appearance resources for the mwm * subparts: "client", "icon", and "feedback" * * * Inputs: * ------ * pSD = pointer to screen data * * Outputs: * ------- * modifies parts of global data wmGD. * * Comments: * -------- * o Changeable GCs are created with XCreateGC. The base GCs used for * text output will have clip_masks defined for them later. * * *************************************<->***********************************/ void ProcessAppearanceResources (WmScreenData *pSD) { Widget clientW; /* dummy widget for resource fetching */ int i; Arg args[10]; /* * Get the client subpart resources: */ /* save info in static globals for dynamic default processing */ _defaultBackground = _defaultColor1; _defaultActiveBackground = _defaultColor2; _pAppearanceData = &(pSD->clientAppearance); (void)XtGetSubresources (pSD->screenTopLevelW, (XtPointer) &(pSD->clientAppearance), WmNclient, WmCClient, wmAppearanceResources, XtNumber (wmAppearanceResources), NULL, 0); #ifdef WSM CheckForNoDither (&(pSD->clientAppearance)); #endif /* WSM */ /* * Process the client resource values: */ /* make background, top and bottom shadow pixmaps */ MakeAppearanceResources (pSD, &(pSD->clientAppearance), True); /* * Get the client.title subpart resources: */ /* insert "client" widget in hierarchy */ i = 0; clientW = XtCreateWidget (WmNclient, xmRowColumnWidgetClass, pSD->screenTopLevelW, (ArgList) args, i); /* fetch "client.title" subpart appearance resources */ _pAppearanceData = &(pSD->clientTitleAppearance); (void)XtGetSubresources (clientW, (XtPointer) &(pSD->clientTitleAppearance), WmNtitle, WmCTitle, wmAppearanceResources, XtNumber (wmAppearanceResources), NULL, 0); #ifdef WSM CheckForNoDither (&(pSD->clientTitleAppearance)); #endif /* WSM */ /* * Process the client.title resource values: */ /* * check if client title appearance is different from the rest of frame. */ if (SimilarAppearanceData (&(pSD->clientAppearance), &(pSD->clientTitleAppearance))) { /* title bar doesn't need special graphic processing */ pSD->decoupleTitleAppearance = False; } else { /* make background, top and bottom shadow pixmaps */ MakeAppearanceResources (pSD, &(pSD->clientTitleAppearance), True); pSD->decoupleTitleAppearance = True; } XtDestroyWidget (clientW); /* all done with dummy widget */ /* * Get the icon subpart resources: */ _pAppearanceData = &(pSD->iconAppearance); (void)XtGetSubresources (pSD->screenTopLevelW, (XtPointer) &(pSD->iconAppearance), WmNicon, WmCIcon, wmAppearanceResources, XtNumber (wmAppearanceResources), NULL, 0); #ifdef WSM CheckForNoDither (&(pSD->iconAppearance)); #endif /* WSM */ /* * Process the icon resource values: */ /* make background, top and bottom shadow pixmaps */ MakeAppearanceResources (pSD, &(pSD->iconAppearance), True); /* * Get the feedback subpart resources: * !!! only get "inactive" resources !!! */ _defaultBackground = _defaultColor2; _defaultActiveBackground = _defaultColor2; _pAppearanceData = &(pSD->feedbackAppearance); (void)XtGetSubresources (pSD->screenTopLevelW, (XtPointer) &(pSD->feedbackAppearance), WmNfeedback, WmCFeedback, wmAppearanceResources, XtNumber (wmAppearanceResources), NULL, 0); #ifdef WSM CheckForNoDither (&(pSD->feedbackAppearance)); #endif /* WSM */ /* * Process the feedback resource values: */ /* make background, top and bottom shadow pixmaps */ MakeAppearanceResources (pSD, &(pSD->feedbackAppearance), False); } /* END OF FUNCTION ProcessAppearanceResources */ /*************************************<->************************************* * * MakeAppearanceResources (pSD, pAData, makeActiveResources) * * * Description: * ----------- * This function makes top, bottom and background pixmaps for a window * manager component. Inactive and active (if specified) GC's are * also made. * * * Inputs: * ------ * pSD = pointer to screen data * * pAData = pointer to appearance data structure containing resource info * * makeActiveResources = if True then make active resources * * Outputs: * ------- * *pAData = pixmap and GC fields filled out * *************************************<->***********************************/ void MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean makeActiveResources) { Pixel foreground; /* * Extract a font from the font list. */ if (! XmeRenderTableGetDefaultFont(pAData->fontList, &(pAData->font))) { sprintf((char *)wmGD.tmpBuffer, ((char *)GETMESSAGE(62, 23, "failed to load font: %.100s")), (char*) pAData->fontList); Warning((char *)wmGD.tmpBuffer); ExitWM(WM_ERROR_EXIT_VALUE); } #ifndef NO_MULTIBYTE /* * Calculate title bar's height and store it in pAData. */ pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent + WM_TITLE_BAR_PADDING; #endif /* * Make standard (inactive) appearance resources. */ /* background pixmap */ if (pAData->backgroundPStr) { pAData->backgroundPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pAData->backgroundPStr, pAData->foreground, pAData->background); if (pAData->backgroundPixmap == XmUNSPECIFIED_PIXMAP) { pAData->backgroundPixmap = (Pixmap)NULL; } } else { pAData->backgroundPixmap = (Pixmap)NULL; } /* top shadow pixmap */ if (pAData->topShadowPStr) { /* * Make sure top shadow color is not the same as background * otherwise the wrong pixmap will be generated. */ if (pAData->topShadowColor != pAData->background) foreground = pAData->topShadowColor; else foreground = pAData->foreground; pAData->topShadowPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pAData->topShadowPStr, foreground, pAData->background); if (pAData->topShadowPixmap == XmUNSPECIFIED_PIXMAP) { pAData->topShadowPixmap = (Pixmap)NULL; } } else { pAData->topShadowPixmap = (Pixmap)NULL; } /* bottom shadow pixmap */ if (pAData->bottomShadowPStr) { /* * Make sure bottom shadow color is not the same as background * otherwise the wrong pixmap will be generated. */ if (pAData->bottomShadowColor != pAData->background) foreground = pAData->bottomShadowColor; else foreground = pAData->foreground; pAData->bottomShadowPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pAData->bottomShadowPStr, foreground, pAData->background); if (pAData->bottomShadowPixmap == XmUNSPECIFIED_PIXMAP) { pAData->bottomShadowPixmap = (Pixmap)NULL; } } else { pAData->bottomShadowPixmap = (Pixmap)NULL; } /* inactive appearance GC */ GetAppearanceGCs (pSD, pAData->foreground, pAData->background, pAData->font, pAData->backgroundPixmap, pAData->topShadowColor, pAData->topShadowPixmap, pAData->bottomShadowColor, pAData->bottomShadowPixmap, &(pAData->inactiveGC), &(pAData->inactiveTopShadowGC), &(pAData->inactiveBottomShadowGC)); /* * Make active apppearance resources if specified. */ if (!makeActiveResources) { return; } /* active background pixmap */ if (pAData->activeBackgroundPStr) { pAData->activeBackgroundPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pAData->activeBackgroundPStr, pAData->activeForeground, pAData->activeBackground); if (pAData->activeBackgroundPixmap == XmUNSPECIFIED_PIXMAP) { pAData->activeBackgroundPixmap = (Pixmap)NULL; } } else { pAData->activeBackgroundPixmap = (Pixmap)NULL; } /* active top shadow pixmap */ if (pAData->activeTopShadowPStr) { pAData->activeTopShadowPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pAData->activeTopShadowPStr, pAData->activeTopShadowColor, pAData->activeBackground); if (pAData->activeTopShadowPixmap == XmUNSPECIFIED_PIXMAP) { pAData->activeTopShadowPixmap = (Pixmap)NULL; } } else { pAData->activeTopShadowPixmap = (Pixmap)NULL; } /* active bottom shadow pixmap */ if (pAData->activeBottomShadowPStr) { pAData->activeBottomShadowPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pAData->activeBottomShadowPStr, pAData->activeBottomShadowColor, pAData->activeBackground); if (pAData->activeBottomShadowPixmap == XmUNSPECIFIED_PIXMAP) { pAData->activeBottomShadowPixmap = (Pixmap)NULL; } } else { pAData->activeBottomShadowPixmap = (Pixmap)NULL; } /* inactive appearance GC */ GetAppearanceGCs (pSD, pAData->activeForeground, pAData->activeBackground, pAData->font, pAData->activeBackgroundPixmap, pAData->activeTopShadowColor, pAData->activeTopShadowPixmap, pAData->activeBottomShadowColor, pAData->activeBottomShadowPixmap, &(pAData->activeGC), &(pAData->activeTopShadowGC), &(pAData->activeBottomShadowGC)); } /* END OF FUNCTION MakeAppearanceResources */ /*************************************<->************************************* * * GetAppearanceGCs (pSD, fg, bg, font, bg_pixmap, ts_color, * ts_pixmap, bs_color, bs_pixmap, pGC, ptsGC, pbsGC) * * * Description: * ----------- * Creates the appearance GCs for any of the icon, client, or feedback * resources. * * * Inputs: * ------ * pSD - pointer to screen data * fg - base foreground color * bg - base background color * font - font * bg_pixmap - background pixmap * ts_color - top shadow color * ts_pixmap - top shadow pixmap * bs_color - bottom shadow color * bs_pixmap - bottom shadow pixmap * pGC - pointer to location to receive base GC * ptsGC - pointer to location to receive top shadow GC * pbsGC - pointer to location to receive bottom shadow GC * * Outputs: * ------- * *pGC - base GC * *ptsGC - top shadow GC * *pbsGC - bottom shadow GC * * * Comments: * -------- * * *************************************<->***********************************/ void GetAppearanceGCs (WmScreenData *pSD, Pixel fg, Pixel bg, XFontStruct *font, Pixmap bg_pixmap, Pixel ts_color, Pixmap ts_pixmap, Pixel bs_color, Pixmap bs_pixmap, GC *pGC, GC *ptsGC, GC *pbsGC) { XGCValues gcv; XtGCMask mask; /* * Get base GC */ mask = GCForeground | GCBackground | GCFont; gcv.foreground = fg; gcv.background = bg; gcv.font = font->fid; if (bg_pixmap) { mask |= GCTile; gcv.tile = bg_pixmap; } *pGC = XCreateGC (DISPLAY, pSD->rootWindow, mask, &gcv); /* * !!! Need GC error detection !!! */ *ptsGC = GetHighlightGC (pSD, ts_color, bg, ts_pixmap); *pbsGC = GetHighlightGC (pSD, bs_color, bg, bs_pixmap); } /* END OF FUNCTION GetAppearanceGCs */ /*************************************<->************************************* * * ProcessScreenResources (pSD, screenName) * * * Description: * ----------- * This function retrieves resources that are screen specific. If the * window manager is providing standard behavior then retrieve the limited * set of resources that don't affect standard behavior and set the * values of the other resources to the standard values. * * * Inputs: * ------ * pSD = pointer to screen data * screenName = name of screen * * * Outputs: * ------- * pSD = resource data for screen is set * * * Comments: * -------- * o Gets subresources based on workspace name * *************************************<->***********************************/ void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName) { #ifdef WSM pResSD = pSD; /* save current screen data for default processing */ /* * Use the screen name (e.g., "0") as the default resource name. */ if (wmGD.useStandardBehavior) { XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD, (String) screenName, (String) screenName, wmStdScreenResources, XtNumber (wmStdScreenResources), NULL, 0); /* * Fill in the standard resource values. */ SetStdScreenResourceValues (pSD); } else { XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD, (String)screenName, (String) screenName, wmScreenResources, XtNumber (wmScreenResources), NULL, 0); #ifndef MOTIF_ONE_DOT_ONE pSD->moveOpaque = (((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW))) -> screen.moveOpaque); #endif } #else /* WSM */ /* * Retrieve screen specific resources. */ if (wmGD.useStandardBehavior) { XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD, (String) screenName, (String)screenName, wmStdScreenResources, XtNumber (wmStdScreenResources), NULL, 0); /* * Fill in the standard resource values. */ SetStdScreenResourceValues (pSD); } else { XtGetSubresources (wmGD.topLevelW, (XtPointer) pSD, (String)screenName, (String)screenName, wmScreenResources, XtNumber (wmScreenResources), NULL, 0); #ifndef MOTIF_ONE_DOT_ONE pSD->moveOpaque =(((XmScreen) XmGetXmScreen(XtScreen(pSD->screenTopLevelW))) -> screen.moveOpaque); #endif } #endif /* WSM */ /* * Do some additional processing on the window manager resource values. */ if (pSD->iconImageMinimum.width < ICON_IMAGE_MIN_WIDTH) { pSD->iconImageMinimum.width = ICON_IMAGE_MIN_WIDTH; } else if (pSD->iconImageMinimum.width > ICON_IMAGE_MAX_WIDTH) { pSD->iconImageMinimum.width = ICON_IMAGE_MAX_WIDTH; } if (pSD->iconImageMinimum.height < ICON_IMAGE_MIN_HEIGHT) { pSD->iconImageMinimum.height = ICON_IMAGE_MIN_HEIGHT; } else if (pSD->iconImageMinimum.height > ICON_IMAGE_MAX_HEIGHT) { pSD->iconImageMinimum.height = ICON_IMAGE_MAX_HEIGHT; } if (pSD->iconImageMaximum.width < pSD->iconImageMinimum.width) { pSD->iconImageMaximum.width = pSD->iconImageMinimum.width; } else if (pSD->iconImageMaximum.width > ICON_IMAGE_MAX_WIDTH) { pSD->iconImageMaximum.width = ICON_IMAGE_MAX_WIDTH; } if (pSD->iconImageMaximum.height < pSD->iconImageMinimum.height) { pSD->iconImageMaximum.height = pSD->iconImageMinimum.height; } else if (pSD->iconImageMaximum.height > ICON_IMAGE_MAX_HEIGHT) { pSD->iconImageMaximum.height = ICON_IMAGE_MAX_HEIGHT; } if (pSD->iconPlacementMargin > MAXIMUM_ICON_MARGIN) { pSD->iconPlacementMargin = MAXIMUM_ICON_MARGIN; } if (pSD->maximumMaximumSize.width <= 0) { pSD->maximumMaximumSize.width = 2 * DisplayWidth (DISPLAY, pSD->screen); } if (pSD->maximumMaximumSize.height <= 0) { pSD->maximumMaximumSize.height = 2 * DisplayHeight (DISPLAY, pSD->screen); } /* * Set the icon appearance default based on whether or not the icon box * is being used. */ if (pSD->iconDecoration & USE_ICON_DEFAULT_APPEARANCE) { if (pSD->useIconBox) { pSD->iconDecoration = ICON_APPEARANCE_ICONBOX; } else { pSD->iconDecoration = ICON_APPEARANCE_STANDALONE; } } /* * If resizeBorderWidth or frameBorderWidth is unset then initialize * to dynamic defaults. */ if ((pSD->resizeBorderWidth == (Dimension)BIGSIZE) || (pSD->frameBorderWidth == (Dimension)BIGSIZE)) { double xres, yres, avg_res; xres = (((double) DisplayWidth(DISPLAY, pSD->screen)) / ((double) DisplayWidthMM(DISPLAY, pSD->screen))); yres = (((double) DisplayHeight(DISPLAY, pSD->screen)) / ((double) DisplayHeightMM(DISPLAY, pSD->screen))); avg_res = (xres + yres) / 2.0; /* Multiply times width in mm (avg. 7-8 pixels) */ if (pSD->resizeBorderWidth == (Dimension)BIGSIZE) { pSD->resizeBorderWidth = (int) (avg_res * 2.2); /* limit size because big borders look ugly */ #ifndef WSM if (wmGD.frameStyle == WmSLAB) { #endif /* WSM */ if (pSD->resizeBorderWidth > 6) pSD->resizeBorderWidth = 6; #ifndef WSM } else { if (pSD->resizeBorderWidth > 7) pSD->resizeBorderWidth = 7; } #endif /* WSM */ } /* Multiply times width in mm (avg. 5-6 pixels) */ if (pSD->frameBorderWidth == (Dimension)BIGSIZE) { pSD->frameBorderWidth = (int) (avg_res * 1.7); /* limit size because big borders look ugly */ if (wmGD.frameStyle == WmSLAB) { if (pSD->frameBorderWidth > 4) pSD->frameBorderWidth = 4; } else { if (pSD->frameBorderWidth > 5) pSD->frameBorderWidth = 5; } } } pSD->externalBevel = FRAME_EXTERNAL_SHADOW_WIDTH; pSD->joinBevel = FRAME_INTERNAL_SHADOW_WIDTH; if (pSD->frameBorderWidth < (pSD->externalBevel + MIN_INTERNAL_BEVEL)) { pSD->frameBorderWidth = pSD->externalBevel + MIN_INTERNAL_BEVEL; } else if (pSD->frameBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH) { pSD->frameBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH; } if (pSD->resizeBorderWidth < (pSD->externalBevel + MIN_INTERNAL_BEVEL)) { pSD->resizeBorderWidth = (pSD->externalBevel + MIN_INTERNAL_BEVEL); } else if (pSD->resizeBorderWidth > MAXIMUM_FRAME_BORDER_WIDTH) { pSD->resizeBorderWidth = MAXIMUM_FRAME_BORDER_WIDTH; } #ifdef WSM /* * Update the resource database. */ WriteOutXrmColors (pSD); #endif /* WSM */ /* * Process the component appearance resources for client, * icon and feedback parts of mwm. */ ProcessAppearanceResources (pSD); #ifdef WSM /* * Process the workspace list and name the initial * workspaces */ ProcessWorkspaceList (pSD); /* * Process default backdrop images to be used in low-color * situations */ ProcessDefaultBackdropImages (pSD); #endif /* WSM */ /* * Save the default icon pixmap in global data. We'll use it only * as a last resort. */ pSD->builtinIconPixmap = XCreateBitmapFromData (DISPLAY, pSD->rootWindow, (char *)iImage_bits, iImage_width, iImage_height); } /* END OF FUNCTION ProcessScreenResources */ #ifdef WSM /*************************************<->************************************* * * ProcessDefaultBackdropImages (pSD) * * * Description: * ----------- * This function processes the default backdrop images to be used * in low color or black and white workspaces. * * * Inputs: * ------ * pSD = pointer to screen data * * * Outputs: * ------- * pSD = resource data for screen is set * * * Comments: * -------- * *************************************<->***********************************/ void ProcessDefaultBackdropImages (WmScreenData *pSD) { } /* END OF FUNCTION ProcessDefaultBackdropImages */ /*************************************<->************************************* * * ProcessWorkspaceList (pSD) * * * Description: * ----------- * This function processes the workspaceCount and workspaceList * resources for a particular screen. It creates space for the initial * workspace data structures and adds in names for workspaces. * * * Inputs: * ------ * pSD = pointer to screen data * * * Outputs: * ------- * pSD = resource data for screen is set * * * Comments: * -------- * NOTE: The workspaceCount resource has precedence over the * workspaceList resource. workspaceCount determines the number of * workspaces to create for the screen. Once the number is determined, * workspaceList is used to fill in the "names." If workspaceList is * not present or doesn't have enough names, then missing names are * generated automatically. If workspaceList is present and * workspaceCount is not present, then the workspaceCount is determined * by the number of names in workspaceList. * *************************************<->***********************************/ void ProcessWorkspaceList (WmScreenData *pSD) { int i, wsNameCount, wsNamesAlloced; WmWorkspaceData *pwsI; unsigned char *lineP = NULL; unsigned char *string; Boolean bHaveWorkspaceList; Boolean bHaveWorkspaceCount; char **ppchWsNames = NULL; /* * Validate initial resource settings */ bHaveWorkspaceCount = (pSD->numWorkspaces >= 1); bHaveWorkspaceList = (pSD->workspaceList != NULL); if (bHaveWorkspaceList) { /* * Parse out array of workspace names */ wsNamesAlloced = WS_ALLOC_AMOUNT; ppchWsNames = (char **) XtMalloc (wsNamesAlloced * sizeof (char *)); if (pSD->workspaceList) { lineP = (unsigned char *) pSD->workspaceList; } else { lineP = (unsigned char *)NULL; } wsNameCount = 0; while (((string = GetString(&lineP)) != NULL)) { ppchWsNames[wsNameCount] = (char *) string; if (++wsNameCount >= wsNamesAlloced) { /* * Need to add more workspaces */ wsNamesAlloced += WS_ALLOC_AMOUNT; if (!(ppchWsNames = (char **) XtRealloc ((char *)ppchWsNames, wsNamesAlloced * sizeof(char *)))) { ExitWM (WM_ERROR_EXIT_VALUE); } } } if (!bHaveWorkspaceCount) { pSD->numWorkspaces = wsNameCount; } } else if (!bHaveWorkspaceCount) { /* * Neither workspaceCount nor workspaceList specified!! * Assume one workspace. */ pSD->numWorkspaces = 1; } if (pSD->numWorkspaces > MAX_WORKSPACE_COUNT) pSD->numWorkspaces = MAX_WORKSPACE_COUNT; /* * Allocate the array of workspace data */ pSD->numWsDataAllocated = (pSD->numWorkspaces + WS_ALLOC_AMOUNT); pSD->numWsDataAllocated -= pSD->numWsDataAllocated % WS_ALLOC_AMOUNT; if (!(pSD->pWS = (WmWorkspaceData *) XtMalloc (pSD->numWsDataAllocated * sizeof(WmWorkspaceData)))) { ExitWM (WM_ERROR_EXIT_VALUE); } pwsI = pSD->pWS; for (i = 0; i < pSD->numWorkspaces; i++, pwsI++) { if (bHaveWorkspaceList && i < wsNameCount) { string = (unsigned char *) ppchWsNames[i]; } else { string = GenerateWorkspaceName (pSD, i); } if (!(pwsI->name = (String) XtMalloc (1+strlen((char *)string)))) { Warning (((char *)GETMESSAGE(62, 27, "Insufficient memory for workspace data"))); ExitWM(WM_ERROR_EXIT_VALUE); } else { strcpy(pwsI->name, (char *)string); } } if (ppchWsNames) XtFree ((char *) ppchWsNames); } /* END OF FUNCTION ProcessWorkspaceList */ #endif /* WSM */ /******************************<->************************************* * * ProcessWorkspaceResources (pWS) * * * Description: * ----------- * This function retrieves resources that are workspace specific. If the * window manager is providing standard behavior then retrieve the limited * set of resources that don't affect standard behavior and set the * values of the other resources to the standard values. * * * Inputs: * ------ * pWS = pointer to workspace data * * * Outputs: * ------- * pWS = resource data for workspace is set * * * Comments: * -------- * o Gets subresources based on workspace name * ******************************<->***********************************/ void ProcessWorkspaceResources (WmWorkspaceData *pWS) { /* * Retrieve workspace specific resources. */ #ifdef WSM pResWS = pWS; /* save current ws for default processing */ #endif /* WSM */ if (wmGD.useStandardBehavior) { XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS, pWS->name, pWS->name, wmStdWorkspaceResources, XtNumber (wmStdWorkspaceResources), NULL, 0); /* * Fill in the standard resource values. * * (no code for this right now) */ #ifdef WSM pWS->iconBoxGeometry = NULL; #endif /* WSM */ } else { XtGetSubresources (pWS->pSD->screenTopLevelW, (XtPointer) pWS, pWS->name, pWS->name, wmWorkspaceResources, XtNumber (wmWorkspaceResources), NULL, 0); #ifdef WSM /* Dup iconbox geometry, it may be free'd later on. */ if (pWS->iconBoxGeometry) { pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry); } #endif /* WSM */ } #ifdef WSM if (pWS->title == NULL) { /* * Setup default workspace title */ pWS->title = XmStringCreateLocalized(pWS->name); } else { /* * Copy resource just in case there's a duplicate * Duplicates point to the same data, freeing on * rename can cause a crash. */ pWS->title = XmStringCopy(pWS->title); } /* * Dup iconbox geometry, it may be free'd later on. */ if (pWS->iconBoxGeometry) { pWS->iconBoxGeometry = XtNewString (pWS->iconBoxGeometry); } /* * Get backdrop resources */ XtGetSubresources (pWS->workspaceTopLevelW, (XtPointer) &(pWS->backdrop), WmNbackdrop, WmCBackdrop, wmBackdropResources, XtNumber (wmBackdropResources), NULL, 0); ProcessBackdropResources (pWS, NULL); #endif /* WSM */ } /* END OF FUNCTION ProcessWorkspaceResources */ #ifdef WSM /******************************<->************************************* * * ProcessPresenceResources (pSD) * * * Description: * ----------- * This function retrieves resources for the workspace presence * dialog. * * Inputs: * ------ * pSD = pointer to screen data * * * Outputs: * ------- * pSD = resource data for workspace presence dialog are set * * * Comments: * -------- * o Gets subresources * ******************************<->***********************************/ void ProcessPresenceResources (WmScreenData *pSD) { #ifndef NO_MESSAGE_CATALOG static char *default_ws_pres_title = NULL; #else static char *default_ws_pres_title = "Workspace Presence"; #endif Arg args[5]; int n; unsigned char *pch1, *pch2; #ifndef NO_MESSAGE_CATALOG /* * Set up localized default title string on initial time through */ if (default_ws_pres_title == NULL) { char * tmpString; /* * catgets returns a pointer to an area that is over written * on each call to catgets. */ tmpString = ((char *)GETMESSAGE(62, 59, "Occupy Workspace")); if ((default_ws_pres_title = (char *)XtMalloc ((unsigned int) (strlen(tmpString) + 1))) == NULL) { Warning (((char *)GETMESSAGE(62, 31, "Insufficient memory for local message string"))); default_ws_pres_title = "Occupy Workspace"; } else { strcpy(default_ws_pres_title, tmpString); } } #endif if (pSD->presence.shellW) { XtGetSubresources (pSD->presence.shellW, (XtPointer) &pSD->presence, WmNworkspacePresence, WmCWorkspacePresence, wmWsPresenceResources, XtNumber (wmWsPresenceResources), NULL, 0); pch2 = NULL; if (pSD->presence.title) { pch1 = (unsigned char *) WmXmStringToString (pSD->presence.title); if (pch1 && (pch2 = (unsigned char *) XtMalloc (1+strlen((char *)pch1)))) { strcpy ((char *)pch2, (char *)pch1); } } if (!pch2) { pch2 = (unsigned char *) default_ws_pres_title; } n = 0; XtSetArg (args[n], XmNtitle, pch2); n++; XtSetValues (pSD->presence.shellW, args, n); } } /* END OF FUNCTION ProcessPresenceResources */ #endif /* WSM */ /*************************************<->************************************* * * ProcessClientResources (pCD) * * * Description: * ----------- * This function retrieves resources that are client specific. If the * window manager is providing standard behavior then retrieve the limited * set of resources that don't affect standard behavior and set the * values of the other resources to the standard values. * * * Inputs: * ------ * pCD = pointer to client data * * * Outputs: * ------- * pCD = resource data for client is set * * * Comments: * -------- * o Gets subresources based on client name and class. * o Creates GC for the client Matte, if there is one. * *************************************<->***********************************/ void ProcessClientResources (ClientData *pCD) { String clientName; String clientClass; WmScreenData *pSD = pCD->pSD; /* * Retrieve basic client specific resources. */ _pCD = pCD; /* save in static global for dynamic default processing */ clientName = (pCD->clientName) ? pCD->clientName : WmNdefaults; clientClass = (pCD->clientClass) ? pCD->clientClass : WmNdefaults; if (wmGD.useStandardBehavior) { XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName, clientClass, wmStdClientResources, XtNumber (wmStdClientResources), NULL, 0); /* * Fill in the standard resource values. */ SetStdClientResourceValues (pCD); } else { XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName, clientClass, wmClientResources, XtNumber (wmClientResources), NULL, 0); } #ifdef NO_MESSAGE_CATALOG /* * If (window menu spec is not found) then use the builtin * system menu. */ if ((pCD->systemMenu == defaultSystemMenuName) && (pSD->defaultSystemMenuUseBuiltin == TRUE)) { pCD->systemMenu = builtinSystemMenuName; } #endif /* * If the client decorations or client functions have been defaulted * fix up the fields in the ProcessMwmHints function. */ /* make top and bottom shadow pixmaps */ if (pCD->iconImageBottomShadowPStr) { if ((pCD->iconImageBottomShadowPStr == pSD->iconAppearance.bottomShadowPStr) && (pCD->iconImageBottomShadowColor == pSD->iconAppearance.bottomShadowColor) && (pCD->iconImageBackground == pSD->iconAppearance.background)) { pCD->iconImageBottomShadowPixmap = pSD->iconAppearance.bottomShadowPixmap; } else { pCD->iconImageBottomShadowPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pCD->iconImageBottomShadowPStr, pCD->iconImageBottomShadowColor, pCD->iconImageBackground); if (pCD->iconImageBottomShadowPixmap == XmUNSPECIFIED_PIXMAP) { pCD->iconImageBottomShadowPixmap = (Pixmap)NULL; } } } else { pCD->iconImageBottomShadowPixmap = (Pixmap)NULL; } if (pCD->iconImageTopShadowPStr) { if ((pCD->iconImageTopShadowPStr == pSD->iconAppearance.topShadowPStr) && (pCD->iconImageTopShadowColor == pSD->iconAppearance.topShadowColor) && (pCD->iconImageBackground == pSD->iconAppearance.background)) { pCD->iconImageTopShadowPixmap = pSD->iconAppearance.topShadowPixmap; } else { pCD->iconImageTopShadowPixmap = XmGetPixmap ( ScreenOfDisplay (DISPLAY, pSD->screen), pCD->iconImageTopShadowPStr, pCD->iconImageTopShadowColor, pCD->iconImageBackground); if (pCD->iconImageTopShadowPixmap == XmUNSPECIFIED_PIXMAP) { pCD->iconImageTopShadowPixmap = (Pixmap)NULL; } } } else { pCD->iconImageTopShadowPixmap = (Pixmap)NULL; } if ((pCD->internalBevel < MIN_INTERNAL_BEVEL) || (pCD->internalBevel > MAX_INTERNAL_BEVEL)) { pCD->internalBevel = MAX_INTERNAL_BEVEL; } /* * Retrieve matte resources and make internal matte resources. */ if (pCD->matteWidth > 0) { XtGetSubresources (pSD->screenTopLevelW, (XtPointer) pCD, clientName, clientClass, wmClientResourcesM, XtNumber (wmClientResourcesM), NULL, 0); /* make top and bottom shadow pixmaps */ #ifdef WSM if (pCD->matteBottomShadowPStr && (!strcmp(pCD->matteBottomShadowPStr, _NoDither))) { pCD->matteBottomShadowPStr = NULL; } #endif /* WSM */ if (pCD->matteBottomShadowPStr) { if ((pCD->matteBottomShadowPStr == pSD->clientAppearance.bottomShadowPStr) && (pCD->matteBottomShadowColor == pSD->clientAppearance.bottomShadowColor) && (pCD->matteBackground == pSD->clientAppearance.background)) { pCD->matteBottomShadowPixmap = pSD->clientAppearance.bottomShadowPixmap; } else { pCD->matteBottomShadowPixmap = XmGetPixmap (ScreenOfDisplay (DISPLAY, pSD->screen), pCD->matteBottomShadowPStr, pCD->matteBottomShadowColor, pCD->matteBackground); if (pCD->matteBottomShadowPixmap == XmUNSPECIFIED_PIXMAP) { pCD->matteBottomShadowPixmap = (Pixmap)NULL; } } } else { pCD->matteBottomShadowPixmap = (Pixmap)NULL; } #ifdef WSM if (pCD->matteTopShadowPStr && (!strcmp(pCD->matteTopShadowPStr, _NoDither))) { pCD->matteTopShadowPStr = NULL; } #endif /* WSM */ if (pCD->matteTopShadowPStr) { if ((pCD->matteTopShadowPStr == pSD->clientAppearance.topShadowPStr) && (pCD->matteTopShadowColor == pSD->clientAppearance.topShadowColor) && (pCD->matteBackground == pSD->clientAppearance.background)) { pCD->matteTopShadowPixmap = pSD->clientAppearance.topShadowPixmap; } else { pCD->matteTopShadowPixmap = XmGetPixmap (ScreenOfDisplay (DISPLAY, pSD->screen), pCD->matteTopShadowPStr, pCD->matteTopShadowColor, pCD->matteBackground); if (pCD->matteTopShadowPixmap == XmUNSPECIFIED_PIXMAP) { pCD->matteTopShadowPixmap = (Pixmap)NULL; } } } else { pCD->matteTopShadowPixmap = (Pixmap)NULL; } /* make top and bottom shadow GC's */ pCD->clientMatteTopShadowGC = GetHighlightGC (pCD->pSD, pCD->matteTopShadowColor, pCD->matteBackground, pCD->matteTopShadowPixmap); pCD->clientMatteBottomShadowGC = GetHighlightGC (pCD->pSD, pCD->matteBottomShadowColor, pCD->matteBackground, pCD->matteBottomShadowPixmap); } } /* END OF FUNCTION ProcessClientResources */ /*************************************<->************************************* * * SetStdClientResourceValues (pCD) * * * Description: * ----------- * This function sets client resource data to standard values. This setting * is done in place of getting the values from the user settings in * the resource database. * * Input: * ----- * pCD = pointer to the client data * * * Output: * ------ * pCD = (client data filled out with resource values) * *************************************<->***********************************/ void SetStdClientResourceValues (ClientData *pCD) { pCD->clientDecoration = WM_DECOR_DEFAULT; pCD->clientFunctions = WM_FUNC_DEFAULT; pCD->focusAutoRaise = True; pCD->systemMenu = builtinSystemMenuName; pCD->usePPosition = USE_PPOSITION_NONZERO; pCD->ignoreWMSaveHints = True; } /* END OF FUNCTION SetStdClientResourceValues */ /******************************<->************************************* * * SetStdScreenResourceValues (pSD) * * * Description: * ----------- * This function sets screen resource data to standard values. This setting * is done in place of getting the values from the user settings in * the resource database. * * Input: * ----- * pSD = pointer to the screen data * * * Output: * ------ * pSD = (screen data filled out with resource values) * ******************************<->***********************************/ void SetStdScreenResourceValues (WmScreenData *pSD) { #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) pSD->rootMenu = builtinRootMenuName; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ pSD->buttonBindings = builtinButtonBindingsName; pSD->cleanText = True; pSD->iconDecoration = (ICON_LABEL_PART | ICON_IMAGE_PART | ICON_ACTIVE_LABEL_PART); pSD->iconPlacement = (ICON_PLACE_LEFT_PRIMARY | ICON_PLACE_BOTTOM_SECONDARY); pSD->keyBindings = builtinKeyBindingsName; pSD->limitResize = True; pSD->resizeCursors = True; pSD->transientDecoration = (WM_DECOR_SYSTEM | WM_DECOR_RESIZEH); pSD->transientFunctions = (WM_FUNC_ALL & ~(MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE | MWM_FUNC_RESIZE)); pSD->useIconBox = False; pSD->feedbackGeometry = NULL; pSD->moveOpaque = False; } /* END OF FUNCTION SetStdScreenResourceValues */ /*************************************<->************************************* * * GetHighlightGC (pSD, fg, bg, pixmap) * * * Description: * ----------- * Get a graphic context for either drawing top- or bottom-shadow * highlights. * * * Inputs: * ------ * pSD = pointer to screen data * fg = foreground color * bg = background color * pixmap = pixmap for highlight * * Outputs: * ------- * RETRUN = GC with the input parameters incorporated. * *************************************<->***********************************/ GC GetHighlightGC (WmScreenData *pSD, Pixel fg, Pixel bg, Pixmap pixmap) { XGCValues gcv; XtGCMask mask; mask = GCForeground | GCBackground | GCLineWidth | GCFillStyle; gcv.background = bg; gcv.foreground = fg; gcv.line_width = 1; if (pixmap) { mask |= GCFillStyle | GCTile; gcv.fill_style = FillTiled; gcv.tile = pixmap; } else { gcv.fill_style = FillSolid; } #ifdef OLD_CODE /* * NOTE: If additional mask bits are added, modify WmGetGC() * in WmGraphics.c to check those values for matches. */ return (WmGetGC (pSD, mask, &gcv)); #endif /* OLD_CODE */ return (XtGetGC (pSD->screenTopLevelW, mask, &gcv)); } /* END OF FUNCTION GetHighlightGC */ /*************************************<->************************************* * * _WmGetDynamicDefault (widget, type, defaultColor, newBackground, value) * * * Description: * ----------- * This function is used to generate a default color of the requested * type. Default colors are generated for a 3-D appearance. * * * Inputs: * ------ * widget = this is the widget that is associated with the resource or * that is the reference widget for the wm subpart. * * type = this is the type of color resource (e.g., top shadow color). * * defaultColor = pointer to default color name/specification. * * newBackground = background pixel for generating 3-D colors. * * * Outputs: * ------- * value = pointer to the XrmValue in which to store the color * *************************************<->***********************************/ void _WmGetDynamicDefault (Widget widget, unsigned char type, String defaultColor, Pixel newBackground, XrmValue *value) { static Screen *oldScreen = NULL; static Screen *newScreen; static Colormap oldColormap; static Colormap newColormap; static Pixel newValue; static Pixel background; static String oldDefaultColor = DEFAULT_COLOR_NONE; static XmColorData colorData; /* initialize the return value */ value->size = sizeof (newValue); value->addr = (char *)&newValue; /* * Process monochrome defaults first. */ newScreen = XtScreen (widget); if (Monochrome (newScreen)) { #ifdef WSM Boolean ok = False; /* * Check color server sets for this screen. */ if (wmGD.statusColorServer == CSERVE_NORMAL) { WmScreenData *pSD; int i; for (i = 0; i < wmGD.numScreens; i++) { if (XScreenNumberOfScreen(newScreen) == wmGD.Screens[i].screen) { pSD = &wmGD.Screens[i]; ok = True; break; } } if (ok) { ok = False; for (i = 0; i < XmCO_MAX_NUM_COLORS; i++) { if (pSD->pPixelData[i].bg == newBackground) { switch (type) { case WmFGC: newValue = pSD->pPixelData[i].fg; break; case WmBGC: newValue = pSD->pPixelData[i].bg; break; case WmTSC: newValue = pSD->pPixelData[i].ts; break; case WmBSC: newValue = pSD->pPixelData[i].bs; break; } ok = True; } } } } if (!ok) { #endif /* WSM */ switch (type) { case WmFGC: newValue = BlackPixelOfScreen (newScreen); break; case WmBGC: newValue = WhitePixelOfScreen (newScreen); break; case WmTSC: newValue = WhitePixelOfScreen (newScreen); break; case WmBSC: newValue = BlackPixelOfScreen (newScreen); break; } #ifdef WSM } #endif /* WSM */ return; } /* * Check to see if appropriate colors are available from the * previous request; if the color is a background color then get * default colors. Generate 3-D colors if necessary. Maintain * new colors in static variables for later reuse. */ newColormap = widget->core.colormap; if ((oldScreen != NULL) && (oldScreen == newScreen) && (oldColormap == newColormap) && (type != WmBGC) && (background == newBackground)) { } else if ((oldScreen == newScreen) && (oldColormap == newColormap) && (type == WmBGC) && (oldDefaultColor == defaultColor)) { } else if (type == WmBGC) { /* * Find or generate a background color and associated 3-D colors. */ oldDefaultColor = defaultColor; /* * Fix for CR 5152 - Due to the use of Realloc in the color caches, * a static pointer is not acceptable. Change it * to a static structure to maintain the data */ colorData = *_WmGetDefaultColors (newScreen, newColormap, defaultColor); } else { /* * Find or generate a color based on the associated background color. */ oldDefaultColor = DEFAULT_COLOR_NONE; background = newBackground; XmGetColors(newScreen, newColormap, background, &colorData.foreground.pixel, &colorData.top_shadow.pixel, &colorData.bottom_shadow.pixel, &colorData.select.pixel); } oldScreen = newScreen; oldColormap = newColormap; /* * Set up the return value. */ colorData.allocated |= type; switch (type) { case XmBACKGROUND: newValue = colorData.background.pixel; break; case XmFOREGROUND: newValue = colorData.foreground.pixel; break; case XmTOP_SHADOW: newValue = colorData.top_shadow.pixel; break; case XmBOTTOM_SHADOW: newValue = colorData.bottom_shadow.pixel; break; case XmSELECT: newValue = colorData.select.pixel; break; default: newValue = colorData.background.pixel; break; } } /* END OF FUNCTION _WmGetDynamicDefault */ /*************************************<->************************************* * * _WmGetDefaultColors (screen, colormap, defaultColor) * * * Description: * ----------- * This function is used to find or generate default 3-D colors based on a * default background color. * * * Inputs: * ------ * screen = screen for which colors are to be generated. * * colormap = colormap that is to be used to make colors. * * defaultColor = pointer to a default color name/specification. * * * Outputs: * ------- * RETURN = pointer to WmColorData structure containing 3-D colors. * *************************************<->***********************************/ XmColorData * _WmGetDefaultColors (screen, colormap, defaultColor) Screen *screen; Colormap colormap; String defaultColor; { static XmColorData *defaultSet[2] = {NULL, NULL}; static int defaultCount[2] = {0, 0}; static int defaultSize[2] = {0, 0}; int setId; register XmColorData *set; register int count; register int size; register int i; Display *display = DisplayOfScreen (screen); XColor colorDef; /* * Fix for CR 5152 - Due to the use of Realloc with _XmGetColors, it is * necessary to maintain a separate cache of color * data. The Realloc may cause the data to be moved, * and the cache would contain pointers into the heap. */ /* * Look through the cache to see if the defaults are already in the * cache. There is a list of cached defaults for each default color. */ if (defaultColor == _defaultColor2) { setId = 1; } else { setId = 0; } set = defaultSet[setId]; count = defaultCount[setId]; size = defaultSize[setId]; for (i = 0; i < count; i++) { if (((set + i)->screen == screen) && ((set + i)->color_map == colormap)) { return (set + i); } } /* * No match in the cache, make a new entry and generate the colors. */ if (count == size) { size = (defaultSize[setId] += 10); set = defaultSet[setId] = (XmColorData *)WmRealloc ((char *) defaultSet[setId], sizeof (XmColorData) * size); } /* * Make the default background color for the resource set. */ if(!XParseColor (display, colormap, defaultColor, &colorDef)) { if(!(strcmp(defaultColor, _defaultColor1))) { XParseColor (display, colormap, _defaultColor1HEX, &colorDef); } else { XParseColor (display, colormap, _defaultColor2HEX, &colorDef); } } XAllocColor (display, colormap, &colorDef); /* * Generate the 3-D colors and save them in the defaults cache. */ XmGetColors(screen, colormap, colorDef.pixel, &set[count].foreground.pixel, &set[count].top_shadow.pixel, &set[count].bottom_shadow.pixel, &set[count].select.pixel); set[count].background.pixel = colorDef.pixel; set[count].screen = screen; set[count].color_map = colormap; set[count].allocated = True; XQueryColor(DISPLAY, colormap, &(set[count].background)); XQueryColor(DISPLAY, colormap, &(set[count].foreground)); XQueryColor(DISPLAY, colormap, &(set[count].top_shadow)); XQueryColor(DISPLAY, colormap, &(set[count].bottom_shadow)); XQueryColor(DISPLAY, colormap, &(set[count].select)); (defaultCount[setId])++; return (set + count); } /* END OF FUNCTION _WmGetDefaultColors */ /*************************************<->************************************* * * WmRealloc (ptr, size) * * * Description: * ----------- * This function is used reallocate a block of storage that has been * malloc'ed. * * * Inputs: * ------ * ptr = pointer to storage that is to be realloc'ed; if NULL malloc an * initial block of storage. * * size = size of new storage * * Outputs: * ------- * RETURN = pointer to realloc'ed block of storage * *************************************<->***********************************/ char * WmRealloc (ptr, size) char *ptr; unsigned size; { if (ptr) { ptr = (char *)XtRealloc (ptr, size); } else { ptr = (char *)XtMalloc (size); } if (ptr == NULL) { Warning (((char *)GETMESSAGE(62, 37, "Insufficient memory for window manager data"))); } return (ptr); } /* END OF FUNCTION WmRealloc */ /*************************************<->************************************* * * WmMalloc (ptr, size) * * * Description: * ----------- * This function is used malloc a block of storage. If a previous block * of storage is being replace the old block is free'd. * * * Inputs: * ------ * ptr = pointer to storage that is to be replaced (free'd). * * size = size of new storage * * Outputs: * ------- * RETURN = pointer to malloc'ed block of storage * *************************************<->***********************************/ char * WmMalloc (ptr, size) char *ptr; unsigned size; { if (ptr) { XtFree (ptr); } ptr = (char *)XtMalloc (size); if (ptr == NULL) { Warning (((char *)GETMESSAGE(62, 38, "Insufficient memory for window manager data"))); } return (ptr); } /* END OF FUNCTION WmMalloc */ /*************************************<->************************************* * * SetupDefaultResources (pSD) * * * Description: * ----------- * This function is used to setup default (builtin) resources for the * key bindings. * * * Inputs: * ------ * pSD = pointer to screen data * wmGD = (defaultKeyBindingsString, ...) * * builtinKeyBindingsName = name of default key bindings set * * * Outputs: * ------- * None * *************************************<->***********************************/ void SetupDefaultResources (pSD) WmScreenData *pSD; { KeySpec *nextKeySpec; String keyBindings; MenuSpec *menuSpec; /* * If (using DefaultBindings mechanism and bindings are not found in .mwmrc) * then use the builtin bindings. */ if (!pSD->keySpecs && !wmGD.useStandardBehavior) { /* * Print warning if user is NOT using "DefaultKeyBindings". */ if (strcmp (pSD->keyBindings, defaultKeyBindingsName)) { MWarning (((char *)GETMESSAGE(62, 67, "Key bindings %s not found, using builtin key bindings\n")), pSD->keyBindings); } pSD->keyBindings = builtinKeyBindingsName; } if (!pSD->buttonSpecs && !wmGD.useStandardBehavior) { /* * Print warning if user is NOT using "DefaultButtonBindings". */ if (strcmp (pSD->buttonBindings, defaultButtonBindingsName)) { MWarning (((char *)GETMESSAGE(62, 68, "Button bindings %s not found, using builtin button bindings\n")), pSD->buttonBindings); } pSD->buttonBindings = builtinButtonBindingsName; } if (pSD->keyBindings == builtinKeyBindingsName) { /* * Default key specifications are to be used and no default * set has been provided by the user. Make the built-in default * set. */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* * Before parsing the string, substitute the real name for * the default rootmenu using the resource rootMenu * for the %s in the string. */ char *buffer; buffer = (char *) XtMalloc(strlen(builtinKeyBindings) + strlen(pSD->rootMenu) + 1); sprintf(buffer, builtinKeyBindings, pSD->rootMenu); ParseKeyStr (pSD, (unsigned char *)buffer); #else ParseKeyStr (pSD, (unsigned char *)builtinKeyBindings); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ } else { /* * Add the switch behavior key binding to the front of the list * of user specified key bindings that have been parsed. */ nextKeySpec = pSD->keySpecs; keyBindings = pSD->keyBindings; pSD->keyBindings = behaviorKeyBindingName; pSD->keySpecs = NULL; ParseKeyStr (pSD, (unsigned char *)behaviorKeyBindings); if (pSD->keySpecs) { /* Skip past the TWO key definitions (1.2 & 1.1.4) */ pSD->keySpecs->nextKeySpec->nextKeySpec = nextKeySpec; } else { pSD->keySpecs = nextKeySpec; } pSD->keyBindings = keyBindings; } if (pSD->buttonBindings == builtinButtonBindingsName) { /* * Default button specifications are to be used and no default * set has been provided by the user. Make the built-in default * set. */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* * Before parsing the string, substitute the real name for * the default rootmenu using the resource rootMenu * for the %s in the string. */ char *buffer; buffer = (char *) XtMalloc(strlen(builtinButtonBindings) + strlen(pSD->rootMenu) + 1); sprintf(buffer, builtinButtonBindings, pSD->rootMenu); ParseButtonStr (pSD, (unsigned char *)buffer); #else ParseButtonStr (pSD, (unsigned char *)builtinButtonBindings); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ } #ifdef NO_MESSAGE_CATALOG /* * Set defaultSystemMenuUseBuiltin to FALSE if DefaultWindowMenu spec * is found. */ menuSpec = pSD->menuSpecs; while ( menuSpec ) { if (!strcmp(menuSpec->name, defaultSystemMenuName)) { pSD->defaultSystemMenuUseBuiltin = FALSE; break; } menuSpec = menuSpec->nextMenuSpec; } #endif } /* END OF FUNCTION SetupDefaultResources */ /*************************************<->************************************* * * SimilarAppearanceData (pAD1, pAD2) * * * Description: * ----------- * This function returns True if the two passed sets of AppearanceData * are similar. This is designed to compare appearance data before * creation of the GCs. * * * Inputs: * ------ * pAD1 pointer to AppearanceData 1 * pAD2 pointer to AppearanceData 2 * * * Outputs: * ------- * Function returns True if similar, False otherwise. * * Comments: * --------- * This function is only used to compare the client * and client*title appearance data. *************************************<->***********************************/ Boolean SimilarAppearanceData (AppearanceData *pAD1, AppearanceData *pAD2) { Boolean rval; #ifdef notdef if ((pAD1->fontList == pAD2->fontList) && (pAD1->background == pAD2->background) && (pAD1->foreground == pAD2->foreground) && (pAD1->backgroundPStr == pAD2->backgroundPStr) && (pAD1->backgroundPixmap == pAD2->backgroundPixmap) && (pAD1->bottomShadowColor == pAD2->bottomShadowColor) && (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) && (pAD1->bottomShadowPixmap == pAD2->bottomShadowPixmap) && (pAD1->topShadowColor == pAD2->topShadowColor) && (pAD1->topShadowPStr == pAD2->topShadowPStr) && (pAD1->topShadowPixmap == pAD2->topShadowPixmap) && (pAD1->activeBackground == pAD2->activeBackground) && (pAD1->activeForeground == pAD2->activeForeground) && (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) && (pAD1->activeBackgroundPixmap == pAD2->activeBackgroundPixmap) && (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) && (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) && (pAD1->activeBottomShadowPixmap == pAD2->activeBottomShadowPixmap) && (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) && (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) && (pAD1->activeTopShadowPixmap == pAD2->activeTopShadowPixmap) ) #else /* * !!! Should find out why all the Pixmap resources are unset !!! */ if ((pAD1->fontList == pAD2->fontList) && (pAD1->background == pAD2->background) && (pAD1->foreground == pAD2->foreground) && (pAD1->backgroundPStr == pAD2->backgroundPStr) && (pAD1->bottomShadowColor == pAD2->bottomShadowColor) && (pAD1->bottomShadowPStr == pAD2->bottomShadowPStr) && (pAD1->topShadowColor == pAD2->topShadowColor) && (pAD1->topShadowPStr == pAD2->topShadowPStr) && (pAD1->activeBackground == pAD2->activeBackground) && (pAD1->activeForeground == pAD2->activeForeground) && (pAD1->activeBackgroundPStr == pAD2->activeBackgroundPStr) && (pAD1->activeBottomShadowColor == pAD2->activeBottomShadowColor) && (pAD1->activeBottomShadowPStr == pAD2->activeBottomShadowPStr) && (pAD1->activeTopShadowColor == pAD2->activeTopShadowColor) && (pAD1->activeTopShadowPStr == pAD2->activeTopShadowPStr) ) #endif { rval = True; } else { rval = False; } return (rval); } /* END OF FUNCTION SimilarAppearanceData */ #ifdef WSM /*************************************<->************************************* * * Monochrome (screen) * * * Description: * ----------- * This function returns True if the screen passed it to be treated * as monochrome for the purpose of assigning default resources. * * * Inputs: * ------ * screen pointer to Screen * * * Outputs: * ------- * Function returns True if monochrome (or Static Gray), False otherwise. * *************************************<->***********************************/ Boolean Monochrome (Screen *screen) { WmScreenData *pSD; int scr; if (wmGD.statusColorServer == CSERVE_NORMAL) { for (scr = 0; scr < wmGD.numScreens; scr++) { pSD = &(wmGD.Screens[scr]); if (pSD->managed) { if (XScreenOfDisplay (DISPLAY, pSD->screen) == screen) { if (pSD->colorUse == XmCO_BLACK_WHITE) { return(True); } else { return(False); } } } } } /* * If we don't know the answer to our question by now, * fall back to the old mwm way of determining monochromicity. * */ return ((DefaultDepthOfScreen(screen) == 1)); } /* END OF FUNCTION Monochrome */ #endif /* WSM */ #ifdef WSM /**************************** eof ***************************/ #endif /* WSM */ motif-2.3.8/clients/mwm/WmResParse.c0000644000175000017500000060052613145162623014234 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmResParse.c /main/9 1996/11/01 10:17:34 drk $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmResNames.h" #ifdef WSM #include
#include
#include #endif /* WSM */ #ifdef PANELIST #include "WmParse.h" #include "WmParseP.h" #include "WmPanelP.h" #endif /* PANELIST */ #include "WmResource.h" #include "WmWinConf.h" #include #include "Xm/VirtKeysI.h" #include #include #include #include #include #ifndef NO_MULTIBYTE #include #endif #ifdef MOTIF_ONE_DOT_ONE #include #include #else #include /* for XmeGetHomeDirName */ #endif #ifdef WSM #include #endif /* WSM */ #define FIX_1127 /* maximum string lengths */ #define MAX_KEYSYM_STRLEN 100 #define MAX_EVENTTYPE_STRLEN 20 #define MAX_MODIFIER_STRLEN 20 #define MAX_CONTEXT_STRLEN 20 #define MAX_GROUP_STRLEN 20 #ifdef min #undef min #endif #define min(a,b) ((a)>(b) ? (b) : (a)) #define MAXLINE (MAXWMPATH+1) #define MBBSIZ 4096 #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define PARSE_MENU_ITEMS(pSD, mSpec) ParseMenuItems(pSD, mSpec) #else # define PARSE_MENU_ITEMS(pSD, mSpec) ParseMenuItems(pSD) #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* * include extern functions */ #include "WmResParse.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ #include "WmError.h" #include "WmFunction.h" #include "WmImage.h" #include "WmXSMP.h" #ifdef MOTIF_ONE_DOT_ONE extern char *getenv (); #endif #ifdef PANELIST # include # ifdef X_NOT_STDC_ENV extern int errno; # endif # define HOME_DT_WMRC "/.dt/dtwmrc" # define LANG_DT_WMRC "/dtwmrc" # define SYS_DT_WMRC CDE_CONFIGURATION_TOP "/sys.dtwmrc" #endif /* PANELIST */ /* * Global Variables And Tables: */ static char cfileName[MAXWMPATH+1]; #ifdef WSM #ifndef NO_MESSAGE_CATALOG char * pWarningStringFile; char * pWarningStringLine; #else char pWarningStringFile[] = "%s: %s on line %d of configuration file %s\n"; char pWarningStringLine[] = "%s: %s on line %d of specification string\n"; #endif #define cfileP (wmGD.pWmPB->pFile) #define parseP (wmGD.pWmPB->pchNext) #define line (wmGD.pWmPB->pchLine) #define linec (wmGD.pWmPB->lineNumber) #else /* WSM */ static FILE *cfileP = NULL; /* fopen'ed configuration file or NULL */ static unsigned char line[MAXLINE+1]; /* line buffer */ static int linec = 0; /* line counter for parser */ static unsigned char *parseP = NULL; /* pointer to parse string */ #endif /* WSM */ typedef struct { char *name; unsigned int mask; } MaskTableEntry; static MaskTableEntry modifierStrings[] = { {"none", None}, {"ctrl", ControlMask}, {"shift", ShiftMask}, {"alt", Mod1Mask}, {"meta", Mod1Mask}, {"lock", LockMask}, {"mod1", Mod1Mask}, {"mod2", Mod2Mask}, {"mod3", Mod3Mask}, {"mod4", Mod4Mask}, {"mod5", Mod5Mask}, {NULL, (unsigned int)NULL}, }; #define ALT_INDEX 3 #define META_INDEX 4 typedef struct { char *event; unsigned int eventType; Boolean (*parseProc)(); unsigned int closure; Boolean fClick; } EventTableEntry; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define CCI_USE_DEFAULT_NAME_TAG "DEFAULT_NAME" String CCIEntryModifierNames[] = { "none", "inline", "cascade", "delimit", "delimit_inline", "delimit_cascade", "exclude" }; typedef enum { NONE, /* internal only. */ INLINE, /* not supported. */ CASCADE, DELIMIT, DELIMIT_INLINE, /* not supported. */ DELIMIT_CASCADE, EXCLUDE } CCIEntryModifier; typedef struct _CCIFuncArg { CCIEntryModifier mod; String cciEntry; } CCIFuncArg; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #ifdef MOTIF_ONE_DOT_ONE void GetHomeDirName(String fileName); #endif #ifdef WSM static String GetNetworkFileName (char *pchFile); #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) static MenuItem *MakeSeparatorTemplate (int); static void ParseMenuItemName (unsigned char **linePP, MenuItem *menuItem); static Boolean ParseClientCommand (unsigned char **linePP, MenuSpec *menuSpec, MenuItem *menuItem, unsigned char *string, Boolean *use_separators); static void FixMenuItem (MenuSpec *menuSpec, MenuItem *menuItem); static Boolean GetCCIModifier (String modString, CCIEntryModifier *mod); static Boolean ParseWmFuncCCIArgs (unsigned char **linePP, WmFunction wmFunction, String *pArgs); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ FILE *FopenConfigFile (void); void SaveMenuAccelerators (WmScreenData *pSD, MenuSpec *newMenuSpec); static void ParseMenuSet (WmScreenData *pSD, unsigned char *lineP); MenuItem *ParseMwmMenuStr (WmScreenData *pSD, unsigned char *menuStr); static MenuItem *ParseMenuItems (WmScreenData *pSD #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) , MenuSpec *menuSpec #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ ); static Boolean ParseWmLabel (WmScreenData *pSD, MenuItem *menuItem, unsigned char *string); static void ParseWmMnemonic (unsigned char **linePP, MenuItem *menuItem); static Boolean ParseWmAccelerator (unsigned char **linePP, MenuItem *menuItem); int ParseWmFunction (unsigned char **linePP, unsigned int res_spec, WmFunction *pWmFunction); #ifndef PANELIST static Boolean ParseWmFuncMaybeStrArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs); #endif /* PANELIST */ static Boolean ParseWmFuncNoArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs); #ifndef PANELIST static Boolean ParseWmFuncStrArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs); #endif /* PANELIST */ void FreeMenuItem (MenuItem *menuItem); static Boolean ParseWmFuncGrpArg (unsigned char **linePP, WmFunction wmFunction, GroupArg *pGroup); static Boolean ParseWmFuncNbrArg (unsigned char **linePP, WmFunction wmFunction, unsigned long *pNumber); void ParseButtonStr (WmScreenData *pSD, unsigned char *buttonStr); static void ParseButtonSet (WmScreenData *pSD, unsigned char *lineP); static Boolean ParseContext (unsigned char **linePP, Context *context, Context *subContext); void ParseKeyStr (WmScreenData *pSD, unsigned char *keyStr); static void ParseKeySet (WmScreenData *pSD, unsigned char *lineP); Boolean ParseBtnEvent (unsigned char **linePP, unsigned int *eventType, unsigned int *button, unsigned int *state, Boolean *fClick); Boolean ParseKeyEvent (unsigned char **linePP, unsigned int *eventType, KeyCode *keyCode, unsigned int *state); static Boolean ParseEvent (unsigned char **linePP, EventTableEntry *table, unsigned int *eventType, unsigned int *detail, unsigned int *state, Boolean *fClick); static Boolean ParseModifiers(unsigned char **linePP, unsigned int *state); static Boolean LookupModifier (unsigned char *name, unsigned int *valueP); static Boolean ParseEventType (unsigned char **linePP, EventTableEntry *table, unsigned int *eventType, Cardinal *ix); static Boolean ParseImmed (unsigned char **linePP, unsigned int closure, unsigned int *detail); static Boolean ParseKeySym (unsigned char **linePP, unsigned int closure, unsigned int *detail); static unsigned int StrToNum(unsigned char *str); static unsigned int StrToHex(unsigned char *str); static unsigned int StrToOct(unsigned char *str); void ScanAlphanumeric (unsigned char **linePP); void ScanWhitespace(unsigned char **linePP); void ToLower (unsigned char *string); void PWarning (char *message); static void ProcessAccelText (unsigned char *startP, unsigned char *endP, unsigned char *destP); void ProcessCommandLine (int argc, char *argv[]); static void ParseScreensArgument (int argc, char *argv[], int *pArgnum, unsigned char *lineP); void ProcessMotifBindings (void); #ifdef PANELIST static void ParseIncludeSet (WmScreenData *pSD, unsigned char *lineP); static void ConfigStackInit (char *pchFileName); static FILE *ConfigStackPush (unsigned char *pchFileName); static void ConfigStackPop (void); Boolean ParseWmFuncActionArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs); static void PreprocessConfigFile (void); #endif /* PANELIST */ static EventTableEntry buttonEvents[] = { {"btn1down", ButtonPress, ParseImmed, SELECT_BUTTON, FALSE}, {"btn1up", ButtonRelease, ParseImmed, SELECT_BUTTON, FALSE}, {"btn1click", ButtonRelease, ParseImmed, SELECT_BUTTON, TRUE}, {"btn1click2", ButtonPress, ParseImmed, SELECT_BUTTON, TRUE}, {"btn2down", ButtonPress, ParseImmed, DMANIP_BUTTON, FALSE}, {"btn2up", ButtonRelease, ParseImmed, DMANIP_BUTTON, FALSE}, {"btn2click", ButtonRelease, ParseImmed, DMANIP_BUTTON, TRUE}, {"btn2click2", ButtonPress, ParseImmed, DMANIP_BUTTON, TRUE}, {"btn3down", ButtonPress, ParseImmed, BMENU_BUTTON, FALSE}, {"btn3up", ButtonRelease, ParseImmed, BMENU_BUTTON, FALSE}, {"btn3click", ButtonRelease, ParseImmed, BMENU_BUTTON, TRUE}, {"btn3click2", ButtonPress, ParseImmed, BMENU_BUTTON, TRUE}, {"btn4down", ButtonPress, ParseImmed, Button4, FALSE}, {"btn4up", ButtonRelease, ParseImmed, Button4, FALSE}, {"btn4click", ButtonRelease, ParseImmed, Button4, TRUE}, {"btn4click2", ButtonPress, ParseImmed, Button4, TRUE}, {"btn5down", ButtonPress, ParseImmed, Button5, FALSE}, {"btn5up", ButtonRelease, ParseImmed, Button5, FALSE}, {"btn5click", ButtonRelease, ParseImmed, Button5, TRUE}, {"btn5click2", ButtonPress, ParseImmed, Button5, TRUE}, { NULL, (unsigned int)NULL, (Boolean(*)())NULL, (unsigned int)NULL, (Boolean)(unsigned)NULL} }; static EventTableEntry keyEvents[] = { {"key", KeyPress, ParseKeySym, 0, FALSE}, { NULL, (unsigned int)NULL, (Boolean(*)())NULL, (unsigned int)NULL, (Boolean)(unsigned)NULL} }; #ifdef PANELIST typedef struct _ConfigFileStackEntry { char *fileName; char *tempName; char *cppName; char *wmgdConfigFile; long offset; DtWmpParseBuf *pWmPB; struct _ConfigFileStackEntry *pIncluder; } ConfigFileStackEntry; static ConfigFileStackEntry *pConfigStack = NULL; static ConfigFileStackEntry *pConfigStackTop = NULL; #endif /* PANELIST */ unsigned int buttonModifierMasks[] = { 0, SELECT_BUTTON_MASK, DMANIP_BUTTON_MASK, BMENU_BUTTON_MASK, Button4Mask, Button5Mask }; /* * FUNCTION PARSER TABLE (function names must be in alphabetic order) */ typedef struct { char * funcName; Context greyedContext; unsigned int resource; long mgtMask; WmFunction wmFunction; Boolean (*parseProc)(); } FunctionTableEntry; /* * NOTE: New functions MUST be added in ALPHABETICAL order. A binary search * is used to find the correct function name. */ FunctionTableEntry functionTable[] = { #ifdef WSM #ifdef PANELIST {"f.action", 0, CRS_ANY, 0, F_Action, ParseWmFuncActionArg}, #else /* PANELIST */ {"f.action", 0, CRS_ANY, 0, F_Action, ParseWmFuncStrArg}, #endif /* PANELIST */ #endif /* WSM */ {"f.beep", 0, CRS_ANY, 0, F_Beep, ParseWmFuncNoArg}, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) {"f.cci", 0, CRS_ANY, 0, F_Nop, ParseWmFuncCCIArgs}, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ {"f.circle_down", F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Circle_Down, ParseWmFuncGrpArg}, {"f.circle_up", F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Circle_Up, ParseWmFuncGrpArg}, #ifdef WSM {"f.create_workspace", 0, CRS_ANY, 0, F_CreateWorkspace, ParseWmFuncNoArg}, {"f.delete_workspace", 0, CRS_ANY, 0, F_DeleteWorkspace, ParseWmFuncNoArg}, #endif /* WSM */ {"f.exec", 0, CRS_ANY, 0, F_Exec, ParseWmFuncStrArg}, {"f.focus_color", F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Focus_Color, ParseWmFuncNoArg}, {"f.focus_key", F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Focus_Key, ParseWmFuncNoArg}, #ifdef WSM {"f.goto_workspace", 0, CRS_ANY, 0, F_Goto_Workspace, ParseWmFuncStrArg}, #endif /* WSM */ #ifdef WSM {"f.help", 0, CRS_ANY, 0, F_Help, ParseWmFuncStrArg}, /* [helpvolume && helptopic] */ {"f.help_mode", 0, CRS_ANY, 0, F_Help_Mode, ParseWmFuncNoArg}, /* for now */ #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) {"f.invoke_command", 0, CRS_ANY, 0, F_InvokeCommand, ParseWmFuncStrArg}, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ {"f.kill", F_CONTEXT_ROOT, CRS_ANY, MWM_FUNC_CLOSE, F_Kill, ParseWmFuncNoArg}, {"f.lower", F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Lower, ParseWmFuncMaybeStrArg}, #ifdef WSM {"f.marquee_selection", F_CONTEXT_WINDOW|F_CONTEXT_ICON|F_SUBCONTEXT_IB_IICON, CRS_ANY, 0, F_Marquee_Selection, ParseWmFuncNoArg}, #endif /* WSM */ {"f.maximize", F_CONTEXT_ROOT|F_CONTEXT_MAXIMIZE| F_SUBCONTEXT_IB_WICON, CRS_ANY, MWM_FUNC_MAXIMIZE, F_Maximize, ParseWmFuncNoArg}, {"f.menu", 0, CRS_ANY, 0, F_Menu, ParseWmFuncStrArg}, {"f.minimize", F_CONTEXT_ICON|F_CONTEXT_ROOT|F_SUBCONTEXT_IB_IICON, CRS_ANY, MWM_FUNC_MINIMIZE, F_Minimize, ParseWmFuncNoArg}, {"f.move", F_CONTEXT_ROOT, CRS_ANY, MWM_FUNC_MOVE, F_Move, ParseWmFuncNoArg}, {"f.next_cmap", 0, CRS_ANY, 0, F_Next_Cmap, ParseWmFuncNoArg}, {"f.next_key", 0, CRS_ANY, 0, F_Next_Key, ParseWmFuncGrpArg}, #ifdef WSM {"f.next_workspace", 0, CRS_ANY, 0, F_Next_Workspace, ParseWmFuncNoArg}, #endif /* WSM */ {"f.nop", F_CONTEXT_ROOT|F_CONTEXT_ICON|F_CONTEXT_WINDOW| F_SUBCONTEXT_IB_WICON | F_SUBCONTEXT_IB_IICON, CRS_ANY, 0, F_Nop, ParseWmFuncNoArg}, {"f.normalize", F_CONTEXT_ROOT|F_CONTEXT_NORMAL|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Normalize, ParseWmFuncNoArg}, #ifdef PANELIST {"f.normalize_and_raise", F_CONTEXT_ROOT|F_CONTEXT_NORMAL, CRS_ANY, 0, F_Normalize_And_Raise, ParseWmFuncMaybeStrArg}, #else /* PANELIST */ {"f.normalize_and_raise", F_CONTEXT_ROOT|F_CONTEXT_NORMAL, CRS_ANY, 0, F_Normalize_And_Raise, ParseWmFuncNoArg}, #endif /* PANELIST */ #ifdef WSM {"f.occupy_all", F_CONTEXT_ICONBOX|F_CONTEXT_ROOT, CRS_ANY, DtWM_FUNC_OCCUPY_WS, F_AddToAllWorkspaces, ParseWmFuncNoArg}, #endif /* WSM */ {"f.pack_icons", 0, CRS_ANY, 0, F_Pack_Icons, ParseWmFuncNoArg}, {"f.pass_keys", 0, CRS_ANY, 0, F_Pass_Key, ParseWmFuncNoArg}, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) {"f.post_rmenu", 0, CRS_KEY, 0, F_Post_RMenu, ParseWmFuncNoArg}, #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ {"f.post_wmenu", 0, CRS_BUTTON|CRS_KEY, 0, F_Post_SMenu, ParseWmFuncNoArg}, {"f.prev_cmap", 0, CRS_ANY, 0, F_Prev_Cmap, ParseWmFuncNoArg}, {"f.prev_key", 0, CRS_ANY, 0, F_Prev_Key, ParseWmFuncGrpArg}, #ifdef WSM {"f.prev_workspace", 0, CRS_ANY, 0, F_Prev_Workspace, ParseWmFuncNoArg}, #endif /* WSM */ {"f.quit_mwm", F_CONTEXT_ICON|F_CONTEXT_WINDOW, CRS_ANY, 0, F_Quit_Mwm, ParseWmFuncNoArg}, {"f.raise", F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Raise, ParseWmFuncMaybeStrArg}, {"f.raise_lower", F_CONTEXT_ROOT | F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Raise_Lower, ParseWmFuncNoArg}, {"f.refresh", 0, CRS_ANY, 0, F_Refresh, ParseWmFuncNoArg}, {"f.refresh_win", F_CONTEXT_ICON|F_CONTEXT_ROOT, CRS_ANY, 0, F_Refresh_Win, ParseWmFuncNoArg}, #ifdef WSM {"f.remove", F_CONTEXT_ROOT, CRS_ANY, DtWM_FUNC_OCCUPY_WS, F_Remove, ParseWmFuncNoArg}, #endif /* WSM */ {"f.resize", F_CONTEXT_ICON|F_CONTEXT_ROOT| F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, CRS_ANY, MWM_FUNC_RESIZE, F_Resize, ParseWmFuncNoArg}, #ifdef WSM {"f.restart", F_CONTEXT_ICON|F_CONTEXT_WINDOW, CRS_ANY, 0, F_Restart, ParseWmFuncStrArg}, #else /* WSM */ {"f.restart", F_CONTEXT_ICON|F_CONTEXT_WINDOW, CRS_ANY, 0, F_Restart, ParseWmFuncNoArg}, #endif /* WSM */ {"f.restore", F_CONTEXT_ROOT|F_CONTEXT_NORMAL|F_SUBCONTEXT_IB_WICON, CRS_ANY, 0, F_Restore, ParseWmFuncNoArg}, {"f.restore_and_raise", F_CONTEXT_ROOT|F_CONTEXT_NORMAL, CRS_ANY, 0, F_Restore_And_Raise, ParseWmFuncNoArg}, {"f.screen", 0, CRS_ANY, 0, F_Screen, ParseWmFuncStrArg}, {"f.send_msg", F_CONTEXT_ROOT, CRS_ANY, 0, F_Send_Msg, ParseWmFuncNbrArg}, {"f.separator", 0, CRS_MENU, 0, F_Separator, ParseWmFuncNoArg}, {"f.set_behavior", 0, CRS_ANY, 0, F_Set_Behavior, ParseWmFuncNoArg}, #ifdef WSM {"f.set_context", 0, CRS_ANY, 0, F_Set_Context, ParseWmFuncNbrArg}, #endif /* WSM */ {"f.title", 0, CRS_MENU, 0, F_Title, ParseWmFuncNoArg}, #if defined(PANELIST) {"f.toggle_frontpanel", 0, CRS_ANY, 0, F_Toggle_Front_Panel, ParseWmFuncNoArg}, {"f.version", 0, CRS_ANY, 0, F_Version, ParseWmFuncNoArg}, #endif /* PANELIST */ #ifdef WSM #ifdef OLD {"f.workspace_presence",F_CONTEXT_ICON|F_CONTEXT_ROOT|F_CONTEXT_ICONBOX| F_SUBCONTEXT_IB_IICON|F_SUBCONTEXT_IB_WICON, #endif /* OLD */ {"f.workspace_presence", F_CONTEXT_ROOT|F_CONTEXT_ICONBOX| F_SUBCONTEXT_IB_WICON, CRS_ANY, DtWM_FUNC_OCCUPY_WS, F_Workspace_Presence, ParseWmFuncNoArg}, #endif /* WSM */ #if defined(DEBUG) && defined(WSM) {"f.zz_debug", 0, CRS_ANY, 0, F_ZZ_Debug, ParseWmFuncStrArg}, #endif /* DEBUG */ }; /* * NOTE: New functions MUST be added in ALPHABETICAL order. A binary search * is used to find the correct function name. */ #define WMFUNCTIONTABLESIZE (sizeof(functionTable)/sizeof(functionTable[0])) /* * Be sure to update these define, whenever adding/deleting a function. */ #ifdef WSM # if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define F_CCI_INDEX 2 # endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ int F_ACTION_INDEX; int F_EXEC_INDEX; int F_NOP_INDEX; #else /* WSM */ # if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # define F_CCI_INDEX 1 # define F_EXEC_INDEX 4 # define F_NOP_INDEX 16 # else # define F_EXEC_INDEX 3 # define F_NOP_INDEX 14 # endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #endif /* WSM */ #ifdef WSM /******************************<->************************************* * * void GetFunctionTableValues (int *execIndex, int *nopIndex, * int *actionIndex) * * Description: * ----------- * This routine dynamically computes the size of the functionTable[], * and the indices for key functions, such as f.exec, f.action, and * f.nop * * Inputs: * ------ * We are setting the values of F_EXEC_INDEX, F_ACTION_INDEX, * and F_NOP_INDEX on a global level. The addresses * for same are passed in. * * Outputs: * ------- * * Comments: * -------- * This routine calls smaller routines for efficiency sake. * ******************************<->***********************************/ void GetFunctionTableValues (int *execIndex, int *nopIndex, int *actionIndex) { GetExecIndex (WMFUNCTIONTABLESIZE, execIndex); GetActionIndex (WMFUNCTIONTABLESIZE, actionIndex); GetNopIndex (WMFUNCTIONTABLESIZE, nopIndex); } /* END OF FUNCTION GetFunctionTableValues */ /******************************<->************************************* * * * Description: * ----------- * * Inputs: * ------ * Outputs: * ------- * * Comments: * -------- * ******************************<->***********************************/ void GetExecIndex (int tableSize, int *execIndex) { int i; for (i = 0; i < (tableSize); i++) { if (!(strcmp ("f.exec", functionTable[i].funcName))) { *execIndex = i; return; } else { *execIndex = 0; } } } /* END OF FUNCTION GetExecIndex */ /******************************<->************************************* * * * Description: * ----------- * * Inputs: * ------ * Outputs: * ------- * * Comments: * -------- * ******************************<->***********************************/ void GetActionIndex (int tableSize, int *actionIndex) { int i; for (i = 0; i < (tableSize); i++) { if (!(strcmp ("f.action", functionTable[i].funcName))) { *actionIndex = i; return; } else { *actionIndex = 0; } } } /* END OF FUNCTION GetActionIndex */ /******************************<->************************************* * * * Description: * ----------- * * Inputs: * ------ * Outputs: * ------- * * Comments: * -------- * ******************************<->***********************************/ void GetNopIndex (int tableSize, int *nopIndex) { int i; for (i = 0; i < (tableSize); i++) { if (!(strcmp ("f.nop", functionTable[i].funcName))) { *nopIndex = i; return; } else { *nopIndex = 0; } } } /* END OF FUNCTION GetNopIndex */ /*************************************<->************************************* * * void * WmDtGetHelpArgs () * * * Description: * ----------- * Get Help Args * * Inputs: * ------ * * Outputs: * ------- * * * Comments: * -------- * None. * *************************************<->***********************************/ void WmDtGetHelpArgs(char *args, unsigned char* volume, unsigned char* topic, int *argsCount) { unsigned char *string; unsigned char *lineP; cfileP = NULL; linec = 0; parseP = (unsigned char*) args; if(GetNextLine () != NULL) { *argsCount = 0; lineP = line; if ((string = GetSmartSMString (&lineP)) != NULL) { *argsCount = *argsCount + 1; strcpy ((char*)topic, (char*)string); } if ((string = GetSmartSMString (&lineP)) != NULL) { *argsCount = *argsCount + 1; strcpy ((char*)volume, (char *)string); } } } /* END OF FUNCTION WmDtGetHelpArgs */ /******************************<->************************************* * * void * ParseDtSessionHints (pSD, property) * * * Description: * ----------- * This function parses a DtSessionHints string and returns a list of * DtSessionItems array. The string should have the syntax: * * * * Inputs: * ------ * line = (global) line buffer * pSD->rootWindow = default root window of display * * * Outputs: * ------- * Return = * * * Comments: * -------- * None. * *************************************<->***********************************/ void ParseDtSessionHints (WmScreenData *pSD, unsigned char *property) { cfileP = NULL; linec = 0; parseP = property; ParseSessionItems (pSD); } /* END OF FUNCTION ParseDtSessionHints */ /*************************************<->************************************* * * FindDtSessionMatch(commandArgc, commandArgv, pCD, pSD, pWorkSpaceList, * clientMachine) * * Description: * ----------- * Try to find a match for this client in the session hints. * Set up client-session data. * * * Inputs: * ------ * commandArgc - argument count * commandArgv - WM_COMMAND argument vector * pCD - pointer to client data * pSD - pointer to screen data * pWorkspaceList - pointer to a list of workspaces (to be returned) * clientMachine - string for -host option in session hints * * Outputs: * ------- * *pCD - client data (may be modified) * FindDtSessionMatch - returns True if a match for this client * was found in the session hints. * *pWorkspaceList - list of workspaces this client should be put * into. (needs to be freed) * * * Comments: * -------- * Various pieces of client state (in pCD) are reset when a match * is found. * * The caller must free *pWorkspaceList when done. * *************************************<->***********************************/ Boolean FindDtSessionMatch(int commandArgc, char **commandArgv, ClientData *pCD, WmScreenData *pSD, char **pWorkSpaceList, char *clientMachine) { int count, item; int relCount; int argNum; SessionGeom *sessionGeom; for (count = 0; count < pSD->totalSessionItems; count++) { if (!pSD->pDtSessionItems[count].processed && pSD->pDtSessionItems[count].commandArgc == commandArgc) { if ((clientMachine) && (pSD->pDtSessionItems[count].clientMachine) && (strcmp(clientMachine, pSD->pDtSessionItems[count].clientMachine))) { /* * This item has clientMachine string but the * clientMachine does not match. */ continue; } for (argNum = 0; argNum < commandArgc ; argNum++) { if(strcmp(commandArgv[argNum], pSD->pDtSessionItems[count].commandArgv[argNum])) { /* * One mismatch and we quit looking at this item. * Decrement argNum so a mismatch on the last item * will not look like a match below when comparing * argNum == commandArgc */ argNum--; break; } } if (argNum == commandArgc) { /* * Made it through all strings so this is a match */ pSD->pDtSessionItems[count].processed = True; pSD->remainingSessionItems --; pCD->clientFlags |= SM_LAUNCHED; /* * Free strings malloc'd for commandArgv for this item */ for (relCount = 0; relCount < commandArgc; relCount++) { XtFree(pSD->pDtSessionItems[count].commandArgv[relCount]); } XtFree((char *)pSD->pDtSessionItems[count].commandArgv); if(pSD->pDtSessionItems[count].clientState) { pCD->clientState = pSD->pDtSessionItems[count].clientState; pCD->clientFlags |= SM_CLIENT_STATE; } if(pSD->pDtSessionItems[count].sessionGeom) { sessionGeom = pSD->pDtSessionItems[count].sessionGeom; if (sessionGeom->flags & XValue) { pCD->clientX = sessionGeom->clientX; pCD->clientFlags |= SM_X; } if (sessionGeom->flags & YValue) { pCD->clientY = sessionGeom->clientY; pCD->clientFlags |= SM_Y; } if (sessionGeom->flags & WidthValue) { pCD->clientWidth = sessionGeom->clientWidth; pCD->clientFlags |= SM_WIDTH; } if (sessionGeom->flags & HeightValue) { pCD->clientHeight = sessionGeom->clientHeight; pCD->clientFlags |= SM_HEIGHT; } /* * Free SessionGeom malloc'd space for this item */ XtFree((char *)pSD->pDtSessionItems[count].sessionGeom); } if(pSD->pDtSessionItems[count].clientMachine) { /* * Free clientMachine malloc'd space for this item */ XtFree((char *) pSD->pDtSessionItems[count].clientMachine); pSD->pDtSessionItems[count].clientMachine = NULL; } if(pSD->pDtSessionItems[count].workspaces) { /* * The caller is responsible for freeing this * data. */ *pWorkSpaceList = pSD->pDtSessionItems[count].workspaces; } if(pSD->remainingSessionItems == 0) { /* * Free the whole pSD->pDtSessionHints structure */ XtFree((char *)pSD->pDtSessionItems); } return (True); } } /* not processed and argc's are the same */ } /* for */ return (False); } /* END OF FUNCTION FindDtSessionMatch */ /*************************************<->************************************* * * void * ParseSessionItems (pSD) * * * Description: * ----------- * Parse session items * * Inputs: * ------ * pSD = pointer to screen data * cfileP = (global) file pointer to NULL * line = (global) line buffer * linec = (global) line count * parseP = (global) parse string pointer if cfileP == NULL * pSD->rootWindow = default root window of display * * Outputs: * ------- * linec = (global) line count incremented * parseP = (global) parse string pointer if cfileP == NULL * * * Comments: * -------- * None. * *************************************<->***********************************/ void ParseSessionItems (WmScreenData *pSD) { unsigned char *string; unsigned char *lineP; int count; /* * Parse property string */ if(GetNextLine () != NULL) { pSD->totalSessionItems = atoi((char *)line); pSD->remainingSessionItems = pSD->totalSessionItems; } if((pSD->totalSessionItems < 1) || !GetSessionHintsInfo(pSD, pSD->totalSessionItems)) { /* * No items or couldn't allocate space */ return; } count = 0; while ((count < pSD->totalSessionItems) && (GetNextLine () != NULL)) { lineP = line; while ((string = GetSmartSMString (&lineP)) != NULL) { if (!strcmp((char *)string, "-geometry")) { /* * Parse geometry if it is present */ string = GetSmartSMString(&lineP); ParseSessionGeometry (pSD, count, string); } else if (!strcmp((char *)string, "-state")) { /* * Parse the state if it is present */ string = GetSmartSMString(&lineP); ParseSessionClientState (pSD, count, string); } else if (!strcmp((char *)string, "-workspaces")) { /* * Parse the workspaces string if it is present */ string = GetSmartSMString(&lineP); ParseSessionWorkspaces (pSD, count, string); } else if (!strcmp((char *)string, "-cmd")) { /* * Parse the command string if it is present */ string = GetSmartSMString(&lineP); ParseSessionCommand (pSD, count, &string); } else if (!strcmp((char *)string, "-host")) { /* * Parse the host string if it is present */ string = GetSmartSMString(&lineP); ParseSessionHost (pSD, count, string); } } /* while GetSmartSMString */ count++; } /* while GetNextLine */ } /* END OF FUNCTION ParseSessionItems */ /*************************************<->************************************* * * ParseSessionClientState (pSD, count, string); * * Description: * ----------- * Inputs: * ------ * Outputs: * ------- * Comments: * -------- * *************************************<->***********************************/ void ParseSessionClientState (WmScreenData *pSD, int count, unsigned char *string) { if(!strcmp((char *)string, "NormalState")) { pSD->pDtSessionItems[count].clientState = NORMAL_STATE; } else if(!strcmp((char *)string, "IconicState")) { pSD->pDtSessionItems[count].clientState = MINIMIZED_STATE; } } /* END OF FUNCTION ParseSessionClientState */ /*************************************<->************************************* * * ParseSessionGeometry (pSD, count, string) * * Description: * ----------- * Inputs: * ------ * Outputs: * ------- * Comments: * -------- * *************************************<->***********************************/ void ParseSessionGeometry (WmScreenData *pSD, int count, unsigned char *string) { SessionGeom *pTmpSessionGeom; int mask /* = 0 */; int X, Y, width, height; X = Y = width = height = 0; /* * XParseGeometry */ mask = XParseGeometry((char *)string, &X, &Y, (unsigned int *)&width, (unsigned int *)&height); if (mask) { /* * Allocate space for the geometry structure */ if ((pTmpSessionGeom = (SessionGeom *)XtMalloc (sizeof (SessionGeom))) == NULL) { Warning (((char *)GETMESSAGE(60, 1, "Insufficient memory for session geometry item"))); return; } pTmpSessionGeom->flags = mask; pTmpSessionGeom->clientX = X; pTmpSessionGeom->clientY = Y; pTmpSessionGeom->clientWidth = width; pTmpSessionGeom->clientHeight = height; pSD->pDtSessionItems[count].sessionGeom = pTmpSessionGeom; } } /* END OF FUNCTION ParseSessionGeometry */ /*************************************<->************************************* * * void * ParseSessionWorkspaces (pSD, count, string) * * Description: * ----------- * Inputs: * ------ * Outputs: * ------- * Comments: * -------- * *************************************<->***********************************/ void ParseSessionWorkspaces (WmScreenData *pSD, int count, unsigned char *string) { /* * Allocate space for the workspaces string */ if ((pSD->pDtSessionItems[count].workspaces = (String)XtMalloc ((unsigned int) (strlen((char *)string) + 1))) == NULL) { Warning (((char *)GETMESSAGE(60, 2, "Insufficient memory for workspaces list in sesssion item"))); return; } strcpy(pSD->pDtSessionItems[count].workspaces, (char *)string); } /* END OF FUNCTION ParseSessionWorkspaces */ /*************************************<->************************************* * * void * ParseSessionCommand (pSD, count, string) * * Description: * ----------- * Inputs: * ------ * Outputs: * ------- * Comments: * -------- * *************************************<->***********************************/ void ParseSessionCommand (WmScreenData *pSD, int count, unsigned char **commandString) { #define ARG_AMT 100 int xindex; unsigned char **argv; int argc = 0; int iSizeArgv; unsigned char *string; argv = (unsigned char **) XtMalloc (ARG_AMT * sizeof(char *)); iSizeArgv = ARG_AMT; while ((string = GetSmartSMString (commandString)) != NULL) { /* * Get pointers to strings in command line and count them */ argv[argc] = string; argc ++; if (argc >= iSizeArgv) { iSizeArgv += ARG_AMT; argv = (unsigned char **) XtRealloc ((char *)argv, (iSizeArgv * sizeof(char *))); } } if ((pSD->pDtSessionItems[count].commandArgv = (char **)XtMalloc ((argc) * sizeof(char * ))) == NULL) { /* * Allocate space for saved argv */ Warning (((char *)GETMESSAGE(60, 3, "Insufficient memory for commandArgv array"))); } else { pSD->pDtSessionItems[count].commandArgc = argc; for (xindex = 0; xindex < argc ; xindex++) { if ((pSD->pDtSessionItems[count].commandArgv[xindex] = (String) XtMalloc ((unsigned int) (strlen((char *)argv[xindex]) + 1))) == NULL) { /* * Allocate space for the next command segment. */ Warning (((char *)GETMESSAGE(60, 4, "Insufficient memory for commandArgv item"))); } else { strcpy(pSD->pDtSessionItems[count].commandArgv[xindex], (char *)argv[xindex]); } } } XtFree ((char *) argv); } /* END OF FUNCTION ParseSessionCommand */ /*************************************<->************************************* * * void * ParseSessionHost (pSD, count, string) * * Description: * ----------- * Inputs: * ------ * Outputs: * ------- * Comments: * -------- * *************************************<->***********************************/ void ParseSessionHost (WmScreenData *pSD, int count, unsigned char *string) { /* * Allocate space for the workspaces string */ if ((pSD->pDtSessionItems[count].clientMachine = (String)XtMalloc ((unsigned int) (strlen((char *)string) + 1))) == NULL) { Warning (((char *)GETMESSAGE(60, 38, "Insufficient memory for host name in sesssion item"))); return; } strcpy(pSD->pDtSessionItems[count].clientMachine, (char *)string); } /* END OF FUNCTION ParseSessionHost */ /*************************************<->************************************* * * GetSessionHintsInfo (pSD, numItems) * * Description: * ----------- * Inputs: * ------ * Outputs: * ------- * Comments: * -------- * *************************************<->***********************************/ Boolean GetSessionHintsInfo (WmScreenData *pSD, long numItems) { if ((pSD->pDtSessionItems = (DtSessionItem *)XtMalloc (numItems * sizeof (DtSessionItem))) == NULL) { Warning (((char *)GETMESSAGE(60, 5, "Insufficient memory for Dt Session Hints"))); return(False); } memset ((char *)pSD->pDtSessionItems, NULL, numItems * sizeof (DtSessionItem)); return(True); } /* END OF FUNCTION GetSessionHintsInfo */ /*************************************<->************************************* * * PeekAhead (currentChar, currentLev) * * * Description: * ----------- * Returns a new level value if this is a new nesting level of quoted string * Otherwise it returns a zero * * * Inputs: * ------ * currentChar = current position in the string * currentLev = current level of nesting * * * Outputs: * ------- * Returns either a new level of nesting or zero if the character is copied in * * * Comments: * -------- * *************************************<->***********************************/ unsigned int PeekAhead(unsigned char *currentChar, unsigned int currentLev) { Boolean done = False; unsigned int tmpLev = 1; #ifndef NO_MULTIBYTE unsigned int chlen; while (((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) && (chlen == 1) && ((*currentChar == '"') || (*currentChar == '\\')) && (done == False)) { currentChar++; if(((chlen = mblen ((char *)currentChar, MB_CUR_MAX)) > 0) && (chlen == 1) && ((*currentChar == '"') || (*currentChar == '\\'))) { tmpLev++; if(*currentChar == '"') { done = True; } else { currentChar++; } } } #else while((*currentChar != NULL) && (done == False) && ((*currentChar == '"') || (*currentChar == '\\'))) { currentChar++; if((*currentChar != NULL) && ((*currentChar == '"') || (*currentChar == '\\'))) { tmpLev++; if(*currentChar == '"') { done = True; } else { currentChar++; } } } #endif /*NO_MULTIBYTE*/ /* * Figure out if this is truly a new level of nesting - else ignore it * This section probably could do some error checking and return -1 * If so, change type of routine from unsigned int to int */ if(done == True) { return(tmpLev); } else { return(0); } } /* END OF FUNCTION PeekAhead */ #endif /* WSM */ #ifdef MOTIF_ONE_DOT_ONE /*************************************<->************************************* * * GetHomeDirName (fileName) * * Description: * ----------- * This function finds the "HOME" directory * * * Inputs: * ------ * fileName * * Outputs: * ------- * fileName * * Comments: * -------- * *************************************<->***********************************/ void GetHomeDirName(String fileName) { int uid; struct passwd *pw; char *ptr = NULL; if((ptr = getenv("HOME")) == NULL) { if((ptr = getenv("USER")) != NULL) { pw = getpwnam(ptr); } else { uid = getuid(); pw = getpwuid(uid); } if (pw) { ptr = pw->pw_dir; } else { ptr = ""; } } strcpy(fileName, ptr); } #endif /*************************************<->************************************* * * SyncModifierStrings (fileName) * * Description: * ----------- * This function updates modifierStrings table so that Mwm uses the correct * modifier to keysym mapping. Specifically, fix up the Alt and Meta bindings. * * Inputs: * ------ * fileName * * Outputs: * ------- * fileName * * Comments: * -------- * *************************************<->***********************************/ void SyncModifierStrings(void) { XModifierKeymap *map; int i, j, k = 0; map = XGetModifierMapping (DISPLAY); for (i = 0; i < 8; i++) { for (j = 0; j < map->max_keypermod; j++) { if (map->modifiermap[k]) { #ifdef FIX_1611 KeySym ks = WmKeycodeToKeysym(DISPLAY, map->modifiermap[k]); #else KeySym ks = XKeycodeToKeysym(DISPLAY, map->modifiermap[k], 0); #endif char *nm = XKeysymToString(ks); /* Compare, ignoring the trailing '_L' or '_R' in keysym */ if (nm && !strncmp("Alt", nm, 3)) { modifierStrings[ALT_INDEX].mask = (1<************************************* * * ProcessWmFile () * * * Description: * ----------- * This function reads the mwm resource description file and processes the * resources that are described. * * * Inputs: * ------ * wmGD.bitmapDirectory = bitmapDirectory resource value * pSD->buttonBindings = buttonBindings resource value * wmGD.configFile = configuration file resource value * pSD->keyBindings = keyBindings resource value * wmGD.rootWindow = default root window of display * HOME = environment variable for home directory * functionTable = window manager function parse table * * * Outputs: * ------- * wmGD.buttonSpecs = list of button binding specifications * wmGD.keySpecs = list of key binding specification * wmGD.menuSpecs = list of menu specifications * *wmGD.acceleratorMenuSpecs = initialized array of (MenuSpec *) * wmGD.acceleratorMenuCount = 0 * * * Comments: * -------- * If there are more than MAXLINE characters on a line the excess characters * are truncated. * *************************************<->***********************************/ #define MENU_SPEC "menu" #define BUTTON_SPEC "buttons" #define KEY_SPEC "keys" #ifdef PANELIST #define FRONT_PANEL_SPEC DTWM_FP_PANEL_OLD #define DROP_EFFECTS_SPEC DTWM_FP_DROP_EFFECTS #define PANEL_SPEC DTWM_FP_PANEL #define BOX_SPEC DTWM_FP_BOX #define CONTROL_SPEC DTWM_FP_CONTROL #define INCLUDE_SPEC DTWM_FP_INCLUDE #define ANIMATION_SPEC DTWM_FP_ANIMATION #define SWITCH_SPEC DTWM_FP_SWITCH void ProcessWmFile (WmScreenData *pSD, Boolean bNested) #else /* PANELIST */ void ProcessWmFile (WmScreenData *pSD) #endif /* PANELIST */ { unsigned char *lineP; unsigned char *string; unsigned int n; MenuSpec *menuSpec; #ifdef PANELIST static Boolean conversionInProgress = False; Arg args[10]; int argnum; if (!bNested) { #endif /* PANELIST */ /* * Initialize global data values that are set based on data in * the mwm resource description file. */ pSD->buttonSpecs = NULL; pSD->keySpecs = NULL; pSD->menuSpecs = NULL; #ifdef WSM /**** hhhhhhhhhhhh ******/ GetFunctionTableValues (&F_EXEC_INDEX, &F_NOP_INDEX, &F_ACTION_INDEX); #endif /* WSM */ /* * Find and parse the default system menu string, if it exists. */ cfileP = NULL; linec = 0; if (((parseP = (unsigned char *) builtinSystemMenu) != NULL) && (GetNextLine () != NULL)) { lineP = line; ParseMenuSet (pSD, lineP); } linec = 0; if (((parseP = (unsigned char *) builtinRootMenu) != NULL) && (GetNextLine () != NULL)) { lineP = line; ParseMenuSet (pSD, lineP); } #ifdef PANELIST if (wmGD.useFrontPanel && !wmGD.dtSD && (XDefaultScreen (wmGD.display) == pSD->screen)) { wmGD.dtSD = pSD; /* only one per display */ } #endif /* PANELIST */ /* * Find and associate a stream with the window manager resource * description file. */ if ((cfileP = FopenConfigFile ()) == NULL) { if (!wmGD.useStandardBehavior) Warning (((char *)GETMESSAGE(60, 6, "Cannot open configuration file"))); return; } #ifdef PANELIST } /* end if (!bNested) */ #endif /* PANELIST */ /* * Parse the information in the configuration file. * If there are more than MAXLINE characters on a line the excess are * truncated. */ linec = 0; while ((GetNextLine () != NULL)) /* not EOF nor read error */ { lineP = line; if ((*line == '!') || (string = GetString (&lineP)) == NULL) /* empty or comment line */ { continue; } ToLower (string); if (!strcmp ((char *)string, MENU_SPEC)) { ParseMenuSet (pSD, lineP); } else if (!strcmp ((char *) string, BUTTON_SPEC)) { ParseButtonSet (pSD, lineP); } else if (!strcmp ((char *) string, KEY_SPEC)) { ParseKeySet (pSD, lineP); } #ifdef PANELIST else if (!strcmp ((char *)string, INCLUDE_SPEC)) { ParseIncludeSet (pSD, lineP); } #endif /* PANELIST */ } fclose (cfileP); /* * Create and initialize the pSD->acceleratorMenuSpecs array. * This assumes we create pointers to MenuSpecs within ProcessWmFile(). * Set pSD->acceleratorMenuCount to 0. */ /* count the number of menu specifications */ n = 0; menuSpec = pSD->menuSpecs; while (menuSpec) { n++; menuSpec = menuSpec->nextMenuSpec; } /* allocate the array and initialize to zeros */ pSD->acceleratorMenuSpecs = NULL; if (n) { pSD->acceleratorMenuSpecs = (MenuSpec **) XtCalloc (n, sizeof (MenuSpec *)); if (pSD->acceleratorMenuSpecs == NULL) { Warning (((char *)GETMESSAGE(60, 7, "Insufficient memory for menu accelerators"))); } } pSD->acceleratorMenuCount = 0; } /* END OF FUNCTION ProcessWmFile */ /**** This function stolen from Xt/Intrinsic.c ****/ /* The implementation of this routine is operating system dependent */ static char *ExtractLocaleName(lang) String lang; { #ifdef hpux /* hpux-specific parsing of the locale string */ #define MAXLOCALE 64 /* buffer size of locale name */ char *start; char *end; int len; static char buf[MAXLOCALE]; /* If lang has a substring ":;", extract * from the first such occurrence as the locale name. */ start = lang; if (start = strchr (lang, ':')) { start++; if (end = strchr (start, ';')) { len = end - start; strncpy(buf, start, len); *(buf + len) = '\0'; lang = buf; } } #endif /* hpux */ return lang; } #ifdef WSM #define RC_CONFIG_SUBDIR "/config/" #define RC_DEFAULT_CONFIG_SUBDIR "/config/C" #endif /* WSM */ /*************************************<->************************************* * * FopenConfigFile () * * * Description: * ----------- * This function searches for, opens, and associates a stream with the mwm * resource description file, * * * Inputs: * ------ * wmGD.configFile = configuration file resource value. * HOME = environment variable for home directory * * * Outputs: * ------- * Return = If successful, a pointer to the FILE structure associated with * the configuration file. Otherwise, NULL. * * * Comments: * -------- * None. * *************************************<->***********************************/ FILE *FopenConfigFile (void) { char *LANG, *LANGp; FILE *fileP; #ifndef MOTIF_ONE_DOT_ONE char *homeDir = XmeGetHomeDirName(); #endif #ifdef PANELIST Boolean stackPushed; #endif /* PANELIST */ /* * Get the LANG environment variable * make copy since another call to getenv will blast the value. */ LANGp = setlocale(LC_CTYPE, NULL); /* * setlocale not guaranteed to return $LANG -- extract * something usable. */ LANGp = ExtractLocaleName (LANGp); if ((LANGp == NULL) || (strlen(LANGp) == 0)) { LANG = NULL; } else { if ((LANG = (char *) XtMalloc(strlen(LANGp) +1)) == NULL) { PWarning (((char *)GETMESSAGE(60, 41, "Insufficient memory to get LANG environment variable."))); return(NULL); } strcpy(LANG, LANGp); } /* * To get a name for the file first look at the value of the configFile * resource. Interpret "~/.." as relative to the user's home directory. * Use the LANG variable if set and .mwmrc is in $HOME/$LANG/.mwmrc */ #ifdef PANELIST if (pConfigStackTop && pConfigStackTop->tempName) { fileP = fopen (pConfigStackTop->tempName, "r"); return (fileP); } stackPushed = (pConfigStackTop && (pConfigStackTop != pConfigStack)); fileP = NULL; cfileName[0] = '\0'; #endif /* PANELIST */ if ((wmGD.configFile != NULL) && (wmGD.configFile[0] != '\0')) /* pointer to nonNULL string */ { if ((wmGD.configFile[0] == '~') && (wmGD.configFile[1] == '/')) /* handle "~/..." */ { #ifdef MOTIF_ONE_DOT_ONE GetHomeDirName(cfileName); #else strcpy (cfileName, homeDir); #endif if (LANG != NULL) { strncat(cfileName, "/", MAXWMPATH-strlen(cfileName)); strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); } strncat(cfileName, &(wmGD.configFile[1]), MAXWMPATH-strlen(cfileName)); if ((fileP = fopen (cfileName, "r")) != NULL) { if (LANG != NULL) { XtFree(LANG); LANG = NULL; } #ifndef PANELIST return (fileP); #endif /* PANELIST */ } else { /* * Just try $HOME/.mwmrc */ #ifdef MOTIF_ONE_DOT_ONE GetHomeDirName(cfileName); #else strcpy (cfileName, homeDir); #endif strncat(cfileName, &(wmGD.configFile[1]), MAXWMPATH-strlen(cfileName)); if ((fileP = fopen (cfileName, "r")) != NULL) { if (LANG != NULL) { XtFree(LANG); LANG = NULL; } #ifndef PANELIST return (fileP); #endif /* PANELIST */ } } } else /* relative to current directory or absolute */ { #ifdef PANELIST char *pch; pch = (char *) GetNetworkFileName (wmGD.configFile); if ((fileP = fopen (pch, "r")) != NULL) { strncpy (cfileName, pch, MAXWMPATH); } XtFree (pch); if ((fileP == NULL) && !stackPushed) { #endif /* PANELIST */ if ((fileP = fopen (wmGD.configFile, "r")) != NULL) { if (LANG != NULL) { XtFree(LANG); LANG = NULL; } return(fileP); } #ifdef PANELIST } else if ((fileP == NULL) && stackPushed) { strcpy (cfileName, wmGD.configFile); } #endif /* PANELIST */ } } #ifdef PANELIST if ((fileP == NULL) && !stackPushed) { #endif /* PANELIST */ /* * The configFile resource didn't do it for us. * First try HOME_MWMRC, then try SYS_MWMRC . */ #define HOME_MWMRC "/.mwmrc" #define SLASH_MWMRC "/system.mwmrc" #ifdef MOTIF_ONE_DOT_ONE GetHomeDirName(cfileName); #else strcpy (cfileName, homeDir); #endif #ifdef WSM if (MwmBehavior) { /* * * Looking for $HOME/$LANG/.mwmrc * --or--if $LANG is NULL * Looking for $HOME/.mwmrc * */ if (LANG != NULL) { strncat(cfileName, "/", MAXWMPATH-strlen(cfileName)); strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); } strncat(cfileName, HOME_MWMRC, MAXWMPATH - strlen(cfileName)); } else { /* * * Looking for $HOME/.dt/$LANG/dtwmrc * * --or--if $LANG is NULL-- * * Looking for $HOME/.dt/dtwmrc * */ strncat(cfileName, "/.dt/", MAXWMPATH-strlen(cfileName)); if (LANG != NULL) { strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); } strncat(cfileName, LANG_DT_WMRC, MAXWMPATH - strlen(cfileName)); } #else /* WSM */ if (LANG != NULL) { strncat(cfileName, "/", MAXWMPATH-strlen(cfileName)); strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); } strncat(cfileName, HOME_MWMRC, MAXWMPATH - strlen(cfileName)); #endif /* WSM */ if ((fileP = fopen (cfileName, "r")) != NULL) { if (LANG != NULL) { XtFree(LANG); LANG = NULL; } #ifndef PANELIST return (fileP); #endif /* PANELIST */ } else { /* * Just try $HOME/.mwmrc */ #ifdef MOTIF_ONE_DOT_ONE GetHomeDirName(cfileName); #else strcpy (cfileName, homeDir); #endif #ifdef WSM if (MwmBehavior) { /* * Just try $HOME/.mwmrc */ strncat(cfileName, HOME_MWMRC, MAXWMPATH - strlen(cfileName)); } else { /* * Just try $HOME/.dt/dtwmrc */ strncat(cfileName, HOME_DT_WMRC, MAXWMPATH - strlen(cfileName)); } #else /* WSM */ strncat(cfileName, HOME_MWMRC, MAXWMPATH - strlen(cfileName)); #endif /* WSM */ if ((fileP = fopen (cfileName, "r")) != NULL) { if (LANG != NULL) { XtFree(LANG); LANG = NULL; } #ifndef PANELIST return (fileP); #endif /* PANELIST */ } } #ifdef PANELIST } #define DTLIBDIR CDE_INSTALLATION_TOP #define DTADMINDIR CDE_CONFIGURATION_TOP #define SLASH_DT_WMRC "/sys.dtwmrc" if ((fileP == NULL) && !stackPushed) { /* * No home-based config file. Try the admin directory. */ strcpy(cfileName, DTADMINDIR); strncat(cfileName, RC_CONFIG_SUBDIR, MAXWMPATH-strlen(cfileName)); strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); strncat(cfileName, SLASH_DT_WMRC, MAXWMPATH - strlen(cfileName)); if (((fileP = fopen (cfileName, "r")) == NULL) && LANG && *LANG) { /* Try it with no LANG */ strcpy(cfileName, DTADMINDIR); strncat(cfileName, RC_CONFIG_SUBDIR, MAXWMPATH-strlen(cfileName)); strncat(cfileName, SLASH_DT_WMRC, MAXWMPATH - strlen(cfileName)); } if ((fileP = fopen (cfileName, "r")) != NULL) { XtFree(LANG); LANG = NULL; } } if ((fileP == NULL) && !stackPushed) { #endif /* PANELIST */ #ifndef MWMRCDIR #define MWMRCDIR "/usr/lib/X11" #endif if (LANG != NULL) { #ifdef WSM if (MwmBehavior) { strcpy(cfileName, MWMRCDIR); strncat(cfileName, "/", MAXWMPATH-strlen(cfileName)); strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); strncat(cfileName, SLASH_MWMRC, MAXWMPATH - strlen(cfileName)); } else { strcpy(cfileName, DTLIBDIR); strncat(cfileName, RC_CONFIG_SUBDIR, MAXWMPATH-strlen(cfileName)); strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); strncat(cfileName, SLASH_DT_WMRC, MAXWMPATH - strlen(cfileName)); } #else /* WSM */ /* * Try /$LANG/system.mwmrc within the install tree */ strcpy(cfileName, MWMRCDIR); strncat(cfileName, "/", MAXWMPATH-strlen(cfileName)); strncat(cfileName, LANG, MAXWMPATH-strlen(cfileName)); strncat(cfileName, SLASH_MWMRC, MAXWMPATH - strlen(cfileName)); #endif /* WSM */ if ((fileP = fopen (cfileName, "r")) != NULL) { XtFree(LANG); LANG = NULL; #ifndef PANELIST return (fileP); #endif /* PANELIST */ } } #ifdef PANELIST if ((fileP == NULL) && !stackPushed) { #endif /* PANELIST */ #ifdef WSM if (MwmBehavior) { strcpy(cfileName, MWMRCDIR); strncat(cfileName, SLASH_MWMRC, MAXWMPATH - strlen(cfileName)); #ifdef PANELIST fileP = fopen (cfileName, "r"); #else /* PANELIST */ return (fopen (cfileName, "r")); #endif /* PANELIST */ } else { strcpy(cfileName, DTLIBDIR); strncat(cfileName, RC_DEFAULT_CONFIG_SUBDIR, MAXWMPATH - strlen(cfileName)); strncat(cfileName, SLASH_DT_WMRC, MAXWMPATH - strlen(cfileName)); #ifdef PANELIST fileP = fopen (cfileName, "r"); #else /* PANELIST */ return (fopen (cfileName, "r")); #endif /* PANELIST */ } #else /* WSM */ /* * Try /system.mwmrc within the install tree */ strcpy(cfileName, MWMRCDIR); strncat(cfileName, SLASH_MWMRC, MAXWMPATH - strlen(cfileName)); if (LANG != NULL) { XtFree(LANG); LANG = NULL; } #ifdef PANELIST strcpy(cfileName, cfileName); fileP = fopen (cfileName, "r"); #else /* PANELIST */ return (fopen (cfileName, "r")); #endif /* PANELIST */ #endif /* WSM */ #ifdef PANELIST } } if (!fileP) { char *pch; /* * handle ":" form of file name */ pch = (char *) GetNetworkFileName (cfileName); if ((fileP = fopen (cfileName, "r")) != NULL) { strncpy (cfileName, pch, MAXWMPATH); XtFree (pch); } /* * Either not ":" form or there was a * problem up above. This is the last attempt to * open something. */ if (!fileP) { fileP = fopen (cfileName, "r"); } } if (!pConfigStack) { ConfigStackInit (cfileName); } if (wmGD.cppCommand && *wmGD.cppCommand) { /* * Run the file through the C-preprocessor */ PreprocessConfigFile (); if (pConfigStackTop->cppName) { /* open the result */ fileP = fopen (pConfigStackTop->cppName, "r"); } } if (LANG != NULL) { XtFree(LANG); LANG = NULL; } return (fileP); #endif /* PANELIST */ } /* END OF FUNCTION FopenConfigFile */ /*************************************<->************************************* * * SaveMenuAccelerators (pSD, newMenuSpec) * * * Description: * ----------- * This function saves the MenuSpec pointer in pSD->acceleratorMenuSpecs. * * * Inputs: * ------ * newMenuSpec = pointer to MenuSpec to be saved. * pSD->acceleratorMenuSpecs = * pSD->acceleratorMenuCount = * * * Outputs: * ------- * pSD->acceleratorMenuSpecs = possibly updated * pSD->acceleratorMenuCount = possibly updated * * * Comments: * -------- * We assume only MenuSpecs created within ProcessWmFile() are to be saved. * Otherwise, we may cause override the limits of pSD->acceleratorMenuSpecs. * *************************************<->***********************************/ void SaveMenuAccelerators (WmScreenData *pSD, MenuSpec *newMenuSpec) { MenuSpec **pMenuSpec; pMenuSpec = pSD->acceleratorMenuSpecs; if (pMenuSpec == NULL) return; while ((*pMenuSpec != NULL) && (*pMenuSpec != newMenuSpec)) { pMenuSpec++; } if (*pMenuSpec == NULL) { *pMenuSpec = newMenuSpec; pSD->acceleratorMenuCount++; } } /* END OF FUNCTION SaveMenuAccelerators */ /*************************************<->************************************* * * ParseMenuSet (pSD, lineP) * * * Description: * ----------- * Menu pane specification found. Parse the following syntax: * * v * Menu menu_pane_name * { * label [mnemonic] [accelerator] function * label [mnemonic] [accelerator] function * ... * label [mnemonic] [accelerator] function * } * * * Inputs: * ------ * cfileP = (global) file pointer to fopened configuration file or NULL * lineP = pointer to menu name in line buffer * line = (global) line buffer * linec = (global) line count * parseP = (global) parse string pointer if cfileP == NULL * pSD->rootWindow = default root window of display * wmGD.bitmapDirectory = bitmapDirectory resource value * HOME = environment variable for home directory * * * Outputs: * ------- * linec = (global) line count incremented * parseP = (global) parse string pointer if cfileP == NULL * pSD->menuSpecs = list of menu specifications * * * Comments: * -------- * Skips unnamed menu specifications. * This means custom menu specifications can be distinguished by NULL name. * *************************************<->***********************************/ static void ParseMenuSet (WmScreenData *pSD, unsigned char *lineP) { unsigned char *string; MenuSpec *menuSpec; /* * If menu name is NULL then skip this pane specification. */ if ((string = GetString (&lineP)) == NULL) { return; } /* * Allocate space for the menu specification structure. */ if ((menuSpec = (MenuSpec *)XtMalloc (sizeof (MenuSpec))) == NULL) { PWarning (((char *)GETMESSAGE(60, 9, "Insufficient memory for menu"))); return; } menuSpec->currentContext = 0; menuSpec->menuWidget = NULL; menuSpec->whichButton = SELECT_BUTTON; /* Button1 selection default */ menuSpec->menuItems = NULL; menuSpec->accelContext = 0; menuSpec->accelKeySpecs = NULL; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) menuSpec->exclusions = NULL; menuSpec->clientLocal = FALSE; menuSpec->commandID = 0; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ menuSpec->nextMenuSpec = NULL; /* * Allocate and fill space for the menu name. */ if ((menuSpec->name = (String)XtMalloc ((unsigned int) (strlen ((char *)string) + 1))) == NULL) { PWarning (((char *)GETMESSAGE(60, 10, "Insufficient memory for menu"))); XtFree ((char *)menuSpec); return; } strcpy (menuSpec->name, (char *)string); /* * Add the empty structure to the head of the menu specification list. */ menuSpec->nextMenuSpec = pSD->menuSpecs; pSD->menuSpecs = menuSpec; /* * Require leading '{' on the next line. */ while ((GetNextLine () != NULL)) /* not EOF nor read error */ { lineP = line; ScanWhitespace(&lineP); if ((lineP == NULL) || (*line == '!') || (*lineP == '\0') || (*lineP == '#')) /* ignore empty or comment line */ { continue; } if (*lineP == '{') /* found '{' */ { break; } /* not a '{' */ PWarning (((char *)GETMESSAGE(60, 11, "Expected '{' after menu name"))); return; } /* * Found leading "{" or EOF. * Parse menu item specifications until "}" or EOF found. */ menuSpec->menuItems = PARSE_MENU_ITEMS (pSD, menuSpec); } /* END OF FUNCTION ParseMenuSet */ /*************************************<->************************************* * * MenuItem * * ParseMwmMenuStr (pSD, menuStr) * * * Description: * ----------- * This function parses a WMW_MENU string and returns a list of * MenuItems structures. The string should have the syntax: * * label [mnemonic] [accelerator] function * label [mnemonic] [accelerator] function * ... * label [mnemonic] [accelerator] function * * * Inputs: * ------ * line = (global) line buffer * pSD->rootWindow = default root window of display * wmGD.bitmapDirectory = bitmapDirectory resource value * HOME = environment variable for home directory * functionTable = window manager function parse table * * * Outputs: * ------- * Return = list of MenuItem structures or NULL * * * Comments: * -------- * None. * *************************************<->***********************************/ MenuItem *ParseMwmMenuStr (WmScreenData *pSD, unsigned char *menuStr) { cfileP = NULL; linec = 0; parseP = menuStr; return (PARSE_MENU_ITEMS (pSD, NULL)); } /* END OF FUNCTION ParseMwmMenuStr */ /*************************************<->************************************* * * static MenuItem * * ParseMenuItems (pSD, menuSpec) * * * Description: * ----------- * Parse menu item specifications: * * label [mnemonic] [accelerator] function * label [mnemonic] [accelerator] function * ... * label [mnemonic] [accelerator] function * [}] * * * Inputs: * ------ * pSD = pointer to screen data * cfileP = (global) file pointer to fopened configuration file or NULL * line = (global) line buffer * linec = (global) line count * parseP = (global) parse string pointer if cfileP == NULL * pSD->rootWindow = default root window of display * wmGD.bitmapDirectory = bitmapDirectory resource value * HOME = environment variable for home directory * * * Outputs: * ------- * linec = (global) line count incremented * parseP = (global) parse string pointer if cfileP == NULL * Return = list of MenuItem structures or NULL * * * Comments: * -------- * None. * *************************************<->***********************************/ static MenuItem *ParseMenuItems (WmScreenData *pSD #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) , MenuSpec *menuSpec #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ ) { unsigned char *string; unsigned char *lineP; MenuItem *firstMenuItem; MenuItem *lastMenuItem; MenuItem *menuItem; register int ix = 0; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) Boolean use_separators = False; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* * Parse "label [mnemonic] [accelerator] function" or * "[.]*" * lines until "}" or EOF found. */ firstMenuItem = lastMenuItem = NULL; while ((GetNextLine () != NULL)) { lineP = line; if ((*line == '!') || (*line == '#') || (string = GetString (&lineP)) == NULL) /* ignore empty or comment lines */ { continue; } if (*string == '}') /* finished with menu set. */ { break; } /* * Allocate space for the menu item structure. */ if ((menuItem = (MenuItem *)XtMalloc (sizeof (MenuItem))) == NULL) { PWarning (((char *)GETMESSAGE(60, 12, "Insufficient memory for menu item"))); continue; } menuItem->nextMenuItem = NULL; menuItem->wmFunction = (WmFunction)NULL; menuItem->wmFuncArgs = NULL; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) menuItem->clientCommandName = NULL; menuItem->clientCommandID = 0; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* * Is this a simple menu item label or is it a * client command specification. */ if (IsClientCommand((String) string)) { if (!ParseClientCommand(&lineP, menuSpec, menuItem, string, &use_separators)) { XtFree ((char *)menuItem); continue; } for (ix = 0; ix < WMFUNCTIONTABLESIZE - 1; ++ix) if (functionTable[ix].wmFunction == F_InvokeCommand) break; if (ix == WMFUNCTIONTABLESIZE - 1) { ix = F_NOP_INDEX; menuItem->wmFunction = F_Nop; } else menuItem->wmFunction = F_InvokeCommand; } else /* It must be a menu item label */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ { /* * Parse the menu item label. */ if (!ParseWmLabel (pSD, menuItem, string)) { XtFree ((char *)menuItem); continue; } } /* * Parse any menu function mnemonic. */ ParseWmMnemonic (&lineP, menuItem); /* * Parse any menu function accelerator. */ if (!ParseWmAccelerator (&lineP, menuItem)) { FreeMenuItem (menuItem); continue; } /* * Parse the menu function name if this is not a client * command. If it is a client command, then the wmFunction * field should already be set, as well as the ix variable, * but we do want to search for a menu item name that occupies * the same place as the function does for normal menu items. */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) if (menuItem->wmFunction != NULL) ParseMenuItemName(&lineP, menuItem); else #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ ix = ParseWmFunction (&lineP, CRS_MENU, &menuItem->wmFunction); /* * Determine context sensitivity and applicability mask. */ menuItem->greyedContext = functionTable[ix].greyedContext; menuItem->mgtMask = functionTable[ix].mgtMask; #ifdef PANELIST if ((menuItem->wmFunction == F_Toggle_Front_Panel) && ((wmGD.useFrontPanel == False) || (wmGD.dtSD != pSD))) { /* * disallow this function if there's no front * panel on this screen. */ menuItem->greyedContext |= (F_CONTEXT_ALL | F_SUBCONTEXT_IB_WICON | F_SUBCONTEXT_IB_IICON); } #endif /* PANELIST */ /* * Apply the function argument parser. */ if (!(*(functionTable [ix].parseProc)) (&lineP, menuItem->wmFunction, &menuItem->wmFuncArgs)) { FreeMenuItem (menuItem); continue; /* skip this menu item */ } #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* * If we're working on the f.cci function, this will fix-up * the menuItem entries so that it appears that we read-in * an old-style client-command entry. Eventually, the cci * handling should be changed to make use of the wmFuncArgs. * Note that if DEFAULT_NAME was specified as the label, it * is first set to NULL. * FixMenuItem needs menuSpec since this is when the EXCLUDE * items are stored. */ if (ix == F_CCI_INDEX) { CCIEntryModifier mod = ((CCIFuncArg *)menuItem->wmFuncArgs)->mod; /* first fix the label if needed. */ if (!strcmp(menuItem->label, CCI_USE_DEFAULT_NAME_TAG)) { XtFree(menuItem->label); menuItem->label = NULL; } FixMenuItem(menuSpec, menuItem); if (mod == DELIMIT || mod == DELIMIT_CASCADE || mod == DELIMIT_INLINE) use_separators = True; } /* * If this menu item is supposed to be wrapped in separators, * then create a separator template before the menu item */ if (use_separators) { MenuItem *separator = MakeSeparatorTemplate(TOP_SEPARATOR); if (lastMenuItem != NULL) lastMenuItem->nextMenuItem = separator; else firstMenuItem = separator; lastMenuItem = separator; } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* * Add this item to the menu specification. */ if (lastMenuItem != NULL) /* not first */ { lastMenuItem->nextMenuItem = menuItem; } else { firstMenuItem = menuItem; } lastMenuItem = menuItem; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* If this menu item is supposed to be wrapped in separators * then create a separator template after the menu item */ if (use_separators) { MenuItem *separator = MakeSeparatorTemplate(BOTTOM_SEPARATOR); if (lastMenuItem != NULL) lastMenuItem->nextMenuItem = separator; else firstMenuItem = separator; lastMenuItem = separator; } use_separators = FALSE; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ } return (firstMenuItem); } /* END OF FUNCTION ParseMenuItems */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * StoreExclusion (menuSpec, string) * * * Description: * ----------- * Store the exclusion string in the menuspec. The list of exclusion * strings are used to determine whether an insertion should be disallowed. * * * Inputs: * ------ * menuSpec = the menu specification structure * string = exclusion client command string * * * Outputs: * ------- * Return = nothing * * Comments: * -------- * *************************************<->***********************************/ static void StoreExclusion (MenuSpec *menuSpec, String string) { MenuExclusion *exclusion; exclusion = (MenuExclusion *)XtMalloc(sizeof(MenuExclusion)); exclusion->command_string = XtNewString(string); /* We don't care what order the exclusions are in so stick it at the head of the list because it is easier. */ exclusion->nextExclusion = menuSpec->exclusions; menuSpec->exclusions = exclusion; } /*************************************<->************************************* * * IsClientCommand (string) * * * Description: * ----------- * Determine whether the string is a client command by the prefix * characters. * * * Inputs: * ------ * string = possible client command string * * * Outputs: * ------- * Return = (Boolean) TRUE iff the string is a client command. * Otherwise, FALSE is returned. * * * Comments: * -------- * This function simply checks what the first two or three characters of * the string are. If they match the beginning of a client command * specification, then TRUE is returned. This function does no go on to * parse the rest of the specification. The legal client command beginning * characters are: * * characters: meaning: * ----------------------------------------------- * < simple client command beginning * ->< forced cascade menu * =< client command with separators * ~< exclusion operator * * Assumes: * -------- * There is no leading whitespace on the string * *************************************<->***********************************/ Boolean IsClientCommand (String string) { if (( #ifndef NO_MULTIBYTE mblen ((char *)string, MB_CUR_MAX) == 1 && #endif *string == '<') || (strncmp(string, "-><", 3) == 0) || (strncmp(string, "=<", 2) == 0) || (strncmp(string, "=><", 3) == 0) || (strncmp(string, "~<", 2) == 0)) return(TRUE); return(FALSE); } /*************************************<->************************************* * * ParseClientCommand (linePP, menuSpec, menuitem, string, use_separators) * * * Description: * ----------- * Parse the string and whatever is left of the line to verify whether * correct syntax was used for a client command. Store the client command * string in the menuitem, unless it is an exclusion. If it is an * exclusion, then store the exclusion string in the menuSpec and return * FALSE to indicate that the menuitem is no longer needed. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * menuItem = pointer to MenuItem structure * string = first token of client command * * * Outputs: * ------- * Return = (Boolean) TRUE iff the line is a valid client command * that can used to match insertions. * Otherwise, FALSE is returned meaning that the client * command had incorrect syntax or it was an exclusion, in * which case any useful information was stored in the * menuSpec. * * * Comments: * -------- * This function parses the entire line to determine if correct * syntax was used for the client command. We assume at this point * that the line is a client command. We are just syntax checking. * If the syntax is correct, the client command is stored in the * menuitem structure, in the "label" field. * * Valid syntax for a client command (single quoted characters are * literals): * * modifier = { '->' | '=' | '~' } * reference = '<' { name | '*' } '>' * command = [ modifier ] reference [ { modifier | '.' } reference ]* * name = alpha-numeric string, white space allowed * * Assumes: * -------- * There is no leading whitespace on the string argument * *************************************<->***********************************/ enum { PRS_NO_STATE, PRS_BEGIN, PRS_MODIFIER, PRS_REFERENCE, PRS_SEPARATOR, PRS_END, PRS_ERROR, PRS_MAX_STATES }; /* This table lists for each parse state, the legal states that can be moved to. Each list must end with a PRS_NO_STATE value to terminate the list. */ static int cmd_parse_table[PRS_END][PRS_END] = { /* PRS_NO_STATE */ { PRS_NO_STATE }, /* PRS_BEGIN */ { PRS_MODIFIER, PRS_REFERENCE, PRS_NO_STATE }, /* PRS_MODIFIER */ { PRS_REFERENCE, PRS_NO_STATE }, /* PRS_REFERENCE */ { PRS_SEPARATOR, PRS_END, PRS_NO_STATE }, /* PRS_SEPARATOR */ { PRS_REFERENCE, PRS_NO_STATE }, }; static Boolean ParseClientCommand (unsigned char **linePP, MenuSpec *menuSpec, MenuItem *menuItem, unsigned char *string, Boolean *use_separators) { int token, linelen, i; int state = PRS_BEGIN; String stream, unchanged_stream, exclusion_text; Boolean return_val = FALSE; Boolean exclusion = FALSE; /* this will be set to TRUE if the client command was parsed to be an exclusion command. */ /* Construct one input stream out of the string and the linePP that we were given. */ linelen = strlen((char *)string) + strlen((char *)*linePP) + 1; if ((unchanged_stream = stream = (String) XtMalloc((unsigned int)(sizeof(unsigned char) * linelen))) == NULL) { PWarning (((char *)GETMESSAGE(60, 42, "Insufficient memory for menu item label"))); return (FALSE); } strcpy(stream, (char *) string); strcat(stream, " "); strcat(stream, (char *) *linePP); for (;;) { token = PRS_NO_STATE; while (token == PRS_NO_STATE) { #ifndef NO_MULTIBYTE if (mblen ((char *)stream, MB_CUR_MAX) > 1) { token = PRS_ERROR; continue; } #endif switch (*stream) { case '\0': case '\n': /* We've reached the end of the stream. Return the PRS_END token. */ token = PRS_END; break; case '-': /* This should be a cascade-force modifier */ ++stream; #ifndef NO_MULTIBYTE if (mblen ((char *)stream, MB_CUR_MAX) > 1) { token = PRS_ERROR; continue; } #endif if (*stream == '>') { ++stream; token = PRS_MODIFIER; } else token = PRS_ERROR; break; case '=': /* This is either a separators modifier or a combination separators and cascade-force modifier */ ++stream; #ifndef NO_MULTIBYTE if (mblen ((char *)stream, MB_CUR_MAX) > 1) { token = PRS_ERROR; continue; } #endif if (*stream == '>') ++stream; token = PRS_MODIFIER; *use_separators = TRUE; break; case '~': /* This is a exclude-command modifier */ ++stream; token = PRS_MODIFIER; exclusion = TRUE; /* Setup a pointer to the text following the ~ so we can do matching later for exclusions. */ exclusion_text = stream; break; case '<': /* Skip the open bracket */ ++stream; /* This should be the beginning of a reference. First skip any leading whitespace. */ #ifndef NO_MULTIBYTE if (mblen ((char *)stream, MB_CUR_MAX) > 1) { token = PRS_ERROR; continue; } #endif while ( #ifndef NO_MULTIBYTE mblen ((char *)stream, MB_CUR_MAX) == 1 && #endif (*stream == ' ' || *stream == '\t')) ++stream; #ifndef NO_MULTIBYTE if (mblen ((char *)stream, MB_CUR_MAX) > 1) { token = PRS_ERROR; continue; } #endif /* Now check for a reference name wild card or a full reference name */ if (*stream == '*') ++stream; else { while ( #ifndef NO_MULTIBYTE mblen ((char *)stream, MB_CUR_MAX) == 1 && #endif (isalnum(*stream) || *stream == ' ' || *stream == '\t' || *stream == '_' )) ++stream; } #ifndef NO_MULTIBYTE if (mblen ((char *)stream, MB_CUR_MAX) > 1) { token = PRS_ERROR; continue; } #endif /* Now skip past any trailing white space */ while ( #ifndef NO_MULTIBYTE mblen ((char *)stream, MB_CUR_MAX) == 1 && #endif (*stream == ' ' || *stream == '\t')) ++stream; #ifndef NO_MULTIBYTE if (mblen ((char *)stream, MB_CUR_MAX) > 1) { token = PRS_ERROR; continue; } #endif /* At this point, we should be looking at the close of the reference */ if (*stream == '>') { token = PRS_REFERENCE; ++stream; } else token = PRS_ERROR; break; case '.': /* This is a reference separator */ ++stream; token = PRS_SEPARATOR; break; case ' ': case '\t': /* The only place white space is allowed as at the beginning of the line, after all the client command text and within the delimiters of a REFERENCE. We are guaranteed not to have whitespace at the beginning of the line by the time this function is called. Also, the REFERENCE parsing above handles all white space internal to the client command. Therefore, since we are seeing white space, we must be at the end of the client command. */ token = PRS_END; break; default: token = PRS_ERROR; } /* end switch (*stream) */ } /* end while (token == PRS_NO_STATE) */ /* If we got an error then just return an error */ if (token == PRS_ERROR) { return_val = FALSE; break; } /* Check whether the token we got is a valid transition */ for (i = 0; cmd_parse_table[state][i] != PRS_NO_STATE; ++i) { if (token == cmd_parse_table[state][i]) { /* It is a valid transition, so break out of the loop */ break; } } /* If i is not indexing the NO_STATE value in the parse_table, then the parse succeeded. Check if the new state is PRS_END. If so then we are done. If the state isn't the same as the current token, then we hit a parse error. */ if (cmd_parse_table[state][i] != PRS_NO_STATE) { if (token == PRS_END) { return_val = TRUE; break; } } else { /* parse error */ return_val = FALSE; break; } /* The transition was valid so make the transition by setting the state to be the current token. */ state = token; } /* end for (;;) */ /* If the return_val is TRUE, then the parse succeeded and we want to save the string we parsed into the label field of the menu item. */ if (return_val == TRUE) { /* NULL terminate the string */ *stream = '\0'; /* Check whether this client command was an exclusion. If not, then store the client command string in the menu item. */ if (exclusion == TRUE) { /* Since the command was an exclusion, store the command string in the menuSpec and change the return value to FALSE. */ StoreExclusion(menuSpec, exclusion_text); return_val = FALSE; } else { menuItem->label = XtNewString(unchanged_stream); menuItem->labelType = XmSTRING; } } /* Free the string we allocated and return. */ XtFree((char *)unchanged_stream); return(return_val); } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * ParseWmLabel (pSD, menuItem, string) * * * Description: * ----------- * Parse a menu label string. * * * Inputs: * ------ * pSD = pointer to screen data * menuItem = pointer to MenuItem structure * string = label string * * * Outputs: * ------- * menuItem->label * menuItem->labelType * menuItem->labelBitmapCache * Return = boolean, FALSE iff insufficient memory * * * Comments: * -------- * We have two label types: XmSTRING and XmPIXMAP * We allocate and fill the label field with string and set the type to * XmSTRING. If string = "@", and contains a * with which to build a label image we save the bitmap in the MenuItem * structure and set the type to XmPIXMAP. * *************************************<->***********************************/ static Boolean ParseWmLabel (WmScreenData *pSD, MenuItem *menuItem, unsigned char *string) { /* * Allocate the label field and copy string. */ if ((menuItem->label = (String) XtMalloc ((unsigned int)(strlen ((char *)string) + 1))) == NULL) { PWarning (((char *)GETMESSAGE(60, 13, "Insufficient memory for menu item"))); return (FALSE); } strcpy (menuItem->label, (char *)string); menuItem->labelType = XmSTRING; if (*string == '@') /* * Here: string = "@" * Try to find the label bitmap in the bitmap cache or read the label * bitmap file. */ { string++; /* skip "@" */ #ifdef WSM if ((menuItem->labelBitmapIndex = GetBitmapIndex (pSD, (char *)string, True)) >= 0) #else /* WSM */ if ((menuItem->labelBitmapIndex = GetBitmapIndex (pSD, (char *)string)) >= 0) #endif /* WSM */ { menuItem->labelType = XmPIXMAP; } } return (TRUE); } /* END OF FUNCTION ParseWmLabel */ /*************************************<->************************************* * * ParseWmMnemonic (linePP, menuItem) * * * Description: * ----------- * Parse an optional menu function mnemonic. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * menuItem = pointer to MenuItem structure * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * menuItem->mnemonic = valid mnemonic character or NULL. * * * Comments: * -------- * None. * *************************************<->***********************************/ static void ParseWmMnemonic (unsigned char **linePP, MenuItem *menuItem) { unsigned char *lineP = *linePP; unsigned char *mnemonic; /* * Skip leading white space. */ ScanWhitespace (&lineP); menuItem->mnemonic = (KeySym)NULL; if (*lineP == '_') /* * We have a mnemonic specification. * Get the next string (we only use the first character). * If no string exists, the labelType is not XmSTRING, or does not contain * the first character, then skip the string and return. * Otherwise, accept the first character as a mnemonic. */ { KeySym ks; lineP++; mnemonic = GetString(&lineP); #ifndef NO_MULTIBYTE if (menuItem->labelType == XmSTRING && mnemonic != NULL && (ks = XStringToKeysym((char *)mnemonic)) != NoSymbol && strchr(menuItem->label, (char)(ks & 0xff)) != NULL) { menuItem->mnemonic = ks; } #else if ((mnemonic != NULL) && (*mnemonic != '\0') && (menuItem->labelType == XmSTRING) && (strchr (menuItem->label, *mnemonic) != NULL)) /* valid mnemonic */ { menuItem->mnemonic = *mnemonic; } #endif else { PWarning (((char *)GETMESSAGE(60, 14, "Invalid mnemonic specification"))); } } *linePP = lineP; /* consume any string */ } /* END OF FUNCTION ParseWmMnemonic */ /*************************************<->************************************* * * ParseWmAccelerator (linePP, menuItem) * * * Description: * ----------- * Parse an optional menu function accelerator. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * menuItem = pointer to MenuItem structure * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * menuItem->accelText = pointer to an accelerator string or NULL. * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseWmAccelerator (unsigned char **linePP, MenuItem *menuItem) { unsigned char *lineP; String string; unsigned int eventType; unsigned int state; KeyCode keycode; Boolean status; menuItem->accelState = 0; menuItem->accelKeyCode = 0; menuItem->accelText = NULL; status = TRUE; /* * If linePP contains NULL, then abort. */ if (*linePP == (unsigned char *) NULL) return(FALSE); /* * Skip leading white space. */ ScanWhitespace (linePP); lineP = *linePP; /* * If the second character is not ".", and an accelerator specification * exists, then process and save the specification string. */ if ((*lineP != '\0') && /* something follows */ (*lineP != '!') && /* skip if we have the ! WmFunction */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* skip label name for client command */ ((*lineP != '"') || (menuItem->wmFunction != F_InvokeCommand)) && #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ (*lineP != 'f') && (*(lineP+1) != '.')) /* skip if we have f.xxx WmFunction */ { if (ParseKeyEvent(&lineP, &eventType, &keycode, &state)) { if ((string = (String) XtMalloc ((unsigned int) (lineP - *linePP + 1))) == NULL) { PWarning (((char *)GETMESSAGE(60, 15, "Insufficient memory for accelerator specification"))); status = FALSE; } else /* * Save the accelerator state and keycode. * Process and save the accelerator text. */ { ProcessAccelText (*linePP, lineP, (unsigned char *) string); menuItem->accelState = state; menuItem->accelKeyCode = keycode; menuItem->accelText = string; } } else { PWarning (((char *)GETMESSAGE(60, 16, "Invalid accelerator specification"))); status = FALSE; } *linePP = lineP; /* consume the specification */ } return (status); } /* END OF FUNCTION ParseWmAccelerator */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * ParseMenuItemName (linePP, menuItem) * * * Description: * ----------- * Parse a user defined client command menu item * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * menuItem = pointer to MenuItem structure * * * Outputs: * ------- * menuItem->label will have menu item name appended to it * * Comments: * -------- * This function attempts to find a menu item label string at the end * of the client command specification line. A menu item label string * must be delimited by double quotes. If found, the label string is * appended to the menuItem->label field, after being reallocated to * accommodate the new space requirement. * *************************************<->***********************************/ static void ParseMenuItemName (unsigned char **linePP, MenuItem *menuItem) { unsigned char *lineP, *endquote; #ifndef NO_MULTIBYTE int chlen; #endif /* Skip past any whitespace */ ScanWhitespace (linePP); lineP = *linePP; /* Look for a double quote */ if ( #ifndef NO_MULTIBYTE mblen ((char *)lineP, MB_CUR_MAX) == 1 && #endif *lineP == '"') { /* Move past the first quote. */ ++lineP; endquote = lineP; /* Search for closing quote */ #ifndef NO_MULTIBYTE while (*endquote != '\0' && (chlen = mblen ((char *)endquote, MB_CUR_MAX)) > 0 && (chlen > 1 || *endquote != '"')) { /* If we ran off the end of the line, then just abort. Bad syntax. */ if ((chlen == 1 && *endquote == '\n') || *endquote == '\0') return; endquote += chlen; } if (chlen < 0) return; /* invalid character */ #else while (*endquote != '\0' && *endquote != '"') { if (*endquote == '\n' || *endquote == '\0') return; endquote++; } #endif /* Well, we have a valid menu item name. Store it in the client command name field. Don't include the double quotes. */ menuItem->clientCommandName = XtMalloc(sizeof(char) * (endquote - lineP) + 1); strncpy(menuItem->clientCommandName, (char *) lineP, endquote - lineP); menuItem->clientCommandName[strlen(menuItem->clientCommandName)+1] = '\0'; } else { /* If there was no double quote, then just advance to the end of the line. */ #ifndef NO_MULTIBYTE while (*lineP != '\0' && ((chlen = mblen ((char *)lineP, MB_CUR_MAX)) > 1 || *lineP != '\n')) lineP += chlen > 0 ? chlen : 1; #else while (*lineP != '\0' && *lineP != '\n') lineP++; #endif *linePP = lineP; } } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * int * ParseWmFunction (linePP, res_spec, pWmFunction) * * * Description: * ----------- * Parse a button, key, or menu function name and return its function table * index. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * res_spec = resource specification type (key, button, or menu). * pWmFunction = pointer to window manager function destination. * functionTable = window manager function parse table * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * pWmFunction = pointer to parsed window manager function. * Return = function table index of parsed function. * * * Comments: * -------- * Uses F_Nop if the function name or resource type is invalid. * *************************************<->***********************************/ int ParseWmFunction (unsigned char **linePP, unsigned int res_spec, WmFunction *pWmFunction) { unsigned char *lineP = *linePP; unsigned char *string; register int low, mid, high, cmp; /* * Skip leading white space. */ ScanWhitespace (&lineP); /* * Have function string (may be NULL or a comment). * Handle the special case of '!' */ if (*lineP == '!') { *linePP = ++lineP; *pWmFunction = F_Exec; return (F_EXEC_INDEX); } /* * Identify the function corresponding to the specified name. * Try binary search of the window manager function parse table. * Assume f.nop if the function and resource type cannot be matched. * This handles NULL and comment strings, bad function names, and functions * in inappropriate resource sets. */ string = GetString (&lineP); *linePP = lineP; if (string != NULL) { ToLower (string); low = 0; high = WMFUNCTIONTABLESIZE - 1; while (low <= high) { mid = (low + high)/2; cmp = strcmp (functionTable[mid].funcName, (char *)string); if (!cmp) /* * Function name match * Require proper resource type for the function. */ { if (res_spec & functionTable[mid].resource) { *pWmFunction = functionTable[mid].wmFunction; return (mid); } /* invalid resource: use F_Nop */ break; } /* * Function name mismatch */ if (cmp > 0) { high = mid - 1; } else { low = mid + 1; } } } /* * Not found: assume f.nop */ *pWmFunction = F_Nop; return (F_NOP_INDEX); } /* END OF FUNCTION ParseWmFunction */ /*************************************<->************************************* * * ParseWmFuncMaybeStrArg (linePP, wmFunction, pArgs) * * * Description: * ----------- * Parses a window manager function with a null or string argument. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * wmFunction = function (not used). * pArgs = pointer to argument destination. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * pArgs = pointer to parsed argument string. * Return = FALSE iff insufficient memory * * * Comments: * -------- * Only used to parse arguments for F_Lower, F_Raise, and F_Raise_Lower. * If it is used for any other function, be sure to change FreeMenuItem () * accordingly. * *************************************<->***********************************/ #ifndef PANELIST static #endif Boolean ParseWmFuncMaybeStrArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs) { unsigned char *string = *linePP; unsigned int len; ScanWhitespace (&string); /* if (*lineP == '-') { *linePP = ++lineP; return (ParseWmFuncStrArg (linePP, wmFunction, pArgs)); } */ #ifdef PANELIST #if 0 else if (*lineP == '"' && *(lineP+1) == '-') { /* kill off '-' */ strcpy ((char *) (lineP+1), (char *) (lineP+2)); return (ParseWmFuncStrArg (linePP, wmFunction, pArgs)); } #endif #endif /* PANELIST */ if ((len = strlen ((char *)string)) != 0) { if ((*pArgs = (String)XtMalloc (len + 1)) == NULL) { PWarning (((char *)GETMESSAGE(60, 17, "Insufficient memory"))); return (FALSE); } strcpy (*pArgs, (char *)string); return (TRUE); } else /* Do ParseWmFuncNoArg () */ { *pArgs = NULL; return (TRUE); } } /* END OF FUNCTION ParseWmFuncMaybeStrArg */ /*************************************<->************************************* * * ParseWmFuncNoArg (linePP, wmFunction, pArgs) * * * Description: * ----------- * Parses a window manager function null argument. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * wmFunction = function (not used). * pArgs = pointer to argument destination. * * * Outputs: * ------- * linePP = unchanged * pArgs = NULL * Return = TRUE * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseWmFuncNoArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs) { *pArgs = NULL; return (TRUE); } /* END OF FUNCTION ParseWmFuncNoArg */ /*************************************<->************************************* * * ParseWmFuncStrArg (linePP, wmFunction, pArgs) * * * Description: * ----------- * Parses a window manager function string argument. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * wmFunction = function for which the argument string is intended. * pArgs = pointer to argument string destination. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * pArgs = pointer to parsed argument string. * Return = FALSE iff insufficient memory * * * Comments: * -------- * Insures that an argument for F_Exec() ends in '&' . * Only used to parse arguments for F_Exec, F_Menu, F_Lower, F_Raise, * F_Raise_Lower, and F_Screen. If it is used for any other function, be * sure to change FreeMenuItem () accordingly. * *************************************<->***********************************/ #ifndef PANELIST static #endif Boolean ParseWmFuncStrArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs) { unsigned char *string; unsigned int len; #ifndef NO_MULTIBYTE char *p; wchar_t last; char delim; wchar_t wdelim; int lastlen; #endif if ((string = GetString (linePP)) != NULL) /* nonNULL string argument */ { len = strlen ((char *)string); if ((*pArgs = (String)XtMalloc (len + 2)) == NULL) { PWarning (((char *)GETMESSAGE(60, 17, "Insufficient memory"))); return (FALSE); } strcpy (*pArgs, (char *)string); /* * Insure that an argument for F_Exec ends in '&' . */ #ifndef NO_MULTIBYTE if ((wmFunction == F_Exec)) { lastlen = 0; p = *pArgs; while (*p && ((len = mblen(p, MB_CUR_MAX)) > 0)) { mbtowc(&last, p, MB_CUR_MAX); lastlen = len; p += len; } delim = '&'; mbtowc(&wdelim, &delim, MB_CUR_MAX); if (lastlen == 1 && last != wdelim) { *p++ = '&'; *p = '\0'; } } #else if ((wmFunction == F_Exec) && ((*pArgs)[len - 1] != '&')) { (*pArgs)[len] = '&'; (*pArgs)[len + 1] = '\0'; } #endif } else /* NULL string argument */ { *pArgs = NULL; } return (TRUE); } /* END OF FUNCTION ParseWmFuncStrArg */ /*************************************<->************************************* * * FreeMenuItem (menuItem) * * * Description: * ----------- * This procedure destroys a MenuItem structure. * * * Inputs: * ------ * menuItem = to be destroyed. * * * Outputs: * ------- * None. * * * Comments: * -------- * Assumes that ParseWmFuncStrArg () has parsed a menu item's function * argument only for F_Exec, F_Menu, F_Lower, F_Raise, F_Raise_Lower, and * F_Screen. If it is used for other functions, be sure to include them here! * *************************************<->***********************************/ void FreeMenuItem (MenuItem *menuItem) { if (menuItem->label != NULL) { XtFree ((char *)menuItem->label); } if (menuItem->accelText != NULL) { XtFree ((char *)menuItem->accelText); } /* * If menuItem->wmFuncArgs is nonNULL, we assume that it is a string that * was malloc'ed in ParseWmFuncStrArg () and we free it now. */ if ((menuItem->wmFuncArgs != NULL) && ((menuItem->wmFunction == F_Exec) || (menuItem->wmFunction == F_Menu) || (menuItem->wmFunction == F_Lower) || (menuItem->wmFunction == F_Raise) || (menuItem->wmFunction == F_Raise_Lower) || (menuItem->wmFunction == F_Screen))) { XtFree ((char *)menuItem->wmFuncArgs); } if (menuItem->clientCommandName != NULL) { XtFree ((char *) menuItem->clientCommandName); } XtFree ((char *)menuItem); } /* END OF FUNCTION FreeMenuItem */ /*************************************<->************************************* * * ParseWmFuncGrpArg (linePP, wmFunction, pGroup) * * * Description: * ----------- * Parses a window manager function group argument. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * wmFunction = function for which the group argument is intended. * pGroup = pointer to group argument destination. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * pGroup = pointer to parsed group argument. * Return = FALSE iff invalid group argument. * * * Comments: * -------- * The only valid nonNULL arguments are "icon", "window", and "transient". * *************************************<->***********************************/ static Boolean ParseWmFuncGrpArg (unsigned char **linePP, WmFunction wmFunction, GroupArg *pGroup) { unsigned char *lineP = *linePP; unsigned char *startP; unsigned char grpStr[MAX_GROUP_STRLEN+1]; int len; /* * Parse groups while each is followed by "|". */ *pGroup = 0; while (1) { /* * Skip whitespace and find next group string. */ ScanWhitespace (&lineP); startP = lineP; ScanAlphanumeric (&lineP); if (startP == lineP) /* Group missing => use default or complain */ { if (*pGroup) { PWarning (((char *)GETMESSAGE(60, 18, "Missing group specification"))); return (FALSE); } else { *pGroup = F_GROUP_DEFAULT; break; } } /* * Found a group string; compare it with valid groups. */ len = min (lineP - startP, MAX_GROUP_STRLEN); (void) strncpy ((char *)grpStr, (char *)startP, len); grpStr[len] = '\0'; ToLower (grpStr); if (!strcmp ("icon", (char *)grpStr)) { *pGroup |= F_GROUP_ICON; } else if (!strcmp ("window", (char *)grpStr)) { *pGroup |= F_GROUP_WINDOW; } else if (!strcmp ("transient", (char *)grpStr)) { *pGroup |= F_GROUP_TRANSIENT; } else /* Unknown group name */ { PWarning (((char *)GETMESSAGE(60, 19, "Invalid group specification"))); return (FALSE); } /* * Continue processing until the line is exhausted. * Skip any '|' . */ ScanWhitespace (&lineP); if (lineP == NULL || *lineP == '\0') { break; } else if (*lineP == '|') { lineP++; } } *linePP = lineP; return (TRUE); } /* END OF FUNCTION ParseWmFuncGrpArg */ /*************************************<->************************************* * * ParseWmFuncNbrArg (linePP, wmFunction, pNumber) * * * Description: * ----------- * Parses a window manager function number argument. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * wmFunction = function * pNumber = pointer to number argument destination. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * pNumber = pointer to parsed number argument. * Return = FALSE iff invalid number argument. * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseWmFuncNbrArg (unsigned char **linePP, WmFunction wmFunction, unsigned long *pNumber) { int val; val = StrToNum (GetString (linePP)); if (val == -1) { PWarning (((char *)GETMESSAGE(60, 20, "Invalid number specification"))); *pNumber = 0; return (FALSE); } *pNumber = val; return (TRUE); } /* END OF FUNCTION ParseWmFuncNbrArg */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * ParseWmFuncCCIArgs (linePP, wmFunction, pArgs) * * * Description: * ----------- * Parses a Client-Command entry's arguments. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * wmFunction = function for which the argument string is intended. * pArgs = pointer to argument string destination. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * pArgs = pointer to parsed argument string. * Return = FALSE iff insufficient memory * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseWmFuncCCIArgs (unsigned char **linePP, WmFunction wmFunction, String *pArgs) { /* * Format: * cci_func_args: * cci_entry * modifier cci_entry_list * * cci_entry_list: * cci_entry * cci_entry . cci_entry * * cci_entry: * '<' cci_label '>' * * cci_label: * any combination of alpha and '_' */ CCIEntryModifier mod; CCIFuncArg *cciArg; unsigned char *string; cciArg = XtNew(CCIFuncArg); if ((string = GetString(linePP)) == NULL) { /* Error - no data for f.cci command. cci_entry_list is required. */ fprintf(stderr, "Incorrect format for f.cci command.\n"); return (FALSE); } else { /* check if no modifier was specified. */ if (string[0] == '<') { cciArg->mod = NONE; cciArg->cciEntry = XtNewString((char*)string); } else { if (! GetCCIModifier((String)string, &mod)) { cciArg->mod = NONE; cciArg->cciEntry = XtNewString(""); } else { cciArg->mod = mod; if ((string = GetString(linePP)) == NULL) { /* Found a modifier, but there's no cci_entry_list. */ fprintf(stderr, "Incorrect format for f.cci command.\n"); return(FALSE); } else { cciArg->cciEntry = XtNewString((char*)string); } } } *pArgs = (String)cciArg; } return(TRUE); } /* END OF FUNCTION ParseWmFuncCCIArgs */ #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * ParseButtonStr () * * * Description: * ----------- * This function parses a button set specification string: * * bindings_name * { * button context function * button context function * ... * button context function * } * * * * Inputs: * ------ * pSD->buttonBindings = buttonBindings resource value * functionTable = window manager function parse table * * * Outputs: * ------- * pSD->buttonSpecs = list of button binding specifications. * * * Comments: * -------- * The button set specification name must match pSD->buttonBindings. * *************************************<->***********************************/ void ParseButtonStr (WmScreenData *pSD, unsigned char *buttonStr) { unsigned char *lineP; cfileP = NULL; linec = 0; if (((parseP = buttonStr) != NULL) && (GetNextLine () != NULL)) { lineP = line; ParseButtonSet (pSD, lineP); } } /* END OF FUNCTION ParseButtonStr */ /*************************************<->************************************* * * ParseButtonSet (pSD, lineP) * * * Description: * ----------- * Button set specification found. Parse the following syntax: * * v * Buttons bindings_name * { * button context function * button context function * ... * button context function * } * * * Inputs: * ------ * cfileP = (global) file pointer to fopened configuration file or NULL * line = (global) line buffer * lineP = pointer to current character in line buffer * pSD->buttonBindings = buttonBindings resource value * * * Outputs: * ------- * lineP = pointer to current character in line buffer * pSD->buttonSpecs = list of button binding specifications. * * * Comments: * -------- * Skips unnamed button binding set and sets with names that don't match * the buttonBindings resource. * Skips bad button binding specifications. * *************************************<->***********************************/ static void ParseButtonSet (WmScreenData *pSD, unsigned char *lineP) { unsigned char *string; ButtonSpec *buttonSpec; ButtonSpec *lastButtonSpec; int ix; /* * Parse the button set bindings from the configuration file. * If either the button set name or buttonBindings resource is NULL or * they don't match, then skip this button specification. */ if (((string = GetString (&lineP)) == NULL) || (pSD->buttonBindings == NULL) || strcmp ((char *)string, pSD->buttonBindings)) { return; } /* * Require leading '{' on the next line. */ while ((GetNextLine () != NULL)) /* not EOF nor read error */ { lineP = line; ScanWhitespace(&lineP); if ((lineP == NULL) || (*line == '!') || (*lineP == '\0') || (*lineP == '#')) /* ignore empty or comment line */ { continue; } if (*lineP == '{') /* found '{' */ { break; } /* not a '{' */ PWarning (((char *)GETMESSAGE(60, 21, "Expected '{' after button set name"))); return; } /* * Found leading "{" or EOF. * Prepare to accumulate button bindings by finding the end of * the button specification list. * lastButtonSpec will be NULL only if no prior bindings exist. */ lastButtonSpec = pSD->buttonSpecs; if (lastButtonSpec != NULL) { while (lastButtonSpec->nextButtonSpec != NULL) { lastButtonSpec = (lastButtonSpec->nextButtonSpec); } } /* * Parse "button context function" until "}" or EOF found. * Skips bad button binding specifications. */ while ((GetNextLine () != NULL)) /* not EOF nor read error */ { lineP = line; ScanWhitespace(&lineP); if ((lineP == NULL) || (*line == '!') || (*lineP == '\0') || (*lineP == '#')) /* ignore empty or comment lines */ { continue; } if (*lineP == '}') /* finished with button set */ { break; } /* * Allocate space for the button binding specification. */ if ((buttonSpec = (ButtonSpec *)XtMalloc (sizeof (ButtonSpec))) == NULL) { PWarning (((char *)GETMESSAGE(60, 22, "Insufficient memory for button specification"))); continue; } buttonSpec->wmFunction = (WmFunction)NULL; buttonSpec->wmFuncArgs = NULL; buttonSpec->nextButtonSpec = NULL; /* * Parse the button specification "button". */ lineP = line; if (!ParseBtnEvent(&lineP, &buttonSpec->eventType, &buttonSpec->button, &buttonSpec->state, &buttonSpec->click)) { PWarning (((char *)GETMESSAGE(60, 23, "Invalid button specification"))); XtFree ((char *)buttonSpec); continue; /* skip this button specification */ } /* * Parse the button context. */ if (!ParseContext(&lineP, &buttonSpec->context, &buttonSpec->subContext)) { PWarning (((char *)GETMESSAGE(60, 24, "Invalid button context"))); XtFree ((char *)buttonSpec); continue; /* skip this button specification */ } /* * Parse the button function and any arguments. */ ix = ParseWmFunction (&lineP, CRS_BUTTON, &buttonSpec->wmFunction); /* * remove any subContexts that don't apply to this function */ if ((functionTable[ix].greyedContext & F_SUBCONTEXT_IB_IICON) && (buttonSpec->subContext & F_SUBCONTEXT_IB_IICON)) { buttonSpec->subContext &= ~F_SUBCONTEXT_IB_IICON; } if ((functionTable[ix].greyedContext & F_SUBCONTEXT_IB_WICON) && (buttonSpec->subContext & F_SUBCONTEXT_IB_WICON)) { buttonSpec->subContext &= ~F_SUBCONTEXT_IB_WICON; } /* * Map Button3 menus to BMenu virtual button */ if (buttonSpec->button == Button3 && (buttonSpec->wmFunction == F_Menu || buttonSpec->wmFunction == F_Post_SMenu)) { buttonSpec->button = wmGD.bMenuButton; } /* * Apply the function argument parser. */ if (!(*(functionTable [ix].parseProc)) (&lineP, buttonSpec->wmFunction, &buttonSpec->wmFuncArgs)) { XtFree ((char *)buttonSpec); continue; /* skip this button specification */ } /* * Add the button specification to the button specification list. */ if (lastButtonSpec != NULL) /* a prior specification exists */ { lastButtonSpec->nextButtonSpec = buttonSpec; } else { pSD->buttonSpecs = buttonSpec; } lastButtonSpec = buttonSpec; } } /* END OF FUNCTION ParseButtonSet */ /*************************************<->************************************* * * ParseContext (linePP, context, subContext) * * * Description: * ----------- * Parses a general context string. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * context = context field value * subContext = subContext field value * Return = (Boolean) true iff valid context string * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseContext (unsigned char **linePP, Context *context, Context *subContext) { unsigned char *lineP = *linePP; unsigned char *startP; unsigned char ctxStr[MAX_CONTEXT_STRLEN+1]; int len; /* * Parse contexts while each is followed by "|". */ *context = 0; *subContext = 0; while (1) { /* * Skip whitespace and find next context string. */ ScanWhitespace (&lineP); startP = lineP; ScanAlphanumeric (&lineP); if (startP == lineP) /* ERROR: Context missing */ { return (FALSE); } /* * Found nonNULL string; compare it with valid contexts. */ len = min(lineP - startP, MAX_CONTEXT_STRLEN); (void) strncpy ((char *)ctxStr, (char *)startP, len); ctxStr[len] = '\0'; ToLower (ctxStr); if (!strcmp ("root", (char *)ctxStr)) { *context |= F_CONTEXT_ROOT; *subContext |= F_SUBCONTEXT_R_ALL; } else if (!strcmp ("icon", (char *)ctxStr)) { *context |= (F_CONTEXT_ICON | F_CONTEXT_ICONBOX | F_SUBCONTEXT_IB_IICON | F_SUBCONTEXT_IB_WICON ); *subContext |= (F_SUBCONTEXT_I_ALL | F_SUBCONTEXT_IB_IICON | F_SUBCONTEXT_IB_WICON ); } else if (!strcmp ("window", (char *)ctxStr)) { *context |= F_CONTEXT_WINDOW; *subContext |= F_SUBCONTEXT_W_ALL; } else if (!strcmp ("frame", (char *)ctxStr)) { *context |= F_CONTEXT_WINDOW; *subContext |= F_SUBCONTEXT_W_FRAME; } else if (!strcmp ("title", (char *)ctxStr)) { *context |= F_CONTEXT_WINDOW; *subContext |= F_SUBCONTEXT_W_TITLE; } else if (!strcmp ("border", (char *)ctxStr)) { *context |= F_CONTEXT_WINDOW; *subContext |= F_SUBCONTEXT_W_BORDER; } else if (!strcmp ("app", (char *)ctxStr)) { *context |= F_CONTEXT_WINDOW; *subContext |= F_SUBCONTEXT_W_APP; } #ifdef WSM else if (!strcmp ("ifkey", (char *)ctxStr)) { *context |= F_CONTEXT_IFKEY; } #endif /* WSM */ else /* Unknown context name */ { return (FALSE); } /* continue only if followed by '|' */ ScanWhitespace (&lineP); if (*lineP != '|') { break; } lineP++; } *linePP = lineP; return (TRUE); } /* END OF FUNCTION ParseContext */ /*************************************<->************************************* * * ParseKeyStr () * * * Description: * ----------- * This function parses a key set specification string: * * bindings_name * { * key context function * key context function * ... * key context function * } * * * Inputs: * ------ * pSD->keyBindings = keyBindings resource value * functionTable = window manager function parse table * * * Outputs: * ------- * pSD->keySpecs = list of key binding specification * * * Comments: * -------- * The key set specification name must match pSD->keyBindings. * *************************************<->***********************************/ void ParseKeyStr (WmScreenData *pSD, unsigned char *keyStr) { unsigned char *lineP; cfileP = NULL; linec = 0; if (((parseP = keyStr) != NULL) && (GetNextLine () != NULL)) { lineP = line; ParseKeySet (pSD, lineP); } } /* END OF FUNCTION ParseKeyStr */ /*************************************<->************************************* * * ParseKeySet (pSD, lineP) * * * Description: * ----------- * Key set specification found. Parse the following syntax: * * v * Keys bindings_name * { * key context function * key context function * ... * key context function * } * * * Inputs: * ------ * cfileP = (global) file pointer to fopened configuration file or NULL * line = (global) line buffer * lineP = pointer to current character in line buffer * pSD->keyBindings = keyBindings resource value * * * Outputs: * ------- * lineP = pointer to current character in line buffer * pSD->keySpecs = list of key binding specifications. * * * Comments: * -------- * Skips unnamed key binding set and sets with names that don't match the * keyBindings resource. * Skips bad key binding specifications. * *************************************<->***********************************/ static void ParseKeySet (WmScreenData *pSD, unsigned char *lineP) { unsigned char *string; KeySpec *keySpec; KeySpec *lastKeySpec; unsigned int eventType; int ix; #ifdef WSM Boolean bBadKey; #endif /* WSM */ /* * Parse the key set bindings from the configuration file. * If either the key set name or keyBindings resource is NULL or they * don't match then skip this key specification. */ if (((string = GetString (&lineP)) == NULL) || (pSD->keyBindings == NULL) || strcmp ((char *)string, pSD->keyBindings)) { return; } /* * Require leading '{' on next line. */ while ((GetNextLine () != NULL)) /* not EOF nor read error */ { lineP = line; ScanWhitespace(&lineP); if ((lineP == NULL) || (*line == '!') || (*lineP == '\0') || (*lineP == '#')) /* ignore empty or comment line */ { continue; } if (*lineP == '{') /* found '{' */ { break; } /* not a '{' */ PWarning (((char *)GETMESSAGE(60, 25, "Expected '{' after key set name"))); return; } /* * Found leading "{" or EOF. * Prepare to accumulate key bindings by finding the end of * the key specification list. * lastKeySpec will be NULL only if no prior bindings exist. */ lastKeySpec = pSD->keySpecs; if (lastKeySpec != NULL) { while (lastKeySpec->nextKeySpec != NULL) { lastKeySpec = (lastKeySpec->nextKeySpec); } } /* * Parse "key context function" until "}" or EOF found. * Skip bad key bindings. */ while ((GetNextLine () != NULL)) /* not EOF nor read error */ { lineP = line; ScanWhitespace (&lineP); if ((lineP == NULL) || (*line == '!') || (*lineP == '\0') || (*lineP == '#')) /* ignore empty or comment lines */ { continue; } if (*lineP == '}') /* finished with key set */ { break; } /* * Allocate space for the key specification. */ if ((keySpec = (KeySpec *)XtMalloc (sizeof (KeySpec))) == NULL) { PWarning (((char *)GETMESSAGE(60, 26, "Insufficient memory for key specification"))); continue; } keySpec->wmFunction = (WmFunction)NULL; keySpec->wmFuncArgs = NULL; keySpec->nextKeySpec = NULL; /* * Parse the key specification. */ #ifdef WSM bBadKey = False; #endif /* WSM */ if (!ParseKeyEvent(&lineP, &eventType, &keySpec->keycode, &keySpec->state)) { #ifdef WSM bBadKey = True; #else /* WSM */ PWarning (((char *)GETMESSAGE(60, 27, "Invalid key specification"))); XtFree ((char *)keySpec); continue; /* skip this key specification */ #endif /* WSM */ } /* * Parse the key context. * Here lineP points to the candidate context string. */ if (!ParseContext(&lineP, &keySpec->context, &keySpec->subContext)) { #ifdef WSM if (bBadKey) PWarning (((char *)GETMESSAGE(60, 27, "Invalid key specification"))); #endif /* WSM */ PWarning (((char *)GETMESSAGE(60, 28, "Invalid key context"))); XtFree ((char *)keySpec); continue; /* skip this key specification */ } #ifdef WSM if (bBadKey) { /* * Don't print an error message if this is a "hardware * available" binding. */ if (!(keySpec->context & F_CONTEXT_IFKEY)) PWarning (((char *)GETMESSAGE(60, 27, "Invalid key specification"))); XtFree ((char *)keySpec); continue; /* skip this key specification */ } /* * This flag is only used for parsing, clear it so the * rest of the program doesn't see it. */ keySpec->context &= ~F_CONTEXT_IFKEY; #endif /* WSM */ /* * Parse the key function and any arguments. */ ix = ParseWmFunction (&lineP, CRS_KEY, &keySpec->wmFunction); /* * remove any subContexts that don't apply to this function */ if ((functionTable[ix].greyedContext & F_SUBCONTEXT_IB_IICON) && (keySpec->subContext & F_SUBCONTEXT_IB_IICON)) { keySpec->subContext &= ~F_SUBCONTEXT_IB_IICON; } if ((functionTable[ix].greyedContext & F_SUBCONTEXT_IB_WICON) && (keySpec->subContext & F_SUBCONTEXT_IB_WICON)) { keySpec->subContext &= ~F_SUBCONTEXT_IB_WICON; } /* * Apply the function argument parser. */ if (!(*(functionTable [ix].parseProc)) (&lineP, keySpec->wmFunction, &keySpec->wmFuncArgs)) { XtFree ((char *)keySpec); continue; /* skip this key specification */ } /* * Add the key specification to the key specification list. */ if (lastKeySpec != NULL) /* a prior specification exists */ { lastKeySpec->nextKeySpec = keySpec; } else { pSD->keySpecs = keySpec; } lastKeySpec = keySpec; } } /* END OF FUNCTION ParseKeySet */ #ifndef WSM /*************************************<->************************************* * * GetNextLine () * * * Description: * ----------- * Returns the next line from an fopened configuration file or a newline- * embedded configuration string. * * * Inputs: * ------ * cfileP = (global) file pointer to fopened configuration file or NULL * line = (global) line buffer * linec = (global) line count * parseP = (global) parse string pointer if cfileP == NULL * * * Outputs: * ------- * line = (global) next line * linec = (global) line count incremented * parseP = (global) parse string pointer incremented * Return = line or NULL if file or string is exhausted. * * * Comments: * -------- * If there are more than MAXLINE characters on a line in the file cfileP the * excess are truncated. * Assumes the line buffer is long enough for any parse string line. * *************************************<->***********************************/ unsigned char * GetNextLine (void) { register unsigned char *string; int len; #ifndef NO_MULTIBYTE int chlen; wchar_t last; wchar_t wdelim; char delim; int lastlen; #endif if (cfileP != NULL) /* read fopened file */ { if ((string = (unsigned char *) fgets ((char *)line, MAXLINE, cfileP)) != NULL) { #ifndef NO_MULTIBYTE lastlen = 0; while (*string && ((len = mblen((char *)string, MB_CUR_MAX)) > 0)) { mbtowc(&last, (char *)string, MB_CUR_MAX); lastlen = len; string += len; } delim = '\\'; mbtowc(&wdelim, &delim, MB_CUR_MAX); if (lastlen == 1 && last == wdelim) { do { if (!fgets((char *)string, MAXLINE - (string - line), cfileP)) break; lastlen = 0; while (*string && ((len = mblen((char *)string, MB_CUR_MAX)) > 0)) { mbtowc(&last, (char *)string, MB_CUR_MAX); lastlen = len; string += len; } linec++; } while (lastlen == 1 && last == wdelim); } string = line; #else len = strlen((char *)string) - 2; if ((len > 0) && string[len] == '\\') { do { string = &string[len]; if (fgets((char *)string, MAXLINE - (string-line), cfileP) == NULL) break; len = strlen((char *)string) - 2; linec++; } while ((len >= 0) && string[len] == '\\'); string = line; } #endif } } else if ((parseP != NULL) && (*parseP != '\0')) /* read parse string */ { string = line; #ifndef NO_MULTIBYTE #ifdef FIX_1127 chlen = mblen((char *)parseP, MB_CUR_MAX); if(chlen==-1) string = NULL; #endif while ((*parseP != '\0') && ((chlen = mblen ((char *)parseP, MB_CUR_MAX)) > 0) && (*parseP != '\n')) /* copy all but NULL and newlines to line buffer */ { while (chlen--) { *(string++) = *(parseP++); } } #else while ((*parseP != '\0') && (*parseP != '\n')) /* copy all but end-of-line and newlines to line buffer */ { *(string++) = *(parseP++); } #endif if (string) *string = '\0'; if (*parseP == '\n') { parseP++; } } else { string = NULL; } linec++; return (string); } /* END OF FUNCTION GetNextLine */ #endif /* WSM */ #ifndef PANELIST #ifdef WSM /*************************************<->************************************* * * GetStringC (linePP, SmBehavior) * * * Description: * ----------- * Returns the next quoted or whitespace-terminated nonquoted string in the * line buffer. * Additional functionality added to GetString in that anything in a * quoted string is considered sacred and nothing will be stripped from * the middle of a quoted string. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * SmBehavior = flag that enables parsing session manager hints * if True. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * Return = string * * * Comments: * -------- * May alter the line buffer contents. * Handles quoted strings and characters, removing trailing whitespace from * quoted strings. * Returns NULL string if the line is empty or is a comment. * Code stolen from dtmwm. * *************************************<->***********************************/ #else /* WSM */ /*************************************<->************************************* * * GetString (linePP) * * * Description: * ----------- * Returns the next quoted or whitespace-terminated nonquoted string in the * line buffer. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * Return = string * * * Comments: * -------- * May alter the line buffer contents. * Handles quoted strings and characters, removing trailing whitespace from * quoted strings. * Returns NULL string if the line is empty or is a comment. * *************************************<->***********************************/ #endif /* WSM */ #ifdef WSM unsigned char *GetStringC (unsigned char **linePP, Boolean SmBehavior) #else /* WSM */ unsigned char *GetString (unsigned char **linePP) #endif /* WSM */ { unsigned char *lineP = *linePP; unsigned char *endP; unsigned char *curP; unsigned char *lnwsP; #ifdef WSM unsigned int level = 0, checkLev, i, quoteLevel[10]; #endif /* WSM */ #ifndef NO_MULTIBYTE int chlen; /* get rid of leading white space */ ScanWhitespace (&lineP); /* * Return NULL if line is empty, a comment, or invalid. */ #ifdef WSM if ( *lineP == '\0' || ((chlen = mblen ((char *)lineP, MB_CUR_MAX)) < 1) || ((chlen == 1) && ((*lineP == '!') || ((!SmBehavior) && (*lineP == '#')))) ) #else /* WSM */ if ( *lineP == '\0' || ((chlen = mblen ((char *)lineP, MB_CUR_MAX)) < 1) || ((chlen > 0) && ((*lineP == '!') || (*lineP == '#'))) ) #endif /* WSM */ { *linePP = lineP; return (NULL); } if ((chlen == 1) && (*lineP == '"')) /* Quoted string */ { #ifdef WSM quoteLevel[level] = 1; #endif /* WSM */ /* * Start beyond double quote and find the end of the quoted string. * '\' quotes the next character. * Otherwise, matching double quote or NULL terminates the string. * * We use lnwsP to point to the last non-whitespace character in the * quoted string. When we have found the end of the quoted string, * increment lnwsP and if lnwsP < endP, write NULL into *lnwsP. * This removes any trailing whitespace without overwriting the * matching quote, needed later. If the quoted string was all * whitespace, then this will write a NULL at the beginning of the * string that will be returned -- OK. */ lnwsP = lineP++; /* lnwsP points to first '"' */ curP = endP = lineP; /* other pointers point beyond */ while ((*endP = *curP) && ((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0) && ((chlen > 1) || (*curP != '"'))) /* Haven't found matching quote yet. * First byte of next character has been copied to endP. */ { curP++; if ((chlen == 1) && (*endP == '\\') && ((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0)) /* character quote: * copy first byte of quoted nonNULL character down. * point curP to next byte */ { #ifdef WSM if (SmBehavior) { /* * Check to see if this is a quoted quote - if it is * strip off a level - if not - it's sacred leave it alone */ checkLev = PeekAhead((curP - 1), quoteLevel[level]); if(checkLev > 0) { if(quoteLevel[level] <= checkLev) { level--; } else { level++; quoteLevel[level] = checkLev; } for(i = 0;i < (checkLev - 2);i++) { *endP++ = *curP++;curP++; } *endP = *curP++; } } else { #endif /* WSM */ *endP = *curP++; #ifdef WSM } #endif /* WSM */ } if (chlen == 1) /* Singlebyte character: character copy finished. */ { if (isspace (*endP)) /* whitespace character: leave lnwsP unchanged. */ { endP++; } else /* non-whitespace character: point lnwsP to it. */ { lnwsP = endP++; } } else if (chlen > 1) /* Multibyte (nonwhitespace) character: point lnwsP to it. * Finish character byte copy. */ { lnwsP = endP++; while (--chlen) { *endP++ = *curP++; lnwsP++; } } } #else /* get rid of leading white space */ ScanWhitespace (&lineP); #ifdef WSM /* Return NULL if line is empty, whitespace, or begins with a comment. */ if ((lineP == NULL || *lineP == '\0') || (!SmBehavior && (*lineP == '#'))) #else /* WSM */ /* Return NULL if line is empty, whitespace, or begins with a comment. */ if ((lineP == NULL) || (*lineP == '\0') || (*lineP == '#')) #endif /* WSM */ { *linePP = lineP; return (NULL); } if (*lineP == '"') /* Quoted string */ { #ifdef WSM quoteLevel[level] = 1; #endif /* WSM */ /* * Start beyond double quote and find the end of the quoted string. * '\' quotes the next character. * Otherwise, matching double quote or NULL terminates the string. * * We use lnwsP to point to the last non-whitespace character in the * quoted string. When we have found the end of the quoted string, * increment lnwsP and if lnwsP < endP, write NULL into *lnwsP. * This removes any trailing whitespace without overwriting the * matching quote, needed later. If the quoted string was all * whitespace, then this will write a NULL at the beginning of the * string that will be returned -- OK. */ lnwsP = lineP++; /* lnwsP points to first '"' */ curP = endP = lineP; /* other pointers point beyond */ while ((*endP = *curP) && (*endP != '"')) /* haven't found matching quote yet */ { /* point curP to next character */ curP++; if ((*endP == '\\') && (*curP != '\0')) /* shift quoted nonNULL character down and curP ahead */ { #ifdef WSM if (SmBehavior) { /* * Check to see if this is a quoted quote - if it is * strip off a level - if not - it's sacred leave it alone */ checkLev = PeekAhead((curP - 1), quoteLevel[level]); if(checkLev > 0) { if(quoteLevel[level] <= checkLev) { level--; } else { level++; quoteLevel[level] = checkLev; } for(i = 0;i < (checkLev - 2);i++) { *endP++ = *curP++;curP++; } *endP = *curP++; } } else { #endif /* WSM */ *endP = *curP++; #ifdef WSM } #endif /* WSM */ } if (isspace (*endP)) /* whitespace character: leave lnwsP unchanged. */ { endP++; } else /* non-whitespace character: point lnwsP to it. */ { lnwsP = endP++; } } #endif /* * Found matching quote or NULL. * NULL out any trailing whitespace. */ lnwsP++; if (lnwsP < endP) { *lnwsP = '\0'; } } else /* Unquoted string */ { /* * Find the end of the nonquoted string. * '\' quotes the next character. * Otherwise, whitespace, end-of-line, or '#' terminates the string. */ curP = endP = lineP; #ifndef NO_MULTIBYTE #ifdef WSM while ((*endP = *curP) && ((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0) && ((chlen > 1) || (!isspace (*curP) && (SmBehavior || (*curP != '#'))))) #else /* WSM */ while ((*endP = *curP) && ((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0) && ((chlen > 1) || (!isspace (*curP) && (*curP != '#')))) #endif /* WSM */ /* Haven't found whitespace or '#' yet. * First byte of next character has been copied to endP. */ { curP++; if ((chlen == 1) && (*endP == '\\') && ((chlen = mblen ((char *)curP, MB_CUR_MAX)) > 0)) /* character quote: * copy first byte of quoted nonNULL character down. * point curP to next byte */ { *endP = *curP++; } endP++; if (chlen > 1) /* Multibyte character: finish character copy. */ { while (--chlen) { *endP++ = *curP++; } } } #else #ifdef WSM while ((*endP = *curP) && !isspace (*endP) && (SmBehavior || (*endP != '#'))) #else /* WSM */ while ((*endP = *curP) && !isspace (*endP) && (*endP != '#')) #endif /* WSM */ { /* point curP to next character */ curP++; if ((*endP == '\\') && (*curP != '\0')) /* shift quoted nonNULL character down and curP ahead */ { *endP = *curP++; } endP++; } #endif } /* * Three cases for *endP: * '#' --> write NULL over # and point to NULL * whitespace or * matching quote -> write end-of-line over char and point beyond * NULL -> point to NULL */ #ifdef WSM if (!SmBehavior && (*endP == '#')) #else /* WSM */ if (*endP == '#') #endif /* WSM */ { *endP = '\0'; /* write '\0' over '#' */ *linePP = endP; /* point to '\0' */ } else if (*endP != '\0') { *endP = '\0'; /* write NULL over terminator */ *linePP = ++curP; /* point beyond terminator */ } else { *linePP = endP; } return ((unsigned char *)lineP); } /* END OF FUNCTION GetString */ #endif /* PANELIST */ /*************************************<->************************************* * * ParseBtnEvent (linePP, eventType, button, state, fClick) * * * Description: * ----------- * Parse a button event specification. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer * buttonEvents = (global) button event parse table * modifierStrings = (global) modifier string/mask table * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * eventType = type of event * button = parsed button number * state = composite modifier mask * fClick = is click? * * Return = (Boolean) true iff valid button event specification * * * Comments: * -------- * None. * *************************************<->***********************************/ Boolean ParseBtnEvent (unsigned char **linePP, unsigned int *eventType, unsigned int *button, unsigned int *state, Boolean *fClick) { if (!ParseEvent (linePP, buttonEvents, eventType, button, state, fClick)) { return (FALSE); } /* * The following is a fix for an X11 deficiency in regards to * modifiers in grabs. */ if (*eventType == ButtonRelease) { /* the button that is going up will always be in the modifiers... */ *state |= buttonModifierMasks[*button]; } return (TRUE); } /* END OF FUNCTION ParseBtnEvent */ /*************************************<->************************************* * * ParseKeyEvent (linePP, eventType, keyCode, state) * * * Description: * ----------- * Parse a key event specification. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer * keyEvents = (global) key event parse table * modifierStrings = (global) modifier string/mask table * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * eventType = type of event * keyCode = parsed KeyCode * state = composite modifier mask * * Return = (Boolean) true iff valid key event specification * * * Comments: * -------- * None. * *************************************<->***********************************/ Boolean ParseKeyEvent (unsigned char **linePP, unsigned int *eventType, KeyCode *keyCode, unsigned int *state) { Boolean fClick; unsigned int keySym = 0; if (!ParseEvent (linePP, keyEvents, eventType, &keySym, state, &fClick)) { return (FALSE); } /* * Here keySym is a KeySym. Convert it to a KeyCode. * KeyCode will be set to 0 if keySym is not defined for any KeyCode * (e.g. 0x001). */ *keyCode = XKeysymToKeycode(DISPLAY, (KeySym) keySym); if (*keyCode == 0) { if (keySym == XK_F9) { keySym = XK_KP_F1; } else if (keySym == XK_F10) { keySym = XK_KP_F2; } else if (keySym == XK_F11) { keySym = XK_KP_F3; } else if (keySym == XK_F12) { keySym = XK_KP_F4; } *keyCode = XKeysymToKeycode(DISPLAY, (KeySym) keySym); } return (*keyCode != 0); } /* END OF FUNCTION ParseKeyEvent */ /*************************************<->************************************* * * ParseEvent (linePP, table, eventType, detail, state, fClick) * * * Description: * ----------- * Parse an event specification. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * table = event parse table * modifierStrings = (global) modifier string/mask table * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * eventType = type of event * detail = dependent upon parse table detail procedure and closure * state = composite modifier mask * fClick = click flag * * Return = (Boolean) true iff valid event specification * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseEvent (unsigned char **linePP, EventTableEntry *table, unsigned int *eventType, unsigned int *detail, unsigned int *state, Boolean *fClick) { unsigned char *lineP = *linePP; Cardinal ix; Boolean status; /* Parse the modifiers */ if (!ParseModifiers (&lineP, state) || *lineP != '<') { return (FALSE); } lineP++; /* skip '<' */ /* Parse the event type */ if (!ParseEventType (&lineP, table, eventType, &ix) || *lineP != '>') { return (FALSE); } lineP++; /* skip '>' */ /* * Compute detail and fClick. * Status will be False for a invalid KeySym name. */ status = (*(table[ix].parseProc))(&lineP, table[ix].closure, detail); *fClick = table[ix].fClick; if (status) { *linePP = lineP; } return (status); } /* END OF FUNCTION ParseEvent */ /*************************************<->************************************* * * ParseModifiers(linePP, state) * * * Description: * ----------- * Parses a modifier specification. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * modifierStrings = (global) modifier string/mask table * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * state = composite modifier mask * Return = (Boolean) true iff valid modifier name * * * Comments: * -------- * If successful, will be followed by NULL or '<'. * *************************************<->***********************************/ static Boolean ParseModifiers(unsigned char **linePP, unsigned int *state) { unsigned char *lineP = *linePP; unsigned char *startP; unsigned char modStr[MAX_MODIFIER_STRLEN+1]; Boolean fNot; unsigned int maskBit; int len; *state = 0; /* * Parse modifiers until the event specifier is encountered. */ ScanWhitespace (&lineP); while ((*lineP != '\0') && (*lineP != '<')) { if (*lineP == '~') { fNot = TRUE; lineP++; } else { fNot = FALSE; } startP = lineP; ScanAlphanumeric (&lineP); if (startP == lineP) /* ERROR: Modifier or '<' missing */ { return (FALSE); } len = min(lineP - startP, MAX_MODIFIER_STRLEN); (void) strncpy ((char *)modStr, (char *)startP, len); modStr[len] = '\0'; if (!LookupModifier (modStr, &maskBit)) /* Unknown modifier name */ { return (FALSE); } if (fNot) { *state &= ~maskBit; } else { *state |= maskBit; } ScanWhitespace(&lineP); } *linePP = lineP; return (TRUE); /* must have '<' or NULL following */ } /* END OF FUNCTION ParseModifiers */ /*************************************<->************************************* * * LookupModifier (name, valueP) * * * Description: * ----------- * Return the modifier mask for the provided modifier name. * * * Inputs: * ------ * name = modifier string * modifierStrings = modifier string/mask table * * * Outputs: * ------- * valueP = modifier mask * Return = (Boolean) true iff valid modifier name * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean LookupModifier (unsigned char *name, unsigned int *valueP) { register int i; if (name != NULL) { ToLower (name); for (i=0; modifierStrings[i].name != NULL; i++) { if (!strcmp (modifierStrings[i].name, (char *)name)) { *valueP = modifierStrings[i].mask; return (TRUE); } } } return (FALSE); } /* END OF FUNCTION LookupModifier */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * GetCCIModifier (modString, mod) * * * Description: * ----------- * Return the cci modifier corresponding to the specified string * * * Inputs: * ------ * modString = cci modifier string; may be null * * * Outputs: * ------- * mod = cci modifier. * Return = (Boolean) true iff valid modifier string * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean GetCCIModifier (String modString, CCIEntryModifier *mod) { CCIEntryModifier i; if (modString != NULL) { ToLower ((unsigned char *)modString); for (i=NONE; i<=EXCLUDE; i++) { if (!strcmp (CCIEntryModifierNames[i], modString)) { *mod = i; return (TRUE); } } } return (FALSE); } /* END OF FUNCTION GetCCIModifier */ /*************************************<->************************************* * * FixMenuItem (menuSpec, menuItem) * * * Description: * ----------- * Fix-up the menuItem so that it appears an old-style cci command was * read from the .mwmrc file * * * Inputs: * ------ * menuItem = the menu item structure * menuSpec = the menu specification structure * * * Outputs: * ------- * menuItem = the fixed-up menuitem * menuSpec = the fixed-up menu specification structure if EXCLUDE found * Return = nothing * * Comments: * -------- * *************************************<->***********************************/ static void FixMenuItem (MenuSpec *menuSpec, MenuItem *menuItem) { String tmp; CCIFuncArg *cciArg; if (menuItem == NULL) return; cciArg = (CCIFuncArg *)menuItem->wmFuncArgs; menuItem->clientCommandName = menuItem->label; menuItem->label = cciArg->cciEntry; /* * Fix-up the label to handle the modifier. */ switch (cciArg->mod) { case NONE: break; case INLINE: break; case CASCADE: /* -> */ tmp = (String) XtMalloc(strlen(menuItem->label) + 3); sprintf(tmp, "->%s", menuItem->label); XtFree(menuItem->label); menuItem->label = tmp; break; case DELIMIT: /* = */ tmp = (String) XtMalloc(strlen(menuItem->label) + 2); sprintf(tmp, "=%s", menuItem->label); XtFree(menuItem->label); menuItem->label = tmp; break; case DELIMIT_INLINE: break; case DELIMIT_CASCADE: /* => */ tmp = (String) XtMalloc(strlen(menuItem->label) + 3); sprintf(tmp, "=>%s", menuItem->label); XtFree(menuItem->label); menuItem->label = tmp; break; case EXCLUDE: /* ~ */ StoreExclusion(menuSpec, menuItem->label); tmp = (String) XtMalloc(strlen(menuItem->label) + 2); sprintf(tmp, "~%s", menuItem->label); XtFree(menuItem->label); menuItem->label = tmp; break; } } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * ParseEventType(linePP, table, eventType, ix) * * * Description: * ----------- * Parses the event type string. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * table = event parse table * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * eventType = type of event * ix = table index for matched event * * Return = (Boolean) true iff valid event * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseEventType (unsigned char **linePP, EventTableEntry *table, unsigned int *eventType, Cardinal *ix) { unsigned char *lineP = *linePP; unsigned char *startP = *linePP; unsigned char eventTypeStr[MAX_EVENTTYPE_STRLEN+1]; register int len; /* Parse out the event string */ ScanAlphanumeric (&lineP); /* * Attempt to match the parsed event against our supported event set. */ if (startP != lineP) { len = min (lineP - startP, MAX_EVENTTYPE_STRLEN); (void) strncpy ((char *)eventTypeStr, (char *)startP, len); eventTypeStr[len] = '\0'; ToLower (eventTypeStr); for (len = 0; table[len].event != NULL; len++) if (!strcmp (table[len].event, (char *)eventTypeStr)) { *ix = len; *eventType = table[*ix].eventType; *linePP = lineP; return (TRUE); } } /* Unknown event specified */ return (FALSE); } /* END OF FUNCTION ParseEventType */ /*************************************<->************************************* * * ParseImmed (linePP, closure, detail) * * * Description: * ----------- * Button event detail procedure. * * * Inputs: * ------ * linePP = not used * closure = table entry * * * Outputs: * ------- * detail = pointer to closure * * Return = TRUE * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseImmed (unsigned char **linePP, unsigned int closure, unsigned int *detail) { *detail = closure; return (TRUE); } /* END OF FUNCTION ParseImmed */ /*************************************<->************************************* * * ParseKeySym (linePP, closure, detail) * * * Description: * ----------- * Key event detail procedure. Parses a KeySym string. * * * Inputs: * ------ * linePP = pointer to current line buffer pointer * * closure = not used. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer * detail = pointer to parsed KeySym * * Return = (Boolean) true iff valid KeySym string * * * Comments: * -------- * None. * *************************************<->***********************************/ static Boolean ParseKeySym (unsigned char **linePP, unsigned int closure, unsigned int *detail) { unsigned char *lineP = *linePP; unsigned char *startP; char keySymName[MAX_KEYSYM_STRLEN+1]; int len; #ifndef NO_MULTIBYTE int chlen; #endif ScanWhitespace (&lineP); startP = lineP; #ifndef NO_MULTIBYTE while (*lineP && ((chlen = mblen ((char *)lineP, MB_CUR_MAX)) > 0) && ((chlen > 1) || (!isspace (*lineP) && *lineP != ',' && *lineP != ':'))) { /* Skip next character */ lineP += chlen; } #else while (*lineP && !isspace (*lineP) && *lineP != ',' && *lineP != ':' ) { /* Skip next character */ lineP++; } #endif len = min (lineP - startP, MAX_KEYSYM_STRLEN); (void) strncpy (keySymName, (char *)startP, len); keySymName[len] = '\0'; #ifndef NO_MULTIBYTE if ((*detail = XStringToKeysym(keySymName)) == NoSymbol && (mblen (keySymName, MB_CUR_MAX) == 1)) #else if ((*detail = XStringToKeysym(keySymName)) == NoSymbol) #endif { if (!isdigit (keySymName[0]) || ((*detail = StrToNum ((unsigned char *)&keySymName[0])) == -1)) { *detail = NoSymbol; return (FALSE); } } *linePP = lineP; return (TRUE); } /* END OF FUNCTION ParseKeySym */ /*************************************<->************************************* * * StrToNum(str) * * * Description: * ----------- * Converts a string to an unsigned hexadecimal, decimal, or octal integer. * * * Inputs: * ------ * str = character string * * * Outputs: * ------- * Return = unsigned integer * * * Comments: * -------- * None. * *************************************<->***********************************/ static unsigned int StrToNum(unsigned char *str) { unsigned char c; unsigned int val = 0; if (*str == '0') { str++; if (*str == 'x' || *str == 'X') { return (StrToHex(++str)); } return (StrToOct(str)); } while ((c = *str) != '\0') { if ('0' <= c && c <= '9') { val = val*10+c-'0'; } else { return (-1); } str++; } return (val); } /* END OF FUNCTION StrToNum */ /*************************************<->************************************* * * * * Description: * ----------- * * Inputs: * ------ * * * Outputs: * ------- * * Comments: * -------- * None. * *************************************<->***********************************/ static unsigned int StrToHex(unsigned char *str) { unsigned char c; unsigned int val = 0; while ((c = *str) != '\0') { if ('0' <= c && c <= '9') { val = val*16+c-'0'; } else if ('a' <= c && c <= 'f') { val = val*16+c-'a'+10; } else if ('A' <= c && c <= 'F') { val = val*16+c-'A'+10; } else { return (-1); } str++; } return (val); } /* END OF FUNCTION StrToHex */ /*************************************<->************************************* * * * * Description: * ----------- * * Inputs: * ------ * * * Outputs: * ------- * * Comments: * -------- * None. * *************************************<->***********************************/ static unsigned int StrToOct(unsigned char *str) { unsigned char c; unsigned int val = 0; while ((c = *str) != '\0') { if ('0' <= c && c <= '7') { val = val*8+c-'0'; } else { return (-1); } str++; } return (val); } /* END OF FUNCTION StrToOct */ /*************************************<->************************************* * * ScanAlphanumeric (linePP) * * * Description: * ----------- * Scan string until a non-alphanumeric character is encountered. * * * Inputs: * ------ * linePP = nonNULL pointer to current line buffer pointer * * * Outputs: * ------- * linePP = nonNULL pointer to revised line buffer pointer * * * Comments: * -------- * Assumes linePP is nonNULL * *************************************<->***********************************/ void ScanAlphanumeric (unsigned char **linePP) { #ifndef NO_MULTIBYTE int chlen; while (*linePP && ((chlen = mblen ((char *) *linePP, MB_CUR_MAX)) > 0) && ((chlen > 1) || isalnum (**linePP))) { (*linePP) += chlen; } #else while (*linePP && isalnum (**linePP)) { (*linePP)++; } #endif } /* END OF FUNCTION ScanAlphanumeric */ #ifndef WSM /*************************************<->************************************* * * ScanWhitespace(linePP) * * * Description: * ----------- * Scan the string, skipping over all white space characters. * * * Inputs: * ------ * linePP = nonNULL pointer to current line buffer pointer * * * Outputs: * ------- * linePP = nonNULL pointer to revised line buffer pointer * * * Comments: * -------- * Assumes linePP is nonNULL * *************************************<->***********************************/ void ScanWhitespace(unsigned char **linePP) { #ifndef NO_MULTIBYTE while (*linePP && (mblen ((char *)*linePP, MB_CUR_MAX) == 1) && isspace (**linePP)) #else while (*linePP && isspace (**linePP)) #endif { (*linePP)++; } } /* END OF FUNCTION ScanWhitespace */ #endif /* not WSM */ #ifndef WSM /*************************************<->************************************* * * ToLower (string) * * * Description: * ----------- * Lower all characters in a string. * * * Inputs: * ------ * string = NULL-terminated character string or NULL * * * Outputs: * ------- * string = NULL-terminated lower case character string or NULL * * * Comments: * -------- * None. * *************************************<->***********************************/ void ToLower (unsigned char *string) { unsigned char *pch = string; #ifndef NO_MULTIBYTE int chlen; while (*pch && ((chlen = mblen ((char *)pch, MB_CUR_MAX)) > 0)) { if ((chlen == 1) && (isupper (*pch))) { *pch = tolower(*pch); } pch += chlen; } #else while (*pch != '\0') { if (isupper (*pch)) { *pch = tolower(*pch); } pch++; } #endif } /* END OF FUNCTION ToLower */ #endif /* WSM */ /*************************************<->************************************* * * PWarning (message) * * * Description: * ----------- * This function lists a resource description parse message to stderr. * * * Inputs: * ------ * message = pointer to a message string * cfileP = (global) file pointer to fopened configuration file or NULL * linec = (global) line counter * *************************************<->***********************************/ void PWarning (char *message) { #ifdef WSM char pch[MAXWMPATH+1]; String sMessage; char *pchFile; sMessage = XtNewString ((String) message); if (cfileP != NULL) { if (pConfigStackTop->fileName) { pchFile = pConfigStackTop->fileName; } else { pchFile = wmGD.configFile; } sprintf (pch, pWarningStringFile, GETMESSAGE(20,1,"Workspace Manager"), sMessage, linec, pchFile); } else { sprintf (pch, pWarningStringLine, GETMESSAGE(20,1,"Workspace Manager"), sMessage, linec); } _DtSimpleError (wmGD.mwmName, DtIgnore, NULL, pch, NULL); XtFree (sMessage); #else /* WSM */ if (cfileP != NULL) { fprintf (stderr, ((char *)GETMESSAGE(60, 33, "%s: %s on line %d of configuration file %s\n")), wmGD.mwmName, message, linec, wmGD.configFile ? wmGD.configFile : cfileName); } else { fprintf (stderr, ((char *)GETMESSAGE(60, 34, "%s: %s on line %d of specification string\n")), wmGD.mwmName, message, linec); } fflush (stderr); #endif /* WSM */ } /* END OF FUNCTION PWarning */ #ifdef WSM /* * Key substitution table entry */ typedef struct _keySubs { unsigned char * pchFrom; int lenFrom; unsigned char * pchTo; } KeySub; /*************************************<->************************************* * * InitKeySubs (ppKeySubs, pNumKeySubs) * * * Description: * ----------- * Initialize key label substitutions used in acclerator text * * * Inputs: * ------ * ppKeySubs = ptr to key substitution table ptr * pNumKeySubs = ptr to number of key substitutions * * * Outputs: * ------- * *ppKeySubs = ptr to key substitution table * *pNumKeySubs = number of substitutions found * * Comments: * -------- * *ppKeySubs is allocated with XtMalloc in a complicated way. * If this ever needs to be freed, a function to free it needs to * be written. * *************************************<->***********************************/ static void InitKeySubs ( KeySub **ppKeySubs, int *pNumKeySubs) { int numKS; KeySub *pKS; KeySub *pKSret; unsigned char *pch0; unsigned char *pch1; int len; #ifndef NO_MULTIBYTE int chlen; #endif pch0 = (unsigned char *)GETMESSAGE(60, 40, ""); if ((pch0 == NULL) || (*pch0 == '\0')) { *ppKeySubs = NULL; *pNumKeySubs = 0; return; } pKSret = NULL; numKS = 0; while (*pch0 != '\0') { ScanWhitespace (&pch0); if (*pch0 == '\0') break; /* * allocate space for next key sub */ if (pKSret == NULL) { pKSret = (KeySub *) XtMalloc (1*sizeof(KeySub)); } else { pKSret = (KeySub *) XtRealloc ((char *)pKSret, (numKS+1)*sizeof(KeySub)); } pKS = &pKSret[numKS]; /* get "from" string */ pch1 = pch0; #ifndef NO_MULTIBYTE while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0)) { if ((chlen == 1) && (*pch1 == ' ')) { break; } pch1 += chlen; } #else /* NO_MULTIBYTE */ while (*pch1 && (*pch1 != ' ')) pch1++; #endif /* NO_MULTIBYTE */ pKS->lenFrom = pch1 - pch0; if (pKS->lenFrom < 1) { /* * no "from" string */ break; } pKS->pchFrom = (unsigned char *) XtMalloc (1+pKS->lenFrom); memcpy (pKS->pchFrom, pch0, pKS->lenFrom); pKS->pchFrom[pKS->lenFrom] = '\0'; /* get "to" string */ ScanWhitespace (&pch1); pch0 = pch1; #ifndef NO_MULTIBYTE while (*pch1 && ((chlen = mblen ((char *)pch1, MB_CUR_MAX)) > 0)) { if ((chlen == 1) && (*pch1 == ' ')) { break; } pch1 += chlen; } #else /* NO_MULTIBYTE */ while (*pch1 && (*pch1 != ' ')) pch1++; #endif /* NO_MULTIBYTE */ len = pch1 - pch0; if (len < 1) { /* * Invalid format, "from" string with no "to" string. */ break; } pKS->pchTo = (unsigned char *) XtMalloc (1+len); memcpy (pKS->pchTo, pch0, len); pKS->pchTo[len] = '\0'; /* advance cursor */ pch0 = pch1; /* got one, bump the counter */ numKS++; } *ppKeySubs = pKSret; *pNumKeySubs = numKS; } #endif /* WSM */ /*************************************<->************************************* * * ProcessAccelText (startP, endP, destP) * * * Description: * ----------- * Process accelerator text and copy into string. * * * Inputs: * ------ * startP = pointer to start of valid accelerator specification * endP = pointer past end of accelerator specification * destP = pointer to destination buffer * * * Outputs: * ------- * Destination buffer has processed accelerator text. * * Comments: * -------- * None. * *************************************<->***********************************/ static void ProcessAccelText (unsigned char *startP, unsigned char *endP, unsigned char *destP) { #ifndef NO_MULTIBYTE int chlen; #endif #ifdef WSM static Boolean bAccelInit = False; static KeySub *pKeySub; static int numKeySubs; unsigned char * pchFirst; unsigned char * pchSub; int lenSub; int i; if (!bAccelInit) { InitKeySubs (&pKeySub, &numKeySubs); bAccelInit = True; } #endif /* WSM */ /* * Copy modifiers */ ScanWhitespace (&startP); while (*startP != '<') { if (*startP == '~') { *destP++ = *startP++; } #ifdef WSM pchFirst = startP; #endif /* WSM */ #ifndef NO_MULTIBYTE while (*startP && (((chlen = mblen ((char *)startP, MB_CUR_MAX)) > 1) || isalnum (*startP))) { while (chlen--) { #ifdef WSM startP++; #else /* WSM */ *destP++ = *startP++; #endif /* WSM */ } } #else while (isalnum (*startP)) { #ifdef WSM startP++; #else /* WSM */ *destP++ = *startP++; #endif /* WSM */ } #endif #ifdef WSM /* find substitution */ pchSub = NULL; lenSub = 0; for (i=0; i 0)) { memcpy (destP, pchSub, lenSub); destP += lenSub; } else { memcpy (destP, pchFirst, startP-pchFirst); destP += startP-pchFirst; } #endif /* WSM */ *destP++ = '+'; ScanWhitespace (&startP); } /* * Skip the key event type. */ startP++; /* skip '<' */ while (*startP != '>') { #ifndef NO_MULTIBYTE startP += mblen ((char *)startP, MB_CUR_MAX); #else startP++; #endif } startP++; /* skip '>' */ /* * Copy the KeySym string. */ ScanWhitespace (&startP); while (startP != endP) { *destP++ = *startP++; } *destP = '\0'; } /* END OF FUNCTION ProcessAccelText */ /*************************************<->************************************* * * ProcessCommandLine (argc, argv) * * * Description: * ----------- * This function looks for and processes mwm options in the command line * * Inputs: * ------ * argc = argument count. * argv = argument vector. * * * Outputs: * ------- * Changes global data to based on command line options recognized * * *************************************<->***********************************/ #define SCREENS_OPT "-screens" #define MULTI_SCREEN_OPT "-multiscreen" void ProcessCommandLine (int argc, char *argv[]) { unsigned char *string; int argnum; unsigned char *lineP; for (argnum = 1; argnum < argc; argnum++) { lineP = (unsigned char *) argv[argnum]; if ((string = GetString (&lineP)) == NULL) /* empty or comment line */ { continue; } if (!strcmp((char *)string, MULTI_SCREEN_OPT)) { wmGD.multiScreen = True; wmGD.numScreens = ScreenCount (DISPLAY); } else if (!strcmp((char *)string, SCREENS_OPT)) { argnum++; /* skip to next arg */ ParseScreensArgument (argc, argv, &argnum, lineP); } } } /* END OF FUNCTION ProcessCommandLine */ /*************************************<->************************************* * * ParseScreensArgument (argc, argv, pArgnum, lineP) * * * Description: * ----------- * This function processes the ``-screens'' command line argument * * Inputs: * ------ * argc = argument count. * argv = argument vector. * pArgnum = pointer to argument number where processing left off * lineP = pointer into argv[*pArgnum] where processing left off * * * Outputs: * ------- * Changes global data to based on command line options recognized * + wmGD.screenNames * + wmGD.numScreens * Assumes default screenNames are already in place * *************************************<->***********************************/ static void ParseScreensArgument (int argc, char *argv[], int *pArgnum, unsigned char *lineP) { unsigned char *string; int sNum = 0; int lastLen; int nameCount = 0; for (; (*pArgnum < argc) && (sNum < ScreenCount(DISPLAY)); (*pArgnum)++, sNum++) { lineP = (unsigned char *)argv[*pArgnum]; if (*argv[*pArgnum] == '"') { /* * if Quote, use GetString to strip it */ if ((string = GetString (&lineP)) == NULL) /* empty or comment line */ { continue; } } else { string = (unsigned char *)argv[*pArgnum]; if (*string == '-') { /* another option, end of screens names */ break; } } if (!(wmGD.screenNames[sNum] = (unsigned char *) XtRealloc ((char*)wmGD.screenNames[sNum], 1 + strlen((char *)string)))) { Warning (((char *)GETMESSAGE(60, 31, "Insufficient memory for screen names"))); ExitWM(WM_ERROR_EXIT_VALUE); } else { strcpy((char *)wmGD.screenNames[sNum], (char *)string); nameCount++; } } (*pArgnum)--; /* * remaining screens (if any) get first name specified */ if (nameCount > 0) { lastLen = 1 + strlen((char *)wmGD.screenNames[0]); for (; sNum < ScreenCount(DISPLAY); sNum++) { if (!(wmGD.screenNames[sNum] = (unsigned char *) XtRealloc ((char*)wmGD.screenNames[sNum], lastLen))) { Warning (((char *)GETMESSAGE(60, 32, "Insufficient memory for screen names"))); ExitWM(WM_ERROR_EXIT_VALUE); } else { strcpy((char *)wmGD.screenNames[sNum], (char *)wmGD.screenNames[0]); } } } } /* END OF FUNCTION ParseScreensArgument */ /*************************************<->************************************* * * ProcessMotifBindings () * * * Description: * ----------- * This function is used retrieve the motif input bindings * and put them into a property on the root window. * * *************************************<->***********************************/ void ProcessMotifBindings (void) { char fileName[MAXWMPATH+1]; char *bindings = NULL; #ifndef MOTIF_ONE_DOT_ONE char *homeDir = XmeGetHomeDirName(); #else FILE *fileP; #endif /* * Look in the user's home directory for .motifbind */ #ifdef MOTIF_ONE_DOT_ONE GetHomeDirName(fileName); #else strcpy (fileName, homeDir); #endif strncat(fileName, "/", MAXWMPATH-strlen(fileName)); strncat(fileName, MOTIF_BINDINGS_FILE, MAXWMPATH-strlen(fileName)); #ifdef MOTIF_ONE_DOT_ONE if ((fileP = fopen (fileName, "r")) != NULL) { unsigned char buffer[MBBSIZ]; int count; Boolean first = True; int mode = PropModeReplace; Window propWindow; /* * Get the atom for the property. */ wmGD.xa_MOTIF_BINDINGS = XInternAtom (DISPLAY, _XA_MOTIF_BINDINGS, False); /* * The property goes on the root window of screen zero */ propWindow = RootWindow(DISPLAY, 0); /* * Copy file contents to property on root window of screen 0. */ while ( (count=fread((char *) &buffer[0], 1, MBBSIZ, fileP)) > 0) { XChangeProperty (DISPLAY, propWindow, wmGD.xa_MOTIF_BINDINGS, XA_STRING, 8, mode, &buffer[0], count); if (first) { first = False; mode = PropModeAppend; } } } #else XDeleteProperty (DISPLAY, RootWindow (DISPLAY, 0), XInternAtom (DISPLAY, "_MOTIF_BINDINGS", False)); XDeleteProperty (DISPLAY, RootWindow (DISPLAY, 0), XInternAtom (DISPLAY, "_MOTIF_DEFAULT_BINDINGS", False)); if (_XmVirtKeysLoadFileBindings (fileName, &bindings) == True) { XChangeProperty (DISPLAY, RootWindow(DISPLAY, 0), XInternAtom (DISPLAY, "_MOTIF_BINDINGS", False), XA_STRING, 8, PropModeReplace, (unsigned char *)bindings, strlen(bindings)); } else { _XmVirtKeysLoadFallbackBindings (DISPLAY, &bindings); } XtFree (bindings); #endif } /* END OF FUNCTION ProcessMotifBindings */ #ifdef PANELIST /*************************************<->************************************* * * void * ParseWmFunctionArg (linePP, ix, wmFunc, ppArg, sClientName) * * * Description: * ----------- * Parse the function arguments for a window manager function. * * * Inputs: * ------ * linePP = pointer to line buffer pointer (contains string arg). * ix = window manager function index (returned by ParseWmFunction) * pWmFunction = pointer to window manager function destination. * ppArg = ptr to argument pointer. * sClientName = string name of client * * * Outputs: * ------- * *ppArg = arg to pass to window manager function when invoking. * Return = true on succes, false on some kind of parse error * * * Comments: * -------- * functionTable (window manager function table) is indexed with ix * to get parsing info. * * This function may malloc memory for the returned arg. * * The sClientName is needed for starting some hpterm-based push_recall * clients. It needs to be passed into the action so the hpterm gets * named appropriately. * *************************************<->***********************************/ Boolean ParseWmFunctionArg ( unsigned char **linePP, int ix, WmFunction wmFunc, void **ppArg, String sClientName, String sTitle) { unsigned char *lineP = *linePP; Boolean bValidArg = True; unsigned char *str = NULL; /* * If this is (possibly) a string argument, put it * in quotes so that it will be parsed properly. */ if ((functionTable[ix].parseProc == ParseWmFuncStrArg) || (functionTable[ix].parseProc == ParseWmFuncMaybeStrArg)) { if (lineP && *lineP != '"') { /* * not in quotes, repackage it, escaping the appropriate * characters. */ str = _DtWmParseMakeQuotedString (lineP); if (str) { lineP = str; } } } /* * Apply the function argument parser. */ if ((functionTable[ix].wmFunction != wmFunc) || !(*(functionTable [ix].parseProc)) (&lineP, wmFunc, ppArg)) { bValidArg = False; } /* * Add the exec parms if this is an f.action */ if ((wmFunc == F_Action) && ppArg && *ppArg) { WmActionArg *pAP = (WmActionArg *) *ppArg; int totLen = 0; /* * allocate more than enough string space to copy * strings and intervening spaces. */ if (sClientName && *sClientName) { /* length of: "name=" + sClientName + NULL */ totLen += 5 + strlen(sClientName) + 1; } if (sTitle && *sTitle) { /* length of: "," + "title=" + sTitle + NULL */ totLen += 1 + 6 + strlen(sTitle) + 1; } if (totLen > 0) { pAP->szExecParms = (String) XtMalloc (totLen); /* start with empty string */ pAP->szExecParms[0] = '\0'; if (sClientName && *sClientName) { strcat (pAP->szExecParms, "name="); strcat (pAP->szExecParms, sClientName); } if (sTitle && *sTitle) { if (pAP->szExecParms[0] != '\0') { strcat (pAP->szExecParms, ","); } strcat (pAP->szExecParms, "title="); strcat (pAP->szExecParms, sTitle); } } } if (str) { XtFree ((char *) str); } return (bValidArg); } /* END OF FUNCTION ParseWmFunctionArg */ /*************************************<->************************************* * * SystemCmd (pchCmd) * * * Description: * ----------- * This function fiddles with our signal handling and calls the * system() function to invoke a unix command. * * * Inputs: * ------ * pchCmd = string with the command we want to exec. * * Outputs: * ------- * * * Comments: * -------- * The system() command is touchy about the SIGCLD behavior. Restore * the default SIGCLD handler during the time we run system(). * *************************************<->***********************************/ void SystemCmd (char *pchCmd) { struct sigaction sa; struct sigaction osa; (void) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_DFL; (void) sigaction (SIGCLD, &sa, &osa); system (pchCmd); (void) sigaction (SIGCLD, &osa, (struct sigaction *) 0); } /*************************************<->************************************* * * DeleteTempConfigFileIfAny () * * * Description: * ----------- * This function deletes the temporary config file used to process * old dtwmrc syntax. * * * Inputs: * ------ * * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ void DeleteTempConfigFileIfAny (void) { char pchCmd[MAXWMPATH+1]; if (pConfigStackTop->tempName) { strcpy (pchCmd, "/bin/rm "); strcat (pchCmd, pConfigStackTop->tempName); SystemCmd (pchCmd); XtFree ((char *) pConfigStackTop->tempName); pConfigStackTop->tempName = NULL; } if (pConfigStackTop->cppName) { strcpy (pchCmd, "/bin/rm "); strcat (pchCmd, pConfigStackTop->cppName); SystemCmd (pchCmd); XtFree ((char *) pConfigStackTop->cppName); pConfigStackTop->cppName = NULL; } } /*************************************<->************************************* * * ParseIncludeSet (pSD, lineP) * * * Description: * ----------- * * * Inputs: * ------ * cfileP = (global) file pointer to fopened configuration file or NULL * lineP = pointer to line buffer * line = (global) line buffer * linec = (global) line count * parseP = (global) parse string pointer if cfileP == NULL * pSD->rootWindow = default root window of display * * Outputs: * ------- * linec = (global) line count incremented * parseP = (global) parse string pointer if cfileP == NULL * * * Comments: * -------- * *************************************<->***********************************/ static void ParseIncludeSet (WmScreenData *pSD, unsigned char *lineP) { unsigned char *string; unsigned char *pchName; /* * Require leading '{' on the next line. */ while ((GetNextLine () != NULL)) /* not EOF nor read error */ { lineP = line; ScanWhitespace(&lineP); if ((lineP == NULL) || (*line == '!') || (*lineP == '\0') || (*lineP == '#')) /* ignore empty or comment line */ { continue; } if (*lineP == '{') /* found '{' */ { break; } /* not a '{' */ PWarning (((char *)GETMESSAGE(60, 37, "Expected '{'"))); return; } /* * Found leading "{" or EOF. * Parse include files until "}" or EOF found. */ while ((GetNextLine () != NULL)) { lineP = line; if ((*line == '!') || (string = GetString (&lineP)) == NULL) /* ignore empty or comment lines */ { continue; } if (*string == '}') /* finished with set. */ { break; } pchName = _DtWmParseFilenameExpand (string); if (pchName && ConfigStackPush (pchName)) { ProcessWmFile (pSD, True /* nested */); ConfigStackPop (); XtFree ((char *) pchName); } } } /*************************************<->************************************* * * ConfigStackInit (pchFileName) * * * Description: * ----------- * Initializes the config file processing stack * * Inputs: * ------ * pchFileName = name of new file to start parsing * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ static void ConfigStackInit (char *pchFileName) { pConfigStack = XtNew (ConfigFileStackEntry); if (pConfigStack) { pConfigStackTop = pConfigStack; pConfigStackTop->fileName = XtNewString (pchFileName); pConfigStackTop->tempName = NULL; pConfigStackTop->cppName = NULL; pConfigStackTop->offset = 0; pConfigStackTop->pWmPB = wmGD.pWmPB; pConfigStackTop->wmgdConfigFile = wmGD.configFile; pConfigStackTop->pIncluder = NULL; } else { sprintf ((char *)wmGD.tmpBuffer, (char *)GETMESSAGE(60,36,"Insufficient memory to process included file: %s"), pchFileName); Warning ((char *)wmGD.tmpBuffer); } } /*************************************<->************************************* * * ConfigStackPush (pchFileName) * * * Description: * ----------- * Open an included config file * * Inputs: * ------ * pchFileName = name of new file to start parsing * wmGD.pWmPB = global parse buffer (pickle this) * * Outputs: * ------- * wmGD.pWmPB = global parse buffer (new one for new file) * return = FILE * to open file or NULL * * * Comments: * -------- * *************************************<->***********************************/ static FILE * ConfigStackPush (unsigned char *pchFileName) { ConfigFileStackEntry *pEntry; FILE *pNewFile = NULL; pEntry = XtNew (ConfigFileStackEntry); if (pEntry) { /* save off state of current config file */ pConfigStackTop->offset = ftell (cfileP); pConfigStackTop->pWmPB = wmGD.pWmPB; fclose (cfileP); /* set up state of new config file */ pEntry->fileName = XtNewString ((char *)pchFileName); pEntry->tempName = NULL; pEntry->cppName = NULL; pEntry->wmgdConfigFile = (String) pEntry->fileName; /* set globals for new config file */ wmGD.pWmPB = _DtWmParseNewBuf (); wmGD.configFile = pEntry->wmgdConfigFile; /* put new entry onto stack */ pEntry->pIncluder = pConfigStackTop; pConfigStackTop = pEntry; /* open the file */ pNewFile = cfileP = FopenConfigFile(); if (!pNewFile) { /* file open failed! back out */ ConfigStackPop (); } } else { sprintf ((char *)wmGD.tmpBuffer, (char *)GETMESSAGE(60,36,"Insufficient memory to process included file: %s"), pchFileName); Warning ((char *)wmGD.tmpBuffer); } return (pNewFile); } /*************************************<->************************************* * * ConfigStackPop () * * * Description: * ----------- * * * Inputs: * ------ * pchFileName = name of new file to start parsing * wmGD.pWmPB = global parse buffer (pickle this) * * Outputs: * ------- * wmGD.pWmPB = global parse buffer (new one for new file) * * * Comments: * -------- * assumes cfileP is closed already * *************************************<->***********************************/ static void ConfigStackPop (void) { Boolean error = False; ConfigFileStackEntry *pPrev; char pchCmd[MAXWMPATH+1]; if (pConfigStackTop != pConfigStack) { pPrev = pConfigStackTop->pIncluder; _DtWmParseDestroyBuf (wmGD.pWmPB); if (pConfigStackTop->tempName) { XtFree (pConfigStackTop->tempName); } if (pConfigStackTop->cppName) { strcpy (pchCmd, "/bin/rm "); strcat (pchCmd, pConfigStackTop->cppName); SystemCmd (pchCmd); XtFree ((char *) pConfigStackTop->cppName); pConfigStackTop->cppName = NULL; } if (pConfigStackTop->fileName) { XtFree (pConfigStackTop->fileName); } wmGD.pWmPB = pPrev->pWmPB; wmGD.configFile = pPrev->wmgdConfigFile; if (pPrev->tempName) { cfileP = fopen (pPrev->tempName, "r"); } else if (pPrev->cppName) { cfileP = fopen (pPrev->cppName, "r"); } else { cfileP = fopen (pPrev->fileName, "r"); } if (cfileP) { fseek (cfileP, pPrev->offset, 0); } else { char msg[MAXWMPATH+1]; sprintf(msg, ((char *)GETMESSAGE(60, 39, "Could not reopen configuration file %s")), pPrev->fileName); Warning (msg); } XtFree ((char *)pConfigStackTop); pConfigStackTop = pPrev; } } /*************************************<->************************************* * * ParseWmFuncActionArg (linePP, wmFunction, pArgs) * * * Description: * ----------- * Parses a window manager f.action argument * * * Inputs: * ------ * linePP = pointer to current line buffer pointer. * wmFunction = function for which the argument string is intended. * pArgs = pointer to argument destination. * * * Outputs: * ------- * linePP = pointer to revised line buffer pointer. * pArgs = pointer to parsed argument. * Return = FALSE iff insufficient memory * * * Comments: * -------- * *************************************<->***********************************/ Boolean ParseWmFuncActionArg (unsigned char **linePP, WmFunction wmFunction, String *pArgs) { #define WM_ACTION_ARG_INCREMENT 5 #define WM_ACTION_ARG_PAD 256 unsigned char *string; char *pch; WmActionArg *pAP; int iArgSz; pAP = XtNew (WmActionArg); if (pAP && (string = GetString (linePP)) != NULL) { /* Got action name */ pAP->actionName = XtNewString ((char *) string); /* Get action arguments, if any */ if (pAP->aap = (DtActionArg *) XtMalloc (WM_ACTION_ARG_INCREMENT * sizeof (DtActionArg))) { iArgSz = WM_ACTION_ARG_INCREMENT; pAP->numArgs = 0; while ((string = GetString (linePP)) != NULL) { if (pAP->aap[pAP->numArgs].u.file.name = (char *) XtMalloc(1 + strlen((char *)string))) { pAP->aap[pAP->numArgs].argClass = DtACTION_FILE; /* format the action argument */ pch = pAP->aap[pAP->numArgs].u.file.name; /* * Expand environment variable */ if (string[0] == '$') { string = (unsigned char *) getenv ((char *)&string[1]); if (!string) { break; } else { /* * Make sure there's room for the new * string. */ pch = (char *) XtRealloc (pch, (1+strlen((char *)string))); pAP->aap[pAP->numArgs].u.file.name = pch; } } /* !!! No host name processing is done!!! */ strcpy (pch, (char *)string); pAP->numArgs++; if (pAP->numArgs == iArgSz) { /* need to increase our array space */ iArgSz += WM_ACTION_ARG_INCREMENT; pAP->aap = (DtActionArg *) XtRealloc((char *)pAP->aap, (iArgSz * sizeof (DtActionArg))); if (!pAP->aap) { break; /* out of memory */ } } } else { break; /* out of memory */ } } } pAP->szExecParms = NULL; *pArgs = (String) pAP; } else /* NULL string argument */ { *pArgs = NULL; } return (TRUE); } /* END OF FUNCTION ParseWmFuncActionArg */ #endif /* PANELIST */ #ifdef WSM /*************************************<->************************************* * * PreprocessConfigFile (pSD) * * * Description: * ----------- * This function runs the configuration file through the C * preprocessor * * * Inputs: * ------ * pSD = ptr to screen data * * Outputs: * ------- * * * Comments: * -------- * *************************************<->***********************************/ static void PreprocessConfigFile (void) { #define CPP_NAME_SIZE ((L_tmpnam)+1) char pchCmd[MAXWMPATH+1]; if (wmGD.cppCommand && *wmGD.cppCommand) { /* * Generate a temp file name. */ pConfigStackTop->cppName = XtMalloc (CPP_NAME_SIZE * sizeof(char)); if (pConfigStackTop->cppName) { (void) tmpnam (pConfigStackTop->cppName); /* * Build up the command line. */ strcpy (pchCmd, wmGD.cppCommand); strcat (pchCmd, " "); strcat (pchCmd, pConfigStackTop->fileName); strcat (pchCmd, " "); strcat (pchCmd, pConfigStackTop->cppName); /* * Run the config file through the converter program * and send the output to a temp file. */ SystemCmd (pchCmd); } } } /*************************************<->************************************* * * GetNetworkFileName (char *pchFile) * * * Description: * ----------- * This function returns a local representation for a network * file. * * * Inputs: * ------ * pchFile - pointer to file name of form [:] * * Return: * ------- * String - ptr to allocated string of local file name. If input * is not a network file, the a copy of pchFile is returned. * * * Comments: * -------- * returned file name should be freed with XtFree(). * *************************************<->***********************************/ static String GetNetworkFileName (char *pchFile) { char *pch; char *host_part; char *file_part; char *netfile; char *sName = NULL; char *pchName = NULL; int count; char **pchTok; String sReturn = NULL; char *homeDir; int len; pch = strchr (pchFile, ':'); if (pch) { /* * Expand special chars and find matching file. */ pchTok = (char **)shellscan (pchFile, &count, 0); if ((count == 1) || (count == 2)) { /* one match found */ host_part = pchTok[0]; } else if (count > 2) { /* several matches found, pick one */ host_part = pchTok[1]; } else { host_part = NULL; } if (host_part != NULL) { pch = strchr (host_part, ':'); if (pch) { /* * copy the string so we don't munge data * inside shellscan */ host_part = sName = XtNewString ((String) host_part); pch = strchr (sName, ':'); /* * separate the host and file parts of the * file name */ *pch = '\0'; file_part = pch+1; } else { /* * The colon went away. Hmm... */ file_part = host_part; host_part = NULL; } if ( #ifndef NO_MULTIBYTE (mblen(file_part, MB_CUR_MAX) == 1) && (mblen(file_part+1, MB_CUR_MAX) == 1) && #endif (*file_part == '~') && (*(file_part+1) == '/')) { /* * Replace '~' with $HOME */ homeDir = XmeGetHomeDirName(); len = strlen (host_part) + 1 + strlen (homeDir) + strlen (file_part) + 1; pch = (char *) XtMalloc (len); strcpy (pch, sName); host_part = pch; pch += strlen (pch) + 1; strcpy (pch, homeDir); strcat (pch, file_part+1); file_part = pch; XtFree (sName); sName = host_part; } } else { /* * shellscan had a problem with the file name. * just operate on the name as-is. * temporarily replace ':' with a NULL */ host_part = sName = XtNewString ((String) pchFile); pch = strchr (sName, ':'); *pch = '\0'; host_part = pchFile; file_part = pch+1; } /* convert to canonical host/file name */ netfile = (char *) tt_host_file_netfile (host_part, file_part); if (tt_pointer_error (netfile) == TT_OK) { /* convert to local file name equivalent */ pchName = tt_netfile_file (netfile); if (tt_pointer_error (pchName) == TT_OK) { sReturn = XtNewString ((String) pchName); tt_free ((char *)pchName); } tt_free (netfile); } if (sName) { XtFree ((char *)sName); } } if (sReturn == NULL) { if ( #ifndef NO_MULTIBYTE (mblen(pchFile, MB_CUR_MAX) == 1) && (mblen(pchFile+1, MB_CUR_MAX) == 1) && #endif (*pchFile == '~') && (*(pchFile+1) == '/')) { /* * Replace '~' with $HOME */ homeDir = XmeGetHomeDirName(); len = strlen (homeDir) + strlen (pchFile) + 1; sReturn = (char *) XtMalloc (len); strcpy (sReturn, homeDir); strcat (sReturn, pchFile+1); } else { sReturn = XtNewString ((String) pchFile); } } return (sReturn); } /**************************** eof ***************************/ #endif /* WSM */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * SetGreyedContextAndMgtMask (menuItem, wmFunction) * * * Description: * ----------- * This function sets up the greyed context and management mask * for a menu item based on the menu function passed in. * * Inputs: * ------ * menuItem = the menu item to be set up * wmFunction = the menu function to find in the function table * to determine how to set up the relevant fields * * Outputs: * ------- * The menuItem will have its greyed context and management mask fields * set appropriately. If the given function cannot be found, the fields * will be set to the appropriate values as if the function were F_Nop. * Return = True if the function could be found. False otherwise. * *************************************<->***********************************/ Boolean SetGreyedContextAndMgtMask (MenuItem *menuItem, WmFunction wmFunction) { int ix; for (ix = 0; ix < WMFUNCTIONTABLESIZE - 1; ++ix) { if (functionTable[ix].wmFunction == wmFunction) { /* Success! The function was found. Set up the values and get the heck out of here. */ menuItem->greyedContext = functionTable[ix].greyedContext; menuItem->mgtMask = functionTable[ix].mgtMask; return(True); } } /* We couldn't find the given command in the function table. Set up the values as if the F_Nop function were found and return False. */ menuItem->greyedContext = functionTable[F_NOP_INDEX].greyedContext; menuItem->mgtMask = functionTable[F_NOP_INDEX].mgtMask; return(False); } /*************************************<->************************************* * * MakeSeparatorTemplate () * * * Description: * ----------- * * Inputs: * ------ * * Outputs: * ------- * *************************************<->***********************************/ static MenuItem *MakeSeparatorTemplate (int position) { MenuItem *item; item = (MenuItem *)XtMalloc(sizeof(MenuItem)); /* We use the labelType to determine where this separator is positioned relative to the client command(s) it is surrounding, i.e. TOP or BOTTOM */ item->labelType = position; /* Make it look like a client command: */ item->label = XtNewString(""); item->labelBitmapIndex = -1; item->mnemonic = (KeySym) 0; item->accelState = 0; item->accelKeyCode = (KeyCode) 0; item->accelText = (String) NULL; item->wmFunction = (WmFunction) F_Separator; item->wmFuncArgs = (String) NULL; item->greyedContext = 0; item->mgtMask = 0; item->clientCommandName = (String) NULL; item->nextMenuItem = (MenuItem *) NULL; return(item); } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ motif-2.3.8/clients/mwm/WmWinState.c0000644000175000017500000010504513145162623014242 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.1 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmWinState.c /main/6 1996/06/20 09:39:39 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmICCC.h" #include "WmProtocol.h" /* * include extern functions */ #include "WmCDecor.h" #include "WmFunction.h" #include "WmIDecor.h" #include "WmIPlace.h" #include "WmIconBox.h" #include "WmKeyFocus.h" #ifdef PANELIST #include "WmPanelP.h" /* for typedef in WmManage.h */ #endif /* PANELIST */ #include "WmManage.h" #include "WmProperty.h" #include "WmWinInfo.h" #include "WmWinList.h" #ifdef WSM #include "WmWrkspace.h" #endif /* WSM */ /* * Function Declarations: */ #include "WmWinState.h" #ifdef PANELIST static void SlideWindowOut (ClientData *pCD); #endif /* PANELIST */ static void UnmapClients (ClientData *pCD, unsigned int event_mask); static void SetupWindowStateWithEventMask (ClientData *pCD, int newState, Time setTime, unsigned int event_mask); /* * Global Variables: */ extern int firstTime; /******************************<->************************************* * * SetClientState (pCD, newState, setTime) * * * Description: * ----------- * This function is used to change the state of a client window (between * withdrawn, normal, minimized, maximized). * * * Inputs: * ------ * pCD = This is a pointer to the window data for the window that * is to have its state changed. The fields that are used * are clientState, ... * * newState = This is the state that the client window is to be changed to. * * setTime = timestamp for state setting operations * * * Outputs: * ------- * pCD.clientState = new client state * ******************************<->***********************************/ void SetClientState (ClientData *pCD, int newState, Time setTime) { SetClientStateWithEventMask(pCD, newState, setTime, (unsigned int)0); } /* END OF FUNCTION SetClientState */ void SetClientStateWithEventMask (ClientData *pCD, int newState, Time setTime, unsigned int event_mask) { ClientData *pcdLeader; int currentState; WmScreenData *pSD = PSD_FOR_CLIENT(pCD); #ifdef WSM Boolean notShowing = (newState & UNSEEN_STATE); #endif /* WSM */ currentState = pCD->clientState; if (currentState == newState) { /* no change in state */ return; } /* * Undo the old state and setup the new state. If this is a transient * window then insure that it is put in a state that is compatible * with its transient leader (e.g., it cannot be minimized separately). */ pcdLeader = (pCD->transientLeader) ? FindTransientTreeLeader (pCD) : pCD; #ifdef WSM SetClientWsIndex (pCD); #endif /* WSM */ if (pCD->transientLeader) { if ((pcdLeader->clientState == MINIMIZED_STATE) && (newState != WITHDRAWN_STATE)) { newState = MINIMIZED_STATE; #ifdef WSM if (notShowing) { newState |= UNSEEN_STATE; } #endif /* WSM */ } else if ((newState == MINIMIZED_STATE) && (pcdLeader->clientState != MINIMIZED_STATE)) { if (currentState == WITHDRAWN_STATE) { newState = NORMAL_STATE; #ifdef WSM if (notShowing) { newState |= UNSEEN_STATE; } #endif /* WSM */ } else { newState = currentState; #ifdef WSM if (notShowing) { newState |= UNSEEN_STATE; } #endif /* WSM */ } } if (newState == currentState) { return; } } switch (newState) { #ifdef WSM case UNSEEN_STATE | WITHDRAWN_STATE: #else case WITHDRAWN_STATE: #endif /* WSM */ { /* * Free window manager resources (frame and icon). The * WM_STATE property is set in WithdrawWindow. */ UnManageWindow (pCD); break; } case NORMAL_STATE: case MAXIMIZED_STATE: { SetupWindowStateWithEventMask (pCD, newState, setTime, event_mask); #ifdef WSM XMapWindow (DISPLAY, pCD->client); XMapWindow (DISPLAY, pCD->clientFrameWin); #if defined(PANELIST) WmStopWaiting(); /* in WmIPC.c */ #endif /* PANELIST */ #endif /* WSM */ break; } case MINIMIZED_STATE: { Boolean clientHasFocus; /* * Transient windows are minimized with the rest of the transient * tree, including the transient leader. */ if ((pCD->clientState == NORMAL_STATE) || (pCD->clientState == MAXIMIZED_STATE)) { if ((wmGD.keyboardFocus == pCD) || (pCD->transientChildren && wmGD.keyboardFocus && (pCD == FindTransientTreeLeader (wmGD.keyboardFocus)))) { clientHasFocus = True; } else { clientHasFocus = False; } if (clientHasFocus || ((wmGD.nextKeyboardFocus == pCD) || (pCD->transientChildren && wmGD.keyboardFocus && (pCD == FindTransientTreeLeader (wmGD.nextKeyboardFocus))))) { /* * Give up the keyboard focus when minimized (including * the case in which an associated transient window has * the focus). Immediately remove the focus indication * from the window being minimized. */ if (wmGD.autoKeyFocus && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT)) { AutoResetKeyFocus (pcdLeader, setTime); } else { Do_Focus_Key (NULL, setTime, ALWAYS_SET_FOCUS | WORKSPACE_IF_NULL); } if (clientHasFocus) { SetKeyboardFocus (NULL, 0); } } /* unmap main client and all transients */ UnmapClients (pCD, event_mask); } /* * Display the icon for the minimized client. */ if (ICON_FRAME_WIN(pCD)) { #ifdef WSM if (pCD->clientState & UNSEEN_STATE) { if (pCD->iconWindow) { XMapWindow (DISPLAY, pCD->iconWindow); } XMapWindow (DISPLAY, ICON_FRAME_WIN(pCD)); } ShowAllIconsForMinimizedClient (pCD); #else /* WSM */ ShowIconForMinimizedClient (pSD->pActiveWS, pCD); #endif /* WSM */ } SetClientWMState (pCD, IconicState, MINIMIZED_STATE); if ((pSD->useIconBox) && P_ICON_BOX(pCD)) { if ((pCD->clientFlags & ICON_BOX) && ACTIVE_ICON_TEXT_WIN) { /* * Hide active icon text window and reparent it to * root */ HideActiveIconText((WmScreenData *)NULL); pSD->activeLabelParent = ACTIVE_ROOT; XReparentWindow(DISPLAY, ACTIVE_ICON_TEXT_WIN , ACTIVE_ROOT, 0, 0 ); } if (ICON_FRAME_WIN(pCD)) { /* * force icon appearance in icon box to change */ IconExposureProc (pCD, True); } } break; } #ifdef WSM case UNSEEN_STATE | NORMAL_STATE: case UNSEEN_STATE | MAXIMIZED_STATE: case UNSEEN_STATE | MINIMIZED_STATE: { if (wmGD.keyboardFocus == pCD) { /* * Give up the keyboard focus */ Do_Focus_Key ((ClientData *)NULL, CurrentTime, ALWAYS_SET_FOCUS); SetKeyboardFocus (NULL, 0); } if (!(pCD->clientState & UNSEEN_STATE) && (((pCD->clientState & ~UNSEEN_STATE) == NORMAL_STATE) || ((pCD->clientState & ~UNSEEN_STATE) == MAXIMIZED_STATE))) { /* unmap main client and all transients */ UnmapClients (pcdLeader, event_mask); } if (pCD->clientFrameWin) { if (!P_ICON_BOX(pCD)) { if (ICON_FRAME_WIN(pCD)) { XUnmapWindow (DISPLAY, ICON_FRAME_WIN(pCD)); } if (pCD->iconWindow) XUnmapWindow (DISPLAY, pCD->iconWindow); } } switch (newState & ~UNSEEN_STATE) { case MINIMIZED_STATE: SetClientWMState (pCD, IconicState, newState); break; case NORMAL_STATE: case MAXIMIZED_STATE: default: SetClientWMState (pCD, NormalState, newState); break; } } break; #endif /* WSM */ } } /* END OF FUNCTION SetClientStateWithEventMask */ /*************************************<->************************************* * * SetupWindowStateWithEventMask (pCD, newState, setTime, event_mask) * * * Description: * ----------- * This function is used to setup a client window in the Normal or Maximized * state. * * * Inputs: * ------ * pCD = This is a pointer to the window data for the window that * is to have its state changed. * * newState = This is the state that the client window is to be changed to. * * setTime = timestamp for state setting operations * * event_mask = what to grab to prevent stray events going somewhere * * Outputs: * ------- * pCD.clientState = new client state * *************************************<->***********************************/ static void SetupWindowStateWithEventMask (ClientData *pCD, int newState, Time setTime, unsigned int event_mask) { int currentState; #ifdef WSM int wsI, iplace; WmWorkspaceData *pWS_i; #else /* WSM */ WmWorkspaceData *pWS = PSD_FOR_CLIENT(pCD)->pActiveWS; #endif /* WSM */ WmScreenData *pSD = PSD_FOR_CLIENT(pCD); currentState = pCD->clientState; /* * A transient window is not restored or maximized if the transient leader * is minimized. */ if (newState == NORMAL_STATE) { if (pCD->maxConfig == True) { /* * The configuration function uses maxConfig to determine * what the current configuration is (and then resets * maxConfig) and uses the state paramenter to determine * what the new configuration is. */ ConfigureNewState (pCD); } } else /* MAXIMIZED_STATE */ { if (pCD->maxConfig == False) { ConfigureNewState (pCD); } } if (currentState == MINIMIZED_STATE) { Boolean clearIconFocus; /* * give up keyboard focus */ if ((wmGD.keyboardFocus == pCD) || (wmGD.nextKeyboardFocus == pCD)) { Do_Focus_Key (NULL, setTime, ALWAYS_SET_FOCUS | WORKSPACE_IF_NULL); } if (wmGD.keyboardFocus == pCD) { clearIconFocus = True; } else { clearIconFocus = False; } /* * The wm icon frame window and the client icon window * (if it is being used) are mapped and the client window and * client frame are unmapped. */ if (ICON_FRAME_WIN(pCD)) { if (pSD->useIconBox && P_ICON_BOX(pCD) && !(pCD->clientFlags & ICON_BOX)) { ShowClientIconState(pCD, newState); } else { Boolean doGrab = False; if (event_mask) doGrab = (Success == XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), False, event_mask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime)); XUnmapWindow (DISPLAY, ICON_FRAME_WIN(pCD)); if (pCD->iconWindow) { XUnmapWindow (DISPLAY, pCD->iconWindow); } if (event_mask && doGrab) { XEvent event; XMaskEvent(DISPLAY, event_mask, &event); XUngrabPointer(DISPLAY,CurrentTime); } #ifdef WSM if (wmGD.iconAutoPlace) { for (wsI = 0; wsI < pCD->numInhabited; wsI++) { iplace = pCD->pWsList[wsI].iconPlace; if (iplace != NO_ICON_PLACE) { pWS_i = GetWorkspaceData (pCD->pSD, pCD->pWsList[wsI].wsID); pWS_i->IPData.placeList[iplace].pCD = NULL; } } } #else /* WSM */ if ((wmGD.iconAutoPlace) && (ICON_PLACE(pCD) != NO_ICON_PLACE)) { pWS->IPData.placeList[ICON_PLACE(pCD)].pCD = NULL; } #endif /* WSM */ } if (clearIconFocus) { ClearFocusIndication (pCD, False /*no refresh*/); wmGD.keyboardFocus = NULL; } } } if ((currentState != NORMAL_STATE) && (currentState != MAXIMIZED_STATE)) { /* * Note that maximized state is considered a NormalState in * the ICCC. SetClientWMState also sets the state in the * client data. */ if (currentState == MINIMIZED_STATE) { /* * Raise the window(s) when they are deiconified. */ pCD->clientState = newState; #ifdef WSM wmGD.bSuspendSecondaryRestack = True; #endif /* WSM */ F_Raise (NULL, pCD, NULL); #ifdef WSM wmGD.bSuspendSecondaryRestack = False; #endif /* WSM */ } if ( (!(pCD->clientFlags & ICON_BOX)) || ((pCD->clientFlags & ICON_BOX) && (!(firstTime))) ) { #ifdef PANELIST if ((currentState == WITHDRAWN_STATE) && (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUBPANEL) && !(pCD->transientChildren)) { if (pCD->dtwmBehaviors & DtWM_BEHAVIOR_SUB_RESTORED) { pCD->dtwmBehaviors &= ~DtWM_BEHAVIOR_SUB_RESTORED; pCD->dtwmBehaviors &= ~DtWM_BEHAVIOR_SUBPANEL; XMapWindow (DISPLAY, pCD->client); XMapWindow (DISPLAY, pCD->clientFrameWin); } else { SlideWindowOut (pCD); } } else #endif /* PANELIST */ MapClientWindows (pCD); } /* * Set the WM_STATE property of the window and any associated * transients, along with the clientState value. The call * is made with an indication of NORMAL_STATE to insure * that transient window clientState values are setup * correctly. The top-level window clientState is set later. */ SetClientWMState (pCD, NormalState, NORMAL_STATE); } pCD->clientState = newState; if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) && (currentState == MINIMIZED_STATE) && wmGD.deiconifyKeyFocus) { ClientData *pcdFocus; pcdFocus = FindTransientFocus (pCD); if (pcdFocus) { Do_Focus_Key (pcdFocus, setTime, ALWAYS_SET_FOCUS); } } if ( pSD->useIconBox && P_ICON_BOX(pCD) && (!(pCD->clientFlags & ICON_BOX)) && (ICON_FRAME_WIN(pCD))) { /* * force icon appearance in icon box to change */ IconExposureProc (pCD, True); } } /* END OF FUNCTION SetupWindowStateWithEventMask */ /*************************************<->************************************* * * ConfigureNewState (pcd) * * * Description: * ----------- * Configure the window to a new state * * * Inputs: * ------ * pcd - pointer to client data * * Outputs: * ------- * * * Comments: * -------- * o This is only good for going between NORMAL and MAXIMIZED state. * *************************************<->***********************************/ void ConfigureNewState (ClientData *pcd) { if (pcd->maxConfig) { pcd->maxConfig = FALSE; RegenerateClientFrame(pcd); XResizeWindow (DISPLAY, pcd->client, (unsigned int) pcd->clientWidth, (unsigned int) pcd->clientHeight); } else { XResizeWindow (DISPLAY, pcd->client, (unsigned int) pcd->maxWidth, (unsigned int) pcd->maxHeight); pcd->maxConfig = TRUE; RegenerateClientFrame(pcd); } SendConfigureNotify (pcd); /* * Force repaint if size doesn't change to update frame appearance. */ if ((pcd->clientWidth == pcd->maxWidth) && (pcd->clientHeight == pcd->maxHeight)) { FrameExposureProc (pcd); } } /* END OF FUNCTION ConfigureNewState */ /*************************************<->************************************* * * UnmapClients (pCD, event_mask) * * * Description: * ----------- * Unmap the window(s). The indicated client may be the head of a transient * tree - if it is unmap all windows in the transient tree. * * * Inputs: * ------ * pCD = pointer to client data of window(s) to be unmapped * event_mask = what to grab to prevent stray events going somewhere. Our * passive grab has just been activated -- but it is dropped when the * window is unmapped and the ButtonRelease event can go to the window * now exposed. Avoid this by grabbing the ButtonRelease before the unmap * and swallowing it. * Also done for icon being unmapped. * *************************************<->***********************************/ static void UnmapClients (ClientData *pCD, unsigned int event_mask) { ClientData *pNext; Boolean doGrab = False; pNext = pCD->transientChildren; while (pNext) { /* unmap all children first */ if (pNext->transientChildren) UnmapClients (pNext, (unsigned int) 0); /* then unmap all siblings at this level */ XUnmapWindow (DISPLAY, pNext->clientFrameWin); XUnmapWindow (DISPLAY, pNext->client); pNext->wmUnmapCount++; pNext = pNext->transientSiblings; } if (event_mask) doGrab = (Success == XGrabPointer (DISPLAY, DefaultRootWindow(DISPLAY), False, event_mask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime)); /* unmap this primary window */ XUnmapWindow (DISPLAY, pCD->clientFrameWin); XUnmapWindow (DISPLAY, pCD->client); if (event_mask && doGrab) { XEvent event; XMaskEvent(DISPLAY, event_mask, &event); XUngrabPointer(DISPLAY,CurrentTime); } pCD->wmUnmapCount++; } /* END OF FUNCTION UnmapClients */ /*************************************<->************************************* * * SetClientWMState (pCD, wmState, mwmState) * * * Description: * ----------- * Set a new window manage state for a client window or a tree of transient * client windows. * * Inputs: * ------ * pCD = pointer to client data * * wmState = new state for WM_STATE property * * mwmState = mwm client state * *************************************<->***********************************/ void SetClientWMState (ClientData *pCD, int wmState, int mwmState) { ClientData *pNext; #ifdef WSM Boolean bToUnseen; bToUnseen = (mwmState & UNSEEN_STATE) != 0; mwmState &= ~UNSEEN_STATE; #endif /* WSM */ #ifdef WSM SetClientWsIndex (pCD); #endif /* WSM */ pNext = pCD->transientChildren; while (pNext) { if (pNext->transientChildren) { SetClientWMState (pNext, wmState, mwmState); } #ifdef WSM SetClientWsIndex (pNext); #endif /* WSM */ SetWMState (pNext->client, wmState, ICON_FRAME_WIN(pNext)); if (pNext->maxConfig && mwmState == NORMAL_STATE) { pNext->clientState = MAXIMIZED_STATE; } #ifdef WSM else if (!pNext->maxConfig && mwmState == MAXIMIZED_STATE) { pNext->clientState = NORMAL_STATE; } #endif /* WSM */ else { pNext->clientState = mwmState; } #ifdef WSM if (bToUnseen) pNext->clientState |= UNSEEN_STATE; #endif /* WSM */ pNext = pNext->transientSiblings; } SetWMState (pCD->client, wmState, ICON_FRAME_WIN(pCD)); pCD->clientState = mwmState; #ifdef WSM if (bToUnseen) pCD->clientState |= UNSEEN_STATE; #endif /* WSM */ } /* END OF FUNCTION SetClientWMState */ #ifdef PANELIST #define SLIDE_UP_PERCENTAGE 5 #define SLIDE_UP_DIVISOR (100/SLIDE_UP_PERCENTAGE) #define SLIDE_UP_INTERVAL 15 /******************************<->************************************* * * void SlideOutTimerProc (client_data, id) * * Description: * ----------- * An XtTimerCallbackProc to process slide up mapping of a panel * * Inputs: * ------ * client_data = pointer to a SlideOutRec * * Outputs: * ------- * * * Comments: * -------- ******************************<->***********************************/ void SlideOutTimerProc ( XtPointer client_data, XtIntervalId *id) { SlideOutRec *pSOR = (SlideOutRec *) client_data; Boolean bDone = False; if (pSOR) { /* * compute next increment; */ switch (pSOR->direction) { case SLIDE_NORTH: if (pSOR->mapping) { pSOR->currY -= pSOR->incHeight; pSOR->currHeight += pSOR->incHeight; if ((pSOR->currY < pSOR->pCD->frameInfo.y) || (pSOR->currHeight > pSOR->pCD->frameInfo.height)) { pSOR->currY = pSOR->pCD->frameInfo.y; pSOR->currHeight = pSOR->pCD->frameInfo.height; } bDone = (pSOR->currY == pSOR->pCD->frameInfo.y); } else { pSOR->currY += pSOR->incHeight; if (pSOR->incHeight >= pSOR->currHeight) { pSOR->currHeight = 0; bDone = True; } else { pSOR->currHeight -= pSOR->incHeight; } } break; case SLIDE_SOUTH: if (pSOR->mapping) { pSOR->currHeight += pSOR->incHeight; if (pSOR->currHeight > pSOR->pCD->frameInfo.height) { pSOR->currHeight = pSOR->pCD->frameInfo.height; } bDone = (pSOR->currHeight == pSOR->pCD->frameInfo.height); } else { if (pSOR->incHeight >= pSOR->currHeight) { pSOR->currHeight = 0; bDone = True; } else { pSOR->currHeight -= pSOR->incHeight; } } break; } /* * do next slide-up */ if (pSOR->currHeight > 0) { XMoveResizeWindow (DISPLAY, pSOR->coverWin, pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight); XMoveResizeWindow (DISPLAY, pSOR->pCD->clientFrameWin, pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight); } /* * See if we need to continue */ if (bDone) { if (!pSOR->mapping) { /* Time to really unmanage the slide-up */ XtUnmanageChild (pSOR->wSubpanel); } else { WmSubpanelPosted (DISPLAY1, pSOR->pCD->client); SendConfigureNotify(pSOR->pCD); } /* done! clean up */ XDestroyWindow (DISPLAY, pSOR->coverWin); pSOR->pCD->pSOR = NULL; XtFree ((char *)pSOR); wmGD.iSlideUpsInProgress -= 1; } else { /* re-arm the timer */ XtAppAddTimeOut(wmGD.mwmAppContext, pSOR->interval, SlideOutTimerProc, (XtPointer)pSOR); XSync (DISPLAY, False); } } } /* END OF FUNCTION SlideOutTimerProc */ /*************************************<->************************************* * * SlideWindowOut (pCD) * * * Description: * ----------- * Maps a window with a slide-out effect. * * * Inputs: * ------ * pCD = pointer to client data * * Comment: * ------- * Only supports slide-up or slide-down * *************************************<->***********************************/ static void SlideWindowOut (ClientData *pCD) { SlideOutRec *pSOR; if (pCD->pSOR) { pSOR = pCD->pSOR; /* * Hmmm. We're already sliding this window. * If we're supposed to go in the other direction, * then turn it around. */ if (pSOR->mapping == True) { /* * We're already mapping this guy, ignore this * and finish what we've already got going. */ return; } else { /* * We're not mapping this guy. Reverse course!! */ pSOR->mapping = True; /* insure the client window is mapped */ XMapWindow (DISPLAY, pCD->client); /* handle the rest on the next timeout */ return; } } /* map the primary window */ XMapWindow (DISPLAY, pCD->client); pSOR = (SlideOutRec *) XtMalloc (sizeof(SlideOutRec)); if (pSOR) { /* * Compute this ahead of time so we can check against * the window size. If the window is short, we'll * just map it, avoiding a lot of processing. */ pSOR->incHeight = (Dimension) (DisplayHeight(DISPLAY, SCREEN_FOR_CLIENT(pCD))/SLIDE_UP_DIVISOR); } if ((pCD->slideDirection != SLIDE_NOT) && pSOR && (pSOR->incHeight < pCD->frameInfo.height)) { XSetWindowAttributes window_attribs; XWindowChanges window_changes; unsigned long mask; /* * Set up data for processing slide up */ pSOR->pCD = pCD; pSOR->interval = SLIDE_UP_INTERVAL; pSOR->direction = pCD->slideDirection; pSOR->mapping = True; pSOR->wSubpanel = NULL; pSOR->pCD->pSOR = pSOR; switch (pSOR->direction) { case SLIDE_NORTH: pSOR->incWidth = 0; pSOR->currWidth = pCD->frameInfo.width; pSOR->currHeight = pSOR->incHeight; pSOR->currX = pCD->frameInfo.x; pSOR->currY = pCD->frameInfo.y + (pCD->frameInfo.height - pSOR->currHeight); break; case SLIDE_SOUTH: pSOR->incWidth = 0; pSOR->currWidth = pCD->frameInfo.width; pSOR->currHeight = pSOR->incHeight; pSOR->currX = pCD->frameInfo.x; pSOR->currY = pCD->frameInfo.y; break; } /* * Create screening window to hide the slide-up from button * events until it is all the way up. */ mask = CWOverrideRedirect; window_attribs.override_redirect = True; pSOR->coverWin = XCreateWindow(DISPLAY, RootWindow (DISPLAY, SCREEN_FOR_CLIENT(pCD)), pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight, 0, CopyFromParent,InputOnly,CopyFromParent, mask, &window_attribs); /* * Put screen window above the slide-up client */ mask = CWStackMode | CWSibling; window_changes.stack_mode = Above; window_changes.sibling = pCD->clientFrameWin; XConfigureWindow (DISPLAY, pSOR->coverWin, mask, &window_changes); /* * Start slide-up processing */ XMoveResizeWindow (DISPLAY, pSOR->coverWin, pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight); XMoveResizeWindow (DISPLAY, pCD->clientFrameWin, pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight); XMapWindow (DISPLAY, pSOR->coverWin); XMapWindow (DISPLAY, pCD->clientFrameWin); XSync (DISPLAY, False); XtAppAddTimeOut(wmGD.mwmAppContext, pSOR->interval, SlideOutTimerProc, (XtPointer)pSOR); wmGD.iSlideUpsInProgress += 1; } else { /* * Not sliding because no direction specified or our window * is just a little guy. */ XMapWindow (DISPLAY, pCD->clientFrameWin); if (pSOR) { XtFree ((char *) pSOR); pCD->pSOR = NULL; } } } /* END OF FUNCTION SlideOutWindow */ /*************************************<->************************************* * * SlideSubpanelBackIn (pCD, wSubpanel) * * * Description: * ----------- * Slides a subpanel back in * * * Inputs: * ------ * pCD = pointer to client data * wSubpanel = subpanel widget to unmanage * * Comment: * ------- * *************************************<->***********************************/ void SlideSubpanelBackIn (ClientData *pCD, Widget wSubpanel) { SlideOutRec *pSOR; if (pCD->pSOR) { pSOR = pCD->pSOR; /* * Hmmm. We're already sliding this window. * If we're supposed to go in the other direction, * then turn it around. */ if (pSOR->mapping == False) { /* * We're already unmapping this guy, ignore this * and finish what we've already got going. */ return; } else { /* * We're mapping this guy. Reverse course!! */ pSOR->mapping = False; pSOR->wSubpanel = wSubpanel; /* handle the rest on the next timeout */ return; } } pSOR = (SlideOutRec *) XtMalloc (sizeof(SlideOutRec)); if (pSOR) { /* * Compute this ahead of time to check if our window * is short. If it is, we'll just unmap it, avoiding * a lot of extra work. */ pSOR->incHeight = (Dimension) (DisplayHeight(DISPLAY, SCREEN_FOR_CLIENT(pCD))/SLIDE_UP_DIVISOR); } if ((pCD->slideDirection != SLIDE_NOT) && pSOR && (pSOR->incHeight < pCD->frameInfo.height)) { XSetWindowAttributes window_attribs; XWindowChanges window_changes; unsigned long mask; /* * Set up data for processing slide up */ pSOR->pCD = pCD; pSOR->interval = SLIDE_UP_INTERVAL; pSOR->direction = pCD->slideDirection; pSOR->mapping = False; pSOR->wSubpanel = wSubpanel; pSOR->pCD->pSOR = pSOR; pSOR->incWidth = 0; pSOR->currWidth = pCD->frameInfo.width; pSOR->currHeight = pCD->frameInfo.height; pSOR->currX = pCD->frameInfo.x; pSOR->currY = pCD->frameInfo.y; switch (pSOR->direction) { case SLIDE_NORTH: pSOR->currHeight -= pSOR->incHeight; pSOR->currY += pSOR->incHeight; break; case SLIDE_SOUTH: pSOR->currHeight -= pSOR->incHeight; break; } /* * Create screening window to hide the slide-up from button * events until it is all the way up. */ mask = CWOverrideRedirect; window_attribs.override_redirect = True; pSOR->coverWin = XCreateWindow(DISPLAY, RootWindow (DISPLAY, SCREEN_FOR_CLIENT(pCD)), pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight, 0, CopyFromParent,InputOnly,CopyFromParent, mask, &window_attribs); /* * Put screen window above the slide-up client */ mask = CWStackMode | CWSibling; window_changes.stack_mode = Above; window_changes.sibling = pCD->clientFrameWin; XConfigureWindow (DISPLAY, pSOR->coverWin, mask, &window_changes); /* * Start slide-up processing */ XMapWindow (DISPLAY, pSOR->coverWin); if (pSOR->currHeight > 0) { XMoveResizeWindow (DISPLAY, pCD->clientFrameWin, pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight); XMoveResizeWindow (DISPLAY, pSOR->coverWin, pSOR->currX, pSOR->currY, pSOR->currWidth, pSOR->currHeight); XSync (DISPLAY, False); } XtAppAddTimeOut(wmGD.mwmAppContext, pSOR->interval, SlideOutTimerProc, (XtPointer)pSOR); wmGD.iSlideUpsInProgress += 1; } else { /* * Not sliding because no direction specified or our window * is just a little guy. */ /* Just unmanage the slide-up */ XtUnmanageChild (wSubpanel); if (pSOR) { XtFree ((char *) pSOR); pCD->pSOR = NULL; } } } /* END OF FUNCTION SlideOutWindow */ #endif /* PANELIST */ /*************************************<->************************************* * * MapClientWindows (pCD) * * * Description: * ----------- * Maps the window. If this is a transient tree then all the windows in * the transient tree are mapped. * * * Inputs: * ------ * pCD = pointer to client data * *************************************<->***********************************/ void MapClientWindows (ClientData *pCD) { ClientData *pNext; pNext = pCD->transientChildren; while (pNext) { /* map all transient children first */ if (pNext->transientChildren) { MapClientWindows (pNext); } /* then map all siblings at this level */ XMapWindow (DISPLAY, pNext->client); XMapWindow (DISPLAY, pNext->clientFrameWin); pNext = pNext->transientSiblings; } /* map the primary window */ XMapWindow (DISPLAY, pCD->client); XMapWindow (DISPLAY, pCD->clientFrameWin); } /* END OF FUNCTION MapClientWindows */ /*************************************<->************************************* * * ShowIconForMinimizedClient (pWS, pCD) * * * Description: * ----------- * This function shows the icon for the specified client. If the icon * is in an icon box then the "minimized" icon is displayed. If the icon * is on the root window it is mapped. * * * Inputs: * ------ * pWS = pointer to workspace data * pCD = pointer to client data * *************************************<->***********************************/ void ShowIconForMinimizedClient (WmWorkspaceData *pWS, ClientData *pCD) { WmScreenData *pSD = PSD_FOR_CLIENT(pCD); /* * Handle auto-placement for root icons (icons not in an icon * box). */ if (wmGD.iconAutoPlace && !P_ICON_BOX(pCD)) { if ((ICON_PLACE(pCD) == NO_ICON_PLACE) || ((pWS->IPData.placeList[ICON_PLACE(pCD)].pCD) && (pWS->IPData.placeList[ICON_PLACE(pCD)].pCD != pCD))) { /* * Icon place not defined or occupied by another client, * find a free place to put the icon. */ if ((ICON_PLACE(pCD) = GetNextIconPlace (&pWS->IPData)) == NO_ICON_PLACE) { ICON_PLACE(pCD) = CvtIconPositionToPlace (&pWS->IPData, pCD->clientX, pCD->clientY); } CvtIconPlaceToPosition (&pWS->IPData, ICON_PLACE(pCD), &ICON_X(pCD), &ICON_Y(pCD)); #ifndef WSM XMoveWindow (DISPLAY, ICON_FRAME_WIN(pCD), ICON_X(pCD), ICON_Y(pCD)); #endif /* WSM */ } pWS->IPData.placeList[ICON_PLACE(pCD)].pCD = pCD; } #ifdef WSM /* * If icon on root window and this workspace is active, the * make sure it's in the right place. */ if ((pWS == pSD->pActiveWS) && !P_ICON_BOX(pCD)) { XMoveWindow (DISPLAY, ICON_FRAME_WIN(pCD), ICON_X(pCD), ICON_Y(pCD)); } #endif /* WSM */ if (pCD->iconWindow) { XMapWindow (DISPLAY, pCD->iconWindow); } if ((pSD->useIconBox) && P_ICON_BOX(pCD)) { ShowClientIconState (pCD, MINIMIZED_STATE ); } else { XWindowChanges windowChanges; /* * Map the icon on the screen at the appropriate place in the * window stack. */ if (wmGD.lowerOnIconify) { if ((&pCD->iconEntry != pSD->lastClient) && (pSD->lastClient)) { if (pSD->lastClient->type == MINIMIZED_STATE) { windowChanges.sibling = ICON_FRAME_WIN(pSD->lastClient->pCD); } else { windowChanges.sibling = pSD->lastClient->pCD->clientFrameWin; } windowChanges.stack_mode = Below; XConfigureWindow (DISPLAY, ICON_FRAME_WIN(pCD), (CWSibling | CWStackMode), &windowChanges); MoveEntryInList (pWS, &pCD->iconEntry, False /*on bottom*/, NULL); } } else { windowChanges.sibling = pCD->clientFrameWin; windowChanges.stack_mode = Below; XConfigureWindow (DISPLAY, ICON_FRAME_WIN(pCD), (CWSibling | CWStackMode), &windowChanges); MoveEntryInList (pWS, &pCD->iconEntry, False /*below*/, &pCD->clientEntry); } #ifdef WSM if (pWS == pSD->pActiveWS) { XMapWindow (DISPLAY, ICON_FRAME_WIN(pCD)); } #else /* WSM */ XMapWindow (DISPLAY, ICON_FRAME_WIN(pCD)); #endif /* WSM */ } } /* END OF FUNCTION ShowIconForMinimizedClient */ #ifdef WSM /*************************************<->************************************* * * ShowAllIconsForMinimizedClient (pCD) * * * Description: * ----------- * This function places icons in all the workspaces for the minimized * client. Since there is only one clientState per client (not per * workspace), this loops over all workspace in which the client * resides and places an icon in each. * * * Inputs: * ------ * pCD = pointer to client data * * Comments: * --------- * This operates by setting up the currentWsc index for each workspace * and calling ShowIconForMinimizedClient, which makes heavy use of * the macros that use the currentWsc index. * *************************************<->***********************************/ void ShowAllIconsForMinimizedClient (ClientData *pCD) { int saveWsc = pCD->currentWsc; int tmpWsc; WmWorkspaceData *pWS; for (tmpWsc = 0; tmpWsc < pCD->numInhabited; tmpWsc++) { pCD->currentWsc = tmpWsc; pWS = GetWorkspaceData (PSD_FOR_CLIENT(pCD), pCD->pWsList[tmpWsc].wsID); ShowIconForMinimizedClient(pWS, pCD); } pCD->currentWsc = saveWsc; } /* END OF FUNCTION ShowAllIconsForMinimizedClient */ #endif /* WSM */ motif-2.3.8/clients/mwm/WmWinInfo.h0000644000175000017500000000500713145162623014057 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ extern void FindClientPlacement (ClientData *pCD); extern void FixWindowConfiguration (ClientData *pCD, unsigned int *pWidth, unsigned int *pHeight, unsigned int widthInc, unsigned int heightInc); extern void FixWindowSize (ClientData *pCD, unsigned int *pWidth, unsigned int *pHeight, unsigned int widthInc, unsigned int heightInc); extern ClientData *GetClientInfo (WmScreenData *pSD, Window clientWindow, long manageFlags); extern ClientData *GetWmClientInfo (WmWorkspaceData *pWS, ClientData *pCD, long manageFlags); extern void CalculateGravityOffset (ClientData *pCD, int *xoff, int *yoff); extern Boolean InitClientPlacement (ClientData *pCD, long manageFlags); extern void InitCColormapData (ClientData *pCD); extern void MakeSystemMenu (ClientData *pCD); extern void PlaceFrameOnScreen (ClientData *pCD, int *pX, int *pY, int w, int h); extern void PlaceIconOnScreen (ClientData *pCD, int *pX, int *pY); extern void ProcessMwmHints (ClientData *pCD); extern void ProcessWmClass (ClientData *pCD); extern void ProcessWmHints (ClientData *pCD, Boolean firstTime); extern void ProcessWmIconTitle (ClientData *pCD, Boolean firstTime); extern void ProcessWmNormalHints (ClientData *pCD, Boolean firstTime, long manageFlags); extern void ProcessWmTransientFor (ClientData *pCD); extern void ProcessWmWindowTitle (ClientData *pCD, Boolean firstTime); extern Boolean SetupClientIconWindow (ClientData *pCD, Window window); extern Boolean WmGetWindowAttributes (Window window); extern void ProcessSmClientID (ClientData *pCD); extern void ProcessWmSaveHint (ClientData *pCD); motif-2.3.8/clients/mwm/WmError.c0000644000175000017500000002073613145162623013600 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmError.c /main/6 1996/10/07 14:27:34 drk $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include #ifdef WSM #include
#endif /* WSM */ #include "WmXSMP.h" /* * Function Declarations: */ #include "WmError.h" #ifdef DEBUG #define E_MAJOR_CODE 0 #define E_MINOR_CODE 1 #define E_RESOURCE_ID 2 #define E_ERROR_SERIAL 3 #define E_CURRENT_SERIAL 4 #define NUM_E_STRINGS 5 static char *pchErrorFormatNames [NUM_E_STRINGS] = { "MajorCode", "MinorCode", "ResourceID", "ErrorSerial", "CurrentSerial" }; static char *pchDefaultErrorFormat [NUM_E_STRINGS] = { " %d ", " %d ", " %ld ", " %ld ", " %ld " }; static char *pchErrorFormat [NUM_E_STRINGS]; #endif /* DEBUG */ /*************************************<->************************************* * * WmInitErrorHandler (display) * * * Description: * ----------- * This function initializes the window manager error handler. * * * Inputs: * ------ * display = display we're talking about * ------- * *************************************<->***********************************/ void WmInitErrorHandler (Display *display) { #ifdef DEBUG char buffer[BUFSIZ]; int i; /* * Fetch the X error format strings from XErrorDB */ for (i = 0; i< NUM_E_STRINGS; i++) { XGetErrorDatabaseText (display, "XlibMessage", pchErrorFormatNames[i], pchDefaultErrorFormat[i], buffer, BUFSIZ); if ((pchErrorFormat[i] = (char *) XtMalloc (1+strlen(buffer))) == NULL) { Warning ("Insufficient memory for error message initialization."); ExitWM (1); } strcpy(pchErrorFormat[i], buffer); } #endif /* DEBUG */ XSetErrorHandler (WmXErrorHandler); XSetIOErrorHandler (WmXIOErrorHandler); XtSetWarningHandler (WmXtWarningHandler); XtSetErrorHandler (WmXtErrorHandler); } /* END OF FUNCTION WmInitErrorHandler */ /*************************************<->************************************* * * WmXErrorHandler (display, errorEvent) * * * Description: * ----------- * This function is the X error handler that is registered with X to * handle X errors resulting from window management activities. * * * Inputs: * ------ * display = display on which X error occurred * * errorEvent = pointer to a block of information describing the error * * * Outputs: * ------- * wmGD.errorFlag = set to True * * Return = 0 * *************************************<->***********************************/ int WmXErrorHandler (Display *display, XErrorEvent *errorEvent) { ClientData *pCD; #ifdef DEBUG char buffer[BUFSIZ]; char message[BUFSIZ]; XGetErrorText (display, errorEvent->error_code, buffer, BUFSIZ); Warning ("X error occurred during window management operation"); fprintf (stderr, "Description = '%s'\n ", buffer); fprintf (stderr, pchErrorFormat[E_MAJOR_CODE], errorEvent->request_code); sprintf(message, "%d", errorEvent->request_code); XGetErrorDatabaseText (display, "XRequest", message, " ", buffer, BUFSIZ); fprintf (stderr, " (%s)\n ", buffer); fprintf (stderr, pchErrorFormat[E_MINOR_CODE], errorEvent->minor_code); fprintf (stderr, "\n "); fprintf (stderr, pchErrorFormat[E_RESOURCE_ID], errorEvent->resourceid); fprintf (stderr, "\n "); fprintf (stderr, pchErrorFormat[E_ERROR_SERIAL], errorEvent->serial); fprintf (stderr, "\n "); fprintf (stderr, pchErrorFormat[E_CURRENT_SERIAL], LastKnownRequestProcessed(display)); fprintf (stderr, "\n"); #endif /* DEBUG */ /* * Check for a BadWindow error for a managed window. If this error * is detected indicate in the client data that the window no longer * exists. */ if ((errorEvent->error_code == BadWindow) && !XFindContext (DISPLAY, errorEvent->resourceid, wmGD.windowContextType, (caddr_t *)&pCD)) { if (errorEvent->resourceid == pCD->client) { pCD->clientFlags |= CLIENT_DESTROYED; } } wmGD.errorFlag = True; wmGD.errorResource = errorEvent->resourceid; wmGD.errorRequestCode = errorEvent->request_code; return (0); } /* END OF FUNCTION WmXErrorHandler */ /*************************************<->************************************* * * WmXIOErrorHandler (display) * * * Description: * ----------- * This function is the X IO error handler that is registered with X to * handle X IO errors. This function exits the window manager. * * * Inputs: * ------ * display = X display on which the X IO error occurred * *************************************<->***********************************/ int WmXIOErrorHandler (Display *display) { char err[100]; sprintf (err, "%s: %s\n", "I/O error on display:", XDisplayString(display)); Warning(err); ExitWM (WM_ERROR_EXIT_VALUE); /*NOTREACHED*/ return 1; } /* END OF FUNCTIONS WmXIOErrorHandler */ /*************************************<->************************************* * * WmXtErrorHandler (message) * * * Description: * ----------- * This function is registered as the X Toolkit fatal error handler. * * * Inputs: * ------ * message = pointer to an error message * *************************************<->***********************************/ void WmXtErrorHandler (char *message) { Warning (message); ExitWM (WM_ERROR_EXIT_VALUE); } /* END OF FUNCTION WmXtErrorHandler */ /*************************************<->************************************* * * WmXtWarningHandler (message) * * * Description: * ----------- * This function is registered as an X Toolkit warning handler. * * * Inputs: * ------ * message = pointer to a warning message * *************************************<->***********************************/ void WmXtWarningHandler (char *message) { #ifdef DEBUG Warning (message); #endif /* DEBUG */ } /* END OF FUNCTIONS WmXtWarningHandler */ /*************************************<->************************************* * * Warning (message) * * * Description: * ----------- * This function lists a message to stderr. * * * Inputs: * ------ * message = pointer to a message string * *************************************<->***********************************/ void Warning (char *message) { #ifdef WSM char pch[MAXWMPATH+1]; sprintf (pch, "%s: %s\n", GETMESSAGE(20, 1, "Workspace Manager"), message); _DtSimpleError (wmGD.mwmName, DtIgnore, NULL, pch, NULL); #else /* WSM */ fprintf (stderr, "%s: %s\n", wmGD.mwmName, message); fflush (stderr); #endif /* WSM */ } /* END OF FUNCTION Warning */ #ifdef WSM #ifdef DEBUGGER /******************************<->************************************* * * PrintFormatted (format, message, message, ...) * * * Description: * ----------- * This function lists several messages to stderr using fprinf() * formatting capabilities. * * Inputs: * ------ * s0-s9 = pointers to message strings * * Comments: * ------ * Caller must provide his/her own argv[0] to this function. ******************************<->***********************************/ /*VARARGS1*/ void PrintFormatted(char *f, char *s0, char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8, char *s9) /* limit of ten args */ { fprintf( stderr, f, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9); fflush (stderr); } /* END OF FUNCTION PrintFormatted */ /************************ eof **************************/ #endif /* DEBUGGER */ #endif /* WSM */ motif-2.3.8/clients/mwm/Makefile.am0000644000175000017500000000343412672140200014056 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = Mwm.msg $(rc_DATA) SUBDIRS = WmWsmLib rcdir = $(MWMRCDIR) rc_DATA = system.mwmrc bin_PROGRAMS = mwm mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART \ -DCDE_INSTALLATION_TOP=\"@CDE_INSTALLATION_TOP@\" \ -DCDE_CONFIGURATION_TOP=\"@CDE_CONFIGURATION_TOP@\" \ -DBITMAPDIR=\"@INCDIR@/bitmaps\" \ -DMWMRCDIR=\"$(MWMRCDIR)\" \ -I$(top_builddir)/lib \ -I$(srcdir)/../../lib ${X_CFLAGS} SRCS1= WmCDInfo.c WmCDecor.c WmCEvent.c\ WmCPlace.c WmColormap.c WmError.c\ WmEvent.c WmFeedback.c \ WmFunction.c WmGraphics.c WmIDecor.c\ WmIPlace.c WmIconBox.c \ WmKeyFocus.c WmMain.c WmManage.c\ WmProperty.c WmResCvt.c\ WmResParse.c WmResource.c WmSignal.c \ WmWinConf.c WmWinInfo.c WmWinList.c WmWinState.c \ WmWsm.c WmXSMP.c version.c WmCmd.c WmImage.c WmInitWs.c WmMenu.c WmProtocol.c noinst_HEADERS = WmBitmap.h \ WmCDInfo.h \ WmCDecor.h \ WmCEvent.h \ WmCPlace.h \ WmCmd.h \ WmColormap.h \ WmDebug.h \ WmError.h \ WmEvent.h \ WmFeedback.h \ WmFunction.h \ WmGlobal.h \ WmGraphics.h \ WmIBitmap.h \ WmICCC.h \ WmIDecor.h \ WmIPlace.h \ WmIconBox.h \ WmImage.h \ WmInitWs.h \ WmKeyFocus.h \ WmManage.h \ WmMenu.h \ WmOL.h \ WmProperty.h \ WmProtocol.h \ WmResCvt.h \ WmResNames.h \ WmResParse.h \ WmResource.h \ WmSignal.h \ WmWinConf.h \ WmWinInfo.h \ WmWinList.h \ WmWinState.h \ WmWsm.h \ WmXSMP.h mwm_SOURCES = $(SRCS1) if MessageCatalog CAT_FILES = Mwm.cat MwmMsgCatI.h $(CAT_FILES): Mwm.msg $(mkinstalldirs) $(top_builddir)/localized/C/msg $(top_builddir)/localized/util/mkcatdefs MwmMsgCatI.h $(srcdir)/Mwm.msg >$(top_builddir)/localized/C/msg/Mwm.msg gencat Mwm.cat $(top_builddir)/localized/C/msg/Mwm.msg endif motif-2.3.8/clients/mwm/WmIconBox.h0000644000175000017500000001036413145162623014051 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2 */ #ifdef WSM extern void AddIconBoxForWorkspace (WmWorkspaceData *pWS); #endif /* WSM */ extern void AddNewBox (WmWorkspaceData *pWS, IconBoxData *pIBD); extern void ChangeActiveIconboxIconText (Widget icon, caddr_t dummy, XFocusChangeEvent *event); extern void CheckIconBoxResize (ClientData *pCD, unsigned int changedValues, int newWidth, int newHeight); extern Boolean CheckIconBoxSize (IconBoxData *pIBD); extern void DeleteIconFromBox (IconBoxData *pIBD, ClientData *pCD); extern void DeleteIconInfo (IconBoxData *pIBD, ClientData *pCD); extern Boolean ExpandVirtualSpace (IconBoxData *pIBD, int newWidth, int newHeight); extern Boolean ExtendIconList (IconBoxData *pIBD, int incr); extern void FindNewPosition (Cardinal *newPosition, IconPlacementData *pIPD, int newPlace); extern MenuItem *GetIconBoxMenuItems (WmScreenData *pSD); extern void GetIconBoxIconRootXY (ClientData *pCD, int *pX, int *pY); extern void HandleIconBoxButtonMotion (Widget icon, caddr_t client_data, XEvent *pev); extern void HandleIconBoxIconKeyPress (Widget icon, caddr_t dummy, XKeyEvent *keyEvent); #ifndef MOTIF_ONE_DOT_ONE extern void IconScrollVisibleCallback (Widget w, caddr_t client_data, XmAnyCallbackStruct *call_data); #endif extern void IconActivateCallback (Widget w, caddr_t client_data, XmAnyCallbackStruct *call_data); extern Boolean IconVisible (ClientData *pCD); extern IconInfo *InsertIconInfo (IconBoxData *pIBD, ClientData *pCD, Widget theWidget); extern Boolean InsertIconIntoBox (IconBoxData *pIBD, ClientData *pCD); extern void InitIconBox (WmScreenData *pSD); extern void InitializeClientData (ClientData *pCD, IconBoxData *pIBD); extern void InitializeIconBoxData (WmWorkspaceData *pWS, IconBoxData *pIBD); extern Cardinal InsertPosition (Widget w); extern void MakeBulletinBoard (WmWorkspaceData *pWS, IconBoxData *pIBD); extern void MakeFadeIconGC (WmScreenData *pSD); extern Boolean MakeIconBox (WmWorkspaceData *pWS, ClientData *pCD); extern void MakeScrolledWindow (WmWorkspaceData *pWS, IconBoxData *pIBD); extern void MakeShell (WmWorkspaceData *pWS, IconBoxData *pIBD); extern void MakeShrinkWrapIconsGC (WmScreenData *pSD, Pixmap bgPixmap); extern void MapIconBoxes (WmWorkspaceData *pWS); extern void PackIconBox (IconBoxData *pIBD, Boolean packVert, Boolean packHorz, int passedInWidth, int passedInHeight); extern void RealignIconList (IconBoxData *pIBD, int newCols, int newRows); extern void RealizeIconBox (WmWorkspaceData *pWS, IconBoxData *pIBD, ClientData *pCD); extern void ReorderIconBoxIcons (ClientData *pCD, IconBoxData *pIBD, Widget theIcon, int newX, int newY); extern void ResetArrowButtonIncrements (ClientData *pCD); extern void ResetIconBoxMaxSize (ClientData *pCD, Widget bBoardWidget); extern void SetGeometry (WmWorkspaceData *pWS, ClientData *pCD, IconBoxData *pIBD); extern void SetGranularity (WmWorkspaceData *pWS, ClientData *pCD, IconBoxData *pIBD); extern void SetIconBoxInfo (WmWorkspaceData *pWS, ClientData *pCD); extern void SetNewBounds (IconBoxData *pIBD); extern void ShowClientIconState (ClientData *pCD, int newState); #ifdef WSM extern void UnmapIconBoxes (WmWorkspaceData *pWS); #endif /* WSM */ extern void UpdateIncrements (Widget sWidget, IconBoxData *pIBD, XConfigureEvent *event); extern String WmXmStringToString (XmString xmString); motif-2.3.8/clients/mwm/WmProtocol.c0000644000175000017500000011101713145162623014301 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.3 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: WmProtocol.c /main/8 1997/06/18 17:31:34 samborn $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" #include "WmICCC.h" /* * include extern functions */ #include "WmError.h" #include "WmFunction.h" #include "WmKeyFocus.h" #include "WmMenu.h" #include "WmWinInfo.h" #ifndef NO_WMQUERY #include "WmEvent.h" #endif /* NO_WMQUERY */ #ifdef PANELIST #include "WmPanelP.h" #endif /* PANELIST */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) # include "WmCmd.h" # include "WmDebug.h" #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #include /* * Function Declarations: */ #include "WmProtocol.h" #ifndef NO_WMQUERY static Boolean wmq_convert (Widget w, Atom *pSelection, Atom *pTarget, Atom *pType_return, XtPointer *pValue_return, unsigned long *pLength_return, int *pFormat_return); static Boolean wmq_convert_all_clients (Widget w, int screen, Atom *pType_return, XtPointer *pValue_return, unsigned long *pLength_return, int *pFormat_return); static void wmq_list_subtree (ClientData *pCD); static void wmq_add_xid (XID win); static void wmq_done (Widget w, Atom *pSelection, Atom *pTarget); static void wmq_lose (Widget w, Atom *pSelection); static void wmq_bump_xids(void); #endif /* NO_WMQUERY */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) static void OwnWMSelections (Time timestamp); static Boolean WMiConvert (Widget, Atom, Atom, XtPointer, unsigned long, int, Atom *, XtPointer *, unsigned long *, int *); static void WMiConvertCB (Widget, XtPointer, XtPointer); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /* * Global Variables: */ #ifndef NO_WMQUERY Atom *xa_WM_QUERY = NULL; Atom xa_WM_POINTER_WINDOW; Atom xa_WM_CLIENT_WINDOW; Atom xa_WM_ALL_CLIENTS; XID *pXids = NULL; int numXids = -1; int curXids = 0; #endif /* NO_WMQUERY */ /*************************************<->************************************* * * SetupWmICCC () * * * Description: * ----------- * This function sets up the window manager handling of the inter-client * communications conventions. * * * Outputs: * ------- * (wmGD) = Atoms id's are setup. * *************************************<->***********************************/ void SetupWmICCC (void) { enum { #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) XA_TARGETS, XA_MULTIPLE, XA_TIMESTAMP, #endif XA_WM_STATE, XA_WM_PROTOCOLS, XA_WM_CHANGE_STATE, XA_WM_SAVE_YOURSELF, XA_WM_DELETE_WINDOW, XA_WM_COLORMAP_WINDOWS, XA_WM_TAKE_FOCUS, XA_MWM_HINTS, XA_MWM_MENU, XA_MWM_MESSAGES, XA_MOTIF_WM_OFFSET, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL) || !defined(NO_WMQUERY)) XA_MOTIF_WM_CLIENT_WINDOW, XA_MOTIF_WM_POINTER_WINDOW, XA_MOTIF_WM_ALL_CLIENTS, #endif #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) XA_MOTIF_WM_DEFINE_COMMAND, XA_MOTIF_WM_INCLUDE_COMMAND, XA_MOTIF_WM_REMOVE_COMMAND, XA_MOTIF_WM_ENABLE_COMMAND, XA_MOTIF_WM_DISABLE_COMMAND, XA_MOTIF_WM_RENAME_COMMAND, XA_MOTIF_WM_INVOKE_COMMAND, XA_MOTIF_WM_REQUEST_COMMAND, XA_MOTIF_WM_WINDOW_FLAGS, XA_MOTIF_WM_AUTOMATION, #endif XA_COMPOUND_TEXT, NUM_ATOMS }; static char *atom_names[] = { #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) _XA_TARGETS, _XA_MULTIPLE, _XA_TIMESTAMP, #endif _XA_WM_STATE, _XA_WM_PROTOCOLS, _XA_WM_CHANGE_STATE, _XA_WM_SAVE_YOURSELF, _XA_WM_DELETE_WINDOW, _XA_WM_COLORMAP_WINDOWS, _XA_WM_TAKE_FOCUS, _XA_MWM_HINTS, _XA_MWM_MENU, _XA_MWM_MESSAGES, _XA_MOTIF_WM_OFFSET, #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL) || !defined(NO_WMQUERY)) # ifdef _XA_MOTIF_WM_CLIENT_WINDOW _XA_MOTIF_WM_CLIENT_WINDOW, _XA_MOTIF_WM_POINTER_WINDOW, _XA_MOTIF_WM_ALL_CLIENTS, # else "_MOTIF_WM_CLIENT_WINDOW", "_MOTIF_WM_POINTER_WINDOW", "_MOTIF_WM_ALL_CLIENTS" # endif #endif #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) _XA_MOTIF_WM_DEFINE_COMMAND, _XA_MOTIF_WM_INCLUDE_COMMAND, _XA_MOTIF_WM_REMOVE_COMMAND, _XA_MOTIF_WM_ENABLE_COMMAND, _XA_MOTIF_WM_DISABLE_COMMAND, _XA_MOTIF_WM_RENAME_COMMAND, _XA_MOTIF_WM_INVOKE_COMMAND, _XA_MOTIF_WM_REQUEST_COMMAND, _XA_MOTIF_WM_WINDOW_FLAGS, _XA_MOTIF_WM_AUTOMATION, #endif "COMPOUND_TEXT" }; XIconSize sizeList; int scr; Atom atoms[XtNumber(atom_names)]; /* * Make atoms that are required by the ICCC and mwm. The atom for * _MOTIF_WM_INFO is intern'ed in ProcessMotifWmInfo. */ XInternAtoms(DISPLAY, atom_names, XtNumber(atom_names), False, atoms); #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) wmGD.xa_TARGETS = atoms[XA_TARGETS]; wmGD.xa_MULTIPLE = atoms[XA_MULTIPLE]; wmGD.xa_TIMESTAMP = atoms[XA_TIMESTAMP]; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ wmGD.xa_WM_STATE = atoms[XA_WM_STATE]; wmGD.xa_WM_PROTOCOLS = atoms[XA_WM_PROTOCOLS]; wmGD.xa_WM_CHANGE_STATE = atoms[XA_WM_CHANGE_STATE]; wmGD.xa_WM_SAVE_YOURSELF = atoms[XA_WM_SAVE_YOURSELF]; wmGD.xa_WM_DELETE_WINDOW = atoms[XA_WM_DELETE_WINDOW]; wmGD.xa_WM_COLORMAP_WINDOWS = atoms[XA_WM_COLORMAP_WINDOWS]; wmGD.xa_WM_TAKE_FOCUS = atoms[XA_WM_TAKE_FOCUS]; wmGD.xa_MWM_HINTS = atoms[XA_MWM_HINTS]; wmGD.xa_MWM_MENU = atoms[XA_MWM_MENU]; wmGD.xa_MWM_MESSAGES = atoms[XA_MWM_MESSAGES]; wmGD.xa_MWM_OFFSET = atoms[XA_MOTIF_WM_OFFSET]; #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* wm query targets */ wmGD._MOTIF_WM_CLIENT_WINDOW = atoms[XA_MOTIF_WM_CLIENT_WINDOW]; wmGD._MOTIF_WM_POINTER_WINDOW = atoms[XA_MOTIF_WM_POINTER_WINDOW]; wmGD._MOTIF_WM_ALL_CLIENTS = atoms[XA_MOTIF_WM_ALL_CLIENTS]; /* intern atoms for Client-Commmand Interface protocol. */ wmGD._MOTIF_WM_DEFINE_COMMAND = atoms[XA_MOTIF_WM_DEFINE_COMMAND]; wmGD._MOTIF_WM_INCLUDE_COMMAND= atoms[XA_MOTIF_WM_INCLUDE_COMMAND]; wmGD._MOTIF_WM_REMOVE_COMMAND = atoms[XA_MOTIF_WM_REMOVE_COMMAND]; wmGD._MOTIF_WM_ENABLE_COMMAND = atoms[XA_MOTIF_WM_ENABLE_COMMAND]; wmGD._MOTIF_WM_DISABLE_COMMAND= atoms[XA_MOTIF_WM_DISABLE_COMMAND]; wmGD._MOTIF_WM_RENAME_COMMAND = atoms[XA_MOTIF_WM_RENAME_COMMAND]; wmGD._MOTIF_WM_INVOKE_COMMAND = atoms[XA_MOTIF_WM_INVOKE_COMMAND]; wmGD._MOTIF_WM_REQUEST_COMMAND= atoms[XA_MOTIF_WM_REQUEST_COMMAND]; wmGD._MOTIF_WM_WINDOW_FLAGS = atoms[XA_MOTIF_WM_WINDOW_FLAGS]; wmGD._MOTIF_WM_AUTOMATION = atoms[XA_MOTIF_WM_AUTOMATION]; #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /* * Assert ownership of the WINDOW_MANAGER selection * on each screen that the window manager controls. * these use the format WM_Si. */ OwnWMSelections(GetTimestamp()); #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ wmGD.xa_COMPOUND_TEXT = atoms[XA_COMPOUND_TEXT]; #ifndef NO_WMQUERY if (!(xa_WM_QUERY = (Atom *) XtMalloc (wmGD.numScreens * (sizeof (Atom))))) { Warning (((char *)GETMESSAGE(56, 2, "Insufficient memory to XInternAtom _MOTIF_WM_QUERY_nn"))); } for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { char wm_query_scr[32]; sprintf(wm_query_scr, "_MOTIF_WM_QUERY_%d", wmGD.Screens[scr].screen); xa_WM_QUERY[scr] = XInternAtom(DISPLAY, wm_query_scr, False); } else { xa_WM_QUERY[scr] = 0; } } xa_WM_CLIENT_WINDOW = atoms[XA_MOTIF_WM_CLIENT_WINDOW]; xa_WM_POINTER_WINDOW = atoms[XA_MOTIF_WM_POINTER_WINDOW]; xa_WM_ALL_CLIENTS = atoms[XA_MOTIF_WM_ALL_CLIENTS]; #endif /* NO_WMQUERY */ /* * Setup the icon size property on the root window. */ sizeList.width_inc = 1; sizeList.height_inc = 1; for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { sizeList.min_width = wmGD.Screens[scr].iconImageMinimum.width; sizeList.min_height = wmGD.Screens[scr].iconImageMinimum.height; sizeList.max_width = wmGD.Screens[scr].iconImageMaximum.width; sizeList.max_height = wmGD.Screens[scr].iconImageMaximum.height; XSetIconSizes (DISPLAY, wmGD.Screens[scr].rootWindow, &sizeList, 1); } } #ifndef NO_WMQUERY /* * Assert ownership of the WM_QUERY selection */ for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { if (!XtOwnSelection(wmGD.topLevelW, xa_WM_QUERY[scr], GetTimestamp(), wmq_convert, wmq_lose, wmq_done)) { Warning (((char *)GETMESSAGE(56, 3, "Failed to own _MOTIF_WM_QUERY_nn selection"))); } } } #endif /* NO_WMQUERY */ } /* END OF FUNCTION SetupWmICCC */ /*************************************<->************************************* * * SendConfigureNotify (pCD) * * * Description: * ----------- * This function is used to send a synthetic ConfigureNotify event when * a client window is reconfigured in certain ways (e.g., the window is * moved without being resized). * * * Inputs: * ------ * pCD = pointer to client data (window id and client size data) * *************************************<->***********************************/ void SendConfigureNotify (ClientData *pCD) { XConfigureEvent notifyEvent; /* * Send a synthetic ConfigureNotify message: */ notifyEvent.type = ConfigureNotify; notifyEvent.display = DISPLAY; notifyEvent.event = pCD->client; notifyEvent.window = pCD->client; #ifdef PANELIST if (pCD->pECD) { int rootX, rootY; Window wChild; WmFpEmbeddedClientData *pECD = (WmFpEmbeddedClientData *)pCD->pECD; /* * The front panel uses clientX, clientY for position in * front panel. Translate to root coords for client's * information. */ XTranslateCoordinates (DISPLAY, pECD->winParent, ROOT_FOR_CLIENT(pCD), pCD->clientX, pCD->clientY, &rootX, &rootY, &wChild); notifyEvent.x = rootX; notifyEvent.y = rootY; notifyEvent.width = pCD->clientWidth; notifyEvent.height = pCD->clientHeight; } else #else /* PANELIST */ #endif /* PANELIST */ if (pCD->maxConfig) { notifyEvent.x = pCD->maxX; notifyEvent.y = pCD->maxY; notifyEvent.width = pCD->maxWidth; notifyEvent.height = pCD->maxHeight; } else { notifyEvent.x = pCD->clientX; notifyEvent.y = pCD->clientY; notifyEvent.width = pCD->clientWidth; notifyEvent.height = pCD->clientHeight; } notifyEvent.border_width = 0; notifyEvent.above = None; notifyEvent.override_redirect = False; XSendEvent (DISPLAY, pCD->client, False, StructureNotifyMask, (XEvent *)¬ifyEvent); } /* END OF FUNCTION SendConfigureNotify */ /*************************************<->************************************* * * SendClientOffsetMessage (pCD) * * * Description: * ----------- * This function is used to send a client message containing the offset * between the window position reported to the user and the actual * window position of the client over the root. * * This can be used by clients that map and unmap windows to help them * work with the window manager to place the window in the same location * when remapped. * * Inputs: * ------ * pCD = pointer to client data (frame geometry info) * *************************************<->***********************************/ void SendClientOffsetMessage (ClientData *pCD) { long borderWidth = (long)pCD->xBorderWidth; long offsetX = pCD->clientOffset.x; long offsetY = pCD->clientOffset.y; XClientMessageEvent clientMsgEvent; clientMsgEvent.type = ClientMessage; clientMsgEvent.window = pCD->client; clientMsgEvent.message_type = wmGD.xa_MWM_MESSAGES; clientMsgEvent.format = 32; clientMsgEvent.data.l[0] = wmGD.xa_MWM_OFFSET; /* * Use window gravity to allow the user to specify the window * position on the screen without having to know the dimensions * of the decoration that mwm is adding. */ switch (pCD->windowGravity) { case NorthWestGravity: default: { clientMsgEvent.data.l[1] = offsetX; clientMsgEvent.data.l[2] = offsetY; break; } case NorthGravity: { clientMsgEvent.data.l[1] = borderWidth; clientMsgEvent.data.l[2] = offsetY; break; } case NorthEastGravity: { clientMsgEvent.data.l[1] = -(offsetX - (2 * borderWidth)); clientMsgEvent.data.l[2] = offsetY; break; } case EastGravity: { clientMsgEvent.data.l[1] = -(offsetX - (2 * borderWidth)); clientMsgEvent.data.l[2] = borderWidth + (offsetY - offsetX)/2; break; } case SouthEastGravity: { clientMsgEvent.data.l[1] = -(offsetX - (2 * borderWidth)); clientMsgEvent.data.l[2] = -(offsetX - (2 * borderWidth)); break; } case SouthGravity: { clientMsgEvent.data.l[1] = borderWidth; clientMsgEvent.data.l[2] = -(offsetX - (2 * borderWidth)); break; } case SouthWestGravity: { clientMsgEvent.data.l[1] = offsetX; clientMsgEvent.data.l[2] = -(offsetX - (2 * borderWidth)); break; } case WestGravity: { clientMsgEvent.data.l[1] = offsetX; clientMsgEvent.data.l[2] = borderWidth + (offsetY - offsetX)/2; break; } case CenterGravity: { clientMsgEvent.data.l[2] = (offsetY - offsetX)/2; break; } } XSendEvent (DISPLAY, pCD->client, False, NoEventMask, (XEvent *)&clientMsgEvent); } /* END OF FUNCTION SendClientOffsetMessage */ /*************************************<->************************************* * * SendClientMsg (window, type, data0, time, pData, dataLen) * * * Description: * ----------- * This function is used to send a client message event that to a client * window. The message may be sent as part of a protocol arranged for by * the client with the WM_PROTOCOLS property. * * * Inputs: * ------ * window = destination window for the client message event * * type = client message type * * data0 = data0 value in the client message * * time = timestamp to be used in the event * * pData = pointer to data to be used in the event * * dataLen = len of data (in 32 bit units) * *************************************<->***********************************/ void SendClientMsg (Window window, long type, long data0, Time time, long *pData, int dataLen) { XClientMessageEvent clientMsgEvent; int i; clientMsgEvent.type = ClientMessage; clientMsgEvent.window = window; clientMsgEvent.message_type = type; clientMsgEvent.format = 32; clientMsgEvent.data.l[0] = data0; clientMsgEvent.data.l[1] = (long)time; if (pData) { /* * Fill in the rest of the ClientMessage event (that holds up to * 5 words of data). */ if (dataLen > 3) { dataLen = 3; } for (i = 2; i < (2 + dataLen); i++) { clientMsgEvent.data.l[i] = pData[i]; } } XSendEvent (DISPLAY, window, False, NoEventMask, (XEvent *)&clientMsgEvent); XFlush(DISPLAY); } /* END OF FUNCTION SendClientMsg */ /*************************************<->************************************* * * AddWmTimer (timerType, timerInterval, pCD) * * * Description: * ----------- * This function sets a window manager timer of the specified type. * * * Inputs: * ------ * timerType = type of timer to be set * * timerInterval = length of timeout in ms * * pCD = pointer to client data associated with the timer * * return = True if timer could be set * *************************************<->***********************************/ Boolean AddWmTimer (unsigned int timerType, unsigned long timerInterval, ClientData *pCD) { WmTimer *pWmTimer; if (!(pWmTimer = (WmTimer *)XtMalloc (sizeof (WmTimer)))) { Warning (((char *)GETMESSAGE(56, 1, "Insufficient memory for window manager data"))); return (False); } /* !!! handle for XtAppAddTimeOut error !!! */ pWmTimer->timerId = XtAppAddTimeOut (wmGD.mwmAppContext, timerInterval, (XtTimerCallbackProc)TimeoutProc, (caddr_t)pCD); pWmTimer->timerCD = pCD; pWmTimer->timerType = timerType; pWmTimer->nextWmTimer = wmGD.wmTimers; wmGD.wmTimers = pWmTimer; return(True); } /* END OF FUNCTION AddWmTimer */ /*************************************<->************************************* * * DeleteClientWmTimers (pCD) * * * Description: * ----------- * This function deletes all window manager timers that are associated with * the specified client window. * * * Inputs: * ------ * pCD = pointer to client data for client whose timers are to be deleted * * wmGD = (wmTimers) * *************************************<->***********************************/ void DeleteClientWmTimers (ClientData *pCD) { WmTimer *pPrevTimer; WmTimer *pWmTimer; WmTimer *pRemoveTimer; pPrevTimer = NULL; pWmTimer = wmGD.wmTimers; while (pWmTimer) { if (pWmTimer->timerCD == pCD) { if (pPrevTimer) { pPrevTimer->nextWmTimer = pWmTimer->nextWmTimer; } else { wmGD.wmTimers = pWmTimer->nextWmTimer; } pRemoveTimer = pWmTimer; pWmTimer = pWmTimer->nextWmTimer; XtRemoveTimeOut (pRemoveTimer->timerId); XtFree ((char *)pRemoveTimer); } else { pPrevTimer = pWmTimer; pWmTimer = pWmTimer->nextWmTimer; } } } /* END OF FUNCTION DeleteClientWmTimers */ /*************************************<->************************************* * * TimeoutProc (client_data, id) * * * Description: * ----------- * This function is an Xtk timeout handler. It is used to handle various * window manager timers (i.e. WM_SAVE_YOURSELF quit timeout). * * * Inputs: * ------ * client_data = pointer to window manager client data * * id = Xtk timer id * *************************************<->***********************************/ void TimeoutProc (caddr_t client_data, XtIntervalId *id) { WmTimer *pPrevTimer; WmTimer *pWmTimer; /* * Find out if the timer still needs to be serviced. */ pPrevTimer = NULL; pWmTimer = wmGD.wmTimers; while (pWmTimer) { if (pWmTimer->timerId == *id) { break; } pPrevTimer = pWmTimer; pWmTimer = pWmTimer->nextWmTimer; } if (pWmTimer) { /* * Do the timer related action. */ switch (pWmTimer->timerType) { case TIMER_QUIT: { XKillClient (DISPLAY, pWmTimer->timerCD->client); break; } case TIMER_RAISE: { Boolean sameScreen; if ((wmGD.keyboardFocus == pWmTimer->timerCD) && (pWmTimer->timerCD->focusPriority == (PSD_FOR_CLIENT(pWmTimer->timerCD))->focusPriority) && (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) && (pWmTimer->timerCD == GetClientUnderPointer(&sameScreen))) { Do_Raise (pWmTimer->timerCD, (ClientListEntry *)NULL, STACK_NORMAL); } break; } } /* * Remove the timer from the wm timer list. */ if (pPrevTimer) { pPrevTimer->nextWmTimer = pWmTimer->nextWmTimer; } else { wmGD.wmTimers = pWmTimer->nextWmTimer; } XtFree ((char *)pWmTimer); } /* * Free up the timer. */ XtRemoveTimeOut (*id); } /* END OF FUNCTION TimeoutProc */ #ifndef NO_WMQUERY /*************************************<->************************************* * * Boolean wmq_convert (w, pSelection, pTarget, pType_return, * pValue_return, pLength_return, pFormat_return) * * * Description: * ----------- * This function converts WM_QUERY selections * * Inputs: * ------ * w - widget * pSelection - pointer to selection type (atom) * pTarget - pointer to requested target type (atom) * * Outputs: * ------ * pType_return - pointer to type of data returned (atom) * pValue_return - pointer to pointer to data returned * pLength_return - ptr to length of data returned * pFormat_return - ptr to format of data returned * * Comments: * -------- * *************************************<->***********************************/ static Boolean wmq_convert ( Widget w, Atom *pSelection, Atom *pTarget, Atom *pType_return, XtPointer *pValue_return, unsigned long *pLength_return, int *pFormat_return ) { Boolean wm_query_found = False; int scr; for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { if (*pSelection == xa_WM_QUERY[scr]) { wm_query_found = True; break; } } } if (wm_query_found) { if (*pTarget == xa_WM_POINTER_WINDOW) { return (False); } else if (*pTarget == xa_WM_CLIENT_WINDOW) { return (False); } else if (*pTarget == xa_WM_ALL_CLIENTS) { return (wmq_convert_all_clients (w, scr, pType_return, pValue_return, pLength_return, pFormat_return)); } } return (wm_query_found); } /* END OF FUNCTION wmq_convert */ /*************************************<->************************************* * * Boolean wmq_convert_all_clients (w, screen, pType_return, * pValue_return, pLength_return, pFormat_return) * * * Description: * ----------- * This function converts the WM_QUERY selection target WM_ALL_CLIENTS * * Inputs: * ------ * w - widget * screen - screen number * * Outputs: * ------ * pType_return - pointer to type of data returned (atom) * pValue_return - pointer to pointer to data returned * pLength_return - ptr to length of data returned * pFormat_return - ptr to format of data returned * * Comments: * -------- * *************************************<->***********************************/ static Boolean wmq_convert_all_clients ( Widget w, int screen, Atom *pType_return, XtPointer *pValue_return, unsigned long *pLength_return, int *pFormat_return ) { WmScreenData *pSD = NULL; ClientListEntry *pEntry; ClientData *pCD; /* * Start with empty client list */ curXids = 0; /* * Get all clients on the specified screen */ if (wmGD.Screens[screen].managed) { pSD = &wmGD.Screens[screen]; /* * Traverse the client list for this screen and * add to the list of window IDs */ pEntry = pSD->clientList; while (pEntry) { /* * Filter out entries for icons */ if (pEntry->type != MINIMIZED_STATE) { pCD = pEntry->pCD; if (pCD->transientChildren) { wmq_list_subtree(pCD->transientChildren); } wmq_add_xid ((XID) pCD->client); } pEntry = pEntry->nextSibling; } } *pType_return = XA_WINDOW; *pValue_return = (XtPointer) pXids; *pLength_return = curXids; *pFormat_return = 32; return (True); } /* END OF FUNCTION wmq_convert_all_clients */ /*************************************<->************************************* * * void wmq_list_subtree (pCD) * * * Description: * ----------- * This function adds the windows in a transient subtree to the * global window list * * Inputs: * ------ * pCD - client data for "leftmost" child of a subtree * * Outputs: * ------ * * Comments: * -------- * *************************************<->***********************************/ static void wmq_list_subtree ( ClientData *pCD ) { /* * Do children first */ if (pCD->transientChildren) { wmq_list_subtree(pCD->transientChildren); } /* * Do me */ wmq_add_xid ((XID) pCD->client); /* * Do siblings */ if (pCD->transientSiblings) { wmq_list_subtree(pCD->transientSiblings); } } /* END OF FUNCTION wmq_list_subtree */ /*************************************<->************************************* * * void wmq_add_xid (win) * * * Description: * ----------- * This function adds an xid to the list * * Inputs: * ------ * win - xid to add * * Outputs: * ------ * * Comments: * -------- * *************************************<->***********************************/ static void wmq_add_xid ( XID win ) { if (curXids >= numXids) { wmq_bump_xids(); } if (curXids < numXids) { pXids[curXids++] = win; } } /* END OF FUNCTION wmq_add_xid */ /*************************************<->************************************* * * void wmq_lose (w, pSelection) * * * Description: * ----------- * This function is called when we lose the WM_QUERY selection * * Inputs: * ------ * w - widget * pSelection - pointer to selection type (atom) * * Outputs: * ------ * * Comments: * -------- * This shouldn't happen! * *************************************<->***********************************/ static void wmq_lose ( Widget w, Atom *pSelection ) { Warning (((char *)GETMESSAGE(56, 4, "Lost _MOTIF_WM_QUERY_nn selection"))); } /* END OF FUNCTION wmq_lose */ /*************************************<->************************************* * * void wmq_done (w, pSelection, pTarget) * * * Description: * ----------- * This function is called when selection conversion is done. * * Inputs: * ------ * w - widget * pSelection - pointer to selection type (atom) * pTarget - pointer to requested target type (atom) * * Outputs: * ------ * * Comments: * -------- * This is here to prevent Xt from freeing our buffers. * *************************************<->***********************************/ static void wmq_done ( Widget w, Atom *pSelection, Atom *pTarget ) { } /* END OF FUNCTION wmq_done */ /*************************************<->************************************* * * static void wmq_bump_xids () * * * Description: * ----------- * This function allocates more xids in our local buffer * * Inputs: * ------ * w - widget * pSelection - pointer to selection type (atom) * pTarget - pointer to requested target type (atom) * * Outputs: * ------ * * Comments: * -------- * This is here to prevent Xt from freeing our buffers. * *************************************<->***********************************/ static void wmq_bump_xids ( void ) { XID *px; if (pXids) { if (!(px = (XID *) XtRealloc ((char *) pXids, (numXids + 32) * (sizeof (XID))))) { Warning (((char *)GETMESSAGE(56, 5, "Insufficient memory to convert _MOTIF_WM_QUERY_nn selection"))); } else { pXids = px; numXids += 32; } } else { if (!(pXids = (XID *) XtMalloc (32 * (sizeof (XID))))) { Warning (((char *)GETMESSAGE(56, 5, "Insufficient memory to convert _MOTIF_WM_QUERY_nn selection"))); } else { numXids = 32; } } } #endif /* NO_WMQUERY */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * static void OwnWMSelections () * * * Description: * ----------- * Get the selection ownership for each managed screen. The selection mwm * will own is WM_Si. * * Inputs: * ------ * * * * * Outputs: * ------ * * Comments: * -------- * * *************************************<->***********************************/ static void OwnWMSelections ( Time timestamp ) { int scr; wmGD.xa_WM = (Atom *) XtMalloc (wmGD.numScreens * (sizeof (Atom))); for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { char wm_scr[8]; sprintf(wm_scr, "WM_S%d", DefaultScreen(DISPLAY)); wmGD.xa_WM[scr] = XInternAtom (DISPLAY, wm_scr, False); #ifdef MWM_WSM /* * This registers the callback to be invoked when a request * is made against a WSM Protocol target. The request * callback is stored by the WSM Protocol code and is * invoked in the convert routine (WMiConvert) below. * See WSMProcessProtoTargets(). */ WSMRegisterRequestCallback(DISPLAY, scr, HandleWsmConvertRequest, NULL); #endif /* * Own the selection through UTM. This sets-up a convert function * that is invoked when a convert request is made on this selection. * The convert function is specified in the drawing area's * XmNconvertCallback resource. */ XtAddCallback(wmGD.Screens[scr].utmShell, XmNconvertCallback, WMiConvertCB, NULL); if (! XmeNamedSource(wmGD.Screens[scr].utmShell, wmGD.xa_WM[scr], timestamp)) { Warning (((char *)GETMESSAGE(56, 6, "Failed to own WM_nn selection"))); } else { PRINT("Owning selection %s\n", wm_scr); } } } } /*************************************<->************************************* * * Boolean WMiConvert ( ) * * * Description: * ----------- * This function converts WM_Si selections using the new param selections * *************************************<->***********************************/ /*ARGSUSED*/ static Boolean WMiConvert ( Widget w, Atom selection, Atom target, XtPointer input, unsigned long inputLen, int inputFmt, Atom *outputType, XtPointer *output, unsigned long *outputLen, int *outputFmt) { int scr; Boolean found = False; /* set up some defaults. selection code doesn't like garbage! */ *outputLen = 0; *output = NULL; *outputFmt = 8; scr = XScreenNumberOfScreen(XtScreen(w)); if (!wmGD.Screens[scr].managed) { Warning (((char *)GETMESSAGE(56, 7, "Got convert request from unmanaged screen"))); found = False; } else { if (target == wmGD.xa_TARGETS) { Atom *targs = (Atom *)XtMalloc((unsigned) (28 * sizeof(Atom))); int targetCount = 0; *output = (XtPointer) targs; /* required targets */ *targs++ = wmGD.xa_TARGETS; targetCount++; *targs++ = wmGD.xa_MULTIPLE; targetCount++; *targs++ = wmGD.xa_TIMESTAMP; targetCount++; #ifdef MWM_WSM /* other targets */ *targs++ = _WSMReqTypeToTarget(DISPLAY, WSM_CONNECT); targetCount++; *targs++ = _WSMReqTypeToTarget(DISPLAY, WSM_EXTENSIONS); targetCount++; *targs++ = _WSMReqTypeToTarget(DISPLAY, WSM_CONFIG_FMT); targetCount++; *targs++ = _WSMReqTypeToTarget(DISPLAY, WSM_GET_STATE); targetCount++; *targs++ = _WSMReqTypeToTarget(DISPLAY, WSM_SET_STATE); targetCount++; *targs++ = _WSMReqTypeToTarget(DISPLAY, WSM_REG_WINDOW); targetCount++; #endif /* menu command interface support */ *targs++ = wmGD._MOTIF_WM_DEFINE_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_INCLUDE_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_REMOVE_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_ENABLE_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_DISABLE_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_RENAME_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_INVOKE_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_REQUEST_COMMAND; targetCount++; *targs++ = wmGD._MOTIF_WM_WINDOW_FLAGS; targetCount++; #ifdef MWM_WSM /* virtual screen support */ *targs++ = wmGD._MOTIF_WM_PAN; targetCount++; *targs++ = wmGD._MOTIF_WM_GOTO; targetCount++; #endif /* automation support */ *targs++ = wmGD._MOTIF_WM_AUTOMATION; targetCount++; *outputType = XA_ATOM; *outputLen = (targetCount * sizeof(Atom)) >> 2; *outputFmt = 32; found = True; } #ifdef MWM_WSM /* virtual screen support */ else if (target == wmGD._MOTIF_WM_PAN) { int dx, dy; Boolean config; dx = (int) UnpackCARD32(&input); dy = (int) UnpackCARD32(&input); config = (Boolean) UnpackCARD8(&input); PanRoot(dx, dy, config); /* * Update the root property */ SetPanPosition (ACTIVE_PSD->panDx, ACTIVE_PSD->panDy); found = True; } else if (target == wmGD._MOTIF_WM_GOTO) { int x, y; x = (int) UnpackCARD32(&input); y = (int) UnpackCARD32(&input); PanRoot(x - ACTIVE_PSD->panDx, y - ACTIVE_PSD->panDy, 1); found = True; } /* * Handle the workspace manager protocol targets... */ else if (WSMIsKnownTarget(w, target)) { /* * Unpack data send in request and invoke CB specified * in WSMRegisterRequestCallback. */ found = WSMProcessProtoTarget (w, target, input, inputLen, inputFmt, outputType, output, outputLen, outputFmt); } #endif /* MWM_WSM */ /* * Handle client-command interface targets. */ else if (target == wmGD._MOTIF_WM_DEFINE_COMMAND) { PRINT("Convert request made for _MOTIF_WM_DEFINE_COMMAND.\n"); DefineCommand(w, target, (MessageData)input, inputLen, inputFmt); PRINT("Returning from _MOTIF_WM_DEFINE_COMMAND.\n"); found = True; } else if (target == wmGD._MOTIF_WM_INCLUDE_COMMAND) { PRINT("Convert request made for _MOTIF_WM_INCLUDE_COMMAND.\n"); IncludeCommand(w, target, (MessageData)input, inputLen, inputFmt); PRINT("Returning from _MOTIF_WM_INCLUDE_COMMAND.\n"); found = True; } else if (target == wmGD._MOTIF_WM_REMOVE_COMMAND) { PRINT("Convert request made for _MOTIF_WM_REMOVE_COMMAND.\n"); RemoveCommand(w, target, (MessageData)input, inputLen, inputFmt); found = True; } else if (target == wmGD._MOTIF_WM_ENABLE_COMMAND) { PRINT("Convert request made for _MOTIF_WM_ENABLE_COMMAND.\n"); EnableCommand(w, target, (MessageData)input, inputLen, inputFmt); found = True; } else if (target == wmGD._MOTIF_WM_DISABLE_COMMAND) { PRINT("Convert request made for _MOTIF_WM_DISABLE_COMMAND.\n"); DisableCommand(w, target, (MessageData)input, inputLen, inputFmt); found = True; } else if (target == wmGD._MOTIF_WM_RENAME_COMMAND) { PRINT("Convert request made for _MOTIF_WM_RENAME_COMMAND.\n"); RenameCommand(w, target, (MessageData)input, inputLen, inputFmt); found = True; } else if (target == wmGD._MOTIF_WM_INVOKE_COMMAND) { /* Shouldn't get here! */ } else if (target == wmGD._MOTIF_WM_REQUEST_COMMAND) { } else if (target == wmGD._MOTIF_WM_WINDOW_FLAGS) { } else if (target == wmGD._MOTIF_WM_AUTOMATION) { /* * This function needs to pack the necessary info into the * output data variable to send back to the requesting */ GetAutomationData(input,outputType,output,outputLen,outputFmt); found = True; } else Warning (((char *)GETMESSAGE(56, 8, "Conversion request made for unknown target type"))); } return (found); } /*************************************<->************************************* * * void WMiConvertCB ( ) * * * Description: * ----------- * This function is invoked by UTM to handle the convert request * made by a requesting application. * * * Comments: * -------- * This function is set-up as a callback on a drawing area kept on each * screen. This is done in WmInitWs.c * *************************************<->***********************************/ /*ARGSUSED*/ static void WMiConvertCB ( Widget w, XtPointer clientData, XtPointer callData) { XmConvertCallbackStruct *cnv = (XmConvertCallbackStruct *)callData; Atom _MOTIF_LOSE_SELECTION = XInternAtom(DISPLAY, "_MOTIF_LOSE_SELECTION", False); int scr = XScreenNumberOfScreen(XtScreen(w)); /* Check to make sure we're dealing with the right selection. */ if (cnv->selection != wmGD.xa_WM[scr]) { Warning (((char *)GETMESSAGE(56, 9, "Conversion request received for unknown selection"))); return; } if (cnv->target == _MOTIF_LOSE_SELECTION) { /* Done with the conversion - free any data used. */ } /* Handle a conversion request with parameter data. */ else { WMiConvert (w, cnv->selection, cnv->target, cnv->parm, cnv->parm_length, cnv->parm_format, &(cnv->type), &(cnv->value), &(cnv->length), &(cnv->format)); } } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ motif-2.3.8/clients/mwm/WmEvent.c0000644000175000017500000021234413145162623013566 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * Motif Release 1.2.4 */ #ifdef HAVE_CONFIG_H #include #endif #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: WmEvent.c /main/7 1996/11/20 15:27:47 rswiston $" #endif #endif /* * Included Files: */ #include "WmGlobal.h" /* * include extern functions */ #include "WmEvent.h" #ifdef WSM #include "WmBackdrop.h" #endif /* WSM */ #include "WmCDInfo.h" #include "WmCDecor.h" #include "WmCEvent.h" #include "WmColormap.h" #include "WmFunction.h" #include "WmKeyFocus.h" #ifdef PANELIST #include "WmPanelP.h" /* for typedef in WmManage.h */ #endif /* PANELIST */ #include "WmManage.h" #include "WmMenu.h" #ifdef WSM #include "WmICCC.h" #include "WmProperty.h" #endif /* WSM */ #include "WmWinInfo.h" #include "WmWinState.h" #ifdef PANELIST #include "WmResNames.h" #include "WmResParse.h" #include "WmParse.h" #include "WmParseP.h" #endif /* PANELIST */ #include /* for MS_LastManagedMenuTime */ extern XmMenuState _XmGetMenuState(); #ifdef WSM /* * FUNCTION PARSER TABLE */ typedef struct { char * funcName; Context greyedContext; unsigned int resource; long mgtMask; WmFunction wmFunction; Boolean (*parseProc)(); } FunctionTableEntry; #endif /* WSM */ /* * Global Variables: */ extern unsigned int buttonModifierMasks[]; #ifdef WSM int smAckState = SM_UNITIALIZED; extern FunctionTableEntry functionTable[]; extern int F_NOP_INDEX; #endif /* WSM */ #ifndef MOTIF_ONE_DOT_ONE #include #endif /*************************************<->************************************* * * InitEventHandling () * * * Description: * ----------- * This function initializes window manager event handling in preparation * for managing client windows. * * * Inputs: * ------ * wmGD = (keySpecs) * *************************************<->***********************************/ void InitEventHandling (void) { WmScreenData *pSD; XSetWindowAttributes setAttributes; unsigned long base_mask; unsigned int n, scr; /* * Prepare to get root (workspace) window events that are used to * manage client windows. Setup accelerator event processing. */ base_mask = SubstructureRedirectMask | FocusChangeMask; /* handle entry of root window */ base_mask |= EnterWindowMask | LeaveWindowMask; for (scr=0; scrmanaged) { setAttributes.event_mask = base_mask; if (pSD->buttonBindings) { /* * The desktop menu and button bindings for window * manager functions use button press and button * release events. */ setAttributes.event_mask |= (ButtonPressMask | ButtonReleaseMask); } XChangeWindowAttributes (DISPLAY, pSD->rootWindow, CWEventMask, &setAttributes); /* * Setup event handling for "accelerated" window management * functions done with key bindings. */ if (pSD->keySpecs) { SetupKeyBindings (pSD->keySpecs, pSD->rootWindow, GrabModeSync, F_CONTEXT_ALL); } if (pSD->acceleratorMenuCount) { for (n = 0; n < pSD->acceleratorMenuCount; n++) { SetupKeyBindings ( pSD->acceleratorMenuSpecs[n]->accelKeySpecs, pSD->rootWindow, GrabModeSync, F_CONTEXT_ALL); } } } /* end if (managed) */ } /* end for (all screens) */ } /* END OF FUNCTION InitEventHandling */ /*************************************<->************************************* * * _WmGrabMasks (modifiers, pnum_masks) * * * Description: * ----------- * This function returns a set of grab masks to use that effectively * filters out the effects of locking modifiers. Redundant masks * are removed. * * * Inputs: * ------ * modifiers - keymask of modifiers * * Outputs: * ------ * *pnum_masks - number of masks returned * * Return: * ------- * pointer to a NULL-terminated list of modifier masks. This memory is * statically allocated and reused. Do no free or modify. Make a copy * if you need to keep it. * *************************************<->***********************************/ static unsigned int * _WmGrabMasks ( unsigned int modifiers, int *pnum_masks ) { static unsigned int *pRetMasks = NULL; static int len_ret_masks = 0; int num_masks; int num_ret_masks; int i,j; unsigned int mask; /* count the number of masks in the lock sequence */ for (num_masks=0; wmGD.pLockMaskSequence[num_masks] != 0; num_masks++); /* insure we have enough space for our returned masks */ if ((pRetMasks == NULL) || (len_ret_masks < num_masks+2)) { if (pRetMasks != NULL) XtFree ((char *)pRetMasks); len_ret_masks = num_masks+2; pRetMasks = (unsigned int *) XtCalloc (len_ret_masks, sizeof(unsigned int)); } /* fill up the array of masks we return */ num_ret_masks = 0; for (i=0; i= num_ret_masks) { /* we don't have this mask yet, add it */ pRetMasks[num_ret_masks] = mask; num_ret_masks++; } } /* * Add the original mask to the list at the end */ pRetMasks[num_ret_masks++] = modifiers; pRetMasks[num_ret_masks] = 0; /* terminator */ *pnum_masks = num_ret_masks; return (pRetMasks); } /*************************************<->************************************* * * WmGrabKey (display, keycode, modifiers, grab_window, owner_events, * pointer_mode, keyboard_mode) * * * Description: * ----------- * This function does several grabs on a key to make sure the * key is grabbed irrespective of the state of locking modifiers * It is a wrapper for XGrabKey, so the parameters are all the * same. * * * Inputs: * ------ * display - X server connection * keycode - keycode to grab * modifiers - keymask of modifiers * grab_window - window to do grab on * owner_events - does app receive events normally? * pointer_mode - pointer event processing during grab * keyboard_mode - keyboard event processing during grab * wmGD.pLockMaskSequence - extra modifier masks to grab with * * Return: * ------- * The function is asynchronous. * *************************************<->***********************************/ void WmGrabKey ( Display *display, int keycode, unsigned int modifiers, Window grab_window, Bool owner_events, int pointer_mode, int keyboard_mode ) { unsigned int *pGrabMasks; int i, num_masks; pGrabMasks = _WmGrabMasks (modifiers, &num_masks); for (i=0; i************************************* * * WmGrabButton (display, button, modifiers, grab_window, owner_events, * event_mask, pointer_mode, keyboard_mode, confine_to, cursor) * * * Description: * ----------- * This function does several grabs on a button to make sure the * button is grabbed irrespective of the state of locking modifiers * It is a wrapper for XGrabButton, so the parameters are all the * same. * * * Inputs: * ------ * display - X server connection * button - button to grab * modifiers - keymask of modifiers * grab_window - window to do grab on * event_mask - event mask in effect during grab * owner_events - does app receive events normally? * pointer_mode - pointer event processing during grab * keyboard_mode - keyboard event processing during grab * confine_to - window to confine the pointer to * cursor - cursor to be displayed during grab * wmGD.pLockMaskSequence - extra modifier masks to grab with * * Return: * ------- * The function is asynchronous. * *************************************<->***********************************/ void WmGrabButton ( Display *display, unsigned int button, unsigned int modifiers, Window grab_window, unsigned int event_mask, Bool owner_events, int pointer_mode, int keyboard_mode, Window confine_to, Cursor cursor ) { unsigned int *pGrabMasks; int i, num_masks; pGrabMasks = _WmGrabMasks (modifiers, &num_masks); for (i=0; i************************************* * * WmUngrabButton (display, button, modifiers, grab_window) * * * Description: * ----------- * This function is the complement of WmGrabButton. It does several * ungrabs on a button to undo the set of grabs done to ignore * the state of locking modifiers. * * It is a wrapper for XUngrabButton, so the parameters are all the * same. * * * Inputs: * ------ * display - X server connection * button - button to grab * modifiers - keymask of modifiers * grab_window - window to do grab on * wmGD.pLockMaskSequence - extra modifier masks to grab with * * Return: * ------- * The function is asynchronous. * *************************************<->***********************************/ void WmUngrabButton ( Display *display, unsigned int button, unsigned int modifiers, Window grab_window ) { unsigned int *pGrabMasks; int i, num_masks; pGrabMasks = _WmGrabMasks (modifiers, &num_masks); for (i=0; i************************************* * * SetupKeyBindings (keySpecs, grabWindow, keyboardMode, context) * * * Description: * ----------- * This function sets up the event handling necessary to support user * specified key bindings for window manager functions. * * * Inputs: * ------ * keySpecs = list of key bindings for window manager functions. * * grabWindow = window that is to be associated with the passive key grab. * * keyboardMode = indicates keyboard mode for grab. * * context = context of key binding to set * * * Outputs: * ------- * RETURN = number of key bindings set * *************************************<->***********************************/ int SetupKeyBindings (KeySpec *keySpecs, Window grabWindow, int keyboardMode, long context) { KeySpec *keySpec; int setCount = 0; Boolean iconContext; /* * Use key grabs to get the keys that invoke window manger functions. */ iconContext = (context == F_CONTEXT_ICON); keySpec = keySpecs; while (keySpec) { #ifdef OLD_CODE if (((keySpec->context == F_CONTEXT_ICON) && iconContext) || ((keySpec->context != F_CONTEXT_ICON) && !iconContext)) #endif if (((F_CONTEXT_ICON == (keySpec->context ^ (F_CONTEXT_ICONBOX | F_SUBCONTEXT_IB_IICON | F_SUBCONTEXT_IB_WICON))) && iconContext) || ((F_CONTEXT_ICON != (keySpec->context ^ (F_CONTEXT_ICONBOX | F_SUBCONTEXT_IB_IICON | F_SUBCONTEXT_IB_WICON))) && !iconContext)) { WmGrabKey (DISPLAY, keySpec->keycode, keySpec->state, grabWindow, False, GrabModeAsync, keyboardMode); setCount++; } keySpec = keySpec->nextKeySpec; } return (setCount); } /* END OF FUNCTION SetupKeyBindings */ /*************************************<->************************************* * * WmDispatchMenuEvent (event) * * * Description: * ----------- * This function detects and processes events that affect menu behavior that * are NOT dispatched (processed) by the toolkit. The events may cause the * menu to be unposted, may trigger hotspot processing, or may represent * menu accelerators. This processing is generally done when the system * menu is posted in "sticky" mode. * * * Inputs: * ------ * event = This is an X event that has been retrieved by XtNextEvent. * wmGD.menuActive == nonNULL * * * Outputs: * ------- * RETURN = If True the event should be dispatched by the toolkit, * otherwise the event should not be dispatched. * *************************************<->***********************************/ Boolean WmDispatchMenuEvent (XButtonEvent *event) { ClientData *pCD = wmGD.menuClient; Boolean doXtDispatchEvent = True; Boolean checkContext; Context context = 0; /* For fixing the bug CR 5227 */ XKeyEvent *keyEvent; KeySpec *keySpecs; MenuButton *menuBtnPtr; if (event->type == KeyPress) { if (wmGD.menuActive->accelKeySpecs) { /* * Check to see if the KeyPress is a menu accelerator * (don't require context match for system menu accelerators). * If so, the active menu will be unposted and the KeyPress event * will not be sent on to the toolkit. */ checkContext = (!pCD || (pCD->systemMenuSpec != wmGD.menuActive)); if (checkContext) { if (pCD) { if (pCD->clientState == MINIMIZED_STATE) { context = F_CONTEXT_ICON; } else if (pCD->clientState == NORMAL_STATE) { context = F_CONTEXT_NORMAL; } else { context = F_CONTEXT_MAXIMIZE; } } else { context = F_CONTEXT_ROOT; } } /* Begin fixing CR 5227 */ keySpecs = wmGD.menuActive->accelKeySpecs; keyEvent = (XKeyEvent *)event; menuBtnPtr = wmGD.menuActive->menuButtons + (wmGD.menuActive->menuButtonSize - 1); while (keySpecs) { if ((keyEvent->keycode == keySpecs->keycode) && ((keyEvent->state == keySpecs->state) || (NOLOCKMOD(keyEvent->state) == keySpecs->state)) && ((!checkContext) || (context & keySpecs->context))) { doXtDispatchEvent = XtIsSensitive(menuBtnPtr->buttonWidget); break; } keySpecs = keySpecs->nextKeySpec; menuBtnPtr--; } doXtDispatchEvent = doXtDispatchEvent && HandleKeyPress ((XKeyEvent *)event, wmGD.menuActive->accelKeySpecs, checkContext, context, TRUE, (ClientData *)NULL); } if (wmGD.menuActive && wmGD.menuUnpostKeySpec) { if ((wmGD.menuUnpostKeySpec->keycode == event->button) && ((wmGD.menuUnpostKeySpec->state == event->state) || (wmGD.menuUnpostKeySpec->state == NOLOCKMOD(event->state)))) { /* * This is an alternate key for unposting a menu from the * keyboard (in addition to [ESC]). */ UnpostMenu (wmGD.menuActive); doXtDispatchEvent = False; } } #ifdef ROOT_ICON_MENU if (wmGD.menuActive && wmGD.F_NextKeySpec) { if (((wmGD.F_NextKeySpec->state == event->state) || (wmGD.F_NextKeySpec->state == NOLOCKMOD(event->state))) && (wmGD.F_NextKeySpec->keycode == event->button)) { /* * This is a key spec to traverse to the next window * via the keyboard. */ UnpostMenu (wmGD.menuActive); doXtDispatchEvent = False; } } if (wmGD.menuActive && wmGD.F_PrevKeySpec) { if (((wmGD.F_PrevKeySpec->state == event->state) || (wmGD.F_PrevKeySpec->state == NOLOCKMOD(event->state))) && (wmGD.F_PrevKeySpec->keycode == event->button)) { /* * This is a key spec to traverse to the previous window * via the keyboard. */ UnpostMenu (wmGD.menuActive); doXtDispatchEvent = False; } } #endif /* ROOT_ICON_MENU */ } else if (wmGD.checkHotspot && ((event->type == ButtonPress) || (event->type == ButtonRelease)) && (event->x_root >= wmGD.hotspotRectangle.x) && (event->y_root >= wmGD.hotspotRectangle.y) && (event->x_root < (wmGD.hotspotRectangle.x + (short) wmGD.hotspotRectangle.width)) && (event->y_root < (wmGD.hotspotRectangle.y + (short) wmGD.hotspotRectangle.height))&& #ifdef WSM (pCD || (wmGD.rootButtonClick && wmGD.clickData.clickPending))) #else /* WSM */ pCD) #endif /* WSM */ { /* ^^^ * Added check for NULL pCD in the above condition. * We should never get here with a NULL pCD, but, * sometimes our UnmapCallback for a menu does not * get called, so..., we get to this point because * wmGD.menuActive is not cleared, but, wmGD.menuClient * is set to NULL when we unmanage the client window. */ /* * The event triggers hotspot processing for the system menu button * or an icon. */ if (event->type == ButtonRelease) { #ifdef WSM if (pCD) { #endif /* WSM */ /* * The system menu is posted from a system menu button or an * icon. By doing a button release over the system menu button * or icon the system menu that is posted is put into keyboard * traversal mode. */ ProcessClickBRelease (event, pCD, wmGD.clickData.context, wmGD.clickData.subContext); if (wmGD.clickData.context == F_SUBCONTEXT_W_SYSTEM) { PopGadgetOut (pCD, FRAME_SYSTEM); } #ifdef MOTIF_ONE_DOT_ONE TraversalOn (pCD->systemMenuSpec); doXtDispatchEvent = False; #else _XmGetMenuState(XtParent(pCD->systemMenuSpec->menuWidget)) ->MS_LastManagedMenuTime = ((XButtonEvent *)event)->time; doXtDispatchEvent = True; #endif #ifdef WSM } else if ((!wmGD.clickData.pCD) && (((XButtonEvent *)event)->button == wmGD.clickData.button) && ((((XButtonEvent *)event)->state == wmGD.clickData.releaseState) || (NOLOCKMOD(((XButtonEvent *)event)->state) == wmGD.clickData.releaseState))) { /* * This is a button release over the root. Check for * root menu click and keep the menu up in a sticky * fashion. */ Time timeDiff; /* * Check click time */ if (((XButtonEvent *)event)->time > wmGD.clickData.time) { timeDiff = ((XButtonEvent *)event)->time - wmGD.clickData.time; } else { timeDiff = ~wmGD.clickData.time + ((XButtonEvent *)event)->time + 1; } if (timeDiff < wmGD.doubleClickTime) { #ifdef MOTIF_ONE_DOT_ONE TraversalOn (wmGD.menuActive); doXtDispatchEvent = False; #else _XmGetMenuState (XtParent(wmGD.menuActive->menuWidget)) ->MS_LastManagedMenuTime = ((XButtonEvent *)event)->time; doXtDispatchEvent = True; #endif } wmGD.clickData.clickPending = False; } #endif /* WSM */ } else { /* * A button press over a system menu button or an icon when the * system menu is posted indicates that a double-click action is * to be done if appropriate and the menu is to be taken * out of traversal mode (done by the menu widget). */ ProcessClickBPress (event, pCD, wmGD.clickData.context, wmGD.clickData.subContext); if (wmGD.clickData.subContext == F_SUBCONTEXT_W_SYSTEM) { PushGadgetIn (pCD, FRAME_SYSTEM); } if (wmGD.clickData.doubleClickContext == F_SUBCONTEXT_W_SYSTEM) { if (wmGD.systemButtonClick2 && (pCD->clientFunctions & MWM_FUNC_CLOSE)) { /* * Close the client window. Cancel other system menu * button actions. */ UnpostMenu (pCD->systemMenuSpec); F_Kill (NULL, pCD, (XEvent *) event); doXtDispatchEvent = False; } } else if (wmGD.clickData.doubleClickContext == F_SUBCONTEXT_I_ALL) { /* * Normalize the icon. */ int newState; UnpostMenu (pCD->systemMenuSpec); if (pCD->maxConfig) { newState = MAXIMIZED_STATE; } else { newState = NORMAL_STATE; } SetClientState (pCD, newState, event->time); wmGD.clickData.clickPending = False; wmGD.clickData.doubleClickPending = False; doXtDispatchEvent = False; } else if ((wmGD.clickData.doubleClickContext == F_SUBCONTEXT_IB_IICON)|| (wmGD.clickData.doubleClickContext == F_SUBCONTEXT_IB_WICON)) { /* * Raise the Window and Normalize */ UnpostMenu (pCD->systemMenuSpec); F_Restore_And_Raise ((String)NULL, pCD, (XEvent *)NULL); /* F_Normalize_And_Raise ((String)NULL, pCD, (XEvent *)NULL); */ doXtDispatchEvent = False; } /* * Else no special button press processing; have the toolkit * dispatch the event to the menu widgets. */ } } return (doXtDispatchEvent); } /* END OF FUNCTION WmDispatchMenuEvent */ /*************************************<->************************************* * * WmDispatchWsEvent (event) * * * Description: * ----------- * This function detects and dispatches events that are reported to the root * (workspace) window and that are not widget-related (i.e. they would not be * dispatched by the Xtk intrinsics). * * * Inputs: * ------ * event = This is an X event that has been retrieved by XtNextEvent. * * * Outputs: * ------- * RETURN = If True the event should be dispatched by the toolkit, * otherwise the event should not be dispatched. * *************************************<->***********************************/ Boolean WmDispatchWsEvent (XEvent *event) { ClientData *pCD; Boolean dispatchEvent = False; WmScreenData *pSD; /* * Detect and dispatch non-widget events that have been reported to * the root window. */ switch (event->type) { case KeyPress: { /* * The key press is to initiate some window management * function (e.g., shuffle the client windows). */ dispatchEvent = HandleWsKeyPress ((XKeyEvent *)event); break; } case ButtonPress: { /* * The button press is to initiate some window management * function (e.g., pop up the desktop menu). */ if (wmGD.menuActive) { dispatchEvent = True; /* have the toolkit dispatch the event */ } else { HandleWsButtonPress ((XButtonEvent *)event); } break; } case ButtonRelease: { /* * The button release may do some window management * function. */ if (wmGD.menuActive) { dispatchEvent = True; /* have the toolkit dispatch the event */ } else { HandleWsButtonRelease ((XButtonEvent *)event); } break; } case UnmapNotify: { /* BEGIN CR 5183 */ if ( (!XFindContext (DISPLAY, event->xunmap.window, wmGD.windowContextType, (XPointer *)&pCD) ) && (((XUnmapEvent *)event)->window == pCD->client) ) /* END CR 5183 */ { /* * This is a synthetic UnmapNotity used to withdraw a client * window form window manager control. */ UnManageWindow (pCD); } break; } case EnterNotify: { HandleWsEnterNotify ((XEnterWindowEvent *)event); break; } case LeaveNotify: { HandleWsLeaveNotify ((XLeaveWindowEvent *)event); break; } case ConfigureRequest: { HandleWsConfigureRequest ((XConfigureRequestEvent *)event); break; } case MapRequest: { /* * Determine if the window is already being managed: */ if ((XFindContext (DISPLAY, event->xmaprequest.window, wmGD.windowContextType, (caddr_t *)&pCD)) && (pSD = GetScreenForWindow (event->xmaprequest.window))) { /* * The window is not yet managed and it's parented to a * screen/root window that we manage. Start to manage the * new window. Management details are dependent on the * type of the window. For a typical top-level application * window reparent the window to a window frame, add it to * the wm saveset, ... */ ManageWindow (pSD, event->xmaprequest.window, MANAGEW_NORMAL); } /* else ... * The context information on the window WAS found. * The window is already managed by the window manager * so this is redundant request to have the client * window managed. */ break; } case FocusIn: { HandleWsFocusIn ((XFocusInEvent *)event); break; } case FocusOut: { break; } } /* end of event.type switch */ return (dispatchEvent); } /* END OF FUNCTION WmDispatchWsEvent */ /*************************************<->************************************* * * HandleWsKeyPress (keyEvent) * * * Description: * ----------- * This function processes KeyPress events that are reported to the root * window. These events are generally associated with accelerators. * * * Inputs: * ------ * keyEvent = pointer to a key press event on the root window. * * Output: * ------ * RETURN = True is the event is to be dispatched by XtDispatch. * *************************************<->***********************************/ Boolean HandleWsKeyPress (XKeyEvent *keyEvent) { Boolean dispatchEvent = False; Boolean checkKeyEvent = True; unsigned int n; Context context; if (wmGD.menuActive) { /* * The active menu accelerators have been checked and keyEvent was * not one of them. We will check for pass keys mode and then * have the toolkit dispatch the event, without searching any other * key or accelerator specification list. */ dispatchEvent = True; checkKeyEvent = False; } /* * If pass keys is active then only check for getting out of the * pass keys mode. Unfreeze the keyboard and replay the key if * pass keys is active. */ if (wmGD.passKeysActive) { if (wmGD.passKeysKeySpec && ((wmGD.passKeysKeySpec->state == keyEvent->state) || (wmGD.passKeysKeySpec->state == NOLOCKMOD(keyEvent->state))) && (wmGD.passKeysKeySpec->keycode == keyEvent->keycode)) { /* * Get out of the pass keys mode. */ F_Pass_Key (NULL, (ClientData *) NULL, (XEvent *) NULL); XAllowEvents (DISPLAY, AsyncKeyboard, CurrentTime); } else { XAllowEvents (DISPLAY, ReplayKeyboard, CurrentTime); } checkKeyEvent = False; } /* * Search through the key specification list and the menu * accelerator lists until these lists are exhausted or * the event is handled. */ if (checkKeyEvent) { if (wmGD.keyboardFocus) { if (wmGD.keyboardFocus->clientState == MINIMIZED_STATE) { context = F_CONTEXT_ICON; } else if (wmGD.keyboardFocus->clientState == NORMAL_STATE) { context = F_CONTEXT_NORMAL; } else { context = F_CONTEXT_MAXIMIZE; } } else { context = F_CONTEXT_ROOT; } if (HandleKeyPress (keyEvent, ACTIVE_PSD->keySpecs, TRUE, context, FALSE, (ClientData *)NULL) && ACTIVE_PSD->acceleratorMenuCount) { for (n = 0; ((keyEvent->keycode != 0) && (n < ACTIVE_PSD->acceleratorMenuCount)); n++) { if (!HandleKeyPress (keyEvent, ACTIVE_PSD->acceleratorMenuSpecs[n]->accelKeySpecs, TRUE, context, TRUE,(ClientData *)NULL)) { break; } } } /* * Fix for CR 3117 - Do the XAllowEvents after calling HandleKeyPress so that * keys meant for an application can be sent to it. */ XAllowEvents (DISPLAY, AsyncKeyboard, CurrentTime); /* * End Fix for CR 3117 */ } return (dispatchEvent); } /* END OF FUNCTION HandleWsKeyPress */ /*************************************<->************************************* * * HandleKeyPress (keyEvent, keySpecs, checkContext, context, onlyFirst, pCD) * * * Description: * ----------- * This function identifies window manager functions that are triggered by * a KeyPress event. The window manager functions are done if appropriate. * * * Inputs: * ------ * keyEvent = pointer to a key press event on the root window * keySpecs = pointer to a key specification list to search * checkContext = TRUE iff the context must match the keySpec context. * context = context to match keySpec context. * onlyFirst = TRUE iff key processing should stop with the first match. * * Output: * ------ * RETURN = False if key binding processing should be terminated; True if * key binding processing can continue * *************************************<->***********************************/ Boolean HandleKeyPress (XKeyEvent *keyEvent, KeySpec *keySpecs, Boolean checkContext, Context context, Boolean onlyFirst, ClientData *pCD) { Boolean processKey = True; ClientData *functionClient; Boolean haveRootBinding = False; Boolean haveWindowBinding = False; /* * Search for matching key specification. */ while (processKey && keySpecs) { if (((keyEvent->state == keySpecs->state) || (NOLOCKMOD(keyEvent->state) == keySpecs->state)) && (keyEvent->keycode == keySpecs->keycode)) { if ((!checkContext) || (context & keySpecs->context)) { /* * A matching key binding has been found. * Determine the client to which the key binding function is to * apply. * Unpost any active menu and specify that no futher key binding * processing should be done. * Do the function associated with the matching key binding. * Stop if onlyFirst == TRUE */ if (pCD) { functionClient = pCD; } else { functionClient = wmGD.keyboardFocus; } if (wmGD.menuActive) { functionClient = wmGD.menuClient; /* might not have focus! */ UnpostMenu (wmGD.menuActive); processKey = False; } else if (onlyFirst) { processKey = False; } if ((keySpecs->wmFunction == F_Menu) || #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) (keySpecs->wmFunction == F_Post_RMenu) || #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ (keySpecs->wmFunction == F_Post_SMenu)) { wmGD.menuUnpostKeySpec = keySpecs; /* menu unpost key spec */ } else if (keySpecs->wmFunction == F_Pass_Key) { wmGD.passKeysKeySpec = keySpecs; } #ifdef ROOT_ICON_MENU else if (keySpecs->wmFunction == F_Next_Key) { wmGD.F_NextKeySpec = keySpecs; } else if (keySpecs->wmFunction == F_Prev_Key) { wmGD.F_PrevKeySpec = keySpecs; } #endif /* ROOT_ICON_MENU */ if (!(keySpecs->wmFunction (keySpecs->wmFuncArgs, functionClient, keyEvent))) { /* * The window manager function return indicates that further * key binding processing should not be done. */ processKey = False; } /* * Note that for key bindings, frame, title, border, and app contexts * are equivalent to the window context. This is NOT the same as for * button bindings. */ if ((context & (F_CONTEXT_WINDOW))) haveWindowBinding = True; } /* Fix for 3117 -- If the keypress looks as if it had been intended * for the application, send it back. */ else if ((context & (F_CONTEXT_WINDOW)) && (keySpecs->context & F_CONTEXT_ROOT)) { haveRootBinding = True; } } keySpecs = keySpecs->nextKeySpec; } if (haveRootBinding && (!haveWindowBinding) ) { XAllowEvents (DISPLAY, ReplayKeyboard, CurrentTime); } return (processKey); } /* END OF FUNCTION HandleKeyPress */ /*************************************<->************************************* * * HandleWsButtonPress (buttonEvent) * * * Description: * ----------- * This function identifies button events that are associated with window * manager functions. Window manager functions are done if appropriate. * * * Inputs: * ------ * buttonEvent = pointer to a button press event on the root window * *************************************<->***********************************/ void HandleWsButtonPress (XButtonEvent *buttonEvent) { ClientData *pCD; Context context; int partContext; Context subContext; /* * Determine if the top-level window that contains the pointer is a * client managed by the window manager (there may be no window under * the pointer or it may be an "override-redirect" window). */ if ((buttonEvent->subwindow == None) || (XFindContext (DISPLAY, buttonEvent->subwindow, wmGD.windowContextType, (caddr_t *)&pCD))) { /* no managed window under the pointer */ pCD = NULL; } /* * Look through the window manager function button binding list for * matches with the event: */ IdentifyEventContext (buttonEvent, pCD, &context, &partContext); subContext = (1L << partContext); ProcessClickBPress (buttonEvent, pCD, context, subContext); if (CheckForButtonAction (buttonEvent, context, subContext, pCD) && pCD) { /* * Button bindings have been processed, now check for bindings that * are associated with the built-in semantics of the window frame * decorations. */ CheckButtonPressBuiltin (buttonEvent, context, subContext, partContext, pCD); } /* * Else skip built-in processing due to execution of a function that * does on-going event processing or that has changed the client state * (e.g., f.move or f.minimize). */ } /* END OF FUNCTION HandleWsButtonPress */ /*************************************<->************************************* * * HandleWsButtonRelease (buttonEvent) * * * Description: * ----------- * This function identifies button release events that are associated with * window manager functions. Window manager functions are done if * appropriate. * * * Inputs: * ------ * buttonEvent = pointer to a button release event * *************************************<->***********************************/ void HandleWsButtonRelease (XButtonEvent *buttonEvent) { ClientData *pCD; Context context; int partContext; Context subContext; /* * Determine if the top-level window that contains the pointer is a * client managed by the window manager (there may be no window under * the pointer or it may be an "override-redirect" window). */ if ((buttonEvent->subwindow == None) || (XFindContext (DISPLAY, buttonEvent->subwindow, wmGD.windowContextType, (caddr_t *)&pCD))) { /* no managed window under the pointer */ pCD = NULL; } /* * Look for a builtin function that may be done by this event. */ IdentifyEventContext (buttonEvent, pCD, &context, &partContext); subContext = (1L << partContext); ProcessClickBRelease (buttonEvent, pCD, context, subContext); if (CheckForButtonAction (buttonEvent, context, subContext, pCD) && pCD) { /* * Button bindings have been processed, now check for bindings that * are associated with the built-in semantics of the window frame * decorations. */ CheckButtonReleaseBuiltin (buttonEvent, context, subContext, pCD); } /* * Else skip built-in processing due to execution of a function that * does on-going event processing or that has changed the client state * (e.g., f.move or f.minimize). */ } /* END OF FUNCTION HandleWsButtonRelease */ /*************************************<->************************************* * * CheckForButtonAction (buttonEvent, context, subContext, pCD) * * * Description: * ----------- * This function checks to see if a button event is to do a button binding * action. The action is done if specified. * * * Inputs: * ------ * buttonEvent = a button event handled by the window manager * * context = button event context (root, icon, window) * * subContext = button event subContext (title, system button, etc.) * * pCD = a pointer to client data that is associated with the button event * * * Outputs: * ------- * RETURN = If True then further button binding processing can be done; * if false then a state change function, menu function, or * configuration function is ongoing and further button binding * processing should not be done. * * *************************************<->***********************************/ Boolean CheckForButtonAction (XButtonEvent *buttonEvent, Context context, Context subContext, ClientData *pCD) { ButtonSpec *buttonSpec; /* * Look through the window manager function button binding list for * matches with the event: */ buttonSpec = ACTIVE_PSD->buttonSpecs; while (buttonSpec) { if ((buttonEvent->button == buttonSpec->button) && ((buttonEvent->state == buttonSpec->state) || (NOLOCKMOD(buttonEvent->state) == buttonSpec->state))) { /* * See if the event context matches the binding context. */ if ((buttonEvent->type == buttonSpec->eventType) && (context & buttonSpec->context) && (subContext & buttonSpec->subContext)) { /* * For click type bindings check for a match between the * event context and the click / double-click context. */ if (buttonEvent->type == ButtonRelease) { /* * Clicks occur on button releases. A button release * binding is always treated as a click binding. */ if ((buttonSpec->subContext | wmGD.clickData.clickContext) != buttonSpec->subContext) { /* click binding and event contexts do not match */ buttonSpec = buttonSpec->nextButtonSpec; continue; } /* else there is a click match */ } else if (buttonSpec->click && (buttonEvent->type==ButtonPress)) { /* * Double-clicks occur on button presses. */ if ((buttonSpec->subContext | wmGD.clickData.doubleClickContext) != buttonSpec->subContext) { /* click binding and event contexts do not match */ buttonSpec = buttonSpec->nextButtonSpec; continue; } else { /* * The is a double-click match. Don't do any click * or double-click matches for the following button * press and release. */ wmGD.clickData.clickPending = False; wmGD.clickData.doubleClickPending = False; } } if (!(buttonSpec->wmFunction (buttonSpec->wmFuncArgs, pCD, buttonEvent))) { /* * The window manager function return indicates that * further button binding processing should not be done. */ return (False); } } } buttonSpec = buttonSpec->nextButtonSpec; } return (True); } /* END OF FUNCTION CheckForButtonAction */ /*************************************<->************************************* * * IdentifyEventContext (event, pCD, pContext, pPartContext) * * * Description: * ----------- * This function identifies the context in which an event occured. The * pointer position is used to identify the context if the event is a * button event. If the context and the window state are incompatible * (e.g., the context is window and the window is minimized) then the * context is reset to 0 (none). * * * Inputs: * ------ * event = find the context of this X event * * pCD = client data (maybe NULL) that the event is associated with * * * Outputs: * ------- * pContext = event context * * pPartContext = part (e.g, frame) context associated with the event * *************************************<->***********************************/ void IdentifyEventContext (XButtonEvent *event, ClientData *pCD, Context *pContext, int *pPartContext) { Boolean eventOnRoot; Window actionWindow; int clientX; int clientY; int framePart; eventOnRoot = (event->window == ACTIVE_ROOT) ? True : False; if (pCD) { actionWindow = (eventOnRoot) ? event->subwindow : event->window; if (actionWindow == pCD->clientFrameWin) { *pContext = F_CONTEXT_WINDOW; if (eventOnRoot) { clientX = event->x - (pCD->maxConfig ? pCD->maxX : pCD->clientX) + pCD->clientOffset.x; clientY = event->y - (pCD->maxConfig ? pCD->maxY : pCD->clientY) + pCD->clientOffset.y; } else { clientX = event->x; clientY = event->y; } framePart = IdentifyFramePart (pCD, clientX, clientY); *pPartContext = framePart; } else if (actionWindow == pCD->clientBaseWin) { *pContext = F_CONTEXT_WINDOW; *pPartContext = FRAME_CLIENT; } else if ((actionWindow == ICON_FRAME_WIN(pCD)) || (actionWindow == ACTIVE_PSD->activeIconTextWin)) { if (P_ICON_BOX(pCD)) { *pContext = F_CONTEXT_ICONBOX; if (pCD->clientState == MINIMIZED_STATE) { *pPartContext = ICONBOX_PART_IICON; } else { *pPartContext = ICONBOX_PART_WICON; } } else { *pContext = F_CONTEXT_ICON; *pPartContext = ICON_PART_ALL; } } else { *pContext = F_CONTEXT_ROOT; *pPartContext = ROOT_PART_ALL; } /* * Check for an incompatible context and window state. */ if (((*pContext & F_CONTEXT_WINDOW) && (pCD->clientState != NORMAL_STATE) && (pCD->clientState != MAXIMIZED_STATE)) || ((*pContext & F_CONTEXT_ICON) && (pCD->clientState != MINIMIZED_STATE))) { *pContext = F_CONTEXT_NONE; } } else { *pContext = F_CONTEXT_ROOT; *pPartContext = ROOT_PART_ALL; } } /* END OF FUNCTION IdentifyEventContext */ /*************************************<->************************************* * * ProcessClickBPress (buttonEvent, pCD, context, subContext) * * * Description: * ----------- * This function checks for a double-click match and saves state information * to do click and double-click processing. * * * Inputs: * ------ * buttonEvent = pointer to a button press event * * pCD = pointer to client data (identifies client window) * * context = root/window/icon context for the event * * subContext = subcontext for the event (title, system button, etc.) * * * Outputs: * ------- * (wmGD.clickData) = click processing information * * (wmGD.clickData.doubleClickContext) = set if double click occured * *************************************<->***********************************/ void ProcessClickBPress (XButtonEvent *buttonEvent, ClientData *pCD, Context context, Context subContext) { Time timeDiff; Boolean passButton; /* * Check for a double-click. If a double click has occurred then * save the double-click context. */ wmGD.clickData.doubleClickContext = F_SUBCONTEXT_NONE; if (wmGD.clickData.doubleClickPending && (buttonEvent->button == wmGD.clickData.button) && ((buttonEvent->state == wmGD.clickData.state) || (NOLOCKMOD(buttonEvent->state) == wmGD.clickData.state)) && (pCD == wmGD.clickData.pCD) && (context == wmGD.clickData.context)) { /* * Check the time between button release events. */ if (buttonEvent->time > wmGD.clickData.time) { timeDiff = buttonEvent->time - wmGD.clickData.time; } else { timeDiff = ~wmGD.clickData.time + buttonEvent->time + 1; } if (timeDiff < wmGD.doubleClickTime) { /* * A double-click has been done; save the context. */ wmGD.clickData.doubleClickContext = subContext | wmGD.clickData.subContext; } } /* * Save state data for click checking. If a button binding match * occurs for a double-click then clear out the clickData (don't * do any click/double-click matches for the following button press * and release). If the button press is done on the client area and * is used to set the focus to the window then don't use it in * setting up clickData. */ if ((buttonEvent->button == SELECT_BUTTON) && ((buttonEvent->state == 0) || (NOLOCKMOD(buttonEvent->state) == 0))) { passButton = wmGD.passSelectButton; } else { passButton = wmGD.passButtons; } if (!(pCD && (buttonEvent->window == pCD->clientBaseWin) && passButton)) { wmGD.clickData.button = buttonEvent->button; wmGD.clickData.state = buttonEvent->state; /* add in event button mask (this will show up in the button release */ wmGD.clickData.releaseState = buttonEvent->state | buttonModifierMasks[buttonEvent->button]; wmGD.clickData.pCD = pCD; wmGD.clickData.context = context; wmGD.clickData.subContext = subContext; wmGD.clickData.time = buttonEvent->time; wmGD.clickData.clickPending = True; wmGD.clickData.doubleClickPending = True; #ifdef WSM wmGD.clickData.bReplayed = wmGD.bReplayedButton; #endif /* WSM */ } } /* END OF FUNCTION ProcessClickBPress */ /*************************************<->************************************* * * ProcessClickBRelease (buttonEvent, pCD, context, subContext) * * * Description: * ----------- * This function checks to see if a "click" was done. The button release * completes a click if there is a click pending and the button release * context is the same as the button press context. Configuration or * menu activity cancels a pending click. * * * Inputs: * ------ * buttonEvent = pointer to a button press event * * pCD = pointer to client data (identifies client window) * * context = root/window/icon context for the event * * subContext = window subcontext for the event (title, system button, etc.) * * (wmGD.clickData) = click processing information * * * Outputs: * ------- * (wmGD.clickData) = click processing information * * (wmGD.clickData.clickContext) = set if click occured * *************************************<->***********************************/ void ProcessClickBRelease (XButtonEvent *buttonEvent, ClientData *pCD, Context context, Context subContext) { /* * Restore the state of the last "depressed" frame gadget */ if (pCD && (wmGD.gadgetClient == pCD) && (pCD->decorFlags)) { PopGadgetOut(pCD, wmGD.gadgetDepressed); } /* * Check to see if a click has been done. */ wmGD.clickData.clickContext = F_SUBCONTEXT_NONE; if (wmGD.clickData.clickPending && (buttonEvent->button == wmGD.clickData.button) && (buttonEvent->state == wmGD.clickData.releaseState) && (pCD == wmGD.clickData.pCD) && (context == wmGD.clickData.context)) { wmGD.clickData.clickContext = subContext | wmGD.clickData.subContext; /* !!! check for double click time? !!! */ } else { wmGD.clickData.doubleClickPending = False; } wmGD.clickData.clickPending = False; } /* END OF FUNCTION ProcessClickBRelease */ #ifdef WSM /*************************************<->************************************* * * HandleDtWmClientMessage (clientEvent) * * * Description: * ----------- * This function handles client message events that are sent to the * wm window. The window manager action that is taken depends on the * message_type of the event. * * * Inputs: * ------ * clientEvent = pointer to a client message event on the wm window * *************************************<->***********************************/ void HandleDtWmClientMessage (XClientMessageEvent *clientEvent) { int scr; /* * Process the client message event based on the message_type. */ if (clientEvent->message_type == wmGD.xa_DT_SM_WM_PROTOCOL) { if (clientEvent->data.l[0] == wmGD.xa_DT_SM_START_ACK_WINDOWS) { smAckState = SM_START_ACK; } else if (clientEvent->data.l[0] == wmGD.xa_DT_SM_STOP_ACK_WINDOWS) { smAckState = SM_STOP_ACK; } } if (clientEvent->message_type == wmGD.xa_WM_PROTOCOLS) { if (clientEvent->data.l[0] == wmGD.xa_WM_SAVE_YOURSELF) { for (scr = 0; scr < wmGD.numScreens; scr++) { if (wmGD.Screens[scr].managed) { /* * Write out current workspace, frontpanel * position and iconbox position and size. */ SaveResources(&wmGD.Screens[scr]); } } /* for loop */ XSetCommand(DISPLAY, wmGD.commandWindow, 0, 0); } /* WM_SAVE_YOURSELF */ } /* WM_PROTOCOLS */ } /* END OF FUNCTION HandleDtWmClientMessage */ /*************************************<->************************************* * * HandleDtWmRequest (pSD, pev) * * * Description: * ----------- * This function processes _DT_WM_REQUESTs that come in from * other clients * * * Inputs: * ------ * pSD - pointer to screen data * pev - pointer to the triggering event (PropertyNotify) * * Comments: * --------- * This reuses the global parse buffer. It assumes that no parsing * is in progress. All parsing of the config file must be completed * before we call this routine. * * *************************************<->***********************************/ void HandleDtWmRequest (WmScreenData *pSD, XEvent *pev) { Boolean more = True; char *pchReq = NULL; String sRequest = NULL; unsigned char *lineP; int iFuncIndex; WmFunction wmFunction; String wmFuncArgs; ClientData *pCD; Context ctxDisallowed; DtWmpParseBuf wmPB; /* * Save state of global parse buffer */ memcpy (&wmPB, wmGD.pWmPB, sizeof(DtWmpParseBuf)); while (more) { GetDtWmRequest (pSD, &pchReq, &more); if (pchReq) { pCD = NULL; ctxDisallowed = F_CONTEXT_ROOT; if (wmGD.requestContextWin != (Window) 0L) { if (!XFindContext (DISPLAY, wmGD.requestContextWin, wmGD.windowContextType, (caddr_t *)&pCD)) { /* * A valid client window was specified * in a previous F_Set_Context request. * Remove the restriction to root-only context. */ ctxDisallowed = F_CONTEXT_NONE; } } sRequest = XtNewString (pchReq); _DtWmParseSetLine (wmGD.pWmPB, (unsigned char *)sRequest); lineP = wmGD.pWmPB->pchLine; iFuncIndex = ParseWmFunction (&lineP, CRS_BUTTON|CRS_KEY, &wmFunction); if (iFuncIndex != F_NOP_INDEX) { if (functionTable[iFuncIndex].greyedContext & ctxDisallowed) { /* * Sorry, we have to disallow this function request * based on context problems. */ XtFree ((char *)sRequest); sRequest = NULL; break; } /* * Apply the function argument parser. */ if ((*(functionTable [iFuncIndex].parseProc)) (&lineP, wmFunction, &wmFuncArgs)) { /* * Found it in the function table! * Apply the function. */ wmFunction (wmFuncArgs, pCD, NULL); /* * Free up allocated args, if any */ if (wmFuncArgs) { if ((functionTable[iFuncIndex].parseProc == ParseWmFuncStrArg) || (functionTable[iFuncIndex].parseProc == ParseWmFuncMaybeStrArg)) { XtFree ((char *)wmFuncArgs); } else if ((functionTable[iFuncIndex].parseProc == ParseWmFuncActionArg)) { WmActionArg *pAP = (WmActionArg *) wmFuncArgs; if (pAP->actionName) XtFree ((char *) pAP->actionName); if (pAP->szExecParms) XtFree ((char *) pAP->szExecParms); while (pAP->numArgs > 0) { XtFree ((char *) pAP->aap[--(pAP->numArgs)].u.file.name); } XtFree ((char *) pAP); } } } } else if (!strncmp (pchReq, DTWM_REQ_CHANGE_BACKDROP, strlen(DTWM_REQ_CHANGE_BACKDROP))) { Pixmap pixmap = None; char *pch; char *pchFile = NULL; /* skip function name */ pch = pchReq; (void) strtok (pch, " "); /* get path name */ pch = strtok (NULL, " "); if (pch) { pchFile = (char *) XtMalloc (1+strlen(pch)); } else { Warning (((char *)GETMESSAGE(32, 3, "Missing path name for backdrop change request."))); } if (pchFile) { strcpy (pchFile, pch); /* get pixmap id */ pch = strtok (NULL, " "); if (pch) { sscanf (pch, "%lx", &pixmap); SetNewBackdrop (ACTIVE_WS, pixmap, (String)pchFile); } else { Warning (((char *)GETMESSAGE(32, 4, "Missing pixmap id for backdrop change request."))); } XtFree (pchFile); } else { Warning (((char *)GETMESSAGE(32, 2, "Insufficient memory to handle backdrop change."))); } } if (sRequest) { XtFree ((char *) sRequest); } XtFree (pchReq); } } /* * Restore state of global parse buffer */ memcpy (wmGD.pWmPB, &wmPB, sizeof(DtWmpParseBuf)); } /* END OF FUNCTION HandleDtWmRequest */ #endif /* WSM */ /*************************************<->************************************* * * HandleWsEnterNotify (enterEvent) * * * Description: * ----------- * This function processes EnterNotify events that are reported to * the root window. * * * Inputs: * ------ * enterEvent = pointer to an enter notify event on the root window. * *************************************<->***********************************/ void HandleWsEnterNotify (XEnterWindowEvent *enterEvent) { WmScreenData *pSD; /* * If the pointer entered a screen that we manage, then set the * new active screen. */ if (wmGD.queryScreen && (!XFindContext (DISPLAY, enterEvent->window, wmGD.screenContextType, (caddr_t *)&pSD))) { SetActiveScreen (pSD); } /* * The root window was entered; do focus processing * if necessary: */ if (!wmGD.menuActive && ((enterEvent->mode == NotifyNormal) || (enterEvent->mode == NotifyUngrab) || (enterEvent->mode == NotifyWhileGrabbed))) { if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) { Do_Focus_Key ((ClientData *) NULL, enterEvent->time, ALWAYS_SET_FOCUS); } else if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) && ((enterEvent->detail == NotifyNonlinearVirtual) || (enterEvent->detail == NotifyNonlinear)) && (wmGD.keyboardFocus == NULL) && enterEvent->focus) { /* * Reset the explicit selection focus to the workspace * window. */ Do_Focus_Key ((ClientData *) NULL, enterEvent->time, ALWAYS_SET_FOCUS); } if (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER) { SetColormapFocus (ACTIVE_PSD, (ClientData *) NULL); } } } /* END OF FUNCTION HandleWsEnterNotify */ /*************************************<->************************************* * * HandleWsLeaveNotify (leaveEvent) * * * Description: * ----------- * This function processes LeaveNotify events that are reported to * the root window. * * * Inputs: * ------ * enterEvent = pointer to an leave notify event on the root window. * *************************************<->***********************************/ void HandleWsLeaveNotify (XLeaveWindowEvent *leaveEvent) { WmScreenData *pSD; /* * The root window was exited; do focus processing * if necessary: */ if (!wmGD.menuActive && ((leaveEvent->detail == NotifyNonlinear) || (leaveEvent->detail == NotifyNonlinearVirtual))) { /* * The pointer has moved to another screen. Fix the * focus on the screen controlled by the window manager. */ if ((wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) || (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER)) { if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_POINTER) { Do_Focus_Key ((ClientData *) NULL, leaveEvent->time, (SCREEN_SWITCH_FOCUS | ALWAYS_SET_FOCUS)); } if (wmGD.colormapFocusPolicy == CMAP_FOCUS_POINTER) { SetColormapFocus (ACTIVE_PSD, (ClientData *) NULL); } } /* Set new active screen */ if (!XFindContext (DISPLAY, leaveEvent->root, wmGD.screenContextType, (caddr_t *)&pSD)) { /* moved to another screen we manage! */ SetActiveScreen (pSD); } else { /* off onto an unmanaged screen */ wmGD.queryScreen = True; /* set input focus to pointer root */ XSetInputFocus (DISPLAY, PointerRoot, RevertToPointerRoot, leaveEvent->time); } } } /* END OF FUNCTION HandleWsLeaveNotify */ /*************************************<->************************************* * * HandleWsConfigureRequest (focusEvent) * * * Description: * ----------- * This function processes ConfigureRequest events that are reported to * the root window. * * * Inputs: * ------ * focusEvent = pointer to a configure request event on the root window. * *************************************<->***********************************/ void HandleWsConfigureRequest (XConfigureRequestEvent *configureEvent) { ClientData *pCD; XConfigureEvent notifyEvent; Boolean configChanged; XWindowChanges values; /* * A window that is a child of the root window is being * configured. Either it is an un-managed window or it is a * managed window that did the configuration before it was * reparented. */ if (XFindContext (DISPLAY, configureEvent->window, wmGD.windowContextType, (caddr_t *)&pCD)) { /* * Get window attribute information; this is used later on * to decide if a synthetic ConfigureNotify event should * be send to the client. */ if (WmGetWindowAttributes (configureEvent->window)) { configChanged = (wmGD.windowAttributes.x != configureEvent->x) || (wmGD.windowAttributes.y != configureEvent->y) || (wmGD.windowAttributes.width != configureEvent->width) || (wmGD.windowAttributes.height != configureEvent->height) || (wmGD.windowAttributes.border_width != configureEvent->border_width) || (configureEvent->value_mask & (CWSibling|CWStackMode)); /* * The window is not (yet) managed. Do the window * configuration. */ if (configChanged) { values.x = configureEvent->x; values.y = configureEvent->y; values.width = configureEvent->width; values.height = configureEvent->height; values.border_width = configureEvent->border_width; values.sibling = configureEvent->above; values.stack_mode = configureEvent->detail; XConfigureWindow (DISPLAY, configureEvent->window, (unsigned int) (configureEvent->value_mask), &values); } /* * Some clients expect a ConfigureNotify event even if the * XConfigureWindow call has NO effect. Send a synthetic * ConfigureNotify event just to be sure. */ if (!configChanged) { notifyEvent.type = ConfigureNotify; notifyEvent.display = DISPLAY; notifyEvent.event = configureEvent->window; notifyEvent.window = configureEvent->window; notifyEvent.x = configureEvent->x; notifyEvent.y = configureEvent->y; notifyEvent.width = configureEvent->width; notifyEvent.height = configureEvent->height; notifyEvent.border_width = configureEvent->border_width; notifyEvent.above = None; notifyEvent.override_redirect = False; XSendEvent (DISPLAY, configureEvent->window, False, StructureNotifyMask, (XEvent *)¬ifyEvent); } } } else { /* * The context information on the window WAS found. * The window is already managed by the window manager * so this is a configuration request that was made before * the window was reparented. */ HandleCConfigureRequest (pCD, configureEvent); } } /* END OF FUNCTION HandleWsConfigureRequest */ /*************************************<->************************************* * * HandleWsFocusIn (focusEvent) * * * Description: * ----------- * This function processes FocusIn events that are reported to the root * window. * * * Inputs: * ------ * focusEvent = pointer to a focus in event on the root window. * *************************************<->***********************************/ void HandleWsFocusIn (XFocusInEvent *focusEvent) { ClientData *pCD; Boolean sameScreen; /* * This code is used to handle the case of the focus being * set to pointer root (either explicitly by some client, by the window * manager or as a result of a "revert to" action). * It also handles the case where the focus is manipulated by a window * manager on another screen (in this case let the other window manager * control the focus). Reset the focus to a client window if appropriate. */ if (((focusEvent->mode == NotifyNormal) || (focusEvent->mode == NotifyUngrab)) && ((focusEvent->detail == NotifyPointerRoot) || (focusEvent->detail == NotifyDetailNone) || (focusEvent->detail == NotifyInferior))) { /* * Fix the keyboard focus if it should be set to a particular client. */ pCD = GetClientUnderPointer (&sameScreen); if (wmGD.keyboardFocus && (focusEvent->detail != NotifyInferior)) { if (sameScreen) { /* * Assume that the focus still belongs to the screen * controlled by mwm. Repair the focus if the client * is still active. */ if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { Do_Focus_Key (wmGD.keyboardFocus, GetTimestamp (), ALWAYS_SET_FOCUS); } else { if (pCD || (focusEvent->detail == NotifyDetailNone)) { /* !!! check for redundant focus setting !!! */ Do_Focus_Key (pCD, GetTimestamp (), ALWAYS_SET_FOCUS); } } SetKeyboardFocus ((ClientData *) NULL, REFRESH_LAST_FOCUS); } else { /* * Assume that the focus is now controlled by a * window manager on another screen. Clear the * focus locally. */ SetKeyboardFocus ((ClientData *) NULL, REFRESH_LAST_FOCUS); } } else { /* * No client window currently has the focus. If the pointer * is on the mwm-controlled screen set the focus to * the window management window if the focus is explicit. */ if (sameScreen) { if (wmGD.keyboardFocusPolicy == KEYBOARD_FOCUS_EXPLICIT) { if (((focusEvent->detail == NotifyInferior) || (focusEvent->detail == NotifyPointerRoot)) && (wmGD.keyboardFocus != wmGD.nextKeyboardFocus)) { /* * Window that had the focus went away. Try to * reset the window to the next keyboard focus * client window if there is one. */ Do_Focus_Key (wmGD.nextKeyboardFocus, GetTimestamp (), ALWAYS_SET_FOCUS); } else { /* Re: CR 4896 */ /* The previous version would pass NULL widget to this */ /* this routine. This doesn't seem to make sense. NULL */ /* has been replaced by pCD which seems to fix the icon */ /* focus problem. */ /* Another related patch is made in WmCEvent.c. */ Do_Focus_Key ((ClientData *) pCD, GetTimestamp(), ALWAYS_SET_FOCUS); } } else /*KEYBOARD_FOCUS_POINTER*/ { if (pCD || focusEvent->detail != NotifyPointerRoot) { Do_Focus_Key (pCD, GetTimestamp (), ALWAYS_SET_FOCUS); } } } } } } /* END OF FUNCTION HandleWsFocusIn */ /*************************************<->************************************* * * GetTimestamp () * * * Description: * ----------- * This function is used to provide a timestamp for use with X calls that * require a timestamp (and a timestamp is not available from a prior * X event). * * * Outputs: * ------- * Return = a timestamp value * * Comment: * -------- * This costs a server round-trip * *************************************<->***********************************/ Time GetTimestamp (void) { Time timestamp; WmScreenData *pSD = ACTIVE_PSD; XEvent event; long property; /* * Do zero-length append to our own WM_STATE */ XChangeProperty (DISPLAY, pSD->wmWorkspaceWin, wmGD.xa_WM_STATE, wmGD.xa_WM_STATE, 32, PropModeAppend, (unsigned char *)&property, 0); /* * Pick up the property notify event */ XSync (DISPLAY, False); if (XCheckWindowEvent (DISPLAY, pSD->wmWorkspaceWin, PropertyChangeMask, &event)) { if (event.type == PropertyNotify) { timestamp = event.xproperty.time; } else { /* not sure what happened here ... use CurrentTime */ timestamp = CurrentTime; } if ((event.type != PropertyNotify) || (event.xproperty.atom != wmGD.xa_WM_STATE)) { /* * This wasn't the event we caused, put it back for * later processing. We'll keep the timestamp, though. */ XPutBackEvent (DISPLAY, &event); } } else { /* Hmm... didn't get the prop notify, fall back to current time */ timestamp = CurrentTime; } return (timestamp); } /* END OF FUNCTION GetTimestamp */ #if ((!defined(WSM)) || defined(MWM_QATS_PROTOCOL)) /*************************************<->************************************* * * LastTime () * * * Description: * ----------- * This function is used to provide a timestamp for use with X calls that * require a timestamp. It returns the last timestamp processed if one * exists or it generates a new one. * * * Inputs: * ------ * none * * Outputs: * ------- * Return = a timestamp value - NOT CurrentTime * *************************************<->***********************************/ Time LastTime () { Time evTime; if (! (evTime = XtLastTimestampProcessed(DISPLAY)) ) evTime = GetTimestamp(); return (evTime); } #endif /* !defined(WSM) || defined(MWM_QATS_PROTOCOL) */ /*************************************<->************************************* * * PullExposureEvents () * * * Description: * ----------- * Pull in and process all outstanding exposure events * * * Inputs: * ------ * * Outputs: * ------- * * Comments: * -------- * Useful for cleaning up display after menu popdown * *************************************<->***********************************/ void PullExposureEvents (void) { XEvent event; Boolean dispatchEvent; /* * Force the exposure events into the queue */ XSync (DISPLAY, False); #ifdef WSM XSync (DISPLAY1, False); #endif /* WSM */ /* * Selectively extract the exposure events */ #ifdef WSM while (XCheckMaskEvent (DISPLAY, ExposureMask|VisibilityChangeMask, &event) || XCheckMaskEvent (DISPLAY1, ExposureMask|VisibilityChangeMask, &event)) #else /* WSM */ while (XCheckMaskEvent (DISPLAY, ExposureMask, &event)) #endif /* WSM */ { /* * Check for, and process non-widget events. The events may be * reported to the root window, to some client frame window, * to an icon window, or to a "special" window management window. */ #ifdef WSM switch (event.type) { case Expose: #endif /* WSM */ if (event.xany.window == ACTIVE_ROOT) { dispatchEvent = WmDispatchWsEvent (&event); } else { dispatchEvent = WmDispatchClientEvent (&event); } #ifdef WSM default: dispatchEvent = True; } #endif /* WSM */ if (dispatchEvent) { /* * Dispatch widget related event: */ XtDispatchEvent (&event); } } } /* END OF FUNCTION PullExposureEvents */ #ifdef WSM /*************************************<->************************************* * * ReplayedButtonEvent () * * * Description: * ----------- * Compare to button events to see if it's one event that's been * replayed. * * * Inputs: * ------ * * Outputs: * ------- * return = True if event is replayed. * * Comments: * -------- * *************************************<->***********************************/ Boolean ReplayedButtonEvent ( XButtonEvent *pevB1, XButtonEvent *pevB2) { Boolean rval = False; if ( (pevB1->type == pevB2->type) && (pevB1->send_event == pevB2->send_event) && (pevB1->display == pevB2->display) && (pevB1->window == pevB2->window) && (pevB1->root == pevB2->root) && (pevB1->subwindow == pevB2->subwindow) && (pevB1->time == pevB2->time) && (pevB1->x == pevB2->x) && (pevB1->y == pevB2->y) && (pevB1->x_root == pevB2->x_root) && (pevB1->y_root == pevB2->y_root) && (pevB1->state == pevB2->state) && (pevB1->button == pevB2->button) && (pevB1->same_screen == pevB2->same_screen) ) { rval = True; } return (rval); } #endif /* WSM */ motif-2.3.8/clients/Makefile.am0000644000175000017500000000007512672140200013254 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = xmbind mwm uil motif-2.3.8/clients/xmbind/0000755000175000017500000000000013211513006012555 500000000000000motif-2.3.8/clients/xmbind/Makefile.in0000644000175000017500000005035313211512765014563 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = xmbind$(EXEEXT) subdir = clients/xmbind ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) xmbind_SOURCES = xmbind.c xmbind_OBJECTS = xmbind.$(OBJEXT) xmbind_LDADD = $(LDADD) xmbind_DEPENDENCIES = ../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = xmbind.c DIST_SOURCES = xmbind.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in LDADD = ../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clients/xmbind/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign clients/xmbind/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xmbind$(EXEEXT): $(xmbind_OBJECTS) $(xmbind_DEPENDENCIES) $(EXTRA_xmbind_DEPENDENCIES) @rm -f xmbind$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xmbind_OBJECTS) $(xmbind_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmbind.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/clients/xmbind/xmbind.c0000644000175000017500000000546613066310437014150 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: xmbind.c /main/10 1997/06/18 17:34:48 samborn $" #endif #endif #include #include #include /* Internal routines "borrowed" from libXm. Don't try this at home! */ extern Boolean _XmVirtKeysLoadFileBindings(char *fileName, String *binding); extern int _XmVirtKeysLoadFallbackBindings(Display *display, String *binding); int main(argc, argv) int argc; char **argv; { enum { XA_MOTIF_DEFAULT_BINDINGS, XA_MOTIF_BINDINGS }; static char *atom_names[] = { "_MOTIF_DEFAULT_BINDINGS", "_MOTIF_BINDINGS" }; Atom atoms[XtNumber(atom_names)]; XtAppContext app_context; Display *display; String bindings = NULL; XtToolkitInitialize(); app_context = XtCreateApplicationContext(); display = XtOpenDisplay(app_context, NULL, argv[0], "Xmbind", NULL, 0, &argc, argv); if (display == NULL) { fprintf(stderr, "%s: Can't open display\n", argv[0]); exit(1); } XInternAtoms(display, atom_names, XtNumber(atom_names), False, atoms); if (argc == 2) { if (_XmVirtKeysLoadFileBindings (argv[1], &bindings) == True) { XDeleteProperty (display, RootWindow (display, 0), atoms[XA_MOTIF_DEFAULT_BINDINGS]); XChangeProperty (display, RootWindow(display, 0), atoms[XA_MOTIF_BINDINGS], XA_STRING, 8, PropModeReplace, (unsigned char *)bindings, strlen(bindings)); XFlush (display); XtFree (bindings); exit(0); } else { fprintf(stderr, "%s: Can't open %s\n", argv[0], argv[1]); exit(1); } } XDeleteProperty (display, RootWindow (display, 0), atoms[XA_MOTIF_BINDINGS]); XDeleteProperty (display, RootWindow (display, 0), atoms[XA_MOTIF_DEFAULT_BINDINGS]); _XmVirtKeysLoadFallbackBindings (display, &bindings); XFlush (display); XtFree (bindings); exit(0); return 0; /* make compiler happy */ } motif-2.3.8/clients/xmbind/README0000644000175000017500000000062512672140200013362 00000000000000/* $XConsortium: README /main/3 1996/07/15 13:56:01 drk $ */ This directory contains the xmbind client. xmbind is used to set up the bindings between keys on the keyboard and Motif virtual keys. Normally mwm will do this on initialization. If you are not running mwm, or wish to change the bindings without restarting mwm, use xmbind. For more information see the xmbind and VirtualBindings man pages. motif-2.3.8/clients/xmbind/Makefile.am0000644000175000017500000000023512672140200014533 00000000000000MAINTAINERCLEANFILES = Makefile.in bin_PROGRAMS = xmbind LDADD = ../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/aclocal.m40000644000175000017500000012366413211512764011441 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([ac_find_xft.m4]) m4_include([ac_image_support.m4]) m4_include([libtool.m4]) m4_include([ltoptions.m4]) m4_include([ltsugar.m4]) m4_include([ltversion.m4]) m4_include([lt~obsolete.m4]) m4_include([acinclude.m4]) motif-2.3.8/ltsugar.m40000644000175000017500000001044013011021115011466 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) motif-2.3.8/depcomp0000755000175000017500000005601613011021645011141 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: motif-2.3.8/bitmaps/0000755000175000017500000000000013211513004011270 500000000000000motif-2.3.8/bitmaps/xm_warning0000644000175000017500000000247212672140200013315 00000000000000/* $XConsortium: xm_warning /main/5 1995/07/17 10:33:17 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_warning_width 9 #define xm_warning_height 22 static char xm_warning_bits[] = { 0x00, 0x00, 0x18, 0x00, 0x2c, 0x00, 0x56, 0x00, 0x2a, 0x00, 0x56, 0x00, 0x2a, 0x00, 0x56, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00}; motif-2.3.8/bitmaps/xm_noenter16m0000644000175000017500000000236312672140200013645 00000000000000/* $XConsortium: xm_noenter16m /main/5 1995/07/17 10:32:37 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter16m_width 16 #define noenter16m_height 16 static char noenter16m_bits[] = { 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03}; motif-2.3.8/bitmaps/xm_noenter160000644000175000017500000000244312672140200013467 00000000000000/* $XConsortium: xm_noenter16 /main/5 1995/07/17 10:32:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter16_width 16 #define noenter16_height 16 #define noenter16_x_hot 7 #define noenter16_y_hot 7 static char noenter16_bits[] = { 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0xfe, 0x7f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03, 0x00, 0x00}; motif-2.3.8/bitmaps/xm_working0000644000175000017500000000272712672140200013333 00000000000000/* $XConsortium: xm_working /main/5 1995/07/17 10:33:26 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_working_width 21 #define xm_working_height 23 static char xm_working_bits[] = { 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0xaa, 0xaa, 0x0a, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x84, 0x15, 0x06, 0x8c, 0x2a, 0x02, 0x04, 0x15, 0x06, 0x0c, 0x0a, 0x02, 0x04, 0x06, 0x06, 0x0c, 0x0b, 0x02, 0x84, 0x15, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xfe, 0xff, 0x0f, 0x56, 0x55, 0x05, 0x00, 0x00, 0x00}; motif-2.3.8/bitmaps/xm_hour16m0000644000175000017500000000234712672140200013152 00000000000000/* $XConsortium: xm_hour16m /main/5 1995/07/17 10:31:55 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour16m_width 16 #define hour16m_height 16 static char hour16m_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/bitmaps/Makefile.in0000644000175000017500000004261213211512765013277 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = bitmaps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(bm_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bmdir)" HEADERS = $(bm_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = bmdir = @INCDIR@/bitmaps bm_HEADERS = \ xm_error \ xm_hour16 \ xm_hour16m \ xm_hour32 \ xm_hour32m \ xm_information \ xm_noenter16 \ xm_noenter16m \ xm_noenter32 \ xm_noenter32m \ xm_question \ xm_warning \ xm_working all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign bitmaps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bitmaps/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-bmHEADERS: $(bm_HEADERS) @$(NORMAL_INSTALL) @list='$(bm_HEADERS)'; test -n "$(bmdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bmdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bmdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(bmdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(bmdir)" || exit $$?; \ done uninstall-bmHEADERS: @$(NORMAL_UNINSTALL) @list='$(bm_HEADERS)'; test -n "$(bmdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(bmdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bmdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-bmHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-bmHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-bmHEADERS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-bmHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/bitmaps/xm_noenter32m0000644000175000017500000000351312672140200013641 00000000000000/* $XConsortium: xm_noenter32m /main/5 1995/07/17 10:32:56 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter32m_width 32 #define noenter32m_height 32 static char noenter32m_bits[] = { 0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0x07, 0x00}; motif-2.3.8/bitmaps/xm_noenter320000644000175000017500000000357512672140200013474 00000000000000/* $XConsortium: xm_noenter32 /main/5 1995/07/17 10:32:46 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter32_width 32 #define noenter32_height 32 #define noenter32_x_hot 15 #define noenter32_y_hot 15 static char noenter32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00}; motif-2.3.8/bitmaps/xm_question0000644000175000017500000000271112672140200013513 00000000000000/* $XConsortium: xm_question /main/5 1995/07/17 10:33:09 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_question_width 22 #define xm_question_height 22 static char xm_question_bits[] = { 0xf0, 0x3f, 0x00, 0x58, 0x55, 0x00, 0xac, 0xaa, 0x00, 0xd6, 0x5f, 0x01, 0xea, 0xbf, 0x02, 0xf6, 0x7f, 0x01, 0xea, 0xba, 0x02, 0xf6, 0x7d, 0x05, 0xea, 0xba, 0x0a, 0x56, 0x7d, 0x15, 0xaa, 0xbe, 0x1e, 0x56, 0x5f, 0x01, 0xac, 0xaf, 0x02, 0x58, 0x57, 0x01, 0xb0, 0xaf, 0x00, 0x60, 0x55, 0x01, 0xa0, 0xaa, 0x00, 0x60, 0x17, 0x00, 0xa0, 0x2f, 0x00, 0x60, 0x17, 0x00, 0xb0, 0x2a, 0x00, 0x50, 0x55, 0x00}; motif-2.3.8/bitmaps/xm_hour160000644000175000017500000000242112672140200012766 00000000000000/* $XConsortium: xm_hour16 /main/5 1995/07/17 10:31:48 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour16_x_hot 7 #define hour16_y_hot 7 #define hour16_width 16 #define hour16_height 16 static char hour16_bits[] = { 0x00, 0x00, 0xfe, 0x7f, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x24, 0x24, 0x44, 0x22, 0x84, 0x21, 0x84, 0x21, 0x44, 0x22, 0x24, 0x24, 0x14, 0x28, 0x94, 0x29, 0xd4, 0x2b, 0xfe, 0x7f, 0x00, 0x00}; motif-2.3.8/bitmaps/xm_information0000644000175000017500000000254312672140200014174 00000000000000/* $XConsortium: xm_information /main/5 1995/07/17 10:32:20 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_information_width 11 #define xm_information_height 24 static char xm_information_bits[] = { 0x00, 0x00, 0x78, 0x00, 0x54, 0x00, 0x2c, 0x00, 0x54, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x2a, 0x00, 0x5c, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0xae, 0x01, 0x56, 0x01, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00}; motif-2.3.8/bitmaps/xm_error0000644000175000017500000000262612672140200013002 00000000000000/* $XConsortium: xm_error /main/5 1995/07/17 10:31:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_error_width 20 #define xm_error_height 20 static char xm_error_bits[] = { 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0xf0, 0x3a, 0x00, 0x58, 0x55, 0x00, 0x2c, 0xa0, 0x00, 0x56, 0x40, 0x01, 0xaa, 0x80, 0x02, 0x46, 0x81, 0x01, 0x8a, 0x82, 0x02, 0x06, 0x85, 0x01, 0x0a, 0x8a, 0x02, 0x06, 0x94, 0x01, 0x0a, 0xe8, 0x02, 0x14, 0x50, 0x01, 0x28, 0xb0, 0x00, 0xd0, 0x5f, 0x00, 0xa0, 0x2a, 0x00, 0x40, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; motif-2.3.8/bitmaps/xm_hour32m0000644000175000017500000000347712672140200013155 00000000000000/* $XConsortium: xm_hour32m /main/5 1995/07/17 10:32:11 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour32m_width 32 #define hour32m_height 32 static char hour32m_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0x00, 0x00, 0xf3, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0xce, 0x00, 0x00, 0x73, 0x8e, 0x7f, 0xfe, 0x71, 0x0e, 0xff, 0xff, 0x70, 0x0e, 0xfe, 0x7f, 0x70, 0x0e, 0xfc, 0x3f, 0x70, 0x0e, 0xf8, 0x1f, 0x70, 0x0e, 0xe0, 0x07, 0x70, 0x0e, 0xe0, 0x07, 0x70, 0x0e, 0x78, 0x1e, 0x70, 0x0e, 0x1c, 0x38, 0x70, 0x0e, 0x06, 0x60, 0x70, 0x0e, 0x03, 0xc0, 0x70, 0x8e, 0x01, 0x80, 0x71, 0xce, 0x00, 0x00, 0x73, 0x6e, 0x80, 0x01, 0x76, 0x6e, 0xc0, 0x03, 0x76, 0x6e, 0xf0, 0x1f, 0x76, 0x6e, 0xff, 0xff, 0x76, 0xee, 0xff, 0xff, 0x77, 0xcf, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/bitmaps/xm_hour320000644000175000017500000000355312672140200012773 00000000000000/* $XConsortium: xm_hour32 /main/5 1995/07/17 10:32:03 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour32_width 32 #define hour32_height 32 #define hour32_x_hot 15 #define hour32_y_hot 15 static char hour32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0x8c, 0x00, 0x00, 0x31, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x8c, 0x00, 0x00, 0x31, 0x0c, 0x7f, 0xfe, 0x30, 0x0c, 0xfe, 0x7f, 0x30, 0x0c, 0xfc, 0x3f, 0x30, 0x0c, 0xf8, 0x1f, 0x30, 0x0c, 0xe0, 0x07, 0x30, 0x0c, 0x80, 0x01, 0x30, 0x0c, 0x80, 0x01, 0x30, 0x0c, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x30, 0x0c, 0x04, 0x20, 0x30, 0x0c, 0x02, 0x40, 0x30, 0x0c, 0x01, 0x80, 0x30, 0x8c, 0x00, 0x00, 0x31, 0x4c, 0x80, 0x01, 0x32, 0x4c, 0xc0, 0x03, 0x32, 0x4c, 0xf0, 0x1f, 0x32, 0x4c, 0xff, 0xff, 0x32, 0xcc, 0xff, 0xff, 0x33, 0x8c, 0xff, 0xff, 0x31, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; motif-2.3.8/bitmaps/Makefile.am0000644000175000017500000000043313145162623013261 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = bmdir = @INCDIR@/bitmaps bm_HEADERS = \ xm_error \ xm_hour16 \ xm_hour16m \ xm_hour32 \ xm_hour32m \ xm_information \ xm_noenter16 \ xm_noenter16m \ xm_noenter32 \ xm_noenter32m \ xm_question \ xm_warning \ xm_working motif-2.3.8/ltmain.sh0000644000175000017500000117077113011021115011402 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # 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 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >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 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # 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 3 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, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: motif-2.3.8/Makefile.imake-pure0000644000175000017500000001337112672140561013272 00000000000000# Copyright (c) 1987-2012, The Open Group. All rights reserved. # # Motif # # These libraries and programs are free software; you can # redistribute them and/or modify them under the terms of the GNU # Lesser General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) # any later version. # # These libraries and programs are distributed in the hope that # they will be useful, but WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public # License along with these librararies and programs; if not, write # to the Free Software Foundation, Inc., 51 Franklin Street, Fifth # Floor, Boston, MA 02110-1301 USA # # Makefile.ini # # This is a toplevel Makefile for bootstrapping an initial build of Motif # Release 2.x. It provides two targets: Makefile (for the cautious) and # World (for the bold). After the full Makefile has been produced, that # should be used. However, if it is accidentally corrupted, or a build # is initiated on a new platform, Makefile.ini can be used to restart. # RELEASE = "Release 2.3.4" PRODUCT = "Motif" SHELL = /bin/sh RM = rm -f MV = mv NMAKE = nmake WORLDOPTS = -k WIN32WORLDOPTS = -i TOP = . CURRENT_DIR = . CONFIGSRC = $(TOP)/config IMAKESRC = $(CONFIGSRC)/imake DEPENDSRC = $(CONFIGSRC)/makedepend DEPENDTOP = ../.. IMAKETOP = ../.. IRULESRC = $(CONFIGSRC)/cf IMAKE = $(IMAKESRC)/imake IMAKE_CMD = $(IMAKE) -I$(IRULESRC) $(IMAKE_DEFINES) MAKE_OPTS = -f xmakefile MAKE_CMD = $(MAKE) $(MAKE_OPTS) NMAKE_CMD = $(NMAKE) $(MAKE_OPTS) FLAGS = $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)" all: @$(MAKE_CMD) xmakefile-exists || $(MAKE) all-initial @$(MAKE_CMD) $@ all-initial: @echo "Please begin by using make World or make Makefile. You may" @echo "find it necessary to set the make variable BOOTSTRAPCFLAGS in" @echo "order to compile imake. One common example is" @echo "\"BOOTSTRAPCFLAGS=-I\", where is the top of your" @echo "X11R6 source tree. Remember to check the configuration" @echo "parameters in the config directory." @echo @echo "We recommend that you read the release notes carefully before" @echo "proceeding; they can be found under the doc directory. If" @echo "the top-level Makefile gets corrupted, copy Makefile.ini to" @echo "Makefile and try again. Do not name your log file make.log or" @echo "it will be deleted." World: @echo "" @echo "Building $(RELEASE) of $(PRODUCT)" @echo "" @case "x$(BOOTSTRAPCFLAGS)" in x) \ echo I hope you checked the configuration parameters in $(IRULESRC) ; \ echo to see if you need to pass BOOTSTRAPCFLAGS. ; \ echo "" ; \ ;; esac; @date @echo "" cd $(IMAKESRC) && $(MAKE) $(FLAGS) clean $(MAKE) $(MFLAGS) Makefile.boot $(MAKE_CMD) $(MFLAGS) VerifyOS $(MAKE_CMD) $(MFLAGS) Makefiles $(MAKE_CMD) $(MFLAGS) testsMakefile $(MAKE_CMD) $(MFLAGS) clean $(MAKE_CMD) $(MFLAGS) includes $(MAKE_CMD) $(MFLAGS) depend $(MAKE_CMD) $(MFLAGS) $(WORLDOPTS) @echo "" @date @echo "" @echo "Full build of $(RELEASE) of $(PRODUCT) complete." @echo "" .PRECIOUS: Makefile # This is just a sequence of bootstrapping steps we have to do. # The steps are listed as separate targets so clearmake can wink in # the Makefile.proto files. Makefile.boot: imake.proto $(DEPENDSRC)/Makefile.proto depend.bootstrap $(IMAKESRC)/Makefile.proto imake.bootstrap imake.proto: cd $(IMAKESRC) && $(MAKE) $(FLAGS) $(RM) $(DEPENDSRC)/Makefile.proto $(DEPENDSRC)/Makefile.proto: $(IMAKE_CMD) -s $(DEPENDSRC)/Makefile.proto -f $(DEPENDSRC)/Imakefile -DTOPDIR=$(DEPENDTOP) -DCURDIR=$(DEPENDSRC) depend.bootstrap: cd $(DEPENDSRC) && $(RM) -r Makefile Makefile.dep makedepend *.o bootstrap cd $(DEPENDSRC) && $(MAKE) -f Makefile.proto bootstrap $(IMAKESRC)/Makefile.proto: $(IMAKE_CMD) -s $(IMAKESRC)/Makefile.proto -f $(IMAKESRC)/Imakefile -DTOPDIR=$(IMAKETOP) -DCURDIR=$(IMAKESRC) imake.bootstrap: cd $(IMAKESRC) && $(MAKE) -f Makefile.proto bootstrapdepend cd $(IMAKESRC) && $(MAKE) $(FLAGS) bootstrap cd $(IMAKESRC) && $(MAKE) -f Makefile.proto all -@if [ -f xmakefile ]; then set -x; \ $(RM) xmakefile.bak; $(MV) xmakefile xmakefile.bak; \ else exit 0; fi $(MAKE) $(MFLAGS) xmakefile Makefile:: $(MAKE) $(MFLAGS) xmakefile xmakefile: Imakefile $(IMAKE_CMD) -s xmakefile -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) World.Win32: @echo : @echo Building $(RELEASE) of $(PRODUCT). @echo : @echo : cd $(IMAKESRC) $(NMAKE) -f Makefile.ini clean.Win32 $(NMAKE) -f Makefile.ini imake.exe cd ..\.. -if exist xmakefile.bak del xmakefile.bak -if exist xmakefile ren xmakefile xmakefile.bak $(IMAKE:/=\) -s xmakefile -I$(IRULESRC) $(IMAKE_DEFINES) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) $(NMAKE_CMD) $(MFLAGS) VerifyOS $(NMAKE_CMD) $(MFLAGS) Makefiles $(NMAKE_CMD) $(MFLAGS) testsMakefile $(NMAKE_CMD) $(MFLAGS) clean $(NMAKE_CMD) $(MFLAGS) includes $(NMAKE_CMD) $(MFLAGS) depend $(NMAKE_CMD) $(MFLAGS) $(WIN32WORLDOPTS) @echo : @echo : @echo Full build of $(RELEASE) of $(PRODUCT) complete. @echo : # don't allow any default rules in this Makefile .SUFFIXES: # a copy of every rule that might be invoked at top level clean: $(MAKE_CMD) $@ dangerous_strip_clean: $(MAKE_CMD) $@ depend: $(MAKE_CMD) $@ Everything: $(MAKE_CMD) $@ external.ln: $(MAKE_CMD) $@ includes: $(MAKE_CMD) $@ install.ln: $(MAKE_CMD) $@ install.man: $(MAKE_CMD) $@ install: $(MAKE_CMD) $@ install.cde: $(MAKE_CMD) $@ Makefiles: $(MAKE_CMD) $@ man_keywords: $(MAKE_CMD) $@ tags: $(MAKE_CMD) $@ VerifyOS: $(MAKE_CMD) $@ motif-2.3.8/include/0000755000175000017500000000000013211513005011255 500000000000000motif-2.3.8/include/Makefile.in0000644000175000017500000004736513211512767013277 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in config.h.in stamp-h.in SUBDIRS = Dt all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/include/config.h.in0000644000175000017500000002361713211512765013245 00000000000000/* include/config.h.in. Generated from configure.ac by autoheader. */ /* We have the fontconfig library */ #undef CONFDIR /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* System Has langinfo.h */ #undef CSRG_BASED /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* "Debug Themes" */ #undef DEBUGTHEMES /* We have the fontconfig library */ #undef FC_DEFAULT_FONTS /* System supports wchar */ #undef HAS_WIDECHAR_FUNCTIONS /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `FcInit' function. */ #undef HAVE_FCINIT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* This is defined if we find the FontConfig library */ #undef HAVE_FONTCONFIG /* Define to 1 if you have the header file. */ #undef HAVE_FONTCONFIG_FONTCONFIG_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Means we have discovered the FreeType library */ #undef HAVE_FREETYPE /* Define to 1 if you have the header file. */ #undef HAVE_FREETYPE_FREETYPE_H /* Define to 1 if you have the `FT_Init_FreeType' function. */ #undef HAVE_FT_INIT_FREETYPE /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_JPEGLIB_H /* Define to 1 if you have the `jpeg_start_decompress' function. */ #undef HAVE_JPEG_START_DECOMPRESS /* This System has libXmu */ #undef HAVE_LIBXMU /* Define to 1 if you have the `Xp' library (-lXp). */ #undef HAVE_LIBXP /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `png_create_read_struct' function. */ #undef HAVE_PNG_CREATE_READ_STRUCT /* Define to 1 if you have the header file. */ #undef HAVE_PNG_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `regcmp' function. */ #undef HAVE_REGCMP /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the `re_comp' function. */ #undef HAVE_RE_COMP /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strcoll' function and it is properly defined. */ #undef HAVE_STRCOLL /* Define to 1 if you have the `strcspn' function. */ #undef HAVE_STRCSPN /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* 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 `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtod' function. */ #undef HAVE_STRTOD /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MALLOC_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_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 that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the `wcscat' function. */ #undef HAVE_WCSCAT /* Define to 1 if you have the `wcschr' function. */ #undef HAVE_WCSCHR /* Define to 1 if you have the `wcscpy' function. */ #undef HAVE_WCSCPY /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define to 1 if you have the `wcsncat' function. */ #undef HAVE_WCSNCAT /* Define to 1 if you have the `wcsncpy' function. */ #undef HAVE_WCSNCPY /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_PRINT_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_XMU_EDITRES_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XOS_R_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XPOLL_H /* Have XmuNCopyISOLatin1Lowered */ #undef HAVE_XMU_N_COPY_ISO /* Means we have discovered the Xrender library */ #undef HAVE_XRENDER /* Define to 1 if you have the `XRenderParseColor' function. */ #undef HAVE_XRENDERPARSECOLOR /* We have discovered the libjpeg library */ #undef JPEG_SUPPORTED /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* no strcasecmp */ #undef NEED_STRCASECMP /* no strdup */ #undef NEED_STRDUP /* System Missing Xos_r.h */ #undef NEED_XOS_R_H /* system Missing X11/Xpoll.h */ #undef NEED_XPOLL_H /* no memmove */ #undef NO_MEMMOVE /* No Defined Message Catalog */ #undef NO_MESSAGE_CATALOG /* "No OL Compatability" */ #undef NO_OL_COMPAT /* No PUTENV */ #undef NO_PUTENV /* no regcmp */ #undef NO_REGCOMP /* Define if weak aliases are not supported */ #undef NO_WEAK_ALIASES /* XICProc isn't defined */ #undef NO_XICPROC /* Compatibility with OpenMotif 2.2 */ #undef OM22_COMPATIBILITY /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* We have discovered the libpng library */ #undef PNG_SUPPORTED /* Printing is supported */ #undef PRINTING_SUPPORTED /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* This means we will be using the Xft library */ #undef USE_XFT /* "Use XmThemes" */ #undef USE_XMTHEMES /* UTF8 is supported */ #undef UTF8_SUPPORTED /* Define if sprintf doesn't return the number of chars written */ #undef VOID_SPRINTF /* "Has XThreads" */ #undef XTHREADS /* "API is MTSAFE" */ #undef XUSE_MTSAFE_API /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define as `fork' if `vfork' does not work. */ #undef vfork motif-2.3.8/include/Dt/0000755000175000017500000000000013211513005011624 500000000000000motif-2.3.8/include/Dt/HelpQuickD.h0000644000175000017500000000561213145162623013726 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: HelpQuickD.h /main/3 1995/10/26 12:25:25 rswiston $ */ /* * (c) Copyright 1993, 1994 Hewlett-Packard Company * (c) Copyright 1993, 1994 International Business Machines Corp. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * (c) Copyright 1993, 1994 Novell, Inc. */ #ifndef _Dt_HelpQuickD_h #define _Dt_HelpQuickD_h #include
#ifdef __cplusplus extern "C" { #endif /* * Constants */ /* Quick help dialog-specific Resources */ #ifndef DtNbackLabelString #define DtNbackLabelString "backLabelString" #endif #ifndef DtNhelpLabelString #define DtNhelpLabelString XmNhelpLabelString #endif #ifndef DtNmoreLabelString #define DtNmoreLabelString "moreLabelString" #endif #ifndef DtNcloseLabelString #define DtNcloseLabelString "closeLabelString" #endif #ifndef DtNprintLabelString #define DtNprintLabelString "printLabelString" #endif #ifndef DtCCallback #define DtCCallback XmCCallback #endif #ifndef DtCBackLabelString #define DtCBackLabelString "BackLabelString" #endif #ifndef DtCHelpLabelString #define DtCHelpLabelString XmCHelpLabelString #endif #ifndef DtCMoreLabelString #define DtCMoreLabelString "MoreLabelString" #endif #ifndef DtCCloseLabelString #define DtCCloseLabelString "CloseLabelString" #endif #ifndef DtCPrintLabelString #define DtCPrintLabelString "PrintLabelString" #endif /* * Types */ /* Widget class and instance */ typedef struct _DtHelpQuickDialogWidgetClassRec * DtHelpQuickDialogWidgetClass; typedef struct _DtHelpQuickDialogWidgetRec * DtHelpQuickDialogWidget; /* * Data */ /* Widget class record */ externalref WidgetClass dtHelpQuickDialogWidgetClass; /* * Functions */ /* tmp backwards compat */ #define DtCreateQuickHelpDialog DtCreateHelpQuickDialog extern Widget DtCreateHelpQuickDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern Widget DtHelpQuickDialogGetChild( Widget widget, unsigned char child); #ifdef __cplusplus } #endif #endif /* _Dt_HelpQuickD_h */ motif-2.3.8/include/Dt/Makefile.in0000644000175000017500000003632013211512767013633 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = include/Dt ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README noinst_HEADERS = Editor.h \ Help.h \ HelpDialog.h \ HelpQuickD.h \ MenuButton.h \ Print.h \ Term.h \ TermPrim.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Dt/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Dt/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/include/Dt/Editor.h0000644000175000017500000003667613145162623013201 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: Editor.h /main/3 1995/10/26 09:32:07 rswiston $ */ /* * (c) Copyright 1993, 1994 Hewlett-Packard Company * (c) Copyright 1993, 1994 International Business Machines Corp. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * (c) Copyright 1993, 1994 Novell, Inc. */ #ifndef _Dt_Editor_h #define _Dt_Editor_h #include #ifdef __cplusplus extern "C" { #endif /* * Constants */ /* Sources of Help requests */ /* Used with XmNhelpCallback */ #define DtEDITOR_HELP_EDIT_WINDOW 1 #define DtEDITOR_HELP_STATUS_LINE 2 #define DtEDITOR_HELP_STATUS_CURRENT_LINE 3 #define DtEDITOR_HELP_STATUS_TOTAL_LINES 4 #define DtEDITOR_HELP_STATUS_MESSAGE 5 #define DtEDITOR_HELP_STATUS_OVERSTRIKE 6 #define DtEDITOR_HELP_FORMAT_DIALOG 7 #define DtEDITOR_HELP_FORMAT_LEFT_MARGIN 8 #define DtEDITOR_HELP_FORMAT_RIGHT_MARGIN 9 #define DtEDITOR_HELP_FORMAT_ALIGNMENT 10 #define DtEDITOR_HELP_CHANGE_DIALOG 11 #define DtEDITOR_HELP_CHANGE_FIND 12 #define DtEDITOR_HELP_CHANGE_CHANGE 13 #define DtEDITOR_HELP_SPELL_DIALOG 14 #define DtEDITOR_HELP_SPELL_MISSPELLED_WORDS 15 #define DtEDITOR_HELP_SPELL_CHANGE 16 /* Specifies the last line in the edit area */ /* Used with DtEditorGoToLine */ #define DtEDITOR_LAST_LINE -999 /* Resource constants */ #ifndef DtNautoShowCursorPosition #define DtNautoShowCursorPosition XmNautoShowCursorPosition #endif #ifndef DtCAutoShowCursorPosition #define DtCAutoShowCursorPosition XmCAutoShowCursorPosition #endif #ifndef DtNblinkRate #define DtNblinkRate XmNblinkRate #endif #ifndef DtCBlinkRate #define DtCBlinkRate XmCBlinkRate #endif #ifndef DtNbuttonFontList #define DtNbuttonFontList XmNbuttonFontList #endif #ifndef DtCFontList #define DtCFontList XmCFontList #endif #ifndef DtNcenterToggleLabel #define DtNcenterToggleLabel "centerToggleLabel" #endif #ifndef DtCCenterToggleLabel #define DtCCenterToggleLabel "CenterToggleLabel" #endif #ifndef DtNchangeAllButtonLabel #define DtNchangeAllButtonLabel "changeAllButtonLabel" #endif #ifndef DtCChangeAllButtonLabel #define DtCChangeAllButtonLabel "ChangeAllButtonLabel" #endif #ifndef DtNchangeButtonLabel #define DtNchangeButtonLabel "changeButtonLabel" #endif #ifndef DtCChangeButtonLabel #define DtCChangeButtonLabel "ChangeButtonLabel" #endif #ifndef DtNchangeFieldLabel #define DtNchangeFieldLabel "changeFieldLabel" #endif #ifndef DtCChangeFieldLabel #define DtCChangeFieldLabel "ChangeFieldLabel" #endif #ifndef DtNcolumns #define DtNcolumns XmNcolumns #endif #ifndef DtCColumns #define DtCColumns XmCColumns #endif #ifndef DtNcurrentLineLabel #define DtNcurrentLineLabel "currentLineLabel" #endif #ifndef DtCCurrentLineLabel #define DtCCurrentLineLabel "CurrentLineLabel" #endif #ifndef DtNcursorPosition #define DtNcursorPosition XmNcursorPosition #endif #ifndef DtCCursorPosition #define DtCCursorPosition XmCCursorPosition #endif #ifndef DtNcursorPositionVisible #define DtNcursorPositionVisible XmNcursorPositionVisible #endif #ifndef DtCCursorPositionVisible #define DtCCursorPositionVisible XmCCursorPositionVisible #endif #ifndef DtNdialogTitle #define DtNdialogTitle "dialogTitle" #endif #ifndef DtCDialogTitle #define DtCDialogTitle XmCDialogTitle #endif #ifndef DtNeditable #define DtNeditable XmNeditable #endif #ifndef DtCEditable #define DtCEditable XmCEditable #endif #ifndef DtNfindButtonLabel #define DtNfindButtonLabel "findButtonLabel" #endif #ifndef DtCFindButtonLabel #define DtCFindButtonLabel "FindButtonLabel" #endif #ifndef DtNfindChangeDialogTitle #define DtNfindChangeDialogTitle "findChangeDialogTitle" #endif #ifndef DtCFindChangeDialogTitle #define DtCFindChangeDialogTitle "FindChangeDialogTitle" #endif #ifndef DtNfindFieldLabel #define DtNfindFieldLabel "findFieldLabel" #endif #ifndef DtCFindFieldLabel #define DtCFindFieldLabel "FindFieldLabel" #endif #ifndef DtNformatAllButtonLabel #define DtNformatAllButtonLabel "formatAllButtonLabel" #endif #ifndef DtCFormatAllButtonLabel #define DtCFormatAllButtonLabel "FormatAllButtonLabel" #endif #ifndef DtNformatParagraphButtonLabel #define DtNformatParagraphButtonLabel "formatParagraphButtonLabel" #endif #ifndef DtCFormatParagraphButtonLabel #define DtCFormatParagraphButtonLabel "FormatParagraphButtonLabel" #endif #ifndef DtNformatSettingsDialogTitle #define DtNformatSettingsDialogTitle "formatSettingsDialogTitle" #endif #ifndef DtCFormatSettingsDialogTitle #define DtCFormatSettingsDialogTitle "FormatSettingsDialogTitle" #endif #ifndef DtNinformationDialogTitle #define DtNinformationDialogTitle "informationDialogTitle" #endif #ifndef DtCInformationDialogTitle #define DtCInformationDialogTitle "InformationDialogTitle" #endif #ifndef DtNinsertLabel #define DtNinsertLabel "insertLabel" #endif #ifndef DtCInsertLabel #define DtCInsertLabel "InsertLabel" #endif #ifndef DtNjustifyToggleLabel #define DtNjustifyToggleLabel "justifyToggleLabel" #endif #ifndef DtCJustifyToggleLabel #define DtCJustifyToggleLabel "JustifyToggleLabel" #endif #ifndef DtNlabelFontList #define DtNlabelFontList XmNlabelFontList #endif #ifndef DtNleftAlignToggleLabel #define DtNleftAlignToggleLabel "leftAlignToggleLabel" #endif #ifndef DtCLeftAlignToggleLabel #define DtCLeftAlignToggleLabel "LeftAlignToggleLabel" #endif #ifndef DtNleftMarginFieldLabel #define DtNleftMarginFieldLabel "leftMarginFieldLabel" #endif #ifndef DtCLeftMarginFieldLabel #define DtCLeftMarginFieldLabel "LeftMarginFieldLabel" #endif #ifndef DtNmaxLength #define DtNmaxLength XmNmaxLength #endif #ifndef DtCMaxLength #define DtCMaxLength XmCMaxLength #endif #ifndef DtNmisspelledListLabel #define DtNmisspelledListLabel "misspelledListLabel" #endif #ifndef DtCMisspelledListLabel #define DtCMisspelledListLabel "MisspelledListLabel" #endif #ifndef DtNoverstrike #define DtNoverstrike "overstrike" #endif #ifndef DtCOverstrike #define DtCOverstrike "Overstrike" #endif #ifndef DtNoverstrikeLabel #define DtNoverstrikeLabel "overstrikeLabel" #endif #ifndef DtCOverstrikeLabel #define DtCOverstrikeLabel "OverstrikeLabel" #endif #ifndef DtNrightAlignToggleLabel #define DtNrightAlignToggleLabel "rightAlignToggleLabel" #endif #ifndef DtCRightAlignToggleLabel #define DtCRightAlignToggleLabel "RightAlignToggleLabel" #endif #ifndef DtNrightMarginFieldLabel #define DtNrightMarginFieldLabel "rightMarginFieldLabel" #endif #ifndef DtCRightMarginFieldLabel #define DtCRightMarginFieldLabel "RightMarginFieldLabel" #endif #ifndef DtNrows #define DtNrows XmNrows #endif #ifndef DtCRows #define DtCRows XmCRows #endif #ifndef DtNscrollHorizontal #define DtNscrollHorizontal XmNscrollHorizontal #endif #ifndef DtCScroll #define DtCScroll XmCScroll #endif #ifndef DtNscrollLeftSide #define DtNscrollLeftSide XmNscrollLeftSide #endif #ifndef DtCScrollSide #define DtCScrollSide XmCScrollSide #endif #ifndef DtNscrollTopSide #define DtNscrollTopSide XmNscrollTopSide #endif #ifndef DtNscrollVertical #define DtNscrollVertical XmNscrollVertical #endif #ifndef DtNshowStatusLine #define DtNshowStatusLine "showStatusLine" #endif #ifndef DtCShowStatusLine #define DtCShowStatusLine "ShowStatusLine" #endif #ifndef DtNspellDialogTitle #define DtNspellDialogTitle "spellDialogTitle" #endif #ifndef DtCSpellDialogTitle #define DtCSpellDialogTitle "SpellDialogTitle" #endif #ifndef DtNspellFilter #define DtNspellFilter "spellFilter" #endif #ifndef DtCSpellFilter #define DtCSpellFilter "SpellFilter" #endif #ifndef DtNtextBackground #define DtNtextBackground "textBackground" #endif #ifndef DtCBackground #define DtCBackground XmCBackground #endif #ifndef DtNtextDeselectCallback #define DtNtextDeselectCallback "textDeselectCallback" #endif #ifndef DtNtextFontList #define DtNtextFontList XmNtextFontList #endif #ifndef DtNtextForeground #define DtNtextForeground "textForeground" #endif #ifndef DtCForeground #define DtCForeground XmCForeground #endif #ifndef DtNtextSelectCallback #define DtNtextSelectCallback "textSelectCallback" #endif #ifndef DtNtextTranslations #define DtNtextTranslations XmNtextTranslations #endif #ifndef DtCTranslations #define DtCTranslations XmCTranslations #endif #ifndef DtCCallback #define DtCCallback XmCCallback #endif #ifndef DtNtopCharacter #define DtNtopCharacter XmNtopCharacter #endif #ifndef DtCTopCharacter #define DtCTopCharacter XmCTopCharacter #endif #ifndef DtNtotalLineCountLabel #define DtNtotalLineCountLabel "totalLineCountLabel" #endif #ifndef DtCTotalLineCountLabel #define DtCTotalLineCountLabel "TotalLineCountLabel" #endif #ifndef DtNwordWrap #define DtNwordWrap XmNwordWrap #endif #ifndef DtCWordWrap #define DtCWordWrap XmCWordWrap #endif #ifndef DtEditorHelpCallbackStruct #define DtEditorHelpCallbackStruct XmAnyCallbackStruct #endif #ifndef DtEditorSelectCallbackStruct #define DtEditorSelectCallbackStruct XmAnyCallbackStruct #endif #ifndef DtEditorDeselectCallbackStruct #define DtEditorDeselectCallbackStruct XmAnyCallbackStruct #endif /* Used with DtEditorChange() */ enum { DtEDITOR_CURRENT_SELECTION, DtEDITOR_NEXT_OCCURRENCE, DtEDITOR_ALL_OCCURRENCES }; /* Used with DtEditorFormat() */ enum { DtEDITOR_FORMAT_ALL, DtEDITOR_FORMAT_PARAGRAPH }; enum { DtEDITOR_ALIGN_CENTER, DtEDITOR_ALIGN_JUSTIFY, DtEDITOR_ALIGN_LEFT, DtEDITOR_ALIGN_RIGHT }; /* Used with DtNtextSelectCallback */ enum { DtEDITOR_TEXT_SELECT, DtEDITOR_TEXT_DESELECT }; /* * Types */ typedef enum _DtEditorErrorCode{ DtEDITOR_NO_ERRORS, DtEDITOR_INVALID_TYPE, DtEDITOR_INVALID_RANGE, DtEDITOR_NULL_ITEM, DtEDITOR_ILLEGAL_SIZE, DtEDITOR_SPELL_FILTER_FAILED, DtEDITOR_NO_TMP_FILE, DtEDITOR_INVALID_FILENAME, DtEDITOR_NONEXISTENT_FILE, DtEDITOR_UNREADABLE_FILE, DtEDITOR_READ_ONLY_FILE, DtEDITOR_NO_FILE_ACCESS, DtEDITOR_DIRECTORY, DtEDITOR_CHAR_SPECIAL_FILE, DtEDITOR_BLOCK_MODE_FILE, DtEDITOR_UNWRITABLE_FILE, DtEDITOR_WRITABLE_FILE, DtEDITOR_SAVE_FAILED, DtEDITOR_INSUFFICIENT_MEMORY, DtEDITOR_NULLS_REMOVED } DtEditorErrorCode; /* Used with DtEditorChange() to specify Find and Change To strings */ typedef struct _DtEditorChangeValues { char *find; char *changeTo; } DtEditorChangeValues; /* Used with DtEditorFormat() to specify left margin, right margin * * and justification styles. */ typedef struct _DtEditorFormatSettings { int leftMargin; int rightMargin; unsigned int alignment; } DtEditorFormatSettings; /* Types used to tag data to/from the editor widget */ typedef enum _DtEditorDataFormat{ DtEDITOR_TEXT, DtEDITOR_WCHAR, DtEDITOR_DATA } DtEditorDataFormat; /* Types used to pass data to/from the editor widget */ typedef struct _DtEditor_DataObj { unsigned int length; void *buf; } DtEditor_DataObj; typedef struct _DtEditorContentRec { DtEditorDataFormat type; union { char *string; wchar_t *wchar; DtEditor_DataObj data; } value; } DtEditorContentRec; /* Widget class and instance */ typedef struct _DtEditorClassRec *DtEditorClass; typedef struct _DtEditorRec *DtEditorWidget; /* * Data */ /* Widget class */ externalref WidgetClass dtEditorWidgetClass; /* * Functions */ extern Widget DtCreateEditor( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern DtEditorErrorCode DtEditorAppend( Widget widget, DtEditorContentRec *data); extern DtEditorErrorCode DtEditorAppendFromFile( Widget widget, char *fileName); extern Boolean DtEditorChange( Widget widget, DtEditorChangeValues *findChangeStrings, unsigned int instanceToChange); extern Boolean DtEditorCheckForUnsavedChanges( Widget widget); extern Boolean DtEditorClearSelection( Widget widget); extern Boolean DtEditorCopyToClipboard( Widget widget); extern Boolean DtEditorCutToClipboard( Widget widget); extern Boolean DtEditorDeleteSelection( Widget widget); extern Boolean DtEditorDeselect( Widget widget); extern void DtEditorDisableRedisplay( Widget widget); extern void DtEditorEnableRedisplay( Widget widget); extern Boolean DtEditorFind( Widget widget, char * find); extern DtEditorErrorCode DtEditorFormat( Widget widget, DtEditorFormatSettings *formatSettings, unsigned int amountToFormat); extern DtEditorErrorCode DtEditorGetContents( Widget widget, DtEditorContentRec *data, Boolean hardCarriageReturns, Boolean markContentsAsSaved); extern XmTextPosition DtEditorGetInsertionPosition( Widget widget); extern XmTextPosition DtEditorGetLastPosition( Widget widget); extern Widget DtEditorGetMessageTextFieldID( Widget widget); extern void DtEditorGetSizeHints( Widget widget, XSizeHints *pHints); extern void DtEditorGoToLine( Widget widget, int lineNumber); extern DtEditorErrorCode DtEditorInsert( Widget widget, DtEditorContentRec *data); extern DtEditorErrorCode DtEditorInsertFromFile( Widget widget, char *fileName); extern void DtEditorInvokeFindChangeDialog( Widget widget); extern void DtEditorInvokeFormatDialog( Widget widget); extern DtEditorErrorCode DtEditorInvokeSpellDialog( Widget widget); extern Boolean DtEditorPasteFromClipboard( Widget widget); extern DtEditorErrorCode DtEditorReplace( Widget widget, XmTextPosition startPos, XmTextPosition endPos, DtEditorContentRec *data); extern DtEditorErrorCode DtEditorReplaceFromFile( Widget widget, XmTextPosition startPos, XmTextPosition endPos, char *fileName); extern void DtEditorReset( Widget widget); extern DtEditorErrorCode DtEditorSaveContentsToFile( Widget widget, char *fileName, Boolean overwriteIfExists, Boolean hardCarriageReturns, Boolean markContentsAsSaved); extern Boolean DtEditorSelectAll( Widget widget); extern DtEditorErrorCode DtEditorSetContents( Widget widget, DtEditorContentRec *data); extern DtEditorErrorCode DtEditorSetContentsFromFile( Widget widget, char *fileName); extern void DtEditorSetInsertionPosition( Widget widget, XmTextPosition position); extern void DtEditorTraverseToEditor( Widget widget); extern Boolean DtEditorUndoEdit( Widget widget); #ifdef __cplusplus } #endif #endif /* _Dt_Editor_h */ motif-2.3.8/include/Dt/Help.h0000644000175000017500000001516513145162623012631 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: Help.h /main/3 1995/10/26 12:23:24 rswiston $ */ /* * (c) Copyright 1993, 1994 Hewlett-Packard Company * (c) Copyright 1993, 1994 International Business Machines Corp. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * (c) Copyright 1993, 1994 Novell, Inc. */ #ifndef _Dt_Help_h #define _Dt_Help_h #include #ifdef __cplusplus extern "C" { #endif /* * Constants */ /* Common DtHelp Resources */ #ifndef DtNcloseCallback #define DtNcloseCallback "closeCallback" #endif #ifndef DtNcolumns #define DtNcolumns XmNcolumns #endif #ifndef DtNexecutionPolicy #define DtNexecutionPolicy "executionPolicy" #endif #ifndef DtNhelpFile #define DtNhelpFile "helpFile" #endif #ifndef DtNhelpOnHelpVolume #define DtNhelpOnHelpVolume "helpOnHelpVolume" #endif #ifndef DtNhelpPrint #define DtNhelpPrint "helpPrint" #endif #ifndef DtNhelpType #define DtNhelpType "helpType" #endif #ifndef DtNhelpVolume #define DtNhelpVolume "helpVolume" #endif #ifndef DtNhyperLinkCallback #define DtNhyperLinkCallback "hyperLinkCallback" #endif #ifndef DtNlocationId #define DtNlocationId "locationId" #endif #ifndef DtNmanPage #define DtNmanPage "manPage" #endif #ifndef DtNminimizeButtons #define DtNminimizeButtons XmNminimizeButtons #endif #ifndef DtNpaperSize #define DtNpaperSize "paperSize" #endif #ifndef DtNprinter #define DtNprinter "printer" #endif #ifndef DtNrows #define DtNrows XmNrows #endif #ifndef DtNscrollBarPolicy #define DtNscrollBarPolicy "scrollBarPolicy" #endif #ifndef DtNstringData #define DtNstringData "stringData" #endif #ifndef DtCCallback #define DtCCallback XmCCallback #endif #ifndef DtCCloseCallback #define DtCCloseCallback "CloseCallback" #endif #ifndef DtCColumns #define DtCColumns XmCColumns #endif #ifndef DtCExecutionPolicy #define DtCExecutionPolicy "ExecutionPolicy" #endif #ifndef DtCHelpFile #define DtCHelpFile "HelpFile" #endif #ifndef DtCHelpOnHelpVolume #define DtCHelpOnHelpVolume "HelpOnHelpVolume" #endif #ifndef DtCHelpPrint #define DtCHelpPrint "HelpPrint" #endif #ifndef DtCHelpType #define DtCHelpType "HelpType" #endif #ifndef DtCHelpVolume #define DtCHelpVolume "HelpVolume" #endif #ifndef DtCHyperLinkCallback #define DtCHyperLinkCallback "HyperLinkCallback" #endif #ifndef DtCLocationId #define DtCLocationId "LocationId" #endif #ifndef DtCManPage #define DtCManPage "ManPage" #endif #ifndef DtCMinimizeButtons #define DtCMinimizeButtons XmCMinimizeButtons #endif #ifndef DtCPaperSize #define DtCPaperSize "PaperSize" #endif #ifndef DtCPrinter #define DtCPrinter "Printer" #endif #ifndef DtCRows #define DtCRows XmCRows #endif #ifndef DtCScrollBarPolicy #define DtCScrollBarPolicy "ScrollBarPolicy" #endif #ifndef DtCStringData #define DtCStringData "StringData" #endif /* Representation types */ #ifndef DtRDtExecutionPolicy #define DtRDtExecutionPolicy "DtExecutionPolicy" #endif #ifndef DtRDtHelpType #define DtRDtHelpType "DtHelpType" #endif #ifndef DtRDtPaperSize #define DtRDtPaperSize "DtPaperSize" #endif #ifndef DtRDtScrollBarPolicy #define DtRDtScrollBarPolicy "DtScrollBarPolicy" #endif /* DtHelpDialogCallbackStruct windowHint field */ #define DtHELP_POPUP_WINDOW 1 #define DtHELP_CURRENT_WINDOW 2 #define DtHELP_NEW_WINDOW 3 /* DtHelpDialogCallbackStruct hyperType field */ #define DtHELP_LINK_JUMP_NEW 1 #define DtHELP_LINK_TOPIC 1 #define DtHELP_LINK_MAN_PAGE 4 #define DtHELP_LINK_APP_DEFINE 5 #define DtHELP_LINK_TEXT_FILE 8 /* DtHelpDialogCallbackStruct reason field */ #define DtCR_HELP_LINK_ACTIVATE 1 #define DtCR_HELP_CLOSE 2 #define DtCR_HELP_HELP 3 /* Possible values for DtNscrollBarPolicy resource */ #define DtHELP_NO_SCROLLBARS 0 #define DtHELP_STATIC_SCROLLBARS 1 #define DtHELP_AS_NEEDED_SCROLLBARS 2 /* Possible values for DtNexecutionPolicy resource */ #define DtHELP_EXECUTE_NONE 0 #define DtHELP_EXECUTE_QUERY_ALL 1 #define DtHELP_EXECUTE_QUERY_UNALIASED 2 #define DtHELP_EXECUTE_ALL 3 /* Possible values for DtNhelpType resource */ #define DtHELP_TYPE_TOPIC 0 #define DtHELP_TYPE_STRING 1 #define DtHELP_TYPE_MAN_PAGE 2 #define DtHELP_TYPE_FILE 3 #define DtHELP_TYPE_DYNAMIC_STRING 4 /* Possible values for DtNpaperSize resource */ #define DtHELP_PAPERSIZE_LETTER 0 #define DtHELP_PAPERSIZE_LEGAL 1 #define DtHELP_PAPERSIZE_EXECUTIVE 2 #define DtHELP_PAPERSIZE_A4 3 #define DtHELP_PAPERSIZE_B5 4 /* DtHelpQuickGetChildGetChild() function */ #define DtHELP_QUICK_CLOSE_BUTTON 1 #define DtHELP_QUICK_PRINT_BUTTON 2 #define DtHELP_QUICK_HELP_BUTTON 3 #define DtHELP_QUICK_SEPARATOR 4 #define DtHELP_QUICK_MORE_BUTTON 5 #define DtHELP_QUICK_BACK_BUTTON 6 /* Return values for DtHelpReturnSelectedWidgetId() */ #define DtHELP_SELECT_ERROR -1 #define DtHELP_SELECT_VALID 0 #define DtHELP_SELECT_ABORT 1 #define DtHELP_SELECT_INVALID 2 /* * Types */ typedef struct { int reason; XEvent *event; char *locationId; char *helpVolume; char *specification; int hyperType; int windowHint; } DtHelpDialogCallbackStruct; /* * Functions */ extern void DtHelpSetCatalogName( char *catFile); extern int DtHelpReturnSelectedWidgetId( Widget parent, Cursor cursor, Widget *widget); #ifdef __cplusplus } #endif #endif /* _Dt_Help_h */ motif-2.3.8/include/Dt/TermPrim.h0000644000175000017500000003022213145162623013467 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: TermPrim.h /main/1 1996/04/21 19:16:41 drk $ */ /* * (c) Copyright 1993, 1994 Hewlett-Packard Company * (c) Copyright 1993, 1994 International Business Machines Corp. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * (c) Copyright 1993, 1994 Novell, Inc. */ #ifndef _Dt_TermPrim_h #define _Dt_TermPrim_h #include #include #ifdef __cplusplus extern "C" { #endif /* * Constants */ /* Resources */ #ifndef DtNbackgroundIsSelect #define DtNbackgroundIsSelect "backgroundIsSelect" #endif #ifndef DtNblinkRate #define DtNblinkRate "blinkRate" #endif #ifndef DtNcharCursorStyle #define DtNcharCursorStyle "charCursorStyle" #endif #ifndef DtNconsoleMode #define DtNconsoleMode "consoleMode" #endif #ifndef DtNcsWidth #define DtNcsWidth "csWidth" #endif #ifndef DtNemulationId #define DtNemulationId "emulationId" #endif #ifndef DtNinputVerifyCallback #define DtNinputVerifyCallback "inputVerifyCallback" #endif #ifndef DtNjumpScroll #define DtNjumpScroll "jumpScroll" #endif #ifndef DtNkshMode #define DtNkshMode "kshMode" #endif #ifndef DtNlogFile #define DtNlogFile "logFile" #endif #ifndef DtNlogInhibit #define DtNlogInhibit "logInhibit" #endif #ifndef DtNlogging #define DtNlogging "logging" #endif #ifndef DtNloginShell #define DtNloginShell "loginShell" #endif #ifndef DtNmapOnOutput #define DtNmapOnOutput "mapOnOutput" #endif #ifndef DtNmapOnOutputDelay #define DtNmapOnOutputDelay "mapOnOutputDelay" #endif #ifndef DtNmarginBell #define DtNmarginBell "marginBell" #endif #ifndef DtNnMarginBell #define DtNnMarginBell "nMarginBell" #endif #ifndef DtNoutputLogCallback #define DtNoutputLogCallback "outputLogCallback" #endif #ifndef DtNpointerBlank #define DtNpointerBlank "pointerBlank" #endif #ifndef DtNpointerBlankDelay #define DtNpointerBlankDelay "pointerBlankDelay" #endif #ifndef DtNpointerColor #define DtNpointerColor "pointerColor" #endif #ifndef DtNpointerColorBackground #define DtNpointerColorBackground "pointerColorBackground" #endif #ifndef DtNpointerShape #define DtNpointerShape "pointerShape" #endif #ifndef DtNreverseVideo #define DtNreverseVideo "reverseVideo" #endif #ifndef DtNsaveLines #define DtNsaveLines "saveLines" #endif #ifndef DtNsizeList #define DtNsizeList "sizeList" #endif #ifndef DtNstatusChangeCallback #define DtNstatusChangeCallback "statusChangeCallback" #endif #ifndef DtNstickyNextCursor #define DtNstickyNextCursor "stickyNextCursor" #endif #ifndef DtNstickyPrevCursor #define DtNstickyPrevCursor "stickyPrevCursor" #endif #ifndef DtNsubprocessLoginShell #define DtNsubprocessLoginShell "subprocessLoginShell" #endif #ifndef DtNsubprocessPid #define DtNsubprocessPid "subprocessPid" #endif #ifndef DtNsubprocessExec #define DtNsubprocessExec "subprocessExec" #endif #ifndef DtNsubprocessTerminationCatch #define DtNsubprocessTerminationCatch "subprocessTerminationCatch" #endif #ifndef DtNsubprocessCmd #define DtNsubprocessCmd "subprocessCmd" #endif #ifndef DtNsubprocessArgv #define DtNsubprocessArgv "subprocessArgv" #endif #ifndef DtNsubprocessTerminationCallback #define DtNsubprocessTerminationCallback "subprocessTerminationCallback" #endif #ifndef DtNtermEmulationMode #define DtNtermEmulationMode "termEmulationMode" #endif #ifndef DtNtermDevice #define DtNtermDevice "termDevice" #endif #ifndef DtNtermDeviceAllocate #define DtNtermDeviceAllocate "termDeviceAllocate" #endif #ifndef DtNtermId #define DtNtermId "termId" #endif #ifndef DtNtermName #define DtNtermName "termName" #endif #ifndef DtNtermSlaveName #define DtNtermSlaveName "termSlaveName" #endif #ifndef DtNttyModes #define DtNttyModes "ttyModes" #endif #ifndef DtNuseFontSets #define DtNuseFontSets "useFontSets" #endif #ifndef DtNuseLineDraw #define DtNuseLineDraw "useLineDraw" #endif #ifndef DtNuserFont #define DtNuserFont "userFont" #endif #ifndef DtNuserBoldFont #define DtNuserBoldFont "userBoldFont" #endif #ifndef DtNvisualBell #define DtNvisualBell "visualBell" #endif #ifndef DtNallowSendEvents #define DtNallowSendEvents "allowSendEvents" #endif #ifndef DtNbaseHeight #define DtNbaseHeight XmNbaseHeight #endif #ifndef DtNbaseWidth #define DtNbaseWidth XmNbaseWidth #endif #ifndef DtNcolumns #define DtNcolumns XmNcolumns #endif #ifndef DtNheightInc #define DtNheightInc XmNheightInc #endif #ifndef DtNmarginHeight #define DtNmarginHeight XmNmarginHeight #endif #ifndef DtNmarginWidth #define DtNmarginWidth XmNmarginWidth #endif #ifndef DtNrows #define DtNrows XmNrows #endif #ifndef DtNshadowType #define DtNshadowType XmNshadowType #endif #ifndef DtNverticalScrollBar #define DtNverticalScrollBar XmNverticalScrollBar #endif #ifndef DtNwidthInc #define DtNwidthInc XmNwidthInc #endif #ifndef DtCBackground #define DtCBackground XmCBackground #endif #ifndef DtCBackgroundIsSelect #define DtCBackgroundIsSelect "BackgroundIsSelect" #endif #ifndef DtCBlinkRate #define DtCBlinkRate "BlinkRate" #endif #ifndef DtCCallback #define DtCCallback XmCCallback #endif #ifndef DtCCursor #define DtCCursor XmCCursor #endif #ifndef DtCConsoleMode #define DtCConsoleMode "ConsoleMode" #endif #ifndef DtCCsWidth #define DtCCsWidth "CsWidth" #endif #ifndef DtCCharCursorStyle #define DtCCharCursorStyle "CharCursorStyle" #endif #ifndef DtCEmulationId #define DtCEmulationId "EmulationId" #endif #ifndef DtCForeground #define DtCForeground XmCForeground #endif #ifndef DtCJumpScroll #define DtCJumpScroll "JumpScroll" #endif #ifndef DtCKshMode #define DtCKshMode "KshMode" #endif #ifndef DtCLogFile #define DtCLogFile "LogFile" #endif #ifndef DtCLogInhibit #define DtCLogInhibit "LogInhibit" #endif #ifndef DtCLogging #define DtCLogging "Logging" #endif #ifndef DtCLoginShell #define DtCLoginShell "LoginShell" #endif #ifndef DtCMapOnOutput #define DtCMapOnOutput "MapOnOutput" #endif #ifndef DtCMapOnOutputDelay #define DtCMapOnOutputDelay "MapOnOutputDelay" #endif #ifndef DtCMarginBell #define DtCMarginBell "MarginBell" #endif #ifndef DtCNMarginBell #define DtCNMarginBell "NMarginBell" #endif #ifndef DtCPointerBlank #define DtCPointerBlank "PointerBlank" #endif #ifndef DtCPointerBlankDelay #define DtCPointerBlankDelay "PointerBlankDelay" #endif #ifndef DtCPointerColor #define DtCPointerColor "PointerColor" #endif #ifndef DtCPointerColorBackground #define DtCPointerColorBackground "PointerColorBackground" #endif #ifndef DtCPointerShape #define DtCPointerShape "PointerShape" #endif #ifndef DtCReverseVideo #define DtCReverseVideo "ReverseVideo" #endif #ifndef DtCSaveLines #define DtCSaveLines "SaveLines" #endif #ifndef DtCSizeList #define DtCSizeList "SizeList" #endif #ifndef DtCStickyCursor #define DtCStickyCursor "StickyCursor" #endif #ifndef DtCSubprocessLoginShell #define DtCSubprocessLoginShell "SubprocessLoginShell" #endif #ifndef DtCSubprocessPid #define DtCSubprocessPid "SubprocessPid" #endif #ifndef DtCSubprocessExec #define DtCSubprocessExec "SubprocessExec" #endif #ifndef DtCSubprocessTerminationCatch #define DtCSubprocessTerminationCatch "SubprocessTerminationCatch" #endif #ifndef DtCSubprocessCmd #define DtCSubprocessCmd "SubprocessCmd" #endif #ifndef DtCSubprocessArgv #define DtCSubprocessArgv "SubprocessArgv" #endif #ifndef DtCTermEmulationMode #define DtCTermEmulationMode "TermEmulationMode" #endif #ifndef DtCTermDevice #define DtCTermDevice "TermDevice" #endif #ifndef DtCTermDeviceAllocate #define DtCTermDeviceAllocate "TermDeviceAllocate" #endif #ifndef DtCTermId #define DtCTermId "TermId" #endif #ifndef DtCTermName #define DtCTermName "TermName" #endif #ifndef DtCTermSlaveName #define DtCTermSlaveName "TermSlaveName" #endif #ifndef DtCTtyModes #define DtCTtyModes "TtyModes" #endif #ifndef DtCUseFontSets #define DtCUseFontSets "UseFontSets" #endif #ifndef DtCUseLineDraw #define DtCUseLineDraw "UseLineDraw" #endif #ifndef DtCUserFont #define DtCUserFont "UserFont" #endif #ifndef DtCUserBoldFont #define DtCUserBoldFont "UserBoldFont" #endif #ifndef DtCVisualBell #define DtCVisualBell "VisualBell" #endif #ifndef DtCAllowSendEvents #define DtCAllowSendEvents "AllowSendEvents" #endif #ifndef DtCBaseHeight #define DtCBaseHeight XmCBaseHeight #endif #ifndef DtCBaseWidth #define DtCBaseWidth XmCBaseWidth #endif #ifndef DtCColumns #define DtCColumns XmCColumns #endif #ifndef DtCHeightInc #define DtCHeightInc XmCHeightInc #endif #ifndef DtCMarginHeight #define DtCMarginHeight XmCMarginHeight #endif #ifndef DtCMarginWidth #define DtCMarginWidth XmCMarginWidth #endif #ifndef DtCRows #define DtCRows XmCRows #endif #ifndef DtCShadowType #define DtCShadowType XmCShadowType #endif #ifndef DtCVerticalScrollBar #define DtCVerticalScrollBar XmCVerticalScrollBar #endif #ifndef DtCWidthInc #define DtCWidthInc XmCWidthInc #endif /* Representation types */ #define DtRDtTermCharCursorStyle "DtTermCharCursorStyle" #define DtRDtTermEmulationMode "DtTermEmulationMode" #define DtRDtTermTerminalSize "DtTermTerminalSize" #define DtRDtTermTerminalSizeList "DtTermTerminalSizeList" /* DtNshadowType values */ #ifndef DtSHADOW_IN #define DtSHADOW_IN XmSHADOW_IN #endif #ifndef DtSHADOW_OUT #define DtSHADOW_OUT XmSHADOW_OUT #endif #ifndef DtSHADOW_ETCHED_IN #define DtSHADOW_ETCHED_IN XmSHADOW_ETCHED_IN #endif #ifndef DtSHADOW_ETCHED_OUT #define DtSHADOW_ETCHED_OUT XmSHADOW_ETCHED_OUT #endif #define DtTERM_CHAR_CURSOR_BOX 0 #define DtTERM_CHAR_CURSOR_BAR 1 #define DtTERM_CHAR_CURSOR_INVISIBLE 2 #define DtTermEMULATIONHP 0 #define DtTermEMULATIONANSI 1 /* Callback reasons */ #define DtCR_TERM_SUBPROCESS_TERMINATION 1 #define DtCR_TERM_STATUS_CHANGE 2 #define DtCR_TERM_INPUT_VERIFY 7 #define DtCR_TERM_OUTPUT_LOG 8 /* * Types */ /* insert char mode */ typedef enum { DtTERM_INSERT_CHAR_OFF = 0, DtTERM_INSERT_CHAR_ON, DtTERM_INSERT_CHAR_ON_WRAP } DtTermInsertCharMode; typedef struct { int reason; XEvent *event; int cursorX; int cursorY; Boolean capsLock; Boolean stop; DtTermInsertCharMode insertCharMode; Boolean locked; } DtTermStatusChangeCallbackStruct; typedef struct { int reason; XEvent *event; pid_t pid; int status; } DtTermSubprocessTerminationCallbackStruct; typedef struct { int reason; XEvent *event; Boolean doit; unsigned char *text; int length; } DtTermInputVerifyCallbackStruct; typedef struct { int reason; XEvent *event; unsigned char *text; int length; } DtTermOutputLogCallbackStruct; typedef struct _DtTermTerminalSize { short rows; short columns; } DtTermTerminalSize; typedef struct _DtTermTerminalSizeList { int numSizes; DtTermTerminalSize *sizes; } DtTermTerminalSizeList; /* Widget class and instance */ typedef struct _DtTermPrimitiveClassRec *DtTermPrimitiveWidgetClass; typedef struct _DtTermPrimitiveRec *DtTermPrimitiveWidget; /* * Data */ /* Widget class record */ externalref WidgetClass dtTermPrimitiveWidgetClass; /* * Functions */ extern Widget DtCreateTermPrimitive( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern void DtTermInitialize(void); extern void DtTermDisplaySend( Widget widget, unsigned char *buffer, int length); extern void DtTermSubprocSend( Widget widget, unsigned char *buffer, int length); extern void DtTermSubprocReap( pid_t pid, int *stat_loc); #ifdef __cplusplus } #endif #endif /* _Dt_TermPrim_h */ motif-2.3.8/include/Dt/Print.h0000644000175000017500000001416013145162623013027 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: Print.h /main/13 1996/10/31 02:09:08 cde-hp $ */ /* * DtPrint/Print.h */ /* (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED * (c) Copyright 1989, 1996 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. * (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1995, 1996, * HEWLETT-PACKARD COMPANY * (c) Copyright 1996 International Business Machines Corp. * (c) Copyright 1996 Sun Microsystems, Inc. * (c) Copyright 1996 Novell, Inc. * (c) Copyright 1996 FUJITSU LIMITED. * (c) Copyright 1996 Hitachi. */ #ifndef _DtPrint_h #define _DtPrint_h #include #ifdef __cplusplus extern "C" { #endif /* * Class record constants */ externalref WidgetClass dtPrintSetupBoxWidgetClass; typedef struct _DtPrintSetupBoxClassRec * DtPrintSetupBoxWidgetClass; typedef struct _DtPrintSetupBoxRec * DtPrintSetupBoxWidget; #ifndef DtIsPrintSetupBox #define DtIsPrintSetupBox(w) (XtIsSubclass (w, dtPrintSetupBoxWidgetClass)) #endif /* * Resource Names */ #define DtNcancelCallback "cancelCallback" #define DtNclosePrintDisplayCallback "closePrintDisplayCallback" #define DtNcopies "copies" #define DtNdescription "description" #define DtNdestroyContextCallback "destroyContextCallback" #define DtNfileName "fileName" #ifndef DtNminimizeButtons # define DtNminimizeButtons "minimizeButtons" #endif #define DtNoptionCount "optionCount" #define DtNoptions "options" #define DtNprintCallback "printCallback" #define DtNprintDestination "printDestination" #define DtNprinterInfoProc "printerInfoProc" #define DtNprinterName "printerName" #define DtNprintSetupMode "printSetupMode" #define DtNselectFileProc "selectFileProc" #define DtNselectPrinterProc "selectPrinterProc" #define DtNsetupCallback "setupCallback" #define DtNverifyPrinterProc "verifyPrinterProc" #define DtNworkAreaLocation "workAreaLocation" #define DtCCancelCallback "CancelCallback" #define DtCClosePrintDisplayCallback "ClosePrintDisplayCallback" #define DtCCopies "Copies" #define DtCDescription "Description" #define DtCDestroyContextCallback "DestroyContextCallback" #define DtCFileName "FileName" #ifndef DtCMinimizeButtons # define DtCMinimizeButtons "MinimizeButtons" #endif #define DtCOptionCount "OptionCount" #define DtCOptions "Options" #define DtCPrintCallback "PrintCallback" #define DtCPrintDestination "PrintDestination" #define DtCPrinterInfoProc "PrinterInfoProc" #define DtCPrinterName "PrinterName" #define DtCPrintSetupMode "PrintSetupMode" #define DtCSelectFileProc "SelectFileProc" #define DtCSelectPrinterProc "SelectPrinterProc" #define DtCSetupCallback "SetupCallback" #define DtCVerifyPrinterProc "VerifyPrinterProc" #define DtCWorkAreaLocation "WorkAreaLocation" #define DtRPrintSetupProc "PrintSetupProc" /* * DtNsetupMode Resource Values */ enum { DtPRINT_SETUP_PLAIN, DtPRINT_SETUP_XP }; /* * DtNworkAreaLocation Resource Values */ enum { DtWORK_AREA_NONE, DtWORK_AREA_TOP, DtWORK_AREA_TOP_AND_BOTTOM, DtWORK_AREA_BOTTOM }; /* * DtNprintDestination Resource Values */ enum { DtPRINT_NO_DESTINATION, DtPRINT_TO_PRINTER, DtPRINT_TO_FILE }; /* * DtNprinterNameMode Resource Values */ enum { DtSHORT_NAME, DtMEDIUM_NAME, DtLONG_NAME }; /* * Mode values for DtPrintSetupBoxResetConnection() */ typedef enum { DtPRINT_CLOSE_CONNECTION, DtPRINT_RELEASE_CONNECTION } DtPrintResetConnectionMode; /* * Callback Reasons */ enum { DtPRINT_CR_NONE, DtPRINT_CR_CANCEL, DtPRINT_CR_CLOSE_PRINT_DISPLAY, DtPRINT_CR_PRINT, DtPRINT_CR_SETUP }; /* * DtPrint proecdure return values */ enum { DtPRINT_SUCCESS, DtPRINT_BAD_PARM, DtPRINT_FAILURE, DtPRINT_INVALID_DISPLAY, DtPRINT_NOT_XP_DISPLAY, DtPRINT_NO_CONNECTION, DtPRINT_NO_DEFAULT, DtPRINT_NO_DEFAULT_DISPLAY, DtPRINT_NO_PRINTER, DtPRINT_PRINTER_MISSING }; enum { DtPRINT_HINT_MESSAGES_OK, DtPRINT_HINT_NO_MESSAGES }; /* * PrintSetupBox Callback Structure Definition */ typedef struct _DtPrintSetupData { String printer_name; Display *print_display; XID print_context; XtEnum destination; String dest_info; XtEnum messages_hint; } DtPrintSetupData; typedef struct _DtPrintSetupCallbackStruct { int reason; XEvent *event; DtPrintSetupData *print_data; } DtPrintSetupCallbackStruct; /* * PrintSetupBox Procedure Resource Type Definition */ typedef XtEnum (*DtPrintSetupProc)(Widget, DtPrintSetupData*); /* * Public Function Declarations */ extern Widget DtCreatePrintSetupBox( Widget p, String name, ArgList args, Cardinal n) ; extern Widget DtCreatePrintSetupDialog( Widget ds_p, String name, ArgList sb_args, Cardinal sb_n) ; extern DtPrintSetupData* DtPrintCopySetupData( DtPrintSetupData* target, const DtPrintSetupData* source); extern XtEnum DtPrintFillSetupData( Widget psub, DtPrintSetupData* print_data); extern void DtPrintFreeSetupData( DtPrintSetupData* target); extern XtEnum DtPrintResetConnection( Widget psub, DtPrintResetConnectionMode m); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _DtPrint_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ motif-2.3.8/include/Dt/Term.h0000644000175000017500000003424413145162623012647 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: Term.h /main/1 1996/04/21 19:15:14 drk $ */ /* * (c) Copyright 1993, 1994 Hewlett-Packard Company * (c) Copyright 1993, 1994 International Business Machines Corp. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * (c) Copyright 1993, 1994 Novell, Inc. */ #ifndef _Dt_TermPrim_h #define _Dt_TermPrim_h #include #include #ifdef __cplusplus extern "C" { #endif /* * Constants */ /* Resources */ #ifndef DtNbackgroundIsSelect #define DtNbackgroundIsSelect "backgroundIsSelect" #endif #ifndef DtNblinkRate #define DtNblinkRate "blinkRate" #endif #ifndef DtNcharCursorStyle #define DtNcharCursorStyle "charCursorStyle" #endif #ifndef DtNconsoleMode #define DtNconsoleMode "consoleMode" #endif #ifndef DtNcsWidth #define DtNcsWidth "csWidth" #endif #ifndef DtNemulationId #define DtNemulationId "emulationId" #endif #ifndef DtNinputVerifyCallback #define DtNinputVerifyCallback "inputVerifyCallback" #endif #ifndef DtNjumpScroll #define DtNjumpScroll "jumpScroll" #endif #ifndef DtNkshMode #define DtNkshMode "kshMode" #endif #ifndef DtNlogFile #define DtNlogFile "logFile" #endif #ifndef DtNlogInhibit #define DtNlogInhibit "logInhibit" #endif #ifndef DtNlogging #define DtNlogging "logging" #endif #ifndef DtNloginShell #define DtNloginShell "loginShell" #endif #ifndef DtNmapOnOutput #define DtNmapOnOutput "mapOnOutput" #endif #ifndef DtNmapOnOutputDelay #define DtNmapOnOutputDelay "mapOnOutputDelay" #endif #ifndef DtNmarginBell #define DtNmarginBell "marginBell" #endif #ifndef DtNnMarginBell #define DtNnMarginBell "nMarginBell" #endif #ifndef DtNoutputLogCallback #define DtNoutputLogCallback "outputLogCallback" #endif #ifndef DtNpointerBlank #define DtNpointerBlank "pointerBlank" #endif #ifndef DtNpointerBlankDelay #define DtNpointerBlankDelay "pointerBlankDelay" #endif #ifndef DtNpointerColor #define DtNpointerColor "pointerColor" #endif #ifndef DtNpointerColorBackground #define DtNpointerColorBackground "pointerColorBackground" #endif #ifndef DtNpointerShape #define DtNpointerShape "pointerShape" #endif #ifndef DtNreverseVideo #define DtNreverseVideo "reverseVideo" #endif #ifndef DtNsaveLines #define DtNsaveLines "saveLines" #endif #ifndef DtNsizeList #define DtNsizeList "sizeList" #endif #ifndef DtNstatusChangeCallback #define DtNstatusChangeCallback "statusChangeCallback" #endif #ifndef DtNstickyNextCursor #define DtNstickyNextCursor "stickyNextCursor" #endif #ifndef DtNstickyPrevCursor #define DtNstickyPrevCursor "stickyPrevCursor" #endif #ifndef DtNsubprocessLoginShell #define DtNsubprocessLoginShell "subprocessLoginShell" #endif #ifndef DtNsubprocessPid #define DtNsubprocessPid "subprocessPid" #endif #ifndef DtNsubprocessExec #define DtNsubprocessExec "subprocessExec" #endif #ifndef DtNsubprocessTerminationCatch #define DtNsubprocessTerminationCatch "subprocessTerminationCatch" #endif #ifndef DtNsubprocessCmd #define DtNsubprocessCmd "subprocessCmd" #endif #ifndef DtNsubprocessArgv #define DtNsubprocessArgv "subprocessArgv" #endif #ifndef DtNsubprocessTerminationCallback #define DtNsubprocessTerminationCallback "subprocessTerminationCallback" #endif #ifndef DtNtermEmulationMode #define DtNtermEmulationMode "termEmulationMode" #endif #ifndef DtNtermDevice #define DtNtermDevice "termDevice" #endif #ifndef DtNtermDeviceAllocate #define DtNtermDeviceAllocate "termDeviceAllocate" #endif #ifndef DtNtermId #define DtNtermId "termId" #endif #ifndef DtNtermName #define DtNtermName "termName" #endif #ifndef DtNtermSlaveName #define DtNtermSlaveName "termSlaveName" #endif #ifndef DtNttyModes #define DtNttyModes "ttyModes" #endif #ifndef DtNuseFontSets #define DtNuseFontSets "useFontSets" #endif #ifndef DtNuseLineDraw #define DtNuseLineDraw "useLineDraw" #endif #ifndef DtNuserFont #define DtNuserFont "userFont" #endif #ifndef DtNuserBoldFont #define DtNuserBoldFont "userBoldFont" #endif #ifndef DtNvisualBell #define DtNvisualBell "visualBell" #endif #ifndef DtNallowSendEvents #define DtNallowSendEvents "allowSendEvents" #endif #ifndef DtNbaseHeight #define DtNbaseHeight XmNbaseHeight #endif #ifndef DtNbaseWidth #define DtNbaseWidth XmNbaseWidth #endif #ifndef DtNcolumns #define DtNcolumns XmNcolumns #endif #ifndef DtNheightInc #define DtNheightInc XmNheightInc #endif #ifndef DtNmarginHeight #define DtNmarginHeight XmNmarginHeight #endif #ifndef DtNmarginWidth #define DtNmarginWidth XmNmarginWidth #endif #ifndef DtNrows #define DtNrows XmNrows #endif #ifndef DtNshadowType #define DtNshadowType XmNshadowType #endif #ifndef DtNverticalScrollBar #define DtNverticalScrollBar XmNverticalScrollBar #endif #ifndef DtNwidthInc #define DtNwidthInc XmNwidthInc #endif #ifndef DtCBackground #define DtCBackground XmCBackground #endif #ifndef DtCBackgroundIsSelect #define DtCBackgroundIsSelect "BackgroundIsSelect" #endif #ifndef DtCBlinkRate #define DtCBlinkRate "BlinkRate" #endif #ifndef DtCCallback #define DtCCallback XmCCallback #endif #ifndef DtCCursor #define DtCCursor XmCCursor #endif #ifndef DtCConsoleMode #define DtCConsoleMode "ConsoleMode" #endif #ifndef DtCCsWidth #define DtCCsWidth "CsWidth" #endif #ifndef DtCCharCursorStyle #define DtCCharCursorStyle "CharCursorStyle" #endif #ifndef DtCEmulationId #define DtCEmulationId "EmulationId" #endif #ifndef DtCForeground #define DtCForeground XmCForeground #endif #ifndef DtCJumpScroll #define DtCJumpScroll "JumpScroll" #endif #ifndef DtCKshMode #define DtCKshMode "KshMode" #endif #ifndef DtCLogFile #define DtCLogFile "LogFile" #endif #ifndef DtCLogInhibit #define DtCLogInhibit "LogInhibit" #endif #ifndef DtCLogging #define DtCLogging "Logging" #endif #ifndef DtCLoginShell #define DtCLoginShell "LoginShell" #endif #ifndef DtCMapOnOutput #define DtCMapOnOutput "MapOnOutput" #endif #ifndef DtCMapOnOutputDelay #define DtCMapOnOutputDelay "MapOnOutputDelay" #endif #ifndef DtCMarginBell #define DtCMarginBell "MarginBell" #endif #ifndef DtCNMarginBell #define DtCNMarginBell "NMarginBell" #endif #ifndef DtCPointerBlank #define DtCPointerBlank "PointerBlank" #endif #ifndef DtCPointerBlankDelay #define DtCPointerBlankDelay "PointerBlankDelay" #endif #ifndef DtCPointerColor #define DtCPointerColor "PointerColor" #endif #ifndef DtCPointerColorBackground #define DtCPointerColorBackground "PointerColorBackground" #endif #ifndef DtCPointerShape #define DtCPointerShape "PointerShape" #endif #ifndef DtCReverseVideo #define DtCReverseVideo "ReverseVideo" #endif #ifndef DtCSaveLines #define DtCSaveLines "SaveLines" #endif #ifndef DtCSizeList #define DtCSizeList "SizeList" #endif #ifndef DtCStickyCursor #define DtCStickyCursor "StickyCursor" #endif #ifndef DtCSubprocessLoginShell #define DtCSubprocessLoginShell "SubprocessLoginShell" #endif #ifndef DtCSubprocessPid #define DtCSubprocessPid "SubprocessPid" #endif #ifndef DtCSubprocessExec #define DtCSubprocessExec "SubprocessExec" #endif #ifndef DtCSubprocessTerminationCatch #define DtCSubprocessTerminationCatch "SubprocessTerminationCatch" #endif #ifndef DtCSubprocessCmd #define DtCSubprocessCmd "SubprocessCmd" #endif #ifndef DtCSubprocessArgv #define DtCSubprocessArgv "SubprocessArgv" #endif #ifndef DtCTermEmulationMode #define DtCTermEmulationMode "TermEmulationMode" #endif #ifndef DtCTermDevice #define DtCTermDevice "TermDevice" #endif #ifndef DtCTermDeviceAllocate #define DtCTermDeviceAllocate "TermDeviceAllocate" #endif #ifndef DtCTermId #define DtCTermId "TermId" #endif #ifndef DtCTermName #define DtCTermName "TermName" #endif #ifndef DtCTermSlaveName #define DtCTermSlaveName "TermSlaveName" #endif #ifndef DtCTtyModes #define DtCTtyModes "TtyModes" #endif #ifndef DtCUseFontSets #define DtCUseFontSets "UseFontSets" #endif #ifndef DtCUseLineDraw #define DtCUseLineDraw "UseLineDraw" #endif #ifndef DtCUserFont #define DtCUserFont "UserFont" #endif #ifndef DtCUserBoldFont #define DtCUserBoldFont "UserBoldFont" #endif #ifndef DtCVisualBell #define DtCVisualBell "VisualBell" #endif #ifndef DtCAllowSendEvents #define DtCAllowSendEvents "AllowSendEvents" #endif #ifndef DtCBaseHeight #define DtCBaseHeight XmCBaseHeight #endif #ifndef DtCBaseWidth #define DtCBaseWidth XmCBaseWidth #endif #ifndef DtCColumns #define DtCColumns XmCColumns #endif #ifndef DtCHeightInc #define DtCHeightInc XmCHeightInc #endif #ifndef DtCMarginHeight #define DtCMarginHeight XmCMarginHeight #endif #ifndef DtCMarginWidth #define DtCMarginWidth XmCMarginWidth #endif #ifndef DtCRows #define DtCRows XmCRows #endif #ifndef DtCShadowType #define DtCShadowType XmCShadowType #endif #ifndef DtCVerticalScrollBar #define DtCVerticalScrollBar XmCVerticalScrollBar #endif #ifndef DtCWidthInc #define DtCWidthInc XmCWidthInc #endif /* Representation types */ #define DtRDtTermCharCursorStyle "DtTermCharCursorStyle" #define DtRDtTermEmulationMode "DtTermEmulationMode" #define DtRDtTermTerminalSize "DtTermTerminalSize" #define DtRDtTermTerminalSizeList "DtTermTerminalSizeList" /* DtNshadowType values */ #ifndef DtSHADOW_IN #define DtSHADOW_IN XmSHADOW_IN #endif #ifndef DtSHADOW_OUT #define DtSHADOW_OUT XmSHADOW_OUT #endif #ifndef DtSHADOW_ETCHED_IN #define DtSHADOW_ETCHED_IN XmSHADOW_ETCHED_IN #endif #ifndef DtSHADOW_ETCHED_OUT #define DtSHADOW_ETCHED_OUT XmSHADOW_ETCHED_OUT #endif #define DtTERM_CHAR_CURSOR_BOX 0 #define DtTERM_CHAR_CURSOR_BAR 1 #define DtTERM_CHAR_CURSOR_INVISIBLE 2 #define DtTermEMULATIONHP 0 #define DtTermEMULATIONANSI 1 /* Callback reasons */ #define DtCR_TERM_SUBPROCESS_TERMINATION 1 #define DtCR_TERM_STATUS_CHANGE 2 #define DtCR_TERM_INPUT_VERIFY 7 #define DtCR_TERM_OUTPUT_LOG 8 /* * Types */ /* insert char mode */ typedef enum { DtTERM_INSERT_CHAR_OFF = 0, DtTERM_INSERT_CHAR_ON, DtTERM_INSERT_CHAR_ON_WRAP } DtTermInsertCharMode; typedef struct { int reason; XEvent *event; int cursorX; int cursorY; Boolean capsLock; Boolean stop; DtTermInsertCharMode insertCharMode; Boolean locked; } DtTermStatusChangeCallbackStruct; typedef struct { int reason; XEvent *event; pid_t pid; int status; } DtTermSubprocessTerminationCallbackStruct; typedef struct { int reason; XEvent *event; Boolean doit; unsigned char *text; int length; } DtTermInputVerifyCallbackStruct; typedef struct { int reason; XEvent *event; unsigned char *text; int length; } DtTermOutputLogCallbackStruct; typedef struct _DtTermTerminalSize { short rows; short columns; } DtTermTerminalSize; typedef struct _DtTermTerminalSizeList { int numSizes; DtTermTerminalSize *sizes; } DtTermTerminalSizeList; /* Widget class and instance */ typedef struct _DtTermPrimitiveClassRec *DtTermPrimitiveWidgetClass; typedef struct _DtTermPrimitiveRec *DtTermPrimitiveWidget; /* * Data */ /* Widget class record */ externalref WidgetClass dtTermPrimitiveWidgetClass; /* * Functions */ extern Widget DtCreateTermPrimitive( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern void DtTermInitialize(void); extern void DtTermDisplaySend( Widget widget, unsigned char *buffer, int length); extern void DtTermSubprocSend( Widget widget, unsigned char *buffer, int length); extern void DtTermSubprocReap( pid_t pid, int *stat_loc); #ifdef __cplusplus } #endif #endif /* _Dt_TermPrim_h */ #ifndef _Dt_Term_h #define _Dt_Term_h #include
#ifdef __cplusplus extern "C" { #endif /* * Constants */ /* Resources */ #ifndef DtNfunctionKeyExecuteProc #define DtNfunctionKeyExecuteProc "functionKeyExecuteProc" #endif #ifndef DtNfunctionKeyUpdateProc #define DtNfunctionKeyUpdateProc "functionKeyUpdateProc" #endif #ifndef DtNautoWrap #define DtNautoWrap "autoWrap" #endif #ifndef DtNreverseWrap #define DtNreverseWrap "reverseWrap" #endif #ifndef DtNsunFunctionKeys #define DtNsunFunctionKeys "sunFunctionKeys" #endif #ifndef DtNc132 #define DtNc132 "c132" #endif #ifndef DtNappCursorDefault #define DtNappCursorDefault "appCursorDefault" #endif #ifndef DtNappKeypadDefault #define DtNappKeypadDefault "appKeypadDefault" #endif #ifndef DtCFunctionKeyExecuteProc #define DtCFunctionKeyExecuteProc "FunctionKeyExecuteProc" #endif #ifndef DtCFunctionKeyUpdateProc #define DtCFunctionKeyUpdateProc "FunctionKeyUpdateProc" #endif #ifndef DtCFunctionKeyLast #define DtCFunctionKeyLast "FunctionKeyLast" #endif #ifndef DtCAutoWrap #define DtCAutoWrap "AutoWrap" #endif #ifndef DtCReverseWrap #define DtCReverseWrap "ReverseWrap" #endif #ifndef DtCSunFunctionKeys #define DtCSunFunctionKeys "SunFunctionKeys" #endif #ifndef DtCC132 #define DtCC132 "C132" #endif #ifndef DtCAppCursorDefault #define DtCAppCursorDefault "AppCursorDefault" #endif #ifndef DtCAppKeypadDefault #define DtCAppKeypadDefault "AppKeypadDefault" #endif /* * Types */ /* Widget class and instance */ typedef struct _DtTermClassRec *DtTermWidgetClass; typedef struct _DtTermRec *DtTermWidget; /* * Data */ /* Widget class record */ externalref WidgetClass dtTermWidgetClass; /* * Functions */ extern Widget DtCreateTerm( Widget parent, char *name, ArgList arglist, Cardinal argcount); #ifdef __cplusplus } #endif #endif /* _Dt_Term_h */ motif-2.3.8/include/Dt/README0000644000175000017500000000025312672140200012427 00000000000000$XConsortium: README /main/1 1996/04/10 13:56:31 drk $ The files in this directory are present only so uil (and wml) can support CDE. They should not be used elsewhere. motif-2.3.8/include/Dt/MenuButton.h0000644000175000017500000000437013145162623014035 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: MenuButton.h /main/3 1995/10/26 09:33:10 rswiston $ */ /* * (c) Copyright 1993, 1994 Hewlett-Packard Company * (c) Copyright 1993, 1994 International Business Machines Corp. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * (c) Copyright 1993, 1994 Novell, Inc. */ #ifndef _Dt_MenuButton_h #define _Dt_MenuButton_h #include #ifdef __cplusplus extern "C" { #endif /* * Constants */ /* Resources */ #ifndef DtNcascadingCallback #define DtNcascadingCallback XmNcascadingCallback #endif #ifndef DtNsubMenuId #define DtNsubMenuId XmNsubMenuId #endif #ifndef DtNcascadePixmap #define DtNcascadePixmap XmNcascadePixmap #endif #ifndef DtCCallback #define DtCCallback XmCCallback #endif #ifndef DtCPixmap #define DtCPixmap XmCPixmap #endif #ifndef DtCMenuWidget #define DtCMenuWidget XmCMenuWidget #endif #ifndef DtCR_CASCADING #define DtCR_CASCADING XmCR_CASCADING #endif /* * Types */ /* Widget class and instance */ typedef struct _DtMenuButtonRec * DtMenuButtonWidget; typedef struct _DtMenuButtonClassRec * DtMenuButtonWidgetClass; /* * Data */ /* Widget class record */ externalref WidgetClass dtMenuButtonWidgetClass; /* * Functions */ extern Widget DtCreateMenuButton( Widget parent, char *name, ArgList arglist, Cardinal argcount); #ifdef __cplusplus } #endif #endif /* _Dt_MenuButton_h */ motif-2.3.8/include/Dt/HelpDialog.h0000644000175000017500000000523213145162623013743 00000000000000/* * CDE - Common Desktop Environment * * Copyright (c) 1993-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* $XConsortium: HelpDialog.h /main/3 1995/10/26 12:24:05 rswiston $ */ /* * (c) Copyright 1993, 1994 Hewlett-Packard Company * (c) Copyright 1993, 1994 International Business Machines Corp. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * (c) Copyright 1993, 1994 Novell, Inc. */ #ifndef _Dt_HelpDialog_h #define _Dt_HelpDialog_h #include
#ifdef __cplusplus extern "C" { #endif /* * Constants */ /* General Help Dialog-specific Resources */ #ifndef DtNmarginWidth #define DtNmarginWidth XmNmarginWidth #endif #ifndef DtNmarginHeight #define DtNmarginHeight XmNmarginHeight #endif #ifndef DtNshowNewWindowButton #define DtNshowNewWindowButton "showNewWindowButton" #endif #ifndef DtNtopicTitle #define DtNtopicTitle "topicTitle" #endif #ifndef DtNvisiblePathCount #define DtNvisiblePathCount "visiblePathCount" #endif #ifndef DtCCallback #define DtCCallback XmCCallback #endif #ifndef DtCMarginWidth #define DtCMarginWidth XmCMarginWidth #endif #ifndef DtCMarginHeight #define DtCMarginHeight XmCMarginHeight #endif #ifndef DtCShowNewWindowButton #define DtCShowNewWindowButton "ShowNewWindowButton" #endif #ifndef DtCTopicTitle #define DtCTopicTitle "TopicTitle" #endif #ifndef DtCVisiblePathCount #define DtCVisiblePathCount "VisiblePathCount" #endif /* * Types */ /* Widget class and instance */ typedef struct _DtHelpDialogWidgetClassRec * DtHelpDialogWidgetClass; typedef struct _DtHelpDialogWidgetRec * DtHelpDialogWidget; /* * Data */ /* Widget class record */ externalref WidgetClass dtHelpDialogWidgetClass; /* * Functions */ extern Widget DtCreateHelpDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount); #ifdef __cplusplus } #endif #endif /* _Dt_HelpDialog_h */ motif-2.3.8/include/Dt/Makefile.am0000644000175000017500000000025112672140200013601 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README noinst_HEADERS = Editor.h \ Help.h \ HelpDialog.h \ HelpQuickD.h \ MenuButton.h \ Print.h \ Term.h \ TermPrim.h motif-2.3.8/include/Makefile.am0000644000175000017500000000011012672140200013224 00000000000000MAINTAINERCLEANFILES = Makefile.in config.h.in stamp-h.in SUBDIRS = Dt motif-2.3.8/README0000644000175000017500000000050212672140200010432 00000000000000Please see the file COPYING for important information. Please see the file RELNOTES for current Release information. Please see the file INSTALL.configure on how to build and install this product using the autoconf tools. Please see the file distro/README.RPM for information on creating rpms from this source tree. motif-2.3.8/RELNOTES0000644000175000017500000004427313211512064010746 00000000000000----------------------------------------------------------------------- Motif 2.3.8 Release Notes The Open Group and Integrated Computer Solutions This document provides Release Notes for the release of Motif 2.3.8. This contains information on what is new in Motif 2.3.8. Please see the COPYING file included with this release. Introduction This document and accompanying text files contain important information. Please read them carefully before starting the build and installation procedures. There are two ways to build Motif from source code: Imake and AutoTools. If you are using Imake, please read INSTALL.imake for notes on how to build and install this product using Imake. This method is deprecated due to a lack of support. Users wishing to apply/test and patch the Imake system should join the development mailing list; all contributions are welcome. Please see the file INSTALL.configure on how to build and install this product using the autoconf tools. This method is now fully supported and is the recommended build method. 1. What is Motif Motif is a freely available source code distribution for the Motif user interface component toolkit. Motif is built on top of the standard X Toolkit(Xt) and X11 libraries. 1.1. Overview of Motif Motif 2.3.X is an updated version of Motif 2.3. Any applications built against a previous 2.x release of Motif will be binary compatible with this release. Pre-compiled versions are available for download at the ICS MotifZone: http://motif.ics.com After downloading this source distribution, it will need to be unpacked and compiled. The distribution contains the following items: * libXm source code and include files * Motif reference documentation (man pages) * Utility libraries * Demo programs 2. What is new in Motif 2.3.8 This is a bug fix release. * Fixed bug 1660: TextField leaves a residual cursor shadow on focus lose * Fixed bug 1659: Many cases of typos in horizontal/vertical conditions in the code * Fixed bug 1658: motif does crash on OpenSuse Leap 42.2 * Fixed bug 1656: TabStack with tabSelectColor and Right causes BadMatch Error * Fixed bug 1625: Open Motif build fails due to weak aliases on Darwin with cl * Fixed bug 1655: Motif 2.3.6 and 2.3.4 do not work with XQuartz 2.7.9 and later * Fixed bug 1652: Add support for more Cyrillic locales * Fixed bug 1650: Memory leak in DataF.c * Fixed bug 1651: motif-2.3.5 tarball contains lib/Xm/Xm.h file generated by configure * Fixed bug 1665: Closing open menus with mouse click disables keyboard shortcut 3. Build Systems Motif 2.3.x was built and tested on the following systems: * Fedora 15 x86_64 * Solaris 10 sparc In all cases, the compiler originally provided with the OS was used. 3.1. OS Support The following platforms are supported operating systems: * Linux 2.6 * Solaris 10 4. Filing Bug Reports If you find a reproducible bug in any of the Motif libraries or code, or an error in the documentation, please reference the BUGREPORT file and/or submit a bug report online at: http://bugs.motifzone.org The status of submitted bugs is maintained there. 5. Documentation For postscript and PDF documentation (users guides and reference manuals), see the URL: http://www.opengroup.org/openmotif/docs/ 6. Compatibility Notice Motif 2.3.x is binary compatible with Motif 2.2.x. Applications built against Motif 2.2 should work with Motif 2.3.x without having to recompile it. Motif 2.3.x is not binary compatible with Motif 2.1.30. Applications built against Motif 2.1.30 will need to be recompiled with the Motif 2.2+ header files. 7. Change Log 2.3.8 December 2017 Current release 2.3.7 March 2017 * Fixed segmentation faults associated with option menus or other popup windows 2.3.6 June 2016 * Fixed bug 1654 (Rendering issues seen while scrolling window) * Fixed parallel building error 2.3.5 March 2016 * Reimplemented bugfix 1565 (The active window changes to inactive when the drop down list is clicked) * Fixed bug 1636 (XmList segfault when left-shift left-button click on list item) * Fixed bug #1612 (Label size computed wrong within a Form) * Fixed bug #1611 (Using deprecated X functions) * Fixed bug #1604 (Using deprecated X functions) * Fixed bug #1581 (Buffer overrun in FontS.c) * Fixed many compile-time bugs 2.3.4 October 2012 * Fixed bug #1565 (The active window changes to inactive when the drop down list is clicked) * Implemented feature request #1300 (Keypad arrows don't work) * Fixed bug #1496 (Version 2.3.2 won't compile if configured enable-message-catalog) * Dropped fix #1359 (File dialog filter problem with * or [ in directory) * Fixed bug #1530 (SimpleSpinBox doesn't return correct values for child on some platforms) * Fixed bug #1272 (Application goes into infinite loop in TraversalI.c:Sort()) * Fixed bug #1529 (Copy/paste problem with Clipboard) * Fixed bug #1536 (Performance issue: XmListSetPos() is very very slow) * Fixed bug #1501 (XmText widget sensitive/unsensitive is visibly same at startup) * Refixed bug #1381 (Sensitivity invisible with antialiased fonts) * Fixed bug #1510 (Input methods do not work with XFT fonts) * Fixed bug #1500 (XmPushButton with grayscale pixmap is not changed visibly when it's sensitivity is changed) * Fixed bug #1540 (XpmCreateBufferFromPixmap function doesn't work properly) * Fixed bug #1505 (Some problems with new insensitive code for label pixmaps) * Fixed bug #1534 (im_widget double-free issue) * Fixed bug #1535 (Destroying a torn-off menu with a submenu mapped causes a crash) * Fixed bug #1532 (Incorrect handling of clip areas for a string (XmString.c)) * Fixed bug #1531 (Using DataField widget with XFT font causes an X Error) * Fixed bug #1519 (XmSpinBoxValidatePosition does not properly check XmNincrementValue) * Added missing #ifdef USE_XFT directive to the patch #1521 * Fixed bug #1488 (XmStringDraw clip not honored) * Fixed bug #1479 (Compiling libUil fails on mac OS X 10.5) * Fixed bug #1528 (Scale widget has some Geometry issues) * Fixed bug #1518 (gcc check in configure script does not use $CC) * Fixed misspellings in the manpage * Fixed bug #1504 (Changing sensitivity on a PushButton with Pixmap causes recomputeSize) * Fixed bug #1516 (Can receive X error setting pixmaps to XmUNSPECIFIED_PIXMAP on PushButton) * Fixed bug #1503 (XmNtabBackground resource is not working properly in XmTabStack widget) * Fixed bug #1512 (Small configure portability fix) * Fixed bug #1523 (Check a return value of XmCvtXmStringToCT before use in strlen) * Refixed bug #1473 (When we set XmNvisibleItemCount resource available in XmComboBox, the widget displays the wrong number of items) * Fixed bug #1521 (LabelGadget draws the text over border of its parent) * Fixed in order to provide compatibility with libpng14, backwards compatible with libpng12 * Fixed dependencies in order to allow build with "make -j" * Fixed bug #1509 (background pixmap not fully displayed) * Fixed bug #1517 (LabelGadget draws over parent window with the background color) * Fixed bug #1507 (LDFLAGS not respected for building libXm and libMrm libraries) * Fixed bug #1511 (CheckBook program from EditTable samples crashes with Motif since 2.3.0 release.) * Fixed bug #1495 (mwm's icon box has graphics corruption) * Fixed in order to provide PRINTING_SUPPORTED and USE_XFT macro definitions in Xm.h * Fixed in order to allow build without libXp * Refixed bug #1321 (Pasting into XmTextField is unreliable) * Fixed bug #1502 (crash in ToolTipGetData()) * Removed xmPanedWindowWidgetClass definition * Fixed bug #1474 (Incrementation of XmNvisibleItemCount value does not work properly in XmComboBox) 2.3.3 March 2010 * Fixed bug #1195 (Making on FreeBSD with non GNU make) * Refixed bug #1388 (SEGV error moving mouse over window related to XmToolTipGetLabel) * Fixed bug #1489 (Paned.h is not included by XmAll.h) * Fixed bug #1486 (Tooltip in DropDown widget makes X hang up) * Dropped fix #1476 (PanedWindow orientation error) * Fixed bug #1320 (Resizing a scrolled text widget can be very, very slow) * Fixed bug #1449 (Uninitalised memory access with XFT fonts) * Fixed bug #1418 (Add file with instructions how to build from CVS) * Refixed bug #1381 (Sensitivity invisible with antialiased fonts) * Fixed bug #1484 (Warning on XmRlabelType when I put a pixmap and a value "top" on XmNPixmapPlacement) * Fixed bug #1475 (autoconf warning "X11/Xmu/Editres.h header present but cannot be compiled") * Fixed bug #1426 (Make location of system.mwmrc configurable) * Fixed bug #1451 (XmStringDrawImage works incorrectly with XFT) * Fixed bug #1453 (MultiList not displayed properly) * Fixed bug #1412 (An insensitive popup menu parent lead to a display-freezing) * Fixed bug #345 (Motif accelerators XmNaccelerator do not work with CapsLock/ScrollLock/NumLock modifiers) * Added splint checking and splint target * Fixed bug #1299 (XmForm erroneously finds "Circular dependency" if widgets are inter-attachmed in vertical/horizontal directions) 2.3.2 March 2009 * Fixed bug #1473 (When we set XmNvisibleItemCount resource available in XmComboBox, the widget displays the wrong number of items) * Added missing 'O' character to UTF8_SUPPORTED macro * Fixed bug #1476 (PanedWindow orientation error) * Fixed bug #1277 (paned widget does not work under Fedora Core 2 with motif 2.2.3-4.1) * Fixed bug #1212 (XmDropSiteRetrieve frees XRectangles before caller can use them) * Fixed in order to allow build out of source tree * Added wml_DEPENDENCIES in tools/wml/Makefile.am * Added ACLOCAL_AMFLAGS in Makefile.am 2.3.1 September 2008 * Added ${prefix}/share/Xm as possible prefix for demos binaries installation * Fixed bug #1443 (Build failure on FreeBSD: undefined reference to `libiconv_open') * Fixed bug #1427 (_xrm '*.iconPixmap:SDtErrors.l' produces bogus error messages) * Refixed bug #1381 (Sensitivity invisible with antialiased fonts) * Fixed bug #1359 (File dialog filter problem with * or [ in directory) * Fixed bug #1446 (Arrow button in DropDown widget issue.) * Fixed bug #1328 (Desktop hang: motif application in XGrabPointer) * Fixed bug #1425 (Resetting entryParent causes crash) * Fixed bug #1439 (warnings during compilation in TabBox.c) * Fixed bug #1420 (DataF.c holds message strings.) * Fixed bug #1419 (Bindings of DataField defined in DataF.c instead of TranslNew.c) * Fixed bug #1431 (motif 2.3 and xorg 7.1.0 64bit problems) * Fixed bug #1432 (XmContainer incorrect GC allocation) * Fixed bug #1250 (XmCombo glyph is unexpectedly shifted when setting XmNvisibleItemCount) * Fixed bug #1401 (Specifying state pixmaps in Container causes crash) * Refixed bug #1442 (Crash on Drag'n'Drop) * Fixed bug #1445 (PopupShell is closing on MouseWheel) * Refixed bug #1371 (XmComboBox problem on FC6) * Fixed bug #1438 (Missing XSetErrorHandler call in XmXftDrawCreate) * Fixed bug #1444 (Function _XmXftDrawCreate() does not work correct with the pixmap) * Fixed bug #1434 (single character utf8 sting is not displayed) * Fixed bug #1442 (Crash on Drag'n'Drop) * Fixed bug #1436 (Definition of GetSameRenditions in XmRenderT.c needs USE_XFT conditional) * Fixed bug #1400 (Corrupted per-display font cache) * Fixed bug #1440 (Tags array size in Label widget is not enough) * Fixed bug #1429 (Build failure with libtool-2.2.4) 2.3.1 Beta 1 May 2008 * Fixed bug #1410 (setting XmNisHomogeneous to True without setting XmNentryClass causes sigfault) * Fixed bug #1402 (Toggle button circular buttons can not mimic modern look) * Fixed bug #1415 (XFT width calculation problem) * Fixed bug #1362 (Repeated calls to XmListReplaceItemsPos cause Error: Cannot perform malloc when using Extended_Select) * Fixed bug #1365 (Top pixel of German character I with top '^' leaves trails) * Fixed bug #1414 (XFT support slowness) * Fixed bug #1351 (Bad dynamic propagation of the sensitive state to popup menus) * Fixed bug #1409 (XmTextField sometimes crashes if a string is set by XtSetValues when XmNmodifyVerifyCallback is set (Only in multibyte locale)) * Fixed bug #1398 (newline not supported in UTF-8 mode) * Fixed bug #1406 (Insensitive icon on XmPushButton black instead of grayed out) * Fixed bug #1396 (ScrollBar warning when XmNotebook resized) * Refixed bug #1388 (SEGV error moving mouse over window related to XmToolTipGetLabel). * Fixed bug #1405 (Menus too short if PIXMAP_AND_STRING is used in PushButtons) * Fixed bug #1404 (PIXMAP_AND_STRING causes crash in XmPushButtton in OptionMenu) * Fixed incorrect parenthesis in if statement * Fixed bug #1371 (XmComboBox problem on FC6) * Fixed bug #1296 (Drag-and-drop behaves incorrectly if XtSetLanguageProc() is present) * Fixed bug #1399 (cut and copy don't work in XmText widget) * Added /usr as possible prefix for toolkit installation * Fixed bug #1395 (Wrong label foreground for etched in menus) * Fixed bug #1392 (The label widgets can have their core class translations changed). * Fixed bug #1337 (XmPushButton's ArmAndActivate() has incorrect callback call). * Fixed bug #1384 (Use of freed storage in XmContainer). * Fixed bug #1209 (XmTextPaste crashes using XmTextField). * Fixed bug #1367 (XmText autoShowCursorPosition is not always honoured when selected text is deleted). * Fixed bug #1140 (Functions do not check _XmGetWidgetExtData() result). * Fixed bug #1383 (missing semi-colon at end of sentense). * Fixed bug #1390 (out of range in array read in ReplaceItem). * Fixed bug #1388 (SEGV error moving mouse over window related to XmToolTipGetLabel). * Fixed bug #1387 (Scale Widget draws value text not centered to slider) * Fixed bug #1381 (Sensitivity invisible with antialiased fonts) * Fixed bug #1389 (A middle click on a tab lets nedit segfault) * Fixed bug #1377 (XmText memory leak in InitializeHook) * Fixed bug #1385 (core.self of XmMultiList is NULL, but must be pointer itself.) * Fixed bug #1380 (Can not set title bar in 2.3) 2.3.0 Beta 2 January 2006 * Fixed vulnerabilities in the libXpm code [CAN-2004-0914 (multiple vulnerabilities) and CAN-2005-0605 (buffer overflow)] * Got rid of the obsolete tmpnam() call in imake * Fixed bug #1315 (Division by zero in List widget) * Fixed bug #1314 (Buffer overflow in MrmItop.c on 64-bit systems) * Fixed bug #1313 (getsubres.c has fallback resources defined that aren't terminated with NULL) * Fixed bug #1304 (Buffer overflow in MrmOpenHierarchy...()) * Fixed bug #1297 (Insensitive XmPIXMAP XmPushButtons are stippled with the wrong color) * Fixed bug #1294 (XmFileSelectionBox's XmNdirSpec resource misbehaves when pathMode is PATH_MODE_RELATIVE) 2.3.0 Beta 1 November 2005 * #1121 (TabBox translation error) * Removed locking of the clipboard from XmClipboardRetrieveStart() * #1283 (TabBox translation error) * #1249 (XmCombo crashes program when resized) * #1286 (XmDataField error with XmALIGNMENT_END) * #1211 (Crash on setting XmNlabelPixmap in a ToggleButtonGadget) * #1264 (Crash in PutDSToStream due to bug in _XmResizeHashTable) * #1276 (Changing AddMode in XmList selects/deselects items without callback) * #1196 (Free memory read in XmIm.c/draw_separator()) * #1193 (MWM crashes when restarting by a session manager) * #1202 (MWM crashes when duplicating a window menu containing f.circle_up) * #1186 (Invalid replacing XmList selected items) * #1214 (Cannot set a string to XmTextField with XtSetValues when XmNmodifyVerifyCallback is set) * #1279 (XmTextGetSelectionPosition returns incorrect values after deleting selection) * #1269 (Popup menus fail on Tarantella/VNC) * #1262 (Entering Esc key before pulldown menu realized crashes) * #1268 (XmCvtXmStringToCT improperly handles an empty string) * Added DataField.h and TabBox.h to XmAll.h * Added synthetic resolution independent conversion of width/height resources to ExtendedList for MultiList * Added wide character string value of search string to ExtendedListCallbackStruct * Made DropDown using XmGrabShell instead of TopLevelShell * #1260 (Option menu changes screen's focus to 'None') * #1258 (XmDataField: data out-of-bounds bug in df_FindPixelLength) * #1257 (XmTextField: "Character xxx not supported in font" errors, bug in multibyte code) * #1256 (Problem with XmNsingleSelectionCallback in XmExt18List widget) * Fixed incorrect XmRenderTableToProp() behavior appearing in RendToProp test * Fixed incorrect XmClipboardCopyByName() behavior appearing in CutPaste2 test 2.3.0 May 2007 a. Several bugs were fixed. 2.2.4 October 2004 a. Fixed vulnerabilities in libXpm code [CVE numbers CAN-2004-0687 (integer overflows) and CAN-2004-0688 (stack overflows)]. b. Fixed compilation under SUSE 9.1. c. Fixed building procedure under FreeBSD. d. Fixed building procedure in order to make it usable with new versions of autoconfig. 2.2.3 August 2002 a. uil support for the new widgets was finished along with demonstrations in the periodic demo. b. Several bugs were fixed. c. Automake building is supported in an object directory. 2.2.1 January 29, 2002 a. The Test directory that contained the automated tests was mentioned in the Release Notes but absent from the source distribution. The reference in the Release Notes was removed. The Tests are still available from the CVS tree. b. Due to an oversight, imake support was not included in the distribution. It was added back in this update. c. If an older version of Motif was installed, the Autoconf build would pick up the older #include files and fail. The Autoconf configuration files were updated to use the proper #include files. d. Formatting errors in doc/man/man3/Makefile.am were corrected. e. The directory demos/unsupported/motifshell contained no source code but was mentioned in configure.in. The proper source code was placed in this directory. f. ToolTip.c and SlideC.c were included in config.h twice. The extra reference was removed. g. The demos for the new widgets were originally placed in the directory demos/programs/newwidgets. To maintain consistency, they were moved to demos/programs. h. The Releases Notes specified the incorrect resource names for enabling tooltips and specifying the string. These typos were corrected. i. Compatibility note for user developed widgets was added to Release Notes. 2.2.0 January 28, 2002 Initial Release motif-2.3.8/config/0000755000175000017500000000000013211513004011076 500000000000000motif-2.3.8/config/Makefile.in0000644000175000017500000004636213211512765013113 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = util all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign config/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/config/util/0000755000175000017500000000000013211513004012053 500000000000000motif-2.3.8/config/util/makeg.man0000644000175000017500000000315112726641672013603 00000000000000.\" $TOG: makeg.man /main/2 1998/02/06 11:24:05 kaleb $ .\" .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA .\" .TH MAKEG 1 "Release 6.4" "X Version 11" .SH NAME makeg \- make a debuggable executable .SH SYNOPSIS .B makeg [ .I make-options .\|.\|. ] [ .I targets .\|.\|. ] .SH DESCRIPTION The .I makeg script runs .I make, passing it variable settings to create a debuggable target when used with a Makefile generated by .I imake. For example, it arranges for the C compiler to be called with the .B \-g option. .SH ENVIRONMENT .TP 8 .B MAKE The .I make program to use. Default ``make''. .TP 8 .B GDB Set to a non-null value if using the .I gdb debugger on Solaris 2, which requires additional debugging options to be passed to the compiler. .SH "SEE ALSO" .I make (1), .I imake (1) motif-2.3.8/config/util/mergelib.cpp0000644000175000017500000000457212726641672014324 00000000000000XCOMM!/bin/sh XCOMM XCOMM $TOG: mergelib.cpp /main/5 1998/02/06 11:24:31 kaleb $ XCOMM XCOMM Motif XCOMM XCOMM Copyright (c) 1987-2012, The Open Group. All rights reserved. XCOMM XCOMM These libraries and programs are free software; you can XCOMM redistribute them and/or modify them under the terms of the GNU XCOMM Lesser General Public License as published by the Free Software XCOMM Foundation; either version 2 of the License, or (at your option) XCOMM any later version. XCOMM XCOMM These libraries and programs are distributed in the hope that XCOMM they will be useful, but WITHOUT ANY WARRANTY; without even the XCOMM implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR XCOMM PURPOSE. See the GNU Lesser General Public License for more XCOMM details. XCOMM XCOMM You should have received a copy of the GNU Lesser General Public XCOMM License along with these librararies and programs; if not, write XCOMM to the Free Software Foundation, Inc., 51 Franklin Street, Fifth XCOMM Floor, Boston, MA 02110-1301 USA XCOMM XCOMM Author: Jim Fulton, MIT X Consortium XCOMM XCOMM mergelib - merge one library into another; this is commonly used by X XCOMM to add the extension library into the base Xlib. XCOMM usage="usage: $0 to-library from-library [object-filename-prefix]" objprefix=_ case $# in 2) ;; 3) objprefix=$3 ;; *) echo "$usage" 1>&2; exit 1 ;; esac tolib=$1 fromlib=$2 if [ ! -f $fromlib ]; then echo "$0: no such from-library $fromlib" 1>&2 exit 1 fi if [ ! -f $tolib ]; then echo "$0: no such to-library $tolib" 1>&2 exit 1 fi XCOMM XCOMM Create a temp directory, and figure out how to reference the XCOMM object files from it (i.e. relative vs. absolute path names). XCOMM tmpdir=tmp.$$ origdir=.. mkdir $tmpdir if [ ! -d $tmpdir ]; then echo "$0: unable to create temporary directory $tmpdir" 1>&2 exit 1 fi case "$fromlib" in /?*) upfrom= ;; *) upfrom=../ ;; esac case "$tolib" in /?*) upto= ;; *) upto=../ ;; esac XCOMM XCOMM In the temp directory, extract all of the object files and prefix XCOMM them with some symbol to avoid name clashes with the base library. XCOMM cd $tmpdir ar x ${upfrom}$fromlib for i in *.o; do mv $i ${objprefix}$i done XCOMM XCOMM Merge in the object modules, ranlib (if appropriate) and cleanup XCOMM ARCMD ${upto}$tolib *.o RANLIB ${upto}$tolib cd $origdir rm -rf $tmpdir motif-2.3.8/config/util/lndir.c0000644000175000017500000001712012726641672013277 00000000000000/* $TOG: lndir.c /main/17 1998/02/06 11:23:50 kaleb $ */ /* Create shadow link tree (after X11R4 script of the same name) Mark Reinhold (mbr@lcs.mit.edu)/3 January 1990 */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif /* From the original /bin/sh script: Used to create a copy of the a directory tree that has links for all non-directories (except those named RCS, SCCS or CVS.adm). If you are building the distribution on more than one machine, you should use this technique. If your master sources are located in /usr/local/src/X and you would like your link tree to be in /usr/local/src/new-X, do the following: % mkdir /usr/local/src/new-X % cd /usr/local/src/new-X % lndir ../X */ #include #include #include #include #include #include #ifndef X_NOT_POSIX #include #else #ifdef SYSV #include #else #ifdef USG #include #else #include #ifndef dirent #define dirent direct #endif #endif #endif #endif #ifndef MAXPATHLEN #define MAXPATHLEN 2048 #endif #if NeedVarargsPrototypes #include #endif #ifdef X_NOT_STDC_ENV extern int errno; #endif int silent = 0; /* -silent */ int ignore_links = 0; /* -ignorelinks */ char *rcurdir; char *curdir; void quit ( #if NeedVarargsPrototypes int code, char * fmt, ...) #else code, fmt, a1, a2, a3) char *fmt; #endif { #if NeedVarargsPrototypes va_list args; va_start(args, fmt); vfprintf (stderr, fmt, args); va_end(args); #else fprintf (stderr, fmt, a1, a2, a3); #endif putc ('\n', stderr); exit (code); } void quiterr (code, s) char *s; { perror (s); exit (code); } void msg ( #if NeedVarargsPrototypes char * fmt, ...) #else fmt, a1, a2, a3) char *fmt; #endif { #if NeedVarargsPrototypes va_list args; #endif if (curdir) { fprintf (stderr, "%s:\n", curdir); curdir = 0; } #if NeedVarargsPrototypes va_start(args, fmt); vfprintf (stderr, fmt, args); va_end(args); #else fprintf (stderr, fmt, a1, a2, a3); #endif putc ('\n', stderr); } void mperror (s) char *s; { if (curdir) { fprintf (stderr, "%s:\n", curdir); curdir = 0; } perror (s); } int equivalent(lname, rname) char *lname; char *rname; { char *s; if (!strcmp(lname, rname)) return 1; for (s = lname; *s && (s = strchr(s, '/')); s++) { while (s[1] == '/') strcpy(s+1, s+2); } return !strcmp(lname, rname); } /* Recursively create symbolic links from the current directory to the "from" directory. Assumes that files described by fs and ts are directories. */ dodir (fn, fs, ts, rel) char *fn; /* name of "from" directory, either absolute or relative to cwd */ struct stat *fs, *ts; /* stats for the "from" directory and cwd */ int rel; /* if true, prepend "../" to fn before using */ { DIR *df; struct dirent *dp; char buf[MAXPATHLEN + 1], *p; char symbuf[MAXPATHLEN + 1]; char basesym[MAXPATHLEN + 1]; struct stat sb, sc; int n_dirs; int symlen; int basesymlen = -1; char *ocurdir; if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino)) { msg ("%s: From and to directories are identical!", fn); return 1; } if (rel) strcpy (buf, "../"); else buf[0] = '\0'; strcat (buf, fn); if (!(df = opendir (buf))) { msg ("%s: Cannot opendir", buf); return 1; } p = buf + strlen (buf); *p++ = '/'; n_dirs = fs->st_nlink; while (dp = readdir (df)) { if (dp->d_name[strlen(dp->d_name) - 1] == '~') continue; strcpy (p, dp->d_name); if (n_dirs > 0) { if (stat (buf, &sb) < 0) { mperror (buf); continue; } #ifdef S_ISDIR if(S_ISDIR(sb.st_mode)) #else if (sb.st_mode & S_IFDIR) #endif { /* directory */ n_dirs--; if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) continue; if (!strcmp (dp->d_name, "RCS")) continue; if (!strcmp (dp->d_name, "SCCS")) continue; if (!strcmp (dp->d_name, "CVS")) continue; if (!strcmp (dp->d_name, "CVS.adm")) continue; ocurdir = rcurdir; rcurdir = buf; curdir = silent ? buf : (char *)0; if (!silent) printf ("%s:\n", buf); if ((stat (dp->d_name, &sc) < 0) && (errno == ENOENT)) { if (mkdir (dp->d_name, 0777) < 0 || stat (dp->d_name, &sc) < 0) { mperror (dp->d_name); curdir = rcurdir = ocurdir; continue; } } if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) { msg ("%s: is a link instead of a directory", dp->d_name); curdir = rcurdir = ocurdir; continue; } if (chdir (dp->d_name) < 0) { mperror (dp->d_name); curdir = rcurdir = ocurdir; continue; } dodir (buf, &sb, &sc, (buf[0] != '/')); if (chdir ("..") < 0) quiterr (1, ".."); curdir = rcurdir = ocurdir; continue; } } /* non-directory */ symlen = readlink (dp->d_name, symbuf, sizeof(symbuf) - 1); if (symlen >= 0) symbuf[symlen] = '\0'; /* The option to ignore links exists mostly because checking for them slows us down by 10-20%. But it is off by default because this really is a useful check. */ if (!ignore_links) { /* see if the file in the base tree was a symlink */ basesymlen = readlink(buf, basesym, sizeof(basesym) - 1); if (basesymlen >= 0) basesym[basesymlen] = '\0'; } if (symlen >= 0) { /* Link exists in new tree. Print message if it doesn't match. */ if (!equivalent (basesymlen>=0 ? basesym : buf, symbuf)) msg ("%s: %s", dp->d_name, symbuf); } else { if (symlink (basesymlen>=0 ? basesym : buf, dp->d_name) < 0) mperror (dp->d_name); } } closedir (df); return 0; } main (ac, av) int ac; char **av; { char *prog_name = av[0]; char *fn, *tn; struct stat fs, ts; while (++av, --ac) { if (strcmp(*av, "-silent") == 0) silent = 1; else if (strcmp(*av, "-ignorelinks") == 0) ignore_links = 1; else if (strcmp(*av, "--") == 0) { ++av, --ac; break; } else break; } if (ac < 1 || ac > 2) quit (1, "usage: %s [-silent] [-ignorelinks] fromdir [todir]", prog_name); fn = av[0]; if (ac == 2) tn = av[1]; else tn = "."; /* to directory */ if (stat (tn, &ts) < 0) quiterr (1, tn); #ifdef S_ISDIR if (!(S_ISDIR(ts.st_mode))) #else if (!(ts.st_mode & S_IFDIR)) #endif quit (2, "%s: Not a directory", tn); if (chdir (tn) < 0) quiterr (1, tn); /* from directory */ if (stat (fn, &fs) < 0) quiterr (1, fn); #ifdef S_ISDIR if (!(S_ISDIR(fs.st_mode))) #else if (!(fs.st_mode & S_IFDIR)) #endif quit (2, "%s: Not a directory", fn); exit (dodir (fn, &fs, &ts, 0)); } motif-2.3.8/config/util/xmkmf.cpp0000644000175000017500000000176312726641672013657 00000000000000XCOMM!/bin/sh XCOMM XCOMM make a Makefile from an Imakefile from inside or outside the sources XCOMM XCOMM $XConsortium: xmkmf.cpp /main/22 1996/09/28 16:17:05 rws $ usage="usage: $0 [-a] [top_of_sources_pathname [current_directory]]" configdirspec=CONFIGDIRSPEC topdir= curdir=. do_all= case "$1" in -a) do_all="yes" shift ;; esac case $# in 0) ;; 1) topdir=$1 ;; 2) topdir=$1 curdir=$2 ;; *) echo "$usage" 1>&2; exit 1 ;; esac case "$topdir" in -*) echo "$usage" 1>&2; exit 1 ;; esac if [ -f Makefile ]; then echo mv -f Makefile Makefile.bak mv -f Makefile Makefile.bak fi if [ "$topdir" = "" ]; then args="-DUseInstalled "$configdirspec else args="-I$topdir/config/cf -DTOPDIR=$topdir -DCURDIR=$curdir" fi echo imake $args case "$do_all" in yes) imake $args && echo "make Makefiles" && make Makefiles && echo "make includes" && make includes && echo "make depend" && make depend ;; *) imake $args ;; esac motif-2.3.8/config/util/Makefile.ini0000644000175000017500000000103312726641672014235 00000000000000# $XConsortium: Makefile.ini,v 1.2 94/04/17 14:55:28 gildea Exp $ # # A way to get lndir built the first time, before you have imake up # and running. You may well have to specify OSFLAGS=-D to # get it to compile, which values are embedded in config files. What # you would pass as BOOTSTRAPCFLAGS might work. OSFLAGS = CC = cc CDEBUGFLAGS = -O INCLUDES = -I. CFLAGS = $(OSFLAGS) $(CDEBUGFLAGS) $(INCLUDES) SHELL = /bin/sh RM = rm -f LN = ln -s lndir: $(LN) ../../include X11 $(CC) -o lndir $(CFLAGS) lndir.c $(RM) X11 motif-2.3.8/config/util/Makefile.in0000644000175000017500000004512313211512765014062 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = makestrs$(EXEEXT) subdir = config/util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) makestrs_SOURCES = makestrs.c makestrs_OBJECTS = makestrs.$(OBJEXT) makestrs_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = makestrs.c DIST_SOURCES = makestrs.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = aminstall.sh bsdinst.sh checktree.c chownxterm.c \ install.sh lndir.c lndir.man Makefile.in makeg.man makeg.sh \ makestrs.c makestrs.man mdepend.cpp mergelib.cpp \ mkdirhier.man mkdirhier.sh syminst.sh x11mf.sh \ xmkmf.cpp xmkmf.man Makefile.ini INCLUDES = ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign config/util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign config/util/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list makestrs$(EXEEXT): $(makestrs_OBJECTS) $(makestrs_DEPENDENCIES) $(EXTRA_makestrs_DEPENDENCIES) @rm -f makestrs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(makestrs_OBJECTS) $(makestrs_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makestrs.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/config/util/makestrs.man0000644000175000017500000001341112726641672014350 00000000000000.\" $TOG: makestrs.man /main/4 1998/02/06 11:24:22 kaleb $ .\" .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA .TH MAKESTRS 1 "Release 6.4" "X Version 11" .SH NAME makestrs \- makes string table C source and header(s) .SH SYNOPSIS .B makestrs [-f source] [-abioptions ...] .SH DESCRIPTION The .I makestrs command creates string table C source files and headers. If .I -f .I source is not specified .I makestrs will read from .I stdin. The C source file is always written to .I stdout. .I makestrs creates one or more C header files as specified in the source file. The following options may be specified: .I -sparcabi, .I -intelabi, .I -functionabi, .I -arrayperabi, and .I -defaultabi. .LP .I -sparcabi is used on SPARC platforms conforming to the SPARC Compliance Definition, i.e. SVR4/Solaris. .LP .I -intelabi is used on Intel platforms conforming to the System V Application Binary Interface, i.e. SVR4. .LP .I -earlyR6abi may be used in addition to .I -intelabi for situations where the vendor wishes to maintain binary compatiblity between X11R6 public-patch 11 (and earlier) and X11R6 public-patch 12 (and later). .LP .I -functionabi generates a functional abi to the string table. This mechanism imposes a severe performance penalty and it's recommended that you not use it. .LP .I -arrayperabi results in a separate array for each string. This is the default behavior if makestrs was compiled with -DARRAYPERSTR (it almost never is). .LP .I -defaultabi forces the generation of the "normal" string table even if makestrs was compiled with -DARRAYPERSTR. Since makestrs is almost never compiled with -DARRAYPERSTR this is the default behavior if no abioptions are specified. .SH SYNTAX The syntax for string-list file is (items in square brackets are optional): .RS 4 #prefix .RE .RS 4 #feature .RE .RS 4 #externref .RE .RS 4 #externdef [] .RE .RS 4 [#ctempl ] .RE .LP .RS 4 #file .RE .RS 4 #table .RE .RS 4 [#htempl] .RE .RS 4 .RE .RS 4 ... .RE .RS 4 .RE .RS 4 [#table .RE .RS 4 .RE .RS 4 ... .RE .RS 4 .RE .RS 4 ... .RE .RS 4 #table .RE .RS 4 ...] .RE .RS 4 [#file .RE .RS 4 ...] .RE .LP In words you may have one or more #file directives. Each #file may have one or more #table directives. .LP The #prefix directive determines the string that makestr will prefix to each definition. .LP The #feature directive determines the string that makestr will use for the feature-test macro, e.g. X[TM]STRINGDEFINES. .LP The #externref directive determines the string that makestr will use for the extern clause, typically this will be "extern" but Motif wants it to be "externalref" .LP The #externdef directive determines the string that makestr will use for the declaration, typically this will be the null string (note that makestrs requires a trailing space in this case, i.e. "#externdef "), and Motif will use "externaldef(_xmstrings). .LP The #ctmpl directive determines the name of the file used as a template for the C source file that is generated .LP Each #file directive will result in a corresponding header file by that name containing the appropriate definitions as specified by command line options. A single C source file containing the declarations for the definitions in all the headers will be printed to stdout. .LP The #htmpl directive determines the name of the file used as a template for the C header file that is generated. .LP Each #table directive will be processed in accordance with the ABI. On most platforms all tables will be catenated into a single table with the name of the first table for that file. To conform to the Intel ABI separate tables will be generated with the names indicated. .LP The template files specified by the #ctmpl and #htmpl directives are processed by copying line for line from the template file to the appropriate output file. The line containing the string .I <<>> is not copied to the output file. The appropriate data is then copied to the output file and then the remainder of the template file is copied to the output file. .SH BUGS makestrs is not very forgiving of syntax errors. Sometimes you need a trailing space after # directives, other times they will mess you up. No warning messages are emitted. .SH SEE ALSO SPARC Compliance Definition 2.2., SPARC International Inc., 535 Middlefield Road, Suite 210, Menlo Park, CA 94025 .LP System V Application Binary Interface, Third Edition, ISBN 0-13-100439-5 UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs, NJ 07632 .LP System V Application Binary Interface, Third Edition, Intel386 Architecture Processor Supplement ISBN 0-13-104670-5 UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs, NJ 07632 .LP System V Application Binary Interface, Third Edition, SPARC Architecture Processor Supplement ISBN 0-13-104696-9 UNIX Press, PTR Prentice Hall, 113 Sylvan Avenue, Englewood Cliffs, NJ 07632 motif-2.3.8/config/util/lndir.man0000644000175000017500000001031712726641672013631 00000000000000.\" $TOG: lndir.man /main/11 1998/02/06 11:23:56 kaleb $ .\" .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA .\" .TH LNDIR 1 "Release 6.4" "X Version 11" .SH NAME lndir \- create a shadow directory of symbolic links to another directory tree .SH SYNOPSIS .B lndir [ .B \-silent ] [ .B \-ignorelinks ] .I \|fromdir\| [ .I todir ] .SH DESCRIPTION The .I lndir program makes a shadow copy .I todir of a directory tree .I fromdir, except that the shadow is not populated with real files but instead with symbolic links pointing at the real files in the .I fromdir directory tree. This is usually useful for maintaining source code for different machine architectures. You create a shadow directory containing links to the real source, which you will have usually mounted from a remote machine. You can build in the shadow tree, and the object files will be in the shadow directory, while the source files in the shadow directory are just symlinks to the real files. .PP This scheme has the advantage that if you update the source, you need not propagate the change to the other architectures by hand, since all source in all shadow directories are symlinks to the real thing: just cd to the shadow directory and recompile away. .PP The .I todir argument is optional and defaults to the current directory. The .I fromdir argument may be relative (e.g., ../src) and is relative to .I todir (not the current directory). .PP .\" CVS.adm is used by the Concurrent Versions System. Note that RCS, SCCS, CVS and CVS.adm directories are not shadowed. .PP If you add files, simply run .I lndir again. New files will be silently added. Old files will be checked that they have the correct link. .PP Deleting files is a more painful problem; the symlinks will just point into never never land. .PP If a file in \fIfromdir\fP is a symbolic link, \fIlndir\fP will make the same link in \fItodir\fP rather than making a link back to the (symbolic link) entry in \fIfromdir.\fP The \fB\-ignorelinks\fP flag changes this behavior. .SH OPTIONS .IP \-silent Normally \fIlndir\fP outputs the name of each subdirectory as it descends into it. The \fB\-silent\fP option suppresses these status messages. .IP \-ignorelinks Causes the program to not treat symbolic links in \fIfromdir\fP specially. The link created in \fItodir\fP will point back to the corresponding (symbolic link) file in \fIfromdir\fP. If the link is to a directory, this is almost certainly the wrong thing. .IP This option exists mostly to emulate the behavior the C version of \fIlndir\fP had in X11R6. Its use is not recommended. .SH DIAGNOSTICS The program displays the name of each subdirectory it enters, followed by a colon. The \fB\-silent\fP option suppresses these messages. .PP A warning message is displayed if the symbolic link cannot be created. The usual problem is that a regular file of the same name already exists. .PP If the link already exists but doesn't point to the correct file, the program prints the link name and the location where it does point. .SH BUGS The .I patch program gets upset if it cannot change the files. You should never run .I patch from a shadow directory anyway. .PP You need to use something like .nf find todir \|\-type l \|\-print \||\| xargs rm .fi to clear out all files before you can relink (if fromdir moved, for instance). Something like .nf find . \|\\! \|\-type d \|\-print .fi will find all files that are not directories. motif-2.3.8/config/util/install.sh0000755000175000017500000000353412726641672014034 00000000000000#!/bin/sh # # install - install a program, script, or datafile # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script 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}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" 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;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 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` fi # get rid of the old one and mode the new one in $doit $rmcmd $dst $doit $instcmd $src $dst # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; fi exit 0 motif-2.3.8/config/util/makeg.sh0000755000175000017500000000064312726641672013450 00000000000000#! /bin/sh # makeg - run "make" with options necessary to make a debuggable executable # $XConsortium: makeg.sh /main/4 1996/06/13 11:45:08 ray $ # set GDB=1 in your environment if using gdb on Solaris 2. make="${MAKE-make}" flags="CDEBUGFLAGS=-g CXXDEBUGFLAGS=-g" # gdb on Solaris needs the stabs included in the executable test "${GDB+yes}" = yes && flags="$flags -xs" exec "$make" $flags LDSTRIPFLAGS= ${1+"$@"} motif-2.3.8/config/util/mdepend.cpp0000644000175000017500000001001212726641672014134 00000000000000XCOMM!/bin/sh XCOMM XCOMM $TOG: mdepend.cpp /main/13 1997/06/20 21:12:18 kaleb $ XCOMM XCOMM Do the equivalent of the 'makedepend' program, but do it right. XCOMM XCOMM Usage: XCOMM XCOMM makedepend [cpp-flags] [-w width] [-s magic-string] [-f makefile] XCOMM [-o object-suffix] XCOMM XCOMM Notes: XCOMM XCOMM The C compiler used can be overridden with the environment XCOMM variable "CC". XCOMM XCOMM The "-v" switch of the "makedepend" program is not supported. XCOMM XCOMM XCOMM This script should XCOMM work on both USG and BSD systems. However, when System V.4 comes out, XCOMM USG users will probably have to change "silent" to "-s" instead of XCOMM "-" (at least, that is what the documentation implies). XCOMM CC=PREPROC silent='-' TMP=/tmp/mdep$$ CPPCMD=${TMP}a DEPENDLINES=${TMP}b TMPMAKEFILE=${TMP}c MAGICLINE=${TMP}d ARGS=${TMP}e trap "rm -f ${TMP}*; exit 1" 1 2 15 trap "rm -f ${TMP}*; exit 0" 1 2 13 echo " \c" > $CPPCMD if [ `wc -c < $CPPCMD` -eq 1 ] then c="\c" n= else c= n="-n" fi echo $n "$c" >$ARGS files= makefile= magic_string='# DO NOT DELETE' objsuffix='.o' width=78 endmarker="" verbose=n append=n while [ $# != 0 ] do if [ "$endmarker"x != x ] && [ "$endmarker" = "$1" ]; then endmarker="" else case "$1" in -D*|-I*) echo $n " '$1'$c" >> $ARGS ;; -g|-O) # ignore so we can just pass $(CFLAGS) in ;; *) if [ "$endmarker"x = x ]; then case "$1" in -w) width="$2" shift ;; -s) magic_string="$2" shift ;; -f*) if [ "$1" = "-f-" ]; then makefile="-" else makefile="$2" shift fi ;; -o) objsuffix="$2" shift ;; --*) echo "$1" | sed 's/^\-\-//' >${TMP}end endmarker="`cat ${TMP}end`" rm -f ${TMP}end if [ "$endmarker"x = x ]; then endmarker="--" fi ;; -v) verbose="y" ;; -a) append="y" ;; -cc) CC="$2" shift ;; -*) echo "Unknown option '$1' ignored" 1>&2 ;; *) files="$files $1" ;; esac fi ;; esac fi shift done echo ' $*' >> $ARGS echo "#!/bin/sh" > $CPPCMD echo "exec $CC `cat $ARGS`" >> $CPPCMD chmod +x $CPPCMD rm $ARGS case "$makefile" in '') if [ -r makefile ] then makefile=makefile elif [ -r Makefile ] then makefile=Makefile else echo 'no makefile or Makefile found' 1>&2 exit 1 fi ;; -) makefile=$TMPMAKEFILE ;; esac if [ "$verbose"x = "y"x ]; then cat $CPPCMD fi echo '' > $DEPENDLINES for i in $files do $CPPCMD $i \ | sed -n "/^#/s;^;$i ;p" done \ | sed -e 's|/[^/.][^/]*/\.\.||g' -e 's|/\.[^.][^/]*/\.\.||g' \ -e 's|"||g' -e 's| \./| |' \ | awk '{ if ($1 != $4 && $2 != "#ident" && $2 != "#pragma") { ofile = substr ($1, 1, length ($1) - 2) "'"$objsuffix"'" print ofile, $4 } }' \ | sort -u \ | awk ' { newrec = rec " " $2 if ($1 != old1) { old1 = $1 if (rec != "") print rec rec = $1 ": " $2 } else if (length (newrec) > '"$width"') { print rec rec = $1 ": " $2 } else rec = newrec } END \ { if (rec != "") print rec }' \ | egrep -v '^[^:]*:[ ]*$' >> $DEPENDLINES trap "" 1 2 13 15 # Now we are committed case "$makefile" in $TMPMAKEFILE) ;; *) rm -f $makefile.bak cp $makefile $makefile.bak echo "Appending dependencies to $makefile" ;; esac XCOMM XCOMM If not -a, append the magic string and a blank line so that XCOMM /^$magic_string/+1,\$d can be used to delete everything from after XCOMM the magic string to the end of the file. Then, append a blank XCOMM line again and then the dependencies. XCOMM if [ "$append" = "n" ] then cat >> $makefile << END_OF_APPEND $magic_string END_OF_APPEND ed $silent $makefile << END_OF_ED_SCRIPT /^$magic_string/+1,\$d w q END_OF_ED_SCRIPT echo '' >>$makefile fi cat $DEPENDLINES >>$makefile case "$makefile" in $TMPMAKEFILE) cat $TMPMAKEFILE ;; esac rm -f ${TMP}* exit 0 motif-2.3.8/config/util/mkdirhier.sh0000755000175000017500000000177312726641672014347 00000000000000#!/bin/sh # $XConsortium: mkdirhier.sh,v 1.7 94/03/24 15:46:34 gildea Exp $ # Courtesy of Paul Eggert newline=' ' IFS=$newline case ${1--} in -*) echo >&2 "mkdirhier: usage: mkdirhier directory ..."; exit 1 esac status= for directory do case $directory in '') echo >&2 "mkdirhier: empty directory name" status=1 continue;; *"$newline"*) echo >&2 "mkdirhier: directory name contains a newline: \`\`$directory''" status=1 continue;; ///*) prefix=/;; # See Posix 2.3 "path". //*) prefix=//;; /*) prefix=/;; -*) prefix=./;; *) prefix= esac IFS=/ set x $directory case $2 in */*) # IFS parsing is broken IFS=' ' set x `echo $directory | tr / ' '` ;; esac IFS=$newline shift for filename do path=$prefix$filename prefix=$path/ shift test -d "$path" || { paths=$path for filename do if [ "$filename" != "." ]; then path=$path/$filename paths=$paths$newline$path fi done mkdir $paths || status=$? break } done done exit $status motif-2.3.8/config/util/x11mf.sh0000755000175000017500000000054412726641672013320 00000000000000#!/bin/sh # # generate a Makefile within the build tree # # usage: x11mf [treedir] # if [ x$1 != x ]; then tree=$1 else tree=/x11 fi dir=`pwd` top=`(cd $tree; /bin/pwd)` intree=no case $dir in $top*) intree=yes;; esac if [ $intree != yes ]; then echo "$0: Must be underneath $tree" exit 1 fi (cd ..; make SUBDIRS=`basename $dir` Makefiles) motif-2.3.8/config/util/checktree.c0000644000175000017500000001626512726641672014135 00000000000000/* $TOG: checktree.c /main/8 1998/02/06 11:23:04 kaleb $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifndef X_NOT_POSIX #include #else #ifdef SYSV #include #else #ifdef USG #include #else #include #ifndef dirent #define dirent direct #endif #endif #endif #endif #ifdef S_IFLNK #define Stat lstat #else #define Stat stat #endif #define CHARSALLOWED \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_." #define fmode_bits_minset 0444 #define fmode_bits_maxset 0777 #define fmode_bits_write 0222 #define dmode_bits_minset 0775 #ifdef X_NOT_STDC_ENV extern int errno; #endif int dorcs = 1; /* check RCS file */ int do83 = 1; /* check for 8+3 clash */ int doro = 1; /* disallow writable (checked out) files */ int dodot = 1; /* disallow .files */ int dotwiddle = 1; /* disallow file~ */ int dontcare(fn) char *fn; { char *cp; if (fn[strlen(fn) - 1] == '~') return 1; cp = strrchr(fn, '.'); return cp && (!strcmp(cp + 1, "Z") || !strcmp(cp + 1, "PS")); } checkfile(fullname, fn, fs) char *fullname, *fn; struct stat *fs; { char *cp; int maxlen = 12; int len, mode; if (dodot && fn[0] == '.') { printf("dot file: %s\n", fullname); return; } for (len = 0, cp = fn; *cp; len++, cp++) { if (!strchr(CHARSALLOWED, *cp)) { if (dotwiddle || *cp != '~' || cp[1]) printf ("bad character: %s\n", fullname); break; } } if (len > maxlen && !dontcare(fn)) printf("too long (%d): %s\n", len, fullname); #ifdef S_IFLNK if ((fs->st_mode & S_IFLNK) == S_IFLNK) { printf("symbolic link: %s\n", fullname); return; } #endif mode = fs->st_mode & (~S_IFMT); if ((fs->st_mode & S_IFDIR) == S_IFDIR) { maxlen = 14; if ((mode & dmode_bits_minset) != dmode_bits_minset) printf("directory mode 0%o not minimum 0%o: %s\n", mode, dmode_bits_minset, fullname); } else if ((fs->st_mode & S_IFREG) != S_IFREG) printf("not a regular file: %s\n", fullname); else { if ((mode & fmode_bits_minset) != fmode_bits_minset) printf("file mode 0%o not minimum 0%o: %s\n", fs->st_mode, fmode_bits_minset, fullname); if (fs->st_nlink != 1) printf("%d links instead of 1: %s\n", fs->st_nlink, fullname); if (doro && (mode & fmode_bits_write) && !dontcare(fn)) printf("writable: %s\n", fullname); } if ((mode & ~fmode_bits_maxset) != 0) printf("mode 0%o outside maximum set 0%o: %s\n", mode, fmode_bits_maxset, fullname); } void checkrcs(dir, p) char *dir; char *p; { DIR *df; struct dirent *dp; struct stat fs; int i; if (!(df = opendir(dir))) { fprintf(stderr, "cannot open: %s\n", dir); return; } while (dp = readdir(df)) { i = strlen(dp->d_name); if (dp->d_name[i - 1] == 'v' && dp->d_name[i - 2] == ',') { strcpy(p, dp->d_name); p[i - 2] = '\0'; if (Stat(dir, &fs) < 0) { strcpy(p, "RCS/"); strcat(p, dp->d_name); printf("not used: %s\n", dir); } } } closedir(df); } int Strncmp(cp1, cp2, n) char *cp1, *cp2; int n; { char c1, c2; for (; --n >= 0 && *cp1 && *cp2; cp1++, cp2++) { if (*cp1 != *cp2) { c1 = *cp1; c2 = *cp2; if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' - 'A'; else if (c1 == '-') c1 = '_'; if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' - 'A'; else if (c2 == '-') c2 = '_'; if (c1 != c2) return (int)c1 - (int)c2; } } if (n < 0) return 0; return (int)*cp1 - (int)*cp2; } int fncomp(n1, n2) char **n1, **n2; { int i, res; char *cp1, *cp2; char c1, c2; i = Strncmp(*n1, *n2, 8); if (!i) { cp1 = strrchr(*n1, '.'); cp2 = strrchr(*n2, '.'); if (cp1 || cp2) { if (!cp1) return -1; if (!cp2) return 1; i = Strncmp(cp1 + 1, cp2 + 1, 3); } } return i; } void checkdir(dir) char *dir; { DIR *df; struct dirent *dp; char *p; struct stat fs; char *s, **names; int i, max; if (!(df = opendir(dir))) { fprintf(stderr, "cannot open: %s\n", dir); return; } p = dir + strlen(dir); if (p[-1] != '/') *p++ = '/'; i = 0; max = 0; names = NULL; while (dp = readdir(df)) { strcpy(p, dp->d_name); if (Stat(dir, &fs) < 0) { perror(dir); continue; } if ((fs.st_mode & S_IFDIR) == S_IFDIR) { if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) continue; if (!strcmp (dp->d_name, "RCS")) { if (dorcs) checkrcs(dir, p); continue; } if (!strcmp (dp->d_name, "SCCS")) continue; if (!strcmp (dp->d_name, "CVS.adm")) continue; checkfile(dir, p, &fs); checkdir(dir); continue; } checkfile(dir, p, &fs); if (dorcs && !dontcare(dp->d_name)) { strcpy(p, "RCS/"); strcat(p, dp->d_name); strcat(p, ",v"); if (Stat(dir, &fs) < 0) { strcpy(p, dp->d_name); printf("no RCS: %s\n", dir); } } if (do83) { s = (char *)malloc(strlen(dp->d_name) + 1); strcpy(s, dp->d_name); if (i >= max) { max += 25; if (names) names = (char **)realloc((char *)names, (max + 1) * sizeof(char *)); else names = (char **)malloc((max + 1) * sizeof(char *)); } names[i++] = s; } } closedir(df); if (do83) { qsort((char *)names, i, sizeof(char *), fncomp); max = i - 1; *p = '\0'; for (i = 0; i < max; i++) { if (!fncomp(&names[i], &names[i + 1])) printf("8+3 clash: %s%s and %s\n", dir, names[i], names[i + 1]); free(names[i]); } if (names) { free(names[i]); free((char *)names); } } } main(argc, argv) int argc; char **argv; { char buf[2048]; argc--; argv++; while (argc > 0) { if (!strcmp(*argv, "-rcs")) { dorcs = 0; argc--; argv++; } else if (!strcmp(*argv, "-83")) { do83 = 0; argc--; argv++; } else if (!strcmp(*argv, "-ro")) { doro = 0; argc--; argv++; } else if (!strcmp(*argv, "-dot")) { dodot = 0; argc--; argv++; } else if (!strcmp(*argv, "-twiddle")) { dotwiddle = 0; argc--; argv++; } else break; } if (!argc) { strcpy(buf, "."); checkdir(buf); } else while (--argc >= 0) { strcpy(buf, *argv++); checkdir(buf); } } motif-2.3.8/config/util/xmkmf.man0000644000175000017500000000472012726641672013644 00000000000000.\" $TOG: xmkmf.man /main/9 1998/02/06 11:25:04 kaleb $ .\" .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA .TH XMKMF 1 "Release 6.4" "X Version 11" .SH NAME xmkmf \- create a Makefile from an Imakefile .SH SYNOPSIS .B xmkmf [ -a ] [ .I topdir [ .I curdir ] ] .SH DESCRIPTION The .I xmkmf command is the normal way to create a .I Makefile from an .I Imakefile shipped with third-party software. .PP When invoked with no arguments in a directory containing an .I Imakefile, the .I imake program is run with arguments appropriate for your system (configured into .I xmkmf when X was built) and generates a .I Makefile. .PP When invoked with the .I \-a option, .I xmkmf builds the .I Makefile in the current directory, and then automatically executes ``make Makefiles'' (in case there are subdirectories), ``make includes'', and ``make depend'' for you. This is the normal way to configure software that is outside the X Consortium build tree. .PP If working inside the X Consortium build tree (unlikely unless you are an X developer, and even then this option is never really used), the .I topdir argument should be specified as the relative pathname from the current directory to the top of the build tree. Optionally, .I curdir may be specified as a relative pathname from the top of the build tree to the current directory. It is necessary to supply .I curdir if the current directory has subdirectories, or the .I Makefile will not be able to build the subdirectories. If a .I topdir is given, .I xmkmf assumes nothing is installed on your system and looks for files in the build tree instead of using the installed versions. .SH "SEE ALSO" imake(1) motif-2.3.8/config/util/bsdinst.sh0000755000175000017500000000366412726641672014040 00000000000000#!/bin/sh # # This accepts bsd-style install arguments and makes the appropriate calls # to the System V install. # $XConsortium: bsdinst.sh /main/8 1996/09/28 16:16:11 rws $ flags="" dst="" src="" dostrip="" owner="" mode="" while [ x$1 != x ]; do case $1 in -c) shift continue;; -m) flags="$flags $1 $2 " mode="$2" shift shift continue;; -o) flags="$flags -u $2 " owner="$2" shift shift continue;; -g) flags="$flags $1 $2 " shift shift continue;; -s) dostrip="strip" shift continue;; *) if [ x$src = x ] then src=$1 else dst=$1 fi shift continue;; esac done case "$mode" in "") ;; *) case "$owner" in "") flags="$flags -u root" ;; esac ;; esac if [ x$src = x ] then echo "$0: no input file specified" exit 1 fi if [ x$dst = x ] then echo "$0: no destination specified" exit 1 fi # set up some variable to be used later rmcmd="" srcdir="." # if the destination isn't a directory we'll need to copy it first if [ ! -d $dst ] then dstbase=`basename $dst` cp $src /tmp/$dstbase rmcmd="rm -f /tmp/$dstbase" src=$dstbase srcdir=/tmp dst="`echo $dst | sed 's,^\(.*\)/.*$,\1,'`" if [ x$dst = x ] then dst="." fi fi # If the src file has a directory, copy it to /tmp to make install happy srcbase=`basename $src` if [ "$src" != "$srcbase" ] && [ "$src" != "./$srcbase" ] then cp $src /tmp/$srcbase src=$srcbase srcdir=/tmp rmcmd="rm -f /tmp/$srcbase" fi # do the actual install if [ -f /usr/sbin/install ] then installcmd=/usr/sbin/install elif [ -f /etc/install ] then installcmd=/etc/install else installcmd=install fi # This rm is commented out because some people want to be able to # install through symbolic links. Uncomment it if it offends you. # rm -f $dst/$srcbase (cd $srcdir ; $installcmd -f $dst $flags $src) if [ x$dostrip = xstrip ] then strip $dst/$srcbase fi # and clean up $rmcmd motif-2.3.8/config/util/aminstall.sh0000644000175000017500000000227512726641672014350 00000000000000#!/bin/sh # $XConsortium: aminstall.sh,v 1.1 94/03/29 15:54:08 gildea Exp $ # aminstall - transfer cross-compiled files to system running Amoeba. # Usage: aminstall binary-directory [-s stksz] unix-source amoeba-dest # # Default soap mask for files # SPMASK=0xFF:2:2 export SPMASK PROG=$0 USAGE="Usage: $PROG binary-directory unix-source amoeba-dest" # # Argument check # case $# in 3|5) ;; *) echo $USAGE >&2 exit 1 ;; esac bindir=$1 stksz= case $2 in -s) if [ $# -ne 5 ] then echo $USAGE >&2 exit 1 fi stksz="-s $3" shift shift ;; esac unxfile=$2 dest=$3 # # Change /public .... into /super (just for installation) # stripped=`echo $dest | sed 's:^/public::'` if [ X$dest != X$stripped ]; then dest=/super$stripped fi # # If the file already exists, then delete it # INFO=`$bindir/std_info $dest 2>&1` case $INFO in *"not found"*) ;; *failed*) ;; *bytes*) $bindir/del -f $dest ;; /??????) echo $PROG: cannot install over directory 1>&2 exit ;; *) $bindir/del -d $dest ;; esac # # Transfer the file to Amoeba # $bindir/../bin.scripts/ainstall $stksz $unxfile $dest > /dev/null 2>&1 if [ $? -ne 0 ] then echo "This is not binary - using tob" $bindir/tob $unxfile $dest fi motif-2.3.8/config/util/chownxterm.c0000644000175000017500000000360412726641672014367 00000000000000/* $TOG: chownxterm.c /main/4 1998/02/06 11:23:10 kaleb $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * chownxterm --- make xterm suid root * * By Stephen Gildea, December 1993 */ #ifdef HAVE_CONFIG_H #include #endif #define XTERM_PATH "/x11/programs/xterm/xterm" #include #include char *prog_name; void help() { setgid(getgid()); setuid(getuid()); printf("chown-xterm makes %s suid root\n", XTERM_PATH); printf("This is necessary on Ultrix for /dev/tty operation.\n"); exit(0); } void print_error(err_string) char *err_string; { setgid(getgid()); setuid(getuid()); fprintf(stderr, "%s: \"%s\"", prog_name, err_string); perror(" failed"); exit(1); } main(argc, argv) int argc; char **argv; { prog_name = argv[0]; if (argc >= 2 && strcmp(argv[1], "-help") == 0) { help(); } else { if (chown(XTERM_PATH, 0, -1) != 0) print_error("chown root " XTERM_PATH); if (chmod(XTERM_PATH, 04555) != 0) print_error("chmod 4555 " XTERM_PATH); } exit(0); } motif-2.3.8/config/util/makestrs.c0000644000175000017500000004421712726641672014027 00000000000000/* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* Constructs string definitions */ #ifdef HAVE_CONFIG_H #include #endif #include #include #ifndef X_NOT_STDC_ENV #include #else char *malloc(); #endif #if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */ char *malloc(); #endif /* macII */ typedef struct _TableEnt { struct _TableEnt* next; char* left; char* right; int offset; } TableEnt; typedef struct _Table { struct _Table* next; TableEnt* tableent; TableEnt* tableentcurrent; TableEnt** tableenttail; char* name; int offset; } Table; typedef struct _File { struct _File* next; FILE* tmpl; char* name; Table* table; Table* tablecurrent; Table** tabletail; } File; static File* file = NULL; static File* filecurrent = NULL; static File** filetail = &file; static char* conststr; static char* prefixstr = NULL; static char* featurestr = NULL; static char* ctmplstr = NULL; static char* fileprotstr; static char* externrefstr; static char* externdefstr; #define X_DEFAULT_ABI 0 #define X_ARRAYPER_ABI 1 #define X_INTEL_ABI 2 #define X_INTEL_ABI_BC 3 #define X_SPARC_ABI 4 #define X_FUNCTION_ABI 5 #define X_MAGIC_STRING "<<>>" static void WriteHeaderProlog (FILE* f, File* phile) { Table* t; TableEnt* te; (void) fprintf (f, "#ifdef %s\n", featurestr); for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) { if (strcmp (te->left, "RAtom") == 0) { (void) fprintf (f, "#ifndef %s%s\n#define %s%s \"%s\"\n#endif\n", prefixstr, te->left, prefixstr, te->left, te->right); } else { (void) fprintf (f, "#define %s%s \"%s\"\n", prefixstr, te->left, te->right); } } (void) fprintf (f, "%s", "#else\n"); } static void IntelABIWriteHeader (FILE* f, File* phile) { Table* t; TableEnt* te; WriteHeaderProlog (f, phile); for (t = phile->table; t; t = t->next) { (void) fprintf (f, "%s %sConst char %s[];\n", externrefstr, conststr ? conststr : fileprotstr, t->name); for (te = t->tableent; te; te = te->next) (void) fprintf (f, "#ifndef %s%s\n#define %s%s ((char*)&%s[%d])\n#endif\n", prefixstr, te->left, prefixstr, te->left, t->name, te->offset); } (void) fprintf (f, "#endif /* %s */\n", featurestr); } static void SPARCABIWriteHeader (FILE* f, File* phile) { Table* t; TableEnt* te; for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) (void) fprintf (f, "#define %s%s \"%s\"\n", prefixstr, te->left, te->right); } static void FunctionWriteHeader (FILE* f, File* phile) { Table* t; TableEnt* te; WriteHeaderProlog (f, phile); (void) fprintf (f, "%s %sConst char* %s();\n", externrefstr, conststr ? conststr : fileprotstr, phile->table->name); for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) (void) fprintf (f, "#ifndef %s%s\n#define %s%s (%s(%d))\n#endif\n", prefixstr, te->left, prefixstr, te->left, phile->table->name, te->offset); (void) fprintf (f, "#endif /* %s */\n", featurestr); } static void ArrayperWriteHeader (FILE* f, File* phile) { Table* t; TableEnt* te; WriteHeaderProlog (f, phile); for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) (void) fprintf (f, "#ifndef %s%s\n%s %sConst char %s%s[];\n#endif\n", prefixstr, te->left, externrefstr, conststr ? conststr : fileprotstr, prefixstr, te->left); (void) fprintf (f, "#endif /* %s */\n", featurestr); } static void DefaultWriteHeader (FILE* f, File* phile) { Table* t; TableEnt* te; WriteHeaderProlog (f, phile); (void) fprintf (f, "%s %sConst char %s[];\n", externrefstr, conststr ? conststr : fileprotstr, phile->table->name); for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) (void) fprintf (f, "#ifndef %s%s\n#define %s%s ((char*)&%s[%d])\n#endif\n", prefixstr, te->left, prefixstr, te->left, phile->table->name, te->offset); (void) fprintf (f, "#endif /* %s */\n", featurestr); } static void CopyTmplProlog (FILE* tmpl, FILE* f) { char buf[1024]; static char* magic_string = X_MAGIC_STRING; int magic_string_len = strlen (magic_string); while (fgets (buf, sizeof buf, tmpl)) { if (strncmp (buf, magic_string, magic_string_len) == 0) { return; } (void) fputs (buf, f); } } static void CopyTmplEpilog (FILE* tmpl, FILE* f) { char buf[1024]; while (fgets (buf, sizeof buf, tmpl)) (void) fputs (buf, f); } static char* abistring[] = { "Default", "Array per string", "Intel", "Intel BC", "SPARC", "Function" }; static void WriteHeader (char* tagline, File* phile, int abi) { FILE* f; char* tmp; Table* t; TableEnt* te; static void (*headerproc[])() = { DefaultWriteHeader, ArrayperWriteHeader, IntelABIWriteHeader, IntelABIWriteHeader, SPARCABIWriteHeader, FunctionWriteHeader }; if ((f = fopen (phile->name, "w+")) == NULL) exit (1); if (phile->tmpl) CopyTmplProlog (phile->tmpl, f); (void) fprintf (f, "%s\n%s\n/* %s ABI version -- Do not edit */\n", "/* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */", "/* This file is automatically generated. */", abistring[abi]); if (tagline) (void) fprintf (f, "/* %s */\n\n", tagline); /* do the right thing for Motif, i.e. avoid _XmXmStrDefs_h_ */ if (strcmp (prefixstr, "Xm") == 0) { if ((fileprotstr = malloc (strlen (phile->name) + 3)) == NULL) exit (1); (void) sprintf (fileprotstr, "_%s_", phile->name); } else { if ((fileprotstr = malloc (strlen (phile->name) + strlen (prefixstr) + 3)) == NULL) exit (1); (void) sprintf (fileprotstr, "_%s%s_", prefixstr, phile->name); } for (tmp = fileprotstr; *tmp; tmp++) if (*tmp == '.') *tmp = '_'; (*headerproc[abi])(f, phile); if (phile->tmpl) CopyTmplEpilog (phile->tmpl, f); (void) free (fileprotstr); (void) fclose (phile->tmpl); (void) fclose (f); } static void WriteSourceLine (TableEnt* te, int abi, int fudge) { char* c; for (c = te->right; *c; c++) (void) printf ("'%c',", *c); (void) printf ("%s", "'\\0'"); if (te->next || fudge) (void) printf ("%c", ','); (void) printf ("%s", "\n"); } static char* const_string = "%s %sConst char %s[] = {\n"; static void IntelABIWriteSource (int abi) { File* phile; for (phile = file; phile; phile = phile->next) { Table* t; TableEnt* te; for (t = phile->table; t; t = t->next) { (void) printf (const_string, externdefstr, conststr ? conststr : "", t->name); for (te = t->tableent; te; te = te->next) WriteSourceLine (te, abi, 0); (void) printf ("%s\n\n", "};"); } } } static void IntelABIBCWriteSource (int abi) { File* phile; for (phile = file; phile; phile = phile->next) { Table* t; TableEnt* te; (void) printf (const_string, externdefstr, conststr ? conststr : "", phile->table->name); for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) WriteSourceLine (te, abi, t->next ? 1 : 0); (void) printf ("%s\n\n", "};"); if (phile->table->next) { (void) printf (const_string, externdefstr, conststr ? conststr : "", phile->table->next->name); for (t = phile->table->next; t; t = t->next) for (te = t->tableent; te; te = te->next) WriteSourceLine (te, abi, 0); (void) printf ("%s\n\n", "};"); } } } static void FunctionWriteSource (int abi) { File* phile; for (phile = file; phile; phile = phile->next) { Table* t; TableEnt* te; (void) printf ("static %sConst char _%s[] = {\n", conststr ? conststr : "", phile->table->name); for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) WriteSourceLine (te, abi, t->next ? 1 : 0); (void) printf ("%s\n\n", "};"); (void) printf ("%sConst char* %s(index)\n int index;\n{\n return &_%s[index];\n}\n\n", conststr ? conststr : "", phile->table->name, phile->table->name); } } static void ArrayperWriteSource (int abi) { File* phile; static int done_atom; for (phile = file; phile; phile = phile->next) { Table* t; TableEnt* te; for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) { if (strcmp (te->left, "RAtom") == 0) { if (done_atom) return; done_atom = 1; } (void) printf ("%s %sConst char %s%s[] = \"%s\";\n", externdefstr, conststr ? conststr : "", prefixstr, te->left, te->right); } } } static void DefaultWriteSource (int abi) { File* phile; for (phile = file; phile; phile = phile->next) { Table* t; TableEnt* te; (void) printf (const_string, externdefstr, conststr ? conststr : "", phile->table->name); for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) WriteSourceLine (te, abi, t->next ? 1 : 0); (void) printf ("%s\n\n", "};"); } } static void WriteSource(char* tagline, int abi) { static void (*sourceproc[])() = { DefaultWriteSource, ArrayperWriteSource, IntelABIWriteSource, IntelABIBCWriteSource, DefaultWriteSource, FunctionWriteSource }; FILE* tmpl; if (ctmplstr) { tmpl = fopen (ctmplstr, "r"); if (tmpl) CopyTmplProlog (tmpl, stdout); else { (void) fprintf (stderr, "Expected template %s, not found\n", ctmplstr); exit (1); } } else tmpl = NULL; (void) printf ("%s\n%s\n/* %s ABI version -- Do not edit */\n", "/* $TOG: makestrs.c /main/11 1998/02/06 11:24:15 kaleb $ */", "/* This file is automatically generated. */", abistring[abi]); if (tagline) (void) printf ("/* %s */\n\n", tagline); (*sourceproc[abi])(abi); if (tmpl) { CopyTmplEpilog (tmpl, stdout); fclose(tmpl); } } static void DoLine(char* buf) { #define X_NO_TOKEN 0 #define X_FILE_TOKEN 1 #define X_TABLE_TOKEN 2 #define X_PREFIX_TOKEN 3 #define X_FEATURE_TOKEN 4 #define X_EXTERNREF_TOKEN 5 #define X_EXTERNDEF_TOKEN 6 #define X_CTMPL_TOKEN 7 #define X_HTMPL_TOKEN 8 #define X_CONST_TOKEN 9 int token; char lbuf[1024]; static char* file_str = "#file"; static char* table_str = "#table"; static char* prefix_str = "#prefix"; static char* feature_str = "#feature"; static char* externref_str = "#externref"; static char* externdef_str = "#externdef"; static char* ctmpl_str = "#ctmpl"; static char* htmpl_str = "#htmpl"; static char* const_str = "#const"; if (strncmp (buf, file_str, strlen (file_str)) == 0) token = X_FILE_TOKEN; else if (strncmp (buf, table_str, strlen (table_str)) == 0) token = X_TABLE_TOKEN; else if (strncmp (buf, prefix_str, strlen (prefix_str)) == 0) token = X_PREFIX_TOKEN; else if (strncmp (buf, feature_str, strlen (feature_str)) == 0) token = X_FEATURE_TOKEN; else if (strncmp (buf, externref_str, strlen (externref_str)) == 0) token = X_EXTERNREF_TOKEN; else if (strncmp (buf, externdef_str, strlen (externdef_str)) == 0) token = X_EXTERNDEF_TOKEN; else if (strncmp (buf, ctmpl_str, strlen (ctmpl_str)) == 0) token = X_CTMPL_TOKEN; else if (strncmp (buf, htmpl_str, strlen (htmpl_str)) == 0) token = X_HTMPL_TOKEN; else if (strncmp (buf, const_str, strlen (const_str)) == 0) token = X_CONST_TOKEN; else token = X_NO_TOKEN; switch (token) { case X_FILE_TOKEN: { File* phile; if ((phile = (File*) malloc (sizeof(File))) == NULL) exit(1); if ((phile->name = malloc (strlen (buf + strlen (file_str)) + 1)) == NULL) exit(1); (void) strcpy (phile->name, buf + strlen (file_str) + 1); phile->table = NULL; phile->tablecurrent = NULL; phile->tabletail = &phile->table; phile->next = NULL; phile->tmpl = NULL; *filetail = phile; filetail = &phile->next; filecurrent = phile; } break; case X_TABLE_TOKEN: { Table* table; if ((table = (Table*) malloc (sizeof(Table))) == NULL) exit(1); if ((table->name = malloc (strlen (buf + strlen (table_str)) + 1)) == NULL) exit(1); (void) strcpy (table->name, buf + strlen (table_str) + 1); table->tableent = NULL; table->tableentcurrent = NULL; table->tableenttail = &table->tableent; table->next = NULL; table->offset = 0; *filecurrent->tabletail = table; filecurrent->tabletail = &table->next; filecurrent->tablecurrent = table; } break; case X_PREFIX_TOKEN: if ((prefixstr = malloc (strlen (buf + strlen (prefix_str)) + 1)) == NULL) exit(1); (void) strcpy (prefixstr, buf + strlen (prefix_str) + 1); break; case X_FEATURE_TOKEN: if ((featurestr = malloc (strlen (buf + strlen (feature_str)) + 1)) == NULL) exit(1); (void) strcpy (featurestr, buf + strlen (feature_str) + 1); break; case X_EXTERNREF_TOKEN: if ((externrefstr = malloc (strlen (buf + strlen (externref_str)) + 1)) == NULL) exit(1); (void) strcpy (externrefstr, buf + strlen (externref_str) + 1); break; case X_EXTERNDEF_TOKEN: if ((externdefstr = malloc (strlen (buf + strlen (externdef_str)) + 1)) == NULL) exit(1); (void) strcpy (externdefstr, buf + strlen (externdef_str) + 1); break; case X_CTMPL_TOKEN: if ((ctmplstr = malloc (strlen (buf + strlen (ctmpl_str)) + 1)) == NULL) exit(1); (void) strcpy (ctmplstr, buf + strlen (ctmpl_str) + 1); break; case X_HTMPL_TOKEN: if ((filecurrent->tmpl = fopen (buf + strlen (htmpl_str) + 1, "r")) == NULL) { (void) fprintf (stderr, "Expected template %s, not found\n", htmpl_str); exit (1); } break; case X_CONST_TOKEN: if ((conststr = malloc (strlen (buf + strlen (const_str)) + 1)) == NULL) exit(1); (void) strcpy (conststr, buf + strlen (const_str) + 1); break; default: { char* right; TableEnt* tableent; int llen; int rlen; int len; if ((right = index(buf, ' '))) *right++ = 0; else right = buf + 1; if (buf[0] == 'H') { strcpy (lbuf, prefixstr); strcat (lbuf, right); right = lbuf; } llen = len = strlen(buf) + 1; rlen = strlen(right) + 1; if (right != buf + 1) len += rlen; if ((tableent = (TableEnt*)malloc(sizeof(TableEnt) + len)) == NULL) exit(1); tableent->left = (char *)(tableent + 1); strcpy(tableent->left, buf); if (llen != len) { tableent->right = tableent->left + llen; strcpy(tableent->right, right); } else { tableent->right = tableent->left + 1; } tableent->next = NULL; *filecurrent->tablecurrent->tableenttail = tableent; filecurrent->tablecurrent->tableenttail = &tableent->next; filecurrent->tablecurrent->tableentcurrent = tableent; } break; } } static void IntelABIIndexEntries (File* file) { Table* t; TableEnt* te; for (t = file->table; t; t = t->next) for (te = t->tableent; te; te = te->next) { te->offset = t->offset; t->offset += strlen (te->right); t->offset++; } } static void DefaultIndexEntries (File* file) { Table* t; TableEnt* te; int offset = 0; for (t = file->table; t; t = t->next) for (te = t->tableent; te; te = te->next) { te->offset = offset; offset += strlen (te->right); offset++; } } static void IndexEntries (File* file, int abi) { switch (abi) { case X_SPARC_ABI: break; case X_INTEL_ABI: case X_INTEL_ABI_BC: IntelABIIndexEntries (file); break; default: DefaultIndexEntries (file); break; } } static char* DoComment (char* line) { char* tag; char* eol; char* ret; int len; /* assume that the first line with two '$' in it is the RCS tag line */ if ((tag = index (line, '$')) == NULL) return NULL; if ((eol = index (tag + 1, '$')) == NULL) return NULL; len = eol - tag; if ((ret = malloc (len)) == NULL) exit (1); (void) strncpy (ret, tag + 1, len - 1); ret[len - 2] = 0; return ret; } int main(int argc, char *argv[]) { int len, i; char* tagline = NULL; File* phile; FILE *f; char buf[1024]; int abi = #ifndef ARRAYPERSTR X_DEFAULT_ABI; #else X_ARRAYPER_ABI; #endif f = stdin; if (argc > 1) { for (i = 1; i < argc; i++) { if (strcmp (argv[i], "-f") == 0) { if (++i < argc) f = fopen (argv[i], "r"); else return 1; } if (strcmp (argv[i], "-sparcabi") == 0) abi = X_SPARC_ABI; if (strcmp (argv[i], "-intelabi") == 0) abi = X_INTEL_ABI; if (strcmp (argv[i], "-functionabi") == 0) abi = X_FUNCTION_ABI; if (strcmp (argv[i], "-earlyR6bc") == 0 && (abi == X_INTEL_ABI)) abi = X_INTEL_ABI_BC; if (strcmp (argv[i], "-arrayperabi") == 0) abi = X_ARRAYPER_ABI; #ifdef ARRAYPERSTR if (strcmp (argv[i], "-defaultabi") == 0) abi = X_DEFAULT_ABI; #endif } } if (f == NULL) return 1; while (fgets(buf, sizeof(buf), f)) { if (!buf[0] || buf[0] == '\n') continue; if (buf[0] == '!') { if (tagline) continue; tagline = DoComment (buf); continue; } if (buf[(len = strlen (buf) - 1)] == '\n') buf[len] = '\0'; DoLine(buf); } for (phile = file; phile; phile = phile->next) { if (abi != X_ARRAYPER_ABI) IndexEntries (phile, abi); WriteHeader (tagline, phile, abi); } WriteSource(tagline, abi); return 0; } motif-2.3.8/config/util/mkdirhier.man0000644000175000017500000000244712726641672014504 00000000000000.\" $TOG: mkdirhier.man /main/10 1998/02/06 11:24:42 kaleb $ .\" .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA .TH MKDIRHIER 1 "Release 6.4" "X Version 11" .SH NAME mkdirhier \- makes a directory hierarchy .SH SYNOPSIS .B mkdirhier directory ... .SH DESCRIPTION The .I mkdirhier command creates the specified directories. Unlike .I mkdir if any of the parent directories of the specified directory do not exist, it creates them as well. .SH "SEE ALSO" mkdir(1) motif-2.3.8/config/util/Makefile.am0000644000175000017500000000056413145162623014051 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = aminstall.sh bsdinst.sh checktree.c chownxterm.c \ install.sh lndir.c lndir.man Makefile.in makeg.man makeg.sh \ makestrs.c makestrs.man mdepend.cpp mergelib.cpp \ mkdirhier.man mkdirhier.sh syminst.sh x11mf.sh \ xmkmf.cpp xmkmf.man Makefile.ini INCLUDES = ${X_CFLAGS} noinst_PROGRAMS = makestrs motif-2.3.8/config/util/syminst.sh0000755000175000017500000000241112726641672014065 00000000000000#!/bin/sh # # syminst - install with a symbolic link back to the build tree # # set DOITPROG to echo to test this script doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. lnprog="${LNPROG-ln -s}" rmprog="${RMPROG-rm}" instcmd="$lnprog" rmcmd="$rmprog -f" srcdir=`pwd`/ src="" dst="" while [ x"$1" != x ]; do case $1 in -c) shift continue;; -m) shift shift continue;; -o) shift shift continue;; -g) shift shift continue;; -s) shift continue;; -DIR) srcdir=`echo $2 | sed 's;/\./;/;g'`/ shift shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "syminst: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "syminst: no destination specified" exit 1 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` fi case $src in /*) srcdir="" instcmd=cp;; esac # get rid of the old one and mode the new one in $doit $rmcmd $dst $doit $instcmd $srcdir$src $dst exit 0 motif-2.3.8/config/Makefile.am0000644000175000017500000000006313145162623013066 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = util motif-2.3.8/ylwrap0000755000175000017500000001531213011021645011022 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2013-01-12.17; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: motif-2.3.8/install-sh0000755000175000017500000003452313011021645011567 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: motif-2.3.8/compile0000755000175000017500000001624513011021645011142 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: motif-2.3.8/BUGREPORT0000644000175000017500000000011212672140200011043 00000000000000Please submit bugs to the on-line bug database: http://bugs.motifzone.net motif-2.3.8/ac_find_xft.m40000644000175000017500000001300213066310437012270 00000000000000AC_DEFUN([AC_FIND_XFT], [ AH_TEMPLATE([HAVE_FREETYPE], [We have the FreeType library]) AH_TEMPLATE([HAVE_FONTCONFIG], [We have the fontconfig library]) AH_TEMPLATE([HAVE_XRENDER], [We have the fontconfig library]) AH_TEMPLATE([FC_DEFAULT_FONTS], [We have the fontconfig library]) AH_TEMPLATE([CONFDIR], [We have the fontconfig library]) AH_TEMPLATE([USE_XFT], [Use XFT]) AC_ARG_ENABLE(xft, [ --enable-xft Enable XFT support (font anti aliasing)],,[enable_xft=yes]) AC_ARG_WITH(freetype_includes, [ --with-freetype-includes=DIR Use FreeType includes in DIR], freetype_includes=$withval, freetype_includes=yes) AC_ARG_WITH(freetype_lib, [ --with-freetype-lib=DIR Use FreeType library in DIR], freetype_lib=$withval, freetype_lib=yes) AC_ARG_WITH(freetype_config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes) AC_ARG_WITH(default_fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], defaultfonts="$withval", default_fonts=yes) AC_ARG_WITH(fontconfig_includes, [ --with-fontconfig-includes=DIR Use Fontconfig includes in DIR], fontconfig_includes=$withval, fontconfig_includes=yes) AC_ARG_WITH(fontconfig_lib, [ --with-fontconfig-lib=DIR Use Fontconfig library in DIR], fontconfig_lib=$withval, fontconfig_lib=yes) AC_ARG_WITH(fontconfig_config, [ --with-fontconfig-config=PROG Use Fontconfig configuration program PROG], fontconfig_config=$withval, fontconfig_config=yes) if test "$enable_xft" = "yes" then # # Check freetype configuration # case "$freetype_config" in no) ;; yes) AC_CHECK_PROG(ft_config,freetype-config,freetype-config,no) ;; *) ft_config="$freetype_config" ;; esac case "$freetype_includes" in no) FREETYPE_CFLAGS="" ;; yes) case "$ft_config" in no) FREETYPE_CFLAGS="" ;; *) FREETYPE_CFLAGS="`$ft_config --cflags`" ;; esac ;; *) FREETYPE_CFLAGS="-I$freetype_includes" ;; esac case "$freetype_lib" in no) freetype_lib="" ;; yes) case "$ft_config" in no) freetype_lib="" ;; *) freetype_lib="`$ft_config --libs`" ;; esac ;; *) freetype_lib="-L$freetype_lib -lfreetype" ;; esac saved_LIBS="$LIBS" LIBS="$LIBS $freetype_lib" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" AC_CHECK_HEADERS(freetype/freetype.h) FINDXFT_HAVE_FREETYPE="no" case "$ac_cv_header_freetype_freetype_h" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) AC_CHECK_FUNCS(FT_Init_FreeType) case "$ac_cv_func_FT_Init_FreeType" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) FINDXFT_HAVE_FREETYPE="yes" AC_DEFINE(HAVE_FREETYPE, 1, Means we have discovered the FreeType library) AC_SUBST(FREETYPE_CFLAGS) ;; esac ;; esac case "$default_fonts" in yes) FC_DEFAULT_FONTS="/usr/share/fonts" AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts") ;; *) FC_DEFAULT_FONTS="$default_fonts" AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts") ;; esac AC_SUBST(FC_DEFAULT_FONTS) # # Set CONFDIR and FONTCONFIG_PATH # case "$confdir" in no|yes) confdir=/etc/fonts ;; *) ;; esac AC_SUBST(confdir) CONFDIR='${confdir}' AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR") AC_SUBST(CONFDIR) # # Check X configuration # FINDXFT_HAVE_XRENDER="no" case "$have_x" in yes) XRENDER_CFLAGS="-I$x_includes" XRENDER_LIBS="-L$x_libraries -lXft -lXrender" saved_LIBS="$LIBS" LIBS="$LIBS $XRENDER_LIBS" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS" AC_CHECK_HEADERS(X11/extensions/Xrender.h) case "$ac_cv_header_X11_extensions_Xrender_h" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) AC_CHECK_FUNCS(XRenderParseColor) case "$ac_cv_func_XRenderParseColor" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) FINDXFT_HAVE_XRENDER="yes" AC_DEFINE(HAVE_XRENDER, 1, Means we have discovered the Xrender library) AC_SUBST(XRENDER_CFLAGS) AC_SUBST(XRENDER_LIBS) ;; esac ;; esac ;; esac # # Check fontconfig configuration # case "$fontconfig_config" in no) ;; yes) AC_CHECK_PROG(fc_config,fontconfig-config,fontconfig-config,no) ;; *) fc_config="$fontconfig_config" ;; esac case "$fontconfig_includes" in no) FONTCONFIG_CFLAGS="" ;; yes) case "$fc_config" in no) FONTCONFIG_CFLAGS="`pkg-config fontconfig --cflags`" ;; *) FONTCONFIG_CFLAGS="`$fc_config --cflags`" ;; esac ;; *) FONTCONFIG_CFLAGS="-I$fontconfig_includes" ;; esac case "$fontconfig_lib" in no) fontconfig_lib="" ;; yes) case "$fc_config" in no) FONTCONFIG_LIBS="`pkg-config fontconfig --libs`" ;; *) FONTCONFIG_LIBS="`$fc_config --libs`" ;; esac ;; *) FONTCONFIG_LIBS="-L$fontconfig_lib -lfontconfig" ;; esac saved_LIBS="$LIBS" LIBS="$LIBS $FONTCONFIG_LIBS" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $FONTCONFIG_CFLAGS" AC_CHECK_HEADERS(fontconfig/fontconfig.h) case "$ac_cv_header_fontconfig_fontconfig_h" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) AC_CHECK_FUNCS(FcInit) case "$ac_cv_func_FcInit" in no) CPPFLAGS="$saved_CPPFLAGS" LIBS="$saved_LIBS" ;; yes) AC_DEFINE(HAVE_FONTCONFIG, 1, This is defined if we find the FontConfig library) AC_SUBST(FONTCONFIG_CFLAGS) AC_SUBST(FONTCONFIG_LIBS) ;; esac ;; esac dnl dnl Should this be conditionally defined ? dnl dnl if test "$FINDXFT_HAVE_XRENDER" = "yes" -a "$FINDXFT_HAVE_FREETYPE" = "yes" dnl then AC_DEFINE(USE_XFT, 1, This means we will be using the Xft library) CFLAGS="$CFLAGS `pkg-config xft --cflags`" AC_SUBST(CFLAGS) LIBS="$LIBS `pkg-config xft --libs`" AC_SUBST(LIBS) dnl fi fi ]) motif-2.3.8/demos/0000755000175000017500000000000013211513007010743 500000000000000motif-2.3.8/demos/Makefile.in0000644000175000017500000004642513211512765012755 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = lib programs unsupported doc EXTRA_DIST = all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/lib/0000755000175000017500000000000013211513007011511 500000000000000motif-2.3.8/demos/lib/Makefile.in0000644000175000017500000004642013211512765013516 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = Xmd Wsm Exm EXTRA_DIST = all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/lib/Wsm/0000755000175000017500000000000013211513007012257 500000000000000motif-2.3.8/demos/lib/Wsm/wsm_funcs.h0000644000175000017500000000643413066310437014375 00000000000000/* $XConsortium: wsm_funcs.h /main/5 1995/07/15 20:43:11 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _WSM_FUNCS_ #define _WSM_FUNCS_ /************************************************************ * * All function Prototypes for non static functions. * * Those that begin with _WSM are "private" for whatever that * is worth... * ************************************************************/ /* * disp.c */ WSMDispInfo * _WSMGetDispInfo( Display * ); WSMScreenInfo * _WSMGetScreenInfo( Display *, int ); void _WSMClearConfigScreenInfo( Display *, int ); WSMConfigFormatData * _WSMGetConfigFormat( Display *, int, WSMConfigFormatType ); Atom _WSMGetSelectionAtom( Display *, int, WSMClientType ); /* * free.c */ void FreeRequest( WSMRequest *request ); void FreeReply( WSMReply *reply ); /* * pack.c */ MessageData _WSMPackRequest( Display *, int, WSMRequest *, unsigned long *, WSMErrorCode * ); MessageData _WSMPackReply( Display *, int, WSMReply *, unsigned long * ); void _WSMUnpackRequest( Display *, int, MessageData, unsigned long, WSMRequestType, WSMRequest * ); void _WSMUnpackReply( Display *, int, MessageData, unsigned long, WSMRequestType, WSMReply * ); MessageData PackString( MessageData, String ); String UnpackString( MessageData * ); MessageData PackCARD32( MessageData, CARD32 ); CARD32 UnpackCARD32( MessageData * ); /* * recv.c */ Boolean WSMDefaultOwnSelection( Widget, WSMClientType, WSMRequestCallbackFunc, XtPointer ); void WSMRegisterRequestCallback( Display *, int, WSMRequestCallbackFunc, XtPointer ); Boolean WSMIsKnownTarget( Widget, Atom ); Atom * GetTargetList( Widget, Boolean, unsigned long * ); Boolean WSMProcessProtoTarget( Widget, Atom, XtPointer, unsigned long, int, Atom *, XtPointer *, unsigned long *, int * ); Atom * WSMGetTargetList(Widget w, Boolean include_defaults, unsigned long *len_ret); /* * send.c */ Boolean WSMSendMessage( Widget, WSMClientType, WSMRequest *, WSMReplyCallbackFunc, XtPointer ); /* * utils.c */ String _WSMReqTypeToName( WSMRequestType ); WSMRequestType _WSMTargetToReqType( Display *, Atom ); Atom _WSMReqTypeToTarget( Display *, WSMRequestType ); Boolean _WSMRequiresConfigFormat( WSMRequestType ); WSMConfigFormatType _WSMGetConfigFormatType( Window ); WSMAttribute * _WSMGetMatchingAttr( XrmQuark, WSMConfigFormatData * ); WSMWinData * _WSMGetMatchingWinData( WSMWinData *, int, XrmQuark ); #endif /* DO NOT ADD ANYTHING AFTER THIS LINE */ motif-2.3.8/demos/lib/Wsm/Makefile.in0000644000175000017500000004621513211512765014266 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/lib/Wsm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libWsm_a_AR = $(AR) $(ARFLAGS) libWsm_a_LIBADD = am_libWsm_a_OBJECTS = debug.$(OBJEXT) disp.$(OBJEXT) free.$(OBJEXT) \ pack.$(OBJEXT) recv.$(OBJEXT) send.$(OBJEXT) util.$(OBJEXT) \ utm_send.$(OBJEXT) libWsm_a_OBJECTS = $(am_libWsm_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libWsm_a_SOURCES) DIST_SOURCES = $(libWsm_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libWsm.a libWsm_a_SOURCES = debug.c disp.c free.c pack.c recv.c send.c util.c utm_send.c noinst_HEADERS = wsm_funcs.h wsm_proto.h utm_send.h INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/lib/Wsm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/lib/Wsm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libWsm.a: $(libWsm_a_OBJECTS) $(libWsm_a_DEPENDENCIES) $(EXTRA_libWsm_a_DEPENDENCIES) $(AM_V_at)-rm -f libWsm.a $(AM_V_AR)$(libWsm_a_AR) libWsm.a $(libWsm_a_OBJECTS) $(libWsm_a_LIBADD) $(AM_V_at)$(RANLIB) libWsm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utm_send.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/lib/Wsm/utm_send.c0000644000175000017500000001767712672140200014204 00000000000000/* $XConsortium: utm_send.c /main/5 1995/07/15 20:43:02 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include "utm_send.h" /* * The following keeps track of multiple utm requests and * pulls the right data off */ typedef struct _DataQueueRec { XtPointer data; struct _DataQueueRec *next, *prev; } DataQueueRec; static DataQueueRec *dataQueue, *dataQueueTail = NULL; static void EnqueueUtmData( XtPointer ); static XtPointer DequeueUtmData( void ); /*================================================================* | The following functions are used to handle selection/UTM | | requests made from the REQUESTORS side to the owner of the | | selection. | | To send a request, the only function needed is UTMSendMessage. | *================================================================*/ /*----------------------------------------------------------------* | UTMSendMessage | | Send a message with parameters. | | Arguments: | | widget - requestor. MUST have destination callback set | | to UTMDestinationProc below. | selection - selection to convert against. | | target - target to make request against. | | param - data to send to selection owner. | | param_len - length of param in fmt units. | | param_fmt - param format (should be WSM_PROTO_FMT). | | callback - function to invoke when done. | | closure - data to pass to the callback. | | time - timestamp of the event; not CurrentTime. | *----------------------------------------------------------------*/ void UTMSendMessage( Widget w, Atom selection, Atom target, XtPointer param, unsigned long paramLen, int paramFmt, XtCallbackProc doneProc, XtPointer closure, Time time) { UTMPackageRec *pUtmData; Display *dpy = XtDisplay(w); int scr = XScreenNumberOfScreen(XtScreen(w)); /* make sure timestamp is valid if (time == 0) time = GetTimestamp(dsp); */ /* allocates and builds utm package to send. */ pUtmData = (UTMPackageRec *) XtMalloc(sizeof(UTMPackageRec)); pUtmData->fmt = paramFmt; pUtmData->len = paramLen; pUtmData->target = target; pUtmData->param = param; pUtmData->doneProc = doneProc; pUtmData->closure = closure; /* * queue-up the data which is pulled off in the * UTMDestinationProc below. Note that the widget * passed in MUST have its destinationCallback set * to UTMDestionationProc! */ EnqueueUtmData(pUtmData); /* * This causes the DestinationCB to be invoked. * That is where that param data is transfered. */ if (!XmeNamedSink(w, selection, XmCOPY, NULL, /* location_data. holds param data (client data), free in TransferDone proc. */ time)) fprintf(stderr, "UTM Error: UTMSendMessage failed.\n"); } /* UTMSendMessage */ /*----------------------------------------------------------------* | UTMDestinationProc | | Invoked by UTM when a sink has been set-up and a request | | initiated against an owner of a selection. | | Arguments: w - the requestor widget | | clientData - not used. data is in the queue. | | callData - pointer to the data passed in the call | | XmeNamedSink(). This will assume that | | the structure pointed to is a UTMDataRec.| | Returns: none | | | | Comments: | | Xt's selection mechanism will not work if the same time- | | stamp is used. prevTimeStamp contains the time of the last | | conversion and if same (or greater) it is incremented. | *----------------------------------------------------------------*/ void UTMDestinationProc ( Widget w, XtPointer clientData, XtPointer callData) { static Time prevTimestamp = 0; static Time increment = 0; Time time; XmDestinationCallbackStruct *dcs = (XmDestinationCallbackStruct *)callData; UTMPackageRec *pUtmData; if (dcs == NULL) { /* bad data - just return. */ return; } /* if duplicate timestamps are used, then make sure they're different. */ if (prevTimestamp == dcs->time) { time = prevTimestamp + (++increment); } else { increment = 0; prevTimestamp = time = dcs->time; } /* pull off the real client data */ pUtmData = (UTMPackageRec *)DequeueUtmData(); /* if no UTMData, then transfer can't be done. Punt. */ if (pUtmData == NULL) return; /* Setup the parameters to pass. */ XmTransferSetParameters(dcs->transfer_id, pUtmData->param, /* ptr to parameter data. */ pUtmData->fmt, /* param format (8,16,32) */ pUtmData->len, /* size of param in fmt units */ dcs->selection); /* not used */ /* Make the transfer. This invokes the selection owner's ConvertCB. * When done, UTMReplyReceived callback proc is invoked. */ XmTransferValue(dcs->transfer_id, pUtmData->target, /* this is the target to convert against.*/ pUtmData->doneProc, /* an XtCallbackProc called when done. */ pUtmData->closure, /* client data passed to done proc */ time); /* don't need the structure any more. */ XtFree((char*)pUtmData); } /* UTMDestinationProc */ /*----------------------------------------------------------------* | EnqueueUtmData | | Puts data onto the queue between sending messages and having | | the destination callback invoked. | *----------------------------------------------------------------*/ static void EnqueueUtmData(XtPointer data) { DataQueueRec *dataRec = (DataQueueRec *)XtMalloc(sizeof(DataQueueRec)); dataRec->data = data; dataRec->next = dataQueue; dataRec->prev = NULL; if (dataQueue == NULL) dataQueueTail = dataRec; else dataQueue->prev = dataRec; dataQueue = dataRec; return; } /*----------------------------------------------------------------* | DequeueUtmData | | Retreives data from the data queue after the destination proc | | was called. Just grab the last entry in the queue. | *----------------------------------------------------------------*/ static XtPointer DequeueUtmData() { DataQueueRec *ptr = dataQueueTail; XtPointer dataPtr = NULL; if (ptr) { dataQueueTail = ptr->prev; if (ptr->prev != NULL) ptr->prev->next = NULL; else dataQueue = NULL; dataPtr = ptr->data; XtFree((char*)ptr); } else fprintf(stderr, "UTM ERROR: Data not found in queue.\n"); return (dataPtr); } motif-2.3.8/demos/lib/Wsm/recv.c0000644000175000017500000003347713066310437013332 00000000000000/* $XConsortium: recv.c /main/5 1995/07/15 20:42:50 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" #include "utm_send.h" #include #include extern Time GetTimestamp (Display *dpy); static Boolean ConvertProc( Widget, Atom *, Atom *, XtPointer, unsigned long, int, Atom *, XtPointer *, unsigned long *, int * ); /* Function Name: WSMDefaultOwnSelection * Description: This is the default routine that owns the proper * selection and the processes incomming messages * from the Wsm protocol. * Arguments: w - A widget on the screen we want to own the * WSM or WM selection for. * NOTE: THIS MUST HAVE A XmNconvertCallback RESOURCE! * client_type - The type of client we are. * request_callback - The callback call when a message * is received. * request_data - Data passed to the request callback. * Returns: True if no one currently owns the selection and I have * taken ownership. * * NOTE: The reply that is filled in by the application programmer is * passed to FreeReply, so that memory may be freed. If you * want to take advantage of this, check wsm_proto.h or free.c * to see what is freed for each type of protocol request, and * then set the reply->any.allocated field to True to activate * automatic memory freeing. */ Boolean WSMDefaultOwnSelection(Widget w, WSMClientType client_type, WSMRequestCallbackFunc request_callback, XtPointer request_data) { Time time; Display *dpy = XtDisplay(w); Atom own_selection = _WSMGetSelectionAtom(dpy, XScreenNumberOfScreen(XtScreen(w)), client_type); if (XGetSelectionOwner(dpy, own_selection) != None) { /* * Someone out there already owns this selection, we should give * up and return. */ printf("Error - Someone out there already owns this selection.\n"); return(False); } if (!XtIsRealized(w)) { fprintf(stderr, "%s must be realized, and is not.\n", "Programmer Error: Widget passed to WSMDefaultOwnSelection"); return(False); } WSMRegisterRequestCallback(dpy, XScreenNumberOfScreen(XtScreen(w)), request_callback, request_data); time = GetTimestamp(dpy); /* CurrentTime or Zero is a no-no! */ /* * NOTE - w MUST have its XmNconvertCallback set properly, * otherwise, no conversions will be handled! */ XmeNamedSource(w, own_selection, time); return(True); } /* Function Name: WSMRegisterRequestCallback * Description: Registers the callback that will be called when * a request comes in on the WSM protocol. * Arguments: disp - The display. * scr_num - The Screen number. * callback, data - The proc to register and the data * to send to it. * Returns: none. * * NOTE: The reply that is filled in by the application programmer is * passed to FreeReply, so that memory may be freed. If you * want to take advantage of this, check wsm_proto.h or free.c * to see what is freed for each type of protocol request, and * then set the reply->any.allocated field to True to activate * automatic memory freeing. */ void WSMRegisterRequestCallback(Display *disp, int scr_num, WSMRequestCallbackFunc callback, XtPointer data) { WSMScreenInfo *scr_info; scr_info = _WSMGetScreenInfo(disp, scr_num); /* * Since only one client can own a particular selection, we can hang * this data off of the screen data structure. This is necessary because * No data is passed to the ConvertProc by Xm or Xt. * * NOTE: We do not need to have room for one callback for the WSM and * one for the WM, since any given client will be one or the other, * not both. */ scr_info->request_callback = callback; scr_info->request_data = data; } /* Function Name: WSMIsKnownTarget * Description: Returns True if this target is part of the WSM protocol. * Arguments: w - Any widget on the screen of the client * we are talking to. * target - the target to check if part of the protocol. * Returns: True if this target is part of the WSM protocol. * * NOTE: This could be extended to know about extensions. */ Boolean WSMIsKnownTarget(Widget w, Atom target) { WSMDispInfo * disp_info = _WSMGetDispInfo(XtDisplay(w)); /* * Can't switch on dynamic data, sigh... */ if (disp_info->connect == target) return(True); if (disp_info->extensions == target) return(True); if (disp_info->config_fmt == target) return(True); if (disp_info->get_state == target) return(True); if (disp_info->set_state == target) return(True); if (disp_info->reg_window == target) return(True); if (disp_info->get_background == target) return(True); if (disp_info->set_background == target) return(True); if (disp_info->wm_windows == target) return(True); if (disp_info->wm_focus == target) return(True); if (disp_info->wm_pointer == target) return(True); return(False); } /* Function Name: WSMGetTargetList * Description: Returns the list of targets understood by the WSM * protocol. * Arguments: w - Any widget on the same screen as the client we * are talking to. * include_defaults - Whether or not to include the * targets TIMESTAMP, MULTIPLE, and TARGETS. * in the returned list. * RETURNED len_ret - The number of atoms returned. * Returns: The targets atom list. This list has been allocated with * XtMalloc, and must be free'd by the caller. */ Atom * WSMGetTargetList(Widget w, Boolean include_defaults, unsigned long *len_ret) { WSMDispInfo *disp_info = _WSMGetDispInfo(XtDisplay(w)); register int i; Atom *list; *len_ret = NUM_WSM_TARGETS; if (include_defaults) *len_ret += NUM_EXTRA_TARGETS; list = (Atom *) XtMalloc(sizeof(Atom) * (*len_ret)); i = 0; list[i++] = disp_info->connect; list[i++] = disp_info->extensions; list[i++] = disp_info->config_fmt; list[i++] = disp_info->get_state; list[i++] = disp_info->set_state; list[i++] = disp_info->reg_window; list[i++] = disp_info->get_background; list[i++] = disp_info->set_background; list[i++] = disp_info->wm_windows; list[i++] = disp_info->wm_focus; list[i++] = disp_info->wm_pointer; if (include_defaults) { list[i++] = disp_info->targets; list[i++] = disp_info->multiple; list[i++] = disp_info->timestamp; } return(list); } /* Function Name: WSMProcessProtoTarget * Description: Unpacks the data sent across to us that matches the * target, then calls the request_callback proceedure. * Arguments: w - Any widget that is on the same screen as the * client that we are talking to. * target - The target that defines which request this is. * input, input_len, input_fmt - The input data. * return_type - This is always set to the target IFF we * know how to process this request. * output, output_len, output_fmt - The data to send back * to the requester. * Returns: True if we know how to process this message and there * are no errors */ Boolean WSMProcessProtoTarget(Widget w, Atom target, XtPointer input, unsigned long input_len, int input_fmt, Atom *return_type, XtPointer *output, unsigned long *output_len, int *output_fmt) { Display *dpy; int scr_num; WSMScreenInfo *screen_info; WSMRequest request; WSMReply reply; /* * Check the Target to make sure it is valid. * Check the format to make sure it is WSM_PROTO_FMT. */ if (!WSMIsKnownTarget(w, target)) return(False); if (input_fmt != WSM_PROTO_FMT) { fprintf(stderr, "Format of the request must be %d\n", WSM_PROTO_FMT); return(False); } dpy = XtDisplay(w); scr_num = XScreenNumberOfScreen(XtScreen(w)); /* * Unpack up the request from the wire. */ _WSMUnpackRequest(dpy, scr_num, (MessageData) input, input_len, _WSMTargetToReqType(dpy, target), &request); /* * Call the app's callback function to process the request. */ screen_info = _WSMGetScreenInfo(dpy, scr_num); reply.any.type = request.any.type; reply.any.allocated = False; (*screen_info->request_callback)(w, screen_info->request_data, &request, &reply); /* * Pack up the reply and send it back. */ *output = (XtPointer) _WSMPackReply(dpy, scr_num, &reply, output_len); *output_fmt = WSM_PROTO_FMT; *return_type = target; /* Is this the right return type? */ FreeRequest(&request); FreeReply(&reply); return(TRUE); } /************************************************************ * * Internal routines. * ************************************************************/ #ifdef JUNK /*================================================================* | The following functions are used to handle selection/UTM | | conversion requests that are received by the selection OWNER. | *================================================================*/ /*----------------------------------------------------------------* | UTMConvertProc | | This is the UTM conversion proc called when a request comes in | | for the selection owner. | | | | NOTE - This function MUST have been set up as the callback for | | the utm widget's XmNconvertCallback procedure! | | | | Arguments: w - The widget making the request. | | clientData - not used. | | callData - the UTM convert callback structure. | *----------------------------------------------------------------*/ static void UTMConvertProc(Widget w, XtPointer clientData, XtPointer callData) { int scr = XScreenNumberOfScreen(XtScreen(w)); XmConvertCallbackStruct *ccs = (XmConvertCallbackStruct *)callData; Atom lose_sel = XInternAtom(XtDisplay(w), "_MOTIF_LOSE_SELECTION", False); WSMScreenInfo *scrInfo = _WSMGetScreenInfo(XtDisplay(w), scr); /* * Check if the callback was invoked for the right reason. * The reason field is not set to anything interresting by the transfer * code, so check the selection. */ if ((!ccs) || ((ccs->selection != scrInfo->wm_selection) && (ccs->selection != scrInfo->wsm_selection))) return; if (ccs->target == lose_sel) { /* Done with the conversion - free any data used. */ } /* * Handle a conversion request with parameter data. */ else { ConvertProc (w, &(ccs->selection), &(ccs->target), ccs->parm, ccs->parm_length, ccs->parm_format, &(ccs->type), &(ccs->value), &(ccs->length), &(ccs->format)); } } /* Function Name: ConvertProc * Description: This is the conversion proc. called when a request * comes in that we need to process. * Arguments: w - The widget that owns the selection? * selection - The selection to be converted. * target - The target to convert. * return_type - The type of the return stream. * output - The output data stream. * output_len - The length of the output stream. * output_fmt - The format of the output stream. * Returns: True if we can convert the selection, False otherwise. */ /*ARGSUSED*/ static Boolean ConvertProc(Widget w, Atom *selection, Atom *target, XtPointer input, unsigned long input_len, int input_fmt, Atom *return_type, XtPointer *output, unsigned long *output_len, int *output_fmt) { WSMDispInfo *disp_info; /* set up some defaults. selection code doesn't like garbage! */ *output = NULL; *output_len = 0; *output_fmt = 8; disp_info = _WSMGetDispInfo(XtDisplay(w)); /* * Since this function is only registered for one selection, I am going * to assume that the intrinsics didn't give me the wrong thing. */ if (*target == disp_info->targets) { *return_type = XA_STRING; *output = (XtPointer) WSMGetTargetList(w, TRUE, output_len); *output_fmt = 32; return(True); } /* * Intrinsics will handle MULTIPLE and TIMESTAMP for me. */ if (WSMProcessProtoTarget(w, *target, input, input_len, input_fmt, return_type, output, output_len, output_fmt)) { return(TRUE); } return(False); /* unknown type, returning... */ } #endif /*JUNK*/ motif-2.3.8/demos/lib/Wsm/disp.c0000644000175000017500000001772212672140200013314 00000000000000/* $XConsortium: disp.c /main/5 1995/07/15 20:42:36 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" WSMDispInfo * GDispInfo = NULL; /* Function Name: _WSMGetDispInfo * Description: Gets the display information structure associated with * the display passed into this function. * Arguments: dpy - The Display to get the info for. * Returns: a WSMDispInfo structure for the display passed. */ WSMDispInfo * _WSMGetDispInfo(Display *dpy) { WSMDispInfo * disp_info; if (GDispInfo == NULL) { disp_info = GDispInfo = (WSMDispInfo *) XtMalloc(sizeof(WSMDispInfo)); } else { disp_info = GDispInfo; while (True) { if (disp_info->disp == dpy) return(disp_info); if (disp_info->next == NULL) break; disp_info = disp_info->next; } /* * This display is not on the global list, add it. */ disp_info->next = (WSMDispInfo *) XtMalloc(sizeof(WSMDispInfo)); disp_info = disp_info->next; } disp_info->disp = dpy; /* * These are our names. * * ||| Should use XtConvertAndStore(). */ disp_info->connect = XInternAtom(dpy, WSM_NAME_CONNECT, False); disp_info->extensions = XInternAtom(dpy, WSM_NAME_EXTENSIONS, False); disp_info->config_fmt = XInternAtom(dpy, WSM_NAME_CONFIG_FMT, False); disp_info->get_state = XInternAtom(dpy, WSM_NAME_GET_STATE, False); disp_info->set_state = XInternAtom(dpy, WSM_NAME_SET_STATE, False); disp_info->reg_window = XInternAtom(dpy, WSM_NAME_REG_WINDOW, False); disp_info->get_background = XInternAtom(dpy, WSM_NAME_WM_GET_BACKGROUND_WINDOW, False); disp_info->set_background = XInternAtom(dpy, WSM_NAME_WM_SET_BACKGROUND_WINDOW, False); disp_info->wm_windows = XInternAtom(dpy, WSM_NAME_WM_WINDOWS, False); disp_info->wm_focus = XInternAtom(dpy, WSM_NAME_WM_FOCUS, False); disp_info->wm_pointer = XInternAtom(dpy, WSM_NAME_WM_POINTER, False); /* * These global resources are unlikely to change. */ disp_info->targets = XInternAtom(dpy, "TARGETS", False); disp_info->multiple = XInternAtom(dpy, "MULTIPLE", False); disp_info->timestamp = XInternAtom(dpy, "TIMESTAMP", False); disp_info->screen_info = NULL; disp_info->next = NULL; return(disp_info); } /* Function Name: _WSMGetScreenInfo * Description: Gets the screen information structure associated with * the display and screen passed into this function. * Arguments: dpy - The Display to get the info for. * screen_number - The screen number. * Returns: a WSMScreenInfo structure for the display passed. */ WSMScreenInfo * _WSMGetScreenInfo(Display *dpy, int screen_number) { WSMDispInfo * disp_info = _WSMGetDispInfo(dpy); WSMScreenInfo *screen_info; char temp[BUFSIZ]; if (disp_info->screen_info == NULL) { /* * Didn't find any screen info on this display, allocate it * and then drop down to the code below that fills in the data. */ screen_info = (WSMScreenInfo *) XtMalloc(sizeof(WSMScreenInfo)); disp_info->screen_info = screen_info; } else { screen_info = disp_info->screen_info; /* * Hunt through the screen info structs on this display until we * find one that matches the screen num passed. If we don't find * one then allocate a new one, put it on the end of the list and * drop into the code below that fills in the data. */ while (True) { if (screen_info->screen_num == screen_number) return(screen_info); if (screen_info->next == NULL) break; screen_info = screen_info->next; } /* * This screen is not on the display's screen list, add it. */ screen_info->next = (WSMScreenInfo *) XtMalloc(sizeof(WSMScreenInfo)); screen_info = screen_info->next; } screen_info->screen_num = screen_number; sprintf(temp, WM_SELECTION_FORMAT, screen_number); screen_info->wm_selection = XInternAtom(dpy, temp, False); sprintf(temp, WSM_SELECTION_FORMAT, screen_number); screen_info->wsm_selection = XInternAtom(dpy, temp, False); screen_info->next = NULL; screen_info->global.num_attrs = 0; screen_info->window.num_attrs = 0; screen_info->icon.num_attrs = 0; screen_info->request_callback = NULL; screen_info->request_data = NULL; return(screen_info); } /* Function Name: _WSMClearConfigScreenInfo * Description: Resets the screen information structure associated with * the display and screen passed into this function. * Arguments: dpy - The Display to get the info for. * screen_number - The screen number. * Returns: */ void _WSMClearConfigScreenInfo(Display *dpy, int screen_number) { WSMDispInfo * disp_info = _WSMGetDispInfo(dpy); WSMScreenInfo *screen_info; char temp[BUFSIZ]; if (disp_info->screen_info != NULL) { screen_info = disp_info->screen_info; /* * Hunt through the screen info structs on this display until we * find one that matches the screen num passed. */ while (True) { if (screen_info->screen_num == screen_number) break; if (screen_info->next == NULL) return; screen_info = screen_info->next; } if (screen_info->global.num_attrs != 0){ XtFree((XtPointer)screen_info->global.attr_list); screen_info->global.num_attrs = 0; } if (screen_info->window.num_attrs != 0){ XtFree((XtPointer)screen_info->window.attr_list); screen_info->window.num_attrs = 0; } if (screen_info->icon.num_attrs != 0){ XtFree((XtPointer)screen_info->icon.attr_list); screen_info->icon.num_attrs = 0; } } } /* Function Name: _WSMGetConfigFormat * Description: Gets the Configuration format for the dpy, scr and * type specified. * Arguments: dpy - The display. * screen_number - The screen number. * type - The type of format required. * Returns: A pointer to the config format, or NULL if none was * found. */ WSMConfigFormatData * _WSMGetConfigFormat(Display *dpy, int screen_number, WSMConfigFormatType type) { WSMScreenInfo *screen_info = _WSMGetScreenInfo(dpy, screen_number); if (screen_info == NULL) return(NULL); switch(type) { case WSM_GLOBAL_FMT: return(&(screen_info->global)); case WSM_WINDOW_FMT: return(&(screen_info->window)); case WSM_ICON_FMT: return(&(screen_info->icon)); default: break; } return(NULL); } /* Function Name: _WSMGetSelectionAtom * Description: Gets the Selection atom for the manager that we want to * send to. * Arguments: dpy - The display. * screen_number - The screen number. * send_to - Whether to send this to the WM or WSM. * Returns: A pointer to the config format, or NULL if none was * found. */ Atom _WSMGetSelectionAtom(Display *dpy, int screen_num, WSMClientType send_to) { WSMScreenInfo *screen_info = _WSMGetScreenInfo(dpy, screen_num); if (screen_info == NULL) return(None); switch(send_to) { case WSM_WORKSPACE_MANAGER: return(screen_info->wsm_selection); case WSM_WINDOW_MANAGER: return(screen_info->wm_selection); default: break; } return(None); } motif-2.3.8/demos/lib/Wsm/send.c0000644000175000017500000002206013066310437013306 00000000000000/* $XConsortium: send.c /main/5 1995/07/15 20:42:54 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include "wsm_proto.h" #include "utm_send.h" extern Time GetTimestamp (Display *dpy); typedef struct _RequestInfo { WSMReplyCallbackFunc reply_callback; /* The reply callback func */ XtPointer reply_data; /* The user data for the callback func */ WSMRequestType request_type; /* The kind of request for cross check. */ Atom send_atom; /* The atom that we sent this message to. */ } RequestInfo; static void UTMReplyReceived( Widget, XtPointer, XtPointer ); static void ReplyReceived( Widget, XtPointer, Atom *, Atom *, XtPointer, unsigned long *, int * ); static UTMPackageRec *_WSMBuildUtmPackage( Atom, int, unsigned long, XtPointer, XtPointer ); /* Function Name: WSMSendMessage * Description: Sends a message to WSM or WM on the screen * and display specified. * Arguments: w - any widget on this display and screen that * also has destination callback. * Note - This widget MUST have the destination * callback set to UTMDestinationProc that * is defined in utm_send.c. * send_to - either WSMWorkspaceManager or WSMWindowManager * request - the request to send. * reply_callback - The routine to call when the * reply comes in. * reply_data - Client data passed to the reply_callback. * Returns: True if an attempt is made to retrieve the selection, * False if an obvious error occured. * * NOTE: Reply callback will be called with reply == NULL if unable * to convert request. */ Boolean WSMSendMessage(Widget w, WSMClientType send_to, WSMRequest *request, WSMReplyCallbackFunc reply_callback, XtPointer reply_data) { int screen_num = XScreenNumberOfScreen(XtScreen(w)); Display *dpy = XtDisplay(w); Atom send_atom = _WSMGetSelectionAtom(dpy, screen_num, send_to); MessageData msg_data; unsigned long msg_len; RequestInfo *req_info; WSMErrorCode error; UTMPackageRec *pUtmData; Time time = GetTimestamp(dpy); /* 0 or CurrentTime not allowed. */ if (send_atom == None) { fprintf(stderr, "%s: Could not get selection atom to send message\n", "Internal Error"); return(False); } /* * Package human-readable request data into protocol package. */ msg_data = _WSMPackRequest(dpy, screen_num, request, &msg_len, &error); if (msg_data == NULL) { (*reply_callback)(w, reply_data, NULL, error); return(False); } req_info = (RequestInfo *) XtMalloc(sizeof(RequestInfo)); req_info->reply_callback = reply_callback; /* The reply callback func */ req_info->reply_data = reply_data; /* user data for the callback func */ req_info->request_type = request->any.type;/*request kind for cross check*/ req_info->send_atom = send_atom; /* Atom we sent this message to. */ if (!XtIsRealized(w)) { fprintf(stderr, "%s WSMSendMessage must be realized, and is not.\n", "Programmer Error: Widget passed to"); return(False); } UTMSendMessage(w, send_atom, _WSMReqTypeToTarget(dpy, request->any.type), (XtPointer) msg_data, msg_len, WSM_PROTO_FMT, UTMReplyReceived, req_info, time); return(True); } /************************************************************ * * Internal Routines. * ************************************************************/ /* Function Name: UTMReplyReceived * Description: Called after the selection owner's convert proc * has finished. * Arguments: w - The widget who initiated the request. * clientData - * callData - * Returns: none */ static void UTMReplyReceived(Widget w, XtPointer clientData, XtPointer callData) { XmSelectionCallbackStruct *scs = (XmSelectionCallbackStruct *) callData; RequestInfo *req_info = (RequestInfo *) clientData; Boolean errorFound = False; Atom type = _WSMReqTypeToTarget(XtDisplay(w), req_info->request_type); /* Let's check some other values just to make sure things are ok. */ if (scs->reason != XmCR_OK) { fprintf(stderr, "ERROR: Bad reason value received in UTMReplyReceived.\n"); errorFound = True; } if (scs->type == XT_CONVERT_FAIL) { fprintf(stderr, "ERROR: Convert failure detected in UTMReplyReceived.\n"); errorFound = True; } if (scs->flags != XmSELECTION_DEFAULT) { fprintf(stderr, "ERROR: Bad flags value received in UTMReplyReceived.\n"); errorFound = True; } if (errorFound) return; ReplyReceived(w, req_info, /* the request info pointer to fill in. */ &scs->selection, &type, /* type of request that was made. */ scs->value, /* data returned from conversion. */ &scs->length, &scs->format); } /* Function Name: ReplyReceived * Description: Called when a reply is received from a request * initiated by a WSMSendMessage. * Arguments: w - The widget who initiated the request. * req_info_ptr - pointer to the request info. * selection - The selection that has been converted. * req_type_atom - The type of request that was made. * length - the amount of message data. * format - the format of the reply. * Returns: none */ static void ReplyReceived(Widget w, XtPointer req_info_ptr, Atom *selection, Atom *req_type_atom, XtPointer value, unsigned long *length, int *format) { RequestInfo *req_info = (RequestInfo *) req_info_ptr; WSMReply reply; Display *dpy = XtDisplay(w); int screen_num; WSMErrorCode fail_code = WSM_SUCCESS; /* * First a few checks to make sure everything is as we expect. */ if (*selection != req_info->send_atom) { fprintf(stderr, "%s, request %d - reply %d\n", "Selection of the reply is not the same as the request", (int) req_info->send_atom, (int) *selection); fail_code = WSM_ERROR_INTERNAL; } if (*req_type_atom != _WSMReqTypeToTarget(dpy, req_info->request_type)) { if (*req_type_atom == None) { if (XGetSelectionOwner(dpy, *selection) == None) { fail_code = WSM_ERROR_NO_SEL_OWNER; printf("No owner for selection #%d\n", (int)*selection); } else fail_code = WSM_ERROR_CONVERSION_FAILED; } else if (*req_type_atom == XT_CONVERT_FAIL) fail_code = WSM_ERROR_TIMEOUT; else { fprintf(stderr, "%s, request %s - reply %d:%s\n", "Target of the reply is not the same as the request", _WSMReqTypeToName(req_info->request_type), (int) *req_type_atom, _WSMReqTypeToName(_WSMTargetToReqType(dpy, *req_type_atom))); fail_code = WSM_ERROR_INTERNAL; } } if (*format != WSM_PROTO_FMT) { fprintf(stderr, "%s, request %d - reply %d\n", "Format of the reply is not the same as the request", (int) WSM_PROTO_FMT, (int) *format); fail_code = WSM_ERROR_INTERNAL; } if (fail_code != WSM_SUCCESS) { /* * Failure, call callback with NULL reply. */ (*req_info->reply_callback)(w, req_info->reply_data, NULL, fail_code); } else { screen_num = XScreenNumberOfScreen(XtScreen(w)); _WSMUnpackReply(dpy, screen_num, value, *length, req_info->request_type, &reply); (*req_info->reply_callback)(w, req_info->reply_data, &reply,fail_code); FreeReply(&reply); } XtFree((XtPointer) req_info_ptr); } /* Function Name: * Description: * Arguments: target - target to make request against. this is the * same as the request type. * fmt - format of param data (should be WSM_PROTO_FMT). * len - length of param in fmt units. * param - parameter data to send to selection owner. * Returns: The UTM data package. */ static UTMPackageRec * _WSMBuildUtmPackage( Atom target, int fmt, unsigned long len, XtPointer param, XtPointer closure) { UTMPackageRec *pUtmData; pUtmData = (UTMPackageRec *) XtMalloc(sizeof(UTMPackageRec)); pUtmData->fmt = fmt; pUtmData->len = len; pUtmData->target = target; pUtmData->param = param; pUtmData->closure = closure; return(pUtmData); } motif-2.3.8/demos/lib/Wsm/free.c0000644000175000017500000001014212672140200013263 00000000000000/* $XConsortium: free.c /main/5 1995/07/15 20:42:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" #include static void FreeWinData( WSMWinData *data, int num ); /* Function Name: FreeRequest * Description: Frees data in the request that has been allocated. * Arguments: request - the request. * Returns: none. */ void FreeRequest(WSMRequest *request) { register int i; if (!request->any.allocated) return; /* Nothing to free. */ switch(request->any.type) { case WSM_CONNECT: XtFree((XtPointer) request->connect.known_versions); break; case WSM_EXTENSIONS: { register int num = request->extensions.num_extensions; register String *ptr; num = request->extensions.num_extensions; ptr = request->extensions.extension_suggestions; for (i = 0; i < num; i++, ptr++) XtFree((XtPointer) *ptr); XtFree((XtPointer) request->extensions.extension_suggestions); } break; case WSM_SET_STATE: { register int num = request->set_state.num_win_info_list; WSMWinInfo *win_info = request->set_state.win_info_list; for (i = 0; i < num; i++, win_info++) FreeWinData(win_info->data_list, win_info->num_data_list); XtFree((XtPointer) request->set_state.win_info_list); } break; default: break; } } /* Function Name: FreeRequest * Description: Frees data in the request that has been allocated. * Arguments: reply - the reply. * Returns: none. */ void FreeReply(WSMReply *reply) { register int i; if (!reply->any.allocated) return; /* Nothing to free. */ switch(reply->any.type) { case WSM_EXTENSIONS: { register int num = reply->extensions.num_extensions; register String *ptr; num = reply->extensions.num_extensions; ptr = reply->extensions.extensions; for (i = 0; i < num; i++, ptr++) XtFree((XtPointer) *ptr); XtFree((XtPointer) reply->extensions.extensions); } break; case WSM_GET_STATE: { WSMWinInfo *win_info = reply->get_state.win_info_list; register int num = reply->get_state.num_win_info_list; for (i = 0; i < num; i++, win_info++) FreeWinData(win_info->data_list, win_info->num_data_list); XtFree((XtPointer) reply->get_state.win_info_list); } break; case WSM_REG_WINDOW: FreeWinData(reply->register_window.window_data, reply->register_window.num_window_data); break; default: break; } } /************************************************************ * * Internal routines * ************************************************************/ /* Function Name: FreeWinData * Description: Frees the data associated with this window. * Arguments: data - The data to free. * num - number of elements in data. * Returns: none. */ static void FreeWinData(WSMWinData *data, int num) { register int i; WSMWinData *top = data; for (i = 0; i < num; i++, data++) { switch (data->type) { case WSM_CHAR_LIST_DATA: XtFree((XtPointer) data->data.char_ptr); break; case WSM_SHORT_LIST_DATA: XtFree((XtPointer) data->data.short_ptr); break; case WSM_LONG_LIST_DATA: XtFree((XtPointer) data->data.long_ptr); break; default: break; } } XtFree((XtPointer) top); } motif-2.3.8/demos/lib/Wsm/wsm_proto.h0000644000175000017500000003262312672140200014410 00000000000000/* $XConsortium: wsm_proto.h /main/5 1995/07/15 20:43:15 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _WSM_PROTO_ #define _WSM_PROTO_ #include #include #include #include #define WSM_PROTO_FMT 8 /************************************************************ * * Defines * ************************************************************/ #define WSM_NAME_CONNECT "_MOTIF_WSM_CONNECT" #define WSM_NAME_EXTENSIONS "_MOTIF_WM_EXTENSIONS" #define WSM_NAME_CONFIG_FMT "_MOTIF_WM_CONFIG_FORMAT" #define WSM_NAME_GET_STATE "_MOTIF_WSM_GET_STATE" #define WSM_NAME_SET_STATE "_MOTIF_WSM_SET_STATE" #define WSM_NAME_REG_WINDOW "_MOTIF_WSM_REGISTER_WINDOW" #define WSM_NAME_WM_GET_BACKGROUND_WINDOW "_MOTIF_WSM_GET_BACKGROUND_WINDOW" #define WSM_NAME_WM_SET_BACKGROUND_WINDOW "_MOTIF_WSM_SET_BACKGROUND_WINDOW" #define WSM_NAME_WM_WINDOWS "_MOTIF_WSM_WM_WINDOWS" #define WSM_NAME_WM_FOCUS "_MOTIF_WSM_WM_FOCUS" #define WSM_NAME_WM_POINTER "_MOTIF_WSM_WM_POINTER" #define NUM_EXTRA_TARGETS 3 #define NUM_WSM_TARGETS 11 #define WM_SELECTION_FORMAT "WM_S%d" #define WSM_SELECTION_FORMAT "WSM_S%d" #define WIN_MASK 0x1FFFFFFF /************************************************************ * * New enumerated types. * ************************************************************/ typedef enum {WSM_CONNECT, WSM_EXTENSIONS, WSM_CONFIG_FMT, WSM_GET_STATE, WSM_SET_STATE, WSM_REG_WINDOW, WSM_WM_GET_BACKGROUND_WINDOW, WSM_WM_SET_BACKGROUND_WINDOW, WSM_WM_WINDOWS, WSM_WM_FOCUS, WSM_WM_POINTER, WSM_UNKNOWN} WSMRequestType; typedef enum {WSM_WORKSPACE_MANAGER, WSM_WINDOW_MANAGER} WSMClientType; typedef enum {WSM_GLOBAL_FMT = 0, WSM_WINDOW_FMT = 1, WSM_ICON_FMT = 2} WSMConfigFormatType; typedef enum {WSM_VALUE_DATA, WSM_CHAR_LIST_DATA, WSM_SHORT_LIST_DATA, WSM_LONG_LIST_DATA, WSM_NONE} WSMDataType; typedef enum {WSM_SUCCESS, WSM_ERROR_INTERNAL, WSM_ERROR_CONVERSION_FAILED, WSM_ERROR_NO_SEL_OWNER, WSM_ERROR_TIMEOUT, WSM_ERROR_NO_CONFIG_FORMAT, WSM_ERROR_ALREADY_HAVE_CONFIG_FORMAT } WSMErrorCode; typedef enum {WSM_CLIENT_WINDOW, WSM_CLIENT_FRAME, WSM_ICON_FRAME} WSMLocationFlag; typedef XtPointer MessageData; /************************************************************ * * Global structures that are used by calling routines. * ************************************************************/ typedef union _WSMData { long value; char * char_ptr; short * short_ptr; long * long_ptr; } WSMData; typedef struct _WSMAttribute { XrmQuark nameq; /* Name of this attribute, quarkified. */ int size; /* The size of this attribute. */ Boolean is_list; /* True if this attribute is a list. */ } WSMAttribute; typedef struct _WSMConfigFormatData { WSMAttribute *attr_list; int num_attrs; } WSMConfigFormatData; typedef struct _WSMWinData { XrmQuark nameq; /* Name of this data entry, quarkified. */ WSMDataType type; /* The type of data stored in data. */ WSMData data; /* The data associated with this data entry. */ int data_len; /* if a list, then the size. */ } WSMWinData; typedef struct _WSMWinInfo { Window window; WSMWinData * data_list; int num_data_list; } WSMWinInfo; typedef Atom WindowProperty; typedef struct _WSMWinEntry { Window *windows; /* one for each location flag set. */ int num_windows; WindowProperty *match_properties; /* properties the window matched. */ int num_match_properties; } WSMWinEntry; typedef struct _AttributePair { WindowProperty *allowed_attributes; WindowProperty *prohibited_attributes; int num_attributes; } AttributePair; /************************************************************ * * Structures for sending a message for each type of event * ************************************************************/ typedef struct _WSMAnyRequestOrReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ } WSMAnyRequestOrReply; typedef struct _WSMConnect { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the known_versions ptr. */ Boolean allocated; short * known_versions; int num_versions; } WSMConnect; typedef struct _WSMExtensions { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free each string on the extension_suggestions list * as well as the extension_suggestions ptr itself. */ Boolean allocated; String *extension_suggestions; int num_extensions; } WSMExtensions; typedef WSMAnyRequestOrReply WSMConfigFormat; typedef struct _WSMGetState { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ Window window; Boolean diffs_allowed; } WSMGetState; typedef struct _WSMSetState { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the win_data list in each element on the * win_info_list. as well as the win_info_list ptr itself. */ Boolean allocated; WSMWinInfo *win_info_list; int num_win_info_list; } WSMSetState; typedef struct _WSMRegisterWindow { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ Window window; } WSMRegisterWindow; typedef struct _WSMWmGetBackgroundWindow { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; int screen; } WSMWmGetBackgroundWindow; typedef struct _WSMWmSetBackgroundWindow { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmSetBackgroundWindow; typedef struct _WSMWmWindows { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; CARD32 location_flag; WindowProperty *window_properties; int num_window_properties; AttributePair **match_attributes; int num_match_attributes; } WSMWmWindows; typedef WSMAnyRequestOrReply WSMWmFocus; typedef WSMAnyRequestOrReply WSMWmPointer; typedef union _WSMRequest { WSMAnyRequestOrReply any; WSMConnect connect; WSMExtensions extensions; WSMConfigFormat config_format; WSMGetState get_state; WSMSetState set_state; WSMRegisterWindow register_window; WSMWmGetBackgroundWindow get_background; WSMWmSetBackgroundWindow set_background; WSMWmWindows wm_windows; WSMWmFocus wm_focus; WSMWmPointer wm_pointer; } WSMRequest; /************************************************************ * * Structures for recieving a reply message for each type of event. * ************************************************************/ typedef struct _WSMConnectReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ short version; } WSMConnectReply; typedef struct _WSMExtensionsReply { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free each string on the extensions list * as well as the extensions ptr itself. */ Boolean allocated; String *extensions; int num_extensions; } WSMExtensionsReply; typedef struct _WSMConfigFormatReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; /* Packlib allocated the data, do not move. */ Boolean accepts_diffs; WSMAttribute * global_formats; int num_global_formats; WSMAttribute * window_formats; int num_window_formats; WSMAttribute * icon_formats; int num_icon_formats; } WSMConfigFormatReply; typedef struct _WSMGetStateReply { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the win_data list in each element on the * win_info_list. as well as the win_info_list ptr itself. */ Boolean allocated; WSMWinInfo *win_info_list; int num_win_info_list; } WSMGetStateReply; typedef WSMAnyRequestOrReply WSMSetStateReply; typedef struct _WSMRegisterWindowReply { WSMRequestType type; /* Type of event, do not move or change. */ /* * Packlib allocated the data, do not move. * If True will free the window_data pointer. */ Boolean allocated; WSMWinData * window_data; int num_window_data; } WSMRegisterWindowReply; typedef struct _WSMWmGetBackgroundWindowReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmGetBackgroundWindowReply; typedef struct _WSMWmSetBackgroundWindowReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmSetBackgroundWindowReply; typedef struct _WSMWmWindowsReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; WSMWinEntry *win_entry_list; int num_win_entry_list; } WSMWmWindowsReply; typedef struct _WSMWmFocusReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; } WSMWmFocusReply; typedef struct _WSMWmPointerReply { WSMRequestType type; /* Type of event, do not move or change. */ Boolean allocated; Window window; CARD32 location_flag; /* client, frame, icon. */ } WSMWmPointerReply; typedef union _WSMReply { WSMAnyRequestOrReply any; WSMConnectReply connect; WSMExtensionsReply extensions; WSMConfigFormatReply config_format; WSMGetStateReply get_state; WSMSetStateReply set_state; WSMRegisterWindowReply register_window; WSMWmGetBackgroundWindowReply get_background; WSMWmSetBackgroundWindowReply set_background; WSMWmWindowsReply wm_windows; WSMWmFocusReply wm_focus; WSMWmPointerReply wm_pointer; } WSMReply; /************************************************************ * * New function types. * ************************************************************/ typedef void (*WSMReplyCallbackFunc)( Widget, /* A Widget on the same screen as the */ /* client that we are talking to. */ XtPointer, /* The user data. */ WSMReply *, /* The reply structure. */ WSMErrorCode /* The error code, or WSM_SUCCESS. */ ); typedef void (*WSMRequestCallbackFunc) ( Widget, /* A Widget on the same screen as the */ /* client that we are talking to. */ XtPointer, /* The user data. */ WSMRequest *, /* The request made of us. */ WSMReply * /* A reply structure that the user should */ /* fill in with the reply to send back. */ ); /************************************************************ * * These depend on lots of stuff above, and must go last. * ************************************************************/ /* * There is an assumption that there is only one WM and WSM per screen * and therefore the config_data can be stored in the screen info. * This seems pretty safe. */ typedef struct _WSMScreenInfo { int screen_num; Atom wsm_selection; Atom wm_selection; WSMConfigFormatData global; WSMConfigFormatData window; WSMConfigFormatData icon; WSMRequestCallbackFunc request_callback; XtPointer request_data; struct _WSMScreenInfo *next; } WSMScreenInfo; typedef struct _WSMDispInfo { Display *disp; Atom connect; Atom extensions; Atom config_fmt; Atom get_state; Atom set_state; Atom reg_window; Atom get_background; Atom set_background; Atom wm_windows; Atom wm_focus; Atom wm_pointer; Atom targets, multiple, timestamp; /* Required default targets. */ WSMScreenInfo *screen_info; struct _WSMDispInfo *next; } WSMDispInfo; #include "wsm_funcs.h" #endif /* _WSM_PROTO_ --- Do not add anything after this line. */ motif-2.3.8/demos/lib/Wsm/debug.c0000644000175000017500000002211613066310437013445 00000000000000/* $XConsortium: debug.c /main/5 1995/07/15 20:42:32 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" static void PrintWindowInfo( String, WSMWinInfo * ); static void PrintWindowData( String, String, WSMWinData * ); static void PrintConfigFormat( String, WSMConfigFormatReply * ); #define STRSIZE (BUFSIZ * 10) /************************************************************ * * This file contains routines to ease in debugging. * ************************************************************/ /* Function Name: PrintRequest * Description: Prints out a request in human readable form. * Arguments: request - The request to print. * Returns: str - The string the request is printed to. */ String PrintRequest(WSMRequest *request) { static char str[STRSIZE]; /* The vile hacks we do in debugging code. */ String ptr; register int i; sprintf(str, "Request: %s\n", _WSMReqTypeToName(request->any.type)); ptr = str + strlen(str); switch (request->any.type) { case WSM_CONNECT: sprintf(ptr, "Number of Versions: %d\nVersions: ", request->connect.num_versions); for (i = 0; i < request->connect.num_versions; i++) { ptr += strlen(ptr); sprintf(ptr, "%d", (int) request->connect.known_versions[i]); if ((i + 1) < request->connect.num_versions) strcat(ptr, ", "); } strcat(ptr, "\n"); break; case WSM_EXTENSIONS: sprintf(ptr, "Number of Extension Suggestions: %d\n%s", request->extensions.num_extensions, "Extension Suggestions:\n "); for (i = 0; i < request->extensions.num_extensions; i++) { ptr += strlen(ptr); strcat(ptr, request->extensions.extension_suggestions[i]); if ((i + 1) < request->extensions.num_extensions) strcat(ptr, ", "); } strcat(ptr, "\n"); break; case WSM_CONFIG_FMT: sprintf(ptr, "No other data for this request.\n"); break; case WSM_GET_STATE: sprintf(ptr, "Window: 0x%X\nDiffs Allowed: %s\n", (unsigned)request->get_state.window, request->get_state.diffs_allowed ? "True" : "False"); break; case WSM_SET_STATE: sprintf(ptr, "Number of Windows with Info: %d\n", request->set_state.num_win_info_list); for (i = 0; i < request->set_state.num_win_info_list; i++) { ptr += strlen(ptr); PrintWindowInfo(ptr, request->set_state.win_info_list + i); } break; case WSM_REG_WINDOW: sprintf(ptr, "Window: 0x%X\n", (unsigned)request->register_window.window); break; case WSM_WM_GET_BACKGROUND_WINDOW: case WSM_WM_SET_BACKGROUND_WINDOW: case WSM_WM_WINDOWS: case WSM_WM_FOCUS: case WSM_WM_POINTER: case WSM_UNKNOWN: /* Not handled cases */ break; } return(str); } /* Function Name: PrintReply * Description: Prints out a reply in human readable form. * Arguments: reply - The reply to print. * Returns: str - The string the reply is printed to. */ String PrintReply(WSMReply *reply) { static char str[STRSIZE]; /* The vile hacks we do in debugging code. */ register int i; String ptr; sprintf(str, "Reply: %s\n", _WSMReqTypeToName(reply->any.type)); ptr = str + strlen(str); switch (reply->any.type) { case WSM_CONNECT: sprintf(ptr, "Version: %d\n", (int) reply->connect.version); break; case WSM_EXTENSIONS: sprintf(ptr, "Number of Extensions: %d\n%s", reply->extensions.num_extensions, "Extensions:\n "); for (i = 0; i < reply->extensions.num_extensions; i++) { ptr += strlen(ptr); strcat(ptr, reply->extensions.extensions[i]); if ((i + 1) < reply->extensions.num_extensions) strcat(ptr, ", "); } strcat(ptr, "\n"); break; case WSM_CONFIG_FMT: PrintConfigFormat(ptr, &(reply->config_format)); break; case WSM_GET_STATE: sprintf(ptr, "Number of Windows with Info: %d\n", reply->get_state.num_win_info_list); for (i = 0; i < reply->get_state.num_win_info_list; i++) { ptr += strlen(ptr); PrintWindowInfo(ptr, reply->get_state.win_info_list + i); } break; case WSM_SET_STATE: sprintf(ptr, "No other data for this reply.\n"); break; case WSM_REG_WINDOW: { int num = reply->register_window.num_window_data; WSMWinData *win_data = reply->register_window.window_data; sprintf(ptr, "Number of Data Attributes: %d\n", num); for (i = 0; i < num; i++, win_data++) { ptr += strlen(ptr); PrintWindowData(ptr, "", win_data); } } break; case WSM_WM_GET_BACKGROUND_WINDOW: case WSM_WM_SET_BACKGROUND_WINDOW: case WSM_WM_WINDOWS: case WSM_WM_FOCUS: case WSM_WM_POINTER: case WSM_UNKNOWN: /* Not handled cases */ break; } return(str); } /************************************************************ * * Internal Routines. * ************************************************************/ /* Function Name: PrintWindowInfo * Description: Prints the info about a single window. * Arguments: str - String to stuff it into. * win_info - The window info to print. * Returns: none. */ static void PrintWindowInfo( String str, WSMWinInfo *win_info) { register int i; int num = win_info->num_data_list; WSMWinData *win_data = win_info->data_list; sprintf(str, "Window: 0x%X\nNumber of Data Attributes: %d\n", (unsigned)win_info->window, num); for (i = 0; i < num; i++, win_data++) { str += strlen(str); PrintWindowData(str, " ", win_data); } } /* Function Name: PrintWindowData * Description: Prints the data about a single window. * Arguments: str - String to stuff it into. * win_data - The window data to print. * Returns: none. */ static void PrintWindowData( String str, String tab_str, WSMWinData *win_data) { register int i; char *type_str = NULL; if (win_data->type == WSM_VALUE_DATA) { sprintf(str, "%sName: %s, Type: Value, Value: %ld\n", tab_str, XrmQuarkToString(win_data->nameq), win_data->data.value); return; } switch(win_data->type) { case WSM_CHAR_LIST_DATA: type_str = "Char List"; break; case WSM_SHORT_LIST_DATA: type_str = "Short List"; break; case WSM_LONG_LIST_DATA: type_str = "Long List"; break; case WSM_VALUE_DATA: case WSM_NONE: /* Not handled cases */ break; } sprintf(str, "%sName: %s, Type: %s, Len: %d\n%s%s", tab_str, XrmQuarkToString(win_data->nameq), type_str, win_data->data_len, tab_str, " "); for (i = 0; i < win_data->data_len; i++) { str += strlen(str); switch(win_data->type) { case WSM_CHAR_LIST_DATA: sprintf(str, "%c(%d)", win_data->data.char_ptr[i], (int) win_data->data.char_ptr[i]); break; case WSM_SHORT_LIST_DATA: sprintf(str, "%d", (int) win_data->data.short_ptr[i]); break; case WSM_LONG_LIST_DATA: sprintf(str, "%ld", win_data->data.long_ptr[i]); break; case WSM_VALUE_DATA: case WSM_NONE: /* Not handled cases */ break; } if (i < (win_data->data_len - 1)) strcat(str, ", "); } strcat(str, "\n"); } /* Function Name: PrintConfigFormat * Description: Prints the configuration format. * Arguments: str - The string to print the conf info into. * config_fmt - The configuration format reply. * Returns: none */ static void PrintConfigFormat( String str, WSMConfigFormatReply *config_fmt) { register int i; sprintf("Accepts Diffs: %s\n", (config_fmt->accepts_diffs ? "True" : "False")); for (i = 0; i < 3; i++) { WSMAttribute *fmt; register int j, num; str += strlen(str); switch (i) { case WSM_GLOBAL_FMT: fmt = config_fmt->global_formats; num = config_fmt->num_global_formats; sprintf(str, "Global Formats - Number: %d\n", num); break; case WSM_WINDOW_FMT: fmt = config_fmt->window_formats; num = config_fmt->num_window_formats; sprintf(str, "Window Formats - Number: %d\n", num); break; case WSM_ICON_FMT: fmt = config_fmt->icon_formats; num = config_fmt->num_icon_formats; sprintf(str, "Icon Formats - Number: %d\n", num); break; } for (j = 0; j < num; j++) { str += strlen(str); sprintf(str, " Name: %s, Size: %d, Is_List: %s\n", XrmQuarkToString(fmt[j].nameq), (int) fmt[j].size, fmt[j].is_list ? "True" : "False"); } } } motif-2.3.8/demos/lib/Wsm/util.c0000644000175000017500000001332212672140200013322 00000000000000/* $XConsortium: util.c /main/5 1995/07/15 20:42:58 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" /************************************************************ * * Routines for converting from targets to names to atoms. * ************************************************************/ /* Function Name: _WSMReqTypeToName * Description: Given a request type, return its name, used mostly * for error messages. * Arguments: req_type - The request type to check. * Returns: a string that is the name of the request. */ String _WSMReqTypeToName(WSMRequestType req_type) { switch (req_type) { case WSM_CONNECT: return("Connect"); case WSM_EXTENSIONS: return("Extensions"); case WSM_CONFIG_FMT: return("Config Format"); case WSM_GET_STATE: return("Get State"); case WSM_SET_STATE: return("Set State"); case WSM_REG_WINDOW: return("Register Window"); default: return("unknown"); } } /* Function Name: _WSMTargetToReqType * Description: Given a target (Atom) and a display, returns the * request type associated with this atom. * Arguments: dpy - The display. * target - The atom that needs to be mapped to a request. * Returns: The request type. */ WSMRequestType _WSMTargetToReqType(Display *dpy, Atom target) { WSMDispInfo *disp_atoms = _WSMGetDispInfo(dpy); if (target == disp_atoms->connect) return(WSM_CONNECT); if (target == disp_atoms->extensions) return(WSM_EXTENSIONS); if (target == disp_atoms->config_fmt) return(WSM_CONFIG_FMT); if (target == disp_atoms->get_state) return(WSM_GET_STATE); if (target == disp_atoms->set_state) return(WSM_SET_STATE); if (target == disp_atoms->reg_window) return(WSM_REG_WINDOW); /* * Atom doesn't match any request, generate error message. */ return(WSM_UNKNOWN); } /* Function Name: _WSMReqTypeToTarget * Description: Given a request type and a display, return the target * (Atom) that maps to it. * Arguments: dpy - The display. * req_type - The request type id. * Returns: The atom that maps to this request type on this display. */ Atom _WSMReqTypeToTarget(Display *dpy, WSMRequestType req_type) { WSMDispInfo *disp_atoms = _WSMGetDispInfo(dpy); switch (req_type) { case WSM_CONNECT: return(disp_atoms->connect); case WSM_EXTENSIONS: return(disp_atoms->extensions); case WSM_CONFIG_FMT: return(disp_atoms->config_fmt); case WSM_GET_STATE: return(disp_atoms->get_state); case WSM_SET_STATE: return(disp_atoms->set_state); case WSM_REG_WINDOW: return(disp_atoms->reg_window); default: break; } return(None); /* Universal null atom. */ } /* Function Name: _WSMRequiresConfigFormat * Description: Returns True if this request requires a valid config * formats. * Arguments: request_type - the request type to check. * Returns: True if config format required for this request. */ Boolean _WSMRequiresConfigFormat(WSMRequestType request_type) { switch (request_type) { case WSM_GET_STATE: case WSM_SET_STATE: case WSM_REG_WINDOW: return(True); default: break; } return(False); } /* Function Name: _WSMGetConfigFormatType * Description: Gets the config format type for this window. * Arguments: win - The window to check. * Returns: The config format type that matches the window passed. */ WSMConfigFormatType _WSMGetConfigFormatType(Window win) { if (win == None) return(WSM_GLOBAL_FMT); if (win & ~WIN_MASK) return(WSM_ICON_FMT); return(WSM_WINDOW_FMT); } /* Function Name: _WSMGetMatchingAttr * Description: Gets the attribute from the format data passed * that matches the the name passed. * Arguments: nameq - The name to match stored as a quark. * fmt_data - the config format data to check against. * Returns: The attribute information that matches the name passed or NULL */ WSMAttribute * _WSMGetMatchingAttr(XrmQuark nameq, WSMConfigFormatData *fmt_data) { register int i; WSMAttribute * attr = fmt_data->attr_list; for (i = 0; i < fmt_data->num_attrs; i++, attr++) { if (nameq == attr->nameq) return(attr); } return(NULL); } /* Function Name: _WSMGetMatchingWinData * Description: Gets the window data in the list passed whose name * matches quark passed. * Arguments: win_data_top - The top of the window data list. * num - The number of items in the window data list. * nameq - The name to match. * Returns: The matching window data or NULL. */ WSMWinData * _WSMGetMatchingWinData(WSMWinData *win_data_top, int num, XrmQuark nameq) { register int i; WSMWinData *local = win_data_top; for (i = 0; i < num; i++, local++) { if (local->nameq == nameq) return(local); } return(NULL); } motif-2.3.8/demos/lib/Wsm/utm_send.h0000644000175000017500000000267012672140200014174 00000000000000/* $XConsortium: utm_send.h /main/5 1995/07/15 20:43:06 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* * This is used to pass the data from the request * setup routine to the callback routine where the * data is actually transferred. */ typedef struct _UTMPackageRec { int fmt; Atom target; unsigned long len; XtPointer param; XtCallbackProc doneProc; XtPointer closure; } UTMPackageRec; extern void UTMSendMessage( Widget, Atom, Atom, XtPointer, unsigned long, int, XtCallbackProc, XtPointer, Time ); extern void UTMDestinationProc ( Widget, XtPointer, XtPointer ); motif-2.3.8/demos/lib/Wsm/pack.c0000644000175000017500000012266313066310437013305 00000000000000/* $XConsortium: pack.c /main/5 1995/07/15 20:42:45 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include "wsm_proto.h" /* this will redifine bzero to memset if needed. */ #include #define COUNT_SIZE (sizeof(CARD16)) #define BOOL_SIZE 1 /* at least 1 byte for a boolean. */ /* * More intuitive names for various functions. */ #define PackBoolean(d, num) PackCARD8((d), (CARD8) (num)) #define PackListNum(d, num) PackCARD16((d), (CARD16) (num)) #define PackWindow(d, num) PackCARD32((d), (CARD32) (num)) #define PackProperty(d, num) PackCARD32((d), (CARD32) (num)) #define UnpackBoolean(data) ((Boolean) UnpackCARD8(data)) #define UnpackListNum(data) ((int) UnpackCARD16(data)) #define UnpackWindow(data) ((Window) UnpackCARD32(data)) #define UnpackProperty(data) ((WindowProperty) UnpackCARD32(data)) #define START_CHECK_MASK 0x80 /************************************************************ * * Function definitions. * ************************************************************/ /* * Routines for getting the amount of space that a request will take in the * protocol data stream. */ static int WinInfoSizePacked(Display *, int, WSMWinInfo *); static int WinEntrySizePacked(Display *, int, WSMWinEntry *); static int WinDataSizePacked(Display *, int, WSMWinData *, int, WSMConfigFormatType); /* * Routines for packing protocol data stream. */ static MessageData PackConfigFormat(MessageData, WSMConfigFormatReply *); static MessageData PackSingleAttribute(MessageData, WSMAttribute *, int); static MessageData PackWinInfo(Display *, int, MessageData, WSMWinInfo *); static MessageData PackWinEntry(Display *, int, MessageData, WSMWinEntry *); static MessageData PackWinData(Display *, int, MessageData, WSMWinData *, int, WSMConfigFormatType); /* public */ MessageData PackCARD16(MessageData, CARD16); /* public */ MessageData PackCARD8(MessageData, CARD8); /* public */ MessageData PackString(MessageData, String); /* public */ MessageData PackCARD32(MessageData, CARD32); /* * Routines for unpacking protocol data stream. */ static void UnpackWinData(MessageData *, Display *, int, WSMConfigFormatType, WSMWinData **, int *); static void UnpackSingleWinDataRec(MessageData *, WSMAttribute *,WSMWinData *); static void UnpackWinInfo(MessageData *, Display *, int, WSMWinInfo *); static void UnpackWinEntry(MessageData *, Display *, int, WSMWinEntry *); /* public */ String UnpackString(MessageData *); /* public */ CARD32 UnpackCARD32(MessageData *); /* public */ CARD16 UnpackCARD16(MessageData *); /* public */ CARD8 UnpackCARD8(MessageData *); /************************************************************ * * These two routines take data stored in a structure that * humans can understand and pack it down into nice little * protocol requests defined by the OSF WSM Protocol spec. * ************************************************************/ /* Function Name: _WSMPackRequest * Description: Packs up the request passed into an appropriate * message data structure. * Arguments: dpy - the display we will be sending this message on. * screen_num - The screen we will be sending this message to. * request - request to send. * RETURNED msg_data_len - The length of the message data. * RETURNED error - An error code if something went wrong. * Returns: A pointer to a message data struct. * * NOTE: The message data struct must be freed by the calling routine. */ MessageData _WSMPackRequest(Display *dpy, int screen_num, WSMRequest *request, unsigned long *msg_data_len, WSMErrorCode *error) { MessageData data, save; int i; long size; WSMWinInfo *win_info; WSMConfigFormatData *global_attrs, *win_attrs, *icon_attrs; *msg_data_len = 0; /* default value. */ global_attrs = _WSMGetConfigFormat(dpy, screen_num, WSM_GLOBAL_FMT); win_attrs = _WSMGetConfigFormat(dpy, screen_num, WSM_WINDOW_FMT); icon_attrs = _WSMGetConfigFormat(dpy, screen_num, WSM_ICON_FMT); *error = WSM_SUCCESS; if (_WSMRequiresConfigFormat(request->any.type) && (global_attrs->num_attrs == 0) && (win_attrs->num_attrs == 0) && (icon_attrs->num_attrs == 0)) { *error = WSM_ERROR_NO_CONFIG_FORMAT; return(NULL); } if (((request->any.type == WSM_CONNECT) || (request->any.type == WSM_CONFIG_FMT)) && ((global_attrs->num_attrs != 0) || (win_attrs->num_attrs != 0) || (icon_attrs->num_attrs != 0))) { *error = WSM_ERROR_ALREADY_HAVE_CONFIG_FORMAT; return(NULL); } /* before sending extensions make sure screen_info config format is cleared */ /* may want to remove this and leave it up to application writer */ if ((request->any.type == WSM_EXTENSIONS) && ((global_attrs->num_attrs != 0) || (win_attrs->num_attrs != 0) || (icon_attrs->num_attrs != 0))) { _WSMClearConfigScreenInfo(dpy,screen_num); } /* * Calculate the size of the request. */ switch (request->any.type) { case WSM_CONNECT: size = COUNT_SIZE; size += sizeof(CARD8) * request->connect.num_versions; break; case WSM_EXTENSIONS: size = COUNT_SIZE; for (i = 0; i < request->extensions.num_extensions; i++) { size += (strlen(request->extensions.extension_suggestions[i]) + COUNT_SIZE); } break; case WSM_CONFIG_FMT: size = 0; break; case WSM_GET_STATE: size = sizeof(CARD32) + BOOL_SIZE; break; case WSM_SET_STATE: size = COUNT_SIZE; /* The count of window info. */ win_info = request->set_state.win_info_list; for (i = 0; i < request->set_state.num_win_info_list; i++,win_info++) size += WinInfoSizePacked(dpy, screen_num, win_info); break; case WSM_REG_WINDOW: size = sizeof(CARD32); break; case WSM_WM_GET_BACKGROUND_WINDOW: size = sizeof(CARD16); break; case WSM_WM_SET_BACKGROUND_WINDOW: size = sizeof(CARD32); break; case WSM_WM_WINDOWS: size = sizeof(CARD32); /* flag */ size += COUNT_SIZE; /* prop count */ size += request->wm_windows.num_window_properties * sizeof(Window); size += COUNT_SIZE; /* num match attributes */ for (i=0; iwm_windows.num_match_attributes; i++) { size += COUNT_SIZE; /* num attributes */ size += 2 * request->wm_windows.match_attributes[i]->num_attributes * sizeof(WindowProperty); } break; case WSM_WM_FOCUS: size = 0; break; case WSM_WM_POINTER: size = 0; break; default: return(NULL); } save = data = (MessageData) XtMalloc(size); /* * Fill in the message. */ switch (request->any.type) { case WSM_CONNECT: data = PackListNum(data, request->connect.num_versions); for (i = 0; i < request->connect.num_versions; i++) data = PackCARD8(data, (CARD8) request->connect.known_versions[i]); break; case WSM_EXTENSIONS: data = PackListNum(data, request->extensions.num_extensions); for (i = 0; i < request->extensions.num_extensions; i++) data=PackString(data,request->extensions.extension_suggestions[i]); break; case WSM_CONFIG_FMT: break; case WSM_GET_STATE: data = PackWindow(data, request->get_state.window); (void) PackBoolean(data, request->get_state.diffs_allowed); break; case WSM_SET_STATE: win_info = request->set_state.win_info_list; data = PackListNum(data, request->set_state.num_win_info_list); for (i = 0; i < request->set_state.num_win_info_list; i++, win_info++) data = PackWinInfo(dpy, screen_num, data, win_info); break; case WSM_REG_WINDOW: (void) PackWindow(data, request->register_window.window); break; case WSM_WM_GET_BACKGROUND_WINDOW: (void) PackCARD16(data, request->get_background.screen); break; case WSM_WM_SET_BACKGROUND_WINDOW: (void) PackWindow(data, request->set_background.window); break; case WSM_WM_WINDOWS: { int i, j; data = PackCARD32(data, request->wm_windows.location_flag); data = PackListNum(data, request->wm_windows.num_window_properties); for (i=0; iwm_windows.num_window_properties; i++) data = PackProperty(data, request->wm_windows.window_properties[i]); data = PackListNum(data, request->wm_windows.num_match_attributes); for (i = 0; i < request->wm_windows.num_match_attributes; i++) { AttributePair *match_attr; match_attr = request->wm_windows.match_attributes[i]; data = PackListNum(data, match_attr->num_attributes); for (j = 0; j < match_attr->num_attributes; j++) data = PackProperty(data, match_attr->allowed_attributes[j]); for (j = 0; j < match_attr->num_attributes; j++) data = PackProperty(data, match_attr->prohibited_attributes[j]); } } break; case WSM_WM_FOCUS: break; case WSM_WM_POINTER: break; default: break; } *msg_data_len = size; return(save); } /* _WSMPackRequest */ /* Function Name: _WSMPackReply * Description: Packs up the Reply passed into an appropriate * message data structure. * Arguments: dpy - the display we will be sending this message on. * screen_num - The screen we will be sending this message to. * reply - reply to send. * RETURNED msg_data_len - The length of the message data. * Returns: A pointer to a message data struct. * * NOTE: The message data struct must be freed by the calling routine. */ MessageData _WSMPackReply(Display *dpy, int screen_num, WSMReply *reply, unsigned long *msg_data_len) { WSMAttribute *attr; WSMWinInfo *win_info; WSMWinEntry *win_entry; register int i; long size; MessageData data, save; *msg_data_len = 0; /* default value. */ switch (reply->any.type) { case WSM_CONNECT: size = sizeof(CARD8); break; case WSM_EXTENSIONS: size = COUNT_SIZE; for (i = 0; i < reply->extensions.num_extensions; i++) { size += (strlen(reply->extensions.extensions[i]) + COUNT_SIZE); } break; case WSM_CONFIG_FMT: size = BOOL_SIZE; /* accept_diffs. */ size += COUNT_SIZE; /* The count of global attributes. */ attr = reply->config_format.global_formats; for (i = 0; i < reply->config_format.num_global_formats; i++) { /* * Bytes in string */ size += strlen(XrmQuarkToString(attr[i].nameq)) * sizeof(CARD8); /* * len of string + size + is_list. */ size += COUNT_SIZE + sizeof(CARD8) + BOOL_SIZE; } size += COUNT_SIZE; /* The count of window attributes. */ attr = reply->config_format.window_formats; for (i = 0; i < reply->config_format.num_window_formats; i++) { /* * Bytes in string */ size += strlen(XrmQuarkToString(attr[i].nameq)) * sizeof(CARD8); /* * len of string + size + is_list. */ size += COUNT_SIZE + sizeof(CARD8) + BOOL_SIZE; } size += COUNT_SIZE; /* The count of icon attributes. */ attr = reply->config_format.icon_formats; for (i = 0; i < reply->config_format.num_icon_formats; i++) { /* * Bytes in string */ size += strlen(XrmQuarkToString(attr[i].nameq)) * sizeof(CARD8); /* * len of string + size + is_list. */ size += COUNT_SIZE + sizeof(CARD8) + BOOL_SIZE; } break; case WSM_GET_STATE: size = COUNT_SIZE; /* The count of window info. */ win_info = reply->get_state.win_info_list; for (i = 0; i < reply->get_state.num_win_info_list; i++,win_info++) size += WinInfoSizePacked(dpy, screen_num, win_info); break; case WSM_SET_STATE: size = 0; break; case WSM_REG_WINDOW: size = WinDataSizePacked(dpy, screen_num, reply->register_window.window_data, reply->register_window.num_window_data, WSM_WINDOW_FMT); break; case WSM_WM_GET_BACKGROUND_WINDOW: size = sizeof(CARD32); break; case WSM_WM_SET_BACKGROUND_WINDOW: size = sizeof(CARD32); break; case WSM_WM_WINDOWS: size = COUNT_SIZE; /* The count of window entries. */ win_entry = reply->wm_windows.win_entry_list; for (i = 0; i < reply->wm_windows.num_win_entry_list; i++,win_entry++) size += WinEntrySizePacked(dpy, screen_num, win_entry); break; case WSM_WM_FOCUS: size = sizeof(CARD32); break; case WSM_WM_POINTER: size = sizeof(CARD32); /* window */ size += sizeof(CARD32); /* flag */ break; default: /* * ||| Error Message. */ return(NULL); } save = data = (MessageData) XtMalloc(size); switch (reply->any.type) { case WSM_CONNECT: (void) PackCARD8(data, (CARD8) (reply->connect.version & 0xFF)); break; case WSM_EXTENSIONS: data = PackListNum(data, reply->extensions.num_extensions); for (i = 0; i < reply->extensions.num_extensions; i++) data = PackString(data, reply->extensions.extensions[i]); break; case WSM_CONFIG_FMT: PackConfigFormat(data, &(reply->config_format)); break; case WSM_GET_STATE: win_info = reply->get_state.win_info_list; data = PackListNum(data, reply->get_state.num_win_info_list); for (i = 0; i < reply->get_state.num_win_info_list; i++, win_info++) data = PackWinInfo(dpy, screen_num, data, win_info); break; case WSM_SET_STATE: break; case WSM_REG_WINDOW: data = PackWinData(dpy, screen_num, data, reply->register_window.window_data, reply->register_window.num_window_data, WSM_WINDOW_FMT); break; case WSM_WM_GET_BACKGROUND_WINDOW: (void) PackWindow(data, reply->get_background.window); break; case WSM_WM_SET_BACKGROUND_WINDOW: (void) PackWindow(data, reply->set_background.window); break; case WSM_WM_WINDOWS: win_entry = reply->wm_windows.win_entry_list; data = PackListNum(data, reply->wm_windows.num_win_entry_list); for (i = 0; i < reply->wm_windows.num_win_entry_list; i++, win_entry++) data = PackWinEntry(dpy, screen_num, data, win_entry); break; case WSM_WM_FOCUS: (void) PackWindow(data, reply->wm_focus.window); break; case WSM_WM_POINTER: (void) PackWindow(data, reply->wm_pointer.window); (void) PackCARD32(data, reply->wm_pointer.location_flag); break; default: break; } *msg_data_len = size; return(save); }/* _WSMPackReply */ /************************************************************ * * These routines take data on the wire and put it into a structure * that can be manipulated by the app. * ************************************************************/ /* Function Name: _WSMUnpackRequest * Description: Unpacks the byte stream from the wire into a request * message structure. * Arguments: dpy - The Display. * screen_num - The Screen number. * data - The bits from accross the wire. * len - The number of bits sent - Better error checking * makes this more necessary. * type - The type of message received. * RETURNED request - This request structure is filled in with the data * unpacked from the protocol. * Returns: none. */ /*ARGSUSED*/ void _WSMUnpackRequest(Display *dpy, int screen_num, MessageData data, unsigned long len, WSMRequestType type, WSMRequest *request) { register int i; request->any.type = type; /* Save the type. */ request->any.allocated = False; switch (request->any.type) { case WSM_CONNECT: request->connect.num_versions = UnpackListNum(&data); request->connect.known_versions = (short *) XtMalloc(sizeof(short) * request->connect.num_versions); request->connect.allocated = True; for (i = 0; i < request->connect.num_versions; i++) request->connect.known_versions[i] = (short) UnpackCARD8(&data); break; case WSM_EXTENSIONS: { register int num; register String *ptr; num = request->extensions.num_extensions = UnpackListNum(&data); ptr = (String *) XtMalloc(sizeof(String) * num); request->extensions.extension_suggestions = ptr; request->extensions.allocated = True; for (i = 0; i < num; i++, ptr++) *ptr = UnpackString(&data); } break; case WSM_CONFIG_FMT: break; case WSM_GET_STATE: request->get_state.window = UnpackWindow(&data); request->get_state.diffs_allowed = UnpackBoolean(&data); break; case WSM_SET_STATE: { int num = UnpackListNum(&data); request->set_state.num_win_info_list = num; request->set_state.win_info_list = (WSMWinInfo *) XtMalloc(sizeof(WSMWinInfo) * num); request->extensions.allocated = True; for (i = 0; i < num; i++) { UnpackWinInfo(&data, dpy, screen_num, request->set_state.win_info_list + i); } } break; case WSM_REG_WINDOW: request->register_window.window = UnpackWindow(&data); break; case WSM_WM_GET_BACKGROUND_WINDOW: request->get_background.screen = (int)UnpackCARD16(&data); break; case WSM_WM_SET_BACKGROUND_WINDOW: request->set_background.window = UnpackWindow(&data); break; case WSM_WM_WINDOWS: { int num, i, j; request->extensions.allocated = True; request->wm_windows.location_flag = UnpackCARD32(&data); num = request->wm_windows.num_window_properties = UnpackListNum(&data); request->wm_windows.window_properties = (WindowProperty *) XtMalloc(sizeof(WindowProperty) * num); for (i=0; iwm_windows.window_properties[i] = UnpackProperty(&data); num = request->wm_windows.num_match_attributes = UnpackListNum(&data); request->wm_windows.match_attributes = (AttributePair **) XtMalloc(sizeof(AttributePair*) * num); for (i=0; iwm_windows.num_match_attributes; i++) { num = UnpackListNum(&data); request->wm_windows.match_attributes[i] = (AttributePair *) XtMalloc(sizeof(AttributePair) * num * 2 + sizeof(int)); request->wm_windows.match_attributes[i]->num_attributes = num; for (j=0; jwm_windows.match_attributes[i]->allowed_attributes[j] = UnpackProperty(&data); } for (j=0; jwm_windows.match_attributes[i]->prohibited_attributes[j] = UnpackProperty(&data); } } } break; case WSM_WM_FOCUS: break; case WSM_WM_POINTER: break; default: break; } } /* _WSMUnpackRequest */ /* Function Name: _WSMUnpackReply * Description: Unpacks the byte stream from the wire into a reply * message structure. * Arguments: dpy - The Display. * screen_num - The Screen number. * data - the bits from accross the wire. * len - The number of bits sent - Better error checking * makes this more necessary. * type - The type of message received. * RETURNED reply - This reply structure is filled in with the data * unpacked from the protocol. * Returns: none. */ /*ARGSUSED*/ void _WSMUnpackReply(Display *dpy, int screen_num, MessageData data, unsigned long len, WSMRequestType type, WSMReply *reply) { register int i; reply->any.type = type; /* Save the type. */ reply->any.allocated = False; switch (reply->any.type) { case WSM_CONNECT: reply->connect.version = (short) UnpackCARD8(&data); break; case WSM_EXTENSIONS: { register int num; register String *ptr; num = reply->extensions.num_extensions = UnpackListNum(&data); ptr = (String *) XtMalloc(sizeof(String) * num); reply->extensions.allocated = True; reply->extensions.extensions = ptr; for (i = 0; i < num; i++, ptr++) *ptr = UnpackString(&data); } break; case WSM_CONFIG_FMT: { register int types; WSMConfigFormatReply * config_format = &(reply->config_format); WSMConfigFormatData *fmt; WSMScreenInfo *scr_info = _WSMGetScreenInfo(dpy, screen_num); config_format->accepts_diffs = UnpackBoolean(&data); for (types = 0; types < 3; types++) { switch(types) { case WSM_GLOBAL_FMT: fmt = &(scr_info->global); break; case WSM_WINDOW_FMT: fmt = &(scr_info->window); break; case WSM_ICON_FMT: fmt = &(scr_info->icon); break; } fmt->num_attrs = UnpackListNum(&data); fmt->attr_list = (WSMAttribute *) XtMalloc(sizeof(WSMAttribute) * fmt->num_attrs); for (i = 0; i < fmt->num_attrs; i++) { String str = UnpackString(&data); fmt->attr_list[i].nameq = XrmStringToQuark(str); XtFree(str); fmt->attr_list[i].size = UnpackCARD8(&data); fmt->attr_list[i].is_list = UnpackCARD8(&data); } } /* * No need to allocate this, since they are just pointers * back to global data. */ config_format->global_formats = scr_info->global.attr_list; config_format->num_global_formats = scr_info->global.num_attrs; config_format->window_formats = scr_info->window.attr_list; config_format->num_window_formats = scr_info->window.num_attrs; config_format->icon_formats = scr_info->icon.attr_list; config_format->num_icon_formats = scr_info->icon.num_attrs; } break; case WSM_GET_STATE: { int num =reply->get_state.num_win_info_list = UnpackListNum(&data); reply->get_state.win_info_list = (WSMWinInfo *) XtMalloc(sizeof(WSMWinInfo) * num); reply->get_state.allocated = True; for (i = 0; i < num; i++) UnpackWinInfo(&data, dpy, screen_num, reply->get_state.win_info_list + i); } break; case WSM_SET_STATE: break; case WSM_REG_WINDOW: UnpackWinData(&data, dpy, screen_num, WSM_WINDOW_FMT, &(reply->register_window.window_data), &(reply->register_window.num_window_data)); reply->register_window.allocated = True; break; case WSM_WM_GET_BACKGROUND_WINDOW: reply->get_background.window = UnpackWindow(&data); break; case WSM_WM_SET_BACKGROUND_WINDOW: reply->set_background.window = UnpackWindow(&data); break; case WSM_WM_WINDOWS: { int num; num = reply->wm_windows.num_win_entry_list = UnpackListNum(&data); reply->wm_windows.win_entry_list = (WSMWinEntry *) XtMalloc(sizeof(WSMWinEntry) * num); reply->wm_windows.allocated = True; for (i = 0; i < num; i++) UnpackWinEntry(&data, dpy, screen_num, reply->wm_windows.win_entry_list + i); } break; case WSM_WM_FOCUS: reply->wm_focus.window = UnpackWindow(&data); break; case WSM_WM_POINTER: reply->wm_pointer.location_flag = UnpackCARD32(&data); break; default: break; } } /* _WSMUnpackReply */ /************************************************************ * * Internal Routines for getting size of packed requests. * ************************************************************/ /* Function Name: WinInfoSizePacked * Description: Returns the size this window structure will take * when packed into a protocol data stream. * Arguments: dpy, screen_num - The display and screen of the client we * are talking to. * win_info - The window info whose size me are checking. * Returns: the size (in bytes) */ static int WinInfoSizePacked(Display *dpy, int screen_num, WSMWinInfo *win_info) { int size = sizeof(CARD32); size += WinDataSizePacked(dpy, screen_num, win_info->data_list, win_info->num_data_list, _WSMGetConfigFormatType(win_info->window)); return(size); } /* Function Name: WinEntrySizePacked * Description: Returns the size this window structure will take * when packed into a protocol data stream. * Arguments: dpy, screen_num - The display and screen of the client we * are talking to. * win_entry - The window entry whose size we are checking. * Returns: the size (in bytes) */ static int WinEntrySizePacked(Display *dpy, int screen_num, WSMWinEntry *win_entry) { int size; size = sizeof(CARD32); size += sizeof(CARD32) * win_entry->num_windows; size = sizeof(CARD32); size += sizeof(WindowProperty) * win_entry->num_match_properties; return(size); } /* Function Name: WinDataSizePacked * Description: The size that will be taken up with this window data * once it is packed into the protocol stream. * Arguments: dpy, screen_num - The screen nmuber and display that * we are talking to. * win_data - The data stored in a window data structure list. * num - number of items in the list. * fmt - The type of format to use to pack this data. * Returns: The size. */ static int WinDataSizePacked(Display *dpy, int screen_num, WSMWinData *win_data, int num, WSMConfigFormatType fmt) { register int i, size; WSMConfigFormatData *fmt_data = _WSMGetConfigFormat(dpy, screen_num, fmt); size = fmt_data->num_attrs / 8 + 1; /* Size of header bits. */ for ( i = 0; i < num; i++, win_data++) { WSMAttribute *attr = _WSMGetMatchingAttr(win_data->nameq, fmt_data); if (attr == NULL) { /* * ||| ERROR. */ continue; } switch(win_data->type) { case WSM_VALUE_DATA: size += attr->size/8; break; default: /* All others are lists. */ size += COUNT_SIZE; size += ((attr->size/8) * win_data->data_len); break; } } return(size); } /************************************************************ * * Internal Routines for packing data into the protocol stream. * ************************************************************/ /* Function Name: PackString * Description: Packs a string into the data stream. * Arguments: data - The data stream to pack into. * str - The string to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackString(MessageData data, String str) { register int i, len = strlen(str); data = PackListNum(data, len); for (i = 0; i < len; i++, str++) data = PackCARD8(data, *str); return(data); } /* Function Name: PackConfigFormat * Description: Packs the configuration format into the data stream. * Arguments: data - the datastream. * config - the reply config format message. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackConfigFormat(MessageData data, WSMConfigFormatReply *config) { data = PackBoolean(data, config->accepts_diffs); data = PackSingleAttribute(data, config->global_formats, config->num_global_formats); data = PackSingleAttribute(data, config->window_formats, config->num_window_formats); data = PackSingleAttribute(data, config->icon_formats, config->num_icon_formats); return(data); } /* Function Name: PackSingleAttribute * Description: Packs a single attribute into a the data stream. * Arguments: data - the datastream. * attr_list, num - The attribute list to pack into the stream. * The number of items in the list. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackSingleAttribute(MessageData data, WSMAttribute *attr_list, int num) { register int i; data = PackListNum(data, num); for (i = 0; i < num; i++, attr_list++) { data = PackString(data, XrmQuarkToString(attr_list->nameq)); data = PackCARD8(data, (CARD8) attr_list->size); data = PackBoolean(data, attr_list->is_list); } return(data); } /* Function Name: PackWinInfo * Description: Packs the window information into the data stream. * Arguments: dpy, screen_num - The display and screen of the client * that we are talking to. * data - The message stream. * win_info - The window info list to pack into the data stream. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackWinInfo(Display *dpy, int screen_num, MessageData data, WSMWinInfo *win_info) { data = PackWindow(data, win_info->window); return(PackWinData(dpy, screen_num, data, win_info->data_list, win_info->num_data_list, _WSMGetConfigFormatType(win_info->window))); } /* Function Name: PackWinEntry * Description: Packs the window information into the data stream. * Arguments: dpy, screen_num - The display and screen of the client * that we are talking to. * data - The message stream. * win_info - The window info list to pack into the data stream. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackWinEntry(Display *dpy, int screen_num, MessageData data, WSMWinEntry *win_entry) { int i; data = PackListNum(data, win_entry->num_windows); for (i = 0; i < win_entry->num_windows; i++) data = PackWindow(data, win_entry->windows[i]); data = PackListNum(data, win_entry->num_match_properties); for (i = 0; i < win_entry->num_match_properties; i++) data = PackProperty(data, win_entry->match_properties[i]); return(data); } /* Function Name: PackWinData * Description: Packs the window data into the data stream. * Arguments: dpy, screen_num - The display and screen of the client * that we are talking to. * data - The message stream. * win_data, num - The window data to pack * into the data stream, and its size. * fmt - The type of config format to use. * Returns: data - A pointer into the next empty location in the * data stream. */ static MessageData PackWinData(Display *dpy, int screen_num, MessageData data, WSMWinData *win_data, int num, WSMConfigFormatType fmt) { WSMConfigFormatData *conf_fmt = _WSMGetConfigFormat(dpy, screen_num, fmt); MessageData mask_pos = data; WSMAttribute *attr; register int i, size = (conf_fmt->num_attrs / 8) + 1; data = (MessageData) ((char *)data + size); bzero((char *) mask_pos, size); /* Set all bits to zero initially*/ attr = conf_fmt->attr_list; for (i = 0; i < conf_fmt->num_attrs ; i++, attr++) { WSMWinData *this_data; this_data = _WSMGetMatchingWinData(win_data, num, attr->nameq); if (this_data != NULL) { if (this_data->type != WSM_VALUE_DATA) data = PackListNum(data, this_data->data_len); switch(this_data->type) { case WSM_CHAR_LIST_DATA: { register int j; char * ptr = this_data->data.char_ptr; for (j = 0 ; j < this_data->data_len; j++, ptr++) data = PackCARD8(data, (CARD8) *ptr); break; } case WSM_SHORT_LIST_DATA: { register int j; short * ptr = this_data->data.short_ptr; for (j = 0 ; j < this_data->data_len; j++, ptr++) data = PackCARD16(data, (CARD16) *ptr); break; } case WSM_LONG_LIST_DATA: { register int j; long * ptr = this_data->data.long_ptr; for (j = 0 ; j < this_data->data_len; j++, ptr++) data = PackCARD32(data, (CARD32) *ptr); break; } case WSM_VALUE_DATA: switch(attr->size) { case 8: data = PackCARD8(data, (CARD8) this_data->data.value); break; case 16: data = PackCARD16(data, (CARD16) this_data->data.value); break; case 32: data = PackCARD32(data, (CARD32) this_data->data.value); break; } break; case WSM_NONE: /* Not handled case */ break; } /* * The first item sets the MSBit, the 8th Item sets the LSBit. * The Nineth sets the MSBit in the second byte. The unused * bits are the LSBits of the last byte. */ (*(unsigned char *)mask_pos) |= (char)(1 << (7 - (i % 8))); } /* * When we get to the end of a char, move to the next one. */ if ((i % 8) == 7) mask_pos = ((char *)mask_pos + 1); } return(data); } /* Function Name: PackCARD32 * Description: Packs an 32 bit value into the data stream. * Arguments: data - The data stream to pack into. * val - The 32 bit value to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackCARD32(MessageData data, CARD32 val) { CARD16 bottom = val & (0xFFFF); CARD16 top = val >> 16; data = PackCARD16(data, top); data = PackCARD16(data, bottom); return(data); } /* Function Name: PackCARD16 * Description: Packs an 16 bit value into the data stream. * Arguments: data - The data stream to pack into. * val - The 16 bit value to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackCARD16(MessageData data, CARD16 val) { CARD8 bottom = val & (0xFF); CARD8 top = val >> 8; data = PackCARD8(data, top); data = PackCARD8(data, bottom); return(data); } /* Function Name: PackCARD8 * Description: Packs an 8 bit value into the data stream. * Arguments: data - The data stream to pack into. * val - The 8 bit value to pack. * Returns: data - A pointer into the next empty location in the * data stream. */ MessageData PackCARD8(MessageData data, CARD8 val) { CARD8 *ptr = (CARD8 *) data; *ptr = (CARD8) val; data = ((char*)data) + 1; return(data); } /************************************************************ * * Internal routines for unpacking the data from the * protocol stream. * ************************************************************/ /* Function Name: UnpackWinData * Description: Unpacks the window data from the protocol stream. * Arguments: data_ptr - A pointer to the message data stream. * dpy, screen_num - The display and screen of the client * that we are talking to. * fmt - The window format to use. * RETURNED win_data - The window data information. * RETURNED num - The number of window data structs in "win_data". * Returns: none */ static void UnpackWinData(MessageData *data_ptr, Display *dpy, int screen_num, WSMConfigFormatType fmt, WSMWinData **win_data, int *num) { register int i, size; WSMConfigFormatData *conf_fmt = _WSMGetConfigFormat(dpy, screen_num, fmt); unsigned char *bit_mask, *current_mask, check_mask; WSMAttribute *attr; WSMWinData *ptr; /* * Figure out how many values have been specified so we know how much * memory to allocate. */ size = conf_fmt->num_attrs / 8 + 1; current_mask = bit_mask = (unsigned char *) XtMalloc(size); /* * Unpack the bits from the wire. */ for (i = 0; i < size; i++, current_mask++) *current_mask = UnpackCARD8(data_ptr); current_mask = bit_mask; check_mask = START_CHECK_MASK; for (*num = 0, i = 0; i < conf_fmt->num_attrs; i++) { if (*current_mask & check_mask) (*num)++; check_mask >>= 1; if ((i % 8) == 7) { current_mask++; check_mask = START_CHECK_MASK; } } ptr = *win_data = (WSMWinData *) XtMalloc(*num * sizeof(WSMWinData)); /* * For each value that was specified pack the data into the window * data record. */ current_mask = bit_mask; check_mask = START_CHECK_MASK; attr = conf_fmt->attr_list; for (i = 0; i < conf_fmt->num_attrs; i++, attr++) { if (*current_mask & check_mask) UnpackSingleWinDataRec(data_ptr, attr, ptr++); check_mask >>= 1; if ((i % 8) == 7) { current_mask++; check_mask = START_CHECK_MASK; } } XtFree((XtPointer) bit_mask); } /* Function Name: UnpackSingleWinDataRec * Description: Packs a single window data record. * Arguments: data_ptr - The data pointer. * attr - The attribute record that defines general information * on how to unpack this data. * win_data - the window data struct. * Returns: none */ static void UnpackSingleWinDataRec(MessageData *data_ptr, WSMAttribute *attr, WSMWinData *win_data) { register int i; /* * Set these no matter what the size. */ win_data->nameq = attr->nameq; /* Save the name. */ if (attr->is_list) { win_data->data_len = UnpackListNum(data_ptr); } else { win_data->type = WSM_VALUE_DATA; win_data->data_len = 0; /* unused... */ } /* * Based on the size, and whether or not this is a list, unpack * the data from the wire. */ switch(attr->size) { case 8: if (attr->is_list) { char *local; win_data->type = WSM_CHAR_LIST_DATA; local = win_data->data.char_ptr = (char *) XtMalloc(sizeof(char) * win_data->data_len); for (i = 0; i < win_data->data_len; i++, local++) *local = UnpackCARD8(data_ptr); } else win_data->data.value = UnpackCARD8(data_ptr); break; case 16: if (attr->is_list) { short *local; win_data->type = WSM_SHORT_LIST_DATA; local = win_data->data.short_ptr = (short *) XtMalloc(sizeof(short) * win_data->data_len); for (i = 0; i < win_data->data_len; i++, local++) *local = UnpackCARD16(data_ptr); } else win_data->data.value = UnpackCARD16(data_ptr); break; case 32: if (attr->is_list) { long *local; win_data->type = WSM_LONG_LIST_DATA; local = win_data->data.long_ptr = (long *) XtMalloc(sizeof(long) * win_data->data_len); for (i = 0; i < win_data->data_len; i++, local++) *local = UnpackCARD32(data_ptr); } else win_data->data.value = UnpackCARD32(data_ptr); break; } } /* Function Name: UnpackWinInfo * Description: Unpacks the window information from the protocol stream. * Arguments: data_ptr - A pointer to the message data stream. * dpy, screen_num - The display and screen of the client * that we are talking to. * win_info - The window information. * Returns: none */ static void UnpackWinInfo(MessageData *data, Display *dpy, int screen_num, WSMWinInfo *win_info) { win_info->window = UnpackWindow(data); UnpackWinData(data, dpy, screen_num, _WSMGetConfigFormatType(win_info->window), &(win_info->data_list), &(win_info->num_data_list)); } /* Function Name: UnpackWinEntry * Description: Unpacks the window entry information from the protocol stream. * Arguments: data_ptr - A pointer to the message data stream. * dpy, screen_num - The display and screen of the client * that we are talking to. * win_entry - The window entry information. * Returns: none */ static void UnpackWinEntry(MessageData *data, Display *dpy, int screen_num, WSMWinEntry *win_entry) { int i; win_entry->num_windows = UnpackListNum(data); win_entry->windows = (Window *) XtMalloc(sizeof(Window) * win_entry->num_windows); for (i=0; inum_windows; i++) win_entry->windows[i] = UnpackWindow(data); win_entry->num_match_properties = UnpackListNum(data); win_entry->match_properties = (WindowProperty *) XtMalloc(sizeof(WindowProperty) * win_entry->num_match_properties); for (i=0; inum_match_properties; i++) win_entry->match_properties[i] = UnpackProperty(data); } /* Function Name: UnpackString * Description: Unpacks a string from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the string from the data stream. * * NOTE: Data is modified to point to the next empty location in the stream. */ String UnpackString(MessageData *data_ptr) { register int i; int len = UnpackListNum(data_ptr); char *str, *top = XtMalloc((len + 1) * sizeof(char)); for (str = top, i = 0; i < len; i++, str++) { *str = (char) UnpackCARD8(data_ptr); } *str = '\0'; return((String) top); } /* Function Name: UnpackCARD32 * Description: Unpacks an 32 bit value from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the CARD32 from the data stream. * * NOTE: data is modified to point to the next empty location in the stream. */ CARD32 UnpackCARD32(MessageData *data_ptr) { CARD32 val = UnpackCARD16(data_ptr) << 16; val |= UnpackCARD16(data_ptr); return(val); } /* Function Name: UnpackCARD16 * Description: Unpacks an 16 bit value from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the CARD16 from the data stream. * * NOTE: data is modified to point to the next empty location in the stream. */ CARD16 UnpackCARD16(MessageData *data_ptr) { CARD16 val = UnpackCARD8(data_ptr) << 8; val |= UnpackCARD8(data_ptr); return(val); } /* Function Name: UnpackCARD8 * Description: Unpacks an 8 bit value from the protocol data stream. * Arguments: data - Pointer to the data stream. * Returns: the CARD8 from the data stream. * * NOTE: data is modified to point to the next empty location in the stream. */ CARD8 UnpackCARD8(MessageData *data_ptr) { CARD8 ret_val = *((char *) *data_ptr); *data_ptr = ((char *) *data_ptr) + 1; return(ret_val); } motif-2.3.8/demos/lib/Wsm/Makefile.am0000644000175000017500000000041612672140200014235 00000000000000MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libWsm.a libWsm_a_SOURCES = debug.c disp.c free.c pack.c recv.c send.c util.c utm_send.c noinst_HEADERS = wsm_funcs.h wsm_proto.h utm_send.h INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/lib/Xmd/0000755000175000017500000000000013211513007012241 500000000000000motif-2.3.8/demos/lib/Xmd/Help.c0000644000175000017500000010153212672140200013220 00000000000000/* $TOG: Help.c /main/7 1997/03/31 13:22:37 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* uncomment for ExmTab button - you'll need to change the Imakefiles for many of the demos however. */ /* #define USE_TAB 1 */ /* This define controls whether XmCSText or XmLabel is used as */ /* the text_display area. */ #define USE_LABEL 1 #include #include #include #include #include #include #include #ifdef USE_LABEL #include #include #else #include #endif /* USE_LABEL */ #include #include #include #ifdef USE_TAB #include #endif /* USE_TAB */ #include "HelpP.h" #define DEFAULTHP "./%N%S" #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define DEFAULT_FONT_NAME "*helvetica-medium-r-*-12-*" #define BOLD_FONT_NAME "*helvetica-bold-r-*-12-*" #define EMPHASIS_FONT_NAME "*helvetica-medium-o-*-12-*" #define HEADING_FONT_NAME "*helvetica-bold-r-*-14-*" #define TITLE_FONT_NAME "*helvetica-bold-o-*-14-*" /* Declare static functions. */ static void Initialize( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void Destroy( Widget wid) ; static void Layout( Widget, Widget ); static void Resize ( Widget w ); static void SetValuesAlmost( Widget cw, Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply); static XtGeometryResult GeometryManager ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply); static void CalcSize (Widget wid, Widget instigator, Dimension *width, Dimension *height); static void ChangeManaged ( Widget w); static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static Boolean ParentProcess(Widget wid, XmParentProcessData event) ; static void ReadHelpFile(Widget w); static XmIncludeStatus parse_proc(XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag tag, XmParseMapping entry, int pattern_length, XmString *str_include, XtPointer call_data); static XmIncludeStatus esc_parse_proc(XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag tag, XmParseMapping entry, int pattern_length, XmString *str_include, XtPointer call_data); static XmString parse_text(String value); static void page_change(Widget, XtPointer, XmNotebookCallbackStruct *); static void unmanage_cb(Widget, Widget, XtPointer); /* No translations and no actions. */ /* Define the resources for the XmdHelp widget. */ static XtResource resources[] = { { XmdNhelpFile, XmdCHelpFile, XmRString, sizeof(String), XtOffsetOf( XmdHelpRec, help.help_file), XmRImmediate, (XtPointer) NULL }, { XmdNhelpPath, XmdCHelpPath, XmRString, sizeof(String), XtOffsetOf( XmdHelpRec, help.help_path), XmRImmediate, (XtPointer) NULL }, { XmNspacing, XmCSpacing, XmRDimension, sizeof(Dimension), XtOffsetOf( XmdHelpRec, help.spacing), XmRImmediate, (XtPointer) 10 }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf( XmdHelpRec, help.rendertable), XmRImmediate, (XtPointer) NULL }, }; /* Define the widget class record. See Chapter 4 of the "OSF/Motif Widget Writer's Guide" for details. */ externaldef(Xmdhelpclassrec) XmdHelpClassRec xmdHelpClassRec = { { /* Here is the Core class record. */ /* superclass */ (WidgetClass) &xmManagerClassRec, /* class_name */ "XmdHelp", /* widget_size */ sizeof(XmdHelpRec), /* class_initialize */ NULL, /* class_part_initialize */ NULL, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ QueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* Here is the Composite class record. */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* Here is the Constaint class record. */ /* constraint_resources */ NULL, /* constraint_num_resources */ 0, /* constraint_size */ sizeof(XmdHelpConstraintRec), /* constraint_initialize */ NULL, /* constraint_destroy */ NULL, /* constraint_set_values */ NULL, /* extension */ NULL, }, { /* Here is the XmManager class record. */ /* translations */ XtInheritTranslations, /* syn_resources */ NULL, /* num_syn_resources */ 0, /* syn_constraint_resources */ NULL, /* num_syn_constraint_resources */ 0, /* parent_process */ ParentProcess, /* extension */ NULL, }, { /* Here is the XmdHelp class record. */ (XtPointer) NULL, /* extension */ } }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef(Xmdhelpwidgetclass) WidgetClass xmdHelpWidgetClass = (WidgetClass) &xmdHelpClassRec; /************************************************************************** * * Initialize: * Called when this widget is first instantiated. * ***************************************************************************/ static void Initialize(Widget request_w, Widget new_w, ArgList p_args, Cardinal *num_args) { XmdHelpWidget rw = (XmdHelpWidget) request_w; XmdHelpWidget nw = (XmdHelpWidget) new_w; Arg args[20]; int n, i; XmRendition rend[10]; XmRenderTable csRT; XmTab tabs[5]; XmTabList csTabs; XmTakesDefaultTrait trait_default; #if USE_LABEL Widget display_parent; #endif /* USE_LABEL */ /* Initialize internal fields */ nw -> help.num_titles = 0; nw -> help.allocated_titles = 0; nw -> help.titles = NULL; nw -> help.help_text = NULL; /* Create a default RenderTable if none specified */ if (nw -> help.rendertable == (XmRenderTable) NULL) { for(n = 0; n < 5; n++) tabs[n] = XmTabCreate(1.0, XmINCHES, XmRELATIVE, XmALIGNMENT_BEGINNING, NULL); csTabs = XmTabListInsertTabs(NULL, tabs, 5, 0); for(n = 0; n < 5; n++) XmTabFree(tabs[n]); n = 0; i = 0; XtSetArg(args[n], XmNfontName, DEFAULT_FONT_NAME); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; XtSetArg(args[n], XmNtabList, csTabs); n++; rend[i] = XmRenditionCreate(new_w, XmFONTLIST_DEFAULT_TAG, args, n); i++; n = 0; XtSetArg(args[n], XmNfontName, BOLD_FONT_NAME); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; rend[i] = XmRenditionCreate(new_w, "bold", args, n); i++; n = 0; XtSetArg(args[n], XmNfontName, HEADING_FONT_NAME); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; rend[i] = XmRenditionCreate(new_w, "heading", args, n); i++; n = 0; XtSetArg(args[n], XmNfontName, EMPHASIS_FONT_NAME); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; rend[i] = XmRenditionCreate(new_w, "emphasis", args, n); i++; n = 0; XtSetArg(args[n], XmNfontName, TITLE_FONT_NAME); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; rend[i] = XmRenditionCreate(new_w, "title", args, n); i++; n = 0; XtSetArg(args[n], XmNfontName, BOLD_FONT_NAME); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; rend[i] = XmRenditionCreate(new_w, "subtitle", args, n); i++; csRT = XmRenderTableAddRenditions(NULL, rend, i, XmMERGE_OLD);; nw -> help.rendertable = csRT; for(n = 0; n < i; n++) XmRenditionFree(rend[n]); } else { nw -> help.rendertable = XmRenderTableCopy(nw -> help.rendertable, NULL, 0); csRT = nw -> help.rendertable; } /* Create internal widgets */ n = 0; XtSetArg(args[n], XmNcurrentPageNumber, 1); n++; nw -> help.notebook = XmCreateNotebook(new_w, "Notebook", args, n); XtAddCallback(nw -> help.notebook, XmNpageChangedCallback, (XtCallbackProc) page_change, (XtPointer) nw); #ifdef USE_LABEL n = 0; XtSetArg(args[n], XmNscrollingPolicy, XmAUTOMATIC); n++; XtSetArg(args[n], XmNwidth, 500); n++; XtSetArg(args[n], XmNheight, 240); n++; XtSetArg(args[n], XmNpageNumber, 1); n++; XtSetArg(args[n], XmNresizable, FALSE); n++; XtSetArg(args[n], XmNnotebookChildType, XmPAGE); n++; display_parent = XmCreateScrolledWindow(nw -> help.notebook, "Text_SW", args, n); #endif /* USE_LABEL */ n = 0; /* XtSetArg(args[n], XmNrenderTable, csRT); n++; */ XtSetArg(args[n], XmNfontList, csRT); n++; #ifdef USE_LABEL XtSetArg(args[n], XmNscrolledWindowChildType, XmWORK_AREA); n++; XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++; nw -> help.text_display = XmCreateLabel(display_parent, "Text", args, n); #else XtSetArg(args[n], XmNrows, 14); n++; XtSetArg(args[n], XmNcolumns, 60); n++; XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++; XtSetArg(args[n], XmNpageNumber, 1); n++; XtSetArg(args[n], XmNnotebookChildType, XmPAGE); n++; XtSetArg(args[n], XmNeditable, False); n++; nw -> help.text_display = XmCreateScrolledCSText(nw -> help.notebook, "Text", args, n); #endif /* USE_LABEL */ n = 0; XtSetArg(args[n], XmNmarginWidth, 15); n++; XtSetArg(args[n], XmNmarginHeight, 10); n++; nw -> help.dismiss = XmCreatePushButton(new_w, "Dismiss", args, n); XtAddCallback(nw -> help.dismiss, XmNactivateCallback, (XtCallbackProc) unmanage_cb, (XtPointer) new_w); /* this is also the default button */ trait_default = (XmTakesDefaultTrait) XmeTraitGet((XtPointer) XtClass(nw -> help.dismiss), XmQTtakesDefault) ; if (trait_default) trait_default->showAsDefault(nw -> help.dismiss, XmDEFAULT_ON); nw -> help.allocated_titles = 0; /* Help path, handle default value here */ if (nw -> help.help_path != NULL) nw -> help.help_path = XtNewString(nw -> help.help_path); /* Help file */ if (nw -> help.help_file != NULL) nw -> help.help_file = XtNewString(nw -> help.help_file); /* Read in file */ ReadHelpFile(new_w); /* Initialize Notebook contents */ page_change(nw -> help.notebook, new_w, NULL); /* Now manage children */ XtManageChild(nw -> help.notebook); #ifdef USE_LABEL XtManageChild(display_parent); #endif /* USE_LABEL */ XtManageChild(nw -> help.text_display); XtManageChild(nw -> help.dismiss); } /**************************************************************************** * * Destroy: * Called when the widget is destroyed. * ****************************************************************************/ static void Destroy( Widget wid ) { XmdHelpWidget help = (XmdHelpWidget) wid; int i; /* Cleanup internal allocations */ for(i = 0; i < help -> help.num_titles; i++) { XtFree((char*) help -> help.titles[i]); XtFree((char*) help -> help.help_text[i]); } XtFree((char*) help -> help.titles); XtFree((char*) help -> help.help_text); XmRenderTableFree(help -> help.rendertable); } /***************************************************************************** * * SetValues: * Called by the Intrinsics whenever any of the resource values change. * ****************************************************************************/ static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { XmdHelpWidget cw = (XmdHelpWidget)old_w; XmdHelpWidget rw = (XmdHelpWidget)request_w; XmdHelpWidget nw = (XmdHelpWidget)new_w; if (nw -> help.rendertable != cw -> help.rendertable) { /* Free the old */ XmRenderTableFree(cw -> help.rendertable); /* Copy the new */ nw -> help.rendertable = XmRenderTableCopy(nw -> help.rendertable, NULL, 0); XtVaSetValues(nw -> help.text_display, XmNrenderTable, nw -> help.rendertable, NULL, NULL); } /* Deal with new helpPath */ if (nw -> help.help_path != cw -> help.help_path) { XtFree(cw -> help.help_path); if (nw -> help.help_path != NULL) nw -> help.help_path = XtNewString(nw -> help.help_path); } /* Deal with new helpFile */ if (nw -> help.help_file != cw -> help.help_file) { XtFree(cw -> help.help_file); nw -> help.help_file = XtNewString(nw -> help.help_file); /* Read new helpfile here */ ReadHelpFile(new_w); } return(False); } /**************************************************************************** * * Resize: * ****************************************************************************/ static void Resize ( Widget w ) { Layout(w, NULL); } /************************************************************************* * * SetValuesAlmost: * Called by the Intrinsics when an XtMakeGeometryRequest call * returns either XmGeometryAlmost or XtGeometryNo. * ***************************************************************************/ static void SetValuesAlmost( Widget cw, /* unused */ Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { /* The parent said XtGeometryNo to the geometry request. Therefore, we need to relayout because this request was due to a change in internal geometry resource of the ExmGrid */ if (!reply->request_mode) { Layout(nw, NULL); } *request = *reply; } /*************************************************************************** * * Layout: * Does all the placement of children. * Instigator tells whether or not to resize all children. * *************************************************************************/ static void Layout( Widget wid, Widget instigator ) { XmdHelpWidget help = (XmdHelpWidget) wid; Widget child; int i; int x; int y; int spacing = help -> help.spacing; x = y = spacing; /* There are only a few children. They are laid out in a simple left to right fashion */ for (i = 0; i < help -> composite.num_children; i++) { child = help -> composite.children[i]; if (XtIsManaged(child)) { if (instigator != child) { XmeConfigureObject(child, x, y, XtWidth(child), XtHeight(child), XtBorderWidth(child)); x += XtWidth(child) + spacing; } } } } /************************************************************************* * * QueryGeometry: * Called by a parent when the parent needs to find out the * preferred size. * ***************************************************************************/ static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XmdHelpWidget help = (XmdHelpWidget) w; /* If the parent calls XtQueryGeometry before the widget has been realized, use the current size as the preferred size. */ /* Deal with user initial size setting */ if (!XtIsRealized(w)) { /* Widget is not yet realized. */ reply->width = XtWidth(w) ; /* might be 0 */ reply->height = XtHeight(w) ; /* might be 0 */ } else { /* Widget is realized. */ /* always computes natural size afterwards */ reply->width = 0; reply->height = 0; } CalcSize (w, NULL, &reply->width, &reply->height); /* This function handles CWidth and CHeight */ return XmeReplyToQueryGeometry(w, request, reply) ; } /**************************************************************************** * * GeometryManager: * Called by Intrinsics in response to a geometry change request from * one of the children * ***************************************************************************/ static XtGeometryResult GeometryManager ( Widget w, /* instigator */ XtWidgetGeometry *request, XtWidgetGeometry *reply ) { XtWidgetGeometry parentRequest; XtGeometryResult result; Dimension curWidth, curHeight, curBW; Dimension new_width, new_height; /* Deny any requests for a new position. */ if ((request->request_mode & CWX) || (request->request_mode & CWY)) return XtGeometryNo ; /* Save the original child resources. */ curWidth = w->core.width; curHeight = w->core.height; curBW = w->core.border_width; CalcSize(XtParent(w), w, &new_width, &new_height); /* Ask the Help's parent if new calculated size is acceptable. */ parentRequest.request_mode = CWWidth | CWHeight; parentRequest.width = new_width; parentRequest.height = new_height; if (request->request_mode & XtCWQueryOnly) parentRequest.request_mode |= XtCWQueryOnly; result = XtMakeGeometryRequest ((Widget)XtParent(w), &parentRequest, NULL); /* Turn XtGeometryAlmost into XtGeometryNo. */ if (result == XtGeometryAlmost) result = XtGeometryNo; if (result == XtGeometryNo || request->request_mode & XtCWQueryOnly) { /* Restore original geometry. */ w->core.width = curWidth; w->core.height = curHeight; w->core.border_width = curBW; } else { /* result == XtGeometryYes and this wasn't just a query */ Layout (XtParent(w), w); /* Layout with this child as the instigator, so that we don't resize this child. */ } return(result); } /************************************************************************** * * ChangeManaged: * Called by the Intrinsics whenever either of the following happens: * * a managed child becomes unmanaged. * * an unmanaged child becomes managed. * *************************************************************************/ static void ChangeManaged( Widget w ) { XmdHelpWidget help = (XmdHelpWidget) w; Dimension helpWidth, helpHeight; int i; /* If you get an initial (C) size from the user or application, keep it. Otherwise, just force width and height to 0 so that CalcSize will overwrite the appropriate fields. */ if (!XtIsRealized(w)) { /* The first time, only attempts to change non specified sizes */ helpWidth = XtWidth(w) ; /* might be 0 */ helpHeight = XtHeight(w) ; /* might be 0 */ } else { helpWidth = 0 ; helpHeight = 0 ; } CalcSize(w, NULL, &helpWidth, &helpHeight); /* Ask parent of Help if Help's new size is acceptable. Keep asking until parent returns either XtGeometryYes or XtGeometryNo. */ while (XtMakeResizeRequest (w, helpWidth, helpHeight, &helpWidth, &helpHeight) == XtGeometryAlmost); Layout (w, NULL); /* Update keyboard traversal */ XmeNavigChangeManaged (w); } /****************************************************************************** * * CalcSize: * Called by QueryGeometry, SetValues, GeometryManager, and ChangeManaged. * Calculate the ideal size of the Help widget. * Only affects the returned size if it is 0. * ****************************************************************************/ static void CalcSize ( Widget wid, Widget instigator, Dimension *helpWidth, Dimension *helpHeight ) { XmdHelpWidget hw = (XmdHelpWidget) wid ; int i; int spacing = hw -> help.spacing; int width = 0; int height = 1; int x, y; x = y = spacing; /* There are only a few children. They are laid out in a simple left to right fashion */ for (i = 0; i < hw -> composite.num_children; i++) { int total_height; Dimension cw, ch, cb; XtWidgetGeometry reply; Widget child; child = hw -> composite.children[i]; if (!XtIsManaged(child)) continue ; /* Get child's preferred geometry if not the instigator. */ if (child != instigator) { XtQueryGeometry (child, NULL, &reply); cw = (reply.request_mode & CWWidth) ? reply.width : child->core.width; ch = (reply.request_mode & CWHeight) ? reply.height : child->core.height; } else { cw = child->core.width; ch = child->core.height; } cb = child->core.border_width; total_height = 2 * (spacing + cb) + ch; height = MAX(height, total_height); width += spacing + cw; } width += spacing; if (!*helpWidth) *helpWidth = width; if (!*helpHeight) *helpHeight = height; } static Boolean ParentProcess(Widget wid, XmParentProcessData event ) { XmdHelpWidget hw = (XmdHelpWidget) wid; Widget dbutton = hw -> help.dismiss; XmPrimitiveClassRec *primitive_class; if(event->any.process_type == XmINPUT_ACTION) { primitive_class = (XmPrimitiveWidgetClass) XtClass(dbutton); if (primitive_class->primitive_class.arm_and_activate && XtIsSensitive(dbutton)) { (*(primitive_class->primitive_class.arm_and_activate)) (dbutton, event->input_action.event, event->input_action.params, event->input_action.num_params) ; } return True; } return False; } /***************************************************************************** * ReadHelpFile * * This reads in the new helpfile using the values of help_file and * help_path * * help_path is a path in the syntax of a XtResolvePathname path *****************************************************************************/ static void ReadHelpFile(Widget w) { XmdHelpWidget help = (XmdHelpWidget)w; char *full_pathname; char *filename; FILE *input; char line[256]; int i; Widget tab; Arg args[10]; int n; Boolean subtitle; if (help -> help.help_file == NULL) filename = "default"; else filename = help -> help.help_file; full_pathname = XtResolvePathname(XtDisplay(w), "help", filename, ".help", help -> help.help_path, NULL, 0, NULL); /* If not found using the help_path supplied (or XFILESEARCHPATH if help_path is NULL), then try using a builtin search path which includes the current directory */ if (full_pathname == NULL) full_pathname = XtResolvePathname(XtDisplay(w), "help", filename, ".help", DEFAULTHP, NULL, 0, NULL); if (full_pathname == NULL) { /* Failure */ sprintf(line, "Couldn't find file %s in the path given.\n", filename); XmeWarning(w, line); return; } /* Cleanup internal allocations (if any) */ for(i = 0; i < help -> help.num_titles; i++) { XtFree((char*) help -> help.titles[i]); XtFree((char*) help -> help.help_text[i]); } help -> help.num_titles = 0; /* Otherwise read it in */ /* The file consists of markers. Section-header will delimit sections and will always start at the beginning of the line to help us "notice" them. We'll read in from one of these to the beginning of the next, concatenating lines. Then we parse it using the XmString parser */ input = fopen(full_pathname, "r"); if (input == NULL) return; fgets(line, 256, input); /* Read until we find a title */ while(! feof(input) && (subtitle = strncmp(line,"",7) != 0) && strncmp(line,"<subtitle>", 10) != 0) fgets(line, 256, input); while(! feof(input)) { XmString tmp; int len; if (feof(input)) break; /* Up allocation if needed */ if (help -> help.num_titles >= help -> help.allocated_titles) { help -> help.allocated_titles += 10; help -> help.titles = (XmStringTable) XtRealloc((char*) help -> help.titles, sizeof(XmString) * help -> help.allocated_titles); help -> help.help_text = (XmStringTable) XtRealloc((char*) help -> help.help_text, sizeof(XmString) * help -> help.allocated_titles); } /* Remove the trailing newline */ len = strlen(line); if (line[len-1] == '\n') line[len-1] = 0; /* Parse the title line */ help -> help.titles[help -> help.num_titles] = parse_text(line); /* Make the tab */ n = 0; XtSetArg(args[n], XmNpageNumber, help -> help.num_titles + 1); n++; if (! subtitle) { XtSetArg(args[n], XmNnotebookChildType, XmMAJOR_TAB); n++; } else { XtSetArg(args[n], XmNnotebookChildType, XmMINOR_TAB); n++; } #ifdef USE_TAB XtSetArg(args[n], ExmNcompoundString, help -> help.titles[help -> help.num_titles]); n++; tab = ExmCreateTabButton(help -> help.notebook, "tab", args, n); #else XtSetArg(args[n], XmNlabelString, help -> help.titles[help -> help.num_titles]); n++; tab = XmCreatePushButton(help -> help.notebook, "tab", args, n); #endif /* USE_TAB */ XtManageChild(tab); /* Now start parsing the rest, until we find another line which has <title> at the begin */ subtitle = False; tmp = XmStringCreateLocalized(""); fgets(line, 256, input); while(! feof(input) && (subtitle = strncmp(line,"<title>", 7) != 0) && strncmp(line,"<subtitle>", 10) != 0) { tmp = XmStringConcatAndFree(tmp, parse_text(line)); fgets(line, 256, input); } help -> help.help_text[help -> help.num_titles++] = tmp; } fclose(input); /* Setup notebook */ XtVaSetValues(help -> help.notebook, XmNlastPageNumber, help -> help.num_titles, XmNcurrentPageNumber, 1, NULL, NULL); } static XmIncludeStatus parse_proc(XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag tag, XmParseMapping entry, int pattern_length, XmString *str_include, XtPointer call_data) { char *rendition_name; Boolean start = True; char *ptr; int len; /* The remaining characters are either rendition or /rendition to indicate the start or end of a rendition */ ptr = (char*) *in_out; ptr++; if (*ptr == '/') { start = False; ptr++; } /* Get rendition name. The name ends at the > delimiter */ rendition_name = ptr; ptr = strchr(ptr, '>'); if (ptr == NULL) { str_include = NULL; return XmINSERT; } /* Null terminate tag */ *ptr = 0; ptr++; rendition_name = XtNewString(rendition_name); len = strlen(rendition_name); *in_out = (XtPointer) ptr; if (start) *str_include = XmStringComponentCreate(XmSTRING_COMPONENT_RENDITION_BEGIN, len, rendition_name); else *str_include = XmStringComponentCreate(XmSTRING_COMPONENT_RENDITION_END, len, rendition_name); XtFree(rendition_name); return XmINSERT; } static XmIncludeStatus esc_parse_proc(XtPointer *in_out, XtPointer text_end, XmTextType type, XmStringTag tag, XmParseMapping entry, int pattern_length, XmString *str_include, XtPointer call_data) { char *ptr; char temp[2]; ptr = (char*) *in_out; ptr++; /* Move to the next character and create an XmString for it */ temp[0] = *ptr++; temp[1] = 0; *str_include = XmStringCreateLocalized(temp); *in_out = (XtPointer) ptr; return XmINSERT; } static XmString parse_text(String value) { static XmParseTable table = NULL; XmString result; int table_size = 4; /* Allocate a parse table if necessary. */ if (!table) { Arg args[10]; Cardinal nargs; XmString tmp; int index = 0; table = (XmParseTable) XtCalloc(table_size, sizeof(XmParseMapping)); tmp = XmStringComponentCreate(XmSTRING_COMPONENT_TAB, 0, NULL); nargs = 0; XtSetArg(args[nargs], XmNincludeStatus, XmINSERT), nargs++; XtSetArg(args[nargs], XmNsubstitute, tmp), nargs++; XtSetArg(args[nargs], XmNpattern, "\t"), nargs++; table[index++] = XmParseMappingCreate(args, nargs); XmStringFree(tmp); tmp = XmStringSeparatorCreate(); nargs = 0; XtSetArg(args[nargs], XmNincludeStatus, XmINSERT), nargs++; XtSetArg(args[nargs], XmNsubstitute, tmp), nargs++; XtSetArg(args[nargs], XmNpattern, "\n"), nargs++; table[index++] = XmParseMappingCreate(args, nargs); nargs = 0; XtSetArg(args[nargs], XmNincludeStatus, XmINVOKE), nargs++; XtSetArg(args[nargs], XmNpattern, "\\"), nargs++; XtSetArg(args[nargs], XmNinvokeParseProc, esc_parse_proc), nargs++; table[index++] = XmParseMappingCreate(args, nargs); nargs = 0; XtSetArg(args[nargs], XmNpattern, "<"), nargs++; XtSetArg(args[nargs], XmNincludeStatus, XmINVOKE), nargs++; XtSetArg(args[nargs], XmNinvokeParseProc, parse_proc), nargs++; table[index++] = XmParseMappingCreate(args, nargs); XmStringFree(tmp); } /* Parse the text into an XmString. */ result = XmStringParseText(value, NULL, NULL, XmCHARSET_TEXT, table, table_size, NULL); return(result); } static void page_change(Widget w, XtPointer help_w, XmNotebookCallbackStruct *cb) { XmdHelpWidget help = (XmdHelpWidget) help_w; int index = cb == NULL ? 0 : cb -> page_number - 1; if (index < 0) index = 0; if (index >= help -> help.num_titles) return; XtVaSetValues(help -> help.text_display, #ifdef USE_LABEL XmNlabelString, help -> help.help_text[index], #else XmNcstextValue, help -> help.help_text[index], #endif /* USE_LABEL */ NULL, NULL); XtVaSetValues( #ifdef USE_LABEL XtParent(XtParent(help -> help.text_display)), #else XtParent(help -> help.text_display), #endif /* USE_LABEL */ XmNpageNumber, index + 1, NULL, NULL); } static void unmanage_cb(Widget button, Widget hw, XtPointer ignore) { XtUnmanageChild(hw); } /* * External functions */ /****************************************************************************** * * XmdCreateHelp: * Called by an application. * *****************************************************************************/ Widget XmdCreateHelp ( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { /* This is a convenience function to instantiate an XmdHelp widget. */ return (XtCreateWidget (name, xmdHelpWidgetClass, parent, arglist, argcount)); } /****************************************************************************** * * XmdCreateHelpDialog * Called by an application to create an XmdHelp managed by a * DialogShell. * *****************************************************************************/ Widget XmdCreateHelpDialog ( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return(XmeCreateClassDialog(xmdHelpWidgetClass, parent, name, arglist, argcount)); } void XmdGotoHelpItem(Widget w, int item, Widget help) { Widget notebook = XtNameToWidget(help, "*Notebook"); XmdHelpWidget hw = (XmdHelpWidget) help; if (item < 0 || item >= hw -> help.num_titles) return; XtVaSetValues(notebook, XmNcurrentPageNumber, item + 1, NULL, NULL); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/Menus.h�������������������������������������������������������������������0000644�0001750�0001750�00000011314�12672140200�013422� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Menus.h /main/5 1995/07/15 20:43:45 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _XmdMenus_h #define _XmdMenus_h /* Menu types which can be requested */ typedef enum { FILE_MENU, EDIT_MENU, SELECTED_MENU, OPTIONS_MENU, VIEW_MENU, HELP_MENU, POPUPS, OBJECT_POPUP_MENU, BACKGROUND_POPUP_MENU, OTHER_POPUP_MENU } XmdMenuType; /* Free advice. The menu elements are returned in arrays which can be used with XtManageChildren. If you are going to use most of the items, then use XtManageChildren and unmanage and/or make insensitive the few which are unused. Otherwise use XtManageChild on each individual widget. By default, the required elements are already managed and nothing else is. (Exception: the FILE_PRINT widget is managed, also the HELP menu doesn't quite follow this rule) */ /* indecis of menu items */ /******************************************************** * Popup menus - unimplemented yet ********************************************************/ /* Selectable element popup menu */ enum { OBJECT_PROPERTIES, OBJECT_OPEN, OBJECT_UNDO, OBJECT_REPEAT, OBJECT_DRAG, OBJECT_SIZE, OBJECT_DUPLICATE, OBJECT_COPY_TO, OBJECT_MOVE_TO, OBJECT_RENAME, OBJECT_CUT, OBJECT_COPY, OBJECT_COPY_LINK, OBJECT_COPY_SPECIAL, OBJECT_PASTE, OBJECT_PASTE_LINK, OBJECT_PASTE_SPECIAL, OBJECT_INSERT, OBJECT_PRIMARY_COPY, OBJECT_PRIMARY_MOVE, OBJECT_PRIMARY_LINK, OBJECT_CLEAR, OBJECT_DELETE, OBJECT_SELECT_ALL, OBJECT_SELECT_PASTED, OBJECT_RESELECT, OBJECT_PRINT, OBJECT_HELP }; /* Background popup menu */ enum { BACKGROUND_UNDO, BACKGROUND_REPEAT, BACKGROUND_NEW, BACKGROUND_DUPLICATE, BACKGROUND_COPY_TO, BACKGROUND_MOVE_TO, BACKGROUND_CUT, BACKGROUND_COPY, BACKGROUND_COPY_LINK, BACKGROUND_COPY_SPECIAL, BACKGROUND_PASTE, BACKGROUND_PASTE_LINK, BACKGROUND_PASTE_SPECIAL, BACKGROUND_INSERT, BACKGROUND_PRIMARY_COPY, BACKGROUND_PRIMARY_MOVE, BACKGROUND_PRIMARY_LINK, BACKGROUND_CLEAR, BACKGROUND_DELETE, BACKGROUND_SELECT_ALL, BACKGROUND_UNSELECT_ALL, BACKGROUND_SELECT_PASTED, BACKGROUND_RESELECT, BACKGROUND_PRINT_ALL, BACKGROUND_PRINT_SELECTED, BACKGROUND_HELP }; /* Other element popup menu */ enum { OTHER_COPY, OTHER_COPY_SPECIAL, OTHER_PASTE, OTHER_PASTE_SPECIAL, OTHER_HELP }; /******************************************************** * Pulldown menus - unimplemented yet ********************************************************/ /* File menu */ enum { FILE_NEW, FILE_OPEN, FILE_SAVE, FILE_SAVE_AS, FILE_REVERT, FILE_SEP1, FILE_COPY_TO, FILE_DRAG, FILE_PRINT, FILE_PRINT_SETUP, FILE_SEP2, FILE_CLOSE, FILE_EXIT, FILE_END }; /* Selected menu */ enum { SELECTED_PROPERTIES, SELECTED_NEW, SELECTED_OPEN, SELECTED_SEP1, SELECTED_COPY_TO, SELECTED_MOVE_TO, SELECTED_SEP2, SELECTED_CLEAR, SELECTED_DELETE, SELECTED_PRINT, SELECTED_EXIT, SELECTED_END }; /* Edit menu */ enum { EDIT_UNDO, EDIT_REPEAT, EDIT_DRAG, EDIT_SIZE, EDIT_DUPLICATE, EDIT_SEP1, EDIT_CUT, EDIT_COPY, EDIT_COPY_LINK, EDIT_COPY_SPECIAL, EDIT_PASTE, EDIT_PASTE_LINK, EDIT_PASTE_SPECIAL, EDIT_INSERT, EDIT_SEP2, EDIT_PRIMARY_COPY, EDIT_PRIMARY_MOVE, EDIT_PRIMARY_LINK, EDIT_SEP3, EDIT_CLEAR, EDIT_DELETE, EDIT_SELECT_ALL, EDIT_SEP4, EDIT_UNSELECT_ALL, EDIT_SELECT_PASTED, EDIT_RESELECT, EDIT_END }; /* View menu */ enum { VIEW_CHANGE, VIEW_NEW, VIEW_SEP, VIEW_INCLUDE, VIEW_SORT, VIEW_FIND, VIEW_END }; /* Help menu */ enum { HELP_OVERVIEW, HELP_SEP1, HELP_INDEX, HELP_TOC, HELP_TASKS, HELP_REFERENCE, HELP_TUTORIAL, HELP_KEYBOARD, HELP_MOUSE, HELP_ON_ITEM, HELP_SEP2, HELP_USING_HELP, HELP_ABOUT, HELP_END }; /* Returns cascade button for pulldown menu, menu for popup menu, widgetlist returned in allocated storage in array. */ extern Widget XmdCreateMenu(XmdMenuType, Widget parent, WidgetList *array, Cardinal *size); #endif /* _XmdMenus_h */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/Makefile.in���������������������������������������������������������������0000644�0001750�0001750�00000047425�13211512765�014254� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = onHelp$(EXEEXT) subdir = demos/lib/Xmd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libXmd_a_AR = $(AR) $(ARFLAGS) libXmd_a_LIBADD = am_libXmd_a_OBJECTS = Help.$(OBJEXT) Menus.$(OBJEXT) Print.$(OBJEXT) \ RegEdit.$(OBJEXT) AdjView.$(OBJEXT) libXmd_a_OBJECTS = $(am_libXmd_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) onHelp_SOURCES = onHelp.c onHelp_OBJECTS = onHelp.$(OBJEXT) onHelp_LDADD = $(LDADD) onHelp_DEPENDENCIES = libXmd.a ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libXmd_a_SOURCES) onHelp.c DIST_SOURCES = $(libXmd_a_SOURCES) onHelp.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libXmd.a libXmd_a_SOURCES = Help.c Menus.c Print.c RegEdit.c AdjView.c noinst_HEADERS = AdjView.h \ Help.h HelpP.h \ Menus.h \ Print.h PrintP.h \ RegEdit.h RegEditI.h LDADD = libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(top_builddir)/lib -I$(srcdir)/../../../lib ${X_CFLAGS} EXTRA_DIST = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/lib/Xmd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/lib/Xmd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libXmd.a: $(libXmd_a_OBJECTS) $(libXmd_a_DEPENDENCIES) $(EXTRA_libXmd_a_DEPENDENCIES) $(AM_V_at)-rm -f libXmd.a $(AM_V_AR)$(libXmd_a_AR) libXmd.a $(libXmd_a_OBJECTS) $(libXmd_a_LIBADD) $(AM_V_at)$(RANLIB) libXmd.a clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list onHelp$(EXEEXT): $(onHelp_OBJECTS) $(onHelp_DEPENDENCIES) $(EXTRA_onHelp_DEPENDENCIES) @rm -f onHelp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(onHelp_OBJECTS) $(onHelp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AdjView.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Menus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Print.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RegEdit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/onHelp.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/RegEdit.h�����������������������������������������������������������������0000644�0001750�0001750�00000002674�12672140200�013667� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: RegEdit.h /main/5 1995/07/15 20:44:09 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _XmdRegEdit_h #define _XmdRegEdit_h #include <Xm/Xm.h> /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif extern void XmdRegisterEditres(Widget toplevel); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _XmdRegEdit_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ��������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/Help.h��������������������������������������������������������������������0000644�0001750�0001750�00000005026�12672140200�013226� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Help.h /main/5 1995/07/15 20:43:32 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _XmdHelp_h #define _XmdHelp_h /* Include appropriate files. */ #include <Xm/Xm.h> /* widget public header file for XmManager */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class and widget record. */ externalref WidgetClass xmdHelpWidgetClass; typedef struct _XmdHelpClassRec * XmdHelpWidgetClass; typedef struct _XmdHelpRec * XmdHelpWidget; /* Define an IsSubclass macro. */ #ifndef XmdIsHelp #define XmdIsHelp(w) XtIsSubclass(w, XmdHelpWidgetClass) #endif #define XmdNhelpFile "helpFile" #define XmdCHelpFile "HelpFile" #define XmdNhelpPath "helpPath" #define XmdCHelpPath "HelpPath" #define XmdNboldFontName "boldFontName" #define XmdNemphasisFontName "emphasisFontName" #define XmdNdefaultFontName "defaultFontName" #define XmdNheadingFontName "headingFontName" #define XmdNtitleFontName "titleFontName" /* Specify the API for this widget. */ extern Widget XmdCreateHelp( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern Widget XmdCreateHelpDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount); /* XtCallbackProc for use with help callbacks, don't forget to include the help widget in the call */ extern void XmdGotoHelpItem(Widget w, int item, Widget help); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _XmdHelp_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/HelpP.h�������������������������������������������������������������������0000644�0001750�0001750�00000005453�12672140200�013352� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: HelpP.h /main/4 1995/07/15 20:43:36 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _XmdHelpP_h #define _XmdHelpP_h /* Include appropriate files. */ #include "Help.h" #include <Xm/ManagerP.h> /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif typedef struct { XtPointer extension; } XmdHelpClassPart; /* Define the full class record. */ typedef struct _XmdHelpClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmdHelpClassPart help_class; } XmdHelpClassRec; externalref XmdHelpClassRec xmdHelpClassRec; /* Define the widget instance part. */ typedef struct { char* help_path; char* help_file; XmRenderTable rendertable; Dimension spacing; /* Internal instance fields */ Cardinal num_titles; Cardinal allocated_titles; XmStringTable titles; XmStringTable help_text; /* Internal widgets (but in child list) */ Widget notebook; Widget text_display; Widget dismiss; } XmdHelpPart; /* Define the full instance record. */ typedef struct _XmdHelpRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmdHelpPart help; } XmdHelpRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define XmdHelpIndex (XmManagerIndex + 1) /* Define the constraint part structure. */ typedef struct _XmdHelpConstraintPart { int dummy; } XmdHelpConstraintPart, * XmdHelpConstraint; /* Define the full constraint structure. */ typedef struct _XmdHelpConstraintRec { XmManagerConstraintPart manager; XmdHelpConstraintPart help; } XmdHelpConstraintRec, * XmdHelpConstraintPtr; /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _XmdHelpP_h */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/RegEdit.c�����������������������������������������������������������������0000644�0001750�0001750�00000135436�13066310437�013676� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: RegEdit.c /main/5 1995/07/15 20:44:04 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <Xm/XmP.h> #include <X11/ShellP.h> #include "RegEdit.h" #include "RegEditI.h" /* static forward. move from global in the original Editres code */ static void _XEditResCheckMessages(); static void _XEditResPutString8(); static void _XEditResPut8(); static void _XEditResPut16(); static void _XEditResPut32(); static void _XEditResPutWidgetInfo(); static void _XEditResResetStream(); static Boolean _XEditResGet8(); static Boolean _XEditResGet16(); static Boolean _XEditResGetSigned16(); static Boolean _XEditResGet32(); static Boolean _XEditResGetString8(); static Boolean _XEditResGetWidgetInfo(); /* the only entry point here */ void XmdRegisterEditres(Widget toplevel) { XtAddEventHandler(toplevel, (EventMask) 0, TRUE, _XEditResCheckMessages, NULL); } /************************************************************ * * Dump the content of the R5 lib/Xmu/EditresCom.c module. * just move global as static. * ************************************************************/ #define _XEditResPutBool _XEditResPut8 #define _XEditResPutResourceType _XEditResPut8 /************************************************************ * * Local structure definitions. * ************************************************************/ typedef enum { BlockNone, BlockSetValues, BlockAll } EditresBlock; typedef struct _SetValuesEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; unsigned short num_entries; /* number of set values requests. */ char * name; char * res_type; XtPointer value; unsigned short value_len; } SetValuesEvent; typedef struct _SVErrorInfo { SetValuesEvent * event; ProtocolStream * stream; unsigned short * count; WidgetInfo * entry; } SVErrorInfo; typedef struct _FindChildEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; short x, y; } FindChildEvent; typedef struct _GenericGetEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; unsigned short num_entries; /* number of set values requests. */ } GenericGetEvent, GetResEvent, GetGeomEvent; /* * Things that are common to all events. */ typedef struct _AnyEvent { EditresCommand type; /* first field must be type. */ WidgetInfo * widgets; } AnyEvent; /* * The event union. */ typedef union _EditresEvent { AnyEvent any_event; SetValuesEvent set_values_event; GetResEvent get_resources_event; GetGeomEvent get_geometry_event; FindChildEvent find_child_event; } EditresEvent; typedef struct _Globals { EditresBlock block; SVErrorInfo error_info; ProtocolStream stream; ProtocolStream * command_stream; /* command stream. */ } Globals; #define CURRENT_PROTOCOL_VERSION 4L #define streq(a,b) (strcmp( (a), (b) ) == 0) static Atom res_editor_command, res_editor_protocol, client_value; static Globals globals; static void SendFailure(), SendCommand(), InsertWidget(), ExecuteCommand(); static void FreeEvent(), ExecuteSetValues(), ExecuteGetGeometry(); static void ExecuteGetResources(); static void GetCommand(); static void LoadResources(); static Boolean IsChild(); static void DumpChildren(); static char *DumpWidgets(), *DoSetValues(), *DoFindChild(); static char *DoGetGeometry(), *DoGetResources(); /************************************************************ * * Resource Editor Communication Code * ************************************************************/ /* Function Name: _XEditResCheckMessages * Description: This callback routine is set on all shell widgets, * and checks to see if a client message event * has come from the resource editor. * Arguments: w - the shell widget. * data - *** UNUSED *** * event - The X Event that triggered this handler. * cont - *** UNUSED ***. * Returns: none. */ /* ARGSUSED */ static void _XEditResCheckMessages(w, data, event, cont) Widget w; XtPointer data; XEvent *event; Boolean *cont; { Time time; ResIdent ident; static Boolean first_time = FALSE; static Atom res_editor, res_comm; Display * dpy; if (event->type == ClientMessage) { XClientMessageEvent * c_event = (XClientMessageEvent *) event; dpy = XtDisplay(w); if (!first_time) { first_time = TRUE; res_editor = XInternAtom(dpy, EDITRES_NAME, False); res_editor_command = XInternAtom(dpy, EDITRES_COMMAND_ATOM, False); res_editor_protocol = XInternAtom(dpy, EDITRES_PROTOCOL_ATOM, False); /* Used in later procedures. */ client_value = XInternAtom(dpy, EDITRES_CLIENT_VALUE, False); LoadResources(w); } if ((c_event->message_type != res_editor) || (c_event->format != EDITRES_SEND_EVENT_FORMAT)) return; time = c_event->data.l[0]; res_comm = c_event->data.l[1]; ident = (ResIdent) c_event->data.l[2]; if (c_event->data.l[3] != CURRENT_PROTOCOL_VERSION) { _XEditResResetStream(&globals.stream); _XEditResPut8(&globals.stream, CURRENT_PROTOCOL_VERSION); SendCommand(w, res_comm, ident, ProtocolMismatch, &globals.stream); return; } XtGetSelectionValue(w, res_comm, res_editor_command, GetCommand, (XtPointer) (long) ident, time); } } /* Function Name: BuildEvent * Description: Takes the info out the protocol stream an constructs * the proper event structure. * Arguments: w - widget to own selection, in case of error. * sel - selection to send error message beck in. * data - the data for the request. * ident - the id number we are looking for. * length - length of request. * Returns: the event, or NULL. */ #define ERROR_MESSAGE ("Client: Improperly formatted protocol request") static EditresEvent * BuildEvent(w, sel, data, ident, length) Widget w; Atom sel; XtPointer data; ResIdent ident; unsigned long length; { EditresEvent * event; ProtocolStream alloc_stream, *stream; unsigned char temp; register unsigned int i; stream = &alloc_stream; /* easier to think of it this way... */ stream->current = stream->top = (unsigned char *) data; stream->size = HEADER_SIZE; /* size of header. */ /* * Retrieve the Header. */ if (length < HEADER_SIZE) { SendFailure(w, sel, ident, Failure, ERROR_MESSAGE); return(NULL); } (void) _XEditResGet8(stream, &temp); if (temp != ident) /* Id's don't match, ignore request. */ return(NULL); event = (EditresEvent *) XtCalloc(sizeof(EditresEvent), 1); (void) _XEditResGet8(stream, &temp); event->any_event.type = (EditresCommand) temp; (void) _XEditResGet32(stream, &(stream->size)); stream->top = stream->current; /* reset stream to top of value.*/ /* * Now retrieve the data segment. */ switch(event->any_event.type) { case SendWidgetTree: break; /* no additional info */ case SetValues: { SetValuesEvent * sv_event = (SetValuesEvent *) event; if ( !(_XEditResGetString8(stream, &(sv_event->name)) && _XEditResGetString8(stream, &(sv_event->res_type)))) { goto done; } /* * Since we need the value length, we have to pull the * value out by hand. */ if (!_XEditResGet16(stream, &(sv_event->value_len))) goto done; sv_event->value = XtMalloc(sizeof(char) * (sv_event->value_len + 1)); for (i = 0; i < sv_event->value_len; i++) { if (!_XEditResGet8(stream, (unsigned char *) sv_event->value + i)) { goto done; } } ((char*)sv_event->value)[i] = '\0'; /* NULL terminate that sucker. */ if (!_XEditResGet16(stream, &(sv_event->num_entries))) goto done; sv_event->widgets = (WidgetInfo *) XtCalloc(sizeof(WidgetInfo), sv_event->num_entries); for (i = 0; i < sv_event->num_entries; i++) { if (!_XEditResGetWidgetInfo(stream, sv_event->widgets + i)) goto done; } } break; case FindChild: { FindChildEvent * find_event = (FindChildEvent *) event; find_event->widgets = (WidgetInfo *) XtCalloc(sizeof(WidgetInfo), 1); if (!(_XEditResGetWidgetInfo(stream, find_event->widgets) && _XEditResGetSigned16(stream, &(find_event->x)) && _XEditResGetSigned16(stream, &(find_event->y)))) { goto done; } } break; case GetGeometry: case GetResources: { GenericGetEvent * get_event = (GenericGetEvent *) event; if (!_XEditResGet16(stream, &(get_event->num_entries))) goto done; get_event->widgets = (WidgetInfo *) XtCalloc(sizeof(WidgetInfo), get_event->num_entries); for (i = 0; i < get_event->num_entries; i++) { if (!_XEditResGetWidgetInfo(stream, get_event->widgets + i)) goto done; } } break; default: { char buf[BUFSIZ]; sprintf(buf, "Unknown Protocol request %d.",event->any_event.type); SendFailure(w, sel, ident, buf); return(NULL); } } return(event); done: SendFailure(w, sel, ident, ERROR_MESSAGE); FreeEvent(event); return(NULL); } /* Function Name: FreeEvent * Description: Frees the event structure and any other pieces * in it that need freeing. * Arguments: event - the event to free. * Returns: none. */ static void FreeEvent(event) EditresEvent * event; { if (event->any_event.widgets != NULL) { XtFree((char *)event->any_event.widgets->ids); XtFree((char *)event->any_event.widgets); } if (event->any_event.type == SetValues) { XtFree(event->set_values_event.name); /* XtFree does not free if */ XtFree(event->set_values_event.res_type); /* value is NULL. */ } XtFree((char *)event); } /* Function Name: GetCommand * Description: Gets the Command out of the selection asserted by the * resource manager. * Arguments: (See Xt XtConvertSelectionProc) * data - contains the ident number for the command. * Returns: none. */ /* ARGSUSED */ static void GetCommand(w, data, selection, type, value, length, format) Widget w; XtPointer data, value; Atom *selection, *type; unsigned long *length; int * format; { ResIdent ident = (ResIdent) (long) data; EditresEvent * event; if ( (*type != res_editor_protocol) || (*format != EDITRES_FORMAT) ) return; if ((event = BuildEvent(w, *selection, value, ident, *length)) != NULL) { ExecuteCommand(w, *selection, ident, event); FreeEvent(event); } } /* Function Name: ExecuteCommand * Description: Executes a command string received from the * resource editor. * Arguments: w - a widget. * command - the command to execute. * value - the associated with the command. * Returns: none. * * NOTES: munges str */ /* ARGSUSED */ static void ExecuteCommand(w, sel, ident, event) Widget w; Atom sel; ResIdent ident; EditresEvent * event; { char * (*func)(); char * str; if (globals.block == BlockAll) { SendFailure(w, sel, ident, "This client has blocked all Editres commands."); return; } else if ((globals.block == BlockSetValues) && (event->any_event.type == SetValues)) { SendFailure(w, sel, ident, "This client has blocked all SetValues requests."); return; } switch(event->any_event.type) { case SendWidgetTree: func = DumpWidgets; break; case SetValues: func = DoSetValues; break; case FindChild: func = DoFindChild; break; case GetGeometry: func = DoGetGeometry; break; case GetResources: func = DoGetResources; break; default: { char buf[BUFSIZ]; sprintf(buf,"Unknown Protocol request %d.",event->any_event.type); SendFailure(w, sel, ident, buf); return; } } _XEditResResetStream(&globals.stream); if ((str = (*func)(w, event, &globals.stream)) == NULL) SendCommand(w, sel, ident, PartialSuccess, &globals.stream); else { SendFailure(w, sel, ident, str); XtFree(str); } } /* Function Name: ConvertReturnCommand * Description: Converts a selection. * Arguments: w - the widget that owns the selection. * selection - selection to convert. * target - target type for this selection. * type_ret - type of the selection. * value_ret - selection value; * length_ret - lenght of this selection. * format_ret - the format the selection is in. * Returns: True if conversion was sucessful. */ /* ARGSUSED */ static Boolean ConvertReturnCommand(w, selection, target, type_ret, value_ret, length_ret, format_ret) Widget w; Atom * selection, * target, * type_ret; XtPointer *value_ret; unsigned long * length_ret; int * format_ret; { /* * I assume the intrinsics give me the correct selection back. */ if ((*target != client_value)) return(FALSE); *type_ret = res_editor_protocol; *value_ret = (XtPointer) globals.command_stream->real_top; *length_ret = globals.command_stream->size + HEADER_SIZE; *format_ret = EDITRES_FORMAT; return(TRUE); } /* Function Name: CommandDone * Description: done with the selection. * Arguments: *** UNUSED *** * Returns: none. */ /* ARGSUSED */ static void CommandDone(widget, selection, target) Widget widget; Atom *selection; Atom *target; { /* Keep the toolkit from automaticaly freeing the selection value */ } /* Function Name: SendFailure * Description: Sends a failure message. * Arguments: w - the widget to own the selection. * sel - the selection to assert. * ident - the identifier. * str - the error message. * Returns: none. */ static void SendFailure(w, sel, ident, str) Widget w; Atom sel; ResIdent ident; char * str; { _XEditResResetStream(&globals.stream); _XEditResPutString8(&globals.stream, str); SendCommand(w, sel, ident, Failure, &globals.stream); } /* Function Name: BuildReturnPacket * Description: Builds a return packet, given the data to send. * Arguments: ident - the identifier. * command - the command code. * stream - the protocol stream. * Returns: packet - the packet to send. */ static XtPointer BuildReturnPacket(ident, command, stream) ResIdent ident; EditresCommand command; ProtocolStream * stream; { long old_alloc, old_size; unsigned char * old_current; /* * We have cleverly keep enough space at the top of the header * for the return protocol stream, so all we have to do is * fill in the space. */ /* * Fool the insert routines into putting the header in the right * place while being damn sure not to realloc (that would be very bad. */ old_current = stream->current; old_alloc = stream->alloc; old_size = stream->size; stream->current = stream->real_top; stream->alloc = stream->size + (2 * HEADER_SIZE); _XEditResPut8(stream, ident); _XEditResPut8(stream, (unsigned char) command); _XEditResPut32(stream, old_size); stream->alloc = old_alloc; stream->current = old_current; stream->size = old_size; return((XtPointer) stream->real_top); } /* Function Name: SendCommand * Description: Builds a return command line. * Arguments: w - the widget to own the selection. * sel - the selection to assert. * ident - the identifier. * command - the command code. * stream - the protocol stream. * Returns: none. */ static void SendCommand(w, sel, ident, command, stream) Widget w; Atom sel; ResIdent ident; EditresCommand command; ProtocolStream * stream; { BuildReturnPacket(ident, command, stream); globals.command_stream = stream; /* * I REALLY want to own the selection. Since this was not triggered * by a user action, and I am the only one using this atom it is safe to * use CurrentTime. */ XtOwnSelection(w, sel, CurrentTime, ConvertReturnCommand, NULL, CommandDone); } /************************************************************ * * Generic Utility Functions. * ************************************************************/ /* Function Name: FindChildren * Description: Retuns all children (popup, normal and otherwise) * of this widget * Arguments: parent - the parent widget. * children - the list of children. * normal - return normal children. * popup - return popup children. * Returns: the number of children. */ static int FindChildren(parent, children, normal, popup) Widget parent, **children; Boolean normal, popup; { CompositeWidget cw = (CompositeWidget) parent; int i, num_children, current = 0; num_children = 0; if (XtIsWidget(parent) && popup) num_children += parent->core.num_popups; if (XtIsComposite(parent) && normal) num_children += cw->composite.num_children; if (num_children == 0) { *children = NULL; return(0); } *children =(Widget*) XtMalloc((Cardinal) sizeof(Widget) * num_children); if (XtIsComposite(parent) && normal) for (i = 0; i < cw->composite.num_children; i++,current++) (*children)[current] = cw->composite.children[i]; if (XtIsWidget(parent) && popup) for ( i = 0; i < parent->core.num_popups; i++, current++) (*children)[current] = parent->core.popup_list[i]; return(num_children); } /* Function Name: IsChild * Description: check to see of child is a child of parent. * Arguments: top - the top of the tree. * parent - the parent widget. * child - the child. * Returns: none. */ static Boolean IsChild(top, parent, child) Widget top, parent, child; { int i, num_children; Widget * children; if (parent == NULL) return(top == child); num_children = FindChildren(parent, &children, TRUE, TRUE); for (i = 0; i < num_children; i++) { if (children[i] == child) { XtFree((char *)children); return(TRUE); } } XtFree((char *)children); return(FALSE); } /* Function Name: VerifyWidget * Description: Makes sure all the widgets still exist. * Arguments: w - any widget in the tree. * info - the info about the widget to verify. * Returns: an error message or NULL. */ static char * VerifyWidget(w, info) Widget w; WidgetInfo *info; { Widget top; register int count; register Widget parent; register unsigned long * child; for (top = w; XtParent(top) != NULL; top = XtParent(top)) {} parent = NULL; child = info->ids; count = 0; while (TRUE) { if (!IsChild(top, parent, (Widget) *child)) return(XtNewString("This widget no longer exists in the client.")); if (++count == info->num_widgets) break; parent = (Widget) *child++; } info->real_widget = (Widget) *child; return(NULL); } /************************************************************ * * Code to Perform SetValues operations. * ************************************************************/ /* Function Name: DoSetValues * Description: performs the setvalues requested. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL. */ static char * DoSetValues(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { char * str; register unsigned i; unsigned short count = 0; SetValuesEvent * sv_event = (SetValuesEvent *) event; _XEditResPut16(stream, count); /* insert 0, will be overwritten later. */ for (i = 0 ; i < sv_event->num_entries; i++) { if ((str = VerifyWidget(w, &(sv_event->widgets[i]))) != NULL) { _XEditResPutWidgetInfo(stream, &(sv_event->widgets[i])); _XEditResPutString8(stream, str); XtFree(str); count++; } else ExecuteSetValues(sv_event->widgets[i].real_widget, sv_event, sv_event->widgets + i, stream, &count); } /* * Overwrite the first 2 bytes with the real count. */ *(stream->top) = count >> XER_NBBY; *(stream->top + 1) = count; return(NULL); } /* Function Name: HandleToolkitErrors * Description: Handles X Toolkit Errors. * Arguments: name - name of the error. * type - type of the error. * class - class of the error. * msg - the default message. * params, num_params - the extra parameters for this message. * Returns: none. */ /* ARGSUSED */ static void HandleToolkitErrors(name, type, class, msg, params, num_params) String name, type, class, msg, *params; Cardinal * num_params; { SVErrorInfo * info = &globals.error_info; char buf[BUFSIZ]; if ( streq(name, "unknownType") ) sprintf(buf, "The `%s' resource is not used by this widget.", info->event->name); else if ( streq(name, "noColormap") ) sprintf(buf, msg, params[0]); else if (streq(name, "conversionFailed") || streq(name, "conversionError")) { if (streq(info->event->value, XtRString)) sprintf(buf, "Could not convert the string '%s' for the `%s' resource.", (char*)info->event->value, info->event->name); else sprintf(buf, "Could not convert the `%s' resource.", info->event->name); } else sprintf(buf, "Name: %s, Type: %s, Class: %s, Msg: %s", name, type, class, msg); /* * Insert this info into the protocol stream, and update the count. */ (*(info->count))++; _XEditResPutWidgetInfo(info->stream, info->entry); _XEditResPutString8(info->stream, buf); } /* Function Name: ExecuteSetValues * Description: Performs a setvalues for a given command. * Arguments: w - the widget to perform the set_values on. * sv_event - the set values event. * sv_info - the set_value info. * Returns: none. */ static void ExecuteSetValues(w, sv_event, entry, stream, count) Widget w; SetValuesEvent * sv_event; WidgetInfo * entry; ProtocolStream * stream; unsigned short * count; { XtErrorMsgHandler old; SVErrorInfo * info = &globals.error_info; info->event = sv_event; /* No data can be passed to */ info->stream = stream; /* an error handler, so we */ info->count = count; /* have to use a global, YUCK... */ info->entry = entry; old = XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), HandleToolkitErrors); XtVaSetValues(w, XtVaTypedArg, sv_event->name, sv_event->res_type, sv_event->value, sv_event->value_len, NULL); (void)XtAppSetWarningMsgHandler(XtWidgetToApplicationContext(w), old); } /************************************************************ * * Code for Creating and dumping widget tree. * ************************************************************/ /* Function Name: DumpWidgets * Description: Given a widget it builds a protocol packet * containing the entire widget heirarchy. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL */ /* ARGSUSED */ static char * DumpWidgets(w, event, stream) Widget w; EditresEvent * event; /* UNUSED */ ProtocolStream * stream; { unsigned short count = 0; /* Find Tree's root. */ for ( ; XtParent(w) != NULL; w = XtParent(w)) {} /* * hold space for count, overwritten later. */ _XEditResPut16(stream, (unsigned int) 0); DumpChildren(w, stream, &count); /* * Overwrite the first 2 bytes with the real count. */ *(stream->top) = count >> XER_NBBY; *(stream->top + 1) = count; return(NULL); } /* Function Name: DumpChildren * Description: Adds a child's name to the list. * Arguments: w - the widget to dump. * stream - the stream to dump to. * count - number of dumps we have performed. * Returns: none. */ /* This is a trick/kludge. To make shared libraries happier (linking * against Xmu but not linking against Xt, and apparently even work * as we desire on SVR4, we need to avoid an explicit data reference * to applicationShellWidgetClass. XtIsTopLevelShell is known * (implementation dependent assumption!) to use a bit flag. So we * go that far. Then, we test whether it is an applicationShellWidget * class by looking for an explicit class name. Seems pretty safe. */ static Bool isApplicationShell(w) Widget w; { register WidgetClass c; if (!XtIsTopLevelShell(w)) return False; for (c = XtClass(w); c; c = c->core_class.superclass) { if (!strcmp(c->core_class.class_name, "ApplicationShell")) return True; } return False; } static void DumpChildren(w, stream, count) Widget w; ProtocolStream * stream; unsigned short *count; { int i, num_children; Widget *children; unsigned long window; char * class; (*count)++; InsertWidget(stream, w); /* Insert the widget into the stream. */ _XEditResPutString8(stream, XtName(w)); /* Insert name */ if (isApplicationShell(w)) class = ((ApplicationShellWidget) w)->application.class; else class = XtClass(w)->core_class.class_name; _XEditResPutString8(stream, class); /* Insert class */ if (XtIsWidget(w)) if (XtIsRealized(w)) window = XtWindow(w); else window = EDITRES_IS_UNREALIZED; else window = EDITRES_IS_OBJECT; _XEditResPut32(stream, window); /* Insert window id. */ /* * Find children and recurse. */ num_children = FindChildren(w, &children, TRUE, TRUE); for (i = 0; i < num_children; i++) DumpChildren(children[i], stream, count); XtFree((char *)children); } /************************************************************ * * Code for getting the geometry of widgets. * ************************************************************/ /* Function Name: DoGetGeometry * Description: retrieves the Geometry of each specified widget. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL */ static char * DoGetGeometry(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { unsigned i; char * str; GetGeomEvent * geom_event = (GetGeomEvent *) event; _XEditResPut16(stream, geom_event->num_entries); for (i = 0 ; i < geom_event->num_entries; i++) { /* * Send out the widget id. */ _XEditResPutWidgetInfo(stream, &(geom_event->widgets[i])); if ((str = VerifyWidget(w, &(geom_event->widgets[i]))) != NULL) { _XEditResPutBool(stream, True); /* an error occured. */ _XEditResPutString8(stream, str); /* set message. */ XtFree(str); } else ExecuteGetGeometry(geom_event->widgets[i].real_widget, stream); } return(NULL); } /* Function Name: ExecuteGetGeometry * Description: Gets the geometry for each widget specified. * Arguments: w - the widget to get geom on. * stream - stream to append to. * Returns: True if no error occured. */ static void ExecuteGetGeometry(w, stream) Widget w; ProtocolStream * stream; { int i; Boolean mapped_when_man; Dimension width, height, border_width; Arg args[8]; Cardinal num_args = 0; Position x, y; if ( !XtIsRectObj(w) || (XtIsWidget(w) && !XtIsRealized(w)) ) { _XEditResPutBool(stream, False); /* no error. */ _XEditResPutBool(stream, False); /* not visable. */ for (i = 0; i < 5; i++) /* fill in extra space with 0's. */ _XEditResPut16(stream, 0); return; } XtSetArg(args[num_args], XtNwidth, &width); num_args++; XtSetArg(args[num_args], XtNheight, &height); num_args++; XtSetArg(args[num_args], XtNborderWidth, &border_width); num_args++; XtSetArg(args[num_args], XtNmappedWhenManaged, &mapped_when_man); num_args++; XtGetValues(w, args, num_args); if (!(XtIsManaged(w) && mapped_when_man) && XtIsWidget(w)) { XWindowAttributes attrs; /* * The toolkit does not maintain mapping state, we have * to go to the server. */ if (XGetWindowAttributes(XtDisplay(w), XtWindow(w), &attrs) != 0) { if (attrs.map_state != IsViewable) { _XEditResPutBool(stream, False); /* no error. */ _XEditResPutBool(stream, False); /* not visable. */ for (i = 0; i < 5; i++) /* fill in extra space with 0's. */ _XEditResPut16(stream, 0); return; } } else { _XEditResPut8(stream, True); /* Error occured. */ _XEditResPutString8(stream, "XGetWindowAttributes failed."); return; } } XtTranslateCoords(w, -((int) border_width), -((int) border_width), &x, &y); _XEditResPutBool(stream, False); /* no error. */ _XEditResPutBool(stream, True); /* Visable. */ _XEditResPut16(stream, x); _XEditResPut16(stream, y); _XEditResPut16(stream, width); _XEditResPut16(stream, height); _XEditResPut16(stream, border_width); } /************************************************************ * * Code for executing FindChild. * ************************************************************/ /* Function Name: PositionInChild * Description: returns true if this location is in the child. * Arguments: child - the child widget to check. * x, y - location of point to check in the parent's * coord space. * Returns: TRUE if the position is in this child. */ static Boolean PositionInChild(child, x, y) Widget child; int x, y; { Arg args[6]; Cardinal num; Dimension width, height, border_width; Position child_x, child_y; Boolean mapped_when_managed; if (!XtIsRectObj(child)) /* we must at least be a rect obj. */ return(FALSE); num = 0; XtSetArg(args[num], XtNmappedWhenManaged, &mapped_when_managed); num++; XtSetArg(args[num], XtNwidth, &width); num++; XtSetArg(args[num], XtNheight, &height); num++; XtSetArg(args[num], XtNx, &child_x); num++; XtSetArg(args[num], XtNy, &child_y); num++; XtSetArg(args[num], XtNborderWidth, &border_width); num++; XtGetValues(child, args, num); /* * The only way we will know of the widget is mapped is to see if * mapped when managed is True and this is a managed child. Otherwise * we will have to ask the server if this window is mapped. */ if (XtIsWidget(child) && !(mapped_when_managed && XtIsManaged(child)) ) { XWindowAttributes attrs; if (XGetWindowAttributes(XtDisplay(child), XtWindow(child), &attrs) != 0) { /* oops */ } else if (attrs.map_state != IsViewable) return(FALSE); } return (x >= child_x) && (x <= (child_x + (Position)width + 2 * (Position)border_width)) && (y >= child_y) && (y <= (child_y + (Position)height + 2 * (Position)border_width)); } /* Function Name: _FindChild * Description: Finds the child that actually contatians the point shown. * Arguments: parent - a widget that is known to contain the point * specified. * x, y - The point in coordinates relative to the * widget specified. * Returns: none. */ static Widget _FindChild(parent, x, y) Widget parent; int x, y; { Widget * children; int i = FindChildren(parent, &children, TRUE, FALSE); while (i > 0) { i--; if (PositionInChild(children[i], x, y)) { Widget child = children[i]; XtFree((char *)children); return(_FindChild(child, x - child->core.x, y - child->core.y)); } } XtFree((char *)children); return(parent); } /* Function Name: DoFindChild * Description: finds the child that contains the location specified. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: an allocated error message if something went horribly * wrong and no set values were performed, else NULL. */ static char * DoFindChild(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { char * str; Widget parent, child; Position parent_x, parent_y; FindChildEvent * find_event = (FindChildEvent *) event; if ((str = VerifyWidget(w, find_event->widgets)) != NULL) return(str); parent = find_event->widgets->real_widget; XtTranslateCoords(parent, (Position) 0, (Position) 0, &parent_x, &parent_y); child = _FindChild(parent, find_event->x - (int) parent_x, find_event->y - (int) parent_y); InsertWidget(stream, child); return(NULL); } /************************************************************ * * Procedures for performing GetResources. * ************************************************************/ /* Function Name: DoGetResources * Description: Gets the Resources associated with the widgets passed. * Arguments: w - a widget in the tree. * event - the event that caused this action. * stream - the protocol stream to add. * Returns: NULL */ static char * DoGetResources(w, event, stream) Widget w; EditresEvent * event; ProtocolStream * stream; { unsigned int i; char * str; GetResEvent * res_event = (GetResEvent *) event; _XEditResPut16(stream, res_event->num_entries); /* number of replys */ for (i = 0 ; i < res_event->num_entries; i++) { /* * Send out the widget id. */ _XEditResPutWidgetInfo(stream, &(res_event->widgets[i])); if ((str = VerifyWidget(w, &(res_event->widgets[i]))) != NULL) { _XEditResPutBool(stream, True); /* an error occured. */ _XEditResPutString8(stream, str); /* set message. */ XtFree(str); } else { _XEditResPutBool(stream, False); /* no error occured. */ ExecuteGetResources(res_event->widgets[i].real_widget, stream); } } return(NULL); } /* Function Name: ExecuteGetResources. * Description: Gets the resources for any individual widget. * Arguments: w - the widget to get resources on. * stream - the protocol stream. * Returns: none. */ static void ExecuteGetResources(w, stream) Widget w; ProtocolStream * stream; { XtResourceList norm_list, cons_list; Cardinal num_norm, num_cons; register int i; /* * Get Normal Resources. */ XtGetResourceList(XtClass(w), &norm_list, &num_norm); if (XtParent(w) != NULL) XtGetConstraintResourceList(XtClass(XtParent(w)),&cons_list,&num_cons); else num_cons = 0; _XEditResPut16(stream, num_norm + num_cons); /* how many resources. */ /* * Insert all the normal resources. */ for ( i = 0; i < (int) num_norm; i++) { _XEditResPutResourceType(stream, NormalResource); _XEditResPutString8(stream, norm_list[i].resource_name); _XEditResPutString8(stream, norm_list[i].resource_class); _XEditResPutString8(stream, norm_list[i].resource_type); } XtFree((char *) norm_list); /* * Insert all the constraint resources. */ if (num_cons > 0) { for ( i = 0; i < (int) num_cons; i++) { _XEditResPutResourceType(stream, ConstraintResource); _XEditResPutString8(stream, cons_list[i].resource_name); _XEditResPutString8(stream, cons_list[i].resource_class); _XEditResPutString8(stream, cons_list[i].resource_type); } XtFree((char *) cons_list); } } /************************************************************ * * Code for inserting values into the protocol stream. * ************************************************************/ /* Function Name: InsertWidget * Description: Inserts the full parent heirarchy of this * widget into the protocol stream as a widget list. * Arguments: stream - the protocol stream. * w - the widget to insert. * Returns: none */ static void InsertWidget(stream, w) ProtocolStream * stream; Widget w; { Widget temp; unsigned long * widget_list; register int i, num_widgets; for (temp = w, i = 0; temp != 0; temp = XtParent(temp), i++) {} num_widgets = i; widget_list = (unsigned long *) XtMalloc(sizeof(unsigned long) * num_widgets); /* * Put the widgets into the list. * make sure that they are inserted in the list from parent -> child. */ for (i--, temp = w; temp != NULL; temp = XtParent(temp), i--) widget_list[i] = (unsigned long) temp; _XEditResPut16(stream, num_widgets); /* insert number of widgets. */ for (i = 0; i < num_widgets; i++) /* insert Widgets themselves. */ _XEditResPut32(stream, widget_list[i]); XtFree((char *)widget_list); } /************************************************************ * * All of the following routines are public. * ************************************************************/ /* Function Name: _XEditResPutString8 * Description: Inserts a string into the protocol stream. * Arguments: stream - stream to insert string into. * str - string to insert. * Returns: none. */ static void _XEditResPutString8(stream, str) ProtocolStream * stream; char * str; { int i, len = strlen(str); _XEditResPut16(stream, len); for (i = 0 ; i < len ; i++, str++) _XEditResPut8(stream, *str); } /* Function Name: _XEditResPut8 * Description: Inserts an 8 bit integer into the protocol stream. * Arguments: stream - stream to insert string into. * value - value to insert. * Returns: none */ static void _XEditResPut8(stream, value) ProtocolStream * stream; unsigned int value; { unsigned char temp; if (stream->size >= stream->alloc) { stream->alloc += 100; stream->real_top = (unsigned char *) XtRealloc( (char *)stream->real_top, stream->alloc + HEADER_SIZE); stream->top = stream->real_top + HEADER_SIZE; stream->current = stream->top + stream->size; } temp = (unsigned char) (value & BYTE_MASK); *((stream->current)++) = temp; (stream->size)++; } /* Function Name: _XEditResPut16 * Description: Inserts a 16 bit integer into the protocol stream. * Arguments: stream - stream to insert string into. * value - value to insert. * Returns: void */ static void _XEditResPut16(stream, value) ProtocolStream * stream; unsigned int value; { _XEditResPut8(stream, (value >> XER_NBBY) & BYTE_MASK); _XEditResPut8(stream, value & BYTE_MASK); } /* Function Name: _XEditResPut32 * Description: Inserts a 32 bit integer into the protocol stream. * Arguments: stream - stream to insert string into. * value - value to insert. * Returns: void */ static void _XEditResPut32(stream, value) ProtocolStream * stream; unsigned long value; { int i; for (i = 3; i >= 0; i--) _XEditResPut8(stream, (value >> (XER_NBBY*i)) & BYTE_MASK); } /* Function Name: _XEditResPutWidgetInfo * Description: Inserts the widget info into the protocol stream. * Arguments: stream - stream to insert widget info into. * info - info to insert. * Returns: none */ static void _XEditResPutWidgetInfo(stream, info) ProtocolStream * stream; WidgetInfo * info; { unsigned int i; _XEditResPut16(stream, info->num_widgets); for (i = 0; i < info->num_widgets; i++) _XEditResPut32(stream, info->ids[i]); } /************************************************************ * * Code for retrieving values from the protocol stream. * ************************************************************/ /* Function Name: _XEditResResetStream * Description: resets the protocol stream * Arguments: stream - the stream to reset. * Returns: none. */ static void _XEditResResetStream(stream) ProtocolStream * stream; { stream->current = stream->top; stream->size = 0; if (stream->real_top == NULL) { stream->real_top = (unsigned char *) XtRealloc( (char *)stream->real_top, stream->alloc + HEADER_SIZE); stream->top = stream->real_top + HEADER_SIZE; stream->current = stream->top + stream->size; } } /* * NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE * * The only modified field if the "current" field. * * The only fields that must be set correctly are the "current", "top" * and "size" fields. */ /* Function Name: _XEditResGetg8 * Description: Retrieves an unsigned 8 bit value * from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ static Boolean _XEditResGet8(stream, val) ProtocolStream * stream; unsigned char * val; { if (stream->size < (stream->current - stream->top)) return(FALSE); *val = *((stream->current)++); return(TRUE); } /* Function Name: _XEditResGet16 * Description: Retrieves an unsigned 16 bit value * from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ static Boolean _XEditResGet16(stream, val) ProtocolStream * stream; unsigned short * val; { unsigned char temp1, temp2; if ( !(_XEditResGet8(stream, &temp1) && _XEditResGet8(stream, &temp2)) ) return(FALSE); *val = (((unsigned short) temp1 << XER_NBBY) + ((unsigned short) temp2)); return(TRUE); } /* Function Name: _XEditResGetSigned16 * Description: Retrieves an signed 16 bit value from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ static Boolean _XEditResGetSigned16(stream, val) ProtocolStream * stream; short * val; { unsigned char temp1, temp2; if ( !(_XEditResGet8(stream, &temp1) && _XEditResGet8(stream, &temp2)) ) return(FALSE); if (temp1 & (1 << (XER_NBBY - 1))) { /* If the sign bit is active. */ *val = -1; /* store all 1's */ *val &= (temp1 << XER_NBBY); /* Now and in the MSB */ *val &= temp2; /* and LSB */ } else *val = (((unsigned short) temp1 << XER_NBBY) + ((unsigned short) temp2)); return(TRUE); } /* Function Name: _XEditResGet32 * Description: Retrieves an unsigned 32 bit value * from the protocol stream. * Arguments: stream. * val - a pointer to value to return. * Returns: TRUE if sucessful. */ static Boolean _XEditResGet32(stream, val) ProtocolStream * stream; unsigned long * val; { unsigned short temp1, temp2; if ( !(_XEditResGet16(stream, &temp1) && _XEditResGet16(stream, &temp2)) ) return(FALSE); *val = (((unsigned short) temp1 << (XER_NBBY * 2)) + ((unsigned short) temp2)); return(TRUE); } /* Function Name: _XEditResGetString8 * Description: Retrieves an 8 bit string value from the protocol stream. * Arguments: stream - the protocol stream * str - the string to retrieve. * Returns: True if retrieval was successful. */ static Boolean _XEditResGetString8(stream, str) ProtocolStream * stream; char ** str; { unsigned short len; register unsigned i; if (!_XEditResGet16(stream, &len)) { return(FALSE); } *str = XtMalloc(sizeof(char) * (len + 1)); for (i = 0; i < len; i++) { if (!_XEditResGet8(stream, (unsigned char *) *str + i)) { XtFree(*str); *str = NULL; return(FALSE); } } (*str)[i] = '\0'; /* NULL terminate that sucker. */ return(TRUE); } /* Function Name: _XEditResGetWidgetInfo * Description: Retrieves the list of widgets that follow and stores * them in the widget info structure provided. * Arguments: stream - the protocol stream * info - the widget info struct to store into. * Returns: True if retrieval was successful. */ static Boolean _XEditResGetWidgetInfo(stream, info) ProtocolStream * stream; WidgetInfo * info; { unsigned int i; if (!_XEditResGet16(stream, &(info->num_widgets))) return(FALSE); info->ids = (unsigned long *) XtMalloc(sizeof(long) * (info->num_widgets)); for (i = 0; i < info->num_widgets; i++) { if (!_XEditResGet32(stream, info->ids + i)) { XtFree((char *)info->ids); info->ids = NULL; return(FALSE); } } return(TRUE); } /************************************************************ * * Code for Loading the EditresBlock resource. * ************************************************************/ /* Function Name: CvStringToBlock * Description: Converts a string to an editres block value. * Arguments: dpy - the display. * args, num_args - **UNUSED ** * from_val, to_val - value to convert, and where to put result * converter_data - ** UNUSED ** * Returns: TRUE if conversion was sucessful. */ /* ARGSUSED */ static Boolean CvtStringToBlock(dpy, args, num_args, from_val, to_val, converter_data) Display * dpy; XrmValue * args; Cardinal * num_args; XrmValue * from_val, * to_val; XtPointer * converter_data; { char ptr[BUFSIZ]; ptr[0]='\0'; static EditresBlock block; /* XmuCopyISOLatin1Lowered(ptr, from_val->addr);*/ if (streq(ptr, "none")) block = BlockNone; else if (streq(ptr, "setvalues")) block = BlockSetValues; else if (streq(ptr, "all")) block = BlockAll; else { Cardinal num_params = 1; String params[1]; params[0] = from_val->addr; XtAppWarningMsg(XtDisplayToApplicationContext(dpy), "CvtStringToBlock", "unknownValue", "EditresError", "Could not convert string \"%s\" to EditresBlock.", params, &num_params); return(FALSE); } if (to_val->addr != NULL) { if (to_val->size < sizeof(EditresBlock)) { to_val->size = sizeof(EditresBlock); return(FALSE); } *(EditresBlock *)(to_val->addr) = block; } else to_val->addr = (XtPointer) block; to_val->size = sizeof(EditresBlock); return(TRUE); } #define XtREditresBlock ("EditresBlock") /* Function Name: LoadResources * Description: Loads a global resource the determines of this * application should allow Editres requests. * Arguments: w - any widget in the tree. * Returns: none. */ static void LoadResources(w) Widget w; { static XtResource resources[] = { {"editresBlock", "EditresBlock", XtREditresBlock, sizeof(EditresBlock), XtOffsetOf(Globals, block), XtRImmediate, (XtPointer) BlockNone} }; for (; XtParent(w) != NULL; w = XtParent(w)) {} XtAppSetTypeConverter(XtWidgetToApplicationContext(w), XtRString, XtREditresBlock, CvtStringToBlock, NULL, (Cardinal) 0, XtCacheAll, NULL); XtGetApplicationResources( w, (caddr_t) &globals, resources, XtNumber(resources), NULL, (Cardinal) 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/AdjView.h�����������������������������������������������������������������0000644�0001750�0001750�00000002661�12672140200�013671� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: AdjView.h /main/5 1995/07/15 20:43:23 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _XmdAdjView_h #define _XmdAdjView_h #include <Xm/Xm.h> /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif extern void XmdSWAdjustView(Widget sw); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _XmdAdjView_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ �������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/Print.c�������������������������������������������������������������������0000644�0001750�0001750�00000070671�13066310437�013446� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Print.c /main/5 1995/07/15 20:43:49 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmP.h> #include <Xm/ToggleB.h> #include <Xm/ToggleBG.h> #include <Xm/TextF.h> #include <Xm/LabelG.h> #include <Xm/PushBG.h> #include <Xm/SeparatoG.h> #include <Xm/RowColumn.h> #include <Xm/MessageB.h> #include <Xm/SelectioB.h> #include "PrintP.h" #include <stdlib.h> #include <ctype.h> #define MAX(x,y) ((x) > (y) ? (x) : (y)) /* Declare static functions. */ static void Initialize( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void Destroy( Widget wid) ; static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void process_printer_list(Widget); static void from_all_change_cb(Widget toggle, XtPointer parent, XmToggleButtonCallbackStruct *cb); static void numeric_only_cb(Widget textf, XtPointer, XmTextVerifyCallbackStruct *cb); static void do_print_cb(Widget, Widget, XtPointer); static void do_help_cb(Widget, Widget, XtPointer); static void unmanage_cb(Widget, Widget, XtPointer); static void post_add_printer(Widget, Widget, XmPushButtonCallbackStruct *cb); static void post_add_pathname(Widget, Widget, XmPushButtonCallbackStruct *cb); static void add_printer_cb(Widget, XtPointer, XmSelectionBoxCallbackStruct *cb); static void cancel_printer_cb(Widget, XtPointer, XmSelectionBoxCallbackStruct *cb); /* No translations and no actions. */ /* Define the resources for the XmdPrint widget. */ static XtResource resources[] = { { XmdNprinterList, XmdCPrinterList, XmRString, sizeof(String), XtOffsetOf( XmdPrintRec, print.printer_list ), XmRImmediate, (XtPointer) NULL }, { XmdNtwoSided, XmdCTwoSided, XmRBoolean, sizeof(Boolean), XtOffsetOf( XmdPrintRec, print.two_sided ), XmRImmediate, (XtPointer) False }, { XmdNreverseOrder, XmdCReverseOrder, XmRBoolean, sizeof(Boolean), XtOffsetOf( XmdPrintRec, print.reverse_order ), XmRImmediate, (XtPointer) False }, { XmdNfromPage, XmdCFromPage, XmRInt, sizeof(int), XtOffsetOf( XmdPrintRec, print.from_page ), XmRImmediate, (XtPointer) 0 }, { XmdNtoPage, XmdCToPage, XmRInt, sizeof(int), XtOffsetOf( XmdPrintRec, print.to_page ), XmRImmediate, (XtPointer) 0 }, { XmdNprintAll, XmdCPrintAll, XmRBoolean, sizeof(Boolean), XtOffsetOf( XmdPrintRec, print.print_all ), XmRImmediate, (XtPointer) True }, { XmdNnumberOfCopies, XmdCNumberOfCopies, XmRInt, sizeof(int), XtOffsetOf( XmdPrintRec, print.number_of_copies ), XmRImmediate, (XtPointer) 1 }, { XmdNprintCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( XmdPrintRec, print.print_callback ), XmRPointer, (XtPointer) NULL } }; /* Define the widget class record. See Chapter 4 of the "OSF/Motif Widget Writer's Guide" for details. */ externaldef(Xmdprintclassrec) XmdPrintClassRec xmdPrintClassRec = { { /* Here is the Core class record. */ /* superclass */ (WidgetClass) &xmFormClassRec, /* class_name */ "XmdPrint", /* widget_size */ sizeof(XmdPrintRec), /* class_initialize */ NULL, /* class_part_initialize */ NULL, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ XtInheritResize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* Here is the Composite class record. */ /* geometry_manager */ XtInheritGeometryManager, /* change_managed */ XtInheritChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* Here is the Constaint class record. */ /* constraint_resources */ NULL, /* constraint_num_resources */ 0, /* constraint_size */ sizeof(XmdPrintConstraintRec), /* constraint_initialize */ NULL, /* constraint_destroy */ NULL, /* constraint_set_values */ NULL, /* extension */ NULL, }, { /* Here is the XmManager class record. */ /* translations */ XtInheritTranslations, /* syn_resources */ NULL, /* num_syn_resources */ 0, /* syn_constraint_resources */ NULL, /* num_syn_constraint_resources */ 0, /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* bulletin_board_class fields */ FALSE, /* always_install_accelerators */ (XmGeoCreateProc)NULL, /* geo_matrix_create */ XmInheritFocusMovedProc, /* focus_moved_proc */ NULL, /* extension */ }, { /* form_class fields */ (XtPointer) NULL, /* extension */ }, { /* Here is the XmdPrint class record. */ (XtPointer) NULL, /* extension */ } }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef(Xmdprintwidgetclass) WidgetClass xmdPrintWidgetClass = (WidgetClass) &xmdPrintClassRec; /************************************************************************** * * Initialize: * Called when this widget is first instantiated. * ***************************************************************************/ static void Initialize(Widget request_w, Widget new_w, ArgList p_args, Cardinal *num_args) { XmdPrintWidget rw = (XmdPrintWidget) request_w; XmdPrintWidget nw = (XmdPrintWidget) new_w; Arg args[20]; int n, i; Widget tmp; Widget rc_tmp, rc_tmp2; Widget printb, cancelb, helpb, sep; XmString str, str2; char buf[20]; /* Initialize internal fields */ nw -> print.num_printers = 0; nw -> print.printers = (char**) NULL; nw -> print.is_printer = (Boolean*) NULL; nw -> print.adding_printer = False; nw -> print.num_om_items = 0; nw -> print.om_items = (WidgetList) NULL; /* Create Manager for each line of widgets. This will make them baseline aligned, which is much more attractive */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopOffset, 10); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftOffset, 10); n++; XtSetArg(args[n], XmNspacing, 10); n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg(args[n], XmNpacking, XmPACK_TIGHT); n++; rc_tmp = XmCreateRowColumn(new_w, "rc", args, n); XtManageChild(rc_tmp); /* Create child widgets */ /* Label for Copies */ n = 0; str = XmStringCreateLocalized("Copies"); XtSetArg(args[n], XmNlabelString, str); n++; tmp = XmCreateLabelGadget(rc_tmp, "copies", args, n); XtManageChild(tmp); XmStringFree(str); /* Text Field for # Copies */ n = 0; XtSetArg(args[n], XmNtopOffset, 15); n++; XtSetArg(args[n], XmNcolumns, 3); n++; nw -> print.copies_tf = XmCreateTextField(rc_tmp, "copies_tf", args, n); XtManageChild(nw -> print.copies_tf); XtAddCallback(nw -> print.copies_tf, XmNmodifyVerifyCallback, (XtCallbackProc) numeric_only_cb, NULL); /* Create Manager for each line of widgets. This will make them baseline aligned, which is much more attractive */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNtopWidget, rc_tmp); n++; XtSetArg(args[n], XmNtopOffset, 10); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftOffset, 10); n++; XtSetArg(args[n], XmNspacing, 10); n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg(args[n], XmNpacking, XmPACK_TIGHT); n++; rc_tmp2 = XmCreateRowColumn(new_w, "rc2", args, n); XtManageChild(rc_tmp2); /* Toggle for 2 sided */ n = 0; str = XmStringCreateLocalized("2 sided"); XtSetArg(args[n], XmNlabelString, str); n++; nw -> print.two_sided_toggle = XmCreateToggleButtonGadget(rc_tmp2, "two_sided_toggle", args, n); XtManageChild(nw -> print.two_sided_toggle); XmStringFree(str); /* Toggle for reverse order */ n = 0; str = XmStringCreateLocalized("Reverse Order"); XtSetArg(args[n], XmNlabelString, str); n++; nw -> print.reverse_order_toggle = XmCreateToggleButtonGadget(rc_tmp2, "reverse_order_toggle", args, n); XtManageChild(nw -> print.reverse_order_toggle); XmStringFree(str); /* Manager for all/from order */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNtopWidget, rc_tmp2); n++; XtSetArg(args[n], XmNtopOffset, 10); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftOffset, 10); n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg(args[n], XmNpacking, XmPACK_TIGHT); n++; XtSetArg(args[n], XmNspacing, 10); n++; XtSetArg(args[n], XmNradioBehavior, True); n++; XtSetArg(args[n], XmNradioAlwaysOne, True); n++; nw -> print.from_all_rc = XmCreateRowColumn(new_w, "from_all_rc", args, n); XtManageChild(nw -> print.from_all_rc); /* Toggle for all */ n = 0; str = XmStringCreateLocalized("All"); XtSetArg(args[n], XmNlabelString, str); n++; nw -> print.all_toggle = XmCreateToggleButtonGadget(nw -> print.from_all_rc, "all_toggle", args, n); XtManageChild(nw -> print.all_toggle); XmStringFree(str); /* Toggle for from */ n = 0; str = XmStringCreateLocalized("From"); XtSetArg(args[n], XmNlabelString, str); n++; nw -> print.from_toggle = XmCreateToggleButtonGadget(nw -> print.from_all_rc, "from_toggle", args, n); XtManageChild(nw -> print.from_toggle); XmStringFree(str); /* from text field */ n = 0; XtSetArg(args[n], XmNcolumns, 3); n++; nw -> print.from_tf = XmCreateTextField(nw -> print.from_all_rc, "from_tf", args, n); XtManageChild(nw -> print.from_tf); XtAddCallback(nw -> print.from_tf, XmNmodifyVerifyCallback, (XtCallbackProc) numeric_only_cb, NULL); /* To label */ tmp = XmCreateLabelGadget(nw -> print.from_all_rc, "to", NULL, 0); XtManageChild(tmp); /* to text field */ n = 0; XtSetArg(args[n], XmNcolumns, 3); n++; nw -> print.to_tf = XmCreateTextField(nw -> print.from_all_rc, "to_tf", args, n); XtManageChild(nw -> print.to_tf); XtAddCallback(nw -> print.to_tf, XmNmodifyVerifyCallback, (XtCallbackProc) numeric_only_cb, NULL); /* destination PD */ nw -> print.destination_pd = XmCreatePulldownMenu(new_w, "pd", NULL, 0); /* destination OM */ n = 0; str = XmStringCreateLocalized("Destination:"); XtSetArg(args[n], XmNlabelString, str); n++; XtSetArg(args[n], XmNmnemonic, 'D'); n++; XtSetArg(args[n], XmNsubMenuId, nw -> print.destination_pd); n++; nw -> print.destination_om = XmCreateOptionMenu(rc_tmp, "om", args, n); XtManageChild(nw -> print.destination_om); tmp = XmCreateSeparatorGadget(nw -> print.destination_pd, "sep", NULL, 0); XtManageChild(tmp); /* New printer or pathname dialog */ n = 0; str = XmStringCreateLocalized("Enter a new value"); str2 = XmStringCreateLocalized("Add"); XtSetArg(args[n], XmNselectionLabelString, str); n++; XtSetArg(args[n], XmNokLabelString, str2); n++; nw -> print.new_printer_dialog = XmCreatePromptDialog(new_w, "QueryDestination", args, n); XmStringFree(str); XmStringFree(str2); XtAddCallback(nw -> print.new_printer_dialog, XmNokCallback, (XtCallbackProc) add_printer_cb, (XtPointer) new_w); XtAddCallback(nw -> print.new_printer_dialog, XmNcancelCallback, (XtCallbackProc) cancel_printer_cb, (XtPointer) new_w); tmp = XmCreatePushButtonGadget(nw -> print.destination_pd, "Other Printer...", NULL, 0); XtManageChild(tmp); XtAddCallback(tmp, XmNactivateCallback, (XtCallbackProc) post_add_printer, (XtPointer) new_w); tmp = XmCreatePushButtonGadget(nw -> print.destination_pd, "Other File...", NULL, 0); XtManageChild(tmp); XtAddCallback(tmp, XmNactivateCallback, (XtCallbackProc) post_add_pathname, (XtPointer) new_w); process_printer_list(new_w); XtAddCallback(nw -> print.all_toggle, XmNvalueChangedCallback, (XtCallbackProc) from_all_change_cb, (XtPointer) new_w); /* Setup Dialog buttons */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopOffset, 2); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNleftWidget, rc_tmp); n++; XtSetArg(args[n], XmNleftOffset, 5); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomOffset, 2); n++; XtSetArg(args[n], XmNorientation, XmVERTICAL); n++; sep = XmCreateSeparatorGadget(new_w, "sep", args, n); XtManageChild(sep); /* Create Manager for dialog buttons. These buttons are stacked at the right edge of the dialog */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopOffset, 10); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNleftWidget, sep); n++; XtSetArg(args[n], XmNleftOffset, 5); n++; XtSetArg(args[n], XmNrightOffset, 10); n++; XtSetArg(args[n], XmNspacing, 10); n++; XtSetArg(args[n], XmNorientation, XmVERTICAL); n++; rc_tmp2 = XmCreateRowColumn(new_w, "rc_buttons", args, n); XtManageChild(rc_tmp2); n = 0; XtSetArg(args[n], XmNmarginWidth, 20); n++; printb = XmCreatePushButtonGadget(rc_tmp2, "Print", args, n); XtAddCallback(printb, XmNactivateCallback, (XtCallbackProc) do_print_cb, (XtPointer) new_w); XtManageChild(printb); cancelb = XmCreatePushButtonGadget(rc_tmp2, "Cancel", args, n); XtAddCallback(cancelb, XmNactivateCallback, (XtCallbackProc) unmanage_cb, (XtPointer) new_w); XtManageChild(cancelb); helpb = XmCreatePushButtonGadget(rc_tmp2, "Help", args, n); XtAddCallback(helpb, XmNactivateCallback, (XtCallbackProc) do_help_cb, (XtPointer) new_w); XtManageChild(helpb); /* Setup ParentProcess information */ XtVaSetValues(new_w, XmNdefaultButton, printb, XmNcancelButton, cancelb, NULL, NULL); /* Process initial values */ if (nw -> print.print_all) { XmToggleButtonGadgetSetState(nw -> print.all_toggle, True, True); } else { XmToggleButtonGadgetSetState(nw -> print.all_toggle, False, True); } sprintf(buf, "%d", nw -> print.from_page); XmTextFieldSetString(nw -> print.from_tf, buf); sprintf(buf, "%d", nw -> print.to_page); XmTextFieldSetString(nw -> print.to_tf, buf); sprintf(buf, "%d", nw -> print.number_of_copies); XmTextFieldSetString(nw -> print.copies_tf, buf); XmToggleButtonGadgetSetState(nw -> print.two_sided_toggle, nw -> print.two_sided, False); XmToggleButtonGadgetSetState(nw -> print.reverse_order_toggle, nw -> print.reverse_order, False); } /**************************************************************************** * * Destroy: * Called when the widget is destroyed. * ****************************************************************************/ static void Destroy( Widget wid ) { XmdPrintWidget print = (XmdPrintWidget) wid; char** strings; int count; int i; strings = print -> print.printers; count = print -> print.num_printers; /* Cleanup internal allocations */ for(i = 0; i < count; i++) XtFree(strings[i]); XtFree((char*) print -> print.printers); XtFree((char*) print -> print.is_printer); XtFree((char*) print -> print.om_items); } /***************************************************************************** * * SetValues: * Called by the Intrinsics whenever any of the resource values change. * ****************************************************************************/ static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { XmdPrintWidget cw = (XmdPrintWidget)old_w; XmdPrintWidget rw = (XmdPrintWidget)request_w; XmdPrintWidget nw = (XmdPrintWidget)new_w; char buf[32]; process_printer_list(new_w); if (nw -> print.print_all != cw -> print.print_all) { if (nw -> print.print_all) { XmToggleButtonGadgetSetState(nw -> print.all_toggle, True, False); XtSetSensitive(nw -> print.from_tf, False); XtSetSensitive(nw -> print.to_tf, False); } else { XmToggleButtonGadgetSetState(nw -> print.from_toggle, True, False); } } if (nw -> print.from_page != cw -> print.from_page) { sprintf(buf, "%d", nw -> print.from_page); XmTextFieldSetString(nw -> print.from_tf, buf); } if (nw -> print.to_page != cw -> print.to_page) { sprintf(buf, "%d", nw -> print.to_page); XmTextFieldSetString(nw -> print.to_tf, buf); } if (nw -> print.number_of_copies != cw -> print.number_of_copies) { sprintf(buf, "%d", nw -> print.number_of_copies); XmTextFieldSetString(nw -> print.copies_tf, buf); } if (nw -> print.two_sided != cw -> print.two_sided) XmToggleButtonGadgetSetState(nw -> print.two_sided_toggle, nw -> print.two_sided, False); if (nw -> print.reverse_order != cw -> print.reverse_order) XmToggleButtonGadgetSetState(nw -> print.reverse_order_toggle, nw -> print.reverse_order, False); return(False); } static void process_printer_list(Widget w) { XmdPrintWidget pw = (XmdPrintWidget)w; char *str = pw -> print.printer_list; char c; int n; int count; Boolean is_path; char buf[128]; /* Clear up old printers (if any) */ XtUnmanageChildren(pw -> print.om_items, pw -> print.num_om_items); for(n = 0; n < pw -> print.num_printers; n++) XtFree((char*) pw -> print.printers[n]); pw -> print.num_printers = 0; if (str == NULL) return; /* List of printers is separated with commas or whitespace */ n = 0; while(str[n] != 0) { /* skip whitespace and punctuation */ while((c = str[n]) != 0 && (isspace(c) || ispunct(c))) n++; /* gather characters until whitespace or comma seen */ count = 0; is_path = False; while((c = str[n]) != 0 && ! (isspace(c) || c == ',')) { if (c == '/' || c == '~' || c == '.') is_path = True; buf[count++] = c; n++; } /* Terminate with 0 */ buf[count++] = 0; /* Make sure printer lists are big enough */ pw -> print.printers = (char**) XtRealloc((char*) pw -> print.printers, sizeof(char*) * pw -> print.num_printers + 1); pw -> print.is_printer = (Boolean*) XtRealloc((char*) pw -> print.is_printer, sizeof(Boolean) * pw -> print.num_printers + 1); pw -> print.printers[pw -> print.num_printers] = XtNewString(buf); pw -> print.is_printer[pw -> print.num_printers] = ! is_path; pw -> print.num_printers++; } /* Process list of printers. Make sure widget array is big enough for files and printers */ if (pw -> print.num_printers > pw -> print.num_om_items) { n = pw -> print.num_om_items; pw -> print.num_om_items = pw -> print.num_printers; pw -> print.om_items = (WidgetList) XtRealloc((char*) pw -> print.om_items, sizeof(Widget) * pw -> print.num_om_items); /* zero out new ones */ while(n < pw -> print.num_om_items) pw -> print.om_items[n++] = (Widget) 0; } /* Now put new strings in */ for(count = 0; count < pw -> print.num_printers; count++) { XmString str; str = XmStringCreateLocalized(pw -> print.printers[count]); if (pw -> print.om_items[count] != (Widget) 0) XtVaSetValues(pw -> print.om_items[count], XmNlabelString, str, NULL, NULL); else { Arg args[2]; XtSetArg(args[0], XmNlabelString, str); pw -> print.om_items[count] = XmCreatePushButtonGadget(pw -> print.destination_pd, "button", args, 1); } XtManageChild(pw -> print.om_items[count]); XmStringFree(str); } /* Fix the position of the widgets in the list */ for(n = pw -> print.num_om_items; n > 0; n--) XtVaSetValues(pw -> print.om_items[n - 1], XmNpositionIndex, 0, NULL, NULL); } static void from_all_change_cb(Widget toggle, XtPointer parent, XmToggleButtonCallbackStruct *cb) { XmdPrintWidget pw = (XmdPrintWidget) parent; Boolean state = ! cb -> set; XtSetSensitive(pw -> print.from_tf, state); XtSetSensitive(pw -> print.to_tf, state); } static void numeric_only_cb(Widget textf, XtPointer ignore, XmTextVerifyCallbackStruct *cb) { if (cb -> text -> length > 0 && ! isdigit(cb -> text -> ptr[0])) cb -> doit = False; } static void do_print_cb(Widget button, Widget pw, XtPointer ignore) { XmdPrintWidget print = (XmdPrintWidget) pw; XmdPrintCallbackStruct cbstruct; Widget history; int i; char* temp; cbstruct.reason = XmCR_OK; cbstruct.event = NULL; cbstruct.two_sided = XmToggleButtonGetState(print -> print.two_sided_toggle); cbstruct.reverse_order = XmToggleButtonGetState(print -> print.reverse_order_toggle); temp = XmTextFieldGetString(print -> print.copies_tf); cbstruct.copies = atol(temp); XtFree(temp); cbstruct.to_printer = True; if (XmToggleButtonGetState(print -> print.all_toggle)) { cbstruct.first = 0; cbstruct.last = 0; } else { temp = XmTextFieldGetString(print -> print.from_tf); cbstruct.first = atol(temp); XtFree(temp); temp = XmTextFieldGetString(print -> print.to_tf); cbstruct.last = atol(temp); XtFree(temp); } XtVaGetValues(print -> print.destination_om, XmNmenuHistory, &history, NULL, NULL); /* Find the right widget. This will tell us the value */ for(i = 0; i < print -> print.num_om_items; i++) if (print -> print.om_items[i] == history) break; cbstruct.printer = NULL; /* Error case */ if (i < print -> print.num_printers) { cbstruct.printer = print -> print.printers[i]; cbstruct.to_printer = print -> print.is_printer[i]; } /* Call the printer callbacks */ XtCallCallbackList(pw, print -> print.print_callback, (XtPointer) &cbstruct); XtUnmanageChild(pw); } static void do_help_cb(Widget button, Widget pw, XtPointer ignore) { XmdPrintWidget print = (XmdPrintWidget) pw; XmAnyCallbackStruct cb; cb.reason = XmCR_HELP; cb.event = NULL; XtCallCallbackList(pw, print -> manager.help_callback, (XtPointer) &cb); XtUnmanageChild(pw); } static void unmanage_cb(Widget button, Widget pw, XtPointer ignore) { XtUnmanageChild(pw); } static void post_add_printer(Widget w, Widget pw, XmPushButtonCallbackStruct *cb) { XmdPrintWidget print = (XmdPrintWidget) pw; print -> print.adding_printer = True; XtManageChild(print -> print.new_printer_dialog); } static void post_add_pathname(Widget w, Widget pw, XmPushButtonCallbackStruct *cb) { XmdPrintWidget print = (XmdPrintWidget) pw; print -> print.adding_printer = False; XtManageChild(print -> print.new_printer_dialog); } static void add_printer_cb(Widget w, XtPointer pw, XmSelectionBoxCallbackStruct *cb) { XmdPrintWidget print = (XmdPrintWidget) pw; int n; int i; Arg args[10]; char *value; Widget button; /* Put the new value in the printer list and fix the option menu. Put the new value at the head of the menu */ XmStringGetLtoR(cb -> value, XmFONTLIST_DEFAULT_TAG, &value); /* Make sure widget array is big enough for all the items */ i = print -> print.num_om_items; print -> print.num_om_items++; print -> print.om_items = (WidgetList) XtRealloc((char*) print -> print.om_items, sizeof(Widget) * (i + 1)); /* Initialize new one */ n = 0; XtSetArg(args[n], XmNpositionIndex, 0); n++; /* Insert at head */ XtSetArg(args[n], XmNlabelString, cb -> value); n++; button = XmCreatePushButtonGadget((Widget) print -> print.destination_pd, "button", args, n); XtManageChild(button); print -> print.om_items[i] = button; /* New printer */ i = print -> print.num_printers; print -> print.num_printers++; print -> print.printers = (char**) XtRealloc((char*) print -> print.printers, sizeof(char*) * (i + 1)); print -> print.is_printer = (Boolean*) XtRealloc((char*) print -> print.is_printer, sizeof(Boolean) * (i + 1)); print -> print.printers[i] = value; print -> print.is_printer[i] = print -> print.adding_printer; XtVaSetValues(print -> print.destination_om, XmNmenuHistory, button, NULL, NULL); } static void cancel_printer_cb(Widget w, XtPointer pw, XmSelectionBoxCallbackStruct *cb) { XmdPrintWidget print = (XmdPrintWidget) pw; Widget history; if (print -> print.om_items && print -> print.num_om_items > 0) history = print -> print.om_items[0]; else history = NULL; /* Just reset the menu history on the print option menu */ XtVaSetValues(print -> print.destination_om, XmNmenuHistory, history, NULL, NULL); } /* * External functions */ /****************************************************************************** * * XmdCreatePrint: * Called by an application. * *****************************************************************************/ Widget XmdCreatePrint ( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { /* This is a convenience function to instantiate an XmdPrint widget. */ return (XtCreateWidget (name, xmdPrintWidgetClass, parent, arglist, argcount)); } /****************************************************************************** * * XmdCreatePrintDialog * Called by an application to create an XmdPrint managed by a * DialogShell. * *****************************************************************************/ Widget XmdCreatePrintDialog ( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return(XmeCreateClassDialog(xmdPrintWidgetClass, parent, name, arglist, argcount)); } void XmdPrintDocument(char* pathname, XmdPrintCallbackStruct* cb) { char command[1024]; command[0] = 0; /* These commands may need modification on different systems. These are the system V and berkeley printer commands */ if (cb -> to_printer) { #ifdef SYSV sprintf(command, "lp -d%s -n%d %s", cb -> printer, cb -> copies, pathname); #else /* Berk */ sprintf(command, "lpr -P%s -#%d %s", cb -> printer, cb -> copies, pathname); #endif /* SYSV */ } else { sprintf(command, "cp %s %s", pathname, cb -> printer); } system(command); } �����������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/Print.h�������������������������������������������������������������������0000644�0001750�0001750�00000006264�12672140200�013437� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Print.h /main/5 1995/07/15 20:43:54 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _XmdPrint_h #define _XmdPrint_h /* Include appropriate files. */ #include <Xm/Xm.h> /* widget public header file for XmManager */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class and widget record. */ externalref WidgetClass xmdPrintWidgetClass; typedef struct _XmdPrintClassRec * XmdPrintWidgetClass; typedef struct _XmdPrintRec * XmdPrintWidget; /* Define an IsSubclass macro. */ #ifndef XmdIsPrint #define XmdIsPrint(w) XtIsSubclass(w, XmdPrintWidgetClass) #endif #define XmdNprinterList "printerList" #define XmdCPrinterList "PrinterList" #define XmdNprintAll "printAll" #define XmdCPrintAll "PrintAll" #define XmdNtwoSided "twoSided" #define XmdCTwoSided "TwoSided" #define XmdNreverseOrder "reverseOrder" #define XmdCReverseOrder "ReverseOrder" #define XmdNfromPage "fromPage" #define XmdCFromPage "FromPage" #define XmdNtoPage "toPage" #define XmdCToPage "ToPage" #define XmdNnumberOfCopies "numberOfCopies" #define XmdCNumberOfCopies "NumberOfCopies" #define XmdNprintCallback "printCallback" /* Print callback */ typedef struct _XmdPrintCallbackStruct { int reason; /* Always XmCR_OK */ XEvent *event; /* Always NULL */ Boolean two_sided; /* True if should print double sided */ Boolean reverse_order; /* True if should reverse order */ Boolean to_printer; /* True if output should go to printer */ int first; /* First page to print. If first==last==0 */ int last; /* then print all pages */ int copies; /* how many copies to print */ char* printer; /* Name of printer or path of file */ } XmdPrintCallbackStruct; /* Specify the API for this widget. */ extern Widget XmdCreatePrint( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern Widget XmdCreatePrintDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern void XmdPrintDocument(char* pathname, XmdPrintCallbackStruct* cb); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _XmdPrint_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/PrintP.h������������������������������������������������������������������0000644�0001750�0001750�00000006365�12672140200�013561� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: PrintP.h /main/4 1995/07/15 20:43:58 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _XmdPrintP_h #define _XmdPrintP_h /* Include appropriate files. */ #include "Print.h" #include <Xm/FormP.h> /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif typedef struct { XtPointer extension; } XmdPrintClassPart; /* Define the full class record. */ typedef struct _XmdPrintClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; XmFormClassPart form_class; XmdPrintClassPart print_class; } XmdPrintClassRec; externalref XmdPrintClassRec xmdPrintClassRec; /* Define the widget instance part. */ typedef struct { char* printer_list; Boolean two_sided; Boolean reverse_order; Boolean print_all; int from_page; int to_page; int number_of_copies; XtCallbackList print_callback; /* Internal instance fields */ Cardinal num_printers; char** printers; Boolean* is_printer; Boolean adding_printer; /* Internal widgets which require access */ Widget copies_tf; Widget two_sided_toggle; Widget reverse_order_toggle; Widget from_all_rc; Widget from_tf; Widget to_tf; Widget from_toggle; Widget all_toggle; Widget destination_om; Widget destination_pd; Widget new_printer_dialog; Cardinal num_om_items; WidgetList om_items; } XmdPrintPart; /* Define the full instance record. */ typedef struct _XmdPrintRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; XmFormPart form; XmdPrintPart print; } XmdPrintRec; /* Define the constraint part structure. */ typedef struct _XmdPrintConstraintPart { int dummy; } XmdPrintConstraintPart, * XmdPrintConstraint; /* Define the full constraint structure. */ typedef struct _XmdPrintConstraintRec { XmManagerConstraintPart manager; /* No bulletin board constraint part */ XmFormConstraintPart form; XmdPrintConstraintPart print; } XmdPrintConstraintRec, * XmdPrintConstraintPtr; /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _XmdPrintP_h */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/README��������������������������������������������������������������������0000644�0001750�0001750�00000000317�12672140200�013043� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 14:00:10 drk $ */ This directory contains a utility library for the Motif demos. The library includes a Help widget. It will includes some other stuff in awhile. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/AdjView.c�����������������������������������������������������������������0000644�0001750�0001750�00000012710�12672140200�013660� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: AdjView.c /main/5 1995/07/15 20:43:19 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /******************************************************************* The following code is aimed at constraining the work_window size in an AUTOMATIC scrolledwindow so that it never becomes smaller than the view, in other word, so that you can never see the clipwindow background. First there are two callback/handler routines and then the convenience function that installs them on the clip and work window. *******************************************************************/ #include <Xm/XmAll.h> #include "AdjView.h" static void ClipResize (Widget clip_window, XtPointer client_data, XtPointer call_data) ; static void WorkResize(Widget work_window, XtPointer client_data, XEvent *event, Boolean *cont); /* The following hack needs more thinking, it appears as if the scrollbar highlight thickness must be removed from the work_window new size. If that is the model, then the real vertical or scrollbar ht values would have to be used instead of this constant */ #define SB_HT 2 static void ClipResize (Widget clip_window, XtPointer client_data, XtPointer call_data) { Widget work_window = (Widget) client_data ; static Dimension prev_clip_width = 0, prev_clip_height = 0 ; Dimension clip_width, clip_height, work_width, work_height ; /* if we're getting bigger, check the current work_window size and if we're bigger than it, resize the work_window so it just fits the clipwindow. if we're getting smaller, ask the preferred work_window size, and if we're still bigger than it, resize the work_window so it just fits the clipwindow, else resize it to its preferred size. */ XtVaGetValues(clip_window, XmNwidth, &clip_width, XmNheight, &clip_height, NULL); if (clip_width > prev_clip_width) { XtVaGetValues(work_window, XmNwidth, &work_width, NULL); if (clip_width > work_width) { XtVaSetValues(work_window, XmNwidth, clip_width - SB_HT, NULL); } } else { XtWidgetGeometry preferred; XtQueryGeometry(work_window, NULL, &preferred); if (clip_width > preferred.width) { XtVaSetValues(work_window, XmNwidth, clip_width - SB_HT, NULL); } else { XtVaSetValues(work_window, XmNwidth, preferred.width, NULL); } } prev_clip_width = clip_width ; if (clip_height > prev_clip_height) { XtVaGetValues(work_window, XmNheight, &work_height, NULL); if (clip_height > work_height) { XtVaSetValues(work_window, XmNheight, clip_height - SB_HT, NULL); } } else { XtWidgetGeometry preferred; XtQueryGeometry(work_window, NULL, &preferred); if (clip_height > preferred.height) { XtVaSetValues(work_window, XmNheight, clip_height - SB_HT, NULL); } else { XtVaSetValues(work_window, XmNheight, preferred.height, NULL); } } prev_clip_height = clip_height ; } static void WorkResize(Widget work_window, XtPointer client_data, XEvent *event, Boolean *cont) { Widget clip_window = (Widget) client_data ; Dimension clip_width, work_width, clip_height, work_height ; /* if the work_window is getting smaller than its clip_window parent, resize it so it just fits. */ XtVaGetValues(work_window, XmNwidth, &work_width, XmNheight, &work_height, NULL); XtVaGetValues(clip_window, XmNwidth, &clip_width, XmNheight, &clip_height, NULL); if (clip_width > work_width + 1) { XtVaSetValues(work_window, XmNwidth, clip_width - SB_HT, NULL); } if (clip_height > work_height + 1) { XtVaSetValues(work_window, XmNheight, clip_height - SB_HT, NULL); } } /*---------That's the public API ----------------------*/ void XmdSWAdjustView (Widget sw) { Widget clip_window, work_window ; unsigned char scrolling_policy ; /* get the clipwindow and _a_ workwindow. To be really correct, this code would have to figure out the case where there are more than one work window */ XtVaGetValues(sw, XmNclipWindow, &clip_window, XmNworkWindow, &work_window, XmNscrollingPolicy, &scrolling_policy, NULL); if (scrolling_policy != XmAUTOMATIC) return ; /* attach callback to ClipWindow so that Container never goes smaller than clip window. We know ClipWindow is a DrawingArea subclass, so we can use a resizeCallback */ XtAddCallback(clip_window, XmNresizeCallback, ClipResize, (XtPointer) work_window); /* also attach handler to Container sp that it never goes smaller than clip window by itself */ XtAddEventHandler(work_window, StructureNotifyMask, False, WorkResize, (XtPointer) clip_window); } ��������������������������������������������������������motif-2.3.8/demos/lib/Xmd/onHelp.c������������������������������������������������������������������0000644�0001750�0001750�00000006020�13066310437�013562� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: onHelp.c /main/4 1995/07/15 20:44:13 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdlib.h> #include <Xm/Xm.h> #include "Help.h" void quitCB( Widget widget, char *tag, XmAnyCallbackStruct *callback_data ) { exit(0); } /* * Main program */ int main(int argc, String argv[]) { Arg args[10]; XtAppContext app_context; int n; Widget toplevel, help; Cardinal size; XmRendition rend[10]; XmRenderTable rt; int i; XmTab tabs[5]; XmTabList tablist; Widget dismiss; toplevel = XtVaAppInitialize(&app_context, "HelpOnHelp", NULL, 0, &argc, argv, NULL, NULL); n = 0; XtSetArg(args[n], XmdNhelpFile, "helpOn"); n++; help = XmdCreateHelp(toplevel, "help", args, n); dismiss = XtNameToWidget(help, "*Dismiss"); XtAddCallback(dismiss, XmNactivateCallback, (XtCallbackProc) quitCB, NULL); /* Get the rendertable and add some new renditions */ XtVaGetValues(help, XmNrenderTable, &rt, NULL, NULL); /* Make the tabs for the tables */ n = 0; tabs[n] = XmTabCreate(2.0, XmINCHES, XmABSOLUTE, XmALIGNMENT_BEGINNING, NULL); n++; tabs[n] = XmTabCreate(4.0, XmINCHES, XmABSOLUTE, XmALIGNMENT_BEGINNING, NULL); n++; tablist = XmTabListInsertTabs(NULL, tabs, n, 0); for(i = 0; i < n; i++) XmTabFree(tabs[i]); /* Add extra renditions needed for the help file */ n = 0; i = 0; XtSetArg(args[n], XmNtabList, tablist); n++; rend[i] = XmRenditionCreate(help, "table", args, n); i++; n = 0; XtSetArg(args[n], XmNfontName, "*courier-medium-r-*-12-*"); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_FONT); n++; rend[i] = XmRenditionCreate(help, "program", args, n); i++; n = 0; XtSetArg(args[n], XmNunderlineType, XmSINGLE_LINE); n++; rend[i] = XmRenditionCreate(help, "underline", args, n); i++; /* Make a copy so that setvalues will work correctly */ rt = XmRenderTableCopy(rt, NULL, 0); rt = XmRenderTableAddRenditions(rt, rend, i, XmMERGE_NEW); for(n = 0; n < i; n++) XmRenditionFree(rend[n]); XtVaSetValues(help, XmNrenderTable, rt, NULL, NULL); XmRenderTableFree(rt); XtManageChild(help); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/RegEditI.h����������������������������������������������������������������0000644�0001750�0001750�00000022255�12672140200�013775� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* $XConsortium: RegEditI.h /main/4 1995/07/14 10:05:01 drk $ */ /* Copyright (c) 1989 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. */ /* * Author: Chris D. Peterson, MIT X Consortium */ /************************************************************ The Editres Protocol The Client message sent to the application is: ATOM = "ResEditor" --- RES_EDITOR_NAME FORMAT = 32 --- RES_EDIT_SEND_EVENT_FORMAT l[0] = timestamp l[1] = command atom name l[2] = ident of command. l[3] = protocol version number to use. The binary protocol has the following format: Card8: 8-bit unsingned integer Card16: 16-bit unsingned integer Card32: 32-bit unsingned integer Int16: 16-bit signed integer Window: 32-bit value Widget: 32-bit value String8: ListOfCard8 [a][b][c] represent an exclusive list of choices. All widgets are passed as a list of widgets, containing the full instance heirarch of this widget. The hierarchy is ordered from parent to child. Thus the first element of each list is the root of the widget tree (this makes verifying that the widget still exists, MUCH faster). ListOfFoo comprises a list of things in the following format: number: Card16 <number> things: ???? This is a synchronous protocol, every request MUST be followed by a reply. Request: Serial Number: Card8 Op Code: Card8 - { SendWidgetTree = 0, SetValues = 1, GetResources = 2, GetGeometry = 3, FindChild = 4, GetValues = 5 } Length: Card32 Data: Reply: Serial Number: Card8 Type: Card8 - { Formatted = 0, Unformatted = 1, ProtocolMismatch = 2 } Length: Card32 Byte Order: All Fields are MSB -> LSB Data: Formatted: The data contains the reply information for the request as specified below if the reply type is "Formatted". The return values for the other reply types are shown below. Unformatted: Message: String8 ProtocolMismatch: RequestedVersion: Card8 ------------------------------------------------------------ SendWidgetTree: ---> Number of Entries: Card16 Entry: widget: ListOfWidgets name: String8 class: String8 window: Card32 toolkit: String8 Send Widget Tree returns the toolkit type, and a fuly specified list of widgets for each widget in the tree. This is enough information to completely reconstruct the entire widget heirarchy. The window return value contains the Xid of the window currently used by this widget. If the widget is unrealized then 0 is returned, and if widget is a non-windowed object a value of 2 is returned. SetValues: name: String8 type: String8 value: String8 Number of Entries: Card16 Entry: widget: ListOfWidgets ---> Number of Entries: Card16 Entry: widget: ListOfWidgets message: String8 SetValues will allow the same resource to be set on a number of widgets. This function will return an error message if the SetValues request caused an Xt error. GetValues: names: ListOfString8 widget: Widget ---> novalues: ListOfCard16 values: ListOfString8 GetValues will allow a number of resource values to be read on a particular widget. The request specifies the names of the resources wanted and the widget id these resources are from. The reply returns a list of indices from the requests name list of resources for which a value can not be returned. It also returns a list of returned values, in the order of the requests names list, skipping those indices present in novalues. GetResources: Number of Entries: Card16 Entry widget: ListOfWidgets: ----> Number of Entries: Card16 Entry Widget: ListOfWidgets: Error: Bool [ Message: String 8 ] [ Number of Resources: Card16 Resource: Kind: {normal, constraint} Name: String8 Class: String8 Type: String8 ] GetResource retrieves the kind, name, class and type for every widget passed to it. If an error occured with the resource fetch Error will be set to True for the given widget and a message is returned rather than the resource info. GetGeometry: Number of Entries: Card16 Entry Widget: ListOfWidgets: ----> Number of Entries: Card16 Entry Widget: ListOfWidgets: Error: Bool [ message: String 8 ] [ mapped: Boolean X: Int16 Y: Int16 Width: Card16 Height: Card16 BorderWidth: Card16 ] GetGeometry retreives the mapping state, x, y, width, height and border width for each widget specified. If an error occured with the geometry fetch "Error" will be set to True for the given widget and a message is returned rather than the geometry info. X an Y corrospond to the root coordinates of the upper left corner of the widget (outside the window border). FindChild: Widget: ListOfWidgets X: Int16 Y: Int16 ---> Widget: ListOfWidgets Find Child returns a descendent of the widget specified that is at the root coordinates specified. NOTE: The returned widget is undefined if the point is contained in two or more mapped widgets, or in two overlapping Rect objs. GetValues: names: ListOfString8 widget: Widget ---> values: ListOfString8 GetValues will allow a number of resource values to be read on a particular widget. Currently only InterViews 3.0.1 Styles and their attributes are supported. In addition, the current user interface only supports the return of 1 resource. The ability to specify and return multiple resources is defined for future editres interfaces where some or all of a widgets resource values are returned and displayed at once. ************************************************************/ #include <X11/Intrinsic.h> #include <X11/Xfuncproto.h> #define XER_NBBY 8 /* number of bits in a byte */ #define BYTE_MASK 255 #define HEADER_SIZE 6 #define EDITRES_IS_OBJECT 2 #define EDITRES_IS_UNREALIZED 0 /* * Format for atoms. */ #define EDITRES_FORMAT 8 #define EDITRES_SEND_EVENT_FORMAT 32 /* * Atoms */ #define EDITRES_NAME "Editres" #define EDITRES_COMMAND_ATOM "EditresCommand" #define EDITRES_COMM_ATOM "EditresComm" #define EDITRES_CLIENT_VALUE "EditresClientVal" #define EDITRES_PROTOCOL_ATOM "EditresProtocol" typedef enum { SendWidgetTree = 0, SetValues = 1, GetResources = 2, GetGeometry = 3, FindChild = 4, GetValues = 5 } EditresCommand; typedef enum {NormalResource = 0, ConstraintResource = 1} ResourceType; /* * The type of a resource identifier. */ typedef unsigned char ResIdent; typedef enum {PartialSuccess= 0, Failure= 1, ProtocolMismatch= 2} EditResError; typedef struct _WidgetInfo { unsigned short num_widgets; unsigned long * ids; Widget real_widget; } WidgetInfo; typedef struct _ProtocolStream { unsigned long size, alloc; unsigned char *real_top, *top, *current; } ProtocolStream; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/Menus.c�������������������������������������������������������������������0000644�0001750�0001750�00000021364�13066310437�013434� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $TOG: Menus.c /main/7 1997/04/15 10:03:39 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmP.h> #include <Xm/PushBG.h> #include <Xm/CascadeBG.h> #include <Xm/SeparatoG.h> #include <Xm/RowColumn.h> #include "Menus.h" typedef struct _menu_info { char* label; char mnemonic; char* accelerator; char* acc_text; Boolean managed; Boolean is_separator; } menu_info; static Widget CreateMenuButton(Widget, char*, char, char*, char*, WidgetClass wc); static Widget CreatePulldown(char* name, char mnemonic, Widget, menu_info*, WidgetList, Cardinal); menu_info file_pulldown[] = { /*label mnem. acc. acc. text mnged. is_sep */ {"New", 'N', "Ctrl<Key>N", "Ctrl+N", True, False}, {"Open", 'O', "Ctrl<Key>O", "Ctrl+O", True, False}, {"Save", 'S', "Ctrl<Key>S", "Ctrl+S", True, False}, {"Save As...",'A', NULL, NULL, True, False}, {"Revert", 0, NULL, NULL, False, False}, {"separator1", 0, NULL, NULL, True, True}, {"Copy To...",0, NULL, NULL, False, False}, {"Drag", 0, NULL, NULL, False, False}, {"Print...", 'P', "Ctrl<Key>P", "Ctrl+P", True, False}, {"Print Setup", 'r', NULL, NULL, False, False}, {"separator2", 0, NULL, NULL, True, True}, {"Close", 'C', NULL, NULL, False, False}, {"Exit", 'x', NULL, NULL, True, False} }; menu_info selected_pulldown[] = { /*label mnem. acc. acc. text mnged. is_sep */ {"Properties", 's', "Ctrl<Key>I", "Ctrl+I", False, False}, {"New", 'N', NULL, NULL, False, False}, {"Open", 'O', NULL, NULL, True, False}, {"separator1", 0, NULL, NULL, True, True}, {"Copy To...", 0, NULL, NULL, False, False}, {"Move To...", 0, NULL, NULL, False, False}, {"separator2", 0, NULL, NULL, True, True}, {"Clear To Trash", 'e', NULL, NULL, False, False}, {"Delete To Trash", 'D', "<Key>osfDelete", "Delete", False, False}, {"Print...", 0, NULL, NULL, False, False}, {"Exit", 'x', NULL, NULL, True, False} }; /* Edit menu */ menu_info edit_pulldown[] = { {"Undo", 'U', NULL, NULL, False, False}, {"Repeat", 'R', NULL, NULL, False, False}, {"Drag", 0, NULL, NULL, False, False}, {"Size", 0, NULL, NULL, False, False}, {"Duplicate", 0, NULL, NULL, False, False}, {"separator1", 0, NULL, NULL, False, True}, {"Cut", 't', "Ctrl<Key>x", "Ctrl+x", True, False}, {"Copy", 'C', "Ctrl<Key>c", "Ctrl+c", True, False}, {"Copy Link", 'k', NULL, NULL, False, False}, {"Copy Special...", 0, NULL, NULL, False, False}, {"Paste", 'P', "Ctrl<Key>v", "Ctrl+v", True, False}, {"Paste Link",0, NULL, NULL, False, False}, {"Paste Special...", 0, NULL, NULL, False, False}, {"Insert...", 'I', NULL, NULL, False, False}, {"separator2", 0, NULL, NULL, True, True}, {"Primary Copy", 0, "Alt,Ctrl<Key>c", "Alt+Ctrl+c", False, False}, {"Primary Move", 0, "Alt,Ctrl<Key>x", "Alt+Ctrl+x", False, False}, {"Primary Link", 0, NULL, NULL, False, False}, {"separator3", 0, NULL, NULL, True, True}, {"Clear", 'e', NULL, NULL, False, False}, {"Delete", 'D', "<Key>osfDelete", "Delete", True, False}, {"Select All",'S', "Ctrl<Key>a", "Ctrl+a", False, False}, {"separator4", 0, NULL, NULL, False, True}, {"Unselect All", 0, "Ctrl<Key>\\", "Ctrl+\\", False, False}, {"Select Pasted", 0, NULL, NULL, False, False}, {"Reselect", 0, NULL, NULL, False, False} }; /* View menu */ menu_info view_pulldown[] = { {"Change View",'C', NULL, NULL, False, False}, {"New", 'N', NULL, NULL, False, False}, {"separator", 0, NULL, NULL, False, True}, {"Include...",'I', NULL, NULL, False, False}, {"Sort...", 'S', NULL, NULL, False, False}, {"Find...", 'F', NULL, NULL, False, False} }; /* Help menu */ menu_info help_pulldown[] = { {"Overview", 'O', NULL, NULL, True, False}, {"separator1", 0, NULL, NULL, True, True}, {"Index", 'I', NULL, NULL, False, False}, {"Table Of Contents", 'C', NULL, NULL, True, False}, {"Tasks", 'T', NULL, NULL, False, False}, {"Reference", 'R', NULL, NULL, False, False}, {"Tutorial", 'L', NULL, NULL, False, False}, {"Keyboard", 'K', NULL, NULL, False, False}, {"Mouse", 'M', NULL, NULL, False, False}, {"separator2", 0, NULL, NULL, True, True}, {"On Item", 0, NULL, NULL, False, False}, {"Using Help",'U', NULL, NULL, False, False}, {"About App.",'A', NULL, NULL, False, False} }; Widget XmdCreateMenu(XmdMenuType type, Widget parent, WidgetList *array, Cardinal *size) { Widget retval = NULL; if (type > POPUPS) { /* This is a popup menu */ } else { /* This is a pulldown menu */ switch(type) { case FILE_MENU: *array = (WidgetList) XtMalloc(sizeof(Widget) * XtNumber(file_pulldown)); *size = XtNumber(file_pulldown); retval = CreatePulldown("File", 'F', parent, file_pulldown, *array, *size); break; case EDIT_MENU: *array = (WidgetList) XtMalloc(sizeof(Widget) * XtNumber(edit_pulldown)); *size = XtNumber(edit_pulldown); retval = CreatePulldown("Edit", 'E', parent, edit_pulldown, *array, *size); break; case SELECTED_MENU: *array = (WidgetList) XtMalloc(sizeof(Widget) * XtNumber(selected_pulldown)); *size = XtNumber(selected_pulldown); retval = CreatePulldown("Selected", 'S', parent, selected_pulldown, *array, *size); break; case VIEW_MENU: *array = (WidgetList) XtMalloc(sizeof(Widget) * XtNumber(view_pulldown)); *size = XtNumber(view_pulldown); retval = CreatePulldown("View", 'V', parent, view_pulldown, *array, *size); break; case HELP_MENU: *array = (WidgetList) XtMalloc(sizeof(Widget) * XtNumber(help_pulldown)); *size = XtNumber(help_pulldown); retval = CreatePulldown("Help", 'H', parent, help_pulldown, *array, *size); break; default: /* internal error */ break; } } return retval; } static Widget CreateMenuButton(Widget menu, char* label, char mnemonic, char* acc, char* acc_text, WidgetClass wc) { Widget tmp; Arg args[10]; int n; XmString tmp1, tmp2; tmp1 = NULL; tmp2 = NULL; n = 0; if (label != NULL) { tmp1 = XmStringCreateLocalized(label); XtSetArg(args[n], XmNlabelString, tmp1); n++; } if (mnemonic != 0) { XtSetArg(args[n], XmNmnemonic, mnemonic); n++; } if (acc != NULL) { XtSetArg(args[n], XmNaccelerator, acc); n++; if (acc_text != NULL) { tmp2 = XmStringCreateLocalized(acc_text); XtSetArg(args[n], XmNacceleratorText, tmp2); n++; } } tmp = XtCreateWidget(label, wc, menu, args, n); if (tmp1) XmStringFree(tmp1); if (tmp2) XmStringFree(tmp2); return(tmp); } static Widget CreatePulldown(char* name, char mnemonic, Widget parent, menu_info *info, WidgetList array, Cardinal size) { int i; Widget cascade_button, pulldown; Arg args[10]; char buffer[128]; sprintf(buffer,"%s_pulldown", name); pulldown = XmCreatePulldownMenu(parent, buffer, NULL, 0); i = 0; if (mnemonic != 0) { XtSetArg(args[i], XmNmnemonic, mnemonic); i++; } XtSetArg(args[i], XmNsubMenuId, pulldown); i++; cascade_button = XmCreateCascadeButtonGadget(parent, name, args, i); XtManageChild(cascade_button); if (strcmp(name, "Help") == 0) XtVaSetValues(parent, XmNmenuHelpWidget, cascade_button, NULL, NULL); /* Create menu items, special exception for the first item in the View menu, which is a cascadebutton*/ for(i = 0; i < size; i++) { if (info[i].is_separator) array[i] = XmCreateSeparatorGadget(pulldown, info[i].label, NULL, 0); else array[i] = CreateMenuButton(pulldown, info[i].label, info[i].mnemonic, info[i].accelerator, info[i].acc_text, (info != view_pulldown && i != 0) ? xmPushButtonGadgetClass : xmCascadeButtonGadgetClass ); if (info[i].managed) XtManageChild(array[i]); } return(pulldown); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Xmd/Makefile.am���������������������������������������������������������������0000644�0001750�0001750�00000000574�13145162623�014235� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libXmd.a noinst_PROGRAMS = onHelp libXmd_a_SOURCES = Help.c Menus.c Print.c RegEdit.c AdjView.c noinst_HEADERS = AdjView.h \ Help.h HelpP.h \ Menus.h \ Print.h PrintP.h \ RegEdit.h RegEditI.h LDADD = libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(top_builddir)/lib -I$(srcdir)/../../../lib ${X_CFLAGS} EXTRA_DIST = ������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Makefile.am�������������������������������������������������������������������0000644�0001750�0001750�00000000107�13145162623�013475� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = Xmd Wsm Exm EXTRA_DIST = ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/��������������������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�012242� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/MenuB.c�������������������������������������������������������������������0000644�0001750�0001750�00000107070�13066310437�013353� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $TOG: MenuB.c /main/6 1999/05/13 15:33:01 mgreess $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /************************************ WARNING ********************************** * * ExmMenuButton is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way * ************************************ WARNING *********************************/ /******************************************************************************* * * MenuB.c - ExmMenuButton widget. This widget serves as a menu * button. It has some features of the XmPushButton widget. * This widget can be a child of a RowColumn widget, * assuming that the XmNrowColumnType resource of the * RowColumn is set to something other than XmWORK_AREA. * ExmMenuButton is a subclass of ExmString and displays * one compound string. * The ExmMenuButton widget demonstrates how to * * install the XmQTmenuSavvy trait. * * call many of the trait methods of the XmQTmenuSystem * trait. * See the "OSF/Motif Widget Writer's Guide" for details. * *******************************************************************************/ /* Include appropriate header files. */ #include <Xm/Screen.h> #include <Xm/CascadeB.h> #include <Xm/DrawP.h> #include <Xm/ManagerP.h> #include <X11/ShellP.h> #include <Xm/TraitP.h> #include <Xm/MenuT.h> #include <Xm/SpecRenderT.h> /* header file for XmBUTTON_RENDER_TABLE */ #include <Xm/UniqueEvnI.h> #include <X11/keysymdef.h> #include <Exm/MenuBP.h> /* The VISUAL_DELAY holds a time in milliseconds. */ XmConst unsigned long VISUAL_DELAY=100; /* Declare all static functions. */ static void Initialize ( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args); static void ClassInitialize(void); static void Destroy ( Widget w); static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args); static void BorderHighlight ( Widget w); static void BorderUnhighlight ( Widget w); static void DrawShadow ( Widget w); static void ArmAndActivate ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void VisualDisarm ( XtPointer cd, XtIntervalId *id); static void BtnDown ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void BtnUp ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void MenuButtonEnter ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void MenuButtonLeave ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void MenuButtonHelp ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void DisableCallback( Widget w, XtEnum value); static char* GetAccelerator( Widget w); static KeySym GetMnemonic( Widget w); static char* GetActivateCBName( void); static void DrawVisual( Widget w); static void CalcVisualSize ( Widget w); /* Define translations. */ static char defaultTranslations[] = "<EnterWindow>: MenuButtonEnter()\n\ <LeaveWindow>: MenuButtonLeave()\n\ <BtnDown>: BtnDown()\n\ <BtnUp>: BtnUp()\n\ :<Key>osfActivate: ArmAndActivate()\n\ :<Key>osfCancel: MenuEscape()\n\ :<Key>osfHelp: MenuButtonHelp()\n\ ~s ~m ~a <Key>Return: ArmAndActivate()\n\ ~s ~m ~a <Key>space: ArmAndActivate()"; static char menuTraversalTranslations[] = "<Unmap>: Unmap()\n\ <FocusOut>: FocusOut()\n\ <FocusIn>: FocusIn()\n\ :<Key>osfCancel: MenuEscape()\n\ :<Key>osfLeft: MenuTraverseLeft()\n\ :<Key>osfRight: MenuTraverseRight()\n\ :<Key>osfUp: MenuTraverseUp()\n\ :<Key>osfDown: MenuTraverseDown()"; /* The following actions will be handled by code inside this file. */ static XtActionsRec Actions[] = { {"ArmAndActivate", ArmAndActivate}, {"BtnDown", BtnDown}, {"BtnUp", BtnUp}, {"MenuButtonEnter", MenuButtonEnter}, {"MenuButtonLeave", MenuButtonLeave}, {"MenuButtonHelp", MenuButtonHelp} }; /* Define the resources. The first four resource definitions are do not define new resources, they simply provide new default values for superclass resources. The only new resource is XmNactivateCallback. */ static XtResource resources[] = { { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( ExmMenuButtonRec, primitive.shadow_thickness), XmRImmediate, (XtPointer) 2 }, { XmNhighlightThickness, XmCHighlightThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( ExmMenuButtonRec, primitive.highlight_thickness), XmRImmediate, (XtPointer) 0 }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf( ExmMenuButtonRec, primitive.traversal_on), XmRImmediate, (XtPointer) True }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf( ExmStringRec,string.alignment), XmRImmediate, (XtPointer) XmALIGNMENT_BEGINNING }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( ExmMenuButtonRec, menu_button.activate_callback), XmRPointer, (XtPointer) NULL }, { XmNmnemonic, XmCMnemonic, XmRKeySym, sizeof(KeySym), XtOffsetOf( ExmMenuButtonRec, menu_button.mnemonic), XmRImmediate, (XtPointer) XK_VoidSymbol }, { XmNaccelerator, XmCAccelerator, XmRString, sizeof(char *), XtOffsetOf(ExmMenuButtonRec, menu_button.accelerator), XmRImmediate, (XtPointer) NULL }, { XmNacceleratorText, XmCAcceleratorText, XmRXmString, sizeof(XmString), XtOffsetOf(ExmMenuButtonRec, menu_button.accelerator_text), XmRImmediate, (XtPointer) NULL }, { XmNmnemonicCharSet, XmCMnemonicCharSet, XmRString, sizeof(XmStringCharSet), XtOffsetOf(ExmMenuButtonRec, menu_button.mnemonic_charset), XmRImmediate, (XtPointer) XmFONTLIST_DEFAULT_TAG } }; /* No synthetic resources. */ /* Here is the class record. */ externaldef (exmmenubuttonclassrec) ExmMenuButtonClassRec exmMenuButtonClassRec = { { /* superclass */ (WidgetClass)&exmStringClassRec, /* class_name */ "ExmMenuButton", /* widget_size */ sizeof(ExmMenuButtonRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ NULL, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ Actions, /* num_actions */ XtNumber(Actions), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ XtInheritResize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* XmPrimitive */ /* border_highlight */ BorderHighlight, /* border_unhighlight */ BorderUnhighlight, /* translations */ menuTraversalTranslations, #if 0 /* translations */ XtInheritTranslations, #endif /* arm_and_activate */ ArmAndActivate, /* syn_resources */ NULL, /* num_syn_resources */ 0, /* extension */ NULL, }, { /* ExmSimple */ /* draw_visual */ DrawVisual, /* draw_shadow */ DrawShadow, /* create_text_gc */ ExmInheritCreateGC, /* destroy_text_gc */ ExmInheritDestroyGC, /* select_text_gc */ ExmInheritSelectGC, /* calc_visual_size */ CalcVisualSize, /* calc_widget_size */ ExmInheritCalcWidgetSize, /* reconfigure */ ExmInheritReconfigure, /* extension */ NULL, }, { /* ExmString */ /* default_render_table_type */ XmBUTTON_RENDER_TABLE, /* extension */ NULL, }, { /* ExmMenuButton */ /* extension */ NULL, } }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef( exmmenubuttonwidgetclass) WidgetClass exmMenuButtonWidgetClass = (WidgetClass) &exmMenuButtonClassRec; /* Define trait structure variables. */ /* We will need to tell XmRowColumn that ExmMenuButton can be a menu child. We will do that be setting the XmQTmenuSavvy trait on ExmMenuButton. In order to set this trait, we must define a trait record variable as follows: */ static XmConst XmMenuSavvyTraitRec menuSavvyTraitRec = { 0, /* Version */ (XmMenuSavvyDisableProc) DisableCallback, /* disableCallback */ GetAccelerator, /* getAccelerator */ GetMnemonic, /* getMnemonic */ GetActivateCBName, /* getActivateCBName */ }; /****************************************************************************** * * ClassInitialize: * Called by the Intrinsics the first time a widget of this class is * instantiated. * *****************************************************************************/ static void ClassInitialize( void ) { /* Install the menuSavvy trait so that the menu will know that this class has the right actions for menus */ XmeTraitSet(exmMenuButtonWidgetClass, XmQTmenuSavvy, (XtPointer) &menuSavvyTraitRec); } /****************************************************************************** * * Initialize * *****************************************************************************/ static void Initialize ( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmMenuButtonWidgetClass wc =(ExmMenuButtonWidgetClass)XtClass(new_w); ExmMenuButtonWidget nw = (ExmMenuButtonWidget)new_w; nw->menu_button.armed = False; nw->menu_button.visual_timer = 0; nw->menu_button.skip_callback = False; /* Force traversal on, the menu system will break otherwise */ nw->primitive.traversal_on = True; nw->primitive.highlight_thickness = 0; if (wc->simple_class.calc_visual_size) (*(wc->simple_class.calc_visual_size))(new_w); if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmMenuButtonWidgetClass, new_w, NULL); if (nw->menu_button.accelerator_text != NULL) nw->menu_button.accelerator_text = XmStringCopy(nw->menu_button.accelerator_text); } /****************************************************************************** * * Destroy * *****************************************************************************/ static void Destroy ( Widget w ) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; if (mw->menu_button.visual_timer != 0) XtRemoveTimeOut (mw->menu_button.visual_timer); } /****************************************************************************** * * SetValues * *****************************************************************************/ static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmMenuButtonWidgetClass wc =(ExmMenuButtonWidgetClass)XtClass(new_w); ExmMenuButtonWidget nw = (ExmMenuButtonWidget) new_w; ExmMenuButtonWidget cw = (ExmMenuButtonWidget) old_w; Boolean redisplayFlag = False; /* should we force these ? - probably to protect from *highlightThickness*/ nw->primitive.highlight_thickness = 0; nw->primitive.traversal_on = True; if (wc->simple_class.reconfigure) { (*(wc->simple_class.reconfigure))(exmMenuButtonWidgetClass, new_w, old_w); redisplayFlag = True; } if (nw->menu_button.accelerator_text != NULL) nw->menu_button.accelerator_text = XmStringCopy(nw->menu_button.accelerator_text); if ((nw->menu_button.accelerator_text != cw->menu_button.accelerator_text) || (nw->menu_button.mnemonic != cw->menu_button.mnemonic)) redisplayFlag = True; return (redisplayFlag); } /****************************************************************************** * * BorderHighlight * *****************************************************************************/ static void BorderHighlight ( Widget w ) { ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(w); ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; if (mw->menu_button.armed == True) return; #ifndef USE_ORIGINAL_MOTIF_CODE XmeDrawShadows (XtDisplay (mw), XtWindow (mw), mw->primitive.top_shadow_GC, mw->primitive.bottom_shadow_GC, mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - 2 * mw->primitive.highlight_thickness, mw->core.height - 2 * mw->primitive.highlight_thickness, mw->primitive.shadow_thickness, XmSHADOW_OUT); #else mw->menu_button.armed = True; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) ((Widget) mw); #endif } /****************************************************************************** * * BorderUnhighlight: * Called when ... * *****************************************************************************/ static void BorderUnhighlight ( Widget w ) { ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(w); ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; if (mw->menu_button.armed == False) return; #ifndef USE_ORIGINAL_MOTIF_CODE XmeClearBorder (XtDisplay (mw), XtWindow(mw), mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - 2 * mw->primitive.highlight_thickness, mw->core.height - 2 * mw->primitive.highlight_thickness, mw->primitive.shadow_thickness); #else mw->menu_button.armed = False; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) ((Widget) mw); #endif } /****************************************************************************** * * DrawVisual * *****************************************************************************/ static void DrawVisual ( Widget w ) { ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(w); ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; /* If the compound string is not NULL and if there is enough space in the widget to draw at least a little portion of the compound string, then render the string with XmStringDraw. */ if (mw->string.compound_string && (mw->simple.visual.width != 0) && (mw->simple.visual.height != 0)) { if (mw->menu_button.mnemonic != XK_VoidSymbol) { char mnemonic_str[2]; XmString tmp; mnemonic_str[0] = mw->menu_button.mnemonic & 0xFF; mnemonic_str[1] = 0; tmp = XmStringCreate(mnemonic_str, mw->menu_button.mnemonic_charset); XmStringDrawUnderline(XtDisplay(mw), XtWindow(mw), mw->string.render_table, mw->string.compound_string, wc->simple_class.select_gc(w), mw->simple.visual.x, mw->simple.visual.y, mw->simple.visual.width, mw->string.alignment, mw->primitive.layout_direction, NULL, tmp); XmStringFree(tmp); } else { XmStringDraw(XtDisplay(mw), XtWindow(mw), mw->string.render_table, mw->string.compound_string, wc->simple_class.select_gc(w), mw->simple.visual.x, mw->simple.visual.y, mw->simple.visual.width, mw->string.alignment, mw->primitive.layout_direction, NULL); } /* Draw the accelerator text */ if (mw->menu_button.accelerator_text) { Dimension height, width, offset; offset = mw->primitive.highlight_thickness + mw->primitive.shadow_thickness; XmStringExtent (mw->string.render_table, mw->menu_button.accelerator_text, &width, &height); XmStringDraw(XtDisplay(mw), XtWindow(mw), mw->string.render_table, mw->menu_button.accelerator_text, wc->simple_class.select_gc(w), XtWidth(w) - width - offset, mw->simple.visual.y, mw->simple.visual.width, mw->string.alignment, mw->primitive.layout_direction, NULL); } XmeClearBorder(XtDisplay(mw), XtWindow(mw), (int)0, (int)0, (Dimension)mw->core.width, (Dimension)mw->core.height, (Dimension)(mw->primitive.highlight_thickness + mw->primitive.shadow_thickness) ); } } /****************************************************************************** * * CalcVisualSize * *****************************************************************************/ static void CalcVisualSize ( Widget w ) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; /* Ideally, how much space would the compound string require? */ if (mw->string.compound_string && !XmStringEmpty(mw->string.compound_string)) XmStringExtent (mw->string.render_table, mw->string.compound_string, &(mw->simple.visual.width), &(mw->simple.visual.height)); else { /* The string is empty, so it requires no space. */ mw->simple.visual.width = 0; mw->simple.visual.height = 0; } /* Now add the space for the accelerator text */ if (mw->menu_button.accelerator_text) { Dimension height, width; int h_unit; Widget scr = XmGetXmScreen(XtScreen(w)); Arg args[1]; XtSetArg(args[0], XmNhorizontalFontUnit, &h_unit); XtGetValues(scr, args, 1); XmStringExtent (mw->string.render_table, mw->menu_button.accelerator_text, &width, &height); mw->simple.visual.width += width + (2 * h_unit); if (height > mw->simple.visual.height) mw->simple.visual.height = height; } } /************************************************************************ * * DrawShadow * ************************************************************************/ static void DrawShadow ( Widget w ) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; if (mw->core.width > 2 * mw->primitive.highlight_thickness && mw->core.height > 2 * mw->primitive.highlight_thickness && mw->primitive.shadow_thickness > 0) { if (mw->menu_button.armed) XmeDrawShadows (XtDisplay (mw), XtWindow (mw), mw->primitive.top_shadow_GC, mw->primitive.bottom_shadow_GC, mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - 2 * mw->primitive.highlight_thickness, mw->core.height - 2 * mw->primitive.highlight_thickness, mw->primitive.shadow_thickness, XmSHADOW_OUT); else XmeClearBorder (XtDisplay (mw), XtWindow(mw), mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - 2 * mw->primitive.highlight_thickness, mw->core.height - 2 * mw->primitive.highlight_thickness, mw->primitive.shadow_thickness); } } /********************************************************************** * * MenuButtonEnter * *********************************************************************/ static void MenuButtonEnter ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(w); ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; XmMenuSystemTrait menuSTrait; int status; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(w)), XmQTmenuSystem); if (! menuSTrait) return; status = menuSTrait -> status(XtParent(w)); if ((((ShellWidget) XtParent(XtParent(mw)))->shell.popped_up) && XmIsInDragMode(status)) { menuSTrait -> childFocus(w); mw->menu_button.armed = True; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) ((Widget) mw); } } /********************************************************************** * * MenuButtonLeave * *********************************************************************/ static void MenuButtonLeave ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(w); ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; XmMenuSystemTrait menuSTrait; int status; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(w)), XmQTmenuSystem); if (! menuSTrait) return; status = menuSTrait -> status(XtParent(w)); if (XmIsInDragMode(status) && mw->menu_button.armed && event->xcrossing.mode == NotifyNormal) { mw->menu_button.armed = False; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) ((Widget) mw); } } /********************************************************************** * * ArmAndActivate * *********************************************************************/ static void ArmAndActivate ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; Boolean already_armed = mw->menu_button.armed; XmAnyCallbackStruct cb; Boolean parent_is_torn = False; Boolean torn_has_focus = False; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(w)), XmQTmenuSystem); if (menuSTrait == NULL) { /* We're in trouble. This isn't a valid menu that we're in and Arm and Activate has been called. Abort ! */ return; } if (!XmIsMenuShell(XtParent(XtParent(mw)))) { parent_is_torn = True; /* Because the pane is torn and the parent is a transient shell, * the shell's focal point should be valid * (as opposed to getting it from a MenuShell). */ if (XmeFocusIsInShell((Widget)mw)) { if (!XtIsSensitive((Widget)mw) || (!XtIsManaged((Widget)mw))) return; torn_has_focus = True; } } else { parent_is_torn = False; } mw->menu_button.armed = False; if (parent_is_torn && !torn_has_focus) { /* Freeze tear off visuals in case accelerators are not in * same context */ menuSTrait -> reparentToTearOffShell(XtParent(w), event); } if (torn_has_focus) menuSTrait -> popdown(XtParent(mw), event); else menuSTrait -> buttonPopdown(XtParent(mw), event); /* if its in a torn off menu pane, show depressed button briefly */ if (torn_has_focus) { /* Set the focus here. */ XmProcessTraversal ((Widget)mw, XmTRAVERSE_CURRENT); /* this should be done through draw-shadow!!!! */ XmeDrawShadows (XtDisplay(mw), XtWindow(mw), mw->primitive.bottom_shadow_GC, mw->primitive.top_shadow_GC, mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - 2 * mw->primitive.highlight_thickness, mw->core.height - 2 * mw->primitive.highlight_thickness, mw->primitive.shadow_thickness, XmSHADOW_OUT); } XFlush (XtDisplay(mw)); /* If the parent is a Menu, set the lastSelectToplevel before the arm. * It's ok if this is recalled later. */ menuSTrait -> getLastSelectToplevel(XtParent(mw)); cb.reason = XmCR_ACTIVATE; cb.event = event; /* if the parent is a Menu, notify it about the select */ menuSTrait -> entryCallback(XtParent(mw), (Widget) mw, &cb); if (! mw -> menu_button.skip_callback && mw->menu_button.activate_callback) { XFlush (XtDisplay (mw)); XtCallCallbackList ((Widget)mw, mw->menu_button.activate_callback, &cb); } mw->menu_button.armed = False; if (torn_has_focus) { /* Leave the focus widget in an armed state */ mw->menu_button.armed = True; } else { menuSTrait -> reparentToTearOffShell(XtParent(mw), event); } /* * If the button is still around, show it released, after a short delay. * This is done if the button is outside of a menus, or if in a torn * off menupane. */ if (torn_has_focus && mw->core.being_destroyed == False && mw->menu_button.visual_timer == 0) { mw->menu_button.visual_timer = XtAppAddTimeOut( XtWidgetToApplicationContext((Widget)mw), (unsigned long) VISUAL_DELAY, VisualDisarm, (XtPointer)(mw)); } } /********************************************************************** * * VisualDisarm: * * *********************************************************************/ static void VisualDisarm ( XtPointer cd, XtIntervalId *id ) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)cd; ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(mw); mw->menu_button.visual_timer = 0; if (XtIsRealized((Widget)mw) && XtIsManaged((Widget)mw)) { /* When rapidly clicking, the focus may have moved away from this widget, so check before changing the shadow. */ if (XmeFocusIsInShell((Widget)mw) && (XmGetFocusWidget((Widget)mw) == (Widget)mw) ) { /* in a torn off menu, redraw shadows */ /* Draw a Motif-style shadow. */ XmeDrawShadows (XtDisplay(mw), XtWindow(mw), mw->primitive.top_shadow_GC, mw->primitive.bottom_shadow_GC, mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - (2 * mw->primitive.highlight_thickness), mw->core.height - (2 * mw->primitive.highlight_thickness), mw->primitive.shadow_thickness, XmSHADOW_OUT); } XFlush (XtDisplay(mw)); } } /********************************************************************** * * BtnDown * *********************************************************************/ static void BtnDown ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(w); ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; XmAnyCallbackStruct cb; Boolean validButton = False; Boolean already_armed; ShellWidget popup; int status; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(mw)), XmQTmenuSystem); if (menuSTrait == NULL) { /* We're in trouble. This isn't a valid menu that we're in. Abort! */ return; } XAllowEvents (XtDisplay(mw), SyncPointer, CurrentTime); if (event && (event->type == ButtonPress)) validButton = menuSTrait -> verifyButton(XtParent(mw), event); if (!validButton) return; menuSTrait -> controlTraversal(XtParent(mw), True); status = menuSTrait -> status(XtParent(w)); /* Popdown other popus that may be up */ if (!(popup = (ShellWidget) menuSTrait -> getPopupPosted (XtParent(mw)))) { if (!XmIsMenuShell (XtParent(XtParent(mw)))) { /* In case tear off not armed and no grabs in place, do it now. * Ok if already armed and grabbed - nothing done. */ menuSTrait -> tearOffArm(XtParent(mw)); } } if (popup) { Widget aw; if (popup->shell.popped_up) menuSTrait -> popdownEveryone((Widget) popup, event); /* If active_child is a cascade (highlighted), unhighlight it. */ aw = ((XmManagerWidget)XtParent(mw))->manager.active_child; if (aw && ((XmIsCascadeButton(aw) || XmIsCascadeButtonGadget(aw)))) XmCascadeButtonHighlight (aw, False); } /* Set focus to this pushbutton. This must follow the possible * unhighlighting of the CascadeButton else it'll screw up active_child. */ (void)XmProcessTraversal( (Widget)mw, XmTRAVERSE_CURRENT); /* get the location cursor - get consistent with Gadgets */ already_armed = mw->menu_button.armed; mw->menu_button.armed = True; _XmRecordEvent(event); } /********************************************************************** * * BtnUp * *********************************************************************/ static void BtnUp ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; Widget parent = XtParent(mw); XmAnyCallbackStruct cb; Boolean flushDone = False; Boolean validButton = False; Boolean popped_up; Widget shell = XtParent(XtParent(mw)); XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(w)), XmQTmenuSystem); if (menuSTrait == NULL) { /* We're in trouble. This isn't a valid menu that we're in and Arm and Activate has been called. Abort ! */ return; } if (event && (event->type == ButtonRelease)) validButton = menuSTrait -> verifyButton(parent, event); if (!validButton || (mw->menu_button.armed == False)) return; mw->menu_button.armed = False; if (!XmIsMenuShell(shell)) popped_up = menuSTrait -> popdown(parent, event); else popped_up = menuSTrait -> buttonPopdown(parent, event); _XmRecordEvent(event); /* XmMENU_POPDOWN left the menu posted on button click - don't activate! */ if (popped_up) return; cb.reason = XmCR_ACTIVATE; cb.event = event; menuSTrait -> entryCallback(parent, (Widget) mw, &cb); if (! mw -> menu_button.skip_callback && mw->menu_button.activate_callback) { XFlush (XtDisplay(mw)); flushDone = True; XtCallCallbackList ((Widget)mw, mw->menu_button.activate_callback, &cb); } /* If the original shell does not indicate an active menu, but rather a * tear off pane, leave the button in an armed state. Also, briefly * display the button as depressed to give the user some feedback of * the selection. */ if (!XmIsMenuShell(shell)) { XmeDrawShadows (XtDisplay (mw), XtWindow (mw), mw->primitive.bottom_shadow_GC, mw->primitive.top_shadow_GC, mw->primitive.highlight_thickness, mw->primitive.highlight_thickness, mw->core.width - 2 * mw->primitive.highlight_thickness, mw->core.height - 2 * mw->primitive.highlight_thickness, mw->primitive.shadow_thickness, XmSHADOW_OUT); XFlush (XtDisplay (mw)); flushDone = True; if (mw->core.being_destroyed == False && mw->menu_button.visual_timer == 0) { mw->menu_button.visual_timer = XtAppAddTimeOut ( XtWidgetToApplicationContext((Widget)mw), (unsigned long)VISUAL_DELAY, VisualDisarm, (XtPointer)mw); } mw->menu_button.armed = True; } else { menuSTrait -> reparentToTearOffShell(XtParent(mw), event); } menuSTrait -> controlTraversal(XtParent(mw), False); /* For the benefit of tear off menus, we must set the focus item * to this button. In normal menus, this would not be a problem * because the focus is cleared when the menu is unposted. */ if (!XmIsMenuShell(shell)) XmProcessTraversal ((Widget)mw, XmTRAVERSE_CURRENT); } /********************************************************************** * * MenuButtonHelp * *********************************************************************/ static void MenuButtonHelp ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmMenuButtonWidgetClass wc = (ExmMenuButtonWidgetClass)XtClass(w); ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; XmMenuSystemTrait menuSTrait; menuSTrait = (XmMenuSystemTrait) XmeTraitGet((XtPointer) XtClass(XtParent(w)), XmQTmenuSystem); if (menuSTrait == NULL) { /* We're in trouble. This isn't a valid menu that we're in and Arm and Activate has been called. Abort ! */ return; } menuSTrait -> buttonPopdown(XtParent(mw), event); XtCallActionProc ((Widget)mw, "PrimitiveHelp", event, params, *num_params); menuSTrait -> reparentToTearOffShell(XtParent(mw), event); } /***********************************************************/ /* Trait method which allows the menu system to control */ /* the button's activate callback. This is used in */ /* conjunction with the entryCallback in RowColumn. The */ /* RowColumn callback (or other menu which supports the */ /* menuSavvy trait) is called via the */ /* childsActivateCallback in the menuSystem trait. */ /***********************************************************/ static void DisableCallback( Widget w, XtEnum value) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; mw->menu_button.skip_callback = !( value == XmENABLE_ACTIVATE); } static char* GetAccelerator(Widget w) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; return(mw -> menu_button.accelerator); } static KeySym GetMnemonic(Widget w) { ExmMenuButtonWidget mw = (ExmMenuButtonWidget)w; return(mw -> menu_button.mnemonic); } static char* GetActivateCBName() { return(XmNactivateCallback); } /************************************************************************ * * ExmCreateMenuButton * Externally accessable function for creating a MenuButton widget * ************************************************************************/ Widget ExmCreateMenuButton ( Widget parent, char *name, Arg *arglist, Cardinal argCount ) { return (XtCreateWidget(name,exmMenuButtonWidgetClass, parent,arglist,argCount)); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/StringTransP.h������������������������������������������������������������0000644�0001750�0001750�00000006030�12672140200�014731� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: StringTransP.h /main/4 1995/07/15 20:41:58 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * StringTransP.h: The widget private header file for the ExmStringTransfer * uniform transfer model demonstration widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmStringTransP_h #define _ExmStringTransP_h /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Include appropriate files. */ #include <Exm/StringTrans.h> /* public header file for the ExmStringTransfer widget */ #include <Exm/ExmStringP.h> /* private header file for the ExmString widget */ /* No new inheritable methods. */ /* Define the widget class part. */ typedef struct _ExmStringTransferClassPart { XtPointer extension; } ExmStringTransferClassPart; /* Define the full class record. */ typedef struct _ExmStringTransferClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; ExmSimpleClassPart simple_class; ExmStringClassPart string_class; ExmStringTransferClassPart string_transfer_class; } ExmStringTransferClassRec; /* Make the full class record externally accessible. */ externalref ExmStringTransferClassRec exmStringTransferClassRec; /* Define the widget instance part. */ typedef struct _ExmStringTransferPart { /* Fields and resources for ExmStringTransfer. */ XtCallbackList destination_callback; Boolean own_primary; } ExmStringTransferPart; /* Define the full instance record. */ typedef struct _ExmStringTransferRec { CorePart core; XmPrimitivePart primitive; ExmSimplePart simple; ExmStringPart string; ExmStringTransferPart string_transfer; } ExmStringTransferRec, *ExmStringTransfer; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmStringTransferIndex (ExmStringIndex + 1) /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmStringTransP_h */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Grid.c��������������������������������������������������������������������0000644�0001750�0001750�00000111552�12672140200�013221� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Grid.c /main/5 1995/07/15 20:40:45 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /********************************** WARNING ********************************** * * ExmGrid is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way *********************************** WARNING *********************************/ /****************************************************************************** * * Grid.c - ExmGrid widget. This widget manages its children as an MxN matrix. * The ExmGrid widget demonstrates how to * * create a relatively easy Motif manager widget. * * install and use the XmQTspecifyRenderTable trait. * * install and use the XmQTdialogShellSavvy trait. * See the "OSF/Motif Widget Writer's Guide" for details. * ******************************************************************************/ /* Include appropriate header files. */ #include <Exm/GridP.h> /* private header file for the ExmGrid widget */ #include <Xm/GadgetP.h> /* for gadget management functions */ #include <Xm/TraitP.h> /* for trait access functions */ #include <Xm/DialogSavvyT.h> /* for XmQTdialogSavvy trait */ #include <Xm/SpecRenderT.h> /* for XmQTspecifyRenderTable trait */ /* Define macros. */ #define Max(x, y) (((x) > (y)) ? (x) : (y)) #define WARNING_TOO_MANY_ROWS "Too many rows specified for ExmGrid.\n" #define WARNING_TOO_MANY_COLUMNS "Too many columns specified for ExmGrid.\n" /* Declare static functions. */ static void GetDialogTitle( Widget bb, int resource, XtArgVal *value) ; static void ClassPartInitialize( WidgetClass widgetClass); static void Initialize( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void Destroy( Widget wid) ; static void Resize ( Widget w ); static void Redisplay ( Widget w, XEvent *event, Region region); static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void SetValuesAlmost( Widget cw, Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply) ; static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply); static XtGeometryResult GeometryManager ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply); static void ChangeManaged ( Widget w); static Boolean ConstraintSetValues ( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void Layout ( Widget wid, Widget instigator); static void CalcSize ( Widget wid, Widget instigator, Dimension *gridWidth, Dimension *gridHeight); static Boolean NeedRelayout ( Widget new, Widget cur); static void CallMapUnmap(Widget wid, Boolean map_unmap) ; static XmRenderTable GetTable(Widget wid, XtEnum type); /* No translations and no actions. */ /* Define the resources for the ExmGrid widget. */ static XtResource resources[] = { { XmNrows, XmCRows, XmRShort, sizeof (short), XtOffsetOf( ExmGridRec, grid.rows), XmRImmediate, (XtPointer) 4 }, { XmNcolumns, XmCColumns, XmRShort, sizeof (short), XtOffsetOf( ExmGridRec, grid.columns), XmRImmediate, (XtPointer) 4 }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( ExmGridRec, grid.margin_width), XmRImmediate, (XtPointer) 10 }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf(ExmGridRec, grid.margin_height), XmRImmediate, (XtPointer) 10 }, { XmNmapCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(ExmGridRec, grid.map_callback), XmRImmediate, (XtPointer) NULL }, { XmNunmapCallback, XmCCallback, XmRCallback, sizeof (XtCallbackList), XtOffsetOf(ExmGridRec, grid.unmap_callback), XmRImmediate, (XtPointer) NULL }, { XmNdefaultPosition, XmCDefaultPosition, XmRBoolean, sizeof (Boolean), XtOffsetOf(ExmGridRec, grid.default_position), XmRImmediate, (XtPointer) True }, { XmNbuttonRenderTable, XmCButtonRenderTable, XmRButtonRenderTable, sizeof (XmRenderTable), XtOffsetOf(ExmGridRec, grid.button_render_table), XmRCallProc, (XtPointer) NULL }, { XmNlabelRenderTable, XmCLabelRenderTable, XmRLabelRenderTable, sizeof (XmRenderTable), XtOffsetOf(ExmGridRec, grid.label_render_table), XmRCallProc, (XtPointer) NULL }, { XmNtextRenderTable, XmCTextRenderTable, XmRTextRenderTable, sizeof (XmRenderTable), XtOffsetOf(ExmGridRec, grid.text_render_table), XmRCallProc, (XtPointer) NULL }, { XmNdialogTitle, XmCDialogTitle, XmRXmString, sizeof (XmString), XtOffsetOf(ExmGridRec, grid.dialog_title), XmRImmediate, (XtPointer) NULL }, }; /* Three of the preceding resources will be handled as synthetic resources. */ static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof (Dimension), XtOffsetOf( ExmGridRec, grid.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof (Dimension), XtOffsetOf( ExmGridRec, grid.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { XmNdialogTitle, sizeof (XmString), XtOffsetOf( ExmGridRec, grid.dialog_title), GetDialogTitle, NULL } }; /* Define the two constraints of ExmGrid. */ static XtResource constraints[] = { { ExmNgridMarginWidthWithinCell, ExmCGridMarginWidthWithinCell, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( ExmGridConstraintRec, grid.grid_margin_width_within_cell), XmRImmediate, (XtPointer) 0 }, { ExmNgridMarginHeightWithinCell, ExmCGridMarginHeightWithinCell, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf( ExmGridConstraintRec, grid.grid_margin_height_within_cell), XmRImmediate, (XtPointer) 0 }, }; /* Both of the preceding constraints will be handled as synthetic constraints. */ static XmSyntheticResource syn_constraints[] = { { ExmNgridMarginWidthWithinCell, sizeof (Dimension), XtOffsetOf( ExmGridConstraintRec, grid.grid_margin_width_within_cell), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { ExmNgridMarginHeightWithinCell, sizeof (Dimension), XtOffsetOf( ExmGridConstraintRec, grid.grid_margin_height_within_cell), XmeFromVerticalPixels, XmeToVerticalPixels }, }; /* Define the widget class record. See Chapter 4 of the "OSF/Motif Widget Writer's Guide" for details. */ externaldef(exmgridclassrec) ExmGridClassRec exmGridClassRec = { { /* Here is the Core class record. */ /* superclass */ (WidgetClass) &xmManagerClassRec, /* class_name */ "ExmGrid", /* widget_size */ sizeof(ExmGridRec), /* class_initialize */ NULL, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ SetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ QueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* Here is the Composite class record. */ /* geometry_manager */ GeometryManager, /* change_managed */ ChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* Here is the Constaint class record. */ /* constraint_resources */ constraints, /* constraint_num_resources */ XtNumber(constraints), /* constraint_size */ sizeof(ExmGridConstraintRec), /* constraint_initialize */ NULL, /* constraint_destroy */ NULL, /* constraint_set_values */ ConstraintSetValues, /* extension */ NULL, }, { /* Here is the XmManager class record. */ /* translations */ XtInheritTranslations, /* syn_resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* syn_constraint_resources */ syn_constraints, /* num_syn_constraint_resources */ XtNumber(syn_constraints), /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* Here is the ExmGrid class record. */ /* layout */ Layout, /* calc_size */ CalcSize, /* need_relayout */ NeedRelayout, /* extension */ NULL, } }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef(exmgridwidgetclass) WidgetClass exmGridWidgetClass = (WidgetClass) &exmGridClassRec; /* Define trait record variables. */ /* Here is the trait record variable for the XmQTdialogSavvy trait. */ static XmConst XmDialogSavvyTraitRec gridDST = { 0, /* version */ CallMapUnmap, /* trait method */ }; /* Here is the trait record variable for the XmQTspecifyRenderTable trait. */ static XmConst XmSpecRenderTraitRec gridSRTT = { 0, /* version */ GetTable, /* trait method */ }; /**************************************************************************** * * GetDialogTitle * Copy the XmString in XmNdialogTitle before returning it to the user. * ****************************************************************************/ static void GetDialogTitle( Widget wid, int resource, XtArgVal *value) { *value = (XtArgVal)XmStringCopy(((ExmGridWidget) wid)->grid.dialog_title); } /**************************************************************************** * * ClassPartInitialize: * Called when this widget or a subclass of this widget is instantiated. * ****************************************************************************/ static void ClassPartInitialize ( WidgetClass widgetClass ) { ExmGridWidgetClass wc = (ExmGridWidgetClass)widgetClass; ExmGridWidgetClass sc = (ExmGridWidgetClass)wc->core_class.superclass; /* The following code allows subclasses of ExmGrid to inherit three of ExmGrid's methods. */ if (wc->grid_class.layout == ExmInheritLayout) wc->grid_class.layout = sc->grid_class.layout; if (wc->grid_class.calc_size == ExmInheritCalcSize) wc->grid_class.calc_size = sc->grid_class.calc_size; if (wc->grid_class.need_relayout == ExmInheritNeedRelayout) wc->grid_class.need_relayout = sc->grid_class.need_relayout; /* Install the XmQTdialogShellSavyy trait on this class and on all its future subclasses. */ XmeTraitSet(widgetClass, XmQTdialogShellSavvy, (XtPointer) &gridDST); /* Install the XmQTspecifyRenderTable trait on this class and on all its future subclasses. */ XmeTraitSet(widgetClass, XmQTspecifyRenderTable, (XtPointer) &gridSRTT); } /************************************************************************** * * Initialize: * Called when this widget is first instantiated. * ***************************************************************************/ static void Initialize ( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmGridWidget rw = (ExmGridWidget)request_w; ExmGridWidget nw = (ExmGridWidget)new_w; /* Initialize one of the internal fields of the ExmGrid widget. */ nw->grid.processing_constraints = False; /* Ensure that user doesn't specify too many rows. */ if (rw->grid.rows > EXM_GRID_MAX_NUMBER_OF_ROWS) { XmeWarning((Widget)rw, WARNING_TOO_MANY_ROWS); nw->grid.rows = EXM_GRID_MAX_NUMBER_OF_ROWS; } /* Ensure that user doesn't specify too many columns. */ if (rw->grid.columns > EXM_GRID_MAX_NUMBER_OF_COLUMNS) { XmeWarning((Widget)rw, WARNING_TOO_MANY_COLUMNS); nw->grid.columns = EXM_GRID_MAX_NUMBER_OF_COLUMNS; } /* Copy in the dialog title XmString and update our shell */ if (nw->grid.dialog_title) { nw->grid.dialog_title = XmStringCopy(rw->grid.dialog_title) ; XmeSetWMShellTitle(nw->grid.dialog_title, XtParent(new_w)) ; } } /**************************************************************************** * * Destroy: * Called when the widget is destroyed. * ****************************************************************************/ static void Destroy( Widget wid ) { ExmGridWidget grid = (ExmGridWidget)wid; /* Deallocate the dynamic memory that holds the dialog_title. */ XmStringFree(grid->grid.dialog_title) ; } /**************************************************************************** * * Resize: * ****************************************************************************/ static void Resize ( Widget w ) { ExmGridWidgetClass gwc = (ExmGridWidgetClass) XtClass(w); /* Configure the children by calling Layout. */ if (gwc->grid_class.layout) (*(gwc->grid_class.layout))(w, NULL); else Layout (w, NULL); } /**************************************************************************** * * Redisplay: * Called by the Intrinsics in response to an exposure event. * ***************************************************************************/ static void Redisplay ( Widget w, XEvent *event, Region region ) { /* Pass exposure event down to gadget children. */ XmeRedisplayGadgets (w, event, region); } /***************************************************************************** * * SetValues: * Called by the Intrinsics whenever any of the resource values change. * ****************************************************************************/ static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmGridWidget cw = (ExmGridWidget)old_w; ExmGridWidget rw = (ExmGridWidget)request_w; ExmGridWidget nw = (ExmGridWidget)new_w; Boolean redisplay = False; Boolean need_relayout; ExmGridWidgetClass gwc = (ExmGridWidgetClass) XtClass(new_w); /* Ensure that user doesn't specify too many rows. */ if (rw->grid.rows > EXM_GRID_MAX_NUMBER_OF_ROWS) { XmeWarning((Widget)rw, WARNING_TOO_MANY_ROWS); nw->grid.rows = EXM_GRID_MAX_NUMBER_OF_ROWS; } /* Ensure that user doesn't specify too many rows. */ if (rw->grid.columns > EXM_GRID_MAX_NUMBER_OF_COLUMNS) { XmeWarning((Widget)rw, WARNING_TOO_MANY_COLUMNS); nw->grid.columns = EXM_GRID_MAX_NUMBER_OF_COLUMNS; } /* See if any class or subclass resources have changed. */ if (gwc->grid_class.need_relayout) need_relayout = (*(gwc->grid_class.need_relayout))(old_w, new_w); else need_relayout = NeedRelayout (old_w, new_w); /* If any geometry resources changed and a new size wasn't specified, recalculate a new ideal size. */ if (need_relayout) { /* Reset the widget size so that CalcSize can affect them. */ if (nw->core.width == cw->core.width) nw->core.width = 0; if (nw->core.height == cw->core.height) nw->core.height = 0; /* Call CalcSize. */ if (gwc->grid_class.calc_size) (*(gwc->grid_class.calc_size))(new_w, NULL, &nw->core.width, &nw->core.height); else CalcSize (new_w, NULL, &nw->core.width, &nw->core.height); /* If the geometry resources have changed but the size hasn't, we need to relayout manually, because Xt won't generate a Resize at this point. */ if ((nw->core.width == cw->core.width) && (nw->core.height == cw->core.height)) { /* Call Layout to configure the children. */ if (gwc->grid_class.layout) (*(gwc->grid_class.layout))(new_w, NULL); else Layout(new_w, NULL); redisplay = True ; } } /* ExmGrid installs the XmQTdialogShellSavvy trait. Therefore, ExmGrid has to process the Xm_DIALOG_SAVVY_FORCE_ORIGIN case, which is as follows. A DialogShell always mimics the child position on itself. That is, the "current" position of an ExmGrid within a DialogShell is always 0. Therefore, if an application tries to set ExmGrid's x or y position to 0, the Intrinsics will not detect a position change and wll not trigger a geometry request. ExmGrid has to detect this special request and set core.x and core.y to the special value, XmDIALOG_SAVVY_FORCE_ORIGIN. That is, XmDIALOG_SAVVY_FORCE_ORIGIN tells DialogShell that ExmGrid really does want to move to an x or y position of 0. */ if (XmIsDialogShell(XtParent(new_w))) { /* Is parent a DialogShell? */ Cardinal i ; /* We have to look in the arglist since old_w->core.x is always 0, and if new_w->core.x is also set to 0, we see no change. */ for (i=0; i<*num_args; i++) { if (strcmp (args[i].name, XmNx) == 0) { if ((args[i].value == 0) && (new_w->core.x == 0)) new_w->core.x = XmDIALOG_SAVVY_FORCE_ORIGIN; } if (strcmp (args[i].name, XmNy) == 0) { if ((args[i].value == 0) && (new_w->core.y == 0)) new_w->core.y = XmDIALOG_SAVVY_FORCE_ORIGIN; } } /* end for */ } /* end of if */ /* Update wm shell title if it has changed */ if(nw->grid.dialog_title != cw->grid.dialog_title ) { XmStringFree(cw->grid.dialog_title) ; nw->grid.dialog_title = XmStringCopy(rw->grid.dialog_title) ; XmeSetWMShellTitle(nw->grid.dialog_title, XtParent(new_w)) ; } return (redisplay); } /************************************************************************* * * SetValuesAlmost: * Called by the Intrinsics when an XtMakeGeometryRequest call * returns either XmGeometryAlmost or XtGeometryNo. * ***************************************************************************/ static void SetValuesAlmost( Widget cw, /* unused */ Widget nw, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { ExmGridWidgetClass gwc = (ExmGridWidgetClass) XtClass(nw); /* ExmGrid's parent said XtGeometryNo to ExmGrid's geometry request. Therefore, we need to relayout because this request was due to a change in internal geometry resource of the ExmGrid */ if (!reply->request_mode) { if (gwc->grid_class.layout) (*(gwc->grid_class.layout))(nw, NULL); else Layout(nw, NULL); } *request = *reply; } /************************************************************************* * * QueryGeometry: * Called by a parent of Grid when the parent needs to find out Grid's * preferred size. QueryGeometry calls CalcSize to do find the * preferred size. * ***************************************************************************/ static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { ExmGridWidgetClass gwc = (ExmGridWidgetClass) XtClass(w); /* If ExmGrid's parent calls XtQueryGeometry before ExmGrid has been realized, use the current size of ExmGrid as the preferred size. */ /* Deal with user initial size setting */ if (!XtIsRealized(w)) { /* Widget is not yet realized. */ reply->width = XtWidth(w) ; /* might be 0 */ reply->height = XtHeight(w) ; /* might be 0 */ } else { /* Widget is realized. */ /* always computes natural size afterwards */ reply->width = 0; reply->height = 0; } /* Call CalcSize to figure out what the preferred size really is. */ if (gwc->grid_class.calc_size) (*(gwc->grid_class.calc_size))(w, NULL, &reply->width, &reply->height); else CalcSize (w, NULL, &reply->width, &reply->height); /* This function handles CWidth and CHeight */ return XmeReplyToQueryGeometry(w, request, reply) ; } /**************************************************************************** * * GeometryManager: * Called by Intrinsics in response to a geometry change request from * one of the children of ExmGrid. * ***************************************************************************/ static XtGeometryResult GeometryManager ( Widget w, /* instigator */ XtWidgetGeometry *request, XtWidgetGeometry *reply ) { ExmGridWidget gw = (ExmGridWidget) XtParent(w); XtWidgetGeometry parentRequest; XtGeometryResult result; Dimension curWidth, curHeight, curBW; ExmGridWidgetClass gwc = (ExmGridWidgetClass) XtClass((Widget)gw); /* If the request was caused by ConstraintSetValues reset the flag */ if (gw->grid.processing_constraints) { gw->grid.processing_constraints = False; /* The ConstraintSetValues added one to border_width; This is the Xt trick used to fire the GM when a non core geometry resource (like a constraint) changes. now take it away. */ request->border_width -= 1; } /* Save the original child resources. */ curWidth = w->core.width; curHeight = w->core.height; curBW = w->core.border_width; /* Deny any requests for a new position. */ if ((request->request_mode & CWX) || (request->request_mode & CWY)) return XtGeometryNo ; if (request->request_mode & CWWidth) w->core.width = request->width; if (request->request_mode & CWHeight) w->core.height = request->height; if (request->request_mode & CWBorderWidth) w->core.border_width = request->border_width; /* Calculate a new ideal size based on these requests. */ /* Setting width and height to 0 tells CalcSize to override these fields with the calculated width and height. */ parentRequest.width = 0; parentRequest.height = 0; if (gwc->grid_class.calc_size) (*(gwc->grid_class.calc_size))((Widget)gw, w, &parentRequest.width, &parentRequest.height); else CalcSize ((Widget)gw, w, &parentRequest.width, &parentRequest.height); /* Ask the Grid's parent if new calculated size is acceptable. */ parentRequest.request_mode = CWWidth | CWHeight; if (request->request_mode & XtCWQueryOnly) parentRequest.request_mode |= XtCWQueryOnly; result = XtMakeGeometryRequest ((Widget)gw, &parentRequest, NULL); /* Turn XtGeometryAlmost into XtGeometryNo. */ if (result == XtGeometryAlmost) result = XtGeometryNo; if (result == XtGeometryNo || request->request_mode & XtCWQueryOnly) { /* Restore original geometry. */ w->core.width = curWidth; w->core.height = curHeight; w->core.border_width = curBW; } else { /* result == XtGeometryYes and this wasn't just a query */ if (gwc->grid_class.layout) (*(gwc->grid_class.layout))((Widget)gw, w); else Layout ((Widget)gw, w); /* Layout with this child as the instigator, so that we don't resize this child. */ } return (result); } /************************************************************************** * * ChangeManaged: * Called by the Intrinsics whenever either of the following happens: * * a managed child becomes unmanaged. * * an unmanaged child becomes managed. * *************************************************************************/ static void ChangeManaged( Widget w ) { Dimension gridWidth, gridHeight; ExmGridWidgetClass gwc = (ExmGridWidgetClass) XtClass(w); /* If you get an initial (C) size from the user or application, keep it. Otherwise, just force width and height to 0 so that CalcSize will overwrite the appropriate fields. */ if (!XtIsRealized(w)) { /* The first time, only attempts to change non specified sizes */ gridWidth = XtWidth(w) ; /* might be 0 */ gridHeight = XtHeight(w) ; /* might be 0 */ } else { gridWidth = 0 ; gridHeight = 0 ; } /* Determine the ideal size of Grid. */ if (gwc->grid_class.calc_size) (*(gwc->grid_class.calc_size))(w, NULL, &gridWidth, &gridHeight); else CalcSize (w, NULL, &gridWidth, &gridHeight); /* Ask parent of Grid if Grid's new size is acceptable. Keep asking until parent returns either XtGeometryYes or XtGeometryNo. */ while (XtMakeResizeRequest (w, gridWidth, gridHeight, &gridWidth, &gridHeight) == XtGeometryAlmost); /* Now that we have a size for the Grid, we can layout the children of the grid. */ if (gwc->grid_class.layout) (*(gwc->grid_class.layout))(w, NULL); else Layout (w, NULL); /* Update keyboard traversal */ XmeNavigChangeManaged (w); } /************************************************************************** * * ConstraintSetValues: * Called by Intrinsics if there is any change in any of the constraint * resources. * **************************************************************************/ static Boolean ConstraintSetValues ( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { ExmGridConstraint nc; ExmGridConstraint cc; ExmGridWidget gw; if (!XtIsRectObj (nw)) return (False); gw = (ExmGridWidget)XtParent(nw); nc = ExmGridCPart(nw); cc = ExmGridCPart(cw); /* Check for change in ExmNgridMarginWidth or ExmNgridMarginHeight */ if ((nc->grid_margin_width_within_cell != cc->grid_margin_width_within_cell || nc->grid_margin_height_within_cell != cc->grid_margin_height_within_cell) && XtIsManaged (nw)) { /* Tell the Intrinsics and the GeometryManager method that a reconfigure is needed. */ gw->grid.processing_constraints = True; /* A trick: by altering one of the core geometry fields, Xt will call the parent's geometry_manager method. */ nw->core.border_width += 1; } return (False); } /*************************************************************************** * * Layout: * Does all the placement of children. * Instigator tells whether or not to resize all children. * *************************************************************************/ static void Layout ( Widget wid, Widget instigator ) { ExmGridWidget gw = (ExmGridWidget) wid ; Dimension mw = gw->grid.margin_width; Dimension mh = gw->grid.margin_height; Dimension TotalWidthOfGridWidget = gw->core.width; Dimension TotalWidthOfGridMargins, TotalHeightOfGridMargins; Dimension TotalHeightOfGridWidget = gw->core.height; Dimension AvailWidthForChildren = 1, AvailHeightForChildren = 1; Dimension WidthAllottedEachChild, HeightAllottedEachChild; int i, row, column; /* Lay out the children that ExmGrid is currently managing. Each child will be placed somewhere on the rowxcolumn grid. */ TotalWidthOfGridMargins = 2 * mw; if (TotalWidthOfGridWidget > TotalWidthOfGridMargins) AvailWidthForChildren = TotalWidthOfGridWidget - TotalWidthOfGridMargins; WidthAllottedEachChild = AvailWidthForChildren / gw->grid.columns; TotalHeightOfGridMargins = 2 * mh; if (TotalHeightOfGridWidget > TotalHeightOfGridMargins) AvailHeightForChildren = TotalHeightOfGridWidget - TotalHeightOfGridMargins; HeightAllottedEachChild = AvailHeightForChildren / gw->grid.rows; /* Now that we know how much space is allotted for each child, we can lay them all out. */ row = 0; column = 0; for (i = 0; i < gw->composite.num_children; i++) { Widget ic = gw->composite.children[i]; ExmGridConstraint glc = ExmGridCPart (ic); Dimension gmw = glc->grid_margin_width_within_cell; Dimension gmh = glc->grid_margin_height_within_cell; Position ChildsStartingX, ChildsStartingY; Dimension ChildsActualWidth, ChildsActualHeight, cb; if (!XtIsManaged(ic)) continue; /* ignored unmanaged children */ cb = ic->core.border_width; /* Calculate the position and the size of the child. During the layout, the children are all resized to exactly fit the cell size minus the cell margin */ ChildsActualWidth = WidthAllottedEachChild - (2 * (gmw + cb)); ChildsStartingX = mw + (column * WidthAllottedEachChild) + gmw; ChildsStartingY = mh + (row * HeightAllottedEachChild) + gmh; ChildsActualHeight = HeightAllottedEachChild - 2 * (gmh + cb); /* If layout is instigated by the GeometryManager don't configure the requesting child, just set its geometry and let Xt configure it. */ if (ic != instigator) { XmeConfigureObject (ic, ChildsStartingX, ChildsStartingY, ChildsActualWidth, ChildsActualHeight, cb); } else { ic->core.x = ChildsStartingX; ic->core.y = ChildsStartingY; ic->core.width = ChildsActualWidth; ic->core.height = ChildsActualHeight; ic->core.border_width = cb; } /* Advance the column counter until we reach the right edge. When we reach the right edge, reset the column counter back to 0 (left edge) and advance the row counter. */ column += 1; if (column == gw->grid.columns) { column = 0; row += 1; } } } /****************************************************************************** * * CalcSize: * Called by QueryGeometry, SetValues, GeometryManager, and ChangeManaged. * Calculate the ideal size of the ExmGrid widget. * Only affects the returned size if it is 0. * ****************************************************************************/ static void CalcSize ( Widget wid, Widget instigator, Dimension *TotalWidthOfGridWidget, Dimension *TotalHeightOfGridWidget ) { ExmGridWidget gw = (ExmGridWidget) wid ; Dimension maxWidth = 1; Dimension maxHeight = 1; int i; /* Examine each of Grid's children. Find the biggest child. The ideal size of the Grid will be large enough to accomodate the largest child. */ for (i = 0; i < gw->composite.num_children; i++) { Widget ic = gw->composite.children[i]; ExmGridConstraint glc = ExmGridCPart (ic); Dimension width, height; Dimension cw, ch, cb; XtWidgetGeometry reply; if (!XtIsManaged(ic)) continue ; /* Get child's preferred geometry if not the instigator. */ if (ic != instigator) { XtQueryGeometry (ic, NULL, &reply); cw = (reply.request_mode & CWWidth) ? reply.width : ic->core.width; ch = (reply.request_mode & CWHeight) ? reply.height : ic->core.height; } else { cw = ic->core.width; ch = ic->core.height; } cb = ic->core.border_width; width = cw + 2 * (cb + glc->grid_margin_width_within_cell); height = ch + 2 * (cb + glc->grid_margin_height_within_cell); maxWidth = Max (width, maxWidth); maxHeight = Max (height, maxHeight); } /* The total width of the grid widget should be set to the width of the largest child widget times the number of columns. */ if (!*TotalWidthOfGridWidget) { *TotalWidthOfGridWidget = maxWidth * gw->grid.columns + (2 * (gw->grid.margin_width)); } /* The total height of the grid widget should be set to the height of the largest child widget times the number of columns. */ if (!*TotalHeightOfGridWidget) { *TotalHeightOfGridWidget = maxHeight * gw->grid.rows + (2 * (gw->grid.margin_height)); } } /**************************************************************************** * * NeedRelayout: * Called by SetValues. * Returns True if a relayout is needed. * based on this class and all superclass resources' changes. * ***************************************************************************/ static Boolean NeedRelayout ( Widget old_w, Widget new_w ) { ExmGridWidget cw = (ExmGridWidget)old_w; ExmGridWidget nw = (ExmGridWidget)new_w; if (nw->grid.margin_width != cw->grid.margin_width || nw->grid.margin_height != cw->grid.margin_height || nw->grid.rows != cw->grid.rows || nw->grid.columns != cw->grid.columns) { return True ; } else return False ; } /*-- Trait methods --*/ /**************************************************************** * * Trait method for XmQTdialogShellSavvy trait. * **************************************************************/ static void CallMapUnmap( Widget wid, Boolean map_unmap) { ExmGridWidget grid = (ExmGridWidget) wid ; XmAnyCallbackStruct call_data; call_data.reason = (map_unmap)? XmCR_MAP : XmCR_UNMAP; call_data.event = NULL; if (map_unmap) { XtCallCallbackList (wid, grid->grid.map_callback, &call_data); } else { XtCallCallbackList (wid, grid->grid.unmap_callback, &call_data); } } /***************************************************************** * * Trait method for XmQTspecifyRenderTable. * *****************************************************************/ static XmRenderTable GetTable( Widget wid, XtEnum type) { ExmGridWidget grid = (ExmGridWidget) wid ; switch(type) { case XmLABEL_RENDER_TABLE : return grid->grid.label_render_table ; case XmBUTTON_RENDER_TABLE : return grid->grid.button_render_table ; case XmTEXT_RENDER_TABLE : return grid->grid.text_render_table ; } return NULL ; } /******************************************************************************* * * ExmCreateGrid: * Called by an application. * ******************************************************************************/ Widget ExmCreateGrid ( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { /* This is a convenience function to instantiate an ExmGrid widget. */ return (XtCreateWidget (name, exmGridWidgetClass, parent, arglist, argcount)); } /******************************************************************************* * * ExmCreateGridDialog * Called by an application to create an ExmGrid managed by a * DialogShell. * ******************************************************************************/ Widget ExmCreateGridDialog ( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return XmeCreateClassDialog (exmGridWidgetClass, parent, name, arglist, argcount) ; } ������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/MenuBP.h������������������������������������������������������������������0000644�0001750�0001750�00000004272�12672140200�013467� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: MenuBP.h /main/4 1995/07/15 20:41:06 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _ExmMenuBP_h #define _ExmMenuBP_h #include <Exm/MenuB.h> #include <Exm/ExmStringP.h> typedef struct _ExmMenuButtonClassPart { XtPointer extension; } ExmMenuButtonClassPart; typedef struct _ExmMenuButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; ExmSimpleClassPart simple_class; ExmStringClassPart string_class; ExmMenuButtonClassPart menu_button_class; } ExmMenuButtonClassRec; extern ExmMenuButtonClassRec exmMenuButtonClassRec; typedef struct _ExmMenuButtonPart { XtCallbackList activate_callback; Boolean armed; Boolean skip_callback; XtIntervalId visual_timer; KeySym mnemonic; XmStringCharSet mnemonic_charset; char* accelerator; XmString accelerator_text; } ExmMenuButtonPart; typedef struct _ExmMenuButtonRec { CorePart core; XmPrimitivePart primitive; ExmSimplePart simple; ExmStringPart string; ExmMenuButtonPart menu_button; } ExmMenuButtonRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmMenuButtonIndex (ExmCommandIndex + 1) /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #endif /* _ExmMenuBP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/SimpleP.h�����������������������������������������������������������������0000644�0001750�0001750�00000011767�12672140200�013721� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: SimpleP.h /main/5 1995/07/15 20:41:32 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * SimpleP.h: The widget private header file for the ExmSimple demonstration * widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmSimpleP_h #define _ExmSimpleP_h /* Include appropriate files. */ #include <Exm/Simple.h> /* public header file for the ExmSimple widget */ #include <Xm/PrimitiveP.h> /* private header file for the XmPrimitive widget */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Make the following seven methods inheritable by subclasses of ExmSimple. */ #define ExmInheritDrawVisual ((XtWidgetProc) _XtInherit) #define ExmInheritDrawShadow ((XtWidgetProc) _XtInherit) #define ExmInheritCreateGC ((XtWidgetProc) _XtInherit) #define ExmInheritDestroyGC ((XtWidgetProc) _XtInherit) #define ExmInheritSelectGC ((ExmSelectGCProc) _XtInherit) #define ExmInheritCalcVisualSize ((XtWidgetProc) _XtInherit) #define ExmInheritCalcWidgetSize ((XtWidgetProc) _XtInherit) #define ExmInheritReconfigure ((ExmReconfigureProc) _XtInherit) /* Provide typedefs for inheritable methods that do not already have an appropriate data type. */ typedef GC (*ExmSelectGCProc)( Widget); typedef void (*ExmReconfigureProc)( WidgetClass, Widget, Widget) ; /* Define the widget class part. */ typedef struct _ExmSimpleClassPart { XtWidgetProc draw_visual; XtWidgetProc draw_shadow; XtWidgetProc create_gc; XtWidgetProc destroy_gc; ExmSelectGCProc select_gc; XtWidgetProc calc_visual_size; XtWidgetProc calc_widget_size; ExmReconfigureProc reconfigure; XtPointer extension; } ExmSimpleClassPart; /* Define the full class record. */ typedef struct _ExmSimpleClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; ExmSimpleClassPart simple_class; } ExmSimpleClassRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmSimpleIndex (XmPrimitiveIndex + 1) /* Make the full class record externally accessible. */ externalref ExmSimpleClassRec exmSimpleClassRec; /* Define the widget instance part. */ typedef struct _ExmSimplePart { /* Provide space for the three resources of ExmSimple. */ unsigned char simple_shape; Dimension margin_height; Dimension margin_width; /* Provide space for the other protected fields of ExmSimple. */ /* normal_gc holds a Graphics Context for rendering the visual when the value of XmNsensitive is True. */ GC normal_gc; /* insensitive_gc holds a Graphics Context for rendering the visual when the value of XmNsensitive is False. */ GC insensitive_gc; /* pref_width holds an integral value representing the widget's current preferred width. */ Dimension pref_width; /* pref_width holds an integral value representing the widget's current preferred height. */ Dimension pref_height; /* need_to_compute_width is a flag. If its value is True, then the widget needs to renegotiate its width. */ Boolean need_to_compute_width; /* need_to_compute_height is a flag. If its value is True, then the widget needs to renegotiate its height. */ Boolean need_to_compute_height; /* visual is an XRectangle value representing the bounding box of the widget's visual. */ XRectangle visual; /* need_to_reconfigure is a flag. If its value is True, then the widget needs to call the reconfigure method. */ Boolean need_to_reconfigure; /* saved_foreground is used for the management of the selected state */ Pixel saved_foreground; } ExmSimplePart; /* Define the full instance record. */ typedef struct _ExmSimpleRec { CorePart core; XmPrimitivePart primitive; ExmSimplePart simple; } ExmSimpleRec; /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmSimpleP_h */ /* Don't add anything after this #endif */ ���������motif-2.3.8/demos/lib/Exm/CommandBP.h���������������������������������������������������������������0000644�0001750�0001750�00000006600�12672140200�014136� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: CommandBP.h /main/4 1995/07/15 20:40:31 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * CommandBP.h: The widget private header file for the ExmCommandButton * demonstration widget. * ******************************************************************************/ /* Ensure that this file be included only once. */ #ifndef _ExmCommandBP_h #define _ExmCommandBP_h /* Include appropriate files. */ #include <Exm/CommandB.h> /* public header file for ExmCommandButton */ #include <Exm/ExmStringP.h> /* private header file for ExmSimple */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Don't define any inheritable methods. */ /* Define the widget class part. */ typedef struct _ExmCommandButtonClassPart { XtPointer extension; } ExmCommandButtonClassPart; /* Define the full class record. */ typedef struct _ExmCommandButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; ExmSimpleClassPart simple_class; ExmStringClassPart string_class; ExmCommandButtonClassPart command_button_class; } ExmCommandButtonClassRec; /* Make the full class record exteranlly accessible. */ externalref ExmCommandButtonClassRec exmCommandButtonClassRec; /* Define the widget instance part. */ typedef struct _ExmCommandButtonPart { XtCallbackList activate_callback; Boolean show_as_default; /* armed is a flag. If its value is True, then the user has selected the widget. */ Boolean armed; /* visual_armed is a flag. If its value is True, then the widget is to visually represent its armed state by drawing a certain kind of shadow. */ Boolean visual_armed; /* visual_timer holds an integral value representing the time (in milliseconds) between when armed is set to True and visual_armed is set to True. */ XtIntervalId visual_timer; } ExmCommandButtonPart; /* Define the full instance record. */ typedef struct _ExmCommandButtonRec { CorePart core; XmPrimitivePart primitive; ExmSimplePart simple; ExmStringPart string; ExmCommandButtonPart command_button; } ExmCommandButtonRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmCommandButtonIndex (ExmStringIndex + 1) /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmCommandBP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ��������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Makefile.in���������������������������������������������������������������0000644�0001750�0001750�00000060472�13211512765�014252� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/lib/Exm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libExm_a_AR = $(AR) $(ARFLAGS) libExm_a_LIBADD = am_libExm_a_OBJECTS = CommandB.$(OBJEXT) Grid.$(OBJEXT) \ Panner.$(OBJEXT) MenuB.$(OBJEXT) Simple.$(OBJEXT) \ ExmString.$(OBJEXT) StringTrans.$(OBJEXT) TabB.$(OBJEXT) libExm_a_OBJECTS = $(am_libExm_a_OBJECTS) libExmMrm_a_AR = $(AR) $(ARFLAGS) libExmMrm_a_LIBADD = am_libExmMrm_a_OBJECTS = ExmMrm.$(OBJEXT) libExmMrm_a_OBJECTS = $(am_libExmMrm_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libExm_a_SOURCES) $(libExmMrm_a_SOURCES) DIST_SOURCES = $(libExm_a_SOURCES) $(libExmMrm_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = wml noinst_LIBRARIES = libExm.a libExmMrm.a INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/.. -I$(top_builddir)/lib ${X_CFLAGS} CLEANFILES = Grid.E libExm_a_SOURCES = CommandB.c Grid.c Panner.c MenuB.c \ Simple.c ExmString.c StringTrans.c TabB.c libExmMrm_a_SOURCES = ExmMrm.c noinst_HEADERS = CommandB.h CommandBP.h ExmMrm.h Grid.h \ GridP.h MenuB.h MenuBP.h Panner.h \ PannerP.h Simple.h SimpleP.h ExmString.h \ ExmStringP.h StringTrans.h StringTransP.h TabB.h \ TabBP.h EXTRA_DIST = all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/lib/Exm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/lib/Exm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libExm.a: $(libExm_a_OBJECTS) $(libExm_a_DEPENDENCIES) $(EXTRA_libExm_a_DEPENDENCIES) $(AM_V_at)-rm -f libExm.a $(AM_V_AR)$(libExm_a_AR) libExm.a $(libExm_a_OBJECTS) $(libExm_a_LIBADD) $(AM_V_at)$(RANLIB) libExm.a libExmMrm.a: $(libExmMrm_a_OBJECTS) $(libExmMrm_a_DEPENDENCIES) $(EXTRA_libExmMrm_a_DEPENDENCIES) $(AM_V_at)-rm -f libExmMrm.a $(AM_V_AR)$(libExmMrm_a_AR) libExmMrm.a $(libExmMrm_a_OBJECTS) $(libExmMrm_a_LIBADD) $(AM_V_at)$(RANLIB) libExmMrm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CommandB.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExmMrm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExmString.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MenuB.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Panner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Simple.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringTrans.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TabB.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/GridP.h�������������������������������������������������������������������0000644�0001750�0001750�00000011005�12672140200�013336� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: GridP.h /main/5 1995/07/15 20:40:53 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * GridP.h: The widget private header file for the ExmGrid widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmGridP_h #define _ExmGridP_h /* Include appropriate files. */ #include <Exm/Grid.h> /* public header file for ExmGrid */ #include <Xm/ManagerP.h> /* private header file for XmManager */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Make the following two methods inheritable by subclasses of ExmGrid. */ #define ExmInheritLayout ((ExmLayoutProc) _XtInherit) #define ExmInheritCalcSize ((ExmCalcSizeProc) _XtInherit) #define ExmInheritNeedRelayout ((ExmNeedRelayoutProc) _XtInherit) /* Define new data types for these two inheritable methods. */ typedef void (*ExmLayoutProc)( Widget, Widget); typedef void (*ExmCalcSizeProc)( Widget, Widget, Dimension *, Dimension *); typedef Boolean (*ExmNeedRelayoutProc)( Widget, Widget); /* Define the widget class part. */ typedef struct { ExmLayoutProc layout; ExmCalcSizeProc calc_size; ExmNeedRelayoutProc need_relayout; XtPointer extension; } ExmGridClassPart; /* Define the full class record. */ typedef struct _ExmGridClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; ExmGridClassPart grid_class; } ExmGridClassRec; externalref ExmGridClassRec exmGridClassRec; /* Define the widget instance part. */ typedef struct { /* Provide space for the values of the four resources of ExmGrid. */ short rows; short columns; Dimension margin_width; Dimension margin_height; XtCallbackList map_callback; XtCallbackList unmap_callback; Boolean default_position; XmRenderTable button_render_table ; XmRenderTable label_render_table ; XmRenderTable text_render_table ; XmString dialog_title; /* processing_constraints is a flag. If its value is True, then it means that the ConstraintSetValues method is requesting a geometry change. */ Boolean processing_constraints; } ExmGridPart; /* Establish an arbitrary limit */ #define EXM_GRID_MAX_NUMBER_OF_ROWS 100 #define EXM_GRID_MAX_NUMBER_OF_COLUMNS 100 /* Define the full instance record. */ typedef struct _ExmGridRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; ExmGridPart grid; } ExmGridRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmGridIndex (XmManagerIndex + 1) /* Define the constraint part structure. */ typedef struct _ExmGridConstraintPart { Dimension grid_margin_width_within_cell; Dimension grid_margin_height_within_cell; } ExmGridConstraintPart, * ExmGridConstraint; /* Define the full constraint structure. */ typedef struct _ExmGridConstraintRec { XmManagerConstraintPart manager; ExmGridConstraintPart grid; } ExmGridConstraintRec, * ExmGridConstraintPtr; /* Define macros for this class. */ #define ExmGridCPart(w) \ (&((ExmGridConstraintPtr) (w)->core.constraints)->grid) /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmGridP_h */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/TabB.c��������������������������������������������������������������������0000644�0001750�0001750�00000112305�13066310437�013152� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: TabB.c /main/5 1995/07/15 20:42:02 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /*********************************** WARNING ********************************** * * ExmTabButton is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way *********************************** WARNING *********************************/ /****************************************************************************** * * TabB.c - ExmTabButton widget. This widget can serve as a Notebook tab. * This widget can affix itself to any parent widget that knows how * to call the appropriate XmQTjoinSide trait methods. * The ExmTabButton widget demonstrates how to * * install the XmQTjoinSide trait. * * use XmeDrawHighlight * * use XmeClearBorder * * use XmeDrawShadows * * use XmeResolvePartOffsets * See the "OSF/Motif Widget Writer's Guide" for details. * ******************************************************************************/ #include <Xm/XmP.h> /* private header file for XmPrimitive */ #include <Exm/TabBP.h> /* private header file for ExmTabButton widget */ #include <Xm/DrawP.h> /* for XmeDraw functions */ #include <Xm/TraitP.h> /* for XmeTrait functions */ #include <Xm/RepType.h> /* for representation type facility */ #include <Xm/SpecRenderT.h> /* defines RENDER_TABLE types. */ #include <Xm/JoinSideT.h> /* for XmQTjoinSide trait */ #include <X11/extensions/shape.h> #define WARNING_SHAPE_CHANGED "Widget not allowed to change shape" #define WARNING_NO_SHAPE_EXTENSION "No Shape extension, style = rectangular" /* Define the macros that we want to go thru offset. */ /* No need to offset primitive or core fields; the Intrinsics will not break binary compatibility. */ #define OpenSide(w) \ XmField(w, offsets, ExmTabButton, open_side, XtEnum) #define JoinShadowThickness(w) \ XmField(w, offsets, ExmTabButton, join_shadow_thickness, Dimension) #define VisualArmed(w) \ XmField(w, offsets, ExmCommandButton, visual_armed, Boolean) #define SimpleShape(w) \ XmField(w, offsets, ExmSimple, simple_shape, unsigned char) #define NeedToReconfigure(w) \ XmField(w, offsets, ExmSimple, need_to_reconfigure, Boolean) #define DEFAULT_CORNER_ROUND_PERCENT 40 /* corber size based on percent of the smaller dimension of the button */ #define CORNER_SIZE(w) \ ((((w->core.width < w->core.height) ? w->core.width \ : w->core.height) * DEFAULT_CORNER_ROUND_PERCENT) / 100) /* Declare all static functions. */ static void ClassInitialize(void) ; static void ClassPartInitialize( WidgetClass wc) ; static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void FixVisualPosition( Widget w ); static void Resize( Widget w ); static void FillOpenRoundedRectangle( Display *dpy, Drawable draw, GC top_gc, GC bottom_gc, GC bg_gc, int x, int y, int w, int h, int shad_thick, int corner_size, unsigned char open_side); static void ShapeButton( Widget w); static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ); static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args) ; static void GetHighlightRectangle ( ExmTabButtonWidget tb, XRectangle * hrect); static void BorderHighlight( Widget wid) ; static void BorderUnhighlight( Widget wid) ; static void DrawShadow( Widget wid); static void JoinSideSetValue(Widget tab, unsigned char join_side, Dimension join_thickness); static unsigned char JoinSideGetValue(Widget tab, Dimension *join_thickness); /* ExmTabButton provides no new translations. All of its translations are inherited from ExmCommandButton. */ /* ExmTabButton provides only one new resource. Use the resolve part offset type of resource */ static XmPartResource resources[] = { { ExmNopenSide, ExmCOpenSide, ExmROpenSide, sizeof (XtEnum), XmPartOffset (ExmTabButton, open_side), XmRImmediate, (XtPointer) XmLEFT }, }; /* No synthetic resources. */ /* Define the widget class record. See Chapter 3 of the "OSF/Motif Widget Writer's Guide for details. */ externaldef(exmtabbuttonclassrec) ExmTabButtonClassRec exmTabButtonClassRec = { { /* Here is the Core class record. */ /* superclass */ (WidgetClass) &exmCommandButtonClassRec, /* class_name */ "ExmTabButton", /* widget_size */ sizeof(ExmTabButtonPart), /* class_initialize */ ClassInitialize, /* class_part_init */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ (XtArgsProc)NULL, /* realize */ Realize, /* actions */ NULL, /* num_actions */ 0, /* resources */ (XtResourceList) resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterlv */ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ Resize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ (XtArgsFunc)NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ (XtArgsProc)NULL, /* accept_focus */ (XtAcceptFocusProc)NULL, /* version */ XtVersionDontCheck, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ (XtStringProc)NULL, /* extension record */ NULL, }, { /* Here is the XmPrimitive class record. */ /* border_highlight */ BorderHighlight, /* border_unhighlight */ BorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ XmInheritArmAndActivate, /* get resources */ NULL, /* num get_resources */ 0, /* extension */ NULL, }, { /* Here is the ExmSimple class record. */ /* draw_visual */ ExmInheritDrawVisual, /* draw_shadow */ DrawShadow, /* create_gc */ ExmInheritCreateGC, /* destroy_gc */ ExmInheritDestroyGC, /* select_gc */ ExmInheritSelectGC, /* calc_visual_size */ ExmInheritCalcVisualSize, /* calc_widget_size */ ExmInheritCalcWidgetSize, /* reconfigure */ ExmInheritReconfigure, /* extension */ NULL, }, { /* Here is the ExmString class record. */ /* default_render_table_type */ XmBUTTON_RENDER_TABLE, /* extension */ NULL, }, { /* Here is the ExmCommandButton class record. */ /* extension */ NULL, }, { /* Here is the ExmTabButton class record. */ /* extension */ NULL, }, }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef(exmtabbuttonwidgetclass) WidgetClass exmTabButtonWidgetClass = (WidgetClass)&exmTabButtonClassRec; /* Define static representation type variables here. ExmTabButton introduces one new representation type. */ static String OpenSideNames[] = { "none", "left", "right", "top", "bottom" }; static XmRepTypeId openSideId; /* Define trait structure variables here. */ /* This widget will install the XmQTjoinSide trait. */ static XmConst XmJoinSideTraitRec tabButtonOST = { 0, /* version */ JoinSideSetValue, JoinSideGetValue, }; /* Part Offset table for XmResolvePartOffsets */ static XmOffsetPtr offsets; /************************************************************************* * * ClassInitialize * Called by the Intrinsics the first time a widget of this class is * instantiated. * ************************************************************************/ static void ClassInitialize() { /* Register new representation types. These new representation types will hold the names of the valid values of the ExmNopenSide resource. */ openSideId = XmRepTypeRegister (ExmROpenSide, OpenSideNames, NULL, XtNumber(OpenSideNames)); /* resolve the offsets so that our XmField macro works fine */ XmeResolvePartOffsets(exmTabButtonWidgetClass, &offsets, NULL); } /************************************************************************ * * ClassPartInitialize * Called by the Intrinsics when this widget or a subclass of this * widget is intantiated. * ************************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { /* Install the XmQTjoinSide trait on the ExmTabButton class and on all its subclasses. */ XmeTraitSet((XtPointer) wc, XmQTjoinSide, (XtPointer) &tabButtonOST); } /***************************************************************************** * * Initialize * Called when the widget is instantiated. * ***************************************************************************/ static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { ExmTabButtonWidgetClass wc = (ExmTabButtonWidgetClass)XtClass(nw); int shape_event_base, shape_error_base; /* Validate the value of ExmNopenSide. If ExmNopenSide does not have a valid value, set its value to XmLEFT. */ if (!XmRepTypeValidValue(openSideId, OpenSide(nw), nw)) OpenSide(nw) = XmLEFT ; /* check if the shape extention is on the server */ if (SimpleShape(nw) != ExmSHAPE_RECTANGLE && !XShapeQueryExtension(XtDisplay(nw), &shape_event_base, &shape_error_base)) { XmeWarning(nw, WARNING_NO_SHAPE_EXTENSION); SimpleShape(nw) = ExmSHAPE_RECTANGLE; } /* default the shadow join to the shadow */ JoinShadowThickness(nw) = Prim_ShadowThickness(nw); if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmTabButtonWidgetClass, nw, NULL); } /***************************************************************************** * * FillOpenRoundedRectangle * Xlib style API for round edge graphics. * This is used for both the bitmap used as a shape and the rendering * of the shaped shadows. * *****************************************************************************/ static void FillOpenRoundedRectangle( Display *dpy, Drawable draw, GC top_gc, GC bottom_gc, GC bg_gc, int x, int y, int w, int h, int shad_thick, int corner_size, unsigned char open_side) { XArc arcs[4]; XRectangle rects[2]; XGCValues top_gcvalues, bottom_gcvalues; Dimension demi_shad = (shad_thick > 1)? (shad_thick/2):shad_thick; if (corner_size > w/2) corner_size = w/2; if (corner_size > h/2) corner_size = h/2; /* first save the current line attributes (have to do all of them because of the weak Xlib API). The default in the GC is 1, so do not change the line width there */ if (shad_thick != 1) { XGetGCValues(dpy, top_gc, GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, &top_gcvalues); /* change the line width and draw the lines */ XSetLineAttributes(dpy, top_gc, shad_thick, LineSolid, CapButt, JoinMiter); if (bottom_gc != top_gc) { XGetGCValues(dpy, bottom_gc, GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, &bottom_gcvalues); XSetLineAttributes(dpy, bottom_gc, shad_thick, LineSolid, CapButt, JoinMiter); } } /* this code is rather long and boring, but there is nothing complex here: we use arcs even for the vertical and horizontal lines, so that the requests are minimized. There are some known visual glitch with shadow = 1. */ if (open_side == XmLEFT) { arcs[0].x = x ; arcs[0].y = y + demi_shad; arcs[0].width = w - corner_size; arcs[0].height = 0; arcs[0].angle1 = 180*64; arcs[0].angle2 = -180*64; arcs[1].x = x + w - 2*corner_size + demi_shad; arcs[1].y = y + demi_shad; arcs[1].width = 2*corner_size - 2*demi_shad; arcs[1].height = 2*corner_size - 2*demi_shad; arcs[1].angle1 = 90*64; arcs[1].angle2 = -50*64; if (shad_thick) XDrawArcs (dpy, draw, top_gc, arcs, 2); if (bg_gc) XFillArcs (dpy, draw, bg_gc, arcs+1, 1); arcs[0].x = x + w - 2*corner_size + demi_shad; arcs[0].y = y + demi_shad; arcs[0].width = 2*corner_size - 2*demi_shad; arcs[0].height = 2*corner_size - 2*demi_shad; arcs[0].angle1 = 40*64; arcs[0].angle2 = -40*64; arcs[1].x = x + w - demi_shad; arcs[1].y = y + corner_size; arcs[1].width = 0; arcs[1].height = h - 2*corner_size; arcs[1].angle1 = 90*64; arcs[1].angle2 = -180*64; arcs[2].x = x + w - 2*corner_size + demi_shad; arcs[2].y = y + h - 2*corner_size + demi_shad ; arcs[2].width = 2*corner_size - 2*demi_shad; arcs[2].height = 2*corner_size - 2*demi_shad; arcs[2].angle1 = 0*64; arcs[2].angle2 = -90*64; arcs[3].x = x ; arcs[3].y = y + h - demi_shad; arcs[3].width = w - corner_size; arcs[3].height = 0 ; arcs[3].angle1 = 180*64; arcs[3].angle2 = -180*64; if (shad_thick) XDrawArcs (dpy, draw, bottom_gc, arcs, 4); if (bg_gc) { XFillArcs (dpy, draw, bg_gc, arcs, 3); /* fill middle with rectangle */ rects[0].x = x; rects[0].y = y; rects[0].width = w - corner_size; rects[0].height = h; rects[1].x = x + w - corner_size; rects[1].y = y + corner_size; rects[1].width = corner_size; rects[1].height = h - corner_size*2; XFillRectangles (dpy, draw, bg_gc, rects, 2); } } else if (open_side == XmBOTTOM) { arcs[0].x = x + demi_shad; arcs[0].y = y + corner_size; arcs[0].width = 0; arcs[0].height = h - corner_size; arcs[0].angle1 = 90*64; arcs[0].angle2 = -180*64; arcs[1].x = x + demi_shad; arcs[1].y = y + demi_shad; arcs[1].width = 2*corner_size - 2*demi_shad; arcs[1].height = 2*corner_size - 2*demi_shad; arcs[1].angle1 = 180*64; arcs[1].angle2 = -90*64; arcs[2].x = x + corner_size ; arcs[2].y = y + demi_shad ; arcs[2].width = w - 2*corner_size ; arcs[2].height = 0; arcs[2].angle1 = 180*64; arcs[2].angle2 = -180*64; arcs[3].x = x + w - 2*corner_size + demi_shad; arcs[3].y = y + demi_shad; arcs[3].width = 2*corner_size - 2*demi_shad; arcs[3].height = 2*corner_size - 2*demi_shad ; arcs[3].angle1 = 90*64; arcs[3].angle2 = -50*64; if (shad_thick) XDrawArcs (dpy, draw, top_gc, arcs, 4); if (bg_gc) XFillArcs (dpy, draw, bg_gc, arcs+1, 3); arcs[0].x = x + w - 2*corner_size + demi_shad; arcs[0].y = y + demi_shad; arcs[0].width = 2*corner_size - 2*demi_shad; arcs[0].height = 2*corner_size - 2*demi_shad; arcs[0].angle1 = 40*64; arcs[0].angle2 = -40*64; arcs[1].x = x + w - demi_shad; arcs[1].y = y + corner_size; arcs[1].width = 0; arcs[1].height = h - corner_size; arcs[1].angle1 = 90*64; arcs[1].angle2 = -180*64; if (shad_thick) XDrawArcs (dpy, draw, bottom_gc, arcs, 2); if (bg_gc) { XFillArcs (dpy, draw, bg_gc, arcs, 1); /* fill middle with rectangle */ rects[0].x = x + corner_size; rects[0].y = y; rects[0].width = w - 2*corner_size; rects[0].height = corner_size; rects[1].x = x ; rects[1].y = y + corner_size; rects[1].width = w; rects[1].height = h - corner_size; XFillRectangles (dpy, draw, bg_gc, rects, 2); } } else if (open_side == XmTOP) { arcs[0].x = x + demi_shad; arcs[0].y = y ; arcs[0].width = 0; arcs[0].height = h - corner_size; arcs[0].angle1 = 90*64; arcs[0].angle2 = -180*64; arcs[1].x = x + demi_shad; arcs[1].y = y + h - 2*corner_size + demi_shad; arcs[1].width = 2*corner_size - 2*demi_shad; arcs[1].height = 2*corner_size - 2*demi_shad; arcs[1].angle1 = 180*64; arcs[1].angle2 = 50*64; if (shad_thick) XDrawArcs (dpy, draw, top_gc, arcs, 2); if (bg_gc) XFillArcs (dpy, draw, bg_gc, arcs+1, 1); arcs[0].x = x + demi_shad; arcs[0].y = y + h - 2*corner_size + demi_shad; arcs[0].width = 2*corner_size - 2*demi_shad; arcs[0].height = 2*corner_size - 2*demi_shad; arcs[0].angle1 = 230*64; arcs[0].angle2 = 40*64; arcs[1].x = x + corner_size; arcs[1].y = y + h - demi_shad; arcs[1].width = w - 2*corner_size; arcs[1].height = 0; arcs[1].angle1 = 180*64; arcs[1].angle2 = -180*64; arcs[2].x = x + w - 2*corner_size + demi_shad; arcs[2].y = y + h - 2*corner_size + demi_shad ; arcs[2].width = 2*corner_size - 2*demi_shad; arcs[2].height = 2*corner_size - 2*demi_shad; arcs[2].angle1 = 270*64; arcs[2].angle2 = 90*64; arcs[3].x = x + w - demi_shad; arcs[3].y = y ; arcs[3].width = 0; arcs[3].height = h - corner_size ; arcs[3].angle1 = 90*64; arcs[3].angle2 = -180*64; if (shad_thick) XDrawArcs (dpy, draw, bottom_gc, arcs, 4); if (bg_gc) { XFillArcs (dpy, draw, bg_gc, arcs, 3); /* fill middle with rectangle */ rects[0].x = x; rects[0].y = y; rects[0].width = w ; rects[0].height = h - corner_size; rects[1].x = x + corner_size; rects[1].y = y + h - corner_size; rects[1].width = w - 2*corner_size; rects[1].height = corner_size; XFillRectangles (dpy, draw, bg_gc, rects, 2); } } else if (open_side == XmRIGHT) { arcs[0].x = x + corner_size; arcs[0].y = y + demi_shad; arcs[0].width = w - corner_size; arcs[0].height = 0; arcs[0].angle1 = 180*64; arcs[0].angle2 = -180*64; arcs[1].x = x + demi_shad; arcs[1].y = y + demi_shad; arcs[1].width = 2*corner_size - 2*demi_shad; arcs[1].height = 2*corner_size - 2*demi_shad; arcs[1].angle1 = 180*64; arcs[1].angle2 = -90*64; arcs[2].x = x + demi_shad ; arcs[2].y = y + corner_size ; arcs[2].width = 0; arcs[2].height = h - 2*corner_size; arcs[2].angle1 = 90*64; arcs[2].angle2 = -180*64; arcs[3].x = x + demi_shad; arcs[3].y = y + h - 2*corner_size + demi_shad; arcs[3].width = 2*corner_size - 2*demi_shad; arcs[3].height = 2*corner_size - 2*demi_shad ; arcs[3].angle1 = 180*64; arcs[3].angle2 = 50*64; if (shad_thick) XDrawArcs (dpy, draw, top_gc, arcs, 4); if (bg_gc) XFillArcs (dpy, draw, bg_gc, arcs+1, 3); arcs[0].x = x + demi_shad; arcs[0].y = y + h - 2*corner_size + demi_shad; arcs[0].width = 2*corner_size - 2*demi_shad; arcs[0].height = 2*corner_size - 2*demi_shad; arcs[0].angle1 = 230*64; arcs[0].angle2 = 40*64; arcs[1].x = x + corner_size; arcs[1].y = y + h - demi_shad; arcs[1].width = w - corner_size; arcs[1].height = 0; arcs[1].angle1 = 180*64; arcs[1].angle2 = -180*64; if (shad_thick) XDrawArcs (dpy, draw, bottom_gc, arcs, 2); if (bg_gc) { XFillArcs (dpy, draw, bg_gc, arcs, 1); /* fill middle with rectangle */ rects[0].x = x ; rects[0].y = y + corner_size; rects[0].width = corner_size; rects[0].height = h - 2*corner_size; rects[1].x = x + corner_size; rects[1].y = y ; rects[1].width = w - corner_size; rects[1].height = h ; XFillRectangles (dpy, draw, bg_gc, rects, 2); } } /* put the line attributes back */ if (shad_thick != 1) { XSetLineAttributes(dpy, top_gc, top_gcvalues.line_width, top_gcvalues.line_style, top_gcvalues.cap_style, top_gcvalues.join_style); if (bottom_gc != top_gc) XSetLineAttributes(dpy, bottom_gc, bottom_gcvalues.line_width, bottom_gcvalues.line_style, bottom_gcvalues.cap_style, bottom_gcvalues.join_style); } } /***************************************************************************** * * ShapeButton * Call on a realized window from Realize and Resize. * Style is rounded edge at this point. * *****************************************************************************/ static void ShapeButton( Widget w) { Pixmap p = XCreatePixmap(XtDisplay(w), XtWindow(w), XtWidth(w), XtHeight(w), 1 ); XGCValues values; GC gc; /* create a gc width 0 to blank the pixmap and then with 1 for the mask */ values.foreground = 0; gc = XCreateGC (XtDisplay(w), p, GCForeground, &values ); XFillRectangle( XtDisplay(w), p, gc, 0, 0, XtWidth(w), XtHeight(w)); XSetForeground (XtDisplay(w), gc, 1); FillOpenRoundedRectangle(XtDisplay(w), p, gc, gc, gc, 0, 0, XtWidth(w), XtHeight(w), Prim_ShadowThickness(w), CORNER_SIZE(w), OpenSide(w)); XShapeCombineMask(XtDisplay(w), XtWindow(w), ShapeBounding, 0, 0, p, ShapeSet ); XShapeCombineMask(XtDisplay(w), XtWindow(w),ShapeClip, 0, 0, p, ShapeSet ); XFreePixmap(XtDisplay(w), p ); XFreeGC (XtDisplay(w), gc); } /***************************************************************************** * * Realize * Called by the Intrinsics to create the window for the widget. This * class's realize method creates a shaped window for this * exact class, but uses the default window otherwise * *****************************************************************************/ static void Realize(Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { /* First call Primitive's method */ xmPrimitiveClassRec.core_class.realize(w, p_valueMask, attributes); /* then reshape the button if needed */ if (SimpleShape(w) != ExmSHAPE_RECTANGLE) ShapeButton(w); } /***************************************************************************** * * FixVisualPosition: tabs are asymmetric, so we need to recenter * the string so it looks right. * ***************************************************************************/ static void FixVisualPosition( Widget w) { /* apply some little correction to the string position as the shadow is only on one side for the TabButton */ if (OpenSide(w) == XmLEFT) ((ExmSimpleWidget)w)->simple.visual.x -= Prim_ShadowThickness(w) ; else if (OpenSide(w) == XmTOP) ((ExmSimpleWidget)w)->simple.visual.y -= Prim_ShadowThickness(w) ; else if (OpenSide(w) == XmRIGHT) ((ExmSimpleWidget)w)->simple.visual.x += Prim_ShadowThickness(w) ; else if (OpenSide(w) == XmBOTTOM) ((ExmSimpleWidget)w)->simple.visual.y += Prim_ShadowThickness(w) ; } /***************************************************************************** * * Resize * Must reshape the window. * ***************************************************************************/ static void Resize( Widget w) { if (XtIsRealized(w) && SimpleShape(w) != ExmSHAPE_RECTANGLE) ShapeButton(w); /* call superclass Resize */ (*exmCommandButtonClassRec.core_class.superclass->core_class.resize)(w); FixVisualPosition(w); } /***************************************************************************** * * SetValues * Called by the Intrinsics when the application tries to set a value * of one of the resources. * ***************************************************************************/ static Boolean SetValues( Widget cw, Widget rw, Widget nw, ArgList args, Cardinal *num_args ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(nw); Boolean expose_flag = False ; /* Make sure that the new value of ExmNopenSide is a valid one. */ if (OpenSide(nw) != OpenSide(cw)) { if (!XmRepTypeValidValue(openSideId, OpenSide(nw), nw)) OpenSide(nw) = OpenSide(cw); else { /* call Resize so the shape and the visual position be reset */ if (wc->core_class.resize) (*(wc->core_class.resize))(nw); expose_flag = True ; } } /* Do no allow change in shape */ if (SimpleShape(cw) != SimpleShape(nw)) { SimpleShape(nw) = SimpleShape(cw); XmeWarning(nw, WARNING_SHAPE_CHANGED); } /* must call our Resize for the shape update */ if (SimpleShape(nw) == ExmSHAPE_OVAL && NeedToReconfigure(nw)) { if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmTabButtonWidgetClass, nw, cw); } return expose_flag ; } /***************************************************************************** * * BorderHighlight * ***************************************************************************/ static void BorderHighlight( Widget wid ) { XRectangle hrect ; ExmTabButtonWidget tb = (ExmTabButtonWidget) wid; tb->primitive.highlighted = True ; /* If there is no need to draw a border highlight, then don't bother. */ if (XtWidth(wid) == 0 || XtHeight( wid) == 0 || tb->primitive.highlight_thickness == 0) return; if (SimpleShape(wid) == ExmSHAPE_OVAL) { /* Render the label using the highlight color for a change. The app must be sure the highlight color and the background and different */ if (tb->string.compound_string && (tb->simple.visual.width != 0) && (tb->simple.visual.height != 0)) { XmStringDraw (XtDisplay(tb), XtWindow(tb), tb->string.render_table, tb->string.compound_string, tb->primitive.highlight_GC, tb->simple.visual.x, tb->simple.visual.y, tb->simple.visual.width, tb->string.alignment, tb->primitive.layout_direction, NULL); } } else { /* Determine where the highlight should be drawn and then draw it. */ GetHighlightRectangle(tb, &hrect); XmeDrawHighlight(XtDisplay( wid), XtWindow( wid), tb->primitive.highlight_GC, hrect.x, hrect.y, hrect.width, hrect.height, tb->primitive.highlight_thickness); } } /***************************************************************************** * * BorderUnhighlight * ***************************************************************************/ static void BorderUnhighlight( Widget wid ) { XRectangle hrect ; ExmTabButtonWidget tb = (ExmTabButtonWidget) wid; /* This flag tells XmPrimitive what the state of the highlights is. By turning it to False, we are alerting XmPrimitive that the highlight is off. */ tb->primitive.highlighted = False ; /* If there is no need to undraw a border highlight, then don't bother. */ if (XtWidth(wid) == 0 || XtHeight(wid) == 0 || tb->primitive.highlight_thickness == 0) return; if (SimpleShape(wid) == ExmSHAPE_OVAL) { /* Undo the render label using the highlight color */ if (tb->string.compound_string && (tb->simple.visual.width != 0) && (tb->simple.visual.height != 0)) { XmStringDraw (XtDisplay(tb), XtWindow(tb), tb->string.render_table, tb->string.compound_string, tb->simple.normal_gc, tb->simple.visual.x, tb->simple.visual.y, tb->simple.visual.width, tb->string.alignment, tb->primitive.layout_direction, NULL); } } else { /* Determine where the highlight should be drawn and then draw it. */ GetHighlightRectangle(tb, &hrect); /* Erase the border highlights. The border highlights of ExmTabButton are located inside the widget; therefore, we can XmeClearBorder rather than XmeDrawHighlight (which is used with the parent color in Motif). */ XmeClearBorder(XtDisplay (wid), XtWindow (wid), hrect.x, hrect.y, hrect.width, hrect.height, tb->primitive.highlight_thickness) ; } } /************************************************************************ * * DrawShadow * ************************************************************************/ static void DrawShadow ( Widget wid) { XPoint pts[3] ; XRectangle hrect ; GC tune_gc = 0; ExmTabButtonWidget tb = (ExmTabButtonWidget) wid; /* ExmTabButton cannot inherit the draw_shadow routine of ExmSimple. This is because ExmSimple's draw_shadow method assumes rectangular shadows; however, ExmTabButton will require both rectangular and curved shadows. That is, the shadows in an ExmTabButton will be partly rectangular and partly curved. The rectangular portions will be drawn with XmeDrawShadows and the curved portions with XFillPolygon. The resulting shadow will be drawn just outside the border highlight. The shadow will have one open side and a 3D appearance. */ if (SimpleShape(wid) == ExmSHAPE_RECTANGLE) { /* Find the dimensions of the border highlight. */ GetHighlightRectangle (tb, &hrect) ; /* Apply a correction to the returned border highlight dimensions since we're drawing the shadow this time around. */ hrect.x -= tb->primitive.shadow_thickness ; hrect.y -= tb->primitive.shadow_thickness ; hrect.width += 2*tb->primitive.shadow_thickness ; hrect.height += 2*tb->primitive.shadow_thickness ; /* Draw the rectangular portion of the shadows. We're drawing a square shadow, but because the position are negative on the open side, it'll look like an open shadow */ XmeDrawShadows (XtDisplay (tb), XtWindow (tb), tb->primitive.top_shadow_GC, tb->primitive.bottom_shadow_GC, hrect.x, hrect.y, hrect.width, hrect.height, tb->primitive.shadow_thickness, VisualArmed(tb) ? XmSHADOW_IN: XmSHADOW_OUT); } else { FillOpenRoundedRectangle(XtDisplay(wid), XtWindow (wid), VisualArmed(tb) ? tb->primitive.bottom_shadow_GC: tb->primitive.top_shadow_GC, VisualArmed(tb) ? tb->primitive.top_shadow_GC: tb->primitive.bottom_shadow_GC, NULL, 0, 0, XtWidth(wid), XtHeight(wid), tb->primitive.shadow_thickness, CORNER_SIZE(wid), OpenSide(wid)); } /* Now draw the shadow join triangle */ /* Determine the dimensions of the curved portions of the shadow. */ if (OpenSide(wid) == XmLEFT) { pts[0].x = 0 ; pts[1].x = JoinShadowThickness(tb) ; pts[2].x = 0 ; if (!VisualArmed(tb)) { /* top part starts with half bottom gc to join clean */ pts[0].y = 0 ; pts[1].y = 0 ; pts[2].y = tb->primitive.shadow_thickness ; } else { /* bottom part starts with half bottom gc to join clean */ pts[0].y = tb->core.height - tb->primitive.shadow_thickness ; pts[1].y = tb->core.height ; pts[2].y = tb->core.height ; } tune_gc = tb->primitive.bottom_shadow_GC ; } else if (OpenSide(wid) == XmRIGHT) { pts[0].x = tb->core.width - JoinShadowThickness(tb) ; pts[1].x = tb->core.width ; pts[2].x = tb->core.width ; if (!VisualArmed(tb)) { /* bottom part ends with half top gc to join clean */ pts[0].y = tb->core.height ; pts[1].y = tb->core.height - tb->primitive.shadow_thickness ; pts[2].y = tb->core.height ; } else { /* top part ends with half top gc to join clean */ pts[0].y = 0 ; pts[1].y = tb->primitive.shadow_thickness ; pts[2].y = 0 ; } tune_gc = tb->primitive.top_shadow_GC ; } else if (OpenSide(wid) == XmTOP) { pts[0].y = 0 ; pts[1].y = 0 ; pts[2].y = JoinShadowThickness(tb) ; if (!VisualArmed(tb)) { /* right part starts with half bottom gc to join clean */ pts[0].x = 0 ; pts[1].x = tb->primitive.shadow_thickness ; pts[2].x = 0 ; } else { /* left part ends with half bottom gc to join clean */ pts[0].x = tb->core.width - tb->primitive.shadow_thickness ; pts[1].x = tb->core.width ; pts[2].x = tb->core.width ; } tune_gc = tb->primitive.bottom_shadow_GC ; } else if (OpenSide(wid) == XmBOTTOM) { pts[0].y = tb->core.height - JoinShadowThickness(tb) ; pts[1].y = tb->core.height ; pts[2].y = tb->core.height ; if (!VisualArmed(tb)) { /* left part ends with half top gc to join clean */ pts[0].x = tb->core.width ; pts[1].x = tb->core.width - tb->primitive.shadow_thickness ; pts[2].x = tb->core.width ; } else { /* right part ends with half top gc to join clean */ pts[0].x = 0 ; pts[1].x = tb->primitive.shadow_thickness ; pts[2].x = 0 ; } tune_gc = tb->primitive.top_shadow_GC ; } /* else if (OpenSide(wid) == XmNONE) do nothing */ /* Draw the curved portion of the shadows, unless join thickness is zero */ if ((OpenSide(wid) != XmNONE) && (JoinShadowThickness(wid) > (Dimension)0)) XFillPolygon (XtDisplay (tb), XtWindow (tb), tune_gc, pts, 3, Convex, CoordModeOrigin); } /***************************************************************************** * * GetHighlightRectangle * Called by BorderHighlight, BorderUnhighlight, and DrawShadow. , * in the case a rectangular tab only. * ***************************************************************************/ static void GetHighlightRectangle ( ExmTabButtonWidget tb, XRectangle *hrect) { /* This function writes the dimensions of the highlight rectangle into *hrect. These dimensions depend on the value of ExmNopenSide. */ if (OpenSide(tb) == XmLEFT) { hrect->x = 0 ; hrect->y = tb->primitive.shadow_thickness ; hrect->width = XtWidth( tb) - tb->primitive.shadow_thickness ; hrect->height = XtHeight(tb) - 2* tb->primitive.shadow_thickness ; } else if (OpenSide(tb) == XmRIGHT) { hrect->x = tb->primitive.shadow_thickness ; hrect->y = tb->primitive.shadow_thickness ; hrect->width = XtWidth(tb) - tb->primitive.shadow_thickness ; hrect->height = XtHeight(tb) - 2* tb->primitive.shadow_thickness ; } else if (OpenSide(tb) == XmTOP) { hrect->x = tb->primitive.shadow_thickness ; hrect->y = 0 ; hrect->width = XtWidth(tb) - 2* tb->primitive.shadow_thickness ; hrect->height = XtHeight(tb) - tb->primitive.shadow_thickness ; } else if (OpenSide(tb) == XmBOTTOM) { hrect->x = tb->primitive.shadow_thickness ; hrect->y = tb->primitive.shadow_thickness ; hrect->width = XtWidth(tb) - 2* tb->primitive.shadow_thickness ; hrect->height = XtHeight(tb) - tb->primitive.shadow_thickness ; } else if (OpenSide(tb) == XmNONE) { hrect->x = tb->primitive.shadow_thickness ; hrect->y = tb->primitive.shadow_thickness ; hrect->width = XtWidth(tb) - 2* tb->primitive.shadow_thickness ; hrect->height = XtHeight(tb) - 2*tb->primitive.shadow_thickness ; } } /*************************************************************** * Trait methods for XmQTjoinSide trait ***************************************************************/ /*************************************************************** * * JoinSideSetValue: * The setValue trait method of XmQTjoinSide. * ***************************************************************/ static void JoinSideSetValue(Widget tab, unsigned char join_side, Dimension join_thickness) { ExmTabButtonWidget tb = (ExmTabButtonWidget) tab; Arg args[6]; int n = 0; if (OpenSide(tb) != join_side) { XtSetArg (args[n], ExmNopenSide, join_side), n++; XtSetValues (tab, args, n); } if (JoinShadowThickness(tb) != join_thickness) { JoinShadowThickness(tb) = join_thickness; /* redraw, in the case XtSetValues will not */ if (XtIsRealized(tab)) DrawShadow (tab); } } /*************************************************************** * * JoinSideGetValue: * The getValue trait method of XmQTjoinSide. * ***************************************************************/ static unsigned char JoinSideGetValue(Widget tab, Dimension * join_thickness) { ExmTabButtonWidget tb = (ExmTabButtonWidget) tab; *join_thickness = JoinShadowThickness(tb); return OpenSide(tb) ; } /************************************************************************ * Application Accessible External Functions ************************************************************************/ /************************************************************************ * * ExmCreateTabButton * Create an instance of a TabButton and return its widget id. * ************************************************************************/ Widget ExmCreateTabButton( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget (name, exmTabButtonWidgetClass, parent, arglist, argcount)); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/StringTrans.h�������������������������������������������������������������0000644�0001750�0001750�00000004671�12672140200�014622� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: StringTrans.h /main/5 1995/07/15 20:41:54 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * StringTrans.h: The widget public header file for the ExmStringTransfer * uniform transfer model demonstration widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmStringTrans_h #define _ExmStringTrans_h /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Include appropriate files. */ #include <Exm/ExmString.h> /* public header file for the ExmString widget */ /* Define the widget class and widget record. */ externalref WidgetClass exmStringTransferWidgetClass; typedef struct _ExmStringTransferClassRec *ExmStringTransferWidgetClass; typedef struct _ExmStringTransferRec *ExmStringTransferWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsStringTransfer #define ExmIsStringTransfer(w) XtIsSubclass(w, exmStringTransferWidgetClass) #endif /* No string equivalents of new resource names. */ /* Specify the API for this widget. */ extern Widget ExmCreateStringTransfer(Widget parent, char *name, Arg *arglist, Cardinal argCount); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _ExmStringTrans_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ �����������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/TabB.h��������������������������������������������������������������������0000644�0001750�0001750�00000005035�12672140200�013147� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: TabB.h /main/5 1995/07/15 20:42:07 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * TabB.h: The widget public header file for the ExmTabButton demonstration * widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmTabB_h #define _ExmTabB_h /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Include appropriate files. */ #include <Exm/CommandB.h> /* public header file for ExmCommandButton */ #include <Xm/JoinSideT.h> /* contains defs. needed by ExmNopenSide resource */ /* Define the widget class and widget record. */ externalref WidgetClass exmTabButtonWidgetClass; typedef struct _ExmTabButtonClassRec *ExmTabButtonWidgetClass; typedef struct _ExmTabButtonRec *ExmTabButtonWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsTabButton #define ExmIsTabButton(w) XtIsSubclass(w, exmTabButtonWidgetClass) #endif /* Define string equivalents of new resource names. */ #define ExmNopenSide "openSide" #define ExmCOpenSide "OpenSide" #define ExmROpenSide "ExmOpenSide" /* Specify the API for this widget. */ extern Widget ExmCreateTabButton(Widget parent, char *name, Arg *arglist, Cardinal argCount); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmTabB_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Panner.c������������������������������������������������������������������0000644�0001750�0001750�00000113520�13145162623�013565� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Panner.c /main/5 1995/07/15 20:41:11 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /************************************ WARNING ********************************** * * ExmPanner is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way * ************************************ WARNING *********************************/ /************************************************************************* * * Panner.c - ExmPanner widget. This widget lets a user pan a * ScrolledWindow (or any other scrollFrame widget) * in two-dimensions. The ExmPanner widget is similar * to the Athena Panner widget. ExmPanner demonstrates: * * how to install the XmQTnavigator trait. * *********************************************************************/ #include <Xm/XmP.h> #include <Xm/TraitP.h> #include <Xm/NavigatorT.h> #include <Xm/DrawP.h> #include <Xm/RepType.h> #include <Exm/PannerP.h> #include <stdlib.h> #include <ctype.h> /* Define macros and constants. */ static XmConst int DEFAULT_WIDTH=100; static XmConst int DEFAULT_HEIGHT=100; static XmConst int DEFAULT_CANVAS_WIDTH=100; static XmConst int DEFAULT_CANVAS_HEIGHT=100; static XmConst int PANNER_OUTOFRANGE = (-30000); #define PANNER_HSCALE(pw,val) ((pw)->panner.haspect * ((double) (val))) #define PANNER_VSCALE(pw,val) ((pw)->panner.vaspect * ((double) (val))) static void ClassPartInitialize( WidgetClass wc ); static void Initialize( Widget greq, Widget gnew, ArgList args, Cardinal *num_args); static void Resize ( Widget gw); static Boolean SetValues( Widget gcur, Widget greq, Widget gnew, ArgList args, Cardinal *num_args); static void DrawVisual( Widget gw); static void CreateGC( Widget w); static void DestroyGC( Widget w); static void DrawRubberBand( ExmPannerWidget pw); static void CheckKnob( register ExmPannerWidget pw, Boolean knob); static void ScaleKnob ( ExmPannerWidget pw, Boolean location, Boolean size); static void ExmPannerStart ( Widget gw, XEvent *event, String *params, Cardinal *num_params); static void ExmPannerStop ( Widget gw, XEvent *event, String *params, Cardinal *num_params); static void ExmPannerAbort ( Widget gw, XEvent *event, String *params, Cardinal *num_params); static void ExmPannerMove ( Widget gw, XEvent *event, String *params, Cardinal *num_params); static void ExmPannerNotify ( Widget gw, XEvent *event, String *params, Cardinal *num_params); static void ExmPannerSet ( Widget gw, XEvent *event, String *params, Cardinal *num_params); static Boolean GetEventXY ( ExmPannerWidget pw, XEvent *event, int *x, int *y); static int ParsePageString ( register char *s, int pagesize, int canvassize, Boolean *relative); static void ExmPannerPage ( Widget gw, XEvent *event, String *params, Cardinal *num_params); static void NavigChangeMoveCB( Widget nav, XtCallbackProc moveCB, XtPointer closure, Boolean setunset); static void NavigSetValue( Widget nav, XmNavigatorData nav_data, Boolean notify); static void NavigGetValue( Widget nav, XmNavigatorData nav_data); /* Define the translations. */ static char defaultTranslations[] = "<Unmap>: PrimitiveUnmap()\n\ <Enter>: PrimitiveEnter()\n\ <Leave>: PrimitiveLeave()\n\ <FocusIn>: PrimitiveFocusIn()\n\ <FocusOut>: PrimitiveFocusOut()\n\ :<Key>osfActivate: PrimitiveParentActivate()\n\ :<Key>osfHelp: PrimitiveHelp()\n\ :<Key>osfCancel: ExmPannerAbort()\n\ ~s ~c ~m ~a <Btn1Down>: ExmPannerStart(1) \n\ ~s ~c ~m ~a <Btn1Motion>: ExmPannerMove() \n\ ~s ~c ~m ~a <Btn1Up>: ExmPannerNotify() ExmPannerStop() \n\ ~s ~c ~m ~a <Btn2Down>: ExmPannerStart(2) \n\ ~s ~c ~m ~a <Btn2Motion>: ExmPannerMove() \n\ ~s ~c ~m ~a <Btn2Up>: ExmPannerNotify() ExmPannerStop() \n\ :<Key>space: ExmPannerSet(rubberband,toggle) \n\ :<Key>osfPageUp: ExmPannerPage(+0, -1p) \n\ :c <Key>osfPageUp: ExmPannerPage(+0, -1c) \n\ :<Key>osfPageDown: ExmPannerPage(+0, +1p) \n\ :c <Key>osfPageDown: ExmPannerPage(+0, +1c) \n\ :<Key>osfPageLeft: ExmPannerPage(-1p, +0) \n\ :c <Key>osfPageLeft: ExmPannerPage(-1c, +0) \n\ :<Key>osfPageRight: ExmPannerPage(+1p, +0) \n\ :c <Key>osfPageRight: ExmPannerPage(+1c, +0) \n\ :<Key>osfLeft: ExmPannerPage(-1, +0) \n\ :c <Key>osfLeft: ExmPannerPage(-1p, +0) \n\ :<Key>osfRight: ExmPannerPage(+1, +0) \n\ :c <Key>osfRight: ExmPannerPage(+1p, +0) \n\ :<Key>osfUp: ExmPannerPage(+0, -1) \n\ :c <Key>osfUp: ExmPannerPage(+0, -1p) \n\ :<Key>osfDown: ExmPannerPage(+0, +1) \n\ :c <Key>osfDown: ExmPannerPage(+0, +1p) \n\ :<Key>osfEndLine: ExmPannerPage(+1c, +1c) \n\ :<Key>osfBeginLine: ExmPannerPage(0,0)\n\ ~s ~m ~a <Key>Return: PrimitiveParentActivate()\n\ s ~m ~a <Key>Tab: PrimitivePrevTabGroup()\n\ ~m ~a <Key>Tab: PrimitiveNextTabGroup()"; /* Define the actions array. */ static XtActionsRec actions[] = { {"ExmPannerStart", ExmPannerStart}, /* start tmp graphics */ {"ExmPannerStop", ExmPannerStop}, /* stop tmp graphics */ {"ExmPannerAbort", ExmPannerAbort}, /* abort panning */ {"ExmPannerMove", ExmPannerMove}, /* move tmp graphics on Motion event */ {"ExmPannerPage", ExmPannerPage}, /* page around usually from keyboard */ {"ExmPannerNotify",ExmPannerNotify}, /* callback new position */ {"ExmPannerSet", ExmPannerSet} /* set various parameters */ }; /* Define the resources. */ #define poff(field) XtOffsetOf(ExmPannerRec, panner.field) static XtResource resources[] = { { ExmNreportCallback, ExmCReportCallback, XtRCallback, sizeof(XtPointer), poff(report_callbacks), XtRCallback, (XtPointer) NULL }, { ExmNrubberBand, ExmCRubberBand, XtRBoolean, sizeof(Boolean), poff(rubber_band), XtRImmediate, (XtPointer) FALSE }, { ExmNcanvasWidth, ExmCCanvasWidth, XmRHorizontalDimension, sizeof(Dimension), poff(canvas_width), XtRImmediate, (XtPointer) 0 }, { ExmNcanvasHeight, ExmCCanvasHeight, XmRVerticalDimension, sizeof(Dimension), poff(canvas_height), XtRImmediate, (XtPointer) 0 }, { ExmNsliderX, ExmCSliderX, XmRHorizontalPosition, sizeof(Position), poff(slider_x), XtRImmediate, (XtPointer) 0 }, { ExmNsliderY, ExmCSliderY, XmRVerticalPosition, sizeof(Position), poff(slider_y), XtRImmediate, (XtPointer) 0 }, { ExmNsliderWidth, ExmCSliderWidth, XmRHorizontalDimension, sizeof(Dimension), poff(slider_width), XtRImmediate, (XtPointer) 0 }, { ExmNsliderHeight, ExmCSliderHeight, XmRVerticalDimension, sizeof(Dimension), poff(slider_height), XtRImmediate, (XtPointer) 0 }, { XmNnavigationType, XmCNavigationType, XmRNavigationType, sizeof(unsigned char), XtOffsetOf(ExmPannerRec, primitive.navigation_type), XmRImmediate, (XtPointer) XmSTICKY_TAB_GROUP }, }; /* 6 of the 8 resources have corresponding synthetic resources. */ static XmSyntheticResource syn_resources[] = { { ExmNcanvasWidth, sizeof (Dimension), poff(canvas_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { ExmNcanvasHeight, sizeof (Dimension), poff(canvas_height), XmeFromVerticalPixels, XmeToVerticalPixels }, { ExmNsliderX, sizeof (Position), poff(slider_x), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { ExmNsliderY, sizeof (Position), poff(slider_y), XmeFromVerticalPixels, XmeToVerticalPixels }, { ExmNsliderWidth, sizeof (Dimension), poff(slider_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { ExmNsliderHeight, sizeof (Dimension), poff(slider_height), XmeFromVerticalPixels, XmeToVerticalPixels }, }; #undef poff /* Define the widget class record. */ externaldef(exmpannerclassrec) ExmPannerClassRec exmPannerClassRec = { { /* Following is the Core class record. */ /* superclass */ (WidgetClass) &exmSimpleClassRec, /* class_name */ "ExmPanner", /* widget_size */ sizeof(ExmPannerRec), /* class_initialize */ NULL, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actions, /* num_actions */ XtNumber(actions), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ Resize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ NULL, /* display_accelerator */ XtInheritDisplayAccelerator, /* extension */ NULL }, { /* Following is the XmPrimitive class record. */ /* border_highlight */ XmInheritWidgetProc, /* border_unhighlight */ XmInheritWidgetProc, /* translations */ NULL, /* arm_and_activate */ (XtActionProc)NULL, /* syn_resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* extension */ NULL, }, { /* Following is the ExmSimple class record. */ /* draw_visual */ DrawVisual, /* draw_shadow */ NULL, /* create_gc */ CreateGC, /* destroy_gc */ DestroyGC, /* select_gc */ ExmInheritSelectGC, /* calc_visual_size */ ExmInheritCalcVisualSize, /* calc_widget_size */ ExmInheritCalcWidgetSize, /* extension */ NULL, }, { /* Following is the ExmPanner class record. */ /* extension */ NULL } }; externaldef(exmpannerwidgetclass) WidgetClass exmPannerWidgetClass = (WidgetClass) &exmPannerClassRec; /* Navigator Trait record for Panner */ static XmConst XmNavigatorTraitRec pannerNT = { 0, /* version */ NavigChangeMoveCB, NavigSetValue, NavigGetValue, }; /********************************************************************* * * ClassPartInitialize * Initialize navigator trait * *********************************************************************/ static void ClassPartInitialize( WidgetClass wc ) { /* Install the navigator trait. */ XmeTraitSet((XtPointer)wc, XmQTnavigator, (XtPointer) &pannerNT); } /********************************************************************* * * Initialize * *********************************************************************/ static void Initialize( Widget greq, Widget gnew, ArgList args, Cardinal *num_args) { ExmPannerWidget req = (ExmPannerWidget) greq, new = (ExmPannerWidget) gnew; if (req->panner.canvas_width < 1) new->panner.canvas_width = DEFAULT_CANVAS_WIDTH; if (req->panner.canvas_height < 1) new->panner.canvas_height = DEFAULT_CANVAS_HEIGHT; if (greq->core.width == 0) gnew->core.width = DEFAULT_WIDTH; if (greq->core.height == 0) gnew->core.height = DEFAULT_HEIGHT; new->panner.tmp.doing = FALSE; new->panner.tmp.showing = FALSE; /* call the resize method to get an initial size */ (* (gnew->core.widget_class->core_class.resize)) (gnew); /* Simple Initialize already created the GCs */ } /********************************************************************* * * Resize * *********************************************************************/ static void Resize ( Widget gw) { ExmPannerWidget pw = (ExmPannerWidget)gw; int hpad = pw->simple.margin_width * 2; int vpad = pw->simple.margin_height * 2; if (pw->panner.canvas_width < 1) pw->panner.canvas_width = pw->core.width; if (pw->panner.canvas_height < 1) pw->panner.canvas_height = pw->core.height; if ((int)pw->core.width <= hpad) hpad = 0; if ((int)pw->core.height <= vpad) vpad = 0; pw->panner.haspect = ((double) pw->core.width - hpad) / (double) pw->panner.canvas_width; pw->panner.vaspect = ((double) pw->core.height - vpad) / (double) pw->panner.canvas_height; ScaleKnob (pw, TRUE, TRUE); } /********************************************************************* * * SetValues * *********************************************************************/ static Boolean SetValues( Widget gcur, Widget greq, Widget gnew, ArgList args, Cardinal *num_args) { ExmPannerWidget cur = (ExmPannerWidget) gcur; ExmPannerWidget new = (ExmPannerWidget) gnew; Boolean redisplay = FALSE; if (cur->panner.rubber_band != new->panner.rubber_band) { if (new->panner.tmp.doing) redisplay = TRUE; } if (cur->panner.canvas_width != new->panner.canvas_width || cur->panner.canvas_height != new->panner.canvas_height || cur->simple.margin_width != new->simple.margin_width || cur->simple.margin_height != new->simple.margin_height) { Resize (gnew); /* does a ScaleKnob as well */ redisplay = TRUE; } else { Boolean loc = (cur->panner.slider_x != new->panner.slider_x || cur->panner.slider_y != new->panner.slider_y); Boolean siz = (cur->panner.slider_width != new->panner.slider_width || cur->panner.slider_height != new->panner.slider_height); if (loc || siz) { ScaleKnob (new, loc, siz); redisplay = TRUE; } } return redisplay; } /********************************************************************* * * DrawVisual * an ExmSimple class method * *********************************************************************/ static void DrawVisual( Widget gw) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(gw); ExmPannerWidget pw = (ExmPannerWidget) gw; int kx = pw->panner.knob_x + pw->simple.margin_width; int ky = pw->panner.knob_y + pw->simple.margin_height; int lx = pw->panner.last_x + pw->simple.margin_width; int ly = pw->panner.last_y + pw->simple.margin_height; /* Clear rubberband */ if (pw->panner.tmp.doing && pw->panner.rubber_band && pw->panner.tmp.showing) DrawRubberBand (pw); /* Only clear areas that need clearing. This minimizes flickering while dragging. */ if (pw->panner.last_y != PANNER_OUTOFRANGE && pw->panner.last_x != PANNER_OUTOFRANGE) { int height = 0; /* Clear horizontal areas */ if (ly < ky) { /* Clear area above new panner position */ height = ky - ly; XClearArea (XtDisplay(gw), XtWindow(gw), lx, ly, (unsigned int) pw->panner.knob_width, (unsigned int) height, False); } else if (ky < ly) { /* Clear area under new panner */ height = ly - ky; XClearArea (XtDisplay(gw), XtWindow(gw), lx, ky + pw->panner.knob_height - 1, (unsigned int) pw->panner.knob_width, (unsigned int) height, False); } /* Clear vertical areas. Try not to clear the same area twice. */ height = pw->panner.knob_height - height; if (height > 0) { if (lx < kx) { /* Clear area to the left of new panner position */ XClearArea (XtDisplay(gw), XtWindow(gw), lx, ly > ky ? ly : ky, (unsigned int) kx - lx, (unsigned int) height, False); } else if (kx < lx) { /* Clear area to the right of new panner */ XClearArea (XtDisplay(gw), XtWindow(gw), kx + pw->panner.knob_width - 1, ly > ky ? ly : ky, (unsigned int) lx - kx, (unsigned int) height, False); } } } pw->panner.last_x = pw->panner.knob_x; pw->panner.last_y = pw->panner.knob_y; /* use Simple class method to fetch either a normal GC or an insensitive GC. Draw a rectangle inside the shadow. */ XFillRectangle (XtDisplay(gw), XtWindow(gw), wc->simple_class.select_gc(gw), kx + pw->primitive.shadow_thickness, ky + pw->primitive.shadow_thickness, pw->panner.knob_width - 2 * pw->primitive.shadow_thickness - 1, pw->panner.knob_height - 2 * pw->primitive.shadow_thickness - 1); XmeDrawShadows (XtDisplay (gw), XtWindow(gw), pw->primitive.top_shadow_GC, pw->primitive.bottom_shadow_GC, kx, ky, pw->panner.knob_width - 1, pw->panner.knob_height - 1, pw->primitive.shadow_thickness, XmSHADOW_OUT); /* if in the middle of rubber_banding, redisplay it as well */ if (pw->panner.tmp.doing && pw->panner.rubber_band) DrawRubberBand (pw); } /********************************************************************* * * CreateGC * an ExmSimple class method * *********************************************************************/ static void CreateGC( Widget w) { ExmPannerWidget pw = (ExmPannerWidget) w ; XtGCMask valuemask = (GCForeground | GCFunction); XGCValues values; /* Envelop our superclass method to get the normal and the insensitive GC and then add our rubber_band GC */ (*(exmSimpleClassRec.simple_class.create_gc))(w); values.foreground = pw->primitive.foreground ^ pw->core.background_pixel; values.function = GXxor; pw->panner.xor_gc = XtGetGC ((Widget) pw, valuemask, &values); } /********************************************************************* * * DestroyGC * an ExmSimple class method * *********************************************************************/ static void DestroyGC( Widget w) { ExmPannerWidget pw = (ExmPannerWidget) w ; /* Envelop our superclass method to destroy the normal and the insensitive GC, and then release our Xor GC */ (*(exmSimpleClassRec.simple_class.destroy_gc))(w); XtReleaseGC ((Widget) pw, pw->panner.xor_gc); } /********************************************************************* * * DrawRubberBand * Draw the rubberband rectangle when rubberband dragging is used. * *********************************************************************/ static void DrawRubberBand( ExmPannerWidget pw) { XDrawRectangle (XtDisplay(pw), XtWindow(pw), pw->panner.xor_gc, (int) (pw->panner.tmp.x - 1 + pw->simple.margin_width), (int) (pw->panner.tmp.y - 1 + pw->simple.margin_height), (unsigned int) (pw->panner.knob_width), (unsigned int) (pw->panner.knob_height)); pw->panner.tmp.showing = !pw->panner.tmp.showing; } /********************************************************************* * * CheckKnob * Called by several action methods. * *********************************************************************/ static void CheckKnob( register ExmPannerWidget pw, Boolean knob) { Position maxx = (((Position) pw->core.width) - pw->simple.margin_width * 2 - ((Position) pw->panner.knob_width)); Position maxy = (((Position) pw->core.height) - pw->simple.margin_height * 2 - ((Position) pw->panner.knob_height)); Position *x = (knob ? &pw->panner.knob_x : &pw->panner.tmp.x); Position *y = (knob ? &pw->panner.knob_y : &pw->panner.tmp.y); /* Note that positions are already normalized (i.e. margins have been subtracted out). */ if (*x < 0) *x = 0; if (*x > maxx) *x = maxx; if (*y < 0) *y = 0; if (*y > maxy) *y = maxy; if (knob) { pw->panner.slider_x = (Position) (((double) pw->panner.knob_x) / pw->panner.haspect + 0.5); pw->panner.slider_y = (Position) (((double) pw->panner.knob_y) / pw->panner.vaspect + 0.5); pw->panner.last_x = pw->panner.last_y = PANNER_OUTOFRANGE; } } /********************************************************************* * * ScaleKnob * Called by Resize and SetValues. This function sets the knob * size and/or its location. * *********************************************************************/ static void ScaleKnob ( ExmPannerWidget pw, Boolean location, Boolean size) { if (location) { pw->panner.knob_x = (Position) PANNER_HSCALE(pw, pw->panner.slider_x); pw->panner.knob_y = (Position) PANNER_VSCALE(pw, pw->panner.slider_y); } if (size) { Dimension width, height; if (pw->panner.slider_width < 1) { pw->panner.slider_width = pw->panner.canvas_width; } if (pw->panner.slider_height < 1) { pw->panner.slider_height = pw->panner.canvas_height; } width = (pw->panner.slider_width < pw->panner.canvas_width)? pw->panner.slider_width : pw->panner.canvas_width; height = (pw->panner.slider_height < pw->panner.canvas_height)? pw->panner.slider_height : pw->panner.canvas_height ; pw->panner.knob_width = (Dimension) PANNER_HSCALE(pw, width); pw->panner.knob_height = (Dimension) PANNER_VSCALE(pw, height); } CheckKnob (pw, TRUE); } /*************************************************************************** * * * Panner action procs * * * **************************************************************************/ /************************************************************************ * * ExmPannerStart * * ************************************************************************/ static void ExmPannerStart ( Widget gw, XEvent *event, String *params, /* unused */ Cardinal *num_params /* unused */ ) { ExmPannerWidget pw = (ExmPannerWidget) gw; int x, y; if (!GetEventXY (pw, event, &x, &y)) { XBell (XtDisplay(gw), 0); /* should do error message */ return; } if (*num_params != 1) { XBell (XtDisplay(gw), 0); return; } if (XmeNamesAreEqual (params[0], "1")) (void) XmProcessTraversal (gw, XmTRAVERSE_CURRENT); pw->panner.tmp.doing = TRUE; pw->panner.tmp.startx = pw->panner.knob_x; pw->panner.tmp.starty = pw->panner.knob_y; pw->panner.tmp.dx = (((Position) x) - pw->panner.knob_x); pw->panner.tmp.dy = (((Position) y) - pw->panner.knob_y); pw->panner.tmp.x = pw->panner.knob_x; pw->panner.tmp.y = pw->panner.knob_y; if (pw->panner.rubber_band) DrawRubberBand (pw); } /************************************************************************ * * ExmPannerStop * * ************************************************************************/ static void ExmPannerStop ( Widget gw, XEvent *event, String *params, /* unused */ Cardinal *num_params /* unused */) { ExmPannerWidget pw = (ExmPannerWidget) gw; int x, y; if (GetEventXY (pw, event, &x, &y)) { pw->panner.tmp.x = ((Position) x) - pw->panner.tmp.dx; pw->panner.tmp.y = ((Position) y) - pw->panner.tmp.dy; CheckKnob (pw, FALSE); } if (pw->panner.rubber_band && pw->panner.tmp.showing) DrawRubberBand(pw); pw->panner.tmp.doing = FALSE; } /************************************************************************ * * ExmPannerAbort: * Restores slider to the position it had at ExmPannerStart. * ************************************************************************/ static void ExmPannerAbort ( Widget gw, XEvent *event, String *params, /* unused */ Cardinal *num_params /* unused */) { ExmPannerWidget pw = (ExmPannerWidget) gw; if (!pw->panner.tmp.doing) return; if (pw->panner.rubber_band && pw->panner.tmp.showing) DrawRubberBand (pw); if (!pw->panner.rubber_band) { /* restore old position */ pw->panner.tmp.x = pw->panner.tmp.startx; pw->panner.tmp.y = pw->panner.tmp.starty; ExmPannerNotify (gw, event, params, num_params); } pw->panner.tmp.doing = FALSE; } /************************************************************************ * * ExmPannerMove * * ************************************************************************/ static void ExmPannerMove ( Widget gw, XEvent *event, /* must be a motion event */ String *params, /* unused */ Cardinal *num_params /* unused */) { ExmPannerWidget pw = (ExmPannerWidget) gw; int x, y; if (!pw->panner.tmp.doing) return; if (!GetEventXY (pw, event, &x, &y)) { XBell (XtDisplay(gw), 0); /* should do error message */ return; } if (pw->panner.rubber_band && pw->panner.tmp.showing) DrawRubberBand (pw); pw->panner.tmp.x = ((Position) x) - pw->panner.tmp.dx; pw->panner.tmp.y = ((Position) y) - pw->panner.tmp.dy; if (!pw->panner.rubber_band) { ExmPannerNotify (gw, event, params, num_params); /* does a check */ } else { CheckKnob (pw, FALSE); DrawRubberBand (pw); } } /************************************************************************ * * ExmPannerNotify * * ************************************************************************/ static void ExmPannerNotify ( Widget gw, XEvent *event, /* unused */ String *params, /* unused */ Cardinal *num_params /* unused */) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(gw); ExmPannerWidget pw = (ExmPannerWidget) gw; Position tmp; if (!pw->panner.tmp.doing) return; CheckKnob (pw, FALSE); pw->panner.knob_x = pw->panner.tmp.x; pw->panner.knob_y = pw->panner.tmp.y; pw->panner.slider_x = (Position) (((double) pw->panner.knob_x) / pw->panner.haspect + 0.5); pw->panner.slider_y = (Position) (((double) pw->panner.knob_y) / pw->panner.vaspect + 0.5); /* check knob */ if (pw->panner.slider_x > (tmp = (((Position) pw->panner.canvas_width) - ((Position) pw->panner.slider_width)))) pw->panner.slider_x = tmp; if (pw->panner.slider_x < 0) pw->panner.slider_x = 0; if (pw->panner.slider_y > (tmp = (((Position) pw->panner.canvas_height) - ((Position) pw->panner.slider_height)))) pw->panner.slider_y = tmp; if (pw->panner.slider_y < 0) pw->panner.slider_y = 0; /* call callback if needed */ if (pw->panner.last_x != pw->panner.knob_x || pw->panner.last_y != pw->panner.knob_y) { ExmPannerCallbackStruct rep; wc->core_class.expose (gw, (XEvent*) NULL, (Region) NULL); rep.changed = (ExmPRSliderX | ExmPRSliderY); rep.slider_x = pw->panner.slider_x; rep.slider_y = pw->panner.slider_y; rep.slider_width = pw->panner.slider_width; rep.slider_height = pw->panner.slider_height; rep.canvas_width = pw->panner.canvas_width; rep.canvas_height = pw->panner.canvas_height; XtCallCallbackList (gw, pw->panner.report_callbacks, (XtPointer) &rep); } } /************************************************************************ * * ExmPannerSet * * ************************************************************************/ static void ExmPannerSet ( Widget gw, XEvent *event, /* unused */ String *params, Cardinal *num_params) { ExmPannerWidget pw = (ExmPannerWidget) gw; Boolean rb; if (*num_params < 2 || !XmeNamesAreEqual (params[0], "rubberband")) { XBell (XtDisplay(gw), 0); return; } if (XmeNamesAreEqual (params[1], "on")) { rb = TRUE; } else if (XmeNamesAreEqual (params[1], "off")) { rb = FALSE; } else if (XmeNamesAreEqual (params[1], "toggle")) { rb = !pw->panner.rubber_band; } else { XBell (XtDisplay(gw), 0); return; } if (rb != pw->panner.rubber_band) { XtVaSetValues (gw, ExmNrubberBand, rb, NULL); } } /************************************************************************ * * GetEventXY * * ************************************************************************/ static Boolean GetEventXY ( ExmPannerWidget pw, XEvent *event, int *x, int *y) { switch (event->type) { case ButtonPress: case ButtonRelease: *x = event->xbutton.x - pw->simple.margin_width; *y = event->xbutton.y - pw->simple.margin_height; return TRUE; case KeyPress: case KeyRelease: *x = event->xkey.x - pw->simple.margin_width; *y = event->xkey.y - pw->simple.margin_height; return TRUE; case EnterNotify: case LeaveNotify: *x = event->xcrossing.x - pw->simple.margin_width; *y = event->xcrossing.y - pw->simple.margin_height; return TRUE; case MotionNotify: *x = event->xmotion.x - pw->simple.margin_width; *y = event->xmotion.y - pw->simple.margin_height; return TRUE; } return FALSE; } /************************************************************************ * * ParsePageString * * ************************************************************************/ static int ParsePageString ( register char *s, int pagesize, int canvassize, Boolean *relative) { char *cp; int val = 1; Boolean rel = FALSE; /* Syntax: spaces [+-] number spaces [pc\0] spaces */ for (; isascii(*s) && isspace(*s); s++) ; /* skip white space */ if (*s == '+' || *s == '-') { /* deal with signs */ rel = TRUE; if (*s == '-') val = -1; s++; } if (!*s) { /* if null then return nothing */ *relative = TRUE; return 0; } /* skip over numbers */ for (cp = s; isascii(*s) && isdigit(*s); s++) ; val *= atoi (cp); /* skip blanks */ for (; isascii(*s) && isspace(*s); s++) ; if (*s) { /* if units */ switch (s[0]) { case 'p': case 'P': val *= pagesize; break; case 'c': case 'C': val *= canvassize; break; } } *relative = rel; return (val); } /************************************************************************ * * ExmPannerPage * * ************************************************************************/ static void ExmPannerPage ( Widget gw, XEvent *event, /* unused */ String *params, Cardinal *num_params /* unused */) { ExmPannerWidget pw = (ExmPannerWidget) gw; Cardinal zero = 0; Boolean isin = pw->panner.tmp.doing; int x, y; Boolean relx, rely; if (*num_params != 2) { XBell (XtDisplay(gw), 0); return; } x = ParsePageString (params[0], (int) pw->panner.knob_width, ((int) pw->core.width) - pw->simple.margin_width*2, &relx); y = ParsePageString (params[1], (int) pw->panner.knob_height, ((int) pw->core.height) - pw->simple.margin_height*2, &rely); if (relx) x += pw->panner.knob_x; if (rely) y += pw->panner.knob_y; if (isin) { /* if in, then use move */ XEvent ev; ev.xbutton.type = ButtonPress; ev.xbutton.x = x; ev.xbutton.y = y; ExmPannerMove (gw, &ev, (String *) NULL, &zero); } else { /* else just do it */ pw->panner.tmp.doing = TRUE; pw->panner.tmp.x = x; pw->panner.tmp.y = y; ExmPannerNotify (gw, event, (String *) NULL, &zero); pw->panner.tmp.doing = FALSE; } } /*************************************************************************** * * * XmQTnavigator Trait Methods * * * **************************************************************************/ /************************************************************************ * * NavigChangeMoveCB * store or remove the callback list to be called on any move. * ************************************************************************/ static void NavigChangeMoveCB( Widget nav, XtCallbackProc moveCB, XtPointer closure, Boolean setunset) { if (setunset) XtAddCallback (nav, ExmNreportCallback, moveCB, closure); else XtRemoveCallback (nav, ExmNreportCallback, moveCB, closure); } /************************************************************************ * * NavigSetValue * change the value and possibly call the callbacks * ************************************************************************/ static void NavigSetValue( Widget nav, XmNavigatorData nav_data, Boolean notify) { ExmPannerWidget pw = (ExmPannerWidget) nav; Arg arglist[6]; Cardinal n ; int hsave_value, vsave_value ; if (nav_data->valueMask & NavDimMask) { pw->panner.dimMask = nav_data->dimMask ; } /* Panner is a two dimensional navigator, it expects one or two dimension to be set, either case should match the ones registered using the NavDimMask flag as aboce. */ if (!(pw->panner.dimMask & nav_data->dimMask)) return ; hsave_value = pw->panner.slider_x ; vsave_value = pw->panner.slider_y ; n = 0; if (nav_data->dimMask & NavigDimensionX) { if ((nav_data->valueMask & NavValue) && (pw->panner.slider_x != nav_data->value.x)) { XtSetArg (arglist[n], ExmNsliderX, nav_data->value.x); n++; } if ((nav_data->valueMask & NavMaximum) && (pw->panner.canvas_width != nav_data->maximum.x)) { XtSetArg (arglist[n], ExmNcanvasWidth,nav_data->maximum.x); n++; } if ((nav_data->valueMask & NavSliderSize) && (pw->panner.slider_width != nav_data->slider_size.x) && (nav_data->slider_size.x != 0)) { XtSetArg (arglist[n], ExmNsliderWidth, nav_data->slider_size.x); n++; } } if (nav_data->dimMask & NavigDimensionY) { if ((nav_data->valueMask & NavValue) && (pw->panner.slider_y != nav_data->value.y)) { XtSetArg (arglist[n], ExmNsliderY, nav_data->value.y); n++; } if ((nav_data->valueMask & NavMaximum) && (pw->panner.canvas_height != nav_data->maximum.y)) { XtSetArg (arglist[n], ExmNcanvasHeight, nav_data->maximum.y);n++; } if ((nav_data->valueMask & NavSliderSize) && (pw->panner.slider_height != nav_data->slider_size.y) && (nav_data->slider_size.y != 0)) { XtSetArg (arglist[n], ExmNsliderHeight, nav_data->slider_size.y); n++; } } if (n) XtSetValues (nav, arglist, n); if (notify && ((pw->panner.slider_x != hsave_value) || (pw->panner.slider_y != vsave_value))) { ExmPannerCallbackStruct rep; rep.changed = (ExmPRSliderX | ExmPRSliderY); /* not always both */ rep.slider_x = pw->panner.slider_x; rep.slider_y = pw->panner.slider_y; rep.slider_width = pw->panner.slider_width; rep.slider_height = pw->panner.slider_height; rep.canvas_width = pw->panner.canvas_width; rep.canvas_height = pw->panner.canvas_height; XtCallCallbackList (nav, pw->panner.report_callbacks, (XtPointer) &rep); } } /************************************************************************ * * NavigGetValue * reports the all the data for this navigator scrollbar * ************************************************************************/ static void NavigGetValue( Widget nav, XmNavigatorData nav_data) { ExmPannerWidget pw = (ExmPannerWidget) nav; nav_data->dimMask = pw->panner.dimMask; if (nav_data->valueMask & (NavValue|NavMinimum|NavMaximum| NavSliderSize|NavIncrement|NavPageIncrement)) { nav_data->value.x = pw->panner.slider_x ; nav_data->value.y = pw->panner.slider_y ; nav_data->maximum.x = pw->panner.canvas_width ; nav_data->maximum.y = pw->panner.canvas_height ; nav_data->slider_size.x = pw->panner.slider_width ; nav_data->slider_size.y = pw->panner.slider_height ; } } /************************************************************************ * * Application Accessible External Functions * ************************************************************************/ /************************************************************************ * * ExmCreatePanner * Create an instance of a Panner and return the widget id. * ************************************************************************/ Widget ExmCreatePanner( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { return (XtCreateWidget (name, exmPannerWidgetClass, parent, arglist, argcount)); } /************************************************************************ * * ExmPannerSetValues * Set some Panner values. * ************************************************************************/ void ExmPannerSetValues( Widget w, int hvalue, int vvalue, #if NeedWidePrototypes int notify ) #else Boolean notify ) #endif /* NeedWidePrototypes */ { ExmPannerWidget pw = (ExmPannerWidget) w; int hsave_value, vsave_value; hsave_value = pw->panner.slider_x ; vsave_value = pw->panner.slider_y ; XtVaSetValues (w, ExmNsliderX, hvalue, ExmNsliderY, vvalue, NULL); if (notify && ((pw->panner.slider_x != hsave_value) || (pw->panner.slider_y != vsave_value))) { ExmPannerCallbackStruct rep; rep.changed = (ExmPRSliderX | ExmPRSliderY); /* not always both..*/ rep.slider_x = pw->panner.slider_x; rep.slider_y = pw->panner.slider_y; rep.slider_width = pw->panner.slider_width; rep.slider_height = pw->panner.slider_height; rep.canvas_width = pw->panner.canvas_width; rep.canvas_height = pw->panner.canvas_height; XtCallCallbackList (w, pw->panner.report_callbacks, (XtPointer) &rep); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/StringTrans.c�������������������������������������������������������������0000644�0001750�0001750�00000133541�12672140200�014614� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: StringTrans.c /main/6 1996/11/20 15:37:29 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /************************************ WARNING ********************************** * * ExmStringTransfer is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way. * ************************************ WARNING *********************************/ /******************************************************************************* * * StringTrans.c - ExmStringTransfer widget. This widget is a subclass * of ExmString that demonstrates UTM data transfer. * See the "OSF/Motif Widget Writer's Guide" for details. * ******************************************************************************/ #include <Xm/XmP.h> /* private header file for XmPrimitive */ #include <Exm/StringTransP.h> /* private header file for ExmStringTransfer */ #include <Xm/Screen.h> /* for screen information */ #include <Xm/TraitP.h> /* for traits */ #include <Xm/TransferT.h> /* for XmQTtransfer trait */ #include <Xm/SpecRenderT.h> /* for XmLABEL_RENDER_TABLE */ #include <Xm/DrawP.h> /* for XmeClearBorder */ /* Declare all static functions. */ static void ClassPartInitialize( WidgetClass widgetclass); static void Initialize( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void DrawVisual ( Widget w); static void CreateGC ( Widget w ); static void RegisterDropSite( Widget w); static void ExmStringTransferMoveFocus( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmStringTransferProcessDrag( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmStringTransferCopyPrimary( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmStringTransferCopyClipboard( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmStringTransferPastePrimary( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmStringTransferPasteClipboard( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ConvertProc( Widget w, XtPointer client_data, XtPointer call_data); static int ConvertCompoundString( Widget w, XmString cstring, Atom target, XtPointer *value, Atom *type, int *format, unsigned long *length, int *nchars); static void DestinationProc( Widget w, XtPointer client_data, XtPointer call_data); static void TransferProc( Widget w, XtPointer client_data, XtPointer call_data); static Atom PreferredTarget( Widget w, Atom *targets, Cardinal num_targets); /* No constants needed. */ /* Default translations for ExmStringTransfer */ static char defaultTranslations[] = "<EnterWindow>: PrimitiveEnter()\n\ <LeaveWindow>: PrimitiveLeave()\n\ c <Btn1Down>: ExmStringTransferMoveFocus()\n\ <Btn1Down>: ExmStringTransferMoveFocus()ExmStringTransferCopyPrimary()\n\ <Btn2Down>: ExmStringTransferProcessDrag()\n\ :<Key>osfPaste: ExmStringTransferPasteClipboard()\n\ :<Key>osfCut: ExmStringTransferCopyClipboard()\n\ :s <Key>osfInsert: ExmStringTransferPasteClipboard()\n\ :s <Key>osfDelete: ExmStringTransferCopyClipboard()\n\ :<Key>osfActivate: PrimitiveParentActivate()\n\ :<Key>osfCancel: PrimitiveParentCancel()\n\ :<Key>osfHelp: PrimitiveHelp()\n\ ~s ~m ~a <Key>Return: PrimitiveParentActivate()"; /* Actions for ExmStringTransfer */ static XtActionsRec actions[] = { {"ExmStringTransferMoveFocus", ExmStringTransferMoveFocus}, {"ExmStringTransferProcessDrag", ExmStringTransferProcessDrag}, {"ExmStringTransferCopyPrimary", ExmStringTransferCopyPrimary}, {"ExmStringTransferPastePrimary", ExmStringTransferPastePrimary}, {"ExmStringTransferCopyClipboard", ExmStringTransferCopyClipboard}, {"ExmStringTransferPasteClipboard", ExmStringTransferPasteClipboard} }; /* Resources for the ExmStringTransfer widget. */ static XtResource resources[] = { /* XmPrimitive */ { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf(XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) True /* Restore the default */ }, /* ExmStringTransfer */ { XmNdestinationCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf(ExmStringTransferRec, string_transfer.destination_callback), XmRCallback, (XtPointer) NULL }, }; /* No synthetic resources. */ externaldef (exmstringtransferclassrec) ExmStringTransferClassRec exmStringTransferClassRec = { { /* superclass */ (WidgetClass)&exmStringClassRec, /* class_name */ "ExmStringTransfer", /* widget_size */ sizeof(ExmStringTransferRec), /* class_initialize */ NULL, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actions, /* num_actions */ XtNumber(actions), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ NULL, /* resize */ XtInheritResize, /* expose */ XtInheritExpose, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* XmPrimitive */ /* border_highlight */ XmInheritBorderHighlight, /* border_unhighlight */ XmInheritBorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ NULL, /* syn_resources */ NULL, /* num_syn_resources */ 0, /* extension */ NULL, }, { /* ExmSimple */ /* draw_visual */ DrawVisual, /* draw_shadow */ ExmInheritDrawShadow, /* create_gc */ CreateGC, /* destroy_gc */ ExmInheritDestroyGC, /* select_gc */ ExmInheritSelectGC, /* calc_visual_size */ ExmInheritCalcVisualSize, /* calc_widget_size */ ExmInheritCalcWidgetSize, /* reconfigure */ ExmInheritReconfigure, /* extension */ NULL, }, { /* ExmString */ /* default_render_table_type */ XmLABEL_RENDER_TABLE, /* extension */ NULL, }, { /* ExmStringTransfer */ /* extension */ NULL, }, }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro for OS-independent global definitions. */ externaldef( exmstringtransferwidgetclass) WidgetClass exmStringTransferWidgetClass = (WidgetClass) &exmStringTransferClassRec; /* No global representation type variables. */ /* Define trait structure variables. */ /* Any widget class that uses the Uniform Transfer Model must have the * Transfer trait. Here we declare a variable to hold the trait structure. */ static XmConst XmTransferTraitRec StringTrT = { 0, /* version */ (XmConvertCallbackProc) ConvertProc, /* convertProc */ (XmDestinationCallbackProc) DestinationProc, /* destinationProc */ NULL, /* no destinationPreHookProc */ }; /************************************************************************ * * ClassPartInitialize * Called by the Intrinsics when this widget or a subclass of this * widget is instantiated. * ************************************************************************/ static void ClassPartInitialize( WidgetClass widgetclass ) { /* Install the XmQTtransfer trait on the ExmStringTransfer class and all its subclasses. */ XmeTraitSet((XtPointer) widgetclass, XmQTtransfer, (XtPointer) &StringTrT); } /****************************************************************************** * * Initialize * Called when this widget is instantiated. * *****************************************************************************/ static void Initialize ( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmStringTransferWidget stw = (ExmStringTransferWidget) new_w; /* Initialize internal instance data structures. */ stw->string_transfer.own_primary = False; /* Register widget as a drop site. */ RegisterDropSite(new_w); } /****************************************************************************** * * DrawVisual: * Called by ExmSimple whenever it needs to draw or redraw the * widget visual. Used here to do the highlighting for own_primary. * *****************************************************************************/ static void DrawVisual(Widget w) { ExmStringTransferWidgetClass wc = (ExmStringTransferWidgetClass)XtClass(w); ExmStringTransferWidget sw = (ExmStringTransferWidget)w; GC use_gc = wc->simple_class.select_gc(w); /* If the compound string is not NULL and if there is enough space in the widget to draw at least a little portion of the compound string, then render the string with XmStringDraw. */ if (sw->string.compound_string && (sw->simple.visual.width != 0) && (sw->simple.visual.height != 0)) { XtGCMask mask = GCForeground | GCBackground; XGCValues values; if (sw->string_transfer.own_primary) { values.foreground = sw->core.background_pixel; values.background = sw->primitive.foreground; XChangeGC(XtDisplay(sw), use_gc, mask, &values); XmStringDrawImage (XtDisplay(sw), XtWindow(sw), sw->string.render_table, sw->string.compound_string, use_gc, sw->simple.visual.x, sw->simple.visual.y, sw->simple.visual.width, sw->string.alignment, sw->primitive.layout_direction, NULL); } else { values.foreground = sw->primitive.foreground; values.background = sw->core.background_pixel; XChangeGC(XtDisplay(sw), use_gc, mask, &values); XmStringDrawImage (XtDisplay(sw), XtWindow(sw), sw->string.render_table, sw->string.compound_string, use_gc, sw->simple.visual.x, sw->simple.visual.y, sw->simple.visual.width, sw->string.alignment, sw->primitive.layout_direction, NULL); } XmeClearBorder(XtDisplay(sw), XtWindow(sw), (int)0, (int)0, (Dimension)sw->core.width, (Dimension)sw->core.height, (Dimension)(sw->primitive.highlight_thickness + sw->primitive.shadow_thickness) ); } } /******************************************************************************* * * CreateGC: * Called by the Initialize method of the base class (ExmSimple). * ******************************************************************************/ static void CreateGC ( Widget w ) { ExmStringWidget sw = (ExmStringWidget)w; XGCValues values; XtGCMask valueMask, dynamicMask; XFontStruct *fs = (XFontStruct *) NULL; Arg args[2]; Pixmap insensitiveStippleBitmap; /* This function creates two GC's: one to render a sensitive widget and the other to render an insensitive widget. */ /* This widget will change background and foreground of the text with the selection state. Therefore, foreground and background should be dynamic values */ dynamicMask = GCForeground | GCBackground; /* First, create the sensitive GC (named normal_gc). */ valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = sw->primitive.foreground; values.background = sw->core.background_pixel; values.graphics_exposures = False; /* In order to set the GCFont field of the GC, we must gather XFontStruct information out of the render table. This is only to get a reasonable initial value. XmStringDraw will pick the necessary fonts from the render table, so we will not need to update the GC when the render table changes. */ if (XmeRenderTableGetDefaultFont(sw->string.render_table, &fs)) { values.font = fs->fid; valueMask |= GCFont; } sw->simple.normal_gc = XtAllocateGC ((Widget)sw, 0, /* use widget's depth */ valueMask, &values, dynamicMask, 0); /* Next, create the insensitive GC. This GC will share the same foreground, background, font, and graphics exposures as the sensitive GC, but will hold a different fill style and stipple pattern. */ valueMask |= GCFillStyle | GCStipple; values.fill_style = FillStippled; /* Gather the Motif-appropriate insensitive stipple bitmap. */ XtSetArg(args[0], XmNinsensitiveStippleBitmap, &insensitiveStippleBitmap); XtGetValues(XmGetXmScreen(XtScreen(w)), args, 1); values.stipple = insensitiveStippleBitmap; sw->simple.insensitive_gc = XtAllocateGC ((Widget)sw, 0, /* use widget's depth */ valueMask, &values, dynamicMask, 0); } /****************************************************************************** * * RegisterDropSite * Called by Initialize. Registers this widget as a drop site. * *****************************************************************************/ static void RegisterDropSite( Widget w) { Atom TEXT = XInternAtom(XtDisplay(w), "TEXT", False); Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); Atom LOCALE_ATOM = XmeGetEncodingAtom(w); Atom MOTIF_C_S = XInternAtom(XtDisplay(w), "_MOTIF_COMPOUND_STRING", False); Atom targets[5]; Arg args[2]; int n, nt; /* Set up import targets. These are the targets from which we can generate a compound string when a drop is made. */ nt = 0; targets[nt++] = MOTIF_C_S; targets[nt++] = COMPOUND_TEXT; targets[nt++] = LOCALE_ATOM; if (LOCALE_ATOM != XA_STRING) { targets[nt++] = XA_STRING; } if (LOCALE_ATOM != TEXT) { targets[nt++] = TEXT; } /* If you add any more targets, bump the array size. */ n = 0; XtSetArg(args[n], XmNimportTargets, targets); n++; XtSetArg(args[n], XmNnumImportTargets, nt); n++; XmeDropSink(w, args, n); } /****************************************************************************** * * ExmStringTransferMoveFocus * Move the keyboard focus to this widget * *****************************************************************************/ static void ExmStringTransferMoveFocus( Widget w, XEvent *event, String *params, Cardinal *num_params) { XmProcessTraversal(w, XmTRAVERSE_CURRENT); } /****************************************************************************** * * ExmStringTransferProcessDrag * Starts a drag operation. * *****************************************************************************/ static void ExmStringTransferProcessDrag( Widget w, XEvent *event, String *params, Cardinal *num_params) { ExmStringTransferWidget stw = (ExmStringTransferWidget) w; Arg args[4]; Cardinal n; if (! stw -> string_transfer.own_primary) { ExmStringTransferPastePrimary(w, event, params, num_params); return; } /* Initialize DragContext resources. We want the drag icon to indicate text, and we support only the COPY operation. */ n = 0; /* Normal drag and drop behavior will be to use the foreground and background of the widget when creating the cursor or or the pixmap drag icon */ XtSetArg(args[n], XmNcursorBackground, stw->core.background_pixel); n++; XtSetArg(args[n], XmNcursorForeground, stw->primitive.foreground); n++; /* We use the default text drag icon, the same as used in the standard Motif widgets. */ XtSetArg(args[n], XmNsourceCursorIcon, XmeGetTextualDragIcon(w)); n++; XtSetArg(args[n], XmNdragOperations, XmDROP_COPY); n++; (void) XmeDragSource(w, NULL, event, args, n); } /****************************************************************************** * * ExmStringTransferCopyPrimary * Take ownership of the PRIMARY selection * *****************************************************************************/ static void ExmStringTransferCopyPrimary( Widget w, XEvent *event, String *params, Cardinal *num_params) { Time time; ExmStringTransfer stw = (ExmStringTransfer) w; /* First we must obtain a timestamp. This is required for ICCCM compliant ownership of a selection. We use XtLastTimestampProcessed which holds the timestamp from the last event the Intrinsics saw with a timestamp. */ time = XtLastTimestampProcessed(XtDisplay(w)); /* Own the primary selection. Indicate this to the user by reversing the foreground and background in the text rendition (eventually) */ stw -> string_transfer.own_primary = True; /* Once we call XmePrimarySource, the widget's transfer trait convert method will get called if a destination wishes to obtain the PRIMARY selection */ XmePrimarySource(w, time); /* Update the widget to show the new state */ stw -> core.widget_class -> core_class.expose(w, NULL, NULL); } /****************************************************************************** * * ExmStringTransferCopyClipboard * Put the current widget's data on the clipboard * *****************************************************************************/ static void ExmStringTransferCopyClipboard( Widget w, XEvent *event, String *params, Cardinal *num_params) { Time time; /* First we must obtain a timestamp. This is required for ICCCM compliant ownership of a selection. We use XtLastTimestampProcessed which holds the timestamp from the last event the Intrinsics saw with a timestamp. */ time = XtLastTimestampProcessed(XtDisplay(w)); /* When we call XmeClipboardSource, either the Motif clipboard will request the current selection data or an external clipboard manager will obtain the data. When the data is obtained, the CLIPBOARD selection will be owned by the data holder */ XmeClipboardSource(w, XmCOPY, time); } /****************************************************************************** * * ExmStringTransferPastePrimary * Paste the contents of the PRIMARY selection * *****************************************************************************/ static void ExmStringTransferPastePrimary( Widget w, XEvent *event, String *params, Cardinal *num_params) { Time time; unsigned int op; /* First we must obtain a timestamp. This is required for ICCCM compliant ownership of a selection. We use XtLastTimestampProcessed which holds the timestamp from the last event the Intrinsics saw with a timestamp. */ time = XtLastTimestampProcessed(XtDisplay(w)); /* We determine the right operation to perform by looking at the modifiers present */ if (event -> xbutton.state & ShiftMask) { if (event -> xbutton.state & ControlMask) op = XmLINK; else op = XmMOVE; } else op = XmCOPY; /* Calling XmePrimarySink will start the process of requesting the PRIMARY selection to be pasted using the transfer trait destination callback for this widget class */ XmePrimarySink(w, op, NULL, time); } /****************************************************************************** * * ExmStringTransferPasteClipboard * Paste the contents of the CLIPBOARD selection * *****************************************************************************/ static void ExmStringTransferPasteClipboard( Widget w, XEvent *event, String *params, Cardinal *num_params) { /* Calling XmeClipboardSink will start the process of requesting the CLIPBOARD selection to be pasted using the transfer trait destination callback for this widget class */ XmeClipboardSink(w, XmCOPY, NULL); } /****************************************************************************** * * Trait Methods: * Provide two of the trait methods defined by the XmQTtransfer trait. * *****************************************************************************/ /****************************************************************************** * * ConvertProc * Transfer trait convertProc. * The toolkit calls this procedure after calling the XmNconvertCallback * procedures whenever someone requests a conversion from the widget. * The convertProc is passed an XmConvertCallbackStruct. The convertProc * fills in the status member and, if it does the conversion, the value, * type, length, and format members, which represent the converted data. * *****************************************************************************/ static void ConvertProc( Widget w, XtPointer client_data, XtPointer call_data) { ExmStringTransferWidget stw = (ExmStringTransferWidget) w; XmConvertCallbackStruct *cs = (XmConvertCallbackStruct *) call_data; int n, nchars; int cstatus; XmString cstring = stw -> string.compound_string; Boolean converted = False; Atom type = None; XtPointer value = (XtPointer) NULL; unsigned long length = 0; int format = 8; /* Setup the needed Atoms. This must be done each time as it is never known which display a particular widget will belong to. Atom values are constant only on individual displays. */ Atom CLIPBOARD = XInternAtom(XtDisplay(w), XmSCLIPBOARD, False); Atom TEXT = XInternAtom(XtDisplay(w), XmSTEXT, False); Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), XmSCOMPOUND_TEXT, False); Atom LOCALE_ATOM = XmeGetEncodingAtom(w); Atom FOREGROUND = XInternAtom(XtDisplay(w), "FOREGROUND", False); Atom BACKGROUND = XInternAtom(XtDisplay(w), "BACKGROUND", False); Atom TARGETS = XInternAtom(XtDisplay(w), XmSTARGETS, False); Atom MOTIF_DROP = XInternAtom(XtDisplay(w), XmS_MOTIF_DROP, False); Atom MOTIF_C_S = XInternAtom(XtDisplay(w), XmS_MOTIF_COMPOUND_STRING, False); Atom MOTIF_EXPORT_TARGETS = XInternAtom(XtDisplay(w), XmS_MOTIF_EXPORT_TARGETS, False); Atom CLIPBOARD_IMMEDIATE = XInternAtom(XtDisplay(w), XmS_MOTIF_CLIPBOARD_TARGETS, False); Atom LOSE_SELECTION = XInternAtom(XtDisplay(w), XmS_MOTIF_LOSE_SELECTION, False); /* We don't support links, so refuse clipboard convert requests which specify XmLINK in the parm field */ if (cs -> selection == CLIPBOARD && cs -> parm == (XtPointer) XmLINK) { cs -> status = XmCONVERT_REFUSE; return; } /* The primary selection has been lost. Cleanup the widget visuals */ if (cs -> selection == XA_PRIMARY && cs -> target == LOSE_SELECTION) { stw -> string_transfer.own_primary = False; stw -> core.widget_class -> core_class.expose(w, NULL, NULL); return; } if (cs -> target == TARGETS) { /* We convert the standard targets, plus those to which we can * convert a compound string. */ Atom *targs = XmeStandardTargets(w, 5, &n); targs[n] = MOTIF_C_S; n++; targs[n] = COMPOUND_TEXT; n++; targs[n] = LOCALE_ATOM; n++; if (LOCALE_ATOM != XA_STRING) { targs[n] = XA_STRING; n++; } if (LOCALE_ATOM != TEXT) { targs[n] = TEXT; n++; } value = (XtPointer) targs; type = XA_ATOM; length = n; format = 32; converted = True; } if (cs -> target == MOTIF_EXPORT_TARGETS) { /* Allow dragging of targets to which we can convert a compound * string, plus FOREGROUND and BACKGROUND. These two will be * converted by XmeStandardConvert. */ Atom *targs = (Atom *) XtMalloc(sizeof(Atom) * 7); if (targs == NULL) { cs -> status = XmCONVERT_REFUSE; return; } n = 0; targs[n] = MOTIF_C_S; n++; targs[n] = COMPOUND_TEXT; n++; targs[n] = LOCALE_ATOM; n++; if (LOCALE_ATOM != XA_STRING) { targs[n] = XA_STRING; n++; } if (LOCALE_ATOM != TEXT) { targs[n] = TEXT; n++; } targs[n] = FOREGROUND; n++; targs[n] = BACKGROUND; n++; value = (XtPointer) targs; type = XA_ATOM; length = n; format = 32; converted = True; } if (cs -> target == CLIPBOARD_IMMEDIATE) { /* Put all targets which have no loss of data on the clipboard This will always include _MOTIF_COMPOUND_STRING and COMPOUND_TEXT. We also put the locale encoding and STRING (the locale encoding of ISO8859-1) on the clipboard providing that they are completely convertable (no loss of data) */ Atom *targs = (Atom *) XtMalloc(sizeof(Atom) * 4); if (targs == NULL) { cs -> status = XmCONVERT_REFUSE; return; } n = 0; targs[n] = MOTIF_C_S; n++; /* Check to make sure we can convert to STRING */ cstatus = ConvertCompoundString(w, cstring, XA_STRING, &value, &type, &format, &length, &nchars); if (cstatus == XmCONVERT_DONE && nchars == 0) { targs[n] = XA_STRING; n++; } /* If the locale is not STRING, then make sure we can convert the locale and, if so, put it on the clipboard */ if (LOCALE_ATOM != XA_STRING) { cstatus = ConvertCompoundString(w, cstring, LOCALE_ATOM, &value, &type, &format, &length, &nchars); if (cstatus == XmCONVERT_DONE && nchars == 0) { targs[n] = LOCALE_ATOM; n++; } if (cstatus == XmCONVERT_DONE) XtFree((char *) value); } targs[n] = COMPOUND_TEXT; n++; if (cstatus == XmCONVERT_DONE) XtFree((char *) value); value = (XtPointer) targs; type = XA_ATOM; length = n; format = 32; converted = True; } if (cs -> target == MOTIF_C_S || cs -> target == COMPOUND_TEXT || cs -> target == TEXT || cs -> target == LOCALE_ATOM || cs -> target == XA_STRING) { /* Convert the compound string to the appropriate target. */ cstatus = ConvertCompoundString(w, cstring, cs -> target, &value, &type, &format, &length, &nchars); if (cstatus == XmCONVERT_REFUSE) { cs -> status = XmCONVERT_REFUSE; return; } if (cstatus == XmCONVERT_DONE) { converted = True; } } if (converted) { /* Converted */ if (cs -> status == XmCONVERT_MERGE) { /* A status of XmCONVERT_MERGE means that our value should be * merged with any value that may have come from the XmNconvertCallback * routines. This should apply only to listlike targets, such as * TARGETS. XmeConvertMerge does the merging. */ XmeConvertMerge(value, type, format, length, cs); XtFree((char *) value); } else { /* Fill in the callback struct members. */ cs -> type = type; cs -> value = value; cs -> length = length; cs -> format = format; } cs -> status = XmCONVERT_DONE; } else { /* We didn't understand the target. Try XmeStandardConvert. */ XmeStandardConvert(w, NULL, cs); if (cs -> value == NULL) cs -> status = XmCONVERT_REFUSE; else cs -> status = XmCONVERT_DONE; } } /****************************************************************************** * * ConvertCompoundString * Called by the transfer trait convertProc to convert a compound * string to an appropriate target. * This function returns a conversion status to indicate whether or * not it was able to convert the compound string: * XmCONVERT_DONE -- successful conversion * XmCONVERT_REFUSE -- error in converting * XmCONVERT_DEFAULT -- unrecognized target * If successful, it returns the value, type, format, and length * arguments, suitable for insertion into an XmConvertCallbackStruct. * It also returns the nchars argument indicating how many unconverted * characters it produced in the event of a partial conversion. * If the returned value is other than XmCONVERT_DONE, the returned * arguments are undefined. * *****************************************************************************/ static int ConvertCompoundString( Widget w, XmString cstring, Atom target, XtPointer *value, Atom *type, int *format, unsigned long *length, int *nchars) { Atom MOTIF_C_S = XInternAtom(XtDisplay(w), "_MOTIF_COMPOUND_STRING", False); Atom TEXT = XInternAtom(XtDisplay(w), "TEXT", False); Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); Atom LOCALE_ATOM = XmeGetEncodingAtom(w); Boolean converted = False; char ** strings; int count, nchars1; if (value == NULL || type == NULL || format == NULL || length == NULL || nchars == NULL) return XmCONVERT_REFUSE; if (target == MOTIF_C_S) { /* For _MOTIF_COMPOUND_STRING, convert to ASN.1 format, and we're done. */ *type = MOTIF_C_S; *format = 8; *length = XmCvtXmStringToByteStream(cstring, (unsigned char **) value); *nchars = 0; converted = True; } if (target == COMPOUND_TEXT || target == TEXT || target == LOCALE_ATOM || target == XA_STRING) { char *ct; XTextProperty text_prop; *type = target; *format = 8; *length = 0; *value = (XtPointer) NULL; *nchars = 0; if (cstring == NULL) { /* If the compound string is NULL, return a value of NULL and a * length of 0, and assert that the conversion was successful. */ if (target == TEXT) *type = LOCALE_ATOM; converted = True; } else { /* For any of these four targets, the first thing we must do is * convert the compound string to compound text. */ ct = XmCvtXmStringToCT(cstring); if (ct == NULL) { /* error in conversion to CT */ return XmCONVERT_REFUSE; } if (target == COMPOUND_TEXT) { /* For COMPOUND_TEXT, return the compound text. * Note: There is no way, using documented functions, to obtain * the length of the converted compound text, other than to * assume that it contains no embedded NULL bytes and call strlen(). * It is theoretically possible for compound text to include * embedded NULLs, but we'll ignore that possibility. */ *value = (XtPointer) ct; *length = strlen(ct); /* Don't include NULL byte */ converted = True; } else { /* For a target of TEXT, STRING, or the locale atom, the next * step is to convert the compound text into locale text. * We use XmbTextPropertyToTextList to do that. */ text_prop.encoding = COMPOUND_TEXT; text_prop.format = 8; text_prop.value = (unsigned char *) ct; text_prop.nitems = strlen(ct); /* Don't include NULL byte */ *nchars = nchars1 = XmbTextPropertyToTextList(XtDisplay(w), &text_prop, &strings, &count); if (nchars1 <= 0) nchars1 = 0; if (*nchars == XNoMemory || *nchars == XLocaleNotSupported || *nchars == XConverterNotFound) { /* error in conversion to locale text */ XtFree(ct); return XmCONVERT_REFUSE; } if (target == TEXT) { /* For TEXT, if we completely converted the compound text to * locale text, return the locale text and the locale atom. * XmbTextListToTextProperty takes care of converting the * locale text to a set of NULL-separated elements, and it * computes the length of the value. * If we only partially converted the compound text to locale * text, we return the compound text and COMPOUND_TEXT. */ if (*nchars == Success) { *type = LOCALE_ATOM; *nchars = XmbTextListToTextProperty(XtDisplay(w), strings, count, XTextStyle, &text_prop); XtFree(ct); XFreeStringList(strings); if (*nchars == XNoMemory || *nchars == XLocaleNotSupported || *nchars == XConverterNotFound) { /* error in conversion to locale text */ return XmCONVERT_REFUSE; } *value = (XtPointer) XtMalloc(text_prop.nitems + 1); if (*value == NULL) { XFree(text_prop.value); return XmCONVERT_REFUSE; } (void) memcpy(*value, text_prop.value, text_prop.nitems + 1); XFree(text_prop.value); *length = text_prop.nitems; } else { XFreeStringList(strings); *type = COMPOUND_TEXT; *value = (XtPointer) ct; *length = strlen(ct); /* Don't include NULL byte */ } converted = True; } if (target == LOCALE_ATOM && !converted) { /* For the locale atom, return the locale text and the * locale atom, even if the compound text was only * partially converted to locale text. */ *nchars = XmbTextListToTextProperty(XtDisplay(w), strings, count, XTextStyle, &text_prop); XtFree(ct); XFreeStringList(strings); if (*nchars == XNoMemory || *nchars == XLocaleNotSupported || *nchars == XConverterNotFound) { /* error in conversion to locale text */ return XmCONVERT_REFUSE; } *value = (XtPointer) XtMalloc(text_prop.nitems + 1); if (*value == NULL) { XFree(text_prop.value); return XmCONVERT_REFUSE; } (void) memcpy(*value, text_prop.value, text_prop.nitems + 1); XFree(text_prop.value); *length = text_prop.nitems; *nchars = nchars1 + (*nchars <= 0 ? 0 : *nchars); converted = True; } if (target == XA_STRING && !converted) { /* For STRING, use XmbTextListToTextProperty to convert the * locale text to STRING, and return the result. * Note that the locale atom might be STRING, so we might * already have done the conversion above. */ *nchars = XmbTextListToTextProperty(XtDisplay(w), strings, count, XStringStyle, &text_prop); XtFree(ct); XFreeStringList(strings); if (*nchars == XNoMemory || *nchars == XLocaleNotSupported || *nchars == XConverterNotFound) { /* error in conversion to string */ return XmCONVERT_REFUSE; } *value = (XtPointer) XtMalloc(text_prop.nitems + 1); if (*value == NULL) { XFree(text_prop.value); return XmCONVERT_REFUSE; } (void) memcpy(*value, text_prop.value, text_prop.nitems + 1); XFree(text_prop.value); *length = text_prop.nitems; *nchars = nchars1 + (*nchars <= 0 ? 0 : *nchars); converted = True; } } } } /* For a successful conversion, return XmCONVERT_DONE. * If we didn't recognize the target, return XmCONVERT_DEFAULT. */ if (converted) return XmCONVERT_DONE; else return XmCONVERT_DEFAULT; } /****************************************************************************** * * DestinationProc * Transfer trait destinationProc. * The toolkit calls this procedure after calling the * XmNdestinationCallback procedures whenever the widget is the * destination for data transfer. * The destinationProc is passed an XmDestinationCallbackStruct. * The destinationProc typically calls XmTransferValue to retrieve * the data or XmTransferDone to finish the transfer. * *****************************************************************************/ static void DestinationProc( Widget w, XtPointer client_data, XtPointer call_data) { XmDestinationCallbackStruct *ds = (XmDestinationCallbackStruct *) call_data; Atom XA_MOTIF_DROP = XInternAtom(XtDisplay(w), "_MOTIF_DROP", False); Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Cardinal num_targets, n; Arg args[2]; Atom target, *targets; if (ds -> operation == XmLINK) { /* We don't support links. */ XmTransferDone(ds -> transfer_id, XmTRANSFER_DONE_FAIL); return; } if (ds -> selection == XA_MOTIF_DROP) { XmDropProcCallbackStruct *cb = (XmDropProcCallbackStruct *) ds -> destination_data; /* No support for drop help. */ if (cb -> dropAction == XmDROP_HELP || cb -> operation == XmDROP_NOOP) { XmTransferDone(ds -> transfer_id, XmTRANSFER_DONE_FAIL); return; } /* Get the list of export targets from the DragContext. If * this list contains a target we can convert to a compound * string, transfer the value. */ n = 0; XtSetArg(args[n], XmNexportTargets, &targets); n++; XtSetArg(args[n], XmNnumExportTargets, &num_targets); n++; XtGetValues(cb -> dragContext, args, n); target = PreferredTarget(w, targets, num_targets); if (target == None) { XmTransferDone(ds -> transfer_id, XmTRANSFER_DONE_FAIL); return; } /* TransferProc is called by XmTransferValue when the data is * ready. TransferProc does the conversion to compound string. */ XmTransferValue(ds -> transfer_id, target, (XtCallbackProc) TransferProc, NULL, 0); } else { /* For selections other than _MOTIF_DROP, ask for TARGETS. * TransferProc will handle the returned targets. */ XmTransferValue(ds -> transfer_id, TARGETS, (XtCallbackProc) TransferProc, NULL, 0); } } /****************************************************************************** * * TransferProc * Called by XmTransferValue when the transferred data is available. * The procedure is passed an XmSelectionCallbackStruct. * It is responsible for converting the data to a compound string * and inserting it into the widget. * *****************************************************************************/ static void TransferProc( Widget w, XtPointer client_data, XtPointer call_data) { XmSelectionCallbackStruct *ss = (XmSelectionCallbackStruct *) call_data; Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); Atom MOTIF_C_S = XInternAtom(XtDisplay(w), "_MOTIF_COMPOUND_STRING", False); Atom LOCALE_ATOM = XmeGetEncodingAtom(w); XmString cstring = (XmString) NULL; Boolean transferred = False; if (ss -> target == TARGETS && ss -> type == XA_ATOM) { /* For TARGETS, if the returned target list contains one we can * convert to a compound string, request conversion to that target. */ Atom target = PreferredTarget(w, (Atom *) ss -> value, ss -> length); if (target == None) { XtFree((char *) ss -> value); ss -> value = (XtPointer) NULL; XmTransferDone(ss -> transfer_id, XmTRANSFER_DONE_FAIL); return; } XmTransferValue(ss -> transfer_id, target, (XtCallbackProc) TransferProc, NULL, 0); } if (ss -> type == MOTIF_C_S) { /* For _MOTIF_COMPOUND_STRING, the data must be in ASN.1 format. Convert to a compound string. cstring = XmCvtByteStreamToXmString((unsigned char *) ss -> value, | ss -> length); */ cstring = XmCvtByteStreamToXmString((unsigned char *) ss -> value); transferred = True; } if (ss -> type == COMPOUND_TEXT) { /* Convert compound text to a compound string. * Note that XmCvtCTToXmString does not convert a list of compound text * strings, so we will get only the first if there's more than one. * XmCvtCTToXmString expects a NULL-terminated compound text string, * so add a trailing NULL. */ char *string; string = XtMalloc(ss -> length + 1); if (string == NULL) { XtFree((char *) ss -> value); ss -> value = (XtPointer) NULL; return; } (void) memcpy(string, ss -> value, ss -> length); string[ss -> length] = '\0'; cstring = XmCvtCTToXmString(string); XtFree(string); transferred = True; } if (ss -> type == XA_STRING || ss -> type == LOCALE_ATOM) { /* Convert either a XA_STRING (ISO8859-1 encoding) or the specific locale encoding. This will be the current locale of the application */ XmString cstring1, sep, oldstring; char **strings; int nchars, count, i; XTextProperty text_prop; text_prop.value = (unsigned char *) ss -> value; text_prop.encoding = ss -> type; text_prop.format = ss -> format; text_prop.nitems = ss -> length; if (ss -> type == XA_STRING) { /* For STRING, create a compound string with an explicit tag * and a type of XmCHARSET_TEXT. */ nchars = (int) XTextPropertyToStringList(&text_prop, &strings, &count); if (nchars == 0) { /* error in conversion to list of strings */ XtFree((char *) ss -> value); ss -> value = (XtPointer) NULL; return; } sep = XmStringSeparatorCreate(); for (i = 0; i < count; i++) { oldstring = cstring; cstring1 = XmStringGenerate(strings[i], (XmStringTag) XmSTRING_ISO8859_1, XmCHARSET_TEXT, NULL); cstring = XmStringConcat(oldstring, cstring1); XmStringFree(oldstring); XmStringFree(cstring1); if (i < count - 1) { oldstring = cstring; cstring = XmStringConcat(oldstring, sep); XmStringFree(oldstring); } } XmStringFree(sep); XFreeStringList(strings); transferred = True; } if (ss -> type == LOCALE_ATOM && !transferred) { /* For locale text (unless the locale atom is STRING), create a * compound string with a tag of _MOTIF_DEFAULT_LOCALE and a type * of XmMULTIBYTE_TEXT. */ nchars = XmbTextPropertyToTextList(XtDisplay(w), &text_prop, &strings, &count); if (nchars == XNoMemory || nchars == XLocaleNotSupported || nchars == XConverterNotFound) { /* error in conversion to locale text */ XtFree((char *) ss -> value); ss -> value = (XtPointer) NULL; return; } sep = XmStringSeparatorCreate(); for (i = 0; i < count; i++) { oldstring = cstring; cstring1 = XmStringGenerate(strings[i], NULL, XmMULTIBYTE_TEXT, NULL); cstring = XmStringConcat(oldstring, cstring1); XmStringFree(oldstring); XmStringFree(cstring1); if (i < count - 1) { oldstring = cstring; cstring = XmStringConcat(oldstring, sep); XmStringFree(oldstring); } } XmStringFree(sep); XFreeStringList(strings); transferred = True; } } if (transferred) { /* We have a compound string. Use it as the new value of * ExmNcompoundString. */ Arg args[1]; Cardinal n; n = 0; XtSetArg(args[n], ExmNcompoundString, cstring); n++; XtSetValues(w, args, n); } XmStringFree(cstring); XtFree((char *) ss -> value); ss -> value = (XtPointer) NULL; } /****************************************************************************** * * PreferredTarget * Given a list of targets, returns the target we prefer to transfer * as a destination. * If we cannot handle any target in the list, returns None. * *****************************************************************************/ static Atom PreferredTarget( Widget w, Atom *targets, Cardinal num_targets) { Atom TEXT = XInternAtom(XtDisplay(w), "TEXT", False); Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), "COMPOUND_TEXT", False); Atom MOTIF_C_S = XInternAtom(XtDisplay(w), "_MOTIF_COMPOUND_STRING", False); Atom LOCALE_ATOM = XmeGetEncodingAtom(w); int n; int cs_index = -1; int ct_index = -1; int locale_index = -1; int string_index = -1; int text_index = -1; for (n = 0; n < num_targets; n++) { if (targets[n] == MOTIF_C_S) cs_index = n; if (targets[n] == COMPOUND_TEXT) ct_index = n; if (targets[n] == TEXT) text_index = n; if (targets[n] == LOCALE_ATOM) locale_index = n; if (targets[n] == XA_STRING) string_index = n; } /* The preferred order of targets: * If the locale atom is present, use this order: * _MOTIF_COMPOUND_STRING * TEXT * COMPOUND_TEXT * locale atom * STRING * If the locale atom is not present, use this order: * _MOTIF_COMPOUND_STRING * COMPOUND_TEXT * STRING */ if (locale_index >= 0) { if (cs_index >= 0) return targets[cs_index]; if (text_index >= 0) return targets[text_index]; if (ct_index >= 0) return targets[ct_index]; if (locale_index >= 0) return targets[locale_index]; if (string_index >= 0) return targets[string_index]; } else { if (cs_index >= 0) return targets[cs_index]; if (ct_index >= 0) return targets[ct_index]; if (string_index >= 0) return targets[string_index]; } return None; } /****************************************************************************** * * ExmCreateStringTransfer * Externally accessible function for creating a StringTransfer widget. * *****************************************************************************/ Widget ExmCreateStringTransfer ( Widget parent, char *name, Arg *arglist, Cardinal argCount ) { return (XtCreateWidget (name, exmStringTransferWidgetClass, parent, arglist, argCount)); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Simple.h������������������������������������������������������������������0000644�0001750�0001750�00000004767�12672140200�013603� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Simple.h /main/5 1995/07/15 20:41:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * Simple.h: The widget public header file for the ExmSimple demonstration * widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmSimple_h #define _ExmSimple_h /* Include appropriate files. */ #include <Xm/Xm.h> /* public header file for the XmPrimitive widget */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class and widget record. */ externalref WidgetClass exmSimpleWidgetClass; typedef struct _ExmSimpleClassRec *ExmSimpleWidgetClass; typedef struct _ExmSimpleRec *ExmSimpleWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsSimple #define ExmIsSimple(w) XtIsSubclass(w, exmSimpleWidgetClass) #endif /* Define string equivalents of new resource names. */ #define ExmNsimpleShape "simpleShape" #define ExmCSimpleShape "SimpleShape" #define ExmRSimpleShape "ExmSimpleShape" /* Specify new enumerated constants for resources. */ enum { ExmSHAPE_OVAL=0, ExmSHAPE_RECTANGLE=1 }; /* Specify the API for this widget. */ extern Widget ExmCreateSimple(Widget parent, char *name, Arg *arglist, Cardinal argCount); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _ExmSimple_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ���������motif-2.3.8/demos/lib/Exm/ExmMrm.c������������������������������������������������������������������0000644�0001750�0001750�00000004662�12672140200�013544� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: ExmMrm.c /main/4 1995/07/15 20:40:36 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #include <stdio.h> #include <Xm/Xm.h> #include <Mrm/MrmPublic.h> #include <Exm/Simple.h> #include <Exm/ExmString.h> #include <Exm/StringTrans.h> #include <Exm/CommandB.h> #include <Exm/MenuB.h> #include <Exm/Grid.h> #include <Exm/TabB.h> #include <Exm/Panner.h> /********************************************************************** * * ExmMrmInitialize - register Exm widget classes with Mrm * *********************************************************************/ int ExmMrmInitialize() { MrmRegisterClass (MrmwcUnknown, "ExmSimple", "ExmCreateSimple", ExmCreateSimple, exmSimpleWidgetClass); MrmRegisterClass (MrmwcUnknown, "ExmString", "ExmCreateString", ExmCreateString, exmStringWidgetClass); MrmRegisterClass (MrmwcUnknown, "ExmStringTransfer", "ExmCreateStringTransfer", ExmCreateStringTransfer, exmStringTransferWidgetClass); MrmRegisterClass (MrmwcUnknown, "ExmGrid", "ExmCreateGrid", ExmCreateGrid, exmGridWidgetClass); MrmRegisterClass (MrmwcUnknown, "ExmCommandButton", "ExmCreateCommandButton", ExmCreateCommandButton, exmCommandButtonWidgetClass); MrmRegisterClass (MrmwcUnknown, "ExmMenuButton", "ExmCreateMenuButton", ExmCreateMenuButton, exmMenuButtonWidgetClass); MrmRegisterClass (MrmwcUnknown, "ExmTabButton", "ExmCreateTabButton", ExmCreateTabButton, exmTabButtonWidgetClass); MrmRegisterClass (MrmwcUnknown, "ExmPanner", "ExmCreatePanner", ExmCreatePanner, exmPannerWidgetClass); return (0); } ������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Panner.h������������������������������������������������������������������0000644�0001750�0001750�00000007247�12672140200�013571� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Panner.h /main/5 1995/07/15 20:41:15 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* Ensure that this file be included only once. */ #ifndef _ExmPanner_h #define _ExmPanner_h /* Include appropriate header file(s). */ #include <Exm/Simple.h> /* public header file for the ExmSimple widget */ /* Allow for compilation by C++. */ #ifdef __cplusplus extern "C" { #endif #define ExmNcanvasWidth "canvasWidth" #define ExmCCanvasWidth "CanvasWidth" #define ExmNcanvasHeight "canvasHeight" #define ExmCCanvasHeight "CanvasHeight" #define ExmNrubberBand "rubberBand" #define ExmCRubberBand "RubberBand" #define ExmNsliderX "sliderX" #define ExmCSliderX "SliderX" #define ExmNsliderY "sliderY" #define ExmCSliderY "SliderY" #define ExmNsliderWidth "sliderWidth" #define ExmCSliderWidth "SliderWidth" #define ExmNsliderHeight "sliderHeight" #define ExmCSliderHeight "SliderHeight" #define ExmNreportCallback "reportCallback" #define ExmCReportCallback "reportCallback" /* * ExmPannerReport - this structure is used by the reportCallback of the * Panner, Porthole, Viewport, and Scrollbar widgets to report its position. * All fields must be filled in, although the changed field may be used as * a hint as to which fields have been altered since the last report. */ typedef struct { int reason; XEvent *event; Mask changed; /* mask, see below */ Position slider_x, slider_y; /* location of slider within outer */ Dimension slider_width, slider_height; /* size of slider */ Dimension canvas_width, canvas_height; /* size of canvas */ } ExmPannerCallbackStruct; #define ExmPRSliderX (1 << 0) #define ExmPRSliderY (1 << 1) #define ExmPRSliderWidth (1 << 2) #define ExmPRSliderHeight (1 << 3) #define ExmPRCanvasWidth (1 << 4) #define ExmPRCanvasHeight (1 << 5) /* external declarations */ externalref WidgetClass exmPannerWidgetClass; typedef struct _ExmPannerClassRec *ExmPannerWidgetClass; typedef struct _ExmPannerRec *ExmPannerWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsPanner #define ExmIsPanner(w) XtIsSubclass(w, exmPannerWidgetClass) #endif /******** Public Function Declarations ********/ extern Widget ExmCreatePanner( Widget parent, char *name, ArgList arglist, Cardinal argcount) ; extern void ExmPannerSetValues( Widget w, int hvalue, int vvalue, #if NeedWidePrototypes int notify) ; #else Boolean notify) ; #endif /* NeedWidePrototypes */ /******** End Public Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _ExmPanner_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/ExmStringP.h��������������������������������������������������������������0000644�0001750�0001750�00000006115�12672140200�014377� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: StringP.h /main/4 1995/07/15 20:41:45 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * StringP.h: The widget private header file for the ExmString demonstration * widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmStringP_h #define _ExmStringP_h /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Include appropriate files. */ #include <Exm/ExmString.h> /* public header file for the ExmString widget */ #include <Exm/SimpleP.h> /* private header file for the ExmSimple widget */ /* No new inheritable methods. */ /* Define the widget class part. */ typedef struct _ExmStringClassPart { unsigned char default_render_table_type; XtPointer extension; } ExmStringClassPart; /* Define the full class record. */ typedef struct _ExmStringClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; ExmSimpleClassPart simple_class; ExmStringClassPart string_class; } ExmStringClassRec; /* Make the full class record externally accessible. */ externalref ExmStringClassRec exmStringClassRec; /* Define a new enumerated type. */ typedef enum { ExmCENTER_STRING, ExmSTART_STRING_LEFT_SIDE, ExmSTART_STRING_RIGHT_SIDE} ExmHowAligned; /* Define the widget instance part. */ typedef struct _ExmStringPart { /* Provide space for the five resources of ExmString. */ XmString compound_string; unsigned char alignment; XmRenderTable render_table; Boolean recompute_size; ExmHowAligned text_starts_here; } ExmStringPart; /* Define the full instance record. */ typedef struct _ExmStringRec { CorePart core; XmPrimitivePart primitive; ExmSimplePart simple; ExmStringPart string; } ExmStringRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmStringIndex (ExmSimpleIndex + 1) /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmStringP_h */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Simple.c������������������������������������������������������������������0000644�0001750�0001750�00000121203�12672140200�013557� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Simple.c /main/5 1995/07/15 20:41:24 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /*********************************** WARNING ********************************** * * ExmSimple is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way *********************************** WARNING *********************************/ /****************************************************************************** * * Simple.c - ExmSimple widget. This widget renders a rectangle or an oval. * The ExmSimple widget demonstrates how to create a * subclass of XmPrimitive that can, itselve, serve as a superclass * for other widgets. ExmSimple also demonstrates how to * * create a new representation type (ExmRSimpleShape). * * install the XmQTcontainerItem trait and its trait methods. * * install the XmQTcareParentVisual trait and methods. * * access the trait methods of the XmQTcontainer trait. * See the "OSF/Motif Widget Writer's Guide" for more details. * ******************************************************************************/ /* Include appropriate header files. */ #include <Exm/SimpleP.h> /* private header file for the ExmSimple widget */ #include <Xm/DrawP.h> /* header file for Xme drawing functions */ #include <Xm/RepType.h> /* header file for representation type facility */ #include <Xm/Screen.h> /* header file for screen information */ #include <Xm/TraitP.h> /* header file for installing traits */ #include <Xm/CareVisualT.h> /* header file for XmQTcareParentVisual trait */ #include <Xm/ContItemT.h> /* header file for XmQTcontainerItem trait */ #include <Xm/ContainerT.h> /* header file for XmQTcontainer trait */ /* The following section defines constants for the widget. The IDEAL_SHAPE_SIZE constant defines the starting preferred width and height for the widget visual (which is either a rectangle or an oval). */ static XmConst int IDEAL_SHAPE_SIZE = 30; static XmConst int FIND_NATURAL_SIZE = 0; /* Declare all static functions. */ static void ClassInitialize(void); static void ClassPartInitialize ( WidgetClass widgetClass ); static void Initialize( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void Destroy ( Widget w); static void Realize( Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ); static void Resize ( Widget w); static void Redisplay ( Widget w, XEvent *event, Region region); static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args); static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply); static void DrawVisual ( Widget w); static void DrawShadow ( Widget w); static void CreateGC ( Widget w); static void DestroyGC ( Widget w); static GC SelectGC ( Widget w); static void CalcVisualSize ( Widget w); static void CalcWidgetSize ( Widget w); static Boolean WidgetDisplayRect( Widget w, XRectangle *displayrect); static void Reconfigure ( WidgetClass class, Widget new_w, Widget old_w); static void ContItemSetValues(Widget w, XmContainerItemData contItemData); static void ContItemGetValues(Widget w, XmContainerItemData contItemData); static Boolean HandleRedraw (Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag); static void SetSelectedVisual (Widget wid) ; /* Define the resources for the ExmSimple widget. This widget supports three new resources: ExmNsimpleShape, XmNmarginWidth, and XmNmarginHeight. Naturally, ExmSimple also supports the resources of its two superclasses: Core and XmPrimitive. */ static XtResource resources[] = { { ExmNsimpleShape, /* resource name */ ExmCSimpleShape, /* resource class */ ExmRSimpleShape, /* resource data type */ sizeof (unsigned char), /* all representation types have this size */ XtOffsetOf( ExmSimpleRec, simple.simple_shape), /* offset */ XmRImmediate, /* default value appears on next line */ (XtPointer)ExmSHAPE_OVAL /* default shape is oval */ }, { XmNmarginWidth, XmCMarginWidth, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( ExmSimpleRec, simple.margin_width), XmRImmediate, (XtPointer) 4 }, { XmNmarginHeight, XmCMarginHeight, XmRVerticalDimension, sizeof (Dimension), XtOffsetOf( ExmSimpleRec, simple.margin_height), XmRImmediate, (XtPointer) 4 }, }; /* Two of the three resources will also be handled as synthetic resources. */ static XmSyntheticResource syn_resources[] = { { XmNmarginWidth, sizeof (Dimension), XtOffsetOf( ExmSimpleRec, simple.margin_width), XmeFromHorizontalPixels, XmeToHorizontalPixels }, { XmNmarginHeight, sizeof (Dimension), XtOffsetOf( ExmSimpleRec, simple.margin_height), XmeFromVerticalPixels, XmeToVerticalPixels }, }; /* Define the widget class record. See Chapter 3 of the "OSF/Motif Widget Writer's Guide" for details. */ /* Here is the XmPrimitive class extension record. */ static XmPrimitiveClassExtRec primClassExtRec = { /* next_extension */ NULL, /* record_type */ NULLQUARK, /* version */ XmPrimitiveClassExtVersion, /* record_size */ sizeof(XmPrimitiveClassExtRec), /* widget_baseline */ NULL, /* widget_display_rect */ WidgetDisplayRect, /* widget_margins */ NULL, }; externaldef (exmsimpleclassrec) ExmSimpleClassRec exmSimpleClassRec = { { /* Here is the core class record. */ /* superclass */ (WidgetClass)&xmPrimitiveClassRec, /* class_name */ "ExmSimple", /* widget_size */ sizeof(ExmSimpleRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ Realize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ Redisplay, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ QueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* Here is the XmPrimitive class record. */ /* border_highlight */ XmInheritBorderHighlight, /* border_unhighlight */ XmInheritBorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ NULL, /* syn_resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* extension */ (XtPointer)&primClassExtRec, }, { /* Here is the ExmSimple class record. */ /* draw_visual */ DrawVisual, /* draw_shadow */ DrawShadow, /* create_gc */ CreateGC, /* destroy_gc */ DestroyGC, /* select_gc */ SelectGC, /* calc_visual_size */ CalcVisualSize, /* calc_widget_size */ CalcWidgetSize, /* reconfigure */ Reconfigure, /* extension */ NULL, } }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef( exmsimplewidgetclass) WidgetClass exmSimpleWidgetClass = (WidgetClass) &exmSimpleClassRec; /* Declare trait record variables. */ /* Declare a trait record variable for the XmQTcontainerItem trait. */ static XmConst XmContainerItemTraitRec simpleCIT = { 0, /* version */ ContItemSetValues, ContItemGetValues, }; /* Declare a trait record variable for the XmQTcareParentVisual trait. */ static XmConst XmCareVisualTraitRec simpleCVT = { 0, /* version */ HandleRedraw, }; /* Declare any global static variables. */ /* The SimpleShapeNames variable holds some normalized values. The XmRepTypeRegister function will use these values to determine the legal values for a given representation type. */ static String SimpleShapeNames[] = { "simple_oval", "simple_rectangle" }; static XmRepTypeId simpleShapeId; /****************************************************************************** * * ClassInitialize: * Called the first time a widget of this class is instantiated. * *****************************************************************************/ static void ClassInitialize( void ) { /* The ExmNsimpleShape resource requires a value of data type ExmRSimpleShape. Since this is not a standard Motif data type, we must create this data type just for the ExmSimple widget. We want ExmRSimpleShape to hold an enumerated value, either XmSIMPLE_OVAL or XmSIMPLE_RECTANGLE. The best way to accomplish this is to register the new data type with representation type facility. */ simpleShapeId = XmRepTypeRegister (ExmRSimpleShape, SimpleShapeNames, NULL, XtNumber(SimpleShapeNames)); } /****************************************************************************** * * ClassPartInitialize: * Called when this widget or a subclass of this widget is instantiated. * *****************************************************************************/ static void ClassPartInitialize ( WidgetClass widgetClass ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)widgetClass; ExmSimpleWidgetClass sc = (ExmSimpleWidgetClass) wc->core_class.superclass; /* The following code allows subclasses of ExmSimple to inherit certain methods of ExmSimple. */ if (wc->simple_class.draw_visual == ExmInheritDrawVisual) wc->simple_class.draw_visual = sc->simple_class.draw_visual; if (wc->simple_class.draw_shadow == ExmInheritDrawShadow) wc->simple_class.draw_shadow = sc->simple_class.draw_shadow; if (wc->simple_class.create_gc == ExmInheritCreateGC) wc->simple_class.create_gc = sc->simple_class.create_gc; if (wc->simple_class.destroy_gc == ExmInheritDestroyGC) wc->simple_class.destroy_gc = sc->simple_class.destroy_gc; if (wc->simple_class.select_gc == ExmInheritSelectGC) wc->simple_class.select_gc = sc->simple_class.select_gc; if (wc->simple_class.calc_visual_size == ExmInheritCalcVisualSize) wc->simple_class.calc_visual_size = sc->simple_class.calc_visual_size; if (wc->simple_class.calc_widget_size == ExmInheritCalcWidgetSize) wc->simple_class.calc_widget_size = sc->simple_class.calc_widget_size; if (wc->simple_class.reconfigure == ExmInheritReconfigure) wc->simple_class.reconfigure = sc->simple_class.reconfigure; /* Install the containerItem trait on ExmSimple and all its subclasses. */ XmeTraitSet((XtPointer) wc, XmQTcontainerItem, (XtPointer) &simpleCIT); /* Install the careParentVisual trait on ExmSimple and all subclasses. */ XmeTraitSet((XtPointer) wc, XmQTcareParentVisual, (XtPointer) &simpleCVT); } /****************************************************************************** * * Initialize: * Called by the Intrinsics when this widget is instantiated. * *****************************************************************************/ static void Initialize( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(new_w); ExmSimpleWidget rw = (ExmSimpleWidget)request_w; ExmSimpleWidget nw = (ExmSimpleWidget)new_w; /* Look at the value assigned to the ExmNsimpleShape resource. If the value assigned is neither ExmSHAPE_OVAL nor ExmSHAPE_RECTANGLE, then issue a warning message and set ExmNsimpleShape to ExmSHAPE_OVAL. */ if (!XmRepTypeValidValue (simpleShapeId, nw->simple.simple_shape, (Widget)nw)) nw->simple.simple_shape = ExmSHAPE_OVAL; /* Call a function that creates the GC's needed by the widget. */ if (wc->simple_class.create_gc) (*(wc->simple_class.create_gc))((Widget)nw); /* If the widget's width is set to 0, that's a trigger for the widget to calculate its width. We are not actually going to calculate its width here, rather we are going to set the need_to_compute_width flag appropriately. */ if (rw->core.width == FIND_NATURAL_SIZE) { nw->simple.need_to_compute_width = True; } else { nw->simple.need_to_compute_width = False; nw->simple.pref_width = rw->core.width; nw->core.width = rw->core.width; } if (rw->core.height == FIND_NATURAL_SIZE) nw->simple.need_to_compute_height = True; else { nw->simple.need_to_compute_height = False; nw->simple.pref_height = rw->core.height; nw->core.height = rw->core.height; } /* mark us as not selected to start with */ nw->simple.saved_foreground = XmUNSPECIFIED_PIXEL ; /* In order not to resize the widget at each level of the Initialize chain, the actual class is passed to this method */ if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmSimpleWidgetClass, new_w, NULL); } /****************************************************************************** * * Destroy: * Called by the Intrinsics whenever this widget is deallocated. * *****************************************************************************/ static void Destroy (Widget w) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass) XtClass(w); /* The ExmSimple widget allocates two internal GC's. In order to prevent memory leaks, we must destroy these GC's. */ if (wc->simple_class.destroy_gc) (*(wc->simple_class.destroy_gc))(w); } /***************************************************************************** * * Realize * Called by the Intrinsics to create the window for the widget. This * class's realize method creates a propagating window for this * exact class, but uses the default window otherwise * *****************************************************************************/ static void Realize(Widget w, XtValueMask *p_valueMask, XSetWindowAttributes *attributes ) { Mask valueMask = *p_valueMask; /* First call Primitive's method */ xmPrimitiveClassRec.core_class.realize(w, p_valueMask, attributes); /* ExmSimple wants to propagate all unused events to its hierarchy, which Primitive.Realize doesn't do. So if this is an ExmSimple widget, we fix the do_not_propagate window attribute */ if (XtClass(w) == exmSimpleWidgetClass) { Mask adjustMask; XSetWindowAttributes xswa; adjustMask = CWDontPropagate; xswa.do_not_propagate_mask = NoEventMask; XChangeWindowAttributes(XtDisplay(w), XtWindow(w), adjustMask, &xswa); } } /****************************************************************************** * * Resize: * Called by the Intrinsics whenever a parent resizes a child. * Also called by the Reconfigure method. * *****************************************************************************/ static void Resize ( Widget w ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(w); ExmSimpleWidget sw = (ExmSimpleWidget)w; Dimension mw, mh; Dimension window_decoration_thickness; Dimension total_target_widget_width, total_target_widget_height; /* Call CalcVisualSize */ if (wc->simple_class.calc_visual_size) (*(wc->simple_class.calc_visual_size))((Widget)sw); window_decoration_thickness = sw->primitive.highlight_thickness + sw->primitive.shadow_thickness; mw = window_decoration_thickness + sw->simple.margin_width; total_target_widget_width = (2 * mw) + sw->simple.visual.width; /* When there is not enough space to display the entire widget, we must clip part of the widget, but which part? */ if (sw->core.width >= total_target_widget_width) { /* We have enough space to display everything (the visual, the margins, and the border decorations). */ sw->simple.visual.x = mw; sw->simple.visual.width = sw->core.width - (2 * mw); } else if (sw->core.width > ((2 * window_decoration_thickness) + sw->simple.visual.width)) { /* We do not have enough space to display everything, but we do have enough space to display the visual and the border decorations. The left and right margins will have to be reduced. */ sw->simple.visual.x = (sw->core.width - sw->simple.visual.width)/2; } else if (sw->core.width > 2 * window_decoration_thickness) { /* Space is very tight. We will eliminate the left and right margins all together. Furthermore, we will reduce the size of the visual. */ sw->simple.visual.x = window_decoration_thickness; sw->simple.visual.width = sw->core.width - (2 * window_decoration_thickness); } else { /* We do not have enough space to display even one pixel of the visual. */ sw->simple.visual.width = 0; } /* Now do the same for the vertical dimension. */ mh = window_decoration_thickness + sw->simple.margin_height; total_target_widget_height = (2 * mh) + sw->simple.visual.height; if (sw->core.height >= total_target_widget_height) { /* We have enough space to display everything (the visual, the margins, and the border decorations). */ sw->simple.visual.y = mh; sw->simple.visual.height = sw->core.height - (2 * mh); } else if (sw->core.height > ((2 * window_decoration_thickness) + sw->simple.visual.height)) { /* We do not have enough space to display everything, but we do have enough space to display the visual and the border decorations. The top and bottom margins will have to be reduced. */ sw->simple.visual.y = (sw->core.height - sw->simple.visual.height)/2; } else if (sw->core.height > 2 * window_decoration_thickness) { /* Space is very tight. We will eliminate the top and right margins all together. Furthermore, we will reduce the size of the visual. */ sw->simple.visual.y = window_decoration_thickness; sw->simple.visual.height = sw->core.height - (2 * window_decoration_thickness); } else { /* We do not have enough space to display even one pixel of the visual. */ sw->simple.visual.height = 0; } } /****************************************************************************** * * Redisplay: * Called by the Intrinsics whenever a portion of the widget that was * obscured becomes exposed. * *****************************************************************************/ static void Redisplay ( Widget w, XEvent *event, Region region ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(w); /* Call the function that draws the widget visual. */ if (wc->simple_class.draw_visual) (*wc->simple_class.draw_visual) (w); /* Call the function that draws the widget shadow. */ if (wc->simple_class.draw_shadow) (*wc->simple_class.draw_shadow) (w); /* Envelop our superclass expose method. The superclass expose method of XmPrimitive knows how to draw the border highlight. */ (*(xmPrimitiveClassRec.core_class.expose))(w, event, region); } /****************************************************************************** * * SetValues: * Called by the Intrinsics when an application attempts to * change the value of a resource. * *****************************************************************************/ static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(new_w); ExmSimpleWidget cw = (ExmSimpleWidget)old_w; ExmSimpleWidget rw = (ExmSimpleWidget)request_w; ExmSimpleWidget nw = (ExmSimpleWidget)new_w; Boolean redisplayFlag = False; /* Validate the value of ExmNsimpleShape by calling XmRepTypeValidValue. */ if (nw->simple.simple_shape != cw->simple.simple_shape) { if (!XmRepTypeValidValue (simpleShapeId, nw->simple.simple_shape, (Widget)nw)) nw->simple.simple_shape = cw->simple.simple_shape; else redisplayFlag = True; } /* Redisplay on change in sensitivity */ if (XtIsSensitive(new_w) != XtIsSensitive(old_w)) redisplayFlag = True; /* If the widget's foreground or background color changes, then we must update the GC. */ if (nw->primitive.foreground != cw->primitive.foreground || nw->core.background_pixel != cw->core.background_pixel) { if (wc->simple_class.destroy_gc) (*(wc->simple_class.destroy_gc))((Widget)cw); if (wc->simple_class.create_gc) (*(wc->simple_class.create_gc))((Widget)nw); redisplayFlag = True; } /* Check for application geometry settings. '0' means 'ideal size' */ if (rw->core.width == FIND_NATURAL_SIZE) { nw->core.width = FIND_NATURAL_SIZE; nw->simple.need_to_compute_width = True; } else if (rw->core.width != cw->core.width) { nw->core.width = rw->core.width; nw->simple.pref_width = rw->core.width; nw->simple.need_to_compute_width = False; } if (rw->core.height == FIND_NATURAL_SIZE) { nw->core.height = FIND_NATURAL_SIZE; nw->simple.need_to_compute_height = True; } else if (rw->core.height != cw->core.height) { nw->core.height = rw->core.height; nw->simple.pref_height = rw->core.height; nw->simple.need_to_compute_height = False; } /* Check for any changes in total widget set, margin size, or window decoration size. If any are found, call Reconfigure. */ nw->simple.need_to_reconfigure = False; if (nw->core.width != cw->core.width || nw->core.height != cw->core.height || nw->simple.margin_width != cw->simple.margin_width || nw->simple.margin_height != cw->simple.margin_height || nw->primitive.shadow_thickness != cw->primitive.shadow_thickness || nw->primitive.highlight_thickness != cw->primitive.highlight_thickness ) Reconfigure (exmSimpleWidgetClass, new_w, old_w); return (redisplayFlag); } /****************************************************************************** * * QueryGeometry: * Called by the Intrinsics in response to a proposed changed in geometry. * *****************************************************************************/ static XtGeometryResult QueryGeometry ( Widget widget, XtWidgetGeometry *parent_request, XtWidgetGeometry *child_reply ) { ExmSimpleWidget sw = (ExmSimpleWidget) widget; if (!XtIsRealized(widget)) { /* Simple has not yet been realized. */ child_reply->width = XtWidth(widget); /* might be 0 */ child_reply->height = XtHeight(widget); /* might be 0 */ } else { /* Simple has been realized. */ child_reply->width = sw->simple.pref_width; child_reply->height = sw->simple.pref_height; } /* Return Simple's preferred size */ return XmeReplyToQueryGeometry(widget, parent_request, child_reply); } /****************************************************************************** * * DrawVisual: * Called by ExmSimple whenever it needs to draw or redraw the * widget visual (either an oval or a rectangle). * *****************************************************************************/ static void DrawVisual ( Widget w ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(w); ExmSimpleWidget sw = (ExmSimpleWidget)w; /* Draw the oval or the rectangle, space permitting. */ if (sw->simple.visual.width > 0 && sw->simple.visual.height > 0) { switch (sw->simple.simple_shape) { case(ExmSHAPE_OVAL): default: XFillArc (XtDisplay(w), XtWindow(w), wc->simple_class.select_gc(w), sw->simple.visual.x, sw->simple.visual.y, sw->simple.visual.width, sw->simple.visual.height, 0, 360 * 64); break; case(ExmSHAPE_RECTANGLE): XFillRectangle (XtDisplay(w), XtWindow(w), wc->simple_class.select_gc(w), sw->simple.visual.x, sw->simple.visual.y, sw->simple.visual.width, sw->simple.visual.height); break; } } } /****************************************************************************** * * DrawShadow: * Called by Redisplay. * *****************************************************************************/ static void DrawShadow ( Widget w ) { ExmSimpleWidget sw = (ExmSimpleWidget)w; /* If there is enough room in the widget to draw a shadow, and if the shadow thickness resource is nonzero, then draw a Motif-style shadow in the appropriate place around the widget's border. */ if (sw->core.width > (2 * sw->primitive.highlight_thickness) && sw->core.height > (2 * sw->primitive.highlight_thickness) && sw->primitive.shadow_thickness > 0) XmeDrawShadows (XtDisplay (sw), XtWindow (sw), sw->primitive.top_shadow_GC, sw->primitive.bottom_shadow_GC, sw->primitive.highlight_thickness, sw->primitive.highlight_thickness, sw->core.width - (2 * sw->primitive.highlight_thickness), sw->core.height - (2 * sw->primitive.highlight_thickness), sw->primitive.shadow_thickness, XmSHADOW_ETCHED_OUT); } /****************************************************************************** * * CreateGC: * Called by Initialize and by SetValues. * *****************************************************************************/ static void CreateGC ( Widget w ) { ExmSimpleWidget sw = (ExmSimpleWidget)w; XGCValues values; XtGCMask valueMask; Arg args[2]; Pixmap insensitiveStippleBitmap; /* This function creates two GC's: one to render a sensitive widget and the other to render an insensitive widget. */ /* First, create the sensitive GC (named normal_GC). */ valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = sw->primitive.foreground; values.background = sw->core.background_pixel; values.graphics_exposures = False; sw->simple.normal_gc = XtGetGC ((Widget)sw, valueMask, &values); /* Next, create the insensitive GC. This GC will share the same foreground, background, and graphics exposures as the sensitive GC, but will hold a different fill style and stipple pattern. The stipple pattern is stored in the XmNinsensitiveStippleBitmap resource of XmScreen. */ valueMask |= GCFillStyle | GCStipple; values.fill_style = FillStippled; /* Gather the Motif-appropriate insensitive stipple bitmap. */ XtSetArg(args[0], XmNinsensitiveStippleBitmap, &insensitiveStippleBitmap); XtGetValues(XmGetXmScreen(XtScreen(w)), args, 1); values.stipple = insensitiveStippleBitmap; sw->simple.insensitive_gc = XtGetGC((Widget)sw, valueMask, &values); } /****************************************************************************** * * DestroyGC: * Called by the Destroy method. * *****************************************************************************/ static void DestroyGC ( Widget w ) { ExmSimpleWidget sw = (ExmSimpleWidget)w; /* Deallocate the resources used by the two GC's. */ XtReleaseGC ((Widget)sw, sw->simple.normal_gc); XtReleaseGC ((Widget)sw, sw->simple.insensitive_gc); } /****************************************************************************** * * SelectGC: * Called by DrawVisual. * *****************************************************************************/ static GC SelectGC ( Widget w ) { ExmSimpleWidget sw = (ExmSimpleWidget)w; GC drawGC; /* Select between the normal (sensitive) GC and the insensitive GC. */ drawGC = XtIsSensitive(w) ? sw->simple.normal_gc : sw->simple.insensitive_gc; return (drawGC); } /****************************************************************************** * * CalcVisualSize: * Called by CalcWidgetSize. * *****************************************************************************/ static void CalcVisualSize ( Widget w ) { ExmSimpleWidget sw = (ExmSimpleWidget)w; /* Calculate the ideal size of class's visual */ sw->simple.visual.width = IDEAL_SHAPE_SIZE; sw->simple.visual.height = IDEAL_SHAPE_SIZE; } /****************************************************************************** * * CalcWidgetSize: * Called by Reconfigure * *****************************************************************************/ static void CalcWidgetSize( Widget w ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)XtClass(w); ExmSimpleWidget sw = (ExmSimpleWidget)w; /* Call CalcVisualSize */ if (wc->simple_class.calc_visual_size) (*(wc->simple_class.calc_visual_size))((Widget)sw); /* Compute the widget's width if asked to. Otherwise, set the widget's width to the preferred width. */ if (sw->simple.need_to_compute_width == True) sw->core.width = sw->simple.visual.width + (2 * (sw->simple.margin_width + sw->primitive.shadow_thickness + sw->primitive.highlight_thickness)); else sw->core.width = sw->simple.pref_width; /* Compute the widget's height if asked to. Otherwise, set the widget's height to the preferred height. */ if (sw->simple.need_to_compute_height == True) sw->core.height = sw->simple.visual.height + (2 * (sw->simple.margin_height + sw->primitive.shadow_thickness + sw->primitive.highlight_thickness)); else sw->core.height = sw->simple.pref_height; } /****************************************************************************** * * WidgetDisplayRect: * Called by several Motif managers to determine how to align the visuals * drawn by primitives. In addition, an application can access this * method by calling XmWidgetGetDisplayRect. * *****************************************************************************/ static Boolean WidgetDisplayRect( Widget w, XRectangle *displayrect ) { ExmSimpleWidget my_widget = (ExmSimpleWidget) w; if ((my_widget->simple.visual.width > 0) && (my_widget->simple.visual.height > 0)) { /* The widget is currently displaying a visual. Write the dimensions of the visual's bounding box into displayrect. */ displayrect->x = my_widget->simple.visual.x; displayrect->y = my_widget->simple.visual.y; displayrect->width = my_widget->simple.visual.width; displayrect->height = my_widget->simple.visual.height; return True; /* Yes, this widget contains something displayable. */ } else { /* The widget is not currently displaying a visual. */ return False; } } /****************************************************************************** * * Reconfigure: * Called by the Initialize and SetValues methods. * *****************************************************************************/ static void Reconfigure ( WidgetClass class, Widget new_w, Widget old_w ) { ExmSimpleWidgetClass wc = (ExmSimpleWidgetClass)class; ExmSimpleWidget nw = (ExmSimpleWidget)new_w; ExmSimpleWidget cw = (ExmSimpleWidget)old_w; /* If Reconfigure is called from a leaf chained method, the following code calls CalcWidgetSize. If Reconfigure is not called from a leaf chained method, wait until the final leaf method is called. (That is because the subclass CalcWidgetSize method may need information derived in its SetValues method.) */ /* The Reconfigure method can only reconfigure an ExmSimple widget or an ExmSimple subclass. */ if (!ExmIsSimple((Widget)nw)) return; if (class == XtClass(nw)) { if (wc->simple_class.calc_widget_size) (*(wc->simple_class.calc_widget_size))((Widget)nw); nw->simple.pref_width = nw->core.width; nw->simple.pref_height = nw->core.height; if (cw == NULL || (nw->core.width == cw->core.width && nw->core.height == cw->core.height) ) { if (wc->core_class.resize) (*(wc->core_class.resize))((Widget)nw); } } else nw->simple.need_to_reconfigure = True; } /******--*********************** Trait Methods ****************--***********/ /****************************************************************************** * * ContItemSetValues * This is a trait method of the XmQTcontainterItem trait. * *****************************************************************************/ static void ContItemSetValues(Widget w, XmContainerItemData contItemData) { ExmSimpleWidget sw = (ExmSimpleWidget)w; /* A Container widget calls this trait method to set new visual attributes on ExmSimple. */ if (contItemData->valueMask & ContItemViewType) { /* We will treat SMALL_ICON as one shape (oval) and LARGE_ICON as a different shape (rectangle). */ if (contItemData->view_type == XmSMALL_ICON) XtVaSetValues(w, ExmNsimpleShape, ExmSHAPE_OVAL, NULL); else XtVaSetValues(w, ExmNsimpleShape, ExmSHAPE_RECTANGLE, NULL); } if (contItemData->valueMask & ContItemVisualEmphasis) { if (contItemData->visual_emphasis == XmSELECTED) { /* ok, we are forced selected, so save current foreground and then fetch the new select color and set it */ /* only save the foreground the first time thru */ if (sw->simple.saved_foreground == XmUNSPECIFIED_PIXEL) sw->simple.saved_foreground = sw->primitive.foreground ; SetSelectedVisual (w) ; } else { /* put back our old foreground and forget saved_foreground. The assumption is that the app will not set the foreground during the time the widget is selected. */ XtVaSetValues(w, XmNforeground, sw->simple.saved_foreground, NULL); sw->simple.saved_foreground = XmUNSPECIFIED_PIXEL ; } } } /****************************************************************************** * * ContItemGetValues * This is a trait method of the XmQTcontainterItem trait. * *****************************************************************************/ static void ContItemGetValues(Widget w, XmContainerItemData contItemData) { ExmSimpleWidget sw = (ExmSimpleWidget)w; if (contItemData->valueMask & ContItemViewType) { if (sw->simple.simple_shape == ExmSHAPE_OVAL) contItemData->view_type = XmSMALL_ICON; else contItemData->view_type = XmLARGE_ICON; } if (contItemData->valueMask & ContItemVisualEmphasis) { /* we know awe are in a selected state if our foreground is currently saved */ if (sw->simple.saved_foreground == XmUNSPECIFIED_PIXEL) contItemData->visual_emphasis = XmNOT_SELECTED; else contItemData->visual_emphasis = XmSELECTED; } if (contItemData->valueMask & ContItemIconWidth) { contItemData->icon_width = sw->core.width - sw->core.x; } if (contItemData->valueMask & ContItemDetailCount) { contItemData->detail_count = 0; } } /****************************************************************************** * * SetSelectedVisual * Get the select color of the parent and set our foreground * *****************************************************************************/ static void SetSelectedVisual ( Widget wid) { /* our parent is notifying us that its select color has changed so let's try to get the new value using the Container trait getValue method and then change our foreground - somehow, there is the assumption that if this method gets called with SelectColor on, then it must be a Container, which is ok in 2.0 */ XmContainerDataRec container_data ; XmContainerTrait container_trait ; Pixel select_color = XmUNSPECIFIED_PIXEL; ExmSimpleWidget sw = (ExmSimpleWidget)wid; /* get the container trait record */ container_trait = (XmContainerTrait) XmeTraitGet((XtPointer) XtClass(XtParent(wid)), XmQTcontainer) ; if (container_trait) { /* get the container information */ container_data.valueMask = ContSelectColor ; container_trait->getValues(XtParent(wid), &container_data); if (container_data.valueMask & ContSelectColor) { /* if the Container uses reverse ground, convert that to using black pixel */ if (container_data.select_color == XmREVERSED_GROUND_COLORS) select_color = BlackPixelOfScreen(XtScreen(wid)); else select_color = container_data.select_color; } } /* only set the foreground of the one selected */ if ((select_color != XmUNSPECIFIED_PIXEL) && (sw->simple.saved_foreground != XmUNSPECIFIED_PIXEL)) XtVaSetValues(wid, XmNforeground, select_color, NULL) ; } /****************************************************************************** * * HandleRedraw * This is a trait method of the XmQTcareParentVisual trait. * *****************************************************************************/ static Boolean HandleRedraw ( Widget kid, Widget cur_parent, Widget new_parent, Mask visual_flag) { Boolean redraw = False; XmCareVisualTrait care_visual ; if (visual_flag & VisualSelectColor) { SetSelectedVisual (kid) ; /* no need to set redraw to True since SetSelectedVisual calls XtSetValues which already re-exposes when foreground changes */ } /* at this point we need to envelop our superclass trait method since we are overiding it but we still want its job to be done */ care_visual = (XmCareVisualTrait) XmeTraitGet(xmPrimitiveWidgetClass, XmQTcareParentVisual) ; /* care_visual never NULL on Primitive ! */ redraw |= care_visual->redraw(kid, cur_parent, new_parent, visual_flag) ; return redraw ; } /****************************************************************************** * * ExmCreateSimple: * Called by an application. * *****************************************************************************/ Widget ExmCreateSimple ( Widget parent, char *name, Arg *arglist, Cardinal argCount ) { /* Convenience function to instantiate an ExmSimple widget. */ return (XtCreateWidget (name, exmSimpleWidgetClass, parent, arglist, argCount)); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/CommandB.h����������������������������������������������������������������0000644�0001750�0001750�00000004601�12672140200�014015� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: CommandB.h /main/5 1995/07/15 20:40:27 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * CommandB.h: The widget public header file for the ExmCommandButton * demonstration widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmCommandB_h #define _ExmCommandB_h /* Include appropriate files. */ #include <Exm/ExmString.h> /* public header file for the ExmString widget */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class and widget record. */ externalref WidgetClass exmCommandButtonWidgetClass; typedef struct _ExmCommandButtonClassRec *ExmCommandButtonWidgetClass; typedef struct _ExmCommandButtonRec *ExmCommandButtonWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsCommandButton #define ExmIsCommandButton(w) XtIsSubclass(w, exmCommandButtonWidgetClass) #endif /* Specify the API for this widget. */ extern Widget ExmCreateCommandButton(Widget parent, char *name, Arg *arglist, Cardinal argCount); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmCommandB_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ �������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/ExmMrm.h������������������������������������������������������������������0000644�0001750�0001750�00000002214�12672140200�013540� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: ExmMrm.h /main/5 1995/07/15 20:40:40 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /********************************************************************** * * ExmMrm.h * *********************************************************************/ int ExmMrmInitialize(void); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/wml/����������������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�013041� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/wml/Makefile.in�����������������������������������������������������������0000644�0001750�0001750�00000051167�13211512765�015052� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = wmldbcreate$(EXEEXT) subdir = demos/lib/Exm/wml ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) wmldbcreate_SOURCES = wmldbcreate.c wmldbcreate_OBJECTS = wmldbcreate.$(OBJEXT) wmldbcreate_LDADD = $(LDADD) wmldbcreate_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = wmldbcreate.c DIST_SOURCES = wmldbcreate.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = Exm.wml CLEANFILES = Exm.wmd $(REPORT) $(WMLTARGETS) tokens.dat wml-uil.mm AM_YFLAGS = -d WMLDIR = $(top_srcdir)/tools/wml INCLUDES = -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(srcdir)/../.. \ -I$(top_srcdir)/tools/wml \ -I$(top_builddir)/tools/wml \ -I$(top_builddir)/clients/uil \ ${X_CFLAGS} LDADD = $(top_builddir)/lib/Xm/libXm.la DISTCLEANFILES = motif.wmd WMDTABLE = Exm.wmd # INCLUDES = -I. -I$(INCLUDESRC) -I$(MINCLUDESRC) -I$(MLIBSRC) -I../../. -I$(MTOP)/include # DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB) # LOCAL_LIBRARIES = XmClientLibs # # WMLDIR = $(MTOP)/tools/wml TABLE = Exm.wml # WMDTABLE = Exm.wmd # WMLTOOLS = $(WMLDIR)/wml $(WMLDIR)/wmluiltok REPORT = wml.report UILY = $(WMLDIR)/Uil.y YACCTARGETS = UilLexPars.c UilLexPars.h WMLTARGETS = UilConst.h UilKeyTab.h \ UilSymArTa.h UilSymArTy.h UilSymCSet.h UilSymCtl.h \ UilSymEnum.h UilSymGen.h UilSymNam.h UilSymRArg.h \ UilSymReas.h UilTokName.h UilUrmClas.h UilSymChCl.h \ UilSymChTa.h TARGETS = $(YACCTARGETS) $(WMLTARGETS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/lib/Exm/wml/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/lib/Exm/wml/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list wmldbcreate$(EXEEXT): $(wmldbcreate_OBJECTS) $(wmldbcreate_DEPENDENCIES) $(EXTRA_wmldbcreate_DEPENDENCIES) @rm -f wmldbcreate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wmldbcreate_OBJECTS) $(wmldbcreate_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmldbcreate.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile all: Exm.wmd $(WMDTABLE): wmldbcreate $(TARGETS) ./wmldbcreate -o $@ # # SRCS = wmldbcreate.c # # NormalLibraryObjectRule() # # all:: includes $(WMDTABLE) # # install:: all # UilLexPars.c UilLexPars.h: $(UILY) $(TARGETS): $(TABLE) $(WMLDIR)/motif.wml $(RM) $(TARGETS) $(REPORT) wml-uil.mm # $(YACC) -d $(YACCFLAGS) $(UILY) # $(MV) y.tab.c UilLexPars.c # $(MV) y.tab.h UilLexPars.h $(top_builddir)/tools/wml/wmluiltok < $(UILY) > tokens.dat # $(RM) wml-uil.mm $(RM) Exm.h $(LN_S) $(srcdir)/$(TABLE) ./Exm.h $(CPP) -I$(WMLDIR) Exm.h | $(top_builddir)/tools/wml/wml $(RM) Exm.h # $(RM) tokens.dat # # $(WMDTABLE): wmldbcreate # $(CLIENTENVSETUP) ./wmldbcreate -o $@ # # NormalProgramTarget(wmldbcreate,wmldbcreate.o,$(DEPLIBS),$(LOCAL_LIBRARIES),$(SYSLIBS)) # # UilDBDef.h: $(WMLDIR)/UilDBDef.h # rm -f UilDBDef.h # ln -s $(WMLDIR)/UilDBDef.h UilDBDef.h # # clean:: # $(RM) $(TARGETS) $(WMDTABLE) $(REPORT) \ # *.mm *.sdml *.txt tokens.dat *.h wmldbcreate UilLexPars.c *~ # # DependTarget() # # includes:: $(TARGETS) UilDBDef.h .NOTPARALLEL: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/wml/README����������������������������������������������������������������0000644�0001750�0001750�00000000674�12672140200�013651� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:59:54 drk $ */ The Exm.wml file in this directory includes all the supported exm widgets provided in the release. This file and the Imakefile also demonstrate how a user can define their own widgets and put them into wml for use with uil. Note that this directory also contains a modified copy of wmldbcreate.c which is necessary for the creation of the wml output file (.wmd) for use with uil. ��������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/wml/wmldbcreate.c���������������������������������������������������������0000644�0001750�0001750�00000042577�13145162623�015447� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: wmldbcreate.c /main/7 1997/04/15 10:20:28 dbl $" #endif #endif /* * This is the program creates binary databases from WML output. */ #include <stdio.h> #include <Mrm/MrmWidget.h> #include <Xm/Xm.h> #include <Xm/MwmUtil.h> #include <Dt/Editor.h> #include <Dt/Help.h> #include <Dt/HelpDialog.h> #include <Dt/HelpQuickD.h> #include <Dt/MenuButton.h> #include <Dt/Print.h> #include <Dt/TermPrim.h> #include <Dt/Term.h> /* * User supplied widget public.h and/or private.h files are to be added here * #ifdef for automatic use in uilwmdcreate script file */ #include <Exm/Simple.h> #include <Exm/ExmString.h> #include <Exm/StringTrans.h> #include <Exm/CommandB.h> #include <Exm/MenuB.h> #include <Exm/Panner.h> #include <Exm/Grid.h> #include <Exm/TabB.h> /* * End of User supplied widget files */ #include "UilDBDef.h" #include "UilLexPars.h" #include "UilSymGen.h" /* from WML */ #include "UilSymArTy.h" /* from WML */ #include "UilSymRArg.h" /* from WML */ #include "UilSymArTa.h" /* from WML */ #include "UilSymReas.h" /* from WML */ #include "UilSymCtl.h" /* from WML */ #include "UilConst.h" /* from WML */ #include "UilSymNam.h" /* from WML */ #include "UilSymEnum.h" /* from WML */ #include "UilSymCSet.h" /* from WML */ #include "UilUrmClas.h" /* from WML */ #include "UilKeyTab.h" /* from WML */ #include "UilSymChCl.h" /* from WML */ #include "UilSymChTa.h" /* from WML */ void emit_globals(void); void emit_header(_db_header_ptr header); void emit_chars( int table_id); void emit_ints_and_string( int table_id); void emit_char_table( int table_id); void emit_length_and_string( int table_id); void emit_shorts( int table_id); void emit_int_and_table_shorts( int table_id); void emit_ints( int table_id); FILE *bfile, *afile; int DEBUG=FALSE; char outfilename[80]; char debugfilename[80]; int main(argc, argv) int argc; char **argv; { _db_header header; strcpy(outfilename, "motif.wmd"); strcpy(debugfilename, "motif.dbg"); for (argc--, argv++; argc; argc--, argv++) { if (strcmp("-debug", *argv) == 0) { DEBUG=TRUE; } else if ((strcmp("-o", *argv) == 0)) { strcpy(outfilename, argv[1]); } } bfile = fopen(outfilename, "w"); if (bfile == (FILE *) NULL) { printf("\nCouldnt't open %s", outfilename); exit (1); } if (DEBUG) { afile = fopen(debugfilename, "w"); if (afile == (FILE *) NULL) { printf("\nCouldn't open %s", debugfilename); exit (1); } } emit_globals(); /* * UilConst * UilSymArty * UilSymCset - parts of it * UilSymChCl */ emit_chars(Constraint_Tab); emit_chars(Argument_Type_Table_Value); emit_chars(Charset_Wrdirection_Table); emit_chars(Charset_Parsdirection_Table); emit_chars(Charset_Charsize_Table); emit_chars(Child_Class_Table); /* * UilKeyTab */ emit_ints_and_string (Key_Table); emit_ints_and_string (Key_Table_Case_Ins); /* * UilSymArTa * UilSymCtl * UilSymReas * UilSymChTa */ emit_char_table (Allowed_Argument_Table); emit_char_table (Allowed_Control_Table); emit_char_table (Allowed_Reason_Table); emit_char_table (Allowed_Child_Table); /* * UilSymCset * UilSymNam * UilUrmClas */ emit_length_and_string (Charset_Xmstring_Names_Table); emit_length_and_string (Charset_Lang_Names_Table); emit_length_and_string (Uil_Widget_Names); emit_length_and_string (Uil_Argument_Names); emit_length_and_string (Uil_Reason_Names); emit_length_and_string (Uil_Enumval_names); emit_length_and_string (Uil_Charset_Names); emit_length_and_string (Uil_Widget_Funcs); emit_length_and_string (Uil_Argument_Toolkit_Names); emit_length_and_string (Uil_Reason_Toolkit_Names); emit_length_and_string (Uil_Children_Names); /* * UilSymCset * UilSymEnum * UilSymRArg * UilUrmClas */ emit_shorts (Charset_Lang_Codes_Table); emit_shorts (Argument_Enum_Set_Table); emit_shorts (Related_Argument_Table); emit_shorts (Uil_Gadget_Funcs); emit_shorts (Uil_Urm_Nondialog_Class); emit_shorts (Uil_Urm_Subtree_Resource); /* * UilSymEnum */ emit_int_and_table_shorts(Enum_Set_Table); /* * UilSymEnum */ emit_ints (Enumval_Values_Table); exit (0); } void emit_globals(void) { _db_globals globals; globals.version = DB_Compiled_Version; globals.uil_max_arg = uil_max_arg; globals.uil_max_charset = uil_max_charset; globals.charset_lang_table_max = charset_lang_table_max; globals.uil_max_object = uil_max_object; globals.uil_max_reason = uil_max_reason; globals.uil_max_enumval = uil_max_enumval; globals.uil_max_enumset = uil_max_enumset; globals.key_k_keyword_count = key_k_keyword_count; globals.key_k_keyword_max_length = key_k_keyword_max_length; globals.uil_max_child = uil_max_child; fwrite (&globals, sizeof (_db_globals), 1, bfile); if (DEBUG) fprintf(afile, "%d %d %d %d %d %d %d %d %d %d ", globals.version, globals.uil_max_arg, globals.uil_max_charset, globals.charset_lang_table_max, globals.uil_max_object, globals.uil_max_reason, globals.uil_max_enumval, globals.uil_max_enumset, globals.key_k_keyword_count, globals.key_k_keyword_max_length); } void emit_header(header) _db_header_ptr header; { fwrite (header, sizeof(_db_header), 1, bfile); if (DEBUG) fprintf(afile, "\n\nTableId=%d, NumEntries=%d, TableSize=%d \n", header->table_id, header->num_items, header->table_size); } void emit_chars(table_id) int table_id; { _db_header header; unsigned char *ptr = NULL; int i; switch (table_id) { case Constraint_Tab: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(constraint_tab_vec); header.num_items = header.table_size; header.table_id = Constraint_Tab; ptr = constraint_tab; break; case Argument_Type_Table_Value: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(argument_type_table_vec); header.num_items = header.table_size; header.table_id = Argument_Type_Table_Value; ptr = argument_type_table; break; case Charset_Wrdirection_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_wrdirection_table_vec); header.num_items = header.table_size; header.table_id = Charset_Wrdirection_Table; ptr = charset_writing_direction_table; break; case Charset_Parsdirection_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_parsdirection_table_vec); header.num_items = header.table_size; header.table_id = Charset_Parsdirection_Table; ptr = charset_parsing_direction_table; break; case Charset_Charsize_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_charsize_table_vec); header.num_items = header.table_size; header.table_id = Charset_Charsize_Table; ptr = charset_character_size_table; break; case Child_Class_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(child_class_table_vec); header.num_items = header.table_size; header.table_id = Child_Class_Table; ptr = child_class_table; break; } emit_header(&header); fwrite (ptr, header.table_size, 1, bfile); if (DEBUG) { for (i=0; i<=header.num_items; i++) { fprintf(afile, "%d ", ptr[i]); } } } void emit_ints_and_string(table_id) int table_id; { _db_header header; key_keytable_entry_type *table = NULL; int i; switch (table_id) { /* * All tables are zero based unless otherwise noted */ case Key_Table: header.table_size = sizeof(key_table_vec); header.num_items = key_k_keyword_count; header.table_id = Key_Table; table = key_table; break; case Key_Table_Case_Ins: header.table_size = sizeof(key_table_case_ins_vec); header.num_items = key_k_keyword_count; header.table_id = Key_Table_Case_Ins; table = key_table_case_ins; break; } emit_header(&header); fwrite (table, header.table_size, 1, bfile); for (i=0; i<header.num_items; i++) { fwrite (table[i].at_name, table[i].b_length + 1, 1, bfile); if (DEBUG) fprintf (afile, "%d %d %d %d %s", table[i].b_class, table[i].b_subclass, table[i].b_length, table[i].b_token, table[i].at_name); } } void emit_char_table(table_id) int table_id; { unsigned char **table = NULL; _db_header header; unsigned char *entry_vec; int i, j; int num_bits = (uil_max_object + 7) / 8; switch (table_id) { /* * All tables are 1 based unless otherwise specified */ case Allowed_Argument_Table: header.table_size = sizeof(allowed_argument_table_vec); header.num_items = uil_max_arg; header.table_id = Allowed_Argument_Table; table = allowed_argument_table; break; case Allowed_Control_Table: header.table_size = sizeof(allowed_control_table_vec); header.num_items = uil_max_object; header.table_id = Allowed_Control_Table; table = allowed_control_table; break; case Allowed_Reason_Table: header.table_size = sizeof(allowed_reason_table_vec); header.num_items = uil_max_reason; header.table_id = Allowed_Reason_Table; table = allowed_reason_table; break; case Allowed_Child_Table: header.table_size = sizeof(allowed_child_table_vec); header.num_items = uil_max_child; header.table_id = Allowed_Child_Table; table = allowed_child_table; break; } emit_header(&header); for (i=1; i<=header.num_items; i++) /* First not used */ { entry_vec = table[i]; fwrite (entry_vec, sizeof (char) * num_bits, 1, bfile); if (DEBUG) { for (j=0; j<num_bits; j++) { fprintf (afile, "%d, ", entry_vec[j]); } fprintf (afile, "\n"); } } } void emit_length_and_string(table_id) int table_id; { _db_header header; int *lengths; char *string_table; char **table = NULL; int i; switch (table_id) { /* * all the tables are 1 based unless otherwise documented */ case Charset_Xmstring_Names_Table: header.table_size = sizeof(charset_xmstring_names_table_vec); header.num_items = uil_max_charset; header.table_id = Charset_Xmstring_Names_Table; table = charset_xmstring_names_table; break; case Charset_Lang_Names_Table: /* * This table is 0 based */ header.table_size = sizeof(charset_lang_names_table_vec); header.num_items = charset_lang_table_max - 1; header.table_id = Charset_Lang_Names_Table; table = charset_lang_names_table; break; case Uil_Widget_Names: header.table_size = sizeof(uil_widget_names_vec); header.num_items = uil_max_object; header.table_id = Uil_Widget_Names; table = uil_widget_names ; break; case Uil_Argument_Names: header.table_size = sizeof(uil_argument_names_vec); header.num_items = uil_max_arg; header.table_id = Uil_Argument_Names; table = uil_argument_names; break; case Uil_Reason_Names: header.table_size = sizeof(uil_reason_names_vec); header.num_items = uil_max_reason; header.table_id = Uil_Reason_Names; table = uil_reason_names; break; case Uil_Enumval_names: header.table_size = sizeof(uil_enumval_names_vec); header.num_items = uil_max_enumval; header.table_id = Uil_Enumval_names; table = uil_enumval_names; break; case Uil_Charset_Names: header.table_size = sizeof(uil_charset_names_vec); header.num_items = uil_max_charset; header.table_id = Uil_Charset_Names; table = uil_charset_names; break; case Uil_Widget_Funcs: header.table_size = sizeof(uil_widget_funcs_vec); header.num_items = uil_max_object; header.table_id = Uil_Widget_Funcs; table = uil_widget_funcs; break; case Uil_Argument_Toolkit_Names: header.table_size = sizeof(uil_argument_toolkit_names_vec); header.num_items = uil_max_arg; header.table_id = Uil_Argument_Toolkit_Names; table = uil_argument_toolkit_names; break; case Uil_Reason_Toolkit_Names: header.table_size = sizeof(uil_reason_toolkit_names_vec); header.num_items = uil_max_reason; header.table_id = Uil_Reason_Toolkit_Names; table = uil_reason_toolkit_names; break; case Uil_Children_Names: header.table_size = sizeof(uil_child_names_vec); header.num_items = uil_max_child; header.table_id = Uil_Children_Names; table = uil_child_names ; break; } emit_header(&header); lengths = (int *) malloc (sizeof (int) * (header.num_items + 1)); for (i=0; i<=header.num_items; i++) { if (table[i] != NULL) { /* * Add one to the length for the null terminator */ lengths[i] = strlen(table[i]) + 1; } else { lengths[i] = 0; } if (DEBUG) fprintf (afile, "%d ", lengths[i]); } fwrite (lengths, sizeof (int) * (header.num_items + 1), 1, bfile); for (i=0; i<=header.num_items; i++) { if (lengths[i]) { /* * assumed lengths[i] = lengths[i] * sizeof(char) * Add one for the null terminator */ fwrite (table[i], lengths[i] + 1, 1, bfile); if (DEBUG) fprintf (afile, "%s ", table[i]); } } free (lengths); } void emit_shorts(table_id) int table_id; { _db_header header; unsigned short int *ptr = NULL; int i; switch (table_id) { /* * All tables are 1 based unless otherwise noted */ case Charset_Lang_Codes_Table: /* * 0 based table */ header.table_size = sizeof(charset_lang_codes_table_vec); header.num_items = charset_lang_table_max - 1; header.table_id = Charset_Lang_Codes_Table; ptr = charset_lang_codes_table; break; case Argument_Enum_Set_Table: header.table_size = sizeof(argument_enumset_table_vec); header.num_items = uil_max_arg; header.table_id = Argument_Enum_Set_Table; ptr = argument_enumset_table; break; case Related_Argument_Table: header.table_size = sizeof(related_argument_table_vec); header.num_items = uil_max_arg; header.table_id = Related_Argument_Table; ptr = related_argument_table; break; case Uil_Gadget_Funcs: header.table_size = sizeof(uil_gadget_variants_vec); header.num_items = uil_max_object; header.table_id = Uil_Gadget_Funcs; ptr = uil_gadget_variants; break; case Uil_Urm_Nondialog_Class: header.table_size = sizeof(uil_urm_nondialog_class_vec); header.num_items = uil_max_object; header.table_id = Uil_Urm_Nondialog_Class; ptr = uil_urm_nondialog_class; break; case Uil_Urm_Subtree_Resource: header.table_size = sizeof(uil_urm_subtree_resource_vec); header.num_items = uil_max_object; header.table_id = Uil_Urm_Subtree_Resource; ptr = uil_urm_subtree_resource; break; } emit_header(&header); fwrite (ptr, header.table_size, 1, bfile); if (DEBUG) { for (i=0; i<header.num_items; i++) { fprintf(afile, "%d ", ptr[i]); } } } void emit_int_and_table_shorts(table_id) int table_id; { _db_header header; UilEnumSetDescDef *table = NULL; int j, i; unsigned short int *value_vec; switch (table_id) { /* * All tables are 1 based unless otherwise noted */ case Enum_Set_Table: header.table_size = sizeof(enum_set_table_vec); header.num_items = uil_max_enumset; header.table_id = Enum_Set_Table; table = enum_set_table; break; } emit_header(&header); fwrite (table, header.table_size, 1, bfile); for (i=0; i<=header.num_items; i++) /* first is not used */ { if (table[i].values_cnt) { fwrite (table[i].values, sizeof (short) * table[i].values_cnt, 1, bfile); } } } void emit_ints(table_id) int table_id; { _db_header header; int *ptr = NULL; int i; switch (table_id) /* * all tables are 1 based unless otherwise noted */ { case Enumval_Values_Table: header.table_size = sizeof(enumval_values_table_vec); header.num_items = uil_max_enumval; header.table_id = Enumval_Values_Table; ptr = enumval_values_table; break; } emit_header(&header); fwrite (ptr, header.table_size, 1, bfile); if (DEBUG) { for (i=0; i<header.num_items; i++) { fprintf(afile, "%d ", ptr[i]); } } } ���������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/wml/Exm.wml���������������������������������������������������������������0000644�0001750�0001750�00000011241�12672140200�014233� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY ! ! This file must be run through cpp to resolve the include files ! ! Include the main motif.wml file ! #include "motif.wml" ! ! These lists will be appended to those defined in the motif.wml file ! ControlList AllWidgetsAndGadgets { ExmSimple; ExmString; ExmCommandButton; ExmMenuButton; ExmStringTransfer; ExmPanner; ExmGrid; ExmTabButton; }; AllWidgets { ExmSimple; ExmString; ExmCommandButton; ExmMenuButton; ExmStringTransfer; ExmPanner; ExmGrid; ExmTabButton; }; MenuWidgetsAndGadgets { ExmMenuButton; }; ManagerWidgets { ExmGrid; }; ! ! The enumeration values used here must be defined in the .h files ! EnumerationSet SimpleShape : integer { ExmSHAPE_OVAL; ExmSHAPE_RECTANGLE; }; JoinSide : integer { XmLEFT; XmRIGHT; XmTOP; XmBOTTOM; } ; Resource ExmNsimpleShape : Argument { Type = integer; EnumerationSet = SimpleShape; }; Class ExmSimple : Widget { SuperClass = XmPrimitive; ConvenienceFunction = ExmCreateSimple; WidgetClass = ExmSimple; Resources { XmNmarginWidth; XmNmarginHeight; ! New ExmNsimpleShape; }; }; Resource ExmNreportCallback : Reason { }; ExmNrubberBand : Argument { Type = boolean; }; ExmNcanvasWidth : Argument { Type = integer; }; ExmNcanvasHeight : Argument { Type = integer; }; ExmNsliderX : Argument { Type = integer; }; ExmNsliderY : Argument { Type = integer; }; ExmNsliderWidth : Argument { Type = integer; }; ExmNsliderHeight : Argument { Type = integer; }; Class ExmPanner : Widget { SuperClass = ExmSimple; ConvenienceFunction = ExmCreatePanner; WidgetClass = ExmPanner; Resources { XmNnavigationType; ! New ExmNreportCallback; ExmNrubberBand; ExmNcanvasWidth; ExmNcanvasHeight; ExmNsliderX; ExmNsliderY; ExmNsliderWidth; ExmNsliderHeight; }; }; Resource ExmNcompoundString : Argument { Type = compound_string; }; Class ExmString : Widget { SuperClass = ExmSimple; ConvenienceFunction = ExmCreateString; WidgetClass = ExmString; Resources { XmNrenderTable; XmNalignment; XmNrecomputeSize; ! New ExmNcompoundString; }; }; Class ExmStringTransfer : Widget { SuperClass = ExmString; ConvenienceFunction = ExmCreateStringTransfer; WidgetClass = ExmStringTransfer; Resources { XmNdestinationCallback; }; }; Class ExmCommandButton : Widget { SuperClass = ExmString; ConvenienceFunction = ExmCreateCommandButton; WidgetClass = ExmCommandButton; Resources { XmNactivateCallback; }; }; Class ExmMenuButton : Widget { SuperClass = ExmString; ConvenienceFunction = ExmCreateMenuButton; WidgetClass = ExmMenuButton; Resources { XmNalignment; XmNhighlightThickness; XmNshadowThickness; XmNtraversalOn; ! New XmNaccelerator; XmNacceleratorText; XmNactivateCallback; XmNmnemonic; XmNmnemonicCharSet; }; }; Resource ExmNopenSide : Argument { Type = integer; EnumerationSet = JoinSide; }; Class ExmTabButton : Widget { SuperClass = ExmCommandButton; ConvenienceFunction = ExmCreateTabButton; Resources { ! New ExmNopenSide; }; }; Resource ExmNgridMarginWidthWithinCell : Constraint { Type = integer; }; ExmNgridMarginHeightWithinCell : Constraint { Type = integer; }; Class ExmGrid : Widget { SuperClass = XmManager; ConvenienceFunction = ExmCreateGrid; WidgetClass = ExmGrid; Resources { XmNrows; XmNcolumns; XmNmarginWidth; XmNmarginHeight; XmNmapCallback; XmNunmapCallback; XmNdefaultPosition; XmNbuttonRenderTable; XmNlabelRenderTable; XmNtextRenderTable; ! Constraint Resources (New) ExmNgridMarginWidthWithinCell; ExmNgridMarginHeightWithinCell; }; Controls { AllWidgetsAndGadgets; }; }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/wml/Makefile.am�����������������������������������������������������������0000644�0001750�0001750�00000004265�13145162623�015036� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = Exm.wml CLEANFILES = Exm.wmd $(REPORT) $(WMLTARGETS) tokens.dat wml-uil.mm AM_YFLAGS = -d noinst_PROGRAMS = wmldbcreate WMLDIR = $(top_srcdir)/tools/wml INCLUDES = -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(srcdir)/../.. \ -I$(top_srcdir)/tools/wml \ -I$(top_builddir)/tools/wml \ -I$(top_builddir)/clients/uil \ ${X_CFLAGS} LDADD = $(top_builddir)/lib/Xm/libXm.la DISTCLEANFILES = motif.wmd all: Exm.wmd WMDTABLE = Exm.wmd $(WMDTABLE): wmldbcreate $(TARGETS) ./wmldbcreate -o $@ # INCLUDES = -I. -I$(INCLUDESRC) -I$(MINCLUDESRC) -I$(MLIBSRC) -I../../. -I$(MTOP)/include # DEPLIBS = $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB) # LOCAL_LIBRARIES = XmClientLibs # # WMLDIR = $(MTOP)/tools/wml TABLE = Exm.wml # WMDTABLE = Exm.wmd # WMLTOOLS = $(WMLDIR)/wml $(WMLDIR)/wmluiltok REPORT = wml.report UILY = $(WMLDIR)/Uil.y YACCTARGETS = UilLexPars.c UilLexPars.h WMLTARGETS = UilConst.h UilKeyTab.h \ UilSymArTa.h UilSymArTy.h UilSymCSet.h UilSymCtl.h \ UilSymEnum.h UilSymGen.h UilSymNam.h UilSymRArg.h \ UilSymReas.h UilTokName.h UilUrmClas.h UilSymChCl.h \ UilSymChTa.h TARGETS = $(YACCTARGETS) $(WMLTARGETS) # # SRCS = wmldbcreate.c # # NormalLibraryObjectRule() # # all:: includes $(WMDTABLE) # # install:: all # UilLexPars.c UilLexPars.h: $(UILY) $(TARGETS): $(TABLE) $(WMLDIR)/motif.wml $(RM) $(TARGETS) $(REPORT) wml-uil.mm # $(YACC) -d $(YACCFLAGS) $(UILY) # $(MV) y.tab.c UilLexPars.c # $(MV) y.tab.h UilLexPars.h $(top_builddir)/tools/wml/wmluiltok < $(UILY) > tokens.dat # $(RM) wml-uil.mm $(RM) Exm.h $(LN_S) $(srcdir)/$(TABLE) ./Exm.h $(CPP) -I$(WMLDIR) Exm.h | $(top_builddir)/tools/wml/wml $(RM) Exm.h # $(RM) tokens.dat # # $(WMDTABLE): wmldbcreate # $(CLIENTENVSETUP) ./wmldbcreate -o $@ # # NormalProgramTarget(wmldbcreate,wmldbcreate.o,$(DEPLIBS),$(LOCAL_LIBRARIES),$(SYSLIBS)) # # UilDBDef.h: $(WMLDIR)/UilDBDef.h # rm -f UilDBDef.h # ln -s $(WMLDIR)/UilDBDef.h UilDBDef.h # # clean:: # $(RM) $(TARGETS) $(WMDTABLE) $(REPORT) \ # *.mm *.sdml *.txt tokens.dat *.h wmldbcreate UilLexPars.c *~ # # DependTarget() # # includes:: $(TARGETS) UilDBDef.h .NOTPARALLEL: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Grid.h��������������������������������������������������������������������0000644�0001750�0001750�00000005127�12672140200�013226� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Grid.h /main/5 1995/07/15 20:40:49 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * Grid.h: The widget public header file for the ExmGrid demonstration * widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmGrid_h #define _ExmGrid_h /* Include appropriate files. */ #include <Xm/Xm.h> /* widget public header file for XmManager */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class and widget record. */ externalref WidgetClass exmGridWidgetClass; typedef struct _ExmGridClassRec * ExmGridWidgetClass; typedef struct _ExmGridRec * ExmGridWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsGrid #define ExmIsGrid(w) XtIsSubclass(w, exmGridWidgetClass) #endif /* Define string equivalents of new resource names. */ #define ExmNgridMarginWidthWithinCell "gridMarginWidthWithinCell" #define ExmNgridMarginHeightWithinCell "gridMarginHeightWithinCell" #define ExmCGridMarginWidthWithinCell "GridMarginWidthWithinCell" #define ExmCGridMarginHeightWithinCell "GridMarginHeightWithinCell" /* Specify the API for this widget. */ extern Widget ExmCreateGrid( Widget parent, char *name, ArgList arglist, Cardinal argcount); extern Widget ExmCreateGridDialog( Widget parent, char *name, ArgList arglist, Cardinal argcount); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmGrid_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/CommandB.c����������������������������������������������������������������0000644�0001750�0001750�00000072227�12672140200�014021� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: CommandB.c /main/5 1995/07/15 20:40:23 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /************************************ WARNING ********************************** * * ExmCommandButton is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way." * ************************************ WARNING *********************************/ /******************************************************************************* * * CommandB.c - ExmCommandButton widget. This widget displays a button that, * when activated, initiates a callback. * This widget demonstrates how to * * create Motif-style button visuals. * * establish Motif-style actions for buttons. * * establish the XmQTactivatable trait. * * establish the XmQTtakesDefault trait. * * establish a simple Motif callback. * See the "OSF/Motif Widget Writer's Guide" for details. * ******************************************************************************/ /* Include appropriate files. */ #include <Exm/CommandBP.h> /* private header file for ExmCommandButton widget */ #include <Xm/DrawP.h> /* header file for Xme drawing functions */ #include <Xm/TraitP.h> /* header file for XmeTraitSet and XmeTraitGet. */ #include <Xm/ActivatableT.h> /* header file for XmQTactivatable trait */ #include <Xm/TakesDefT.h> /* header file for XmQTtakesDefault trait */ #include <Xm/SpecRenderT.h> /* header file for render table constants */ /* The VISUAL_DELAY constant holds a time in milliseconds. */ static XmConst unsigned long VISUAL_DELAY = 100; /* Declare all static functions. */ static void Initialize ( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args); static void ClassInitialize(void); static void ClassPartInitialize( WidgetClass widgetclass); static void Destroy ( Widget w); static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args); static void DrawShadow ( Widget w); static void ExmCommandButtonEnter ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmCommandButtonLeave ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmCommandButtonArmAndActivate ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmCommandButtonArm ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmCommandButtonActivate ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void ExmCommandButtonDisarm ( Widget w, XEvent *event, String *params, Cardinal *num_params); static void VisualDisarm ( XtPointer cd, XtIntervalId *id); static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset); static void ShowAsDefault( Widget w, XtEnum state); /* Define the translations for the ExmCommandButton widget. The first four translations will be handled by the XmPrimitive widget; the last six translations will be handled by the ExmCommandButton widget itself. */ static char defaultTranslations[] = "<EnterWindow>: ExmCommandButtonEnter()\n\ <LeaveWindow>: ExmCommandButtonLeave()\n\ ~c <Btn1Down>: ExmCommandButtonArm()\n\ <Btn1Up>: ExmCommandButtonActivate() ExmCommandButtonDisarm()\n\ :<Key>osfActivate: PrimitiveParentActivate()\n\ :<Key>osfCancel: PrimitiveParentCancel()\n\ :<Key>osfHelp: PrimitiveHelp()\n\ :<Key>osfSelect: ExmCommandButtonArmAndActivate()\n\ ~s ~m ~a <Key>space: ExmCommandButtonArmAndActivate()\n\ ~s ~m ~a <Key>Return: PrimitiveParentActivate()"; /* Declare the actions array. */ static XtActionsRec actions[] = { {"ExmCommandButtonEnter", ExmCommandButtonEnter}, {"ExmCommandButtonLeave", ExmCommandButtonLeave}, {"ExmCommandButtonArmAndActivate", ExmCommandButtonArmAndActivate}, {"ExmCommandButtonArm", ExmCommandButtonArm}, {"ExmCommandButtonActivate", ExmCommandButtonActivate}, {"ExmCommandButtonDisarm", ExmCommandButtonDisarm} }; /* Define the resources for the ExmCommandButton widget. This widget supports one new resource: XmNactivateCallback. In addition, this widget overrides the default values of two resources in XmPrimitive: XmNshadowThickness and XmNtraversalOn. */ static XtResource resources[] = { { XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension, sizeof (Dimension), XtOffsetOf( ExmCommandButtonRec, primitive.shadow_thickness), XmRImmediate, (XtPointer) 3 }, { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf( ExmCommandButtonRec, primitive.traversal_on), XmRImmediate, (XtPointer) True }, { XmNactivateCallback, XmCCallback, XmRCallback, sizeof(XtCallbackList), XtOffsetOf( ExmCommandButtonRec, command_button.activate_callback), XmRPointer, (XtPointer) NULL }, }; /* ExmCommandButton does not treat any of its resources as synthetic resources. */ /* Here is the primitive class extension record. */ static XmPrimitiveClassExtRec primClassExtRec = { /* next_extension */ NULL, /* record_type */ NULLQUARK, /* version */ XmPrimitiveClassExtVersion, /* record_size */ sizeof(XmPrimitiveClassExtRec), /* widget_baseline */ XmInheritBaselineProc, /* widget_display_rect */ XmInheritDisplayRectProc, /* widget_margins */ NULL, }; /* Define the widget class record. See Chapter 3 of the "OSF/Motif Widget Writer's Guide" for details. */ externaldef (exmcommandbuttonclassrec) ExmCommandButtonClassRec exmCommandButtonClassRec = { { /* superclass */ (WidgetClass)&exmStringClassRec, /* class_name */ "ExmCommandButton", /* widget_size */ sizeof(ExmCommandButtonRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ actions, /* num_actions */ XtNumber(actions), /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ XtInheritResize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* XmPrimitive */ /* border_highlight */ XmInheritBorderHighlight, /* border_unhighlight */ XmInheritBorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ ExmCommandButtonArmAndActivate, /* syn_resources */ NULL, /* num_syn_resources */ 0, /* extension */ (XtPointer)&primClassExtRec, }, { /* ExmSimple */ /* draw_visual */ ExmInheritDrawVisual, /* draw_shadow */ DrawShadow, /* create_gc */ ExmInheritCreateGC, /* destroy_gc */ ExmInheritDestroyGC, /* select_gc */ ExmInheritSelectGC, /* calc_visual_size */ ExmInheritCalcVisualSize, /* calc_widget_size */ ExmInheritCalcWidgetSize, /* reconfigure */ ExmInheritReconfigure, /* extension */ NULL, }, { /* ExmString */ /* default_render_table_type */ XmBUTTON_RENDER_TABLE, /* extension */ NULL, }, { /* ExmCommandButton */ /* extension */ NULL, }, }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef( exmcommandbuttonwidgetclass) WidgetClass exmCommandButtonWidgetClass = (WidgetClass) &exmCommandButtonClassRec; /* Declare an Activatable Trait record variable. */ static XmConst XmActivatableTraitRec commandButtonAT = { 0, /* version */ ChangeCB, }; /* Declare a Takes Default record variable. */ static XmConst XmTakesDefaultTraitRec commandButtonTDT = { 0, /* version */ ShowAsDefault, }; /******************************************************************************* * * Initialize: * Called by the Intrinsics when this widget is instantiated. * ******************************************************************************/ static void Initialize ( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmCommandButtonWidgetClass wc =(ExmCommandButtonWidgetClass)XtClass(new_w); ExmCommandButtonWidget nw = (ExmCommandButtonWidget) new_w; /* Initialize the three private fields of the ExmCommandButton widget. */ nw->command_button.armed = False; nw->command_button.visual_armed = False; nw->command_button.visual_timer = 0; /* Reconfigure if necessary. (This Reconfigure method is defined in the ExmSimple widget.) */ if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmCommandButtonWidgetClass, new_w, NULL); } /************************************************************************ * * ClassInitialize * Called by the Intrinsics the first time a widget of this class is * instantiated. * ************************************************************************/ static void ClassInitialize(void) { #ifndef USE_ORIGINAL_MOTIF_CODE /* Install the XmQTtakesDefault trait on CommandButton only. */ XmeTraitSet((XtPointer) exmCommandButtonWidgetClass, XmQTtakesDefault, (XtPointer) &commandButtonTDT); #endif } /************************************************************************ * * ClassPartInitialize * Called by the Intrinsics when this widget or a subclass of this * widget is instantiated. * ************************************************************************/ static void ClassPartInitialize( WidgetClass widgetclass ) { /* Install the XmQTactivatable trait on CommandButton and its subclasses. */ XmeTraitSet((XtPointer) widgetclass, XmQTactivatable, (XtPointer) &commandButtonAT); #ifdef USE_ORIGINAL_MOTIF_CODE /* Install the XmQTtakesDefault trait on CommandButton and its subclasses. */ XmeTraitSet((XtPointer) widgetclass, XmQTtakesDefault, (XtPointer) &commandButtonTDT); #endif } /******************************************************************************* * * Destroy: * Called by the Intrinsics when this widget is deallocated. * ******************************************************************************/ static void Destroy ( Widget w ) { ExmCommandButtonWidget cw = (ExmCommandButtonWidget)w; /* If the widget is deallocated during the middle of a time out, remove the time out. (In other words, if we didn't do this, then we could only deallocate the widget after any time outs had expired. */ if (cw->command_button.visual_timer != 0) XtRemoveTimeOut (cw->command_button.visual_timer); } /******************************************************************************* * * SetValues: * Called by the Intrinsics in response to a change in a resource value. * ******************************************************************************/ static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmCommandButtonWidgetClass wc =(ExmCommandButtonWidgetClass)XtClass(new_w); ExmCommandButtonWidget nw = (ExmCommandButtonWidget)new_w; Boolean redisplayFlag = False; /* If the simple.reconfigure flag changes, trigger a redisplay. */ if (nw->simple.need_to_reconfigure == True) { if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmCommandButtonWidgetClass, new_w, old_w); redisplayFlag = True; } return (redisplayFlag); } /******************************************************************************* * * DrawShadow: * Called by the ExmCommandButtonEnter, ExmCommandButtonLeave, * ExmCommandButtonArmAndActivate, ExmCommandButtonArm, * ExmCommandButtonDisarm, and VisualDisarm methods. * ******************************************************************************/ static void DrawShadow ( Widget w ) { ExmCommandButtonWidget cw = (ExmCommandButtonWidget)w; unsigned int shadow_type; /* This routine draws the "inner shadow" of the widget. Unlike the other subclasses of \*LExmSimple\*O, the \*LExmCommandButton\*O draws two shadows. One shadow, the one drawn by this routine, is always displayed. The other shadow is only displayed when the widget is the default button. The inner shadow is drawn inside the margins. In other words, the inner shadow will hug the text it encloses. The outer shadow is drawn by the ShowAsDefault trait method. */ if (cw->core.width > 2 * cw->primitive.highlight_thickness && cw->core.height > 2 * cw->primitive.highlight_thickness && cw->primitive.shadow_thickness > 0) { XmeDrawShadows (XtDisplay (cw), XtWindow (cw), cw->primitive.top_shadow_GC, cw->primitive.bottom_shadow_GC, cw->primitive.highlight_thickness + cw->simple.margin_width, cw->primitive.highlight_thickness + cw->simple.margin_height, cw->core.width - (2 * cw->primitive.highlight_thickness) - (2 * cw->simple.margin_width), cw->core.height - (2 * cw->primitive.highlight_thickness) - (2 * cw->simple.margin_height), cw->primitive.shadow_thickness, cw->command_button.visual_armed ? XmSHADOW_ETCHED_IN : XmSHADOW_ETCHED_OUT); } } /******************************************************************************* * * ExmCommandButtonEnter: * Called by the Intrinsics whenever the cursor enters a window. * ******************************************************************************/ static void ExmCommandButtonEnter ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmCommandButtonWidgetClass wc = (ExmCommandButtonWidgetClass)XtClass(w); ExmCommandButtonWidget cw = (ExmCommandButtonWidget)w; if (cw->command_button.armed == True) { /* In order for this code to be executed, the user had to have just performed the following steps: 1. moved the cursor into the widget window. 2. armed the widget. 3. moved the cursor out of the widget window. 4. moved the cursor back into the widget window. */ cw->command_button.visual_armed = True; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) (w); } /* Call the PrimitiveEnter function defined by the XmPrimitive widget. */ XtCallActionProc (w, "PrimitiveEnter", event, params, *num_params); } /******************************************************************************* * * ExmCommandButtonLeave: * Called by the Intrinsics whenever the cursor leaves the widget's window. * ******************************************************************************/ static void ExmCommandButtonLeave ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmCommandButtonWidgetClass wc = (ExmCommandButtonWidgetClass)XtClass(w); ExmCommandButtonWidget cw = (ExmCommandButtonWidget)w; if (cw->command_button.armed == True) { /* In order for this code to be executed, the user had to have: 1. moved the cursor into the widget window. 2. armed the widget. 3. moved the cursor out of the widget window. */ cw->command_button.visual_armed = False; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) (w); } XtCallActionProc (w, "PrimitiveLeave", event, params, *num_params); } /******************************************************************************* * * ExmCommandButtonArmAndActivate: * Called by the Intrinsics whenever the user presses <Key>osfSelect or * <Key>space. * ******************************************************************************/ static void ExmCommandButtonArmAndActivate ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmCommandButtonWidgetClass wc = (ExmCommandButtonWidgetClass)XtClass(w); ExmCommandButtonWidget cw = (ExmCommandButtonWidget)w; XmAnyCallbackStruct cb; /* Call DrawShadow. */ cw->command_button.visual_armed = True; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) (w); /* Eliminate any data waiting in the X Window's output buffer. */ XFlush (XtDisplay (cw)); /* Assuming that the XmNactivateCallback resource is set to True, call the callback routine. */ if (cw->command_button.activate_callback) { cb.reason = XmCR_ACTIVATE; cb.event = event; XtCallCallbackList ((Widget)cw, cw->command_button.activate_callback, &cb); } /* Provide a short delay prior to the appearance of any new windows created by the callback. The net effect is that the ExmCommandButton will appear to flash on and off immediately prior to the appearance of any window that may overwrite it. */ if ((cw->core.being_destroyed == False) && (cw->command_button.visual_timer == 0)) cw->command_button.visual_timer = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)cw), (unsigned long) VISUAL_DELAY, VisualDisarm, (XtPointer)(cw)); /* pass this arg to VisualDisarm */ } /******************************************************************************* * * ExmCommandButtonArm: * Called by the Intrinsics in response to a <Btn1Down> event. * ******************************************************************************/ static void ExmCommandButtonArm ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmCommandButtonWidgetClass wc = (ExmCommandButtonWidgetClass)XtClass(w); ExmCommandButtonWidget cw = (ExmCommandButtonWidget)w; /* Make this ExmCommandButton widget the current widget. (Highlight its border, if appropriate. */ XmProcessTraversal (w, XmTRAVERSE_CURRENT); /* Redraw the shadow to indicate arming. */ cw->command_button.armed = True; cw->command_button.visual_armed = True; if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow))(w); } /******************************************************************************* * * ExmCommandButtonActivate: * Called by the Intrinsics in response to a <Btn1Up> event. * ******************************************************************************/ static void ExmCommandButtonActivate ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmCommandButtonWidget cw = (ExmCommandButtonWidget)w; XmAnyCallbackStruct cb; if (cw->command_button.activate_callback) { cb.reason = XmCR_ACTIVATE; cb.event = event; XFlush (XtDisplay(cw)); XtCallCallbackList (w, cw->command_button.activate_callback, &cb); } } /******************************************************************************* * * ExmCommandButtonDisarm: * Called by the Intrinsics after every call to the Activate method. * ******************************************************************************/ static void ExmCommandButtonDisarm ( Widget w, XEvent *event, String *params, Cardinal *num_params ) { ExmCommandButtonWidgetClass cbwc = (ExmCommandButtonWidgetClass)XtClass(w); ExmCommandButtonWidget cbw = (ExmCommandButtonWidget)w; /* Change the appearance of the shadow to indicate that the widget is no longer armed. */ cbw->command_button.armed = False; cbw->command_button.visual_armed = False; if (cbwc->simple_class.draw_shadow) (*(cbwc->simple_class.draw_shadow)) (w); } /******************************************************************************* * * VisualDisarm: * Called by ExmCommandButtonArmAndActivate. * ******************************************************************************/ static void VisualDisarm ( XtPointer client_data, XtIntervalId *id ) { ExmCommandButtonWidget cw = (ExmCommandButtonWidget)client_data; ExmCommandButtonWidgetClass wc = (ExmCommandButtonWidgetClass)XtClass(cw); /* Change back the shadow appearance at the end of the timeout period. */ cw->command_button.visual_timer = 0; cw->command_button.visual_armed = False; if (XtIsRealized ((Widget)cw) && XtIsManaged ((Widget)cw)) if (wc->simple_class.draw_shadow) (*(wc->simple_class.draw_shadow)) ((Widget)cw); XFlush (XtDisplay (cw)); } /************************************************************************ * * Trait methods -------- * ************************************************************************/ /************************************************************************ * * ChangeCB: * Called by a parent widget of ExmCommandButton to update the * callback list. * ************************************************************************/ static void ChangeCB( Widget w, XtCallbackProc activCB, XtPointer closure, Boolean setunset) { if (setunset) /* Add to the callback list. */ XtAddCallback (w, XmNactivateCallback, activCB, closure); else /* Remove from the callback list. */ XtRemoveCallback (w, XmNactivateCallback, activCB, closure); } /************************************************************************ * * ShowAsDefault * set up the default visual * ************************************************************************/ static void ShowAsDefault(Widget w, XtEnum state) { ExmCommandButtonWidgetClass cbwc = (ExmCommandButtonWidgetClass)XtClass(w); ExmCommandButtonWidget cbw = (ExmCommandButtonWidget)w; Position start_x_of_outer_shadow, start_y_of_outer_shadow; Dimension margin_push_out=0; Dimension width_of_outer_shadow, height_of_outer_shadow; int dx, dy, width, height; GC top_GC, bottom_GC; Dimension outer_shadow_thickness; int outer_shadow_type; int margins_were_pushed_out=0; #define MARGIN_BETWEEN_HIGHLIGHT_AND_OUTER_SHADOW 2 start_x_of_outer_shadow = cbw->primitive.highlight_thickness + MARGIN_BETWEEN_HIGHLIGHT_AND_OUTER_SHADOW; start_y_of_outer_shadow = cbw->primitive.highlight_thickness + MARGIN_BETWEEN_HIGHLIGHT_AND_OUTER_SHADOW; width_of_outer_shadow = cbw->core.width - (2 * start_x_of_outer_shadow); height_of_outer_shadow = cbw->core.height - (2 * start_y_of_outer_shadow); outer_shadow_thickness = 3; switch (state) { case XmDEFAULT_READY: /* Push out the margins to make room for subsequent increases in the shadow thickness. The request to push out the margins will increase the size of the CommandButton widget assuming that its manager has the space to spare. */ if (cbw->primitive.shadow_thickness < 5) margin_push_out = 5; else margin_push_out = cbw->primitive.shadow_thickness; margins_were_pushed_out = 1; XtVaSetValues((Widget)cbw, XmNmarginWidth, cbw->simple.margin_width + margin_push_out, XmNmarginHeight, cbw->simple.margin_height + margin_push_out, NULL); break ; case XmDEFAULT_ON : /* Draw an outer shadow. The outer shadow is drawn outside the widget's margins but inside the border highlight. The inner shadow is drawn by the DrawShadow method. */ top_GC = cbw->primitive.top_shadow_GC; bottom_GC = cbw->primitive.bottom_shadow_GC; outer_shadow_type = cbw->command_button.visual_armed ? XmSHADOW_ETCHED_IN : XmSHADOW_ETCHED_OUT; XmeDrawShadows(XtDisplay(w), XtWindow(w), top_GC, bottom_GC, start_x_of_outer_shadow, start_y_of_outer_shadow, width_of_outer_shadow, height_of_outer_shadow, outer_shadow_thickness, outer_shadow_type); break ; case XmDEFAULT_OFF : /* Erase the outer shadow when the widget is no longer the default. */ XmeClearBorder(XtDisplay(w), XtWindow(w), start_x_of_outer_shadow, start_y_of_outer_shadow, width_of_outer_shadow, height_of_outer_shadow, outer_shadow_thickness); break ; case XmDEFAULT_FORGET : default : /* The widget is not a potential default button. If XmDEFAULT_FORGET is called at some point after XmDEFAULT_READY was called, then we have to restore the margins back to their original size. */ if (margins_were_pushed_out) XtVaSetValues((Widget)cbw, XmNmarginWidth, cbw->simple.margin_width - margin_push_out, XmNmarginHeight, cbw->simple.margin_height - margin_push_out, NULL); break ; } } /************************************************************************ * * Application Accessible External Functions * ************************************************************************/ /******************************************************************************* * * ExmCreateCommandButton: * Called by an application. * ******************************************************************************/ Widget ExmCreateCommandButton ( Widget parent, char *name, Arg *arglist, Cardinal argCount ) { /* Convenience function to instantiate an ExmCommandButton widget. */ return (XtCreateWidget(name,exmCommandButtonWidgetClass, parent,arglist,argCount)); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/README��������������������������������������������������������������������0000644�0001750�0001750�00000015545�12672140200�013055� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:59:32 drk $ */ This directory contains the source code for the Exm demonstration widgets. The Exm demonstration widgets illustrate how to write a Motif widget in C. If you are interested in writing a Motif widget in C++, you should see the ../ExmCxx directory. Complete details on the Exm demonstration widgets can be found in the "OSF/Motif Widget Writer's Guide and Reference" manual. We are providing the Exm widget set for educational purposes only. Programmers should not use any Exm widgets inside a commercial application. This README file summarizes the purpose of each file in this directory. The end of this README file contains instructions for building the Exm widget set. *************************** WIDGETS IN THIS DIRECTORY *************************** The Exm demonstration widgets is an eight widget set having the following hierarchy: --------------------Core-------------------- | | V V XmPrimitive XmManager | | | | V V ExmSimple------------------------ ExmGrid | | V V -----------------ExmString-------------- ExmPanner | | | V V V ExmCommandButton ExmStringTransfer ExmMenuButton | V ExmTabButton ********* ExmSimple ********* The ExmSimple widget consists of three files: * Simple.c * Simple.h * SimpleP.h The ExmSimple widget renders a rectangle or an oval. This widget demonstrates how to create a * relatively easy Motif widget. * primitive widget that can serve as a superclass for other widgets. * new representation type. ********* ExmString ********* The ExmString widget consists of three files: * String.c * String.h * StringP.h The ExmString widget demonstrates how to handle compound strings in Motif widgets. The ExmString widget is similar to the XmLabel widget. The biggest difference between the two is that an XmLabel can render either a compound string or a pixmap but an ExmString can render only a compound string. More specifically, the ExmString widget demonstrates how to: * use the four recommended resources for handling compound strings. * use the XmQTaccessTextual trait. * calculate the baselines of each lines of text. **************** ExmCommandButton **************** The ExmCommandButton widget consists of three files: * CommandB.c * CommandB.h * CommandBP.h This widget displays a button that, when activated, initiates a callback. This widget demonstrates how to * create Motif-style button visuals. * establish Motif-style actions for buttons. * install the XmQTactivatable trait. * install the XmQTtakesDefault trait. * establish a simple Motif callback. ************* ExmMenuButton ************* The ExmMenuButton widget consists of three files: * MenuB.c * MenuB.h * MenuBP.h This widget renders a menu child button that, when activated, initiates a callback. This widget demonstrates how to * create a menu child widget, in the style of XmPushButton. * install the XmQTmenuSavvy trait. * call the trait methods of XmQTmenuSystem. ***************** ExmStringTransfer ***************** The ExmStringTransfer widget consists of three files: * StringTrans.c * StringTrans.h * StringTransP.h This widget renders a compound string. The ExmStringTransfer widget demonstrates how to * implement the Uniform Transfer Method (UTM) in a Motif widget. * write a widget that supports Drag and Drop. * install the XmQTtransfer trait. ********* ExmPanner ********* The ExmPanner widget consists of three files: * Panner.c * Panner.h * PannerP.h This widget allows users to pan (navigate) through different portions of another widget. The ExmPanner widget renders a small rectangle inside a widget. The user may move this rectangle. As the rectangle moves to different portions of its surrounding widget, different portions of the target widget will become visible. The ExmPanner widget demonstrates how to: * write a navigator widget. * use the XmQTnavigator trait. ************ ExmTabButton ************ The ExmTabButton widget consists of three files: * TabB.c * TabB.h * TabBP.h This widget attaches itself to one side of a parent widget in order to give the appearance of a tab "growing out of" the parent. The ExmTabButton widget is activatable. It demonstrates how to * use the XmQTjoinSide trait. * use several Xme drawing functions. ******* ExmGrid ******* The ExmGrid widget consists of three files: * Grid.c * Grid.h * GridP.h The ExmGrid widget demonstrates how to * write a manager widget. * use the XmQTdialogSavvy trait. *********** UIL SUPPORT *********** The directory also contains several files pertaining to UIL support of the Exm widgets. They are: * Exm.uil: a header file that can be included in UIL applications. This file defines the API for UIL applications wishing to use the Exm widget set. * Exm.wml: (not available at Alpha.) This file can be compiled with wml in order to form a new motif.wmd file or a new UIL compiler. * ExmMrm.c: contains MrmRegisterClass calls for the Exm widget set. * ExmMrm.h: a header file that provides an interface to the code in the ExmMrm.c file. *************************** BUILDING THE EXM WIDGET SET *************************** This directory contains an Imakefile. In order to build the Exm widget set from this Imakefile, you should follow these steps: 1. $ make Makefile # This command should create a true Makefile. 2. $ make includes 3. $ make depend 4. $ make The "make" command should compile all of the source code files in the directory. The resulting widget object files will be archived into a library file named libExm.a. The ExmMrm.o object file will be archived into a library file named libMrm.a. In order to exercise the code in the libraries, you must build an application stored in one of the following subdirectories: * simple_app * exm_app_in_c * exm_app_in_uil �����������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/PannerP.h�����������������������������������������������������������������0000644�0001750�0001750�00000006360�12672140200�013704� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: PannerP.h /main/5 1995/07/15 20:41:19 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef _ExmPannerP_h #define _ExmPannerP_h #include <Exm/Panner.h> #include <Exm/SimpleP.h> #ifdef __cplusplus extern "C" { #endif typedef struct _ExmPannerClassPart { /* new fields in widget class */ XtPointer extension; } ExmPannerClassPart; typedef struct _ExmPannerClassRec { /* Panner widget class */ CoreClassPart core_class; XmPrimitiveClassPart primitive_class; ExmSimpleClassPart simple_class; ExmPannerClassPart panner_class; } ExmPannerClassRec; typedef struct { /* new fields in widget */ /* resources... */ XtCallbackList report_callbacks; /* callback/Callback */ Dimension canvas_width; /* canvasWidth/CanvasWidth */ Dimension canvas_height; /* canvasHeight/CanvasHeight */ Position slider_x; /* sliderX/SliderX */ Position slider_y; /* sliderY/SliderY */ Dimension slider_width; /* sliderWidth/SliderWidth */ Dimension slider_height; /* sliderHeight/SliderHeight */ /* private data... */ GC xor_gc; /* for doing XOR tmp graphics */ double haspect, vaspect; /* aspect ratio of core to canvas */ Boolean rubber_band; /* true = rubber band, false = move */ struct { Boolean doing; /* tmp graphics in progress */ Boolean showing; /* true if tmp graphics displayed */ Position startx, starty; /* initial position of slider */ Position dx, dy; /* offset loc for tmp graphics */ Position x, y; /* location for tmp graphics */ } tmp; Position knob_x, knob_y; /* real upper left of knob in canvas */ Dimension knob_width, knob_height; /* real size of knob in canvas */ Position last_x, last_y; /* previous location of knob */ Mask dimMask ; /* navigator mask */ } ExmPannerPart; typedef struct _ExmPannerRec { CorePart core; XmPrimitivePart primitive; ExmSimplePart simple; ExmPannerPart panner; } ExmPannerRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmPannerIndex (ExmSimpleIndex + 1) /* * external declarations */ externalref ExmPannerClassRec exmPannerClassRec; /******** Private Function Declarations ********/ /******** End Private Function Declarations ********/ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _ExmPannerP_h */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/TabBP.h�������������������������������������������������������������������0000644�0001750�0001750�00000006052�12672140200�013267� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: TabBP.h /main/4 1995/07/15 20:42:11 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * TabBP.h: The widget private header file for the ExmTabButton demonstration * widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmTabBP_h #define _ExmTabBP_h /* Include appropriate files. */ #include <Exm/TabB.h> /* public header file for ExmTabButton */ #include <Exm/CommandBP.h> /* private header file for ExmCommandButton */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* This widget does not provide any inheritable methods. */ /* Define the widget class part. */ typedef struct _ExmTabButtonClassPart { XtPointer extension; } ExmTabButtonClassPart; /* Define the full class record. */ typedef struct _ExmTabButtonClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; ExmSimpleClassPart simple_class; ExmStringClassPart string_class; ExmCommandButtonClassPart command_button_class; ExmTabButtonClassPart tab_button_class; } ExmTabButtonClassRec; /* Define the subclassing level index to be used with ResolvePartOffset */ #define ExmTabButtonIndex (ExmCommandButtonIndex + 1) /* Make the full class record externally accessible. */ externalref ExmTabButtonClassRec exmTabButtonClassRec; /* Define the widget instance part. */ typedef struct _ExmTabButtonPart { /* Provide space for the one resource of ExmTabButton. */ XtEnum open_side; /* Provide space for the size of the join shadow_thickness */ Dimension join_shadow_thickness; } ExmTabButtonPart; /* Define the full instance record. */ typedef struct _ExmTabButtonRec { CorePart core; XmPrimitivePart primitive; ExmSimplePart simple; ExmStringPart string; ExmCommandButtonPart command_button; ExmTabButtonPart tab_button; } ExmTabButtonRec; /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmTabBP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/ExmString.h���������������������������������������������������������������0000644�0001750�0001750�00000004651�12672140200�014262� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: String.h /main/5 1995/07/15 20:41:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * String.h: The widget public header file for the ExmString demonstration * widget. * ******************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmString_h #define _ExmString_h /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Include appropriate files. */ #include <Exm/Simple.h> /* public header file for the ExmSimple widget */ /* Define the widget class and widget record. */ externalref WidgetClass exmStringWidgetClass; typedef struct _ExmStringClassRec *ExmStringWidgetClass; typedef struct _ExmStringRec *ExmStringWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsString #define ExmIsString(w) XtIsSubclass(w, exmStringWidgetClass) #endif /* Define string equivalents of new resource names. */ #define ExmNcompoundString "compoundString" #define ExmCCompoundString "CompoundString" /* Specify the API for this widget. */ extern Widget ExmCreateString(Widget parent, char *name, Arg *arglist, Cardinal argCount); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmString_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ���������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/ExmString.c���������������������������������������������������������������0000644�0001750�0001750�00000114204�12672140200�014251� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $TOG: String.c /main/10 1997/04/16 10:00:15 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /************************************ WARNING ********************************** * * ExmString is a demonstration widget. OSF provides this widget * solely to teach programmers how to write their own Motif widgets. * OSF does not support this widget in any way ************************************ WARNING *********************************/ /******************************************************************************* * * String.c - ExmString widget. This widget renders a compound string. * The ExmString widget demonstrates how to work with strings * in Motif widgets. Functionally, the widget is similar to * XmLabel, except that XmLabel can render both pixmaps and * compound strings. The ExmString widget manipulates the * resources and traits used by other Motif string-oriented * widgets. See the "OSF/Motif Widget Writer's Guide" for details. * ******************************************************************************/ /* Include appropriate header files. */ #include <Xm/XmP.h> /* private header file for the XmPrimitive widget */ #include <Xm/XmosP.h> /* header file for MB_CUR_MAX */ #include <Exm/ExmStringP.h> /* private header file for the ExmString widget */ #include <Xm/RepType.h> /* header file for representation type facility */ #include <Xm/TraitP.h> /* header file for installing traits */ #include <Xm/AccTextT.h> /* header file for AccessTextual trait */ #include <Xm/SpecRenderT.h> /* header file for XmLABEL_RENDER_TABLE */ #include <Xm/Screen.h> /* header file for screen information */ #include <Xm/DrawP.h> /* header file for Draw routines */ /* Declare all static functions. */ static void DefaultFont ( Widget w, int offset, XrmValue *value ); static void GetValuesCompoundString( Widget w, int resource, XtArgVal *value); static void ClassInitialize(void); static void ClassPartInitialize( WidgetClass widgetclass); static void Initialize( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static void Destroy ( Widget w ); static void Resize ( Widget w ); static void AlignmentDirection( Widget w ); static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ); static XtGeometryResult QueryGeometry ( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply); static void DrawVisual ( Widget w ); static void CalcVisualSize ( Widget w ); static void CreateGC ( Widget w ); static Boolean WidgetBaselines ( Widget w, Dimension **baselines, int *line_count); static Boolean WidgetDisplayRect ( Widget w, XRectangle *displayrect); static void StringSetValue( Widget w, XtPointer s, int format); static XtPointer StringGetValue( Widget w, int format); static int StringPreferredFormat( Widget w); /* Define constants here. */ static XmConst int FIND_NATURAL_SIZE = 0; #define UNSUPPORTED_FORMAT "Someone is trying to get or set a value for \n\ ExmNcompoundString; however, the specified format is undefined.\n" /* Define the translations string for the ExmString widget. All six actions will be handled by the XmPrimitive widget. */ static char defaultTranslations[] = "<EnterWindow>: PrimitiveEnter()\n\ <LeaveWindow>: PrimitiveLeave()\n\ :<Key>osfActivate: PrimitiveParentActivate()\n\ :<Key>osfCancel: PrimitiveParentCancel()\n\ :<Key>osfHelp: PrimitiveHelp()\n\ ~s ~m ~a <Key>Return: PrimitiveParentActivate()"; /* No actions array needed. */ /* Define the resources for the ExmString widget. */ static XtResource resources[] = { { XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof (Boolean), XtOffsetOf( XmPrimitiveRec, primitive.traversal_on), XmRImmediate, (XtPointer) False /* override the default. */ }, { ExmNcompoundString, ExmCCompoundString, XmRXmString, sizeof(XmString), XtOffsetOf( ExmStringRec,string.compound_string), XmRImmediate, (XtPointer) NULL }, { XmNrenderTable, XmCRenderTable, XmRRenderTable, sizeof(XmRenderTable), XtOffsetOf( ExmStringRec,string.render_table), XtRCallProc, (XtPointer) DefaultFont }, { XmNalignment, XmCAlignment, XmRAlignment, sizeof(unsigned char), XtOffsetOf( ExmStringRec,string.alignment), XmRImmediate, (XtPointer) XmALIGNMENT_CENTER }, { XmNrecomputeSize, XmCRecomputeSize, XmRBoolean, sizeof(Boolean), XtOffsetOf( ExmStringRec,string.recompute_size), XmRImmediate, (XtPointer) True }, }; /* Provide a synthetic resource for ExmNcompoundString. */ static XmSyntheticResource syn_resources[] = { { ExmNcompoundString, sizeof(XmString), XtOffsetOf(ExmStringRec, string.compound_string), GetValuesCompoundString, NULL } }; /* Here is the primitive class extension record. */ static XmPrimitiveClassExtRec primClassExtRec = { /* next_extension */ NULL, /* record_type */ NULLQUARK, /* version */ XmPrimitiveClassExtVersion, /* record_size */ sizeof(XmPrimitiveClassExtRec), /* widget_baseline */ WidgetBaselines, /* widget_display_rect */ WidgetDisplayRect, /* widget_margins */ NULL, }; externaldef (exmstringclassrec) ExmStringClassRec exmStringClassRec = { { /* superclass */ (WidgetClass)&exmSimpleClassRec, /* class_name */ "ExmString", /* widget_size */ sizeof(ExmStringRec), /* class_initialize */ ClassInitialize, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ Resize, /* expose */ XtInheritExpose, /* set_values */ SetValues, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ defaultTranslations, /* query_geometry */ QueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* XmPrimitive */ /* border_highlight */ XmInheritBorderHighlight, /* border_unhighlight */ XmInheritBorderUnhighlight, /* translations */ XtInheritTranslations, /* arm_and_activate */ NULL, /* syn_resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* extension */ (XtPointer)&primClassExtRec, }, { /* ExmSimple */ /* draw_visual */ DrawVisual, /* draw_shadow */ ExmInheritDrawShadow, /* create_text_gc */ CreateGC, /* destroy_text_gc */ ExmInheritDestroyGC, /* select_text_gc */ ExmInheritSelectGC, /* calc_visual_size */ CalcVisualSize, /* calc_widget_size */ ExmInheritCalcWidgetSize, /* reconfigure */ ExmInheritReconfigure, /* extension */ NULL, }, { /* ExmString */ /* default_render_table_type */ XmLABEL_RENDER_TABLE, /* extension */ NULL, } }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro for OS-independent global definitions. */ externaldef( exmstringwidgetclass) WidgetClass exmStringWidgetClass = (WidgetClass) &exmStringClassRec; /* Define static representation type variables here. */ static XmRepTypeId alignmentId; /* Define trait structure variables here. */ /* Since ExmString displays a primary parcel of text, the ExmString widget must install the XmQTaccessTextual trait. The following declaration is of a trait structure variable named StringATT. */ static XmConst XmAccessTextualTraitRec StringATT = { 0, /* version */ StringGetValue, StringSetValue, StringPreferredFormat, }; /******************************************************************************* * * DefaultFont: * Called by the Intrinsics to establish a default value for the * XmNrenderTable resource. * ******************************************************************************/ static void DefaultFont ( Widget w, int offset, XrmValue *value ) { ExmStringWidgetClass wc = (ExmStringWidgetClass)XtClass(w); static XmRenderTable f1; /* Find the default render table associated with the default render table type. */ f1 = XmeGetDefaultRenderTable (w, wc->string_class.default_render_table_type); value->addr = (XtPointer)&f1; value->size = sizeof(f1); } /************************************************************************ * * GetValuesCompoundString * This is a synthetic resource function called by Motif when * an application calls XtGetValues to access the value of * ExmNcompoundString. * ***********************************************************************/ /*ARGSUSED*/ static void GetValuesCompoundString( Widget w, int resource, /* unused */ XtArgVal *value) { ExmStringWidget sw = (ExmStringWidget) w; XmString string; /* All Motif widgets are responsible for making a copy of an XmString resource whenever an application accesses the resource through a call to XtGetValues. */ string = XmStringCopy(sw->string.compound_string); *value = (XtArgVal) string; } /******************************************************************************* * * ClassInitialize * Called by the Intrinsics the first time a widget of this class is * instantiated. * ******************************************************************************/ static void ClassInitialize(void) { /* Use existing Motif representation types for XmNalignment. */ alignmentId = XmRepTypeGetId (XmRAlignment); if (alignmentId == XmREP_TYPE_INVALID) XmeWarning(NULL, "The value of XmNalignment is illegal."); } /************************************************************************ * * ClassPartInitialize * Called by the Intrinsics when this widget or a subclass of this * widget is instantiated. * ************************************************************************/ static void ClassPartInitialize( WidgetClass widgetclass ) { /* Install the XmQTaccessTextual trait on the ExmString class and all its subclasses. */ XmeTraitSet((XtPointer) widgetclass, XmQTaccessTextual, (XtPointer) &StringATT); } /******************************************************************************* * * Initialize * Called when this widget is instantiated. * ******************************************************************************/ static void Initialize ( Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmStringWidgetClass wc = (ExmStringWidgetClass)XtClass(new_w); ExmStringWidget nw = (ExmStringWidget)new_w; unsigned char stringDirection; Arg dirArgs[1]; /* Copy the compound string and render table. */ nw->string.compound_string = XmStringCopy(nw->string.compound_string); nw->string.render_table = XmRenderTableCopy(nw->string.render_table, NULL, 0); /* Validate XmNalignment */ if (!XmRepTypeValidValue (alignmentId, nw->string.alignment, (Widget)nw)) nw->string.alignment = XmALIGNMENT_CENTER; /* If the XmNstringDirection resource is set to XmSTRING_DIRECTION_DEFAULT, then we need to figure out what the default string direction is. If the parent is a manager, then we'll set the string direction of ExmString to the string direction of the manager. */ AlignmentDirection((Widget)nw); if (wc->simple_class.calc_visual_size) (*(wc->simple_class.calc_visual_size))(new_w); if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmStringWidgetClass, new_w, NULL); } /******************************************************************************* * * Destroy * Called by the Intrinsics whenever this widget is deallocated. * ******************************************************************************/ static void Destroy ( Widget w ) { ExmStringWidget sw = (ExmStringWidget)w; /* Free the memory used to hold the ExmNcompound_string and XmNrenderTable resource values. */ if (sw->string.compound_string != NULL) XmStringFree (sw->string.compound_string); if (sw->string.render_table != NULL) XmRenderTableFree (sw->string.render_table); } /******************************************************************************* * * Resize * ******************************************************************************/ static void Resize ( Widget w ) { ExmStringWidget sw = (ExmStringWidget)w; Dimension mw, mh; Dimension window_decoration_thickness; /* Configure internal geometry using current size */ if ((sw->simple.visual.width == FIND_NATURAL_SIZE) || (sw->simple.visual.height == FIND_NATURAL_SIZE)) return; window_decoration_thickness = sw->primitive.highlight_thickness + sw->primitive.shadow_thickness; /* Determine where the string's bounding box should start. */ /* First determine the X coordinate of the bounding box. */ mw = window_decoration_thickness + sw->simple.margin_width; switch (sw->string.text_starts_here) { case ExmSTART_STRING_LEFT_SIDE : sw->simple.visual.x = mw; break; case ExmSTART_STRING_RIGHT_SIDE : sw->simple.visual.x = sw->core.width - (mw + sw->simple.visual.width + window_decoration_thickness); break; case ExmCENTER_STRING : sw->simple.visual.x = ((int)(sw->core.width - sw->simple.visual.width))/2; break; }; /* Now do the same for the vertical dimension. */ mh = window_decoration_thickness + sw->simple.margin_height; /* If the widget has enough vertical space to display all the lines in the string, then center the string. */ if ((int)sw->core.height > (int)((2 * window_decoration_thickness) + sw->simple.visual.height)) { sw->simple.visual.y = ((int)(sw->core.height - sw->simple.visual.height))/2; } else if ((int)sw->core.height > ((int)(2 * window_decoration_thickness))) { /* Space is very tight. We will eliminate the top margin altogether and start the first line of the compound string snug against the bottom of the top edge of the window decorations. */ sw->simple.visual.y = window_decoration_thickness; } else /* Space is so tight that we do not have enough space to display even one pixel of the visual. */ sw->simple.visual.y = window_decoration_thickness; } /******************************************************************************* * * AlignmentDirection: * Called by Initialize and by SetValues. * ******************************************************************************/ static void AlignmentDirection( Widget w ) { ExmStringWidget sw = (ExmStringWidget)w; /* This method determines where the text starts. The text could * be centered. * start at the left side of the widget. * start at the right side of the widget. */ if (sw->string.alignment == XmALIGNMENT_CENTER) /* The string will be centered. */ sw->string.text_starts_here = ExmCENTER_STRING; else if ( (XmDirectionMatch(sw->primitive.layout_direction, XmLEFT_TO_RIGHT) && sw->string.alignment == XmALIGNMENT_BEGINNING) || (XmDirectionMatch(sw->primitive.layout_direction, XmRIGHT_TO_LEFT) && sw->string.alignment == XmALIGNMENT_END) ) /* The string will start at the left side of the widget. */ sw->string.text_starts_here = ExmSTART_STRING_LEFT_SIDE; else if ( (XmDirectionMatch(sw->primitive.layout_direction, XmLEFT_TO_RIGHT) && sw->string.alignment == XmALIGNMENT_END) || (XmDirectionMatch(sw->primitive.layout_direction, XmRIGHT_TO_LEFT) && sw->string.alignment == XmALIGNMENT_BEGINNING) ) /* The string will start at the right side of the widget. */ sw->string.text_starts_here = ExmSTART_STRING_RIGHT_SIDE; } /******************************************************************************* * * SetValues * ******************************************************************************/ static Boolean SetValues ( Widget old_w, Widget request_w, Widget new_w, ArgList args, Cardinal *num_args ) { ExmStringWidgetClass wc = (ExmStringWidgetClass)XtClass(new_w); ExmStringWidget cw = (ExmStringWidget)old_w; ExmStringWidget nw = (ExmStringWidget)new_w; Boolean redisplayFlag = False; /* Copy ExmNcompoundString if its value has changed */ if (nw->string.compound_string != cw->string.compound_string) { nw->string.compound_string = XmStringCopy(nw->string.compound_string); XmStringFree(cw->string.compound_string); cw->string.compound_string = (XmString) NULL; nw->simple.need_to_reconfigure = True; } /* Update XmNcompound_string whenever XmNrenderTable changes */ if (nw->string.render_table != cw->string.render_table) { nw->string.render_table = XmRenderTableCopy(nw->string.render_table, NULL, 0); XmRenderTableFree (cw->string.render_table); cw->string.render_table = (XmRenderTable) NULL; nw->simple.need_to_reconfigure = True; } /* Validate any changes to the value of the XmNalignment resource. If the requested new value is not valid, then reset the value of the XmNalignment resource to the old value. */ if (nw->string.alignment != cw->string.alignment) { if (!XmRepTypeValidValue(alignmentId, nw->string.alignment, (Widget)nw)) nw->string.alignment = cw->string.alignment; else nw->simple.need_to_reconfigure = True; } /* If the XmNrecomputeSize resource used to be False but is now True, then we will have to set in motion the series of calls that will lead to an appropriate resize of the widget. */ if ((nw->string.recompute_size == True) && (cw->string.recompute_size == False)) { nw->simple.need_to_reconfigure = True; if (nw->core.width == cw->core.width) nw->core.width = FIND_NATURAL_SIZE; if (nw->core.height == cw->core.height) nw->core.height = FIND_NATURAL_SIZE; } /* If the Alignment has changed or the layout direction has changed, then the widget needs to determine a new starting position for the bounding text box. */ if ( nw->string.alignment != cw->string.alignment || nw->primitive.layout_direction != cw->primitive.layout_direction) AlignmentDirection((Widget)nw); /* Determine whether or not the widget needs to be reconfigured. Just about any change to a resource will necessitate a reconfiguration. If the widget does need to be reconfigured, call Reconfigure. */ if (nw->simple.need_to_reconfigure == True) { if (wc->simple_class.reconfigure) (*(wc->simple_class.reconfigure))(exmStringWidgetClass, new_w, old_w); redisplayFlag = True; } return (redisplayFlag); } /******************************************************************************* * * QueryGeometry * Called by the Intrinsics in response to a proposed changed in geometry. * ******************************************************************************/ static XtGeometryResult QueryGeometry( Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply ) { ExmStringWidgetClass swc = (ExmStringWidgetClass)XtClass(w); ExmStringWidget sw = (ExmStringWidget) w ; if (!XtIsRealized(w)) { /* Widget has not been realized yet. */ reply->width = XtWidth(w); /* might be 0 */ reply->height = XtHeight(w); /* might be 0 */ } else { if (sw->string.recompute_size) { /* The user will allow the ExmString widget to change size, so let's call CalcWidgetSize to calculate the widget's preferred size. */ int save_w, save_h; save_w = XtWidth(w); save_h = XtHeight(w); if (swc->simple_class.calc_widget_size) (*(swc->simple_class.calc_widget_size))((Widget)sw); sw -> simple.pref_width = XtWidth(w); sw -> simple.pref_height = XtHeight(w); XtWidth(w) = save_w; XtHeight(w) = save_h; } reply->width = sw -> simple.pref_width; reply->height = sw -> simple.pref_height; } /* Return our preferred size */ return XmeReplyToQueryGeometry(w, request, reply); } /******************************************************************************* * * DrawVisual * ******************************************************************************/ static void DrawVisual ( Widget w ) { ExmStringWidgetClass wc = (ExmStringWidgetClass)XtClass(w); ExmStringWidget sw = (ExmStringWidget)w; /* If the compound string is not NULL and if there is enough space in the widget to draw at least a little portion of the compound string, then render the string with XmStringDraw. */ if (sw->string.compound_string && (sw->simple.visual.width != 0) && (sw->simple.visual.height != 0)) { XmStringDraw (XtDisplay(sw), XtWindow(sw), sw->string.render_table, sw->string.compound_string, wc->simple_class.select_gc(w), sw->simple.visual.x, sw->simple.visual.y, sw->simple.visual.width, sw->string.alignment, sw->primitive.layout_direction, NULL); XmeClearBorder(XtDisplay(sw), XtWindow(sw), (int)0, (int)0, (Dimension)sw->core.width, (Dimension)sw->core.height, (Dimension)(sw->primitive.highlight_thickness + sw->primitive.shadow_thickness) ); } } /******************************************************************************* * * CreateGC: * Called by the Initialize method of the base class (ExmSimple). * ******************************************************************************/ static void CreateGC ( Widget w ) { ExmStringWidget sw = (ExmStringWidget)w; XGCValues values; XtGCMask valueMask; XFontStruct *fs = (XFontStruct *) NULL; Arg args[2]; Pixmap insensitiveStippleBitmap; /* This function creates two GC's: one to render a sensitive widget and the other to render an insensitive widget. */ /* First, create the sensitive GC (named normal_gc). */ valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = sw->primitive.foreground; values.background = sw->core.background_pixel; values.graphics_exposures = False; /* In order to set the GCFont field of the GC, we must gather XFontStruct information out of the render table. This is only to get a reasonable initial value. XmStringDraw will pick the necessary fonts from the render table, so we will not need to update the GC when the render table changes. */ if (XmeRenderTableGetDefaultFont(sw->string.render_table, &fs)) { values.font = fs->fid; valueMask |= GCFont; } sw->simple.normal_gc = XtGetGC ((Widget)sw, valueMask, &values); /* Next, create the insensitive GC. This GC will share the same foreground, background, font, and graphics exposures as the sensitive GC, but will hold a different fill style and stipple pattern. */ valueMask |= GCFillStyle | GCStipple; values.fill_style = FillStippled; /* Gather the Motif-appropriate insensitive stipple bitmap. */ XtSetArg(args[0], XmNinsensitiveStippleBitmap, &insensitiveStippleBitmap); XtGetValues(XmGetXmScreen(XtScreen(w)), args, 1); values.stipple = insensitiveStippleBitmap; sw->simple.insensitive_gc = XtGetGC((Widget) sw, valueMask, &values); } /******************************************************************************* * * CalcVisualSize * ******************************************************************************/ static void CalcVisualSize ( Widget w ) { ExmStringWidget sw = (ExmStringWidget)w; /* Ideally, how much space would the compound string require? */ if (sw->string.compound_string && !XmStringEmpty(sw->string.compound_string)) XmStringExtent (sw->string.render_table, sw->string.compound_string, &(sw->simple.visual.width), &(sw->simple.visual.height)); else { /* The string is empty, so it requires no space. */ sw->simple.visual.width = 0; sw->simple.visual.height = 0; } } /******************************************************************************* * * WidgetBaselines: * Called by manager widgets needing to align text-based visuals. * This method can also be called directly by an application through * the XmWidgetGetBaselines function. * ******************************************************************************/ static Boolean WidgetBaselines( Widget w, Dimension **baselines, int *line_count) { XmStringContext context = NULL; XmString current_string; XmString string1 = NULL; char* text1; char* text2; XmStringCharSet char_set1, char_set2; XmStringDirection direction1, direction2; /* XmFontList FontList; */ XmRenderTable RenderTable; Boolean separator1, separator2; Dimension *base_array; Dimension Offset; int index; ExmStringWidget sw = (ExmStringWidget)w; /* This function returns True to indicate that the widget is displaying text, or False to indicate that the widget is not displaying text. If the widget is displaying text, this function calculates the baseline of each displayed line of text. */ index = 0; RenderTable = sw->string.render_table; /* Initialize the string context. If the XmStringInitContext call returns False, then no string context could be found which suggests that no text is being displayed in the widget. */ current_string = sw->string.compound_string; if (!XmStringInitContext (&context, current_string)) return (False); /* Determine how many lines are in the displayed string. */ *line_count = XmStringLineCount(current_string); base_array = (Dimension *)XtMalloc((sizeof(Dimension) * (*line_count))); /* Offset = ((ExmStringWidget) w)->string.visual.y; */ Offset = sw->simple.visual.y; /* Go through the compound string, segment by segment. */ while (XmStringGetNextSegment (context, &text1, &char_set1, &direction1, &separator1)) { if (string1) XmStringFree(string1); string1 = XmStringCreate(text1, char_set1); XtFree(text1); if (separator1) { while (XmStringPeekNextComponent(context)== XmSTRING_COMPONENT_SEPARATOR) { XmStringGetNextComponent (context, &text1, &char_set1, &direction1, NULL, NULL, NULL); base_array[index++] = Offset + XmStringBaseline (RenderTable, string1); Offset += XmStringHeight (RenderTable, string1); } } else if (XmStringGetNextSegment (context, &text2, &char_set2, &direction2, &separator2)) { XmString string2; if (separator2) { string2 = XmStringCreate(text2, char_set2); string1 = XmStringConcat(string1, string2); base_array[index++] = Offset + XmStringBaseline (RenderTable, string1); Offset += XmStringHeight (RenderTable, string1); } else { string2 = XmStringCreate(text2, char_set2); string1 = XmStringConcat(string1, string2); } XtFree(text2); XmStringFree(string2); XtFree(char_set2); } else { XtFree(char_set1); break; } XtFree(char_set1); } /* end of outer while loop */ base_array[index++] = Offset + XmStringBaseline (RenderTable, string1); XmStringFree(string1); *baselines = base_array; XmStringFreeContext(context); return (True); } /******************************************************************************* * * WidgetDisplayRect: * Called by several Motif managers to determine how to align the visuals * drawn by primitives. In addition, an application can access this * method by calling XmWidgetGetDisplayRect. * ******************************************************************************/ static Boolean WidgetDisplayRect( Widget w, XRectangle *displayrect ) { ExmStringWidget my_widget = (ExmStringWidget) w; if ((my_widget->simple.visual.width > 0 && my_widget->simple.visual.height > 0)) { displayrect->x = my_widget->simple.visual.x; displayrect->y = my_widget->simple.visual.y; displayrect->width = my_widget->simple.visual.width; displayrect->height = my_widget->simple.visual.height; return True; /* Yes, this widget contains something displayable. */ } else { return False; /* this widget is not currently displaying a visual. */ } } /******************************************************************************* * * Trait Methods: * We now provide the code for the three methods defined by the * XmQTaccessTextual trait. * ******************************************************************************/ /******************************************************************************* * * StringGetValue: Called by another widget (generally a parent of * an ExmString). This trait method must return the currently * displayed text string in the format that the caller requests. * ******************************************************************************/ static XtPointer StringGetValue( Widget w, int format) { ExmStringWidget string_w = (ExmStringWidget) w; XmString value; int n; Arg args[4]; XmParseTable map[2]; XmString separator; XtPointer result; XmTextType output_type; /* Get the string that the ExmString widget is currently displaying. */ value = XmStringCopy(string_w -> string.compound_string); /* The "value" variable know holds the string in XmString format. */ switch (format) { case XmFORMAT_XmSTRING: /* If the caller wants "value" returned as a compound string, no conversion is necessary. */ return (XtPointer) value; case XmFORMAT_MBYTE: case XmFORMAT_WCS: /* If the caller wants "value" returned as a multibyte string or as a wide character string, then we have to convert it. */ if (format == XmFORMAT_MBYTE) output_type = XmMULTIBYTE_TEXT; else output_type = XmWIDECHAR_TEXT; /* Create a very simple parse table consisting of two parse mappings. */ separator = XmStringSeparatorCreate(); n = 0; XtSetArg( args[n], XmNpattern, "\n"); n++; XtSetArg( args[n], XmNpatternType, output_type ); n++; XtSetArg( args[n], XmNsubstitute, separator ); n++; XtSetArg( args[n], XmNincludeStatus, XmINSERT ); n++; map[0] = (XmParseMapping *) XmParseMappingCreate( args, n ); XmStringFree(separator); separator = XmStringComponentCreate( XmSTRING_COMPONENT_TAB, 0, NULL); n = 0; XtSetArg( args[n], XmNpattern, "\t"); n++; XtSetArg( args[n], XmNpatternType, output_type ); n++; XtSetArg( args[n], XmNsubstitute, separator ); n++; XtSetArg( args[n], XmNincludeStatus, XmINSERT ); n++; map[1] = (XmParseMapping *) XmParseMappingCreate( args, n ); XmStringFree(separator); /* Unparse "value" into either MULTIBYTE or WCS format. */ result = XmStringUnparse (value, (XmStringTag) NULL, (XmTextType)NULL, (XmTextType)output_type, (XmParseTable)map, XtNumber(map), XmOUTPUT_ALL); /* Variable "result" now holds the text of the string in either MULTIBYTE or WCS format. */ return (XtPointer)result; default: XmeWarning((Widget)w, UNSUPPORTED_FORMAT); return NULL; } } /******************************************************************************* * * StringSetValue: * Called by another widget to set the value of the ExmNcompoundString * resource. * ******************************************************************************/ static void StringSetValue( Widget w, XtPointer string, int format) { Arg args[1]; XmString temp; Boolean freetemp; int length; char *str; wchar_t *str2; /* The caller will pass a new value for ExmNcompoundString. This new value will be passed in the "string" argument. However, there is no guarantee that the input "string" will be passed in XmString format. If the input "string" is passed in WCS or MULTIBYTE format, then we must convert the "string" into XmString format. Once the "string" is in XmString format, we can use it as the new value of ExmNcompoundString. */ switch (format) { case XmFORMAT_XmSTRING: temp = (XmString) string; freetemp = False; break; case XmFORMAT_WCS: str2 = (wchar_t *) string; /* How long is str2? */ length = 0; while (str2[length] != 0) length++; /* malloc enough space to hold str */ str = (char*) XtMalloc(MB_CUR_MAX * (length+1)); wcstombs(str, str2, MB_CUR_MAX * (length+1)); XtFree((char *) string); string = str; case XmFORMAT_MBYTE: temp = XmStringCreateLocalized(string); freetemp = True; break; default: XmeWarning((Widget)w, UNSUPPORTED_FORMAT); return; } XtSetArg(args[0], ExmNcompoundString, temp); XtSetValues(w, args, 1); if (freetemp) XmStringFree(temp); } /******************************************************************************* * * StringPreferredFormat * Called by another widget to determine the preferred string format of * this widget. The possible returned formats are: * * XmFORMAT_XmSTRING (Motif compound string format) * * XmFORMAT_MBYTE (Multibyte format) * * XmFORMAT_WCS (Wide character string format) * ******************************************************************************/ static int StringPreferredFormat( Widget w) { /* Choose XmFORMAT_XmSTRING because the ExmString widget holds its displayed text in XmString format (as opposed to Multibyte or WCS format). */ return(XmFORMAT_XmSTRING); } /******************************************************************************* * * ExmCreateString * Externally accessable function for creating a String widget * ******************************************************************************/ Widget ExmCreateString ( Widget parent, char *name, Arg *arglist, Cardinal argCount ) { return (XtCreateWidget(name,exmStringWidgetClass,parent,arglist,argCount)); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/MenuB.h�������������������������������������������������������������������0000644�0001750�0001750�00000004120�12672140200�013337� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: MenuB.h /main/5 1995/07/15 20:41:02 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* Ensure that the file be included only once. */ #ifndef _ExmMenuB_h #define _ExmMenuB_h /* Include appropriate files. */ #include <Exm/ExmString.h> /* public header file for immediate superclass */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class and widget record. */ externalref WidgetClass exmMenuButtonWidgetClass; typedef struct _ExmMenuButtonClassRec *ExmMenuButtonWidgetClass; typedef struct _ExmMenuButtonRec *ExmMenuButtonWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsMenuButton #define ExmIsMenuButton(w) XtIsSubclass(w, exmMenuButtonWidgetClass) #endif /* Define string equivalents of new resource names. */ /* None. */ /* Specify the API for this widget. */ extern Widget ExmCreateMenuButton(Widget parent, char *name, Arg *arglist, Cardinal argCount); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* _ExmMenuB_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/lib/Exm/Makefile.am���������������������������������������������������������������0000644�0001750�0001750�00000001177�13145162623�014236� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = wml noinst_LIBRARIES = libExm.a libExmMrm.a INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/.. -I$(top_builddir)/lib ${X_CFLAGS} CLEANFILES = Grid.E libExm_a_SOURCES = CommandB.c Grid.c Panner.c MenuB.c \ Simple.c ExmString.c StringTrans.c TabB.c libExmMrm_a_SOURCES = ExmMrm.c noinst_HEADERS = CommandB.h CommandBP.h ExmMrm.h Grid.h \ GridP.h MenuB.h MenuBP.h Panner.h \ PannerP.h Simple.h SimpleP.h ExmString.h \ ExmStringP.h StringTrans.h StringTransP.h TabB.h \ TabBP.h EXTRA_DIST = �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�011510� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/Makefile.in�������������������������������������������������������������������0000644�0001750�0001750�00000046403�13211512765�013516� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = programGuide all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513010�014127� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014677� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Notebook/���������������������������������������������������0000755�0001750�0001750�00000000000�13211513010�016451� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Notebook/notebook.c�����������������������������������������0000644�0001750�0001750�00000010607�12672140200�020370� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: notebook.c /main/5 1995/07/15 20:40:05 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <Xm/XmAll.h> #include <Xmd/RegEdit.h> void CreateNotebook(Widget); extern void CreateMenus(Widget); extern void HelpCB(Widget, XtPointer, XtPointer); extern void QuitCB(Widget, XtPointer, XtPointer); Widget top_level; #define APP_CLASS "XmdNotebook" int main(int argc, char **argv) { XtAppContext app_context; Widget main_window; XtSetLanguageProc(NULL, NULL, NULL); top_level = XtVaOpenApplication(&app_context, APP_CLASS, NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL); XmdRegisterEditres(top_level); main_window = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, top_level, NULL); CreateMenus(main_window); CreateNotebook(main_window); XtRealizeWidget(top_level); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } void CreateNotebook(Widget parent_of_notebook) { #define PAGES_IN_NOTEBOOK 7 #define NUMBER_OF_MAJOR_TABS 2 Widget notebook, frame; char buff[80]; int i; static char *info[PAGES_IN_NOTEBOOK+1] = { "dummy", "apples are high in fiber", "bananas are high in Potassium", "oranges are high in Vitamin C", "celery", "lettuce", "sweet potato", "carrot" }; notebook = XtVaCreateWidget("notebook", xmNotebookWidgetClass, parent_of_notebook, NULL); /* Create the pages of the Notebook. */ for (i=1; i<=PAGES_IN_NOTEBOOK; i++) { /* Create a frame on every page. */ frame = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, notebook, XmNnotebookChildType, XmPAGE, XmNpageNumber,i, NULL); /* Place the page contents (a string) on each page. */ XtVaCreateManagedWidget(info[i], xmLabelWidgetClass, frame, NULL); } XtVaCreateManagedWidget("tropical only", xmLabelWidgetClass, notebook, XmNnotebookChildType, XmSTATUS_AREA, XmNpageNumber, 2, NULL); /* Create major tabs to divide the pages into categories. */ XtVaCreateManagedWidget("fruits", xmPushButtonWidgetClass, notebook, XmNnotebookChildType, XmMAJOR_TAB, XmNpageNumber, 1, NULL); XtVaCreateManagedWidget("vegetables", xmPushButtonWidgetClass, notebook, XmNnotebookChildType, XmMAJOR_TAB, XmNpageNumber, 4, NULL); /* Create some minor tabs to divide the categories into subcategories. */ XtVaCreateManagedWidget("green", xmPushButtonWidgetClass, notebook, XmNnotebookChildType, XmMINOR_TAB, XmNpageNumber, 4, NULL); XtVaCreateManagedWidget("orange", xmPushButtonWidgetClass, notebook, XmNnotebookChildType, XmMINOR_TAB, XmNpageNumber, 6, NULL); XtManageChild(notebook); } �������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Notebook/interface.c����������������������������������������0000644�0001750�0001750�00000011470�12672140200�020507� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: interface.c /main/4 1995/07/15 20:40:00 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmAll.h> void CreateMenus(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); extern Widget top_level; /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, (XtPointer)1); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB: This function is called when the user requests help. This function displays a Message DialogBox. *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { int what_kind_of_help = (int)cd; char help_string[400]; XmString hs_as_cs; Widget dialog_general_help; Arg arg[3]; sprintf(help_string, "This program demonstrates how to use an XmNotebook in an application.\n\ You can turn the pages of the notebook by \n\ * clicking on the page scroller arrows \n\ * clicking on one of the major tab buttons (fruits or vegetables) \n\ * clicking on one of the minor tab buttons (green or orange) \n\ A status area appears when the current page number is 2."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); dialog_general_help = (Widget)XmCreateMessageDialog(top_level, "message", arg, 1); XmStringFree(hs_as_cs); switch (what_kind_of_help) { case 1: XtManageChild(dialog_general_help); break; default: /* no other help */ break; } } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Notebook/Makefile.in����������������������������������������0000644�0001750�0001750�00000045435�13211512765�020471� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = notebook$(EXEEXT) subdir = demos/doc/programGuide/ch08/Notebook ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_notebook_OBJECTS = interface.$(OBJEXT) notebook.$(OBJEXT) notebook_OBJECTS = $(am_notebook_OBJECTS) notebook_LDADD = $(LDADD) notebook_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(notebook_SOURCES) DIST_SOURCES = $(notebook_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README notebook.man notebook_SOURCES = interface.c notebook.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch08/Notebook/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch08/Notebook/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list notebook$(EXEEXT): $(notebook_OBJECTS) $(notebook_DEPENDENCIES) $(EXTRA_notebook_DEPENDENCIES) @rm -f notebook$(EXEEXT) $(AM_V_CCLD)$(LINK) $(notebook_OBJECTS) $(notebook_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notebook.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Notebook/notebook.man���������������������������������������0000644�0001750�0001750�00000003117�12672140200�020717� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: notebook.man /main/4 1995/07/17 10:45:18 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH notebook 1X MOTIF "Demonstration programs" .SH NAME \*Lnotebook\*O\(emDemonstrates how to use XmNotebook in a simple application .SH SYNOPSIS .sS \*LNotebook\*O .sE .SH DESCRIPTION \*Lnotebook\*O illustrates how to place an XmNotebook into an application. You can turn the pages of the notebook by * clicking on the page scroller arrows * clicking on one of the major tab buttons (fruits or vegetables) * clicking on one of the minor tab buttons (green or orange) A status area appears when the current page number is 2. .PP For details on the code, see Chapter 8 of the "OSF/Motif Programmer's Guide." �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Notebook/README���������������������������������������������0000644�0001750�0001750�00000000517�12672140200�017263� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:57:48 drk $ */ README File for notebook Example The notebook example demonstrates a simple use of the XmNotebook widget. To run the program, just type: $ notebook For an explanation of how this program works, see Chapter 8 of the "OSF/Motif Programmer's Guide." ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Notebook/Makefile.am����������������������������������������0000644�0001750�0001750�00000000470�13145162623�020446� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README notebook.man noinst_PROGRAMS = notebook notebook_SOURCES = interface.c notebook.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Makefile.in�������������������������������������������������0000644�0001750�0001750�00000046477�13211512765�016720� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/doc/programGuide/ch08 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = Container Notebook all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch08/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch08/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Container/��������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�016621� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Container/interface.c���������������������������������������0000644�0001750�0001750�00000011374�12672140200�020654� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: interface.c /main/4 1995/07/15 20:39:56 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmAll.h> void CreateMenus(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); extern Widget top_level; /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, (XtPointer)1); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB: This function is called when the user requests help. This function displays a Message DialogBox. *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { int what_kind_of_help = (int)cd; char help_string[400]; XmString hs_as_cs; Widget dialog_general_help; Arg arg[3]; sprintf(help_string, "This program demonstrates how to use an XmContainer in an application.\n\ You can toggle the arrows to expand or collapse the hierarchy underneath.\n\ When you click on any label (like President), the application calls \n\ a callback. The callback merely prints the word 'Ring!' to standard output."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); dialog_general_help = (Widget)XmCreateMessageDialog(top_level, "message", arg, 1); XmStringFree(hs_as_cs); switch (what_kind_of_help) { case 1: XtManageChild(dialog_general_help); break; default: /* no other help */ break; } } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Container/container.man�������������������������������������0000644�0001750�0001750�00000002745�12672140200�021231� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: container.man /main/4 1995/07/17 10:45:00 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH container 1X MOTIF "Demonstration programs" .SH NAME \*Lcontainer\*O\(emDemonstrates how to use XmContainer in a simple application .SH SYNOPSIS .sS \*LContainer\*O .sE .SH DESCRIPTION \*Lcontainer\*O illustrates how to place an XmContainer into an application. The XmContainer in the application displays an organizational chart for a small company. You can toggle the arrows to expand or collapse portions of the chart. .PP For details on the code, see Chapter 8 of the "OSF/Motif Programmer's Guide." ���������������������������motif-2.3.8/demos/doc/programGuide/ch08/Container/Makefile.in���������������������������������������0000644�0001750�0001750�00000045464�13211512765�020635� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = container$(EXEEXT) subdir = demos/doc/programGuide/ch08/Container ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_container_OBJECTS = container.$(OBJEXT) interface.$(OBJEXT) container_OBJECTS = $(am_container_OBJECTS) container_LDADD = $(LDADD) container_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(container_SOURCES) DIST_SOURCES = $(container_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README container.man container_SOURCES = container.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch08/Container/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch08/Container/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list container$(EXEEXT): $(container_OBJECTS) $(container_DEPENDENCIES) $(EXTRA_container_DEPENDENCIES) @rm -f container$(EXEEXT) $(AM_V_CCLD)$(LINK) $(container_OBJECTS) $(container_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/container.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Container/container.c���������������������������������������0000644�0001750�0001750�00000007213�12672140200�020673� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: container.c /main/5 1995/07/15 20:39:52 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <Xm/XmAll.h> #include <Xmd/RegEdit.h> void CreateContainer(Widget); void MakeACall(Widget, XtPointer, XtPointer); extern void CreateMenus(Widget); extern void HelpCB(Widget, XtPointer, XtPointer); extern void QuitCB(Widget, XtPointer, XtPointer); Widget top_level; #define APP_CLASS "XmdContainer" static String fallbacks[] = { "container.allowShellResize: True", "container*fontList: fixed", NULL }; int main(int argc, char **argv) { XtAppContext app_context; Widget main_window; XtSetLanguageProc(NULL, NULL, NULL); top_level = XtVaOpenApplication(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, NULL); XmdRegisterEditres(top_level); main_window = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, top_level, NULL); CreateMenus(main_window); CreateContainer(main_window); XtRealizeWidget(top_level); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } void MakeACall(Widget w, XtPointer client_data, XtPointer call_data) { printf("Ring!\n"); } void CreateContainer(Widget parent_of_container) { Widget container1; Widget president, vice_president, dir_of_sales, dir_of_rnd, dir_of_mfr; container1 = XtVaCreateWidget("Container", xmContainerWidgetClass, parent_of_container, XmNlayoutType, XmOUTLINE, XmNselectionPolicy, XmBROWSE_SELECT, XmNautomaticSelection, XmNO_AUTO_SELECT, XmNentryViewType, XmSMALL_ICON, NULL); XtAddCallback(container1, XmNselectionCallback, MakeACall, (XtPointer)NULL); president = XtVaCreateManagedWidget("President", xmIconGadgetClass, container1, XmNoutlineState, XmEXPANDED, NULL); vice_president = XtVaCreateManagedWidget("Vice-President", xmIconGadgetClass, container1, XmNentryParent, president, XmNoutlineState, XmEXPANDED, NULL); dir_of_sales = XtVaCreateManagedWidget("Director of Sales", xmIconGadgetClass, container1, XmNentryParent, vice_president, NULL); dir_of_rnd = XtVaCreateManagedWidget("Director of R&D", xmIconGadgetClass, container1, XmNentryParent, vice_president, NULL); dir_of_mfr = XtVaCreateManagedWidget("Director of Manufacturing", xmIconGadgetClass, container1, XmNentryParent, vice_president, NULL); XtManageChild(container1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Container/README��������������������������������������������0000644�0001750�0001750�00000000523�12672140200�017422� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:57:25 drk $ */ README File for container Example The container example demonstrates a simple use of the XmContainer widget. To run the program, just type: $ container For an explanation of how this program works, see Chapter 8 of the "OSF/Motif Programmer's Guide." �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Container/Makefile.am���������������������������������������0000644�0001750�0001750�00000000474�13145162623�020614� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README container.man noinst_PROGRAMS = container container_SOURCES = container.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch08/Makefile.am�������������������������������������������������0000644�0001750�0001750�00000000102�12672140200�016645� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = Container Notebook ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014675� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/Makefile.in�������������������������������������������������0000644�0001750�0001750�00000046500�13211512765�016701� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/doc/programGuide/ch06 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = combo_box spin_box all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch06/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch06/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/combo_box/��������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�016644� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/combo_box/interface.c���������������������������������������0000644�0001750�0001750�00000011346�12672140200�020676� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: interface.c /main/4 1995/07/15 20:39:38 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmAll.h> void CreateMenus(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); extern Widget top_level; /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, (XtPointer)1); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB: This function is called when the user requests help. This function displays a Message DialogBox. *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { int what_kind_of_help = (int)cd; char help_string[400]; XmString hs_as_cs; Widget dialog_general_help; Arg arg[3]; sprintf(help_string, "This program demonstrates how to use an XmComboBox in an application.\n\ You can make a selection by typing it directly into the TextField\n\ or by selecting the item from the DropDown list. To make the list\n\ drop down, click on the arrow that appears next to the TextField."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); dialog_general_help = (Widget)XmCreateMessageDialog(top_level, "message", arg, 1); XmStringFree(hs_as_cs); switch (what_kind_of_help) { case 1: XtManageChild(dialog_general_help); break; default: /* no other help */ break; } } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/combo_box/Makefile.in���������������������������������������0000644�0001750�0001750�00000045463�13211512765�020657� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = combo_box$(EXEEXT) subdir = demos/doc/programGuide/ch06/combo_box ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_combo_box_OBJECTS = combo_box.$(OBJEXT) interface.$(OBJEXT) combo_box_OBJECTS = $(am_combo_box_OBJECTS) combo_box_LDADD = $(LDADD) combo_box_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(combo_box_SOURCES) DIST_SOURCES = $(combo_box_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README combo_box.man combo_box_SOURCES = combo_box.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch06/combo_box/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch06/combo_box/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list combo_box$(EXEEXT): $(combo_box_OBJECTS) $(combo_box_DEPENDENCIES) $(EXTRA_combo_box_DEPENDENCIES) @rm -f combo_box$(EXEEXT) $(AM_V_CCLD)$(LINK) $(combo_box_OBJECTS) $(combo_box_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/combo_box.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/combo_box/combo_box.man�������������������������������������0000644�0001750�0001750�00000003115�12672140200�021231� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: combo_box.man /main/4 1995/07/17 10:44:48 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH combo_box 1X MOTIF "Demonstration programs" .SH NAME \*Lcombo_box\*O\(emDemonstrates how to use XmComboBox in a simple application .SH SYNOPSIS .sS \*Lcombo_box\*O .sE .SH DESCRIPTION \*Lcombo_box\*O illustrates how to place an XmComboBox into an application. The XmComboBox in the application is of type XmDROP_DOWN_COMBO_BOX. You can make a selection by typing it directly into the TextField or by selecting the item from the DropDown list. To make the list drop down, click on the arrow that appears next to the TextField. .PP For details on the code, see Chapter 6 of the "OSF/Motif Programmer's Guide." ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/combo_box/README��������������������������������������������0000644�0001750�0001750�00000000522�12672140200�017444� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:56:41 drk $ */ README File for combo_box Example The combo_box example demonstrates a simple use of the XmComboBox widget. To run the program, just type: $ combo_box For an explanation of how this program works, see Chapter 6 of the "OSF/Motif Programmer's Guide." ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/combo_box/combo_box.c���������������������������������������0000644�0001750�0001750�00000010475�12672140200�020707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: combo_box.c /main/5 1995/07/15 20:39:34 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <Xm/XmAll.h> #include <Xmd/RegEdit.h> void CreateComboBox(Widget); extern void CreateMenus(Widget); extern void SelectionCB(Widget, XtPointer, XtPointer); extern void HelpCB(Widget, XtPointer, XtPointer); extern void QuitCB(Widget, XtPointer, XtPointer); Widget top_level; #define APP_CLASS "XmdComboBox" static String fallbacks[] = { "combobox.allowShellResize: True", "combobox*fontList: fixed", NULL }; int main(int argc, char **argv) { XtAppContext app_context; Widget main_window; XtSetLanguageProc(NULL, NULL, NULL); top_level = XtVaOpenApplication(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, NULL); XmdRegisterEditres(top_level); main_window = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, top_level, NULL); CreateMenus(main_window); CreateComboBox(main_window); XtRealizeWidget(top_level); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } void CreateComboBox(Widget parent_of_combo_box) { #define NUM_LIST_ITEMS 5 Widget comboBox; Arg args[10]; Cardinal n, i; XmString ListItem[NUM_LIST_ITEMS]; static char *ListString[] = { "kiwi", "raspberry", "carambola", "litchi", "coconut" }; /* Create a list of XmStrings for the ComboBox List child */ for (i=0; i < NUM_LIST_ITEMS; i++) ListItem[i] = XmStringCreate (ListString[i], XmSTRING_DEFAULT_CHARSET); /* Create a ComboBox of type XmDROP_DOWN_COMBO_BOX. */ /* Resources passed to ComboBox are passed on to the * children of ComboBox. So, in the argument list * below, the resources, XmNitems, and XmNitemCount * will be passed on to the List child of ComboBox. */ n=0; XtSetArg (args[n], XmNcomboBoxType, XmDROP_DOWN_COMBO_BOX); n++; XtSetArg (args[n], XmNarrowSpacing, 5); n++; XtSetArg (args[n], XmNitems, ListItem); n++; XtSetArg (args[n], XmNitemCount, NUM_LIST_ITEMS); n++; comboBox = XmCreateComboBox (parent_of_combo_box, "ComboBox", args, n); XtManageChild (comboBox); XtAddCallback (comboBox, XmNselectionCallback, SelectionCB, (XtPointer)NULL); /* Example of manipulating a child widget directly to set the * visibleItemCount on the list. */ n=0; XtSetArg (args[n], XmNvisibleItemCount, 5); n++; XtSetValues (XtNameToWidget (comboBox,"*List"), args, n); } void SelectionCB (Widget w, XtPointer client_data, XtPointer call_data) { XmComboBoxCallbackStruct *cb = (XmComboBoxCallbackStruct *)call_data; XmStringCharSet charset; XmStringDirection direction; XmStringContext context; Boolean separator; char *item; /* This callback procedure prints the item that was just selected. */ /* Retrieve the selected text string from XmString. */ item = XmStringUnparse(cb->item_or_text, NULL, XmCHARSET_TEXT, XmCHARSET_TEXT, NULL, 0, XmOUTPUT_ALL); printf ("ComboBox SelectionCB: item = %s\n\n", item); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/combo_box/Makefile.am���������������������������������������0000644�0001750�0001750�00000000474�13145162623�020637� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README combo_box.man noinst_PROGRAMS = combo_box combo_box_SOURCES = combo_box.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/spin_box/���������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�016516� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/spin_box/spin_box.c�����������������������������������������0000644�0001750�0001750�00000052074�12672140200�020434� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: spin_box.c /main/5 1995/07/15 20:39:47 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> /* #include <X11/Xos.h> */ #include <Xm/XmAll.h> #include <Xmd/RegEdit.h> #define NUM_MONTHS 12 #define NUM_LETTERS 10 #define Y_OFFSET 50 #define SPIN1_MIN 0 #define SPIN1_MAX 6 /* * Externaly declared functions */ void CreateMenus(Widget); void setMonths(void); void setLetters(void); void printReason(int reason); void setMaxDay(Widget monthWidget, int nextMM); void changedSpin0(Widget w, XtPointer client, XtPointer call); void changedSpin1(Widget w, XtPointer client, XtPointer call); void changedSpin6(Widget w, XtPointer client, XtPointer call); void modifySpin1(Widget w, XtPointer client, XtPointer call); void modifySpin4(Widget w, XtPointer client, XtPointer call); void demoExit(Widget w, XtPointer client, XtPointer call); int main(int argc, char **argv); void CreateSpinBoxes(Widget parent_of_spin_box); int thisMM = 3; int thisDD = 27; int thisYY = 94; static char *months[NUM_MONTHS] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; static char *letters[NUM_LETTERS] = { "a", "b", "c", "d", "e", "f", "g", "f", "h", "i" }; XmString monthValues[NUM_MONTHS]; XmString letterValues[NUM_LETTERS]; /***** SpinBox Widgets *****/ Widget spin0, spin0_text, spin1, spin1_text, spin2, spin2_text; Widget spin3, spin3_text, spin4, spin4_text, spin5, spin5_text; Widget spin6, spin6_text1, spin6_deco1, spin6_text2, spin6_deco2; Widget spin6_text3; Widget top_level; #define APP_CLASS "XmdSpinBox" static String fallbacks[] = { "spinbox.allowShellResize: True", "spinbox*fontList: fixed", NULL }; /* main() */ int main (int argc, char **argv) { XtAppContext app; Display *display; XtAppContext app_context; Widget main_window; XtSetLanguageProc(NULL, NULL, NULL); top_level = XtVaOpenApplication(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, NULL); XmdRegisterEditres(top_level); main_window = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, top_level, NULL); CreateMenus(main_window); CreateSpinBoxes(main_window); XtRealizeWidget(top_level); XtAppMainLoop(app_context); exit(0); } void CreateSpinBoxes(Widget parent_of_spin_box) { Cardinal n; Position nextY; Arg argList[25]; Widget parent; XmString decoString; /***** Set Y position for next SpinBox *****/ nextY = 10; /***** Create BulletinBoard parent for SpinBox widgets *****/ n = 0; XtSetArg(argList[n], XmNwidth, 250); n++; XtSetArg(argList[n], XmNheight, 400); n++; parent = XmCreateBulletinBoard(parent_of_spin_box, "Parent", argList, n); XtManageChild(parent); /****************************************************************/ /***** ***** Create SpinBox spin0 ***** ***** Choices: months of the year ***** ***** Callbacks: ***** - changedSpin0 Prints string desription of callback ***** reason, and prints 'new' year when boundary ***** is crossed (January to December, decrement year; ***** December to January, increment year); *****/ /***** Create SpinBox parent *****/ n = 0; XtSetArg(argList[n], XmNy, nextY); n++; spin0 = XmCreateSpinBox(parent, "spin0", argList, n); /***** Increment Y position for next SpinBox *****/ nextY += Y_OFFSET; /***** Create XmString array of month names *****/ setMonths(); /***** Create TextField child *****/ n = 0; XtSetArg(argList[n], XmNvalues, monthValues); n++; XtSetArg(argList[n], XmNnumValues, 12); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmSTRING); n++; XtSetArg(argList[n], XmNselectionPolicy, XmSINGLE_SELECT); n++; XtSetArg(argList[n], XmNeditable, False); n++; spin0_text = XmCreateTextField(spin0, "spin0_text", argList, n); /***** Manage SpinBox *****/ XtManageChild(spin0); /***** Call changedSpin0 AFTER displayed value has changed *****/ XtAddCallback(spin0, XmNvalueChangedCallback, changedSpin0, (XtPointer) 0); /***** Manage SpinBox child *****/ XtManageChild(spin0_text); /***** End of SpinBox spin0 *****/ /***** ***** Create SpinBox spin1 ***** ***** Choices: letters of the alphabet ***** ***** Callbacks: ***** - modifySpin1 Callback prevents spinning beyond ***** positions 0 (letter a) and 6 (letter g) ***** ***** - changedSpin1 Sets arrow sensitivity to inhibit wrapping ***** *****/ /***** Create SpinBox parent *****/ n = 0; XtSetArg(argList[n], XmNy, nextY); n++; XtSetArg(argList[n], XmNdefaultArrowSensitivity, XmARROWS_DECREMENT_SENSITIVE); n++; spin1 = XmCreateSpinBox(parent, "spin1", argList, n); /***** Increment Y position for next SpinBox *****/ nextY += Y_OFFSET; /***** Create XmString array of single letters *****/ setLetters(); /***** Create SpinBox child *****/ n = 0; XtSetArg(argList[n], XmNvalues, letterValues); n++; XtSetArg(argList[n], XmNnumValues, NUM_LETTERS); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmSTRING); n++; XtSetArg(argList[n], XmNarrowSensitivity, XmARROWS_INCREMENT_SENSITIVE); n++; XtSetArg(argList[n], XmNeditable, False); n++; spin1_text = XmCreateTextField(spin1, "spin0_text", argList, n); /***** Manage SpinBox *****/ XtManageChild(spin1); /***** Call modifySpin1 BEFORE displayed value is changed *****/ XtAddCallback(spin1, XmNmodifyVerifyCallback, modifySpin1, (XtPointer) 0); /***** Call changedSpin1 AFTER displayed value has changed *****/ XtAddCallback(spin1, XmNvalueChangedCallback, changedSpin1, (XtPointer) 0); /***** Manage SpinBox child *****/ XtManageChild(spin1_text); /***** End of SpinBox spin1 *****/ /***** ***** Create SpinBox spin2 ***** ***** Choices: 0.0000 to 0.0010 by .0002 ***** ***** Initial Position: 4 (displays 0.0008) ***** ***** Callbacks: none ***** *****/ /***** Create SpinBox parent *****/ n = 0; XtSetArg(argList[n], XmNy, nextY); n++; spin2 = XmCreateSpinBox( parent, "spin2", argList, n ); /***** Increment Y position for next SpinBox *****/ nextY += Y_OFFSET; n = 0; XtSetArg(argList[n], XmNposition, 4); n++; XtSetArg(argList[n], XmNdecimalPoints, 4); n++; XtSetArg(argList[n], XmNincrementValue, 2); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmNUMERIC); n++; XtSetArg(argList[n], XmNeditable, False); n++; spin2_text = XmCreateTextField( spin2, "spin2_text", argList, n ); /***** Manage SpinBox *****/ XtManageChild(spin2); /***** Manage SpinBox child *****/ XtManageChild(spin2_text); /***** End of SpinBox spin2 *****/ /***** ***** Create SpinBox spin3 ***** ***** Choices: 0.000 to 121.500 by 0.002 ***** ***** Callbacks: none ***** *****/ /***** Create SpinBox parent *****/ n = 0; XtSetArg(argList[n], XmNy, nextY); n++; XtSetArg(argList[n], XmNrepeatDelay, 250); n++; XtSetArg(argList[n], XmNarrowLayout, XmARROWS_BEGINNING); n++; spin3 = XmCreateSpinBox( parent, "spin3", argList, n ); /***** Increment Y position for next SpinBox *****/ nextY += Y_OFFSET; n = 0; XtSetArg(argList[n], XmNminimumValue, 0); n++; XtSetArg(argList[n], XmNdecimalPoints, 3); n++; XtSetArg(argList[n], XmNincrementValue, 2); n++; XtSetArg(argList[n], XmNmaximumValue, 121500); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmNUMERIC); n++; spin3_text = XmCreateTextField( spin3, "spin3_text", argList, n ); /***** Manage SpinBox *****/ XtManageChild(spin3); /***** Manage SpinBox child *****/ XtManageChild(spin3_text); /***** End of SpinBox spin3 *****/ /***** ***** Create SpinBox spin4 ***** ***** Choices: 0 to 10 by 1 ***** ***** Callbacks: ***** - modifySpin4 Callback inhibits spinning below 0 ***** at all times. Wrapping increments the maximum value. ***** *****/ /***** Create SpinBox parent *****/ n = 0; XtSetArg(argList[n], XmNy, nextY); n++; XtSetArg(argList[n], XmNarrowSize, 35); n++; XtSetArg(argList[n], XmNrepeatDelay, 250); n++; XtSetArg(argList[n], XmNinitialDelay, 500); n++; XtSetArg(argList[n], XmNarrowLayout, XmARROWS_SPLIT); n++; spin4 = XmCreateSpinBox( parent, "spin4", argList, n ); /***** Increment Y position for next SpinBox *****/ nextY += Y_OFFSET; n = 0; XtSetArg(argList[n], XmNmaximumValue, 4); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmNUMERIC); n++; spin4_text = XmCreateTextField( spin4, "spin4_text", argList, n ); /***** Manage SpinBox *****/ XtManageChild(spin4); /***** Call modifySpin4 BEFORE displayed value is changed *****/ XtAddCallback(spin4, XmNmodifyVerifyCallback, modifySpin4, (XtPointer) 0); /***** Manage SpinBox child *****/ XtManageChild(spin4_text); /***** End of SpinBox spin4 *****/ /***** ***** Create SpinBox spin5 ***** ***** Choices: 0 to 10 by 1 ***** ***** Delay: Repeat delay is 0 - displayed value only increments ***** or decrements ONCE each time arrow is armed ***** ***** Callbacks: none ***** *****/ /***** Create SpinBox parent *****/ n = 0; XtSetArg(argList[n], XmNy, nextY); n++; XtSetArg(argList[n], XmNarrowSize, 20); n++; XtSetArg(argList[n], XmNrepeatDelay, 0); n++; XtSetArg(argList[n], XmNarrowLayout, XmARROWS_BEGINNING); n++; spin5 = XmCreateSpinBox( parent, "spin5", argList, n ); /***** Increment Y position for next SpinBox *****/ nextY += Y_OFFSET; n = 0; XtSetArg(argList[n], XmNminimumValue, 1); n++; XtSetArg(argList[n], XmNposition, 1); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmNUMERIC); n++; XtSetArg(argList[n], XmNeditable, False); n++; spin5_text = XmCreateTextField( spin5, "spin5_text", argList, n ); /***** Manage SpinBox *****/ XtManageChild(spin5); /***** Manage SpinBox child *****/ XtManageChild(spin5_text); /***** End of SpinBox spin5 *****/ /***** ***** Create SpinBox spin6 ***** ***** This example has multiple children, including two ***** decoration children. In addition, this SpinBox ***** includes 'chaining', the process where a change ***** in one child causes values to change in the child ***** and on or more other children. Chaining is performed ***** by the valueChanged callback. ***** ***** Choices: spin6_text1 1 to 12 (months) ***** spin6_deco1 '/' decoration ***** spin6_text2 1 to 28-31 (max days varies by month) ***** spin6_deco2 '/' decoration ***** spin6_text3 0 to 99 (years) ***** ***** Callbacks: ***** - changedSpin6 sets maximum days in month. The month field ***** is chained to the day field, and the year field is ***** chained to the month field. (When the day child ***** wraps, the month child is also changed. When the ***** month child wraps, the year child is also changed.) ***** *****/ /***** Create SpinBox parent *****/ n = 0; XtSetArg(argList[n], XmNy, nextY); n++; XtSetArg(argList[n], XmNinitialDelay, 0); n++; XtSetArg(argList[n], XmNrepeatDelay, 150); n++; spin6 = XmCreateSpinBox( parent, "spin6", argList, n ); /***** Increment Y position for next SpinBox *****/ nextY += Y_OFFSET; /***** Create SpinBox child *****/ n = 0; XtSetArg(argList[n], XmNwidth, 30); n++; XtSetArg(argList[n], XmNposition, thisMM - 1); n++; XtSetArg(argList[n], XmNminimumValue, 1); n++; XtSetArg(argList[n], XmNmaximumValue, 12); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmNUMERIC); n++; spin6_text1 = XmCreateTextField( spin6, "spin6_text1", argList, n ); /***** Create SpinBox decoration child *****/ n = 0; decoString = XmStringCreateLtoR("/", XmSTRING_DEFAULT_CHARSET); XtSetArg(argList[n], XmNlabelString, decoString); n++; spin6_deco1 = XmCreateLabel( spin6, "spin6_deco1", argList, n ); /***** Create SpinBox child *****/ n = 0; XtSetArg(argList[n], XmNwidth, 30); n++; XtSetArg(argList[n], XmNposition, thisDD - 1); n++; XtSetArg(argList[n], XmNminimumValue, 1); n++; XtSetArg(argList[n], XmNmaximumValue, 31); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmNUMERIC); n++; spin6_text2 = XmCreateTextField( spin6, "spin6_text2", argList, n ); /***** Create SpinBox decoration child *****/ n = 0; decoString = XmStringCreateLtoR("/", XmSTRING_DEFAULT_CHARSET); XtSetArg(argList[n], XmNlabelString, decoString); n++; spin6_deco2 = XmCreateLabel( spin6, "spin6_deco2", argList, n ); XmStringFree(decoString); /***** Create SpinBox child *****/ n = 0; XtSetArg(argList[n], XmNwidth, 30); n++; XtSetArg(argList[n], XmNposition, thisYY); n++; XtSetArg(argList[n], XmNmaximumValue, 99); n++; XtSetArg(argList[n], XmNspinBoxChildType, XmNUMERIC); n++; spin6_text3 = XmCreateTextField( spin6, "spin6_text3", argList, n ); /***** Manage SpinBox *****/ XtManageChild(spin6); /***** Call changedSpin6 AFTER displayed value has changed *****/ XtAddCallback(spin6, XmNvalueChangedCallback, changedSpin6, (XtPointer) 0); /***** Manage SpinBox children *****/ XtManageChild(spin6_text1); XtManageChild(spin6_deco1); XtManageChild(spin6_text2); XtManageChild(spin6_deco2); XtManageChild(spin6_text3); /***** End of SpinBox spin6 *****/ } /***** *****/ /***** Utility Functions *****/ /***** *****/ /***** ***** setMonths - create XmString array of month names *****/ void setMonths() { XmString tempString; int monthLoop; for (monthLoop = 0; monthLoop < NUM_MONTHS; monthLoop++) { tempString = XmStringCreate(months[monthLoop], XmFONTLIST_DEFAULT_TAG); monthValues[monthLoop] = tempString; } } /***** ***** setLetters - create XmString array of single letters *****/ void setLetters() { XmString tempString; int letterLoop; for (letterLoop = 0; letterLoop < NUM_LETTERS; letterLoop++) { tempString = XmStringCreate(letters[letterLoop], XmFONTLIST_DEFAULT_TAG); letterValues[letterLoop] = tempString; } } /***** ***** printReason - print string description of callback reason *****/ void printReason(int reason) { printf("reason = "); switch(reason) { case XmCR_SPIN_NEXT: printf("XmCR_SPIN_NEXT"); break; case XmCR_SPIN_PRIOR: printf("XmCR_SPIN_PRIOR"); break; case XmCR_SPIN_FIRST: printf("XmCR_SPIN_FIRST"); break; case XmCR_SPIN_LAST: printf("XmCR_SPIN_LAST"); break; case XmCR_OK: printf("XmCR_OK"); break; default: printf("** unknown ** (%d)", reason); break; } printf("\n"); } /***** ***** setMaxDay - set maximumValue for day widget *****/ void setMaxDay(Widget monthWidget, int nextMM) { Cardinal n; Arg argList[5]; int lastDay; if (nextMM == 2) { if (thisYY %4 == 0 && thisYY %400 != 0) lastDay = 29; else lastDay = 28; } else if (nextMM == 4 || nextMM == 6 || nextMM == 9 || nextMM == 11) lastDay = 30; else lastDay = 31; n = 0; XtSetArg(argList[n], XmNmaximumValue, lastDay); n++; XtSetValues(monthWidget, argList, n); } /***** *****/ /***** Callback Functions *****/ /***** *****/ void changedSpin0(Widget w, XtPointer client, XtPointer call) { XmSpinBoxCallbackStruct *user; static int thisYear = 1994; user = (XmSpinBoxCallbackStruct *)call; /***** Print string description of reason *****/ printReason(user->reason); if (user->crossed_boundary) { if (user->reason == XmCR_SPIN_NEXT) thisYear++; else thisYear--; printf("Year Now: %d\n", thisYear); } } void changedSpin1(Widget w, XtPointer client, XtPointer call) { XmSpinBoxCallbackStruct *user; Cardinal n; Arg argList[5]; user = (XmSpinBoxCallbackStruct *)call; n = 0; if (user->position == SPIN1_MAX) XtSetArg( argList[n], XmNarrowSensitivity, XmARROWS_DECREMENT_SENSITIVE ); else if (user->position == SPIN1_MIN) XtSetArg( argList[n], XmNarrowSensitivity, XmARROWS_INCREMENT_SENSITIVE ); else XtSetArg(argList[n], XmNarrowSensitivity, XmARROWS_SENSITIVE); n++; XtSetValues(user->widget, argList, n); } void changedSpin6(Widget w, XtPointer client, XtPointer call) { XmSpinBoxCallbackStruct *user; Cardinal n; Arg argList[5]; int saveMM; int saveDD; int saveYY; user = (XmSpinBoxCallbackStruct *)call; if (user->widget == spin6_text1) { thisMM = user->position + 1; if (thisDD <=3 ) setMaxDay(spin6_text2, thisMM -1); else if (thisDD > 27) setMaxDay(spin6_text2, thisMM); saveYY = thisYY; if (user->crossed_boundary) { if (user->reason == XmCR_SPIN_NEXT) thisYY++; else thisYY--; } if (thisYY != saveYY) { if (thisYY < 0) thisYY = 99; else if (thisYY > 99) thisYY %= 100; n = 0; XtSetArg(argList[n], XmNposition, thisYY); n++; XtSetValues(spin6_text3, argList, n); } } else if (user->widget == spin6_text2) { thisDD = user->position + 1; if (thisDD <=3 && user->reason == XmCR_SPIN_PRIOR) setMaxDay(spin6_text2, thisMM -1); else if (thisDD > 27 && user->reason == XmCR_SPIN_NEXT) setMaxDay(spin6_text2, thisMM); saveMM = thisMM; saveYY = thisYY; if (user->crossed_boundary) { if (user->reason == XmCR_SPIN_NEXT) thisMM++; else thisMM--; } if (thisMM != saveMM) { if (thisMM < 1) { thisMM = 12; thisYY--; } else if (thisMM > 12) { thisMM = 1; thisYY++; } n = 0; XtSetArg(argList[n], XmNposition, thisMM - 1); n++; XtSetValues(spin6_text1, argList, n); if (thisYY != saveYY) { n = 0; XtSetArg(argList[n], XmNposition, thisYY); n++; XtSetValues(spin6_text3, argList, n); } } } else if (user->widget == spin6_text3) { thisYY = user->position; if (user->reason == XmCR_OK) { if (thisDD <= 3) setMaxDay(spin6_text2, thisMM - 1); else if (thisDD > 27) setMaxDay(spin6_text2, thisMM); } } } void modifySpin1(Widget w, XtPointer client, XtPointer call) { XmSpinBoxCallbackStruct *user; user = (XmSpinBoxCallbackStruct *)call; if (user->position > SPIN1_MAX) user->doit = False; else /***** Print string description of reason *****/ printReason(user->reason); } void modifySpin4(Widget w, XtPointer client, XtPointer call) { XmSpinBoxCallbackStruct *user; int newHigh; Cardinal n; Arg argList[5]; user = (XmSpinBoxCallbackStruct *)call; if (user->crossed_boundary) { if (user->reason == XmCR_SPIN_NEXT) { n = 0; XtSetArg(argList[n], XmNmaximumValue, &newHigh); n++; XtGetValues(user->widget, argList, n); newHigh++; n = 0; XtSetArg(argList[n], XmNmaximumValue, newHigh); n++; XtSetValues(user->widget, argList, n); user->position = 0; } else if (user->reason == XmCR_SPIN_PRIOR) user->doit = False; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/spin_box/interface.c����������������������������������������0000644�0001750�0001750�00000011333�13066310437�020555� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: interface.c /main/4 1995/07/15 20:39:43 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmAll.h> void CreateMenus(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); extern Widget top_level; /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, (XtPointer)1); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB: This function is called when the user requests help. This function displays a Message DialogBox. *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { int what_kind_of_help = (int)cd; char help_string[400]; XmString hs_as_cs; Widget dialog_general_help; Arg arg[3]; sprintf(help_string, "This program demonstrates how to use an XmSpinBox in an application.\n\ The application creates seven different SpinBoxes for you to manipulate.\n\ Click the ArrowButtons next to each SpinBox in order to increment or\n\ decrement the values of the SpinBox Children."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); dialog_general_help = (Widget)XmCreateMessageDialog(top_level, "message", arg, 1); XmStringFree(hs_as_cs); switch (what_kind_of_help) { case 1: XtManageChild(dialog_general_help); break; default: /* no other help */ break; } } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/spin_box/Makefile.in����������������������������������������0000644�0001750�0001750�00000045434�13211512765�020527� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = spin_box$(EXEEXT) subdir = demos/doc/programGuide/ch06/spin_box ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_spin_box_OBJECTS = spin_box.$(OBJEXT) interface.$(OBJEXT) spin_box_OBJECTS = $(am_spin_box_OBJECTS) spin_box_LDADD = $(LDADD) spin_box_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(spin_box_SOURCES) DIST_SOURCES = $(spin_box_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README spin_box.man spin_box_SOURCES = spin_box.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch06/spin_box/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch06/spin_box/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list spin_box$(EXEEXT): $(spin_box_OBJECTS) $(spin_box_DEPENDENCIES) $(EXTRA_spin_box_DEPENDENCIES) @rm -f spin_box$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spin_box_OBJECTS) $(spin_box_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spin_box.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/spin_box/spin_box.man���������������������������������������0000644�0001750�0001750�00000002765�12672140200�020767� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: spin_box.man /main/4 1995/07/17 10:44:54 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH spin_box 1X MOTIF "Demonstration programs" .SH NAME \*Lspin_box\*O\(emDemonstrates how to use XmSpinBox in a simple application .SH SYNOPSIS .sS \*Lspin_box\*O .sE .SH DESCRIPTION \*Lspin_box\*O illustrates how to use an XmComboBox into an application. The application creates seven different SpinBoxes for you to manipulate. Click the ArrowButtons next to each SpinBox in order to increment or decrement the values of the SpinBox Children. .PP For details on the code, see Chapter 6 of the "OSF/Motif Programmer's Guide." �����������motif-2.3.8/demos/doc/programGuide/ch06/spin_box/README���������������������������������������������0000644�0001750�0001750�00000000522�12672140200�017316� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:57:06 drk $ */ README File for spin_box Example The spin_box example demonstrates some simple uses of the XmSpinBox widget. To run the program, just type: $ spin_box For an explanation of how this program works, see Chapter 6 of the "OSF/Motif Programmer's Guide." ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/spin_box/Makefile.am����������������������������������������0000644�0001750�0001750�00000000470�13145162623�020505� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README spin_box.man noinst_PROGRAMS = spin_box spin_box_SOURCES = spin_box.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch06/Makefile.am�������������������������������������������������0000644�0001750�0001750�00000000102�12672140200�016643� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = combo_box spin_box ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513010�014671� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/Makefile.in�������������������������������������������������0000644�0001750�0001750�00000046504�13211512765�016707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/doc/programGuide/ch17 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = simple_drag simple_drop all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch17/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch17/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drop/������������������������������������������������0000755�0001750�0001750�00000000000�13211513010�017206� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drop/Makefile.in�������������������������������������0000644�0001750�0001750�00000045371�13211512765�021225� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = simple_drop$(EXEEXT) subdir = demos/doc/programGuide/ch17/simple_drop ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_simple_drop_OBJECTS = simple_drop.$(OBJEXT) simple_drop_OBJECTS = $(am_simple_drop_OBJECTS) simple_drop_LDADD = $(LDADD) simple_drop_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(simple_drop_SOURCES) DIST_SOURCES = $(simple_drop_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README simple_drop.man simple_drop_SOURCES = simple_drop.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch17/simple_drop/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch17/simple_drop/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list simple_drop$(EXEEXT): $(simple_drop_OBJECTS) $(simple_drop_DEPENDENCIES) $(EXTRA_simple_drop_DEPENDENCIES) @rm -f simple_drop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simple_drop_OBJECTS) $(simple_drop_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple_drop.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drop/simple_drop.c�����������������������������������0000644�0001750�0001750�00000030166�12672140200�021624� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: simple_drop.c /main/4 1995/07/15 20:40:19 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /****************************************************************** This program demonstrates how to add support to an XmDrawingArea widget so that a pixmap can be dropped into it ******************************************************************/ #include <Xm/MainW.h> #include <Xm/Frame.h> #include <Xm/CascadeB.h> #include <Xm/MessageB.h> #include <Xm/PushBG.h> #include <Xm/RowColumn.h> #include <Xm/Label.h> #include <Xm/DrawingA.h> #include <Xm/Transfer.h> #include <Xm/TransferP.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void CreateMenus(Widget); int Play(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); void DestinationCallback(Widget, XtPointer, XtPointer); void TransferProc(Widget, XtPointer, XtPointer); void OutputAnAtomName(Widget, Atom); void ListAllTheTargets(Widget, Atom *, unsigned long); Widget toplevel; /****************************************************************** main: ******************************************************************/ int main(int argc, char **argv) { static Widget MainWindow; XtAppContext app_context; Widget Frame1, RC1, Label1, DrawingArea1; Pixmap pixmap; GC gc; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); toplevel = XtOpenApplication(&app_context, "Test", NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL, 0); MainWindow = XtVaCreateManagedWidget("MainWindow1", xmMainWindowWidgetClass, toplevel, NULL); CreateMenus(MainWindow); RC1 = XtVaCreateManagedWidget("RC1", xmRowColumnWidgetClass, MainWindow, NULL); if (!argv[1]) { printf("usage: %s bitmap-file\n", *argv); exit(1); } /* Load bitmap given in argv[1] */ pixmap = XmGetPixmap(XtScreen(toplevel), argv[1], BlackPixelOfScreen(XtScreen(toplevel)), WhitePixelOfScreen(XtScreen(toplevel))); if (pixmap == XmUNSPECIFIED_PIXMAP) { printf("can't create pixmap from %s\n", argv[1]); exit(1); } /* Now instantiate an XmLabel widget that displays pixmap. */ Label1 = XtVaCreateManagedWidget("Label1", xmLabelWidgetClass, RC1, XmNlabelType, XmPIXMAP, XmNlabelPixmap, pixmap, NULL); Frame1 = XtVaCreateManagedWidget("Frame1", xmFrameWidgetClass, RC1, XmNshadowThickness, 3, NULL); DrawingArea1 = XtVaCreateManagedWidget("DrawingArea1", xmDrawingAreaWidgetClass, Frame1, XmNwidth, 150, XmNheight, 150, XmNresizePolicy, XmRESIZE_NONE, NULL); XmeDropSink(DrawingArea1, NULL, 0); XtAddCallback(DrawingArea1, XmNdestinationCallback, DestinationCallback, NULL); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } /********************************************************************** DestinationCallback: **********************************************************************/ void DestinationCallback(Widget w, XtPointer ignore, XtPointer call_data) { XmDestinationCallbackStruct *dcs = (XmDestinationCallbackStruct *)call_data; Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Atom _MOTIF_EXPORT_TARGETS = XInternAtom(XtDisplay(w), "_MOTIF_EXPORT_TARGETS", False); printf("\n\nNow in Destination Callback.\n"); printf("\tSelection: "); OutputAnAtomName ((Widget)w, dcs->selection); /* Ask the source to return a list of all the export targets that it knows how to convert. */ XmTransferValue(dcs->transfer_id, _MOTIF_EXPORT_TARGETS, (XtCallbackProc)TransferProc, NULL, XtLastTimestampProcessed(XtDisplay(w))); } /********************************************************************** TransferProc: Called by UTM whenever a conversion routine completes a conversion that was initiated by an XmTransferValue call. **********************************************************************/ void TransferProc(Widget w, XtPointer ignore, XtPointer call_data) { XmSelectionCallbackStruct *scs = (XmSelectionCallbackStruct *) call_data; Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Atom _MOTIF_EXPORT_TARGETS = XInternAtom(XtDisplay(w), "_MOTIF_EXPORT_TARGETS", False); Atom PIXMAP = XInternAtom(XtDisplay(w), "PIXMAP", False); Atom *targets = (Atom *)scs->value; int PIXMAP_is_supported = 0; unsigned long n; Widget Label2; printf("\n\nNow in TransferProc.\n"); printf("The source has converted: "); OutputAnAtomName(w, scs->target); if ((scs->target == _MOTIF_EXPORT_TARGETS) && (scs->type == XA_ATOM)) { printf("TransferProc: target is TARGETS.\n"); printf("Number of supported targets is %ld\n", scs->length); ListAllTheTargets(w, targets, scs->length); for (n=0; n<=scs->length; n++) { /* Look through list of returned TARGETS to see if PIXMAP is there. */ if (targets[n] == PIXMAP) { printf("The source knows how to convert PIXMAP.\n"); PIXMAP_is_supported = 1; } } if (PIXMAP_is_supported) { printf("TransferProc: Asking for PIXMAP.\n"); XmTransferValue(scs->transfer_id, PIXMAP, (XtCallbackProc)TransferProc, NULL, XtLastTimestampProcessed(XtDisplay(w))); } } if ((scs->target == PIXMAP)) { Pixmap transferred_pixmap = *(Pixmap*) scs->value; Pixmap copy_of_transferred_pixmap; Window root_return; int x, y; unsigned int width, height; unsigned int border_width, depth; GC gc; XtGCMask valueMask; XGCValues values; printf("TransferProc: source has transferred the PIXMAP.\n"); printf("We need to paste it into the DrawingArea.\n"); /* It is better to display a copy of the returned pixmap than to display the returned pixmap itself. The following code creates the copy. */ XGetGeometry(XtDisplay(w), (Drawable)transferred_pixmap, &root_return, &x, &y, &width, &height, &border_width, &depth); copy_of_transferred_pixmap = XCreatePixmap(XtDisplay(w), XtWindow(w), width, height, depth); valueMask = GCFunction; values.function = GXcopy; gc = XtGetGC(w, valueMask, &values); XCopyArea(XtDisplay(w), transferred_pixmap, copy_of_transferred_pixmap, gc, x, y, width, height, x, y); Label2 = XtVaCreateManagedWidget("Label2", xmLabelWidgetClass, w, XmNlabelType, XmPIXMAP, XmNlabelPixmap, copy_of_transferred_pixmap, NULL); XtReleaseGC(w, gc); XmTransferDone(scs->transfer_id, XmTRANSFER_DONE_SUCCEED); } } /********************************************************************** OutputAnAtomName **********************************************************************/ void OutputAnAtomName(Widget w, Atom target) { char *AtomName = malloc(sizeof(char *) * 34); AtomName = XGetAtomName(XtDisplay(w), target); printf("\t%s\n", AtomName); } /********************************************************************** ListAllTheTargets **********************************************************************/ void ListAllTheTargets(Widget w, Atom *targets, unsigned long number_of_targets) { int n; printf("Here are all the targets:\n"); for (n=0; n<number_of_targets; n++) OutputAnAtomName(w, targets[n]); } /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, (XtPointer)1); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { int what_kind_of_help = (int)cd; char help_string[400]; XmString hs_as_cs; Widget dialog_general_help; Arg arg[3]; sprintf(help_string, "This program demonstrates how to add a destination callback\n\ to an application.\n\ You should drag the displayed pixmap from the Label widget\n\ and drop it inside the framed DrawingArea widget."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); dialog_general_help = (Widget)XmCreateMessageDialog(toplevel, "message", arg, 1); XmStringFree(hs_as_cs); switch (what_kind_of_help) { case 1: XtManageChild(dialog_general_help); break; default: /* no other help */ break; } } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drop/README������������������������������������������0000644�0001750�0001750�00000000631�12672140200�020015� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:59:14 drk $ */ README File for SimpleDrop Example The SimpleDrop demonstrates how a Motif application can add an XmNdestinationCallback procedure to an XmDrawingArea widget. To run the program, just type: $ SimpleDrop <pixmap_file_name> For an explanation of how this program works, see Chapter 17 of the "OSF/Motif Programmer's Guide." �������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drop/simple_drop.man���������������������������������0000644�0001750�0001750�00000003574�12672140200�022160� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: simple_drop.man /main/4 1995/07/17 10:46:05 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH simple_drop 1X MOTIF "Demonstration programs" .SH NAME \*Lsimple_drop\*O\(emDemonstrates how to add an XmNdestinationCallback to an XmDrawingArea widget .SH SYNOPSIS .sS \*Lsimple_drop\*O \*V<pixmap_file>\*O .sE .SH DESCRIPTION \*Lsimple_drop\*O illustrates how an application can add an \*LXmNdestinationCallback\*O to an \*LXmDrawingArea\*O widget. .PP You must specify the name of a \*Vpixmap_file\*O as the only argument to \*Lsimple_drop\*O. The specified \*Vpixmap_file\*O will be displayed in the Label widget. .PP You should drag the pixmap from the Label widget and drop it in the framed DrawingArea widget. The application extends the DrawingArea widget so that it can act as the destination for a pixmap transfer. After the pixmap has been successfully transferred, it will be displayed inside the DrawingArea. .PP For details on the code, see Chapter 17 of the "OSF/Motif Programmer's Guide." ������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drop/Makefile.am�������������������������������������0000644�0001750�0001750�00000000471�13145162623�021204� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README simple_drop.man noinst_PROGRAMS = simple_drop simple_drop_SOURCES = simple_drop.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drag/������������������������������������������������0000755�0001750�0001750�00000000000�13211513010�017157� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drag/simple_drag.man���������������������������������0000644�0001750�0001750�00000003461�12672140200�022075� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: simple_drag.man /main/4 1995/07/17 10:45:47 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH simple_drag 1X MOTIF "Demonstration programs" .SH NAME \*Lsimple_drag\*O\(emDemonstrates how to add an XmNconvertCallback to a ScrollBar widget .SH SYNOPSIS .sS \*Lsimple_drag\*O .sE .SH DESCRIPTION \*Lsimple_drag\*O illustrates how an application can add an \*LXmNconvertCallback\*O procedure to a Motif application. In particular, the application adds an \*LXmNconvertCallback\*O procedure to a ScrollBar widget. .PP To exercise this program, you should place the cursor on the slider of the ScrollBar. Then press <Btn2> to begin a drag operation. A DragIcon will appear. Move the DragIcon to the Text widget and 'drop' the DragIcon anywhere inside the Text widget. The application will transfer the XmNvalue of the ScrollBar to the Text widget. .PP For details on the code, see Chapter 17 of the "OSF/Motif Programmer's Guide." ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drag/Makefile.in�������������������������������������0000644�0001750�0001750�00000045371�13211512765�021176� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = simple_drag$(EXEEXT) subdir = demos/doc/programGuide/ch17/simple_drag ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_simple_drag_OBJECTS = simple_drag.$(OBJEXT) simple_drag_OBJECTS = $(am_simple_drag_OBJECTS) simple_drag_LDADD = $(LDADD) simple_drag_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(simple_drag_SOURCES) DIST_SOURCES = $(simple_drag_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README simple_drag.man simple_drag_SOURCES = simple_drag.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch17/simple_drag/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch17/simple_drag/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list simple_drag$(EXEEXT): $(simple_drag_OBJECTS) $(simple_drag_DEPENDENCIES) $(EXTRA_simple_drag_DEPENDENCIES) @rm -f simple_drag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simple_drag_OBJECTS) $(simple_drag_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple_drag.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drag/simple_drag.c�����������������������������������0000644�0001750�0001750�00000025773�12672140200�021556� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: simple_drag.c /main/4 1995/07/15 20:40:14 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <Xm/MainW.h> #include <Xm/CascadeB.h> #include <Xm/MessageB.h> #include <Xm/PushBG.h> #include <Xm/RowColumn.h> #include <Xm/ScrollBar.h> #include <Xm/Text.h> #include <Xm/TransferP.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void CreateMenus(Widget); int Play(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); void OutputAnAtomName(Widget, Atom); void StartDrag(Widget, XEvent *); void ConvertCallback(Widget, XtPointer, XtPointer); Widget toplevel; /****************************************************************** main: ******************************************************************/ int main(int argc, char **argv) { static Widget MainWindow; XtAppContext app_context; Widget Frame1, RC1; Widget Text1, ScrollBar1; char dragTranslations[] = "#override <Btn2Down>: StartDrag()"; static XtActionsRec dragActions[] = { {"StartDrag", (XtActionProc)StartDrag} }; XtTranslations parsed_xlations; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); toplevel = XtOpenApplication(&app_context, "Test", NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL, 0); MainWindow = XtVaCreateManagedWidget("MainWindow1", xmMainWindowWidgetClass, toplevel, NULL); CreateMenus(MainWindow); /* Create a RowColumn to contain the ScrollBar and Text widgets. */ RC1 = XtVaCreateManagedWidget("RC1", xmRowColumnWidgetClass, MainWindow, NULL); /* Create a ScrollBar. */ parsed_xlations = XtParseTranslationTable(dragTranslations); XtAppAddActions(app_context, dragActions, XtNumber(dragActions)); ScrollBar1 = XtVaCreateManagedWidget("SB1", xmScrollBarWidgetClass, RC1, XmNorientation, XmHORIZONTAL, XmNtranslations, parsed_xlations, NULL); /* Associate a convert callback with the ScrollBar. */ XtAddCallback(ScrollBar1, XmNconvertCallback, ConvertCallback, NULL); /* Create a text widget; it will be a potential drop site. */ Text1 = XtVaCreateManagedWidget("Text", xmTextWidgetClass, RC1, XmNeditMode, XmMULTI_LINE_EDIT, XmNrows, 25, XmNcolumns, 25, NULL); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } /************************************************************************** StartDrag: When the user presses <Btn2Down>, this routine will be called. **************************************************************************/ void StartDrag(Widget w, XEvent *event) { Arg args[2]; Cardinal n=0; XtSetArg(args[n], XmNdragOperations, XmDROP_COPY); n++; XmeDragSource(w, NULL, event, args, n); } /********************************************************************** ConvertCallback: Handles requests to convert targets. Actually, our ConvertCallback procedure only knows how to convert the following targets: * MOTIF_EXPORT_TARGETS * TARGETS * COMPOUND_TEXT **********************************************************************/ void ConvertCallback(Widget w, XtPointer ignore, XtPointer call_data) { XmConvertCallbackStruct *ccs = (XmConvertCallbackStruct *)call_data; int value; Atom COMPOUND_TEXT = XInternAtom(XtDisplay(w), XmSCOMPOUND_TEXT, False); Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Atom MOTIF_EXPORT_TARGETS = XInternAtom(XtDisplay(w), XmS_MOTIF_EXPORT_TARGETS, False); int n; printf("\nNow in ConvertCallback.\n"); printf("\tSelection: "); OutputAnAtomName((Widget)w, ccs->selection); printf("\tTarget: "); OutputAnAtomName((Widget)w, ccs->target); /* XmeDragSource is going to call ConvertCallback and ask it to convert MOTIF_EXPORT_TARGETS. */ if ( (ccs->target == MOTIF_EXPORT_TARGETS) || (ccs->target == TARGETS)) { /* We have to create a list of targets that ConvertCallback can convert. For simplicity, we are going to restrict that list to one target: COMPOUND_TEXT. */ Atom *targs = (Atom *) XtMalloc(sizeof(Atom) * 1); if (targs == NULL) { ccs->status = XmCONVERT_REFUSE; printf("Refuse.\n"); return; } n = 0; targs[n] = COMPOUND_TEXT; n++; ccs->value = (XtPointer) targs; ccs->type = XA_ATOM; ccs->length = n; ccs->format = 32; ccs->status = XmCONVERT_DONE; /* Yes, we converted the target. */ } /* If the drop site supports COMPOUND_TEXT as an import target, then the drop site will ask ConvertCallback to convert the value to COMPOUND_TEXT format. */ else if (ccs->target == COMPOUND_TEXT) { char *passtext; char *ctext; XmString cstring; char ValueAsAString[10]; /* The part of the ScrollBar that we are transferring is its XmNvalue resource. */ XtVaGetValues(w, XmNvalue, &value, NULL); /* Convert XmNvalue to COMPOUND_TEXT. */ sprintf(ValueAsAString, "%d", value); cstring = XmStringCreateLocalized(ValueAsAString); ctext = XmCvtXmStringToCT(cstring); passtext = XtMalloc(strlen(ctext)+1); memcpy(passtext, ctext, strlen(ctext)+1); /* Assign converted string to XmConvertCallbackStruct. */ ccs->value = (XtPointer)passtext; ccs->type = XA_STRING; ccs->length = strlen(passtext); ccs->format = 8; ccs->status = XmCONVERT_DONE; } else { /* Unexpected target. */ ccs->status = XmCONVERT_REFUSE; } } /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, (XtPointer)1); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB: Provide help when the user asks for it. *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { int what_kind_of_help = (int)cd; char help_string[500]; XmString hs_as_cs; Widget dialog_general_help; Arg arg[3]; sprintf(help_string, "This program demonstrates how to add a convert callback\n\ to an application and how to add drag capability to the \n\ ScrollBar widget. You should place the cursor on the slider \n\ of the ScrollBar. Then press <Btn2> to begin a drag operation.\n\ A DragIcon will appear. Move the DragIcon to the Text widget \n\ and 'drop' the DragIcon anywhere inside the Text widget.\n\ The application will transfer the XmNvalue of the ScrollBar \n\ to the Text widget."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); dialog_general_help = (Widget)XmCreateMessageDialog(toplevel, "message", arg, 1); XmStringFree(hs_as_cs); switch (what_kind_of_help) { case 1: XtManageChild(dialog_general_help); break; default: /* no other help */ break; } } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(0); } /********************************************************************** OutputAnAtomName: Translates a target from its internal atom format into a human readable character string. **********************************************************************/ void OutputAnAtomName(Widget w, Atom target) { char *AtomName = malloc(sizeof(char *) * 34); AtomName = XGetAtomName(XtDisplay(w), target); printf("\t%s\n", AtomName); } �����motif-2.3.8/demos/doc/programGuide/ch17/simple_drag/README������������������������������������������0000644�0001750�0001750�00000000563�12672140200�017772� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:58:42 drk $ */ README File for simple_drag Example The simple_drag program demonstrates how a Motif application can add an XmNconvertCallback procedure. To run the program, just type: $ simple_drag For an explanation of how this program works, see Chapter 17 of the "OSF/Motif Programmer's Guide." ���������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/simple_drag/Makefile.am�������������������������������������0000644�0001750�0001750�00000000471�13145162623�021155� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README simple_drag.man noinst_PROGRAMS = simple_drag simple_drag_SOURCES = simple_drag.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch17/Makefile.am�������������������������������������������������0000644�0001750�0001750�00000000106�12672140200�016651� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = simple_drag simple_drop ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/Makefile.in������������������������������������������������������0000644�0001750�0001750�00000046466�13211512765�016154� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/doc/programGuide ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = ch05 ch06 ch08 ch16 ch17 all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014674� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Makefile.in�������������������������������������������������0000644�0001750�0001750�00000046462�13211512765�016707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/doc/programGuide/ch05 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = Scale all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch05/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch05/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Scale/������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�015723� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Scale/tic_mark.c��������������������������������������������0000644�0001750�0001750�00000007372�12672140200�017612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: tic_mark.c /main/5 1995/07/15 20:39:30 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <Xm/XmAll.h> #include <Xmd/RegEdit.h> void CreateScale(Widget); extern void CreateMenus(Widget); extern void HelpCB(Widget, XtPointer, XtPointer); extern void QuitCB(Widget, XtPointer, XtPointer); Widget top_level; #define APP_CLASS "XmdScale" static String fallbacks[] = { "scale1.allowShellResize: True", "scale1.value: 20", NULL }; int main(int argc, char **argv) { XtAppContext app_context; Widget main_window; XtSetLanguageProc(NULL, NULL, NULL); top_level = XtVaOpenApplication(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks,sessionShellWidgetClass, NULL); XmdRegisterEditres(top_level); main_window = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, top_level, NULL); CreateMenus(main_window); CreateScale(main_window); XtRealizeWidget(top_level); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } void CreateScale(Widget parent_of_scale) { #define BOTTOM_OF_THERMOMETER -20 #define TOP_OF_THERMOMETER 40 #define NUM_TICS (((TOP_OF_THERMOMETER - BOTTOM_OF_THERMOMETER) / 10) + 1) Widget scale1, tics[NUM_TICS]; Arg args[10]; Cardinal i, n; unsigned char scale_orientation, tic_orientation; Dimension tic_long_dim = 10, tic_short_dim = 5; Dimension tic_width, tic_height; char tic_name[10]; /* Build the Scale. */ scale1 = XtVaCreateManagedWidget("scale1", xmScaleWidgetClass, parent_of_scale, XmNslidingMode, XmTHERMOMETER, XmNeditable, True, XmNshowValue, True, XmNminimum, BOTTOM_OF_THERMOMETER, XmNmaximum, TOP_OF_THERMOMETER, NULL); /* Now build the tic marks. */ n = 0; XtSetArg(args[n], XmNorientation, &scale_orientation); n++; XtGetValues(scale1, args, n); if (scale_orientation == XmHORIZONTAL) { tic_orientation = XmVERTICAL; tic_width = tic_short_dim; tic_height = tic_long_dim; } else { tic_orientation = XmHORIZONTAL; tic_width = tic_long_dim; tic_height = tic_short_dim; } for (i = 0; i < NUM_TICS; i++) { sprintf(tic_name, "tic_%d", i); n = 0; XtSetArg(args[n], XmNseparatorType, XmSINGLE_LINE); n++; XtSetArg(args[n], XmNorientation, tic_orientation); n++; XtSetArg(args[n], XmNwidth, tic_width); n++; XtSetArg(args[n], XmNheight, tic_height); n++; tics[i] = XmCreateSeparatorGadget(scale1, tic_name, args, n); } XtManageChildren(tics, NUM_TICS); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Scale/interface.c�������������������������������������������0000644�0001750�0001750�00000010727�12672140200�017757� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: interface.c /main/4 1995/07/15 20:39:25 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmAll.h> void CreateMenus(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); extern Widget top_level; /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, NULL); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB: This function is called when the user requests help. This function displays a Message DialogBox. *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { char help_string[400]; XmString hs_as_cs; static Widget dialog_general_help = NULL; Arg arg[3]; sprintf(help_string, "This program demonstrates how to use an XmScale in an application.\n\ In addition, it demonstrates how an XmScale can contain tic marks."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); if(dialog_general_help == NULL) dialog_general_help = (Widget)XmCreateMessageDialog(top_level, "message", arg, 1); XmStringFree(hs_as_cs); XtManageChild(dialog_general_help); } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(1); } �����������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Scale/Makefile.in�������������������������������������������0000644�0001750�0001750�00000045423�13211512765�017732� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = tic_mark$(EXEEXT) subdir = demos/doc/programGuide/ch05/Scale ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_tic_mark_OBJECTS = tic_mark.$(OBJEXT) interface.$(OBJEXT) tic_mark_OBJECTS = $(am_tic_mark_OBJECTS) tic_mark_LDADD = $(LDADD) tic_mark_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(tic_mark_SOURCES) DIST_SOURCES = $(tic_mark_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README tic_mark.man tic_mark_SOURCES = tic_mark.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch05/Scale/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch05/Scale/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list tic_mark$(EXEEXT): $(tic_mark_OBJECTS) $(tic_mark_DEPENDENCIES) $(EXTRA_tic_mark_DEPENDENCIES) @rm -f tic_mark$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tic_mark_OBJECTS) $(tic_mark_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tic_mark.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Scale/tic_mark.man������������������������������������������0000644�0001750�0001750�00000002553�12672140200�020137� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: tic_mark.man /main/5 1995/07/17 10:44:42 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH tic_mark 1X MOTIF "Demonstration programs" .SH NAME \*Ltic_mark\*O\(emDemonstrates how to place tic marks along side an XmScale widget .SH SYNOPSIS .sS \*Ltic_mark\*O .sE .SH DESCRIPTION \*Ltic_mark\*O illustrates how to use an XmScale in an application, and how to place tic marks next to an XmScale. .PP For details on the code, see Chapter 5 of the "OSF/Motif Programmer's Guide." �����������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Scale/README������������������������������������������������0000644�0001750�0001750�00000000524�12672140200�016525� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:56:23 drk $ */ README File for XmScale/tic_mark Example The tic_mark example demonstrates a simple use of the XmScale widget. To run the program, just type: $ tic_mark For an explanation of how this program works, see Chapter 5 of the "OSF/Motif Programmer's Guide." ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Scale/Makefile.am�������������������������������������������0000644�0001750�0001750�00000000467�13145162623�017720� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README tic_mark.man noinst_PROGRAMS = tic_mark tic_mark_SOURCES = tic_mark.c interface.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch05/Makefile.am�������������������������������������������������0000644�0001750�0001750�00000000064�12672140200�016651� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = Scale ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/Makefile.am������������������������������������������������������0000644�0001750�0001750�00000000107�12672140200�016110� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = ch05 ch06 ch08 ch16 ch17 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch16/������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513010�014670� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch16/Makefile.in�������������������������������������������������0000644�0001750�0001750�00000045254�13211512765�016707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = UTMXmText$(EXEEXT) subdir = demos/doc/programGuide/ch16 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_UTMXmText_OBJECTS = UTMXmText.$(OBJEXT) UTMXmText_OBJECTS = $(am_UTMXmText_OBJECTS) UTMXmText_LDADD = $(LDADD) UTMXmText_DEPENDENCIES = $(top_builddir)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(UTMXmText_SOURCES) DIST_SOURCES = $(UTMXmText_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README UTMXmText.man UTMXmText_SOURCES = UTMXmText.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/doc/programGuide/ch16/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/doc/programGuide/ch16/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list UTMXmText$(EXEEXT): $(UTMXmText_OBJECTS) $(UTMXmText_DEPENDENCIES) $(EXTRA_UTMXmText_DEPENDENCIES) @rm -f UTMXmText$(EXEEXT) $(AM_V_CCLD)$(LINK) $(UTMXmText_OBJECTS) $(UTMXmText_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UTMXmText.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch16/UTMXmText.man�����������������������������������������������0000644�0001750�0001750�00000003203�12672140200�017131� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: UTMXmText.man /main/4 1995/07/17 10:45:38 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH UTMXmText 1X MOTIF "Demonstration programs" .SH NAME \*LUTMXmText\*O\(emDemonstrates how to add UTM callbacks to an application .SH SYNOPSIS .sS \*LUTMXmText\*O .sE .SH DESCRIPTION \*LUTMXmText\*O illustrates how an application can add UTM callbacks to enhance the data transfer capabilities of a Motif widget. When you invoke the program, two text widgets will appear. The top widget is marked as the "DESTINATION" widget. The bottom widget is marked as the "source" widget. All text transferred from the "source" widget to the "DESTINATION" widget will be converted to uppercase. .PP For details on the code, see Chapter 16 of the "OSF/Motif Programmer's Guide." ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch16/README������������������������������������������������������0000644�0001750�0001750�00000000600�12672140200�015473� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 13:58:15 drk $ */ README File for UTMXmText Example The UTMXmText demonstrates how a Motif application can add UTM callbacks on two XmText widgets to support a new target. To run the program, just type: $ UTMXmText For an explanation of how this program works, see Chapter 16 of the "OSF/Motif Programmer's Guide." ��������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch16/Makefile.am�������������������������������������������������0000644�0001750�0001750�00000000460�13145162623�016664� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README UTMXmText.man noinst_PROGRAMS = UTMXmText UTMXmText_SOURCES = UTMXmText.c INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS) LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/programGuide/ch16/UTMXmText.c�������������������������������������������������0000644�0001750�0001750�00000031255�12672140200�016610� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: UTMXmText.c /main/4 1995/07/15 20:40:10 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <Xm/Xm.h> #include <Xm/MainW.h> #include <Xm/Frame.h> #include <Xm/CascadeB.h> #include <Xm/MessageB.h> #include <Xm/PushBG.h> #include <Xm/RowColumn.h> #include <Xm/Transfer.h> #include <Xm/Label.h> #include <Xm/Text.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> void MakeTextWidgets(Widget); void ConvertCallback(Widget, XtPointer, XtPointer); void DestinationCallback(Widget, XtPointer, XtPointer); void TransferProc(Widget, XtPointer, XtPointer); void CreateMenus(Widget); void HelpCB(Widget, XtPointer, XtPointer); void QuitCB(Widget, XtPointer, XtPointer); void OutputAnAtomName(Widget, Atom); void ListAllTheTargets(Widget, Atom *, unsigned long); Widget toplevel; /****************************************************************** main: ******************************************************************/ int main(int argc, char **argv) { static Widget MainWindow; XtAppContext app_context; Widget Frame1; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); toplevel = XtOpenApplication(&app_context, "Test", NULL, 0, &argc, argv, NULL,sessionShellWidgetClass, NULL, 0); MainWindow = XtVaCreateManagedWidget("MainWindow1", xmMainWindowWidgetClass, toplevel, NULL); CreateMenus(MainWindow); Frame1 = XtVaCreateManagedWidget("Frame1", xmFrameWidgetClass, MainWindow, NULL); MakeTextWidgets(Frame1); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } /****************************************************************** MakeTextWidgets: Instantiate two text widgets both managed by the same RowColumn widget. ******************************************************************/ void MakeTextWidgets(Widget parent) { Widget RC1; Widget Text1, Text2; RC1 = XtVaCreateManagedWidget("RC1", xmRowColumnWidgetClass, parent, NULL); Text1 = XtVaCreateManagedWidget("Text1", xmTextWidgetClass, RC1, XmNeditMode, XmMULTI_LINE_EDIT, XmNrows, 10, XmNcolumns, 36, XmNvalue, "DESTINATION: ONLY UPPERCASE HERE.", NULL); /* Attach an XmNdestinationCallback procedure to Text1. */ XtAddCallback(Text1, XmNdestinationCallback, DestinationCallback, NULL); Text2 = XtVaCreateManagedWidget("Text2", xmTextWidgetClass, RC1, XmNeditMode, XmMULTI_LINE_EDIT, XmNrows, 10, XmNcolumns, 36, XmNvalue, "Source: Responsible for converting.", NULL); /* Attach an XmNconvertCallback procedure to Text2. */ XtAddCallback(Text2, XmNconvertCallback, ConvertCallback, NULL); } /********************************************************************** ConvertCallback **********************************************************************/ void ConvertCallback(Widget w, XtPointer ignore, XtPointer call_data) { XmConvertCallbackStruct *ccs = (XmConvertCallbackStruct *)call_data; char *selected_text; char *copy_of_selected_text; Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Atom _MOTIF_CLIPBOARD_TARGETS = XInternAtom(XtDisplay(w), "_MOTIF_CLIPBOARD_TARGETS", False); Atom MYTEXT = XInternAtom(XtDisplay(w), "MYTEXT", False); int n=0; Atom *targs = (Atom *)XtMalloc(sizeof(Atom) * 2); printf("\n\nNow in ConvertCallback.\n"); printf("\tSelection: "); OutputAnAtomName((Widget)w, ccs->selection); printf("\tTarget: "); OutputAnAtomName((Widget)w, ccs->target); if ((ccs->target == TARGETS) || (ccs->target == _MOTIF_CLIPBOARD_TARGETS)) { printf("ConvertCallback: Adding MYTEXT to the list of targets.\n"); /* use targs to hold a list of targets that my application can convert. */ targs[n] = MYTEXT; n++; ccs->value = (XtPointer) targs; ccs->type = XA_ATOM; ccs->format = 32; ccs->length = n; ccs->status = XmCONVERT_MERGE; } else if (ccs->target == MYTEXT) { /* Get the selection. */ selected_text = XmTextGetSelection(w); copy_of_selected_text = selected_text; /* Convert any lowercase letters in the selection to uppercase. */ while (*selected_text) { if (islower(*selected_text)) *selected_text = toupper(*selected_text); selected_text++; } /* Place the converted text into the XmConvertCallbackStruct. */ ccs->value = copy_of_selected_text; ccs->type = ccs->target; ccs->format = 8; ccs->length = strlen(copy_of_selected_text); ccs->status = XmCONVERT_DONE; } } /********************************************************************** DestinationCallback: **********************************************************************/ void DestinationCallback(Widget w, XtPointer ignore, XtPointer call_data) { XmDestinationCallbackStruct *dcs = (XmDestinationCallbackStruct *)call_data; Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Atom MYTEXT = XInternAtom(XtDisplay(w), "MYTEXT", False); printf("\n\nNow in DestinationCallback\n"); printf("\tSelection: "); OutputAnAtomName ((Widget)w, dcs->selection); /* Ask the source to return a list of all the targets supported. */ XmTransferValue(dcs->transfer_id, TARGETS, (XtCallbackProc)TransferProc, NULL, XtLastTimestampProcessed(XtDisplay(w))); } /********************************************************************** TransferProc: Called by UTM whenever a conversion routine completes a conversion that was initiated by an XmTransferValue call. **********************************************************************/ void TransferProc(Widget w, XtPointer ignore, XtPointer call_data) { XmSelectionCallbackStruct *scs = (XmSelectionCallbackStruct *) call_data; Atom TARGETS = XInternAtom(XtDisplay(w), "TARGETS", False); Atom MYTEXT = XInternAtom(XtDisplay(w), "MYTEXT", False); Atom *targets = (Atom *)scs->value; int MYTEXT_is_supported = 0; unsigned long n; printf("\n\nNow in TransferProc.\n"); if ((scs->target == TARGETS) && (scs->type == XA_ATOM)) { printf("TransferProc: target is TARGETS.\n"); printf("Number of supported targets is %ld\n", scs->length); ListAllTheTargets(w, targets, scs->length); for (n=0; n<=scs->length; n++) { /* Look through list of returned TARGETS to see if MYTEXT is there. */ if (targets[n] == MYTEXT) MYTEXT_is_supported = 1; } if (MYTEXT_is_supported) printf("TransferProc: Requesting conversion of MYTEXT.\n"); XmTransferValue(scs->transfer_id, MYTEXT, (XtCallbackProc)TransferProc, NULL, XtLastTimestampProcessed(XtDisplay(w))); } if ((scs->target == MYTEXT)) { XmTextPosition current_insertion_position; printf("TransferProc: source has converted MYTEXT.\n"); current_insertion_position = XmTextGetInsertionPosition(w); XmTextInsert(w, current_insertion_position, (char *)scs->value); XmTransferDone(scs->transfer_id, XmTRANSFER_DONE_SUCCEED); } } /********************************************************************** OutputAnAtomName **********************************************************************/ void OutputAnAtomName(Widget w, Atom target) { char *AtomName = malloc(sizeof(char *) * 34); AtomName = XGetAtomName(XtDisplay(w), target); printf("\t%s\n", AtomName); } /********************************************************************** ListAllTheTargets **********************************************************************/ void ListAllTheTargets(Widget w, Atom *targets, unsigned long number_of_targets) { int n; printf("Here are all the targets:\n"); for (n=0; n<number_of_targets; n++) OutputAnAtomName(w, targets[n]); } /************************************************************************** CreateMenus: This function generates the menu bar and the submenus. **************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { XmString file, help; Widget menubar, FilePullDown, HelpPullDown; Widget overview, quit, Help1; /* Create the menubar itself. */ file = XmStringCreateSimple("File"); help = XmStringCreateSimple("Help"); menubar = (Widget)XmCreateMenuBar(parent_of_menu_bar, "menubar", NULL, 0); FilePullDown = (Widget)XmCreatePulldownMenu(menubar, "FilePullDown", NULL, 0); HelpPullDown = (Widget)XmCreatePulldownMenu(menubar, "HelpPullDown", NULL, 0); /******************************FILE*********************************/ XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menubar, XmNlabelString, file, XmNmnemonic, 'F', XmNsubMenuId, FilePullDown, NULL); quit = XtVaCreateManagedWidget("Quit", xmPushButtonGadgetClass, FilePullDown, NULL); XtAddCallback(quit, XmNactivateCallback, QuitCB, NULL); /******************************HELP*********************************/ Help1 = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menubar, XmNlabelString, help, XmNmnemonic, 'H', XmNsubMenuId, HelpPullDown, NULL); XtVaSetValues(menubar, XmNmenuHelpWidget, Help1, NULL); overview = XtVaCreateManagedWidget("Overview", xmPushButtonGadgetClass, HelpPullDown, NULL); XtAddCallback(overview, XmNactivateCallback, HelpCB, (XtPointer)1); XmStringFree(file); XmStringFree(help); XtManageChild(menubar); } /********************************************************************* HelpCB *********************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb ) { int what_kind_of_help = (int)cd; char help_string[500]; XmString hs_as_cs; Widget dialog_general_help; Arg arg[3]; sprintf(help_string, "This program demonstrates how to add a convert callback\n\ and a destination callback to an application.\n\ You should try to transfer text from the 'Source' Text widget to\n\ the 'DESTINATION' text widget. The text that you transfer\n\ will be converted to all uppercase when it arrives in the\n\ destination widget. You can transfer the text via drag and drop,\n\ clipboard, secondary, or primary selections."); hs_as_cs = XmStringCreateLtoR(help_string, XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, hs_as_cs); dialog_general_help = (Widget)XmCreateMessageDialog(toplevel, "message", arg, 1); XmStringFree(hs_as_cs); switch (what_kind_of_help) { case 1: XtManageChild(dialog_general_help); break; default: /* no other help */ break; } } /******************************************************************************* QuitCB: Exit *******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { exit(1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/doc/Makefile.am�������������������������������������������������������������������0000644�0001750�0001750�00000000073�12672140200�013465� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = programGuide ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/����������������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�013333� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmfonts/��������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�015031� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmfonts/Makefile.in���������������������������������������������������0000644�0001750�0001750�00000044740�13211512767�017043� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = xmfonts$(EXEEXT) subdir = demos/unsupported/xmfonts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) xmfonts_SOURCES = xmfonts.c xmfonts_OBJECTS = xmfonts.$(OBJEXT) xmfonts_LDADD = $(LDADD) xmfonts_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = DIST_SOURCES = xmfonts.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SOURCES = xmfonts.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/xmfonts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/xmfonts/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xmfonts$(EXEEXT): $(xmfonts_OBJECTS) $(xmfonts_DEPENDENCIES) $(EXTRA_xmfonts_DEPENDENCIES) @rm -f xmfonts$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xmfonts_OBJECTS) $(xmfonts_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmfonts.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������motif-2.3.8/demos/unsupported/xmfonts/xmfonts.c�����������������������������������������������������0000644�0001750�0001750�00000032065�13145162623�016633� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: xmfonts.c /main/5 1995/07/14 10:08:26 drk $" #endif #endif /**--------------------------------------------------------------------- *** *** file: xmfonts.c *** *** Xmfonts.ad: xmfonts*XmScrolledWindow.height: 432 xmfonts*XmScrolledWindow.width: 390 xmfonts*row_column.XmNnumColumns: 5 xmfonts*row_column.XmNpacking: XmPACK_COLUMN ***-------------------------------------------------------------------*/ #include <stdio.h> #include <stdlib.h> #include <X11/Intrinsic.h> #include <Xm/Xm.h> #include <Xm/MainW.h> #include <Xm/PushB.h> #include <Xm/RowColumn.h> #include <Xm/CascadeB.h> #include <Xm/ScrolledW.h> #include <Xm/Frame.h> #include <Xm/MessageB.h> #include <Xm/PushBG.h> /*------------------------------------------------------------- ** Forward Declarations */ Widget CreateApplication (); /* create main window */ Widget CreateFontSample (); /* create font display window */ Widget CreateHelp (); /* create help window */ void SelectFontCB (); /* callback for font buttons */ void CloseCB (); /* callback for close button */ void HelpCB (); /* callback for help button */ void QuitCB (); /* callback for quit button */ /*------------------------------------------------------------- ** Global Variables */ #define MAX_ARGS 20 static XmStringCharSet charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET; typedef struct { char *fontpattern; int maxfont ; /* number max of font to be displayed */ int maxlen ; /* max length of font name to be displayed */ Boolean usegadget ; } ApplicationData, *ApplicationDataPtr; ApplicationData AppData; #define XtNfontPattern "fontPattern" #define XtCFontPattern "FontPattern" #define XtNmaxFont "maxFont" #define XtCMaxFont "MaxFont" #define XtNmaxLen "maxLen" #define XtCMaxLen "MaxLen" #define XtNuseGadget "useGadget" #define XtCUseGadget "UseGadget" static XtResource resources[] = { { XtNfontPattern, XtCFontPattern, XmRString, sizeof(String), XtOffset(ApplicationDataPtr, fontpattern), XmRString, "*" }, { XtNmaxFont, XtCMaxFont, XmRInt, sizeof(int), XtOffset(ApplicationDataPtr, maxfont), XmRImmediate, (caddr_t) 1000 }, { XtNmaxLen, XtCMaxLen, XmRInt, sizeof(int), XtOffset(ApplicationDataPtr, maxlen), XmRImmediate, (caddr_t) 10 }, { XtNuseGadget, XtCUseGadget, XmRBoolean, sizeof (Boolean), XtOffset(ApplicationDataPtr, usegadget), XmRImmediate, (caddr_t) TRUE } }; /*------------------------------------------------------------- ** main - main logic for application */ int main (argc,argv) int argc; char **argv; { Display *display; /* Display */ Widget app_shell; /* ApplicationShell */ Widget main_window; /* MainWindow */ XtAppContext app_context; /* Initialize toolkit and open the display. */ app_shell = XtAppInitialize(&app_context, "XMdemos", NULL, 0, &argc, argv, NULL, NULL, 0); XtGetApplicationResources(app_shell, (XtPointer)&AppData, resources, XtNumber(resources), NULL, 0); main_window = CreateApplication (app_shell); XtRealizeWidget (app_shell); /* Get and dispatch events. */ XtAppMainLoop (app_context); return 0; /* make compiler happy */ } /*------------------------------------------------------------- ** CreateApplication - create main window */ Widget CreateApplication (parent) Widget parent; /* parent widget */ { Widget main_window; /* MainWindow */ Widget menu_bar; /* MenuBar */ Widget menu_pane; /* MenuPane */ Widget cascade; /* CascadeButton */ Widget frame; /* Frame */ Widget swindow; /* ScrolledWindow */ Widget row_column; /* RowColumn */ Widget button; /* PushButtonGadget */ Widget hsb, vsb; /* ScrollBars */ Arg args[MAX_ARGS]; /* arg list */ register int n; /* arg count */ char * name; int count, i ; char ** fontnamelist ; XmString label_string; /* Create MainWindow. */ n = 0; main_window = XmCreateMainWindow (parent, "main_window", args, n); XtManageChild (main_window); /* Create MenuBar in MainWindow. */ n = 0; menu_bar = XmCreateMenuBar (main_window, "menu_bar", args, n); XtManageChild (menu_bar); /* Create "Exit" PulldownMenu. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Quit", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, QuitCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "Exit", args, n); XtManageChild (cascade); /* Create "Help" button. */ n = 0; cascade = XmCreateCascadeButton (menu_bar, "Help", args, n); XtManageChild (cascade); XtAddCallback (cascade, XmNactivateCallback, HelpCB, NULL); n = 0; XtSetArg (args[n], XmNmenuHelpWidget, cascade); n++; XtSetValues (menu_bar, args, n); /* Create Frame MainWindow and ScrolledWindow in Frame. */ n = 0; frame = XmCreateFrame (main_window, "frame", args, n); XtManageChild (frame); n = 0; XtSetArg (args[n], XmNscrollingPolicy, XmAUTOMATIC); n++; swindow = XmCreateScrolledWindow (frame, "swindow", args, n); XtManageChild (swindow); /* Create RowColumn in ScrolledWindow to manage buttons. */ n = 0; row_column = XmCreateRowColumn (swindow, "row_column", args, n); XtManageChild (row_column); /* Set MainWindow areas and add tab groups */ XmMainWindowSetAreas (main_window, menu_bar, NULL, NULL, NULL, frame); /* Create a PushButton widget for each font. Get the font list from the server and keep only the font name whose length is less than the given maxLen resource. */ fontnamelist = XListFonts(XtDisplay(main_window), AppData.fontpattern, AppData.maxfont, &count); if (!fontnamelist) { fprintf(stderr,"No font on your server, exit\n"); exit(0); } /* read one entry each time through the loop */ for (i = 0; i < count; i++ ) { name = fontnamelist[i] ; if (strlen(name) > AppData.maxlen) continue ; /* create PushButton in RowCol */ n = 0; label_string = XmStringCreateLtoR(name, charset); XtSetArg (args[n], XmNlabelString, label_string); n++; if (AppData.usegadget) button = XmCreatePushButtonGadget (row_column, name, args, n); else button = XmCreatePushButton(row_column, name, args, n); XtManageChild (button); XtAddCallback (button, XmNarmCallback, SelectFontCB, NULL); XmStringFree (label_string); } /* Return MainWindow. */ XFreeFontNames(fontnamelist); return (main_window); } /*------------------------------------------------------------- ** CreateFontSample - create font display window */ Widget CreateFontSample (parent) Widget parent; /* parent widget */ { Widget message_box; /* MessageBox Dialog */ Widget button; Arg args[MAX_ARGS]; /* arg list */ register int n; /* arg count */ char *name = NULL; /* font name */ XFontStruct *font = NULL; /* font pointer */ XmFontList fontlist = NULL; /* fontlist pointer */ static char message[BUFSIZ]; /* text sample */ XmString name_string = NULL; XmString message_string = NULL; XmString button_string = NULL; /* Get font name. */ n = 0; XtSetArg (args[n], XmNlabelString, &name_string); n++; XtGetValues (parent, args, n); XmStringGetLtoR (name_string, charset, &name); /* Load font and generate message to display. */ if (name) font = XLoadQueryFont (XtDisplay (XtParent (parent)), name); if (!font) sprintf (message, "Unable to load font: %s", name); else { fontlist = XmFontListCreate (font, charset); sprintf (message, "\ This is font %s.\n\ The quick brown fox jumps over the lazy dog.", name); } message_string = XmStringCreateLtoR (message, charset); button_string = XmStringCreateLtoR ("Close", charset); /* Create MessageBox dialog. */ n = 0; XtSetArg (args[n], XmNdialogTitle, name_string); n++; XtSetArg (args[n], XmNokLabelString, button_string); n++; XtSetArg (args[n], XmNmessageString, message_string); n++; message_box = XmCreateMessageDialog (XtParent (XtParent(parent)), "fontbox", args, n); button = XmMessageBoxGetChild (message_box, XmDIALOG_MESSAGE_LABEL); if (fontlist) { n = 0; XtSetArg (args[n], XmNfontList, fontlist); n++; XtSetValues(button, args, n); } button = XmMessageBoxGetChild (message_box, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild (button); button = XmMessageBoxGetChild (message_box, XmDIALOG_HELP_BUTTON); XtUnmanageChild (button); /* Free strings and return MessageBox. */ if (fontlist) XmFontListFree (fontlist); if (name_string) XmStringFree (name_string); if (message_string) XmStringFree (message_string); if (button_string) XmStringFree (button_string); return (message_box); } /*------------------------------------------------------------- ** CreateHelp - create help window */ Widget CreateHelp (parent) Widget parent; /* parent widget */ { Widget button; Widget message_box; /* Message Dialog */ Arg args[MAX_ARGS]; /* arg list */ register int n; /* arg count */ static char message[BUFSIZ]; /* help text */ XmString title_string = NULL; XmString message_string = NULL; XmString button_string = NULL; /* Generate message to display. */ sprintf (message, "\ These are buttons for the fonts in your X11 server whose \n\ name lengths are below the given maxLen application resource.\n\ The button label is the name of the font. When you select \n\ a button, a small window will display a sample of the font. \n\n\ Press the 'close' button to close a font window. \n\ Select 'quit' from the 'exit' menu to exit this application."); message_string = XmStringCreateLtoR (message, charset); button_string = XmStringCreateLtoR ("Close", charset); title_string = XmStringCreateLtoR ("xmfonts help", charset); /* Create MessageBox dialog. */ n = 0; XtSetArg (args[n], XmNdialogTitle, title_string); n++; XtSetArg (args[n], XmNokLabelString, button_string); n++; XtSetArg (args[n], XmNmessageString, message_string); n++; message_box = XmCreateMessageDialog (parent, "helpbox", args, n); button = XmMessageBoxGetChild (message_box, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild (button); button = XmMessageBoxGetChild (message_box, XmDIALOG_HELP_BUTTON); XtUnmanageChild (button); /* Free strings and return MessageBox. */ if (title_string) XmStringFree (title_string); if (message_string) XmStringFree (message_string); if (button_string) XmStringFree (button_string); return (message_box); } /*------------------------------------------------------------- ** SelectFontCB - callback for font buttons */ void SelectFontCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { Widget message_box; /* Create font sample window. */ message_box = CreateFontSample (w); /* Display font sample window. */ XtManageChild (message_box); } /*------------------------------------------------------------- ** CloseCB - callback for close button */ void CloseCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* font pointer */ caddr_t call_data; /* data from widget class */ { XFontStruct *font = (XFontStruct *) client_data; Widget message_box = XtParent (w); Widget shell = XtParent (message_box); /* Free font. */ if (font) XFreeFont (XtDisplay (w), font); /* Unmanage and destroy widgets. */ XtUnmanageChild (message_box); XtDestroyWidget (shell); } /*------------------------------------------------------------- ** HelpCB - callback for help button */ void HelpCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { Widget message_box; /* MessageBox */ /* Create help window. */ message_box = CreateHelp (w); /* Display help window. */ XtManageChild (message_box); } /*------------------------------------------------------------- ** QuitCB - callback for quit button */ void QuitCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from applicaiton */ caddr_t call_data; /* data from widget class */ { /* Terminate the application. */ exit (0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmfonts/Makefile.am���������������������������������������������������0000644�0001750�0001750�00000000313�13145162623�017014� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = xmfonts SOURCES = xmfonts.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/motifshell/�����������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�015501� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/motifshell/Makefile.in������������������������������������������������0000644�0001750�0001750�00000045043�13211512767�017510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = motifshell$(EXEEXT) subdir = demos/unsupported/motifshell ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) motifshell_SOURCES = motifshell.c motifshell_OBJECTS = motifshell.$(OBJEXT) motifshell_LDADD = $(LDADD) motifshell_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = DIST_SOURCES = motifshell.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SOURCES = motifshell.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/motifshell/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/motifshell/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list motifshell$(EXEEXT): $(motifshell_OBJECTS) $(motifshell_DEPENDENCIES) $(EXTRA_motifshell_DEPENDENCIES) @rm -f motifshell$(EXEEXT) $(AM_V_CCLD)$(LINK) $(motifshell_OBJECTS) $(motifshell_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motifshell.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/motifshell/motifshell.c�����������������������������������������������0000644�0001750�0001750�00000067006�13201252401�017741� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: motifshell.c /main/7 1997/03/31 13:41:20 dbl $" #endif #endif /**************************************************************************** **************************************************************************** ** ** File: motifShell.c ** ** Project: Motif - widget examination program ** ** Description: Program which shows resources of widgets ** **************************************************************************** ****************************************************************************/ /*************************************************** * * * Revision history: * * * * 05/26/89 strong Initial Version * * 06/01/89 strong 1.0 * * 06/26/89 pjlevine complete rewrite * * 03/12/92 deblois yet another rewrite * * * ****************************************************/ #include <X11/Xos.h> /* Standard C headers */ #include <stdio.h> #include <stdlib.h> #include <sys/signal.h> /* X headers */ #include <X11/IntrinsicP.h> /* Xm headers */ #include <Xm/Xm.h> #include <Xm/CascadeB.h> #include <Xm/DialogS.h> #include <Xm/FileSB.h> #include <Xm/Form.h> #include <Xm/Label.h> #include <Xm/List.h> #include <Xm/MainW.h> #include <Xm/MenuShell.h> #include <Xm/PushB.h> #include <Xm/RepType.h> #include <Xm/ScrolledW.h> #include <Xm/SelectioB.h> #include <Xm/Text.h> #define APP_CLASS "XMdemo" #define DEFAULT_FONT "fixed" #define TEST_STRING "The quick brown fox jumps over the lazy dog." #define TEST_HELP "Type here to test the font.\nApply sets this window.\nOK sets main window." #define HELP_FILE "help" #define WELCOME_FILE "welcome" #define MEMBERSHIP_FILE "membership" #define RESEARCH_FILE "research" #define PRINCIPLES_FILE "principles" #define MOTIF_FILE "motif" #define READ 0 #define WRITE 1 /* Global Variables */ Display *display; char filename [256]; Widget TextWin; Widget LabelW; XtAppContext AppContext; int perr[2], p; /* Declarations */ int GetFileLen (int fd); /*-------------------------------------------------------------* | ExtractNormalString | | support routine to get normal string from XmString | *-------------------------------------------------------------*/ char *ExtractNormalString(XmString cs) { XmStringContext context; XmStringCharSet charset; XmStringDirection direction; Boolean separator; static char *primitiveString; XmStringInitContext (&context, cs); XmStringGetNextSegment (context, &primitiveString, &charset, &direction, &separator); XmStringFreeContext (context); return ((char *) primitiveString); } /*-------------------------------------------------------------* | FontSelectApply | *-------------------------------------------------------------*/ void FontSelectApply (Widget w, XtPointer client_data, XtPointer call_data) { XmSelectionBoxCallbackStruct *cdata = (XmSelectionBoxCallbackStruct *)call_data; Widget textWidget = (Widget)client_data; char *textstr; XmFontList fontList; XFontStruct *mfinfo; /* no font selected... */ if (cdata->value == NULL) return; textstr = ExtractNormalString (cdata->value); if ((mfinfo = XLoadQueryFont(display, textstr))==NULL) printf ("couldn't open %s font\n", textstr); fontList = XmFontListCreate (mfinfo, XmFONTLIST_DEFAULT_TAG); XtVaSetValues(textWidget, XmNfontList, fontList, NULL); } /*-------------------------------------------------------------* | FontSelectOK | *-------------------------------------------------------------*/ void FontSelectOK (Widget w, XtPointer client_data, XtPointer call_data) { XmSelectionBoxCallbackStruct *callback_data = (XmSelectionBoxCallbackStruct *)call_data; char *textstr; XmFontList fontList; XFontStruct *mfinfo; if (callback_data->value == (XmString) NULL) return; textstr = ExtractNormalString (callback_data->value); if ((mfinfo = XLoadQueryFont(display, textstr))==NULL) printf ("couldn't open %s font\n", textstr); fontList = XmFontListCreate (mfinfo, XmFONTLIST_DEFAULT_TAG); XtVaSetValues(TextWin, XmNfontList, fontList, NULL); } /*-------------------------------------------------------------* | FontTest | *-------------------------------------------------------------*/ void FontTest (Widget w, XtPointer client_data, XtPointer call_data) { XmSelectionBoxCallbackStruct *callback_data = (XmSelectionBoxCallbackStruct *)call_data; Widget txtWidget = (Widget)client_data; char *textstr = DEFAULT_FONT; XmFontList fontList; XFontStruct *mfinfo; if (callback_data->value == (XmString) NULL) return; textstr = ExtractNormalString (callback_data->value); if (textstr == NULL) sprintf(textstr, "%s", DEFAULT_FONT); if ((mfinfo = XLoadQueryFont(display, textstr))==NULL) printf ("couldn't open %s font\n", textstr); fontList = XmFontListCreate (mfinfo, " "); XtVaSetValues(txtWidget, XmNfontList, fontList, XmNvalue, TEST_HELP, NULL); } /*-------------------------------------------------------------* | NextCap | *-------------------------------------------------------------*/ char *NextCap (char *path, char *cp, int len) { static int finish = 0; int span; char *ep, *np; if (!finish) return(NULL); if ((ep = strchr(cp, ':'))) span = ep - cp; else { finish++; ep = strchr(cp, '\0'); span = ep - cp; }; np = malloc(span + len + 2); strncpy(np, cp, span); np[span] = '/'; np[span+1] = '\0'; return(np); } /*-------------------------------------------------------------* | file_exist | *-------------------------------------------------------------*/ int file_exist (char *fullname) { /* Save the file pointer so it can be closed */ FILE *tmpf; if ((tmpf=fopen(fullname,"r"))) { fclose(tmpf); return(1); } else return(0); } /*-------------------------------------------------------------* | search_in_env | *-------------------------------------------------------------*/ char *search_in_env (char *filename) { int i, len; char *envpath, *prefix, *cp; len = strlen(filename); if ((envpath = getenv("PATH"))) { cp = envpath; cp += 2; while ((prefix = NextCap(envpath, cp, len))) { cp += strlen(prefix); strncat(prefix, filename, len); if (file_exist(prefix)) return(prefix); free(prefix); } } return(NULL); } /*-------------------------------------------------------------* | GetSource | *-------------------------------------------------------------*/ char *GetSource (char *fileptr) { static char *retbuff; int fd, flen, catlen; char *capfileptr, *defaultcap, *datahome; if ((fd = open (fileptr, O_RDONLY)) < 0) { /* Try looking in MSHELLDIR. */ char pathname[1024]; /* strcpy(pathname, MSHELLDIR); */ strcat(pathname, "/"); strcat(pathname, fileptr); if ((fd = open (pathname, O_RDONLY)) < 0) { if ((defaultcap = getenv("MOTIFSHELLFILES"))) { catlen = strlen(defaultcap); datahome = (char *) malloc(catlen + strlen(fileptr) + 2); strncpy(datahome, defaultcap, catlen); datahome[catlen] = '/'; datahome[catlen + 1] = '\0'; strcat(datahome, fileptr); if ((fd = open(datahome, O_RDONLY)) < 0) { printf ("Cannot find the file %s in %s\n", fileptr, datahome); free(datahome); return((char *) NULL); } free(datahome); } else if ((capfileptr = search_in_env(fileptr))) { fd = open (capfileptr, O_RDONLY); free(capfileptr); } else { printf ("Cannot find the file %s\n", fileptr); printf ("Please setup MOTIFSHELLFILES entry in environment and put data files there.\n"); return ((char *) NULL); } } } flen = GetFileLen(fd); retbuff = (char*) calloc (1, flen + 1); if (read (fd, retbuff, flen) <= 0) { printf ("Error reading file %s\n", fileptr); return ((char *) NULL); } close (fd); return (retbuff); } /*-------------------------------------------------------------* | DoTheFont | *-------------------------------------------------------------*/ XmString *DoTheFont (int *count) { char **fontlist; int i; static XmString *addrstr; fontlist = XListFonts (display, "*", 1200, count); addrstr = (XmString *) XtCalloc (*count, sizeof (XmString)); for (i = 0; i < *count; i++) addrstr[i] = XmStringCreateLocalized(fontlist[i]); return (addrstr); } /*-------------------------------------------------------------* | PopupHelpShell | *-------------------------------------------------------------*/ void PopupHelpShell (Widget w, XtPointer client_data, XtPointer call_data) { Widget helpText = (Widget)client_data; char *buffer; buffer = GetSource (HELP_FILE); XmTextSetString (helpText, buffer); } /*-------------------------------------------------------------* | SetLabelStr | *-------------------------------------------------------------*/ void SetLabelStr (XmString tcs) { XtVaSetValues(LabelW, XmNlabelString, tcs, NULL); } /*-------------------------------------------------------------* | SetLabel | *-------------------------------------------------------------*/ void SetLabel (char *label) { XmString tcs; tcs = XmStringCreateLocalized(label); SetLabelStr(tcs); XmStringFree(tcs); } /*-------------------------------------------------------------* | ShowFontDialogShell | *-------------------------------------------------------------*/ void ShowFontDialogShell (Widget parent, char *label) { Widget workText, list; static Widget dlog = NULL; int count; XmString *fonts; if (dlog == NULL) { fonts = DoTheFont(&count); dlog = XmCreateSelectionDialog(parent, label, NULL, 0); workText = XtVaCreateManagedWidget ("workText", xmTextWidgetClass, dlog, XmNeditable, True, XmNeditMode, XmMULTI_LINE_EDIT, XmNcolumns, 30, XmNrows, 3, XmNresizeHeight, False, XmNwordWrap, True, XmNvalue, TEST_STRING, NULL); XtVaSetValues(dlog, XmNwidth, 450, XmNheight, 450, XmNallowShellResize, True, XmNlistItems, fonts, XmNlistItemCount, count, XmNlistVisibleItemCount, 10, NULL); list = XmSelectionBoxGetChild(dlog, XmDIALOG_LIST); XtVaSetValues(list, XmNselectionPolicy, XmSINGLE_SELECT, NULL); XtUnmanageChild(XmSelectionBoxGetChild(dlog, XmDIALOG_APPLY_BUTTON)); XtAddCallback (dlog, XmNokCallback, FontSelectOK, NULL); XtAddCallback (dlog, XmNhelpCallback, FontTest, (XtPointer)workText); XtAddCallback (list, XmNsingleSelectionCallback, FontSelectApply, (XtPointer)workText); } XtManageChild(dlog); } /*-------------------------------------------------------------* | CreateHelpDialogShell | *-------------------------------------------------------------*/ void CreateHelpDialogShell (Widget parent, char *say) { static Widget dlog = NULL; Widget helpText, button; if (dlog == NULL) { dlog = XmCreateFormDialog(parent, "Help Window", NULL, 0); helpText = XtVaCreateManagedWidget("helpText", xmTextWidgetClass, dlog, XmNeditable, False, XmNeditMode, XmMULTI_LINE_EDIT, XmNcolumns, 50, XmNresizeHeight, True, XmNwordWrap, True, XmNleftAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, 30, NULL); button = XtVaCreateManagedWidget("dismiss", xmPushButtonWidgetClass, dlog, XmNleftAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, helpText, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL); XtAddCallback (XtParent(dlog), XmNpopupCallback, PopupHelpShell, (XtPointer)helpText); } XtManageChild(dlog); } /*-------------------------------------------------------------* | CreateTextWin | *-------------------------------------------------------------*/ Widget CreateTextWin (Widget parent) { Widget stext; char *buffer; XmString tcs; tcs = XmStringCreateLocalized ("Welcome to Motif"); LabelW = XtVaCreateManagedWidget("Label", xmLabelWidgetClass, parent, XmNleftAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNlabelString, tcs, XmNmarginHeight, 5, XmNshadowThickness, 1, NULL); XmStringFree (tcs); stext = XmCreateScrolledText(parent, "s_text", NULL, 0); XtVaSetValues(stext, XmNeditMode, XmMULTI_LINE_EDIT, XmNeditable, False, XmNcolumns, 80, XmNrows, 30, NULL); XtVaSetValues(XtParent(stext), XmNleftAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_WIDGET, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNtopWidget, LabelW, XmNleftOffset, 5, XmNrightOffset, 5, XmNbottomOffset, 5, XmNheight, 550, XmNwidth, 500, XmNresizeWidth, True, XmNresizeHeight, False, NULL); XtManageChild(stext); buffer = GetSource (WELCOME_FILE); XmTextSetString (stext, buffer); return(stext); } /*-------------------------------------------------------------* | GetFileLen | *-------------------------------------------------------------*/ int GetFileLen (int fd) { static int retval; #if defined(L_SET) && defined(L_XTND) lseek (fd, 0, L_SET); retval = lseek (fd, 0, L_XTND); lseek (fd, 0, L_SET); #else lseek (fd, 0, SEEK_SET); retval = lseek (fd, 0, SEEK_END); lseek (fd, 0, SEEK_SET); #endif return (retval); } /*-------------------------------------------------------------* | SysCall | *-------------------------------------------------------------*/ void SysCall (Widget widget, char *systemCommand, Boolean set_uidpath) { #define CMD "find .. -name '%s' \\( -type f -o -type l \\) -print" char str[256]; char *findCmd; FILE *file; pid_t p; if ((p = fork()) == 0) { /* note - execlp uses PATH */ execlp(systemCommand, systemCommand, NULL); /* if we fail to find the systemCommand, use 'find' to look for it. */ fprintf(stderr, "can't find %s\n", systemCommand); findCmd = (char *) XtMalloc(strlen(systemCommand) + sizeof(CMD) + 1); sprintf(findCmd, CMD, systemCommand); file = popen(findCmd, "r"); XtFree(findCmd); /* If this program is not on our path, then it's uid file */ /* probably isn't either. Set UIDPATH if requested and unset. */ if (set_uidpath) set_uidpath = (getenv("UIDPATH") == NULL); while(fgets(str, 80, file) != NULL) { str[strlen(str)-1] = '\0'; printf("Trying: %s\n", str); if (set_uidpath) { #ifndef NO_PUTENV char *uidpath = XtMalloc(8 + strlen(str) + 4 + 1); sprintf(uidpath, "UIDPATH=%s.uid", str); putenv(uidpath); #else char *uidpath = XtMalloc(strlen(str) + 4 + 1); sprintf(uidpath, "%s.uid", str); setenv("UIDPATH", uidpath, 1); #endif } execl(str, systemCommand, NULL); printf("Still can't find %s...\n", systemCommand); } printf("I give up!\n"); exit(0); } } /*-------------------------------------------------------------* | Quit | *-------------------------------------------------------------*/ void Quit(int i) { printf("Bye!\n"); exit(0); } /*-------------------------------------------------------------* | Menu1CB | | File pulldown menu items. | *-------------------------------------------------------------*/ void Menu1CB (Widget w, XtPointer clientData, XtPointer callData) { int itemNo = (int)clientData; switch (itemNo) { case 0: Quit(0); break; /* Quit */ } } /*-------------------------------------------------------------* | Menu2CB | | OSF Happenings pulldown menu items. | *-------------------------------------------------------------*/ void Menu2CB (Widget w, XtPointer clientData, XtPointer callData) { int itemNo = (int)clientData; char *buffer = NULL; XmString labelStr; XtVaGetValues(w, XmNlabelString, &labelStr, NULL); SetLabelStr (labelStr); switch (itemNo) { case 0: buffer = GetSource (MEMBERSHIP_FILE); break; case 1: buffer = GetSource (RESEARCH_FILE); break; case 2: buffer = GetSource (PRINCIPLES_FILE); break; case 3: buffer = GetSource (MOTIF_FILE); break; } XmTextSetString (TextWin, buffer); } /*-------------------------------------------------------------* | Menu3CB | | Demos pulldown menu items. | *-------------------------------------------------------------*/ void Menu3CB (Widget w, XtPointer clientData, XtPointer callData) { int itemNo = (int)clientData; XmString labelStr; XtVaGetValues(w, XmNlabelString, &labelStr, NULL); SetLabelStr (labelStr); switch (itemNo) { case 0: SysCall (w, "periodic", True); break; case 1: SysCall (w, "dogs", True); break; case 2: SysCall (w, "motifanim", False); break; } } /*-------------------------------------------------------------* | Menu4CB | | Unix Commands pulldown menu items. | *-------------------------------------------------------------*/ void Menu4CB (Widget w, XtPointer clientData, XtPointer callData) { int itemNo = (int)clientData; char *buffer; XmString labelStr; switch (itemNo) { case 0: /* File Listing */ { XtVaGetValues(w, XmNlabelString, &labelStr, NULL); SetLabelStr (labelStr); system ("ls -al > /tmp/motifshell.tmp"); buffer = GetSource ("/tmp/motifshell.tmp"); XmTextSetString (TextWin, buffer); system ("rm -r /tmp/motifshell.tmp"); break; } case 1: /* Process Status */ { XtVaGetValues(w, XmNlabelString, &labelStr, NULL); SetLabelStr (labelStr); #ifdef linux system ("ps a > /tmp/motifshell.tmp"); #else system ("ps -a > /tmp/motifshell.tmp"); #endif buffer = GetSource ("/tmp/motifshell.tmp"); XmTextSetString (TextWin, buffer); system ("rm -r /tmp/motifshell.tmp"); break; } case 2: /* Show Source */ { XtVaGetValues(w, XmNlabelString, &labelStr, NULL); SetLabelStr (labelStr); buffer = GetSource (filename); XtVaSetValues(TextWin, XmNvalue, buffer, NULL); break; } } } /*-------------------------------------------------------------* | Menu5CB | | X Programs pulldown menu items. | *-------------------------------------------------------------*/ void Menu5CB (Widget w, XtPointer clientData, XtPointer callData) { int itemNo = (int)clientData; switch (itemNo) { case 0: SysCall (w, "xterm", False); break; case 1: SysCall (w, "xclock", False); break; case 2: SysCall (w, "xload", False); break; } } /*-------------------------------------------------------------* | Menu6CB | | Font pulldown menu items. | *-------------------------------------------------------------*/ void Menu6CB (Widget w, XtPointer clientData, XtPointer callData) { int itemNo = (int)clientData; switch (itemNo) { case 0: /* Load... */ { ShowFontDialogShell (XtParent(w), "List O' Fonts"); break; } } } /*-------------------------------------------------------------* | Menu7CB | | Help pulldown menu items. | *-------------------------------------------------------------*/ void Menu7CB (Widget w, XtPointer clientData, XtPointer callData) { int itemNo = (int)clientData; switch (itemNo) { case 0: /* Are you sure? */ { CreateHelpDialogShell (XtParent(w), "Help Window"); break; } } } static char *menuString[] = { "File", "OSF Happenings", "Demos", "Unix Commands", "X Programs", "Font", "Help" }; static char *subString[][XtNumber(menuString)] = { { "Quit" }, { "OSF Membership", "OSF's Research Institute", "OSF's Principles", "OSF/Motif" }, { "Periodic Table", "Dogs", "Animation" }, { "File Listing", "Process Status", "Show Source" }, { "Xterm", "Xclock", "Xload"}, { "Load..." }, { "Are you sure ?" } }; /*-------------------------------------------------------------* | CreateMenuBar | *-------------------------------------------------------------*/ Widget CreateMenuBar (Widget parent) { int i; XmString s[10]; Widget menuBar, helpCascade; menuBar = XmVaCreateSimpleMenuBar(parent, "MenuBar", XmVaCASCADEBUTTON, s[0] = XmStringCreateSimple(menuString[0]), menuString[0][0], XmVaCASCADEBUTTON, s[1] = XmStringCreateSimple(menuString[1]), menuString[1][0], XmVaCASCADEBUTTON, s[2] = XmStringCreateSimple(menuString[2]), menuString[2][0], XmVaCASCADEBUTTON, s[3] = XmStringCreateSimple(menuString[3]), menuString[3][0], XmVaCASCADEBUTTON, s[4] = XmStringCreateSimple(menuString[4]), menuString[4][0], XmVaCASCADEBUTTON, s[5] = XmStringCreateSimple(menuString[5]), menuString[5][0], XmVaCASCADEBUTTON, s[6] = XmStringCreateSimple(menuString[6]), menuString[6][0], NULL); for (i=0; i<=6; i++) XmStringFree(s[i]); XmVaCreateSimplePulldownMenu(menuBar, menuString[0], 0, Menu1CB, /* File */ XmVaPUSHBUTTON, s[0] = XmStringCreateSimple(subString[0][0]), NULL, NULL, NULL, NULL); for (i=0; i<1; i++) XmStringFree(s[i]); XmVaCreateSimplePulldownMenu(menuBar, menuString[1], 1, Menu2CB, /* OSF Happenings */ XmVaPUSHBUTTON, s[0] = XmStringCreateSimple(subString[1][0]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[1] = XmStringCreateSimple(subString[1][1]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[2] = XmStringCreateSimple(subString[1][2]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[3] = XmStringCreateSimple(subString[1][3]), NULL, NULL, NULL, NULL); for (i=0; i<=3; i++) XmStringFree(s[i]); XmVaCreateSimplePulldownMenu(menuBar, menuString[2], 2, Menu3CB, /* Demos */ XmVaPUSHBUTTON, s[0] = XmStringCreateSimple(subString[2][0]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[1] = XmStringCreateSimple(subString[2][1]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[2] = XmStringCreateSimple(subString[2][2]), NULL, NULL, NULL, NULL); for (i=0; i<=2; i++) XmStringFree(s[i]); XmVaCreateSimplePulldownMenu(menuBar, menuString[3], 3, Menu4CB, /* Unix Commands */ XmVaPUSHBUTTON, s[0] = XmStringCreateSimple(subString[3][0]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[1] = XmStringCreateSimple(subString[3][1]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[2] = XmStringCreateSimple(subString[3][2]), NULL, NULL, NULL, NULL); for (i=0; i<=2; i++) XmStringFree(s[i]); XmVaCreateSimplePulldownMenu(menuBar, menuString[4], 4, Menu5CB, /* X Programs */ XmVaPUSHBUTTON, s[0] = XmStringCreateSimple(subString[4][0]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[1] = XmStringCreateSimple(subString[4][1]), NULL, NULL, NULL, XmVaPUSHBUTTON, s[2] = XmStringCreateSimple(subString[4][2]), NULL, NULL, NULL, NULL); for (i=0; i<=2; i++) XmStringFree(s[i]); XmVaCreateSimplePulldownMenu(menuBar, menuString[5], 5, Menu6CB, /* Font */ XmVaPUSHBUTTON, s[0] = XmStringCreateSimple(subString[5][0]), NULL, NULL, NULL, NULL); for (i=0; i<=0; i++) XmStringFree(s[i]); XmVaCreateSimplePulldownMenu(menuBar, menuString[6], 6, Menu7CB, /* Help */ XmVaPUSHBUTTON, s[0] = XmStringCreateSimple(subString[6][0]), NULL, NULL, NULL, NULL); for (i=0; i<=0; i++) XmStringFree(s[i]); XtVaSetValues(menuBar, XmNmenuHelpWidget, XtNameToWidget(menuBar, "button_6"), NULL); XtManageChild(menuBar); return (menuBar); } /*-------------------------------------------------------------* | main | *-------------------------------------------------------------*/ int main (int argc, char **argv) { Widget shell, mainWindow, workRegion, menuBar; signal(SIGHUP, Quit); signal(SIGINT, Quit); signal(SIGQUIT, Quit); system ("touch /tmp/motifshell.tmp"); system ("rm -r /tmp/motifshell.tmp"); XtToolkitInitialize(); AppContext = XtCreateApplicationContext(); if ((display = XtOpenDisplay (AppContext, NULL, argv[0], APP_CLASS, NULL, 0, &argc, argv)) == NULL) { fprintf (stderr,"\n%s: Can't open display\n", argv[0]); exit(1); } /* capture the source-code file name for use later. */ sprintf(filename, "%s.c", argv[0]); XmRepTypeInstallTearOffModelConverter(); shell = XtVaAppCreateShell(argv[0], APP_CLASS, applicationShellWidgetClass, display, XmNallowShellResize, True, NULL); mainWindow = XtVaCreateManagedWidget("mainWindow", xmMainWindowWidgetClass, shell, XmNmarginWidth, 2, XmNmarginHeight, 2, NULL); workRegion = XtVaCreateManagedWidget("s_text", xmFormWidgetClass, mainWindow, NULL); menuBar = CreateMenuBar (mainWindow); TextWin = CreateTextWin (workRegion); XmMainWindowSetAreas(mainWindow, menuBar, NULL, NULL, NULL, workRegion); XtRealizeWidget(shell); XtAppMainLoop(AppContext); return 0; /* make compiler happy */ } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/motifshell/README�����������������������������������������������������0000644�0001750�0001750�00000002532�12672140200�016304� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 14:11:47 drk $ */ README for Motif Shell - A shell environment using motif motifshell V0.9 ------------- This directory contains the sources for motifshell. motifshell is a demo of an environment created using motif. The purpose of the demo is to show how motif may be used as an stand-alone environment for dispatching other programs and utilities. Motifshell is written in C code only. There are no UIL references. The makefile in the current directory should be all you need to compile the program. Bugs: 1) When you do a directory listing or a ps, you will notice this takes some time. I use a system () call and pipe the output to a file, and then read the file...I know, not real cool but given the time constraints...hey, it works. 2) There may be 'unaligned data access' errors on startup. 3) The attempts to execute some other X and unix commands fail because the executables can't be found. This should be easy to fix, just haven't looked into it. Please let me know of any bugs or misfeatures you find. If you fix or modify the code, please send the source so I can incorporate it into future releases. If you notice any other bugs in this demo, please see the bug list in the Release Notes to see if the problem is a known Toolkit defect. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/motifshell/Makefile.am������������������������������������������������0000644�0001750�0001750�00000000321�13145162623�017463� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = motifshell SOURCES = motifshell.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dainput/��������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014777� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dainput/Makefile.in���������������������������������������������������0000644�0001750�0001750�00000045532�13211512766�017010� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = dainput$(EXEEXT) subdir = demos/unsupported/dainput ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_dainput_OBJECTS = dainput.$(OBJEXT) dainput_dlg.$(OBJEXT) \ dainput_ui.$(OBJEXT) dainput_OBJECTS = $(am_dainput_OBJECTS) dainput_LDADD = $(LDADD) dainput_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(dainput_SOURCES) DIST_SOURCES = $(dainput_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in dainput_SOURCES = dainput.c dainput_dlg.c dainput_ui.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} noinst_HEADERS = dainput.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/dainput/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/dainput/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list dainput$(EXEEXT): $(dainput_OBJECTS) $(dainput_DEPENDENCIES) $(EXTRA_dainput_DEPENDENCIES) @rm -f dainput$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dainput_OBJECTS) $(dainput_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dainput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dainput_dlg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dainput_ui.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dainput/dainput_dlg.c�������������������������������������������������0000644�0001750�0001750�00000027303�12672140200�017363� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: dainput_dlg.c /main/5 1995/07/15 20:47:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <Xm/XmP.h> /* for XmeGetDefaultRenderTable */ #include <Xm/XmIm.h> #include <stdlib.h> #include "dainput.h" typedef struct _DaTextDataRec { char * text; /* Contains the (multibyte) text */ long text_length; /* Current number of bytes displayed */ long alloced_length; /* Allocated nuber of bytes */ XFontStruct * font; /* Font for displaying text */ XFontSet font_set; /* Font set for displaying text - takes precedence over font */ GC gc; /* GC for drawing text */ Dimension baseline; /* Baseline for displayed text */ Dimension lineheight; /* line height for font or font set */ Dimension cursor_pos; /* X position for insertion cursor */ } DaTextDataRec, *DaTextData; /**************************************************************** * GetGC: * Get a gc for drawing text and lines in the drawing area. ****************************************************************/ static void GetGC(Widget widget, DaTextData text_data) { Pixel foreground; XtGCMask value_mask = GCForeground|GCLineWidth; XGCValues values; XtVaGetValues(widget, XmNforeground, &foreground, NULL); values.foreground = foreground; values.line_width = 1; if (text_data->font) { values.font = text_data->font->fid; value_mask |= GCFont; } text_data->gc = XtGetGC(widget, value_mask, &values); } /**************************************************************** * GetFont: * Get a font for drawing text. Gets the default text render * table, and extract the font or fontset from the rendition * tagged XmFONTLIST_DEFAULT_TAG. Use the first font set or font * found if there is no such rendition. Also fills in baseline * and lineheight values. ****************************************************************/ static void GetFont(Widget widget, DaTextData text_data) { XmRenderTable rt; XmFontContext context; XmFontListEntry next_entry; XmFontType type_return = XmFONT_IS_FONT; XtPointer tmp_font; Boolean have_font_struct = False; Boolean have_font_set = False; char* font_tag = NULL; rt = XmeGetDefaultRenderTable(widget, XmTEXT_FONTLIST); if (!XmFontListInitFontContext(&context, rt)) return; do { next_entry = XmFontListNextEntry(context); if (next_entry) { tmp_font = XmFontListEntryGetFont(next_entry, &type_return); font_tag = XmFontListEntryGetTag(next_entry); if (strcmp(XmFONTLIST_DEFAULT_TAG, font_tag) == 0) { /* If there is a real font in this font entry, we're done */ if (type_return == XmFONT_IS_FONTSET) { text_data->font_set = (XFontSet)tmp_font; text_data->font = NULL; break; } else if (type_return == XmFONT_IS_FONT) { text_data->font = (XFontStruct *)tmp_font; text_data->font_set = NULL; break; } } else { /* save the first one in case no font is found * in default entry. Font sets prevail over fonts */ if (type_return == XmFONT_IS_FONTSET) { if (!have_font_set) { text_data->font_set = (XFontSet)tmp_font; have_font_set = True; } } else if (type_return == XmFONT_IS_FONT) { if (!have_font_struct && !have_font_set) { text_data->font = (XFontStruct*)tmp_font; have_font_struct = True; } } } if (font_tag) XtFree(font_tag); } } while (next_entry != NULL); XmFontListFreeFontContext(context); if (text_data->font_set) { XFontSetExtents *fs_extents; fs_extents = XExtentsOfFontSet(text_data->font_set); text_data->baseline = -fs_extents->max_logical_extent.y; text_data->lineheight = fs_extents->max_logical_extent.height; } else if (text_data->font) { text_data->baseline = text_data->font->max_bounds.ascent; text_data->lineheight = (text_data->font->max_bounds.ascent + text_data->font->max_bounds.descent); } } /**************************************************************** * DaExit: * Exit application. ****************************************************************/ /*CCB*/ void DaExit(Widget widget, XtPointer client_data, XtPointer calldata) { exit(0); } /**************************************************************** * DaOverView: * Show help information. ****************************************************************/ /*CCB*/ void DaOverView(Widget widget, XtPointer client_data, XtPointer calldata) { /* Not yet implemented */ } /**************************************************************** * DaRedrawText: * Draw a line one pixel below the text baseline. * Draw the text. * Draw a cursor marking where the next character typed will be * drawn. ****************************************************************/ /*CCB*/ void DaRedrawText(Widget widget, XtPointer client_data, XtPointer calldata) { DaTextData text_data = NULL; Dimension margin_width, margin_height, width; XPoint points[3]; XtVaGetValues(widget, XmNuserData, &text_data, XmNmarginWidth, &margin_width, XmNmarginHeight, &margin_height, XmNwidth, &width, NULL); if (text_data == NULL) { /* First time through - allocate the extra data we need */ text_data = (DaTextData)XtCalloc(1, sizeof(DaTextDataRec)); text_data->alloced_length = 20; text_data->text = XtMalloc(text_data->alloced_length); GetFont(widget, text_data); GetGC(widget, text_data); text_data->cursor_pos = margin_width; XtVaSetValues(widget, XmNuserData, text_data, NULL); } /* Draw baseline */ XDrawLine(XtDisplay(widget), XtWindow(widget), text_data->gc, margin_width, text_data->baseline + margin_height + 1, width - margin_width, text_data->baseline + margin_height + 1); /* If there is text, draw it */ if (text_data->text_length > 0) { if (text_data->font_set) { XmbDrawString(XtDisplay(widget), XtWindow(widget), text_data->font_set, text_data->gc, margin_width, text_data->baseline + margin_height, text_data->text, text_data->text_length); } else if (text_data->font) { XDrawString(XtDisplay(widget), XtWindow(widget), text_data->gc, margin_width, text_data->baseline + margin_height, text_data->text, text_data->text_length); } } /* Draw the cursor */ points[0].x = text_data->cursor_pos - 3; points[0].y = text_data->baseline + margin_height + 3; points[1].x = 3; points[1].y = -3; points[2].x = 4; points[2].y = 4; XDrawLines(XtDisplay(widget), XtWindow(widget), text_data->gc, points, 3, CoordModePrevious); (points[0].y)--; XDrawLines(XtDisplay(widget), XtWindow(widget), text_data->gc, points, 3, CoordModePrevious); } /**************************************************************** * DaInputText: * If we received a keypress event, check whether any character(s) * was typed. If so, add it to the text, forward the cursor * position and redraw. ****************************************************************/ /*CCB*/ void DaInputText(Widget widget, XtPointer client_data, XtPointer calldata) { DaTextData text_data = NULL; XmAnyCallbackStruct *cbs = (XmAnyCallbackStruct *)calldata; XPoint spot; Dimension margin_width, margin_height; if (cbs->event && cbs->event->type == KeyPress) { char insert_string[100]; int insert_length; Status status_return; XtVaGetValues(widget, XmNuserData, &text_data, XmNmarginWidth, &margin_width, XmNmarginHeight, &margin_height, NULL); /* Get the characters typed, if any */ insert_length = XmImMbLookupString(widget, (XKeyEvent *) cbs->event, insert_string, 100, NULL, &status_return); /* if we got any text, append it to the rest */ if (insert_length > 0 && (status_return == XLookupChars || status_return == XLookupBoth)) { if (text_data->text_length + insert_length > text_data->alloced_length) { text_data->alloced_length += insert_length + 20; text_data->text = XtRealloc(text_data->text, text_data->alloced_length); } strncpy(&(text_data->text[text_data->text_length]), insert_string, insert_length); text_data->text_length += insert_length; /* compute new cursor position */ if (text_data->text_length > 0) { if (text_data->font_set) { text_data->cursor_pos = margin_width + XmbTextEscapement(text_data->font_set, text_data->text, text_data->text_length); } else if (text_data->font) { text_data->cursor_pos = margin_width + XTextWidth(text_data->font, text_data->text, text_data->text_length); } } /* Tell input method about new cursor position */ spot.x = text_data->cursor_pos; spot.y = text_data->baseline + margin_height; XmImVaSetValues(widget, XmNspotLocation, &spot, NULL); } /* redraw the text. This isn't very efficient, but it does the job... */ XClearWindow(XtDisplay(widget), XtWindow(widget)); DaRedrawText(widget, NULL, NULL); } } /**************************************************************** * DaResizedText: * Widget was resized. Redisplay the window. ****************************************************************/ /*CCB*/ void DaResizedText(Widget widget, XtPointer client_data, XtPointer calldata) { /* redraw the text. This isn't very efficient or smart, but it does the job... */ XClearWindow(XtDisplay(widget), XtWindow(widget)); DaRedrawText(widget, NULL, NULL); } /**************************************************************** * DaFocusHandler: * Keyboard focus movement event handler. Inform the input * method when we lose or gain keyboard focus. ****************************************************************/ void DaFocusHandler(Widget widget, XtPointer client_data, XEvent *event, Boolean *cont) { DaTextData text_data = NULL; XPoint spot; XmRenderTable rt; Dimension margin_height; if (!event) return; XtVaGetValues(widget, XmNuserData, &text_data, XmNmarginHeight, &margin_height, NULL); switch (event->type) { case FocusIn: case EnterNotify: /* Tell input method about our cursor position, line spacing * and font. */ if (text_data) { spot.x = text_data->cursor_pos; spot.y = text_data->baseline + margin_height; } else { spot.x = spot.y = 10; } rt = XmeGetDefaultRenderTable(widget, XmTEXT_FONTLIST); XmImVaSetFocusValues(widget, XmNspotLocation, &spot, XmNrenderTable, rt, /* since DrawingArea does not have a resource */ XmNlineSpace, (text_data ? text_data->lineheight : 10), NULL); break; case FocusOut: case LeaveNotify: XmImUnsetFocus(widget); break; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dainput/dainput.h�����������������������������������������������������0000644�0001750�0001750�00000004037�12672140200�016541� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: dainput.h /main/5 1995/07/15 20:47:24 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _dainput_h_ #define _dainput_h_ #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern void DaExit(Widget widget, XtPointer client_data, XtPointer calldata); extern void DaOverView(Widget widget, XtPointer client_data, XtPointer calldata); extern void DaRedrawText(Widget widget, XtPointer client_data, XtPointer calldata); extern void DaInputText(Widget widget, XtPointer client_data, XtPointer calldata); extern void DaResizedText(Widget widget, XtPointer client_data, XtPointer calldata); extern void DaFocusHandler(Widget widget, XtPointer client_data, XEvent * event, Boolean * cont); extern Widget DaCreateGui(char * name, char * aclass, int argc, char ** argv, Display * display); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dainput/dainput_ui.c��������������������������������������������������0000644�0001750�0001750�00000013634�12672140200�017234� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: dainput_ui.c /main/5 1995/07/15 20:47:32 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <memory.h> #include <Xm/Xm.h> #include <Xm/CascadeB.h> #include <Xm/CascadeBG.h> #include <Xm/DrawingA.h> #include <Xm/MainW.h> #include <Xm/PushB.h> #include <Xm/RowColumn.h> #include <Xm/XmIm.h> #include "dainput.h" #define WI_DAINPUT 0 #define WI_MAINWINDOW 1 #define WI_MENUBAR 2 #define WI_FILE 3 #define WI_FILEMENU 4 #define WI_EXIT 5 #define WI_HELP 6 #define WI_HELPMENU 7 #define WI_OVERVIEW 8 #define WI_WORKAREA 9 /**************************************************************** * * Main C code for presentation component * ****************************************************************/ /************************************************************** * DaCreateGui: **************************************************************/ Widget DaCreateGui(char * name, char * aclass, int argc, char ** argv, Display * display) { Arg args[15]; Widget widget_array[10]; int n; /***************** object of type : ApplicationShell *****************/ n = 0; /* Setup argc & argv attribute */ XtSetArg(args[n], XtNargc, argc); n++; XtSetArg(args[n], XtNargv, argv); n++; widget_array[WI_DAINPUT] = XtAppCreateShell(name, aclass, applicationShellWidgetClass, display, args, n); /***************** mainWindow : XmMainWindow *****************/ widget_array[WI_MAINWINDOW] = XmCreateMainWindow(widget_array[WI_DAINPUT], "mainWindow", NULL, 0); /***************** menuBar : XmMenuBar *****************/ widget_array[WI_MENUBAR] = XmCreateMenuBar(widget_array[WI_MAINWINDOW], "menuBar", NULL, 0); /***************** File : XmCascadeButton *****************/ widget_array[WI_FILE] = XmCreateCascadeButton(widget_array[WI_MENUBAR], "File", NULL, 0); /***************** fileMenu : XmPulldownMenu *****************/ widget_array[WI_FILEMENU] = XmCreatePulldownMenu(widget_array[WI_MENUBAR], "fileMenu", NULL, 0); { Arg args[1]; XtSetArg(args[0], XmNsubMenuId, widget_array[WI_FILEMENU]); XtSetValues(widget_array[WI_FILE], args, 1); } /***************** Exit : XmPushButton *****************/ widget_array[WI_EXIT] = XmCreatePushButton(widget_array[WI_FILEMENU], "Exit", NULL, 0); XtAddCallback(widget_array[WI_EXIT], XmNactivateCallback, DaExit, NULL); /***************** Help : XmCascadeButton *****************/ widget_array[WI_HELP] = XmCreateCascadeButton(widget_array[WI_MENUBAR], "Help", NULL, 0); /***************** helpMenu : XmPulldownMenu *****************/ widget_array[WI_HELPMENU] = XmCreatePulldownMenu(widget_array[WI_MENUBAR], "helpMenu", NULL, 0); { Arg args[1]; XtSetArg(args[0], XmNsubMenuId, widget_array[WI_HELPMENU]); XtSetValues(widget_array[WI_HELP], args, 1); } /***************** Overview : XmPushButton *****************/ widget_array[WI_OVERVIEW] = XmCreatePushButton(widget_array[WI_HELPMENU], "Overview", NULL, 0); XtAddCallback(widget_array[WI_OVERVIEW], XmNactivateCallback, DaOverView, NULL); /***************** workArea : XmDrawingArea *****************/ n = 0; XtSetArg(args[n], XmNwidth, 300); n++; XtSetArg(args[n], XmNheight, 35); n++; widget_array[WI_WORKAREA] = XmCreateDrawingArea(widget_array[WI_MAINWINDOW], "workArea", args, n); /* * Register drawing area for input method support and set input * context values. */ XmImRegister(widget_array[WI_WORKAREA], 0); { Pixel bg, fg; Pixmap bg_pixmap; n = 0; XtSetArg(args[n], XmNbackground, &bg); n++; XtSetArg(args[n], XmNforeground, &fg); n++; XtSetArg(args[n], XmNbackgroundPixmap, &bg_pixmap);n++; XtGetValues(widget_array[WI_WORKAREA], args, n); n = 0; XtSetArg(args[n], XmNbackground, bg); n++; XtSetArg(args[n], XmNforeground, fg); n++; XtSetArg(args[n], XmNbackgroundPixmap, bg_pixmap);n++; XmImSetValues(widget_array[WI_WORKAREA], args, n); } /* * Add event handler for focus events. This is needed for the * input method to correctly display the input area. */ XtAddEventHandler(widget_array[WI_WORKAREA], EnterWindowMask|LeaveWindowMask|FocusChangeMask, False, DaFocusHandler, NULL); XtAddCallback(widget_array[WI_WORKAREA], XmNexposeCallback, DaRedrawText, NULL); XtAddCallback(widget_array[WI_WORKAREA], XmNinputCallback, DaInputText, NULL); XtAddCallback(widget_array[WI_WORKAREA], XmNresizeCallback, DaResizedText, NULL); /***************** menuBar : XmMenuBar *****************/ n = 0; XtSetArg(args[n], XmNmenuHelpWidget, widget_array[WI_HELP]); n++; XtSetValues(widget_array[WI_MENUBAR], args, n); XtManageChild(widget_array[WI_EXIT]); XtManageChild(widget_array[WI_FILE]); XtManageChild(widget_array[WI_OVERVIEW]); XtManageChild(widget_array[WI_HELP]); XtManageChild(widget_array[WI_MENUBAR]); XtManageChild(widget_array[WI_WORKAREA]); XtManageChild(widget_array[WI_MAINWINDOW]); /* * Return the first created widget. */ return widget_array[WI_DAINPUT]; } ����������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dainput/README��������������������������������������������������������0000644�0001750�0001750�00000000747�12672140200�015610� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 14:10:57 drk $ */ DAINPUT ------- This demo shows how get internationalized text input in a drawingarea widget. It has the necessary calls to set up and handle the connection with the input method: XmImRegister, XmImSetValues, XmImSetFocusValues and XmImUnsetFocus. This demo only does text input. It does not try to be a text editor, so there is no way to delete text, select text etc. The intention is to show the use of the XmIm API. �������������������������motif-2.3.8/demos/unsupported/dainput/dainput.c�����������������������������������������������������0000644�0001750�0001750�00000006005�13066310437�016542� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: dainput.c /main/5 1995/07/15 20:47:20 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <locale.h> #include <X11/Intrinsic.h> #include <Xm/Xm.h> /* to get _NO_PROTO */ #include "dainput.h" /**************************************************************** * base: ****************************************************************/ static char *base(char *str) { static char basename[300]; char *p; if ((p = strrchr(str, '/'))) (void) strcpy(basename, p+1); else (void) strcpy(basename, str); if ((p = strrchr(basename, '.'))) *p ='\0'; return basename; } /************************************************************** * main: **************************************************************/ int main(int argc, char **argv) { XtAppContext app_context; Display * display; Widget top_level; char * aclass = "XmdDaInput"; char name[132]; char ** temp_argv = argv; (void) strncpy(name, base(argv[0]), 132); /* handle the '-name' option */ while (*temp_argv) { if (strcmp(*temp_argv, "-name") == 0) { (void) strncpy(name, *++temp_argv, 132); break; } temp_argv++; } /* Initialize the X Intrinsics */ XtToolkitInitialize(); /* Set up language environment */ XtSetLanguageProc(NULL, (XtLanguageProc)NULL, NULL); /* create application context */ app_context = XtCreateApplicationContext(); /* open up one display */ display = XtOpenDisplay(app_context, NULL, name, aclass, (XrmOptionDescRec *)NULL, 0, &argc, argv); if (!display) { (void) fprintf(stderr, "Unable to open display\n"); exit(0); } /* Create the user interface */ top_level = DaCreateGui(name, aclass, argc, argv, display); if (top_level == NULL) { (void) fprintf(stderr, "Unable to create user interface\n"); exit(1); } /* Realize and start event dispatching */ XtRealizeWidget(top_level); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dainput/Makefile.am���������������������������������������������������0000644�0001750�0001750�00000000412�13145162623�016762� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = dainput dainput_SOURCES = dainput.c dainput_dlg.c dainput_ui.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} noinst_HEADERS = dainput.h ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Makefile.in�����������������������������������������������������������0000644�0001750�0001750�00000047000�13211512766�015334� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/unsupported ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = dainput \ hellomotif \ xmapdef \ xmfonts \ xmforc \ xmform \ Exm \ aicon \ dogs \ uilsymdump \ motifshell EXTRA_DIST = all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/unsupported/uilsymdump/�����������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�015543� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/uilsymdump/Makefile.in������������������������������������������������0000644�0001750�0001750�00000045137�13211512767�017556� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = uilsymdump$(EXEEXT) subdir = demos/unsupported/uilsymdump ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) uilsymdump_SOURCES = uilsymdump.c uilsymdump_OBJECTS = uilsymdump.$(OBJEXT) uilsymdump_LDADD = $(LDADD) uilsymdump_DEPENDENCIES = ../../../clients/uil/libUil.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = uilsymdump.c DIST_SOURCES = uilsymdump.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(srcdir)/../../../clients -I$(srcdir)/../../../lib -I../../../clients -I$(top_builddir)/lib ${X_CFLAGS} EXTRA_DIST = LDADD = ../../../clients/uil/libUil.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/uilsymdump/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/uilsymdump/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list uilsymdump$(EXEEXT): $(uilsymdump_OBJECTS) $(uilsymdump_DEPENDENCIES) $(EXTRA_uilsymdump_DEPENDENCIES) @rm -f uilsymdump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(uilsymdump_OBJECTS) $(uilsymdump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uilsymdump.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/uilsymdump/README�����������������������������������������������������0000644�0001750�0001750�00000001071�12672140200�016343� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 14:12:08 drk $ */ This directory contains the sample UIL/Xm program, uilsymdump. This program uses the UIL callable interface to compile a source program. It also calls the UilDumpSymbolTable routine in order to show the contents of the symbol table (parse tree). You may wish to compile the callable UIL library with the debug flag for your compiler to use uilsymdump to its best advantage. If you notice any bugs in this demo, please see the bug list in the Release Notes to see if the problem is a known Toolkit defect. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/uilsymdump/uilsymdump.c�����������������������������������������������0000644�0001750�0001750�00000010230�13145162623�020045� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: uilsymdump.c /main/6 1998/04/17 11:26:22 mgreess $" #endif #endif #include <uil/UilDef.h> #include <stdio.h> #include <ctype.h> /* ** ** Table of Contents ** */ Uil_status_type MessageCB (); Uil_status_type StatusCB (); /* ** globals */ FILE *source_file; /* ** Entry point */ int main(int argc, char *argv[]) { Uil_command_type command_desc; Uil_compile_desc_type compile_desc; Uil_status_type return_status; int x = 1, y = 1; char *include_list[3]; char file_name[255], listing_name[255], uid_name[255]; /* ** Ask for the file name. */ printf("Enter file to be compiled (leave off the .uil): "); *file_name = '\0'; fgets (file_name, sizeof(file_name), stdin); if (strlen(file_name) && file_name[strlen(file_name)-1] == '\n') file_name[strlen(file_name)-1] = '\0'; strcpy (uid_name, file_name); strcat (uid_name, ".uid"); strcpy (listing_name, file_name); strcat (listing_name, ".lis"); strcat (file_name, ".uil"); /* ** Fill in the command decs */ command_desc.resource_file = uid_name; command_desc.listing_file = listing_name; command_desc.include_dir_count = 2; command_desc.include_dir = (char **)include_list; command_desc.source_file = file_name; include_list[0] = "com:"; include_list[1] = "../include"; command_desc.listing_file_flag = 1; command_desc.resource_file_flag = 1; command_desc.machine_code_flag = 1; command_desc.report_info_msg_flag = 1; command_desc.report_warn_msg_flag = 1; command_desc.parse_tree_flag = 1; command_desc.status_update_delay = 400; return_status = Uil(&command_desc, &compile_desc, MessageCB, (char *)&x, StatusCB, (char *)&y); UilDumpSymbolTable( (sym_entry_type *)compile_desc.parse_tree_root ); return return_status; } Uil_status_type MessageCB( message_user_data, msg_number, msg_severity, msg_text, src_text, ptr_text, loc_text, message_summary) int *message_user_data; /* Opaque, user-supplied argument */ int msg_number; /* constant to identify the error */ int msg_severity; /* severity level */ char *msg_text; /* text of message */ char *src_text; /* text of source line on which error occured */ char *ptr_text; /* source column information */ char *loc_text; /* location line */ unsigned int (*message_summary)[Uil_k_max_status+1]; { printf ("Message(%d) -- %d-%d-%s\n %s\n %s\n %s\n", *message_user_data, msg_number, msg_severity, msg_text, src_text, ptr_text, loc_text); *message_user_data = *message_user_data + 1; return Uil_k_continue; } Uil_status_type StatusCB( status_user_data, percent_complete, lines_processed, current_file, message_summary) int *status_user_data; unsigned int percent_complete; unsigned int lines_processed; char *current_file; unsigned int (*message_summary)[Uil_k_max_status+1]; { printf("Status(%d) -- Percent: %d, Lines: %d, File: %s\n", *status_user_data, percent_complete, lines_processed, current_file); *status_user_data = *status_user_data + 1; return Uil_k_continue; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/uilsymdump/Makefile.am������������������������������������������������0000644�0001750�0001750�00000000357�13145162623�017536� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = uilsymdump INCLUDES = -I$(srcdir)/../../../clients -I$(srcdir)/../../../lib -I../../../clients -I$(top_builddir)/lib ${X_CFLAGS} EXTRA_DIST = LDADD = ../../../clients/uil/libUil.la ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmapdef/��������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014757� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmapdef/Makefile.in���������������������������������������������������0000644�0001750�0001750�00000044740�13211512767�016771� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = xmapdef$(EXEEXT) subdir = demos/unsupported/xmapdef ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) xmapdef_SOURCES = xmapdef.c xmapdef_OBJECTS = xmapdef.$(OBJEXT) xmapdef_LDADD = $(LDADD) xmapdef_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = DIST_SOURCES = xmapdef.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SOURCES = xmapdef.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/xmapdef/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/xmapdef/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xmapdef$(EXEEXT): $(xmapdef_OBJECTS) $(xmapdef_DEPENDENCIES) $(EXTRA_xmapdef_DEPENDENCIES) @rm -f xmapdef$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xmapdef_OBJECTS) $(xmapdef_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmapdef.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������motif-2.3.8/demos/unsupported/xmapdef/xmapdef.c�����������������������������������������������������0000644�0001750�0001750�00000036010�12672140200�016470� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: xmapdef.c /main/4 1995/07/15 20:47:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* ** This demo shows an APPLICATION_DEFINED scrolled window. ** ** It's a file viewer that uses a FSB for filename input and ** a viewport with a vertical scrollbar to see the file. ** The file is shown using the per screen font resource. ** */ #include <stdio.h> #include <stdlib.h> #include <Xm/XmAll.h> /*------------------------------------------------------------- ** Forwarded functions */ void CreateApplication (); void WarnUser (); Widget CreateHelp (); /* Xt callbacks */ void DrawCB (); void ValueCB (); void OpenCB (); void ReadCB (); void QuitCB (); void HelpCB (); /*------------------------------------------------------------- ** File i/o and drawing stuff */ void InitFile (); Boolean BuildLineTable (); void ReDraw (); void ReSize (); typedef struct { Widget work_area ; Widget v_scrb ; String file_name ; XFontStruct * font_struct ; GC draw_gc ; char ** lines ; int num_lines ; } FileData ; /*------------------------------------------------------------- ** Main body */ int main(argc, argv) int argc; char **argv; { XtAppContext app_context; Widget toplevel ; FileData filedata ; toplevel = XtAppInitialize(&app_context, "XMdemos", NULL, 0, &argc, argv, NULL, NULL, 0); InitFile(toplevel, &filedata, argc, argv); CreateApplication (toplevel, &filedata); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } /*------------------------------------------------------------- ** Create a app_defined Main Window with a Menubar to load a file ** Add the vertical scrollbar and the workarea to filedata. */ void CreateApplication (parent, filedata) Widget parent; FileData * filedata; { Widget main_window, menu_bar, menu_pane, cascade, button ; Arg args[5]; int n ; /* Create app_defined MainWindow. */ n = 0; XtSetArg (args[n], XmNscrollingPolicy, XmAPPLICATION_DEFINED); n++; main_window = XmCreateMainWindow (parent, "main_window", args, n); XtManageChild (main_window); /* Create MenuBar in MainWindow. */ n = 0; menu_bar = XmCreateMenuBar (main_window, "menu_bar", args, n); XtManageChild (menu_bar); /* Create "File" PulldownMenu with Load and Quit buttons */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Open...", args, n); XtManageChild (button); /* pass the graphic id to the save function */ XtAddCallback (button, XmNactivateCallback, OpenCB, (XtPointer)filedata); n = 0; button = XmCreatePushButton (menu_pane, "Quit", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, QuitCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "File", args, n); XtManageChild (cascade); /* Create "Help" PulldownMenu with Help button. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Help", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, HelpCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "Help", args, n); XtManageChild (cascade); n = 0; XtSetArg (args[n], XmNmenuHelpWidget, cascade); n++; XtSetValues (menu_bar, args, n); /* Create vertical scrollbar only */ n = 0; XtSetArg (args[n], XmNorientation, XmVERTICAL); n++; filedata->v_scrb = XmCreateScrollBar (main_window, "v_scrb", args, n); XtAddCallback (filedata->v_scrb, XmNvalueChangedCallback, ValueCB, (XtPointer)filedata); XtManageChild (filedata->v_scrb); /* Create work_area in MainWindow */ n = 0; filedata->work_area = XmCreateDrawingArea(main_window, "work_area", args, n); XtAddCallback (filedata->work_area, XmNexposeCallback, DrawCB, (XtPointer)filedata); XtAddCallback (filedata->work_area, XmNresizeCallback, DrawCB, (XtPointer)filedata); XtManageChild (filedata->work_area); /* Set MainWindow areas */ XmMainWindowSetAreas (main_window, menu_bar, NULL, NULL, filedata->v_scrb, filedata->work_area); } /*------------------------------------------------------------- ** OpenCB - callback for Open button */ void OpenCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { static Widget fsb_box = NULL ; if (!fsb_box) { fsb_box = XmCreateFileSelectionDialog (w, "Load file", NULL, 0); /* just propagate the graphic information */ XtAddCallback (fsb_box, XmNokCallback, ReadCB, client_data); } XtManageChild (fsb_box); } /*------------------------------------------------------------- ** QuitCB - callback for quit button */ void QuitCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from applicaiton */ caddr_t call_data; /* data from widget class */ { exit (0); } /*------------------------------------------------------------- ** HelpCB - callback for help button */ void HelpCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { static Widget message_box = NULL ; if (!message_box) message_box = CreateHelp (w); XtManageChild (message_box); } /*------------------------------------------------------------- ** ReadCB - callback for fsb activate */ void ReadCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { FileData * filedata = (FileData *) client_data ; String file_name ; Arg args[5]; int n, slider_size ; Dimension height ; file_name = XmTextGetString( XmFileSelectionBoxGetChild(w, XmDIALOG_TEXT)) ; if (!BuildLineTable(filedata, file_name)) { WarnUser (w, "Cannot open %s\n", file_name); } else { filedata->file_name = file_name ; /* ok, we have a new file, so reset some values */ n = 0; XtSetArg (args[n], XmNheight, &height); n++; XtGetValues (filedata->work_area, args, n); slider_size = (height - 4) / (filedata->font_struct->ascent + filedata->font_struct->descent) ; if (slider_size <= 0) slider_size = 1 ; if (slider_size > filedata->num_lines) slider_size = filedata->num_lines ; n = 0 ; XtSetArg (args[n], XmNsliderSize, slider_size); n++; XtSetArg (args[n], XmNmaximum, filedata->num_lines); n++; XtSetArg (args[n], XmNvalue, 0); n++; XtSetValues (filedata->v_scrb, args, n); /* clear and redraw */ XClearWindow(XtDisplay(filedata->work_area), XtWindow(filedata->work_area)); ReDraw (filedata); } } /*------------------------------------------------------------- ** ValueCB - callback for scrollbar */ void ValueCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { FileData * filedata = (FileData *) client_data ; /* clear and redraw, dumb dumb.. */ XClearWindow(XtDisplay(filedata->work_area), XtWindow(filedata->work_area)); ReDraw(filedata); } /*------------------------------------------------------------- ** DrawCB - callback for drawing area */ void DrawCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { XmDrawingAreaCallbackStruct * dacs = (XmDrawingAreaCallbackStruct *) call_data ; FileData * filedata = (FileData *) client_data ; XSetWindowAttributes xswa; static Boolean first_time = True ; switch (dacs->reason) { case XmCR_EXPOSE: if (first_time) { /* Change once the bit gravity of the Drawing Area; default is north west and we want forget, so that resize always generates exposure events */ first_time = False ; xswa.bit_gravity = ForgetGravity ; XChangeWindowAttributes(XtDisplay(w), XtWindow(w), CWBitGravity, &xswa); } ReDraw(filedata) ; break ; case XmCR_RESIZE: ReSize(filedata) ; break ; } } /*------------------------------------------------------------- ** CreateHelp - create help window */ Widget CreateHelp (parent) Widget parent; /* parent widget */ { Widget button; Widget message_box; /* Message Dialog */ Arg args[20]; /* arg list */ register int n; /* arg count */ static char message[1000]; /* help text */ XmString title_string = NULL; XmString message_string = NULL; XmString button_string = NULL; /* Generate message to display. */ sprintf (message, "\ Use the Open button in the File menu to load a new file.\n\n\ Use the ScrollBar to scroll and the window manager to resize the main\n\ window and see the slider size change.\n\n\ You can specify which font to display the test using the\n\ XmNfont screen resource."); message_string = XmStringCreateLtoR (message, XmSTRING_DEFAULT_CHARSET); button_string = XmStringCreateLtoR ("Close", XmSTRING_DEFAULT_CHARSET); title_string = XmStringCreateLtoR ("General Help", XmSTRING_DEFAULT_CHARSET); /* Create MessageBox dialog. */ n = 0; XtSetArg (args[n], XmNdialogTitle, title_string); n++; XtSetArg (args[n], XmNokLabelString, button_string); n++; XtSetArg (args[n], XmNmessageString, message_string); n++; message_box = XmCreateMessageDialog (parent, "helpbox", args, n); button = XmMessageBoxGetChild (message_box, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild (button); button = XmMessageBoxGetChild (message_box, XmDIALOG_HELP_BUTTON); XtUnmanageChild (button); /* Free strings and return MessageBox. */ if (title_string) XmStringFree (title_string); if (message_string) XmStringFree (message_string); if (button_string) XmStringFree (button_string); return (message_box); } void WarnUser (widget, format, name) Widget widget ; String format ; String name ; { /* better ui needed */ printf(format, name); } /*************************** FILE STUFF **********************************/ void InitFile(widget, filedata, argc, argv) Widget widget; FileData * filedata; int argc; char **argv; { Arg args[5]; int n ; XGCValues val ; filedata->lines = NULL ; filedata->num_lines = 0 ; /* get the X font from the screen object and make a gc */ n = 0; /* do not use the screen object routine in 1.1 or lesser */ #if XmREVISION < 2 filedata->font_struct = XLoadQueryFont(XtDisplay(widget), "fixed"); #else XtSetArg (args[n], XmNfont, &(filedata->font_struct)); n++; XtGetValues (XmGetXmScreen(XDefaultScreenOfDisplay(XtDisplay(widget))), args, n); #endif val.font = filedata->font_struct->fid ; filedata->draw_gc = XtGetGC(widget, GCFont, &val); if (argc == 2) { if (BuildLineTable(filedata, argv[1])) { filedata->file_name = argv[1] ; } else { filedata->file_name = "" ; WarnUser(widget, "Cannot open %s\n", argv[1]); } } else { filedata->file_name = "" ; } } Boolean BuildLineTable(filedata, file_name) FileData * filedata ; String file_name ; { FILE *in_file ; char linebuff[256] ; if ((in_file = fopen(file_name, "r")) == NULL) { return False ; } else { /* free the current data */ if (filedata->num_lines) { while (filedata->num_lines-- >= 0) { XtFree(filedata->lines[filedata->num_lines]) ; } XtFree ((char*)filedata->lines) ; filedata->lines = NULL ; filedata->num_lines = 0 ; } /* allocate and fill new data */ while (fgets (linebuff, 256, in_file)) { filedata->num_lines ++ ; /* better fragmentation needed... */ filedata->lines = (char**) XtRealloc((char*)filedata->lines, filedata->num_lines * sizeof(char*)) ; filedata->lines[filedata->num_lines-1] = XtNewString(linebuff); } return True ; } } void ReDraw(filedata) FileData * filedata ; { /* Display as many line as slider_size actually shows, since slider_size is computed relative to the work_area height */ Cardinal i ; int value, slider_size ; Arg args[5]; int n ; Position y ; if (filedata->num_lines == 0) return ; n = 0; XtSetArg (args[n], XmNvalue, &value); n++; XtSetArg (args[n], XmNsliderSize, &slider_size); n++; XtGetValues (filedata->v_scrb, args, n); for (i = value, y = 2 + filedata->font_struct->ascent; i < value + slider_size ; i++, y += (filedata->font_struct->ascent + filedata->font_struct->descent)) { XDrawString(XtDisplay(filedata->work_area), XtWindow(filedata->work_area), filedata->draw_gc, 4, y, filedata->lines[i], strlen(filedata->lines[i])); } } void ReSize(filedata) FileData * filedata ; { /* Just update the scrollbar internals here, don't bother to redisplay since the gravity is none */ Arg args[5]; int n ; int value, slider_size ; Dimension height ; if (filedata->num_lines == 0) return ; n = 0; XtSetArg (args[n], XmNheight, &height); n++; XtGetValues (filedata->work_area, args, n); /* sliderSize is the number of visible lines */ slider_size = (height - 4) / (filedata->font_struct->ascent + filedata->font_struct->descent) ; if (slider_size <= 0) slider_size = 1 ; if (slider_size > filedata->num_lines) slider_size = filedata->num_lines ; n = 0; XtSetArg (args[n], XmNvalue, &value); n++; XtGetValues (filedata->v_scrb, args, n); /* value shouldn't change that often but there are cases where it matters */ if (value > filedata->num_lines - slider_size) value = filedata->num_lines - slider_size; n = 0; XtSetArg (args[n], XmNsliderSize, slider_size); n++; XtSetArg (args[n], XmNvalue, value); n++; XtSetArg (args[n], XmNmaximum, filedata->num_lines); n++; XtSetValues (filedata->v_scrb, args, n); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmapdef/Makefile.am���������������������������������������������������0000644�0001750�0001750�00000000313�13145162623�016742� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = xmapdef SOURCES = xmapdef.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/aicon/����������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014424� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/aicon/Makefile.in�����������������������������������������������������0000644�0001750�0001750�00000044745�13211512766�016442� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = aicon$(EXEEXT) subdir = demos/unsupported/aicon ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) aicon_SOURCES = aicon.c aicon_OBJECTS = aicon.$(OBJEXT) aicon_LDADD = $(LDADD) aicon_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = aicon.c DIST_SOURCES = aicon.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} EXTRA_DIST = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/aicon/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/aicon/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list aicon$(EXEEXT): $(aicon_OBJECTS) $(aicon_DEPENDENCIES) $(EXTRA_aicon_DEPENDENCIES) @rm -f aicon$(EXEEXT) $(AM_V_CCLD)$(LINK) $(aicon_OBJECTS) $(aicon_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aicon.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������motif-2.3.8/demos/unsupported/aicon/aicon.c���������������������������������������������������������0000644�0001750�0001750�00000025354�13066310437�015624� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: aicon.c /main/5 1995/07/15 20:47:16 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdlib.h> #include <Xm/XmAll.h> #include <Xmd/AdjView.h> #include <Xmd/RegEdit.h> #include <Xmd/Help.h> #ifdef SYS_DIR #include <sys/dir.h> #else #ifdef NDIR #include <ndir.h> #else #include <dirent.h> #endif #endif #define APP_CLASS "XmdAIcon" typedef struct { String icon_dir; String valid_extensions; } ApplicationData, *ApplicationDataPtr; static ApplicationData AppData; /* no need for a prefix, this is not exported */ #define NiconDir "iconDir" #define CIconDir "IconDir" #define NvalidExtensions "validExtensions" #define CValidExtensions "ValidExtensions" static XtResource resources[] = { { NiconDir, CIconDir, XmRString, sizeof(String), XtOffset(ApplicationDataPtr, icon_dir), XmRString, "." }, { NvalidExtensions, CValidExtensions, XmRString, sizeof(String), XtOffset(ApplicationDataPtr, valid_extensions), XmRString, "xbm,xpm,bm,pm" }, }; /* * Fallbacks: keep it minimum */ static String fallbacks[] = { "*help_manager.helpFile: aicon", "aicon.geometry:700x500", NULL }; static void HelpCB (Widget w, XtPointer client_data, XtPointer call_data) { static Widget help_widget = NULL ; if (!help_widget) help_widget = XmdCreateHelpDialog(w, "help_manager", NULL, 0); XtManageChild(help_widget); } static void DefCB( Widget widget, XtPointer tag, XtPointer data) { XmContainerSelectCallbackStruct *cbs = (XmContainerSelectCallbackStruct*)data; Pixmap pix ; Window root; int x,y; unsigned int loc_width, loc_height, border_width, loc_depth; XtVaGetValues(cbs->selected_items[0], XmNlargeIconPixmap, &pix, NULL); if (pix != XmUNSPECIFIED_PIXMAP) { XGetGeometry(XtDisplay(widget), pix, &root, &x, &y, &loc_width, &loc_height, &border_width, &loc_depth); if (loc_depth == DefaultDepthOfScreen(XtScreen(widget))) { XSetWindowBackgroundPixmap(XtDisplay(widget), DefaultRootWindow(XtDisplay(widget)), pix); XClearWindow(XtDisplay(widget), DefaultRootWindow(XtDisplay(widget))); } } } static void AppModalDialogWarning (w, str) Widget w; String str; { static Widget warning_dialog = NULL ; XmString message_string ; if (!warning_dialog) { warning_dialog = XmCreateWarningDialog (w, "Huh ho", NULL, 0); XtAddCallback (warning_dialog, XmNhelpCallback, HelpCB, NULL); } message_string = XmStringGenerate((XtPointer) str, NULL, XmCHARSET_TEXT, NULL); XtVaSetValues(warning_dialog, XmNmessageString, message_string, NULL); XmStringFree(message_string); XtManageChild(warning_dialog); } static void PopulateContainer(cont, dir) Widget cont ; String dir ; { char icon_fullname[256] ; #if defined (SYS_DIR) || defined (NDIR) struct direct *item; /* entry in directory */ #else struct dirent *item; /* entry in directory */ #endif static Widget * icong = NULL ; static int n_icong = 0; Cardinal num_children, i; Widget * children ; int dir_len ; DIR *dirp; dir_len = strlen(dir) ; /* let's remove the FSB added * pattern */ if (dir[dir_len-1] == '*') dir[--dir_len] = '\0'; /* try to open the icons directory */ if (!(dirp = opendir (dir))) { char s[256] ; sprintf(s, "Cannot open iconDir: %s\n", dir); AppModalDialogWarning(cont, s); return; } /* first destroy current set of icons (if any) */ XtVaGetValues(cont, XmNnumChildren, &num_children, XmNchildren, &children, NULL); XtUnmanageChildren(children, num_children); for (i=0; i < num_children; i++) XtDestroyWidget(children[i]); strcpy(icon_fullname, dir); icon_fullname[dir_len] = '/' ; /* turn Container (back) to CELLS. Also ask for natural cell sizes */ XtVaSetValues (cont, XmNspatialStyle, XmCELLS, XmNlargeCellWidth, 0, XmNlargeCellHeight, 0, NULL); /* read one entry each time through the loop */ for (item = readdir (dirp), i = 0; item != NULL; item = readdir (dirp)) { /* reset the fullname every time */ icon_fullname[dir_len+1] = '\0' ; strcat(icon_fullname, item->d_name); if ((!strcmp (item->d_name, ".")) || (!strcmp (item->d_name, ".."))) continue ; /* check the extension only if ALL is not part of it */ if (!strstr(AppData.valid_extensions, "ALL")) { /* the extension is defined by anything after the last . */ String extension = strrchr(item->d_name, '.'); /* if no . or . is last char of the file name, invalid */ if (!extension || extension[1] == '\0') continue ; /* if the extension is in not the list, invalid */ if (!strstr(AppData.valid_extensions, extension+1)) continue; } if (i >= n_icong) { n_icong += 500 ; icong = (Widget*)XtRealloc((char*)icong, n_icong * sizeof(Widget*)); } icong[i] = XtVaCreateWidget(item->d_name, xmIconGadgetClass, cont, XtVaTypedArg, XmNlargeIconPixmap, XmRString, icon_fullname, strlen(icon_fullname)+1, NULL); i++; } XtManageChildren(icong, i); /* turn Container back to NONE */ XtVaSetValues (cont, XmNspatialStyle, XmNONE, NULL); } static void QuitCB (w, client_data, call_data) Widget w; /* widget id */ XtPointer client_data; /* data from application */ XtPointer call_data; /* data from widget class */ { exit(0); } static void UnMapCB (w, client_data, call_data) Widget w; /* widget id */ XtPointer client_data; /* data from application */ XtPointer call_data; /* data from widget class */ { XtUnmanageChild(w); } static void OKCB (w, client_data, call_data) Widget w; /* widget id */ XtPointer client_data; /* data from application */ XtPointer call_data; /* data from widget class */ { Widget cont = *(Widget*)client_data ; String dir ; unsigned char path_mode ; /* in CDE mode, the FilterText is useless, we have to look at the Directory text */ XtVaGetValues(w, XmNpathMode, &path_mode, NULL); if (path_mode != XmPATH_MODE_RELATIVE) dir = XmTextGetString(XtNameToWidget(w, "FilterText")); else dir = XmTextGetString(XtNameToWidget(w, "DirText")); PopulateContainer(cont, dir); } static void OpenCB (w, client_data, call_data) Widget w; /* widget id */ XtPointer client_data; /* data from application */ XtPointer call_data; /* data from widget class */ { static Widget fsb_box = NULL ; if (!fsb_box) { Arg args[2]; Cardinal n; XmString dir ; dir = XmStringGenerate((XtPointer) AppData.icon_dir, NULL, XmCHARSET_TEXT, NULL); n = 0; XtSetArg (args[n], XmNdirectory, dir); n++; fsb_box = XmCreateFileSelectionDialog (w, "Open Icon Dir", args, n); XtAddCallback (fsb_box, XmNhelpCallback, HelpCB, NULL); XmStringFree(dir); XtAddCallback (fsb_box, XmNokCallback, OKCB, client_data); XtAddCallback (fsb_box, XmNcancelCallback, UnMapCB, client_data); XtUnmanageChild(XtNameToWidget(fsb_box, "Selection")); XtUnmanageChild(XtNameToWidget(fsb_box, "Text")); } XtManageChild (fsb_box); } static Widget CreateMainWindowWithMenuBar(toplevel, client_data) Widget toplevel ; XtPointer client_data ; { Widget main_window, menu_bar, menu_pane, cascade, button ; Arg args[20]; Cardinal n; /* Create MainWindow. */ n = 0; main_window = XmCreateMainWindow (toplevel, "main_window", args, n); XtManageChild (main_window); /* Create MenuBar in MainWindow. */ n = 0; menu_bar = XmCreateMenuBar (main_window, "menu_bar", args, n); XtManageChild (menu_bar); /* Create "File" PulldownMenu. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Open...", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, OpenCB, client_data); n = 0; button = XmCreatePushButton (menu_pane, "Exit", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, QuitCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "File", args, n); XtManageChild (cascade); /* Create "Help" PulldownMenu. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane3", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Overview", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, HelpCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "Help", args, n); XtManageChild (cascade); n = 0; XtSetArg (args[n], XmNmenuHelpWidget, cascade); n++; XtSetValues (menu_bar, args, n); return main_window ; } int main(int argc, char **argv) { XtAppContext app_context; Widget toplevel, sw, cont, mainw ; XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaAppInitialize(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks, NULL); XtGetApplicationResources(toplevel, (XtPointer)&AppData, resources, XtNumber(resources), NULL, 0); XmdRegisterEditres(toplevel) ; mainw = CreateMainWindowWithMenuBar(toplevel, &cont); XtManageChild(mainw); /* we want a scrolledwindow because the container window can potentially be huge */ sw = XtVaCreateManagedWidget("sw", xmScrolledWindowWidgetClass, mainw, XmNscrollingPolicy, XmAUTOMATIC, NULL); cont = XtVaCreateManagedWidget("cont", xmContainerWidgetClass, sw, XmNspatialResizeModel, XmGROW_BALANCED, NULL); XtAddCallback(cont, XmNdefaultActionCallback, DefCB, NULL); /* setup our clipwindow/workwindow constraint stuff */ XmdSWAdjustView (sw) ; XtRealizeWidget(toplevel); PopulateContainer(cont, AppData.icon_dir); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/aicon/Makefile.am�����������������������������������������������������0000644�0001750�0001750�00000000342�13145162623�016411� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = aicon LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} EXTRA_DIST = ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmform/���������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014643� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmform/xmform.c�������������������������������������������������������0000644�0001750�0001750�00000016255�12672140200�016251� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: xmform.c /main/4 1995/07/15 20:47:50 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /**--------------------------------------------------------------------- *** *** file: xmform.c *** *** project: Motif Widgets example programs *** *** creation: Spring 91 - Cambridge *** Daniel Dardailler. *** *** description: This program demonstrates the possibilities of *** the Motif form widget. *** It can display a string of letters made from buttons *** and arrows (resizable using Form attachments). *** *** defaults: xmform looks nicer with these defaults: *** xmform*highlightThickness: 0 xmform.XmForm.shadowThickness: 3 xmform*XmPushButton.background: cadetblue xmform*XmArrowButton.foreground: cadetblue xmform*XmArrowButton.background: lightgrey xmform*XmForm.background: lightgrey xmform*topShadowColor: white xmform*bottomShadowColor: black ***-------------------------------------------------------------------*/ #include <Xm/Xm.h> #include <Xm/Form.h> #include <Xm/PushB.h> #include <Xm/ArrowB.h> static void FillItPlease(); static void NearlyEvenSpread(); static Widget AddStem() ; int main(argc, argv) int argc; char **argv; { XtAppContext app_context; Widget toplevel, topform, *forms ; Cardinal len_word, p ; String word = "MOTIF" ; char s[2] ; toplevel = XtAppInitialize(&app_context, "XMdemos", NULL, 0, &argc, argv, NULL, NULL, 0); topform = XmCreateForm(toplevel, "topform", NULL, 0); XtManageChild(topform); /* pick up the string to be displayed if any */ if (argc == 2) word = argv[1] ; /* create a form for each letter and fill it with the 'stem widgets' */ len_word = strlen(word); forms = (Widget*)calloc(len_word,sizeof(Widget)); s[1] = 0 ; /* string used for the subform widget name */ for (p = 0 ; p < len_word; p++) { s[0] = word[p] ; /* subform names are the letters themselves */ forms[p] = XmCreateForm(topform, s, NULL, 0); FillItPlease(forms[p], word[p]); } /* evenly spread out the forms with some spacing in between */ NearlyEvenSpread(forms, p, 2, /* horizontal spacing */ 9) ; /* vertical margin */ XtManageChildren(forms, p); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } static void NearlyEvenSpread(child_list, num_child, hor_spacing, ver_spacing) Widget * child_list; Cardinal num_child; Dimension hor_spacing; Dimension ver_spacing; { /* this algorithm works only for the default fractionBase == 100 */ /* hor_spacing and ver_margin are equally applied on each sides */ Dimension hor_child_room ; Cardinal n, i ; Arg args[10] ; hor_child_room = 100 / num_child ; for (i = 0 ; i < num_child ; i++) { n = 0 ; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION); n++ ; XtSetArg(args[n], XmNleftPosition, hor_child_room*i + hor_spacing); n++ ; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++ ; XtSetArg(args[n], XmNrightPosition, hor_child_room*(i+1) - hor_spacing); n++ ; XtSetArg(args[n], XmNtopAttachment, XmATTACH_POSITION); n++ ; XtSetArg(args[n], XmNtopPosition, ver_spacing); n++ ; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_POSITION); n++ ; XtSetArg(args[n], XmNbottomPosition, 100 - ver_spacing); n++ ; XtSetValues(child_list[i], args, n); } } static void FillItPlease(form, letter) Widget form ; char letter ; { /* This routine only handle the "MOTIF" letters, it's up to you to implement the rest, good luck for K,N,R,V,X,Y,Z... */ Cardinal n = 0, p = 0 ; Arg args[10] ; Widget child[10] ; switch(letter) { case 'M' : /* 2 buttons and the arrow in between on top */ child[p] = AddStem(form, 0, 25, 100, 0, XmPUSHBUTTON); p++; child[p] = AddStem(form, 0, 100, 100, 75, XmPUSHBUTTON); p++; child[p] = AddStem(form, 0, 75, 35, 25, NULL); p++; /* XtSetArg(args[n], XmNshadowThickness, 0); n++;*/ XtSetArg(args[n], XmNarrowDirection, XmARROW_DOWN); n++; XtSetValues(child[2], args, n); XtManageChildren(child, p); break ; case 'O' : /* 2 left and right vertical buttons and 2 horizontals */ child[p] = AddStem(form, 25, 25, 75, 0, XmPUSHBUTTON); p++; child[p] = AddStem(form, 0, 100, 25, 0, XmPUSHBUTTON); p++; child[p] = AddStem(form, 25, 100, 75, 75, XmPUSHBUTTON); p++; child[p] = AddStem(form, 75, 100, 100, 0, XmPUSHBUTTON); p++; XtManageChildren(child, p); break ; case 'T' : /* 1 vertical button and 1 horizontal on top */ child[p] = AddStem(form, 25, 63, 100, 38, XmPUSHBUTTON); p++; child[p] = AddStem(form, 0, 100, 25, 0, XmPUSHBUTTON); p++; XtManageChildren(child, p); break ; case 'I' : /* 1 vertical button + one arrow on top */ child[p] = AddStem(form, 0, 63, 25, 38, NULL); p++; child[p] = AddStem(form, 30, 63, 100, 38, XmPUSHBUTTON); p++; /* XtSetArg(args[n], XmNshadowThickness, 0); n++;*/ XtSetValues(child[0], args, n); XtManageChildren(child, p); break ; case 'F' : /* 1 vertical button and 2 horizontal on the right */ child[p] = AddStem(form, 0, 25, 100, 0, XmPUSHBUTTON); p++; child[p] = AddStem(form, 0, 100, 25, 25, XmPUSHBUTTON); p++; child[p] = AddStem(form, 36, 75, 61, 25, XmPUSHBUTTON); p++; XtManageChildren(child, p); break ; default: child[p] = AddStem(form, 0, 100, 100, 0, XmPUSHBUTTON); p++; XtManageChildren(child, p); break ; } } static Widget AddStem(form, top, right, bottom, left, type) Widget form ; Dimension top, right, bottom, left; int type ; { /* create an object, either a button or an arrow, using positionnal attachment everywhere, instead of possibly form attachment or widget attachment */ Cardinal n = 0 ; Arg args[10] ; XtSetArg(args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNtopPosition, top); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNrightPosition, right); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNbottomPosition, bottom); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNleftPosition, left); n++; if (type == XmPUSHBUTTON) return XmCreatePushButton(form, "", args, n); else return XmCreateArrowButton(form, "", args, n); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmform/Makefile.in����������������������������������������������������0000644�0001750�0001750�00000044713�13211512767�016655� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = xmform$(EXEEXT) subdir = demos/unsupported/xmform ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) xmform_SOURCES = xmform.c xmform_OBJECTS = xmform.$(OBJEXT) xmform_LDADD = $(LDADD) xmform_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = DIST_SOURCES = xmform.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SOURCES = xmform.c EXTRA_DIST = LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/xmform/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/xmform/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xmform$(EXEEXT): $(xmform_OBJECTS) $(xmform_DEPENDENCIES) $(EXTRA_xmform_DEPENDENCIES) @rm -f xmform$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xmform_OBJECTS) $(xmform_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmform.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������������������������motif-2.3.8/demos/unsupported/xmform/Makefile.am����������������������������������������������������0000644�0001750�0001750�00000000310�13145162623�016623� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = xmform SOURCES = xmform.c EXTRA_DIST = LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/hellomotif/�����������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�015475� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/hellomotif/Makefile.in������������������������������������������������0000644�0001750�0001750�00000045034�13211512767�017504� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = hellomotif$(EXEEXT) subdir = demos/unsupported/hellomotif ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) hellomotif_SOURCES = hellomotif.c hellomotif_OBJECTS = hellomotif.$(OBJEXT) hellomotif_LDADD = $(LDADD) hellomotif_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = DIST_SOURCES = hellomotif.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SOURCES = hellomotif.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/hellomotif/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/hellomotif/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list hellomotif$(EXEEXT): $(hellomotif_OBJECTS) $(hellomotif_DEPENDENCIES) $(EXTRA_hellomotif_DEPENDENCIES) @rm -f hellomotif$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hellomotif_OBJECTS) $(hellomotif_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hellomotif.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/hellomotif/hellomotif.c�����������������������������������������������0000644�0001750�0001750�00000007245�13066310437�017745� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: hellomotif.c /main/5 1995/07/15 20:47:36 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include <stdlib.h> #include <Xm/XmAll.h> #define APP_CLASS "XmdHelloMotif" /* Although it's really bad to hardcode Positions, keep this for a close hellomotif_in_c equivalence to the uil version */ #define NEW_BUTTON_X 11 /* not mentioning hardcoding labels... */ #define NEW_BUTTON_LABEL "Goodbye\nWorld!" static void Activate( Widget widget, XtPointer tag, XtPointer data); /* * Fallbacks: font, label and position go together in this demo */ static String fallbacks[] = { "hellomotif_in_c.allowShellResize: True", "hellomotif_in_c*fontList: fixed", "*helloworld_label.labelString:Press button once\\nto change label;\\ntwice to exit.", "*helloworld_button.x: 15", "*helloworld_button.y: 60", "*helloworld_button.labelString:Hello\nWorld!", NULL }; /* * Main program: create a shell, a pure bb with a label and a button * underneath it. Attach a callback to the button. */ int main(int argc, char *argv[]) { XtAppContext app_context; Widget top_level, helloworld_main, helloworld_label, helloworld_button ; /* * Initialize Xt and create a resizable shell */ top_level = XtVaAppInitialize(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks, NULL); /* * Create the widget tree: first the bb parent. */ helloworld_main = XtVaCreateManagedWidget ("helloworld_main", xmBulletinBoardWidgetClass, top_level, NULL); /* the label */ helloworld_label = XtVaCreateManagedWidget ("helloworld_label", xmLabelWidgetClass, helloworld_main, NULL); /* the button underneath the label */ helloworld_button = XtVaCreateManagedWidget ("helloworld_button", xmPushButtonWidgetClass, helloworld_main, NULL); /* add the callback to change the button label */ XtAddCallback(helloworld_button, XmNactivateCallback, Activate, NULL); /* * Realize the toplevel widget. This will cause the entire "managed" * widget hierarchy to be displayed */ XtRealizeWidget(top_level); /* * Loop and process events */ XtAppMainLoop(app_context); /* UNREACHABLE */ return (0); } static void Activate( Widget widget, XtPointer tag, XtPointer data) { static Boolean first_time = True ; /* First click: change the pushbutton label and recenter */ if (first_time) { XmString new_button_label = XmStringGenerate(NEW_BUTTON_LABEL, NULL, XmCHARSET_TEXT, NULL); XtVaSetValues(widget, XmNx, NEW_BUTTON_X, XmNlabelString, new_button_label, NULL); XmStringFree(new_button_label); first_time = False ; } else { exit(0); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/hellomotif/Makefile.am������������������������������������������������0000644�0001750�0001750�00000000321�13145162623�017457� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = hellomotif SOURCES = hellomotif.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014267� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/DogP.h�����������������������������������������������������������0000644�0001750�0001750�00000004435�12672140200�015220� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: DogP.h /main/5 1995/07/14 10:06:06 drk $ */ /***************************************************************************** * * DogP.H - widget private header file * ******************************************************************************/ #ifndef _DogP_h #define _DogP_h #include <Xm/PrimitiveP.h> #include "Dog.h" void _DogDrawPixmap(); void _DogPosition(); #define DogIndex (XmPrimitiveIndex + 1) typedef struct _DogClassPart { XtPointer reserved; } DogClassPart; typedef struct _DogClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; DogClassPart dog_class; } DogClassRec; extern DogClassRec dogClassRec; typedef struct _DogPart { int wag_time; int bark_time; XtCallbackList bark_callback; Boolean wagging; Boolean barking; GC draw_GC; Pixmap up_pixmap; Pixmap down_pixmap; Pixmap bark_pixmap; Position pixmap_x; Position pixmap_y; Position draw_x; Position draw_y; Dimension draw_width; Dimension draw_height; int curr_px; Pixmap curr_pixmap; Dimension curr_width; Dimension curr_height; XtIntervalId wagId; XtIntervalId barkId; } DogPart; typedef struct _DogRec { CorePart core; XmPrimitivePart primitive; DogPart dog; } DogRec; #define UpPx 0 #define DownPx 1 #define BarkPx 2 #endif /* _DogP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/Square.h���������������������������������������������������������0000644�0001750�0001750�00000003376�12672140200�015632� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: Square.h /main/5 1995/07/14 10:06:38 drk $ */ /***************************************************************************** * * Square.h - widget public header file * ******************************************************************************/ #ifndef _Square_h #define _Square_h #include <Xm/BulletinB.h> externalref WidgetClass squareWidgetClass; typedef struct _SquareClassRec *SquareWidgetClass; typedef struct _SquareRec *SquareWidget; extern Widget SquareCreate(); extern int SquareMrmInitialize(); #define IsSquare(w) XtIsSubclass((w), squareWidgetClass) #define SquareWIDTH 0 #define SquareHEIGHT 1 #define SquareNmajorDimension "majorDimension" #define SquareCMajorDimension "MajorDimension" #define SquareNmakeSquare "makeSquare" #define SquareCMakeSquare "MakeSquare" #endif /* _Square_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/Makefile.in������������������������������������������������������0000644�0001750�0001750�00000045772�13211512767�016307� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = dogs$(EXEEXT) subdir = demos/unsupported/dogs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_dogs_OBJECTS = dogs.$(OBJEXT) Dog.$(OBJEXT) Square.$(OBJEXT) dogs_OBJECTS = $(am_dogs_OBJECTS) dogs_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(dogs_SOURCES) DIST_SOURCES = $(dogs_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = dogs.uil Dog.uil Square.uil bark.bm down.bm up.bm noinst_HEADERS = Dog.h \ DogP.h \ Square.h \ SquareP.h CLEANFILES = dogs.uid dogs_SOURCES = dogs.c Dog.c Square.c dogs_DEPENDENCIES = dogs.uid LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} SUFFIXES = .uil .uid all: all-am .SUFFIXES: .SUFFIXES: .uil .uid .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/dogs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/dogs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list dogs$(EXEEXT): $(dogs_OBJECTS) $(dogs_DEPENDENCIES) $(EXTRA_dogs_DEPENDENCIES) @rm -f dogs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dogs_OBJECTS) $(dogs_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Square.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dogs.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile .uil.uid: ../../../clients/uil/uil $< -I$(srcdir) -o $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������motif-2.3.8/demos/unsupported/dogs/Square.c���������������������������������������������������������0000644�0001750�0001750�00000022101�12672140200�015610� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Square.c /main/6 1998/03/25 18:18:13 csn $" #endif #endif /***************************************************************************** * * Square.c - widget source file * ******************************************************************************/ #include <stdio.h> #include <Xm/Xm.h> #include <Mrm/MrmPublic.h> #include <Xm/BulletinBP.h> #include "SquareP.h" #define Width(w) XmField((w),square_offsets,Core,width,Dimension) #define Height(w) XmField((w),square_offsets,Core,height,Dimension) #define BorderWidth(w) XmField((w),square_offsets,Core,border_width,Dimension) #define MajorDimension(w) XmField((w),square_offsets,Square,major_dimension,int) #define MakeSquare(w) XmConstraintField((w),square_constraint_offsets, \ Square,make_square, Boolean) static void ClassInitialize(); static void Initialize(); static Boolean SetValues(); static void ConstraintInitialize(); static Boolean ConstraintSetValues(); static XmPartResource resources[] = { { SquareNmajorDimension, SquareCMajorDimension, XmRInt, sizeof(int), XmPartOffset(Square,major_dimension), XmRImmediate, (caddr_t)SquareWIDTH } }; static XmPartResource constraints[] = { { SquareNmakeSquare, SquareCMakeSquare, XmRBoolean, sizeof(Boolean), XmConstraintPartOffset(Square,make_square), XmRImmediate, (caddr_t)False } }; externaldef(squareclassrec) SquareClassRec squareClassRec = { { /* core_class fields */ (WidgetClass) &xmBulletinBoardClassRec, /* superclass */ "Square", /* class_name */ sizeof(SquarePart), /* widget_size */ ClassInitialize, /* class_initialize */ NULL, /* class init part proc */ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_notify */ XtInheritRealize, /* realize */ NULL, /* actions */ 0, /* num_actions */ (XtResourceList)resources,/* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ False, /* compress_motion */ XtExposeCompressMaximal, /* compress_exposure */ False, /* compress_enterleave */ False, /* visible_interest */ NULL, /* destroy */ XtInheritResize, /* resize */ XtInheritExpose, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersionDontCheck, /* version */ NULL, /* callback_private */ XtInheritTranslations, /* tm_table */ XtInheritQueryGeometry, /* Query Geometry proc */ NULL, /* disp accelerator */ NULL, /* extension */ }, { /* composite_class fields */ XtInheritGeometryManager, /* geometry_manager */ XtInheritChangeManaged, /* change_managed */ XtInheritInsertChild, /* insert_child */ XtInheritDeleteChild, /* delete_child */ NULL, /* extension */ }, { /* constraint_class fields */ (XtResourceList)constraints, /* constraint resource */ XtNumber(constraints), /* number of constraints */ sizeof(SquareConstraintRec), /* size of constraint */ ConstraintInitialize, /* initialization */ NULL, /* destroy proc */ ConstraintSetValues, /* set_values proc */ NULL, /* extension */ }, { /* manager_class fields */ XtInheritTranslations, /* translations */ NULL, /* syn_resources */ 0, /* num_syn_resources */ NULL, /* syn_cont_resources */ 0, /* num_syn_cont_resources */ XmInheritParentProcess, /* parent_process */ NULL, /* extension */ }, { /* bulletin_board_class fields */ FALSE, /* always_install_accelerators */ NULL, /* geo_matrix_create */ XmInheritFocusMovedProc, /* focus_moved_proc */ NULL, /* extension */ }, { /* square_class fields */ NULL, /* extension */ } }; externaldef(squarewidgetclass) WidgetClass squareWidgetClass = (WidgetClass) &squareClassRec; static XmOffsetPtr square_offsets; /* Part offsets table */ static XmOffsetPtr square_constraint_offsets; /* Constraint offsets table */ /********************************************************************** * * SquareCreate - Convenience routine, used by Uil/Mrm. * *********************************************************************/ Widget SquareCreate(parent, name, arglist, nargs) Widget parent; char *name; Arg *arglist; int nargs; { return(XtCreateWidget (name, squareWidgetClass, parent, arglist, nargs)); } /********************************************************************** * * SquareMrmInitialize - register Square widget class with Mrm * *********************************************************************/ int SquareMrmInitialize() { return(MrmRegisterClass (MrmwcUnknown, "Square", "SquareCreate", SquareCreate, (WidgetClass)&squareClassRec)); } /********************************************************************** * * Class methods * *********************************************************************/ static void ClassInitialize() { XmResolveAllPartOffsets(squareWidgetClass, &square_offsets, &square_constraint_offsets); } static void Initialize(req, new) SquareWidget req; SquareWidget new; { if (MajorDimension(new) != SquareWIDTH && MajorDimension(new) != SquareHEIGHT) { XtWarning("Square: invalid majorDimension"); MajorDimension(new) = SquareWIDTH; } } static Boolean SetValues(curr, req, new) SquareWidget curr; SquareWidget req; SquareWidget new; { if (MajorDimension(new) != SquareWIDTH && MajorDimension(new) != SquareHEIGHT) { XtWarning("Square: invalid majorDimension"); MajorDimension(new) = MajorDimension(curr); } return (False); } static void ConstraintInitialize (req, new) Widget req; Widget new; { Dimension m; if(MakeSquare(new) == True) { if (MajorDimension(XtParent(new))==SquareWIDTH) m = Width(new); else m = Height(new); XtResizeWidget(new, m, m, BorderWidth(new)); } } static Boolean ConstraintSetValues (old, ref, new) Widget old; Widget ref; Widget new; { Boolean redraw = False; if (MakeSquare(new) != MakeSquare(old)) { if(MakeSquare(new)==True) { if (MajorDimension(XtParent(new))==SquareWIDTH) Height(new) = Width(new); else Width(new) = Height(new); } else { XtWidgetGeometry gi; XtWidgetGeometry gp; if (MajorDimension(XtParent(new))==SquareWIDTH) Height(new) = Height(new)/2; else Width(new) = Width(new)/2; gi.request_mode = CWWidth | CWHeight; gi.width = Width(new); gi.height = Height(new); if (XtQueryGeometry(new, &gi, &gp) == XtGeometryAlmost) { if (gp.request_mode && CWWidth != 0) Width(new) = gp.width; if (gp.request_mode && CWHeight != 0) Height(new) = gp.height; } } redraw = True; } return (redraw); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/down.bm����������������������������������������������������������0000644�0001750�0001750�00000027177�12672140200�015515� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: down.bm /main/4 1995/07/17 18:07:23 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define down_width 152 #define down_height 91 #define down_x_hot 0 #define down_y_hot 0 static unsigned char down_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x55, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x55, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xea, 0xba, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xea, 0xba, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7d, 0x7d, 0xd5, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7d, 0x7d, 0xd5, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xae, 0xab, 0xae, 0xbe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xae, 0xab, 0xae, 0xbe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x57, 0x55, 0x55, 0x55, 0xff, 0xc1, 0xd5, 0xd7, 0x5f, 0x7f, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x57, 0x55, 0x55, 0x55, 0xff, 0xc1, 0xd5, 0xd7, 0x5f, 0x7f, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xfe, 0xff, 0xab, 0xeb, 0xab, 0xaa, 0xea, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0xaf, 0xff, 0xaa, 0xaa, 0xaa, 0x73, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0x7f, 0x55, 0x55, 0xd5, 0x73, 0x00, 0x00, 0x00, 0x80, 0x5f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x7f, 0x55, 0x55, 0xfd, 0xd5, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbe, 0xaa, 0xaa, 0xfa, 0xaa, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfe, 0xaa, 0xaa, 0xea, 0xbf, 0x0f, 0x00, 0x00, 0x00, 0x7c, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, 0x55, 0xd5, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x5e, 0xf5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xfd, 0x55, 0xd5, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x80, 0xaf, 0xfe, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfa, 0xaa, 0xea, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xab, 0xef, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0xab, 0xea, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf5, 0xe3, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0xd5, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfd, 0xe0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3e, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x1e, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x07, 0xf8, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x01, 0xf8, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0xb8, 0xaa, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0xb8, 0xaa, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xd5, 0x5f, 0x55, 0x55, 0x55, 0xf5, 0xff, 0x55, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xd5, 0x5f, 0x55, 0x55, 0x55, 0xf5, 0xff, 0x55, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xaa, 0xfb, 0xea, 0xea, 0xff, 0xff, 0xeb, 0xab, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xaa, 0xfb, 0xea, 0xea, 0xff, 0xff, 0xeb, 0xab, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x57, 0xf5, 0xd5, 0xff, 0x1f, 0x00, 0x00, 0x7f, 0x55, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x57, 0xf5, 0xd5, 0xff, 0x1f, 0x00, 0x00, 0x7f, 0x55, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xaa, 0xfe, 0xaa, 0x07, 0x00, 0x00, 0x00, 0xfc, 0xea, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xaa, 0xfe, 0xab, 0x07, 0x00, 0x00, 0x00, 0xbc, 0xfa, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x55, 0xfd, 0x55, 0x07, 0x00, 0x00, 0x00, 0x5c, 0xf5, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xf5, 0x83, 0x55, 0x07, 0x00, 0x00, 0x00, 0x57, 0x7f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xea, 0x83, 0xab, 0x07, 0x00, 0x00, 0x00, 0xab, 0xbe, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaf, 0xfa, 0x80, 0xaf, 0x1f, 0x00, 0x00, 0xe0, 0xab, 0xae, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0xfd, 0x80, 0x5f, 0x1f, 0x00, 0x00, 0xe0, 0x57, 0x5f, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x57, 0x1f, 0x00, 0x7e, 0xfd, 0x00, 0x00, 0xf8, 0xf5, 0x7f, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xaf, 0x1f, 0x00, 0xbe, 0xfa, 0x00, 0x00, 0xf8, 0xea, 0xbf, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xaa, 0x07, 0x00, 0xf0, 0xef, 0x00, 0x00, 0xbe, 0x7e, 0xb0, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x55, 0x07, 0x00, 0xf0, 0xf7, 0x00, 0x00, 0x5e, 0x7d, 0x70, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x1f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x56, 0x1d, 0xf0, 0xd7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xab, 0x1f, 0x00, 0x00, 0xff, 0x00, 0x00, 0xae, 0x1e, 0xf0, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xaf, 0x03, 0x00, 0xbe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/Square.uil�������������������������������������������������������0000644�0001750�0001750�00000002763�12672140200�016173� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: Square.uil /main/5 1995/07/14 10:06:54 drk $ !****************************************************************************** !**************************************************************************** !* !* Square.uil - Square widget UIL header file !* !**************************************************************************** ! resources value SquareNmajorDimension : private argument ('majorDimension', integer); SquareNmakeSquare : private argument ('makeSquare', boolean); ! resource values value SquareWIDTH : 0; SquareHEIGHT : 1; ! widget create procedure procedure SquareCreate(); �������������motif-2.3.8/demos/unsupported/dogs/SquareP.h��������������������������������������������������������0000644�0001750�0001750�00000004157�12672140200�015750� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: SquareP.h /main/5 1995/07/14 10:07:05 drk $ */ #ifndef _SquareP_h #define _SquareP_h #include "Square.h" #include <Xm/BulletinBP.h> #define SquareIndex (XmBulletinBIndex + 1) typedef struct _SquareClassPart { XtPointer reserved; } SquareClassPart; typedef struct _SquareClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; XmBulletinBoardClassPart bulletin_board_class; SquareClassPart square_class; } SquareClassRec; externalref SquareClassRec squareClassRec; typedef struct _SquarePart { int major_dimension; } SquarePart; /* Full instance record declaration */ typedef struct _SquareRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; XmBulletinBoardPart bulletin_board; SquarePart square; } SquareRec; typedef struct _SquareConstraintPart { Boolean make_square; } SquareConstraintPart; typedef struct _SquareConstraintRec { XmManagerConstraintPart manager; SquareConstraintPart square; } SquareConstraintRec, *SquareConstraint; #endif /* _SquareP_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/bark.bm����������������������������������������������������������0000644�0001750�0001750�00000027177�12672140200�015465� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: bark.bm /main/4 1995/07/17 18:07:16 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define bark_width 152 #define bark_height 91 #define bark_x_hot 0 #define bark_y_hot 0 static unsigned char bark_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xeb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xeb, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x55, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x55, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xea, 0xba, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xea, 0xba, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7d, 0x7d, 0xd5, 0x07, 0x00, 0x00, 0x00, 0x00, 0x56, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7d, 0x7d, 0xd5, 0x07, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x1a, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xae, 0xab, 0xae, 0xbe, 0x07, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x1a, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xae, 0xab, 0xae, 0xbe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x78, 0xf5, 0x80, 0xff, 0x57, 0x55, 0x55, 0x55, 0xff, 0xc1, 0xd5, 0xd7, 0x5f, 0x7f, 0xff, 0x03, 0x00, 0x00, 0x00, 0x78, 0xf5, 0x80, 0xff, 0x57, 0x55, 0x55, 0x55, 0xff, 0xc1, 0xd5, 0xd7, 0x5f, 0x7f, 0xff, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xea, 0xff, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xfe, 0xff, 0xab, 0xeb, 0xab, 0xaa, 0xea, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0xaf, 0xff, 0xaa, 0xaa, 0xaa, 0x73, 0x00, 0x00, 0x00, 0xc0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0x7f, 0x55, 0x55, 0xd5, 0x73, 0x00, 0x00, 0x00, 0xc0, 0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x7f, 0x55, 0x55, 0xfd, 0xd5, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xaf, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbe, 0xaa, 0xaa, 0xba, 0xaa, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfe, 0xaa, 0xaa, 0x2a, 0xbf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, 0x55, 0x75, 0xde, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xfd, 0x55, 0xd5, 0xd7, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfa, 0xaa, 0xea, 0xaf, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0xab, 0xea, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0xd5, 0xf0, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0x7d, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbf, 0x0f, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbf, 0x0f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x03, 0x00, 0x10, 0x06, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x03, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xaa, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x1f, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xaa, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x1f, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xd5, 0x5f, 0x55, 0x55, 0x55, 0xf5, 0xff, 0x55, 0xd5, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xd5, 0x5f, 0x55, 0x55, 0x55, 0xf5, 0xff, 0x55, 0xd5, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xaa, 0xfb, 0xea, 0xea, 0xff, 0xff, 0xeb, 0xab, 0x3a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xaa, 0xfb, 0xea, 0xea, 0xff, 0xff, 0xeb, 0xab, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x57, 0xf5, 0xd5, 0xff, 0x1f, 0x00, 0x00, 0x7f, 0x55, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x57, 0xf5, 0xd5, 0xff, 0x1f, 0x00, 0x00, 0x7f, 0x55, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xaa, 0xfe, 0xaa, 0x07, 0x00, 0x00, 0x00, 0xfc, 0xea, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xaa, 0xfe, 0xab, 0x07, 0x00, 0x00, 0x00, 0xbc, 0xfa, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x55, 0xfd, 0x55, 0x07, 0x00, 0x00, 0x00, 0x5c, 0xf5, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xf5, 0x83, 0x55, 0x07, 0x00, 0x00, 0x00, 0x57, 0x7f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xea, 0x83, 0xab, 0x07, 0x00, 0x00, 0x00, 0xab, 0xbe, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaf, 0xfa, 0x80, 0xaf, 0x1f, 0x00, 0x00, 0xe0, 0xab, 0xae, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0xfd, 0x80, 0x5f, 0x1f, 0x00, 0x00, 0xe0, 0x57, 0x5f, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x57, 0x1f, 0x00, 0x7e, 0xfd, 0x00, 0x00, 0xf8, 0xf5, 0x7f, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xaf, 0x1f, 0x00, 0xbe, 0xfa, 0x00, 0x00, 0xf8, 0xea, 0xbf, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xaa, 0x07, 0x00, 0xf0, 0xef, 0x00, 0x00, 0xbe, 0x7e, 0xb0, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x55, 0x07, 0x00, 0xf0, 0xf7, 0x00, 0x00, 0x5e, 0x7d, 0x70, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x1f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x56, 0x1d, 0xf0, 0xd7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xab, 0x1f, 0x00, 0x00, 0xff, 0x00, 0x00, 0xae, 0x1e, 0xf0, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xaf, 0x03, 0x00, 0xbe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/Dog.h������������������������������������������������������������0000644�0001750�0001750�00000003260�12672140200�015073� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: Dog.h /main/5 1995/07/14 10:05:31 drk $ */ /***************************************************************************** * * Dog.h - widget public header file * ******************************************************************************/ #ifndef _Dog_h #define _Dog_h #define USING_UIL externalref WidgetClass dogWidgetClass; typedef struct _DogClassRec *DogWidgetClass; typedef struct _DogRec *DogWidget; #define DogNbarkCallback "barkCallback" #define DogNwagTime "wagTime" #define DogNbarkTime "barkTime" #define DogCWagTime "WagTime" #define DogCBarkTime "BarkTime" #define IsDog(w) XtIsSubclass((w), dogWidgetClass) extern Widget DogCreate(); #ifdef USING_UIL extern int DogMrmInitialize(); #endif #endif /* _Dog_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/README�����������������������������������������������������������0000644�0001750�0001750�00000004106�12672140200�015071� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 14:11:26 drk $ */ This directory contains the sources of the Dog widget, the Square widget, and the dogs demo. DOG WIDGET ---------- The Dog widget demonstrates how to subclass a primitive widget which will remain binary compatible with future versions of Motif. It uses XmResolvePartOffsets(), and associated macros, and implements all the recommendations in the XmResolvePartOffsets manpage. The Dog widget is a subclass of XmPrimitive. It can bark and wag its tail. If you want more exotic tricks - feel free to subclass it, or replace up.bm, down.bm and bark.bm with more interesting bitmaps. It has the following resources: DogNwagTime - time in milliseconds between each wag. DogNbarkTime - time in milliseconds the bark graphic is displayed. DogNbarkCallback - callback called by the bark action. It has the following translations: osfActivate/Return/Space/MB1 = Bark W/MB2 = Wag tail. S/Shift-MB2 = Stop wagging tail. osfHelp = Help SQUARE WIDGET ------------- The Square widget demonstrates how to subclass a constraint widget which will remain binary compatible with future versions of Motif. It uses XmResolveAllPartOffsets(), and associated macros, and implements all the recommendations in the XmResolveAllPartOffsets manpage. The Square Widget is a subclass of XmBulletinBoard. It forces its children to be square using a constraint resource. It has one resource: SquareNmajorDimension - determines which dimension will be used for the new size of the child. Values are SquareWIDTH or SquareHEIGHT. It has one constraint resource: SquareNmakeSquare - determines whether the child is forced to be square or set to its preferred size. DOGS DEMO --------- The dogs demo uses the Dog and Square widgets. It illustrates how to incorporate new widgets into UIL source, using the user_defined function. It allows you to dynamically change the DogNwagTime and SquareNmakeSquare resources. If you have a machine with any sound generation features at all, you may want to change the bark callback to something better than XBell(). ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/Dog.uil����������������������������������������������������������0000644�0001750�0001750�00000002672�12672140200�015443� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: Dog.uil /main/5 1995/07/14 10:05:51 drk $ !****************************************************************************** !**************************************************************************** !* !* Dog.uil - Dog widget UIL header file !* !**************************************************************************** ! resources value DogNwagTime : private argument ('wagTime', integer); DogNbarkTime : private argument ('barkTime', integer); DogNbarkCallback : reason ('barkCallback'); ! widget create procedure procedure DogCreate(); ����������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/dogs.uil���������������������������������������������������������0000644�0001750�0001750�00000022050�12672140200�015656� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: dogs.uil /main/5 1995/07/14 10:07:35 drk $ !****************************************************************************** !****************************************************************************** !* !* dogs.uil - Square & Dog widget demo, application UIL file. !* !****************************************************************************** module squares version = 'v1.0' names = case_sensitive character_set=iso_latin1 objects = { XmPushButton = gadget; XmToggleButton = gadget; } include file 'Square.uil'; include file 'Dog.uil'; procedure create_cb(integer); bark_cb(integer); tb_cb(integer); scale_cb(integer); help_cb(compound_string); exit_cb(); value k_dog1_id : 1; k_dog2_id : 2; k_dog3_id : 3; k_help_id : 4; value dog1_bark_volume : 90; dog1_bark_time : 1100; dog1_wag_time : 100; dog1_square : false; dog2_bark_volume : 40; dog2_bark_time : 400; dog2_wag_time : 100; dog2_square : false; dog3_bark_volume : 70; dog3_bark_time : 700; dog3_wag_time : 100; dog3_square : false; value help_text : compound_string(" ", separate=true) & compound_string(" ", separate=true) & compound_string("osfActivate/MB1 = Bark.", separate=true) & compound_string("W/MB2 = Wag tail.", separate=true) & compound_string("S/Shift-MB2 = Stop.", separate=true) & compound_string("osfHelp = Help.", separate=true) & compound_string(""); object app_main : XmMainWindow { controls { XmMenuBar bar; XmForm work; unmanaged XmInformationDialog help_box; }; callbacks { XmNhelpCallback=procedure help_cb(compound_string("Dogs") & help_text); }; }; object help_box : XmInformationDialog { arguments { XmNmessageAlignment = XmALIGNMENT_BEGINNING; XmNdialogTitle = "Help"; XmNokLabelString = "Dismiss"; }; callbacks { MrmNcreateCallback = procedure create_cb(k_help_id); }; }; object bar : XmMenuBar { arguments { XmNmenuHelpWidget = XmCascadeButton help; }; controls { XmCascadeButton file; XmCascadeButton help; }; }; object file : XmCascadeButton { arguments { XmNlabelString = "File"; XmNmnemonic = keysym('F'); }; controls { XmPulldownMenu file_pd; }; }; object file_pd : XmPulldownMenu { controls { XmPushButton exit_pb; }; }; object exit_pb : XmPushButton { arguments { XmNlabelString = "Exit"; XmNmnemonic = keysym('E');}; callbacks { XmNactivateCallback = procedure exit_cb(); }; }; object help : XmCascadeButton { arguments { XmNlabelString = "Help"; XmNmnemonic = keysym('H'); }; controls { XmPulldownMenu help_pd; }; }; object help_pd : XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton help_pb; }; }; object help_pb : XmPushButton { arguments { XmNlabelString = "On Dogs"; XmNmnemonic = keysym('D');}; callbacks { XmNactivateCallback = procedure help_cb (compound_string("Dogs") & help_text); }; }; object work : XmForm { controls { XmFrame frame; XmScale scale1; XmScale scale2; XmScale scale3; XmSeparator sep; XmToggleButton tb1; XmToggleButton tb2; XmToggleButton tb3; }; }; object frame : XmFrame { arguments { XmNrightAttachment = XmATTACH_FORM; XmNrightOffset = 5; XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 5; XmNtopAttachment = XmATTACH_FORM; XmNtopOffset = 5; XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 10; XmNbottomWidget = XmScale scale1; }; controls { user_defined square; }; }; object square : user_defined procedure SquareCreate { arguments { XmNwidth = 600; XmNheight = 220; XmNresizePolicy = XmRESIZE_GROW; SquareNmajorDimension = SquareWIDTH; }; controls { user_defined dog1; user_defined dog2; user_defined dog3; }; }; object dog1 : user_defined procedure DogCreate { arguments { SquareNmakeSquare = dog1_square; XmNx = 20; XmNy = 20; XmNforeground = color('red', foreground); XmNbackground = color('lightblue', background); XmNshadowThickness = 12; DogNwagTime = dog1_wag_time; DogNbarkTime = dog1_bark_time; }; callbacks { MrmNcreateCallback = procedure create_cb(k_dog1_id); DogNbarkCallback = procedure bark_cb(dog1_bark_volume); XmNhelpCallback = procedure help_cb (compound_string("Rover") & help_text); }; }; object dog2 : user_defined procedure DogCreate { arguments { SquareNmakeSquare = dog2_square; XmNx = 220; XmNy = 20; XmNforeground = color('black', foreground); XmNbackground = color('lightblue', background); XmNshadowThickness = 4; DogNwagTime = dog2_wag_time; DogNbarkTime = dog2_bark_time; }; callbacks { MrmNcreateCallback = procedure create_cb(k_dog2_id); DogNbarkCallback = procedure bark_cb(dog2_bark_volume); XmNhelpCallback = procedure help_cb (compound_string("Spot") & help_text); }; }; object dog3 : user_defined procedure DogCreate { arguments { SquareNmakeSquare = dog3_square; XmNx = 420; XmNy = 20; XmNforeground = color('Brown', foreground); XmNbackground = color('lightblue', background); XmNshadowThickness = 10; DogNwagTime = dog3_wag_time; DogNbarkTime = dog3_bark_time; }; callbacks { MrmNcreateCallback = procedure create_cb(k_dog3_id); DogNbarkCallback = procedure bark_cb(dog3_bark_volume); XmNhelpCallback = procedure help_cb (compound_string("Fido") & help_text); }; }; object scale1 : XmScale { arguments { XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 5; XmNrightAttachment = XmATTACH_POSITION; XmNrightPosition = 30; XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5; XmNbottomWidget = XmSeparator sep; XmNminimum = 1; XmNmaximum = 200; XmNtitleString = 'Wag Rate'; XmNorientation = XmHORIZONTAL; XmNprocessingDirection = XmMAX_ON_LEFT; XmNvalue = dog1_wag_time; }; callbacks { XmNvalueChangedCallback = procedure scale_cb(1); XmNdragCallback = procedure scale_cb(1); }; }; object scale2 : XmScale { arguments { XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 36; XmNrightAttachment = XmATTACH_POSITION; XmNrightPosition = 63; XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5; XmNbottomWidget = XmSeparator sep; XmNminimum = 1; XmNmaximum = 200; XmNtitleString = 'Wag Rate'; XmNorientation = XmHORIZONTAL; XmNprocessingDirection = XmMAX_ON_LEFT; XmNvalue = dog2_wag_time; }; callbacks { XmNvalueChangedCallback = procedure scale_cb(2); XmNdragCallback = procedure scale_cb(2); }; }; object scale3 : XmScale { arguments { XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 69; XmNrightAttachment = XmATTACH_FORM; XmNrightOffset = 5; XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5; XmNbottomWidget = XmSeparator sep; XmNminimum = 1; XmNmaximum = 200; XmNtitleString = 'Wag Rate'; XmNorientation = XmHORIZONTAL; XmNprocessingDirection = XmMAX_ON_LEFT; XmNvalue = dog3_wag_time; }; callbacks { XmNvalueChangedCallback = procedure scale_cb(3); XmNdragCallback = procedure scale_cb(3); }; }; object sep : XmSeparator { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5; XmNbottomWidget = XmToggleButton tb1; }; }; object tb1 : XmToggleButton { arguments { XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 5; XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 5; XmNset = dog1_square; XmNlabelString = 'Make Square'; }; callbacks { XmNvalueChangedCallback = procedure tb_cb(1); }; }; object tb2 : XmToggleButton { arguments { XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 36; XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 5; XmNset = dog2_square; XmNlabelString = 'Make Square'; }; callbacks { XmNvalueChangedCallback = procedure tb_cb(2); }; }; object tb3 : XmToggleButton { arguments { XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 69; XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 5; XmNset = dog3_square; XmNlabelString = 'Make Square'; }; callbacks { XmNvalueChangedCallback = procedure tb_cb(3); }; }; end module; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/Dog.c������������������������������������������������������������0000644�0001750�0001750�00000041562�13066310437�015106� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: Dog.c /main/7 1997/05/02 10:11:08 dbl $" #endif #endif /***************************************************************************** * * Dog.c - Dog widget source file * ******************************************************************************/ #include <stdio.h> #include <X11/StringDefs.h> #include <Xm/XmP.h> #include <Xm/DrawP.h> #include "DogP.h" #ifdef USING_UIL #include <Mrm/MrmAppl.h> #endif /* USING_UIL */ #include "up.bm" #include "down.bm" #include "bark.bm" #ifndef MAX #define MAX(x,y) ((x) > (y) ? (x) : (y)) #endif #define WagTime(w) XmField(w,offsets,Dog,wag_time, int) #define BarkTime(w) XmField(w,offsets,Dog,bark_time, int) #define BarkCallback(w) XmField(w,offsets,Dog,bark_callback,XtCallbackList) #define UpPixmap(w) XmField(w,offsets,Dog,up_pixmap,Pixmap) #define DownPixmap(w) XmField(w,offsets,Dog,down_pixmap,Pixmap) #define BarkPixmap(w) XmField(w,offsets,Dog,bark_pixmap,Pixmap) #define CurrPixmap(w) XmField(w,offsets,Dog,curr_pixmap,Pixmap) #define CurrPx(w) XmField(w,offsets,Dog,curr_px,int) #define Wagging(w) XmField(w,offsets,Dog,wagging,Boolean) #define Barking(w) XmField(w,offsets,Dog,barking,Boolean) #define DrawGC(w) XmField(w,offsets,Dog,draw_GC,GC) #define PixmapX(w) XmField(w,offsets,Dog,pixmap_x,Position) #define PixmapY(w) XmField(w,offsets,Dog,pixmap_y,Position) #define DrawX(w) XmField(w,offsets,Dog,draw_x,Position) #define DrawY(w) XmField(w,offsets,Dog,draw_y,Position) #define DrawWidth(w) XmField(w,offsets,Dog,draw_width,Dimension) #define DrawHeight(w) XmField(w,offsets,Dog,draw_height,Dimension) #define CurrWidth(w) XmField(w,offsets,Dog,curr_width,Dimension) #define CurrHeight(w) XmField(w,offsets,Dog,curr_height,Dimension) #define HighlightThickness(w) \ XmField(w,offsets,XmPrimitive,highlight_thickness,Dimension) #define ShadowThickness(w) \ XmField(w,offsets,XmPrimitive,shadow_thickness,Dimension) #define Foreground(w) XmField(w,offsets,XmPrimitive,foreground,Pixel) #define Highlighted(w) XmField(w,offsets,XmPrimitive,highlighted,Boolean) #define TopShadowGC(w) XmField(w,offsets,XmPrimitive,top_shadow_GC,GC) #define BottomShadowGC(w) XmField(w,offsets,XmPrimitive,bottom_shadow_GC,GC) #define BackgroundPixel(w) XmField(w,offsets,Core,background_pixel,Pixel) #define Width(w) XmField(w,offsets,Core,width,Dimension) #define Height(w) XmField(w,offsets,Core,height,Dimension) #define WagId(w) XmField(w,offsets,Dog,wagId,XtIntervalId) #define BarkId(w) XmField(w,offsets,Dog,barkId,XtIntervalId) #define SetPixmap(w, px, pixmap, width, height) \ CurrPx(w) = px; CurrPixmap(w) = pixmap; \ CurrWidth(w) = width; CurrHeight(w) = height #define MakePixmap(b,wd,ht) \ XCreatePixmapFromBitmapData(XtDisplay(w),RootWindowOfScreen(XtScreen(w)), \ (char *)(b), (wd), (ht), Foreground(w), BackgroundPixel(w), \ DefaultDepthOfScreen(XtScreen(w))) static void ClassInitialize(); static void Initialize(); static void Redisplay(); static void Resize(); static void Destroy(); static Boolean SetValues(); static XtGeometryResult QueryGeometry(); static void bark_dog(); static void end_bark(); static void start_wag(); static void stop_wag(); static void do_wag(); static void create_GC(); static void create_pixmaps(); static void destroy_pixmaps(); static char defaultTranslations[] = "<Btn1Down>: Bark()\n\ ~Shift<Btn2Down>: StartWag()\n\ Shift<Btn2Down>: StopWag()\n\ <Key>Return: Bark()\n\ Ctrl <Key>Return: Bark()\n\ <Key>osfActivate: Bark()\n\ <Key>space: Bark()\n\ Ctrl <Key>space: Bark()\n\ <Key>osfSelect: Bark()\n\ <Key>W: StartWag()\n\ <Key>S: StopWag()\n\ <Key>osfHelp: PrimitiveHelp()"; static XtActionsRec actionsList[] = { { "Bark", (XtActionProc) bark_dog}, { "StartWag", (XtActionProc) start_wag}, { "StopWag", (XtActionProc) stop_wag} }; static XmPartResource resources[] = { {DogNwagTime, DogCWagTime, XtRInt, sizeof(int), XmPartOffset(Dog,wag_time), XmRImmediate, (caddr_t)100}, {DogNbarkTime, DogCBarkTime, XtRInt, sizeof(int), XmPartOffset(Dog,bark_time), XmRImmediate, (caddr_t)1000}, {DogNbarkCallback, XtCCallback, XtRCallback, sizeof(caddr_t), XmPartOffset(Dog,bark_callback), XtRCallback, NULL} }; DogClassRec dogClassRec = { { /* core_class fields */ (WidgetClass) &xmPrimitiveClassRec, /* superclass */ "Dog", /* class_name */ sizeof(DogPart), /* widget_size */ ClassInitialize, /* class_initialize */ NULL, /* class_part_initialize*/ False, /* class_inited */ Initialize, /* initialize */ NULL, /* initialize_notify */ XtInheritRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ (XtResourceList)resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ True, /* compress_exposure */ True, /* compress_enterleave */ False, /* visible_interest */ Destroy, /* destroy */ Resize, /* resize */ Redisplay, /* expose */ SetValues, /* set_values */ NULL, /* set_values_hook */ XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersionDontCheck, /* version */ NULL, /* callback_private */ defaultTranslations, /* tm_table */ QueryGeometry, /* query_geometry */ NULL, /* disp accelerator */ NULL /* extension */ }, { /* primitive_class record */ XmInheritWidgetProc, /* border_highlight */ XmInheritWidgetProc, /* border_unhighlight */ XtInheritTranslations, /* translations */ bark_dog, /* arm_and_activate */ NULL, /* syn resources */ 0, /* num syn_resources */ NULL, /* extension */ }, { /* dog_class record */ NULL, /* extension */ } }; externaldef(dogwidgetclass) WidgetClass dogWidgetClass = (WidgetClass) &dogClassRec; static XmOffsetPtr offsets; /* Part Offset table for XmResolvePartOffsets */ /********************************************************************** * * DogCreate - Convenience routine, used by Uil/Mrm. * *********************************************************************/ Widget DogCreate(parent, name, arglist, nargs) Widget parent; char *name; Arg *arglist; int nargs; { return(XtCreateWidget (name, dogWidgetClass, parent, arglist, nargs)); } #ifdef USING_UIL /********************************************************************** * * DogMrmInitialize - register Dog widget class with Mrm * *********************************************************************/ int DogMrmInitialize() { return(MrmRegisterClass (MrmwcUnknown, "Dog" , "DogCreate", DogCreate, (WidgetClass)&dogClassRec)); } #endif /* USING_UIL */ /********************************************************************** * * _DogDrawPixmap - draw the current pixmap * *********************************************************************/ void _DogDrawPixmap(dw) DogWidget dw; { Widget w = (Widget) dw; if (XtIsRealized(w)) { XCopyArea(XtDisplay(w),CurrPixmap(w), XtWindow(w),DrawGC(w), PixmapX(w), PixmapY(w), DrawWidth(w), DrawHeight(w), DrawX(w), DrawY(w)); } } /********************************************************************** * * _DogPosition(w) - position the current pixmap * *********************************************************************/ void _DogPosition(w) DogWidget w; { Dimension margin = ShadowThickness(w) + HighlightThickness(w); if (CurrWidth(w) < MAX(Width(w) - 2 * margin,0)) { PixmapX(w) = 0; DrawX(w) = Width(w)/2 - CurrWidth(w)/2; DrawWidth(w) = CurrWidth(w); } else { PixmapX(w) = (CurrWidth(w) - (Width(w) - 2 * margin))/2; DrawX(w) = margin; DrawWidth(w) = Width(w) - 2 * margin; } if (CurrHeight(w) < MAX(Height(w) - 2 * margin,0)) { PixmapY(w)= 0; DrawY(w) = Height(w)/2 - CurrHeight(w)/2; DrawHeight(w) = CurrHeight(w); } else { PixmapY(w) = (CurrHeight(w) - (Height(w) - 2 * margin))/2; DrawY(w) = margin; DrawHeight(w) = Height(w) - 2 * margin; } } /********************************************************************** * * Class methods * *********************************************************************/ static void ClassInitialize() { XmResolvePartOffsets(dogWidgetClass, &offsets); } static void create_GC(w) DogWidget w; { XGCValues values; XtGCMask valueMask; valueMask = GCForeground | GCBackground | GCGraphicsExposures; values.foreground = Foreground(w); values.background = BackgroundPixel(w); values.graphics_exposures = False; DrawGC(w) = XtGetGC((Widget)w,valueMask,&values); } static void create_pixmaps(w) DogWidget w; { UpPixmap(w) = MakePixmap(up_bits, up_width, up_height); DownPixmap(w) = MakePixmap(down_bits, down_width, down_height); BarkPixmap(w) = MakePixmap(bark_bits, bark_width, bark_height); } static void Initialize(request, new) DogWidget request; DogWidget new; { if (Width(request) == 0) Width(new) = MAX(MAX(up_width, down_width),bark_width) + 2*(ShadowThickness(new)+HighlightThickness(new)); if (Height(request) == 0) Height(new) = MAX(MAX(up_height, down_height),bark_height) + 2*(ShadowThickness(new)+HighlightThickness(new)); create_GC(new); create_pixmaps(new); SetPixmap(new, DownPx, DownPixmap(new), down_width, down_height); Wagging(new) = False; Barking(new) = False; WagId(new) = 0; BarkId(new) = 0; Resize(new); } static void destroy_pixmaps(w) DogWidget w; { XFreePixmap (XtDisplay(w), UpPixmap(w)); XFreePixmap (XtDisplay(w), DownPixmap(w)); XFreePixmap (XtDisplay(w), BarkPixmap(w)); } static void Destroy(w) DogWidget w; { XtReleaseGC ((Widget)w, DrawGC(w)); destroy_pixmaps(w); if (WagId(w) != 0) XtRemoveTimeOut( WagId(w)); if (BarkId(w) != 0) XtRemoveTimeOut( BarkId(w)); XtRemoveAllCallbacks ((Widget)w, DogNbarkCallback); } static void Resize(w) DogWidget w; { _DogPosition(w); } static Boolean DifferentBackground(w, p) Widget w; Widget p; { if (XmIsPrimitive(w) && XmIsManager(p)) { Pixel w_bg, p_bg; Pixmap w_px, p_px; XtVaGetValues(w, XmNbackground, &w_bg, XmNbackgroundPixmap, &w_px, NULL); XtVaGetValues(p, XmNbackground, &p_bg, XmNbackgroundPixmap, &p_px, NULL); return ((w_bg == p_bg) && (w_px == p_px)); } return (False); } static void Redisplay(w, event, region) Widget w; XEvent *event; Region region; { if (XtIsRealized(w)) { XmeDrawShadows(XtDisplay (w), XtWindow (w), TopShadowGC(w), BottomShadowGC(w), HighlightThickness(w), HighlightThickness(w), Width(w) - 2 * HighlightThickness(w), Height(w) - 2 * HighlightThickness(w), ShadowThickness(w), XmSHADOW_OUT); if (Highlighted(w)) (*((DogWidgetClass)XtClass(w)) -> primitive_class.border_highlight)((Widget)w); else if (DifferentBackground ((Widget)w, XtParent (w))) (*((DogWidgetClass)XtClass(w)) -> primitive_class.border_unhighlight)((Widget)w); _DogDrawPixmap((DogWidget)w); } } static Boolean SetValues(current, request, new) DogWidget current; DogWidget request; DogWidget new; { Boolean redraw = False; if (ShadowThickness(new) != ShadowThickness(current) || HighlightThickness(new) != HighlightThickness(current)) { _DogPosition(new); redraw = True; } if (Foreground(new) != Foreground(current) || BackgroundPixel(new) != BackgroundPixel(current)) { XtReleaseGC ((Widget)current, DrawGC(current)); create_GC(new); destroy_pixmaps(new); create_pixmaps(new); switch (CurrPx(new)) { case(UpPx) : SetPixmap(new,UpPx,UpPixmap(new),up_width,up_height); break; case(DownPx) : SetPixmap(new,DownPx,DownPixmap(new),down_width,down_height); break; case(BarkPx) : SetPixmap(new,BarkPx,BarkPixmap(new),bark_width,bark_height); break; } redraw = True; } return (redraw); } static XtGeometryResult QueryGeometry (w, intended, reply) DogWidget w; XtWidgetGeometry *intended; XtWidgetGeometry *reply; { reply->request_mode = 0; if ((intended->request_mode & (~(CWWidth | CWHeight))) != 0) return (XtGeometryNo); reply->request_mode = (CWWidth | CWHeight); reply->width = MAX(MAX(down_width,up_width),bark_width) + 2*(ShadowThickness(w)+HighlightThickness(w)); reply->height = MAX(MAX(down_height,up_height),bark_height) + 2*(ShadowThickness(w)+HighlightThickness(w)); if (reply->width != intended->width || reply->height != intended->height || intended->request_mode != reply->request_mode) return (XtGeometryAlmost); else { reply->request_mode = 0; return (XtGeometryYes); } } /********************************************************************** * * Widget actions * *********************************************************************/ static void bark_dog(w, event) DogWidget w; XEvent *event; { XmProcessTraversal((Widget)w, XmTRAVERSE_CURRENT); XtCallCallbacks ((Widget)w, DogNbarkCallback, NULL); if (Barking(w) == True) return; Barking(w) = True; SetPixmap(w,BarkPx,BarkPixmap(w),bark_width,bark_height); _DogPosition(w); _DogDrawPixmap(w); BarkId(w) = XtAppAddTimeOut (XtWidgetToApplicationContext((Widget)w), BarkTime(w), end_bark, w); } static void end_bark(w, t) DogWidget w; XtIntervalId *t; { SetPixmap(w,DownPx,DownPixmap(w),down_width,down_height); _DogPosition(w); _DogDrawPixmap(w); Barking(w) = False; BarkId(w) = 0; if (Wagging(w) == True) WagId(w) = XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)w), WagTime(w), do_wag, w); } static void start_wag(w, event) DogWidget w; XEvent *event; { XmProcessTraversal((Widget)w, XmTRAVERSE_CURRENT); if (Wagging(w) == True) return; Wagging(w) = True; if (Barking(w) == True) return; WagId(w) = XtAppAddTimeOut (XtWidgetToApplicationContext((Widget)w), WagTime(w), do_wag, w); } static void stop_wag(w, event) DogWidget w; XEvent *event; { XmProcessTraversal((Widget)w, XmTRAVERSE_CURRENT); Wagging(w) = False; if (WagId(w) != 0) XtRemoveTimeOut( WagId(w)); WagId(w) = 0; } static void do_wag(w, t) XtPointer w; XtIntervalId *t; { DogWidget dw = (DogWidget)w; if (Barking(dw) == True) return; if (Wagging(dw) == False) return; switch(CurrPx(dw)) { case(UpPx): SetPixmap(dw,DownPx,DownPixmap(dw),down_width,down_height); break; case(DownPx): SetPixmap(dw,UpPx,UpPixmap(dw),up_width,up_height); break; } _DogPosition(dw); _DogDrawPixmap(dw); XtAppAddTimeOut (XtWidgetToApplicationContext((Widget)dw), WagTime(dw), do_wag, dw); } ����������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/dogs.c�����������������������������������������������������������0000644�0001750�0001750�00000011335�12672140200�015313� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: dogs.c /main/5 1995/07/14 10:07:19 drk $" #endif #endif /***************************************************************************** * * dogs.c - Square & Dog widget demo source file. * ******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <Xm/Xm.h> #include <Xm/MessageB.h> #include <Mrm/MrmPublic.h> #include "Square.h" #include "Dog.h" XtAppContext app_context; #define k_dog1_id 1 #define k_dog2_id 2 #define k_dog3_id 3 #define k_help_id 4 static void create_cb(); static void bark_cb(); static void tb_cb(); static void scale_cb(); static void help_cb(); static void exit_cb(); static MrmHierarchy mrm_id; static char *mrm_vec[]={"dogs.uid"}; static MrmCode mrm_class; static MRMRegisterArg mrm_names[] = { {"create_cb", (caddr_t)create_cb }, {"bark_cb", (caddr_t)bark_cb }, {"tb_cb", (caddr_t)tb_cb }, {"scale_cb", (caddr_t)scale_cb }, {"help_cb", (caddr_t)help_cb }, {"exit_cb", (caddr_t)exit_cb } }; static Widget dog1_id; static Widget dog2_id; static Widget dog3_id; static Widget help_id; int main(argc, argv) int argc; char **argv; { Widget shell; Display *display; Widget app_main = NULL; Arg args[3]; MrmInitialize (); SquareMrmInitialize(); DogMrmInitialize(); XtToolkitInitialize(); app_context = XtCreateApplicationContext(); display = XtOpenDisplay(app_context, NULL, argv[0], "Dogs", NULL, 0, &argc, argv); if (display == NULL) { fprintf(stderr, "%s: Can't open display\n", argv[0]); exit(1); } XtSetArg (args[0], XtNallowShellResize, True); XtSetArg (args[1], XtNminWidth, 620); XtSetArg (args[2], XtNminHeight, 370); shell = XtAppCreateShell(argv[0], NULL, applicationShellWidgetClass, display, args, 3); if (MrmOpenHierarchy (1, mrm_vec, NULL, &mrm_id) != MrmSUCCESS) exit(0); MrmRegisterNames(mrm_names, XtNumber(mrm_names)); MrmFetchWidget (mrm_id, "app_main", shell, &app_main, &mrm_class); XtManageChild(app_main); XtRealizeWidget(shell); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } static void create_cb(w, id, reason) Widget w; int *id; unsigned long *reason; { switch (*id) { case k_dog1_id: dog1_id = w; break; case k_dog2_id: dog2_id = w; break; case k_dog3_id: dog3_id = w; break; case k_help_id: help_id = w; XtUnmanageChild((Widget)XmMessageBoxGetChild(help_id, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild((Widget)XmMessageBoxGetChild(help_id, XmDIALOG_HELP_BUTTON)); break; } } static void bark_cb (w, volume, cb) Widget w; int *volume; XtPointer cb; { XBell(XtDisplay(w), *volume); } static void tb_cb (w, tag, cb) Widget w; int *tag; XmToggleButtonCallbackStruct *cb; { Arg args[1]; Widget dog=NULL; switch (*tag) { case(1) : dog = dog1_id; break; case(2) : dog = dog2_id; break; case(3) : dog = dog3_id; break; } XtSetArg(args[0], SquareNmakeSquare, cb->set); XtSetValues(dog, args, 1); } static void scale_cb(w, tag, cb) Widget w; int *tag; XmScaleCallbackStruct *cb; { Arg args[1]; Widget dog = NULL; switch (*tag) { case(1) : dog = dog1_id; break; case(2) : dog = dog2_id; break; case(3) : dog = dog3_id; break; } XtSetArg(args[0], DogNwagTime, cb->value); XtSetValues(dog, args, 1); } static void help_cb (w, name, cb) Widget w; XmString name; XtPointer cb; { Arg args[1]; if (name == NULL) return; XtSetArg (args[0], XmNmessageString, name); XtSetValues(help_id, args, 1); XtManageChild(help_id); } static void exit_cb (w, name, cb) Widget w; XmString name; XtPointer cb; { exit(0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/dogs/Makefile.am������������������������������������������������������0000644�0001750�0001750�00000000765�13145162623�016265� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = dogs.uil Dog.uil Square.uil bark.bm down.bm up.bm noinst_HEADERS = Dog.h \ DogP.h \ Square.h \ SquareP.h CLEANFILES = dogs.uid noinst_PROGRAMS = dogs dogs_SOURCES = dogs.c Dog.c Square.c dogs_DEPENDENCIES = dogs.uid LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} SUFFIXES = .uil .uid .uil.uid: ../../../clients/uil/uil $< -I$(srcdir) -o $@ �����������motif-2.3.8/demos/unsupported/dogs/up.bm������������������������������������������������������������0000644�0001750�0001750�00000027163�12672140200�015165� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: up.bm /main/4 1995/07/17 18:07:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define up_width 152 #define up_height 91 #define up_x_hot 0 #define up_y_hot 0 static unsigned char up_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xeb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xeb, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x55, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x55, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xea, 0xba, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xea, 0xba, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7d, 0x7d, 0xd5, 0x07, 0x00, 0x00, 0x00, 0x00, 0x56, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7d, 0x7d, 0xd5, 0x07, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x1a, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xae, 0xab, 0xae, 0xbe, 0x07, 0x00, 0x00, 0x00, 0x00, 0xbe, 0x1a, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xae, 0xab, 0xae, 0xbe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x78, 0xf5, 0x80, 0xff, 0x57, 0x55, 0x55, 0x55, 0xff, 0xc1, 0xd5, 0xd7, 0x5f, 0x7f, 0xff, 0x03, 0x00, 0x00, 0x00, 0x78, 0xf5, 0x80, 0xff, 0x57, 0x55, 0x55, 0x55, 0xff, 0xc1, 0xd5, 0xd7, 0x5f, 0x7f, 0xff, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xea, 0xff, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xfe, 0xff, 0xab, 0xeb, 0xab, 0xaa, 0xea, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0xaf, 0xff, 0xaa, 0xaa, 0xaa, 0x73, 0x00, 0x00, 0x00, 0xc0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0x7f, 0x55, 0x55, 0xd5, 0x73, 0x00, 0x00, 0x00, 0xc0, 0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x7f, 0x55, 0x55, 0xfd, 0xd5, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xaf, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbe, 0xaa, 0xaa, 0xfa, 0xaa, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfe, 0xaa, 0xaa, 0xea, 0xbf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, 0x55, 0xd5, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xfd, 0x55, 0xd5, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfa, 0xaa, 0xea, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0xab, 0xea, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0xd5, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x57, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xbf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xaa, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xaa, 0xae, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xd5, 0x5f, 0x55, 0x55, 0x55, 0xf5, 0xff, 0x55, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0xd5, 0x5f, 0x55, 0x55, 0x55, 0xf5, 0xff, 0x55, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xaa, 0xfb, 0xea, 0xea, 0xff, 0xff, 0xeb, 0xab, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xaa, 0xfb, 0xea, 0xea, 0xff, 0xff, 0xeb, 0xab, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x57, 0xf5, 0xd5, 0xff, 0x1f, 0x00, 0x00, 0x7f, 0x55, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x57, 0xf5, 0xd5, 0xff, 0x1f, 0x00, 0x00, 0x7f, 0x55, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xaa, 0xfe, 0xaa, 0x07, 0x00, 0x00, 0x00, 0xfc, 0xea, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xaa, 0xfe, 0xab, 0x07, 0x00, 0x00, 0x00, 0xbc, 0xfa, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x55, 0xfd, 0x55, 0x07, 0x00, 0x00, 0x00, 0x5c, 0xf5, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xf5, 0x83, 0x55, 0x07, 0x00, 0x00, 0x00, 0x57, 0x7f, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xea, 0x83, 0xab, 0x07, 0x00, 0x00, 0x00, 0xab, 0xbe, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaf, 0xfa, 0x80, 0xaf, 0x1f, 0x00, 0x00, 0xe0, 0xab, 0xae, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0xfd, 0x80, 0x5f, 0x1f, 0x00, 0x00, 0xe0, 0x57, 0x5f, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x57, 0x1f, 0x00, 0x7e, 0xfd, 0x00, 0x00, 0xf8, 0xf5, 0x7f, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xaf, 0x1f, 0x00, 0xbe, 0xfa, 0x00, 0x00, 0xf8, 0xea, 0xbf, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xaa, 0x07, 0x00, 0xf0, 0xef, 0x00, 0x00, 0xbe, 0x7e, 0xb0, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x55, 0x07, 0x00, 0xf0, 0xf7, 0x00, 0x00, 0x5e, 0x7d, 0x70, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x1f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x56, 0x1d, 0xf0, 0xd7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xab, 0x1f, 0x00, 0x00, 0xff, 0x00, 0x00, 0xae, 0x1e, 0xf0, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xfa, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xaf, 0x03, 0x00, 0xbe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Makefile.am�����������������������������������������������������������0000644�0001750�0001750�00000000442�13145162623�015321� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in SUBDIRS = dainput \ hellomotif \ xmapdef \ xmfonts \ xmforc \ xmform \ Exm \ aicon \ dogs \ uilsymdump \ motifshell EXTRA_DIST = ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmforc/���������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014631� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmforc/Makefile.in����������������������������������������������������0000644�0001750�0001750�00000044714�13211512767�016644� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = xmforc$(EXEEXT) subdir = demos/unsupported/xmforc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) xmforc_SOURCES = xmforc.c xmforc_OBJECTS = xmforc.$(OBJEXT) xmforc_LDADD = $(LDADD) xmforc_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = DIST_SOURCES = xmforc.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SOURCES = xmforc.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/xmforc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/xmforc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xmforc$(EXEEXT): $(xmforc_OBJECTS) $(xmforc_DEPENDENCIES) $(EXTRA_xmforc_DEPENDENCIES) @rm -f xmforc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xmforc_OBJECTS) $(xmforc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmforc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������motif-2.3.8/demos/unsupported/xmforc/xmforc.c�������������������������������������������������������0000644�0001750�0001750�00000130025�13066310437�016226� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $TOG: xmforc.c /main/6 1997/03/31 13:42:03 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* ** The demo code demonstrates how to use Form attachments and ** the demo by itself illustrates the RowColumn layout resources. ** */ #include <Xm/XmAll.h> #include <stdlib.h> /*------------------------------------------------------------- ** forwarded functions */ void CreateApplication (Widget parent); void CreateForms (Widget parent); void LateSelfAttach (Widget form); void LateCenterAttach (Widget form); Widget CreateHelp (Widget parent); Widget CreateRC (Widget parent); void ResizeHandler (Widget, XtPointer, XEvent *, Boolean *) ; void SetSensitiveScaleScrollBar (Widget scale, Boolean sensitive); void CreateResDialog(void); void UpdateResDialog(Widget widget); /* Xt callbacks */ void QuitCB (Widget w, XtPointer client_data, XtPointer call_data); void HelpCB (Widget w, XtPointer client_data, XtPointer call_data); void TextFieldCB (Widget w, XtPointer client_data, XtPointer call_data) ; void PackingCB (Widget w, XtPointer client_data, XtPointer call_data) ; void EntryAlignmentCB (Widget w, XtPointer client_data, XtPointer call_data) ; void OrientationCB (Widget w, XtPointer client_data, XtPointer call_data) ; void NumColCB (Widget w, XtPointer client_data, XtPointer call_data) ; void WidthCB (Widget w, XtPointer client_data, XtPointer call_data) ; void ResizeWidthCB (Widget w, XtPointer client_data, XtPointer call_data) ; void ResizeHeightCB (Widget w, XtPointer client_data, XtPointer call_data) ; void HeightCB (Widget w, XtPointer client_data, XtPointer call_data) ; void AdjustLastCB (Widget w, XtPointer client_data, XtPointer call_data) ; void IsAlignedCB (Widget w, XtPointer client_data, XtPointer call_data) ; void AdjustMarginCB (Widget w, XtPointer client_data, XtPointer call_data) ; void NumChildCB (Widget w, XtPointer client_data, XtPointer call_data) ; void EntryCB (Widget w, XtPointer client_data, XtPointer call_data) ; void ResOkCB (Widget w, XtPointer client_data, XtPointer call_data) ; /*------------------------------------------------------------- ** RowCol structure */ typedef struct { Widget rc ; Cardinal num_children; /* some widget ids to be kept around */ Widget form, form1, scale_width, scale_height, entry_align_option ; /* rowcol resources set by the user */ unsigned char packing ; unsigned char orientation ; short num_columns ; Boolean resize_width, resize_height ; Dimension width, height ; Boolean adjust_last, adjust_margin, is_aligned ; unsigned char entry_alignment ; Dimension margin_width, margin_height, spacing, entry_border ; Widget cur_button, res_dialog, res_form ; } RC_Data ; static RC_Data rc_data ; /*------------------------------------------------------------- ** Main body */ int main(int argc, char **argv) { XtAppContext app_context; Widget toplevel ; toplevel = XtAppInitialize(&app_context, "XMdemos", NULL, 0, &argc, argv, NULL, NULL, 0); CreateApplication (toplevel); XtRealizeWidget(toplevel); if (argc != 2) LateSelfAttach(rc_data.form) ; LateCenterAttach(rc_data.form1) ; /* have to do that because of scrollbar sensitivity always linked with scale one */ SetSensitiveScaleScrollBar (rc_data.scale_width, !rc_data.resize_width); XtAppMainLoop(app_context); /*NOTREACHED*/ exit(0); } /*------------------------------------------------------------- ** Create a MainWindow with a Form in it. */ void CreateApplication (Widget parent) { Widget main_window, menu_bar, menu_pane, cascade, button ; Arg args[5]; int n ; /* Create app_defined MainWindow. */ n = 0; XtSetArg (args[n], XmNscrollingPolicy, XmAPPLICATION_DEFINED); n++; main_window = XmCreateMainWindow (parent, "main_window", args, n); XtManageChild (main_window); /* Create MenuBar in MainWindow. */ n = 0; menu_bar = XmCreateMenuBar (main_window, "menu_bar", args, n); XtManageChild (menu_bar); /* Create "File" PulldownMenu with Quit button */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Quit", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, QuitCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "File", args, n); XtManageChild (cascade); /* Create "Help" PulldownMenu with Help button. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Help", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, HelpCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "Help", args, n); XtManageChild (cascade); n = 0; XtSetArg (args[n], XmNmenuHelpWidget, cascade); n++; XtSetValues (menu_bar, args, n); /* Create my complex forms in the MainWindow */ CreateForms(main_window) ; /* Set MainWindow areas */ XmMainWindowSetAreas (main_window, menu_bar, NULL, NULL, NULL, rc_data.form); } /*------------------------------------------------------------- ** CreateForms - create forms and title in Frame ** ** This form is built by lines. There are 5 lines, one line ** for the title, one line for the separator under the title, one ** for the option menus, one for the scale and one for 2 sub-forms. ** Within each line, the widgets are vertically attached to the ** first item in the line, using 2 opposite_widget attachment, which ** make the line totally driven by the first item. ** Vertical attachment between lines are thus made only using the ** first item in each line. ** Horizontal attachments within a line are made using attach widget ** (except for the third line where I use positionning). Now the problem ** with attach_widget is that only the last item in a line will be ** resized (and you can't use positionning since you don't know the ** relative sizes of each child in a line). So I'm gonna use late ** binding and attach_self: all the regular widget attachement that ** I set here (not the opposite_widget ones) will be changed in ** attach_self after the first layout has been done. ** ** After the first layout (read: after XtRealizeWidget(topshell)), ** I'm also going to do some centering that can't be done statically. ** */ void CreateForms (Widget parent) { Widget title, sep, form2, textfield1, textfield2, textfield3, textfield4, label1, label2, label3, label4, option1, option2, button, pulldown, toggle1, toggle2, toggle3, scale1, scale2 ; Arg args[20]; int n ; n = 0; rc_data.form = XmCreateForm(parent, "main_form", args, n); XtManageChild (rc_data.form); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; title = XmCreateLabel(rc_data.form, "rowcol_layout", args, n); XtManageChild (title); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, title); n++; sep = XmCreateSeparator(rc_data.form, "separator", args, n); XtManageChild (sep); n = 0; pulldown = XmCreatePulldownMenu(rc_data.form, "packing_pulldown", args, n); n = 0; button = XmCreatePushButton(pulldown, "pack_tight", args, n); XtAddCallback (button, XmNactivateCallback, PackingCB, (XtPointer) XmPACK_TIGHT); XtManageChild(button); rc_data.packing = XmPACK_TIGHT ; n = 0; button = XmCreatePushButton(pulldown, "pack_column", args, n); XtAddCallback (button, XmNactivateCallback, PackingCB, (XtPointer) XmPACK_COLUMN); XtManageChild(button); n = 0; button = XmCreatePushButton(pulldown, "pack_none", args, n); XtAddCallback (button, XmNactivateCallback, PackingCB, (XtPointer) XmPACK_NONE); XtManageChild(button); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNleftPosition, 10); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, title); n++; XtSetArg (args[n], XmNsubMenuId, pulldown); n++; option1 = XmCreateOptionMenu(rc_data.form, "packing_option", args, n); XtManageChild (option1); n = 0; pulldown = XmCreatePulldownMenu(rc_data.form, "orientation_pulldown", args, n); n = 0; button = XmCreatePushButton(pulldown, "vertical", args, n); XtAddCallback (button, XmNactivateCallback, OrientationCB, (XtPointer) XmVERTICAL); XtManageChild(button); rc_data.orientation = XmVERTICAL ; n = 0; button = XmCreatePushButton(pulldown, "horizontal", args, n); XtAddCallback (button, XmNactivateCallback, OrientationCB, (XtPointer) XmHORIZONTAL); XtManageChild(button); #define XtSetArg_HorAlignWith(widget) \ XtSetArg (args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++;\ XtSetArg (args[n], XmNtopWidget, widget); n++;\ XtSetArg (args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++;\ XtSetArg (args[n], XmNbottomWidget, widget); n++ n = 0; XtSetArg_HorAlignWith(option1) ; XtSetArg (args[n], XmNrightAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNrightPosition, 90); n++; XtSetArg (args[n], XmNsubMenuId, pulldown); n++; option2 = XmCreateOptionMenu(rc_data.form, "orientation_option", args, n); XtManageChild (option2); rc_data.num_columns = 1 ; n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, option1); n++; XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg (args[n], XmNshowValue, True); n++; XtSetArg (args[n], XmNminimum, 1); n++; XtSetArg (args[n], XmNvalue, rc_data.num_columns); n++; scale1 = XmCreateScale(rc_data.form, "num_columns", args, n); XtAddCallback (scale1, XmNvalueChangedCallback, NumColCB, NULL); XtManageChild (scale1); n = 0; label1 = XmCreateLabel(scale1, "num_column_label", args, n); XtManageChild (label1); rc_data.num_children = 0 ; n = 0; XtSetArg_HorAlignWith(scale1) ; XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, scale1); n++; XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg (args[n], XmNshowValue, True); n++; XtSetArg (args[n], XmNminimum, 0); n++; XtSetArg (args[n], XmNvalue, rc_data.num_children); n++; scale2 = XmCreateScale(rc_data.form, "num_children", args, n); XtAddCallback (scale2, XmNvalueChangedCallback, NumChildCB, NULL); XtManageChild (scale2); /* num_children is used everywhere for checking existence of the rowcolumn */ n = 0; label1 = XmCreateLabel(scale2, "num_children_label", args, n); XtManageChild (label1); n = 0; XtSetArg_HorAlignWith(scale2) ; XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, scale2); n++; XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg (args[n], XmNshowValue, True); n++; XtSetArg (args[n], XmNminimum, 1); n++; rc_data.scale_width = XmCreateScale(rc_data.form, "resize_width", args, n); XtAddCallback (rc_data.scale_width, XmNvalueChangedCallback, WidthCB, NULL); XtManageChild (rc_data.scale_width); /* rc_data.width will be initialized with the first resize */ rc_data.resize_width = True ; n = 0; XtSetArg (args[n], XmNset, rc_data.resize_width); n++; toggle1 = XmCreateToggleButton(rc_data.scale_width, "resize_width_toggle", args, n); XtAddCallback (toggle1, XmNvalueChangedCallback, ResizeWidthCB, NULL); XtManageChild (toggle1); SetSensitiveScaleScrollBar (rc_data.scale_width, !rc_data.resize_width); n = 0; XtSetArg_HorAlignWith(rc_data.scale_width) ; XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, rc_data.scale_width); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg (args[n], XmNshowValue, True); n++; XtSetArg (args[n], XmNminimum, 1); n++; rc_data.scale_height = XmCreateScale(rc_data.form, "resize_height", args, n); XtAddCallback (rc_data.scale_height, XmNvalueChangedCallback, HeightCB, NULL); XtManageChild (rc_data.scale_height); /* rc_data.height will be initialized with the first resize */ rc_data.resize_height = True ; n = 0; XtSetArg (args[n], XmNset, rc_data.resize_height); n++; toggle1 = XmCreateToggleButton(rc_data.scale_height, "resize_height_toggle", args, n); XtAddCallback (toggle1, XmNvalueChangedCallback, ResizeHeightCB, NULL); XtManageChild (toggle1); SetSensitiveScaleScrollBar (rc_data.scale_height, !rc_data.resize_height); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, scale1); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; rc_data.form1 = XmCreateForm(rc_data.form, "form1", args, n); XtManageChild (rc_data.form1); rc_data.adjust_last = True ; n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNset, rc_data.adjust_last); n++; toggle1 = XmCreateToggleButton(rc_data.form1, "adjust_last_toggle", args, n); XtAddCallback (toggle1, XmNvalueChangedCallback, AdjustLastCB, NULL); XtManageChild (toggle1); rc_data.adjust_margin = True ; n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNtopPosition, 25); n++; XtSetArg (args[n], XmNset, rc_data.adjust_margin); n++; toggle2 = XmCreateToggleButton(rc_data.form1, "adjust_margin_toggle", args, n); XtAddCallback (toggle2, XmNvalueChangedCallback, AdjustMarginCB, NULL); XtManageChild (toggle2); rc_data.is_aligned = True ; n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNtopPosition, 50); n++; XtSetArg (args[n], XmNset, rc_data.is_aligned); n++; toggle3 = XmCreateToggleButton(rc_data.form1, "is_aligned_toggle", args, n); XtAddCallback (toggle3, XmNvalueChangedCallback, IsAlignedCB, NULL); XtManageChild (toggle3); n = 0; pulldown = XmCreatePulldownMenu(rc_data.form1, "entry_align_pulldown", args, n); n = 0; button = XmCreatePushButton(pulldown, "align_beginning", args, n); XtAddCallback (button, XmNactivateCallback, EntryAlignmentCB, (XtPointer) XmALIGNMENT_BEGINNING); XtManageChild(button); rc_data.entry_alignment = XmALIGNMENT_BEGINNING ; n = 0; button = XmCreatePushButton(pulldown, "align_center", args, n); XtAddCallback (button, XmNactivateCallback, EntryAlignmentCB, (XtPointer) XmALIGNMENT_CENTER); XtManageChild(button); n = 0; button = XmCreatePushButton(pulldown, "align_end", args, n); XtAddCallback (button, XmNactivateCallback, EntryAlignmentCB, (XtPointer) XmALIGNMENT_END); XtManageChild(button); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNtopPosition, 77); n++; XtSetArg (args[n], XmNsubMenuId, pulldown); n++; rc_data.entry_align_option = XmCreateOptionMenu(rc_data.form1, "entry_alignment", args, n); XtManageChild (rc_data.entry_align_option); n = 0; XtSetArg_HorAlignWith(rc_data.form1) ; XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, rc_data.form1); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; form2 = XmCreateForm(rc_data.form, "form2", args, n); XtManageChild (form2); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNtopPosition, 0); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_FORM); n++; XtSetArg (args[n], XmNleftOffset, -100); n++; XtSetArg (args[n], XmNcolumns, 4); n++; XtSetArg (args[n], XmNvalue, "3"); n++; textfield1 = XmCreateTextField(form2, "margin_width_text", args, n); XtAddCallback (textfield1, XmNactivateCallback, TextFieldCB, XmNmarginWidth); XtManageChild (textfield1); rc_data.margin_width = 3 ; n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNtopPosition, 25); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, textfield1); n++; XtSetArg (args[n], XmNcolumns, 4); n++; XtSetArg (args[n], XmNvalue, "3"); n++; textfield2 = XmCreateTextField(form2, "margin_height_text", args, n); XtAddCallback (textfield2, XmNactivateCallback, TextFieldCB, XmNmarginHeight); XtManageChild (textfield2); rc_data.margin_height = 3 ; n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNtopPosition, 50); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, textfield1); n++; XtSetArg (args[n], XmNcolumns, 4); n++; XtSetArg (args[n], XmNvalue, "3"); n++; textfield3 = XmCreateTextField(form2, "spacing_text", args, n); XtAddCallback (textfield3, XmNactivateCallback, TextFieldCB, XmNspacing); XtManageChild (textfield3); rc_data.spacing = 3 ; n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNtopPosition, 75); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, textfield1); n++; XtSetArg (args[n], XmNcolumns, 4); n++; XtSetArg (args[n], XmNvalue, "0"); n++; textfield4 = XmCreateTextField(form2, "entry_border_text", args, n); XtAddCallback (textfield4, XmNactivateCallback, TextFieldCB, XmNentryBorder); XtManageChild (textfield4); rc_data.entry_border = 0 ; n = 0; XtSetArg_HorAlignWith(textfield1); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield1); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; label1 = XmCreateLabel(form2, "margin_width", args, n); XtManageChild (label1); n = 0; XtSetArg_HorAlignWith(textfield2); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield2); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; label2 = XmCreateLabel(form2, "margin_height", args, n); XtManageChild (label2); n = 0; XtSetArg_HorAlignWith(textfield3); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield3); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; label3 = XmCreateLabel(form2, "spacing", args, n); XtManageChild (label3); n = 0; XtSetArg_HorAlignWith(textfield4); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield4); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; label4 = XmCreateLabel(form2, "entry_border", args, n); XtManageChild (label4); } /*------------------------------------------------------------- ** LateSelfAttach ** ** Run thru the child list of this form and ** change all the attach_widget target in attach_self, so that ** prorating happens on resize. ** */ void LateSelfAttach(Widget form) { Arg args[5]; int n, i ; Widget * children, left_widget, top_widget ; Cardinal num_children ; unsigned char left_attach, top_attach ; n = 0; XtSetArg (args[n], XmNnumChildren, &num_children); n++; XtSetArg (args[n], XmNchildren, &children); n++; XtGetValues (form, args, n); for (i=0; i < num_children; i++) { n = 0; XtSetArg (args[n], XmNleftAttachment, &left_attach); n++; XtSetArg (args[n], XmNleftWidget, &left_widget); n++; XtSetArg (args[n], XmNtopAttachment, &top_attach); n++; XtSetArg (args[n], XmNtopWidget, &top_widget); n++; XtGetValues (children[i], args, n); if (left_attach == XmATTACH_WIDGET) { n = 0; XtSetArg (args[n], XmNrightAttachment, XmATTACH_SELF); n++; XtSetArg (args[n], XmNrightOffset, 0); n++; XtSetValues (left_widget, args, n); } if (top_attach == XmATTACH_WIDGET) { n = 0; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_SELF); n++; XtSetArg (args[n], XmNbottomOffset, 0); n++; XtSetValues (top_widget, args, n); } } } /*------------------------------------------------------------- ** LateCenterAttach ** ** Run thru the child list of this form and ** center the children horizontally, using their current width. ** */ void LateCenterAttach(Widget form) { Arg args[5]; int n, i ; Widget * children ; Cardinal num_children ; Dimension width ; n = 0; XtSetArg (args[n], XmNnumChildren, &num_children); n++; XtSetArg (args[n], XmNchildren, &children); n++; XtGetValues (form, args, n); for (i=0; i < num_children; i++) { n = 0; XtSetArg (args[n], XmNwidth, &width); n++; XtGetValues (children[i], args, n); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNleftPosition, 50); n++; XtSetArg (args[n], XmNleftOffset, -((int)width)/2); n++; XtSetValues (children[i], args, n); } } /*------------------------------------------------------------- ** QuitCB - callback for cancel button */ void QuitCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { exit (0); } /*------------------------------------------------------------- ** HelpCB - callback for help button */ void HelpCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { static Widget message_box = NULL ; if (!message_box) message_box = CreateHelp (w); XtManageChild (message_box); } /*------------------------------------------------------------- ** CreateHelp - create help window */ Widget CreateHelp (Widget parent) /* parent widget */ { Widget button; Widget message_box; /* Message Dialog */ Arg args[20]; /* arg list */ register int n; /* arg count */ static char message[1000]; /* help text */ XmString title_string = NULL; XmString message_string = NULL; XmString button_string = NULL; /* Generate message to display. */ sprintf (message, "\ Use the numChildren resource to control the creation and destruction\n\ of the RowColumn. Then use the other controls to manipulate the RowColumn\n\ layout resources."); message_string = XmStringCreateLtoR (message, XmSTRING_DEFAULT_CHARSET); button_string = XmStringCreateLtoR ("Close", XmSTRING_DEFAULT_CHARSET); title_string = XmStringCreateLtoR ("General Help", XmSTRING_DEFAULT_CHARSET); /* Create MessageBox dialog. */ n = 0; XtSetArg (args[n], XmNdialogTitle, title_string); n++; XtSetArg (args[n], XmNokLabelString, button_string); n++; XtSetArg (args[n], XmNmessageString, message_string); n++; message_box = XmCreateMessageDialog (parent, "helpbox", args, n); button = XmMessageBoxGetChild (message_box, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild (button); button = XmMessageBoxGetChild (message_box, XmDIALOG_HELP_BUTTON); XtUnmanageChild (button); /* Free strings and return MessageBox. */ if (title_string) XmStringFree (title_string); if (message_string) XmStringFree (message_string); if (button_string) XmStringFree (button_string); return (message_box); } /*------------------------------------------------------------- ** NumChildCB */ void NumChildCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; XmScaleCallbackStruct * scb = (XmScaleCallbackStruct *) call_data ; Widget * children, new_child ; char name[10] ; int i ; Cardinal num_children ; /* the valueChangeCallback might get called with the same value */ if (rc_data.num_children == scb->value) return ; if (scb->value == 0) { /* assert: rc already exists, since we moved from something not null to 0 */ XtDestroyWidget(XtParent(rc_data.rc)); rc_data.num_children = 0 ; return ; } /* assert: value != num_children */ if (scb->value > rc_data.num_children) { /* num_children can be zero */ if (rc_data.num_children == 0) rc_data.rc = CreateRC(w); /* add buttons at the end of the child list */ for (i = rc_data.num_children ; i < scb->value; i++) { sprintf(name, "push%d", i); new_child = XmCreatePushButton (rc_data.rc, name, NULL, 0); XtManageChild(new_child); } } else { XtSetArg (args[0], XmNchildren, &children); XtGetValues (rc_data.rc, args, 1); for (i = rc_data.num_children ; i > scb->value; i--) { XtDestroyWidget(children[i-1]); } } rc_data.num_children = scb->value ; } /*------------------------------------------------------------- ** HeightCB */ void HeightCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; XmScaleCallbackStruct * scb = (XmScaleCallbackStruct *) call_data ; rc_data.height = scb->value ; if (rc_data.num_children) { XtSetArg(args[0], XmNheight, scb->value); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** AdjustMarginCB */ void AdjustMarginCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; XmToggleButtonCallbackStruct * scb = (XmToggleButtonCallbackStruct *) call_data ; rc_data.adjust_margin = scb->set ; if (rc_data.num_children) { XtSetArg(args[0], XmNadjustMargin, scb->set); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** IsAlignedCB */ void IsAlignedCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; XmToggleButtonCallbackStruct * scb = (XmToggleButtonCallbackStruct *) call_data ; rc_data.is_aligned = scb->set ; if (rc_data.num_children) { XtSetArg(args[0], XmNisAligned, scb->set); XtSetValues(rc_data.rc, args, 1); } /* XtSetSensitive(rc_data.entry_align_option, scb->set);*/ } /*------------------------------------------------------------- ** AdjustLastCB */ void AdjustLastCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; XmToggleButtonCallbackStruct * scb = (XmToggleButtonCallbackStruct *) call_data ; rc_data.adjust_last = scb->set ; if (rc_data.num_children) { XtSetArg(args[0], XmNadjustLast, scb->set); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** ResizeWidthCB */ void ResizeWidthCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[4] ; Cardinal n ; XmToggleButtonCallbackStruct * scb = (XmToggleButtonCallbackStruct *) call_data ; rc_data.resize_width = scb->set ; if (rc_data.num_children) { n = 0 ; XtSetArg(args[n], XmNresizeWidth, scb->set); n++ ; /* Nice hack: when we switch from resizeWidth False to True, width will be ignored, but since we want a relayout to happen, to reflect the new shrink wrap stuff, we need to ask for something different than the current width. So we use (int)scb->set which is 0 resizeWidth = False, and adds 1 when it's True */ XtSetArg(args[n], XmNwidth, rc_data.width + (int)scb->set); n++ ; XtSetValues(rc_data.rc, args, n); } SetSensitiveScaleScrollBar (rc_data.scale_width, !scb->set) ; } /*------------------------------------------------------------- ** ResizeHeightCB */ void ResizeHeightCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[4] ; Cardinal n ; XmToggleButtonCallbackStruct * scb = (XmToggleButtonCallbackStruct *) call_data ; rc_data.resize_height = scb->set ; if (rc_data.num_children) { n = 0 ; /* same trick as resize_width, see above*/ XtSetArg(args[n], XmNresizeHeight, scb->set); n++ ; XtSetArg(args[n], XmNheight, rc_data.height + (int)scb->set); n++ ; XtSetValues(rc_data.rc, args, n); } SetSensitiveScaleScrollBar (rc_data.scale_height, !scb->set) ; } /*-------------------------------------------------------------*/ void SetSensitiveScaleScrollBar (Widget scale, Boolean sensitive) { Arg args[4] ; Cardinal n ; Widget * children ; n = 0; XtSetArg (args[n], XmNchildren, &children); n++; XtGetValues (scale, args, n); /* everybody knows that this is the scrollbar... */ XtSetSensitive(children[1], sensitive); } /*------------------------------------------------------------- ** WidthCB */ void WidthCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; XmScaleCallbackStruct * scb = (XmScaleCallbackStruct *) call_data ; rc_data.width = scb->value ; if (rc_data.num_children) { XtSetArg(args[0], XmNwidth, scb->value); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** NumColCB */ void NumColCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; XmScaleCallbackStruct * scb = (XmScaleCallbackStruct *) call_data ; if (rc_data.num_columns == scb->value) return ; rc_data.num_columns = scb->value ; if (rc_data.num_children) { XtSetArg(args[0], XmNnumColumns, scb->value); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** OrientationCB */ void OrientationCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; rc_data.orientation = (unsigned char) (int) client_data ; if (rc_data.num_children) { XtSetArg(args[0], XmNorientation, client_data); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** EntryAlignmentCB */ void EntryAlignmentCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; rc_data.entry_alignment = (unsigned char) (int) client_data ; if (rc_data.num_children) { XtSetArg(args[0], XmNentryAlignment, client_data); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** PackingCB client_data = resource value */ void PackingCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; rc_data.packing = (unsigned char) (int) client_data ; if (rc_data.num_children) { XtSetArg(args[0], XmNpacking, client_data); XtSetValues(rc_data.rc, args, 1); } } /*------------------------------------------------------------- ** TextFieldCB client_data = resource name */ void TextFieldCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[1] ; String string ; int val ; string = XmTextFieldGetString(w) ; if (string) { val = atoi(string) ; if (strcmp(client_data, XmNmarginWidth)) rc_data.margin_width = val ; if (strcmp(client_data, XmNmarginHeight)) rc_data.margin_height = val ; if (strcmp(client_data, XmNspacing)) rc_data.spacing = val ; if (strcmp(client_data, XmNentryBorder)) rc_data.entry_border = val ; if (rc_data.num_children) { XtSetArg(args[0], client_data, val); XtSetValues(rc_data.rc, args, 1); } XtFree(string); } } /*------------------------------------------------------------- ** EntryCB callback for buttons in the RC */ void EntryCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { XmRowColumnCallbackStruct * rcCB = (XmRowColumnCallbackStruct *) call_data ; rc_data.cur_button = rcCB->widget; if (!rc_data.res_dialog) CreateResDialog(); UpdateResDialog(rc_data.cur_button); XtManageChild (rc_data.res_dialog); } /*------------------------------------------------------------- ** CreateResDialog - create a dialog window for modifying ** some current button resources. */ void CreateResDialog (void) { Widget label1, label2, label3, label4, label5, textfield1, textfield2, textfield3, textfield4, textfield5 ; Arg args[20] ; Cardinal n ; n = 0 ; rc_data.res_dialog = XmCreateMessageDialog(rc_data.rc, "res_dialog", args, n); XtAddCallback (rc_data.res_dialog, XmNokCallback, ResOkCB, NULL); n = 0 ; rc_data.res_form = XmCreateForm(rc_data.res_dialog, "res_form", args, n); XtManageChild (rc_data.res_form); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_POSITION); n++; XtSetArg (args[n], XmNleftPosition, 33); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; textfield1 = XmCreateTextField(rc_data.res_form, "t_x", args, n); XtManageChild (textfield1); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, textfield1); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, textfield1); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; textfield2 = XmCreateTextField(rc_data.res_form, "t_y", args, n); XtManageChild (textfield2); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, textfield2); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, textfield2); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; textfield3 = XmCreateTextField(rc_data.res_form, "t_width", args, n); XtManageChild (textfield3); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, textfield3); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, textfield3); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; textfield4 = XmCreateTextField(rc_data.res_form, "t_height", args, n); XtManageChild (textfield4); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, textfield4); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, textfield4); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; textfield5 = XmCreateTextField(rc_data.res_form, "t_recomp_size", args, n); XtManageChild (textfield5); n = 0; XtSetArg_HorAlignWith(textfield1); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield1); n++; label1 = XmCreateLabel(rc_data.res_form, "l_x", args, n); XtManageChild (label1); n = 0; XtSetArg_HorAlignWith(textfield2); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield2); n++; label2 = XmCreateLabel(rc_data.res_form, "l_y", args, n); XtManageChild (label2); n = 0; XtSetArg_HorAlignWith(textfield3); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield3); n++; label3 = XmCreateLabel(rc_data.res_form, "l_width", args, n); XtManageChild (label3); n = 0; XtSetArg_HorAlignWith(textfield4); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield4); n++; label4 = XmCreateLabel(rc_data.res_form, "l_height", args, n); XtManageChild (label4); n = 0; XtSetArg_HorAlignWith(textfield5); XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, textfield5); n++; label5 = XmCreateLabel(rc_data.res_form, "l_recomp_size", args, n); XtManageChild (label5); } /*------------------------------------------------------------- ** ResOkCB for buttons, called one each text return and OK */ void ResOkCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[10] ; Cardinal n ; char * s_x, * s_y, * s_width, * s_height, *s_recomp_size ; Widget * children ; /* following code based on the assumption that the children in the res_dialog form have a specific order */ n = 0; XtSetArg (args[n], XmNchildren, &children); n++; XtGetValues (rc_data.res_form, args, n); s_x = XmTextFieldGetString(children[0]) ; s_y = XmTextFieldGetString(children[1]) ; s_width = XmTextFieldGetString(children[2]) ; s_height = XmTextFieldGetString(children[3]) ; s_recomp_size = XmTextFieldGetString(children[4]) ; n = 0 ; XtSetArg(args[n], XmNx, atoi(s_x)); n++; XtSetArg(args[n], XmNy, atoi(s_y)); n++; XtSetArg(args[n], XmNwidth, atoi(s_width)); n++; XtSetArg(args[n], XmNheight, atoi(s_height)); n++; XtSetArg(args[n], XmNrecomputeSize, atoi(s_recomp_size)); n++; XtSetValues(rc_data.cur_button, args, n); XtFree(s_x); XtFree(s_y); XtFree(s_width); XtFree(s_height); XtFree(s_recomp_size); } /*------------------------------------------------------------- ** UpdateResDialog - update the dialog window used to change ** this button resources. */ void UpdateResDialog (Widget widget) /* rc child widget */ { Arg args[20] ; Cardinal n ; Position b_x, b_y ; Dimension b_width, b_height ; Boolean b_recomp_size ; char s[10] ; Widget * children ; XmString title ; /* first update the name of the dialog */ title = XmStringCreateLtoR (XtName(widget), XmSTRING_DEFAULT_CHARSET); n = 0; XtSetArg (args[n], XmNdialogTitle, title); n++; XtSetValues (rc_data.res_dialog, args, n); XmStringFree (title); n = 0; XtSetArg (args[n], XmNx, &b_x); n++; XtSetArg (args[n], XmNy, &b_y); n++; XtSetArg (args[n], XmNwidth, &b_width); n++; XtSetArg (args[n], XmNheight, &b_height); n++; XtSetArg (args[n], XmNrecomputeSize, &b_recomp_size); n++; XtGetValues (widget, args, n); /* following code based on the assumption that the children in the res_dialog form have a specific order */ n = 0; XtSetArg (args[n], XmNchildren, &children); n++; XtGetValues (rc_data.res_form, args, n); sprintf(s,"%d",b_x); n = 0; XtSetArg (args[n], XmNvalue, s); n++; XtSetValues (children[0], args, n); sprintf(s,"%d",b_y); n = 0; XtSetArg (args[n], XmNvalue, s); n++; XtSetValues (children[1], args, n); sprintf(s,"%d",b_width); n = 0; XtSetArg (args[n], XmNvalue, s); n++; XtSetValues (children[2], args, n); sprintf(s,"%d",b_height); n = 0; XtSetArg (args[n], XmNvalue, s); n++; XtSetValues (children[3], args, n); sprintf(s,"%d",b_recomp_size); n = 0; XtSetArg (args[n], XmNvalue, s); n++; XtSetValues (children[4], args, n); } /*------------------------------------------------------------- ** CreateRC - create the rc in a dialog and fill it with ** resource coming from rc_data. */ Widget CreateRC (Widget parent) /* parent widget */ { Widget dialog_shell, rc ; Arg args[20] ; Cardinal n ; n = 0 ; XtSetArg(args[n], XmNallowShellResize, True); n++ ; dialog_shell = XmCreateDialogShell(parent, "RowColumn", args, n); XtManageChild(dialog_shell); n = 0 ; XtSetArg(args[n], XmNpacking, rc_data.packing); n++ ; XtSetArg(args[n], XmNorientation, rc_data.orientation); n++ ; XtSetArg(args[n], XmNnumColumns, rc_data.num_columns); n++ ; XtSetArg(args[n], XmNresizeWidth, rc_data.resize_width); n++ ; XtSetArg(args[n], XmNresizeHeight, rc_data.resize_height); n++ ; XtSetArg(args[n], XmNwidth, rc_data.width); n++ ; XtSetArg(args[n], XmNheight, rc_data.height); n++ ; XtSetArg(args[n], XmNadjustLast, rc_data.adjust_last); n++ ; XtSetArg(args[n], XmNadjustMargin, rc_data.adjust_margin); n++ ; XtSetArg(args[n], XmNisAligned, rc_data.is_aligned); n++ ; XtSetArg(args[n], XmNentryAlignment, rc_data.entry_alignment); n++ ; XtSetArg(args[n], XmNmarginWidth, rc_data.margin_width); n++ ; XtSetArg(args[n], XmNmarginHeight, rc_data.margin_height); n++ ; XtSetArg(args[n], XmNspacing, rc_data.spacing); n++ ; XtSetArg(args[n], XmNentryBorder, rc_data.entry_border); n++ ; rc = XmCreateRowColumn(dialog_shell, "rc", args, n); XtManageChild(rc); XtAddCallback (rc, XmNentryCallback, EntryCB, NULL); XtAddEventHandler(rc, StructureNotifyMask, False, ResizeHandler, NULL); return rc ; } /* ** Get here whenever the rowcolumnis move, resize.. ** Have to update the scale value */ void ResizeHandler (Widget widget, XtPointer data, XEvent *event, Boolean *cont) { Arg args[5] ; Cardinal n ; n = 0 ; XtSetArg(args[n], XmNwidth, &(rc_data.width)); n++ ; XtSetArg(args[n], XmNheight, &(rc_data.height)); n++ ; XtGetValues (widget, args, n); /* don't bother checking same value, scale will do it */ XmScaleSetValue(rc_data.scale_width, rc_data.width); XmScaleSetValue(rc_data.scale_height, rc_data.height); /* have to do that because of scrollbar sensitivity always linked with scale one */ SetSensitiveScaleScrollBar (rc_data.scale_width, !rc_data.resize_width); SetSensitiveScaleScrollBar (rc_data.scale_height, !rc_data.resize_height); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/xmforc/Makefile.am����������������������������������������������������0000644�0001750�0001750�00000000311�13145162623�016612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_PROGRAMS = xmforc SOURCES = xmforc.c LDADD = ../../../lib/Xm/libXm.la EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Exm/������������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�014064� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Exm/Makefile.in�������������������������������������������������������0000644�0001750�0001750�00000045122�13211512766�016070� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/unsupported/Exm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libExm_a_AR = $(AR) $(ARFLAGS) libExm_a_LIBADD = am_libExm_a_OBJECTS = Container.$(OBJEXT) libExm_a_OBJECTS = $(am_libExm_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libExm_a_SOURCES) DIST_SOURCES = $(libExm_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libExm.a libExm_a_SOURCES = Container.c noinst_HEADERS = Container.h ContainerP.h EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/.. -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/unsupported/Exm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/unsupported/Exm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libExm.a: $(libExm_a_OBJECTS) $(libExm_a_DEPENDENCIES) $(EXTRA_libExm_a_DEPENDENCIES) $(AM_V_at)-rm -f libExm.a $(AM_V_AR)$(libExm_a_AR) libExm.a $(libExm_a_OBJECTS) $(libExm_a_LIBADD) $(AM_V_at)$(RANLIB) libExm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Container.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Exm/ContainerP.h������������������������������������������������������0000644�0001750�0001750�00000006516�12672140200�016230� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: ContainerP.h /main/4 1995/07/15 20:47:12 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /**************************************************************************** * * ContainerP.h: The widget private header file for the ExmContainer widget. * ****************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmContainerP_h #define _ExmContainerP_h /* Include appropriate files. */ #include <Exm/Container.h> /* public header file for ExmContainer */ #include <Exm/GridP.h> /* private header file for Grid */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class part. */ typedef struct { XtPointer extension; } ExmContainerClassPart; /* Define the full class record. */ typedef struct _ExmContainerClassRec { CoreClassPart core_class; CompositeClassPart composite_class; ConstraintClassPart constraint_class; XmManagerClassPart manager_class; ExmGridClassPart grid_class; ExmContainerClassPart container_class; } ExmContainerClassRec; externalref ExmContainerClassRec exmContainerClassRec; /* Define the widget instance part. */ typedef struct { /* Provide space for the values of the resources of ExmContainer. */ Dimension first_column_width; Cardinal * detail_order; Cardinal detail_order_count; XmTabList detail_tablist ; XmStringTable detail_header ; Cardinal detail_header_count; Pixel select_color; unsigned char layout_type; Widget icon_header; } ExmContainerPart; /* Define the full instance record. */ typedef struct _ExmContainerRec { CorePart core; CompositePart composite; ConstraintPart constraint; XmManagerPart manager; ExmGridPart grid; ExmContainerPart container; } ExmContainerRec; /* Define the constraint part structure. */ typedef struct _ExmContainerConstraintPart { char unused ; } ExmContainerConstraintPart, * ExmContainerConstraint; /* Define the full constraint structure. */ typedef struct _ExmContainerConstraintRec { XmManagerConstraintPart manager; ExmGridConstraintPart grid; ExmContainerConstraintPart container; } ExmContainerConstraintRec, * ExmContainerConstraintPtr; /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmContainerP_h */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Exm/Container.h�������������������������������������������������������0000644�0001750�0001750�00000005520�12672140200�016102� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: Container.h /main/4 1995/07/15 20:47:08 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /***************************************************************************** * * Container.h: The widget public header file. * ****************************************************************************/ /* Ensure that the file be included only once. */ #ifndef _ExmContainer_h #define _ExmContainer_h /* Include appropriate files. */ #include <Xm/Xm.h> /* widget public header file for XmManager */ /* Allow for C++ compilation. */ #ifdef __cplusplus extern "C" { #endif /* Define the widget class and widget record. */ externalref WidgetClass exmContainerWidgetClass; typedef struct _ExmContainerClassRec * ExmContainerWidgetClass; typedef struct _ExmContainerRec * ExmContainerWidget; /* Define an IsSubclass macro. */ #ifndef ExmIsContainer #define ExmIsContainer(w) XtIsSubclass(w, exmContainerWidgetClass) #endif /* Define string equivalents of new resource names. */ #define ExmNfirstColumnWidth "firstColumnWidth" #define ExmCFirstColumnWidth "FirstColumnWidth" #define ExmNdetailOrder "detailOrder" #define ExmCDetailOrder "DetailOrder" #define ExmNdetailOrderCount "detailOrderCount" #define ExmCDetailOrderCount "DetailOrderCount" #define ExmNdetailTabList "detailTabList" #define ExmCDetailTabList "DetailTabList" #define ExmNdetailHeader "detailHeader" #define ExmCDetailHeader "DetailHeader" #define ExmNdetailHeaderCount "detailHeaderCount" #define ExmCDetailHeaderCount "DetailHeaderCount" #define ExmNselectColor "selectColor" #define ExmCSelectColor "SelectColor" #define ExmNlayoutType "layoutType" #define ExmCLayoutType "LayoutType" /* Specify the API for this widget. */ extern Widget ExmCreateContainer(); /* Allow for C++ compilation. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif /* Ensure that the file be included only once. */ #endif /* _ExmContainer_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Exm/Container.c�������������������������������������������������������0000644�0001750�0001750�00000105232�13066310437�016107� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $TOG: Container.c /main/7 1997/05/02 10:09:20 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /********************************* WARNING ********************************** * * This widget is for educational purposes only. * Commercial applications should NOT instantiate this widget. * OSF makes no guarantees on the stability of this widget. * ********************************* WARNING *********************************/ /****************************************************************************** * * Container.c - ExmContainer widget. * ******************************************************************************/ /* Include appropriate files. */ #include <Xm/GadgetP.h> /* header file for gadget management functions */ #include <Xm/TraitP.h> /* header file for trait functions */ #include <Xm/ContainerT.h> /* container trait */ #include <Xm/ContItemT.h> /* container item trait */ #include <Xm/DrawingA.h> #include <Xm/IconH.h> #include <Xm/ScrollFrameT.h> #include <Xm/XmI.h> #include <Xm/XmTabListI.h> #include <Exm/ContainerP.h> /* This one should be somewhere common */ /* The Max macro returns the higher of two input arguments. */ #define Max(x, y) (((x) > (y)) ? (x) : (y)) extern Dimension XmTabListGetPosition(Screen *,XmTabList, Cardinal); /* Declare static functions. */ static void ButtonHandler(Widget wid, XtPointer data, XEvent * event, Boolean *cont); static void GetFirstColumnWidth( Widget wid, int offset, XtArgVal *value); static void GetDetailTabList( Widget wid, int offset, XtArgVal *value); static void SelectColorDefault( Widget widget, int offset, XrmValue *value ); static void ClassPartInitialize( WidgetClass widgetClass); static void Initialize( Widget rw, Widget nw, ArgList args, Cardinal *num_args); static void Destroy( Widget wid); static void Layout ( Widget wid, Widget instigator); static void CalcSize ( Widget wid, Widget instigator, Dimension *gridWidth, Dimension *gridHeight); static Boolean NeedRelayout ( Widget old_w, Widget new_w); static XmTabList GetDefaultTabList( ExmContainerWidget cw, Cardinal detail_order_count); static XmTabList GetDumbTabList( Dimension tab_size, Cardinal asked_num_tab); static void ContainerGetValues(Widget w, XmContainerData containerData); static Dimension GetDefaultFirstColumnWidth( ExmContainerWidget cw, Dimension fcw_init); static Cardinal GetDefaultDetailCount( ExmContainerWidget cw, Cardinal detail_count); /* No translations and no actions. */ static XtResource resources[] = { { ExmNfirstColumnWidth, ExmCFirstColumnWidth, XmRDimension, sizeof (Dimension), XtOffsetOf(ExmContainerRec, container.first_column_width), XmRImmediate, (XtPointer) 0 }, { ExmNdetailOrder, ExmCDetailOrder, XmRCardinalList, sizeof (Cardinal *), XtOffsetOf(ExmContainerRec, container.detail_order), XmRImmediate, (XtPointer) NULL }, { ExmNdetailOrderCount, ExmCDetailOrderCount, XmRCardinal, sizeof (Cardinal), XtOffsetOf(ExmContainerRec, container.detail_order_count), XmRImmediate, (XtPointer) 0 }, { ExmNdetailTabList, ExmCDetailTabList, XmRTabList, sizeof (XmTabList), XtOffsetOf(ExmContainerRec, container.detail_tablist), XmRImmediate, (XtPointer) NULL }, { ExmNdetailHeader, ExmCDetailHeader, XmRXmStringTable, sizeof (XmStringTable), XtOffsetOf(ExmContainerRec, container.detail_header), XmRImmediate, (XtPointer) NULL }, { ExmNdetailHeaderCount, ExmCDetailHeaderCount, XmRCardinal, sizeof (Cardinal), XtOffsetOf(ExmContainerRec, container.detail_header_count), XmRImmediate, (XtPointer) 0 }, { ExmNselectColor, ExmCSelectColor, XmRPixel, sizeof (Pixel), XtOffsetOf(ExmContainerRec, container.select_color), XmRImmediate, (XtPointer) SelectColorDefault }, { ExmNlayoutType, ExmCLayoutType, XmRLayoutType, sizeof (unsigned char), XtOffsetOf(ExmContainerRec, container.layout_type), XmRImmediate, (XtPointer) XmDETAIL }, }; static XmSyntheticResource syn_resources[] = { { ExmNfirstColumnWidth, sizeof (Dimension), XtOffsetOf( ExmContainerRec, container.first_column_width), GetFirstColumnWidth, NULL }, { ExmNdetailTabList, sizeof (XmTabList), XtOffsetOf( ExmContainerRec, container.detail_tablist), GetDetailTabList, NULL }, }; /* Define the widget class record. See Chapter 4 of the "OSF/Motif Widget Writer's Guide" for details. */ externaldef(exmcontainerclassrec) ExmContainerClassRec exmContainerClassRec = { { /* core_class */ /* superclass */ (WidgetClass) &exmGridClassRec, /* class_name */ "ExmContainer", /* widget_size */ sizeof(ExmContainerRec), /* class_initialize */ NULL, /* class_part_initialize */ ClassPartInitialize, /* class_inited */ FALSE, /* initialize */ Initialize, /* initialize_hook */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, /* resources */ resources, /* num_resources */ XtNumber(resources), /* xrm_class */ NULLQUARK, /* compress_motion */ TRUE, /* compress_exposure */ XtExposeCompressMaximal, /* compress_enterleave */ TRUE, /* visible_interest */ FALSE, /* destroy */ Destroy, /* resize */ XtInheritResize, /* expose */ XtInheritExpose, /* set_values */ NULL, /* set_values_hook */ NULL, /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* version */ XtVersion, /* callback_private */ NULL, /* tm_table */ XtInheritTranslations, /* query_geometry */ XtInheritQueryGeometry, /* display_accelerator */ NULL, /* extension */ NULL, }, { /* composite_class */ /* geometry_manager */ XtInheritGeometryManager, /* change_managed */ XtInheritChangeManaged, /* insert_child */ XtInheritInsertChild, /* delete_child */ XtInheritDeleteChild, /* extension */ NULL, }, { /* constraint_class */ /* constraint_resources */ NULL, /* constraint_num_resources */ 0, /* constraint_size */ sizeof(ExmGridConstraintRec), /* constraint_initialize */ NULL, /* constraint_destroy */ NULL, /* constraint_set_values */ NULL, /* extension */ NULL, }, { /* manager class */ /* translations */ XtInheritTranslations, /* syn_resources */ syn_resources, /* num_syn_resources */ XtNumber(syn_resources), /* syn_constraint_resources */ NULL, /* num_syn_constraint_resources */ 0, /* parent_process */ XmInheritParentProcess, /* extension */ NULL, }, { /* grid class */ /* layout */ Layout, /* calc_size */ CalcSize, /* need_relayout */ NeedRelayout, /* extension */ NULL, }, { /* container class */ /* extension */ NULL, } }; /* Establish the widget class name as an externally accessible symbol. Use the "externaldef" macro rather than the "extern" keyword. */ externaldef(exmcontainerwidgetclass) WidgetClass exmContainerWidgetClass = (WidgetClass) &exmContainerClassRec; /* Container Trait record for Grid */ static XmContainerTraitRec containerCT = { 0, /* version */ ContainerGetValues, }; /************************************************************************ * GetFirstColumnWidth ************************************************************************/ /*ARGSUSED*/ static void GetFirstColumnWidth( Widget wid, int offset, /* unused */ XtArgVal *value) { ExmContainerWidget cw = (ExmContainerWidget) wid ; Dimension fcw = cw->container.first_column_width ; if (!fcw) { /* get the max of icon_width + their indentation */ fcw = GetDefaultFirstColumnWidth(cw, 0); } *value = (XtArgVal)fcw; } /************************************************************************ * GetDetailTabList ************************************************************************/ /*ARGSUSED*/ static void GetDetailTabList( Widget wid, int offset, /* unused */ XtArgVal *value) { ExmContainerWidget cw = (ExmContainerWidget) wid ; XmTabList tab_list = cw->container.detail_tablist ; if (!tab_list) { /* get the default one */ Cardinal detail_order_count ; if (cw->container.detail_order_count != 0) { detail_order_count = cw->container.detail_order_count ; } else { detail_order_count = GetDefaultDetailCount(cw, 0) ; } tab_list = GetDefaultTabList(cw, detail_order_count); /* callers should not free this memory */ } *value = (XtArgVal)tab_list; } /**************************************************************************** * * SelectColorDefault. * ****************************************************************************/ static void SelectColorDefault( Widget widget, int offset, XrmValue *value ) { XmeGetDefaultPixel (widget, XmSELECT, offset, value); } /**************************************************************************** * * ClassPartInitialize: * Called when this widget or a subclass of this widget is instantiated. * ****************************************************************************/ static void ClassPartInitialize ( WidgetClass widgetClass ) { /* Install the XmQTcontainer trait on ExmContainer and all its subclasses. */ XmeTraitSet(widgetClass, XmQTcontainer, (XtPointer) &containerCT); } /************************************************************************ * Initialize ************************************************************************/ /*ARGSUSED*/ static void Initialize( Widget rw, Widget nw, ArgList args, /* unused */ Cardinal *num_args) /* unused */ { ExmContainerWidget cw = (ExmContainerWidget)nw; ExmContainerWidget rcw = (ExmContainerWidget)rw; Arg sargs[10] ; Cardinal n = 0, i ; Widget header_parent = nw ; unsigned char scrollp = XmAPPLICATION_DEFINED ; XmScrollFrameTrait scrollFrameTrait; cw->container.icon_header = NULL ; if (cw->container.detail_header && cw->container.detail_header_count) { /**** first make a copy of the detail header table */ cw->container.detail_header = (XmStringTable) XtMalloc(cw->container.detail_header_count * sizeof(XmString)); for (i=0; i<cw->container.detail_header_count; i++) cw->container.detail_header[i] = XmStringCopy(rcw->container.detail_header[i]); /**** deal with the IconHeader creation */ scrollFrameTrait = (XmScrollFrameTrait) XmeTraitGet((XtPointer) XtClass(XtParent(nw)), XmQTscrollFrame); /* check that the parent is a scrollframe already initialize, which also means an automatic scrolledwindow in Motif */ if (scrollFrameTrait && scrollFrameTrait -> getInfo (XtParent(nw), NULL, NULL, NULL)) { scrollp = XmAUTOMATIC ; /* use an intermediate DA so that we can have margins */ n = 0 ; XtSetArg(sargs[n], XmNmarginHeight, cw->grid.margin_height); n++ ; XtSetArg(sargs[n], XmNmarginWidth, cw->grid.margin_width); n++ ; XtSetArg(sargs[n], XmNscrolledWindowChildType, XmSCROLL_HOR); n++; XtSetArg(sargs[n], XmNbackground, nw->core.background_pixel); n++; XtSetArg(sargs[n], XmNbackgroundPixmap, nw->core.background_pixmap); n++; XtSetArg(sargs[n], XmNborderWidth, nw->core.border_width); n++; XtSetArg(sargs[n], XmNforeground, cw->manager.foreground); n++; header_parent = XmCreateDrawingArea(XtParent(nw), "HeaderDA", sargs, n); XtManageChild(header_parent); } n = 0 ; /* this is required */ XtSetArg(sargs[n], XmNcontainerID, nw); n++ ; /* this is optional */ XtSetArg(sargs[n], XmNshadowThickness, 0); n++ ; XtSetArg(sargs[n], XmNtraversalOn, False); n++ ; XtSetArg(sargs[n], XmNlabelString, cw->container.detail_header[0]); n++ ; if (cw->container.detail_header_count > 1) { XtSetArg(sargs[n], XmNdetail, &(cw->container.detail_header[1])); n++ ; } XtSetArg(sargs[n], XmNdetailCount, cw->container.detail_header_count - 1); n++ ; cw->container.icon_header = XmCreateIconHeader(header_parent, "Header", sargs, n); XtManageChild(cw->container.icon_header); /**** Now we have to position the Container properly in the scrolling window if there is one */ if (scrollp == XmAUTOMATIC) { cw->core.y = cw->container.icon_header->core.height ; /* also resize the DA to remove the bottom margin */ XmeConfigureObject(header_parent, header_parent->core.x, header_parent->core.y, cw->container.icon_header->core.width + 2*cw->grid.margin_height, cw->container.icon_header->core.height + cw->grid.margin_height, header_parent->core.border_width); } else { /* if not scrolling, no need to keep it, it will be dealt with as a regular kid */ cw->container.icon_header = NULL ; } } /**** copy the tablist */ if (cw->container.detail_tablist) { cw->container.detail_tablist = XmTabListCopy(cw->container.detail_tablist, 0, 0); } /* add an event handler to play with selection */ XtAddEventHandler(nw, ButtonPressMask, False, ButtonHandler, NULL); } static void ButtonHandler(Widget wid, XtPointer data, XEvent * event, Boolean *cont) { Widget item ; XmContainerItemDataRec cItemData; XmContainerItemTrait cItemTrait; item = XmObjectAtPoint(wid, event->xbutton.x, event->xbutton.y); if (item) { if ((cItemTrait = (XmContainerItemTrait) XmeTraitGet((XtPointer)XtClass(item), XmQTcontainerItem))) { cItemData.valueMask = ContItemVisualEmphasis; cItemTrait->getValues(item, &cItemData); if (cItemData.visual_emphasis == XmSELECTED) cItemData.visual_emphasis = XmNOT_SELECTED ; else cItemData.visual_emphasis = XmSELECTED ; cItemTrait->setValues(item, &cItemData); } } } /************************************************************************ * Destroy ************************************************************************/ static void Destroy( Widget wid) { ExmContainerWidget cw = (ExmContainerWidget)wid; Cardinal i ; if (cw->container.icon_header) { /* that will destroy the icon header child as well */ XtDestroyWidget(XtParent(cw->container.icon_header)); } if (cw->container.detail_header && cw->container.detail_header_count) { for (i=0; i<cw->container.detail_header_count; i++) XmStringFree(cw->container.detail_header[i]); XtFree((char*)cw->container.detail_header); } if (cw->container.detail_tablist) { XmTabListFree(cw->container.detail_tablist); } } /***************************************************************************** * * NeedRelayout: * need to tell if any of the resource values change should cause * a relayout. Must envelop the superclass method because it is * only called once by the superclass defining the method. * ****************************************************************************/ static Boolean NeedRelayout ( Widget old_w, Widget new_w ) { ExmContainerWidget cw = (ExmContainerWidget)old_w; ExmContainerWidget nw = (ExmContainerWidget)new_w; Boolean need_relayout ; /* envelop the superclass method */ need_relayout = ((* ((ExmGridClassRec *) exmContainerClassRec.core_class.superclass) ->grid_class.need_relayout) (old_w, new_w) || (nw->container.first_column_width != cw->container.first_column_width || nw->container.detail_order != cw->container.detail_order || nw->container.detail_order_count != cw->container.detail_order_count || nw->container.detail_tablist != cw->container.detail_tablist)); return (need_relayout); } /*************************************************************************** * * Layout: * Does all the placement of children. * Instigator tells whether or not to resize all children. * *************************************************************************/ static void Layout ( Widget wid, Widget instigator ) { ExmContainerWidget cw = (ExmContainerWidget) wid ; Cardinal i, num_managed = 0; int line_count ; Dimension width, height, baseline_first = 0, interspace_max = 0, pref_height, interspace; int height_under_prec = 0 ; Dimension * baselines ; Position x, y ; /**** a first pass to compute the interspace */ for (i = 0; i < cw->composite.num_children; i++) { Widget ic = cw->composite.children[i]; XtWidgetGeometry reply; if (!XtIsManaged(ic)) continue ; num_managed ++ ; /* ask for preferred height and baseline to the kid */ XmWidgetGetBaselines(ic, &baselines, &line_count); if (!line_count) continue ; /* store the first baseline and height under */ if (!baseline_first) { baseline_first = baselines[0]; /* negative so that it gives 0 below, so that it doesn't count in the max */ height_under_prec = -baseline_first ; } interspace = height_under_prec + baselines[0] ; interspace_max = Max(interspace_max, interspace); /* Get child's preferred height. */ XtQueryGeometry (ic, NULL, &reply); pref_height = (reply.request_mode & CWHeight) ? reply.height : ic->core.height; height_under_prec = pref_height - baselines[0] ; XtFree((char*) baselines); } /* now layout */ /**** a second pass to actually do the layout */ /* first deal with the icon header outside the container */ if (cw->container.icon_header && XtIsManaged(cw->container.icon_header)) { Widget header_parent ; XmeConfigureObject (cw->container.icon_header, cw->grid.margin_width, cw->grid.margin_height, cw->core.width - 2*cw->grid.margin_width, cw->container.icon_header->core.height, cw->container.icon_header->core.border_width); /* also reconfigure the parent DA */ header_parent = XtParent(cw->container.icon_header) ; XmeConfigureObject(header_parent, header_parent->core.x, header_parent->core.y, cw->core.width, cw->container.icon_header->core.height + cw->grid.margin_height, header_parent->core.border_width); } y = cw->grid.margin_height ; for (i = 0; i < cw->composite.num_children; i++) { Widget ic = cw->composite.children[i]; ExmGridConstraint glc = ExmGridCPart (ic); if (LayoutIsRtoLM(cw)) x = cw->grid.margin_width ; else x = cw->grid.margin_width + glc->grid_margin_width_within_cell ; width = cw->core.width - 2*cw->grid.margin_width - glc->grid_margin_width_within_cell; height = ic->core.height ; if (ic != instigator) { XtConfigureWidget (ic, x, y, width, height, ic->core.border_width); } else { ic->core.x = x; ic->core.y = y; ic->core.width = width; ic->core.height = height; } XmWidgetGetBaselines(ic, &baselines, &line_count); if (line_count) y += baselines[0] + interspace_max ; if (i != cw->composite.num_children - 1) { XmWidgetGetBaselines(cw->composite.children[i+1], &baselines, &line_count); if (line_count) y -= baselines[0] ; } } } /**************************************************************************** * * CalcSize: * Calculate the ideal size of the ExmGrid widget. * Only affect the returned size if it is 0 * ***************************************************************************/ static void CalcSize ( Widget wid, Widget instigator, Dimension *width_ret, Dimension *height_ret) { /* The Width of the Container is the sum of the first_column_width and the detail width. If the first_column_width is not set, we must compute it as the max of all the icon_width at their position (we set the fcw temporarily so that it is not recomputed when the detailwidth are calculated. The detail width is the position of the last tab if there is one for the last detail_order, otherwise it's the max width of all icon detail width. The Height of the container is n-1 time the max of height_under baseline of i-1 + baseline of i , + baseline 0 + h_under n-1 */ ExmContainerWidget cw = (ExmContainerWidget) wid ; Boolean fcw_set = False ; Cardinal i, num_managed = 0 ; int line_count ; Dimension height, baseline_first = 0, interspace_max = 0, pref_height, pref_width, interspace, detail_width; int height_under_prec = 0 ; Dimension * baselines ; Cardinal tab_count = 0 ; /**** first get the first column width */ if (!cw->container.first_column_width) { cw->container.first_column_width = GetDefaultFirstColumnWidth(cw, 0); /* we don't want to keep this calculated first_column_width in cw, so set a flag to reset it to 0 at the end */ fcw_set = True ; } /**** now get the details part */ if (cw->container.layout_type != XmDETAIL) detail_width = 0 ; else { if (cw->container.detail_tablist) tab_count = XmTabListTabCount(cw->container.detail_tablist) ; if (cw->container.detail_order_count && tab_count >= cw->container.detail_order_count) { detail_width = XmTabListGetPosition(XtScreen((Widget)cw), cw->container.detail_tablist, tab_count-1); } else { XtWidgetGeometry reply; /* get the max width of all details */ if (cw->container.icon_header && XtIsManaged(cw->container.icon_header)) { Dimension header_width ; /* start with header's preferred width. */ XtQueryGeometry (cw->container.icon_header, NULL, &reply); header_width = (reply.request_mode & CWWidth) ? reply.width : cw->container.icon_header->core.width; detail_width = header_width - /* remove the horiz indent */ (cw->container.first_column_width - cw->container.icon_header->core.x); } else detail_width = 0 ; for (i = 0; i < cw->composite.num_children; i++) { Widget ic = cw->composite.children[i]; /* Get child's preferred width. */ if (ic != instigator) { XtQueryGeometry (ic, NULL, &reply); pref_width = (reply.request_mode & CWWidth) ? reply.width : ic->core.width; } else { pref_width = ic->core.width ; } detail_width = Max(detail_width, pref_width - /* remove the horiz indent */ (cw->container.first_column_width - ic->core.x)); } } } /**** compute the ideal height */ for (i = 0; i < cw->composite.num_children; i++) { Widget ic = cw->composite.children[i]; XtWidgetGeometry reply; if (!XtIsManaged(ic)) continue ; num_managed ++ ; /* ask for preferred height and baseline to the kid */ XmWidgetGetBaselines(ic, &baselines, &line_count); if (!line_count) continue ; /* store the first baseline and height under */ if (!baseline_first) { baseline_first = baselines[0]; /* negative so that it gives 0 below, so that it doesn't count in the max */ height_under_prec = -baseline_first ; } interspace = height_under_prec + baselines[0] ; interspace_max = Max(interspace_max, interspace); /* Get child's preferred height. */ XtQueryGeometry (ic, NULL, &reply); pref_height = (reply.request_mode & CWHeight) ? reply.height : ic->core.height; height_under_prec = pref_height - baselines[0] ; XtFree((char*) baselines); } /* now sum up everything */ height = baseline_first + interspace_max * (num_managed-1) + height_under_prec ; /*** do not set non null dimensions */ if (*width_ret == 0) *width_ret = cw->container.first_column_width + detail_width + cw->grid.margin_width ; if (*height_ret == 0) *height_ret = height + 2*cw->grid.margin_height; /*** set it back to 0, a getvalueshook will provide the real information */ if (fcw_set) cw->container.first_column_width = 0 ; } /************************************************************************ * GetDefaultFirstColumnWidth ************************************************************************/ /*ARGSUSED*/ static Dimension GetDefaultFirstColumnWidth( ExmContainerWidget cw, Dimension first_column_width) { Dimension width ; Cardinal i ; XmContainerItemDataRec cont_item_data ; XmContainerItemTrait cont_item_trait ; /* Get the max icon width + indent of all managed kids */ /* deal with icon_header outside container first */ if (cw->container.icon_header && XtIsManaged(cw->container.icon_header)) { /* start with header's icon width. */ cont_item_trait = (XmContainerItemTrait) XmeTraitGet((XtPointer) XtClass(cw->container.icon_header), XmQTcontainerItem) ; cont_item_data.valueMask = ContItemIconWidth ; cont_item_trait->getValues(cw->container.icon_header, &cont_item_data); first_column_width = Max(first_column_width, cw->grid.margin_width + cont_item_data.icon_width) ; } for (i = 0; i < cw->composite.num_children; i++) { Widget ic = cw->composite.children[i]; ExmGridConstraint glc = ExmGridCPart (ic); if (!XtIsManaged(ic)) continue ; /* if the child has the ContItem trait, use its icon_width, othersize, use it's width */ cont_item_trait = (XmContainerItemTrait) XmeTraitGet((XtPointer) XtClass(ic), XmQTcontainerItem) ; if (cont_item_trait) { cont_item_data.valueMask = ContItemIconWidth ; cont_item_trait->getValues(ic, &cont_item_data); width = cont_item_data.icon_width ; } else { width = ic->core.width ; } /* the inner cell margin width plays the outline indentation role in this example widget */ first_column_width = Max (first_column_width, cw->grid.margin_width + width + glc->grid_margin_width_within_cell); } return first_column_width ; } /************************************************************************ * GetDefaultDetailCount ************************************************************************/ /*ARGSUSED*/ static Cardinal GetDefaultDetailCount( ExmContainerWidget cw, Cardinal detail_count) { Cardinal i ; XmContainerItemDataRec cont_item_data ; XmContainerItemTrait cont_item_trait ; /* Get the max detail_count of all managed kids */ /* deal with icon_header outside container first */ if (cw->container.icon_header && XtIsManaged(cw->container.icon_header)) { /* start with header's detail_count */ cont_item_trait = (XmContainerItemTrait) XmeTraitGet((XtPointer) XtClass(cw->container.icon_header), XmQTcontainerItem) ; /* icon headert always has the trait */ cont_item_data.valueMask = ContItemDetailCount ; cont_item_trait->getValues(cw->container.icon_header, &cont_item_data); detail_count = Max(detail_count, cont_item_data.detail_count) ; } for (i = 0; i < cw->composite.num_children; i++) { Widget ic = cw->composite.children[i]; if (!XtIsManaged(ic)) continue ; /* if the child has the ContItem trait, use its detail_count */ cont_item_trait = (XmContainerItemTrait) XmeTraitGet((XtPointer) XtClass(ic), XmQTcontainerItem) ; if (cont_item_trait) { cont_item_data.valueMask = ContItemDetailCount ; cont_item_trait->getValues(ic, &cont_item_data); detail_count = Max (detail_count, cont_item_data.detail_count); } } return detail_count ; } /**************************************************************************** * * GetDefaultTabList * (XmNwidth-2*XmNmarginWidth-XmNfirstColumnWidth)/XmNdetailOrderCount * ***************************************************************************/ static XmTabList GetDefaultTabList( ExmContainerWidget cw, Cardinal detail_order_count) { XmTabList default_tablist = NULL ; /* if the Container has a valid size, a default tablist of size detail_order_count shall be returned in detail_tablist. The tabs in this tablist shall be equal to: (XmNwidth-2*XmNmarginWidth-XmNfirstColumnWidth) /XmNdetailOrderCount If XmNwidth is not yet valid, a NULL detail_tablist is returned, so that the icon can concat all its details and get a reasonable size. */ if (cw->core.width) { Dimension tab_size = 0 ; if ((cw->core.width > (2*cw->grid.margin_width + cw->container.first_column_width)) && detail_order_count) { tab_size = (cw->core.width - 2*cw->grid.margin_width - cw->container.first_column_width) / detail_order_count ; default_tablist = GetDumbTabList(tab_size, detail_order_count); } /* else return NULL as well */ } return default_tablist ; } /**************************************************************************** * * GetDumbTabList * fixed space - lazy allocation .do not deallocate the returned value * ***************************************************************************/ static XmTabList GetDumbTabList( Dimension tab_size, Cardinal asked_num_tab) { static int Num_tab = 0 ; static XmTab * Tab_pool = NULL ; static XmTabList Tab_list = NULL ; Cardinal i, prev_num_tab = Num_tab ; if (Num_tab < asked_num_tab) { Num_tab = asked_num_tab ; Tab_pool = (XmTab*) XtRealloc((char*)Tab_pool, Num_tab*sizeof(XmTab)); } /* create more tabs */ for (i=prev_num_tab; i<Num_tab; i++) Tab_pool[i] = XmTabCreate(0.0, XmPIXELS, XmABSOLUTE, XmALIGNMENT_BEGINNING, XmS); /* update the values */ for (i=0; i<asked_num_tab; i++) XmTabSetValue(Tab_pool[i], (float)tab_size*(i+1)); /* free the previous tablist and return a new one. Not clear what is going to happen to the Tab_pool array, is it going to be copied or ref counted, but I won't free them... */ if (Tab_list) XmTabListFree(Tab_list); Tab_list = XmTabListInsertTabs(NULL, Tab_pool, asked_num_tab, 0); return Tab_list ; } /*-- Trait methods --*/ /************************************************************************ * ContainerGetValues * ************************************************************************/ static void ContainerGetValues(Widget w, XmContainerData containerData) { ExmContainerWidget cw = (ExmContainerWidget) w ; Boolean fcw_set = False ; /**** fill in detail_order */ if (cw->container.layout_type == XmDETAIL) { if (cw->container.detail_order_count != 0) { containerData->detail_order_count = cw->container.detail_order_count ; containerData->detail_order = cw->container.detail_order ; } else { /* take the max detail count and return NULL for the detail_order, so that the icon takes a default order */ if (containerData->valueMask & ContDetailOrder) { containerData->detail_order_count = GetDefaultDetailCount(cw, 0); containerData->detail_order = NULL ; } } } else { containerData->detail_order_count = 0 ; containerData->detail_order = NULL ; } /**** if the resource firstColumnWidth is set, use it, otherwise, default it */ if (cw->container.layout_type == XmDETAIL) { if (cw->container.first_column_width) containerData->first_column_width = cw->container.first_column_width ; else /* don't bother computing it if not asked */ if (containerData->valueMask & ContFirstColumnWidth) { /* set the container resource temporarily */ cw->container.first_column_width = containerData->first_column_width = GetDefaultFirstColumnWidth(cw, containerData->first_column_width) ; fcw_set = True ; } } else if (cw->container.layout_type == XmSPATIAL) containerData->first_column_width = 0; /**** if detail_tablist has been set, use it, else compute a default */ if (cw->container.detail_tablist) containerData->detail_tablist = cw->container.detail_tablist ; else /* go find a default only if needed */ if (containerData->valueMask & ContDetailTabList) { containerData->detail_tablist = GetDefaultTabList(cw, containerData->detail_order_count); } /**** get a value for this one - kinda random, just to test */ if (cw->manager.navigation_type == XmTAB_GROUP) containerData->selection_mode = XmNORMAL_MODE ; else containerData->selection_mode = XmADD_MODE ; /**** just to try out the trait protocol */ if (cw->container.select_color == WhitePixelOfScreen(XtScreen(w))) containerData->valueMask &= ~ContSelectColor ; else containerData->select_color = cw->container.select_color ; /*** set first_column_width back to 0, a getvalueshook will provided the real information */ if (fcw_set) cw->container.first_column_width = 0 ; } /***************************************************************************** * * ExmCreateContainer: * Called by an application. * ****************************************************************************/ Widget ExmCreateContainer ( Widget parent, char *name, ArgList arglist, Cardinal argcount ) { /* This is a convenience function to instantiate an ExmContainer widget. */ return (XtCreateWidget (name, exmContainerWidgetClass, parent, arglist, argcount)); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/unsupported/Exm/Makefile.am�������������������������������������������������������0000644�0001750�0001750�00000000405�13145162623�016051� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MAINTAINERCLEANFILES = Makefile.in noinst_LIBRARIES = libExm.a libExm_a_SOURCES = Container.c noinst_HEADERS = Container.h ContainerP.h EXTRA_DIST = INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/.. -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/�������������������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�012575� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�13211513007�013542� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/example.todo��������������������������������������������������������0000644�0001750�0001750�00000000446�12672140200�016011� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*PHome Stuff *THome *C42 *L0 .Walk the dog . .Feed the cat . .Clean the sink . *PWork stuff *TWork *C46 *L0 .Read reports . .Read the funnies . .Work a little *PFun Stuff *TFun *C0 *L0 .Go to the beach . .Play with kids . .Play video games . .Go bowling *PDay is over *TNight *C0 *L0 .Sleep . ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/XmdTodo.ad����������������������������������������������������������0000644�0001750�0001750�00000004254�12672140200�015354� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������! $XConsortium: XmdTodo.ad /main/4 1995/07/17 18:53:45 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! Sample application defaults file ! ! Optionally place this file in your system's app-defaults directory, ! often found in /usr/lib/X11/app-defaults ! ! Size of the text display area *text.rows: 24 *text.columns: 80 ! Which printers to list by default. Files can be added by using ! pathnames, all are separated by commas *print_manager.printerList: lp,./todo.txt ! Help file name *help_manager.helpFile: todo ! Notebook resources *notebook.frameShadowThickness: 2 *notebook.bindingType: XmSPIRAL ! Tab resources, all tabs are named atab *atab.renderTable: *helvetica-bold-r-normal-*-12-* ! Color resources ! On HP and CDE systems, the following line will turn off the color ! object ! *useColorObj: false ! Here are some suggested schemes for coloring ! Gray color scheme ! *background: gray50 ! *foreground: white ! *text*foreground: black ! *text*background: gray95 ! *notebook*foreground: black ! *notebook*background: gray85 ! *notebook*frameBackground: gray80 ! *atab.highlightColor: white ! Blue color scheme ! *background: RoyalBlue ! *foreground: white ! *text*foreground: black ! *text*background: lightblue ! *notebook*foreground: white ! *notebook*background: SlateBlue ! *notebook*frameBackground: SlateBlue ! *atab.highlightColor: violetred1 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/Makefile.in���������������������������������������������������������0000644�0001750�0001750�00000055323�13211512766�015552� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = todo$(EXEEXT) subdir = demos/programs/todo ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_todo_OBJECTS = todo.$(OBJEXT) io.$(OBJEXT) actions.$(OBJEXT) todo_OBJECTS = $(am_todo_OBJECTS) todo_LDADD = $(LDADD) todo_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(todo_SOURCES) DIST_SOURCES = $(todo_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/todo build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/todo datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README XmdTodo.ad example.todo todo.man todo.help todo_SOURCES = todo.c io.c actions.c page.h data_DATA = $(EXTRA_DIST) $(todo_SOURCES) INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/todo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/todo/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list todo$(EXEEXT): $(todo_OBJECTS) $(todo_DEPENDENCIES) $(EXTRA_todo_DEPENDENCIES) @rm -f todo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(todo_OBJECTS) $(todo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/actions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/todo.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/io.c����������������������������������������������������������������0000644�0001750�0001750�00000020471�12672140200�014242� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char *rcsid = "$XConsortium: io.c /main/6 1995/07/14 09:46:23 drk $"; #endif #endif #include <stdlib.h> #include <unistd.h> #include <Xm/Xm.h> #include <Xm/MessageB.h> #include <Xm/Notebook.h> #include <Xm/Text.h> #include <Exm/TabB.h> #include <stdio.h> #include "page.h" Widget ioerror = (Widget) NULL; extern Widget notebook, textw, shell; Page pages[MAXPAGES]; extern int currentPage; extern int modified; int maxpages; Page AllocPage(); /* Pages are stored pretty simply: * each page starts with "*PLabel" * the next line has "*TLabel" if there is a major tab * or with *MLabel for a minor tab * *Cnnnn has the cursor position * *Lnnnn has the top line position * the page's text continues to the next page start. * regular lines start with . */ void ParseNewLines(label) char * label ; { /* look for "\n" and change in '\n' and compact */ char * s ; while (*label) { if ((*label == '\\') && (*(label+1) == 'n')) { *label = '\n' ; s = label+1 ; while (*s) { *s = *(s+1) ; s++ ; } } label ++ ; } } static void PrintWithNewLines(output, label) FILE *output ; char * label ; { /* look for '\n' and print "\n" */ while (*label) { if (*label == '\n') { fprintf(output,"\\n"); } else fprintf(output,"%c", *label); label ++ ; } fprintf(output,"\n"); label ++ ; } void ReadDB(char* filename) { FILE *input; int i, number, first = 1; char *buffer; int max, current; char line[1024]; Arg args[5]; Widget tab; input = fopen(filename, "r"); if (ioerror == (Widget) NULL) { ioerror = XmCreateInformationDialog(shell, "IO_Error_Dialog", NULL, 0); } if (input == NULL && strncmp(filename,"untitled",8) != 0) { XmString str; char buf[256]; sprintf(buf, "Can't access (%s) for reading", filename); str = XmStringCreateLocalized(buf); XtVaSetValues(ioerror, XmNmessageString, str, NULL, NULL); XtManageChild(ioerror); } /* Destroy current pages on reread */ for(i = 0; i < maxpages; i++) { XtFree(pages[i] -> page); XtFree(pages[i] -> majorTab); XtFree(pages[i] -> minorTab); XtFree(pages[i] -> label); if (pages[i] -> majorPB) XtDestroyWidget(pages[i] -> majorPB); if (pages[i] -> minorPB) XtDestroyWidget(pages[i] -> minorPB); } number = 0; if (input != NULL) { max = MAXINIT; buffer = (char*) XtMalloc(max); buffer[0] = 0; /* Reset page buffer */ current = 0; pages[0] = AllocPage(); while(fgets(line, 1024, input) != NULL) { if (line[0] == '*') /* Special */ { if (line[1] == 'P') /* New Page */ { if (first == 1) { first = 0; } else { pages[number] -> page = buffer; current = 0; max = MAXINIT; buffer = (char*) XtMalloc(max); buffer[0] = 0; /* Reset page buffer */ number++; pages[number] = AllocPage(); } if (strlen(line) > 3) { line[strlen(line) - 1] = 0; /* Remove newline */ pages[number] -> label = XtNewString(&line[2]); } } else if (line[1] == 'T') /* Tab */ { XmString name; line[strlen(line) - 1] = 0; /* Remove newline */ if (strlen(line) > 3) { pages[number] -> majorTab = XtNewString(&line[2]); i = 0; ParseNewLines(pages[number] -> majorTab); name = XmStringGenerate(pages[number] -> majorTab, NULL, XmCHARSET_TEXT, NULL); XtSetArg(args[i], XmNnotebookChildType, XmMAJOR_TAB); i++; XtSetArg(args[i], XmNpageNumber, (number + 1)); i++; XtSetArg(args[i], ExmNcompoundString, name); i++; XtSetArg(args[i], XmNshadowThickness, 1); i++; tab = ExmCreateTabButton(notebook, "atab", args, i); XtManageChild(tab); pages[number] -> majorPB = tab; XmStringFree(name); } } else if (line[1] == 'M') /* Minor Tab */ { XmString name; line[strlen(line) - 1] = 0; /* Remove newline */ if (strlen(line) > 3) { pages[number] -> minorTab = XtNewString(&line[2]); i = 0; ParseNewLines(pages[number] -> minorTab); name = XmStringGenerate(pages[number] -> minorTab, NULL, XmCHARSET_TEXT, NULL); XtSetArg(args[i], XmNnotebookChildType, XmMINOR_TAB); i++; XtSetArg(args[i], XmNpageNumber, (number + 1)); i++; XtSetArg(args[i], ExmNcompoundString, name); i++; XtSetArg(args[i], XmNshadowThickness, 1); i++; tab = ExmCreateTabButton(notebook, "atab", args, i); pages[number] -> minorPB = tab; XtManageChild(tab); XmStringFree(name); } } else if (line[1] == 'C') /* Cursor position */ { pages[number] -> lastcursorpos = strtol(&line[2], NULL, 0); } else if (line[1] == 'L') /* Top line position */ { pages[number] -> lasttoppos = strtol(&line[2], NULL, 0); } } else /* Regular line. "Remove" . and append */ { current += strlen(&line[1]); if ((current - 2) > max) { max = 2 * max; buffer=(char*) XtRealloc(buffer, max); } strcat(buffer, &line[1]); } } } /* If we didn't have a file to read, we need to setup a page */ if (input == NULL) { number = 0; pages[0] = AllocPage(); pages[0] -> page = XtMalloc(2); pages[0] -> page[0] = 0; } else { pages[number] -> page = buffer; } maxpages = number; i = 0; XtSetArg(args[i], XmNlastPageNumber, maxpages + 1); i++; XtSetArg(args[i], XmNcurrentPageNumber, 1); i++; XtSetValues(notebook, args, i); if (input) fclose(input); } void SaveDB(char* filename) { int number; FILE *output; int i; char oldfilename[256]; if (ioerror == (Widget) NULL) { ioerror = XmCreateInformationDialog(shell, "IO_Error_Dialog", NULL, 0); } if (access(filename, F_OK) == 0 && access(filename, W_OK) != 0) { XmString str; char buf[256]; sprintf(buf, "Can't access (%s) for writing", filename); str = XmStringCreateLocalized(buf); XtVaSetValues(ioerror, XmNmessageString, str, NULL, NULL); XtManageChild(ioerror); return; } /* Append a ~ to make the old filename */ if (access(filename, F_OK) == 0) { strcpy(oldfilename, filename); strcat(oldfilename, "~"); rename(filename, oldfilename); } /* Make sure to grab current page */ if (modified) { if (pages[currentPage] -> page != NULL) XtFree(pages[currentPage] -> page); pages[currentPage] -> page = XmTextGetString(textw); } output = fopen(filename, "w"); for(number = 0; number <= maxpages; number++) { if (pages[number] -> label != NULL) fprintf(output, "*P%s\n", pages[number] -> label); else fprintf(output, "*P\n"); if (pages[number] -> majorTab != NULL) { fprintf(output, "*T"); PrintWithNewLines(output, pages[number] -> majorTab); } if (pages[number] -> minorTab != NULL) { fprintf(output, "*M"); PrintWithNewLines(output, pages[number] -> minorTab); } fprintf(output, "*C%d\n", pages[number] -> lastcursorpos); fprintf(output, "*L%d\n", pages[number] -> lasttoppos); fputc('.', output); if (pages[number] -> page != NULL) { for(i = 0; pages[number] -> page[i] != 0; i++) { fputc(pages[number] -> page[i], output); if (pages[number] -> page[i] == '\n') fputc('.', output); } } fputc('\n', output); } fclose(output); } Page AllocPage() { Page p; p = (Page) XtMalloc(sizeof(PageRec)); p -> page = NULL; p -> label = NULL; p -> minorTab = NULL; p -> majorTab = NULL; p -> minorPB = (Widget) 0; p -> majorPB = (Widget) 0; p -> lasttoppos = 0; p -> lastcursorpos = 0; return(p); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/todo.man������������������������������������������������������������0000644�0001750�0001750�00000005007�12672140200�015127� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" $XConsortium: todo.man /main/4 1995/07/17 10:49:07 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH todo 1X MOTIF "Demonstration programs" .SH NAME \*Ltodo\*O \(em Manage todo lists .SH SYNOPSIS .sS \*Ltodo [-todoFile pathname] \*O .sE .SH DESCRIPTION \*LTodo\*O is a simple todo list manager. It provides a demonstration of the XmNotebook widget. To use \*Ltodo\*O, you should be able to simply run it from any directory. By default it reads its database from your home directory, but this can be overriden by \fIpathname\fR. .SH Files .nf .ta 1.2i $HOME/.todo The user's todo list .fi .SH X Defaults The class of this application is \fIXmDTodo\fR. The name of the widgets of particular interest are: .nf .ta 1.2i notebook The XmNotebook widget text The XmText widget label The status area XmLabel widget .fi To set a specific resource in your \fI.Xdefaults\fR file, you specify the particular widget and resource. For example, if we wished to assign specific colors to the text widget's and notebook widget's background, we could do the following: .nf .ta 3i XmDTodo*notebook.background: forestgreen XmDTodo*text.background: white .fi Additionally there is an application resource to set the default todo file location: .nf .ta 3i XmDTodo*todoFile: /users/myhomedir/sometodofile .fi .SH BUGS Todo can occationally get confused when pages are deleted. Save the current contents and reopen to resync the application in this case. New pages are always prepended before the current page, there should be a way to choose. Ideally the display should use an XmCSText with rich text and not plain ascii, but that went beyond the scope of the demonstration. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/README��������������������������������������������������������������0000644�0001750�0001750�00000001014�12672140200�014337� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* $XConsortium: README /main/3 1996/07/15 14:09:23 drk $ */ ToDo ---- ToDo is a simple list organizer. It uses an XmNotebook widget with tabs to help organize your lists of tasks. It has no fancy features and by default stores its database in the single file .todo in your home directory. You can use the example.todo file in this directory to see some of the features. Just type "./todo -todoFile example.todo" to start this way. Regards, Douglas Rand ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/page.h��������������������������������������������������������������0000644�0001750�0001750�00000002574�12672140200�014560� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char *rcsidpageH = "$XConsortium: page.h /main/5 1995/07/14 09:46:34 drk $"; #endif #endif #ifndef Page_H #define Page_H #define MAXPAGES 100 #define MAXINIT 512 typedef struct { char *page; char *majorTab; char *minorTab; char *label; Widget minorPB; Widget majorPB; int lasttoppos; int lastcursorpos; } PageRec, *Page; /* Options */ typedef struct { String todoFile; } OptionsRec; extern OptionsRec options; #endif /* Page_H */ ������������������������������������������������������������������������������������������������������������������������������������motif-2.3.8/demos/programs/todo/todo.c��������������������������������������������������������������0000644�0001750�0001750�00000023717�12672140200�014606� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char *rcsid = "$XConsortium: todo.c /main/6 1995/07/14 09:46:43 drk $"; #endif #endif #include <pwd.h> #include <unistd.h> #include <stdlib.h> /* X include files */ #include <X11/Intrinsic.h> #include <X11/StringDefs.h> #include <X11/Xatom.h> /* Motif include files */ #include <Xm/Xm.h> #include <Xm/CascadeBG.h> #include <Xm/FileSB.h> #include <Xm/Label.h> #include <Xm/MainW.h> #include <Xm/Notebook.h> #include <Xm/PushBG.h> #include <Xm/RowColumn.h> #include <Xm/ScrolledW.h> #include <Xm/Separator.h> #include <Xm/Text.h> /* Demo include files */ #include <Xmd/Help.h> #include <Xmd/Menus.h> #include <Xmd/Print.h> #include "page.h" #define APP_CLASS "XmdTodo" #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define MIN(x,y) ((x) > (y) ? (y) : (x)) char * fallback_resources[] = { "*text.rows: 24", "*text.columns: 80", "*print_manager.printerList: lp,./todo.txt", "*help_manager.helpFile: todo", "*notebook.frameShadowThickness: 2", "*notebook.bindingType: XmSPIRAL", NULL }; /* Options */ OptionsRec options; #define Offset(field) XtOffsetOf(OptionsRec, field) XtResource resources[] = { {"todoFile", "TodoFile", XtRString, sizeof(String), Offset(todoFile), XtRImmediate, NULL} }; #undef Offset XrmOptionDescRec optionDesc[] = { {"-todoFile", "*todoFile", XrmoptionSepArg, (XtPointer) NULL} }; static void QuitAppl(Widget, char *, XmPushButtonCallbackStruct *); static void TextChanged(Widget, XtPointer, XtPointer); void manageCB(Widget, Widget, XtPointer); void PresentFDialog(Widget, XtPointer, XmPushButtonCallbackStruct*); void New(Widget, char*, XmPushButtonCallbackStruct *); void Save(Widget, char*, XmFileSelectionBoxCallbackStruct *); void Open(Widget, char*, XmFileSelectionBoxCallbackStruct *); void Print(Widget, char*, XmdPrintCallbackStruct *); void SaveIt(Widget, char*, XmPushButtonCallbackStruct *); void PageChange(Widget, XtPointer, XmNotebookCallbackStruct *); void NewPage(Widget, XtPointer, XmPushButtonCallbackStruct *); void DeletePage(Widget, XtPointer, XmPushButtonCallbackStruct *); void EditPage(Widget, XtPointer, XmPushButtonCallbackStruct *); void SetPage(int); void help_cb(Widget, XtPointer, XmAnyCallbackStruct *); extern void ReadDB(char*); extern void SaveDB(char*); extern Page pages[]; Widget shell, notebook, textw, labelw; Widget help_widget, file_dialog; int currentPage = 1; int modified; extern int maxpages; struct passwd *user; int main(int argc, char* argv[]) { Widget mainw, menubar; Widget *file_menu, *edit_menu, *selected_menu, *help_menu, temp; Widget print_widget; Cardinal size; XtAppContext context; Arg args[10]; int n, i; XmString tmp; char temppath[256]; if (argc == 2 && strcmp(argv[1], "-help") == 0) { printf("Usage: todo [-todoFile pathname]\n"); return(0); } shell = XtVaAppInitialize(&context, APP_CLASS, optionDesc, XtNumber(optionDesc), &argc, argv, fallback_resources, NULL); XtGetApplicationResources(shell, (XtPointer) &options, resources, XtNumber(resources), (Arg *) NULL, 0); mainw = XmCreateMainWindow(shell, "mainw", NULL, 0); XtManageChild(mainw); menubar = XmCreateMenuBar(mainw, "menub", NULL, 0); XtManageChild(menubar); n = 0; XtSetArg(args[n], XmNcurrentPageNumber, 1); n++; XtSetArg(args[n], XmNlastPageNumber, 100); n++; notebook = XmCreateNotebook(mainw, "notebook", args, n); XtManageChild(notebook); XtAddCallback(notebook, XmNpageChangedCallback, (XtCallbackProc) PageChange, NULL); n = 0; XtSetArg(args[n], XmNmenuBar, menubar); n++; XtSetValues(mainw, args, n); n = 0; XtSetArg(args[n], XmNpageNumber, 1); n++; XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++; textw = XmCreateScrolledText(notebook, "text", args, n); XtManageChild(textw); XtAddCallback(textw, XmNvalueChangedCallback, TextChanged, NULL); n = 0; XtSetArg(args[n], XmNnotebookChildType, XmSTATUS_AREA); n++; XtSetArg(args[n], XmNpageNumber, 1); n++; labelw = XmCreateLabel(notebook, "label", args, n); XtManageChild(labelw); XmdCreateMenu(FILE_MENU, menubar, &file_menu, &size); XtAddCallback(file_menu[FILE_NEW], XmNactivateCallback, (XtCallbackProc) New, NULL); XtAddCallback(file_menu[FILE_OPEN], XmNactivateCallback, (XtCallbackProc) PresentFDialog, (XtPointer) Open); XtAddCallback(file_menu[FILE_EXIT], XmNactivateCallback, (XtCallbackProc) QuitAppl, NULL); XtAddCallback(file_menu[FILE_SAVE_AS], XmNactivateCallback, (XtCallbackProc) PresentFDialog, (XtPointer) Save); XtAddCallback(file_menu[FILE_SAVE], XmNactivateCallback, (XtCallbackProc) SaveIt, NULL); XmdCreateMenu(SELECTED_MENU, menubar, &selected_menu, &size); XtUnmanageChildren(selected_menu, size); XtManageChild(selected_menu[SELECTED_PROPERTIES]); XtAddCallback(selected_menu[SELECTED_PROPERTIES], XmNactivateCallback, (XtCallbackProc) EditPage, NULL); XtManageChild(selected_menu[SELECTED_NEW]); XtAddCallback(selected_menu[SELECTED_NEW], XmNactivateCallback, (XtCallbackProc) NewPage, NULL); XtManageChild(selected_menu[SELECTED_DELETE]); XtAddCallback(selected_menu[SELECTED_DELETE], XmNactivateCallback, (XtCallbackProc) DeletePage, NULL); XmdCreateMenu(HELP_MENU, menubar, &help_menu, &size); XtUnmanageChildren(help_menu, size); XtManageChild(help_menu[HELP_OVERVIEW]); print_widget = XmdCreatePrintDialog(shell, "print_manager", NULL, 0); XtAddCallback(print_widget, XmdNprintCallback, (XtCallbackProc) Print, NULL); tmp = XmStringCreateLocalized("About Printing"); XtAddCallback(file_menu[FILE_PRINT], XmNactivateCallback, (XtCallbackProc) manageCB, (XtPointer) print_widget); help_widget = XmdCreateHelpDialog(shell, "help_manager", NULL, 0); XtAddCallback(help_menu[HELP_OVERVIEW], XmNactivateCallback, (XtCallbackProc) help_cb, (XtPointer) 0); XtAddCallback(print_widget, XmNhelpCallback, (XtCallbackProc) help_cb, (XtPointer) 1); n = 0; XtSetArg(args[n], XmNautoUnmanage, True); n++; file_dialog = XmCreateFileSelectionDialog(shell, "file_dialog", args, n); user = getpwuid(getuid()); for (i = 0; i < MAXPAGES; i++) { pages[i] = NULL; } if (options.todoFile == NULL) { strcpy(temppath, user -> pw_dir); strcat(temppath, "/.todo"); options.todoFile = XtNewString(temppath); } else { /* Copy the string for consistency */ options.todoFile = XtNewString(options.todoFile); } XtVaSetValues(shell, XmNtitle, options.todoFile, XmNtitleEncoding, XA_STRING, NULL, NULL); ReadDB(options.todoFile); SetPage(0); XtRealizeWidget(shell); XtAppMainLoop(context); return 0; /* make compiler happy */ } static void QuitAppl(Widget w, char *i, XmPushButtonCallbackStruct *e) { exit(0); } static void TextChanged(Widget w, XtPointer i, XtPointer i2) { modified = 1; } void manageCB( widget, w_to_manage, callback_data) Widget widget; Widget w_to_manage; XtPointer callback_data; { if (w_to_manage != (Widget) NULL) XtManageChild(w_to_manage); } void PresentFDialog(Widget w, XtPointer cb, XmPushButtonCallbackStruct *cs) { XtRemoveAllCallbacks(file_dialog, XmNokCallback); XtAddCallback(file_dialog, XmNokCallback, (XtCallbackProc) cb, NULL); XtManageChild(file_dialog); } void New(Widget w, char* ignore, XmPushButtonCallbackStruct *cs) { char buf[128]; char *str; Boolean found = False; int i = 0; while(! found) { sprintf(buf, "untitled%d.todo", i++); found = access(buf, F_OK) != 0; } str = XtNewString(buf); ReadDB(str); XtFree(options.todoFile); options.todoFile = str; XtVaSetValues(shell, XmNtitle, str, XmNtitleEncoding, XA_STRING, NULL, NULL); SetPage(0); } void Save(Widget w, char *i, XmFileSelectionBoxCallbackStruct *i2) { char *str; if ((str = XmStringUnparse(i2->value, NULL, XmCHARSET_TEXT, XmCHARSET_TEXT, NULL, 0, XmOUTPUT_ALL))) { SaveDB(str); XtFree(options.todoFile); options.todoFile = str; XtVaSetValues(shell, XmNtitle, str, XmNtitleEncoding, XA_STRING, NULL, NULL); } } void Open(Widget w, char *i, XmFileSelectionBoxCallbackStruct *i2) { char *str; if ((str = XmStringUnparse(i2->value, NULL, XmCHARSET_TEXT, XmCHARSET_TEXT, NULL, 0, XmOUTPUT_ALL))) { ReadDB(str); XtFree(options.todoFile); options.todoFile = str; XtVaSetValues(shell, XmNtitle, str, XmNtitleEncoding, XA_STRING, NULL, NULL); } } void help_cb(Widget w, XtPointer item, XmAnyCallbackStruct *cb) { XtManageChild(help_widget); XmdGotoHelpItem(w, (int) item, help_widget); } void Print(Widget w, char *ignore, XmdPrintCallbackStruct *cb) { int i; FILE *temp; int from, to; temp = fopen("/tmp/.todoout", "w"); if (cb -> first == cb -> last && cb -> first == 0) { from = 0; to = maxpages - 1; } else { from = MAX(0, cb -> first - 1); to = MIN(maxpages, cb -> last - 1); } for (i = from; i <= to; i++) { if (pages[i] -> label != NULL) { fprintf(temp, "Subject: %s\n", pages[i] -> label); fprintf(temp, "---------------------------\n\n\n"); } fprintf(temp, "%s", pages[i] -> page); if (i != (maxpages - 1)) fprintf(temp, "\f"); } fclose(temp); XmdPrintDocument("/tmp/.todoout", cb); } �������������������������������������������������motif-2.3.8/demos/programs/todo/todo.help�����������������������������������������������������������0000644�0001750�0001750�00000002055�12672140200�015304� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<title>Overview todo-manage todo lists todo Todo is a simple todo list manager. It provides a demonstration of the XmNotebook widget. To use todo, you should be able to simply run it from any directory. Files: $HOME/.todo The user's todo list X Defaults: The class of this application is XmDTodo. The name of the widgets of particular interest are: notebook The XmNotebook widget text The XmText widget label The status area XmLabel widget To set a specific resource in your .Xdefaults file, you specify the particular widget and resource. For example, if we wished to assign specific colors to the text widget's and notebook widget's background, we could do the following: XmDTodo*notebook.background: forestgreen XmDTodo*text.background: white About printing Todo outputs a text file with partially formatted data. Each page is headed by a underlined subject line. Otherwise the text from the page is printed as is. motif-2.3.8/demos/programs/todo/actions.c0000644000175000017500000003110212672140200015264 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char *rcsid = "$TOG: actions.c /main/7 1997/05/02 10:01:40 dbl $"; #endif #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "page.h" extern Page pages[]; Widget editDialog = 0, deleteDialog = 0; void SetPage(int); void AdjustPages(int, int); void FixPages(); void PageChange(Widget w, XtPointer i, XmNotebookCallbackStruct *cs); Page AllocPage(); char* Trim(char*); extern void SaveDB(char*); extern Widget shell, textw, labelw, notebook; extern int maxpages, currentPage, modified; void NewPage(Widget w, XtPointer i, XmPushButtonCallbackStruct *cs) { Arg args[2]; if (modified && pages[currentPage] != NULL) { if (pages[currentPage] -> page != NULL) XtFree(pages[currentPage] -> page); pages[currentPage] -> page = XmTextGetString(textw); } AdjustPages(currentPage, 1); pages[currentPage] = AllocPage(); FixPages(); XtSetArg(args[0], XmNcurrentPageNumber, (currentPage + 1)); XtSetArg(args[1], XmNlastPageNumber, (maxpages + 1)); XtSetValues(notebook, args, 2); SetPage(currentPage); } void DoDeletePage(Widget w, XtPointer i, XmPushButtonCallbackStruct *cs) { Arg args[2]; if (pages[currentPage] != NULL) { if (pages[currentPage] -> page != NULL) XtFree(pages[currentPage] -> page); if (pages[currentPage] -> minorPB != (Widget) 0) XtDestroyWidget(pages[currentPage] -> minorPB); if (pages[currentPage] -> majorPB != (Widget) 0) XtDestroyWidget(pages[currentPage] -> majorPB); XtFree((XtPointer) pages[currentPage]); } pages[currentPage] = NULL; AdjustPages(currentPage, -1); /* If there are no more pages left, then create a blank one */ if (maxpages < 0) { pages[0] = AllocPage(); pages[0] -> page = XtMalloc(2); pages[0] -> page[0] = 0; maxpages = 0; } FixPages(); XtSetArg(args[0], XmNcurrentPageNumber, (currentPage + 1)); XtSetArg(args[1], XmNlastPageNumber, (maxpages + 1)); XtSetValues(notebook, args, 2); SetPage(currentPage); } void DeletePage(Widget w, XtPointer i, XmPushButtonCallbackStruct *cs) { if (deleteDialog == 0) { Arg args[10]; XmString okLabel, promptText, dialogTitle; dialogTitle = XmStringCreateLocalized("Page Delete Dialog"); okLabel = XmStringCreateLocalized("Delete"); promptText = XmStringCreateLocalized("Really delete this page?"); XtSetArg(args[0], XmNokLabelString, okLabel); XtSetArg(args[1], XmNmessageString, promptText); XtSetArg(args[2], XmNdialogTitle, dialogTitle); XtSetArg(args[3], XmNdialogStyle, XmDIALOG_PRIMARY_APPLICATION_MODAL); deleteDialog = XmCreateMessageDialog(shell, "DeletePage", args, 4); XtAddCallback(deleteDialog, XmNokCallback, (XtCallbackProc) DoDeletePage, NULL); XmStringFree(dialogTitle); XmStringFree(okLabel); XmStringFree(promptText); } XtManageChild(deleteDialog); } Widget labelEditW, majorTabW, minorTabW; void DoEditPage(Widget w, XtPointer ig, XmPushButtonCallbackStruct *cs) { char *temp; XmString tstr; Arg args[5]; int i; pages[currentPage] -> label = XmTextFieldGetString(labelEditW); if (pages[currentPage] -> minorTab != NULL) XtFree(pages[currentPage] -> minorTab); temp = XmTextGetString(minorTabW); temp = Trim(temp); if (strlen(temp) > 0) pages[currentPage] -> minorTab = temp; else { XtFree(temp); pages[currentPage] -> minorTab = NULL; if (pages[currentPage] -> minorPB) XtUnmanageChild(pages[currentPage] -> minorPB); } if (pages[currentPage] -> majorTab != NULL) XtFree(pages[currentPage] -> majorTab); temp = XmTextGetString(majorTabW); temp = Trim(temp); if (strlen(temp) > 0) pages[currentPage] -> majorTab = temp; else { XtFree(temp); pages[currentPage] -> majorTab = NULL; if (pages[currentPage] -> majorPB) XtUnmanageChild(pages[currentPage] -> majorPB); } if (pages[currentPage] -> majorTab != NULL) { if (pages[currentPage] -> majorPB == (Widget) 0) { i = 0; XtSetArg(args[i], XmNpageNumber, currentPage + 1); i++; XtSetArg(args[i], XmNnotebookChildType, XmMAJOR_TAB); i++; XtSetArg(args[i], XmNshadowThickness, 1); i++; pages[currentPage] -> majorPB = ExmCreateTabButton(notebook, "atab", args, i); } tstr = XmStringGenerate(pages[currentPage] -> majorTab, NULL, XmCHARSET_TEXT, NULL); XtSetArg(args[0], ExmNcompoundString, tstr); XtSetValues(pages[currentPage] -> majorPB, args, 1); XtManageChild(pages[currentPage] -> majorPB); } if (pages[currentPage] -> minorTab != NULL) { if (pages[currentPage] -> minorPB == (Widget) 0) { i = 0; XtSetArg(args[i], XmNpageNumber, currentPage + 1); i++; XtSetArg(args[i], XmNnotebookChildType, XmMINOR_TAB); i++; XtSetArg(args[i], XmNshadowThickness, 1); i++; pages[currentPage] -> minorPB = ExmCreateTabButton(notebook, "atab", args, i); } tstr = XmStringGenerate(pages[currentPage] -> minorTab, NULL, XmCHARSET_TEXT, NULL); XtSetArg(args[0], ExmNcompoundString, tstr); XtSetValues(pages[currentPage] -> minorPB, args, 1); XtManageChild(pages[currentPage] -> minorPB); } /* Get contents before update */ XtFree(pages[currentPage] -> page); pages[currentPage] -> page = XmTextGetString(textw); SetPage(currentPage); } void EditPage(Widget w, XtPointer i, XmPushButtonCallbackStruct *cs) { if (pages[currentPage] == NULL) return; if (editDialog == 0) { Arg args[10]; XmString promptText, dialogTitle, temp; XmString okLabel, cancelLabel; Widget label, rc1, rc2; dialogTitle = XmStringCreateLocalized("Page Edit Dialog"); promptText = XmStringCreateLocalized("Really edit this page?"); okLabel = XmStringCreateLocalized("OK"); cancelLabel = XmStringCreateLocalized("Cancel"); XtSetArg(args[0], XmNselectionLabelString, promptText); XtSetArg(args[1], XmNdialogTitle, dialogTitle); XtSetArg(args[2], XmNdialogStyle, XmDIALOG_PRIMARY_APPLICATION_MODAL); XtSetArg(args[3], XmNokLabelString, okLabel); XtSetArg(args[4], XmNcancelLabelString, cancelLabel); editDialog = XmCreateTemplateDialog(shell, "EditPage", args, 5); XtAddCallback(editDialog, XmNokCallback, (XtCallbackProc) DoEditPage, NULL); XmStringFree(dialogTitle); XmStringFree(promptText); XmStringFree(okLabel); XmStringFree(cancelLabel); XtSetArg(args[0], XmNorientation, XmVERTICAL); rc1 = XmCreateRowColumn(editDialog, "rc", args, 1); XtManageChild(rc1); XtSetArg(args[0], XmNorientation, XmHORIZONTAL); rc2 = XmCreateRowColumn(rc1, "rc2", args, 1); temp = XmStringCreateLocalized("Label:"); XtSetArg(args[0], XmNwidth, 100); XtSetArg(args[1], XmNlabelString, temp); label = XmCreateLabelGadget(rc2, "label", args, 2); XtManageChild(label); XmStringFree(temp); XtManageChild(rc2); labelEditW = XmCreateTextField(rc2, "editTF", NULL, 0); XtManageChild(labelEditW); XtSetArg(args[0], XmNorientation, XmHORIZONTAL); rc2 = XmCreateRowColumn(rc1, "rc2", args, 1); temp = XmStringCreateLocalized("Major Tab:"); XtSetArg(args[0], XmNwidth, 100); XtSetArg(args[1], XmNlabelString, temp); label = XmCreateLabelGadget(rc2, "label", args, 2); XtManageChild(label); XmStringFree(temp); majorTabW = XmCreateTextField(rc2, "majorTF", NULL, 0); XtManageChild(majorTabW); XtManageChild(rc2); XtSetArg(args[0], XmNorientation, XmHORIZONTAL); rc2 = XmCreateRowColumn(rc1, "rc2", args, 1); temp = XmStringCreateLocalized("Minor Tab:"); XtSetArg(args[0], XmNwidth, 100); XtSetArg(args[1], XmNlabelString, temp); label = XmCreateLabelGadget(rc2, "label", args, 2); XtManageChild(label); XmStringFree(temp); minorTabW = XmCreateTextField(rc2, "minorTF", NULL, 0); XtManageChild(minorTabW); XtManageChild(rc2); } if (pages[currentPage] -> label != NULL) XmTextFieldSetString(labelEditW, pages[currentPage] -> label); else XmTextFieldSetString(labelEditW, ""); if (pages[currentPage] -> majorTab != NULL) XmTextSetString(majorTabW, pages[currentPage] -> majorTab); else XmTextSetString(majorTabW, ""); if (pages[currentPage] -> minorTab != NULL) XmTextSetString(minorTabW, pages[currentPage] -> minorTab); else XmTextSetString(minorTabW, ""); XtManageChild(editDialog); } void SaveIt(Widget w, char *i, XmPushButtonCallbackStruct *e) { SaveDB(options.todoFile); } void SetPage(int pageNumber) { XmString tmp; char buf[80]; Arg args[5]; currentPage = pageNumber; if (pageNumber <= maxpages) { XtSetArg(args[0], XmNpageNumber, (pageNumber + 1)); XtSetValues(XtParent(textw), args, 1); } if (pages[pageNumber] != NULL) { if (pages[pageNumber] -> page != NULL) XtSetArg(args[0], XmNvalue, pages[pageNumber] -> page); else XtSetArg(args[0], XmNvalue, ""); XtSetValues(textw, args, 1); if (pages[pageNumber] -> label != NULL) tmp = XmStringCreateLocalized(pages[pageNumber] -> label); else { sprintf(buf, "Page %d", pageNumber + 1); tmp = XmStringCreateLocalized(buf); } } else { XtSetArg(args[0], XmNvalue, ""); XtSetValues(textw, args, 1); sprintf(buf, "Page %d (Bad Page)", pageNumber + 1); tmp = XmStringCreateLocalized(buf); } XmTextSetTopCharacter(textw, pages[pageNumber] -> lasttoppos); XmTextSetInsertionPosition(textw, pages[pageNumber] -> lastcursorpos); XtSetArg(args[0], XmNpageNumber, (pageNumber + 1)); XtSetArg(args[1], XmNlabelString, tmp); XtSetValues(labelw, args, 2); XmStringFree(tmp); } void PageChange(Widget w, XtPointer i, XmNotebookCallbackStruct *cs) { if (modified && pages[currentPage] != NULL) { if (pages[currentPage] -> page != NULL) XtFree(pages[currentPage] -> page); pages[currentPage] -> page = XmTextGetString(textw); pages[currentPage] -> lasttoppos = XmTextGetTopCharacter(textw); pages[currentPage] -> lastcursorpos = XmTextGetInsertionPosition(textw); } SetPage(cs -> page_number - 1); } void AdjustPages(int startpage, int ins) { int i; /* ins is either +1 or -1 for insert or delete a page */ if (ins > 0) { for(i = maxpages; i >= startpage; i--) pages[i + 1] = pages[i]; maxpages += 1; } else { for(i = startpage; i <= maxpages; i++) pages[i] = pages[i + 1]; maxpages -= 1; } } void FixPages() { int i; Arg args[2]; /* Now scan the pages and fix the tabs */ for (i = 0; i <= maxpages; i++) { XtSetArg(args[0], XmNpageNumber, (i + 1)); if (pages[i] -> majorPB != (Widget) 0) XtSetValues(pages[i] -> majorPB, args, 1); if (pages[i] -> minorPB != (Widget) 0) XtSetValues(pages[i] -> minorPB, args, 1); } } /* This function removes leading and trailing whitespace. It deallocates the original string and returns a brand new string */ char* Trim(char* str) { char *new; int first, last; int length; if (str == NULL) return(XtNewString("")); length = strlen(str); for(first = 0; first < length && isspace(str[first]); first++); for(last = length - 1; last > first && isspace(str[last]); last--); if (! isspace(str[last])) last++; /* Last needs to be adjusted */ if (first == last) /* Empty */ { free(str); return(strdup("")); } else { new = XtMalloc(last - first + 1); /* Don't forget last 0 */ strncpy(new, &str[first], last - first); new[last - first] = 0; free(str); return(new); } } motif-2.3.8/demos/programs/todo/Makefile.am0000644000175000017500000000067513145162623015540 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/todo datadir = ${prefix}/share/Xm/todo EXTRA_DIST = README XmdTodo.ad example.todo todo.man todo.help bin_PROGRAMS = todo todo_SOURCES = todo.c io.c actions.c page.h data_DATA = $(EXTRA_DIST) $(todo_SOURCES) INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la motif-2.3.8/demos/programs/ButtonBox/0000755000175000017500000000000013211513007014521 500000000000000motif-2.3.8/demos/programs/ButtonBox/bboxdemo.c0000644000175000017500000005601112672140200016410 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include Widget bbox; void Exit(Widget w, XtPointer client, XtPointer call); void Equal(Widget w, XtPointer client, XtPointer call); void Fill(Widget w, XtPointer client, XtPointer call); void Width(Widget w, XtPointer client, XtPointer call); void OnlyNum(Widget w, XtPointer client, XtPointer call); void Orient(Widget w, XtPointer client, XtPointer call); void Explain(Widget w, XtPointer client, XtPointer call); /* * * These are fallbacks that are designed to ensure the * program works properly in case the resource file is * not picked up. * */ static String fallbacks[] = { /* * General fallback resources. */ "*background: grey", "*bbox*background: white", "*bform.height: 575", "*bbox.width: 450", "*bbox.height: 65", "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*infolabel*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*infolabel.marginWidth: 10", "*infolabel.marginHeight: 10", "*boxSizeLabel.labelString: XmNequalSize", "*fillOptionLabel.labelString: XmNfillOption", "*widLabel.labelString: XmNmarginWidth", "*htLabel.labelString: XmNmarginHeight", "*orientLabel.labelString: XmNorientation", "*toggle1.labelString: True", "*toggle2.labelString: False", "*toggle3.labelString: XmHORIZONTAL", "*toggle4.labelString: XmVERTICAL", "*resform*XmPushButton.labelString: Explain...", "*resform*pulldownMenu.nonePB.labelString: XmFillNone", "*resform*pulldownMenu.minorPB.labelString: XmFillMinor", "*resform*pulldownMenu.majorPB.labelString: XmFillMajor", "*resform*pulldownMenu.allPB.labelString: XmFillAll", "*quitPB.labelString: Quit", NULL, }; void Exit(Widget w, XtPointer client, XtPointer call) { exit(0); } /* * * This function forces the buttons to be of equal size. * */ void Equal(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; Boolean equal; if ((int)client == 1) equal = True; else equal = False; argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, equal); argcnt++; XtSetValues(bbox, args, argcnt); } /* * * This function forces the margins along the sides (width) * or along the top and bottom (height) to be of a particular * size. * */ void Width(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; char *val; int margin = 0; val = XmTextFieldGetString(w); margin = atoi(val); argcnt = 0; if ((int)client == 1) { XtSetArg(args[argcnt], XmNmarginHeight, (short) margin); argcnt++; } else { XtSetArg(args[argcnt], XmNmarginWidth, (short) margin); argcnt++; } XtSetValues(bbox, args, argcnt); XtFree(val); } /* * * Depending on the resource, the buttons either fill the box * along the minor axis (minor), the major axis (major), neither (none) * or completely fill the box (all). * */ void Fill(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; int val = (int)client; argcnt = 0; switch (val) { case 1: XtSetArg(args[argcnt], XmNfillOption, XmFillNone); argcnt++; XtSetValues(bbox, args, argcnt); break; case 2: XtSetArg(args[argcnt], XmNfillOption, XmFillMinor); argcnt++; XtSetValues(bbox, args, argcnt); break; case 3: XtSetArg(args[argcnt], XmNfillOption, XmFillMajor); argcnt++; XtSetValues(bbox, args, argcnt); break; case 4: XtSetArg(args[argcnt], XmNfillOption, XmFillAll); argcnt++; XtSetValues(bbox, args, argcnt); break; } } /* * Validation of input. * * A common routine to ensure that the only values entered * in the text box are all numeric. * */ void OnlyNum(Widget w, XtPointer client, XtPointer call) { XmTextVerifyCallbackStruct *verify_struct = (XmTextVerifyCallbackStruct *) call; if (verify_struct->text->ptr) if (!isdigit(*verify_struct->text->ptr)) verify_struct->doit = False; } /* * * Specifies the orientation of the buttons in the box. * */ void Orient(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; unsigned char orient; if ((int)client == 1) orient = XmVERTICAL; else orient = XmHORIZONTAL; argcnt = 0; XtSetArg(args[argcnt], XmNorientation, orient); argcnt++; XtSetValues(bbox, args, argcnt); } /* * * Stuff needed for the demo program to output info * */ void Explain(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; XmString xmstring = NULL; static Widget info = NULL; int explain = (int) client; if (info == NULL) { Widget temp; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; info = XmCreateInformationDialog(w, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); } switch (explain) { case 1: xmstring = XmStringCreateLtoR( "The equalSize resource specifies whether children of the Button\n\ Box have equal heights and widths. The height and width chosen for\n\ all the children is the height and width of the largest child.", XmSTRING_DEFAULT_CHARSET); break; case 2: xmstring = XmStringCreateLtoR( "The fillOption resource sets four kinds of fill options: FillNone,\n\ FillMajor, FillMinor, and FillAll. Fill specifies how to use any extra\n\ space left over once all children have been sized. This resource usually\n\ expands children in a reasonable manner.\n\ \n\ FillMajor expands children in the direction of the orientation resource.\n\ FillMinor expands children in the opposite direction of the orientation \ resource.\n\ FillAll expands children in both major and minor directions.\n\ FillNone doesn't expand children.", XmSTRING_DEFAULT_CHARSET); break; case 3: xmstring = XmStringCreateLtoR( "marginWidth is the number of spacing pixels to the left and to the right\n\ of the children in the Button Box.", XmSTRING_DEFAULT_CHARSET); break; case 4: xmstring = XmStringCreateLtoR( "marginHeight is the number of spacing pixels on top and on bottom of the \n\ children in the Button Box.", XmSTRING_DEFAULT_CHARSET); break; case 5: xmstring = XmStringCreateLtoR( "orientation specifies whether the children of the Button Box are placed\n\ in a row or a column. HORIZONTAL places children in a row (major dimension\n\ is width, minor dimension is height). VERTICAL places children in a column\n\ (major dimension is height, minor dimension is width).", XmSTRING_DEFAULT_CHARSET); break; default: printf("explaining NOTHING\n"); break; } argcnt = 0; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; XtSetValues(info, args, argcnt); XmStringFree(xmstring); XtManageChild(info); } int main(int argc, char **argv) { Arg args[5]; Cardinal argcnt; Widget top, bboxframe, infoframe, infolabel, resframe, resform, bboxSizeRC, boxSizeLabel, togl_btn1, togl_btn2, pushButton, radioRC, fillOptionRC, fillOptionLabel, fillOptionMenu, nonePB, minorPB, majorPB, allPB, menuShell, pulldownMenu, pushButton1,widRC, widLabel, widText, htRC, htLabel, htText, pushButton2, orientRC, orientLabel, pushButton3, pushButton4, quitPB, bbox_PB1, bbox_PB2, bbox_PB3, bbox_PB4, togl_btn3, togl_btn4, orientRadio, bform; XtAppContext app; XmString xmstring; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Button Box Demo"); argcnt++; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; top = XtOpenApplication( &app, "Buttonbox", NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, args, argcnt); bform = XtVaCreateManagedWidget("bform", xmFormWidgetClass, top, XmNresizePolicy, XmRESIZE_GROW, NULL); bboxframe = XtVaCreateManagedWidget("bboxframe", xmFrameWidgetClass,bform, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNtopOffset, 10, XmNbottomOffset, 10, XmNx, 10, XmNy, 10, NULL); { Widget dbbox = XmCreateFormDialog(top,"frame",NULL,0); /* * * Take Note: * * Creation of the widget being demoed. * */ bbox = XtVaCreateManagedWidget("bbox", xmButtonBoxWidgetClass, dbbox, XmNx, 2, XmNy, 2, NULL); XtVaSetValues(bbox, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL); XtManageChild(dbbox); } /* * * The following widgets created are buttons to fill the box. * This is to assist in the demonstration of the buttonBox's * utility. * */ bbox_PB1 = XmVaCreateManagedPushButton(bbox, "FirstButton", NULL); bbox_PB2 = XmVaCreateManagedPushButton(bbox, "SecondButton", NULL); bbox_PB3 = XmVaCreateManagedPushButton(bbox, "ThirdButton", NULL); bbox_PB4 = XtCreateManagedWidget("LastButton", xmPushButtonWidgetClass, bbox, NULL, 0); xmstring = XmStringCreateLtoR( "The Motif Button Box widget can arrange buttons into single rows and columns\n\ much more easily than the Motif Row Column or Motif Form!\n\ (And two ButtonBoxes paired together do a great job of lining items up.)\n\ \n\ The four buttons in the other window are inside an Motif Button Box. Try \ resizing\n\ this window! Try modifying the Button Box's resources using the area below.\n\ \n\ Press the \"Explain...\" button to find out more about a particular resource.", XmSTRING_DEFAULT_CHARSET); infoframe = XtVaCreateManagedWidget("infoframe", xmFrameWidgetClass, bform, XmNbottomAttachment, XmATTACH_NONE, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 95, XmNtopOffset, 0, XmNbottomOffset, 0, XmNleftOffset, 10, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNtopWidget, bboxframe, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, bboxframe, NULL); resframe = XtVaCreateManagedWidget("resframe", xmFrameWidgetClass, bform, XmNbottomAttachment, XmATTACH_NONE, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 95, XmNtopOffset, 9, XmNbottomOffset, 0, XmNleftOffset, 0, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, infoframe, XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET, XmNleftWidget, infoframe, NULL); quitPB = XmVaCreatePushButton(bform, "quitPB", XmNtopAttachment, XmATTACH_NONE, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, bboxframe, XmNbottomAttachment, XmATTACH_FORM, XmNtopOffset, 0, XmNbottomOffset, 10, XmNleftOffset, 300, XmNwidth, 100, NULL); XtManageChild(quitPB); infolabel = XtVaCreateManagedWidget("infolabel", xmLabelWidgetClass, infoframe, XmNx, 2, XmNy, 2, XmNalignment, XmALIGNMENT_BEGINNING, XmNlabelString, xmstring, NULL); resform = XtVaCreateManagedWidget("resform", xmFormWidgetClass, resframe, XmNresizePolicy, XmRESIZE_GROW, NULL); bboxSizeRC = XtVaCreateManagedWidget("bboxSizeRC", xmRowColumnWidgetClass, resform, XmNorientation, XmHORIZONTAL, XmNpacking, XmPACK_TIGHT, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_NONE, XmNtopOffset, 10, XmNleftOffset, 10, XmNrowColumnType, XmWORK_AREA, NULL); fillOptionRC = XtVaCreateManagedWidget("fillOptionRC", xmRowColumnWidgetClass, resform, XmNorientation, XmHORIZONTAL, XmNpacking, XmPACK_TIGHT, XmNbottomAttachment, XmATTACH_NONE, XmNleftAttachment, XmATTACH_FORM, XmNtopOffset, 10, XmNbottomOffset, 0, XmNleftOffset, 10, XmNrowColumnType, XmWORK_AREA, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, bboxSizeRC, NULL); widRC = XtVaCreateManagedWidget("widRC", xmRowColumnWidgetClass, resform, XmNorientation, XmHORIZONTAL, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, fillOptionRC, XmNpacking, XmPACK_TIGHT, XmNbottomAttachment, XmATTACH_NONE, XmNleftAttachment, XmATTACH_FORM, XmNtopOffset, 10, XmNbottomOffset, 0, XmNleftOffset, 10, XmNrowColumnType, XmWORK_AREA, NULL); htRC = XtVaCreateManagedWidget("htRC", xmRowColumnWidgetClass, resform, XmNorientation, XmHORIZONTAL, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, widRC, XmNpacking, XmPACK_TIGHT, XmNbottomAttachment, XmATTACH_NONE, XmNleftAttachment, XmATTACH_FORM, XmNtopOffset, 10, XmNbottomOffset, 0, XmNleftOffset, 10, XmNrowColumnType, XmWORK_AREA, NULL); orientRC = XtVaCreateManagedWidget("orientRC", xmRowColumnWidgetClass, resform, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, htRC, XmNorientation, XmHORIZONTAL, XmNpacking, XmPACK_TIGHT, XmNbottomAttachment, XmATTACH_NONE, XmNleftAttachment, XmATTACH_FORM, XmNtopOffset, 10, XmNbottomOffset, 0, XmNleftOffset, 10, XmNrowColumnType, XmWORK_AREA, NULL); boxSizeLabel = XtVaCreateManagedWidget("boxSizeLabel", xmLabelWidgetClass, bboxSizeRC, XmNx, 3, XmNy, 3, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNx, 82); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; radioRC = XmCreateRadioBox(bboxSizeRC,"radioRC", args, argcnt); togl_btn1 = XtVaCreateManagedWidget("toggle1", xmToggleButtonWidgetClass, radioRC, NULL); togl_btn2 = XtVaCreateManagedWidget("toggle2", xmToggleButtonWidgetClass, radioRC, NULL); XtManageChild(radioRC); pushButton = XtVaCreateManagedWidget("pushButton", xmPushButtonWidgetClass, bboxSizeRC, XmNx, 265, XmNy, 3, NULL); fillOptionLabel = XtVaCreateManagedWidget("fillOptionLabel", xmLabelWidgetClass, fillOptionRC, XmNx, 3, XmNy, 3, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNx, 100); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; fillOptionMenu = XmCreateOptionMenu(fillOptionRC, "fillOptionMenu", args, argcnt); XtManageChild(fillOptionMenu); argcnt = 0; XtSetArg(args[argcnt], XmNwidth, 1); argcnt++; XtSetArg(args[argcnt], XmNheight, 1); argcnt++; menuShell = XtCreatePopupShell("menuShell", xmMenuShellWidgetClass, fillOptionRC, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_PULLDOWN); argcnt++; XtSetArg(args[argcnt], XmNx, 0); argcnt++; XtSetArg(args[argcnt], XmNy, 0); argcnt++; XtSetArg(args[argcnt], XmNwidth, 54); argcnt++; XtSetArg(args[argcnt], XmNheight, 88); argcnt++; pulldownMenu = XtCreateWidget("pulldownMenu", xmRowColumnWidgetClass, menuShell, args, argcnt); nonePB = XtVaCreateManagedWidget("nonePB", xmPushButtonWidgetClass, pulldownMenu, NULL); minorPB = XtVaCreateManagedWidget("minorPB", xmPushButtonWidgetClass, pulldownMenu, NULL); majorPB = XtVaCreateManagedWidget("majorPB", xmPushButtonWidgetClass, pulldownMenu, NULL); allPB = XtVaCreateManagedWidget("allPB", xmPushButtonWidgetClass, pulldownMenu, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNsubMenuId, pulldownMenu); argcnt++; XtSetValues(fillOptionMenu, args, argcnt); pushButton1 = XtVaCreateManagedWidget("pushButton1", xmPushButtonWidgetClass, fillOptionRC, XmNx, 262, XmNy, 3, NULL); widLabel = XtVaCreateManagedWidget("widLabel", xmLabelWidgetClass, widRC, XmNx, 3, XmNy, 3, NULL); widText = XtVaCreateManagedWidget("widText", xmTextFieldWidgetClass, widRC, XmNx, 76, XmNy, 3, NULL); pushButton2 = XtVaCreateManagedWidget("pushButton2", xmPushButtonWidgetClass, widRC, XmNx, 217, XmNy, 3, NULL); htLabel = XtVaCreateManagedWidget("htLabel", xmLabelWidgetClass, htRC, XmNx, 3, XmNy, 3, NULL); htText = XtVaCreateManagedWidget("htText", xmTextFieldWidgetClass, htRC, XmNx, 76, XmNy, 3, NULL); pushButton3 = XtVaCreateManagedWidget("pushButton3", xmPushButtonWidgetClass, htRC, XmNx, 217, XmNy, 3, NULL); orientLabel = XtVaCreateManagedWidget("orientLabel", xmLabelWidgetClass, orientRC, XmNx, 3, XmNy, 3, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNx, 82); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; orientRadio = XmCreateRadioBox(orientRC,"orientRadio", args, argcnt); togl_btn3 = XtVaCreateManagedWidget("toggle3", xmToggleButtonWidgetClass, orientRadio, NULL); togl_btn4 = XtVaCreateManagedWidget("toggle4", xmToggleButtonWidgetClass, orientRadio, NULL); { unsigned char orientation; XtVaGetValues(bbox, XmNorientation, &orientation, NULL); if (XmHORIZONTAL == orientation) XmToggleButtonSetState(togl_btn3, True, False); else XmToggleButtonSetState(togl_btn4, True, False); } XtManageChild(orientRadio); pushButton4 = XtVaCreateManagedWidget("pushButton4", xmPushButtonWidgetClass, orientRC, XmNx, 82, XmNy, 3, NULL); XtAddCallback(quitPB, XmNactivateCallback, Exit, (XtPointer)0); XtAddCallback(pushButton, XmNactivateCallback, Explain, (XtPointer)1); XtAddCallback(pushButton1, XmNactivateCallback, Explain, (XtPointer)2); XtAddCallback(pushButton2, XmNactivateCallback, Explain, (XtPointer)3); XtAddCallback(pushButton3, XmNactivateCallback, Explain, (XtPointer)4); XtAddCallback(pushButton4, XmNactivateCallback, Explain, (XtPointer)5); XtAddCallback(togl_btn1, XmNvalueChangedCallback, Equal, (XtPointer)1); XtAddCallback(togl_btn2, XmNvalueChangedCallback, Equal, (XtPointer)0); XtAddCallback(nonePB, XmNactivateCallback, Fill, (XtPointer)1); XtAddCallback(minorPB, XmNactivateCallback, Fill, (XtPointer)2); XtAddCallback(majorPB, XmNactivateCallback, Fill, (XtPointer)3); XtAddCallback(allPB, XmNactivateCallback, Fill, (XtPointer)4); XtAddCallback(htText, XmNactivateCallback, Width, (XtPointer)1); XtAddCallback(htText, XmNmodifyVerifyCallback, OnlyNum, (XtPointer)0); XtAddCallback(widText, XmNactivateCallback, Width, (XtPointer)0); XtAddCallback(widText, XmNmodifyVerifyCallback, OnlyNum, (XtPointer)0); XtAddCallback(togl_btn4, XmNvalueChangedCallback, Orient, (XtPointer)1); XtAddCallback(togl_btn3, XmNvalueChangedCallback, Orient, (XtPointer)0); XtRealizeWidget(top); XtAppMainLoop(app); /* appease compiler warning god */ return (0); } motif-2.3.8/demos/programs/ButtonBox/Makefile.in0000644000175000017500000005502213211512765016524 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = bboxdemo$(EXEEXT) subdir = demos/programs/ButtonBox ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_bboxdemo_OBJECTS = bboxdemo.$(OBJEXT) bboxdemo_OBJECTS = $(am_bboxdemo_OBJECTS) bboxdemo_LDADD = $(LDADD) bboxdemo_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(bboxdemo_SOURCES) DIST_SOURCES = $(bboxdemo_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/ButtonBox build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/ButtonBox datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = bboxdemo_SOURCES = bboxdemo.c data_DATA = $(EXTRA_DIST) $(bboxdemo_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/ButtonBox/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/ButtonBox/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list bboxdemo$(EXEEXT): $(bboxdemo_OBJECTS) $(bboxdemo_DEPENDENCIES) $(EXTRA_bboxdemo_DEPENDENCIES) @rm -f bboxdemo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bboxdemo_OBJECTS) $(bboxdemo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bboxdemo.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/ButtonBox/Makefile.am0000644000175000017500000000053213145162623016507 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/ButtonBox datadir = ${prefix}/share/Xm/ButtonBox bin_PROGRAMS = bboxdemo EXTRA_DIST = bboxdemo_SOURCES = bboxdemo.c data_DATA = $(EXTRA_DIST) $(bboxdemo_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/setdate/0000755000175000017500000000000013211513007014226 500000000000000motif-2.3.8/demos/programs/setdate/setDate.c0000644000175000017500000002305013066310437015715 00000000000000/* $XConsortium: setDate.c /main/6 1996/11/08 16:40:07 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #include #include #include #include #ifndef CSRG_BASED #include #endif #include #include #include #include #include #include #include #include #include #include XtAppContext context; #define APP_CLASS "XmdSetDate" struct tm *thetime; time_t timer; Widget action, exitpb; void ValueChanged(Widget, XtPointer, XtPointer); void QuitAppl(Widget, XtPointer, XtPointer); void Doit(Widget, XtPointer, XtPointer); char * fallback_resources[] = { "*SpinBoxs.orientation: XmHORIZONTAL", "*SpinBoxs.packing: XmPACK_TIGHT", "*label2.labelString: Date:", "*label3.labelString: Time:", "*XmSpinBox.alignment: XmALIGNMENT_END", "*XmSpinBox.arrowLayout: XmARROWS_SPLIT", "*dateCommand: echo %s", NULL }; int dy, yr, mn, hr, mi; Widget day, month, year, hour, minute; char *dateCommand = NULL; int main(int argc, char **argv) { Widget shell, panedw, rc, rc2, sb1, sb2; Widget label, label2; Arg args[20]; int argcount; int i; XmString months[12]; char *monthstr[12]; char buf[10]; char *str; shell = XtVaAppInitialize(&context, APP_CLASS, NULL, 0, &argc, argv, fallback_resources, NULL); time(&timer); thetime = localtime(&timer); dy = thetime -> tm_mday; yr = thetime -> tm_year + 1900; mn = thetime -> tm_mon; hr = thetime -> tm_hour; mi = thetime -> tm_min; panedw = XmCreatePanedWindow(shell, "BBoard", NULL, 0); XtManageChild(panedw); /* argcount = 0; XtSetArg(args[argcount], XmNlabelType, XmSTRING), argcount++; XtSetArg(args[argcount], XmNlabelString, XmStringCreate("Set Current Date and Time", XmSTRING_DEFAULT_CHARSET)), argcount++; label = XmCreateLabel(panedw, "label1", args, argcount); XtManageChild(label); */ str = XGetDefault(XtDisplay(panedw), APP_CLASS, "dateCommand"); if (str == NULL) str = XGetDefault(XtDisplay(panedw), argv[0], "dateCommand"); if (str == NULL) dateCommand = "echo Default command, the date is: %s"; else dateCommand = str; rc = XmCreateRowColumn(panedw, "SpinBoxs", NULL, 0); XtManageChild(rc); label = XmCreateLabel(rc, "label2", NULL, 0); XtManageChild(label); sb1 = XmCreateSpinBox(rc, "DateSB", NULL, 0); XtAddCallback(sb1, XmNvalueChangedCallback, ValueChanged, NULL); XtManageChild(sb1); argcount = 0; XtSetArg(args[argcount], XmNpositionType, XmPOSITION_INDEX), argcount++; XtSetArg(args[argcount], XmNspinBoxChildType, XmNUMERIC), argcount++; XtSetArg(args[argcount], XmNmaximumValue, 31), argcount++; XtSetArg(args[argcount], XmNminimumValue, 1), argcount++; XtSetArg(args[argcount], XmNposition, dy - 1), argcount++; XtSetArg(args[argcount], XmNcolumns, 3), argcount++; day = XmCreateTextField(sb1, "Day", args, argcount); XtManageChild(day); #ifndef CSRG_BASED months[0] = XmStringCreate(nl_langinfo(MON_1), XmSTRING_DEFAULT_CHARSET); months[1] = XmStringCreate(nl_langinfo(MON_2), XmSTRING_DEFAULT_CHARSET); months[2] = XmStringCreate(nl_langinfo(MON_3), XmSTRING_DEFAULT_CHARSET); months[3] = XmStringCreate(nl_langinfo(MON_4), XmSTRING_DEFAULT_CHARSET); months[4] = XmStringCreate(nl_langinfo(MON_5), XmSTRING_DEFAULT_CHARSET); months[5] = XmStringCreate(nl_langinfo(MON_6), XmSTRING_DEFAULT_CHARSET); months[6] = XmStringCreate(nl_langinfo(MON_7), XmSTRING_DEFAULT_CHARSET); months[7] = XmStringCreate(nl_langinfo(MON_8), XmSTRING_DEFAULT_CHARSET); months[8] = XmStringCreate(nl_langinfo(MON_9), XmSTRING_DEFAULT_CHARSET); months[9] = XmStringCreate(nl_langinfo(MON_10), XmSTRING_DEFAULT_CHARSET); months[10] = XmStringCreate(nl_langinfo(MON_11), XmSTRING_DEFAULT_CHARSET); months[11] = XmStringCreate(nl_langinfo(MON_12), XmSTRING_DEFAULT_CHARSET); #else months[0] = XmStringCreate("January", XmSTRING_DEFAULT_CHARSET); months[1] = XmStringCreate("February", XmSTRING_DEFAULT_CHARSET); months[2] = XmStringCreate("March", XmSTRING_DEFAULT_CHARSET); months[3] = XmStringCreate("April", XmSTRING_DEFAULT_CHARSET); months[4] = XmStringCreate("May", XmSTRING_DEFAULT_CHARSET); months[5] = XmStringCreate("June", XmSTRING_DEFAULT_CHARSET); months[6] = XmStringCreate("July", XmSTRING_DEFAULT_CHARSET); months[7] = XmStringCreate("August", XmSTRING_DEFAULT_CHARSET); months[8] = XmStringCreate("September", XmSTRING_DEFAULT_CHARSET); months[9] = XmStringCreate("October", XmSTRING_DEFAULT_CHARSET); months[10] = XmStringCreate("November", XmSTRING_DEFAULT_CHARSET); months[11] = XmStringCreate("December", XmSTRING_DEFAULT_CHARSET); #endif argcount = 0; XtSetArg(args[argcount], XmNpositionType, XmPOSITION_INDEX), argcount++; XtSetArg(args[argcount], XmNvalues, months), argcount++; XtSetArg(args[argcount], XmNnumValues, 12), argcount++; XtSetArg(args[argcount], XmNposition, mn), argcount++; XtSetArg(args[argcount], XmNcolumns, 12), argcount++; month = XmCreateTextField(sb1, "MonthSB", args, argcount); XtManageChild(month); argcount = 0; XtSetArg(args[argcount], XmNpositionType, XmPOSITION_INDEX), argcount++; XtSetArg(args[argcount], XmNspinBoxChildType, XmNUMERIC), argcount++; XtSetArg(args[argcount], XmNmaximumValue, 2020), argcount++; XtSetArg(args[argcount], XmNminimumValue, 1992), argcount++; XtSetArg(args[argcount], XmNposition, yr-1992), argcount++; XtSetArg(args[argcount], XmNcolumns, 5), argcount++; year = XmCreateTextField(sb1, "YearSB", args, argcount); XtManageChild(year); argcount = 0; label = XmCreateLabel(rc, "label3", args, argcount); XtManageChild(label); argcount = 0; XtSetArg(args[argcount], XmNy, 50), argcount++; sb2 = XmCreateSpinBox(rc, "TimeSB", args, argcount); XtAddCallback(sb2, XmNvalueChangedCallback, ValueChanged, NULL); XtManageChild(sb2); argcount = 0; XtSetArg(args[argcount], XmNpositionType, XmPOSITION_INDEX), argcount++; XtSetArg(args[argcount], XmNspinBoxChildType, XmNUMERIC), argcount++; XtSetArg(args[argcount], XmNmaximumValue, 23), argcount++; XtSetArg(args[argcount], XmNminimumValue, 0), argcount++; XtSetArg(args[argcount], XmNposition, hr), argcount++; XtSetArg(args[argcount], XmNcolumns, 3), argcount++; hour = XmCreateTextField(sb2, "Hour", args, argcount); XtManageChild(hour); argcount = 0; XtSetArg(args[argcount], XmNpositionType, XmPOSITION_INDEX), argcount++; XtSetArg(args[argcount], XmNlabelType, XmSTRING), argcount++; XtSetArg(args[argcount], XmNlabelString, XmStringCreate(":", XmSTRING_DEFAULT_CHARSET)), argcount++; label = XmCreateLabel(sb2, "label4", args, argcount); XtManageChild(label); argcount = 0; XtSetArg(args[argcount], XmNpositionType, XmPOSITION_INDEX), argcount++; XtSetArg(args[argcount], XmNspinBoxChildType, XmNUMERIC), argcount++; XtSetArg(args[argcount], XmNmaximumValue, 59), argcount++; XtSetArg(args[argcount], XmNminimumValue, 0), argcount++; XtSetArg(args[argcount], XmNposition, mi), argcount++; XtSetArg(args[argcount], XmNcolumns, 3), argcount++; minute = XmCreateTextField(sb2, "Minute", args, argcount); XtManageChild(minute); argcount = 0; XtSetArg(args[argcount], XmNorientation, XmHORIZONTAL), argcount++; XtSetArg(args[argcount], XmNpacking, XmPACK_TIGHT), argcount++; rc2 = XmCreateRowColumn(panedw, "SpinBoxs2", args, argcount); XtManageChild(rc2); argcount = 0; action = XmCreatePushButton(rc2, "SetDate", args, argcount); XtManageChild(action); XtAddCallback(action, XmNactivateCallback, Doit, "OK"); argcount = 0; exitpb = XmCreatePushButton(rc2, "Quit", args, argcount); XtManageChild(exitpb); XtAddCallback(exitpb, XmNactivateCallback, QuitAppl, "OK"); XtRealizeWidget(shell); XtAppMainLoop(context); return 0; /* make compiler happy */ } void ValueChanged(Widget w, XtPointer client_data, XtPointer data) { XmSpinBoxCallbackStruct *call; call = (XmSpinBoxCallbackStruct *)data; if (call->widget == day) dy = call->position + 1; else if (call->widget == month) mn = call->position; else if (call->widget == year) yr = call->position + 1992; else if (call->widget == hour) hr = call->position; else if (call->widget == minute) mi = call->position; } void QuitAppl(Widget w, XtPointer i, XtPointer data) { XmPushButtonCallbackStruct *e = (XmPushButtonCallbackStruct *) data; exit(0); } void Doit(Widget w, XtPointer client_data, XtPointer data) { XmPushButtonCallbackStruct *e = (XmPushButtonCallbackStruct *) data; char buffer[80]; char date[32]; sprintf(date, "%02d%02d%02d%02d%02d", (mn + 1), dy, hr, mi, yr - (100 * (yr / 100))); sprintf(buffer, dateCommand, date); system(buffer); } motif-2.3.8/demos/programs/setdate/setDate.man0000644000175000017500000000264512672140200016244 00000000000000.\" $XConsortium: setDate.man /main/4 1995/07/17 10:48:52 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY ...\" " .TH setDate 1X MOTIF "Demonstration programs" .SH NAME \*LsetDate\*O\(emshow current time using the SpinBox widget. .SH SYNOPSIS .sS \*LsetDate\*O .sE .SH DESCRIPTION \*LSetDate\*O shows the current time. This can be changed using the arrows or using the keyboard keys osfLeft and osfRight. Then the "setDate" button can be pressed the new time is printed. With a minor modification in the code, the date command can be executed instead. motif-2.3.8/demos/programs/setdate/Makefile.in0000644000175000017500000005501413211512766016233 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = setDate$(EXEEXT) subdir = demos/programs/setdate ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_setDate_OBJECTS = setDate.$(OBJEXT) setDate_OBJECTS = $(am_setDate_OBJECTS) setDate_LDADD = $(LDADD) setDate_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(setDate_SOURCES) DIST_SOURCES = $(setDate_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/setDate build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/setDate datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = XmdSetDate.ad README setDate.man setDate_SOURCES = setDate.c data_DATA = $(EXTRA_DIST) $(setDate_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/setdate/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/setdate/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list setDate$(EXEEXT): $(setDate_OBJECTS) $(setDate_DEPENDENCIES) $(EXTRA_setDate_DEPENDENCIES) @rm -f setDate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setDate_OBJECTS) $(setDate_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setDate.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/setdate/README0000644000175000017500000000074512672140200015035 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:09:05 drk $ */ SetDate ------- SetDate is a simple demonstration of the SpinBox widget. In addition it can be modified to make a fairly useful sysadmin tool. One of my long term peeves on UNIX systems is the difficultly of changing the system clock, SetDate can be modified to do this and setuid'ed to make it quite easy. Enjoy, Doug motif-2.3.8/demos/programs/setdate/Makefile.am0000644000175000017500000000054513145162623016220 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/setDate datadir = ${prefix}/share/Xm/setDate bin_PROGRAMS = setDate EXTRA_DIST = XmdSetDate.ad README setDate.man setDate_SOURCES = setDate.c data_DATA = $(EXTRA_DIST) $(setDate_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/setdate/XmdSetDate.ad0000644000175000017500000000303612672140200016461 00000000000000! $XConsortium: XmdSetDate.ad /main/4 1995/07/17 18:53:38 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! Sample application defaults file ! ! Optionally place this file in your system's app-defaults directory, ! often found in /usr/lib/X11/app-defaults ! ! The main RowColumn *SpinBoxs.orientation: XmHORIZONTAL *SpinBoxs.packing: XmPACK_TIGHT ! Labels for the two spin boxes *label2.labelString: Date: *label3.labelString: Time: ! Arrow layout for spinboxes *XmSpinBox.alignment: XmALIGNMENT_END *XmSpinBox.arrowLayout: XmARROWS_SPLIT ! This can be changed to run the date command to update the ! system date/time. Usually this must be run as superuser *dateCommand: echo "Date is now: %s in date command format" motif-2.3.8/demos/programs/Paned/0000755000175000017500000000000013211513007013624 500000000000000motif-2.3.8/demos/programs/Paned/Makefile.in0000644000175000017500000005506013211512766015632 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = paned$(EXEEXT) subdir = demos/programs/Paned ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_paned_OBJECTS = creation-c.$(OBJEXT) paned.$(OBJEXT) paned_OBJECTS = $(am_paned_OBJECTS) paned_LDADD = $(LDADD) paned_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(paned_SOURCES) DIST_SOURCES = $(paned_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Paned2 build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Paned2 datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = paned_SOURCES = creation-c.c paned.c data_DATA = $(EXTRA_DIST) $(paned_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Paned/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Paned/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list paned$(EXEEXT): $(paned_OBJECTS) $(paned_DEPENDENCIES) $(EXTRA_paned_DEPENDENCIES) @rm -f paned$(EXEEXT) $(AM_V_CCLD)$(LINK) $(paned_OBJECTS) $(paned_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creation-c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paned.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Paned/creation-c.c0000644000175000017500000003511012672140200015735 00000000000000/* * Generated by the ICS builderXcessory (BX). * * * Builder Xcessory 3.0A. * */ /* * MOTIF include files needed for widget creation. */ #include #include #include #include #include #include #include #include /* * Function: BxRegisterConverters() * Registers all the converters for all widgets. */ static void BxRegisterConverters() { XtInitializeWidgetClass(xmPushButtonWidgetClass); XtInitializeWidgetClass(xmToggleButtonWidgetClass); XtInitializeWidgetClass(xmLabelWidgetClass); XtInitializeWidgetClass(xmFrameWidgetClass); XtInitializeWidgetClass(xmFormWidgetClass); XtInitializeWidgetClass(xmRowColumnWidgetClass); XtInitializeWidgetClass(xmPanedWidgetClass); XtInitializeWidgetClass(topLevelShellWidgetClass); } /* * Function prototypes for routines * located in utilities file. */ extern XtPointer CONVERT(); extern void MENU_POST(); /* * Callback procedure declarations */ extern void CreateLabel(); extern void OtherResCB(); extern void ConstraintResCB(); extern void OrientChValCB(); extern void SepValChCB(); extern void QuitCB(); extern void SashValChCB(); /* * Function: Createpaned() * Create paned hierarchy of widgets. */ Widget Createpaned( parent) Widget parent; { Arg args[512]; Cardinal argcnt; Boolean argok; Widget retval; Widget paned; Widget pane_form_zero; Widget frame1; Widget label_one; Widget sash_one_tog; Widget pane_form_one; Widget frame2; Widget label_two; Widget sash_two_tog; Widget pane_form_three; Widget frame3; Widget label_three; Widget sash_three_tog; argok = False; BxRegisterConverters(); argcnt = 0; paned = XtCreateWidget("paned", xmPanedWidgetClass, parent, args, argcnt); retval = paned; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; pane_form_zero = XtCreateWidget("pane_form_zero", xmFormWidgetClass, paned, args, argcnt); XtManageChild(pane_form_zero); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNbottomOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 9); argcnt++; XtSetArg(args[argcnt], XmNx, 10); argcnt++; sash_one_tog = XtCreateWidget("sash_one_tog", xmToggleButtonWidgetClass, pane_form_zero, args, argcnt); XtAddCallback(sash_one_tog, XmNvalueChangedCallback, SashValChCB, (XtPointer)0); XtManageChild(sash_one_tog); argcnt = 0; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNx, 10); argcnt++; XtSetArg(args[argcnt], XmNy, 10); argcnt++; frame1 = XtCreateWidget("frame1", xmFrameWidgetClass, pane_form_zero, args, argcnt); XtManageChild(frame1); argcnt = 0; XtSetArg(args[argcnt], XmNx, 2); argcnt++; XtSetArg(args[argcnt], XmNy, 2); argcnt++; label_one = XtCreateWidget("label_one", xmLabelWidgetClass, frame1, args, argcnt); XtManageChild(label_one); argcnt = 0; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, frame1); argcnt++; XtSetValues(sash_one_tog, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; pane_form_one = XtCreateWidget("pane_form_one", xmFormWidgetClass, paned, args, argcnt); XtManageChild(pane_form_one); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNbottomOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNx, 10); argcnt++; sash_two_tog = XtCreateWidget("sash_two_tog", xmToggleButtonWidgetClass, pane_form_one, args, argcnt); XtAddCallback(sash_two_tog, XmNvalueChangedCallback, SashValChCB, (XtPointer)0); XtManageChild(sash_two_tog); argcnt = 0; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 11); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNx, 11); argcnt++; XtSetArg(args[argcnt], XmNy, 10); argcnt++; frame2 = XtCreateWidget("frame2", xmFrameWidgetClass, pane_form_one, args, argcnt); XtManageChild(frame2); argcnt = 0; XtSetArg(args[argcnt], XmNx, 2); argcnt++; XtSetArg(args[argcnt], XmNy, 2); argcnt++; label_two = XtCreateWidget("label_two", xmLabelWidgetClass, frame2, args, argcnt); XtManageChild(label_two); argcnt = 0; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, frame2); argcnt++; XtSetValues(sash_two_tog, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; pane_form_three = XtCreateWidget("pane_form_three", xmFormWidgetClass, paned, args, argcnt); XtManageChild(pane_form_three); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNbottomOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNx, 10); argcnt++; sash_three_tog = XtCreateWidget("sash_three_tog", xmLabelWidgetClass, pane_form_three, args, argcnt); XtManageChild(sash_three_tog); argcnt = 0; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNx, 10); argcnt++; XtSetArg(args[argcnt], XmNy, 10); argcnt++; frame3 = XtCreateWidget("frame3", xmFrameWidgetClass, pane_form_three, args, argcnt); XtManageChild(frame3); argcnt = 0; XtSetArg(args[argcnt], XmNx, 2); argcnt++; XtSetArg(args[argcnt], XmNy, 2); argcnt++; label_three = XtCreateWidget("label_three", xmLabelWidgetClass, frame3, args, argcnt); XtManageChild(label_three); argcnt = 0; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, frame3); argcnt++; XtSetValues(sash_three_tog, args, argcnt); return( retval ); } /* * Function: Createform() * Create form hierarchy of widgets. */ Widget Createform( parent) Widget parent; { Arg args[512]; Cardinal argcnt; Boolean argok; Widget retval; Widget form; Widget frame; Widget hype_label; Widget res_frame; Widget res_rowcol; Widget orient_rc; Widget orient_label; Widget horiz_tog; Widget vert_tog; Widget sep_rc; Widget sep_label; Widget sep_on_tog; Widget sep_off_tog; Widget other_rc; Widget other_res; Widget cons_res; Widget quit_pb; argok = False; BxRegisterConverters(); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNx, 171); argcnt++; XtSetArg(args[argcnt], XmNy, 212); argcnt++; form = XtCreateWidget("form", xmFormWidgetClass, parent, args, argcnt); retval = form; argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNbottomOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 1); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 20); argcnt++; res_frame = XtCreateWidget("res_frame", xmFrameWidgetClass, form, args, argcnt); XtManageChild(res_frame); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 10); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 20); argcnt++; frame = XtCreateWidget("frame", xmFrameWidgetClass, form, args, argcnt); XtManageChild(frame); argcnt = 0; hype_label = XtCreateWidget("hype_label", xmLabelWidgetClass, frame, args, argcnt); CreateLabel(hype_label, (XtPointer)0, (XtPointer)0); XtManageChild(hype_label); argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; XtSetArg(args[argcnt], XmNx, 2); argcnt++; XtSetArg(args[argcnt], XmNy, 2); argcnt++; res_rowcol = XtCreateWidget("res_rowcol", xmRowColumnWidgetClass, res_frame, args, argcnt); XtManageChild(res_rowcol); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNpacking, XmPACK_TIGHT); argcnt++; XtSetArg(args[argcnt], XmNradioBehavior, True); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; orient_rc = XtCreateWidget("orient_rc", xmRowColumnWidgetClass, res_rowcol, args, argcnt); XtManageChild(orient_rc); argcnt = 0; XtSetArg(args[argcnt], XmNx, 3); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; orient_label = XtCreateWidget("orient_label", xmLabelWidgetClass, orient_rc, args, argcnt); XtManageChild(orient_label); argcnt = 0; XtSetArg(args[argcnt], XmNx, 82); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; horiz_tog = XtCreateWidget("horiz_tog", xmToggleButtonWidgetClass, orient_rc, args, argcnt); XtAddCallback(horiz_tog, XmNvalueChangedCallback, OrientChValCB, (XtPointer)XmHORIZONTAL); XtManageChild(horiz_tog); argcnt = 0; XtSetArg(args[argcnt], XmNx, 164); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; vert_tog = XtCreateWidget("vert_tog", xmToggleButtonWidgetClass, orient_rc, args, argcnt); XtAddCallback(vert_tog, XmNvalueChangedCallback, OrientChValCB, (XtPointer)XmVERTICAL); XtManageChild(vert_tog); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNpacking, XmPACK_TIGHT); argcnt++; XtSetArg(args[argcnt], XmNradioBehavior, True); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; sep_rc = XtCreateWidget("sep_rc", xmRowColumnWidgetClass, res_rowcol, args, argcnt); XtManageChild(sep_rc); argcnt = 0; XtSetArg(args[argcnt], XmNx, 3); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; sep_label = XtCreateWidget("sep_label", xmLabelWidgetClass, sep_rc, args, argcnt); XtManageChild(sep_label); argcnt = 0; XtSetArg(args[argcnt], XmNx, 64); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; sep_on_tog = XtCreateWidget("sep_on_tog", xmToggleButtonWidgetClass, sep_rc, args, argcnt); XtAddCallback(sep_on_tog, XmNvalueChangedCallback, SepValChCB, (XtPointer)True); XtManageChild(sep_on_tog); argcnt = 0; XtSetArg(args[argcnt], XmNx, 152); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; sep_off_tog = XtCreateWidget("sep_off_tog", xmToggleButtonWidgetClass, sep_rc, args, argcnt); XtAddCallback(sep_off_tog, XmNvalueChangedCallback, SepValChCB, (XtPointer)False); XtManageChild(sep_off_tog); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; other_rc = XtCreateWidget("other_rc", xmRowColumnWidgetClass, res_rowcol, args, argcnt); XtManageChild(other_rc); argcnt = 0; XtSetArg(args[argcnt], XmNx, 3); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; other_res = XtCreateWidget("other_res", xmPushButtonWidgetClass, other_rc, args, argcnt); XtAddCallback(other_res, XmNactivateCallback, OtherResCB, (XtPointer)0); XtManageChild(other_res); argcnt = 0; XtSetArg(args[argcnt], XmNx, 72); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; cons_res = XtCreateWidget("cons_res", xmPushButtonWidgetClass, other_rc, args, argcnt); XtAddCallback(cons_res, XmNactivateCallback, ConstraintResCB, (XtPointer)0); XtManageChild(cons_res); argcnt = 0; XtSetArg(args[argcnt], XmNx, 135); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; quit_pb = XtCreateWidget("quit_pb", xmPushButtonWidgetClass, other_rc, args, argcnt); XtAddCallback(quit_pb, XmNactivateCallback, QuitCB, (XtPointer)0); XtManageChild(quit_pb); argcnt = 0; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, frame); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 1); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, frame); argcnt++; XtSetValues(res_frame, args, argcnt); return( retval ); } motif-2.3.8/demos/programs/Paned/paned.c0000644000175000017500000002450513066310437015017 00000000000000/* * Copyright 1994, Integrated Computer Solutions, Inc. * * All Rights Reserved. * * Author: Rick Umali * * paned.c * */ /************************************************************** * INCLUDE FILES **************************************************************/ #include #include #include #include #include #include #include /************************************************************** * GLOBALS **************************************************************/ Widget G_paned = NULL; Widget G_form = NULL; /************************************************************** * FORWARD DECLARATIONS **************************************************************/ Widget Createform(Widget); Widget Createpaned(Widget); /************************************************************** * DEFINES **************************************************************/ /************************************************************** * FALLBACKS **************************************************************/ static String fallbacks[] = { /* * General fallback resources. */ "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*hype_label*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*orient_label.labelString: Orientation:", "*horiz_tog.labelString: XmHORIZONTAL", "*vert_tog.labelString: XmVERTICAL", "*sep_label.labelString: Show Separator:", "*sep_on_tog.labelString: True", "*sep_off_tog.labelString: False", "*other_res.labelString: Other Resources...", "*cons_res.labelString: Constraint Resources...", "*quit_pb.labelString: Quit", "*XmPaned*XmForm*XmLabel.labelString: Motif Paned Widget", "*XmPaned*XmForm*XmToggleButton.labelString: Show Sash", "*XmPaned*XmForm*sash_three_tog.labelString: Pane Demo", NULL, }; /************************************************************** * PUBLIC (GLOBAL) CODE **************************************************************/ /* * Function Name: InitControls * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void InitControls() { Arg args[5]; Cardinal argcnt; Widget w; argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; XtSetArg(args[argcnt], XmNseparatorOn, True); argcnt++; XtSetValues(G_paned, args, argcnt); w = XtNameToWidget(G_form, "*vert_tog"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find vert_tog"); exit(1); } XmToggleButtonSetState(w, True, False); w = XtNameToWidget(G_form, "*sep_on_tog"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find sep_on_tog"); exit(1); } XmToggleButtonSetState(w, True, False); w = XtNameToWidget(G_paned, "*pane_form_zero"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find pane_form_zero"); exit(1); } argcnt = 0; XtSetArg(args[argcnt], XmNshowSash, True); argcnt++; XtSetValues(w, args, argcnt); w = XtNameToWidget(G_paned, "*sash_one_tog"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find sash_one_tog"); exit(1); } XmToggleButtonSetState(w, True, False); w = XtNameToWidget(G_paned, "*pane_form_one"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find pane_form_one"); exit(1); } argcnt = 0; XtSetArg(args[argcnt], XmNshowSash, True); argcnt++; XtSetValues(w, args, argcnt); w = XtNameToWidget(G_paned, "*sash_two_tog"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find sash_two_tog"); exit(1); } XmToggleButtonSetState(w, True, False); w = XtNameToWidget(G_paned, "*pane_form_three"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find pane_form_three"); exit(1); } argcnt = 0; XtSetArg(args[argcnt], XmNshowSash, True); argcnt++; XtSetValues(w, args, argcnt); w = XtNameToWidget(G_paned, "*sash_three_tog"); if (w == NULL) { fprintf(stderr, "InitControls: Unable to find sash_three_tog"); exit(1); } XmToggleButtonSetState(w, True, False); } /* * Function Name: SashValChCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void SashValChCB(Widget w, XtPointer client, XtPointer call) { /* * BE CAREFUL...ASSUMES THIS WIDGET IS CHILD OF FORM, WHICH IS CHILD * OF A XI PANED */ Arg args[5]; Cardinal argcnt; Widget parent = XtParent(w); argcnt = 0; XtSetArg(args[argcnt], XmNshowSash, XmToggleButtonGetState(w)); argcnt++; XtSetValues(parent, args, argcnt); } /* * Function Name: SepValChCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void SepValChCB(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; Boolean val = (Boolean) (unsigned)client; if (!XmToggleButtonGetState(w)) return; argcnt = 0; XtSetArg(args[argcnt], XmNseparatorOn, val); argcnt++; XtSetValues(G_paned, args, argcnt); } /* * Function Name: OrientChValCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void OrientChValCB(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; unsigned char orient = (unsigned char) (unsigned)client; if (!XmToggleButtonGetState(w)) return; argcnt = 0; XtSetArg(args[argcnt], XmNorientation, orient); argcnt++; XtSetValues(G_paned, args, argcnt); } /* * Function Name: ConstraintResCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void ConstraintResCB(Widget w, XtPointer client, XtPointer call) { static Widget info = NULL; if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Paned Widget adds \"constraint\" widgets to any children that are\n\ inside it. Here's the list of available constraint resources:\n\ \n\ Resource (Type)\n\ allowResize (Boolean) - Allows/Disallows children geometry changes\n\ paneMaximum, paneMinimum (Dimension)\n\ preferredPaneSize (Dimension)\n\ resizeToPreferred (Boolean)\n\ showSash (Boolean) - To see behavior, press \"Show Sash\" toggle\n\ skipAdjust (Boolean)", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateInformationDialog(w, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XmStringFree(xmstring); } XtManageChild(info); } /* * Function Name: OtherResCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void OtherResCB(Widget w, XtPointer client, XtPointer call) { static Widget info = NULL; if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Paned widget provides other resources. Here's a partial\n\ list of available resources:\n\ \n\ Resource (Type)\n\ cursor (Cursor) - Cursor to use over Motif Paned\n\ marginHeight, marginWidth (Dimension)\n\ sashHeight (Position)\n\ sashShawdowThickness (Dimension)", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateInformationDialog(w, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XmStringFree(xmstring); } XtManageChild(info); } /* * Function Name: CreateLabel * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void CreateLabel(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Paned Widget extends the capabilities of the standard Paned\n\ Window that comes with Motif.\n\ \n\ The Motif Paned Widget offers horizontal as well as vertical orientation,\n\ (the Motif Paned widget only offers a vertical orientation). To see the\n\ two forms of orienation, press the XmHORIZONTAL or XmVERTICAL toggles.\n\ \n\ The Motif Paned Widget can be used as a \"smarter\" Row Column widget, by\n\ turning off the separators between panes. Press the True or False toggles\n\ to see this behavior.", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNmarginHeight, 10); argcnt++; XtSetArg(args[argcnt], XmNmarginWidth, 10); argcnt++; XtSetArg(args[argcnt], XmNalignment, XmALIGNMENT_BEGINNING); argcnt++; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; XtSetValues(w, args, argcnt); XmStringFree(xmstring); } /* * Function Name: QuitCB * Description: Exits the program * Arguments: This is an XtCallback * Returns: Nothing */ void QuitCB(Widget w, XtPointer client, XtPointer call) { exit(0); } /* * Function Name: main * Description: * Arguments: the usual suspects * Returns: nothing * */ int main(int argc, char **argv) { Arg args[5]; Cardinal argcnt; Widget top, paned_top, w; XtAppContext app; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; XtSetArg(args[argcnt], XmNtitle, "Motif Paned Widget Demo"); argcnt++; top = XtOpenApplication(&app, "Paned", NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, args, argcnt); G_form = Createform(top); XtManageChild(G_form); argcnt = 0; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; XtSetArg(args[argcnt], XmNtitle, "Motif Paned Widget Demo"); argcnt++; paned_top = XtAppCreateShell("paned_top", "Paned_Top", topLevelShellWidgetClass, XtDisplay(top), args, argcnt); G_paned = Createpaned(paned_top); XtManageChild(G_paned); InitControls(); XtRealizeWidget(top); XtRealizeWidget(paned_top); XtAppMainLoop(app); return(0); } motif-2.3.8/demos/programs/Paned/Makefile.am0000644000175000017500000000052513145162623015614 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Paned2 datadir = ${prefix}/share/Xm/Paned2 EXTRA_DIST = bin_PROGRAMS = paned paned_SOURCES = creation-c.c paned.c data_DATA = $(EXTRA_DIST) $(paned_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/drag_and_drop/0000755000175000017500000000000013211513007015360 500000000000000motif-2.3.8/demos/programs/drag_and_drop/Makefile.in0000644000175000017500000005643613211512766017376 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = DNDDemo$(EXEEXT) simpledrop$(EXEEXT) subdir = demos/programs/drag_and_drop ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_DNDDemo_OBJECTS = DNDDemo.$(OBJEXT) DNDDraw.$(OBJEXT) DNDDemo_OBJECTS = $(am_DNDDemo_OBJECTS) DNDDemo_LDADD = $(LDADD) DNDDemo_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_simpledrop_OBJECTS = simpledrop.$(OBJEXT) simpledrop_OBJECTS = $(am_simpledrop_OBJECTS) simpledrop_LDADD = $(LDADD) simpledrop_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(DNDDemo_SOURCES) $(simpledrop_SOURCES) DIST_SOURCES = $(DNDDemo_SOURCES) $(simpledrop_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/drag_and_drop build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/drag_and_drop datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = simpledrop.man DNDDemo.man README DNDDemo_SOURCES = DNDDemo.c DNDDraw.c simpledrop_SOURCES = simpledrop.c data_DATA = $(EXTRA_DIST) $(DNDDemo_SOURCES) $(simpledrop_SOURCES) noinst_HEADERS = DNDDemo.h LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/drag_and_drop/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/drag_and_drop/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list DNDDemo$(EXEEXT): $(DNDDemo_OBJECTS) $(DNDDemo_DEPENDENCIES) $(EXTRA_DNDDemo_DEPENDENCIES) @rm -f DNDDemo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(DNDDemo_OBJECTS) $(DNDDemo_LDADD) $(LIBS) simpledrop$(EXEEXT): $(simpledrop_OBJECTS) $(simpledrop_DEPENDENCIES) $(EXTRA_simpledrop_DEPENDENCIES) @rm -f simpledrop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simpledrop_OBJECTS) $(simpledrop_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DNDDemo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DNDDraw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpledrop.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/drag_and_drop/DNDDemo.c0000644000175000017500000012376713145162623016710 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: DNDDemo.c /main/8 1996/10/10 16:32:41 drk $" #endif #endif /* * file: DNDDemo.c * * A demo program showing the basic Drag And Drop operations. */ #include "DNDDemo.h" /* * The folowing character arrays are for use with the drop help * dialogs. For internationalization, message catalogs should * replace these static declarations. */ char HELP_MSG1[] = "This drop action will change the color\n\ of the rectangle that the paint palette\n\ icon is dropped on. To accept this drop\n\ press the o.k. button, otherwise press\n\ cancel"; char HELP_MSG2[] = "This drop action will move the rectangle\n\ to the new position. To accept this drop\n\ press the o.k. button, otherwise press\n\ cancel"; char HELP_MSG3[] = "This drop action will copy the rectangle\n\ to the new position. To accept this drop\n\ press the o.k. button, otherwise press\n\ cancel"; char HELP_MSG4[] = "This drop action can either copy or\n\ move the rectangle to the new position.\n\ Select the operation that you desire.\n\ In the future, use Ctrl with Btn2 to\n\ perform copy operations. The default\n\ operation is move. To accept this drop\n\ press the o.k. button, otherwise press\n\ cancel"; char HELP_MSG5[] = "This drop action is at an Invalid drop\n\ position. Please cancel this drop \n\ by pressing the cancel button."; /* Globals variables */ Widget topLevel; Widget drawingArea; Widget helpDialog = NULL; Widget helpLabel, helpMenu; Widget myDC; XtAppContext appContext; XmDestinationCallbackStruct *savedCB; /* This function creates the Drag Icon. */ static Widget GetDragIcon(Widget w, Pixmap icon, Pixmap iconMask, Dimension width, Dimension height, Pixel background, Pixel foreground) { Widget dragIcon; Arg args[10]; int n = 0; XtSetArg(args[n], XmNhotX, ICON_X_HOT); n++; XtSetArg(args[n], XmNhotY, ICON_Y_HOT); n++; XtSetArg(args[n], XmNwidth, width); n++; XtSetArg(args[n], XmNheight, height); n++; XtSetArg(args[n], XmNmaxWidth, appInfo->maxCursorWidth); n++; XtSetArg(args[n], XmNmaxHeight, appInfo->maxCursorHeight); n++; XtSetArg(args[n], XmNbackground, background); n++; XtSetArg(args[n], XmNforeground, foreground); n++; XtSetArg(args[n], XmNpixmap, icon); n++; if (iconMask != XmUNSPECIFIED_PIXMAP && iconMask != None) { XtSetArg(args[n], XmNmask, iconMask); n++; } dragIcon = XmCreateDragIcon(w, "dragIcon", args, n); return(dragIcon); } /* This function creates the bitmaps for the icon and the mask * and then calls GetDragIcon() to create the drag icon. */ static Widget GetDragIconFromBits(Widget w, char *bits, char *mask, Dimension width, Dimension height, Pixel background, Pixel foreground) { Pixmap icon, iconMask; Display *display = XtDisplay(w); icon = XCreateBitmapFromData(display, DefaultRootWindow(display), bits, width, height); iconMask = XCreateBitmapFromData(display, DefaultRootWindow(display), mask, width, height); return(GetDragIcon(w, icon, iconMask, width, height, background, foreground)); } /* This function creates the rectangle bitmaps for the icon and * the mask based on the maximum server allowable cursor size * and then calls GetDragIcon() to create the drag icon. */ static Widget GetDragIconFromRect(Widget w, RectPtr rect, Pixel background) { Pixmap icon; Pixel foreground = RectGetColor(rect); Dimension width, height; /* Create a depth 1 pixmap (bitmap) for use with the drag icon */ icon = GetBitmapFromRect(w, rect, background, foreground, &width, &height); /* use bitmap for both the bitmap and mask */ return(GetDragIcon(w, icon, None, width, height, background, foreground)); } /* This is a selection conversion function that is used in * converting drag/drop export background color targets. * The return types follow ICCC statndards. */ /* ARGSUSED */ void ColorConvert(Widget widget, XtPointer ignore, XmConvertCallbackStruct *cs) { Display *display = XtDisplay(widget); Atom BACKGROUND = XInternAtom(display, "BACKGROUND", False); Atom PIXEL = XInternAtom(display, "PIXEL", False); Atom TARGETS = XInternAtom(display, "TARGETS", False); Atom ME_TARGETS = XInternAtom(display, XmS_MOTIF_EXPORT_TARGETS, False); if (cs -> target == BACKGROUND) { /* Get widget's background */ Pixel *background; background = (Pixel *) XtMalloc(sizeof(Pixel)); XtVaGetValues(widget, XmNbackground, background, NULL, NULL); /* value, type, length, and format must be set */ cs -> value = (XtPointer) background; cs -> type = PIXEL; cs -> length = sizeof(Pixel); cs -> format = 32; } else if (cs -> target == TARGETS || cs -> target == ME_TARGETS) { /* This target is required by ICCCM */ Atom *targs; int target_count = 0; if (cs -> target == ME_TARGETS) targs = (Atom *)XtMalloc((unsigned) (1 * sizeof(Atom))); else targs = XmeStandardTargets(widget, 1, &target_count); targs[target_count++] = BACKGROUND; cs -> value = (XtPointer) targs; cs -> length = target_count; cs -> format = 32; cs -> type = XA_ATOM; cs -> status = XmCONVERT_DONE; } else cs -> status = XmCONVERT_REFUSE; } /* This callback procedure resets the drag icon cursor to show * when the drag is in a valid region . It cause the * state icon to become visible when a drop is at a valid * position for drag over effects. */ static void DragMotionCallback(Widget w, XtPointer client, XtPointer call) { XmDragMotionCallback cb = (XmDragMotionCallback) call; Arg args[2]; Widget stateIcon, invalidIcon; if (cb->dropSiteStatus == XmVALID_DROP_SITE) { stateIcon = (Widget) client; XtSetArg(args[0], XmNblendModel, XmBLEND_STATE_SOURCE); XtSetArg(args[1], XmNstateCursorIcon, stateIcon); XtSetValues(w, args, 2); } else if (cb->dropSiteStatus == XmINVALID_DROP_SITE) { XtSetArg(args[0], XmNdefaultInvalidCursorIcon, &invalidIcon); XtGetValues(XmGetXmScreen(XtScreen(w)), args, 1); XtSetArg(args[0], XmNblendModel, XmBLEND_STATE_SOURCE); XtSetArg(args[1], XmNstateCursorIcon, invalidIcon); XtSetValues(w, args, 2); } else { XtSetArg(args[0], XmNblendModel, XmBLEND_JUST_SOURCE); XtSetValues(w, args, 1); } } /* This callback procedure resets the drag icon cursor to show * when the drag is in a valid region . It cause the * state icon to become visible when a drop is at a valid * position for drag over effects. */ /* ARGSUSED */ static void DropSiteLeaveCallback(Widget w, XtPointer client, XtPointer call) { Arg args[1]; XtSetArg(args[0], XmNblendModel, XmBLEND_JUST_SOURCE); XtSetValues(w, args, 1); } /* This callback procedure removes the icons when the drop is complete */ /* ARGSUSED */ static void ColorDragDropFinishCB(Widget w, XtPointer client, XtPointer call) { Widget sourceIcon; Widget stateIcon = (Widget) client; Arg args[1]; XtSetArg(args[0], XmNsourceCursorIcon, &sourceIcon); XtGetValues(w, args, 1); XtDestroyWidget(sourceIcon); XtDestroyWidget(stateIcon); } /* This action procedure sets up the drag data and begins the drag operation */ /* ARGSUSED */ void ColorRect(Widget w, XEvent *event, String *params, Cardinal *num_params) { static XtCallbackRec dragDropFinishCB[] = { {ColorDragDropFinishCB, NULL}, {NULL, NULL} }; static XtCallbackRec dragMotionCB[] = { {DragMotionCallback, NULL}, {NULL, NULL} }; static XtCallbackRec dropSiteLeaveCB[] = { {DropSiteLeaveCallback, NULL}, {NULL, NULL} }; Atom targets[1]; Widget sourceIcon, stateIcon; Pixel background, foreground; char *source_bits, *source_mask; char *state_bits, *state_mask; Dimension width, height; Arg args[16]; int n = 0; n = 0; XtSetArg(args[n], XmNbackground, &background); n++; XtSetArg(args[n], XmNforeground, &foreground); n++; XtGetValues(w, args, n); /* If the server will handle a large icon, create one */ if (appInfo->maxCursorWidth >= ICON_WIDTH && appInfo->maxCursorHeight >= ICON_HEIGHT) { source_bits = (char *)SOURCE_ICON_BITS; source_mask = (char *)SOURCE_ICON_MASK; state_bits = (char *)STATE_ICON_BITS; state_mask = (char *)STATE_ICON_MASK; width = ICON_WIDTH; height = ICON_HEIGHT; } else { /* If the server will handle a small icon, create one */ source_bits = (char *)SMALL_SOURCE_ICON_BITS; source_mask = (char *)SMALL_SOURCE_ICON_MASK; state_bits = (char *)SMALL_STATE_ICON_BITS; state_mask = (char *)SMALL_STATE_ICON_MASK; width = SMALL_ICON_WIDTH; height = SMALL_ICON_HEIGHT; } /* Create the drag cursor icons */ sourceIcon = GetDragIconFromBits(w, source_bits, source_mask, width, height, background, foreground); stateIcon = GetDragIconFromBits(w, state_bits, state_mask, width, height, background, foreground); /* Setup the arglist for the drag context that is created at drag start */ n = 0; /* initially only show the source icon */ XtSetArg(args[n], XmNblendModel, XmBLEND_JUST_SOURCE); n++; /* set cursor colors for the drag states */ XtSetArg(args[n], XmNvalidCursorForeground, GetColor(VALID_CURSOR_FG_COLOR)); n++; XtSetArg(args[n], XmNinvalidCursorForeground, GetColor(INVALID_CURSOR_FG_COLOR)); n++; XtSetArg(args[n], XmNnoneCursorForeground, GetColor(NONE_CURSOR_FG_COLOR)); n++; /* set args for the drag cursor icons */ XtSetArg(args[n], XmNcursorBackground, background); n++; XtSetArg(args[n], XmNcursorForeground, foreground); n++; XtSetArg(args[n], XmNsourceCursorIcon, sourceIcon); n++; XtSetArg(args[n], XmNstateCursorIcon, stateIcon); n++; /* identify the necessary callbacks */ dragDropFinishCB[0].closure = (XtPointer) stateIcon; XtSetArg(args[n], XmNdragDropFinishCallback, dragDropFinishCB); n++; dragMotionCB[0].closure = (XtPointer) stateIcon; XtSetArg(args[n], XmNdragMotionCallback, dragMotionCB); n++; XtSetArg(args[n], XmNdropSiteLeaveCallback, dragMotionCB); n++; /* set the drag operations that are supported */ XtSetArg(args[n], XmNdragOperations, XmDROP_COPY); n++; /* start the drag. This creates a drag context. */ myDC = XmeDragSource(w, NULL, event, args, n); } /* * This is a selection conversion function that is used in * converting requests for rectangle targets. The return types follow * ICCCM standards. */ /* ARGSUSED */ void RectConvert(Widget widget, XtPointer ignore, XmConvertCallbackStruct *cs) { Display *display = XtDisplay(widget); Atom MY_RECT = XmInternAtom(display, "_MY_RECTANGLE", False); Atom RECT_INFO = XmInternAtom(display, "RECT_INFO", False); Atom DELETE = XmInternAtom(display, "DELETE", False); Atom TARGETS = XmInternAtom(display, "TARGETS", False); Atom ME_TARGETS = XmInternAtom(display, XmS_MOTIF_EXPORT_TARGETS, False); Atom *targs; int target_count; Arg args[1]; RectPtr rect, oldRect; if (cs -> target == MY_RECT) { /* Create a new rectangle using information from the old retangle */ oldRect = (RectPtr) cs -> location_data; /* We create create a new rectangle and wait for a delete target on the * old rectangle instead of just moving the old rectangle because * the rectangle movement might be an interclient move. */ rect = RectCreate(oldRect->x, oldRect->y, oldRect->width, oldRect->height, oldRect->color, oldRect->pixmap); /* value, type, length, and format must be assigned values */ cs -> value = (XtPointer) rect; cs -> type = RECT_INFO; cs -> length = sizeof(*rect)/sizeof(long); cs -> format = 32; cs -> status = XmCONVERT_DONE; } else if (cs -> target == DELETE) { /* delete the old rectangle */ RectHide(XtDisplay(widget), XtWindow(widget), cs -> location_data); RectFree(cs -> location_data); /* * DELETE target return parameters MUST be assigned as follows to * ICCCM compliant. */ cs -> value = NULL; cs -> type = XmInternAtom(XtDisplay(widget), "NULL", False); cs -> length = 0; cs -> format = 8; cs -> status = XmCONVERT_DONE; } else if (cs -> target == TARGETS || cs -> target == ME_TARGETS) { /* This target is required by ICCCM */ Atom *targs; int target_count = 0; if (cs -> target == ME_TARGETS) targs = (Atom *)XtMalloc((unsigned) (1 * sizeof(Atom))); else targs = XmeStandardTargets(widget, 1, &target_count); targs[target_count++] = MY_RECT; cs -> value = (XtPointer) targs; cs -> length = target_count; cs -> format = 32; cs -> type = XA_ATOM; cs -> status = XmCONVERT_DONE; } else cs -> status = XmCONVERT_REFUSE; } /* This callback procedure removes the old cursor icon */ /* ARGSUSED */ static void RectDragDropFinishCB(Widget w, XtPointer client, XtPointer call) { Widget sourceCursorIcon; Arg args[1]; XtSetArg(args[0], XmNsourceCursorIcon, &sourceCursorIcon); XtGetValues(w, args, 1); XtDestroyWidget(sourceCursorIcon); /* Free temp data */ XtFree(client); } /* This callback procedure redraws the rectangles once the drop is completed */ /* ARGSUSED */ static void RectDropFinishCB(Widget w, XtPointer client, XtPointer call) { Widget redraw = (Widget) client; appInfo->clearRect = NULL; appInfo->doMove = True; RedrawRectangles(redraw); } /* This callback procedure handle the drawing of the target * rectangle depending of the dropSiteStatus for drag over * effects. */ /* ARGSUSED */ static void RectDragMotionCB(Widget w, XtPointer client, XtPointer call) { XmDragMotionCallback cb = (XmDragMotionCallback) call; DragConvertPtr conv = (DragConvertPtr) client; Display *display; Window window; RectPtr rect; if (cb->dropSiteStatus == XmVALID_DROP_SITE) { /* re-stipple the rectangle when the poitner is inside the drop site */ if ( appInfo->clearRect == NULL && appInfo->doMove) { display = XtDisplay(conv->widget); window = XtWindow(conv->widget); rect = conv->rect; RectHide(display, window, rect); RectDrawStippled(display, window, rect); } } else { /* re-fill the rectangle when the poitner is outside the drop site */ if (appInfo->clearRect != NULL && appInfo->doMove) { appInfo->clearRect = NULL; RedrawRectangles(conv->widget); } } } /* This callback procedure handle the drawing of the target * rectangle When the operation changes. */ /* ARGSUSED */ static void RectOperationChangedCB(Widget w, XtPointer client, XtPointer call) { XmDragMotionCallback cb = (XmDragMotionCallback) call; DragConvertPtr conv = (DragConvertPtr) client; Display *display; Window window; RectPtr rect; /* re-stipple the rectangle when the poitner is inside the drop site */ if ( appInfo->clearRect == NULL && appInfo->doMove) { display = XtDisplay(conv->widget); window = XtWindow(conv->widget); rect = conv->rect; RectHide(display, window, rect); RectDrawStippled(display, window, rect); } /* re-fill the rectangle when the operation changes to copy */ if (appInfo->clearRect != NULL && !appInfo->doMove) { appInfo->clearRect = NULL; RedrawRectangles(conv->widget); } } /* This action procedure sets up the drag data and begins the drag operation */ /* ARGSUSED */ static void StartMove(Widget w, XEvent *event, String *params, Cardinal *num_params) { RectPtr rect; Position x = event->xbutton.x; Position y = event->xbutton.y; static XtCallbackRec dragDropFinishCB[] = { {RectDragDropFinishCB, NULL}, {NULL, NULL} }; static XtCallbackRec dropFinishCB[] = { {RectDropFinishCB, NULL}, {NULL, NULL} }; static XtCallbackRec dragMotionCB[] = { {RectDragMotionCB, NULL}, {NULL, NULL} }; static XtCallbackRec operationChangedCB[] = { {RectOperationChangedCB, NULL}, {NULL, NULL} }; Atom targets[1]; Display *display = XtDisplay(w); Widget sourceCursorIcon; DragConvertPtr conv; Pixel background, foreground; Arg args[16]; int n = 0; /* find a rectangle at the given x,y position */ rect = RectFind(x, y); /* start move only if it begins on a rectangle */ if (rect) { XtSetArg(args[0], XmNbackground, &background); XtGetValues(w, args, 1); foreground = RectGetColor(rect); sourceCursorIcon = GetDragIconFromRect(w, rect, background); /* On a move operation, draw the current * rectangle as a stippled outline. */ if (!(event->xbutton.state & ControlMask)) { RectHide(display, XtWindow(w), rect); RectDrawStippled(display, XtWindow(w), rect); } else appInfo->doMove = False; /* Setup arglist for the drag context that is created at drag start */ n = 0; /* initially only show the source icon */ XtSetArg(args[n], XmNblendModel, XmBLEND_JUST_SOURCE); n++; /* set args for the drag cursor icons */ XtSetArg(args[n], XmNcursorBackground, background); n++; XtSetArg(args[n], XmNcursorForeground, foreground); n++; XtSetArg(args[n], XmNsourceCursorIcon, sourceCursorIcon); n++; /* * Set up information to pass to the convert * function and callback procs. */ conv = (DragConvertPtr) XtMalloc(sizeof(DragConvertRec)); conv->widget = w; conv->rect = rect; /* identify the necessary callbacks and the client data to be passed */ dragDropFinishCB[0].closure = (XtPointer) conv; XtSetArg(args[n], XmNdragDropFinishCallback, dragDropFinishCB); n++; dropFinishCB[0].closure = (XtPointer) w; XtSetArg(args[n], XmNdropFinishCallback, dropFinishCB); n++; dragMotionCB[0].closure = (XtPointer) conv; XtSetArg(args[n], XmNdragMotionCallback, dragMotionCB); n++; operationChangedCB[0].closure = (XtPointer) conv; XtSetArg(args[n], XmNoperationChangedCallback, operationChangedCB); n++; /* set the drag operations that are supported */ XtSetArg(args[n], XmNdragOperations, XmDROP_COPY | XmDROP_MOVE); n++; /* start the drag. This creates a drag context. */ myDC = XmeDragSource(w, (XtPointer) rect, event, args, n); } } /* This procedure searches through the export targets and * returns flags to indicate which targets were found */ /* ARGSUSED */ static void CheckTargets(Widget w, Display *display, Boolean *rectFound, Boolean *bgFound, Boolean *pixFound) { Atom MY_RECT = XmInternAtom(display, "_MY_RECTANGLE", False); Atom BACKGROUND = XmInternAtom(display, "BACKGROUND", False); Atom PIXMAP = XmInternAtom(display, "PIXMAP", False); Atom *exportTargets; Cardinal numExportTargets; Arg args[2]; int n; /* Get list of transfer targets */ n = 0; XtSetArg(args[0], XmNexportTargets, &exportTargets); XtSetArg(args[1], XmNnumExportTargets, &numExportTargets); XtGetValues(w, args, 2); /* initialize targets found flags */ *rectFound = *bgFound = *pixFound = False; /* search through the export targets */ for (n = 0; n < numExportTargets; n++) { if (exportTargets[n] == MY_RECT) *rectFound = True; else if (exportTargets[n] == BACKGROUND) *bgFound = True; else if (exportTargets[n] == PIXMAP) *pixFound = True; } } /* This procedure handles drop site messages and performs the * appropriate drag under effects. */ /* ARGSUSED */ static void DragProcCallback(Widget w, XtPointer client, XtPointer call) { XmDragProcCallbackStruct *cb = (XmDragProcCallbackStruct *) call; Display *display = XtDisplay(w); Boolean rectFound, bgFound, pixFound; static unsigned char initial_operations; static unsigned char initial_operation; RectPtr rect; CheckTargets(cb->dragContext, display, &rectFound, &bgFound, &pixFound); switch(cb->reason) { case XmCR_DROP_SITE_ENTER_MESSAGE: /* save the value of the operations and operation fields */ initial_operations = cb->operations; initial_operation = cb->operation; rect = RectFind(cb->x, cb->y); /* Remove any operations for the operations field which do not * apply to the simulated drop site. */ if (rect) { if (bgFound || pixFound) { cb->operations = XmDROP_COPY; RectHighlight(w, rect); } else if (rectFound) { cb->operations = cb->operations & (XmDROP_COPY | XmDROP_MOVE); RectUnhighlight(w); } } else { cb->operations = initial_operations & (XmDROP_COPY | XmDROP_MOVE); RectUnhighlight(w); } /* Set operation to the valid operation preferred by the simulated * drop site or to XmDROP_NOOP if the operations list does not * contain the preferred operation. */ if (rect) { if (bgFound || pixFound) { if (cb->operations & XmDROP_COPY) cb->operation = XmDROP_COPY; else cb->operation = XmDROP_NOOP; } else if (rectFound) { if (cb->operations & XmDROP_MOVE) cb->operation = XmDROP_MOVE; else if (cb->operations & XmDROP_COPY) cb->operation = XmDROP_COPY; else cb->operation = XmDROP_NOOP; } } else { if (rectFound) { if (cb->operations & XmDROP_MOVE) cb->operation = XmDROP_MOVE; else if (cb->operations & XmDROP_COPY) cb->operation = XmDROP_COPY; else cb->operation = XmDROP_NOOP; } else cb->operation = initial_operation; } /* * Set dropSiteStatus to XmDROP_SITE_INVALID if the operation * field is XmDROP_NOOP, or if there are no common targets * between the source and the nested drop site. Otherwise, set * dropSiteStatus to XmDROP_SITE_VALID. */ if (cb->operation == XmDROP_NOOP || (rect && (!rectFound && !bgFound && !pixFound)) || (!rect && !rectFound)) cb->dropSiteStatus = XmINVALID_DROP_SITE; else cb->dropSiteStatus = XmVALID_DROP_SITE; /* * Display appropriate drag under visuals. Only highlight * the rectangle if we are changing rectangle attributes. */ if ((rect && bgFound) || (pixFound && cb->dropSiteStatus == XmVALID_DROP_SITE)) RectHighlight(w, rect); break; case XmCR_DROP_SITE_LEAVE_MESSAGE: /* Only unhighlight the rectangle if previously highlighted */ if (appInfo->highlightRect != NULL) RectUnhighlight(w); break; case XmCR_DROP_SITE_MOTION_MESSAGE: rect = RectFind(cb->x, cb->y); /* * Remove any operations for the operations field which do not * apply to the simulated drop site. */ if (rect) { if (bgFound || pixFound) { cb->operations = XmDROP_COPY; RectHighlight(w, rect); } else if (rectFound) { cb->operations = cb->operations & (XmDROP_COPY | XmDROP_MOVE); RectUnhighlight(w); } } else { cb->operations = initial_operations & (XmDROP_COPY | XmDROP_MOVE); RectUnhighlight(w); } /* * Set operation to the valid operation preferred by the simulated * drop site or to XmDROP_NOOP if the operations list does not * contain the preferred operation. */ if (rect) { if (bgFound || pixFound) { if (cb->operations & XmDROP_COPY) cb->operation = XmDROP_COPY; else cb->operation = XmDROP_NOOP; } else if (rectFound) { if (cb->operations & XmDROP_MOVE) cb->operation = XmDROP_MOVE; else if (cb->operations & XmDROP_COPY) cb->operation = XmDROP_COPY; else cb->operation = XmDROP_NOOP; } } else { if (rectFound) { if (cb->operations & XmDROP_MOVE) cb->operation = XmDROP_MOVE; else if (cb->operations & XmDROP_COPY) cb->operation = XmDROP_COPY; else cb->operation = XmDROP_NOOP; } else cb->operation = initial_operation; } /* * Set dropSiteStatus to XmDROP_SITE_INVALID if the operation * field is XmDROP_NOOP, or if there are no common targets * between the source and the nested drop site. Otherwise, * set dropSiteStatus to XmDROP_SITE_VALID. */ if (cb->operation == XmDROP_NOOP || (rect && (!rectFound && !bgFound && !pixFound)) || (!rect && !rectFound)) cb->dropSiteStatus = XmINVALID_DROP_SITE; else cb->dropSiteStatus = XmVALID_DROP_SITE; /* * Display appropriate drag under visuals. Only highlight * the rectangle if we are changing rectangle attributes. */ if ((rect && bgFound) || (pixFound && cb->dropSiteStatus == XmVALID_DROP_SITE)) RectHighlight(w, rect); break; case XmCR_OPERATION_CHANGED: if (rectFound) { if (cb->operation == XmDROP_MOVE) appInfo->doMove = True; else appInfo->doMove = False; } break; default: /* other messages we consider invalid */ cb->dropSiteStatus = XmINVALID_DROP_SITE; break; } /* allow animation to be performed */ cb->animate = True; } /* This procedure handles the data that is being transfer */ /* ARGSUSED */ static void TransferProcCallback(Widget wid, XtPointer closure, XtPointer call_data) { XmSelectionCallbackStruct *cs = (XmSelectionCallbackStruct *) call_data; DropTransfer transferRec = (DropTransfer) closure; Display *display = XtDisplay(wid); Atom RECT_INFO = XmInternAtom(display, "RECT_INFO", False); Atom PIXEL = XmInternAtom(display, "PIXEL", False); Atom NULL_ATOM = XmInternAtom(display, "NULL", False); Arg args[10]; RectPtr rect; int n; /* * The delete target returns a NULL_ATOM type and value equal to NULL * so it isn't a failure. Otherwise, check for NULL value or targets * that wee don't support and set transfer failure. */ if (cs -> type != NULL_ATOM && (!cs -> value || (cs -> type != RECT_INFO && cs -> type != PIXEL && cs -> type != XA_DRAWABLE))) { /* Free the value if there is one, or we would have a memory leak */ XtFree(cs -> value); return; } /* Handle pixel type (i.e. change in background) */ if (cs -> type == PIXEL) { rect = RectFind(transferRec->x, transferRec->y); RectSetColor(rect, display, XtWindow(wid), *((Pixel*)cs -> value)); } /* Handle drawable type (i.e. change in pixmap) */ else if (cs -> type == XA_DRAWABLE) { rect = RectFind(transferRec->x, transferRec->y); RectSetPixmap(rect, display, XtWindow(wid), *((Pixmap *)cs -> value)); } /* Handle rect_info type (i.e. new rectangle) */ else if (cs -> type == RECT_INFO) { rect = (RectPtr) cs -> value; RectRegister(rect, transferRec->x, transferRec->y); RedrawRectangles(wid); cs -> value = NULL; /* No need to free, it is being stored in RecTable */ } /* Free the value if there is one, or we would have a memory leak */ if (cs -> value) XtFree(cs -> value); } /* This procedure frees the data used the data transfer proc that * was passed from the drop procedure. */ /* ARGSUSED */ static void DropDestroyCB(Widget w, XtPointer clientData, XtPointer callData) { XtFree((char *)clientData); } /* This procedure initiates the drop transfer. */ /* ARGSUSED */ static void HandleDrop(Widget w, XtPointer call, XtPointer call_data) { XmDestinationCallbackStruct *cs = (XmDestinationCallbackStruct *) call; XmDropProcCallbackStruct *ds; static XtCallbackRec dropDestroyCB[] = { {DropDestroyCB, NULL}, {NULL, NULL} }; Display *display = XtDisplay(w); Arg args[10]; DropTransfer transferRec; int n; Boolean rectFound, bgFound, pixFound; RectPtr rect; Boolean transferValid = False; /* For drop help we save the struct in a global */ if (call == NULL) cs = savedCB; ds = (XmDropProcCallbackStruct *) cs -> destination_data; /* Cancel the drop on invalid drop operations */ if (!(ds->operations & XmDROP_MOVE || ds->operations & XmDROP_COPY)) { XmTransferDone(cs -> transfer_id, XmTRANSFER_DONE_FAIL); } else { /* Find out which nested dropsite contains the pointer */ rect = RectFind(ds->x, ds->y); CheckTargets(ds->dragContext, display, &rectFound, &bgFound, &pixFound); /* rect !NULL indicates we are within a nested dropsite */ if (rect) { /* MY_RECT is a possible target, we'll support it first */ if (rectFound) transferValid = True; else if (bgFound || pixFound) { /* support only copy with the BACKGROUND and PIXMAP targets */ if (ds->operation != XmDROP_COPY) ds->operation = XmDROP_COPY; transferValid = True; } } else { if (rectFound) transferValid = True; } if (transferValid) { /* intialize data to send to drop transfer callback */ transferRec = (DropTransfer) XtMalloc(sizeof(DropTransferRec)); transferRec->widget = w; transferRec->x = ds->x; transferRec->y = ds->y; XmTransferValue(cs -> transfer_id, XmInternAtom(display, "_MY_RECTANGLE", False), TransferProcCallback, (XtPointer) transferRec, CurrentTime); XmTransferValue(cs -> transfer_id, XmInternAtom(display, "BACKGROUND", False), TransferProcCallback, (XtPointer) transferRec, CurrentTime); XmTransferValue(cs -> transfer_id, XmInternAtom(display, "PIXMAP", False), TransferProcCallback, (XtPointer) transferRec, CurrentTime); /* Set up move targets */ if (ds->operation == XmDROP_MOVE) { XmTransferValue(cs -> transfer_id, XmInternAtom(display, "DELETE", False), TransferProcCallback, (XtPointer) transferRec, CurrentTime); } } else { XmTransferDone(cs -> transfer_id, XmTRANSFER_DONE_FAIL); } } } /* This procedure is used with the drop help dialog to cancel the drop */ /* ARGSUSED */ static void CancelDrop(Widget w, XtPointer call, XtPointer ignore) { XmDestinationCallbackStruct *cs; /* For drop help we save the struct in a global */ cs = savedCB; XmTransferDone(cs -> transfer_id, XmTRANSFER_DONE_FAIL); } void ChangeOperation(Widget widget, caddr_t client_data, XmAnyCallbackStruct *call_data) { if (client_data == 0) appInfo->operation = XmDROP_MOVE; else appInfo->operation = XmDROP_COPY; } /* This procedure manages the help dialog and determines which * message is displayed in the dialog depending on the position * and the type of drop. */ /* ARGSUSED */ static void HandleHelp(Widget w, XtPointer call, XtPointer ignore) { XmDestinationCallbackStruct *cs = (XmDestinationCallbackStruct *) call; XmDropProcCallbackStruct *ds = (XmDropProcCallbackStruct *) cs -> destination_data; Boolean rectFound, bgFound, pixFound; XmString helpStr = NULL; RectPtr rect; Arg args[5]; XmString tempStr, buttonArray[2]; int n = 0; savedCB = cs; /* if we haven't created a help dialog, create one now */ if (helpDialog == NULL) { XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; XtSetArg(args[n], XmNtitle, "Drop Help"); n++; helpDialog = XmCreateMessageDialog(topLevel, "Help", args, n); n = 0; buttonArray[0] = XmStringCreateSimple("Move"); buttonArray[1] = XmStringCreateSimple("Copy"); XtSetArg(args[n], XmNbuttons, buttonArray); n++; XtSetArg(args[n], XmNbuttonCount, 2); n++; XtSetArg(args[n], XmNbuttonSet, 0); n++; XtSetArg(args[n], XmNsimpleCallback, ChangeOperation); n++; tempStr = XmStringCreateSimple("Operations:"); XtSetArg(args[n], XmNoptionLabel, tempStr); n++; helpMenu = XmCreateSimpleOptionMenu(helpDialog, "helpMenu", args, n); XmStringFree(tempStr); XmStringFree(buttonArray[0]); XmStringFree(buttonArray[1]); XtAddCallback(helpDialog, XmNokCallback, HandleDrop, NULL); XtAddCallback(helpDialog, XmNcancelCallback, CancelDrop, NULL); XtUnmanageChild(XmMessageBoxGetChild(helpDialog, XmDIALOG_HELP_BUTTON)); XtRealizeWidget(helpDialog); } /* find the valid targets */ CheckTargets(ds->dragContext, XtDisplay(w), &rectFound, &bgFound, &pixFound); /* determine the appropriate help message */ if (rectFound) { if (ds->operations == (XmDROP_MOVE | XmDROP_COPY)) { XtManageChild(helpMenu); helpStr = XmStringCreateLtoR(HELP_MSG4, XmFONTLIST_DEFAULT_TAG); XtManageChild(XmMessageBoxGetChild(helpDialog, XmDIALOG_OK_BUTTON)); } else if (ds->operation == XmDROP_MOVE) { XtUnmanageChild(helpMenu); helpStr = XmStringCreateLtoR(HELP_MSG2, XmFONTLIST_DEFAULT_TAG); XtManageChild(XmMessageBoxGetChild(helpDialog, XmDIALOG_OK_BUTTON)); } else if (ds->operation == XmDROP_COPY) { XtUnmanageChild(helpMenu); helpStr = XmStringCreateLtoR(HELP_MSG3, XmFONTLIST_DEFAULT_TAG); XtManageChild(XmMessageBoxGetChild(helpDialog, XmDIALOG_OK_BUTTON)); } } else if ((bgFound || (pixFound && ds->operation)) == XmDROP_COPY) { XtUnmanageChild(helpMenu); rect = RectFind(ds->x, ds->y); if (rect) { helpStr = XmStringCreateLtoR(HELP_MSG1, XmFONTLIST_DEFAULT_TAG); XtManageChild(XmMessageBoxGetChild(helpDialog, XmDIALOG_OK_BUTTON)); } else { helpStr = XmStringCreateLtoR(HELP_MSG5, XmFONTLIST_DEFAULT_TAG); XtUnmanageChild(XmMessageBoxGetChild(helpDialog, XmDIALOG_OK_BUTTON)); } } else { XtUnmanageChild(helpMenu); helpStr = XmStringCreateLtoR(HELP_MSG5, XmFONTLIST_DEFAULT_TAG); XtUnmanageChild(XmMessageBoxGetChild(helpDialog, XmDIALOG_OK_BUTTON)); } /* set the help message into the dialog */ XtSetArg(args[0], XmNmessageString, helpStr); XtSetValues(helpDialog, args, 1); /* Free the XmString */ XmStringFree(helpStr); /* map the help dialog */ XtManageChild(helpDialog); } /* The procedure either begins the drop of initiates the help dialog * depending on the dropAction. */ /* ARGSUSED */ void handleDestination(Widget w, XtPointer client, XtPointer call) { XmDestinationCallbackStruct *cs = (XmDestinationCallbackStruct *) call; if (appInfo->highlightRect != NULL) RectUnhighlight(w); if (cs->operation != XmOTHER) HandleDrop(w, call, NULL); else HandleHelp(w, call, NULL); } /* This procedure registers the drop targets and the drop site */ static void RegisterDropSite(Widget w) { Display *display = XtDisplay(w); Atom targets[3]; Arg args[5]; int n = 0; /* Only accept moves or copies */ XtSetArg(args[n], XmNdragOperations, XmDROP_COPY | XmDROP_MOVE); n++; /* set all possible targets for any of the nested drop sites */ targets[0] = XmInternAtom(display, "_MY_RECTANGLE", False); targets[1] = XmInternAtom(display, "BACKGROUND", False); targets[2] = XmInternAtom(display, "PIXMAP", False); XtSetArg(args[n], XmNimportTargets, targets); n++; XtSetArg(args[n], XmNnumImportTargets, 3); n++; /* register a dragProc - necessary for simulating nested drop sites */ XtSetArg(args[n], XmNdragProc, DragProcCallback); n++; XmeDropSink(w, args, n); } static void SetInvalidIcon(Widget w) { Widget invalidIcon; char *invalid_bits; Dimension width, height; Arg args[1]; if (appInfo->maxCursorWidth >= ICON_WIDTH && appInfo->maxCursorHeight >= ICON_HEIGHT) { invalid_bits = (char *)INVALID_ICON_BITS; width = ICON_WIDTH; height = ICON_HEIGHT; } else { /* If the server will handle a small icon, create one */ invalid_bits = (char *)SMALL_INVALID_ICON_BITS; width = SMALL_ICON_WIDTH; height = SMALL_ICON_HEIGHT; } invalidIcon = GetDragIconFromBits(w, invalid_bits, invalid_bits, width, height, GetColor(DRAW_AREA_FG_COLOR), GetColor(DRAW_AREA_BG_COLOR)); XtSetArg(args[0], XmNdefaultInvalidCursorIcon, invalidIcon); XtSetValues(XmGetXmScreen(XtScreen(w)), args, 1); } /* This procedure initalizes the toolkit and other application information */ static void InitializeApplication(int *argc, String *argv) { static XtActionsRec new_actions[] = { {"StartRect", StartRect}, {"ExtendRect", ExtendRect}, {"EndRect", EndRect}, {"StartMove", StartMove}, {"ColorRect", ColorRect}, }; Arg args[5]; Cardinal n = 0; /* Ininialize struct that hold global information */ InitializeAppInfo(); /* Initialize Toolkit and create shell */ XtSetArg(args[n], XmNwidth, 295); n++; XtSetArg(args[n], XmNheight, 270); n++; topLevel = XtAppInitialize(&appContext, "DNDDemo", NULL, 0, argc, argv, NULL, args, n); /* Set drag protocol styles */ n = 0; XtSetArg(args[n], XmNdragInitiatorProtocolStyle, XmDRAG_PREFER_RECEIVER); n++; XtSetArg(args[n], XmNdragReceiverProtocolStyle, XmDRAG_DYNAMIC); n++; XtSetValues(XmGetXmDisplay(XtDisplay(topLevel)), args, n); /* Initialize tables for holding rectangle information */ InitializeRectDpyTable(); /* Add new actions for use with translation tables */ XtAppAddActions(appContext, new_actions, 5); /* Get the display server's best cursor size */ XQueryBestCursor(XtDisplay(topLevel), RootWindowOfScreen(XtScreen(topLevel)), 64, 64, &appInfo->maxCursorWidth, &appInfo->maxCursorHeight); } /* This the program start procedure */ int main (int argc, String *argv) { /* Initialize toolkit and application global values */ InitializeApplication(&argc, argv); /* Create main window, drawing area, and color labels */ CreateLayout(); /* Register the drawing area as a drop site */ RegisterDropSite(drawingArea); SetInvalidIcon(drawingArea); /* Realize and map widget hiearchy */ XtRealizeWidget(topLevel); /* Create GC for drawing rectangles */ CreateRectGC(); /* Begin event loop processing */ XtAppMainLoop(appContext); /* Make compiler happy */ return 0; } motif-2.3.8/demos/programs/drag_and_drop/simpledrop.c0000644000175000017500000003253313066310437017642 00000000000000/* $XConsortium: simpledrop.c /main/6 1996/04/21 18:50:33 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* * A Simple Drag And Drop Demo * * Created: Vania JOLOBOFF / January 1994 * ====================================================================== * */ /* * ===================== include ======================================== */ #include #include #include /* ====================================================================== * General Types */ typedef enum {closed, open} State ; /* * The demo basic data structure */ typedef struct _Airport { XtAppContext context; Display * display; int screen_width; int screen_height; State state; Widget main; /* the main window */ Widget drop_area; /* the drop_area drawing area */ Widget help_dialog; Widget error_dialog; Widget warning_dialog; Widget msg_area; Position drop_x; Position drop_y; } DropDemoRec, *DropDemo; /* ====================================================================== * Global constants and variables */ Atom StringAtom; Atom PixmapAtom; Atom CTAtom; /* ============================ prototypes ======================= */ static void Warning(DropDemo this, String s1, String s2); /* issue a warning to user */ static Widget MenuBarEntry(Widget menubar, String entry, String labels[], XtCallbackProc procs[], XtPointer private[], int count); static void HelpCallback(Widget button, XtPointer client_data, XtPointer cbs); static void ExitCallback(Widget button, XtPointer client_data, XtPointer cbs); static void SomethingDropped(Widget dc, XtPointer client_data, XmDropProcCallbackStruct *call_data); /* drop proc callback on airport. Something is landing */ static void TransferDone(Widget transfer, XtPointer client_data, Atom * selection, Atom * type, XtPointer value, unsigned long *length, int *format); /* Xt Selection Callback. Transfer flight number from source */ /* ===================================================================== * Show application modal warning dialogue box with specified messages */ static void Warning(DropDemo this, String s1, String s2) { XmString msg; char tmp[256]; if (s1 == NULL) msg = XmStringCreateLocalized(s2); else if (s2 == NULL) msg = XmStringCreateLocalized(s1); else { strncat(strcpy(tmp, s1), s2, 256); msg = XmStringCreateLocalized(tmp); } if (this->warning_dialog == NULL) { Arg args[8]; int n = 0; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; this->warning_dialog = XmCreateWarningDialog(this->main, "warning", args, n); } printf("warning %s\n", tmp); XtVaSetValues(this->warning_dialog, XmNmessageString, msg, NULL); /* XmStringFree(msg); */ printf("managing dialog\n"); XtManageChild(this->warning_dialog); } /* =============================================================== * Create a cascade and a pulldown entry into a menubar, * from a list of push button specs. * If the label is NULL, create a separator instead of a push button. */ static Widget MenuBarEntry(Widget menubar, String entry, String labels[], XtCallbackProc procs[], XtPointer private[], int count) { Widget menu; Widget kid; Arg args[8]; int n; int i; char name[128]; n = 0; menu = XmCreatePulldownMenu(menubar, strcat(strcpy(name, entry), "Menu"), args, n); for( i = 0; i < count; i++) { n = 0; if (labels[i] == NULL) { kid = XmCreateSeparator(menu, "sep", args, n); } else { kid = XmCreatePushButton(menu, labels[i], args, n); if (procs[i] != NULL) XtAddCallback(kid, XmNactivateCallback, procs[i], private[i]); } XtManageChild(kid); } n = 0; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple(entry)); n++; XtSetArg(args[n], XmNsubMenuId, menu); n++; kid = XmCreateCascadeButton(menubar, entry, args, n); XtManageChild(kid); return kid; } /* ============================================================== * Main loop */ int main(int argc, char *argv[]) { #define MAIN_CHILDREN 3 #define FORM_CHILDREN 2 #define SetMenuEntry(k,l,p,d) labels[k]=l;procs[k]=p;private[k]=d; #define NUM_TARGETS 3 Atom targets[NUM_TARGETS]; Widget theWidgetRoot; Widget main_kid[MAIN_CHILDREN]; Widget form_kid[FORM_CHILDREN]; Widget framed[2]; Widget entry; static char myClass[] = "DropDemo"; Arg args[10]; int n ; String labels[4]; XtCallbackProc procs[4]; XtPointer private[4]; DropDemo this; /* * Initialize */ this = (DropDemo) XtCalloc(sizeof(DropDemoRec), 1); this->state = closed; theWidgetRoot = XtVaAppInitialize(&this->context, myClass, NULL, 0, &argc, argv, NULL, NULL, XmNallowShellResize, True, NULL); this->display = XtDisplay(theWidgetRoot); StringAtom = XmInternAtom(this->display, "STRING", False); PixmapAtom = XmInternAtom(this->display, "PIXMAP", False); CTAtom = XmInternAtom(this->display, "COMPOUND_TEXT", False); /* * Create the widget structure. * Create the Main Window, the menubar and the pulldown menus * Then a scale and a drawing area inside a frame inside a form */ n = 0; this->main = XmCreateMainWindow(theWidgetRoot, "main", args, n); /* * Create the menu bar with a File and Help entries */ n = 0; XtSetArg (args[n], XmNscrolledWindowChildType, XmMENU_BAR); n++ ; main_kid[0] = XmCreateMenuBar(this->main, "menubar", args, n); n = 0; SetMenuEntry(n, "Exit", (XtCallbackProc)ExitCallback, (XtPointer)this ); n++; entry = MenuBarEntry(main_kid[0], "File", labels, procs, private, n); n = 0; SetMenuEntry(0, "Tutorial", (XtCallbackProc)HelpCallback, (XtPointer)this); n++; entry = MenuBarEntry(main_kid[0], "Help", labels, procs, private, n); n = 0; XtSetArg(args[n], XmNmenuHelpWidget, entry); n++; XtSetValues(main_kid[0], args, n); /* * Create the work area as a Form containing a Scale and a Frame */ n = 0; this->screen_width = WidthOfScreen(XtScreenOfObject(this->main)); this->screen_height = HeightOfScreen(XtScreenOfObject(this->main)); XtSetArg(args[n], XmNwidth, this->screen_width*3/7); n++; XtSetArg(args[n], XmNheight, this->screen_height*3/7); n++; XtSetArg(args[n], XmNresizePolicy, XmRESIZE_ANY); n++; XtSetArg (args[n], XmNscrolledWindowChildType, XmWORK_AREA); n++ ; main_kid[1] = XmCreateForm(this->main, "work_area", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg(args[n], XmNvalue, 0); n++; XtSetArg(args[n], XmNmaximum, this->screen_width*3/7); n++; XtSetArg(args[n], XmNminimum, 0); n++; XtSetArg(args[n], XmNshowValue, True); n++; XtSetArg(args[n], XmNtitleString, XmStringCreateLocalized("Number To Drag")); n++; form_kid[0] = XmCreateScale(main_kid[1], "scale", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET) ; n++; XtSetArg(args[n], XmNtopWidget, form_kid[0]) ; n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; form_kid[1] = XmCreateFrame(main_kid[1], "frame", args, n); n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++; framed[0] = XmCreateLabel(form_kid[1], "drop_here", args, n); /* * Create the dropping area */ n = 0; this->drop_area = framed[1] = XmCreateBulletinBoard(form_kid[1], "da", args, n); XtVaSetValues(this->drop_area, XmNuserData, this, NULL); n = 0; targets[0] = StringAtom; targets[1] = PixmapAtom; targets[2] = CTAtom; XtSetArg(args[n], XmNimportTargets, targets); n++; XtSetArg(args[n], XmNnumImportTargets, NUM_TARGETS); n++; XtSetArg(args[n], XmNdragProc, NULL); n++; XtSetArg(args[n], XmNdropProc, SomethingDropped); n++; XmDropSiteRegister(this->drop_area, args, n); XtManageChildren(framed, 2); XtManageChildren(form_kid, FORM_CHILDREN); XtManageChildren(main_kid, 2); XtManageChild(this->main); XtRealizeWidget(theWidgetRoot); XtAppMainLoop(this->context); return 0; /* make compiler happy */ } /* =============================================================== * The Exit Callback. Exit properly. */ static void ExitCallback(Widget button, XtPointer client_data, XtPointer cbs) { DropDemo this = (DropDemo) client_data; XtCloseDisplay(this->display); exit(0); } /* ====================================================================== * Help Callback. Display help message. */ static void HelpCallback(Widget button, XtPointer client_data, XtPointer cbs) { DropDemo this = (DropDemo) client_data; static char helpmsg[] = "Please drag the value of the scale into the drop area"; if ( this->help_dialog == NULL ) { Arg args[8]; int n = 0; XtSetArg(args[n], XmNmessageString, XmStringCreateLocalized(helpmsg)); n++; this->help_dialog = XmCreateInformationDialog(button, "helpdialog", args, n); } XtManageChild(this->help_dialog); } /* =============================================================== * Drop proc callback of the drop site. * If the drop site is invalid, issue a warning * If the drop site is valid, we know the target is at least one of * String, CT or Pixmap. * Pick one of them only in this order of preference. */ static void SomethingDropped(Widget dropSite, XtPointer client_data, XmDropProcCallbackStruct *call_data) { #define NUMREC 2 DropDemo this; Arg args[8]; Arg get_args[4]; Atom * exports; XmDropTransferEntryRec target_data[NUMREC]; unsigned char status = '\0'; Widget dc = call_data->dragContext; int n = 0; int i = 0; Cardinal num_targets = 0; Cardinal num_transfer = 0; XtVaGetValues(dropSite, XmNuserData, &this, NULL); XtSetArg(get_args[i], XmNexportTargets, &exports); i++; XtSetArg(get_args[i], XmNnumExportTargets, &num_targets); i++; XtGetValues(dc, get_args, i); if (call_data->dropSiteStatus == XmVALID_DROP_SITE) { call_data->operation = XmDROP_COPY; this->drop_x = call_data->x; this->drop_y = call_data->y; for (i = 0; i < num_targets; i++ ) if (exports[i] == StringAtom || exports[i] == CTAtom || exports[i] == PixmapAtom) { status = XmTRANSFER_SUCCESS; num_transfer = 1; target_data[0].client_data = (XtPointer) this; target_data[0].target = exports[i]; XtSetArg(args[n], XmNtransferProc, TransferDone); n++; XtSetArg(args[n], XmNdropTransfers, target_data); n++; break; } } else { Warning(this, "Non Identified Object is Dropped. ", num_targets > 0 ? XmGetAtomName(this->display,exports[0]) : ""); status = XmTRANSFER_FAILURE; } XtSetArg(args[n], XmNnumDropTransfers, num_transfer); n++; XtSetArg(args[n], XmNtransferStatus, status); n++; XmDropTransferStart(call_data->dragContext, args, n); #undef NUMREC } /* =============================================================== * The selection callback proc after drop transfer. * Bytes have been received. Check they are OK * If data received is corrupted, issue a warning. */ static void TransferDone(Widget transfer, XtPointer client_data, Atom * selection, Atom * type, XtPointer value, unsigned long *length, int *format) { Arg args[16]; int n = 0; Widget label; DropDemo this = (DropDemo) client_data; XmString string = NULL; char msg[256]; if (*format == 8) { if (*type == StringAtom) string = XmStringCreateSimple( (char *) value ); else if (*type == CTAtom) string = XmCvtCTToXmString( (char *) value ); XtSetArg(args[n], XmNlabelString, string); n++; } else if (*type == PixmapAtom && *format == 32) { Pixmap pixmap = (Pixmap) value; XtSetArg(args[n], XmNbackgroundPixmap, pixmap); n++; } else { XtVaSetValues(transfer, XmNtransferStatus, XmTRANSFER_FAILURE, XmNnumDropTransfers, 0, NULL); sprintf(msg, "Type %s format %d", XmGetAtomName(this->display, *type), *format); Warning(this, "Dropped data is corrupted. ", msg); return; } XtSetArg(args[n], XmNx, this->drop_x); n++; XtSetArg(args[n], XmNy, this->drop_y); n++; label = XmCreateLabel(this->drop_area, "label", args, n); XtManageChild(label); if (string != NULL) XmStringFree(string); } motif-2.3.8/demos/programs/drag_and_drop/DNDDemo.man0000644000175000017500000000243512672140200017214 00000000000000.\" $XConsortium: DNDDemo.man /main/4 1995/07/17 10:46:39 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH DNDDemo 1X MOTIF "Demonstration programs" .SH NAME \*LDNDDemo\*O\(emdemonstraits the drag and drop system. .SH SYNOPSIS .sS \*LDNDDemo\*O .sE .SH DESCRIPTION \*LDNDDemo\*O shows off the features in Motif Drag and Drop. It also serves as a programming example. For a simpler example, look at simpledrop.c. motif-2.3.8/demos/programs/drag_and_drop/simpledrop.man0000644000175000017500000000251412672140200020156 00000000000000.\" $XConsortium: simpledrop.man /main/4 1995/07/17 10:46:47 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH simpledrop 1X MOTIF "Demonstration programs" .SH NAME \*Lsimpledrop\*O\(emis a simple demonstration of the drag and drop system. Unlike DNDDemo, simpledrop is a minimal example. .SH SYNOPSIS .sS \*Lsimpledrop\*O .sE .SH DESCRIPTION \*Lsimpledrop\*O shows off the most basic features in Motif Drag and Drop. It also serves as a programming example. motif-2.3.8/demos/programs/drag_and_drop/README0000644000175000017500000001210512672140200016160 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:02:47 drk $ */ README for the DNDDemo and simpledrop. This directory contains the demos illustrating typical usage of the drag and drop features. "simpledrop" is a minimalist demo, helpful in showing how to get started in drag and drop without too many special effects. "DNDDemo" uses most of the tricks available in drag and drop to provide drag over and drag under effects. simpledrop ---------- The program simpledrop is a minimal drag and drop demonstration. It displays a scale widget and a drawing area. To use, startup the program, set the scale to a value and then use BTransfer to drag the scale value. Drop the scale value into the drawing area labelled "drop_here" and the number will appear at the drop spot. In addition, you can copy the numbers in the drawing area around. Press BTransfer on one of the numbers and then drop somewhere else. DNDDemo ------- This demonstration program uses the Uniform Transfer Model in Motif 2.0. When the demo comes up, it does not have any valid drop sites. It comes up with different color rectangles which act as drag sources for dragging the colors around. You can create the drop sites as follows: Move the pointer into the drawing area (with white background). Press MouseBtn1 and drag. You will see the rubberbanding effect. Release MouseBtn1 after dragging some distance. A rectangle will appear with one of its corners corresponding to the point of MouseBtn1 press, and the diagonally opposite corner corresponding to the point of MouseBtn1 release. The rectangle comes up filled with black by default. You can create any number of rectangles like this. To initiate a drag, you move the pointer over to the drag source, press BTransfer (which is MouseBtn2 by default), and start dragging. Immediately, you will notice that the cursor changes to a painter's palette in the same color as the color rectangle from which the drag is initiated. The rectanlges inside the drawing area that you created will act as valid drop sites for colors. You can test this by, for example, initiating the drag from the yellow color rectangle, dragging over to one of the rectangles inside the drawing area, and releasing BTransfer. While you are dragging, you will notice several things. When you are dragging over root window, the dragicon consists of only the painter's palette. When you drag over parts of the drawing area where there are no rectangles, you will notice that the dragicon changes to include a "DO NOT ENTER!" sign on top of the painter's palette; when you are dragging over any of the rectangles inside the drawing area, you will see that the "DO NOT ENTER!" sign gets replaced with a painter's brush. To attempt a drop, you will release BTransfer. If you release BTranfer with the pointer over any part of drawing area outside of the rectangles, or anywhere on the root window, you will see that the dragicon snaps back to the point of drag initiation, and disappears. This is an indication that the drop you attempted was a failure. On the other hand, if you release BTransfer with the pointer over any of the rectangles inside the drawing area, you will see that the dragicon melts into the background and disappears; this indicates that the drop you attempted was a success. Also, when the rectangle on which the drop was attempted, gets filled with the color that was being dragged around (yellow, in our example). The rectangles inside the drawing area themselves act as drag sources. You can initiate the drag with the pointer on any rectangle, and you will notice that the cursor changes to a rectangle (either of the same size or a smaller size depending on X cursor size constraints). You can drag a rectangle from one place and drop it onto a new place inside the drawing area. The rectangle gets physically moved to the new position. If, on the other hand, you want to copy the rectangle to a new position, you can use the appropriate modifier key while dragging, and/or at the time you attempt the drop ( is the modifier key for copy in the current implementation). When you drag a rectangle with no modifier key pressed or with pressed, you will notice that the solid rectangle from where you initiated the drag gets replaced by a hollow rectangle with dotted-line borders. It will continue to be this way, for the duration of the drag or until you press the key, which will change the operation to Copy; at which time it will regain its original solid form. A couple of other things to note. Anytime during dragging, you can cancel that drag by hitting the Cancel key. Also, during dragging, anytime you hit the Help key, you will get a dialog giving you some information about whether the drop will succeed, what are the drop operations possible, etc. motif-2.3.8/demos/programs/drag_and_drop/DNDDemo.h0000644000175000017500000001625413145162623016705 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * file: DNDDemo.h * * Header file for the program DNDDemo. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* The following is used to layout the color labels */ #define BOX_WIDTH 85 #define BOX_HEIGHT 25 #define BOX_X_OFFSET 95 #define BOX_Y_OFFSET 35 #define BOX_X_MARGIN 10 #define BOX_Y_MARGIN 10 /* The following are used in setting up the drag icons */ #define ICON_WIDTH 32 #define ICON_HEIGHT 32 #define SMALL_ICON_WIDTH 16 #define SMALL_ICON_HEIGHT 16 #define ICON_X_HOT 0 #define ICON_Y_HOT 0 /* Some scales or text entry field could be added to change this value */ #define RECT_WIDTH 20 #define RECT_HEIGHT 50 /* The following defines could be setup as application resources */ #define RECT_START_COLOR "black" #define HIGHLIGHT_THICKNESS 3 #define HIGHLIGHT_COLOR "Black" /* this is equivalent to gray60 in the R5 rgb.txt */ #define DRAW_AREA_BG_COLOR "white" #define DRAW_AREA_FG_COLOR "black" /* 5127 fix */ #define LABEL1_COLOR "#ff5026" /* a slight softer shade of red, red was too dark */ #define LABEL2_COLOR "orange" #define LABEL3_COLOR "yellow" #define LABEL4_COLOR "violet" #define LABEL5_COLOR "#00C3ff" /* a blue green color, blue was too dark */ #define LABEL6_COLOR "green" #define VALID_CURSOR_FG_COLOR "black" #define INVALID_CURSOR_FG_COLOR "maroon" #define NONE_CURSOR_FG_COLOR "maroon" /* * This struct is used to contain information about each rectangle * to use in the dislay routines */ typedef struct _RectStruct { CARD32 x; CARD32 y; CARD32 width; CARD32 height; CARD32 color; CARD32 pixmap; /* currently not in use */ } RectStruct, *RectPtr; /* This struct is used to hold global application information */ typedef struct _AppInfoRec { GC rectGC; /* graphic context used to draw the rectangles */ Pixel currentColor; /* color that is currently in the GC */ RectPtr *rectDpyTable; /* the rectangle display table */ int rectsAllocd; /* keeps track of how much the above table has been alloc'd */ int numRects; /* the number of rects that are visible */ RectPtr highlightRect; /* the current highlighted rectangle */ RectPtr clearRect; /* the rectangle that is being moved */ Boolean doMove; /* indicates that a move is being performed */ Boolean creatingRect; /* indicates that a rect create is being performed */ unsigned char operation;/* indicates the drop help operation */ unsigned int maxCursorWidth; /* the maximum allowable cursor width */ unsigned int maxCursorHeight; /* the maximum allowable cursor height */ Position rectX; Position rectY; Position rectX2; Position rectY2; } AppInfoRec, *AppInfo; /* * This struct is used to pass information * from the dropProc to the transferProc */ typedef struct _DropTransferRec { Widget widget; Position x; Position y; } DropTransferRec, *DropTransfer; /* * This struct is used to pass information * from the rectangle dragStart proc to it's associated * callback procs. */ typedef struct _DragConvertRec { Widget widget; RectPtr rect; } DragConvertRec, *DragConvertPtr; extern void InitializeAppInfo(void ); extern void StartRect(Widget , XEvent *, String *, Cardinal *); extern void ExtendRect(Widget , XEvent *, String *, Cardinal *); extern void EndRect(Widget , XEvent *, String *, Cardinal *); extern RectPtr RectCreate(Position , Position , Dimension , Dimension , Pixel , Pixmap ); extern RectPtr RectFind(Position , Position ); extern void RectSetColor(RectPtr , Display *, Window , Pixel ); extern Pixel RectGetColor(RectPtr ); extern Pixmap GetBitmapFromRect(Widget , RectPtr , Pixel , Pixel , Dimension *, Dimension *); extern void RectHide(Display *, Window , RectPtr ); extern void RectFree(RectPtr ); extern void RedrawRectangles(Widget ); extern void RectDrawStippled(Display *, Window , RectPtr ); extern void RectHighlight(Widget , RectPtr ); extern void RectUnhighlight(Widget ); extern void RectSetPixmap(RectPtr , Display *, Window , Pixmap ); extern void RectRegister(RectPtr , Position , Position ); extern void InitializeRectDpyTable(void ); extern void CreateLayout(void ); extern void CreateRectGC(void ); extern Pixel GetColor(char *); extern void ColorRect(Widget , XEvent *, String *, Cardinal *); extern void RectConvert(Widget, XtPointer, XmConvertCallbackStruct*); extern void ColorConvert(Widget, XtPointer, XmConvertCallbackStruct*); extern void handleDestination(Widget, XtPointer, XtPointer); /* The following character arrays hold the bits for * the source and state icons for both 32x32 and 16x16 drag icons. * The source is a color palatte icon and the state is a paint brush icon. */ extern unsigned char SOURCE_ICON_BITS[]; extern unsigned char SOURCE_ICON_MASK[]; extern unsigned char STATE_ICON_BITS[]; extern unsigned char STATE_ICON_MASK[]; extern unsigned char INVALID_ICON_BITS[]; extern unsigned char SMALL_SOURCE_ICON_BITS[]; extern unsigned char SMALL_SOURCE_ICON_MASK[]; extern unsigned char SMALL_STATE_ICON_BITS[]; extern unsigned char SMALL_STATE_ICON_MASK[]; extern unsigned char SMALL_INVALID_ICON_BITS[]; /* The folowing character arrays are for use with the drop help * dialogs. For internationalization, message catalogs should * replace these static declarations. */ extern char HELP_MSG1[]; extern char HELP_MSG2[]; extern char HELP_MSG3[]; extern char HELP_MSG4[]; extern char HELP_MSG5[]; /* Globals variables */ extern AppInfo appInfo; extern Widget topLevel; extern Widget drawingArea; extern Widget helpDialog; extern Widget helpLabel, helpMenu; extern XtAppContext appContext; motif-2.3.8/demos/programs/drag_and_drop/DNDDraw.c0000644000175000017500000010121413145162623016700 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: DNDDraw.c /main/7 1997/03/31 13:33:37 dbl $" #endif #endif /* * file: DNDDraw.c * * File containing all the drawing routines needed to run DNDDemo * program. * */ #include "DNDDemo.h" static void RectDraw(Display *, Window , RectPtr ); /* The following character arrays hold the bits for * the source and state icons for both 32x32 and 16x16 drag icons. * The source is a color palette icon and the state is a paint brush icon. */ unsigned char SOURCE_ICON_BITS[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x02, 0x00, 0x50, 0x55, 0x07, 0x00, 0x28, 0x00, 0x0c, 0x00, 0x94, 0x42, 0x19, 0x00, 0xca, 0xe5, 0x33, 0x00, 0x85, 0xc6, 0x33, 0x80, 0x42, 0xe7, 0x33, 0x40, 0x81, 0xc3, 0x31, 0xa0, 0x00, 0x00, 0x38, 0x50, 0x00, 0x00, 0x1c, 0x28, 0x00, 0x00, 0x0e, 0x90, 0x02, 0x00, 0x07, 0xc8, 0x05, 0x80, 0x03, 0x90, 0x07, 0xc0, 0x01, 0x48, 0x05, 0xe0, 0x00, 0x90, 0x03, 0x70, 0x00, 0x08, 0x00, 0x30, 0x00, 0x10, 0x14, 0x30, 0x00, 0x08, 0x2a, 0x30, 0x00, 0x10, 0x34, 0x30, 0x00, 0x28, 0x2a, 0x60, 0x00, 0x50, 0x9c, 0xe2, 0x00, 0xa0, 0x40, 0xc4, 0x01, 0x40, 0x01, 0x84, 0x01, 0x80, 0x42, 0x84, 0x03, 0x00, 0x85, 0x03, 0x03, 0x00, 0x0a, 0x00, 0x03, 0x00, 0xf4, 0xff, 0x03, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00}; unsigned char SOURCE_ICON_MASK[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0xff, 0xff, 0x7f, 0x80, 0xff, 0xff, 0x7f, 0xc0, 0xff, 0xff, 0x7f, 0xe0, 0xff, 0xff, 0x7f, 0xf0, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0x03, 0xfc, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0xfe, 0xff, 0x07, 0x00, 0xfc, 0xff, 0x03}; unsigned char STATE_ICON_BITS[] = { 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xc0, 0x0d, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xc0}; unsigned char STATE_ICON_MASK[] = { 0x3f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xf0}; unsigned char INVALID_ICON_BITS[] = { 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff, 0x03, 0xc0, 0x1f, 0xf0, 0x07, 0xe0, 0x07, 0xc0, 0x0f, 0xf0, 0x07, 0x00, 0x1f, 0xf8, 0x0f, 0x00, 0x3e, 0xf8, 0x1f, 0x00, 0x3c, 0xfc, 0x3f, 0x00, 0x7c, 0x3c, 0x7f, 0x00, 0x78, 0x3c, 0xfe, 0x00, 0x78, 0x1e, 0xfc, 0x01, 0xf0, 0x1e, 0xf8, 0x03, 0xf0, 0x1e, 0xf0, 0x07, 0xf0, 0x1e, 0xe0, 0x0f, 0xf0, 0x1e, 0xc0, 0x1f, 0xf0, 0x1e, 0x80, 0x3f, 0xf0, 0x1e, 0x00, 0x7f, 0xf0, 0x3c, 0x00, 0xfe, 0x78, 0x3c, 0x00, 0xfc, 0x79, 0x7c, 0x00, 0xf8, 0x7f, 0x78, 0x00, 0xf0, 0x3f, 0xf8, 0x00, 0xe0, 0x3f, 0xf0, 0x01, 0xc0, 0x1f, 0xe0, 0x07, 0xc0, 0x0f, 0xc0, 0x1f, 0xf0, 0x07, 0x80, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x01, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00}; unsigned char SMALL_SOURCE_ICON_BITS[] = { 0x80, 0x1f, 0x40, 0x60, 0x20, 0x91, 0x90, 0xaa, 0x08, 0x91, 0x08, 0x40, 0x08, 0x20, 0x08, 0x10, 0x28, 0x10, 0x78, 0x10, 0x28, 0x20, 0x08, 0x41, 0x90, 0x43, 0x20, 0x21, 0x40, 0x10, 0x80, 0x0f}; unsigned char SMALL_SOURCE_ICON_MASK[] = { 0x80, 0x1f, 0xc0, 0x7f, 0xe0, 0xff, 0xf0, 0xff, 0xf8, 0xff, 0xf8, 0x7f, 0xf8, 0x3f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x3f, 0xf8, 0x7f, 0xf0, 0x7f, 0xe0, 0x3f, 0xc0, 0x1f, 0x80, 0x0f}; unsigned char SMALL_STATE_ICON_BITS[] = { 0x0f, 0x00, 0x1e, 0x00, 0x1e, 0x00, 0x3c, 0x00, 0x50, 0x00, 0xe0, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00}; unsigned char SMALL_STATE_ICON_MASK[] = { 0x0f, 0x00, 0x1e, 0x00, 0x1e, 0x00, 0x3c, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00}; unsigned char SMALL_INVALID_ICON_BITS[] = { 0xe0, 0x03, 0xf8, 0x0f, 0x1c, 0x1c, 0x1e, 0x30, 0x3e, 0x30, 0x73, 0x60, 0xe3, 0x60, 0xc3, 0x61, 0x83, 0x63, 0x03, 0x67, 0x06, 0x3e, 0x06, 0x3c, 0x1c, 0x1c, 0xf8, 0x0f, 0xe0, 0x03, 0x00, 0x00}; /* Globals variables */ AppInfo appInfo; /* This is a string to pixel conversion function. */ Pixel GetColor(char *colorstr) { XrmValue from, to; from.size = strlen(colorstr) +1; if (from.size < sizeof(String)) from.size = sizeof(String); from.addr = colorstr; to.addr = NULL; XtConvert(topLevel, XmRString, &from, XmRPixel, &to); if (to.addr != NULL) return ((Pixel) *((Pixel *) to.addr)); else return ( (XtArgVal) NULL); } /* This procedure is used to initalize the application information structure */ void InitializeAppInfo(void) { if (!appInfo) { appInfo = (AppInfo) XtMalloc(sizeof(AppInfoRec)); appInfo->rectGC = NULL; appInfo->currentColor = 0; appInfo->rectDpyTable = NULL; appInfo->rectsAllocd = 0; appInfo->numRects = 0; appInfo->highlightRect = NULL; appInfo->clearRect = NULL; appInfo->doMove = True; appInfo->creatingRect = True; appInfo->operation = XmDROP_MOVE; appInfo->maxCursorWidth = 64; appInfo->maxCursorHeight = 64; appInfo->rectX = 0; appInfo->rectY = 0; appInfo->rectX2 = 0; appInfo->rectY2 = 0; } } /* This procedure sets the color in the GC for drawing the rectangles * in a new color. */ void SetColor(Display *display, Pixel color) { /* * if the GC already has a foreground of this color, * it would be wasteful to reset the color */ if (color != appInfo->currentColor) { XSetForeground(display, appInfo->rectGC, (unsigned long) color); appInfo->currentColor = color; } } /* This function draws the rectangle in the color provided */ static void RectDraw(Display *display, Window window, RectPtr rect) { SetColor(display, rect->color); XFillRectangle(display, window, appInfo->rectGC, rect->x, rect->y, rect->width, rect->height); } /* This procedure draws the rectangle highlight in a specified color*/ static void RectDrawHighlight( Widget w, RectPtr rect, Pixel color ) { Display *display = XtDisplay(w); Window window = XtWindow(w); Pixel currentColor = rect->color; XGCValues values; values.foreground = color; XChangeGC(display, appInfo->rectGC, GCForeground, &values); XDrawRectangle(display, window, appInfo->rectGC, rect->x + 1, rect->y + 1, rect->width - HIGHLIGHT_THICKNESS, rect->height - HIGHLIGHT_THICKNESS); /* Return the GC to it's previous state */ values.foreground = appInfo->currentColor = currentColor; XChangeGC(display, appInfo->rectGC, GCForeground, &values); } /* This procedure handles redrawing the rectangles. It draws * them according to the order in the rectangle display table. * The rectangles at the top of the table are drawn first. */ void RedrawRectangles(Widget w) { Display *display = XtDisplay(w); RectPtr rect; Window window = XtWindow(w); int i; for (i = 0; i < appInfo->numRects; i++) { rect = appInfo->rectDpyTable[i]; /* Only draw the rectangles that haven't been cleared */ if (rect != appInfo->clearRect) { RectDraw(display, window, rect); } /* Draw the rectangle highlight of the highlight rectangle */ if (rect == appInfo->highlightRect) { RectDrawHighlight(w, rect, GetColor(HIGHLIGHT_COLOR)); } } } /* This procedure will clear the current rectangle and redraw any rectangles * that were partially cleared by the rectangle that was deleted. */ /* ARGSUSED */ void RectHide(Display *display, Window window, RectPtr rect) { Pixel background, oldColor; Arg args[1]; /* Get the background of the drawing area. */ XtSetArg(args[0], XmNbackground, &background); XtGetValues(drawingArea, args, 1); /* Save the old color for restoration purposes. */ oldColor = rect->color; /* Clear the rectangle */ rect->color = background; RectDraw(display, window, rect); appInfo->clearRect = rect; /* redraw the rest of the rectangles */ RedrawRectangles(drawingArea); /* restore the rectangle color */ rect->color = oldColor; } /* This procedure draws the stipple rectangle that is used in marking * the old rectangle position during a rectangle move operation. */ /* ARGSUSED */ void RectDrawStippled(Display *display, Window window, RectPtr rect) { register int x = rect->x; register int y = rect->y; register Dimension width = rect->width; register Dimension height = rect->height; XGCValues values; XSegment segments[4]; /* Set the rectangle color */ values.foreground = appInfo->currentColor = rect->color; XChangeGC(display, appInfo->rectGC, GCForeground , &values); /* Create the segments for drawing the stippled rectangle */ segments[0].x1 = segments[2].x1 = x; segments[0].y1 = segments[0].y2 = y; segments[0].x2 = x + width - 1; segments[1].x1 = segments[1].x2 = x + width - 1; segments[1].y1 = segments[3].y1 = y; segments[3].y2 = y + height; segments[2].y1 = segments[2].y2 = y + height - 1; segments[3].x1 = segments[3].x2 = x; segments[2].x2 = x + width; segments[1].y2 = y + height; /* Set the line attributes and draw */ XSetLineAttributes(display, appInfo->rectGC, 1, LineOnOffDash, CapButt, JoinMiter); XDrawSegments (display, window, appInfo->rectGC, segments, 4); /* restore the default line settings */ values.line_width = HIGHLIGHT_THICKNESS; values.line_style = LineSolid; XChangeGC(display, appInfo->rectGC, GCLineWidth | GCLineStyle, &values); } /* This procedure sets the highlight rectangle and * redraws the rectangles. The expose routine will draw * the highlight around the highlighted rectangle. */ /* ARGSUSED */ void RectHighlight(Widget w, RectPtr rect) { if (appInfo->highlightRect != rect) { appInfo->highlightRect = rect; RedrawRectangles(w); } } /* This procedure sets the highlight rectangle to NULL and * redraws the rectangles. The expose routine will clear * the highlight around the highlighted rectangle. */ /* ARGSUSED */ void RectUnhighlight(Widget w) { if (appInfo->highlightRect) { appInfo->highlightRect = NULL; RedrawRectangles(w); } } /* This function creates and initialized a new rectangle */ RectPtr RectCreate(Position x, Position y, Dimension width, Dimension height, Pixel color, Pixmap pixmap) { RectPtr rect; rect = (RectPtr) XtMalloc(sizeof(RectStruct)); rect->x = x; rect->y = y; rect->width = width; rect->height = height; rect->color = color; rect->pixmap = pixmap; return(rect); } /* This procedure will move the rectangle to the end of the rectangle * display table (effectively raising it to top of the displayed * rectangles). */ static void RectToTop(RectPtr rect) { int i, j; if (rect) { /* Get the index to the target rectangle */ for (i = 0; i < appInfo->numRects; i++) { if (appInfo->rectDpyTable[i] == rect) break; } /* Shift the other rectangles downward */ for (j = i; j < appInfo->numRects - 1; j++) appInfo->rectDpyTable[j] = appInfo->rectDpyTable[j + 1]; /* Place the target rectangle at the end */ appInfo->rectDpyTable[j] = rect; } } /* This procedure raises the rectangle to the top of the drawing area */ /* ARGSUSED */ static void RectRaise(Widget w, RectPtr rect) { RectToTop(rect); RedrawRectangles(w); } /* This procedure moves the rectangle the the end of the display stack, * decrements the number of rectangles, and then frees the rectangle. */ void RectFree(RectPtr rect) { /* if the rectangle is registered */ if (rect) { RectToTop(rect); appInfo->numRects--; XtFree((char *)rect); } } /* This procedure added the rectangle to the rectangle display table * (reallocing the table if necessary). */ void RectRegister(RectPtr rect, Position x, Position y) { appInfo->numRects++; /* rectangles can have their x and y values reset at registration time */ rect->x = x; rect->y = y; /* realloc the table if it is too small */ if (appInfo->numRects > appInfo->rectsAllocd) { /* grow geometrically */ appInfo->rectsAllocd *= 2; appInfo->rectDpyTable = (RectPtr *) XtRealloc((char *) appInfo->rectDpyTable, (unsigned) (sizeof(RectPtr) * appInfo->rectsAllocd)); } /* Add to end of display table */ appInfo->rectDpyTable[appInfo->numRects - 1] = rect; } /* This function find the top most rectangle at the given x,y position */ RectPtr RectFind(Position x, Position y) { RectPtr rect; int i; /* * Search from the end of the rectangle display table * to find the top most rectangle. */ for (i = appInfo->numRects - 1; i >= 0; i--) { rect = appInfo->rectDpyTable[i]; if (rect->x <= x && rect->x + rect->width >= x && rect->y <= y && rect->y + rect->height >= y) { return(rect); } } /* If a rectangle is not found return NULL */ return(NULL); } /* This procedure sets the retangle's color */ void RectSetColor(RectPtr rect, Display *display, Window window, Pixel color) { rect->color = color; RectDraw(display, window, rect); } /* This function gets the retangle's color */ Pixel RectGetColor(RectPtr rect) { return(rect->color); } /* This procedure sets the retangle's pixmap. The pixmap portion of the * rectangle is not currently being used. */ /* ARGSUSED */ void RectSetPixmap(RectPtr rect, Display *display, Window window, Pixmap pixmap) { rect->pixmap = pixmap; /* not currently being looked at */ RectDraw(display, window, rect); } /* This function gets the retangle's pixmap. The pixmap portion of the * rectangle is not currently being used. */ /* ARGSUSED */ static Pixmap RectGetPixmap(RectPtr rect) { return (rect->pixmap); } /* This procedure gets the retangle's height and width. */ /* ARGSUSED */ static void RectGetDimensions(RectPtr rect, Dimension *width, Dimension *height) { *width = rect->width; *height = rect->height; } /* This function creates the rectangle bitmaps for the icon. */ Pixmap GetBitmapFromRect(Widget w, RectPtr rect, Pixel background, Pixel foreground, Dimension *widthRtn, Dimension *heightRtn) { Dimension width, height, maxHeight, maxWidth; GC fillGC; Pixmap icon_pixmap; Display *display = XtDisplay(w); XGCValues values; unsigned long mask; RectGetDimensions(rect, &width, &height); /* Get the maximum allowable width and height allowed by the cursor */ maxWidth = appInfo->maxCursorWidth; maxHeight = appInfo->maxCursorHeight; /* if the dimensions aren't within the allowable dimensions resize * then proportionally */ if (maxWidth < width || maxHeight < height) { if (width > height) { height = (height * maxWidth) / width; width = appInfo->maxCursorWidth; } else { width = (width * maxHeight) / height; height = appInfo->maxCursorHeight; } } /* Create a depth 1 pixmap (bitmap) for use with the drag icon */ icon_pixmap = XCreatePixmap(display, XtWindow(w), width, height, 1); mask = GCFunction | GCForeground | GCBackground; values.foreground = 1; values.background = 0; values.function = GXcopy; /* create a GC for drawing into the bitmap */ fillGC = XCreateGC(display, icon_pixmap, mask, &values); /* * This draws a filled rectangle. If only an outline is desired * use a XDrawRectangle() call. Note: the outline does not * produce a very nice melt effect. */ XFillRectangle(display, icon_pixmap, fillGC, 0, 0, width, height); /* Free the fill GC */ XFreeGC(display, fillGC); *widthRtn = width; *heightRtn = height; return(icon_pixmap); } /*************************************************************************** *************************************************************************** Functions used in Drawing Outlines: *************************************************************************** ***************************************************************************/ /* * This procedure changes the GC to do rubberband * drawing of a rectangle frame . */ static void SetXorGC(Widget w) { unsigned long valueMask = GCFunction | GCForeground | GCLineWidth | GCPlaneMask; XGCValues values; Pixel bg, fg; XtVaGetValues (w, XmNbackground, &bg, XmNforeground, &fg, NULL); values.function = GXxor; values.plane_mask = fg^bg; /* Better fix for 5127 */ values.foreground = bg; values.line_width = 1; XChangeGC(XtDisplay(w), appInfo->rectGC, valueMask, &values); } /* This procedure returns the GC to it's initial state. */ static void SetNormGC(Widget w) { unsigned long valueMask = GCFunction | GCLineWidth | GCForeground | GCPlaneMask; XGCValues values; values.function = GXcopy; values.foreground = appInfo->currentColor; values.line_width = HIGHLIGHT_THICKNESS; values.plane_mask = 0xFFFFFFFF; XChangeGC(XtDisplay(w), appInfo->rectGC, valueMask, &values); } /* This procedure returns the values of the current rectangle outline */ static void OutlineGetDimensions(Position *x, Position *y, Dimension *width, Dimension *height) { if (appInfo->rectX < appInfo->rectX2) { *x = appInfo->rectX; *width = appInfo->rectX2 - *x; } else { *x = appInfo->rectX2; *width = appInfo->rectX - *x; } if (appInfo->rectY < appInfo->rectY2) { *y = appInfo->rectY; *height = appInfo->rectY2 - *y; } else { *y = appInfo->rectY2; *height = appInfo->rectY - *y; } } static void OutlineDraw(Widget w) { Position x, y; Dimension width, height; OutlineGetDimensions(&x, &y, &width, &height); XDrawRectangle(XtDisplay(w), XtWindow(w), appInfo->rectGC, x, y, width, height); } /* This procedure sets intializes the drawing positions */ static void OutlineSetPosition(Position x, Position y) { appInfo->rectX = appInfo->rectX2 = x; appInfo->rectY = appInfo->rectY2 = y; } /* This procedure resets outline end position */ static void OutlineResetPosition(Position x, Position y) { appInfo->rectX2 = x; appInfo->rectY2 = y; } /* This action procedure begins creating a rectangle at the x,y position * of the button event if a rectangle doesn't already exist at * that position. Otherwise is raises the rectangle to the top * of the drawing area. */ /* ARGSUSED */ void StartRect(Widget w, XEvent *event, String *params, Cardinal *num_params) { Display *display = XtDisplay(w); RectPtr rect; Position x = event->xbutton.x; Position y = event->xbutton.y; rect = RectFind(x, y); /* if there isn't a rectangle at this position, begin creating one */ if (!rect) { appInfo->creatingRect = True; /* set gc for drawing rubberband outline for rectangles */ SetXorGC(w); /* set the initial outline positions */ OutlineSetPosition(x, y); /* Draw the rectangle */ OutlineDraw(w); } else RectRaise(w, rect); } /* This action procedure extends the drawing of the outline * for the rectangle to be created. */ /* ARGSUSED */ void ExtendRect(Widget w, XEvent *event, String *params, Cardinal *num_params) { if (appInfo->creatingRect) { /* erase the old outline */ OutlineDraw(w); /* set the new outline end positions */ OutlineResetPosition(event->xbutton.x, event->xbutton.y); /* redraw the outline */ OutlineDraw(w); } } /* This action procedure creates a rectangle depending on the * dimensions set in the StartRect and ExtendRect action procs. */ /* ARGSUSED */ void EndRect(Widget w, XEvent *event, String *params, Cardinal *num_params) { Position x, y; Dimension width, height; RectPtr rect; if (appInfo->creatingRect) { /* erase the last outline */ OutlineDraw(w); /* return GC to original state */ SetNormGC(w); /* Get the outline dimensions for creating the rectangle */ OutlineGetDimensions(&x, &y, &width, &height); /* we don't want to create zero width or height rectangles */ if (width == 0 || height == 0){ appInfo->creatingRect = False; return; } rect = RectCreate(x, y, width, height, GetColor(RECT_START_COLOR), XmUNSPECIFIED_PIXMAP); RectDraw(XtDisplay(w), XtWindow(w), rect); RectRegister(rect, x, y); appInfo->creatingRect = False; } } /* The procedure assigns new translations the the given widget */ static void SetupTranslations(Widget widget, char *new_translations) { XtTranslations new_table; new_table = XtParseTranslationTable(new_translations); XtOverrideTranslations(widget, new_table); } /* This procedure handles exposure events and makes a call to * RedrawRectangles() to redraw the rectangles * The rectangles at the top of the table are drawn first. */ /* ARGSUSED */ static void HandleExpose(Widget w, XtPointer closure, XtPointer call_data) { RedrawRectangles(w); } /* This procedure sets up the drawing area */ static void CreateDrawingArea(Widget parent) { static char da_translations[] = "#replace : StartMove() \n\ : StartRect() \n\ : ExtendRect() \n\ : EndRect() \n\ c t: XtDisplayTranslations()"; Arg args[10]; int n = 0; XtTranslations new_table; new_table = XtParseTranslationTable(da_translations); /* create drawing area at the top of the form */ n = 0; XtSetArg(args[n], XmNtranslations, new_table); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNwidth, 295); n++; XtSetArg(args[n], XmNheight, 180); n++; XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); n++; XtSetArg(args[n], XmNbackground, GetColor(DRAW_AREA_BG_COLOR)); n++; XtSetArg(args[n], XmNforeground, GetColor(DRAW_AREA_FG_COLOR)); n++; drawingArea = XmCreateDrawingArea(parent, "drawingArea", args, n); XtManageChild(drawingArea); /* add expose callback to redisplay rectangles */ XtAddCallback(drawingArea, XmNexposeCallback, HandleExpose, (XtPointer) NULL); /* add callbacks for UTM */ XtAddCallback(drawingArea, XmNdestinationCallback, (XtCallbackProc) handleDestination, (XtPointer) NULL); XtAddCallback(drawingArea, XmNconvertCallback, (XtCallbackProc) RectConvert, (XtPointer) NULL); } /* This procedure sets up the area for obtaining rectangle colors */ static void CreateColorPushButtons(Widget parent, Widget separator) { static char label_translations[] = ": ColorRect()"; Widget bulletinBoard; Widget children[6]; XmString csString; Arg args[10]; int n = 0; /* Creating an empty compound string so the labels will have no text. */ csString = XmStringCreateSimple(""); /* Creating 6 color labels */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNtopWidget, separator); n++; XtSetArg(args[n], XmNtopOffset, 2); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNwidth, 295); n++; bulletinBoard = XmCreateBulletinBoard(parent, "buletinBoard", args, n); XtManageChild(bulletinBoard); n = 0; XtSetArg(args[n], XmNx, BOX_X_MARGIN); n++; XtSetArg(args[n], XmNy, BOX_Y_MARGIN); n++; XtSetArg(args[n], XmNwidth, BOX_WIDTH); n++; XtSetArg(args[n], XmNheight, BOX_HEIGHT); n++; XtSetArg(args[n], XmNlabelString, csString); n++; XtSetArg(args[n], XmNbackground, GetColor(LABEL1_COLOR)); n++; XtSetArg(args[n], XmNborderWidth, 1); n++; children[0] = XmCreatePushButton(bulletinBoard, "PushButton1", args, n); /* add translations for manipulating rectangles */ SetupTranslations(children[0], label_translations); n = 0; XtSetArg(args[n], XmNx, BOX_X_MARGIN + BOX_X_OFFSET); n++; XtSetArg(args[n], XmNy, BOX_Y_MARGIN); n++; XtSetArg(args[n], XmNwidth, BOX_WIDTH); n++; XtSetArg(args[n], XmNheight, BOX_HEIGHT); n++; XtSetArg(args[n], XmNlabelString, csString); n++; XtSetArg(args[n], XmNbackground, GetColor(LABEL2_COLOR)); n++; XtSetArg(args[n], XmNborderWidth, 1); n++; children[1] = XmCreatePushButton(bulletinBoard, "PushButton1", args, n); /* add translations for manipulating rectangles */ SetupTranslations(children[1], label_translations); n = 0; XtSetArg(args[n], XmNx, BOX_X_MARGIN + (2 * BOX_X_OFFSET)); n++; XtSetArg(args[n], XmNy, BOX_Y_MARGIN); n++; XtSetArg(args[n], XmNwidth, BOX_WIDTH); n++; XtSetArg(args[n], XmNheight, BOX_HEIGHT); n++; XtSetArg(args[n], XmNlabelString, csString); n++; XtSetArg(args[n], XmNbackground, GetColor(LABEL3_COLOR)); n++; XtSetArg(args[n], XmNborderWidth, 1); n++; children[2] = XmCreatePushButton(bulletinBoard, "PushButton3", args, n); /* add translations for manipulating rectangles */ SetupTranslations(children[2], label_translations); n = 0; XtSetArg(args[n], XmNx, BOX_X_MARGIN); n++; XtSetArg(args[n], XmNy, BOX_Y_MARGIN + BOX_Y_OFFSET); n++; XtSetArg(args[n], XmNwidth, BOX_WIDTH); n++; XtSetArg(args[n], XmNheight, BOX_HEIGHT); n++; XtSetArg(args[n], XmNlabelString, csString); n++; XtSetArg(args[n], XmNbackground, GetColor(LABEL4_COLOR)); n++; XtSetArg(args[n], XmNborderWidth, 1); n++; children[3] = XmCreatePushButton(bulletinBoard, "PushButton4", args, n); /* add translations for manipulating rectangles */ SetupTranslations(children[3], label_translations); n = 0; XtSetArg(args[n], XmNx, BOX_X_MARGIN + BOX_X_OFFSET); n++; XtSetArg(args[n], XmNy, BOX_Y_MARGIN + BOX_Y_OFFSET); n++; XtSetArg(args[n], XmNwidth, BOX_WIDTH); n++; XtSetArg(args[n], XmNheight, BOX_HEIGHT); n++; XtSetArg(args[n], XmNtopWidget, children[0]); n++; XtSetArg(args[n], XmNlabelString, csString); n++; XtSetArg(args[n], XmNbackground, GetColor(LABEL5_COLOR)); n++; XtSetArg(args[n], XmNborderWidth, 1); n++; children[4] = XmCreatePushButton(bulletinBoard, "PushButton5", args, n); /* add translations for manipulating rectangles */ SetupTranslations(children[4], label_translations); n = 0; XtSetArg(args[n], XmNx, BOX_X_MARGIN + (2 * BOX_X_OFFSET)); n++; XtSetArg(args[n], XmNy, BOX_Y_MARGIN + BOX_Y_OFFSET); n++; XtSetArg(args[n], XmNwidth, BOX_WIDTH); n++; XtSetArg(args[n], XmNheight, BOX_HEIGHT); n++; XtSetArg(args[n], XmNlabelString, csString); n++; XtSetArg(args[n], XmNbackground, GetColor(LABEL6_COLOR)); n++; XtSetArg(args[n], XmNborderWidth, 1); n++; children[5] = XmCreatePushButton(bulletinBoard, "PushButton6", args, n); /* add translations for manipulating rectangles */ SetupTranslations(children[5], label_translations); /* Managing the children all at once helps performance */ XtManageChildren(children, 6); /* Add convert callbacks */ for(n = 0; n < 6; n++) XtAddCallback(children[n], XmNconvertCallback, (XtCallbackProc) ColorConvert, (XtPointer) NULL); /* Freeing compound string. It is no longer necessary. */ XmStringFree(csString); } /* This procedure initalizes the rectangle display table */ void InitializeRectDpyTable(void) { /* * Initialize display table. This is used to maintain the * order in which the rectangles are displayed */ appInfo->rectDpyTable = (RectPtr *) XtMalloc((unsigned)sizeof(RectPtr)); /* Initialize rectangle counter. This is used in reallocing the tables */ appInfo->rectsAllocd = 1; } /* This procedure creates the components to be displayed */ void CreateLayout(void) { Widget mainWindow, form, separator; Arg args[10]; int n = 0; /* Create main window */ mainWindow = XmCreateMainWindow(topLevel, "mainWindow", args, n); XtManageChild(mainWindow); /* Create form for hold drawing area, separator, and color labels */ n = 0; XtSetArg(args[n], XmNwidth, 300); n++; form = XmCreateForm(mainWindow, "form", args, n); XtManageChild(form); /* Create area for drawing rectangles */ CreateDrawingArea(form); /* Create separator to separate drawing area from color labels */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNtopWidget, drawingArea); n++; XtSetArg(args[n], XmNtopOffset, 5); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNwidth, 300); n++; separator = XmCreateSeparatorGadget(form, "separator", args, n); XtManageChild(separator); /* Create color labels for changing colors of buttons */ CreateColorPushButtons(form, separator); /* Make form the work window of the main window */ n = 0; XtSetArg(args[n], XmNworkWindow, form); n++; XtSetValues(mainWindow, args, n); } /* This procedure initializes the GC for drawing rectangles */ void CreateRectGC(void) { XGCValues values; values.line_style = LineSolid; values.line_width = HIGHLIGHT_THICKNESS; values.foreground = appInfo->currentColor = GetColor(RECT_START_COLOR); appInfo->rectGC = XCreateGC(XtDisplay(topLevel), XtWindow(drawingArea), GCLineStyle | GCLineWidth | GCForeground, &values); } motif-2.3.8/demos/programs/drag_and_drop/Makefile.am0000644000175000017500000000073313145162623017351 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/drag_and_drop datadir = ${prefix}/share/Xm/drag_and_drop bin_PROGRAMS = DNDDemo simpledrop EXTRA_DIST = simpledrop.man DNDDemo.man README DNDDemo_SOURCES = DNDDemo.c DNDDraw.c simpledrop_SOURCES = simpledrop.c data_DATA = $(EXTRA_DIST) $(DNDDemo_SOURCES) $(simpledrop_SOURCES) noinst_HEADERS = DNDDemo.h LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/piano/0000755000175000017500000000000013211513007013703 500000000000000motif-2.3.8/demos/programs/piano/Inv8_part1.piano0000644000175000017500000000302712672140200016611 0000000000000012 200 12 1 7 12 200 12 2 7 4 400 6 3 4 4 400 10 4 6 4 400 6 5 4 4 400 13 6 8 4 400 6 7 4 4 400 18 8 11 0 200 17 9 10 0 200 15 10 9 0 200 13 11 8 0 200 15 12 9 0 200 13 13 8 2 200 11 14 6 0 200 10 15 6 2 200 11 16 6 0 200 10 17 6 0 200 8 18 5 4 400 6 19 4 4 400 10 20 6 4 400 13 21 8 4 400 10 22 6 4 400 18 23 11 4 400 13 24 8 0 200 22 25 13 0 200 25 26 15 2 200 23 27 13 0 200 25 28 15 0 200 22 29 13 0 200 25 30 15 2 200 23 31 13 0 200 25 32 15 0 200 22 33 13 0 200 25 34 15 2 200 23 35 13 0 200 25 36 15 0 200 18 37 11 0 200 22 38 13 0 200 20 39 12 0 200 22 40 13 0 200 18 41 11 0 200 22 42 13 0 200 20 43 12 0 200 22 44 13 0 200 18 45 11 0 200 22 46 13 0 200 20 47 12 0 200 22 48 13 0 200 15 49 9 0 200 18 50 11 0 200 17 51 10 0 200 18 52 11 0 200 15 53 9 0 200 18 54 11 0 200 17 55 10 0 200 18 56 11 0 200 15 57 9 0 200 18 58 11 0 200 17 59 10 0 200 18 60 11 4 400 12 61 7 4 400 8 62 5 4 400 15 63 9 4 400 12 64 7 4 400 18 65 11 4 400 15 66 9 0 200 20 67 12 0 200 22 68 13 0 200 20 69 12 0 200 18 70 11 0 200 17 71 10 0 200 18 72 11 0 200 17 73 10 0 200 15 74 9 0 200 13 75 8 0 200 15 76 9 0 200 13 77 8 2 200 11 78 6 4 400 10 79 6 0 200 15 80 9 0 200 13 81 8 0 200 12 82 7 0 200 13 83 8 0 200 12 84 7 0 200 10 85 6 0 200 8 86 5 0 200 10 87 6 0 200 8 88 5 0 200 6 89 4 0 200 5 90 3 0 200 6 91 4 0 200 5 92 3 0 200 3 93 2 4 400 1 94 1 0 200 13 95 8 0 200 12 96 7 4 400 13 97 8 4 400 5 98 3 4 400 6 99 4 4 400 13 100 8 4 400 5 101 3 4 400 13 102 8 4 400 3 103 2 4 400 12 104 7 8 800 13 105 8 12 200 10 106 6 12 200 10 107 6 12 200 10 108 6 12 200 10 109 6 motif-2.3.8/demos/programs/piano/Makefile.in0000644000175000017500000005501613211512766015712 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = piano$(EXEEXT) subdir = demos/programs/piano ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_piano_OBJECTS = piano.$(OBJEXT) piano_OBJECTS = $(am_piano_OBJECTS) piano_LDADD = $(LDADD) piano_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(piano_SOURCES) DIST_SOURCES = $(piano_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/piano build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/piano datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in piano_SOURCES = piano.c EXTRA_DIST = piano.images README Inv8_part1.piano Inv8_part2.piano \ piano.man data_DATA = $(EXTRA_DIST) $(piano_SOURCES) LDADD = ../../../lib/Xm/libXm.la -lm INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/piano/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/piano/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list piano$(EXEEXT): $(piano_OBJECTS) $(piano_DEPENDENCIES) $(EXTRA_piano_DEPENDENCIES) @rm -f piano$(EXEEXT) $(AM_V_CCLD)$(LINK) $(piano_OBJECTS) $(piano_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/piano.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/piano/piano.man0000644000175000017500000001414612672140200015435 00000000000000.\" $XConsortium: piano.man /main/4 1995/07/17 10:48:30 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH piano 1X MOTIF "Demonstration programs" .SH NAME \fBpiano\fR\(emMIDI demo .SH SYNOPSIS .sS \fBpiano\fR .sE .SH DESCRIPTION The Piano demo shows how one might write a MIDI (MOTIF INTERFACE to DUMB INSTRUMENTS) application. Both a staff, for writing music, and keyboard are provided. Piano is a musical demo that allows multiple voices to be played by connecting to other displays. It also provides the capability to save and restore voices. .PP When running the program, you can either play the keyboard directly by 'tickling the ivories' using Button1, or you can enter notes by pressing Button 1 on the staff and depositing the active note specified by the cursor. To change the active note, select another note or rest in the pallet at the bottom. The selected note will be displayed as the new mouse cursor. .PP Though the note selection is limited, it is possible to play sharps as well as naturals. The interface isn't advanced enough to handle flats. Note that E# will play as F and B# will play as C. .PP The staff will automatically resize larger as notes are added past the right side of the staff. To see these notes, scroll the score window as needed. .PP If you wish to delete a note in the staff, press Button2 over the note. The note will disappear and the notes to the right will shift over. .PP Pressing Button3 over the staff will display a popup menu associated with this staff. It contains the following items: .PP \fBAdd Voice\fR This function is used to connect .br another display to a new staff. .br After selecting this command, you .br will be prompted for the display .br to connect. Any music written in .br the new staff will play to this .br display. Note that pressing the .br right mouse button on the new staff .br will show the name of the display .br in the menu's title.In addition, .br this menu's commands will relate .br to this staff. .br The new staff will be added to the .br bottom of the score and it may be .br necessary to scroll down to make .br it visible. .PP \fBRemove Voice\fR Removes a staff and voice from the .br score. There is no undo for this .br command; all music written in this .br staff will be deleted. .PP \fBClear Voice\fR Removes all notes in a .br staff. This will not effect the .br display connection. .PP \fBPlay Voice\fR Plays the notes in the selected .br staff. If the resource, .br \fBuseKeyboard\fR, is set to True, .br which is the default, the keyboard .br will play along. .PP \fBPlay All\fR Plays all voices in the score .br together. .PP \fBSave Voice\fR Saves the selected voice to a file. .br A File Selection Dialog will be .br displayed to prompt for the name of .br the file in which to save the voice. .br The display connection information .br is not saved. .PP \fBLoad Voice\fR Loads a voice from a file. This will .br append to any existing notes .br in the voice. .PP Piano also supports the following resources: .PP \fBbaseDuration\fR Sets the duration of a quarter note .br (in msec). .br Default value = 200 .PP \fBbaseFrequency\fR Sets the frequency of bottom note .br (in Hz). .br Default value = 246.9413 .PP \fBuseKeyboard\fR Specifies if keyboard should play .br along. .br Default value = True .PP \fBwkeyCount\fR Is the number of white keys on the .br keyboard. .br Default value = 28 .PP \fBkeyHeight\fR Is the initial height in pixels of .br the white keys. .br Default value = 160 .PP \fBkeyWidth\fR Is the initial width in pixels of .br the white keys. .br Default value = 20 .PP Two voices are included with the demo, \fBInv8_part1.piano\fR and \fBInv8_part2.piano\fR. These are the two voices of Bach's Invention #8. Try loading these into two voices connected to different displays and play them together. .SS Problems So far, changing the pitches doesn't seem to work on SUN, DEC PMAX3100, and SGI Personal Iris. On the RS6000 and HP700 things should work fine. If XBell() doesn't work correctly on your system change the PlayNote() function as needed. .PP ----- .br Enjoy, .br Andrew deBlois motif-2.3.8/demos/programs/piano/piano.c0000644000175000017500000015450713066310437015123 00000000000000/* $TOG: piano.c /main/11 1997/05/14 13:42:25 bill $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /**************************************************************************** **************************************************************************** ** ** File: piano.c ** ** Version: 2.0 ** ** By: Andrew deBlois ** ** This application won't be able to play tunes on the pmax and sun ** since you can't change the tones generated by XBell. ** **************************************************************************** ****************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "piano.images" /* note that anything after REST must be some type of rest. */ typedef enum {EIGHTH, EIGHTHDOT, EIGHTHSHARP, EIGHTHDOTSHARP, QUARTER, QUARTERDOT, QUARTERSHARP, QUARTERDOTSHARP, HALF, HALFDOT, HALFSHARP, HALFDOTSHARP, REST, RESTDOT, LAST_NOTE} NoteType; char *noteName[] = {"eighth", "eighthdot", "eighthsharp", "eighthdotsharp", "quarter", "quarterdot", "quartersharp", "quarterdotsharp", "half", "halfdot", "halfsharp", "halfdotsharp", "rest", "restdot"}; typedef enum { MENU_QUIT, MENU_HELP } MenuFunction; /*-------------------------------------------------------------* | Types | *-------------------------------------------------------------*/ /***** * NoteDescription: Structure to hold the description of all note types supported. */ typedef struct _NoteDescription { Pixmap image; Pixmap mask; } NoteDescription; /***** * NoteRec: Data stored in each note after it is added to the staff. */ typedef struct _NoteRec { Display *display; NoteType noteType; /* type of note or rest. */ int noteDuration; int noteNumber; /* number of note to play */ int noteIndex; /* index used for positioning. */ int ledgerLine; struct _NoteRec *next; } NoteRec; /***** * StaffRec: Data used to manipulate the staff containing a list of notes. */ typedef struct _StaffRec { Display *display; Widget staff; NoteRec *notes; Widget divider; /* seperator above this staff. */ struct _StaffRec *prev, *next; } StaffRec; /***** * AppData: Data used throughout the app to hold all necessary data. */ typedef struct _AppData { /* resources */ int baseDuration; /* equal to one quarter note */ float baseFrequency; /* frequency assigned to new staffs. */ Boolean useKeyboard; /* if true, keyboard played with voice(s). */ int wkeyCount; /* number of white keys on the keyboard. */ int keyHeight; /* white key keight - also sets black keys */ int keyWidth; /* width of each black key. */ /* data */ GC noteGC; NoteType activeNoteType; /* index into the noteTable */ NoteDescription noteTable[LAST_NOTE]; /* definition info for each note type. */ StaffRec *staffList; /* holds list of all staffs (voices). */ Widget score; /* the rowcolumn holding the staffs. */ } AppData; /*-------------------------------------------------------------* | defines | *-------------------------------------------------------------*/ #define APP_NAME "piano" #define APP_CLASS "Piano" /* * default resource settings. */ #define DEFAULT_BASE_FREQUENCY "246.9413" #define DEFAULT_BASE_DURATION 200 #define DEFAULT_WKEY_COUNT 28 /* number of white keys */ #define DEFAULT_KEY_HEIGHT 160 #define DEFAULT_KEY_WIDTH 20 #define LOCAL_NAME "local" /* just used for a label */ #define EMSG1 "Fatal Error -- Cannot allocate memory for resources.\n" /*-------------------------------------------------------------* | Resources | *-------------------------------------------------------------*/ XtResource appRes[] = { {"baseDuration", "BaseDuration", XtRInt, sizeof(int), XtOffsetOf(AppData, baseDuration), XtRImmediate, (XtPointer)DEFAULT_BASE_DURATION}, {"baseFrequency", "BaseFrequency", XtRFloat, sizeof(float), XtOffsetOf(AppData, baseFrequency), XmRString, DEFAULT_BASE_FREQUENCY}, {"useKeyboard", "UseKeyboard", XtRBoolean, sizeof(Boolean), XtOffsetOf(AppData, useKeyboard), XmRImmediate, (XtPointer)TRUE}, {"wkeyCount", "WkeyCount", XtRInt, sizeof(int), XtOffsetOf(AppData, wkeyCount), XtRImmediate, (XtPointer)DEFAULT_WKEY_COUNT}, {"keyHeight", "KeyHeight", XtRInt, sizeof(int), XtOffsetOf(AppData, keyHeight), XtRImmediate, (XtPointer)DEFAULT_KEY_HEIGHT}, {"keyWidth", "KeyWidth", XtRInt, sizeof(int), XtOffsetOf(AppData, keyWidth), XtRImmediate, (XtPointer)DEFAULT_KEY_WIDTH}, }; /*-------------------------------------------------------------* | Function Declarations | *-------------------------------------------------------------*/ /* KEYBOARD */ void BuildKeys (Widget); Widget CreateKeyboard (Widget); /* SCORE */ StaffRec *GetStaffData (Widget); void DrawNotes (Widget, int, int); void DrawStaffCB (Widget, XtPointer, XtPointer); void SetIcon (Widget, Pixmap); void DrawNote (Widget, NoteRec *, int, int); void SetActiveNote (Widget, NoteType); void AddNoteAtPosn (Widget, int, NoteType); void AddNoteToStaffCB (Widget, XtPointer, XtPointer); void AddNewStaff (Display *, char *); void PostStaffMenu (Widget, XtPointer, XEvent *, Boolean *); void CreateStaffMenu (Widget, Widget, char *); /* OTHER */ void AddVoiceCB (Widget, XtPointer, XtPointer); void RemoveVoiceCB (Widget, XtPointer, XtPointer); void ClearVoiceCB (Widget, XtPointer, XtPointer); void PlayVoiceCB (Widget, XtPointer, XtPointer); void PlayAllCB (Widget, XtPointer, XtPointer); void SetAppIcon (Widget); void GetBell (Display *); void SetBell (Display *, int, int); int Pitch (int); void PlayNote (XtPointer, XtIntervalId *); void SoundCB (Widget, XtPointer, XtPointer); void SetNoteCB (Widget, XtPointer, XtPointer); void CreateScore (Widget); Widget CreateNotebook (Widget); void CvtStrToFloat (XrmValue *, Cardinal *, XrmValue *, XrmValue *); /* Globals */ AppData *appData; XtAppContext context; int orig_percent, orig_pitch, orig_duration; Widget key[1000]; String fallback[] = { "Piano*highlightThickness: 0", "Piano*borderWidth: 0", "Piano*iconImage: Piano.bmp", "Piano*borderWidth: 0", "Piano*margin: 0", "Piano*wKey.background: white", "Piano*bKey.background: black", "Piano*wKey.foreground: black", "Piano*bKey.foreground: white", "Piano*wKey.shadowThickness: 2", "Piano*bKey.shadowThickness: 4", "Piano*wKey.armColor: grey85", "Piano*bKey.armColor: grey0", "Piano*wKey.topShadowColor: white", "Piano*bKey.bottomShadowColor: black", "Piano*wKey.topShadowColor: grey60", "Piano*bKey.bottomShadowColor: grey20", "Piano*bKey.labelString: ", "Piano*wKey.labelString: ", "Piano*keyboard.marginWidth: 10", "Piano*keyboard.marginHeight: 10", "Piano*scoreWin.height: 111", "Piano*staff.width: 920", "Piano*staff.height: 100", "Piano*popupBtn1.labelString: Add Voice", "Piano*popupBtn2.labelString: Remove Voice", "Piano*popupBtn3.labelString: Clear Voice", "Piano*popupBtn4.labelString: Play Voice", "Piano*popupBtn5.labelString: Play All", "Piano*popupBtn6.labelString: Save Voice", "Piano*popupBtn7.labelString: Load Voice", "Piano*cascade1.labelString: File", "Piano*cascade2.labelString: Help", "Piano*b1.labelString: Quit", "Piano*notebook.orientation: horizontal", "Piano*notebook.adjustLast: false", "Piano*notebook*paneMaximum: 40", "Piano*dspPromptDlog.labelString: Enter name of display to connect to:", "Piano*warnDlog.messageString: Error in connecting to display", "Piano*helpDlog*messageString:\ Piano Demo\\n\ ----------\\n\ Press Btn3 on a staff to post an associated menu\\n\ containing the following items:\\n\ Add Voice - Add a new staff and voice. Each voice may\\n\ connect to a different display.\\n\ Remove Voice - Removes a staff and voice from the score.\\n\ Clear Voice - Removes all notes in a staff.\\n\ Play Voice - Plays the notes in the selected staff.\\n\ Play All - Plays all voices in the score together.\\n\ Save Voice - Saves the selected voice to a file.\\n\ Load Voice - Loads a voice from a file. This will\\n\ append to any existing notes in the voice.\\n\\n\ To delete a note, press Btn2 over the desired note in a staff.\\n\\n\ Settable resources are:\\n\ baseDuration - sets the duration of a quarter note. (msec)\\n\ baseFrequency - sets the frequency of bottom note. (Hz)\\n\ useKeyboard - specifies if keyboard should play along.\\n\ wkeyCount - number of white keys on the keyboard.\\n\ keyHeight - initial height in pixels of the white keys.\\n\ keyWidth - initial width in pixels of the white keys.", NULL }; /***********************************************************************/ /*----------------------------------------------------------------* | MyErrorHandler | *----------------------------------------------------------------*/ int MyErrorHandler (Display *display, XErrorEvent *errorEvent) { /* this is most likely invoked when the frequency selected is out of range. */ printf("X Error!\n"); return 0; /* Ignored by X. */ } /*----------------------------------------------------------------* | DoQuit | *----------------------------------------------------------------*/ void DoQuit () { exit(0); } /*----------------------------------------------------------------* | DoHelp | *----------------------------------------------------------------*/ void DoHelp () { static Widget dlog = NULL; Arg args[3]; int n; if (dlog == NULL) { dlog = XmCreateInformationDialog(appData->score, "helpDlog", NULL, 0); XtUnmanageChild( XmMessageBoxGetChild (dlog, XmDIALOG_HELP_BUTTON) ); XtUnmanageChild( XmMessageBoxGetChild (dlog, XmDIALOG_CANCEL_BUTTON) ); } XtManageChild(dlog); } /*----------------------------------------------------------------* | MenuCB | *----------------------------------------------------------------*/ void MenuCB (Widget w, XtPointer clientData, XtPointer callData) { switch ((long)clientData) { case MENU_QUIT: DoQuit(); break; case MENU_HELP: DoHelp(); break; } } /*--------------------------------------------------------------------* | DoAddVoiceCB | *--------------------------------------------------------------------*/ void DoAddVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { XmSelectionBoxCallbackStruct *cb = (XmSelectionBoxCallbackStruct *)callData; String dspName; Display *newDisplay; String appName, appClass; static Widget dlog = NULL; int n, argc = 0; Arg args[5]; XtGetApplicationNameAndClass(XtDisplay(w), &appName, &appClass); XmStringGetLtoR(cb->value, XmSTRING_DEFAULT_CHARSET, &dspName); newDisplay = XtOpenDisplay(context, dspName, appName, appClass, NULL, 0, &argc, NULL); if (newDisplay != NULL) AddNewStaff(newDisplay, dspName); else { if (dlog == NULL) { n = 0; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; XtSetArg(args[n], XmNdialogType, XmDIALOG_ERROR); n++; dlog = XmCreateWarningDialog(appData->score, "warnDlog", args, n); } XtManageChild(dlog); } if (dspName) XtFree(dspName); } /*--------------------------------------------------------------------* | AddVoiceCB | *--------------------------------------------------------------------*/ void AddVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { Cardinal n; Arg args[5]; static Widget dlog = NULL; if (dlog == NULL) { n = 0; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; XtSetArg(args[n], XmNdialogType, XmDIALOG_PROMPT); n++; dlog = XmCreatePromptDialog(appData->score, "dspPromptDlog", args, n); XtAddCallback(dlog, XmNokCallback, DoAddVoiceCB, NULL); } XtManageChild(dlog); } /*--------------------------------------------------------------------* | RemoveVoiceCB | *--------------------------------------------------------------------*/ void RemoveVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { Widget staff = (Widget)clientData; StaffRec *staffData; staffData = GetStaffData(staff); if (staffData->divider != NULL) XtDestroyWidget(staffData->divider); XtDestroyWidget(staff); if (staffData->next != NULL) staffData->next->prev = staffData->prev; if (staffData->prev != NULL) staffData->prev->next = staffData->next; else appData->staffList = staffData->next; XtFree((char *)staffData); } /*--------------------------------------------------------------------* | ClearVoiceCB | *--------------------------------------------------------------------*/ void ClearVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { Widget staff = (Widget)clientData; StaffRec *staffData; NoteRec *notes, *np; staffData = GetStaffData(staff); if (staffData != NULL) { while (staffData->notes != NULL) { np = staffData->notes; staffData->notes = staffData->notes->next; XtFree((char *)np); } XClearArea(XtDisplay(staff), XtWindow(staff), 0, 0, 0, 0, TRUE); } } /*--------------------------------------------------------------------* | ArmKey | *--------------------------------------------------------------------*/ void ArmKey (XtPointer clientData, XtIntervalId *id) { Widget key = (Widget) clientData; XEvent event; XtCallbackList cbList; XtVaGetValues(key, XmNarmCallback, &cbList, NULL); XtVaSetValues(key, XmNarmCallback, NULL, NULL); XtCallActionProc(key, "Arm", &event, NULL, 0); XtVaSetValues(key, XmNarmCallback, cbList, NULL); } /*--------------------------------------------------------------------* | DisarmKey | *--------------------------------------------------------------------*/ void DisarmKey (XtPointer clientData, XtIntervalId *id) { Widget key = (Widget) clientData; XEvent event; XtCallActionProc(key, "Disarm", &event, NULL, 0); } /*--------------------------------------------------------------------* | PlayNotes | | Note that bell duration and interval timing are defined in X as | | based on milliseconds. Add a timeout for each note to play, then | | let things go. | *--------------------------------------------------------------------*/ void PlayNotes (XtPointer clientData, XtIntervalId *id) { NoteRec *note = (NoteRec *)clientData; XEvent event; XtCallbackList tempCallbackList; int dt = 0; while (note != NULL) { if (note->noteType < REST) { XtAppAddTimeOut(context, dt, PlayNote, note); /* now to press the keys. */ if (appData->useKeyboard) { XtAppAddTimeOut(context, dt, ArmKey, key[note->noteNumber]); XtAppAddTimeOut(context, dt+note->noteDuration, DisarmKey, key[note->noteNumber]); } } dt += note->noteDuration; note = note->next; } } /*--------------------------------------------------------------------* | PlayVoiceCB | *--------------------------------------------------------------------*/ void PlayVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { Widget staff = (Widget)clientData; StaffRec *staffData; NoteRec *notes; staffData = GetStaffData(staff); if (staffData != NULL) XtAppAddTimeOut(context, 1, PlayNotes, staffData->notes); } /*--------------------------------------------------------------------* | PlayAllCB | *--------------------------------------------------------------------*/ void PlayAllCB (Widget staff, XtPointer clientData, XtPointer callData) { StaffRec *sPtr; for (sPtr = appData->staffList; sPtr != NULL; sPtr = sPtr->next) { XtAppAddTimeOut(context, 1, PlayNotes, sPtr->notes); } } /*--------------------------------------------------------------------* | DoSaveVoiceCB | *--------------------------------------------------------------------*/ void DoSaveVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { XmFileSelectionBoxCallbackStruct *fdata = (XmFileSelectionBoxCallbackStruct *)callData; Widget staff = (Widget)clientData; StaffRec *staffData; NoteRec *note; FILE *fp; char *fileName; static Widget errDlog = NULL; if (fdata->length > 0) { XmStringGetLtoR(fdata->value, XmSTRING_DEFAULT_CHARSET, &fileName); staffData = GetStaffData(staff); if (staffData != NULL) { fp = fopen(fileName, "w"); for (note = staffData->notes; note != NULL; note = note->next) { fprintf(fp, "%d %d %d %d %d\n", note->noteType, note->noteDuration, note->noteNumber, note->noteIndex, note->ledgerLine); } fclose(fp); } if (fileName) XtFree(fileName); } } /*--------------------------------------------------------------------* | SaveVoiceCB | *--------------------------------------------------------------------*/ void SaveVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { Widget staff = (Widget)clientData; static Widget fsdlog = NULL; static Widget oldStaff; if (fsdlog == NULL) { fsdlog = XmCreateFileSelectionDialog(staff, "saveDlog", NULL, 0); XtVaSetValues(fsdlog, XmNautoUnmanage, True, XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL, NULL); } else { XtRemoveCallback(fsdlog, XmNokCallback, DoSaveVoiceCB, oldStaff); } XtAddCallback(fsdlog, XmNokCallback, DoSaveVoiceCB, staff); oldStaff = staff; XtManageChild(fsdlog); } /*--------------------------------------------------------------------* | DoLoadVoiceCB | *--------------------------------------------------------------------*/ void DoLoadVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { XmFileSelectionBoxCallbackStruct *fdata = (XmFileSelectionBoxCallbackStruct *)callData; Widget staff = (Widget)clientData; StaffRec *staffData; NoteRec *note, *tail; FILE *fp; Boolean done = FALSE; int noteOffset; char *fileName; if (fdata->length > 0) { XmStringGetLtoR(fdata->value, XmSTRING_DEFAULT_CHARSET, &fileName); fp = fopen(fileName, "r"); if (fileName) XtFree(fileName); if (fp != NULL) { staffData = GetStaffData(staff); if (staffData->notes == NULL) { tail = NULL; noteOffset = 0; } else for (tail=staffData->notes, noteOffset = 1; tail->next != NULL; tail = tail->next, noteOffset++); while (!done) { note = (NoteRec *) XtMalloc(sizeof(NoteRec)); if (fscanf(fp, "%d %d %d %d %d\n", (int *)¬e->noteType, ¬e->noteDuration, ¬e->noteNumber, ¬e->noteIndex, ¬e->ledgerLine) > 0) { note->noteIndex += noteOffset; note->display = staffData->display; note->next = NULL; if (tail == NULL) { staffData->notes = note; tail = note; } else { tail->next = note; tail = tail->next; } } else { XtFree((XtPointer)note); done = TRUE; } } fclose(fp); } XClearArea(XtDisplay(w), XtWindow(staff), 0, 0, 0, 0, TRUE); } } /*--------------------------------------------------------------------* | LoadVoiceCB | *--------------------------------------------------------------------*/ void LoadVoiceCB (Widget w, XtPointer clientData, XtPointer callData) { Widget staff = (Widget)clientData; static Widget fsdlog = NULL; static Widget oldStaff; if (fsdlog == NULL) { fsdlog = XmCreateFileSelectionDialog(staff, "loadDlog", NULL, 0); XtVaSetValues(fsdlog, XmNautoUnmanage, True, XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL, NULL); } else { XtRemoveCallback(fsdlog, XmNokCallback, DoLoadVoiceCB, oldStaff); } XtAddCallback(fsdlog, XmNokCallback, DoLoadVoiceCB, staff); oldStaff = staff; XtManageChild(fsdlog); } /*--------------------------------------------------------------------* | DrawNotes | | x1,x2 specify the clipping width. If they are the same value, no | | clipping is performed. | *--------------------------------------------------------------------*/ void DrawNotes (Widget staff, int x1, int x2) { StaffRec *staffData; NoteRec *notes, *np; staffData = GetStaffData(staff); if (staffData != NULL) for (np = staffData->notes; np != NULL; np = np->next) DrawNote(staff, np, x1, x2); } /*--------------------------------------------------------------------* | DrawStaffCB | *--------------------------------------------------------------------*/ void DrawStaffCB (Widget staff, XtPointer clientData, XtPointer callData) { XExposeEvent *expEvt = (XExposeEvent *)((XmDrawingAreaCallbackStruct*)callData)->event; int i, y; Dimension width, height; if (expEvt->count > 1) return; XtVaGetValues(XtParent(staff), XmNwidth, &width, NULL); XtVaGetValues(staff, XmNwidth, &width, XmNheight, &height, NULL); for (i=4; i<=12; i+=2) { y = i*(int)height / 16; XDrawLine(XtDisplay(staff), XtWindow(staff), DefaultGCOfScreen(XtScreen(staff)), 0, y, width, y); } DrawNotes(staff, expEvt->x, expEvt->x + expEvt->width); } /*-------------------------------------------------------------* | SetAppIcon() | *-------------------------------------------------------------*/ void SetAppIcon(Widget shell) { Pixmap iconPixmap; iconPixmap = XCreateBitmapFromData(XtDisplay(shell), XtScreen(shell)->root, (char*)piano_bits, piano_width, piano_height); XtVaSetValues(shell, XmNiconPixmap, iconPixmap, NULL); } /*--------------------------------------------------------------------* | GetBell | *--------------------------------------------------------------------*/ void GetBell(Display *dpy) { XKeyboardState stateValues; XGetKeyboardControl(dpy, &stateValues); orig_percent = stateValues.bell_percent; orig_pitch = stateValues.bell_pitch; orig_duration = stateValues.bell_duration; } /*--------------------------------------------------------------------* | SetBell | *--------------------------------------------------------------------*/ void SetBell(Display *dpy, int pitch, int duration) { XKeyboardControl controlValues; unsigned long valueMask = KBBellPercent | KBBellPitch | KBBellDuration; controlValues.bell_percent = orig_percent; controlValues.bell_pitch = pitch; controlValues.bell_duration = duration; XChangeKeyboardControl(dpy, valueMask, &controlValues); } /*--------------------------------------------------------------------* | Pitch | *--------------------------------------------------------------------*/ int Pitch (int note) { double x, m, n, f; /* notes are calculated from the base frequency. */ /* This is the first note on the keyboard. */ /* The frequency of a note = 2^(index / 12). */ x = (double)2.0; m = (double)note; n = (double)12.0; f = (double)appData->baseFrequency * pow(x, (m/n)); return((int)f); } /*--------------------------------------------------------------------* | PlayNote | *--------------------------------------------------------------------*/ void PlayNote (XtPointer clientData, XtIntervalId *id) { NoteRec *note = (NoteRec *)clientData; SetBell(note->display, Pitch(note->noteNumber), note->noteDuration); XBell(note->display, 100); SetBell(note->display, orig_pitch, orig_duration); } /*--------------------------------------------------------------------* | SoundCB | *--------------------------------------------------------------------*/ void SoundCB (Widget w, XtPointer noteNumber, XtPointer callData) { XmPushButtonCallbackStruct *cb = (XmPushButtonCallbackStruct *)callData; NoteRec note; /* only play the note if this is a true arm event. */ if (cb->event != NULL) { note.display = XtDisplay(w); note.noteType = EIGHTH; note.noteNumber = (NoteType)noteNumber; note.noteIndex = 0; note.ledgerLine = 0; note.noteDuration = appData->baseDuration; PlayNote(¬e, 0); } } #define MUG_SHOTS 11 /*--------------------------------------------------------------------* | BuildKeys | *--------------------------------------------------------------------*/ void BuildKeys (Widget parent) { Pixmap iconPixmaps[MUG_SHOTS+1]; int i, j = 0, imageCount=MUG_SHOTS; Boolean pixmapsSet = FALSE, easterEgg = False; int noteCount = appData->wkeyCount; static Boolean firstTime = True; if (firstTime) { int x, y, junk; unsigned int bjunk; Window wjunk; firstTime = False; /* dev team's signature... :-) */ XQueryPointer(XtDisplay(parent), RootWindowOfScreen(XtScreen(parent)), &wjunk, &wjunk, &x, &y, &junk, &junk, &bjunk); easterEgg = (x+y == 0); if (easterEgg) { Display *dsp = XtDisplay(parent); Window win = RootWindowOfScreen(XtScreen(parent)); Pixmap shapemask; XpmAttributes attributes; attributes.valuemask = 0; XmeXpmCreatePixmapFromData(dsp, win, none, &(iconPixmaps[0]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, andrew, &(iconPixmaps[1]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, dan, &(iconPixmaps[2]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, dave, &(iconPixmaps[3]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, doug, &(iconPixmaps[4]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, ellis, &(iconPixmaps[5]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, ingeborg, &(iconPixmaps[6]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, jim, &(iconPixmaps[7]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, kamesh, &(iconPixmaps[8]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, scott, &(iconPixmaps[9]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, steve, &(iconPixmaps[10]), &shapemask, &attributes); XmeXpmCreatePixmapFromData(dsp, win, vania, &(iconPixmaps[11]), &shapemask, &attributes); appData->wkeyCount = noteCount = imageCount; } } XtVaSetValues(parent, XmNfractionBase, noteCount * 10, NULL); j = 0; for (i=0; ikeyWidth, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, i*10 + 7, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, i*10 + 13, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, noteCount*6, NULL); XtAddCallback(key[j], XmNarmCallback, SoundCB, (XtPointer)(long)j); } j = 0; for (i=0; ikeyHeight, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, i*10, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, (i+1)*10, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL); XtAddCallback(key[j], XmNarmCallback, SoundCB, (XtPointer)(long)j); if (easterEgg) { XtVaSetValues(key[j], XmNlabelType, XmPIXMAP, XmNlabelPixmap, iconPixmaps[0], XmNarmPixmap, iconPixmaps[(i%imageCount)+1], XmNmarginLeft, 0, XmNmarginRight, 0, XmNmarginTop, 100, NULL); } } } /*--------------------------------------------------------------------* | CreateKeyboard | *--------------------------------------------------------------------*/ Widget CreateKeyboard(Widget parent) { int i, j = 0; Widget keyBoard, wKey, bKey; keyBoard = XtVaCreateWidget("keyBoard", xmFormWidgetClass, parent, NULL); BuildKeys(keyBoard); XtManageChild(keyBoard); return(keyBoard); } /*--------------------------------------------------------------------* | SetIcon | *--------------------------------------------------------------------*/ void SetIcon (Widget w, Pixmap cursorPixmap) { Pixel fgPix, bgPix; Cursor cursor; XColor xcolors[2]; Display *dsp = XtDisplay(w); xcolors[0].pixel = BlackPixelOfScreen(DefaultScreenOfDisplay(dsp)); xcolors[1].pixel = WhitePixelOfScreen(DefaultScreenOfDisplay(dsp)); XQueryColors(dsp, DefaultColormapOfScreen(DefaultScreenOfDisplay(dsp)), xcolors, 2); cursor = XCreatePixmapCursor(dsp, cursorPixmap, cursorPixmap, &(xcolors[0]), &(xcolors[1]), note_x_hot, note_y_hot); XDefineCursor(dsp, XtWindow(w), cursor); } /*--------------------------------------------------------------------* | GetStaffData | | This scans the list of staffs for a match. It returns the data | | associated with the staff. | *--------------------------------------------------------------------*/ StaffRec *GetStaffData (Widget staff) { StaffRec *sPtr; for (sPtr = appData->staffList; sPtr != NULL; sPtr = sPtr->next) { if (sPtr->staff == staff) return (sPtr); } /* should never get here */ return (NULL); } /*--------------------------------------------------------------------* | DrawNote | *--------------------------------------------------------------------*/ void DrawNote (Widget staff, NoteRec *note, int x1, int x2) { Dimension width, height; Pixmap notePix, notePixMask; int x, y; notePix = appData->noteTable[note->noteType].image; notePixMask = appData->noteTable[note->noteType].mask; XtVaGetValues(staff, XmNwidth, &width, XmNheight, &height, NULL); x = note->noteIndex * 15; y = (15 - note->ledgerLine) * (int)height / 16 - (note_height/2) - 4; /* if the position is off the right side of the staff, resize it. */ if ((x + note_width) > (int)width) XtVaSetValues(staff, XmNwidth, x + 2*note_width, NULL); if ((x1 != x2) && (x < x1-note_width || x > x2+note_width)) return; XSetClipMask (XtDisplay(staff), appData->noteGC, notePixMask); XSetClipOrigin(XtDisplay(staff), appData->noteGC, x, y); XCopyArea(XtDisplay(staff), notePix, XtWindow(staff), appData->noteGC, 0, 0, note_width, note_height, x, y); } /*--------------------------------------------------------------------* | SetActiveNote | *--------------------------------------------------------------------*/ void SetActiveNote (Widget w, NoteType noteType) { appData->activeNoteType = noteType; SetIcon(appData->score, appData->noteTable[noteType].mask); XSetClipMask(XtDisplay(w), appData->noteGC, appData->noteTable[noteType].mask); } /*--------------------------------------------------------------------* | SetNoteCB | | callback which sets the active note and modifies the cursor. | *--------------------------------------------------------------------*/ void SetNoteCB (Widget w, XtPointer clientData, XtPointer callData) { NoteType noteType = (NoteType)clientData; SetActiveNote(w, noteType); } /*--------------------------------------------------------------------* | NoteNumber | *--------------------------------------------------------------------*/ int NoteNumber (int ledgerLine, Boolean isASharp) { int n = 0; switch (ledgerLine) { case 1: n = 1; break; case 2: n = 3; break; case 3: n = 5; break; case 4: n = 6; break; case 5: n = 8; break; case 6: n = 10; break; case 7: n = 12; break; case 8: n = 13; break; case 9: n = 15; break; case 10: n = 17; break; case 11: n = 18; break; case 12: n = 20; break; } if (isASharp) return (n+1); else return (n); } /*--------------------------------------------------------------------* | DeleteNoteAtPosn | *--------------------------------------------------------------------*/ void DeleteNoteAtPosn (Widget staff, int x, int y) { int ledgerLine, noteIndex, i; Dimension height; StaffRec *staffData; NoteRec *np, *npTemp; /* find the corresponding ledger line in the staff. */ XtVaGetValues(staff, XmNheight, &height, NULL); ledgerLine = 15 - (16 * y / (int)height); noteIndex = x / 15; staffData = GetStaffData(staff); if ((staffData != NULL) && (staffData->notes != NULL)) { if (noteIndex == 1) { npTemp = staffData->notes; staffData->notes = staffData->notes->next; } else { for (np = staffData->notes; ((noteIndex > 2) && (np->next != NULL)); noteIndex--) np = np->next; if (np->next != NULL) { npTemp = np->next; np->next = np->next->next; } else npTemp = NULL; } if (npTemp != NULL) XtFree((XtPointer)npTemp); for (np = staffData->notes, i = 0; np != NULL; np = np->next) np->noteIndex = ++i; XClearArea(XtDisplay(staff), XtWindow(staff), 0, 0, 0, 0, TRUE); } } /*--------------------------------------------------------------------* | AddNoteAtPosn | *--------------------------------------------------------------------*/ void AddNoteAtPosn (Widget staff, int y, NoteType noteType) { int ledgerLine, noteCount, noteDuration; Dimension height; StaffRec *staffData; NoteRec *noteList, *currentNoteList, *np; Boolean isASharp = FALSE; /* find the corresponding ledger line in the staff. */ XtVaGetValues(staff, XmNheight, &height, NULL); ledgerLine = 15 - (16 * y / (int)height); /* round up to G and down to middle C. */ if (ledgerLine < 1) ledgerLine = 1; else if (ledgerLine > 12) ledgerLine = 12; switch (noteType) { case EIGHTH: noteDuration = appData->baseDuration; break; case EIGHTHDOT: noteDuration = appData->baseDuration*3/2; break; case EIGHTHSHARP: noteDuration = appData->baseDuration; isASharp = TRUE; break; case EIGHTHDOTSHARP: noteDuration = appData->baseDuration*3/2; isASharp = TRUE; break; case QUARTER: noteDuration = appData->baseDuration*2; break; case QUARTERDOT: noteDuration = appData->baseDuration*3; break; case QUARTERSHARP: noteDuration = appData->baseDuration*2; isASharp = TRUE; break; case QUARTERDOTSHARP: noteDuration = appData->baseDuration*3; isASharp = TRUE; break; case HALF: noteDuration = appData->baseDuration*4; break; case HALFDOT: noteDuration = appData->baseDuration*6; break; case HALFSHARP: noteDuration = appData->baseDuration*4; isASharp = TRUE; break; case HALFDOTSHARP: noteDuration = appData->baseDuration*6; isASharp = TRUE; break; case REST: noteDuration = appData->baseDuration; break; case RESTDOT: noteDuration = appData->baseDuration*3/2; break; default: noteDuration = 0; } /* get the staff info - this tells the display to use. */ staffData = GetStaffData(staff); noteList = (NoteRec *)XtMalloc(sizeof(NoteRec)); noteList->display = staffData->display; noteList->noteType = noteType; noteList->noteDuration = noteDuration; noteList->noteNumber = NoteNumber(ledgerLine, isASharp); noteList->ledgerLine = ledgerLine; noteList->next = NULL; /* get the current list of notes. */ currentNoteList = staffData->notes; /* find out how many there are. */ for (noteCount=1, np=currentNoteList; ((np != NULL) && (np->next != NULL)); np=np->next, noteCount++) ; if (np == NULL) { staffData->notes = noteList; noteList->noteIndex = noteCount; } else { np->next = noteList; noteList->noteIndex = noteCount+1; } DrawNote(staff, noteList, 0, 0); } /*--------------------------------------------------------------------* | AddNoteToStaffCB | *--------------------------------------------------------------------*/ void AddNoteToStaffCB (Widget staff, XtPointer clientData, XtPointer callData) { XmDrawingAreaCallbackStruct *cb = (XmDrawingAreaCallbackStruct *)callData; XButtonEvent *btnEvent = (XButtonEvent *)cb->event; int vposn, hposn; if ((btnEvent->button == Button1) && (btnEvent->type == ButtonPress)) { AddNoteAtPosn(staff, btnEvent->y, appData->activeNoteType); } else if ((btnEvent->button == Button2) && (btnEvent->type == ButtonPress)) { DeleteNoteAtPosn(staff, btnEvent->x, btnEvent->y); } } /*--------------------------------------------------------------------* | AddNewStaff | | Creates data for a new staff and adds it to the global score. | | A popup menu is attached to the staff. | *--------------------------------------------------------------------*/ void AddNewStaff (Display *newDisplay, char *dspName) { StaffRec *staffData; staffData = (StaffRec *) XtMalloc(sizeof(StaffRec)); staffData->display = newDisplay; staffData->notes = NULL; staffData->next = staffData->prev = NULL; /* if this is not the first staff, the add a seperator. */ if (appData->staffList != NULL) staffData->divider = XtVaCreateManagedWidget("divider", xmSeparatorWidgetClass, appData->score, NULL); else staffData->divider = NULL; staffData->staff = XtVaCreateManagedWidget("staff", xmDrawingAreaWidgetClass, appData->score, XmNresizePolicy, XmRESIZE_NONE, NULL); XtAddCallback(staffData->staff, XmNexposeCallback, DrawStaffCB, staffData); XtAddCallback(staffData->staff, XmNinputCallback, AddNoteToStaffCB, staffData); CreateStaffMenu(appData->score, staffData->staff, dspName); /* * add the staff to the staff list. */ staffData->next = appData->staffList; if (appData->staffList != NULL) appData->staffList->prev = staffData; appData->staffList = staffData; } /*--------------------------------------------------------------------* | PostStaffMenu | *--------------------------------------------------------------------*/ void PostStaffMenu (Widget w, XtPointer clientData, XEvent *event, Boolean *dispatch) { Widget menu = (Widget)clientData; XButtonEvent *btnEvent = (XButtonEvent *)event; int button; XtVaGetValues(menu, XmNwhichButton, &button, NULL); if (btnEvent->button == button) { XmMenuPosition(menu, btnEvent); XtManageChild(menu); } } /*--------------------------------------------------------------------* | CreateStaffMenu | *--------------------------------------------------------------------*/ void CreateStaffMenu (Widget score, Widget staff, char *dspName) { Widget popupMenu, popupBtn[8]; popupMenu = XmCreatePopupMenu(staff, "popupMenu", NULL, 0); XtAddEventHandler(staff, ButtonPressMask, False, PostStaffMenu, popupMenu); XtVaCreateManagedWidget(dspName, xmLabelWidgetClass, popupMenu, NULL); XtVaCreateManagedWidget("line", xmSeparatorWidgetClass, popupMenu, NULL); popupBtn[1] = XtVaCreateManagedWidget("popupBtn1", xmPushButtonWidgetClass, popupMenu, NULL); popupBtn[2] = XtVaCreateManagedWidget("popupBtn2", xmPushButtonWidgetClass, popupMenu, NULL); popupBtn[3] = XtVaCreateManagedWidget("popupBtn3", xmPushButtonWidgetClass, popupMenu, NULL); popupBtn[4] = XtVaCreateManagedWidget("popupBtn4", xmPushButtonWidgetClass, popupMenu, NULL); popupBtn[5] = XtVaCreateManagedWidget("popupBtn5", xmPushButtonWidgetClass, popupMenu, NULL); popupBtn[6] = XtVaCreateManagedWidget("popupBtn6", xmPushButtonWidgetClass, popupMenu, NULL); popupBtn[7] = XtVaCreateManagedWidget("popupBtn7", xmPushButtonWidgetClass, popupMenu, NULL); /* if this is the first one, then don't allow it to be removed. */ if (appData->staffList == NULL) XtVaSetValues(popupBtn[2], XmNsensitive, False, NULL); XtAddCallback(popupBtn[1], XmNactivateCallback, AddVoiceCB, NULL); XtAddCallback(popupBtn[2], XmNactivateCallback, RemoveVoiceCB, staff); XtAddCallback(popupBtn[3], XmNactivateCallback, ClearVoiceCB, staff); XtAddCallback(popupBtn[4], XmNactivateCallback, PlayVoiceCB, staff); XtAddCallback(popupBtn[5], XmNactivateCallback, PlayAllCB, NULL); XtAddCallback(popupBtn[6], XmNactivateCallback, SaveVoiceCB, staff); XtAddCallback(popupBtn[7], XmNactivateCallback, LoadVoiceCB, staff); } /*--------------------------------------------------------------------* | CreateScore | | Creates the rowcolumn to holds the staffs. Also creates an option | | menu for manipulating the staffs. The staff is inserted into the | | global appData list of scores. | *--------------------------------------------------------------------*/ void CreateScore(Widget parent) { Widget scoreWin; scoreWin = XtVaCreateManagedWidget("scoreWin", xmScrolledWindowWidgetClass, parent, XmNscrollingPolicy, XmAUTOMATIC, NULL); appData->score = XtVaCreateManagedWidget("score", xmRowColumnWidgetClass, scoreWin, XmNadjustLast, FALSE, XmNnumColumns, 1, XmNorientation, XmVERTICAL, XmNpacking, XmPACK_TIGHT, NULL); AddNewStaff(XtDisplay(appData->score), LOCAL_NAME); } /*--------------------------------------------------------------------* | CreateNotebook | *--------------------------------------------------------------------*/ Widget CreateNotebook(Widget parent) { NoteType noteType; Widget notebook, noteButton[LAST_NOTE]; Pixel fg, bg; Display *dsp = XtDisplay(parent); Window win = RootWindowOfScreen(XtScreen(parent)); int d = DefaultDepthOfScreen(XtScreen(parent)); notebook = XtVaCreateManagedWidget("notebook", xmRowColumnWidgetClass, parent, NULL); /* * create a pushbutton for each note type and setup its callback. */ for (noteType = (NoteType)0; noteType < LAST_NOTE; noteType++) { noteButton[noteType] = XtVaCreateManagedWidget(noteName[noteType], xmPushButtonWidgetClass, notebook, XmNlabelType, XmPIXMAP, XmNlabelPixmap, appData->noteTable[noteType].image, NULL); XtAddCallback(noteButton[noteType], XmNactivateCallback, SetNoteCB, (XtPointer)noteType); } return notebook; } /*-------------------------------------------------------------* | Resource Converter: CvtStrToFloat | *-------------------------------------------------------------*/ void CvtStrToFloat (XrmValue *args, Cardinal *nargs, XrmValue *fromVal, XrmValue *toVal) { static float result; if (sscanf((char *)fromVal->addr, "%f", &result) == 1) { toVal->size = sizeof(float); toVal->addr = (XtPointer) &result; } else XtStringConversionWarning((char *)fromVal->addr, "Float"); } /*----------------------------------------------------------------* | GetAppResources | | The following resources are supported in piano: | | .baseDuration: (int) | | -- frequencey in Hz for middle C. | | .baseFrequency: (float) | | -- duration in ms of a quarter note. | | .wkeyCount: (int) | | -- specifies the number of white keys. | | .keyHeight: (int) | | -- white key pixel height. black keys are calculated. | | .keyWidth: (int) | | -- white key pixel width. black keys are calculated. | *----------------------------------------------------------------*/ AppData *GetAppResources (Widget w) { AppData *appData; if ((appData = (AppData *) XtCalloc(1, sizeof(AppData))) == NULL) { printf(EMSG1); exit(0); } XtGetApplicationResources(w, (XtPointer)appData, appRes, XtNumber(appRes), NULL, 0); return (appData); } /*--------------------------------------------------------------------* | GetNoteImagePixmap | *--------------------------------------------------------------------*/ Pixmap GetNoteImagePixmap(Widget w, NoteType note) { Pixel fg, bg; Display *dsp = XtDisplay(w); Window win = RootWindowOfScreen(XtScreen(w)); int d = DefaultDepthOfScreen(XtScreen(w)); unsigned char *data = NULL; XtVaGetValues(w, XmNforeground, &fg, XmNbackground, &bg, NULL); switch (note) { case EIGHTH: data = eighth_bits; break; case EIGHTHDOT: data = eighth_dot_bits; break; case EIGHTHSHARP: data = eighth_sharp_bits; break; case EIGHTHDOTSHARP: data = eighth_dot_sharp_bits; break; case QUARTER: data = quarter_bits; break; case QUARTERDOT: data = quarter_dot_bits; break; case QUARTERSHARP: data = quarter_sharp_bits; break; case QUARTERDOTSHARP: data = quarter_dot_sharp_bits;break; case HALF: data = half_bits; break; case HALFDOT: data = half_dot_bits; break; case HALFSHARP: data = half_sharp_bits; break; case HALFDOTSHARP: data = half_dot_sharp_bits; break; case REST: data = rest_bits; break; case RESTDOT: data = rest_dot_bits; break; default: ; } return(XCreatePixmapFromBitmapData(dsp, win, (char*)data, note_width, note_height, fg, bg, d)); } /*--------------------------------------------------------------------* | GetNoteMaskPixmap | *--------------------------------------------------------------------*/ Pixmap GetNoteMaskPixmap(Widget w, NoteType note) { Pixel fg, bg; Display *dsp = XtDisplay(w); Window win = RootWindowOfScreen(XtScreen(w)); int d = DefaultDepthOfScreen(XtScreen(w)); unsigned char *data = NULL; XtVaGetValues(w, XmNforeground, &fg, XmNbackground, &bg, NULL); switch (note) { case EIGHTH: data = eighth_bits; break; case EIGHTHDOT: data = eighth_dot_bits; break; case EIGHTHSHARP: data = eighth_sharp_bits; break; case EIGHTHDOTSHARP: data = eighth_dot_sharp_bits; break; case QUARTER: data = quarter_bits; break; case QUARTERDOT: data = quarter_dot_bits; break; case QUARTERSHARP: data = quarter_sharp_bits; break; case QUARTERDOTSHARP: data = quarter_dot_sharp_bits;break; case HALF: data = half_bits; break; case HALFDOT: data = half_dot_bits; break; case HALFSHARP: data = half_sharp_bits; break; case HALFDOTSHARP: data = half_dot_sharp_bits; break; case REST: data = rest_bits; break; case RESTDOT: data = rest_dot_bits; break; default: ; } return (XCreatePixmapFromBitmapData(dsp, win, (char*)data, note_width, note_height, 1, 0, 1)); } /*--------------------------------------------------------------------* | BuildNoteTable | *--------------------------------------------------------------------*/ void BuildNoteTable (Widget w) { NoteType i; for (i = (NoteType)0; inoteTable[i].image = GetNoteImagePixmap(w, i); appData->noteTable[i].mask = GetNoteMaskPixmap(w, i); } } /*--------------------------------------------------------------------* | CreateMenuBar | *--------------------------------------------------------------------*/ void CreateMenuBar (Widget parent) { Cardinal n; Arg args[10]; Widget menuBar; Widget cascade1, cascade2; Widget menuPane1, menuPane2; Widget b1; menuBar = XmCreateMenuBar(parent, "menuBar", NULL, 0); menuPane1 = XmCreatePulldownMenu(menuBar, "menuPane1", NULL, 0); menuPane2 = XmCreatePulldownMenu(menuBar, "menuPane2", NULL, 0); b1 = XtCreateManagedWidget("b1", xmPushButtonWidgetClass, menuPane1, NULL,0); n = 0; XtSetArg(args[n], XmNsubMenuId, menuPane1); n++; cascade1 = XmCreateCascadeButton(menuBar, "cascade1", args, n); XtManageChild(cascade1); n = 0; cascade2 = XmCreateCascadeButton(menuBar, "cascade2", args, n); XtManageChild(cascade2); n = 0; XtSetArg(args[n], XmNmenuHelpWidget, cascade2); n++; XtSetValues(menuBar, args, n); XtAddCallback(b1, XmNactivateCallback, MenuCB, (XtPointer)MENU_QUIT); XtAddCallback(cascade2, XmNactivateCallback, MenuCB, (XtPointer)MENU_HELP); XtManageChild(menuBar); } /*--------------------------------------------------------------------* | Main | *--------------------------------------------------------------------*/ int main(int argc, char **argv) { Widget shell, mainWin, panedWin; Widget keyboard, notebook; int fn; Pixel fg, bg; XGCValues values; shell = XtVaAppInitialize(&context, APP_CLASS, NULL, 0, &argc, argv, fallback, NULL); XSetErrorHandler(MyErrorHandler); XtAddConverter(XtRString, XtRFloat, CvtStrToFloat, NULL, 0); appData = GetAppResources(shell); mainWin = XmCreateMainWindow(shell, "mainWin", NULL, 0); XtManageChild(mainWin); CreateMenuBar(mainWin); panedWin = XtVaCreateManagedWidget("panedWin", xmPanedWindowWidgetClass, mainWin, NULL); keyboard = CreateKeyboard(panedWin); CreateScore(panedWin); BuildNoteTable(panedWin); notebook = CreateNotebook(panedWin); SetAppIcon(shell); XtRealizeWidget(shell); /* get the note GC */ XtVaGetValues(appData->score, XmNforeground, &fg, XmNbackground, &bg, NULL); values.foreground = fg; values.background = bg; appData->noteGC = XtGetGC(appData->score, GCForeground | GCBackground, &values); SetActiveNote(appData->score, QUARTER); /* save the old bell values so that they can be restored. */ GetBell(XtDisplay(shell)); XtAppMainLoop(context); return 0; /* make compiler happy */ } motif-2.3.8/demos/programs/piano/Inv8_part2.piano0000644000175000017500000000306512672140200016614 0000000000000012 200 12 1 7 12 200 12 2 7 12 200 12 3 7 12 200 12 4 7 12 200 12 5 7 12 200 12 6 7 12 200 12 7 7 12 200 12 8 7 12 200 12 9 7 12 200 12 10 7 12 200 12 11 7 12 200 12 12 7 12 200 12 13 7 12 200 12 14 7 4 400 6 15 4 4 400 10 16 6 4 400 6 17 4 4 400 13 18 8 4 400 6 19 4 4 400 18 20 11 0 200 17 21 10 0 200 15 22 9 0 200 13 23 8 0 200 15 24 9 0 200 13 25 8 2 200 11 26 6 0 200 10 27 6 2 200 11 28 6 0 200 10 29 6 0 200 8 30 5 4 400 6 31 4 4 400 10 32 6 4 400 13 33 8 4 400 10 34 6 4 400 18 35 11 4 400 13 36 8 0 200 10 37 6 0 200 13 38 8 2 200 11 39 6 0 200 13 40 8 0 200 10 41 6 0 200 13 42 8 2 200 11 43 6 0 200 13 44 8 0 200 10 45 6 0 200 13 46 8 2 200 11 47 6 0 200 13 48 8 0 200 6 49 4 0 200 10 50 6 0 200 8 51 5 0 200 10 52 6 0 200 6 53 4 0 200 10 54 6 0 200 8 55 5 0 200 10 56 6 0 200 6 57 4 0 200 10 58 6 0 200 8 59 5 0 200 10 60 6 0 200 3 61 2 0 200 6 62 4 0 200 5 63 3 0 200 6 64 4 0 200 3 65 2 0 200 6 66 4 0 200 5 67 3 0 200 6 68 4 0 200 3 69 2 0 200 6 70 4 0 200 5 71 3 0 200 6 72 4 4 400 12 73 7 4 400 8 74 5 4 400 13 75 8 4 400 10 76 6 4 400 17 77 10 4 400 13 78 8 0 200 18 79 11 0 200 20 80 12 0 200 18 81 11 0 200 17 82 10 0 200 15 83 9 0 200 17 84 10 0 200 15 85 9 0 200 13 86 8 0 200 12 87 7 0 200 13 88 8 0 200 12 89 7 0 200 10 90 6 4 400 8 91 5 0 200 13 92 8 0 200 12 93 7 0 200 10 94 6 0 200 12 95 7 0 200 10 96 6 0 200 8 97 5 0 200 6 98 4 0 200 8 99 5 0 200 6 100 4 0 200 5 101 3 0 200 3 102 2 0 200 5 103 3 0 200 3 104 2 0 200 1 105 1 0 200 12 106 7 0 200 8 107 5 0 200 6 108 4 0 200 5 109 3 0 200 6 110 4 4 400 8 111 5 4 400 20 112 12 12 200 10 113 6 12 200 10 114 6 motif-2.3.8/demos/programs/piano/README0000644000175000017500000000776212672140200014520 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:07:33 drk $ */ Piano V2 --------- The Piano demo shows how one might write a MIDI (MOTIF INTERFACE to DUMB INSTRUMENTS) application. Both a staff, for writing music, and keyboard are provided. Piano is a musical demo that allows multiple voices to be played by connecting to other displays. It also provides the capability to save and restore voices. When running the program, you can either play the keyboard directly by 'tickling the ivories' using Button1, or you can enter notes by pressing Button 1 on the staff and depositing the active note specified by the cursor. To change the active note, select another note or rest in the pallet at the bottom. The selected note will be displayed as the new mouse cursor. Though the note selection is limited, it is possible to play sharps as well as naturals. The interface isn't advanced enough to handle flats. Note that E# will play as F and B# will play as C. The staff will automatically resize larger as notes are added past the right side of the staff. To see these notes, scroll the score window as needed. If you wish to delete a note in the staff, press Button2 over the note. The note will disappear and the notes to the right will shift over. Pressing Button3 over the staff will display a popup menu associated with this staff. It contains the following items: Add Voice - This function is used to connect another display to a new staff. After selecting this command, you will be prompted for the display to connect. Any music written in the new staff will play to this display. Note that pressing the right mouse button on the new staff will show the name of the display in the menu's title. In addition, this menu's commands will relate to this staff. The new staff will be added to the bottom of the score and it may be necessary to scroll down to make it visible. Remove Voice - Removes a staff and voice from the score. There is no undo for this command - all music written in this staff will be deleted. Clear Voice - Removes all notes in a staff. This will not effect the display connection. Play Voice - Plays the notes in the selected staff. If the resource, useKeyboard, is set to True, which is the default, the keyboard will play along. Play All - Plays all voices in the score together. Save Voice - Saves the selected voice to a file. A FileSelectionDialog will be displayed to prompt for the name of the file in which to save the voice. The display connection information is not saved. Load Voice - Loads a voice from a file. This will append to any existing notes in the voice. Piano also supports the following resources: baseDuration - sets the duration of a quarter note. (msec) Default value = 200 baseFrequency - sets the frequency of bottom note. (Hz) Default value = 246.9413 useKeyboard - specifies if keyboard should play along. Default value = True wkeyCount - number of white keys on the keyboard. Default value = 28 keyHeight - initial height in pixels of the white keys. Default value = 160 keyWidth - initial width in pixels of the white keys. Default value = 20 Two voices are included with the demo, Inv8_part1.piano and Inv8_part2.piano. These are the two voices of Bach's Invention #8. Try loading these into two voices connected to different displays and play them together. PROBLEMS ======== - So far, changing the pitches doesn't seem to work on SUN, DEC PMAX3100, and SGI Personal Iris. On the RS6000 and HP700 things should work fine. If XBell() doesn't work correctly on your system change the PlayNote() function as needed. ----- Enjoy, Andrew deBlois motif-2.3.8/demos/programs/piano/Makefile.am0000644000175000017500000000061513145162623015673 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/piano datadir = ${prefix}/share/Xm/piano bin_PROGRAMS = piano piano_SOURCES = piano.c EXTRA_DIST = piano.images README Inv8_part1.piano Inv8_part2.piano \ piano.man data_DATA = $(EXTRA_DIST) $(piano_SOURCES) LDADD = ../../../lib/Xm/libXm.la -lm INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/piano/piano.images0000644000175000017500000047004012672140200016126 00000000000000#define piano_width 50 #define piano_height 50 static unsigned char piano_bits[] = { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x01, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x02, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x05, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x03, 0x82, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x03, 0xc5, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x7c, 0xbf, 0xf1, 0x7d, 0x9f, 0x03, 0x42, 0x7c, 0x5f, 0xf1, 0x7d, 0x9f, 0x03, 0x45, 0x10, 0xac, 0x41, 0x10, 0x9c, 0x03, 0x42, 0x10, 0x5c, 0x41, 0x10, 0x9c, 0x03, 0x45, 0x10, 0xac, 0x41, 0x10, 0x9c, 0x03, 0x42, 0x10, 0x5c, 0x41, 0x10, 0x9c, 0x03, 0x45, 0x10, 0xac, 0x41, 0x10, 0x9c, 0x03, 0x42, 0x10, 0x5c, 0x41, 0x10, 0x9c, 0x03, 0x45, 0x10, 0xac, 0x41, 0x10, 0x9c, 0x03, 0x42, 0x10, 0x5c, 0x41, 0x10, 0x8c, 0x03, 0xc5, 0xff, 0xff, 0xff, 0xff, 0x87, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x05, 0x40, 0x00, 0x00, 0x10, 0x80, 0x03, 0x02, 0xc0, 0x00, 0x00, 0x30, 0x80, 0x03, 0x05, 0x40, 0x01, 0x00, 0x50, 0x80, 0x03, 0x02, 0x40, 0x60, 0x00, 0x10, 0x80, 0x03, 0x05, 0x70, 0xf0, 0x00, 0x1c, 0x80, 0x03, 0x82, 0x78, 0x70, 0x10, 0x1e, 0x84, 0x03, 0x85, 0x31, 0x14, 0x30, 0x0c, 0x8c, 0x03, 0x82, 0x02, 0x18, 0x50, 0x00, 0x94, 0x03, 0x85, 0x00, 0x14, 0x10, 0x00, 0x84, 0x03, 0xe2, 0x00, 0x18, 0x1c, 0x00, 0x87, 0x03, 0xf5, 0x00, 0x10, 0x1e, 0x80, 0x87, 0x03, 0x62, 0x00, 0x00, 0x0c, 0x00, 0x83, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03}; #define note_width 16 #define note_height 16 #define note_x_hot 4 #define note_y_hot 16 static unsigned char eighth_bits[] = { 0x00, 0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x1d, 0x00, 0x39, 0x00, 0x31, 0x00, 0x21, 0x78, 0x21, 0xfc, 0x21, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfc, 0x00, 0x38, 0x00}; static unsigned char quarter_bits[] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfc, 0x00, 0x38, 0x00}; static unsigned char half_bits[] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0x8e, 0x01, 0x86, 0x01, 0xc6, 0x01, 0xfc, 0x00, 0x38, 0x00}; static unsigned char rest_bits[] = { 0x00, 0x20, 0x00, 0x10, 0x00, 0x18, 0x00, 0x0c, 0x38, 0x0f, 0xfc, 0x07, 0xfc, 0x05, 0x78, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x20, 0x00}; static unsigned char rest_dot_bits[] = { 0x00, 0x20, 0x00, 0x10, 0x00, 0x18, 0x00, 0x0c, 0x38, 0x0f, 0xfc, 0x07, 0xfc, 0x05, 0x78, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x80, 0x00, 0x80, 0x08, 0x40, 0x1c, 0x40, 0x1c, 0x20, 0x08}; static unsigned char eighth_dot_bits[] = { 0x00, 0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x1d, 0x00, 0x39, 0x00, 0x31, 0x00, 0x21, 0x78, 0x21, 0xfc, 0x21, 0xfe, 0x01, 0xfe, 0x09, 0xfe, 0x1d, 0xfc, 0x1c, 0x38, 0x08}; static unsigned char quarter_dot_bits[] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0xfe, 0x01, 0xfe, 0x09, 0xfe, 0x1d, 0xfc, 0x1c, 0x38, 0x08}; static unsigned char half_dot_bits[] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0x8e, 0x01, 0x86, 0x09, 0xc6, 0x1d, 0xfc, 0x1c, 0x38, 0x08}; static unsigned char eighth_sharp_bits[] = { 0x00, 0x51, 0x00, 0xfb, 0x00, 0x57, 0x00, 0xff, 0x00, 0x57, 0x00, 0x1d, 0x00, 0x39, 0x00, 0x31, 0x00, 0x21, 0x78, 0x21, 0xfc, 0x21, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfc, 0x00, 0x38, 0x00}; static unsigned char quarter_sharp_bits[] = { 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfc, 0x00, 0x38, 0x00}; static unsigned char half_sharp_bits[] = { 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0x8e, 0x01, 0x86, 0x01, 0xc6, 0x01, 0xfc, 0x00, 0x38, 0x00}; static unsigned char eighth_dot_sharp_bits[] = { 0x00, 0x51, 0x00, 0xfb, 0x00, 0x57, 0x00, 0xff, 0x00, 0x57, 0x00, 0x1d, 0x00, 0x39, 0x00, 0x31, 0x00, 0x21, 0x78, 0x21, 0xfc, 0x21, 0xfe, 0x01, 0xfe, 0x09, 0xfe, 0x1d, 0xfc, 0x1c, 0x38, 0x08}; static unsigned char quarter_dot_sharp_bits[] = { 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0xfe, 0x01, 0xfe, 0x09, 0xfe, 0x1d, 0xfc, 0x1c, 0x38, 0x08}; static unsigned char half_dot_sharp_bits[] = { 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0xf9, 0x00, 0x51, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x78, 0x01, 0xfc, 0x01, 0x8e, 0x01, 0x86, 0x09, 0xc6, 0x1d, 0xfc, 0x1c, 0x38, 0x08}; /* XPM */ static char * none [] = { /* width height ncolors cpp [x_hot y_hot] */ "1 1 1 1 -1 -1", /* colors */ " s none m none c none", /* pixels */ " "}; /* XPM */ static char * andrew [] = { /* width height ncolors cpp [x_hot y_hot] */ "98 126 4 1 -1 -1", /* colors */ " c black", ". c #555555555555", "X c #AAAAAAAAAAAA", "o c white", /* pixels */ " ", " ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ", " ................. ...............................................................................", " ...... ... . . . . . . . . . . . . ... . . ... . . . . . . ... ... ... . . . . . . ... ... ... ..", " .................................................................................................", " .... . . . . . . . . ... ... ... ... . . ... . . . . . . . . . . . . . . . . . . . . . . . . . . ", " .................................................................................................", " ...... ... ... ... ... ... ... ... ... ... . . . . . . ... ... ... . . ... ... ... ... ... ... ..", " X.............................................X.X................................................", " .... . . . . . . . . ... . . ... . . . . . . . . . . . . . . . . . . . . . . ... . . . . . . ... ", " X........................................ ....... ... ...........................................", " ...... ... ... ... ... ... ... ... . . . . . . . . . . . . . . . . ... ... ... ... ... ... ... ..", " X.......................................... ... . . . . . . .....................................", " .... . . ... ... . . . . . . . . . . . . . . . . . . . . . . . ... ... ... . . ... ... ", " ..................................... . . . . . . . . . . . . ...................................", " .......... ... ... ... ... . . . . . . . . . . . . . . ... ... ... ... ... ....... ..", " ............................... . . . . . . . . . . . . . . . ...................................", " .... ... . . . . . . . . . . . . . . . . ... ... ... ... ... . . ... ", " ............................. . . . . . . . . ... . . . . . . . . ...............................", " ...... ... ... ... ... ... . . . . . . . . . . . . . ... ... ... ... ... ... ..", " ............................. . . . . . . . . . . . . . . . . . . . .............................", " .... ... ... . . ... ... . . . . . . . . . . . ... ... ... ... ... ....", " ........................... . . . . . . . . . . . . . . . . . . . . . ...........................", " .............. ... ... ... . . . . . . . . . . . . . . . . . . ..........................", " X.......................... . . . . . . . . ... . . . . . . . ..... . . .........................", " ........ ... ... . . ... . . . . . . . . . ... . . . . . ... ... ... ... ... ... ", " ......................... . . . . . . . . . . ..........X.X.. ... . . . .........................", " .......... ....... ... . . . . . . . ......X.X.X.X.X.... . . . . . . ......................", " X...................... . . . . . . . . . ..X.XXXXXXXXXXXXX.X.... . . . .........................", " ............ ... ... . . . . . . . ...XXXXXXXXXXXX.X.... . . . ........................", " ....................... . . . . . . . . . ..XXXXoXoXoXoXXXXXX.X.. . . . . .......................", " ...................... . . . . . . . . . ..XXoXoXXXoXXXXXX.X.... . . . . ......................", " X...................... . . . . . . . . . ..oXoXoXoXoXoXoXXXXXX.X.... . . ......................X", " ............ ... ... . . . . . . . . ..XXoXoXoXoXXXoXXXX.X.X.... . . . ......................", " X.................... . . . . . . . . . . XXoXoooXoXoXoXoXoXXXXXX.... . . .......................", " .........X.......... . . . . . . . . . XXXXoXoXoXXXoXXXXXXXX.X...... . . ......................", " X...X.................. ... ... . . ....XXoXoXoXoXoXoXoXoXXXXXXXX...... . ..X....................", " .................... . . . . . . ......X.XXXXXXoXXXXXXXXXXXX.X.X.... . . . ....................", " X.X.................. . . . ....X.XXX.XXXXXXXXoXoXoXXXoXXXXXXXXXX.... . . .......................", " .................. . . . . . ....X.X.X.XXXXXXXXXXXXXXXXXXXXX.X.X.... . . . ......................", " X...X.............. . . . . ....X.XXXXXXXXXXoXXXoXoXoXXXoXXXXXX.X...... . ......................X", " ........ ....... . . . . ......X.X.X.XXoXoXoXXXoXoXoXXXX.X.X.... . . . ... ... ... ........", " ................... . . . . ........X.X.XXoXoooooooooXoXX.X.X........ . . .......................", " .................. . . . . . ..... . . XX..XXoXXXoXoXXXX...... . ... . . ......................", " ................... . . . . ... . . ...Xo...X..XXXXXX.X...X.... ..... . . . .....................", " .... X.. ... ... . . . . . . . . . ..... ..XXXXX.. . .oo . . . . . . ... ... ... ........", " X.....X.......... . . . . . . . . ............X.oXX.......X...... . . . . . .....................", " X. ... ....... . . . . . . . . . . . . .....ooX... ... . . . . . . . . . ....... ..........", " o................ . . . . ... . ... ... ........XXX.X...... ... ... . . . . ....................X", " X. . ... ... . . . . . . . . . . . ... ....X........ . . . . . . . . . . . ... ... ... ", " ................. . . . . . . ... ... ..........XXX.....X.. . . ... . ... . .....................", " .. ....... ... . . . . . . . . . ... ....... ..X........ ... . . . . . . ... ... ... ... ... ..", " X................ . . ..... ............X.......XXX.....X.............. ... .....................", " .... ... . . . . . ..... . . . ............. ..X.. ............. . . ... . . . ... ... ... ... ", " ................. . . ..X.............X.X.X.....X.X.....X.X...X........XX........................", " ...... ... ... . . . ..X.X ......................X.......X........ ....XX. . . ... ... ... ... ..", " X.................. . .XX.........X.X.X.X...X...X.X.....X.X.X.X.X.....XXX........................", " .... . . . . . . . . ..X.... ....................... ............... ..X.. . . . . . . . . . . . ", " ..................... ..X.............X.X.X.....X.X...X.X.X.X.X.......X.X........................", " .. ... . . . . ... . ....... ........X.X.X.......X.....X.X.............X.. ... . . ... ... ... ..", " X.......................X.......X.X.X.X.XXX.....XXX.....XXX.X.X.X.....X.X........................", " .... . . . . . . . . . ..... ........X.X.X.. ....X.......XXX........ ..X.. . ... . . . . ... . . ", " X.................... ............X.X.XXXXX.....X.X.....XXXXX.X..................................", " .. ... ... . . ... . . ..... . ......X.XXX.... ....... ..X.X.X...... ..... ... ... ... ... ... ..", " X.......................X.X.......X.X.XXXXX.............XXXXX.X.X................................", " .. . . . . . . . . . . . ... ... ......X.X...... ... ..X.X.X........ . . . . . . . ... . . . . ", " ..................... . . . ........X.XXX.X.....X.X.....X.X.X.X...... . .........................", " .. ... ... ... . . ... . . . . ......X.X.........X.......X.X.X...... . . . . . ... ... ... ... ..", " X...................... . . ........X.X.X.X.X.X.X.X.X.X.X.X.X.X.X................................", " .... . . . . . . . . . . . . ................X.X.X.......X........ . . . . . . . . . . . . . . ", " X........................ . ......X.X.X...X.X.X.X.X.X.X...X.X.X..................................", " .. ... ... . . ... . . . . . . ............................X.X...... . ... ... ... ... ... ... ..", " X.......................... ........X.X...................X.X.X..................................", " .... ... . . . . . . . . . . . . ....... . . ........... ..X.... . . ... . . . . . . . . . . ... ", " X........ ... ............. . ......X.X.......X.X.X.......X.X.X..................................", " .. ... . . . . . . . . . . . . . ....X.X.. ....X.X.......X.X...... . . ... ... ... ... ... ... ..", " X.......................... . ......X.X.X.....X.X.....X.X.X.X....................................", " .... . . . . . . . . . . . . . . ............... ......X.X...... . . . . . . . . ... ... ... ... ", " X............ ....... ... . . . . ....X.X.X.X.....X.X.X.X.X...... ... . .........................", " .. . . . . . . ... . . . . . . . ......X.X.X.X.X.X.X.X.X.... . ... . . . ... ... ... ... ... ..", " X...................... . . ... ........X.X.X.X.XXX.XXX.X.X.... ..... . . . .....................", " .... . . . . . . . . . . . . . . ......X...X.X.X.X...... . . ... . . . ... ... . . ... ", " X........ . . ... ... . . . ..... . ......X.X.XXX.XXX.X...... ....... . . . .....................", " .. . . . . . . . . . . . . ... . . ......X.X.X.X...... . . ..... . . . . ... ... ... ... ..", " X.................... . . . ....... . ......XXX.X.X.X...... ....X.... . . . . ...................", " .... . . . . . . . . . . ..... . . ............. . . . ....... . . . . . . . . . . . ", " X.... ....... ... . . . . . . ....... . . ............. . ....X.X.... . . . . . . ...............", " .. . . . . . . . . . . . . ..... . . . . . . . . . . ..X...... . . . . . . . . ... ... ..", " X.............. . . . . . . ....X.X.... . . . . ... . . ....X.X.X.... . . . . . . . . . .........", " .. . . . . . . . . . . ....... . . . . . . . ... ........... . . . . . ", " X.... ... . . . . . . . . . ......X.........................X.X...... . . . . . . . . . . . .....", " .. . . . . . . . . . ........... ..................X.... . . . . . . . . . ", " X...... . . . . . . . . . . ......X.X.......X.X.X.X.X.......X.X.... . . . . . . . . . . . . . . .", " .. . . . . . . . ......... ......X.................. . ", " X.. . . . . . . . . . . . . . ....X...........X.X.X.......X.X.X.... . . . . . . . . . . . . . . .", " .. . . . . . . . . ................................... . . . . . . ", " X.. . . . . . . . . . . . . . ......X...........X...X...X.X.X...... . . . . . . . . . . . . . . .", " .. . . . . ............. ................... . . ", " . . . . . . . . . . . . . . . ......X.X...................X...... . . . . . . . . . . . . . . . .", " .. . . . . . . . . . ..........................X.... . . . . . . . . . ", " X.. . . . . . . . . . . . . . . ....X.X.X...X...X...X...X.X.... . . . . . . . . . . . . . . . . .", " .. . . . . . . ......X...................... . . . . . ", " ... . . . . . . . . . . . . . . ..X...X.X.X.X.X.X.X...X.X.X.. . . . . . . . . . . . . . . . . . .", " .. . . . . . . . . ......X.X.X.....X...X.X.X.... . . . . . . . ", " X.. . . . . . . . . . . . . . . ..X.X.X.X.X.X.X.X.X.X.X.X.X.. . . . . . . . . . . . . . . . . . .", " .. . . . . ....X.X.X...X...X.X.X.... . . . ", " ... . . . . . . . . . . . . . . . ..X.X.X.X.X.X.X.X.X.X.X.X.. . . . . . . . . . . . . . . . . . .", " .. . . . . . . . . . . . ..X.X.X.X.X.X.X.X.X.X.X.. . . . . . . . . ", " ... . . . . . . . . . . . . . . . . ..X.XXX.XXXXXXXXXXX.X.X.. . . . . . . . . . . . . . . . . . .", " .. . . . . . . . . . ..X.X.X.X.X.X.X.X.X.X.. . . . . . . . . ", " ... . . . . . . . . . . . . . . . . . ..X.XXXXXXXXXXXXXXX.. . . . . . . . . . . . . . . . . . . .", " .. . . . . . . . . . . . . . . . ..X.XXX.XXXXXXX.X.X . . . . . . . . . . . . . . . ", " ... . . . . . . . . . . . . . . . . . . XXXXXXXXXXXXXXXXX.. . . . . . . . . . . . . . . . . . . .", " . . . . . . . ..X.X.X.X.X.X.X.. . . . . . . . . . . ", " ... . . . . . . . . . . . . . . . . . . ..XXX.XXXXXXXXXX. . . . . . . . . . . . . . . . . . . . .", " .. . . . . . . . . . . . ..X.X.X.X.X.. . . . . . . . . . . ", " ... . . . . . . . . . . . . . . . . . . . . XXXXXXXXXXX.. . . . . . . . . . . . . . . . . . . . .", " .. . . . . . . . ..X.X.X.X.. . . . . . . . ", " ... . . . . . . . . . . . . . . . . . . . . . XXXXXXX.. . . . . . . . . . . . . . . . . . . . . .", " .. . . . . . . . . . . . . . X.X.X.. . . . . . . . . . . . ", " X.. ... . . . . . . . . . . . . . . . . . . . ..XXX.. . . . . . . . . . . . . . . . . . . . . . .", " .. . . . . . . . . . ..X.. . . . . . . . ", " o.. . . . . . . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . .", " o. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", " oX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", " oo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "}; /* XPM */ static char * dan [] = { /* width height ncolors cpp [x_hot y_hot] */ "99 132 4 1 -1 -1", /* colors */ " c #BBBBBBBBBBBB", ". c #555555555555", "X c #AAAAAAAAAAAA", "o c #FFFFFFFFFFFF", /* pixels */ " ", ".X.X.XXX.XXXXXXXXXXXXXXXXXXXXXXXXXXX.XXX.XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXX.XX", "XXXXXXXXXXXXXXoXXXXXXXXXXXXXXXoXXXXXXXXXXXXXXXoXXXoXXXXXXXXXXXoXXXXXXXXXXXXXXXoXoXoXoXoXoXXXXXXXXXX", "XX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXXXXXXXXXXX", "XXXXXXXXXXXXoXXXXXXXXXXXXXXXoXXXoXXXXXXXXXXXXXXXoXXXoXXXXXXXoXXXoXXXoXXXXXXXoXoXoXoXoXoXoXXXoXXXXXX", ".XXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.XXXXXXX.XXXXX.X.X.X.X.XXX.XXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXX.X.X.X.X.X.X.X.XXXXXXXXXXXXoXoXoXoXoXoXXXXXXXXXX", "XX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.XXXXXXX...X...X...X...X...X.XXX.X.XXXXXXXXoXXXoXXXXXXXXXXXXX", "XXXXXXXXXXXXoXXXXXXXXXXXXXXXoXXXoXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.XXXXX.XXXXoXoXoXoXoXoXoXXXXXXXXXX", ".X.X.XXX.XXXXXXXXXXXXXXXXXXXXXXX.XXX.X.X.X.X...X.......X...........X.X.X.XXXXXXXXXXXXXXoXXXX.XXX.XX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXoXoXoXoXoXoXXXXXXXXXX", ".X.XXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X...X...X...X.......X.......X...X...X.X.X...XXXXXXXXoXXXX.XXXXXXXX", "XXXXXXXXoXXXoXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXoXoXoXoXoXXXXXXXXXX", ".XXX.XXXXXXXXXXX.XXXXXXXXX.X...................................................XXXXXXXXXXXXX.XXX.XX", "XXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXoXoXoXoXXXXXXXXXX", ".X.XXXXXXXXXXXXXXXXXXXXX.X...X...X.......X.......X...X.......X...X...X...X.......X.XXoXXXXXXXXXXXXX", "XXXXXXXXXXXXoXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXoXoXoXXXXXXXXXX", ".X.X.XXXXXXXXXXX.XXXXX.X...........................................................X.XXXXXXX.XXX.XX", "XXXXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXoXoXXXXXXXXXX", ".X.XXXXXXXXXXXXXXXXXXX...............X.......X...............................X.......XXXXX.XXXXXXX.", "XXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXoXXXXXXXXXX", ".X.X.XXXXXXXXXXX.XXX...............................X...................................XXXXX.XXXXXX", "XXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXX", ".X.XXXXXXXXXXXXXXX.X.....X...X...X...X...X...X...X...............X.......X...X...X......XX.X.XXXXX.", "XXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXX", ".X.X.XXX.XXXXXXX.X.....................................................................X.X.X.XXX.X.", "XXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXX", ".X.XXX.XXXXXXXXX.X...X.......X.......X.......X.......X.......X...............X.......X...X.X.XXXXX.", "XXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXX", ".X.X.XXX.XXX.XXX.X.................X.......................................................X.XXX.X.", "XXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXX", ".X.XXX.XXXXXXX.X.X.......X.......X...X...X...X...X...X...X...X...X.......X...........X...X.X.XXXXX.", "XXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXX", ".X.X.XXX.X.X.XXX...............................X...X...X.......X.........................X.X.X.X.X.", "X.XXXXXXXXXXXXX.X.X.X.X...X.X.X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXX", ".X.X.X.X.X.X.X.X.X...................X...X...X.X.X.X.X.XXX...X.......X...............X.XXX.X.X.XXX.", "XXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXX.X.XXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXX.XXXXXXX", ".X.X.X.X.X.X.X.X...................X.X.X.X.X.X.X.X.X.X.XXXXX...X.......................X.X.X.X.X.X.", "X.XXX.XXX.XXX.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXoXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.XXX.X.X.XXX.X", ".X.X.X.X.X.X.X.X.X...X...X...X...X.X.X.XXXXXXXXXXXXXXXXXXXXX.X.X.X...X...X...........X.XXX.X.X.X.X.", "XXXXXXX.XXX.XXX.X.X.X.X.X.X.X.X.X.X.XXXXoooXoXoXoXoXoXoXoXoXXXX.XXX.X.X.X.X.X.X.X.X.XXXXXXX.X.X.XXX", ".X.X.X.X.X.X.X.X...................X.XXoXoXoXoXoXoXoXoXoXXXoXX.X.X...................X.X.X...X.X.X.", "X.X.X.XXX.X.X.X.X.X.X.X.X.X.X.X.X.XXXXoXoXoooXoooooooooooXoooXoXXXX.X.X.X.X.X.X...X.XXXXX.X.X.XXX.X", ".X.X.X.X.X.X.X.X...............X.X.XXXXoXoXoXoXoXoooooooooXoooooooXXXX...X...X.......X.X.X...X.X.X.", "XXX.XXXXXXX.XXX.X.X.X.X.X.X.X.X.X.XXoXoXoooooooooooooooooooooooooooooXX.X.X.X.X.X.X.XXXXX.X.X.X.X.X", ".X.X.X.X.X.X.X.X.................XXXXXXoXoXoXoXoXoooXoooooooooooooooXXXX.X.X.......X.X.X.X.X.X.X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXoXoXXXoooooooooooooooooooooooXoXXXXXX.X.X.X.XXXXX.X.X.X.X.X", ".X.X.X.X.X.X.X.X.X.............XXXXXXXXXXX.X.X.XXoXoXoXoooooooooXoXoXX.X.X.X.X...X.X.X.X.X...X.X.X.", "XXX.XXX.X.X.XXX.X.X.X.X.X.X.X.XXXXXXXXXXX.X.X.X.XXXXoXoXoooooooXoXXXXXX.X.X.X.X.X.XXXXXXX.X.X.X.X.X", ".X.X.X.X...X.X.................X.XXX.X.X...X.......X.X.XXXXoXXXX.X.................X.X.X.....X.X...", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXX.X.X.XXX.X.X.X.X.XXXXoXXXXXX.X.X.X.X.X.X.X.X.XXX.XXX.X.X.X.X.X", ".X.X.X.X.X.X.X...............X.XXXXXXX.X.X.X.X.X.X...X.X.XXXXX.X.X...X.X.X...X...X.X.X.X.X...X.X.X.", "XXX.XXX.X.X.XXX.X.X.X.X.X.X.X.XXXXXXXXXXX.X.X.X.X.X.X.X.XXoXoXX.X.X.X.X.X.X.X.X.XXX.XXXXX.X.X.X.X.X", ".X.X.X.X.X.X.X.X...X...........XXXXX.X.X...X.....X.X...X.oooXX.X...........X.....X.X.X.X.......X.X.", "X.XXX.X.X.X.X.X.X.XXX.X.X.X.X.XXXXXXXXXXX.X.X.X.XXX.X.X.XXoooXX.X.X.X.X.X.X.X.X.X.XXX.XXX.X.X.X.X.X", ".X.X.X.X.X.X.X.X.X.X.X.X.X...X.XXXXXXXXXXX.XXX.XXX.XXX.X.XXoXX.XXX.X.X.X.X.X.X.X.X.X.X.X.X...X.X.X.", "XXX.X.X.X.X.X.X.XXXXX.X.X.X.XXXXXXoXoXoXoXXXXXXXoXXXoXXXXXoooXXXoXXXXXXXX.XXXXX.XXXXXXXXX.X.X.X.XXX", ".X.X.X.X.X.X.X.X.XXX.X.X.....X.XXXXoXoXoXoXXXXXXXXXXXXXX.XXoXX.XXXXXXXXX.X.XXX.X.X.X.X.X.......X...", "X.X.X.X.X.X.X.X.XXXXXXX.X.X.X.XXXXoXoooooooooXoXoXoXoXoXXXoXoXXXXXoXoXoXXXXXXXX.X.XXX.XXX.X.X.X.X.X", ".X.X.X.X.X.X.X.X.XXX.X.X.X.X.X.XXXXoXoXoooXoooXoXoXoXoXXXXXoXX.XXXXXXoXXXXXXXX.X.X.X.X.X.X...X.X.X.", "X.X.XXX.X.X.XXX.XXoXXXX.X.X.XXXXXXoXoooooooooooXoXoooXXXXXoXoXXXXXoXoooooXoXoXX.XXX.XXXXX.X.X.X.X.X", ".X.X.X.X.X.X.X.X.XXXXX...X.X.X.XXXXoXoXoooooXoooXoooXXXXXXXoXX.X.XXoXoooXoXoXX.X.X.X.X.X.......X.X.", "X.XXX.X.X.X.X.X.XXoXoXX.X.X.X.XXXXoXoXoooooooooooooooXXXXXoXoXXXXXoXoooooooXXXX.X.XXX.XXX.XXX.X.X.X", ".X.X.X.X.X.X.X.X.XXXXX.XXX.X.X.XXXXXXoXoooooooooooooXX.XXoXoXX.XXXXXXoooXoXoXX.X.X.X.X.X.X...X.X.X.", "XXX.XXX.X.X.X.X.XXoXoXXXXXX.X.X.XXoXoXoXoooooooooooXXXXXoooooXX.XXoXoooooooXoXX.XXX.XXX.X.X.X.X.X.X", ".X.X.X.X...X.X.X.XXXXXXX.X.X...X.XXXXoXoXoooXoooXoXX.X.XXoXoXXXX.XXoXoXoXoXXXX.X.X.X.X.X.......X...", "X.X.X.X.X.X.X.X.X.XXXXXXX.X.X.X.XXXXoXoooooooooooooXXXXXoXoooXXXXXoooXoooXoXXXX.X.X.X.XXX.X.X.X.X.X", ".X.X.X.X.X.X.X.X.X.XXXXXXX...X.X.XXXXoXoXoXoooooooXXXXXXXoXoXX.X.XXoXoXoXoXXXX.X.X.X.X.X.X...X.X.X.", "X.X.X.X.X.X.X.X.X.XXXXXXXXX.X.X.XXXXoXoXoXooooooooXXXXXXXXoXoXX.XXoXoooXoXoXXXX.XXX.XXXXX.X.X.X.X.X", ".X.X.X.X...X...X.X.X.XXXXX.X...X.X.XXXXXXoXoXoXoXoXX.X.X.XXX.X.X.XXoXoXoXXXX.X.X.X.X.X.X.....X.X...", "X.X.X.X.X.X.X.X.X.X.XXXXoXX.X.X.X.XXXXXXoXoXoXoooXoXX.X.X.XXX.X.XXoXoXoXoXoXX.XXX.XXX.XXX.X.X.X.X.X", ".X.X.X...X.X.X.X.X.X.X.XXXXX.X...X.XXXXXXoXoXoXoXoXX.X.X.X.X.X...XXoXoXoXXXX.X.X.X.X.X.X.X...X.X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.XXX.X.X.X.XXXXXXoXoXoooXoXoXXXX.X.X.X.X.XXXXoooXoXXXXXX.XXX.XXX.X.X.X.X.X.X", ".......X...X...X...X.......X...X...X.XXXXXXoXoXoXXXX.X.X.X.X.X.X.XXXXoXoXXXX.X.X.X.X.X.X.......X...", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXoXoXoXoXoXXXXXXXXXXXX.X.XXoXoXoXXXX.XXX.X.X.XXX.X.X.X.X.X", ".X...X.X.X...X.X.X...X.......X...X.X.X.XXXXXXoXoXXXXXXXXXX.XXX.X.X.XXXXXXX.X.X.X.X.X.X.X.X...X.X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXoXXXoXoXoXXXXXoXoXXXoXXXXXXXXXoXoXX.X.X.XXX.XXX.X.X.X.X.X.X", "...X...X...X...X...X.......X...X...X.X.XXXXXXX.XXXXXXXXXXXXXXXXX.X.X.XXXXX.X...X.X.X.X.X...X...X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXoXoXXXXXoXXXXXXXXXXXXXXXXXXXXXXXX.X.X.X.XXX.XXX.X.X.X.X.X", ".X...X...X.X.X...X.X.X...X.......X.X.X.XXXXXXXXXXXXX.X.X.X.X.X.X.X.XXXXXXX.X.X.X.X.X.X.X.X...X.X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXX.X.X.X.X.X.X.X.X.XXXXXXX.XXX.XXX.XXX.X.X.X.X.X.X", "...X...X...X...X...X...X...X.......X.X.X.XXXXXXX.X.X.X.X.X.X...X.X.X.XXX.X.X.X.X.X.X.X.X.......X...", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXX.X.X.XXX.X.X.XXX.X.X.X.X.X", ".X...X...X...X...X...X.......X.......X.X.X.XXXXXXX.XXX.XXXXXXX.X.X.XXX.X.X...X.X.X.X.X.X.X...X.X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXXXX.XXXXXXX.X.X.XXX.XXX.XXX.X.X.X.X.X.X", "...X...X...X...X...X.......X...X...X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...X...X.X.X.X.X.......X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXX.XXXXXXXXXXX.X.X.XXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".X...X...X.X.X...X...X...X...X.X.X...X.X.X.X.X.XXX.XXXXXXX.XXX.XXX.X.X.X.X...X...X.X.X.X.X...X.X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXXXoXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".......X...X...X.......X.......X...........X.X.X.X.X.XXXXXXXXX.X.X.X...X.......X.......X.......X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXX.XXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".X...X...X...X...X...X.......X...X...X...X...X.X.X.X.X.XXXXXXX.X.X.X.X.......X.......X.......X.X.X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", "...X...X...X...................X...X...........X.X.X.X.X.XXX.X.X.X.X.......X...................X...", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".X...X...X.X.X...X...X.......X...X.X.X...X...X...X.X.X.X.X.X.X.X.X...X...X...X...X...X...X.......X.", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".......X...............X.......X...X...X...............X...X...X...................................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...X.X.X.X.X.X.X.X.X", ".X...X...X...........X...X...X...X...X.X.X...X...X...X...X.X.X.X.X...X...X...X...............X.....", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", "...X...................X.......X.X.X...X.X.X...X.X.X.X.X.X.X...X...X.......X.......................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".X.......X...............X...X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.......X.X.X...............X.....", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXX.XXX.X.X.XXXXXXX.XXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", "...........X...............X...X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.................................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXX.X.X.XXX.XXX.XXX.X.X.X.X.X.X.X...X...X...X.X.X.X.X", ".....X...............X.......X...X.X.X.X.X.XXX.X.X.X.X.X.X.X.X.X.X...X...X...X.....................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXXXXXX.XXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", "...............................X.....X.X.XXX.X.X.X.X.X.X.X.X.X.X...........X.......................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".X.......................X.......X.X.X.X.XXXXXXXXX.X.X.XXX.X.X...X...X...X...X.....................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXXXXXXXXXXXXXXXX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".......................X...........X...X...X.X.X.X.X.X.X.......X...X...X...X.......................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...X.X.X.X.X", ".............X.......X...X...X.......X...X...X...X...X...X...X.X.X...X.X.X...X.....................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", "...........................X...X.......X...X...X...X...X...X.X.X.X.X...X...X...................X...", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...X.X.X.X.X.X.X", ".X...........................X...X...X.X.X.X.X...X.......X.X.X.X.X.X.X.X.X.X.......................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", "...............................X...X...X...X...................X...X.X.X...........................", "X.X.X.X.X.X.X.X.X.X.X.X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...X.X.X...X...X.X.X", ".....X...........................X...X.......................X...X...X.X.X...........X.............", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".......................................................................X...........................", "X.X.X.X.X.X.X.X.X.X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...X.X.X.X.X.X.X.X.X.X.X", ".X...............X...............X...............X.......X.......X.................................", "X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", "...................................................................................................", "X.X.X.X...X.X.X.X.X.X.X...X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X", ".....................................X...............X.......X....................................."}; /* XPM */ static char * dave [] = { /* width height ncolors cpp [x_hot y_hot] */ "101 128 4 1 -1 -1", /* colors */ " c black", ". c #555555555555", "X c #AAAAAAAAAAAA", "o c white", /* pixels */ " ", " . . . . . . . . . . ... . . ... . . ... . . ... . . ... ... ... ... ... ... ... ... ... ... ... ...", " ....................................................................................................", " .. ... ... ... ... ... ... ... ... ... ... . . . . . . . . ... ... ....... ....... .................", " ................................................... . . ............................................", " ... . . . . . . . . . . . . . . ... . . . . . . . . . . . . . ... ... ... ... ... ....... ... ...", " ........................................... . . . . . . . . . ......................................", " .. ... ... ... ... ... ... ... ... ... . . . . . . . . . . . . . . ... .............................", " ....................................... ... . . . . . . . . . . ....................................", " . . . . . . ... . . ... . . . . . . . . . . . . . . . . . . ... ... ... ... ... ... ... ...", " ..................................... . . . . . . . . . . . . . . ..................................", " .. ... ... ... ... ... ... . . . . . . . . . . . . . . . . . . . . . . ... .........................", " ............................... . . . . ... . . . . . . . . . . . . ................................", " . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . . . ... ....... ... ... .......", " ......................... . . . . . . ... . . . . . . . . . . . . ... ..............................", " .. ... ... ... ... ... . . . . . . . . . . . . . . . . . . . . . . . . . . .........................", " ....................... ... . . ... ... ... . . . . . . . . . . ... ... ............................", " . . ... . . ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ....... ... .......", " ..................... ... . . ... . . ... . . . . . . . . . . ... . . ... ..........................", " .. ... ... ... ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .....................", " ................... ... ... ... ... ... ... ... . . . . . . ... ... ... ... ........................", " . . ... ... ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ...............", " ..................... ... ... ....... . . ... ... ... ... ... ... ... . ..... ......................", " .. ........... ... . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . .................", " ................... ... ... ... ....... ............................... ....... ................X...", " ... ... ... ... . . . . . . . . . ... . . . ... . . ... . . . . . . . . . . . . . . ... ...........", " ................. . . ... . . ........... . . ........X...... ... ... ... . . . . ..................", " .. ....... ... . . . . . . . . . ..... . . . . ... ......... . . . . . . . . . . . .................", " ................... ... ... ... ....X...... ..........X.X...... ... ....... ... ... ................", " ... ... ... . . . . . . . . . . . ..... . . . . ........... . . . . . . . . . . . . ...............", " ..................... . . . . . . ....X...... ....XXX.X.X.... ........... ... ......................", " ............. . . . . . . . . . . ....X.X.. ....XXXXX.... . . ..X........ . . . . . . .............", " ................... ... ... ... ....X.XXXXX...XXXXXXXXX.X.X.X.X.XXX.X...... ... ... ............X...", " ... ... ... . . . . . . . . . . ....X.X.X.X.XXXXXXXXXXX.X.X.X.X.X.X...... . . . . . ... ...........", " . ............. . . . ... . ......X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.X...... ... . ................", " . ... ... ... . . . . . . . ........X.X.X.XXXXXXXXXXXXXXX.XXX.X.X.X.X.... . . . . . . .............", " ............... . . ... ... ....X.X.XXXXXXXXXXXXXXXXoXXXXXXXXXXXXXX.X.X.... ... ... ................", " . . ... . . . . . . . . . . ......X.X.X.XXXXXXXXXXXXXXXXXXX.XXX.X.X...... . . . . . . . ... .......", " ............. . . . . ... ........X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X...... ... . . ..............", " .. ... ... . . . . . . . . . ......X.X.XXXXXXXXXXXXXXXXXXXXXXX.XXX.X.X.... . . . . . . .............", " ............... . . ... ... ....X.X.XXXXXXXXoXXXoXXXoXXXoXXXoXXXXXX.X.X.X.. ... ... ................", " . . . . . . . . . . . . . . ......X.X.X.XXXXXXXXXXXXXXXXXXXXXXX.X.X...X.. . . . . . . . ....... ...", " ............... . . . . . . ......X.X.XXXXXXXXoXXXoXXXoXXXXXXXXXX.X.X.X.X.... ... . . ..............", " .. ... ... . . . . . . . . . ......X.X.XXX.XXXXXXXXXXXXXXX.X.X.X.X.X.X.... . . . . . . .............", " ............... . . ... . . ......X.X.X.XXXXXXXXoXXXoXXXXXX.XXXXXXX.X.X.X.. ... . . ................", " . . . . . . . . . . . . . . ..............X.XXXXXXX.X.X.X.X.XXX.X.X........ . . . . . . ... .......", " ............. . . . . . . ........X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXX.X.X.X.... . . ..................", " .. . . ... . . . . . . . . ... ..X.X.X.X.X...X.XXXXXXX.X.X.X.X.X.X.X.X...X.. . . . . . .............", " ............... . . . . ........X.X.XXX.X.X.X.X.XXXXXXX.X.X.X...X.X.X.X.X.X.... . . ................", " . . . . . . . . . . . . . ..............X...X.X.X.X.X...X.........X.X.... . . . . ... ... ... ...", " ............. . . . . . . ................X.X.X.X.XXX.XXX.XXX...X.X.X.X.X.X.. . . ..................", " . . . ... . . . . . . . . ....... ... ..X.X.X...X.X.X.X.X.X.X.X.X.X.X.X.X.... . . .................", " ............... . . . . . . ........X...XXX.X.X.XXX.X.XXXXXXXXXXXXX.XXX.X.X.........................", " . . . . . . . . . . . . . . ..........X.X.X.....X.X...X.X.X.XXX.X.X.X.X.... ....... ....... .......", " ................. . . . . ........X.X.XXXXXXX.X.X.XXX.X.XXXXXXXXXXXXX.XXX.X...X.X.X.................", " . ... ... . . . . . . . . ..........X.XXX.X.....X.X.X.X.XXXXXXXXXXXXX.X.X...X.XXX..................", " ................... ....... ....X.X.XXXXXXX.X...XXXXX.X.XXXXXXXXXXXXXXX.X.X.X.XXXXX.................", " . . . . . . . . . . ..... . ......X.X.X.X.......X.X.X.X.X.X.XXXXXXX.X.X.......X.X...... ... ... ...", " ................. . ..X.........X.XXX.XXX.X.X.X.X.XXX.X.X.XXXXXXXXXXXXX.X.X...XXX.X.................", " . . . . . . . . . . ....X.. ....X.X.X.X.X.X.....X.X.X...X.XXXXXXXXXXX.X.X...X.X.X..................", " ................... ....X.X.....X.X.XXXXXXX.X...XXXXX.X.XXXXXXXXXXXXXXX.X.X.X.X.X.X.................", " . . . . . . . . . . ....... ......X.X.X.X.X.....XXX.X.X.XXXXXXXXXXX.X.X.......X.... ... ... .......", " ..................... ..X.......X.X.X.XXXXXXX.X.XXXXX.X.X.XXXXXXXXXXXXX.X.X.X.XXX.X.................", " .. . . ... . . ... . . ..... ....X.X.X.XXX.X.....X.X.X.X.XXXXXXXXXXXXX.X.X...X.X.X..................", " ........................X.......X.X.XXXXXXX.X.X.XXXXX.X.XXXXXXXXXXXXXXX.X.X.X.X.X...................", " . . . . . . . . . . . ..... ......X.X.X.X.X.....X.X...X.XXX.XXXXXXX.X.X.......X.... ... ... .......", " ................. ... ....X.. ....X.X.XXXXX.X.X...X.X.X.XXXXXXXXXXXXX.X.X.X...X.X...................", " . ... . . . . . . . . ....... ....X.X.XXX.X.X.......X.X.X.XXX.XXX.X.X.X.......... ....... .........", " ........................X.........X.XXXXXXX.X.X.X.X.XXX.XXXXXXXXXXXXX.X.X.X.........................", " . . . . . . . . . . . ..... . . ..X.X.X.X.X...X.X.X.X.X.X.X.X.X.X.X.X.X.... . . ... ... ... ... ...", " ..................... ....... ....X.X.X.X.X.X.X.XXXXX.XXX.XXXXXXX.XXX.X.X.X.. ......................", " . ... ... . . ... . . . . . . ......X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.... .....................", " ....................... . . ......X.X.X.X.X.X.X.XXXXXXX.XXX.XXXXXXXXXXX.X.X.........................", " . . . . . . . . . . . . . . . ......X...........X...X.......X.X.X.X.X.... ... ... ... ... ... ...", " . ................... . . . . ....X.X.X.X.X...X.X.X.X.X.X...X.XXX.X.X.X.X...........................", " . . . . . . . . . . . . . . . ........X.........X.XXX.X.....X.X.X.X.X.X.......... ....... .........", " ........................... . ......X.X.X.X.....XXXXXXX.X.X.XXXXXXX.XXX.X...........................", " . . . . . . . . . . . . . . . ......X.X.......X.X...X...X.X.X.X.X.X...... ... ... ... ... .......", " ..... ....................... ........X.X.X...X.X.X.X.X.X.X.XXXXXXXXX.X.X.X.........................", " . . . . . . . . . . . . . . . . ........X.......X.X.X.X.X.X.X.X.X.X.X..............................", " ............................... ....X.X.X.X.X.X.XXX.XXX.XXXXXXXXXXX.X.X.X...........................", " . . . . . . . . . . . . . . . . ......X...........X.X.X.X.X.X.X.X.X........ . . . . ... ... ... ...", " . ... ... ... ............... . . ....X.X.X.X.X.X.X.X.X.XXXXX.XXX.X.X.X...X.. ......................", " . . . . . . . . . . . . . . . . . ..........X.X.X...X.X.X.X.X.X.X.......... . . . ............... .", " ............................... ........X.X.X.X.X.X.XXXXXXX.XXX.X.X.X...X...... ....................", " . . . . . . . . . . . . . . . . . . ..........X.X.X.X.X.X.X.X.X............ . . . . ....... ... ...", " ..... ....... ............... . . ........X.X.X.X.XXXXXXX.XXX.X.X.X...X.X.X.. . . ..................", " .. . . . . . . ... . . . . . . . . ... ......X...X.XXX.X.X.X.X...........X.. . . . .................", " ............................... ........X...X.X.XXXXXXXXXXX.X.X.X...X.X.X.X.... ....................", " . . . . . . . . . . . . . . . . . . . . ......X.X.X.XXX.X.X................ . . . . ... ....... ...", " ......................... ... ... ... ........X.X.XXXXXXX.X.X.X.......X.X.X...... ..................", " . . . . . ... . . . . . . . . . . ... ........X.X.X.X.X.X.X.........X.X.X...... . . ...............", " ........................... ... ............X.X.X.X.XXX.X.X.X.......X.X.X.X.X...........X...........", " . . . . . . . . . . ... . . . . ....... ... ......X...X...........X.X.X........ . . ....X.X.... ...", " ......................... ... ..................X.X.X.X...X.......X.X.X.X.X.............XXXXX.X.....", " . . . ... ... ... ... . . . . . . ....... ... ..................X.X.X.X.X...... . ......XXXXX.X.X..", " ........................................X...........X...X.X.X.X.XXXXXXX.X.X.X...........XXXXoXXXXXX.", " . . . . . . . . . ..... . . ... . ......... ... ..............X.X.X.X.X...... . . . ....XXXXXXXXX.X", " ..................X.X.X.. ... ........X.X.X.......X...X.X.X.X.X.X.XXX.X.X.X...... ......XXoXoXoXXXXX", " . ... ... ......X.X.X.. . . . ..........X.........X.X.X.X.X.X.X.X.X.X.X.X.... . . .....XXXXXXXXXXXX", " ..............X.XXXXXXX.........X...X.X.X.X.X...X.X.XXX.XXX.XXXXXXXXXXX.X.X.............XXXXoXoXoXXX", " . . . . ....X.X.X.X.X.. ... . ........X.X.X.......X.X.X.X.X.X.X.X.X.X.X.... . . . . ..XXXXXXXXXXXXX", " ..........X.XXXXXXXXXXX...............X.X.XXX.X.X.X.X.XXXXXXXXXXXXXXX.X.X.... .........XXXoXoXoXoXoX", " .. ... ..X.XXXXXXX.XXX.... ... ..........X.X.X.X.X.X.X.XXX.XXX.XXX.X.X.... . . ... ....XXXXXXoXXXoXX", " ........XXXXXXXXXXXXXXX.X...........X.X.XXXXXXX.X.X.XXXXXXXXXXXXXXXXX.................XXoXoXoXoXoXoX", " . . ..X.XXXXXXX.X.X.X.X.. . . . . ....X.X.X.X.X.X.X.X.X.XXX.XXX.X.X.... . . . . . . ..XXXXXXXXXXXXX", " ......XXXXXXXXXXXXXXXXXX..............X.X.XXXXXXX.XXXXXXXXXXXXXXXXXXXXX...............XXoXoXoXoXoXoX", " .....X.XXXXXXXXX.X.XXX.X.. ... ... ... ....XXX.XXX.XXXXXXXXXXXXXXXXXXX.X.. . . . . ..XXXXXXXXoXXXXXX", " X.X.XXXXXXXXoXXXXXXXXXXXX...............XXXXoXXXoXXXoXoXoXXXoXoXoXXXXXXXX...........XXoXoXoXoXoXoXoX", " .X.X.XXXXXXXXXXX.XXXXXXX.... . . . . . ..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... ... ..XXXXXXXXXXXXXXXXX", " X.XXXXXXXXXXXXXXXXXXXXXXX.X.............XXXXXXoXoXoXoXoXoXoXXXoXXXoXXXoXXXX.......XXXXoXoXoXoXoXoXoX", " .X.XXXXXXXXXXX.XXXXXXXXXXX.. . ... ....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......XXXXoXXXoXXXoXXXoXX", " XXXXXXXXoXoXoXXXXXXXoXXXXXX...........XXXXXXXXXXoXXXoXoXoXoXoXoXoXoXoXoXoXX.....XXXXoXoXoXoXoXoXoXoX", " .X.X.XXXXXXXXXXXXXXXXXXX.X.X . . . ..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXXXXXX.....XXXXXXoXXXXXXXoXXXo", " XXXXXXXXXXoXXXXXXXoXXXXXXXXXX.......XXXXXXoXXXoXXXoXXXoXXXoXoXoXoXoXoXoXoXoXX.XXXXoXoXoXoXoXoXoXoXoX", " XX.XXXXXXXXXXX.XXXXXXXXXXXXX.. . . ..XXXXXXXXXXXXXXXXXXXXXXXXoXXXoXXXoXoXoXXXXXXXoXXXoXXXoXXXoXXXoXX", " XXXXXXXXXXXXoXXXXXXXoXXXXXXXXX......XXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoX", " .XXXXXXXXXXXXX.XXXXXXXXXXXXXXX.. ..X.XXXXXXXXXXXXXXXXXXXXXXXXXXoXXXXXXXXXXXoXXXXXXXoXXXoXXXoXXXoXXXo", " XXXXXXXXXXoXXXXXXXoXXXXXXXXXXXX...XXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoX", " XXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXoXXXoXXXXXXXoXXXoXXXoXXXoXXXoXXXoXXXoXoXXXXXoXo", " oXXXXXXXXXoXXXXXoXoXoXXXoXoXXXXXoXXXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoX", " .XXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXoXXXoXXXXXXXoXXXXXXXXXXXoXXXoXXXo", " XXXXXXXXXXoXXXXXXXoXXXoXXXoXXXoXXXoXXXXXXXXXXXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoX", " XX.XXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXXXXXoXXXoXXXoXXXoXXXoXXXoXXXoXXXoXXXoXoXoXX", " XXXXXXXXXXXXXXXXoXXXoXoXoXXXXXXXoXXXoXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoX", " XXXX.XXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXoXXXXXXXXXXXoXXXXXXXX", " XXXXXXXXXXoXXXXXXXoXXXoXoXoXXXXXXXoXXXoXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoX", " XX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXoXXXoXXXoXXXoXXXoXXXoXXXoXXXoXoXoXXXoXX"}; /* XPM */ static char * doug [] = { /* width height ncolors cpp [x_hot y_hot] */ "99 137 4 1 -1 -1", /* colors */ " c black", ". c white", "X c #555555555555", "o c #AAAAAAAAAAAA", /* pixels */ " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", " XoXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " oXX X XXXXXXXXXXX XXX XXX XXX X X XXX XXX XXX X X X X XXX XXX X X XXX XXX XXX XXX X X X X X X X X ", " oX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " oXX XXXXXXX XXXXXXX XXXXXXXXX X X XXXXX X X X X X X X X XXX XXXXXXX XXXXXXX XXX XXX XXXXXXX XXX XX", " XX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " oXXXXXXXXXXXXXXXX XXXXXXX X X X X XXX X X X X X X X X X X XXX X X XXX XXXXXXX X X XXX XXX XXX XXX ", " XX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " oXXXXXXXXXXXXXXXXXXXXXXXXXX X X XXX XXX X X X X X X X X XXX XXXXXXXXXXXXXXX XXX XXXXXXXXXXX XXXXXX", " XX X XXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " XXXXXXXXXXXXXXXXX XXX XXX X X X X X X X X X X X X X X X X XXX XXX XXX XXX XXX XXX XXX XXXXXXXX", " XX XXX XXX X X X X XXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " oXXXXXXXXXXXXXXXXXX XXX X X X X X X X X X X X X X X X X X X X X X X XXX X XXXXXXXXXXXXXXXXXXXXXXXX", " XX X X X XXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " XXXXXXXXXXXXXXXXXXXXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X XXXXXXX XXXXXXX XXXX", " XX XXX XXX X X X X X X X X X X X X X X X X X X X X X X X X X", " oXXXXXXXXXXXXXXXXXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X XXXXXXX XXXXXXXXXX", " XX X X X X X XXX X X X X X X X X X X X X X X X X", " XXXXXXXXX XXXXXXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X XXX XXXX", " XX XXX X X X X X X X X X X X X X X X X X X X X X X X", " oXXXXXXXXXXXXXX XXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X XXX XXX XXXXXX", " XX X X X X X X X X X X X X X X X X X", " XXXXX XXXXXXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X XXX XXX XXXX", " XX XXX X X X X X X X X X X X X X X X X X X X", " XXXXXXXXXXX X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X XXX X X X X XXX XXXXXX", " XX X X X X X X X X X X X X X X X X X X", " X XXXXXXX X X X X X X X X X X X X X X X XXXXXXX X X XXX X X X X X X X X X X X X X X X XXXX", " XX XXX X X X X X X XXXXXXXXXXXXXXXXXXX X X X X X X X X", " XXXXXXX X X X X X X X X X X X X X XXXXXXoXoXoXoXoXoXoXoXoXXXX X X X X X X X X X X X X X XXXXXXXXXX", " XX X X X X X X X X XXXXoXoXoXoXoXoXoXoXXXXXX X X X X X X X", " XXXXX X X X X X X X X X X X X XXXXXXoXoXoXoXoooXoXoXoXXXoXXXX X X X X X X X X X X X X XXXXXXXX", " XX XXX X X X X X X XXXXXXoXoXoXoXoXoXoXoXoXoXXXXXX X X X X X X X X X", " XXXXXXX X X X X X X X X X X X XXXXXXoXoXoooooooooooooXoXoXoXoXXXXXX X X X X X X X X X X XXXXXXXXXX", " X X X X X X XXXXXXXXoXoXoXoXoXoXoXoXoXXXXXXXX X X X X X X X", " XXXXX X X X X X X X X X X XXXXoXoXoXoXoooooooooooXoooXoXoXXXXXX X X X X X X X X XXX XXX ", " XX XXX X X X XXXXXXoXoXoXoooooooXoXoXoXoXXXXXXXX X X X X X", " XXX XXX X X X X X X XXXXoXoXoooooooo.ooooooooooooooXoXoXXXX X X X X X X X X XXX XX", " X X X X XXXXXXoXoXoXoooooooooooXoXoXoXoXXXXXXXX X X X X", " XXXXX X X X X X X X X XXXXXXoXoXoXoooooooooooooooooooooooXoXXXXXX X X X X X X X X X X ", " XX X X XX X X XXXXoXoXoXoooooooooooooooXoooooXoXXXXXXXX X X X X X", " XXX X X X X X X X X XXXXXXoXoXoooooooooooo.ooooooooooooooXoXXXXXX X X X X X X X X X XX", " XX X X X XXXXXXoXoXoXoooooooooooXoooXoXoXoXoXXXX X X X X", " X X X X X X X XXX XXXXXXoXoooXoooooooooooooooooooooooooXoXoXXXX X X X X X ", " X X X XXXXXXoXoXoXoooooooooooooooXoXoXoXoXoXXXXXX X X X", " X X X X X X X X XXXXXXoXoXoXoooooooooooooooooooooooooooXoXXXXXX X X X X X X X ", " X X XXXXXXoXoXoXoXoXoXoooooooXoXoXoXoXoXoXXXX X X X X X", " X X X X X X X X X XXXXoXoXoXoXoooooooooooooooooooooXoXoooXoXXXX X X X ", " X XXXXXXXXoXoXoXoooooooooo.ooooooooooXoXoXoXXXX X X", " X X X X X X X X X XX X X oXoXoXoXoXoooooooo.o.o.o.o.ooo.ooooooXoXoXXXX X X X X X X XX", " XX X XXXXXXoXoXoooooooooooooooooooooXoXoXXXX X X X X", " X X X X X X X X X XXXXoXoXoXoXoooo.ooo.o.o.o.o.ooooooXoXoXXXX X X X X X ", " X X X X XXXXX X X Xoo X..XoooXoXXXooX XXXXXXXXX X X X X", " X X X X X X X X X X XXX XXX XXX XXXXoXX XXXXoXoXX XX.XXXXXX X XXXXX X X X X X X X ", " X X X X XXoXoXXXX XXoXX oooXXXXXX XXoXoXXXX X X X", " X X X X X X X X X X X XoooXoooooXoXoXoXXXoooXoXoXoXoooXoXoXoX X X X X ", " X X X X X X XXoXoXXXoXXXoXXXo XXXXoXXXXXoXXXXXXXoXX X X", " X X XXX X X X X X X X X oXoXoXX X oooXoXoXX XX XoXXXo..XX XXXXoXo X X X X X X XX", " X X X XXXXX X Xo.XXXXXX XXo XXXXXXooX XXX XXXXX X X", " X X XXX X X X X X X XoXXXXXX XXXooXoXoXXXoXX XXoXoXX X oXXXoXoX X X X ", " X X X XXoXXXXXXXXXoXoXoXX XXo XXXoXoXXXXXXXXXXXX X X X", " X X XXX X X X X X X X X X XXoXXXoXoXoooooooXo XXoXX XXoooooooXoXoXoXoXX X X XXX XX", " X X X oXXXXXoXoXoooXoXo XXXXX XXoXoooXoXoXXXoXX X X X X X", " X X X X X X X X X X XXoXoXoXoooXoooXoXX XXoXXXXXXXoXoooXoXoXoXoXXX X X X X X ", " X X X X XXoXoXoXoXoXoXoXX XXXXXXX XXXXoXoXoXoXoXoXX X X X X", " X X X X X X X X X X X X X XXoXoXooooooooooo XXoXoXXXX oXoooooooXoooXoXXXX X X X X XXX XX", " X X XXXXoXoXoXoXoXX XXoXXXXX oXoXoXoXoXoXoXX X X X X X X", " X X X X X X X X X X oXoXoXoXoXoooXX XXoXoXXXoXXXoooooooooXoXX XXX X X X X XXX ", " X X X X X XXXoXoXoXoXoXXXXXoXoXX XXXXXXoXoooXoXoXo XXX X X X", " X X X X X X XXX X X X XXXXX XXoXoXoXXXooXXoXoooXXXXXooXXoXoooXoXXXXXXXX X X X X X XXX XX", " X X XXXXX XXXXXXXXoXX XXoooooXX XXoXXXX XXX XXXXX X X X X X X", " X X X X X X X X XXXXoXoXoooooooXXXXXoooXXXXXoo.ooooXoXoXoXXXX XXX X X X X X X ", " XX X X X XXXXoXoXoooooXXXXXXXoXX XXXXoo.ooooXoXoXXXX X X X X X X X", " X X X X X X X X X XXXXoXoooo.ooooXX XXXXoXXXXXoo.o.ooooooXoXXXX X X X X X X X X X X X XX", " X XXoXoooooooXXXX XXX XXXXXXoooooooXoXXXX X X X X X X X", " X X X X X XXoXoooo.ooooXXXXXoXXXoXXXoooooooooooXXXX X X X X X X X X X XXX ", " XX X X XXoXoXoooooXX X XXoXX X XXoXoooooXoXX X X X X X X X X X X", " oXX X X X X X X XXXXoooooooXX X XXXXXXX X XXoooooooXoXX X X X X X XXX X X X X XX", " XX X XXXXoXoXoXX X X X XXoXoXoXX X X X X X X X X X", " XXX X X X X X X X XXoXoXXXX X X X X X X XXoXoXoXoXX X X X X X XXX X X X X ", " XX X X X XXXXo X X X X XXoXoXX X X X X X X X X X", " oXX X X X X X X X X X XXoXX X X X XXXXXXX X X X X XXoXXXX X X X X X X X X X X XXXXX XX", " XX X X X XXXXX X X X XXX X X X X X X X X X X", " o XXX X X X X X X X X X X X XXXXXXXXX X X X XXoXX X X X X X X X X X X X X ", " XX X X X X X X X XXX X X X X X X X X X X X X X X X X", " oXX X X X X X X X X X XXX X X XXXXXXXXXXX X X XXX X X X X X X XXX XXX XXX XX", " XX X X X X X X X X XXXXoXXXX X X X X X X X X X X X X X", " oXX X X X X X X X XXX XXXXXXXXoXoXXXXXXXX X X X X X X X X X X X X X X X X X ", " XX X X X X X X XXX XXXXXXXXXXXXXXXXXXX X X X X X X X X X X X", " oXX X X X X X X X X X XXXXXXXXXXoXoXoXoXoXXXoXX X X X X XXX XXX XXX XXX XXX XX", " XX X X X X XXXXX X X X X X X XXX X X X X X X X X X X", " X X X X X X X X X X XXXXXXX X X X XXXXXXX X X X X X X X X X X X X XXX ", " XX X X X X X XXXXXXX X X X X X XXX X X X X X X X X X X X", " oXX X X X X X X X X X X X XXXXXXX X X X X XXXXX X X X X XXX XXX X X X X XXX XX", " XX X X X X X XXXXX X X XXX X X X X X X X X X X X X", " oXX X X X X X X X X XXX X X X X XXX X X X X X X X X X X X XXX X X ", " XX X X X X X X X X X X X X X X X X X X X X", " oXX X X X X X X X X X X X X X X X X X XXX X X X X XXX XXX X X XXX XXX XX", " XX X X X X X X X X X X X X X X", " o X X X X X X X X X X X X X X X X X XXX X X XXX ", " XX X X X X X X X X X X X X X X X X X X X", " oXX X X X X X X X X X X X X XXX X X XXX XXX XXX XX", " XX X X X X X X X X X X X X X X X X X X", " oXX X X X X X X X X XXXXXXX XXX X X XXX XXX X X ", " XX X X X X X X X XXXXoXoXX X X X X X X X X X X", " oXX X X X X X X XXXXX X X X X X X X X oXoXoo.ooXXXX X X XXX XXX XX", " XX X X X X XXXXXXX XooXoXoooooXX X X X X X X X", " o X X X X X XXoooXoXoXX X XX.ooXoooo.o.ooXX X X X X X X ", " XX X X X X XXoXoXoXoXXXX oooXoXoooooooooXX X X X X X X", " oXX X XXXXoXoooooXoooXoXXXX X Xo.ooooooo.o.o.o.ooXX X XXX X ", " XX X XXoXoXoXoooXoooXoXoXX XXoooXoXoooo.o.ooooooXX X X X X", " oXXXXXoooooooooooooooXoooXX Xo.o.ooooooo.o.o.o.o.ooXoXX X XX", " XXXXXoXoooooooooooooooXoooXX XXoo.ooooooooooo.o.o.ooooooXX X X", " .ooooooo.ooo.ooo.ooo.ooo.ooXX X X X X X X X XXoo.o.ooooo.o.o.o.o...o.o.o.ooXXX", " .oooooooXoooooooooooooXoooooXX X X Xooo.ooooooooooooo.o.ooooo.ooooXX", " .ooooooooooooooooooooooooo.ooXX X X X X X X XXXo.o.o.ooooo.o.o.o.o.o.ooo.o.o.ooo", " .oXoXoXoooooooXoooooooXoooooooXX X X X X X XXXXoo...ooooooo.ooooo.o.o.ooooo.oooo", " .ooooooo.o.ooooo.ooo.ooooo.o.ooXoXXXXXX X X XXX X X X X XXoXoo.o...ooo.o.o.o.o.o...o.o.o.o.o.o", " ooXoXoooooooXoooooooooooooo.o.ooXXXXXX X X XXXXX X XXXXoooo.o.ooooo.ooooooo.o.o.ooooooo.oo", " .ooooooo.ooooooooooooooooo...o.ooXoXXXX X X XXoXX X X X X XXoXoo.....o.o.o.o.o.o.o.o.o...o.o.o...o", " .oooXoooooooooooooooooooooo.o.o.ooXoXXXX X XXoXoXXXX X XXXXoXoooo.o.o.ooooooo.ooooooo.o.o.ooo.o.o.", " .ooooooooooooooo.ooo.ooo.o.o...o.ooXoXoXXXXXoXoXoXXXXXXXoXoooo.o.....o.o.o.o.o.o.o.o.......o.o.o.o", " .oooXoooooooXoooooooooooooo.o.o.ooooXoXoXXXoXoXoXoXoXXXoXoooooooo.o.ooXoooooooooooooo.o.o.o.ooo.oo", " .ooooooooooooooooooooooooo.o.o...o.ooooooXoooXoooXoooXoooo.ooo.o.o.o.ooooo.o.o.o.o.o.......o.o...o", " ..ooooooooXoooooooooooooooooo.o.o.ooooooooXoXoXoXoXoXoXoooo.ooooo.ooo.o.ooooo.ooooooo.o.o.o.ooo.o.", " .ooooooooooooooooooo.ooo.ooo...o.o.o.ooooooooooooooooooo.o.o.ooo.ooo.......o.o.o.ooo.o.......o.o..", " .oooooooooooXoooooooooooooooo.o.o.o.ooooooooXoooXoXoXoooooo.ooo.ooo.o.o.o.o.o.ooooooooo.o.o.o.ooo.", " .o.ooooooooooooooooooo.o.o.ooo.o.o.o.o.o.o.ooooooooooooo.o.o.o.o.o...o...o...o.o.o.ooo...o...o.o..", " ..ooooXoooooooooooooooooo.ooooooo.ooo.o.o.o.ooXoooXoooooooooooXoo.o.o.o.o.o.o.o.o.o.ooo...o.o.o.o.", " ..oo.ooo.ooooooo.o.o.o.o.o.o.ooo...o.o.o.o.o.ooooooooooooooo.o.o...o...o.......o.o.o.o............", " ..ooooooooooooooooooooo.ooo.ooXoooooo.o.ooo.ooooXoooooo.o.o.o.o.o.o.o.o.o.o.o.o.ooo.o.o.o.o.o...o.", " .o.ooooooooooooooo.o.o.o.o.o.o.ooooooooooo.o.o.ooooo.....................o...o.o.o.o.o...........o", " ..ooooXoooooooooooooooooooooo.o.o.o.o.ooo.ooo.ooo.o.......o...o.o.o.o.o.o.o.o.o.o.ooo.o.o.o...o...", " ...o.ooo.ooooooooooo.o.o.o.o.o.o.o.o...o...o...oo......................o...o...o.o.o.o.o..........", " o.ooooooooooooooooooooooooooooo.o.o.o.o.o.o.o.oooo......o.o.o.o.o.o.o.o.o.o.o.o.ooo.ooo.o.o.o.o.o.", " ...ooooooooooooooooooooooo.o.o.o.o...o...o.o.o.o.o.......o.......o.o.o.o.o...o...o.o.o...o........", " ....ooooooXoooXoooooooooo.o.o.o.o.o.o.o.o.o.ooo.o.....o.o.o.o.o.o.o.o.o...o.o.o.o.ooo.o.o.o.o.o.o.", " .....ooooooooooooooooooo.o.o.o.o.o...o.o.o.o.o.........o.......o...o...o.......o.....o.o.......o.."}; /* XPM */ static char * ellis [] = { /* width height ncolors cpp [x_hot y_hot] */ "100 126 4 1 -1 -1", /* colors */ " c black", ". c #555555555555", "X c #AAAAAAAAAAAA", "o c white", /* pixels */ " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..XXoXo", "..................................... ... ... ..................................................X.oX", ".. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ... ... ... . . ... . . . . . ...", "........................................... . . . . . . . . ........................................", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", "................................. ... . . . . . . . . . . . . ......................................", ".. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ... . . ... . . . . . . . . .", "............................... . . . . . . . . . . . . . . . . . . ................................", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", "................. ... ... . . . . . . . . . . . . . . . . . . . . . . . . ..........................", ".. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", "....................... . . . . . . . . . . . . . . . . . . . . . . . . . . ........................", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", "..................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ..............", ".. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... .", "................... . . . . . . . . . . . . . . . . . . . . . ..... . . . . . . ... ................", " . . . . . . . . . . . . . . . . . . . ..... . . . . . . . . . . .", "................. . . . . . . . . . . . . . . . . . . ............... . . . . . . . . . . ..........", ".. . . . . . . . . . . . . . . . . . . ..... ........... . . . . . . . . . . . .", "................... . . . . . . . . . . . . . . . . ..X.........X.X.X.. . . . . . . . . ............", " . . . . . . . . . . . . . . . . . ......... ..X.X.... . . . . . . . .", "................. . . . . . . . . . . . . . . . . ..X.X.X.X...X.X.X.X.... . . . . . . . . ... ......", ".. . . . . . . . . . . . . . . . . . . ....X.X.....X.X.X.X.X.. . . . . . . . ... .", "............... . . . . . . . . . . . . ... . ....X.X.X.X.X.XXXXXXX.X.X.... . . . . . . . . ... ....", " . . . . . . . . . . . . . . . . ......X.....X.X.X.X.X.... . . . . . . . .", "......... ... . . . . . . . . . . . . . . . . ....X.X.X.X.XXXXXXX.X.X.X.... . . . . . . . . . ......", ".. . . . . . . . . . . . . . . . . . ........X.XXX.XXX.XXX.X.X.X.. . . . . . . . . . . .", "............... . . . . . . . . . . ... ... ....X.X.XXXXXXXXXXXXXXXXXXX.X.... . . . . . . . ........", " . . . . . . . . . . . . . ......X.X.X.XXXXXXXXXXX.X.X.X.X.... . . . . . . . .", "............. . . . . . . . . . . ... ....X.X.X.XXXXXXXXXXXXXXXXXXXXX.X.X.X.. . . . . . . . . ......", ".. . . . . . . . . . . . . . ........X.XXXXXXXXXXXXXXXXXXX.X.X.X.X.... . . . . . . . . .", "............. . . . . . . . . . ... ......X.XXXXXXXXoXXXoXXXXXXXXXXXXXXXX.X...... . . . . . . . ....", ".. . . . . . . . . . ......X.X.X.XXXXXXXXXXXXXXX.XXX.X.X...... . . . . . .", "......... . . . . . . . . . . . . ......X.XXXXXXXXXXXXXXXXXXXXXXXXXXX.XXX.X.... . . . . . . . . . ..", ".. . . . . . . . . . . . . . . ....X.X.XXX.XXX.XXXXXXXXXXX.XXX.X.X.X.X.... . . . . . . . .", "........... . . . . . . ....X...X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.. . . . . . . ........", ".. . . . . . . . ....X...X.X.X.X.X.XXXXXXXXXXXXXXX.X.X.X.X.X.X.X.... . . . . . . . . . .", "......... . . . . . . . . ..X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.... . . . . . . . ... ..", ".. . . . . . . . . . . ..X.X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXXXX.XXX.X.X.... . . . . . . . . . .", "........... . . . . . . . ..X.X.X.X.XXX.XXXXXXXXoXXXoXXXoXXXoXXXXXXXXXX.X.X.X.. . . . . . . . . ....", " . . . . . . . ..X...X.......X.XXXXXXXXXXXXXXXXXXX.X.X.X........ . . . . .", "......... . . . . . . . . . ..X...X.........X.XXXXXXXXoXXXXXXXXXXXX.X.......... . . . . . . . . . ..", ".. . . . . . . . . ..... ............XXXXXXXXXXXXXXXXX.X.... . . ... . . . . . . . . .", "....... . . . . . . . . ... . ......X.X.X.X.XXX.XXXXoXXXoXXXXXX.X.............. . ... . . . . . ....", " . . . . . ... . .. . ..X.X.X.X...X.XXXXXXX.X.X.... . . . . . . . . . . . . . .", "..... . . . . . . . . . ..... . . ....X.X.XXXXX.X.X.X.XXXXXXXXX.X.X........ . . . . . . . . . ... ..", ".. . . . . . . . ..... . . ..X.....X.X.X.X.X.X.XXX.X.X.XXX.... . . . . . . . . . . . .", "....... . . . . . . . . ....X.. ....X.......X.X.X.XXX.XXoXXXXXXXXXX.X........ . . . . . . . ... ....", " . . . . . ..... . ....... . . ..X...X.X.XXX.X.XXX...... . . . . . . . . . .", "..... . . . . . . . . . ......................X.X.XXX.XXX.X.X.XXX.X ... ... ... . . . . . . . ... ..", ".. . . . . . . ..X...............X.X.X.XXX.XXX.X.X.X.. ... . . . . . . . . . . . . . .", "....... . . . . . . . . ....X.......X.X.X.X.X.X.XXXXXXX.X.X.XXX.X...X...... ... . . . . . . ........", " . . . . . . ..........X.......X.X.X.X.X...X.X.X.X.X.X.......... . . . . . . . . .", "..... . . . . . . . . . ..........X.X.X.X.XXX.XXXXXXX.XXX.XXXXX.X.X.X.X.X.X.... . . . . . . . ......", ".. . . . . . . . ....X.....X.X.X.X.X.X.XXX.X.X.X.X.X.X.X.X.X.X.X.X...X . . . . . . . .", "..... . . . . . . . . . ....X...X.XXXXX.XXXXXXXXXXX.XXXXX.X.XXXXXXXXXXX.X.X.X.. . . . . . . ........", " . . . . . ....... X.X.X.X.XXXXXXX.X.X.X.X...X.XXX.X.X.X.X...X.. . . . . . .", "..... . . . . . . . . ......X.X...XXXXXXXXXXXXXXX.X.X.XXX.X.XXXXXXXXXXXXX.XXX.... . . . . . ........", ".. . . . . . . . ....X.......XXXXXXXXXXX.X...X.XXX...XXXXXXXXX.XXX.X.. . . . . . . . . .", "... . . . . . . . . . ......X.X.X.X.X.X.XXXXXXX.X.X.XXXXXXX.XXXXXXXXXXXXXXXXX.. . . . . . . ........", ".. . . ... . ......X.X.X.X.X.X.X...X.X.X.XXXXX.....XXXXX.XXX.XXX . . . . . . ...", "... . . . . . . . . . ......X.X.X.XXXXXXX.XXX.X.X.X.XXXXX.X.X.XXXXXXXXXXXXX...... . . . . ..........", ".. . . . . . .. . ......X.X.X.X.X.X.X.X.X.X.XXXXXXX.....X.XXXXX.X.X.... . . . . . . ... .", "... . . . . . . . . . . ....X.X.XXXXXXX.XXXXX.X.XXX.XXXXX.X.X.XXXXXXXXX.XXX.X.. . . . . . . ........", " . . . . ......X.X.X.X.X.X.X.X.X.X...X.X.......X.X.X.X.X.X.... . . . . . . .", "... . . . . . . . . . . ..X.X.X.X.X.X.XXXXX.X.X.X.X.X.X...X.X.XXX.X.X.XXX.X.... . . . . . ... ......", ".. . . . . . ....X...X.X.X.X.X...X...X.X.X...X.....X.X.X.X.X.X.... . . . . . . . . .", "... . . . . . . . . . . ....X.X.X.X.XXX.X.X.....X...XXX.X.......X.X.XXX.X.X.... . . . . ... ........", " . . . ......X.X...... ... . . ..... . . . . ....X.X...... . . . . . . . . .", "... . . . . . . . . . . ..X.X.X.X.X........ . ... ....X...... . ......XXX.X.... . . . . . ..........", ".. . . ......X.X.. . ... . . . . . . ... . . . . ....X.X.... . . . . . . ... .", "... . . . . . . . . . . ....X.X.X.......... . . ............. . ......XXX.X.... . . . . ............", " . . . . ....... . . . . . . . . ..... . . . . ... ..X.... . . . . . . . .", "..... . . . . . . . . . . ....X.... . ..... . ... ....... ... ........X.X.X.. . . . . ... ..........", ".. . . . . . ....... . . ... . . . . ..X.X.. . . ... ....X.X.. . . . . . . . . .", "... ... . . . . . . . . . ....X.X.......X............XXXX.. ..........X.X.X.. . . . . . ............", " . . . . . . ..........X.... ... ....X.X.. . ....... ....... . . . . . . . . .", "..... . . . . . . . . . . . . ....X.X.X.XXX.X.X.XXXXXXXXX.X...XXXXX.X.X.X.. . . . . . ..............", ".. . . . . . . . ......X.XXX.X.X.X.X.XXX.X.X.X.X.X.X.X.X.... . . . . . . . . . . .", "....... ... . . . . . . . . . ....X.X.XXXXX.XXXXXXXXXXX.XXX.XXXXXXX.X...... . . . . ................", " . . . . . . . . ......X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.... . . . . . . . . . . . .", "..... ... . . . . . . . . . ....X.X.XXXXXXX.XXX.XXX.XXX.XXXXXXX.X...... . . ... ... ... ..........", ".. . . . . . . . . . . ....X.X.XXX.X.X.X.X.X.X.X.X.X.X.... . . . . . . . . . . . . .", "... ....... ... . . . . . . . . ........X.XXXXXXXXXXXXXXXXXXXXX.X...... . . ........................", ".. . . . . . . . . . . ... ....X.X.X.X.X.X.X.X.X.X.X.X.. . . . . . . . . . . . . . . .", "..... ... ... ... . . . . . . . . ......X.XXXXXXXXXXXXXXX.XXX.X.X.... . . . . ... ... ..............", ".. . . . . . . . . . . . . . . . . ..X.X.X.XXXXXXX.X.X.X...... . . . . . . . . . . . . . . .", "....... ... ....... . . . . ... . . ....X.X.X.XXXXXXXXX.X.X.X.X.... . . . . . . ....................", " . . . . . . . . . . . . . . ....X.X.X.XXX.X.X........ . . . . . . . . . . . . .", "..... ... ... ... . . . . . . ... . . ....X.X.XXXXXXXXXXX.X.X.X.. . . . . . . . . . . ... ....... ..", ".. . . . . . . . . . . . ... . ....X.X.XXX.X.X.X.X...... . . . . . . . . . . . . . . .", "... ....... . . . . . . . . ....... . ......X.X.X.X.XXX.X.X.X.. ... . . . . . . . . . . . . ........", " . . . . . . . . . ....... . ......X...X......... . . . . . . . . . . . . .", "..... . . . . . . . . . . . . ....... . . ......X.X.X.X.X.... ..... . . . . . . . . . . . . . . . ..", ".. . . . . . . . . . ....... . . ..........X.... . ..... . . . . . . . . . . . . . .", "... . . . . . . . . . . . . ......X...... . ....X...X.X.X.. ..X.... . . . . . . . . . . . . . . . . ", " . . . . . . ... ........... . . . . . . ....... . . . . . . . ", ". . . . . . . . . . . . . . . ....X.X.X.X.X.. . . . . ....X.X.. . . . . . . . . . . . . . . . . . . ", " . . . . . . . . ........X...X...... . ......X.X.. . . . . . . . . . . . . . ", "... . . . . . . . . . . . . . ....X.X.X.X.X.X.X.X.X.X.X.XXX.X.. . . . . . . . . . . . . . . . . . . ", " . . . . . . . ........X.X.X.X.X.X.X.X.X.X.X.. . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . ....X.X.X.X.XXX.XXX.XXX.XXX.X.. . . . . . . . . . . . . . . . . . . . ", " . . . . . . . . . . ....X.X...X.X.X.X.X.X.X.X.X.. . . . . . . . . . . . . . . . . .", "... . . . . . . . . . . . . . . ..X.X.X.X.X.XXXXXXX.X.X.X.. . . . . . . . . ... . . . . . . . . . . ", " . . . . . ..X.X.X...X.X.X.X.X.X.X.. . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . X.X.X.X.X.X.X.X.X.X.X.. . . . . . . . . . . . . . . . . . . ... . ", " . . . . . . . . . . ..X.X.X.X.X.X.X.X.X . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . XXX.XXX.X.X.X.X.X.. . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . ..X.X.X...X.... . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . ..X.X...X.X.. . . . . . . . . . . . . . . . . . . . . . ... . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", "... . . . . . . . . . . . . . . . . ... ... . . ... ... . . . . . . ... ... . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", "... . . . . . . . . . . . . . . . . ....... ... ....... . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . ..... . . . ..... . . . . . . . . . . . . . . . . . . . . . . . ", ".. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", "... . . . . . . . . . . . . . . . . . ..... . . ..... . . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", "... . . . . . . . . . . . . . . . . . . . . ..... . . . . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "}; /* XPM */ static char * ingeborg [] = { /* width height ncolors cpp [x_hot y_hot] */ "98 122 4 1 -1 -1", /* colors */ " c #AAAAAAAAAAAA", ". c white", "X c #555555555555", "o c black", /* pixels */ " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . . . . . . . X X X . . . . . . . . . . . . . . . . . . . . ", " . . . . . ... . . . . . . . . . . . . . XXoXoXoXoXXXX . . . . . . . . . . . ... . . ... . .", ". . . . . . . . . . . . . . . . . . XXXXXXoooooooooooooooXX . . . . . . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . XXoXoXoXoXoXoXoooXoXoXoXoXoXX . . . . . . . . . . . . . . . .", ". . . . . . . . . . . . . . . . .XXoXoooooooooooooooooooooooooooXoX . . . . . . . . . . . . . . . ", ".. ... ... ... ... . . ... . . XXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXX. . . . . ... ... ... ... ...", ". . . . . . . . . . . . . . ooooooooooooooooooooooooooooooooooooooo . . . . . . . . . . . . ", " . . . . . . . . . . . . . .XXoXoXoXoXoooXoooXoooXoooXoooXoooXoooXoXoXoX . . . . . . . . . . . . .", ". . . . . . . . . . . . . XXoooooooooooooooooooooooooooooooooooooooooXoXX . . . . . . . . . . . ", ".. ... ... ... . . ... . oXoXoXoXoXoXoXoooXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXX. . . . ... . . ... . .", ". . . . . . . . . . . . XoXoooooooooooooooooooooooooooooooooooooooooooooooXX . . . . . . . . . . ", " ... . . . . . . . . . XoXoXoXoXoXoooXoooXoooXoooXoooXoooXoooXoXoXoXoXoXoXoXX. . . . . . . . . . .", ". . . . . . . . . . . XoXoooooooXoooooooooooooooooooooooooooooooXoooooooXoooXX . . . . . . . . . ", ".. ... ... ... ... . XoXXXoXoXoXoXoXoooXoXoXoooXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXX... ... ... ... ...", ". . . . . . . . . .XXoXoooooooXoooooooooooooooooooooooooooooooooooXoooXoooXoooXX . . . . . . . . ", " . . . . . . . . . XoXoXoXoXoXoooXoooXoooXoooXoooXoooXoooXoooXoooXoXoXoXoXoXoXoX . . . . . . ... .", ". . . . . . . . . XoXoXoooXoXoooooooooooooooooooooooooooooooooooooooXoXoXoXoXoXo . . . . . . . . ", ".. ... ... ... ..XoXoXoXoXoXoXoXoooXoXoXoooXoXoXoooXoXoXoXoXoXoXoXoXoXoXXXoXXXoXX ... . . ... ...", ". . . . . . . . oooooXoooXoooooooooooooooooooooooooooooooooooooooooooXoXoXoXoXoXX. . . . . . . . ", " ... . . ... . .XXoooXoXoXoXoXoooXoooXoooXoooXoooXoooXoXoXoooXoXoXoXoXoXoXoXoXoXoX . . . ... ... .", ". . . . . . . .XXoooXoooXoooooooooooooooooooooooooooooooooooooooXoooXoooXoXoXoXoXoX . . . . . . . ", ".. ... ... ... XoXoXoXoXoXoXoooXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXoXoXoXoXo... ... ... ...", ". . . . . . . XoooooooooooooooooooooooooooooooooooooooooooooooooooXoooXoooXoooXooooX. . . . . . . ", " . . ... . . oooXoXoXoXoXoooXoooXoooXoooXoooXoooXoXoXoXoXoXoXoXoXoXoXXXoXoXoXoXoXoX ... ... ... .", ". . . . . . .oooooooooXoooooooooooooooooooooooooooooXoooXoooXoooXoXoXoXoXoooooooXooo . . . . . . ", ".. ... ... . XoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXX. ... ... ...", ". . . . . . oooooooooXoooooooooooooooooooooooooooXoooXoooXoooXoXoXoXoXoXoooooooooXoX . . . . . . ", " ... ... . .XXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXoXXXoXoXoXoXoXoXo . ... ... .", ". . . . . . XoooooooooXoXoooooooXoooXoooXoXoXoooXoXoXoXoXoXoXoXoXoXoXoXoXoXoooooooooXo . . . . . ", ".. ... ... .XXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXXXoXXXXXXXXXXXoXoXoXoXoXoX ... ... ...", ". . . . . . XoooooooooXoooXoooXoooXoooXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXooooooooooooooo . . . . . ", " . . ... . .oXoooXoXoXoXoXoXoXoXoXoXoXXXoXoXoXXXoXoXXXoXoXXXoXXXoXXXXXXXoXoXoXoooXoXoX . . . ... .", ". . . . . . ooooooooooXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoooXoXoXoXoXoXoXoXoXoooooooooooXo . . . . . ", ".. ... ... oXoXoXoXoXoXXXoXoXoXXXoXXXoXXXoXoXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoX ... ... ...", ". . . . . .XooooooooooooXoXoooXoXoXoXoXoXoXoooXoooooooooooooooXoooXoooooooooooooooooooX . . . . . ", " ... ... . oXoXoXoXoXoXoXoXoXoXXXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXX. ... ... .", ". . . . . . XoooooooooooXoooXoXoXoXoXoXXXoXoXoooXoooooooooooooooXoooooooXoooooooooooXoX . . . . . ", "...... ... oXoXoXoXoXoXoXoXoXXXXXoXXXX XXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXo... ... ...", ". . . . . .oooooooooooooooooooXoXoXoXoXoXXXoXoXoooXoooooooooooooooooooooooooooooooooooX . . . . . ", " ... ... . XoXoXoXoXoXoXoXoXoXXXoXoXoXXXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoooXoXoXoXoXoXoXo . . ... .", ". . . . . oXoooooooooooooooXoXoXoooXoXoXoXXXXXXXXXXXXXoXoooXoooooooooooooooXoooXoooXoXX. . . . . ", ".. .......XXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXX X X oXoXoXoXoXoXoXoXoXoXoXoXoXoXoXo . .......", ". . . . . XoooooooooooooooXoooooXoXoXoXoXoXoXX X X X XXoXoXoooXoXoXoooooooXoooooooooooXX. . . . . ", " ... ... .XXoXoXoXoXoXoXoXoXoXXXX X X XXXXXXXXX X XXXXXXX X X XXoXoXoXoXoXoXoXoXoXX. ... ... .", ". . . . . XoooooooooooooXoXoXXXX X X XXX X X X X X X XXXXX X X X X XXoXoXXXoooXoooXoX . . . . . ", "...... ...XXoXoXoXoXoXoXoXX X X X XXXXoXXXX X X X X X X X X X XXXXXXoXoXoXoXoXX... ... ...", ". . . . . oooooooooooXoXoXXXX XXoXoooXoXoXXXX X X XXXXXXoXoXoXoXXXXXXXXXoXoooooooooX . . . . . ", " ... ... . XoXoXoXoXoXoXX X X XXoXXXoXoX X X X X X XXoXoXoXoXX X X XXoXoXoXoXoXX. . . ... .", ". . . . . oXoooooooXoXXXX X X XXXXXXoXX XXX XXX X X X X XoooXXXoXX X XXXXoooXoooXoX . . . . . ", ".. ....... XoXoXoXoXoXXXX X X X XXX X X X X X X X XXoXX XXX X XXXXoXoXoXoXX... .......", ". . . . . .oooooooooooXXXX X X X X X X X X X XXXXX XXX X X XXXXXXXXX X X XXoXoooooXooo . . . . . ", " ... ... .. oXoXoXoXoXXXX X X X X X X X X X X X X X XXoXoXoXoXoX . ... .....", ". . . . . . XoooXoooooXXXX X X X XXX X XXXXX X X X X X X XXXXoooXoooXo . . . . . ", "............ XoXoXoXoXXXX X X X X X XXX X X XXXXoXoXoXoX ... .......", ". . . . . . XXoooooooXoXX X X X X XXXXXXXXXXXXXXX X X X X X XXXXoXoXoooooXX. . . . . . ", " ... ... ... XXoXoXoXXXX X X X X XXX XXX X X X X XXoXoXoXoXo . ... ... .", ". . . . . . . oXoooXoXXXXXX X X X X XXXXX XXXXXXX X X X X X XXXXoXoXoooX . . . . . . ", ".............. XXXoXoXoXXXX . X XXX X X XXX X X XXXXXXoXoXoXX. ...........", ". . . . . . . .XXoXoooXoXXXX X X X X XXX X X XXXXX X X X X X XXXXoXoXoooXo . . . . . . ", ".... ... ... ...XXXXoXXXXXX X X X X X X X X XXXXXXoXoXo ... ... .....", ". . . . . . . . XXoXoXXXXXX X X X X XXX X X X XXX X X X XXXXoXoXoXoX . . . . . . . ", "................. XXXXoXXXX X X X XXX X XXX X XXXXXXoXoXX...............", ". . . . . . . . . XXoXoXXXXXX X X X X XXXXXXXXoXXXX X X X X XXXXXXXXoXoXX . . . . . . . ", " ....... ... ... . X XXXXXXX X X X X X X X X X X XXXXX oXoXX. . ... ....... .", ". . . . . . . . . . XXoXXXXXX X X X X X X X X X X X X X X X X XXXXXXXXoXX . . . . . . . . ", ".................. . XXXXX X X X X X X X X X XXXXXXXXX. . ...............", ". . . . . . . . . . X XXXXXXX X X X X X X X X X X X X X X X X X X XXXXXXXXoXX . . . . . . . . . ", "............ ....... X XXX X X X X X X X X X X X XXX XXX . ... ....... .....", ". . . . . . . . . . .oXoXXXXXX X X X X X X X X X X X X X X X X X XXX XXXX . . . . . . . . . . ", "..................... oXX X X X X X X X X X X X X X X X XXXXX. ...................", ". . . . . . . . . . . XoXX XXX X X X X XXXXXXX XXX XXX XXXXX X X X XXXXXXoXoX . . . . . . . . . . ", "........ ....... ... . XoX X X X XXXXX XXX X X XXXXX X X X X X oXoX ... ... ... .........", ". . . . . . . . . . . .XXoXXXX X X X XXXXXXXXXXXXXXXXX X X X X X X XooXX. . . . . . . . . . . ", "...................... .XXo X X X X X X X X X X X X X X XXoXo ......................", ". . . . . . . . . . . . XXo XXX X X X X X XXX X X X XXXXX X X X XXXXoooX . . . . . . . . . . . ", ".................... ... XXX X X X X X X X X X X X X X X oXoX . ....... .............", ". . . . . . . . . . . . .XXoXX X X X X X X X X X XXX X X X X X X X X oooXX. . . . . . . . . . ... ", "........................ .XXXXX X X X X X X X X XXoXo .......................", ". . . . . . . . . . . . oXXXXXX X X X X X X X X X X X X X X XXX XXoXooX. . . . . . . . . . . . ", "........................ . XX XXX X X X X X X XXoXoXX. . ... ....... .........", ". . . . . . . . . . . . . oXX XXXXX X X X X X X X X X X XXoXooo . . . . . . . . . . . . ", "..........................XXX X XXX X X X X X XXoXXXoX . .......................", ". . . . . . . . . . . . . oXX X XXXXX X X X X X X X X X XXX XXoXX oXX. . . . . . . . . . . . . ", ".......................... X X X XXX X X X X X XXX XXXXX. ... .....................", ". . . . . . . . . . . . . .XXX X X XXXXX X X X X X X X X oXX XXXXo . . . . . . . . . . . ... ", ".......................... XXX XXX X X X X XXX X XX ...........................", ". . . . . . . . . . . . . .XXX X X X XXXXX X X X X X X XXXXoXX X X XX . . . . . . . . . . . . . . ", "........................ . X X X XXX X X X X X XXXXX X XX ... .........................", ". ... . . . . . . . . . . . X X X X X XXoXX X X X X X XXoXX X X X X. . . . . . . . . . . ... . . ", "............................ X X XXXXXX X X XXXXXXX X .............................", ". . . . . . . . . . . . . . X X X X X X X XXoXoXoXoXoXXXX X X X X X . . . . . . . . . . . . . . ", "............................ X X X X X X X X X X X X.............................", ". . . ... . . . . . . . . . X X X X X X X X X X X X X X X X XXX . . . . . . . . . . . ... ", "........................ . X X X XXX. . .......................", ". . . . . . . . . . . . XX X X X X X X X X X X X X X X X X X XXXXX . . . . . . . . . . . ", "...................... . X X X X X X X X XXX .....................", ". ... . . . . . . . . XXXXX X X X X X X X X X X X X X X XXXXXXX . . . . . . ... . . ", "...................... X X X X X X X X . ...................", ". . . . . . . . . . . XXXXXXXX X X X X X X X X X X X X X X XXXXXXX X . . . . . . . . . ", ".................... X XXX X X X X X X . .................", ". . . ... . . . . . XXXXXXXX X X X X X X X X X X X X X . ... . . ... ", ".................. .X X X X X X . . . . . .............", ". . . . . . . . XXXXXXXX X X X X X X X X X X X X X XXX X . . . . . . ", "............ . X X X X X X . . . . . . . .........", ". ... . . . X X XXX X X X X X X X X X X . . . . . . . ", ".......... . . . . X X X X X . . . . . . . . .......", ". . . . . XXXXX X X X X X X X X X X . . . ", "........ . . . . . X X X X . . . . . . . . . . . ...", ". ... X X X X X X X X X X . . . . ", ".... . . . . . . . . . X X X . . . . . . . . . . . . .", ". X X X X X X X X X X X X X X . . . ", " . . . . . . . . . X . . . . . . . . . . . . . ", " X . X X X X X . . . . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", " . X X X X X . . . . . . . ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", " . . . . . X X X . . . . . . . . . . . . . . . "}; /* XPM */ static char * jim [] = { /* width height ncolors cpp [x_hot y_hot] */ "102 146 5 1 -1 -1", /* colors */ " c black", "? c green", ". c white", "X c #AAAAAAAAAAAA", "o c #555555555555", /* pixels */ " ..........................X...X...X.X.X.X.XXX.XXXXXXXXXXXXoXoXoXoXoooooooooooooooooooooooo o o ooo o ", " .......X...X.XXXXXXXXXXXXXXoXoXoXoXoXoooooooooooooo ooooo o o o ooo ooooooo ooo ooo ooooooo oooooooo ", " XXoooo o ooo o o o o o o o o o o o o o o o o o o o o o o o o ooooo ", " o o o o o o o o o o o o o o o o o o o o o o o o o o ooo ooo ooooooo ooo oooooooooooooooooooooooooo ", " o o o ooooo o o o o o o o o o o o o o o o o o o ooo ooo o o ooo ooo ooo ooo ooo ooo ooooo ", " ooo ooo ooooooooooo ooooooooooooooo ooo o o o o o o o o oooooooooooooooooooooooooooooooooooooooooooo ", " o o o o o o o o o o o o o o o o o o o o o o o o o o o ooo o o ooo o o ooo ooo ", " o ooo ooooooo ooo ooo ooo ooo o o o oooooooooooooooooooooooooooooooooooooooo ", " o o o o o o o o o o o o o o o o o o o ooo ooo ooo ooo ooo ooo ooo o ", " ooooooo ooo ooo o o o o ooo o o o o o o oooooooooooooooooooooooooooooooooooo ", " o o ooo o o o o o o o o o o o o o ooo ooo ooo o o ooo ooo ooo ", " o ooooooo ooo ooo o o o o o o oooooooooooooooooooooooooooooooooo ", " o o o o o o o o o o o o o o ooo ooo ooooooooooo ooo ooooo ", " ooooooo ooo o o o o ooo o o o o oooooooooooooooooooooooooooooooo ", " o ooo o o o o o o o ooo o o ooo o o ooo ooo ", " ooXoo ooo o o o o ooo oooooooooooooooooooooooooooo ", " oooo o o o o o o o o o ooo ooo ooo ooo ooooooo o ", " ooo ooo o o o ooo o o o o o o oooooooooooooooooooooooooooo ", " o o o o o o o o o o o ooo o o ooo ooo ooo ", " o ooo ooo o o o o o o o o o o oooooooooooooooooooooooooo ", " o o o o o o o o ooo ooo ooo ooo ooooooooo ", " o o ooo o o o o o o o o o o o o oooooooooooooooooooooooooo ", " o o o o o o ooo ooo ooo o o ooo ooo ", " o ooooo o o o o o o o o ooo o oooooooooooooooooooooooo ", " o o o o o o o o ooooXoXoo o ooo ooooooo ooooooooo ", " ooo ooo o o o o o ooooooo ooooXoX o ooXXXXXXXoooo o oooooooooooooooooooooooo ", " o o o ooooo ooooXoXXXXXoo ooXXXXXXXXXoooo o o ooo o ooooo ooooooo ", " o o o o o o o o o ooooooo ooXXXX.X.X.XXoooXX.X.X.XXXXoXoo o o o oooooooooooooooooooooo ", " o o o o o o ooooo ooooXXXX.XXX.oooXXXX.X.XXXXXXoooo ooooooooo ooooooo ooooo ", " ooo o o o o o o ooooXoooXoXX.X.X...X.XXoXX.X.X.X.X.XXXXoooo o oooooooooooooooooooooooo ", " o o o o ooooooXoXXXXXX.X.X.XXoooXX.XXX.XXXXXXoXoo ooo o o ooo ooooooo ooo ", " o o o o o o o ooooXoXoXXXX.XXX.X.X...oXX.X.X.X.X.X.XXXXoooo o oooooooooooooooooooooo ", " o o o o ooooXoXXXXXX.X.X.XXoXX.X.X.X.X.X.XXXXoXoo o ooo ooooooo ooooooooo ", " o o o o o o o ooooXoXXXX.X.X.X.X.X.XXX.X.X.X.X.X.XXX.XXoXoo o o o oooooooooooooooooooooo ", " o o o ooXoXoXXXXXXXXXXXoXoXX.X.X.X.XXXXXXXXXXoo o ooo ooo ooo ooooooo ", " o o o o o o o ooooXoXoXXXX.X.X.XXoXoXX.X.X.X.X.X.XXXXXXXXoo o oooooooooooooooooooooo ", " o o o o ooooXoXoXXXXXXXX.XXoXX.X.X.X.X.X.X.XXXXXXoXoo ooo ooo ooooooo ooooo ", " o o o o o o o o ooooooXXXXXXXX.X.X.XXX.......X.X.X.XXXXXXXXoooo oooooooooooooooooooooo ", " o o o ooooXoXoXoXoXXXXXXXX.X.X.X.X.X.X.XXXXoXoXoooo o ooo ooo ooo ooo ooo ", " o o o o o o ooooooXoXXXXXXXX.X.X...........X.XXXXoXoXoXoXoo oooooooooooooooooooooo ", " o o o o ooooXoXoXoXX.X.X.X...X...X.X.XXoXoo ooooooo o ooo ooooooo ooooooo o ", " o o o o ooo o o o ooooXoXoXXXX.X.X...........X.XXoXoooooooXoooo o oooooooooooooooooooooo ", " o o ooooooXoXoXXXX.X...X...X.X.XXoo o ooooooooo oo ooo ooo ooo ooo ooo ", " o o o o o o o o o ooooooooooXoXXXX.X.......X.XXoooooXoXoXoooooo oooooooooooooooooooooo ", " o o o o o o o o o o ooooXX.X.X.X.X.XXXXoooXoXXXoXoXoooo o ooo ooo ooooooo ooooo ", " o o o o o o o o o o o ooo ooo ooXoXX.X.X.X.XXXXoXoXX.X.XXoXoXoXoo oooooooooooooooooooooooo ", " o o o o o o ooXXXXXX.XXXXoooXoooXoXoXoooXoo ooo ooo ooo ooo ooo ooo ", " o o o o o o o o o o o ooooooXoXoooooXoXXXX.XXXXoooooo ooooooXoXXXoo oooooooooooooooooooooooo ", " o o o o o ooooooXoooooooooXX.XXXXoXoooo o ooo ooXXXoo o o ooo ooooooo ooooooo o ", " o o o o o o o ooo ooooooooo o ooooooooXX.XXXXXXoXXo ooXoooXXXXXooooooooooooooooooooooooooo ", " o o o o o o o oXoooooooXXXoXoXoXoXoooXoooXoXXXoooo o o ooo ooo ooo ooo ooo ", " o o o o o o o o o o ooooo o o ooo ooXXXoXoooXX.XXoXXXXXXXXXXXoXXXXXXXooooooooooooooooooooooooooo ", " o o o ooooo o ooo o oXXoXoXoooXXXXXoXXXoXoXoXoXoXXXXXoooooo ooo ooooooooooo ooooo ", " o o o o o o o o o o ooooXoXoo ooXoXoXXXXXoooXXXXXoXoXXXXXXXXXXXX.XXXXooooooooooooooooooooooooooo ", " o o ooooooo ooooooXoXoXoooooXoXoooXoXXXXXXXXXXXXXXXoooo ooo o o ooo ooo ooo ooo ", " o o o o o o o o ooo o o ooXoXoooooXoXoXXXoooooXoXXXoXoXXXXXX.XXXXXXXXXXooooooooooooooooooooooooooo ", " o o o o ooo o ooXoXoooooXoXXXoXoooooXoXoXoXoXXXXXXXXXXXXXXXoo ooo ooo ooo ooo ooooooo o ", " o o o o o o o o o ooo o o ooXoXoXoXoXXXXXXXoXoooXXXXXoXoXXXX.X.X.X.X.XXXXooooooooooooooooooooooooooo ", " o o o o o ooooXoXoXoXoXoXoXoo ooXoXoXoooXXXX.X.XXXXXXoXoooo ooo ooo ooo ooooo o ooo ", " o o o o o o o o o o o ooooXoXoXoXoXXXXXoooooXoXXXoXoXoXX.X.X.X.XXXXXXooooooooooooooooooooooooooo ", " o o o o ooooXoXoXXXXXXXoXoo ooXoXXXoooXX.X.X.X.XXXXoXoo o o ooo ooo ooo ooo ooooo ", " ooo o o o o o o o o o ooXoXoXXXX.XXX.XXXXoooXXXXXXXoXoXX...X...X.XXoXooooooooooooooooooooooooooo ", " o o ooooooXoXXXXXXXXXoo ooXXXoXoXooX.X.X.XXXXXXoXoooo o o o o ooo o o ooo o o ", " o o o o o o o o o o ooooooXoXXXX.X.XXXo ooXoXXXXXoXoXX.X.X.X.XXXXooooooooooooooooooooooooooooo ", " o o o o ooooXoXXXXXXXXXoo ooXXXXXoXoXoXX.XXX.XXXXoooo ooo ooo ooo ooo ooo ooo o ", " o o o o o o o o o o o ooooXoXXXX.X.XXoooooXX.X.XXoXoXX.X.X.XXXXoXoXooooooooooooooooooooooooooo ", " o o o o o o ooooXoXXXXXoX o ooXXXXXoooooXXXXXXXXXoooooooo o o ooo o o ooo o o ooo ", " o o o o o o o o o o o o o ooooXXXXXXXXXoo ooXXXXXoooooXXXXXXXXXXXoXoXooooooooooooooooooooooooooo ", " o o o o o ooooXoXoXXXoXoo o XoXoooo ooXoXoooXoXoooooo o o ooo ooo ooo ooo ooo o ", " o o o o o o o o o o o ooooooXoXXXoXoXoXoo o ooooo o ooooooooooXoXoXooooooooooooooooooooooooooo ", " o o o o ooooooooooo o o o o o o ooooooXoo o ooo o o ooo o o ooo o o ", " o o o o o o o o o o o o o o ooooooooooooo o o o o o o o o XoXoXooooooooooooooooooooooooooooo ", " o o o ooo o o o o ooXoooooo o o ooo o o ooo ooo ooo o ", " o o o o o o o o o o o ooo ooXoo o o o o o o o o o o ooooooXoXoXooooooooooooooooooooooooooooo ", " o o o o o o ooo o o ooooXoXoooo o o o o o o o o ooo o o ooo ", " o o o o o o o o o o o o o o ooo o o o o o o ooooooooXoXoXoXoooo oooooooooooooooooooooooooo ", " o o o o o o o o ooo oo o o o o ooo ooooooXoXoXoXoo o o o o ooo ooo ooo ooo ooo o ", " o o o o o o o o o o o o o o o ooXoooXoooooooXoXoXoXoXoXoXoXoXoXoXoo oooooooooooooooooooooooooooo ", " o o o ooooooo o ooooXoXoXoXoooooXoXoooo o o o o o o o o o o o o o o o o ", " o o o o o o o o o o o o o o ooooooooooooooooXoXoXoooXoXoXoXoXooooooooooooooooooooooooooooooooo ", " o o o o o o ooooooo o ooooooooooooooXoooooo ooXoo o o o o o o ooo o o ooo o ", " o o o o o o o o o o o o o o o ooooooooooooooooooooooXoXoXoXoooooXXXooooooooooooooooooooooooooo ", " o o o o ooo ooo o ooooooXoXoXoo o o oXXoooooooo o o o o o o o o ooo ", " o o o o o o o o o o o o o o o ooooooooooooXXXXXXXoXXXoXooooooo.XXoXoooXooooooooooooooooooooo ", " o o o o o o o ooooooXoXXXoXoXoXoooooo ooXXXoXoooooooooooo ooo o o ooo o ", " o o o o o o o o o o o o o o o o o o o o ooooooooXoXXXXXoXXXoXoooooooXX.XXXXoXoXoXoXooooooooooooooooo ", " o o o o o o ooooXoXoXoXoXoooo oooo...XXoooooooooooooo ooo o o ooo ", " o o o o o o o o o o o o o o o o o o o o o ooo ooooXoXoXoXoXoXoooooXo....XoXoXoXoXoXoXoXooooooooooooo ", " o o o o o o o o o ooooooooXoXoooo ooooX....XXoooXoXoXoXoXoooooooooooooo ", " o o o o o o o o o o o o o o ooo o o o o o ooo ooooooooXoXoXoooXoX......XXoXoXoXoXoXXXoXoXoXoXoXooo ", " o o o ooo o o o o o ooo ooooooo ooooXX.....XXoXoXoXoXoXoXoXoXoXoXoXoooX ", " o ooo o o o o ooo o o ooooXXo o o o o o o ooo ooooooooooooXoXX.......XXoXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o ooXoo o o o o o o o o o o o ooooXX.......XXoXoXoXoXoXoXoXoXoXoXoXoXoX ", " o o o o o o o ooo o o o o ooXX.Xo ooo o o o o o o o o ooooXoXX.........XXoXoXoXoXoXXXoXoXoXXXoXXXo ", " o o o o o o o ooXXXoo o o o o o o o oooooX.........XXoXoooooooXoooXoXoXoXoXoXoX ", " o o o o o o ooo o o o o ooooXXXX.Xo ooo ooooooooooooXoooXoXX...........XXoXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o ooXXXX.Xo o o ooooooXoooXoooXooX.............oXoXoooXoooXoXoXoXoXoXoooo ", " o o ooo o o ooooooo ooo o ooooXX.X...XXoooooooooXoXoXoXoXoXX.............XXoXoXoXoXoXXXoXoXoXoXoXoXo ", " o o o o o o o o o o o ooXX.X.X.XXoooo oooooooooooooX...............oXoooXoXoXoXoXoXoXoXoXoooX ", " o o o ooo o o o ooooo o o ooooXX.X.......oXoooooooXoooXoXX...............XXXXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o o ooooXX.X.......XoooooooooooooX.................oXoXoXoXoooXoXoXoXoXoooXoX ", " o o ooo ooo ooo ooooo o ooooooXX.X..........XoXoooooXoXX..................XXXXXoXXXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o o o o oXXXXX.X........Xooooooooo...................XXoXoXoooooooooooooooXoooX ", " o o o o o o o ooooooo ooo ooooXXXX.............XXoooXX....................XoXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o o o oooXXXXX.X...........XXoXX.....................XooXoooXoooXoXoXoXoXoXoXoX ", " o o ooo ooooooooooooo o o o ooXX.X.X..............XX.......................oXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o o oX.X.X.X............Xooo.....................XXoooooooooooXoXoooooooXoX ", " o o o o o ooo ooo ooo o o ooooXX.X...............oo?oX.....................oXoXoXoXoXoXoXXXoooXoXoXo ", " o o o o o o o o o o o o o oooX.X.X.X.X.........Xo???oX...................XXoXoooooooXoooXoooooooXoX ", " ooo o o o o ooo ooo ooo ooooooXX................X?o?o?X....................XXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o oooooX.X...X...X.......?????? X..................XXoXoXoooXoooooooooooXoooX ", " o o o o o ooo ooo o o o o oooo.................X??o???oo...................XXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o o o ooXX...X.......X...Xo???????oX..................XoXoXoooooXoXoooooXoXoooo ", " o o ooo o o ooo ooo o o o oooo.X...............?o???o?oX...................XXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o oooX.X.......X...X..X???????XX...................oooXoXoXoooXoXoXoooXoXoo ", " o o o o o ooo ooo o o ooo oooo..................X???o?XX.X.................XXoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o oooX..................X???oo...X.................oooooXoooXoooXoooXoooXoX ", " ooo ooo o o ooo ooo ooooooooXo...................Xo???X....................XXoXoXoXoXoXoXXXoXoXoXoXo ", " o o o o o o o ooo o oooX.X...X...X...X.....?????.....................oooXoooooooXoooooooooooo ", " o o o ooo o o o o o o ooooooooX..............X...Xo???oX....................XoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o oooooX...........X......X?????X....................oXoXoXoXoXoooooXoXoXoXoo ", " o o o o ooo o o ooo ooooooooooX..................X??o???....................XoXoXoXoXXXoXoXoXXXXXoXo ", " o o o o o o o o o o o o ooo oo.X...X...X...X...XX???????...................oooXoXoXoooXoooXoooXoXoX ", " o ooo o o ooo ooo ooo ooooooooX..................o????o??o..................XoXoXoXoXoXoXoXoXoXoXoXo ", " o o o o o ooo o o o o ooo oooo.................Xo???????oX.................XXoooXoooooXoXoooXoXoXoo ", " ooo o o ooooooooooo ooooooooooXX.........X.....XX?????o?o?X..................oooXoXoXoXoXoXoXoXoXoXo ", " o o o o o ooo o o o o o o o oo.X...X...X.X...XX??????????oXX...X...........XooooooooooXoooooooXoXoX ", " o o o o ooo o ooo ooo ooo ooooXX.........X.....o????o?o???oX................XoooXoXoXoXoXoXoXoXoXoXo ", " o o ooo o o o o o o o o oooo...X...X.X.X...oo?????o?????X................XXoooXoooooooXoooXoXoXoo ", " o o ooooooooooooooo ooo ooooooXX.........X...Xo?????o?o???oo.................oooXoXoXoXoXoXoXoXoXoXo ", " o o o o o o ooo o o o o o o oo.X...X.X.XXX.XX?????????????oX...............XooooooooooooooXoooooooX ", " o o o ooooooooooooooo ooooooooXX.........X...oo???o???o???oo.................oXoXoXoXoXoooXoXoXoXoXo ", " o o ooo o o o o ooo o ooooooXX.....X.X.X.Xo?????o?o?????oX...............XXoooXoooXoooXoooXoXoXoX ", " ooo ooooooooooooooooooooooooooXX.......X....Xo??????o?o?o?o?X................XooXoXoXoXoXoXoXoXoXoXo ", " o o o o o o o o o o ooo oo.X...X.X.X...o??????????o????o...X...........XXoooooooooooooooooXoooX ", " o o o o ooooooooo o ooooo ooooXX.....X.....XX???????o?o?o?o?oX...............XooooXoooXoooXoooXoXoXo ", " o o o o o o o o o o o o o oo.X.X.X.X...X.o????????o???o??oXX...X..........XoooooooooooooooXoXoXoo ", " ooo o o ooooooooooo ooooo ooooXX...........XX???o???o?o?o?o?oX...............XooooooXoXoXoXoXoXoXoXo ", " o o o o o o o o o o o o ooo oo.X.X.X...X.XX?????????????????XX.....X.......XXoo ooooooooooooooXoooo ", " o o o ooo o o ooo ooooooooooooXX.X.........Xo?o?o?o?o?o?o?o?oo...............XooooooooXoXoXoXoXoXoXo ", " oo o o o o X o o ooo o o ooooXX.X...X...XX?????????o???o?o?XX..............XoooooooooooXoooooooooo ", " ooo o o ooXoooo ooooooooooooooXX...........Xo?o?o?o???o?o?o?ooXX.............XooooXoXoXoXoXoXooooooo ", " o o o o o o o o o o o ooooooXX.X.X...X.XX?????????????????oXXX...X........Xoooooooooooooooooooooo ", " o o o ooo ooo o o ooooo ooo ooXX.X.......X.oo?o?o???o?o???o?oo.X.............XXoooooooXoXoXooooooooo ", " oo o ooo o o o o o o o o o ooXX.X.X.X.X.Xo?????????????????oXXX.....X......Xoooooooooooooooooo o o ", " Xoo ooooooo o o o o o o ooo ooXXXX.X.....XXoo???o???o???o?o?oo.X.X...........XXoooooXoooXoooXooooooo "}; /* XPM */ static char * kamesh [] = { /* width height ncolors cpp [x_hot y_hot] */ "97 124 4 1 -1 -1", /* colors */ " c #AAAAAAAAAAAA", ". c white", "X c #555555555555", "o c black", /* pixels */ " . . . . . . . . . . . X X . . . . . . . . . . . . ", ". . . . . . . . . . . . . . . . . . . X X X . . . . . . . . . . . . . . . . . . . . . .", " . . . . . . XXXXXXXXXXX XXX XXX X . . . . . . ", ". . . . . . . . . . . . . . . . XXXXXXXXXXXXXXXXX . X X X XXX . . . . . . . . . . . . . . .", " . . . . . . . . . XXXXXXXXXXXXXXXXXXXXoXX X X XXXXoXXXX . . . . . . . . . ", ". . . . . . . . . . . . . . XXXXXXX XXX XXXXXXoXXXXXXXX XXXXXXXXXXX . . . . . . . . . . . . .", " . . . . . . XXoXoXXXoXXXXXXXoooXoXoXoXoXoXoXoXoXoXoXXXX X . . . . . ", ". . . . . . . . . . . . X XXXXXXoXXXXXXXoXoXoXoXoXXXoXXXoXXXoXXXoXoXX X X . . . . . . . . . . .", " . . . . . . X XXoXoXoXoXoXoXoXoooXoooXoXXXoXoXoXoXoXXXoXXXX X X . . . . . . ", ". . . . . . . . . . . .X XXoXoXoXXXXXXXoXoXoXoXoXoXoXXXoXXXoXXXXXXXoXX X X X . . . . . . . . . .", " . . . . . XXXoXoXoXoXoXoXoXoXoXoooXoooXoXoXoXoXoXoXoXoXoXXXXXX X . . . . ", ". . . . . . . . . . . XXoXoXXXoXoXoXoXoXoXoXoXoXoXXXoXoXoXoXoXXXXXXXo XXX X X . . . . . . . . .", " . . . . . . XXoXoXoXoooXoXoXoXoXoooXoooXoXoXoXoXoXoXoXXXoXXXXXXXXXX X . . . . . . ", ". . . . . . . . . . XXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXoXXXoXXXoXXXXXXXXXX XXX X . . . . . . . .", " . . . oXoXoXoXoXoXoooXoooXoooooooXoXXXXXXXoXoXoXoXoXoXoXXXXXXXXXXXXXX . . . ", ". . . . . . . . . XXoXXXXXXXoXoXoXoXoXoXoXoXoXXXXXX X XXXXXXXXoXXXXXXXXXXXXXXXXXX . . . . . .", " . . . . oXoXoXXXoXoXoXoXoooXoXoXoXoXXXX X X X XXXXXXoXoXoXXXXXXXXXXXXXXXXXX . . . ", ". . . . . . . . XXoXXXXXXXoXXXoXoXoXoXoXXXX X X X X X X XXoXXXXXX XXX X XXXXXXX . . . . . .", " . . XXoXoXXXoXoXoXoXoooXoXoXXXX X X X X X X X X XXXXoXoXoXX XXXXXXXXoXXXX . . . ", ". . . . . . . . XoXXXX XXXXoXoXoXoXXXX X X X X X X X X X XXoXoXoXX XXXXX XXXXXXX. . . . . .", " . . . . oXoXX XXXXoXoooooXXXX X X X X X X X X X X X X XXXXoooXo X XXXXXXXXXXXX . . . ", ". . . . . . . .XXXXX X XXXXoXoXoXX X X X X X X XXoXoXX X X XXXXXXXXX . . . . .", " . . XoXoXX XXoXoXoXoXXXX X X X X X X X X X X X X X X XXXXoooXoXXXXXXXXXXXXXX . . ", ". . . . . . . XXoXXXX XXXXoXoXXXX X X X X X X X XXoXXXX XXXXXXX X X . . . . .", " . . . XXoXoXo XXXXoXoXXXX X X X X X X X X X X X X X XXXXoXoXXXoXXXXXXXoXX X . . . ", ". . . . . . . XXXXoXX X XXoXXXX X X X X XXXXoXXXXXXXXXXXX X . . . .", " . . . oXoXoXoXXXXXoXoXXXXXX X X X X X X X X X X X X X X XXXXoXoXoXoXXXoXXXoXX X . . ", ". . . . . . XXoXoXoXXXX XXXXXXX X X X X X XXXXoXXXoXXXXXXXXXX X . . . .", " . . . XXoXoXoXoXoXXXoXXXXXX X X X X X X X X X X X XXXXoXoXoXoXoXXXoXXXXXX . ", ". . . . . . XXXXXXXoXXXX XXXXXXX X X X X X X XXoXXXoXXXXXXXXXXXX . . . .", " . . XoXXXoXoXoXXXXXoXoXXXXXX X X X X X X X X X X X X X X X XXoXoooXoXoXoXoXoXoXX . . ", ". . . . . XXXXXXXXoXXXX XXXXXXXXX X X X X X X X XXXXoXXXoXoXoXXXXXX . . . .", " . . oXoXoXXXoXXXoXXXoXXXXXXXXXX X X X X X X X X X X X XXXXXXoXoXoXoXoXoXXXXXX . . ", ". . . . . XXXXXXXXXXXXXXXXXXXXXX X X X X X X XXoXoXXXoXoXXXXXXXX . . . .", " . . oXoXXXoXXXoXXXoXoXoXXXXXX X X X X X X X X X X X X X XXXXoXoXoXoXoXXXXXXXX . . ", ". . . . .XXXXoXXXXXXXXXXXoXXXXXXXX X X X X X X X XXoXXXoXXXX XXX X . . . .", " . . XXXXoXXXoXoXoXoXoXXXXXXXXXX X X X X X X X XXXXXXXXoXXXoXXXoXXXXXX . ", ". . . . . XXXXXXXXoXXXXXoXXXXXX X X X X X XXXXXXX XXoXXXXXXXX . . . .", " . . XXXoXoXoXoXoXoXoooXXXXXXXX X X X X X X X X X X XXXXXXXXoXoXXXXXoXXXoXoXX . . ", ". . . . XXXXoXXXoXXXoXoXoXXXX X X X X X X X X X X X XXXXXXX XXXXXXX X . . . .", " . . XXoXoXoXoXoXoooXoXXXXXXXoXXXXXX X X X X X X X X X X X X X XXXXXXoXXXXXXXXXXXXXX . . ", ". . . . .XXXXXXoXXXoXXXoXXXXXXXoXoXoXXXXXXXX X X X X X X X X X X X X X X XXoXXXXXXXXXXXX . . . .", " . . XXoXoXoXoXoXoooXXXoXoXoooooooXoXoXoXXXX XXXXXXXXXXoXXXXXXXXXXXXXoXoXXXoXXXXXoXX . . ", ". . . . .X XXoXXXXXoXoXoXXXXXoXXXoXXXoXoXoXXXXXX X XXXXXXXXoXoXXXoXXXXXXXXXoXoXXXXXXXXXX . . . .", " . . . XXXXoXoXoooXoXXXoXoXoXoXoXoXoXoXoXXXXXXXXXXXoXXXoXoXXXXXXXoXoXXXXXoXoXoXoXXXoXX. . . . ", ". . . . .XXXXXXoXoXoXoXXXXXXXXXXXXXXXXXXXXXoXXXX X XXXXoXoXoXXXX XXoXXXoXXXXXoXoXXXXXXXX . . . .", " . . XXoXoXoooXoooXoXoXoXoXoXoXoXoXX XXoXoXXXXXXXoXoooooooXoXoXoXoXoXoXoooXoXoXoXXXX . . ", ". . . . . XXXoXoXoXoXoXXXXXXXoXoXoXXXXXXXX XXoXXXX XXXXoXoXoXoXoXXXXXXXXXXXoXoXoXoXXXX X . . . .", " . . XXXXoXoXoooXoXoXoXoXoooXoooXoXoXoXoXoXX X XXoooXoooXoXoXoXXXoXoXoXoXoXoXoXXXXX . . . ", ". . . . . XXXXXXoXoXoXXXXXoXoXoXoXoXoXoXoXoXoXX X X XXoXoXoXoXoXoXoXXXXXXXoXoXoXXXoXXXX . . . .", " . . oXoXoXoXoXoXoXoXoooooXoooooXXXoXoXoXoXXXoXoXoooXoooooooXoXoXoXoXoXoXoXoXXXXXX . . ", ". . . . . . XoXXXoXoXoXoXXXXXoXoXXXoXoXXXXXXXXXXXX XXoXXXoXXXoXoXoXoXoXXXXXoXoXoXoXXXXXX . . . .", " . . . . XXoXoXoXoXoXXXXXoXoXoXoXXXXXXXoXXXoXX X XXoXXXoXXXoooXXXoXoXoXoXoXoXoXoXoXoX . . . . ", ". . . . . . XXXXoXoXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXoXoXXXoXXXoXXXoXXXX. . . . .", " . . .XXoXoooXoXoXoXXXXXXXoXXXoXXXoXXXXXoXX X XXoXoXoXoXXXXXXXoXoXXXXXoXoXoXoXoXX . . ", ". . . . . . oXXXoXXXXXXXXXX X XXXXXXX XXX XXXXX X XXXXXXXXXXXXXXXXXXXXXXoXXXoXoXoXX . . . . .", " . . . . XXoXoXoXXXoXXXXXX XXX XXXXXXX XXXXX X X X XXXXXXXXoXXXoXXXXXXXXXoXoooXoXX . . . ", ". . . . . . XXXXXXXXXXXXXXX X X X X X X X XXX X X X X XXX XXX X X XXXXXXoXXXX . . . . . .", " . . . XXXXoXoXoXXXXXXXXXX X X X X X XXoXX X X XXX X XXXXX X X X XXoXXXXXoXoXX . . . . ", ". . . . . . XXXXXXXXXXXXXX X X X X X X XXX X X XXX X X X X X XXXXXXXXXXX . . . . . .", " . . . . . XXXXXXoXXXoXX XXX X X X X X X XXXXX X XXXXX X X X X X X XXXXXXXXXXoX . . . . . . ", ". . . . . . X XXXXXXXXXX X X X X X XXX X X X X X X X XXXXXXX X X . . . . . .", " . . XXXXoXoXoXXXXXX XXX X X X X oXXXXXXXXXX XXXXXXoXX X X X X X XXXXXXX XXXXX . . . ", ". . . . . . X XXXXXXXXXXX X X X X X X XXoXXXoXXXX XXXXXXXXX X X X X X XXX X X X . . . . . .", " . . . . X XXoXoXoXoXXXXXXXX X XXXXoXoXoXoooooXoXoXoooXXXXXX X X X X X XXXXX X X . . . . . . ", ". . . . . . X XXXXXXXXXXXXXXXXXXXXXXXXXXXXoXoXoXoXoXoXoXXXXXXXX X X XXX X. . . . . . .", " . . XXXXoXoXoXoXoXXXoXoXoXXXXXXXXXoXoooXoooXoXoooXXXoXXXXXX X XXXXXXXXX X X . . . . ", ". . . . . . X XXXXXXXXXXXXXXX X X X X X XXXXXXoXXXXXXXX XXXXXXoXXXXXXXX XXX X X . . . . . . .", " . . . . X XXXXoXoXoXXXXXX X X X X XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X . . . . . . ", ". . . . . . X X XXXXXXXXXXX X X X X X X X X X XXX X XXX XXX X X X X X X XXX XXX . . . . . . .", " . . .XXXXXXoXoXXXXXXXXXX XXX XXX XXX XXX XXXXXXXXXXXXXXX XXX XXXXXXXXXXX X X . . . . ", ". . . . . . XXXXXXXXXXXXXXXXX X X X X XXX X X X X X X X X XXX X X X X XXXXXXX X X . . . . . . .", " . . . . . XXXXoXXXoXXXXXX XXX X X XXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXX X X . . . . . . ", ". . . . . . . XXXXXXXXXXXXX X X X X X X XXXXXXX XXXXXXXXXXX X X X X X X XXX X X X . . . . . . .", " . . . . XXoXXXoXoXXXXXXXXXXXXXXXXXoXoXoXoXoXoXoXoXoXoXXXXXXXX XXXXXXXXXXXXX . . . . . ", ". . . . . . . XXXXXXXXXXXXXXX X X XXXXoXoXoXoXoXoXoXoXoXoXXXX X X X X XXXXXXX X . . . . . . . .", " . . . . . . . XXXoXXXoXXXXXXXXXXXXXXXoooXXXX XXX XXXXXXXXoooXXXX XXX XXXXXXXXXXX . . . . . . . ", ". . . . . . . .XXXXXXXXXXXXX XXX XXXXXXX X X X X X X X X XXXXXXX X X X X XXXXX X . . . . . . . .", " . . . XXX oXoXXXXXXXXXXXXXoXXXXXXXXXX X X X XXXXXXXXXXXXXXXXXXXXXXXXX . . . . . ", ". . . . . . . . X XXXXXXXXXXX XXXXXXXXXXX X X X X X X XXX XXXXXXX X X XXXXXXX X. . . . . . . . .", " . . . . . . . XXXXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX . . . . . . . . ", ". . . . . . . . . XXXXXXXXXXXXXXXXX XXXXXXXXXXoXXXoXXXXXXXX XXX X X XXX XXX X . . . . . . . . .", " . . . . . . XXoXoXXXoXXXXXXXXXXXXXoXoXoXoXoXoXoXoXXXXXXXXXXXXXXXXXXXX . . . . . . ", ". . . . . . . . . . XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XXXXX . . . . . . . . . .", " . . . . . . . . . XXoXoXXXoXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXX . . . . . . . . . . ", ". . . . . . . . . . . XXXXXXXXXXXXX X X X X X X X X X X X XXX XXXXXXX. . . . . . . . . . .", " . . . . . XoXoXoXXXoXXXXXXXXXX X X X X X X XXXXXXXXXXXXXXXXoXo . . . . . ", ". . . . . . . . . . . . XoXXXoXXXXXXXX X X X X X X X X X X X X XXXXXXXXXXXX . . . . . . . . . . .", " . . . . . . . . . . . XXoXoXoXoXoXXXXXX X X X X X X X X XXXXXXXXXXXXoXX X . . . . . . . . . . ", ". . . . . . . . . . . . XXoXXXXXXXX X X X X X X X X X X X XXXXXXXXXXX . . . . . . . . . . . .", " . . . . . . . . . XoXoooXoXoXoXXXXXXXXXX XXX X X XXXXXXXXoXoXoXoX . . . . . . . . ", ". . . . . . . . . . . . XXoXoXoXoXXXXXXXX XXX X X X X XXX XXXXXXXXXXoXX . . . . . . . . . . . .", " . . . . . . . . . . . XoXoXoooXoXoXoXXXXXXXXXX XXXXXXXXXXXXoXoXoXoXoX . . . . . . . . . . . . ", ". . . . . . . . . . . . .XXoXoXoXoXoXoXXXXXXXXXX XXX XXXXXXXXXXoXXXoXXXX. . . . . . . . . . . . .", " . . . . . . . XoXoooooooooooXoXoXoXXXoXXXoXXXoXoXoXoXoooXoXX . . . . . . . . . ", ". . . . . . . . . . . . .XXoXoXoXoXoXoXoXoXXXoXoXoXXXXXXXoXoXoXoXoXoXXX . . . . . . . . . . . . .", " . . . . . . . . . . . oXoXoooooooXoooooXoXoXoXoXoXoooXoooXoXoXoXoXX . . . . . . . . . . . . ", ". . . . . . . . . . . . . XXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXX . . . . . . . . . . . . .", " . . . . . . . . . oXoXoXoooooooooooooooooooooooooooXoooooXoXoXX . . . . . . . . . . ", ". . . . . . . . . . . . XXXXoXoXoXoXoXoXoXoooXoXoXoXoXoXoXoXoXoXoXXXXX . . . . . . . . . . . . .", " . . . . . . . . . . . XXXXoXoXoXoooooooooooooooooooooooXoooXoooXXXXXX . . . . . . . . . . . . ", ". . . . . . . . . . . .XXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXX XXX . . . . . . . . . . . .", " . . . . . . XXoXoXoXoXoooXoooooooooooooooooooooooooooXoXXXXXXXX . . . . . . ", ". . . . . . . . . . . oXoXXXXXXXoXoXoXoooXoooXoooXoooXoXoXoXoXXXX XXXXoX . . . . . . . . . . . .", " . . . . . . . . . oXoXoXXXoXoXoXoXoooooooooooooooooooXoXoXoXXXXXXXXXo . . . . . . . . . . . ", ". . . . . . . . . . .XXoXoXXXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoXXXX X X XXoXX . . . . . . . . . . .", " . . . . . . XXoXoXoXoXXXoXoXoXoXoooXoooooooXoXoXoXoXoXXXXXXXXXoXoXX. . . . . . . . ", ". . . . . . . . . . XXXXXoXXXXXXXXXXXoXoXoXoXoXoXoXoXoXoXoXXXXXX X XXXXXXXX . . . . . . . . . . .", " . . . . . . . . . XXXoXoXoXXXXXXXoXoXoXoXoooXoXoXoXoXoXoXoXXXXXX XXXXoXoXX . . . . . . . . . . ", ". . . . . . . . . .XXXXXXXXXXXXXXXXXXXXoXoXoXoXoXoXoXXXXXXXX X X X X XXoXXXX. . . . . . . . . . .", " . . . . XXoXoXoXoXoXXXXXXXoXoXoXoXoXoXoXoXoXoXoXXXXXXXXXXXXXoXoXXX . . . . . ", ". . . . . . . . . XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X X XXXXXXXXX . . . . . . . . . .", " . . . . . . . XXXXXoXXXoXXXXXXXXXXXXXXXoXXXXXXXoXXXXXXXXXX XXXXXXXXoXXXoXX . . . . . . . . ", ". . . . . . . . XXXXXXXXXXXXXXX XXX XXXXXXX XXXXXXXXXXX X X X X X XXXXXXXXX . . . . . . . . . .", " . . . . . XXXXXXoXXXXXXXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXoXoXXXXXX . . . . ", ". . . . . . XXXXXXXXXXXXXXXXXXX X X X XXX XXX X X XXX X X X X X XXXXXXXXXXXXXXXXX . . . . . . .", " . . . XXXXoXXXXXXXoXXXXXXXoXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX . . . . ", ". . . X XXXXXXXXXXXXXXXXXXXXXXX X X X X X X X X X XXX X X X X XXXXXXXXXXXXXXXXXXXXX . . . . .", " X XXXXXXoXoXoXoXoXXXoXXXoXXXoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXoXXXoXXXoXoXXXX . . ", " X XXX XXXXXXXXXXXXXXXXXXXXXXoXXXX X X X X XXX XXX X X X X X X XXXXXXoXXXXXXXXXXXoXXXXXX . . . .", "XXXXXXXXXXXXoXoXXXoXXXoXXXoooooXXXXXX XXX XXXXXXXXXXX XXX XXX XXXXXXoooXXXoXXXXXoXoXXXXXXXX . . ", "XXXXXXXXXXXXXXXXXXXXXXXXXoooXoooXoXX X X X X X X X X X X X X X XXXXoXoooXXXXXXXXXXXoXXXXXXXX . .", "XXXXoXXXoXXXoXoXoXoXoXXXoooooooooooXXXX XXX XXXXXXXXXXX XXX XXoXoooooooooXXXoXXXoXoXoXXXXXXXX ", "XXXXXXXXXXXXXXXXXXXXXXXoooXoooXoXoXoXXXX X X X X X X X X X XXoXoooXoooXoooXXXXXXXXXXXXXXXXXXXX "}; /* XPM */ static char * scott [] = { /* width height ncolors cpp [x_hot y_hot] */ "99 132 4 1 -1 -1", /* colors */ " c black", ". c #555555555555", "X c #AAAAAAAAAAAA", "o c white", /* pixels */ " ", ".X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...X.X.X.XXX.X.X.XXX.X.X.XXX.X.X.XXX.X.XXXXX.X.X.X.X.X.", "X.X.X.XXX.XXX.XXXXXXXXXXXXXXX.XXXXXXX.X.X.X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XXX.X.X...X...X.XXX.XXXXX.X.XXXXXXX.XXX.XXX.XXXXX.X.XXXXXXX.XXX.XXX.", "X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X...............X.X.X.X.X.X.X.X.XXXXXXX.XXX.XXX.X.XXXXX.X.X.XXX.X.", "X.XXX.XXX.XXX.XXXXXXXXXXXXXXX.X.X.........X...X.X.X.X.XXX.XXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.XXX.X.X.XXX.X.X.... ..................X...X.X.X.XXXXXXX.XXXXXXXXXXX.XXXXXXX.XXX.XXX.", "XXXXXXXXXXXXXXXXXXXXXXXXXXX.X.......................X...X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.X.X.X.X.. ... . . . . . . . . . . ........X.X.XXX.XXX.XXXXXXX.X.X.XXX.XXX.XXX.XX", "X.XXXXXXXXXXXXXXXXXXXXXXX........................ ............X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.XXX.X...... . . . . . . . . . . . . . . ......X.X.X.XXXXXXX.XXX.XXXXXXX.XXXXXXX.", "XXX.XXXXXXXXXXXXXXXXXXX.X.......................................X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.X.X.X.. . . . . . . . . . . . . . . . . . . ......X.X.XXX.X.X.X.XXXXX.XXX.XXX.XX", "X.XXXXXXXXXXX.XXXXXXX.X...... ... ... ....... ....... ... ........X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX", ".X.X.X.XXX.X.X.XXX.X.X.... . . . . . . . . . . . . . . . . . . . ..X.X.XXXXXXX.XXX.XXXXXXX.XXXXXXX.", "XXXXXXXXXXXXXXXXXXXXX.................. ............................X.XXXXXXXXXXXXXXoXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.X.... . . . . . . . . . . . . ... ... . . . . . ....X.X.X.XXX.X.XXXXX.X.X.XXX.XX", "XXXXXXXXXXXXXXXXX.XXX............ ............................... ....X.XXXXXXXXXXXXXXXXXXXXXXXXXXX", ".X.XXX.X.X.X.X.X.X.X.. . . . . . . ... ....................... ... . ....X.XXX.X.X.XXXXXXX.XXX.XXX.", "XXXXXXXXXXXXXXXXXXX.X...................X.X.X.X.X.X.X.X.X...............X.XXXXXXXXXXoXXXXXXXXXXXXXX", ".X.X.X.X.XXX.X.X.X.X.. . . . . . ..........X...X.X.X............ . . . . ..X.XXX.X.XXXXX.XXX.XXX.XX", "X.XXXXXXXXXXXXXXX.X...................X.X.X.X.X.X.X.X.X.X.X.......... ... ..X.XXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.... . . ... ..........X.X.X.X.X.X.X............ . . . . ..X.XXX.XXXXXXXXXXX.XXX.", "X.XXXXXXXXXXXXX.X.X.................X.X.X.X.XXX.XXX.X.X.X.X.X...X...........XXXXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.... . . . . ... ......X.X.X.X.X.X.X.X.X............ . . . ..X.X.X.XXXXX.XXX.X.X.XX", "X.XXX.XXXXXXX.XXX...................X.X.X.X.XXXXX.XXX.X.X.X.X.X...............XXXXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.X.. . ... ... ......X.X.X.X.X.XXX.X.X.X.X.X.......... ... ....X.X.XXXXXXX.XXX.XXX.", "X.X.XXXXXXXXXXXXX...................X.X.XXXXXXXXXXXXXXXXXXX.X.X.X...............XXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.... . . . . ........X.X.X.X.XXXXXXX.X.X.X.X............ ... ....X.XXXXX.X.X.X.X.X.", "X.XXXXXXXXXXX.X.X.... ............X.X.XXXXXXXXXXXXXXXXXXX.X.X.X.X.X.............XXXXXXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.. . . ... ......X...X.XXX.XXXXXXXXXXX.X.X.X.X...X........ . . ..X.XXXXXXX.XXX.XXX.", "XXXXXXXXXXXXXXX.X...............X.X.XXXXXXXXXXXXXXXXXXXXXXX.X.X.X.X.X...........X.XXoXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.X.. . . . ..........X.X.X.X.X.XXX.X.X.X.X.X.X.X.X........ . . . ....XXXXX.XXX.XXX.XX", "X.XXXXXXXXXXXXX.................X.X.X.X.X.XXXXXXXXXXX.XXX.X.X.X.X.X.X.X...... ....XXXXXXXXXXXXXXXXX", ".X.XXX.X.X.X.X.... . . . . ..........X.X.X.X.X.X.X.X.X.X.X.X.X.X.X........ . . . ..XXXXXXX.XXX.XXX.", "XXXXXXXXXXXXXXX.................X.X.X.X.XXXXXXXXXXXXXXXXXXX.X.X.X.X.X.X.............XXXXXXXXXXXXXXX", ".X.X.XXX.X.X.X.. . . . . ..............X.X.X.X.X.X.X.X.X.X.X............ ... . . ....X.X.XXX.XXXXXX", "X.XXXXXXXXXXX.X.. ... ..................X.XXXXXXXXXXXXX.X.X.......X.X.X...... ........XXXXXXXXXXXXX", ".X.X.X.XXX.X.X.. . . . ....... . . ... ..X.XXX.XXX.X.X........ ........... . ... . ..X.XXX.XXX.XXXX", "XXXXXXXXXXXXX.......................X...X...XXXXXXX.X.X.X.XXX.................. ......XXXXXXXXXXXXX", ".X.X.XXX.X.X.... . . . . . . . . ............X.X.X.......X............ . . . . . . . ..X.X.X.XXX.XX", "X.XXXXXXXXXXX.... ... ... ........X.......X.X.XXX.X...X.XXXXX.X.......... ............XXXXXXXXXXXXX", ".X.XXX.XXX.X.. . . . . . . ... ............X.....X...X.XXoXX.X.......... . . . . . . ..XXX.XXX.XXXX", "XXXXXXXXXXX.X...................X.X.X.X.X...X.......XXXXXXoXXXX.X.....................X.XXXXXXXXXXX", ".X.X.X.X.X.X.. . . . . . . . . ............X.. ......X.X.X.X........ . . . . . . ... ..X.XXX.X.X.XX", "X.XXXXXXXXX.......... ................X.X.X.....X...X.X.X.XXX.X...X.......... ........X.XXXXXXXXXXX", ".X.XXX.XXX.... . . . . ... . . ........X...X.....X...X...X.X.......... ... . . . . . ..X.X.XXX.XXXX", "XXXXXXXXXXX.X.......... ................X.XXX...X...X.X.X.....X...X.X.................X.XXXXXXXXXXX", ".X.X.X.X.X.X.. . . . . . . . ... ... ......X............................ . . . . . . ..X.XXX.XXX.XX", "XXX.XXXXXXX...... ... ................X.X.X...X.X...X.X.X.X.X.X...X.......... ........XXXXXXXXXXXXX", ".X.X.X.XXX.X.. . . . . . ............X...............X...X.X.X............ . . ......X.XXX.XXXXXXX.", "X.XXXXXXXXXXX...................X...X.X.X.X.....X.X...X.X.X.X.X.X.X.X.X.........X.X...XXXXXXXXXXXXX", ".X.X.X.XXXXX.... ... . . ... ......X.X.X.... ....... ..X.X.X.X.X............ ..........X.XXX.XXX.XX", "X.XXXXXXXXXXX.....X.. ............X.X.X.X.....X.X.X...X.X.XXX.X.X.X.....X.........X...XXXXXXXXXXXXX", ".X.XXX.XXXXX.X...X.. . ..........X.X.X.X.. ....X.X.......X.X.X.X.X...............X.X.X.XXXXXXXXXXX.", "XXX.XXXXXXXXXXX.X.X.............X.X.XXX.....X.XXXXX.X...XXX.X.X.XXX.X...X.......X.X.XXXXXXXXXXXXXXX", "...X.X.X.X.X.X...... . . ... ......X.........X.X.X.X...X...X.X.X.......... . ......X.XXX.X.XXXXX.XX", "X.XXXXXXXXXXX.X...................X.....X.....XXXXX.X.X.X...X.X.X.....X...........X.X.XXXXXXXXXXXXX", ".X.XXX.XXX.XXX.. ... . ..........X...X.X.X.....X.X.....X.X.X.X.......X.... ..........X.XXX.XXX.X.X.", "X.XXXXXXXXXXXXX.............X.X.XXX.XXXXX.......X...X.X.XXXXXXX.XXX.X.X.........X.X.X.XXXXXXXXXXXXX", ".X.X.X.X.X.X.X.. ... ... ......X.X.X.X.X...............X.XXX.X.X.X.X...... . ..........XXXXX.X.X.XX", "X.XXXXXXXXXXX.X...... ........X.X.XXXXXXX.X.X.X...X.X.X.XXXXXXXXX.X.X.X...............XXXXXXXXXXXXX", ".X.XXX.XXXXX.X.. . . . ... ......X.X.X.X.X.......X.....X.X.XXX.X.X.X...... . . ......X.XXXXX.X.XXXX", "XXXXXXXXXXXXXXX...............X.XXX.XXX.X.......X.......X.XXXXXXXXX.X...............XXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.. . . . . . . ..X...X...... . ....... . ......X.X.X...... . . . . ....XXX.XXX.XXX.X.", "X.XXXXXXXXXXX.X.. ... ........X.X.X.X.......................X.XXX.X.X.... ... ......X.XXXXXXXXXXXXX", ".X.XXX.X.X.X.X.... . . . . ......X.... . . ... ... ... . . ....X.X...... . . . . . ..X.XXX.XXX.XXXX", "XXX.XXXXXXXXXXX.................X...............X...............X.X.X...............XXXXXXXXXXXXXXX", ".X.X.XXX.XXX.X.. . . . . . . ....... . . . . ....... ... ... ........... . . . . ....X.X.XXX.XXX.XX", "X.XXXXXXXXXXXXX...... ... ....................X...X.............X.X.......... ......X.XXXXXXXXXXXXX", ".X.X.X.XXX.XXX.... . . . . ....... ... . . ........... ....... ....... . . . . . . ..X.XXX.XXX.XXX.", "XXXXXXXXXXXXXXX.................................X.X.X...X...........................XXXXXXXXXXXXXXX", ".X.X.X.X.X.X.X.. . . . . . . . . . ..... ......X.XXX.... ..... . ... . . . . . . ....XXX.XXX.XXX.X.", "X.XXXXXXXXXXX.X.. ... ... ............X.......X.X.X.......X.......... ... ... ......XXXXX.XXXXXXXXX", ".X.X.X.XXX.X.X.... . . . . . . . . ........................... ... . . . . . . . . ..X.XXX.XXX.XXX.", "X.X.XXXXXXX.XXX.... ................X.X.X...X.X.X.X.X.X.X.X.X.............. ........XXXXXXXXXXXXXXX", ".X.X.XXX.X.X.... . . . . . . . . . ............X.X.X............ . . . . ... . . ....X.X.X.X.X.X.X.", "X.XXXXXXXXXXX.X...... ... ... ............X...X.X.X...X.X.X.......... ....... ......X.XXXXXXXXXXXXX", ".X.X.X.X.X.X.X.... . . . . . . . . ........................... . . . . . . . . . . ..X.XXX.X.X.X.X.", "XXX.XXXXXXX.X.......... ................X...............X...........................XXXXXXXXXXXXXXX", ".X.X.X.X.X.X.... . . . . . . . . . . ....... . . . . ... ... . . . . . . . . . . ....X.X.X.X.X.X.X.", "X.X.XXXXX.X.X.... ... ... ... ... ........................... ... ... ... ... ........XXX.X.XXXXXXX", ".X.X.X.X.X.X.... . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . . . ........X.X.X.X.X.", "X.X.XXXXXXX.X.............. ....... ............................... ....... ................XXXXXXX", "...X.X.X.X.X.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..X.X.X.", "X.X.X.XXX.XX..... ... ... ... ... ... ............... ... ... ... ... ... ... ... ............XXX.X", ".X.X.X.X.X.. . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . ..X.X.", "X.X.XXX.XXX............................................................ ....... ................XXX", "...X.X.X.X.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... . . . . . . . ..X.", "X.X.X.XXX........ ... ... ....... ....... ....... ... ... ... ... ... ... ....X.................X.X", ".X.X.X.X.. . . . . . . . . ... . . . . . . . . . . . . . . . . . . . . . . . ... . . . . . . . ....", "X.X.XXX.X.................................................................. ..X...................X", "...X.X.X.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X.. ... ... ... . . ..", "X.X.X.X.............. ....................................... ... ... ... ....X....................", ".X.X.X.. . . . ... . . ... . . . . . . ... . . . . . . . . . . . . . . . . ..XX. . . . ... ... . . ", "X.X.X.................X.....................................................XXX.X..................", ".... . . . . . . . . X.X.. . . . . . . . . . . . . . . . . . . . . . . . ..X.XXX.X.. ... . . . . . ", "X........ ... ........XXX.X...................... ... ... ....... ... ......XXX.XXX................", ".. . . . . . . . ... ..X...X.. . . . . . . . . . . . . . . . . . . . . ....XXXX..X.. . ... . . . . ", "......................XXX.XXo.............................. ..............XXXXX.XX.................", " . . . . . . . . . . ..X...XXX.. . . . . . . . . . . . . . . . . . ..... ..XXX.XXX.. . . . . . . . ", "............. ..........X.XXoXX.............. ....... ... ... ........X...XXXXX.X..................", " . . . . . . . . . . . ..X.XXXXX...... ... . . . . . . . . . . . ........X.XXX.X.. . . ... . . . . ", "........................XXXXoXXXX.X...............................X.X.X.XXXXo.X.X..................", " . . . . . . . . . . . . X.XXX.X.X.X.... . . . . . . . . . . ......X...X.XXXX... ... . . . . . . . ", ". ....... ................XXXXXXX.X.X........ ... ............X.X.X.X.XXXXoXX.X....................", " . . . . . . . . . . . ....XXXXXXX.X.X.... . . . . ... . ....X.X.X...X.XXXXXX..... ... . . . . . . ", "............................XXoXoXX.XXX.............X.....X.XXX.X.X.X.XXoXXXX......................", " . . . . . . . . ............XXXXX.X.X.......... ..........X.X.X.X.X.XXX.XXX.... ... . . . . . . . ", ". ... ....... ................oXXXXXX.X.X.X.X.X...X.X.X.X.XXX.XXX.X.XXXXXXoXX......................", " . . . . . . . ... ............XXXXX.X.X.X...X...X.X.X.X.X.X.X.X.X.X.XXXXoXX.. ... ... . . . . ... ", "............................X.XXoXXXXXX.X.X.X.X.X.X.X.X.XXXXXXX.X.XXXXXXoXo........................", " . . . . . . . . . . ... ... ....X.XXX.X...X...X...X.X.X.X.X.X.X.X.X.X.XXX.. . . . . . . . . . . . ", ". ... ... ... ... ..............XXX.XXXXX.X.X.X.X.X.X.X.X.X.X.X.XXXXX.oXX........ ... ... .........", " . . . . . . . . . . . . . ... ..XXX.X.XXX.X.X...X.X.X.X.X.X.X.XXX...XXX.... . . . . . . . . . . . ", "........... ....... ..............XXXXXXoXXXX.X.X.X.XXX.X.X.XXXXXXXXXXX.................... .......", " . . . . . . . . . . . . . . . . ..XXXXXXXXX.X.......X.X...X.XXX.XXXXX.. . . . . . . . . . . . . . ", ". ... ... ... ... ... ... ... ....XXXXoXXXoXXXX.X.X.X.X.X.XXXXXXXXoXX........ ... ... ... ... ... .", " . . . . . . . . . . . . . . . . ....XXXXXXXXXXX.X...X...X.X.X.XXoXX.. . . . . . . . . . . . . . . ", "............... .....................XoXoXoXoXXXXXX.X.X.XXX.XXoXoXX................................", " . . . . . . . . . . . . . . . . . . ..XXXXoXoXXXX.X...X.X.XXXXXX... . . . . . . . . . . . . . . . ", ". ... ... ....... ....... ....... ... ..XXoXoXoXoXXXX.XXXXoXoXoXX............ ... ....... ... ... .", " . ... . . . . . . . . . . . . . . . . ..XXXXoXoXoXXXXXXXoXXXXXX.. . . ... . . . . ... . . . . . . ", "..........................................XXoXoooooXoXoXoXoXoXX............ .......................", " . . . . . . . . . . . . . . . . . . . . ..XXXXoXoXXXXXoXoXXX. . ... ... . . . . . . . . . . . . . ", "..... ....... ....... ....... ........... .XoXoXoXoXoXoXoXoXX ............... ... ........... ... .", " . ... . . . . . . . . . . . . . . . . . . .XXXXXoXXXoXoXoXX.. ... . . . . . . . . . . . . . . . . ", "............................................XXoXoXXXoooXoXX........................................", " . . . . . . . . . . . . . . . . . . . . . ..XXXXXXXXoXoXX.. . . . . . . . . . . . . . . . . . . . ", ". ... ... ... ... ... ... ....... ... ... ....XXXXoXoXoXoXX.. ... ........... ... ... ....... ... .", " . . . . . . . . . . . . . . . . . . . . . . ..XXXXXXoXoXX . . . . . . . . . . . . . . . . . . . . "}; /* XPM */ static char * steve [] = { /* width height ncolors cpp [x_hot y_hot] */ "101 151 4 1 -1 -1", /* colors */ " c black", ". c white", "X c #555555555555", "o c #AAAAAAAAAAAA", /* pixels */ " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", " X X X X XXX X X X X X X X X X X X X X X X X XXX X X X X XXX XXX X X XXX X X XXX XXX X X X X XXX XXX", " X XXXXX X XXXXXXXXXXX XXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX", " X X X X X X X X X XXX X X X X XXX X X X X X X XXX XXX XXX XXX X X XXXXX X XXX XXX XXX X X X X X X X", " XXX XXX XXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", " X X X X X X X X XXX X X XXX X X X X X X X X X X X X X X X X XXX X X X X X X X X X X X X X X X X", " X XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X X X X X X X X X XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", " X X X XXX X X X X XXX XXX X X XXX X X XXX X X X X X X X XXX X X XXX XXX XXX XXXXXXX XXX X X X", " XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXX X X X X X X X X X X X XXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX", " X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", " XXXXX X X XXX XXXXXXX XXX XXXXXXX X X X X X X X X X X X X X X X X X XXXXXXXXXXXXXXXXXXXXXXXXXXX ", " X X X X X XXX X X X X XXX XXX X X X X X X X X X X X X X X XXX X XXX X XXX X", " XXX XXXXXXX XXXXXXXXXXX XXX XXX X X X X X X X X X X X X X X X X X X X XXXXXXXXXXXXXXXXXXXXXXXXXXX ", " X X X X X X X X X X X X X X X X X X X X X X X X X X X XXX XXX X X X X X X", " XXXXX X XXXXX XXXXXXXXXXXXXXX X X X X X X X X X X X X X X X X X X X X X XXXXXXXXXXXXXXXXXXXXXXXXXX", " X X X X X X X X X X X XXX X X X X X X X X X X X X X X X XXX X X XXX X", " XXXXXXXXXXXXXXX XXXXXXX XXXXX X X X X X X X X X X X X X X X X X X X X X X X XXXXoXXXXXXXXXXXXXXXXXXX", " X X X X X X X XXX X X X X X X X X X X X X X X X X X X X X XXX X X", " X XXXXXXX X X XXX XXXXXXX X X X X X X X X X X X X X X X X X X X X XXX XXXXXXXXXXXXXXXXXX", " XX X X X X X X X X X XXX X X X X XXX X X XXXXXXX X X X X X X X XXX X X X X X X X", " XXX XXXXXXX XXXXXXX XXXXX X X X X X X X XXXXXXXXXXXXoXoXXXXXoXX X X X X X X XXXXXXXXXXXXXXXXXXXXXXX ", " X X X X X X X X X X X X X XXXXXXXXXXoXXXXXXXXXoXX X X X X X X XXX XXX XXX X X", " X XXX XXX XXXXXXX XXX X X X X X X X X XXoXoXoXoXoooXoXoooXoXoXoXXXX X X X XXX X XXXXXXXXXXXXXXXXXX", " XX X X X X X X X X X X X XXoXoXoXoXoooXoooXoXoooXoXoXoXX X X X X X XXX X X X X X", " XXXXXXXXXXXXXXXXXXXXX X X X X X X XXoXoXoooXoooooooooooooooooooXoXoXXXX X X X X XXXXXXXXXXXXXXXXXX", " X X X X X X X X X X X XXXXXXoXoXoXoooXoooXoooXoooXoXoXXXXXX X X X X X X X X X X X X", " XXXXX XXX XXX XXX X X X X XXXXXXoooXoXoXoooooooooooo.ooooooooooXoXXXXXX X X X X XXXXXXXXXXXXXXXXXX", " X X X X X X X X X X XXXXoXXXoXXXoXoooooooooooooooooooooooXXXXXXXX X X X X X X X X X X X X", " XXX XXXXXXXXXXXXXXX X X X XXXXXXoXoXoXoXoooooooooooooooooooo.ooooXoXoXoXXXX X X X X XXXXXXXXXXXXXXXX", " X X X X X X X X X X XXXXoXoXXXoXoooooooooooooo.ooooooooXoXoXXXXXXXX X X X X X X X X X X", " XXXXX XXXXXXX XXX X X X X XXXXoXoXoooXoooooooooo.o.o.ooooooooooooXoooXoXXXXXX XXX X XXXXXXXXXXXXXXXX", " X X X X X X X X X X X X XXXXXXoXoXoXoo.ooooooooooooooooooooooooXoXoXXXXXX X X X X XXX X X XXX X", " XXXXXXXXXXXXXXX X X XXX XXXXXXoXoXoXoooXoooooooo.ooooooooooooooooooXoXXXoXXXX X X X XXXXXXXXXXXXXXX ", " X X X X X X X X X X X XXXXXXXXXXoXoXoXoXoXoooooooooooooooooXoXoXoXXXXXXXXXX X X X X X X X X XXX", " XXX X XXX XXX XXX X X X XXXXXXoXoXoXoXoooooooooooooooooooooooooooXoXoXoXXXoXXXXXX X XXXXXXXXXXXXXXXX", " X X X X X X X X X X XXX XXXXXXoXXXoXoooXoXoooooooooooooooooXoXoXoXoXXXXXXXX XXX X XXX XXX X X X", " XXXXXXX XXXXXXX X X XXX XXXXXXoXoXoXoooooooooooooooo.ooooooooooooooXoooXoXXXXXXXX X XXX XXXXXXXXXXX ", " X X X X X X X X X X X XXXXXXoXoXoXoXoXoooXoooooooXoooooooXoooXoooXoXXXXXXXX X X X X X X X X X", " X XXX XXX XXX X X X X XXXXXXXXXXXXoXoooooooooooooo.ooo.o.o.ooooooooooXoXXXXXXXX X X X XXXXXXXXXXXXXX", " X X X X X X X X X X XXX XXXXoXoXoooooooooooooooooooooooooXoooXoXoXXXX XXX X X X X X X X X X", " XXXXXXXXXXXXXXX X X X X X XXXXoXoXoXoooooooo.o.o.o.o.o.o.o.oooooooooooXXoXX XXX X X X XXXXX XXXXXXXX", " X X X X X X X X X X X XXXXXXXXXXXXoXoXoooooooooooooooXoXoXoXoXXXXXX X X X X X X X X X X X", " X XXX XXX XXX X X X X X X XXXXXXXXXXXXXXoXoXoo.ooo.o.o.ooXoXoXXXXXoXoXoXXXX X XXX X X XXXXXXXXXXXXXX", " X X X X X X X X X X X X X X X XXXXoooo.ooooooXoXXXX X X XXX XXX X X X X XXX X X XXX X", " XXX XXXXXXX XXX X X X X X XXX X XXXXoXXXXXXXoXoo.o.o.ooooXoXXXXXXXX XXX XXXXX X X X X X XXX XXXXXXX ", " X X X X X X X X X X X X XXXXoXXXX XXXXXooooo.ooooXXXX X X XXX X X XXX X X X X X X X X", " X XXX XXX XXX X X X X X X XXX XXoXoooooooXoXoXoooo.ooooooXoXXXoooooXoXXXX XXX X X X X XXX XXX XXXXXX", " X X X X X X X X X X XXXXoXoXoooXoXoooXoooooooXoooXXXoXoooXoXoXXXX X X X X X X XXX X", " XXXXXXX XXX X X X X X X XXX XXXXoXoXoXoXoXoX.ooXoooooooXoooXoXoXoooXoooXoXXXX X X X X XXXXXXXXXXXX", " X X X X X X X X X XXoXXXX XXXXXXXooXXXoXoXoXoXoXXXXXo XXXoXoXX X X X X X X X X X", " X XXX XXX X X X X X X X XXoXXXX XX oXoooXoooXoXoXoXoooooooXXXX X XXoXoXX X X X XXXXXXX XXXXXX", " X X X X X X X X X XXoXX X XX XXoooooXXXoXoXoXoXoXooo X XXX XXoXX XXX X X X X X X X X", " XXX XXX XXXXXXX X X XXXXoXoXXXXXoXoooXoooXoXoooXoXXXoooooXoXXXoXXXoXoXXXoXX X X XXXXXXX XXXX", " X X X X X X X X X XXoXXXoXoXoXoooooXXXXXoXoXXXXXoXoooooXoXoXXXXXoXXXX X X X X X X X", " X XXX X XXXXX X X XXXXoXoXoXoXoXoooooXoXoXoooXXXoXoXoooooooooooXoXoXoXXXX X X XXXXXXX XXXXXX", " X X X X X X X XXXXXoXoXoXoXoXoooXoXoXXXoXXXXXoXoXoXoXoooooXoXoXoXXXX X X X X X X X X X", " XXX XXX XXX XXX X X X X XXXXoXoXoXoXoooXoooXoXXXoooXXXoXoXoooooooooXoooXoXoXXXX X XXoXXXXXXXXXX XXXX", " X X X X X X X X X X X XXXXXXXXXXXXXXoXoXoXXXoXoXo XXoXoXoXoXoXoXoXoXoXXXX X XXXXXXX X X X X X X", " X X X XXX X X X XXoXX X XXXXXXXXXXoXoXoXoooooXXXoooooXoXoooooXoooXoXoXoXXXoXXXX XoXoXoXX XXX XXXXXX", " X X X X X X X XXoXX X XXXXXXXXoXoXoXoooXoXoXXooooXoXXXoooooXoXoXoXoXoXXXXXX oXoXoXXXX X X X X X", " XXX XXXXXXX XXXXoXoXX XXXXoXoXoooXoXoooooXoXoXoo.ooXoXXXoo.ooooooXoXoXoXoXXXX XooXoo.XoXXXXXXXXXXX", " X X X X X X X oXoXXX X XXXXXXXXXXoXoXooooXXXXoooooXXXoXXXoooooooXoXoXXXXXX X XXoooXoooXX X X X X X", " X XXX XXX XXX XXoXoXo XXXXXXoXoXoooooooooXoXXXooooX XooXoooooooXoooXoXoXoXXXXXoooooooooXXXXXXXXXXX", " X X X X X X X oXoXoXX X X XXXXoXoXoooooooXoXX XoXX X XXoXoooooooooooXXXXXX X XXoooXoooXX X X X X X", " XXX XXX XXX X XXoXoXoXX XXXXoXoXoooooooo.ooXoXo oXoXoXoXoXoooooo.ooooXoXoXoXXXXXoo.ooXoXoXXXXXX XXXX", " X X X X X X XXXXoXo X X XXXXoXXXoXoooXoXXXXXX XXXXXXo XXoXoooooXoXoXoXXXX X oooooooXoXX X X X X X", " X XXX XXX XXX XXoXoooXX XXXXoXoooXoooo.ooXoXXXoXoXoXXXoXoXoXoooooXoooXoXoXXXXXXooooooXoXo XXXXXXX XX", " X X X X X X X XXXXoooXX X XXoXXXoXoooooXXXXXXXXXoXoXXXXXXXoXoXoooXoXoXoXXXX X oooXoooXXXX XXX X X X", " XXX XXX XXX X oXooooo XXXXXXoXoooooooXoXXXoXoXoXoXoooXoXXXoooooooooooXoXXXXXXXoooXoXoXXXX XXXXXXX ", " X X X X X X XXXoXoXX XXXXXXoXXXoXoXoXoXoXXXoXoXoXoXoXXXoXoXoXoXoXoXoXoXX X oXoXoXoXX X X X X X X", " X XXX X X XXX X XXoXoXo XXXXXXoXoXoXoXoXoXoXXXoooooooooXoXoXoXoXoooXoXoooXXXX XXoXoooXXXXXXXX XXX XX", " X X X X X X X XXXXXXX XXXXoXoXoXXXoXXXoXoXoXoooooXoXoXoXXXoXoXoXoXoXoXXXXXX XXXXoXX X X X X X X X", " XXX XXX XXX X X XXoXoXo XXXXoXoXoXoXoXoXoXoXoooo.ooooooooooXoXoXoXoooooXoXoXX XooXoXoXXXXXXXXXX XXXX", " X X X X X X X XXXXXXX X XXXXXXXXXXXXXXXXoXoooXoXoooooXoXoXoXoXXXoXXXoXXXX XoXoXXXX X X X X X X X", " X XXX XXX X X X XXoXoXX XXoXoXoXoXoXoXXXoXoXoooooooooXoXoooXoooXoXoXoXoXXXX Xo.XoXX X X XXX XXX X ", " X X X X X X X XXoXX X XXXXXXXXXXoXXXXXXXXXXXoXXXX XXXXXXoXoXoXXXoXXXXXXXX oXoXX X X X X X X X X", " XXX XXX XXX X X X XXoXoXX XXoXoXoXoXoXoXXXX XXXXXXXXXXXXXXX XXoXoooXoooXoXXXXXXXoXo XXXXXXX XXXXXXX ", " X X X X X X X X XXX XXXXXXXXoXoXXXXXXXXXXXXXXXoXXXXXoXXXXXXXoXoXXXXXXXX XXoXXXX X X X X XXX X X", " X XXX XXXXX X X X XXXXX XXXXXXoXoXoXoXoXoooXoXoXoXoXoXoXoXoXoXoXoooXoXoXoXX XXX X X XXXXXXX XXX XX", " X X X X X X X X XXX XXXXXXXXoXoXoXoXXXoXoXoXXXoXoXXXoXoXoXXXoXoXoXXXXXX X X X X X X X X X X X X", " XXX X X XXX XXX X X XXXXXXXXoXoXoXXXoXoXoXoXoXXXoXoXoooXoXoXoXoXoXoXXXXXX X XXX XXXXXXXXXXXX", " X X X X X X X X X XXXXXXXXXXoXXXXXoXXXXXoXoXXXoXoXXXXXoXoooXXXXXXXX X X X XXX X X X X", " X X X X X XXX X X X XXXXoXXXoXXXoXoXoXoXoXoooXoXoXoXoXoXoXXXoooXoXXXXXX XXXXXXX XXX XXX XX", " X X X X X X X X X XXXXXXoXXXXXXXoXXXoXoXoXXXoXoXoXXXoXXXXXoXXXXXX X X X X X X X X X X X", " XXX X X XXX XXX XXX X X XXXXoXoXXXXXoXoXoXXXoXXXoXoXoXoXoXoXoXoXoXoXoXX X X XXX XXX XXX XXXXXXXX", " X X X X X X X X X X X X XXXXXXXXXXXXoXXXXXXXoXXXXXXXXXXXXXXXXXXXX X X X X X X X X X X X X X X", " X X X X X X X XXX X X X X XXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXXXXXX X X XXX X XXXXXXXXX XXXXXX", " X X X X X X X X X X X X X XXXXXXXXXXXXXXoXoXoXoXoXoXXXXXXXXXXXXXXXX X X X X X X X X X X X X X", " XXX X X XXX X X XXX X X X X XXXXXXXXXXXXoXoXoXoooooooooXoXoXXXXXXXXXXXX X XXX XXX XXXXXXXXXXXXXXXX", " X X X X X X X X X X X X X X X XXXXXXXXoXoXoXoXoooXXXXXXXX XXXXX X X X X X X X X X X X X X X", " X X X X X X X XXX X X X X X X XXX XXXXoXoXoXoooooooXoXoXXXXXXXXXX X X X XXXXX X X XXX XXX X X XX", " X X X X X X X X X X X X X X X X XXXXXXoXoXoXoooXoXoXXXX X XXX X X X X X X X X X X X X X X X X", " X X X X XXX XXX X X X X X XXX X X X XXXXXXoXoXoXoXoXoXoXXXXXX XXX XXX XXXXoXXXXXX XXX XXX XXX XXXX", " X X X X X X X X X X X X X X X X XXXXXXXXXXXXXXXXoXX X X X X X X X XXXXX X X X X X X X X X X", " X X X X X X X X X X X X X X X XXX X X X X XXXXoXXXoXXXoXXXXXX X X X X XXXXXXoXooX XXXXX X XXX XXXXXX", " X X X X X X X X X X X X X X X X X X X X X X XXXXXXX X X X X X X X X XXX XXoXoXX X X X X X X X X X", " XXXXX X XXX XXX XXX X X XXX XXX XXX X X X X X X XXX XXXXXXX X X XXX XXXXXXXXoXXXoXX XXX XXX XXX XXX ", " X X X X X X X X X X X X XXX X X X X X X X X X X X X X XXX X XXoXoXX X X X X X X X X X", " X X X X X X X XXX X X XXXXoXX XXX X X X X X X X X XXX X X X X XXX XXXXXXXXXXoooooXX X XXX XXX XXX XX", " XX X X X X X X X X X X XXoXX X XXX X X X X X X X X X X X X X X X XXXXXXX XXoXooo X X X X X X X X X", " X X XXXXX X XXX X X XXXXoXoXX XXXXX X XXXXXXXXX X XXXXXXXXXXXXX XXXXXXoXXXXXoooooXX XXX XXX XXXXXXX ", " X X X X X X X X X X X XXoXX X XXX X X XXXXXXXXX XXX XXXXX X X XXX XXXXX XXoooXoXX X X X X X X X X", " XXXXX XXX X X X X X X XXXXoXX XXXXXXX X XXXXXXXXoXoXXXXXXXoXXXXXXXoXXXXXXXXXoooooXo X XXX XXX X X XX", " X X X X X X X X X X X XXoXX X XXXXX X XXXXXXXXXXoXoXXXXXXXXXX XXXXXXXXXXXXoooXoooXX X X X X X X X X", " XXX X X XXX X X XXX XXXXXXoXX XXoXXXXXXXXXXXoXoXoooXoXoXoXXXoXXXXXXXoXXXoooooooooooXXXX X XXXXXXXXX ", " X X X X X X X X X XXX XXoXX XXXXX XXX XXX XXoXXXoXoXoXXXX XXXXXXXXXXXXoooXoXoXoooXX X X X X X X", " X X X X X X X X X XXXXXXXXXXoXXXXXXXXXXXXXXXXXoXoXoXoXoXXXXXXXoXXXoXXXoooo.ooooooooooXoXXXXXX XXX X ", " X X X X X X X X X XXXXX XXXXo XXXXXXXXXXX XXXXoXoXoXXXXXXXXXXXXXXXXXoXoooXoooXoXoXoXoXoXXXXXXXX X X", " XXX XXX XXXXXXXXXXXXoXXXXXXXoooXXXXXoXoXXXXXoXXXoooXoXoXoXXXXXXXoXoXoooooooooooooooooooXoooooooXoXXX", " X X X X XXXXX XXX XXX X XXX oooXXXoXXXX XXX XXXXoXoXXXXXXXXXXXXXXXoXoXoooooXoXoooooXoXoXoXoXoXoXoXo", " X X XXXXXXXXXXXXXXoXXXXXXXXXXXoXoXXXoXoXXXXXXXXXoXoXoXoXXXXXXXoXoXoooXoooooooooooooooooXoooooooooooo", " XXXXXXXXXXXXXX XXXXoXX XXX XXoXXXoXXXXXXXXXXXXXXXoXXXXXXXXXXXXXXXoXoXoXoooXoXoooXoooXoooooooooXoooXo", " XXXXoXXXoXoXoXoXoXoXoXXXoXX oXXXoXoXoXoXoXXXoXXXXXoXoXoXXXXXoXXXooooooooooooooooooooooooooooooooooXo", " XXXXXXXXXXX XXXXXXXXX XXXXXXXXXXoXXXXXoXXXXXXXXXXXXXXXXXXXXXXXoooXoXoXoXoXoooooXoXoXoooXoXoooooooXo", " XXoXXXXXoXoXXXoXoXoXoXXXXXXXXXX oXoooXoXoXoXoXoXXXXXoXoXoXoXXXoooooooXoXoXoooooooooooooooXoXoXoooXoo", " XX XXXXXXXXXXXXXXoXXXoXXXX XXoXXXX oooXoXXXXXXXXXXXXXXXXXXXXXoooXoXoooXoXoXoooXoXoXoXoXoXoXoooooooXo", " XXXXXXXXoXXXoXoXoXoXooXXXXXXXooXoXXXoooXoXoXoXoXXXoXoXoXoXXXoooooooooooooooooooooooooooooooooooooooo", " XXXXXXXXXXXXXXXoXoXXXXXXXXXX XXXXo XXoooXXXXXXXXXXXXXXXXXXXoXoXoXXXoXoooXoooXoXoXoXoXoooXoooXoXoXoXo", " oXoXoXoXoXoXXXoXoXoooXoXXXXXXXoXXXX oXoooXoXXXoXoXoXXXoXoXoooooXoXoooXoooooooooooooooooooooooooooooo", " XoXoXoXXXXXXXoXXXoXoXoXoXX XXXXXXX XXXXoXXXXXXXXXXXXXoXXXoXoXXXoXoXoXoXoooXoXoXoXoooooXoooXoXoXoXoXo", " oooXoXoXoXoXoXXXoXoXoooooXXXXXoXXXXXoXoooXoXoXoXoXoXoXoooXoXoooooooooooXoooooooooooooooooooooooooooo", " XoXoXXXoXXXXXoXXXoXoXoXXXo XXXXX XXXXXXoXXXXXXXXXXXXXXXoXoXoXoooXoXoXoXoXoXoXoXoXoooXoooXoXoXoooXoXo", " oXoooXoXoXoXXXXXoXoooXoXoXoXXXXXXXXXoXoooXoXoXoXXXXXXooooXoooooooooooXoXoXoooooooooooXoXoXXooooooooo", " XoXoXoXoXXXXXoXXXoXoXoXoXoXXXXXXXXXXXoXoXXXoXoXXXXXXXoXooXXoooooXoXoXoXXXoXoooXoooooXoXoXoXoXoXooooo", " oooXoooooXoXoXoXoXoooooooXoXXXoXoXXXoXoXoXXXoXoXoXXXoooooooXoooXoooooXoXoooooooooooooooooooooo.ooooo", " XXXoXoXoXoXoXoXoXoXoXoXoXoXo XXXXoXX XXoXXXoXXXoXXXoXoooXoXoXoXoXoooooooXoooooooooXoooooXoXoXooooooo", " oXoXoXoooXoXoXoooXoooXoooooooXoXoXooXXXXoXoXoXoXXXoooXoooXoooooooooooooooooooXoooooooooooooooooooooo", " XoXoXXXoXoXoXoXoXoooXoXoXoXoXo XXoXoXo XXXXXXoXXXXXoooXoooXoooXoooXoXoXoooXoXoXoooooooooooooooooXooo", " oooXoooXoooXoooooooXoooooooooXXXoooooXoXoXoXoXoXoXoooooooooooo.ooooooXoooooooooooo.ooooo.ooooooo.ooX", " XoXoXoXoXoXoXoXoXoooXoXoXoXoXoXoXoXoXoXX XXoXoXXXXXoXoXoXoXoXoooooooXoooXoXoXoooooooXoXoXoooXoooXooo", " oXoXoXoooooXoXoXoXoXoooXoooooXoXoooXoXooX oooXoXoXoooooXoXoXoo.ooooooXoooXoooooooooooooooooooooooooo", " XXXXXoXXXoXoXoXoooXoXoooooXoooXoXoXoooXoXX XXoXoXoXoXoXoXoooooXoooXoooXoXoooooooooXoooXoooXoooXoooXo", " oooooooooooXoooXoooXoooXoooooooooXoXoooooXoXXXoXoooXoooooooooooooooXoooooooooo.ooooooooooooooooooooo", " XXXoXoXoXXXoXoXoXoXXXoXoXoXoXoXoXoXoXoooXXoo XXoXoooXoXoooooooooXoooXoooXoooXoooooooooooXoooXoXoXoXo", " XXoXoXoooXoXoXoXoXoooXoooooooooooooooXoooXoooXXXoXoooooooXoooooooXoooooooo.ooooooooooooooooooooooooo", " XoXXXoXXXoXXXoXoXXXXXoXoXoXoXoXoooXoooXoooooXoXXXoXoXoXoXoXoXoXoXoooooXoooooooooooXoooooooXoXoXoooXo", " oXXXoXoXoXoXoooXoXoXoooXoooooooooooooooXoooXoooXoXoooooXoooooooooooooooooooooooooooooooooooooooooooo", " XXXoXXXoXXXXXXXXXXXoXXooXoXoXoXoXoXoXoooXoooXoooXXXoXoooooooXoXoXoXoXoooXoooXoooXoooXoXoXoXoXoXoXoXo", " oXoXoXoXoXoXXXoXoXoXoXoooXoooooooXoooX.ooooooXooXXoooooooooooooooXoooooooooooooooooooooooXoooooooXoo", " XXXXXXXoXXXXXoXXXoXoXoXoXoXoXoXoXoXoooooooXoXoXoXoooooooooXoooXoooXoooooooXoXoXoXoXoooXoXoXoXoXoooXo", " oXoXoXoXoXXXoXoXoooXoXoXoooXoooooooooooXoooooooooooo.ooooooooooooooooooooooooooooooooooooXoooooooXoX", " XXXoXXXXXoXoXoXoXXooXoXoXoXoXoXoXoooXXXoXXXoXoXoXoooooooooooXoooooXoXoooooXoXoooXoXoXoXoXoooXoooXoXo", " oXoXoXoXXXoXXXXXoXoXoXoooooooooooooXoXoXoooXXooXoooooooooooooooooXoooooooXoooooooooooooooooooXoXoXoX", " XoXXXXXXXXXoXoXXXoXoXoXXXoXoXoXoXoXXooXXXoXXXoXXXoooooXoXoooooooXoXoooXoooooooXoooXoXoXoXoXoXoooXooo", " oooXoXoXoXoXoXoooXoXoXoooooooooXoooXoXoXoXoXoooXoooooooooooooooooooooooooooooooooooooooooooooXoXoooo", " XoXoXXXXXXXXXoXoXoXoXXXXXoXoXoXoXoXoXXXXXXXoXoXoXXXoXoXoXoXoXoooXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXo", " oXoXoXoXoXoXoXXXXXoXoXoXoXoooXoooooooXoXoXoooooXoXoooooooooXoooXoXoooooooooooXoooooooooooXoooXoooXoo", " XoXoXoXXXXXXXoXoXoXoXoXXooXoXoXoXoXoXoXXXoooXoXoXoooooXoXoXoooXoooXoXoXoooXoooXoXoXoXoXoXoXoXoooooXo", " oXoXoXoXoXoXoXoXoXoooooXoXoXoooooooXoXoXoooooooXoooooXoooooXoXoXoooooooooooooooooooXoooooooXooo oooX", " XXXoXoXXXXXXXXXoXXXoXoXXXoXoXXXoXoXoXoXoXoXoXoXoXXXoXoXoXoooXoXoXoXoXoXoXoXoXoXoXoooXoXoXoXoXXX oXo", " oXoXXXXXXXoXoXoXoXoooXoXoXoooXoooXoXoXoooooooXoXoXoXoXooXooXoXoooXoooXoooooooooooXoXoooooXoooX.Xo oo"}; /* XPM */ static char * vania [] = { /* width height ncolors cpp [x_hot y_hot] */ "102 138 4 1 -1 -1", /* colors */ " c #555555555555", ". c black", "X c #AAAAAAAAAAAA", "o c white", /* pixels */ " . . . . . . . . . . . . . X X X X X X X ", " X X X X X . . . X X X X X X X X X X X X X X X X X X X X X X X X", " . . . . . X X X X X X X X X ", " X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X", ".. . . . . X X X X X X X ", ". . . . . . . X X X X X X X X X X . X X X X X X X X X X X X X X X X X", " . . . . . . . . . . . . X X X X X X X X X X X X X . . . ", ". . . . . . . . X XXX X X X X X X X . X X X X X X X X X X X X X X X X X X X X", ".. ... . . ... . X X X X X X X X X . . . . . . . X X X X X X X X X X X X X X X X X X ", ". . . . . . . . X X X X X X X X X . X X X X X X X X X X X X X X X X X X X X X X XXX X X X X X", "............ ... X X X X X X X X . .X X X X X X X X X X X X X X X X X X X X X X X ", ". . . . . . . . X X X X X X X X X X X X X XXX X X X . . X X X X X XXX X XXXXXXX. . X X", "................ X X X X X X X X X . . . . . . . . . . . X X . ", ". . . . . . . . X X X X X X X X X X X X X X X X X X X . . . . . . . . . . . . X X X", ".... ........... X X X X X X X X X ... ... . . . . . . . . . . . . . . . . . ", ". . . . . . . . X X X X X X X X X X X X X X X X X X X X . . . . . . . . . . . . . . . . .X X", "................ X . . ......................... ... ... . . . . ", ". . . . . . . . X X X X X X X X X X X X X X X . . ... ..... . . . . . . . . . . . . . . . . . X", " ... ... ... ... X X X X X X X . ................... ... ... ... ... ... ... ... . ", " . . . . . . . X X X X X X X X X X X X X X . ... ... ....... ... . . . . . . . . . . . . . X X X", " . ... X X X ........................................... . ", " X X X X . X X X X X X X X X X X X X . ............... ....... . . . . . . . X X X X X X", " X X X X X X ................................. . . ", " X X X X X X . X X X X X X X X X X X X . ....... ....... ....... ... ... . . X X X X X X X X X X", " .. X X X X ....................................... ... ", " X X X X X . X X X X X X X X X . ......................... ....... ... . . X X X X X X X X X", " .. X X X X X X X ................................................. ", " X X X X X X . XX X X X X X X X . ... ....... ....... ........... ... ... ... . . X X X X X X X X", " ...X X X X ..................................................... ", " X X X . X X X X X X X ..................... ....................... ....... . X X X X X X", " .. X X ........................................................... ", " X X X . X X X X . . ................... ... ... ....... ... ... ... . . . . X X X X X X", " ...X X . ............................................................... ", " X X X . X X X . ........................... . . ... ................... . . . . X X X X X", " ...X ............................. . . ... ....................... ...... X ", " X X X X . X X . ............... ....... ... . . . . . . . ... ... ... . . . . ... X X X X X", " .. ............................... . . . . ............................. ", " X X X X . ....................... . . . X X X . ... ....... ... ... ..... X X X X X", " .. ............................. . X X X X X . ............. . ........... ", " X X X . ............... ....... . . . XXXXXXXXXXX . . . ... . . . . ....... X X X X X", " . ............................... X X XXX XXX. ........... ............. X ", " X X X ... ............... ....... ... . X X XXXXXXXXXX X . ... . . . . .......... X X X X X", " . ............................. .. X X X X X XXX X X X ..... . . ............. X ", " X X X . ....... ....... . . ... . . . .XXX XXXXXXXXXXX XXXXX . . . ....... ... X X X X X", " . . ........................... . . X X XXX X X X X X X ..... . . ............. ", " X X . ....... ....... . . ... ... . . X XXXXXXXXXXXXX X XXX. . . X ............ X X X X X", " . . ................. . ........... .X X XXX XXX XXX X X ... X ........... X ", " X . ... ... ....... . . . . . . . XXXXXXXXXXXXXXX XXX . XXX . . . ... X X X X X", " ..................... . . ....... X X X X X XXX X X X X . . X X . . . ...... ", " X . ....... ... ... ... . . . . . . XXX XXXXXXXXXXX XXXXX X XXXXX . ...X X X X X", " . ....................... . . ... . X X X X XXXXX X XXXXX X XXX X ..... X ", " X ....... ... . . . . . . . . . . . X X XXXXXXXXXXXXX XXoXXXXXX X XXXXXXX X X X ... . X X X X", " ....................... ......... X X X X XXX XXX X X XXX X X ...... ", " ....... ....... . . . . . . ... . X X X X X . . . . XXXXXXXXXXXXXXX X X X .....X X X X", " ....................... ........... X . . ... ... XXXXXXX XXX X . . . ... X ", " . ... ... . . . . . . . . ... . . X X X X X . . . . . XXXXXXXXXXX . . . ... X X X X X", " . ................................. X . . XX. . . . . . . XXXXXXX X . . ......... ", " . ... ....... ....... ... ... ... . . .XX . XXXXXXX X . . . ... . X X X X X", " . ................................... . . . . . . . . . . XXX X . . . ....... X X ", " . . ....... . . ... ... ... ... ... X X . . . . . XXo . . ... X X X X X", " . ................................. X . ..... . . . . XX ... . . . . ... . ", " X . ....... ... ... ....... ....... X X X X X XXX . . . . XX . . . . . ... . X X X X", " . ................................. X X X X . . . . . XXX . ......... . . X ", " . . ... ... ... ... ... ... ... . X X X X XXX X XXX . . . ... ... . X X X X", " . ................................. X X X X X .. X X . . . . . ..... . . ", " . ... ....... ... ... ... ... ... X X XXXXX X X X X X X X X . X X . . . . . . . . ", "X X . ............................... X XXX X X X X X X X X . .............", " X X . ... ... ... . . . . . . ... . X X X XXXXX X X X XXXXXXX X X X X . X X X X ... ... . . ..", " X ............. . . ........... X X X X X X X X X X X X . . .............", " X ....... ...... X X ... ... X X XXXXXXX X XXXXX XXX X X X X X X X X . ... . . . . ", " ................... X X X X. ..... X XXX XXX X X X X X X X X X . X X X .............", " . ... ... ... XXXXXXXXX . . X XXXXXXXXoXXXX X X X XXX XXX XXX X XXXXXXX . ....... ..", " X .............. X XXX X . . X X X XXXXXXXXX X X X X X X X XXX X X X .............", " X X . ....... ... XXXXX X . X X XXXXXXXXoXXXXXX XXX X X XXXXXXX X X X X X . ... ........", "X X ............. X XXX . X X X X XXXXXXX X X X X X X X X X X X .............", " X X X . ... ... ... X XXX X X X X XXXXXXoXoXXXXXX X X X X XXXXX XXXXXXX X. . ... . . . ", " X ............... X . . . X X X X X XXX X X X X X X X X X X X X X ..............", " X X X ... ....... .. X X . X X X XXX XXXXXXX XXX X X X XXXXXXX X XXXXX . ... ... ... ", "X ............... X . X X X X XXX X X XXX X XXX X X X XXX X .............", " X X X . ... ... ... . XXX X X XXXXXXXXXXX XXXXXXX X X X X XXXXX X X XXX ... ... ... ..", " . ............... . . X X X XXX X X X X X X X X X X X X ...............", " X X X X ....... ....... . X X X X X XXXXXXX X X XXX X X X X X X X XXX . ... ... . . ", "X X ................. X . X X XXX X X X X X X X X X X . X ...............", " X X X X ... ... ... ... X X X XXXXXXXXXXX X X X X XXXXXXX X X X XXX . . . . . . ..", " X ................... . . X X X X X X X X X X X X X . . X X ...............", " X X X X X . ....... ....... . X X X XXXXXXX X X XXXXXXX XXX X X X X XXX X . ... ... . . ", " ................... . . X XXX X X X X XXXXXXXXXXX X X XXX X X ...............", " X X X ... ... ....... . . . X X X X XXXXXXXXXXXXXXX XXXXXXoXoXXXXXX X XXXXXXX . . . . . . . ..", " ................... . . X X X X X X X X . X XXXXXXXXX X. X XXX .................", " X X X . ... ........... . X X X X XXXXXXX XXXXX XXXXXXoXXXX XXXXXXX . . ... ... . . ", " ............... . . . X X X X XXX X X XXX X XXXXX X . X XXX X .................", " X X X X . ... ... ... . X X X X XXXXXXXXXXXXXXXXX X XXX X X X X XXXXX . . . . ... . . . ", " X . ............... . . . X X X X X X X X XXX X X X . X X ...................", " X X X X . ........... . . X X X X XXXXXXXXXXXXXXXXXXX X X X XXX .. ... ... ... . . ", "X X . ........... . . . X X X X X XXX X X XXX XXXXXXX X X X ...................", " X X X X ... ... ... X X X X XXXXX XXXXXXXXXXXXoXX X X X X XXX . . ... ... . . . ", " X ............. X . . X X X X X X XXX XXX XXXXX X X ...................", " X X X X X ..... ..... X X X X X X XXXXXXXXXXXXXXXXXXX X X X X X X .. ... ... ... . . ", "X X X X ........... X X X X X X X X X XXXXXXX X X X X X ...................", " X X X X ... ... . X XXoXX X X X XXX XXX XXXXXXXXXXXXXXXXXXX X X X X X X X X . . . . ... . . . ", " X .......... X XXXX X X X X X X X X X X X X XXX X X X X ...................", " X X X . ..... . X X XXoXXXX XXX X X X X XXX XXXXXXXXXXXXX X X X X X X X .. ... ... ... ... ", "X X ..... . . .X X X XoXXXX X X X X X X X X X X X X X X X X X X X ...................", " X X . . X XXX XXX XXoXoXXXXXXXXXX X X X X XXXXXXXXXXX X X X X X X X X . . ... . . ... ..", " . X . X XXX XoXXXX X X X X X X X XXX X X X X X ...................", " X X X X . X XXXXX XXX XXoXoXXXXXX XXX X X X X XXXXXXX X X X X X X X X .. ... ... ..... . ", " X. . XXX X XXX XXoXoXX X X X X X X X X X X X X X X X X X ...................", " X X X X X X X X XXoXX XXX XXoXoooXXXXXXXX X X X X X X X X X X X X X X X . . . . . . ... ..", " X X X XXX X XXX XoXoXX X X X X X X . X X X ...................", " X X X X XXX XXX XXX X X XXoXoXX XXXXXXoXoooXX X X X X X X X X X X X X X X X . ... ... ... ... ", "X XXXXXXXX X X XX X XoXoXX XXXXX XXoXoXX X X X X X X X X X X X ...................", " X XXoXoXoXXXXXX XXX XXX XXoXoXX XXoXXXXXoooXX X X X X X X X X X X X X X X X . . ... . . . . . ", " XXXXXXXXoXXXX XXX X X XXoXoXX XXX X XXoXoXX X X . X X X X ...................", " XXXXoXoXoXoXoXoXoXX X XXX XXoXoXX XXoXXXXXoooXX X X X X X X X X X X X . . . ... ... . . ", "XXXXXXXXoXoXoXoXoXXXXXX X XXX XXoXoXX XXoXX XXoXoXX . . X X X X X X ...................", "XoXoXoXoXoXoooXoooXoXoXoXXXoXX XXoXoXXXXXoXXXXXoooXoXX X X X X X X XXX X X X X . . . . . . ... . ", "XXXXXXoXXXoXoXoXoXoXoXoXoXXXXXX XXoXoXX XXXXX XXXXoXXXX X X . X X X X X ...................", "XoXoXoXoXoXoXoXoXoXoXoooXoXoXoXXXXXoXoXoXXXoXoXXXoXoXoXX XXX X X X X X X X X X X . ... ... ... ... ", "XXXXXXXXoXoXoXoXoXoXoXoXoXoXoXoXoXXXoXoXoXXXXXXXX XXoXoXX XXX X X X X X X X ...................", "XXXoXoXoXoXoXoXoXoXoooXoooooooooooXoXoooooXXXXXoXX XXoXoXXXXXX XXX X X X X X X X X . . ... ... . . ..", "XXXXXXXXXXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXX XXXXX XXoXoXX XXX X X X X ...................", "XoXXXoXoXoXoXoXoXoXoXoXoXoooooooooooooooooooXXXXXoXXXXXoXoXoXXXX X XX X X X X X X . . . ... ... ... ", "XXXXoXXXoXoXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXX XXoXoXX XXX X X X X ...................", "XXXoXoXoXoXoXoXoXoXoooXoooXoooXoooooooooooooooXoooXoXoXXXoXoXXXoXX XXXXX X . X X . . . . ... ... . ", "XXXXXXXXXXXXXXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXXXXXXXXXX X ...................", "XoXXXoXXXoXoXoXoXoXoXoXoXoooooooXoooXoooXoooXoooXoooooooXoXoXoXoXoXXXXXXXX X X X . ... ... ... . . ", "XXXXXXXXXXXXoXXXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXX X X ...................", "XXXoXXXoXoXoXoXoXoXoXoXoXoXoooooooooooooooooooooooooooooooXoooXoXoXoXXXXXX X X X X . . . . . . . . ..", "XXXXXXXXXXXXXXXXXXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXXXXXX X ...................", "XoXoXoXoXoXoXoXoXoXoXoXoXoXoXoooXoooooooooooXoooooooooooXoooXoooXoXXXoXXXXXX X X X . ... ... ... ... ", "oXXXoXXXoXoXoXXXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXX X X X ...................", "XoXoXoXoXoXoXoXoooXoXoXoooXoooXoooooooXoooooooooooooooXoooooooXoXoXoXoXoXXXXXX X X . . . . ... . . ..", "oXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXXXXXX X X ...................", "XoXoXoXoXoXoXoXoXoXoXoooXoooXoooXoooXoooXoooXoooXoooXoooXoooXoXoXoXoXoXoXoXXXXXX X . ... ... ... . . ", "oXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXoXXXX XXX ...................", "XoXoXoXoXoXoooXoooXoooooooXoooooooXoooooooXoooXoooXoooXoooXoooXoXoXoXoXoXoXoXXXXXX . . ... ... . . ..", "oXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXoXXXXXXXX XXX...................", "XoXoXoXoXoXoXoXoXoXoXoooooooXoooooooXoooXoooXoooXoooXoooXoooXoXoXoXoXoXoXoXXXXXXXXX . ... ... ... ... "}; motif-2.3.8/demos/programs/Outline/0000755000175000017500000000000013211513007014214 500000000000000motif-2.3.8/demos/programs/Outline/Makefile.in0000644000175000017500000005476413211512766016234 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = outline$(EXEEXT) subdir = demos/programs/Outline ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_outline_OBJECTS = outline.$(OBJEXT) outline_OBJECTS = $(am_outline_OBJECTS) outline_LDADD = $(LDADD) outline_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(outline_SOURCES) DIST_SOURCES = $(outline_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Outline build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Outline datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = outline_SOURCES = outline.c data_DATA = $(outline_SOURCES) $(EXTRA_DIST) LDADD = $(TOPDIR)/lib/Xm/libXm.la TOPDIR = ../../.. INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Outline/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Outline/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list outline$(EXEEXT): $(outline_OBJECTS) $(outline_DEPENDENCIES) $(EXTRA_outline_DEPENDENCIES) @rm -f outline$(EXEEXT) $(AM_V_CCLD)$(LINK) $(outline_OBJECTS) $(outline_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outline.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Outline/outline.c0000644000175000017500000005046012672140200015765 00000000000000/* * Copyright 1994, Integrated Computer Solutions, Inc. * * All Rights Reserved. * * Author: Rick Umali * * outline.c * * Almost a direct copy of the tree.c demo code * */ /************************************************************** * INCLUDE FILES **************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /************************************************************** * STATIC FUNCTION DECLARATIONS **************************************************************/ static Widget CreateNode(Widget, Widget, char *, XmHierarchyNodeState); static void BuildHierarchy(Widget, WidgetClass); static void WriteUpHype(Widget); static void MakeControlPanel(Widget); static void ShowCB(Widget, XtPointer, XtPointer); static void ExplainCB(Widget, XtPointer, XtPointer); static void CallbackTogCB(Widget, XtPointer, XtPointer); static void QuitCB(Widget, XtPointer, XtPointer); void InitializePanel(Widget); /************************************************************** * GLOBALS **************************************************************/ static Widget G_outline = NULL; static int done = 0; /************************************************************** * SHOW CODE **************************************************************/ #define CODE "void\n\ BuildHierarchy(Widget parent)\n\ {\n\ Widget outline, hierarchy, w1, w2, w3;\n\ \n\ outline = XtCreateManagedWidget(\"outline_widget\", xmOutlineWidgetClass,\n\ parent, NULL, (Cardinal) 0);\n\ \n\ w1 = CreateNode(outline, NULL, \"Widgets\", XmOpen);\n\ \n\ w2 = CreateNode(outline, w1, \"Writing Widgets\", XmOpen);\n\ {\n\ (void) CreateNode(outline, w2, \"Widget Data Structures\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w2, \"Structure Naming Conventions\", XmAlwaysOpen);\n\ w3 = CreateNode(outline, w2, \"Writing Header Files\", XmOpen);\n\ }\n\ \n\ (void) CreateNode(outline, w3, \"Writing Private Header Files\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w3, \"Writing Public Header Files\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w3, \"Internal Header Files\", XmAlwaysOpen);\n\ \n\ w3 = CreateNode(outline, w2, \"The Base Widget Classes\", XmOpen);\n\ (void) CreateNode(outline, w3, \"The Core Class Structure\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w3, \"The Core Instance Structure\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w3, \"The Composite Class Structure\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w3, \"The Composite Instance Structure\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w3, \"The Constraint Class Structure\", XmAlwaysOpen);\n\ (void) CreateNode(outline, w3, \"The Constraint Instance Structure\", XmAlwaysOpen);\n\ }\n\ \n\ Widget\n\ CreateNode(Widget w_parent, Widget parent_node, char * name, \n\ XmHierarchyNodeState state)\n\ {\n\ Arg args[10];\n\ Cardinal num_args;\n\ Widget w;\n\ XmString xmstring;\n\ \n\ xmstring = XmStringCreateSimple(name);\n\ \n\ num_args = 0;\n\ XtSetArg(args[num_args], XmNlabelString, xmstring); num_args++;\n\ XtSetArg(args[num_args], XmNnodeState, state); num_args++;\n\ XtSetArg(args[num_args], XmNparentNode, parent_node); num_args++;\n\ \n\ w = XtCreateManagedWidget(name, xmPushButtonWidgetClass,\n\ w_parent, args, num_args);\n\ \n\ XmStringFree(xmstring);\n\ return(w);\n\ }" /************************************************************** * RESOURCE FALLBACKS **************************************************************/ static String fallbacks[] = { "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*hypelabel*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*show_code*fontList: -*-courier-*-r-normal-*-*-*-*-*-*-*-*-*", "*show_pb.labelString: Show Layout Code...", "*explain_pb.labelString: Other Resources...", "*rc_1*XmSeparator*orientation: XmVERTICAL", "*ladder_tog.labelString: Connect Style:", "*callback_tog.labelString: Node State Callback:", "*autoclose_tog.labelString: Auto Close", "*connect_tog.labelString: Connect Nodes", "*quit_pb.labelString: Quit", NULL, }; /* * Function Name: InitializePanel * Description: Checks the resources at start up and sets their * labels and toggles appropriately * Arguments: pane - area containing the buttons and toggles * Returns: Nothing * */ void InitializePanel(Widget pane) { Arg args[10]; Cardinal argcnt; Boolean auto_close; Boolean connect; XmString xmstring; XtCallbackStatus status; Widget lab_temp, tog_temp; argcnt = 0; XtSetArg(args[argcnt], XmNautoClose, &auto_close); argcnt++; XtSetArg(args[argcnt], XmNconnectNodes, &connect); argcnt++; XtGetValues(G_outline, args, argcnt); /* * Initialize Node State Callback Toggle and Label */ lab_temp = XtNameToWidget(pane, "*callback_lab"); if (lab_temp == NULL) { fprintf(stderr, "InitializePane: cannot find callback_lab\n"); exit(1); } tog_temp = XtNameToWidget(pane, "*callback_tog"); if (tog_temp == NULL) { fprintf(stderr, "InitializePane: cannot find callback_tog\n"); exit(1); } status = XtHasCallbacks(G_outline, XmNnodeStateCallback); switch(status) { case XtCallbackHasSome: XmToggleButtonSetState(tog_temp, True, False); xmstring = XmStringCreateSimple("Added"); break; case XtCallbackNoList: case XtCallbackHasNone: default: XmToggleButtonSetState(tog_temp, False, False); xmstring = XmStringCreateSimple("Not Added"); break; } argcnt = 0; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; XtSetValues(lab_temp, args, argcnt); XmStringFree(xmstring); /* * Initialize Auto Close Toggle */ tog_temp = XtNameToWidget(pane, "*autoclose_tog"); if (tog_temp == NULL) { fprintf(stderr, "InitializePane: cannot find autoclose_tog\n"); exit(1); } XmToggleButtonSetState(tog_temp, auto_close, False); tog_temp = XtNameToWidget(pane, "*connect_tog"); if (tog_temp == NULL) { fprintf(stderr, "InitializePane: cannot find connecct_tog\n"); exit(1); } XmToggleButtonSetState(tog_temp, connect, False); } /* * Function Name: main * Description: * Arguments: the usual suspects * Returns: nothing * */ int main(int argc, char **argv) { Widget top, pane; Arg args[10]; Cardinal num_args; XtAppContext app_con; num_args = 0; XtSetArg(args[num_args], XmNtitle, "Outline Demo"); num_args++; XtSetArg(args[num_args], XmNallowShellResize, True); num_args++; top = XtAppInitialize(&app_con, "Treedemo", NULL, 0, &argc, argv, fallbacks, args, num_args); { Widget sw; num_args = 0; pane = XtCreateManagedWidget("pane", xmPanedWindowWidgetClass, top, args, num_args); WriteUpHype(pane); num_args = 0; XtSetArg(args[num_args], XmNscrollingPolicy, XmAUTOMATIC); num_args++; XtSetArg(args[num_args], XmNheight, 500); num_args++; sw = XtCreateManagedWidget("pane", xmScrolledWindowWidgetClass, pane, args, num_args); BuildHierarchy(sw, xmOutlineWidgetClass); MakeControlPanel(pane); InitializePanel(pane); } XtRealizeWidget(top); /* Process events, unwrapping correctly. */ while (!done) { XEvent event; XtAppNextEvent(app_con, &event); XtDispatchEvent(&event); } XtDestroyWidget(top); XtDestroyApplicationContext(app_con); exit(0); } /************************************************************** * STATIC FUNCTIONS **************************************************************/ /* * Function Name: BuildHierarchy * Description: * Arguments: * Returns: Nothing * */ static void BuildHierarchy(Widget parent, WidgetClass class) { Widget outline, hierarchy, w1, w2, w3; G_outline = outline = XtCreateManagedWidget("outline_widget", class, parent, NULL, (Cardinal) 0); w1 = CreateNode(outline, NULL, "Widgets", XmOpen); w2 = CreateNode(outline, w1, "Writing Widgets", XmOpen); { (void) CreateNode(outline, w2, "Widget Data Structures", XmAlwaysOpen); (void) CreateNode(outline, w2, "Structure Naming Conventions", XmAlwaysOpen); w3 = CreateNode(outline, w2, "Writing Header Files", XmOpen); } (void) CreateNode(outline, w3, "Writing Private Header Files", XmAlwaysOpen); (void) CreateNode(outline, w3, "Writing Public Header Files", XmAlwaysOpen); (void) CreateNode(outline, w3, "Internal Header Files", XmAlwaysOpen); w3 = CreateNode(outline, w2, "The Base Widget Classes", XmOpen); (void) CreateNode(outline, w3, "The Core Class Structure", XmAlwaysOpen); (void) CreateNode(outline, w3, "The Core Instance Structure", XmAlwaysOpen); (void) CreateNode(outline, w3, "The Composite Class Structure", XmAlwaysOpen); (void) CreateNode(outline, w3, "The Composite Instance Structure", XmAlwaysOpen); (void) CreateNode(outline, w3, "The Constraint Class Structure", XmAlwaysOpen); (void) CreateNode(outline, w3, "The Constraint Instance Structure", XmAlwaysOpen); } static void NewChildCB(Widget w, XtPointer client, XtPointer call) { static int count = 0; char buffer[30]; sprintf (buffer, "New Child %d", count++); CreateNode((Widget)client, w, buffer, XmAlwaysOpen); } /* * Function Name: CreateNode * Description: * Arguments: * Returns: Widget * */ static Widget CreateNode(Widget w_parent, Widget parent_node, char * name, XmHierarchyNodeState state) { Arg args[10]; Cardinal num_args; Widget w; XmString xmstring; xmstring = XmStringCreateSimple(name); num_args = 0; XtSetArg(args[num_args], XmNlabelString, xmstring); num_args++; XtSetArg(args[num_args], XmNnodeState, state); num_args++; XtSetArg(args[num_args], XmNparentNode, parent_node); num_args++; w = XtCreateManagedWidget(name, xmPushButtonWidgetClass, w_parent, args, num_args); XtAddCallback(w,XmNactivateCallback,NewChildCB,w_parent); XmStringFree(xmstring); return(w); } /* * Function Name: WriteUpHype * Description: Prints up the "Hype" message in a label * Arguments: the usual suspects * Returns: nothing */ static void WriteUpHype(Widget parent) { Arg args[5]; Cardinal argcnt; Widget w; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Outline Widget displays hierarchical data in an outline layout with a Motif\n\ look and feel. The Outline widget displayed below has several Motif PushButtons (the\n\ Outline can accept any type of widget); press one to add a new child.\n\ \n\ The Outline Widget uses \"constraints\" to arrange the children with the right layout.\n\ To see the code to generate the tree below, press \"Show Layout Code...\".\n\ \n\ The toggles below set different resources on the Outline widget itself.\n\ \n\ Press \"Other Resources...\" for more information on the various resources.", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNmarginHeight, 10); argcnt++; XtSetArg(args[argcnt], XmNmarginWidth, 10); argcnt++; XtSetArg(args[argcnt], XmNalignment, XmALIGNMENT_BEGINNING); argcnt++; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; w = XtCreateManagedWidget("hypelabel", xmLabelWidgetClass, parent, args, argcnt); XmStringFree(xmstring); } /* * Function Name: ShowCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void ShowCB(Widget w, XtPointer client, XtPointer call) { static Widget info = NULL; if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; XmString ok_xmstring; ok_xmstring = XmStringCreateSimple("OK"); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Show Code..."); argcnt++; /* XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; */ XtSetArg(args[argcnt], XmNokLabelString, ok_xmstring); argcnt++; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; info = XmCreateTemplateDialog(G_outline, "show_code", args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNcolumns, 60); argcnt++; XtSetArg(args[argcnt], XmNrows, 20); argcnt++; XtSetArg(args[argcnt], XmNvalue, CODE); argcnt++; XtSetArg(args[argcnt], XmNeditable, False); argcnt++; XtSetArg(args[argcnt], XmNeditMode, XmMULTI_LINE_EDIT); argcnt++; temp = XmCreateScrolledText(info, "show_text", args, argcnt); XtManageChild(temp); XmStringFree(ok_xmstring); } XtManageChild(info); } /* * Function Name: ExplainCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void ExplainCB(Widget w, XtPointer client, XtPointer call) { static Widget info = NULL; if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Tree and Outline widget actually derive behavior from the\n\ Hierarchy Widget. The Hierarchy widget provides resources that specify\n\ the relationships between children.\n\ \n\ XmNautoClose specifies whether the Tree or Outline automatically closes\n\ any nodes if a parent node is closed. To see the behavior, press the Auto\n\ Close toggle, then close and reopen the Core.\n\ \n\ XmNnodeState is a constraint resource on a child of the Tree or Outline.\n\ It determines whether a node is Open, Closed, Hidden, or Always Visible.\n\ Use \"Show Layout Code...\" to see how this demo used this resource.\n\ \n\ XmNparentNode specifies this node's parent. This resource determines the\n\ node's logical parent (the widget instance tree says the node is a child of\n\ the Tree or Outline, but the parentNode will specify where on the layout\n\ the node will appear. Use \"Show Layout Code...\" to see how this demo used\n\ this resource.\n\ \n\ XmNnodeStateCallback provides a way to receive feedback when any node is\n\ opened or closed. To use this callback, press the Node State Callback toggle.", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateInformationDialog(G_outline, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XmStringFree(xmstring); } XtManageChild(info); } /* * Function Name: NodeStateCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void NodeStateCB(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; Widget info, temp; XmHierarchyNodeStateData *node_data = (XmHierarchyNodeStateData *) call; XmString xmstring; char *name; char buf[100]; argcnt = 0; XtSetArg(args[argcnt], XmNlabelString, &xmstring); argcnt++; XtGetValues(node_data->widget, args, argcnt); XmStringGetLtoR(xmstring, XmFONTLIST_DEFAULT_TAG, &name); if (node_data->state == XmOpen) sprintf(buf, "%s has switched to the XmOpen state.", name); else if (node_data->state == XmClosed) sprintf(buf, "%s has switched to the XmClosed state.", name); else if (node_data->state == XmAlwaysOpen) sprintf(buf, "%s has switched to the XmAlwaysOpen state.", name); else if (node_data->state == XmHidden) sprintf(buf, "%s has switched to the XmHidden state.", name); else sprintf(buf, "%s has switched node state.", name); xmstring = XmStringCreateSimple(buf); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Node State Changed"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateInformationDialog(w, "nodechange", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XmStringFree(xmstring); XtFree(name); XtManageChild(info); } /* * Function Name: CallbackTogCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void CallbackTogCB(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; Widget lab = (Widget) client; XmString xmstring; if (XmToggleButtonGetState(w)) { XtAddCallback(G_outline, XmNnodeStateCallback, NodeStateCB, NULL); xmstring = XmStringCreateSimple("Added"); } else { XtRemoveAllCallbacks(G_outline, XmNnodeStateCallback); xmstring = XmStringCreateSimple("Not Added"); } argcnt = 0; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; XtSetValues(lab, args, argcnt); XmStringFree(xmstring); } /* * Function Name: AutoCloseTogCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void AutoCloseTogCB(Widget w, XtPointer client, XtPointer call) { XtVaSetValues(G_outline, XmNautoClose, XmToggleButtonGetState(w), NULL); } static void ConnectTogCB(Widget w, XtPointer client, XtPointer call) { XtVaSetValues(G_outline, XmNconnectNodes, XmToggleButtonGetState(w), NULL); } /* * Function Name: QuitCB * Description: Exits the program * Arguments: This is an XtCallback * Returns: Nothing */ static void QuitCB(Widget w, XtPointer client, XtPointer call) { done = 1; } /* * Function Name: MakeControlPanel * Description: Prints up the "Hype" message in a label * Arguments: the usual suspects * Returns: nothing */ static void MakeControlPanel(Widget parent) { Arg args[5]; Cardinal argcnt; Widget big_rc, rc_1, rc_2, show_pb, explain_pb, ladder_tog, ladder_lab, callback_tog, callback_lab, quit_pb, autoclose_tog, sep, connect_tog; /* Big Vertical Row Column for the control panel */ argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; XtSetArg(args[argcnt], XmNpacking, XmPACK_TIGHT); argcnt++; big_rc = XtCreateManagedWidget("big_rc", xmRowColumnWidgetClass, parent, args, argcnt); /* First Row */ argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNpacking, XmPACK_TIGHT); argcnt++; rc_1 = XtCreateManagedWidget("rc_1", xmRowColumnWidgetClass, big_rc, args, argcnt); argcnt = 0; callback_tog = XtCreateManagedWidget("callback_tog", xmToggleButtonWidgetClass, rc_1, args, argcnt); argcnt = 0; callback_lab = XtCreateManagedWidget("callback_lab", xmLabelWidgetClass, rc_1, args, argcnt); XtAddCallback(callback_tog, XmNvalueChangedCallback, CallbackTogCB, (XtPointer) callback_lab); argcnt = 0; sep = XtCreateManagedWidget("sep_two", xmSeparatorWidgetClass, rc_1, args, argcnt); argcnt = 0; autoclose_tog = XtCreateManagedWidget("autoclose_tog", xmToggleButtonWidgetClass, rc_1, args, argcnt); XtAddCallback(autoclose_tog, XmNvalueChangedCallback, AutoCloseTogCB, NULL); argcnt = 0; sep = XtCreateManagedWidget("sep_two", xmSeparatorWidgetClass, rc_1, args, argcnt); argcnt = 0; connect_tog = XtCreateManagedWidget("connect_tog", xmToggleButtonWidgetClass, rc_1, args, argcnt); XtAddCallback(connect_tog, XmNvalueChangedCallback, ConnectTogCB, NULL); /* Third Row */ argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNpacking, XmPACK_TIGHT); argcnt++; rc_2 = XtCreateManagedWidget("rc_2", xmRowColumnWidgetClass, big_rc, args, argcnt); argcnt = 0; show_pb = XtCreateManagedWidget("show_pb", xmPushButtonWidgetClass, rc_2, args, argcnt); XtAddCallback(show_pb, XmNactivateCallback, ShowCB, NULL); argcnt = 0; explain_pb = XtCreateManagedWidget("explain_pb", xmPushButtonWidgetClass, rc_2, args, argcnt); XtAddCallback(explain_pb, XmNactivateCallback, ExplainCB, NULL); argcnt = 0; quit_pb = XtCreateManagedWidget("quit_pb", xmPushButtonWidgetClass, rc_2, args, argcnt); XtAddCallback(quit_pb, XmNactivateCallback, QuitCB, NULL); } motif-2.3.8/demos/programs/Outline/Makefile.am0000644000175000017500000000052113145162623016200 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Outline datadir = ${prefix}/share/Xm/Outline EXTRA_DIST = bin_PROGRAMS = outline outline_SOURCES = outline.c data_DATA = $(outline_SOURCES) $(EXTRA_DIST) LDADD = $(TOPDIR)/lib/Xm/libXm.la TOPDIR = ../../.. INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/workspace/0000755000175000017500000000000013211513007014573 500000000000000motif-2.3.8/demos/programs/workspace/command_ui.c0000644000175000017500000006003613066310437017011 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: command_ui.c /main/8 1997/05/02 10:08:26 dbl $" #endif #endif #include #include #include #include #include "Wsm/wsm_proto.h" #include "Wsm/wsm_funcs.h" #include "Wsm/utm_send.h" #include "wsm.h" #include "wsmStruct.h" #include "wsmDebug.h" #include "command_ui.h" #include "wsm_cb.h" #include "wsm_ui.h" extern AtomStruct atoms; extern Display *dsp; extern Widget shell; extern Widget shell_ui; extern Space* space_list; extern Space* all_space; extern Space *current_space; extern WSM_UI* wsm_ui; extern Boolean wsm_shown; int debug_index = 0; #define GET_COMMAND_ID(dpy) ((CARD32) XAllocID(dpy)) CARD32 switch_id; CARD32 show_id; CARD32 occupy_id; CARD32 copy_all_id; CARD32 link_all_id; CARD32 remove_id; Boolean exiting = False; CommandSpace *command_space_list; typedef enum {ROOT, ALL, ICON, WIN, DEFINE, INCLUDE, REMOVE, ENABLE, DISABLE, RENAME, INLINE, MAXTOGGLES } RType; Atom WM_S0, _MOTIF_WM_DEFINE_COMMAND, _MOTIF_WM_INCLUDE_COMMAND, _MOTIF_WM_DISABLE_COMMAND, _MOTIF_WM_ENABLE_COMMAND, _MOTIF_WM_INVOKE_COMMAND, _MOTIF_WM_REMOVE_COMMAND, _MOTIF_WM_RENAME_COMMAND; Time GetTimestamp (Display *dpy) { XEvent event; XWindowAttributes attr; Window rwin = RootWindowOfScreen(XtScreen(utmShell)); Atom time_atom = XInternAtom(dsp, "_MOTIF_CURRENT_TIME", False); XGetWindowAttributes(dsp, rwin, &attr); if (! (attr.your_event_mask & PropertyChangeMask)) XSelectInput(dsp, rwin, attr.your_event_mask | PropertyChangeMask); XChangeProperty(dsp, rwin, time_atom, time_atom, 8, PropModeAppend, NULL, 0); XWindowEvent(dsp, rwin, PropertyChangeMask, &event); if (! (attr.your_event_mask & PropertyChangeMask)) XSelectInput(dsp, rwin, attr.your_event_mask); return(event.xproperty.time); } /*----------------------------------------------------------------------* | SelectionProc | | This is invoked when a message is finished and the reply is received.| *----------------------------------------------------------------------*/ void SelectionProc (Widget w, XtPointer clientData, XtPointer callData) { } /*----------------------------------------------------------------------* | LastSelectionProc | | This is invoked when the last message is finished and the reply is | | received. | *----------------------------------------------------------------------*/ void LastSelectionProc (Widget w, XtPointer clientData, XtPointer callData) { Display *dsp = XtDisplay(w); XSync(dsp, False); XCloseDisplay(dsp); exit(0); } /*----------------------------------------------------------------------* | SendMessage | *----------------------------------------------------------------------*/ void SendMessage(RType rtype, XtPointer msg, int len, Time time) { XtCallbackProc s_proc; Atom target = 0; if (!exiting) s_proc = SelectionProc; else s_proc = LastSelectionProc; if (!XtIsRealized(shell)) { PRINT("must be realized\n"); return; } switch (rtype) { case DEFINE: target = _MOTIF_WM_DEFINE_COMMAND; break; case INCLUDE: target = _MOTIF_WM_INCLUDE_COMMAND; break; case REMOVE: target = _MOTIF_WM_REMOVE_COMMAND; break; case ENABLE: target = _MOTIF_WM_ENABLE_COMMAND; break; case DISABLE: target = _MOTIF_WM_DISABLE_COMMAND; break; case RENAME: target = _MOTIF_WM_RENAME_COMMAND; break; case ROOT: case ALL: case ICON: case WIN: case INLINE: case MAXTOGGLES: /* Not handled cases */ break; } UTMSendMessage(utmShell, WM_S0, target, (XtPointer) msg, (unsigned long)len, WSM_PROTO_FMT, s_proc, (XtPointer)++debug_index, time); if (msg != NULL) XtFree(msg); } /*----------------------------------------------------------------------* | SendEnable | *----------------------------------------------------------------------*/ void SendEnableCommand (Window window, CARD32 commandID) { #ifndef _NO_DISABLE Time time; XtPointer msg,save; int size=0; CARD32 count = 1L; CARD32 windowBit = 1<<30; /* CARD32 iconBit = 1<<31;*/ char str[128]; time = GetTimestamp(dsp); size += sizeof(CARD32); /* command id */ size += sizeof(CARD32); /* count */ size += sizeof(CARD32); /* window */ save = msg = (XtPointer) XtMalloc(size); window |= windowBit; msg = PackCARD32(msg,(CARD32)commandID); msg = PackCARD32(msg,(CARD32)count); msg = PackCARD32(msg,(CARD32)window); PRINT("EnableCommand #%d on window %x (%u).\n", commandID, window, window); SendMessage(ENABLE, save, size, time); #endif } /*----------------------------------------------------------------------* | SendDisable | *----------------------------------------------------------------------*/ void SendDisableCommand (Window window, CARD32 commandID) { #ifndef _NO_DISABLE Time time; XtPointer msg,save; int size=0; CARD32 count = 1L; CARD32 windowBit = 1<<30; /* CARD32 iconBit = 1<<31;*/ char str[128]; time = GetTimestamp(dsp); size += sizeof(CARD32); /* command id */ size += sizeof(CARD32); /* count */ size += sizeof(CARD32); /* window */ save = msg = (XtPointer) XtMalloc(size); window |= windowBit; msg = PackCARD32(msg,(CARD32)commandID); msg = PackCARD32(msg,(CARD32)count); msg = PackCARD32(msg,(CARD32)window); PRINT("DisableCommand #%d on window %x (%u).\n", commandID, window, window); SendMessage(DISABLE, save, size, time); #endif } /*----------------------------------------------------------------------* | SendInclude | *----------------------------------------------------------------------*/ void SendIncludeCommand(Window window, int commID, Boolean is_in_line) { Time time; XtPointer msg, save; CARD32 commandID = 0L; CARD32 in_line = 0L; CARD32 selection = 0L; CARD32 count = 1L; CARD32 windowBit = 1<<30; /* CARD32 iconBit = 1<<31;*/ char str[128]; int size=0; commandID += commID; selection += atoms.own_selection; if (is_in_line) { in_line = 1L; } time = GetTimestamp(dsp); /* * Fixup the window id receiving the client command. * Top 2 bits: * 10 - Icon only * 01 - Window only * 11 - Both Icon and Window * 00 - Reserved (Don't Use!) * * Bottom 30 bits: * 0x3fffffff - All windows and/or icons * 0x00000000 - Root window menu */ size += sizeof(CARD32); /* in-line*/ size += sizeof(CARD32); /* command id */ size += sizeof(CARD32); /* selection */ size += sizeof(CARD32); /* count */ size += sizeof(CARD32); /* window */ save = msg = (XtPointer) XtMalloc(size); window |= windowBit; msg = PackCARD32(msg, (CARD32)in_line); msg = PackCARD32(msg, (CARD32)commandID); msg = PackCARD32(msg, (CARD32)selection); msg = PackCARD32(msg, (CARD32)count); msg = PackCARD32(msg, (CARD32)window); PRINT("IncludeCommand #%d on window %x (%u).\n", commandID, window, window); SendMessage(INCLUDE, save, size, time); } /*----------------------------------------------------------------------* | SendRemove | *----------------------------------------------------------------------*/ void SendRemoveCommand(Window window, CARD32 commandID) { Time time; XtPointer msg,save; CARD32 selection = 0L; CARD32 count = 1L; CARD32 windowBit = 1<<30; /* CARD32 iconBit = 1<<31;*/ char str[128]; int size=0; time = GetTimestamp(dsp); selection += atoms.own_selection; /* * Fixup the window id receiving the client command. * Top 2 bits: * 10 - Icon only * 01 - Window only * 11 - Both Icon and Window * 00 - Reserved (Don't Use!) * * Bottom 30 bits: * 0x3fffffff - All windows and/or icons * 0x00000000 - Root window menu */ window |= windowBit; size += sizeof(CARD32); /* command id */ size += sizeof(CARD32); /* count */ size += sizeof(CARD32); /* window id */ save = msg = (XtPointer) XtMalloc(size); msg = PackCARD32(msg, (CARD32) commandID); msg = PackCARD32(msg, (CARD32) count); msg = PackCARD32(msg, (CARD32) window); PRINT("RemoveCommand #%d on window %x (%u).\n", commandID, window, window); SendMessage(REMOVE, save, size, time); } /*----------------------------------------------------------------------* | SendDefineCommand | *----------------------------------------------------------------------*/ void SendDefineCommand (int parID, int commID, char *cmdName, char *cmdDefault) { Time time; XtPointer msg,save; int size=0; CARD32 selection = 0L; CARD32 commandID = 0L; CARD32 parentID = 0L; commandID += commID; parentID += parID; time = GetTimestamp(dsp); selection += atoms.own_selection; size += sizeof(CARD32); /* command id */ size += sizeof(CARD32); /* selection */ size += sizeof(CARD32); /* parent id */ size += sizeof(CARD16) + (strlen(cmdName) * sizeof(CARD8)); /* name */ size += sizeof(CARD16) + (strlen(cmdDefault) * sizeof(CARD8)); /* defalault label */ save = msg = (XtPointer) XtMalloc(size); msg = PackCARD32(msg, (CARD32) commandID); msg = PackCARD32(msg, (CARD32) selection); msg = PackCARD32(msg, (CARD32) parentID); msg = PackString(msg, (String) cmdName); msg = PackString(msg, (String) cmdDefault); PRINT("DefineCommand: %d, %d, %d, '%s', '%s'\n", commandID, selection, parentID, cmdName, cmdDefault); SendMessage(DEFINE, save, size, time); } /*----------------------------------------------------------------------* | SendRename | *----------------------------------------------------------------------*/ void SendRenameCommand(Window window, int commID, char *new_name) { Time time; XtPointer msg, save; CARD32 commandID = 0L; CARD32 count = 1L; CARD32 windowBit = 1<<30; /* CARD32 iconBit = 1<<31;*/ char str[128]; int size=0; commandID += commID; time = GetTimestamp(dsp); /* * Fixup the window id receiving the client command. * Top 2 bits: * 10 - Icon only * 01 - Window only * 11 - Both Icon and Window * 00 - Reserved (Don't Use!) * * Bottom 30 bits: * 0x3fffffff - All windows and/or icons * 0x00000000 - Root window menu */ size += sizeof(CARD32); /* command id */ size += sizeof(CARD16) + (strlen(new_name) * sizeof(CARD8)); size += sizeof(CARD32); /* count */ size += sizeof(CARD32); /* window */ save = msg = (XtPointer) XtMalloc(size); window |= windowBit; msg = PackCARD32(msg, (CARD32)commandID); msg = PackString(msg, (String) new_name); msg = PackCARD32(msg, (CARD32)count); msg = PackCARD32(msg, (CARD32)window); PRINT("RenameCommand #%d to %s on window %x (%u).\n", commandID, new_name, window, window); SendMessage(RENAME, save, size, time); } /*----------------------------------------------------------------------* | CS Structure stuff | *----------------------------------------------------------------------*/ CommandSpace * GetCSFromCopyID(CARD32 i) { CommandSpace *cs; cs = command_space_list; while (cs != NULL) { if (cs->copy_command_id == i) { return cs; } cs = cs->next; } return NULL; } CommandSpace * GetCSFromLinkID(CARD32 i) { CommandSpace *cs; cs = command_space_list; while (cs != NULL) { if (cs->link_command_id == i) { return cs; } cs = cs->next; } return NULL; } CommandSpace * GetCSFromSwitchID(CARD32 i) { CommandSpace *cs; cs = command_space_list; while (cs != NULL) { if (cs->switch_command_id == i) return cs; cs = cs->next; } PRINT("GetCSFromSwitch(%d) returning NULL\n",i); return NULL; } CommandSpace * GetCSFromSpaceID(int i) { int j; CommandSpace *cs; cs = command_space_list; if (cs == NULL) return NULL; for (j = 0; j < i; j++) { if (cs == NULL) return NULL; cs = cs->next; } return cs; } CommandSpace * GetCSFromSpace(Space *space) { CommandSpace *cs; cs = command_space_list; while (cs != NULL) { if (cs->space == space) return cs; cs = cs->next; } return NULL; } Space * GetSpaceFromLinkID(CARD32 c_id) { CommandSpace *cs = command_space_list; while (cs != NULL) { if (cs->link_command_id == c_id) return cs->space; cs = cs->next; } return NULL; } Space * GetSpaceFromCopyID(CARD32 c_id) { CommandSpace *cs = command_space_list; while (cs != NULL) { if (cs->copy_command_id == c_id) return cs->space; cs = cs->next; } return NULL; } Space * GetSpaceFromSwitchID(CARD32 c_id) { CommandSpace *cs = command_space_list; while (cs != NULL) { if (cs->switch_command_id == c_id) return cs->space; cs = cs->next; } return NULL; } void RemoveCommandSpace(CommandSpace *cspace) { CommandSpace *cs = command_space_list; CommandSpace *pcs = command_space_list; while (cs != NULL) { if (cs == cspace) { if (cs == pcs) command_space_list = cs->next; else pcs->next = cs->next; } pcs = cs; cs = cs->next; } XtFree((XtPointer)cspace); } CommandSpace* CreateCommandSpace(Space *space,CARD32 copy_id, CARD32 link_id,CARD32 switch_id) { CommandSpace *s, *s2; s = (CommandSpace*)XtMalloc(sizeof(CommandSpace)); s->space = space; s->copy_command_id = copy_id; s->link_command_id = link_id; s->switch_command_id = switch_id; s->next = NULL; if (command_space_list == NULL) command_space_list = s; else { for (s2 = command_space_list; s2->next != NULL; s2 = s2->next); s2->next = s; } return s; } /*----------------------------------------------------------------------* | InvokeCommand | *----------------------------------------------------------------------*/ void InvokeCommand ( Widget w, Atom target, MessageData data, unsigned long len, int fmt) { CARD32 commandID; Window windowID; WorkWindow *w_window; CommandSpace *cs; commandID = UnpackCARD32(&data); windowID = UnpackCARD32(&data); PRINT("commandID = %d\n",commandID); PRINT("windowID = %d\n", windowID); if (commandID == show_id) { if (wsm_shown) { PRINT("hide workspace manager\n"); HideWsm(); } else { PRINT("show workspace manager\n"); ShowWsm(); } } else if (commandID == occupy_id) { PRINT("copy window\n"); w_window = GetWorkWindow(windowID); if (w_window != NULL) CreateOccupy(w_window); } else if (commandID == copy_all_id) { PRINT("copy window\n"); w_window = GetWorkWindow(windowID); if (w_window != NULL) CopyWindow(w_window,current_space,all_space); } else if (commandID == link_all_id) { PRINT("copy window\n"); w_window = GetWorkWindow(windowID); if (w_window != NULL) LinkWindow(w_window,current_space,all_space); } else if (commandID == remove_id) { PRINT("remove id\n"); w_window = GetWorkWindow(windowID); if (w_window != 0) { if (w_window->s_list->next != NULL && w_window->window != None && _WSMGetConfigFormatType(w_window->window) != WSM_ICON_FMT) DeleteWindow(w_window,current_space); } } else if ((cs = GetCSFromSwitchID(commandID)) != NULL) { PRINT("SendLeaveRoom(%s)\n",cs->space->name); XmToggleButtonSetState(wsm_ui->space_button[GetSpaceID(cs->space)],True,True); } else if ((cs = GetCSFromCopyID(commandID)) != NULL) { PRINT("copy space"); w_window = GetWorkWindow(windowID); if (w_window != NULL) { PRINT(" %s\n",cs->space->name); CopyWindow(w_window,current_space, cs->space); } } else if ((cs = GetCSFromLinkID(commandID)) != NULL) { PRINT("link space"); w_window = GetWorkWindow(windowID); if (w_window != NULL) { PRINT(" %s\n",cs->space->name); LinkWindow(w_window,current_space, cs->space); } } } /*----------------------------------------------------------------------* | GenerateSwitchMenu | *----------------------------------------------------------------------*/ void GenerateSwitchMenu(void) { CommandSpace *cspace; switch_id = GET_COMMAND_ID(dsp); SendDefineCommand(0,switch_id, "_WSM_SWITCH_WORKSPACE", "Switch Workspace"); for (cspace = command_space_list; cspace != NULL; cspace = cspace->next) { SendDefineCommand(switch_id, cspace->switch_command_id, cspace->space->name, cspace->space->name); } } /*----------------------------------------------------------------------* | SetInitialCommands | *----------------------------------------------------------------------*/ void SetInitialCommands(void) { Space *space; /* all window stuff */ PRINT("set initial commands \n"); occupy_id = GET_COMMAND_ID(dsp); copy_all_id = GET_COMMAND_ID(dsp); link_all_id = GET_COMMAND_ID(dsp); remove_id = GET_COMMAND_ID(dsp); show_id = GET_COMMAND_ID(dsp); for (space = space_list; space != NULL; space = space->next) { (void)CreateCommandSpace(space, GET_COMMAND_ID(dsp), GET_COMMAND_ID(dsp), GET_COMMAND_ID(dsp)); } SendDefineCommand(0,occupy_id, "_WSM_OCCUPY", "Occupy..."); SendDefineCommand(0,copy_all_id, "_WSM_COPY_ALL", "Copy To All"); SendDefineCommand(0,link_all_id, "_WSM_LINK_ALL", "Link To All"); SendDefineCommand(0,remove_id, "_WSM_REMOVE_FROM_WS", "Remove From Workspace"); GenerateSwitchMenu(); if (wsm_shown) SendDefineCommand(0,show_id, "_WSM_HIDE_WSM", "Hide Workspace Manager"); else SendDefineCommand(0,show_id, "_WSM_SHOW_WSM", "Show Workspace Manager"); SendIncludeCommand(0x3fffffff,occupy_id, True); SendIncludeCommand(0x3fffffff,copy_all_id, True); SendIncludeCommand(0x3fffffff,link_all_id, True); SendIncludeCommand(0x3fffffff,remove_id, True); SendIncludeCommand(0x00000000,switch_id, False); SendIncludeCommand(0x00000000,show_id, True); } /*----------------------------------------------------------------------* | AddWindow | This will add commands to a new window *----------------------------------------------------------------------*/ void AddWindow(Window win) { SendIncludeCommand(win,occupy_id, True); SendIncludeCommand(win,copy_all_id, True); SendIncludeCommand(win,link_all_id, True); SendIncludeCommand(win,remove_id, True); } /*----------------------------------------------------------------------* | ShowWsmCommand | This will add a Show or Hide Workspace Manager *----------------------------------------------------------------------*/ void ShowWsmCommand(void) { if (wsm_shown) SendRenameCommand(0x0, show_id, "Hide Workspace Manager"); else SendRenameCommand(0x0, show_id, "Show Workspace Manager"); } /*----------------------------------------------------------------------* | AddSpaceCommand | | This will add a new workspace name to the "Switch" root menu command. *----------------------------------------------------------------------*/ void AddSpaceCommand(Space *space) { CommandSpace *cs = CreateCommandSpace(space, GET_COMMAND_ID(dsp), GET_COMMAND_ID(dsp), GET_COMMAND_ID(dsp)); SendRemoveCommand(0x00000000,switch_id); SendRemoveCommand(0x00000000,show_id); GenerateSwitchMenu(); SendIncludeCommand(0x00000000,switch_id, False); SendIncludeCommand(0x00000000,show_id, True); } /*----------------------------------------------------------------------* | RemoveSpaceCommand | *----------------------------------------------------------------------*/ void RemoveSpaceCommand(int i) { CommandSpace *cs = GetCSFromSpaceID(i); if (cs != NULL) { RemoveCommandSpace(cs); } SendRemoveCommand(0x00000000,switch_id); SendRemoveCommand(0x00000000,show_id); GenerateSwitchMenu(); SendIncludeCommand(0x00000000,switch_id, False); SendIncludeCommand(0x00000000,show_id, True); } /*----------------------------------------------------------------------* | ChangeSpaceCommandName | *----------------------------------------------------------------------*/ void ChangeSpaceCommandName(Space *space) { CommandSpace *cs = GetCSFromSpace(space); if (cs != NULL) { SendRenameCommand(0x0, cs->switch_command_id, space->name); } } /*----------------------------------------------------------------------* | DisableDeleteCommand | *----------------------------------------------------------------------*/ void DisableDeleteCommand(Window window) { if (remove_id != 0) { SendDisableCommand(window,remove_id); } } /*----------------------------------------------------------------------* | EnableDeleteCommand | *----------------------------------------------------------------------*/ void EnableDeleteCommand(Window window) { if (remove_id != 0) { SendEnableCommand(window,remove_id); } } /*----------------------------------------------------------------------* | RemoveAllCommandsAndExit | *----------------------------------------------------------------------*/ void RemoveAllCommandsAndExit() { Window rootWindow = XRootWindowOfScreen(XtScreen(shell)); PRINT("REMOVE ALL COMMANDS\n"); SendRemoveCommand(0x3fffffff,occupy_id); SendRemoveCommand(0x3fffffff,copy_all_id); SendRemoveCommand(0x3fffffff,link_all_id); SendRemoveCommand(0x3fffffff,remove_id); SendRemoveCommand(0x00000000,switch_id); exiting = True; SendRemoveCommand(0x00000000,show_id); } /*----------------------------------------------------------------------* | InternStuff | *----------------------------------------------------------------------*/ void InternStuff (Display *dsp) { WM_S0 = XInternAtom(dsp, "WM_S0", False); _MOTIF_WM_DEFINE_COMMAND = XInternAtom(dsp, "_MOTIF_WM_DEFINE_COMMAND", False); _MOTIF_WM_INCLUDE_COMMAND = XInternAtom(dsp, "_MOTIF_WM_INCLUDE_COMMAND", False); _MOTIF_WM_DISABLE_COMMAND = XInternAtom(dsp, "_MOTIF_WM_DISABLE_COMMAND", False); _MOTIF_WM_ENABLE_COMMAND = XInternAtom(dsp, "_MOTIF_WM_ENABLE_COMMAND", False); _MOTIF_WM_INVOKE_COMMAND = XInternAtom(dsp, "_MOTIF_WM_INVOKE_COMMAND", False); _MOTIF_WM_REMOVE_COMMAND = XInternAtom(dsp, "_MOTIF_WM_REMOVE_COMMAND", False); _MOTIF_WM_RENAME_COMMAND = XInternAtom(dsp, "_MOTIF_WM_RENAME_COMMAND", False);} motif-2.3.8/demos/programs/workspace/command_ui.h0000644000175000017500000000326212672140200017003 00000000000000/* $XConsortium: command_ui.h /main/5 1995/07/15 20:46:19 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmCmd_h #define wsmCmd_h #include "wsm.h" typedef struct _CommandSpace { Space *space; CARD32 copy_command_id; CARD32 link_command_id; CARD32 switch_command_id; struct _CommandSpace *next; } CommandSpace; extern void SetInitialCommands( void ); extern void ShowWsmCommand( void ); extern void AddSpaceCommand( Space *s ); extern void AddWindow( Window ); extern void InvokeCommand( Widget, Atom, MessageData, unsigned long, int ); extern void RemoveSpaceCommand( int i ); extern void ChangeSpaceCommandName( Space* ); extern void InternStuff( Display *dsp ); extern void DisableDeleteCommand( Window ); extern void EnableDeleteCommand( Window ); extern void RemoveAllCommandsAndExit(); #endif motif-2.3.8/demos/programs/workspace/Makefile.in0000644000175000017500000005701513211512766016603 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = wsm$(EXEEXT) subdir = demos/programs/workspace ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_wsm_OBJECTS = client_win.$(OBJEXT) command_ui.$(OBJEXT) \ wsm.$(OBJEXT) wsmData.$(OBJEXT) wsmDebug.$(OBJEXT) \ wsmSend.$(OBJEXT) wsmStruct.$(OBJEXT) wsm_cb.$(OBJEXT) \ wsm_create.$(OBJEXT) xrmLib.$(OBJEXT) wsm_OBJECTS = $(am_wsm_OBJECTS) wsm_LDADD = $(LDADD) wsm_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(wsm_SOURCES) DIST_SOURCES = $(wsm_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/wsm build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/wsm datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = README wsm.man wsm_SOURCES = client_win.c command_ui.c wsm.c wsmData.c wsmDebug.c \ wsmSend.c wsmStruct.c wsm_cb.c wsm_create.c xrmLib.c \ command_ui.h wsm_cb.h wsm_create.h wsmData.h wsmDebug.h \ wsm.h wsmSend.h wsmStruct.h wsm_ui.h xrmLib.h data_DATA = $(wsm_SOURCES) $(EXTRA_DIST) INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/workspace/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/workspace/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list wsm$(EXEEXT): $(wsm_OBJECTS) $(wsm_DEPENDENCIES) $(EXTRA_wsm_DEPENDENCIES) @rm -f wsm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(wsm_OBJECTS) $(wsm_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client_win.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command_ui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wsmData.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wsmDebug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wsmSend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wsmStruct.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wsm_cb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wsm_create.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrmLib.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/workspace/wsm_create.h0000644000175000017500000000310212672140200017012 00000000000000/* $XConsortium: wsm_create.h /main/5 1995/07/15 20:46:50 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmCreate_h #define wsmCreate_h #include "wsm_ui.h" extern Widget CreateNameWorkspace( Widget, WSM_UI* ); extern Widget CreateBackgroundWorkspace( Widget, WSM_UI* ); extern Widget CreateDeleteWorkspace( Widget, WSM_UI* ); extern Widget CreateWorkspace( Widget, WSM_UI* ); extern Widget CreateWorkspace( Widget, WSM_UI* ); extern Widget CreateConfigureWorkspace( Widget, WSM_UI* ); extern Widget CreateWorkspacePanelBX( Widget, WSM_UI*, Boolean ); extern Widget CreateSaveAs( Widget, WSM_UI* ); extern Widget CreateOccupyWorkspace( Widget, WSM_UI* ); #endif motif-2.3.8/demos/programs/workspace/xrmLib.c0000644000175000017500000006703613145162623016142 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: xrmLib.c /main/6 1995/07/14 10:01:41 drk $" #endif #endif #include #include #include #include "wsm.h" #include "wsmDebug.h" #include "wsmData.h" XrmDatabase wsm_dbase = NULL; static XrmQuark linkedq = NULLQUARK; static XrmQuark space_listq = NULLQUARK; static XrmQuark all_workspacesq = NULLQUARK; static XrmQuark current_spaceq = NULLQUARK; static XrmQuark show_dialogq = NULLQUARK; static XrmQuark workspace_listq = NULLQUARK; static XrmQuark background_listq = NULLQUARK; static XrmQuark pixmap_listq = NULLQUARK; XrmQuark hideq = NULLQUARK; XrmQuark allspaceq = NULLQUARK; /*------------------------------------------------------------------ InitializeXrm ------------------------------------------------------------------*/ Boolean InitializeXrm(char *dbase_name) { Boolean retval = True; /* initialize dbase */ XrmInitialize(); if (wsm_dbase == NULL) { wsm_dbase = XrmGetFileDatabase(dbase_name); if (wsm_dbase == NULL) { printf("cannot open database %s\n", dbase_name); wsm_dbase = XrmGetStringDatabase("wsm_WSM.WSM.0.linked:True\nwsm_WSM.WSM.0.allWorkspaces:True\nwsm_WSM.WSM.0.linkedRoom.hidden:0\nsaveAsShell_WSM*allWorkspaces:True\nconfigureShell_WSM*allWorkspaces:True\nnameShell_WSM*allWorkspaces: True\nbackgroundShell_WSM*allWorkspaces:True\ndeleteShell_WSM*allWorkspaces:True\nsaveAsShell_WSM*allWorksapces:True\noccupyShell_WSM*allWorkspaces:True"); if (wsm_dbase == NULL) { printf("cannot open databse \n"); retval = False; } } } /* initialize workspace resource quarks */ if (linkedq == NULLQUARK) { current_spaceq = XrmStringToQuark("currentWorkspace"); workspace_listq = XrmStringToQuark("workspaceList"); background_listq = XrmStringToQuark("backgroundList"); pixmap_listq = XrmStringToQuark("labelPixmapList"); space_listq = XrmStringToQuark("spaceList"); show_dialogq = XrmStringToQuark("showWSDialog"); linkedq = XrmStringToQuark("linked"); all_workspacesq = XrmStringToQuark("allWorkspaces"); hideq = XrmStringToQuark("hidden"); allspaceq = XrmStringToQuark("all"); } return retval; } /*------------------------------------------------------------------ GetSpaceListResources ------------------------------------------------------------------*/ Boolean GetSpaceListResources(Widget w, char ***s_list, char ***b_list, char ***p_list, char **c_space, Boolean *s_dialog) { XrmValue value; XrmRepresentation type; XrmValue toVal; XrmValue boolVal; Boolean retval = False; XrmQuark specifier[2]; toVal.addr = NULL; specifier[0] = workspace_listq; specifier[1] = NULLQUARK; if (XrmQGetResource(wsm_dbase, specifier, specifier, &type, &value)) { if (XtConvertAndStore(w, XtRString, &value, XtRStringTable, &toVal)) { *s_list = *(String**)toVal.addr; retval = True; } } else *s_list = NULL; specifier[0] = background_listq; specifier[1] = NULLQUARK; if (XrmQGetResource(wsm_dbase, specifier, specifier, &type, &value)) { if (XtConvertAndStore(w, XtRString, &value, XtRStringTable, &toVal)) { *b_list = *(String**)toVal.addr; retval = True; } } else *b_list = NULL; specifier[0] = pixmap_listq; specifier[1] = NULLQUARK; if (XrmQGetResource(wsm_dbase, specifier, specifier, &type, &value)) { if (XtConvertAndStore(w, XtRString, &value, XtRStringTable, &toVal)) { *p_list = *(String**)toVal.addr; retval = True; } } else *p_list = NULL; specifier[0] = current_spaceq; if (XrmQGetResource(wsm_dbase, specifier, specifier, &type, &value)) { *c_space = value.addr; retval = True; } else *c_space = NULL; specifier[0] = show_dialogq; if (XrmQGetResource(wsm_dbase, specifier, specifier, &type, &value)) { if (XtConvertAndStore(w, XtRString, &value, XtRBoolean, &boolVal)) { *s_dialog = *(Boolean*)toVal.addr; retval = True; } } else *s_dialog = True; return retval; } /*------------------------------------------------------------------ GetWorkspaceResources ------------------------------------------------------------------*/ Boolean GetWorkspaceResources(Widget w, XrmQuarkList specifier_list, XrmQuarkList *room_list, /*return*/ Boolean *all_workspaces, /*return*/ Boolean *linked) /*return*/ { XrmHashTable *xrm_workspace_list; XrmValue boolVal; XrmValue value; XrmRepresentation type; Boolean a_bool; XrmValue toVal; String *room_str_list; XrmQuark *room; int i; Boolean retval = False; int list_length = 100; int max_length = 5; int curr_length = 1; xrm_workspace_list = (XrmHashTable*)XtMalloc(list_length *sizeof(XrmHashTable)); toVal.addr = NULL; #ifdef DEBUG PRINT("GetWorkSpaceResources for %s\n",XrmQuarkToString(specifier_list[0])); #endif /* fetch a list of database levels that matches the specifier */ if (XrmQGetSearchList(wsm_dbase, specifier_list, specifier_list, xrm_workspace_list, list_length) == False) { #ifdef DEBUG PRINT("XrmQGetSearchList is false\n"); #endif return False; } /* get list of worspaces from database */ room = (XrmQuark*)XtMalloc(max_length*sizeof(XrmQuark)); if (XrmQGetSearchResource(xrm_workspace_list, space_listq, space_listq, &type, &value)) { if (XtConvertAndStore(w, XtRString, &value, XtRStringTable, &toVal)) { room_str_list = *(String **)toVal.addr; #ifdef DEBUG PRINT("rooms list found: "); #endif for (i = 0; room_str_list[i] != NULL; i++) { curr_length++; if (curr_length > max_length) { max_length +=5; room = (XrmQuark*)XtRealloc((char*)room,(max_length)*sizeof(XrmQuark)); } room[i] = XrmStringToQuark(room_str_list[i]); #ifdef DEBUG PRINT(" %s ",room_str_list[i]); #endif } #ifdef DEBUG PRINT("\n"); #endif room[i] = NULLQUARK; *room_list = room; retval = True; } } else { #ifdef DEBUG PRINT("%s is null for %s\n", XrmQuarkToString(space_listq), XrmQuarkToString(specifier_list[0])); #endif XtFree((XtPointer)room); *room_list = NULL; } /* get linked resource from database */ boolVal.size = sizeof(Boolean); boolVal.addr = (XtPointer)&a_bool; if (XrmQGetSearchResource(xrm_workspace_list, linkedq, linkedq, &type, &value)) { if (XtConvertAndStore(w, XtRString, &value, XtRBoolean, &boolVal)) { *linked = *(Boolean*)boolVal.addr; #ifdef DEBUG if (*linked) PRINT("linked: True\n"); else PRINT("linked: False\n"); #endif retval = True; } } else { #ifdef DEBUG PRINT("linked not found\n"); #endif *linked = False; } /* get allWorkspace resource from database */ if (XrmQGetSearchResource(xrm_workspace_list, all_workspacesq, all_workspacesq, &type, &value)) { if (XtConvertAndStore(w, XtRString, &value, XtRBoolean, &boolVal)) { *all_workspaces = *(Boolean*)boolVal.addr; #ifdef DEBUG if (*all_workspaces) PRINT("all_workspaces: True %d\n",*all_workspaces); else PRINT("all_workspaces: False\n"); #endif retval = True; } } else { #ifdef DEBUG PRINT("all_workspaces not found\n"); #endif *all_workspaces = False; } XtFree((XtPointer)xrm_workspace_list); return retval; } /*------------------------------------------------------------------ GetWindowConfigurationEntry ------------------------------------------------------------------*/ Boolean GetWindowConfigurationEntry(XrmQuarkList specifier_list, XrmQuarkList attribute_list, XrmQuark room_name, XrmValue **attribute_values) /* return */ { int list_length = 100; XrmHashTable *xrm_workspace_list; XrmRepresentation type; XrmQuark specifier[10]; XrmValue *values_array = NULL; Boolean retval = False; int i,j; int num_attrib; /* PRINT("enter GetWindowConfig ......");*/ xrm_workspace_list = (XrmHashTable*)XtMalloc(list_length *sizeof(XrmHashTable)); for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; } specifier[i] = room_name; specifier[i+1] = NULLQUARK; if (wsm_dbase == NULL) { return False; } for (num_attrib = 0; attribute_list[num_attrib] != NULLQUARK; num_attrib++); if (XrmQGetSearchList(wsm_dbase, specifier, specifier, xrm_workspace_list, list_length)) { values_array = (XrmValue*)XtMalloc(num_attrib*sizeof(XrmValue)); for (j = 0; attribute_list[j] != NULLQUARK ;j++) { if (!XrmQGetSearchResource(xrm_workspace_list, attribute_list[j], attribute_list[j], &type, &(values_array[j]))) { values_array[j].size = 0; values_array[j].addr = NULL; } else retval = True; } } *attribute_values = values_array; /* PRINT("return\n");*/ XtFree((XtPointer)xrm_workspace_list); return retval; } /*------------------------------------------------------------------ GetAllWindowConfigurationEntry ------------------------------------------------------------------*/ Boolean GetAllWindowConfigurationEntry(XrmQuarkList specifier_list, XrmQuarkList attribute_list, XrmQuarkList room_list, XrmValue ***attribute_values)/*return*/ { Boolean retval = False; int list_length = 100; XrmHashTable *xrm_workspace_list; XrmRepresentation type; XrmQuark specifier[10]; XrmValue *values_array; int i,j; int num_rooms, num_attributes; int spec_index; XrmValue **values; #ifdef DEBUG /* PRINT("enter GetAllWindowConfig ......");*/ #endif xrm_workspace_list = (XrmHashTable*)XtMalloc(list_length *sizeof(XrmHashTable)); /* create a QuarkList for use in database query */ for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; } spec_index = i; specifier[spec_index+1] = NULLQUARK; if (wsm_dbase == NULL) { return retval; } for (num_attributes = 0; attribute_list[num_attributes] != NULLQUARK; num_attributes++); for (num_rooms = 0; room_list[num_rooms] != NULLQUARK; num_rooms++); values = (XrmValue **)XtMalloc(num_rooms*sizeof(XrmValue*)); for (i = 0; i < num_rooms; i ++) { values_array = (XrmValue*)XtMalloc(num_attributes*sizeof(XrmValue)); specifier[spec_index] = room_list[i]; if (XrmQGetSearchList(wsm_dbase, specifier, specifier, xrm_workspace_list, list_length)) { for (j = 0;attribute_list[j] != NULLQUARK; j++) { if (!XrmQGetSearchResource(xrm_workspace_list, attribute_list[j], attribute_list[j], &type, &(values_array[j]))) { values_array[j].size = 0; values_array[j].addr = NULL; } else retval = True; } } values[i] = values_array; } *attribute_values = values; /* PRINT("return\n");*/ XtFree((XtPointer)xrm_workspace_list); return retval; } /*------------------------------------------------------------------ SaveSpaceListResources ------------------------------------------------------------------*/ Boolean SaveSpaceListResources(char *space_list, char *b_list, char *p_list, char *c_space) { XrmBinding bind[2]; XrmQuark specifier[2]; XrmValue value; PRINT("enter SaveSpaceListResources ....."); if (wsm_dbase == NULL) { return False; } specifier[0] = workspace_listq; specifier[1] = NULLQUARK; bind[0] = XrmBindLoosely; bind[1] = NULLQUARK; value.addr = space_list; value.size = strlen(space_list) +1; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); specifier[0] = background_listq; specifier[1] = NULLQUARK; bind[0] = XrmBindLoosely; bind[1] = NULLQUARK; value.addr = b_list; value.size = strlen(b_list) +1; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); specifier[0] = pixmap_listq; specifier[1] = NULLQUARK; bind[0] = XrmBindLoosely; bind[1] = NULLQUARK; value.addr = p_list; value.size = strlen(p_list) +1; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); specifier[0] = current_spaceq; value.addr = c_space; value.size = strlen(c_space) +1; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); /* XrmPutFileDatabase(wsm_dbase, ".test2");*/ PRINT("return\n"); return True; } /*------------------------------------------------------------------ SaveWorkspaceResources ------------------------------------------------------------------*/ Boolean SaveWorkspaceResources(Widget w, XrmQuarkList specifier_list, XrmQuark room_nameq, XrmQuark remove_roomq, Boolean all_workspaces, Boolean linked) { XrmQuarkList room_list = NULL; XrmBinding bind[10]; XrmQuark specifier[10]; int specifier_count; static char linked_string[10]; static char all_workspace_string[10]; XrmValue value; int i; Boolean room_found = False; Boolean in_dbase = False; Boolean all_work = False; Boolean link = False; char *rooms_str; char *str; char *new_str; int size; /* PRINT("enter SaveWorkspaceResources .....");*/ if (wsm_dbase == NULL) { return False; } for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; bind[i] = XrmBindTightly; } bind[i] = XrmBindTightly; bind[i+1] = NULLQUARK; specifier[i+1] = NULLQUARK; specifier_count = i; in_dbase = GetWorkspaceResources(w, specifier_list, &room_list, &all_work, &link); if (in_dbase) { if (room_list!= NULL) { for (i = 0; room_list[i] != NULLQUARK; i++) { if (room_nameq == room_list[i]) room_found = True; } } } if (!room_found) { #ifdef DEBUG PRINT("room %s not found %s\n",XrmQuarkToString(room_nameq), XrmQuarkToString(specifier[0])); #endif new_str = XrmQuarkToString(room_nameq); rooms_str = (char*) XtMalloc(2 * sizeof(char)); rooms_str[0] = '\0'; if (room_list != NULL) { for (i = 0; room_list[i] != NULLQUARK; i++) { if (room_list[i] != remove_roomq) { str = XrmQuarkToString(room_list[i]); size = strlen(rooms_str) +1; rooms_str = (char*) XtRealloc(rooms_str,(size + strlen(str) + 3)*sizeof(char)); strcat(rooms_str,str); strcat(rooms_str,","); } } } size = strlen(rooms_str) +1; rooms_str = (char*) XtRealloc(rooms_str,(size + strlen(new_str)+2) * sizeof(char)); strcat(rooms_str,new_str); value.addr = rooms_str; value.size = strlen(rooms_str) +1; specifier[specifier_count] =space_listq; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); XtFree((XtPointer)rooms_str); } if (room_list != NULL) XtFree((XtPointer)room_list); if (!in_dbase || link != linked) { /* add linked and allWorkspaces to dbase here */ if (linked) strcpy(linked_string,"True"); else strcpy(linked_string,"False"); value.addr = linked_string; value.size = strlen(linked_string) +1; specifier[specifier_count] =linkedq; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); } if (!in_dbase || all_work != all_workspaces) { if (all_workspaces) strcpy(all_workspace_string,"True"); else strcpy(all_workspace_string,"False"); specifier[specifier_count] = all_workspacesq; value.addr = all_workspace_string; value.size = strlen(all_workspace_string) +1; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); } /* XrmPutFileDatabase(wsm_dbase, ".test2");*/ /* PRINT("return\n");*/ return True; } /*------------------------------------------------------------------ SaveWindowConfiguration ------------------------------------------------------------------*/ Boolean SaveWindowConfiguration(XrmQuarkList specifier_list, XrmQuarkList attribute_qlist, XrmQuark room_nameq, XrmValue *attr_values) { int j; XrmBinding bind[10]; XrmQuark specifier[10]; int specifier_index; int i; /* PRINT("enter SaveWindowConfigure .....");*/ if (wsm_dbase == NULL) { return False; } for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; bind[i] = XrmBindTightly; } specifier[i] = room_nameq; bind[i] = XrmBindTightly; specifier_index = i+1; bind[i+1] = XrmBindTightly; specifier[i +2] = NULLQUARK; bind[i+2] = NULLQUARK; for (j = 0; attribute_qlist[j] != NULLQUARK; j++) { specifier[specifier_index] = attribute_qlist[j]; if (attr_values[j].size != 0) { XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &(attr_values[j])); } } /* XrmPutFileDatabase(wsm_dbase, ".test2");*/ /* PRINT("return\n");*/ return True; } static Boolean delete_line(char *line) { int i; for (i = 0; line[i] != '\0'; i++); if (line[i-2] == 'X' && line[i-3] == 'X' && line[i-4] == 'X' ) { return True; } else return False; } /*------------------------------------------------------------------ RemoveAllWorkspaceResources ------------------------------------------------------------------*/ void RemoveAllWorkspaceResources(XrmQuarkList specifier_list) { XrmQuark work_attrib_qlist[5]; int i,j; char *str = "XXX"; XrmBinding bind[10]; XrmQuark specifier[10]; int spec_index; XrmValue value; work_attrib_qlist[0] = space_listq; work_attrib_qlist[1] = linkedq; work_attrib_qlist[2] = all_workspacesq; work_attrib_qlist[3] = NULLQUARK; for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; bind[i] = XrmBindTightly; } bind[i] = XrmBindTightly; specifier[i +1] = NULLQUARK; bind[i+1] = NULLQUARK; spec_index = i; value.addr = str; value.size = strlen(str)+1; for (j = 0; work_attrib_qlist[j] != NULLQUARK; j++) { specifier[spec_index] = work_attrib_qlist[j]; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); } } /*------------------------------------------------------------------ RemoveWorkspaceResource ------------------------------------------------------------------*/ /* */ Boolean RemoveWorkspacesResource(Widget w, XrmQuarkList specifier_list, XrmQuark room_nameq) { XrmBinding bind[10]; XrmQuark specifier[10]; Boolean in_dbase = False; XrmQuarkList room_list = NULL; int i; Boolean all_workspaces = False; Boolean linked = False; Boolean room_found = False; XrmValue value; char true_str[10]; char *rooms_str; char *r_str; int len; int size; strcpy(true_str,"True"); rooms_str = (char*) XtMalloc(2*sizeof(char)); rooms_str[0] = '\0'; in_dbase = GetWorkspaceResources(w, specifier_list, &room_list, &all_workspaces, &linked); if (in_dbase) { if (room_list!= NULL) for (i = 0; room_list[i] != NULLQUARK; i++) { if (room_nameq == room_list[i] || room_list[i] == allspaceq) { room_found = True; } else { r_str = XrmQuarkToString(room_list[i]); size = strlen(rooms_str) +1; rooms_str = (char*) XtRealloc(rooms_str,(size + strlen(r_str) + 3) * sizeof(char)); strcat(rooms_str,r_str); strcat(rooms_str,","); } } } if (room_list != NULL) XtFree((XtPointer)room_list); if (in_dbase && room_found && strlen(rooms_str) > 0) { len = strlen(rooms_str); if (len > 0) rooms_str[len-1] = '\0'; for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; bind[i] = XrmBindTightly; } /* PRINT("New workspace list %s\n",rooms_str);*/ bind[i] = XrmBindTightly; specifier[i] = space_listq; bind[i+1] = NULLQUARK; specifier[i+1]= NULLQUARK; value.addr = rooms_str; value.size = strlen(rooms_str) +1; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); /* for now just set room.hidden:True */ /* specifier[i] = hideq; value.addr = true_str; value.size = strlen(true_str) + 1; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); */ } /* else if (in_dbase && room_found && strlen(rooms_str) == 0) { RemoveAllWorkspaceResources(specifier); }*/ else { XtFree(rooms_str); return False; } XtFree(rooms_str); return True; } /*------------------------------------------------------------------ PurgeAllWindowConfiguration ------------------------------------------------------------------*/ Boolean PurgeAllWindowConfiguration(Widget w, XrmQuarkList specifier_list, XrmQuarkList attribute_qlist) { Boolean retval = False; int i, j,num_attrib; char * str = "XXX"; FILE *fileD; FILE *fileN; char line[512]; XrmBinding bind[10]; XrmQuark specifier[10]; XrmValue value; Boolean in_dbase = False; XrmQuarkList room_list; Boolean all_workspaces; Boolean linked; int room_index, attrib_index; char *del_db, *save_db; Boolean free_del = True, free_save = True; in_dbase = GetWorkspaceResources(w, specifier_list, &room_list, &all_workspaces, &linked); if (!in_dbase) return False; RemoveAllWorkspaceResources(specifier_list); for (num_attrib = 0; attribute_qlist[num_attrib]!= NULLQUARK; num_attrib++) { } value.addr = str; value.size = strlen(str)+1; for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; bind[i] = XrmBindTightly; } bind[i] = XrmBindTightly; bind[i+1] = XrmBindTightly; specifier[i+2] = NULLQUARK; bind[i+2] = NULLQUARK; room_index = i; attrib_index = i+1; for (i = 0; room_list[i] != NULLQUARK; i++) { specifier[room_index] = room_list[i]; for (j = 0; attribute_qlist[j] != NULLQUARK; j++) { specifier[attrib_index] = attribute_qlist[j]; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); } } if (room_list != NULL) XtFree((XtPointer)room_list); if ((del_db = tempnam(NULL, "wsmD")) == NULL) { del_db = ".wsmDelDB"; free_del = False; } if ((save_db = tempnam(NULL, "wsmS")) == NULL) { save_db = ".wsmSaveDB"; free_save = False; } XrmPutFileDatabase(wsm_dbase, del_db); fileD = fopen(del_db,"r"); fileN = fopen(save_db,"w"); if ((fileD != NULL) && (fileN != NULL)) { while (fgets(line,512,fileD)) { if (!(delete_line(line))) { if (fputs(line,fileN) == EOF) { PRINT("can't puts %s\n",line); } } } fclose(fileD); fclose(fileN); XrmDestroyDatabase(wsm_dbase); wsm_dbase = XrmGetFileDatabase(save_db); remove(del_db); remove(save_db); } if (free_del) free(del_db); if (free_save) free(save_db); return retval; } /*------------------------------------------------------------------ PurgeWindowConfiguration ------------------------------------------------------------------*/ Boolean PurgeWindowConfiguration(Widget w, XrmQuarkList specifier_list, XrmQuarkList attribute_qlist, XrmQuark room_nameq) { int i,j; Boolean retval = False; int num_attrib; FILE *fileD; FILE *fileN; char line[512]; XrmBinding bind[10]; XrmQuark specifier[10]; XrmValue value; int specifier_index; char *str = "XXX"; char *del_db, *save_db; Boolean free_del = True, free_save = True; for (num_attrib = 0; attribute_qlist[num_attrib]!= NULLQUARK; num_attrib++) { } value.addr = str; value.size = strlen(str)+1; RemoveWorkspacesResource(w, specifier_list, room_nameq); for (i = 0; specifier_list[i] != NULLQUARK; i++) { specifier[i] = specifier_list[i]; bind[i] = XrmBindTightly; } specifier[i] = room_nameq; bind[i] = XrmBindTightly; specifier_index = i+1; bind[i+1] = XrmBindTightly; specifier[i +2] = NULLQUARK; bind[i+2] = NULLQUARK; for (j = 0; attribute_qlist[j] != NULLQUARK; j++) { specifier[specifier_index] = attribute_qlist[j]; XrmQPutResource(&wsm_dbase, bind, specifier, XrmStringToRepresentation("String"), &value); } if ((del_db = tempnam(NULL, "wsmD")) == NULL) { del_db = ".wsmDelDB"; free_del = False; } if ((save_db = tempnam(NULL, "wsmS")) == NULL) { save_db = ".wsmSaveDB"; free_save = False; } XrmPutFileDatabase(wsm_dbase, del_db); fileD = fopen(del_db,"r"); fileN = fopen(save_db,"w"); if ((fileD != NULL) && (fileN != NULL)) { while (fgets(line,512,fileD)) { if (!(delete_line(line))) { if (fputs(line,fileN) == EOF) { PRINT("can't puts %s\n",line); } } } fclose(fileD); fclose(fileN); XrmDestroyDatabase(wsm_dbase); wsm_dbase = XrmGetFileDatabase(save_db); remove(del_db); remove(save_db); } if (free_del) free(del_db); if (free_save) free(save_db); return retval; } /*------------------------------------------------------------------ SaveWsmToFile ------------------------------------------------------------------*/ void SaveWsmToFile(char *file_name) { UpdateXrm(); XrmPutFileDatabase(wsm_dbase, file_name); } motif-2.3.8/demos/programs/workspace/xrmLib.h0000644000175000017500000002022012672140200016116 00000000000000/* $XConsortium: xrmLib.h /main/5 1995/07/15 20:46:59 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef xrmLib_h #define xrmLib_h /* Function Name: InitializeXrm * * Description: Open the Xrm database * * Arguments: file_name - name of xrm database file * * */ extern Boolean InitializeXrm( char * ); /* Function Name: GetWorkspaceResources * * Description: Gets the workspace resources for a window * * Arguments: widget - any widget * specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * room_list - returns a quark list of room names that * the window is in. * all_workspaces - returns allWorkspaces resource * linked - returns linked resource * */ extern Boolean GetWorkspaceResources( Widget w, XrmQuarkList specifier, XrmQuarkList *room_qlist, Boolean *all_workspaces, Boolean *linked ); extern Boolean GetSpaceListResources( Widget w, char ***, char ***, char ***, char**, Boolean* ); /* Function Name: GetWindowConfigurationEntry * * Description: Gets the configuration information for a specified * window. * * Arguments: specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * attribute_list - A quark list of attribute names * to search for in database. * room_name - Room name that the window is in. * if it is linked then the linkedRoom * quark should be passed. * attributes_values - Returns array of values * found in the database. The array * length is equal to attribute_list length. * (If no value is found for an attribute then * a value with 0 length and NULL addr is passed) * * Returns: True if any resources found, else False. * * */ extern Boolean GetWindowConfigurationEntry( XrmQuarkList specifier, XrmQuarkList attribute_list, XrmQuark room_name, XrmValue **attribute_values ); /* Function Name: GetWindowStackedEntry * * Description: Gets the stacked resource for a specified * window. * * Arguments: specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * room_name - Room name that the window is in. * if it is linked then the linkedRoom * quark should be passed. * attributes_value - Returns a stacked value * * Returns: True if resources found, else False. * * */ extern Boolean GetWindowStackedEntry( XrmQuarkList specifier, XrmQuark room_name, XrmValue *attribute_value ); /* * Function Name: GetAllWindowConfigurationEntry * * Description: Gets the configuration information for a specified * window. * * Arguments: specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * attribute_list - A quark list of attribute names * to search for in database. * room_list - list of room names that the window is in. * if it is linked then the linkedRoom * quark should be passed. * attributes_values - Returns double array of values * found in the database. The array * width is equal to the number of rooms. The array * length is equal to attribute_list length. * (If no value is found for an attribute then * a value with 0 length and NULL addr is passed) * * Returns: True if any resources found, else False. * * * */ extern Boolean GetAllWindowConfigurationEntry( XrmQuarkList specifier, XrmQuarkList attribute_list, XrmQuarkList room_list, XrmValue ***attribute_values ); /* * * Function Name: SaveWorkspaceResources * * Description: Save the workspaces resources in the xrm database * window. * * Arguments: widget - any widget * specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * room_nameq - Room name quark to be added to database. * all_workspaces - allWorkspaces resource * linked - linked resource * */ extern Boolean SaveWorkspaceResources( Widget, XrmQuarkList, XrmQuark, XrmQuark, Boolean, Boolean ); extern Boolean SaveSpaceListResources( char *, char *, char *, char * ); /* * * Function Name: SaveWindowConfiguration * * Description: Save the window configuration in the xrm database * * Arguments: specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * attribute_qlist - A quark list of attribute names to * be saved in database. * room_nameq - Room name quark that the configuration is in. * if it is linked then the linkedRoom * quark should be passed. * attr_values - list of attribute values (matches attrib_qlist) * */ extern Boolean SaveWindowConfiguration( XrmQuarkList, XrmQuarkList, XrmQuark, XrmValue * ); /* * * Function Name: PurgeWindowConfiguration * * Description: Remove the window configuration from the xrm database * * Arguments: specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * attribute_qlist - A quark list of attribute names to * be removed in database. * room_nameq - the room that the configuration * */ extern Boolean PurgeWindowConfiguration( Widget w, XrmQuarkList specifier_list, XrmQuarkList attribute_qlist, XrmQuark room_nameq ); /* * * Function Name: PurgeAllWindowConfiguration * * Description: Remove the window configuration from the xrm database * * Arguments: specifier - A list of quarks that specifies the * window (SM_CLIENT_ID, WM_ROLE). * attribute_qlist - A quark list of attribute names to * be removed in database. * room_nameq - the room that the configuration * */ extern Boolean PurgeAllWindowConfiguration( Widget w, XrmQuarkList specifier_list, XrmQuarkList attribute_qlist ); /* * * Function Name: SaveWsmToFile * * Description: Saves the Xrm database to a specified file * * Arguments: file_name - file name * */ extern void SaveWsmToFile( char *file_name ); #endif motif-2.3.8/demos/programs/workspace/wsmStruct.c0000644000175000017500000010065113066310437016707 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: wsmStruct.c /main/7 1997/05/02 10:04:46 dbl $" #endif #endif #include #include #include #include "wsm.h" #include "wsmData.h" #include "wsmStruct.h" #include "wsm_cb.h" #include "wsmDebug.h" #include "xrmLib.h" #include "command_ui.h" extern AtomStruct atoms; extern Space *space_list; extern Space *all_space; extern Space *current_space; extern WorkWindow *work_windows; extern XrmQuark *space_qlist; extern XrmQuark *window_attribq; extern XrmQuark *icon_attribq; extern XrmQuark *global_attribq; extern WSMAttribute *window_attrib_list; extern WSMAttribute *icon_attrib_list; extern WSMAttribute *global_attrib_list; extern int num_window_attrib; extern int num_icon_attrib; extern int num_global_attrib; extern Boolean diffs_allowed; extern Widget shell; extern Display *dsp; extern Boolean connected; static char* GetWMName( Window, Boolean ); static char* GetWMClient( Window, Boolean ); static char* GetWMRole( Window, Boolean ); static char* GetWMCount( XrmQuark,XrmQuark ); XrmQuarkList GetSpecifierQList( Window, Boolean ); void AddWindowToSpace( Space*,WorkWindow* ); char *Get_SM_CLIENT_ID( Display*, Window ); char *Get_WM_WINDOW_ROLE( Display*, Window ); Colormap default_cmap = 0; /**********************************************************************/ /* INTERNAL STRUCTURE CODE */ /**********************************************************************/ /*------------------------------------------------------------------ CreateSpace ------------------------------------------------------------------*/ Space* CreateSpace(XrmQuark name, char *str) { WorkWindowList *w_list; Space *s, *s2; s = (Space*)XtMalloc(sizeof(Space)); s->nameq = name; s->w_list = NULL; if (all_space->w_list != NULL) { w_list = all_space->w_list; while (w_list != NULL) { AddWindowToSpace(s,w_list->work_win); w_list = w_list->next; } } s->next = NULL; strcpy(s->name, str); strcpy(s->background,"None"); strcpy(s->pixmap_name,"None"); s->pixel = 0; s->pixmap = None; s->pixmap_label = None; if (space_list == NULL) { current_space = s; space_list = s; } else { s2 = space_list; while (s2->next != NULL) s2 = s2->next; s2->next = s; } return s; } /*------------------------------------------------------------------ SetSpacePixel ------------------------------------------------------------------*/ Boolean SetSpacePixel(Space *s, char *name) { Boolean retval = True; XColor a_color; XColor def_color; if (default_cmap == 0) default_cmap = DefaultColormap(dsp,0); if (XAllocNamedColor(dsp,default_cmap,name,&a_color, &def_color)==0) return False; s->pixel = a_color.pixel; strcpy(s->background,name); s->pixmap = None; return retval; } /*------------------------------------------------------------------ SpacePixelSet ------------------------------------------------------------------*/ Boolean SpacePixelSet(Space *s) { if (strcmp("None",s->background) == 0) return False; if (s->pixmap != None) return False; else return True; } /*------------------------------------------------------------------ SetSpacePixmap ------------------------------------------------------------------*/ Boolean SetSpacePixmap(Space *s, char *name) { unsigned int width, height; Window root = XRootWindowOfScreen(XtScreen(shell)); s -> pixmap = XmGetPixmapByDepth(XtScreen(shell), name, BlackPixel(XtDisplay(shell), 0), WhitePixel(XtDisplay(shell), 0), DefaultDepth(dsp, 0)); if (s -> pixmap == XmUNSPECIFIED_PIXMAP) { fprintf(stderr, "can't get pixmap for %s\n", name); return False; } s->background[0] = '"'; s->background[1] = '\0'; strcat(s->background,name); PRINT("s->background is %s\n",name); return True; } /*------------------------------------------------------------------ SpacePixmapSet ------------------------------------------------------------------*/ Boolean SpacePixmapSet(Space *s) { if (strcmp("None",s->background) == 0) return False; if (s->pixmap == None) return False; else return True; } /*------------------------------------------------------------------ SetSpaceLabelPixmap ------------------------------------------------------------------*/ Boolean SetSpaceLabelPixmap(Space *s, char *name) { unsigned int width, height; Pixmap bitmap; int status; GC gc; XGCValues values; Window root = XRootWindowOfScreen(XtScreen(shell)); PRINT("setting space %s label pixmap to %s\n", s->name,name); if (strcmp(name,"None") == 0 || strcmp(name,"none")== 0) return False; status = XReadBitmapFile(dsp,root,name,&width,&height,&bitmap, (int *)NULL, (int *)NULL); if (status == BitmapOpenFailed) { fprintf(stderr, "can't open file %s\n", name); return False; } else if (status == BitmapFileInvalid) { fprintf(stderr, "bad bitmap format file: %s\n", name); return False; } else if (status == BitmapNoMemory) { fprintf(stderr, "insufficient memory for bitmap file: %s\n", name); return False; } values.foreground = BlackPixel(XtDisplay(shell),0); values.background = WhitePixel(XtDisplay(shell),0); gc = XCreateGC(dsp,root,GCForeground|GCBackground,&values); if (s->pixmap_label != None) XFreePixmap(dsp,s->pixmap_label); s->pixmap_label = XCreatePixmap(dsp,root,width,height, (unsigned int)DefaultDepth(dsp,0)); XCopyPlane(dsp,bitmap,s->pixmap_label,gc,0,0,width,height,0,0, (unsigned long)1); /* s->pixmap = XCreatePixmapFromBitmapData(dsp,root,name,width,height, BlackPixel(XtDisplay(shell),0), WhitePixel(XtDisplay(shell),0), (unsigned int) DefaultDepth(dsp, DefaultScreen(dsp)));*/ strcpy(s->pixmap_name,name); PRINT("s->pixmap_name is %s\n",name); XFreeGC(dsp, gc); return True; } /*------------------------------------------------------------------ SpaceLabelPixmapSet ------------------------------------------------------------------*/ Boolean SpaceLabelPixmapSet(Space *s) { if (s->pixmap_label == None) return False; else return True; } /*------------------------------------------------------------------ CreateInternalStructure ------------------------------------------------------------------*/ Boolean CreateInternalStructure(WorkWindow *w_window,XrmQuark *rooms_qlist) { Space *space; int j; Boolean in_current_space = False; if (w_window->all_workspaces) { /* create internal structures */ for (j=0, space = space_list; space !=NULL; space = space->next, j++) { if (space == current_space) in_current_space = True; AddSpaceToWindow(space, w_window); AddWindowToSpace(space, w_window); } } else if (rooms_qlist == NULL) { AddSpaceToWindow(current_space,w_window); AddWindowToSpace(current_space,w_window); in_current_space = True; } else { /* create internal structures */ for (j=0; rooms_qlist[j] != NULLQUARK; j++) { space = GetSpace(rooms_qlist[j]); if (space == NULL) space = CreateSpace(rooms_qlist[j], XrmQuarkToString(rooms_qlist[j])); if (space == current_space) in_current_space = True; AddSpaceToWindow(space, w_window); AddWindowToSpace(space, w_window); } } if (w_window->all_workspaces) AddWindowToSpace(all_space,w_window); return in_current_space; } /*------------------------------------------------------------------ CreateWorkWindow ------------------------------------------------------------------*/ WorkWindow* CreateWorkWindow(Window window) { WorkWindow *w, *w2; int i; w = GetWorkWindow(window); /* if wsm already knows about this window then just set mapped = True and return the window */ if (w != NULL) { w->mapped = True; return w; } w = (WorkWindow *)XtMalloc(sizeof(WorkWindow)); w->window = window; w->used = True; switch (_WSMGetConfigFormatType(window)) { case WSM_GLOBAL_FMT: w->attrib_qlist = global_attribq; w->attrib_list = global_attrib_list; w->num_attrib_list = num_global_attrib; w->all_workspaces = True; w->specifier_qlist = GetSpecifierQList(0,False); w->name = GetWMName(0,False); break; case WSM_WINDOW_FMT: w->attrib_qlist = window_attribq; w->attrib_list = window_attrib_list; w->num_attrib_list = num_window_attrib; w->all_workspaces = False; w->specifier_qlist = GetSpecifierQList(window,False); w->name = GetWMName(window,False); break; case WSM_ICON_FMT: w->attrib_qlist = icon_attribq; w->attrib_list = icon_attrib_list; w->num_attrib_list = num_icon_attrib; w->all_workspaces = True; w->specifier_qlist = GetSpecifierQList(window, True); w->name = GetWMName(window,True); break; default: break; } w->next = NULL; w->prev = NULL; w->last_space = NULL; w->s_list = NULL; w->linked = False; w->mapped = True; w->win_data = (WSMWinData*)XtMalloc(w->num_attrib_list*sizeof(WSMWinData)); for (i = 0; i < w->num_attrib_list; i++) { w->win_data[i].nameq = w->attrib_qlist[i]; w->win_data[i].type = WSM_NONE; w->win_data[i].data.value = -1; } if (work_windows == NULL) work_windows = w; else { w2 = work_windows; while (w2->next != NULL) w2 = w2->next; w2->next = w; w->prev = w2; } if (w->all_workspaces) { CreateInternalStructure(w,NULL); UpdateBothList(all_space); } if (_WSMGetConfigFormatType(window) == WSM_WINDOW_FMT) { PRINT("XSelectInput "); print_window(w); XSelectInput(dsp,window,StructureNotifyMask); } return w; } /*------------------------------------------------------------------ ReCreateWorkWindow ------------------------------------------------------------------*/ WorkWindow* ReCreateWorkWindow(Window window) { WorkWindow *w; int i; w = GetWorkWindow(window); if (w == NULL) return CreateWorkWindow(window); switch (_WSMGetConfigFormatType(window)) { case WSM_GLOBAL_FMT: w->attrib_qlist = global_attribq; w->attrib_list = global_attrib_list; w->num_attrib_list = num_global_attrib; break; case WSM_WINDOW_FMT: w->attrib_qlist = window_attribq; w->attrib_list = window_attrib_list; w->num_attrib_list = num_window_attrib; break; case WSM_ICON_FMT: w->attrib_qlist = icon_attribq; w->attrib_list = icon_attrib_list; w->num_attrib_list = num_icon_attrib; break; default: break; } XtFree((XtPointer)w->win_data); w->win_data = (WSMWinData*)XtMalloc(w->num_attrib_list*sizeof(WSMWinData)); for (i = 0; i < w->num_attrib_list; i++) { w->win_data[i].nameq = w->attrib_qlist[i]; w->win_data[i].type = WSM_NONE; w->win_data[i].data.value = -1; } return w; } /*------------------------------------------------------------------ GetSpace ------------------------------------------------------------------*/ Space* GetSpace(XrmQuark name) { Space *s; s = space_list; while (s != NULL) { if (s->nameq == name) return s; s = s->next; } PRINT("returning NULL space\n"); return NULL; } /*------------------------------------------------------------------ GetSpaceFromName ------------------------------------------------------------------*/ Space* GetSpaceFromName(char *name) { Space *s; s = space_list; while (s != NULL) { if (strcmp(s->name,name)== 0) return s; s = s->next; } PRINT("returning NULL space\n"); return NULL; } /*------------------------------------------------------------------ GetNumberSpaces ------------------------------------------------------------------*/ int GetNumberSpaces() { Space *s; int i; for (i = 0, s = space_list; s != NULL; s = s->next, i++); return i; } /*------------------------------------------------------------------ GetWorkWindowID ------------------------------------------------------------------*/ WorkWindow* GetWorkWindowID(Space *s,int wsm_index) { int j =0; WorkWindowList *w_list = s->w_list; while (w_list != NULL) { if (_WSMGetConfigFormatType(w_list->work_win->window) == WSM_WINDOW_FMT) { if (j == wsm_index) return w_list->work_win; j++; } w_list = w_list->next; } return NULL; } /*------------------------------------------------------------------ GetSpaceFromID ------------------------------------------------------------------*/ Space* GetSpaceFromID(int wsm_index) { int j; Space *s; s = space_list; if (s == NULL) return NULL; for (j = 0; j < wsm_index; j++) { if (s == NULL) return NULL; s = s->next; } return s; } /*------------------------------------------------------------------ GetSpaceID ------------------------------------------------------------------*/ int GetSpaceID(Space *space) { int j; Space *s; for (j = 0, s = space_list; s != NULL; s = s->next, j++) { if (s == space) return j; } return -1; } /*------------------------------------------------------------------ GetWorkWindow ------------------------------------------------------------------*/ WorkWindow* GetWorkWindow(Window window) { WorkWindow *w; w = work_windows; while (w != NULL) { if (w->window == window) return w; w = w->next; } return NULL; } /*------------------------------------------------------------------ GetWorkWindowClient ------------------------------------------------------------------*/ /* Boolean #ifndef _NO_PROTO GetWorkWindowClient(Window window, WorkWindow*** w_windows, int *num_w_windows) #else GetWorkWindowClient(window) Window window; WorkWindow ***w_windows; int *num_w_windows; #endif { WorkWindow *w, *i_window; int num_w = 0; WorkWindow **w_wins; Boolean found = False; w = work_windows; while (w != NULL) { if (w->window == window) { main_w = w; found = True; break; } w = w->next; } if (!found) return False; i_window = GetIconWorkWindow(win); if (i_window == NULL) w_wins = (WorkWindow*) XtMalloc(sizeof(WorkWindow*)); else w_wins = (WorkWindow*) XtMalloc(2*sizeof(WorkWindow*)); w_wins[num_w++] = main_w; if (i_window != NULL) w_wins[num_w++] = i_window; client_id = main_w->specifier_qlist[0]; count = main_w->specifier_qlist[2]; w = work_windows; while (w != NULL) { if (w->specifier_qlist[0] == client_id && w->specifier_qlist[2] == count) { w_wins = (WorkWidnow*) XtRealloc(w_wins,(num_w+1) * sizeof(WorkWindow*)); w_wins[num_w] = w; num_w++; } } *w_windows = w_wins; *num_w_windows = num_w; return True; } */ /*------------------------------------------------------------------ GetWorkWindowClientIDs ------------------------------------------------------------------*/ Boolean GetWorkWindowClientIDs(int main_pos, Space *s, int **w_ids, int *num_wids) { WorkWindowList *w_list; int num_w = 0; int *wids; Boolean found = False; int pos; WorkWindow *main_w; XrmQuark client_id, count; w_list = s->w_list; pos = 0; while (w_list != NULL) { if (_WSMGetConfigFormatType(w_list->work_win->window) == WSM_WINDOW_FMT) { if (pos == main_pos) { main_w = w_list->work_win; found = True; break; } pos++; } w_list = w_list->next; } if (!found) return False; wids = (int*) XtMalloc(sizeof(int)); wids[num_w++] = main_pos; client_id = main_w->specifier_qlist[0]; count = main_w->specifier_qlist[2]; w_list = s->w_list; pos = 0; while (w_list != NULL) { if (_WSMGetConfigFormatType(w_list->work_win->window) == WSM_WINDOW_FMT) { if (w_list->work_win->specifier_qlist[0] == client_id && w_list->work_win->specifier_qlist[2] == count && w_list->work_win != main_w) { wids = (int*) XtRealloc((char*)wids,(num_w+1) * sizeof(int)); wids[num_w] = pos; num_w++; } pos++; } w_list = w_list->next; } *w_ids = wids; *num_wids = num_w; return True; } /*------------------------------------------------------------------ GetIconWorkWindow ------------------------------------------------------------------*/ WorkWindow* GetIconWorkWindow(Window window) { WorkWindow *w; w = work_windows; while (w != NULL) { if (w->window == (window | ~WIN_MASK)) return w; w = w->next; } PRINT("returning NULL icon window\n"); return NULL; } /*------------------------------------------------------------------ AddSpaceToWindow ------------------------------------------------------------------*/ void AddSpaceToWindow(Space *s, WorkWindow *w_window) { SpaceList *s_list, *s_list2; s_list = (SpaceList*)XtMalloc(sizeof(SpaceList)); s_list->next = NULL; s_list->space = s; if (w_window->s_list == NULL) { w_window->s_list = s_list; } else { s_list2 = w_window->s_list; if (s_list2->space == s) { XtFree((char*)s_list); return; } while (s_list2->next != NULL) { s_list2 = s_list2->next; if (s_list2->space == s) { XtFree((char*)s_list); return; } } s_list2->next = s_list; } if ((w_window->s_list != NULL) && (w_window->s_list->next != NULL) && (w_window->mapped) && (_WSMGetConfigFormatType(w_window->window) == WSM_WINDOW_FMT)) { EnableDeleteCommand(w_window->window); } UpdateButtons(w_window); } /*------------------------------------------------------------------ AddWindowToSpace ------------------------------------------------------------------*/ void AddWindowToSpace(Space *s, WorkWindow *w_window) { WorkWindowList *w_list,*w_list2; w_list = (WorkWindowList*)XtMalloc(sizeof(WorkWindowList)); w_list->next = NULL; w_list->work_win = w_window; w_list->sib_win = NULL; if (s->w_list == NULL) s->w_list = w_list; else { w_list2 = s->w_list; if (w_list2->work_win == w_window) { XtFree((char*)w_list); return; } while (w_list2->next != NULL) { w_list2 = w_list2->next; if (w_list2->work_win == w_window) { XtFree((char*)w_list); return; } } w_list2->next = w_list; } UpdateBothList(s); } /*------------------------------------------------------------------ RemoveWorkWindowFromSpace ------------------------------------------------------------------*/ void RemoveWorkWindowFromSpace(Space *s, WorkWindow *w_window) { WorkWindowList *w_list,*pw_list; w_list = s->w_list; pw_list = w_list; while (w_list !=NULL) { if (w_list->work_win == w_window) { if (pw_list == w_list) s->w_list = s->w_list->next; else pw_list->next = w_list->next; XtFree((XtPointer)w_list); UpdateBothList(s); return; } if (w_list->sib_win == w_window) w_list->sib_win = NULL; pw_list = w_list; w_list = w_list->next; } return; } /*------------------------------------------------------------------ RemoveSpaceFromWindow ------------------------------------------------------------------*/ void RemoveSpaceFromWindow(Space *s, WorkWindow *w_window) { SpaceList *s_list,*ps_list; s_list = w_window->s_list; ps_list = s_list; while (s_list !=NULL) { if (s_list->space == s) { if (ps_list == s_list) w_window->s_list = w_window->s_list->next; else ps_list->next = s_list->next; XtFree((XtPointer)s_list); if (w_window->s_list != NULL) if (w_window->s_list->next == NULL) DisableDeleteCommand(w_window->window); return; } ps_list = s_list; s_list = s_list->next; } if (w_window->s_list != NULL) if (w_window->s_list->next == NULL) DisableDeleteCommand(w_window->window); UpdateButtons(w_window); } /*------------------------------------------------------------------ RemoveWorkWindow ------------------------------------------------------------------*/ void RemoveWorkWindow(WorkWindow *w_window, Boolean purge) { SpaceList *s_list; WorkWindow *pre_window, *post_window; pre_window = w_window->prev; post_window = w_window->next; s_list = w_window->s_list; while (s_list != NULL) { RemoveWorkWindowFromSpace(s_list->space, w_window); s_list = s_list->next; } if (w_window->all_workspaces) RemoveWorkWindowFromSpace(all_space,w_window); if (work_windows == w_window) work_windows = w_window->next; if (pre_window != NULL) pre_window->next = post_window; if (post_window != NULL) post_window->prev = pre_window; if (purge) (void) PurgeAllWindowConfiguration(shell, w_window->specifier_qlist, w_window->attrib_qlist); XtFree((XtPointer)w_window->win_data); XtFree((XtPointer)w_window); } /*------------------------------------------------------------------ RemoveSpace ------------------------------------------------------------------*/ /* not tested */ void RemoveSpace(Space *space) { WorkWindowList *w_list, *destroy_list; Space *s, *p; w_list = space->w_list; while (w_list != NULL) { RemoveSpaceFromWindow(space,w_list->work_win); destroy_list = w_list; w_list = w_list->next; XtFree((char*)destroy_list); } s = space_list; p = s; while (s != NULL) { if (s == space) { if (p == s) space_list = s->next; else p->next = s->next; } p = s; s = s->next; } XtFree((XtPointer)space); } /*------------------------------------------------------------------ IsWorkWindowInSpace ------------------------------------------------------------------*/ Boolean IsWorkWindowInSpace(WorkWindow *w,Space *s) { WorkWindowList *w_list; if (w->all_workspaces && s!= all_space) return True; w_list = s->w_list; while (w_list != NULL) { if (w_list->work_win == w) return True; w_list = w_list->next; } return False; } /*------------------------------------------------------------------ IsSpaceInWorkWindow ------------------------------------------------------------------*/ Boolean IsSpaceInWorkWindow(Space *s, WorkWindow *w) { SpaceList *s_list; if (w->all_workspaces && s!= all_space) return True; s_list = w->s_list; while (s_list !=NULL) { if (s_list->space == s) return True; s_list = s_list->next; } return False; } /*------------------------------------------------------------------ InitializeWsm ------------------------------------------------------------------*/ void InitializeWsm() { atoms.save_property = XmInternAtom(XtDisplay(shell),"WM_SAVE_YOURSELF",False); atoms.protocols_property = XmInternAtom(XtDisplay(shell),"WM_PROTOCOLS",False); atoms.sm_client_id_property = XmInternAtom(XtDisplay(shell),"_MOTIF_SM_CLIENT_ID",False); atoms.wm_role_property = XmInternAtom(XtDisplay(shell),"_MOTIF_WM_WINDOW_ROLE",False); atoms.wm_client_leader = XmInternAtom(XtDisplay(shell),"WM_CLIENT_LEADER",False); all_space = (Space *)XtMalloc(sizeof(Space)); all_space->nameq = XrmStringToQuark("all"); all_space->w_list = NULL; all_space->next = NULL; current_space = NULL; } /*------------------------------------------------------------------ RestartWsm ------------------------------------------------------------------*/ void CompleteRestartWSM() { Space *s; WorkWindowList *w_list, *destroy_w_list; WorkWindow *w, *destroy_w; SpaceList *s_list, *destroy_s_list; s = space_list; while (s!= NULL) { w_list = s->w_list; while (w_list != NULL) { destroy_w_list = w_list; w_list = w_list->next; XtFree((XtPointer)destroy_w_list); } s->w_list = NULL; s = s->next; } w_list = all_space->w_list; while (w_list != NULL) { destroy_w_list=w_list; w_list = w_list->next; XtFree((XtPointer)destroy_w_list); } all_space->w_list = NULL; all_space->next = NULL; w = work_windows; while (w!= NULL) { destroy_w = w; s_list = w->s_list; while (s_list != NULL) { destroy_s_list = s_list; s_list = s_list->next; XtFree((XtPointer)destroy_s_list); } w = w->next; XtFree((XtPointer)destroy_w); } work_windows = NULL; PRINT("Restarting WSM\n"); } void RestartWSM() { WorkWindow *w; for (w = work_windows; w != NULL; w = w->next) { w->used = False; } } void FinishRestartWSM() { WorkWindow *w; for (w = work_windows; w != NULL; w = w->next) { if (w->used == False) { RemoveWorkWindow(w,False); } } } /*------------------------------------------------------------------ GetWSMWindow ------------------------------------------------------------------*/ Window GetWSMWindow(WorkWindow *w_window) { return (w_window->window); } /*------------------------------------------------------------------ SetWorkWindowValues ------------------------------------------------------------------*/ void SetWorkWindowValues(WorkWindow *w, Boolean all_workspaces, Boolean linked) { if (all_workspaces && !(w->all_workspaces)) { AddWindowToSpace(all_space,w); UpdateBothList(all_space); UpdateButtons(w); } else if (!all_workspaces && w->all_workspaces) { RemoveWorkWindowFromSpace(all_space,w); UpdateBothList(all_space); UpdateButtons(w); } w->all_workspaces = all_workspaces; w->linked = linked; } /*------------------------------------------------------------------ UnmapCurrentSpace ------------------------------------------------------------------*/ void UnmapCurrentSpace() { WorkWindowList *w_list = current_space->w_list; while (w_list!= NULL) { w_list->work_win->mapped = False; w_list = w_list->next; } } /*------------------------------------------------------------------ UnmapWorkWindow ------------------------------------------------------------------*/ void UnmapWorkWindow(WorkWindow *w_window) { w_window->mapped = False; } /*------------------------------------------------------------------ MapWorkWindow ------------------------------------------------------------------*/ void MapWorkWindow(WorkWindow *w_window) { w_window->mapped = True; } /**********************************************************************/ /* This is for testing purposes. */ /**********************************************************************/ char* trimblanks(char *s) { char *p; p = &s[strlen(s)-1]; /* point to last char */ while((*p <= ' ') && p >= s) p--; p++; *p = '\0'; return s; } void translate_for_database(char *s) { int length = strlen(s); int i,j; for (i = 0; i < length; i++) { if (s[i] == ':') { s[i] = '&'; } } } static char* GetWMName(Window window, Boolean is_icon) { XTextProperty textProperty; char *str = NULL; if (window == 0) { str = (char*) XtMalloc((strlen("Global") +1) * sizeof(char)); strcpy(str,"Global"); return str; } if(XGetWMName(dsp, (window & WIN_MASK), &textProperty)) { if (textProperty.encoding == XA_STRING) { if (textProperty.value) { str = (String)textProperty.value; trimblanks(str); if(str[0]) { if (is_icon) { str = (char*)XtRealloc(str,(strlen(str)+2 )* sizeof(char)); strcat(str,"I"); } return str; } } } } strcpy(str, ""); return str; } static char * GetWMClient(Window window, Boolean is_icon) { int format; int status; unsigned long nitems, after; Atom type = None; char *str; status = XGetWindowProperty(dsp, (window & WIN_MASK), atoms.sm_client_id_property, 0L,(long)1000, False, XA_STRING, &type, &format, &nitems, &after, (unsigned char **)&str); if (status == Success) { if (str == NULL) return (NULL); translate_for_database(str); if (is_icon) { str = (char*) XtRealloc((char*)str,(strlen(str)+2) * sizeof(char)); strcat(str,"I"); } return str; } /* * if there's no clientID on this window, then see if it points * to a client leader that has a clientID. */ else { Window leader; /* check for CLIENT_LEADER property. */ status = XGetWindowProperty(dsp, (window & WIN_MASK), atoms.wm_client_leader, 0L,(long)1000, False, XA_WINDOW, &type, &format, &nitems, &after, (unsigned char **)&leader); if (status == Success) { if ((leader == None) || (leader == window)) return (NULL); else return (GetWMClient(leader, is_icon)); } else { /* Old-style client - no WM_CLIENT_ID property */ return (NULL); } } } static char * GetWMRole(Window window, Boolean is_icon) { int format; int status; unsigned long nitems, after; Atom type = None; char *str; status = XGetWindowProperty(dsp, (window & WIN_MASK), atoms.wm_role_property, 0L,(long)1000, False, XA_STRING, &type, &format, &nitems, &after, (unsigned char **)&str); if (status == Success) { if (str == NULL) return (NULL); translate_for_database(str); if (is_icon) { str = (char*) XtRealloc((char*)str,(strlen(str)+2) * sizeof(char)); strcat(str,"I"); } return str; } else return (NULL); } static char * GetWMCount(XrmQuark client, XrmQuark role) { WorkWindow *w; char *str; int count; count = 0; for (w = work_windows; w!= NULL; w = w->next) { if (w->specifier_qlist[0] == client && w->specifier_qlist[1] == role) count++; } str = (String) XtMalloc(4*sizeof(char)); /* if (count == 0) strcpy(str,"*"); else*/ sprintf(str,"%d",count); return str; } XrmQuarkList GetSpecifierQList(Window window, Boolean is_icon) { XrmQuark *specifier; char *client; char *role; char *count; specifier = (XrmQuark*)XtMalloc(4*sizeof(XrmQuark)); if (window != 0) { client = GetWMClient(window, is_icon); if (client == NULL) client = GetWMName(window,is_icon); role = GetWMRole(window, is_icon); if (role == NULL) role = GetWMName(window,is_icon); specifier[0] = XrmStringToQuark(client); specifier[1] = XrmStringToQuark(role); count = GetWMCount(specifier[0],specifier[1]); specifier[2] = XrmStringToQuark(count); specifier[3] = NULLQUARK; XtFree((XtPointer)client); XtFree((XtPointer)role); XtFree((XtPointer)count); } else { specifier[0] = XrmStringToQuark("Global"); specifier[1] = NULLQUARK; } return specifier; } motif-2.3.8/demos/programs/workspace/wsm.man0000644000175000017500000002506512672140200016027 00000000000000.\" $XConsortium: wsm.man /main/4 1995/07/17 10:49:19 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH wsm 1X MOTIF "Demonstration programs" .SH NAME \fBwsm\fR\(emMotif Workspace Manager demo .SH SYNOPSIS .sS \fBwsm\fR [\*Voptions\fR] .sE .SH DESCRIPTION The Motif Workspace Manager (Wsm) uses the new Workspace Manager protocol supported in the Motif Window Manager (Mwm) 2.0. This application will only work with Mwm Version 2.0. .PP Wsm provides a way for users to group windows and applications into workspaces or rooms. Only one room or workspace is visible at one time. By only viewing windows in one workspace at a time, your desktop can be greatly reduced of clutter. .PP With Wsm, it is possible to have one window duplicated in multiple workspaces. These duplicates can be either references to each other, where the width, height, stacking order and other attributes are kept the same in each workspace, or they can be copies, where each instance can have a different position, size, or other attribute from its counterparts in the other workspaces. The term \fBLink\fR is used to refer to duplicates that each reference the same set of attributes. The term \fBCopy\fR is used to refer to duplicates that contain their own attribute sets independent from each other. .P There are two methods of accessing all the functionality of the workspace manager. The first is through commands added by Wsm to Mwm menus. The second is through the interface provided through the initial Wsm dialog. .SS Options Wsm supports the following command-line options: .PP \fB-fileName, -file, -f\fR Specifies the name of the workspace .br manager configuration file. .PP \fB-workspaceList, -wL\fR Specifies the list of workspaces .br to use. .PP \fB-backgroundList, -bL\fR Specifies the background color .br to apply to each of the workspaces. .PP \fB-labelPixmapList, -labelPL\fR .br Specifies the label image to .br use for each of the workspace .br buttons. .PP \fB -currentWorkspace, -cW\fR Specifies the default workspace .br from the list of workspaces. .PP \fB-showWSDialog, -s\fR If True, a \fBmenuBar\fR is displayed .br in the Wsm main dialog window. .br The default is True. .PP .SS "The Mwm Menu Interface" Wsm will add menu entries to Mwm's menus that provide you with the needed tools to use the capabilities of Wsm. Each window menu will be modified by adding the following items: .PP \fBOccupy...\fR This will display a dialog window .br allowing you to select which .br workspaces the associated window .br should be duplicated into. .br The dialog also allows either .br \fBLink\fR or \fBCopy\fR the window .br to each of the selected workspaces. .PP \fBCopy To All\fR This will cause the window to be .br copied to each of the workspaces. .PP \fBLink To All\fR This will cause the window to be .br linked to each of the workspaces. .PP \fBRemove From Workspace\fR This will remove the window from .br this workspace. If the window is .br only in one workspace, then this .br command will be inactive. It is .br not possible to remove a window .br from all workspaces using this .br command. .PP Wsm will modify the root menu (specified by Mwm's resource \fBrootMenu\fR) by adding the following commands: .PP \fBSwitch Workspace\fR This is a cascade menu which .br will cascade to a menu containing .br an entry for each workspace. Selecting .br an item will cause Wsm to swith .br to the corresponding workspace. .PP \fBHide Workspace Manager\fR .br \fB(Show Workspace Manager)\fR .br This will cause the workspace to be .br unmapped (mapped) and the menu item .br label to be switched to .br \fBShow Workspace Manager\fR .br (Hide Workspace Manager). .PP .SS "Wsm Dialog Interface" The Wsm dialog window contains a menu bar and a rowcolumn contining a toggle button associated with each workspace. A popup menu can also be displayed by pressing Button3 in the rowcolumn area. .PP The menu bar contains the following: .PP \fBFile .br ----\fR .PP \fBSave\fR Saves the state of the workspace .br manager and the information it .br holds for each window. .br The data is stored in the workspace .br manager configuration file which, by .br default, is $HOME/.wsmdb. .PP \fBSave As...\fR Prompts for the name of the file .br to save the workspace manager .br data into. .PP \fBQuit\fR Terminates the workspace. .br Note that there may be .br a slight delay before the .br workspace manager fully .br terminates since it does some .br cleaning-up of Mwm's menus .br and removes the items it added. .PP .PP \fBWorkspace .br ---------\fR .PP \fBNew Workspace\fR Creates a new workspace and .br adds to associated toggle .br button to the rowcolumn. .PP \fBRename Workspaces...\fR Displays a dialog window .br you to rename each of the .br workspaces. It also allows .br you to enter a fully qualified .br bitmap to use as the label .br instead of the name. .PP \fBSet Background...\fR This displays a dialog that .br allows you to specify the .br background color of the workspace. .PP \fBConfigure Workspaces...\fR This displays a dialog that .br allows you to move windows .br from one workspace to another. .br In the dialog, two lists are .br displayed. On top of each list .br is an option menu that allows .br you to select the corresponding .br workspace for the windows .br in the list. By selecting a .br window or windows in the left .br list, you can copy or move the to .br the workspace specified in the .br list on the right. By selecting .br \fBRemove\fR, you can, instead, .br remove them from the workspace .br on the left. The buttons at the .br bottom, \fBClient\fR and .br \fBWindow\fR, will cause either .br all windows for a client to .br automatically be selected, .br or individual windows. .PP \fBDelete Workspaces...\fR This displays a dialog prompting .br you to select the workspace(s) .br you with to delete. .PP .PP \fBView .br ----\fR .PP \fBHide Workspace Manager\fR This will cause the workspace .br manager to unmap. Make sure that .br Wsm has inserted the command .br \fBHide Workspace Manager\fR .br into your root menu. If not, then .br you will not be able to restore .br the workspace manager. .PP The popup menu, displayed by pressing Button3 in the workspace rowcolumn contains the following items and matches the descriptions above: .PP \fBNew Workspace .br Rename Workspaces... .br Set Background... .br Configure Workspaces... .br Delete Workspaces... .br ------------------- .br Hide Workspace Manager .br ------------------- .br Save .br Save As... .br ------------------- .br Exit\fR .PP Note, by default the workspace manager does not occupy all workspaces. You should select 'Copy To All' or 'Link To All' the first time Wsm is used. After you have saved your configuration, this is no longer necessary. .PP Wsm supports the following resources: .PP \fBfileName\fR Specifies the name of the workspace .br manager configuration file. .PP \fBworkspaceList\fR Specifies the list of workspaces .br to use. .PP \fBbackgroundList\fR Specifies the background color .br to apply to each of the workspaces. .PP \fBlabelPixmapList\fR Specifies the label image to .br use for each of the workspace .br buttons. .PP \fBcurrentWorkspace\fR Specifies the default workspace .br from the list of workspaces. .PP \fBuseMenuBar\fR If True, a \fBmenuBar\fR is .br displayed in the Wsm main dialog .br window. The default is True. motif-2.3.8/demos/programs/workspace/wsm.c0000644000175000017500000011750613066310437015511 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: wsm.c /main/8 1997/05/02 10:08:35 dbl $" #endif #endif #include #include #include #include #include "wsmSend.h" #include "wsm.h" #include "wsm_ui.h" #include "wsmStruct.h" #include "xrmLib.h" #include "wsmDebug.h" #include "wsmData.h" #include "wsm_cb.h" #include "wsm_create.h" #include "command_ui.h" #include "Wsm/utm_send.h" #include #include #include #include #include #include extern Atom WM_S0; extern Atom _MOTIF_WM_INVOKE_COMMAND; extern Time GetTimestamp (Display *dpy); /* globals */ Widget utmShell; AtomStruct atoms; WSM_UI* wsm_ui; Boolean mwm_gone =False; Boolean mwm_reconnect = False; Boolean diffs_allowed = False; Widget shell; Widget shell_ui; Display *dsp; Space * current_space = NULL; Space *all_space; Space *space_list = NULL; WSMConfigFormatReply *config_format_reply = NULL; XrmQuark *space_qlist; WorkWindow *work_windows; Window mwm_window; IndexStruct wsm_index; int num_window_attrib; int num_icon_attrib; int num_global_attrib; XrmQuark *window_attribq; XrmQuark *icon_attribq; XrmQuark *global_attribq; WSMAttribute *window_attrib_list; WSMAttribute *icon_attrib_list; WSMAttribute *global_attrib_list; Boolean connected = False; char *file_name; Space *from_space; Space *to_space; Boolean wsm_shown; typedef struct { String file_name; String *workspace_list; String *background_list; String *label_pixmap_list; String current_workspace; Boolean show_dialog; Boolean show_menu; } AppData; typedef struct { Window window; Space *from_space; Space *to_space; } CopyStruct; AppData app_data; static String fallbacks[] = { "*title: WSM", "*nameShell.title: Workspace Name", "*backgroundShell.title: Workspace Background", "*deleteShell.title: Delete Workspace", "*configureShell.title: Configure Workspace", "*saveAsShell.title: Save As", "*occupyShell.title: Occupy", "*newButton.labelString: New Workspace", "*nameButton.labelString: Rename Workspaces...", "*configureButton.labelString: Configure Workspaces...", "*deleteButton.labelString: Delete Workspaces...", "*hideButton.labelString: Hide Workspace Manager", "*saveButton.labelString: Save", "*saveAsButton.labelString: Save As...", "*exitButton.labelString: Exit", "*backgroundButton.labelString: Set Background...", "*fileCascade.labelString: File", "*fileCascade.mnemonic: F", "*workspaceCascade.labelString: Workspace", "*workspaceCascade.mnemonic: W", "*viewCascade.labelString: View", "*viewCascade.mnemonic: V", "*saveButton.mnemonic: S", "*saveAsButton.mnemonic: A", "*exitButton.mnemonic: x", "*backgroundButton.mnemonic: B", "*newButton.mnemonic: N", "*nameButton.mnemonic: R", "*configureButton.mnemonic: C", "*deleteButton.mnemonic: D", "*hideButton.mnemonic: H", "*applyButton.labelString: Apply", "*dismissButton.labelString: Dismiss", "*cancelButton.labelString: Cancel", "*okButton.labelString: Ok", "*cancelButton.labelString: Cancel", "*configureShell*titleLabel.labelString: Configure Workspace", "*configureShell*copyButton.labelString: Copy", "*configureShell*linkButton.labelString: Link", "*configureShell*occupyButton.labelString: >> Occupy >>", "*configureShell*moveButton.labelString: >> Move >>", "*configureShell*deleteButton.labelString: Remove", "*configureShell*clientButton.labelString: Window", "*configureShell*windowButton.labelString: Client", "*configureShell.height: 400", "*configureShell.width: 550", "*configureShell*fromForm.leftOffset: 10", "*configureShell*fromForm.rightOffset: 10", "*configureShell*toForm.leftOffset: 10", "*configureShell*toForm.rightOffset: 10", "*configureShell*buttonForm.leftOffset: -75", "*configureShell*toggleRow.topOffset: 50", "*configureShell*separator2.bottomOffset: 5", "*configureShell*dismissButton.bottomOffset:5", "*nameShell*nameTitleLabel.labelString: Workspace Name", "*nameShell*nameLabel.labelString: Workspace Name", "*nameShell*pixmapLabel.labelString: Label Pixmap", "*nameShell*nameList.height: 200", "*nameShell*applyButton.leftPosition: 25", "*nameShell*dismissButton.leftPosition: 55", "*nameShell*nameTitleLabel.topOffset: 5", "*nameShell*nameWindow.leftOffset: 5", "*nameShell*nameWindow.rightOffset: 5", "*nameShell*nameWindow.topOffset: 5", "*nameShell*nameWindow.bottomOffset: 5", "*nameShell*wnameForm.leftOffset: 5", "*nameShell*wnameForm.rightOffset: 5", "*nameShell*pixForm.leftOffset: 5", "*nameShell*pixForm.rightOffset: 5", "*backgroundShell*backgroundTitleLabel.labelString: Workspace Background", "*backgroundShell*backgroundLabel.labelString: Workspace Background", "*backgroundShell*backgroundList.height: 200", "*backgroundShell*applyButton.leftPosition: 25", "*backgroundShell*dismissButton.leftPosition: 55", "*backgroundShell*backgroundTitleLabel.topOffset: 5", "*backgroundShell*backgroundWindow.leftOffset: 5", "*backgroundShell*backgroundWindow.rightOffset: 5", "*backgroundShell*backgroundWindow.topOffset: 5", "*backgroundShell*backgroundWindow.bottomOffset: 5", "*backgroundShell*backgroundForm.leftOffset: 5", "*backgroundShell*backgroundForm.rightOffset: 5", "*deleteShell*deleteTitleLabel.labelString: Delete Workspace", "*deleteShell*deleteList.height: 200", "*deleteShell*applyButton.leftPosition: 0", "*deleteShell*dismissButton.leftPosition: 45", "*deleteShell*deleteTitleLabel.topOffset: 5", "*deleteShell*deleteWindow.leftOffset: 5", "*deleteShell*deleteWindow.rightOffset: 5", "*deleteShell*deleteWindow.topOffset: 5", "*deleteShell*deleteWindow.bottomOffset: 5", "*saveAsShell*saveAsTitleLabel.labelString: Save As", "*saveAsShell*saveAsLabel.labelString: Database Name", "*saveAsShell*okButton.leftPosition: 20", "*saveAsShell*cancelButton.leftPosition: 50", "*saveAsShell*saveAsTitleLabel.topOffset: 5", "*saveAsShell*dbForm.leftOffset: 5", "*saveAsShell*dbForm.rightOffset: 5", "*saveAsShell*dbForm.topOffset: 5", "*saveAsShell*dbForm.bottomOffset: 5", "*occupyShell*occupyTitleLabel.labelString: Occupy Workspace", "*occupyShell*copyButton.labelString: Copy", "*occupyShell*linkButton.labelString: Link", "*occupyShell*okButton.leftPosition: 20", "*occupyShell*cancelButton.leftPosition: 50", "*occupyShell*occupyList.width: 175", "*occupyShell*occupyList.height: 200", "*occupyShell*occupyTitleLabel.topOffset: 5", "*occupyShell*occupyTitleLabel.leftOffset: 5", "*occupyShell*occupyTitleLabel.rightOffset: 5", "*occupyShell*occupyWindow.topOffset: 5", "*occupyShell*occupyWindow.leftOffset: 5", "*occupyShell*occupyWindow.rightOffset: 5", "*occupyShell*toggleRow.topOffset: 5", "*occupyShell*toggleRow.leftOffset: 30", NULL, }; static XtResource resources[] = { { "fileName", "FileName", XtRString, sizeof(String), XtOffsetOf(AppData, file_name), XtRString, (XtPointer) NULL, }, { "workspaceList", "WorkspaceList", XtRStringTable, sizeof(XtRStringTable), XtOffsetOf(AppData, workspace_list), XtRString, (XtPointer) NULL, }, { "backgroundList", "BackgroundList", XtRStringTable, sizeof(XtRStringTable), XtOffsetOf(AppData, background_list), XtRString, (XtPointer) NULL, }, { "labelPixmapList", "LabelPixmapList", XtRStringTable, sizeof(XtRStringTable), XtOffsetOf(AppData, label_pixmap_list), XtRString, (XtPointer) NULL, }, { "currentWorkspace", "CurrentWorkspace", XtRString, sizeof(XtRString), XtOffsetOf(AppData, current_workspace), XtRString, (XtPointer) NULL, }, { "showWSDialog", "ShowWSDialog", XtRBoolean, sizeof(Boolean), XtOffsetOf(AppData, show_dialog), XtRImmediate, (XtPointer) True, }, { "useMenuBar", "UseMenuBar", XtRBoolean, sizeof(Boolean), XtOffsetOf(AppData, show_menu), XtRImmediate, (XtPointer) True, }, }; static XrmOptionDescRec options[] = { {"-fileName", "*fileName", XrmoptionSepArg, NULL}, {"-file", "*fileName", XrmoptionSepArg, NULL}, {"-f", "*fileName", XrmoptionSepArg, NULL}, {"-workspaceList", "*workspaceList", XrmoptionSepArg, NULL}, {"-wL", "*workspaceList", XrmoptionSepArg, NULL}, {"-backgroundList", "*backgroundList", XrmoptionSepArg, NULL}, {"-bL", "*backgroundList", XrmoptionSepArg, NULL}, {"-labelPixmapList", "*labelPixmapList", XrmoptionSepArg, NULL}, {"-labelPL", "*labelPixmapList", XrmoptionSepArg, NULL}, {"-currentWorkspace", "*currentWorkspace", XrmoptionSepArg, NULL}, {"-cW", "*currentWorkspace", XrmoptionSepArg, NULL}, {"-showWSDialog", "showWSDialog", XrmoptionSepArg, NULL}, {"-s", "*showWSDialog", XrmoptionSepArg, NULL}, }; Widget text; static void UTMConvertProc( Widget w, XtPointer clientData, XtPointer callData ); static Boolean WsmConvertProc( Widget, Atom *, Atom *, XtPointer, unsigned long, int, Atom *, XtPointer *, unsigned long *, int * ); static void SetupWsmSignalHandlers( int ); static void QuitWsmSignalHandler( int ); void GetFileName(char **name) { /* get dbase file name */ char *home_name = getenv("HOME"); if (app_data.file_name != NULL) { if (app_data.file_name[0] != '/') { *name = XtMalloc(sizeof(char)*(strlen(home_name)+ 1 + strlen(app_data.file_name)+ 2)); strcpy(*name,home_name); strcat(*name, "/"); strcat(*name,app_data.file_name); } else { *name = XtMalloc(sizeof(char) *(strlen(app_data.file_name) +1)); strcpy(*name,app_data.file_name); } } else { *name = XtMalloc(sizeof(char) *(strlen(home_name) + 9)); strcpy(*name,home_name); strcat(*name, "/.wsmdb"); } } void GetWorkspaces(String *str_table) { char *str, strq[20]; int i; /* get workspaces from resources or from dbase file or default to 4 rooms */ if (app_data.workspace_list != NULL) { for (i = 0; app_data.workspace_list[i] != NULL; i++) { sprintf(strq,"Room%d",i+1); str = (char*) XtMalloc((strlen(app_data.workspace_list[i]) +1) * sizeof(char)); strcpy(str, app_data.workspace_list[i]); CreateSpace(XrmStringToQuark(strq),str); XtFree(str); } } else if (str_table != NULL) { for (i = 0; str_table[i] != NULL; i++) { sprintf(strq,"Room%d",i+1); str = (char*) XtMalloc((strlen(str_table[i]) +1) * sizeof(char)); strcpy(str, str_table[i]); CreateSpace(XrmStringToQuark(strq),str); XtFree(str); } } else { str = (char*) XtMalloc( 8* sizeof(char)); for (i = 1; i < 5; i++) { sprintf(str,"Room%d",i); CreateSpace(XrmStringToQuark(str), str); } XtFree(str); } } void GetBackgrounds(String *str_table) { int i; Space *space; char *cptr; /* get backgrounds from resources or from dbase file or default to None */ if (app_data.background_list != NULL) { for (i = 0; app_data.background_list[i] != NULL; i++) { space = GetSpaceFromID(i); if (space != NULL) { if (app_data.background_list[i][0] == '"') { cptr = app_data.background_list[i]+1; SetSpacePixmap(space, cptr); } else SetSpacePixel(space,app_data.background_list[i]); } } } else if (str_table != NULL) { for (i = 0; str_table[i] != NULL; i++) { space = GetSpaceFromID(i); if (space != NULL) { if (str_table[i][0] == '"') { cptr = str_table[i] +1; SetSpacePixmap(space,cptr); } else SetSpacePixel(space,str_table[i]); } XtFree((XtPointer)str_table[i]); } } } void GetPixmaps(String *str_table) { int i; Space *space; /* get pixmap labels from resources or from dbase file or default to None */ if (app_data.label_pixmap_list != NULL) { for (i = 0; app_data.label_pixmap_list[i] != NULL; i++) { space = GetSpaceFromID(i); if (space != NULL) { SetSpaceLabelPixmap(space,app_data.label_pixmap_list[i]); } } } else if (str_table != NULL) { for (i = 0; str_table[i] != NULL; i++) { space = GetSpaceFromID(i); if (space != NULL) { SetSpaceLabelPixmap(space,str_table[i]); } XtFree((XtPointer)str_table[i]); } XtFree((XtPointer)str_table); } } void GetCurrentSpace(String str) { Space *s; PRINT("getting current space\n"); /* get current space from resources or from dbase file */ if (app_data.current_workspace != NULL) { PRINT("from app_data\n"); s = GetSpaceFromName(app_data.current_workspace); if (s == NULL) s = GetSpace(XrmStringToQuark(app_data.current_workspace)); if (s != NULL) current_space = s; } else if (str != NULL) { PRINT("from str\n"); s = GetSpaceFromName(str); if (s == NULL) s = GetSpace(XrmStringToQuark(str)); if (s != NULL) current_space = s; } PRINT("Current space %s\n", current_space->name); } void GetShowWSDialog(Boolean *s_dialog) { /* get dbase file name */ if (app_data.show_dialog == False) { *s_dialog = False; } } #ifdef _ERROR_HANDLERS int MyXErrorHandler(Display *display, XErrorEvent *event) { PRINT("Called MyXErrorHandler XXXXXXXXXXXXXXXXXXXXXXX\n"); return(0); } void MyXtErrorHandler(char *err) { PRINT("Called MyXtErrorHandler Xt Xt Xt Xt Xt Xt Xt Xt Xt\n"); return; } #endif int main(argc, argv) int argc; char **argv; { XtAppContext app_con; Widget rc; Arg args[20]; Atom wsm_0_atom; Cardinal num_args = 0; XEvent event; Widget Shell001; Widget Shell001a; Widget Shell002; Widget Shell003; Widget Shell004; Widget Shell005; Time time; int argcnt; String *str_table,*b_str_table,*lp_str_table; String current_space_str; Boolean show_dialog = True; shell = XtAppInitialize(&app_con, "WSM", options, XtNumber(options), &argc, argv, fallbacks, args, num_args); XtRealizeWidget(shell); utmShell = XtVaCreateManagedWidget("utmShell", xmDrawingAreaWidgetClass, shell, NULL); XtAddCallback(utmShell, XmNconvertCallback, UTMConvertProc, NULL); #ifdef NO_TIMERS XtSetSelectionTimeout(5000000); #endif #ifdef _ERROR_HANDLERS XSetErrorHandler(MyXErrorHandler); XtAppSetErrorHandler(app_con,MyXtErrorHandler); #endif dsp = XtDisplay(shell); XtVaSetValues(shell,XmNallowShellResize,True,NULL); app_data.show_dialog = show_dialog; XtVaGetApplicationResources(shell, &app_data, resources, XtNumber(resources), NULL); InitializeWsm(); GetFileName(&file_name); PRINT("FILE NAME %s\n", file_name); InitializeXrm(file_name); GetSpaceListResources(shell, &str_table, &b_str_table, &lp_str_table, ¤t_space_str, &show_dialog); GetWorkspaces(str_table); GetBackgrounds(b_str_table); GetPixmaps(lp_str_table); GetCurrentSpace(current_space_str); GetShowWSDialog(&show_dialog); PrintAllSpaces(); wsm_shown = show_dialog; wsm_ui = (WSM_UI*)XtMalloc(sizeof(WSM_UI)); wsm_0_atom = XInternAtom(XtDisplay(shell), "WSM_S0", False); InitializeInterface(wsm_ui); if (XGetSelectionOwner(XtDisplay(shell), wsm_0_atom) != None) { fprintf(stderr, "Someone owms the WSM selection on screen 0.\n"); exit(1); } rc = CreateWorkspacePanel(shell, wsm_ui, app_data.show_menu); XtAddCallback(shell, XmNpopdownCallback, QuitCB, (XtPointer)NULL); /* This arglist is used for all of the dialogs created below */ argcnt = 0; XtSetArg(args[argcnt], XmNdeleteResponse, XmUNMAP); argcnt++; Shell001 = XtCreatePopupShell("nameShell", topLevelShellWidgetClass, shell, args, argcnt); CreateNameWorkspace(Shell001, wsm_ui); Shell001a = XtCreatePopupShell("backgroundShell", topLevelShellWidgetClass, shell, args, argcnt); CreateBackgroundWorkspace(Shell001a, wsm_ui); Shell002 = XtCreatePopupShell("deleteShell", topLevelShellWidgetClass, shell, args, argcnt); CreateDeleteWorkspace(Shell002, wsm_ui); Shell003 = XtCreatePopupShell("configureShell", topLevelShellWidgetClass, shell, args, argcnt); CreateConfigureWorkspace(Shell003, wsm_ui); Shell004 = XtCreatePopupShell("saveAsShell", topLevelShellWidgetClass, shell, args, argcnt); CreateSaveAs(Shell004, wsm_ui); #ifndef _NO_OCCUPY_DIALOG Shell005 = XtCreatePopupShell("occupyShell", topLevelShellWidgetClass, shell, args, argcnt); CreateOccupyWorkspace(Shell005, wsm_ui); #endif XtManageChild(rc); SetSpaceBackground(current_space); InternStuff(dsp); atoms.own_selection = _WSMGetSelectionAtom (dsp, XScreenNumberOfScreen(XtScreen(shell)), WSM_WORKSPACE_MANAGER); PRINT("own selection: %s\n",XGetAtomName(dsp,atoms.own_selection)); if (XGetSelectionOwner(dsp, atoms.own_selection) != None) { fprintf(stderr, "Error - Someone out there already owns this selection.\n"); exit(1); } WSMRegisterRequestCallback(dsp, XScreenNumberOfScreen(XtScreen(shell)), RequestReceived,NULL); /* * Setup destination proc - use UTMDestinationProc from utm_send.c module. * Any requests made MUST then use UTMSendMesage. * Also setup own convert proc. * * Note - convertProc was setup when utmShell was created. */ XtAddCallback(utmShell, XmNdestinationCallback, UTMDestinationProc, NULL); time = GetTimestamp(dsp); XmeNamedSource(utmShell, atoms.own_selection, time); SendConnect(utmShell); if (!show_dialog) XtUnmapWidget(shell); SetupWsmSignalHandlers(0); for (;;) { XtAppNextEvent(app_con, &event); if (event.type == ClientMessage) { DealWithClientMessage(rc,(XClientMessageEvent *)&event); } if(event.type == DestroyNotify) { DealWithDestroyNotify(rc,(XDestroyWindowEvent *) &event); } if(event.type == MapNotify) { DealWithMapNotify(rc,(XMapEvent *) &event); } if(event.type == UnmapNotify) { DealWithUnmapNotify(rc,(XUnmapEvent *) &event); } if(XtDispatchEvent(&event)) continue; } return 0; } /* Function Name: UTMConvertProc * Description: This is the UTM conversion proc called when a request * comes in that we need to process. * Arguments: w - The widget making the request. * clientData - not used. * callData - the UTM convert callback structure. */ static void UTMConvertProc(Widget w, XtPointer clientData, XtPointer callData) { int scr = XScreenNumberOfScreen(XtScreen(w)); Display *dsp = XtDisplay(w); XmConvertCallbackStruct *ccs = (XmConvertCallbackStruct *)callData; Atom lose_sel = XInternAtom(dsp, "_MOTIF_LOSE_SELECTION", False); Atom wm_sel = _WSMGetSelectionAtom(dsp, scr, WSM_WINDOW_MANAGER); Atom wsm_sel = _WSMGetSelectionAtom(dsp, scr, WSM_WORKSPACE_MANAGER); /* * Check if the callback was invoked for the right reason. * The reason field is not set to anything interresting by the transfer * code, so check the selection. */ if ((!ccs) || ((ccs->selection != wm_sel) && (ccs->selection != wsm_sel))) return; if (ccs->target == lose_sel) { /* Done with the conversion - free any data used. */ } /* * Handle a conversion request with parameter data. */ else { WsmConvertProc (w, &(ccs->selection), &(ccs->target), ccs->parm, ccs->parm_length, ccs->parm_format, &(ccs->type), &(ccs->value), &(ccs->length), &(ccs->format)); } } static Boolean WsmConvertProc(Widget w, Atom *selection, Atom *target, XtPointer input, unsigned long input_len, int input_fmt, Atom *return_type, XtPointer *output, unsigned long *output_len, int *output_fmt) { WSMDispInfo *disp_info; PRINT("WsmConvertProc target is %s\n",XGetAtomName(dsp,*target)); disp_info = _WSMGetDispInfo(XtDisplay(w)); if (*target == disp_info->targets) { *return_type = XA_STRING; *output = (XtPointer) (long) WSMGetTargetList(w, TRUE, output_len); *output_fmt = 32; return(True); } /* * The only target this handles not included in the * WSM Protocol is INVOKE_COMMAND. Check for this here. * If new targets are added later, they may be added here. */ if (*target == _MOTIF_WM_INVOKE_COMMAND) { /* ||| CARD8 type? */ InvokeCommand(w, *target, (CARD8*)input, input_len, input_fmt); return (TRUE); } if (!WSMIsKnownTarget(w, *target)) { PRINT("isn't known target\n"); return (False); } else { PRINT ("is known target \n"); if (WSMProcessProtoTarget(w, *target, input, input_len, input_fmt, return_type, output, output_len, output_fmt)) return(TRUE); } return(False); } void SendExtensionsProc(XtPointer client_data, XtIntervalId *int_id) { Widget w = (Widget)client_data; SendExtensionCB(w,NULL,NULL); } /*ARGSUSED*/ void RequestReceived(Widget w, XtPointer textp, WSMRequest *request, WSMReply *reply) { Boolean version_found = False; int i; PRINT("RequestReceived\n"); reply->any.allocated = True; switch (reply->any.type = request->any.type) { case WSM_CONNECT: { /* send versions in decending order */ for (i = 0; i < request->connect.num_versions; i++) if (request->connect.known_versions[i] == 1 || request->connect.known_versions[i] == 2 || request->connect.known_versions[i] == 3) { reply->connect.version = request->connect.known_versions[i]; version_found = True; break; } if (!version_found) reply->connect.version = 0; if (connected) { RestartWSM(); connected = False; } mwm_reconnect = True; SendExtensionCB(w,NULL,NULL); } break; case WSM_REG_WINDOW: { PRINT("wsm: get Register reply\n"); if (connected) { GetRegisterWindowReply(request->register_window.window,reply); print_reply(reply); } else { reply->register_window.allocated = False; reply->register_window.num_window_data = 0; reply->register_window.window_data = NULL; } PRINT(" got it\n"); } break; case WSM_EXTENSIONS: case WSM_CONFIG_FMT: case WSM_GET_STATE: case WSM_SET_STATE: case WSM_WM_GET_BACKGROUND_WINDOW: case WSM_WM_SET_BACKGROUND_WINDOW: case WSM_WM_WINDOWS: case WSM_WM_FOCUS: case WSM_WM_POINTER: case WSM_UNKNOWN: /* Not handled cases */ break; } /* * If we had allocated any data here we need to ask the * library to free it, see comments in WSMDefaultOwnSelection for * details. */ } void SendConnect(Widget w) { WSMRequest request; static short versions[] = { 3,2,1 }; Display *dsp = XtDisplay(w); int scr = XScreenNumberOfScreen(XtScreen(shell)); Atom wm_selection = _WSMGetSelectionAtom(dsp, scr, WSM_WINDOW_MANAGER); if (XGetSelectionOwner(dsp, wm_selection) == None) return; PRINT("send connect\n"); if (connected == False) { request.any.type = WSM_CONNECT; request.connect.allocated = False; request.connect.known_versions = versions; request.connect.num_versions = XtNumber(versions); WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveConnectRCB, NULL); } } void ReceiveConnectRCB(Widget w, XtPointer call, WSMReply *reply, WSMErrorCode error) { PRINT("receive connect\n"); if (reply != NULL) { SendExtensionCB(w,call,call); } else PRINT("receive connect == NULL\n"); } void SendExtensionCB(Widget w, XtPointer client,XtPointer call) { WSMRequest request; static String extensions[] = { "Test", "Extension #1", "Extension #123" }; request.any.type = WSM_EXTENSIONS; request.extensions.extension_suggestions = extensions; request.extensions.num_extensions = 3; request.extensions.allocated = False; WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveExtensionsRCB, call); } void ReceiveExtensionsRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { if (reply != NULL ) { SendConfigCB(w,client, client); } else { PRINT(" extension reply == NULL\n"); SendConfigCB(w,client,client); } } void SendConfigCB(Widget w, XtPointer client, XtPointer call) { WSMRequest request; request.any.type = WSM_CONFIG_FMT; WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveConfigRCB, call); } Boolean find_format(XrmQuark nameq, XrmQuark *nameq_list, int num_list) { int i; for (i = 0; i < num_list; i++) { if (nameq == nameq_list[i]) return True; } return False; } void ReceiveConfigRCB(Widget w, XtPointer call, WSMReply *reply, WSMErrorCode error) { int i,j; XrmQuark hideq = XrmStringToQuark("hidden"); XrmQuark iconicq = XrmStringToQuark("iconic"); if (mwm_reconnect) { if (num_global_attrib != reply->config_format.num_global_formats) mwm_reconnect = False; for (i = 0; i < reply->config_format.num_global_formats && mwm_reconnect; i++) { if (global_attribq[i] != reply->config_format.global_formats[i].nameq || global_attrib_list[i].size != reply->config_format.global_formats[i].size || global_attrib_list[i].is_list != reply->config_format.global_formats[i].is_list) mwm_reconnect = False; } if (num_window_attrib != reply->config_format.num_window_formats) mwm_reconnect = False; for (i = 0; i < reply->config_format.num_window_formats && mwm_reconnect; i++) { if (window_attribq[i] != reply->config_format.window_formats[i].nameq || window_attrib_list[i].size != reply->config_format.window_formats[i].size || window_attrib_list[i].is_list != reply->config_format.window_formats[i].is_list) mwm_reconnect = False; } for (i = 0; i < reply->config_format.num_icon_formats && mwm_reconnect; i++) { if ( icon_attribq[i] != reply->config_format.icon_formats[i].nameq || icon_attrib_list[i].size != reply->config_format.icon_formats[i].size || icon_attrib_list[i].is_list != reply->config_format.icon_formats[i].is_list) mwm_reconnect = False; } if (!mwm_reconnect) CompleteRestartWSM(); } if (reply != NULL && !mwm_reconnect) { diffs_allowed =reply->config_format.accepts_diffs; global_attrib_list= (WSMAttribute*) XtMalloc(reply->config_format.num_global_formats * sizeof(WSMAttribute)); global_attribq = (XrmQuark*)XtMalloc((1+reply->config_format.num_global_formats) * sizeof(XrmQuark)); window_attrib_list = (WSMAttribute*)XtMalloc(reply->config_format.num_window_formats * sizeof(WSMAttribute)); window_attribq = (XrmQuark*)XtMalloc((1+reply->config_format.num_window_formats) * sizeof(XrmQuark)); icon_attrib_list = (WSMAttribute*)XtMalloc(reply->config_format.num_icon_formats * sizeof(WSMAttribute)); icon_attribq = (XrmQuark*)XtMalloc((1+reply->config_format.num_icon_formats) * sizeof(XrmQuark)); wsm_index.hide = -1; wsm_index.iconic = -1; for (i = 0; i < reply->config_format.num_global_formats; i++) { global_attrib_list[i].nameq = global_attribq[i] = reply->config_format.global_formats[i].nameq; global_attrib_list[i].size = reply->config_format.global_formats[i].size; global_attrib_list[i].is_list = reply->config_format.global_formats[i].is_list; } global_attribq[i] = NULLQUARK; num_global_attrib = i; for (i = 0; i < reply->config_format.num_window_formats; i++) { if (reply->config_format.window_formats[i].nameq == hideq) wsm_index.hide = i; if (reply->config_format.window_formats[i].nameq == iconicq) wsm_index.iconic = i; window_attrib_list[i].nameq = window_attribq[i] = reply->config_format.window_formats[i].nameq; window_attrib_list[i].size = reply->config_format.window_formats[i].size; window_attrib_list[i].is_list = reply->config_format.window_formats[i].is_list; } window_attribq[i] = NULLQUARK; num_window_attrib = i; for (i = 0; i < reply->config_format.num_icon_formats; i++) { icon_attrib_list[i].nameq = icon_attribq[i] = reply->config_format.icon_formats[i].nameq; icon_attrib_list[i].size = reply->config_format.icon_formats[i].size; icon_attrib_list[i].is_list = reply->config_format.icon_formats[i].is_list; } icon_attribq[i] = NULLQUARK; num_icon_attrib = i; config_format_reply = &(reply->config_format); } if (reply != NULL) { SendStartGetStateCB(w,call,call); } } void SendStartGetStateCB(Widget w, XtPointer call, XtPointer client) { WSMRequest request; PRINT("wsm: send start get state\n"); request.get_state.window = (Window)0; request.get_state.diffs_allowed = False; request.any.type = WSM_GET_STATE; WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, SendStartSetStateRCB, call); } void SendStartSetStateRCB(Widget w, XtPointer call, WSMReply *reply, WSMErrorCode error) { WSMRequest request; if (reply != NULL) { if (reply->any.type == WSM_GET_STATE && config_format_reply != NULL) { CreateStartStateRequest(&(reply->get_state), &request); WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveSetStateRCB, call); } } } void ReceiveSetStateRCB(Widget w, XtPointer call, WSMReply *reply, WSMErrorCode error) { Atom mwm_selection; WorkWindow *w_window; SetInitialCommands(); w_window = work_windows; for (w_window = work_windows; w_window != NULL; w_window = w_window->next) if (w_window->s_list != NULL) if (w_window->s_list->next == NULL) DisableDeleteCommand(w_window->window); connected = True; mwm_gone = False; mwm_reconnect = False; mwm_selection = _WSMGetSelectionAtom(dsp, XScreenNumberOfScreen(XtScreen(shell)),WSM_WINDOW_MANAGER); mwm_window = XGetSelectionOwner(dsp, mwm_selection); if ( mwm_window != None) { XSelectInput(dsp,mwm_window,StructureNotifyMask); } PRINT("CONNECTED!\n"); } void SendSaveWsm(char *file_name) { WSMRequest request; request.get_state.window = 0; request.get_state.diffs_allowed = False; request.any.type = WSM_GET_STATE; PRINT("wsm: WSMSendMessage WSM_GET_STATE %s\n", file_name); WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveSaveWsmRCB, (XtPointer)file_name); } void SendLeaveRoom(Space *s) { WSMRequest request; request.get_state.window = 0; request.get_state.diffs_allowed = False; request.any.type = WSM_GET_STATE; PRINT("wsm: WSMSendMessage WSM_GET_STATE\n"); WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveLeaveRoomRCB, (XtPointer)s); } void ReceiveSaveWsmRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { char *file_name = (char*) client; if (reply != NULL) { if (reply->any.type == WSM_GET_STATE) { PRINT("wsm: save\n"); SaveState(&(reply->get_state),False); PRINT("wsm: done\n\n"); } } UpdateXrm(); SaveWsmToFile(file_name); } void ReceiveLeaveRoomRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { if (reply != NULL) { if (reply->any.type == WSM_GET_STATE) { PRINT("wsm: save\n"); SaveState(&(reply->get_state),False); PRINT("wsm: done\n\n"); ChangeRoomCB(w,client,NULL); } } } void ReceiveEnterRoomRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { PRINT("finished entering room\n"); } void ChangeRoomCB(Widget w, XtPointer client, XtPointer call) { WSMRequest request; Space *space = (Space*)client; PRINT("wsm: Get SET_STATE request\n"); if (space != NULL) { GetChangeSpaceRequest(space,&request); WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveEnterRoomRCB, NULL); SetSpaceBackground(space); } } void ReceiveCopyMoveRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { PRINT("receive copy/move\n"); } void CopyWindow(WorkWindow *w_window, Space *from_s, Space* to_s) { WSMRequest request; CopyStruct *copy_struct; from_space = from_s; to_space = to_s; PrintAllSpaces(); if (w_window != NULL) { print_window(w_window); if (from_space == current_space && w_window->mapped) { copy_struct = (CopyStruct *)XtMalloc(sizeof(CopyStruct)); copy_struct->window = w_window->window; copy_struct->to_space = to_s; copy_struct->from_space = from_s; request.get_state.window = w_window->window; request.get_state.diffs_allowed = True; request.any.type = WSM_GET_STATE; PRINT("Sending Get State \n"); WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, CopyRCB, (XtPointer)copy_struct); } else if (GetCopyWindowRequest(w_window->window, from_space, to_space, &request)) WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveCopyMoveRCB, NULL); } else PRINT("copy null window\n"); } void CopyRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { WSMRequest request; CopyStruct *copy_struct = (CopyStruct*)client; PRINT("Received get state\n"); if (reply != NULL) { if (reply->any.type == WSM_GET_STATE) { PRINT("calling SaveState\n"); SaveState(&(reply->get_state), True); } if (GetCopyWindowRequest(copy_struct->window, copy_struct->from_space, copy_struct->to_space, &request)) WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveCopyMoveRCB, NULL); } XtFree((XtPointer)copy_struct); } void MoveWindow(WorkWindow *w_window, Space *from_s, Space* to_s) { WSMRequest request; from_space = from_s; to_space = to_s; if (w_window != NULL) { if (from_space == current_space) { request.get_state.window = w_window->window; request.get_state.diffs_allowed = True; request.any.type = WSM_GET_STATE; WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, MoveRCB, (XtPointer)w_window->window); } else if (GetMoveWindowRequest(w_window->window, from_space, to_space, &request)) WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveCopyMoveRCB, NULL); } } void MoveRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { WSMRequest request; if (reply != NULL) { SaveState(&(reply->get_state), True); if (GetMoveWindowRequest((Window)client, from_space, to_space, &request)) { WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveCopyMoveRCB, NULL); } } } void DeleteWindow(WorkWindow *w_window, Space *from_s) { WSMRequest request; from_space = from_s; if (w_window != NULL) { if (GetDeleteWindowRequest(w_window->window, from_space,&request)) WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveCopyMoveRCB, NULL); } } void LinkWindow(WorkWindow *w_window, Space *from_s, Space *to_s) { WSMRequest request; CopyStruct *copy_struct; from_space = from_s; to_space = to_s; if (w_window != NULL) { if (from_space == current_space) { copy_struct = (CopyStruct *)XtMalloc(sizeof(CopyStruct)); copy_struct->window = w_window->window; copy_struct->to_space = to_s; copy_struct->from_space = from_s; request.get_state.window = w_window->window; request.get_state.diffs_allowed = True; request.any.type = WSM_GET_STATE; WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, LinkRCB, (XtPointer)copy_struct); } else if (GetLinkWindowRequest(w_window->window, from_space, to_space, &request)) WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveCopyMoveRCB, NULL); } else PRINT("copy null window\n"); } void LinkRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { WSMRequest request; CopyStruct *copy_struct = (CopyStruct*)client; if (reply != NULL) { SaveState(&(reply->get_state),True); if (GetLinkWindowRequest(copy_struct->window, copy_struct->from_space, copy_struct->to_space, &request)) WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ReceiveCopyMoveRCB, NULL); } XtFree((XtPointer)copy_struct); } /* This function doesn't appear to be used anywhere */ #ifdef notdef void BackgroundRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { Window windowID = reply->get_background.window; GC gc; unsigned int root_width, root_height; XGCValues values; Window rootWindow = XRootWindowOfScreen(XtScreen(shell)); gc = XCreateGC(dsp,rootWindow,0,&values); XSetBackground(dsp,gc,WhitePixel(dsp,0)); PRINT("background reply returned. %d %d\n", windowID, rootWindow); XFillRectangle(dsp,rootWindow,gc,0,0,root_width,root_height); } #endif void SetSpaceBackground(Space *space) { if (SpacePixelSet(space)) { PRINT("setting background color\n"); XSetWindowBackground(dsp, XRootWindowOfScreen(XtScreen(shell)), space->pixel); XClearWindow(dsp,XRootWindowOfScreen(XtScreen(shell))); } else if (SpacePixmapSet(space)) { PRINT("setting background pixmap\n"); XSetWindowBackgroundPixmap(dsp,XRootWindowOfScreen(XtScreen(shell)), space->pixmap); XClearWindow(dsp,XRootWindowOfScreen(XtScreen(shell))); } } void QuitCB(Widget w, XtPointer client, XtPointer call) { PRINT("QUITCB\n"); ManageAllWindowsAndExit(); } void ManageAllWindowsAndExit() { WSMRequest request; PRINT("ManageAllWindowsAndExit()\n"); if (!mwm_gone) { if (GetManageAllWindowsRequest(&request)) WSMSendMessage(utmShell, WSM_WINDOW_MANAGER, &request, ExitRCB, NULL); else CleanUpAndExit(); } else exit(0); } void ExitRCB(Widget w, XtPointer client, WSMReply *reply, WSMErrorCode error) { CleanUpAndExit(); } void CleanUpAndExit() { if (!mwm_gone) RemoveAllCommandsAndExit(); } /*************************************<->************************************* * * SetupWsmSignalHandlers () * * * Description: * ----------- * This function sets up the signal handlers for the workspace manager. * *************************************<->***********************************/ /*ARGSUSED*/ static void SetupWsmSignalHandlers (int dummy) { void (*signalHandler) (); signalHandler = (void (*)())signal (SIGINT, SIG_IGN); if (signalHandler != (void (*)())SIG_IGN) { signal (SIGINT, QuitWsmSignalHandler); } signalHandler = (void (*)())signal (SIGHUP, SIG_IGN); if (signalHandler != (void (*)())SIG_IGN) { signal (SIGHUP, QuitWsmSignalHandler); } signal (SIGQUIT, QuitWsmSignalHandler); signal (SIGTERM, QuitWsmSignalHandler); } /* END OF FUNCTION SetupWsmSignalHandlers */ /*************************************<->************************************* * * QuitWsmSignalHandler () * * * Description: * ----------- * This function is called on receipt of a signal that is to terminate the * workspace manager. * *************************************<->***********************************/ /*ARGSUSED*/ static void QuitWsmSignalHandler (int dummy) { ManageAllWindowsAndExit(); XFlush(dsp); } /* END OF FUNCTION QuitWsmSignalHandler */ motif-2.3.8/demos/programs/workspace/wsmSend.c0000644000175000017500000012537413066310437016325 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: wsmSend.c /main/7 1997/03/31 14:15:32 dbl $" #endif #endif #include #include #include "wsm.h" #include "wsmSend.h" #include "xrmLib.h" #include "wsmData.h" #include "wsmDebug.h" #include "wsmStruct.h" #include "command_ui.h" /* Globals */ extern AtomStruct atoms; extern Boolean mwm_gone; extern Window mwm_window; extern Space *space_list; extern Space *all_space; extern Space *current_space; extern WorkWindow *work_windows; extern XrmQuark *space_qlist; extern XrmQuark *window_attribq; extern XrmQuark *icon_attribq; extern XrmQuark *global_attribq; extern IndexStruct wsm_index; extern WSMAttribute *window_attrib_list; extern WSMAttribute *icon_attrib_list; extern WSMAttribute *global_attrib_list; extern int num_window_attrib; extern int num_icon_attrib; extern int num_global_attrib; extern Boolean diffs_allowed; extern Widget shell; extern Display *dsp; extern Boolean connected; extern char *file_name; extern Boolean mwm_reconnect; static XrmQuark linkedRoomQuark; /*------------------------------------------------------------------ GetDataListStart ------------------------------------------------------------------*/ static void GetDataListStart(WorkWindow *w_window, int i, XrmQuark room_q, Boolean diffs, WSMGetStateReply *get_state, WSMWinData **data_list, int *num_data) { XrmValue *attr_values; /* get window attributes from database */ GetWindowConfigurationEntry(w_window->specifier_qlist, w_window->attrib_qlist, room_q, &attr_values); /* create set state request */ /* print_values(attr_values,w_window->attrib_qlist, room_q, w_window->num_attrib_list);*/ /* use WSM_GET_STATE to initialize data structures */ /* fill in data_list and num_data for WSM_SET_STATE request */ if (get_state != NULL) CreateStartWSMWinData(attr_values, diffs, get_state->win_info_list[i].data_list, get_state->win_info_list[i].num_data_list, w_window, data_list, num_data); else CreateStartWSMWinData(attr_values, diffs, NULL, 0, w_window, data_list, num_data); if (attr_values != NULL) XtFree((XtPointer)attr_values); } /*------------------------------------------------------------------ GetDataList ------------------------------------------------------------------*/ static void GetDataList(WorkWindow *w_window, XrmQuark room_q, Boolean diffs, WSMWinData **data_list, int *num_data) { XrmValue *attr_values; /* get window configuration from database */ GetWindowConfigurationEntry(w_window->specifier_qlist, w_window->attrib_qlist, room_q, &attr_values); /* create set state request */ /* print_values(attr_values,w_window->attrib_qlist, room_q, w_window->num_attrib_list);*/ /* fill in data_list and num_data for WSM_SET_STATE request */ CreateWSMWinData(attr_values, diffs, w_window, data_list, num_data); if (attr_values != NULL) XtFree((XtPointer)attr_values); } /*------------------------------------------------------------------ GetUnhideDataList ------------------------------------------------------------------*/ static void GetUnhideDataList(WorkWindow *w_window, XrmQuark room_q, WSMWinData **data_list, int *num_data) { /* fill in data_list and num_data for WSM_SET_STATE request */ CreateUnhideWSMWinData(NULL, w_window, data_list, num_data); } /*------------------------------------------------------------------ CreateStartStateRequest ------------------------------------------------------------------*/ void CreateStartStateRequest(WSMGetStateReply *get_state, WSMRequest *request) { Window window; int i; XrmQuarkList rooms_qlist = NULL; WSMWinData *xrm_data_list; int num_xrm_data_list; WorkWindow *w_window = NULL; Boolean linked = False; Boolean all_work = False; int num_win; WSMWinInfo *win_info; Boolean in_current_space = False; XrmQuark room_name = NULLQUARK; /* print_reply_start_state(get_state);*/ PRINT("\nSTART STATE\n"); linkedRoomQuark = XrmStringToQuark("linkedRoom"); request->set_state.num_win_info_list = 0; num_win = 0; win_info = (WSMWinInfo*)XtMalloc((get_state->num_win_info_list)*sizeof(WSMWinInfo)); for (i = 0; i < get_state->num_win_info_list; i ++) { in_current_space = False; window = get_state->win_info_list[i].window; if (mwm_reconnect && (w_window = GetWorkWindow(window)) != NULL) { w_window->used = True; if ( !IsWorkWindowInSpace(w_window,current_space)) CreateHideWSMWinData(diffs_allowed, w_window, &xrm_data_list, &num_xrm_data_list); else num_xrm_data_list = 0; } else { w_window = CreateWorkWindow(window); /* get window's workspace resources from database */ if (GetWorkspaceResources(shell, w_window->specifier_qlist, &rooms_qlist, &all_work, &linked)) { /* set the workspace values received from database */ SetWorkWindowValues(w_window,all_work,linked); /* set links in internal structures */ in_current_space = CreateInternalStructure(w_window,rooms_qlist); /* if its in current space or no diffs allowed, get config info for WSM_SET_STATE */ if (in_current_space || !diffs_allowed) { if (linked) room_name = linkedRoomQuark; else if (!diffs_allowed && !in_current_space) room_name = rooms_qlist[0]; else room_name = current_space->nameq; GetDataListStart(w_window, i, room_name, diffs_allowed, get_state, &xrm_data_list, &num_xrm_data_list); /* set last space variable */ if (in_current_space) w_window->last_space = current_space; /* if no diffs allowed && not in current space then set hide info to True */ else { w_window->win_data[wsm_index.hide].data.value = 1; xrm_data_list[wsm_index.hide].data.value = 1; w_window->last_space = GetSpace(room_name); } } /* else only send hide info in WSM_SET_STATE */ else { /* create set state request */ CreateStartHideWSMWinData(diffs_allowed, get_state->win_info_list[i].data_list, get_state->win_info_list[i].num_data_list, w_window, &xrm_data_list, &num_xrm_data_list); } if (rooms_qlist != NULL) XtFree((XtPointer)rooms_qlist); } /* nothing in the database */ else { CreateStartWSMWinData(NULL, diffs_allowed, get_state->win_info_list[i].data_list, get_state->win_info_list[i].num_data_list, w_window, &xrm_data_list, &num_xrm_data_list); w_window->last_space = current_space; in_current_space = CreateInternalStructure(w_window,NULL); PRINT("nothing in database\n"); } } /* create WSM_SET_STATE win_info */ if (num_xrm_data_list > 0) { print_win_data(xrm_data_list,num_xrm_data_list); win_info[num_win].data_list = xrm_data_list; win_info[num_win].num_data_list = num_xrm_data_list; win_info[num_win].window = GetWSMWindow(w_window); num_win++; } }/* end for loop */ if (num_win ==0) { request->set_state.allocated = False; request->set_state.num_win_info_list = 0; request->any.type = WSM_SET_STATE; PRINT("REQUEST: no window data\n"); XtFree((XtPointer)win_info); } else { /* create WSM_SET_STATE */ if (num_win != get_state->num_win_info_list) win_info = (WSMWinInfo*)XtRealloc((char*)win_info,num_win*sizeof(WSMWinInfo)); request->set_state.allocated = True; request->set_state.num_win_info_list = num_win; request->set_state.win_info_list = win_info; request->any.type = WSM_SET_STATE; print_request(request); } if (mwm_reconnect) FinishRestartWSM(); /* SaveState(get_state);*/ } /*------------------------------------------------------------------ SaveState ------------------------------------------------------------------*/ void SaveState(WSMGetStateReply *get_state, Boolean diffs) { int i; XrmValue *value_list; WorkWindow *w_window; XrmQuark roomq; Boolean no_save; WSMWinData *hide_data; PRINT("\n\nSAVE STATE\n"); /* If diffs = True then check to see if any of the windows were unmapped since the last save state. (This is done by setting mapped = False for every window in current space and then turning mapped = True for each window sent over from window manager. Anything not sent over by window manager must have been unmapped ) */ if (!diffs) UnmapCurrentSpace(); /* for each window, save its state in database and in internal structures */ print_reply_start_state(get_state); for (i = 0; i < get_state->num_win_info_list; i++) { w_window = GetWorkWindow(get_state->win_info_list[i].window); if (w_window != NULL) { no_save = False; print_window(w_window); if (!diffs) MapWorkWindow(w_window); if (_WSMGetConfigFormatType(w_window->window) == WSM_WINDOW_FMT) { hide_data = _WSMGetMatchingWinData(get_state->win_info_list[i].data_list, get_state->win_info_list[i].num_data_list, w_window->attrib_qlist[wsm_index.hide]); if (hide_data) { if (hide_data->data.value == 1) { no_save = True; } } } if (!no_save) { /* update internal structures */ UpdateWinData(get_state->win_info_list[i].data_list, get_state->win_info_list[i].num_data_list, w_window->win_data, w_window->num_attrib_list); /* create XrmValues to store in database */ CreateValues(w_window, get_state->win_info_list[i].data_list, get_state->win_info_list[i].num_data_list, &value_list); /* store workspace resources */ SaveWorkspaceResources(shell, w_window->specifier_qlist, current_space->nameq, NULLQUARK, w_window->all_workspaces, w_window->linked); if (w_window->linked) roomq = linkedRoomQuark; else roomq = current_space->nameq; print_values(value_list,w_window->attrib_qlist,roomq, w_window->num_attrib_list); /* store window resources */ SaveWindowConfiguration(w_window->specifier_qlist, w_window->attrib_qlist, roomq, value_list); FreeValues(w_window->num_attrib_list,value_list); } } } } /*------------------------------------------------------------------ GetChangeSpaceRequest ------------------------------------------------------------------*/ void GetChangeSpaceRequest(Space *to_s, WSMRequest *request) { WorkWindow *w_window; WorkWindowList *w_list; Boolean in_current_space = False; Boolean in_to_space = False; Boolean first = True; int num_win; WSMWinData *xrm_data_list; int num_xrm_data_list; WSMWinInfo *win_info = NULL; XrmQuark room_name; PRINT("\n\nCHANGE ROOM from %s to %s\n", XrmQuarkToString(current_space->nameq), XrmQuarkToString(to_s->nameq)); request->set_state.num_win_info_list = 0; w_list = current_space->w_list; /* loop through each window in current workspace */ while (w_list != NULL) { num_xrm_data_list = 0; w_window = w_list->work_win; /* only send info for mapped windows */ if (w_window->mapped) { print_window(w_window); in_to_space = IsWorkWindowInSpace(w_window,to_s); /* if the window is also in the room being switched to then send new config info if window not linked, or send stacking info if it is linked */ if (in_to_space) { if (!(w_window->linked) || !diffs_allowed ) { GetDataList(w_window, to_s->nameq, diffs_allowed, &xrm_data_list, &num_xrm_data_list); w_window->last_space = to_s; } /* if the window is linked, i only need to send stacked info */ else { GetUnhideDataList(w_window, linkedRoomQuark, &xrm_data_list, &num_xrm_data_list); } } /* if its not in the destination workspace, hide it */ if (!in_to_space) { CreateHideWSMWinData(diffs_allowed, w_window, &xrm_data_list, &num_xrm_data_list); } /* if there is any info to send the window manager store it*/ if (num_xrm_data_list > 0) { print_win_data(xrm_data_list,num_xrm_data_list); num_win = request->set_state.num_win_info_list; request->set_state.num_win_info_list++; if (first) { win_info = (WSMWinInfo*)XtMalloc(sizeof(WSMWinInfo)); first = False; } else win_info = (WSMWinInfo*)XtRealloc((char*)win_info, (num_win+1)* sizeof(WSMWinInfo)); win_info[num_win].data_list = xrm_data_list; win_info[num_win].num_data_list = num_xrm_data_list; win_info[num_win].window = GetWSMWindow(w_window); } } w_list = w_list->next; } w_list = to_s->w_list; while (w_list != NULL) { num_xrm_data_list = 0; w_window = w_list->work_win; print_window(w_window); if (w_window->mapped) { in_current_space = IsWorkWindowInSpace(w_window,current_space); /* if it was in current space, it was taken care of in the above loop */ if (!in_current_space) { /* if the last configuration for the window was in the destination workspace, i only need to send hide info */ if (diffs_allowed && (w_window->last_space == to_s || (w_window->linked && w_window->last_space != NULL))) { GetUnhideDataList(w_window, to_s->nameq, &xrm_data_list, &num_xrm_data_list); } else { if (w_window->linked) room_name = linkedRoomQuark; else room_name = to_s->nameq; GetDataList(w_window, room_name, diffs_allowed, &xrm_data_list, &num_xrm_data_list); w_window->last_space = to_s; } /* if there is any info to send to window manager */ if (num_xrm_data_list >0) { print_win_data(xrm_data_list,num_xrm_data_list); num_win = request->set_state.num_win_info_list; request->set_state.num_win_info_list++; if (first) { win_info = (WSMWinInfo*)XtMalloc(sizeof(WSMWinInfo)); first = False; } else win_info = (WSMWinInfo*)XtRealloc((char*)win_info, (num_win+1)* sizeof(WSMWinInfo)); win_info[num_win].data_list = xrm_data_list; win_info[num_win].num_data_list = num_xrm_data_list; win_info[num_win].window = GetWSMWindow(w_window); } } } w_list = w_list->next; } if (request->set_state.num_win_info_list > 0) { request->set_state.allocated = True; request->set_state.win_info_list = win_info; } else { request->set_state.allocated = False; request->set_state.win_info_list = NULL; } request->any.type = WSM_SET_STATE; print_request(request); current_space = to_s; } /*------------------------------------------------------------------ GetRegisterOldWindowReply ------------------------------------------------------------------*/ void GetRegisterOldWindowReply(WorkWindow *w_window,WSMReply *reply) { WSMWinData *xrm_data_list; int num_xrm_data_list = 0; Boolean in_current_space = False; PRINT("\n\nREGISTER OLD WINDOW .....\n"); reply->any.type = WSM_REG_WINDOW; reply->register_window.num_window_data = 0; reply->register_window.window_data = NULL; in_current_space = IsWorkWindowInSpace(w_window,current_space); /* Display window in current room AND any rooms it was in previously. If other behavior wanted, take this if statement out */ if (!in_current_space) { AddSpaceToWindow(current_space, w_window); AddWindowToSpace(current_space, w_window); in_current_space = True; } if (in_current_space) { if (!(w_window->linked) || !diffs_allowed) { GetDataList(w_window, current_space->nameq, diffs_allowed, &xrm_data_list, &num_xrm_data_list); w_window->last_space = current_space; } /* if the window is linked (no stacked above info, i could remove this) */ else if (w_window->linked) { GetUnhideDataList(w_window, linkedRoomQuark, &xrm_data_list, &num_xrm_data_list); } } else { CreateHideWSMWinData(diffs_allowed, w_window, &xrm_data_list, &num_xrm_data_list); } print_win_data(xrm_data_list,num_xrm_data_list); reply->any.type = WSM_REG_WINDOW; if (num_xrm_data_list > 0) { reply->register_window.allocated = True; reply->register_window.num_window_data = num_xrm_data_list; reply->register_window.window_data = xrm_data_list; } if (w_window->s_list != NULL) if (w_window->s_list->next == NULL) DisableDeleteCommand(w_window->window); print_reply(reply); } /*------------------------------------------------------------------ GetRegisterWindowReply ------------------------------------------------------------------*/ void GetRegisterWindowReply(Window window,WSMReply *reply) { WSMWinData *xrm_data_list; int num_xrm_data_list = 0; WorkWindow *w_window; XrmQuarkList rooms_qlist; Boolean all_workspaces, linked; Boolean in_current_space = False; Boolean new_window = True; XrmQuark room_name = NULLQUARK; PRINT("\n\nREGISTER WINDOW .....\n"); reply->any.type = WSM_REG_WINDOW; reply->register_window.num_window_data = 0; w_window = GetWorkWindow(window); if (w_window == NULL) w_window = CreateWorkWindow(window); else new_window = False; w_window->mapped = True; print_window(w_window); if (_WSMGetConfigFormatType(window) == WSM_WINDOW_FMT) AddWindow(window); if (!new_window) { GetRegisterOldWindowReply(w_window,reply); return; } /* get window's workspace resources from database */ if (GetWorkspaceResources(shell, w_window->specifier_qlist, &rooms_qlist, &all_workspaces, &linked)) { /* set the workspace values received from database */ SetWorkWindowValues(w_window,all_workspaces,linked); /* create internal structures */ in_current_space = CreateInternalStructure(w_window,rooms_qlist); if (!in_current_space) { AddSpaceToWindow(current_space, w_window); AddWindowToSpace(current_space, w_window); in_current_space = True; } /* if its in current space or no diffs allowed, get config info for WSM_SET_STATE */ if (in_current_space || !diffs_allowed) { if (linked) room_name = linkedRoomQuark; else if (!diffs_allowed && !in_current_space) room_name = rooms_qlist[0]; else room_name = current_space->nameq; GetDataListStart(w_window, 0, room_name, diffs_allowed, NULL, &xrm_data_list, &num_xrm_data_list); if (in_current_space) { w_window->win_data[wsm_index.hide].data.value = 0; w_window->last_space = current_space; } else if (!diffs_allowed) { w_window->win_data[wsm_index.hide].data.value = 1; xrm_data_list[wsm_index.hide].data.value = 1; w_window->last_space = GetSpace(room_name); } } /* else only send hide info in WSM_SET_STATE */ else { CreateStartHideWSMWinData(True, NULL, 0, w_window, &xrm_data_list, &num_xrm_data_list); w_window->win_data[wsm_index.hide].type = WSM_VALUE_DATA; w_window->win_data[wsm_index.hide].data.value = 1; } if (rooms_qlist != NULL) XtFree((XtPointer)rooms_qlist); print_win_data(xrm_data_list,num_xrm_data_list); reply->any.type = WSM_REG_WINDOW; reply->register_window.num_window_data = num_xrm_data_list; reply->register_window.window_data = xrm_data_list; print_reply(reply); } /* nothing in the database */ else { CreateStartWSMWinData(NULL, True, NULL, 0, w_window, &xrm_data_list, &num_xrm_data_list); CreateInternalStructure(w_window,NULL); reply->any.type = WSM_REG_WINDOW; reply->register_window.num_window_data = 0; reply->register_window.window_data = NULL; print_reply(reply); w_window->last_space = current_space; PRINT("nothing in database\n"); } if (w_window->s_list != NULL) if (w_window->s_list->next == NULL) DisableDeleteCommand(w_window->window); } /*------------------------------------------------------------------ DealWithClientMessage ------------------------------------------------------------------*/ void DealWithClientMessage(Widget widget,XClientMessageEvent *ev) { char **argv; int argc = 3; if (ev->type != ClientMessage) return; if (ev->message_type != atoms.protocols_property) return; if (ev->data.l[0] != atoms.save_property) return; SaveWsmToFile(file_name); argv = (char**)XtMalloc(3*sizeof(char*)); argv[0] = "wsm"; argv[1] = "-f"; argv[2] = file_name; XSetCommand(dsp,XtWindow(widget),argv,argc); XtFree((char*)argv); } /*------------------------------------------------------------------ DealWithDestroyNotify ------------------------------------------------------------------*/ void DealWithDestroyNotify(Widget widget,XDestroyWindowEvent *ev) { WorkWindow *w_window = GetWorkWindow(ev->window); WorkWindow *i_window; if (ev->window == mwm_window) DealWithDestroyMwmNotify(); if (connected == False) return; #ifdef DEBUG PRINT("destroy 0x%x\n",ev->window); #endif if (w_window == NULL) { w_window = GetWorkWindow(ev->event); if (w_window != NULL) { RemoveWorkWindow(w_window, False); i_window = GetIconWorkWindow(w_window->window); if (i_window != NULL) RemoveWorkWindow(i_window,False); } } else { RemoveWorkWindow(w_window,False); i_window = GetIconWorkWindow(w_window->window); if (i_window != NULL) RemoveWorkWindow(i_window,False); } } /*------------------------------------------------------------------ DealWithDestroyMwmNotify ------------------------------------------------------------------*/ void DealWithDestroyMwmNotify() { if (connected == False) return; RestartWSM(); mwm_gone = True; PRINT("Mwm went away\n"); } /*------------------------------------------------------------------ DealMapNotify ------------------------------------------------------------------*/ void DealWithMapNotify(Widget widget,XMapEvent *ev) { WorkWindow *w_window = GetWorkWindow(ev->window); if (connected == False) return; #ifdef DEBUG PRINT("MapNotify\n"); #endif if (w_window == NULL) { w_window = GetWorkWindow(ev->event); if (w_window != NULL) w_window->mapped = True; } else w_window->mapped = True; } /*------------------------------------------------------------------ DealUnmapNotify ------------------------------------------------------------------*/ void DealWithUnmapNotify(Widget widget,XUnmapEvent *ev) { WorkWindow *i_window; WorkWindow *w_window = GetWorkWindow(ev->window); #ifdef DEBUG PRINT("UnapNotify\n"); #endif if (connected == False) return; if (w_window == NULL) { w_window = GetWorkWindow(ev->event); if (w_window != NULL) { w_window->mapped = False; /* RemoveWorkWindow(w_window, False); i_window = GetIconWorkWindow(w_window->window); if (i_window != NULL) RemoveWorkWindow(i_window,False); */ } } else { w_window->mapped = False; /* RemoveWorkWindow(w_window, False); i_window = GetIconWorkWindow(w_window->window); if (i_window != NULL) RemoveWorkWindow(i_window,False); */ } } /*------------------------------------------------------------------ CreateSetState ------------------------------------------------------------------*/ Boolean CreateSetState(WSMWinData *data_list, int num_data_list, WSMWinData *data_list_i, int num_data_list_i, WorkWindow *w_window, WorkWindow *i_window, WSMRequest *request) { Boolean retval; WSMWinInfo *win_info = NULL; int count; print_window(w_window); print_win_data(data_list,num_data_list); if (i_window != NULL) { print_window(i_window); print_win_data(data_list_i,num_data_list_i); } count = 0; retval = False; if (num_data_list > 0 && num_data_list_i > 0) win_info = (WSMWinInfo*)XtMalloc(2*sizeof(WSMWinInfo)); else if (num_data_list > 0 || num_data_list_i > 0) win_info = (WSMWinInfo*)XtMalloc(sizeof(WSMWinInfo)); if (num_data_list > 0) { win_info[count].data_list = data_list; win_info[count].num_data_list = num_data_list; win_info[count].window = GetWSMWindow(w_window); count++; } if (num_data_list_i > 0) { win_info[count].data_list = data_list_i; win_info[count].num_data_list = num_data_list_i; win_info[count].window = GetWSMWindow(i_window); count++; } if (num_data_list > 0 || num_data_list_i > 0) { request->set_state.allocated = True; request->any.type = WSM_SET_STATE; request->set_state.win_info_list = win_info; request->set_state.num_win_info_list = count; retval = True; } else { request->set_state.allocated = True; request->any.type = WSM_SET_STATE; request->set_state.win_info_list = NULL; request->set_state.num_win_info_list = 0; } return retval; } /*------------------------------------------------------------------ GetCopyWindowRequest ------------------------------------------------------------------*/ Boolean GetCopyWindowRequest(Window win, Space *from_s, Space *to_s, WSMRequest *request) { WSMWinData *xrm_data_list; WSMWinData *xrm_data_list_i; int num_xrm_data_list = 0; int num_xrm_data_list_i = 0; WorkWindow *w_window; WorkWindow *i_window; XrmValue *attr_values = NULL; XrmValue *attr_values_i = NULL; Boolean retval = False; XrmQuark room_nameq; PRINT("COPY\n"); w_window = GetWorkWindow(win); i_window = GetIconWorkWindow(win); if (w_window != NULL && from_s != NULL && to_s != NULL && IsWorkWindowInSpace(w_window,from_s)) { if (w_window->linked) room_nameq = linkedRoomQuark; else room_nameq = from_s->nameq; GetWindowConfigurationEntry(w_window->specifier_qlist, w_window->attrib_qlist, room_nameq, &attr_values); if (i_window != NULL) GetWindowConfigurationEntry(i_window->specifier_qlist, i_window->attrib_qlist, room_nameq, &attr_values_i); if (to_s == all_space) { CopyWindowToAllSpaces(w_window,i_window,attr_values, attr_values_i, from_s); } else { CopyWindowToSpace(w_window,i_window,attr_values,attr_values_i,to_s); } w_window->linked = False; SaveWorkspaceResources(shell, w_window->specifier_qlist, to_s->nameq, NULLQUARK, w_window->all_workspaces, w_window->linked); if (i_window != NULL) { i_window->linked = False; SaveWorkspaceResources(shell, i_window->specifier_qlist, to_s->nameq, NULLQUARK, i_window->all_workspaces, i_window->linked); } if ((to_s == current_space || to_s == all_space) && from_s != current_space && w_window->mapped) { CreateWSMWinData(attr_values, diffs_allowed, w_window, &xrm_data_list, &num_xrm_data_list); w_window->last_space = current_space; if (i_window != NULL) { CreateWSMWinData(attr_values_i, diffs_allowed, i_window, &xrm_data_list_i, &num_xrm_data_list_i); i_window->last_space = current_space; } retval = CreateSetState(xrm_data_list,num_xrm_data_list, xrm_data_list_i,num_xrm_data_list_i, w_window, i_window, request); } if (attr_values != NULL) XtFree((char*)attr_values); if (attr_values_i != NULL) XtFree((char*)attr_values_i); } if (retval) print_request(request); return retval; } /*------------------------------------------------------------------ CopyWindowToAllSpaces ------------------------------------------------------------------*/ void CopyWindowToAllSpaces(WorkWindow *w_window, WorkWindow *i_window, XrmValue *attr_values, XrmValue *attr_values_i,Space* skip_space) { Space *space; space = space_list; w_window->linked = False; while (space!= NULL) { if (space != skip_space) { SaveWindowConfiguration(w_window->specifier_qlist, w_window->attrib_qlist, space->nameq, attr_values); if (i_window != NULL) SaveWindowConfiguration(i_window->specifier_qlist, i_window->attrib_qlist, space->nameq, attr_values_i); SaveWorkspaceResources(shell, w_window->specifier_qlist, space->nameq, NULLQUARK, w_window->all_workspaces, w_window->linked); } if (!(IsWorkWindowInSpace(w_window,space))) { AddWindowToSpace(space,w_window); AddSpaceToWindow(space,w_window); } space = space->next; } if (!(IsWorkWindowInSpace(w_window,all_space))) AddWindowToSpace(all_space,w_window); w_window->all_workspaces = True; } /*------------------------------------------------------------------ CopyWindowToSpace ------------------------------------------------------------------*/ void CopyWindowToSpace(WorkWindow *w_window, WorkWindow *i_window, XrmValue *attr_values, XrmValue *attr_values_i, Space *space) { SpaceList *s_list; if (w_window->linked) { /* break links and replace with copies */ s_list = w_window->s_list; while (s_list != NULL) { SaveWindowConfiguration(w_window->specifier_qlist, w_window->attrib_qlist, s_list->space->nameq, attr_values); if (i_window != NULL) SaveWindowConfiguration(i_window->specifier_qlist, i_window->attrib_qlist, s_list->space->nameq, attr_values_i); s_list = s_list->next; } } SaveWindowConfiguration(w_window->specifier_qlist, w_window->attrib_qlist, space->nameq, attr_values); if (i_window != NULL) SaveWindowConfiguration(i_window->specifier_qlist, i_window->attrib_qlist, space->nameq, attr_values_i); if (!(IsWorkWindowInSpace(w_window,space))) { AddWindowToSpace(space,w_window); AddSpaceToWindow(space,w_window); } } /*------------------------------------------------------------------ GetMoveWindowRequest ------------------------------------------------------------------*/ Boolean GetMoveWindowRequest(Window win, Space *from_s, Space *to_s, WSMRequest *request) { WSMWinData *xrm_data_list, *xrm_data_list_i; int num_xrm_data_list = 0; int num_xrm_data_list_i = 0; WorkWindow *w_window; WorkWindow *i_window; XrmValue *attr_values = NULL; XrmValue *attr_values_i = NULL; Boolean retval = False; PRINT("MOVE 0x%X \n", win); w_window = GetWorkWindow(win); i_window = GetIconWorkWindow(win); if (w_window != NULL && from_s != NULL && to_s != NULL && IsWorkWindowInSpace(w_window,from_s)) { /* if the window isn't linked, then save the "from" workspace configuration into t he "to" workspace */ if (!(w_window->linked)) { GetWindowConfigurationEntry(w_window->specifier_qlist, w_window->attrib_qlist, from_s->nameq, &attr_values); SaveWindowConfiguration(w_window->specifier_qlist, w_window->attrib_qlist, to_s->nameq, attr_values); if (i_window != NULL) { GetWindowConfigurationEntry(i_window->specifier_qlist, i_window->attrib_qlist, from_s->nameq, &attr_values_i); SaveWindowConfiguration(i_window->specifier_qlist, i_window->attrib_qlist, to_s->nameq, attr_values_i); } } /* if the window was in all workspaces, remove it from all_space */ if (w_window->all_workspaces) { RemoveWorkWindowFromSpace(all_space,w_window); w_window->all_workspaces = False; } /* if the window wasn't in the "to" workspace, add it */ if (!IsWorkWindowInSpace(w_window,to_s)) { SaveWorkspaceResources(shell, w_window->specifier_qlist, to_s->nameq, from_s->nameq, w_window->all_workspaces, w_window->linked); AddWindowToSpace(to_s,w_window); AddSpaceToWindow(to_s,w_window); } /* if its necessary to send info to the window manager */ if ((to_s == current_space || from_s == current_space) && w_window->mapped) { if (to_s == current_space) { /* if its linked then i need to get its configuration, otherwise i already got it above */ if (w_window->linked) { GetWindowConfigurationEntry(w_window->specifier_qlist, w_window->attrib_qlist, linkedRoomQuark, &attr_values); if (i_window != NULL) GetWindowConfigurationEntry(i_window->specifier_qlist, i_window->attrib_qlist, linkedRoomQuark, &attr_values_i); } CreateWSMWinData(attr_values, True, w_window, &xrm_data_list, &num_xrm_data_list); w_window->last_space = current_space; if (i_window != NULL) { CreateWSMWinData(attr_values_i, True, i_window, &xrm_data_list_i, &num_xrm_data_list_i); i_window->last_space = current_space; } } else { CreateHideWSMWinData(diffs_allowed, w_window, &xrm_data_list, &num_xrm_data_list); } retval = CreateSetState(xrm_data_list,num_xrm_data_list, xrm_data_list_i,num_xrm_data_list_i, w_window, i_window, request); } /* get rid of the "from" workspace configuration */ if (!w_window->linked) PurgeWindowConfiguration(shell, w_window->specifier_qlist, w_window->attrib_qlist, from_s->nameq); RemoveWorkWindowFromSpace(from_s, w_window); RemoveSpaceFromWindow(from_s, w_window); if (attr_values != NULL) XtFree((char*)attr_values); if (attr_values_i != NULL) XtFree((char*)attr_values_i); } return retval; } /*------------------------------------------------------------------ GetDeleteWindowRequest ------------------------------------------------------------------*/ Boolean GetDeleteWindowRequest(Window win, Space *from_s,WSMRequest *request) { WSMWinInfo *win_info; WSMWinData *xrm_data_list; int num_xrm_data_list = 0; WorkWindow *w_window; Boolean retval = False; PRINT("DELETE 0x%X \n", win); w_window = GetWorkWindow(win); if (w_window != NULL && from_s != NULL ) { if (IsWorkWindowInSpace(w_window,from_s)) { PurgeWindowConfiguration(shell, w_window->specifier_qlist, w_window->attrib_qlist, from_s->nameq); RemoveWorkWindowFromSpace(from_s, w_window); RemoveSpaceFromWindow(from_s, w_window); if (w_window->all_workspaces) { RemoveWorkWindowFromSpace(all_space,w_window); w_window->all_workspaces = False; } if (from_s == current_space && w_window->mapped) { CreateHideWSMWinData(diffs_allowed, w_window, &xrm_data_list, &num_xrm_data_list); print_win_data(xrm_data_list,num_xrm_data_list); if (num_xrm_data_list > 0) { win_info = (WSMWinInfo*)XtMalloc(sizeof(WSMWinInfo)); win_info[0].data_list = xrm_data_list; win_info[0].num_data_list = num_xrm_data_list; win_info[0].window = GetWSMWindow(w_window); request->set_state.allocated = True; request->any.type = WSM_SET_STATE; request->set_state.win_info_list = win_info; request->set_state.num_win_info_list = 1; retval = True; } } } } return retval; } /*------------------------------------------------------------------ GetLinkWindowRequest ------------------------------------------------------------------*/ Boolean GetLinkWindowRequest(Window win, Space *from_s, Space *to_s, WSMRequest *request) { WSMWinData *xrm_data_list; int num_xrm_data_list = 0; WSMWinData *xrm_data_list_i; int num_xrm_data_list_i = 0; WorkWindow *w_window; WorkWindow *i_window; XrmValue *attr_values = NULL; XrmValue *attr_values_i = NULL; Boolean retval = False; Boolean in_space = False; Space *space; w_window = GetWorkWindow(win); i_window = GetIconWorkWindow(win); PRINT("LINK WINDOW "); if (w_window != NULL && from_s != NULL && to_s != NULL) { #ifdef DEBUG print_window(w_window); #endif if (IsWorkWindowInSpace(w_window,from_s)) { in_space = IsWorkWindowInSpace(w_window,to_s); if (in_space && w_window->linked) return False; if (!in_space) { /* if the window is being linked into all workspaces, look through all workspaces and also add it to all_space*/ if (to_s == all_space) { space = space_list; while (space != NULL) { if (!IsWorkWindowInSpace(w_window,space)) { AddWindowToSpace(space,w_window); AddSpaceToWindow(space,w_window); } space = space->next; } AddWindowToSpace(all_space,w_window); w_window->all_workspaces = True; } /* else just add it to a single workspace */ else { AddWindowToSpace(to_s,w_window); AddSpaceToWindow(to_s,w_window); } } /* if the window wasn't linked then save the "from" configuration into the database as the linked configuration */ if (!(w_window->linked)) { GetWindowConfigurationEntry(w_window->specifier_qlist, w_window->attrib_qlist, from_s->nameq, &attr_values); SaveWindowConfiguration(w_window->specifier_qlist, w_window->attrib_qlist, linkedRoomQuark, attr_values); if (i_window != NULL) { GetWindowConfigurationEntry(i_window->specifier_qlist, i_window->attrib_qlist, from_s->nameq, &attr_values_i); SaveWindowConfiguration(i_window->specifier_qlist, i_window->attrib_qlist, linkedRoomQuark, attr_values_i); } if (attr_values != NULL) XtFree((char*)attr_values); if (attr_values_i != NULL) XtFree((char*)attr_values_i); attr_values = NULL; attr_values_i = NULL; } /* save workspace resources if they have changed */ if (!in_space || !(w_window->linked) || to_s == all_space) { SaveWorkspaceResources(shell, w_window->specifier_qlist, to_s->nameq, NULLQUARK, w_window->all_workspaces, True); if (i_window) SaveWorkspaceResources(shell, i_window->specifier_qlist, to_s->nameq, NULLQUARK, i_window->all_workspaces, True); } /* send info to window manager if necessary */ if ((to_s == current_space || to_s == all_space) && from_s != current_space && w_window->mapped) { if (w_window->linked) { GetWindowConfigurationEntry(w_window->specifier_qlist, w_window->attrib_qlist, linkedRoomQuark, &attr_values); if (i_window != NULL) GetWindowConfigurationEntry(i_window->specifier_qlist, i_window->attrib_qlist, linkedRoomQuark, &attr_values_i); } CreateWSMWinData(attr_values, diffs_allowed, w_window, &xrm_data_list, &num_xrm_data_list); w_window->last_space = current_space; if (i_window != NULL) { CreateWSMWinData(attr_values_i, diffs_allowed, i_window, &xrm_data_list_i, &num_xrm_data_list_i); i_window->last_space = current_space; } retval = CreateSetState(xrm_data_list,num_xrm_data_list, xrm_data_list_i,num_xrm_data_list_i, w_window, i_window, request); if (attr_values != NULL) XtFree((char*)attr_values); if (attr_values_i != NULL) XtFree((char*)attr_values_i); attr_values = NULL; attr_values_i = NULL; } w_window->linked = True; if (i_window != NULL) i_window->linked = True; } } PRINT("return\n"); return retval; } /*------------------------------------------------------------------ GetManageAllWindowsRequest ------------------------------------------------------------------*/ Boolean GetManageAllWindowsRequest(WSMRequest *request) { WSMWinInfo *win_info; WSMWinData *xrm_data_list; int num_xrm_data_list = 0; WorkWindow *w_window; int num_win; PRINT("MANAGE WINDOWS "); w_window = work_windows; win_info = NULL; num_win = 0; for (w_window = work_windows; w_window!= NULL; w_window = w_window->next) { #ifdef DEBUG print_window(w_window); #endif if (_WSMGetConfigFormatType(w_window->window) == WSM_WINDOW_FMT) { if (!(IsWorkWindowInSpace(w_window,current_space))) { if (w_window->last_space != NULL && w_window->mapped) { GetUnhideDataList(w_window, w_window->last_space->nameq, &xrm_data_list, &num_xrm_data_list); if (num_xrm_data_list > 0) { print_win_data(xrm_data_list,num_xrm_data_list); if (win_info == NULL) win_info = (WSMWinInfo*)XtMalloc(sizeof(WSMWinInfo)); else win_info = (WSMWinInfo*)XtRealloc((char*)win_info, (num_win+1)* sizeof(WSMWinInfo)); win_info[num_win].data_list = xrm_data_list; win_info[num_win].num_data_list = num_xrm_data_list; win_info[num_win].window = GetWSMWindow(w_window); num_win++; } } } } } if (num_win ==0) { PRINT("MANAGE WINDOWS: no window data\n"); return False; } else { request->set_state.allocated = True; request->set_state.num_win_info_list = num_win; request->set_state.win_info_list = win_info; request->any.type = WSM_SET_STATE; print_request(request); return True; } } motif-2.3.8/demos/programs/workspace/wsmData.c0000644000175000017500000005016113066310437016274 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wsmData.c /main/6 1995/07/14 09:48:38 drk $" #endif #endif #include #include #include #include "wsm.h" #include "wsmDebug.h" #include "xrmLib.h" void LongListDestructor( XtAppContext , XrmValuePtr, XtPointer, XrmValuePtr , Cardinal * ); Boolean CvtStringToLongList( Display *, XrmValuePtr, Cardinal *, XrmValuePtr, XrmValuePtr, XtPointer * ); extern XrmQuark hideq; extern IndexStruct wsm_index; extern Widget shell; extern Space *current_space; extern Space *space_list; /*------------------------------------------------------------------ UpdateXrm Save the current workspaceList, backgroundList, and labelPixmapList ------------------------------------------------------------------*/ void UpdateXrm() { Space *s; char *s_list; char *b_list; char *p_list; char *c_space; int curr_size = 0; int max_size =200; s_list = (char*) XtMalloc(max_size *sizeof(char)); s_list[0] = '\0'; for (s = space_list; s != NULL; s = s->next) { curr_size = strlen(s->name) + 2; if (curr_size > max_size) { max_size +=100; s_list = (char*)XtRealloc(s_list,max_size*sizeof(char)); } strcat(s_list,s->name); if (s->next != NULL) strcat(s_list,","); } max_size = 200; b_list = (char*) XtMalloc(max_size *sizeof(char)); b_list[0] = '\0'; for (s = space_list; s != NULL; s = s->next) { curr_size = strlen(s->background) + 2; if (curr_size > max_size) { max_size +=100; b_list = (char*)XtRealloc(b_list,max_size*sizeof(char)); } strcat(b_list,s->background); if (s->next != NULL) strcat(b_list,","); } max_size = 200; p_list = (char*) XtMalloc(max_size *sizeof(char)); p_list[0] = '\0'; for (s = space_list; s != NULL; s = s->next) { curr_size = strlen(s->pixmap_name) + 2; if (curr_size > max_size) { max_size +=100; p_list = (char*)XtRealloc(p_list,max_size*sizeof(char)); } strcat(p_list,s->pixmap_name); if (s->next != NULL) strcat(p_list,","); } max_size = strlen(current_space->name) +1; c_space = (char*) XtMalloc( max_size*sizeof(char)); strcpy(c_space,current_space->name); (void )SaveSpaceListResources(s_list,b_list,p_list,c_space); XtFree((char*)s_list); XtFree((char*)b_list); XtFree((char*)p_list); XtFree((char*)c_space); } /*------------------------------------------------------------------ ConvertToWsmData Convert an XrmValue into a WSMWinData ------------------------------------------------------------------*/ Boolean ConvertToWSMData(XrmValue *value, WSMWinData *win_data, WSMWinData *start_data, WSMAttribute *attrib) { XrmValue toVal; XtPointer fByte; int i,j; static Boolean register_long_converter; toVal.size = sizeof(fByte); toVal.addr = (XtPointer)&fByte; if (!(attrib->is_list)) { if (XtConvertAndStore(shell, XtRString, value, XtRInt, &toVal)) { if (start_data->type == WSM_NONE || (int) *(int*)toVal.addr != (int) start_data->data.value ) { win_data->nameq = attrib->nameq; win_data->data.value = *(int*)toVal.addr; win_data->type = WSM_VALUE_DATA; #ifdef DEBUG2 PRINT(" value %s %s %ld %ld\n",XrmQuarkToString(attrib->nameq), (char*)value->addr,*(int*)toVal.addr,start_data->data.value); #endif return True; } else return False; } } else if (attrib->size == sizeof(long)*8) { if (!register_long_converter) { XtSetTypeConverter(XtRString,"LongList",CvtStringToLongList,NULL, 0, XtCacheNone,LongListDestructor); register_long_converter = True; } if (XtConvertAndStore(shell, XtRString, value, "LongList", &toVal)) { win_data->nameq = attrib->nameq; win_data->data.long_ptr = *(long**)toVal.addr; win_data->data_len = toVal.size; win_data->type = WSM_LONG_LIST_DATA; #ifdef DEBUG2 PRINT("value stackingOrder %d: ", win_data->data_len); for (j = 0; j < toVal.size; j++) PRINT(" %ld ",win_data->data.long_ptr[j]); PRINT("\n"); #endif return True; } } else { PRINT("not converted to wsm struct\n"); } return False; } /*------------------------------------------------------------------ WinDataCopy Copy a WSMWinData structure ------------------------------------------------------------------*/ void WinDataCopy(WSMWinData *w_data, WSMWinData *copy_data) { int i; switch(copy_data->type) { case WSM_CHAR_LIST_DATA: { w_data->type = WSM_CHAR_LIST_DATA; break; } case WSM_SHORT_LIST_DATA: { w_data->type = WSM_SHORT_LIST_DATA; break; } case WSM_LONG_LIST_DATA: { /* long *long_list; if (w_data->data_len != 0) XtFree((XtPointer)w_data->data.long_ptr); long_list = (long*)XtMalloc(copy_data->data_len*sizeof(long)); for (i = 0; i < copy_data->data_len; i ++) long_list[i] = copy_data->data.long_ptr[i]; w_data->data.long_ptr =long_list; */ w_data->type = WSM_LONG_LIST_DATA; break; } case WSM_VALUE_DATA: { w_data->data.value =copy_data->data.value; w_data->type = WSM_VALUE_DATA; break; } case WSM_NONE: /* Not handled case */ break; } w_data->nameq = copy_data->nameq; } /*------------------------------------------------------------------ CreateWSMWinData Create WSMWinData list from an XrmValue list ------------------------------------------------------------------*/ Boolean CreateWSMWinData(XrmValue *value_list, Boolean diffs_allowed, WorkWindow *w_window, /* return */ WSMWinData **win_data_return, /* return */ int *num_data_return) /* return */ { int i; Boolean retval = False; WSMWinData *win_data; Boolean in_dbase; int num_data = 0; *num_data_return = 0; win_data = NULL; #ifdef DEBUG PRINT("enter CreateWinData ......\n"); #endif /* win_data is returned for use in a set state request */ win_data = (WSMWinData*)XtMalloc(w_window->num_attrib_list*sizeof(WSMWinData)); /* loop through attributes and convert value_list to win_data */ for (i = 0; i < w_window->num_attrib_list; i++) { in_dbase = False; /* if value in database */ if (value_list != NULL) if (value_list[i].size > 0) { /* convert it and assign */ if (ConvertToWSMData(&(value_list[i]), &(win_data[num_data]), &(w_window->win_data[i]), &(w_window->attrib_list[i]))) { WinDataCopy(&(w_window->win_data[i]), &(win_data[num_data])); num_data++; retval = True; in_dbase = True; } } /* if not in database and diffs aren't allowed*/ if (!diffs_allowed && !in_dbase && w_window->win_data != NULL) { #ifdef DEBUG PRINT(" no %s\n",XrmQuarkToString(w_window->attrib_qlist[0])); #endif WinDataCopy(&(win_data[num_data]),&(w_window->win_data[i])); num_data++; } } if (num_data !=0) { win_data = (WSMWinData*) XtRealloc((char *)win_data, num_data *sizeof(WSMWinData)); *win_data_return = win_data; } else { XtFree((char*)win_data); *win_data_return = NULL; } *num_data_return = num_data; #ifdef DEBUG PRINT("return\n"); #endif return retval; } /*------------------------------------------------------------------ CreateStartWSMWinData Create WSMWinData list from an XrmValue list and initialize a windows WSMWinData list. ------------------------------------------------------------------*/ Boolean CreateStartWSMWinData(XrmValue *value_list, Boolean diffs_allowed, WSMWinData *start_win_data, int num_start_win_data, WorkWindow *w_window, WSMWinData **win_data_return, /* return */ int *num_data_return) /* return */ { int i; WSMWinData *start_data; /* set internal start_win_data_return */ if (start_win_data != NULL) { for (i = 0; i < w_window->num_attrib_list; i++) { start_data = _WSMGetMatchingWinData(start_win_data, num_start_win_data, w_window->attrib_qlist[i]); if (start_data != NULL) WinDataCopy(&(w_window->win_data[i]),start_data); } } return CreateWSMWinData(value_list, diffs_allowed, w_window, win_data_return, num_data_return); } /*------------------------------------------------------------------ CreateHideWSMWinData Create WSMData list with hidden = True. ------------------------------------------------------------------*/ void CreateHideWSMWinData(Boolean diffs_allowed, WorkWindow *w_window, WSMWinData **win_data_return, int *num_data_return) { int i; WSMWinData *win_data = NULL; int num_data = 0; *num_data_return = 0; #ifdef DEBUG PRINT("enter CreateHideWSMWinData ......"); #endif if (diffs_allowed && _WSMGetConfigFormatType(w_window->window) == WSM_WINDOW_FMT) { win_data = (WSMWinData*)XtMalloc(sizeof(WSMWinData)); num_data = 1; win_data[0].data.value = 1; win_data[0].nameq = hideq; win_data[0].type = WSM_VALUE_DATA; WinDataCopy(&(w_window->win_data[wsm_index.hide]), &(win_data[0])); } else if (_WSMGetConfigFormatType(w_window->window) == WSM_WINDOW_FMT) { win_data = (WSMWinData*)XtMalloc(w_window->num_attrib_list *sizeof(WSMWinData)); for (i = 0; i < w_window->num_attrib_list; i++) { if (w_window->attrib_qlist[i] == hideq) win_data[i].data.value = 1; else WinDataCopy(&(win_data[num_data]),&(w_window->win_data[i])); num_data++; } w_window->win_data[wsm_index.hide].data.value = 1; } *win_data_return = win_data; *num_data_return = num_data; #ifdef DEBUG PRINT("return\n"); #endif } /*------------------------------------------------------------------ CreateStartHideWSMWinData Create WSMWinData list with hidden = True and initialize window's WSMWinData list ------------------------------------------------------------------*/ void CreateStartHideWSMWinData(Boolean diffs_allowed, WSMWinData *start_win_data, int num_start_win_data, WorkWindow *w_window, WSMWinData **win_data_return, int *num_data_return) { int i; WSMWinData *start_data; for (i = 0; i < w_window->num_attrib_list; i++) { if (w_window->attrib_list[i].nameq == hideq) { w_window->win_data[i].data.value = 1; w_window->win_data[i].nameq = hideq; w_window->win_data[i].type = WSM_VALUE_DATA; } else { if (start_win_data != NULL) { start_data = _WSMGetMatchingWinData(start_win_data, num_start_win_data, w_window->attrib_qlist[i]); if (start_data != NULL) WinDataCopy(&(w_window->win_data[i]),start_data); } } } CreateHideWSMWinData(diffs_allowed, w_window, win_data_return, num_data_return); } /*------------------------------------------------------------------ CreateUnhideWSMWinData Create WSMWinData list with hidden = False ------------------------------------------------------------------*/ void CreateUnhideWSMWinData(XrmValue *value, WorkWindow *w_window, WSMWinData **win_data_return, int *num_data_return) { WSMWinData *win_data; XrmValue toVal; XtPointer fByte; int num_data = 0; *num_data_return = 0; #ifdef DEBUG PRINT("enter CreateUnhideWSMWinData ......\n"); #endif win_data = NULL; num_data = 0; if (_WSMGetConfigFormatType(w_window->window) == WSM_WINDOW_FMT) { if (win_data == NULL) win_data = (WSMWinData*)XtMalloc(sizeof(WSMWinData)); win_data[num_data].data.value = 0; win_data[num_data].nameq = hideq; win_data[num_data].type = WSM_VALUE_DATA; w_window->win_data[wsm_index.hide].data.value = 0; num_data++; } *win_data_return = win_data; *num_data_return = num_data; #ifdef DEBUG PRINT("return\n"); #endif } /*------------------------------------------------------------------ FreeValues Free values created in CreateValues ------------------------------------------------------------------*/ void FreeValues(int num_values, XrmValue *value_list) { int i; if (value_list == NULL) return; for (i = 0; i < num_values; i++) { if (value_list[i].size !=0 && value_list[i].addr != NULL) XtFree((XtPointer)value_list[i].addr); } XtFree((XtPointer)value_list); } /*------------------------------------------------------------------ CreateValues Create XrmValue list from WSMWinData list ------------------------------------------------------------------*/ Boolean CreateValues(WorkWindow *w_window, WSMWinData *data_list, int num_data_list, XrmValue **value_list_return) { int i; WSMWinData *win_data; XrmValue *values; char* str; char tempstr[10]; int num_values; #ifdef DEBUG PRINT("enter CreateValues ...\n"); #endif win_data = NULL; num_values = 0; values = (XrmValue*)XtMalloc(w_window->num_attrib_list*sizeof(XrmValue)); for (i = 0; i < w_window->num_attrib_list; i++) { win_data = _WSMGetMatchingWinData(data_list, num_data_list, w_window->attrib_qlist[i]); if (win_data != NULL) { switch(win_data->type) { case WSM_CHAR_LIST_DATA: { } case WSM_SHORT_LIST_DATA: { } case WSM_LONG_LIST_DATA: { str = (char*)XtMalloc(10 * (win_data->data_len) *sizeof(char)); str[0] = '\0'; for (i = 0; i < win_data->data_len; i++) { sprintf(tempstr,"%ld",win_data->data.long_ptr[i]); strcat(str,tempstr); if (i < win_data->data_len -1) strcat(str,","); } values[num_values].addr = str; values[num_values].size = strlen(str)+1; num_values++; break; } case WSM_VALUE_DATA: { str = (char*)XtMalloc(10 *sizeof(char)); sprintf(str,"%ld", win_data->data.value); values[num_values].addr = str; values[num_values].size = strlen(str) +1; #ifdef DEBUG PRINT(" V: %s = %s \n",XrmQuarkToString(w_window->attrib_qlist[i]),str); #endif num_values++; break; } case WSM_NONE: /* Not handled case */ break; } } else { values[num_values].addr = NULL; values[num_values].size = 0; num_values++; } } *value_list_return = values; #ifdef DEBUG PRINT("return\n"); #endif if (num_values == 0) return False; else return True; } /*------------------------------------------------------------------ UpdateWinData ------------------------------------------------------------------*/ void UpdateWinData(WSMWinData *win_data, int win_data_count, WSMWinData *start_win_data, int start_win_data_count) { int i; WSMWinData *start_data; for (i = 0; i < win_data_count; i++) { start_data = _WSMGetMatchingWinData(start_win_data, start_win_data_count, win_data[i].nameq); if (start_data != NULL) WinDataCopy(start_data,&(win_data[i])); } } Boolean CvtStringToLongList(Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr from, XrmValuePtr to, XtPointer *data) { register int i, count = 1; register char *ch; char *start = from->addr; int len; static long *list; Boolean reset; char *str; XrmValue value, toVal; if (*num_args != 0) { XtAppErrorMsg(XtDisplayToApplicationContext(dpy), "cvtStringToSTringList", "wrongParamters", "XtToolkitError", "String to string list conversion needs no extra args", (String *) NULL, (Cardinal *) NULL); } if (to->addr != NULL && to->size < sizeof(XtPointer)) { to->size = sizeof(XtPointer); return FALSE; } if (start == NULL || *start == '\0') list = NULL; else { count = 1; for (ch = start; *ch != '\0'; ch++) { if (*ch == ',') count++; } list = (long*)XtMalloc(count*sizeof(long)); str = (char*)XtMalloc(10*sizeof(char)); for (i = 0; i < count; i++) { for (ch = start; *ch != ',' && *ch != '\0'; ch++){} len = ch - start; strncpy(str,start,len); str[len] = '\0'; list[i] = atol(str); start = ch+1; } XtFree((XtPointer) str); } if (to->addr == NULL) to->addr = (caddr_t)&list; else *(long**) to->addr = list; to->size = count; return TRUE; } void LongListDestructor(XtAppContext app, XrmValuePtr to , XtPointer converter_data, XrmValuePtr args, Cardinal *num_args) { long *list = (long *) to->addr; long *entry; if (list == NULL) return; for (entry = list; entry != NULL; entry++) { XtFree((XtPointer)entry); } XtFree((XtPointer)list); } motif-2.3.8/demos/programs/workspace/wsm_cb.c0000644000175000017500000007042213066310437016150 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: wsm_cb.c /main/8 1997/05/02 10:05:18 dbl $" #endif #endif #include #include #include #include #include #include #include #include #include "wsm.h" #include "wsmStruct.h" #include "wsm_ui.h" #include "wsmDebug.h" #include "xrmLib.h" #include "wsm_cb.h" #include "command_ui.h" #include "wsm_create.h" extern Boolean wsm_shown; extern Widget shell; extern WSM_UI* wsm_ui; extern Boolean connected; extern Boolean mwm_gone; extern Widget fromField; extern Widget toField; extern Space* all_space; extern Space* current_space; extern Space* space_list; extern char *file_name; Boolean copy_mode = True; /**********************************************************************/ /* WSM Dialog Interface */ /**********************************************************************/ void InitializeInterface(WSM_UI* wsm_ui) { int num_rooms = GetNumberSpaces(); int max_num_rooms = 20; wsm_ui->space_button = (Widget*) XtMalloc(max_num_rooms*sizeof(Widget)); wsm_ui->num_space_buttons = num_rooms; wsm_ui->from_option_button = (Widget*) XtMalloc(max_num_rooms*sizeof(Widget)); wsm_ui->to_option_button = (Widget*)XtMalloc((max_num_rooms +1)*sizeof(Widget)); wsm_ui->from_space = NULL; wsm_ui->to_space = NULL; } void HideWsm() { wsm_shown = False; ShowWsmCommand(); /* XtPopdown(XtParent(XtParent(wsm_ui->wsm_row_column)));*/ XtPopdown(XtParent(wsm_ui->configure_form)); XtPopdown(XtParent(wsm_ui->name_form)); XtPopdown(XtParent(wsm_ui->delete_form)); XtPopdown(XtParent(wsm_ui->save_as_form)); XtUnmapWidget(shell); } void ShowWsm() { wsm_shown = True; ShowWsmCommand(); /* XtPopup(XtParent(XtParent(wsm_ui->wsm_row_column)),XtGrabNone);*/ XtMapWidget(shell); } /**********************************************************************/ /* Workspace Panel */ /**********************************************************************/ Widget CreateWorkspacePanel(Widget shell, WSM_UI* wsm_ui, Boolean show_menu) { Widget parent; XmString xmstr; int i; Space *space; parent = CreateWorkspacePanelBX(shell,wsm_ui, show_menu); space = space_list; for (i = 0; space != NULL && i < wsm_ui->num_space_buttons; i++) { xmstr = XmStringCreateLtoR(space->name, XmSTRING_DEFAULT_CHARSET); XtVaSetValues(wsm_ui->space_button[i],XmNlabelString,xmstr,NULL); XmStringFree(xmstr); space = space->next; } return parent; } void CreateNewSpaceButton(int i, char *name, WSM_UI *wsm_ui) { int argcnt; Arg args[15]; XmString xmstr; int user_data = i+1; argcnt = 0; XtSetArg(args[argcnt], XmNindicatorSize, 20); argcnt++; XtSetArg(args[argcnt], XmNspacing, 10); argcnt++; XtSetArg(args[argcnt], XmNuserData, user_data); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr=XmStringCreateLtoR(name,XmSTRING_DEFAULT_CHARSET))); argcnt++; XtSetArg(args[argcnt], XmNrecomputeSize, True); argcnt++; wsm_ui->space_button[i] = XtCreateWidget("pushButton", xmToggleButtonWidgetClass, wsm_ui->wsm_row_column, args, argcnt); XmStringFree( xmstr ); XtAddCallback(wsm_ui->space_button[i], XmNvalueChangedCallback, SendLeaveRoomCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->space_button[i]); } /* ARGSUSED */ void SendLeaveRoomCB(Widget w, XtPointer client, XtPointer call) { int wsm_index; Space *space; XmToggleButtonCallbackStruct *toggle_struct = (XmToggleButtonCallbackStruct*)call; XtVaGetValues(w,XmNuserData, &wsm_index,NULL); if (connected && !mwm_gone) { if (toggle_struct->set) { space = GetSpaceFromID(wsm_index -1); if (space != NULL) (void) SendLeaveRoom(space); } } if (mwm_gone && current_space != NULL) XmToggleButtonSetState(wsm_ui->space_button[GetSpaceID(current_space)],True,True); } /* ARGSUSED */ void NewActivateCB(Widget w, XtPointer client, XtPointer call) { static int i = 0; char str[20]; WSM_UI *wsm_ui = (WSM_UI*)client; Space *space; if (i == 0) { for (i = 1, space = space_list; space != NULL; i++, space = space->next); } sprintf(str,"Room%d",i++); space = CreateSpace(XrmStringToQuark(str),str); CreateNewSpaceButton(wsm_ui->num_space_buttons,str, wsm_ui); CreateFromOptionButton(wsm_ui->num_space_buttons,str); CreateToOptionButton(wsm_ui->num_space_buttons,str); #ifndef _NO_CLIENT_COMMAND AddSpaceCommand(space); #endif wsm_ui->num_space_buttons++; UpdateSpaceList(wsm_ui->delete_list); UpdateSpaceList(wsm_ui->name_list); UpdateSpaceList(wsm_ui->background_list); #ifndef _NO_OCCUPY_DIALOG UpdateSpaceList(wsm_ui->occupy_list); #endif } /* ARGSUSED */ void HideActivateCB(Widget w, XtPointer client, XtPointer call) { HideWsm(); } /* ARGSUSED */ void SaveActivateCB(Widget w, XtPointer client, XtPointer call) { SendSaveWsm(file_name); } /* ARGSUSED */ void ExitCB(Widget w, XtPointer client, XtPointer call) { ManageAllWindowsAndExit(); } /**********************************************************************/ /* WSM Configure CBs */ /**********************************************************************/ void CreateFromOptionButton(int i, char *name) { int argcnt; Arg args[15]; XmString xmstr; argcnt = 0; XtSetArg(args[argcnt], XmNuserData, i+1); argcnt++; XtSetArg(args[argcnt], XmNrecomputeSize, True); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr=XmStringCreateLtoR(name, XmSTRING_DEFAULT_CHARSET))); argcnt++; wsm_ui->from_option_button[i] = XtCreateWidget("fromWorkspace1Button", xmPushButtonWidgetClass, XtParent(wsm_ui->from_option_button[0]), args, argcnt); XmStringFree( xmstr ); XtAddCallback(wsm_ui->from_option_button[i], XmNactivateCallback, FromWorkspaceCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->from_option_button[i]); } void CreateToOptionButton(int i, char *name) { int argcnt; Arg args[15]; XmString xmstr[2]; xmstr[0] = XmStringCreateSimple(name); XtVaSetValues(wsm_ui->to_option_button[i], XmNuserData, i+1, XmNlabelString, xmstr[0], NULL); XmStringFree(xmstr[0]); argcnt = 0; XtSetArg(args[argcnt], XmNuserData, 0); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr[1]=XmStringCreateLtoR("All Workspaces", XmSTRING_DEFAULT_CHARSET))); argcnt++; wsm_ui->to_option_button[i+1] = XtCreateWidget("fromWorkspace1Button", xmPushButtonWidgetClass, XtParent(wsm_ui->to_option_button[0]), args, argcnt); XmStringFree( xmstr[1] ); XtAddCallback(wsm_ui->to_option_button[i+1], XmNactivateCallback, ToWorkspaceCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->to_option_button[i+1]); } void UpdateList(Widget list,Space *s) { char *str; XmString xmstr; WorkWindowList *w_list; w_list = s->w_list; XmListDeleteAllItems(list); while (w_list != NULL) { if (_WSMGetConfigFormatType(w_list->work_win->window) == WSM_WINDOW_FMT) { str = (char*) XtMalloc((strlen(w_list->work_win->name) + 15) * sizeof(char)); sprintf(str,"0x%x %s",(unsigned)w_list->work_win->window, w_list->work_win->name); xmstr = XmStringCreateLocalized(str); XmListAddItemUnselected(list,xmstr,0); XmStringFree(xmstr); XtFree(str); } w_list = w_list->next; } } void UpdateBothList(Space *s) { if(connected) { if (wsm_ui->from_space == s) UpdateList(wsm_ui->from_list,s); if (wsm_ui->to_space == s) UpdateList(wsm_ui->to_list,s); } } void UpdateButtons(WorkWindow *w_window) { if (w_window == wsm_ui->w_window) { if (w_window->linked) XmToggleButtonSetState(wsm_ui->link_toggle,True,True); else XmToggleButtonSetState(wsm_ui->copy_toggle,True,True); if (w_window->s_list->next == NULL || w_window->window == 0 || _WSMGetConfigFormatType(w_window->window) == WSM_ICON_FMT) XtVaSetValues(wsm_ui->delete_button,XmNsensitive,False,NULL); else XtVaSetValues(wsm_ui->delete_button,XmNsensitive,True,NULL); if (w_window->window == 0 || _WSMGetConfigFormatType(w_window->window) == WSM_ICON_FMT || wsm_ui->to_space == all_space) XtVaSetValues(wsm_ui->move_button,XmNsensitive,False,NULL); else XtVaSetValues(wsm_ui->move_button,XmNsensitive,True,NULL); } } void CreateConfigureCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int space_id = -1; if (connected ) { if (wsm_ui->from_space == NULL && wsm_ui->to_space == NULL) { wsm_ui->from_space = current_space; wsm_ui->to_space = current_space; UpdateBothList(current_space); space_id = GetSpaceID(current_space); if (space_id != -1) { XtVaSetValues(wsm_ui->from_option_menu, XmNmenuHistory, wsm_ui->from_option_button[space_id], NULL); XtVaSetValues(wsm_ui->to_option_menu, XmNmenuHistory, wsm_ui->to_option_button[space_id], NULL); } } } XtManageChild(wsm_ui->configure_form); XtPopup(XtParent(wsm_ui->configure_form), XtGrabNone); } /* ARGSUSED */ void MoveCB(Widget w, XtPointer client, XtPointer call) { int pos_count = 0; int *pos_list; int i; WorkWindow *w_window; WSM_UI *wsm_ui = (WSM_UI*)client; if (XmListGetSelectedPos(wsm_ui->from_list,&pos_list, &pos_count)) { for (i = 0; i < pos_count; i++) { w_window = GetWorkWindowID(wsm_ui->from_space,pos_list[i]-1); if (w_window != NULL) MoveWindow(w_window, wsm_ui->from_space, wsm_ui->to_space); } } if (pos_count > 0) XtFree((XtPointer)pos_list); } /* ARGSUSED */ void DeleteCB(Widget w, XtPointer client, XtPointer call) { int pos_count = 0; int *pos_list; WorkWindow *w_window; WSM_UI *wsm_ui = (WSM_UI*)client; if (XmListGetSelectedPos(wsm_ui->from_list,&pos_list, &pos_count)) { w_window = GetWorkWindowID(wsm_ui->from_space,pos_list[0]-1); if (w_window != NULL) DeleteWindow(w_window, wsm_ui->from_space); } if (pos_count > 0) XtFree((XtPointer)pos_list); } /* ARGSUSED */ void ToWorkspaceCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int room_num = 0; Space *space; XtVaGetValues(w,XmNuserData,&room_num, NULL); if (room_num != 0) space = GetSpaceFromID(room_num-1); else space = all_space; if (space != NULL) { wsm_ui->to_space = space; UpdateList(wsm_ui->to_list,space); if (space == all_space) XtVaSetValues(wsm_ui->move_button,XmNsensitive,False,NULL); else XtVaSetValues(wsm_ui->move_button,XmNsensitive,True,NULL); } else PRINT("not found %d\n", room_num); } /* ARGSUSED */ void FromWorkspaceCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int room_num; Space *space; XtVaGetValues(w,XmNuserData,&room_num, NULL); space = GetSpaceFromID(room_num-1); if (space != NULL) { wsm_ui->from_space = space; UpdateList(wsm_ui->from_list,space); } else PRINT("Not Found %d\n", room_num); } void Copy(WSM_UI* wsm_ui) { int pos_count = 0; int *pos_list; int i; WorkWindow *w_window; if (XmListGetSelectedPos(wsm_ui->from_list,&pos_list, &pos_count)) { #ifdef DEBUG /* PRINT("%d copy %d from %s to %s\n", pos_count, pos_list[0], from_space, to_space);*/ #endif for (i = 0; i < pos_count; i++) { w_window = GetWorkWindowID(wsm_ui->from_space,pos_list[i] - 1); if (w_window != NULL) CopyWindow(w_window, wsm_ui->from_space,wsm_ui->to_space); } } if (pos_count > 0) XtFree((XtPointer)pos_list); } void Link(WSM_UI* wsm_ui) { int pos_count = 0; int *pos_list; WorkWindow *w_window; int i; if (XmListGetSelectedPos(wsm_ui->from_list,&pos_list, &pos_count)) { #ifdef DEBUG /* PRINT("%d copy %d from %s to %s\n", pos_count, pos_list[0], from_space, to_space);*/ #endif for (i = 0; i < pos_count ; i++) { w_window = GetWorkWindowID(wsm_ui->from_space, pos_list[i]-1); if (w_window != NULL) LinkWindow(w_window, wsm_ui->from_space, wsm_ui->to_space); } } if (pos_count > 0) XtFree((XtPointer)pos_list); } /* ARGSUSED */ void OccupyCB(Widget w, XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; Boolean copy_set; XtVaGetValues(wsm_ui->copy_toggle, XmNset,©_set,NULL); if (copy_set) Copy(wsm_ui); else Link(wsm_ui); } void WindowModeCB(Widget w,XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtVaSetValues(wsm_ui->from_list,XmNselectionPolicy,XmSINGLE_SELECT,NULL); } void ClientModeCB(Widget w,XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtVaSetValues(wsm_ui->from_list,XmNselectionPolicy,XmMULTIPLE_SELECT,NULL); } void SelectFromListCB(Widget w,XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int pos_count = 0; int *pos_list; WorkWindow *w_window; if (XmListGetSelectedPos(wsm_ui->from_list,&pos_list, &pos_count)) { w_window = GetWorkWindowID(wsm_ui->from_space,pos_list[0]-1); if (w_window != NULL) { wsm_ui->w_window = w_window; UpdateButtons(w_window); } } if (pos_count > 0) XtFree((XtPointer)pos_list); } void MultSelectFromListCB(Widget w,XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XmListCallbackStruct *list_call = (XmListCallbackStruct *)call; int pos_count = 0; int *pos_list; WorkWindow *w_window; int *select_ids; int num_select; int i; int item_pos = list_call->item_position; Boolean doit = False; PRINT("item pos %d\n",item_pos); w_window = GetWorkWindowID(wsm_ui->from_space,item_pos-1); if (w_window != NULL) { wsm_ui->w_window = w_window; UpdateButtons(w_window); GetWorkWindowClientIDs(item_pos-1, wsm_ui->from_space,&select_ids,&num_select); if (XmListGetSelectedPos(wsm_ui->from_list,&pos_list, &pos_count)) { for (i = 0; i < pos_count; i++) { if (pos_list[i] == item_pos) doit = True; } if (doit) for (i = 0; i < pos_count; i++) { if (pos_list[i] != item_pos) XmListDeselectPos(wsm_ui->from_list,pos_list[i]); } } if (num_select > 0) { for (i = 0; i < num_select; i++) { if (select_ids[i] != item_pos -1) { XmListSelectPos(w,select_ids[i] +1,False); } } } if (pos_count > 0) XtFree((XtPointer)pos_list); } } void SelectToListCB(Widget w, XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int pos_count = 0; int *pos_list; /* XmListDeselectAllItems(wsm_ui->to_list);*/ if (XmListGetSelectedPos(wsm_ui->to_list,&pos_list, &pos_count)) { XmListDeselectPos(wsm_ui->to_list,pos_list[0]); } if (pos_count > 0) XtFree((XtPointer)pos_list); } /* ARGSUSED */ void DismissConfigureCB(Widget w,XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtPopdown(XtParent(wsm_ui->configure_form)); } /**********************************************************************/ /* WSM Name Workspace CBs */ /**********************************************************************/ /* ARGSUSED */ void CreateNameCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; if (connected ) { UpdateSpaceList(wsm_ui->name_list); } XtManageChild(wsm_ui->name_form); XmListSelectPos(wsm_ui->name_list,1,True); XtPopup(XtParent(wsm_ui->name_form), XtGrabNone); } void UpdateSpaceList(Widget list) { XmString xmstr; Space *s = space_list; XmListDeleteAllItems(list); while (s != NULL) { xmstr = XmStringCreateLtoR(s->name, XmSTRING_DEFAULT_CHARSET); XmListAddItem(list,xmstr,0); XmStringFree(xmstr); s = s->next; } } void SelectNameSpaceCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int pos_count = 0; int *pos_list; Space *space; if (XmListGetSelectedPos(wsm_ui->name_list,&pos_list, &pos_count)) { space = GetSpaceFromID(pos_list[0]-1); if (space != NULL) { XmTextSetString(wsm_ui->name_text,space->name); XmTextSetString(wsm_ui->pixmap_text,space->pixmap_name); } } if (pos_count > 0) XtFree((XtPointer)pos_list); } void ChangeSpaceName(WSM_UI* wsm_ui,Space *space,int wsm_index) { XmString xmstr; xmstr = XmStringCreateLtoR(space->name, XmSTRING_DEFAULT_CHARSET); XtVaSetValues(wsm_ui->space_button[wsm_index],XmNlabelString,xmstr,NULL); XtVaSetValues(wsm_ui->from_option_button[wsm_index],XmNlabelString,xmstr,NULL); XtVaSetValues(wsm_ui->to_option_button[wsm_index],XmNlabelString,xmstr,NULL); XmStringFree(xmstr); UpdateSpaceList(wsm_ui->name_list); UpdateSpaceList(wsm_ui->delete_list); UpdateSpaceList(wsm_ui->background_list); #ifndef _NO_OCCUPY_DIALOG UpdateSpaceList(wsm_ui->occupy_list); #endif } /* ARGSUSED */ void NameActivateCB(Widget w, XtPointer client, XtPointer call) { XmProcessTraversal(wsm_ui->pixmap_text,XmTRAVERSE_CURRENT); } /* ARGSUSED */ void NameOkActivateCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; Space *space; int pos_count = 0; int *pos_list; char *old_name; char *str; if (XmListGetSelectedPos(wsm_ui->name_list,&pos_list, &pos_count)) { space = GetSpaceFromID(pos_list[0]-1); if (space != NULL) { PRINT("change name for space %s\n",space->name); old_name = (char*) XtMalloc(strlen((space->name) +1)*sizeof(char)); strcpy(old_name,space->name); str = XmTextGetString(wsm_ui->name_text); if (strlen(str) < MAX_LENGTH) { strcpy(space->name,str); if (strcmp(old_name,space->name) != 0) { PRINT("Change name to %s\n",space->name); ChangeSpaceName(wsm_ui,space,pos_list[0]-1); #ifndef _NO_CLIENT_COMMAND ChangeSpaceCommandName(space); #endif } } XtFree(str); XtFree(old_name); #ifndef _NO_PIXMAP str = XmTextGetString(wsm_ui->pixmap_text); if (strcmp(str,"None")!=0 && strcmp(str,"none") != 0 && strcmp(str,space->pixmap_name) != 0) if (SetSpaceLabelPixmap(space,str)) { XtVaSetValues(wsm_ui->space_button[GetSpaceID(space)], XmNlabelPixmap,space->pixmap_label, XmNlabelType, XmPIXMAP, NULL); } XtFree(str); XmListSelectPos(wsm_ui->name_list,pos_list[0],True); /* XtPopdown(XtParent(wsm_ui->name_form));*/ #endif } } if (pos_count > 0) XtFree((XtPointer)pos_list); } /* ARGSUSED */ void DismissNameCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtPopdown(XtParent(wsm_ui->name_form)); } /**********************************************************************/ /* WSM Background Workspace CBs */ /**********************************************************************/ /* ARGSUSED */ void CreateBackgroundCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; if (connected ) { UpdateSpaceList(wsm_ui->background_list); } XtManageChild(wsm_ui->background_form); XmListSelectPos(wsm_ui->background_list,1,True); XtPopup(XtParent(wsm_ui->background_form), XtGrabNone); } void SelectBackgroundSpaceCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int pos_count = 0; int *pos_list; Space *space; if (XmListGetSelectedPos(wsm_ui->background_list,&pos_list, &pos_count)) { space = GetSpaceFromID(pos_list[0]-1); if (space != NULL) { XmTextSetString(wsm_ui->background_text,space->background); } } if (pos_count > 0) XtFree((XtPointer)pos_list); } /* ARGSUSED */ void BackgroundActivateCB(Widget w, XtPointer client, XtPointer call) { Space *space; int pos_count = 0; int *pos_list; char *str; if (XmListGetSelectedPos(wsm_ui->background_list,&pos_list, &pos_count)) { space = GetSpaceFromID(pos_list[0]-1); if (space != NULL) { str = XmTextGetString(wsm_ui->background_text); /* SendChangeSpaceBackground(space);*/ if (str[0] != '"') { if (SetSpacePixel(space,str)) { XtVaSetValues(wsm_ui->space_button[GetSpaceID(space)], XmNbackground,space->pixel, XmNunselectColor,space->pixel, NULL); if (space == current_space) SetSpaceBackground(space); } } else { if (SetSpacePixmap(space,str+1)) { if (space == current_space) SetSpaceBackground(space); } } XtFree(str); XmListSelectPos(wsm_ui->background_list,pos_list[0],True); /* XtPopdown(XtParent(wsm_ui->background_form));*/ } } if (pos_count > 0) XtFree((XtPointer)pos_list); } /* ARGSUSED */ void DismissBackgroundCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtPopdown(XtParent(wsm_ui->background_form)); } /**********************************************************************/ /* WSM Delete Workspace CBs */ /**********************************************************************/ /* ARGSUSED */ void CreateDeleteCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; if (connected ) { UpdateSpaceList(wsm_ui->delete_list); } XtManageChild(wsm_ui->delete_form); XtPopup(XtParent(wsm_ui->delete_form), XtGrabNone); } /* ARGSUSED */ void DismissDeleteCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtPopdown(XtParent(wsm_ui->delete_form)); } /* ARGSUSED */ void DeleteActivateCB(Widget w, XtPointer client, XtPointer call) { Space *space; int pos_count = 0; int *pos_list; int i; WSM_UI *wsm_ui = (WSM_UI*)client; if (XmListGetSelectedPos(wsm_ui->delete_list,&pos_list, &pos_count)) { space = GetSpaceFromID(pos_list[0]-1); if (space != NULL) { #ifndef _NO_CLIENT_COMMAND RemoveSpaceCommand(pos_list[0]-1); #endif RemoveSpace(space); XtDestroyWidget(wsm_ui->space_button[pos_list[0]-1]); XtDestroyWidget(wsm_ui->from_option_button[pos_list[0]-1]); XtDestroyWidget(wsm_ui->to_option_button[pos_list[0]-1]); for (i = pos_list[0]-1; i < wsm_ui->num_space_buttons-1; i++) { wsm_ui->space_button[i] = wsm_ui->space_button[i+1]; XtVaSetValues(wsm_ui->space_button[i], XmNuserData,i+1,NULL); wsm_ui->from_option_button[i] = wsm_ui->from_option_button[i+1]; XtVaSetValues(wsm_ui->from_option_button[i],XmNuserData,i+1,NULL); wsm_ui->to_option_button[i] = wsm_ui->to_option_button[i+1]; XtVaSetValues(wsm_ui->to_option_button[i],XmNuserData,i+1,NULL); } wsm_ui->to_option_button[i] = wsm_ui->to_option_button[i+1]; wsm_ui->num_space_buttons--; UpdateSpaceList(wsm_ui->delete_list); UpdateSpaceList(wsm_ui->name_list); UpdateSpaceList(wsm_ui->background_list); #ifndef _NO_OCCUPY_DIALOG UpdateSpaceList(wsm_ui->occupy_list); #endif } } if (pos_count > 0) XtFree((XtPointer)pos_list); } void SelectDeleteCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int pos_count = 0; int *pos_list; Space *space; WorkWindowList *w_list; if (XmListGetSelectedPos(wsm_ui->delete_list,&pos_list, &pos_count)) { space = GetSpaceFromID(pos_list[0]-1); if (space != NULL) { w_list = space->w_list; while (w_list != NULL) { if (w_list->work_win->s_list->next == NULL) { XtVaSetValues(wsm_ui->ok_button,XmNsensitive,False,NULL); return; } w_list = w_list->next; } XtVaSetValues(wsm_ui->ok_button,XmNsensitive,True,NULL); } } if (pos_count > 0) XtFree((XtPointer)pos_list); } /**********************************************************************/ /* Save As CBs */ /**********************************************************************/ void SaveAsCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtManageChild(wsm_ui->save_as_form); XtPopup(XtParent(wsm_ui->save_as_form),XtGrabNone); } /* ARGSUSED */ void SaveAsOkCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int new_length; char *new_file_name; char *home_name; new_file_name = XmTextGetString(wsm_ui->save_as_text); if (strcmp(new_file_name,"")!= 0) { if (new_file_name[0] != '/') { home_name = getenv("HOME"); new_length = strlen(home_name) + 1 + strlen(new_file_name) + 2; file_name = XtRealloc(file_name, new_length * sizeof(char)); strcpy(file_name,home_name); strcat(file_name, "/"); strcat(file_name,new_file_name); } else { new_length = strlen(new_file_name) + 1; file_name = XtRealloc(file_name, new_length * sizeof(char)); strcpy(file_name,new_file_name); } SendSaveWsm(file_name); XtPopdown(XtParent(wsm_ui->save_as_form)); XtFree((XtPointer)new_file_name); } } /* ARGSUSED */ void DismissSaveAsCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtPopdown(XtParent(wsm_ui->save_as_form)); } /**********************************************************************/ /* WSM Occupy Workspace CBs */ /**********************************************************************/ void UpdateOccupySpaceList(Widget list) { XmString xmstr; Space *s = space_list; XmListDeleteAllItems(list); while (s != NULL) { xmstr = XmStringCreateLtoR(s->name, XmSTRING_DEFAULT_CHARSET); XmListAddItem(list,xmstr,0); XmStringFree(xmstr); s = s->next; } } /* ARGSUSED */ void CreateOccupy(WorkWindow *w_window) { wsm_ui->occupy_window = w_window; if (connected ) { UpdateSpaceList(wsm_ui->occupy_list); } if (w_window->linked) XmToggleButtonSetState(wsm_ui->link_occupy_toggle,True,True); else XmToggleButtonSetState(wsm_ui->copy_occupy_toggle,True,True); XtManageChild(wsm_ui->occupy_form); XtPopup(XtParent(wsm_ui->occupy_form), XtGrabNone); } /* ARGSUSED */ void DismissOccupyCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; XtPopdown(XtParent(wsm_ui->occupy_form)); } /* ARGSUSED */ void OccupyActivateCB(Widget w, XtPointer client, XtPointer call) { Space *space; int pos_count = 0; int *pos_list; int i; WSM_UI *wsm_ui = (WSM_UI*)client; if (XmListGetSelectedPos(wsm_ui->occupy_list,&pos_list, &pos_count)) { for (i = 0; i < pos_count; i++) { space = GetSpaceFromID(pos_list[i] - 1); if (space != NULL) { if (copy_mode) { PRINT("Copy to space: %s\n", space->name); CopyWindow(wsm_ui->occupy_window,current_space,space); } else { PRINT("Link to space: %s\n", space->name); LinkWindow(wsm_ui->occupy_window,current_space,space); } } else PRINT("Space == NULL\n"); } } if (pos_count > 0) XtFree((XtPointer)pos_list); XtPopdown(XtParent(wsm_ui->occupy_form)); } void SelectOccupyCB(Widget w, XtPointer client, XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; int pos_count = 0; int *pos_list; Space *space; WorkWindowList *w_list; if (XmListGetSelectedPos(wsm_ui->occupy_list,&pos_list, &pos_count)) { space = GetSpaceFromID(pos_list[0]-1); if (space != NULL) { } } if (pos_count > 0) XtFree((XtPointer)pos_list); } void CopyModeCB(Widget w,XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; copy_mode = XmToggleButtonGetState(w); } void LinkModeCB(Widget w,XtPointer client,XtPointer call) { WSM_UI *wsm_ui = (WSM_UI*)client; copy_mode = XmToggleButtonGetState(w); } motif-2.3.8/demos/programs/workspace/wsm.h0000644000175000017500000001051012672140200015470 00000000000000/* $TOG: wsm.h /main/6 1997/05/02 10:08:43 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsm_h #define wsm_h #include "Wsm/wsm_proto.h" /* Internal Data Strucures */ #define MAX_LENGTH 256 extern Widget utmShell; typedef struct _Space { XrmQuark nameq; char name[MAX_LENGTH]; Pixmap pixmap_label; char pixmap_name[MAX_LENGTH]; char background[MAX_LENGTH]; unsigned long pixel; Pixmap pixmap; struct _WorkWindowList *w_list; struct _Space *next; } Space; typedef struct _SpaceList { Space *space; struct _SpaceList *next; } SpaceList; typedef struct _WorkWindow { Window window; Boolean all_workspaces; Boolean linked; Boolean mapped; XrmQuarkList specifier_qlist; char *name; XrmQuarkList attrib_qlist; WSMAttribute *attrib_list; int num_attrib_list; Space *last_space; WSMWinData *win_data; Boolean used; struct _SpaceList *s_list; struct _WorkWindow *next; struct _WorkWindow *prev; } WorkWindow; typedef struct _WorkWindowList { WorkWindow *work_win; WorkWindow *sib_win; struct _WorkWindowList *next; } WorkWindowList; #ifdef DATA typedef struct _DataList { WSMWinData **data; struct _DataList *next; } DataList; #endif typedef struct _IndexStruct { int hide; int iconic; } IndexStruct; typedef struct _AtomStruct { Atom save_property; Atom wm_role_property; Atom wm_client_leader; Atom protocols_property; Atom sm_client_id_property; Atom own_selection; } AtomStruct; /* funcs */ extern void SendConnect( Widget ); extern void SendLeaveRoom( Space* ); extern void SendSaveWsm( char * ); extern void RequestReceived( Widget, XtPointer, WSMRequest*, WSMReply* ); extern void ChangeRoomCB( Widget, XtPointer, XtPointer ); extern void PrintRoomsCB( Widget, XtPointer, XtPointer ); extern void SendExtensionCB( Widget, XtPointer, XtPointer ); extern void SendConfigCB( Widget, XtPointer, XtPointer ); extern void SendStartGetStateCB( Widget, XtPointer, XtPointer ); extern void SendConnectCB( Widget, XtPointer, XtPointer ); extern void ReceiveLeaveRoomRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void ReceiveSaveWsmRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void ReceiveEnterRoomRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void ReceiveConnectRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void ReceiveExtensionsRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void ReceiveConfigRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void ReceiveSetStateRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void SendStartSetStateRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void CopyRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void CopyWindow( WorkWindow*, Space*, Space* ); extern void LinkRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void LinkWindow( WorkWindow*, Space*, Space* ); extern void DeleteWindow( WorkWindow*, Space* ); extern void MoveRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void MoveWindow( WorkWindow*, Space*, Space* ); extern void BackgroundRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void SetSpaceBackground( Space* ); extern void QuitCB( Widget, XtPointer, XtPointer ); extern void ManageAllWindowsAndExit(); extern void ExitRCB( Widget, XtPointer, WSMReply*, WSMErrorCode ); extern void CleanUpAndExit(); #endif motif-2.3.8/demos/programs/workspace/wsmDebug.c0000644000175000017500000001613612672140200016444 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wsmDebug.c /main/6 1995/07/14 09:48:58 drk $" #endif #endif #include #include #include "wsm.h" #include "wsmStruct.h" #include "wsmDebug.h" extern Space *space_list; extern Space *current_space; extern WorkWindow *work_windows; void print_space_windows( Space *s ); /**********************************************************************/ /* DEBUG CODE */ /**********************************************************************/ void print_window(WorkWindow *w_window) { #ifdef DEBUG2 int p; PRINT("\nWINDOW %d = ",w_window->window); for (p = 0; w_window->specifier_qlist[p] != NULLQUARK; p++) PRINT("%s.", XrmQuarkToString(w_window->specifier_qlist[p])); PRINT("\n"); if (w_window->mapped) PRINT("mapped\n"); else PRINT("unmapped\n"); #endif } void print_all_windows() { #ifdef DEBUG WorkWindow *w_window = work_windows; while (w_window != NULL) { PRINT("WINDOW 0x%X %s\n", w_window->window, XrmQuarkToString(w_window->specifier_qlist[0])); w_window = w_window->next; } #endif } void print_space_windows(Space *s) { #ifdef DEBUG WorkWindowList *w_list; if (s!= NULL) { w_list = s->w_list; while (w_list != NULL) { PRINT("SPACE %s WINDOW 0x%X %s\n", XrmQuarkToString(s->nameq), w_list->work_win->window, XrmQuarkToString(w_list->work_win->specifier_qlist[0])); w_list = w_list->next; } } else PRINT("NULL space\n"); #endif } void print_all_values(XrmValue **attr_values,XrmQuarkList attrib_qlist,XrmQuarkList rooms_qlist, int num_attrib) { #ifdef DEBUG int p,q; for (p = 0; rooms_qlist[p] != NULLQUARK; p++) { for (q = 0; q < num_attrib; q++) { if (attr_values[p][q].size != 0) PRINT("%s %s : %s \n", XrmQuarkToString(rooms_qlist[p]), XrmQuarkToString(attrib_qlist[q]), (char*)attr_values[p][q].addr); else { PRINT("%s %s : NOT FOUND \n", XrmQuarkToString(rooms_qlist[p]), XrmQuarkToString(attrib_qlist[q])); } } } #endif } void print_values(XrmValue *attr_values,XrmQuarkList attrib_qlist,XrmQuark room, int num_attrib) { #ifdef DEBUG2 int q; for (q = 0; q < num_attrib; q++) { if (attr_values[q].size != 0) PRINT(" v: %s %s : %s \n", XrmQuarkToString(room), XrmQuarkToString(attrib_qlist[q]), (char*)attr_values[q].addr); else PRINT(" v: %s %s : NOT FOUND \n", XrmQuarkToString(room), XrmQuarkToString(attrib_qlist[q])); } #endif } void print_win_data( WSMWinData *xrm_data_list, int num_xrm_data_list) { int p; #ifdef DEBUG2 if (num_xrm_data_list == 0) PRINT("D: no data \n"); else { for (p = 0; p < num_xrm_data_list; p++) { PRINT("D: %s %ld\n", XrmQuarkToString(xrm_data_list[p].nameq), xrm_data_list[p].data.value); } } #endif } void print_internal_win_data( WSMWinData *xrm_data_list, int num_xrm_data_list) { #ifdef DEBUG int p; for (p = 0; p < num_xrm_data_list; p++) { PRINT("I: %s %ld\n", XrmQuarkToString(xrm_data_list[p].nameq), xrm_data_list[p].data.value); } #endif } void print_request(WSMRequest *request) { #ifdef DEBUG2 int p,q,i; Window window; WorkWindow *w_window; PRINT("\nREQUEST:\n"); if (request->any.type == WSM_SET_STATE) { PRINT("num_win_info_list = %d\n",request->set_state.num_win_info_list); for (p = 0; p < request->set_state.num_win_info_list; p++) { window = request->set_state.win_info_list[p].window; w_window = GetWorkWindow(window); PRINT(" %d ",window); if ( _WSMGetConfigFormatType(window) == WSM_ICON_FMT) PRINT(" ICON "); else if ( _WSMGetConfigFormatType(window) == WSM_WINDOW_FMT) PRINT(" WINDOW "); else if ( _WSMGetConfigFormatType(window) == WSM_GLOBAL_FMT) PRINT(" GLOBAL "); if (w_window != NULL) { for (i = 0; w_window->specifier_qlist[i] != NULLQUARK; i++) PRINT("%s.", XrmQuarkToString(w_window->specifier_qlist[i])); } PRINT("\n"); for (q = 0; q < request->set_state.win_info_list[p].num_data_list; q++) { PRINT(" %s %d\n", XrmQuarkToString(request->set_state.win_info_list[p].data_list[q].nameq), request->set_state.win_info_list[p].data_list[q].data.value); } } } PRINT("\n"); #endif } void print_reply(WSMReply *reply) { #ifdef DEBUG2 int q; PRINT("\n"); if (reply->any.type == WSM_REG_WINDOW) { PRINT("REPLY WSM_REG_WINDOW\n"); for (q = 0; q < reply->register_window.num_window_data; q++) { PRINT(" %s %d\n", XrmQuarkToString(reply->register_window.window_data[q].nameq), reply->register_window.window_data[q].data.value); } } #endif } void print_reply_start_state(WSMGetStateReply *get_state) { #ifdef DEBUG2 int i,j,p; Window window; WorkWindow *w_window; PRINT("REPLY WSM_GET_STATE\n"); for (i = 0; i < get_state->num_win_info_list; i ++) { window = get_state->win_info_list[i].window; w_window = GetWorkWindow(window); /* PRINT(" 0x%X \n",window);*/ PRINT(" %d ",window); if ( _WSMGetConfigFormatType(window) == WSM_ICON_FMT) PRINT(" ICON "); else if ( _WSMGetConfigFormatType(window) == WSM_WINDOW_FMT) PRINT(" WINDOW "); else if ( _WSMGetConfigFormatType(window) == WSM_GLOBAL_FMT) PRINT(" GLOBAL "); if (w_window != NULL) { for (p = 0; w_window->specifier_qlist[p] != NULLQUARK; p++) PRINT("%s.", XrmQuarkToString(w_window->specifier_qlist[p])); } PRINT("\n"); for (j = 0; j < get_state->win_info_list[i].num_data_list; j++) PRINT(" %s %ld\n", XrmQuarkToString(get_state->win_info_list[i].data_list[j].nameq), get_state->win_info_list[i].data_list[j].data.value); } #endif } void PrintSpace(char *name) { #ifdef DEBUG Space *s; s = GetSpace(XrmStringToQuark(name)); if (s != NULL) print_space_windows(s); #endif } void PrintAllSpaces() { #ifdef DEBUG Space *s = space_list; while (s != NULL) { PRINT("SPACE: %s\n", s->name); PRINT(" pixmap_name: %s\n", s->pixmap_name); PRINT(" background: %s\n", s->background); print_space_windows(s); s = s->next; } #endif } motif-2.3.8/demos/programs/workspace/wsmData.h0000644000175000017500000000350612672140200016271 00000000000000/* $XConsortium: wsmData.h /main/5 1995/07/15 20:46:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmData_h #define wsmData_h /* i use the following code to switch between XrmValues and WSMWinData structures */ extern void UpdateXrm(); extern Boolean CreateWSMWinData( XrmValue*, Boolean, WorkWindow*, WSMWinData**, int* ); extern Boolean CreateStartWSMWinData( XrmValue*, Boolean, WSMWinData*, int, WorkWindow*, WSMWinData**, int* ); extern void CreateStartHideWSMWinData( Boolean, WSMWinData *, int, WorkWindow*, WSMWinData**, int* ); extern void CreateHideWSMWinData( Boolean, WorkWindow*, WSMWinData**, int* ); extern void CreateUnhideWSMWinData( XrmValue *, WorkWindow*, WSMWinData**, int* ); extern Boolean CreateValues( WorkWindow *, WSMWinData *data_list, int num_data_list, XrmValue **value_list_return ); extern void FreeValues( int num_values, XrmValue *value_list ); extern void UpdateWinData( WSMWinData*, int, WSMWinData*, int ); #endif motif-2.3.8/demos/programs/workspace/README0000644000175000017500000001552012672140200015377 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:10:03 drk $ */ Motif Workspace Manager - Wsm ----------------------------- ************************************************************************ * This demo only works with Mwm 2.0. It does not work with Mwm 2.1. * ************************************************************************ The Motif Workspace Manager uses the new Workspace Manager protocol supported in the Motif Window Manager (Mwm) 2.0. Wsm provides a way for users to group windows and applications into workspaces or rooms. Only one room or workspace is visible at one time. By only viewing windows in one workspace at a time, your desktop can be greatly reduced of clutter. With Wsm, it is possible to have one window duplicated in multiple workspaces. These duplicates can be either references to each other, where the width, height, stacking order and other attributes are kept the same in each workspace, or they can be copies, where each instance can have a different position, size, or other attribute from its counterparts in the other workspaces. The term 'Link' is used to refer to duplicates that each reference the same set of attributes. The term 'Copy' is used to refer to duplicates that contain their own attribute sets independent from each other. There are two methods of accessing all the functionality of the workspace manager. The first is through commands added by Wsm to Mwm menus. The second is through the interface provided through the initial WSM dialog. The Mwm Menu Interface ---------------------- Wsm will add menu entries to Mwm's menus that provide you with the needed tools to use the capabilities of Wsm. Each window menu will be modified by adding the following items: Occupy... This will display a dialog window allowing you to select which workspaces the associated window should be duplicated into. The dialog also allows either Link or Copy the window to each of the selected workspaces. Copy To All This will cause the window to be copied to each of the workspaces. Link To All This will cause the window to be linked to each of the workspaces. Remove From Workspace This will remove the window from this workspace. If the window is only in one workspace, then this command will be inactive. It is not possible to remove a window from all workspaces using this command. Wsm will modify the root menu (specified by Mwm's resource 'rootMenu') by adding the following commands: Switch Workspace This is a cascade menu which will cascade to a menu containing an entry for each workspace. Selecting an item will cause Wsm to switch to the corresponding workspace. Hide Workspace Manager (Show Workspace Manager) This will cause the workspace to be unmapped (mapped) and the menu item label to be switched to Show Workspace Manager (Hide Workspace Manager). Wsm Dialog Interface -------------------- The Wsm dialog window contains a menu bar and a rowcolumn contining a toggle button associated with each workspace. A popup menu can also be displayed by pressing Button3 in the rowcolumn area. The menu bar contains the following: File ---- Save Saves the state of the workspace manager and the information it holds for each window. The data is stored in the workspace manager configuration file which, by default, is $HOME/.wsmdb. Save As... Prompts for the name of the file to save the workspace manager data into. Quit Terminates the workspace. Note that there may be a slight delay before the workspace manager fully terminates since it does some cleaning-up of Mwm's menus and removes the items it added. Workspace --------- New Workspace Creates a new workspace and adds the associated toggle button to the rowcolumn. Rename Workspaces... Displays a dialog window that allows you you to rename each of the workspaces. It also allows you to enter a fully qualified bitmap to use as the label instead of the name. Set Background... This displays a dialog that allows you to specify the background color of the workspace. Configure Workspaces... This displays a dialog that allows you to move windows from one workspace to another. In the dialog, two lists are displayed. On top of each list is an option menu that allows you to select the corresponding workspace for the windows in the list. By selecting a window or windows in the left list, you can copy or move the window to the workspace specified in the list on the right. By selecting Remove, you can, instead, remove them from the workspace on the left. The buttons at the bottom, Client and Window, will cause either all windows for a client to automatically be selected, or individual windows. Delete Workspaces... This displays a dialog prompting you to select the workspace(s) you with to delete. View ---- Hide Workspace Manager This will cause the workspace manager to unmap. Make sure that Wsm has inserted the command 'Hide Workspace Manager' into your root menu. If not, then you will not be able to restore the workspace manager! The popup menu, displayed by pressing Button3 in the workspace rowcolumn contains the following items and matches the descriptions above: New Workspace Rename Workspaces... Set Background... Configure Workspaces... Delete Workspaces... ------------------- Hide Workspace Manager ------------------- Save Save As... ------------------- Exit Note, by default the workspace manager does not occupy all workspaces. You should select 'Copy To All' or 'Link To All' the first time Wsm is used. After you have saved your configuration, this is no longer necessary. Wsm supports the following resources: fileName Specifies the name of the workspace manager configuration file. workspaceList Specifies the list of workspaces to use. backgroundList Specifies the background color to apply to each of the workspaces. labelPixmapList Specifies the label image to use for each of the workspace buttons. currentWorkspace Specifies the default workspace from the list of workspaces. useMenuBar If True, a menuBar is displayed in the Wsm main dialog window. The default is True. Wsm supports the following command-line options: -fileName, -file, -f Specifies the name of the workspace manager configuration file. -workspaceList, -wL Specifies the list of workspaces to use. -backgroundList, -bL Specifies the background color to apply to each of the workspaces. -labelPixmapList, -labelPL Specifies the label image to use for each of the workspace buttons. -currentWorkspace, -cW Specifies the default workspace from the list of workspaces. -showWSDialog, -s If True, a menuBar is displayed in the Wsm main dialog window. The default is True. motif-2.3.8/demos/programs/workspace/wsmSend.h0000644000175000017500000000470312672140200016311 00000000000000/* $XConsortium: wsmSend.h /main/5 1995/07/15 20:46:36 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmSend_h #define wsmSend_h #include "wsm.h" extern void CreateStartStateRequest( WSMGetStateReply *get_state, WSMRequest *request ); extern void CreateReStartStateRequest( WSMGetStateReply *get_state, WSMRequest *request ); extern void CreateReStartStateRequest2( WSMGetStateReply *get_state, WSMRequest *request ); extern void GetChangeSpaceRequest( Space*, WSMRequest* ); extern void GetRegisterOldWindowReply( WorkWindow*, WSMReply* ); extern void GetRegisterWindowReply( Window, WSMReply* ); extern void SaveState( WSMGetStateReply*, Boolean ); extern void RemoveWindow( Window ); extern void DealWithMapNotify( Widget, XMapEvent *ev ); extern void DealWithUnmapNotify( Widget, XUnmapEvent *ev ); extern void DealWithClientMessage( Widget, XClientMessageEvent *ev ); extern void DealWithDestroyNotify( Widget, XDestroyWindowEvent *ev ); extern void DealWithDestroyMwmNotify(); extern Boolean GetCopyWindowRequest( Window, Space *, Space *, WSMRequest * ); extern void CopyWindowToAllSpaces( WorkWindow*, WorkWindow*, XrmValue*, XrmValue*, Space * ); extern void CopyWindowToSpace( WorkWindow*, WorkWindow*, XrmValue*, XrmValue*, Space * ); extern Boolean GetMoveWindowRequest( Window, Space *, Space *, WSMRequest * ); extern Boolean GetDeleteWindowRequest( Window, Space *, WSMRequest * ); extern Boolean GetLinkWindowRequest( Window, Space *, Space *, WSMRequest * ); extern Boolean GetManageAllWindowsRequest( WSMRequest* ); #endif motif-2.3.8/demos/programs/workspace/wsmStruct.h0000644000175000017500000000563712672140200016713 00000000000000/* $XConsortium: wsmStruct.h /main/5 1995/07/15 20:46:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmStruct_h #define wsmStruct_h #include "wsm.h" extern Space* CreateSpace( XrmQuark, char* ); extern Boolean SetSpacePixel( Space *, char* ); extern Boolean SpacePixelSet( Space * ); extern Boolean SetSpacePixmap( Space *, char* ); extern Boolean SpacePixmapSet( Space * ); extern Boolean SetSpaceLabelPixmap( Space *, char* ); extern Boolean SpaceLabelPixmapSet( Space * ); extern Boolean CreateInternalStructure( WorkWindow*, XrmQuark* ); extern WorkWindow* CreateWorkWindow( Window ); extern WorkWindow* ReCreateWorkWindow( Window ); extern void SetWorkWindowValues( WorkWindow*, Boolean, Boolean ); extern Space* GetSpace( XrmQuark ); extern Space* GetSpaceFromName( char* ); extern int GetSpaceID( Space* ); extern int GetNumberSpaces(); extern WorkWindow* GetWorkWindowID( Space*, int ); extern Space* GetSpaceFromID( int ); extern WorkWindow* GetWorkWindow( Window ); extern WorkWindow* GetWorkWindowClient( Window, WorkWindow***, int* ); extern Boolean GetWorkWindowClientIDs( int, Space*, int**, int* ); extern WorkWindow* GetIconWorkWindow( Window ); extern void AddSpaceToWindow( Space*, WorkWindow* ); extern void AddWindowToSpace( Space*, WorkWindow* ); extern void RemoveWorkWindowFromSpace( Space*, WorkWindow* ); extern void RemoveSpaceFromWindow( Space*, WorkWindow* ); extern void RemoveWorkWindow( WorkWindow*, Boolean ); extern void RemoveSpace( Space* ); extern Boolean IsWorkWindowInSpace( WorkWindow*, Space* ); extern Boolean IsSpaceInWorkWindow( Space*, WorkWindow* ); extern void InitializeWsm(); extern void CompleteRestartWSM(); extern void RestartWSM(); extern void FinishRestartWSM(); extern Window GetWSMWindow( WorkWindow* ); extern void MapWorkWindow( WorkWindow* ); extern void UnmapWorkWindow( WorkWindow* ); extern void UnmapCurrentSpace( ); #endif motif-2.3.8/demos/programs/workspace/wsm_create.c0000644000175000017500000015747012672140200017027 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: wsm_create.c /main/7 1996/10/30 10:23:18 cde-osf $" #endif #endif /* * Required Motif Include Files */ #include #include #include #include #include #include #include #include #include #include #include #include /* * User supplied include files. */ #include "wsm_ui.h" #include "wsm_cb.h" #include "wsm.h" #include "wsmStruct.h" /* * Some Convenience Routines */ void MENU_POST(); extern Space *current_space; /* * Literal Definitions */ /* * Global widget declarations. * - first remove definition of EXTERNAL */ #ifdef EXTERNAL #undef EXTERNAL #endif #define EXTERNAL /* Start Global Widget Declarations */ /* End Global Widget Declarations */ /* * Function: * MENU_POST(p, mw, ev, dispatch); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * p - Widget : the widget to post * mw - XtPointer : the menu widget * ev - XEvent* : the event that caused the menu post * dispatch - Boolean* : not used * Output: * None */ #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #ifndef IGNORE_MENU_POST void MENU_POST ARGLIST((p, mw, ev, dispatch)) ARG(Widget, p) ARG(XtPointer, mw) ARG(XEvent *, ev) GRA(Boolean *, dispatch) { Arg args[2]; int argcnt; int button; Widget m = (Widget)mw; XButtonEvent *e = (XButtonEvent *)ev; argcnt = 0; XtSetArg(args[argcnt], XmNwhichButton, &button); argcnt++; XtGetValues(m, args, argcnt); if( e->button != button) return; XmMenuPosition(m, e); XtManageChild(m); } #endif Widget CreateNameWorkspace(Widget parent, WSM_UI* wsm_ui) { Arg args[32]; Cardinal argcnt; /*SUPPRESS 591*/ Widget retval; /*SUPPRESS 591*/ Widget cancelButton; Widget separator; Widget okButton; Widget nameLabel; Widget pixmapLabel; Widget nameTitleLabel; Widget nameWindow; Widget buttonForm; Widget nameForm; Widget pixForm; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; wsm_ui->name_form = XtCreateWidget("nameForm", xmFormWidgetClass, parent, args, argcnt); retval = wsm_ui->name_form; argcnt = 0; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; nameTitleLabel = XtCreateWidget("nameTitleLabel", xmLabelWidgetClass, wsm_ui->name_form, args, argcnt); XtManageChild(nameTitleLabel); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; buttonForm = XtCreateWidget("buttonForm", xmFormWidgetClass, wsm_ui->name_form, args, argcnt); XtManageChild(buttonForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; okButton = XtCreateWidget("applyButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(okButton, XmNactivateCallback, NameOkActivateCB, (XtPointer)wsm_ui); XtManageChild(okButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; cancelButton = XtCreateWidget("dismissButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(cancelButton, XmNactivateCallback, DismissNameCB, (XtPointer)wsm_ui); XtManageChild(cancelButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, buttonForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; separator = XtCreateWidget("separator", xmSeparatorWidgetClass, wsm_ui->name_form, args, argcnt); XtManageChild(separator); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, separator); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; pixForm = XtCreateWidget("pixForm", xmFormWidgetClass, wsm_ui->name_form, args, argcnt); XtManageChild(pixForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; pixmapLabel = XtCreateWidget("pixmapLabel", xmLabelWidgetClass, pixForm, args, argcnt); #ifndef _NO_PIXMAP XtManageChild(pixmapLabel); #endif argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, pixmapLabel); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; wsm_ui->pixmap_text = XtCreateWidget("textField", xmTextFieldWidgetClass, pixForm, args, argcnt); XtAddCallback(wsm_ui->pixmap_text, XmNactivateCallback, NameOkActivateCB, (XtPointer)wsm_ui); #ifndef _NO_PIXMAP XtManageChild(wsm_ui->pixmap_text); #endif argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, pixForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; nameForm = XtCreateWidget("wnameForm", xmFormWidgetClass, wsm_ui->name_form, args, argcnt); XtManageChild(nameForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; nameLabel = XtCreateWidget("nameLabel", xmLabelWidgetClass, nameForm, args, argcnt); XtManageChild(nameLabel); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, nameLabel); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; wsm_ui->name_text = XtCreateWidget("textField", xmTextFieldWidgetClass, nameForm, args, argcnt); XtAddCallback(wsm_ui->name_text, XmNactivateCallback, NameActivateCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->name_text); argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAPPLICATION_DEFINED); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, nameTitleLabel); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, nameForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; nameWindow = XtCreateWidget("nameWindow", xmScrolledWindowWidgetClass, wsm_ui->name_form, args, argcnt); XtManageChild(nameWindow); argcnt = 0; XtSetArg(args[argcnt], XmNshadowThickness, 2); argcnt++; XtSetArg(args[argcnt], XmNitemCount, 0); argcnt++; XtSetArg(args[argcnt], XmNselectionPolicy, XmSINGLE_SELECT); argcnt++; XtSetArg(args[argcnt], XmNlistSizePolicy, XmCONSTANT); argcnt++; wsm_ui->name_list = XtCreateWidget("nameList", xmListWidgetClass, nameWindow, args, argcnt); XtAddCallback(wsm_ui->name_list, XmNsingleSelectionCallback, SelectNameSpaceCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->name_list); return( retval ); } Widget CreateBackgroundWorkspace(Widget parent, WSM_UI* wsm_ui) { Arg args[32]; Cardinal argcnt; Widget retval; Widget cancelButton; Widget separator; Widget okButton; Widget backgroundLabel; Widget backgroundTitleLabel; Widget backgroundWindow; Widget buttonForm; Widget bgForm; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; wsm_ui->background_form = XtCreateWidget("backgroundForm", xmFormWidgetClass, parent, args, argcnt); retval = wsm_ui->background_form; argcnt = 0; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; backgroundTitleLabel = XtCreateWidget("backgroundTitleLabel", xmLabelWidgetClass, wsm_ui->background_form, args, argcnt); XtManageChild(backgroundTitleLabel); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; buttonForm = XtCreateWidget("buttonForm", xmFormWidgetClass, wsm_ui->background_form, args, argcnt); XtManageChild(buttonForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; okButton = XtCreateWidget("applyButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(okButton, XmNactivateCallback, BackgroundActivateCB, (XtPointer)wsm_ui); XtManageChild(okButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; cancelButton = XtCreateWidget("dismissButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(cancelButton, XmNactivateCallback, DismissBackgroundCB, (XtPointer)wsm_ui); XtManageChild(cancelButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, buttonForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; separator = XtCreateWidget("separator", xmSeparatorWidgetClass, wsm_ui->background_form, args, argcnt); XtManageChild(separator); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, separator); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; bgForm = XtCreateWidget("bgForm", xmFormWidgetClass, wsm_ui->background_form, args, argcnt); XtManageChild(bgForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; backgroundLabel = XtCreateWidget("backgroundLabel", xmLabelWidgetClass, bgForm, args, argcnt); XtManageChild(backgroundLabel); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, backgroundLabel); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; wsm_ui->background_text = XtCreateWidget("textField", xmTextFieldWidgetClass, bgForm, args, argcnt); XtAddCallback(wsm_ui->background_text, XmNactivateCallback, BackgroundActivateCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->background_text); argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAPPLICATION_DEFINED); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, backgroundTitleLabel); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, bgForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; backgroundWindow = XtCreateWidget("backgroundWindow", xmScrolledWindowWidgetClass, wsm_ui->background_form, args, argcnt); XtManageChild(backgroundWindow); argcnt = 0; XtSetArg(args[argcnt], XmNshadowThickness, 2); argcnt++; XtSetArg(args[argcnt], XmNitemCount, 0); argcnt++; XtSetArg(args[argcnt], XmNselectionPolicy, XmSINGLE_SELECT); argcnt++; XtSetArg(args[argcnt], XmNlistSizePolicy, XmCONSTANT); argcnt++; wsm_ui->background_list = XtCreateWidget("backgroundList", xmListWidgetClass, backgroundWindow, args, argcnt); XtAddCallback(wsm_ui->background_list, XmNsingleSelectionCallback, SelectBackgroundSpaceCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->background_list); return( retval ); } Widget CreateDeleteWorkspace(Widget parent, WSM_UI* wsm_ui) { Arg args[32]; Cardinal argcnt; Widget retval; Widget deleteWindow; Widget deleteTitleLabel; Widget cancelButton1; Widget separator; Widget buttonForm; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; wsm_ui->delete_form = XtCreateWidget("deleteForm", xmFormWidgetClass, parent, args, argcnt); retval = wsm_ui->delete_form; argcnt = 0; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; deleteTitleLabel = XtCreateWidget("deleteTitleLabel", xmLabelWidgetClass, wsm_ui->delete_form, args, argcnt); XtManageChild(deleteTitleLabel); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; buttonForm = XtCreateWidget("buttonForm", xmFormWidgetClass, wsm_ui->delete_form, args, argcnt); XtManageChild(buttonForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; wsm_ui->ok_button = XtCreateWidget("applyButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(wsm_ui->ok_button, XmNactivateCallback, DeleteActivateCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->ok_button); XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; cancelButton1 = XtCreateWidget("dismissButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(cancelButton1, XmNactivateCallback, DismissDeleteCB, (XtPointer)wsm_ui); XtManageChild(cancelButton1); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, buttonForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; separator = XtCreateWidget("separator", xmSeparatorWidgetClass, wsm_ui->delete_form, args, argcnt); XtManageChild(separator); argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAPPLICATION_DEFINED); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, deleteTitleLabel); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, separator); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; deleteWindow = XtCreateWidget("deleteWindow", xmScrolledWindowWidgetClass, wsm_ui->delete_form, args, argcnt); XtManageChild(deleteWindow); argcnt = 0; XtSetArg(args[argcnt], XmNshadowThickness, 2); argcnt++; XtSetArg(args[argcnt], XmNitemCount, 0); argcnt++; XtSetArg(args[argcnt], XmNselectionPolicy, XmSINGLE_SELECT); argcnt++; XtSetArg(args[argcnt], XmNlistSizePolicy, XmCONSTANT); argcnt++; XtSetArg(args[argcnt], XmNvisibleItemCount, 10); argcnt++; wsm_ui->delete_list = XtCreateWidget("deleteList", xmListWidgetClass, deleteWindow, args, argcnt); XtAddCallback(wsm_ui->delete_list, XmNsingleSelectionCallback, SelectDeleteCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->delete_list); return( retval ); } Widget CreateConfigureWorkspace(Widget parent, WSM_UI* wsm_ui) { Arg args[32]; Cardinal argcnt; /*SUPPRESS 591*/ Widget retval; /*SUPPRESS 591*/ XmString xmstr[32]; Widget fromScrolledWindow; Widget toScrolledWindow; Widget occupyButton; Widget toggleRow; Widget toggleRow2; Widget titleLabel; Widget dismissButton; Widget separator2; Widget menuShell1; Widget pulldownMenu1; Widget menuShell; Widget pulldownMenu; Widget current_button =0; Widget fromForm, buttonForm, toForm; int i; Space *s; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; wsm_ui->configure_form = XtCreateWidget("configureForm", xmFormWidgetClass, parent, args, argcnt); retval = wsm_ui->configure_form; argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; titleLabel = XtCreateWidget("titleLabel", xmLabelWidgetClass, wsm_ui->configure_form, args, argcnt); XtManageChild(titleLabel); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNleftPosition, 45); argcnt++; dismissButton = XtCreateWidget("dismissButton", xmPushButtonWidgetClass, wsm_ui->configure_form, args, argcnt); XtAddCallback(dismissButton, XmNactivateCallback, DismissConfigureCB, (XtPointer)wsm_ui); XtManageChild(dismissButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, dismissButton); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; separator2 = XtCreateWidget("separator2", xmSeparatorWidgetClass, wsm_ui->configure_form, args, argcnt); XtManageChild(separator2); /* * The window/client radio box */ argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNradioBehavior, True); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, separator2); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, separator2); argcnt++; toggleRow2 = XtCreateWidget("toggleRow", xmRowColumnWidgetClass, wsm_ui->configure_form, args, argcnt); XtManageChild(toggleRow2); argcnt = 0; XtSetArg(args[argcnt], XmNindicatorType, XmONE_OF_MANY); argcnt++; XtSetArg(args[argcnt], XmNset, True); argcnt++; wsm_ui->window_toggle = XtCreateWidget("windowButton", xmToggleButtonWidgetClass, toggleRow2, args, argcnt); XtAddCallback(wsm_ui->window_toggle, XmNvalueChangedCallback, WindowModeCB, (XtPointer)wsm_ui); #ifndef _NO_CLIENT_MODE XtManageChild(wsm_ui->window_toggle); #endif argcnt = 0; XtSetArg(args[argcnt], XmNindicatorType, XmONE_OF_MANY); argcnt++; wsm_ui->client_toggle = XtCreateWidget("clientButton", xmToggleButtonWidgetClass, toggleRow2, args, argcnt); XtAddCallback(wsm_ui->client_toggle, XmNvalueChangedCallback, ClientModeCB, (XtPointer)wsm_ui); #ifndef _NO_CLIENT_MODE XtManageChild(wsm_ui->client_toggle); #endif /* * The three container forms */ argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, titleLabel); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNleftPosition, 50); argcnt++; buttonForm = XtCreateWidget("buttonForm", xmFormWidgetClass, wsm_ui->configure_form, args, argcnt); XtManageChild(buttonForm); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, titleLabel); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNrightWidget, buttonForm); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, toggleRow2); argcnt++; fromForm = XtCreateWidget("fromForm", xmFormWidgetClass, wsm_ui->configure_form, args, argcnt); XtManageChild(fromForm); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, titleLabel); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, buttonForm); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, toggleRow2); argcnt++; toForm = XtCreateWidget("toForm", xmFormWidgetClass, wsm_ui->configure_form, args, argcnt); XtManageChild(toForm); /* * The option menus */ argcnt = 0; XtSetArg(args[argcnt], XmNwidth, 1); argcnt++; XtSetArg(args[argcnt], XmNheight, 1); argcnt++; menuShell = XtCreatePopupShell("menuShell", xmMenuShellWidgetClass, toForm, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_PULLDOWN); argcnt++; pulldownMenu = XtCreateWidget("pulldownMenu", xmRowColumnWidgetClass, menuShell, args, argcnt); for (i = 0; i< wsm_ui->num_space_buttons; i++) { s = GetSpaceFromID(i); argcnt = 0; XtSetArg(args[argcnt], XmNuserData, i+1); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr[0]=XmStringCreateLtoR(s->name, XmSTRING_DEFAULT_CHARSET))); argcnt++; wsm_ui->to_option_button[i] = XtCreateWidget("toWorkspace1Button", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(wsm_ui->to_option_button[i], XmNactivateCallback, ToWorkspaceCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->to_option_button[i]); XmStringFree(xmstr[0]); if (s == current_space) current_button = wsm_ui->to_option_button[i]; } argcnt = 0; XtSetArg(args[argcnt], XmNuserData, 0); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr[0]=XmStringCreateLtoR("All Workspaces", XmSTRING_DEFAULT_CHARSET))); argcnt++; wsm_ui->to_option_button[i] = XtCreateWidget("toAllWorkspaceButton", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(wsm_ui->to_option_button[i], XmNactivateCallback, ToWorkspaceCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->to_option_button[i]); XmStringFree(xmstr[0]); argcnt = 0; XtSetArg(args[argcnt], XmNmarginWidth, 0); argcnt++; XtSetArg(args[argcnt], XmNspacing, 0); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr[0]=XmStringCreateLtoR( "", XmSTRING_DEFAULT_CHARSET))); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_OPTION); argcnt++; XtSetArg(args[argcnt], XmNsubMenuId, pulldownMenu); argcnt++; if (current_button) {XtSetArg(args[argcnt], XmNmenuHistory, current_button);argcnt++;} wsm_ui->to_option_menu = XtCreateWidget("toMenu", xmRowColumnWidgetClass, toForm, args, argcnt); XtManageChild(wsm_ui->to_option_menu); XmStringFree(xmstr[0]); argcnt = 0; XtSetArg(args[argcnt], XmNwidth, 1); argcnt++; XtSetArg(args[argcnt], XmNheight, 1); argcnt++; menuShell1 = XtCreatePopupShell("menuShell1", xmMenuShellWidgetClass, fromForm, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_PULLDOWN); argcnt++; pulldownMenu1 = XtCreateWidget("pulldownMenu1", xmRowColumnWidgetClass, menuShell1, args, argcnt); current_button = 0; for (i = 0; i< wsm_ui->num_space_buttons; i++) { s = GetSpaceFromID(i); argcnt = 0; XtSetArg(args[argcnt], XmNuserData, i+1); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr[0]= XmStringCreateLtoR(s->name,XmSTRING_DEFAULT_CHARSET))); argcnt++; wsm_ui->from_option_button[i] = XtCreateWidget("fromWorkspace1Button", xmPushButtonWidgetClass, pulldownMenu1, args, argcnt); XtAddCallback(wsm_ui->from_option_button[i], XmNactivateCallback, FromWorkspaceCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->from_option_button[i]); XmStringFree(xmstr[0]); if (s == current_space) current_button = wsm_ui->to_option_button[i]; } argcnt = 0; XtSetArg(args[argcnt], XmNmarginWidth, 0); argcnt++; XtSetArg(args[argcnt], XmNspacing, 0); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr[0]=XmStringCreateLtoR( "", XmSTRING_DEFAULT_CHARSET))); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_OPTION); argcnt++; XtSetArg(args[argcnt], XmNsubMenuId, pulldownMenu1); argcnt++; if (current_button) {XtSetArg(args[argcnt], XmNmenuHistory, current_button);argcnt++;} wsm_ui->from_option_menu = XtCreateWidget("fromMenu", xmRowColumnWidgetClass, fromForm, args, argcnt); XtManageChild(wsm_ui->from_option_menu); XmStringFree(xmstr[0]); /* * The scrolled lists */ argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAPPLICATION_DEFINED); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, wsm_ui->from_option_menu); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; fromScrolledWindow = XtCreateWidget("fromScrolledWindow", xmScrolledWindowWidgetClass, fromForm, args, argcnt); XtManageChild(fromScrolledWindow); argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAPPLICATION_DEFINED); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, wsm_ui->to_option_menu); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; toScrolledWindow = XtCreateWidget("toScrolledWindow", xmScrolledWindowWidgetClass, toForm, args, argcnt); XtManageChild(toScrolledWindow); argcnt = 0; XtSetArg(args[argcnt], XmNshadowThickness, 2); argcnt++; XtSetArg(args[argcnt], XmNitemCount, 0); argcnt++; XtSetArg(args[argcnt], XmNselectionPolicy, XmSINGLE_SELECT); argcnt++; XtSetArg(args[argcnt], XmNlistSizePolicy, XmCONSTANT); argcnt++; wsm_ui->from_list = XtCreateWidget("fromList", xmListWidgetClass, fromScrolledWindow, args, argcnt); XtAddCallback(wsm_ui->from_list, XmNsingleSelectionCallback, SelectFromListCB, (XtPointer)wsm_ui); XtAddCallback(wsm_ui->from_list, XmNmultipleSelectionCallback, MultSelectFromListCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->from_list); XtInitializeWidgetClass(xmListWidgetClass); argcnt = 0; XtSetArg(args[argcnt], XmNshadowThickness, 2); argcnt++; XtSetArg(args[argcnt], XmNitemCount, 0); argcnt++; XtSetArg(args[argcnt], XmNselectionPolicy, XmSINGLE_SELECT); argcnt++; XtSetArg(args[argcnt], XmNlistSizePolicy, XmCONSTANT); argcnt++; wsm_ui->to_list = XtCreateWidget("toList", xmListWidgetClass, toScrolledWindow, args, argcnt); XtAddCallback(wsm_ui->to_list, XmNsingleSelectionCallback, SelectToListCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->to_list); /* * The copy/link radio box */ argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNradioBehavior, True); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; toggleRow = XtCreateWidget("toggleRow", xmRowColumnWidgetClass, buttonForm, args, argcnt); XtManageChild(toggleRow); argcnt = 0; XtSetArg(args[argcnt], XmNindicatorType, XmONE_OF_MANY); argcnt++; XtSetArg(args[argcnt], XmNset, True); argcnt++; wsm_ui->copy_toggle = XtCreateWidget("copyButton", xmToggleButtonWidgetClass, toggleRow, args, argcnt); XtManageChild(wsm_ui->copy_toggle); argcnt = 0; XtSetArg(args[argcnt], XmNindicatorType, XmONE_OF_MANY); argcnt++; wsm_ui->link_toggle = XtCreateWidget("linkButton", xmToggleButtonWidgetClass, toggleRow, args, argcnt); XtManageChild(wsm_ui->link_toggle); /* * The occupy/move/remove buttons */ argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, toggleRow); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; occupyButton = XtCreateWidget("occupyButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(occupyButton, XmNactivateCallback, OccupyCB, (XtPointer)wsm_ui); XtManageChild(occupyButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, occupyButton); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; wsm_ui->move_button = XtCreateWidget("moveButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(wsm_ui->move_button, XmNactivateCallback, MoveCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->move_button); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, wsm_ui->move_button); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; wsm_ui->delete_button = XtCreateWidget("deleteButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(wsm_ui->delete_button, XmNactivateCallback, DeleteCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->delete_button); return( retval ); } Widget CreateWorkspacePanelBX(Widget parent, WSM_UI* wsm_ui, Boolean show_menu) { Arg args[32]; Cardinal argcnt; Widget retval; /*SUPPRESS 591*/ XmString xmstr[8]; Widget form; Widget menuBar; Widget fileCascade; Widget pulldownMenu; Widget saveButton; Widget saveAsButton; Widget separator; Widget exitButton; Widget workspaceCascade; Widget pulldownMenu1; Widget viewCascade; Widget menuShell2; Widget pulldownMenu2; Widget popupMenu; Widget backgroundButton; Widget newButton; Widget nameButton; Widget hideButton; Widget deleteButton; Widget configureButton; int i; Space *s; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_ANY); argcnt++; form = XtCreateWidget("form", xmFormWidgetClass, parent, args, argcnt); retval = form; XtManageChild(form); if (show_menu) { argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_BAR); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; menuBar = XtCreateWidget("menuBar", xmRowColumnWidgetClass, form, args, argcnt); retval = menuBar; XtManageChild(menuBar); argcnt = 0; fileCascade = XtCreateWidget("fileCascade", xmCascadeButtonWidgetClass, menuBar, args, argcnt); XtManageChild(fileCascade); argcnt = 0; pulldownMenu = XmCreatePulldownMenu(fileCascade, "pulldownMenu", args, argcnt); argcnt = 0; saveButton = XtCreateWidget("saveButton", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(saveButton, XmNactivateCallback, SaveActivateCB, (XtPointer)wsm_ui); XtManageChild(saveButton); argcnt = 0; saveAsButton = XtCreateWidget("saveAsButton", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(saveAsButton, XmNactivateCallback, SaveAsCB, (XtPointer)wsm_ui); XtManageChild(saveAsButton); argcnt = 0; separator = XtCreateWidget("separator", xmSeparatorWidgetClass, pulldownMenu, args, argcnt); XtManageChild(separator); argcnt = 0; exitButton = XtCreateWidget("exitButton", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(exitButton, XmNactivateCallback, ExitCB, (XtPointer)wsm_ui); XtManageChild(exitButton); argcnt = 0; XtSetArg(args[argcnt], XmNsubMenuId, pulldownMenu); argcnt++; XtSetValues(fileCascade, args, argcnt); argcnt = 0; workspaceCascade = XtCreateWidget("workspaceCascade", xmCascadeButtonWidgetClass, menuBar, args, argcnt); XtManageChild(workspaceCascade); argcnt = 0; pulldownMenu1 = XmCreatePulldownMenu(workspaceCascade, "pulldownMenu1", args, argcnt); argcnt = 0; newButton = XtCreateWidget("newButton", xmPushButtonWidgetClass, pulldownMenu1, args, argcnt); XtAddCallback(newButton, XmNactivateCallback, NewActivateCB, (XtPointer)wsm_ui); XtManageChild(newButton); argcnt = 0; nameButton = XtCreateWidget("nameButton", xmPushButtonWidgetClass, pulldownMenu1, args, argcnt); XtAddCallback(nameButton, XmNactivateCallback, CreateNameCB, (XtPointer)wsm_ui); XtManageChild(nameButton); argcnt = 0; backgroundButton = XtCreateWidget("backgroundButton", xmPushButtonWidgetClass, pulldownMenu1, args, argcnt); XtAddCallback(backgroundButton, XmNactivateCallback, CreateBackgroundCB, (XtPointer)wsm_ui); XtManageChild(backgroundButton); argcnt = 0; configureButton = XtCreateWidget("configureButton", xmPushButtonWidgetClass, pulldownMenu1, args, argcnt); XtAddCallback(configureButton, XmNactivateCallback, CreateConfigureCB, (XtPointer)wsm_ui); XtManageChild(configureButton); argcnt = 0; deleteButton = XtCreateWidget("deleteButton", xmPushButtonWidgetClass, pulldownMenu1, args, argcnt); XtAddCallback(deleteButton, XmNactivateCallback, CreateDeleteCB, (XtPointer)wsm_ui); XtManageChild(deleteButton); argcnt = 0; XtSetArg(args[argcnt], XmNsubMenuId, pulldownMenu1); argcnt++; XtSetValues(workspaceCascade, args, argcnt); argcnt = 0; viewCascade = XtCreateWidget("viewCascade", xmCascadeButtonWidgetClass, menuBar, args, argcnt); XtManageChild(viewCascade); argcnt = 0; pulldownMenu2 = XmCreatePulldownMenu(viewCascade, "pulldownMenu2", args, argcnt); argcnt = 0; hideButton = XtCreateWidget("hideButton", xmPushButtonWidgetClass, pulldownMenu2, args, argcnt); XtAddCallback(hideButton, XmNactivateCallback, HideActivateCB, (XtPointer)wsm_ui); XtManageChild(hideButton); argcnt = 0; XtSetArg(args[argcnt], XmNsubMenuId, pulldownMenu2); argcnt++; XtSetValues(viewCascade, args, argcnt); } argcnt = 0; XtSetArg(args[argcnt], XmNresizeWidth, True); argcnt++; XtSetArg(args[argcnt], XmNresizeHeight, True); argcnt++; XtSetArg(args[argcnt], XmNadjustLast, True); argcnt++; XtSetArg(args[argcnt], XmNradioAlwaysOne, True); argcnt++; XtSetArg(args[argcnt], XmNradioBehavior, True); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNspacing, 8); argcnt++; XtSetArg(args[argcnt], XmNpacking, XmPACK_TIGHT); argcnt++; if (show_menu) { XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, menuBar); argcnt++; } else { XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; } XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; wsm_ui->wsm_row_column = XtCreateWidget("buttonPanel", xmRowColumnWidgetClass, form, args, argcnt); XtManageChild(wsm_ui->wsm_row_column); for (i = 0; i< wsm_ui->num_space_buttons; i++) { s = GetSpaceFromID(i); argcnt = 0; XtSetArg(args[argcnt], XmNindicatorSize, 20); argcnt++; XtSetArg(args[argcnt], XmNspacing, 10); argcnt++; XtSetArg(args[argcnt], XmNuserData, i+1); argcnt++; XtSetArg(args[argcnt], XmNlabelString, (xmstr[0]=XmStringCreateLtoR( s->name, XmSTRING_DEFAULT_CHARSET))); argcnt++; XtSetArg(args[argcnt], XmNrecomputeSize, True); argcnt++; /* check between these lines...crashes in 2.0 not in 1.2.2 */ if (SpacePixelSet(s)) {XtSetArg(args[argcnt],XmNbackground,s->pixel);argcnt++;} if (SpaceLabelPixmapSet(s)) { XtSetArg(args[argcnt],XmNlabelPixmap,s->pixmap_label); argcnt++; XtSetArg(args[argcnt],XmNlabelType,XmPIXMAP);argcnt++; } /* above this line */ if (s == current_space) {XtSetArg(args[argcnt], XmNset, True); argcnt++;} wsm_ui->space_button[i] = XtCreateWidget("pushButton", xmToggleButtonWidgetClass, wsm_ui->wsm_row_column, args, argcnt); XtAddCallback(wsm_ui->space_button[i], XmNvalueChangedCallback, SendLeaveRoomCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->space_button[i]); XmStringFree(xmstr[0]); } /* * Build the popup menu */ argcnt = 0; XtSetArg(args[argcnt], XmNwidth, 1); argcnt++; XtSetArg(args[argcnt], XmNheight, 1); argcnt++; menuShell2 = XtCreatePopupShell("menuShell2", xmMenuShellWidgetClass, wsm_ui->wsm_row_column, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_POPUP); argcnt++; popupMenu = XtCreateWidget("popupMenu", xmRowColumnWidgetClass, menuShell2, args, argcnt); XtAddEventHandler(XtParent(XtParent(popupMenu)), ButtonPressMask, False, MENU_POST, (XtPointer)popupMenu); argcnt = 0; newButton = XtCreateWidget("newButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(newButton, XmNactivateCallback, NewActivateCB, (XtPointer)wsm_ui); XtManageChild(newButton); argcnt = 0; nameButton = XtCreateWidget("nameButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(nameButton, XmNactivateCallback, CreateNameCB, (XtPointer)wsm_ui); XtManageChild(nameButton); argcnt = 0; backgroundButton = XtCreateWidget("backgroundButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(backgroundButton, XmNactivateCallback, CreateBackgroundCB, (XtPointer)wsm_ui); XtManageChild(backgroundButton); argcnt = 0; configureButton = XtCreateWidget("configureButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(configureButton, XmNactivateCallback, CreateConfigureCB, (XtPointer)wsm_ui); XtManageChild(configureButton); argcnt = 0; deleteButton = XtCreateWidget("deleteButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(deleteButton, XmNactivateCallback, CreateDeleteCB, (XtPointer)wsm_ui); XtManageChild(deleteButton); argcnt = 0; (void) XtCreateManagedWidget("separator", xmSeparatorWidgetClass, popupMenu, args, argcnt); argcnt = 0; hideButton = XtCreateWidget("hideButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(hideButton, XmNactivateCallback, HideActivateCB, (XtPointer)wsm_ui); #ifndef _NO_ROOT XtManageChild(hideButton); #endif argcnt = 0; (void) XtCreateManagedWidget("separator", xmSeparatorWidgetClass, popupMenu, args, argcnt); argcnt = 0; saveButton = XtCreateWidget("saveButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(saveButton, XmNactivateCallback, SaveActivateCB, (XtPointer)wsm_ui); XtManageChild(saveButton); argcnt = 0; saveAsButton = XtCreateWidget("saveAsButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(saveAsButton, XmNactivateCallback, SaveAsCB, (XtPointer)wsm_ui); XtManageChild(saveAsButton); argcnt = 0; (void) XtCreateManagedWidget("separator", xmSeparatorWidgetClass, popupMenu, args, argcnt); argcnt = 0; exitButton = XtCreateWidget("exitButton", xmPushButtonWidgetClass, popupMenu, args, argcnt); XtAddCallback(exitButton, XmNactivateCallback, ExitCB, (XtPointer)wsm_ui); XtManageChild(exitButton); return( retval ); } Widget CreateSaveAs(Widget parent, WSM_UI* wsm_ui) { Arg args[32]; Cardinal argcnt; Widget retval; Widget cancelButton2; Widget separator3; Widget okButton2; Widget saveAsLabel; Widget saveAsTitleLabel; Widget dbForm; Widget buttonForm; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; wsm_ui->save_as_form = XtCreateWidget("saveAsForm", xmFormWidgetClass, parent, args, argcnt); retval = wsm_ui->save_as_form; argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; saveAsTitleLabel = XtCreateWidget("saveAsTitleLabel", xmLabelWidgetClass, wsm_ui->save_as_form, args, argcnt); XtManageChild(saveAsTitleLabel); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, saveAsTitleLabel); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; dbForm = XtCreateWidget("dbForm", xmFormWidgetClass, wsm_ui->save_as_form, args, argcnt); XtManageChild(dbForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; saveAsLabel = XtCreateWidget("saveAsLabel", xmLabelWidgetClass, dbForm, args, argcnt); XtManageChild(saveAsLabel); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, saveAsLabel); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; wsm_ui->save_as_text = XtCreateWidget("saveAsText", xmTextFieldWidgetClass, dbForm, args, argcnt); XtAddCallback(wsm_ui->save_as_text, XmNactivateCallback, SaveAsOkCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->save_as_text); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, dbForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; separator3 = XtCreateWidget("separator3", xmSeparatorWidgetClass, wsm_ui->save_as_form, args, argcnt); XtManageChild(separator3); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, separator3); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; buttonForm = XtCreateWidget("buttonForm", xmFormWidgetClass, wsm_ui->save_as_form, args, argcnt); XtManageChild(buttonForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; okButton2 = XtCreateWidget("okButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(okButton2, XmNactivateCallback, SaveAsOkCB, (XtPointer)wsm_ui); XtManageChild(okButton2); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; cancelButton2 = XtCreateWidget("cancelButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(cancelButton2, XmNactivateCallback, DismissSaveAsCB, (XtPointer)wsm_ui); XtManageChild(cancelButton2); return( retval ); } #ifndef _NO_OCCUPY_DIALOG Widget CreateOccupyWorkspace(Widget parent, WSM_UI* wsm_ui) { Arg args[32]; Cardinal argcnt; Widget retval; Widget occupyWindow; Widget occupyTitleLabel; Widget cancelButton; Widget separator; Widget okButton; Widget toggleRow; Widget buttonForm; argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; wsm_ui->occupy_form = XtCreateWidget("occupyForm", xmFormWidgetClass, parent, args, argcnt); retval = wsm_ui->occupy_form; argcnt = 0; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; occupyTitleLabel = XtCreateWidget("occupyTitleLabel", xmLabelWidgetClass, wsm_ui->occupy_form, args, argcnt); XtManageChild(occupyTitleLabel); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_GROW); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; buttonForm = XtCreateWidget("buttonForm", xmFormWidgetClass, wsm_ui->occupy_form, args, argcnt); XtManageChild(buttonForm); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; okButton = XtCreateWidget("okButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(okButton, XmNactivateCallback,OccupyActivateCB, (XtPointer)wsm_ui); XtManageChild(okButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; cancelButton = XtCreateWidget("cancelButton", xmPushButtonWidgetClass, buttonForm, args, argcnt); XtAddCallback(cancelButton, XmNactivateCallback, DismissOccupyCB, (XtPointer)wsm_ui); XtManageChild(cancelButton); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, buttonForm); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; separator = XtCreateWidget("separator", xmSeparatorWidgetClass, wsm_ui->occupy_form, args, argcnt); XtManageChild(separator); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNradioBehavior, True); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget,separator); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; toggleRow = XtCreateWidget("toggleRow", xmRowColumnWidgetClass, wsm_ui->occupy_form, args, argcnt); XtManageChild(toggleRow); argcnt = 0; XtSetArg(args[argcnt], XmNindicatorType, XmONE_OF_MANY); argcnt++; XtSetArg(args[argcnt], XmNset, True); argcnt++; wsm_ui->copy_occupy_toggle = XtCreateWidget("copyButton", xmToggleButtonWidgetClass, toggleRow, args, argcnt); XtAddCallback(wsm_ui->copy_occupy_toggle, XmNvalueChangedCallback, CopyModeCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->copy_occupy_toggle); argcnt = 0; XtSetArg(args[argcnt], XmNindicatorType, XmONE_OF_MANY); argcnt++; wsm_ui->link_occupy_toggle = XtCreateWidget("linkButton", xmToggleButtonWidgetClass, toggleRow, args, argcnt); XtAddCallback(wsm_ui->link_occupy_toggle, XmNvalueChangedCallback, LinkModeCB, (XtPointer)wsm_ui); XtManageChild(wsm_ui->link_occupy_toggle); argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAPPLICATION_DEFINED); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, occupyTitleLabel); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNbottomWidget, toggleRow); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; occupyWindow = XtCreateWidget("occupyWindow", xmScrolledWindowWidgetClass, wsm_ui->occupy_form, args, argcnt); XtManageChild(occupyWindow); argcnt = 0; XtSetArg(args[argcnt], XmNshadowThickness, 2); argcnt++; XtSetArg(args[argcnt], XmNitemCount, 0); argcnt++; XtSetArg(args[argcnt], XmNselectionPolicy, XmMULTIPLE_SELECT); argcnt++; XtSetArg(args[argcnt], XmNlistSizePolicy, XmCONSTANT); argcnt++; XtSetArg(args[argcnt], XmNvisibleItemCount, 10); argcnt++; wsm_ui->occupy_list = XtCreateWidget("occupyList", xmListWidgetClass, occupyWindow, args, argcnt); XtManageChild(wsm_ui->occupy_list); return( retval ); } #endif motif-2.3.8/demos/programs/workspace/wsm_ui.h0000644000175000017500000000346512672140200016200 00000000000000/* $XConsortium: wsm_ui.h /main/4 1995/07/15 20:46:54 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmUI_h #define wsmUI_h #include "wsm.h" typedef struct _WSM_UI{ Widget wsm_row_column; Widget *space_button; int num_space_buttons; Widget configure_form; Widget from_list; Widget to_list; Widget copy_toggle; Widget link_toggle; Widget window_toggle; Widget client_toggle; Widget from_option_menu; Widget *from_option_button; Widget to_option_menu; Widget *to_option_button; Widget delete_button; Widget move_button; Space *from_space; Space *to_space; WorkWindow *w_window; Widget delete_form; Widget delete_list; Widget ok_button; Widget name_form; Widget name_list; Widget name_text; Widget pixmap_text; Widget background_form; Widget background_list; Widget background_text; Widget save_as_form; Widget save_as_text; Widget occupy_form; Widget occupy_list; Widget copy_occupy_toggle; Widget link_occupy_toggle; WorkWindow* occupy_window; } WSM_UI; #endif motif-2.3.8/demos/programs/workspace/Makefile.am0000644000175000017500000000114013145162623016555 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/wsm datadir = ${prefix}/share/Xm/wsm EXTRA_DIST = README wsm.man bin_PROGRAMS = wsm wsm_SOURCES = client_win.c command_ui.c wsm.c wsmData.c wsmDebug.c \ wsmSend.c wsmStruct.c wsm_cb.c wsm_create.c xrmLib.c \ command_ui.h wsm_cb.h wsm_create.h wsmData.h wsmDebug.h \ wsm.h wsmSend.h wsmStruct.h wsm_ui.h xrmLib.h data_DATA = $(wsm_SOURCES) $(EXTRA_DIST) INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm motif-2.3.8/demos/programs/workspace/wsmDebug.h0000644000175000017500000000340512672140200016444 00000000000000/* $XConsortium: wsmDebug.h /main/5 1995/07/15 20:46:32 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmDebug_h #define wsmDebug_h #include "wsm.h" #ifdef WSM_DEBUG #ifndef PRINT #define PRINT printf #endif #else #ifndef PRINT static int noop (char *fmt, ...) { return 0; } #define PRINT noop #endif #endif extern void print_window( WorkWindow* ); extern void print_all_window(); extern void print_space_windows( Space* ); extern void print_values( XrmValue*, XrmQuarkList, XrmQuark, int ); extern void print_all_values( XrmValue**, XrmQuarkList, XrmQuarkList, int ); extern void print_win_data( WSMWinData*, int ); extern void print_internal_win_data( WSMWinData*, int ); extern void print_request( WSMRequest* ); extern void print_reply( WSMReply* ); extern void print_reply_start_state( WSMGetStateReply* ); extern void PrintSpace( char * ); extern void PrintAllSpaces(); #endif motif-2.3.8/demos/programs/workspace/client_win.c0000644000175000017500000000511513145162623017026 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: client_win.c /main/5 1995/07/14 09:47:48 drk $" #endif #endif #include #include #include static Window TryChildren(); /* Find a window with WM_STATE, else return win itself, as per ICCCM */ static Atom WM_STATE = None; Window IsClientWindow(dpy, win, retdata) Display *dpy; Window win; unsigned int **retdata; { Atom type = None; int format; unsigned long nitems, after; unsigned int *data; Window inf; /* WM_STATE *data */ *retdata = NULL; if(WM_STATE == None) { WM_STATE = XInternAtom(dpy, "WM_STATE", True); } if (!WM_STATE) return win; XGetWindowProperty(dpy, win, WM_STATE, 0, 2, False, AnyPropertyType, &type, &format, &nitems, &after, (unsigned char **)&data); if (type) { *retdata = data; return win; } inf = TryChildren(dpy, win, WM_STATE, retdata); if (!inf) inf = win; return inf; } static Window TryChildren (dpy, win, WM_STATE, retdata) Display *dpy; Window win; Atom WM_STATE; unsigned int **retdata; { Window root, parent; Window *children; unsigned int nchildren; unsigned int i; Atom type = None; int format; unsigned long nitems, after; unsigned int *data; Window inf = 0; if (!XQueryTree(dpy, win, &root, &parent, &children, &nchildren)) return 0; for (i = 0; !inf && (i < nchildren); i++) { XGetWindowProperty(dpy, children[i], WM_STATE, 0, 2, False, AnyPropertyType, &type, &format, &nitems, &after, (unsigned char **)&data); if (type) { inf = children[i]; *retdata = data; } } for (i = 0; !inf && (i < nchildren); i++) inf = TryChildren(dpy, children[i], WM_STATE, retdata); if (children) XFree((char *)children); return inf; } motif-2.3.8/demos/programs/workspace/wsm_cb.h0000644000175000017500000001015213066310437016147 00000000000000/* $XConsortium: wsm_cb.h /main/5 1995/07/15 20:46:46 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifndef wsmCB_h #define wsmCB_h #include "wsm_ui.h" extern void InitializeInterface( WSM_UI* ); extern void HideWsm(); extern void ShowWsm(); extern Widget CreateWorkspacePanel( Widget, WSM_UI*, Boolean ); extern void CreateNewSpaceButton( int, char*, WSM_UI* ); extern void SendLeaveRoomCB( Widget, XtPointer, XtPointer ); extern void NewActivateCB( Widget, XtPointer, XtPointer ); extern void HideActivateCB( Widget, XtPointer, XtPointer ); extern void SaveActivateCB( Widget, XtPointer, XtPointer ); extern void ExitCB( Widget, XtPointer, XtPointer ); extern void CreateFromOptionButton( int, char* ); extern void CreateToOptionButton( int, char* ); extern void UpdateList( Widget, Space* ); extern void UpdateBothList( Space* ); extern void CreateConfigureCB( Widget, XtPointer, XtPointer ); extern void MoveCB( Widget, XtPointer, XtPointer ); extern void DeleteCB( Widget, XtPointer, XtPointer ); extern void ToWorkspaceCB( Widget, XtPointer, XtPointer ); extern void FromWorkspaceCB( Widget, XtPointer, XtPointer ); extern void Copy( WSM_UI* ); extern void Link( WSM_UI* ); extern void OccupyCB( Widget, XtPointer, XtPointer ); extern void SelectFromListCB( Widget, XtPointer, XtPointer ); extern void MultSelectFromListCB( Widget, XtPointer, XtPointer ); extern void ClientModeCB( Widget, XtPointer, XtPointer ); extern void WindowModeCB( Widget, XtPointer, XtPointer ); extern void SelectToListCB( Widget, XtPointer, XtPointer ); extern void DismissConfigureCB( Widget, XtPointer, XtPointer ); extern void CreateNameCB( Widget, XtPointer, XtPointer ); extern void UpdateSpaceList( Widget ); extern void SelectNameSpaceCB( Widget, XtPointer, XtPointer ); extern void ChangeSpaceName( WSM_UI*, Space*, int ); extern void NameActivateCB( Widget, XtPointer, XtPointer ); extern void PixmapActivateCB( Widget, XtPointer, XtPointer ); extern void NameOkActivateCB( Widget, XtPointer, XtPointer ); extern void DismissNameCB( Widget, XtPointer, XtPointer ); extern void CreateBackgroundCB( Widget, XtPointer, XtPointer ); extern void SelectBackgroundSpaceCB( Widget, XtPointer, XtPointer ); extern void BackgroundActivateCB( Widget, XtPointer, XtPointer ); extern void DismissBackgroundCB( Widget, XtPointer, XtPointer ); extern void CreateDeleteCB( Widget, XtPointer, XtPointer ); extern void DismissDeleteCB( Widget, XtPointer, XtPointer ); extern void DeleteActivateCB( Widget, XtPointer, XtPointer ); extern void SelectDeleteCB( Widget, XtPointer, XtPointer ); extern void SaveAsCB( Widget, XtPointer, XtPointer ); extern void SaveAsOkCB( Widget, XtPointer, XtPointer ); extern void DismissSaveAsCB( Widget, XtPointer, XtPointer ); extern void CreateOccupy( WorkWindow* ); extern void DismissOccupyCB( Widget, XtPointer, XtPointer ); extern void OccupyActivateCB( Widget, XtPointer, XtPointer ); extern void SelectOccupyCB( Widget, XtPointer, XtPointer ); extern void CopyModeCB( Widget, XtPointer, XtPointer ); extern void LinkModeCB( Widget, XtPointer, XtPointer ); extern void UpdateButtons(WorkWindow *w_window); #endif motif-2.3.8/demos/programs/Ext18List/0000755000175000017500000000000013211513007014342 500000000000000motif-2.3.8/demos/programs/Ext18List/callbacks-c.c0000644000175000017500000004144112672140200016572 00000000000000/* * Generated by the ICS builderXcessory (BX). * * * Builder Xcessory 3.0A. * */ #include #include #include #include #include #include #include "extlist.h" #include #include extern PlayerData players[]; extern Pixmap porsche_pix; extern Pixmap stopsign_pix; extern Pixmap crab_pix; extern Pixmap clown_pix; static int NothingSort(short , XmMultiListRowInfo *, XmMultiListRowInfo *); static int ExtListAlphaSort(short , XmMultiListRowInfo *, XmMultiListRowInfo *); static int ExtListIntSort(short , XmMultiListRowInfo *, XmMultiListRowInfo *); static int ExtListDoubleSort(short , XmMultiListRowInfo *, XmMultiListRowInfo *); /************************************************************** * CALLBACKS **************************************************************/ /* ARGSUSED */ Widget CreateExtListCB( Widget parent ) { XmString tcs; Widget retWid; Arg args[MAX_ARGS]; Cardinal argcnt; XmMultiListRowInfo *row_info; int i, j; XmString *col_title_str; static String col_titles[] = { "At Bat", "Name", "AVG", "AB", "R", "H", "HR", "RBI", NULL, }; Xm18SortFunction **sort_funcs = (Xm18SortFunction **) XtMalloc(sizeof(Xm18SortFunction *) * NUM_COLUMNS); /* * Create the XmMultiListRowInfo "rows" * * Create PLAYER_LIMIT XmMultiListRowInfo structs * Initially however, there are no rows */ row_info = (XmMultiListRowInfo *) XtMalloc(sizeof(XmMultiListRowInfo) * LINEUP_LIMIT); /* * Each XmMultiListRowInfo contains an array of strings, which represent * the column data. * * In this example, the following columns are: * 0 - Name * 1 - "AVG" * 2 - "AB" * 3 - "R" * 4 - "H" * 5 - "HR" * 6 - "RBI" */ for (i = 0; i < LINEUP_LIMIT; i++) { row_info[i].values = (XmString *) XtMalloc(NUM_COLUMNS * sizeof(XmString)); for (j = 0; j < NUM_COLUMNS; j++) row_info[i].values[j] = NULL; } /* Column titles must also be XmStrings */ col_title_str = (XmString *)XtMalloc( NUM_COLUMNS*sizeof(XmString)); for (j = 0; j < NUM_COLUMNS; j++) { col_title_str[j] = XmStringCreateSimple(col_titles[j]); switch (j){ case 0: sort_funcs[j] = (Xm18SortFunction *)NothingSort; break; case 1: sort_funcs[j] = (Xm18SortFunction *)ExtListAlphaSort; break; case 2: sort_funcs[j] = (Xm18SortFunction *)ExtListDoubleSort; break; default : sort_funcs[j] = (Xm18SortFunction *)ExtListIntSort; } } /* These arguments set up the list with no elements. The * row info will be added each time AddPlayer is done. Look * at that code to see how the row information is initialized */ argcnt = 0; XtSetArg(args[argcnt], XmNfirstColumnPixmaps, True); argcnt++; XtSetArg(args[argcnt], XmNentryData, row_info); argcnt++; XtSetArg(args[argcnt], XmNnumRows, 0); argcnt++; XtSetArg(args[argcnt], XmNnumColumns, NUM_COLUMNS); argcnt++; XtSetArg(args[argcnt], XmNcolumnTitles, col_title_str); argcnt++; XtSetArg(args[argcnt], XmNtitle, tcs=XmStringCreateSimple("Lineup")); argcnt++; XtSetArg(args[argcnt], XmNsortFunctions, sort_funcs); argcnt++; XtSetArg(args[argcnt], XmNselectionPolicy, XmSINGLE_SELECT); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; retWid = XtCreateManagedWidget("ext18listWidget", xmMultiListWidgetClass, parent, args, argcnt); XmStringFree(tcs); for (j = 0; j < NUM_COLUMNS; j++) XmStringFree(col_title_str[j]); XtFree((char*)col_title_str); return( retWid); } /* ARGSUSED */ void RemCB(Widget w, XtPointer client, XtPointer call ) { Arg args[5]; Cardinal argcnt; DemoInfo demo_info = (DemoInfo)client; XmMultiListRowInfo *items = NULL, *new_items = NULL; short items_count = 0, new_items_count = 0; int i, j, k; argcnt = 0; XtSetArg(args[argcnt], XmNentryData, &items); argcnt++; XtSetArg(args[argcnt], XmNnumRows, &items_count); argcnt++; XtGetValues(demo_info->extlist, args, argcnt); { XmString tcs = XmStringCreateSimple("No Selected Player"); XtVaSetValues( demo_info->rem_pb, XmNlabelString,tcs, NULL); XmStringFree(tcs); } if (items_count == 0) return; /* Count how many were NOT selected */ for (i = 0; i < items_count; i++) if (!items[i].selected) new_items_count++; /* Allocate this amount of memory */ new_items = (XmMultiListRowInfo *) XtMalloc(sizeof(XmMultiListRowInfo) * LINEUP_LIMIT); for (i = 0; i < LINEUP_LIMIT; i++) { new_items[i].values = (XmString *) XtMalloc(NUM_COLUMNS * sizeof(XmString)); for (j = 0; j < NUM_COLUMNS; j++) new_items[i].values[j] = NULL; } for (i = 0, j = 0; i < items_count; i++) { if (!items[i].selected) { new_items[j].pixmap = items[i].pixmap; new_items[j].selected = False; new_items[j].data = items[i].data; for (k = 0; k < NUM_COLUMNS; k++) new_items[j].values[k] = items[i].values[k]; j++; } } argcnt = 0; XtSetArg(args[argcnt], XmNentryData, new_items); argcnt++; XtSetArg(args[argcnt], XmNnumRows, new_items_count); argcnt++; XtSetValues(demo_info->extlist, args, argcnt); for (i = 0; i < items_count; i++) { XtFree((XtPointer) items[i].values); } XtFree((XtPointer) items); } /* ARGSUSED */ void ToggleFindArea(Widget w, XtPointer client, XtPointer call ) { DemoInfo demo_info = (DemoInfo)client; Arg args[5]; Cardinal argcnt = 0; Boolean is_set; XtSetArg( args[0], XmNset, &is_set ); XtGetValues( w, args, 1 ); XtSetArg( args[0], XmNshowFind, is_set ); XtSetValues( demo_info->extlist, args, 1 ); } /* ARGSUSED */ void FirstRowCol(Widget w, XtPointer client, XtPointer call ) { DemoInfo demo_info = (DemoInfo)client; Arg args[5]; Cardinal argcnt = 0; XtSetArg(args[argcnt], XmNfirstRow, 2); argcnt++; XtSetArg(args[argcnt], XmNfirstColumn, 1); argcnt++; XtSetValues( demo_info->extlist, args, argcnt ); } /* ARGSUSED */ void UnselCB(Widget w, XtPointer client, XtPointer call ) { DemoInfo demo_info = (DemoInfo)client; XmMultiListUnselectAllItems( demo_info->extlist ); } /* ARGSUSED */ void QuitCB(w, client, call) Widget w; XtPointer client; XtPointer call; { exit(0); } /* ARGSUSED */ void UpdateRemLabelStr(Widget w,XtPointer client, XtPointer call ) { DemoInfo demo_info = (DemoInfo)client; Arg args[5]; Cardinal argcnt; XmMultiListRowInfo *row_info = (XmMultiListRowInfo *)call; if (row_info && row_info->values) { XtSetArg( args[0], XmNlabelString, row_info->values[1] ); XtSetValues( demo_info->rem_pb, args, 1 ); } else { XmString tcs = XmStringCreateSimple("No Selected Player"); XtVaSetValues( demo_info->rem_pb, XmNlabelString,tcs, NULL); XmStringFree(tcs); } } /* ARGSUSED */ void ChoosePlayerCB(Widget w,XtPointer client, XtPointer call ) { DemoInfo demo_info = (DemoInfo)client; Arg args[5]; Cardinal argcnt; XmMultiListRowInfo *row_info; short num_rows; int i=0, playernum; char buf[BUFSIZ]; Boolean found=False; while ((i < NUM_PLAYERS) && (!found)){ if (w == demo_info->player[i]) found = True; else i++; } playernum = i; argcnt = 0; XtSetArg(args[argcnt], XmNentryData, &row_info); argcnt++; XtSetArg(args[argcnt], XmNnumRows, &num_rows); argcnt++; XtGetValues(demo_info->extlist, args, argcnt); if (num_rows == LINEUP_LIMIT) { XmString xmstring; static Widget info = NULL; if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; xmstring = XmStringCreateSimple("Cannot have more than nine players."); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Error"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateErrorDialog(w, "error", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XmStringFree(xmstring); } XtManageChild(info); return; } for (i = 0; i < num_rows; i++) { XmString xmstring; static Widget info = NULL; if ((int) row_info[i].data == playernum) { if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Error"); argcnt++; info = XmCreateErrorDialog(w, "error", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); } sprintf(buf, "%s already in line up.", players[playernum].name); xmstring = XmStringCreateSimple(buf); argcnt = 0; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; XtSetValues(info, args, argcnt); XtManageChild(info); XmStringFree(xmstring); return; } } row_info[num_rows].data = (XtPointer) playernum; switch (players[playernum].picture) { case PPORSCHE: row_info[num_rows].pixmap = porsche_pix; break; case PCRAB: row_info[num_rows].pixmap = crab_pix; break; case PCLOWN: row_info[num_rows].pixmap = clown_pix; break; case PSTOP: row_info[num_rows].pixmap = stopsign_pix; break; } row_info[num_rows].selected = False; row_info[num_rows].values[1] = XmStringCreateSimple(players[playernum].name); XtFree((XtPointer) row_info[num_rows].values[2]); sprintf(buf, ".%d", players[playernum].average); row_info[num_rows].values[2] = XmStringCreateSimple(buf); XtFree((XtPointer) row_info[num_rows].values[3]); sprintf(buf, "%d", players[playernum].at_bats); row_info[num_rows].values[3] = XmStringCreateSimple(buf); XtFree((XtPointer) row_info[num_rows].values[4]); sprintf(buf, "%d", players[playernum].runs); row_info[num_rows].values[4] = XmStringCreateSimple(buf); XtFree((XtPointer) row_info[num_rows].values[5]); sprintf(buf, "%d", players[playernum].hits); row_info[num_rows].values[5] = XmStringCreateSimple(buf); XtFree((XtPointer) row_info[num_rows].values[6]); sprintf(buf, "%d", players[playernum].home_runs); row_info[num_rows].values[6] = XmStringCreateSimple(buf); XtFree((XtPointer) row_info[num_rows].values[7]); sprintf(buf, "%d", players[playernum].rbi); row_info[num_rows].values[7] = XmStringCreateSimple(buf); num_rows++; argcnt = 0; XtSetArg(args[argcnt], XmNentryData, row_info); argcnt++; XtSetArg(args[argcnt], XmNnumColumns, NUM_COLUMNS); argcnt++; XtSetArg(args[argcnt], XmNnumRows, num_rows); argcnt++; XtSetValues(demo_info->extlist, args, argcnt); } /* ARGSUSED */ void CreateLabel(w, client, call) Widget w; XtPointer client; XtPointer call; { Arg args[5]; Cardinal argcnt; XmString xmstring; xmstring = XmStringCreateLtoR( "This is a demo of the Motif Internationalized Extended List widget.\n\ \n\ The Internationalized Extended List provides multi-column list \n\ capabilities, which are not available in Motif. It uses XmStrings \n\ exclusively, and is able to display color pixmaps in the leftmost \n\ column. Search capability is built into the widget and is accessed \n\ through the Find Area below the list.\n\ \n\ Selections may be done in single select mode or extended select mode.\n\ There are convenience routines for selecting and unselecting rows \n\ programmatically as well. To see some of the features of this widget, \n\ add some data to the list, by selecting one of the players from the \n\ Add Player option menu.\n\ \n\ The Extended List can sort rows based on the currently selected column \n\ using sort routines provided by the developer. Select different\n\ column titles to see what order that sort routine produces. \n\ \n\ Search the list by typing a string into the text field next \n\ to the Find button. Then select the Find button or hit \n\ the Enter key to initiate the search. If the string is found, the \n\ row that contains it will be made viewable and selected. If not \n\ found,the Extended list will issue a beep.\n\ \n\ The Find area may be unmanaged by setting the \"showFind\" resource \n\ to False.See how the widget looks without the Find area taking up space.\n\ \n\ There is a convenience routine for unselecting rows programmatically \n\ Select the Unselect Current pushbutton to see it work.\n\ \n\ To see how the firstRow and firstCol resources work, select the \n\ Row 2, Col 1 button. The extended list will make that the upper left \n\ row and column. Remember, the list cannot be scrolled past its end. \n\ Therefore, if making a particular row and col the upper leftmost would \n\ cause the list to scroll past its boundaries, it will scroll to the \n\ end ", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNalignment, XmALIGNMENT_BEGINNING); argcnt++; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; XtSetValues(w, args, argcnt); XmStringFree(xmstring); } /************************************************************ * * Sort routines. * ************************************************************/ static int NothingSort( short column, XmMultiListRowInfo *row1, XmMultiListRowInfo *row2 ) { return(0); } static String StringFromXmString(XmString xms) { String str; if (XmStringGetLtoR(xms,XmFONTLIST_DEFAULT_TAG, &str)) return str; else return NULL; } /* Function Name: ExtListAlphaSort * Description: A sorting employee to sort things is alphabetic order. * This function only compares the first segment in the XmStrings. * If multi-segment XmStrings were expected, you could loop thru * both strings, extracting all segments and then do the compare * Arguments: column - column to sort on. * row1, row2 - two rows to check. * Returns: -1, 0, or 1 depending upon whether 1 is less than, * equal to, or greater than 2. */ static int ExtListAlphaSort( short column, XmMultiListRowInfo *row1, XmMultiListRowInfo *row2 ) { String str1 = StringFromXmString(row1->values[column]); String str2 = StringFromXmString(row2->values[column]); int ret_val; if (str1 == NULL) ret_val = -1; /* str1 is empty. it must be less than str2 */ else if (str2 == NULL) ret_val = 1; /* str2 is empty. str1 must be greater */ else ret_val = strcmp(str1, str2); /* clean up */ if (str1 != NULL) XtFree((XtPointer) str1); if (str2 != NULL) XtFree((XtPointer) str2); return (ret_val); } /* Function Name: ExtListIntSort * Description: A sorting function to sort things in numerical order. * Arguments: column - column to sort on. * row1, row2 - two rows to check. * Returns: -1, 0, or 1 depending upon whether 1 is less than, * equal to, or greater than 2. */ static int ExtListIntSort( short column, XmMultiListRowInfo *row1, XmMultiListRowInfo *row2 ) { String str1 = StringFromXmString(row1->values[column]); String str2 = StringFromXmString(row2->values[column]); int ret_val; if (str1 == NULL) ret_val = -1; /* str1 is empty. it must be less than str2 */ else if (str2 == NULL) ret_val = 1; /* str2 is empty. str1 must be greater */ else { int i1, i2; i1 = atoi(str1); i2 = atoi(str2); if (i1 == i2) ret_val = 0; else if (i1 < i2) ret_val = -1; else ret_val = 1; }; /* clean up */ if (str1 != NULL) XtFree((XtPointer) str1); if (str2 != NULL) XtFree((XtPointer) str2); return(ret_val); } /* Function Name: ExtListIntSort * Description: A sorting function to sort things in numerical order. * Arguments: column - column to sort on. * row1, row2 - two rows to check. * Returns: -1, 0, or 1 depending upon whether 1 is less than, * equal to, or greater than 2. */ static int ExtListDoubleSort( short column, XmMultiListRowInfo *row1, XmMultiListRowInfo *row2 ) { String str1 = StringFromXmString(row1->values[column]); String str2 = StringFromXmString(row2->values[column]); int ret_val; if (str1 == NULL) ret_val = -1; /* str1 is empty. it must be less than str2 */ else if (str2 == NULL) ret_val = 1; /* str2 is empty. str1 must be greater */ else { float i1, i2; sscanf( str1, "%f", (float *)&i1 ); sscanf( str2, "%f", (float *)&i2 ); if (i1 == i2) ret_val = 0; else if (i1 < i2) ret_val = -1; else ret_val = 1; }; /* clean up */ if (str1 != NULL) XtFree((XtPointer) str1); if (str2 != NULL) XtFree((XtPointer) str2); return(ret_val); } motif-2.3.8/demos/programs/Ext18List/Makefile.in0000644000175000017500000006616613211512766016361 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = ext18list$(EXEEXT) subdir = demos/programs/Ext18List ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_ext18list_OBJECTS = util-c.$(OBJEXT) callbacks-c.$(OBJEXT) \ creation.$(OBJEXT) ext18list.$(OBJEXT) ext18list_OBJECTS = $(am_ext18list_OBJECTS) ext18list_LDADD = $(LDADD) ext18list_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(ext18list_SOURCES) DIST_SOURCES = $(ext18list_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Ext18list build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Ext18list datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = pixmaps ext18list_SOURCES = util-c.c callbacks-c.c creation.c ext18list.c \ extlist.h EXTRA_DIST = data_DATA = $(EXTRA_DIST) $(ext18list_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Ext18List/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Ext18List/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ext18list$(EXEEXT): $(ext18list_OBJECTS) $(ext18list_DEPENDENCIES) $(EXTRA_ext18list_DEPENDENCIES) @rm -f ext18list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ext18list_OBJECTS) $(ext18list_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext18list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util-c.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dataDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Ext18List/extlist.h0000644000175000017500000000145612672140200016136 00000000000000/* * Copyright 1994, Integrated Computer Solutions, Inc. * * All Rights Reserved. * * Author: Rick Umali * * extlist.h * */ #ifndef _extlist_h #define _extlist_h typedef enum { PPORSCHE, PCLOWN, PSTOP, PCRAB } PlayerPix; #define NUM_PLAYERS 14 /************************************************************** * DATA STRUCTURES **************************************************************/ typedef struct _DemoInfo { Widget extlist; Widget rem_pb; Widget player[14]; } DemoStruct, *DemoInfo; typedef struct _PlayerData { PlayerPix picture; char *name; int at_bats; int runs; int hits; int rbi; int average; /* entered as an integer...displayed as a "float" */ int home_runs; } PlayerData; #define NUM_COLUMNS 8 #define MAX_ARGS 15 #define LINEUP_LIMIT 9 #endif motif-2.3.8/demos/programs/Ext18List/ext18list.c0000644000175000017500000001271213066310437016310 00000000000000/* * Copyright 1994, Integrated Computer Solutions, Inc. * * All Rights Reserved. * * Author: Rick Umali * * MultiList.c * */ /************************************************************** * INCLUDE FILES **************************************************************/ #include #include #include #include #include #include #include "extlist.h" #include #include #include #include /************************************************************** External functions **************************************************************/ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif extern Pixmap XPM_PIXMAP ARGLIST((w, pixmapName)) ARG(Widget, w) GRA(char **, pixmapName); /************************************************************** * GLOBALS **************************************************************/ Widget G_extlist = NULL; Pixmap porsche_pix; Pixmap stopsign_pix; Pixmap crab_pix; Pixmap clown_pix; PlayerData players[] = { /* Name AB R H RBI AVG HR */ { PPORSCHE, "Mo Vaughn", 159, 30, 55, 33, 346, 11 }, { PCLOWN, "Tim Naehring", 133, 25, 43, 27, 323, 6 }, { PSTOP, "Scott Cooper", 139, 24, 43, 30, 309, 9 }, { PCLOWN, "John Valentin", 78, 12, 22, 11, 282, 2 }, { PSTOP, "Carlos Rodriguez", 39, 2, 11, 4, 282, 1}, { PCLOWN, "Otis Nixon", 148, 23, 41, 13, 277, 0}, { PSTOP, "Scott Fletcher", 80, 13, 21, 8, 263, 2}, { PCLOWN, "Andre Dawson", 134, 19, 33, 27, 246, 10}, { PPORSCHE, "Damon Berryhill", 72, 4, 17, 6, 236, 1}, { PPORSCHE, "Billy Hatcher", 139, 23, 32, 15, 230, 1}, { PCLOWN, "Mike Greenwell", 151, 31, 35, 25, 232, 7}, { PSTOP, "Rich Rowland", 28, 1, 6, 6, 214, 1}, { PCLOWN, "Lee Tinsley", 34, 10, 7, 2, 206, 0}, { PPORSCHE, "Dave Valle", 72, 5, 11, 4, 153, 1}, }; /************************************************************** * FORWARD DECLARATIONS **************************************************************/ Widget Createform(Widget, DemoInfo); static void QuitCB(Widget, XtPointer, XtPointer); /************************************************************** * DEFINES **************************************************************/ /************************************************************** * FALLBACKS **************************************************************/ static String fallbacks[] = { /* * General fallback resources. */ "*background: grey", "*rightPane*background: grey", "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*explain_label*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*explain_label*marginWidth: 10", "*explain_label*marginHeight: 10", "*rem_label.alignment: XmALIGNMENT_BEGINNING", "*rem_label.labelString: Remove Player", "*add_label.labelString: Add Player ", "*add_label.alignment: XmALIGNMENT_BEGINNING", "*rem_pb.labelString: No Selected Player", "*unsel_pb.labelString: Unselect Current", "*firstRowCol.labelString: Go to Row 2, 1", "*toggleFind.labelString: Toggle Finder", "*quit_pb.labelString: Quit", "*MultiList.title: Red Sox Line Up Card", "*multilistWidget*title: Line Up", "*playerone.labelString: Mo Vaughn", "*playertwo.labelString: Tim Naehring", "*playerthree.labelString: Scott Cooper", "*playerfour.labelString: John Valentin", "*playerfive.labelString: Carlos Rodriguez", "*playersix.labelString: Otis Nixon", "*playerseven.labelString: Scott Fletcher", "*playereight.labelString: Andre Dawon", "*playernine.labelString: Damon Berryhill", "*playerten.labelString: Billy Hatcher", "*playereleven.labelString: Mike Greenwell", "*playertwelve.labelString: Rich Rowland", "*playerthirteen.labelString: Lee Tinsley", "*playerfourteen.labelString: Dave Valle", "*ext18listWidget*background: White", "*list*background: White", NULL, }; /************************************************************** * CALLBACKS **************************************************************/ /* * Function Name: InitializeData * Description: * Arguments: * Returns: nothing * */ void InitializeData(shell ) Widget shell; { porsche_pix = XPM_PIXMAP(shell, porsche); crab_pix = XPM_PIXMAP(shell, crab); stopsign_pix = XPM_PIXMAP(shell, stopsign); clown_pix = XCreateBitmapFromData(XtDisplay(shell), RootWindowOfScreen(XtScreen(shell)), (char *)clown_bits, clown_width, clown_height); } /************************************************************** * PUBLIC (GLOBAL) CODE **************************************************************/ /* * Function Name: main * Description: * Arguments: the usual suspects * Returns: nothing * */ int main(int argc, char **argv) { Widget top, demo; XtAppContext app; DemoInfo demo_info = (DemoInfo)XtMalloc( sizeof(DemoStruct)); XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); top = XtOpenApplication( &app, "MultiList", NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, NULL, 0); demo = Createform(top, demo_info); XtManageChild(demo); InitializeData(top); XtRealizeWidget(top); XtAppMainLoop(app); return(0); } motif-2.3.8/demos/programs/Ext18List/util-c.c0000644000175000017500000026106113066310437015643 00000000000000/* * MODULE: BxConvert.c * AUTHOR: Automatically generated by Builder Xcessory * * Description: This module contains various utilities, converters * for XmStrings (to work properly with app-defaults), and if needed * the XPM pixmap utilities. * * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to * make system wide changes to this file which will be visible next time * this file is generated. * ${BX} is the directory where Builder Xcessory is installed. */ /* * BX supplies a string format for compound strings: * * ::[#tag][:t][:r]["str"] * * where: * :: = indicates compound string. * tag = the font tag * :t = separator (if not seen no separator added to segment) * :r = right to left (if not seen left to right assumed) * "str" = the text of the string. * * The components for the compound string can be repeated any number of * times. */ /***************************************************************************** * INCLUDE FILES *****************************************************************************/ #include #include #include #include /* * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI. */ #if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__) # include # if defined(HAVE_MALLOC_H) # include # elif defined(HAVE_SYS_MALLOC_H) # include # endif #endif /***************************************************************************** * TYPDEFS AND DEFINES *****************************************************************************/ /* * Undefine this if you want to use native strcasecmp. */ #define LOCAL_STRCASECMP #ifdef _NO_PROTO #ifdef NeedFunctionPrototypes #undef NeedFunctionPrototypes #endif #endif /* * Define SUPPORTS_WCHARS if the system supports wide character sets */ #if !defined(VAX) && !defined(__CENTERLINE__) #define SUPPORTS_WCHARS #endif /* * Handy definition used in SET_BACKGROUND_COLOR */ #define UNSET (-1) /* * Set state of inclusion of prototypes properly */ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif #ifdef NeedFunctionPrototypes #ifdef __cplusplus #define UARG(a, b) a, #define GRAU(a, b) a) #else #define UARG(a, b) a b, #define GRAU(a, b) a b) #endif #else #define UARG(a, b) a b; #define GRAU(a, b) a b; #endif /* * Set up strcasecmp function */ #if defined(LOCAL_STRCASECMP) #define STRCASECMP StrCasecmp #ifndef NeedFunctionPrototypes static int StrCasecmp(); #else static int StrCasecmp(char*, char*); #endif #else #define STRCASECMP strcasecmp #endif /* * Define XTPOINTER so it works with all releases of * Xt and c++. */ #ifdef __cplusplus #if XtSpecificationRelease < 5 #define XTPOINTER char * #else #define XTPOINTER XPointer #endif #else #define XTPOINTER XtPointer #endif /* * The following enum is used to support wide character sets. * Use this enum for references into the Common Wide Characters array. * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last * entry in the enum. This will maintain correct memory usage, etc. */ enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab, WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR, WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne, NUM_COMMON_WCHARS }; /***************************************************************************** * GLOBAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * EXTERNAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * STATIC DECLARATION *****************************************************************************/ #ifndef NeedFunctionPrototypes #ifndef SUPPORTS_WCHARS static int mblen (); #endif static int strlenWc (); static size_t doMbstowcs (); static size_t doWcstombs (); static void copyWcsToMbs (); static int dombtowc (); static Boolean extractSegment (); static XmString StringToXmString (); static char* getNextCStrDelim (); static int getCStrCount (); static wchar_t *CStrCommonWideCharsGet (); #else #ifndef SUPPORTS_WCHARS static int mblen (char*, size_t); #endif static int strlenWc (wchar_t*); static size_t doMbstowcs (wchar_t*, char*, size_t); static size_t doWcstombs (char*, wchar_t*, size_t); static void copyWcsToMbs (char*, wchar_t*, int, Boolean); static int dombtowc (wchar_t*, char*, size_t); static Boolean extractSegment (wchar_t**, wchar_t**, int *, wchar_t**, int*, int*, Boolean*); static XmString StringToXmString (char*); static char* getNextCStrDelim (char*); static int getCStrCount (char*); static wchar_t *CStrCommonWideCharsGet (); #endif /***************************************************************************** * STATIC CODE *****************************************************************************/ #if defined(LOCAL_STRCASECMP) /* * Function: * cmp = StrCasecmp(s1, s2); * Description: * Compare two strings ignoring case * Input: * s1 - char * : string 1 to compare * s2 - char * : string 2 to compare * Output: * int : 0; s1 == s2 * 1; s1 != s2 */ static int StrCasecmp ARGLIST((s1, s2)) ARG(register char *, s1) GRA(register char *, s2) { register int c1, c2; while (*s1 && *s2) { c1 = isupper(*s1) ? tolower(*s1) : *s1; c2 = isupper(*s2) ? tolower(*s2) : *s2; if (c1 != c2) { return(1); } s1++; s2++; } if (*s1 || *s2) { return(1); } return(0); } #endif #ifndef SUPPORTS_WCHARS /* * Function: * len = mblen(s, n); * Description: * The mblen function for platforms that don't have one. This * function simply returns a length of 1 since no wide character * support exists for this platform. * Input: * s - char * : the character string to get the length from * n - size_t : the size of the string * Output: * int : always 1 */ static int mblen ARGLIST((s, n)) ARG(char *, s) GRA(size_t, n) { return(1); } #endif /* * Function: * len = strlenWc(ptr); * Description: * Return the number of characters in a wide character string (not * the characters in the resultant mbs). * Input: * ptr - wchar_t* : pointer to the wcs to count * Output: * int : the number of characters found */ static int strlenWc ARGLIST((ptr)) GRA(wchar_t *,ptr) { register wchar_t *p = ptr; register int x = 0; if (!ptr) return(0); while (*p++) x++; return (x); } /* * Function: * bytesConv = doMbstowcs(wcs, mbs, n); * Description: * Create a wcs string from an input mbs. * Input: * wcs - wchar_t* : pointer to result buffer of wcs * mbs - char* : pointer to the source mbs * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doMbstowcs ARGLIST((wcs, mbs, n)) ARG(wchar_t *,wcs) ARG(char *, mbs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && mbs[i] != 0; ++i) { wcs[i] = mbs[i]; } wcs[i++] = 0; return(i); #else return(mbstowcs(wcs, mbs, n)); #endif } /* * Function: * bytesConv = doWcstombs(wcs, mbs, n); * Description: * Create a mbs string from an input wcs. * Input: * wcs - wchar_t* : pointer to the source wcs * mbs - char* : pointer to result mbs buffer * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doWcstombs ARGLIST((mbs, wcs, n)) ARG(char *, mbs) ARG(wchar_t *, wcs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && wcs[i] != 0; ++i) { mbs[i] = wcs[i]; } mbs[i] = 0; return(i); #else return(wcstombs(mbs, wcs, n)); #endif } /* * Function: * copyWcsToMbs(mbs, wcs, len); * Description: * Create a mbs string from an input wcs. This function allocates * a buffer if necessary. * Input: * mbs - char* : destination for the converted/copied output * wcs - wchar_t* : pointer to wcs to copy/convert * len - int : the number of wchar_t' to convert * process_it - Boolean : True if processing of quoted charcters, * False if blind. * Output: * None */ static void copyWcsToMbs ARGLIST((mbs, wcs, len, process_it)) ARG(char *, mbs) ARG(wchar_t *, wcs) ARG(int, len) GRA(Boolean, process_it) { static wchar_t *tbuf; static int tbufSize = 0; int numCvt; int lenToConvert; wchar_t *fromP = wcs; wchar_t *x = &fromP[len]; wchar_t *toP; wchar_t *commonWChars = CStrCommonWideCharsGet(); wchar_t tmp; /* * Make sure there's room in the buffer */ if (tbufSize < len) { tbuf = (wchar_t*)realloc((char*)tbuf, (len + 1) * sizeof(wchar_t)); tbufSize = len; } /* * Now copy and process */ toP = tbuf; lenToConvert = 0; while (fromP < x) { /* * Check for quoted characters */ if ((*fromP == commonWChars[WBackSlash]) && process_it) { fromP++; /* Skip quote */ if (fromP == x) /* Hanging quote? */ { *toP++ = commonWChars[WBackSlash]; lenToConvert++; break; } tmp = *fromP++; if (tmp == commonWChars[WideN]) { *toP++ = commonWChars[WNewLine]; } else if (tmp == commonWChars[WideT]) { *toP++ = commonWChars[WTab]; } else if (tmp == commonWChars[WideR]) { *toP++ = commonWChars[WCarriageReturn]; } else if (tmp == commonWChars[WideF]) { *toP++ = commonWChars[WFormFeed]; } else if (tmp == commonWChars[WideV]) { *toP++ = commonWChars[WVerticalTab]; } else if (tmp == commonWChars[WBackSlash]) { *toP++ = commonWChars[WBackSlash]; } else { /* * No special translation needed */ *toP++ = tmp; } } else { *toP++ = *fromP++; } lenToConvert++; } numCvt = doWcstombs(mbs, tbuf, lenToConvert); mbs[numCvt] = '\0'; } /* * Function: * status = dombtowc(wide, multi, size); * Description: * Convert a multibyte character to a wide character. * Input: * wide - wchar_t * : where to put the wide character * multi - char * : the multibyte character to convert * size - size_t : the number of characters to convert * Output: * 0 - if multi is a NULL pointer or points to a NULL character * #bytes - number of bytes in the multibyte character * -1 - multi is an invalid multibyte character. * * NOTE: if wide is NULL, then this returns the number of bytes in * the multibyte character. */ static int dombtowc ARGLIST((wide, multi, size)) ARG(wchar_t *, wide) ARG(char *, multi) GRA(size_t, size) { int retVal = 0; #ifndef SUPPORTS_WCHARS if ((multi == NULL) || (*multi == '\000')) { if (wide) wide[0] = '\0'; return (0); } for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++) { if (wide != NULL) { wide[retVal] = multi[retVal]; } } #else retVal = mbtowc(wide, multi, size); #endif return(retVal); } /* * Function: * ptr = getNextSepartor(str); * Description: * Parse through a string looking for the next compound string * field separator * Inputs: * str - wchar_t* : the address of address of the string to parse * Outputs: * ptr - wchar_t* : pointer to character, if found, points to end * of string otherwise ('\0'). */ static wchar_t* getNextSeparator ARGLIST((str)) GRA(wchar_t *, str) { wchar_t *ptr = str; wchar_t *commonWChars = CStrCommonWideCharsGet(); while (*ptr) { /* * Check for separator */ if ((*ptr == commonWChars[WHash]) || (*ptr == commonWChars[WQuote]) || (*ptr == commonWChars[WColon])) { return(ptr); } else if (*ptr == commonWChars[WBackSlash]) { ptr++; if (*ptr) ptr++; /* Skip quoted character */ } else { ptr++; } } return(ptr); } /* * Function: * more = * extractSegment(str, tagStart, tagLen, txtStart, txtLen, * pDir, pSep); * Description: * Parse through a string version of a compound string and extract * the first compound string segment from the string. * Inputs: * str - char** : the address of address of the string to parse * tagStart - char** : address to return pointer to tag start into * tagLen - int* : address where to return the tag length into * txtStart - char** : address to return the text start into * txtLen - int* : address where to return the text length * pDir - int* : address to return the string direction into * pSep - Boolean * : address to return the separtor into * Outputs: * more - Boolean : True if more of the string to parse. * False means done. */ static Boolean extractSegment ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep)) ARG(wchar_t **, str) ARG(wchar_t **, tagStart) ARG(int *, tagLen) ARG(wchar_t **, txtStart) ARG(int *, txtLen) ARG(int *, pDir) GRA(Boolean *, pSep) { wchar_t *start; wchar_t *text; int textL; Boolean tagSeen; wchar_t *tag; int tagL; Boolean modsSeen; Boolean sep; int dir; Boolean done; int *lenUp; Boolean checkDir; wchar_t *commonWChars; wchar_t emptyStrWcs[1]; /* * Initialize variables */ text = NULL; textL = 0; tagSeen = False; tag = NULL; tagL = 0; modsSeen = False; dir = XmSTRING_DIRECTION_L_TO_R; sep = False; done = False; lenUp = NULL; commonWChars = CStrCommonWideCharsGet(); /* * Guard against nulls */ if (!(start = *str)) { start = emptyStrWcs; emptyStrWcs[0] = commonWChars[WNull]; } /* * If the first character of the string isn't a # or a ", then we * just have a regular old simple string. Do the same the thing for * the empty string. */ if ((*start == '\0') || (start != getNextSeparator(start))) { text = start; if (!(textL = strlenWc(start))) { text = NULL; } start += textL; } else { done = False; while (!done) { if (*start == commonWChars[WHash]) { if (tagSeen) { done = True; break; } else { tagSeen = True; tag = ++start; start = getNextSeparator(tag); if ((tagL = start - tag) == 0) { tag = NULL; /* Null tag specified */ } } } else if (*start == commonWChars[WQuote]) { text = ++start; start = getNextSeparator(start); while (!((*start == commonWChars[WQuote]) || (*start == commonWChars[WNull]))) { start = getNextSeparator(++start); } if ((textL = start - text) == 0) { text = NULL; /* Null text specified */ } /* * if a quote, skip over it */ if (*start == commonWChars[WQuote]) { start++; } done = True; } else if (*start == commonWChars[WColon]) { if (modsSeen) { done = True; break; } /* * If the next character is a t or f, the we've got * a separator. */ modsSeen = True; checkDir = False; start++; if ((*start == commonWChars[WideT]) || (*start == commonWChars[WideUT]) || (*start == commonWChars[WideOne])) { sep = True; start++; checkDir = True; } else if ((*start == commonWChars[WideF]) || (*start == commonWChars[WideUF]) || (*start == commonWChars[WideZero])) { sep = False; start++; checkDir = True; } else if ((*start == commonWChars[WideR]) || (*start == commonWChars[WideUR])) { start++; dir = XmSTRING_DIRECTION_R_TO_L; } else if ((*start == commonWChars[WideL]) || (*start == commonWChars[WideUL])) { start++; dir = XmSTRING_DIRECTION_L_TO_R; } /* * Look for direction if necessary. This requires a bit of * look ahead. */ if (checkDir && (*start == commonWChars[WColon])) { if ((*(start + 1) == commonWChars[WideL]) || (*(start + 1) == commonWChars[WideUL])) { dir = XmSTRING_DIRECTION_L_TO_R; start += 2; } else if ((*(start + 1) == commonWChars[WideR]) || (*(start + 1) == commonWChars[WideUR])) { dir = XmSTRING_DIRECTION_R_TO_L; start+=2; } } } else { /* * A bad string format! We'll just skip the character. */ start++; } } } /* * Now fill in return values */ if (*str) *str = start; if (tagStart) *tagStart = tag; if (tagLen) *tagLen = tagL; if (txtStart) *txtStart = text; if (txtLen) *txtLen = textL; if (pDir) *pDir = dir; if (pSep) *pSep = sep; return ((*start == commonWChars[WNull]) ? False : True); } /* * Function: * xstr = StringToXmString(str); * Description: * Parse a string into an XmString. * Inputs: * str - char * : the string to parse * Outputs: * xstr - XmString : the allocated return structure */ static XmString StringToXmString ARGLIST((str)) GRA(char *,str) { static char* tagBuf = NULL; static int tagBufLen = 0; static char* textBuf = NULL; static int textBufLen = 0; wchar_t *ctx; wchar_t *tag; int tagLen; wchar_t *text; int textLen; Boolean sep; int dir; Boolean more; wchar_t *wcStr; int curDir; XmString xmStr; XmString s1; XmString s2; if (!str) return(NULL); /* * For expediencies sake, we'll overallocate this buffer so that * the wcs is guaranteed to fit (1 wc per byte in original string). */ wcStr = (wchar_t*)malloc((strlen(str) + 1) * sizeof(wchar_t)); doMbstowcs(wcStr, str, strlen(str) + 1); /* * Create the beginning segment */ curDir = XmSTRING_DIRECTION_L_TO_R; xmStr = XmStringDirectionCreate(curDir); /* * Convert the string. */ more = True; ctx = wcStr; while (more) { more = extractSegment(&ctx, &tag, &tagLen, &text, &textLen, &dir, &sep); /* * Pick up a direction change */ if (dir != curDir) { #if defined(VMS) || (defined(__osf__) && defined(__alpha)) /* * This is required on DEC Windows systems because they've * added the REVERT direction. */ s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); #endif curDir = dir; s1 = XmStringDirectionCreate(curDir); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Create the segment. Text and tag first. */ if (textLen) { if (textBufLen <= (textLen * sizeof(wchar_t))) { textBufLen = (textLen + 1) * sizeof(wchar_t); textBuf = (char*)realloc(textBuf, textBufLen); } copyWcsToMbs(textBuf, text, textLen, True); if (tagLen) { if (tagBufLen <= (tagLen * sizeof(wchar_t))) { tagBufLen = (tagLen + 1) * sizeof(wchar_t); tagBuf = (char*)realloc(tagBuf, tagBufLen); } copyWcsToMbs(tagBuf, tag, tagLen, False); } else { if (!tagBuf) { tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1; tagBuf = (char*)malloc(tagBufLen); } strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET); } s1 = XmStringCreate(textBuf, tagBuf); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Add in the separators. */ if (sep) { s1 = XmStringSeparatorCreate(); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } } /* * Free up memory and return */ free((char*)wcStr); return(xmStr); } /* * Function: * nextCStr = getNextCStrDelim(str); * Description: * Find the next unquoted , or \n in the string * Input: * str - char * : the input string * Output: * nextCStr - char* : pointer to the next delimiter. Returns NULL if no * delimiter found. */ static char* getNextCStrDelim ARGLIST((str)) GRA(char *,str) { char *comma = str; Boolean inQuotes = False; int len; if (!str) return(NULL); if (!*str) return(NULL); /* At end */ #ifdef __CENTERLINE__ mblen((char *)NULL, sizeof(wchar_t)); #else mblen(NULL, sizeof(wchar_t)); #endif while (*comma) { if ((len = mblen(comma, sizeof(wchar_t))) > 1) { comma += len; continue; } if (*comma == '\\') { comma++; /* Over quote */ comma += mblen(comma, sizeof(wchar_t)); continue; } /* * See if we have a delimiter */ if (!inQuotes) { if ((*comma == ',') || (*comma == '\012')) { return(comma); } } /* * Deal with quotes */ if (*comma == '\"') { inQuotes = ~inQuotes; } comma++; } return(NULL); /* None found */ } /* * Function: * cnt = getCStrCount(str); * Description: * Get the count of cstrings in a compound string table ascii * format. * Input: * str - char * : string to parse * Output: * cnt - int : the number of XmStrings found */ static int getCStrCount ARGLIST((str)) GRA(char *, str) { int x = 1; char *newStr; if (!str) return(0); if (!*str) return(0); while ((newStr = getNextCStrDelim(str))) { x++; str = ++newStr; } return(x); } /* * Function: * cwc = CStrCommonWideCharsGet(); * Description: * Return the array of common wide characters. * Input: * None. * Output: * cwc - wchar_t * : this array should never be written to or FREEd. */ static wchar_t *CStrCommonWideCharsGet() { static wchar_t *CommonWideChars = NULL; if (CommonWideChars == NULL) { int i; /* * If you add to this array, don't forget to change the enum in * the TYPEDEFS and DEFINES section above to correspond to this * array. */ static char *characters[] = { "\000", "\t", "\n", "\r", "\f", "\v", "\\", "\"", "#", ":", "f", "l", "n", "r", "t", "v", "F", "L", "R", "T", "0", "1" }; /* * Allocate and create the array. */ CommonWideChars = (wchar_t*)malloc(NUM_COMMON_WCHARS * sizeof(wchar_t)); for (i = 0; i < NUM_COMMON_WCHARS; i++) { (void)dombtowc(&(CommonWideChars[i]), characters[i], 1); } } return(CommonWideChars); } /* * Function: * CONVERTER CvtStringToXmString * and * XmStringCvtDestroy * Description: * Convert a string to an XmString. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * ::[#[font-tag]]"string"[#[font-tag]"string"] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmString ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) UARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString resStr; char *str; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg(XtDisplayToApplicationContext(d), "cvtStringToXmString", "wrongParameters", "XtToolkitError", "String to XmString converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * See if this is a simple string */ str = (char*)fromVal->addr; if (strncmp(str, "::", 2)) { resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET); } else { /* * Convert into internal format */ resStr = StringToXmString(fromVal->addr + 2); /* skip :: */ } /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&resStr; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString)) { toVal->size = sizeof(XmString); XtDisplayStringConversionWarning(d, fromVal->addr, "XmString"); XmStringFree(resStr); return(False); } else { *(XmString *)toVal->addr = resStr; toVal->size = sizeof(XmString); } return(True); } static void XmStringCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmStringFree(*(XmString*)(to->addr)); } /* * Function: * CONVERTER CvtStringToXmStringTable * and * XmStringTableCvtDestroy * * Description: * Convert a string to an XmString table. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ... * compound_string_table = [compound_string][,compound_string] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmStringTable ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) ARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString *CStrTable; XmString *tblPtr; char *str; char *tmpBuf; char *nextDelim; XrmValue fVal; XrmValue tVal; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg (XtDisplayToApplicationContext(d), "cvtStringToXmStringTable", "wrongParameters", "XtToolkitError", "String to XmStringTable converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * Set str and make sure there's somethin' there */ if (!(str = (char*)fromVal->addr)) { str = ""; } /* * Allocate the XmStrings + 1 for NULL termination */ CStrTable = (XmString*)malloc((getCStrCount(str) + 1) * sizeof(XmString*)); /* * Use the string converter for the strings */ tmpBuf = (char*)malloc(strlen(str) + 1); strcpy(tmpBuf, str); str = tmpBuf; /* * Create strings */ tblPtr = CStrTable; if (*str) { while (str) { nextDelim = getNextCStrDelim(str); /* * Overwrite nextDelim */ if (nextDelim) { *nextDelim = '\0'; nextDelim++; } /* * Convert it */ fVal.size = strlen(str) + 1; fVal.addr = str; tVal.size = sizeof(XTPOINTER); tVal.addr = (XTPOINTER)tblPtr; /* * Call converter ourselves since this is used to create * the strings in the table we create. We need to do this * since we don't have a widget to send to the XtConvertAndStore * function. Side effects are that we can never get these * compound strings cached and that no destructor function is * called when the strings leave existance, but we nuke 'em * in the XmStringTable destuctor. */ CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL); tblPtr++; str = nextDelim; } } free(tmpBuf); /* * Null terminate */ *tblPtr = NULL; /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&CStrTable; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString*)) { toVal->size = sizeof(XmString*); XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable"); tblPtr = CStrTable; while (*tblPtr) { XmStringFree(*tblPtr); } free((char*)CStrTable); return(False); } else { *(XmString **)toVal->addr = CStrTable; toVal->size = sizeof(XmString*); } return(True); } static void XmStringTableCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmString *tblPtr = *(XmString**)(to->addr); while (*tblPtr) { XmStringFree(*tblPtr); } free((char*)(*(XmString**)(to->addr))); } /***************************************************************************** * GLOBAL CODE *****************************************************************************/ /* * Function: * RegisterBxConverters(appContext); * Description: * This globally available function installs all the converters necessary * to run BuilderXcessory generated interfaces that use compound * strings. This is necessary since Motif has not supplied very smart * converters. * Input: * appContext - XtAppContext : the application context * Output: * None */ void RegisterBxConverters ARGLIST((appContext)) GRA(XtAppContext, appContext) { XtAppSetTypeConverter(appContext, XmRString, XmRXmString, (XtTypeConverter)CvtStringToXmString, NULL, 0, XtCacheNone, XmStringCvtDestroy); XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable, (XtTypeConverter)CvtStringToXmStringTable, NULL, 0, XtCacheNone, XmStringTableCvtDestroy); } /* * Function: * CONVERT(w, from_string, to_type, to_size, success); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * w - Widget : the widget to use for conversion * from_string - char * : the string to convert from * to_type - char * : the type to convert to * to_size - int : the size of the conversion result * success - Boolean* : Set to the result value of the conversion * Output: * None */ #ifndef IGNORE_CONVERT XtPointer CONVERT ARGLIST((w, from_string, to_type, to_size, success)) ARG(Widget, w) ARG(char *, from_string) ARG(char *, to_type) ARG(int, to_size) GRA(Boolean *, success) { XrmValue fromVal, toVal; /* resource holders */ Boolean convResult; /* return value */ XtPointer val; /* Pointer size return value */ /* * We will assume that the conversion is going to fail and change this * value later if the conversion is a success. */ *success = False; /* * Since we are converting from a string to some type we need to * set the fromVal structure up with the string information that * the caller passed in. */ fromVal.size = strlen(from_string) + 1; fromVal.addr = from_string; /* * Since we are not sure what type and size of data we are going to * get back we will set this up so that the converter will point us * at a block of valid data. */ toVal.size = 0; toVal.addr = NULL; /* * Now lets try to convert this data by calling this handy-dandy Xt * routine. */ convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal); /* * Now we have two conditions here. One the conversion was a success * and two the conversion failed. */ if(!convResult) { /* * If this conversion failed that we can pretty much return right * here because there is nothing else we can do. */ return((XtPointer) NULL); } /* * If we get this far that means we did the conversion and all is * well. Now we have to handle the special cases for type and * size constraints. */ if(!strcmp(to_type, "String")) { /* * Since strings are handled different in Xt we have to deal with * the conversion from a string to a string. When this happens the * toVal.size will hold the strlen of the string so generic * conversion code can't handle it. It is possible for a string to * string conversion to happen so we do have to watch for it. */ val = (XTPOINTER)toVal.addr; } else { /* * Here is the generic conversion return value handler. This * just does some size specific casting so that value that we * return is in the correct bytes of the XtPointer that we * return. Here we check all sizes from 1 to 8 bytes. */ switch(toVal.size) { case 1: val = (XTPOINTER)(unsigned)(*(char*)toVal.addr); break; case 2: val = (XTPOINTER)(unsigned)(*(short*)toVal.addr); break; case 4: val = (XTPOINTER)(unsigned)(*(int*)toVal.addr); break; case 8: default: val = (XTPOINTER)(unsigned)(*(long*)toVal.addr); break; } } /* * Well everything is done and the conversion was a success so lets * set the success flag to True. */ *success = convResult; /* * Finally lets return the converted value. */ /*SUPPRESS 80*/ return(val); } #endif /* * Function: * MENU_POST(p, mw, ev, dispatch); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * p - Widget : the widget to post * mw - XtPointer : the menu widget * ev - XEvent* : the event that caused the menu post * dispatch - Boolean* : not used * Output: * None */ #ifndef IGNORE_MENU_POST void MENU_POST ARGLIST((p, mw, ev, dispatch)) UARG(Widget, p) ARG(XtPointer, mw) ARG(XEvent *, ev) GRAU(Boolean *, dispatch) { Arg args[2]; int argcnt; int button; Widget m = (Widget)mw; XButtonEvent *e = (XButtonEvent *)ev; argcnt = 0; XtSetArg(args[argcnt], XmNwhichButton, &button); argcnt++; XtGetValues(m, args, argcnt); if(e->button != button) return; XmMenuPosition(m, e); XtManageChild(m); } #endif /* * Function: * SET_BACKGROUND_COLOR(w, args, argcnt, bg_color); * Description: * Sets the background color and shadows of a widget. * Input: * w - The widget to set the background color on. * args, argcnt - The argument list so far. * bg_color - The new background color as a pixel. * Output: * none * * NOTES: This assumes that args later in the argument list * override those already in the list. Therfore i f * there are shadow colors later in the list they will win. * * There is no need to use this function when creating a widget * only when doing a set values, shadow colors are automatically * calculated at creation time. */ void SET_BACKGROUND_COLOR ARGLIST((w, args, argcnt, bg_color)) ARG(Widget, w) ARG(ArgList, args) ARG(Cardinal *, argcnt) GRA(Pixel, bg_color) { int i; int topShadowLoc; int bottomShadowLoc; int selectLoc; int fgLoc; Boolean argok = False; #if ((XmVERSION == 1) && (XmREVISION > 0)) /* * Walk through the arglist to see if the user set the top or * bottom shadow colors. */ selectLoc = topShadowLoc = bottomShadowLoc = UNSET; for (i = 0; i < *argcnt; i++) { if ((strcmp(args[i].name, XmNtopShadowColor) == 0) || (strcmp(args[i].name, XmNtopShadowPixmap) == 0)) { topShadowLoc = i; } else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) || (strcmp(args[i].name, XmNbottomShadowPixmap) == 0)) { bottomShadowLoc = i; } else if (strcmp(args[i].name, XmNarmColor) == 0) { selectLoc = i; } else if (strcmp(args[i].name, XmNforeground) == 0) { fgLoc = i; } } /* * If either the top or bottom shadow are not set then we * need to use XmGetColors to get the shadow colors from the backgound * color and add those that are not already in the arglist to the * arglist. * */ if ((bottomShadowLoc == UNSET) || (topShadowLoc == UNSET) || (selectLoc == UNSET) || (fgLoc == UNSET)) { Arg larg[1]; Colormap cmap; Pixel topShadow; Pixel bottomShadow; Pixel select; Pixel fgColor; XtSetArg(larg[0], XmNcolormap, &cmap); XtGetValues(w, larg, 1); XmGetColors(XtScreen(w), cmap, bg_color, &fgColor, &topShadow, &bottomShadow, &select); if (topShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow); (*argcnt)++; } if (bottomShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow); (*argcnt)++; } if (selectLoc == UNSET) { XtSetArg(args[*argcnt], XmNarmColor, select); (*argcnt)++; } if (fgLoc == UNSET) { XtSetArg(args[*argcnt], XmNforeground, fgColor); (*argcnt)++; } } #endif XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++; } /* * Function: * w = BxFindTopShell(start); * Description: * Go up the hierarhcy until we find a shell widget. * Input: * start - Widget : the widget to start with. * Output: * w - Widget : the shell widget. */ #ifndef _BX_FIND_TOP_SHELL #define _BX_FIND_TOP_SHELL Widget BxFindTopShell ARGLIST((start)) GRA(Widget, start) { Widget p; while ((p = XtParent(start))) { start = p; } return(start); } #endif /* _BX_FIND_TOP_SHELL */ /* * Function: * BxWidgetIdsFromNames(ref, cbName, stringList) * Description: * Return an array of widget ids from a list of widget names. * Input: * ref - Widget : reference widget. * cbName - char* : callback name. * stringList - char*: list of widget names. * Output: * WidgetList : array of widget IDs. */ #ifndef _BX_WIDGETIDS_FROM_NAMES #define _BX_WIDGETIDS_FROM_NAMES WidgetList BxWidgetIdsFromNames ARGLIST((ref, cbName, stringList)) ARG(Widget, ref) ARG(char, *cbName) GRA(char, *stringList) { WidgetList wgtIds = NULL; int wgtCount = 0; Widget inst; Widget current; String tmp; String start; String widget; char *ptr; /* * For backward compatibility, remove [ and ] from the list. */ tmp = start = XtNewString(stringList); if((start = strchr(start, '[')) != NULL) start++; else start = tmp; while((start && *start) && isspace(*start)) { start++; } ptr = strrchr(start, ']'); if (ptr) { *ptr = '\0'; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * start now points to the first character after the [. * the list is now either empty, one, or more widget * instance names. */ start = strtok(start, ","); while(start) { while((start && *start) && isspace(*start)) { start++; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * Form a string to use with XtNameToWidget(). */ widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char)); sprintf(widget, "*%s", start); /* * Start at this level and continue up until the widget is found * or until the top of the hierarchy is reached. */ current = ref; while (current != NULL) { inst = XtNameToWidget(current, widget); if (inst != NULL ) { wgtCount++; wgtIds = (WidgetList)XtRealloc((char *)wgtIds, wgtCount * sizeof(Widget)); wgtIds[wgtCount - 1] = inst; break; } current = XtParent(current); } if (current == NULL) { printf("Callback Error (%s):\n\t\ Cannot find widget %s\n", cbName, widget); } XtFree(widget); start = strtok(NULL, ","); } /* * NULL terminate the list. */ wgtIds = (WidgetList)XtRealloc((char *)wgtIds, (wgtCount + 1) * sizeof(Widget)); wgtIds[wgtCount] = NULL; XtFree((char *)tmp); return(wgtIds); } #endif /* _BX_WIDGETIDS_FROM_NAMES */ /**************************************************************************** * * Big chunk of code inserted from Bull * ****************************************************************************/ #ifndef IGNORE_XPM_PIXMAP /* * Copyright 1990, 1991 GROUPE BULL * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of GROUPE BULL not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. GROUPE BULL makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * GROUPE BULL disclaims all warranties with regard to this software, * including all implied warranties of merchantability and fitness, * in no event shall GROUPE BULL be liable for any special, * indirect or consequential damages or any damages * whatsoever resulting from loss of use, data or profits, * whether in an action of contract, negligence or other tortious * action, arising out of or in connection with the use * or performance of this software. * */ /* Return ErrorStatus codes: * null if full success * positive if partial success * negative if failure */ #define XpmColorError 1 #define XpmSuccess 0 #define XpmOpenFailed -1 #define XpmFileInvalid -2 #define XpmNoMemory -3 #define XpmColorFailed -4 typedef struct { char *name; /* Symbolic color name */ char *value; /* Color value */ Pixel pixel; /* Color pixel */ } XpmColorSymbol; typedef struct { unsigned long valuemask; /* Specifies which attributes are * defined */ Visual *visual; /* Specifies the visual to use */ Colormap colormap; /* Specifies the colormap to use */ unsigned int depth; /* Specifies the depth */ unsigned int width; /* Returns the width of the created * pixmap */ unsigned int height; /* Returns the height of the created * pixmap */ unsigned int x_hotspot; /* Returns the x hotspot's * coordinate */ unsigned int y_hotspot; /* Returns the y hotspot's * coordinate */ unsigned int cpp; /* Specifies the number of char per * pixel */ Pixel *pixels; /* List of used color pixels */ unsigned int npixels; /* Number of pixels */ XpmColorSymbol *colorsymbols; /* Array of color symbols to * override */ unsigned int numsymbols; /* Number of symbols */ char *rgb_fname; /* RGB text file name */ /* Infos */ unsigned int ncolors; /* Number of colors */ char ***colorTable; /* Color table pointer */ char *hints_cmt; /* Comment of the hints section */ char *colors_cmt; /* Comment of the colors section */ char *pixels_cmt; /* Comment of the pixels section */ unsigned int mask_pixel; /* Transparent pixel's color table * index */ } XpmAttributes; /* Xpm attribute value masks bits */ #define XpmVisual (1L<<0) #define XpmColormap (1L<<1) #define XpmDepth (1L<<2) #define XpmSize (1L<<3) /* width & height */ #define XpmHotspot (1L<<4) /* x_hotspot & y_hotspot */ #define XpmCharsPerPixel (1L<<5) #define XpmColorSymbols (1L<<6) #define XpmRgbFilename (1L<<7) #define XpmInfos (1L<<8) /* all infos members */ #define XpmReturnPixels (1L<<9) #define XpmReturnInfos XpmInfos /* * minimal portability layer between ansi and KR C */ /* forward declaration of functions with prototypes */ #ifdef NeedFunctionPrototypes #define FUNC(f, t, p) extern t f p #define LFUNC(f, t, p) static t f p #else #define FUNC(f, t, p) extern t f() #define LFUNC(f, t, p) static t f() #endif /* * functions declarations */ #ifdef __cplusplus extern "C" { #endif LFUNC(XpmCreatePixmapFromData, int, (Display * display, Drawable d, char **data, Pixmap * pixmap_return, Pixmap * shapemask_return, XpmAttributes * attributes)); LFUNC(XpmCreateImageFromData, int, (Display * display, char **data, XImage ** image_return, XImage ** shapemask_return, XpmAttributes * attributes)); LFUNC(XpmFreeAttributes, void, (XpmAttributes * attributes)); #ifdef __cplusplus } /* for C++ V2.0 */ #endif #ifdef SYSV #define bcopy(source, dest, count) memcpy(dest, source, count) #endif typedef struct { unsigned int type; union { FILE *file; char **data; } stream; char *cptr; unsigned int line; int CommentLength; char Comment[BUFSIZ]; char *Bcmt, *Ecmt, Bos, Eos; unsigned int InsideString; /* used during parsing: 0 or 1 * whether we are inside or not */ } xpmData; #define XPMARRAY 0 #define XPMFILE 1 #define XPMPIPE 2 typedef unsigned char byte; extern char *xpmColorKeys[]; #define TRANSPARENT_COLOR "None" /* this must be a string! */ /* number of xpmColorKeys */ #define NKEYS 5 /* * key numbers for visual type, they must fit along with the number key of * each corresponding element in xpmColorKeys[] defined in xpm.h */ #define MONO 2 #define GRAY4 3 #define GRAY 4 #define COLOR 5 /* structure containing data related to an Xpm pixmap */ typedef struct { char *name; unsigned int width; unsigned int height; unsigned int cpp; unsigned int ncolors; char ***colorTable; unsigned int *pixelindex; XColor *xcolors; char **colorStrings; unsigned int mask_pixel; /* mask pixel's colorTable index */ } xpmInternAttrib; #define UNDEF_PIXEL 0x80000000 char *xpmColorKeys[] = { "s", /* key #1: symbol */ "m", /* key #2: mono visual */ "g4", /* key #3: 4 grays visual */ "g", /* key #4: gray visual */ "c", /* key #5: color visual */ }; /* XPM private routines */ LFUNC(xpmCreateImage, int, (Display * display, xpmInternAttrib * attrib, XImage ** image_return, XImage ** shapeimage_return, XpmAttributes * attributes)); LFUNC(xpmParseData, int, (xpmData * data, xpmInternAttrib * attrib_return, XpmAttributes * attributes)); LFUNC(xpmVisualType, int, (Visual * visual)); LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors)); LFUNC(xpmInitInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmFreeInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmSetAttributes, void, (xpmInternAttrib * attrib, XpmAttributes * attributes)); /* I/O utility */ LFUNC(xpmNextString, void, (xpmData * mdata)); LFUNC(xpmNextUI, int, (xpmData * mdata, unsigned int *ui_return)); LFUNC(xpmGetC, int, (xpmData * mdata)); LFUNC(xpmUngetC, int, (int c, xpmData * mdata)); LFUNC(xpmNextWord, unsigned int, (xpmData * mdata, char *buf)); LFUNC(xpmGetCmt, void, (xpmData * mdata, char **cmt)); LFUNC(xpmOpenArray, int, (char **data, xpmData * mdata)); LFUNC(XpmDataClose, void, (xpmData * mdata)); /* RGB utility */ LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); /* Image utility */ LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname, unsigned int color_index, Pixel * image_pixel, Pixel * mask_pixel, unsigned int *mask_pixel_index)); LFUNC(CreateXImage, int, (Display * display, Visual * visual, unsigned int depth, unsigned int width, unsigned int height, XImage ** image_return)); LFUNC(SetImagePixels, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); /* * Macros * * The XYNORMALIZE macro determines whether XY format data requires * normalization and calls a routine to do so if needed. The logic in * this module is designed for LSBFirst byte and bit order, so * normalization is done as required to present the data in this order. * * The ZNORMALIZE macro performs byte and nibble order normalization if * required for Z format data. * * The XYINDEX macro computes the index to the starting byte (char) boundary * for a bitmap_unit containing a pixel with coordinates x and y for image * data in XY format. * * The ZINDEX* macros compute the index to the starting byte (char) boundary * for a pixel with coordinates x and y for image data in ZPixmap format. * */ #define XYNORMALIZE(bp, img) \ if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \ xpm_xynormalizeimagebits((unsigned char *)(bp), img) #define ZNORMALIZE(bp, img) \ if (img->byte_order == MSBFirst) \ xpm_znormalizeimagebits((unsigned char *)(bp), img) #define XYINDEX(x, y, img) \ ((y) * img->bytes_per_line) + \ (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3) #define ZINDEX(x, y, img) ((y) * img->bytes_per_line) + \ (((x) * img->bits_per_pixel) >> 3) #define ZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2) #define ZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1) #define ZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x) #define ZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3) #if __STDC__ #define Const const #else #define Const #endif Pixmap XPM_PIXMAP ARGLIST((w, pixmapName)) ARG(Widget, w) GRA(char **, pixmapName) { XpmAttributes attributes; int argcnt; Arg args[10]; Pixmap pixmap; Pixmap shape; int returnValue; argcnt = 0; XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++; XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++; XtGetValues(w, args, argcnt); attributes.visual = DefaultVisual(XtDisplay(w), DefaultScreen(XtDisplay(w))); attributes.valuemask = (XpmDepth | XpmColormap | XpmVisual); returnValue = XpmCreatePixmapFromData(XtDisplay(w), DefaultRootWindow(XtDisplay(w)), pixmapName, &pixmap, &shape, &attributes); if ( shape ) { XFreePixmap(XtDisplay(w), shape); } switch(returnValue) { case XpmOpenFailed: case XpmFileInvalid: case XpmNoMemory: case XpmColorFailed: XtWarning("Could not create pixmap."); return(XmUNSPECIFIED_PIXMAP); default: return(pixmap); } } static unsigned int atoui ARGLIST((p, l, ui_return)) ARG(register char *, p) ARG(unsigned int, l) GRA(unsigned int *, ui_return) { register int n, i; n = 0; for (i = 0; i < l; i++) if (*p >= '0' && *p <= '9') n = n * 10 + *p++ - '0'; else break; if (i != 0 && i == l) { *ui_return = n; return 1; } else return 0; } static int XpmCreatePixmapFromData ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes)) ARG(Display *, display) ARG(Drawable, d) ARG(char **, data) ARG(Pixmap *, pixmap_return) ARG(Pixmap *, shapemask_return) GRA(XpmAttributes *,attributes) { XImage *image, **imageptr = NULL; XImage *shapeimage, **shapeimageptr = NULL; int ErrorStatus; XGCValues gcv; GC gc; /* * initialize return values */ if (pixmap_return) { *pixmap_return = (Pixmap)NULL; imageptr = ℑ } if (shapemask_return) { *shapemask_return = (Pixmap)NULL; shapeimageptr = &shapeimage; } /* * create the images */ ErrorStatus = XpmCreateImageFromData(display, data, imageptr, shapeimageptr, attributes); if (ErrorStatus < 0) return (ErrorStatus); /* * create the pixmaps */ if (imageptr && image) { *pixmap_return = XCreatePixmap(display, d, image->width, image->height, image->depth); gcv.function = GXcopy; gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv); XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0, image->width, image->height); XDestroyImage(image); XFreeGC(display, gc); } if (shapeimageptr && shapeimage) { *shapemask_return = XCreatePixmap(display, d, shapeimage->width, shapeimage->height, shapeimage->depth); gcv.function = GXcopy; gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv); XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0, shapeimage->width, shapeimage->height); XDestroyImage(shapeimage); XFreeGC(display, gc); } return (ErrorStatus); } static int XpmCreateImageFromData ARGLIST((display, data, image_return, shapeimage_return, attributes)) ARG(Display *,display) ARG(char **, data) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { xpmData mdata; int ErrorStatus; xpmInternAttrib attrib; /* * initialize return values */ if (image_return) *image_return = NULL; if (shapeimage_return) *shapeimage_return = NULL; if ((ErrorStatus = xpmOpenArray(data, &mdata)) != XpmSuccess) return (ErrorStatus); xpmInitInternAttrib(&attrib); ErrorStatus = xpmParseData(&mdata, &attrib, attributes); if (ErrorStatus == XpmSuccess) ErrorStatus = xpmCreateImage(display, &attrib, image_return, shapeimage_return, attributes); if (ErrorStatus >= 0) xpmSetAttributes(&attrib, attributes); else if (attributes) XpmFreeAttributes(attributes); xpmFreeInternAttrib(&attrib); XpmDataClose(&mdata); return (ErrorStatus); } /* * open the given array to be read or written as an xpmData which is returned */ static int xpmOpenArray ARGLIST((data, mdata)) ARG(char **,data) GRA(xpmData *,mdata) { mdata->type = XPMARRAY; mdata->stream.data = data; mdata->cptr = *data; mdata->line = 0; mdata->CommentLength = 0; mdata->Bcmt = mdata->Ecmt = NULL; mdata->Bos = mdata->Eos = '\0'; mdata->InsideString = 0; return (XpmSuccess); } /* * Intialize the xpmInternAttrib pointers to Null to know * which ones must be freed later on. */ static void xpmInitInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *,attrib) { attrib->ncolors = 0; attrib->colorTable = NULL; attrib->pixelindex = NULL; attrib->xcolors = NULL; attrib->colorStrings = NULL; attrib->mask_pixel = UNDEF_PIXEL; } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \ if (chars) free(chars); \ if (pixelindex) free((char *)pixelindex); \ if (hints_cmt) free((char *)hints_cmt); \ if (colors_cmt) free((char *)colors_cmt); \ if (pixels_cmt) free((char *)pixels_cmt); \ return(status); } /* * This function parses an Xpm file or data and store the found informations * in an an xpmInternAttrib structure which is returned. */ static int xpmParseData ARGLIST((data, attrib_return, attributes)) ARG(xpmData *,data) ARG(xpmInternAttrib *, attrib_return) GRA(XpmAttributes *, attributes) { /* variables to return */ unsigned int width, height; unsigned int ncolors = 0; unsigned int cpp; unsigned int x_hotspot, y_hotspot, hotspot = 0; char ***colorTable = NULL; unsigned int *pixelindex = NULL; char *hints_cmt = NULL; char *colors_cmt = NULL; char *pixels_cmt = NULL; /* calculation variables */ unsigned int rncolors = 0; /* read number of colors, it is * different to ncolors to avoid * problem when freeing the * colorTable in case an error * occurs while reading the hints * line */ unsigned int key = 0; /* color key */ char *chars = NULL, buf[BUFSIZ]; unsigned int *iptr; unsigned int a, b, x, y, l; unsigned int curkey; /* current color key */ unsigned int lastwaskey; /* key read */ char curbuf[BUFSIZ]; /* current buffer */ /* * read hints: width, height, ncolors, chars_per_pixel */ if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height) && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp))) RETURN(XpmFileInvalid); ncolors = rncolors; /* * read hotspot coordinates if any */ hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot); /* * store the hints comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &hints_cmt); /* * read colors */ colorTable = (char ***) calloc(ncolors, sizeof(char **)); if (!colorTable) RETURN(XpmNoMemory); for (a = 0; a < ncolors; a++) { xpmNextString(data); /* skip the line */ colorTable[a] = (char **) calloc((NKEYS + 1), sizeof(char *)); if (!colorTable[a]) RETURN(XpmNoMemory); /* * read pixel value */ colorTable[a][0] = (char *) malloc(cpp); if (!colorTable[a][0]) RETURN(XpmNoMemory); for (b = 0; b < cpp; b++) colorTable[a][0][b] = xpmGetC(data); /* * read color keys and values */ curkey = 0; lastwaskey = 0; while ((l = xpmNextWord(data, buf))) { if (!lastwaskey) { for (key = 1; key < NKEYS + 1; key++) if ((strlen(xpmColorKeys[key - 1]) == l) && (!strncmp(xpmColorKeys[key - 1], buf, l))) break; } if (!lastwaskey && key <= NKEYS) { /* open new key */ if (curkey) { /* flush string */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } curkey = key; /* set new key */ curbuf[0] = '\0'; /* reset curbuf */ lastwaskey = 1; } else { if (!curkey) RETURN(XpmFileInvalid); /* key without value */ if (!lastwaskey) strcat(curbuf, " ");/* append space */ buf[l] = '\0'; strcat(curbuf, buf); /* append buf */ lastwaskey = 0; } } if (!curkey) RETURN(XpmFileInvalid); /* key without value */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } /* * store the colors comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &colors_cmt); /* * read pixels and index them on color number */ pixelindex = (unsigned int *) malloc(sizeof(unsigned int) * width * height); if (!pixelindex) RETURN(XpmNoMemory); iptr = pixelindex; chars = (char *) malloc(cpp); if (!chars) RETURN(XpmNoMemory); for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { for (a = 0; a < cpp; a++) chars[a] = xpmGetC(data); for (a = 0; a < ncolors; a++) if (!strncmp(colorTable[a][0], chars, cpp)) break; if (a == ncolors) RETURN(XpmFileInvalid); /* no color matches */ *iptr = a; } } /* * store the pixels comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &pixels_cmt); free(chars); /* * store found informations in the xpmInternAttrib structure */ attrib_return->width = width; attrib_return->height = height; attrib_return->cpp = cpp; attrib_return->ncolors = ncolors; attrib_return->colorTable = colorTable; attrib_return->pixelindex = pixelindex; if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->hints_cmt = hints_cmt; attributes->colors_cmt = colors_cmt; attributes->pixels_cmt = pixels_cmt; } if (hotspot) { attributes->x_hotspot = x_hotspot; attributes->y_hotspot = y_hotspot; attributes->valuemask |= XpmHotspot; } } return (XpmSuccess); } /* * set the color pixel related to the given colorname, * return 0 if success, 1 otherwise. */ static int SetColor ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index)) ARG(Display *, display) ARG(Colormap, colormap) ARG(char *, colorname) ARG(unsigned int, color_index) ARG(Pixel *, image_pixel) ARG(Pixel *, mask_pixel) GRA(unsigned int *, mask_pixel_index) { XColor xcolor; if (STRCASECMP(colorname, TRANSPARENT_COLOR)) { if (!XParseColor(display, colormap, colorname, &xcolor) || (!XAllocColor(display, colormap, &xcolor))) return (1); *image_pixel = xcolor.pixel; *mask_pixel = 1; } else { *image_pixel = 0; *mask_pixel = 0; *mask_pixel_index = color_index;/* store the color table index */ } return (0); } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (image) XDestroyImage(image); \ if (shapeimage) XDestroyImage(shapeimage); \ if (image_pixels) free((char *)image_pixels); \ if (mask_pixels) free((char *)mask_pixels); \ return(status); } static int xpmCreateImage ARGLIST((display, attrib, image_return, shapeimage_return, attributes)) ARG(Display *, display) ARG(xpmInternAttrib *, attrib) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { /* variables stored in the XpmAttributes structure */ Visual *visual; Colormap colormap; unsigned int depth; XpmColorSymbol *colorsymbols = NULL; unsigned int numsymbols; /* variables to return */ XImage *image = NULL; XImage *shapeimage = NULL; unsigned int mask_pixel; unsigned int ErrorStatus, ErrorStatus2; /* calculation variables */ Pixel *image_pixels = NULL; Pixel *mask_pixels = NULL; char *colorname; unsigned int a, b, l; Boolean pixel_defined; unsigned int key; /* * retrieve information from the XpmAttributes */ if (attributes && attributes->valuemask & XpmColorSymbols) { colorsymbols = attributes->colorsymbols; numsymbols = attributes->numsymbols; } else numsymbols = 0; if (attributes && attributes->valuemask & XpmVisual) visual = attributes->visual; else visual = DefaultVisual(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmColormap) colormap = attributes->colormap; else colormap = DefaultColormap(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmDepth) depth = attributes->depth; else depth = DefaultDepth(display, DefaultScreen(display)); ErrorStatus = XpmSuccess; /* * alloc pixels index tables */ key = xpmVisualType(visual); image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!image_pixels) RETURN(XpmNoMemory); mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!mask_pixels) RETURN(XpmNoMemory); mask_pixel = UNDEF_PIXEL; /* * get pixel colors, store them in index tables */ for (a = 0; a < attrib->ncolors; a++) { colorname = NULL; pixel_defined = False; /* * look for a defined symbol */ if (numsymbols && attrib->colorTable[a][1]) { for (l = 0; l < numsymbols; l++) if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1])) break; if (l != numsymbols) { if (colorsymbols[l].value) colorname = colorsymbols[l].value; else pixel_defined = True; } } if (!pixel_defined) { /* pixel not given as symbol value */ if (colorname) { /* colorname given as symbol value */ if (!SetColor(display, colormap, colorname, a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) pixel_defined = True; else ErrorStatus = XpmColorError; } b = key; while (!pixel_defined && b > 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b--; } b = key + 1; while (!pixel_defined && b < NKEYS + 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b++; } if (!pixel_defined) RETURN(XpmColorFailed); } else { image_pixels[a] = colorsymbols[l].pixel; mask_pixels[a] = 1; } } /* * create the image */ if (image_return) { ErrorStatus2 = CreateXImage(display, visual, depth, attrib->width, attrib->height, &image); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); /* * set the image data * * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use * optimized functions, otherwise use slower but sure general one. * */ if (image->depth == 1) SetImagePixels1(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 8) SetImagePixels8(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 16) SetImagePixels16(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 32) SetImagePixels32(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else SetImagePixels(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); } /* * create the shape mask image */ if (mask_pixel != UNDEF_PIXEL && shapeimage_return) { ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width, attrib->height, &shapeimage); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); SetImagePixels1(shapeimage, attrib->width, attrib->height, attrib->pixelindex, mask_pixels); } free((char *)mask_pixels); /* * if requested store allocated pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnInfos || attributes->valuemask & XpmReturnPixels)) { if (mask_pixel != UNDEF_PIXEL) { Pixel *pixels, *p1, *p2; attributes->npixels = attrib->ncolors - 1; pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels); if (pixels) { p1 = image_pixels; p2 = pixels; for (a = 0; a < attrib->ncolors; a++, p1++) if (a != mask_pixel) *p2++ = *p1; attributes->pixels = pixels; } else { /* if error just say we can't return requested data */ attributes->valuemask &= ~XpmReturnPixels; attributes->valuemask &= ~XpmReturnInfos; attributes->pixels = NULL; attributes->npixels = 0; } free((char *)image_pixels); } else { attributes->pixels = image_pixels; attributes->npixels = attrib->ncolors; } attributes->mask_pixel = mask_pixel; } else free((char *)image_pixels); /* * return created images */ if (image_return) *image_return = image; if (shapeimage_return) *shapeimage_return = shapeimage; return (ErrorStatus); } /* * Create an XImage */ static int CreateXImage ARGLIST((display, visual, depth, width, height, image_return)) ARG(Display *, display) ARG(Visual *, visual) ARG(unsigned int, depth) ARG(unsigned int, width) ARG(unsigned int, height) GRA(XImage **, image_return) { int bitmap_pad; /* first get bitmap_pad */ if (depth > 16) bitmap_pad = 32; else if (depth > 8) bitmap_pad = 16; else bitmap_pad = 8; /* then create the XImage with data = NULL and bytes_per_line = 0 */ *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0, width, height, bitmap_pad, 0); if (!*image_return) return (XpmNoMemory); /* now that bytes_per_line must have been set properly alloc data */ (*image_return)->data = (char *) malloc((*image_return)->bytes_per_line * height); if (!(*image_return)->data) { XDestroyImage(*image_return); *image_return = NULL; return (XpmNoMemory); } return (XpmSuccess); } /* * The functions below are written from X11R5 MIT's code (XImUtil.c) * * The idea is to have faster functions than the standard XPutPixel function * to build the image data. Indeed we can speed up things by supressing tests * performed for each pixel. We do exactly the same tests but at the image * level. Assuming that we use only ZPixmap images. */ LFUNC(_putbits, void, (register char *src, int dstoffset, register int numbits, register char *dst)); LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb)); static unsigned char Const _reverse_byte[0x100] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static void _XReverse_Bytes ARGLIST((bpt, nb)) ARG(register unsigned char *, bpt) GRA(register int, nb) { do { *bpt = _reverse_byte[*bpt]; bpt++; } while (--nb > 0); } static void xpm_xynormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; if (img->byte_order != img->bitmap_bit_order) { switch (img->bitmap_unit) { case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } if (img->bitmap_bit_order == MSBFirst) _XReverse_Bytes(bp, img->bitmap_unit >> 3); } static void xpm_znormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; switch (img->bits_per_pixel) { case 4: *bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF); break; case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 24: c = *(bp + 2); *(bp + 2) = *bp; *bp = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } static unsigned char Const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; static unsigned char Const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static void _putbits ARGLIST((src, dstoffset, numbits, dst)) ARG(register char *, src) /* address of source bit string */ ARG(int, dstoffset) /* bit offset into destination; * range is 0-31 */ ARG(register int, numbits) /* number of bits to copy to * destination */ GRA(register char *, dst) /* address of destination bit string */ { register unsigned char chlo, chhi; int hibits; dst = dst + (dstoffset >> 3); dstoffset = dstoffset & 7; hibits = 8 - dstoffset; chlo = *dst & _lomask[dstoffset]; for (;;) { chhi = (*src << dstoffset) & _himask[dstoffset]; if (numbits <= hibits) { chhi = chhi & _lomask[dstoffset + numbits]; *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi; break; } *dst = chhi | chlo; dst++; numbits = numbits - hibits; chlo = (unsigned char) (*src & _himask[hibits]) >> hibits; src++; if (numbits <= dstoffset) { chlo = chlo & _lomask[numbits]; *dst = (*dst & _himask[numbits]) | chlo; break; } numbits = numbits - dstoffset; } } /* * Default method to write pixels into a Z image data structure. * The algorithm used is: * * copy the destination bitmap_unit or Zpixel to temp * normalize temp if needed * copy the pixel bits into the temp * renormalize temp if needed * copy the temp back into the destination image data */ static void SetImagePixels ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { Pixel pixel; unsigned long px; register char *src; register char *dst; int nbytes; register unsigned int *iptr; register int x, y, i; iptr = pixelindex; if (image->depth == 1) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[XYINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = image->bitmap_unit >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; XYNORMALIZE(&px, image); i = ((x + image->xoffset) % image->bitmap_unit); _putbits((char *) &pixel, i, 1, (char *) &px); XYNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[XYINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } else { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; if (image->depth == 4) pixel &= 0xf; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[ZINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = (image->bits_per_pixel + 7) >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; ZNORMALIZE(&px, image); _putbits((char *) &pixel, (x * image->bits_per_pixel) & 7, image->bits_per_pixel, (char *) &px); ZNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[ZINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } } /* * write pixels into a 32-bits Z image data structure */ #ifndef WORD64 static unsigned long byteorderpixel = MSBFirst << 24; #endif static void SetImagePixels32 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *paddr; register unsigned int *iptr; register int x, y; iptr = pixelindex; #ifndef WORD64 if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { paddr = (unsigned int *)(&(image->data[ZINDEX32(x, y, image)])); *paddr = (unsigned int)pixels[*iptr]; } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 24); addr[1] = (unsigned char)(pixels[*iptr] >> 16); addr[2] = (unsigned char)(pixels[*iptr] >> 8); addr[3] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[3] = (unsigned char)(pixels[*iptr] >> 24); addr[2] = (unsigned char)(pixels[*iptr] >> 16); addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 16-bits Z image data structure */ static void SetImagePixels16 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *iptr; register int x, y; iptr = pixelindex; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 8); addr[1] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 8-bits Z image data structure */ static void SetImagePixels8 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned int *iptr; register int x, y; iptr = pixelindex; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) image->data[ZINDEX8(x, y, image)] = (char)pixels[*iptr]; } /* * write pixels into a 1-bit depth image data structure and **offset null** */ static void SetImagePixels1 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { unsigned char bit; int xoff, yoff; register unsigned int *iptr; register int x, y; if (image->byte_order != image->bitmap_bit_order) SetImagePixels(image, width, height, pixelindex, pixels); else { iptr = pixelindex; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 0x80 >> xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 1 << xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } } } /* * Store into the XpmAttributes structure the required informations stored in * the xpmInternAttrib structure. */ static void xpmSetAttributes ARGLIST((attrib, attributes)) ARG(xpmInternAttrib *, attrib) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->cpp = attrib->cpp; attributes->ncolors = attrib->ncolors; attributes->colorTable = attrib->colorTable; attrib->ncolors = 0; attrib->colorTable = NULL; } attributes->width = attrib->width; attributes->height = attrib->height; attributes->valuemask |= XpmSize; } } /* * Free the XpmAttributes structure members * but the structure itself */ static void XpmFreeAttributes ARGLIST((attributes)) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnPixels && attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } if (attributes->valuemask & XpmInfos) { if (attributes->colorTable) { xpmFreeColorTable(attributes->colorTable, attributes->ncolors); attributes->colorTable = NULL; attributes->ncolors = 0; } if (attributes->hints_cmt) { free(attributes->hints_cmt); attributes->hints_cmt = NULL; } if (attributes->colors_cmt) { free(attributes->colors_cmt); attributes->colors_cmt = NULL; } if (attributes->pixels_cmt) { free(attributes->pixels_cmt); attributes->pixels_cmt = NULL; } if (attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; } } attributes->valuemask = 0; } } /* * Free the xpmInternAttrib pointers which have been allocated */ static void xpmFreeInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *, attrib) { unsigned int a; if (attrib->colorTable) xpmFreeColorTable(attrib->colorTable, attrib->ncolors); if (attrib->pixelindex) free((char *)attrib->pixelindex); if (attrib->xcolors) free((char *)attrib->xcolors); if (attrib->colorStrings) { for (a = 0; a < attrib->ncolors; a++) if (attrib->colorStrings[a]) free((char *)attrib->colorStrings[a]); free((char *)attrib->colorStrings); } } /* * close the file related to the xpmData if any */ static void XpmDataClose ARGLIST((mdata)) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: break; case XPMFILE: if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin)) fclose(mdata->stream.file); break; #ifdef ZPIPE case XPMPIPE: pclose(mdata->stream.file); #endif } } /* * skip whitespace and compute the following unsigned int, * returns 1 if one is found and 0 if not */ static int xpmNextUI ARGLIST((mdata, ui_return)) ARG(xpmData *, mdata) GRA(unsigned int *, ui_return) { char buf[BUFSIZ]; int l; l = xpmNextWord(mdata, buf); return atoui(buf, l, ui_return); } /* * get the current comment line */ static void xpmGetCmt ARGLIST((mdata, cmt)) ARG(xpmData *, mdata) GRA(char **, cmt) { switch (mdata->type) { case XPMARRAY: *cmt = NULL; break; case XPMFILE: case XPMPIPE: if (mdata->CommentLength) { *cmt = (char *) malloc(mdata->CommentLength + 1); strncpy(*cmt, mdata->Comment, mdata->CommentLength); (*cmt)[mdata->CommentLength] = '\0'; mdata->CommentLength = 0; } else *cmt = NULL; break; } } /* * skip to the end of the current string and the beginning of the next one */ static void xpmNextString ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; switch (mdata->type) { case XPMARRAY: mdata->cptr = (mdata->stream.data)[++mdata->line]; break; case XPMFILE: case XPMPIPE: if (mdata->Eos) while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF); if (mdata->Bos) /* if not natural XPM2 */ while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF); break; } } /* * return the current character, skipping comments */ static int xpmGetC ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; register unsigned int n = 0, a; unsigned int notend; switch (mdata->type) { case XPMARRAY: return (*mdata->cptr++); case XPMFILE: case XPMPIPE: c = getc(mdata->stream.file); if (mdata->Bos && mdata->Eos && (c == mdata->Bos || c == mdata->Eos)) { /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (c); } if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) { mdata->Comment[0] = c; /* * skip the string begining comment */ do { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0' && c != EOF); if (mdata->Bcmt[n] != '\0') { /* this wasn't the begining of a comment */ /* put characters back in the order that we got them */ for (a = n; a > 0; a--) xpmUngetC(mdata->Comment[a], mdata); return (mdata->Comment[0]); } /* * store comment */ mdata->Comment[0] = mdata->Comment[n]; notend = 1; n = 0; while (notend) { while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } mdata->CommentLength = n; a = 0; do { c = getc(mdata->stream.file); n++; a++; mdata->Comment[n] = c; } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0' && c != EOF); if (mdata->Ecmt[a] == '\0') { /* this is the end of the comment */ notend = 0; xpmUngetC(mdata->Comment[n], mdata); } } c = xpmGetC(mdata); } return (c); } return 0; } /* * push the given character back */ static int xpmUngetC ARGLIST((c, mdata)) ARG(int, c) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: return (*--mdata->cptr = c); case XPMFILE: case XPMPIPE: if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos)) /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (ungetc(c, mdata->stream.file)); } return 0; } /* * skip whitespace and return the following word */ static unsigned int xpmNextWord ARGLIST((mdata, buf)) ARG(xpmData *, mdata) GRA(char *, buf) { register unsigned int n = 0; int c; switch (mdata->type) { case XPMARRAY: while (isspace(c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; do { c = *mdata->cptr++; buf[n++] = c; } while (!isspace(c) && c != mdata->Eos && c != '\0'); n--; mdata->cptr--; break; case XPMFILE: case XPMPIPE: while (isspace(c = xpmGetC(mdata)) && c != mdata->Eos); while (!isspace(c) && c != mdata->Eos && c != EOF) { buf[n++] = c; c = xpmGetC(mdata); } xpmUngetC(c, mdata); break; } return (n); } static int xpmVisualType ARGLIST((visual)) GRA(Visual *, visual) { #if defined(__cplusplus) || defined(c_plusplus) switch ( visual->c_class ) #else switch ( visual->class ) #endif { case StaticGray: case GrayScale: switch (visual->map_entries) { case 2: return (MONO); case 4: return (GRAY4); default: return (GRAY); } default: return (COLOR); } } /* * Free the computed color table */ static void xpmFreeColorTable ARGLIST((colorTable, ncolors)) ARG(char ***, colorTable) GRA(int, ncolors) { int a, b; if (colorTable) { for (a = 0; a < ncolors; a++) if (colorTable[a]) { for (b = 0; b < (NKEYS + 1); b++) if (colorTable[a][b]) free(colorTable[a][b]); free((char *)colorTable[a]); } free((char *)colorTable); } } #endif motif-2.3.8/demos/programs/Ext18List/Makefile.am0000644000175000017500000000065413145162623016335 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Ext18list datadir = ${prefix}/share/Xm/Ext18list bin_PROGRAMS = ext18list SUBDIRS = pixmaps ext18list_SOURCES = util-c.c callbacks-c.c creation.c ext18list.c \ extlist.h EXTRA_DIST = data_DATA = $(EXTRA_DIST) $(ext18list_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/Ext18List/creation.c0000644000175000017500000002670112672140200016241 00000000000000/* * MOTIF include files needed for widget creation. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "extlist.h" static void PlayerOptionMenu( Widget, DemoInfo ); /* * Function: RegisterConverters() * Registers all the converters for all widgets. */ static void RegisterConverters() { XtInitializeWidgetClass(xmPushButtonWidgetClass); XtInitializeWidgetClass(xmToggleButtonWidgetClass); XtInitializeWidgetClass(xmLabelWidgetClass); XtInitializeWidgetClass(xmFrameWidgetClass); XtInitializeWidgetClass(xmFormWidgetClass); XtInitializeWidgetClass(xmRowColumnWidgetClass); XtInitializeWidgetClass(xmMultiListWidgetClass); XtInitializeWidgetClass(xmPanedWidgetClass); XtInitializeWidgetClass(xmButtonBoxWidgetClass); XtInitializeWidgetClass(topLevelShellWidgetClass); XtInitializeWidgetClass(xmMenuShellWidgetClass); } /* * Function prototypes for routines * located in utilities file. */ extern XtPointer CONVERT(); extern void MENU_POST(); /* * Callback procedure declarations */ extern Widget CreateExtListCB(); extern void AddCB(); extern void RemCB(); extern void ExplainCB(); extern void QuitCB(); extern void UnselCB(); extern void ToggleFindArea(); extern void FirstRowCol(); extern void ChoosePlayerCB(); extern void UpdateRemLabelStr(); extern void CreateLabel(); /* * Function: Createform() * Create form hierarchy of widgets. */ Widget Createform( Widget parent, DemoInfo demo_info) { Arg args[512]; Cardinal argcnt; Boolean argok; Widget retval; Widget big_pane,right_pane; Widget listframe; Widget extlist; Widget lineup_frame; Widget lineup_row; Widget add_rc; Widget rem_rc; Widget elist_op_frame; Widget elist_op_row; Widget unsel_pb; Widget quit_pb; Widget explain_frame, explain_scrolled ; Widget explain_label; argok = False; RegisterConverters(); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; big_pane = XtCreateManagedWidget("pane",xmPanedWidgetClass, parent, args, argcnt); /* the left pane */ argcnt = 0; listframe = XtCreateManagedWidget("listframe", xmFrameWidgetClass, big_pane, args, argcnt); /* this is an interesting routine to read through in the file callbacks-c.c. It shows how to initialize the extended list */ demo_info->extlist = CreateExtListCB(listframe ); XtAddCallback( demo_info->extlist, XmNsingleSelectionCallback, UpdateRemLabelStr, (XtPointer)demo_info ); /* create the right pane */ right_pane = XtVaCreateManagedWidget("rigntPane",xmPanedWidgetClass, big_pane, NULL ); /* Create the Scrolled Help Text Area */ argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAUTOMATIC ); argcnt++; XtSetArg(args[argcnt], XmNscrollBarDisplayPolicy, XmAS_NEEDED ); argcnt++; XtSetArg(args[argcnt], XmNresizeToPreferred, True ); argcnt++; XtSetArg(args[argcnt], XmNpreferredPaneSize, 300 ); argcnt++; explain_scrolled = XtCreateManagedWidget( "scrollExplain", xmScrolledWindowWidgetClass, right_pane, args, argcnt ); explain_label = XtCreateManagedWidget("explain_label", xmLabelWidgetClass, explain_scrolled, NULL, 0 ); CreateLabel(explain_label, (XtPointer)0, (XtPointer)0); /* Create the controls area */ argcnt = 0; XtSetArg(args[argcnt], XmNskipAdjust, True ); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False ); argcnt++; lineup_frame = XtCreateManagedWidget("lineup_frame", xmFrameWidgetClass, right_pane, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillMajor ); argcnt++; lineup_row = XtCreateManagedWidget("lineup_row", xmButtonBoxWidgetClass, lineup_frame, args, argcnt ); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillMajor ); argcnt++; add_rc = XtCreateManagedWidget("add_rc", xmButtonBoxWidgetClass, lineup_row, args, argcnt ); (void) XtCreateManagedWidget("add_label", xmLabelWidgetClass, add_rc, NULL, 0 ); PlayerOptionMenu(add_rc, demo_info); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillMajor ); argcnt++; rem_rc = XtCreateManagedWidget("rem_rc", xmButtonBoxWidgetClass, lineup_row, args, argcnt ); (void)XtCreateManagedWidget("rem_label", xmLabelWidgetClass, rem_rc, NULL, 0 ); demo_info->rem_pb = XtCreateManagedWidget("rem_pb", xmPushButtonWidgetClass, rem_rc, NULL, 0 ); XtAddCallback(demo_info->rem_pb, XmNactivateCallback, RemCB, (XtPointer)demo_info); /* next group */ argcnt = 0; XtSetArg(args[argcnt], XmNskipAdjust, True ); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False ); argcnt++; lineup_frame = XtCreateManagedWidget("lineup_frame", xmFrameWidgetClass, right_pane, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillNone ); argcnt++; add_rc = XtCreateManagedWidget("quit_rc", xmButtonBoxWidgetClass, lineup_frame, args, argcnt ); unsel_pb = XtCreateManagedWidget("unsel_pb", xmPushButtonWidgetClass, add_rc, NULL, 0 ); XtAddCallback(unsel_pb, XmNactivateCallback, UnselCB, (XtPointer)demo_info); unsel_pb = XtCreateManagedWidget("firstRowCol", xmPushButtonWidgetClass, add_rc, NULL, 0 ); XtAddCallback(unsel_pb, XmNactivateCallback, FirstRowCol, (XtPointer)demo_info); unsel_pb = XtCreateManagedWidget("toggleFind", xmToggleButtonWidgetClass, add_rc, NULL, 0 ); XtAddCallback(unsel_pb, XmNarmCallback, ToggleFindArea, (XtPointer)demo_info); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillNone ); argcnt++; XtSetArg(args[argcnt], XmNskipAdjust, True ); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False ); argcnt++; add_rc = XtCreateManagedWidget("quit_rc", xmButtonBoxWidgetClass, right_pane, args, argcnt ); quit_pb = XtCreateManagedWidget("quit_pb", xmPushButtonWidgetClass, add_rc, NULL, 0); XtAddCallback(quit_pb, XmNactivateCallback, QuitCB, (XtPointer)0); return( big_pane ); } static void PlayerOptionMenu( Widget parent, DemoInfo demo_info ) { Arg args[512]; Cardinal argcnt; Widget optionMenu; Widget menuShell; Widget pulldownMenu; argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_OPTION); argcnt++; XtSetArg(args[argcnt], XmNx, 3); argcnt++; XtSetArg(args[argcnt], XmNy, 3); argcnt++; optionMenu = XtCreateManagedWidget("optionMenu", xmRowColumnWidgetClass, parent, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNwidth, 1); argcnt++; XtSetArg(args[argcnt], XmNheight, 1); argcnt++; menuShell = XtCreatePopupShell("menuShell", xmMenuShellWidgetClass, XtParent(optionMenu), args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNrowColumnType, XmMENU_PULLDOWN); argcnt++; XtSetArg(args[argcnt], XmNx, 0); argcnt++; XtSetArg(args[argcnt], XmNy, 0); argcnt++; XtSetArg(args[argcnt], XmNwidth, 108); argcnt++; XtSetArg(args[argcnt], XmNheight, 298); argcnt++; pulldownMenu = XtCreateWidget("pulldownMenu", xmRowColumnWidgetClass, menuShell, args, argcnt); argcnt = 0; demo_info->player[0] = XtCreateManagedWidget("playerone", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[0], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[1] = XtCreateManagedWidget("playertwo", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[1], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[2] = XtCreateManagedWidget("playerthree", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[2], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[3] = XtCreateManagedWidget("playerfour", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[3], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[4] = XtCreateManagedWidget("playerfive", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[4], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[5] = XtCreateManagedWidget("playersix", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[5], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[6] = XtCreateManagedWidget("playerseven", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[6], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[7] = XtCreateManagedWidget("playereight", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[7], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[8] = XtCreateManagedWidget("playernine", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[8], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[9] = XtCreateManagedWidget("playerten", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[9], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[10] = XtCreateManagedWidget("playereleven", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[10], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[11] = XtCreateManagedWidget("playertwelve", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[11], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[12] = XtCreateManagedWidget("playerthirteen", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[12], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; demo_info->player[13] = XtCreateManagedWidget("playerfourteen", xmPushButtonWidgetClass, pulldownMenu, args, argcnt); XtAddCallback(demo_info->player[13], XmNactivateCallback, ChoosePlayerCB, (XtPointer)demo_info ); argcnt = 0; XtSetArg(args[argcnt], XmNsubMenuId, pulldownMenu); argcnt++; XtSetValues(optionMenu, args, argcnt); } motif-2.3.8/demos/programs/Ext18List/pixmaps/0000755000175000017500000000000013211513007016023 500000000000000motif-2.3.8/demos/programs/Ext18List/pixmaps/stopsign.xpm0000644000175000017500000000254312672140200020344 00000000000000/* XPM */ static char * stopsign[] = { /* stopsign pixmap * width height ncolors chars_per_pixel */ "32 32 3 1 ", " c #FFFFFFFFFFFF s s_#FFFFFFFFFFFF ", ". c #000 s s_#000 ", "X c #FF0000 s s_#FF0000 ", /* pixels */ " ............ ", " . . ", " . XXXXXXXXXXXX . ", " . XXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXXXXXX . ", ". XXX XX XX XX XXXX .", ". XX XXX XXX XXX XXX X XXX XXX .", ". XX XXXXXXX XXX XXX X XXX XXX .", ". XX XXXXXXX XXX XXX X XXX XXX .", ". XXX XXXXXX XXX XXX X XXX XXX .", ". XXXX XXXXX XXX XXX X XXXX .", ". XXXXX XXXX XXX XXX X XXXXXXX .", ". XXXXXX XXX XXX XXX X XXXXXXX .", ". XXXXXX XXX XXX XXX X XXXXXXX .", ". XXXXXX XXX XXX XXX X XXXXXXX .", ". XX XXX XXX XXX XXX X XXXXXXX .", ". XXX XXXX XXXX XX XXXXXXX .", " . XXXXXXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXX . ", " . XXXXXXXXXXXX . ", " . . ", " ............ " } ; motif-2.3.8/demos/programs/Ext18List/pixmaps/Makefile.in0000644000175000017500000003650313211512766020032 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/Ext18List/pixmaps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(datadir)" DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Ext18list/pixmaps datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = clown.xbm crab.xpm eye.xpm porsche.xpm stopsign.xpm data_DATA = $(EXTRA_DIST) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Ext18List/pixmaps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Ext18List/pixmaps/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Ext18List/pixmaps/clown.xbm0000644000175000017500000000572012672140200017602 00000000000000#define clown_width 81 #define clown_height 52 static unsigned char clown_bits[] = { 0x00,0x00,0xe0,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00, 0x80,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x03,0x00,0x00,0xc0,0x01,0x00, 0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x1e,0x3f,0x3f,0x00,0x00,0x00, 0x0f,0x00,0x00,0x00,0x00,0xf0,0xc1,0xc0,0x01,0x00,0xc0,0x03,0x00,0x00,0x00, 0x00,0xc0,0x20,0x00,0x03,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xc0, 0x0f,0x00,0x30,0x00,0xe0,0x01,0x00,0x00,0x00,0x4c,0x30,0x30,0x00,0x18,0x00, 0x1f,0x3e,0x00,0x00,0x00,0x88,0x08,0x46,0x00,0x04,0x03,0x00,0xe0,0x61,0x00, 0x00,0x70,0x84,0x89,0x00,0xc4,0x00,0x00,0x00,0x1e,0x00,0x00,0x3f,0x84,0x80, 0x00,0x32,0x00,0xf8,0x01,0x00,0x00,0xc0,0xc0,0x04,0x41,0x00,0x0e,0x00,0x80, 0x1f,0x00,0x00,0x30,0x00,0x19,0x3e,0x00,0x82,0x01,0x00,0x70,0x00,0x00,0x08, 0x38,0x62,0x18,0x00,0xe1,0x00,0x00,0x00,0x00,0x00,0x3f,0x04,0xf2,0x61,0x00, 0x31,0x00,0x80,0x0f,0x30,0xc0,0xc0,0x85,0x0d,0x86,0x00,0x0e,0x00,0x40,0x30, 0x0c,0x20,0x00,0x76,0x02,0x08,0x01,0x04,0x00,0x20,0x6e,0xc2,0x10,0x3e,0x0c, 0x71,0x08,0x01,0xc8,0x03,0x20,0x5f,0x3b,0x08,0x41,0x18,0x09,0x88,0x00,0x30, 0x04,0x40,0x03,0x07,0x88,0x9c,0x30,0x11,0x66,0x00,0x20,0x0e,0xc0,0x00,0x70, 0x10,0xbf,0x30,0xe2,0x11,0x00,0x20,0x0f,0x20,0x00,0x00,0x04,0x5c,0x30,0x0c, 0x0e,0x00,0x40,0x02,0x10,0x00,0x00,0x10,0x38,0x18,0xfc,0x10,0x00,0x80,0x7f, 0x10,0x00,0x00,0x44,0x17,0x0c,0x03,0x21,0x00,0xf0,0xff,0x10,0x00,0x00,0x10, 0x02,0xc7,0x30,0x22,0x00,0xfc,0xff,0x61,0x00,0x00,0x44,0x80,0x23,0x08,0x31, 0x00,0x86,0xff,0x81,0x03,0x00,0x11,0xc1,0xff,0xf3,0x10,0x00,0xc6,0xff,0x01, 0x3e,0x00,0x44,0xe4,0x07,0x02,0x0c,0x00,0xfe,0xff,0x00,0xe2,0x00,0x11,0x7f, 0x00,0x02,0x07,0x00,0xf8,0x7f,0x00,0x21,0x41,0x44,0x02,0x20,0xdf,0x01,0x00, 0xe0,0x0f,0x80,0x11,0x11,0x11,0x03,0x11,0x03,0x00,0x00,0x00,0x01,0xe0,0x18, 0x45,0x44,0x02,0x91,0x00,0x00,0x00,0x00,0x02,0x1e,0x86,0x10,0x11,0x83,0x48, 0x00,0x00,0x00,0x00,0xfc,0x81,0x61,0x44,0x44,0x41,0x24,0x00,0x00,0x00,0x00, 0x04,0x78,0x18,0x11,0x91,0x20,0x22,0x00,0x00,0x00,0x00,0xf8,0x07,0x46,0x44, 0xc4,0x20,0x12,0x00,0x00,0x00,0x00,0x10,0xf0,0x11,0x11,0x71,0x10,0x09,0x00, 0x00,0x00,0x00,0xc0,0x4f,0x44,0x44,0xfc,0x90,0x08,0x00,0x00,0x00,0x00,0x00, 0x12,0x11,0x11,0xff,0x91,0x08,0x00,0x00,0x00,0x00,0x1f,0x45,0x44,0xc4,0x03, 0x49,0x04,0x00,0x00,0x00,0x80,0xf0,0x11,0x11,0xf1,0x00,0x4a,0x03,0x00,0x00, 0x00,0x80,0xc0,0x47,0x84,0xff,0x00,0xca,0x00,0x00,0x00,0x00,0x00,0xe1,0x1f, 0xfd,0xcb,0x01,0x2a,0x00,0x00,0x00,0x00,0x00,0xfe,0xef,0xbf,0x85,0x87,0x1f, 0x00,0x00,0x00,0x00,0x00,0x1e,0xfc,0x86,0x05,0xff,0x03,0x00,0x00,0x00,0x00, 0x00,0x04,0x70,0x83,0x85,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x70,0x03, 0xeb,0xc3,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xf0,0x0e,0xfe,0x80,0x00,0x00, 0x00,0x00,0x00,0x00,0x20,0xf8,0xfb,0x71,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0xfc,0x01,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xc0, 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x07,0x00,0x00,0x00, 0x00,0x00}; motif-2.3.8/demos/programs/Ext18List/pixmaps/crab.xpm0000644000175000017500000000400312672140200017376 00000000000000/* XPM */ static char * crab[] = { /* crab pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c SkyBlue m white s s_SkyBlue ", "x c orange m black s s_orange ", "* c #ff72c2 m black s s_#ff72c2 ", "+ c SteelBlue m white s s_SteelBlue ", "G c black m black s s_black ", "a c LightGrey m white s s_LightGrey ", /* pixels */ ". . . . . . * * * * . . . . . . . . . * * * * . . . . . ", ". . . . + * x x * . . . . . . . . . . + * x x * . . . . ", ". . . + * x x * . . . . . . . . . . . . + * x x * . . . ", ". . + * x * . . . * . . . . . . . . . * . . + * x * . . ", ". . + * x * . . + * . . . . . . . . + * . . + * x * . . ", ". . + * x * . + * * . . . . . . . . + * * . + * x * . . ", ". . + * x * + * * . . . . . . . . . . + * * + * x * . . ", ". . + * x * * * . . . . . . . . . . . . + * * x x * . . ", ". . . + * x * . . + * . . . . . . + * . . + * x * . . . ", ". . . + * x . . + * . + * * . * * . + * . . + x * . . . ", ". . . . + x . . + * . + * * . * * . + * . . + x . . . . ", ". . . . + x . . . + * + * * * * * + * . . . + x . . . . ", ". . . . + * x . . + * * * * * * * * * . . + x * . . . . ", ". . . . . + * x * * * * x x x x x * * * * x * . . . . . ", ". . . . + + + * * x x x x x x x x x x x x * . . . . . . ", ". . + + * x x x x x x x x x x x x x x x x x x * x . . . ", ". + * x x a + * * x x x x x x x x x x x * * a G * x * . ", "+ * x . . . + * * x x x x x x x x x x x * * G . . . x * ", ". . . . . . + * * x x x x x x x x x x x * * . . . . . . ", ". . . . . + * * x x x x x x x x x x x x x * * . . . . . ", ". . . + * x x x * x x x x x x x x x x x * x x x * . . . ", ". . + * x a a + * * x x x x x x x x x * * a a a x * . . ", ". + * x G G G + * * x x x x x x x x x * * a G G G x * . ", ". + * G . . . + * x * x x x x x x x * x * a G . . . * . ", ". . . . . . + * x a * * * x x x * * * a x * G . . . . . ", ". . . . . + * x a G a a * * * * * a a G a x * G . . . . ", ". . . . . + x a G . G G a a a a a G G . G G x a G . . . ", ". . . . . + x a G . . . G G G G G . . . . . x a G . . . " } ; motif-2.3.8/demos/programs/Ext18List/pixmaps/porsche.xpm0000644000175000017500000001075612672140200020146 00000000000000/* XPM */ static char * porsche[] = { /* porsche pixmap * width height ncolors chars_per_pixel */ "64 64 4 1 ", " c slateblue s s_slateblue ", ". c yellow s s_yellow ", "r c red s s_red ", "b c black s s_black ", /* pixels */ " ", " ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb............................................bb ", " bb..bbbb..bbbb..bbbb..bbbb..bbbb..b..b..bbbb..bb ", " bb..b..b..b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b..b..b..b..b..b..b.....b.....b..b..b.....bb ", " bb..bbbb..b..b..bbb...bbbb..b.....bbbb..bbbb..bb ", " bb..b.....b..b..b..b.....b..b.....b..b..b.....bb ", " bb..b.....b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b.....bbbb..b..b..bbbb..bbbb..b..b..bbbb..bb ", " bb............................................bb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....................bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb......b...b...bb.....bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....b...b...b....b..bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....bb..bb.bbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb...bbbbbbbb......bb..bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..bbbb...............bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.bbb.................bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..........b..b.......bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.....b...b..b........bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb....b...b..b..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....b.bbbbbbbbb..............bbbbbbbbbbbbbbbbb ", " bb...bbbb.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb..bbb.........b..............bbbbbbbbbbbbbbbbb ", " bb.bbb..........b...bbb........bbbbbbbbbbbbbbbbb ", " bb.........b..b.b..bbbbb.......bbbbbbbbbbbbbbbbb ", " bb.....b..b..b..b..b.bbb.....b.brrrrrrrrrrrrrrbb ", " bb....b..b..b..bb....bbb....bb.brrrrrrrrrrrrrrbb ", " bb...bb.bbbbbbb.b....bbb....bb.brrrrrrrrrrrrrrbb ", " bb..bbbbb......bb...bbbbb...b..brrrrrrrrrrrrrrbb ", " bb.bbb..........b.bbbbbbbbbbb..brrrrrrrrrrrrrrbb ", " bb..............b.b.bbbbbbbbb..brrrrrrrrrrrrrrbb ", " bbbbbbbbbbbbbbbbb.b.b....bbbb..bbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbb...b.....b.b..b..............bb ", " bbbbbbbbbbbbbbbbb........bb.bb.b...b..b.......bb ", " bbbbbbbbbbbbbbbb........b..b..b..b..b...b...bb ", " bbbbbbbbbbbbbbbb.......b..b...b.b..b...b....bb ", " bbbbbbbbbbbbbbbbb............b.bbbbbbbbbb...bb ", " bbrrrrrrrrrrrrrrb..........bbbb........bb.bb ", " bbrrrrrrrrrrrrrrrb........bbbb............bb ", " bbrrrrrrrrrrrrrrrbbbbbbbb.......b..b....bb ", " bbrrrrrrrrrrrrrrrrrrbb.....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb...bb.bbbbbbbb...bb ", " bbbbbbbbbbbbbbbbbbbb...bbbb......bb.bb ", " bbbbbbbbbbbbbbbbbbb..bbb...........b ", " bbbbbbbbbbbbbbbbbbb.bbb...........bb ", " bbbbbbbbbbbbbbbbbb..............bb ", " bbbbbbbbbbbbbbbbb...b.b.b.....bb ", " bbbbbbbbbbbbbbbb..b.b.b..b..bb ", " bbrrrrrrrrrrrbb..bbbbbbb..bb ", " bbrrrrrrrrrrbb.bbb....b.bb ", " bbrrrrrrrrrbb.bb......bb ", " bbbrrrrrrrbb.......bbb ", " bbbbrrrrrbb.....bbbb ", " bbbbrrrbb...bbbb ", " bbbbrbb.bbbb ", " bbbbbbbb ", " bbbb ", " bb ", " " } ; motif-2.3.8/demos/programs/Ext18List/pixmaps/eye.xpm0000644000175000017500000000462312672140200017261 00000000000000/* XPM */ static char * eye[] = { /* eye pixmap * width height ncolors chars_per_pixel */ "32 32 4 2 ", " c #FFFFFFFFFFFF s s_#FFFFFFFFFFFF ", ". c #000 s s_#000 ", "X c #FFFFB0B0B0B0 s s_#FFFFB0B0B0B0 ", "o c #32329999CCCC s s_#32329999CCCC ", /* pixels */ " ", " ", " . . . . . . . ", " . . . X X X X X X X . . . ", " . . X X X X X X X X X X X X X . . ", " . X X X X X X X X X X X X X X X X X . ", " . X X X X X X X X X X X X X X X X X X X . ", " . X X X X X X X X X X X X X X X X X X X X X . ", " . X X X X X X X X X X X X X X X X . X . X . X X . ", " . X X X X X X X X X X X X X X X . . . . X . ", " . X X X X X X X X X X X X X X X . . o . . X . ", " . X X X X X X . X X X X X X X . . o o o o o . . ", " . X X X X X . X X . X X X X . . o o o o o o . ", " . X X X X . X X . X X X X X X . o o o o o o o . . ", " . X X X . X X . X X X X X X . . o o o o o o o . ", " . X X . X X . X X X X X X X X . o o o o o o o o . . ", " . X X X . X X . X X X X X X . . o o o o o o o . ", " . X X X X . X X . . . X X X X . . o o o o o . . ", " . X X X X . X X X X . X X X X . . o . . . ", " . X X X X X . X X X X . X X X X . . . . X . ", " . X X X X . . X X X . X X X X X . X . X . X . ", " . X X . X X X X . X X X X X X X X X X X . ", " . X X . X X . X X X X X X X X X X X . ", " . . X . . X X X X X X X X X X . . ", " . X X X X X X X X X . . . ", " . X X X X . . . . ", " . X X . X X . ", " . X X . X X . ", " . X X . . . . . . . ", " . X . X X X X X . . X . . ", " . X X X X X X X X X X . X X . ", " . . . . . . . . . . . . . X . . " } ; motif-2.3.8/demos/programs/Ext18List/pixmaps/Makefile.am0000644000175000017500000000025712672140200020004 00000000000000MAINTAINERCLEANFILES = Makefile.in datadir = ${prefix}/share/Xm/Ext18list/pixmaps EXTRA_DIST = clown.xbm crab.xpm eye.xpm porsche.xpm stopsign.xpm data_DATA = $(EXTRA_DIST) motif-2.3.8/demos/programs/IconB/0000755000175000017500000000000013211513007013567 500000000000000motif-2.3.8/demos/programs/IconB/Makefile.in0000644000175000017500000005540113211512766015574 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = iconbuttondemo$(EXEEXT) subdir = demos/programs/IconB ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_iconbuttondemo_OBJECTS = misc.$(OBJEXT) iconbuttondemo.$(OBJEXT) iconbuttondemo_OBJECTS = $(am_iconbuttondemo_OBJECTS) iconbuttondemo_LDADD = $(LDADD) iconbuttondemo_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(iconbuttondemo_SOURCES) DIST_SOURCES = $(iconbuttondemo_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Icon build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Icon datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = small.bm iconbuttondemo_SOURCES = misc.c iconbuttondemo.c data_DATA = $(iconbuttondemo_SOURCES) $(EXTRA_DIST) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. \ -I$(srcdir)/$(TOPDIR)/lib \ ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/IconB/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/IconB/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list iconbuttondemo$(EXEEXT): $(iconbuttondemo_OBJECTS) $(iconbuttondemo_DEPENDENCIES) $(EXTRA_iconbuttondemo_DEPENDENCIES) @rm -f iconbuttondemo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(iconbuttondemo_OBJECTS) $(iconbuttondemo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconbuttondemo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/IconB/misc.c0000644000175000017500000025735313066310437014637 00000000000000/***************************************************************************** * INCLUDE FILES *****************************************************************************/ #include #include #include #include /* * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI. */ #if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__) # include # if defined(HAVE_MALLOC_H) # include # elif defined(HAVE_SYS_MALLOC_H) # include # endif #endif /***************************************************************************** * TYPDEFS AND DEFINES *****************************************************************************/ /* * Undefine this if you want to use native strcasecmp. */ #define LOCAL_STRCASECMP #ifdef _NO_PROTO #ifdef NeedFunctionPrototypes #undef NeedFunctionPrototypes #endif #endif /* * Define SUPPORTS_WCHARS if the system supports wide character sets */ #if !defined(VAX) && !defined(__CENTERLINE__) #define SUPPORTS_WCHARS #endif /* * Handy definition used in SET_BACKGROUND_COLOR */ #define UNSET (-1) /* * Set state of inclusion of prototypes properly */ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif #ifdef NeedFunctionPrototypes #ifdef __cplusplus #define UARG(a, b) a, #define GRAU(a, b) a) #else #define UARG(a, b) a b, #define GRAU(a, b) a b) #endif #else #define UARG(a, b) a b; #define GRAU(a, b) a b; #endif /* * Set up strcasecmp function */ #if defined(LOCAL_STRCASECMP) #define STRCASECMP StrCasecmp #ifndef NeedFunctionPrototypes static int StrCasecmp(); #else static int StrCasecmp(char*, char*); #endif #else #define STRCASECMP strcasecmp #endif /* * Define XTPOINTER so it works with all releases of * Xt and c++. */ #ifdef __cplusplus #if XtSpecificationRelease < 5 #define XTPOINTER char * #else #define XTPOINTER XPointer #endif #else #define XTPOINTER XtPointer #endif /* * The following enum is used to support wide character sets. * Use this enum for references into the Common Wide Characters array. * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last * entry in the enum. This will maintain correct memory usage, etc. */ enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab, WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR, WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne, NUM_COMMON_WCHARS }; /***************************************************************************** * GLOBAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * EXTERNAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * STATIC DECLARATION *****************************************************************************/ #ifndef NeedFunctionPrototypes #ifndef SUPPORTS_WCHARS static int mblen (); #endif static int strlenWc (); static size_t doMbstowcs (); static size_t doWcstombs (); static void copyWcsToMbs (); static int dombtowc (); static Boolean extractSegment (); static XmString StringToXmString (); static char* getNextCStrDelim (); static int getCStrCount (); static wchar_t *CStrCommonWideCharsGet (); #else #ifndef SUPPORTS_WCHARS static int mblen (char*, size_t); #endif static int strlenWc (wchar_t*); static size_t doMbstowcs (wchar_t*, char*, size_t); static size_t doWcstombs (char*, wchar_t*, size_t); static void copyWcsToMbs (char*, wchar_t*, int, Boolean); static int dombtowc (wchar_t*, char*, size_t); static Boolean extractSegment (wchar_t**, wchar_t**, int *, wchar_t**, int*, int*, Boolean*); static XmString StringToXmString (char*); static char* getNextCStrDelim (char*); static int getCStrCount (char*); static wchar_t *CStrCommonWideCharsGet (); #endif /***************************************************************************** * STATIC CODE *****************************************************************************/ #if defined(LOCAL_STRCASECMP) /* * Function: * cmp = StrCasecmp(s1, s2); * Description: * Compare two strings ignoring case * Input: * s1 - char * : string 1 to compare * s2 - char * : string 2 to compare * Output: * int : 0; s1 == s2 * 1; s1 != s2 */ static int StrCasecmp ARGLIST((s1, s2)) ARG(register char *, s1) GRA(register char *, s2) { register int c1, c2; while (*s1 && *s2) { c1 = isupper(*s1) ? tolower(*s1) : *s1; c2 = isupper(*s2) ? tolower(*s2) : *s2; if (c1 != c2) { return(1); } s1++; s2++; } if (*s1 || *s2) { return(1); } return(0); } #endif #ifndef SUPPORTS_WCHARS /* * Function: * len = mblen(s, n); * Description: * The mblen function for platforms that don't have one. This * function simply returns a length of 1 since no wide character * support exists for this platform. * Input: * s - char * : the character string to get the length from * n - size_t : the size of the string * Output: * int : always 1 */ static int mblen ARGLIST((s, n)) ARG(char *, s) GRA(size_t, n) { return(1); } #endif /* * Function: * len = strlenWc(ptr); * Description: * Return the number of characters in a wide character string (not * the characters in the resultant mbs). * Input: * ptr - wchar_t* : pointer to the wcs to count * Output: * int : the number of characters found */ static int strlenWc ARGLIST((ptr)) GRA(wchar_t *,ptr) { register wchar_t *p = ptr; register int x = 0; if (!ptr) return(0); while (*p++) x++; return (x); } /* * Function: * bytesConv = doMbstowcs(wcs, mbs, n); * Description: * Create a wcs string from an input mbs. * Input: * wcs - wchar_t* : pointer to result buffer of wcs * mbs - char* : pointer to the source mbs * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doMbstowcs ARGLIST((wcs, mbs, n)) ARG(wchar_t *,wcs) ARG(char *, mbs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && mbs[i] != 0; ++i) { wcs[i] = mbs[i]; } wcs[i++] = 0; return(i); #else return(mbstowcs(wcs, mbs, n)); #endif } /* * Function: * bytesConv = doWcstombs(wcs, mbs, n); * Description: * Create a mbs string from an input wcs. * Input: * wcs - wchar_t* : pointer to the source wcs * mbs - char* : pointer to result mbs buffer * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doWcstombs ARGLIST((mbs, wcs, n)) ARG(char *, mbs) ARG(wchar_t *, wcs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && wcs[i] != 0; ++i) { mbs[i] = wcs[i]; } mbs[i] = 0; return(i); #else return(wcstombs(mbs, wcs, n)); #endif } /* * Function: * copyWcsToMbs(mbs, wcs, len); * Description: * Create a mbs string from an input wcs. This function allocates * a buffer if necessary. * Input: * mbs - char* : destination for the converted/copied output * wcs - wchar_t* : pointer to wcs to copy/convert * len - int : the number of wchar_t' to convert * process_it - Boolean : True if processing of quoted charcters, * False if blind. * Output: * None */ static void copyWcsToMbs ARGLIST((mbs, wcs, len, process_it)) ARG(char *, mbs) ARG(wchar_t *, wcs) ARG(int, len) GRA(Boolean, process_it) { static wchar_t *tbuf; static int tbufSize = 0; int numCvt; int lenToConvert; wchar_t *fromP = wcs; wchar_t *x = &fromP[len]; wchar_t *toP; wchar_t *commonWChars = CStrCommonWideCharsGet(); wchar_t tmp; /* * Make sure there's room in the buffer */ if (tbufSize < len) { tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t)); tbufSize = len; } /* * Now copy and process */ toP = tbuf; lenToConvert = 0; while (fromP < x) { /* * Check for quoted characters */ if ((*fromP == commonWChars[WBackSlash]) && process_it) { fromP++; /* Skip quote */ if (fromP == x) /* Hanging quote? */ { *toP++ = commonWChars[WBackSlash]; lenToConvert++; break; } tmp = *fromP++; if (tmp == commonWChars[WideN]) { *toP++ = commonWChars[WNewLine]; } else if (tmp == commonWChars[WideT]) { *toP++ = commonWChars[WTab]; } else if (tmp == commonWChars[WideR]) { *toP++ = commonWChars[WCarriageReturn]; } else if (tmp == commonWChars[WideF]) { *toP++ = commonWChars[WFormFeed]; } else if (tmp == commonWChars[WideV]) { *toP++ = commonWChars[WVerticalTab]; } else if (tmp == commonWChars[WBackSlash]) { *toP++ = commonWChars[WBackSlash]; } else { /* * No special translation needed */ *toP++ = tmp; } } else { *toP++ = *fromP++; } lenToConvert++; } numCvt = doWcstombs(mbs, tbuf, lenToConvert); mbs[numCvt] = '\0'; } /* * Function: * status = dombtowc(wide, multi, size); * Description: * Convert a multibyte character to a wide character. * Input: * wide - wchar_t * : where to put the wide character * multi - char * : the multibyte character to convert * size - size_t : the number of characters to convert * Output: * 0 - if multi is a NULL pointer or points to a NULL character * #bytes - number of bytes in the multibyte character * -1 - multi is an invalid multibyte character. * * NOTE: if wide is NULL, then this returns the number of bytes in * the multibyte character. */ static int dombtowc ARGLIST((wide, multi, size)) ARG(wchar_t *, wide) ARG(char *, multi) GRA(size_t, size) { int retVal = 0; #ifndef SUPPORTS_WCHARS if ((multi == NULL) || (*multi == '\000')) { if (wide) wide[0] = '\0'; return (0); } for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++) { if (wide != NULL) { wide[retVal] = multi[retVal]; } } #else retVal = mbtowc(wide, multi, size); #endif return(retVal); } /* * Function: * ptr = getNextSepartor(str); * Description: * Parse through a string looking for the next compound string * field separator * Inputs: * str - wchar_t* : the address of address of the string to parse * Outputs: * ptr - wchar_t* : pointer to character, if found, points to end * of string otherwise ('\0'). */ static wchar_t* getNextSeparator ARGLIST((str)) GRA(wchar_t *, str) { wchar_t *ptr = str; wchar_t *commonWChars = CStrCommonWideCharsGet(); while (*ptr) { /* * Check for separator */ if ((*ptr == commonWChars[WHash]) || (*ptr == commonWChars[WQuote]) || (*ptr == commonWChars[WColon])) { return(ptr); } else if (*ptr == commonWChars[WBackSlash]) { ptr++; if (*ptr) ptr++; /* Skip quoted character */ } else { ptr++; } } return(ptr); } /* * Function: * more = * extractSegment(str, tagStart, tagLen, txtStart, txtLen, * pDir, pSep); * Description: * Parse through a string version of a compound string and extract * the first compound string segment from the string. * Inputs: * str - char** : the address of address of the string to parse * tagStart - char** : address to return pointer to tag start into * tagLen - int* : address where to return the tag length into * txtStart - char** : address to return the text start into * txtLen - int* : address where to return the text length * pDir - int* : address to return the string direction into * pSep - Boolean * : address to return the separtor into * Outputs: * more - Boolean : True if more of the string to parse. * False means done. */ static Boolean extractSegment ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep)) ARG(wchar_t **, str) ARG(wchar_t **, tagStart) ARG(int *, tagLen) ARG(wchar_t **, txtStart) ARG(int *, txtLen) ARG(int *, pDir) GRA(Boolean *, pSep) { wchar_t *start; wchar_t *text; int textL; Boolean tagSeen; wchar_t *tag; int tagL; Boolean modsSeen; Boolean sep; int dir; Boolean done; int *lenUp; Boolean checkDir; wchar_t *commonWChars; wchar_t emptyStrWcs[1]; /* * Initialize variables */ text = NULL; textL = 0; tagSeen = False; tag = NULL; tagL = 0; modsSeen = False; dir = XmSTRING_DIRECTION_L_TO_R; sep = False; done = False; lenUp = NULL; commonWChars = CStrCommonWideCharsGet(); /* * Guard against nulls */ if (!(start = *str)) { start = emptyStrWcs; emptyStrWcs[0] = commonWChars[WNull]; } /* * If the first character of the string isn't a # or a ", then we * just have a regular old simple string. Do the same the thing for * the empty string. */ if ((*start == '\0') || (start != getNextSeparator(start))) { text = start; if (!(textL = strlenWc(start))) { text = NULL; } start += textL; } else { done = False; while (!done) { if (*start == commonWChars[WHash]) { if (tagSeen) { done = True; break; } else { tagSeen = True; tag = ++start; start = getNextSeparator(tag); if ((tagL = start - tag) == 0) { tag = NULL; /* Null tag specified */ } } } else if (*start == commonWChars[WQuote]) { text = ++start; start = getNextSeparator(start); while (!((*start == commonWChars[WQuote]) || (*start == commonWChars[WNull]))) { start = getNextSeparator(++start); } if ((textL = start - text) == 0) { text = NULL; /* Null text specified */ } /* * if a quote, skip over it */ if (*start == commonWChars[WQuote]) { start++; } done = True; } else if (*start == commonWChars[WColon]) { if (modsSeen) { done = True; break; } /* * If the next character is a t or f, the we've got * a separator. */ modsSeen = True; checkDir = False; start++; if ((*start == commonWChars[WideT]) || (*start == commonWChars[WideUT]) || (*start == commonWChars[WideOne])) { sep = True; start++; checkDir = True; } else if ((*start == commonWChars[WideF]) || (*start == commonWChars[WideUF]) || (*start == commonWChars[WideZero])) { sep = False; start++; checkDir = True; } else if ((*start == commonWChars[WideR]) || (*start == commonWChars[WideUR])) { start++; dir = XmSTRING_DIRECTION_R_TO_L; } else if ((*start == commonWChars[WideL]) || (*start == commonWChars[WideUL])) { start++; dir = XmSTRING_DIRECTION_L_TO_R; } /* * Look for direction if necessary. This requires a bit of * look ahead. */ if (checkDir && (*start == commonWChars[WColon])) { if ((*(start + 1) == commonWChars[WideL]) || (*(start + 1) == commonWChars[WideUL])) { dir = XmSTRING_DIRECTION_L_TO_R; start += 2; } else if ((*(start + 1) == commonWChars[WideR]) || (*(start + 1) == commonWChars[WideUR])) { dir = XmSTRING_DIRECTION_R_TO_L; start+=2; } } } else { /* * A bad string format! We'll just skip the character. */ start++; } } } /* * Now fill in return values */ if (*str) *str = start; if (tagStart) *tagStart = tag; if (tagLen) *tagLen = tagL; if (txtStart) *txtStart = text; if (txtLen) *txtLen = textL; if (pDir) *pDir = dir; if (pSep) *pSep = sep; return ((*start == commonWChars[WNull]) ? False : True); } /* * Function: * xstr = StringToXmString(str); * Description: * Parse a string into an XmString. * Inputs: * str - char * : the string to parse * Outputs: * xstr - XmString : the allocated return structure */ static XmString StringToXmString ARGLIST((str)) GRA(char *,str) { static char* tagBuf = NULL; static int tagBufLen = 0; static char* textBuf = NULL; static int textBufLen = 0; wchar_t *ctx; wchar_t *tag; int tagLen; wchar_t *text; int textLen; Boolean sep; int dir; Boolean more; wchar_t *wcStr; int curDir; XmString xmStr; XmString s1; XmString s2; if (!str) return(NULL); /* * For expediencies sake, we'll overallocate this buffer so that * the wcs is guaranteed to fit (1 wc per byte in original string). */ wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t)); doMbstowcs(wcStr, str, strlen(str) + 1); /* * Create the beginning segment */ curDir = XmSTRING_DIRECTION_L_TO_R; xmStr = XmStringDirectionCreate(curDir); /* * Convert the string. */ more = True; ctx = wcStr; while (more) { more = extractSegment(&ctx, &tag, &tagLen, &text, &textLen, &dir, &sep); /* * Pick up a direction change */ if (dir != curDir) { #if defined(VMS) || (defined(__osf__) && defined(__alpha)) /* * This is required on DEC Windows systems because they've * added the REVERT direction. */ s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); #endif curDir = dir; s1 = XmStringDirectionCreate(curDir); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Create the segment. Text and tag first. */ if (textLen) { if (textBufLen <= (textLen * sizeof(wchar_t))) { textBufLen = (textLen + 1) * sizeof(wchar_t); textBuf = (char*)XtRealloc(textBuf, textBufLen); } copyWcsToMbs(textBuf, text, textLen, True); if (tagLen) { if (tagBufLen <= (tagLen * sizeof(wchar_t))) { tagBufLen = (tagLen + 1) * sizeof(wchar_t); tagBuf = (char*)XtRealloc(tagBuf, tagBufLen); } copyWcsToMbs(tagBuf, tag, tagLen, False); } else { if (!tagBuf) { tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1; tagBuf = (char*)XtMalloc(tagBufLen); } strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET); } s1 = XmStringCreate(textBuf, tagBuf); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Add in the separators. */ if (sep) { s1 = XmStringSeparatorCreate(); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } } /* * Free up memory and return */ XtFree((char*)wcStr); return(xmStr); } /* * Function: * nextCStr = getNextCStrDelim(str); * Description: * Find the next unquoted , or \n in the string * Input: * str - char * : the input string * Output: * nextCStr - char* : pointer to the next delimiter. Returns NULL if no * delimiter found. */ static char* getNextCStrDelim ARGLIST((str)) GRA(char *,str) { char *comma = str; Boolean inQuotes = False; int len; if (!str) return(NULL); if (!*str) return(NULL); /* At end */ #ifdef __CENTERLINE__ mblen((char *)NULL, sizeof(wchar_t)); #else mblen(NULL, sizeof(wchar_t)); #endif while (*comma) { if ((len = mblen(comma, sizeof(wchar_t))) > 1) { comma += len; continue; } if (*comma == '\\') { comma++; /* Over quote */ comma += mblen(comma, sizeof(wchar_t)); continue; } /* * See if we have a delimiter */ if (!inQuotes) { if ((*comma == ',') || (*comma == '\012')) { return(comma); } } /* * Deal with quotes */ if (*comma == '\"') { inQuotes = ~inQuotes; } comma++; } return(NULL); /* None found */ } /* * Function: * cnt = getCStrCount(str); * Description: * Get the count of cstrings in a compound string table ascii * format. * Input: * str - char * : string to parse * Output: * cnt - int : the number of XmStrings found */ static int getCStrCount ARGLIST((str)) GRA(char *, str) { int x = 1; char *newStr; if (!str) return(0); if (!*str) return(0); while ((newStr = getNextCStrDelim(str))) { x++; str = ++newStr; } return(x); } /* * Function: * cwc = CStrCommonWideCharsGet(); * Description: * Return the array of common wide characters. * Input: * None. * Output: * cwc - wchar_t * : this array should never be written to or FREEd. */ static wchar_t *CStrCommonWideCharsGet() { static wchar_t *CommonWideChars = NULL; /* * If you add to this array, don't forget to change the enum in * the TYPEDEFS and DEFINES section above to correspond to this * array. */ static char *characters[] = { "\000", "\t", "\n", "\r", "\f", "\v", "\\", "\"", "#", ":", "f", "l", "n", "r", "t", "v", "F", "L", "R", "T", "0", "1" }; if (CommonWideChars == NULL) { int i; /* * Allocate and create the array. */ CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t)); for (i = 0; i < NUM_COMMON_WCHARS; i++) { (void)dombtowc(&(CommonWideChars[i]), characters[i], 1); } } return(CommonWideChars); } /* * Function: * CONVERTER CvtStringToXmString * and * XmStringCvtDestroy * Description: * Convert a string to an XmString. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * ::[#[font-tag]]"string"[#[font-tag]"string"] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmString ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) UARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString resStr; char *str; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg(XtDisplayToApplicationContext(d), "cvtStringToXmString", "wrongParameters", "XtToolkitError", "String to XmString converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * See if this is a simple string */ str = (char*)fromVal->addr; if (strncmp(str, "::", 2)) { resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET); } else { /* * Convert into internal format */ resStr = StringToXmString(fromVal->addr + 2); /* skip :: */ } /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&resStr; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString)) { toVal->size = sizeof(XmString); XtDisplayStringConversionWarning(d, fromVal->addr, "XmString"); XmStringFree(resStr); return(False); } else { *(XmString *)toVal->addr = resStr; toVal->size = sizeof(XmString); } return(True); } static void XmStringCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmStringFree(*(XmString*)(to->addr)); } /* * Function: * CONVERTER CvtStringToXmStringTable * and * XmStringTableCvtDestroy * * Description: * Convert a string to an XmString table. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ... * compound_string_table = [compound_string][,compound_string] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmStringTable ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) ARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString *CStrTable; XmString *tblPtr; char *str; char *tmpBuf; char *nextDelim; XrmValue fVal; XrmValue tVal; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg (XtDisplayToApplicationContext(d), "cvtStringToXmStringTable", "wrongParameters", "XtToolkitError", "String to XmStringTable converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * Set str and make sure there's somethin' there */ if (!(str = (char*)fromVal->addr)) { str = ""; } /* * Allocate the XmStrings + 1 for NULL termination */ CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*)); /* * Use the string converter for the strings */ tmpBuf = (char*)XtMalloc(strlen(str) + 1); strcpy(tmpBuf, str); str = tmpBuf; /* * Create strings */ tblPtr = CStrTable; if (*str) { while (str) { nextDelim = getNextCStrDelim(str); /* * Overwrite nextDelim */ if (nextDelim) { *nextDelim = '\0'; nextDelim++; } /* * Convert it */ fVal.size = strlen(str) + 1; fVal.addr = str; tVal.size = sizeof(XTPOINTER); tVal.addr = (XTPOINTER)tblPtr; /* * Call converter ourselves since this is used to create * the strings in the table we create. We need to do this * since we don't have a widget to send to the XtConvertAndStore * function. Side effects are that we can never get these * compound strings cached and that no destructor function is * called when the strings leave existance, but we nuke 'em * in the XmStringTable destuctor. */ CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL); tblPtr++; str = nextDelim; } } XtFree(tmpBuf); /* * Null terminate */ *tblPtr = NULL; /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&CStrTable; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString*)) { toVal->size = sizeof(XmString*); XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable"); tblPtr = CStrTable; while (*tblPtr) { XmStringFree(*tblPtr); } XtFree((char*)CStrTable); return(False); } else { *(XmString **)toVal->addr = CStrTable; toVal->size = sizeof(XmString*); } return(True); } static void XmStringTableCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmString *tblPtr = *(XmString**)(to->addr); while (*tblPtr) { XmStringFree(*tblPtr); } XtFree((char*)(*(XmString**)(to->addr))); } /***************************************************************************** * GLOBAL CODE *****************************************************************************/ /* * Function: * RegisterBxConverters(appContext); * Description: * This globally available function installs all the converters necessary * to run BuilderXcessory generated interfaces that use compound * strings. This is necessary since Motif has not supplied very smart * converters. * Input: * appContext - XtAppContext : the application context * Output: * None */ void RegisterBxConverters ARGLIST((appContext)) GRA(XtAppContext, appContext) { XtAppSetTypeConverter(appContext, XmRString, XmRXmString, (XtTypeConverter)CvtStringToXmString, NULL, 0, XtCacheNone, XmStringCvtDestroy); XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable, (XtTypeConverter)CvtStringToXmStringTable, NULL, 0, XtCacheNone, XmStringTableCvtDestroy); } /* * Function: * CONVERT(w, from_string, to_type, to_size, success); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * w - Widget : the widget to use for conversion * from_string - char * : the string to convert from * to_type - char * : the type to convert to * to_size - int : the size of the conversion result * success - Boolean* : Set to the result value of the conversion * Output: * None */ #ifndef IGNORE_CONVERT XtPointer CONVERT ARGLIST((w, from_string, to_type, to_size, success)) ARG(Widget, w) ARG(char *, from_string) ARG(char *, to_type) ARG(int, to_size) GRA(Boolean *, success) { XrmValue fromVal, toVal; /* resource holders */ Boolean convResult; /* return value */ XtPointer val; /* Pointer size return value */ to_size = 0; /* * We will assume that the conversion is going to fail and change this * value later if the conversion is a success. */ *success = False; /* * Since we are converting from a string to some type we need to * set the fromVal structure up with the string information that * the caller passed in. */ fromVal.size = strlen(from_string) + 1; fromVal.addr = from_string; /* * Since we are not sure what type and size of data we are going to * get back we will set this up so that the converter will point us * at a block of valid data. */ toVal.size = 0; toVal.addr = NULL; /* * Now lets try to convert this data by calling this handy-dandy Xt * routine. */ convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal); /* * Now we have two conditions here. One the conversion was a success * and two the conversion failed. */ if(!convResult) { /* * If this conversion failed that we can pretty much return right * here because there is nothing else we can do. */ return((XtPointer) NULL); } /* * If we get this far that means we did the conversion and all is * well. Now we have to handle the special cases for type and * size constraints. */ if(!strcmp(to_type, "String")) { /* * Since strings are handled different in Xt we have to deal with * the conversion from a string to a string. When this happens the * toVal.size will hold the strlen of the string so generic * conversion code can't handle it. It is possible for a string to * string conversion to happen so we do have to watch for it. */ val = (XTPOINTER)toVal.addr; } else { /* * Here is the generic conversion return value handler. This * just does some size specific casting so that value that we * return is in the correct bytes of the XtPointer that we * return. Here we check all sizes from 1 to 8 bytes. */ switch(toVal.size) { case 1: val = (XTPOINTER)(unsigned)(*(char*)toVal.addr); break; case 2: val = (XTPOINTER)(unsigned)(*(short*)toVal.addr); break; case 4: val = (XTPOINTER)(unsigned)(*(int*)toVal.addr); break; case 8: default: val = (XTPOINTER)(unsigned)(*(long*)toVal.addr); break; } } /* * Well everything is done and the conversion was a success so lets * set the success flag to True. */ *success = convResult; /* * Finally lets return the converted value. */ /*SUPPRESS 80*/ return(val); } #endif /* * Function: * MENU_POST(p, mw, ev, dispatch); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * p - Widget : the widget to post * mw - XtPointer : the menu widget * ev - XEvent* : the event that caused the menu post * dispatch - Boolean* : not used * Output: * None */ #ifndef IGNORE_MENU_POST void MENU_POST ARGLIST((p, mw, ev, dispatch)) UARG(Widget, p) ARG(XtPointer, mw) ARG(XEvent *, ev) GRAU(Boolean *, dispatch) { Arg args[2]; int argcnt; int button; Widget m = (Widget)mw; XButtonEvent *e = (XButtonEvent *)ev; argcnt = 0; XtSetArg(args[argcnt], XmNwhichButton, &button); argcnt++; XtGetValues(m, args, argcnt); if(e->button != button) return; XmMenuPosition(m, e); XtManageChild(m); } #endif /* * Function: * SET_BACKGROUND_COLOR(w, args, argcnt, bg_color); * Description: * Sets the background color and shadows of a widget. * Input: * w - The widget to set the background color on. * args, argcnt - The argument list so far. * bg_color - The new background color as a pixel. * Output: * none * * NOTES: This assumes that args later in the argument list * override those already in the list. Therfore i f * there are shadow colors later in the list they will win. * * There is no need to use this function when creating a widget * only when doing a set values, shadow colors are automatically * calculated at creation time. */ void SET_BACKGROUND_COLOR ARGLIST((w, args, argcnt, bg_color)) ARG(Widget, w) ARG(ArgList, args) ARG(Cardinal *, argcnt) GRA(Pixel, bg_color) { int i; int topShadowLoc; int bottomShadowLoc; int selectLoc; int fgLoc; Boolean argok = False; #if ((XmVERSION == 1) && (XmREVISION > 0)) /* * Walk through the arglist to see if the user set the top or * bottom shadow colors. */ selectLoc = topShadowLoc = bottomShadowLoc = UNSET; for (i = 0; i < *argcnt; i++) { if ((strcmp(args[i].name, XmNtopShadowColor) == 0) || (strcmp(args[i].name, XmNtopShadowPixmap) == 0)) { topShadowLoc = i; } else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) || (strcmp(args[i].name, XmNbottomShadowPixmap) == 0)) { bottomShadowLoc = i; } else if (strcmp(args[i].name, XmNarmColor) == 0) { selectLoc = i; } else if (strcmp(args[i].name, XmNforeground) == 0) { fgLoc = i; } } /* * If either the top or bottom shadow are not set then we * need to use XmGetColors to get the shadow colors from the backgound * color and add those that are not already in the arglist to the * arglist. * */ if ((bottomShadowLoc == UNSET) || (topShadowLoc == UNSET) || (selectLoc == UNSET) || (fgLoc == UNSET)) { Arg larg[1]; Colormap cmap; Pixel topShadow; Pixel bottomShadow; Pixel select; Pixel fgColor; XtSetArg(larg[0], XmNcolormap, &cmap); XtGetValues(w, larg, 1); XmGetColors(XtScreen(w), cmap, bg_color, &fgColor, &topShadow, &bottomShadow, &select); if (topShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow); (*argcnt)++; } if (bottomShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow); (*argcnt)++; } if (selectLoc == UNSET) { XtSetArg(args[*argcnt], XmNarmColor, select); (*argcnt)++; } if (fgLoc == UNSET) { XtSetArg(args[*argcnt], XmNforeground, fgColor); (*argcnt)++; } } #endif XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++; } /* * Function: * w = BxFindTopShell(start); * Description: * Go up the hierarhcy until we find a shell widget. * Input: * start - Widget : the widget to start with. * Output: * w - Widget : the shell widget. */ #ifndef _BX_FIND_TOP_SHELL #define _BX_FIND_TOP_SHELL Widget BxFindTopShell ARGLIST((start)) GRA(Widget, start) { Widget p; while ((p = XtParent(start))) { start = p; } return(start); } #endif /* _BX_FIND_TOP_SHELL */ /* * Function: * BxWidgetIdsFromNames(ref, cbName, stringList) * Description: * Return an array of widget ids from a list of widget names. * Input: * ref - Widget : reference widget. * cbName - char* : callback name. * stringList - char*: list of widget names. * Output: * WidgetList : array of widget IDs. */ #ifndef _BX_WIDGETIDS_FROM_NAMES #define _BX_WIDGETIDS_FROM_NAMES WidgetList BxWidgetIdsFromNames ARGLIST((ref, cbName, stringList)) ARG(Widget, ref) ARG(char, *cbName) GRA(char, *stringList) { WidgetList wgtIds = NULL; int wgtCount = 0; Widget inst; Widget current; String tmp; String start; String widget; char *ptr; /* * For backward compatibility, remove [ and ] from the list. */ tmp = start = XtNewString(stringList); if((start = strchr(start, '[')) != NULL) start++; else start = tmp; while((start && *start) && isspace(*start)) { start++; } ptr = strrchr(start, ']'); if (ptr) { *ptr = '\0'; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * start now points to the first character after the [. * the list is now either empty, one, or more widget * instance names. */ start = strtok(start, ","); while(start) { while((start && *start) && isspace(*start)) { start++; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * Form a string to use with XtNameToWidget(). */ widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char)); sprintf(widget, "*%s", start); /* * Start at this level and continue up until the widget is found * or until the top of the hierarchy is reached. */ current = ref; while (current != NULL) { inst = XtNameToWidget(current, widget); if (inst != NULL ) { wgtCount++; wgtIds = (WidgetList)XtRealloc((char *)wgtIds, wgtCount * sizeof(Widget)); wgtIds[wgtCount - 1] = inst; break; } current = XtParent(current); } if (current == NULL) { printf("Callback Error (%s):\n\t\ Cannot find widget %s\n", cbName, widget); } XtFree(widget); start = strtok(NULL, ","); } /* * NULL terminate the list. */ wgtIds = (WidgetList)XtRealloc((char *)wgtIds, (wgtCount + 1) * sizeof(Widget)); wgtIds[wgtCount] = NULL; XtFree((char *)tmp); return(wgtIds); } #endif /* _BX_WIDGETIDS_FROM_NAMES */ /**************************************************************************** * * Big chunk of code inserted from Bull * ****************************************************************************/ #ifndef IGNORE_XPM_PIXMAP #ifdef SYSV #include #endif /* * Copyright 1990, 1991 GROUPE BULL * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of GROUPE BULL not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. GROUPE BULL makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * GROUPE BULL disclaims all warranties with regard to this software, * including all implied warranties of merchantability and fitness, * in no event shall GROUPE BULL be liable for any special, * indirect or consequential damages or any damages * whatsoever resulting from loss of use, data or profits, * whether in an action of contract, negligence or other tortious * action, arising out of or in connection with the use * or performance of this software. * */ /* Return ErrorStatus codes: * null if full success * positive if partial success * negative if failure */ #define XpmColorError 1 #define XpmSuccess 0 #define XpmOpenFailed -1 #define XpmFileInvalid -2 #define XpmNoMemory -3 #define XpmColorFailed -4 typedef struct { char *name; /* Symbolic color name */ char *value; /* Color value */ Pixel pixel; /* Color pixel */ } XpmColorSymbol; typedef struct { unsigned long valuemask; /* Specifies which attributes are * defined */ Visual *visual; /* Specifies the visual to use */ Colormap colormap; /* Specifies the colormap to use */ unsigned int depth; /* Specifies the depth */ unsigned int width; /* Returns the width of the created * pixmap */ unsigned int height; /* Returns the height of the created * pixmap */ unsigned int x_hotspot; /* Returns the x hotspot's * coordinate */ unsigned int y_hotspot; /* Returns the y hotspot's * coordinate */ unsigned int cpp; /* Specifies the number of char per * pixel */ Pixel *pixels; /* List of used color pixels */ unsigned int npixels; /* Number of pixels */ XpmColorSymbol *colorsymbols; /* Array of color symbols to * override */ unsigned int numsymbols; /* Number of symbols */ char *rgb_fname; /* RGB text file name */ /* Infos */ unsigned int ncolors; /* Number of colors */ char ***colorTable; /* Color table pointer */ char *hints_cmt; /* Comment of the hints section */ char *colors_cmt; /* Comment of the colors section */ char *pixels_cmt; /* Comment of the pixels section */ unsigned int mask_pixel; /* Transparent pixel's color table * index */ } XpmAttributes; /* Xpm attribute value masks bits */ #define XpmVisual (1L<<0) #define XpmColormap (1L<<1) #define XpmDepth (1L<<2) #define XpmSize (1L<<3) /* width & height */ #define XpmHotspot (1L<<4) /* x_hotspot & y_hotspot */ #define XpmCharsPerPixel (1L<<5) #define XpmColorSymbols (1L<<6) #define XpmRgbFilename (1L<<7) #define XpmInfos (1L<<8) /* all infos members */ #define XpmReturnPixels (1L<<9) #define XpmReturnInfos XpmInfos /* * minimal portability layer between ansi and KR C */ /* forward declaration of functions with prototypes */ #ifdef NeedFunctionPrototypes #define FUNC(f, t, p) extern t f p #define LFUNC(f, t, p) static t f p #else #define FUNC(f, t, p) extern t f() #define LFUNC(f, t, p) static t f() #endif /* * functions declarations */ #ifdef __cplusplus extern "C" { #endif LFUNC(XpmCreatePixmapFromData, int, (Display * display, Drawable d, char **data, Pixmap * pixmap_return, Pixmap * shapemask_return, XpmAttributes * attributes)); LFUNC(XpmCreateImageFromData, int, (Display * display, char **data, XImage ** image_return, XImage ** shapemask_return, XpmAttributes * attributes)); LFUNC(XpmFreeAttributes, void, (XpmAttributes * attributes)); #ifdef __cplusplus } /* for C++ V2.0 */ #endif #ifdef SYSV #define bcopy(source, dest, count) memcpy(dest, source, count) #endif typedef struct { unsigned int type; union { FILE *file; char **data; } stream; char *cptr; unsigned int line; int CommentLength; char Comment[BUFSIZ]; char *Bcmt, *Ecmt, Bos, Eos; unsigned int InsideString; /* used during parsing: 0 or 1 * whether we are inside or not */ } xpmData; #define XPMARRAY 0 #define XPMFILE 1 #define XPMPIPE 2 typedef unsigned char byte; extern char *xpmColorKeys[]; #define TRANSPARENT_COLOR "None" /* this must be a string! */ /* number of xpmColorKeys */ #define NKEYS 5 /* * key numbers for visual type, they must fit along with the number key of * each corresponding element in xpmColorKeys[] defined in xpm.h */ #define MONO 2 #define GRAY4 3 #define GRAY 4 #define COLOR 5 /* structure containing data related to an Xpm pixmap */ typedef struct { char *name; unsigned int width; unsigned int height; unsigned int cpp; unsigned int ncolors; char ***colorTable; unsigned int *pixelindex; XColor *xcolors; char **colorStrings; unsigned int mask_pixel; /* mask pixel's colorTable index */ } xpmInternAttrib; #define UNDEF_PIXEL 0x80000000 char *xpmColorKeys[] = { "s", /* key #1: symbol */ "m", /* key #2: mono visual */ "g4", /* key #3: 4 grays visual */ "g", /* key #4: gray visual */ "c", /* key #5: color visual */ }; /* XPM private routines */ LFUNC(xpmCreateImage, int, (Display * display, xpmInternAttrib * attrib, XImage ** image_return, XImage ** shapeimage_return, XpmAttributes * attributes)); LFUNC(xpmParseData, int, (xpmData * data, xpmInternAttrib * attrib_return, XpmAttributes * attributes)); LFUNC(xpmVisualType, int, (Visual * visual)); LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors)); LFUNC(xpmInitInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmFreeInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmSetAttributes, void, (xpmInternAttrib * attrib, XpmAttributes * attributes)); /* I/O utility */ LFUNC(xpmNextString, void, (xpmData * mdata)); LFUNC(xpmNextUI, int, (xpmData * mdata, unsigned int *ui_return)); LFUNC(xpmGetC, int, (xpmData * mdata)); LFUNC(xpmUngetC, int, (int c, xpmData * mdata)); LFUNC(xpmNextWord, unsigned int, (xpmData * mdata, char *buf)); LFUNC(xpmGetCmt, void, (xpmData * mdata, char **cmt)); LFUNC(xpmOpenArray, int, (char **data, xpmData * mdata)); LFUNC(XpmDataClose, void, (xpmData * mdata)); /* RGB utility */ LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); /* Image utility */ LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname, unsigned int color_index, Pixel * image_pixel, Pixel * mask_pixel, unsigned int *mask_pixel_index)); LFUNC(CreateXImage, int, (Display * display, Visual * visual, unsigned int depth, unsigned int width, unsigned int height, XImage ** image_return)); LFUNC(SetImagePixels, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); /* * Macros * * The XYNORMALIZE macro determines whether XY format data requires * normalization and calls a routine to do so if needed. The logic in * this module is designed for LSBFirst byte and bit order, so * normalization is done as required to present the data in this order. * * The ZNORMALIZE macro performs byte and nibble order normalization if * required for Z format data. * * The XYINDEX macro computes the index to the starting byte (char) boundary * for a bitmap_unit containing a pixel with coordinates x and y for image * data in XY format. * * The ZINDEX* macros compute the index to the starting byte (char) boundary * for a pixel with coordinates x and y for image data in ZPixmap format. * */ #define XYNORMALIZE(bp, img) \ if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \ xpm_xynormalizeimagebits((unsigned char *)(bp), img) #define ZNORMALIZE(bp, img) \ if (img->byte_order == MSBFirst) \ xpm_znormalizeimagebits((unsigned char *)(bp), img) #define XYINDEX(x, y, img) \ ((y) * img->bytes_per_line) + \ (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3) #define ZINDEX(x, y, img) ((y) * img->bytes_per_line) + \ (((x) * img->bits_per_pixel) >> 3) #define ZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2) #define ZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1) #define ZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x) #define ZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3) #if __STDC__ #define Const const #else #define Const #endif Pixmap XPM_PIXMAP (Widget w,char ** pixmapName) { XpmAttributes attributes; int argcnt; Arg args[10]; Pixmap pixmap; Pixmap shape; int returnValue; argcnt = 0; XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++; XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++; XtGetValues(w, args, argcnt); attributes.visual = DefaultVisual(XtDisplay(w), DefaultScreen(XtDisplay(w))); attributes.valuemask = (XpmDepth | XpmColormap | XpmVisual); returnValue = XpmCreatePixmapFromData(XtDisplay(w), DefaultRootWindow(XtDisplay(w)), pixmapName, &pixmap, &shape, &attributes); if ( shape ) { XFreePixmap(XtDisplay(w), shape); } switch(returnValue) { case XpmOpenFailed: case XpmFileInvalid: case XpmNoMemory: case XpmColorFailed: XtWarning("Could not create pixmap."); return(XmUNSPECIFIED_PIXMAP); default: return(pixmap); } } static unsigned int atoui ARGLIST((p, l, ui_return)) ARG(register char *, p) ARG(unsigned int, l) GRA(unsigned int *, ui_return) { register int n, i; n = 0; for (i = 0; i < l; i++) if (*p >= '0' && *p <= '9') n = n * 10 + *p++ - '0'; else break; if (i != 0 && i == l) { *ui_return = n; return 1; } else return 0; } static int XpmCreatePixmapFromData ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes)) ARG(Display *, display) ARG(Drawable, d) ARG(char **, data) ARG(Pixmap *, pixmap_return) ARG(Pixmap *, shapemask_return) GRA(XpmAttributes *,attributes) { XImage *image, **imageptr = NULL; XImage *shapeimage, **shapeimageptr = NULL; int ErrorStatus; XGCValues gcv; GC gc; /* * initialize return values */ if (pixmap_return) { *pixmap_return = (Pixmap)NULL; imageptr = ℑ } if (shapemask_return) { *shapemask_return = (Pixmap)NULL; shapeimageptr = &shapeimage; } /* * create the images */ ErrorStatus = XpmCreateImageFromData(display, data, imageptr, shapeimageptr, attributes); if (ErrorStatus < 0) return (ErrorStatus); /* * create the pixmaps */ if (imageptr && image) { *pixmap_return = XCreatePixmap(display, d, image->width, image->height, image->depth); gcv.function = GXcopy; gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv); XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0, image->width, image->height); XDestroyImage(image); XFreeGC(display, gc); } if (shapeimageptr && shapeimage) { *shapemask_return = XCreatePixmap(display, d, shapeimage->width, shapeimage->height, shapeimage->depth); gcv.function = GXcopy; gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv); XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0, shapeimage->width, shapeimage->height); XDestroyImage(shapeimage); XFreeGC(display, gc); } return (ErrorStatus); } static int XpmCreateImageFromData ARGLIST((display, data, image_return, shapeimage_return, attributes)) ARG(Display *,display) ARG(char **, data) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { xpmData mdata; int ErrorStatus; xpmInternAttrib attrib; /* * initialize return values */ if (image_return) *image_return = NULL; if (shapeimage_return) *shapeimage_return = NULL; if ((ErrorStatus = xpmOpenArray(data, &mdata)) != XpmSuccess) return (ErrorStatus); xpmInitInternAttrib(&attrib); ErrorStatus = xpmParseData(&mdata, &attrib, attributes); if (ErrorStatus == XpmSuccess) ErrorStatus = xpmCreateImage(display, &attrib, image_return, shapeimage_return, attributes); if (ErrorStatus >= 0) xpmSetAttributes(&attrib, attributes); else if (attributes) XpmFreeAttributes(attributes); xpmFreeInternAttrib(&attrib); XpmDataClose(&mdata); return (ErrorStatus); } /* * open the given array to be read or written as an xpmData which is returned */ static int xpmOpenArray ARGLIST((data, mdata)) ARG(char **,data) GRA(xpmData *,mdata) { mdata->type = XPMARRAY; mdata->stream.data = data; mdata->cptr = *data; mdata->line = 0; mdata->CommentLength = 0; mdata->Bcmt = mdata->Ecmt = NULL; mdata->Bos = mdata->Eos = '\0'; mdata->InsideString = 0; return (XpmSuccess); } /* * Intialize the xpmInternAttrib pointers to Null to know * which ones must be freed later on. */ static void xpmInitInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *,attrib) { attrib->ncolors = 0; attrib->colorTable = NULL; attrib->pixelindex = NULL; attrib->xcolors = NULL; attrib->colorStrings = NULL; attrib->mask_pixel = UNDEF_PIXEL; } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \ if (chars) free(chars); \ if (pixelindex) free((char *)pixelindex); \ if (hints_cmt) free((char *)hints_cmt); \ if (colors_cmt) free((char *)colors_cmt); \ if (pixels_cmt) free((char *)pixels_cmt); \ return(status); } /* * This function parses an Xpm file or data and store the found informations * in an an xpmInternAttrib structure which is returned. */ static int xpmParseData ARGLIST((data, attrib_return, attributes)) ARG(xpmData *,data) ARG(xpmInternAttrib *, attrib_return) GRA(XpmAttributes *, attributes) { /* variables to return */ unsigned int width, height; unsigned int ncolors = 0; unsigned int cpp; unsigned int x_hotspot, y_hotspot, hotspot = 0; char ***colorTable = NULL; unsigned int *pixelindex = NULL; char *hints_cmt = NULL; char *colors_cmt = NULL; char *pixels_cmt = NULL; /* calculation variables */ unsigned int rncolors = 0; /* read number of colors, it is * different to ncolors to avoid * problem when freeing the * colorTable in case an error * occurs while reading the hints * line */ unsigned int key = 0; /* color key */ char *chars = NULL, buf[BUFSIZ]; unsigned int *iptr; unsigned int a, b, x, y, l; unsigned int curkey; /* current color key */ unsigned int lastwaskey; /* key read */ char curbuf[BUFSIZ]; /* current buffer */ /* * read hints: width, height, ncolors, chars_per_pixel */ if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height) && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp))) RETURN(XpmFileInvalid); ncolors = rncolors; /* * read hotspot coordinates if any */ hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot); /* * store the hints comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &hints_cmt); /* * read colors */ colorTable = (char ***) calloc(ncolors, sizeof(char **)); if (!colorTable) RETURN(XpmNoMemory); for (a = 0; a < ncolors; a++) { xpmNextString(data); /* skip the line */ colorTable[a] = (char **) calloc((NKEYS + 1), sizeof(char *)); if (!colorTable[a]) RETURN(XpmNoMemory); /* * read pixel value */ colorTable[a][0] = (char *) malloc(cpp); if (!colorTable[a][0]) RETURN(XpmNoMemory); for (b = 0; b < cpp; b++) colorTable[a][0][b] = xpmGetC(data); /* * read color keys and values */ curkey = 0; lastwaskey = 0; while ((l = xpmNextWord(data, buf))) { if (!lastwaskey) { for (key = 1; key < NKEYS + 1; key++) if ((strlen(xpmColorKeys[key - 1]) == l) && (!strncmp(xpmColorKeys[key - 1], buf, l))) break; } if (!lastwaskey && key <= NKEYS) { /* open new key */ if (curkey) { /* flush string */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } curkey = key; /* set new key */ curbuf[0] = '\0'; /* reset curbuf */ lastwaskey = 1; } else { if (!curkey) RETURN(XpmFileInvalid); /* key without value */ if (!lastwaskey) strcat(curbuf, " ");/* append space */ buf[l] = '\0'; strcat(curbuf, buf); /* append buf */ lastwaskey = 0; } } if (!curkey) RETURN(XpmFileInvalid); /* key without value */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } /* * store the colors comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &colors_cmt); /* * read pixels and index them on color number */ pixelindex = (unsigned int *) malloc(sizeof(unsigned int) * width * height); if (!pixelindex) RETURN(XpmNoMemory); iptr = pixelindex; chars = (char *) malloc(cpp); if (!chars) RETURN(XpmNoMemory); for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { for (a = 0; a < cpp; a++) chars[a] = xpmGetC(data); for (a = 0; a < ncolors; a++) if (!strncmp(colorTable[a][0], chars, cpp)) break; if (a == ncolors) RETURN(XpmFileInvalid); /* no color matches */ *iptr = a; } } /* * store the pixels comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &pixels_cmt); free(chars); /* * store found informations in the xpmInternAttrib structure */ attrib_return->width = width; attrib_return->height = height; attrib_return->cpp = cpp; attrib_return->ncolors = ncolors; attrib_return->colorTable = colorTable; attrib_return->pixelindex = pixelindex; if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->hints_cmt = hints_cmt; attributes->colors_cmt = colors_cmt; attributes->pixels_cmt = pixels_cmt; } if (hotspot) { attributes->x_hotspot = x_hotspot; attributes->y_hotspot = y_hotspot; attributes->valuemask |= XpmHotspot; } } return (XpmSuccess); } /* * set the color pixel related to the given colorname, * return 0 if success, 1 otherwise. */ static int SetColor ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index)) ARG(Display *, display) ARG(Colormap, colormap) ARG(char *, colorname) ARG(unsigned int, color_index) ARG(Pixel *, image_pixel) ARG(Pixel *, mask_pixel) GRA(unsigned int *, mask_pixel_index) { XColor xcolor; if (STRCASECMP(colorname, TRANSPARENT_COLOR)) { if (!XParseColor(display, colormap, colorname, &xcolor) || (!XAllocColor(display, colormap, &xcolor))) return (1); *image_pixel = xcolor.pixel; *mask_pixel = 1; } else { *image_pixel = 0; *mask_pixel = 0; *mask_pixel_index = color_index;/* store the color table index */ } return (0); } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (image) XDestroyImage(image); \ if (shapeimage) XDestroyImage(shapeimage); \ if (image_pixels) free((char *)image_pixels); \ if (mask_pixels) free((char *)mask_pixels); \ return(status); } static int xpmCreateImage ARGLIST((display, attrib, image_return, shapeimage_return, attributes)) ARG(Display *, display) ARG(xpmInternAttrib *, attrib) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { /* variables stored in the XpmAttributes structure */ Visual *visual; Colormap colormap; unsigned int depth; XpmColorSymbol *colorsymbols = NULL; unsigned int numsymbols; /* variables to return */ XImage *image = NULL; XImage *shapeimage = NULL; unsigned int mask_pixel; unsigned int ErrorStatus, ErrorStatus2; /* calculation variables */ Pixel *image_pixels = NULL; Pixel *mask_pixels = NULL; char *colorname; unsigned int a, b, l; Boolean pixel_defined; unsigned int key; /* * retrieve information from the XpmAttributes */ if (attributes && attributes->valuemask & XpmColorSymbols) { colorsymbols = attributes->colorsymbols; numsymbols = attributes->numsymbols; } else numsymbols = 0; if (attributes && attributes->valuemask & XpmVisual) visual = attributes->visual; else visual = DefaultVisual(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmColormap) colormap = attributes->colormap; else colormap = DefaultColormap(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmDepth) depth = attributes->depth; else depth = DefaultDepth(display, DefaultScreen(display)); ErrorStatus = XpmSuccess; /* * alloc pixels index tables */ key = xpmVisualType(visual); image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!image_pixels) RETURN(XpmNoMemory); mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!mask_pixels) RETURN(XpmNoMemory); mask_pixel = UNDEF_PIXEL; /* * get pixel colors, store them in index tables */ for (a = 0; a < attrib->ncolors; a++) { colorname = NULL; pixel_defined = False; /* * look for a defined symbol */ if (numsymbols && attrib->colorTable[a][1]) { for (l = 0; l < numsymbols; l++) if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1])) break; if (l != numsymbols) { if (colorsymbols[l].value) colorname = colorsymbols[l].value; else pixel_defined = True; } } if (!pixel_defined) { /* pixel not given as symbol value */ if (colorname) { /* colorname given as symbol value */ if (!SetColor(display, colormap, colorname, a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) pixel_defined = True; else ErrorStatus = XpmColorError; } b = key; while (!pixel_defined && b > 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b--; } b = key + 1; while (!pixel_defined && b < NKEYS + 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b++; } if (!pixel_defined) RETURN(XpmColorFailed); } else { image_pixels[a] = colorsymbols[l].pixel; mask_pixels[a] = 1; } } /* * create the image */ if (image_return) { ErrorStatus2 = CreateXImage(display, visual, depth, attrib->width, attrib->height, &image); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); /* * set the image data * * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use * optimized functions, otherwise use slower but sure general one. * */ if (image->depth == 1) SetImagePixels1(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 8) SetImagePixels8(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 16) SetImagePixels16(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 32) SetImagePixels32(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else SetImagePixels(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); } /* * create the shape mask image */ if (mask_pixel != UNDEF_PIXEL && shapeimage_return) { ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width, attrib->height, &shapeimage); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); SetImagePixels1(shapeimage, attrib->width, attrib->height, attrib->pixelindex, mask_pixels); } free((char *)mask_pixels); /* * if requested store allocated pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnInfos || attributes->valuemask & XpmReturnPixels)) { if (mask_pixel != UNDEF_PIXEL) { Pixel *pixels, *p1, *p2; attributes->npixels = attrib->ncolors - 1; pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels); if (pixels) { p1 = image_pixels; p2 = pixels; for (a = 0; a < attrib->ncolors; a++, p1++) if (a != mask_pixel) *p2++ = *p1; attributes->pixels = pixels; } else { /* if error just say we can't return requested data */ attributes->valuemask &= ~XpmReturnPixels; attributes->valuemask &= ~XpmReturnInfos; attributes->pixels = NULL; attributes->npixels = 0; } free((char *)image_pixels); } else { attributes->pixels = image_pixels; attributes->npixels = attrib->ncolors; } attributes->mask_pixel = mask_pixel; } else free((char *)image_pixels); /* * return created images */ if (image_return) *image_return = image; if (shapeimage_return) *shapeimage_return = shapeimage; return (ErrorStatus); } /* * Create an XImage */ static int CreateXImage ARGLIST((display, visual, depth, width, height, image_return)) ARG(Display *, display) ARG(Visual *, visual) ARG(unsigned int, depth) ARG(unsigned int, width) ARG(unsigned int, height) GRA(XImage **, image_return) { int bitmap_pad; /* first get bitmap_pad */ if (depth > 16) bitmap_pad = 32; else if (depth > 8) bitmap_pad = 16; else bitmap_pad = 8; /* then create the XImage with data = NULL and bytes_per_line = 0 */ *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0, width, height, bitmap_pad, 0); if (!*image_return) return (XpmNoMemory); /* now that bytes_per_line must have been set properly alloc data */ (*image_return)->data = (char *) malloc((*image_return)->bytes_per_line * height); if (!(*image_return)->data) { XDestroyImage(*image_return); *image_return = NULL; return (XpmNoMemory); } return (XpmSuccess); } /* * The functions below are written from X11R5 MIT's code (XImUtil.c) * * The idea is to have faster functions than the standard XPutPixel function * to build the image data. Indeed we can speed up things by supressing tests * performed for each pixel. We do exactly the same tests but at the image * level. Assuming that we use only ZPixmap images. */ LFUNC(_putbits, void, (register char *src, int dstoffset, register int numbits, register char *dst)); LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb)); static unsigned char Const _reverse_byte[0x100] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static void _XReverse_Bytes ARGLIST((bpt, nb)) ARG(register unsigned char *, bpt) GRA(register int, nb) { do { *bpt = _reverse_byte[*bpt]; bpt++; } while (--nb > 0); } static void xpm_xynormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; if (img->byte_order != img->bitmap_bit_order) { switch (img->bitmap_unit) { case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } if (img->bitmap_bit_order == MSBFirst) _XReverse_Bytes(bp, img->bitmap_unit >> 3); } static void xpm_znormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; switch (img->bits_per_pixel) { case 4: *bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF); break; case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 24: c = *(bp + 2); *(bp + 2) = *bp; *bp = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } static unsigned char Const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; static unsigned char Const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static void _putbits ARGLIST((src, dstoffset, numbits, dst)) ARG(register char *, src) /* address of source bit string */ ARG(int, dstoffset) /* bit offset into destination; * range is 0-31 */ ARG(register int, numbits) /* number of bits to copy to * destination */ GRA(register char *, dst) /* address of destination bit string */ { register unsigned char chlo, chhi; int hibits; dst = dst + (dstoffset >> 3); dstoffset = dstoffset & 7; hibits = 8 - dstoffset; chlo = *dst & _lomask[dstoffset]; for (;;) { chhi = (*src << dstoffset) & _himask[dstoffset]; if (numbits <= hibits) { chhi = chhi & _lomask[dstoffset + numbits]; *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi; break; } *dst = chhi | chlo; dst++; numbits = numbits - hibits; chlo = (unsigned char) (*src & _himask[hibits]) >> hibits; src++; if (numbits <= dstoffset) { chlo = chlo & _lomask[numbits]; *dst = (*dst & _himask[numbits]) | chlo; break; } numbits = numbits - dstoffset; } } /* * Default method to write pixels into a Z image data structure. * The algorithm used is: * * copy the destination bitmap_unit or Zpixel to temp * normalize temp if needed * copy the pixel bits into the temp * renormalize temp if needed * copy the temp back into the destination image data */ static void SetImagePixels ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { Pixel pixel; unsigned long px; register char *src; register char *dst; int nbytes; register unsigned int *iptr; register int x, y, i; iptr = pixelindex; if (image->depth == 1) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[XYINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = image->bitmap_unit >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; XYNORMALIZE(&px, image); i = ((x + image->xoffset) % image->bitmap_unit); _putbits((char *) &pixel, i, 1, (char *) &px); XYNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[XYINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } else { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; if (image->depth == 4) pixel &= 0xf; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[ZINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = (image->bits_per_pixel + 7) >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; ZNORMALIZE(&px, image); _putbits((char *) &pixel, (x * image->bits_per_pixel) & 7, image->bits_per_pixel, (char *) &px); ZNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[ZINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } } /* * write pixels into a 32-bits Z image data structure */ #ifndef WORD64 static unsigned long byteorderpixel = MSBFirst << 24; #endif static void SetImagePixels32 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *paddr; register unsigned int *iptr; register int x, y; iptr = pixelindex; #ifndef WORD64 if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { paddr = (unsigned int *)(&(image->data[ZINDEX32(x, y, image)])); *paddr = (unsigned int)pixels[*iptr]; } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 24); addr[1] = (unsigned char)(pixels[*iptr] >> 16); addr[2] = (unsigned char)(pixels[*iptr] >> 8); addr[3] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[3] = (unsigned char)(pixels[*iptr] >> 24); addr[2] = (unsigned char)(pixels[*iptr] >> 16); addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 16-bits Z image data structure */ static void SetImagePixels16 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *iptr; register int x, y; iptr = pixelindex; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 8); addr[1] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 8-bits Z image data structure */ static void SetImagePixels8 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned int *iptr; register int x, y; iptr = pixelindex; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) image->data[ZINDEX8(x, y, image)] = (char)pixels[*iptr]; } /* * write pixels into a 1-bit depth image data structure and **offset null** */ static void SetImagePixels1 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { unsigned char bit; int xoff, yoff; register unsigned int *iptr; register int x, y; if (image->byte_order != image->bitmap_bit_order) SetImagePixels(image, width, height, pixelindex, pixels); else { iptr = pixelindex; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 0x80 >> xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 1 << xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } } } /* * Store into the XpmAttributes structure the required informations stored in * the xpmInternAttrib structure. */ static void xpmSetAttributes ARGLIST((attrib, attributes)) ARG(xpmInternAttrib *, attrib) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->cpp = attrib->cpp; attributes->ncolors = attrib->ncolors; attributes->colorTable = attrib->colorTable; attrib->ncolors = 0; attrib->colorTable = NULL; } attributes->width = attrib->width; attributes->height = attrib->height; attributes->valuemask |= XpmSize; } } /* * Free the XpmAttributes structure members * but the structure itself */ static void XpmFreeAttributes ARGLIST((attributes)) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnPixels && attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } if (attributes->valuemask & XpmInfos) { if (attributes->colorTable) { xpmFreeColorTable(attributes->colorTable, attributes->ncolors); attributes->colorTable = NULL; attributes->ncolors = 0; } if (attributes->hints_cmt) { free(attributes->hints_cmt); attributes->hints_cmt = NULL; } if (attributes->colors_cmt) { free(attributes->colors_cmt); attributes->colors_cmt = NULL; } if (attributes->pixels_cmt) { free(attributes->pixels_cmt); attributes->pixels_cmt = NULL; } if (attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; } } attributes->valuemask = 0; } } /* * Free the xpmInternAttrib pointers which have been allocated */ static void xpmFreeInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *, attrib) { unsigned int a; if (attrib->colorTable) xpmFreeColorTable(attrib->colorTable, attrib->ncolors); if (attrib->pixelindex) free((char *)attrib->pixelindex); if (attrib->xcolors) free((char *)attrib->xcolors); if (attrib->colorStrings) { for (a = 0; a < attrib->ncolors; a++) if (attrib->colorStrings[a]) free((char *)attrib->colorStrings[a]); free((char *)attrib->colorStrings); } } /* * close the file related to the xpmData if any */ static void XpmDataClose ARGLIST((mdata)) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: break; case XPMFILE: if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin)) fclose(mdata->stream.file); break; #ifdef ZPIPE case XPMPIPE: pclose(mdata->stream.file); #endif } } /* * skip whitespace and compute the following unsigned int, * returns 1 if one is found and 0 if not */ static int xpmNextUI ARGLIST((mdata, ui_return)) ARG(xpmData *, mdata) GRA(unsigned int *, ui_return) { char buf[BUFSIZ]; int l; l = xpmNextWord(mdata, buf); return atoui(buf, l, ui_return); } /* * get the current comment line */ static void xpmGetCmt ARGLIST((mdata, cmt)) ARG(xpmData *, mdata) GRA(char **, cmt) { switch (mdata->type) { case XPMARRAY: *cmt = NULL; break; case XPMFILE: case XPMPIPE: if (mdata->CommentLength) { *cmt = (char *) malloc(mdata->CommentLength + 1); strncpy(*cmt, mdata->Comment, mdata->CommentLength); (*cmt)[mdata->CommentLength] = '\0'; mdata->CommentLength = 0; } else *cmt = NULL; break; } } /* * skip to the end of the current string and the beginning of the next one */ static void xpmNextString ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; switch (mdata->type) { case XPMARRAY: mdata->cptr = (mdata->stream.data)[++mdata->line]; break; case XPMFILE: case XPMPIPE: if (mdata->Eos) while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF); if (mdata->Bos) /* if not natural XPM2 */ while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF); break; } } /* * return the current character, skipping comments */ static int xpmGetC ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; register unsigned int n = 0, a; unsigned int notend; switch (mdata->type) { case XPMARRAY: return (*mdata->cptr++); case XPMFILE: case XPMPIPE: c = getc(mdata->stream.file); if (mdata->Bos && mdata->Eos && (c == mdata->Bos || c == mdata->Eos)) { /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (c); } if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) { mdata->Comment[0] = c; /* * skip the string begining comment */ do { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0' && c != EOF); if (mdata->Bcmt[n] != '\0') { /* this wasn't the begining of a comment */ /* put characters back in the order that we got them */ for (a = n; a > 0; a--) xpmUngetC(mdata->Comment[a], mdata); return (mdata->Comment[0]); } /* * store comment */ mdata->Comment[0] = mdata->Comment[n]; notend = 1; n = 0; while (notend) { while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } mdata->CommentLength = n; a = 0; do { c = getc(mdata->stream.file); n++; a++; mdata->Comment[n] = c; } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0' && c != EOF); if (mdata->Ecmt[a] == '\0') { /* this is the end of the comment */ notend = 0; xpmUngetC(mdata->Comment[n], mdata); } } c = xpmGetC(mdata); } return (c); } return 0; } /* * push the given character back */ static int xpmUngetC ARGLIST((c, mdata)) ARG(int, c) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: return (*--mdata->cptr = c); case XPMFILE: case XPMPIPE: if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos)) /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (ungetc(c, mdata->stream.file)); } return 0; } /* * skip whitespace and return the following word */ static unsigned int xpmNextWord ARGLIST((mdata, buf)) ARG(xpmData *, mdata) GRA(char *, buf) { register unsigned int n = 0; int c; switch (mdata->type) { case XPMARRAY: while (isspace(c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; do { c = *mdata->cptr++; buf[n++] = c; } while (!isspace(c) && c != mdata->Eos && c != '\0'); n--; mdata->cptr--; break; case XPMFILE: case XPMPIPE: while (isspace(c = xpmGetC(mdata)) && c != mdata->Eos); while (!isspace(c) && c != mdata->Eos && c != EOF) { buf[n++] = c; c = xpmGetC(mdata); } xpmUngetC(c, mdata); break; } return (n); } static int xpmVisualType ARGLIST((visual)) GRA(Visual *, visual) { #if defined(__cplusplus) || defined(c_plusplus) switch ( visual->c_class ) #else switch ( visual->class ) #endif { case StaticGray: case GrayScale: switch (visual->map_entries) { case 2: return (MONO); case 4: return (GRAY4); default: return (GRAY); } default: return (COLOR); } } /* * Free the computed color table */ static void xpmFreeColorTable ARGLIST((colorTable, ncolors)) ARG(char ***, colorTable) GRA(int, ncolors) { int a, b; if (colorTable) { for (a = 0; a < ncolors; a++) if (colorTable[a]) { for (b = 0; b < (NKEYS + 1); b++) if (colorTable[a][b]) free(colorTable[a][b]); free((char *)colorTable[a]); } free((char *)colorTable); } } #endif motif-2.3.8/demos/programs/IconB/small.bm0000644000175000017500000000043712672140200015144 00000000000000#define small_width 16 #define small_height 16 static unsigned char small_bits[] = { 0xc0, 0x01, 0x30, 0x06, 0x0c, 0x18, 0x1c, 0x10, 0x3a, 0x20, 0x72, 0x20, 0x61, 0x40, 0xc1, 0x40, 0xc1, 0x41, 0x82, 0x21, 0x02, 0x23, 0x04, 0x17, 0x0c, 0x1e, 0x30, 0x06, 0xc0, 0x01, 0x00, 0x00}; motif-2.3.8/demos/programs/IconB/iconbuttondemo.c0000644000175000017500000004022613066310437016722 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "small.bm" #include #include #include #include void Exit(Widget , XtPointer , XtPointer ); void Explain(Widget , XtPointer client, XtPointer ); void ShowThisButton(Widget, XtPointer, XtPointer); void CreateLabel(Widget , XtPointer , XtPointer ); /************************************************************** External functions **************************************************************/ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif extern Pixmap XPM_PIXMAP ARGLIST((w, pixmapName)) ARG(Widget, w) GRA(char **, pixmapName); /* * * The following define is essentially to assist in the * creation of properly formatted information dialogs. * * This is really a convenience thing which bears little * relevance to the actual working of the program. * */ #define OUTPUT_CODE "This is an %s inside an Icon Box.\n\ \n\ It was created using the following resource settings:\n\ \n\ iconPlacement = %s\n\ cellX = %d\n\ cellY = %d\n\ name = %s" /* * * These are fallbacks that are designed to ensure the * program works properly in case the resource file is * not picked up. * */ static String fallbacks[] = { /* * General fallback resources. */ "*bform.width: 1100", "*bform.height: 600", "*background: grey", "*iconBox*background: white", "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*infolabel*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*infolabel.marginWidth: 10", "*infolabel.marginHeight: 10", "*placeLabel.labelString: XmNiconPlacement", "*xLabel.labelString: XmNcellX", "*yLabel.labelString: XmNcellY", "*quitPB.labelString: Quit", "*pushButton.labelString: Explain", "*pushButton1.labelString: Explain", "*pushButton2.labelString: Explain", "*resform*XmPushButton.labelString: Explain...", NULL, }; void Exit(Widget w, XtPointer client, XtPointer call) { exit(0); } /* * * The following function goes through a lot of contortions * to output user friendly information. * * The logical gymnastics undertaken, however, help in * describing the internals of the widgets used. * */ void ShowThisButton(Widget w, XtPointer client, XtPointer call) { Widget info = NULL, temp; Arg args[5]; Cardinal argcnt; XmIconPlacement place = XmIconNone; char place_str[50]; XmString xmstring; short x, y; char message_string[BUFSIZ]; String class_name = 0; argcnt = 0; XtSetArg(args[argcnt], XmNiconPlacement, &place); argcnt++; XtSetArg(args[argcnt], XmNcellX, &x); argcnt++; XtSetArg(args[argcnt], XmNcellY, &y); argcnt++; XtGetValues(w, args, argcnt); switch(place) { case XmIconTop: sprintf(place_str, "XmIconTop"); break; case XmIconLeft: sprintf(place_str, "XmIconLeft"); break; case XmIconRight: sprintf(place_str, "XmIconRight"); break; case XmIconBottom: sprintf(place_str, "XmIconBottom"); break; case XmIconOnly: sprintf(place_str, "XmIconOnly"); break; default: case XmIconNone: sprintf(place_str, "XmIconNone"); break; } /* * Obtaining the class name here is a little "tricky" */ if (XtClass(w) == xmIconButtonWidgetClass) { class_name = "XmIconButton"; } else if (XtClass(w) == xmPushButtonWidgetClass) { { sprintf(place_str, "not applicable"); class_name = "XmPushButton"; } } else if (XtClass(w) == xmToggleButtonWidgetClass) { { sprintf(place_str, "not applicable"); class_name = "XmToggleButton"; } } sprintf(message_string, OUTPUT_CODE, class_name, place_str, x, y, XtName(w)); xmstring = XmStringCreateLtoR(message_string, XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Code Sample"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateInformationDialog(w, "showcode", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XtManageChild(info); XmStringFree(xmstring); } /* * * Stuff needed for the demo program to output info * */ void Explain(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; XmString xmstring =0 ; static Widget info = NULL; int explain = (int) client; if (info == NULL) { Widget temp; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; info = (Widget)XmCreateInformationDialog(w, "explain", args, argcnt); temp = (Widget)XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = (Widget)XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); } switch (explain) { case 1: xmstring = XmStringCreateLtoR( " This is an IconButton resource. \n\ \n\ Specifies the location of the pixmap (icon) with respect \n\ to the displayed text.\n\ \n\ This resource can take one of the following values: XmIconTop,\n\ XmIconBottom, XmIconLeft, XmIconRight, XmIconNone, XmIconOnly. ", XmSTRING_DEFAULT_CHARSET); break; case 2: xmstring = XmStringCreateLtoR( " This is an IconBox resource.\n\ \n\ It specifies the location of a particular button in cell space\n\ in the x direction.", XmSTRING_DEFAULT_CHARSET); break; case 3: xmstring = XmStringCreateLtoR( " This is an IconBox resource.\n\ \n\ It specifies the location of a particular button in cell space\n\ in the y direction.", XmSTRING_DEFAULT_CHARSET); break; default: printf("explaining NOTHING\n"); break; } argcnt = 0; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; XtSetValues(info, args, argcnt); XmStringFree(xmstring); XtManageChild(info); } int main(int argc, char **argv) { Arg args[15]; Cardinal argcnt; Widget top, iconBoxframe, iconBox, infoframe, infolabel, big_pane, right_pane, placeRC, xRC, yRC, placeLabel, xLabel, yLabel, pushButton, pushButton1, pushButton2, iconButton1, iconButton2, iconButton3, iconButton4, iconButton5, iconPushButton6, iconToggleButton7, iconLabel, quitPB; Widget explain_scrolled, buttonBox; Pixmap icon_pixmap; XtAppContext app; XmString xmstring; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Icon Box/Button Demo"); argcnt++; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; top = XtOpenApplication( &app, "IconBox", NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, args, argcnt); /* big pane */ argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; big_pane = XtCreateManagedWidget("bull", xmPanedWidgetClass, top, args, argcnt); iconBoxframe = XtVaCreateManagedWidget("inconBoxframe", xmFrameWidgetClass, big_pane, NULL ); argcnt = 0; iconBox = XtVaCreateManagedWidget("iconBox", xmIconBoxWidgetClass, iconBoxframe, XmNallowResize, True, XmNresizeToPreferred, True, XmNpreferredPaneSize, 300, XmNminimumCellWidth, 48, XmNminimumCellHeight, 48, NULL ); /* right pane */ argcnt = 0; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; XtSetArg(args[argcnt], XmNskipAdjust, False ); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; right_pane = XtCreateManagedWidget("rightpane", xmPanedWidgetClass, big_pane, args,argcnt); /* * Take Note: * * Creation of the IconBox widget. Note the widget class used. * */ xmstring = XmStringCreateLtoR( "This is a demo of two unique Motif Widgets: the Icon Button and Icon Box.\n\ \n\ Labels, Push Buttons, and Toggle Buttons are limited because these\n\ widgets only allow EITHER labels OR pixmaps on the face but NOT BOTH.\n\ Icon Buttons relieve the developer of this restriction, allowing both, or either,\n\ pixmaps and labels on its face.\n\ \n\ Row Column and Form from Motif make it difficult to produce \"matrix\", or \n\ \"cell oriented\" layouts (in which the height and width are the same).\n\ The Icon Box places a constraint on all of its children, making each child\n\ the same width and height. Moreover, the Icon Box lets the developer\n\ specify which cell in the Icon Box each child should go.\n\ ", XmSTRING_DEFAULT_CHARSET); infoframe = XtVaCreateManagedWidget("infoframe", xmFrameWidgetClass, right_pane, NULL ); argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAUTOMATIC ); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; XtSetArg(args[argcnt], XmNresizeToPreferred, True); argcnt++; XtSetArg(args[argcnt], XmNpreferredPaneSize, 300); argcnt++; XtSetArg(args[argcnt], XmNallowResize, True); argcnt++; XtSetArg(args[argcnt], XmNscrollBarDisplayPolicy, XmAS_NEEDED ); argcnt++; explain_scrolled = XtCreateManagedWidget( "scrollExplain", xmScrolledWindowWidgetClass, infoframe, args, argcnt ); infolabel = XtVaCreateManagedWidget("infolabel", xmLabelWidgetClass, explain_scrolled, XmNx, 2, XmNy, 2, XmNalignment, XmALIGNMENT_BEGINNING, XmNlabelString, xmstring, NULL); placeRC = XtVaCreateManagedWidget("placeRC", xmRowColumnWidgetClass, right_pane, XmNorientation, XmHORIZONTAL, XmNpacking, XmPACK_TIGHT, XmNrowColumnType, XmWORK_AREA, XmNskipAdjust, True, XmNshowSash, False, NULL); xRC = XtVaCreateManagedWidget("xRC", xmRowColumnWidgetClass, right_pane, XmNorientation, XmHORIZONTAL, XmNpacking, XmPACK_TIGHT, XmNrowColumnType, XmWORK_AREA, XmNskipAdjust, True, XmNshowSash, False, NULL); yRC = XtVaCreateManagedWidget("yRC", xmRowColumnWidgetClass, right_pane, XmNorientation, XmHORIZONTAL, XmNpacking, XmPACK_TIGHT, XmNrowColumnType, XmWORK_AREA, XmNskipAdjust, True, XmNshowSash, False, NULL); placeLabel = XtVaCreateManagedWidget("placeLabel", xmLabelWidgetClass, placeRC, XmNx, 3, XmNy, 3, NULL); pushButton = XtVaCreateManagedWidget("pushButton", xmPushButtonWidgetClass, placeRC, XmNx, 82, XmNy, 3, NULL); xLabel = XtVaCreateManagedWidget("xLabel", xmLabelWidgetClass, xRC, XmNx, 3, XmNy, 3, NULL); pushButton1 = XtVaCreateManagedWidget("pushButton1", xmPushButtonWidgetClass, xRC, XmNx, 82, XmNy, 3, NULL); yLabel = XtVaCreateManagedWidget("yLabel", xmLabelWidgetClass, yRC, XmNx, 3, XmNy, 3, NULL); pushButton2 = XtVaCreateManagedWidget("pushButton2", xmPushButtonWidgetClass, yRC, XmNx, 58, XmNy, 3, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillNone); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; XtSetArg(args[argcnt], XmNskipAdjust, True); argcnt++; buttonBox = XtCreateManagedWidget("buttonBox1", xmButtonBoxWidgetClass, right_pane, args, argcnt); quitPB = XtVaCreateManagedWidget("quitPB", xmPushButtonWidgetClass, buttonBox, NULL); /* * Take Note: * * Creation of the IconButton widgets. Note the widget class used. * */ icon_pixmap = XPM_PIXMAP( iconBox, crab ); iconButton1 = XtVaCreateManagedWidget("XmIconTop", xmIconButtonWidgetClass, iconBox, XmNpixmap, icon_pixmap, XmNcellX, XmIconBoxAnyCell, XmNcellY, XmIconBoxAnyCell, XmNiconPlacement, XmIconTop, NULL ); XtAddCallback(iconButton1, XmNactivateCallback, ShowThisButton, NULL); icon_pixmap = XPM_PIXMAP( iconBox, crab ); iconButton2 = XtVaCreateManagedWidget("XmIconBottom", xmIconButtonWidgetClass, iconBox,XmNpixmap, icon_pixmap, XmNcellX, XmIconBoxAnyCell, XmNcellY, XmIconBoxAnyCell, XmNiconPlacement, XmIconBottom, NULL ); XtAddCallback(iconButton2, XmNactivateCallback, ShowThisButton, NULL); icon_pixmap = None; iconButton3 = XtVaCreateManagedWidget("XmIconLeft", xmIconButtonWidgetClass, iconBox,XmNpixmap, icon_pixmap, XmNiconPlacement, XmIconLeft, XmNcellX, XmIconBoxAnyCell, XmNcellY, XmIconBoxAnyCell, NULL ); XtAddCallback(iconButton3, XmNactivateCallback, ShowThisButton, NULL); icon_pixmap = XCreateBitmapFromData(XtDisplay(iconBox), RootWindowOfScreen(XtScreen(iconBox)), (char *)small_bits, small_width, small_height); iconButton4 = XtVaCreateManagedWidget("XmIconRight", xmIconButtonWidgetClass, iconBox,XmNpixmap, icon_pixmap, XmNcellX, XmIconBoxAnyCell, XmNcellY, XmIconBoxAnyCell, XmNiconPlacement, XmIconLeft, NULL ); XtAddCallback(iconButton4, XmNactivateCallback, ShowThisButton, NULL); icon_pixmap = XPM_PIXMAP( iconBox, stopsign ); iconButton5 = XtVaCreateManagedWidget("stop", xmIconButtonWidgetClass, iconBox,XmNpixmap, icon_pixmap, XmNcellX, XmIconBoxAnyCell, XmNcellY, XmIconBoxAnyCell, XmNiconPlacement, XmIconOnly, NULL ); XtAddCallback(iconButton5, XmNactivateCallback, ShowThisButton, NULL); iconPushButton6 = XtVaCreateManagedWidget("Push", xmPushButtonWidgetClass, iconBox,XmNpixmap, icon_pixmap, XmNcellX, XmIconBoxAnyCell, XmNcellY, XmIconBoxAnyCell, NULL ); XtAddCallback(iconPushButton6, XmNactivateCallback, ShowThisButton, NULL); iconToggleButton7 = XtVaCreateManagedWidget("PushMe!", xmToggleButtonWidgetClass, iconBox, XmNcellX, XmIconBoxAnyCell, XmNcellY, XmIconBoxAnyCell, NULL ); XtAddCallback(iconToggleButton7, XmNvalueChangedCallback, ShowThisButton, NULL); XtAddCallback(quitPB, XmNactivateCallback, Exit, (XtPointer)0); XtAddCallback(pushButton, XmNactivateCallback, Explain, (XtPointer) 1); XtAddCallback(pushButton1, XmNactivateCallback, Explain, (XtPointer) 2); XtAddCallback(pushButton2, XmNactivateCallback, Explain, (XtPointer) 3); XtRealizeWidget(top); XtAppMainLoop(app); return(0); } motif-2.3.8/demos/programs/IconB/Makefile.am0000644000175000017500000000064213145162623015557 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Icon datadir = ${prefix}/share/Xm/Icon EXTRA_DIST = small.bm bin_PROGRAMS = iconbuttondemo iconbuttondemo_SOURCES = misc.c iconbuttondemo.c data_DATA = $(iconbuttondemo_SOURCES) $(EXTRA_DIST) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. \ -I$(srcdir)/$(TOPDIR)/lib \ ${X_CFLAGS} motif-2.3.8/demos/programs/Makefile.in0000644000175000017500000004761113211512766014606 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = airport \ animate \ drag_and_drop \ draw \ earth \ filemanager \ fileview \ getsubres \ hellomotif \ i18ninput \ panner \ periodic \ piano \ popups \ sampler2_0 \ setdate \ Exm \ todo \ workspace \ hellomotifi18n \ tooltips \ ButtonBox \ Column \ FontSel \ Outline \ TabStack \ Tree \ ColorSel \ Combo2 \ Ext18List \ IconB \ Paned \ pixmaps EXTRA_DIST = all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Column/0000755000175000017500000000000013211513007014032 500000000000000motif-2.3.8/demos/programs/Column/column.c0000644000175000017500000000647212672140200015425 00000000000000/* simple test program */ #include #include #include #include #include #define phone_width 16 #define phone_height 16 static unsigned char phone_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x2c, 0x1a, 0x20, 0x02, 0xb0, 0x06, 0x18, 0x0c, 0xa8, 0x0a, 0x0c, 0x18, 0xa4, 0x12, 0x04, 0x10, 0xfc, 0x1f, 0x00, 0x00}; static int done = 0; static void quitCB(Widget w, XtPointer client, XtPointer call) { done = 1; } static void pCB(Widget w, XtPointer client, XtPointer call) { printf ("Widget '%s' got data not matching XmNpicture\n", XtName(w)); } static void vCB(Widget w, XtPointer client, XtPointer call) { XmDataFieldCallbackStruct *cbs = (XmDataFieldCallbackStruct*)call; printf ("Widget '%s' got data %s\n", XtName(w),cbs->text); } static void addCallbacks(Widget df) { XtAddCallback(df, XmNpictureErrorCallback, pCB, NULL); XtAddCallback(df, XmNvalidateCallback, vCB, NULL); } static void createQuit(Widget quit_parent) { Widget button = XmCreatePushButton(quit_parent, "quit", NULL, 0); XtManageChild(button); XtAddCallback(button, XmNactivateCallback, quitCB, (XtPointer)NULL); } static void createScreen(Widget parent) { Widget top = XmCreatePanedWindow(parent, "pane", NULL,0); Widget tab = XmCreateTabStack(top,"tab",NULL,0); XtManageChild(XmCreateScrolledText(tab,"explanation",NULL,0)); { Widget column = XmCreateColumn(tab,"column",NULL,0); Widget w; Pixel bg; XtManageChild(XmCreateTextField(column, "name", NULL, 0)); XtManageChild(XmCreateTextField(column, "address1", NULL, 0)); XtManageChild(XmCreateTextField(column, "address2", NULL, 0)); XtManageChild(XmCreateTextField(column, "city", NULL, 0)); XtManageChild(w=XmCreateDataField(column, "state", NULL, 0)); addCallbacks(w); XtManageChild(w=XmCreateDataField(column, "zip", NULL, 0)); addCallbacks(w); XtManageChild(w = XmCreateDataField(column, "phone", NULL, 0)); addCallbacks(w); XtVaGetValues(column,XmNbackground,&bg,NULL); XtVaSetValues(w,XmNentryLabelPixmap, XCreatePixmapFromBitmapData(XtDisplay(w), DefaultRootWindow(XtDisplay(w)), (char*)phone_bits, phone_width, phone_height, BlackPixelOfScreen(XtScreen(w)), bg, DefaultDepthOfScreen(XtScreen(w))), NULL); XtManageChild(column); } createQuit(top); XtManageChild(tab); XtManageChild(top); } #define CLASS "Column" int main (int argc,char *argv[]) { XtAppContext app_context; Widget app_shell; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); app_shell = XtVaOpenApplication ( &app_context, CLASS, NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL ); XtVaSetValues(app_shell,XmNallowShellResize, True, NULL); /* create application */ createScreen(app_shell); XtRealizeWidget(app_shell); /* Process events, unwrapping correctly. */ while (!done) { XEvent event; XtAppNextEvent(app_context, &event); XtDispatchEvent(&event); } XtDestroyWidget(app_shell); XtDestroyApplicationContext(app_context); exit(0); } motif-2.3.8/demos/programs/Column/Makefile.in0000644000175000017500000005474413211512766016050 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = column$(EXEEXT) subdir = demos/programs/Column ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_column_OBJECTS = column.$(OBJEXT) column_OBJECTS = $(am_column_OBJECTS) column_LDADD = $(LDADD) column_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(column_SOURCES) DIST_SOURCES = $(column_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Column build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Column datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in column_SOURCES = column.c EXTRA_DIST = Column.ad data_DATA = $(EXTRA_DIST) $(column_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Column/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Column/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list column$(EXEEXT): $(column_OBJECTS) $(column_DEPENDENCIES) $(EXTRA_column_DEPENDENCIES) @rm -f column$(EXEEXT) $(AM_V_CCLD)$(LINK) $(column_OBJECTS) $(column_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/column.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Column/Column.ad0000644000175000017500000000417512672140200015525 00000000000000!resources for the Column layout and labels *entryLabelAlignment: ALIGNMENT_END *column.tabLabelString: Demo *name.entryLabelString: Name *address1.entryLabelString: Address *address2.showEntryLabel: False *address1.columns: 30 *address2.columns: 30 *address1.fillStyle: FILL_RAGGED *address2.fillStyle: FILL_RAGGED *city.entryLabelString: City *state.entryLabelString: State *state.columns: 2 *state.fillStyle: FILL_RAGGED *zip.entryLabelString: Zip+4 Code *zip.columns: 10 *zip.fillStyle: FILL_RAGGED *phone.entryLabelString: USA Telephone *phone.entryLabelType: pixmap ! resources for picture definitions *state.picture: && *zip.picture: #####-#### *phone.picture: ###-###-#### ! resources for the pop-up tips *column.XmTextField.toolTip.tipEnabled: True *column.XmDataField.toolTip.tipEnabled: True *column.name.toolTip.labelString: Customer's Name *column.address1.toolTip.labelString: Address, First Line *column.address2.toolTip.labelString: Address, Second Line *column.city.toolTip.labelString: Customer's City *column.state.toolTip.labelString: Two-Letter Abbreviation *column.zip.toolTip.labelString: Zip+4 USA Postal Code *column.phone.toolTip.labelString: Telephone ###-###-#### !resources for the explanation screen *explanationSW.tabLabelString: Explanation *explanation.editMode: MULTI_LINE_EDIT *explanation.editable: False *explanation.value: \ This is a demo of the XmColumn widget, showing its\n\ ability to lay out widgets and their associated labels.\n\ This usage is very simple; please consult the manual\n\ page for extra resource values which can be used. \n\n\ Note the ability to right-justify labels. Note also\n\ that labels can be text or pixmap (or missing). In\n\ addition, the children can be of different widths\n\ or filled to the same width.\n\ \n\ In addition, this demo shows use of the XmDataField\n\ widget and its XmNpicture resource. Certain data\n\ fields are set up so that the input should match \n\ a particular format.\n\ \n\ This demo also shows use of the pop-up help library.\n\ The "tool tips" appear near widgets to provide extra\n\ help or hints in data entry. motif-2.3.8/demos/programs/Column/Makefile.am0000644000175000017500000000052513145162623016022 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Column datadir = ${prefix}/share/Xm/Column bin_PROGRAMS = column column_SOURCES = column.c EXTRA_DIST = Column.ad data_DATA = $(EXTRA_DIST) $(column_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/Combo2/0000755000175000017500000000000013211513007013716 500000000000000motif-2.3.8/demos/programs/Combo2/Makefile.in0000644000175000017500000005471713211512766015734 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = combo$(EXEEXT) subdir = demos/programs/Combo2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_combo_OBJECTS = combo.$(OBJEXT) combo_OBJECTS = $(am_combo_OBJECTS) combo_LDADD = $(LDADD) combo_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(combo_SOURCES) DIST_SOURCES = $(combo_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/combo2 build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/combo2 datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = Combo.ad combo_SOURCES = combo.c data_DATA = $(EXTRA_DIST) $(combo_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Combo2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Combo2/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list combo$(EXEEXT): $(combo_OBJECTS) $(combo_DEPENDENCIES) $(EXTRA_combo_DEPENDENCIES) @rm -f combo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(combo_OBJECTS) $(combo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/combo.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Combo2/Combo.ad0000644000175000017500000000117112672140200015204 00000000000000!resources for the Combo (most are set in the code) *rc.tabLabelString: Demo *combo.label.labelString: Planet !resources for the explanation screen *explanationSW.tabLabelString: Explanation *explanation.editMode: MULTI_LINE_EDIT *explanation.editable: False *explanation.rows: 8 *explanation.value: \ This is a demo of the XmDropDown widget, showing its\n\ ability to offer a customized combination box.\n\ This is done by creating a separate popup shell and\n\ then setting a few resources on the XmDropDown.\n\ \n\ The callbacks in this code set the data appropriately\n\ to match the text or the list of toggles. motif-2.3.8/demos/programs/Combo2/combo.c0000644000175000017500000000447313066310437015123 00000000000000/* simple test program */ #include #include #include #include #include static int done = 0; static void quitCB(Widget w, XtPointer client, XtPointer call) { done = 1; } /* note! using names of the widgets as equivalent to the labels */ static char * values[] = { "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto", }; static void createQuit(Widget quit_parent) { Widget button = XmCreatePushButton(quit_parent, "quit", NULL, 0); XtManageChild(button); XtAddCallback(button, XmNactivateCallback, quitCB, (XtPointer)NULL); } static void createScreen(Widget parent) { Widget top = XmCreatePanedWindow(parent, "pane", NULL,0); Widget tab = XmCreateTabStack(top,"tab",NULL,0); XtManageChild(XmCreateScrolledText(tab,"explanation",NULL,0)); { XmStringTable tmp0; Arg args[10]; int n, i = XtNumber(values); Widget combo; Widget rc = XmCreateRowColumn(tab, "rc", NULL,0); XtManageChild(rc); tmp0 = (XmStringTable) XtMalloc(i * sizeof(XmString)); for(n = 0; n < i; n++) tmp0[n] = XmStringCreateLocalized(values[n]); n=0; XtSetArg(args[n], XmNitems, tmp0); n++; XtSetArg(args[n], XmNitemCount, i); n++; combo = XmCreateDropDown(rc, "combo", args, n); XtManageChild(combo); } createQuit(top); XtManageChild(tab); XtManageChild(top); } #define CLASS "Combo" int main (int argc,char *argv[]) { XtAppContext app_context; Widget app_shell; Display *display; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); app_shell = XtVaOpenApplication ( &app_context, CLASS, NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL ); XtVaSetValues(app_shell,XmNallowShellResize, True, NULL); /* create application */ createScreen(app_shell); XtRealizeWidget(app_shell); /* Process events, unwrapping correctly. */ while (!done) { XEvent event; XtAppNextEvent(app_context, &event); XtDispatchEvent(&event); } XtDestroyWidget(app_shell); XtDestroyApplicationContext(app_context); exit(0); } motif-2.3.8/demos/programs/Combo2/Makefile.am0000644000175000017500000000052013145162623015701 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/combo2 datadir = ${prefix}/share/Xm/combo2 bin_PROGRAMS = combo EXTRA_DIST = Combo.ad combo_SOURCES = combo.c data_DATA = $(EXTRA_DIST) $(combo_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/draw/0000755000175000017500000000000013211513007013532 500000000000000motif-2.3.8/demos/programs/draw/Makefile.in0000644000175000017500000005501113211512766015534 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = draw$(EXEEXT) subdir = demos/programs/draw ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_draw_OBJECTS = draw.$(OBJEXT) draw_OBJECTS = $(am_draw_OBJECTS) draw_LDADD = $(LDADD) draw_DEPENDENCIES = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(draw_SOURCES) DIST_SOURCES = $(draw_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/draw build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/draw datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in draw_SOURCES = draw.c EXTRA_DIST = XmdDraw.ad README draw.help draw.man data_DATA = $(EXTRA_DIST) $(draw_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/draw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/draw/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list draw$(EXEEXT): $(draw_OBJECTS) $(draw_DEPENDENCIES) $(EXTRA_draw_DEPENDENCIES) @rm -f draw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(draw_OBJECTS) $(draw_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/draw.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/draw/draw.help0000644000175000017500000000107212672140200015262 00000000000000Overview Draw : a drawing demo using Motif If the TextField is empty, BSelect in the workarea starts a new polyline, otherwise it creates a new PushButton using the current text as label. A polyline is finished by clicking twice at the same location. Deleting a line or a pushbutton is done by clicking Shift BSelect on the object. The Scales control the size of the scrollable workarea. Save, in the File menu, maps a FileSelectionBox and then writes X Resource formatted data. To load them back, put them in your .Xdefaults file. motif-2.3.8/demos/programs/draw/draw.c0000644000175000017500000006365412672140200014572 00000000000000/* $XConsortium: draw.c /main/5 1996/06/13 10:32:01 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /* ** This demo shows an AUTOMATIC scrolled window and some graphics ** done in a DrawingArea. ** ** It lets you draw polylines and buttons, resizes the picture, ** and eventually save the data in an X resource format. ** */ #include #include #include #include #include #include #include /*------------------------------------------------------------- ** Graphic data structure and API */ #define APP_CLASS "XmdDraw" /* very simple data struct, static size, etc... */ #define MAX_POINT 100 typedef struct { XPoint points[MAX_POINT] ; Cardinal num_points ; #define POLYLINE 1 unsigned char type ; } GraphicUnit ; #define MAX_GRAPH 100 typedef struct { GraphicUnit graphics[MAX_GRAPH] ; Cardinal num_graphics ; XPoint anchor_point ; XPoint drag_point ; GC drag_gc ; Boolean in_drag ; Dimension old_width, old_height ; Widget work_area ; Widget textf ; } Graphic ; static char drawTranslations[] = "#replace\n\ ~s ~m ~a Return:DrawingAreaInput() ManagerParentActivate()\n\ Return:DrawingAreaInput() ManagerGadgetSelect()\n\ osfActivate:DrawingAreaInput() ManagerParentActivate()\n\ osfCancel:DrawingAreaInput() ManagerParentCancel()\n\ osfHelp:DrawingAreaInput() ManagerGadgetHelp()\n\ space:DrawingAreaInput() ManagerGadgetSelect()\n\ osfSelect:DrawingAreaInput() ManagerGadgetSelect()\n\ :DrawingAreaInput() ManagerGadgetKeyInput()\n\ :DrawingAreaInput()\n\ :DrawingAreaInput() ManagerGadgetButtonMotion()\n\ :DrawingAreaInput() ManagerGadgetButtonMotion()\n\ :DrawingAreaInput() ManagerGadgetArm()\n\ :DrawingAreaInput() ManagerGadgetActivate()\n\ :DrawingAreaInput() ManagerGadgetDrag()\n\ :DrawingAreaInput()\n\ :DrawingAreaInput()"; /*------------------------------------------------------------- ** Application data stuff: this serve as the file saving format */ typedef struct { char * lines; char * towns; } ApplicationData, * ApplicationDataPtr ; #define XtNlines "lines" #define XtCLines "Lines" #define XtNtowns "towns" #define XtCTowns "Towns" /* if this stuff was as easily initializable, I would put it local to main */ static XtResource app_resources[] = { { XtNlines, XtCLines, XmRString, sizeof(String), XtOffset(ApplicationDataPtr, lines), XmRString, "" }, { XtNtowns, XtCTowns, XmRString, sizeof(String), XtOffset(ApplicationDataPtr, towns), XmRString, "" }, }; /* if this stuff was as easily initializable, I would put it local to main */ /* better to have that in automatic mode */ static String fallback_resources[] = { "*help_manager.helpFile: draw", "*work_area.width:1000", "*work_area.height:1000", "*XmScale.minimum: 100", "*XmScale.maximum: 16000", ".geometry:600x500", NULL } ; /*------------------------------------------------------------- ** forwarded functions */ static void CreateApplication (Widget parent, Graphic *graph); /* Xt callbacks */ static void SaveCB (Widget w, XtPointer client_data, XtPointer call_data); static void OK_WriteCB (Widget w, XtPointer client_data, XtPointer call_data); static void QuitCB (Widget w, XtPointer client_data, XtPointer call_data); static void HelpCB (Widget w, XtPointer client_data, XtPointer call_data); static void DrawCB (Widget w, XtPointer client_data, XtPointer call_data); static void ValueCB (Widget w, XtPointer client_data, XtPointer call_data); static void TravCB (Widget w, XtPointer client_data, XtPointer call_data); static void PushCB (Widget w, XtPointer client_data, XtPointer call_data); static void InitDraw (Graphic *graph, ApplicationData *app_data); static void ReDraw (Graphic *graph, XEvent *event); static void ReSize (Graphic *graph, Dimension widget, Dimension height); static void StartUnit (Graphic *graph, Position x, Position y); static void DragUnit (Graphic *graph, Position x, Position y); static Boolean NearPoint (XPoint point, Position x, Position y); static void EndUnit (Graphic *graph, Position x, Position y); static void DeleteUnit (Graphic *graph, Position x, Position y); /*------------------------------------------------------------- ** Main body */ int main(int argc, char *argv[]) { XtAppContext app_context; Widget toplevel; ApplicationData app_data; Graphic legraph; toplevel = XtAppInitialize(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallback_resources, NULL, 0); /** Plug in Editres protocol */ XmdRegisterEditres(toplevel); XtGetApplicationResources(toplevel, (XtPointer)&app_data, app_resources, XtNumber(app_resources), NULL, 0); CreateApplication (toplevel, &legraph); InitDraw(&legraph, &app_data); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); /*NOTREACHED*/ exit(0); } /*------------------------------------------------------------- ** Create a Main Window with a menubar, a command panel containing ** 2 scales and a textfied, and a workarea. ** Also put in the graphic structure the workarea info and the ** textfield ids. */ static void CreateApplication (Widget parent, Graphic * graph) { Widget main_window, menu_bar, menu_pane, cascade, button, comw, scale; Arg args[5]; int n; XtTranslations xlations; /* Create automatic MainWindow. */ n = 0; XtSetArg (args[n], XmNscrollingPolicy, XmAUTOMATIC); n++; main_window = XmCreateMainWindow (parent, "main_window", args, n); XtAddCallback (main_window, XmNtraverseObscuredCallback, TravCB, (XtPointer)graph); XtManageChild (main_window); /* Create MenuBar in MainWindow. */ n = 0; menu_bar = XmCreateMenuBar (main_window, "menu_bar", args, n); XtManageChild (menu_bar); /* Create "File" PulldownMenu with Save and Quit buttons */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Save...", args, n); XtManageChild (button); /* pass the graphic id to the save function */ XtAddCallback (button, XmNactivateCallback, SaveCB, (XtPointer)graph); n = 0; button = XmCreatePushButton (menu_pane, "Quit", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, QuitCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "File", args, n); XtManageChild (cascade); /* Create "Help" PulldownMenu with Help button. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Overview", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, HelpCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "Help", args, n); XtManageChild (cascade); n = 0; XtSetArg (args[n], XmNmenuHelpWidget, cascade); n++; XtSetValues (menu_bar, args, n); /* Create work_area in MainWindow */ n = 0; XtSetArg (args[n], XmNresizePolicy, XmRESIZE_NONE); n++ ; XtSetArg (args[n], XmNmarginWidth, 0); n++ ; XtSetArg (args[n], XmNmarginHeight, 0); n++ ; /* hardcode this one, since its is required for the motion handling */ xlations = XtParseTranslationTable(drawTranslations); XtSetArg (args[n], XmNtranslations, xlations); n++; graph->work_area = XmCreateDrawingArea(main_window, "work_area", args, n); XtAddCallback (graph->work_area, XmNexposeCallback, DrawCB, (XtPointer)graph); XtAddCallback (graph->work_area, XmNresizeCallback, DrawCB, (XtPointer)graph); XtAddCallback (graph->work_area, XmNinputCallback, DrawCB, (XtPointer)graph); XtManageChild (graph->work_area); /* Create a commandWindow in MainWindow with text and scales */ n = 0; comw = XmCreateRowColumn(main_window, "comw", args, n); XtManageChild (comw); n = 0; XtSetArg (args[n], XmNcommandWindow, comw); n++; XtSetValues (main_window, args, n); /* find the initial size of the work_area and report to the scales */ n = 0; XtSetArg (args[n], XmNwidth, &graph->old_width); n++; XtSetArg (args[n], XmNheight, &graph->old_height); n++; XtGetValues (graph->work_area, args, n); n = 0; XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg (args[n], XmNshowValue, True); n++; XtSetArg (args[n], XmNvalue, graph->old_width); n++; scale = XmCreateScale(comw, "scale_w", args, n); /* scale_w is the name */ XtAddCallback (scale, XmNvalueChangedCallback, ValueCB, (XtPointer)graph->work_area); XtManageChild (scale); n = 0; XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; XtSetArg (args[n], XmNshowValue, True); n++; XtSetArg (args[n], XmNvalue, graph->old_height); n++; scale = XmCreateScale(comw, "scale_h", args, n); XtAddCallback (scale, XmNvalueChangedCallback, ValueCB, (XtPointer)graph->work_area); XtManageChild (scale); n = 0; graph->textf = XmCreateTextField(comw, "textf", args, n); XtManageChild (graph->textf); /* Set MainWindow areas */ XmMainWindowSetAreas (main_window, menu_bar, comw, NULL, NULL, graph->work_area); } /*------------------------------------------------------------- ** PushCB - callback for push button inside the workarea */ static void PushCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { XmPushButtonCallbackStruct * pbcs = (XmPushButtonCallbackStruct *) call_data ; if ((pbcs->event->type == ButtonRelease) && (pbcs->event->xbutton.state & ShiftMask)) XtDestroyWidget(w); /* else printf("Activate %s\n",XtName(w));*/ } /*------------------------------------------------------------- ** TravCB - callback for traverseObscure */ static void TravCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { XmTraverseObscuredCallbackStruct * tocs = (XmTraverseObscuredCallbackStruct *) call_data ; Graphic * graph = (Graphic *) client_data ; if (tocs->traversal_destination != graph->work_area) XmScrollVisible(w, tocs->traversal_destination, 20, 20) ; } /*------------------------------------------------------------- ** ValueCB - callback for scales */ static void ValueCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Arg args[5]; int n ; int value ; Widget workarea = (Widget) client_data ; /* get the value outof the Scale */ n = 0; XtSetArg (args[n], XmNvalue, &value); n++; XtGetValues (w, args, n); n = 0; if (strcmp(XtName(w), "scale_w") == 0 ) { /* width scale */ XtSetArg (args[n], XmNwidth, value); n++; } else { XtSetArg (args[n], XmNheight, value); n++; } XtSetValues (workarea, args, n); } /*------------------------------------------------------------- ** SaveCB - callback for Save button */ static void SaveCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { static Widget fsb_box = NULL ; if (!fsb_box) { fsb_box = XmCreateFileSelectionDialog (w, "Save graphics", NULL, 0); /* just propagate the graphic information */ XtAddCallback (fsb_box, XmNokCallback, OK_WriteCB, client_data); } XtManageChild (fsb_box); } /*------------------------------------------------------------- ** QuitCB - callback for quit button */ static void QuitCB (Widget w, /* widget id */ XtPointer client_data, /* data from applicaiton */ XtPointer call_data) /* data from widget class */ { exit (0); } /*------------------------------------------------------------- ** HelpCB - callback for help button */ static void HelpCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { static Widget help_widget = NULL ; if (!help_widget) help_widget = XmdCreateHelpDialog(w, "help_manager", NULL, 0); XtManageChild(help_widget); } /*------------------------------------------------------------- ** OK_WriteCB - callback for saving the graphics in a file */ static void OK_WriteCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { Widget text ; char * filename ; FILE *out_file ; Cardinal i,j ; Arg args[5]; int n ; Widget * children ; Cardinal num_children ; Graphic * graph = (Graphic *) client_data ; Position x,y ; text = XmFileSelectionBoxGetChild(w, XmDIALOG_TEXT); filename = XmTextGetString(text); if ((out_file=fopen(filename, "w")) == NULL) { printf("Can't open file: %s ", filename); return ; } fprintf(out_file, "draw.lines: "); for (i=0; i < graph->num_graphics; i++) { for (j=0; j < graph->graphics[i].num_points; j++) { fprintf(out_file, "%d_%d", graph->graphics[i].points[j].x, graph->graphics[i].points[j].y) ; if (j == graph->graphics[i].num_points - 1) { if (i != graph->num_graphics - 1) fprintf(out_file, ". ") ; } else fprintf(out_file, ", ") ; } } fprintf(out_file, "\n"); fprintf(out_file, "draw.towns: "); n = 0; XtSetArg (args[n], XmNnumChildren, &num_children); n++; XtSetArg (args[n], XmNchildren, &children); n++; XtGetValues (graph->work_area, args, n); for (i=0; i < num_children; i++) { fprintf(out_file, "%s", XtName(children[i])); if (i != num_children - 1) fprintf(out_file, ", ") ; } fprintf(out_file, "\n"); for (i=0; i < num_children; i++) { n = 0; XtSetArg (args[n], XmNx, &x); n++; XtSetArg (args[n], XmNy, &y); n++; XtGetValues (children[i], args, n); fprintf(out_file, "draw*%s.x: %d\n",XtName(children[i]),x); fprintf(out_file, "draw*%s.y: %d\n",XtName(children[i]),y); } fclose(out_file); } /*------------------------------------------------------------- ** DrawCB - callback for drawing area */ static void DrawCB (Widget w, /* widget id */ XtPointer client_data, /* data from application */ XtPointer call_data) /* data from widget class */ { XmDrawingAreaCallbackStruct * dacs = (XmDrawingAreaCallbackStruct *) call_data ; Arg args[5]; int n ; Dimension width, height ; String name ; Widget newpush ; XSetWindowAttributes xswa; Graphic * graph = (Graphic *) client_data ; static Boolean first_time = True ; switch (dacs->reason) { case XmCR_EXPOSE: if (first_time) { /* Change once the bit gravity of the Drawing Area; default is north west and we want forget, so that resize always generates exposure events */ first_time = False ; xswa.bit_gravity = ForgetGravity ; XChangeWindowAttributes(XtDisplay(w), XtWindow(w), CWBitGravity, &xswa); } ReDraw(graph, dacs->event) ; break ; case XmCR_RESIZE: n = 0; XtSetArg (args[n], XmNwidth, &width); n++; XtSetArg (args[n], XmNheight, &height); n++; XtGetValues (w, args, n); ReSize(graph, width, height) ; break ; case XmCR_INPUT: if (dacs->event->type == ButtonPress) { name = XmTextFieldGetString(graph->textf) ; /* textfield */ if (strcmp ("", name) != 0) { n = 0; XtSetArg (args[n], XmNx, dacs->event->xbutton.x); n++; XtSetArg (args[n], XmNy, dacs->event->xbutton.y); n++; newpush = XmCreatePushButton(w, name, args, n); XtAddCallback (newpush, XmNactivateCallback, PushCB, NULL); XtManageChild (newpush); } else if ((dacs->event->xbutton.state & ShiftMask) && (!graph->in_drag)) { DeleteUnit (graph, dacs->event->xbutton.x, dacs->event->xbutton.y); } else { if (!graph->in_drag) { StartUnit(graph, dacs->event->xbutton.x, dacs->event->xbutton.y); } else { EndUnit(graph, dacs->event->xbutton.x, dacs->event->xbutton.y); } } XtFree(name); } else /* need to get motion events here: app_default should modified DrawingArea translation with both Motion and BtnMotion addition */ if (dacs->event->type == MotionNotify) { /* this one just exits if in_drag is False */ DragUnit(graph, dacs->event->xbutton.x, dacs->event->xbutton.y); } break ; } } /*************************** GRAPHICS **********************************/ static void InitDraw(Graphic * graph, ApplicationData * app_data) { XGCValues val ; Arg args[5]; int n ; Cardinal i ; Dimension width, height ; String pstr, wstr ; int x, y ; Widget newpush ; /* create the gc used for the rudder banding effect */ n = 0; XtSetArg (args[n], XmNforeground, &val.foreground); n++; XtSetArg (args[n], XmNbackground, &val.background); n++; XtGetValues (graph->work_area, args, n); val.foreground = val.foreground ^ val.background ; val.function = GXxor ; graph->drag_gc = XtGetGC(graph->work_area, GCForeground | GCBackground | GCFunction, &val); /* initialize the graphic stuff */ graph->in_drag = False ; graph->num_graphics = 0 ; for (i=0; i < MAX_GRAPH; i++) { graph->graphics[i].num_points = 0 ; } /* polylines syntax: draw.lines: 10_10, 20_30, 28_139. 11_112, 145_60. 211_112, 45_60 would be nice to use nested strtok but the sucker is not reentrant... */ wstr = XtNewString(app_data->lines) ; for(pstr = (char *) strtok(wstr, ".,") ; pstr ; pstr = (char *) strtok( NULL, ".,")) { while (*pstr && isspace(*pstr)) pstr++; if (*pstr == '\0') break; sscanf(pstr, "%d_%d", &x, &y); graph->graphics[graph->num_graphics].points [graph->graphics[graph->num_graphics].num_points].x = x ; graph->graphics[graph->num_graphics].points [graph->graphics[graph->num_graphics].num_points].y = y ; graph->graphics[graph->num_graphics].num_points ++ ; graph->graphics[graph->num_graphics].type = POLYLINE ; /* look in the original to see if it is a new unit */ if (app_data->lines[pstr - wstr + strlen(pstr)] == '.') graph->num_graphics ++ ; } XtFree(wstr); if (strlen(app_data->lines)) graph->num_graphics ++ ; /* Towns syntax: draw.towns: Boston, Woburn, SanJose draw*Boston.x: 30 draw*Boston.y: 30 draw*Woburn.x: 130 draw*Woburn.y: 30 draw*SanJose.x: 30 draw*SanJose.y: 130 */ wstr = XtNewString(app_data->towns) ; for(pstr = (char *) strtok(wstr, ".,") ; pstr ; pstr = (char *) strtok( NULL, ".,")) { while (*pstr && isspace(*pstr)) pstr++; if (*pstr == '\0') break; newpush = XmCreatePushButton(graph->work_area, pstr, NULL, 0); XtAddCallback (newpush, XmNactivateCallback, PushCB, NULL); XtManageChild (newpush); } XtFree(wstr); } static void ReDraw(Graphic * graph, XEvent * event) { Cardinal i ; Widget w = graph->work_area ; /* the expose event region could be used for better performance */ for (i=0; i < graph->num_graphics; i++) { if (graph->graphics[i].type == POLYLINE) XDrawLines(XtDisplay(w), XtWindow(w), XDefaultGC(XtDisplay(w),XDefaultScreen(XtDisplay(w))), graph->graphics[i].points, graph->graphics[i].num_points, CoordModeOrigin); } } static void ReSize(Graphic * graph, Dimension width, Dimension height) { /* Note: very bad design: resize should not modify the data since you lose everything when you resize tiny tiny tiny, but hey, what do you expect for a demo ? This way at least I can use the resource interface for creating the buttons in place (see InitDraw) */ Widget w = graph->work_area ; Cardinal i,j ; Arg args[5]; int n ; Widget * children ; Cardinal num_children ; Position x,y ; float xratio = (float) width / graph->old_width, yratio = (float) height / graph->old_height ; /* reposition and resize the graphic units */ for (i=0; i < graph->num_graphics; i++) { for (j=0; j < graph->graphics[i].num_points; j++) { graph->graphics[i].points[j].x *= xratio ; graph->graphics[i].points[j].y *= yratio ; } } /* reposition the pushbutton children */ /* I can use XtMoveWidget here since it's like being part of the widget resize class method... */ n = 0; XtSetArg (args[n], XmNnumChildren, &num_children); n++; XtSetArg (args[n], XmNchildren, &children); n++; XtGetValues (w, args, n); for (i=0; i < num_children; i++) { n = 0; XtSetArg (args[n], XmNx, &x); n++; XtSetArg (args[n], XmNy, &y); n++; XtGetValues (children[i], args, n); XtMoveWidget(children[i], (Position) (x * xratio), (Position) (y * yratio)); } graph->old_width = width ; graph->old_height = height ; } static void StartUnit(Graphic * graph, Position x, Position y) { Widget w = graph->work_area ; graph->drag_point.x = graph->anchor_point.x = x ; graph->drag_point.y = graph->anchor_point.y = y ; graph->in_drag = True ; XDrawLine(XtDisplay(w), XtWindow(w), graph->drag_gc, graph->anchor_point.x, graph->anchor_point.y, graph->drag_point.x, graph->drag_point.y); } static void DragUnit(Graphic * graph, Position x, Position y) { Widget w = graph->work_area ; if (!graph->in_drag) return ; XDrawLine(XtDisplay(w), XtWindow(w), graph->drag_gc, graph->anchor_point.x, graph->anchor_point.y, graph->drag_point.x, graph->drag_point.y); graph->drag_point.x = x ; graph->drag_point.y = y ; XDrawLine(XtDisplay(w), XtWindow(w), graph->drag_gc, graph->anchor_point.x, graph->anchor_point.y, graph->drag_point.x, graph->drag_point.y); } static Boolean NearPoint (XPoint point, Position x, Position y) { #define ERROR 5 if ((point.x > x - ERROR) && (point.x < x + ERROR) && (point.y > y - ERROR) && (point.y < y + ERROR)) return True ; else return False ; } static void EndUnit(Graphic * graph, Position x, Position y) { Widget w = graph->work_area ; Cardinal num_points ; /* no matter what happens, we need to remove the current rubber band */ XDrawLine(XtDisplay(w), XtWindow(w), graph->drag_gc, graph->anchor_point.x, graph->anchor_point.y, graph->drag_point.x, graph->drag_point.y); /* if the given point if the same as the anchor, we're done with this polyline, exit drag mode and be ready for the next graphic unit, i.e increment num_graphics */ if (NearPoint(graph->anchor_point, x, y)) { graph->in_drag = False ; /* now see if a new unit needs to be created */ if (graph->graphics[graph->num_graphics].num_points) { graph->graphics[graph->num_graphics].type = POLYLINE ; if (graph->num_graphics < MAX_GRAPH) graph->num_graphics ++ ; else printf("The graphic buffer is full, overwrite the last...\n"); } } else { /* draw the real line and store it in the structure */ XDrawLine(XtDisplay(w), XtWindow(w), XDefaultGC(XtDisplay(w),XDefaultScreen(XtDisplay(w))), graph->anchor_point.x, graph->anchor_point.y, x, y); /* first point in a unit is actually special */ num_points = graph->graphics[graph->num_graphics].num_points ; if (num_points == 0) { graph->graphics[graph->num_graphics].points[num_points].x = graph->anchor_point.x ; graph->graphics[graph->num_graphics].points[num_points].y = graph->anchor_point.y ; graph->graphics[graph->num_graphics].num_points ++ ; num_points ++ ; } graph->graphics[graph->num_graphics].points[num_points].x = x ; graph->graphics[graph->num_graphics].points[num_points].y = y ; if (graph->graphics[graph->num_graphics].num_points < MAX_POINT) graph->graphics[graph->num_graphics].num_points ++ ; else printf("The unit buffer is full, overwrite the last...\n"); /* now start the new unit */ graph->drag_point.x = graph->anchor_point.x = x ; graph->drag_point.y = graph->anchor_point.y = y ; XDrawLine(XtDisplay(w), XtWindow(w), graph->drag_gc, graph->anchor_point.x, graph->anchor_point.y, graph->drag_point.x, graph->drag_point.y); } } static void DeleteUnit(Graphic * graph, Position x, Position y) { Widget w = graph->work_area ; Cardinal i,j ; int a = -1 ; /* try to find a unit under this point */ for (i=0; (i < graph->num_graphics) && (a == -1); i++) { for (j=0; j < graph->graphics[i].num_points; j++) { if (NearPoint(graph->graphics[i].points[j], x, y)) { a = i ; break ; } } } if (a != -1) { /* found a unit under the current point, delete and redisplay */ for (i = a ; i < graph->num_graphics ; i++) { graph->graphics[i] = graph->graphics[i+1] ; } graph->num_graphics -- ; XClearArea(XtDisplay(w), XtWindow(w), 0, 0, graph->old_width, graph->old_height, True); } } motif-2.3.8/demos/programs/draw/README0000644000175000017500000000056012672140200014334 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:03:06 drk $ */ A ScrolledWindow/DrawingArea graphic demo. You'll be presented with a canvas in which you can interactively draw lines or create buttons. Read the man page and use the help system to get more information. This demo is Editres aware. Do something like: XENVIRONMENT=XmdDraw draw Daniel Dardailler. motif-2.3.8/demos/programs/draw/draw.man0000644000175000017500000000305112672140200015104 00000000000000.\" $XConsortium: draw.man /main/4 1995/07/17 10:46:58 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH draw 1X MOTIF "Demonstration programs" .SH NAME \*Ldraw\*O\ - a ScrolledWindow/DrawingArea graphic demo. .SH SYNOPSIS .sS \*Ldraw\*O .sE .SH DESCRIPTION \*LDraw\*O provides a demonstration of using a DrawingArea in an AUTOMATIC ScrolledWindow. .SH Files .nf .ta 1.2i XmdDraw: the app-default file is very important for usability. Try running something like: (XENVIRONMENT=XmdDraw draw) .fi .SH X Defaults The class of this application is \fIXmdDraw\fR. .SH Editres: Draw is Editres aware, so you can use 'editres' to see the names of the widgets in the instance hierarchy. motif-2.3.8/demos/programs/draw/XmdDraw.ad0000644000175000017500000000411712672140200015332 00000000000000! $XConsortium: XmdDraw.ad /main/4 1995/07/17 18:52:43 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY *comw.scrolledWindowChildType:XmCOMMAND_WINDOW ! map data draw.lines: 77_97, 73_123, 152_177, 171_243, 158_335, 117_399, 270_455, 314_408, 357_385, 382_382, 421_388, 436_396, 445_400, 477_378, 513_357, 467_241, 447_262, 483_144, 481_95, 359_8, 334_4, 292_4, 259_34, 211_63, 180_40, 156_49, 172_92, 77_97 draw.towns: Paris, Marseille, Nice, Perigueux, Grenoble, ATLANTIC, MEDITERRANEE *Paris.x: 292 *Paris.y: 114 *Marseille.x: 391 *Marseille.y: 386 *Nice.x: 497 *Nice.y: 349 *Perigueux.x: 216 *Perigueux.y: 293 *Grenoble.x: 436 *Grenoble.y: 296 *ATLANTIC.x: 24 *ATLANTIC.y: 242 *ATLANTIC.background: blue *MEDITERRANEE.background: blue *MEDITERRANEE.x: 442 *MEDITERRANEE.y: 466 ! numeral *work_area.width:1000 *work_area.height:1000 draw.width: 600 draw.height:500 *XmScale.minimum: 100 *XmScale.maximum: 16000 !labels *scale_w.titleString: Width *scale_h.titleString: Height ! color and font stuff *topShadowColor: white !*background: lightgrey *XmMainWindow.background: wheat2 !*work_area.background: blue *XmScale.background: wheat2 *comw.spacing:0 *fontList:-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-* *highlightColor:Black *autoUnmanage: True *help_manager.helpFile: draw motif-2.3.8/demos/programs/draw/Makefile.am0000644000175000017500000000060313145162623015517 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/draw datadir = ${prefix}/share/Xm/draw bin_PROGRAMS = draw draw_SOURCES = draw.c EXTRA_DIST = XmdDraw.ad README draw.help draw.man data_DATA = $(EXTRA_DIST) $(draw_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/earth/0000755000175000017500000000000013211513007013700 500000000000000motif-2.3.8/demos/programs/earth/earth.man0000644000175000017500000000267112672140200015427 00000000000000.\" $XConsortium: earth.man /main/4 1995/07/17 10:47:09 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH earth 1X MOTIF "Demonstration programs" .SH NAME \*Learth\*O\ - a shape extension/animation demo. .SH SYNOPSIS .sS \*Learth\*O [-speed number] .sE .SH DESCRIPTION \*LEarth\*O provides a demonstration of using a shaped window within a Motif application and mwm. The speed argument is a number between -100,100. .SH X Defaults The class of this application is \fIXmdEarth\fR. Earth supports the following application resources: speed, background, foreground. motif-2.3.8/demos/programs/earth/earth.c0000644000175000017500000002427512672140561015114 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: earth.c /main/5 1995/07/14 09:41:16 drk $" #endif #endif /*************************************************************************** * earth. * This demo illustrates the use of the R4 shape extension and Motif. * Author: Daniel Dardailler. * * Effects by: Andrew deBlois ***************************************************************************/ #define APP_CLASS "XmdEarth" #include #include #include #include #include /* R4 header required */ #include "terre.xbm" /* can cause compilation problem with some gcc version, due of the size of the bitmap array */ /*** Application default stuff */ typedef struct { int speed; XtIntervalId timeoutID; Pixel foreground ; Pixel background ; Boolean persue; } ApplicationData, *ApplicationDataPtr; ApplicationData AppData; #define PERSUE_ON_VALUE 94 #define PERSUE_OFF_VALUE -94 #define XmNspeed "speed" #define XmCSpeed "Speed" #define XmNpersue "persue" #define XmCPersue "Persue" static XtResource resources[] = { { XmNspeed, XmCSpeed, XmRInt, sizeof(int), XtOffsetOf (ApplicationData, speed), XmRImmediate, (caddr_t) 50 }, /* overwrite the default colors (doing that will lead to weird behavior if you specify -fg or -bg on the command line, but I really don't care, it's easier to use the standard names) */ { XmNforeground, XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf (ApplicationData, foreground), XmRString, "brown"}, { XmNbackground, XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf (ApplicationData, background), XmRString, "turquoise"}, { XmNpersue, XmCPersue, XmRBoolean, sizeof (Boolean), XtOffsetOf (ApplicationData, persue), XmRImmediate, (caddr_t) 0} }; static XrmOptionDescRec options[] = { {"-speed", "*speed", XrmoptionSepArg, NULL}, } ; /*** end of Application default stuff */ static XtAppContext app_con; static Widget toplevel, draw ; static Pixmap pterre ; static GC gc ; static int n ; static void Syntax() ; static void input_callback(); static void expose_callback(); static void speed_callback() ; static void NextBitmap (); int delayInterval (speed) /**************************/ int speed; { double maxDelay = 1000.0; double val = (double)(abs(speed)); return (int)( maxDelay / val ); } char *fallback[] = { /* too bad there is no real converter for that stuff! */ "*mwmDecorations: 0", "*XmDialogShell*mwmDecorations: 1", NULL }; int main(argc, argv) int argc; char **argv ; /**************************************/ { Arg args[10] ; Cardinal n; XGCValues values; XtGCMask valueMask; Pixmap shape_mask ; XGCValues xgcv; GC shapeGC ; int shape_event_base, shape_error_base; /* just used as dummy parameters */ /* Initialize, using my options */ toplevel = XtAppInitialize(&app_con, APP_CLASS, options, XtNumber(options), &argc, argv, fallback, NULL, 0); /* if a bad option was reached, XtAppInitialize should let it */ if (argc > 1) Syntax(argv[0]) ; /* read the programmer app default */ XtGetApplicationResources(toplevel, (XtPointer)&AppData, resources, XtNumber(resources), NULL, 0); /* create a fixed size drawing area + callback for dialog popup */ n = 0 ; XtSetArg(args[n], XmNwidth, 64); n++ ; XtSetArg(args[n], XmNheight, 64); n++ ; draw = XmCreateDrawingArea (toplevel, "draw", args, n); XtManageChild(draw); XtAddCallback(draw,XmNinputCallback,(XtCallbackProc)input_callback,NULL); XtAddCallback(draw,XmNexposeCallback,(XtCallbackProc)expose_callback,NULL); XtRealizeWidget(toplevel); /* create the big bitmap on the server */ pterre = XCreateBitmapFromData (XtDisplay(toplevel),XtWindow(toplevel), (char *)terre_bits,terre_width,terre_height) ; /* create a GC for the earth colors */ valueMask = GCForeground | GCBackground ; values.foreground = AppData.foreground ; values.background = AppData.background ; gc = XtGetGC ((Widget) toplevel, valueMask , &values); /* if there is a shape extension, use it */ if (XShapeQueryExtension (XtDisplay (draw), &shape_event_base, &shape_error_base)) { shape_mask = XCreatePixmap (XtDisplay (draw), XtWindow (draw), 64, 64, 1); shapeGC = XCreateGC (XtDisplay (draw), shape_mask, 0, &xgcv); /* erase the pixmap as a mask */ XSetForeground (XtDisplay (draw), shapeGC, 0); XFillRectangle (XtDisplay (draw), shape_mask, shapeGC, 0,0, 64,64); XSetForeground (XtDisplay (draw), shapeGC, 1); /* draw the bounding/clipping shape : a circle */ XFillArc(XtDisplay (draw), shape_mask, shapeGC, 0,0, 64,64, 0,23040); /* shape the parent for event managing and the widget for drawing */ XShapeCombineMask (XtDisplay (toplevel), XtWindow (toplevel), ShapeBounding, 0,0, shape_mask, ShapeSet); XShapeCombineMask (XtDisplay (draw), XtWindow (draw), ShapeClip, 0,0, shape_mask, ShapeSet); XFreePixmap (XtDisplay (draw), shape_mask); /* don't ask me why I use alternatively draw and toplevel as a parameter of XtDisplay, it doesn't matter at all */ } else { fprintf(stderr, "Bad news: there is no shape extension on your server...\n"); } /* animation done in background */ AppData.timeoutID = XtAppAddTimeOut(app_con, delayInterval(AppData.speed), NextBitmap, NULL); XtAppMainLoop(app_con); return 0; /* make compiler happy */ } static void NextBitmap (client_data, id) /****************************************************/ XtPointer client_data; XtIntervalId *id; { AppData.timeoutID = 0; if (AppData.speed != 0) { if (XtIsRealized(draw)) { Position x, y; if (AppData.speed > 0) n = (n>28)?0:n+1; else n = (n>0)?n-1:29; XCopyPlane (XtDisplay(draw), pterre, XtWindow(draw), gc, 0, 64*n, 64, 64, 0, 0, 1); if (AppData.persue) { Position x, y; int mx, my, ji; Window jw; unsigned int jk; XtVaGetValues(toplevel, XmNx, &x, XmNy, &y, NULL); XQueryPointer(XtDisplay(toplevel), XtWindow(toplevel), &jw, &jw, &mx, &my, &ji, &ji, &jk); XtVaSetValues(toplevel,XmNx, x+((mx-x)/10),XmNy, y+((my-y)/10),NULL); } } AppData.timeoutID = XtAppAddTimeOut(app_con, delayInterval(AppData.speed), NextBitmap, NULL); } } static void expose_callback(widget, tag, callback_data) /****************************************************/ Widget widget ; XtPointer tag ; XtPointer callback_data ; { XCopyPlane (XtDisplay(draw), pterre, XtWindow(draw), gc, 0, 64*n, 64, 64, 0, 0, 1); } static void input_callback(widget, tag, callback_data) /****************************************************/ Widget widget ; XtPointer tag ; XtPointer callback_data ; { XmDrawingAreaCallbackStruct * dacb = (XmDrawingAreaCallbackStruct *) callback_data ; static Widget speed_dialog = NULL ; Widget speed_scale ; Arg args[15] ; Cardinal n; XmString title_string; if ((dacb->event->type == ButtonPress) && (dacb->event->xbutton.button == Button3)) { if (speed_dialog == NULL) { speed_dialog = XmCreateFormDialog(toplevel, "Speed control", NULL, 0) ; n = 0 ; title_string = XmStringGenerate("rotation speed", NULL, XmCHARSET_TEXT, NULL); XtSetArg(args[n], XmNtitleString, title_string); n++ ; XtSetArg(args[n], XmNshowValue, True); n++ ; XtSetArg(args[n], XmNvalue, AppData.speed); n++ ; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++ ; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNleftPosition, 10); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNrightPosition, 90); n++; XtSetArg(args[n], XmNminimum, -100); n++; XtSetArg(args[n], XmNmaximum, 100); n++; speed_scale = XmCreateScale(speed_dialog, "speed_scale", args, n) ; XtAddCallback(speed_scale,XmNdragCallback, (XtCallbackProc)speed_callback,NULL); XtAddCallback(speed_scale,XmNvalueChangedCallback, (XtCallbackProc)speed_callback,NULL); XtManageChild(speed_scale); } XtManageChild(speed_dialog); if (AppData.speed == PERSUE_ON_VALUE) AppData.persue = TRUE; else if (AppData.speed == PERSUE_OFF_VALUE) AppData.persue = FALSE; } } static void speed_callback(widget, tag, callback_data) /******************************************************/ Widget widget ; XtPointer tag ; XtPointer callback_data ; { XmScaleCallbackStruct * scb = (XmScaleCallbackStruct *) callback_data ; if ((AppData.speed == 0) && (scb->value != 0)) { AppData.speed = scb->value; if (AppData.timeoutID != 0) XtRemoveTimeOut(AppData.timeoutID); XtAppAddTimeOut(app_con, delayInterval(AppData.speed), NextBitmap, NULL); } else AppData.speed = scb->value ; } static void Syntax(com) char * com ; /**********************************/ { fprintf(stderr, "%s understands all standard Xt options, plus:\n",com); fprintf(stderr, " -speed: -100,100 (earth rotation speed)\n"); } motif-2.3.8/demos/programs/earth/Makefile.in0000644000175000017500000005472413211512766015714 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = earth$(EXEEXT) subdir = demos/programs/earth ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_earth_OBJECTS = earth.$(OBJEXT) earth_OBJECTS = $(am_earth_OBJECTS) earth_LDADD = $(LDADD) earth_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(earth_SOURCES) DIST_SOURCES = $(earth_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/earth build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/earth datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in earth_SOURCES = earth.c EXTRA_DIST = terre.xbm earth.man README data_DATA = $(EXTRA_DIST) $(earth_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/earth/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/earth/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list earth$(EXEEXT): $(earth_OBJECTS) $(earth_DEPENDENCIES) $(EXTRA_earth_DEPENDENCIES) @rm -f earth$(EXEEXT) $(AM_V_CCLD)$(LINK) $(earth_OBJECTS) $(earth_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earth.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/earth/terre.xbm0000644000175000017500000027544312672140200015471 00000000000000/* $XConsortium: terre.xbm /main/4 1995/07/17 18:21:18 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define terre_width 64 #define terre_height 1920 static unsigned char terre_bits[] = { 0x00, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x01, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xdc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xdc, 0xff, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0xd8, 0xff, 0x03, 0x00, 0x00, 0xe0, 0x00, 0xe0, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x78, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x1c, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x0e, 0x00, 0x80, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0x03, 0x00, 0xf0, 0x21, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0xf0, 0x80, 0xfb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, 0xf2, 0xff, 0x01, 0x40, 0x00, 0x00, 0xa0, 0x1f, 0x80, 0xff, 0x03, 0x20, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xdf, 0x0f, 0x08, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3e, 0x1f, 0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7d, 0x18, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf9, 0x19, 0x04, 0x00, 0x80, 0xff, 0xff, 0xff, 0xfb, 0x31, 0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf7, 0x21, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe7, 0x21, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xef, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x7f, 0x40, 0x04, 0x00, 0x80, 0xff, 0xff, 0xff, 0x1f, 0x40, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1e, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x1e, 0x00, 0x00, 0xfc, 0xf8, 0xff, 0xff, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xff, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x8f, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x80, 0xff, 0xcf, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x67, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x63, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x21, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0xff, 0x21, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0xff, 0x11, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x07, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x86, 0x01, 0x60, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0xe0, 0xfe, 0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0xc6, 0xfc, 0x03, 0x00, 0x00, 0xe0, 0x03, 0x00, 0xce, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x02, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x3e, 0xf4, 0xff, 0x00, 0x80, 0x03, 0x00, 0x00, 0x1e, 0xa0, 0xff, 0x01, 0x80, 0x01, 0x00, 0x00, 0x1c, 0x48, 0xff, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xf0, 0x03, 0x60, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x07, 0x20, 0x00, 0x00, 0x00, 0xfe, 0x9f, 0xfd, 0x07, 0x30, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x38, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x19, 0x38, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xdf, 0x13, 0x38, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbf, 0x0f, 0x24, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x0f, 0x40, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x0f, 0x02, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x0e, 0x02, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x07, 0x20, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x03, 0xf0, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0x01, 0x00, 0x00, 0x7e, 0xfe, 0xff, 0x0f, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0xfc, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x01, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xf0, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xf0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0xf0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x04, 0xe0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x04, 0xc0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0x7f, 0x02, 0x80, 0xff, 0x01, 0x00, 0x00, 0xe0, 0x3f, 0x02, 0x80, 0xff, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x01, 0x80, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x01, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf9, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3c, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0c, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0xc0, 0x1e, 0x00, 0x60, 0xe4, 0x03, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0xa0, 0xfe, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0xc0, 0x07, 0xff, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x80, 0x03, 0xff, 0x01, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x03, 0xf4, 0x01, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x7d, 0xc0, 0x03, 0xe0, 0x03, 0x00, 0x00, 0x80, 0xff, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00, 0x80, 0xff, 0xfb, 0x07, 0x30, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x18, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1e, 0x08, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x08, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x04, 0x01, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0x14, 0x02, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x37, 0x0c, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x37, 0x18, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x2f, 0x18, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x10, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x90, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0xc0, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x80, 0x7f, 0x00, 0x00, 0x80, 0x9f, 0xff, 0x3f, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xc0, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x0f, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x0f, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x2f, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x13, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0x09, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x70, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xc0, 0xf3, 0x01, 0x00, 0xa2, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0xec, 0x07, 0x00, 0x00, 0xf8, 0x3f, 0x01, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x78, 0xf8, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x78, 0xe8, 0x01, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x30, 0xe8, 0x01, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x03, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x06, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0xe0, 0x08, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x70, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x30, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x30, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x30, 0x11, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0xb0, 0x40, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x3f, 0xc0, 0x01, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x80, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x61, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0xf1, 0x03, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0xfa, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0xe7, 0xff, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x80, 0x7f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x9d, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x81, 0x03, 0x70, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0b, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x9f, 0x0f, 0x00, 0x90, 0x02, 0x00, 0x00, 0xe0, 0xdf, 0x1f, 0x00, 0x70, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x31, 0x00, 0x80, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x80, 0xf3, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x02, 0x01, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x38, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x07, 0xc0, 0x07, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0xc0, 0x03, 0x01, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x80, 0x11, 0x02, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x80, 0x1b, 0x18, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x20, 0xfe, 0x01, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x40, 0xff, 0x03, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xf8, 0xfe, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x38, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x38, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x38, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x67, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x0c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x78, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf8, 0x00, 0x40, 0x02, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0x01, 0x80, 0x06, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x02, 0x00, 0x1e, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xf8, 0xff, 0x2f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xdc, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x38, 0x01, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x30, 0x01, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x7c, 0x20, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x3c, 0x20, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x38, 0xc2, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x38, 0x03, 0x06, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x88, 0x7f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0xd0, 0xff, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xef, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x80, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x80, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x00, 0x40, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x40, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x9f, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc3, 0x05, 0x80, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc7, 0x0f, 0x00, 0x02, 0x00, 0x00, 0x80, 0xff, 0xdf, 0x1f, 0x00, 0x06, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x18, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x30, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x40, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, 0xe0, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x03, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x07, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0xc0, 0x1f, 0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0xc0, 0x0f, 0x08, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x87, 0x20, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0xcf, 0x00, 0x03, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xc2, 0x3f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0xe1, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xcc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x1f, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x7c, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xfd, 0x01, 0x08, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x1f, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0xfe, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xe0, 0x21, 0x08, 0x00, 0x00, 0x30, 0x00, 0x00, 0xe0, 0x33, 0xe0, 0x00, 0x00, 0x30, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0xe1, 0x0f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x1f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x83, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x33, 0x06, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x61, 0x08, 0x00, 0x00, 0x00, 0x00, 0xe2, 0xff, 0xe1, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x2f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7e, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x9f, 0x0c, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff, 0x0f, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xff, 0x7f, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x60, 0xf8, 0x7f, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xff, 0xff, 0x33, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc3, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x13, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfb, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xf8, 0xff, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, 0xfc, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf8, 0x7f, 0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x08, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0x04, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xcf, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc1, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0xe1, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0x0c, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x1c, 0xfe, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x80, 0x13, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xf9, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x04, 0xc0, 0xf8, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x06, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x0f, 0x01, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x80, 0x8b, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x41, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1b, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xef, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x83, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x61, 0x00, 0xe6, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x30, 0x00, 0x00, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x10, 0x00, 0x00, 0x06, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xfe, 0x4f, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x80, 0xbf, 0x10, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x9f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x0f, 0x06, 0x00, 0x00, 0x00, 0x00, 0x02, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x1f, 0x7e, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x06, 0x90, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x03, 0x10, 0x02, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x01, 0x00, 0x04, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x26, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x78, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x30, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x30, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x43, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x41, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x61, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x11, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x04, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x38, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x09, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xf0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x8f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x67, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x81, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x83, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x08, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x23, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x63, 0x08, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x06, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0xe7, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0xe3, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xe1, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x08, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x08, 0x02, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x0d, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x08, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x88, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x20, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xd8, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x38, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x38, 0xfe, 0xff, 0x1f, 0x01, 0x00, 0x00, 0x00, 0x3c, 0xfe, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x7c, 0xf8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3c, 0xf8, 0x01, 0x01, 0x00, 0x00, 0x00, 0x06, 0x0c, 0xe0, 0x03, 0x01, 0x00, 0x00, 0x00, 0x02, 0x0c, 0xe0, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x03, 0x04, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x68, 0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x50, 0x70, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x60, 0x7c, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x60, 0x3c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x08, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x83, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x21, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x61, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x47, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x21, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x9f, 0x21, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x21, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x30, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x04, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe8, 0xe3, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0xc1, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x81, 0x0f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x76, 0x80, 0x07, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x36, 0x80, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x80, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x80, 0x01, 0x40, 0x00, 0x03, 0x00, 0x00, 0x1f, 0x00, 0x02, 0x08, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x16, 0x38, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x2c, 0x1c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x18, 0x3e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x30, 0x1e, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x70, 0xdc, 0xa0, 0x01, 0x00, 0x03, 0x00, 0x00, 0x60, 0x00, 0x80, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0xff, 0x06, 0x00, 0x24, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x24, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x28, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x8f, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x13, 0x02, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x23, 0x02, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x27, 0x03, 0x00, 0x20, 0xfe, 0xff, 0xff, 0xff, 0x87, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xf7, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xe7, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xb8, 0x0f, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0xb8, 0x3f, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00, 0xbc, 0x3f, 0xf0, 0xc7, 0xbf, 0x00, 0x00, 0x00, 0xbc, 0x1f, 0xf0, 0x83, 0x9f, 0x00, 0x00, 0x00, 0xbe, 0x0f, 0xf0, 0x81, 0x3f, 0x00, 0x00, 0x00, 0xbe, 0x03, 0xf0, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x60, 0x00, 0x7e, 0x20, 0x00, 0x00, 0x7e, 0x00, 0x60, 0x00, 0x70, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x60, 0x00, 0x20, 0xc0, 0x00, 0x00, 0xff, 0x01, 0x80, 0x00, 0x02, 0xc0, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x04, 0x88, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x09, 0x0c, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x0a, 0x0e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x8c, 0x0f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x1c, 0x0f, 0x08, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x38, 0x27, 0x78, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10, 0x20, 0xe0, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x3e, 0x03, 0x00, 0x00, 0x00, 0x80, 0x4f, 0x00, 0x3e, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x3c, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00, 0x38, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x38, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfa, 0xff, 0xff, 0xff, 0xbf, 0x01, 0x00, 0x40, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x40, 0xe0, 0xff, 0xff, 0xff, 0x7f, 0x30, 0x00, 0x20, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x08, 0x00, 0xe0, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf0, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0xff, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0xfb, 0x84, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0xfb, 0x0f, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xfc, 0xfb, 0x07, 0xfc, 0xf3, 0x2f, 0x00, 0x00, 0xfc, 0xf3, 0x03, 0xfc, 0xe1, 0x27, 0x00, 0x00, 0xfe, 0xf3, 0x01, 0x7c, 0xc0, 0x0f, 0x04, 0x00, 0xfe, 0x73, 0x00, 0x38, 0x00, 0x1f, 0x04, 0x00, 0xfe, 0x1f, 0x00, 0x38, 0x00, 0x1f, 0x08, 0x00, 0xfe, 0x07, 0x00, 0x38, 0x00, 0x1c, 0x10, 0x00, 0xfe, 0x7f, 0x00, 0x10, 0x00, 0x08, 0x10, 0x00, 0xff, 0x3f, 0x00, 0x40, 0x00, 0x01, 0x10, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x80, 0x02, 0x03, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x87, 0x03, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0xc7, 0x13, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x03, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0xcc, 0x09, 0x07, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x0e, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xf8, 0x63, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x05, 0xf8, 0x33, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0xf8, 0x21, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x21, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0xf0, 0x23, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0xe0, 0x23, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0xe0, 0x03, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x80, 0x03, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x80, 0x03, 0x00, 0x00, 0x00, 0xc0, 0xe3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x00, 0x00, 0xd4, 0xff, 0xff, 0xff, 0xff, 0x87, 0x00, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xa7, 0x00, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x00, 0xe0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0xdf, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xf8, 0xbf, 0x1f, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xf8, 0x3f, 0xbf, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0xf8, 0x7f, 0xff, 0xc1, 0xff, 0xff, 0x0f, 0x00, 0xfc, 0x7f, 0xff, 0x01, 0xff, 0xfc, 0x01, 0x00, 0xfc, 0x7f, 0xfe, 0x00, 0x7e, 0xf8, 0x05, 0x00, 0xfe, 0x7f, 0x7e, 0x00, 0x3e, 0xf0, 0x03, 0x00, 0xfe, 0xff, 0x1e, 0x00, 0x1e, 0xc0, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x0c, 0xc0, 0x07, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x0c, 0x00, 0x07, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x0c, 0x00, 0x02, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x40, 0x00, 0x02, 0xff, 0xff, 0x07, 0x00, 0x00, 0x80, 0x40, 0x02, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x20, 0x60, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x40, 0x61, 0x00, 0xf0, 0xff, 0x01, 0x00, 0x00, 0x80, 0x71, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x80, 0x71, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x33, 0x30, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x20, 0x62, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0xe0, 0xff, 0x08, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xc0, 0x7f, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xc0, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xc0, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x80, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xf4, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x4c, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x06, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x03, 0xfd, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x0f, 0xe0, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x80, 0x0f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x02, 0xc0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xf7, 0xc7, 0xff, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xef, 0x2f, 0xf8, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xef, 0xff, 0xf0, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xcf, 0x7f, 0xc0, 0x3f, 0x3f, 0x00, 0xf8, 0xff, 0xcf, 0x7f, 0x80, 0x1f, 0x3e, 0x00, 0xfc, 0xff, 0x9f, 0x1f, 0x80, 0x0f, 0x7c, 0x00, 0xfc, 0xff, 0x9f, 0x07, 0x80, 0x07, 0x78, 0x00, 0xfc, 0xff, 0xff, 0x01, 0x00, 0x07, 0x78, 0x08, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x07, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x02, 0x40, 0x10, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x08, 0x10, 0x10, 0xdc, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x28, 0x04, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x30, 0x06, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x30, 0x07, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x20, 0x46, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xc6, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xfe, 0x1f, 0x06, 0x00, 0x00, 0x00, 0x70, 0x00, 0xfe, 0x1f, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0xfc, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0xfc, 0x07, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf8, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1f, 0x00, 0xf8, 0x07, 0x01, 0x00, 0x00, 0x00, 0x1f, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfe, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x32, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x70, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x38, 0xb1, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x18, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 0xfc, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x03, 0x00, 0xfe, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0xfd, 0xf1, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0xf9, 0x0b, 0xfe, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0xfb, 0x3f, 0xfc, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xf3, 0x3f, 0xf0, 0xe7, 0x03, 0xe0, 0xff, 0xff, 0xf3, 0x1f, 0xe0, 0xc3, 0x03, 0xf0, 0xff, 0xff, 0xe7, 0x07, 0xe0, 0xc3, 0x03, 0xf0, 0xff, 0xff, 0xef, 0x01, 0xc0, 0x01, 0x07, 0xf0, 0xff, 0xff, 0x5f, 0x00, 0xc0, 0x00, 0x07, 0xf0, 0xff, 0xff, 0x1f, 0x00, 0x80, 0x00, 0x04, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x80, 0x00, 0x04, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, 0xe0, 0xfd, 0xff, 0xff, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x21, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x22, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf2, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf4, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x8f, 0x01, 0x00, 0x00, 0x40, 0x00, 0xc0, 0xff, 0xc7, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x20, 0x00, 0x80, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x30, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x10, 0xfb, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xdc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x7c, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x80, 0xc7, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x83, 0xf6, 0xff, 0xff, 0xff, 0x01, 0x00, 0xc0, 0x41, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x03, 0x00, 0xe0, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x07, 0x00, 0xf0, 0x7f, 0xef, 0xff, 0xff, 0xff, 0x07, 0x00, 0xf8, 0xff, 0xff, 0xbf, 0xff, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x7f, 0x7f, 0xfc, 0xff, 0x1f, 0x00, 0xfe, 0xff, 0xff, 0xfe, 0x82, 0xff, 0x1f, 0x00, 0xfe, 0xff, 0xff, 0xfe, 0x0f, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x0f, 0x7c, 0x1e, 0x00, 0xff, 0xff, 0xff, 0xf9, 0x07, 0x7c, 0x1c, 0x00, 0xff, 0xff, 0xff, 0xf9, 0x03, 0x38, 0x1c, 0x80, 0xff, 0xff, 0xff, 0xf3, 0x00, 0x38, 0x18, 0x80, 0xff, 0xff, 0xff, 0x37, 0x00, 0x30, 0x30, 0x80, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x30, 0x20, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x20, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x40, 0x00, 0x00, 0xbe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x90, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x90, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0xb0, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xa0, 0x01, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xe0, 0x01, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x43, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x71, 0x00, 0x00, 0x00, 0x04, 0x00, 0xf0, 0xff, 0x60, 0x00, 0x00, 0x00, 0x04, 0x00, 0xe0, 0x7f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x04, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0x98, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x78, 0xc8, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3c, 0xd0, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0x1c, 0x88, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x03, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfc, 0x03, 0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xcf, 0xfb, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff, 0xef, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0xff, 0xdf, 0x9f, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xbf, 0xbf, 0xf0, 0x1f, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0xff, 0xe1, 0x1f, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xff, 0xc1, 0x37, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xfe, 0x81, 0x33, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xfc, 0x80, 0x23, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3d, 0x00, 0x63, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x43, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x03, 0x00, 0x02, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x01, 0xc0, 0xe7, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x01, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x80, 0x01, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x80, 0x03, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x80, 0x07, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 0xff, 0x21, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 0xff, 0x31, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 0x7f, 0x18, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xfc, 0x3f, 0x18, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xf8, 0x3f, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf8, 0x3f, 0x0c, 0x00, 0x00, 0x08, 0x00, 0x00, 0xf8, 0x1f, 0x04, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x40, 0x00, 0x8c, 0xf9, 0xff, 0x03, 0x00, 0x00, 0x20, 0x00, 0xce, 0xff, 0xff, 0x07, 0x00, 0x00, 0x18, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x04, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf9, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0x07, 0xda, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0x03, 0x90, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x7d, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0xf3, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xfd, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0xf3, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xef, 0x07, 0x1f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xef, 0x3f, 0x1e, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xdf, 0x3f, 0x1c, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x9f, 0x3f, 0x18, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xbf, 0x1f, 0x18, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0x0f, 0x18, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x03, 0x10, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x10, 0x02, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x03, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x07, 0x00, 0x03, 0x00, 0xf0, 0xf3, 0xff, 0xff, 0x07, 0x00, 0x07, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 0x07, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x07, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x04, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x06, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x07, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x03, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x03, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x01, 0x00, 0x78, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x01, 0x00, 0x70, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00}; motif-2.3.8/demos/programs/earth/README0000644000175000017500000000125212672140200014501 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:03:26 drk $ */ Earth ----- This demo demonstrates the use of the shape extension within Motif and the Motif WindowManager. It starts a decoration-less small (64x64 pixels) rotating earth on your screen that you can control using a dialog scale popped up with Btn3 on the earth itself. The following resources are supported: speed Sets the rotation speed. Default = 50. foreground Sets the color of land. Default = brown background Sets the color of water. Default = turquoise It also supports the command-line option: -speed Sets the rotation speed. ------ Enjoy, - Daniel Dardailler - Andrew deBlois motif-2.3.8/demos/programs/earth/Makefile.am0000644000175000017500000000052213145162623015665 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/earth datadir = ${prefix}/share/Xm/earth bin_PROGRAMS = earth earth_SOURCES = earth.c EXTRA_DIST = terre.xbm earth.man README data_DATA = $(EXTRA_DIST) $(earth_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/popups/0000755000175000017500000000000013211513007014123 500000000000000motif-2.3.8/demos/programs/popups/Makefile.in0000644000175000017500000005510013211512766016124 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = autopopups$(EXEEXT) subdir = demos/programs/popups ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_autopopups_OBJECTS = autopopups.$(OBJEXT) autopopups_OBJECTS = $(am_autopopups_OBJECTS) autopopups_LDADD = $(LDADD) autopopups_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(autopopups_SOURCES) DIST_SOURCES = $(autopopups_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/autopopups build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/autopopups datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in autopopups_SOURCES = autopopups.c EXTRA_DIST = README autopopups.man data_DATA = $(EXTRA_DIST) $(autopopups_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/popups/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/popups/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list autopopups$(EXEEXT): $(autopopups_OBJECTS) $(autopopups_DEPENDENCIES) $(EXTRA_autopopups_DEPENDENCIES) @rm -f autopopups$(EXEEXT) $(AM_V_CCLD)$(LINK) $(autopopups_OBJECTS) $(autopopups_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/autopopups.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/popups/autopopups.c0000644000175000017500000002311613066310437016443 00000000000000/* $XConsortium: autopopups.c /main/5 1995/07/15 20:45:56 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include XtAppContext context; #define APP_CLASS "AutomaticPopups" Widget exitpb; void QuitAppl(Widget, char *, XmPushButtonCallbackStruct *); void ExposeCB(Widget, char *, XmDrawingAreaCallbackStruct *); void ButtonEventHandler(Widget, XtPointer, XEvent*); void PopupHandlerCB(Widget, XtPointer, XmPopupHandlerCallbackStruct *); void addButton(Widget, char*); void addChildren(Widget, char*); int circlex, circley, circled; int rectx, recty, recth, rectw; Widget popup1, popup2, popup3, popup4, popup5; int main(int argc, char **argv) { Widget shell; Widget frame1, frame2; Widget da1, da2; Widget btn1, btn2, label1, label2, btn3, sbtn1; Widget explain; Arg args[10]; int count; XmString str, tmp1, tmp2; shell = XtVaAppInitialize(&context, APP_CLASS, NULL, 0, &argc, argv, NULL, NULL); frame1 = XmCreateFrame(shell, "outerframe", NULL, 0); XtManageChild(frame1); count = 0; XtSetArg(args[count], XmNpopupEnabled, XmPOPUP_AUTOMATIC_RECURSIVE); count++; popup1 = XmCreatePopupMenu(frame1, "popupOF", args, count); addChildren(popup1, "OuterFrameMenu"); str = XmStringCreateLocalized("OuterFrame"); count = 0; XtSetArg(args[count], XmNlabelString, str); count++; XtSetArg(args[count], XmNframeChildType, XmFRAME_TITLE_CHILD); count++; label1 = XmCreateLabel(frame1, "label1", args, count); XtManageChild(label1); XmStringFree(str); count = 0; XtSetArg(args[count], XmNheight, 500); count++; XtSetArg(args[count], XmNwidth, 500); count++; XtSetArg(args[count], XmNframeChildType, XmFRAME_WORKAREA_CHILD); count++; XtSetArg(args[count], XmNresizePolicy, XmRESIZE_NONE); count++; da1 = XmCreateDrawingArea(frame1, "da1", args, count); XtManageChild(da1); count = 0; XtSetArg(args[count], XmNx, 100); count++; XtSetArg(args[count], XmNy, 100); count++; frame2 = XmCreateFrame(da1, "innerframe", args, count); XtManageChild(frame2); count = 0; XtSetArg(args[count], XmNpopupEnabled, XmPOPUP_AUTOMATIC_RECURSIVE); count++; popup2 = XmCreatePopupMenu(frame2, "popupIF", args, count); addChildren(popup2, "InnerFrameMenu"); addButton(popup2, "Make me different"); str = XmStringCreateLocalized("InnerFrame"); count = 0; XtSetArg(args[count], XmNlabelString, str); count++; XtSetArg(args[count], XmNframeChildType, XmFRAME_TITLE_CHILD); count++; label2 = XmCreateLabel(frame2, "label2", args, count); XtManageChild(label2); XmStringFree(str); count = 0; XtSetArg(args[count], XmNheight, 300); count++; XtSetArg(args[count], XmNwidth, 300); count++; XtSetArg(args[count], XmNframeChildType, XmFRAME_WORKAREA_CHILD); count++; XtSetArg(args[count], XmNresizePolicy, XmRESIZE_NONE); count++; da2 = XmCreateDrawingArea(frame2, "da2", args, count); XtManageChild(da2); XtAddCallback(da2, XmNexposeCallback, (XtCallbackProc) ExposeCB, NULL); XtAddCallback(da2, XmNpopupHandlerCallback, (XtCallbackProc) PopupHandlerCB, NULL); count = 0; str = XmStringCreateLocalized( "Click Button3 anywhere to cause a popup menu"); tmp1 = XmStringConcat(str, XmStringSeparatorCreate()); XmStringFree(str); tmp2 = XmStringCreateLocalized( "to be posted. Note that the posted menu"); str = XmStringConcat(tmp1, tmp2); XmStringFree(tmp1); XmStringFree(tmp2); tmp1 = XmStringConcat(str, XmStringSeparatorCreate()); XmStringFree(str); tmp2 = XmStringCreateLocalized( "differs depending on where you click."); str = XmStringConcat(tmp1, tmp2); XmStringFree(tmp1); XmStringFree(tmp2); XtSetArg(args[count], XmNx, 10); count++; XtSetArg(args[count], XmNy, 200); count++; XtSetArg(args[count], XmNlabelString, str); count++; XtSetArg(args[count], XmNalignment, XmALIGNMENT_BEGINNING); count++; explain = XmCreateLabelGadget(da2, "Explain", args, count); XtManageChild(explain); XmStringFree(str); circlex = 40; circley = 120; circled = 30; rectx = 80; recty = 120; recth = 30; rectw = 60; str = XmStringCreateLocalized("Quit"); count = 0; XtSetArg(args[count], XmNlabelString, str); count++; XtSetArg(args[count], XmNx, 40); count++; XtSetArg(args[count], XmNy, 40); count++; btn1 = XmCreatePushButton(da2, "pb1", args, count); XtManageChild(btn1); XtAddCallback(btn1, XmNactivateCallback, (XtCallbackProc) QuitAppl, NULL); str = XmStringCreateLocalized("Another Button With no Menu"); count = 0; XtSetArg(args[count], XmNlabelString, str); count++; XtSetArg(args[count], XmNx, 40); count++; XtSetArg(args[count], XmNy, 80); count++; btn3 = XmCreatePushButton(da2, "pb3", args, count); XtManageChild(btn3); count = 0; XtSetArg(args[count], XmNpopupEnabled, XmPOPUP_AUTOMATIC); count++; popup4 = XmCreatePopupMenu(btn1, "popupBtn1", args, count); addChildren(popup4, "SharedMenu"); addButton(popup4, "Do something more"); addButton(popup4, "What else?"); str = XmStringCreateLocalized("PushMe"); count = 0; XtSetArg(args[count], XmNlabelString, str); count++; XtSetArg(args[count], XmNx, 40); count++; XtSetArg(args[count], XmNy, 40); count++; btn2 = XmCreatePushButton(da1, "pb2", args, count); XtManageChild(btn2); str = XmStringCreateLocalized("I share a menu"); count = 0; XtSetArg(args[count], XmNlabelString, str); count++; XtSetArg(args[count], XmNx, 240); count++; XtSetArg(args[count], XmNy, 40); count++; sbtn1 = XmCreatePushButton(da1, "sharepb1", args, count); XtManageChild(sbtn1); /* Associate a menu with this button */ XmAddToPostFromList(popup4, sbtn1); count = 0; XtSetArg(args[count], XmNpopupEnabled, XmPOPUP_AUTOMATIC); count++; popup3 = XmCreatePopupMenu(btn2, "popupBtn2", args, count); addChildren(popup3, "Button2Menu"); addButton(popup3, "Do something more"); count = 0; XtSetArg(args[count], XmNpopupEnabled, True); count++; popup4 = XmCreatePopupMenu(da2, "PopupObjects1", args, count); addChildren(popup4, "ObjectMenu"); addButton(popup4, "Flip"); addButton(popup4, "Size"); addButton(popup4, "Stretch"); XtRealizeWidget(shell); XtAppMainLoop(context); return 0; /* make compiler happy */ } void QuitAppl(Widget w, char *i, XmPushButtonCallbackStruct *e) { exit(0); } void addChildren(Widget popup, char* label) { XmString str; Arg args[2]; Widget child; str = XmStringCreateLocalized(label); XtSetArg(args[0], XmNlabelString, str); child = XmCreateLabelGadget(popup, "Title", args, 1); XtManageChild(child); XmStringFree(str); child = XmCreateSeparatorGadget(popup, "Sep", NULL, 0); XtManageChild(child); addButton(popup, "Cut"); addButton(popup, "Copy"); addButton(popup, "Paste"); } void addButton(Widget parent, char* label) { Widget ch; XmString str; Arg args[2]; str = XmStringCreateLocalized(label); XtSetArg(args[0], XmNlabelString, str); ch = XmCreatePushButtonGadget(parent, label, args, 1); XtManageChild(ch); XmStringFree(str); } GC drawGC = NULL; void ExposeCB(Widget da, char *ig, XmDrawingAreaCallbackStruct *cbs) { Arg args[2]; XGCValues gcv; Pixel fg; Pixel bg; if (drawGC == NULL) { XtSetArg (args[0], XmNforeground, &fg); XtSetArg (args[1], XmNbackground, &bg); XtGetValues (da, args, 2); gcv.foreground = fg; gcv.background = bg; gcv.line_width = 2; drawGC = XtGetGC (da, GCForeground | GCBackground | GCLineWidth, &gcv); } XDrawArc(XtDisplay(da), XtWindow(da), drawGC, circlex, circley, circled, circled, 0, (360 * 64)); XDrawRectangle(XtDisplay(da), XtWindow(da), drawGC, rectx, recty, rectw, recth); } void PopupHandlerCB(Widget da, XtPointer ignore, XmPopupHandlerCallbackStruct *phcs) { int radius; int dx, dy; XButtonEvent *bevent = (XButtonEvent *) phcs -> event; int eventx, eventy; Position wox, woy; /* Translate event coordinates to this widget */ /* First get origin of this widget */ XtTranslateCoords(da, 0, 0, &wox, &woy); /* Now calculate relative offset */ eventx = bevent -> x_root - wox; eventy = bevent -> y_root - woy; /* Check for hit in circle or rectangle to post special menus */ dx = eventx - rectx; dy = eventy - recty; if (dx > 0 && dx < rectw && dy > 0 && dy < recth) { phcs -> menuToPost = popup4; return; } dx = eventx - circlex; dy = eventy - circley; dx -= circled / 2; dy -= circled / 2; radius = (dx * dx) + (dy * dy); if (radius < ((circled * circled) / 4)) phcs -> menuToPost = popup4; } motif-2.3.8/demos/programs/popups/README0000644000175000017500000000063612672140200014731 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:08:10 drk $ */ autopopups ---------- Autopopups was a small quick and dirty program written to demonstrate the automatic popup menu system enhancements in 2.0. Various menus exist on different widgets and will be posted. The use of the XmNpopupHandlerCallback is also show on the drawing area widget (see the menus which post on the circle and rectangle). motif-2.3.8/demos/programs/popups/autopopups.man0000644000175000017500000000254212672140200016763 00000000000000.\" $XConsortium: autopopups.man /main/4 1995/07/17 10:48:39 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH autopopups 1X MOTIF "Demonstration programs" .SH NAME \*Lautopopups\*O\(emAutomatic popup menu demonstration .SH SYNOPSIS .sS \*Lautopopups\*O .sE .SH DESCRIPTION \*Lautopopups\*O demonstrates the use of the new automatic popup features in 2.0. Note the different popup menus which are posted as you press button3 on the different objects. Press the Quit button to exit. motif-2.3.8/demos/programs/popups/Makefile.am0000644000175000017500000000055413145162623016115 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/autopopups datadir = ${prefix}/share/Xm/autopopups bin_PROGRAMS = autopopups autopopups_SOURCES = autopopups.c EXTRA_DIST = README autopopups.man data_DATA = $(EXTRA_DIST) $(autopopups_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/getsubres/0000755000175000017500000000000013211513007014600 500000000000000motif-2.3.8/demos/programs/getsubres/Makefile.in0000644000175000017500000005521013211512766016603 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = getsubres$(EXEEXT) subdir = demos/programs/getsubres ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_getsubres_OBJECTS = getsubres.$(OBJEXT) getsubres_OBJECTS = $(am_getsubres_OBJECTS) getsubres_LDADD = $(LDADD) getsubres_DEPENDENCIES = ../../lib/Xmd/libXmd.a \ ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(getsubres_SOURCES) DIST_SOURCES = $(getsubres_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/getsubres build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/getsubres datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = getsubres.help getsubres.man README getsubres_SOURCES = getsubres.c data_DATA = $(EXTRA_DIST) $(getsubres_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/getsubres/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/getsubres/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list getsubres$(EXEEXT): $(getsubres_OBJECTS) $(getsubres_DEPENDENCIES) $(EXTRA_getsubres_DEPENDENCIES) @rm -f getsubres$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getsubres_OBJECTS) $(getsubres_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsubres.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/getsubres/getsubres.man0000644000175000017500000000437512672140200017232 00000000000000.\" $XConsortium: getsubres.man /main/5 1996/04/22 23:15:06 pascale $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH getsubres 1X MOTIF "Demonstration programs" .SH NAME \*Lgetsubres\*O\ - a viewer of Motif widget resources .SH SYNOPSIS .sS \*Lgetsubres\*O [All|] .sE .SH DESCRIPTION \*LGetsubres\*O uses XmGetSecondaryResourceData to fetch the widget resources that XtGetResourceList won't see. You can specify which widget resources to display on the command line by using the syntax "getsubres " with one of those names: Object, RectObj, Widget, Core, Composite, Constraint, Primitive, ScrollBar, ArrowB, List, Separator, TextF, Label, DrawnB, PushB, ToggleB, CascadeB, Text, Gadget, ArrowBG, SeparatorG, LabelG, PushBG, ToggleBG, CascadeBG, Manager, BulletinB, DrawingA, Frame, MainW, Form, RowCol, ScrolledW, PanedW, SelectionB, FileSB, MessageB, Scale, Command, Display, Screen, DragContext, DragIcon, DropSiteMgr, DropTransfer, DragOverS, Shell, OverrideShell, WMShell, MenuShell, VendorS, ToplevelShell, ApplicationShell, TransientShell, DialogShell, Container, IconGadget, Notebook, ComboBox, SpinBox. (default is Widget) Or you can use "getsubres All". .SH X Defaults The class of this application is \fIXmdGetsubres\fR. .SH Editres: Getsubres is Editres aware, so you can use 'editres' to see the names of the widgets in the instance hierarchy. motif-2.3.8/demos/programs/getsubres/getsubres.c0000644000175000017500000003720312672140200016675 00000000000000/* $XConsortium: getsubres.c /main/6 1995/07/15 20:45:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include #include /* This is no your ordinary demo, it displays widget class info and needs a couple of P.h file usually reserved for widget writers */ #include #include #include #include #include #include static void QuitCB (); static void HelpCB (); typedef struct _ClassArrayRec { String name ; WidgetClass class ; } ClassArrayRec ; /* Cannot initialize everything in C */ static ClassArrayRec class_array[] = { { "Object", (WidgetClass) NULL }, { "RectObj", (WidgetClass) NULL }, { "Widget", (WidgetClass) NULL }, { "Core", (WidgetClass) NULL }, { "Composite", (WidgetClass) NULL }, { "Constraint", (WidgetClass) NULL }, { "Primitive", (WidgetClass) NULL }, { "ScrollBar", (WidgetClass) NULL }, { "ArrowB", (WidgetClass) NULL }, { "List", (WidgetClass) NULL }, { "Separator", (WidgetClass) NULL }, { "TextF", (WidgetClass) NULL }, { "Label", (WidgetClass) NULL }, { "DrawnB", (WidgetClass) NULL }, { "PushB", (WidgetClass) NULL }, { "ToggleB", (WidgetClass) NULL }, { "CascadeB", (WidgetClass) NULL }, { "Text", (WidgetClass) NULL }, { "Gadget", (WidgetClass) NULL }, { "ArrowBG", (WidgetClass) NULL }, { "SeparatorG", (WidgetClass) NULL }, { "LabelG", (WidgetClass) NULL }, { "PushBG", (WidgetClass) NULL }, { "ToggleBG", (WidgetClass) NULL }, { "CascadeBG", (WidgetClass) NULL }, { "Manager", (WidgetClass) NULL }, { "BulletinB", (WidgetClass) NULL }, { "DrawingA", (WidgetClass) NULL }, { "Frame", (WidgetClass) NULL }, { "MainW", (WidgetClass) NULL }, { "Form", (WidgetClass) NULL }, { "RowCol", (WidgetClass) NULL }, { "ScrolledW", (WidgetClass) NULL }, { "PanedW", (WidgetClass) NULL }, { "SelectionB", (WidgetClass) NULL }, { "FileSB", (WidgetClass) NULL }, { "MessageB", (WidgetClass) NULL }, { "Scale", (WidgetClass) NULL }, { "Command", (WidgetClass) NULL }, { "Shell", (WidgetClass) NULL }, { "OverrideShell", (WidgetClass) NULL }, { "WMShell", (WidgetClass) NULL }, { "MenuShell", (WidgetClass) NULL }, { "VendorS", (WidgetClass) NULL }, { "ToplevelShell", (WidgetClass) NULL }, { "ApplicationShell", (WidgetClass) NULL }, { "TransientShell", (WidgetClass) NULL }, { "DialogShell", (WidgetClass) NULL }, { "Sash", (WidgetClass) NULL }, { "TearOffB", (WidgetClass) NULL }, { "Display", (WidgetClass) NULL }, { "Screen", (WidgetClass) NULL }, { "DragContext", (WidgetClass) NULL }, { "DragIcon", (WidgetClass) NULL }, { "DropSiteMgr", (WidgetClass) NULL }, { "DropTransfer", (WidgetClass) NULL }, { "DragOverS", (WidgetClass) NULL }, { "GrabShell", (WidgetClass) NULL }, { "IconH", (WidgetClass) NULL }, { "ClipWindow", (WidgetClass) NULL }, { "Container", (WidgetClass) NULL }, { "IconG", (WidgetClass) NULL }, { "Notebook", (WidgetClass) NULL }, { "SpinBox", (WidgetClass) NULL }, { "SimpleSpinBox", (WidgetClass) NULL }, { "ComboBox", (WidgetClass) NULL }, }; /* stupid c compiler */ static void InitClassArray () { int n; n = 0; class_array[n].class = objectClass; n++; class_array[n].class = rectObjClass; n++; class_array[n].class = widgetClass; n++; /* unNamed */ class_array[n].class = coreWidgetClass; n++; class_array[n].class = compositeWidgetClass; n++; class_array[n].class = constraintWidgetClass; n++; class_array[n].class = xmPrimitiveWidgetClass; n++; class_array[n].class = xmScrollBarWidgetClass; n++; class_array[n].class = xmArrowButtonWidgetClass; n++; class_array[n].class = xmListWidgetClass; n++; class_array[n].class = xmSeparatorWidgetClass; n++; class_array[n].class = xmTextFieldWidgetClass; n++; class_array[n].class = xmLabelWidgetClass; n++; class_array[n].class = xmDrawnButtonWidgetClass; n++; class_array[n].class = xmPushButtonWidgetClass; n++; class_array[n].class = xmToggleButtonWidgetClass; n++; class_array[n].class = xmCascadeButtonWidgetClass; n++; class_array[n].class = xmTextWidgetClass; n++; class_array[n].class = xmGadgetClass; n++; class_array[n].class = xmArrowButtonGadgetClass; n++; class_array[n].class = xmSeparatorGadgetClass; n++; class_array[n].class = xmLabelGadgetClass; n++; class_array[n].class = xmPushButtonGadgetClass; n++; class_array[n].class = xmToggleButtonGadgetClass; n++; class_array[n].class = xmCascadeButtonGadgetClass; n++; class_array[n].class = xmManagerWidgetClass; n++; class_array[n].class = xmBulletinBoardWidgetClass; n++; class_array[n].class = xmDrawingAreaWidgetClass; n++; class_array[n].class = xmFrameWidgetClass; n++; class_array[n].class = xmMainWindowWidgetClass; n++; class_array[n].class = xmFormWidgetClass; n++; class_array[n].class = xmRowColumnWidgetClass; n++; class_array[n].class = xmScrolledWindowWidgetClass; n++; class_array[n].class = xmPanedWindowWidgetClass; n++; class_array[n].class = xmSelectionBoxWidgetClass; n++; class_array[n].class = xmFileSelectionBoxWidgetClass; n++; class_array[n].class = xmMessageBoxWidgetClass; n++; class_array[n].class = xmScaleWidgetClass; n++; class_array[n].class = xmCommandWidgetClass; n++; class_array[n].class = shellWidgetClass; n++; class_array[n].class = overrideShellWidgetClass; n++; class_array[n].class = wmShellWidgetClass; n++; class_array[n].class = xmMenuShellWidgetClass; n++; class_array[n].class = vendorShellWidgetClass; n++; class_array[n].class = topLevelShellWidgetClass; n++; class_array[n].class = applicationShellWidgetClass; n++; class_array[n].class = transientShellWidgetClass; n++; class_array[n].class = xmDialogShellWidgetClass; n++; class_array[n].class = xmSashWidgetClass; n++; /* primitive */ class_array[n].class = xmTearOffButtonWidgetClass; n++; /* pushbutton */ class_array[n].class = xmDisplayClass; n++; /* appshell */ class_array[n].class = xmScreenClass; n++; /* core */ class_array[n].class = xmDragContextClass; n++; /* core */ class_array[n].class = xmDragIconObjectClass; n++; /* object */ class_array[n].class = xmDropSiteManagerObjectClass; n++;/* object */ class_array[n].class = xmDropTransferObjectClass; n++; /* object */ class_array[n].class = xmDragOverShellWidgetClass; n++; /* vendors */ class_array[n].class = xmGrabShellWidgetClass; n++; class_array[n].class = xmIconHeaderClass; n++; class_array[n].class = xmClipWindowWidgetClass; n++; class_array[n].class = xmContainerWidgetClass; n++; class_array[n].class = xmIconGadgetClass; n++; class_array[n].class = xmNotebookWidgetClass; n++; class_array[n].class = xmSpinBoxWidgetClass; n++; class_array[n].class = xmSimpleSpinBoxWidgetClass; n++; class_array[n].class = xmComboBoxWidgetClass; n++; } static WidgetClass GetClassPointer(class) String class ; { Cardinal i ; static Boolean first_time = True ; if (first_time) InitClassArray () ; first_time = False ; for (i = 0 ; i < XtNumber(class_array); i++) { if (strcmp(class, class_array[i].name) == 0) return class_array[i].class ; } return NULL ; } static String buffer = NULL ; static short rows = 0, columns = 0 ; static void AddToBuffer (String fmt, ...) { va_list args; static Cardinal curpos = 0 ; char tmp[256] ; Cardinal i, tmplen ; Va_start(args, fmt); (void) vsprintf(tmp, fmt, args); tmplen = strlen(tmp) ; columns = (columns > tmplen)? columns : tmplen ; buffer = XtRealloc(buffer, curpos + tmplen + 1); for (i=0 ; tmp[i]; i++) { buffer[curpos++] = tmp[i] ; if (tmp[i] == '\n') rows ++ ; } buffer[curpos] = '\0' ; va_end(args); } static void GetPrintRes (name) String name ; { Cardinal i, j, k, num_resources, num_sec; XtResourceList resource_list ; XmSecondaryResourceData * res_sec_list ; WidgetClass class ; char buff_line[256] ; if ((class = GetClassPointer(name)) == NULL) { XtWarning("Cannot find specified class name"); class = widgetClass ; name = "Widget" ; } XtInitializeWidgetClass (class) ; AddToBuffer("Fetching resources for widget %s:\n", name); AddToBuffer("=======================================\n"); /* fecth Xt regular */ XtGetResourceList(class, &resource_list, &num_resources); AddToBuffer("\nRegular Xt resources: %d\n",num_resources); AddToBuffer( "------------------------\n"); for (j=0; j < 256; j++) buff_line[j] = ' ' ; for (i = 0 ; i < num_resources; i++) { if ((i%2) == 0) { strncpy (buff_line, resource_list[i].resource_name, strlen(resource_list[i].resource_name)) ; } else { strcpy (buff_line + 37, resource_list[i].resource_name) ; AddToBuffer(" %s\n", buff_line); for (j=0; j < 256; j++) buff_line[j] = ' ' ; } } if ((i%2) != 0) { buff_line[strlen(resource_list[i-1].resource_name)] = '\0' ; AddToBuffer(" %s\n", buff_line); for (j=0; j < 256; j++) buff_line[j] = ' ' ; } XtFree((char*)resource_list) ; /* fecth Xt constraint */ XtGetConstraintResourceList(class, &resource_list, &num_resources); if (num_resources) { AddToBuffer("\nConstraint Xt resources: %d\n",num_resources); AddToBuffer( "------------------------\n"); for (j=0; j < 256; j++) buff_line[j] = ' ' ; for (i = 0 ; i < num_resources; i++) { if ((i%2) == 0) { strncpy (buff_line, resource_list[i].resource_name, strlen(resource_list[i].resource_name)) ; } else { strcpy (buff_line + 37, resource_list[i].resource_name) ; AddToBuffer(" %s\n", buff_line); for (j=0; j < 256; j++) buff_line[j] = ' ' ; } } if ((i%2) != 0) { buff_line[strlen(resource_list[i-1].resource_name)] = '\0' ; AddToBuffer(" %s\n", buff_line); for (j=0; j < 256; j++) buff_line[j] = ' ' ; } XtFree((char*)resource_list) ; } /* fetch Motif second */ num_sec = XmGetSecondaryResourceData (class, &res_sec_list); if (num_sec) { AddToBuffer("\n\nMotif secondary blocks: %d\n", num_sec); AddToBuffer( "--------------------------\n"); for (i = 0; i < num_sec; i++) { AddToBuffer("\nSecondary[%d] : %d resources\n\n", i, res_sec_list[i]->num_resources); for (j = 0 ; j < res_sec_list[i]->num_resources; j++) { if ((j%2) == 0) { strncpy (buff_line, res_sec_list[i]->resources[j].resource_name, strlen( res_sec_list[i]->resources[j].resource_name)) ; } else { strcpy (buff_line + 37, res_sec_list[i]->resources[j].resource_name) ; AddToBuffer(" %s\n", buff_line); for (k=0; k < 256; k++) buff_line[k] = ' ' ; } } if ((j%2) != 0) { buff_line[strlen( res_sec_list[i]->resources[j-1].resource_name)] = '\0' ; AddToBuffer(" %s\n", buff_line); for (k=0; k < 256; k++) buff_line[k] = ' ' ; } XtFree((char *)res_sec_list[i]->resources); XtFree((char *)res_sec_list[i]); } XtFree((char*) res_sec_list); } } static String fallbacks[] = { "*help_manager.helpFile: getsubres", NULL }; #define APP_CLASS "XmdGetsubres" int main(argc, argv) int argc ; char **argv; { Widget toplevel, main_window, menu_bar, menu_pane, cascade, button, viewer ; XtAppContext app_context; String name ; Cardinal i ; Arg args[10] ; Cardinal n; /* Usage: getres class | getres All*/ toplevel = XtAppInitialize(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks, NULL, 0); /** Plug in Editres protocol */ XmdRegisterEditres(toplevel); /* get a default in no name provided */ if (argc == 1) name = "Widget"; else name = argv[1] ; /* Fill a string buffer with lines of text (this demo was originally designed with printf...) */ if (strcmp(name, "All") == 0) { for (i = 0; i < XtNumber(class_array); i++) { GetPrintRes (class_array[i].name); AddToBuffer( "\n*******************************************************\n\n"); } } else { GetPrintRes(name) ; } n = 0; main_window = XmCreateMainWindow (toplevel, "main_window", args, n); XtManageChild (main_window); /* Create MenuBar in MainWindow. */ n = 0; menu_bar = XmCreateMenuBar (main_window, "menu_bar", args, n); XtManageChild (menu_bar); /* Create "File" PulldownMenu with a Quit button */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Quit", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, QuitCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "File", args, n); XtManageChild (cascade); /* Create "Help" PulldownMenu with Help button. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Overview", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, HelpCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "Help", args, n); XtManageChild (cascade); n = 0; XtSetArg (args[n], XmNmenuHelpWidget, cascade); n++; XtSetValues (menu_bar, args, n); /* Create the viewer widget: here a text */ n = 0; XtSetArg (args[n], XmNvalue, buffer); n++; XtSetArg (args[n], XmNrows, rows+1); n++; XtSetArg (args[n], XmNcolumns, columns-1); n++; XtSetArg (args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++; if (strcmp(name, "All") != 0) { viewer = XmCreateText(main_window, "viewer", args, n); } else { viewer = XmCreateScrolledText(main_window, "viewer", args, n); } XtManageChild(viewer); XtFree(buffer) ; /* Text has its own copy */ XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } /*------------------------------------------------------------- ** QuitCB - callback for quit button */ static void QuitCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from applicaiton */ caddr_t call_data; /* data from widget class */ { exit (0); } /*------------------------------------------------------------- ** HelpCB - callback for help button */ static void HelpCB (w, client_data, call_data) Widget w; /* widget id */ caddr_t client_data; /* data from application */ caddr_t call_data; /* data from widget class */ { static Widget help_widget = NULL ; if (!help_widget) help_widget = XmdCreateHelpDialog(w, "help_manager", NULL, 0); XtManageChild(help_widget); } motif-2.3.8/demos/programs/getsubres/README0000644000175000017500000000212112672140200015375 00000000000000/* $XConsortium: README /main/4 1996/07/15 14:04:34 drk $ */ Getsubres: a viewer of Motif widget resources ---------------------------------------------------- getsubres uses XmGetSecondaryResourceData to fetch the widget resources that XtGetResourceList won't see. You can specify which widget resources to display on the command line by using the syntax "getsubres CLASS_NAME" with one of those names: Object, RectObj, Widget, Core, Composite, Constraint, Primitive, ScrollBar, ArrowB, List, Separator, TextF, Label, DrawnB, PushB, ToggleB, CascadeB, Text, Gadget, ArrowBG, SeparatorG, LabelG, PushBG, ToggleBG, CascadeBG, Manager, BulletinB, DrawingA, Frame, MainW, Form, RowCol, ScrolledW, PanedW, SelectionB, FileSB, MessageB, Scale, Command, Display, Screen, DragContext, DragIcon, DropSiteMgr, DropTransfer, DragOverS, Shell, OverrideShell, WMShell, MenuShell, VendorS, ToplevelShell, ApplicationShell, TransientShell, DialogShell, Container, IconGadget, Notebook, ComboBox, SpinBox (default is Widget) Or you can use "getsubres All". Daniel Dardailler motif-2.3.8/demos/programs/getsubres/getsubres.help0000644000175000017500000000177012672140200017403 00000000000000Overview Getsubres: a viewer of Motif widget resources getsubres uses XmGetSecondaryResourceData to fetch the widget resources that XtGetResourceList won't see. You can specify which widget resources to display on the command line by using the syntax "getsubres CLASS_NAME" with one of those names: Object, RectObj, Widget, Core, Composite, Constraint, Primitive, ScrollBar, ArrowB, List, Separator, TextF, Label, DrawnB, PushB, ToggleB, CascadeB, Text, Gadget, ArrowBG, SeparatorG, LabelG, PushBG, ToggleBG, CascadeBG, Manager, BulletinB, DrawingA, Frame, MainW, Form, RowCol, ScrolledW, PanedW, SelectionB, FileSB, MessageB, Scale, Command, Display, Screen, DragContext, DragIcon, DropSiteMgr, DropTransfer, DragOverS, Shell, OverrideShell, WMShell, MenuShell, VendorS, ToplevelShell, ApplicationShell, TransientShell, DialogShell, Container, IconGadget, Notebook, ComboBox, SpinBox, SimpleSpinBox. (default is Widget) Or you can use "getsubres All". motif-2.3.8/demos/programs/getsubres/Makefile.am0000644000175000017500000000064013145162623016566 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/getsubres datadir = ${prefix}/share/Xm/getsubres bin_PROGRAMS = getsubres EXTRA_DIST = getsubres.help getsubres.man README getsubres_SOURCES = getsubres.c data_DATA = $(EXTRA_DIST) $(getsubres_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/sampler2_0/0000755000175000017500000000000013211513007014541 500000000000000motif-2.3.8/demos/programs/sampler2_0/main.xpm0000644000175000017500000000115212672140200016133 00000000000000/* XPM */ /* $XConsortium: main.xpm /main/4 1995/07/18 16:05:21 drk $ */ static char * main [] = { "22 17 3 1", " c #FFFFFFFFFFFF", ". c #000000000000", "X c #FFFFCACAB6B6", " .................... ", ". .", ". ... .", ". ..XX. .", ". .XXX. .", ". .XXX... .", ". ..XXX.......... .", ". .XXX..XXXXXXXXX. .", ". .XX.X.......... .", ". ...XX.XXXXX. .", ". .XXXX...... .", ". .XXXX.XXXX. .", ". ..XXX..... .. .", ". ........ .. .", ". .", ". .", " .................... "}; motif-2.3.8/demos/programs/sampler2_0/sampler2_0.c0000644000175000017500000007160712672140561016617 00000000000000/* $XConsortium: sampler2_0.c /main/13 1995/07/15 20:46:01 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include #include #include /* need these semi public header during the construction of the ContainerOutline class widget tree, as data, not as real widgets */ #include #include #include #include #ifdef SAMPLER_DEBUG_SSPINB #include #include #endif /* The notebook maintains its own data thru XmNuserData, which points to a notebook data struct */ typedef struct { String page_name; WidgetClass page_class ; XtCallbackProc page_init_proc ; } PageDataStruct; typedef struct { Widget status; Cardinal num_pages ; PageDataStruct * pages ; } NotebookDataStruct; /********************************************************************** the following is used in the ContainerOutline page, which displays a tree of all the wigdet classes in Xt/Motif */ typedef struct _ClassInfoRec { Boolean documented ; /* whether or not the class is documented */ WidgetClass w_class ; } ClassInfoRec; typedef struct _IconGInfoRec { Cardinal parent_index ; /* entryParent resource */ ClassInfoRec class_info ; } IconGInfoRec, * IconGInfo; /*********** Following used to build the icong_array[] with the widget class tree information *****************/ /* this one is not exported by Xt, mimic it static here */ static RectObjClassRec unNamedObjClassRec = { { /* superclass */ (WidgetClass)&rectObjClassRec, /* class_name */ "UnNamedObj", /* widget_size */ 0 } }; static WidgetClass unNamedObjClass = (WidgetClass) &unNamedObjClassRec; #define ClassName(wclass) ((WidgetClass)wclass)->core_class.class_name #define MAX_CLASSES 100 static IconGInfo icong_array[MAX_CLASSES] ; /*** my own little stack manager: push and pop */ #define MAX_DEPTH 10 static Cardinal stack_index[MAX_DEPTH] ; static Cardinal stack_heap = 0 ; #define PushIndex(i) (stack_index[stack_heap++] = i) #define PopIndex() (stack_index[--stack_heap]) #define SSB_NUMERIC 0 #define SSB_STRING 1 #define NUM_SSB_WIDGETS 2 static Widget ssb_widgets[NUM_SSB_WIDGETS]; /** each page has an Init routine which is called the first time a page is raised. It delays the real page creation somehow */ static PageDataStruct * NewPageSet (Cardinal *num_page_return); static void NbCB (Widget w, XtPointer client_data, XtPointer call_data); static void DestroyCB (Widget w, XtPointer client_data, XtPointer call_data); static void QuitCB (Widget w, XtPointer client_data, XtPointer call_data); static void HelpCB (Widget w, XtPointer client_data, XtPointer call_data); static Widget CreateMainWindowWithMenuBar (Widget toplevel); static void ContainerExpose (Widget wid, XtPointer closure, XEvent *event, Boolean *cont); static void InitContainerSpatial(Widget w, XtPointer client_data, XtPointer call_data); static void TravCB (Widget w, XtPointer client_data, XtPointer call_data); static void InitContainerOutline(Widget w, XtPointer client_data, XtPointer call_data); static void OKCB (Widget w, XtPointer client_data, XtPointer call_data); static void InitPanedWindow(Widget w, XtPointer client_data, XtPointer call_data); static void InitFileSelectionBox(Widget w, XtPointer client_data, XtPointer call_data); static void InitTogglesWindow(Widget w, XtPointer client_data, XtPointer call_data); static void InitScaleCombo(Widget w, XtPointer client_data, XtPointer call_data); static void SetDyn(WidgetClass wclass, Cardinal index, Boolean documented); static Cardinal InitClassArray (void); static void sb_ModifyVerifyCB(Widget w, XtPointer client_data, XtPointer call_data); static void sb_ValueChangedCB(Widget w, XtPointer client_data, XtPointer call_data); static void tf_ActivateCB(Widget w, XtPointer client_data, XtPointer call_data); static void sb_ApplyCB(Widget w, XtPointer client_data, XtPointer call_data); static void sb_CancelCB(Widget w, XtPointer client_data, XtPointer call_data); static void sb_OkCB(Widget w, XtPointer client_data, XtPointer call_data); static Widget ssb_GetTextField(Widget w); #define APP_CLASS "XmdSampler2_0" static Widget toplevel ; /* used in OKCB for set its size */ /* * Fallbacks: keep it minimum */ static String fallbacks[] = { "*help_manager.helpFile: sampler2_0", "*XmIconGadget.outlineState: XmEXPANDED", "*SWContainerOutline.scrollingPolicy:XmAUTOMATIC", "*ContainerOutline.layoutType:outline", NULL }; /***********************************************/ /***********************************************/ int main(int argc, char *argv[]) { XtAppContext app_context; int i ; Widget mainw, nb ; NotebookDataStruct nb_data ; XmNotebookCallbackStruct nb_call_data ; XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaAppInitialize(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallbacks, NULL); /** Plug in Editres protocol */ XmdRegisterEditres(toplevel); /*** create utility widgets */ mainw = CreateMainWindowWithMenuBar(toplevel); XtManageChild(mainw); /* allocate new pages struct */ nb_data.pages = NewPageSet (&nb_data.num_pages) ; nb = XtVaCreateManagedWidget("nb", xmNotebookWidgetClass, mainw, XmNuserData, &nb_data, NULL); XtAddCallback (nb, XmNpageChangedCallback, NbCB, NULL); XtAddCallback (nb, XmNdestroyCallback, DestroyCB, NULL); /*** create page and tab buttons, one per page */ for (i=0; i< nb_data.num_pages; i++) { char tab_name[100] ; sprintf(tab_name, "TabTo%s", nb_data.pages[i].page_name); (void) XtVaCreateManagedWidget(nb_data.pages[i].page_name, nb_data.pages[i].page_class, nb, NULL); (void) XtVaCreateManagedWidget(tab_name, xmPushButtonWidgetClass, nb, NULL); } /*** create only one status area */ nb_data.status = XtVaCreateManagedWidget("Status", xmLabelWidgetClass, nb, XmNpageNumber, 1, NULL); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); return (0); } /* I wish C could initialized that statically, but it can't */ static PageDataStruct * NewPageSet (Cardinal *num_page_return) { Cardinal n; PageDataStruct * pages; #define NUM_PAGES 7 pages = (PageDataStruct *) XtMalloc(NUM_PAGES * sizeof(PageDataStruct)); n = 0; pages[n].page_name = "ContainerSpatial"; pages[n].page_init_proc = InitContainerSpatial; pages[n].page_class = xmContainerWidgetClass; n++; pages[n].page_name = "SWContainerOutline"; pages[n].page_init_proc = InitContainerOutline; pages[n].page_class = xmScrolledWindowWidgetClass; n++; pages[n].page_name = "PanedWindow"; pages[n].page_init_proc = InitPanedWindow; pages[n].page_class = xmPanedWindowWidgetClass; n++; pages[n].page_name = "FileSelectionBox"; pages[n].page_init_proc = InitFileSelectionBox; pages[n].page_class = xmFrameWidgetClass; n++; pages[n].page_name = "TogglesWindow"; pages[n].page_init_proc = InitTogglesWindow; pages[n].page_class = xmScrolledWindowWidgetClass; n++; pages[n].page_name = "ScaleCombo"; pages[n].page_init_proc = InitScaleCombo; pages[n].page_class = xmFormWidgetClass; n++; *num_page_return = n ; return pages ; } /********************************************** * NbCB - callback for Notebook * Update the status label. and init the page if not yet done */ static void NbCB (Widget w, XtPointer client_data, XtPointer call_data) { XmNotebookCallbackStruct * nbcs = (XmNotebookCallbackStruct *) call_data ; NotebookDataStruct * nb_data ; /* get the data for this notebook from the notebook */ XtVaGetValues(w, XmNuserData, &nb_data, NULL); /* set the status label to the widget I'm showing now, plus its page number */ XtVaSetValues(nb_data->status, XtVaTypedArg, XmNlabelString, XtRString, nb_data->pages[nbcs->page_number - 1].page_name, strlen(nb_data->pages[nbcs->page_number - 1].page_name)+1, XmNpageNumber, nbcs->page_number, NULL); /* here I use page_class as a flag to check if the page has been initialized. page_class is the field that stores the class of the widget in the page, it is not NULL the first time thru and I set it NULL here cause I won't be using it again */ if (nb_data->pages[nbcs->page_number - 1].page_class) { (* nb_data->pages[nbcs->page_number - 1].page_init_proc) (nbcs->page_widget, NULL, NULL) ; nb_data->pages[nbcs->page_number - 1].page_class = NULL ; } } /********************************************** * DestroyCB - callback when Notebook dies * Free the data associated with this Notebook. */ static void DestroyCB (Widget w, XtPointer client_data, XtPointer call_data) { NotebookDataStruct * nb_data ; /* get the data for this notebook from the notebook */ XtVaGetValues(w, XmNuserData, &nb_data, NULL); XtFree((char*) nb_data->pages); /* nbdata itself comes from the stack in this program */ } static void QuitCB (Widget w, XtPointer client_data, XtPointer call_data) { exit (0); } static void HelpCB (Widget w, XtPointer client_data, XtPointer call_data) { static Widget help_widget = NULL ; if (!help_widget) help_widget = XmdCreateHelpDialog(toplevel, "help_manager", NULL, 0); XtManageChild(help_widget); } static Widget CreateMainWindowWithMenuBar(Widget toplevel) { Widget main_window, menu_bar, menu_pane, cascade, button ; Arg args[20]; Cardinal n; /* Create MainWindow. */ n = 0; main_window = XmCreateMainWindow (toplevel, "main_window", args, n); XtManageChild (main_window); /* Create MenuBar in MainWindow. */ n = 0; menu_bar = XmCreateMenuBar (main_window, "menu_bar", args, n); XtManageChild (menu_bar); /* Create "File" PulldownMenu. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Exit", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, QuitCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "File", args, n); XtManageChild (cascade); /* Create "Help" PulldownMenu. */ n = 0; menu_pane = XmCreatePulldownMenu (menu_bar, "menu_pane3", args, n); n = 0; button = XmCreatePushButton (menu_pane, "Overview", args, n); XtManageChild (button); XtAddCallback (button, XmNactivateCallback, HelpCB, NULL); n = 0; XtSetArg (args[n], XmNsubMenuId, menu_pane); n++; cascade = XmCreateCascadeButton (menu_bar, "Help", args, n); XtManageChild (cascade); n = 0; XtSetArg (args[n], XmNmenuHelpWidget, cascade); n++; XtSetValues (menu_bar, args, n); return main_window ; } static void ContainerExpose( Widget wid, XtPointer closure, /* unused */ XEvent *event, Boolean *cont ) /* unused */ { /* Turn the spatial container to NONE after it is realized */ XtVaSetValues (wid, XmNspatialStyle, XmNONE, NULL); } static void InitContainerSpatial (Widget w, XtPointer client_data, XtPointer call_data) { Cardinal i ; #define NUM_ICONS 10 Widget icons[NUM_ICONS ] ; for (i=0; itraversal_destination, 20, 20) ; } static void InitContainerOutline (Widget w, XtPointer client_data, XtPointer call_data) { Widget container, *icongs; Cardinal i ; /* get the number of classes in Xt/Motif */ i = InitClassArray() ; /* allocate space for the array of icongadgets to be managed at once */ icongs = (Widget*) XtMalloc(i * sizeof(Widget)); XtAddCallback (w, XmNtraverseObscuredCallback, TravCB, NULL); /* create the container */ container = XtVaCreateManagedWidget("ContainerOutline", xmContainerWidgetClass, w, NULL); /* setup our clipwindow/workwindow constraint stuff */ XmdSWAdjustView (w) ; /* create the root */ icongs[0] = XtVaCreateWidget( ClassName(icong_array[0]->class_info.w_class), xmIconGadgetClass, container, XmNentryParent, NULL, XmNsensitive, icong_array[0]->class_info.documented, XmNuserData, &(icong_array[0]->class_info), NULL); i = 1 ; while (icong_array[i]) { /* parent_index has been set during InitClassArray */ icongs[i] = XtVaCreateWidget( ClassName(icong_array[i]->class_info.w_class), xmIconGadgetClass, container, XmNentryParent, icongs[icong_array[i]->parent_index], XmNsensitive, icong_array[i]->class_info.documented, XmNuserData, &(icong_array[i]->class_info), NULL); i++ ; } XtManageChildren(icongs, i); } static void OKCB (Widget w, XtPointer client_data, XtPointer call_data) { String input_string ; int size_in_pixel ; String colon_location ; String resource_name ; XtEnum orientation ; /* get back something ala "width: 20cm" */ input_string = XmTextFieldGetString((Widget)client_data); /* find the ':' */ colon_location = strchr(input_string, ':'); /* cut the input_string in two by ending it at color_location, the other piece being at colon_location+1 */ if (colon_location) *colon_location = '\0'; else { XtFree(input_string); return ; } /* now try to figure out the dimension being set */ if (strstr(input_string, "width")) { orientation = XmHORIZONTAL ; resource_name = XmNwidth ; } else if (strstr(input_string, "height")) { orientation = XmVERTICAL ; resource_name = XmNheight ; } else { XtFree(input_string); return ; } size_in_pixel = XmConvertStringToUnits(XtScreen(w), colon_location+1, orientation, XmPIXELS, NULL) ; if (size_in_pixel) XtVaSetValues(toplevel, resource_name, size_in_pixel, NULL); XtFree(input_string); } static void InitPanedWindow (Widget w, XtPointer client_data, XtPointer call_data) { Widget child_w[2], sub_pane, temp, form, frame; child_w[0] = XtVaCreateWidget("Arrow1", xmArrowButtonWidgetClass, w, NULL); sub_pane = child_w[1] = XtVaCreateWidget("SubPane", xmPanedWindowWidgetClass, w, NULL); XtManageChildren(child_w, 2); child_w[0] = XtVaCreateWidget("Arrow2", xmArrowButtonWidgetClass, sub_pane, NULL); temp = child_w[1] = XtVaCreateWidget("Temp", xmMessageBoxWidgetClass, sub_pane, NULL); XtRealizeWidget(temp); XtManageChildren(child_w, 2); form = XtVaCreateManagedWidget("Form", xmFormWidgetClass, temp, NULL); frame = child_w[0] = XtVaCreateWidget("Frame", xmFrameWidgetClass, form, NULL); child_w[1] = XtVaCreateWidget("TextF", xmTextFieldWidgetClass, form, NULL); XtManageChildren(child_w, 2); XtAddCallback (temp, XmNokCallback, OKCB, (XtPointer)child_w[1]); child_w[0] = XtVaCreateWidget("Title", xmLabelGadgetClass, frame, NULL); child_w[1] = XtVaCreateWidget("Label", xmLabelWidgetClass, frame, NULL); XtManageChildren(child_w, 2); } static void InitFileSelectionBox (Widget w, XtPointer client_data, XtPointer call_data) { XtVaCreateManagedWidget("FileSelectionBox", xmFileSelectionBoxWidgetClass, w, NULL); } static void InitTogglesWindow (Widget w, XtPointer client_data, XtPointer call_data) { Cardinal i ; #define NUM_TOG 50 Widget work_area, toggles[NUM_TOG] ; work_area = XtVaCreateManagedWidget("RowColumn", xmRowColumnWidgetClass, w, NULL); for (i=0; iparent_index = index ; icong_array[i]->class_info.w_class = wclass ; icong_array[i]->class_info.documented = documented ; i++ ; } static Cardinal InitClassArray (void) { /* This code builds the Xt/Motif widget class tree using a breadth first search algorithm */ Cardinal n = 0; int index = -1; SetDyn(objectClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmDragIconObjectClass, index, True); n++; SetDyn(xmDropTransferObjectClass, index, True); n++; SetDyn(xmDropSiteManagerObjectClass, index, False); n++; SetDyn(rectObjClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(unNamedObjClass, index, False); PushIndex(n); n++; SetDyn(xmGadgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmArrowButtonGadgetClass, index, True); n++; SetDyn(xmSeparatorGadgetClass, index, True); n++; SetDyn(xmLabelGadgetClass, index, True); PushIndex(n); n++; SetDyn(xmIconGadgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmIconHeaderClass, index, False); n++; index = PopIndex () ; SetDyn(xmPushButtonGadgetClass, index, True); n++; SetDyn(xmToggleButtonGadgetClass, index, True); n++; SetDyn(xmCascadeButtonGadgetClass, index, True); n++; index = PopIndex () ; SetDyn(coreWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(compositeWidgetClass, index, True); PushIndex(n); n++; SetDyn(xmScreenClass, index, True); n++; SetDyn(xmDragContextClass, index, True); n++; SetDyn(xmPrimitiveWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmScrollBarWidgetClass, index, True); n++; SetDyn(xmArrowButtonWidgetClass, index, True); n++; SetDyn(xmListWidgetClass, index, True); n++; SetDyn(xmSeparatorWidgetClass, index, True); n++; SetDyn(xmTextFieldWidgetClass, index, True); n++; SetDyn(xmDrawnButtonWidgetClass, index, True); n++; SetDyn(xmTextWidgetClass, index, True); n++; SetDyn(xmSashWidgetClass, index, False); n++; SetDyn(xmLabelWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmToggleButtonWidgetClass, index, True); n++; SetDyn(xmCascadeButtonWidgetClass, index, True); n++; SetDyn(xmPushButtonWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmTearOffButtonWidgetClass, index, False); n++; index = PopIndex () ; SetDyn(constraintWidgetClass, index, True); PushIndex(n); n++; SetDyn(shellWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(wmShellWidgetClass, index, True); PushIndex(n); n++; SetDyn(overrideShellWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmMenuShellWidgetClass, index, True); n++; index = PopIndex () ; SetDyn(vendorShellWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmGrabShellWidgetClass, index, False); n++; SetDyn(xmDragOverShellWidgetClass, index, False); n++; SetDyn(transientShellWidgetClass, index, True); PushIndex(n); n++; SetDyn(topLevelShellWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(applicationShellWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmDisplayClass, index, True); n++; index = PopIndex () ; SetDyn(xmDialogShellWidgetClass, index, True); n++; index = PopIndex () ; SetDyn(xmManagerWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmDrawingAreaWidgetClass, index, True); n++; SetDyn(xmFrameWidgetClass, index, True); n++; SetDyn(xmRowColumnWidgetClass, index, True); n++; SetDyn(xmPanedWindowWidgetClass, index, True); n++; SetDyn(xmScaleWidgetClass, index, True); n++; SetDyn(xmComboBoxWidgetClass, index, True); n++; SetDyn(xmContainerWidgetClass, index, True); n++; SetDyn(xmNotebookWidgetClass, index, True); n++; SetDyn(xmSpinBoxWidgetClass, index, True); n++; SetDyn(xmScrolledWindowWidgetClass, index, True); PushIndex(n); n++; SetDyn(xmBulletinBoardWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmFormWidgetClass, index, True); n++; SetDyn(xmMessageBoxWidgetClass, index, True); n++; SetDyn(xmSelectionBoxWidgetClass, index, True); PushIndex(n); n++; index = PopIndex () ; SetDyn(xmFileSelectionBoxWidgetClass, index, True); n++; SetDyn(xmCommandWidgetClass, index, True); n++; index = PopIndex () ; SetDyn(xmMainWindowWidgetClass, index, True); n++; return n ; } /* ARGSUSED */ static void sb_ModifyVerifyCB(Widget w, XtPointer client_data, XtPointer call_data) { char *buffer; XmSpinBoxCallbackStruct *cbs = (XmSpinBoxCallbackStruct *) call_data; int position = cbs->position; Widget textual = (Widget) NULL; if (XtIsSubclass(w, xmSimpleSpinBoxWidgetClass)) textual = ssb_GetTextField(w); else if (XtIsSubclass(w, xmSpinBoxWidgetClass)) textual = cbs->widget; else textual = (Widget) NULL; if (! textual) { printf("Null textual widget for %s\n", XtName(w)); return; } #ifdef SAMPLER_TEST_SSPINB if (XmStringGetLtoR(cbs->value, XmFONTLIST_DEFAULT_TAG, &buffer)) printf("ModifyVerify value for %s.%s is %s\n", XtName(w), XtName(textual), buffer); #endif } /* ARGSUSED */ static void sb_ValueChangedCB(Widget w, XtPointer client_data, XtPointer call_data) { char *buffer; XmSpinBoxCallbackStruct *cbs = (XmSpinBoxCallbackStruct *) call_data; int position = cbs->position; Widget textual = (Widget) NULL; if (XtIsSubclass(w, xmSimpleSpinBoxWidgetClass)) textual = ssb_GetTextField(w); else if (XtIsSubclass(w, xmSpinBoxWidgetClass)) textual = cbs->widget; else textual = (Widget) NULL; if (! textual) { printf("Null textual widget for %s\n", XtName(w)); return; } #ifdef SAMPLER_TEST_SSPINB if (XmStringGetLtoR(cbs->value, XmFONTLIST_DEFAULT_TAG, &buffer)) printf("ValueChanged value for %s.%s is %s\n", XtName(w), XtName(textual), buffer); #endif } /* ARGSUSED */ static void tf_ActivateCB(Widget w, XtPointer client_data, XtPointer call_data) { Arg args[1]; int position, minimum; Widget textual = (Widget) w; if (XmSpinBoxValidatePosition (textual, &position) == XmCURRENT_VALUE) XBell(XtDisplay(w), 0); /* * Force the widget to redraw itself. */ XtSetArg(args[0], XmNposition, position); XtSetValues(textual, args, 1); } /* ARGSUSED */ /* ARGSUSED */ static void sb_ApplyCB(Widget w, XtPointer client_data, XtPointer call_data) { /* Widget *ssb_widgets = (Widget *) client_data; */ XmString xmstring; int pos; Arg args[1]; /* Apply adds a new string to the sspinb_s widget */ XtSetArg(args[0], XmNtextString, &xmstring); XtGetValues(w, args, 1); XtSetArg(args[0], XmNposition, &pos); XtGetValues(ssb_widgets[SSB_NUMERIC], args, 1); XmSimpleSpinBoxAddItem(ssb_widgets[SSB_STRING], xmstring, pos); } static void sb_CancelCB(Widget w, XtPointer client_data, XtPointer call_data) { /* Widget *ssb_widgets = (Widget *) client_data; */ int pos; Arg args[1]; /* Cancel deletes a string from the sspinb_s widget */ XtSetArg(args[0], XmNposition, &pos); XtGetValues(ssb_widgets[SSB_NUMERIC], args, 1); XmSimpleSpinBoxDeletePos(ssb_widgets[SSB_STRING], pos); } /* ARGSUSED */ static void sb_OkCB(Widget w, XtPointer client_data, XtPointer call_data) { /* Widget *ssb_widgets = (Widget *) client_data; */ XmString xmstring; Arg args[1]; /* OK sets position of sspinb_s to the specified string. */ XtSetArg(args[0], XmNtextString, &xmstring); XtGetValues(w, args, 1); XmSimpleSpinBoxSetItem(ssb_widgets[SSB_STRING], xmstring); } /* ARGSUSED */ static Widget ssb_GetTextField(Widget w) { Arg args[1]; Widget textual = (Widget) NULL; XtSetArg(args[0], XmNtextField, &textual); XtGetValues(w, args, 1); return(textual); } motif-2.3.8/demos/programs/sampler2_0/XmdSampler2_0.ad0000644000175000017500000002355412672140200017356 00000000000000! $TOG: XmdSampler2_0.ad /main/12 1999/04/13 16:07:49 mgreess $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY !!!!!!!!!!!!!!!!!!!!!!!!!!!! ! resources setting !!!!!!!!!!!!!!!!!!!!!!!!!!!! *help_manager.helpFile: sampler2_0 ! a few Colors *background: #d0d0d8 *topShadowColor: white *bottomShadowColor: black *selectColor: #ADADD8D8E6E6 ! match the color in the notebook with the one ! in spir.xpm. *nb.frameBackground: #ADADD8D8E6E6 *nb.XmPushButton.background: #ADADD8D8E6E6 *nb.Status.background: #ADADD8D8E6E6 *nb.PageScroller.background: #ADADD8D8E6E6 ! pixmap settings *nb.bindingType:pixmap *nb.bindingPixmap:spir.xpm *nb.bindingWidth:20 *nb.XmPushButton.labelType: pixmap *TabToContainerSpatial.labelPixmap:k7.xpm *TabToSWContainerOutline.labelPixmap:k7.xpm *TabToPanedWindow.labelPixmap:stack.xpm *TabToFileSelectionBox.labelPixmap:labir.xpm *TabToTogglesWindow.labelPixmap:da.xpm *TabToScaleCombo.labelPixmap:pile.xpm *ContainerSpatial*largeIconPixmap:prev.xpm *ContainerSpatial*IconGadget1.largeIconPixmap:bomb.xpm *ContainerSpatial*IconGadget2.viewType:small_icon *ContainerSpatial*IconGadget2.smallIconPixmap:girlface.xpm *ContainerSpatial*IconGadget3.largeIconPixmap:bee.xpm *ContainerSpatial*IconGadget5.viewType:small_icon *ContainerSpatial*IconGadget5.smallIconPixmap:main.xpm *ContainerSpatial*IconGadget7.largeIconPixmap:bee.xpm *ContainerSpatial*IconGadget3.labelString:Bee *ContainerSpatial*IconGadget4.labelString:short *ContainerSpatial*IconGadget5.height:30 *ContainerSpatial*IconGadget8.viewType:small_icon *ContainerSpatial*IconGadget9.smallIconPixmap:cherry.xpm *ContainerSpatial*IconGadget9.viewType:small_icon ! dimension settings sampler2_0.width:480 sampler2_0.height:450 *nb.innerMarginWidth:5 *nb.innerMarginHeight:5 *ContainerSpatial.borderWidth:2 *ContainerSpatial.largeCellWidth:100 *ContainerSpatial.largeCellHeight:100 *SubPane.Arrow2.shadowThickness:5 *SubPane*Form.Frame.shadowType:shadow_etched_out *SubPane*Form.Frame.shadowThickness:2 *TogglesWindow.RowColumn.height:400 *ComboBox*XmScrollBar.width:15 *backPageNumber:8 *backPageSize:15 *XmPushButton.marginHeight:1 *ContainerOutline.outlineIndentation: 20 *PanedWindow*Arrow2.paneMinimum:100 *Arrow1.paneMinimum:100 *Temp.paneMinimum:100 *ComboBox*listSpacing:2 *RowColumn.RCChild31.indicatorSize:10 ! strings *SubPane*Form.Frame.Title.labelString:New UnitType Syntax *SubPane*Form.Frame.Label.labelString:\ Use the TextField to specify the size\n\ of the toplevel shell you're into !\n\ (ala: width: 35cm or height: 4.54 inch.\n\ one dimension at a time)\n *ComboBox*List.items: NavigatorT.h, ContItemT.h, LayoutT.h, SpecRenderT.h, AccTextT.h, ContainerT.h, MenuT.h, TakesDefT.h, ActivatableT.h, DialogSavvyT.h, AccColorT.h, TransferT.h, CareVisualT.h, JoinSideT.h, ScrollFrameT.h, UnitTypeT.h,XmeClearBorder,XmeConfigureObject,XmeDrawArrow,XmeDrawDiamond,XmeDrawSeparator,XmeDrawShadows,XmeDrawHighlight,XmeRenderTableGetDefaultFont,XmeFromHorizontalPixels,XmeFromVerticalPixels,XmeReplyToQueryGeometry,XmeGetDefaultRenderTable,XmeQueryBestCursorSize,XmeGetNullCursor,XmeGetTextualDragIcon,XmeGadgetAtPoint,XmeMicroSleep,XmeNavigChangeManaged,XmeGetHomeDirName,XmeGetLocalizedString,XmeRedisplayGadgets,XmeStringIsValid,XmeStringUpdate,XmeSetWMShellTitle,XmeStringsAreEqual,XmeToHorizontalPixels,XmeToVerticalPixels,XmeConfigureObject,XmeWarning *ComboBox*List.itemCount:45 *Scale.titleString:Temperature\nin Celsius ! layout settings !*ContainerSpatial.spatialResizeModel:grow_balanced *SWContainerOutline.scrollingPolicy:XmAUTOMATIC *ContainerOutline.layoutType:outline *ContainerOutline.entryViewType:XmSMALL_ICON *XmIconGadget.outlineState: XmEXPANDED *SubPane.orientation:horizontal *SubPane*allowResize:True *SubPane.Temp.dialogType:dialog_template *SubPane.Temp.okLabelString:Apply *SubPane.Temp.cancelLabelString:Forget *SubPane*Form*Attachment:attach_form *SubPane*Form.Frame.bottomAttachment:attach_none *SubPane*Form.TextF.topAttachment:attach_widget *SubPane*Form.TextF.topWidget:Frame *SubPane*Form.Frame.Title.childHorizontalAlignment:alignment_center *SubPane*Form.Frame.Title.childType:frame_title_child *TogglesWindow.scrollingPolicy:automatic *TogglesWindow.RowColumn.resizeHeight:False *FileSelectionBox*resizePolicy:resize_none *FileSelectionBox*pathMode:path_mode_relative *FileSelectionBox*fileFilterStyle:XmFILTER_HIDDEN_FILES *ScaleCombo*Attachment:attach_form *ScaleCombo*Offset:2 *ScaleCombo.Scale.leftAttachment:attach_position *ScaleCombo.Scale.leftPosition:50 *ScaleCombo.ComboBox.topOffset:40 *ScaleCombo.ComboBox.rightAttachment:attach_position *ScaleCombo.ComboBox.rightPosition:50 *ScaleCombo.ComboBox.bottomAttachment:attach_none *ScaleCombo.SpinBox.rightAttachment:attach_position *ScaleCombo.SpinBox.rightPosition:50 *ScaleCombo.SpinBox.topAttachment:attach_none *ScaleCombo.SpinBox.bottomOffset:60 *ScaleCombo.SpinBox.spacing: 0 *ScaleCombo.SpinBox.Date.spinBoxChildType: numeric *ScaleCombo.SpinBox.Date.columns: 2 *ScaleCombo.SpinBox.Date.position: 21 *ScaleCombo.SpinBox.Date.minimumValue: 1 *ScaleCombo.SpinBox.Date.maximumValue: 31 *ScaleCombo.SpinBox.Month.spinBoxChildType: string *ScaleCombo.SpinBox.Month.columns:8 *ScaleCombo.SpinBox.Month.position:6 *ScaleCombo.SpinBox.Month.editable: False *ScaleCombo.SpinBox.Month.numValues:12 !*ScaleCombo.SpinBox.Month.wrap: False *ScaleCombo.SpinBox.Month.values:January,February,March,April,May,June,July,August,September,October,November,December *ScaleCombo.SpinBox.Year.spinBoxChildType: numeric *ScaleCombo.SpinBox.Year.columns: 4 *ScaleCombo.SpinBox.Year.position: 1995 *ScaleCombo.SpinBox.Year.minimumValue: 1900 *ScaleCombo.SpinBox.Year.maximumValue: 2025 *ScaleCombo.SimpleSpinBoxString.rightAttachment: attach_position *ScaleCombo.SimpleSpinBoxString.rightPosition: 50 *ScaleCombo.SimpleSpinBoxString.topAttachment: attach_none *ScaleCombo.SimpleSpinBoxString.bottomOffset: 100 *ScaleCombo.SimpleSpinBoxString.arrowLayout: arrows_split *ScaleCombo.SimpleSpinBoxString.spinBoxChildType: string *ScaleCombo.SimpleSpinBoxString.editable: True *ScaleCombo.SimpleSpinBoxString.columns: 9 *ScaleCombo.SimpleSpinBoxString.position: 6 *ScaleCombo.SimpleSpinBoxString.numValues: 12 *ScaleCombo.SimpleSpinBoxString.values: January,February,March,April,May,June,July,August,September,October,November,December *ScaleCombo.SimpleSpinBoxNumeric.rightAttachment: attach_position *ScaleCombo.SimpleSpinBoxNumeric.rightPosition: 50 *ScaleCombo.SimpleSpinBoxNumeric.topAttachment: attach_none *ScaleCombo.SimpleSpinBoxNumeric.bottomOffset: 140 *ScaleCombo.SimpleSpinBoxNumeric.arrowOrientation:arrows_horizontal *ScaleCombo.SimpleSpinBoxNumeric.arrowLayout: arrows_split *ScaleCombo.SimpleSpinBoxNumeric.initialDelay: 100 *ScaleCombo.SimpleSpinBoxNumeric.repeatDelay: 100 *ScaleCombo.SimpleSpinBoxNumeric.spinBoxChildType: numeric *ScaleCombo.SimpleSpinBoxNumeric.columns: 4 *ScaleCombo.SimpleSpinBoxNumeric.editable: True *ScaleCombo.SimpleSpinBoxNumeric.incrementValue: 1 *ScaleCombo.SimpleSpinBoxNumeric.decimalPoints: 0 *ScaleCombo.SimpleSpinBoxNumeric.maximumValue: 12 *ScaleCombo.SimpleSpinBoxNumeric.minimumValue: 1 *ScaleCombo.SimpleSpinBoxNumeric.position: 1 !*ScaleCombo.SimpleSpinBoxNumeric.wrap: False !*ScaleCombo.SimpleSpinBoxNumeric.positionType: position_index *ScaleCombo.SelectionBoxDebug.rightAttachment: attach_position *ScaleCombo.SelectionBoxDebug.rightPosition: 50 *ScaleCombo.SelectionBoxDebug.topAttachment: attach_none *ScaleCombo.SelectionBoxDebug.bottomOffset: 180 *ScaleCombo.SelectionBoxDebug.applyLabelString: Add Item *ScaleCombo.SelectionBoxDebug.cancelLabelString: Del Pos *ScaleCombo.SelectionBoxDebug.okLabelString: Set Item *ScaleCombo.SelectionBoxDebug.selectionLabelString: Specify Item *ComboBox.comboBoxType:Drop_Down_Combo_box *ComboBox*List.visibleItemCount:16 ! toggles specific *RowColumn.RCChild1.indicatorOn:indicator_check *RowColumn.RCChild1.labelString:Check *RowColumn.RCChild2.indicatorOn:indicator_check_box *RowColumn.RCChild2.labelString:CheckB *RowColumn.RCChild3.indicatorOn:indicator_cross *RowColumn.RCChild3.labelString:Cross *RowColumn.RCChild4.indicatorOn:indicator_cross_box *RowColumn.RCChild4.labelString:CrossB *RowColumn.RCChild18.toggleMode:XmTOGGLE_INDETERMINATE *RowColumn.RCChild18.labelString:3States *RowColumn.RCChild30.indicatorType:ONE_OF_MANY *RowColumn.RCChild30.labelString:Radio *RowColumn.RCChild31.indicatorType:ONE_OF_MANY_ROUND *RowColumn.RCChild31.labelString:Circular ! scale specific *Scale.slidingMode:thermometer *Scale.scaleWidth:15 *Scale.sliderVisual:FOREGROUND *Scale.Scrollbar.foreground:red *Scale.minimum:350 *Scale.maximum:430 *Scale.decimalPoints:1 *Scale.showValue: XmNEAR_BORDER *Scale.value:372 *Scale.showArrows:XmMAX_SIDE *Scale.editable:true ! misc *snapBackMultiple:5 *FileSelectionBox*HorScrollBar.showArrows:min_side *FileSelectionBox*VertScrollBar.showArrows:max_side *FileSelectionBox*directory:/etc *SubPane.Arrow2.arrowDirection:arrow_right *Arrow1.arrowDirection:arrow_down *Arrow1.sensitive:no ! CDE stuff *enableBtn1Transfer:True *enableEtchedInMenu:True *enableButtonTab:True *enableMenuInCascade:True *defaultButtonEmphasis:internal_highlight *enableToggleColor:True *enableDragIcon:True *enableThinThickness:True motif-2.3.8/demos/programs/sampler2_0/cherry.xpm0000644000175000017500000000327512672140200016513 00000000000000/* XPM */ /* $XConsortium: cherry.xpm /main/4 1995/07/18 16:04:49 drk $ */ static char * cherry.xpm [] = { "36 38 4 1", " c #64649595EDED", ". c #0F0FF0F00000", "X c #787867675050", "o c #FFFF00000000", " .......... ", " ......XX.... ", " ....XXXX.... ", " ...XXX....... ", " ............ ", " X ........ ", " XXX .... ", " ......XXX ", " .......XXXX ", " ...XX.. X XXX ", " ...XX.. X XXXX ", " ....X.... X XXX ", " ..X.... XX XXXXX ", " ..... XX XXXXX ", " X XX XX ", " XX X XX ", " XX XX XX ", " XX X XXX ", " XX XX X ", " ooooo X XX XX ", " ooooooo X Xoooo ", " ooooooooo XX oooooo ", " ooooooooooo XX oooooooo ", " ooooooooooo XX oooooooooo ", " ooooooooooo ooooo oooooooooo ", " ooooooooooo ooooooo oooooooooo ", " ooooooooo ooooooooo oooooooooo ", " ooooooo ooooooooo oooooooo ", " ooooo ooooooooo oooooo ", " ooooooooo oooo ", " ooooooooo ", " ooooooo ", " ooooo ", " ", " ", " ", " ", " "}; motif-2.3.8/demos/programs/sampler2_0/prev.xpm0000644000175000017500000000732412672140200016172 00000000000000/* XPM */ /* $XConsortium: prev.xpm /main/4 1995/07/18 16:05:34 drk $ */ static char * prev.xpm [] = { "52 63 7 1", " c none s background", ". c #000000000000", "X c #0F0FFFFFF0F0", "o c #CCCC32323232", "O c #FFFFFFFF0000", "+ c #FFFFFFFFFFFF", "@ c #545454545454", " .. ", " .... ", " ....... ", " ......... ", " ............ ", " .....XXX...... ", " .....XXXXXX...... ", " .....XXXXXXXXX..... ", " .....XXXXX...XXX...... ", " ......XXXXX....XXX...... ", " .........XXX......XX....... ", " ...........XXXX....XXX....... ", " ..............XXX...XXXXX....... ", " .....ooooo......XXXXXXXXXXXXX..... ", " .....oooooooo......XXXXXXXXXXXXX..... ", " .....ooooooooooo.....XXXX.....XXXXX.... ", " ....ooooo...oooo......XXX.......XXX..... ", " ..ooooo....oooo......XXXX.......X...... ", " . ...ooo......ooo.......XXX............O.. ", " . ..oooo....oooo.......XXXX..........OOO. ", " .. ...ooo...oooo.........XXX..........OOO.. ", " ... ..oooooooooo.........XXX..........OOO.. ", " .... ...ooooooo........................OOO... ", " .... ..oooo...........................OOO... ", " ...... ...oooo................O.........OOO.... ", " ...... ..oooo...............OOOO.......OOO.... ", " ....... ...ooo...............OOOOO......OOO..... ", " ........ ..oooo...............OOOOO.....OOO..... ", " ......... ...oooo.....++++++.....OOOO....OOO...... ", " ......... ..oooo...++++++++++....OOOOO..OOO...... ", "........... ....o...++++....++++....OOOOOOOOO.......", "........... .......++........++......OOOOOOO.......", " ........... ......+++.......++++......OOOOOO..... ", " ........... .....++......++++..........OOOO... .", " ........... .....++....++++.............O... ...", " ........... ....++..++++....++........... .....", " ........... ....++++++......++......... ...... ", " ........... ...++++.......+++....... ........ ", " ........... ....++........++...... .......... ", " ........... ...++++....++++.... ........... ", " ........... ....++++++++++... ............. ", " ........... .....++++++.... ............... ", " ........... ............@@@................ ", " ........... .........@@@.................. ", " ........... .......@@@.................... ", " ........... ....@@@..................... ", " ........... ..@@@....................... ", " ........... ......................... ", " ........... .......................... ", " ........... ........................ ", " ......... ...................... ", " ......... ..................... ", " ........ ................... ", " ....... ................. ", " ...... ................ ", " ...... .............. ", " .... ............ ", " .... ........... ", " ... ......... ", " .. ....... ", " . ...... ", " . .... ", " .. "}; motif-2.3.8/demos/programs/sampler2_0/Makefile.in0000644000175000017500000005553213211512766016553 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = sampler2_0$(EXEEXT) subdir = demos/programs/sampler2_0 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_sampler2_0_OBJECTS = sampler2_0.$(OBJEXT) sampler2_0_OBJECTS = $(am_sampler2_0_OBJECTS) sampler2_0_LDADD = $(LDADD) sampler2_0_DEPENDENCIES = ../../lib/Xmd/libXmd.a \ ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sampler2_0_SOURCES) DIST_SOURCES = $(sampler2_0_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/sampler2_0 build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/sampler2_0 datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = bee.xpm bomb.xpm cherry.xpm da.xpm girlface.xpm k7.xpm \ labir.xpm main.xpm pile.xpm prev.xpm spir.xpm stack.xpm \ text.xpm README sampler2_0.man sampler2_0.help \ XmdSampler2_0.ad sampler2_0_SOURCES = sampler2_0.c data_DATA = $(sampler2_0_SOURCES) $(EXTRA_DIST) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/sampler2_0/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/sampler2_0/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list sampler2_0$(EXEEXT): $(sampler2_0_OBJECTS) $(sampler2_0_DEPENDENCIES) $(EXTRA_sampler2_0_DEPENDENCIES) @rm -f sampler2_0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sampler2_0_OBJECTS) $(sampler2_0_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sampler2_0.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/sampler2_0/pile.xpm0000644000175000017500000000232012672140200016136 00000000000000/* XPM */ /* $XConsortium: pile.xpm /main/4 1995/07/18 16:05:28 drk $ */ static char * pile [] = { "24 35 6 1", " c #FFFFFFFFFFFF s background", ". c #000000000000", "X c #D3D3D3D3D3D3", "o c #CCCCCCCC0000", "O c #FFFFFFFF0000", "+ c #6666CDCDAAAA", " . ", " .X. ", " .XXX. ", " .XXXXX. ", " .XXXXXXX. ", " .XXXX.XXXX. ", " .XXXXX..XXXX. ", " .XXXXXX.X.XXXX. ", " .XXXXXXX.XX.XXXX. ", ".XXXXXXXX.X.X.XXXX. ", " .XXXXXXX..XXX.XXXX. ", " .XXXXXX.XXXXXXXX. ", " .o.XXXXX.XXXXXXX. ", ".ooo.XXXX.XXXXXX.o. ", " .ooo.XXX.XXXXX.ooo. ", " .ooo.XXXXXXX.ooo. ", " .O.ooo.XXXXX.ooo. ", ".OOO.ooo.XXX.ooo.O. ", " .OOO.ooo.X.ooo.OOO. ", " .OOO.ooo.ooo.OOO. ", " .+.OOO.ooooo.OOO. ", ".+++.OOO.ooo.OOO.+. ", " .+++.OOO.o.OOO.+++. ", " .+++.OOO.OOO.+++. ", " .+++.OOOOO.+++. ", " .+++.OOO.+++. ", " .+++.O.+++. ", " .+++.+++. ", " .+++++. ", " .+++. ", " .+. ", " . ", " ", " ", " "}; motif-2.3.8/demos/programs/sampler2_0/labir.xpm0000644000175000017500000000303312672140200016300 00000000000000/* XPM */ /* $XConsortium: labir.xpm /main/4 1995/07/18 16:05:15 drk $ */ static char * labir [] = { "34 35 5 1", " c #FFFFFFFFFFFF s background", ". c #FFFF7F7F5050", "X c #000000000000", "o c #AFAFEEEEEEEE", "O c #FFFFFFFF0000", " ", " .. .. ", " ..... . . ", " ....... ", " ", " XXXXXXXXXXXXXXXX ", " XoooooXoooooXooooX ", " XXXXXoXXXXoXXXXXoX ", " XoooooooooXooooooooX ", " XoXXXXXXXXXXXXXoXXXX ", " XooooooooooooooooooooX ", " XXXooXXXXXXXooXXXXXooX ", " XoooooXoooooXooooooXoooX ", " XooXXXoooXooXXXXXoooXXXX ", " XoooooooooXooooooooooooooX ", " XXXXXXXXXXXXXXXXXXXXXXXooX ", " XooooooooooooooooooooooooooX ", " XXXooooooooooooooooXoooXXXXX ", "XooooooooooooooooooooXoooooooX ", "XXXXXXXXXXXXXoooXXXXXXXXXXXXXX ", "XoooooooooooXoooXooooooooooooX ", "XoooooooooooX XooooooooooooX ", "XoooooooooooX XoooooooXXoooX ", "XoooooooooooX XoooooXXOOXooX ", "XXXXXXXXXXXXX XXXXXXOOOOXXXX ", " XOOXXOOX ", " XOXOOXXX ", " XOOOOOOX ", " XOOOXOOX ", " XXOOOOX ", " XXOX ", " X ", " ", " ", " "}; motif-2.3.8/demos/programs/sampler2_0/stack.xpm0000644000175000017500000000260112672140200016314 00000000000000/* XPM */ /* $XConsortium: stack.xpm /main/4 1995/07/18 16:05:47 drk $ */ static char * stack [] = { "29 35 6 1", " c #222222222222", ". c #FFFFFFFFFFFF s background", "X c #EEEEEEEEEEEE", "o c #61618787D9D9", "O c #FFFF7F7F5050", "+ c #FFFFFFFF0000", " ..........", " XXXXXXXXXXXXXXXXX .........", " XXXXXXXXXXXXXXXXX . ........", " XXXXXXXXXXXXXXXXX .. .......", " XXXXXXXXXXXXXXXXX ... ......", " XXXXXXXXXXXXXXXXX .... .....", " XXXXXXXXXXXXXXXXX ....", " XXoooooooooooooXXXXXXXX ....", " XXoOOOOOOOOOOOoXXXXXXXX ....", " XXoooooooooooooXXXXXXXX ....", " XXo+++++++++++oooXXXXXX ....", " XXo+++++++++++o+oXXXXXX ....", " XXo+++++++++++oooXXXXXX ....", " XXo+++++++++++oOoooXXXX ....", " XXo+++++++++++oOoOoXXXX ....", " XXo+++++++++++oOoooXXXX ....", " XXoooooooooooooOo+oooXX ....", " XXXXoOOOOOOOOOOOo+o+oXX ....", " XXXXoOOOOOOOOOOOo+oooXX ....", " XXXXooooooooooooo+oOoXX ....", " XXXXXXo+++++++++++oOoXX ....", " XXXXXXo+++++++++++oOoXX ....", " XXXXXXoooooooooooooOoXX ....", " XXXXXXXXoOOOOOOOOOOOoXX ....", " XXXXXXXXoOOOOOOOOOOOoXX ....", " XXXXXXXXoooooooooooooXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " ....", ".............................", ".............................", "............................."}; motif-2.3.8/demos/programs/sampler2_0/text.xpm0000644000175000017500000000265112672140200016200 00000000000000/* XPM */ /* $XConsortium: text.xpm /main/4 1995/07/18 16:05:53 drk $ */ static char * text [] = { "29 35 8 1", " c #444444444444", ". c #B4B4EDEDEBEB s background", "X c #FFFFFFFFFFFF", "o c #B2B222222222", "O c #FFFFFFFF0000", "+ c #6666CDCDAAAA", "@ c #5A5AF4F44C4C", "# c #FFFF7F7F5050", " ..........", " XXXXXXXXXXXXXXXXX .........", " XXXXXXXXXXXXXXXXX X ........", " XXXXXXXXXXXXXXXXX XX .......", " XXXooXXXXXXXXXXXX XXX ......", " XXoooOOO XX XXXX .....", " XXXXXXXXXXXXXXXXX ....", " XX OOX++++ XXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XX X @@@@ X XXXX ....", " XXXXXXXXXXXXXXoXoXXXXXX ....", " XX X X ### oo XXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXX +++X OOOOO XXXX ....", " XXX@@XXXXXXXXXXXXXXXXXX ....", " XX @ @@ +++ X XXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XX X OOOX X XXXX ....", " XXXXXXXXOXXXoXoXXXXXXXX ....", " XX X ##o## XXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXX+XXXXXXXXXXXXXXX ....", " XXXX + ++ X@@@@ XXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XX X X #### XXXX ....", " XXXXXXXXoXXXXXXXXXXXXXX ....", " XX #### X@@@ X XXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " ....", ".............................", ".............................", "............................."}; motif-2.3.8/demos/programs/sampler2_0/girlface.xpm0000644000175000017500000000147212672140200016770 00000000000000/* XPM */ /* $XConsortium: girlface.xpm /main/4 1995/07/18 16:05:02 drk $ */ static char * girlface [] = { "21 24 5 1", " c #FFFFFFFFFFFF", ". c #000000000000", "X c #FFFFCACAB6B6", "o c #FFFF00000000", "O c #B3B3F3F3EDED", " ", " ", " ...... ", " .....XXX. ", " oo.....XXXX. ", " ...ooo....XXXXX. ", "....oo.....XXX..X. ", ".. oo...XXXX..XXX. ", ". . oo...XXXXXXXXXX. ", "... .....X.XXXXXXX. ", " .......X..XXXXXXX. ", " .. .....XXXXXXXooo ", " . .....X.XXXXXoo ", " . ...XXXXXXXXX. ", " .XXXXXX... ", " ..XXXXX. ", " ...XXXXXX. ", " ..O..XXXXX... ", " ..OOOO..XXX..OO. ", " .OOOOOOOO....OOOO ", " OOOOOOOOOOOOOOOOOO ", " ", " ", " "}; motif-2.3.8/demos/programs/sampler2_0/k7.xpm0000644000175000017500000000314012672140200015527 00000000000000/* XPM */ /* $XConsortium: k7.xpm /main/4 1995/07/18 16:05:09 drk $ */ static char * k7 [] = { "36 35 5 1", " c #FFFFFFFFFFFF s background", ". c #222222222222", "X c #4040E0E0D0D0 s foreground", "o c green", "O c #CCCCCCCC0000", " ", " ", " ", " ", " ", " ", " ", " .............................. ", ".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", ".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", ".XXX........................XXX. ", ".XX. . . . . . . . . . . . ..XX. ", ".X. . . . . . . . . . . . . ..X. ", ".X.. . ................. . . .X. ", ".X. . ..oooooooooooooooo. . ..X. ", ".X.. ..oo..oo......oo..oo. . .X. ", ".X. . .o....o. .o....o.. ..X. ", ".X.. ..o.. .o. .o.. .o. . .X. ", ".X. . .oo..oo......oo..oo.. ..X. ", ".X.. . .oooooooooooooooo.. . .X. ", ".X. . . ................. . ..X. ", ".X.. . . . . . . . . . . . . .X. ", ".X. . . . . . . . . . . . . ..X. ", ".X............................X. ", ".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", ".XXXXX.....................XXXX. ", ".XXXX.OOOOOOOOOOOOOOOOOOOO..XXX. ", ".XXX.OOO.OO..OOOOOO..OO.OOO..XX. ", ".XXX.OOO.OO..OOOOOO..OO.OOO..XX. ", ".XXX.OOOOOOOOOOOOOOOOOOOOOO..XX. ", ".... .....O..O....O.. ..... .... ", " .... .................... .... ", " ", " ", " "}; motif-2.3.8/demos/programs/sampler2_0/sampler2_0.help0000644000175000017500000000321712672140200017303 00000000000000Overview Sampler2_0 demo: A 2.0-features oriented demo Sampler2_0 provides a demonstration of almost all the new visible features/widgets the OSF/Motif 2.0 release. It uses a Notebook as its main component and each page demonstrate s one or more different new functionalities: - Container in spatial layout - Container in Outline - PanedWindow - CDE FileSelectionBox - New ToggleButton types - ComboBox, Spinbox and Thermometer Scale. Files: XmdSampler2_0: the resource file is very important for usability. Run 'xrdb XmdSampler2_0' or something like XFILESEARCHPATH=XmdSampler2_0 sampler2_0. X Defaults: The class of this application is XmdSampler2_0. Editres: Sampler2_0 is Editres aware, so you can use 'editres' to see the names of the widgets in the instance hierarchy. CDE: Sampler2_0 app-defaults sets the CDE switch on, in particular, the FileSB is the CDE one, the transfer is done using Btn1 and the default drag icons are the CDE ones. Some new 2.0 enhancements besides the new widgets: - Support for *ShadowThickness:1: everywhere. - Support for XPM files: everywhere. - Auto-drag: drag anything on the edge of a ScrolledWindow ClipWindow shadow and it will drag. - New UnitType syntax and horizontal PanedWindow: on page 3. - Scrollbar's arrows on the same side: in the FSB, page 4. - SnapBack scrollbar: in the FSB, page 4. - List new selectColor resource: on any List. - Toggle check and cross mark. + Round and indeterminate mode. - Thermometer slider and tic marks to Scale. motif-2.3.8/demos/programs/sampler2_0/bee.xpm0000644000175000017500000000404312672140200015744 00000000000000/* XPM */ /* $XConsortium: bee.xpm /main/4 1995/07/18 16:04:36 drk $ */ static char * bee.xpm [] = { "44 39 5 1", " c none", ". c #222222222222", "X c #D2D2B4B48C8C", "o c #B0B0C4C4DEDE", "O c #FFFFFFFF0000", " . . .... ", " . ..X.. ..XX... ", " ..XXX. .XXXXXXX.. ", " . ..XXXXX..XXXXXXXX.. ", " ..XX.XX..XXXXXXXXXX.. ", " . .XX.XXX.XXXXXXXX.XXX. .", " ..XX.XX.XXXXXXX..XXXX. ", " . .XXX.X..XXXXXX.XXXXXX. ", " .XX.XX.XXXXXX.XXXXXXX. .", " . .XX.X..XXXXXX.XXXXXXX. ", " . .XX.XX.XXXXX..XXXXXXX.. ", " .. . .XX.X.XXXXX.XXXXXXXXX. .", " . .X.XX.XXX..XXXXXXXXXX. ", ".. .. . .X.X.XXX.XXXXXXXXXXX. ", " ... . .XXX.X..XXXXXXXXXX.. . ", " ..... .XX..XXXXXXXXXX... ", " ..o... .XX.XXXXXXX..... . ", " ..oooooo. .......... . ", " .ooooooooo................ . ", " .oo.oooooooo......OOO....OO.. ", " .oo...ooooooo.O....OOO.....OO... ", " .ooo...ooooooo.O.....OOO....OO..... ", " .oooo.oooooooo.O.....OOO.....OO...O.. ", ".ooooooooo.oooo.O.....OOO.....OO...OO.. ", ".oooooooo.ooooo.O.....OOO.....OO....OO.. ", " .oooooo.oooooo.O.....OOO.....OO....OO... ", " ......oooooo.OO.....OOO.....OO....OO.... ", " ..ooooooo.OO......OOO.....OO....OO... ", " .......OO.......OOO....OO.....OO.. ", " ..........OOO....OO....OO.. ", " ..........OOO....OO...... ", " ........OOO.....O..... ", " .......OOO....OO..... ", " . ....OOO........ ", " . ......... . ", " . .. .. ", " . .. ... ", " ... .. .. ", " .. ..... .... "}; motif-2.3.8/demos/programs/sampler2_0/README0000644000175000017500000000124612672140200015345 00000000000000/* $XConsortium: README /main/4 1996/07/15 14:08:37 drk $ */ A 2.0-features oriented demo. ----------------------------- Sampler2_0 provides a demonstration of almost all the new visible features/widgets the OSF/Motif 2.0 release. It uses a Notebook as its main component and each page demonstrates one or more different new functionalities: - Container in spatial layout - Container in Outline - PanedWindow - CDE FileSelectionBox - New ToggleButton types - ComboBox, Spinbox and Thermometer Scale. XmdSampler2_0, the app-default file, is very important for usability. Do something like: XENVIRONMENT=XmdSampler2_0 sampler2_0 - Daniel Dardailler motif-2.3.8/demos/programs/sampler2_0/spir.xpm0000644000175000017500000000160712672140200016171 00000000000000/* XPM */ /* $XConsortium: spir.xpm /main/4 1995/07/18 16:05:41 drk $ */ static char * spir [] = { "28 21 5 1", " c #000000000000", ". c #FFFFFFFFFFFF s background", "X c #222222222222", "o c #ADADD8D8E6E6", "O c #D3D3D3D3D3D3", " .......Xoooooo ..... oo", " ......Xooooo ....... o", " ......Xoooo ......... ", " ......Xoooo ......... ", " ....Xoooo X....... ", " ..Xoo XXOOO..... ", ".. X XOOOO ..... ", ".. X OOOO O ...... o", ".. XOOOOOO ..... oo", ".... OOOOO ooo", ".... OOOOO oo oooo", "... OOOO oooooo ooooo", ".. OOOO oooooooooooooooooo", ".. OOO Xooooooooooooooooooo", ". O .Xooooooooooooooooooo", ". ...Xooooooooooooooooooo", " ....Xooooooooooooooooooo", " .....Xooooooooooooooooooo", " .....Xooooooooo ooooo", " ......Xoooooooo oooo", " .......Xooooooo ooo"}; motif-2.3.8/demos/programs/sampler2_0/sampler2_0.man0000644000175000017500000000405712672140200017131 00000000000000.\" $XConsortium: sampler2_0.man /main/5 1996/04/22 23:19:01 pascale $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH sampler2_0 1X MOTIF "Demonstration programs" .SH NAME \*Lsampler2_0\*O : a 2.0 features showcase .SH SYNOPSIS .sS \*Lsampler2_0\*O .sE .SH DESCRIPTION \*LSampler2_0\*O provides a demonstration of of almost all the new visible features the OSF/Motif 2.0 release. It uses a Notebook as its main component and each page demonstrates one or more different new functionalities: - Container in spatial layout - Container in Outline - PanedWindow - CDE FileSelectionBox - New ToggleButton types - ComboBox, Spinbox and Thermometer Scale. .SH Files .nf .ta 1.2i XmdSampler2_0: the app-default file is very important for usability. Try something like: XENVIRONMENT=XmdSampler2_0 sampler2_0 .fi .SH X Defaults The class of this application is \fIXmdSampler2_0\fR. .SH Editres: Sampler2_0 is Editres aware, so you can use 'editres' to see the names of the widgets in the instance hierarchy. .SH CDE: Sampler2_0 app-defaults sets the CDE switch on, in particular, the FileSB is the CDE one, the transfer is done using Btn1 and the default drag icons are the CDE ones. motif-2.3.8/demos/programs/sampler2_0/bomb.xpm0000644000175000017500000000320412672140200016126 00000000000000/* XPM */ /* $XConsortium: bomb.xpm /main/4 1995/07/18 16:04:43 drk $ */ static char * bomb.xpm [] = { "36 35 7 1", " c none s background", ". c #0F0FF0F00000", "X c #FFFFFFFF0000", "o c #FFFF00000000", "O c #D2D2B4B48C8C", "+ c #222222222222", "@ c #FFFFFFFFFFFF", " ", " . . ", " . ", " X . o .XX ", " .o XX .XX ", " .oX .X X oo ", " . XX Xoo ", " OOOOOOO XXo . . . ", " OOO OOO .XXX ", " OO OO. oo oX ", " O ooX o. ", " O o o oooo. X ", " +++++++ .o oXX ooX. ", " +++++++ . o . o . ", " +++++++++++ ", " +++++++++++++++ . ", " +++++++++++++++ ", " +++++++++++++++++ ", " +++++++++++++++++ ", "++++++++++++++@++++ ", "+++++++++++++++++++ ", "+++++++++++++++@+++ ", "+++++++++++++++@+++ ", "+++++++++++++++@+++ ", "+++++++++++++++++++ ", "++++++++++++++@++++ ", " +++++++++++++++++ ", " +++++++++++@+++++ ", " +++++++++++++++ ", " +++++++++++++++ ", " +++++++++++ ", " +++++++ ", " ", " ", " "}; motif-2.3.8/demos/programs/sampler2_0/da.xpm0000644000175000017500000000254612672140200015603 00000000000000/* XPM */ /* $XConsortium: da.xpm /main/4 1995/07/18 16:04:56 drk $ */ static char * da [] = { "29 35 5 1", " c #333333333333", ". c #FFFFFFFFFFFF s background", "X c #5A5AF4F44C4C", "o c #B2B222222222", "O c #FFFF7F7F5050", " ..........", " XXXXXXXXXXXXXXXXX .........", " XX X XXXXXXXXXX . ........", " XX X XXXXXXXXXX .. .......", " XX X XXXXXXXXXX ... ......", " XX X XXXXXXXXXX .... .....", " XX X XXXXXXXXXX ....", " XX X XXXXXXXXXXXXXXXX ....", " XX X XXXXXXXXXXXXXXXX ....", " XX X XXXXXXXXXXXXXXXX ....", " XX XXXXXXXXXXXXXXXX ....", " XX ... XXXXXXXXXXXXXXXX ....", " XX ... XXXXXXXXXXXXXXXX ....", " XX ... XXXXXXXXXXXXXXXX ....", " XX ... XXXXXXXXXXXXXXXX ....", " XX ... XXXXXXXXXXXXXXXX ....", " XXX XXXXXXXXXXXXXXXXX ....", " XX XXXXXXXXXXXXXXXX ....", " XX o XXXXXXXXXXXXXXXX ....", " XX oXXXXXXXXXXXXXXX ....", " XX XXXXXXXXXXXXXXX ....", " XX o XXXXXXXXXXXXXXX ....", " XX ooXXXXXXXXXXXXXXX ....", " XXooo ooXXXX XOOOOOOOOX ....", " XXoo ooXXXXXXXO.OOOOOX ....", " XXXooooXXXXXXOOOOOOOOOX ....", " XXXooooXXXXOOOOOOOOOOOX ....", " XXXXoo XXXXXXOOOOOOOOOX ....", " XXXXXXo XXOOOOOOOOOOOOX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " XXXXXXXXXXXXXXXXXXXXXXX ....", " ....", ".............................", ".............................", "............................."}; motif-2.3.8/demos/programs/sampler2_0/Makefile.am0000644000175000017500000000113713145162623016531 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/sampler2_0 datadir = ${prefix}/share/Xm/sampler2_0 EXTRA_DIST = bee.xpm bomb.xpm cherry.xpm da.xpm girlface.xpm k7.xpm \ labir.xpm main.xpm pile.xpm prev.xpm spir.xpm stack.xpm \ text.xpm README sampler2_0.man sampler2_0.help \ XmdSampler2_0.ad bin_PROGRAMS = sampler2_0 sampler2_0_SOURCES = sampler2_0.c data_DATA = $(sampler2_0_SOURCES) $(EXTRA_DIST) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/fileview/0000755000175000017500000000000013211513007014407 500000000000000motif-2.3.8/demos/programs/fileview/German.uil0000644000175000017500000000371012672140200016255 00000000000000! $XConsortium: German.uil /main/4 1996/07/15 15:14:32 drk $ ! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! Motif File Viewer -- main uil file ! ! Created October 1991 Vania Joloboff module mce version = 'v1.1' names = case_sensitive value searchprompt : exported compound_string ('Zeichenkette zum Suchen eingeben'); value fatal_error : exported compound_string ('Fehler'); value no_file : exported compound_string ('Keine Datei'); value no_pane : exported compound_string ('Keine panel zu schliessen'); value no_pattern : exported compound_string ('Zeichenkette zum Suchen eingeben'); value no_search : exported compound_string ('Zeichenkette zu lang'); value not_found : exported compound_string ('Zeichenkette nicht gefunden: '); value empty_file : exported compound_string ('Leere Datei'); value help_file : exported compound_string ('Im Menü Datei: Datei öffnen mit Öffnen, beenden mit Beenden'); value help_view : exported compound_string ('Im Menü Sicht: Ausschnitt öffnen mit Erzeugen, schließen mit Schließen'); value help_search : exported compound_string (' Zeichenkette auffinden mit Suchen'); end module; motif-2.3.8/demos/programs/fileview/English.uil0000644000175000017500000000364212672140200016441 00000000000000! $XConsortium: English.uil /main/4 1996/07/15 15:13:35 drk $ ! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! Motif File Viewer -- main uil file ! ! Created October 1991 Vania Joloboff module mce version = 'v1.1' names = case_sensitive value searchprompt : exported compound_string ('String searched'); value fatal_error : exported compound_string ('Error'); value no_file : exported compound_string ('Cannot Open File'); value no_pane : exported compound_string ('No pane to close'); value no_pattern : exported compound_string ('Enter string to be searched'); value no_search : exported compound_string ('Searched string too long'); value not_found : exported compound_string ('String not found: '); value empty_file : exported compound_string ('No File'); value help_file : exported compound_string ('In File Menu: open a file with Open, close it with Close'); value help_view : exported compound_string ('In Help menu: open a new pane with New Pane, close it with Close Pane'); value help_search : exported compound_string (' Search a string with Search'); end module; motif-2.3.8/demos/programs/fileview/English.df0000644000175000017500000000474712672140200016250 00000000000000! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY Fileview*fontList : *-helvetica-bold-r-normal--24-*-iso8859-1: *main.menubar*fontList : *-helvetica-bold-r-normal--24-*-iso8859-1: *primary*Foreground : Black *main*Background : RosyBrown1 *fsb*Background : RosyBrown1 !*primary.Geometry: 400x400 *main*panes*XmText*resizeWidth: True *main.work.resizePolicy: RESIZE_GROW *main.work.panes*allowResize: True *main.work.panes.refigureMode: True *main.work.panes*sash*background: Turquoise *main*XmText*fontList: *-lucida-medium-r-normal-sans-20-*-iso8859-1: *main.work.panes*sashHeight: 10 *main.work.panes*sashIndent: -32 *main.work.panes*sashWidth: 40 *main.work.panes.spacing: 20 *main.work.panes*XmSeparatorGadget*Margin: 10 *main*menubar*background: PaleGreen *main*menubar*TearOffControl.shadowThickness : 4 *main*menubar*TearOffControl.separatorType : XmSHADOW_ETCHED_IN_DASH *primary.main.menubar*fileMenu.exit.labelString: Quit *primary.main.menubar*fileMenu.close.labelString: Close *main*menubar.file.labelString: File *main.menubar.view.labelString: View *main.menubar.help.labelString: Help *main.menubar*fileMenu.opennew.labelString: Open New Shell *main.menubar*fileMenu.open.labelString: Open New File *main.menubar*viewMenu.search.labelString: Search *main.menubar*viewMenu.new_pane.labelString: New Pane *main.menubar*viewMenu.kill_pane.labelString: Close Pane *main.menubar*helpMenu.help_view.labelString: Tutorial *search_box*fontList: *-helvetica-bold-r-normal--24-*-iso8859-1: *search_box*dialogTitle: Search Dialog *search_box.form.dir_frame*title.labelString : Direction *search_box.form.dir_frame*forward.labelString: Forward *search_box.form.dir_frame*backward.labelString: Backward motif-2.3.8/demos/programs/fileview/French.uil0000644000175000017500000000365712672140200016263 00000000000000! $XConsortium: French.uil /main/4 1996/07/15 15:14:01 drk $ ! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! Motif File Viewer -- main uil file ! module messages version = 'v1.1' names = case_sensitive value searchprompt : exported compound_string('Chaîne cherchée'); value fatal_error : exported compound_string ('Erreur'); value no_file : exported compound_string ('Fichier non ouvert'); value no_pane : exported compound_string ('Pas de panneau à ouvrir'); value no_pattern : exported compound_string('Entrer la chaîne à chercher'); value no_search : exported compound_string('Chaîne cherchée trop longue'); value not_found : exported compound_string('Chaine non trouvée'); value empty_file : exported compound_string ('Fichier Vide'); value help_file : exported compound_string ('Dans le menu Fichier : ouvrir un fichier avec Ouvrir, quitter avec Quitter'); value help_view : exported compound_string ('Dans le menu Aide : ouvrir un panneau avec Ouvrir Panneau, le fermer avec Fermer'); value help_search : exported compound_string (' chercher une chaîne avec Chercher'); end module; motif-2.3.8/demos/programs/fileview/fileview.h0000644000175000017500000000734412672140200016323 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: fileview.h /main/5 1995/07/14 10:03:05 drk $ */ #include #include #include #if (! defined X_H) #include #endif #if (! defined _XLIB_H) #include #endif #if (! defined _Xm_h) #include #endif #if (defined DECLAREGLOBAL) #define global #else #define global extern #endif /* * The "more" program Motif-ied * * Allow a user to view files in separate windows. * There is one top level shell created per file opened. * Each top level shell is parent of a Main Window, the work area * of which is a PanedWindow. * * * The File menu contains commands Open, and Exit or Close * In the primary top level shell, Exit exits the client * In the secondaries, Close closes the shell * * Open * On selecting Open/File in the menu bar, a file selection box * is mapped to choose the file. * * If OpenFile is successful, close first the current file opened, * destroy all existing panes, and display the new file. * * Close: this entry only exists on the secondary windows. * It destroys the top level shell and closes the file. * * Exit: this entry only exists on the primary window * closes the file and exits. * * The View menu: * * New Pane: Creates a new pane in the paned window * Delete Pane: delete the current pane. * Search: pops a dialogue box for searching text in the file * On the OK callback of the dialogue box * search the string. * if found show in current pane * else pop up dialogue box again. * */ /* * Implementation notes. * * There is a data structure of type View that encapsulates * all information relative to each top level shell in the application * A View contains: the shell id, the panedwindow id, the file descriptor, * the number of panes, the file selection box id, * * This data structure is allocated at shell creation time * and passed around as client data to the callbacks or as the userdata * of the widgets. * * For each pane in the paned window, there is one Pane data structure. * THIS PROGRAM IS NOT REALLY INTERNATONALIZED. * LABELS ARE IN ENNGLISH */ typedef struct _Pane { Widget text; struct _Pane * next; struct _Pane * previous; } Pane, *PanePtr; typedef struct { Widget shell; Widget path; Widget paned_window; Widget fsb; Widget view_cascade; Widget search_entry; int n_panes; PanePtr panes; PanePtr current_pane; Widget text_source; Widget search_box; Widget warning_box; Widget error_box; Widget direction; Dimension text_height; } View, *ViewPtr; /* * Global variables, initialized in main.c */ global XtAppContext theContext; global Display * theDisplay; global Widget theWidgetRoot; global Widget thePrimaryShell; /* Public Widget names, initialized in main.c */ global String new_pane ; global String kill_pane ; global String search ; global String help ; motif-2.3.8/demos/programs/fileview/file.h0000644000175000017500000000212412672140200015417 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: file.h /main/5 1995/07/14 10:02:43 drk $ */ #include #include #include #include #define file_h #include "fileE.h" #undef file_h motif-2.3.8/demos/programs/fileview/Makefile.in0000644000175000017500000005662013211512766016420 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = fileview$(EXEEXT) subdir = demos/programs/fileview ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_fileview_OBJECTS = main.$(OBJEXT) text.$(OBJEXT) file.$(OBJEXT) fileview_OBJECTS = $(am_fileview_OBJECTS) fileview_LDADD = $(LDADD) fileview_DEPENDENCIES = ../../../lib/Xm/libXm.la \ ../../../lib/Mrm/libMrm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(fileview_SOURCES) DIST_SOURCES = $(fileview_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/fileview build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/fileview datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in fileview_SOURCES = main.c text.c file.c file.h fileE.h fileview.h main.h \ mainE.h text.h textE.h EXTRA_DIST = $(UILS) English.df French.df German.df README Fileview.ad data_DATA = French.uid German.uid English.uid $(fileview_SOURCES) $(EXTRA_DIST) UILS = French.uil German.uil English.uil LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/fileview/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/fileview/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list fileview$(EXEEXT): $(fileview_OBJECTS) $(fileview_DEPENDENCIES) $(EXTRA_fileview_DEPENDENCIES) @rm -f fileview$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fileview_OBJECTS) $(fileview_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dataDATA .PRECIOUS: Makefile all: French.uid German.uid English.uid French.uid: French.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil German.uid: German.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil English.uid: English.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) French.uid German.uid English.uid # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/fileview/French.df0000644000175000017500000000522112672140200016050 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! HISTORY *main.menubar*fontList : *-helvetica-bold-r-normal--24-*-iso8859-1: *primary*Foreground : Black *main*Background : RosyBrown1 *fsb*Background : RosyBrown1 !*primary.Geometry: 400x400 *main*panes*XmText*resizeWidth: True *main.work.resizePolicy: RESIZE_GROW *main.work.panes*allowResize: True *main.work.panes.refigureMode: True *main.work.panes*sash*background: Turquoise *main*XmText*fontList: *-lucida-medium-r-normal-sans-20-*-iso8859-1: *main.work.panes*sashHeight: 10 *main.work.panes*sashIndent: -32 *main.work.panes*sashWidth: 40 *main.work.panes.spacing: 20 *main.work.panes*XmSeparatorGadget*Margin: 10 *main*menubar*background: PaleGreen *main*menubar*TearOffControl.shadowThickness : 4 *main*menubar*TearOffControl.separatorType : XmSHADOW_ETCHED_IN_DASH *Cancel.labelString: Annuler *OK.labelString: OUI *Help.labelString: Aide *Apply.labelString: Filtrer *Selection.labelString: Selection *fileListLabelString: Fichiers *filterLabelString: Filtre *dirListLabelString: Catalogues *primary.main.menubar*fileMenu.exit.labelString: Quitter *primary.main.menubar*fileMenu.close.labelString: Fermer *main*menubar.file.labelString: Fichier *main.menubar.view.labelString: Vue *main.menubar.help.labelString: Aide *main.menubar*fileMenu.opennew.labelString: Ouvrir Nouveau *main.menubar*fileMenu.open.labelString: Ouvrir *main.menubar*viewMenu.search.labelString: Chercher *main.menubar*viewMenu.new_pane.labelString: Ouvrir Panneau *main.menubar*viewMenu.kill_pane.labelString: Fermer Panneau *main.menubar*helpMenu.help_view.labelString: Tutorial *search_box*fontList: *-helvetica-bold-r-normal--24-*-iso8859-1: *search_box*dialogTitle: Chercher *search_box.form.dir_frame*title.labelString : Direction *search_box.form.dir_frame*forward.labelString: En Avant *search_box.form.dir_frame*backward.labelString: En Arrière motif-2.3.8/demos/programs/fileview/main.c0000644000175000017500000005157113066310437015442 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$TOG: main.c /main/8 1997/03/31 13:54:57 dbl $" #endif #endif #include "main.h" /* =============================================================== * The Done Callback. Set the locale to the selected one * in the radio box */ static void DoneCallback(Widget button, XtPointer client_data, XtPointer call_data) { ViewPtr this = (ViewPtr) client_data; Widget b; XtVaGetValues(locale_box, XmNmenuHistory, &b, NULL); XtVaGetValues(b, XmNuserData, &SelectedLocale, NULL); LocaleName = LocaleTable[CurrentOS][SelectedLocale]; printf ("language selected\n"); } /* =============================================================== * Create a dialog box to verify the OS and choose the locale */ static Widget CreateLocaleBox(ViewPtr this, OS os, String os_name) { Widget select_box, pick_form; Widget framed[2], frame; Widget languages[MaxLanguage+1] ; Widget oss[MaxOS+1] ; int i, lang; Arg args[20]; int count; int n; Widget os_panel; Widget lang_frame, os_frame; char s[255]; int def_lang = 0; XmString msg, msg1, msg2; n = 0; XtSetArg(args[n], XmNmessageString, XmStringCreateSimple("Select a language, Verify your OS")); n++; XtSetArg(args[n], XmNokLabelString, XmStringCreateSimple("Done")); n++; select_box = XmCreateTemplateDialog(theWidgetRoot, "search_box", args, n); XtAddCallback(select_box, XmNokCallback, (XtCallbackProc) DoneCallback, (XtPointer) this); n = 0; pick_form = XmCreateForm(select_box, "form", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; lang_frame = XmCreateFrame(pick_form, "lang_frame", args, n); n = 0; XtSetArg(args[n], XmNframeChildType, XmFRAME_TITLE_CHILD); n++; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple("Language")); n++; framed[0] = XmCreateLabel(lang_frame, "title", args, n); n = 0; XtSetArg(args[n], XmNframeChildType, XmFRAME_WORKAREA_CHILD); n++; XtSetArg(args[n], XmNisAligned, True); n++; XtSetArg(args[n], XmNradioAlwaysOne, True); n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END); n++; XtSetArg(args[n], XmNentryClass, xmToggleButtonWidgetClass); n++; XtSetArg(args[n], XmNorientation, XmVERTICAL); n++; framed[1] = XmCreateRadioBox(lang_frame, "lang_box", args, n); locale_box = framed[1]; def_lang = 0; for (count= 0, i = 0; i < MaxLanguage ; i++) { if (SupportedLocale [os][i]) { if (i == French) def_lang = French; n = 0; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple(LangList[i])); n++; XtSetArg(args[n], XmNuserData, i); n++; languages[count] = XmCreateToggleButton(framed[1], LangList[i], args, n); ++count; } else printf("%s does not support %s\n", OSList[os], LangList[i]); } XtManageChildren(languages, count); XtManageChildren(framed, 2); XtManageChild(lang_frame); XmToggleButtonSetState(languages[def_lang], True, True); n = 0; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNtopWidget, lang_frame); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; if (os < MaxOS) { sprintf(s, "Your Operating System is %s", os_name); msg = XmStringCreateSimple(s); XtSetArg(args[n], XmNlabelString, msg); n++; os_frame = XmCreateLabel(pick_form, "title", args, n); } else { os_frame = XmCreateFrame(pick_form, "os_frame", args, n); n = 0; XtSetArg(args[n], XmNframeChildType, XmFRAME_TITLE_CHILD); n++; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple("Operating System")); n++; framed[0] = XmCreateLabel(os_frame, "title", args, n); n = 0; XtSetArg(args[n], XmNframeChildType, XmFRAME_WORKAREA_CHILD); n++; XtSetArg(args[n], XmNisAligned, True); n++; XtSetArg(args[n], XmNradioAlwaysOne, True); n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END); n++; XtSetArg(args[n], XmNentryClass, xmToggleButtonWidgetClass); n++; XtSetArg(args[n], XmNorientation, XmVERTICAL); n++; framed[1] = os_box = XmCreateRadioBox(os_frame, "os_box", args, n); n = 0; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple(OSList[i])); n++; for (i = 0; i < MaxOS ; i++) { n = 0; XtSetArg(args[n], XmNuserData, i); n++; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple(OSList[i])); n++; oss[i] = XmCreateToggleButton(framed[1], OSList[i], args, n); } n = 0; XtSetArg(args[n], XmNuserData, MaxOS); n++; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple("Other")); n++; oss[MaxOS] = XmCreateToggleButton(framed[1], OSList[i], args, n); XtManageChildren(oss, MaxOS+1); XtManageChildren(framed, 2); XmToggleButtonSetState(oss[MaxOS-1], True, True); } XtManageChild(os_frame); XtManageChild(pick_form); return select_box; } /* =============================================================== * Create a dialog box to verify the OS and choose the locale */ static void SelectLocale(ViewPtr this, OS os, String os_name) { Widget select_box = NULL; if (locale_box == NULL) select_box = CreateLocaleBox(this, os, os_name); XtManageChild(select_box); } /* =============================================================== * Main: Initialize, create the application shell and loop * Check that the language specified is * supported by fileview and libX and libC. */ int main(int argc, char *argv[]) { #define C_locale_name "C" char **p1, **p2; int i; ViewPtr this; XEvent event; String new_locale; char msg[128]; String lang = getenv("LANG"); OS os; struct utsname os_def; char filename[255]; Language l; /* * init widget names */ new_pane = "new_pane"; kill_pane = "kill_pane"; search = "search"; /* save argc and argv */ save_argc = argc; save_argv = (char **) XtCalloc(argc, sizeof(char *)); for ( p1 = argv, p2 = save_argv, i = argc; i-- > 0 ; ) *p2++ = *p1++ ; /* alloc the object for the primary view */ this = (ViewPtr) XtCalloc(sizeof(View), 1); XtToolkitInitialize(); MrmInitialize(); theContext = XtCreateApplicationContext(); uname(&os_def); for (os = 0; os < MaxOS ; os++) if (strcmp(os_def.sysname, OSList[os]) == 0) break; CurrentOS = os; for (l = 1; l < MaxLanguage; l++) { if (setlocale(LC_ALL, LocaleTable[os][l]) == NULL || ! XSupportsLocale()) { sprintf(msg, "Locale `%s' not supported by C and/or X library", LocaleTable[os][l]); XtAppWarning(theContext, msg); SupportedLocale [CurrentOS][SelectedLocale] = False; } } setlocale(LC_ALL, "C"); theDisplay = XtOpenDisplay(theContext, NULL, myName, myClass, NULL, 0, &argc, argv); theWidgetRoot = XtAppCreateShell(myName, myClass, applicationShellWidgetClass, theDisplay, NULL, 0); XtGetApplicationResources(theWidgetRoot, &FileViewResources, FileViewResourcesSpecs, XtNumber(FileViewResourcesSpecs), (ArgList) NULL, 0); do { SelectLocale(this, os, os_def.sysname); do { XtAppNextEvent(theContext, &event); XtDispatchEvent(&event); } while (LocaleName == NULL); new_locale = setlocale(LC_ALL, LocaleName); if (new_locale == NULL || ! XSupportsLocale() ) { SupportedLocale [CurrentOS][SelectedLocale] = False; new_locale = NULL; } else if (! XSetLocaleModifiers("")) XtAppWarning(theContext, "X locale modifiers not supported, using default"); } while ( new_locale == NULL); XtDestroyWidget(theWidgetRoot); XtCloseDisplay(theDisplay); XtSetLanguageProc(theContext, (XtLanguageProc) MyLanguageProc, theContext); theDisplay = XtOpenDisplay(theContext, NULL, myName, myClass, NULL, 0, &argc, argv); theWidgetRoot = XtAppCreateShell(myName, myClass, applicationShellWidgetClass, theDisplay, NULL, 0); if (strcmp(FileViewResources.version, "NoValue") == 0) { Screen * screen = XtScreenOfObject(theWidgetRoot); XrmDatabase db = XtScreenDatabase(screen); strcpy(filename, LangList[SelectedLocale]); strcat(filename, ".df"); printf("default %s\n", filename); XrmCombineFileDatabase(filename, &db, True); } strcpy(filename, LangList[SelectedLocale]); strcat(filename, ".uid"); uid_files[0] = filename; if (MrmOpenHierarchyPerDisplay(theDisplay, 1, uid_files, NULL, &theUIDdatabase) != MrmSUCCESS) /* || (MrmRegisterNames(regvec, regnum) != MrmSUCCESS)) */ { fprintf (stderr, "Cannot open hierarchy defined by %s\n", uid_files[0]); } NewFileShell(theWidgetRoot, this, save_argc, save_argv); XtPopup(this->shell, XtGrabNone); /* XtRealizeWidget(this->text_source); */ XtAppMainLoop(theContext); return 0; /* make compiler happy */ } /* =============================================================== * The language proc. * Note: Xt guarantees that xnl is not NULL. No need to test it. * Return a language string usable by XtResolvePathname. */ static String MyLanguageProc(Display * dpy, String xnl, XtAppContext theContext) { return setlocale(LC_CTYPE, NULL); } /* =============================================================== * Create a new top level shell. * If primary is true create a quit entry, * else a close entryn */ static ViewPtr NewFileShell(Widget parent, ViewPtr this, int argc, char *argv[]) { Widget mw, children[4], menubar, entry; Arg args[20]; String names[8]; XtCallbackProc procs[8]; XtPointer private[8]; int n; Dimension width, height; WidgetClass class; Bool primary = True; #define SetMenuEntry(k,l,p,d) names[k]=l;procs[k]=p;private[k]=d; n = 0; XtSetArg(args[n], XmNallowShellResize, True); n++; if (this == NULL) { this = (ViewPtr) XtCalloc(sizeof(View), 1); XtSetArg(args[n], XmNtitle, "File" ); n++; class = topLevelShellWidgetClass; } else { XtSetArg(args[n], XmNargv, argv); n++; XtSetArg(args[n], XmNargc, argc); n++; XtSetArg(args[n], XmNtitle, "File View Main"); n++; class = applicationShellWidgetClass; } this->shell = XtCreatePopupShell("primary", class, parent, args, n); /* * Create the main window, the menubar and the pane * Store the view in userData for further use. */ n = 0; XtSetArg(args[n], XmNuserData, this); n++; mw = XmCreateMainWindow(this->shell, "main", args, n); children[0] = XmCreateMenuBar(mw, "menubar", NULL, 0); n = 0; SetMenuEntry(n, "open", (XtCallbackProc) OpenFileCallback, (XtPointer) this); n++; SetMenuEntry(n, "opennew", (XtCallbackProc) OpenNewShellCallback, (XtPointer) this); n++; SetMenuEntry(n, NULL, NULL, NULL); n++; if (primary) { SetMenuEntry(n, "exit", (XtCallbackProc) ExitCallback, (XtPointer) parent); } else { SetMenuEntry(n, "close", (XtCallbackProc) CloseCallback, (XtPointer) this); } n++; (void) CreateMenuBarEntry(children[0], "file", names, procs, private, n); n = 0; SetMenuEntry(n, new_pane, (XtCallbackProc) NewPaneCallback, (XtPointer) this); n++; SetMenuEntry(n, kill_pane,(XtCallbackProc) KillPaneCallback, (XtPointer) this); n++; SetMenuEntry(n, search, (XtCallbackProc) FindCallback, (XtPointer) this); n++; this->view_cascade = CreateMenuBarEntry(children[0], "view", names, procs, private, n); SetSensitive(this->view_cascade, new_pane, False); SetSensitive(this->view_cascade, kill_pane, False); SetSensitive(this->view_cascade, search, False); SetMenuEntry(0, "help_view", (XtCallbackProc) HelpCallback, (XtPointer) this); entry = CreateMenuBarEntry(children[0], "help", names, procs, private, 1); n = 0; XtSetArg(args[n], XmNmenuHelpWidget, entry); n++; XtSetValues(children[0], args, n); XtManageChild(children[0]); n = 0; width = WidthOfScreen(XtScreenOfObject(mw)) / 2 ; height = HeightOfScreen(XtScreenOfObject(mw)) * 2 / 3 ; XtSetArg(args[n], XmNwidth, width); n++; XtSetArg(args[n], XmNheight, height); n++; XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); n++; children[1] = XmCreateForm(mw, "work", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; this->paned_window = XmCreatePanedWindow(children[1], "panes", args, n); XtManageChild(this->paned_window); n = 0; this->text_source = XmCreateText(children[1], /* the form */ "textsource", args, n); n = 0; this->path = children[2] = XmCreateLabel(mw, "filename", args, n); n = 0; XtSetArg(args[n], XmNmenuBar, children[0]); n++; XtSetArg(args[n], XmNworkWindow, children[1]); n++; XtSetArg(args[n], XmNmessageWindow, children[2]); n++; XtSetValues(mw, args, n); XtManageChildren(children, 3); XtManageChild(mw); return this; } /* =============================================================== * Create a cascade and a pulldown entry into a menubar, * from a list of push button specs. * If the label is NULL, create a separator instead of a push button. */ static Widget CreateMenuBarEntry(Widget menubar, String entry, String names[], XtCallbackProc procs[], XtPointer private[], int count) { Widget menu; Widget child; Arg args[8]; int n; int i; char menu_name[64]; n = 0; XtSetArg(args[n], XmNtearOffModel, XmTEAR_OFF_ENABLED); n++; menu = XmCreatePulldownMenu(menubar, strcat(strcpy(menu_name, entry), "Menu"), args, n); for(i = 0; i < count; i++) { n = 0; if (names[i] == NULL) child = XmCreateSeparator(menu, "sep", args, n); else { child = XmCreatePushButton(menu, names[i], args, n); if (procs[i] != NULL) XtAddCallback(child, XmNactivateCallback, procs[i], private[i]); } XtManageChild(child); } n = 0; XtSetArg(args[n], XmNsubMenuId, menu); n++; child = XmCreateCascadeButton(menubar, entry, args, n); XtManageChild(child); return child; } /* =============================================================== * Routine to change menu bar items sensitivity. * Takes a cascade button, extract the pulldown, find the item. */ void SetSensitive(Widget cascade, String item, Boolean sensitive) { Widget menu, button; XtVaGetValues(cascade, XmNsubMenuId, &menu, NULL); button = XtNameToWidget(menu, item); XtSetSensitive(button, sensitive); } /* =============================================================== * The Exit Callback. The root widget is passed as client data. * Close properly. Exit. */ static void ExitCallback(Widget button, Widget root, XmPushButtonCallbackStruct *call_data) { Display * dpy = XtDisplay(root); XtDestroyWidget(root); XtCloseDisplay(dpy); exit(0); } /* =============================================================== * The Close Callback. The root widget is passed as client data. * Close properly. Exit. */ static void CloseCallback(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data) { printf("close callback\n"); XtDestroyWidget(this->shell); XtFree((char *) this); } /* =================================================================== * The Help callback: Show an information message box. */ static void HelpCallback(Widget widget, ViewPtr this, XmPushButtonCallbackStruct *call_data) { static Widget HelpDialog = NULL; if ( HelpDialog == NULL ) { Arg args[8]; int n = 0; XmString help1, help2, help3, help_msg; help1 = XmStringConcatAndFree(FetchString(this, "help_file"), XmStringSeparatorCreate()); help2 = XmStringConcatAndFree(FetchString(this, "help_view"), XmStringSeparatorCreate()); help_msg = XmStringConcatAndFree(XmStringConcatAndFree(help1, help2), FetchString(this, "help_search")); XtSetArg(args[n], XmNmessageString, help_msg); n++; HelpDialog = XmCreateInformationDialog(this->shell, "helpdialog", args, n); XmStringFree(help_msg); } XtManageChild(HelpDialog); } /* =============================================================== * The Open New Shell Callback. * The primary View object is passed in the client_data * Open a new shell and a new file selected by a file selection box. */ static void OpenNewShellCallback(Widget widget, ViewPtr this, XmPushButtonCallbackStruct *call_data) { XmPushButtonCallbackStruct dummy_data; ViewPtr view; view = NewFileShell(theWidgetRoot, NULL, 0, NULL); XtPopup(view->shell, XtGrabNone); } /* =============================================================== * The Open File Callback. The View object is passed in the client_data * Open a new file selected by a file selection box. */ static void OpenFileCallback(Widget widget, ViewPtr this, XmPushButtonCallbackStruct *call_data) { Arg args[8]; int n = 0; if (this->fsb == NULL) { this->fsb = CreateFileSelectionBox(this); XtManageChild(this->fsb); } else if (XtIsManaged(this->fsb)) XtPopup(XtParent(this->fsb), XtGrabNone); else XtManageChild(this->fsb); } /* =============================================================== * Create File Selection Box */ static Widget CreateFileSelectionBox(ViewPtr this) { Arg args[8]; int n = 0; Widget fsb; XtSetArg(args[n], XmNallowShellResize, True); n++; XtSetArg(args[n], XmNresizePolicy, XmRESIZE_GROW); n++; /* XtSetArg(args[n], XmNdialogStyle, XmDIALOG_PRIMARY_APPLICATION_MODAL); n++; */ fsb = XmCreateFileSelectionDialog(this->shell, "fsb", args, n); XtAddCallback(fsb, XmNokCallback, (XtCallbackProc) FileOKCallback, this); XtAddCallback(fsb, XmNcancelCallback, (XtCallbackProc) FileCancelCallback, this); return fsb; } /* =================================================================== * Pop down the fsb. */ static void FileCancelCallback(Widget fsb, ViewPtr this, XmFileSelectionBoxCallbackStruct *call_data) { XtPopdown(XtParent(this->fsb)); } /* ===================================================================== * Fetch an string from Mrm database */ XmString FetchString(ViewPtr this, String name) { MrmCode code; XmString fetched; if (MrmFetchLiteral(theUIDdatabase, name, theDisplay, (XtPointer) &fetched, (MrmCode *) &code) == MrmSUCCESS) return fetched; ViewError(this, XmStringCreateLocalized("Can't fetch from database: "), XmStringCreateLocalized(name)); return XmStringCreateLocalized("String Not Found"); } /* ===================================================================== * Show application modal error dialogue box */ void ViewError(ViewPtr this, XmString s1, XmString s2) { XmString msg; msg = XmStringConcatAndFree(s1, s2); if (this->error_box == NULL) { Arg args[8]; int n = 0; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; this->error_box = XmCreateErrorDialog(this->shell, "error", args, n); } XtVaSetValues(this->error_box, XmNmessageString, msg, NULL); XtManageChild(this->error_box); XmStringFree(msg); } /* ===================================================================== * Show application modal error dialogue box */ void ViewWarning(ViewPtr this, XmString s1, XmString s2) { XmString msg; msg = XmStringConcatAndFree(s1, s2); if (this->warning_box == NULL) { Arg args[8]; int n = 0; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; this->warning_box = XmCreateWarningDialog(this->shell, "warning", args, n); } XtVaSetValues(this->warning_box, XmNmessageString, msg, NULL); XtManageChild(this->warning_box); XmStringFree(msg); } motif-2.3.8/demos/programs/fileview/mainE.h0000644000175000017500000000246312672140200015537 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: mainE.h /main/6 1995/07/14 10:03:41 drk $ */ #if ( defined main_h ) #define extern #endif extern void SetSensitive(Widget cascade, String item, Boolean sensitive); extern void ViewError(ViewPtr this, XmString s1, XmString s2); extern void ViewWarning(ViewPtr this, XmString s1, XmString s2); extern XmString FetchString(ViewPtr this, String name); #if ( defined main_h ) #define extern #endif motif-2.3.8/demos/programs/fileview/fileE.h0000644000175000017500000000223512672140200015527 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: fileE.h /main/6 1995/07/14 10:02:54 drk $ */ #if ( defined file_h ) #define extern #endif FILE * OpenFile(char * filename); void CloseFile(FILE * file); char * ReadFile(FILE * file, int *filesize); #if ( defined extern ) #undef extern #endif motif-2.3.8/demos/programs/fileview/main.h0000644000175000017500000001576213145162623015451 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* #include */ #define main_h #define DECLAREGLOBAL #include "fileview.h" #undef DECLAREGLOBAL #include "mainE.h" #include "textE.h" /* * Local variables */ #define UIL_FILE_COUNT 1 static char *uid_files[UIL_FILE_COUNT] = {NULL}; static MrmHierarchy theUIDdatabase = NULL; /* MRM database hierarchy id */ /* static MRMRegisterArg regvec[] = { {"exit_proc", (caddr_t) ExitCallback}, }; static MrmCount regnum = sizeof(regvec) / sizeof(MRMRegisterArg); */ typedef enum {AIX=0, DGUX=1, HPUX=2, IRIX=3, IRIX64=4, OSF1=5, Solaris=6, SunOS=7, SonyNews=8, SysV=9, UXP=10, MaxOS=11 } OS; static String OSList[] = { /* AIX */ "AIX", /* DGUX */ "dgux", /* HPUX */ "HP-UX", /* SGI IRIX */ "IRIX", /* SGI IRIX64 */ "IRIX64", /* DEC OSF1 */ "OSF1", /* Solaris */ "Solaris", /* SunOS */ "SunOS", /* Sony NEWS */ "NEWS-OS", /* Novell SysV */ "UNIX_SV", /* Fujitsu UXP */ "UNIX_System_V", "Other" }; static OS CurrentOS; typedef enum {C=0, English=1, French=2, German=3, Spanish=4, Hebrew=5, Japanese=6, Korean=7, Russian=8, MaxLanguage=9} Language; static String LangList[] = { "C locale", "English", "French", "German", "Spanish", "Hebrew", "Japanese", "Korean", "Russian", "Javanais" }; static Widget locale_dialog = NULL; static Widget locale_box; static Widget os_box = NULL; static String LocaleName = NULL; static Language SelectedLocale; static Boolean SupportedLocale [MaxOS+1][MaxLanguage] = { /* C Englis French German Spanis Hebrew Japan Korea Russi */ {/* AIX */ True, True, True, True, True, True, True, True, True}, {/* DGUX */ True, True, True, True, True, False, True, True, True}, {/* HPUX */ True, True, True, True, True, True, True, True, True}, {/* IRIX */ True, True, True, True, True, True, True, True, True}, {/* IRIX64 */ True, True, True, True, True, True, True, True, True}, {/* OSF1 */ True, True, True, True, True, True, True, True, True}, {/* Solaris */ True, True, True, True, True, True, True, True, True}, {/* SunOS */ True, True, True, True, True, True, True, True, True}, {/* Sony News */ True, True, False, False, False, False, True, True, False}, {/* USL Sys V */ True, True, True, True, True, False, True, False, False}, {/* Fujitsu */ True, False, False, False, False, True, False, False, False}, {/* dummy */ True, False, False, False, False, False, False, False, False} }; static String LocaleTable [MaxOS+1][MaxLanguage] = { {/* AIX */ "C", "en_US.8859-1", "fr_FR.8859-1", "gr_DE.8859-1", "iw_IL.ISO8859-8", "jp_JP.euc", "kr_KR", "ru_RU.ISO8859-2", "es_ES.ISO8859-1"}, {/* DGUX */ "C", "en_US.850", "fr_FR.850", "de_DE.850", "es_ES.850", NULL, "ja_JP.euc", "ko_KR.euc", "ru_RU.8859-5"}, {/* HPUX */ "C", "american", "french", "german", "spanish", "hebrew.iso88598", "japanese", "korean", "russian"}, {/* IRIX */ "C", "en_US.8859-1", "fr_FR.8859-1", "gr_DE.8859-1", "iw_IL.ISO8859-8", "jp_JP.euc", "kr_KR", "ru_RU.ISO8859-2", "es_ES.ISO8859-1"}, {/* IRIX64 */ "C", "en_US.8859-1", "fr_FR.8859-1", "gr_DE.8859-1", "iw_IL.ISO8859-8", "jp_JP.euc", "kr_KR", "ru_RU.ISO8859-2", "es_ES.ISO8859-1"}, {/* OSF1 */ "C", "en_US.8859-1", "fr_FR.8859-1", "de_DE.8859-1", "es_ES.ISO8859-1", "iw_IL.ISO8859-8", "jp_JP.SJIS", "kr_KR.eucKR", "ru_RU.ISO8859-2"}, {/* Solaris */ "C", "en_US.8859-1", "fr_FR.8859-1", "gr_DE.8859-1", "iw_IL.ISO8859-8", "jp_JP.euc", "kr_KR", "ru_RU.ISO8859-2", "es_ES.ISO8859-1"}, {/* SunOS */ "C", "en_US.8859-1", "fr_FR.8859-1", "gr_DE.8859-1", "iw_IL.ISO8859-8", "jp_JP.euc", "kr_KR", "ru_RU.ISO8859-2", "es_ES.ISO8859-1"}, {/* Sony NEWS */"C", "en_US.88591", NULL, NULL, NULL, "jp_JP.EUC", "kr_KR.EUC", NULL, NULL}, {/* Novell */ "C", "en_US", "fr", "de", "es", NULL, "ja", NULL, NULL}, {/* Fujitsu */ "C", "C", NULL, NULL, NULL, NULL, "ja_JP", NULL, NULL}, {/* dummy */ "C", "", "", "", "", "", "", "", ""} }; /* * Application Resources */ global struct _FileViewResources { String version; int bell_duration; int bell_percent; } FileViewResources; static XtResource FileViewResourcesSpecs[] = { { "checkVersion", XtCString, XtRString, sizeof(String), XtOffsetOf( struct _FileViewResources, version), XtRImmediate, (XtPointer) "NoValue" }, { "bellDuration", XmCMaxValue, XmRInt, sizeof(int), XtOffsetOf( struct _FileViewResources, bell_duration), XmRImmediate, (XtPointer) 100 }, { "bellPercent", XmCMaxValue, XmRInt, sizeof(int), XtOffsetOf( struct _FileViewResources, bell_percent), XmRImmediate, (XtPointer) 100 } }; static char myClass[] = "Fileview"; static char myName[] = "fileview" ; static int save_argc; static char ** save_argv; static String MyLanguageProc(Display * dpy, String xnl, XtAppContext theContext); static ViewPtr NewFileShell(Widget parent, ViewPtr this, int argc, char *argv[]); static Widget CreateMenuBarEntry(Widget menubar, String entry, String names[], XtCallbackProc procs[], XtPointer private[], int count); static void ExitCallback(Widget button, Widget root, XmPushButtonCallbackStruct *call_data); static void CloseCallback(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data); static void HelpCallback(Widget widget, ViewPtr this, XmPushButtonCallbackStruct *call_data); static void OpenNewShellCallback(Widget widget, ViewPtr this, XmPushButtonCallbackStruct *call_data); static void OpenFileCallback(Widget widget, ViewPtr this, XmPushButtonCallbackStruct *call_data); static Widget CreateFileSelectionBox(ViewPtr this); static void FileCancelCallback(Widget fsb, ViewPtr this, XmFileSelectionBoxCallbackStruct *call_data); #undef main_h motif-2.3.8/demos/programs/fileview/README0000644000175000017500000000572212672140200015216 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:04:13 drk $ */ This demo is pretty much the "more" program Motif-ied and internationalized. You can view files in your language ! This demo only works if your Operating System supports setlocale() and Xlib supports the same locale as your OS. The program MUST be executed through the sh script "xmfile" This script is a Korn Shell script currently running on ULTRIX 4.1 or ULTRIX 4.2 HPUX 8.05 OSF1.0.4 You may have to do some work for running on your OS and your shell. Steps to follow: 1) Check your Operating System Reference Manual for supported locales (usually "man setlocale") to know your locale names. 2) Edit the xmfile script. The script contains association between languages and locales names For example if you want to run in French, and the name of the french locale on your system is FROG_REDMEAT then 1) make sure that the variable $sysname contains the name of your OS 2) add a case in the case statement for french under your OS that sets the LANG variable LANG=FROG_REDMEAT 3) The UID files are searched in the directory named with the language name. 4) If you want to add a new language add a case branch for the language. create a directory of that name. Go into this directory. Create adequate X resource files and uil files. compile the uil file 5) Come back to the xmfile directory Execute "xmfile language". where "language" is one the arguments listed in the script : french, english, german. Of course you may only view files in the specified language If you execute "xmfile" with no argument, the default language is French. ========================================== After the program has started: Allow a user to view files in separate windows. There is one top level shell created per file opened. The first top level shell created (application shell) is called the Primary shell. Others are Secondary. Each top level shell is parent of a Main Window, the work area of which is a PanedWindow. The menu bar has entries File for opening/closing file, exiting View for controlling the panes in the pane window The File menu contains commands Open, and Exit or Close In the primary shell, Exit exits the client In the secondaries, Close closes the shell The Open menu: On selecting Open/File in the menu bar, a file selection box is mapped to choose the file. If OpenFile is successful, close first the current file opened, destroy all existing panes, and display the new file. Close: this entry only exists on the secondary windows. It destroys the top level shell and closes the file. Exit: this entry only exists on the primary shell closes the file and the shell. The View menu: New Pane: Creates a new pane in the paned window Delete Pane: delete the current pane. Search: pops a dialogue box for searching text in the file On the OK callback of the dialogue box search the string. if found show in current pane else pop up dialogue box again. motif-2.3.8/demos/programs/fileview/Fileview.ad0000644000175000017500000000314712672140200016415 00000000000000! $XConsortium: Fileview.ad /main/4 1995/07/17 18:52:56 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY *defaultFontList : *-helvetica-medium-r-normal--14-* *background : Yellow *primary.Geometry: 400x400 *main*panes*XmText*resizeWidth: True *main.work.resizePolicy: RESIZE_GROW *main.work.panes*allowResize: True *main.work.panes.refigureMode: True *main.work.panes*sash*Background: Green *main.work.panes*sashHeight: 10 *main.work.panes*sashIndent: -32 *main.work.panes*sashWidth: 40 *main.work.panes.spacing: 20 *main.work.panes*separator*Background: Red *main.work.panes*separator*Foreground: Yellow *main.work.panes*XmSeparatorGadget*Margin: 10 *main*menubar*background: PeachPuff *main*menubar*TearOffControl.shadowThickness : 4 *main*menubar*TearOffControl.separatorType : XmSHADOW_ETCHED_IN_DASH motif-2.3.8/demos/programs/fileview/German.df0000644000175000017500000000647712672140200016072 00000000000000! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY Fileview*fontList : *-helvetica-bold-r-normal--24-*-iso8859-1 *main.menubar*fontList : *-helvetica-bold-r-normal--24-*-iso8859-1 *primary*Foreground : Black *main*Background : RosyBrown1 *fsb*Background : RosyBrown1 *primary.Geometry: 400x400 *main*panes*XmText*resizeWidth: True *main.work.resizePolicy: RESIZE_GROW *main.work.panes*allowResize: True *main.work.panes.refigureMode: True *main.work.panes*sash*background: Turquoise *main*XmText*fontList: *-lucida-medium-r-normal-sans-20-*-iso8859-1 *main*XmText*wordWrap: True *main*XmText*background: PaleGreen *main.work.panes*sashHeight: 10 *main.work.panes*sashIndent: -32 *main.work.panes*sashWidth: 40 *main.work.panes.spacing: 20 *main.work.panes*XmSeparatorGadget*Margin: 10 *main*menubar*background: PeachPuff *main*menubar*TearOffControl.shadowThickness : 4 *main*menubar*TearOffControl.separatorType : XmSHADOW_ETCHED_IN_DASH *main.work.resizePolicy: RESIZE_GROW *main.work.panes*allowResize: True *main.work.panes.refigureMode: True *main.work.panes*sash*Background: Turquoise *main.work.panes*sashHeight: 10 *main.work.panes*sashIndent: -32 *main.work.panes*sashWidth: 40 *main.work.panes.spacing: 20 *main.work.panes*separator*Background: Red *main.work.panes*separator*Foreground: Yellow *main.work.panes*XmSeparatorGadget*Margin: 10 *main*menubar*background: PeachPuff *main*menubar*TearOffControl.shadowThickness : 4 *main*menubar*TearOffControl.separatorType : XmSHADOW_ETCHED_IN_DASH *Cancel.labelString: Abbrechen *OK.labelString: Ausführen *Help.labelString: Hilfe *Apply.labelString: Filtern *Selection.labelString: Auswahl *fileListLabelString: Dateiliste *filterLabelString: Filter *dirListLabelString: Verzeichnisse *primary.main.menubar*fileMenu.exit.labelString: Beenden *primary.main.menubar*fileMenu.close.labelString: Schliessen *main*menubar.file.labelString: Datei *main.menubar.view.labelString: Sicht *main.menubar.help.labelString: Hilfe *main.menubar*fileMenu.opennew.labelString: Öffnen in Neu *main.menubar*fileMenu.open.labelString: Öffnen *main.menubar*viewMenu.search.labelString: Suchen *main.menubar*viewMenu.new_pane.labelString: Ausschnitt erzeugen *main.menubar*viewMenu.kill_pane.labelString: Ausschnitt schließen *main.menubar*helpMenu.help_view.labelString: Hilfe *search_box*dialogTitle: Suchen *search_box.form.dir_frame*title.labelString : Richtung *search_box.form.dir_frame*title : Richtung *search_box.form.dir_frame*forward.labelString: Vorwärts *search_box.form.dir_frame*backward.labelString: Rückwärts motif-2.3.8/demos/programs/fileview/text.h0000644000175000017500000000445712672140200015477 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: text.h /main/6 1995/07/14 10:04:01 drk $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define text_h #include "fileview.h" #include "textE.h" #include "mainE.h" #include "fileE.h" /* * Localized strings, loaded at run time from a localized resource file */ static XmString no_search_msg = NULL; static XmString not_found_msg = NULL; static XmString no_pattern_msg = NULL; static XmString search_msg = NULL; /* * UIL literal names for localized strings. */ static String no_search = "no_search" ; static String not_found = "not_found" ; static String no_pattern = "no_pattern" ; static String search_prompt = "searchprompt"; static void CancelSearch(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data); static void SearchSubstring(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data); static void NoInsert(Widget text, ViewPtr this, XmTextVerifyPtr verify); static void ChangeCurrentPane(Widget text, ViewPtr this, XmAnyCallbackStruct verify); #undef text_h motif-2.3.8/demos/programs/fileview/file.c0000644000175000017500000000360112672140200015413 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: file.c /main/6 1995/07/14 10:02:30 drk $" #endif #endif #include #include #include "file.h" #ifndef X_NOT_STDC_ENV #include #endif /* ===================================================================== * Open File */ FILE * OpenFile(char *path) { return fopen(path, "r"); } /* ===================================================================== * Close File */ void CloseFile(FILE * file) { fclose (file); } /* ===================================================================== * Read File in buffer */ char * ReadFile(FILE * file, int *filesize) { char * buffer; fseek(file, 0L, SEEK_END); * filesize = ftell(file); /* fgetpos(file, (fpos_t *) filesize);*/ rewind(file); buffer = (char *) XtMalloc(*filesize+1); if (fread(buffer, 1, *filesize, file) == *filesize ) { buffer[*filesize] = '\0'; return buffer; } XtFree(buffer); return NULL; } motif-2.3.8/demos/programs/fileview/textE.h0000644000175000017500000000271212672140200015574 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: textE.h /main/6 1995/07/14 10:04:18 drk $ */ #if ( defined text_h ) #define extern #endif extern void FileOKCallback(Widget fsb, ViewPtr this, XmFileSelectionBoxCallbackStruct *call_data); extern void FindCallback(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data); extern void NewPaneCallback(Widget fsb, ViewPtr this, XmPushButtonCallbackStruct *call_data); extern void KillPaneCallback(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data); #if ( defined extern ) #undef extern #endif motif-2.3.8/demos/programs/fileview/Makefile.am0000644000175000017500000000177412672140200016375 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/fileview datadir = ${prefix}/share/Xm/fileview bin_PROGRAMS = fileview fileview_SOURCES = main.c text.c file.c file.h fileE.h fileview.h main.h \ mainE.h text.h textE.h EXTRA_DIST = $(UILS) English.df French.df German.df README Fileview.ad data_DATA = French.uid German.uid English.uid $(fileview_SOURCES) $(EXTRA_DIST) UILS= French.uil German.uil English.uil LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: French.uid German.uid English.uid French.uid: French.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil German.uid: German.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil English.uid: English.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) French.uid German.uid English.uid motif-2.3.8/demos/programs/fileview/text.c0000644000175000017500000002760413066310437015502 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: text.c /main/7 1996/10/30 10:28:07 cde-osf $" #endif #endif #include "text.h" /* =================================================================== * The OK callback for FSB. Check the selected file can be opened. * If so, close the old file, read the new file. * Create an unmapped text source with the contents of the file. */ void FileOKCallback(Widget fsb, ViewPtr this, XmFileSelectionBoxCallbackStruct *call_data) { FILE * file; char * path; char *buffer; static char no_file[] = "no_file" ; static XmString no_file_msg = NULL; XmPushButtonCallbackStruct dummy; int filesize; XmStringContext ctxt; XmStringCharSet charset; XmStringDirection dir; Boolean sep; XmStringInitContext(&ctxt, call_data->value); XmStringGetNextSegment(ctxt, &path, &charset, &dir, &sep); XmStringFreeContext(ctxt); XtFree((char *)charset); if (((file = OpenFile(path)) == NULL) || (buffer = ReadFile(file, &filesize)) == NULL) { if (no_file_msg == NULL) no_file_msg = FetchString(this, no_file); ViewError(this, no_file_msg, call_data->value); } else { PanePtr pane = this->panes, tmp; XtPopdown(XtParent(fsb)); while ( pane != NULL) { /* destroy all panes */ XtDestroyWidget(pane->text); tmp = pane; pane = pane->next; XtFree((char *)tmp); --this->n_panes; } this->panes = NULL; this->current_pane = NULL; /* Set the new source text */ XmTextSetString(this->text_source, buffer); XtFree(buffer); XtFree(path); CloseFile(file); NewPaneCallback(this->paned_window, this, &dummy); XtVaSetValues(this->path, XmNlabelString, call_data->value, NULL); } } /* =================================================================== * The new pane callback. Create a new pane in the pane window. * Alloc a pane structure, initialize it. * Set focus to the new pane. * Allow menu items on panes. */ void NewPaneCallback(Widget widget, ViewPtr this, XmPushButtonCallbackStruct *call_data) { PanePtr new; Arg args[10]; int n = 0; Dimension height; short index ; Widget target = NULL; new = (PanePtr) XtCalloc(sizeof(Pane), 1); if (this->panes != NULL) this->panes->previous = new; new->next = this->panes; this->panes = new; /* * If not first time, split current pane in 2 to create the new pane */ if (this->n_panes == 0) { /* first time, just load the file */ SetSensitive(this->view_cascade, new_pane, True); SetSensitive(this->view_cascade, search, True); } else { target = XtParent(this->current_pane->text); } ++this->n_panes; n = 0; XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++; XtSetArg(args[n], XmNallowResize, True); n++; new->text = XmCreateScrolledText(this->paned_window, "pane", args, n); /* XtAddCallback(new->text, XmNmodifyVerifyCallback, (XtCallbackProc) NoInsert, this); */ XtAddCallback(new->text, XmNfocusCallback, (XtCallbackProc) ChangeCurrentPane, this); XmTextSetSource(new->text, XmTextGetSource(this->text_source), 0, 0); if (target != NULL) { /* this is not the first pane */ n = 0; XtSetArg(args[n], XmNpositionIndex, &index); n++; XtSetArg(args[n], XmNheight, &height); n++; XtGetValues(target, args, n); ++index; printf("set source text\n"); n = 0; XtSetArg(args[n], XmNpositionIndex, index); n++; XtSetArg(args[n], XmNheight, (Dimension) height/2); n++; XtSetValues(XtParent(new->text), args, n); XmTextSetTopCharacter(new->text, XmTextGetTopCharacter(this->current_pane->text)); XtVaSetValues(target, XmNheight, (Dimension) height/2, NULL); } printf("source text set\n"); XtManageChild(new->text); if (this->n_panes == 2) SetSensitive(this->view_cascade, kill_pane, True); XmProcessTraversal(new->text, XmTRAVERSE_CURRENT); this->current_pane = new; } /* =================================================================== * The kill pane callback. Delete a pane in the pane window. * Free pane structure. */ void KillPaneCallback(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data) { PanePtr *pane, tmp; /* printf("%d panes left\n", this->n_panes-1); */ for (pane = &this->panes; *pane != this->current_pane; ) pane = &((*pane)->next); /* * Destroy the old one, free memory. * Do not allow the last pane to be destroyed * Make destroy command unavailable if last pane. * Make next or previous pane become current and traverse to it. */ tmp = *pane; *pane = (*pane)->next; XtDestroyWidget(tmp->text); XtFree((char *)tmp); this->current_pane = (*pane == NULL) ? this->panes : *pane; if ( --this->n_panes < 2 ) SetSensitive(this->view_cascade, kill_pane, False); XmProcessTraversal(this->current_pane->text, XmTRAVERSE_CURRENT); } /* ===================================================================== * Focus has moved. Change current pane. */ static void ChangeCurrentPane(Widget text, ViewPtr this, XmAnyCallbackStruct verify) { PanePtr pane = this->panes; while (pane != NULL) { if (pane->text == text) break; pane = pane->next; } this->current_pane = pane; } /* =============================================================== * The Find Callback. The parent widget is passed as client data. * */ void FindCallback(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data) { Widget template; XtCallbackRec ok[2], cancel[2]; #define NUMBOXES 4 #define NUMBUTTONS 2 #define TITLEDFRAME 2 Widget framed[TITLEDFRAME]; Widget frame; Widget forward, backward; if ( this->search_box == NULL ) { Arg args[10]; int n = 0; search_msg = FetchString(this, search_prompt); XtSetArg(args[n], XmNautoUnmanage, False); n++; XtSetArg(args[n], XmNmessageString, search_msg); n++; ok[0].callback = (XtCallbackProc) SearchSubstring; ok[0].closure = (XtPointer) this; ok[1].callback = cancel[1].callback = NULL; ok[1].closure = cancel[1].closure = NULL; cancel[0].callback = (XtCallbackProc) CancelSearch; cancel[0].closure = (XtPointer) this; XtSetArg(args[n], XmNokCallback, (XtCallbackList) ok); n++; XtSetArg(args[n], XmNcancelCallback, (XtCallbackList) cancel); n++; this->search_box = XmCreateTemplateDialog(this->shell, "search_box", args, n); n = 0; template = XmCreateForm(this->search_box, "form", args, n); n = 0; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; this->search_entry = XmCreateTextField(template, "entry", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget, this->search_entry); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; frame = XmCreateFrame(template, "dir_frame", args, n); n = 0; XtSetArg(args[n], XmNframeChildType, XmFRAME_TITLE_CHILD); n++; framed[0] = XmCreateLabel(frame, "title", args, n); n = 0; XtSetArg(args[n], XmNframeChildType, XmFRAME_WORKAREA_CHILD); n++; XtSetArg(args[n], XmNisAligned, True); n++; XtSetArg(args[n], XmNradioAlwaysOne, True); n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END); n++; XtSetArg(args[n], XmNentryClass, xmToggleButtonWidgetClass); n++; XtSetArg(args[n], XmNorientation, XmVERTICAL); n++; this->direction = framed[1] = XmCreateRadioBox(frame, "direction", args, n); n = 0; XtSetArg(args[n], XmNuserData, XmTEXT_FORWARD); n++; forward = XmCreateToggleButton(framed[1], "forward", args, n); n = 0; XtSetArg(args[n], XmNuserData, XmTEXT_BACKWARD); n++; backward = XmCreateToggleButton(framed[1], "backward", args, n); XtManageChild(forward); XtManageChild(backward); XtManageChildren(framed, TITLEDFRAME); XmToggleButtonSetState(forward, True, True); XtManageChild(this->search_entry); XtManageChild(frame); XtManageChild(template); } if (XtIsManaged(this->search_box)) XtPopup(XtParent(this->search_box), XtGrabNone); else XtManageChild(this->search_box); XmProcessTraversal(this->search_entry, XmTRAVERSE_CURRENT); #undef NUMBUTTONS #undef NUMBOXES #undef TITLEDFRAME } /* =============================================================== * The Find Callback. The View object is passed as client data. * */ static void CancelSearch(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data) { XtPopdown(XtParent(this->search_box)); } /* =============================================================== * The Find Callback. The parent widget is passed as client data. * */ static void SearchSubstring(Widget button, ViewPtr this, XmPushButtonCallbackStruct *call_data) { #define STRING_MAX_CHARS 1024 char *substring; /* int status; */ XmTextPosition pos; /* int last = XmTextFieldGetLastPosition(this->search_entry); */ XmString search = NULL; XmTextDirection direction; Widget toggle; /* status = XmTextFieldGetSubstring(this->search_entry, 0, last, STRING_MAX_CHARS, substring); if (status == XmCOPY_FAILED || status == XmCOPY_TRUNCATED) { if (no_search_msg == NULL) no_search_msg = FetchString(this, no_search); search = XmStringCreateLocalized(substring); ViewWarning(this, no_search_msg, search); return; } */ substring = XmTextFieldGetString(this->search_entry); if (substring == NULL) { if (no_pattern_msg == NULL) no_pattern_msg = FetchString(this, no_pattern); ViewWarning(this, no_pattern_msg, (XmString) NULL); return; } XtVaGetValues(this->direction, XmNmenuHistory, &toggle, NULL); XtVaGetValues(toggle, XmNuserData, &direction, NULL); if (XmTextFindString(this->current_pane->text, XmTextGetInsertionPosition(this->current_pane->text), substring, direction, &pos)) { XmTextSetTopCharacter(this->current_pane->text, pos); XmTextSetInsertionPosition(this->current_pane->text, pos); XtPopdown(XtParent(this->search_box)); } else { if (not_found_msg == NULL) not_found_msg = FetchString(this, not_found); search = XmStringCreateLocalized(substring); ViewWarning(this, not_found_msg, search); XmStringFree(search); } XtFree(substring); } /* ===================================================================== * Reject text insertion */ static void NoInsert(Widget text, ViewPtr this, XmTextVerifyPtr verify) { /* if (verify->startPos != verify->endPos) printf("deleting text %d %d\n", verify->startPos, verify->endPos); if (verify->text != NULL && verify->text->length > 0) printf("inserting %d characters: '%s'\n", verify->text->length, verify->text->ptr); */ } motif-2.3.8/demos/programs/ColorSel/0000755000175000017500000000000013211513007014317 500000000000000motif-2.3.8/demos/programs/ColorSel/colordemo.c0000644000175000017500000003054412672140200016375 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * * The following defines help in clarifying the data being passed. * */ #define EXPLAIN_MODE 1 #define EXPLAIN_NAME 2 #define EXPLAIN_MAR 3 #define EXPLAIN_RGB 4 void Exit(Widget w, XtPointer client, XtPointer call); void Explain(Widget w, XtPointer client, XtPointer call); void GetColor(Widget w, XtPointer client, XtPointer call); /* * * Structure to pass data back and forth using a callbacks' client_data * */ typedef struct _Holder{ Widget colorBtn; Widget colorWidget; XColor the_color; Colormap the_map; } holderStruct; /* * * These are fallbacks that are designed to ensure the * program works properly in case the resource file is * not picked up. * */ static String fallbacks[] = { /* * General fallback resources. */ "*background: grey", "*colorSelector*background: white", "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*infolabel*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*infolabel.marginWidth: 10", "*infolabel.marginHeight: 10", "*buttonBox1*XmPushButton.labelString: Explain...", "*rightpane*colModeLabel.labelString: XmNcolorMode", "*rightpane*colNameLabel.labelString: XmNcolorName", "*rightpane*marLabel.labelString: XmNmarginWidth, XmNmarginHeight", "*rightpane*rgbFileLabel.labelString: XmNrgbFile", "*quitPB.labelString: Quit", "*colorPB.labelString: Color", "*buttonBox1*XmLabel.alignment: XmALIGNMENT_BEGINNING", NULL, }; void Exit(Widget w, XtPointer client, XtPointer call) { exit(0); } /* * * Stuff needed for the demo program to output info * */ void Explain(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; XmString xmstring=NULL; static Widget info = NULL; int explain = (int) client; if (info == NULL) { Widget temp; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; info = XmCreateInformationDialog(w, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); } switch (explain) { case EXPLAIN_MODE: xmstring = XmStringCreateLtoR( "This resouce may be either XmListMode and XmScaleMode. This\n\ determines what mode the Color Selector should use when it is\n\ created.\n\ \n\ List Mode presents a listing of colors built up from the\n\ XmNrgbFile resource. Scale Mode displays three sliders that\n\ adjust Red, Green, and Blue color values.", XmSTRING_DEFAULT_CHARSET); break; case EXPLAIN_NAME: xmstring = XmStringCreateLtoR( "This resource controls the name of the color that is displayed\n\ to the user. Using XtGetValues on this resource returns the name\n\ of the current color. Using XtSetValues on this resource sets the\n\ current color.\n\ \n\ This resource is of type String.", XmSTRING_DEFAULT_CHARSET); break; case EXPLAIN_MAR: xmstring = XmStringCreateLtoR( "The Color Selector is made up of many children. This resource\n\ adjusts the remaining space between a) each of the children in the\n\ Color Selector, and b) the outside children and the edge of the\n\ Color Selector.", XmSTRING_DEFAULT_CHARSET); break; case EXPLAIN_RGB: xmstring = XmStringCreateLtoR( "The name of a file that contains valid color names and their\n\ appropriate values.\n\ \n\ All duplicates are removed, and the list is sorted, before it is\n\ shown to the user.", XmSTRING_DEFAULT_CHARSET); break; default: printf("explaining NOTHING\n"); break; } argcnt = 0; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; XtSetValues(info, args, argcnt); XmStringFree(xmstring); XtManageChild(info); } static XmString CreateHelpArea() { XmString xmstr = XmStringCreateLtoR( "The Motif Color Selector is an interface to the colors \n\ available on a display.\n\ \n\ In Scale Mode, the position of the sliders \n\ determines RGB values of the current color, and displays the \n\ pixel value in the colored area at the bottom.\n\ In List Mode, a list of all the named colors in the current\n\ rgb.txt file are shown. Selecting from this list updates\n\ the color display area with the associated pixel value.\n\ The ColorSelector will attempt to show the closest approximation\n\ to the color selected in one mode when switching to another\n\ if it cannot find an exact match .\n\ \n\ A developer may get the current color value programmatically\n\ through XtGetValues. An example of how this is used is shown\n\ by the selecting the Color Button at the bottom of the right \n\ half of the demo. The value obtained from the ColorSelector\n\ was used to set the backgroundColor of the Color Button.\n\ \n\ Resources defined by the Color Selector are shown below. For more\n\ information on a resource, select the Explain button to \n\ its right.", XmSTRING_DEFAULT_CHARSET); return( xmstr ); } /* * * This function demonstrates the use of the new widget. * The color generated by the Color Selector Widget is used * to change the background of the push button calling this * routine. * */ void GetColor(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; String color_name; holderStruct holder = *(holderStruct *)client; argcnt = 0; XtSetArg(args[argcnt], XmNcolorName, &color_name); argcnt++; XtGetValues(holder.colorWidget, args, argcnt); XParseColor(XtDisplay(w), holder.the_map, color_name, &(holder.the_color)); XAllocColor(XtDisplay(w), holder.the_map, &(holder.the_color)); argcnt = 0; XtSetArg(args[argcnt], XmNbackground, holder.the_color.pixel); argcnt++; XtSetValues(holder.colorBtn, args, argcnt); } int main(int argc, char **argv) { Arg args[5]; Cardinal argcnt; Widget top, colorframe, colorSelector, infoframe, infolabel, buttonBox, rbuttonBox, lbuttonBox, colModeLabel, pushButton, big_pane, right_pane, left_pane, explain_scrolled, colNameLabel, marLabel, rgbFileLabel, quitPB, colorPB; XtAppContext app; XmString xmstring; Colormap default_map; XColor the_color; unsigned long mask; holderStruct holder; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Color Selector Demo"); argcnt++; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; top = XtOpenApplication( &app, "ColorSelector", NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, args, argcnt); default_map = DefaultColormapOfScreen(XtScreen(top)); /* big pane */ argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; big_pane = XtCreateManagedWidget("bull", xmPanedWidgetClass, top, args, argcnt); colorframe = XtVaCreateManagedWidget("colorframe", xmFrameWidgetClass, big_pane, XmNshowSash, False, NULL); colorSelector = XtVaCreateManagedWidget("colorSelector", xmColorSelectorWidgetClass, colorframe, NULL); /* right pane */ argcnt = 0; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; XtSetArg(args[argcnt], XmNskipAdjust, False ); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; right_pane = XtCreateManagedWidget("rightpane", xmPanedWidgetClass, big_pane, args,argcnt); infoframe = XtVaCreateManagedWidget("infoframe", xmFrameWidgetClass, right_pane, XmNshowSash, False, XmNresizeToPreferred, True, XmNpreferredPaneSize, 300, XmNallowResize, True, NULL); argcnt = 0; XtSetArg(args[argcnt], XmNscrollingPolicy, XmAUTOMATIC ); argcnt++; XtSetArg(args[argcnt], XmNscrollBarDisplayPolicy, XmAS_NEEDED ); argcnt++; explain_scrolled = XtCreateManagedWidget( "scrollExplain", xmScrolledWindowWidgetClass, infoframe, args, argcnt ); xmstring = CreateHelpArea(); infolabel = XtVaCreateManagedWidget("infolabel", xmLabelWidgetClass, explain_scrolled, XmNalignment, XmALIGNMENT_BEGINNING, XmNlabelString, xmstring, NULL); /* Resources and their associated Explain buttons */ argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillAll); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; XtSetArg(args[argcnt], XmNskipAdjust, True); argcnt++; buttonBox = XtCreateManagedWidget("buttonBox1",xmButtonBoxWidgetClass, right_pane, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillMinor); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; lbuttonBox = XtCreateManagedWidget("buttonBoxl", xmButtonBoxWidgetClass, buttonBox, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillMinor); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; rbuttonBox = XtCreateManagedWidget("buttonBoxr", xmButtonBoxWidgetClass, buttonBox, args, argcnt); colModeLabel = XtVaCreateManagedWidget("colModeLabel", xmLabelWidgetClass, lbuttonBox, NULL); pushButton = XtVaCreateManagedWidget("pushButton", xmPushButtonWidgetClass, rbuttonBox, NULL); XtAddCallback(pushButton, XmNactivateCallback, Explain, (XtPointer)EXPLAIN_MODE); colNameLabel = XtVaCreateManagedWidget("colNameLabel", xmLabelWidgetClass, lbuttonBox, NULL); pushButton = XtVaCreateManagedWidget("pushButton1", xmPushButtonWidgetClass, rbuttonBox, NULL); XtAddCallback(pushButton, XmNactivateCallback, Explain, (XtPointer)EXPLAIN_NAME); marLabel = XtVaCreateManagedWidget("marLabel", xmLabelWidgetClass, lbuttonBox, NULL); pushButton = XtVaCreateManagedWidget("pushButton2", xmPushButtonWidgetClass, rbuttonBox, NULL); XtAddCallback(pushButton, XmNactivateCallback, Explain, (XtPointer)EXPLAIN_MAR); rgbFileLabel = XtVaCreateManagedWidget("rgbFileLabel", xmLabelWidgetClass, lbuttonBox, NULL); pushButton = XtVaCreateManagedWidget("pushButton3", xmPushButtonWidgetClass, rbuttonBox, NULL); XtAddCallback(pushButton, XmNactivateCallback, Explain, (XtPointer)EXPLAIN_RGB); /* * Take Note: * * The following push button demostrates the point in using * the colorSelector widget. * */ argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillNone); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; XtSetArg(args[argcnt], XmNskipAdjust, True); argcnt++; buttonBox = XtCreateManagedWidget("buttonBox2", xmButtonBoxWidgetClass, right_pane, args, argcnt); colorPB = XtVaCreateManagedWidget("Color", xmPushButtonWidgetClass, buttonBox, NULL ); quitPB = XtVaCreateManagedWidget("quitPB", xmPushButtonWidgetClass, buttonBox, NULL ); /* finished all the interface pieces, now do all the rest */ XAllocColorCells(XtDisplay(top), default_map, False, &mask, 0, &the_color.pixel, 1); holder.colorBtn = colorPB; holder.colorWidget = colorSelector; holder.the_color = the_color; holder.the_map = default_map; XtAddCallback(colorPB, XmNactivateCallback, GetColor, &holder); XtAddCallback(quitPB, XmNactivateCallback, Exit, (XtPointer)0); XtRealizeWidget(top); XtAppMainLoop(app); return(0); } motif-2.3.8/demos/programs/ColorSel/Makefile.in0000644000175000017500000005517313211512765016331 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = colordemo$(EXEEXT) subdir = demos/programs/ColorSel ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_colordemo_OBJECTS = util-c.$(OBJEXT) colordemo.$(OBJEXT) colordemo_OBJECTS = $(am_colordemo_OBJECTS) colordemo_LDADD = $(LDADD) colordemo_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(colordemo_SOURCES) DIST_SOURCES = $(colordemo_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Color build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Color datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in colordemo_SOURCES = util-c.c colordemo.c EXTRA_DIST = data_DATA = $(colordemo_SOURCES) $(EXTRA_DIST) LDADD = $(TOPDIR)/lib/Xm/libXm.la TOPDIR = ../../.. INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/ColorSel/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/ColorSel/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list colordemo$(EXEEXT): $(colordemo_OBJECTS) $(colordemo_DEPENDENCIES) $(EXTRA_colordemo_DEPENDENCIES) @rm -f colordemo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(colordemo_OBJECTS) $(colordemo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colordemo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util-c.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/ColorSel/util-c.c0000644000175000017500000026117213066310437015623 00000000000000/* * MODULE: Convert.c * AUTHOR: Automatically generated by Builder Xcessory * * Description: This module contains various utilities, converters * for XmStrings (to work properly with app-defaults), and if needed * the XPM pixmap utilities. * * Edit the file ${}/gen/utils.c ($SYSTEM:[gen]utils.c on VMS) to * make system wide changes to this file which will be visible next time * this file is generated. * ${} is the directory where Builder Xcessory is installed. */ /* * supplies a string format for compound strings: * * ::[#tag][:t][:r]["str"] * * where: * :: = indicates compound string. * tag = the font tag * :t = separator (if not seen no separator added to segment) * :r = right to left (if not seen left to right assumed) * "str" = the text of the string. * * The components for the compound string can be repeated any number of * times. */ /***************************************************************************** * INCLUDE FILES *****************************************************************************/ #include #include #include #include /* * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI. */ #if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__) # include # if defined(HAVE_MALLOC_H) # include # elif defined(HAVE_SYS_MALLOC_H) # include # endif #endif /***************************************************************************** * TYPDEFS AND DEFINES *****************************************************************************/ /* * Undefine this if you want to use native strcasecmp. */ #define LOCAL_STRCASECMP #ifdef _NO_PROTO #ifdef NeedFunctionPrototypes #undef NeedFunctionPrototypes #endif #endif /* * Define SUPPORTS_WCHARS if the system supports wide character sets */ #if !defined(VAX) && !defined(__CENTERLINE__) #define SUPPORTS_WCHARS #endif /* * Handy definition used in SET_BACKGROUND_COLOR */ #define UNSET (-1) /* * Set state of inclusion of prototypes properly */ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif #ifdef NeedFunctionPrototypes #ifdef __cplusplus #define UARG(a, b) a, #define GRAU(a, b) a) #else #define UARG(a, b) a b, #define GRAU(a, b) a b) #endif #else #define UARG(a, b) a b; #define GRAU(a, b) a b; #endif /* * Set up strcasecmp function */ #if defined(LOCAL_STRCASECMP) #define STRCASECMP StrCasecmp #ifndef NeedFunctionPrototypes static int StrCasecmp(); #else static int StrCasecmp(char*, char*); #endif #else #define STRCASECMP strcasecmp #endif /* * Define XTPOINTER so it works with all releases of * Xt and c++. */ #ifdef __cplusplus #if XtSpecificationRelease < 5 #define XTPOINTER char * #else #define XTPOINTER XPointer #endif #else #define XTPOINTER XtPointer #endif /* * The following enum is used to support wide character sets. * Use this enum for references into the Common Wide Characters array. * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last * entry in the enum. This will maintain correct memory usage, etc. */ enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab, WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR, WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne, NUM_COMMON_WCHARS }; /***************************************************************************** * GLOBAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * EXTERNAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * STATIC DECLARATION *****************************************************************************/ #ifndef NeedFunctionPrototypes #ifndef SUPPORTS_WCHARS static int mblen (); #endif static int strlenWc (); static size_t doMbstowcs (); static size_t doWcstombs (); static void copyWcsToMbs (); static int dombtowc (); static Boolean extractSegment (); static XmString StringToXmString (); static char* getNextCStrDelim (); static int getCStrCount (); static wchar_t *CStrCommonWideCharsGet (); #else #ifndef SUPPORTS_WCHARS static int mblen (char*, size_t); #endif static int strlenWc (wchar_t*); static size_t doMbstowcs (wchar_t*, char*, size_t); static size_t doWcstombs (char*, wchar_t*, size_t); static void copyWcsToMbs (char*, wchar_t*, int, Boolean); static int dombtowc (wchar_t*, char*, size_t); static Boolean extractSegment (wchar_t**, wchar_t**, int *, wchar_t**, int*, int*, Boolean*); static XmString StringToXmString (char*); static char* getNextCStrDelim (char*); static int getCStrCount (char*); static wchar_t *CStrCommonWideCharsGet (); #endif /***************************************************************************** * STATIC CODE *****************************************************************************/ #if defined(LOCAL_STRCASECMP) /* * Function: * cmp = StrCasecmp(s1, s2); * Description: * Compare two strings ignoring case * Input: * s1 - char * : string 1 to compare * s2 - char * : string 2 to compare * Output: * int : 0; s1 == s2 * 1; s1 != s2 */ static int StrCasecmp ARGLIST((s1, s2)) ARG(register char *, s1) GRA(register char *, s2) { register int c1, c2; while (*s1 && *s2) { c1 = isupper(*s1) ? tolower(*s1) : *s1; c2 = isupper(*s2) ? tolower(*s2) : *s2; if (c1 != c2) { return(1); } s1++; s2++; } if (*s1 || *s2) { return(1); } return(0); } #endif #ifndef SUPPORTS_WCHARS /* * Function: * len = mblen(s, n); * Description: * The mblen function for platforms that don't have one. This * function simply returns a length of 1 since no wide character * support exists for this platform. * Input: * s - char * : the character string to get the length from * n - size_t : the size of the string * Output: * int : always 1 */ static int mblen ARGLIST((s, n)) ARG(char *, s) GRA(size_t, n) { return(1); } #endif /* * Function: * len = strlenWc(ptr); * Description: * Return the number of characters in a wide character string (not * the characters in the resultant mbs). * Input: * ptr - wchar_t* : pointer to the wcs to count * Output: * int : the number of characters found */ static int strlenWc ARGLIST((ptr)) GRA(wchar_t *,ptr) { register wchar_t *p = ptr; register int x = 0; if (!ptr) return(0); while (*p++) x++; return (x); } /* * Function: * bytesConv = doMbstowcs(wcs, mbs, n); * Description: * Create a wcs string from an input mbs. * Input: * wcs - wchar_t* : pointer to result buffer of wcs * mbs - char* : pointer to the source mbs * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doMbstowcs ARGLIST((wcs, mbs, n)) ARG(wchar_t *,wcs) ARG(char *, mbs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && mbs[i] != 0; ++i) { wcs[i] = mbs[i]; } wcs[i++] = 0; return(i); #else return(mbstowcs(wcs, mbs, n)); #endif } /* * Function: * bytesConv = doWcstombs(wcs, mbs, n); * Description: * Create a mbs string from an input wcs. * Input: * wcs - wchar_t* : pointer to the source wcs * mbs - char* : pointer to result mbs buffer * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doWcstombs ARGLIST((mbs, wcs, n)) ARG(char *, mbs) ARG(wchar_t *, wcs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && wcs[i] != 0; ++i) { mbs[i] = wcs[i]; } mbs[i] = 0; return(i); #else return(wcstombs(mbs, wcs, n)); #endif } /* * Function: * copyWcsToMbs(mbs, wcs, len); * Description: * Create a mbs string from an input wcs. This function allocates * a buffer if necessary. * Input: * mbs - char* : destination for the converted/copied output * wcs - wchar_t* : pointer to wcs to copy/convert * len - int : the number of wchar_t' to convert * process_it - Boolean : True if processing of quoted charcters, * False if blind. * Output: * None */ static void copyWcsToMbs ARGLIST((mbs, wcs, len, process_it)) ARG(char *, mbs) ARG(wchar_t *, wcs) ARG(int, len) GRA(Boolean, process_it) { static wchar_t *tbuf; static int tbufSize = 0; int numCvt; int lenToConvert; wchar_t *fromP = wcs; wchar_t *x = &fromP[len]; wchar_t *toP; wchar_t *commonWChars = CStrCommonWideCharsGet(); wchar_t tmp; /* * Make sure there's room in the buffer */ if (tbufSize < len) { tbuf = (wchar_t*)realloc((char*)tbuf, (len + 1) * sizeof(wchar_t)); tbufSize = len; } /* * Now copy and process */ toP = tbuf; lenToConvert = 0; while (fromP < x) { /* * Check for quoted characters */ if ((*fromP == commonWChars[WBackSlash]) && process_it) { fromP++; /* Skip quote */ if (fromP == x) /* Hanging quote? */ { *toP++ = commonWChars[WBackSlash]; lenToConvert++; break; } tmp = *fromP++; if (tmp == commonWChars[WideN]) { *toP++ = commonWChars[WNewLine]; } else if (tmp == commonWChars[WideT]) { *toP++ = commonWChars[WTab]; } else if (tmp == commonWChars[WideR]) { *toP++ = commonWChars[WCarriageReturn]; } else if (tmp == commonWChars[WideF]) { *toP++ = commonWChars[WFormFeed]; } else if (tmp == commonWChars[WideV]) { *toP++ = commonWChars[WVerticalTab]; } else if (tmp == commonWChars[WBackSlash]) { *toP++ = commonWChars[WBackSlash]; } else { /* * No special translation needed */ *toP++ = tmp; } } else { *toP++ = *fromP++; } lenToConvert++; } numCvt = doWcstombs(mbs, tbuf, lenToConvert); mbs[numCvt] = '\0'; } /* * Function: * status = dombtowc(wide, multi, size); * Description: * Convert a multibyte character to a wide character. * Input: * wide - wchar_t * : where to put the wide character * multi - char * : the multibyte character to convert * size - size_t : the number of characters to convert * Output: * 0 - if multi is a NULL pointer or points to a NULL character * #bytes - number of bytes in the multibyte character * -1 - multi is an invalid multibyte character. * * NOTE: if wide is NULL, then this returns the number of bytes in * the multibyte character. */ static int dombtowc ARGLIST((wide, multi, size)) ARG(wchar_t *, wide) ARG(char *, multi) GRA(size_t, size) { int retVal = 0; #ifndef SUPPORTS_WCHARS if ((multi == NULL) || (*multi == '\000')) { if (wide) wide[0] = '\0'; return (0); } for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++) { if (wide != NULL) { wide[retVal] = multi[retVal]; } } #else retVal = mbtowc(wide, multi, size); #endif return(retVal); } /* * Function: * ptr = getNextSepartor(str); * Description: * Parse through a string looking for the next compound string * field separator * Inputs: * str - wchar_t* : the address of address of the string to parse * Outputs: * ptr - wchar_t* : pointer to character, if found, points to end * of string otherwise ('\0'). */ static wchar_t* getNextSeparator ARGLIST((str)) GRA(wchar_t *, str) { wchar_t *ptr = str; wchar_t *commonWChars = CStrCommonWideCharsGet(); while (*ptr) { /* * Check for separator */ if ((*ptr == commonWChars[WHash]) || (*ptr == commonWChars[WQuote]) || (*ptr == commonWChars[WColon])) { return(ptr); } else if (*ptr == commonWChars[WBackSlash]) { ptr++; if (*ptr) ptr++; /* Skip quoted character */ } else { ptr++; } } return(ptr); } /* * Function: * more = * extractSegment(str, tagStart, tagLen, txtStart, txtLen, * pDir, pSep); * Description: * Parse through a string version of a compound string and extract * the first compound string segment from the string. * Inputs: * str - char** : the address of address of the string to parse * tagStart - char** : address to return pointer to tag start into * tagLen - int* : address where to return the tag length into * txtStart - char** : address to return the text start into * txtLen - int* : address where to return the text length * pDir - int* : address to return the string direction into * pSep - Boolean * : address to return the separtor into * Outputs: * more - Boolean : True if more of the string to parse. * False means done. */ static Boolean extractSegment ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep)) ARG(wchar_t **, str) ARG(wchar_t **, tagStart) ARG(int *, tagLen) ARG(wchar_t **, txtStart) ARG(int *, txtLen) ARG(int *, pDir) GRA(Boolean *, pSep) { wchar_t *start; wchar_t *text; int textL; Boolean tagSeen; wchar_t *tag; int tagL; Boolean modsSeen; Boolean sep; int dir; Boolean done; int *lenUp; Boolean checkDir; wchar_t *commonWChars; wchar_t emptyStrWcs[1]; /* * Initialize variables */ text = NULL; textL = 0; tagSeen = False; tag = NULL; tagL = 0; modsSeen = False; dir = XmSTRING_DIRECTION_L_TO_R; sep = False; done = False; lenUp = NULL; commonWChars = CStrCommonWideCharsGet(); /* * Guard against nulls */ if (!(start = *str)) { start = emptyStrWcs; emptyStrWcs[0] = commonWChars[WNull]; } /* * If the first character of the string isn't a # or a ", then we * just have a regular old simple string. Do the same the thing for * the empty string. */ if ((*start == '\0') || (start != getNextSeparator(start))) { text = start; if (!(textL = strlenWc(start))) { text = NULL; } start += textL; } else { done = False; while (!done) { if (*start == commonWChars[WHash]) { if (tagSeen) { done = True; break; } else { tagSeen = True; tag = ++start; start = getNextSeparator(tag); if ((tagL = start - tag) == 0) { tag = NULL; /* Null tag specified */ } } } else if (*start == commonWChars[WQuote]) { text = ++start; start = getNextSeparator(start); while (!((*start == commonWChars[WQuote]) || (*start == commonWChars[WNull]))) { start = getNextSeparator(++start); } if ((textL = start - text) == 0) { text = NULL; /* Null text specified */ } /* * if a quote, skip over it */ if (*start == commonWChars[WQuote]) { start++; } done = True; } else if (*start == commonWChars[WColon]) { if (modsSeen) { done = True; break; } /* * If the next character is a t or f, the we've got * a separator. */ modsSeen = True; checkDir = False; start++; if ((*start == commonWChars[WideT]) || (*start == commonWChars[WideUT]) || (*start == commonWChars[WideOne])) { sep = True; start++; checkDir = True; } else if ((*start == commonWChars[WideF]) || (*start == commonWChars[WideUF]) || (*start == commonWChars[WideZero])) { sep = False; start++; checkDir = True; } else if ((*start == commonWChars[WideR]) || (*start == commonWChars[WideUR])) { start++; dir = XmSTRING_DIRECTION_R_TO_L; } else if ((*start == commonWChars[WideL]) || (*start == commonWChars[WideUL])) { start++; dir = XmSTRING_DIRECTION_L_TO_R; } /* * Look for direction if necessary. This requires a bit of * look ahead. */ if (checkDir && (*start == commonWChars[WColon])) { if ((*(start + 1) == commonWChars[WideL]) || (*(start + 1) == commonWChars[WideUL])) { dir = XmSTRING_DIRECTION_L_TO_R; start += 2; } else if ((*(start + 1) == commonWChars[WideR]) || (*(start + 1) == commonWChars[WideUR])) { dir = XmSTRING_DIRECTION_R_TO_L; start+=2; } } } else { /* * A bad string format! We'll just skip the character. */ start++; } } } /* * Now fill in return values */ if (*str) *str = start; if (tagStart) *tagStart = tag; if (tagLen) *tagLen = tagL; if (txtStart) *txtStart = text; if (txtLen) *txtLen = textL; if (pDir) *pDir = dir; if (pSep) *pSep = sep; return ((*start == commonWChars[WNull]) ? False : True); } /* * Function: * xstr = StringToXmString(str); * Description: * Parse a string into an XmString. * Inputs: * str - char * : the string to parse * Outputs: * xstr - XmString : the allocated return structure */ static XmString StringToXmString ARGLIST((str)) GRA(char *,str) { static char* tagBuf = NULL; static int tagBufLen = 0; static char* textBuf = NULL; static int textBufLen = 0; wchar_t *ctx; wchar_t *tag; int tagLen; wchar_t *text; int textLen; Boolean sep; int dir; Boolean more; wchar_t *wcStr; int curDir; XmString xmStr; XmString s1; XmString s2; if (!str) return(NULL); /* * For expediencies sake, we'll overallocate this buffer so that * the wcs is guaranteed to fit (1 wc per byte in original string). */ wcStr = (wchar_t*)malloc((strlen(str) + 1) * sizeof(wchar_t)); doMbstowcs(wcStr, str, strlen(str) + 1); /* * Create the beginning segment */ curDir = XmSTRING_DIRECTION_L_TO_R; xmStr = XmStringDirectionCreate(curDir); /* * Convert the string. */ more = True; ctx = wcStr; while (more) { more = extractSegment(&ctx, &tag, &tagLen, &text, &textLen, &dir, &sep); /* * Pick up a direction change */ if (dir != curDir) { #if defined(VMS) || (defined(__osf__) && defined(__alpha)) /* * This is required on DEC Windows systems because they've * added the REVERT direction. */ s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); #endif curDir = dir; s1 = XmStringDirectionCreate(curDir); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Create the segment. Text and tag first. */ if (textLen) { if (textBufLen <= (textLen * sizeof(wchar_t))) { textBufLen = (textLen + 1) * sizeof(wchar_t); textBuf = (char*)realloc(textBuf, textBufLen); } copyWcsToMbs(textBuf, text, textLen, True); if (tagLen) { if (tagBufLen <= (tagLen * sizeof(wchar_t))) { tagBufLen = (tagLen + 1) * sizeof(wchar_t); tagBuf = (char*)realloc(tagBuf, tagBufLen); } copyWcsToMbs(tagBuf, tag, tagLen, False); } else { if (!tagBuf) { tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1; tagBuf = (char*)malloc(tagBufLen); } strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET); } s1 = XmStringCreate(textBuf, tagBuf); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Add in the separators. */ if (sep) { s1 = XmStringSeparatorCreate(); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } } /* * Free up memory and return */ free((char*)wcStr); return(xmStr); } /* * Function: * nextCStr = getNextCStrDelim(str); * Description: * Find the next unquoted , or \n in the string * Input: * str - char * : the input string * Output: * nextCStr - char* : pointer to the next delimiter. Returns NULL if no * delimiter found. */ static char* getNextCStrDelim ARGLIST((str)) GRA(char *,str) { char *comma = str; Boolean inQuotes = False; int len; if (!str) return(NULL); if (!*str) return(NULL); /* At end */ #ifdef __CENTERLINE__ mblen((char *)NULL, sizeof(wchar_t)); #else mblen(NULL, sizeof(wchar_t)); #endif while (*comma) { if ((len = mblen(comma, sizeof(wchar_t))) > 1) { comma += len; continue; } if (*comma == '\\') { comma++; /* Over quote */ comma += mblen(comma, sizeof(wchar_t)); continue; } /* * See if we have a delimiter */ if (!inQuotes) { if ((*comma == ',') || (*comma == '\012')) { return(comma); } } /* * Deal with quotes */ if (*comma == '\"') { inQuotes = ~inQuotes; } comma++; } return(NULL); /* None found */ } /* * Function: * cnt = getCStrCount(str); * Description: * Get the count of cstrings in a compound string table ascii * format. * Input: * str - char * : string to parse * Output: * cnt - int : the number of XmStrings found */ static int getCStrCount ARGLIST((str)) GRA(char *, str) { int x = 1; char *newStr; if (!str) return(0); if (!*str) return(0); while ((newStr = getNextCStrDelim(str))) { x++; str = ++newStr; } return(x); } /* * Function: * cwc = CStrCommonWideCharsGet(); * Description: * Return the array of common wide characters. * Input: * None. * Output: * cwc - wchar_t * : this array should never be written to or FREEd. */ static wchar_t *CStrCommonWideCharsGet() { static wchar_t *CommonWideChars = NULL; if (CommonWideChars == NULL) { int i; /* * If you add to this array, don't forget to change the enum in * the TYPEDEFS and DEFINES section above to correspond to this * array. */ static char *characters[] = { "\000", "\t", "\n", "\r", "\f", "\v", "\\", "\"", "#", ":", "f", "l", "n", "r", "t", "v", "F", "L", "R", "T", "0", "1" }; /* * Allocate and create the array. */ CommonWideChars = (wchar_t*)malloc(NUM_COMMON_WCHARS * sizeof(wchar_t)); for (i = 0; i < NUM_COMMON_WCHARS; i++) { (void)dombtowc(&(CommonWideChars[i]), characters[i], 1); } } return(CommonWideChars); } /* * Function: * CONVERTER CvtStringToXmString * and * XmStringCvtDestroy * Description: * Convert a string to an XmString. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * ::[#[font-tag]]"string"[#[font-tag]"string"] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmString ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) UARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString resStr; char *str; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg(XtDisplayToApplicationContext(d), "cvtStringToXmString", "wrongParameters", "XtToolkitError", "String to XmString converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * See if this is a simple string */ str = (char*)fromVal->addr; if (strncmp(str, "::", 2)) { resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET); } else { /* * Convert into internal format */ resStr = StringToXmString(fromVal->addr + 2); /* skip :: */ } /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&resStr; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString)) { toVal->size = sizeof(XmString); XtDisplayStringConversionWarning(d, fromVal->addr, "XmString"); XmStringFree(resStr); return(False); } else { *(XmString *)toVal->addr = resStr; toVal->size = sizeof(XmString); } return(True); } static void XmStringCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmStringFree(*(XmString*)(to->addr)); } /* * Function: * CONVERTER CvtStringToXmStringTable * and * XmStringTableCvtDestroy * * Description: * Convert a string to an XmString table. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ... * compound_string_table = [compound_string][,compound_string] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmStringTable ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) ARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString *CStrTable; XmString *tblPtr; char *str; char *tmpBuf; char *nextDelim; XrmValue fVal; XrmValue tVal; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg (XtDisplayToApplicationContext(d), "cvtStringToXmStringTable", "wrongParameters", "XtToolkitError", "String to XmStringTable converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * Set str and make sure there's somethin' there */ if (!(str = (char*)fromVal->addr)) { str = ""; } /* * Allocate the XmStrings + 1 for NULL termination */ CStrTable = (XmString*)malloc((getCStrCount(str) + 1) * sizeof(XmString*)); /* * Use the string converter for the strings */ tmpBuf = (char*)malloc(strlen(str) + 1); strcpy(tmpBuf, str); str = tmpBuf; /* * Create strings */ tblPtr = CStrTable; if (*str) { while (str) { nextDelim = getNextCStrDelim(str); /* * Overwrite nextDelim */ if (nextDelim) { *nextDelim = '\0'; nextDelim++; } /* * Convert it */ fVal.size = strlen(str) + 1; fVal.addr = str; tVal.size = sizeof(XTPOINTER); tVal.addr = (XTPOINTER)tblPtr; /* * Call converter ourselves since this is used to create * the strings in the table we create. We need to do this * since we don't have a widget to send to the XtConvertAndStore * function. Side effects are that we can never get these * compound strings cached and that no destructor function is * called when the strings leave existance, but we nuke 'em * in the XmStringTable destuctor. */ CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL); tblPtr++; str = nextDelim; } } free(tmpBuf); /* * Null terminate */ *tblPtr = NULL; /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&CStrTable; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString*)) { toVal->size = sizeof(XmString*); XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable"); tblPtr = CStrTable; while (*tblPtr) { XmStringFree(*tblPtr); } free((char*)CStrTable); return(False); } else { *(XmString **)toVal->addr = CStrTable; toVal->size = sizeof(XmString*); } return(True); } static void XmStringTableCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmString *tblPtr = *(XmString**)(to->addr); while (*tblPtr) { XmStringFree(*tblPtr); } free((char*)(*(XmString**)(to->addr))); } /***************************************************************************** * GLOBAL CODE *****************************************************************************/ /* * Function: * RegisterConverters(appContext); * Description: * This globally available function installs all the converters necessary * to run BuilderXcessory generated interfaces that use compound * strings. This is necessary since Motif has not supplied very smart * converters. * Input: * appContext - XtAppContext : the application context * Output: * None */ void RegisterConverters ARGLIST((appContext)) GRA(XtAppContext, appContext) { XtAppSetTypeConverter(appContext, XmRString, XmRXmString, (XtTypeConverter)CvtStringToXmString, NULL, 0, XtCacheNone, XmStringCvtDestroy); XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable, (XtTypeConverter)CvtStringToXmStringTable, NULL, 0, XtCacheNone, XmStringTableCvtDestroy); } /* * Function: * CONVERT(w, from_string, to_type, to_size, success); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * w - Widget : the widget to use for conversion * from_string - char * : the string to convert from * to_type - char * : the type to convert to * to_size - int : the size of the conversion result * success - Boolean* : Set to the result value of the conversion * Output: * None */ #ifndef IGNORE_CONVERT XtPointer CONVERT ARGLIST((w, from_string, to_type, to_size, success)) ARG(Widget, w) ARG(char *, from_string) ARG(char *, to_type) ARG(int, to_size) GRA(Boolean *, success) { XrmValue fromVal, toVal; /* resource holders */ Boolean convResult; /* return value */ XtPointer val; /* Pointer size return value */ /* * We will assume that the conversion is going to fail and change this * value later if the conversion is a success. */ *success = False; /* * Since we are converting from a string to some type we need to * set the fromVal structure up with the string information that * the caller passed in. */ fromVal.size = strlen(from_string) + 1; fromVal.addr = from_string; /* * Since we are not sure what type and size of data we are going to * get back we will set this up so that the converter will point us * at a block of valid data. */ toVal.size = 0; toVal.addr = NULL; /* * Now lets try to convert this data by calling this handy-dandy Xt * routine. */ convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal); /* * Now we have two conditions here. One the conversion was a success * and two the conversion failed. */ if(!convResult) { /* * If this conversion failed that we can pretty much return right * here because there is nothing else we can do. */ return((XtPointer) NULL); } /* * If we get this far that means we did the conversion and all is * well. Now we have to handle the special cases for type and * size constraints. */ if(!strcmp(to_type, "String")) { /* * Since strings are handled different in Xt we have to deal with * the conversion from a string to a string. When this happens the * toVal.size will hold the strlen of the string so generic * conversion code can't handle it. It is possible for a string to * string conversion to happen so we do have to watch for it. */ val = (XTPOINTER)toVal.addr; } else { /* * Here is the generic conversion return value handler. This * just does some size specific casting so that value that we * return is in the correct bytes of the XtPointer that we * return. Here we check all sizes from 1 to 8 bytes. */ switch(toVal.size) { case 1: val = (XTPOINTER)(unsigned)(*(char*)toVal.addr); /* may be exists bug */ break; case 2: val = (XTPOINTER)(unsigned)(*(short*)toVal.addr); /* may be exists bug */ break; case 4: val = (XTPOINTER)(unsigned)(*(int*)toVal.addr); /* may be exists bug */ break; case 8: default: val = (XTPOINTER)(unsigned)(*(long*)toVal.addr); /* may be exists bug */ break; } } /* * Well everything is done and the conversion was a success so lets * set the success flag to True. */ *success = convResult; /* * Finally lets return the converted value. */ /*SUPPRESS 80*/ return(val); } #endif /* * Function: * MENU_POST(p, mw, ev, dispatch); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * p - Widget : the widget to post * mw - XtPointer : the menu widget * ev - XEvent* : the event that caused the menu post * dispatch - Boolean* : not used * Output: * None */ #ifndef IGNORE_MENU_POST void MENU_POST ARGLIST((p, mw, ev, dispatch)) UARG(Widget, p) ARG(XtPointer, mw) ARG(XEvent *, ev) GRAU(Boolean *, dispatch) { Arg args[2]; int argcnt; int button; Widget m = (Widget)mw; XButtonEvent *e = (XButtonEvent *)ev; argcnt = 0; XtSetArg(args[argcnt], XmNwhichButton, &button); argcnt++; XtGetValues(m, args, argcnt); if(e->button != button) return; XmMenuPosition(m, e); XtManageChild(m); } #endif /* * Function: * SET_BACKGROUND_COLOR(w, args, argcnt, bg_color); * Description: * Sets the background color and shadows of a widget. * Input: * w - The widget to set the background color on. * args, argcnt - The argument list so far. * bg_color - The new background color as a pixel. * Output: * none * * NOTES: This assumes that args later in the argument list * override those already in the list. Therfore i f * there are shadow colors later in the list they will win. * * There is no need to use this function when creating a widget * only when doing a set values, shadow colors are automatically * calculated at creation time. */ void SET_BACKGROUND_COLOR ARGLIST((w, args, argcnt, bg_color)) ARG(Widget, w) ARG(ArgList, args) ARG(Cardinal *, argcnt) GRA(Pixel, bg_color) { int i; int topShadowLoc; int bottomShadowLoc; int selectLoc; int fgLoc; Boolean argok = False; #if ((XmVERSION == 1) && (XmREVISION > 0)) /* * Walk through the arglist to see if the user set the top or * bottom shadow colors. */ selectLoc = topShadowLoc = bottomShadowLoc = UNSET; for (i = 0; i < *argcnt; i++) { if ((strcmp(args[i].name, XmNtopShadowColor) == 0) || (strcmp(args[i].name, XmNtopShadowPixmap) == 0)) { topShadowLoc = i; } else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) || (strcmp(args[i].name, XmNbottomShadowPixmap) == 0)) { bottomShadowLoc = i; } else if (strcmp(args[i].name, XmNarmColor) == 0) { selectLoc = i; } else if (strcmp(args[i].name, XmNforeground) == 0) { fgLoc = i; } } /* * If either the top or bottom shadow are not set then we * need to use XmGetColors to get the shadow colors from the backgound * color and add those that are not already in the arglist to the * arglist. * */ if ((bottomShadowLoc == UNSET) || (topShadowLoc == UNSET) || (selectLoc == UNSET) || (fgLoc == UNSET)) { Arg larg[1]; Colormap cmap; Pixel topShadow; Pixel bottomShadow; Pixel select; Pixel fgColor; XtSetArg(larg[0], XmNcolormap, &cmap); XtGetValues(w, larg, 1); XmGetColors(XtScreen(w), cmap, bg_color, &fgColor, &topShadow, &bottomShadow, &select); if (topShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow); (*argcnt)++; } if (bottomShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow); (*argcnt)++; } if (selectLoc == UNSET) { XtSetArg(args[*argcnt], XmNarmColor, select); (*argcnt)++; } if (fgLoc == UNSET) { XtSetArg(args[*argcnt], XmNforeground, fgColor); (*argcnt)++; } } #endif XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++; } /* * Function: * w = FindTopShell(start); * Description: * Go up the hierarhcy until we find a shell widget. * Input: * start - Widget : the widget to start with. * Output: * w - Widget : the shell widget. */ #ifndef __FIND_TOP_SHELL #define __FIND_TOP_SHELL Widget FindTopShell ARGLIST((start)) GRA(Widget, start) { Widget p; while ((p = XtParent(start))) { start = p; } return(start); } #endif /* __FIND_TOP_SHELL */ /* * Function: * WidgetIdsFromNames(ref, cbName, stringList) * Description: * Return an array of widget ids from a list of widget names. * Input: * ref - Widget : reference widget. * cbName - char* : callback name. * stringList - char*: list of widget names. * Output: * WidgetList : array of widget IDs. */ #ifndef __WIDGETIDS_FROM_NAMES #define __WIDGETIDS_FROM_NAMES WidgetList WidgetIdsFromNames ARGLIST((ref, cbName, stringList)) ARG(Widget, ref) ARG(char, *cbName) GRA(char, *stringList) { WidgetList wgtIds = NULL; int wgtCount = 0; Widget inst; Widget current; String tmp; String start; String widget; char *ptr; /* * For backward compatibility, remove [ and ] from the list. */ tmp = start = XtNewString(stringList); if((start = strchr(start, '[')) != NULL) start++; else start = tmp; while((start && *start) && isspace(*start)) { start++; } ptr = strrchr(start, ']'); if (ptr) { *ptr = '\0'; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * start now points to the first character after the [. * the list is now either empty, one, or more widget * instance names. */ start = strtok(start, ","); while(start) { while((start && *start) && isspace(*start)) { start++; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * Form a string to use with XtNameToWidget(). */ widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char)); sprintf(widget, "*%s", start); /* * Start at this level and continue up until the widget is found * or until the top of the hierarchy is reached. */ current = ref; while (current != NULL) { inst = XtNameToWidget(current, widget); if (inst != NULL ) { wgtCount++; wgtIds = (WidgetList)XtRealloc((char *)wgtIds, wgtCount * sizeof(Widget)); wgtIds[wgtCount - 1] = inst; break; } current = XtParent(current); } if (current == NULL) { printf("Callback Error (%s):\n\t\ Cannot find widget %s\n", cbName, widget); } XtFree(widget); start = strtok(NULL, ","); } /* * NULL terminate the list. */ wgtIds = (WidgetList)XtRealloc((char *)wgtIds, (wgtCount + 1) * sizeof(Widget)); wgtIds[wgtCount] = NULL; XtFree((char *)tmp); return(wgtIds); } #endif /* __WIDGETIDS_FROM_NAMES */ /**************************************************************************** * * Big chunk of code inserted from Bull * ****************************************************************************/ #ifndef IGNORE_XPM_PIXMAP /* * Copyright 1990, 1991 GROUPE BULL * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of GROUPE BULL not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. GROUPE BULL makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * GROUPE BULL disclaims all warranties with regard to this software, * including all implied warranties of merchantability and fitness, * in no event shall GROUPE BULL be liable for any special, * indirect or consequential damages or any damages * whatsoever resulting from loss of use, data or profits, * whether in an action of contract, negligence or other tortious * action, arising out of or in connection with the use * or performance of this software. * */ /* Return ErrorStatus codes: * null if full success * positive if partial success * negative if failure */ #define XpmColorError 1 #define XpmSuccess 0 #define XpmOpenFailed -1 #define XpmFileInvalid -2 #define XpmNoMemory -3 #define XpmColorFailed -4 typedef struct { char *name; /* Symbolic color name */ char *value; /* Color value */ Pixel pixel; /* Color pixel */ } XpmColorSymbol; typedef struct { unsigned long valuemask; /* Specifies which attributes are * defined */ Visual *visual; /* Specifies the visual to use */ Colormap colormap; /* Specifies the colormap to use */ unsigned int depth; /* Specifies the depth */ unsigned int width; /* Returns the width of the created * pixmap */ unsigned int height; /* Returns the height of the created * pixmap */ unsigned int x_hotspot; /* Returns the x hotspot's * coordinate */ unsigned int y_hotspot; /* Returns the y hotspot's * coordinate */ unsigned int cpp; /* Specifies the number of char per * pixel */ Pixel *pixels; /* List of used color pixels */ unsigned int npixels; /* Number of pixels */ XpmColorSymbol *colorsymbols; /* Array of color symbols to * override */ unsigned int numsymbols; /* Number of symbols */ char *rgb_fname; /* RGB text file name */ /* Infos */ unsigned int ncolors; /* Number of colors */ char ***colorTable; /* Color table pointer */ char *hints_cmt; /* Comment of the hints section */ char *colors_cmt; /* Comment of the colors section */ char *pixels_cmt; /* Comment of the pixels section */ unsigned int mask_pixel; /* Transparent pixel's color table * index */ } XpmAttributes; /* Xpm attribute value masks bits */ #define XpmVisual (1L<<0) #define XpmColormap (1L<<1) #define XpmDepth (1L<<2) #define XpmSize (1L<<3) /* width & height */ #define XpmHotspot (1L<<4) /* x_hotspot & y_hotspot */ #define XpmCharsPerPixel (1L<<5) #define XpmColorSymbols (1L<<6) #define XpmRgbFilename (1L<<7) #define XpmInfos (1L<<8) /* all infos members */ #define XpmReturnPixels (1L<<9) #define XpmReturnInfos XpmInfos /* * minimal portability layer between ansi and KR C */ /* forward declaration of functions with prototypes */ #ifdef NeedFunctionPrototypes #define FUNC(f, t, p) extern t f p #define LFUNC(f, t, p) static t f p #else #define FUNC(f, t, p) extern t f() #define LFUNC(f, t, p) static t f() #endif /* * functions declarations */ #ifdef __cplusplus extern "C" { #endif LFUNC(XpmCreatePixmapFromData, int, (Display * display, Drawable d, char **data, Pixmap * pixmap_return, Pixmap * shapemask_return, XpmAttributes * attributes)); LFUNC(XpmCreateImageFromData, int, (Display * display, char **data, XImage ** image_return, XImage ** shapemask_return, XpmAttributes * attributes)); LFUNC(XpmFreeAttributes, void, (XpmAttributes * attributes)); #ifdef __cplusplus } /* for C++ V2.0 */ #endif #ifdef SYSV #define bcopy(source, dest, count) memcpy(dest, source, count) #endif typedef struct { unsigned int type; union { FILE *file; char **data; } stream; char *cptr; unsigned int line; int CommentLength; char Comment[BUFSIZ]; char *Bcmt, *Ecmt, Bos, Eos; unsigned int InsideString; /* used during parsing: 0 or 1 * whether we are inside or not */ } xpmData; #define XPMARRAY 0 #define XPMFILE 1 #define XPMPIPE 2 typedef unsigned char byte; extern char *xpmColorKeys[]; #define TRANSPARENT_COLOR "None" /* this must be a string! */ /* number of xpmColorKeys */ #define NKEYS 5 /* * key numbers for visual type, they must fit along with the number key of * each corresponding element in xpmColorKeys[] defined in xpm.h */ #define MONO 2 #define GRAY4 3 #define GRAY 4 #define COLOR 5 /* structure containing data related to an Xpm pixmap */ typedef struct { char *name; unsigned int width; unsigned int height; unsigned int cpp; unsigned int ncolors; char ***colorTable; unsigned int *pixelindex; XColor *xcolors; char **colorStrings; unsigned int mask_pixel; /* mask pixel's colorTable index */ } xpmInternAttrib; #define UNDEF_PIXEL 0x80000000 char *xpmColorKeys[] = { "s", /* key #1: symbol */ "m", /* key #2: mono visual */ "g4", /* key #3: 4 grays visual */ "g", /* key #4: gray visual */ "c", /* key #5: color visual */ }; /* XPM private routines */ LFUNC(xpmCreateImage, int, (Display * display, xpmInternAttrib * attrib, XImage ** image_return, XImage ** shapeimage_return, XpmAttributes * attributes)); LFUNC(xpmParseData, int, (xpmData * data, xpmInternAttrib * attrib_return, XpmAttributes * attributes)); LFUNC(xpmVisualType, int, (Visual * visual)); LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors)); LFUNC(xpmInitInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmFreeInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmSetAttributes, void, (xpmInternAttrib * attrib, XpmAttributes * attributes)); /* I/O utility */ LFUNC(xpmNextString, void, (xpmData * mdata)); LFUNC(xpmNextUI, int, (xpmData * mdata, unsigned int *ui_return)); LFUNC(xpmGetC, int, (xpmData * mdata)); LFUNC(xpmUngetC, int, (int c, xpmData * mdata)); LFUNC(xpmNextWord, unsigned int, (xpmData * mdata, char *buf)); LFUNC(xpmGetCmt, void, (xpmData * mdata, char **cmt)); LFUNC(xpmOpenArray, int, (char **data, xpmData * mdata)); LFUNC(XpmDataClose, void, (xpmData * mdata)); /* RGB utility */ LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); /* Image utility */ LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname, unsigned int color_index, Pixel * image_pixel, Pixel * mask_pixel, unsigned int *mask_pixel_index)); LFUNC(CreateXImage, int, (Display * display, Visual * visual, unsigned int depth, unsigned int width, unsigned int height, XImage ** image_return)); LFUNC(SetImagePixels, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); /* * Macros * * The XYNORMALIZE macro determines whether XY format data requires * normalization and calls a routine to do so if needed. The logic in * this module is designed for LSBFirst byte and bit order, so * normalization is done as required to present the data in this order. * * The ZNORMALIZE macro performs byte and nibble order normalization if * required for Z format data. * * The XYINDEX macro computes the index to the starting byte (char) boundary * for a bitmap_unit containing a pixel with coordinates x and y for image * data in XY format. * * The ZINDEX* macros compute the index to the starting byte (char) boundary * for a pixel with coordinates x and y for image data in ZPixmap format. * */ #define XYNORMALIZE(bp, img) \ if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \ xpm_xynormalizeimagebits((unsigned char *)(bp), img) #define ZNORMALIZE(bp, img) \ if (img->byte_order == MSBFirst) \ xpm_znormalizeimagebits((unsigned char *)(bp), img) #define XYINDEX(x, y, img) \ ((y) * img->bytes_per_line) + \ (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3) #define ZINDEX(x, y, img) ((y) * img->bytes_per_line) + \ (((x) * img->bits_per_pixel) >> 3) #define ZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2) #define ZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1) #define ZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x) #define ZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3) #if __STDC__ #define Const const #else #define Const #endif Pixmap XPM_PIXMAP ARGLIST((w, pixmapName)) ARG(Widget, w) GRA(char **, pixmapName) { XpmAttributes attributes; int argcnt; Arg args[10]; Pixmap pixmap; Pixmap shape; int returnValue; argcnt = 0; XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++; XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++; XtGetValues(w, args, argcnt); attributes.visual = DefaultVisual(XtDisplay(w), DefaultScreen(XtDisplay(w))); attributes.valuemask = (XpmDepth | XpmColormap | XpmVisual); returnValue = XpmCreatePixmapFromData(XtDisplay(w), DefaultRootWindow(XtDisplay(w)), pixmapName, &pixmap, &shape, &attributes); if ( shape ) { XFreePixmap(XtDisplay(w), shape); } switch(returnValue) { case XpmOpenFailed: case XpmFileInvalid: case XpmNoMemory: case XpmColorFailed: XtWarning("Could not create pixmap."); return(XmUNSPECIFIED_PIXMAP); default: return(pixmap); } } static unsigned int atoui ARGLIST((p, l, ui_return)) ARG(register char *, p) ARG(unsigned int, l) GRA(unsigned int *, ui_return) { register int n, i; n = 0; for (i = 0; i < l; i++) if (*p >= '0' && *p <= '9') n = n * 10 + *p++ - '0'; else break; if (i != 0 && i == l) { *ui_return = n; return 1; } else return 0; } static int XpmCreatePixmapFromData ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes)) ARG(Display *, display) ARG(Drawable, d) ARG(char **, data) ARG(Pixmap *, pixmap_return) ARG(Pixmap *, shapemask_return) GRA(XpmAttributes *,attributes) { XImage *image, **imageptr = NULL; XImage *shapeimage, **shapeimageptr = NULL; int ErrorStatus; XGCValues gcv; GC gc; /* * initialize return values */ if (pixmap_return) { *pixmap_return = (Pixmap)NULL; imageptr = ℑ } if (shapemask_return) { *shapemask_return = (Pixmap)NULL; shapeimageptr = &shapeimage; } /* * create the images */ ErrorStatus = XpmCreateImageFromData(display, data, imageptr, shapeimageptr, attributes); if (ErrorStatus < 0) return (ErrorStatus); /* * create the pixmaps */ if (imageptr && image) { *pixmap_return = XCreatePixmap(display, d, image->width, image->height, image->depth); gcv.function = GXcopy; gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv); XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0, image->width, image->height); XDestroyImage(image); XFreeGC(display, gc); } if (shapeimageptr && shapeimage) { *shapemask_return = XCreatePixmap(display, d, shapeimage->width, shapeimage->height, shapeimage->depth); gcv.function = GXcopy; gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv); XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0, shapeimage->width, shapeimage->height); XDestroyImage(shapeimage); XFreeGC(display, gc); } return (ErrorStatus); } static int XpmCreateImageFromData ARGLIST((display, data, image_return, shapeimage_return, attributes)) ARG(Display *,display) ARG(char **, data) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { xpmData mdata; int ErrorStatus; xpmInternAttrib attrib; /* * initialize return values */ if (image_return) *image_return = NULL; if (shapeimage_return) *shapeimage_return = NULL; if ((ErrorStatus = xpmOpenArray(data, &mdata)) != XpmSuccess) return (ErrorStatus); xpmInitInternAttrib(&attrib); ErrorStatus = xpmParseData(&mdata, &attrib, attributes); if (ErrorStatus == XpmSuccess) ErrorStatus = xpmCreateImage(display, &attrib, image_return, shapeimage_return, attributes); if (ErrorStatus >= 0) xpmSetAttributes(&attrib, attributes); else if (attributes) XpmFreeAttributes(attributes); xpmFreeInternAttrib(&attrib); XpmDataClose(&mdata); return (ErrorStatus); } /* * open the given array to be read or written as an xpmData which is returned */ static int xpmOpenArray ARGLIST((data, mdata)) ARG(char **,data) GRA(xpmData *,mdata) { mdata->type = XPMARRAY; mdata->stream.data = data; mdata->cptr = *data; mdata->line = 0; mdata->CommentLength = 0; mdata->Bcmt = mdata->Ecmt = NULL; mdata->Bos = mdata->Eos = '\0'; mdata->InsideString = 0; return (XpmSuccess); } /* * Intialize the xpmInternAttrib pointers to Null to know * which ones must be freed later on. */ static void xpmInitInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *,attrib) { attrib->ncolors = 0; attrib->colorTable = NULL; attrib->pixelindex = NULL; attrib->xcolors = NULL; attrib->colorStrings = NULL; attrib->mask_pixel = UNDEF_PIXEL; } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \ if (chars) free(chars); \ if (pixelindex) free((char *)pixelindex); \ if (hints_cmt) free((char *)hints_cmt); \ if (colors_cmt) free((char *)colors_cmt); \ if (pixels_cmt) free((char *)pixels_cmt); \ return(status); } /* * This function parses an Xpm file or data and store the found informations * in an an xpmInternAttrib structure which is returned. */ static int xpmParseData ARGLIST((data, attrib_return, attributes)) ARG(xpmData *,data) ARG(xpmInternAttrib *, attrib_return) GRA(XpmAttributes *, attributes) { /* variables to return */ unsigned int width, height; unsigned int ncolors = 0; unsigned int cpp; unsigned int x_hotspot, y_hotspot, hotspot = 0; char ***colorTable = NULL; unsigned int *pixelindex = NULL; char *hints_cmt = NULL; char *colors_cmt = NULL; char *pixels_cmt = NULL; /* calculation variables */ unsigned int rncolors = 0; /* read number of colors, it is * different to ncolors to avoid * problem when freeing the * colorTable in case an error * occurs while reading the hints * line */ unsigned int key = 0; /* color key */ char *chars = NULL, buf[BUFSIZ]; unsigned int *iptr; unsigned int a, b, x, y, l; unsigned int curkey; /* current color key */ unsigned int lastwaskey; /* key read */ char curbuf[BUFSIZ]; /* current buffer */ /* * read hints: width, height, ncolors, chars_per_pixel */ if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height) && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp))) RETURN(XpmFileInvalid); ncolors = rncolors; /* * read hotspot coordinates if any */ hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot); /* * store the hints comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &hints_cmt); /* * read colors */ colorTable = (char ***) calloc(ncolors, sizeof(char **)); if (!colorTable) RETURN(XpmNoMemory); for (a = 0; a < ncolors; a++) { xpmNextString(data); /* skip the line */ colorTable[a] = (char **) calloc((NKEYS + 1), sizeof(char *)); if (!colorTable[a]) RETURN(XpmNoMemory); /* * read pixel value */ colorTable[a][0] = (char *) malloc(cpp); if (!colorTable[a][0]) RETURN(XpmNoMemory); for (b = 0; b < cpp; b++) colorTable[a][0][b] = xpmGetC(data); /* * read color keys and values */ curkey = 0; lastwaskey = 0; while ((l = xpmNextWord(data, buf))) { if (!lastwaskey) { for (key = 1; key < NKEYS + 1; key++) if ((strlen(xpmColorKeys[key - 1]) == l) && (!strncmp(xpmColorKeys[key - 1], buf, l))) break; } if (!lastwaskey && key <= NKEYS) { /* open new key */ if (curkey) { /* flush string */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } curkey = key; /* set new key */ curbuf[0] = '\0'; /* reset curbuf */ lastwaskey = 1; } else { if (!curkey) RETURN(XpmFileInvalid); /* key without value */ if (!lastwaskey) strcat(curbuf, " ");/* append space */ buf[l] = '\0'; strcat(curbuf, buf); /* append buf */ lastwaskey = 0; } } if (!curkey) RETURN(XpmFileInvalid); /* key without value */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } /* * store the colors comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &colors_cmt); /* * read pixels and index them on color number */ pixelindex = (unsigned int *) malloc(sizeof(unsigned int) * width * height); if (!pixelindex) RETURN(XpmNoMemory); iptr = pixelindex; chars = (char *) malloc(cpp); if (!chars) RETURN(XpmNoMemory); for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { for (a = 0; a < cpp; a++) chars[a] = xpmGetC(data); for (a = 0; a < ncolors; a++) if (!strncmp(colorTable[a][0], chars, cpp)) break; if (a == ncolors) RETURN(XpmFileInvalid); /* no color matches */ *iptr = a; } } /* * store the pixels comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &pixels_cmt); free(chars); /* * store found informations in the xpmInternAttrib structure */ attrib_return->width = width; attrib_return->height = height; attrib_return->cpp = cpp; attrib_return->ncolors = ncolors; attrib_return->colorTable = colorTable; attrib_return->pixelindex = pixelindex; if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->hints_cmt = hints_cmt; attributes->colors_cmt = colors_cmt; attributes->pixels_cmt = pixels_cmt; } if (hotspot) { attributes->x_hotspot = x_hotspot; attributes->y_hotspot = y_hotspot; attributes->valuemask |= XpmHotspot; } } return (XpmSuccess); } /* * set the color pixel related to the given colorname, * return 0 if success, 1 otherwise. */ static int SetColor ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index)) ARG(Display *, display) ARG(Colormap, colormap) ARG(char *, colorname) ARG(unsigned int, color_index) ARG(Pixel *, image_pixel) ARG(Pixel *, mask_pixel) GRA(unsigned int *, mask_pixel_index) { XColor xcolor; if (STRCASECMP(colorname, TRANSPARENT_COLOR)) { if (!XParseColor(display, colormap, colorname, &xcolor) || (!XAllocColor(display, colormap, &xcolor))) return (1); *image_pixel = xcolor.pixel; *mask_pixel = 1; } else { *image_pixel = 0; *mask_pixel = 0; *mask_pixel_index = color_index;/* store the color table index */ } return (0); } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (image) XDestroyImage(image); \ if (shapeimage) XDestroyImage(shapeimage); \ if (image_pixels) free((char *)image_pixels); \ if (mask_pixels) free((char *)mask_pixels); \ return(status); } static int xpmCreateImage ARGLIST((display, attrib, image_return, shapeimage_return, attributes)) ARG(Display *, display) ARG(xpmInternAttrib *, attrib) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { /* variables stored in the XpmAttributes structure */ Visual *visual; Colormap colormap; unsigned int depth; XpmColorSymbol *colorsymbols = NULL; unsigned int numsymbols; /* variables to return */ XImage *image = NULL; XImage *shapeimage = NULL; unsigned int mask_pixel; unsigned int ErrorStatus, ErrorStatus2; /* calculation variables */ Pixel *image_pixels = NULL; Pixel *mask_pixels = NULL; char *colorname; unsigned int a, b, l; Boolean pixel_defined; unsigned int key; /* * retrieve information from the XpmAttributes */ if (attributes && attributes->valuemask & XpmColorSymbols) { colorsymbols = attributes->colorsymbols; numsymbols = attributes->numsymbols; } else numsymbols = 0; if (attributes && attributes->valuemask & XpmVisual) visual = attributes->visual; else visual = DefaultVisual(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmColormap) colormap = attributes->colormap; else colormap = DefaultColormap(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmDepth) depth = attributes->depth; else depth = DefaultDepth(display, DefaultScreen(display)); ErrorStatus = XpmSuccess; /* * alloc pixels index tables */ key = xpmVisualType(visual); image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!image_pixels) RETURN(XpmNoMemory); mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!mask_pixels) RETURN(XpmNoMemory); mask_pixel = UNDEF_PIXEL; /* * get pixel colors, store them in index tables */ for (a = 0; a < attrib->ncolors; a++) { colorname = NULL; pixel_defined = False; /* * look for a defined symbol */ if (numsymbols && attrib->colorTable[a][1]) { for (l = 0; l < numsymbols; l++) if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1])) break; if (l != numsymbols) { if (colorsymbols[l].value) colorname = colorsymbols[l].value; else pixel_defined = True; } } if (!pixel_defined) { /* pixel not given as symbol value */ if (colorname) { /* colorname given as symbol value */ if (!SetColor(display, colormap, colorname, a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) pixel_defined = True; else ErrorStatus = XpmColorError; } b = key; while (!pixel_defined && b > 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b--; } b = key + 1; while (!pixel_defined && b < NKEYS + 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b++; } if (!pixel_defined) RETURN(XpmColorFailed); } else { image_pixels[a] = colorsymbols[l].pixel; mask_pixels[a] = 1; } } /* * create the image */ if (image_return) { ErrorStatus2 = CreateXImage(display, visual, depth, attrib->width, attrib->height, &image); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); /* * set the image data * * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use * optimized functions, otherwise use slower but sure general one. * */ if (image->depth == 1) SetImagePixels1(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 8) SetImagePixels8(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 16) SetImagePixels16(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 32) SetImagePixels32(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else SetImagePixels(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); } /* * create the shape mask image */ if (mask_pixel != UNDEF_PIXEL && shapeimage_return) { ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width, attrib->height, &shapeimage); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); SetImagePixels1(shapeimage, attrib->width, attrib->height, attrib->pixelindex, mask_pixels); } free((char *)mask_pixels); /* * if requested store allocated pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnInfos || attributes->valuemask & XpmReturnPixels)) { if (mask_pixel != UNDEF_PIXEL) { Pixel *pixels, *p1, *p2; attributes->npixels = attrib->ncolors - 1; pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels); if (pixels) { p1 = image_pixels; p2 = pixels; for (a = 0; a < attrib->ncolors; a++, p1++) if (a != mask_pixel) *p2++ = *p1; attributes->pixels = pixels; } else { /* if error just say we can't return requested data */ attributes->valuemask &= ~XpmReturnPixels; attributes->valuemask &= ~XpmReturnInfos; attributes->pixels = NULL; attributes->npixels = 0; } free((char *)image_pixels); } else { attributes->pixels = image_pixels; attributes->npixels = attrib->ncolors; } attributes->mask_pixel = mask_pixel; } else free((char *)image_pixels); /* * return created images */ if (image_return) *image_return = image; if (shapeimage_return) *shapeimage_return = shapeimage; return (ErrorStatus); } /* * Create an XImage */ static int CreateXImage ARGLIST((display, visual, depth, width, height, image_return)) ARG(Display *, display) ARG(Visual *, visual) ARG(unsigned int, depth) ARG(unsigned int, width) ARG(unsigned int, height) GRA(XImage **, image_return) { int bitmap_pad; /* first get bitmap_pad */ if (depth > 16) bitmap_pad = 32; else if (depth > 8) bitmap_pad = 16; else bitmap_pad = 8; /* then create the XImage with data = NULL and bytes_per_line = 0 */ *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0, width, height, bitmap_pad, 0); if (!*image_return) return (XpmNoMemory); /* now that bytes_per_line must have been set properly alloc data */ (*image_return)->data = (char *) malloc((*image_return)->bytes_per_line * height); if (!(*image_return)->data) { XDestroyImage(*image_return); *image_return = NULL; return (XpmNoMemory); } return (XpmSuccess); } /* * The functions below are written from X11R5 MIT's code (XImUtil.c) * * The idea is to have faster functions than the standard XPutPixel function * to build the image data. Indeed we can speed up things by supressing tests * performed for each pixel. We do exactly the same tests but at the image * level. Assuming that we use only ZPixmap images. */ LFUNC(_putbits, void, (register char *src, int dstoffset, register int numbits, register char *dst)); LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb)); static unsigned char Const _reverse_byte[0x100] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static void _XReverse_Bytes ARGLIST((bpt, nb)) ARG(register unsigned char *, bpt) GRA(register int, nb) { do { *bpt = _reverse_byte[*bpt]; bpt++; } while (--nb > 0); } static void xpm_xynormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; if (img->byte_order != img->bitmap_bit_order) { switch (img->bitmap_unit) { case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } if (img->bitmap_bit_order == MSBFirst) _XReverse_Bytes(bp, img->bitmap_unit >> 3); } static void xpm_znormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; switch (img->bits_per_pixel) { case 4: *bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF); break; case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 24: c = *(bp + 2); *(bp + 2) = *bp; *bp = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } static unsigned char Const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; static unsigned char Const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static void _putbits ARGLIST((src, dstoffset, numbits, dst)) ARG(register char *, src) /* address of source bit string */ ARG(int, dstoffset) /* bit offset into destination; * range is 0-31 */ ARG(register int, numbits) /* number of bits to copy to * destination */ GRA(register char *, dst) /* address of destination bit string */ { register unsigned char chlo, chhi; int hibits; dst = dst + (dstoffset >> 3); dstoffset = dstoffset & 7; hibits = 8 - dstoffset; chlo = *dst & _lomask[dstoffset]; for (;;) { chhi = (*src << dstoffset) & _himask[dstoffset]; if (numbits <= hibits) { chhi = chhi & _lomask[dstoffset + numbits]; *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi; break; } *dst = chhi | chlo; dst++; numbits = numbits - hibits; chlo = (unsigned char) (*src & _himask[hibits]) >> hibits; src++; if (numbits <= dstoffset) { chlo = chlo & _lomask[numbits]; *dst = (*dst & _himask[numbits]) | chlo; break; } numbits = numbits - dstoffset; } } /* * Default method to write pixels into a Z image data structure. * The algorithm used is: * * copy the destination bitmap_unit or Zpixel to temp * normalize temp if needed * copy the pixel bits into the temp * renormalize temp if needed * copy the temp back into the destination image data */ static void SetImagePixels ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { Pixel pixel; unsigned long px; register char *src; register char *dst; int nbytes; register unsigned int *iptr; register int x, y, i; iptr = pixelindex; if (image->depth == 1) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[XYINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = image->bitmap_unit >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; XYNORMALIZE(&px, image); i = ((x + image->xoffset) % image->bitmap_unit); _putbits((char *) &pixel, i, 1, (char *) &px); XYNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[XYINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } else { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; if (image->depth == 4) pixel &= 0xf; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[ZINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = (image->bits_per_pixel + 7) >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; ZNORMALIZE(&px, image); _putbits((char *) &pixel, (x * image->bits_per_pixel) & 7, image->bits_per_pixel, (char *) &px); ZNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[ZINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } } /* * write pixels into a 32-bits Z image data structure */ #ifndef WORD64 static unsigned long byteorderpixel = MSBFirst << 24; #endif static void SetImagePixels32 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *paddr; register unsigned int *iptr; register int x, y; iptr = pixelindex; #ifndef WORD64 if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { paddr = (unsigned int *)(&(image->data[ZINDEX32(x, y, image)])); *paddr = (unsigned int)pixels[*iptr]; } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 24); addr[1] = (unsigned char)(pixels[*iptr] >> 16); addr[2] = (unsigned char)(pixels[*iptr] >> 8); addr[3] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[3] = (unsigned char)(pixels[*iptr] >> 24); addr[2] = (unsigned char)(pixels[*iptr] >> 16); addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 16-bits Z image data structure */ static void SetImagePixels16 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *iptr; register int x, y; iptr = pixelindex; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 8); addr[1] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 8-bits Z image data structure */ static void SetImagePixels8 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned int *iptr; register int x, y; iptr = pixelindex; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) image->data[ZINDEX8(x, y, image)] = (char)pixels[*iptr]; } /* * write pixels into a 1-bit depth image data structure and **offset null** */ static void SetImagePixels1 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { unsigned char bit; int xoff, yoff; register unsigned int *iptr; register int x, y; if (image->byte_order != image->bitmap_bit_order) SetImagePixels(image, width, height, pixelindex, pixels); else { iptr = pixelindex; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 0x80 >> xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 1 << xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } } } /* * Store into the XpmAttributes structure the required informations stored in * the xpmInternAttrib structure. */ static void xpmSetAttributes ARGLIST((attrib, attributes)) ARG(xpmInternAttrib *, attrib) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->cpp = attrib->cpp; attributes->ncolors = attrib->ncolors; attributes->colorTable = attrib->colorTable; attrib->ncolors = 0; attrib->colorTable = NULL; } attributes->width = attrib->width; attributes->height = attrib->height; attributes->valuemask |= XpmSize; } } /* * Free the XpmAttributes structure members * but the structure itself */ static void XpmFreeAttributes ARGLIST((attributes)) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnPixels && attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } if (attributes->valuemask & XpmInfos) { if (attributes->colorTable) { xpmFreeColorTable(attributes->colorTable, attributes->ncolors); attributes->colorTable = NULL; attributes->ncolors = 0; } if (attributes->hints_cmt) { free(attributes->hints_cmt); attributes->hints_cmt = NULL; } if (attributes->colors_cmt) { free(attributes->colors_cmt); attributes->colors_cmt = NULL; } if (attributes->pixels_cmt) { free(attributes->pixels_cmt); attributes->pixels_cmt = NULL; } if (attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; } } attributes->valuemask = 0; } } /* * Free the xpmInternAttrib pointers which have been allocated */ static void xpmFreeInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *, attrib) { unsigned int a; if (attrib->colorTable) xpmFreeColorTable(attrib->colorTable, attrib->ncolors); if (attrib->pixelindex) free((char *)attrib->pixelindex); if (attrib->xcolors) free((char *)attrib->xcolors); if (attrib->colorStrings) { for (a = 0; a < attrib->ncolors; a++) if (attrib->colorStrings[a]) free((char *)attrib->colorStrings[a]); free((char *)attrib->colorStrings); } } /* * close the file related to the xpmData if any */ static void XpmDataClose ARGLIST((mdata)) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: break; case XPMFILE: if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin)) fclose(mdata->stream.file); break; #ifdef ZPIPE case XPMPIPE: pclose(mdata->stream.file); #endif } } /* * skip whitespace and compute the following unsigned int, * returns 1 if one is found and 0 if not */ static int xpmNextUI ARGLIST((mdata, ui_return)) ARG(xpmData *, mdata) GRA(unsigned int *, ui_return) { char buf[BUFSIZ]; int l; l = xpmNextWord(mdata, buf); return atoui(buf, l, ui_return); } /* * get the current comment line */ static void xpmGetCmt ARGLIST((mdata, cmt)) ARG(xpmData *, mdata) GRA(char **, cmt) { switch (mdata->type) { case XPMARRAY: *cmt = NULL; break; case XPMFILE: case XPMPIPE: if (mdata->CommentLength) { *cmt = (char *) malloc(mdata->CommentLength + 1); strncpy(*cmt, mdata->Comment, mdata->CommentLength); (*cmt)[mdata->CommentLength] = '\0'; mdata->CommentLength = 0; } else *cmt = NULL; break; } } /* * skip to the end of the current string and the beginning of the next one */ static void xpmNextString ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; switch (mdata->type) { case XPMARRAY: mdata->cptr = (mdata->stream.data)[++mdata->line]; break; case XPMFILE: case XPMPIPE: if (mdata->Eos) while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF); if (mdata->Bos) /* if not natural XPM2 */ while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF); break; } } /* * return the current character, skipping comments */ static int xpmGetC ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; register unsigned int n = 0, a; unsigned int notend; switch (mdata->type) { case XPMARRAY: return (*mdata->cptr++); case XPMFILE: case XPMPIPE: c = getc(mdata->stream.file); if (mdata->Bos && mdata->Eos && (c == mdata->Bos || c == mdata->Eos)) { /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (c); } if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) { mdata->Comment[0] = c; /* * skip the string begining comment */ do { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0' && c != EOF); if (mdata->Bcmt[n] != '\0') { /* this wasn't the begining of a comment */ /* put characters back in the order that we got them */ for (a = n; a > 0; a--) xpmUngetC(mdata->Comment[a], mdata); return (mdata->Comment[0]); } /* * store comment */ mdata->Comment[0] = mdata->Comment[n]; notend = 1; n = 0; while (notend) { while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } mdata->CommentLength = n; a = 0; do { c = getc(mdata->stream.file); n++; a++; mdata->Comment[n] = c; } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0' && c != EOF); if (mdata->Ecmt[a] == '\0') { /* this is the end of the comment */ notend = 0; xpmUngetC(mdata->Comment[n], mdata); } } c = xpmGetC(mdata); } return (c); } return 0; } /* * push the given character back */ static int xpmUngetC ARGLIST((c, mdata)) ARG(int, c) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: return (*--mdata->cptr = c); case XPMFILE: case XPMPIPE: if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos)) /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (ungetc(c, mdata->stream.file)); } return 0; } /* * skip whitespace and return the following word */ static unsigned int xpmNextWord ARGLIST((mdata, buf)) ARG(xpmData *, mdata) GRA(char *, buf) { register unsigned int n = 0; int c; switch (mdata->type) { case XPMARRAY: while (isspace(c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; do { c = *mdata->cptr++; buf[n++] = c; } while (!isspace(c) && c != mdata->Eos && c != '\0'); n--; mdata->cptr--; break; case XPMFILE: case XPMPIPE: while (isspace(c = xpmGetC(mdata)) && c != mdata->Eos); while (!isspace(c) && c != mdata->Eos && c != EOF) { buf[n++] = c; c = xpmGetC(mdata); } xpmUngetC(c, mdata); break; } return (n); } static int xpmVisualType ARGLIST((visual)) GRA(Visual *, visual) { #if defined(__cplusplus) || defined(c_plusplus) switch ( visual->c_class ) #else switch ( visual->class ) #endif { case StaticGray: case GrayScale: switch (visual->map_entries) { case 2: return (MONO); case 4: return (GRAY4); default: return (GRAY); } default: return (COLOR); } } /* * Free the computed color table */ static void xpmFreeColorTable ARGLIST((colorTable, ncolors)) ARG(char ***, colorTable) GRA(int, ncolors) { int a, b; if (colorTable) { for (a = 0; a < ncolors; a++) if (colorTable[a]) { for (b = 0; b < (NKEYS + 1); b++) if (colorTable[a][b]) free(colorTable[a][b]); free((char *)colorTable[a]); } free((char *)colorTable); } } #endif motif-2.3.8/demos/programs/ColorSel/Makefile.am0000644000175000017500000000053613145162623016311 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Color datadir = ${prefix}/share/Xm/Color bin_PROGRAMS = colordemo colordemo_SOURCES = util-c.c colordemo.c EXTRA_DIST = data_DATA = $(colordemo_SOURCES) $(EXTRA_DIST) LDADD = $(TOPDIR)/lib/Xm/libXm.la TOPDIR = ../../.. INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/tooltips/0000755000175000017500000000000013211513007014452 500000000000000motif-2.3.8/demos/programs/tooltips/Makefile.in0000644000175000017500000005477613211512766016475 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = tooltips$(EXEEXT) subdir = demos/programs/tooltips ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_tooltips_OBJECTS = tooltips.$(OBJEXT) tooltips_OBJECTS = $(am_tooltips_OBJECTS) tooltips_LDADD = $(LDADD) tooltips_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(tooltips_SOURCES) DIST_SOURCES = $(tooltips_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/tooltips build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/tooltips datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = tooltips_SOURCES = tooltips.c data_DATA = $(tooltips_SOURCES) $(EXTRA_DIST) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/tooltips/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/tooltips/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list tooltips$(EXEEXT): $(tooltips_OBJECTS) $(tooltips_DEPENDENCIES) $(EXTRA_tooltips_DEPENDENCIES) @rm -f tooltips$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tooltips_OBJECTS) $(tooltips_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tooltips.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/tooltips/tooltips.c0000644000175000017500000002174212672140200016422 00000000000000#include #include /* * Fallbacks: font, label and position go together in this demo */ static String fallbacks[] = { "?.toolTipEnable: True", "?.toolTipPostDelay: 2000", "?.toolTipPostDuration: 500", "?.TipShell.TipLabel.background: blue", "*ToolTipControl.messageString: ToolTip Control Panel", "*ToolTipControl.messageAlignment: XmALIGNMENT_CENTER", "*ToolTipSlider.slideInterval: 5", "*toolTipEnable.indicatorOn: False", "*toolTipEnable.shadowThickness: 2", "*toolTipEnable.fillOnSelect: True", "*toolTipEnable.rightAttachment: XmATTACH_FORM", "*toolTipEnable.labelString: Enable Tips", "*toolTipString: No tip defined", "*toolTipEnable.toolTipString: toggle usage of tool-tips", "*toolTipPostDelayLabel.labelString: Posting Delay", "*toolTipPostDelay.toolTipString: tip posting delay\\nin mS", "*toolTipPostDelay.columns: 8", "*toolTipPostDurationLabel.labelString: Duration", "*toolTipPostDuration.toolTipString: tip duration\\nin mS", "*toolTipPostDuration.columns: 8", "*Exit.toolTipString: no tip necessary", NULL }; typedef struct { Pixel modified_color; } AppResources_t, *AppResourcesPtr; AppResources_t AppResources; static XtResource resources[] = { {"modifiedColor", "ModifiedColor", XtRPixel, sizeof(Pixel), XtOffset(AppResourcesPtr, modified_color), XtRString, "red"}, }; static void ToggleEnable(Widget w, XtPointer client_data, XtPointer call_data) { Widget shell = (Widget)client_data; XmToggleButtonCallbackStruct *cbs = (XmToggleButtonCallbackStruct *)call_data; XtVaSetValues(shell, XmNtoolTipEnable, cbs->set, NULL); } static void ValueChanged(Widget w, XtPointer client_data, XtPointer call_data) { Widget shell = (Widget)client_data; String valueString; int value; XmTextPosition position; valueString = XmTextFieldGetString(w); value = atoi(valueString); value = value < 0 ? 0 : value; value = value > 60000 ? 60000 : value; valueString = XtRealloc(valueString, 255); sprintf(valueString, "%i", value); position = XmTextFieldGetInsertionPosition(w); XtRemoveCallback(w, XmNvalueChangedCallback, (XtCallbackProc)ValueChanged, shell); XmTextFieldSetString(w, valueString); XtAddCallback(w, XmNvalueChangedCallback, (XtCallbackProc)ValueChanged, shell); XmTextFieldSetInsertionPosition(w, position); XtFree(valueString); } static void Activate(Widget w, XtPointer client_data, XtPointer call_data) { Widget shell = (Widget)client_data; String valueString; String callback; int value; Pixel background; valueString = XmTextFieldGetString(w); XtVaGetValues(w, XmNuserData, &callback, NULL); value = atoi(valueString); XtVaSetValues(shell, callback, value, NULL); XtFree(valueString); XtVaGetValues(XtParent(w), XmNbackground, &background, NULL); XtVaSetValues(w, XmNbackground, background, NULL); } static void ModifyVerify(Widget w, XtPointer client_data, XtPointer call_data) { Widget shell = (Widget)client_data; XmTextVerifyCallbackStruct *cbs = (XmTextVerifyCallbackStruct *)call_data; int i; for (i = 0; i < cbs->text->length; i++) { if (cbs->text->ptr[i] < '0' || cbs->text->ptr[i] > '9') { cbs->doit = False; break; } } if (cbs->doit) { XtVaSetValues(w, XmNbackground, AppResources.modified_color, NULL); } } static void ToolTipPopup(Widget w, XtPointer client_data, XtPointer call_data) { if ((int)client_data == 0) { printf("popping up\n"); } else { printf("popping down\n"); } } static void cancelCallback(Widget w, XtPointer client_data, XtPointer call_data) { Widget child = XmMessageBoxGetChild(w, XmDIALOG_CANCEL_BUTTON); XtSetSensitive(child, !XtIsSensitive(child)); } int main(int argc, char *argv[]) { XtAppContext app_context; Widget top_level, helloworld_main, toolTipEnable; Widget toolTipPostDelay; Widget toolTipPostDuration; Widget exitButton; Widget MessageBox; Widget ToolTipLabel; /* * Initialize Xt and create a resizable shell */ top_level = XtVaAppInitialize(&app_context, "test1", NULL, 0, &argc, argv, fallbacks, NULL); XtGetApplicationResources(top_level, &AppResources, resources, XtNumber(resources), NULL, 0); /* * Create the widget tree: first the bb parent. */ MessageBox = XmCreateMessageBox(top_level, "ToolTipControl", NULL, 0); helloworld_main = XmCreateForm (MessageBox, "helloworld_main", NULL, 0); toolTipEnable = XmCreateToggleButton(helloworld_main, "toolTipEnable", NULL, 0); { Boolean enable; XtVaGetValues(top_level, XmNtoolTipEnable, &enable, NULL); XmToggleButtonSetState(toolTipEnable, enable, False); } XtVaSetValues(toolTipEnable, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, NULL); XtAddCallback(toolTipEnable, XmNvalueChangedCallback, (XtCallbackProc)ToggleEnable, top_level); XtManageChild(toolTipEnable); { Widget label, text; int delay; char buf[255]; toolTipPostDelay = XmCreateForm(helloworld_main, "toolTipPostDelayForm", NULL, 0); XtVaSetValues(toolTipPostDelay, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, toolTipEnable, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); label = XmCreateLabel(toolTipPostDelay, "toolTipPostDelayLabel", NULL, 0); text = XmCreateTextField(toolTipPostDelay, "toolTipPostDelay", NULL, 0); XtVaGetValues(top_level, XmNtoolTipPostDelay, &delay, NULL); sprintf(buf, "%i", delay); XmTextFieldSetString(text, buf); XtAddCallback(text, XmNmodifyVerifyCallback, (XtCallbackProc)ModifyVerify, top_level); XtAddCallback(text, XmNvalueChangedCallback, (XtCallbackProc)ValueChanged, top_level); XtAddCallback(text, XmNactivateCallback, (XtCallbackProc)Activate, top_level); XtVaSetValues(text, XmNuserData, XmNtoolTipPostDelay, XmNtopAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); XtVaSetValues(label, XmNalignment, XmALIGNMENT_BEGINNING, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNrightAttachment, XmATTACH_WIDGET, XmNtopWidget, text, XmNbottomWidget, text, XmNrightWidget, text, XmNleftAttachment, XmATTACH_FORM, NULL); XtManageChild(label); XtManageChild(text); XtManageChild(toolTipPostDelay); } { Widget label, text; int delay; char buf[255]; toolTipPostDuration = XmCreateForm(helloworld_main, "toolTipPostDurationForm", NULL, 0); XtVaSetValues(toolTipPostDuration, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, toolTipPostDelay, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); label = XmCreateLabel(toolTipPostDuration, "toolTipPostDurationLabel", NULL, 0); text = XmCreateTextField(toolTipPostDuration, "toolTipPostDuration", NULL, 0); XtVaGetValues(top_level, XmNtoolTipPostDuration, &delay, NULL); sprintf(buf, "%i", delay); XmTextFieldSetString(text, buf); XtAddCallback(text, XmNmodifyVerifyCallback, (XtCallbackProc)ModifyVerify, top_level); XtAddCallback(text, XmNvalueChangedCallback, (XtCallbackProc)ValueChanged, top_level); XtAddCallback(text, XmNactivateCallback, (XtCallbackProc)Activate, top_level); XtVaSetValues(text, XmNuserData, XmNtoolTipPostDuration, XmNtopAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); XtVaSetValues(label, XmNalignment, XmALIGNMENT_BEGINNING, XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET, XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET, XmNrightAttachment, XmATTACH_WIDGET, XmNtopWidget, text, XmNbottomWidget, text, XmNrightWidget, text, XmNleftAttachment, XmATTACH_FORM, NULL); XtManageChild(label); XtManageChild(text); XtManageChild(toolTipPostDuration); } exitButton = XmVaCreatePushButtonGadget(helloworld_main, "Exit", XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, toolTipPostDuration, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); XtAddCallback(exitButton, XmNactivateCallback, (XtCallbackProc)exit, NULL); XtManageChild(exitButton); XtManageChild(helloworld_main); XtManageChild(MessageBox); XtAddCallback(MessageBox, XmNcancelCallback, (XtCallbackProc)cancelCallback, NULL); XtAddCallback(MessageBox, XmNokCallback, (XtCallbackProc)cancelCallback, NULL); ToolTipLabel = XmToolTipGetLabel(top_level); XtAddCallback(XtParent(ToolTipLabel), XmNpopupCallback, (XtCallbackProc)ToolTipPopup, (XtPointer)0); XtAddCallback(XtParent(ToolTipLabel), XmNpopdownCallback, (XtCallbackProc)ToolTipPopup, (XtPointer)1); /* * Realize the toplevel widget. This will cause the entire "managed" * widget hierarchy to be displayed */ XtRealizeWidget(top_level); /* * Loop and process events */ XtAppMainLoop(app_context); /* UNREACHABLE */ return (0); } motif-2.3.8/demos/programs/tooltips/Makefile.am0000644000175000017500000000051213145162623016436 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/tooltips datadir = ${prefix}/share/Xm/tooltips EXTRA_DIST = bin_PROGRAMS = tooltips tooltips_SOURCES = tooltips.c data_DATA = $(tooltips_SOURCES) $(EXTRA_DIST) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/panner/0000755000175000017500000000000013211513007014060 500000000000000motif-2.3.8/demos/programs/panner/panner.c0000644000175000017500000011247512672140200015442 00000000000000/* $TOG: panner.c /main/6 1997/03/31 13:38:32 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INIT_SCREEN_WIDTH 50 #define MAX_DISPLAY_COUNT 10 #define LOCAL 0 #define PAN_FORMAT 8 #define PAN_SIZE 9 #define WM_SELECTION_FORMAT "WM_S%1d" #define COLOR_COUNT 20 String fallback[] = { "Panner.mappedWhenManaged: FALSE", "Panner.width: 325", "Panner.height: 290", "Panner*frame.marginWidth: 7", "Panner*frame.marginHeight: 7", "Panner*notebook.firstPageNumber: 0", "Panner*tab.shadowThickness: 1", "Panner*canvas.background: grey40", "Panner*canvas.foreground: yellow", /* Menu entry definitions */ "Panner*cascade1.labelString: File", "Panner*cascade2.labelString: Display", "Panner*cascade3.labelString: Help", "Panner*b1.labelString: Quit", "Panner*b2.labelString: Update", "Panner*b3.labelString: New Display...", "Panner*promptDlog*selectionLabelString: Display name:", "Panner*messageDlog*messageString:\ Panner Demo\\n-----------\\nGrab and move dashed box to pan display.\\n\ Use 'New Display...' command to add another display.\\n\ Select displays from tabs in the notebook.", "Panner*warningDlog*messageString:\ The panner window is not pinned!\\n\ Add the line:\\n\\n \"Mwm*Panner*ClientPinned: True\"\\n\\n\ to your .Xdefaults file and restart Mwm.", NULL }; typedef struct _PannerInfoRec { Display *display; Screen *screen; Widget shell; Widget utmShell; /* drawing area used for UTM */ Widget canvas; int thumbX, thumbY; unsigned int thumbW, thumbH; int lastEventX, lastEventY; Atom WM; /* need selections on the correct display */ Atom WM_PAN; Atom WM_GOTO; Atom WM_PAN_POS; } PannerInfoRec; typedef struct _PanPostion { long x; long y; } PanPosition; typedef enum { MENU_QUIT, MENU_UPDATE, MENU_NEW, MENU_HELP } MenuFunction; typedef enum { UNKNOWN, VERIFYING, VERIFIED } PinState; /* * globals. */ XtAppContext app; unsigned short DSP; /* index of active display */ Widget notebook; GC thumbGC, canvasGC; XContext context; PannerInfoRec *pInfoList; unsigned long cells[COLOR_COUNT]; PinState pinnedState = UNKNOWN; int origX, origY; #ifdef X_ONLY Boolean LOCK = False; #endif static void OpenNewDisplay(String, Widget, PannerInfoRec *); static void UpdatePannerCB (Widget, XtPointer, XtPointer); static void ChangePageCB (Widget, XtPointer, XtPointer); static void DoAddDisplayCB (Widget, XtPointer, XtPointer); static void DestinationCB (Widget, XtPointer, XtPointer); static void DoneMoveScreenCB (Widget, XtPointer, XtPointer); static void WatchForWindowPanning (Display *dsp); static void HandlePropertyChange (XEvent *event); static void UpdatePannerView (PannerInfoRec *pInfoList, int remoteDsp); static void DrawWindows (PannerInfoRec *); static void DrawThumb (PannerInfoRec *); static void SetupColorsAndGCs(); static GC GetXorGC (Widget); static GC GetCanvasGC (Widget); static void SetWindowColor (PannerInfoRec *, int); static void TranslateCoordinates (PannerInfoRec *, int, int, unsigned int, unsigned int, int*,int*,unsigned int*,unsigned int*); static int IgnoreError (Display *dsp, XErrorEvent *event); static void StartTracking (Widget, XtPointer, XEvent *, Boolean *); static void DoTracking (Widget, XtPointer, XEvent *, Boolean *); static void StopTracking (Widget, XtPointer, XEvent *, Boolean *); static void MoveScreen (PannerInfoRec *, int, int, Time); static XtPointer PackCARD32 (XtPointer, CARD32); static XtPointer PackCARD16 (XtPointer, CARD16); static XtPointer PackCARD8 (XtPointer, CARD8); static void CreateMenuBar (Widget parent); static void MenuCB (Widget w, XtPointer clientData, XtPointer callData); static void DoUpdatePanner (); static void DoAddDisplay (); static void DoHelp (); static void DoQuit (); static void CheckPinnedState (); static void ShowPinStateWarning (); static void HandleInitialExpose (Widget, XtPointer, XEvent *, Boolean *); /*----------------------------------------------------------------* | main | *----------------------------------------------------------------*/ int main (int argc, char** argv) { Widget mainWin, frame; XEvent event; pInfoList = (PannerInfoRec *) XtMalloc(sizeof(PannerInfoRec) * MAX_DISPLAY_COUNT); for (DSP = 0; DSP < MAX_DISPLAY_COUNT; DSP++) pInfoList[DSP].display = NULL; DSP = LOCAL; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); pInfoList[LOCAL].shell = XtVaOpenApplication(&app, "Panner", NULL, 0, &argc, argv, fallback, sessionShellWidgetClass, NULL); pInfoList[LOCAL].display = XtDisplay(pInfoList[LOCAL].shell); mainWin = XmCreateMainWindow(pInfoList[LOCAL].shell, "mainWin", NULL, 0); XtManageChild(mainWin); CreateMenuBar(mainWin); frame = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, mainWin, NULL); notebook = XtVaCreateManagedWidget("notebook", xmNotebookWidgetClass, frame, NULL); XtRealizeWidget(pInfoList[LOCAL].shell); context = XUniqueContext (); OpenNewDisplay(/*$DISPLAY*/NULL, notebook, pInfoList); SetupColorsAndGCs(); XtAddCallback(notebook, XmNpageChangedCallback, ChangePageCB, pInfoList); XtAddEventHandler(notebook, ExposureMask, False, HandleInitialExpose, NULL); XtMapWidget(pInfoList[LOCAL].shell); for (;;) { XtAppNextEvent(app, &event); if (event.type == PropertyNotify) HandlePropertyChange(&event); XtDispatchEvent(&event); } } /*----------------------------------------------------------------* | OpenNewDisplay | | - Get new display connection to named display. | | - If display name is not NULL, create shell on the display. | | - Fill in correct record in pInfoList. | *----------------------------------------------------------------*/ static void OpenNewDisplay( String displayName, Widget notebook, PannerInfoRec *pInfoList) { int newDsp = 0; int argc = 0; char **argv = NULL; Dimension canvasW, canvasH; char selectionName[40]; PannerInfoRec *pInfo; Widget tab; XmString tabName; XtCallbackList cbList; /* * If NULL, then the display's already been created. */ if (displayName != NULL) { XtVaGetValues(notebook, XmNlastPageNumber, &newDsp, XmNpageChangedCallback, &cbList, NULL); newDsp++; if ((pInfoList[newDsp].display = XOpenDisplay(displayName)) == NULL) { fprintf(stderr, "ERROR - Can't open display \"%s\".\n", displayName); return; } XtDisplayInitialize(app, pInfoList[newDsp].display, "panner", "Panner", NULL, 0, &argc, argv); /* create an unmapped shell on the remote display */ pInfoList[newDsp].shell = XtVaAppCreateShell( "panner", "Panner", applicationShellWidgetClass, pInfoList[newDsp].display, XmNmappedWhenManaged, False, NULL); XtRealizeWidget(pInfoList[newDsp].shell); } /* * For UTM to work, there must be a drawing area or UTM saavy * widget. * * We must set-up a destination callback function that * does the actual transfer of the parameter info to Mwm. */ pInfoList[newDsp].utmShell = XtVaCreateManagedWidget("utmShell", xmDrawingAreaWidgetClass, pInfoList[newDsp].shell, XmNmappedWhenManaged, False, NULL); XtAddCallback(pInfoList[newDsp].utmShell, XmNdestinationCallback, DestinationCB, &(pInfoList[newDsp])); /* * Initialize the correct record in the pInfoList. */ pInfoList[newDsp].screen = XtScreen(pInfoList[newDsp].shell); /* * setup handler to watch when Mwm changes the root property. * first store some data on the root window. */ XSaveContext(pInfoList[newDsp].display, DefaultRootWindow(pInfoList[newDsp].display), context, (XPointer)(long)newDsp); /* store index into panner info. */ WatchForWindowPanning(pInfoList[newDsp].display); /* * Add another page to the notebook. * First must set size correctly. */ XtVaGetValues(pInfoList[LOCAL].shell, XmNwidth, &canvasW, XmNheight, &canvasH, NULL); pInfoList[newDsp].canvas = XtVaCreateManagedWidget("canvas", xmDrawingAreaWidgetClass, notebook, XmNchildType, XmPAGE, XmNpageNumber, newDsp, XmNwidth, canvasW, XmNheight, canvasH, NULL); XtAddCallback(pInfoList[newDsp].canvas, XmNexposeCallback, UpdatePannerCB, pInfoList); if (displayName == NULL) tabName = XmStringCreate("LOCAL",XmFONTLIST_DEFAULT_TAG); else tabName = XmStringCreate(displayName,XmFONTLIST_DEFAULT_TAG); tab = XtVaCreateManagedWidget("tab", xmPushButtonWidgetClass, notebook, XmNlabelString, tabName, XmNchildType, XmMAJOR_TAB, NULL); XmStringFree(tabName); pInfoList[newDsp].thumbW = INIT_SCREEN_WIDTH; pInfoList[newDsp].thumbH = pInfoList[newDsp].thumbW * HeightOfScreen(pInfoList[newDsp].screen) / WidthOfScreen(pInfoList[newDsp].screen); XtVaGetValues(pInfoList[newDsp].canvas, XmNwidth, &canvasW, XmNheight, &canvasH, NULL); pInfoList[newDsp].thumbX = (int)canvasW/2 - (int)pInfoList[newDsp].thumbW/2; pInfoList[newDsp].thumbY = (int)canvasH/2 - (int)pInfoList[newDsp].thumbH/2; /* Setup the atoms needed to communicate with Mwm. Check screen number! */ sprintf(selectionName, WM_SELECTION_FORMAT, XScreenNumberOfScreen(pInfoList[newDsp].screen)); pInfoList[newDsp].WM = XmInternAtom(pInfoList[newDsp].display, selectionName, False); pInfoList[newDsp].WM_PAN = XmInternAtom(pInfoList[newDsp].display, "_MOTIF_WM_PAN", False); pInfoList[newDsp].WM_GOTO = XmInternAtom(pInfoList[newDsp].display, "_MOTIF_WM_GOTO", False); pInfoList[newDsp].WM_PAN_POS = XmInternAtom(pInfoList[newDsp].display, "_MOTIF_WM_PAN_POSITION", False); XtAddEventHandler(pInfoList[newDsp].canvas, ButtonPressMask, False, StartTracking, (XtPointer)&pInfoList[newDsp]); } /*========================== CALLBACKS ==========================*/ /*----------------------------------------------------------------* | UpdatePannerCB | *----------------------------------------------------------------*/ static void UpdatePannerCB ( Widget w, XtPointer clientData, XtPointer callData) { XmDrawingAreaCallbackStruct *cb = (XmDrawingAreaCallbackStruct *)callData; PannerInfoRec *pInfoList = (PannerInfoRec *)clientData; if (cb->reason == XmCR_EXPOSE) { XExposeEvent *event = (XExposeEvent *)cb->event; /* Last expose event received - do the drawing. */ if (event->count == 0) UpdatePannerView(pInfoList, DSP); } else /* * Update button pressed. */ UpdatePannerView(pInfoList, DSP); } /*----------------------------------------------------------------* | ChangePageCB | | Invoked just prior to notebook page change. Any drawing here | | would be lost. | *----------------------------------------------------------------*/ static void ChangePageCB ( Widget w, XtPointer clientData, XtPointer callData) { PannerInfoRec *pInfoList = (PannerInfoRec *)clientData; XmNotebookCallbackStruct *nbData = (XmNotebookCallbackStruct *)callData; int pageNumber; pageNumber = nbData->page_number; if ((pageNumber >= MAX_DISPLAY_COUNT) || (pInfoList[pageNumber].display == NULL)) { fprintf(stderr, "ERROR - bad display index. (%d).\n", pageNumber); } else { DSP = pageNumber; } } /*----------------------------------------------------------------* | DoAddDisplayCB | *----------------------------------------------------------------*/ static void DoAddDisplayCB ( Widget w, XtPointer clientData, XtPointer callData) { XmSelectionBoxCallbackStruct *cb = (XmSelectionBoxCallbackStruct *)callData; PannerInfoRec *pInfoList = (PannerInfoRec *)clientData; char *dspName; /* Free when done. */ String appName, appClass; /* Don't free - owned by Xt. */ XtGetApplicationNameAndClass(pInfoList[LOCAL].display, &appName, &appClass); XmStringGetLtoR(cb->value, XmSTRING_DEFAULT_CHARSET, &dspName); OpenNewDisplay(dspName, notebook, pInfoList); if (dspName) XtFree(dspName); } /*----------------------------------------------------------------* | DestinationCB | | This function gets invoked by UTM when a sink has been estab- | | lished and a request initiated against another selection. The | | purpose here is to set-up the parameters and pass them to the | | owner of the selection. The parameter data has already been | | allocated in the MoveScreen() function. | | clientData holds the pannerInfoRec corresponding to the right | | display. | *----------------------------------------------------------------*/ static void DestinationCB ( Widget w, XtPointer clientData, XtPointer callData) { XmDestinationCallbackStruct *dcs = (XmDestinationCallbackStruct *)callData; PannerInfoRec *pInfo = (PannerInfoRec *)clientData; Atom target; /* * Pass the data to free in the clientData field. * location_data points to the param data. This was set in * MoveScreen(). */ /* FIRST - setup the parameters to pass. */ XmTransferSetParameters(dcs->transfer_id, dcs->location_data, /* pointer to param data. */ PAN_FORMAT, PAN_SIZE, /* should be calculated. */ dcs->selection); /* type - don't care. */ /* LAST - Make the transfer. */ XmTransferValue(dcs->transfer_id, pInfo->WM_PAN, /* target for conversion. */ DoneMoveScreenCB, /* CB proc invoked when done. */ dcs->location_data, /* clientData - to be freed. */ dcs->time); } /*----------------------------------------------------------------* | DoneMoveScreenCB | *----------------------------------------------------------------*/ static void DoneMoveScreenCB ( Widget w, XtPointer clientData, XtPointer callData) { /* * Conversion completed. Safe to free param data. */ XtFree((char *)clientData); } /*=========================== PAN-HANDLING ==========================*/ /*----------------------------------------------------------------* | WatchForWindowPanning | *----------------------------------------------------------------*/ static void WatchForWindowPanning (Display *dsp) { XWindowAttributes attr; Window rwin = DefaultRootWindow(dsp); /* Watch whenever the window manager's panning position changes. */ /* Mwm stores the position in properties on the root window. */ /* This is stored in the _MOTIF_WM_PAN_POSITION property. */ XGetWindowAttributes(dsp, rwin, &attr); if (! (attr.your_event_mask & PropertyChangeMask)) XSelectInput(dsp, rwin, attr.your_event_mask | PropertyChangeMask); } /*----------------------------------------------------------------* | HandlePropertyChange | | This routine checks the property changed and if its the right | | property, grab the new panning position. | *----------------------------------------------------------------*/ static void HandlePropertyChange (XEvent *event) { XPropertyEvent *propEvent = (XPropertyEvent *)event; int iDsp; /* Get the correct info record stored with the context manager. */ if (XFindContext(propEvent->display, propEvent->window, context, (XPointer*)&iDsp)) return; /* check if this is the right one. Othersize, we'll update when another * display changes. */ if (propEvent && propEvent->atom != pInfoList[iDsp].WM_PAN_POS) return; /* if the display doesn't match the current one, then punt. */ if (iDsp == DSP) { if (pinnedState == VERIFIED) UpdatePannerView(pInfoList, iDsp); else { Window rWin, child; int x, y, newX, newY; unsigned int width, height, bWidth, depth; /* Get position of the top-level shell */ XGetGeometry(pInfoList[LOCAL].display, XtWindow(pInfoList[LOCAL].shell), &rWin, &x, &y, &width, &height, &bWidth, &depth); XTranslateCoordinates(pInfoList[LOCAL].display, XtWindow(pInfoList[LOCAL].shell), rWin, x, y, &newX, &newY, &child); if ((newX == origX) && (newY == origY)) pinnedState = VERIFIED; else ShowPinStateWarning(); } } #ifdef X_ONLY LOCK = False; #endif } /*============================ DRAWING ===========================*/ /*----------------------------------------------------------------* | UpdatePannerView | *----------------------------------------------------------------*/ static void UpdatePannerView ( PannerInfoRec *pInfoList, int remoteDsp) { XClearArea(pInfoList[LOCAL].display, XtWindow(pInfoList[remoteDsp].canvas), 0, 0, 0, 0, False); DrawWindows(pInfoList); DrawThumb(&pInfoList[remoteDsp]); } /*----------------------------------------------------------------* | DrawWindows | *----------------------------------------------------------------*/ static void DrawWindows (PannerInfoRec *pInfoList) { Window realRoot, root, parent, *child = NULL; int i, x, y; unsigned int childCount, width, height; int (*oldHandler)(); realRoot = RootWindow(pInfoList[DSP].display, XScreenNumberOfScreen(pInfoList[DSP].screen)); if (XQueryTree(pInfoList[DSP].display, realRoot, &root, &parent, &child, &childCount)) { /* * We need to install an error handler since the window-tree may * become invalid while where still processing the list. */ oldHandler = XSetErrorHandler(IgnoreError); for (i=0; icanvas), XtWindow(pInfo->canvas), thumbGC, pInfo->thumbX, pInfo->thumbY, pInfo->thumbW, pInfo->thumbH); } /*----------------------------------------------------------------* | SetupColorsAndGCs | | Called once at the beginning to setup some drawing stuff. | *----------------------------------------------------------------*/ static void SetupColorsAndGCs() { int i; XColor color; Colormap cmap = DefaultColormapOfScreen(pInfoList[LOCAL].screen); /* * set-up the global GCs. */ thumbGC = GetXorGC(pInfoList[LOCAL].canvas); canvasGC = GetCanvasGC(pInfoList[LOCAL].canvas); /* * Allocate the global color cells for the drawing of each windows. * The more random the colors, the better. */ if (XAllocColorCells(pInfoList[LOCAL].display, cmap, False, NULL, 0, cells, COLOR_COUNT)) for (i=0; idisplay, canvasGC, cells[(i+1)%COLOR_COUNT]); } /*----------------------------------------------------------------* | TranslateCoordinates | *----------------------------------------------------------------*/ static void TranslateCoordinates ( PannerInfoRec *pInfo, int x1, int y1, unsigned int width1, unsigned int height1, int *x2, int *y2, unsigned int *width2, unsigned int *height2) { int rootW, rootH; rootW = WidthOfScreen(pInfo->screen); rootH = HeightOfScreen(pInfo->screen); *x2 = x1 * (int)pInfo->thumbW / (int)rootW + pInfo->thumbX; *y2 = y1 * (int)pInfo->thumbH / (int)rootH + pInfo->thumbY; *width2 = width1 * pInfo->thumbW / rootW; *height2 = height1 * pInfo->thumbH / rootH; } /*----------------------------------------------------------------* | IgnoreError | *----------------------------------------------------------------*/ static int IgnoreError (Display *dsp, XErrorEvent *event) { /* * Do Nothing... * This is needed since we will may be updating the list of window * while one of them goes away. Ie: the window list received from * XQueryTree may not be valid for the entire loop where we get each * window's geometry. */ return 0; /* make compiler happy */ } /*======================= TRACKING HANDLERS ======================*/ /*----------------------------------------------------------------* | StartTracking | *----------------------------------------------------------------*/ static void StartTracking ( Widget w, XtPointer clientData, XEvent *event, Boolean *dispatch) { PannerInfoRec *pInfo = (PannerInfoRec *)clientData; XPointerMovedEvent *motionEvent = (XPointerMovedEvent *)event; if ((pinnedState == VERIFIED) && (event->xbutton.button == Button1)) { pInfo->lastEventX = event->xbutton.x; pInfo->lastEventY = event->xbutton.y; if ((event->xbutton.x < pInfo->thumbX) || (event->xbutton.y < pInfo->thumbY) || (event->xbutton.x > pInfo->thumbX + (int)pInfo->thumbW) || (event->xbutton.y > pInfo->thumbY + (int)pInfo->thumbH)) { /* * if on the canvas, then center the thumb over the pointer. */ MoveScreen(pInfo, event->xbutton.x - (int)pInfo->thumbW/2, event->xbutton.y - (int)pInfo->thumbH/2, motionEvent->time); } XtAddEventHandler(w, ButtonReleaseMask, False, StopTracking, clientData); XtAddEventHandler(w, Button1MotionMask, False, DoTracking, clientData); } else if (pinnedState != VERIFIED) CheckPinnedState (); } /*----------------------------------------------------------------* | DoTracking | *----------------------------------------------------------------*/ static void DoTracking ( Widget w, XtPointer clientData, XEvent *event, Boolean *dispatch) { PannerInfoRec *pInfo = (PannerInfoRec *)clientData; XPointerMovedEvent *motionEvent = (XPointerMovedEvent *)event; MoveScreen(pInfo, pInfo->thumbX + event->xbutton.x - pInfo->lastEventX, pInfo->thumbY + event->xbutton.y - pInfo->lastEventY, motionEvent->time); pInfo->lastEventX = event->xbutton.x; pInfo->lastEventY = event->xbutton.y; } /*----------------------------------------------------------------* | StopTracking | *----------------------------------------------------------------*/ static void StopTracking ( Widget w, XtPointer clientData, XEvent *event, Boolean *dispatch) { if (event->xbutton.button == Button1) { XtRemoveEventHandler(w, Button1MotionMask, False, DoTracking, clientData); XtRemoveEventHandler(w, ButtonReleaseMask, False, StopTracking, clientData); } } /*----------------------------------------------------------------* | MoveScreen | *----------------------------------------------------------------*/ static void MoveScreen ( PannerInfoRec *pInfo, int newX, int newY, Time time) { int dx, dy, panDx, panDy, rootW, rootH; XtPointer msg, fulldata; unsigned long size; DrawThumb(pInfo); dx = newX - pInfo->thumbX; dy = newY - pInfo->thumbY; pInfo->thumbX = newX; pInfo->thumbY = newY; DrawThumb(pInfo); /* * Send Pan message to mwm. */ rootW = WidthOfScreen(pInfo->screen); rootH = HeightOfScreen(pInfo->screen); panDx = -(dx * rootW / (int)pInfo->thumbW); panDy = -(dy * rootH / (int)pInfo->thumbH); size = sizeof(CARD32); /* panDx */ size += sizeof(CARD32); /* panDy */ size += sizeof(CARD8); /* config */ msg = fulldata = (XtPointer) XtMalloc(sizeof(CARD8) * size); msg = PackCARD32(msg, panDx); msg = PackCARD32(msg, panDy); msg = PackCARD8(msg, True); #ifdef X_ONLY { Display *display; Window window; Atom MY_PANNER_PROP; display = XtDisplay(notebook); /* notebook just happens to be a global. */ window = XtWindow(notebook); MY_PANNER_PROP = XInternAtom(display, "MY_PANNER_PROP", False); /* * Note - to really make this work across multiple displays, * the window argument must reside on the same display as WM_Si. */ /* * Use a lock to make sure the property was read by Mwm. * When the pan-property is updated, it's safe to make another * conversion. */ if (!LOCK) { LOCK = True; /* Freed in HandlePropertyChange. */ XChangeProperty(display, window, MY_PANNER_PROP, MY_PANNER_PROP, PAN_FORMAT, PropModeReplace, (unsigned char *)fulldata, size); XConvertSelection(pInfo->display, pInfo->WM, pInfo->WM_PAN, MY_PANNER_PROP, window, time); } } #else if (! XmeNamedSink(pInfo->utmShell, /* widget with destination callback */ pInfo->WM, /* named selection - ie. Window Manager */ XmCOPY, /* operation to perform on the data */ (XtPointer)fulldata, /* pointer to param data, */ time) /* free n TransferDone proc. */ ) printf("Error - UTM Transfer failed.\n"); #endif /* X_ONLY */ } /*----------------------------------------------------------------* | PACKING FUNCTIONS | *----------------------------------------------------------------*/ static XtPointer PackCARD32 (XtPointer data, CARD32 val) { CARD16 bottom = val & (0xFFFF); CARD16 top = val >> 16; data = PackCARD16(data, top); data = PackCARD16(data, bottom); return(data); } static XtPointer PackCARD16 (XtPointer data, CARD16 val) { CARD8 bottom = val & (0xFF); CARD8 top = val >> 8; data = PackCARD8(data, top); data = PackCARD8(data, bottom); return(data); } static XtPointer PackCARD8 (XtPointer data, CARD8 val) { CARD8 *ptr = (CARD8 *) data; *ptr = (CARD8) val; data = ((char*)data) + 1; return(data); } /*======================= USER INTERFACE ======================*/ /*----------------------------------------------------------------* | CreateMenuBar | *----------------------------------------------------------------*/ static void CreateMenuBar (Widget parent) { Cardinal n; Arg args[10]; Widget menuBar; Widget cascade1, cascade2, cascade3; Widget menuPane1, menuPane2; Widget b1, b2, b3; menuBar = XmCreateMenuBar(parent, "menuBar", NULL, 0); menuPane1 = XmCreatePulldownMenu(menuBar, "menuPane1", NULL, 0); menuPane2 = XmCreatePulldownMenu(menuBar, "menuPane2", NULL, 0); b1 = XtCreateManagedWidget("b1", xmPushButtonWidgetClass, menuPane1, NULL,0); XtAddCallback(b1, XmNactivateCallback, MenuCB, (XtPointer)MENU_QUIT); b2 = XtCreateManagedWidget("b2", xmPushButtonWidgetClass, menuPane2, NULL,0); XtAddCallback(b2, XmNactivateCallback, MenuCB, (XtPointer)MENU_UPDATE); b3 = XtCreateManagedWidget("b3", xmPushButtonWidgetClass, menuPane2, NULL,0); XtAddCallback(b3, XmNactivateCallback, MenuCB, (XtPointer)MENU_NEW); n = 0; XtSetArg(args[n], XmNsubMenuId, menuPane1); n++; cascade1 = XmCreateCascadeButton(menuBar, "cascade1", args, n); XtManageChild(cascade1); n = 0; XtSetArg(args[n], XmNsubMenuId, menuPane2); n++; cascade2 = XmCreateCascadeButton(menuBar, "cascade2", args, n); XtManageChild(cascade2); n = 0; cascade3 = XmCreateCascadeButton(menuBar, "cascade3", args, n); XtAddCallback(cascade3, XmNactivateCallback, MenuCB, (XtPointer)MENU_HELP); XtManageChild(cascade3); n = 0; XtSetArg(args[n], XmNmenuHelpWidget, cascade3); n++; XtSetValues(menuBar, args, n); XtManageChild(menuBar); } /*----------------------------------------------------------------* | MenuCB | *----------------------------------------------------------------*/ static void MenuCB (Widget w, XtPointer clientData, XtPointer callData) { switch ((long)clientData) { case MENU_UPDATE: DoUpdatePanner(); break; case MENU_NEW: DoAddDisplay(); break; case MENU_QUIT: DoQuit(); break; case MENU_HELP: DoHelp(); break; } } /*----------------------------------------------------------------* | DoUpdatePanner | *----------------------------------------------------------------*/ static void DoUpdatePanner () { XClearArea(pInfoList[LOCAL].display, XtWindow(pInfoList[DSP].canvas), 0, 0, 0, 0, False); DrawWindows(pInfoList); DrawThumb(&pInfoList[DSP]); } /*----------------------------------------------------------------* | DoAddDisplay | *----------------------------------------------------------------*/ static void DoAddDisplay () { static Widget dlog = NULL; Arg args[3]; int n; if (dlog == NULL) { n = 0; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; dlog = XmCreatePromptDialog(pInfoList[LOCAL].shell, "promptDlog", args, n); XtAddCallback(dlog, XmNokCallback, DoAddDisplayCB, pInfoList); XtUnmanageChild( XmSelectionBoxGetChild (dlog, XmDIALOG_HELP_BUTTON) ); } XtManageChild(dlog); } /*----------------------------------------------------------------* | DoHelp | *----------------------------------------------------------------*/ static void DoHelp () { static Widget dlog = NULL; Arg args[3]; int n; if (dlog == NULL) { dlog = XmCreateInformationDialog(pInfoList[LOCAL].shell, "messageDlog", NULL, 0); XtUnmanageChild( XmMessageBoxGetChild (dlog, XmDIALOG_HELP_BUTTON) ); XtUnmanageChild( XmMessageBoxGetChild (dlog, XmDIALOG_CANCEL_BUTTON) ); } XtManageChild(dlog); } /*----------------------------------------------------------------* | DoQuit | *----------------------------------------------------------------*/ static void DoQuit () { XSync (pInfoList[LOCAL].display, False); XCloseDisplay (pInfoList[LOCAL].display); exit(0); } /*----------------------------------------------------------------* | GetTimeStamp | *----------------------------------------------------------------*/ Time GetTimestamp (Display *dsp) { XEvent event; XWindowAttributes attr; Atom timeProp = XInternAtom(dsp, "_MOTIF_CURRENT_TIME", False); Window rwin = DefaultRootWindow(dsp); XGetWindowAttributes(dsp, rwin, &attr); if (! (attr.your_event_mask & PropertyChangeMask)) XSelectInput(dsp, rwin, attr.your_event_mask | PropertyChangeMask); XChangeProperty(dsp, rwin, timeProp, timeProp, 8, PropModeAppend, NULL, 0); XWindowEvent(dsp, rwin, PropertyChangeMask, &event); if (! (attr.your_event_mask & PropertyChangeMask)) XSelectInput(dsp, rwin, attr.your_event_mask); return(event.xproperty.time); } /*----------------------------------------------------------------* | CheckPinnedState | *----------------------------------------------------------------*/ static void CheckPinnedState () { static int panDx=0, panDy=-1; XtPointer msg, fulldata; unsigned long size; Window rWin, child; int x, y; unsigned int width, height, bWidth, depth; Time time = GetTimestamp(pInfoList[LOCAL].display); if (pinnedState == VERIFIED) return; panDy = -panDy; pinnedState = VERIFYING; /* Get position of the top-level shell */ XGetGeometry(pInfoList[LOCAL].display, XtWindow(pInfoList[LOCAL].shell), &rWin, &x, &y, &width, &height, &bWidth, &depth); XTranslateCoordinates(pInfoList[LOCAL].display, XtWindow(pInfoList[LOCAL].shell), rWin, x, y, &origX, &origY, &child); size = sizeof(CARD32); /* panDx */ size += sizeof(CARD32); /* panDy */ size += sizeof(CARD8); /* config */ msg = fulldata = (XtPointer) XtMalloc(sizeof(CARD8) * size); msg = PackCARD32(msg, panDx); msg = PackCARD32(msg, panDy); msg = PackCARD8(msg, True); if (! XmeNamedSink(pInfoList[LOCAL].utmShell, pInfoList[LOCAL].WM, XmCOPY, (XtPointer)fulldata, time) ) printf("Error - UTM Transfer failed.\n"); } /*----------------------------------------------------------------* | ShowPinStateWarning | *----------------------------------------------------------------*/ static void ShowPinStateWarning () { static Widget dlog = NULL; Arg args[3]; int n; if (dlog == NULL) { dlog = XmCreateWarningDialog(pInfoList[LOCAL].shell, "warningDlog", NULL, 0); XtUnmanageChild( XmMessageBoxGetChild (dlog, XmDIALOG_HELP_BUTTON) ); XtUnmanageChild( XmMessageBoxGetChild (dlog, XmDIALOG_CANCEL_BUTTON) ); } XtManageChild(dlog); } /*----------------------------------------------------------------* | HandleInitialExpose | *----------------------------------------------------------------*/ static void HandleInitialExpose ( Widget w, XtPointer clientData, XEvent *event, Boolean *cont) { XtRemoveEventHandler(w, ExposureMask, False, HandleInitialExpose, NULL); CheckPinnedState(); } motif-2.3.8/demos/programs/panner/Makefile.in0000644000175000017500000005474413211512766016076 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = panner$(EXEEXT) subdir = demos/programs/panner ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_panner_OBJECTS = panner.$(OBJEXT) panner_OBJECTS = $(am_panner_OBJECTS) panner_LDADD = $(LDADD) panner_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(panner_SOURCES) DIST_SOURCES = $(panner_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/panner build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/panner datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in panner_SOURCES = panner.c EXTRA_DIST = README panner.man data_DATA = $(EXTRA_DIST) $(panner_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/panner/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/panner/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list panner$(EXEEXT): $(panner_OBJECTS) $(panner_DEPENDENCIES) $(EXTRA_panner_DEPENDENCIES) @rm -f panner$(EXEEXT) $(AM_V_CCLD)$(LINK) $(panner_OBJECTS) $(panner_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panner.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/panner/panner.man0000644000175000017500000001251312672140200015763 00000000000000.\" $XConsortium: panner.man /main/4 1995/07/17 10:48:10 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH panner 1X MOTIF "Demonstration programs" .SH NAME \fBpanner\fR\(emVirtual screen support demo .SH SYNOPSIS .sS \fBpanner\fR .sE .SH DESCRIPTION Panner demonstrates how an application can interface to Mwm's virtual screen support protocol. The protocol allows other application to pan the desktop Mwm is running on. With Panner, you can see a miniature version of your desktop and interactively pan the display. Panner also allows you to connect to other displays and pan them as well. Please use this feature with discretion; it can be most anoying to others >:-). Also note that Panner will only work with Mwm 2.0. .PP Panner starts up displaying notebook widget with one page. Each page in the notebook represents a display screen. As you add other displays to Panner, they appear as new pages in the notebook. In the notebook page, you should see several colored rectangles. Each rectangle represents a window on the display. The is also a dashed rectangle which represents the display screen. You can grab hold of this rectangle using Button1 and interactively move it about the page causing the display to pan. If you wish to quickly 'hop' to another location on the desktop, press Button1 on the destination and the screen will be centered around that point. .PP The Display item in the menu bar contains the following items: .PP \fBUpdate\fR This will refresh the notebook page and .br redraw each miniature window. .PP \fBNew Display\fR This will prompt you for the name of a new .br Display connection name. .PP In Mwm's Virtual Screen Protocol, it is possible to 'pin' windows so that they are not effected by the panning. This can be done by using the following Mwm resources: .PP \fBclientPinned\fR Tells Mwm to ignore a particular .br client's window(s) when panning windows. .PP \fBiconPinned\fR Tells Mwm to ignore a particular .br client's icon(s) when panning windows. .PP Since you do not want to have Panner move while you are panning, you must tell Mwm to pin the panner window using the following line in your \fB.Xdefaults\fR file: .PP \fBMwm*Panner*ClientPinned: True\fR .PP To find out more about Mwm's Virtual Screen Protocol, see the \*VOSF/Motif Programmer's Reference, Revision 2.0\fR or the associated \*VOSF/Motif User's Guide, Revision 2.0\fR. .PP If you wish to interactively pin and unpin windows, there is a new, but unsupported function in Mwm call \fBf.toggle_pin_state\fR. This function can be added to a window's menu and allows you to pin and unpin windows. .PP There are five associated resources. These resources modify the label used in the window menu to show the state of the window. The default for this label is to display the string "make pinned" when the associated window is not pinned, and "make unpinned" when it is pinned. You can specify a new set of labels or pixmaps using the following resources: .PP \fBpinStateLabelType\fR This specifies the label type. .br \fBXmPIXMAP\fR Displays a pixmap .br using \fBpinnedPixmap\fR .br and unpinnedPixmap. .PP \fBXmSTRING\fR Displays text .br using \fBpinnedString\fR .br and \fBunpinnedString\fR. .PP \fBpinnedString\fR This specifies the string to display .br when the \fBpinStateLabelType\fR is .br \fBXmSTRING\fR and the associated window .br is pinned. .PP \fBunpinnedString\fR This specifies the string to display .br when the \fBpinStateLabelType\fR is .br \fBXmSTRING\fR and the associated window .br is unpinned. .PP \fBpinnedPixmap\fR This specifies the pixmap to display .br when the \fBpinStateLabelType\fR is .br \fBXmPIXMAP\fR and the associated window .br is pinned. .PP \fBunpinnedPixmap\fR This specifies the pixmap to display .br when the \fBpinStateLabelType\fR is .br \fBXmPIXMAP\fR and the associated window .br is unpinned. .PP ---------- .br Enjoy, .br Andrew deBlois motif-2.3.8/demos/programs/panner/README0000644000175000017500000000717312672140200014671 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:06:45 drk $ */ Panner ------ ************************************************************************ * This demo only works with Mwm 2.0. It does not work with Mwm 2.1. * ************************************************************************ Panner demonstrates how an application can interface to Mwm's virtual screen support protocol. The protocol allows other application to pan the desktop Mwm is running on. With Panner, you can see a miniature version of your desktop and interactively pan the display. Panner also allows you to connect to other displays and pan them as well. Please use this feature with discretion; it can be most anoying to others >:-) Panner starts-up displaying a notebook widget with one page. Each page in the notebook represents a display screen. As you add other displays to Panner, they appear as new pages in the notebook. In the notebook page, you should see several colored rectangles. Each rectangle represents a window on the display. The is also a dashed rectangle which represents the display screen. You can grab hold of this rectangle using Button1 and interactively move it about the page causing the display to pan. If you wish to quickly 'hop' to another location on the desktop, press Button1 on the destination and the screen will be centered around that point. The Display item in the menu bar contains the following items: Update - This will refresh the notebook page and redraw each miniature window. New Display - This will prompt you for the name of a new Display connection name. In Mwm's Virtual Screen Protocol, it is possible to 'pin' windows so that they are not effected by the panning. This can be done by using the following Mwm resources: clientPinned - tells Mwm to ignore a particular client's window(s) when panning windows. iconPinned - tells Mwm to ignore a particular client's icon(s) when panning windows. Since you do not want to have Panner move while you are panning, you must tell Mwm to pin the panner window using the following line in your .Xdefaults file: Mwm*Panner*ClientPinned: True To find out more about Mwm's Virtual Screen Protocol, see the Motif 2.0 Programmer's Reference or User's Guide. If you wish to interactively pin and unpin windows, there is a new, but unsupported function in Mwm call f.toggle_pin_state. This function can be added to a window's menu and allows you to pin and unpin windows. There are five associated resources. These resources modify the label used in the window menu to show the state of the window. The default for this label is to display the string "make pinned" when the associated window is not pinned, and "make unpinned" when it is pinned. You can specify a new set of labels or pixmaps using the following resources: pinStateLabelType This specifies the label type. XmPIXMAP Displays a pixmap using pinnedPixmap and unpinnedPixmap. XmSTRING Displays text using pinnedString and unpinnedString. pinnedString This specifies the string to display when the pinStateLabelType is XmSTRING and the associated window is pinned. unpinnedString This specifies the string to display when the pinStateLabelType is XmSTRING and the associated window is unpinned. pinnedPixmap This specifies the pixmap to display when the pinStateLabelType is XmPIXMAP and the associated window is pinned. unpinnedPixmap This specifies the pixmap to display when the pinStateLabelType is XmPIXMAP and the associated window is unpinned. Enjoy, Andrew deBlois motif-2.3.8/demos/programs/panner/Makefile.am0000644000175000017500000000051713145162623016051 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/panner datadir = ${prefix}/share/Xm/panner bin_PROGRAMS = panner panner_SOURCES = panner.c EXTRA_DIST = README panner.man data_DATA = $(EXTRA_DIST) $(panner_SOURCES) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/FontSel/0000755000175000017500000000000013211513007014147 500000000000000motif-2.3.8/demos/programs/FontSel/callbacks-c.c0000644000175000017500000001207212672140200016375 00000000000000/* * Generated by the ICS builderXcessory (BX). * * * Builder Xcessory 3.0A. * */ /************************************************************** * INCLUDES **************************************************************/ #include #include #include #include #include #include #include "fontsel.h" /************************************************************** * GLOBALS' EXTERNS **************************************************************/ extern Widget G_font; /* ARGSUSED */ void CreateHypeLabel(w, client, call) Widget w; XtPointer client; XtPointer call; { Arg args[5]; Cardinal argcnt; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Font Selector lets the developer add font selecting capabilities into their applications.\n\ The Font Selector allows the end user to choose particular fonts based on font family, size,\n\ weight, and other advanced criteria from the X Logical Font Description (XFLD).", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNalignment, XmALIGNMENT_BEGINNING); argcnt++; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; XtSetValues(w, args, argcnt); } /* ARGSUSED */ void ShowFontValChCB(w, client, call) Widget w; XtPointer client; XtPointer call; { Arg args[5]; Cardinal argcnt; argcnt = 0; XtSetArg(args[argcnt], XmNshowFontName, XmToggleButtonGetState(w)); argcnt++; XtSetValues(G_font, args, argcnt); } /* ARGSUSED */ void ExplainCB(w, client, call) Widget w; XtPointer client; XtPointer call; { Arg args[5]; Cardinal argcnt; XmString xmstring=NULL; static Widget info = NULL; int explain = (int) client; if (info == NULL) { Widget temp; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; info = XmCreateInformationDialog(w, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); } switch (explain) { case EXPLAIN_SHOWFONT: xmstring = XmStringCreateLtoR( "The Font Selector widget can display the name of the current font\n\ directly on the widget itself. Press the \"Show Font on Widget\" toggle\n\ button to see this behavior.", XmSTRING_DEFAULT_CHARSET); break; case EXPLAIN_CURFONT: xmstring = XmStringCreateLtoR( "Getting and Setting the XmNcurrentFont resource results in obtaining\n\ or setting the current font displayed by the Font Selector widget. Press\n\ the \"Show Current Font...\" button to see the current font displayed in\n\ a separate dialog.", XmSTRING_DEFAULT_CHARSET); break; default: break; } argcnt = 0; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; XtSetValues(info, args, argcnt); XmStringFree(xmstring); XtManageChild(info); } /* ARGSUSED */ void ShowCurFont(w, client, call) Widget w; XtPointer client; XtPointer call; { Arg args[5]; Cardinal argcnt; XmString xmstring; static Widget info = NULL; String fontname; argcnt = 0; XtSetArg(args[argcnt], XmNcurrentFont, &fontname); argcnt++; XtGetValues(G_font, args, argcnt); if (info == NULL) { Widget temp; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Current Font"); argcnt++; info = XmCreateInformationDialog(w, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); } if (fontname == NULL) xmstring = XmStringCreateSimple("No Current Font"); else xmstring = XmStringCreateSimple(fontname); argcnt = 0; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; XtSetValues(info, args, argcnt); XmStringFree(xmstring); XtManageChild(info); } /* ARGSUSED */ void ShowOtherCB(w, client, call) Widget w; XtPointer client; XtPointer call; { Arg args[5]; Cardinal argcnt; XmString xmstring; static Widget info = NULL; if (info == NULL) { Widget temp; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Other Resources"); argcnt++; info = XmCreateInformationDialog(w, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); } xmstring = XmStringCreateLtoR( "The Font Selector Widget has a few other resources to control its\n\ appearance:\n\ \n\ Resource - Type - Explanation\n\ \n\ isoFontsOnly - Boolean - Show only ISO8859-1 fonts\n\ textRows - Dimension - Number of rows shown in the text widget\n\ useScaling - Boolean - Controls \"Use Font Scaling\" toggle", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; XtSetValues(info, args, argcnt); XmStringFree(xmstring); XtManageChild(info); } /* ARGSUSED */ void QuitCB(w, client, call) Widget w; XtPointer client; XtPointer call; { exit(0); } motif-2.3.8/demos/programs/FontSel/Makefile.in0000644000175000017500000005533413211512766016161 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = fontsel$(EXEEXT) subdir = demos/programs/FontSel ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_fontsel_OBJECTS = callbacks-c.$(OBJEXT) creation-c.$(OBJEXT) \ fontsel.$(OBJEXT) fontsel_OBJECTS = $(am_fontsel_OBJECTS) fontsel_LDADD = $(LDADD) fontsel_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(fontsel_SOURCES) DIST_SOURCES = $(fontsel_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/fontsel build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/fontsel datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in fontsel_SOURCES = callbacks-c.c creation-c.c fontsel.c fontsel.h EXTRA_DIST = data_DATA = $(EXTRA_DIST) $(fontsel_SOURCES) LDADD = $(TOPDIR)/lib/Xm/libXm.la TOPDIR = ../../.. INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/FontSel/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/FontSel/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list fontsel$(EXEEXT): $(fontsel_OBJECTS) $(fontsel_DEPENDENCIES) $(EXTRA_fontsel_DEPENDENCIES) @rm -f fontsel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fontsel_OBJECTS) $(fontsel_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creation-c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontsel.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/FontSel/fontsel.h0000644000175000017500000000050712672140200015715 00000000000000/* * Copyright 1994, Integrated Computer Solutions, Inc. * * All Rights Reserved. * * Author: Rick Umali * * fontsel.h * */ /************************************************************** * DEFINES **************************************************************/ #define EXPLAIN_CURFONT 1 #define EXPLAIN_SHOWFONT 2 motif-2.3.8/demos/programs/FontSel/creation-c.c0000644000175000017500000001745512672140200016274 00000000000000/* * Generated by the ICS builderXcessory (BX). * * * Builder Xcessory 3.0A. * */ /* * MOTIF include files needed for widget creation. */ #include #include #include #include #include #include #include #include #include /* * User supplied include files. * (This is the C Output Include Information). */ #include "fontsel.h" /* * Function: BxRegisterConverters() * Registers all the converters for all widgets. */ static void BxRegisterConverters() { XtInitializeWidgetClass(xmSeparatorWidgetClass); XtInitializeWidgetClass(xmPushButtonWidgetClass); XtInitializeWidgetClass(xmToggleButtonWidgetClass); XtInitializeWidgetClass(xmLabelWidgetClass); XtInitializeWidgetClass(xmFrameWidgetClass); XtInitializeWidgetClass(xmFormWidgetClass); XtInitializeWidgetClass(xmRowColumnWidgetClass); XtInitializeWidgetClass(xmFontSelectorWidgetClass); XtInitializeWidgetClass(topLevelShellWidgetClass); } /* * Function prototypes for routines * located in utilities file. */ extern XtPointer CONVERT(); extern void MENU_POST(); /* * Callback procedure declarations */ extern void CreateHypeLabel(); extern void ShowFontValChCB(); extern void ExplainCB(); extern void ShowCurFont(); extern void ShowOtherCB(); extern void QuitCB(); /* * Function: CreateDemoForm() * Create form hierarchy of widgets. */ Widget CreateDemoForm( parent) Widget parent; { Arg args[512]; Cardinal argcnt; Boolean argok; Widget retval; Widget form; Widget font_frame; Widget fontsel; Widget hype_frame; Widget hype_label; Widget control_frame; Widget control_rc; Widget show_font_tog; Widget explain_showfont; Widget separator; Widget cur_font_pb; Widget explain_curfont; Widget separator1; Widget other_pb; Widget separator2; Widget quit_pb; argok = False; BxRegisterConverters(); argcnt = 0; XtSetArg(args[argcnt], XmNresizePolicy, XmRESIZE_ANY); argcnt++; form = XtCreateWidget("form", xmFormWidgetClass, parent, args, argcnt); retval = form; argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNbottomOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 20); argcnt++; control_frame = XtCreateWidget("control_frame", xmFrameWidgetClass, form, args, argcnt); XtManageChild(control_frame); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNx, 20); argcnt++; XtSetArg(args[argcnt], XmNy, 20); argcnt++; hype_frame = XtCreateWidget("hype_frame", xmFrameWidgetClass, form, args, argcnt); XtManageChild(hype_frame); argcnt = 0; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNbottomAttachment, XmATTACH_POSITION); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_FORM); argcnt++; XtSetArg(args[argcnt], XmNrightAttachment, XmATTACH_NONE); argcnt++; XtSetArg(args[argcnt], XmNbottomPosition, 95); argcnt++; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNrightOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, control_frame); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, control_frame); argcnt++; font_frame = XtCreateWidget("font_frame", xmFrameWidgetClass, form, args, argcnt); XtManageChild(font_frame); argcnt = 0; fontsel = XtCreateWidget("fontsel", xmFontSelectorWidgetClass, font_frame, args, argcnt); XtManageChild(fontsel); argcnt = 0; hype_label = XtCreateWidget("hype_label", xmLabelWidgetClass, hype_frame, args, argcnt); CreateHypeLabel(hype_label, (XtPointer)0, (XtPointer)0); XtManageChild(hype_label); argcnt = 0; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNrowColumnType, XmWORK_AREA); argcnt++; control_rc = XtCreateWidget("control_rc", xmRowColumnWidgetClass, control_frame, args, argcnt); XtManageChild(control_rc); argcnt = 0; show_font_tog = XtCreateWidget("show_font_tog", xmToggleButtonWidgetClass, control_rc, args, argcnt); XtAddCallback(show_font_tog, XmNvalueChangedCallback, ShowFontValChCB, (XtPointer)0); XtManageChild(show_font_tog); argcnt = 0; explain_showfont = XtCreateWidget("explain_showfont", xmPushButtonWidgetClass, control_rc, args, argcnt); XtAddCallback(explain_showfont, XmNactivateCallback, ExplainCB, (XtPointer)EXPLAIN_SHOWFONT); XtManageChild(explain_showfont); argcnt = 0; XtSetArg(args[argcnt], XmNseparatorType, XmSHADOW_ETCHED_OUT); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; separator = XtCreateWidget("separator", xmSeparatorWidgetClass, control_rc, args, argcnt); XtManageChild(separator); argcnt = 0; cur_font_pb = XtCreateWidget("cur_font_pb", xmPushButtonWidgetClass, control_rc, args, argcnt); XtAddCallback(cur_font_pb, XmNactivateCallback, ShowCurFont, (XtPointer)0); XtManageChild(cur_font_pb); argcnt = 0; explain_curfont = XtCreateWidget("explain_curfont", xmPushButtonWidgetClass, control_rc, args, argcnt); XtAddCallback(explain_curfont, XmNactivateCallback, ExplainCB, (XtPointer)EXPLAIN_CURFONT); XtManageChild(explain_curfont); argcnt = 0; XtSetArg(args[argcnt], XmNseparatorType, XmSHADOW_ETCHED_OUT); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; separator1 = XtCreateWidget("separator1", xmSeparatorWidgetClass, control_rc, args, argcnt); XtManageChild(separator1); argcnt = 0; other_pb = XtCreateWidget("other_pb", xmPushButtonWidgetClass, control_rc, args, argcnt); XtAddCallback(other_pb, XmNactivateCallback, ShowOtherCB, (XtPointer)0); XtManageChild(other_pb); argcnt = 0; XtSetArg(args[argcnt], XmNseparatorType, XmSHADOW_ETCHED_OUT); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; separator2 = XtCreateWidget("separator2", xmSeparatorWidgetClass, control_rc, args, argcnt); XtManageChild(separator2); argcnt = 0; quit_pb = XtCreateWidget("quit_pb", xmPushButtonWidgetClass, control_rc, args, argcnt); XtAddCallback(quit_pb, XmNactivateCallback, QuitCB, (XtPointer)0); XtManageChild(quit_pb); argcnt = 0; XtSetArg(args[argcnt], XmNtopOffset, 20); argcnt++; XtSetArg(args[argcnt], XmNtopAttachment, XmATTACH_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNtopWidget, hype_frame); argcnt++; XtSetArg(args[argcnt], XmNleftOffset, 0); argcnt++; XtSetArg(args[argcnt], XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET); argcnt++; XtSetArg(args[argcnt], XmNleftWidget, hype_frame); argcnt++; XtSetValues(control_frame, args, argcnt); return( retval ); } motif-2.3.8/demos/programs/FontSel/Makefile.am0000644000175000017500000000056613145162623016144 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/fontsel datadir = ${prefix}/share/Xm/fontsel bin_PROGRAMS = fontsel fontsel_SOURCES = callbacks-c.c creation-c.c fontsel.c fontsel.h EXTRA_DIST = data_DATA = $(EXTRA_DIST) $(fontsel_SOURCES) LDADD = $(TOPDIR)/lib/Xm/libXm.la TOPDIR = ../../.. INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/FontSel/fontsel.c0000644000175000017500000000615213066310437015723 00000000000000/* * Copyright 1994, Integrated Computer Solutions, Inc. * * All Rights Reserved. * * Author: Rick Umali * * fontsel.c * */ /************************************************************** * INCLUDE FILES **************************************************************/ #include #include #include #include "fontsel.h" #include #include #include /************************************************************** * GLOBALS **************************************************************/ Widget G_font = NULL; /************************************************************** * FORWARD DECLARATIONS **************************************************************/ Widget CreateDemoForm(Widget); /************************************************************** * DEFINES **************************************************************/ /************************************************************** * FALLBACKS **************************************************************/ static String fallbacks[] = { /* * General fallback resources. */ "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*hype_label*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*hype_label.marginWidth: 10", "*hype_label.marginHeight: 10", "*show_font_tog.labelString: Show Font on Widget", "*explain_showfont.labelString: Explain...", "*cur_font_pb.labelString: Show Current Font...", "*explain_curfont.labelString: Explain...", "*other_pb.labelString: Other Resources...", "*quit_pb.labelString: Quit", "*resform*rgbFileLabel.labelString: XmNrgbFile", NULL, }; /************************************************************** * PUBLIC (GLOBAL) CODE **************************************************************/ /* * Function Name: InitializeDemoForm * Description: * Arguments: form - * Returns: nothing * */ void InitializeDemoForm(Widget form) { Widget w; w = XtNameToWidget(form, "*show_font_tog"); if (w == NULL) { fprintf(stderr, "InitializeDemoForm: cannot find show_font_tog\n"); exit(1); } XmToggleButtonSetState(w, False, False); /* Set the global variable */ G_font = XtNameToWidget(form, "*fontsel"); if (G_font == NULL) { fprintf(stderr, "InitializeDemoForm: cannot find fontsel\n"); exit(1); } } /* * Function Name: main * Description: * Arguments: the usual suspects * Returns: nothing * */ int main(argc, argv) int argc; char **argv; { Arg args[5]; Cardinal argcnt; Widget top, demowindow; XtAppContext app; argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Font Selector Demo"); argcnt++; XtSetArg(args[argcnt], XmNiconName, "Font Selector Demo"); argcnt++; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; top = XtAppInitialize(&app, "ColorSelector", NULL, 0, &argc, argv, fallbacks, args, argcnt); demowindow = CreateDemoForm(top); XtManageChild(demowindow); InitializeDemoForm(demowindow); XtRealizeWidget(top); XtAppMainLoop(app); return 0; } motif-2.3.8/demos/programs/periodic/0000755000175000017500000000000013211513007014373 500000000000000motif-2.3.8/demos/programs/periodic/Makefile.in0000644000175000017500000005550613211512766016406 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = periodic$(EXEEXT) subdir = demos/programs/periodic ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_periodic_OBJECTS = periodic.$(OBJEXT) periodic_OBJECTS = $(am_periodic_OBJECTS) periodic_LDADD = $(LDADD) periodic_DEPENDENCIES = ../../../lib/Xm/libXm.la \ ../../../lib/Mrm/libMrm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(periodic_SOURCES) DIST_SOURCES = $(periodic_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/periodic build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/periodic datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = periodic.uil periodic_l.uil XmdPeriodic.ad README periodic_SOURCES = periodic.c data_DATA = $(EXTRA_DIST) $(periodic_SOURCES) periodic.uid LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/periodic/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/periodic/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list periodic$(EXEEXT): $(periodic_OBJECTS) $(periodic_DEPENDENCIES) $(EXTRA_periodic_DEPENDENCIES) @rm -f periodic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(periodic_OBJECTS) $(periodic_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/periodic.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dataDATA .PRECIOUS: Makefile all: periodic.uid periodic.uid: periodic.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) periodic.uid # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/periodic/XmdPeriodic.ad0000644000175000017500000000506112672140200017033 00000000000000! $XConsortium: XmdPeriodic.ad /main/5 1996/04/22 23:28:42 pascale $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY XmdPeriodic*XmText.columns: 10 XmdPeriodic*XmTextField.columns: 10 XmdPeriodic*XmComboBox*columns: 8 XmdPeriodic*scaleFrame*XmScale.width: 50 XmdPeriodic*scrollFrame*XmScrollBar.width: 50 XmdPeriodic*toggleButtonControls*Text.marginHeight: 1 XmdPeriodic*toggleButtonControls.spacing: 0 ?.toolTipEnable: True ?.toolTipPostDelay: 10 ?.toolTipPostDuration: 1000 ?.TipShell.TipLabel.background: yellow *background: yello *toolTipString: Jimmy was here XmdPeriodic*fontList: *-*-*-medium-r-*-*-*-100-*-*-p-*-*-* XmdPeriodic*HeaderDA*fontList: *-*-*-bold-r-*-*-*-100-*-*-p-*-*-* XmdPeriodic*titleLabel.fontList: *-*-*-bold-r-*-*-*-180-*-*-p-*-*-* XmdPeriodic*subtitleLabel.fontList: *-*-*-bold-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*labelLabel.fontList: *-*-*-bold-r-*-*-*-180-*-*-p-*-*-* XmdPeriodic*menuBar*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*popupMenu*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*XmMessageBox*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*fileDialog*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*selectDialog*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*promptDialog*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*toggleButtonExample*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-* XmdPeriodic*toggleButtonControls*fontList: *-*-*-medium-r-*-*-*-100-*-*-p-*-*-* XmdPeriodic*toggleButtonPage*fontList: *-*-*-medium-r-*-*-*-100-*-*-p-*-*-* motif-2.3.8/demos/programs/periodic/periodic.uil0000644000175000017500000021644412746225210016647 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: periodic.uil /main/8 1996/11/08 15:41:22 drk $ !****************************************************************************** !***************************************************************** !* !* Author: Alastair Gourlay !* Date: April 1992 !* Author: Michael K. Yee !* Date: August 1990 !* !***************************************************************** module periodic version = 'v2.0' names = case_sensitive objects = { XmLabel = widget; XmPushButton = widget; XmToggleButton = widget; XmCascadeButton = widget; XmSeparator = widget; } include file ("periodic_l.uil"); procedure ManageCb(); UnmanageCb(string); ShowCb(string); InitPopupCb(string); PopdownCb(); DaExposeCb(); DaResizeCb(); DbExposeCb(); DbResizeCb(); ScaleCb(); SetScaleCb(integer); ViewCb(); LayoutCb(); ToggleLightsCb(); ExitCb(); ScrollVisibleCb(); ToggleControlCb(integer); ToggleValueChangedCb(); value x0 : 0; x1 : 5; x2 : 10; x3 : 15; x4 : 20; x5 : 25; x6 : 30; x7 : 35; x8 : 40; y0 : 0; y1 : 8; y2 : 16; y3 : 24; y4 : 32; y5 : 40; value boxMarginWidth : 5; boxMarginHeight : 5; value XmDEFAULT_SELECT_COLOR : color("XmDEFAULT_SELECT_COLOR"); list formArgs : arguments { XmNleftAttachment = XmATTACH_POSITION; XmNrightAttachment = XmATTACH_POSITION; XmNtopAttachment = XmATTACH_POSITION; XmNbottomAttachment = XmATTACH_POSITION; }; list titleArgs : arguments { XmNframeChildType = XmFRAME_TITLE_CHILD; XmNchildHorizontalSpacing = 4; XmNchildVerticalAlignment = XmALIGNMENT_WIDGET_BOTTOM; }; ! ! Main window ! object appMain : XmMainWindow { arguments { XmNmenuBar = XmMenuBar menuBar; }; controls { XmMenuBar menuBar; XmFrame { arguments { XmNmarginWidth = 20; XmNmarginHeight = 20; }; controls { XmForm workArea; }; }; unmanaged XmFileSelectionDialog fileDialog; unmanaged XmSelectionDialog selectDialog; unmanaged XmTemplateDialog templateDialog; unmanaged XmInformationDialog infoDialog; unmanaged XmWarningDialog warningDialog; unmanaged XmErrorDialog errorDialog; unmanaged XmQuestionDialog questionDialog; unmanaged XmWorkingDialog workingDialog; unmanaged XmPromptDialog promptDialog; unmanaged XmInformationDialog showDialog; }; }; ! ! Menu bar and pulldown menus ! object menuBar : XmMenuBar { arguments { XmNmenuHelpWidget = XmCascadeButton helpCascade; }; controls { XmCascadeButton fileCascade; XmCascadeButton editCascade; XmCascadeButton viewCascade; XmCascadeButton optionsCascade; XmCascadeButton helpCascade; }; }; object fileCascade : XmCascadeButton { arguments { XmNlabelString = fileCascadeText; XmNmnemonic = keysym(fileCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton newButton; XmPushButton openButton; XmPushButton saveButton; XmPushButton saveAsButton; XmPushButton printButton; XmPushButton exitButton; }; }; }; }; object newButton : XmPushButton { arguments { XmNlabelString = newButtonText; XmNmnemonic = keysym(newButtonMnem); }; }; object openButton : XmPushButton { arguments { XmNlabelString = openButtonText; XmNmnemonic = keysym(openButtonMnem); }; }; object saveButton : XmPushButton { arguments { XmNlabelString = saveButtonText; XmNmnemonic = keysym(saveButtonMnem); }; }; object saveAsButton : XmPushButton { arguments { XmNlabelString = saveAsButtonText; XmNmnemonic = keysym(saveAsButtonMnem); }; }; object printButton : XmPushButton { arguments { XmNlabelString = printButtonText; XmNmnemonic = keysym(printButtonMnem); }; }; object exitButton : XmPushButton { arguments { XmNlabelString = exitButtonText; XmNmnemonic = keysym(exitButtonMnem); }; callbacks { XmNactivateCallback = procedure ExitCb(); }; }; object editCascade : XmCascadeButton { arguments { XmNlabelString = editCascadeText; XmNmnemonic = keysym(editCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton undoButton; XmSeparator { }; XmPushButton cutButton; XmPushButton copyButton; XmPushButton pasteButton; XmSeparator { }; XmPushButton clearButton; XmPushButton deleteButton; }; }; }; }; object undoButton : XmPushButton { arguments { XmNlabelString = undoButtonText; XmNmnemonic = keysym(undoButtonMnem); }; }; object cutButton : XmPushButton { arguments { XmNlabelString = cutButtonText; XmNmnemonic = keysym(cutButtonMnem); }; }; object copyButton : XmPushButton { arguments { XmNlabelString = copyButtonText; XmNmnemonic = keysym(copyButtonMnem); }; }; object pasteButton : XmPushButton { arguments { XmNlabelString = pasteButtonText; XmNmnemonic = keysym(pasteButtonMnem); }; }; object clearButton : XmPushButton { arguments { XmNlabelString = clearButtonText; XmNmnemonic = keysym(clearButtonMnem); }; }; object deleteButton : XmPushButton { arguments { XmNlabelString = deleteButtonText; XmNmnemonic = keysym(deleteButtonMnem); }; }; object viewCascade : XmCascadeButton { arguments { XmNlabelString = viewCascadeText; XmNmnemonic = keysym(viewCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmToggleButton stackButton; XmToggleButton tileButton; XmSeparator { }; XmToggleButton dayButton; XmToggleButton weekButton; XmToggleButton monthButton; XmToggleButton yearButton; }; }; }; }; object stackButton : XmToggleButton { arguments { XmNlabelString = stackButtonText; XmNmnemonic = keysym(stackButtonMnem); XmNindicatorType = XmONE_OF_MANY; }; callbacks { XmNvalueChangedCallback = procedure LayoutCb(); }; }; object tileButton : XmToggleButton { arguments { XmNlabelString = tileButtonText; XmNmnemonic = keysym(tileButtonMnem); XmNindicatorType = XmONE_OF_MANY; }; callbacks { XmNvalueChangedCallback = procedure LayoutCb(); }; }; object dayButton : XmToggleButton { arguments { XmNlabelString = dayButtonText; XmNmnemonic = keysym(dayButtonMnem); XmNindicatorType = XmONE_OF_MANY; }; callbacks { XmNvalueChangedCallback = procedure ViewCb(); }; }; object weekButton : XmToggleButton { arguments { XmNlabelString = weekButtonText; XmNmnemonic = keysym(weekButtonMnem); XmNindicatorType = XmONE_OF_MANY; }; callbacks { XmNvalueChangedCallback = procedure ViewCb(); }; }; object monthButton : XmToggleButton { arguments { XmNlabelString = monthButtonText; XmNmnemonic = keysym(monthButtonMnem); XmNindicatorType = XmONE_OF_MANY; }; callbacks { XmNvalueChangedCallback = procedure ViewCb(); }; }; object yearButton : XmToggleButton { arguments { XmNlabelString = yearButtonText; XmNmnemonic = keysym(yearButtonMnem); XmNindicatorType = XmONE_OF_MANY; }; callbacks { XmNvalueChangedCallback = procedure ViewCb(); }; }; object optionsCascade : XmCascadeButton { arguments { XmNlabelString = optionsCascadeText; XmNmnemonic = keysym(optionsCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmCascadeButton fontCascade; XmCascadeButton directCascade; XmToggleButton caseButton; XmToggleButton wrapButton; }; }; }; }; object fontCascade : XmCascadeButton { arguments { XmNlabelString = fontCascadeText; XmNmnemonic = keysym(fontCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton smallFontButton; XmPushButton mediumFontButton; XmPushButton largeFontButton; }; }; }; }; object smallFontButton : XmPushButton { arguments { XmNlabelString = smallFontButtonText; XmNmnemonic = keysym(smallFontButtonMnem); }; }; object mediumFontButton : XmPushButton { arguments { XmNlabelString = mediumFontButtonText; XmNmnemonic = keysym(mediumFontButtonMnem); }; }; object largeFontButton : XmPushButton { arguments { XmNlabelString = largeFontButtonText; XmNmnemonic = keysym(largeFontButtonMnem); }; }; object directCascade : XmCascadeButton { arguments { XmNlabelString = directCascadeText; XmNmnemonic = keysym(directCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton upDirButton; XmPushButton downDirButton; XmPushButton leftDirButton; XmPushButton rightDirButton; }; }; }; }; object upDirButton : XmPushButton { arguments { XmNlabelString = upButtonText; XmNmnemonic = keysym(upButtonMnem); }; }; object downDirButton : XmPushButton { arguments { XmNlabelString = downButtonText; XmNmnemonic = keysym(downButtonMnem); }; }; object leftDirButton : XmPushButton { arguments { XmNlabelString = leftButtonText; XmNmnemonic = keysym(leftButtonMnem); }; }; object rightDirButton : XmPushButton { arguments { XmNlabelString = rightButtonText; XmNmnemonic = keysym(rightButtonMnem); }; }; object caseButton : XmToggleButton { arguments { XmNlabelString = caseButtonText; XmNmnemonic = keysym(caseButtonMnem); }; }; object wrapButton : XmToggleButton { arguments { XmNlabelString = wrapButtonText; XmNmnemonic = keysym(wrapButtonMnem); }; }; object helpCascade : XmCascadeButton { arguments { XmNlabelString = helpCascadeText; XmNmnemonic = keysym(helpCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton contextButton; XmPushButton windowButton; XmPushButton tutorButton; XmPushButton versionButton; }; }; }; }; object contextButton : XmPushButton { arguments { XmNlabelString = contextButtonText; XmNmnemonic = keysym(contextButtonMnem); }; }; object windowButton : XmPushButton { arguments { XmNlabelString = windowButtonText; XmNmnemonic = keysym(windowButtonMnem); }; }; object tutorButton : XmPushButton { arguments { XmNlabelString = tutorButtonText; XmNmnemonic = keysym(tutorButtonMnem); }; }; object versionButton : XmPushButton { arguments { XmNlabelString = versionButtonText; XmNmnemonic = keysym(versionButtonMnem); }; }; ! ! Work area widgets ! object workArea : XmForm { arguments { XmNfractionBase = 40; }; controls { XmLabel titleLabel; XmLabel subtitleLabel; XmFrame separatorFrame; XmFrame arrowFrame; XmFrame pushFrame; XmFrame toggleFrame; XmFrame labelFrame; XmFrame optionFrame; XmFrame scaleFrame; XmFrame radioFrame; XmFrame textFrame; XmFrame tabFrame; XmFrame notebookFrame; XmFrame scrollFrame; XmFrame listFrame; XmFrame popupFrame; XmFrame drawFrame; XmFrame drawBtnFrame; XmFrame spinBoxFrame; XmFrame comboBoxFrame; }; }; object titleLabel : XmLabel { arguments { XmNleftAttachment = XmATTACH_POSITION; XmNrightAttachment = XmATTACH_POSITION; XmNleftPosition = x1; XmNrightPosition = x7; XmNtopAttachment = XmATTACH_FORM; XmNlabelString = titleLabelText; }; }; object subtitleLabel : XmLabel { arguments { XmNleftAttachment = XmATTACH_POSITION; XmNrightAttachment = XmATTACH_POSITION; XmNleftPosition = x1; XmNrightPosition = x7; XmNtopAttachment = XmATTACH_WIDGET; XmNtopWidget = XmLabel titleLabel; XmNlabelString = subtitleLabelText; }; }; object separatorFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x1; XmNtopPosition = y0; XmNbottomPosition = y1; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginWidth; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = separatorFrameText; }; }; XmSeparator { }; }; }; object arrowFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x1; XmNtopPosition = y1; XmNbottomPosition = y2; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginWidth; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = arrowFrameText; }; }; XmForm { arguments { XmNfractionBase = 3; }; controls { XmArrowButton arrowB1; XmArrowButton arrowB2; XmArrowButton arrowB3; XmArrowButton arrowB4; }; }; }; }; object arrowB1 : XmArrowButton { arguments { arguments formArgs; XmNleftPosition = 0; XmNrightPosition = 1; XmNtopPosition = 1; XmNbottomPosition = 2; XmNarrowDirection = XmARROW_LEFT; XmNshadowThickness = 0; }; }; object arrowB2 : XmArrowButton { arguments { arguments formArgs; XmNleftPosition = 2; XmNrightPosition = 3; XmNtopPosition = 1; XmNbottomPosition = 2; XmNarrowDirection = XmARROW_RIGHT; XmNshadowThickness = 0; }; }; object arrowB3 : XmArrowButton { arguments { arguments formArgs; XmNleftPosition = 1; XmNrightPosition = 2; XmNtopPosition = 0; XmNbottomPosition = 1; XmNarrowDirection = XmARROW_UP; XmNshadowThickness = 0; }; }; object arrowB4 : XmArrowButton { arguments { arguments formArgs; XmNleftPosition = 1; XmNrightPosition = 2; XmNtopPosition = 2; XmNbottomPosition = 3; XmNarrowDirection = XmARROW_DOWN; XmNshadowThickness = 0; }; }; object pushFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x1; XmNrightPosition = x2; XmNtopPosition = y2; XmNbottomPosition = y3; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginWidth; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = pushFrameText; }; }; XmForm { controls { XmPushButton pushButton; }; }; }; }; object pushButton : XmPushButton { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNtopAttachment = XmATTACH_POSITION; XmNtopPosition = 10; XmNbottomAttachment = XmATTACH_POSITION; XmNbottomPosition = 90; XmNlabelString = pushButtonText; }; }; object toggleFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x1; XmNrightPosition = x2; XmNtopPosition = y1; XmNbottomPosition = y2; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginWidth; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = toggleFrameText; }; }; XmForm { controls { XmToggleButton toggleButton; }; }; }; }; object toggleButton : XmToggleButton { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNtopAttachment = XmATTACH_POSITION; XmNtopPosition = 10; XmNbottomAttachment = XmATTACH_POSITION; XmNbottomPosition = 90; XmNlabelString = toggleButtonText; XmNtoolTipString = "Tool Tips work when set in the uil file"; }; callbacks { XmNvalueChangedCallback = procedure ToggleLightsCb(); }; }; object labelFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x1; XmNtopPosition = y2; XmNbottomPosition = y3; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = labelFrameText; }; }; XmForm { controls { XmLabel labelLabel; }; }; }; }; object labelLabel : XmLabel { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNtopAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_FORM; XmNlabelString = labelText; }; }; object optionFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x7; XmNrightPosition = x8; XmNtopPosition = y2; XmNbottomPosition = y3; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = optionFrameText; }; }; XmOptionMenu { arguments { XmNlabelString = optionMenuText; XmNorientation = XmVERTICAL; XmNmnemonic = keysym(optionMenuMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton { arguments { XmNlabelString = sundayButtonText; XmNmnemonic = keysym(sundayButtonMnem); }; }; XmPushButton { arguments { XmNlabelString = mondayButtonText; XmNmnemonic = keysym(mondayButtonMnem); }; }; XmPushButton { arguments { XmNlabelString = tuesdayButtonText; XmNmnemonic = keysym(tuesdayButtonMnem); }; }; XmPushButton { arguments { XmNlabelString = wednesdayButtonText; XmNmnemonic = keysym(wednesdayButtonMnem); }; }; XmPushButton { arguments { XmNlabelString = thursdayButtonText; XmNmnemonic = keysym(thursdayButtonMnem); }; }; XmPushButton { arguments { XmNlabelString = fridayButtonText; XmNmnemonic = keysym(fridayButtonMnem); }; }; XmPushButton { arguments { XmNlabelString = saturdayButtonText; XmNmnemonic = keysym(saturdayButtonMnem); }; }; }; }; }; }; }; }; object scaleFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x5; XmNrightPosition = x6; XmNtopPosition = y1; XmNbottomPosition = y2; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = scaleFrameText; }; }; XmForm { controls { XmScale valueScale; }; }; }; }; object valueScale : XmScale { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNtopAttachment = XmATTACH_POSITION; XmNtopPosition = 15; XmNshowValue = true; XmNminimum = scaleMinimum; XmNmaximum = scaleMaximum; XmNvalue = scaleValue; XmNdecimalPoints = 1; XmNtitleString = scaleTitleText; XmNorientation = XmHORIZONTAL; }; callbacks { XmNdragCallback = procedure ScaleCb(); XmNvalueChangedCallback = procedure ScaleCb(); }; }; object radioFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x6; XmNrightPosition = x7; XmNtopPosition = y1; XmNbottomPosition = y2; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = radioFrameText; }; }; XmRadioBox { arguments { XmNradioAlwaysOne = true; XmNspacing = 0; }; controls { XmToggleButton { arguments { XmNlabelString = radio1Text; XmNset = true; }; callbacks { XmNvalueChangedCallback = procedure SetScaleCb(radio1Value); }; }; XmToggleButton { arguments { XmNlabelString = radio2Text; }; callbacks { XmNvalueChangedCallback = procedure SetScaleCb(radio2Value); }; }; XmToggleButton { arguments { XmNlabelString = radio3Text; }; callbacks { XmNvalueChangedCallback = procedure SetScaleCb(radio3Value); }; }; }; }; }; }; object treeFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x7; XmNrightPosition = x8; XmNtopPosition = y1; XmNbottomPosition = y2; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = radioFrameText; }; }; XmRadioBox { arguments { XmNradioAlwaysOne = true; XmNspacing = 0; }; controls { XmToggleButton { arguments { XmNlabelString = radio1Text; XmNset = true; }; callbacks { XmNvalueChangedCallback = procedure SetScaleCb(radio1Value); }; }; XmToggleButton { arguments { XmNlabelString = radio2Text; }; callbacks { XmNvalueChangedCallback = procedure SetScaleCb(radio2Value); }; }; XmToggleButton { arguments { XmNlabelString = radio3Text; }; callbacks { XmNvalueChangedCallback = procedure SetScaleCb(radio3Value); }; }; }; }; }; }; object textFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x5; XmNtopPosition = y2; XmNbottomPosition = y3; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = textFrameText; }; }; XmText { arguments { XmNeditMode = XmMULTI_LINE_EDIT; }; }; }; }; object scrollFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x3; XmNrightPosition = x4; XmNtopPosition = y2; XmNbottomPosition = y3; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = scrollFrameText; }; }; XmForm { controls { XmScrollBar { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_POSITION; XmNbottomPosition = 50; XmNtraversalOn = true; XmNhighlightThickness = 2; XmNorientation = XmHORIZONTAL; }; }; }; }; }; }; object listFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x5; XmNrightPosition = x6; XmNtopPosition = y2; XmNbottomPosition = y3; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = listFrameText; }; }; XmScrolledList { arguments { XmNitems = greekAlphabet; }; }; }; }; object comboBoxFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x6; XmNrightPosition = x7; XmNtopPosition = y2; XmNbottomPosition = y3; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = comboBoxFrameText; }; }; XmForm { controls { XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_POSITION; XmNbottomPosition = 50; XmNbottomOffset = -1 font_unit; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = hebrewAText; }; controls { Xm_List { arguments { XmNitems = hebrewAlphabet; XmNvisibleItemCount = 6; }; }; }; }; }; }; }; }; object paneFrame : XmFrame { controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = paneFrameText; }; }; XmPanedWindow { controls { XmScrolledText { arguments { XmNvalue = pane1Text; XmNeditMode = XmMULTI_LINE_EDIT; }; }; XmScrolledText { arguments { XmNvalue = pane2Text; XmNeditMode = XmMULTI_LINE_EDIT; }; }; }; }; }; }; object popupFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x7; XmNrightPosition = x8; XmNtopPosition = y0; XmNbottomPosition = y1; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = popupFrameText; }; }; XmForm { controls { XmLabel popupWindow; }; }; }; }; object popupWindow : XmLabel { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNtopAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_FORM; XmNborderWidth = 1; XmNlabelString = popupWindowText; XmNtraversalOn = true; }; controls { unmanaged XmPopupMenu popupMenu; }; }; object popupMenu : XmPopupMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmLabel { arguments { XmNlabelString = popupTitleText; }; }; XmSeparator { arguments { XmNseparatorType = XmDOUBLE_LINE; }; }; XmPushButton { arguments { XmNlabelString = popupUndoText; XmNmnemonic = keysym(popupUndoMnem); }; }; XmSeparator { }; XmPushButton { arguments { XmNlabelString = popupCutText; XmNmnemonic = keysym(popupCutMnem); }; }; XmPushButton { arguments { XmNlabelString = popupCopyText; XmNmnemonic = keysym(popupCopyMnem); }; }; XmPushButton { arguments { XmNlabelString = popupPasteText; XmNmnemonic = keysym(popupPasteMnem); }; }; XmSeparator { }; XmPushButton { arguments { XmNlabelString = popupClearText; XmNmnemonic = keysym(popupClearMnem); }; }; XmPushButton { arguments { XmNlabelString = popupDeleteText; XmNmnemonic = keysym(popupDeleteMnem); }; }; }; callbacks { MrmNcreateCallback = procedure InitPopupCb("*popupWindow"); XmNpopdownCallback = procedure PopdownCb(); }; }; object drawFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x5; XmNtopPosition = y1; XmNbottomPosition = y2; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = drawFrameText; }; }; XmFrame { arguments { XmNshadowType = XmSHADOW_IN; XmNshadowThickness = 2; }; controls { XmDrawingArea drawArea; }; }; }; }; object drawArea : XmDrawingArea { arguments { XmNtraversalOn = false; }; callbacks { XmNexposeCallback = procedure DaExposeCb(); XmNresizeCallback = procedure DaResizeCb(); }; }; object drawBtnFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x3; XmNtopPosition = y1; XmNbottomPosition = y2; XmNmarginWidth = 2 * boxMarginWidth; XmNmarginHeight = 2 * boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = drawBtnFrameText; }; }; XmDrawnButton drawnButton; }; }; object drawnButton : XmDrawnButton { arguments { XmNpushButtonEnabled = true; }; callbacks { XmNexposeCallback = procedure DbExposeCb(); XmNresizeCallback = procedure DbResizeCb(); XmNactivateCallback = procedure ShowCb("*showDialog"); }; }; object spinBoxFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x3; XmNtopPosition = y2; XmNbottomPosition = y3; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = spinBoxFrameText; }; }; XmForm { controls { XmSpinBox { arguments { XmNleftAttachment = XmATTACH_FORM; XmNrightAttachment = XmATTACH_FORM; XmNbottomAttachment = XmATTACH_POSITION; XmNbottomPosition = 50; XmNbottomOffset = -1 font_unit; XmNarrowLayout = XmARROWS_SPLIT; }; controls { XmTextField { arguments { XmNeditable = false; XmNspinBoxChildType = XmSTRING; XmNnumValues = 6; XmNvalues = quarks; XmNcolumns = 6; }; }; }; }; }; }; }; }; object commandFrame : XmFrame { arguments { XmNtabLabelString = "XmCommand"; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = commandFrameText; }; }; XmCommand { arguments { XmNmarginWidth = 4; XmNmarginHeight = 4; XmNhistoryMaxItems = 20; XmNpromptString = commandPromptText; }; }; }; }; object tabFrame: XmFrame { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x4; XmNtopPosition = y3; XmNbottomPosition = y5; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = "TabStack"; }; }; XmTabStack tabstack; }; }; object tabstack: XmTabStack{ controls { XmTree tree; XmOutline outline; XmFrame commandFrame; XmFrame paneFrame; XmColumn column; }; }; object tree: XmTree{ arguments { XmNtabLabelString = "XmTree"; }; controls { XmPushButton Germanic; XmPushButton TEast; XmPushButton TWest; XmPushButton TNorth; XmPushButton Burgundian; XmPushButton Gothic; XmPushButton Lombardic ; XmPushButton Vandalic; XmPushButton Ingaevonic; XmPushButton High; }; }; object outline: XmOutline{ arguments { XmNtabLabelString = "XmOutline"; XmNconnectNodes = true; }; controls { XmPushButton Germanic; XmPushButton TEast; XmPushButton TWest; XmPushButton TNorth; XmPushButton Burgundian; XmPushButton Gothic; XmPushButton Lombardic ; XmPushButton Vandalic; XmPushButton Ingaevonic; XmPushButton High; }; }; ! ! Nodes for our tree and outline ! object Germanic :XmPushButton { arguments { XmNlabelString = "Germanic"; XmNnodeState = XmAlwaysOpen; }; }; object TEast :XmPushButton { arguments { XmNlabelString = "East"; XmNparentNode = Germanic; XmNnodeState = XmAlwaysOpen; }; }; object TWest :XmPushButton { arguments { XmNlabelString = "West"; XmNparentNode = Germanic; XmNnodeState = XmAlwaysOpen; }; }; object TNorth :XmPushButton { arguments { XmNlabelString = "North"; XmNparentNode = Germanic; XmNnodeState = XmAlwaysOpen; }; }; object Burgundian :XmPushButton { arguments { XmNlabelString = "Burgundian"; XmNparentNode = TEast; XmNnodeState = XmAlwaysOpen; }; }; object Gothic :XmPushButton { arguments { XmNlabelString = "Gothic"; XmNparentNode = TEast; XmNnodeState = XmAlwaysOpen; }; }; object Lombardic :XmPushButton { arguments { XmNlabelString = "Lombardic"; XmNparentNode = TEast; XmNnodeState = XmAlwaysOpen; }; }; object Vandalic :XmPushButton { arguments { XmNlabelString = "Vandalic"; XmNparentNode = TEast; XmNnodeState = XmAlwaysOpen; }; }; object Ingaevonic :XmPushButton { arguments { XmNlabelString = "Ingaevonic"; XmNparentNode = TWest; XmNnodeState = XmAlwaysOpen; }; }; object High :XmPushButton { arguments { XmNlabelString = "High German"; XmNparentNode = TWest; XmNnodeState = XmAlwaysOpen; }; }; ! ! End of tree nodes ! object column: XmColumn { arguments { XmNtabLabelString = "XmColumn"; }; controls { XmText { arguments { XmNvalue = "617-621-0020"; XmNwidth = 100; XmNentryLabelString = "Phone Number"; }; }; XmText { arguments { XmNvalue = "201 Broadway"; XmNwidth = 100; XmNentryLabelString = "Address"; }; }; XmText { arguments { XmNvalue = "Cambridge"; XmNwidth = 100; XmNentryLabelString = "City"; }; }; XmText { arguments { XmNvalue = "Mass"; XmNwidth = 100; XmNentryLabelString = "State"; }; }; }; }; object notebookFrame : XmFrame { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x8; XmNtopPosition = y3; XmNbottomPosition = y5; XmNmarginWidth = boxMarginWidth; XmNmarginHeight = boxMarginHeight; }; controls { XmLabel { arguments { arguments titleArgs; XmNlabelString = notebookFrameText; }; }; XmNotebook notebook; }; }; object notebook : XmNotebook { controls { XmPushButton { arguments { XmNlabelString = dialogText; XmNnotebookChildType = XmMAJOR_TAB; XmNpageNumber = 1; }; }; XmPushButton { arguments { XmNlabelString = notebookWidgetsText; XmNnotebookChildType = XmMAJOR_TAB; XmNpageNumber = 2; }; }; XmPushButton { arguments { XmNlabelString = notebookLayoutsText; XmNnotebookChildType = XmMAJOR_TAB; XmNpageNumber = 3; }; }; XmPushButton { arguments { XmNlabelString = togglesText; XmNnotebookChildType = XmMAJOR_TAB; XmNpageNumber = 11; }; }; XmPushButton { arguments { XmNlabelString = aText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 3; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutLTText; XmNpageNumber = 3; }; }; XmPushButton { arguments { XmNlabelString = bText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 4; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutRTText; XmNpageNumber = 4; }; }; XmPushButton { arguments { XmNlabelString = cText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 5; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutTLText; XmNpageNumber = 5; }; }; XmPushButton { arguments { XmNlabelString = fText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 6; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutTRText; XmNpageNumber = 6; }; }; XmPushButton { arguments { XmNlabelString = gText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 7; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutBLText; XmNpageNumber = 7; }; }; XmPushButton { arguments { XmNlabelString = jText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 8; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutBRText; XmNpageNumber = 8; }; }; XmPushButton { arguments { XmNlabelString = kText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 9; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutLBText; XmNpageNumber = 9; }; }; XmPushButton { arguments { XmNlabelString = lText; XmNnotebookChildType = XmMINOR_TAB; XmNpageNumber = 10; }; }; XmLabel { arguments { XmNnotebookChildType = XmSTATUS_AREA; XmNlabelString = layoutRBText; XmNpageNumber = 10; }; }; XmContainer dialogContainer; XmScrolledWindow widgetTreeScrolledWin; XmForm layoutLTForm; XmForm layoutRTForm; XmForm layoutTLForm; XmForm layoutTRForm; XmForm layoutBLForm; XmForm layoutBRForm; XmForm layoutLBForm; XmForm layoutRBForm; XmForm toggleButtonPage; }; }; object dialogContainer : XmContainer { arguments { XmNnotebookChildType = XmPAGE; XmNpageNumber = 1; XmNautomaticSelection = true; XmNentryViewType = XmLARGE_ICON; XmNlayoutType = XmSPATIAL; XmNselectionPolicy = XmSINGLE_SELECT; XmNspatialSnapModel = XmCENTER; }; callbacks { XmNdefaultActionCallback = procedure ManageCb(); }; controls { XmIconGadget templatePick; XmIconGadget infoPick; XmIconGadget warningPick; XmIconGadget errorPick; XmIconGadget questionPick; XmIconGadget workingPick; XmIconGadget filePick; XmIconGadget selectPick; XmIconGadget promptPick; }; }; object templatePick : XmIconGadget { arguments { XmNlabelString = templatePickText; XmNlargeIconPixmap = templatePixmap; }; }; object infoPick : XmIconGadget { arguments { XmNlabelString = infoPickText; XmNlargeIconPixmap = infoPixmap; }; }; object warningPick : XmIconGadget { arguments { XmNlabelString = warningPickText; XmNlargeIconPixmap = warningPixmap; }; }; object errorPick : XmIconGadget { arguments { XmNlabelString = errorPickText; XmNlargeIconPixmap = errorPixmap; }; }; object questionPick : XmIconGadget { arguments { XmNlabelString = questionPickText; XmNlargeIconPixmap = questionPixmap; }; }; object workingPick : XmIconGadget { arguments { XmNlabelString = workingPickText; XmNlargeIconPixmap = workingPixmap; }; }; object filePick : XmIconGadget { arguments { XmNlabelString = filePickText; XmNlargeIconPixmap = filePixmap; }; }; object selectPick : XmIconGadget { arguments { XmNlabelString = selectPickText; XmNlargeIconPixmap = selectPixmap; }; }; object promptPick : XmIconGadget { arguments { XmNlabelString = promptPickText; XmNlargeIconPixmap = promptPixmap; }; }; ! Notebook Page 2 object widgetTreeScrolledWin : XmScrolledWindow { arguments { XmNnotebookChildType = XmPAGE; XmNpageNumber = 2; XmNscrollBarDisplayPolicy = XmAS_NEEDED; XmNscrollingPolicy = XmAUTOMATIC; }; callbacks { XmNtraverseObscuredCallback = procedure ScrollVisibleCb(); }; controls { XmContainer widgetContainer; }; }; object widgetContainer : XmContainer { arguments { XmNentryViewType = XmSMALL_ICON; XmNautomaticSelection = true; XmNselectionPolicy = XmSINGLE_SELECT; XmNoutlineIndentation = 20; XmNlayoutType = XmDETAIL; XmNdetailColumnHeading = notebookWidgetsHeaders; }; controls { XmIconGadget wt_Object; XmIconGadget wt_Rect; XmIconGadget wt_Core; XmIconGadget wt_Composite; XmIconGadget wt_Constraint; XmIconGadget wt_XmManager; XmIconGadget wt_XmDrawingArea; XmIconGadget wt_XmFrame; XmIconGadget wt_XmRowColumn; XmIconGadget wt_XmPanedWindow; XmIconGadget wt_XmScale; XmIconGadget wt_XmComboBox; XmIconGadget wt_XmContainer; XmIconGadget wt_XmNotebook; XmIconGadget wt_XmSpinBox; XmIconGadget wt_XmScrolledWindow; XmIconGadget wt_XmMainWindow; XmIconGadget wt_XmBulletinBoard; XmIconGadget wt_XmForm; XmIconGadget wt_XmMessageBox; XmIconGadget wt_XmSelectionBox; XmIconGadget wt_XmFileSelectionBox; XmIconGadget wt_XmCommand; XmIconGadget wt_Shell; XmIconGadget wt_WMShell; XmIconGadget wt_VendorShell; XmIconGadget wt_XmGrabShell; XmIconGadget wt_XmDragOverShell; XmIconGadget wt_TransientShell; XmIconGadget wt_XmDialogShell; XmIconGadget wt_TopLevelShell; XmIconGadget wt_ApplicationShell; XmIconGadget wt_XmDisplay; XmIconGadget wt_OverrideShell; XmIconGadget wt_XmMenuShell; XmIconGadget wt_XmScreen; XmIconGadget wt_XmDragContext; XmIconGadget wt_XmPrimitive; XmIconGadget wt_XmScrollBar; XmIconGadget wt_XmArrowButton; XmIconGadget wt_XmList; XmIconGadget wt_XmSeparator; XmIconGadget wt_XmTextField; XmIconGadget wt_XmDrawnButton; XmIconGadget wt_XmText; XmIconGadget wt_XmSash; XmIconGadget wt_XmLabel; XmIconGadget wt_XmToggleButton; XmIconGadget wt_XmCascadeButton; XmIconGadget wt_XmPushButton; XmIconGadget wt_XmTearOffButton; XmIconGadget wt_XmGadget; XmIconGadget wt_XmArrowButtonGadget; XmIconGadget wt_XmSeparatorGadget; XmIconGadget wt_XmLabelGadget; XmIconGadget wt_XmPushButtonGadget; XmIconGadget wt_XmToggleButtongadget; XmIconGadget wt_XmCascadeButtonGadget; XmIconGadget wt_XmIconGadget; XmIconGadget wt_XmIconHeader; XmIconGadget wt_XmDragIcon; XmIconGadget wt_XmDropTransfer; XmIconGadget wt_XmDropSiteManager; }; }; object wt_Object : XmIconGadget { arguments { XmNlabelString = wtObjectText; XmNoutlineState = XmEXPANDED; XmNdetail = wtObjectDetail; }; }; object wt_Rect : XmIconGadget { arguments { XmNlabelString = wtRectText; XmNentryParent = wt_Object; XmNoutlineState = XmEXPANDED; XmNdetail = wtRectDetail; }; }; object wt_Core : XmIconGadget { arguments { XmNlabelString = wtCoreText; XmNentryParent = wt_Rect; XmNoutlineState = XmEXPANDED; XmNdetail = wtCoreDetail; }; }; object wt_Composite : XmIconGadget { arguments { XmNlabelString = wtCompositeText; XmNentryParent = wt_Core; XmNoutlineState = XmEXPANDED; XmNdetail = wtCompositeDetail; }; }; object wt_Constraint : XmIconGadget { arguments { XmNlabelString = wtConstraintText; XmNentryParent = wt_Composite; XmNoutlineState = XmEXPANDED; XmNdetail = wtConstraintDetail; }; }; object wt_XmManager : XmIconGadget { arguments { XmNlabelString = wtXmManagerText; XmNentryParent = wt_Constraint; XmNdetail = wtXmManagerDetail; }; }; object wt_XmDrawingArea : XmIconGadget { arguments { XmNlabelString = wtXmDrawingAreaText; XmNentryParent = wt_XmManager; XmNdetail = wtXmDrawingAreaDetail; }; }; object wt_XmFrame : XmIconGadget { arguments { XmNlabelString = wtXmFrameText; XmNentryParent = wt_XmManager; XmNdetail = wtXmFrameDetail; }; }; object wt_XmRowColumn : XmIconGadget { arguments { XmNlabelString = wtXmRowColumnText; XmNentryParent = wt_XmManager; XmNdetail = wtXmRowColumnDetail; }; }; object wt_XmPanedWindow : XmIconGadget { arguments { XmNlabelString = wtXmPanedWindowText; XmNentryParent = wt_XmManager; XmNdetail = wtXmPanedWindowDetail; }; }; object wt_XmScale : XmIconGadget { arguments { XmNlabelString = wtXmScaleText; XmNentryParent = wt_XmManager; XmNdetail = wtXmScaleDetail; }; }; object wt_XmComboBox : XmIconGadget { arguments { XmNlabelString = wtXmComboBoxText; XmNentryParent = wt_XmManager; XmNdetail = wtXmComboBoxDetail; }; }; object wt_XmContainer : XmIconGadget { arguments { XmNlabelString = wtXmContainerText; XmNentryParent = wt_XmManager; XmNdetail = wtXmContainerDetail; }; }; object wt_XmNotebook : XmIconGadget { arguments { XmNlabelString = wtXmNotebookText; XmNentryParent = wt_XmManager; XmNdetail = wtXmNotebookDetail; }; }; object wt_XmSpinBox : XmIconGadget { arguments { XmNlabelString = wtXmSpinBoxText; XmNentryParent = wt_XmManager; XmNdetail = wtXmSpinBoxDetail; }; }; object wt_XmScrolledWindow : XmIconGadget { arguments { XmNlabelString = wtXmScrolledWindowText; XmNentryParent = wt_XmManager; XmNdetail = wtXmScrolledWindowDetail; }; }; object wt_XmMainWindow : XmIconGadget { arguments { XmNlabelString = wtXmMainWindowText; XmNentryParent = wt_XmScrolledWindow; XmNdetail = wtXmMainWindowDetail; }; }; object wt_XmBulletinBoard : XmIconGadget { arguments { XmNlabelString = wtXmBulletinBoardText; XmNentryParent = wt_XmManager; XmNdetail = wtXmBulletinBoardDetail; }; }; object wt_XmForm : XmIconGadget { arguments { XmNlabelString = wtXmFormText; XmNentryParent = wt_XmBulletinBoard; XmNdetail = wtXmFormDetail; }; }; object wt_XmMessageBox : XmIconGadget { arguments { XmNlabelString = wtXmMessageBoxText; XmNentryParent = wt_XmBulletinBoard; XmNdetail = wtXmMessageBoxDetail; }; }; object wt_XmSelectionBox : XmIconGadget { arguments { XmNlabelString = wtXmSelectionBoxText; XmNentryParent = wt_XmBulletinBoard; XmNdetail = wtXmSelectionBoxDetail; }; }; object wt_XmFileSelectionBox : XmIconGadget { arguments { XmNlabelString = wtXmFileSelectionBoxText; XmNentryParent = wt_XmSelectionBox; XmNdetail = wtXmFileSelectionBoxDetail; }; }; object wt_XmCommand : XmIconGadget { arguments { XmNlabelString = wtXmCommandText; XmNentryParent = wt_XmSelectionBox; XmNdetail = wtXmCommandDetail; }; }; object wt_Shell : XmIconGadget { arguments { XmNlabelString = wtShellText; XmNentryParent = wt_Composite; XmNdetail = wtShellDetail; }; }; object wt_WMShell : XmIconGadget { arguments { XmNlabelString = wtWMShellText; XmNentryParent = wt_Shell; XmNdetail = wtWMShellDetail; }; }; object wt_VendorShell : XmIconGadget { arguments { XmNlabelString = wtVendorShellText; XmNentryParent = wt_WMShell; XmNdetail = wtVendorShellDetail; }; }; object wt_XmGrabShell : XmIconGadget { arguments { XmNlabelString = wtXmGrabShellText; XmNentryParent = wt_VendorShell; XmNdetail = wtXmGrabShellDetail; }; }; object wt_XmDragOverShell : XmIconGadget { arguments { XmNlabelString = wtXmDragOverShellText; XmNentryParent = wt_VendorShell; XmNdetail = wtXmDragOverShellDetail; }; }; object wt_TransientShell : XmIconGadget { arguments { XmNlabelString = wtTransientShellText; XmNentryParent = wt_VendorShell; XmNdetail = wtTransientShellDetail; }; }; object wt_XmDialogShell : XmIconGadget { arguments { XmNlabelString = wtXmDialogShellText; XmNentryParent = wt_TransientShell; XmNdetail = wtXmDialogShellDetail; }; }; object wt_TopLevelShell : XmIconGadget { arguments { XmNlabelString = wtTopLevelShellText; XmNentryParent = wt_VendorShell; XmNdetail = wtTopLevelShellDetail; }; }; object wt_ApplicationShell : XmIconGadget { arguments { XmNlabelString = wtApplicationShellText; XmNentryParent = wt_TopLevelShell; XmNdetail = wtApplicationShellDetail; }; }; object wt_XmDisplay : XmIconGadget { arguments { XmNlabelString = wtXmDisplayText; XmNentryParent = wt_ApplicationShell; XmNdetail = wtXmDisplayDetail; }; }; object wt_OverrideShell : XmIconGadget { arguments { XmNlabelString = wtOverrideShellText; XmNentryParent = wt_Shell; XmNdetail = wtOverrideShellDetail; }; }; object wt_XmMenuShell : XmIconGadget { arguments { XmNlabelString = wtXmMenuShellText; XmNentryParent = wt_OverrideShell; XmNdetail = wtXmMenuShellDetail; }; }; object wt_XmScreen : XmIconGadget { arguments { XmNlabelString = wtXmScreenText; XmNentryParent = wt_Core; XmNdetail = wtXmScreenDetail; }; }; object wt_XmDragContext : XmIconGadget { arguments { XmNlabelString = wtXmDragContextText; XmNentryParent = wt_Core; XmNdetail = wtXmDragContextDetail; }; }; object wt_XmPrimitive : XmIconGadget { arguments { XmNlabelString = wtXmPrimitiveText; XmNentryParent = wt_Core; XmNdetail = wtXmPrimitiveDetail; }; }; object wt_XmScrollBar : XmIconGadget { arguments { XmNlabelString = wtXmScrollBarText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmScrollBarDetail; }; }; object wt_XmArrowButton : XmIconGadget { arguments { XmNlabelString = wtXmArrowButtonText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmArrowButtonDetail; }; }; object wt_XmList : XmIconGadget { arguments { XmNlabelString = wtXmListText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmListDetail; }; }; object wt_XmSeparator : XmIconGadget { arguments { XmNlabelString = wtXmSeparatorText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmSeparatorDetail; }; }; object wt_XmTextField : XmIconGadget { arguments { XmNlabelString = wtXmTextFieldText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmTextFieldDetail; }; }; object wt_XmDrawnButton : XmIconGadget { arguments { XmNlabelString = wtXmDrawnButtonText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmDrawnButtonDetail; }; }; object wt_XmText : XmIconGadget { arguments { XmNlabelString = wtXmTextText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmTextDetail; }; }; object wt_XmSash : XmIconGadget { arguments { XmNlabelString = wtXmSashText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmSashDetail; }; }; object wt_XmLabel : XmIconGadget { arguments { XmNlabelString = wtXmLabelText; XmNentryParent = wt_XmPrimitive; XmNdetail = wtXmLabelDetail; }; }; object wt_XmToggleButton : XmIconGadget { arguments { XmNlabelString = wtXmToggleButtonText; XmNentryParent = wt_XmLabel; XmNdetail = wtXmToggleButtonDetail; }; }; object wt_XmCascadeButton : XmIconGadget { arguments { XmNlabelString = wtXmCascadeButtonText; XmNentryParent = wt_XmLabel; XmNdetail = wtXmCascadeButtonDetail; }; }; object wt_XmPushButton : XmIconGadget { arguments { XmNlabelString = wtXmPushButtonText; XmNentryParent = wt_XmLabel; XmNdetail = wtXmPushButtonDetail; }; }; object wt_XmTearOffButton : XmIconGadget { arguments { XmNlabelString = wtXmTearOffButtonText; XmNentryParent = wt_XmPushButton; XmNdetail = wtXmTearOffButtonDetail; }; }; object wt_XmGadget : XmIconGadget { arguments { XmNlabelString = wtXmGadgetText; XmNentryParent = wt_Rect; XmNdetail = wtXmGadgetDetail; }; }; object wt_XmArrowButtonGadget : XmIconGadget { arguments { XmNlabelString = wtXmArrowButtonGadgetText; XmNentryParent = wt_XmGadget; XmNdetail = wtXmArrowButtonGadgetDetail; }; }; object wt_XmSeparatorGadget : XmIconGadget { arguments { XmNlabelString = wtXmSeparatorGadgetText; XmNentryParent = wt_XmGadget; XmNdetail = wtXmSeparatorGadgetDetail; }; }; object wt_XmLabelGadget : XmIconGadget { arguments { XmNlabelString = wtXmLabelGadgetText; XmNentryParent = wt_XmGadget; XmNdetail = wtXmLabelGadgetDetail; }; }; object wt_XmPushButtonGadget : XmIconGadget { arguments { XmNlabelString = wtXmPushButtonGadgetText; XmNentryParent = wt_XmLabelGadget; XmNdetail = wtXmPushButtonGadgetDetail; }; }; object wt_XmToggleButtongadget : XmIconGadget { arguments { XmNlabelString = wtXmToggleButtongadgetText; XmNentryParent = wt_XmLabelGadget; XmNdetail = wtXmToggleButtongadgetDetail; }; }; object wt_XmCascadeButtonGadget : XmIconGadget { arguments { XmNlabelString = wtXmCascadeButtonGadgetText; XmNentryParent = wt_XmLabelGadget; XmNdetail = wtXmCascadeButtonGadgetDetail; }; }; object wt_XmIconGadget : XmIconGadget { arguments { XmNlabelString = wtXmIconGadgetText; XmNentryParent = wt_XmGadget; XmNdetail = wtXmIconGadgetDetail; }; }; object wt_XmIconHeader : XmIconGadget { arguments { XmNlabelString = wtXmIconHeaderText; XmNentryParent = wt_XmIconGadget; XmNdetail = wtXmIconHeaderDetail; }; }; object wt_XmDragIcon : XmIconGadget { arguments { XmNlabelString = wtXmDragIconText; XmNentryParent = wt_Object; XmNdetail = wtXmDragIconDetail; }; }; object wt_XmDropTransfer : XmIconGadget { arguments { XmNlabelString = wtXmDropTransferText; XmNentryParent = wt_Object; XmNdetail = wtXmDropTransferDetail; }; }; object wt_XmDropSiteManager : XmIconGadget { arguments { XmNlabelString = wtXmDropSiteManagerText; XmNentryParent = wt_Object; XmNdetail = wtXmDropSiteManagerDetail; }; }; ! ! Dialog widgets ! object templateDialog : XmTemplateDialog{ arguments { XmNokLabelString = templateOkText; XmNcancelLabelString = templateCancelText; XmNdialogTitle = templateTitleText; XmNautoUnmanage = false; }; controls { XmMenuBar templateMenuBar; XmScrolledText { arguments { XmNeditMode = XmMULTI_LINE_EDIT; XmNrows = 10; };}; XmPushButton { arguments { XmNlabelString = templateIncludeText; }; }; XmPushButton { arguments { XmNlabelString = templateDraftText; }; }; XmPushButton { arguments { XmNlabelString = templateSpellText; }; }; }; callbacks { XmNcancelCallback = procedure UnmanageCb("*templateDialog"); }; }; object templateMenuBar : XmMenuBar { arguments { }; controls { XmCascadeButton templateFileCascade; }; }; object templateFileCascade : XmCascadeButton { arguments { XmNlabelString = templateCascadeText; XmNmnemonic = keysym(templateCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton sendButton; XmPushButton includeButton; XmPushButton draftButton; XmPushButton spellButton; XmPushButton cancelButton; }; }; }; }; object sendButton : XmPushButton { arguments { XmNlabelString = templateOkText; XmNmnemonic = keysym(templateOkMnem); }; }; object includeButton : XmPushButton { arguments { XmNlabelString = templateIncludeText; XmNmnemonic = keysym(templateIncludeMnem); }; }; object draftButton : XmPushButton { arguments { XmNlabelString = templateDraftText; XmNmnemonic = keysym(templateDraftMnem); }; }; object spellButton : XmPushButton { arguments { XmNlabelString = templateSpellText; XmNmnemonic = keysym(templateSpellMnem); }; }; object cancelButton : XmPushButton { arguments { XmNlabelString = templateCancelText; XmNmnemonic = keysym(templateCancelMnem); }; callbacks { XmNactivateCallback = procedure UnmanageCb("*templateDialog"); }; }; object showDialog : XmInformationDialog { arguments { XmNdialogTitle = "Motif Release 2.3"; XmNcancelLabelString = "Enjoy!"; XmNmessageString = compound_string("Motif Release 2.3", separate = true) & compound_string("", separate = true) & compound_string("June 1994", separate = true) & compound_string("", separate = true) & compound_string("Dev: Vania, Ellis, Kamesh, Jim, Andrew, ") & compound_string("Daniel, David, Doug, Ingeborg, Scott, Steve")& compound_string("", separate = true) & compound_string("", separate = true) & compound_string("QA: Ramesh, Alka, Marianne, Pascale, ") & compound_string("Shobana, Ron, Yakov", separate = true) & compound_string("", separate = true) & compound_string("Doc: Ken, Barry, Bernice",separate = true) & compound_string("", separate = true) & compound_string("Rats: Marty",separate = true) & compound_string("", separate = true) & compound_string("Sys: Paul, Chauncy, Kevin, ") & compound_string("Weidong", separate = true) & compound_string("", separate = true) & compound_string("Ops: Cathy, Darrell", separate = true) & compound_string("", separate = true) & compound_string("Also starring: Beth, Lorraine", separate = true) & compound_string(""); }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object infoDialog : XmInformationDialog { arguments { XmNdialogTitle = informationTitleText; XmNmessageString = infoMessageText; XmNcancelLabelString = infoCancelText; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object warningDialog : XmWarningDialog { arguments { XmNdialogTitle = warningTitleText; XmNmessageString = warningMessageText; XmNokLabelString = warningOkText; XmNcancelLabelString = warningCancelText; }; controls { Xm_Help unmanaged { }; }; }; object errorDialog : XmErrorDialog { arguments { XmNdialogTitle = errorTitleText; XmNmessageString = errorMessageText; XmNokLabelString = errorOkText; XmNcancelLabelString = errorCancelText; }; controls { Xm_Help unmanaged { }; }; }; object questionDialog : XmQuestionDialog { arguments { XmNdialogTitle = questionTitleText; XmNmessageString = questionMessageText; XmNokLabelString = questionYesText; XmNcancelLabelString = questionNoText; }; controls { Xm_Help unmanaged { }; XmPushButton { arguments { XmNlabelString = questionMaybeText; }; }; }; }; object workingDialog : XmWorkingDialog { arguments { XmNcancelLabelString = workingCancelText; XmNdialogTitle = workingTitleText; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; Xm_Message unmanaged { }; XmScale { arguments { XmNorientation = XmHORIZONTAL; XmNshowValue = true; XmNtitleString = workingScaleText; }; }; }; }; object fileDialog : XmFileSelectionDialog { arguments { XmNautoUnmanage = true; XmNdialogTitle = fileTitleText; XmNselectionLabelString = fileSelectText; XmNlistLabelString = fileListText; XmNdirListLabelString = fileDirListText; XmNfileListLabelString = fileFileListText; XmNfilterLabelString = fileFilterLabelText; XmNnoMatchString = fileNoMatchText; XmNokLabelString = fileLoadText; XmNapplyLabelString = fileFilterText; XmNcancelLabelString = fileCancelText; XmNlistVisibleItemCount = 6; }; controls { Xm_Help unmanaged { }; unmanaged XmSeparator { }; ! First, a dummy work area child XmMenuBar fileMenuBar; XmPushButton { arguments { XmNlabelString = fileMergeText; }; }; XmPushButton { arguments { XmNlabelString = fileRemoveText; }; }; }; }; object fileMenuBar : XmMenuBar { arguments { }; controls { XmCascadeButton filterCascade; }; }; object filterCascade : XmCascadeButton { arguments { XmNlabelString = formatCascadeText; XmNmnemonic = keysym(formatCascadeMnem); }; controls { XmPulldownMenu { arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; }; controls { XmPushButton audioButton; XmPushButton graphicsButton; XmPushButton textButton; }; }; }; }; object audioButton : XmPushButton { arguments { XmNlabelString = audioButtonText; XmNmnemonic = keysym(audioButtonMnem); }; }; object graphicsButton : XmPushButton { arguments { XmNlabelString = graphicsButtonText; XmNmnemonic = keysym(graphicsButtonMnem); }; }; object textButton : XmPushButton { arguments { XmNlabelString = textButtonText; XmNmnemonic = keysym(textButtonMnem); }; }; object selectDialog : XmSelectionDialog { arguments { XmNdialogTitle = selectTitleText; XmNlistItems = greekAlphabet; XmNlistVisibleItemCount = 6; XmNselectionLabelString = selectSelectionText; XmNlistLabelString = selectListText; XmNokLabelString = selectOkText; XmNapplyLabelString = selectApplyText; XmNcancelLabelString = selectCancelText; }; controls { Xm_Help unmanaged { }; }; }; object promptDialog : XmPromptDialog { arguments { XmNdialogTitle = promptTitleText; XmNselectionLabelString = promptMessageText; XmNokLabelString = promptOkText; XmNcancelLabelString = promptCancelText; }; controls { Xm_Help unmanaged { }; }; }; ! Notebook Pages 3..10 ! XmForm swaps left/right based on layout direction, but not top/bottom. ! We want the button layout to be constant, so the visual matches the ! documentation of XmNlayoutDirection. list layoutLControls : controls { XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x0; XmNbottomPosition = x2; XmNlabelString = aText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x0; XmNbottomPosition = x2; XmNlabelString = bText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x2; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = cText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = dText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = eText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x6; XmNrightPosition = x8; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = fText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x2; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = gText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = hText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = iText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x6; XmNrightPosition = x8; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = jText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x6; XmNbottomPosition = x8; XmNlabelString = kText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x6; XmNbottomPosition = x8; XmNlabelString = lText; }; }; }; list layoutRControls : controls { XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x0; XmNbottomPosition = x2; XmNlabelString = aText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x0; XmNbottomPosition = x2; XmNlabelString = bText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x6; XmNrightPosition = x8; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = cText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = dText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = eText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x2; XmNtopPosition = x2; XmNbottomPosition = x4; XmNlabelString = fText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x6; XmNrightPosition = x8; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = gText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = hText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = iText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x0; XmNrightPosition = x2; XmNtopPosition = x4; XmNbottomPosition = x6; XmNlabelString = jText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x4; XmNrightPosition = x6; XmNtopPosition = x6; XmNbottomPosition = x8; XmNlabelString = kText; }; }; XmPushButton { arguments { arguments formArgs; XmNleftPosition = x2; XmNrightPosition = x4; XmNtopPosition = x6; XmNbottomPosition = x8; XmNlabelString = lText; }; }; }; object layoutLTForm : XmForm { arguments { XmNpageNumber = 3; XmNfractionBase = 40; XmNlayoutDirection = XmLEFT_TO_RIGHT_TOP_TO_BOTTOM; }; controls { controls layoutLControls; }; }; object layoutRTForm : XmForm { arguments { XmNpageNumber = 4; XmNfractionBase = 40; XmNlayoutDirection = XmRIGHT_TO_LEFT_TOP_TO_BOTTOM; }; controls { controls layoutRControls; }; }; object layoutTLForm : XmForm { arguments { XmNpageNumber = 5; XmNfractionBase = 40; XmNlayoutDirection = XmTOP_TO_BOTTOM_LEFT_TO_RIGHT; }; controls { controls layoutLControls; }; }; object layoutTRForm : XmForm { arguments { XmNpageNumber = 6; XmNfractionBase = 40; XmNlayoutDirection = XmTOP_TO_BOTTOM_RIGHT_TO_LEFT; }; controls { controls layoutRControls; }; }; object layoutBLForm : XmForm { arguments { XmNpageNumber = 7; XmNfractionBase = 40; XmNlayoutDirection = XmBOTTOM_TO_TOP_LEFT_TO_RIGHT; }; controls { controls layoutLControls; }; }; object layoutBRForm : XmForm { arguments { XmNpageNumber = 8; XmNfractionBase = 40; XmNlayoutDirection = XmBOTTOM_TO_TOP_RIGHT_TO_LEFT; }; controls { controls layoutRControls; }; }; object layoutLBForm : XmForm { arguments { XmNpageNumber = 9; XmNfractionBase = 40; XmNlayoutDirection = XmLEFT_TO_RIGHT_BOTTOM_TO_TOP; }; controls { controls layoutLControls; }; }; object layoutRBForm : XmForm { arguments { XmNpageNumber = 10; XmNfractionBase = 40; XmNlayoutDirection = XmRIGHT_TO_LEFT_BOTTOM_TO_TOP; }; controls { controls layoutRControls; }; }; ! Notebook Page 11 object toggleButtonPage : XmForm { arguments { XmNpageNumber = 11; XmNfractionBase = 40; }; controls { XmToggleButton toggleButtonExample; XmScrolledWindow toggleButtonControlWin; }; }; object toggleButtonExample : XmToggleButton { arguments { arguments formArgs; XmNleftPosition = 10; XmNrightPosition = 30; XmNtopPosition = 0; XmNbottomPosition = 10; XmNlabelString = toggleExampleText; XmNindicatorOn = XmINDICATOR_CHECK_BOX; XmNindicatorType = XmN_OF_MANY; XmNindicatorSize = 20; XmNtoggleMode = XmTOGGLE_BOOLEAN; XmNvisibleWhenOff = true; XmNfillOnSelect = true; XmNset = XmSET; XmNselectColor = XmDEFAULT_SELECT_COLOR; }; callbacks { XmNvalueChangedCallback = procedure ToggleValueChangedCb(); }; }; object toggleButtonControlWin : XmScrolledWindow { arguments { arguments formArgs; XmNleftPosition = 0; XmNleftOffset = 5; XmNrightPosition = 40; XmNrightOffset = 5; XmNtopPosition = 10; XmNbottomPosition = 40; XmNscrollBarDisplayPolicy = XmAS_NEEDED; XmNscrollingPolicy = XmAUTOMATIC; }; callbacks { XmNtraverseObscuredCallback = procedure ScrollVisibleCb(); }; controls { XmRowColumn toggleButtonControls; }; }; object toggleButtonControls : XmRowColumn { arguments { XmNnumColumns = 2; XmNpacking = XmPACK_COLUMN; XmNentryAlignment = XmALIGNMENT_END; }; controls { XmLabel toggleIndOnLabel; XmLabel toggleTogModeLabel; XmLabel toggleSetLabel; XmLabel toggleVizOffLabel; XmLabel toggleFillLabel; XmLabel toggleSelColorLabel; XmLabel toggleUnselColorLabel; XmLabel toggleIndTypeLabel; XmLabel toggleIndSizeLabel; XmComboBox toggleIndOnControl; XmComboBox toggleTogModeControl; XmComboBox toggleSetControl; XmComboBox toggleVizOffControl; XmComboBox toggleFillControl; XmComboBox toggleSelColorControl; XmComboBox toggleUnselColorControl; XmComboBox toggleIndTypeControl; XmComboBox toggleIndSizeControl; }; }; object toggleIndOnLabel : XmLabel { arguments { XmNlabelString = toggleIndOnText; }; }; object toggleIndOnControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = toggleCheckBoxItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 7; XmNitems = toggleIndOnItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(1); }; }; object toggleIndTypeLabel : XmLabel { arguments { XmNlabelString = toggleIndTypeText; }; }; object toggleIndTypeControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = toggleNofManyItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 4; XmNitems = toggleIndTypeItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(2); }; }; object toggleIndSizeLabel : XmLabel { arguments { XmNlabelString = toggleIndSizeText; }; }; object toggleIndSizeControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = toggle20Item; }; controls { Xm_List { arguments { XmNvisibleItemCount = 5; XmNitems = toggleIndSizeItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(3); }; }; object toggleTogModeLabel : XmLabel { arguments { XmNlabelString = toggleTogModeText; }; }; object toggleTogModeControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = toggleBooleanItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 2; XmNitems = toggleTogModeItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(4); }; }; object toggleVizOffLabel : XmLabel { arguments { XmNlabelString = toggleVizOffText; }; }; object toggleVizOffControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = toggleOnItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 2; XmNitems = toggleVizOffItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(8); }; }; object toggleSelColorLabel : XmLabel { arguments { XmNlabelString = toggleSelColorText; }; }; object toggleSelColorControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_COMBO_BOX; XmNselectedItem = toggleDefaultSelectItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 3; XmNitems = toggleSelColorItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(6); }; }; object toggleUnselColorLabel : XmLabel { arguments { XmNlabelString = toggleUnselColorText; }; }; object toggleUnselColorControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_COMBO_BOX; XmNselectedItem = toggleBackgroundItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 1; XmNitems = toggleUnselColorItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(9); }; }; object toggleFillLabel : XmLabel { arguments { XmNlabelString = toggleFillText; }; }; object toggleFillControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = toggleOnItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 2; XmNitems = toggleFillItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(7); }; }; object toggleSetLabel : XmLabel { arguments { XmNlabelString = toggleSetText; }; }; object toggleSetControl : XmComboBox { arguments { XmNpositionMode = XmONE_BASED; XmNarrowSize = 15; XmNcomboBoxType = XmDROP_DOWN_LIST; XmNselectedItem = toggleSetItem; }; controls { Xm_List { arguments { XmNvisibleItemCount = 3; XmNitems = toggleSetItems; }; }; }; callbacks { XmNselectionCallback = procedure ToggleControlCb(5); }; }; end module; motif-2.3.8/demos/programs/periodic/periodic.c0000644000175000017500000005474712672140200016277 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: periodic.c /main/8 1996/04/22 23:28:50 pascale $" #endif #endif /****************************************************************************** * periodic.c * * Copy and rename the file periodic.ad to Periodic in your home directory * or app-defaults directory, or merge it with your .Xdefaults file. * * It provides useful default values for Periodic fonts and colors * *****************************************************************************/ #include #include #include #include #include #include #include #include #include typedef struct _DrawData { GC gc; Position drawX; Position drawY; Dimension drawWidth; Dimension drawHeight; } DrawData; static GC GetGC( Widget w ); static void ConfigureDrawData( Widget w, DrawData *data ); static void DrawButton( Widget w ); static void DrawArea( Widget w ); static void PopupHandler( Widget w, Widget pw, XEvent *event, Boolean *ctd ); static void ManageCb( Widget w, XtPointer cd, XmContainerSelectCallbackStruct *cb ); static void UnmanageCb( Widget w, String id, XtPointer cb ); static void InitPopupCb( Widget w, String id, XtPointer cb ); static void PopdownCb( Widget w, XtPointer cd, XtPointer cb ); static void DaExposeCb( Widget w, XtPointer cd, XtPointer cb ); static void DaResizeCb( Widget w, XtPointer cd, XtPointer cb ); static void DbExposeCb( Widget w, XtPointer cd, XtPointer cb ); static void DbResizeCb( Widget w, XtPointer cd, XtPointer cb ); static void ScaleCb( Widget w, XtPointer cd, XtPointer cb ); static void SetScaleCb( Widget w, int *value, XmToggleButtonCallbackStruct *cb ); static void ViewCb( Widget w, XtPointer cd, XmToggleButtonCallbackStruct *cb ); static void LayoutCb( Widget w, XtPointer cd, XmToggleButtonCallbackStruct *cb ); static void ToggleLightsCb( Widget w, XtPointer cd, XmToggleButtonCallbackStruct *cb ); static void ShowCb( Widget w, String id, XtPointer cb ); static void ExitCb( Widget w, XtPointer cd, XtPointer cb ); static void ScrollVisibleCb( Widget w, XtPointer cd, XmTraverseObscuredCallbackStruct *cb ); static void ToggleControlCb( Widget w, XtPointer client_data, XmComboBoxCallbackStruct *cb ); static void ToggleValueChangedCb( Widget w, XtPointer client_data, XmToggleButtonCallbackStruct *cb ); static MrmHierarchy mrmId; static char *mrmFile[]={"periodic.uid"}; static MrmCode mrmClass; static MRMRegisterArg mrmNames[] = { {"InitPopupCb", (XtPointer)InitPopupCb }, {"PopdownCb", (XtPointer)PopdownCb }, {"UnmanageCb", (XtPointer)UnmanageCb }, {"ManageCb", (XtPointer)ManageCb }, {"DaExposeCb", (XtPointer)DaExposeCb }, {"DaResizeCb", (XtPointer)DaResizeCb }, {"DbExposeCb", (XtPointer)DbExposeCb }, {"DbResizeCb", (XtPointer)DbResizeCb }, {"ScaleCb", (XtPointer)ScaleCb }, {"SetScaleCb", (XtPointer)SetScaleCb }, {"ViewCb", (XtPointer)ViewCb }, {"LayoutCb", (XtPointer)LayoutCb }, {"ToggleLightsCb", (XtPointer)ToggleLightsCb }, {"ShowCb", (XtPointer)ShowCb }, {"ExitCb", (XtPointer)ExitCb }, {"ScrollVisibleCb", (XtPointer)ScrollVisibleCb }, {"ToggleValueChangedCb", (XtPointer)ToggleValueChangedCb }, {"ToggleControlCb", (XtPointer)ToggleControlCb } }; static String fallbackResources[] = { "*XmText.columns: 10", "*XmTextField.columns: 10", "*XmComboBox*columns: 8", "*scaleFrame*XmScale.width: 50", "*scrollFrame*XmScrollBar.width: 50", "*toggleButtonControls*Text.marginHeight: 1", "*toggleButtonControls.spacing: 0", "?.toolTipEnable: True", "?.toolTipPostDelay: 2000", "?.toolTipPostDuration: 5000", "?.TipShell.TipLabel.background: yellow", "*pushButton.toolTipString: A Tool Tip for all children of XmGadget and XmPrimitive", "*fontList: *-*-*-medium-r-*-*-*-100-*-*-p-*-*-*", "*HeaderDA*fontList: *-*-*-bold-r-*-*-*-100-*-*-p-*-*-*", "*titleLabel.fontList: *-*-*-bold-r-*-*-*-180-*-*-p-*-*-*", "*subtitleLabel.fontList: *-*-*-bold-r-*-*-*-140-*-*-p-*-*-*", "*labelLabel.fontList: *-*-*-bold-r-*-*-*-180-*-*-p-*-*-*", "*menuBar*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-*", "*popupMenu*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-*", "*XmMessageBox*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-*", "*fileDialog*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-*", "*selectDialog*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-*", "*promptDialog*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-*", "*toggleButtonExample*fontList: *-*-*-medium-r-*-*-*-140-*-*-p-*-*-*", "*toggleButtonControls*fontList: *-*-*-medium-r-*-*-*-100-*-*-p-*-*-*", "*toggleButtonPage*fontList: *-*-*-medium-r-*-*-*-100-*-*-p-*-*-*", NULL }; #define APP_NAME "periodic" #define APP_CLASS "XmdPeriodic" static XtAppContext appContext; static Widget shell; static unsigned setting_toggle = 0; int main(int argc, char *argv[] ) { Widget appMain; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); MrmInitialize (); shell = XtVaOpenApplication( &appContext, APP_CLASS, NULL, 0, &argc, argv, fallbackResources, sessionShellWidgetClass, NULL ); if (MrmOpenHierarchy (1, mrmFile, NULL, &mrmId) != MrmSUCCESS) exit(0); MrmRegisterNames(mrmNames, XtNumber(mrmNames)); MrmFetchWidget (mrmId, "appMain", shell, &appMain, &mrmClass); XtManageChild(appMain); XtRealizeWidget(shell); XtAppMainLoop(appContext); return 0; /* make compiler happy */ } static void ExitCb( Widget w, XtPointer cd, XtPointer cb ) { exit(0); } /***************************************************************** * * Display selected Dialog widget * *****************************************************************/ static void ManageCb( Widget w, XtPointer cd, XmContainerSelectCallbackStruct *cb ) { static Widget managedDialog = NULL; int i; for (i = 0; i < cb->selected_item_count; i++) { Widget dialog = NULL; char *name = XtName(cb->selected_items[i]); if ((managedDialog != NULL) && XtIsManaged(managedDialog)) { XtUnmanageChild(managedDialog); managedDialog = NULL; } if ((strlen(name) > 4) && strcmp(name + strlen(name) - 4, "Pick") == 0) { char buf[64]; buf[0] = '*'; strcpy(buf + 1, name); strcpy(buf + strlen(buf) - 4, "Dialog"); dialog = XtNameToWidget(shell, buf); if (dialog) { managedDialog = dialog; XtManageChild(dialog); } } } } static void UnmanageCb( Widget w, String id, XtPointer cb ) { XtUnmanageChild (XtNameToWidget (shell, id)); } static void ShowCb( Widget w, String id, XtPointer cb ) { static Widget tb = NULL; static Widget sc = NULL; int value; if (tb == NULL) tb = XtNameToWidget (shell, "*toggleButton"); if (sc == NULL) sc = XtNameToWidget (shell, "*valueScale"); XmScaleGetValue (sc, &value); if (XmToggleButtonGetState(tb) == True && value == 1020) XtManageChild (XtNameToWidget (shell, id)); } /***************************************************************** * * Provide RadioBox behavior inside a PulldownMenu * *****************************************************************/ static void ViewCb( Widget w, XtPointer cd, XmToggleButtonCallbackStruct *cb ) { static Widget viewToggle = NULL; if (cb->set) { if (viewToggle) XmToggleButtonSetState (viewToggle, False, False); viewToggle = w; } else { if (w == viewToggle) XmToggleButtonSetState (w, True, False); } } static void LayoutCb( Widget w, XtPointer cd, XmToggleButtonCallbackStruct *cb ) { static Widget layoutToggle = NULL; if (cb->set) { if (layoutToggle) XmToggleButtonSetState (layoutToggle, False, False); layoutToggle = w; } else { if (w == layoutToggle) XmToggleButtonSetState (w, True, False); } } /***************************************************************** * * PopupMenu support * *****************************************************************/ static Time popupLastEventTime = 0; static void InitPopupCb( Widget w, String id, XtPointer cb ) { Widget popupWindow = XtNameToWidget (shell, id); XtAddEventHandler (popupWindow, ButtonPressMask, False, (XtEventHandler)PopupHandler, (XtPointer)w); } static void PopupHandler ( Widget w, Widget pw, XEvent *event, Boolean *ctd ) { if (((XButtonEvent *)event)->button != Button3) return; if (((XButtonEvent *)event)->time <= popupLastEventTime) return; XmMenuPosition((Widget) pw, (XButtonEvent *)event); XtManageChild ((Widget) pw); } /* By default, cancelling a popup menu with Button 3 will cause the * popup to be reposted at the location of the cancelling click. * * To switch off this behavior, remember when the menu was popped down. * In PopupHandler, don't repost the menu if the posting click just * cancelled a popup menu. */ static void PopdownCb( Widget w, XtPointer cd, XtPointer cb ) { popupLastEventTime = XtLastTimestampProcessed (XtDisplayOfObject(w)); } /***************************************************************** * * Draw utilities * *****************************************************************/ static DrawData *drawData = NULL; static DrawData *buttonData = NULL; static GC GetGC( Widget w ) { Arg args[2]; XGCValues gcv; Pixel fg; Pixel bg; GC gc; XtSetArg (args[0], XmNforeground, &fg); XtSetArg (args[1], XmNbackground, &bg); XtGetValues (w, args, 2); gcv.foreground = fg; gcv.background = bg; gcv.line_width = 1; gc = XtGetGC (w, GCForeground | GCBackground | GCLineWidth, &gcv); return (gc); } static void ConfigureDrawData( Widget w, DrawData *data ) { Arg args[6]; Dimension width, height, st, ht, mw, mh; Dimension totalMarginWidth; Dimension totalMarginHeight; width = height = st = ht = mw = mh = 0; XtSetArg (args[0], XmNwidth, &width); XtSetArg (args[1], XmNheight, &height); XtSetArg (args[2], XmNshadowThickness, &st); XtSetArg (args[3], XmNhighlightThickness, &ht); XtSetArg (args[4], XmNmarginWidth, &mw); XtSetArg (args[5], XmNmarginHeight, &mh); XtGetValues (w, args, 6); totalMarginWidth = st + ht + mw; totalMarginHeight = st + ht + mh; if (2 * totalMarginWidth < width && 2 * totalMarginHeight < height) { data->drawX = totalMarginWidth; data->drawY = totalMarginHeight; data->drawWidth = width - 2 * totalMarginWidth; data->drawHeight = height - 2 * totalMarginHeight; } else { data->drawWidth = 0; data->drawHeight = 0; } } /***************************************************************** * * DrawingArea display code * *****************************************************************/ static void DaResizeCb( Widget w, XtPointer cd, XtPointer cb ) { if (drawData == NULL) return; ConfigureDrawData (w, drawData); XClearWindow (XtDisplayOfObject(w), XtWindowOfObject(w)); DrawArea (w); } static void DaExposeCb( Widget w, XtPointer cd, XtPointer cb ) { if (drawData == NULL) { drawData = (DrawData *)XtMalloc (sizeof(DrawData)); drawData->gc = GetGC (w); ConfigureDrawData (w, drawData); } DrawArea(w); } #define NPOINTS 40 static void DrawArea( Widget w ) { int i, x, y, m; XPoint p[NPOINTS]; if (drawData->drawWidth == 0) return; XClearArea (XtDisplayOfObject(w), XtWindowOfObject(w), drawData->drawX, drawData->drawY, drawData->drawWidth, drawData->drawHeight, False); XDrawRectangle (XtDisplayOfObject(w), XtWindowOfObject(w), drawData->gc, drawData->drawX, drawData->drawY, drawData->drawWidth, drawData->drawHeight); XDrawLine (XtDisplayOfObject(w), XtWindowOfObject(w), drawData->gc, drawData->drawX, drawData->drawY + drawData->drawHeight/2, drawData->drawX + drawData->drawWidth, drawData->drawY + drawData->drawHeight/2); m = 20 * drawData->drawHeight / 100; p[0].x = drawData->drawX; p[0].y = drawData->drawY + drawData->drawHeight/2; for (i = 1; i < NPOINTS-1; i++) { p[i].x = drawData->drawX + (i * drawData->drawWidth)/NPOINTS; p[i].y = drawData->drawY + m/2 + (rand() % (drawData->drawHeight - m)); } p[NPOINTS-1].x = drawData->drawX + drawData->drawWidth; p[NPOINTS-1].y = drawData->drawY + drawData->drawHeight/2; XDrawLines (XtDisplayOfObject(w), XtWindowOfObject(w), drawData->gc, p, NPOINTS, CoordModeOrigin); } static void ScaleCb( Widget w, XtPointer cd, XtPointer cb ) { static Widget da = NULL; if (drawData == NULL) return; if (da == NULL) da = XtNameToWidget (shell, "*drawArea"); DrawArea (da); } static void SetScaleCb( Widget w, int *value, XmToggleButtonCallbackStruct *cb ) { static Widget da = NULL; static Widget sc = NULL; if (drawData == NULL) return; /* CR 9647: ignore calls that unset the toggle. */ if (! cb->set) return; if (da == NULL) da = XtNameToWidget (shell, "*drawArea"); if (sc == NULL) sc = XtNameToWidget (shell, "*valueScale"); XmScaleSetValue (sc, *value); DrawArea (da); } /***************************************************************** * * DrawnButton display code * *****************************************************************/ static Boolean lightsOn = False; static void DbResizeCb( Widget w, XtPointer cd, XtPointer cb ) { if (buttonData == NULL) return; ConfigureDrawData (w, buttonData); XClearArea (XtDisplayOfObject(w), XtWindowOfObject(w), buttonData->drawX, buttonData->drawY, buttonData->drawWidth, buttonData->drawHeight, False); DrawButton (w); } static void DbExposeCb( Widget w, XtPointer cd, XtPointer cb ) { if (buttonData == NULL) { buttonData = (DrawData *)XtMalloc (sizeof(DrawData)); buttonData->gc = GetGC (w); ConfigureDrawData (w, buttonData); } DrawButton(w); } #define NARCS 6 static void DrawButton( Widget w ) { int i, x, y, incX, incY; XArc a[NARCS]; if (buttonData->drawWidth == 0 || !lightsOn) return; a[0].x = buttonData->drawX + (buttonData->drawWidth - 1)/2; a[0].y = buttonData->drawY + (buttonData->drawHeight - 1)/2; a[0].width = 1; a[0].height = 1; a[0].angle1 = 0; a[0].angle2 = 360*64; incX = (buttonData->drawWidth - 1)/(2 * NARCS); incY = (buttonData->drawHeight - 1)/(2 * NARCS); for (i = 1; i < NARCS; i++) { a[i].x = a[i-1].x - incX; a[i].y = a[i-1].y - incY; a[i].width = a[i-1].width + 2 * incX; a[i].height = a[i-1].height + 2 * incY; #ifndef BROKEN_SERVER_ARCS a[i].angle1 = 0; a[i].angle2 = 360 * 64; #else XDrawRectangle (XtDisplayOfObject(w), XtWindowOfObject(w), buttonData->gc, a[i].x, a[i].y, a[i].width, a[i].height); #endif } #ifndef BROKEN_SERVER_ARCS XDrawArcs (XtDisplayOfObject(w), XtWindowOfObject(w), buttonData->gc, a, NARCS); #endif } static void ToggleLightsCb( Widget w, XtPointer cd, XmToggleButtonCallbackStruct *cb ) { static Widget db = NULL; if (buttonData == NULL) return; if (db == NULL) db = XtNameToWidget (shell, "*drawnButton"); lightsOn = cb->set; if (lightsOn) DrawButton (db); else XClearArea (XtDisplayOfObject(db), XtWindowOfObject(db), buttonData->drawX, buttonData->drawY, buttonData->drawWidth, buttonData->drawHeight, False); } /***************************************************************** * * TraverseObscured callback * *****************************************************************/ static void ScrollVisibleCb( Widget w, XtPointer cd, XmTraverseObscuredCallbackStruct *cb ) { Widget target = cb->traversal_destination; Widget parent = XtParent(target); XmScrollVisible(w, (XmIsComboBox(parent) ? parent : target), 0, 0); } /***************************************************************** * * Toggle value changed callback * *****************************************************************/ static void ToggleValueChangedCb(Widget w, XtPointer client_data, XmToggleButtonCallbackStruct *cb) { if (! setting_toggle++) { Widget toggle_set = XtNameToWidget(XtParent(w), "*toggleSetControl"); XtVaSetValues(toggle_set, XmNselectedPosition, cb->set + 1, NULL); } --setting_toggle; } /***************************************************************** * * Toggle controls callback * *****************************************************************/ /* Resource lists for ToggleControlCb(). */ static unsigned char toggle_ind_on[] = { XmINDICATOR_NONE, XmINDICATOR_FILL, XmINDICATOR_BOX, XmINDICATOR_CHECK, XmINDICATOR_CHECK_BOX, XmINDICATOR_CROSS, XmINDICATOR_CROSS_BOX }; static unsigned char toggle_ind_type[] = { XmN_OF_MANY, XmONE_OF_MANY, XmONE_OF_MANY_ROUND, XmONE_OF_MANY_DIAMOND }; static Dimension toggle_ind_size[] = { 10, 15, 20, 25, 30 }; static unsigned char toggle_toggle_mode[] = { XmTOGGLE_BOOLEAN, XmTOGGLE_INDETERMINATE }; static unsigned char toggle_set[] = { XmUNSET, XmSET, XmINDETERMINATE }; static Pixel toggle_select_color[] = { XmDEFAULT_SELECT_COLOR, XmREVERSED_GROUND_COLORS, XmHIGHLIGHT_COLOR }; static Pixel toggle_unselect_color[] = { XmUNSPECIFIED_PIXEL /* initialized dynamically */ }; static Boolean toggle_boolean[] = { True, False }; #define RESET_VALUE(w, list, value) \ { \ int pos; \ for (pos = 0; pos < XtNumber(list); pos++) \ if (list[pos] == value) \ { \ XtVaSetValues(w, XmNselectedPosition, pos + 1, NULL); \ break; \ } \ } static Boolean get_color(Widget widget, XmString name, char *res_type, Pixel *value) { Boolean result = False; char *text; if (XmStringGetLtoR(name, XmFONTLIST_DEFAULT_TAG, &text)) { XrmValue from, to; from.size = sizeof(char*); from.addr = (XPointer)text; to.size = sizeof(Pixel); to.addr = (XPointer)value; result = XtConvertAndStore(widget, XmRString, &from, res_type, &to); XtFree(text); } return result; } static void ToggleControlCb(Widget w, XtPointer client_data, XmComboBoxCallbackStruct *cb) { static Widget tw = NULL; static Widget ind_type_wid, tog_mode_wid, set_wid; int item = cb->item_position - 1; int control = *(int *)client_data; unsigned char uchar_value; if (tw == NULL) { tw = XtNameToWidget(shell, "*toggleButtonExample"); ind_type_wid = XtNameToWidget(XtParent(tw), "*toggleIndTypeControl"); tog_mode_wid = XtNameToWidget(XtParent(tw), "*toggleTogModeControl"); set_wid = XtNameToWidget(XtParent(tw), "*toggleSetControl"); XtVaGetValues(tw, XmNbackground, &toggle_unselect_color[0], NULL); } if (! setting_toggle++) { switch (control) { case 1: XtVaSetValues(tw, XmNindicatorOn, toggle_ind_on[item], NULL); break; case 2: XtVaSetValues(tw, XmNindicatorType, toggle_ind_type[item], NULL); XtVaGetValues(tw, XmNindicatorType, &uchar_value, NULL); if (uchar_value != toggle_ind_type[item]) RESET_VALUE(ind_type_wid, toggle_ind_type, uchar_value); if (uchar_value != XmN_OF_MANY) { unsigned char toggle_mode, set; XtVaGetValues(tw, XmNtoggleMode, &toggle_mode, XmNset, &set, NULL); RESET_VALUE(tog_mode_wid, toggle_toggle_mode, toggle_mode); RESET_VALUE(set_wid, toggle_set, set); } break; case 3: XtVaSetValues(tw, XmNindicatorSize, toggle_ind_size[item], NULL); break; case 4: XtVaSetValues(tw, XmNtoggleMode, toggle_toggle_mode[item], NULL); XtVaGetValues(tw, XmNtoggleMode, &uchar_value, NULL); if (uchar_value != toggle_toggle_mode[item]) RESET_VALUE(tog_mode_wid, toggle_toggle_mode, uchar_value); if (uchar_value != XmTOGGLE_INDETERMINATE) { XtVaGetValues(tw, XmNset, &uchar_value, NULL); RESET_VALUE(set_wid, toggle_set, uchar_value); } break; case 5: XtVaSetValues(tw, XmNset, toggle_set[item], NULL); XtVaGetValues(tw, XmNset, &uchar_value, NULL); if (uchar_value != toggle_set[item]) RESET_VALUE(set_wid, toggle_set, uchar_value); break; case 6: if (item >= 0) XtVaSetValues(tw, XmNselectColor, toggle_select_color[item], NULL); else { Pixel color; if (get_color(tw, cb->item_or_text, XmRSelectColor, &color)) XtVaSetValues(tw, XmNselectColor, color, NULL); else XBell(XtDisplayOfObject(tw), 0); } break; case 7: XtVaSetValues(tw, XmNfillOnSelect, toggle_boolean[item], NULL); break; case 8: XtVaSetValues(tw, XmNvisibleWhenOff, toggle_boolean[item], NULL); break; case 9: if (item >= 0) XtVaSetValues(tw, XmNunselectColor, toggle_unselect_color[item], NULL); else { Pixel color; if (get_color(tw, cb->item_or_text, XmRPixel, &color)) XtVaSetValues(tw, XmNunselectColor, color, NULL); else XBell(XtDisplayOfObject(tw), 0); } break; } } --setting_toggle; } motif-2.3.8/demos/programs/periodic/README0000644000175000017500000000170212672140200015174 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:07:11 drk $ */ README for The Periodic Table of Motif Widgets PERIODIC v2.0 ------------- This directory contains the sources for periodic. Periodic is a demo of the displayable widgets in Motif. Periodic presents many Motif widgets for your visual and sensual enjoyment. The resources in the file Periodic.ad should be used. Either merge the file with your .Xdefaults, or copy it to your home directory and rename it to 'Periodic' - it will then be used as the application defaults file. Ignore the color resources if you are displaying on a monochrome server. If the fonts do not exist on your server, change the resource to use a font of similar size. This is a rewrite of the previous version that was shipped with earlier releases of Motif. The original version of Periodic can be found in ../../tests/Performance/Expose/. Enjoy, Michael K. Yee Alastair Gourlay motif-2.3.8/demos/programs/periodic/periodic_l.uil0000644000175000017500000006033212672140200017144 00000000000000! $XConsortium: periodic_l.uil /main/7 1996/10/30 10:16:28 cde-osf $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY value quarks : string_table ("up", "down", "charm", "strange", "top", "bottom"); hebrewAText : "aleph"; hebrewAlphabet : string_table ( "aleph", "beth", "gimel", "daleth", "he", "vav", "zayin", "heth", "teth", "yodh", "kaph", "lamedh", "mem", "nun", "samekh", "ayin", "pe", "sadhe", "qoph", "resh", "sin", "shin", "tav"); greekAlphabet : string_table ( "alpha", "beta", "gamma", "delta", "epsilon", "zeta", "eta", "theta", "iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega"); ! Main Window ! File menu fileCascadeText : "File"; fileCascadeMnem : "F"; newButtonText : "New"; newButtonMnem : "N"; openButtonText : "Open..."; openButtonMnem : "O"; saveButtonText : "Save"; saveButtonMnem : "S"; saveAsButtonText : "Save As..."; saveAsButtonMnem : "A"; printButtonText : "Print"; printButtonMnem : "P"; exitButtonText : "Exit"; exitButtonMnem : "E"; ! Edit menu editCascadeText : "Edit"; editCascadeMnem : "E"; undoButtonText : "Undo"; undoButtonMnem : "U"; cutButtonText : "Cut"; cutButtonMnem : "t"; copyButtonText : "Copy"; copyButtonMnem : "C"; pasteButtonText : "Paste"; pasteButtonMnem : "P"; clearButtonText : "Clear"; clearButtonMnem : "e"; deleteButtonText : "Delete"; deleteButtonMnem : "D"; ! View menu viewCascadeText : "View"; viewCascadeMnem : "V"; stackButtonText : "Stack"; stackButtonMnem : "S"; tileButtonText : "Tile"; tileButtonMnem : "T"; dayButtonText : "Day"; dayButtonMnem : "D"; weekButtonText : "Week"; weekButtonMnem : "W"; monthButtonText : "Month"; monthButtonMnem : "M"; yearButtonText : "Year"; yearButtonMnem : "Y"; ! Options menu optionsCascadeText : "Options"; optionsCascadeMnem : "O"; fontCascadeText : "Font"; fontCascadeMnem : "F"; smallFontButtonText : "Small"; smallFontButtonMnem : "S"; mediumFontButtonText : "Medium"; mediumFontButtonMnem : "M"; largeFontButtonText : "Large"; largeFontButtonMnem : "L"; directCascadeText : "Direction"; directCascadeMnem : "D"; upButtonText : "Up"; upButtonMnem : "U"; downButtonText : "Down"; downButtonMnem : "D"; leftButtonText : "Left"; leftButtonMnem : "L"; rightButtonText : "Right"; rightButtonMnem : "R"; caseButtonText : "Case Sensitive"; caseButtonMnem : "C"; wrapButtonText : "Word Wrap"; wrapButtonMnem : "W"; ! Help menu helpCascadeText : "Help"; helpCascadeMnem : "H"; contextButtonText : "On Context"; contextButtonMnem : "C"; windowButtonText : "On Window"; windowButtonMnem : "W"; tutorButtonText : "Tutorial"; tutorButtonMnem : "T"; versionButtonText : "On Version"; versionButtonMnem : "V"; ! periodic title titleLabelText : "The Periodic Table of Motif Widgets"; subtitleLabelText : "The Open Group"; ! widget names separatorFrameText : "Separator"; arrowFrameText : "ArrowButton"; pushFrameText : "PushButton"; toggleFrameText : "ToggleButton"; labelFrameText : "Label"; optionFrameText : "OptionMenu"; scaleFrameText : "Scale"; radioFrameText : "RadioBox"; textFrameText : "Text"; scrollFrameText : "ScrollBar"; listFrameText : "ScrolledList"; comboBoxFrameText : "ComboBox"; paneFrameText : "PanedWindow"; popupFrameText : "PopupMenu"; drawFrameText : "DrawingArea"; drawBtnFrameText : "DrawnButton"; spinBoxFrameText : "SpinBox"; commandFrameText : "Command"; notebookFrameText : "Notebook"; dialogText : "Dialogs"; templateTitleText : "TemplateDialog"; warningTitleText : "WarningDialog"; workingTitleText : "WorkingDialog"; informationTitleText : "InformationDialog"; questionTitleText : "QuestionDialog"; errorTitleText : "ErrorDialog"; fileTitleText : "FileSelectionDialog"; selectTitleText : "SelectionDialog"; promptTitleText : "PromptDialog"; ! widget text pushButtonText : compound_string("Start", separate = true) & compound_string("Filming"); toggleButtonText : "Lights"; labelText : compound_string("DON'T", separate = true) & compound_string("PANIC"); scaleTitleText : "MHz"; scaleMinimum : 885; scaleMaximum : 1079; scaleValue : 1017; radio1Text : "WFNX"; radio1Value : 1017; radio2Text : "WJUL"; radio2Value : 915; radio3Text : "WGBH"; radio3Value : 897; pane1Text : "The Open Group"; pane2Text : "Motif Release 2.3\n"; popupWindowText : compound_string ("Press", separate = true) & compound_string ("Button 3", separate = true) & compound_string ("for", separate = true) & compound_string ("Menu"); popupTitleText : "Edit Menu"; popupUndoText : "Undo"; popupUndoMnem : "U"; popupCutText : "Cut"; popupCutMnem : "t"; popupCopyText : "Copy"; popupCopyMnem : "C"; popupPasteText : "Paste"; popupPasteMnem : "P"; popupClearText : "Clear"; popupClearMnem : "e"; popupDeleteText : "Delete"; popupDeleteMnem : "D"; commandPromptText : "periodic >"; templatePickText : "Template"; infoPickText : "Information"; warningPickText : "Warning"; errorPickText : "Error"; questionPickText : "Question"; workingPickText : "Working"; filePickText : "FileSelection"; selectPickText : "Selection"; promptPickText : "Prompt"; ! option menu optionMenuText : "Day"; optionMenuMnem : "D"; sundayButtonText : "Sunday"; sundayButtonMnem : "S"; mondayButtonText : "Monday"; mondayButtonMnem : "M"; tuesdayButtonText : "Tuesday"; tuesdayButtonMnem : "T"; wednesdayButtonText : "Wednesday"; wednesdayButtonMnem : "W"; thursdayButtonText : "Thursday"; thursdayButtonMnem : "h"; fridayButtonText : "Friday"; fridayButtonMnem : "F"; saturdayButtonText : "Saturday"; saturdayButtonMnem : "a"; ! Template dialog templateCascadeText : "File"; templateCascadeMnem : "F"; templateOkText : "Send"; templateOkMnem : "S"; templateCancelText : "Cancel"; templateCancelMnem : "C"; templateIncludeText : "Include..."; templateIncludeMnem : "I"; templateDraftText : "Draft"; templateDraftMnem : "D"; templateSpellText : "Spell"; templateSpellMnem : "p"; templatePixmap : icon(" ", " *********************** ", " * * ", " * *** * ", " * * ", " * * * * * * * * * * * * ", " * * ", " * ***************** * * ", " * * * * ", " * * * * * ", " * * * * * ", " * * * * * ", " * * * * * ", " * * * * * ", " * * * * * ", " * ***************** * ", " * * * ", " * * ************* * * ", " * * ", " * * ", " * *** *** *** *** *** * ", " * *** *** *** *** *** * ", " * * ", " *********************** ", " "); ! Information dialog infoCancelText : "Dismiss"; infoMessageText : compound_string("Congratulations!", separate = true) & compound_string("Bandwidth grab successful.", separate = true) & compound_string("", separate = true) & compound_string("Continue oscillation."); infoPixmap : icon(" ", " ", " **** ", " * * * ", " ** * ", " * * * ", " * * ", " ", " ", " ****** ", " * * * ", " *** * ", " * * ", " ** * ", " * * ", " ** * ", " * * ", " ** * ", " * * ", " ** * ", " *** * ** ", " ** * * * ", " * * * * ", " ", " "); ! Warning dialog warningOkText : "Proceed"; warningCancelText : "Cancel"; warningMessageText : compound_string("Warning, Warning,", separate = true) & compound_string("Danger Will Robinson..."); warningPixmap : icon(" ", " ", " ", " ** ", " ** * ", " ** * * ", " * * * ", " ** * * ", " * * * ", " ** * * ", " ** * ", " * * ", " ** * ", " * * ", " ** * ", " * * ", " ", " ", " **** ", " * * ", " ** * ", " * * ", " ", " ", " "); ! Error dialog errorOkText : "Retry"; errorCancelText : "Cancel"; errorMessageText : compound_string("Frontal lobe seek error!", separate = true) & compound_string("Intellect not installed."); errorPixmap : icon(" ", " ", " ", " ", " ****** ", " **** * *** ", " ** * * * * * ", " ** * * * ", " ** * * * * ", " * * * * * * ", " ** * * ** ", " * * * * * * ", " ** * * ** ", " * * * * * * ", " ** * * ** ", " * * * *** * ", " * * * * * ", " * * ** * ", " * ******* * ", " * * * * * ", " * * * * ", " ", " ", " ", " "); ! Question dialog questionYesText : "Yes"; questionMaybeText : "Maybe"; questionNoText : "No"; questionMessageText : compound_string("This is Motif 2.3.", separate = true) & compound_string("", separate = true) & compound_string("Any questions ?"); questionPixmap : icon(" ", " ", " ********** ", " ** * * * * * ", " ** * * * * * * ", " ** * ******* * * ", " * * ********* * * ", " ** *********** * ", " * * *** * *** * * ", " ** ***** ***** * * ", " * * *** * *** * * * ", " ** * * * ***** * * * ", " * * * * ***** * **** ", " ** * * ***** * * ", " ** * ***** * * * ", " ** * *** * * * ", " ** ***** * * ", " ** * * * * * ", " * * * * * * ", " ** *** * ", " * ***** * ", " ** *** * ", " ** * * * * ", " * * * * * * ", " "); ! Working dialog workingCancelText : "Abort"; workingScaleText : "Percent Complete"; workingPixmap : icon(" ", " ", " ******************* ", " * * * * * * * * * * ", " * * * * * * ** ", " ** ** * * * * ", " * * * * * * ** ", " ** ** * * * * ", " * ** * * ** ", " ** * * * * * ", " * * * * ** ", " ** * * * ", " * ** ** ", " ** ** * * ", " * ** * * ** ", " ** ** * * * * ", " * * * * * * ** ", " ** ** * * * * ", " * * * * * * ** ", " ** ** * * * * ", " * * * * * * ** ", " ******************* ", " ** * * * * * * * * ", " ", " "); ! File Selection dialog fileSelectText : "Selection"; fileListText : "List"; fileLoadText : "Load"; fileDirListText : "Directories"; fileFileListText : "Files"; fileFilterLabelText : "Filter"; fileNoMatchText : " [ ] "; fileFilterText : "Filter"; fileCancelText : "Cancel"; fileMergeText : "Merge"; fileRemoveText : "Remove"; filePixmap : icon(" ", " **************** ", " *** * * * * * *** ", " ** *** ", " * ****** **** ", " ** * * * ** ***** ", " * * * * * ** ****** ", " ** * * * * * ", " * *** * * ** ", " ** * * * ", " * * * ** ", " ** * * * ", " * * * ** ", " ** * * * ", " * * * ** ", " ** *** * ", " * ** ", " ** * ", " * *** ** ", " ** * * * ", " * *** ** ", " ** * ", " ********************* ", " ** * * * * * * * * * ", " "); formatCascadeText : "Format"; formatCascadeMnem : "F"; audioButtonText : "Audio"; audioButtonMnem : "A"; graphicsButtonText : "Graphics"; graphicsButtonMnem : "G"; textButtonText : "Text"; textButtonMnem : "T"; ! Selection dialog selectSelectionText : "Selection"; selectListText : "Items"; selectOkText : "Ok"; selectApplyText : "Apply"; selectCancelText : "Cancel"; selectPixmap : icon(" ", " *********************** ", " * * ", " * * ", " * ***************** * * ", " * * * * ", " * * ** * * * ", " * * **** * * * ", " * * *** * * * ", " * * ***** * * * ", " * * **** * * * ", " * * * * ", " * ***************** * * ", " * * ", " * ******************* * ", " * * * * ", " * ******************* * ", " * * ", " * * * * * * * * * * * * ", " * * ", " * ***** ***** ***** * ", " * ***** ***** ***** * ", " * * ", " *********************** ", " "); ! Prompt dialog promptOkText : "Ok"; promptCancelText : "Cancel"; promptMessageText : "Name, please?"; promptPixmap : icon(" ", " ", " ", " ", " ******************* ", " * * ", " * * ", " * *************** * ", " * * * * ", " * * * * ", " * * * * ", " * * * * ", " * *************** * ", " * * ", " * * * * * * * * * * ", " * * ", " * ***** ***** * ", " * ***** ***** * ", " * * ", " ******************* ", " ", " ", " ", " ", " "); ! Widgets container (page 2 of the notebook) notebookWidgetsText : "Widgets"; notebookWidgetsHeaders : string_table("Widget", "Xt/Xm ", "SLOC "); wtObjectText : "Object"; wtObjectDetail : string_table(" Xt", " 355"); wtRectText : "Rect"; wtRectDetail : string_table(" Xt", " 311"); wtCoreText : "Core"; wtCoreDetail : string_table(" Xt", " 551"); wtCompositeText : "Composite"; wtCompositeDetail : string_table(" Xt", " 365"); wtConstraintText : "Constraint"; wtConstraintDetail : string_table(" Xt", " 133"); wtXmManagerText : "XmManager"; wtXmManagerDetail : string_table(" Xm", " 3250"); wtXmDrawingAreaText : "XmDrawingArea"; wtXmDrawingAreaDetail : string_table(" Xm", " 117"); wtXmFrameText : "XmFrame"; wtXmFrameDetail : string_table(" Xm", " 1785"); wtXmRowColumnText : "XmRowColumn"; wtXmRowColumnDetail : string_table(" Xm", " 5732"); wtXmPanedWindowText : "XmPanedWindow"; wtXmPanedWindowDetail : string_table(" Xm", " 3174"); wtXmScaleText : "XmScale"; wtXmScaleDetail : string_table(" Xm", " 4090"); wtXmComboBoxText : "XmComboBox"; wtXmComboBoxDetail : string_table(" Xm", " 4135"); wtXmContainerText : "XmContainer"; wtXmContainerDetail : string_table(" Xm", "11208"); wtXmNotebookText : "XmNotebook"; wtXmNotebookDetail : string_table(" Xm", " 7894"); wtXmSpinBoxText : "XmSpinBox"; wtXmSpinBoxDetail : string_table(" Xm", " 3302"); wtXmScrolledWindowText : "XmScrolledWindow"; wtXmScrolledWindowDetail : string_table(" Xm", " 4532"); wtXmMainWindowText : "XmMainWindow"; wtXmMainWindowDetail : string_table(" Xm", " 1819"); wtXmBulletinBoardText : "XmBulletinBoard"; wtXmBulletinBoardDetail : string_table(" Xm", " 3062"); wtXmFormText : "XmForm"; wtXmFormDetail : string_table(" Xm", " 3925"); wtXmMessageBoxText : "XmMessageBox"; wtXmMessageBoxDetail : string_table(" Xm", " 2211"); wtXmSelectionBoxText : "XmSelectionBox"; wtXmSelectionBoxDetail : string_table(" Xm", " 3005"); wtXmFileSelectionBoxText : "XmFileSelectionBox"; wtXmFileSelectionBoxDetail : string_table(" Xm", " 4371"); wtXmCommandText : "XmCommand"; wtXmCommandDetail : string_table(" Xm", " 1403"); wtShellText : "Shell"; wtShellDetail : string_table(" Xt", " 2904"); wtWMShellText : "WMShell"; wtWMShellDetail : string_table(" Xt", " 2904"); wtVendorShellText : "VendorShell"; wtVendorShellDetail : string_table(" Xt", " 221"); wtXmGrabShellText : "XmGrabShell"; wtXmGrabShellDetail : string_table(" Xm", " 1139"); wtXmDragOverShellText : "XmDragOverShell"; wtXmDragOverShellDetail : string_table(" Xm", " 4106"); wtTransientShellText : "TransientShell"; wtTransientShellDetail : string_table(" Xt", " 2904"); wtXmDialogShellText : "XmDialogShell"; wtXmDialogShellDetail : string_table(" Xm", " 1624"); wtTopLevelShellText : "TopLevelShell"; wtTopLevelShellDetail : string_table(" Xt", " 2904"); wtApplicationShellText : "ApplicationShell"; wtApplicationShellDetail : string_table(" Xt", " 2904"); wtXmDisplayText : "XmDisplay"; wtXmDisplayDetail : string_table(" Xm", " 1734"); wtOverrideShellText : "OverrideShell"; wtOverrideShellDetail : string_table(" Xt", " 2904"); wtXmMenuShellText : "XmMenuShell"; wtXmMenuShellDetail : string_table(" Xm", " 3098"); wtXmScreenText : "XmScreen"; wtXmScreenDetail : string_table(" Xm", " 2218"); wtXmDragContextText : "XmDragContext"; wtXmDragContextDetail : string_table(" Xm", " 4588"); wtXmPrimitiveText : "XmPrimitive"; wtXmPrimitiveDetail : string_table(" Xm", " 2241"); wtXmScrollBarText : "XmScrollBar"; wtXmScrollBarDetail : string_table(" Xm", " 5513"); wtXmArrowButtonText : "XmArrowButton"; wtXmArrowButtonDetail : string_table(" Xm", " 1290"); wtXmListText : "XmList"; wtXmListDetail : string_table(" Xm", "11987"); wtXmSeparatorText : "XmSeparator"; wtXmSeparatorDetail : string_table(" Xm", " 836"); wtXmTextFieldText : "XmTextField"; wtXmTextFieldDetail : string_table(" Xm", "11868"); wtXmDrawnButtonText : "XmDrawnButton"; wtXmDrawnButtonDetail : string_table(" Xm", " 1603"); wtXmTextText : "XmText"; wtXmTextDetail : string_table(" Xm", " 5053"); wtXmSashText : "XmSash"; wtXmSashDetail : string_table(" Xm", " 726"); wtXmLabelText : "XmLabel"; wtXmLabelDetail : string_table(" Xm", " 3721"); wtXmToggleButtonText : "XmToggleButton"; wtXmToggleButtonDetail : string_table(" Xm", " 4267"); wtXmCascadeButtonText : "XmCascadeButton"; wtXmCascadeButtonDetail : string_table(" Xm", " 2861"); wtXmPushButtonText : "XmPushButton"; wtXmPushButtonDetail : string_table(" Xm", " 3738"); wtXmTearOffButtonText : "XmTearOffButton"; wtXmTearOffButtonDetail : string_table(" Xm", " 759"); wtXmGadgetText : "XmGadget"; wtXmGadgetDetail : string_table(" Xm", " 1910"); wtXmArrowButtonGadgetText : "XmArrowButtonGadget"; wtXmArrowButtonGadgetDetail : string_table(" Xm", " 2023"); wtXmSeparatorGadgetText : "XmSeparatorGadget"; wtXmSeparatorGadgetDetail : string_table(" Xm", " 2293"); wtXmLabelGadgetText : "XmLabelGadget"; wtXmLabelGadgetDetail : string_table(" Xm", " 5002"); wtXmPushButtonGadgetText : "XmPushButtonGadget"; wtXmPushButtonGadgetDetail : string_table(" Xm", " 4429"); wtXmToggleButtongadgetText : "XmToggleButtongadget"; wtXmToggleButtongadgetDetail : string_table(" Xm", " 5427"); wtXmCascadeButtonGadgetText : "XmCascadeButtonGadget"; wtXmCascadeButtonGadgetDetail : string_table(" Xm", " 3722"); wtXmIconGadgetText : "XmIconGadget"; wtXmIconGadgetDetail : string_table(" Xm", " 4410"); wtXmIconHeaderText : "XmIconHeader"; wtXmIconHeaderDetail : string_table(" Xm", " 355"); wtXmDragIconText : "XmDragIcon"; wtXmDragIconDetail : string_table(" Xm", " 1706"); wtXmDropTransferText : "XmDropTransfer"; wtXmDropTransferDetail : string_table(" Xm", " 898"); wtXmDropSiteManagerText : "XmDropSiteManager"; wtXmDropSiteManagerDetail : string_table(" Xm", " 7246"); ! Layout left-to-right, top-to-bottom (pages 3..10 of the notebook) notebookLayoutsText : "Layouts"; layoutLTText : "Left to Right, Top to Bottom keyboard traversal"; layoutRTText : "Right to Left, Top to Bottom keyboard traversal"; layoutLBText : "Left to Right, Bottom to Top keyboard traversal"; layoutRBText : "Right to Left, Bottom to Top keyboard traversal"; layoutTLText : "Top to Bottom, Left to Right keyboard traversal"; layoutTRText : "Top to Bottom, Right to Left keyboard traversal"; layoutBLText : "Bottom to Top, Left to Right keyboard traversal"; layoutBRText : "Bottom to Top, Right to Left keyboard traversal"; aText : "A"; bText : "B"; cText : "C"; dText : "D"; eText : "E"; fText : "F"; gText : "G"; hText : "H"; iText : "I"; jText : "J"; kText : "K"; lText : "L"; ! Toggles (page 11 of the notebook) togglesText : "Toggles"; toggleExampleText : "Toggle Button Example"; toggleIndOnText : "XmNindicatorOn:"; toggleCheckBoxItem : "Check box"; toggleIndOnItems : string_table ( "None", "Fill", "Box", "Check", toggleCheckBoxItem, "Cross", "Cross box" ); toggleIndTypeText : "XmNindicatorType:"; toggleNofManyItem : "N-of-Many"; toggleIndTypeItems : string_table ( toggleNofManyItem, "1-of-Many", "1-of-Many-Round", "1-of-Many-Diamond" ); toggleIndSizeText : "XmNindicatorSize:"; toggle20Item : "20"; toggleIndSizeItems : string_table ( "10", "15", toggle20Item, "25", "30" ); toggleTogModeText : "XmNtoggleMode:"; toggleBooleanItem : "Boolean"; toggleTogModeItems : string_table ( toggleBooleanItem, "Indeterminate" ); toggleVizOffText : "XmNvisibleWhenOff:"; toggleOnItem : "On"; toggleVizOffItems : string_table ( toggleOnItem, "Off" ); toggleSelColorText : "XmNselectColor:"; toggleDefaultSelectItem : "Default Select"; toggleSelColorItems : string_table ( toggleDefaultSelectItem, "Reversed Ground", "Highlight" ); toggleUnselColorText : "XmNunselectColor:"; toggleBackgroundItem : "Background"; toggleUnselColorItems : string_table ( toggleBackgroundItem ); toggleFillText : "XmNfillOnSelect:"; toggleFillItems : string_table ( toggleOnItem, "Off" ); toggleSetText : "XmNset:"; toggleSetItem : "Set"; toggleSetItems : string_table ( "Unset", toggleSetItem, "Indeterminate" ); motif-2.3.8/demos/programs/periodic/Makefile.am0000644000175000017500000000112613145162623016361 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/periodic datadir = ${prefix}/share/Xm/periodic bin_PROGRAMS = periodic EXTRA_DIST = periodic.uil periodic_l.uil XmdPeriodic.ad README periodic_SOURCES = periodic.c data_DATA = $(EXTRA_DIST) $(periodic_SOURCES) periodic.uid LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: periodic.uid periodic.uid: periodic.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) periodic.uid motif-2.3.8/demos/programs/hellomotif/0000755000175000017500000000000013211513007014737 500000000000000motif-2.3.8/demos/programs/hellomotif/Makefile.in0000644000175000017500000005554613211512766016756 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = hellomotif$(EXEEXT) subdir = demos/programs/hellomotif ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_hellomotif_OBJECTS = hellomotif.$(OBJEXT) hellomotif_OBJECTS = $(am_hellomotif_OBJECTS) hellomotif_LDADD = $(LDADD) hellomotif_DEPENDENCIES = ../../../lib/Xm/libXm.la \ ../../../lib/Mrm/libMrm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(hellomotif_SOURCES) DIST_SOURCES = $(hellomotif_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/hellomotif build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/hellomotif datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = hellomotif.uil README hellomotif_SOURCES = hellomotif.c data_DATA = $(EXTRA_DIST) $(hellomotif_SOURCES) hellomotif.uid LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotif/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotif/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list hellomotif$(EXEEXT): $(hellomotif_OBJECTS) $(hellomotif_DEPENDENCIES) $(EXTRA_hellomotif_DEPENDENCIES) @rm -f hellomotif$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hellomotif_OBJECTS) $(hellomotif_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hellomotif.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dataDATA .PRECIOUS: Makefile all: hellomotif.uid hellomotif.uid: hellomotif.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) hellomotif.uid # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotif/hellomotif.c0000644000175000017500000000774513145162623017214 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: hellomotif.c /main/6 1995/07/14 09:42:12 drk $" #endif #endif #include #include /* Motif Toolkit */ #include /* Mrm Toolkit */ /* Although it's really bad to hardcode Positions, keep this for now for compatibility */ #define NEW_BUTTON_X 11 /* not mentioning hardcoding labels... look at hellomotif_i18n for a better example */ #define NEW_BUTTON_LABEL "Goodbye\nWorld!" static void Activate( Widget widget, XtPointer tag, XtPointer data); static String uid_vec[]={"hellomotif.uid"}; /* MRM database file list */ static MrmRegisterArg reg_vec[] = { /* Callback bindings */ {"helloworld_button_activate", (XtPointer)Activate} }; /* * Main program: fetch the hellomotif.uil description. */ int main(int argc, char *argv[]) { XtAppContext app_context; Widget top_level, helloworld_main; MrmCode mrm_class ; MrmHierarchy mrm_hierarchy; /* * Initialize the MRM */ MrmInitialize (); /* * Initialize Xt and create a resizable shell */ top_level = XtVaAppInitialize(&app_context, "XmdHelloMotif", NULL, 0, &argc, argv, NULL, XmNallowShellResize, True, NULL); /* * Create the Mrm hierarchy */ if (MrmOpenHierarchy (XtNumber(uid_vec), /* number of files */ uid_vec, /* files */ NULL, /* os_ext_list (null) */ &mrm_hierarchy) /* ptr to returned id */ != MrmSUCCESS) { XtError ("can't open hierarchy\n"); } /* * Register our callback routines so that the resource manager can * resolve them at widget-creation time. */ if (MrmRegisterNames (reg_vec, XtNumber(reg_vec)) != MrmSUCCESS) XtError("can't register names\n"); /* * Call MRM to fetch and create the widgets */ if (MrmFetchWidget (mrm_hierarchy, "helloworld_main", top_level, &helloworld_main, &mrm_class) != MrmSUCCESS) XtError ("can't fetch interface\n"); /* * Make the toplevel widget "manage" the main window (or whatever the * the uil defines as the topmost widget). This will * cause it to be "realized" when the toplevel widget is "realized" */ XtManageChild(helloworld_main); /* * Realize the toplevel widget. This will cause the entire "managed" * widget hierarchy to be displayed */ XtRealizeWidget(top_level); /* * Loop and process events */ XtAppMainLoop(app_context); /* UNREACHABLE */ return (0); } static void Activate( Widget widget, XtPointer tag, XtPointer data) { static Boolean first_time = True ; /* First click: change the pushbutton label and recenter */ if (first_time) { XmString new_button_label = XmStringGenerate(NEW_BUTTON_LABEL, NULL, XmCHARSET_TEXT, NULL); XtVaSetValues(widget, XmNx, NEW_BUTTON_X, XmNlabelString, new_button_label, NULL); XmStringFree(new_button_label); first_time = False ; } else { exit(0); } } motif-2.3.8/demos/programs/hellomotif/README0000644000175000017500000000046112672140200015541 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:05:19 drk $ */ This directory contains the sample UIL/Xm program, hellomotif, a simple program with a label and a push button. If you notice any bugs in this demo, please see the bug list in the Release Notes to see if the problem is a known Toolkit defect. motif-2.3.8/demos/programs/hellomotif/hellomotif.uil0000644000175000017500000000325513145162623017553 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! !******************************************************************************* module helloworld version = 'v1.0' names = case_sensitive procedure helloworld_button_activate(); object helloworld_main : XmBulletinBoard { controls { XmLabel helloworld_label; XmPushButton helloworld_button; }; }; object helloworld_button : XmPushButton { arguments { XmNx = 15; XmNy = 60; XmNlabelString = compound_string('Hello',separate=true) & 'World!'; }; callbacks { XmNactivateCallback = procedure helloworld_button_activate(); }; }; object helloworld_label : XmLabel { arguments { XmNlabelString = compound_string('Press button once',separate=true) & compound_string('to change label;',separate=true) & 'twice to exit.'; }; }; end module; motif-2.3.8/demos/programs/hellomotif/Makefile.am0000644000175000017500000000111113145162623016717 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/hellomotif datadir = ${prefix}/share/Xm/hellomotif bin_PROGRAMS = hellomotif EXTRA_DIST = hellomotif.uil README hellomotif_SOURCES = hellomotif.c data_DATA = $(EXTRA_DIST) $(hellomotif_SOURCES) hellomotif.uid LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: hellomotif.uid hellomotif.uid: hellomotif.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) hellomotif.uid motif-2.3.8/demos/programs/animate/0000755000175000017500000000000013211513007014213 500000000000000motif-2.3.8/demos/programs/animate/animate.man0000644000175000017500000000463612672140200016260 00000000000000.\" $XConsortium: animate.man /main/4 1995/07/17 10:46:33 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH animate 1X MOTIF "Demonstration programs" .SH NAME \*Lanimate\*O : an animation program using Motif 1.2 .SH SYNOPSIS .sS \*Lanimate\*O [-anim uidfile] [-speed speed_factor] .sE .SH DESCRIPTION \*LAnimate\*O demonstrates the following Motif features: - declaration of icon/bitmap using UIL - exchange of value between UIL and C using Mrm. - use of the Motif form widget. - background procedure running while the client process is waiting for inputs (Xt intrinsics feature). The pixmaps are not fixed by animate but instead read at startup from existing UID files. The syntax of all the 'animation.uid' files follows some simple rules and one can easily add a new set of pixmap to be animated using animate. dog.uil, plane.uil and superman.uil are tree examples of animation data files. (superman.xbm are referenced in superman.uil). The default animation is 'dog'. To run the demo with the other animations, use the command: % animate -anim plane % animate -anim superman motiflogo.uil, animate.uil and animate.c are the core components of the program. speed_factor is a number between 0 and 100. .SH Files .nf .ta 1.2i XmdAnimate: the app-default file. Try running something like: (XENVIRONMENT=XmdAnimate animate) .fi .SH X Defaults The class of this application is \fIXmdAnimate\fR. .SH Editres: Animate is Editres aware, so you can use 'editres' to see the names of the widgets in the instance hierarchy. motif-2.3.8/demos/programs/animate/XmdAnimate.ad0000644000175000017500000000221012672140200016464 00000000000000! $XConsortium: XmdAnimate.ad /main/4 1995/07/17 18:52:37 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY xmanimate.geometry: 470x275 *horizontalSpacing: 20 *verticalSpacing: 20 *XmScale.value: 10 *XmScale.orientation : XmHORIZONTAL *XmScale.showValue : true *XmScale.bottomOffset : 10 *help_manager.helpFile: xmanimate motif-2.3.8/demos/programs/animate/dog.uil0000644000175000017500000007222712672140200015432 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: dog.uil /main/5 1995/07/14 09:40:44 drk $ !****************************************************************************** module dog !********************************************************************** ! anim_XXX variables must be changed to adapt the new animation ! stuff, at least the number of icons must be the right one. !********************************************************************** value anim_width : exported 700 ; anim_height : exported 200 ; ! prefered values for default initial animation frame size, ! used in motifanim.uil for the geometry of the drawingarea anim_number : exported 6 ; ! number of image in the animation, read by motifanim.c (by a ! MrmFetchLiteral) at run time anim_step : exported 20 ; ! number of horizontal pixels add before next icon drawing, ! read by motifanim.c (by a MrmFetchLiteral) at run time anim_backcolor : exported color('white', background); ! used in motifanim.uil for the color of the drawingarea !********************************************************************** ! The following can be generated by a animation icon editor ! (xfedor + emacs in this case...) !********************************************************************** value dogcolor1 : color('white', background); dogcolor2 : color('black', foreground); dogcolor3 : color('Salmon', background); dogcolor4 : color('maroon', background); dogcolor5 : color('yellow', background); dogcolor6 : color('blue', foreground); dog_ct : color_table(dogcolor1=' ', dogcolor2='.', dogcolor3='X', dogcolor4='o', dogcolor5='O', dogcolor6='+'); ! the following icon must have the syntax ! icon and must be exported since they are read ! by motifanim.c at run time. ! here we have : NAME=dog and N=[1,2,3,4,5,6] dogicon1 : exported icon(color_table=dog_ct, " ", " ", " .... ", " ..XX.... ", " o....... .XXXXXO ... ", " ...oXoooXXXX... .....Oooooo. ", " ..XXXooXooXXXXXXX.. ..ooo.oooo.++. ", " ..XXXXoXXoooooXXXXXoo. .o.oooooooo.++o..... ", " .XoooXooXXXXXXooXXXoooo... ..oooo.oooooooooooooo.. ", " .XXXoXXoooXXXXXXXXXoooooooo.. ..oooooo.ooooooooooooooo. ", " .oOXXXXXXXXXXXXXoXoXXXoooooooo....oooooooooooooooooooooooo. ", " .oo.OXXoooXooXXXXXXXXXooooooooooooooooooooo.ooooo.ooooooooo. ", " .oo.ooOXoooXoXXoooXXXXoooooooooooooooooooooo..oooooooooo. .. ", " .oo.oooOooXoooooooooooooooooooooooooooooooooo..o. .o.o..... ", " .ooo.ooooooooooooooooooooooooooooooooooooooooo... ...... ", " .ooo.oooooooooooo.ooooooooooooooooooooooooooo. ... ", " .ooo..ooooooooooooo.o.ooooooooooXXooooooooo.o... ", " .oo...ooooooooooooo..oo. .ooooooXXXXoooooo. .. ", " .oo...oooooooooooooo...X.oo..oooXXXooXooX. . ", " .oo.. .ooooooooooooooo.X.X.o..oooXooXXXXXXX. ", " .oo. ..oooooooooooooo....X. .oooXoooXXXX.. ", " ooo.. .ooooooooooooooo.. ...ooooXXXXXXXXX. ", " .OO. ..oooooooooooooo.....oooooXXXXXXX.. ", " .XX. .ooooooooooooo.X..oooooXXXXXXXX. ", " .X. ..oooXoXooooo.X.ooooooXXXXXX.. ", " .XX. .ooXXooooooo..ooooooXXXXX.. ", " .. .XX. ...XoXoooo.oooooooXXX.. ", " .oo.. .XX. ..XXoooo.oooooooX.. ", " .ooo......OXX. ...ooooo.oooo... ", " .ooooooooOX. ..oooo.o.... ", " ..oooooo.. ..ooooo.... ", " ...... .... .......ooo.. ", " .oooo....oooo...ooo. ", " .oooooooooooo....ooo. ", " ..ooooooo......oooo. ", " ......... .oooo. ", " .ooooo.. ", " .ooooooo.. ", " .oooooooO. ", " ..ooOOOXX..... ", " ....XXXXXXXX.. ", " ....XXXXXX. ", " ...XXX.. ", " ..... ", " ", " ", " . . . . . . . . . . . . . . . . . . . " ) ; dogicon2 : exported icon(color_table=dog_ct, " ", " ... ", " .XXX...... ", " .XXXXXXooo.. ", " .....o..ooooooo. ", " ............X. ....oooooooooooo.+. ", " ...oooXXXXXXXXXXo... ..... ....ooooooooooooooo.++.. ", " ..ooooooXXoXooXXXooooo........ooooo......oooooooooooooooooooooooo....", " ..ooooXoXXXXooXooXXoooooooooooooooooooooooooooooooooooo.ooooooooooooo..", " .oooXoXXXoooXooXXXXXoooooooooooooooooooooooooooooooooooo.oooooooooooooo.", " .oXooXXXooXoXXXXoXXXXooooooooooooooooooooooooooooooooooooo.ooooooooooooo.", " .ooXXXoXXoXXXoXXXXoooooooooooooooooooooooooooooooooooooooo. .o.o.o.ooooo. ", " ..OoXOXoXXoXooXooooooooooooooooooooo.ooooooooooooooooooooo. ....ooooooo.. ", " ..oOoXXXXXoXooXoooooooooooooooooooo..ooooXXooooooooooooo.o. ............ ", " .ooooooOXXoooooooooooooooooooooooo...oooXXXXXXoooooooooo.oo.. ", " .oooooooooooooooo.oooooooooooooooooo.ooooXoXXXXXXXooooo.ooo. ", " ..ooo.ooooooooooooo..o.o.oooooooooooo..oooooXXo. XXXXooo.oo.. ", " .oooo..ooooooooooooo.OXXX .oooooooooooo..ooooXXXX.oooo. .oo.. ", " .XXoo...ooooooooooooo..O. XX.oooooooooo...oooooXXX.oX . Xoo.. ", " .XXXo.. .ooooooooooooo.......XXooo.oooooo..oooooooX.XX.XXX... ", " . .XXXo. .ooooooooooooo.ooXXX .XXOOo.ooooo...oooooXX.XXXX... ", " .o. .XXXo. .ooooooooooooo..ooo.. XX..oooo.O.O....ooooX.. .... ", " .oo. ..oXXo. .ooooooooooooo...o.... OXX . .XX X ....oooo........... ", " .oo......ooooo. ..oooooooooooo... .O....... XX XXX......ooo.... .o.o.o.. ", " .ooooooooooo.. .ooooooooooo.. ..X. . ..................ooo.. .oooooooo. ", " .oooooooo.. .ooooooooooo....XXX.. .............ooo... .oooooooo. ", " .ooooo.. .oooooooooo..OOXXXX . .ooo........oooo. ", " ..... .ooooooooooo..OoooXoo. .ooo. ..ooo. ", " .oooooooooooo.. ooooo . ... .oooo. .ooo. ", " ..oooooooooooo....o.oooo. .ooo..oooo. .ooo. ", " .oooooooooooo... .ooo.oo.. .oooooooo. ..oooo. ", " ..oooooooooooo.. .oooooo. .ooooo.. .oooo. ", " ...oooooooooo..... ..oo.oo.. .ooo. .ooo. ", " .oXXooooooo.... .oooooo. ... .oo. ", " .oXXoooo.... .oooooo. .. ", " ..XoXo... .ooooo.. ", " .XXXX. ..ooooo. ", " .oXXXX .oooooo.. ", " .XXXXX ..oooooo.. ", " .oXoXX. ....ooooo... ", " .XXXX... ..ooooooo.. ", " .XXXXo.. ...ooooooo. ", " .oXXXXo. ...ooooo. ", " .ooXXo. ...... ", " ....... ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . " ) ; dogicon3 : exported icon(color_table=dog_ct, " ", " ", " ...... ", " ........oooooo..... .. ", " ...ooooooooooooooooooo.......X.. ", " .......ooooooXooXoXooXXoooooooooooo.XXX... ", " .................ooooooooooooXoooooooooooooooooooooo..XXXXo.. ", " ..XXXXXXXXXooXXXXXooooooooooXoooXooooooooooooooooooooooooo.oooooo. ", " ...XXXooXXXXXXXoooooooooooXXooooooooooooooooooooooooooooooooooooooooo. ", " ..oXXXoXXXXXXoXXXoooooooooooooooooooooooooooooooooooooooooooooooooooo.+. ", " .oXXXooXXXXXXooXoooooooooooooooooooooooooooooooooooooooooo.o..oooooooo+... ", " ..oXXXXXXXoXXoXoooooooooooooooooooooooooooooooooooooooooo.o. . .ooooooooooo.. ", " .oooXXXXXXXXooooooooooooooooooooooooooooooooooXXXXXXXXXXX. ......ooooooooooooo.. ", " .ooXXXXooooooooooooooooooooooooooooooooooooooooooXXXXXXo.. ........oooooo.ooooo.. ", " .ooXooooooooooooooooooooooooooooooooooooooo.oooooooXXX......... ..ooooo.ooooo. ", " .ooooooooooooooooooooooooooooooooooooooooooo.ooooooooXXooXXooo.. ...o. ...oo. ", " .ooooooooooooooooooooo.o.o.o.ooooooooooooooooo.ooooooooXXXXoooooo. .... . ... ", " ..ooooooooooooooooooooooooooooo.o.ooooooooooooooo.ooo.oo.oooooooooo.... .... ", " .oooooooooooooooooooooo.........ooo.o.o.o.o.o.o.o. ..oooooooooooooooo. ... ", " ..ooooooooooooooooooo................ooo.X.XX .X.XXXX..............ooooo..oo. ", " ...ooooooooooooooooooo........ ........... XXX XXXXX...................oooo..oo. ", " ........ooooooooooooooooo.......... .................................oooo..oo. ", " .XXXXoXooooooooooooooooo..... . .. .......... ... .o. .o. ..ooo. .oo. ", " ..XXooXXXXoooooooooooooo....... ... ...ooooooo........ .oo.. ", " ...XXXXXXXXXXoooooooooo......... ... .......... ... . .ooo. ", " ..XXXXXXXXo....................XXX... .oooo. ", " .oXXooXXX.... .... . .X. ..... .oo.. ", " .oXXXXXXo.. ...ooo.o. X... ... ", " .ooo.... .ooo.o.ooo.. ", " ... .ooo.ooo.... ", " .o.o.oo... ", " ...ooooo... ", " .oooooo... ", " .ooooo... ", " .oooo.. ", " .oo.. ", " .... ", " ", " ", " ", " ", " ", " ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " ) ; dogicon4 : exported icon(color_table=dog_ct, " ", " .............. ", " ..XXXooXXXooooo...... ........... ", " .....ooXXXXXXoXXoXXooooo............ooooooooooo..... ", " ... ..oXXXXoXXoXXXXXXXXXooooooooooooooooooooooooooooooo.. ", " ..ooo.ooXXXXXXXXXXXXXXXXXXooooooooooooooooooooooooooooooooo.. .. ", " .oooo.ooXXXXXXXXoXXXXXXXXXoooooooooooooooooooooooooooooooooooo... .o.... ", " .oooo.XXOoOXXXOoXXoooooXXXXoooooooooooooooooooooooooooooooooooooo...oo.XXX. ", " .ooo.oooXXXooOooooooooooooooooooooooooooooooooooooooooXoooooooooooo..ooXXo.. ", " .ooo..oooooooooooooooooooooooooooooooooooooooooooooooooXXXXXoooooooooooo.oooo. ", " .XX..oooooooooooooooooooooooooooooooooooooooooooooooooooXXXXXXoooooooooo.ooooo. ", " .XXX..oooooooooooooooooo.oooooooooooooooooooooooooooooooooXXXo.XXoooooooooooo++. ", " .Xoo..oooooooooooooo.o.ooo.oooooooooooooooooooooooooooooooXXXX.oooooooooooooo++o.. ", " ....ooo...ooooooooooooo.....oooo.ooooooooooooooooooooooooooooooXoXo.o.oooooooooooooooo.. ", " ..............oooooooooooo... ...oo. .ooooooooooooooooooooooooooooooXXo....o.ooooooooooooooo. ", " ..oXXXXXXoooooooooooooooooo.X.......oooo.o..ooooooooooooooooooooooooooooo.........oooooooooooo. ", " ...oXXXXXoXXooooooooooooooooooXO.... ....ooo.oo.o.o.o.ooooooooooooo..oooooooo.. O.....oo...ooooo. ", " .oXXXXXXXoXXoooooooooooooooooo.OO.. ....ooooooo.o.o.o.o.o.o.o.O.o.ooooooooo.... O..... ..oo.. ", " ..XXXXo..........oooooooooooooo.O.. ....oooooooooooo.o.oooooooo.ooooooooooo.o... ......... ", " .oXoXo...............ooooooooo.... ......oooooooooooooooo....oooooooooooooooo.... ", " ..Xo...O.O.O.XOO.OO .....ooo..... .......................oo.o.o.o.o.ooooooooo.. ", " ..... .o. .o. .o. .o........... ......................oooooooooo.o.o.o.oooo.. ", " .ooo.o.oooooooooooooooooo..... ...............oooooooooooooo. ", " .ooo.ooooo................. . .X...................oooooo. ", " .ooo.ooo.... ..X. ... ..ooooo.. ", " .oo.oo.... . .X.X.. ..ooooo. ", " .ooooo.. .OO. .. ..oooo. ", " .oooo.. . .o. . .ooo. ", " ..oo.. ..ooo. . ... ", " .... ..ooo.. ", " ..oooo. ", " .oooo. ", " .oooo. ", " .ooo. ", " .ooo. ", " .ooo.. ", " .oooo... ", " .oooooo. ", " .oooooo. ", " ..oooo. ", " ..... ", " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " ) ; dogicon5 : exported icon(color_table=dog_ct, " ", " ......... ", " ....ooooooooo...... ...... ", " ...oXXooXXXXXXXoXooooo... ..XXXXX... ", " ..ooooXXXXXXXoXoXXooooooooo.... .XXXXXXoo..... ", " .XoXoXXXXXoXXXoXXoXooooooooooooo..... .o....Xoooooooo. ", " .XoXoXoXXXXXXXXoXXXooooooooooooooooooo.... ....oo..oo.ooooooooo. ", " .oXoXXXXXXXXoooXXXXoooooooooooooooooooooooo....oooooooooooooooooo++o. ", " ..ooXXXXXXXXXXXXXoXooooooooooooooooooooooooooooooooooooooo.ooooooo.+oo.... ", " .oooXXoXXXXoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo..", " .oooXXXXoXXXooooooooo.oooooooooooooooooooooooXoooooooooooo.oooooooooooooooo.", " .o.XXooXXXooooooooo.o.o.oooo.oooooooooooooooXoXXoooooooooo.oooooooo.ooooooo.", " ..o.ooooooooooooooooooo...o.oooooooooooooooooXoXXXXooooooooo.o.ooooooooo.o.o.", " .ooo.oooooooooooooooooo.. .o.oooooooooooooooooXXXoXXXoooo.o. .o.o.X.o. . ... ", " .ooo..ooooooooooooooooo....o.oooooooooooooooooXXXXXXXXo.oooooooo.X......... ", " .ooo..ooooooooooooooooo....o.oo.ooooooooooooXXXXXXXXXXooo......... ", " .oo. ..oooooooooooooooo. .ooo.ooooooooooooXXXXXXXoXXoo.. ", " .oo. ..ooooooooooooooo...oooo.o. .oooo.oooXooXXXoXXo.. ", " ..oo. ....oooooooooooo....ooo..o.X.o..oooXXXXoXXXXX. ", " .ooo. ....oooooooooo.. ....oooo.X.o.ooooXoXXXXXo.. ", " .. ..oo. ... ..oooooooooo. .......XXX.ooooooXooXo.. ", " .o.. ..ooo. ...XX..oooooooooo. .........ooooooXoo... ", " .ooo. ..ooo. .ooX ..ooooooooo.. ....oooooooo... ", " .ooo....oooo. .oo. ..ooooooooo.. .. .ooooooo. ", " .ooooooooo. .o....oooooooo... ..X...ooooo.. ", " ..ooooo.. ...oooooooo.. ...o. ..ooooo. ", " ..... .ooooooo.. .X. .o....oooo. ", " .oooooo.. .. .o.oo.. ..ooo. ", " .oooooooo. ..oo.o. .. .oooo. ", " ..ooooooo. .... .o.o... .ooo. ", " ....ooooo.....ooooXX..... .ooo. ", " ...ooooo....oo. ... .ooo. ", " ...ooooo....... .ooo. ", " ..ooooo.... .oo. ", " ..oooo.. .oo. ", " ..oo.. .ooo. ", " .... .ooo.. ", " .oooo.. ", " .ooooo. ", " ..oo.. ", " . . . . . . . . . . . . . . . . . . . . . . . . . ... . " ) ; dogicon6 : exported icon(color_table=dog_ct, " ", " ........... ", " ..oXXXooooooo.... ..... ", " .ooXXXXXXXXXXXXXXX.... .XXXXX.... ", " .oXXXXXXXooXXXooXXXXooo.. .....XX.ooo.. ", " .oXXXoXXXXXXXXXXXXXXXooooo... .o.. XX.oooooo. ", " .oooXXXXXXoooo.ooXXXooooooooo.. ...ooo..XX..oooooo. ", " .oXXoXXXoXXoooo.oooooooooooooooo...........ooooooo......oo++o+. ", " ...XXXXXXXXXooooo.ooooooooooooooooooooooooooooooooooo.oooooo+.ooo... ", " ..ooo.ooXooooooooooo.oooooooooooooooooooooooooooooooooooooooooooooooo..", " .ooooooooooooooooooooo.ooooooooooooooooooooooooooooooooo.oooooooooooooo.", " .ooooo.ooooooooooooooooo.ooooooooooooooooooooooooooooooooo.ooooooooooooo.", " .ooo.o. .ooooooooooooooooo.oooooooooooooooooooooooooooooooo.o.o.oooooooo. ", " .ooo.....oooooooooooooooooo.ooooooooo.oooooooooooooo.ooo.ooo.XXX.ooooo.. ", " .ooo. ..ooooooooooooooooo.o.ooooooo.ooXXXoooooooo.oooooooo.......... ", " .Xo. ..ooooooooooooooooo. .o.oo..ooXooXXXooooooo.ooo.... ", " .XX. ..oooooooooooooooo..X.X...oooXooXoXXXoooo.oo.. ", " .XX. ...oooooooooooooo.X.X.X..oooXXooXXXXXXoo... ", " .XX. .....oooooooooo.......oooXXXXoXXXXXXX.. ", " .XX. ..ooooooooXX. ..ooooXooXXXXXXXXX ", " .XXX. .ooooooo......ooooXoXXXXXXXo. ", " .XX. .ooooo......ooooXXoXXXXXXo. ", " ... ..XXo. .oooo.. .ooooooXXXXXXo. ", " .ooo......oooo. .oooo. .oooooooXXoXo.. ", " .ooooooooooo. .ooo.. .ooooXXoooo.. ", " ..ooooooo.. .ooo. .oooooXo.... ", " ....... .ooo. .ooooo.. ", " .oo.. .ooooo. ", " .oo.. .oooo. ", " ..oo.. .ooo.. ", " .oooo. .ooo.. ", " .oooo....o.. ", " .ooooooo... ", " .ooooooooo... ", " ...ooooooooo. ", " ....oooooo. ", " ......oooo. ", " .o. ...... ", " .oo. . ", " ..oo. . ", " .oo. .. ", " ..ooooo. ", " ..ooooo. ", " . . . . . . . . . ....... . . . . . . . " ) ; end module ; motif-2.3.8/demos/programs/animate/xmanimate.c0000644000175000017500000002523612672140200016273 00000000000000/* $XConsortium: xmanimate.c /main/5 1995/07/15 20:44:58 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ /*************************************************************************** * Motifanim. * --------- * This program displays a animation made of a succession of pixmaps drawn * side by side in a scrolled drawingarea; there are also control * buttons for managing the animation (start, speed, stop, step ...) * This program reads two uid files: 'motifanim.uid', describing the general * interface of the buttons, label etc, and a .uid file, describing * the data for the animation itself (essentially a set of icons to * be read using MrmFetchIconLiteral. can be set at run time * in the command line and is supposed to define the following value: * anim_width : width of the drawing area receiving animation * anim_height : height of the drawing area receiving animation * anim_number : number of icons in the animation (N) * icon : name of the icon pixmap, for instance 'dogicon1' * anim_backcolor : color of the drawing area receiving animation * anim_step : horizontal offset added before each animation step * See dog.uil, the default , for an example of such a file. * ----------------------------------- * Authors: Daniel Dardailler, 90 (this version - last updated 94) * Vincent Bouthors, 89 (Egerie version) * Daniel Dardailler, 88 (xdog version) ****************************************************************************/ #include #include /* Motif Toolkit */ #include #include /* Mrm */ #include #include #include static MrmHierarchy s_MrmHierarchy; /* MRM database hierarch id */ static char *vec[2]={"xmanimate.uid"}; /* MRM database file list */ static int vecnum = sizeof(vec) / sizeof(char*); /* the second uid file name (vec[1]), containing animation data, is taken at run time in command line option -anim */ static MrmCode class, return_type ; /* forward declaration of interface procedures */ static void p_motifanim_start(); static void p_motifanim_stop(); static void p_motifanim_step(); static void p_motifanim_speed(); static void p_motifanim_draw(); static void p_motifanim_exit(); static void p_motifanim_help(); static void InitAnim(); /* binding of uil procedure names with C functions */ static MRMRegisterArg regvec[] = { {"p_motifanim_start",(XtPointer)p_motifanim_start}, {"p_motifanim_stop",(XtPointer)p_motifanim_stop}, {"p_motifanim_step",(XtPointer)p_motifanim_step}, {"p_motifanim_speed",(XtPointer)p_motifanim_speed}, {"p_motifanim_exit",(XtPointer)p_motifanim_exit}, {"p_motifanim_draw",(XtPointer)p_motifanim_draw}, {"p_motifanim_help",(XtPointer)p_motifanim_help} }; static MrmCount regnum = XtNumber(regvec); static Display *display; static XtAppContext app_context; /** -- Animation variables **/ static int scalespeed, max_scale ; /* init with widget values */ static short width ; static Boolean stop = True ; static int xanim = 50, yanim = 25, ianim = 0 ; static int speed_factor = 20 ; /* reinitialized with argv */ static char * anim_name = "dog"; /* reinitialized with argv */ #define MAXIMAGES 10 static unsigned int wanim[MAXIMAGES], hanim[MAXIMAGES] ; static Pixmap panim[MAXIMAGES] ; /* initalized with uil value by fetching */ static int nimage, step_size ; /* initalized with uil value by fetching */ static GC gc ; static Widget drawingArea; static int speedcount ; #define APP_CLASS "XmdAnimate" static String fallbacks[] = { "*help_manager.helpFile: xmanimate", NULL }; /****************************************************************** * Main program: motifanim [-anim anim_name] [-speed speed_factor] */ int main(argc, argv) int argc; String argv[]; { /* * Declare the variables to contain the two widget ids */ Widget toplevel, motifanimmain = NULL ; Arg arglist[1] ; char uidanimfile[100] ; int n; MrmInitialize (); XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaOpenApplication(&app_context, APP_CLASS, NULL , 0, &argc, argv, fallbacks, sessionShellWidgetClass, NULL); /** Plug in Editres protocol */ XmdRegisterEditres(toplevel); /* * Parsing of the remaining animation options */ while (*++argv) { if (!strcmp(*argv,"-anim")) { if (*++argv) anim_name = *argv ; } else if (!strcmp(*argv,"-speed")) { if (*++argv) speed_factor = atoi(*argv) ; } } /* * Build the secong uid file and open the Mrm.hierarchy (2 files) */ strcpy(uidanimfile,anim_name); strcat(uidanimfile,".uid"); vec[1] = uidanimfile ; if (MrmOpenHierarchy (vecnum, /* number of files */ vec, /* files */ NULL, /* os_ext_list (null) */ &s_MrmHierarchy) /* ptr to returned id */ != MrmSUCCESS) { printf ("can't open hierarchy defined by %s and %s\n",vec[0],vec[1]); exit(0); } if (MrmRegisterNames (regvec, regnum) != MrmSUCCESS) { printf("can't register names\n"); exit(0) ; } if (MrmFetchWidget (s_MrmHierarchy, "motifanim_main", toplevel, &motifanimmain, &class) != MrmSUCCESS) { printf("can't fetch interface\n"); exit(0); } XtManageChild(motifanimmain); XtRealizeWidget(toplevel); /* * Call the routine that will fetch the animation variables. */ InitAnim() ; XtAppMainLoop(app_context); /* UNREACHABLE */ return (0); } static void InitAnim() /********/ { XGCValues gcv; int i,dum ; char uiliconname[100]; int * pint ; Window wdum ; /* fetch the number of animation icons from Mrm hierarchy */ if (MrmFetchLiteral(s_MrmHierarchy, "anim_number", XtDisplay(drawingArea), (XtPointer *)&pint, &return_type) != MrmSUCCESS) { printf("Can't fetch literal anim_number in %s.uid\n",anim_name); exit(0) ; } nimage = (*pint > MAXIMAGES)?(MAXIMAGES-1):(*pint-1); /* fetch the step value from Mrm hierarchy */ if (MrmFetchLiteral(s_MrmHierarchy, "anim_step", XtDisplay(drawingArea), (XtPointer *)&pint, &return_type) != MrmSUCCESS) { printf("Can't fetch literal anim_step in %s.uid\n",anim_name); exit(0) ; } step_size = *pint ; /* fetch the icon pixmaps from Mrm hierarchy */ for (i = 0 ; i <= nimage ; i++) { sprintf(uiliconname, "%sicon%d",anim_name, i+1); if (MrmFetchIconLiteral(s_MrmHierarchy, uiliconname, XtScreen(drawingArea), XtDisplay(drawingArea), BlackPixel(XtDisplay(drawingArea), DefaultScreen(XtDisplay(drawingArea))), WhitePixel(XtDisplay(drawingArea), DefaultScreen(XtDisplay(drawingArea))), &panim[i]) != MrmSUCCESS) { fprintf(stderr, "Can't fetch uiliconname %s\n", uiliconname); exit (-1); } /* get the icons geometry with X standard requests */ XGetGeometry(XtDisplay(drawingArea),panim[i],&wdum, &dum,&dum,&wanim[i],&hanim[i], (unsigned int*)&dum,(unsigned int*)&dum); } /* to avoid event accumulation during animation */ gcv.graphics_exposures = False ; gc = XCreateGC(XtDisplay(drawingArea), XtWindow(drawingArea), GCGraphicsExposures, &gcv); speedcount = 0 ; } /** Background Work Procedure: it return the current value of stop and then is automatically removed when stop = true. **/ static Boolean fstep(client_data) /************************/ XtPointer client_data ; /* scalespeed */ { speedcount += (int)*(int*)client_data ; if (speedcount >= (max_scale*speed_factor)) { speedcount = 0 ; XClearArea(XtDisplay(drawingArea), XtWindow(drawingArea), xanim, yanim, wanim[ianim], hanim[ianim] , False); xanim = (xanim > width)?(-wanim[ianim]):(xanim+step_size) ; ianim = (ianim == nimage)?0:(ianim+1); XCopyArea(XtDisplay(drawingArea), panim[ianim], XtWindow(drawingArea), gc, 0, 0, wanim[ianim], hanim[ianim], xanim, yanim); XSync(XtDisplay(drawingArea),False); } return stop ; } /** The callbacks **/ /*******************/ static void p_motifanim_help (Widget w, XtPointer client_data, XtPointer call_data) { static Widget help_widget = NULL ; if (!help_widget) help_widget = XmdCreateHelpDialog(w, "help_manager", NULL, 0); XtManageChild(help_widget); } static void p_motifanim_start( widget, tag, callback_data ) Widget widget; char *tag; XmAnyCallbackStruct *callback_data; { XtAppAddWorkProc(app_context,fstep, (XtPointer)&scalespeed); stop = False ; } static void p_motifanim_stop( widget, tag, callback_data ) Widget widget; char *tag; XmAnyCallbackStruct *callback_data; { stop = True ; } static void p_motifanim_step( widget, tag, callback_data ) Widget widget; char *tag; XmAnyCallbackStruct *callback_data; { int max = (max_scale*speed_factor) ; fstep(&max) ; } static void p_motifanim_speed( widget, tag, callback_data ) Widget widget; int *tag; XmScaleCallbackStruct *callback_data; { Arg arg ; if (*tag == 0) { XmScaleGetValue(widget,&scalespeed); XtSetArg(arg,XmNmaximum,&max_scale); XtGetValues(widget,&arg,1); } else scalespeed = callback_data->value ; } static void p_motifanim_draw( widget, tag, callback_data ) Widget widget; int *tag; XmAnyCallbackStruct *callback_data; { Arg arg ; if (*tag == 0) { XtSetArg(arg,XmNwidth,&width); XtGetValues(widget,&arg,1); drawingArea = widget ; } else { XCopyArea(XtDisplay(drawingArea), panim[ianim], XtWindow(drawingArea), gc, 0, 0, wanim[ianim], hanim[ianim], xanim, yanim); } } static void p_motifanim_exit( widget, tag, callback_data ) Widget widget; char *tag; XmAnyCallbackStruct *callback_data; { exit(0); } motif-2.3.8/demos/programs/animate/Makefile.in0000644000175000017500000005716013211512766016224 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = xmanimate$(EXEEXT) subdir = demos/programs/animate ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_xmanimate_OBJECTS = xmanimate.$(OBJEXT) xmanimate_OBJECTS = $(am_xmanimate_OBJECTS) xmanimate_LDADD = $(LDADD) xmanimate_DEPENDENCIES = ../../lib/Xmd/libXmd.a \ ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(xmanimate_SOURCES) DIST_SOURCES = $(xmanimate_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/animate build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/animate datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = dog.uil plane.uil superman.uil xmanimate.uil \ superman1.xbm superman2.xbm superman3.xbm superman4.xbm \ superman5.xbm superman6.xbm XmdAnimate.ad \ README animate.help animate.man xmanimate.man xmanimate_SOURCES = xmanimate.c CLEANFILES = dog.uid plane.uid superman.uid xmanimate.uid data_DATA = dog.uid plane.uid superman.uid xmanimate.uid $(xmanimate_SOURCES) \ $(EXTRA_DIST) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib \ -I$(srcdir)/../../lib \ -I$(top_builddir)/lib \ ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/animate/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/animate/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xmanimate$(EXEEXT): $(xmanimate_OBJECTS) $(xmanimate_DEPENDENCIES) $(EXTRA_xmanimate_DEPENDENCIES) @rm -f xmanimate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xmanimate_OBJECTS) $(xmanimate_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmanimate.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dataDATA .PRECIOUS: Makefile all: dog.uid plane.uid superman.uid xmanimate.uid dog.uid: dog.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil plane.uid: plane.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil superman.uid: superman.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil xmanimate.uid: xmanimate.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) periodic.uid # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/animate/superman6.xbm0000644000175000017500000000603612672140200016571 00000000000000/* $XConsortium: superman6.xbm /main/4 1995/07/17 18:21:10 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define superX6_width 88 #define superX6_height 29 #define superX6_x_hot 81 #define superX6_y_hot 29 static char superX6_bits[] = { 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0x01, 0x00, 0xfc, 0x81, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0x87, 0xca, 0x03, 0x00, 0x80, 0xff, 0x30, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0x03, 0x77, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0x83, 0x1e, 0x00, 0x38, 0xfe, 0xff, 0xff, 0xff, 0x2f, 0xfc, 0x03, 0x70, 0x01, 0x00, 0x00, 0xff, 0x8f, 0xff, 0x3f, 0xc0, 0x03, 0x00, 0x60, 0x01, 0x00, 0x00, 0xf0, 0x77, 0xff, 0xc3, 0xff, 0x03, 0x00, 0x60, 0x01, 0x00, 0x00, 0x00, 0xc8, 0xff, 0x7d, 0xed, 0x03, 0x60, 0x70, 0x01, 0x00, 0x00, 0x00, 0x70, 0xff, 0x01, 0xe0, 0x21, 0x00, 0x78, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0xbd, 0x0a, 0x00, 0x00, 0x7c, 0x81, 0x00, 0x41, 0x00, 0xc8, 0xff, 0x03, 0xe0, 0x01, 0x00, 0x58, 0x80, 0x81, 0x01, 0x00, 0x70, 0xff, 0xff, 0x1f, 0x20, 0x20, 0x00, 0x00, 0xc1, 0x20, 0xc0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0x03, 0x62, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/demos/programs/animate/superman1.xbm0000644000175000017500000000603612672140200016564 00000000000000/* $XConsortium: superman1.xbm /main/4 1995/07/17 18:20:25 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define superX1_width 88 #define superX1_height 29 #define superX1_x_hot 80 #define superX1_y_hot 29 static char superX1_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0x17, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x07, 0x08, 0x80, 0xff, 0xff, 0xef, 0xff, 0x0f, 0x00, 0xfe, 0x0f, 0x00, 0x08, 0x50, 0xff, 0xff, 0x1f, 0xd4, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x50, 0xff, 0xff, 0xdf, 0xff, 0xff, 0x07, 0x7f, 0x00, 0x08, 0xfc, 0x4f, 0xff, 0xff, 0x07, 0xff, 0x03, 0x80, 0x00, 0x10, 0x80, 0xff, 0xbf, 0xff, 0x03, 0xf8, 0x00, 0x00, 0xc0, 0x02, 0x08, 0xc0, 0xff, 0xff, 0xff, 0x5d, 0x75, 0x00, 0x00, 0xc0, 0x42, 0x48, 0x30, 0xfc, 0xff, 0xff, 0x01, 0x50, 0x40, 0x00, 0xe0, 0xc2, 0x60, 0xf8, 0xf8, 0xff, 0xff, 0xff, 0x0f, 0x40, 0x80, 0xf1, 0x90, 0x31, 0xb4, 0xf1, 0xff, 0xff, 0xff, 0xbf, 0x3f, 0x00, 0xf8, 0x12, 0x1b, 0xaa, 0xf0, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xfb, 0x02, 0x0e, 0x6a, 0xf1, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xd0, 0x00, 0x0e, 0x94, 0xf1, 0xff, 0xff, 0xff, 0x87, 0xe3, 0x3f, 0xa0, 0x02, 0x1b, 0xb8, 0xf8, 0xff, 0xff, 0xff, 0x7b, 0x1d, 0x0e, 0x40, 0x92, 0x31, 0x40, 0xfc, 0xff, 0xff, 0xff, 0x03, 0x68, 0x00, 0x80, 0xc2, 0x60, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x27, 0x00, 0x00, 0x40, 0x48, 0xc0, 0xff, 0xaf, 0xff, 0xff, 0x1f, 0x9a, 0x08, 0xe0, 0x1f, 0x08, 0x00, 0xfe, 0x57, 0xff, 0xff, 0xef, 0x7f, 0x08, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x50, 0xff, 0xff, 0xef, 0xff, 0x81, 0x01, 0xf0, 0x43, 0x00, 0x00, 0x50, 0xff, 0xff, 0x17, 0x00, 0x00, 0xfe, 0x0f, 0xfc, 0x03, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/demos/programs/animate/xmanimate.uil0000644000175000017500000001553412672140200016642 00000000000000! $XConsortium: xmanimate.uil /main/4 1996/07/15 15:13:12 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY !*************************************************************** !* ** !* Motifanim general interface. ** !* Author : Daniel Dardailler, March 90, June 90, August 91 ** !* ** !**************************************************************/ module motifanim version = 'v1.0' names = case_sensitive procedure p_motifanim_start(); p_motifanim_stop(); p_motifanim_step(); p_motifanim_speed(integer); p_motifanim_exit(); p_motifanim_help(); p_motifanim_draw(integer); !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! The main is a big Form that try to manage its children ! as well as possible... !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! object motifanim_main : XmMainWindow { controls { XmMenuBar motifanim_bar ; XmForm motifanim_form ; }; }; object motifanim_form : XmForm { arguments { XmNdefaultButton = motifanim_start ; }; controls { XmScrolledWindow motifanim_view; XmSeparator motifanim_sep; XmPushButton motifanim_start; XmPushButton motifanim_stop; XmPushButton motifanim_step; XmScale motifanim_speed; }; }; !------------------------------------------------------- ! As a geometry starting point, we fix the bottom line of ! PushButtons (start, stop..) to the Form bottom and sides ! and the menubar to the top !------------------------------------------------------- object motifanim_bar : XmMenuBar { arguments { XmNmenuHelpWidget = XmCascadeButton help_entry; }; controls { XmCascadeButton file_menu_entry; XmCascadeButton help_entry; }; }; object file_menu_entry : XmCascadeButton { arguments { XmNlabelString = compound_string('File') ; XmNmnemonic = keysym("F"); }; controls { XmPulldownMenu file_menu; }; }; object help_entry : XmCascadeButton { arguments { XmNlabelString = compound_string('Help') ; XmNmnemonic = keysym("H"); }; controls { XmPulldownMenu help_menu; }; }; object file_menu : XmPulldownMenu { controls { XmPushButton motifanim_quit; }; }; object help_menu : XmPulldownMenu { controls { XmPushButton motifanim_help; }; }; object motifanim_quit : XmPushButton { arguments { XmNlabelString = compound_string('Quit'); XmNmnemonic = keysym("Q"); }; callbacks { XmNactivateCallback = procedure p_motifanim_exit(); }; }; object motifanim_help : XmPushButton { arguments { XmNlabelString = compound_string('Overview'); XmNmnemonic = keysym("O"); }; callbacks { XmNactivateCallback = procedure p_motifanim_help(); }; }; object motifanim_start : XmPushButton { arguments { XmNlabelString = compound_string('Start'); XmNbottomAttachment = XmATTACH_FORM ; XmNleftAttachment = XmATTACH_FORM ; }; callbacks { XmNactivateCallback = procedure p_motifanim_start(); }; }; object motifanim_stop : XmPushButton { arguments { XmNlabelString = compound_string('Stop'); XmNbottomAttachment = XmATTACH_FORM ; XmNleftAttachment = XmATTACH_WIDGET ; XmNleftWidget = XmPushButton motifanim_start ; }; callbacks { XmNactivateCallback = procedure p_motifanim_stop(); }; }; object motifanim_step : XmPushButton { arguments { XmNlabelString = compound_string('One step'); XmNbottomAttachment = XmATTACH_FORM ; XmNleftAttachment = XmATTACH_WIDGET ; XmNleftWidget = XmPushButton motifanim_stop ; }; callbacks { XmNactivateCallback = procedure p_motifanim_step(); }; }; object motifanim_speed : XmScale { arguments { XmNtitleString = compound_string('Speed'); XmNorientation = XmHORIZONTAL ; XmNbottomAttachment = XmATTACH_FORM ; XmNleftAttachment = XmATTACH_WIDGET ; XmNleftWidget = XmPushButton motifanim_step ; }; callbacks { MrmNcreateCallback = procedure p_motifanim_speed(0); XmNdragCallback = procedure p_motifanim_speed(1); XmNvalueChangedCallback = procedure p_motifanim_speed(2); }; }; !------------------------------------------------------- ! Now that the bottom pushbuttons are fixed, ! we attach the Separator to the first one in the line !------------------------------------------------------- object motifanim_sep : XmSeparator { arguments { XmNrightAttachment = XmATTACH_FORM ; XmNleftAttachment = XmATTACH_FORM ; XmNbottomAttachment = XmATTACH_WIDGET ; XmNbottomWidget = motifanim_speed ; }; }; !------------------------------------------------------- ! This one is full rubber !------------------------------------------------------- object motifanim_view : XmScrolledWindow { arguments { XmNrightAttachment = XmATTACH_FORM ; XmNtopAttachment = XmATTACH_FORM ; XmNbottomAttachment = XmATTACH_WIDGET ; XmNbottomWidget = XmSeparator motifanim_sep ; XmNleftAttachment = XmATTACH_FORM ; XmNscrollingPolicy = XmAUTOMATIC ; }; controls { XmDrawingArea view_anim ; }; }; value anim_width : imported integer ; anim_height : imported integer ; anim_backcolor : imported color ; object view_anim : XmDrawingArea { arguments { XmNwidth = anim_width ; XmNheight = anim_height ; XmNbackground = anim_backcolor ; }; callbacks { MrmNcreateCallback = procedure p_motifanim_draw(0); XmNexposeCallback = procedure p_motifanim_draw(1); }; }; end module; motif-2.3.8/demos/programs/animate/animate.help0000644000175000017500000000255412672140200016432 00000000000000Overview Animate : an animation program using Motif 1.2 Animate demonstrates the following Motif features: - declaration of icon/bitmap using UIL - exchange of value between UIL and C using Mrm. - use of the Motif form widget. - background procedure running while the client process is waiting for inputs (Xt intrinsics feature). The pixmaps are not fixed by animate but instead read at startup from existing UID files. The syntax of all the 'animation.uid' files follows some simple rules and one can easily add a new set of pixmap to be animated using animate. dog.uil, plane.uil and superman.uil are tree examples of animation data files. (superman.xbm are referenced in superman.uil). The default animation is 'dog'. To run the demo with the other animations, use the command: % animate -anim plane % animate -anim superman motiflogo.uil, animate.uil and animate.c are the core components of the program. speed_factor is a number between 0 and 100. Files: XmdAnimate: the app-default file. for usability. Run 'xrdb XmdAnimate' or something like XENVIRONMENT=XmdAnimate animate X Defaults: The class of this application is XmdAnimate. Editres: Animate_0 is Editres aware, so you can use 'editres' to see the names of the widgets in the instance hierarchy. motif-2.3.8/demos/programs/animate/plane.uil0000644000175000017500000001665312672140200015761 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: plane.uil /main/5 1995/07/14 09:40:53 drk $ !****************************************************************************** module plane !********************************************************************** ! anim_XXX variables must be changed to adapt the new animation ! stuff, at least the number of icons must be the right one. !********************************************************************** value anim_width : exported 800 ; anim_height : exported 150 ; ! prefered values for default initial animation frame size, ! used in motifanim.uil for the geometry of the drawingarea anim_number : exported 2 ; ! number of image in the animation, read by motifanim.c (by a ! MrmFetchLiteral) at run time anim_step : exported 10 ; ! number of horizontal pixels add before next icon drawing, ! read by motifanim.c (by a MrmFetchLiteral) at run time anim_backcolor : exported color('lightblue', background); ! used in motifanim.uil for the color of the drawingarea !********************************************************************** ! The following can be generated by a animation icon editor ! (xfedor + emacs in my case...) !********************************************************************** value planecolor1 : color('lightblue', background); planecolor2 : color('black', foreground); planecolor3 : color('blue', foreground); planecolor4 : color('red', foreground); planecolor5 : color('yellow', background); plane_ct : color_table(planecolor1=' ', planecolor2='.', planecolor3='X', planecolor4='o', planecolor5='O'); ! the following icon must have the syntax ! icon and must be exported since they are read ! by motifanim.c at run time. ! here we have : NAME=plane and N=[1,2] planeicon1 : exported icon(color_table=plane_ct, " ... ", " ..... ", " XXXX .. ... XXXX ", "XXXXXX . . .. . X . ", "XXXXXXX oooooo . . .... X . ", "XXXXXXXX oooooooooooo.. . X X ", "XXXXXXXXX ooooooooooooo... .. XX X X ", "XXXXXXXXX ooooo ooo .. XX X XXXXX .... ", "XXXXXXXXXX o o.ooXXXXX X XXXXXXX.... X .. ", "XXXXXXXXXXX . .oo X X XXXXXXX .... X .. ", "XXXXXXXXXXX X ooooX XXXXXXXXXXXX.... X .. ", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .... X .. ", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... X .. ", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .... X .. ", "XXOOOOOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XX.. ", "XOOOOOOOOOOXXXXXXXXXOX XX XX XX XX XX XXOXOOOXXXX .... .....", "XOOOOOOOOXXXXXXXXXOOXXXXXXXXXXXXXXXXXXXXOOXXXXXXXX.... XX.. ", "XXXXXXXXXXXXXXXXOOOOOOOOOOOOOOOOOOOOOOOOXXXXXXXXX .... X .. ", "XXXXXXXXXXXXXXOOXXXXXXXXXXXXXXXXXXXXOOXXXXXXXXXXXX.... X .. ", " XXXXXXXXXXXOOOOOOOOOOOOOOOOOOOOOOOOXXXXXXXXXXXXX .... X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .... X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... X .. ", " XXXXXXXXXXXXXXXXXXXXXXX .... X .. ", " X..X X.X. ", " X..X X.X. ", " X..X X.X. ", " X..X ...... ", " ............ ", " ............ ", " ...... .... ", " ...... ", " .... " ) ; planeicon2 : exported icon(color_table=plane_ct, " ", " ", " ", " ", " ", " ", " ... ", " ..... ", " XXXX .. ... XXXX ", " XXXXXX . . .. . X . ", " XXXXXXX o . . .... X . ", " XXXXXXXX ooo .. . X X ", " XXXXXXXXX ooooo ... .. XX X X ", " XXXXXXXXX oooooooooooo .. XX X XXXXX .... ", " XXXXXXXXXX oooooooooooo.ooXXXXX X XXXXXXX....X .. ", " XXXXXXXXXXX ooooooooo. .oo X X XXXXXXX ....X .. ", " XXXXXXXXXXX X ooooX XXXXXXXXXXXX....X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ....X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ....X .. ", " XXOOOOOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....XX.. ", " XOOOOOOOOOOXXXXXXXXXOX XX XX XX XX XX XXOXOOOXXXX .........", " XOOOOOOOOXXXXXXXXXOOXXXXXXXXXXXXXXXXXXXXOOXXXXXXXX....XX.. ", " XXXXXXXXXXXXXXXXOOOOOOOOOOOOOOOOOOOOOOOOXXXXXXXXX ....X .. ", " XXXXXXXXXXXXXXOOXXXXXXXXXXXXXXXXXXXXOOXXXXXXXXXXXX....X .. ", " XXXXXXXXXXXOOOOOOOOOOOOOOOOOOOOOOOOXXXXXXXXXXXXX ....X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ....X .. ", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....X .. ", " XXXXXXXXXXXXXXXXXXXXXXX ....X .. ", " X..X X.X. ", " X..X X.X. ", " X..X X.X. ", " X..X ...... ", " ............ ", " ............ ", " ...... .... ", " ...... ", " .... ", " " ); end module ; motif-2.3.8/demos/programs/animate/superman4.xbm0000644000175000017500000000603612672140200016567 00000000000000/* $XConsortium: superman4.xbm /main/4 1995/07/17 18:20:53 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define superX4_width 88 #define superX4_height 29 #define superX4_x_hot 80 #define superX4_y_hot 29 static char superX4_bits[] = { 0xff, 0xff, 0x1f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xa2, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x0e, 0xfc, 0x01, 0x80, 0x02, 0x00, 0x00, 0x80, 0x8f, 0xff, 0xc3, 0xf0, 0x01, 0x00, 0x80, 0x02, 0x60, 0x00, 0x00, 0x70, 0xff, 0xbd, 0xaf, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x10, 0x58, 0xff, 0x03, 0x00, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x40, 0x06, 0x50, 0xff, 0xff, 0xe1, 0x60, 0x00, 0xe1, 0x40, 0x40, 0x58, 0xfe, 0x87, 0xff, 0xff, 0xfe, 0x3f, 0x00, 0xf0, 0xd2, 0x60, 0x2c, 0xfe, 0xff, 0xff, 0xff, 0x54, 0x0f, 0x0e, 0xf8, 0x92, 0x31, 0x56, 0xfe, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xd0, 0x00, 0x1b, 0x04, 0xff, 0x8f, 0xff, 0xff, 0xbf, 0x7f, 0x00, 0xa0, 0x02, 0x0e, 0x00, 0x00, 0x70, 0xff, 0xff, 0xbf, 0xff, 0x08, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x48, 0xff, 0xff, 0x3f, 0xf6, 0x07, 0xfc, 0x3f, 0x1b, 0x00, 0x00, 0x50, 0xff, 0xff, 0xbf, 0xff, 0xff, 0x01, 0xc0, 0xff, 0x01, 0xe0, 0x8f, 0xff, 0xff, 0x5f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/demos/programs/animate/xmanimate.man0000644000175000017500000000501712672140200016617 00000000000000.\" $XConsortium: xmanimate.man /main/4 1995/07/17 10:46:33 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH xmanimate 1X MOTIF "Demonstration programs" .SH NAME \*Lxmanimate\*O : an animation program using Motif .SH SYNOPSIS .sS \*Lxmanimate\*O [-anim uidfile] [-speed speed_factor] .sE .SH DESCRIPTION \*LXmanimate\*O demonstrates the following Motif features: - declaration of icon/bitmap using UIL - exchange of value between UIL and C using Mrm. - use of the Motif form widget. - background procedure running while the client process is waiting for inputs (Xt intrinsics feature). Xmanimate allows the user to animate a set of pixmaps in a window. The pixmaps are not fixed by xmanimate but instead read at startup from existing UID files. The syntax of all the 'animation.uid' files follows some simple rules and one can easily add a new set of pixmaps to be animated using xmanimate. dog.uil, plane.uil and superman.uil are tree examples of animation data files. (superman.xbm are referenced in superman.uil). The default animation is 'dog'. To run the demo with the other animations, use the command: % xmanimate -anim plane % xmanimate -anim superman xmanimate.uil and xmanimate.c are the core components of the program. speed_factor is a number between 0 and 100. .SH Files .nf .ta 1.2i XmdAnimate: the app-default file, which is very important for usability. Try running something like: (XENVIRONMENT=XmdAnimate xmanimate) .fi .SH X Defaults The class of this application is \fIXmdAnimate\fR. .SH Editres: Xmanimate is Editres aware, so you can use 'editres' to see the names of the widgets in the instance hierarchy. motif-2.3.8/demos/programs/animate/superman2.xbm0000644000175000017500000000603612672140200016565 00000000000000/* $XConsortium: superman2.xbm /main/4 1995/07/17 18:20:34 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define superX2_width 88 #define superX2_height 29 #define superX2_x_hot 81 #define superX2_y_hot 29 static char superX2_bits[] = { 0xff, 0xff, 0x17, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0xff, 0xff, 0xef, 0xff, 0x7f, 0x00, 0xf0, 0xff, 0x07, 0x08, 0x80, 0xff, 0xff, 0x0f, 0xea, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x08, 0x50, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x50, 0xff, 0xff, 0xdf, 0xff, 0xff, 0x07, 0x7f, 0x00, 0x08, 0xfc, 0x4f, 0xff, 0xff, 0x07, 0xff, 0x03, 0x80, 0x00, 0x10, 0x80, 0xff, 0xbf, 0xff, 0x03, 0xf8, 0x00, 0x00, 0xc0, 0x02, 0x08, 0xc0, 0xff, 0xff, 0xff, 0x5d, 0x75, 0x00, 0x00, 0xc0, 0x42, 0x48, 0x30, 0xfc, 0xff, 0xff, 0x01, 0x50, 0x40, 0x00, 0xe0, 0xc2, 0x60, 0xf8, 0xf8, 0xff, 0xff, 0xff, 0x0f, 0x40, 0x80, 0xf1, 0x90, 0x31, 0xb4, 0xf1, 0xff, 0xff, 0xff, 0xdf, 0x3f, 0x00, 0xf8, 0x12, 0x1b, 0xaa, 0xf0, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xfb, 0x02, 0x0e, 0x6a, 0xf1, 0xff, 0xff, 0xff, 0x5f, 0xfc, 0xff, 0xd0, 0x00, 0x0e, 0x94, 0xf1, 0xff, 0xff, 0xff, 0x87, 0xe3, 0x3f, 0xa0, 0x02, 0x1b, 0xb8, 0xf8, 0xff, 0xff, 0xff, 0x7b, 0x1d, 0x0e, 0x40, 0x92, 0x31, 0x40, 0xfc, 0xff, 0xff, 0xff, 0x03, 0x68, 0x00, 0x80, 0xc2, 0x60, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x27, 0x00, 0x00, 0x40, 0x48, 0xc0, 0xff, 0xaf, 0xff, 0xff, 0xdf, 0x9f, 0x08, 0xe0, 0x1f, 0x08, 0x00, 0xfe, 0x57, 0xff, 0xff, 0x1f, 0x7d, 0x08, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x50, 0xff, 0xff, 0xef, 0xff, 0x81, 0xff, 0x0f, 0x40, 0x00, 0x00, 0x50, 0xff, 0xff, 0xef, 0xff, 0xff, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/demos/programs/animate/superman5.xbm0000644000175000017500000000603612672140200016570 00000000000000/* $XConsortium: superman5.xbm /main/4 1995/07/17 18:20:59 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define superX5_width 88 #define superX5_height 29 #define superX5_x_hot 81 #define superX5_y_hot 29 static char superX5_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xfe, 0xff, 0xff, 0x1f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x34, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0xff, 0xff, 0xff, 0x1f, 0x80, 0x7d, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x04, 0x00, 0x00, 0xfe, 0xfe, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x7b, 0x01, 0x00, 0x70, 0xff, 0xc7, 0xff, 0x21, 0x20, 0xfc, 0x03, 0x70, 0x01, 0x00, 0x00, 0xfc, 0x8b, 0xff, 0xc3, 0xc1, 0x03, 0x00, 0x70, 0x01, 0x00, 0x00, 0x00, 0x74, 0xff, 0x7d, 0xd5, 0x01, 0x00, 0x70, 0x01, 0x00, 0x00, 0x00, 0x58, 0xff, 0x03, 0xa0, 0x01, 0x60, 0x70, 0x00, 0x00, 0x00, 0x00, 0x68, 0xff, 0xff, 0x1f, 0x20, 0x00, 0x58, 0x21, 0x00, 0x00, 0x00, 0x90, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x40, 0x00, 0x79, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/demos/programs/animate/superman3.xbm0000644000175000017500000000603612672140200016566 00000000000000/* $XConsortium: superman3.xbm /main/4 1995/07/17 18:20:43 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define superX3_width 88 #define superX3_height 29 #define superX3_x_hot 82 #define superX3_y_hot 29 static char superX3_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xbf, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0x00, 0xc0, 0xff, 0x7f, 0x70, 0xfe, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x34, 0xff, 0xff, 0xff, 0xff, 0x06, 0x00, 0x00, 0xc0, 0x1f, 0x80, 0x7d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xfe, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x7b, 0x01, 0x00, 0x70, 0xff, 0xc7, 0xff, 0x21, 0x20, 0xfc, 0x03, 0x70, 0x01, 0x00, 0x00, 0xfc, 0x8b, 0xff, 0xc2, 0xc1, 0x03, 0x00, 0x70, 0x01, 0x00, 0x00, 0x00, 0x74, 0xff, 0x7c, 0xd5, 0x01, 0x00, 0x70, 0x01, 0x00, 0x00, 0x00, 0x58, 0xff, 0x03, 0xa0, 0x01, 0x60, 0x70, 0x00, 0x00, 0x00, 0x00, 0x68, 0xff, 0xff, 0x1f, 0x20, 0x00, 0x58, 0x21, 0x00, 0x00, 0x00, 0x90, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x40, 0x00, 0x79, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; motif-2.3.8/demos/programs/animate/README0000644000175000017500000000227512672140200015022 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:02:03 drk $ */ Xmanimate --------- This program demonstrates the following Motif features: - declaration of icon/bitmap using UIL for portability across visuals - exchange of value between UIL and C using Mrm. - use of the Motif form widget. - background procedure running while the client process is waiting for inputs (Xt intrinsics feature). Xmanimate allows the user to animate a set of pixmaps in a window. The pixmaps are not fixed by xmanimate but instead read at startup from existing UID files. The syntax of all the 'animation.uid' files follows some simple rules and one can easily add a new set of pixmaps to be animated using xmanimate. dog.uil, plane.uil and superman.uil are tree examples of animation data files. (superman.xbm are referenced in superman.uil). The default animation is 'dog'. To run the demo with the other animations, use the command: % xmanimate -anim plane % xmanimate -anim superman xmanimate.uil and xmanimate.c are the core components of the program. Daniel Dardailler. PS: add XmdAnimate in your resource environment, or run directly: (XENVIRONMENT=XmdAnimate xmanimate) motif-2.3.8/demos/programs/animate/superman.uil0000644000175000017500000000474212672140200016510 00000000000000! ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! $XConsortium: superman.uil /main/5 1995/07/14 09:41:07 drk $ !****************************************************************************** module superman !********************************************************************** ! anim_XXX variables must be changed to adapt the new animation ! stuff, at least the number of icons must be the right one. !********************************************************************** value anim_width : exported 700 ; anim_height : exported 200 ; ! prefered values for default initial animation frame size, ! used in motifanim.uil for the geometry of the drawingarea anim_number : exported 6 ; ! number of image in the animation, read by motifanim.c (by a ! MrmFetchLiteral) at run time anim_step : exported 4 ; ! number of horizontal pixels add before next icon drawing, ! read by motifanim.c (by a MrmFetchLiteral) at run time anim_backcolor : exported color('black', background); ! used in motifanim.uil for the color of the drawingarea value ! the following icon must have the syntax ! icon and must be exported since they are read ! by motifanim.c at run time. ! here we have : NAME=superman and N=[1,2,3,4,5,6] supermanicon1 : exported xbitmapfile("superman1.xbm"); supermanicon2 : exported xbitmapfile("superman2.xbm"); supermanicon3 : exported xbitmapfile("superman3.xbm"); supermanicon4 : exported xbitmapfile("superman4.xbm"); supermanicon5 : exported xbitmapfile("superman5.xbm"); supermanicon6 : exported xbitmapfile("superman6.xbm"); end module ; motif-2.3.8/demos/programs/animate/Makefile.am0000644000175000017500000000245013145162623016202 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/animate datadir = ${prefix}/share/Xm/animate EXTRA_DIST = dog.uil plane.uil superman.uil xmanimate.uil \ superman1.xbm superman2.xbm superman3.xbm superman4.xbm \ superman5.xbm superman6.xbm XmdAnimate.ad \ README animate.help animate.man xmanimate.man xmanimate_SOURCES = xmanimate.c CLEANFILES = dog.uid plane.uid superman.uid xmanimate.uid data_DATA = dog.uid plane.uid superman.uid xmanimate.uid $(xmanimate_SOURCES) \ $(EXTRA_DIST) bin_PROGRAMS = xmanimate LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib \ -I$(srcdir)/../../lib \ -I$(top_builddir)/lib \ ${X_CFLAGS} all: dog.uid plane.uid superman.uid xmanimate.uid dog.uid: dog.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil plane.uid: plane.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil superman.uid: superman.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil xmanimate.uid: xmanimate.uil ../../../clients/uil/uil -o $@ $? -I$(srcdir)/../../../clients/uil -I../../../clients/uil clean-local: $(RM) periodic.uid motif-2.3.8/demos/programs/Tree/0000755000175000017500000000000013211513007013474 500000000000000motif-2.3.8/demos/programs/Tree/Makefile.in0000644000175000017500000005503713211512766015506 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = tree$(EXEEXT) subdir = demos/programs/Tree ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_tree_OBJECTS = bxutil-c.$(OBJEXT) tree.$(OBJEXT) tree_OBJECTS = $(am_tree_OBJECTS) tree_LDADD = $(LDADD) tree_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(tree_SOURCES) DIST_SOURCES = $(tree_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Tree build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Tree datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = tree_SOURCES = bxutil-c.c tree.c data_DATA = $(EXTRA_DIST) $(tree_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Tree/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Tree/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list tree$(EXEEXT): $(tree_OBJECTS) $(tree_DEPENDENCIES) $(EXTRA_tree_DEPENDENCIES) @rm -f tree$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tree_OBJECTS) $(tree_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxutil-c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Tree/tree.c0000644000175000017500000007570213066310437014544 00000000000000/* * Copyright 1994, Integrated Computer Solutions, Inc. * * All Rights Reserved. * * Author: Rick Umali * * tree.c * */ /************************************************************** * INCLUDE FILES **************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /************************************************************** External functions **************************************************************/ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif extern Pixmap XPM_PIXMAP ARGLIST((w, pixmapName)) ARG(Widget, w) GRA(char **, pixmapName); /************************************************************** * STATIC FUNCTION DECLARATIONS **************************************************************/ static Widget CreateNode(Widget, Widget, char *, XmHierarchyNodeState); static void BuildHierarchy(Widget, WidgetClass); static void WriteUpHype(Widget); static void MakeControlPanel(Widget); static void ShowCB(Widget, XtPointer, XtPointer); static void ExplainCB(Widget, XtPointer, XtPointer); static void CallbackTogCB(Widget, XtPointer, XtPointer); static void QuitCB(Widget, XtPointer, XtPointer); static void OrientationCB(Widget, XtPointer, XtPointer); static void ConnectStyleCB(Widget, XtPointer, XtPointer); static void CompressStyleCB(Widget, XtPointer, XtPointer); static void ScaleCB(Widget, XtPointer, XtPointer); /************************************************************** * GLOBALS **************************************************************/ static Widget G_tree = NULL; static Pixmap close_folder, open_folder; static Widget core, composite, constraint, primitive, manager; static char* resources[]= {XmNhorizontalNodeSpace,XmNhorizontalDelta,XmNverticalNodeSpace,XmNverticalDelta}; /************************************************************** * SHOW CODE **************************************************************/ #define CODE "static void\n\ BuildHierarchy(Widget parent)\n\ {\n\ Widget tree, hierarchy;\n\ \n\ tree = XtCreateManagedWidget(\"hierarchy\", xiTreeWidgetClass, \n\ parent, NULL, (Cardinal) 0);\n\ \n\ core = CreateNode(tree, NULL, \"Core\", XmOpen);\n\ \n\ primitive = CreateNode(tree, core, \"Primitive\", XmOpen);\n\ {\n\ (void) CreateNode(tree, primitive, \"Icon Button\", XmAlwaysOpen);\n\ (void) CreateNode(tree, primitive, \"Data Field\", XmAlwaysOpen);\n\ }\n\ \n\ composite = CreateNode(tree, core, \"Composite\", XmOpen);\n\ constraint = CreateNode(tree, composite, \"Constraint\", XmOpen);\n\ \n\ manager = CreateNode(tree, constraint, \"Manager\", XmOpen);\n\ {\n\ (void) CreateNode(tree, manager, \"Button Box\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Color Selector\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Column\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Combination Box\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Dialog Box\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Extended List\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Font Selector\", XmAlwaysOpen);\n\ hierarchy = CreateNode(tree, manager, \"Hierarchy\", XmOpen);\n\ {\n\ (void) CreateNode(tree, hierarchy, \"Tree\", XmAlwaysOpen);\n\ (void) CreateNode(tree, hierarchy, \"Outline\", XmAlwaysOpen);\n\ }\n\ (void) CreateNode(tree, manager, \"Icon Box\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Pixmap Editor\", XmAlwaysOpen);\n\ (void) CreateNode(tree, manager, \"Stretch Widget\", XmAlwaysOpen);\n\ }\n\ }\n\ \n\ static Widget\n\ CreateNode(Widget w_parent, Widget parent_node, char * name, \n\ XmHierarchyNodeState state)\n\ {\n\ Arg args[10];\n\ Cardinal num_args;\n\ Widget w;\n\ XmString xmstring;\n\ \n\ xmstring = XmStringCreateSimple(name);\n\ \n\ num_args = 0;\n\ XtSetArg(args[num_args], XmNlabelString, xmstring); num_args++;\n\ XtSetArg(args[num_args], XmNnodeState, state); num_args++;\n\ XtSetArg(args[num_args], XmNparentNode, parent_node); num_args++;\n\ \n\ w = XtCreateManagedWidget(name, xmPushButtonWidgetClass,\n\ w_parent, args, num_args);\n\ \n\ XmStringFree(xmstring);\n\ \n\ return(w);\n\ }" /************************************************************** * RESOURCE FALLBACKS **************************************************************/ static String fallbacks[] = { "*background: grey", "*treeWidget.background: white", "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*", "*hypelabel*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*", "*show_code*fontList: -*-courier-*-r-normal-*-*-*-*-*-*-*-*-*", "*show_pb.labelString: Show Layout Code...", "*explain_pb.labelString: Other Resources...", "*ladder_lab.labelString: Connect Style", "*ladder.labelString: XmTreeLadder", "*direct.labelString: XmTreeDirect", "*compress_lab.labelString: Compress Style", "*leaves.labelString: XmTreeCompressLeaves", "*none.labelString: XmTreeCompressNone", "*all.labelString: XmTreeCompressAll", "*callback_tog.labelString: Node State Callback:", "*callback_lab.labelString: Not Added", "*callback_lab.background: wheat", "*changePixTog.labelString: Folder Pixmaps:", "*changePixLab.labelString: Default", "*changePixLab.background: wheat", "*autoclose_tog.labelString: Auto Close", "*orientation.labelString: Orientation", "*horizontal.labelString: XmHORIZONTAL", "*vertical.labelString: XmVERTICAL", "*quit_pb.labelString: Quit", "*XmLabel.alignment: XmALIGNMENT_BEGINNING", "*XmToggleButton*alignment: XmALIGNMENT_BEGINNING", "*treeWidget*XmPushButton.background: Wheat", "*horizontalNodeSpace.labelString: Horizontal Node Space", "*horizontalDelta.labelString: Horizontal Delta", "*verticalNodeSpace.labelString: Vertical Node Space", "*verticalDelta.labelString: Vertical Delta", NULL, }; /* * Function Name: main * Description: * Arguments: the usual suspects * Returns: nothing * */ int main(int argc, char **argv) { Widget top, big_pane; Arg args[10]; Cardinal num_args; XtAppContext app_con; Widget scrolled, right_pane; XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); num_args = 0; XtSetArg(args[num_args], XmNtitle, "Tree Demo"); num_args++; XtSetArg(args[num_args], XmNallowShellResize, True); num_args++; top = XtOpenApplication( &app_con, "Treedemo", NULL, 0, &argc, argv, fallbacks, sessionShellWidgetClass, args, num_args); num_args = 0; big_pane = XtVaCreateManagedWidget("bigPane", xmPanedWidgetClass, top, XmNorientation, XmHORIZONTAL, NULL); #if 0 scrolled = XtVaCreateManagedWidget( "scrollTree", xmScrolledWindowWidgetClass, big_pane, XmNresizeToPreferred, True, XmNpreferredPaneSize, 500, XmNallowResize, True, XmNscrollingPolicy, XmAUTOMATIC, XmNshowSash, True, XmNscrollBarDisplayPolicy, XmAS_NEEDED, NULL ); #else scrolled=big_pane; #endif BuildHierarchy(scrolled, xmTreeWidgetClass); /* right pane */ right_pane = XtVaCreateManagedWidget("rightPane", xmPanedWidgetClass, big_pane, XmNskipAdjust, False, XmNorientation, XmVERTICAL, NULL ); scrolled = XtVaCreateManagedWidget( "scrollMessage", xmScrolledWindowWidgetClass, right_pane, XmNscrollingPolicy, XmAUTOMATIC, XmNscrollBarDisplayPolicy, XmAS_NEEDED, XmNpaneMaximum, 200, XmNallowResize, True, NULL ); WriteUpHype(scrolled); MakeControlPanel(right_pane); /* Create the pixmaps which will be used later */ open_folder = XPM_PIXMAP( top, porsche ); close_folder = XPM_PIXMAP( top, stopsign ); XtRealizeWidget(top); XtAppMainLoop(app_con); return 0; } /************************************************************** * STATIC FUNCTIONS **************************************************************/ /* * Function Name: BuildHierarchy * Description: * Arguments: * Returns: Nothing * */ static void BuildHierarchy(Widget parent, WidgetClass class) { Widget tree, hierarchy; G_tree = tree = XtCreateManagedWidget("treeWidget", class, parent, NULL, (Cardinal) 0); XtVaSetValues(G_tree, XmNunitType, XmPIXELS, NULL); core = CreateNode(tree, NULL, "Core", XmOpen); primitive = CreateNode(tree, core, "Primitive", XmOpen); { (void) CreateNode(tree, primitive, "Icon Button", XmAlwaysOpen); (void) CreateNode(tree, primitive, "Data Field", XmAlwaysOpen); } composite = CreateNode(tree, core, "Composite", XmOpen); constraint = CreateNode(tree, composite, "Constraint", XmOpen); manager = CreateNode(tree, constraint, "Manager", XmOpen); { (void) CreateNode(tree, manager, "Button Box", XmAlwaysOpen); (void) CreateNode(tree, manager, "Color Selector", XmAlwaysOpen); (void) CreateNode(tree, manager, "Column", XmAlwaysOpen); (void) CreateNode(tree, manager, "Combination Box", XmAlwaysOpen); (void) CreateNode(tree, manager, "Dialog Box", XmAlwaysOpen); (void) CreateNode(tree, manager, "Extended List", XmAlwaysOpen); (void) CreateNode(tree, manager, "Font Selector", XmAlwaysOpen); hierarchy = CreateNode(tree, manager, "Hierarchy", XmOpen); { (void) CreateNode(tree, hierarchy, "Tree", XmAlwaysOpen); (void) CreateNode(tree, hierarchy, "Outline", XmAlwaysOpen); } (void) CreateNode(tree, manager, "Icon Box", XmAlwaysOpen); (void) CreateNode(tree, manager, "Pixmap Editor", XmAlwaysOpen); (void) CreateNode(tree, manager, "Stretch Widget", XmAlwaysOpen); } } static void NewChildCB(Widget w, XtPointer client, XtPointer call) { CreateNode((Widget)client, w, "New Child", XmAlwaysOpen); } static void getNodesCB(Widget w, XtPointer client, XtPointer call) { WidgetList list = XmHierarchyGetChildNodes(w); int i; if (!list) printf ("Widget '%s' has no node children.\n",XtName(w)); else for (i=0; list[i]; i++) { printf ("Widget '%s' has a node child '%s'.\n",XtName(w), XtName(list[i])); } XtFree((char*)list); { #if 1 #define wingdogs_width 32 #define wingdogs_height 32 static unsigned char wingdogs_bits[] = { 0x60, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x0f, 0x00, 0x00, 0x40, 0x3e, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x80, 0x84, 0xff, 0x00, 0xc0, 0x86, 0xff, 0x00, 0xc0, 0x07, 0xff, 0x21, 0xe0, 0x0f, 0xfe, 0x23, 0xf0, 0x0f, 0xfe, 0x23, 0xfc, 0x1d, 0xfe, 0x13, 0xfe, 0x39, 0xfc, 0x13, 0xff, 0x3f, 0xfc, 0x83, 0xff, 0x9f, 0xfc, 0xc1, 0xff, 0x0f, 0xfe, 0xe0, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x7f, 0xf6, 0xff, 0xff, 0x1f, 0xfb, 0xff, 0xff, 0x07, 0xf8, 0xfd, 0xff, 0x03, 0xbc, 0xf9, 0xff, 0x01, 0x3c, 0xf9, 0xff, 0x01, 0x3e, 0xf0, 0xf7, 0x00, 0x1f, 0xe0, 0x77, 0x00, 0x1f, 0x80, 0x77, 0x00, 0x8f, 0x00, 0x6f, 0x00, 0xc7, 0x00, 0x6e, 0x80, 0x07, 0x00, 0x7c, 0x80, 0x0d, 0x00, 0xf8, 0x80, 0x1f, 0x00, 0xf0, 0x01}; Window root = RootWindowOfScreen(XtScreen(w)); Pixmap pixmap = XCreateBitmapFromData(XtDisplay(w),root, (char *)wingdogs_bits, wingdogs_width, wingdogs_height); XtVaSetValues(w,XmNnodeCloseFolderPixmap, pixmap, NULL); #endif } } /* * Function Name: CreateNode * Description: * Arguments: * Returns: Widget * */ static Widget CreateNode(Widget w_parent, Widget parent_node, char * name, XmHierarchyNodeState state) { Arg args[10]; Cardinal num_args; Widget w; XmString xmstring; xmstring = XmStringCreateSimple(name); num_args = 0; XtSetArg(args[num_args], XmNlabelString, xmstring); num_args++; XtSetArg(args[num_args], XmNnodeState, state); num_args++; XtSetArg(args[num_args], XmNparentNode, parent_node); num_args++; XtSetArg(args[num_args], XmNlineStyle, 99); num_args++; w = XtCreateManagedWidget(name, xmPushButtonWidgetClass, w_parent, args, num_args); XtAddCallback(w, XmNactivateCallback, NewChildCB, w_parent); XmStringFree(xmstring); return(w); } /* * Function Name: WriteUpHype * Description: Prints up the "Hype" message in a label * Arguments: the usual suspects * Returns: nothing */ static void WriteUpHype(Widget parent) { Arg args[5]; Cardinal argcnt; Widget w; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Tree Widget displays hierarchical data in a tree layout with a Motif\n\ look and feel. The Tree widget displayed below contains entries corresponding\n\ to Motif widgets. The nodes are XmPushButtons, but the tree can accept any type of widget.\n\ \n\ The Tree Widget uses \"constraints\" to arrange the children with the right layout.\n\ To see the code to generate the tree below, press \"Show Layout Code...\".\n\ \n\ There are two Connect Styles, XmTreeDirect and XmTreeLadder. To see the\n\ difference in the way the tree is displayed in each of these modes, \n\ select the Connect Style option.\n\ \n\ There are two orientations, XmHORIZONTAL and XmVERTICAL. To see the\n\ difference in the way the tree is displayed in each of these modes, \n\ select the Orientation option.\n\ \n\ There are three compression styles, XmTreeCompressLeaves, XmTreeCompressAll \n\ and XmTreeCompressNone. To see the difference in the way the tree is displayed in each of these modes, \n\ set the orientation to XmVERTICAL and select the Compress Style option.\n\ \n\ A developer may add a Node State Callback, which gets fired off each\n\ time a node changes state. Set the Node State Callback toggle to \n\ selected. This will add the callback to the tree. Now open or close any \n\ node in the tree and see what happens. It can be annoying, so don't leave\n\ it on !\n\ \n\ Color pixmaps may be used instead of the Default images that look like\n\ little folders. Select the Folder Pixmaps toggle to see how the tree\n\ might look with user defined pixmaps.\n\ \n\ Folders may be forced to close all their descendents folder buttons when\n\ they become closed. Set the Auto Close toggle button to selected.\n\ Close one of the nodes close to the root. When you open it again, you \n\ will see that all its children are closed.\n\ \n\ If you press on a node itself, you will see a list of its node children\n\ echoed to standard output.\n\ \n\ Press \"Other Resources...\" to see the resources that manipulate the Tree's look and feel.", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNmarginHeight, 10); argcnt++; XtSetArg(args[argcnt], XmNmarginWidth, 10); argcnt++; XtSetArg(args[argcnt], XmNalignment, XmALIGNMENT_BEGINNING); argcnt++; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; w = XtCreateManagedWidget("hypelabel", xmLabelWidgetClass, parent, args, argcnt); XmStringFree(xmstring); } /* * Function Name: ShowCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void ShowCB(Widget w, XtPointer client, XtPointer call) { static Widget info = NULL; if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; XmString ok_xmstring; ok_xmstring = XmStringCreateSimple("OK"); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Show Code..."); argcnt++; /* XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; */ XtSetArg(args[argcnt], XmNokLabelString, ok_xmstring); argcnt++; XtSetArg(args[argcnt], XmNallowShellResize, True); argcnt++; info = XmCreateTemplateDialog(G_tree, "show_code", args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNcolumns, 60); argcnt++; XtSetArg(args[argcnt], XmNrows, 20); argcnt++; XtSetArg(args[argcnt], XmNvalue, CODE); argcnt++; XtSetArg(args[argcnt], XmNeditable, False); argcnt++; XtSetArg(args[argcnt], XmNeditMode, XmMULTI_LINE_EDIT); argcnt++; temp = XmCreateScrolledText(info, "show_text", args, argcnt); XtManageChild(temp); XmStringFree(ok_xmstring); } XtManageChild(info); } /* * Function Name: ExplainCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void ExplainCB(Widget w, XtPointer client, XtPointer call) { static Widget info = NULL; if (info == NULL) { Arg args[5]; Cardinal argcnt; Widget temp; XmString xmstring; xmstring = XmStringCreateLtoR( "The Motif Tree and Outline widget actually derive behavior from the\n\ Hierarchy Widget. The Hierarchy widget provides resources that specify\n\ the relationships between children.\n\ \n\ XmNautoClose specifies whether the Tree or Outline automatically closes\n\ any nodes if a parent node is closed. To see the behavior, press the Auto\n\ Close toggle, then close and reopen the Core.\n\ \n\ XmNnodeState is a constraint resource on a child of the Tree or Outline.\n\ It determines whether a node is Open, Closed, Hidden, or Always Visible.\n\ Use \"Show Layout Code...\" to see how this demo used this resource.\n\ \n\ XmNparentNode specifies this node's parent. This resource determines the\n\ node's logical parent (the widget instance tree says the node is a child of\n\ the Tree or Outline, but the parentNode will specify where on the layout\n\ the node will appear. Use \"Show Layout Code...\" to see how this demo used\n\ this resource.\n\ \n\ XmNlineColor allows the programmer to specify the color of the lines that\n\ connect the nodes.\n\ \n\ XmNnodeStateCallback provides a way to receive feedback when any node is\n\ opened or closed. To use this callback, press the Node State Callback toggle.", XmSTRING_DEFAULT_CHARSET); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Explanation"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateInformationDialog(G_tree, "explain", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XmStringFree(xmstring); } XtManageChild(info); } /* * Function Name: ConnectStyleCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void ConnectStyleCB(Widget w, XtPointer client, XtPointer call) { XtPointer userData; XtVaGetValues(w,XmNuserData,&userData,NULL); XtVaSetValues(G_tree,XmNconnectStyle,userData,NULL); } /* * Function Name: CompressStyleCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void CompressStyleCB(Widget w, XtPointer client, XtPointer call) { XtPointer userData; XtVaGetValues(w,XmNuserData,&userData,NULL); XtVaSetValues(G_tree,XmNcompressStyle,userData,NULL); } /* * Function Name: NodeStateCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ void NodeStateCB(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; Widget info, temp; XmHierarchyNodeStateData *node_data = (XmHierarchyNodeStateData *) call; XmString xmstring; char *name; char buf[100]; argcnt = 0; XtSetArg(args[argcnt], XmNlabelString, &xmstring); argcnt++; XtGetValues(node_data->widget, args, argcnt); XmStringGetLtoR(xmstring, XmFONTLIST_DEFAULT_TAG, &name); if (node_data->state == XmOpen) sprintf(buf, "%s has switched to the XmOpen state.", name); else if (node_data->state == XmClosed) sprintf(buf, "%s has switched to the XmClosed state.", name); else if (node_data->state == XmAlwaysOpen) sprintf(buf, "%s has switched to the XmAlwaysOpen state.", name); else if (node_data->state == XmHidden) sprintf(buf, "%s has switched to the XmHidden state.", name); else sprintf(buf, "%s has switched node state.", name); xmstring = XmStringCreateSimple(buf); argcnt = 0; XtSetArg(args[argcnt], XmNtitle, "Node State Changed"); argcnt++; XtSetArg(args[argcnt], XmNmessageString, xmstring); argcnt++; info = XmCreateInformationDialog(w, "nodechange", args, argcnt); temp = XmMessageBoxGetChild(info, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(temp); temp = XmMessageBoxGetChild(info, XmDIALOG_HELP_BUTTON); XtUnmanageChild(temp); XmStringFree(xmstring); XtFree(name); XtManageChild(info); } static void ChangePixmap(Widget w, XtPointer client, XtPointer call) { Widget label = (Widget)client; static Boolean TreeUsingPixmaps = False; if (TreeUsingPixmaps){ XtVaSetValues( G_tree, XmNopenFolderPixmap, XmUNSPECIFIED_PIXMAP, XmNcloseFolderPixmap, XmUNSPECIFIED_PIXMAP, NULL ); XtVaSetValues( label, XmNlabelString, XmStringCreateSimple("Default"), NULL); } else { XtVaSetValues( G_tree, XmNopenFolderPixmap, open_folder, XmNcloseFolderPixmap, close_folder, NULL ); XtVaSetValues( label, XmNlabelString, XmStringCreateSimple("User Defined"), NULL); } TreeUsingPixmaps = !TreeUsingPixmaps; } /* * Function Name: CallbackTogCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void CallbackTogCB(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; Widget lab = (Widget) client; XmString xmstring; if (XmToggleButtonGetState(w)) { XtAddCallback(G_tree, XmNnodeStateCallback, NodeStateCB, NULL); xmstring = XmStringCreateSimple("Added"); } else { XtRemoveAllCallbacks(G_tree, XmNnodeStateCallback); xmstring = XmStringCreateSimple("Not Added"); } argcnt = 0; XtSetArg(args[argcnt], XmNlabelString, xmstring); argcnt++; XtSetValues(lab, args, argcnt); XmStringFree(xmstring); } /* * Function Name: AutoCloseTogCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void AutoCloseTogCB(Widget w, XtPointer client, XtPointer call) { Arg args[5]; Cardinal argcnt; argcnt = 0; if (XmToggleButtonGetState(w)) { XtSetArg(args[argcnt], XmNautoClose, True); argcnt++; } else { XtSetArg(args[argcnt], XmNautoClose, False); argcnt++; } XtSetValues(G_tree, args, argcnt); } /* * Function Name: OrientationCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void OrientationCB(Widget w, XtPointer client, XtPointer call) { XtPointer userData; XtVaGetValues(w,XmNuserData,&userData,NULL); XtVaSetValues(G_tree,XmNorientation,userData,NULL); } /* * Function Name: ScaleCB * Description: * Arguments: This is an XtCallback * Returns: Nothing */ static void ScaleCB(Widget w, XtPointer client, XtPointer call) { XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct *)call; XtVaSetValues(G_tree, resources[(int)client], cbs->value, NULL); } /* * Function Name: QuitCB * Description: Exits the program * Arguments: This is an XtCallback * Returns: Nothing */ static void QuitCB(Widget w, XtPointer client, XtPointer call) { exit(0); } /* * Function Name: MakeControlPanel * Description: * Arguments: * Returns: nothing */ static void MakeControlPanel(Widget right_pane) { Arg args[5]; Cardinal argcnt; Widget tog, lab, pb, bbox, leftBbox, rightBbox; /* this is a clever use of the ButtonBox -- if two of them have to ** fill the same vertical space and each has "equalSize" set, then ** each row will be lined up with the item in the other box */ argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillNone); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmHORIZONTAL); argcnt++; XtSetArg(args[argcnt], XmNshowSash, False); argcnt++; XtSetArg(args[argcnt], XmNskipAdjust, True); argcnt++; bbox = XtCreateManagedWidget("buttonBox1", xmButtonBoxWidgetClass, right_pane, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillNone); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; leftBbox = XtCreateManagedWidget("buttonBox1", xmButtonBoxWidgetClass, bbox, args, argcnt); argcnt = 0; XtSetArg(args[argcnt], XmNequalSize, True); argcnt++; XtSetArg(args[argcnt], XmNfillOption, XmFillNone); argcnt++; XtSetArg(args[argcnt], XmNorientation, XmVERTICAL); argcnt++; rightBbox = XtCreateManagedWidget("buttonBox1", xmButtonBoxWidgetClass, bbox, args, argcnt); XtVaCreateManagedWidget("ladder_lab", xmLabelWidgetClass, leftBbox, NULL); { Widget option = XmCreateOptionMenu(rightBbox, "option", NULL,0); Widget pulldown = XmCreatePulldownMenu(option, "pulldown", NULL, 0); Widget direct, ladder; XmTreeConnectStyle connectStyle = XmTreeDirect; XtManageChild(direct = XmCreatePushButton(pulldown, "direct", NULL, 0)); XtVaSetValues(direct, XmNuserData, XmTreeDirect, NULL); XtManageChild(ladder = XmCreatePushButton(pulldown, "ladder", NULL, 0)); XtVaSetValues(ladder, XmNuserData, XmTreeLadder, NULL); XtAddCallback(direct,XmNactivateCallback, ConnectStyleCB, NULL); XtAddCallback(ladder,XmNactivateCallback, ConnectStyleCB, NULL); XtVaSetValues(option,XmNsubMenuId,pulldown,NULL); XtVaGetValues(G_tree, XmNconnectStyle, &connectStyle, NULL); if (XmTreeDirect == connectStyle) XtVaSetValues(option,XmNmenuHistory,direct,NULL); else XtVaSetValues(option,XmNmenuHistory,ladder,NULL); XtManageChild(option); } XtVaCreateManagedWidget("compress_lab", xmLabelWidgetClass, leftBbox, NULL); { Widget option = XmCreateOptionMenu(rightBbox, "option", NULL,0); Widget pulldown = XmCreatePulldownMenu(option, "pulldown", NULL, 0); Widget leaves, all, none; XmTreeCompressStyle compressStyle = XmTreeCompressLeaves; XtManageChild(leaves = XmCreatePushButton(pulldown, "leaves", NULL, 0)); XtVaSetValues(leaves, XmNuserData, XmTreeCompressLeaves, NULL); XtManageChild(all = XmCreatePushButton(pulldown, "all", NULL, 0)); XtVaSetValues(all, XmNuserData, XmTreeCompressAll, NULL); XtManageChild(none = XmCreatePushButton(pulldown, "none", NULL, 0)); XtVaSetValues(none, XmNuserData, XmTreeCompressNone, NULL); XtAddCallback(leaves,XmNactivateCallback, CompressStyleCB, NULL); XtAddCallback(all,XmNactivateCallback, CompressStyleCB, NULL); XtAddCallback(none,XmNactivateCallback, CompressStyleCB, NULL); XtVaSetValues(option,XmNsubMenuId,pulldown,NULL); XtVaGetValues(G_tree, XmNcompressStyle, &compressStyle, NULL); if (XmTreeCompressLeaves == compressStyle) XtVaSetValues(option,XmNmenuHistory,leaves,NULL); else if (XmTreeCompressAll == compressStyle) XtVaSetValues(option,XmNmenuHistory,all,NULL); else XtVaSetValues(option,XmNmenuHistory,none,NULL); XtManageChild(option); } tog = XtVaCreateManagedWidget("callback_tog", xmToggleButtonWidgetClass, leftBbox, NULL); lab = XtVaCreateManagedWidget("callback_lab", xmLabelWidgetClass, rightBbox, NULL); XtAddCallback(tog, XmNvalueChangedCallback, CallbackTogCB, (XtPointer) lab); tog = XtVaCreateManagedWidget("changePixTog", xmToggleButtonWidgetClass, leftBbox, NULL); lab = XtVaCreateManagedWidget("changePixLab", xmLabelWidgetClass, rightBbox, NULL); XtAddCallback(tog, XmNvalueChangedCallback, ChangePixmap, (XtPointer) lab); tog = XtVaCreateManagedWidget("autoclose_tog", xmToggleButtonWidgetClass, leftBbox, NULL); { Boolean set; XtVaGetValues(G_tree, XmNautoClose, &set, NULL); XtVaSetValues(tog, XmNset, set, NULL); } XtAddCallback(tog, XmNvalueChangedCallback, AutoCloseTogCB, NULL); /* this is just to line things up nicely */ (void)XtVaCreateManagedWidget("dummy", xmLabelWidgetClass,rightBbox, XmNlabelType, XmPIXMAP, XmNlabelPixmap, XmUNSPECIFIED_PIXMAP, NULL); XtVaCreateManagedWidget("orientation", xmLabelWidgetClass, leftBbox, NULL); { Widget option = XmCreateOptionMenu(rightBbox, "option", NULL,0); Widget pulldown = XmCreatePulldownMenu(option, "pulldown", NULL, 0); Widget horizontal, vertical; unsigned char orientation = XmHORIZONTAL; XtManageChild(horizontal = XmCreatePushButton(pulldown, "horizontal", NULL, 0)); XtVaSetValues(horizontal, XmNuserData, XmHORIZONTAL, NULL); XtManageChild(vertical = XmCreatePushButton(pulldown, "vertical", NULL, 0)); XtVaSetValues(vertical, XmNuserData, XmVERTICAL, NULL); XtAddCallback(horizontal,XmNactivateCallback, OrientationCB, NULL); XtAddCallback(vertical,XmNactivateCallback, OrientationCB, NULL); XtVaSetValues(option,XmNsubMenuId,pulldown,NULL); XtVaGetValues(G_tree, XmNorientation, &orientation, NULL); if (XmHORIZONTAL == orientation) XtVaSetValues(option,XmNmenuHistory,horizontal,NULL); else XtVaSetValues(option,XmNmenuHistory,vertical,NULL); XtManageChild(option); } { int i; for (i=0;i #include #include #include /* * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI. */ #if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__) # include # if defined(HAVE_MALLOC_H) # include # elif defined(HAVE_SYS_MALLOC_H) # include # endif #endif /***************************************************************************** * TYPDEFS AND DEFINES *****************************************************************************/ /* * Undefine this if you want to use native strcasecmp. */ #define LOCAL_STRCASECMP #ifdef _NO_PROTO #ifdef NeedFunctionPrototypes #undef NeedFunctionPrototypes #endif #endif /* * Define SUPPORTS_WCHARS if the system supports wide character sets */ #if !defined(VAX) && !defined(__CENTERLINE__) #define SUPPORTS_WCHARS #endif /* * Handy definition used in SET_BACKGROUND_COLOR */ #define UNSET (-1) /* * Set state of inclusion of prototypes properly */ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif #ifdef NeedFunctionPrototypes #ifdef __cplusplus #define UARG(a, b) a, #define GRAU(a, b) a) #else #define UARG(a, b) a b, #define GRAU(a, b) a b) #endif #else #define UARG(a, b) a b; #define GRAU(a, b) a b; #endif /* * Set up strcasecmp function */ #if defined(LOCAL_STRCASECMP) #define STRCASECMP StrCasecmp #ifndef NeedFunctionPrototypes static int StrCasecmp(); #else static int StrCasecmp(char*, char*); #endif #else #define STRCASECMP strcasecmp #endif /* * Define XTPOINTER so it works with all releases of * Xt and c++. */ #ifdef __cplusplus #if XtSpecificationRelease < 5 #define XTPOINTER char * #else #define XTPOINTER XPointer #endif #else #define XTPOINTER XtPointer #endif /* * The following enum is used to support wide character sets. * Use this enum for references into the Common Wide Characters array. * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last * entry in the enum. This will maintain correct memory usage, etc. */ enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab, WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR, WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne, NUM_COMMON_WCHARS }; /***************************************************************************** * GLOBAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * EXTERNAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * STATIC DECLARATION *****************************************************************************/ #ifndef NeedFunctionPrototypes #ifndef SUPPORTS_WCHARS static int mblen (); #endif static int strlenWc (); static size_t doMbstowcs (); static size_t doWcstombs (); static void copyWcsToMbs (); static int dombtowc (); static Boolean extractSegment (); static XmString StringToXmString (); static char* getNextCStrDelim (); static int getCStrCount (); static wchar_t *CStrCommonWideCharsGet (); #else #ifndef SUPPORTS_WCHARS static int mblen (char*, size_t); #endif static int strlenWc (wchar_t*); static size_t doMbstowcs (wchar_t*, char*, size_t); static size_t doWcstombs (char*, wchar_t*, size_t); static void copyWcsToMbs (char*, wchar_t*, int, Boolean); static int dombtowc (wchar_t*, char*, size_t); static Boolean extractSegment (wchar_t**, wchar_t**, int *, wchar_t**, int*, int*, Boolean*); static XmString StringToXmString (char*); static char* getNextCStrDelim (char*); static int getCStrCount (char*); static wchar_t *CStrCommonWideCharsGet (); #endif /***************************************************************************** * STATIC CODE *****************************************************************************/ #if defined(LOCAL_STRCASECMP) /* * Function: * cmp = StrCasecmp(s1, s2); * Description: * Compare two strings ignoring case * Input: * s1 - char * : string 1 to compare * s2 - char * : string 2 to compare * Output: * int : 0; s1 == s2 * 1; s1 != s2 */ static int StrCasecmp ARGLIST((s1, s2)) ARG(register char *, s1) GRA(register char *, s2) { register int c1, c2; while (*s1 && *s2) { c1 = isupper(*s1) ? tolower(*s1) : *s1; c2 = isupper(*s2) ? tolower(*s2) : *s2; if (c1 != c2) { return(1); } s1++; s2++; } if (*s1 || *s2) { return(1); } return(0); } #endif #ifndef SUPPORTS_WCHARS /* * Function: * len = mblen(s, n); * Description: * The mblen function for platforms that don't have one. This * function simply returns a length of 1 since no wide character * support exists for this platform. * Input: * s - char * : the character string to get the length from * n - size_t : the size of the string * Output: * int : always 1 */ static int mblen ARGLIST((s, n)) ARG(char *, s) GRA(size_t, n) { return(1); } #endif /* * Function: * len = strlenWc(ptr); * Description: * Return the number of characters in a wide character string (not * the characters in the resultant mbs). * Input: * ptr - wchar_t* : pointer to the wcs to count * Output: * int : the number of characters found */ static int strlenWc ARGLIST((ptr)) GRA(wchar_t *,ptr) { register wchar_t *p = ptr; register int x = 0; if (!ptr) return(0); while (*p++) x++; return (x); } /* * Function: * bytesConv = doMbstowcs(wcs, mbs, n); * Description: * Create a wcs string from an input mbs. * Input: * wcs - wchar_t* : pointer to result buffer of wcs * mbs - char* : pointer to the source mbs * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doMbstowcs ARGLIST((wcs, mbs, n)) ARG(wchar_t *,wcs) ARG(char *, mbs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && mbs[i] != 0; ++i) { wcs[i] = mbs[i]; } wcs[i++] = 0; return(i); #else return(mbstowcs(wcs, mbs, n)); #endif } /* * Function: * bytesConv = doWcstombs(wcs, mbs, n); * Description: * Create a mbs string from an input wcs. * Input: * wcs - wchar_t* : pointer to the source wcs * mbs - char* : pointer to result mbs buffer * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doWcstombs ARGLIST((mbs, wcs, n)) ARG(char *, mbs) ARG(wchar_t *, wcs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && wcs[i] != 0; ++i) { mbs[i] = wcs[i]; } mbs[i] = 0; return(i); #else return(wcstombs(mbs, wcs, n)); #endif } /* * Function: * copyWcsToMbs(mbs, wcs, len); * Description: * Create a mbs string from an input wcs. This function allocates * a buffer if necessary. * Input: * mbs - char* : destination for the converted/copied output * wcs - wchar_t* : pointer to wcs to copy/convert * len - int : the number of wchar_t' to convert * process_it - Boolean : True if processing of quoted charcters, * False if blind. * Output: * None */ static void copyWcsToMbs ARGLIST((mbs, wcs, len, process_it)) ARG(char *, mbs) ARG(wchar_t *, wcs) ARG(int, len) GRA(Boolean, process_it) { static wchar_t *tbuf; static int tbufSize = 0; int numCvt; int lenToConvert; wchar_t *fromP = wcs; wchar_t *x = &fromP[len]; wchar_t *toP; wchar_t *commonWChars = CStrCommonWideCharsGet(); wchar_t tmp; /* * Make sure there's room in the buffer */ if (tbufSize < len) { tbuf = (wchar_t*)realloc((char*)tbuf, (len + 1) * sizeof(wchar_t)); tbufSize = len; } /* * Now copy and process */ toP = tbuf; lenToConvert = 0; while (fromP < x) { /* * Check for quoted characters */ if ((*fromP == commonWChars[WBackSlash]) && process_it) { fromP++; /* Skip quote */ if (fromP == x) /* Hanging quote? */ { *toP++ = commonWChars[WBackSlash]; lenToConvert++; break; } tmp = *fromP++; if (tmp == commonWChars[WideN]) { *toP++ = commonWChars[WNewLine]; } else if (tmp == commonWChars[WideT]) { *toP++ = commonWChars[WTab]; } else if (tmp == commonWChars[WideR]) { *toP++ = commonWChars[WCarriageReturn]; } else if (tmp == commonWChars[WideF]) { *toP++ = commonWChars[WFormFeed]; } else if (tmp == commonWChars[WideV]) { *toP++ = commonWChars[WVerticalTab]; } else if (tmp == commonWChars[WBackSlash]) { *toP++ = commonWChars[WBackSlash]; } else { /* * No special translation needed */ *toP++ = tmp; } } else { *toP++ = *fromP++; } lenToConvert++; } numCvt = doWcstombs(mbs, tbuf, lenToConvert); mbs[numCvt] = '\0'; } /* * Function: * status = dombtowc(wide, multi, size); * Description: * Convert a multibyte character to a wide character. * Input: * wide - wchar_t * : where to put the wide character * multi - char * : the multibyte character to convert * size - size_t : the number of characters to convert * Output: * 0 - if multi is a NULL pointer or points to a NULL character * #bytes - number of bytes in the multibyte character * -1 - multi is an invalid multibyte character. * * NOTE: if wide is NULL, then this returns the number of bytes in * the multibyte character. */ static int dombtowc ARGLIST((wide, multi, size)) ARG(wchar_t *, wide) ARG(char *, multi) GRA(size_t, size) { int retVal = 0; #ifndef SUPPORTS_WCHARS if ((multi == NULL) || (*multi == '\000')) { if (wide) wide[0] = '\0'; return (0); } for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++) { if (wide != NULL) { wide[retVal] = multi[retVal]; } } #else retVal = mbtowc(wide, multi, size); #endif return(retVal); } /* * Function: * ptr = getNextSepartor(str); * Description: * Parse through a string looking for the next compound string * field separator * Inputs: * str - wchar_t* : the address of address of the string to parse * Outputs: * ptr - wchar_t* : pointer to character, if found, points to end * of string otherwise ('\0'). */ static wchar_t* getNextSeparator ARGLIST((str)) GRA(wchar_t *, str) { wchar_t *ptr = str; wchar_t *commonWChars = CStrCommonWideCharsGet(); while (*ptr) { /* * Check for separator */ if ((*ptr == commonWChars[WHash]) || (*ptr == commonWChars[WQuote]) || (*ptr == commonWChars[WColon])) { return(ptr); } else if (*ptr == commonWChars[WBackSlash]) { ptr++; if (*ptr) ptr++; /* Skip quoted character */ } else { ptr++; } } return(ptr); } /* * Function: * more = * extractSegment(str, tagStart, tagLen, txtStart, txtLen, * pDir, pSep); * Description: * Parse through a string version of a compound string and extract * the first compound string segment from the string. * Inputs: * str - char** : the address of address of the string to parse * tagStart - char** : address to return pointer to tag start into * tagLen - int* : address where to return the tag length into * txtStart - char** : address to return the text start into * txtLen - int* : address where to return the text length * pDir - int* : address to return the string direction into * pSep - Boolean * : address to return the separtor into * Outputs: * more - Boolean : True if more of the string to parse. * False means done. */ static Boolean extractSegment ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep)) ARG(wchar_t **, str) ARG(wchar_t **, tagStart) ARG(int *, tagLen) ARG(wchar_t **, txtStart) ARG(int *, txtLen) ARG(int *, pDir) GRA(Boolean *, pSep) { wchar_t *start; wchar_t *text; int textL; Boolean tagSeen; wchar_t *tag; int tagL; Boolean modsSeen; Boolean sep; int dir; Boolean done; int *lenUp; Boolean checkDir; wchar_t *commonWChars; wchar_t emptyStrWcs[1]; /* * Initialize variables */ text = NULL; textL = 0; tagSeen = False; tag = NULL; tagL = 0; modsSeen = False; dir = XmSTRING_DIRECTION_L_TO_R; sep = False; done = False; lenUp = NULL; commonWChars = CStrCommonWideCharsGet(); /* * Guard against nulls */ if (!(start = *str)) { start = emptyStrWcs; emptyStrWcs[0] = commonWChars[WNull]; } /* * If the first character of the string isn't a # or a ", then we * just have a regular old simple string. Do the same the thing for * the empty string. */ if ((*start == '\0') || (start != getNextSeparator(start))) { text = start; if (!(textL = strlenWc(start))) { text = NULL; } start += textL; } else { done = False; while (!done) { if (*start == commonWChars[WHash]) { if (tagSeen) { done = True; break; } else { tagSeen = True; tag = ++start; start = getNextSeparator(tag); if ((tagL = start - tag) == 0) { tag = NULL; /* Null tag specified */ } } } else if (*start == commonWChars[WQuote]) { text = ++start; start = getNextSeparator(start); while (!((*start == commonWChars[WQuote]) || (*start == commonWChars[WNull]))) { start = getNextSeparator(++start); } if ((textL = start - text) == 0) { text = NULL; /* Null text specified */ } /* * if a quote, skip over it */ if (*start == commonWChars[WQuote]) { start++; } done = True; } else if (*start == commonWChars[WColon]) { if (modsSeen) { done = True; break; } /* * If the next character is a t or f, the we've got * a separator. */ modsSeen = True; checkDir = False; start++; if ((*start == commonWChars[WideT]) || (*start == commonWChars[WideUT]) || (*start == commonWChars[WideOne])) { sep = True; start++; checkDir = True; } else if ((*start == commonWChars[WideF]) || (*start == commonWChars[WideUF]) || (*start == commonWChars[WideZero])) { sep = False; start++; checkDir = True; } else if ((*start == commonWChars[WideR]) || (*start == commonWChars[WideUR])) { start++; dir = XmSTRING_DIRECTION_R_TO_L; } else if ((*start == commonWChars[WideL]) || (*start == commonWChars[WideUL])) { start++; dir = XmSTRING_DIRECTION_L_TO_R; } /* * Look for direction if necessary. This requires a bit of * look ahead. */ if (checkDir && (*start == commonWChars[WColon])) { if ((*(start + 1) == commonWChars[WideL]) || (*(start + 1) == commonWChars[WideUL])) { dir = XmSTRING_DIRECTION_L_TO_R; start += 2; } else if ((*(start + 1) == commonWChars[WideR]) || (*(start + 1) == commonWChars[WideUR])) { dir = XmSTRING_DIRECTION_R_TO_L; start+=2; } } } else { /* * A bad string format! We'll just skip the character. */ start++; } } } /* * Now fill in return values */ if (*str) *str = start; if (tagStart) *tagStart = tag; if (tagLen) *tagLen = tagL; if (txtStart) *txtStart = text; if (txtLen) *txtLen = textL; if (pDir) *pDir = dir; if (pSep) *pSep = sep; return ((*start == commonWChars[WNull]) ? False : True); } /* * Function: * xstr = StringToXmString(str); * Description: * Parse a string into an XmString. * Inputs: * str - char * : the string to parse * Outputs: * xstr - XmString : the allocated return structure */ static XmString StringToXmString ARGLIST((str)) GRA(char *,str) { static char* tagBuf = NULL; static int tagBufLen = 0; static char* textBuf = NULL; static int textBufLen = 0; wchar_t *ctx; wchar_t *tag; int tagLen; wchar_t *text; int textLen; Boolean sep; int dir; Boolean more; wchar_t *wcStr; int curDir; XmString xmStr; XmString s1; XmString s2; if (!str) return(NULL); /* * For expediencies sake, we'll overallocate this buffer so that * the wcs is guaranteed to fit (1 wc per byte in original string). */ wcStr = (wchar_t*)malloc((strlen(str) + 1) * sizeof(wchar_t)); doMbstowcs(wcStr, str, strlen(str) + 1); /* * Create the beginning segment */ curDir = XmSTRING_DIRECTION_L_TO_R; xmStr = XmStringDirectionCreate(curDir); /* * Convert the string. */ more = True; ctx = wcStr; while (more) { more = extractSegment(&ctx, &tag, &tagLen, &text, &textLen, &dir, &sep); /* * Pick up a direction change */ if (dir != curDir) { #if defined(VMS) || (defined(__osf__) && defined(__alpha)) /* * This is required on DEC Windows systems because they've * added the REVERT direction. */ s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); #endif curDir = dir; s1 = XmStringDirectionCreate(curDir); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Create the segment. Text and tag first. */ if (textLen) { if (textBufLen <= (textLen * sizeof(wchar_t))) { textBufLen = (textLen + 1) * sizeof(wchar_t); textBuf = (char*)realloc(textBuf, textBufLen); } copyWcsToMbs(textBuf, text, textLen, True); if (tagLen) { if (tagBufLen <= (tagLen * sizeof(wchar_t))) { tagBufLen = (tagLen + 1) * sizeof(wchar_t); tagBuf = (char*)realloc(tagBuf, tagBufLen); } copyWcsToMbs(tagBuf, tag, tagLen, False); } else { if (!tagBuf) { tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1; tagBuf = (char*)malloc(tagBufLen); } strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET); } s1 = XmStringCreate(textBuf, tagBuf); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Add in the separators. */ if (sep) { s1 = XmStringSeparatorCreate(); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } } /* * Free up memory and return */ free((char*)wcStr); return(xmStr); } /* * Function: * nextCStr = getNextCStrDelim(str); * Description: * Find the next unquoted , or \n in the string * Input: * str - char * : the input string * Output: * nextCStr - char* : pointer to the next delimiter. Returns NULL if no * delimiter found. */ static char* getNextCStrDelim ARGLIST((str)) GRA(char *,str) { char *comma = str; Boolean inQuotes = False; int len; if (!str) return(NULL); if (!*str) return(NULL); /* At end */ #ifdef __CENTERLINE__ mblen((char *)NULL, sizeof(wchar_t)); #else mblen(NULL, sizeof(wchar_t)); #endif while (*comma) { if ((len = mblen(comma, sizeof(wchar_t))) > 1) { comma += len; continue; } if (*comma == '\\') { comma++; /* Over quote */ comma += mblen(comma, sizeof(wchar_t)); continue; } /* * See if we have a delimiter */ if (!inQuotes) { if ((*comma == ',') || (*comma == '\012')) { return(comma); } } /* * Deal with quotes */ if (*comma == '\"') { inQuotes = ~inQuotes; } comma++; } return(NULL); /* None found */ } /* * Function: * cnt = getCStrCount(str); * Description: * Get the count of cstrings in a compound string table ascii * format. * Input: * str - char * : string to parse * Output: * cnt - int : the number of XmStrings found */ static int getCStrCount ARGLIST((str)) GRA(char *, str) { int x = 1; char *newStr; if (!str) return(0); if (!*str) return(0); while ((newStr = getNextCStrDelim(str))) { x++; str = ++newStr; } return(x); } /* * Function: * cwc = CStrCommonWideCharsGet(); * Description: * Return the array of common wide characters. * Input: * None. * Output: * cwc - wchar_t * : this array should never be written to or FREEd. */ static wchar_t *CStrCommonWideCharsGet() { static wchar_t *CommonWideChars = NULL; if (CommonWideChars == NULL) { int i; /* * If you add to this array, don't forget to change the enum in * the TYPEDEFS and DEFINES section above to correspond to this * array. */ static char *characters[] = { "\000", "\t", "\n", "\r", "\f", "\v", "\\", "\"", "#", ":", "f", "l", "n", "r", "t", "v", "F", "L", "R", "T", "0", "1" }; /* * Allocate and create the array. */ CommonWideChars = (wchar_t*)malloc(NUM_COMMON_WCHARS * sizeof(wchar_t)); for (i = 0; i < NUM_COMMON_WCHARS; i++) { (void)dombtowc(&(CommonWideChars[i]), characters[i], 1); } } return(CommonWideChars); } /* * Function: * CONVERTER CvtStringToXmString * and * XmStringCvtDestroy * Description: * Convert a string to an XmString. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * ::[#[font-tag]]"string"[#[font-tag]"string"] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmString ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) UARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString resStr; char *str; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg(XtDisplayToApplicationContext(d), "cvtStringToXmString", "wrongParameters", "XtToolkitError", "String to XmString converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * See if this is a simple string */ str = (char*)fromVal->addr; if (strncmp(str, "::", 2)) { resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET); } else { /* * Convert into internal format */ resStr = StringToXmString(fromVal->addr + 2); /* skip :: */ } /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&resStr; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString)) { toVal->size = sizeof(XmString); XtDisplayStringConversionWarning(d, fromVal->addr, "XmString"); XmStringFree(resStr); return(False); } else { *(XmString *)toVal->addr = resStr; toVal->size = sizeof(XmString); } return(True); } static void XmStringCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmStringFree(*(XmString*)(to->addr)); } /* * Function: * CONVERTER CvtStringToXmStringTable * and * XmStringTableCvtDestroy * * Description: * Convert a string to an XmString table. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ... * compound_string_table = [compound_string][,compound_string] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmStringTable ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) ARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString *CStrTable; XmString *tblPtr; char *str; char *tmpBuf; char *nextDelim; XrmValue fVal; XrmValue tVal; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg (XtDisplayToApplicationContext(d), "cvtStringToXmStringTable", "wrongParameters", "XtToolkitError", "String to XmStringTable converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * Set str and make sure there's somethin' there */ if (!(str = (char*)fromVal->addr)) { str = ""; } /* * Allocate the XmStrings + 1 for NULL termination */ CStrTable = (XmString*)malloc((getCStrCount(str) + 1) * sizeof(XmString*)); /* * Use the string converter for the strings */ tmpBuf = (char*)malloc(strlen(str) + 1); strcpy(tmpBuf, str); str = tmpBuf; /* * Create strings */ tblPtr = CStrTable; if (*str) { while (str) { nextDelim = getNextCStrDelim(str); /* * Overwrite nextDelim */ if (nextDelim) { *nextDelim = '\0'; nextDelim++; } /* * Convert it */ fVal.size = strlen(str) + 1; fVal.addr = str; tVal.size = sizeof(XTPOINTER); tVal.addr = (XTPOINTER)tblPtr; /* * Call converter ourselves since this is used to create * the strings in the table we create. We need to do this * since we don't have a widget to send to the XtConvertAndStore * function. Side effects are that we can never get these * compound strings cached and that no destructor function is * called when the strings leave existance, but we nuke 'em * in the XmStringTable destuctor. */ CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL); tblPtr++; str = nextDelim; } } free(tmpBuf); /* * Null terminate */ *tblPtr = NULL; /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&CStrTable; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString*)) { toVal->size = sizeof(XmString*); XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable"); tblPtr = CStrTable; while (*tblPtr) { XmStringFree(*tblPtr); } free((char*)CStrTable); return(False); } else { *(XmString **)toVal->addr = CStrTable; toVal->size = sizeof(XmString*); } return(True); } static void XmStringTableCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmString *tblPtr = *(XmString**)(to->addr); while (*tblPtr) { XmStringFree(*tblPtr); } free((char*)(*(XmString**)(to->addr))); } /***************************************************************************** * GLOBAL CODE *****************************************************************************/ /* * Function: * RegisterBxConverters(appContext); * Description: * This globally available function installs all the converters necessary * to run BuilderXcessory generated interfaces that use compound * strings. This is necessary since Motif has not supplied very smart * converters. * Input: * appContext - XtAppContext : the application context * Output: * None */ void RegisterBxConverters ARGLIST((appContext)) GRA(XtAppContext, appContext) { XtAppSetTypeConverter(appContext, XmRString, XmRXmString, (XtTypeConverter)CvtStringToXmString, NULL, 0, XtCacheNone, XmStringCvtDestroy); XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable, (XtTypeConverter)CvtStringToXmStringTable, NULL, 0, XtCacheNone, XmStringTableCvtDestroy); } /* * Function: * CONVERT(w, from_string, to_type, to_size, success); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * w - Widget : the widget to use for conversion * from_string - char * : the string to convert from * to_type - char * : the type to convert to * to_size - int : the size of the conversion result * success - Boolean* : Set to the result value of the conversion * Output: * None */ #ifndef IGNORE_CONVERT XtPointer CONVERT ARGLIST((w, from_string, to_type, to_size, success)) ARG(Widget, w) ARG(char *, from_string) ARG(char *, to_type) ARG(int, to_size) GRA(Boolean *, success) { XrmValue fromVal, toVal; /* resource holders */ Boolean convResult; /* return value */ XtPointer val; /* Pointer size return value */ /* * We will assume that the conversion is going to fail and change this * value later if the conversion is a success. */ *success = False; /* * Since we are converting from a string to some type we need to * set the fromVal structure up with the string information that * the caller passed in. */ fromVal.size = strlen(from_string) + 1; fromVal.addr = from_string; /* * Since we are not sure what type and size of data we are going to * get back we will set this up so that the converter will point us * at a block of valid data. */ toVal.size = 0; toVal.addr = NULL; /* * Now lets try to convert this data by calling this handy-dandy Xt * routine. */ convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal); /* * Now we have two conditions here. One the conversion was a success * and two the conversion failed. */ if(!convResult) { /* * If this conversion failed that we can pretty much return right * here because there is nothing else we can do. */ return((XtPointer) NULL); } /* * If we get this far that means we did the conversion and all is * well. Now we have to handle the special cases for type and * size constraints. */ if(!strcmp(to_type, "String")) { /* * Since strings are handled different in Xt we have to deal with * the conversion from a string to a string. When this happens the * toVal.size will hold the strlen of the string so generic * conversion code can't handle it. It is possible for a string to * string conversion to happen so we do have to watch for it. */ val = (XTPOINTER)toVal.addr; } else { /* * Here is the generic conversion return value handler. This * just does some size specific casting so that value that we * return is in the correct bytes of the XtPointer that we * return. Here we check all sizes from 1 to 8 bytes. */ switch(toVal.size) { case 1: val = (XTPOINTER)(unsigned)(*(char*)toVal.addr); /* may be here bug */ break; case 2: val = (XTPOINTER)(unsigned)(*(short*)toVal.addr); /* may be here bug */ break; case 4: val = (XTPOINTER)(unsigned)(*(int*)toVal.addr); /* may be here bug */ break; case 8: default: val = (XTPOINTER)(unsigned)(*(long*)toVal.addr); /* may be here bug */ break; } } /* * Well everything is done and the conversion was a success so lets * set the success flag to True. */ *success = convResult; /* * Finally lets return the converted value. */ /*SUPPRESS 80*/ return(val); } #endif /* * Function: * MENU_POST(p, mw, ev, dispatch); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * p - Widget : the widget to post * mw - XtPointer : the menu widget * ev - XEvent* : the event that caused the menu post * dispatch - Boolean* : not used * Output: * None */ #ifndef IGNORE_MENU_POST void MENU_POST ARGLIST((p, mw, ev, dispatch)) UARG(Widget, p) ARG(XtPointer, mw) ARG(XEvent *, ev) GRAU(Boolean *, dispatch) { Arg args[2]; int argcnt; int button; Widget m = (Widget)mw; XButtonEvent *e = (XButtonEvent *)ev; argcnt = 0; XtSetArg(args[argcnt], XmNwhichButton, &button); argcnt++; XtGetValues(m, args, argcnt); if(e->button != button) return; XmMenuPosition(m, e); XtManageChild(m); } #endif /* * Function: * SET_BACKGROUND_COLOR(w, args, argcnt, bg_color); * Description: * Sets the background color and shadows of a widget. * Input: * w - The widget to set the background color on. * args, argcnt - The argument list so far. * bg_color - The new background color as a pixel. * Output: * none * * NOTES: This assumes that args later in the argument list * override those already in the list. Therfore i f * there are shadow colors later in the list they will win. * * There is no need to use this function when creating a widget * only when doing a set values, shadow colors are automatically * calculated at creation time. */ void SET_BACKGROUND_COLOR ARGLIST((w, args, argcnt, bg_color)) ARG(Widget, w) ARG(ArgList, args) ARG(Cardinal *, argcnt) GRA(Pixel, bg_color) { int i; int topShadowLoc; int bottomShadowLoc; int selectLoc; int fgLoc; Boolean argok = False; #if ((XmVERSION == 1) && (XmREVISION > 0)) /* * Walk through the arglist to see if the user set the top or * bottom shadow colors. */ selectLoc = topShadowLoc = bottomShadowLoc = UNSET; for (i = 0; i < *argcnt; i++) { if ((strcmp(args[i].name, XmNtopShadowColor) == 0) || (strcmp(args[i].name, XmNtopShadowPixmap) == 0)) { topShadowLoc = i; } else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) || (strcmp(args[i].name, XmNbottomShadowPixmap) == 0)) { bottomShadowLoc = i; } else if (strcmp(args[i].name, XmNarmColor) == 0) { selectLoc = i; } else if (strcmp(args[i].name, XmNforeground) == 0) { fgLoc = i; } } /* * If either the top or bottom shadow are not set then we * need to use XmGetColors to get the shadow colors from the backgound * color and add those that are not already in the arglist to the * arglist. * */ if ((bottomShadowLoc == UNSET) || (topShadowLoc == UNSET) || (selectLoc == UNSET) || (fgLoc == UNSET)) { Arg larg[1]; Colormap cmap; Pixel topShadow; Pixel bottomShadow; Pixel select; Pixel fgColor; XtSetArg(larg[0], XmNcolormap, &cmap); XtGetValues(w, larg, 1); XmGetColors(XtScreen(w), cmap, bg_color, &fgColor, &topShadow, &bottomShadow, &select); if (topShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow); (*argcnt)++; } if (bottomShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow); (*argcnt)++; } if (selectLoc == UNSET) { XtSetArg(args[*argcnt], XmNarmColor, select); (*argcnt)++; } if (fgLoc == UNSET) { XtSetArg(args[*argcnt], XmNforeground, fgColor); (*argcnt)++; } } #endif XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++; } /* * Function: * w = BxFindTopShell(start); * Description: * Go up the hierarhcy until we find a shell widget. * Input: * start - Widget : the widget to start with. * Output: * w - Widget : the shell widget. */ #ifndef _BX_FIND_TOP_SHELL #define _BX_FIND_TOP_SHELL Widget BxFindTopShell ARGLIST((start)) GRA(Widget, start) { Widget p; while ((p = XtParent(start))) { start = p; } return(start); } #endif /* _BX_FIND_TOP_SHELL */ /* * Function: * BxWidgetIdsFromNames(ref, cbName, stringList) * Description: * Return an array of widget ids from a list of widget names. * Input: * ref - Widget : reference widget. * cbName - char* : callback name. * stringList - char*: list of widget names. * Output: * WidgetList : array of widget IDs. */ #ifndef _BX_WIDGETIDS_FROM_NAMES #define _BX_WIDGETIDS_FROM_NAMES WidgetList BxWidgetIdsFromNames ARGLIST((ref, cbName, stringList)) ARG(Widget, ref) ARG(char, *cbName) GRA(char, *stringList) { WidgetList wgtIds = NULL; int wgtCount = 0; Widget inst; Widget current; String tmp; String start; String widget; char *ptr; /* * For backward compatibility, remove [ and ] from the list. */ tmp = start = XtNewString(stringList); if((start = strchr(start, '[')) != NULL) start++; else start = tmp; while((start && *start) && isspace(*start)) { start++; } ptr = strrchr(start, ']'); if (ptr) { *ptr = '\0'; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * start now points to the first character after the [. * the list is now either empty, one, or more widget * instance names. */ start = strtok(start, ","); while(start) { while((start && *start) && isspace(*start)) { start++; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * Form a string to use with XtNameToWidget(). */ widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char)); sprintf(widget, "*%s", start); /* * Start at this level and continue up until the widget is found * or until the top of the hierarchy is reached. */ current = ref; while (current != NULL) { inst = XtNameToWidget(current, widget); if (inst != NULL ) { wgtCount++; wgtIds = (WidgetList)XtRealloc((char *)wgtIds, wgtCount * sizeof(Widget)); wgtIds[wgtCount - 1] = inst; break; } current = XtParent(current); } if (current == NULL) { printf("Callback Error (%s):\n\t\ Cannot find widget %s\n", cbName, widget); } XtFree(widget); start = strtok(NULL, ","); } /* * NULL terminate the list. */ wgtIds = (WidgetList)XtRealloc((char *)wgtIds, (wgtCount + 1) * sizeof(Widget)); wgtIds[wgtCount] = NULL; XtFree((char *)tmp); return(wgtIds); } #endif /* _BX_WIDGETIDS_FROM_NAMES */ /**************************************************************************** * * Big chunk of code inserted from Bull * ****************************************************************************/ #ifndef IGNORE_XPM_PIXMAP /* * Copyright 1990, 1991 GROUPE BULL * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of GROUPE BULL not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. GROUPE BULL makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * GROUPE BULL disclaims all warranties with regard to this software, * including all implied warranties of merchantability and fitness, * in no event shall GROUPE BULL be liable for any special, * indirect or consequential damages or any damages * whatsoever resulting from loss of use, data or profits, * whether in an action of contract, negligence or other tortious * action, arising out of or in connection with the use * or performance of this software. * */ /* Return ErrorStatus codes: * null if full success * positive if partial success * negative if failure */ #define XpmColorError 1 #define XpmSuccess 0 #define XpmOpenFailed -1 #define XpmFileInvalid -2 #define XpmNoMemory -3 #define XpmColorFailed -4 typedef struct { char *name; /* Symbolic color name */ char *value; /* Color value */ Pixel pixel; /* Color pixel */ } XpmColorSymbol; typedef struct { unsigned long valuemask; /* Specifies which attributes are * defined */ Visual *visual; /* Specifies the visual to use */ Colormap colormap; /* Specifies the colormap to use */ unsigned int depth; /* Specifies the depth */ unsigned int width; /* Returns the width of the created * pixmap */ unsigned int height; /* Returns the height of the created * pixmap */ unsigned int x_hotspot; /* Returns the x hotspot's * coordinate */ unsigned int y_hotspot; /* Returns the y hotspot's * coordinate */ unsigned int cpp; /* Specifies the number of char per * pixel */ Pixel *pixels; /* List of used color pixels */ unsigned int npixels; /* Number of pixels */ XpmColorSymbol *colorsymbols; /* Array of color symbols to * override */ unsigned int numsymbols; /* Number of symbols */ char *rgb_fname; /* RGB text file name */ /* Infos */ unsigned int ncolors; /* Number of colors */ char ***colorTable; /* Color table pointer */ char *hints_cmt; /* Comment of the hints section */ char *colors_cmt; /* Comment of the colors section */ char *pixels_cmt; /* Comment of the pixels section */ unsigned int mask_pixel; /* Transparent pixel's color table * index */ } XpmAttributes; /* Xpm attribute value masks bits */ #define XpmVisual (1L<<0) #define XpmColormap (1L<<1) #define XpmDepth (1L<<2) #define XpmSize (1L<<3) /* width & height */ #define XpmHotspot (1L<<4) /* x_hotspot & y_hotspot */ #define XpmCharsPerPixel (1L<<5) #define XpmColorSymbols (1L<<6) #define XpmRgbFilename (1L<<7) #define XpmInfos (1L<<8) /* all infos members */ #define XpmReturnPixels (1L<<9) #define XpmReturnInfos XpmInfos /* * minimal portability layer between ansi and KR C */ /* forward declaration of functions with prototypes */ #ifdef NeedFunctionPrototypes #define FUNC(f, t, p) extern t f p #define LFUNC(f, t, p) static t f p #else #define FUNC(f, t, p) extern t f() #define LFUNC(f, t, p) static t f() #endif /* * functions declarations */ #ifdef __cplusplus extern "C" { #endif LFUNC(XpmCreatePixmapFromData, int, (Display * display, Drawable d, char **data, Pixmap * pixmap_return, Pixmap * shapemask_return, XpmAttributes * attributes)); LFUNC(XpmCreateImageFromData, int, (Display * display, char **data, XImage ** image_return, XImage ** shapemask_return, XpmAttributes * attributes)); LFUNC(XpmFreeAttributes, void, (XpmAttributes * attributes)); #ifdef __cplusplus } /* for C++ V2.0 */ #endif #ifdef SYSV #define bcopy(source, dest, count) memcpy(dest, source, count) #endif typedef struct { unsigned int type; union { FILE *file; char **data; } stream; char *cptr; unsigned int line; int CommentLength; char Comment[BUFSIZ]; char *Bcmt, *Ecmt, Bos, Eos; unsigned int InsideString; /* used during parsing: 0 or 1 * whether we are inside or not */ } xpmData; #define XPMARRAY 0 #define XPMFILE 1 #define XPMPIPE 2 typedef unsigned char byte; extern char *xpmColorKeys[]; #define TRANSPARENT_COLOR "None" /* this must be a string! */ /* number of xpmColorKeys */ #define NKEYS 5 /* * key numbers for visual type, they must fit along with the number key of * each corresponding element in xpmColorKeys[] defined in xpm.h */ #define MONO 2 #define GRAY4 3 #define GRAY 4 #define COLOR 5 /* structure containing data related to an Xpm pixmap */ typedef struct { char *name; unsigned int width; unsigned int height; unsigned int cpp; unsigned int ncolors; char ***colorTable; unsigned int *pixelindex; XColor *xcolors; char **colorStrings; unsigned int mask_pixel; /* mask pixel's colorTable index */ } xpmInternAttrib; #define UNDEF_PIXEL 0x80000000 char *xpmColorKeys[] = { "s", /* key #1: symbol */ "m", /* key #2: mono visual */ "g4", /* key #3: 4 grays visual */ "g", /* key #4: gray visual */ "c", /* key #5: color visual */ }; /* XPM private routines */ LFUNC(xpmCreateImage, int, (Display * display, xpmInternAttrib * attrib, XImage ** image_return, XImage ** shapeimage_return, XpmAttributes * attributes)); LFUNC(xpmParseData, int, (xpmData * data, xpmInternAttrib * attrib_return, XpmAttributes * attributes)); LFUNC(xpmVisualType, int, (Visual * visual)); LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors)); LFUNC(xpmInitInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmFreeInternAttrib, void, (xpmInternAttrib * xmpdata)); LFUNC(xpmSetAttributes, void, (xpmInternAttrib * attrib, XpmAttributes * attributes)); /* I/O utility */ LFUNC(xpmNextString, void, (xpmData * mdata)); LFUNC(xpmNextUI, int, (xpmData * mdata, unsigned int *ui_return)); LFUNC(xpmGetC, int, (xpmData * mdata)); LFUNC(xpmUngetC, int, (int c, xpmData * mdata)); LFUNC(xpmNextWord, unsigned int, (xpmData * mdata, char *buf)); LFUNC(xpmGetCmt, void, (xpmData * mdata, char **cmt)); LFUNC(xpmOpenArray, int, (char **data, xpmData * mdata)); LFUNC(XpmDataClose, void, (xpmData * mdata)); /* RGB utility */ LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); /* Image utility */ LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname, unsigned int color_index, Pixel * image_pixel, Pixel * mask_pixel, unsigned int *mask_pixel_index)); LFUNC(CreateXImage, int, (Display * display, Visual * visual, unsigned int depth, unsigned int width, unsigned int height, XImage ** image_return)); LFUNC(SetImagePixels, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); /* * Macros * * The XYNORMALIZE macro determines whether XY format data requires * normalization and calls a routine to do so if needed. The logic in * this module is designed for LSBFirst byte and bit order, so * normalization is done as required to present the data in this order. * * The ZNORMALIZE macro performs byte and nibble order normalization if * required for Z format data. * * The XYINDEX macro computes the index to the starting byte (char) boundary * for a bitmap_unit containing a pixel with coordinates x and y for image * data in XY format. * * The ZINDEX* macros compute the index to the starting byte (char) boundary * for a pixel with coordinates x and y for image data in ZPixmap format. * */ #define XYNORMALIZE(bp, img) \ if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \ xpm_xynormalizeimagebits((unsigned char *)(bp), img) #define ZNORMALIZE(bp, img) \ if (img->byte_order == MSBFirst) \ xpm_znormalizeimagebits((unsigned char *)(bp), img) #define XYINDEX(x, y, img) \ ((y) * img->bytes_per_line) + \ (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3) #define ZINDEX(x, y, img) ((y) * img->bytes_per_line) + \ (((x) * img->bits_per_pixel) >> 3) #define ZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2) #define ZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1) #define ZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x) #define ZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3) #if __STDC__ #define Const const #else #define Const #endif Pixmap XPM_PIXMAP ARGLIST((w, pixmapName)) ARG(Widget, w) GRA(char **, pixmapName) { XpmAttributes attributes; int argcnt; Arg args[10]; Pixmap pixmap; Pixmap shape; int returnValue; argcnt = 0; XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++; XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++; XtGetValues(w, args, argcnt); attributes.visual = DefaultVisual(XtDisplay(w), DefaultScreen(XtDisplay(w))); attributes.valuemask = (XpmDepth | XpmColormap | XpmVisual); returnValue = XpmCreatePixmapFromData(XtDisplay(w), DefaultRootWindow(XtDisplay(w)), pixmapName, &pixmap, &shape, &attributes); if ( shape ) { XFreePixmap(XtDisplay(w), shape); } switch(returnValue) { case XpmOpenFailed: case XpmFileInvalid: case XpmNoMemory: case XpmColorFailed: XtWarning("Could not create pixmap."); return(XmUNSPECIFIED_PIXMAP); default: return(pixmap); } } static unsigned int atoui ARGLIST((p, l, ui_return)) ARG(register char *, p) ARG(unsigned int, l) GRA(unsigned int *, ui_return) { register int n, i; n = 0; for (i = 0; i < l; i++) if (*p >= '0' && *p <= '9') n = n * 10 + *p++ - '0'; else break; if (i != 0 && i == l) { *ui_return = n; return 1; } else return 0; } static int XpmCreatePixmapFromData ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes)) ARG(Display *, display) ARG(Drawable, d) ARG(char **, data) ARG(Pixmap *, pixmap_return) ARG(Pixmap *, shapemask_return) GRA(XpmAttributes *,attributes) { XImage *image, **imageptr = NULL; XImage *shapeimage, **shapeimageptr = NULL; int ErrorStatus; XGCValues gcv; GC gc; /* * initialize return values */ if (pixmap_return) { *pixmap_return = (Pixmap)NULL; imageptr = ℑ } if (shapemask_return) { *shapemask_return = (Pixmap)NULL; shapeimageptr = &shapeimage; } /* * create the images */ ErrorStatus = XpmCreateImageFromData(display, data, imageptr, shapeimageptr, attributes); if (ErrorStatus < 0) return (ErrorStatus); /* * create the pixmaps */ if (imageptr && image) { *pixmap_return = XCreatePixmap(display, d, image->width, image->height, image->depth); gcv.function = GXcopy; gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv); XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0, image->width, image->height); XDestroyImage(image); XFreeGC(display, gc); } if (shapeimageptr && shapeimage) { *shapemask_return = XCreatePixmap(display, d, shapeimage->width, shapeimage->height, shapeimage->depth); gcv.function = GXcopy; gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv); XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0, shapeimage->width, shapeimage->height); XDestroyImage(shapeimage); XFreeGC(display, gc); } return (ErrorStatus); } static int XpmCreateImageFromData ARGLIST((display, data, image_return, shapeimage_return, attributes)) ARG(Display *,display) ARG(char **, data) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { xpmData mdata; int ErrorStatus; xpmInternAttrib attrib; /* * initialize return values */ if (image_return) *image_return = NULL; if (shapeimage_return) *shapeimage_return = NULL; if ((ErrorStatus = xpmOpenArray(data, &mdata)) != XpmSuccess) return (ErrorStatus); xpmInitInternAttrib(&attrib); ErrorStatus = xpmParseData(&mdata, &attrib, attributes); if (ErrorStatus == XpmSuccess) ErrorStatus = xpmCreateImage(display, &attrib, image_return, shapeimage_return, attributes); if (ErrorStatus >= 0) xpmSetAttributes(&attrib, attributes); else if (attributes) XpmFreeAttributes(attributes); xpmFreeInternAttrib(&attrib); XpmDataClose(&mdata); return (ErrorStatus); } /* * open the given array to be read or written as an xpmData which is returned */ static int xpmOpenArray ARGLIST((data, mdata)) ARG(char **,data) GRA(xpmData *,mdata) { mdata->type = XPMARRAY; mdata->stream.data = data; mdata->cptr = *data; mdata->line = 0; mdata->CommentLength = 0; mdata->Bcmt = mdata->Ecmt = NULL; mdata->Bos = mdata->Eos = '\0'; mdata->InsideString = 0; return (XpmSuccess); } /* * Intialize the xpmInternAttrib pointers to Null to know * which ones must be freed later on. */ static void xpmInitInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *,attrib) { attrib->ncolors = 0; attrib->colorTable = NULL; attrib->pixelindex = NULL; attrib->xcolors = NULL; attrib->colorStrings = NULL; attrib->mask_pixel = UNDEF_PIXEL; } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \ if (chars) free(chars); \ if (pixelindex) free((char *)pixelindex); \ if (hints_cmt) free((char *)hints_cmt); \ if (colors_cmt) free((char *)colors_cmt); \ if (pixels_cmt) free((char *)pixels_cmt); \ return(status); } /* * This function parses an Xpm file or data and store the found informations * in an an xpmInternAttrib structure which is returned. */ static int xpmParseData ARGLIST((data, attrib_return, attributes)) ARG(xpmData *,data) ARG(xpmInternAttrib *, attrib_return) GRA(XpmAttributes *, attributes) { /* variables to return */ unsigned int width, height; unsigned int ncolors = 0; unsigned int cpp; unsigned int x_hotspot, y_hotspot, hotspot = 0; char ***colorTable = NULL; unsigned int *pixelindex = NULL; char *hints_cmt = NULL; char *colors_cmt = NULL; char *pixels_cmt = NULL; /* calculation variables */ unsigned int rncolors = 0; /* read number of colors, it is * different to ncolors to avoid * problem when freeing the * colorTable in case an error * occurs while reading the hints * line */ unsigned int key = 0; /* color key */ char *chars = NULL, buf[BUFSIZ]; unsigned int *iptr; unsigned int a, b, x, y, l; unsigned int curkey; /* current color key */ unsigned int lastwaskey; /* key read */ char curbuf[BUFSIZ]; /* current buffer */ /* * read hints: width, height, ncolors, chars_per_pixel */ if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height) && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp))) RETURN(XpmFileInvalid); ncolors = rncolors; /* * read hotspot coordinates if any */ hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot); /* * store the hints comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &hints_cmt); /* * read colors */ colorTable = (char ***) calloc(ncolors, sizeof(char **)); if (!colorTable) RETURN(XpmNoMemory); for (a = 0; a < ncolors; a++) { xpmNextString(data); /* skip the line */ colorTable[a] = (char **) calloc((NKEYS + 1), sizeof(char *)); if (!colorTable[a]) RETURN(XpmNoMemory); /* * read pixel value */ colorTable[a][0] = (char *) malloc(cpp); if (!colorTable[a][0]) RETURN(XpmNoMemory); for (b = 0; b < cpp; b++) colorTable[a][0][b] = xpmGetC(data); /* * read color keys and values */ curkey = 0; lastwaskey = 0; while ((l = xpmNextWord(data, buf))) { if (!lastwaskey) { for (key = 1; key < NKEYS + 1; key++) if ((strlen(xpmColorKeys[key - 1]) == l) && (!strncmp(xpmColorKeys[key - 1], buf, l))) break; } if (!lastwaskey && key <= NKEYS) { /* open new key */ if (curkey) { /* flush string */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } curkey = key; /* set new key */ curbuf[0] = '\0'; /* reset curbuf */ lastwaskey = 1; } else { if (!curkey) RETURN(XpmFileInvalid); /* key without value */ if (!lastwaskey) strcat(curbuf, " ");/* append space */ buf[l] = '\0'; strcat(curbuf, buf); /* append buf */ lastwaskey = 0; } } if (!curkey) RETURN(XpmFileInvalid); /* key without value */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(XpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } /* * store the colors comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &colors_cmt); /* * read pixels and index them on color number */ pixelindex = (unsigned int *) malloc(sizeof(unsigned int) * width * height); if (!pixelindex) RETURN(XpmNoMemory); iptr = pixelindex; chars = (char *) malloc(cpp); if (!chars) RETURN(XpmNoMemory); for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { for (a = 0; a < cpp; a++) chars[a] = xpmGetC(data); for (a = 0; a < ncolors; a++) if (!strncmp(colorTable[a][0], chars, cpp)) break; if (a == ncolors) RETURN(XpmFileInvalid); /* no color matches */ *iptr = a; } } /* * store the pixels comment line */ if (attributes && (attributes->valuemask & XpmReturnInfos)) xpmGetCmt(data, &pixels_cmt); free(chars); /* * store found informations in the xpmInternAttrib structure */ attrib_return->width = width; attrib_return->height = height; attrib_return->cpp = cpp; attrib_return->ncolors = ncolors; attrib_return->colorTable = colorTable; attrib_return->pixelindex = pixelindex; if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->hints_cmt = hints_cmt; attributes->colors_cmt = colors_cmt; attributes->pixels_cmt = pixels_cmt; } if (hotspot) { attributes->x_hotspot = x_hotspot; attributes->y_hotspot = y_hotspot; attributes->valuemask |= XpmHotspot; } } return (XpmSuccess); } /* * set the color pixel related to the given colorname, * return 0 if success, 1 otherwise. */ static int SetColor ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index)) ARG(Display *, display) ARG(Colormap, colormap) ARG(char *, colorname) ARG(unsigned int, color_index) ARG(Pixel *, image_pixel) ARG(Pixel *, mask_pixel) GRA(unsigned int *, mask_pixel_index) { XColor xcolor; if (STRCASECMP(colorname, TRANSPARENT_COLOR)) { if (!XParseColor(display, colormap, colorname, &xcolor) || (!XAllocColor(display, colormap, &xcolor))) return (1); *image_pixel = xcolor.pixel; *mask_pixel = 1; } else { *image_pixel = 0; *mask_pixel = 0; *mask_pixel_index = color_index;/* store the color table index */ } return (0); } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (image) XDestroyImage(image); \ if (shapeimage) XDestroyImage(shapeimage); \ if (image_pixels) free((char *)image_pixels); \ if (mask_pixels) free((char *)mask_pixels); \ return(status); } static int xpmCreateImage ARGLIST((display, attrib, image_return, shapeimage_return, attributes)) ARG(Display *, display) ARG(xpmInternAttrib *, attrib) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(XpmAttributes *, attributes) { /* variables stored in the XpmAttributes structure */ Visual *visual; Colormap colormap; unsigned int depth; XpmColorSymbol *colorsymbols = NULL; unsigned int numsymbols; /* variables to return */ XImage *image = NULL; XImage *shapeimage = NULL; unsigned int mask_pixel; unsigned int ErrorStatus, ErrorStatus2; /* calculation variables */ Pixel *image_pixels = NULL; Pixel *mask_pixels = NULL; char *colorname; unsigned int a, b, l; Boolean pixel_defined; unsigned int key; /* * retrieve information from the XpmAttributes */ if (attributes && attributes->valuemask & XpmColorSymbols) { colorsymbols = attributes->colorsymbols; numsymbols = attributes->numsymbols; } else numsymbols = 0; if (attributes && attributes->valuemask & XpmVisual) visual = attributes->visual; else visual = DefaultVisual(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmColormap) colormap = attributes->colormap; else colormap = DefaultColormap(display, DefaultScreen(display)); if (attributes && attributes->valuemask & XpmDepth) depth = attributes->depth; else depth = DefaultDepth(display, DefaultScreen(display)); ErrorStatus = XpmSuccess; /* * alloc pixels index tables */ key = xpmVisualType(visual); image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!image_pixels) RETURN(XpmNoMemory); mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!mask_pixels) RETURN(XpmNoMemory); mask_pixel = UNDEF_PIXEL; /* * get pixel colors, store them in index tables */ for (a = 0; a < attrib->ncolors; a++) { colorname = NULL; pixel_defined = False; /* * look for a defined symbol */ if (numsymbols && attrib->colorTable[a][1]) { for (l = 0; l < numsymbols; l++) if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1])) break; if (l != numsymbols) { if (colorsymbols[l].value) colorname = colorsymbols[l].value; else pixel_defined = True; } } if (!pixel_defined) { /* pixel not given as symbol value */ if (colorname) { /* colorname given as symbol value */ if (!SetColor(display, colormap, colorname, a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) pixel_defined = True; else ErrorStatus = XpmColorError; } b = key; while (!pixel_defined && b > 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b--; } b = key + 1; while (!pixel_defined && b < NKEYS + 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = XpmColorError; } b++; } if (!pixel_defined) RETURN(XpmColorFailed); } else { image_pixels[a] = colorsymbols[l].pixel; mask_pixels[a] = 1; } } /* * create the image */ if (image_return) { ErrorStatus2 = CreateXImage(display, visual, depth, attrib->width, attrib->height, &image); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); /* * set the image data * * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use * optimized functions, otherwise use slower but sure general one. * */ if (image->depth == 1) SetImagePixels1(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 8) SetImagePixels8(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 16) SetImagePixels16(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 32) SetImagePixels32(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else SetImagePixels(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); } /* * create the shape mask image */ if (mask_pixel != UNDEF_PIXEL && shapeimage_return) { ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width, attrib->height, &shapeimage); if (ErrorStatus2 != XpmSuccess) RETURN(ErrorStatus2); SetImagePixels1(shapeimage, attrib->width, attrib->height, attrib->pixelindex, mask_pixels); } free((char *)mask_pixels); /* * if requested store allocated pixels in the XpmAttributes structure */ if (attributes && (attributes->valuemask & XpmReturnInfos || attributes->valuemask & XpmReturnPixels)) { if (mask_pixel != UNDEF_PIXEL) { Pixel *pixels, *p1, *p2; attributes->npixels = attrib->ncolors - 1; pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels); if (pixels) { p1 = image_pixels; p2 = pixels; for (a = 0; a < attrib->ncolors; a++, p1++) if (a != mask_pixel) *p2++ = *p1; attributes->pixels = pixels; } else { /* if error just say we can't return requested data */ attributes->valuemask &= ~XpmReturnPixels; attributes->valuemask &= ~XpmReturnInfos; attributes->pixels = NULL; attributes->npixels = 0; } free((char *)image_pixels); } else { attributes->pixels = image_pixels; attributes->npixels = attrib->ncolors; } attributes->mask_pixel = mask_pixel; } else free((char *)image_pixels); /* * return created images */ if (image_return) *image_return = image; if (shapeimage_return) *shapeimage_return = shapeimage; return (ErrorStatus); } /* * Create an XImage */ static int CreateXImage ARGLIST((display, visual, depth, width, height, image_return)) ARG(Display *, display) ARG(Visual *, visual) ARG(unsigned int, depth) ARG(unsigned int, width) ARG(unsigned int, height) GRA(XImage **, image_return) { int bitmap_pad; /* first get bitmap_pad */ if (depth > 16) bitmap_pad = 32; else if (depth > 8) bitmap_pad = 16; else bitmap_pad = 8; /* then create the XImage with data = NULL and bytes_per_line = 0 */ *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0, width, height, bitmap_pad, 0); if (!*image_return) return (XpmNoMemory); /* now that bytes_per_line must have been set properly alloc data */ (*image_return)->data = (char *) malloc((*image_return)->bytes_per_line * height); if (!(*image_return)->data) { XDestroyImage(*image_return); *image_return = NULL; return (XpmNoMemory); } return (XpmSuccess); } /* * The functions below are written from X11R5 MIT's code (XImUtil.c) * * The idea is to have faster functions than the standard XPutPixel function * to build the image data. Indeed we can speed up things by supressing tests * performed for each pixel. We do exactly the same tests but at the image * level. Assuming that we use only ZPixmap images. */ LFUNC(_putbits, void, (register char *src, int dstoffset, register int numbits, register char *dst)); LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb)); static unsigned char Const _reverse_byte[0x100] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static void _XReverse_Bytes ARGLIST((bpt, nb)) ARG(register unsigned char *, bpt) GRA(register int, nb) { do { *bpt = _reverse_byte[*bpt]; bpt++; } while (--nb > 0); } static void xpm_xynormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; if (img->byte_order != img->bitmap_bit_order) { switch (img->bitmap_unit) { case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } if (img->bitmap_bit_order == MSBFirst) _XReverse_Bytes(bp, img->bitmap_unit >> 3); } static void xpm_znormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; switch (img->bits_per_pixel) { case 4: *bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF); break; case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 24: c = *(bp + 2); *(bp + 2) = *bp; *bp = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } static unsigned char Const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; static unsigned char Const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static void _putbits ARGLIST((src, dstoffset, numbits, dst)) ARG(register char *, src) /* address of source bit string */ ARG(int, dstoffset) /* bit offset into destination; * range is 0-31 */ ARG(register int, numbits) /* number of bits to copy to * destination */ GRA(register char *, dst) /* address of destination bit string */ { register unsigned char chlo, chhi; int hibits; dst = dst + (dstoffset >> 3); dstoffset = dstoffset & 7; hibits = 8 - dstoffset; chlo = *dst & _lomask[dstoffset]; for (;;) { chhi = (*src << dstoffset) & _himask[dstoffset]; if (numbits <= hibits) { chhi = chhi & _lomask[dstoffset + numbits]; *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi; break; } *dst = chhi | chlo; dst++; numbits = numbits - hibits; chlo = (unsigned char) (*src & _himask[hibits]) >> hibits; src++; if (numbits <= dstoffset) { chlo = chlo & _lomask[numbits]; *dst = (*dst & _himask[numbits]) | chlo; break; } numbits = numbits - dstoffset; } } /* * Default method to write pixels into a Z image data structure. * The algorithm used is: * * copy the destination bitmap_unit or Zpixel to temp * normalize temp if needed * copy the pixel bits into the temp * renormalize temp if needed * copy the temp back into the destination image data */ static void SetImagePixels ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { Pixel pixel; unsigned long px; register char *src; register char *dst; int nbytes; register unsigned int *iptr; register int x, y, i; iptr = pixelindex; if (image->depth == 1) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[XYINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = image->bitmap_unit >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; XYNORMALIZE(&px, image); i = ((x + image->xoffset) % image->bitmap_unit); _putbits((char *) &pixel, i, 1, (char *) &px); XYNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[XYINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } else { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; if (image->depth == 4) pixel &= 0xf; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[ZINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = (image->bits_per_pixel + 7) >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; ZNORMALIZE(&px, image); _putbits((char *) &pixel, (x * image->bits_per_pixel) & 7, image->bits_per_pixel, (char *) &px); ZNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[ZINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } } /* * write pixels into a 32-bits Z image data structure */ #ifndef WORD64 static unsigned long byteorderpixel = MSBFirst << 24; #endif static void SetImagePixels32 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *paddr; register unsigned int *iptr; register int x, y; iptr = pixelindex; #ifndef WORD64 if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { paddr = (unsigned int *)(&(image->data[ZINDEX32(x, y, image)])); *paddr = (unsigned int)pixels[*iptr]; } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 24); addr[1] = (unsigned char)(pixels[*iptr] >> 16); addr[2] = (unsigned char)(pixels[*iptr] >> 8); addr[3] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX32(x, y, image)]; addr[3] = (unsigned char)(pixels[*iptr] >> 24); addr[2] = (unsigned char)(pixels[*iptr] >> 16); addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 16-bits Z image data structure */ static void SetImagePixels16 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *iptr; register int x, y; iptr = pixelindex; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 8); addr[1] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[ZINDEX16(x, y, image)]; addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 8-bits Z image data structure */ static void SetImagePixels8 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned int *iptr; register int x, y; iptr = pixelindex; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) image->data[ZINDEX8(x, y, image)] = (char)pixels[*iptr]; } /* * write pixels into a 1-bit depth image data structure and **offset null** */ static void SetImagePixels1 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { unsigned char bit; int xoff, yoff; register unsigned int *iptr; register int x, y; if (image->byte_order != image->bitmap_bit_order) SetImagePixels(image, width, height, pixelindex, pixels); else { iptr = pixelindex; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 0x80 >> xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = ZINDEX1(x, y, image); xoff = x & 7; bit = 1 << xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } } } /* * Store into the XpmAttributes structure the required informations stored in * the xpmInternAttrib structure. */ static void xpmSetAttributes ARGLIST((attrib, attributes)) ARG(xpmInternAttrib *, attrib) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnInfos) { attributes->cpp = attrib->cpp; attributes->ncolors = attrib->ncolors; attributes->colorTable = attrib->colorTable; attrib->ncolors = 0; attrib->colorTable = NULL; } attributes->width = attrib->width; attributes->height = attrib->height; attributes->valuemask |= XpmSize; } } /* * Free the XpmAttributes structure members * but the structure itself */ static void XpmFreeAttributes ARGLIST((attributes)) GRA(XpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & XpmReturnPixels && attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } if (attributes->valuemask & XpmInfos) { if (attributes->colorTable) { xpmFreeColorTable(attributes->colorTable, attributes->ncolors); attributes->colorTable = NULL; attributes->ncolors = 0; } if (attributes->hints_cmt) { free(attributes->hints_cmt); attributes->hints_cmt = NULL; } if (attributes->colors_cmt) { free(attributes->colors_cmt); attributes->colors_cmt = NULL; } if (attributes->pixels_cmt) { free(attributes->pixels_cmt); attributes->pixels_cmt = NULL; } if (attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; } } attributes->valuemask = 0; } } /* * Free the xpmInternAttrib pointers which have been allocated */ static void xpmFreeInternAttrib ARGLIST((attrib)) GRA(xpmInternAttrib *, attrib) { unsigned int a; if (attrib->colorTable) xpmFreeColorTable(attrib->colorTable, attrib->ncolors); if (attrib->pixelindex) free((char *)attrib->pixelindex); if (attrib->xcolors) free((char *)attrib->xcolors); if (attrib->colorStrings) { for (a = 0; a < attrib->ncolors; a++) if (attrib->colorStrings[a]) free((char *)attrib->colorStrings[a]); free((char *)attrib->colorStrings); } } /* * close the file related to the xpmData if any */ static void XpmDataClose ARGLIST((mdata)) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: break; case XPMFILE: if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin)) fclose(mdata->stream.file); break; #ifdef ZPIPE case XPMPIPE: pclose(mdata->stream.file); #endif } } /* * skip whitespace and compute the following unsigned int, * returns 1 if one is found and 0 if not */ static int xpmNextUI ARGLIST((mdata, ui_return)) ARG(xpmData *, mdata) GRA(unsigned int *, ui_return) { char buf[BUFSIZ]; int l; l = xpmNextWord(mdata, buf); return atoui(buf, l, ui_return); } /* * get the current comment line */ static void xpmGetCmt ARGLIST((mdata, cmt)) ARG(xpmData *, mdata) GRA(char **, cmt) { switch (mdata->type) { case XPMARRAY: *cmt = NULL; break; case XPMFILE: case XPMPIPE: if (mdata->CommentLength) { *cmt = (char *) malloc(mdata->CommentLength + 1); strncpy(*cmt, mdata->Comment, mdata->CommentLength); (*cmt)[mdata->CommentLength] = '\0'; mdata->CommentLength = 0; } else *cmt = NULL; break; } } /* * skip to the end of the current string and the beginning of the next one */ static void xpmNextString ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; switch (mdata->type) { case XPMARRAY: mdata->cptr = (mdata->stream.data)[++mdata->line]; break; case XPMFILE: case XPMPIPE: if (mdata->Eos) while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF); if (mdata->Bos) /* if not natural XPM2 */ while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF); break; } } /* * return the current character, skipping comments */ static int xpmGetC ARGLIST((mdata)) GRA(xpmData *, mdata) { int c; register unsigned int n = 0, a; unsigned int notend; switch (mdata->type) { case XPMARRAY: return (*mdata->cptr++); case XPMFILE: case XPMPIPE: c = getc(mdata->stream.file); if (mdata->Bos && mdata->Eos && (c == mdata->Bos || c == mdata->Eos)) { /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (c); } if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) { mdata->Comment[0] = c; /* * skip the string begining comment */ do { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0' && c != EOF); if (mdata->Bcmt[n] != '\0') { /* this wasn't the begining of a comment */ /* put characters back in the order that we got them */ for (a = n; a > 0; a--) xpmUngetC(mdata->Comment[a], mdata); return (mdata->Comment[0]); } /* * store comment */ mdata->Comment[0] = mdata->Comment[n]; notend = 1; n = 0; while (notend) { while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } mdata->CommentLength = n; a = 0; do { c = getc(mdata->stream.file); n++; a++; mdata->Comment[n] = c; } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0' && c != EOF); if (mdata->Ecmt[a] == '\0') { /* this is the end of the comment */ notend = 0; xpmUngetC(mdata->Comment[n], mdata); } } c = xpmGetC(mdata); } return (c); } return 0; } /* * push the given character back */ static int xpmUngetC ARGLIST((c, mdata)) ARG(int, c) GRA(xpmData *, mdata) { switch (mdata->type) { case XPMARRAY: return (*--mdata->cptr = c); case XPMFILE: case XPMPIPE: if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos)) /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (ungetc(c, mdata->stream.file)); } return -0; } /* * skip whitespace and return the following word */ static unsigned int xpmNextWord ARGLIST((mdata, buf)) ARG(xpmData *, mdata) GRA(char *, buf) { register unsigned int n = 0; int c; switch (mdata->type) { case XPMARRAY: while (isspace(c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; do { c = *mdata->cptr++; buf[n++] = c; } while (!isspace(c) && c != mdata->Eos && c != '\0'); n--; mdata->cptr--; break; case XPMFILE: case XPMPIPE: while (isspace(c = xpmGetC(mdata)) && c != mdata->Eos); while (!isspace(c) && c != mdata->Eos && c != EOF) { buf[n++] = c; c = xpmGetC(mdata); } xpmUngetC(c, mdata); break; } return (n); } static int xpmVisualType ARGLIST((visual)) GRA(Visual *, visual) { #if defined(__cplusplus) || defined(c_plusplus) switch ( visual->c_class ) #else switch ( visual->class ) #endif { case StaticGray: case GrayScale: switch (visual->map_entries) { case 2: return (MONO); case 4: return (GRAY4); default: return (GRAY); } default: return (COLOR); } } /* * Free the computed color table */ static void xpmFreeColorTable ARGLIST((colorTable, ncolors)) ARG(char ***, colorTable) GRA(int, ncolors) { int a, b; if (colorTable) { for (a = 0; a < ncolors; a++) if (colorTable[a]) { for (b = 0; b < (NKEYS + 1); b++) if (colorTable[a][b]) free(colorTable[a][b]); free((char *)colorTable[a]); } free((char *)colorTable); } } #endif motif-2.3.8/demos/programs/Tree/Makefile.am0000644000175000017500000000053313145162623015463 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Tree datadir = ${prefix}/share/Xm/Tree EXTRA_DIST = bin_PROGRAMS = tree tree_SOURCES = bxutil-c.c tree.c data_DATA = $(EXTRA_DIST) $(tree_SOURCES) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/i18ninput/0000755000175000017500000000000013211513007014434 500000000000000motif-2.3.8/demos/programs/i18ninput/i18ninput.c0000644000175000017500000000662512672140200016371 00000000000000/* $XConsortium: i18ninput.c /main/5 1995/07/15 20:45:37 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #include #include #include #include #include #include #include static XtAppContext app_context; static String fallback_reslist[] = { "*font.label.labelString: Select font", "*font*button1.labelString: Small", "*font*button1.renderTable: *medium*-r-*--14*:", "*font*button2.labelString: Medium", "*font*button2.renderTable: *medium*-r-*--18*:", "*font*button3.labelString: Large", "*font*button3.renderTable: *medium*-r-*--24*:", "*color.label.labelString: Select color", "*color*button1.labelString: Red", "*color*button1.foreground: #fe5151", "*color*button2.labelString: Green", "*color*button2.foreground: #00be51", "*color*button3.labelString: Blue", "*color*button3.foreground: #2aa1fd", "*XmText.renderTable: *medium*-r-*--18*:", "*XmTextField.renderTable: *medium*-r-*--18*:", NULL }; extern int dialog_init(int *argc, char **argv, Display *dpy); /**************************************************************** * base: ****************************************************************/ static char *base(char *str) { static char basename[300]; char *p; if ((p = strrchr(str, '/'))) (void) strcpy(basename, p+1); else (void) strcpy(basename, str); if ((p = strrchr(basename, '.'))) *p ='\0'; return basename; } /************************************************************** * main: **************************************************************/ int main(int argc, char **argv) { Display * display; char name[132]; (void) strncpy(name, base(argv[0]), 132); /* Initialize the X Intrinsics */ XtToolkitInitialize(); /* Set up language environment for X */ XtSetLanguageProc(NULL, (XtLanguageProc)NULL, NULL); /* Create application context */ app_context = XtCreateApplicationContext(); XtAppSetFallbackResources(app_context, fallback_reslist); /* open up one display */ display = XtOpenDisplay(app_context, NULL, name, "XmdI18nInput", (XrmOptionDescRec *)NULL, 0, &argc, argv); if (!display) { (void) fprintf(stderr, "Unable to open display\n"); exit(0); } /* Call init functions. This creates the user interface (placed in input.c) */ if (dialog_init(&argc, argv, display) != 0) exit(1); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } motif-2.3.8/demos/programs/i18ninput/Makefile.in0000644000175000017500000005536613211512766016453 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = i18ninput$(EXEEXT) subdir = demos/programs/i18ninput ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_i18ninput_OBJECTS = i18ninput.$(OBJEXT) input.$(OBJEXT) i18ninput_OBJECTS = $(am_i18ninput_OBJECTS) i18ninput_LDADD = $(LDADD) i18ninput_DEPENDENCIES = ../../lib/Xmd/libXmd.a \ ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(i18ninput_SOURCES) DIST_SOURCES = $(i18ninput_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/i18ninput build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/i18ninput datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in i18ninput_SOURCES = i18ninput.c input.c EXTRA_DIST = XmdI18nInput.ad README i18ninput.man i18ninput.help data_DATA = $(EXTRA_DIST) $(i18ninput_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/i18ninput/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/i18ninput/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list i18ninput$(EXEEXT): $(i18ninput_OBJECTS) $(i18ninput_DEPENDENCIES) $(EXTRA_i18ninput_DEPENDENCIES) @rm -f i18ninput$(EXEEXT) $(AM_V_CCLD)$(LINK) $(i18ninput_OBJECTS) $(i18ninput_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i18ninput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/i18ninput/XmdI18nInput.ad0000644000175000017500000000741512672140200017102 00000000000000! $XConsortium: XmdI18nInput.ad /main/4 1995/07/17 18:53:03 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY # # File menu # *Exit.labelString: Exit *Exit.mnemonic: E *File.labelString: File *File.mnemonic: F # # Help menu # *Help.labelString: Help *Help.mnemonic: H *Overview.labelString: Overview *Overview.mnemonic: O *InputInfo.labelString: Input Method *InputInfo.mnemonic: I # # Font selection radio box # *font.label.labelString: Select font *font*button1.labelString: Small *font*button1.renderTable: *font*button1.renderTable.fontName: *medium*-r-*--14* *font*button1.renderTable.fontType: font_is_fontset *font*button2.labelString: Medium *font*button2.renderTable: *font*button2.renderTable.fontName: *medium*-r-*--18* *font*button2.renderTable.fontType: font_is_fontset *font*button3.labelString: Large *font*button3.renderTable: *font*button3.renderTable.fontName: *medium*-r-*--24* *font*button3.renderTable.fontType: font_is_fontset # If you change XmText[Field].renderTable to use the font of another button # as the initial value, change button2 in the next line to the appropriate # button (button1, button2, button3) *font*button2.set: True *XmText.renderTable: *XmText.renderTable.fontName: *medium*-r-*--18* *XmText.renderTable.fontType: font_is_fontset *XmTextField.renderTable: *XmTextField.renderTable.fontName: *medium*-r-*--18* *XmTextField.renderTable.fontType: font_is_fontset # # Color selection radio box # # If you change colors, you might want to change labelStrings also # *color.label.labelString: Select color *color*button1.labelString: Red *color*button1.foreground: #fe5151 *color*button1.selectColor: #fe5151 *color*button2.labelString: Green *color*button2.foreground: #00be51 *color*button2.selectColor: #00be51 *color*button3.labelString: Blue *color*button3.foreground: #2aa1fd *color*button3.selectColor: #2aa1fd # If you change the initial background, remember to change which button is # initially set. *scrolledText.background: #fe5151 *scrolledtext*color*button1.set: True *Text.background: #00be51 *text*color*button2.set: True *textField.background: #2aa1fd *textfield*color*button3.set: True # # Dialog titles # *im_info.dialogTitle: Input method information *help_popup.title: Help # # Colors and fonts for all widgets, unless otherwise specified # *background: ivory *renderTable: *renderTable*fontName: *helvetica*bold*-r-*--14* *renderTable*fontType: font_is_font *renderTable*tabList: 20fu, +17fu # # Application resources for information on input method used. # Provided to enable translation of this text. # *localeString: Locale: *preeditString: Preedit style: *statusString: Status style: *noImString: No input method has been opened *noIcString: No input context(s) created *imInfoString: \ \nSee VendorShell documentation for more information\n\ on preedit and status styles. For information on\n\ available input methods and invocation of input\n\ methods, refer to your vendor documentation. motif-2.3.8/demos/programs/i18ninput/i18ninput.help0000644000175000017500000000727512672140200017101 00000000000000Overview Overview This program shows a scrolled XmText, a single-line XmText and an XmTextField. The intention is to show Motif's capability of internationalized text input. For many of the languages in the world, text in that language can be directly typed on the keyboard. For others, this is not the case. A character may require several keystrokes. This is accomplished by composing or preediting text before it is passed to its destination. The control panels for fonts and colors show how these values are passed to the input method to give preediting and status areas a look consistent with the widget which currently has the focus. Composing and preediting Composing is usually used when a set of key strokes always results in the same character. For example, the character å may require three keystrokes: Compose Key, a, o. Preediting is used when the same set of key strokes can result in different characters. For example, the keystrokes may be a phonetic representation of a kanji character. However, several kanji characters may use the same phonetic representation, so the typist must be able to choose the target character from a list of possible characters. Both of these may use an input method. For composing, the input method is often very simple, and the user may not even notice that one is in use. The preedit style is usually set to XIMPreeditNone and the status style to XIMStatusNone. (See Xlib documentation for information on the meaning of these values.) When preediting is required, there are a variety of styles. Which styles are supported depends on the vendor of your X library and server. Motif supports three preediting styles and two status style in addition to the two mentioned above. To find out the current preediting style, select "Input Method" from the Help menu. This window will also show the locale the program is running in. Preediting Preediting There are two areas visible while doing preediting, the preedit area and the status area. These may be separate or joint. The preedit area displays the characters before they are committed to the text widget. The status area displays information about how the keyboard input is interpreted. The status area also displays the menu of characters matching the keyboard input when there are multiple choices. Preediting styles supported by Motif are: XIMPreeditPosition (also called over-the-spot) XIMPreeditArea (also called off-the-spot) XIMPreeditNothing (also called root) Status styles are: XIMStatusArea XIMStatusNothing For XIMPreeditNothing/XIMStatusNothing, the input method will create a window as a child of the root window. This may or may not be visible when preediting is not in progress. This is where the composed characters and/or the status information are displayed. For XIMPreeditArea/XIMStatusArea, the input method will use the window of the VendorShell. The shell is resized to allow for at least one line of text in the font used in the widget with the focus. For XIMPreeditPosition, the preedited text is displayed in a window placed on top of the widget. For text widgets, this is at the insertion position of the widget. Choosing preedit style The preferred preediting style can be set with the XmNpreeditType resource. This is a VendorShell resource, and applies to all children of this shell. (See VendorShell reference page for appropriate values) How do I start preediting? The actual keystrokes that switches into or out of preediting mode or inserts the preedited text in the widget are different for different input methods. Refer to your vendor documentation for more information on this subject. motif-2.3.8/demos/programs/i18ninput/i18ninput.man0000644000175000017500000000346612672140200016722 00000000000000.\" $XConsortium: i18ninput.man /main/4 1995/07/17 10:47:53 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH i18ninput 1X MOTIF "Demonstration programs" .SH NAME \*Li18ninput \*O\(em entering text with input methods in Motif's text widgets .SH SYNOPSIS .sS \*Li18ninput\*O .sE .SH DESCRIPTION \*Li18ninput\*O is a demo fully enabled to interact with input methods. It shows the effect of different colors and fonts in widgets that interact with input methods. The "Input Method" help item provides some information on the active input method. This demo is also fully internationalized. It has only been localized to english. All localization information is contained in the application resource file. .SH X Defaults The class of this application is \fIXmdI18nInput\fR. See the application resource file for interesting resources to change. To set a specific resource in your \fI.Xdefaults\fR file, you specify the particular widget and resource. motif-2.3.8/demos/programs/i18ninput/README0000644000175000017500000000254412672140200015242 00000000000000/* $XConsortium: README /main/4 1996/07/15 14:06:13 drk $ */ i18ninput ========= This program is set up to handle text input in any language. It shows the effect of changing background or font in a text widget that uses an input method. The main window contains a scrolled multi-line XmText, a one-line XmText and an XmTextField. All three have a separate control panel for the font and background color of the text widgets. The key function call for enabling internationalized text input is the call to XtSetLanguageProc in main.c. See the man page for XtSetLanguageProc for a description of this function. This function must be called to enable text input through an input method. In addition, some languages require more than one font to render text in this language. Therefore, the demo uses fontsets as a default. Worth noting is that no fonts or labels are hardcoded. The labels, colors and fonts necessary for the demo to be meaningful are either specified as fallback resources or as the default value of application resources. Files: ====== README is this file. main.c contains program initialization. input.c contains functions for creating the user interface and interacting with the user. I18ninput contains application resources. i18ninput.help contains some help on this program. This file is displayed if you select Overview in the Help menu. motif-2.3.8/demos/programs/i18ninput/input.c0000644000175000017500000006375012672140200015673 00000000000000/* $XConsortium: input.c /main/5 1995/07/15 20:45:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define WI_INPUT 0 #define WI_MAINWINDOW 1 #define WI_MENUBAR 2 #define WI_FILEMENU 3 #define WI_EXIT 4 #define WI_FILE 5 #define WI_MAIN 6 #define WI_SCROLLEDTEXT 7 #define WI_STFONT 8 #define WI_SCROLLEDTEXT1 20 #define WI_SEPARATOR 21 #define WI_TEXT 22 #define WI_TEXT1 35 #define WI_SEPARATOR1 36 #define WI_TEXTFIELD 37 #define WI_TEXTFIELD1 50 #define WI_HELPMENU 51 #define WI_OVERVIEW 52 #define WI_INPUTINFO 53 #define WI_HELP 54 #define WI_FORM 0 #define WI_FONT 1 #define WI_RADIOBOX 2 #define WI_BUTTON1 3 #define WI_BUTTON2 4 #define WI_BUTTON3 5 #define WI_LABEL 6 #define WI_COLOR 7 #define WI_RADIOBOX1 8 #define WI_BUTTON4 9 #define WI_BUTTON5 10 #define WI_BUTTON6 11 #define WI_LABEL1 12 /* Global data */ typedef struct { String locale_string; String preedit_string; String status_string; String im_info_string; String no_im_string; String no_ic_string; } ApplicationData, *ApplicationDataPtr; static ApplicationData app_resources; static XtResource resources[] = { { "localeString", "LocaleString", XtRString, sizeof (String), XtOffset(ApplicationDataPtr, locale_string), XtRImmediate, "Locale:" }, { "preeditString", "PreeditString", XtRString, sizeof (String), XtOffset(ApplicationDataPtr, preedit_string), XtRImmediate, "Preedit style:" }, { "statusString", "StatusString", XtRString, sizeof (String), XtOffset(ApplicationDataPtr, status_string), XtRImmediate, "Status style:" }, { "noImString", "NoImString", XtRString, sizeof (String), XtOffset(ApplicationDataPtr, no_im_string), XtRImmediate, "No input method has been opened" }, { "noIcString", "NoIcString", XtRString, sizeof (String), XtOffset(ApplicationDataPtr, no_ic_string), XtRImmediate, "No input context(s) created" }, { "imInfoString", "ImInfoString", XtRString, sizeof (String), XtOffset(ApplicationDataPtr, im_info_string), XtRImmediate, "\n\ See VendorShell documentation for more information\n\ on preedit and status styles. For information on\n\ available input methods and invocation of input\n\ methods, refer to your vendor documentation." } }; /* callback functions */ static void ShowIMStatus(Widget widget, XtPointer args, XtPointer calldata); static void SelectFont(Widget widget, XtPointer args, XtPointer calldata); static void SelectColor(Widget widget, XtPointer args, XtPointer calldata); static void Exit(Widget widget, XtPointer args, XtPointer calldata); static void Overview(Widget widget, XtPointer args, XtPointer calldata); /**************************************************************** * * Interface * ****************************************************************/ /**************************************************************** * get_constraint_widget: * Get the right widget for setting form constraints. * Used for the scrolled XmText. * ****************************************************************/ static Widget get_constraint_widget(Widget child, Widget parent) { Widget w; w = child; while (XtParent(w) != parent) w = XtParent(w); return (w); } /**************************************************************** * * Main C code for presentation component * ****************************************************************/ /************************************************************** * form_widget: * Create a form widget with two radio boxes inside a frame, * one for setting fonts and one for setting color. * **************************************************************/ static void form_widget(char * name, Widget parent, Widget * warr_ret) { Arg args[16]; Widget widget_array[13]; XtCallbackList cbl; XtCallbackRec cbs1[2]; XtCallbackRec cbs2[2]; int inc; int n; /***************** object of type : XmForm *****************/ n = 0; XtSetArg(args[n], XmNfractionBase, 8); n++; widget_array[WI_FORM] = XmCreateForm(parent, name, args, n); /***************** font : XmFrame *****************/ widget_array[WI_FONT] = XmCreateFrame(widget_array[WI_FORM], "font", NULL, 0); /***************** radiobox : XmRadioBox *****************/ n = 0; cbl = cbs1; cbl->closure = (XtPointer) NULL; cbl->callback = SelectFont; cbl++; if (cbl != cbs1) { cbl->callback = NULL; XtSetArg(args[n], XmNentryCallback, cbs1); n++; } widget_array[WI_RADIOBOX] = XmCreateRadioBox(widget_array[WI_FONT], "radiobox", args, n); /***************** button1 : XmToggleButton *****************/ widget_array[WI_BUTTON1] = XmCreateToggleButton(widget_array[WI_RADIOBOX], "button1", NULL, 0); /***************** button2 : XmToggleButton *****************/ widget_array[WI_BUTTON2] = XmCreateToggleButton(widget_array[WI_RADIOBOX], "button2", NULL, 0); /***************** button3 : XmToggleButton *****************/ widget_array[WI_BUTTON3] = XmCreateToggleButton(widget_array[WI_RADIOBOX], "button3", NULL, 0); /***************** label : XmLabel *****************/ n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++; XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_CENTER); n++; widget_array[WI_LABEL] = XmCreateLabel(widget_array[WI_FONT], "label", args, n); /***************** color : XmFrame *****************/ widget_array[WI_COLOR] = XmCreateFrame(widget_array[WI_FORM], "color", NULL, 0); /***************** radiobox : XmRadioBox *****************/ n = 0; cbl = cbs2; cbl->closure = (XtPointer) NULL; cbl->callback = SelectColor; cbl++; if (cbl != cbs2) { cbl->callback = NULL; XtSetArg(args[n], XmNentryCallback, cbs2); n++; } widget_array[WI_RADIOBOX1] = XmCreateRadioBox(widget_array[WI_COLOR], "radiobox", args, n); /***************** button1 : XmToggleButton *****************/ n = 0; widget_array[WI_BUTTON4] = XmCreateToggleButton(widget_array[WI_RADIOBOX1], "button1", args, n); /***************** button2 : XmToggleButton *****************/ n = 0; widget_array[WI_BUTTON5] = XmCreateToggleButton(widget_array[WI_RADIOBOX1], "button2", args, n); /***************** button3 : XmToggleButton *****************/ n = 0; widget_array[WI_BUTTON6] = XmCreateToggleButton(widget_array[WI_RADIOBOX1], "button3", args, n); /***************** label : XmLabel *****************/ n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++; XtSetArg(args[n], XmNchildHorizontalAlignment, XmALIGNMENT_CENTER); n++; widget_array[WI_LABEL1] = XmCreateLabel(widget_array[WI_COLOR], "label", args, n); /***************** font : XmFrame *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightPosition, 4); n++; XtSetArg(args[n], XmNtopPosition, 5); n++; XtSetValues(widget_array[WI_FONT], args, n); XtManageChild(widget_array[WI_BUTTON1]); XtManageChild(widget_array[WI_BUTTON2]); XtManageChild(widget_array[WI_BUTTON3]); XtManageChild(widget_array[WI_RADIOBOX]); XtManageChild(widget_array[WI_LABEL]); XtManageChild(widget_array[WI_FONT]); /***************** color : XmFrame *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNleftWidget, widget_array[WI_FONT]); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopPosition, 5); n++; XtSetValues(widget_array[WI_COLOR], args, n); XtManageChild(widget_array[WI_BUTTON4]); XtManageChild(widget_array[WI_BUTTON5]); XtManageChild(widget_array[WI_BUTTON6]); XtManageChild(widget_array[WI_RADIOBOX1]); XtManageChild(widget_array[WI_LABEL1]); XtManageChild(widget_array[WI_COLOR]); XtManageChild(widget_array[WI_FORM]); if (warr_ret != NULL) { (void) memcpy((char *)warr_ret, (char *)widget_array, sizeof(Widget)*13); } } /************************************************************** * create_input_widget: * Creates the application shell and all children except the * two dialogs. **************************************************************/ static Widget create_input_widget(char * name, Display * display, int argc, char ** argv) { Arg args[18]; Arg pargs[5]; Widget tmpw; Widget widget_array[60]; int inc; int n; int pn; /***************** ApplicationShell *****************/ n = 0; /* Setup argc & argv attribute */ XtSetArg(args[n], XtNargc, argc); n++; XtSetArg(args[n], XtNargv, argv); n++; XtSetArg(args[n], XtNallowShellResize, True); n++; /* to allow widgets to change size when font changes */ widget_array[WI_INPUT] = XtAppCreateShell(name, "I18ninput", applicationShellWidgetClass, display, args, n); /***************** mainWindow : XmMainWindow *****************/ widget_array[WI_MAINWINDOW] = XmCreateMainWindow(widget_array[WI_INPUT], "mainWindow", NULL, 0); /***************** menuBar : XmMenuBar *****************/ widget_array[WI_MENUBAR] = XmCreateMenuBar(widget_array[WI_MAINWINDOW], "menuBar", NULL, 0); /***************** filemenu : XmPulldownMenu *****************/ widget_array[WI_FILEMENU] = XmCreatePulldownMenu(widget_array[WI_MENUBAR], "filemenu", NULL, 0); /***************** exit : XmPushButton *****************/ widget_array[WI_EXIT] = XmCreatePushButton(widget_array[WI_FILEMENU], "Exit", NULL, 0); XtAddCallback(widget_array[WI_EXIT], XmNactivateCallback, (XtCallbackProc)Exit, NULL); /***************** file : XmCascadeButton *****************/ n = 0; XtSetArg(args[n], XmNsubMenuId, widget_array[WI_FILEMENU]); n++; widget_array[WI_FILE] = XmCreateCascadeButton(widget_array[WI_MENUBAR], "File", args, n); /***************** helpmenu : XmPulldownMenu *****************/ widget_array[WI_HELPMENU] = XmCreatePulldownMenu(widget_array[WI_MENUBAR], "helpmenu", NULL, 0); /***************** overview : XmPushButton *****************/ widget_array[WI_OVERVIEW] = XmCreatePushButton(widget_array[WI_HELPMENU], "Overview", NULL, 0); XtAddCallback(widget_array[WI_OVERVIEW], XmNactivateCallback, (XtCallbackProc)Overview, NULL); /***************** input : XmPushButton *****************/ widget_array[WI_INPUTINFO] = XmCreatePushButton(widget_array[WI_HELPMENU], "InputInfo", NULL, 0); XtAddCallback(widget_array[WI_INPUTINFO], XmNactivateCallback, (XtCallbackProc)ShowIMStatus, NULL); /***************** help : XmCascadeButton *****************/ n = 0; XtSetArg(args[n], XmNsubMenuId, widget_array[WI_HELPMENU]); n++; widget_array[WI_HELP] = XmCreateCascadeButton(widget_array[WI_MENUBAR], "Help", args, n); n = 0; XtSetArg(args[n], XmNmenuHelpWidget, widget_array[WI_HELP]); n++; XtSetValues(widget_array[WI_MENUBAR], args, n); /***************** main : XmForm *****************/ n = 0; XtSetArg(args[n], XmNfractionBase, 3); n++; widget_array[WI_MAIN] = XmCreateForm(widget_array[WI_MAINWINDOW], "main", args, n); /***************** scrolledtext : XmForm *****************/ form_widget("scrolledtext", widget_array[WI_MAIN], &(widget_array[WI_SCROLLEDTEXT])); /***************** scrolledText : XmScrolledText *****************/ n = 0; XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++; XtSetArg(args[n], XmNrows, 8); n++; XtSetArg(args[n], XmNcolumns, 12); n++; widget_array[WI_SCROLLEDTEXT1] = XmCreateScrolledText(widget_array[WI_SCROLLEDTEXT], "scrolledText", args, n); /***************** separator : XmSeparator *****************/ n = 0; XtSetArg(args[n], XmNorientation, XmVERTICAL); n++; XtSetArg(args[n], XmNshadowThickness, 4); n++; widget_array[WI_SEPARATOR] = XmCreateSeparator(widget_array[WI_MAIN], "separator", args, n); /***************** text : XmForm *****************/ form_widget("text", widget_array[WI_MAIN], &(widget_array[WI_TEXT])); /***************** text : XmText *****************/ n = 0; XtSetArg(args[n], XmNcolumns, 12); n++; widget_array[WI_TEXT1] = XmCreateText(widget_array[WI_TEXT], "Text", args, n); /***************** separator1 : XmSeparator *****************/ n = 0; XtSetArg(args[n], XmNorientation, XmVERTICAL); n++; XtSetArg(args[n], XmNshadowThickness, 4); n++; widget_array[WI_SEPARATOR1] = XmCreateSeparator(widget_array[WI_MAIN], "separator1", args, n); /***************** textfield : XmForm *****************/ form_widget("textfield", widget_array[WI_MAIN], &(widget_array[WI_TEXTFIELD])); /***************** textField : XmTextField *****************/ n = 0; XtSetArg(args[n], XmNcolumns, 12); n++; widget_array[WI_TEXTFIELD1] = XmCreateTextField(widget_array[WI_TEXTFIELD], "textField", args, n); XtManageChild(widget_array[WI_EXIT]); XtManageChild(widget_array[WI_FILE]); XtManageChild(widget_array[WI_OVERVIEW]); XtManageChild(widget_array[WI_INPUTINFO]); XtManageChild(widget_array[WI_HELP]); XtManageChild(widget_array[WI_MENUBAR]); /***************** scrolledtext : XmForm *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightPosition, 1); n++; XtSetValues(widget_array[WI_SCROLLEDTEXT], args, n); /***************** scrolledText : XmScrolledText *****************/ pn = 0; XtSetArg(pargs[pn], XmNleftAttachment, XmATTACH_FORM); pn++; XtSetArg(pargs[pn], XmNrightAttachment, XmATTACH_FORM); pn++; XtSetArg(pargs[pn], XmNtopAttachment, XmATTACH_FORM); pn++; XtSetArg(pargs[pn], XmNbottomAttachment, XmATTACH_WIDGET); pn++; XtSetArg(pargs[pn], XmNbottomWidget, widget_array[WI_STFONT]); pn++; tmpw = get_constraint_widget(widget_array[WI_SCROLLEDTEXT1], widget_array[WI_SCROLLEDTEXT]); if (tmpw) XtSetValues(tmpw, pargs, pn); XtManageChild(widget_array[WI_SCROLLEDTEXT1]); XtManageChild(widget_array[WI_SCROLLEDTEXT]); /***************** separator : XmSeparator *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftWidget, widget_array[WI_SCROLLEDTEXT]); n++; XtSetValues(widget_array[WI_SEPARATOR], args, n); XtManageChild(widget_array[WI_SEPARATOR]); /***************** text : XmForm *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNleftWidget, widget_array[WI_SEPARATOR]); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION); n++; XtSetArg(args[n], XmNrightPosition, 2); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetValues(widget_array[WI_TEXT], args, n); /***************** text : XmText *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++; XtSetValues(widget_array[WI_TEXT1], args, n); XtManageChild(widget_array[WI_TEXT1]); XtManageChild(widget_array[WI_TEXT]); /***************** separator1 : XmSeparator *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftWidget, widget_array[WI_TEXT]); n++; XtSetValues(widget_array[WI_SEPARATOR1], args, n); XtManageChild(widget_array[WI_SEPARATOR1]); /***************** textfield : XmForm *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNleftWidget, widget_array[WI_SEPARATOR1]); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetValues(widget_array[WI_TEXTFIELD], args, n); /***************** textField : XmTextField *****************/ n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++; XtSetValues(widget_array[WI_TEXTFIELD1], args, n); XtManageChild(widget_array[WI_TEXTFIELD1]); XtManageChild(widget_array[WI_TEXTFIELD]); XtManageChild(widget_array[WI_MAIN]); XtManageChild(widget_array[WI_MAINWINDOW]); /* * Return the first created widget. */ return widget_array[WI_INPUT]; } /**************************************************************** * * Dialog * ****************************************************************/ /**************************************************************** * SelectFont: * Set the font of the Text child of our parent form to the * ****************************************************************/ /*ARGSUSED*/ static void SelectFont(Widget widget, XtPointer args, XtPointer calldata) { XmRowColumnCallbackStruct *cbs = (XmRowColumnCallbackStruct*)calldata; XmFontList fontlist; Widget *children, *swchildren; Cardinal num_children, num_swchildren; Widget form = widget; Boolean set = False; int i, j; XtVaGetValues(cbs->widget, XmNfontList, &fontlist, XmNset, &set, NULL); if (!set) return; /* do not change font when toggle is unset */ /* Find XmForm parent */ while (form && !XmIsForm(form)) form = XtParent(form); if (form) { /* Find an XmText[Field] child and apply XmNfontList */ XtVaGetValues(form, XmNchildren, &children, XmNnumChildren, &num_children, NULL); for (i = 0; i < num_children; i++) { if (XmIsText(children[i]) || XmIsTextField(children[i])) { XtVaSetValues(children[i], XmNfontList, fontlist, NULL); break; } if (XmIsScrolledWindow(children[i])) { /* This may be a scrolled text. Look for an XmText child */ XtVaGetValues(children[i], XmNchildren, &swchildren, XmNnumChildren, &num_swchildren, NULL); for (j = 0; j < num_swchildren; j++) if (XmIsText(swchildren[j])) { XtVaSetValues(swchildren[j], XmNfontList, fontlist, NULL); break; } if (j != num_swchildren) break; } } } } /*ARGSUSED*/ static void SelectColor(Widget widget, XtPointer args, XtPointer calldata) { XmRowColumnCallbackStruct *cbs = (XmRowColumnCallbackStruct*)calldata; Pixel color; Widget *children, *swchildren; Cardinal num_children, num_swchildren; Widget form = widget; Boolean set; int i, j; XtVaGetValues(cbs->widget, XmNforeground, &color, XmNset, &set, NULL); if (!set) return; /* do not change color when toggle is unset */ /* Find XmForm parent */ while (form && !XmIsForm(form)) form = XtParent(form); if (form) { /* Find an XmText[Field] child and apply toggle's XmNforeground to text's XmNbackground */ XtVaGetValues(form, XmNchildren, &children, XmNnumChildren, &num_children, NULL); for (i = 0; i < num_children; i++) { if (XmIsText(children[i]) || XmIsTextField(children[i])) XtVaSetValues(children[i], XmNbackground, color, NULL); if (XmIsScrolledWindow(children[i])) { /* This may be a scrolled text. Look for an XmText child */ XtVaGetValues(children[i], XmNchildren, &swchildren, XmNnumChildren, &num_swchildren, NULL); for (j = 0; j < num_swchildren; j++) if (XmIsText(swchildren[j])) { XtVaSetValues(swchildren[j], XmNbackground, color, NULL); break; } if (j != num_swchildren) break; } } } } /*ARGSUSED*/ static void ShowIMStatus(Widget widget, XtPointer client_data, XtPointer calldata) { static Widget message_dialog = NULL; Widget toplevel; Widget text_widget, tmp_w; XIM xim; XIC xic = NULL; XIMStyle style; char *locale; char *preedit_style = "", *status_style = ""; char *buf; XmString message_str; Arg args[10]; int n; /* Get input method used */ xim = XmImGetXIM(widget); if (!xim) { locale = setlocale(LC_CTYPE, NULL); } else { locale = XLocaleOfIM(xim); } /* Find ApplicationShell */ toplevel = widget; while (toplevel && !XtIsApplicationShell(toplevel)) toplevel = XtParent(toplevel); if (!toplevel) return; /* Get input context info for text widget */ text_widget = XtNameToWidget(toplevel, "*Text"); if (text_widget) xic = XmImSetXIC(text_widget, NULL); if (xic && XGetICValues(xic, XNInputStyle, &style, NULL) == NULL) { if (style & XIMPreeditArea) preedit_style = "OffTheSpot \t(XIMPreeditArea)"; else if (style & XIMPreeditPosition) preedit_style = "OverTheSpot \t(XIMPreeditPosition)"; else if (style & XIMPreeditNothing) preedit_style = "Root \t(XIMPreeditNothing)"; else if (style & XIMPreeditNone) preedit_style = "None \t(XIMPreeditNone)"; if (style & XIMStatusArea) status_style = "OffTheSpot \t(XIMStatusArea)"; else if (style & XIMStatusNothing) status_style = "Root \t(XIMStatusNothing)"; else if (style & XIMStatusNone) status_style = "None \t(XIMStatusNone)"; } /* Create help text */ buf = (char *)XtMalloc(strlen(app_resources.locale_string) + strlen(locale) + strlen(app_resources.preedit_string) + strlen(preedit_style) + strlen(app_resources.status_string) + strlen(status_style) + strlen(app_resources.im_info_string) + 100); if (xim) { if (xic) { sprintf(buf, "%s \t%s\n%s \t%s\n%s \t%s\n%s", app_resources.locale_string, locale, app_resources.preedit_string, preedit_style, app_resources.status_string, status_style, app_resources.im_info_string); } else { sprintf(buf, "%s \t%s\n%s\n%s", app_resources.locale_string, locale, app_resources.no_ic_string, app_resources.im_info_string); } } else { sprintf(buf, "%s \t%s\n%s", app_resources.locale_string, locale, app_resources.no_im_string); } message_str = XmStringGenerate(buf, NULL, XmCHARSET_TEXT, NULL); XtFree((char *)buf); /* put help text in a message dialog */ n = 0; XtSetArg(args[n], XmNmessageString, message_str); n++; if (message_dialog == NULL) { message_dialog = XmCreateMessageDialog(toplevel, "im_info", args, n); /* Only keep OK button */ tmp_w = XmMessageBoxGetChild(message_dialog, XmDIALOG_CANCEL_BUTTON); XtUnmanageChild(tmp_w); tmp_w = XmMessageBoxGetChild(message_dialog, XmDIALOG_HELP_BUTTON); XtUnmanageChild(tmp_w); } else { XtSetValues(message_dialog, args, n); } XtManageChild(message_dialog); XmStringFree(message_str); } /*ARGSUSED*/ static void Overview(Widget widget, XtPointer client_data, XtPointer calldata) { Widget toplevel; static Widget help_window = NULL; Arg args[10]; int n; Position x, y; Dimension width, height; /* Find ApplicationShell */ toplevel = widget; while (toplevel && !XtIsApplicationShell(toplevel)) toplevel = XtParent(toplevel); if (!toplevel) return; /* Position dialog */ n = 0; XtSetArg(args[n], XmNx, &x); n++; XtSetArg(args[n], XmNy, &y); n++; XtSetArg(args[n], XmNwidth, &width); n++; XtSetArg(args[n], XmNheight, &height); n++; XtGetValues(toplevel, args, n); n = 0; XtSetArg(args[n], XmNx, x+width/2); n++; XtSetArg(args[n], XmNy, y+height/2); n++; if (help_window == NULL) { XtSetArg(args[n], XmdNhelpFile, "i18ninput"); n++; XtSetArg(args[n], XmNrenderTable, NULL); n++; /* to get default */ help_window = XmdCreateHelpDialog(toplevel, "help", args, n); } else { XtSetValues(XtParent(help_window), args, n); } XtManageChild(help_window); } /*ARGSUSED*/ static void Exit(Widget widget, XtPointer args, XtPointer calldata) { exit(0); } int dialog_init(int *argc, char **argv, Display *dpy) { Widget appl_w; appl_w = create_input_widget("input", dpy, *argc, argv); XtGetApplicationResources(appl_w, &app_resources, resources, XtNumber(resources), NULL, 0); XtRealizeWidget(appl_w); XtPopup(appl_w, XtGrabNone); return 0; } motif-2.3.8/demos/programs/i18ninput/Makefile.am0000644000175000017500000000067213145162623016427 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/i18ninput datadir = ${prefix}/share/Xm/i18ninput bin_PROGRAMS = i18ninput i18ninput_SOURCES = i18ninput.c input.c EXTRA_DIST = XmdI18nInput.ad README i18ninput.man i18ninput.help data_DATA = $(EXTRA_DIST) $(i18ninput_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/filemanager/0000755000175000017500000000000013211513007015047 500000000000000motif-2.3.8/demos/programs/filemanager/pix.xpm0000644000175000017500000000365412672140200016326 00000000000000/* XPM */ /* $XConsortium: pix.xpm /main/4 1995/07/18 16:03:51 drk $ */ static char * pix [] = { /* width height ncolors cpp [x_hot y_hot] */ "32 40 9 1 0 0", /* colors */ " s topShadowColor m white c #c8c8c8c8c8c8", ". s iconColor2 m white c white", "X s bottomShadowColor m black c #646464646464", "o s iconColor3 m black c red", "O s iconColor7 m white c cyan", "+ s iconGray1 m white c #e1e1e1e1e1e1", "@ s iconColor5 m black c blue", "# s iconColor4 m white c green", "$ s iconColor8 m black c magenta", /* pixels */ " ", " ..............................X", " ..............................X", " ..oooooOOOOO+++++.............X", " ..oooooOOOOO+++++.............X", " ..oooooOOOOO+++++.............X", " ..oooooOOOOO+++++.............X", " ..oooooOOOOO+++++.............X", " ..@@@@@ooooo#####.............X", " ..@@@@@ooooo#####.............X", " ..@@@@@ooooo#####.............X", " ..@@@@@ooooo#####.............X", " ..@@@@@ooooo#####.............X", " ..ooooo@@@@@$$$$$.............X", " ..ooooo@@@@@$$$$$.............X", " ..ooooo@@@@@$$$$$.............X", " ..ooooo@@@@@$$$$$.............X", " ..ooooo@@@@@$$$$$.............X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}; motif-2.3.8/demos/programs/filemanager/filemanager.help0000644000175000017500000000146612672140200020123 00000000000000Introduction Filemanager is a demonstration of the XmContainer widget, the XmIconGadget, the Motif pixmap reader (which now can read XPM files) and also serves to show the usage of the X resource mechanism. It does allow for some configuration of actions and icons. To use the demo, simply run it from the directory of interest. Navigation is obtained by activating (double clicking) the folder icons (.., or a subdir), by selecting a parent directory from the option menu, or by using the "Open..." menu item to enter a pathname. Read the man page for details on setting resources to customize the application. The xpm files supplied can be installed in your normal bitmap/pixmap repository and note that you can customize this for Motif by using the XBMLANGPATH environment variable. motif-2.3.8/demos/programs/filemanager/s_dir.xpm0000644000175000017500000000127412672140200016622 00000000000000/* XPM */ /* $XConsortium: s_dir.xpm /main/4 1995/07/18 16:03:59 drk $ */ static char * s_dir [] = { /* width height ncolors cpp [x_hot y_hot] */ "16 16 5 1 -1 -1", /* colors */ " s topShadowColor m white c #c8c8c8c8c8c8", ". s bottomShadowColor m black c #646464646464", "X s none m none c none", "o s iconColor5 m black c blue", "O s iconColor1 m black c black", /* pixels */ " .XXXXXXXXX", " ooooo.XXXXXXXXX", " ooooo.XXXXXXXXX", " ", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", " OOOOOOOOOOOOOO.", "................"}; motif-2.3.8/demos/programs/filemanager/obj.xpm0000644000175000017500000000340612672140200016273 00000000000000/* XPM */ /* $XConsortium: obj.xpm /main/4 1995/07/18 16:03:45 drk $ */ static char * obj [] = { /* width height ncolors cpp [x_hot y_hot] */ "32 40 4 1 0 0", /* colors */ " s topShadowColor m white c #c8c8c8c8c8c8", ". s iconColor2 m white c white", "X s bottomShadowColor m black c #646464646464", "o s selectColor m white c #7d7d7d7d7d7d", /* pixels */ " ", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ...........oooooooooooooo.....X", " ..........oooooooooooooooo....X", " .........oo..............oo...X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " ........oo................oo..X", " .....o..oo................oo..X", " ....ooo..oo..............oo...X", " ...ooooo..oooooooooooooooo....X", " ....ooo.....oooooooooooo......X", " .....o........................X", " ..............................X", " ..............................X", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}; motif-2.3.8/demos/programs/filemanager/dir.xpm0000644000175000017500000000377612672140200016311 00000000000000/* XPM */ /* $XConsortium: dir.xpm /main/4 1995/07/18 16:03:18 drk $ */ static char * dir [] = { /* width height ncolors cpp [x_hot y_hot] */ "48 32 5 1 0 0", /* colors */ " s none m none c none", ". s topShadowColor m white c #c8c8c8c8c8c8", "X s iconColor5 m black c blue", "o s background m black c #969696969696", "O s bottomShadowColor m black c #646464646464", /* pixels */ " ", " ............... ", " .XXXXXXXXXXXXXXX. ", " .XXXXXXXXXXXXXXX. ", " .XXXXXXXXXXXXXXX.............................. ", " .XXXXXXXXXXXXXXX.oooooooooooooooooooooooooooooO", " .XXXXXXXXXXXXXXX.oooooooooooooooooooooooooooooO", ".................ooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".ooooooooooooooooooooooooooooooooooooooooooooooO", ".OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"}; motif-2.3.8/demos/programs/filemanager/convert.c0000644000175000017500000000653612672140200016626 00000000000000/* $XConsortium: convert.c /main/5 1995/07/15 20:45:16 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include #include "filemanager.h" void targetConvertCallback(Widget wid, XtPointer ignore, XmConvertCallbackStruct *cs) { Atom XA_TARGETS = XInternAtom(XtDisplay(wid), XmSTARGETS, False); Atom XA_FILE = XInternAtom(XtDisplay(wid), XmSFILE, False); Atom XA_FILENAME = XInternAtom(XtDisplay(wid), XmSFILE_NAME, False); Atom XA_MOTIF_EXPORTS = XInternAtom(XtDisplay(wid), XmS_MOTIF_EXPORT_TARGETS, False); Atom XA_MOTIF_REQUIRED = XInternAtom(XtDisplay(wid), XmS_MOTIF_CLIPBOARD_TARGETS, False); Atom XA_MOTIF_DROP = XInternAtom(XtDisplay(wid), XmS_MOTIF_DROP, False); if (cs -> selection == XA_MOTIF_DROP && (cs -> target == XA_TARGETS || cs -> target == XA_MOTIF_EXPORTS || cs -> target == XA_MOTIF_REQUIRED)) { Atom *targs; targs = (Atom *) XtMalloc(sizeof(Atom) * 2); targs[0] = XA_FILE; targs[1] = XA_FILENAME; cs -> value = (XtPointer) targs; cs -> length = 2; cs -> type = XA_ATOM; cs -> format = 32; cs -> status = XmCONVERT_MERGE; } else if (cs -> target == XA_FILE || cs -> target == XA_FILENAME) { if (cs -> location_data == NULL) { WidgetList selected; Cardinal count; int i; /* First get list of selected items. */ XtVaGetValues(fileviewer, XmNselectedObjects, &selected, XmNselectedObjectCount, &count, NULL, NULL); if (count > 0) { char *rval = NULL; int curpos = 0; for(i = 0; i < count; i++) { char *path; int pathlen; path = getPathFromIcon(selected[i]); pathlen = strlen(path) + 1; rval = XtRealloc(rval, curpos + pathlen); /* This will include the terminating NULL byte. Important, do not remove this NULL byte, it acts as a separator */ strncpy(rval, path, pathlen); curpos += pathlen; } cs -> format = 8; cs -> length = curpos - 1; cs -> type = XA_STRING; cs -> status = XmCONVERT_DONE; } else { cs -> status = XmCONVERT_REFUSE; } } else { char *path; path = getPathFromIcon(cs -> location_data); cs -> value = path; if (path != NULL) cs -> length = strlen(path); else cs -> length = 0; cs -> format = 8; cs -> type = XA_STRING; cs -> status = XmCONVERT_DONE; } } } void targetDestinationCallback(Widget w, XtPointer ignore, XmDestinationCallbackStruct *cs) { /* Later */ } motif-2.3.8/demos/programs/filemanager/interface.c0000644000175000017500000002056513066310437017115 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: interface.c /main/6 1995/07/14 09:41:50 drk $" #endif #endif #include #include #include /* Motif Toolkit */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "filemanager.h" Widget CreateMenuButton(char* name, Widget parent, XtCallbackProc callback, XtPointer data, char mnemonic) { Widget button; Arg args[2]; int n = 0; if (mnemonic != 0) { XtSetArg(args[n], XmNmnemonic, mnemonic); n++; } button = XmCreatePushButtonGadget(parent, name, args, n); XtManageChild(button); XtAddCallback(button, XmNactivateCallback, callback, data); return(button); } Widget CreateInterface(char* name, Widget parent) { Widget top, menubar, selected, view, *selected_menu, *view_menu, view_pulldown, form, dirOM, where, sw, dirMenu, lroot, help, *help_menu, helpDialog, container, view_sub_menu, show_hidden; Arg args[30]; int n; Cardinal size; XmString tmp, tmp2; Pixel white, black, lightblue, gray; Display *display; Screen *screen; XmRendition rend[1]; XmString headings[10]; int num_headings; /* Create widgets */ top = XmCreateMainWindow(parent, name, NULL, 0); XtManageChild(top); /* Goto dialog */ n = 0; tmp = XmStringCreateLocalized("Enter new directory"); tmp2 = XmStringCreateLocalized("Goto"); XtSetArg(args[n], XmNselectionLabelString, tmp); n++; XtSetArg(args[n], XmNokLabelString, tmp2); n++; gotoDialog = XmCreatePromptDialog(top, "gotoDialog", args, n); XtAddCallback(gotoDialog, XmNokCallback, gotoCB, NULL); XmStringFree(tmp); XmStringFree(tmp2); /* Menu bar */ menubar = XmCreateMenuBar(top, "menubar", NULL, 0); XtManageChild(menubar); XmdCreateMenu(SELECTED_MENU, menubar, &selected_menu, &size); XtUnmanageChildren(selected_menu, size); XtManageChild(selected_menu[SELECTED_NEW]); XtAddCallback(selected_menu[SELECTED_NEW], XmNactivateCallback, (XtCallbackProc) newFolder, NULL); XtManageChild(selected_menu[SELECTED_OPEN]); XtAddCallback(selected_menu[SELECTED_OPEN], XmNactivateCallback, (XtCallbackProc) manageCB, (XtPointer) gotoDialog); XtManageChild(selected_menu[SELECTED_DELETE]); XtAddCallback(selected_menu[SELECTED_DELETE], XmNactivateCallback, (XtCallbackProc) deleteItem, NULL); XtManageChild(selected_menu[SELECTED_EXIT]); XtAddCallback(selected_menu[SELECTED_EXIT], XmNactivateCallback, (XtCallbackProc) quitCB, NULL); view_pulldown = XmdCreateMenu(VIEW_MENU, menubar, &view_menu, &size); XtUnmanageChildren(view_menu, size); XtManageChild(view_menu[VIEW_CHANGE]); show_hidden = XmCreateToggleButtonGadget(view_pulldown, "show_hidden", NULL, 0); XtManageChild(show_hidden); XtAddCallback(show_hidden, XmNvalueChangedCallback, (XtCallbackProc) showHiddenCB, NULL); view_sub_menu = XmCreatePulldownMenu(view_pulldown, "viewSubMenu", NULL, 0); XtVaSetValues(view_menu[VIEW_CHANGE], XmNsubMenuId, view_sub_menu, NULL, NULL); CreateMenuButton("Large", view_sub_menu, (XtCallbackProc) viewCB, "large", 'L'); CreateMenuButton("Small", view_sub_menu, (XtCallbackProc) viewCB, "small", 'S'); CreateMenuButton("Detail", view_sub_menu, (XtCallbackProc) viewCB, "detail", 'D'); helpDialog = XmdCreateHelpDialog(top, "help_manager", NULL, 0); XmdCreateMenu(HELP_MENU, menubar, &help_menu, &size); XtUnmanageChildren(help_menu, size); XtManageChild(help_menu[HELP_OVERVIEW]); XtAddCallback(help_menu[HELP_OVERVIEW], XmNactivateCallback, (XtCallbackProc) manageCB, (XtPointer) helpDialog); /* Main window work area */ n = 0; XtSetArg(args[n], XmNrubberPositioning, False); n++; XtSetArg(args[n], XmNresizePolicy, XmRESIZE_ANY); n++; form = XmCreateForm(top, "form", args, n); XtManageChild(form); dirMenu = XmCreatePulldownMenu(top, "dirMenu", NULL, 0); /* Create children */ for(n = 0; n < 9; n++) { char buffer[10]; sprintf(buffer, "l%d", n); CreateMenuButton(buffer, dirMenu, NULL, NULL, 0); } /* Create the last child */ tmp = XmStringCreateLocalized("/"); n = 0; XtSetArg(args[n], XmNlabelString, tmp); n++; lroot = XmCreatePushButtonGadget(dirMenu, "lroot", args, n); XtAddCallback(lroot, XmNactivateCallback, (XtCallbackProc) readdirCB, (XtPointer) "/"); XtManageChild(lroot); XmStringFree(tmp); tmp = XmStringCreateLocalized("Directory"); n = 0; XtSetArg(args[n], XmNlabelString, tmp); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_NONE); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_NONE); n++; XtSetArg(args[n], XmNresizable, True); n++; XtSetArg(args[n], XmNsubMenuId, dirMenu); n++; dirOM = XmCreateOptionMenu(form, "dirOM", args, n); XtManageChild(dirOM); XmStringFree(tmp); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNleftWidget, dirOM); n++; XtSetArg(args[n], XmNleftOffset, 30); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg(args[n], XmNtopWidget, dirOM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget, dirOM); n++; where = XmCreateLabelGadget(form, "Where", args, n); XtManageChild(where); n = 0; XtSetArg(args[n], XmNwidth, 450); n++; XtSetArg(args[n], XmNheight, 350); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNtopWidget, dirOM); n++; XtSetArg(args[n], XmNtopOffset, 5); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNresizable, True); n++; XtSetArg(args[n], XmNleftOffset, 5); n++; XtSetArg(args[n], XmNrightOffset, 5); n++; XtSetArg(args[n], XmNbottomOffset, 5); n++; XtSetArg(args[n], XmNscrollingPolicy, XmAUTOMATIC); n++; XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmSTATIC); n++; XtSetArg(args[n], XmNscrolledWindowMarginWidth, 5); n++; XtSetArg(args[n], XmNscrolledWindowMarginHeight, 5); n++; sw = XmCreateScrolledWindow(form, "sw", args, n); XtManageChild(sw); num_headings = 0; headings[num_headings++] = XmStringCreateLocalized("Filename"); headings[num_headings++] = XmStringCreateLocalized("Owner"); headings[num_headings++] = XmStringCreateLocalized("Permissions"); headings[num_headings++] = XmStringCreateLocalized("Size"); n = 0; XtSetArg(args[n], XmNspatialIncludeModel, XmAPPEND); n++; XtSetArg(args[n], XmNspatialStyle, XmGRID); n++; XtSetArg(args[n], XmNspatialResizeModel, XmGROW_MINOR); n++; XtSetArg(args[n], XmNspatialSnapModel, XmCENTER); n++; XtSetArg(args[n], XmNdetailColumnHeading, headings); n++; XtSetArg(args[n], XmNdetailColumnHeadingCount, num_headings); n++; container = XmCreateContainer(sw, "container", args, n); XtManageChild(container); XtAddCallback(container, XmNdefaultActionCallback, (XtCallbackProc) selectCB, NULL); XtAddCallback(container, XmNoutlineChangedCallback, (XtCallbackProc) outlineCB, NULL); for(n = 0; n < num_headings; n++) XmStringFree(headings[n]); return(top); } motif-2.3.8/demos/programs/filemanager/readdir.c0000644000175000017500000004271412672140200016556 00000000000000/* $TOG: readdir.c /main/7 1997/03/31 13:53:34 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include #include #include /* Motif Toolkit */ #include /* Mrm */ #include #include #include "filemanager.h" Pixmap fileIcon, dirIcon, fileMask, dirMask, execIcon, execMask, noneIcon, noneMask; Pixmap s_fileIcon, s_dirIcon, s_fileMask, s_dirMask, s_execIcon, s_execMask, s_noneIcon, s_noneMask; #define NDIRLEVELS 9 int ndirLabel = NDIRLEVELS; Widget *dirLabel; char* paths[NDIRLEVELS]; Boolean showHidden = False; char *currentdir = NULL; int validFI = 0; int maxFI = 0; FileInfoRec *FI = NULL; int maxIcons = 0; int validIcons = 0; WidgetList IconGadgets = NULL; static void doOptionMenu(); static void getIcons(int ind, Pixmap *icon, Pixmap *mask, Pixmap *sicon, Pixmap *smask); static int GetNewEntry(int, char*, struct dirent*); static FileInfoRec *GetInfoFromWidget(Widget); typedef int (*qsProc)(const void *, const void *); static int qsCompare(void *xx, void *yy) { FileInfoRec *x = (FileInfoRec *) xx; FileInfoRec *y = (FileInfoRec *) yy; return(strcmp(x -> name, y -> name)); } static void SortChildren() { int i; if (validFI == 0) return; qsort(FI, validFI, sizeof(FileInfoRec), (qsProc) qsCompare); /* Reorder the list of gadgets */ for(i = 0; i < validFI; i++) IconGadgets[i] = FI[i].icon; } /* Determine real full pathname */ /* This code is UNIX pathname dependent */ char* expandPath(char *dirname) { char buf[1024]; Boolean parentdir = False; Boolean curdir = False; Boolean isroot = False; char *dir; int length; if (strcmp(dirname, "/") == 0) isroot = True; if (strncmp(dirname, "..", 2) == 0) parentdir = True; if (! parentdir && strncmp(dirname, ".", 1) == 0) curdir = True; if (! isroot && (curdir || parentdir)) { char *n; char *partial; /* Move currentdir info into a buffer for manipulation */ if (currentdir == NULL) { getcwd(buf, 1024); } else { strcpy(buf, currentdir); } dir = buf; length = strlen(dir); if (length > 2 && dir[length] == '/') dir[length] = 0; if (parentdir) { n = strrchr(dir, '/'); if (n != NULL) n = strrchr(dir, '/'); if (n != NULL) *n = 0; /* truncate */ } /* Look for ../ or ./ at the beginning of the string */ partial = strchr(dirname, '/'); if (partial != NULL) { strcat(dir, "/"); strcat(dir, partial); } /* If we are empty here, then we started with ../ */ if (dir[0] == 0) strcpy(dir, "/"); return(XtNewString(dir)); } else { return(XtNewString(dirname)); } } void readdirCB(Widget widget, char* dirname, XmAnyCallbackStruct *callback_data) { read_directory(NULL, dirname); } void outlineCB(Widget widget, char* subdirname, XmContainerOutlineCallbackStruct *callback_data) { if (callback_data -> new_outline_state == True) { Widget parent = callback_data -> item; char *path; int ind; FileInfoRec *f = GetInfoFromWidget(parent); if (! f -> dirRead) { /* Create full pathname. More complex as we must go find the all the parent's names first */ Widget grandparent; char *names[32]; /* They had better not go more than 32 levels deep in the view ! */ char buf[256]; int level; f->dirRead = True; level = 0; /* First go get all the strings */ XtVaGetValues(parent, XmNentryParent, &grandparent, NULL, NULL); names[level++] = f -> name; for(; grandparent != (Widget) NULL; level++) { FileInfoRec *f = GetInfoFromWidget(grandparent); if (f) names[level] = f -> name; /* Get the next parent */ XtVaGetValues(grandparent, XmNentryParent, &grandparent, NULL, NULL); } /* Now assemble the names into a string */ strcpy(buf, ""); for(level = level - 1; level >= 0; level--) { strcat(buf, "/"); /* Unix dependent */ strcat(buf, names[level]); } path = fullpath(buf); if (path != NULL) { read_directory(parent, path); XtFree(path); } } } } void read_directory(Widget parent, char* dirname) { DIR *thisdir; struct dirent *info; int i; char *tempdir = NULL; if (parent == NULL) { XtFree(currentdir); currentdir = expandPath(dirname); thisdir = opendir(currentdir); } else { tempdir = expandPath(dirname); thisdir = opendir(tempdir); } if (thisdir == NULL) return; if (parent == NULL) { struct stat buf; /* Unmanage all iconGadgets */ XtUnmanageChildren(IconGadgets,validFI); /* Free old namestrings */ for(i = 0; i < validFI; i++) XtFree(FI[i].name); validFI = 0; /* Reset */ /* Update last read time for current directory */ stat(currentdir, &buf); ltm = buf.st_ctime; } while((info = readdir(thisdir))) { Boolean is_dot, is_dotdot; is_dot = strcmp(info -> d_name, ".") == 0; is_dotdot = strcmp(info -> d_name, "..") == 0; /* We always process non-dot name files. But if they start with a dot, we process them only if showHidden is true, or they are one of dot or dot-dot */ if ((is_dot && parent == (Widget) NULL) || showHidden || is_dotdot || (! (info -> d_name[0] == '.'))) { validFI = process_single_entry(parent, tempdir, validFI, info); validFI++; } } /* Sort children and relayout container */ SortChildren(); XmContainerReorder(fileviewer, IconGadgets, validFI); /* Manage all valid iconGadgets */ XtManageChildren(IconGadgets,validFI); XmContainerRelayout(fileviewer); if (parent == NULL) { doOptionMenu(); } /* Restrict geometry of Container */ fixViewerSize(XtParent(fileviewer), NULL, NULL); closedir(thisdir); XtFree(tempdir); } int process_single_entry(Widget parent, char* dir, int ind, struct dirent *info) { Pixmap icon, mask; Pixmap s_icon, s_mask; char buf[64]; int status; int i; float size; XmString details[10]; XmString stemp; int num_details; mode_t mode; struct passwd *user; if (parent) status = GetNewEntry(ind, dir, info); else status = GetNewEntry(ind, currentdir, info); icon = mask = s_icon = s_mask = XmUNSPECIFIED_PIXMAP; if (status != -1) getIcons(ind, &icon, &mask, &s_icon, &s_mask); else getIcons(-1, &icon, &mask, &s_icon, &s_mask); num_details = 0; /* Owner */ if (status != -1) user = getpwuid(FI[ind].statbuf.st_uid); else user = NULL; if (user != NULL) details[num_details++] = XmStringCreateLocalized(user->pw_name); else { sprintf(buf, "%d", FI[ind].statbuf.st_uid); details[num_details++] = XmStringCreateLocalized(buf); } /* Permissions */ if (status != -1) mode = FI[ind].statbuf.st_mode; else mode = 0; sprintf(buf, "%c%c%c,%c%c%c,%c%c%c", (S_IRUSR & mode) ? 'r' : '-', (S_IWUSR & mode) ? 'w' : '-', (S_IXUSR & mode) ? 'x' : '-', (S_IRGRP & mode) ? 'r' : '-', (S_IWGRP & mode) ? 'w' : '-', (S_IXGRP & mode) ? 'x' : '-', (S_IROTH & mode) ? 'r' : '-', (S_IWOTH & mode) ? 'w' : '-', (S_IXOTH & mode) ? 'x' : '-'); details[num_details++] = XmStringCreateLocalized(buf); /* Size */ if (status != -1) size = FI[ind].statbuf.st_size; else size = 0; if (size < 1000.0) sprintf(buf, "%-d", (int) size); else if (size < 1.0e6) sprintf(buf, "%-.2fK", size/1.0e3); else sprintf(buf, "%-.2fM", size/1.0e6); details[num_details++] = XmStringCreateLocalized(buf); stemp = XmStringCreateLocalized(info -> d_name); XtVaSetValues(IconGadgets[ind], XmNlabelString, stemp, XmNlargeIconPixmap, icon, XmNlargeIconMask, mask, XmNsmallIconPixmap, s_icon, XmNsmallIconMask, s_mask, XmNdetail, details, XmNentryParent, parent, XmNoutlineState, XmCOLLAPSED, XmNdetailCount, num_details, NULL, NULL); FI[ind].icon = IconGadgets[ind]; XmStringFree(stemp); if (S_ISDIR(FI[ind].statbuf.st_mode) && strcmp(info -> d_name, ".") != 0 && strcmp(info -> d_name, "..") != 0) { ind++; FI[ind].dirRead = False; /* Create "." child */ GetNewEntry(ind, currentdir, info); stemp = XmStringCreateLocalized("."); XtVaSetValues(IconGadgets[ind], XmNlabelString, stemp, XmNlargeIconPixmap, icon, XmNlargeIconMask, mask, XmNsmallIconPixmap, s_icon, XmNsmallIconMask, s_mask, XmNdetail, details, XmNdetailCount, num_details, XmNentryParent, IconGadgets[ind-1], NULL, NULL); FI[ind].icon = IconGadgets[ind]; XmStringFree(stemp); } for(i = 0; i < num_details; i++) XmStringFree(details[i]); return(ind); } static int GetNewEntry(int vFI, char* dir, struct dirent *info) { char buf[256]; int status; if (vFI >= maxFI) { int newsize; if (maxFI == 0) { newsize = 64; FI = (FileInfoRec *) XtMalloc(newsize * sizeof(FileInfoRec)); } else { newsize = maxFI * 2; FI = (FileInfoRec *) XtRealloc((XtPointer) FI, newsize * sizeof(FileInfoRec)); } maxFI = newsize; } FI[vFI].name = XtNewString(info -> d_name); /* More UNIX specific code */ strcpy(buf, dir); strcat(buf, "/"); strcat(buf, info -> d_name); status = stat(buf, &FI[vFI].statbuf); if (vFI >= maxIcons) { int newsize; if (maxIcons == 0) { newsize = 64; IconGadgets = (Widget *) XtMalloc(sizeof(Widget) * newsize); } else { newsize = maxIcons * 2; IconGadgets = (Widget *) XtRealloc((XtPointer) IconGadgets, sizeof(Widget) * newsize); } maxIcons = newsize; } if (vFI >= validIcons) { IconGadgets[vFI] = XmCreateIconGadget(fileviewer, "IG", NULL, 0); validIcons++; } return status; } static char* find_suffix(char *filename) { int i = strlen(filename); while(i > 0 && filename[i] != '.') i--; if (filename[i] == '.') return(&filename[i + 1]); else return(filename); } static void readIcon(str, icon, mask, fg, bg) char *str; Pixmap *icon; Pixmap *mask; Pixel fg, bg; { if (str != NULL) { char msk[256]; if (strcmp(find_suffix(str), "xpm") == 0) { int len = strlen(str); strncpy(msk, str, len - 4); msk[len - 4] = 0; strcat(msk, "_m.xpm"); } else { strcpy(msk, str); strcat(msk, "_m"); } *icon = XmGetPixmap(XtScreen(toplevel), str, fg, bg); *mask = XmGetPixmapByDepth(XtScreen(toplevel), msk, WhitePixelOfScreen(XtScreen(toplevel)), BlackPixelOfScreen(XtScreen(toplevel)), 1); } } static void getIcons(int ind, Pixmap *icon, Pixmap *mask, Pixmap *sicon, Pixmap *smask) { Boolean isdir; Boolean isexec; Boolean canRead; FileInfoRec *info = &FI[ind]; mode_t mode; XrmQuark path[10]; XrmQuark classes[10]; XrmDatabase db = XtScreenDatabase(XtScreenOfObject(toplevel)); XrmValue value; XrmRepresentation type; Pixel fg, bg; char *str; char *default_type = NULL; XtVaGetValues(fileviewer, XmNforeground, &bg, XmNbackground, &fg, NULL, NULL); /* First try the resource database, then use the fallbacks below */ classes[0] = app_class_quark; classes[1] = XrmStringToQuark("Types"); classes[2] = XrmStringToQuark("Any"); classes[3] = XrmStringToQuark("Icon"); classes[4] = NULLQUARK; path[4] = NULLQUARK; path[0] = app_quark; path[1] = XrmStringToQuark("types"); if (ind < 0) { default_type = "default_none"; } else { path[2] = XrmStringToQuark(find_suffix(info -> name)); path[3] = XrmStringToQuark("largeIcon"); XrmQGetResource(db, path, classes, &type, &value); str = (char*) value.addr; readIcon(str, icon, mask, fg, bg); path[3] = XrmStringToQuark("smallIcon"); XrmQGetResource(db, path, classes, &type, &value); str = (char*) value.addr; readIcon(str, sicon, smask, fg, bg); if (*icon != XmUNSPECIFIED_PIXMAP && *sicon != XmUNSPECIFIED_PIXMAP) return; } isdir = S_ISDIR(info -> statbuf.st_mode); mode = info -> statbuf.st_mode; isexec = (mode & S_IXUSR) | (mode & S_IXGRP) | (mode & S_IXOTH); /* Defaults */ if (default_type != NULL) { path[2] = XrmStringToQuark(default_type); } else if (isdir) { path[2] = XrmStringToQuark("default_dir"); } else if (isexec) { path[2] = XrmStringToQuark("default_exec"); } else { path[2] = XrmStringToQuark("default_file"); } if (*icon == XmUNSPECIFIED_PIXMAP) { path[3] = XrmStringToQuark("largeIcon"); XrmQGetResource(db, path, classes, &type, &value); str = (char*) value.addr; readIcon(str, icon, mask, fg, bg); } if (*sicon == XmUNSPECIFIED_PIXMAP) { path[3] = XrmStringToQuark("smallIcon"); XrmQGetResource(db, path, classes, &type, &value); str = (char*) value.addr; readIcon(str, sicon, smask, fg, bg); } } /* Setup Option Menu */ /* Break off components and stuff into the pushbuttons */ /* This code is entirely UNIX pathname dependent */ static void doOptionMenu() { int i; XmString stemp; char *c = currentdir; Widget memWidget; XtUnmanageChildren(dirLabel, ndirLabel); for (i = 0; i < ndirLabel; i++) { XtFree(paths[i]); paths[i] = NULL; } i = 0; if (*c == '/') c++; /* Pointing at dir sep */ while(i < ndirLabel && *c != 0) { char buf[128]; int n; int rind; int span; /* Copy dir name */ for(n = 0; n < 128 && c[n] != '/' && c[n] != 0; n++) buf[n] = c[n]; buf[n] = 0; c = &c[n]; rind = ndirLabel - i - 1; if (rind < 0) break; /* Copy full path */ span = c - currentdir + 1; paths[i] = XtMalloc(span + 1); strncpy(paths[i], currentdir, span); paths[i][span] = 0; /* Null terminate */ stemp = XmStringCreateLocalized(buf); XtVaSetValues(dirLabel[rind], XmNlabelString, stemp, NULL, NULL); XmStringFree(stemp); XtManageChild(dirLabel[rind]); XtRemoveAllCallbacks(dirLabel[rind], XmNactivateCallback); XtAddCallback(dirLabel[rind], XmNactivateCallback, (XtCallbackProc) readdirCB, paths[i]); i++; while (*c == '/' && *c != 0) c++; /* Pointing at dir sep */ } if (ndirLabel - i >= 0 && i != 0) memWidget = dirLabel[ndirLabel - i]; else if (i == 0) memWidget = XtNameToWidget(mainW, "*lroot"); else memWidget = dirLabel[0]; XtVaSetValues(dirOM, XmNmenuHistory, memWidget, NULL, NULL); /* Reset label */ stemp = XmStringCreateLocalized(currentdir); XtVaSetValues(displayLabel, XmNlabelString, stemp, NULL, NULL); } void selectCB(Widget w, XtPointer ignore, XtPointer cb) { XmContainerSelectCallbackStruct *cbstruct = (XmContainerSelectCallbackStruct *) cb; char *temp; Boolean found = False; Widget target = cbstruct -> selected_items[0]; mode_t mode; FileInfoRec *f; if (cbstruct -> selected_item_count != 1) return; f = GetInfoFromWidget(target); if (! f) return; mode = f -> statbuf.st_mode; if (S_ISDIR(mode)) { /* For directories, navigate downward */ if (strcmp(f -> name, "..") == 0 || strcmp(f -> name, ".") == 0) temp = expandPath(f -> name); else temp = fullpath(f -> name); readdirCB(w, temp, NULL); XtFree(temp); } else { XrmDatabase db = XtScreenDatabase(XtScreen(toplevel)); XrmQuark classes[10]; XrmQuark path[10]; XrmRepresentation type; XrmValue value; char *str; /* First try the resource database, then use the fallbacks below */ classes[0] = app_class_quark; classes[1] = XrmStringToQuark("Types"); classes[2] = XrmStringToQuark("Any"); classes[3] = XrmStringToQuark("Action"); classes[4] = NULLQUARK; path[0] = app_quark; path[1] = XrmStringToQuark("types"); path[2] = XrmStringToQuark(find_suffix(f -> name)); path[3] = XrmStringToQuark("action"); path[4] = NULLQUARK; XrmQGetResource(db, path, classes, &type, &value); str = (char*) value.addr; if (str == NULL) { if ((mode & S_IXUSR) | (mode & S_IXGRP) | (mode & S_IXOTH)) { path[2] = XrmStringToQuark("default_exec"); } else { path[2] = XrmStringToQuark("default_file"); } XrmQGetResource(db, path, classes, &type, &value); str = (char*) value.addr; } if (str != NULL) { char *pathname = fullpath(f -> name); char buf[256]; sprintf(buf, str, pathname); strcat(buf, " &"); system(buf); XtFree(pathname); } } } char * getPathFromIcon(Widget w) { FileInfoRec *f = GetInfoFromWidget(w); if (f) return(fullpath(f -> name)); else return(NULL); } static FileInfoRec * GetInfoFromWidget(Widget w) { Boolean found = False; int ind; for(ind = 0; ind < validFI; ind++) { if (IconGadgets[ind] == w) { found = True; break; } } if (found) return(&FI[ind]); else return(NULL); } motif-2.3.8/demos/programs/filemanager/filemanager.h0000644000175000017500000000527412672140200017423 00000000000000/* $XConsortium: filemanager.h /main/5 1995/07/15 20:45:20 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifndef _filemanager_h #define _filemanager_h #include #include typedef struct _FileInfo { char *name; struct stat statbuf; Widget icon; Boolean dirRead; } FileInfoRec; extern Widget fileviewer, dirOM, toplevel, mainW, gotoDialog; extern char *currentdir; extern Widget *dirLabel, displayLabel; extern int ndirLabel; extern char *paths[]; extern FileInfoRec *FI; extern WidgetList IconGadgets; extern int validFI; extern Boolean showHidden; extern time_t ltm; extern char *deleteCommand; extern XrmQuark app_class_quark; extern XrmQuark app_quark; extern Widget CreateInterface(char*, Widget); extern char* fullpath(char*); extern void readdirCB(Widget, char*, XmAnyCallbackStruct *); extern void outlineCB(Widget, char*, XmContainerOutlineCallbackStruct *); extern void manageCB(Widget, Widget, XtPointer); extern void viewCB(Widget, char*, XtPointer); extern void gotoCB(Widget widget, XtPointer i1, XtPointer cb); extern void selectCB(Widget w, XtPointer ignore, XtPointer cb); extern void quitCB(Widget, char*, XmAnyCallbackStruct*); extern void newFolder(Widget widget, XtPointer ignore, XtPointer ignore2); extern void deleteItem(Widget widget, XtPointer ignore, XtPointer ignore2); extern void targetDestinationCallback(Widget, XtPointer, XmDestinationCallbackStruct*); extern void targetConvertCallback(Widget, XtPointer, XmConvertCallbackStruct*); extern char *getPathFromIcon(Widget); extern void fixViewerSize(Widget w, XtPointer i1, XtPointer i2); extern void showHiddenCB(Widget widget, XtPointer ignore, XmToggleButtonCallbackStruct *callback_data); extern void read_directory(Widget, char*); extern int process_single_entry(Widget, char*, int, struct dirent*); #endif /* _filemanager_h */ motif-2.3.8/demos/programs/filemanager/Makefile.in0000644000175000017500000005643613211512766017065 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = filemanager$(EXEEXT) subdir = demos/programs/filemanager ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_filemanager_OBJECTS = filemanager.$(OBJEXT) actions.$(OBJEXT) \ readdir.$(OBJEXT) convert.$(OBJEXT) interface.$(OBJEXT) filemanager_OBJECTS = $(am_filemanager_OBJECTS) filemanager_LDADD = $(LDADD) filemanager_DEPENDENCIES = ../../lib/Xmd/libXmd.a \ ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(filemanager_SOURCES) DIST_SOURCES = $(filemanager_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/filemanager build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/filemanager datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in filemanager_SOURCES = filemanager.c actions.c readdir.c convert.c \ interface.c filemanager.h EXTRA_DIST = filemanager.man filemanager.help XmdFilemanager.ad \ code.xpm dir.xpm exec.xpm file.xpm none.xpm \ obj.xpm pix.xpm s_dir.xpm s_exec.xpm s_file.xpm \ s_none.xpm s_pix.xpm data_DATA = $(EXTRA_DIST) $(filemanager_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/filemanager/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/filemanager/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list filemanager$(EXEEXT): $(filemanager_OBJECTS) $(filemanager_DEPENDENCIES) $(EXTRA_filemanager_DEPENDENCIES) @rm -f filemanager$(EXEEXT) $(AM_V_CCLD)$(LINK) $(filemanager_OBJECTS) $(filemanager_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/actions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemanager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/filemanager/XmdFilemanager.ad0000644000175000017500000000640712672140200020170 00000000000000! $XConsortium: XmdFilemanager.ad /main/4 1995/07/17 18:52:49 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! Sample application defaults file ! ! Optionally place this file in your system's app-defaults directory, ! often found in /usr/lib/X11/app-defaults ! ! How often should filemanager check for the current directory being ! updated *updateTime: 2000 ! The command run when you delete a file. %s is replaced with the ! full pathname *deleteCommand: rm %s ! A simple type database to define icons and actions ! the "type" is simply the suffix or the entire filename for files ! containing no dots ! ! You can define a largeIcon, a smallIcon and an action. The action has ! the %s replaced by the full pathname of the file *types.o.largeIcon: obj.xpm *types.c.largeIcon: code.xpm *types.h.largeIcon: code.xpm *types.xpm.largeIcon: pix.xpm *types.xpm.smallIcon: s_pix.xpm *types.xpm.action: vueicon -f %s *types.filemanager.action: %s *types.default_file.largeIcon: file.xpm *types.default_file.smallIcon: s_file.xpm *types.default_dir.largeIcon: dir.xpm *types.default_dir.smallIcon: s_dir.xpm *types.default_exec.largeIcon: exec.xpm *types.default_exec.smallIcon: s_exec.xpm *types.default_none.largeIcon: none.xpm *types.default_none.smallIcon: s_none.xpm *types.default_file.action: $EDITOR %s *types.default_exec.action: xterm -e %s ! More resources. These control the container ! ! Don't show any border on the outline expand/collapse button *XmContainer.OutlineButton.shadowThickness: 0 ! Nice defaults for the foreground, background and select colors *XmContainer*foreground: black *XmContainer*background: gray90 *XmContainer.selectColor: lightblue ! This is the amount by which subdirectories will be indented *XmContainer.outlineIndentation: 3fu ! This is the width of the first column in the detail view *XmContainer.outlineColumnWidth: 35fu ! ... and these are the widths of the subsequent columns *XmContainer.detailTabList: +9fu,+15fu,+10fu ! This defines the font to be used for the icons. Note that this ! definition for the renderTable can be much more complex *XmIconGadget.renderTable: *helvetica-bold-r-*-10-* ! Don't show shadows around the iconGadget *XmIconGadget.shadowThickness: 0 ! Control the show_hidden menu item *show_hidden.labelString: Show Hidden Files *show_hidden.indicatorOn: XmINDICATOR_CHECK *show_hidden.indicatorSize: 15 ! What is the helpfile name *help_manager.helpFile: filemanager motif-2.3.8/demos/programs/filemanager/code.xpm0000644000175000017500000000345212672140200016434 00000000000000/* XPM */ /* $XConsortium: code.xpm /main/4 1995/07/18 16:03:11 drk $ */ static char * code [] = { /* width height ncolors cpp [x_hot y_hot] */ "32 40 5 1 0 0", /* colors */ " s topShadowColor m white c #c8c8c8c8c8c8", ". s iconColor2 m white c white", "X s bottomShadowColor m black c #646464646464", "o s selectColor m white c #7d7d7d7d7d7d", "O s iconColor1 m black c black", /* pixels */ " ", " ..............................X", " ..............................X", " ...oo.........................X", " ..o...........................X", " ..o...........................X", " ..o........................o..X", " .o............................X", " ..o.....ooooooo.ooo..oo.o..o..X", " ..o.......................o...X", " ..o...........................X", " ...oo....................O....X", " ..............................X", " ........ooo..ooooooo.oo..O....X", " ........................O.....X", " ..............................X", " .........................O....X", " ..............................X", " ........OOOOOOOO.OO..O...O....X", " ........................O.....X", " ..............................X", " ...oo.........................X", " .....o........................X", " .....o........................X", " .....o........................X", " ......o.......................X", " .....o........................X", " .....o........................X", " .....o........................X", " ...oo.........................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}; motif-2.3.8/demos/programs/filemanager/filemanager.man0000644000175000017500000000542412672140200017744 00000000000000.\" $XConsortium: filemanager.man /main/4 1995/07/17 10:47:16 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY ...\" " .TH filemanager 1X MOTIF "Demonstration programs" .SH NAME \*Lfilemanager\*O\(emdisplay directories in a container. .SH SYNOPSIS .sS \*Lfilemanager\*O .sE .SH DESCRIPTION \*LFilemanager\*O provides a display of the contents of a directory as file and directory icons. You may run it anywhere and it allows customization of the icons and actions via the X resource mechanism. .SH X Defaults The class of this application is \fIXmDFilemanager\fR. The following are examples of the right resources to change. "suffix" can be any file suffix. Pixmaps are specified in XPM format (see XmGetPixmap in the Programmer's Reference for details on this subject). Actions are specified as control strings for sprintf, where the %s is substituted for by the pathname of the object. "default_file" is defined as the type for unspecified non-executable files and "default_exec" for unspecified executable files. .nf .ta .25i 4i XmDFilemanager.types.suffix.largeIcon: a large icon bitmap or pixmap XmDFilemanager.types.suffix.smallIcon: a small icon bitmap or pixmap XmDFilemanager.types.suffix.action: an action to take when activated XmDFilemanager.types.default_file.action: $EDITOR %s XmDFilemanager.types.default_exec.action: xterm -e %s XmDFilemanager*XmContainer.OutlineButton.shadowThickness: 0 XmDFilemanager*XmContainer*foreground: black XmDFilemanager*XmContainer*background: gray90 XmDFilemanager*XmContainer.selectColor: lightblue XmDFilemanager*XmContainer.outlineIndentation: 30 XmDFilemanager*XmContainer.expandedStatePixmap: exp.xpm XmDFilemanager*XmContainer.collapsedStatePixmap: col.xpm XmDFilemanager*XmContainer.outlineColumnWidth: 6cm XmDFilemanager*XmContainer.detailTabList: +3cm,+3cm,+3cm XmDFilemanager*XmIconGadget.renderTable: *helvetica-bold-r-*-10-* XmDFilemanager*XmIconGadget.shadowThickness: 0 .fi motif-2.3.8/demos/programs/filemanager/file.xpm0000644000175000017500000000340712672140200016441 00000000000000/* XPM */ /* $XConsortium: file.xpm /main/4 1995/07/18 16:03:32 drk $ */ static char * file [] = { /* width height ncolors cpp [x_hot y_hot] */ "32 40 4 1 0 0", /* colors */ " s topShadowColor m white c #c8c8c8c8c8c8", ". s iconColor2 m white c white", "X s bottomShadowColor m black c #646464646464", "o s background m black c #969696969696", /* pixels */ " ", " ..............................X", " .o.................o..........X", " .oooooooooooooo....oooo.......X", " ...........o..................X", " .o......o........o............X", " .oooo...ooo..oooooooooooo.....X", " ................o.............X", " .o...o...................o....X", " .ooooooooooooo...ooooo..oo....X", " ........o.....................X", " ..............................X", " ..............................X", " ..............................X", " .o...................o..ooo...X", " .ooooooooooo..oo..ooooooooo...X", " ......o.o.....................X", " ..............................X", " .o....o......o..oo............X", " .ooooooooooooo..oooooo..o.....X", " ..o...........................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " ..............................X", " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}; motif-2.3.8/demos/programs/filemanager/s_pix.xpm0000644000175000017500000000150612672140200016642 00000000000000/* XPM */ /* $XConsortium: s_pix.xpm /main/4 1995/07/18 16:04:29 drk $ */ static char * s_pix [] = { /* width height ncolors cpp [x_hot y_hot] */ "16 16 9 1 0 0", /* colors */ " s topShadowColor m white c #c8c8c8c8c8c8", ". s bottomShadowColor m black c #646464646464", "X s none m none c none", "o s foreground m white c white", "O s iconColor3 m black c red", "+ s iconColor7 m white c cyan", "@ s iconGray1 m white c #e1e1e1e1e1e1", "# s iconColor5 m black c blue", "$ s iconColor4 m white c green", /* pixels */ " .XXXX", " oooooooooo.XXXX", " oOOO+++@@o.XXXX", " oOOO+++@@o.XXXX", " oOOO+++@@o.XXXX", " o###OOO$$o.XXXX", " o###OOO$$o.XXXX", " o###OOO$$o.XXXX", " oOOO$$$++o.XXXX", " oOOO$$$++o.XXXX", " oOOO$$$++o.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", "............XXXX"}; motif-2.3.8/demos/programs/filemanager/s_exec.xpm0000644000175000017500000000114012672140200016760 00000000000000/* XPM */ /* $XConsortium: s_exec.xpm /main/4 1995/07/18 16:04:05 drk $ */ static char * s_exec [] = { /* width height ncolors cpp [x_hot y_hot] */ "16 16 3 1 -1 -1", /* colors */ " s none m none c none", ". s iconColor5 m black c blue", "X s iconColor6 m white c yellow", /* pixels */ " . ", " ....... ", " ........... ", " XX........... ", " XXX.......... ", " XXXXX..........", " XXXXXX.........", " XXXXXXX........", "XXXXXXXXX.......", " XXXXXXXXX......", " XXXXXXXXXX.....", " XXXXXXXXXXX....", " XXXXXXXXXXX.. ", " XXXXXXXXXXXX. ", " XXXXXXXXXXX ", " XXXXXXX "}; motif-2.3.8/demos/programs/filemanager/none.xpm0000644000175000017500000000345112672140200016460 00000000000000/* XPM */ /* $XConsortium: none.xpm /main/4 1995/07/18 16:03:39 drk $ */ static char * none [] = { /* width height ncolors cpp [x_hot y_hot] */ "32 40 5 1 0 0", /* colors */ " s iconColor1 m black c black", ". s topShadowColor m white c #c8c8c8c8c8c8", "X s iconColor2 m white c white", "o s background m black c #969696969696", "O s bottomShadowColor m black c #646464646464", /* pixels */ " ............................ ", " XXXXXXXXXXXXXXXXXXXXXXXXXX ", ". XXXXXXXXXXXXXXXXoXXXXXXX O", ".X ooooooooooooXXXXooooXXXX XO", ".X XXXXXXXoXXXXXXXXXXXXXX XO", ".Xo XXXoXXXXXXXXoXXXXXXX XXO", ".Xoo XXoooXXooooooooooo XXXO", ".XXXX XXXXXXXXXoXXXXXX XXXXO", ".XoXXX XXXXXXXXXXXXXXXX oXXXXO", ".Xoooo ooooooXXXooooo oXXXXO", ".XXXXXX XXXXXXXXXXXX XXXXXXO", ".XXXXXXX XXXXXXXXXX XXXXXXXO", ".XXXXXXXX XXXXXXXXXX XXXXXXXXO", ".XXXXXXXX XXXXXXXX XXXXXXXXO", ".XoXXXXXXX XXXXXX oXXoooXXXO", ".Xooooooooo XooX oooooooXXXO", ".XXXXXXoXoXX XX XXXXXXXXXXXO", ".XXXXXXXXXXXX XX XXXXXXXXXXXXO", ".XoXXXXoXXXXX XXXXXXXXXXXXO", ".Xoooooooooooo oooooXXoXXXXXO", ".XXoXXXXXXXXXX XXXXXXXXXXXXXO", ".XXXXXXXXXXXX XXXXXXXXXXXXO", ".XXXXXXXXXXXX XX XXXXXXXXXXXXO", ".XXXXXXXXXXX XX XXXXXXXXXXXO", ".XXXXXXXXXX XXXX XXXXXXXXXXO", ".XXXXXXXXX XXXXXX XXXXXXXXXO", ".XXXXXXXX XXXXXXXX XXXXXXXXO", ".XXXXXXXX XXXXXXXXXX XXXXXXXXO", ".XXXXXXX XXXXXXXXXX XXXXXXXO", ".XXXXXX XXXXXXXXXXXX XXXXXXO", ".XXXXX XXXXXXXXXXXXXX XXXXXO", ".XXXXX XXXXXXXXXXXXXXXX XXXXXO", ".XXXX XXXXXXXXXXXXXXXX XXXXO", ".XXX XXXXXXXXXXXXXXXXXX XXXO", ".XX XXXXXXXXXXXXXXXXXXXX XXO", ".X XXXXXXXXXXXXXXXXXXXXXX XO", ".X XXXXXXXXXXXXXXXXXXXXXXXX XO", ". XXXXXXXXXXXXXXXXXXXXXXXX O", " XXXXXXXXXXXXXXXXXXXXXXXXXX ", " OOOOOOOOOOOOOOOOOOOOOOOOOOOO "}; motif-2.3.8/demos/programs/filemanager/filemanager.c0000644000175000017500000001527612672140200017421 00000000000000/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #ifdef REV_INFO #ifndef lint static char rcsid[] = "$XConsortium: filemanager.c /main/6 1995/07/14 09:41:39 drk $" #endif #endif #include #include #include /* Motif Toolkit */ #include #include "filemanager.h" Display *display; XtAppContext app_context; Widget toplevel, mainW, dirOM, fileviewer; Widget gotoDialog, displayLabel; static int ErrorHandler(Display *display, XErrorEvent *event); static void UpdateDir(XtPointer, XtIntervalId*); #define APP_CLASS "XmdFilemanager" time_t ltm = 0; unsigned int updateTime; char *deleteCommand; XrmQuark app_class_quark; XrmQuark app_quark; char * fallback_resources[] = { "*updateTime: 2000", /* Check on directory every two seconds */ "*deleteCommand: rm %s", "*types.o.largeIcon: obj.xpm", "*types.c.largeIcon: code.xpm", "*types.h.largeIcon: code.xpm", "*types.xpm.largeIcon: pix.xpm", "*types.xpm.smallIcon: s_pix.xpm", "*types.xpm.action: vueicon -f %s", "*types.filemanager.action: %s", "*types.default_file.largeIcon: file.xpm", "*types.default_file.smallIcon: s_file.xpm", "*types.default_dir.largeIcon: dir.xpm", "*types.default_dir.smallIcon: s_dir.xpm", "*types.default_exec.largeIcon: exec.xpm", "*types.default_exec.smallIcon: s_exec.xpm", "*types.default_none.largeIcon: none.xpm", "*types.default_none.smallIcon: s_none.xpm", "*types.default_file.action: $EDITOR %s", "*types.default_exec.action: xterm -e %s", "*XmContainer.OutlineButton.shadowThickness: 0", /* "*XmContainer.OutlineButton*armPixmap: arm.xpm", */ "*XmContainer*foreground: black", "*XmContainer*background: gray90", "*XmContainer.selectColor: lightblue", "*XmContainer.outlineIndentation: 30", "*XmContainer.outlineColumnWidth: 6cm", "*XmContainer.detailTabList: +3cm,+3cm,+3cm", "*XmIconGadget.renderTable: *helvetica-bold-r-*-10-*", "*XmIconGadget.shadowThickness: 0", "*show_hidden.labelString: Show Hidden Files", "*show_hidden.indicatorOn: XmINDICATOR_CHECK", "*show_hidden.indicatorSize: 15", "*help_manager.helpFile: filemanager", NULL }; /* * Main program */ int main(int argc, char* argv[]) { Arg args[10]; int n = 0; Pixel fg, bg; Display *display; int time; char *str; int i; XtSetArg(args[n], XmNallowShellResize, True); n++; toplevel = XtVaAppInitialize(&app_context, APP_CLASS, NULL, 0, &argc, argv, fallback_resources, NULL); app_class_quark = XrmStringToQuark(APP_CLASS); app_quark = XrmStringToQuark(argv[0]); mainW = CreateInterface("main", toplevel); /* First try the resource database, then use the fallbacks below */ str = XGetDefault(XtDisplay(toplevel), APP_CLASS, "updateTime"); if (str == NULL) str = XGetDefault(XtDisplay(toplevel), argv[0], "updateTime"); if (str == NULL) updateTime = 2000; else updateTime = atoi(str); str = XGetDefault(XtDisplay(toplevel), APP_CLASS, "deleteCommand"); if (str == NULL) str = XGetDefault(XtDisplay(toplevel), argv[0], "deleteCommand"); if (str == NULL) deleteCommand = "rm %s"; else deleteCommand = str; /* Find the widgets in the hierarchy */ dirOM = XtNameToWidget(mainW, "*dirOM"); dirLabel = (Widget *) XtMalloc(sizeof(Widget) * ndirLabel); for (i = 0; i < ndirLabel; i++) { char buf[16]; sprintf(buf, "*l%d", i); dirLabel[i] = XtNameToWidget(mainW, buf); paths[i] = NULL; } fileviewer = XtNameToWidget(mainW, "*container"); gotoDialog = XtNameToWidget(mainW, "*gotoDialog"); displayLabel = XtNameToWidget(mainW, "*Where"); XtVaGetValues(fileviewer, XmNforeground, &bg, XmNbackground, &fg, NULL, NULL); XtManageChild(mainW); /* Install our special error handler */ XSetErrorHandler((XErrorHandler) ErrorHandler); /* Add the UTM callbacks on the container area */ XtAddCallback(fileviewer, XmNdestinationCallback, (XtCallbackProc) targetDestinationCallback, NULL); XtAddCallback(fileviewer, XmNconvertCallback, (XtCallbackProc) targetConvertCallback, NULL); XtAddCallback(XtParent(fileviewer), XmNresizeCallback, fixViewerSize, NULL); readdirCB(fileviewer, ".", NULL); XtRealizeWidget(toplevel); XmContainerRelayout(fileviewer); XtAppAddTimeOut(app_context, updateTime, UpdateDir, (XtPointer) 0); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } /* Adjust the size of the underlying container widget to be at least large enough to fit in the clipwindow */ void fixViewerSize(Widget w, XtPointer i1, XtPointer i2) { Dimension width, height, container_w, container_h; /* Get the correct dimensions of the clipwindow */ XtVaGetValues(w, XtNwidth, &width, XtNheight, &height, NULL, NULL); /* Get the correct dimensions of the container */ XtVaGetValues(fileviewer, XtNwidth, &container_w, XtNheight, &container_h, NULL, NULL); XtVaSetValues(fileviewer, XtNwidth, width, NULL, NULL); if (container_h < height) XtVaSetValues(fileviewer, XtNheight, height, NULL, NULL); } /* Error handler for X protocol errors. Continue after error */ static int ErrorHandler(Display *display, XErrorEvent *event) { char errortext[100]; XmString tmp; XGetErrorText(display, event -> error_code, errortext, 100); printf("X Protocol error: %s\n", errortext); printf("XID %ld serial %ld major %d minor %d\n", event -> resourceid, event -> serial, event -> request_code, event -> minor_code); return 0; } /* Check for modification of current directory. We don't handle updates in subdirectories (at least yet), but this *is* free software */ static void UpdateDir(XtPointer data, XtIntervalId *id) { struct stat buf; XtAppAddTimeOut(app_context, updateTime, (XtTimerCallbackProc) UpdateDir, 0); if (stat(currentdir, &buf) != 0) { printf("Can't stat directory: %s\n", currentdir); return; } if (ltm != buf.st_ctime) { read_directory((Widget) NULL, "."); } } motif-2.3.8/demos/programs/filemanager/exec.xpm0000644000175000017500000000377212672140200016453 00000000000000/* XPM */ /* $XConsortium: exec.xpm /main/4 1995/07/18 16:03:26 drk $ */ static char * exec [] = { /* width height ncolors cpp [x_hot y_hot] */ "40 40 3 1 0 0", /* colors */ " s none m none c none", ". s iconColor5 m black c blue", "X s iconColor6 m white c yellow", /* pixels */ " ........ ", " .............. ", " .................... ", " X..................... ", " XXX..................... ", " XXXXX....................... ", " XXXXXXX....................... ", " XXXXXXXX...................... ", " XXXXXXXXX....................... ", " XXXXXXXXXXX....................... ", " XXXXXXXXXXXX........................ ", " XXXXXXXXXXXXX....................... ", " XXXXXXXXXXXXXXX....................... ", " XXXXXXXXXXXXXXX....................... ", " XXXXXXXXXXXXXXXX...................... ", " XXXXXXXXXXXXXXXXX..................... ", "XXXXXXXXXXXXXXXXXX......................", "XXXXXXXXXXXXXXXXXXX.....................", "XXXXXXXXXXXXXXXXXXXX....................", "XXXXXXXXXXXXXXXXXXXX....................", "XXXXXXXXXXXXXXXXXXXXX...................", "XXXXXXXXXXXXXXXXXXXXX...................", "XXXXXXXXXXXXXXXXXXXXXX..................", "XXXXXXXXXXXXXXXXXXXXXXX.................", " XXXXXXXXXXXXXXXXXXXXXX................ ", " XXXXXXXXXXXXXXXXXXXXXXX............... ", " XXXXXXXXXXXXXXXXXXXXXXXX.............. ", " XXXXXXXXXXXXXXXXXXXXXXXX.............. ", " XXXXXXXXXXXXXXXXXXXXXXXX............ ", " XXXXXXXXXXXXXXXXXXXXXXXXX........... ", " XXXXXXXXXXXXXXXXXXXXXXXX.......... ", " XXXXXXXXXXXXXXXXXXXXXXXX........ ", " XXXXXXXXXXXXXXXXXXXXXXX....... ", " XXXXXXXXXXXXXXXXXXXXXXXX...... ", " XXXXXXXXXXXXXXXXXXXXXXXX.... ", " XXXXXXXXXXXXXXXXXXXXXX.. ", " XXXXXXXXXXXXXXXXXXXXXX ", " XXXXXXXXXXXXXXXXXXXX ", " XXXXXXXXXXXXXX ", " XXXXXXXX "}; motif-2.3.8/demos/programs/filemanager/s_file.xpm0000644000175000017500000000130512672140200016756 00000000000000/* XPM */ /* $XConsortium: s_file.xpm /main/4 1995/07/18 16:04:17 drk $ */ static char * s_file [] = { /* width height ncolors cpp [x_hot y_hot] */ "16 16 5 1 0 0", /* colors */ " s topShadowColor m white c #c8c8c8c8c8c8", ". s bottomShadowColor m black c #646464646464", "X s none m none c none", "o s iconColor2 m white c white", "O s background m black c #969696969696", /* pixels */ " .XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oOOOOOOOoo.XXXX", " oooooooooo.XXXX", " oOOOOOOOoo.XXXX", " oooooooooo.XXXX", " oOOOOOoooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", " oooooooooo.XXXX", "............XXXX"}; motif-2.3.8/demos/programs/filemanager/README0000644000175000017500000000214312672140200015650 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:03:54 drk $ */ Filemanager ----------- Filemanager is a demonstration of the XmContainer widget, the XmIconGadget, the Motif pixmap reader (which now can read XPM files) and also serves to show the usage of the X resource mechanism. It does allow for some configuration of actions and icons. To use the demo, simply run it from the directory of interest. Navigation is obtained by activating (double clicking) the folder icons (.., or a subdir), by selecting a parent directory from the option menu, or by using the "Open..." menu item to enter a pathname. Read the man page for details on setting resources to customize the application. The xpm files supplied can be installed in your normal bitmap/pixmap repository and note that you can customize this for Motif by using the XBMLANGPATH environment variable. The help file can be installed in a place where it will be found via XFILESEARCHPATH, where the type replacement (%T) will have the value of "help." For example, /usr/lib/X11/help/filemanager.help. Regards, Douglas Rand motif-2.3.8/demos/programs/filemanager/actions.c0000644000175000017500000000730213066310437016607 00000000000000/* $XConsortium: actions.c /main/5 1995/07/15 20:45:12 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA * */ /* * HISTORY */ #include #include #include #include #include /* Motif Toolkit */ #include /* Mrm */ #include #include #include #include "filemanager.h" void gotoCB(Widget widget, XtPointer i1, XtPointer cb) { Widget text; char *str; text = XtNameToWidget(widget, "*Text"); str = XmTextFieldGetString(text); readdirCB(widget, str, NULL); XtFree(str); } void manageCB(Widget widget, Widget w_to_manage, XtPointer callback_data) { if (w_to_manage != (Widget) NULL) XtManageChild(w_to_manage); } void viewCB(Widget widget, char *type, XtPointer callback_data) { XtEnum size=0, spatial=0; if (strcmp(type, "large") == 0) { size = XmLARGE_ICON; spatial = XmSPATIAL; } else if (strcmp(type, "small") == 0) { size = XmSMALL_ICON; spatial = XmSPATIAL; } else if (strcmp(type, "detail") == 0) { size = XmSMALL_ICON; spatial = XmDETAIL; } XtVaSetValues(fileviewer, XmNlayoutType, spatial, XmNentryViewType, size, 0, NULL); fixViewerSize(XtParent(fileviewer), NULL, NULL); XmContainerRelayout(fileviewer); } void quitCB(Widget widget, char *tag, XmAnyCallbackStruct *callback_data) { exit(0); } char* fullpath(char *filename) { char buf[1024]; char *rstr; /* This is for UNIX, write something else for a non-UNIX OS */ if (strcmp(currentdir, "/") == 0) sprintf(buf, "/%s", filename); else if (filename[0] == '/') sprintf(buf, "%s%s", currentdir, filename); else sprintf(buf, "%s/%s", currentdir, filename); rstr = XtNewString(buf); return(rstr); } void showHiddenCB(Widget widget, XtPointer ignore, XmToggleButtonCallbackStruct *callback_data) { showHidden = callback_data -> set; read_directory((Widget) NULL, "."); } void newFolder(Widget widget, XtPointer ignore, XtPointer ignore2) { char buf[256]; int i = 0; int status; Boolean done = False; struct stat statbuf; while(! done) { sprintf(buf, "%s/unnamed%d", currentdir, i); status = stat(buf, &statbuf); if (status != 0) { if (errno == ENOENT) done = True; else return; /* Bad error */ } if (i >= 100) return; i++; } mkdir(buf, 0755); } void deleteItem(Widget widget, XtPointer ignore, XtPointer ignore2) { WidgetList selected; Cardinal count; int i; /* First get list of selected items. */ XtVaGetValues(fileviewer, XmNselectedObjects, &selected, XmNselectedObjectCount, &count, NULL, NULL); if (count <= 0) return; for(i = 0; i < count; i++) { char buf[256]; sprintf(buf, deleteCommand, getPathFromIcon(selected[i])); system(buf); } XtVaSetValues(fileviewer, XmNselectedObjectCount, 0, NULL, NULL); } motif-2.3.8/demos/programs/filemanager/Makefile.am0000644000175000017500000000124513145162623017037 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/filemanager datadir = ${prefix}/share/Xm/filemanager bin_PROGRAMS = filemanager filemanager_SOURCES = filemanager.c actions.c readdir.c convert.c \ interface.c filemanager.h EXTRA_DIST = filemanager.man filemanager.help XmdFilemanager.ad \ code.xpm dir.xpm exec.xpm file.xpm none.xpm \ obj.xpm pix.xpm s_dir.xpm s_exec.xpm s_file.xpm \ s_none.xpm s_pix.xpm data_DATA = $(EXTRA_DIST) $(filemanager_SOURCES) LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/filemanager/s_none.xpm0000644000175000017500000000134712672140200017004 00000000000000/* XPM */ /* $XConsortium: s_none.xpm /main/4 1995/07/18 16:04:22 drk $ */ static char * s_none [] = { /* width height ncolors cpp [x_hot y_hot] */ "16 16 6 1 0 0", /* colors */ " s iconColor1 m black c black", ". s topShadowColor m white c #c8c8c8c8c8c8", "X s none m none c none", "o s iconColor2 m white c white", "O s bottomShadowColor m black c #646464646464", "+ s background m black c #969696969696", /* pixels */ " ........ XXXX", " oooooo OXXXX", ". oooooo OXXXX", ".o ++++ oOXXXX", ".oo oo ooOXXXX", ".o++ +ooOXXXX", ".ooo oooOXXXX", ".o+++ ooooOXXXX", ".ooo oooOXXXX", ".ooo oo oooOXXXX", ".oo oo ooOXXXX", ".o oooo oOXXXX", ". oooooo OXXXX", " ooooooo OXXXX", " oooooooo XXXX", " OOOOOOOOOO XXXX"}; motif-2.3.8/demos/programs/TabStack/0000755000175000017500000000000013211513007014271 500000000000000motif-2.3.8/demos/programs/TabStack/Makefile.in0000644000175000017500000005551513211512766016304 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = tabstack$(EXEEXT) subdir = demos/programs/TabStack ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_tabstack_OBJECTS = bxutils.$(OBJEXT) callbacks.$(OBJEXT) \ creation.$(OBJEXT) main.$(OBJEXT) tabstack_OBJECTS = $(am_tabstack_OBJECTS) tabstack_LDADD = $(LDADD) tabstack_DEPENDENCIES = $(TOPDIR)/lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(tabstack_SOURCES) DIST_SOURCES = $(tabstack_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Tabstack build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Tabstack datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in tabstack_SOURCES = bxutils.c callbacks.c creation.c main.c creation.h EXTRA_DIST = data_DATA = $(tabstack_SOURCES) $(EXTRA_DIST) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/TabStack/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/TabStack/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list tabstack$(EXEEXT): $(tabstack_OBJECTS) $(tabstack_DEPENDENCIES) $(EXTRA_tabstack_DEPENDENCIES) @rm -f tabstack$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tabstack_OBJECTS) $(tabstack_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bxutils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/TabStack/callbacks.c0000644000175000017500000001406213066310437016311 00000000000000/* * README: This file is appended to at file generation time. * Edits can be made throughout the file */ /* * Generated by the ICS Builder Xcessory (BX). * * * Builder Xcessory 3.5.1. * */ #include /* * Standard includes for builtins. */ #include #include #include #include /* * Macros to make code look nicer between ANSI and K&R. */ #ifndef ARGLIST #if (NeedFunctionPrototypes == 0) #define PROTOTYPE(p) () #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #define UARG(a, b) a b; #define GRAU(a, b) a b; #else #define PROTOTYPE(p) p #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #ifdef __cplusplus #define UARG(a, b) a, #define GRAU(a, b) a) #else #define UARG(a, b) a b, #define GRAU(a, b) a b) #endif #endif #endif Widget BxFindTopShell PROTOTYPE((Widget)); WidgetList BxWidgetIdsFromNames PROTOTYPE((Widget, char*, char*)); /* Function Name: BxExitCB * * Description: This functions expects an integer to be passed in * client data. It calls the exit() system call with * the integer value as the argument to the function. * * Arguments: Widget w: the activating widget. * XtPointer client: the integer exit value. * XtPointer call: the call data (unused). */ /* ARGSUSED */ void BxExitCB ARGLIST((w, client, call)) UARG( Widget, w) ARG( XtPointer, client) GRAU( XtPointer, call) { int exitValue = (int)client; exit(exitValue); } /* Function Name: BxSetValuesCB * * Description: This function accepts a string of the form: * "widgetName.resourceName = value\n..." * It then attempts to convert the widget name to a widget * ID and the value to a valid resource value. It then * sets the value on the given widget. * * Arguments: Widget w: the activating widget. * XtPointer client: the set values string. * XtPointer call: the call data (unused). * * Notes: * This function expects that there is an application * shell from which all other widgets are descended. */ #include /* ARGSUSED */ void BxSetValuesCB ARGLIST((w, client, call)) ARG( Widget, w) ARG( XtPointer, client) GRAU( XtPointer, call) { #define CHUNK 512 Boolean first = True; String rscs = XtNewString((String)client); String *valueList = (String *)XtCalloc(CHUNK, sizeof(String)); char *start; char *ptr, *cptr; String name; String rsc; int i, count = 0; Widget *current; for ( start = rscs; rscs && *rscs; rscs = strtok(NULL, "\n")) { if ( first ) { rscs = strtok(rscs, "\n"); first = False; } valueList[count] = XtNewString(rscs); count++; if ( count == CHUNK ) { valueList = (String *)XtRealloc((char *)valueList, (count + CHUNK) * sizeof(String)); } } XtFree((char *)start); for ( i = 0; i < count; i++ ) { /* * First, extract the widget name and generate a string to * pass to BxWidgetIdsFromNames(). */ cptr = strrchr(valueList[i], '.'); if ( cptr != NULL ) { *cptr = '\000'; } else { printf("Callback Error (BxSetValuesCB):\n\t\ Syntax Error - specify BxSetValuesCB data as\n\t\ . = \n"); XtFree((char *)(valueList[i])); continue; } name = valueList[i]; while( (name && *name) && isspace(*name) ) { name++; } ptr = name + strlen(name) - 1; while( ptr && *ptr ) { if ( isspace(*ptr) ) { ptr--; } else { ptr++; break; } } if ( ptr && *ptr ) { *ptr = '\0'; } if ( ptr == NULL ) { printf("Callback Error (BxSetValuesCB):\n\t\ Syntax Error - specify BxSetValuesCB data as\n\t\ . = \n"); XtFree((char *)(valueList[i])); return; } /* * Next, get the resource name to set. */ rsc = ++cptr; cptr = strchr(rsc, '='); if ( cptr != NULL ) { *cptr = '\000'; } else { printf("Callback Error (BxSetValuesCB):\n\t\ Syntax Error - specify BxSetValuesCB data as\n\t\ . = \n"); XtFree((char *)(valueList[i])); continue; } while( (rsc && *rsc) && isspace(*rsc) ) { rsc++; } ptr = rsc + strlen(rsc) - 1; while( ptr && *ptr ) { if ( isspace(*ptr) ) { ptr--; } else { ptr++; break; } } if ( ptr && *ptr ) { *ptr = '\0'; } /* * Lastly, get the string value to which to set the resource. */ start = ++cptr; while( (start && *start) && isspace(*start) ) { start++; } if ( start == NULL ) { printf("Callback Error (BxSetValuesCB):\n\t\ Syntax Error - specify BxSetValuesCB data as\n\t\ . = \n"); XtFree((char *)(valueList[i])); return; } ptr = start + strlen(start) - 1; while( ptr && *ptr ) { if ( isspace(*ptr) ) { ptr--; } else { ptr++; break; } } if ( ptr && *ptr ) { *ptr = '\0'; } /* * Now convert the widget name to a Widget ID */ current = BxWidgetIdsFromNames(w, "BxSetValuesCB", name); if ( current[0] == NULL ) { XtFree((char *)(valueList[i])); continue; } /* * If the widget name conversion succeeded, we now need to get the * resource list for the widget so that we can do a resource conversion * of the value. */ XtVaSetValues(*current, XtVaTypedArg, rsc, XtRString, start, strlen(start)+1, NULL); XtFree((char *)(valueList[i])); } XtFree((char *)valueList); #undef CHUNK } motif-2.3.8/demos/programs/TabStack/main.c0000644000175000017500000000656513066310437015327 00000000000000/* * README: Portions of this file are merged at file generation * time. Edits can be made *only* in between specified code blocks, look * for keywords and . */ /* * Generated by the ICS Builder Xcessory (BX). * * * Builder Xcessory 3.5.1. * */ /* * Motif required Headers */ #include #include #include #include #if (XmVersion >= 1002) #include #endif #include /* * Globally included information. */ /* * Headers for classes used in this program */ /* * Common constant and pixmap declarations. */ #include "creation.h" /* * Convenience functions from utilities file. */ extern void RegisterBxConverters(XtAppContext); extern XtPointer CONVERT(Widget, char *, char *, int, Boolean *); extern XtPointer DOUBLE(double); extern XtPointer SINGLE(float); extern void MENU_POST(Widget, XtPointer, XEvent *, Boolean *); extern Pixmap XPM_PIXMAP(Widget, char**); extern void SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal*, Pixel); /* Begin user code block */ /* End user code block */ /* * Change this line via the Output Application Names Dialog. */ #define BX_APP_CLASS "BuilderProduct" int main( int argc, char **argv) { Widget parent; XtAppContext app; Arg args[256]; Cardinal ac; Boolean argok=False; Widget topLevelShell; Widget form; /* Begin user code block */ /* End user code block */ /* * The applicationShell is created as an unrealized * parent for multiple topLevelShells. The topLevelShells * are created as popup children of the applicationShell. * This is a recommendation of Paul Asente & Ralph Swick in * _X_Window_System_Toolkit_ p. 677. */ parent = XtVaOpenApplication ( &app, BX_APP_CLASS, NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, NULL ); RegisterBxConverters(app); #if (XmVersion >= 1002) XmRepTypeInstallTearOffModelConverter(); #endif /* Begin user code block */ /* End user code block */ /* * Create classes and widgets used in this program. */ ac = 0; XtSetArg(args[ac], XmNx, 333); ac++; XtSetArg(args[ac], XmNy, 277); ac++; XtSetArg(args[ac], XmNwidth, 839); ac++; XtSetArg(args[ac], XmNheight, 508); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; topLevelShell = XtCreatePopupShell("topLevelShell", topLevelShellWidgetClass, parent, args, ac); form = (Widget)Createform(topLevelShell); XtManageChild(form); XtPopup(XtParent(form), XtGrabNone); /* Begin user code block */ /* End user code block */ /* Begin user code block */ /* End user code block */ XtAppMainLoop(app); /* * A return value even though XtAppMainLoop never ends. */ return(0); } motif-2.3.8/demos/programs/TabStack/bxutils.c0000644000175000017500000027673413066310437016104 00000000000000/* * WARNING: This file is overwritten at code generation time. * Any changes to this file will be lost. */ /* * MODULE: BxConvert.c * AUTHOR: Automatically generated by Builder Xcessory * * Description: This module contains various utilities, converters * for XmStrings (to work properly with app-defaults), and if needed * the XPM pixmap utilities. * * Edit the file ${BX}/gen/bxutils.c (BX$SYSTEM:[gen]bxutils.c on VMS) to * make system wide changes to this file which will be visible next time * this file is generated. * ${BX} is the directory where Builder Xcessory is installed. */ /* * BX supplies a string format for compound strings: * * ::[#tag][:t][:r]["str"] * * where: * :: = indicates compound string. * tag = the font tag * :t = separator (if not seen no separator added to segment) * :r = right to left (if not seen left to right assumed) * "str" = the text of the string. * * The components for the compound string can be repeated any number of * times. */ /***************************************************************************** * INCLUDE FILES *****************************************************************************/ #include #include #include #include /* * Include stdlib.h and malloc.h if code is C++, ANSI, or Extended ANSI. */ #if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__) # include # if defined(HAVE_MALLOC_H) # include # elif defined(HAVE_SYS_MALLOC_H) # include # endif #endif /***************************************************************************** * TYPDEFS AND DEFINES *****************************************************************************/ /* * Undefine this if you want to use native strcasecmp. */ #define LOCAL_STRCASECMP #ifdef _NO_PROTO #ifdef NeedFunctionPrototypes #undef NeedFunctionPrototypes #endif #endif /* * Define SUPPORTS_WCHARS if the system supports wide character sets */ #if !defined(VAX) && !defined(__CENTERLINE__) #define SUPPORTS_WCHARS #endif /* * Handy definition used in SET_BACKGROUND_COLOR */ #define UNSET (-1) /* * Set state of inclusion of prototypes properly */ #ifdef NeedFunctionPrototypes #define ARGLIST(p) ( #define ARG(a, b) a b, #define GRA(a, b) a b) #else #define ARGLIST(p) p #define ARG(a, b) a b; #define GRA(a, b) a b; #endif #ifdef NeedFunctionPrototypes #ifdef __cplusplus #define UARG(a, b) a, #define GRAU(a, b) a) #else #define UARG(a, b) a b, #define GRAU(a, b) a b) #endif #else #define UARG(a, b) a b; #define GRAU(a, b) a b; #endif /* * Set up strcasecmp function */ #if defined(LOCAL_STRCASECMP) #define STRCASECMP StrCasecmp #ifndef NeedFunctionPrototypes static int StrCasecmp(); #else static int StrCasecmp(char*, char*); #endif #else #define STRCASECMP strcasecmp #endif /* * Define XTPOINTER so it works with all releases of * Xt and c++. */ #ifdef __cplusplus #if XtSpecificationRelease < 5 #define XTPOINTER char * #else #define XTPOINTER XPointer #endif #else #define XTPOINTER XtPointer #endif /* * The following enum is used to support wide character sets. * Use this enum for references into the Common Wide Characters array. * If you add to the array, ALWAYS keep NUM_COMMON_WCHARS as the last * entry in the enum. This will maintain correct memory usage, etc. */ enum { WNull, WTab, WNewLine, WCarriageReturn, WFormFeed, WVerticalTab, WBackSlash, WQuote, WHash, WColon, WideF, WideL, WideN, WideR, WideT, WideV, WideUF, WideUL, WideUR, WideUT, WideZero, WideOne, NUM_COMMON_WCHARS }; /***************************************************************************** * GLOBAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * EXTERNAL DECLARATIONS *****************************************************************************/ /***************************************************************************** * STATIC DECLARATION *****************************************************************************/ #ifndef NeedFunctionPrototypes #ifndef SUPPORTS_WCHARS static int mblen (); #endif static int strlenWc (); static size_t doMbstowcs (); static size_t doWcstombs (); static void copyWcsToMbs (); static int dombtowc (); static Boolean extractSegment (); static XmString StringToXmString (); static char* getNextCStrDelim (); static int getCStrCount (); static wchar_t *CStrCommonWideCharsGet (); #else #ifndef SUPPORTS_WCHARS static int mblen (char*, size_t); #endif static int strlenWc (wchar_t*); static size_t doMbstowcs (wchar_t*, char*, size_t); static size_t doWcstombs (char*, wchar_t*, size_t); static void copyWcsToMbs (char*, wchar_t*, int, Boolean); static int dombtowc (wchar_t*, char*, size_t); static Boolean extractSegment (wchar_t**, wchar_t**, int *, wchar_t**, int*, int*, Boolean*); static XmString StringToXmString (char*); static char* getNextCStrDelim (char*); static int getCStrCount (char*); static wchar_t *CStrCommonWideCharsGet (); #endif /***************************************************************************** * STATIC CODE *****************************************************************************/ #if defined(LOCAL_STRCASECMP) /* * Function: * cmp = StrCasecmp(s1, s2); * Description: * Compare two strings ignoring case * Input: * s1 - char * : string 1 to compare * s2 - char * : string 2 to compare * Output: * int : 0; s1 == s2 * 1; s1 != s2 */ static int StrCasecmp ARGLIST((s1, s2)) ARG(register char *, s1) GRA(register char *, s2) { register int c1, c2; while (*s1 && *s2) { c1 = isupper(*s1) ? tolower(*s1) : *s1; c2 = isupper(*s2) ? tolower(*s2) : *s2; if (c1 != c2) { return(1); } s1++; s2++; } if (*s1 || *s2) { return(1); } return(0); } #endif #ifndef SUPPORTS_WCHARS /* * Function: * len = mblen(s, n); * Description: * The mblen function for platforms that don't have one. This * function simply returns a length of 1 since no wide character * support exists for this platform. * Input: * s - char * : the character string to get the length from * n - size_t : the size of the string * Output: * int : always 1 */ static int mblen ARGLIST((s, n)) ARG(char *, s) GRA(size_t, n) { return(1); } #endif /* * Function: * len = strlenWc(ptr); * Description: * Return the number of characters in a wide character string (not * the characters in the resultant mbs). * Input: * ptr - wchar_t* : pointer to the wcs to count * Output: * int : the number of characters found */ static int strlenWc ARGLIST((ptr)) GRA(wchar_t *,ptr) { register wchar_t *p = ptr; register int x = 0; if (!ptr) return(0); while (*p++) x++; return (x); } /* * Function: * bytesConv = doMbstowcs(wcs, mbs, n); * Description: * Create a wcs string from an input mbs. * Input: * wcs - wchar_t* : pointer to result buffer of wcs * mbs - char* : pointer to the source mbs * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doMbstowcs ARGLIST((wcs, mbs, n)) ARG(wchar_t *,wcs) ARG(char *, mbs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && mbs[i] != 0; ++i) { wcs[i] = mbs[i]; } wcs[i++] = 0; return(i); #else return(mbstowcs(wcs, mbs, n)); #endif } /* * Function: * bytesConv = doWcstombs(wcs, mbs, n); * Description: * Create a mbs string from an input wcs. * Input: * wcs - wchar_t* : pointer to the source wcs * mbs - char* : pointer to result mbs buffer * n - size_t : the number of characters to convert * Output: * bytesConv - size_t : number of bytes converted */ static size_t doWcstombs ARGLIST((mbs, wcs, n)) ARG(char *, mbs) ARG(wchar_t *, wcs) GRA(size_t, n) { #ifndef SUPPORTS_WCHARS int i; for (i = 0; i < n && wcs[i] != 0; ++i) { mbs[i] = wcs[i]; } mbs[i] = 0; return(i); #else size_t retval; retval = wcstombs(mbs, wcs, (n * sizeof(wchar_t))); if ( retval == (size_t)-1 ) return(0); else return(retval); #endif } /* * Function: * copyWcsToMbs(mbs, wcs, len); * Description: * Create a mbs string from an input wcs. This function allocates * a buffer if necessary. * Input: * mbs - char* : destination for the converted/copied output * wcs - wchar_t* : pointer to wcs to copy/convert * len - int : the number of wchar_t' to convert * process_it - Boolean : True if processing of quoted charcters, * False if blind. * Output: * None */ static void copyWcsToMbs ARGLIST((mbs, wcs, len, process_it)) ARG(char *, mbs) ARG(wchar_t *, wcs) ARG(int, len) GRA(Boolean, process_it) { static wchar_t *tbuf = NULL; static int tbufSize = 0; int numCvt; int lenToConvert; wchar_t *fromP = wcs; wchar_t *x = &fromP[len]; wchar_t *toP; wchar_t *commonWChars = CStrCommonWideCharsGet(); wchar_t tmp; /* * Make sure there's room in the buffer */ if (tbufSize < len) { tbuf = (wchar_t*)XtRealloc((char*)tbuf, (len + 1) * sizeof(wchar_t)); tbufSize = len; } /* * Now copy and process */ toP = tbuf; lenToConvert = 0; while (fromP < x) { /* * Check for quoted characters */ if ((*fromP == commonWChars[WBackSlash]) && process_it) { fromP++; /* Skip quote */ if (fromP == x) /* Hanging quote? */ { *toP++ = commonWChars[WBackSlash]; lenToConvert++; break; } tmp = *fromP++; if (tmp == commonWChars[WideN]) { *toP++ = commonWChars[WNewLine]; } else if (tmp == commonWChars[WideT]) { *toP++ = commonWChars[WTab]; } else if (tmp == commonWChars[WideR]) { *toP++ = commonWChars[WCarriageReturn]; } else if (tmp == commonWChars[WideF]) { *toP++ = commonWChars[WFormFeed]; } else if (tmp == commonWChars[WideV]) { *toP++ = commonWChars[WVerticalTab]; } else if (tmp == commonWChars[WBackSlash]) { *toP++ = commonWChars[WBackSlash]; } else { /* * No special translation needed */ *toP++ = tmp; } } else { *toP++ = *fromP++; } lenToConvert++; } tmp = tbuf[lenToConvert]; tbuf[lenToConvert] = (unsigned)NULL; numCvt = doWcstombs(mbs, tbuf, lenToConvert); tbuf[lenToConvert] = tmp; mbs[numCvt] = '\0'; } /* * Function: * status = dombtowc(wide, multi, size); * Description: * Convert a multibyte character to a wide character. * Input: * wide - wchar_t * : where to put the wide character * multi - char * : the multibyte character to convert * size - size_t : the number of characters to convert * Output: * 0 - if multi is a NULL pointer or points to a NULL character * #bytes - number of bytes in the multibyte character * -1 - multi is an invalid multibyte character. * * NOTE: if wide is NULL, then this returns the number of bytes in * the multibyte character. */ static int dombtowc ARGLIST((wide, multi, size)) ARG(wchar_t *, wide) ARG(char *, multi) GRA(size_t, size) { int retVal = 0; #ifndef SUPPORTS_WCHARS if ((multi == NULL) || (*multi == '\000')) { if (wide) wide[0] = '\0'; return (0); } for (retVal = 0; retVal < size && multi[retVal] != '\000'; retVal++) { if (wide != NULL) { wide[retVal] = multi[retVal]; } } #else retVal = mbtowc(wide, multi, size); #endif return(retVal); } /* * Function: * ptr = getNextSepartor(str); * Description: * Parse through a string looking for the next compound string * field separator * Inputs: * str - wchar_t* : the address of address of the string to parse * Outputs: * ptr - wchar_t* : pointer to character, if found, points to end * of string otherwise ('\0'). */ static wchar_t* getNextSeparator ARGLIST((str)) GRA(wchar_t *, str) { wchar_t *ptr = str; wchar_t *commonWChars = CStrCommonWideCharsGet(); while (*ptr) { /* * Check for separator */ if ((*ptr == commonWChars[WHash]) || (*ptr == commonWChars[WQuote]) || (*ptr == commonWChars[WColon])) { return(ptr); } else if (*ptr == commonWChars[WBackSlash]) { ptr++; if (*ptr) ptr++; /* Skip quoted character */ } else { ptr++; } } return(ptr); } /* * Function: * more = * extractSegment(str, tagStart, tagLen, txtStart, txtLen, * pDir, pSep); * Description: * Parse through a string version of a compound string and extract * the first compound string segment from the string. * Inputs: * str - char** : the address of address of the string to parse * tagStart - char** : address to return pointer to tag start into * tagLen - int* : address where to return the tag length into * txtStart - char** : address to return the text start into * txtLen - int* : address where to return the text length * pDir - int* : address to return the string direction into * pSep - Boolean * : address to return the separtor into * Outputs: * more - Boolean : True if more of the string to parse. * False means done. */ static Boolean extractSegment ARGLIST((str, tagStart, tagLen, txtStart, txtLen, pDir, pSep)) ARG(wchar_t **, str) ARG(wchar_t **, tagStart) ARG(int *, tagLen) ARG(wchar_t **, txtStart) ARG(int *, txtLen) ARG(int *, pDir) GRA(Boolean *, pSep) { wchar_t *start; wchar_t *text; int textL; Boolean tagSeen; wchar_t *tag; int tagL; Boolean modsSeen; Boolean sep; int dir; Boolean done; int *lenUp; Boolean checkDir; wchar_t *commonWChars; wchar_t emptyStrWcs[1]; /* * Initialize variables */ text = NULL; textL = 0; tagSeen = False; tag = NULL; tagL = 0; modsSeen = False; dir = XmSTRING_DIRECTION_L_TO_R; sep = False; done = False; lenUp = NULL; commonWChars = CStrCommonWideCharsGet(); /* * Guard against nulls */ if (!(start = *str)) { start = emptyStrWcs; emptyStrWcs[0] = commonWChars[WNull]; } /* * If the first character of the string isn't a # or a ", then we * just have a regular old simple string. Do the same the thing for * the empty string. */ if ((*start == '\0') || (start != getNextSeparator(start))) { text = start; if (!(textL = strlenWc(start))) { text = NULL; } start += textL; } else { done = False; while (!done) { if (*start == commonWChars[WHash]) { if (tagSeen) { done = True; break; } else { tagSeen = True; tag = ++start; start = getNextSeparator(tag); if ((tagL = start - tag) == 0) { tag = NULL; /* Null tag specified */ } } } else if (*start == commonWChars[WQuote]) { text = ++start; start = getNextSeparator(start); while (!((*start == commonWChars[WQuote]) || (*start == commonWChars[WNull]))) { start = getNextSeparator(++start); } if ((textL = start - text) == 0) { text = NULL; /* Null text specified */ } /* * if a quote, skip over it */ if (*start == commonWChars[WQuote]) { start++; } done = True; } else if (*start == commonWChars[WColon]) { if (modsSeen) { done = True; break; } /* * If the next character is a t or f, the we've got * a separator. */ modsSeen = True; checkDir = False; start++; if ((*start == commonWChars[WideT]) || (*start == commonWChars[WideUT]) || (*start == commonWChars[WideOne])) { sep = True; start++; checkDir = True; } else if ((*start == commonWChars[WideF]) || (*start == commonWChars[WideUF]) || (*start == commonWChars[WideZero])) { sep = False; start++; checkDir = True; } else if ((*start == commonWChars[WideR]) || (*start == commonWChars[WideUR])) { start++; dir = XmSTRING_DIRECTION_R_TO_L; } else if ((*start == commonWChars[WideL]) || (*start == commonWChars[WideUL])) { start++; dir = XmSTRING_DIRECTION_L_TO_R; } /* * Look for direction if necessary. This requires a bit of * look ahead. */ if (checkDir && (*start == commonWChars[WColon])) { if ((*(start + 1) == commonWChars[WideL]) || (*(start + 1) == commonWChars[WideUL])) { dir = XmSTRING_DIRECTION_L_TO_R; start += 2; } else if ((*(start + 1) == commonWChars[WideR]) || (*(start + 1) == commonWChars[WideUR])) { dir = XmSTRING_DIRECTION_R_TO_L; start+=2; } } } else { /* * A bad string format! We'll just skip the character. */ start++; } } } /* * Now fill in return values */ if (*str) *str = start; if (tagStart) *tagStart = tag; if (tagLen) *tagLen = tagL; if (txtStart) *txtStart = text; if (txtLen) *txtLen = textL; if (pDir) *pDir = dir; if (pSep) *pSep = sep; return ((*start == commonWChars[WNull]) ? False : True); } /* * Function: * xstr = StringToXmString(str); * Description: * Parse a string into an XmString. * Inputs: * str - char * : the string to parse * Outputs: * xstr - XmString : the allocated return structure */ static XmString StringToXmString ARGLIST((str)) GRA(char *,str) { static char* tagBuf = NULL; static int tagBufLen = 0; static char* textBuf = NULL; static int textBufLen = 0; wchar_t *ctx; wchar_t *tag; int tagLen; wchar_t *text; int textLen; Boolean sep; int dir; Boolean more; wchar_t *wcStr; int curDir; XmString xmStr; XmString s1; XmString s2; if (!str) return(NULL); /* * For expediencies sake, we'll overallocate this buffer so that * the wcs is guaranteed to fit (1 wc per byte in original string). */ wcStr = (wchar_t*)XtMalloc((strlen(str) + 1) * sizeof(wchar_t)); doMbstowcs(wcStr, str, strlen(str) + 1); /* * Create the beginning segment */ curDir = XmSTRING_DIRECTION_L_TO_R; xmStr = XmStringDirectionCreate(curDir); /* * Convert the string. */ more = True; ctx = wcStr; while (more) { more = extractSegment(&ctx, &tag, &tagLen, &text, &textLen, &dir, &sep); /* * Pick up a direction change */ if (dir != curDir) { #if defined(VMS) || (defined(__osf__) && defined(__alpha)) #if XmVERSION > 1 || (XmVERSION == 1 && XmREVISION >= 2) /* * This is required on DEC Windows systems because they've * added the REVERT direction. */ s1 = XmStringDirectionCreate(XmSTRING_DIRECTION_REVERT); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); #endif #endif curDir = dir; s1 = XmStringDirectionCreate(curDir); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Create the segment. Text and tag first. */ if (textLen) { if (textBufLen <= (textLen * sizeof(wchar_t))) { textBufLen = (textLen + 1) * sizeof(wchar_t); textBuf = (char*)XtRealloc(textBuf, textBufLen); } copyWcsToMbs(textBuf, text, textLen, True); if (tagLen) { if (tagBufLen <= (tagLen * sizeof(wchar_t))) { tagBufLen = (tagLen + 1) * sizeof(wchar_t); tagBuf = (char*)XtRealloc(tagBuf, tagBufLen); } copyWcsToMbs(tagBuf, tag, tagLen, False); } else { if (!tagBuf) { tagBufLen = strlen(XmSTRING_DEFAULT_CHARSET) + 1; tagBuf = (char*)XtMalloc(tagBufLen); } strcpy(tagBuf, XmSTRING_DEFAULT_CHARSET); } s1 = XmStringCreate(textBuf, tagBuf); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } /* * Add in the separators. */ if (sep) { s1 = XmStringSeparatorCreate(); s2 = xmStr; xmStr = XmStringConcat(s2, s1); XmStringFree(s1); XmStringFree(s2); } } /* * Free up memory and return */ XtFree((char*)wcStr); return(xmStr); } /* * Function: * nextCStr = getNextCStrDelim(str); * Description: * Find the next unquoted , or \n in the string * Input: * str - char * : the input string * Output: * nextCStr - char* : pointer to the next delimiter. Returns NULL if no * delimiter found. */ static char* getNextCStrDelim ARGLIST((str)) GRA(char *,str) { char *comma = str; Boolean inQuotes = False; int len; if (!str) return(NULL); if (!*str) return(NULL); /* At end */ #ifdef __CENTERLINE__ mblen((char *)NULL, sizeof(wchar_t)); #else mblen(NULL, sizeof(wchar_t)); #endif while (*comma) { if ((len = mblen(comma, sizeof(wchar_t))) > 1) { comma += len; continue; } if (*comma == '\\') { comma++; /* Over quote */ comma += mblen(comma, sizeof(wchar_t)); continue; } /* * See if we have a delimiter */ if (!inQuotes) { if ((*comma == ',') || (*comma == '\012')) { return(comma); } } /* * Deal with quotes */ if (*comma == '\"') { inQuotes = ~inQuotes; } comma++; } return(NULL); /* None found */ } /* * Function: * cnt = getCStrCount(str); * Description: * Get the count of cstrings in a compound string table ascii * format. * Input: * str - char * : string to parse * Output: * cnt - int : the number of XmStrings found */ static int getCStrCount ARGLIST((str)) GRA(char *, str) { int x = 1; char *newStr; if (!str) return(0); if (!*str) return(0); while ((newStr = getNextCStrDelim(str))) { x++; str = ++newStr; } return(x); } /* * Function: * cwc = CStrCommonWideCharsGet(); * Description: * Return the array of common wide characters. * Input: * None. * Output: * cwc - wchar_t * : this array should never be written to or FREEd. */ static wchar_t *CStrCommonWideCharsGet() { static wchar_t *CommonWideChars = NULL; /* * If you add to this array, don't forget to change the enum in * the TYPEDEFS and DEFINES section above to correspond to this * array. */ static char *characters[] = { "\000", "\t", "\n", "\r", "\f", "\v", "\\", "\"", "#", ":", "f", "l", "n", "r", "t", "v", "F", "L", "R", "T", "0", "1" }; if (CommonWideChars == NULL) { int i; /* * Allocate and create the array. */ CommonWideChars = (wchar_t*)XtMalloc(NUM_COMMON_WCHARS * sizeof(wchar_t)); for (i = 0; i < NUM_COMMON_WCHARS; i++) { (void)dombtowc(&(CommonWideChars[i]), characters[i], 1); } } return(CommonWideChars); } /* * Function: * CONVERTER CvtStringToXmString * and * XmStringCvtDestroy * Description: * Convert a string to an XmString. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * ::[#[font-tag]]"string"[#[font-tag]"string"] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmString ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) UARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString resStr; char *str; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg(XtDisplayToApplicationContext(d), "cvtStringToXmString", "wrongParameters", "XtToolkitError", "String to XmString converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * See if this is a simple string */ str = (char*)fromVal->addr; if (strncmp(str, "::", 2)) { resStr = XmStringCreateLtoR(fromVal->addr, XmSTRING_DEFAULT_CHARSET); } else { /* * Convert into internal format */ resStr = StringToXmString(fromVal->addr + 2); /* skip :: */ } /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&resStr; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString)) { toVal->size = sizeof(XmString); XtDisplayStringConversionWarning(d, fromVal->addr, "XmString"); XmStringFree(resStr); return(False); } else { *(XmString *)toVal->addr = resStr; toVal->size = sizeof(XmString); } return(True); } static void XmStringCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmStringFree(*(XmString*)(to->addr)); } /* * Function: * CONVERTER CvtStringToXmStringTable * and * XmStringTableCvtDestroy * * Description: * Convert a string to an XmString table. This allows a string contained in * resource file to contain multiple fonts. The syntax for the string * is: * compound_string = [#[font-tag]]"string"[#[font-tag]"string"] ... * compound_string_table = [compound_string][,compound_string] ... * * note that the # can be escaped (\#). * * Input: * Output: * Standard. */ static Boolean CvtStringToXmStringTable ARGLIST((d, args, num_args, fromVal, toVal, data)) ARG(Display *, d) ARG(XrmValue *, args) ARG(Cardinal *, num_args) ARG(XrmValue *, fromVal) ARG(XrmValue *, toVal) GRAU(XtPointer, data) { static XmString *CStrTable; XmString *tblPtr; char *str; char *tmpBuf; char *nextDelim; XrmValue fVal; XrmValue tVal; /* * This converter takes no parameters */ if (*num_args != 0) { XtAppWarningMsg (XtDisplayToApplicationContext(d), "cvtStringToXmStringTable", "wrongParameters", "XtToolkitError", "String to XmStringTable converter needs no extra arguments", (String *)NULL, (Cardinal *)NULL); } /* * Set str and make sure there's somethin' there */ if (!(str = (char*)fromVal->addr)) { str = ""; } /* * Allocate the XmStrings + 1 for NULL termination */ CStrTable = (XmString*)XtMalloc((getCStrCount(str) + 1) * sizeof(XmString*)); /* * Use the string converter for the strings */ tmpBuf = (char*)XtMalloc(strlen(str) + 1); strcpy(tmpBuf, str); str = tmpBuf; /* * Create strings */ tblPtr = CStrTable; if (*str) { while (str) { nextDelim = getNextCStrDelim(str); /* * Overwrite nextDelim */ if (nextDelim) { *nextDelim = '\0'; nextDelim++; } /* * Convert it */ fVal.size = strlen(str) + 1; fVal.addr = str; tVal.size = sizeof(XTPOINTER); tVal.addr = (XTPOINTER)tblPtr; /* * Call converter ourselves since this is used to create * the strings in the table we create. We need to do this * since we don't have a widget to send to the XtConvertAndStore * function. Side effects are that we can never get these * compound strings cached and that no destructor function is * called when the strings leave existance, but we nuke 'em * in the XmStringTable destuctor. */ CvtStringToXmString(d, args, num_args, &fVal, &tVal, NULL); tblPtr++; str = nextDelim; } } XtFree(tmpBuf); /* * Null terminate */ *tblPtr = NULL; /* * Done, return result */ if (toVal->addr == NULL) { toVal->addr = (XTPOINTER)&CStrTable; toVal->size = sizeof(XmString); } else if (toVal->size < sizeof(XmString*)) { toVal->size = sizeof(XmString*); XtDisplayStringConversionWarning(d, fromVal->addr, "XmStringTable"); tblPtr = CStrTable; while (*tblPtr) { XmStringFree(*tblPtr); } XtFree((char*)CStrTable); return(False); } else { *(XmString **)toVal->addr = CStrTable; toVal->size = sizeof(XmString*); } return(True); } static void XmStringTableCvtDestroy ARGLIST((app, to, data, args, num_args)) UARG(XtAppContext, app) ARG(XrmValue *, to) UARG(XtPointer, data) UARG(XrmValue *, args) GRAU(Cardinal *, num_args) { XmString *tblPtr = *(XmString**)(to->addr); while (*tblPtr) { XmStringFree(*tblPtr); } XtFree((char*)(*(XmString**)(to->addr))); } /***************************************************************************** * GLOBAL CODE *****************************************************************************/ /* * Function: * RegisterBxConverters(appContext); * Description: * This globally available function installs all the converters necessary * to run BuilderXcessory generated interfaces that use compound * strings. This is necessary since Motif has not supplied very smart * converters. * Input: * appContext - XtAppContext : the application context * Output: * None */ void RegisterBxConverters ARGLIST((appContext)) GRA(XtAppContext, appContext) { XtAppSetTypeConverter(appContext, XmRString, XmRXmString, (XtTypeConverter)CvtStringToXmString, NULL, 0, XtCacheNone, XmStringCvtDestroy); XtAppSetTypeConverter(appContext, XmRString, XmRXmStringTable, (XtTypeConverter)CvtStringToXmStringTable, NULL, 0, XtCacheNone, XmStringTableCvtDestroy); } /* * Function: * CONVERT(w, from_string, to_type, to_size, success); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * w - Widget : the widget to use for conversion * from_string - char * : the string to convert from * to_type - char * : the type to convert to * to_size - int : the size of the conversion result * success - Boolean* : Set to the result value of the conversion * Output: * None */ #ifndef IGNORE_CONVERT XtPointer CONVERT ARGLIST((w, from_string, to_type, to_size, success)) ARG(Widget, w) ARG(char *, from_string) ARG(char *, to_type) ARG(int, to_size) GRA(Boolean *, success) { XrmValue fromVal, toVal; /* resource holders */ Boolean convResult; /* return value */ XtPointer val; /* Pointer size return value */ to_size = 0; /* * We will assume that the conversion is going to fail and change this * value later if the conversion is a success. */ *success = False; /* * Since we are converting from a string to some type we need to * set the fromVal structure up with the string information that * the caller passed in. */ fromVal.size = strlen(from_string) + 1; fromVal.addr = from_string; /* * Since we are not sure what type and size of data we are going to * get back we will set this up so that the converter will point us * at a block of valid data. */ toVal.size = 0; toVal.addr = NULL; /* * Now lets try to convert this data by calling this handy-dandy Xt * routine. */ convResult = XtConvertAndStore(w, XmRString, &fromVal, to_type, &toVal); /* * Now we have two conditions here. One the conversion was a success * and two the conversion failed. */ if(!convResult) { /* * If this conversion failed that we can pretty much return right * here because there is nothing else we can do. */ return((XtPointer) NULL); } /* * If we get this far that means we did the conversion and all is * well. Now we have to handle the special cases for type and * size constraints. */ if(!strcmp(to_type, "String")) { /* * Since strings are handled different in Xt we have to deal with * the conversion from a string to a string. When this happens the * toVal.size will hold the strlen of the string so generic * conversion code can't handle it. It is possible for a string to * string conversion to happen so we do have to watch for it. */ val = (XTPOINTER)toVal.addr; } else if(!strcmp(to_type, "Double")) { val = (XTPOINTER)((double*)toVal.addr); } else if(!strcmp(to_type, "Float")) { val = (XTPOINTER)((float*)toVal.addr); } else { /* * Here is the generic conversion return value handler. This * just does some size specific casting so that value that we * return is in the correct bytes of the XtPointer that we * return. Here we check all sizes from 1 to 8 bytes. */ switch(toVal.size) { case 1: val = (XTPOINTER)(unsigned)(*(char*)toVal.addr); /* may be here exists bug ! */ break; case 2: val = (XTPOINTER)(unsigned)(*(short*)toVal.addr); /* may be here exists bug ! */ break; case 4: val = (XTPOINTER)(unsigned)(*(int*)toVal.addr); /* may be here exists bug ! */ break; case 8: default: val = (XTPOINTER)(unsigned)(*(long*)toVal.addr); /* may be here exists bug ! */ break; } } /* * Well everything is done and the conversion was a success so lets * set the success flag to True. */ *success = convResult; /* * Finally lets return the converted value. */ /*SUPPRESS 80*/ return(val); } #endif /* * Function: * MENU_POST(p, mw, ev, dispatch); * Description: * A converter wrapper for convenience from BuilderXcessory. * Input: * p - Widget : the widget to post * mw - XtPointer : the menu widget * ev - XEvent* : the event that caused the menu post * dispatch - Boolean* : not used * Output: * None */ #ifndef IGNORE_MENU_POST void MENU_POST ARGLIST((p, mw, ev, dispatch)) UARG(Widget, p) ARG(XtPointer, mw) ARG(XEvent *, ev) GRAU(Boolean *, dispatch) { Arg args[2]; int argcnt; int button; Widget m = (Widget)mw; XButtonEvent *e = (XButtonEvent *)ev; argcnt = 0; XtSetArg(args[argcnt], XmNwhichButton, &button); argcnt++; XtGetValues(m, args, argcnt); if(e->button != button) return; XmMenuPosition(m, e); XtManageChild(m); } #endif /* * Function: * SET_BACKGROUND_COLOR(w, args, argcnt, bg_color); * Description: * Sets the background color and shadows of a widget. * Input: * w - The widget to set the background color on. * args, argcnt - The argument list so far. * bg_color - The new background color as a pixel. * Output: * none * * NOTES: This assumes that args later in the argument list * override those already in the list. Therfore i f * there are shadow colors later in the list they will win. * * There is no need to use this function when creating a widget * only when doing a set values, shadow colors are automatically * calculated at creation time. */ void SET_BACKGROUND_COLOR ARGLIST((w, args, argcnt, bg_color)) ARG(Widget, w) ARG(ArgList, args) ARG(Cardinal *, argcnt) GRA(Pixel, bg_color) { int i; int topShadowLoc; int bottomShadowLoc; int selectLoc; int fgLoc; #if ((XmVERSION == 1) && (XmREVISION > 0)) /* * Walk through the arglist to see if the user set the top or * bottom shadow colors. */ selectLoc = topShadowLoc = bottomShadowLoc = UNSET; for (i = 0; i < *argcnt; i++) { if ((strcmp(args[i].name, XmNtopShadowColor) == 0) || (strcmp(args[i].name, XmNtopShadowPixmap) == 0)) { topShadowLoc = i; } else if ((strcmp(args[i].name, XmNbottomShadowColor) == 0) || (strcmp(args[i].name, XmNbottomShadowPixmap) == 0)) { bottomShadowLoc = i; } else if (strcmp(args[i].name, XmNarmColor) == 0) { selectLoc = i; } else if (strcmp(args[i].name, XmNforeground) == 0) { fgLoc = i; } } /* * If either the top or bottom shadow are not set then we * need to use XmGetColors to get the shadow colors from the backgound * color and add those that are not already in the arglist to the * arglist. * */ if ((bottomShadowLoc == UNSET) || (topShadowLoc == UNSET) || (selectLoc == UNSET) || (fgLoc == UNSET)) { Arg larg[1]; Colormap cmap; Pixel topShadow; Pixel bottomShadow; Pixel select; Pixel fgColor; XtSetArg(larg[0], XmNcolormap, &cmap); XtGetValues(w, larg, 1); XmGetColors(XtScreen(w), cmap, bg_color, &fgColor, &topShadow, &bottomShadow, &select); if (topShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNtopShadowColor, topShadow); (*argcnt)++; } if (bottomShadowLoc == UNSET) { XtSetArg(args[*argcnt], XmNbottomShadowColor, bottomShadow); (*argcnt)++; } if (selectLoc == UNSET) { XtSetArg(args[*argcnt], XmNarmColor, select); (*argcnt)++; } if (fgLoc == UNSET) { XtSetArg(args[*argcnt], XmNforeground, fgColor); (*argcnt)++; } } #endif XtSetArg(args[*argcnt], XmNbackground, bg_color); (*argcnt)++; } /* * Function: * w = BxFindTopShell(start); * Description: * Go up the hierarhcy until we find a shell widget. * Input: * start - Widget : the widget to start with. * Output: * w - Widget : the shell widget. */ #ifndef _BX_FIND_TOP_SHELL #define _BX_FIND_TOP_SHELL Widget BxFindTopShell ARGLIST((start)) GRA(Widget, start) { Widget p; while((p = XtParent(start))) { start = p; } return(start); } #endif /* _BX_FIND_TOP_SHELL */ /* * Function: * BxWidgetIdsFromNames(ref, cbName, stringList) * Description: * Return an array of widget ids from a list of widget names. * Input: * ref - Widget : reference widget. * cbName - char* : callback name. * stringList - char*: list of widget names. * Output: * WidgetList : array of widget IDs. */ #ifndef _BX_WIDGETIDS_FROM_NAMES #define _BX_WIDGETIDS_FROM_NAMES WidgetList BxWidgetIdsFromNames ARGLIST((ref, cbName, stringList)) ARG(Widget, ref) ARG(char, *cbName) GRA(char, *stringList) { WidgetList wgtIds = NULL; int wgtCount = 0; Widget inst; Widget current; String tmp; String start; String widget; char *ptr; /* * For backward compatibility, remove [ and ] from the list. */ tmp = start = XtNewString(stringList); if((start = strchr(start, '[')) != NULL) start++; else start = tmp; while((start && *start) && isspace(*start)) { start++; } ptr = strrchr(start, ']'); if (ptr) { *ptr = '\0'; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * start now points to the first character after the [. * the list is now either empty, one, or more widget * instance names. */ start = strtok(start, ","); while(start) { while((start && *start) && isspace(*start)) { start++; } ptr = start + strlen(start) - 1; while(ptr && *ptr) { if (isspace(*ptr)) { ptr--; } else { ptr++; break; } } if (ptr && *ptr) { *ptr = '\0'; } /* * Form a string to use with XtNameToWidget(). */ widget = (char *)XtMalloc((strlen(start) + 2) * sizeof(char)); sprintf(widget, "*%s", start); /* * Start at this level and continue up until the widget is found * or until the top of the hierarchy is reached. */ current = ref; while (current != NULL) { inst = XtNameToWidget(current, widget); if (inst != NULL ) { wgtCount++; wgtIds = (WidgetList)XtRealloc((char *)wgtIds, wgtCount * sizeof(Widget)); wgtIds[wgtCount - 1] = inst; break; } current = XtParent(current); } if (current == NULL) { printf("Callback Error (%s):\n\t\ Cannot find widget %s\n", cbName, widget); } XtFree(widget); start = strtok(NULL, ","); } /* * NULL terminate the list. */ wgtIds = (WidgetList)XtRealloc((char *)wgtIds, (wgtCount + 1) * sizeof(Widget)); wgtIds[wgtCount] = NULL; XtFree((char *)tmp); return(wgtIds); } #endif /* _BX_WIDGETIDS_FROM_NAMES */ XtPointer SINGLE ARGLIST((val)) GRA(float, val) { XtPointer pointer; pointer = (XtPointer)XtMalloc(sizeof(float)); if ( pointer != NULL ) *((float *)pointer) = val; return(pointer); } XtPointer DOUBLE ARGLIST((val)) GRA(double, val) { XtPointer pointer; pointer = (XtPointer)XtMalloc(sizeof(double)); if ( pointer != NULL ) *((double *)pointer) = val; return(pointer); } /**************************************************************************** * * Big chunk of code inserted from Bull (based on modified 3.3) * ****************************************************************************/ #ifndef IGNORE_XPM_PIXMAP #ifndef USE_XPM_LIBRARY #ifdef SYSV #include #endif /* * Copyright 1990, 1991 GROUPE BULL * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of GROUPE BULL not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. GROUPE BULL makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * GROUPE BULL disclaims all warranties with regard to this software, * including all implied warranties of merchantability and fitness, * in no event shall GROUPE BULL be liable for any special, * indirect or consequential damages or any damages * whatsoever resulting from loss of use, data or profits, * whether in an action of contract, negligence or other tortious * action, arising out of or in connection with the use * or performance of this software. * */ /* Return ErrorStatus codes: * null if full success * positive if partial success * negative if failure */ #define BxXpmColorError 1 #define BxXpmSuccess 0 #define BxXpmOpenFailed -1 #define BxXpmFileInvalid -2 #define BxXpmNoMemory -3 #define BxXpmColorFailed -4 typedef struct { char *name; /* Symbolic color name */ char *value; /* Color value */ Pixel pixel; /* Color pixel */ } BxXpmColorSymbol; typedef struct { unsigned long valuemask; /* Specifies which attributes are * defined */ Visual *visual; /* Specifies the visual to use */ Colormap colormap; /* Specifies the colormap to use */ unsigned int depth; /* Specifies the depth */ unsigned int width; /* Returns the width of the created * pixmap */ unsigned int height; /* Returns the height of the created * pixmap */ unsigned int x_hotspot; /* Returns the x hotspot's * coordinate */ unsigned int y_hotspot; /* Returns the y hotspot's * coordinate */ unsigned int cpp; /* Specifies the number of char per * pixel */ Pixel *pixels; /* List of used color pixels */ unsigned int npixels; /* Number of pixels */ BxXpmColorSymbol *colorsymbols; /* Array of color symbols to * override */ unsigned int numsymbols; /* Number of symbols */ char *rgb_fname; /* RGB text file name */ /* Infos */ unsigned int ncolors; /* Number of colors */ char ***colorTable; /* Color table pointer */ char *hints_cmt; /* Comment of the hints section */ char *colors_cmt; /* Comment of the colors section */ char *pixels_cmt; /* Comment of the pixels section */ unsigned int mask_pixel; /* Transparent pixel's color table * index */ } BxXpmAttributes; /* Xpm attribute value masks bits */ #define BxXpmVisual (1L<<0) #define BxXpmColormap (1L<<1) #define BxXpmDepth (1L<<2) #define BxXpmSize (1L<<3) /* width & height */ #define BxXpmHotspot (1L<<4) /* x_hotspot & y_hotspot */ #define BxXpmCharsPerPixel (1L<<5) #define BxXpmColorSymbols (1L<<6) #define BxXpmRgbFilename (1L<<7) #define BxXpmInfos (1L<<8) /* all infos members */ #define BxXpmReturnPixels (1L<<9) #define BxXpmReturnInfos BxXpmInfos /* * minimal portability layer between ansi and KR C */ /* forward declaration of functions with prototypes */ #ifdef NeedFunctionPrototypes #define LFUNC(f, t, p) static t f p #else #define LFUNC(f, t, p) static t f() #endif /* * functions declarations */ #ifdef __cplusplus extern "C" { #endif LFUNC(XpmCreatePixmapFromData, int, (Display * display, Drawable d, char **data, Pixmap * pixmap_return, Pixmap * shapemask_return, BxXpmAttributes * attributes)); LFUNC(XpmCreateImageFromData, int, (Display * display, char **data, XImage ** image_return, XImage ** shapemask_return, BxXpmAttributes * attributes)); LFUNC(XpmFreeAttributes, void, (BxXpmAttributes * attributes)); #ifdef __cplusplus } /* for C++ V2.0 */ #endif typedef struct { unsigned int type; union { FILE *file; char **data; } stream; char *cptr; unsigned int line; int CommentLength; char Comment[BUFSIZ]; char *Bcmt, *Ecmt, Bos, Eos; unsigned int InsideString; /* used during parsing: 0 or 1 * whether we are inside or not */ } bxxpmData; #define BXXPMARRAY 0 #define BXXPMFILE 1 #define BXXPMPIPE 2 typedef unsigned char byte; #define BX_TRANSPARENT_COLOR "None" /* this must be a string! */ /* number of BxXpmColorKeys */ #define BXNKEYS 5 /* * key numbers for visual type, they must fit along with the number key of * each corresponding element in BxXpmColorKeys[] defined in xpm.h */ #define BXMONO 2 #define BXGRAY4 3 #define BXGRAY 4 #define BXCOLOR 5 /* structure containing data related to an Xpm pixmap */ typedef struct { char *name; unsigned int width; unsigned int height; unsigned int cpp; unsigned int ncolors; char ***colorTable; unsigned int *pixelindex; XColor *xcolors; char **colorStrings; unsigned int mask_pixel; /* mask pixel's colorTable index */ } bxxpmInternAttrib; #define BX_UNDEF_PIXEL 0x80000000 char *BxXpmColorKeys[] = { "s", /* key #1: symbol */ "m", /* key #2: mono visual */ "g4", /* key #3: 4 grays visual */ "g", /* key #4: gray visual */ "c", /* key #5: color visual */ }; /* XPM private routines */ LFUNC(xpmCreateImage, int, (Display * display, bxxpmInternAttrib * attrib, XImage ** image_return, XImage ** shapeimage_return, BxXpmAttributes * attributes)); LFUNC(xpmParseData, int, (bxxpmData * data, bxxpmInternAttrib * attrib_return, BxXpmAttributes * attributes)); LFUNC(BxXpmVisualType, int, (Visual * visual)); LFUNC(xpmFreeColorTable, void, (char ***colorTable, int ncolors)); LFUNC(xpmInitInternAttrib, void, (bxxpmInternAttrib * xmpdata)); LFUNC(xpmFreeInternAttrib, void, (bxxpmInternAttrib * xmpdata)); LFUNC(xpmSetAttributes, void, (bxxpmInternAttrib * attrib, BxXpmAttributes * attributes)); /* I/O utility */ LFUNC(xpmNextString, void, (bxxpmData * mdata)); LFUNC(xpmNextUI, int, (bxxpmData * mdata, unsigned int *ui_return)); LFUNC(xpmGetC, int, (bxxpmData * mdata)); LFUNC(xpmUngetC, int, (int c, bxxpmData * mdata)); LFUNC(xpmNextWord, unsigned int, (bxxpmData * mdata, char *buf)); LFUNC(xpmGetCmt, void, (bxxpmData * mdata, char **cmt)); LFUNC(xpmOpenArray, int, (char **data, bxxpmData * mdata)); LFUNC(XpmDataClose, void, (bxxpmData * mdata)); /* RGB utility */ LFUNC(xpm_xynormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); LFUNC(xpm_znormalizeimagebits, void, (register unsigned char *bp, register XImage * img)); /* Image utility */ LFUNC(SetColor, int, (Display * display, Colormap colormap, char *colorname, unsigned int color_index, Pixel * image_pixel, Pixel * mask_pixel, unsigned int *mask_pixel_index)); LFUNC(CreateXImage, int, (Display * display, Visual * visual, unsigned int depth, unsigned int width, unsigned int height, XImage ** image_return)); LFUNC(SetImagePixels, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels32, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels16, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels8, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(SetImagePixels1, void, (XImage * image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel * pixels)); LFUNC(atoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); /* * Macros * * The BXXYNORMALIZE macro determines whether XY format data requires * normalization and calls a routine to do so if needed. The logic in * this module is designed for LSBFirst byte and bit order, so * normalization is done as required to present the data in this order. * * The BXZNORMALIZE macro performs byte and nibble order normalization if * required for Z format data. * * The BXXYINDEX macro computes the index to the starting byte (char) boundary * for a bitmap_unit containing a pixel with coordinates x and y for image * data in XY format. * * The BXZINDEX* macros compute the index to the starting byte (char) boundary * for a pixel with coordinates x and y for image data in ZPixmap format. * */ #define BXXYNORMALIZE(bp, img) \ if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \ xpm_xynormalizeimagebits((unsigned char *)(bp), img) #define BXZNORMALIZE(bp, img) \ if (img->byte_order == MSBFirst) \ xpm_znormalizeimagebits((unsigned char *)(bp), img) #define BXXYINDEX(x, y, img) \ ((y) * img->bytes_per_line) + \ (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3) #define BXZINDEX(x, y, img) ((y) * img->bytes_per_line) + \ (((x) * img->bits_per_pixel) >> 3) #define BXZINDEX32(x, y, img) ((y) * img->bytes_per_line) + ((x) << 2) #define BXZINDEX16(x, y, img) ((y) * img->bytes_per_line) + ((x) << 1) #define BXZINDEX8(x, y, img) ((y) * img->bytes_per_line) + (x) #define BXZINDEX1(x, y, img) ((y) * img->bytes_per_line) + ((x) >> 3) #if __STDC__ #define Const const #else #define Const #endif static unsigned int atoui ARGLIST((p, l, ui_return)) ARG(register char *, p) ARG(unsigned int, l) GRA(unsigned int *, ui_return) { register int n, i; n = 0; for (i = 0; i < l; i++) if (*p >= '0' && *p <= '9') n = n * 10 + *p++ - '0'; else break; if (i != 0 && i == l) { *ui_return = n; return 1; } else return 0; } static int XpmCreatePixmapFromData ARGLIST((display, d, data, pixmap_return, shapemask_return, attributes)) ARG(Display *, display) ARG(Drawable, d) ARG(char **, data) ARG(Pixmap *, pixmap_return) ARG(Pixmap *, shapemask_return) GRA(BxXpmAttributes *,attributes) { XImage *image, **imageptr = NULL; XImage *shapeimage, **shapeimageptr = NULL; int ErrorStatus; XGCValues gcv; GC gc; /* * initialize return values */ if (pixmap_return) { *pixmap_return = (Pixmap)NULL; imageptr = ℑ } if (shapemask_return) { *shapemask_return = (Pixmap)NULL; shapeimageptr = &shapeimage; } /* * create the images */ ErrorStatus = XpmCreateImageFromData(display, data, imageptr, shapeimageptr, attributes); if (ErrorStatus < 0) return (ErrorStatus); /* * create the pixmaps */ if (imageptr && image) { *pixmap_return = XCreatePixmap(display, d, image->width, image->height, image->depth); gcv.function = GXcopy; gc = XCreateGC(display, *pixmap_return, GCFunction, &gcv); XPutImage(display, *pixmap_return, gc, image, 0, 0, 0, 0, image->width, image->height); XDestroyImage(image); XFreeGC(display, gc); } if (shapeimageptr && shapeimage) { *shapemask_return = XCreatePixmap(display, d, shapeimage->width, shapeimage->height, shapeimage->depth); gcv.function = GXcopy; gc = XCreateGC(display, *shapemask_return, GCFunction, &gcv); XPutImage(display, *shapemask_return, gc, shapeimage, 0, 0, 0, 0, shapeimage->width, shapeimage->height); XDestroyImage(shapeimage); XFreeGC(display, gc); } return (ErrorStatus); } static int XpmCreateImageFromData ARGLIST((display, data, image_return, shapeimage_return, attributes)) ARG(Display *,display) ARG(char **, data) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(BxXpmAttributes *, attributes) { bxxpmData mdata; int ErrorStatus; bxxpmInternAttrib attrib; /* * initialize return values */ if (image_return) *image_return = NULL; if (shapeimage_return) *shapeimage_return = NULL; if ((ErrorStatus = xpmOpenArray(data, &mdata)) != BxXpmSuccess) return (ErrorStatus); xpmInitInternAttrib(&attrib); ErrorStatus = xpmParseData(&mdata, &attrib, attributes); if (ErrorStatus == BxXpmSuccess) ErrorStatus = xpmCreateImage(display, &attrib, image_return, shapeimage_return, attributes); if (ErrorStatus >= 0) xpmSetAttributes(&attrib, attributes); else if (attributes) XpmFreeAttributes(attributes); xpmFreeInternAttrib(&attrib); XpmDataClose(&mdata); return (ErrorStatus); } /* * open the given array to be read or written as an bxxpmData which is returned */ static int xpmOpenArray ARGLIST((data, mdata)) ARG(char **,data) GRA(bxxpmData *,mdata) { mdata->type = BXXPMARRAY; mdata->stream.data = data; mdata->cptr = *data; mdata->line = 0; mdata->CommentLength = 0; mdata->Bcmt = mdata->Ecmt = NULL; mdata->Bos = mdata->Eos = '\0'; mdata->InsideString = 0; return (BxXpmSuccess); } /* * Intialize the bxxpmInternAttrib pointers to Null to know * which ones must be freed later on. */ static void xpmInitInternAttrib ARGLIST((attrib)) GRA(bxxpmInternAttrib *,attrib) { attrib->ncolors = 0; attrib->colorTable = NULL; attrib->pixelindex = NULL; attrib->xcolors = NULL; attrib->colorStrings = NULL; attrib->mask_pixel = BX_UNDEF_PIXEL; } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (colorTable) xpmFreeColorTable(colorTable, ncolors); \ if (chars) free(chars); \ if (pixelindex) free((char *)pixelindex); \ if (hints_cmt) free((char *)hints_cmt); \ if (colors_cmt) free((char *)colors_cmt); \ if (pixels_cmt) free((char *)pixels_cmt); \ return(status); } /* * This function parses an Xpm file or data and store the found informations * in an an bxxpmInternAttrib structure which is returned. */ static int xpmParseData ARGLIST((data, attrib_return, attributes)) ARG(bxxpmData *,data) ARG(bxxpmInternAttrib *, attrib_return) GRA(BxXpmAttributes *, attributes) { /* variables to return */ unsigned int width, height; unsigned int ncolors = 0; unsigned int cpp; unsigned int x_hotspot, y_hotspot, hotspot = 0; char ***colorTable = NULL; unsigned int *pixelindex = NULL; char *hints_cmt = NULL; char *colors_cmt = NULL; char *pixels_cmt = NULL; /* calculation variables */ unsigned int rncolors = 0; /* read number of colors, it is * different to ncolors to avoid * problem when freeing the * colorTable in case an error * occurs while reading the hints * line */ unsigned int key = 0; /* color key */ char *chars = NULL, buf[BUFSIZ]; unsigned int *iptr; unsigned int a, b, x, y, l; unsigned int curkey; /* current color key */ unsigned int lastwaskey; /* key read */ char curbuf[BUFSIZ]; /* current buffer */ /* * read hints: width, height, ncolors, chars_per_pixel */ if (!(xpmNextUI(data, &width) && xpmNextUI(data, &height) && xpmNextUI(data, &rncolors) && xpmNextUI(data, &cpp))) RETURN(BxXpmFileInvalid); ncolors = rncolors; /* * read hotspot coordinates if any */ hotspot = xpmNextUI(data, &x_hotspot) && xpmNextUI(data, &y_hotspot); /* * store the hints comment line */ if (attributes && (attributes->valuemask & BxXpmReturnInfos)) xpmGetCmt(data, &hints_cmt); /* * read colors */ colorTable = (char ***) calloc(ncolors, sizeof(char **)); if (!colorTable) RETURN(BxXpmNoMemory); for (a = 0; a < ncolors; a++) { xpmNextString(data); /* skip the line */ colorTable[a] = (char **) calloc((BXNKEYS + 1), sizeof(char *)); if (!colorTable[a]) RETURN(BxXpmNoMemory); /* * read pixel value */ colorTable[a][0] = (char *) malloc(cpp); if (!colorTable[a][0]) RETURN(BxXpmNoMemory); for (b = 0; b < cpp; b++) colorTable[a][0][b] = xpmGetC(data); /* * read color keys and values */ curkey = 0; lastwaskey = 0; while ((l = xpmNextWord(data, buf))) { if (!lastwaskey) { for (key = 1; key < BXNKEYS + 1; key++) if ((strlen(BxXpmColorKeys[key - 1]) == l) && (!strncmp(BxXpmColorKeys[key - 1], buf, l))) break; } if (!lastwaskey && key <= BXNKEYS) { /* open new key */ if (curkey) { /* flush string */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(BxXpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } curkey = key; /* set new key */ curbuf[0] = '\0'; /* reset curbuf */ lastwaskey = 1; } else { if (!curkey) RETURN(BxXpmFileInvalid); /* key without value */ if (!lastwaskey) strcat(curbuf, " ");/* append space */ buf[l] = '\0'; strcat(curbuf, buf); /* append buf */ lastwaskey = 0; } } if (!curkey) RETURN(BxXpmFileInvalid); /* key without value */ colorTable[a][curkey] = (char *) malloc(strlen(curbuf) + 1); if (!colorTable[a][curkey]) RETURN(BxXpmNoMemory); strcpy(colorTable[a][curkey], curbuf); } /* * store the colors comment line */ if (attributes && (attributes->valuemask & BxXpmReturnInfos)) xpmGetCmt(data, &colors_cmt); /* * read pixels and index them on color number */ pixelindex = (unsigned int *) malloc(sizeof(unsigned int) * width * height); if (!pixelindex) RETURN(BxXpmNoMemory); iptr = pixelindex; chars = (char *) malloc(cpp); if (!chars) RETURN(BxXpmNoMemory); for (y = 0; y < height; y++) { xpmNextString(data); for (x = 0; x < width; x++, iptr++) { for (a = 0; a < cpp; a++) chars[a] = xpmGetC(data); for (a = 0; a < ncolors; a++) if (!strncmp(colorTable[a][0], chars, cpp)) break; if (a == ncolors) RETURN(BxXpmFileInvalid); /* no color matches */ *iptr = a; } } /* * store the pixels comment line */ if (attributes && (attributes->valuemask & BxXpmReturnInfos)) xpmGetCmt(data, &pixels_cmt); free(chars); /* * store found informations in the bxxpmInternAttrib structure */ attrib_return->width = width; attrib_return->height = height; attrib_return->cpp = cpp; attrib_return->ncolors = ncolors; attrib_return->colorTable = colorTable; attrib_return->pixelindex = pixelindex; if (attributes) { if (attributes->valuemask & BxXpmReturnInfos) { attributes->hints_cmt = hints_cmt; attributes->colors_cmt = colors_cmt; attributes->pixels_cmt = pixels_cmt; } if (hotspot) { attributes->x_hotspot = x_hotspot; attributes->y_hotspot = y_hotspot; attributes->valuemask |= BxXpmHotspot; } } return (BxXpmSuccess); } /* * set the color pixel related to the given colorname, * return 0 if success, 1 otherwise. */ static int SetColor ARGLIST((display, colormap,colorname, color_index, image_pixel, mask_pixel, mask_pixel_index)) ARG(Display *, display) ARG(Colormap, colormap) ARG(char *, colorname) ARG(unsigned int, color_index) ARG(Pixel *, image_pixel) ARG(Pixel *, mask_pixel) GRA(unsigned int *, mask_pixel_index) { XColor xcolor; if (STRCASECMP(colorname, BX_TRANSPARENT_COLOR)) { if (!XParseColor(display, colormap, colorname, &xcolor) || (!XAllocColor(display, colormap, &xcolor))) return (1); *image_pixel = xcolor.pixel; *mask_pixel = 1; } else { *image_pixel = 0; *mask_pixel = 0; *mask_pixel_index = color_index;/* store the color table index */ } return (0); } /* function call in case of error, frees only localy allocated variables */ #undef RETURN #define RETURN(status) \ { if (image) XDestroyImage(image); \ if (shapeimage) XDestroyImage(shapeimage); \ if (image_pixels) free((char *)image_pixels); \ if (mask_pixels) free((char *)mask_pixels); \ return(status); } static int xpmCreateImage ARGLIST((display, attrib, image_return, shapeimage_return, attributes)) ARG(Display *, display) ARG(bxxpmInternAttrib *, attrib) ARG(XImage **, image_return) ARG(XImage **, shapeimage_return) GRA(BxXpmAttributes *, attributes) { /* variables stored in the BxXpmAttributes structure */ Visual *visual; Colormap colormap; unsigned int depth; BxXpmColorSymbol *colorsymbols = NULL; unsigned int numsymbols; /* variables to return */ XImage *image = NULL; XImage *shapeimage = NULL; unsigned int mask_pixel; unsigned int ErrorStatus, ErrorStatus2; /* calculation variables */ Pixel *image_pixels = NULL; Pixel *mask_pixels = NULL; char *colorname; unsigned int a, b, l; Boolean pixel_defined; unsigned int key; /* * retrieve information from the BxXpmAttributes */ if (attributes && attributes->valuemask & BxXpmColorSymbols) { colorsymbols = attributes->colorsymbols; numsymbols = attributes->numsymbols; } else numsymbols = 0; if (attributes && attributes->valuemask & BxXpmVisual) visual = attributes->visual; else visual = DefaultVisual(display, DefaultScreen(display)); if (attributes && attributes->valuemask & BxXpmColormap) colormap = attributes->colormap; else colormap = DefaultColormap(display, DefaultScreen(display)); if (attributes && attributes->valuemask & BxXpmDepth) depth = attributes->depth; else depth = DefaultDepth(display, DefaultScreen(display)); ErrorStatus = BxXpmSuccess; /* * alloc pixels index tables */ key = BxXpmVisualType(visual); image_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!image_pixels) RETURN(BxXpmNoMemory); mask_pixels = (Pixel *) malloc(sizeof(Pixel) * attrib->ncolors); if (!mask_pixels) RETURN(BxXpmNoMemory); mask_pixel = BX_UNDEF_PIXEL; /* * get pixel colors, store them in index tables */ for (a = 0; a < attrib->ncolors; a++) { colorname = NULL; pixel_defined = False; /* * look for a defined symbol */ if (numsymbols && attrib->colorTable[a][1]) { for (l = 0; l < numsymbols; l++) if (!strcmp(colorsymbols[l].name, attrib->colorTable[a][1])) break; if (l != numsymbols) { if (colorsymbols[l].value) colorname = colorsymbols[l].value; else pixel_defined = True; } } if (!pixel_defined) { /* pixel not given as symbol value */ if (colorname) { /* colorname given as symbol value */ if (!SetColor(display, colormap, colorname, a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) pixel_defined = True; else ErrorStatus = BxXpmColorError; } b = key; while (!pixel_defined && b > 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = BxXpmColorError; } b--; } b = key + 1; while (!pixel_defined && b < BXNKEYS + 1) { if (attrib->colorTable[a][b]) { if (!SetColor(display, colormap, attrib->colorTable[a][b], a, &image_pixels[a], &mask_pixels[a], &mask_pixel)) { pixel_defined = True; break; } else ErrorStatus = BxXpmColorError; } b++; } if (!pixel_defined) RETURN(BxXpmColorFailed); } else { image_pixels[a] = colorsymbols[l].pixel; mask_pixels[a] = 1; } } /* * create the image */ if (image_return) { ErrorStatus2 = CreateXImage(display, visual, depth, attrib->width, attrib->height, &image); if (ErrorStatus2 != BxXpmSuccess) RETURN(ErrorStatus2); /* * set the image data * * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use * optimized functions, otherwise use slower but sure general one. * */ if (image->depth == 1) SetImagePixels1(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 8) SetImagePixels8(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 16) SetImagePixels16(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else if (image->bits_per_pixel == 32) SetImagePixels32(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); else SetImagePixels(image, attrib->width, attrib->height, attrib->pixelindex, image_pixels); } /* * create the shape mask image */ if (mask_pixel != BX_UNDEF_PIXEL && shapeimage_return) { ErrorStatus2 = CreateXImage(display, visual, 1, attrib->width, attrib->height, &shapeimage); if (ErrorStatus2 != BxXpmSuccess) RETURN(ErrorStatus2); SetImagePixels1(shapeimage, attrib->width, attrib->height, attrib->pixelindex, mask_pixels); } free((char *)mask_pixels); /* * if requested store allocated pixels in the BxXpmAttributes structure */ if (attributes && (attributes->valuemask & BxXpmReturnInfos || attributes->valuemask & BxXpmReturnPixels)) { if (mask_pixel != BX_UNDEF_PIXEL) { Pixel *pixels, *p1, *p2; attributes->npixels = attrib->ncolors - 1; pixels = (Pixel *) malloc(sizeof(Pixel) * attributes->npixels); if (pixels) { p1 = image_pixels; p2 = pixels; for (a = 0; a < attrib->ncolors; a++, p1++) if (a != mask_pixel) *p2++ = *p1; attributes->pixels = pixels; } else { /* if error just say we can't return requested data */ attributes->valuemask &= ~BxXpmReturnPixels; attributes->valuemask &= ~BxXpmReturnInfos; attributes->pixels = NULL; attributes->npixels = 0; } free((char *)image_pixels); } else { attributes->pixels = image_pixels; attributes->npixels = attrib->ncolors; } attributes->mask_pixel = mask_pixel; } else free((char *)image_pixels); /* * return created images */ if (image_return) *image_return = image; if (shapeimage_return) *shapeimage_return = shapeimage; return (ErrorStatus); } /* * Create an XImage */ static int CreateXImage ARGLIST((display, visual, depth, width, height, image_return)) ARG(Display *, display) ARG(Visual *, visual) ARG(unsigned int, depth) ARG(unsigned int, width) ARG(unsigned int, height) GRA(XImage **, image_return) { int bitmap_pad; /* first get bitmap_pad */ if (depth > 16) bitmap_pad = 32; else if (depth > 8) bitmap_pad = 16; else bitmap_pad = 8; /* then create the XImage with data = NULL and bytes_per_line = 0 */ *image_return = XCreateImage(display, visual, depth, ZPixmap, 0, 0, width, height, bitmap_pad, 0); if (!*image_return) return (BxXpmNoMemory); /* now that bytes_per_line must have been set properly alloc data */ (*image_return)->data = (char *) malloc((*image_return)->bytes_per_line * height); if (!(*image_return)->data) { XDestroyImage(*image_return); *image_return = NULL; return (BxXpmNoMemory); } return (BxXpmSuccess); } /* * The functions below are written from X11R5 MIT's code (XImUtil.c) * * The idea is to have faster functions than the standard XPutPixel function * to build the image data. Indeed we can speed up things by supressing tests * performed for each pixel. We do exactly the same tests but at the image * level. Assuming that we use only ZPixmap images. */ LFUNC(_putbits, void, (register char *src, int dstoffset, register int numbits, register char *dst)); LFUNC(_XReverse_Bytes, void, (register unsigned char *bpt, register int nb)); static unsigned char Const _reverse_byte[0x100] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static void _XReverse_Bytes ARGLIST((bpt, nb)) ARG(register unsigned char *, bpt) GRA(register int, nb) { do { *bpt = _reverse_byte[*bpt]; bpt++; } while (--nb > 0); } static void xpm_xynormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; if (img->byte_order != img->bitmap_bit_order) { switch (img->bitmap_unit) { case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } if (img->bitmap_bit_order == MSBFirst) _XReverse_Bytes(bp, img->bitmap_unit >> 3); } static void xpm_znormalizeimagebits ARGLIST((bp,img)) ARG(register unsigned char *, bp) GRA(register XImage *, img) { register unsigned char c; switch (img->bits_per_pixel) { case 4: *bp = ((*bp >> 4) & 0xF) | ((*bp << 4) & ~0xF); break; case 16: c = *bp; *bp = *(bp + 1); *(bp + 1) = c; break; case 24: c = *(bp + 2); *(bp + 2) = *bp; *bp = c; break; case 32: c = *(bp + 3); *(bp + 3) = *bp; *bp = c; c = *(bp + 2); *(bp + 2) = *(bp + 1); *(bp + 1) = c; break; } } static unsigned char Const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; static unsigned char Const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static void _putbits ARGLIST((src, dstoffset, numbits, dst)) ARG(register char *, src) /* address of source bit string */ ARG(int, dstoffset) /* bit offset into destination; * range is 0-31 */ ARG(register int, numbits) /* number of bits to copy to * destination */ GRA(register char *, dst) /* address of destination bit string */ { register unsigned char chlo, chhi; int hibits; dst = dst + (dstoffset >> 3); dstoffset = dstoffset & 7; hibits = 8 - dstoffset; chlo = *dst & _lomask[dstoffset]; for (;;) { chhi = (*src << dstoffset) & _himask[dstoffset]; if (numbits <= hibits) { chhi = chhi & _lomask[dstoffset + numbits]; *dst = (*dst & _himask[dstoffset + numbits]) | chlo | chhi; break; } *dst = chhi | chlo; dst++; numbits = numbits - hibits; chlo = (unsigned char) (*src & _himask[hibits]) >> hibits; src++; if (numbits <= dstoffset) { chlo = chlo & _lomask[numbits]; *dst = (*dst & _himask[numbits]) | chlo; break; } numbits = numbits - dstoffset; } } /* * Default method to write pixels into a Z image data structure. * The algorithm used is: * * copy the destination bitmap_unit or Zpixel to temp * normalize temp if needed * copy the pixel bits into the temp * renormalize temp if needed * copy the temp back into the destination image data */ static void SetImagePixels ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { Pixel pixel; unsigned long px; register char *src; register char *dst; int nbytes; register unsigned int *iptr; register int x, y, i; iptr = pixelindex; if (image->depth == 1) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[BXXYINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = image->bitmap_unit >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; BXXYNORMALIZE(&px, image); i = ((x + image->xoffset) % image->bitmap_unit); _putbits((char *) &pixel, i, 1, (char *) &px); BXXYNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[BXXYINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } else { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { pixel = pixels[*iptr]; if (image->depth == 4) pixel &= 0xf; for (i = 0, px = pixel; i < sizeof(unsigned long); i++, px >>= 8) ((unsigned char *) &pixel)[i] = (unsigned char)px; src = &image->data[BXZINDEX(x, y, image)]; dst = (char *) &px; px = 0; nbytes = (image->bits_per_pixel + 7) >> 3; for (i = nbytes; --i >= 0;) *dst++ = *src++; BXZNORMALIZE(&px, image); _putbits((char *) &pixel, (x * image->bits_per_pixel) & 7, image->bits_per_pixel, (char *) &px); BXZNORMALIZE(&px, image); src = (char *) &px; dst = &image->data[BXZINDEX(x, y, image)]; for (i = nbytes; --i >= 0;) *dst++ = *src++; } } } /* * write pixels into a 32-bits Z image data structure */ #ifndef WORD64 static unsigned long byteorderpixel = MSBFirst << 24; #endif static void SetImagePixels32 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *paddr; register unsigned int *iptr; register int x, y; iptr = pixelindex; #ifndef WORD64 if (*((char *) &byteorderpixel) == image->byte_order) { for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { paddr = (unsigned int *)(&(image->data[BXZINDEX32(x, y, image)])); *paddr = (unsigned int)pixels[*iptr]; } } else #endif if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 24); addr[1] = (unsigned char)(pixels[*iptr] >> 16); addr[2] = (unsigned char)(pixels[*iptr] >> 8); addr[3] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[BXZINDEX32(x, y, image)]; addr[3] = (unsigned char)(pixels[*iptr] >> 24); addr[2] = (unsigned char)(pixels[*iptr] >> 16); addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 16-bits Z image data structure */ static void SetImagePixels16 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned char *addr; register unsigned int *iptr; register int x, y; iptr = pixelindex; if (image->byte_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)]; addr[0] = (unsigned char)(pixels[*iptr] >> 8); addr[1] = (unsigned char)(pixels[*iptr]); } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { addr = &((unsigned char *) image->data)[BXZINDEX16(x, y, image)]; addr[1] = (unsigned char)(pixels[*iptr] >> 8); addr[0] = (unsigned char)(pixels[*iptr]); } } /* * write pixels into a 8-bits Z image data structure */ static void SetImagePixels8 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { register unsigned int *iptr; register int x, y; iptr = pixelindex; for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) image->data[BXZINDEX8(x, y, image)] = (char)pixels[*iptr]; } /* * write pixels into a 1-bit depth image data structure and **offset null** */ static void SetImagePixels1 ARGLIST((image, width, height, pixelindex, pixels)) ARG(XImage *, image) ARG(unsigned int, width) ARG(unsigned int, height) ARG(unsigned int *, pixelindex) GRA(Pixel *, pixels) { unsigned char bit; int xoff, yoff; register unsigned int *iptr; register int x, y; if (image->byte_order != image->bitmap_bit_order) SetImagePixels(image, width, height, pixelindex, pixels); else { iptr = pixelindex; if (image->bitmap_bit_order == MSBFirst) for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = BXZINDEX1(x, y, image); xoff = x & 7; bit = 0x80 >> xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } else for (y = 0; y < height; y++) for (x = 0; x < width; x++, iptr++) { yoff = BXZINDEX1(x, y, image); xoff = x & 7; bit = 1 << xoff; if (pixels[*iptr] & 1) image->data[yoff] |= bit; else image->data[yoff] &= ~bit; } } } /* * Store into the BxXpmAttributes structure the required informations stored in * the bxxpmInternAttrib structure. */ static void xpmSetAttributes ARGLIST((attrib, attributes)) ARG(bxxpmInternAttrib *, attrib) GRA(BxXpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & BxXpmReturnInfos) { attributes->cpp = attrib->cpp; attributes->ncolors = attrib->ncolors; attributes->colorTable = attrib->colorTable; attrib->ncolors = 0; attrib->colorTable = NULL; } attributes->width = attrib->width; attributes->height = attrib->height; attributes->valuemask |= BxXpmSize; } } /* * Free the BxXpmAttributes structure members * but the structure itself */ static void XpmFreeAttributes ARGLIST((attributes)) GRA(BxXpmAttributes *, attributes) { if (attributes) { if (attributes->valuemask & BxXpmReturnPixels && attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; attributes->npixels = 0; } if (attributes->valuemask & BxXpmInfos) { if (attributes->colorTable) { xpmFreeColorTable(attributes->colorTable, attributes->ncolors); attributes->colorTable = NULL; attributes->ncolors = 0; } if (attributes->hints_cmt) { free(attributes->hints_cmt); attributes->hints_cmt = NULL; } if (attributes->colors_cmt) { free(attributes->colors_cmt); attributes->colors_cmt = NULL; } if (attributes->pixels_cmt) { free(attributes->pixels_cmt); attributes->pixels_cmt = NULL; } if (attributes->pixels) { free((char *)attributes->pixels); attributes->pixels = NULL; } } attributes->valuemask = 0; } } /* * Free the bxxpmInternAttrib pointers which have been allocated */ static void xpmFreeInternAttrib ARGLIST((attrib)) GRA(bxxpmInternAttrib *, attrib) { unsigned int a; if (attrib->colorTable) xpmFreeColorTable(attrib->colorTable, attrib->ncolors); if (attrib->pixelindex) free((char *)attrib->pixelindex); if (attrib->xcolors) free((char *)attrib->xcolors); if (attrib->colorStrings) { for (a = 0; a < attrib->ncolors; a++) if (attrib->colorStrings[a]) free((char *)attrib->colorStrings[a]); free((char *)attrib->colorStrings); } } /* * close the file related to the bxxpmData if any */ static void XpmDataClose ARGLIST((mdata)) GRA(bxxpmData *, mdata) { switch (mdata->type) { case BXXPMARRAY: break; case BXXPMFILE: if (mdata->stream.file != (stdout) && mdata->stream.file != (stdin)) fclose(mdata->stream.file); break; #ifdef ZPIPE case BXXPMPIPE: pclose(mdata->stream.file); #endif } } /* * skip whitespace and compute the following unsigned int, * returns 1 if one is found and 0 if not */ static int xpmNextUI ARGLIST((mdata, ui_return)) ARG(bxxpmData *, mdata) GRA(unsigned int *, ui_return) { char buf[BUFSIZ]; int l; l = xpmNextWord(mdata, buf); return atoui(buf, l, ui_return); } /* * get the current comment line */ static void xpmGetCmt ARGLIST((mdata, cmt)) ARG(bxxpmData *, mdata) GRA(char **, cmt) { switch (mdata->type) { case BXXPMARRAY: *cmt = NULL; break; case BXXPMFILE: case BXXPMPIPE: if (mdata->CommentLength) { *cmt = (char *) malloc(mdata->CommentLength + 1); strncpy(*cmt, mdata->Comment, mdata->CommentLength); (*cmt)[mdata->CommentLength] = '\0'; mdata->CommentLength = 0; } else *cmt = NULL; break; } } /* * skip to the end of the current string and the beginning of the next one */ static void xpmNextString ARGLIST((mdata)) GRA(bxxpmData *, mdata) { int c; switch (mdata->type) { case BXXPMARRAY: mdata->cptr = (mdata->stream.data)[++mdata->line]; break; case BXXPMFILE: case BXXPMPIPE: if (mdata->Eos) while ((c = xpmGetC(mdata)) != mdata->Eos && c != EOF); if (mdata->Bos) /* if not natural XPM2 */ while ((c = xpmGetC(mdata)) != mdata->Bos && c != EOF); break; } } /* * return the current character, skipping comments */ static int xpmGetC ARGLIST((mdata)) GRA(bxxpmData *, mdata) { int c; register unsigned int n = 0, a; unsigned int notend; switch (mdata->type) { case BXXPMARRAY: return (*mdata->cptr++); case BXXPMFILE: case BXXPMPIPE: c = getc(mdata->stream.file); if (mdata->Bos && mdata->Eos && (c == mdata->Bos || c == mdata->Eos)) { /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (c); } if (!mdata->InsideString && mdata->Bcmt && c == mdata->Bcmt[0]) { mdata->Comment[0] = c; /* * skip the string begining comment */ do { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } while (c == mdata->Bcmt[n] && mdata->Bcmt[n] != '\0' && c != EOF); if (mdata->Bcmt[n] != '\0') { /* this wasn't the begining of a comment */ /* put characters back in the order that we got them */ for (a = n; a > 0; a--) xpmUngetC(mdata->Comment[a], mdata); return (mdata->Comment[0]); } /* * store comment */ mdata->Comment[0] = mdata->Comment[n]; notend = 1; n = 0; while (notend) { while (mdata->Comment[n] != mdata->Ecmt[0] && c != EOF) { c = getc(mdata->stream.file); mdata->Comment[++n] = c; } mdata->CommentLength = n; a = 0; do { c = getc(mdata->stream.file); n++; a++; mdata->Comment[n] = c; } while (c == mdata->Ecmt[a] && mdata->Ecmt[a] != '\0' && c != EOF); if (mdata->Ecmt[a] == '\0') { /* this is the end of the comment */ notend = 0; xpmUngetC(mdata->Comment[n], mdata); } } c = xpmGetC(mdata); } return (c); } return('\0'); } /* * push the given character back */ static int xpmUngetC ARGLIST((c, mdata)) ARG(int, c) GRA(bxxpmData *, mdata) { switch (mdata->type) { case BXXPMARRAY: return (*--mdata->cptr = c); case BXXPMFILE: case BXXPMPIPE: if (mdata->Bos && (c == mdata->Bos || c == mdata->Eos)) /* if not natural XPM2 */ mdata->InsideString = !mdata->InsideString; return (ungetc(c, mdata->stream.file)); } return('\0'); } /* * skip whitespace and return the following word */ static unsigned int xpmNextWord ARGLIST((mdata, buf)) ARG(bxxpmData *, mdata) GRA(char *, buf) { register unsigned int n = 0; int c; switch (mdata->type) { case BXXPMARRAY: while (isspace(c = *mdata->cptr) && c != mdata->Eos) mdata->cptr++; do { c = *mdata->cptr++; buf[n++] = c; } while (!isspace(c) && c != mdata->Eos && c != '\0'); n--; mdata->cptr--; break; case BXXPMFILE: case BXXPMPIPE: while (isspace(c = xpmGetC(mdata)) && c != mdata->Eos); while (!isspace(c) && c != mdata->Eos && c != EOF) { buf[n++] = c; c = xpmGetC(mdata); } xpmUngetC(c, mdata); break; } return (n); } static int BxXpmVisualType ARGLIST((visual)) GRA(Visual *, visual) { #if defined(__cplusplus) || defined(c_plusplus) switch ( visual->c_class ) #else switch ( visual->class ) #endif { case StaticGray: case GrayScale: switch (visual->map_entries) { case 2: return (BXMONO); case 4: return (BXGRAY4); default: return (BXGRAY); } default: return (BXCOLOR); } } /* * Free the computed color table */ static void xpmFreeColorTable ARGLIST((colorTable, ncolors)) ARG(char ***, colorTable) GRA(int, ncolors) { int a, b; if (colorTable) { for (a = 0; a < ncolors; a++) if (colorTable[a]) { for (b = 0; b < (BXNKEYS + 1); b++) if (colorTable[a][b]) free(colorTable[a][b]); free((char *)colorTable[a]); } free((char *)colorTable); } } #else /* USE_XPM_LIBRARY */ #include #define BxXpmColorError XpmColorError #define BxXpmSuccess XpmSuccess #define BxXpmOpenFailed XpmOpenFailed #define BxXpmFileInvalid XpmFileInvalid #define BxXpmNoMemory XpmNoMemory #define BxXpmColorFailed XpmColorFailed #define BxXpmVisual XpmVisual #define BxXpmColormap XpmColormap #define BxXpmDepth XpmDepth #define BxXpmSize XpmSize #define BxXpmHotspot XpmHotspot #define BxXpmCharsPerPixel XpmCharsPerPixel #define BxXpmColorSymbols XpmColorSymbols #define BxXpmRgbFilename XpmRgbFilename #define BxXpmInfos XpmInfos #define BxXpmReturnPixels XpmReturnPixels #define BxXpmReturnInfos XpmReturnInfos typedef XpmAttributes BxXpmAttributes; #endif /* USE_XPM_LIBRARY */ Pixmap XPM_PIXMAP ARGLIST((w, pixmapName)) ARG(Widget, w) GRA(char **, pixmapName) { BxXpmAttributes attributes; int argcnt; Arg args[10]; Pixmap pixmap; Pixmap shape; int returnValue; argcnt = 0; XtSetArg(args[argcnt], XmNdepth, &(attributes.depth)); argcnt++; XtSetArg(args[argcnt], XmNcolormap, &(attributes.colormap)); argcnt++; XtGetValues(w, args, argcnt); attributes.visual = DefaultVisual(XtDisplay(w), DefaultScreen(XtDisplay(w))); attributes.valuemask = (BxXpmDepth | BxXpmColormap | BxXpmVisual); returnValue = XpmCreatePixmapFromData(XtDisplay(w), DefaultRootWindow(XtDisplay(w)), pixmapName, &pixmap, &shape, &attributes); if ( shape ) { XFreePixmap(XtDisplay(w), shape); } switch(returnValue) { case BxXpmOpenFailed: case BxXpmFileInvalid: case BxXpmNoMemory: case BxXpmColorFailed: XtWarning("Could not create pixmap."); return(XmUNSPECIFIED_PIXMAP); default: return(pixmap); } } #endif /* This structure is for capturing app-defaults values for a Class */ typedef struct _UIAppDefault { char* cName; /* Class name */ char* wName; /* Widget name */ char* cInstName; /* Name of class instance(nested) */ char* wRsc; /* Widget resource */ char* value; /* value read from app-defaults */ } UIAppDefault; void setDefaultResources ARGLIST((_name, w, resourceSpec)) ARG(char*, _name) ARG(Widget, w) GRA(String *,resourceSpec) { int i; Display *dpy = XtDisplay ( w ); /* Retrieve the display pointer */ XrmDatabase rdb = NULL; /* A resource data base */ /* Create an empty resource database */ rdb = XrmGetStringDatabase ( "" ); /* Add the Component resources, prepending the name of the component */ i = 0; while ( resourceSpec[i] != NULL ) { char buf[1000]; sprintf(buf, "*%s%s", _name, resourceSpec[i++]); XrmPutLineResource( &rdb, buf ); } /* Merge them into the Xt database, with lowest precendence */ if ( rdb ) { #if (XlibSpecificationRelease>=5) XrmDatabase db = XtDatabase(dpy); XrmCombineDatabase(rdb, &db, FALSE); #else XrmMergeDatabases ( dpy->db, &rdb ); dpy->db = rdb; #endif } } /* * This method gets all the resources from the app-defaults file * (resource databse) and fills in the table (defs) if the app default * value exists. */ void InitAppDefaults ARGLIST((parent, defs)) ARG(Widget, parent) GRA(UIAppDefault *, defs) { XrmQuark cQuark; XrmQuark rsc[6]; XrmRepresentation rep; XrmValue val; XrmDatabase rdb; int rscIdx; /* Get the database */ if ((rdb = XrmGetDatabase(XtDisplay(parent))) == NULL) { return; /* Can't get the database */ } /* Look for each resource in the table */ while (defs->wName) { rscIdx = 0; cQuark = XrmStringToQuark(defs->cName); /* class quark */ rsc[rscIdx++] = cQuark; if (defs->wName[0] == '\0') { rsc[rscIdx++] = cQuark; } else { rsc[rscIdx++] = XrmStringToQuark(defs->wName); } if (defs->cInstName && defs->cInstName[0] != '\0') { rsc[rscIdx++] = XrmStringToQuark(defs->cInstName); } rsc[rscIdx++] = XrmStringToQuark(defs->wRsc); rsc[rscIdx++] = NULLQUARK; if (XrmQGetResource(rdb, rsc, rsc, &rep, &val)) { defs->value = strdup((char*)val.addr); } defs++; } } /* * This method applies the app defaults for the class to a specific * instance. All the widgets in the path are loosly coupled (use *). * To override a specific instance, use a tightly coupled app defaults * resource line (use .). */ void SetAppDefaults ARGLIST((w, defs, inst_name)) ARG(Widget,w) ARG(UIAppDefault*, defs) GRA(char*, inst_name) { Display* dpy = XtDisplay ( w ); /* Retrieve the display */ XrmDatabase rdb = NULL; /* A resource data base */ char lineage[1000]; char buf[1000]; Widget parent; /* Protect ourselves */ if (inst_name == NULL) return; /* Create an empty resource database */ rdb = XrmGetStringDatabase ( "" ); /* Start the lineage with our name and then get our parents */ sprintf(lineage, "*%s", inst_name); parent = w; while (parent) { WidgetClass wclass = XtClass(parent); if (wclass == applicationShellWidgetClass) break; strcpy(buf, lineage); sprintf(lineage, "*%s%s", XtName(parent), buf); parent = XtParent(parent); } /* Add the Component resources, prepending the name of the component */ while (defs->wName != NULL) { /* * We don't deal with the resource if it isn't found in the * Xrm database at class initializtion time (in initAppDefaults). */ if (defs->value == NULL) { defs++; continue; } /* Build up string after lineage */ if (defs->cInstName != NULL) { /* Don't include class instance name if it is also the instance */ /* being affected. */ if (*defs->cInstName != '\0') { sprintf(buf, "%s.%s*%s.%s: %s", lineage, defs->wName, defs->cInstName, defs->wRsc, defs->value); } else { sprintf(buf, "%s.%s.%s: %s", lineage, defs->wName, defs->wRsc, defs->value); } } else if (*defs->wName != '\0') { sprintf(buf, "%s*%s.%s: %s", lineage, defs->wName, defs->wRsc, defs->value); } else { sprintf(buf, "%s.%s: %s", lineage, defs->wRsc, defs->value); } XrmPutLineResource( &rdb, buf ); defs++; } /* Merge them into the Xt database, with lowest precendence */ if ( rdb ) { #if (XlibSpecificationRelease >= 5) XrmDatabase db = XtDatabase(dpy); XrmCombineDatabase(rdb, &db, FALSE); #else XrmMergeDatabases ( dpy->db, &rdb ); dpy->db = rdb; #endif } } motif-2.3.8/demos/programs/TabStack/Makefile.am0000644000175000017500000000061413145162623016260 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Tabstack datadir = ${prefix}/share/Xm/Tabstack bin_PROGRAMS = tabstack tabstack_SOURCES = bxutils.c callbacks.c creation.c main.c creation.h EXTRA_DIST = data_DATA = $(tabstack_SOURCES) $(EXTRA_DIST) TOPDIR = ../../.. LDADD = $(TOPDIR)/lib/Xm/libXm.la INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/TabStack/creation.c0000644000175000017500000006204513150162634016200 00000000000000/* * WARNING: This file is overwritten at code generation time. * Any changes to this file will be lost. */ /* * Generated by the ICS Builder Xcessory (BX). * * * Builder Xcessory 3.5.1. * */ #include #include #include #include #include #include #include #include #include #include #include /* * Globally included information. */ /* * Common constant and pixmap declarations. */ #include "creation.h" /* * Convenience functions from utilities file. */ extern void RegisterBxConverters(XtAppContext); extern XtPointer CONVERT(Widget, char *, char *, int, Boolean *); extern XtPointer DOUBLE(double); extern XtPointer SINGLE(float); extern void MENU_POST(Widget, XtPointer, XEvent *, Boolean *); extern Pixmap XPM_PIXMAP(Widget, char**); extern void SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal*, Pixel); /* * Declarations for callbacks and handlers. */ void BxExitCB(Widget, XtPointer, XtPointer); void BxSetValuesCB(Widget, XtPointer, XtPointer); /* * Create the form hierarchy of widgets. */ Widget Createform(Widget parent) { Arg args[256]; Cardinal ac=0; Boolean argok=False; Widget form; Widget tabStack; Widget scrolledWindow; Widget text; Widget form1; Widget frame; Widget form2; Widget radioBox1; Widget toggleButton4; Widget toggleButton5; Widget toggleButton6; Widget label4; Widget radioBox; Widget toggleButton; Widget toggleButton1; Widget toggleButton2; Widget toggleButton3; Widget label3; Widget tabStack1; Widget label; Widget label1; Widget label2; Widget separator; Widget pushButton; /* * Register the converters for the widgets. */ RegisterBxConverters(XtWidgetToApplicationContext(parent)); XtInitializeWidgetClass(xmFormWidgetClass); XtInitializeWidgetClass(xmTabStackWidgetClass); XtInitializeWidgetClass(xmScrolledWindowWidgetClass); XtInitializeWidgetClass(xmTextWidgetClass); XtInitializeWidgetClass(xmFrameWidgetClass); XtInitializeWidgetClass(xmRowColumnWidgetClass); XtInitializeWidgetClass(xmToggleButtonWidgetClass); XtInitializeWidgetClass(xmLabelWidgetClass); XtInitializeWidgetClass(xmSeparatorWidgetClass); XtInitializeWidgetClass(xmPushButtonWidgetClass); ac = 0; XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++; XtSetArg(args[ac], XmNdialogTitle, CONVERT(parent, "EnhancementPak TabStack Demo", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNx, 333); ac++; XtSetArg(args[ac], XmNy, 277); ac++; XtSetArg(args[ac], XmNwidth, 839); ac++; XtSetArg(args[ac], XmNheight, 508); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; form = XmCreateForm(parent, "form", args, ac); ac = 0; XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++; XtSetArg(args[ac], XmNx, 10); ac++; XtSetArg(args[ac], XmNy, 10); ac++; XtSetArg(args[ac], XmNwidth, 818); ac++; XtSetArg(args[ac], XmNheight, 436); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; tabStack = XmCreateTabStack(form, "tabStack", args, ac); XtManageChild(tabStack); ac = 0; XtSetArg(args[ac], XmNscrollingPolicy, XmAPPLICATION_DEFINED); ac++; XtSetArg(args[ac], XmNx, -794); ac++; XtSetArg(args[ac], XmNy, 56); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; scrolledWindow = XmCreateScrolledWindow(tabStack, "scrolledWindow", args, ac); XtManageChild(scrolledWindow); ac = 0; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "LightBlue", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNvalue, "The XmTabStack widget manages a group of widgets such that only one widget\n\ in the group is visible at a time. Each child is associated with a \"tab\"\n\ that displays a text label and/or a pixmap. By selecting the \"tab\" the user\n\ interactively determines which child is displayed. This widget exhibits\n\ behavior similar to the Microsoft Windows(TM) Tab Control.\n\ \n\ The tabs can be configured to appear above, below, to the right, and to the\n\ left of a work area with the text oriented in any of the four cardinal\n\ directions.\n\ \n\ The TabStack allows the user to select, either by pointer or keyboard\n\ traversal, tabs. When a tab is selected it changes appearance so that it\n\ appears to be raised above the other tabs. When a tab is selected the\n\ child associated with the tab is made visible. One tab is selected at all\n\ times."); ac++; XtSetArg(args[ac], XmNeditMode, XmMULTI_LINE_EDIT); ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; text = XmCreateText(scrolledWindow, "text", args, ac); XtManageChild(text); ac = 0; XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++; XtSetArg(args[ac], XmNx, 12); ac++; XtSetArg(args[ac], XmNy, 56); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; form1 = XmCreateForm(tabStack, "form1", args, ac); XtManageChild(form1); ac = 0; XtSetArg(args[ac], XmNshadowType, XmSHADOW_IN); ac++; XtSetArg(args[ac], XmNx, 484); ac++; XtSetArg(args[ac], XmNy, 10); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; frame = XmCreateFrame(form1, "frame", args, ac); XtManageChild(frame); ac = 0; XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++; XtSetArg(args[ac], XmNx, 2); ac++; XtSetArg(args[ac], XmNy, 2); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; form2 = XmCreateForm(frame, "form2", args, ac); XtManageChild(form2); ac = 0; XtSetArg(args[ac], XmNisHomogeneous, False); ac++; XtSetArg(args[ac], XmNnumColumns, 2); ac++; XtSetArg(args[ac], XmNx, 89); ac++; XtSetArg(args[ac], XmNy, 89); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; radioBox1 = XmCreateRadioBox(form2, "radioBox1", args, ac); XtManageChild(radioBox1); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Round", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; toggleButton4 = XmCreateToggleButton(radioBox1, "toggleButton4", args, ac); XtManageChild(toggleButton4); XtAddCallback(toggleButton4, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabStyle=rounded"); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Beveled", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNset, True); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; toggleButton5 = XmCreateToggleButton(radioBox1, "toggleButton5", args, ac); XtManageChild(toggleButton5); XtAddCallback(toggleButton5, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabStyle=beveled"); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Square", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; toggleButton6 = XmCreateToggleButton(radioBox1, "toggleButton6", args, ac); XtManageChild(toggleButton6); XtAddCallback(toggleButton6, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabStyle=squared"); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Corners:", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNx, 10); ac++; XtSetArg(args[ac], XmNy, 89); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; label4 = XmCreateLabel(form2, "label4", args, ac); XtManageChild(label4); ac = 0; XtSetArg(args[ac], XmNisHomogeneous, False); ac++; XtSetArg(args[ac], XmNnumColumns, 2); ac++; XtSetArg(args[ac], XmNx, 92); ac++; XtSetArg(args[ac], XmNy, 10); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; radioBox = XmCreateRadioBox(form2, "radioBox", args, ac); XtManageChild(radioBox); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Top", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNset, True); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; toggleButton = XmCreateToggleButton(radioBox, "toggleButton", args, ac); XtManageChild(toggleButton); XtAddCallback(toggleButton, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=top"); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Bottom", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; toggleButton1 = XmCreateToggleButton(radioBox, "toggleButton1", args, ac); XtManageChild(toggleButton1); XtAddCallback(toggleButton1, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=bottom"); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Right", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; toggleButton2 = XmCreateToggleButton(radioBox, "toggleButton2", args, ac); XtManageChild(toggleButton2); XtAddCallback(toggleButton2, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=right"); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Left", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; toggleButton3 = XmCreateToggleButton(radioBox, "toggleButton3", args, ac); XtManageChild(toggleButton3); XtAddCallback(toggleButton3, XmNvalueChangedCallback, BxSetValuesCB, (XtPointer)"tabStack1.tabSide=left"); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Tabs On:", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNx, 10); ac++; XtSetArg(args[ac], XmNy, 10); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; label3 = XmCreateLabel(form2, "label3", args, ac); XtManageChild(label3); ac = 0; XtSetArg(args[ac], XmNresizePolicy, XmRESIZE_GROW); ac++; XtSetArg(args[ac], XmNheight, 276); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; tabStack1 = XmCreateTabStack(form1, "tabStack1", args, ac); XtManageChild(tabStack1); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, ":::t\"Sample TabStack\"\"Label One\"", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNx, 12); ac++; XtSetArg(args[ac], XmNy, 50); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; label = XmCreateLabel(tabStack1, "label", args, ac); XtManageChild(label); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, ":::t\"Sample TabStack\"\"Label Two\"", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNx, -441); ac++; XtSetArg(args[ac], XmNy, 50); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; label1 = XmCreateLabel(tabStack1, "label1", args, ac); XtManageChild(label1); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, ":::t\"Sample TabStack\"\"Label Three\"", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNx, -441); ac++; XtSetArg(args[ac], XmNy, 50); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; label2 = XmCreateLabel(tabStack1, "label2", args, ac); XtManageChild(label2); ac = 0; XtSetArg(args[ac], XmNx, 9); ac++; XtSetArg(args[ac], XmNy, 456); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; separator = XmCreateSeparator(form, "separator", args, ac); XtManageChild(separator); ac = 0; XtSetArg(args[ac], XmNlabelString, CONVERT(parent, "Quit", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNx, 784); ac++; XtSetArg(args[ac], XmNy, 468); ac++; XtSetArg(args[ac], XmNbackground, CONVERT(parent, "#ccc", XmRPixel, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNfontList, CONVERT(parent, "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1", XmRFontList, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNforeground, CONVERT(parent, "Black", XmRPixel, 0, &argok)); if (argok) ac++; pushButton = XmCreatePushButton(form, "pushButton", args, ac); XtManageChild(pushButton); XtAddCallback(pushButton, XmNactivateCallback, BxExitCB, (XtPointer)0); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNbottomWidget, separator); ac++; XtSetArg(args[ac], XmNtopOffset, 10); ac++; XtSetArg(args[ac], XmNbottomOffset, 10); ac++; XtSetArg(args[ac], XmNleftOffset, 10); ac++; XtSetArg(args[ac], XmNrightOffset, 11); ac++; XtSetValues(tabStack, args, ac); ac = 0; XtSetArg(args[ac], XmNtabLabelString, CONVERT(parent, "Description", XmRXmString, 0, &argok)); if (argok) ac++; XtSetValues(scrolledWindow, args, ac); ac = 0; XtSetArg(args[ac], XmNtabLabelString, CONVERT(parent, "Resources", XmRXmString, 0, &argok)); if (argok) ac++; XtSetArg(args[ac], XmNtabLabelPixmap, XPM_PIXMAP(parent, allviewpix_icon)); ac++; XtSetValues(form1, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++; XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNtopOffset, 10); ac++; XtSetArg(args[ac], XmNbottomOffset, 10); ac++; XtSetArg(args[ac], XmNrightOffset, 10); ac++; XtSetValues(frame, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_NONE); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_POSITION); ac++; XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNtopWidget, radioBox); ac++; XtSetArg(args[ac], XmNleftPosition, 30); ac++; XtSetArg(args[ac], XmNtopOffset, 10); ac++; XtSetArg(args[ac], XmNbottomOffset, 0); ac++; XtSetArg(args[ac], XmNrightOffset, 10); ac++; XtSetValues(radioBox1, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNtopWidget, radioBox1); ac++; XtSetArg(args[ac], XmNbottomWidget, radioBox1); ac++; XtSetArg(args[ac], XmNtopOffset, 0); ac++; XtSetArg(args[ac], XmNbottomOffset, 0); ac++; XtSetArg(args[ac], XmNleftOffset, 10); ac++; XtSetValues(label4, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_POSITION); ac++; XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNleftPosition, 31); ac++; XtSetArg(args[ac], XmNtopOffset, 10); ac++; XtSetArg(args[ac], XmNrightOffset, 10); ac++; XtSetValues(radioBox, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNtopWidget, radioBox); ac++; XtSetArg(args[ac], XmNbottomWidget, radioBox); ac++; XtSetArg(args[ac], XmNtopOffset, 0); ac++; XtSetArg(args[ac], XmNbottomOffset, 0); ac++; XtSetArg(args[ac], XmNleftOffset, 10); ac++; XtSetValues(label3, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++; XtSetArg(args[ac], XmNrightWidget, frame); ac++; XtSetArg(args[ac], XmNtopOffset, 10); ac++; XtSetArg(args[ac], XmNbottomOffset, 82); ac++; XtSetArg(args[ac], XmNleftOffset, 9); ac++; XtSetArg(args[ac], XmNrightOffset, 10); ac++; XtSetValues(tabStack1, args, ac); ac = 0; XtSetArg(args[ac], XmNtabLabelString, CONVERT(parent, "One", XmRXmString, 0, &argok)); if (argok) ac++; XtSetValues(label, args, ac); ac = 0; XtSetArg(args[ac], XmNtabLabelString, CONVERT(parent, "Two", XmRXmString, 0, &argok)); if (argok) ac++; XtSetValues(label1, args, ac); ac = 0; XtSetArg(args[ac], XmNtabLabelString, CONVERT(parent, "Three", XmRXmString, 0, &argok)); if (argok) ac++; XtSetValues(label2, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNbottomWidget, pushButton); ac++; XtSetArg(args[ac], XmNbottomOffset, 10); ac++; XtSetArg(args[ac], XmNleftOffset, 9); ac++; XtSetArg(args[ac], XmNrightOffset, 10); ac++; XtSetValues(separator, args, ac); ac = 0; XtSetArg(args[ac], XmNtopAttachment, XmATTACH_NONE); ac++; XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNleftAttachment, XmATTACH_NONE); ac++; XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(args[ac], XmNbottomOffset, 10); ac++; XtSetArg(args[ac], XmNrightOffset, 10); ac++; XtSetValues(pushButton, args, ac); return( form ); } motif-2.3.8/demos/programs/TabStack/creation.h0000644000175000017500000000207013066310437016177 00000000000000/* * WARNING: This file is overwritten at code generation time. * Any changes to this file will be lost. */ /* * * This constant file generated by Builder Xcessory 3.5.1. * */ #ifndef creation_H #define creation_H #define allviewpix allviewpix_icon static char * allviewpix_icon[] = { "24 24 3 1", ". c #c0cc0cc0c", "X c #000", "o c #6363b8b8ffff", ".....XXXXX....XXXXX.....", "...XXoooooXXXXoooooXX...", "..XooooooooXXooooooooX..", ".XoXXXooooXooXooooXXooX.", ".XoXooXoooXooXoooXooXoX.", "XooXooXooXooooXooXoooooX", "XooXXXoooXooooXoooXXoooX", "XooXoooooXooooXoooooXooX", "XooXoooooXooooXooXooXooX", "XooXoooooXXXXXXoooXXoooX", ".XooooooXXXooXoXXoooooX.", ".XoooooXooXooXoooXooooX.", "..XoooXooooXXoooooXooX..", "...XXoXoooXXXXooooXXX...", ".....XXXXXooooXXXXXX....", ".....XoooooooooooooX....", ".....XoooXoooooXoooX....", ".....XoooXXoooXXoooX....", ".....XoooXoXoXoXoooX....", "......XooXooXooXooX.....", "......XooXoooooXooX.....", ".......XoooooooooX......", "........XXoooooXX.......", "..........XXXXX........." }; extern Widget Createform(Widget parent); #endif motif-2.3.8/demos/programs/Makefile.am0000644000175000017500000000126213145162623014564 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = airport \ animate \ drag_and_drop \ draw \ earth \ filemanager \ fileview \ getsubres \ hellomotif \ i18ninput \ panner \ periodic \ piano \ popups \ sampler2_0 \ setdate \ Exm \ todo \ workspace \ hellomotifi18n \ tooltips \ ButtonBox \ Column \ FontSel \ Outline \ TabStack \ Tree \ ColorSel \ Combo2 \ Ext18List \ IconB \ Paned \ pixmaps EXTRA_DIST = motif-2.3.8/demos/programs/Exm/0000755000175000017500000000000013211513007013326 500000000000000motif-2.3.8/demos/programs/Exm/simple_app/0000755000175000017500000000000013211513007015457 500000000000000motif-2.3.8/demos/programs/Exm/simple_app/Makefile.in0000644000175000017500000006102313211512766017461 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = simpleDemo$(EXEEXT) subdir = demos/programs/Exm/simple_app ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(manmdir)" \ "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_simpleDemo_OBJECTS = simpleDemo.$(OBJEXT) simpleDemo_OBJECTS = $(am_simpleDemo_OBJECTS) simpleDemo_LDADD = $(LDADD) simpleDemo_DEPENDENCIES = ../../../../lib/Xm/libXm.la \ ../../../lib/Exm/libExm.a AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(simpleDemo_SOURCES) DIST_SOURCES = $(simpleDemo_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } manmdir = $(mandir)/manm NROFF = nroff MANS = $(man_MANS) DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Exm/simple_app build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Exm/simple_app datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in data_DATA = README man_MANS = simpleDemo.man simpleDemo_SOURCES = simpleDemo.c EXTRA_DIST = simpleDemo.man README INCLUDES = -I$(srcdir)/../../../../lib \ -I$(srcdir)/../../../lib \ -I$(top_builddir)/lib \ ${X_CFLAGS} LDADD = ../../../../lib/Xm/libXm.la \ ../../../lib/Exm/libExm.a all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Exm/simple_app/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Exm/simple_app/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list simpleDemo$(EXEEXT): $(simpleDemo_OBJECTS) $(simpleDemo_DEPENDENCIES) $(EXTRA_simpleDemo_DEPENDENCIES) @rm -f simpleDemo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(simpleDemo_OBJECTS) $(simpleDemo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleDemo.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-manm: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(manmdir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(manmdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(manmdir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.m[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^m][0-9a-z]*$$,m,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(manmdir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(manmdir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(manmdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(manmdir)" || exit $$?; }; \ done; } uninstall-manm: @$(NORMAL_UNINSTALL) @list=''; test -n "$(manmdir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.m[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^m][0-9a-z]*$$,m,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(manmdir)'; $(am__uninstall_files_from_dir) install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(manmdir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-manm install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA uninstall-man uninstall-man: uninstall-manm .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-manm install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-dataDATA \ uninstall-man uninstall-manm .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Exm/simple_app/simpleDemo.man0000644000175000017500000000274112672140200020177 00000000000000.\" $XConsortium: simpleDemo.man /main/4 1995/07/17 10:46:28 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH simpleDemo 1X MOTIF "Demonstration programs" .SH NAME \*LsimpleDemo\*O\(emDemonstrates how to use the ExmSimple demonstration widget in a simple application .SH SYNOPSIS .sS \*LsimpleDemo\*O .sE .SH DESCRIPTION \*LsimpleDemo\*O illustrates how to use an ExmSimple demonstration widget in an application. Actually, simpleDemo instantiates four ExmSimple widgets, each one using different combinations of resources. .PP For details on the code, see Chapter 2 of the "OSF/Motif Widget Writer's Guide." motif-2.3.8/demos/programs/Exm/simple_app/README0000644000175000017500000000064512672140200016265 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:01:22 drk $ */ README File for simpleDemo Example The simpleDemo example demonstrates how to instantiate the ExmSimple demonstration widget in a C application. To build the program, just type $ make To run the program, just type: $ simpleDemo For an explanation of how this program works, see Chapter 2 of the "OSF/Motif Widget Writer's Guide." motif-2.3.8/demos/programs/Exm/simple_app/simpleDemo.c0000644000175000017500000001335513066310437017662 00000000000000/* $XConsortium: simpleDemo.c /main/5 1995/07/15 20:44:25 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /**************************************************************************** **************************************************************************** ** ** File: simpleDemo.c ** ** Description: C program to demonstrate the ExmSimple widget. ** **************************************************************************** ****************************************************************************/ #include /* Standard C headers */ #include #include #include /* X headers */ #include /* Xm headers */ #include #include #include #include #include #include #include #include #include #include #include /* Definitions. */ #define APP_CLASS "XMdemo" /******************************************************************************* exercise_ExmSimple: Realize four ExmSimple widgets. *******************************************************************************/ void exercise_ExmSimple(Widget parent) { Widget simpleWidget1, simpleWidget2, simpleWidget3, simpleWidget4; /* Instantiate a default ExmSimple widget; the default shape is an oval. */ simpleWidget1 = XtVaCreateManagedWidget("Simple1", exmSimpleWidgetClass, parent, NULL); /* Override the default shape; draw a rectangle instead. */ simpleWidget2 = XtVaCreateManagedWidget("Simple2", exmSimpleWidgetClass, parent, ExmNsimpleShape, ExmSHAPE_RECTANGLE, NULL); /* Override the default shadow thickness and margin width. */ simpleWidget3 = XtVaCreateManagedWidget("Simple3", exmSimpleWidgetClass, parent, ExmNsimpleShape, ExmSHAPE_OVAL, XmNshadowThickness, 14, XmNmarginWidth, 9, NULL); /* Experiment with a different unit type. */ simpleWidget4 = XtVaCreateManagedWidget("Simple4", exmSimpleWidgetClass, parent, ExmNsimpleShape, ExmSHAPE_RECTANGLE, XmNunitType, Xm100TH_MILLIMETERS, XmNmarginHeight, 1000, NULL); } /******************************************************************************* QuitCB: Exit the program when the user selects 'Quit' *******************************************************************************/ void QuitCB(Widget w, XtPointer ignore, XtPointer cbstruct) { exit(0); } /******************************************************************************* main: Set up the application, including the mainWindow and menuBar. *******************************************************************************/ int main (int argc, char **argv) { Display *display; Widget shell, mainWindow, workRegion, menuBar, cascade, menuitem, menu; XtAppContext AppContext; XmString str; /* Do standard Motif application start-up. */ XtToolkitInitialize(); AppContext = XtCreateApplicationContext(); if ((display = XtOpenDisplay (AppContext, NULL, argv[0], APP_CLASS, NULL, 0, &argc, argv)) == NULL) { fprintf (stderr,"\n%s: Can't open display\n", argv[0]); exit(1); } shell = XtVaAppCreateShell(argv[0], APP_CLASS, applicationShellWidgetClass, display, XmNallowShellResize, True, NULL); mainWindow = XtVaCreateManagedWidget("myMainWindow", xmMainWindowWidgetClass, shell, NULL); /* Create a menu bar with one simple menu. */ menuBar = XmCreateMenuBar(mainWindow, "menuBar", NULL, 0); XtManageChild(menuBar); cascade = XmCreateCascadeButtonGadget(menuBar, "File", NULL, 0); XtManageChild(cascade); menu = XmCreatePulldownMenu(menuBar, "FileMenu", NULL, 0); XtVaSetValues(cascade, XmNsubMenuId, menu, NULL); str = XmStringCreateLocalized("Quit"); menuitem = XtVaCreateManagedWidget("item", xmPushButtonWidgetClass, menu, XmNlabelString, str, NULL); XmStringFree(str); XtAddCallback(menuitem, XmNactivateCallback, QuitCB, NULL); /* Create a XmRowColumn widget; the ExmSimple widgets will ultimately be managed by this XmRowColumn. */ workRegion = XtVaCreateManagedWidget("myWorkRegion", xmRowColumnWidgetClass, mainWindow, NULL); exercise_ExmSimple(workRegion); XtRealizeWidget(shell); XtAppMainLoop(AppContext); return 0; /* make compiler happy */ } motif-2.3.8/demos/programs/Exm/simple_app/Makefile.am0000644000175000017500000000073413145162623017451 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Exm/simple_app datadir = ${prefix}/share/Xm/Exm/simple_app data_DATA = README man_MANS = simpleDemo.man bin_PROGRAMS = simpleDemo simpleDemo_SOURCES = simpleDemo.c EXTRA_DIST = simpleDemo.man README INCLUDES = -I$(srcdir)/../../../../lib \ -I$(srcdir)/../../../lib \ -I$(top_builddir)/lib \ ${X_CFLAGS} LDADD = ../../../../lib/Xm/libXm.la \ ../../../lib/Exm/libExm.a motif-2.3.8/demos/programs/Exm/app_in_c/0000755000175000017500000000000013211513007015076 500000000000000motif-2.3.8/demos/programs/Exm/app_in_c/Makefile.in0000644000175000017500000005706513211512766017113 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = exm_in_c$(EXEEXT) subdir = demos/programs/Exm/app_in_c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(manmdir)" PROGRAMS = $(bin_PROGRAMS) am_exm_in_c_OBJECTS = exm_in_c.$(OBJEXT) exm_in_c_OBJECTS = $(am_exm_in_c_OBJECTS) exm_in_c_LDADD = $(LDADD) exm_in_c_DEPENDENCIES = ../../../lib/Exm/libExm.a \ ../../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(exm_in_c_SOURCES) DIST_SOURCES = $(exm_in_c_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } manmdir = $(mandir)/manm NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/Exm/app_in_c build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/Exm/app_in_c datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in man_MANS = exm_in_c.man exm_in_c_SOURCES = exm_in_c.c EXTRA_DIST = exm_in_c.man INCLUDES = -I$(srcdir)/../../../../lib \ -I$(srcdir)/../../../lib \ -I$(top_builddir)/lib \ ${X_CFLAGS} LDADD = ../../../lib/Exm/libExm.a \ ../../../../lib/Xm/libXm.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Exm/app_in_c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Exm/app_in_c/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list exm_in_c$(EXEEXT): $(exm_in_c_OBJECTS) $(exm_in_c_DEPENDENCIES) $(EXTRA_exm_in_c_DEPENDENCIES) @rm -f exm_in_c$(EXEEXT) $(AM_V_CCLD)$(LINK) $(exm_in_c_OBJECTS) $(exm_in_c_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exm_in_c.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-manm: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(manmdir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(manmdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(manmdir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.m[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^m][0-9a-z]*$$,m,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(manmdir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(manmdir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(manmdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(manmdir)" || exit $$?; }; \ done; } uninstall-manm: @$(NORMAL_UNINSTALL) @list=''; test -n "$(manmdir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.m[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^m][0-9a-z]*$$,m,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(manmdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(manmdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-manm install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-manm .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-manm \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-manm .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Exm/app_in_c/exm_in_c.man0000644000175000017500000000252212672140200017276 00000000000000.\" $XConsortium: exm_in_c.man /main/4 1995/07/17 10:46:14 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH exm_in_c 1X MOTIF "Demonstration programs" .SH NAME \*Lexm_in_c\*O\(emDemonstrates how to use all Exm demonstration widgets in an application .SH SYNOPSIS .sS \*Lexm_in_c\*O .sE .SH DESCRIPTION \*Lexm_in_c\*O illustrates how to use all eight Exm demonstration widgets in a C application. .PP For details on the code, see the "OSF/Motif Widget Writer's Guide." motif-2.3.8/demos/programs/Exm/app_in_c/README0000644000175000017500000000064312672140200015702 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:00:46 drk $ */ README File for exm_in_c Example The exm_in_c example demonstrates how to instantiate all the Exm demonstration widgets in a C application. To build the program, just type $ make To run the program, just type: $ exm_in_c For an explanation of each of the Exm demonstration widgets, see the "OSF/Motif Widget Writer's Guide." motif-2.3.8/demos/programs/Exm/app_in_c/Makefile.am0000644000175000017500000000065613145162623017073 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/Exm/app_in_c datadir = ${prefix}/share/Xm/Exm/app_in_c man_MANS = exm_in_c.man bin_PROGRAMS = exm_in_c exm_in_c_SOURCES = exm_in_c.c EXTRA_DIST = exm_in_c.man INCLUDES = -I$(srcdir)/../../../../lib \ -I$(srcdir)/../../../lib \ -I$(top_builddir)/lib \ ${X_CFLAGS} LDADD = ../../../lib/Exm/libExm.a \ ../../../../lib/Xm/libXm.la motif-2.3.8/demos/programs/Exm/app_in_c/exm_in_c.c0000644000175000017500000004764713066310437016777 00000000000000/* $XConsortium: exm_in_c.c /main/5 1995/07/15 20:44:17 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /******************************************************************************* * * AllExmDemo.c: This is a sample application written in C that instantiates * all of the Exm widgets. * ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void CreateMenus(Widget); void ExerciseExmSimpleWidgets(Widget); void ExerciseExmStringWidgets(Widget); void ExerciseExmStringTransferWidgets(Widget); void ExerciseExmCommandButtonWidgets(Widget); void ExerciseExmTabButtonWidget(Widget); void QuitCB(Widget, XtPointer, XtPointer); void HelpCB(Widget, XtPointer, XtPointer); void DanceCB(Widget, XtPointer, XtPointer); void YesCB(Widget, XtPointer, XtPointer); void NoCB(Widget, XtPointer, XtPointer); Widget top_level, MainWindow; enum WidgetN {SimpleH=0, StringH, StringTransferH, CommandButtonH, TabButtonH, PannerH, MenuButtonH, GridH}; int main(int argc, char **argv) { static Widget Frame1; XtAppContext app_context; Arg MainWindowArgs[6]; Arg args[12]; Cardinal n; Widget Grid; Widget Panner1; Widget Label1; top_level = XtAppInitialize(&app_context, "Test", NULL, 0, &argc, argv, NULL, NULL, 0); n=0; XtSetArg(MainWindowArgs[n], XmNscrollingPolicy, XmAUTOMATIC); n++; XtSetArg(MainWindowArgs[n], XmNwidth, 400); n++; XtSetArg(MainWindowArgs[n], XmNheight, 400); n++; MainWindow = (Widget)XmCreateMainWindow(top_level, "MainWindow", MainWindowArgs, n); XtManageChild (MainWindow); CreateMenus(MainWindow); /* An ExmGrid manager widget will manage most of the Exm primitives. */ Grid = XtVaCreateManagedWidget ("Grid", exmGridWidgetClass, MainWindow, XmNrows, 3, XmNcolumns, 4, NULL); XtAddCallback (Grid, XmNhelpCallback, HelpCB, (XtPointer)GridH); ExerciseExmSimpleWidgets(Grid); ExerciseExmStringWidgets(Grid); ExerciseExmStringTransferWidgets(Grid); ExerciseExmTabButtonWidget(Grid); /* This section exercises the ExmPanner widget. */ n=0; XtSetArg(args[n], XmNwidth, 150); n++; XtSetArg(args[n], XmNheight, 150); n++; XtSetArg(args[n], XmNscrolledWindowChildType, XmMESSAGE_WINDOW); n++; /* XtSetArg(args[n], ExmNresize, False); n++; */ Panner1 = XtCreateWidget ("Panner1", exmPannerWidgetClass, MainWindow, args, n); XtAddCallback(Panner1, XmNhelpCallback, HelpCB, (XtPointer)PannerH); XtManageChild(Panner1); { XmScrollFrameTrait sf_trait = (XmScrollFrameTrait) XmeTraitGet((XtPointer)XtClass(MainWindow), XmQTscrollFrame); sf_trait->addNavigator(MainWindow, Panner1, NavigDimensionX|NavigDimensionY); } XtRealizeWidget(top_level); XtAppMainLoop(app_context); return 0; /* make compiler happy */ } /******************************************************************************* * * CreateMenus: * This function generates the menu bar and the submenus. * It exercises the ExmMenuButton widget. * ******************************************************************************/ void CreateMenus(Widget parent_of_menu_bar) { static Widget PullDownFromFile, PullDownFromHelp; static Widget HelpWidget, menu_bar, QuitWidget; char menu_button_name[24]; static Widget MenuButtonWidget[8]; XmString file_string, quit_string, help_cs, menu_as_a_cs, acc_string; int menu_num; static char *menu_help_string[] = { "ExmSimple", "ExmString", "ExmStringTransfer", "ExmCommandButton", "ExmTabButton", "ExmPanner", "ExmMenuButton", "ExmGrid" }; static char menu_help_mnemonics[] = "ESTCBPMG"; int n; Arg args[10] ; /* Create a MenuBar in MainWindow. */ n = 0; menu_bar = (Widget)XmCreateMenuBar (parent_of_menu_bar, "menu_bar", args, n); XtManageChild (menu_bar); /* Create a context for the pulldown menu. */ n = 0; PullDownFromFile = (Widget)XmCreatePulldownMenu (menu_bar, "file_pane", args, n); /* Place the "File" cascade button at the top of the pulldown. */ file_string = XmStringCreateSimple("File"); XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, menu_bar, XmNlabelString, file_string, XmNmnemonic, 'F', XmNsubMenuId, PullDownFromFile, NULL); /* Create the entries pulled down by pressing "File" */ quit_string = XmStringCreateSimple("Quit"); acc_string = XmStringCreateSimple("Alt-q"); QuitWidget = XtVaCreateManagedWidget("Quit", exmMenuButtonWidgetClass, PullDownFromFile, ExmNcompoundString, quit_string, XmNmnemonic, 'Q', XmNacceleratorText, acc_string, XmNaccelerator, "Altq", NULL); XtAddCallback (QuitWidget, XmNactivateCallback, QuitCB, NULL); XmStringFree(file_string); XmStringFree(quit_string); XmStringFree(acc_string); /* Create "Help" PulldownMenu with Help button. */ n = 0; PullDownFromHelp = (Widget)(XmCreatePulldownMenu (menu_bar, "help_pane", args, n)); /* Place the "Help" cascade button at the top of the pulldown. */ help_cs = XmStringCreateSimple("Help"); HelpWidget = XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, menu_bar, XmNlabelString, help_cs, XmNmnemonic, 'H', XmNsubMenuId, PullDownFromHelp, NULL); /* Make sure that the "Help" button appears in the appropriate place within the menubar. */ XtVaSetValues(menu_bar, XmNmenuHelpWidget, HelpWidget, NULL); for (menu_num=0; menu_num<8; menu_num++) { char mnemonic_char; sprintf(menu_button_name, "Menu Button %d", menu_num); menu_as_a_cs = XmStringCreateSimple(menu_help_string[menu_num]); mnemonic_char = menu_help_mnemonics[menu_num]; MenuButtonWidget[menu_num] = XtVaCreateManagedWidget(menu_button_name, exmMenuButtonWidgetClass, PullDownFromHelp, ExmNcompoundString, menu_as_a_cs, XmNmnemonic, mnemonic_char, NULL); XtAddCallback (MenuButtonWidget[menu_num], XmNactivateCallback, HelpCB, (XtPointer)menu_num); XmStringFree(menu_as_a_cs); } } /******************************************************************************* * * ExerciseExmSimpleWidgets: * This function instantiates two ExmSimple widgets. * ******************************************************************************/ void ExerciseExmSimpleWidgets(Widget parent_handle) { Widget Simple1, Simple2; Arg args[10]; Cardinal n = 0; /* Instantiate two ExmSimple widgets. */ Simple1 = ExmCreateSimple(parent_handle, "Simple1", args, 0); XtAddCallback(Simple1, XmNhelpCallback, HelpCB, (XtPointer)SimpleH); Simple2 = ExmCreateSimple(parent_handle, "Simple3", args, 0); XtVaSetValues (Simple2, ExmNsimpleShape, ExmSHAPE_RECTANGLE, XmNunitType, Xm100TH_MILLIMETERS, XmNsensitive, False, XmNmarginWidth, 300, XmNmarginHeight, 2000, NULL); XtAddCallback(Simple2, XmNhelpCallback, HelpCB, (XtPointer)SimpleH); XtManageChild(Simple1); XtManageChild(Simple2); } /******************************************************************************* * * ExerciseExmStringWidgets: * This function instantiates four ExmString widgets. * ******************************************************************************/ void ExerciseExmStringWidgets(Widget parent_handle) { Widget String1, String2; XmString a_compound_string; a_compound_string = XmStringCreateLtoR("A Multiline Compound String\nIn an\n\ ExmString widget.\0", XmFONTLIST_DEFAULT_TAG); /* Instantiate two ExmString widgets. */ String1 = XtVaCreateManagedWidget("String1", exmStringWidgetClass, parent_handle, ExmNcompoundString, a_compound_string, NULL); String2 = XtVaCreateManagedWidget("String2", exmStringWidgetClass, parent_handle, XmNalignment, XmALIGNMENT_BEGINNING, ExmNcompoundString, a_compound_string, NULL); } /******************************************************************************* * * ExerciseExmStringTransferWidgets: * This function instantiates two ExmStringTransfer widgets. * ******************************************************************************/ void ExerciseExmStringTransferWidgets(Widget parent_handle) { XmString transfer_cstring_1, transfer_cstring_2; Widget StringTransfer1, StringTransfer2; transfer_cstring_1 = XmStringCreateLocalized("ExmStringTransfer 1"); transfer_cstring_2 = XmStringCreateLocalized("ExmStringTransfer 2"); StringTransfer1 = XtVaCreateManagedWidget("StringTransfer1", exmStringTransferWidgetClass, parent_handle, XmNstringDirection, XmSTRING_DIRECTION_L_TO_R, ExmNcompoundString, transfer_cstring_1, NULL); XtAddCallback(StringTransfer1, XmNhelpCallback, HelpCB, (XtPointer)StringTransferH); StringTransfer2 = XtVaCreateManagedWidget("StringTransfer2", exmStringTransferWidgetClass, parent_handle, XmNalignment, XmALIGNMENT_END, ExmNcompoundString, transfer_cstring_2, NULL); XtAddCallback(StringTransfer2, XmNhelpCallback, HelpCB, (XtPointer)StringTransferH); } /******************************************************************************* * * ExerciseExmTabButtonWidget: * This function instantiates one ExmTabButton widget and one * XmNotebook function. The ExmTabButton will serve as the tab * of the XmNotebook. * ******************************************************************************/ void ExerciseExmTabButtonWidget(Widget parent_handle) { Widget Notebook1, TabButton1; XmString tab_button_string; /* Instantiate an XmNotebook widget. */ Notebook1 = XtVaCreateManagedWidget("Notebook1", xmNotebookWidgetClass, parent_handle, NULL); /* Instantiate an ExmTabButton widget hanging off the XmNotebook. */ tab_button_string = XmStringCreateLocalized("Tab But"); TabButton1 = XtVaCreateManagedWidget("TabButton1", exmTabButtonWidgetClass, Notebook1, ExmNcompoundString, tab_button_string, ExmNopenSide, XmLEFT, NULL); XtAddCallback(TabButton1, XmNhelpCallback, HelpCB, (XtPointer)TabButtonH); } /******************************************************************************* * * ExerciseExmCommandButtonWidgets: * This function instantiates two ExmCommandButton widgets. * ******************************************************************************/ void ExerciseExmCommandButtonWidgets(Widget parent_handle) { XmString really_quit, yes, no, dance, help; Widget String1, TemplateDialog; Widget CommandButton1, CommandButton2, CommandButton3, CommandButton4; Arg arg[3]; really_quit = XmStringCreateLtoR("Do you really want to quit?\0", XmFONTLIST_DEFAULT_TAG); yes = XmStringCreateLtoR("Yes\0", XmFONTLIST_DEFAULT_TAG); no = XmStringCreateLtoR("No\0", XmFONTLIST_DEFAULT_TAG); dance = XmStringCreateLtoR("No, I want to\ndance instead.\0", XmFONTLIST_DEFAULT_TAG); help = XmStringCreateLtoR("Help\0", XmFONTLIST_DEFAULT_TAG); /* Create a MessageBox to which we can attach ExmCommandButton's. */ TemplateDialog = XmCreateTemplateDialog(parent_handle, "QuitNow?", NULL, 0); String1 = XtVaCreateManagedWidget("String1", exmStringWidgetClass, TemplateDialog, XmNshadowThickness, 0, ExmNcompoundString, really_quit, NULL); CommandButton1 = XtVaCreateManagedWidget("CommandButton1", exmCommandButtonWidgetClass, TemplateDialog, ExmNcompoundString, yes, NULL); XtAddCallback(CommandButton1, XmNactivateCallback, YesCB, NULL); XtAddCallback(CommandButton1, XmNhelpCallback, HelpCB, (XtPointer)CommandButtonH); /* Make CommandButton1 the initial default button of the MessageBox. */ XtVaSetValues(TemplateDialog, XmNdefaultButton, CommandButton1, NULL); CommandButton2 = XtVaCreateManagedWidget("CommandButton2", exmCommandButtonWidgetClass, TemplateDialog, ExmNcompoundString, no, NULL); XtAddCallback(CommandButton2, XmNactivateCallback, NoCB, NULL); XtAddCallback(CommandButton2, XmNhelpCallback, HelpCB, (XtPointer)CommandButtonH); CommandButton3 = XtVaCreateManagedWidget("CommandButton3", exmCommandButtonWidgetClass, TemplateDialog, XmNalignment, XmALIGNMENT_BEGINNING, ExmNcompoundString, dance, NULL); XtAddCallback(CommandButton3, XmNactivateCallback, DanceCB, NULL); XtAddCallback(CommandButton3, XmNhelpCallback, HelpCB, (XtPointer)CommandButtonH); CommandButton4 = XtVaCreateManagedWidget("CommandButton4", exmCommandButtonWidgetClass, TemplateDialog, ExmNcompoundString, help, NULL); XtAddCallback(CommandButton4, XmNactivateCallback, HelpCB, (XtPointer)CommandButtonH); XtAddCallback(CommandButton4, XmNhelpCallback, HelpCB, (XtPointer)CommandButtonH); XtManageChild(TemplateDialog); } /******************************************************************************* * * QuitCB: * Callback that causes application to exit. * ******************************************************************************/ void QuitCB(Widget w, XtPointer cd, XtPointer cb) { ExerciseExmCommandButtonWidgets(top_level); } /******************************************************************************* * * HelpCB: * Callback that causes application to exit. * ******************************************************************************/ void HelpCB(Widget w, XtPointer cd, XtPointer cb) { int what_kind_of_help = (int)cd; static char *messages[] = { "ExmSimple displays one oval or rectangle.\n", "ExmString displays one compound string.\n", "ExmStringTransfer demonstrates Drag and Drop.\ To transfer text between two ExmStringTransfer widgets:\n\ 1. Place the cursor anywhere inside the widget, \n\ 2. Depress M2.\n\ 3. Move the cursor to another ExmStringTransferWidget.\n\ 4. Release M2.", "ExmCommandButton displays a compound string. \n\ This widget can serve as a button inside a dialog box.", "ExmTabButton displays a compound string. It can affix itself\n\ to one side of a suitable host widget (like an XmNotebook).", "ExmPanner is a two-dimensional navigator widget.\n\ To navigate with the ExmPanner,\n\ 1. Place the cursor over the rectangular slider.\n\ 2. Depress M1.\n\ 3. Move the cursor around. As you do, the viewport will change.\n\ 4. Release M1 to stop navigating.\n\ Note that there are additional ways to navigate.", "ExmMenuButton displays a compound string. This widget can serve\n\ as a button inside a menu.", "ExmGrid is a sample Manager widget. In this application, ExmGrid\n\ manages two ExmSimple widgets, two ExmString widgets, two\n\ ExmStringTransfer widgets, and one XmNotebook widget." }; XmString message_as_a_cs; Widget help_dialog; Arg arg[3]; message_as_a_cs = XmStringCreateLtoR(messages[(int)cd], XmFONTLIST_DEFAULT_TAG); XtSetArg(arg[0], XmNmessageString, message_as_a_cs); help_dialog = XmCreateMessageDialog(top_level, "message", arg, 1); XmStringFree(message_as_a_cs); XtManageChild(help_dialog); } /******************************************************************************* * * YesCB: * Callback associated with CommandButton1. * ******************************************************************************/ void YesCB(Widget w, XtPointer cd, XtPointer cb) { exit(0); } /******************************************************************************* * * NoCB: * Callback associated with CommandButton2. * ******************************************************************************/ void NoCB(Widget w, XtPointer cd, XtPointer cb) { /* no op */ } /******************************************************************************* * * DanceCB: * Callback associated with CommandButton3. * ******************************************************************************/ void DanceCB(Widget w, XtPointer cd, XtPointer cb) { XmString everybody_dance_now; Arg arg[2]; Widget MsgBox1; everybody_dance_now = XmStringCreateSimple("Everybody Dance Now!"); XtSetArg(arg[0], XmNmessageString, everybody_dance_now); MsgBox1 = XmCreateMessageDialog(w, "MsgBox1", arg, 1); XmStringFree(everybody_dance_now); XtManageChild(MsgBox1); } motif-2.3.8/demos/programs/Exm/Makefile.in0000644000175000017500000004656213211512766015343 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/Exm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = app_in_c simple_app app_in_uil #SUBDIRS = app_in_c simple_app EXTRA_DIST = Exm.uil README all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Exm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Exm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Exm/app_in_uil/0000755000175000017500000000000013211513007015445 500000000000000motif-2.3.8/demos/programs/Exm/app_in_uil/exm_in_uil.uil0000644000175000017500000003263712672140200020244 00000000000000! $XConsortium: exm_in_uil.uil /main/4 1996/07/15 15:12:38 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY ! ! exm_in_uil.uil - Exm widget demo application UIL file. ! module exmdemo objects = { XmPushButton = gadget; } procedure ManageCb(string); LetsDanceCb(); ExitCb(); value SimpleHelpCS : compound_string ("ExmSimple displays one oval or rectangle."); StringHelpCS : compound_string ("ExmString displays one compound string."); TransferHelpCS : compound_string ("ExmStringTransfer acts as ExmString,", separate = true) & compound_string ("except that the string inside an,", separate = true) & compound_string ("ExmStringTransfer can be transferred", separate = true) & compound_string ("via primary, clipboard, or drag and drop.", separate = true); CommandHelpCS : compound_string ("ExmCommandButton displays a compound string.", separate = true) & compound_string ("This widget can serve as a button inside a dialog box."); GridHelpCS : compound_string ("ExmGrid is a sample Manager widget.", separate = true) & compound_string ("In this application, ExmGrid manages", separate = true) & compound_string ("two ExmSimple widgets, two ExmString", separate = true) & compound_string ("widgets, two ExmStringTransfer", separate = true) & compound_string ("widgets, and one XmNotebook widget.", separate = true); TabHelpCS : compound_string ("ExmTabButton displays a compound string.", separate = true) & compound_string ("It can affix itself to one side of a", separate = true) & compound_string ("(like an XmNotebook).", separate = true); PannerHelpCS : compound_string ("ExmPanner is a two-dimensional navigator.", separate = true) & compound_string ("widget. To navigate with the ExmPanner: ", separate = true) & compound_string (" 1. Place the cursor over the rectangular slider. ", separate = true) & compound_string (" 2. Press . ", separate = true) & compound_string (" 3. Move the cursor around. As you do,", separate = true) & compound_string (" the viewport will change.", separate = true) & compound_string (" 4. Press to stop navigating.", separate = true); MenuHelpCS : compound_string ("ExmMenuButton displays a compound string.", separate = true) & compound_string ("The widget can serve as a button inside", separate = true) & compound_string ("a menu.", separate = true); DanceCS : compound_string ("No, I want to", separate = true) & compound_string ("dance instead", separate = true); DanceHelpCS : compound_string ("Everybody dance now!"); a_compound_string : compound_string("A multiline compound string", separate = true) & compound_string("in an", separate = true) & compound_string("ExmString widget", separate = true); transfer_cstring_1 : compound_string ("ExmStringTransfer 1"); transfer_cstring_2 : compound_string ("ExmStringTransfer 2"); tab_button_string : compound_string ("Tab But"); !*********************************************************************** object appMain : XmMainWindow { arguments { XmNmenuBar = XmMenuBar menuBar; XmNworkWindow = XmFrame workArea; }; controls { XmMenuBar menuBar; XmFrame workArea; unmanaged XmInformationDialog SimpleHelpDialog; unmanaged XmInformationDialog StringHelpDialog; unmanaged XmInformationDialog TransferHelpDialog; unmanaged XmInformationDialog CommandHelpDialog; unmanaged XmInformationDialog TabHelpDialog; unmanaged XmInformationDialog PannerHelpDialog; unmanaged XmInformationDialog MenuHelpDialog; unmanaged XmInformationDialog GridHelpDialog; unmanaged XmInformationDialog DanceHelpDialog; unmanaged XmTemplateDialog ExitQueryDialog; }; callbacks { }; }; !*********************************************************************** object menuBar : XmMenuBar { arguments { XmNmenuHelpWidget = XmCascadeButton helpCascade; }; controls { XmCascadeButton fileCascade; XmCascadeButton helpCascade; }; }; object fileCascade : XmCascadeButton { arguments { XmNlabelString ="File"; XmNmnemonic = keysym("F"); }; controls { XmPulldownMenu { controls { ExmMenuButton exitButton; }; }; }; }; object exitButton : ExmMenuButton { arguments { ExmNcompoundString = "Exit"; XmNmnemonic = keysym("E"); }; callbacks { XmNactivateCallback = procedure ManageCb("*ExitQueryDialog"); }; }; !************************************************************* ! Design Help Pulldown !************************************************************* object helpCascade : XmCascadeButton { arguments { XmNlabelString ="Help"; XmNmnemonic = keysym("H"); }; controls { XmPulldownMenu { controls { ExmMenuButton SimpleHelpButton; ExmMenuButton StringHelpButton; ExmMenuButton TransferHelpButton; ExmMenuButton CommandHelpButton; ExmMenuButton TabHelpButton; ExmMenuButton PannerHelpButton; ExmMenuButton MenuHelpButton; ExmMenuButton GridHelpButton; }; }; }; }; object SimpleHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmSimple"; XmNmnemonic = keysym("E"); }; callbacks { XmNactivateCallback = procedure ManageCb("*SimpleHelpDialog"); }; }; object StringHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmString"; XmNmnemonic = keysym("S"); }; callbacks { XmNactivateCallback = procedure ManageCb("*StringHelpDialog"); }; }; object TransferHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmStringTransfer"; XmNmnemonic = keysym("T"); }; callbacks { XmNactivateCallback = procedure ManageCb("*TransferHelpDialog"); }; }; object CommandHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmCommand"; XmNmnemonic = keysym("C"); }; callbacks { XmNactivateCallback = procedure ManageCb("*CommandHelpDialog"); }; }; object TabHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmTabButton"; XmNmnemonic = keysym("B"); }; callbacks { XmNactivateCallback = procedure ManageCb("*TabHelpDialog"); }; }; object PannerHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmPanner"; XmNmnemonic = keysym("P"); }; callbacks { XmNactivateCallback = procedure ManageCb("*PannerHelpDialog"); }; }; object MenuHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmMenuButton"; XmNmnemonic = keysym("M"); }; callbacks { XmNactivateCallback = procedure ManageCb("*MenuHelpDialog"); }; }; object GridHelpButton : ExmMenuButton { arguments { ExmNcompoundString = "ExmGrid"; XmNmnemonic = keysym("G"); }; callbacks { XmNactivateCallback = procedure ManageCb("*GridHelpDialog"); }; }; !*********************************************************************** ! Help Callbacks. !*********************************************************************** object SimpleHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = SimpleHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object StringHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = StringHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object TransferHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = TransferHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object CommandHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = CommandHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object TabHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = TabHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object PannerHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = PannerHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object MenuHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = MenuHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; object GridHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Help"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = GridHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; !*********************************************************************** ! Exit Callback !*********************************************************************** object ExitQueryDialog : XmTemplateDialog { arguments { XmNdialogTitle = "Dialog"; XmNmessageString = "Do you really want to quit?"; }; controls { ExmCommandButton YesCommand; ExmCommandButton NoCommand; ExmCommandButton DanceCommand; ExmCommandButton HelpCommand; }; }; object YesCommand : ExmCommandButton { arguments { ExmNcompoundString = "Yes"; }; callbacks { XmNactivateCallback = procedure ExitCb(); }; }; object NoCommand : ExmCommandButton { arguments { ExmNcompoundString = "No"; }; }; object DanceCommand : ExmCommandButton { arguments { ExmNcompoundString = DanceCS; }; callbacks { XmNactivateCallback = procedure ManageCb("*DanceHelpDialog"); }; }; object HelpCommand : ExmCommandButton { arguments { ExmNcompoundString = "Help"; }; callbacks { XmNactivateCallback = procedure ManageCb("*CommandHelpDialog"); }; }; object DanceHelpDialog : XmInformationDialog { arguments { XmNdialogTitle = "Dance"; XmNcancelLabelString = "Dismiss"; XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON; XmNmessageString = DanceHelpCS; }; controls { Xm_OK unmanaged { }; Xm_Help unmanaged { }; }; }; !*********************************************************************** object workArea : XmFrame { arguments { XmNmarginWidth = 10; XmNmarginHeight = 10; XmNshadowThickness = 3; }; controls { XmFrame gridFrame; }; }; object gridFrame : XmFrame { arguments { }; controls { ExmGrid grid; }; }; !*********************************************************************** object grid : ExmGrid { arguments { XmNrows = 2; XmNcolumns = 4; }; controls { ExmSimple Simple1; ExmSimple Simple2; ExmString String1; ExmString String2; ExmStringTransfer StringTransfer1; ExmStringTransfer StringTransfer2; XmNotebook Notebook1; }; }; object Simple1 : ExmSimple { }; object Simple2 : ExmSimple { arguments { ExmNsimpleShape = ExmSHAPE_RECTANGLE; XmNunitType = Xm100TH_MILLIMETERS; XmNsensitive = false; XmNmarginWidth = 300; XmNmarginHeight = 2000; ExmNgridMarginHeightWithinCell = 200; }; }; object String1 : ExmString { arguments { ExmNcompoundString = a_compound_string; }; }; object String2 : ExmString { arguments { ExmNcompoundString = a_compound_string; XmNalignment = XmALIGNMENT_BEGINNING; }; }; object StringTransfer1 : ExmStringTransfer { arguments { ExmNcompoundString = transfer_cstring_1; XmNalignment = XmALIGNMENT_END; }; }; object StringTransfer2 : ExmStringTransfer { arguments { ExmNcompoundString = transfer_cstring_2; }; }; object Notebook1 : XmNotebook { controls { ExmTabButton TabButton1; }; }; object TabButton1 : ExmTabButton { arguments { ExmNcompoundString = tab_button_string; }; }; end module; motif-2.3.8/demos/programs/Exm/app_in_uil/Makefile.in0000644000175000017500000003411613211512766017452 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/Exm/app_in_uil ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = exm_in_uil.uil CLEANFILES = exm_in_uil.uid #noinst_PROGRAMS = exm_in_uil #exm_in_uil_DEPENDENCIES = exm_in_uil.uid LDADD = -L../../../lib/Exm -lExmMrm -lExm $(top_builddir)/lib/Mrm/libMrm.la INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/lib -I../../../lib -I$(top_builddir)/lib ${X_CFLAGS} SUFFIXES = .uil .uid all: all-am .SUFFIXES: .SUFFIXES: .uil .uid $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/Exm/app_in_uil/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/Exm/app_in_uil/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile .uil.uid: $(top_builddir)/clients/uil/uil -wmd ../../../lib/Exm/wml/Exm.wmd -I$(srcdir) -o $@ $< # EXMSRC = ../../../lib/Exm # EXMINCLUDESRC = $(MINCLUDESRC) # EXMLIB = $(EXMSRC)/libExm.a # EXMMRMLIB = $(EXMSRC)/libExmMrm.a # INCLUDES = -I$(EXMINCLUDESRC) # DEPLIBS = $(EXMMRMLIB) $(EXMLIB) MrmClientDepLibs #LOCAL_LIBRARIES = $(EXMMRMLIB) $(EXMLIB) MrmClientLibs #LOCAL_UILFLAGS = -wmd $(EXMSRC)/wml/Exm.wmd # # SRCS = exm_in_uil.c # OBJS = exm_in_uil.o # #MSimpleProgramTarget(exm_in_uil) #MSimpleUidTarget(exm_in_uil) # #InstallManPage(exm_in_uil,$(MANDIR)) #InstallProgram(exm_in_uil,$(BINDIR)) # #DependTarget() # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/Exm/app_in_uil/README0000644000175000017500000000042012672140200016242 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:01:02 drk $ */ README File for AllExmDemo Example AllExmDemo is a UIL program that exercises the Exm widget set. To build the program, just type $ make To run the program, just type: $ AllExmDemo motif-2.3.8/demos/programs/Exm/app_in_uil/Makefile.am0000644000175000017500000000175713145162623017445 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = exm_in_uil.uil CLEANFILES = exm_in_uil.uid #noinst_PROGRAMS = exm_in_uil #exm_in_uil_DEPENDENCIES = exm_in_uil.uid LDADD = -L../../../lib/Exm -lExmMrm -lExm $(top_builddir)/lib/Mrm/libMrm.la INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/lib -I../../../lib -I$(top_builddir)/lib ${X_CFLAGS} SUFFIXES = .uil .uid .uil.uid: $(top_builddir)/clients/uil/uil -wmd ../../../lib/Exm/wml/Exm.wmd -I$(srcdir) -o $@ $< # EXMSRC = ../../../lib/Exm # EXMINCLUDESRC = $(MINCLUDESRC) # EXMLIB = $(EXMSRC)/libExm.a # EXMMRMLIB = $(EXMSRC)/libExmMrm.a # INCLUDES = -I$(EXMINCLUDESRC) # DEPLIBS = $(EXMMRMLIB) $(EXMLIB) MrmClientDepLibs #LOCAL_LIBRARIES = $(EXMMRMLIB) $(EXMLIB) MrmClientLibs #LOCAL_UILFLAGS = -wmd $(EXMSRC)/wml/Exm.wmd # # SRCS = exm_in_uil.c # OBJS = exm_in_uil.o # #MSimpleProgramTarget(exm_in_uil) #MSimpleUidTarget(exm_in_uil) # #InstallManPage(exm_in_uil,$(MANDIR)) #InstallProgram(exm_in_uil,$(BINDIR)) # #DependTarget() motif-2.3.8/demos/programs/Exm/README0000644000175000017500000001554512672140200014141 00000000000000/* $XConsortium: README /main/3 1996/07/15 14:00:27 drk $ */ This directory contains the source code for the Exm demonstration widgets. The Exm demonstration widgets illustrate how to write a Motif widget in C. If you are interested in writing a Motif widget in C++, you should see the ../ExmCxx directory. Complete details on the Exm demonstration widgets can be found in the "OSF/Motif Widget Writer's Guide and Reference" manual. We are providing the Exm widget set for educational purposes only. Programmers should not use any Exm widgets inside a commercial application. This README file summarizes the purpose of each file in this directory. The end of this README file contains instructions for building the Exm widget set. *************************** WIDGETS IN THIS DIRECTORY *************************** The Exm demonstration widgets is an eight widget set having the following hierarchy: --------------------Core-------------------- | | V V XmPrimitive XmManager | | | | V V ExmSimple------------------------ ExmGrid | | V V -----------------ExmString-------------- ExmPanner | | | V V V ExmCommandButton ExmStringTransfer ExmMenuButton | V ExmTabButton ********* ExmSimple ********* The ExmSimple widget consists of three files: * Simple.c * Simple.h * SimpleP.h The ExmSimple widget renders a rectangle or an oval. This widget demonstrates how to create a * relatively easy Motif widget. * primitive widget that can serve as a superclass for other widgets. * new representation type. ********* ExmString ********* The ExmString widget consists of three files: * String.c * String.h * StringP.h The ExmString widget demonstrates how to handle compound strings in Motif widgets. The ExmString widget is similar to the XmLabel widget. The biggest difference between the two is that an XmLabel can render either a compound string or a pixmap but an ExmString can render only a compound string. More specifically, the ExmString widget demonstrates how to: * use the four recommended resources for handling compound strings. * use the XmQTaccessTextual trait. * calculate the baselines of each lines of text. **************** ExmCommandButton **************** The ExmCommandButton widget consists of three files: * CommandB.c * CommandB.h * CommandBP.h This widget displays a button that, when activated, initiates a callback. This widget demonstrates how to * create Motif-style button visuals. * establish Motif-style actions for buttons. * install the XmQTactivatable trait. * install the XmQTtakesDefault trait. * establish a simple Motif callback. ************* ExmMenuButton ************* The ExmMenuButton widget consists of three files: * MenuB.c * MenuB.h * MenuBP.h This widget renders a menu child button that, when activated, initiates a callback. This widget demonstrates how to * create a menu child widget, in the style of XmPushButton. * install the XmQTmenuSavvy trait. * call the trait methods of XmQTmenuSystem. ***************** ExmStringTransfer ***************** The ExmStringTransfer widget consists of three files: * StringTrans.c * StringTrans.h * StringTransP.h This widget renders a compound string. The ExmStringTransfer widget demonstrates how to * implement the Uniform Transfer Method (UTM) in a Motif widget. * write a widget that supports Drag and Drop. * install the XmQTtransfer trait. ********* ExmPanner ********* The ExmPanner widget consists of three files: * Panner.c * Panner.h * PannerP.h This widget allows users to pan (navigate) through different portions of another widget. The ExmPanner widget renders a small rectangle inside a widget. The user may move this rectangle. As the rectangle moves to different portions of its surrounding widget, different portions of the target widget will become visible. The ExmPanner widget demonstrates how to: * write a navigator widget. * use the XmQTnavigator trait. ************ ExmTabButton ************ The ExmTabButton widget consists of three files: * TabB.c * TabB.h * TabBP.h This widget attaches itself to one side of a parent widget in order to give the appearance of a tab "growing out of" the parent. The ExmTabButton widget is activatable. It demonstrates how to * use the XmQTjoinSide trait. * use several Xme drawing functions. ******* ExmGrid ******* The ExmGrid widget consists of three files: * Grid.c * Grid.h * GridP.h The ExmGrid widget demonstrates how to * write a manager widget. * use the XmQTdialogSavvy trait. *********** UIL SUPPORT *********** The directory also contains several files pertaining to UIL support of the Exm widgets. They are: * Exm.uil: a header file that can be included in UIL applications. This file defines the API for UIL applications wishing to use the Exm widget set. * Exm.wml: (not available at Alpha.) This file can be compiled with wml in order to form a new motif.wmd file or a new UIL compiler. * ExmMrm.c: contains MrmRegisterClass calls for the Exm widget set. * ExmMrm.h: a header file that provides an interface to the code in the ExmMrm.c file. *************************** BUILDING THE EXM WIDGET SET *************************** This directory contains an Imakefile. In order to build the Exm widget set from this Imakefile, you should follow these steps: 1. $ make Makefile # This command should create a true Makefile. 2. $ make includes 3. $ make depend 4. $ make The "make" command should compile all of the source code files in the directory. The resulting widget object files will be archived into a library file named libExm.a. The ExmMrm.o object file will be archived into a library file named libMrm.a. In order to exercise the code in the libraries, you must build an application stored in one of the following subdirectories: * simple_app * exm_app_in_c * exm_app_in_uil motif-2.3.8/demos/programs/Exm/Exm.uil0000644000175000017500000000466412672140200014525 00000000000000! $XConsortium: Exm.uil /main/4 1996/07/15 15:12:16 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY !**************************************************************************** !* !* Exm.uil - Exm widgets UIL header file !* !**************************************************************************** !* Exm Creation API procedure ExmCreateSimple(); ExmCreateString(); ExmCreateStringTransfer(); ExmCreateCommandButton(); ExmCreateMenuButton(); ExmCreateGrid(); ExmCreateTabButton(); ExmCreatePanner(); !* Exm Resources value ExmNsimpleShape : private argument ('simpleShape', integer); ExmNcompoundString : private argument ('compoundString', compound_string); ExmNgridMarginWidthWithinCell : private argument ('gridMarginWidthWithinCell', integer); ExmNgridMarginHeightWithinCell : private argument ('gridMarginHeightWithinCell', integer); ExmNopenSide : private argument ('openSide', integer); ExmNreportCallback : private argument ('reportCallback', callback); ExmNrubberBand : private argument ('rubberBand', boolean); ExmNcanvasWidth : private argument ('canvasWidth', integer); ExmNcanvasHeight : private argument ('canvasHeight', integer); ExmNsliderX : private argument ('sliderX', integer); ExmNsliderY : private argument ('sliderY', integer); ExmNsliderWidth : private argument ('sliderWidth', integer); ExmNsliderHeight : private argument ('sliderHeight', integer); value ExmSHAPE_OVAL : 0; ExmSHAPE_RECTANGLE : 1; motif-2.3.8/demos/programs/Exm/Makefile.am0000644000175000017500000000021213145162623015307 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = app_in_c simple_app app_in_uil #SUBDIRS = app_in_c simple_app EXTRA_DIST = Exm.uil README motif-2.3.8/demos/programs/hellomotifi18n/0000755000175000017500000000000013211513007015437 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/japan/0000755000175000017500000000000013211513007016530 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/japan/Makefile.in0000644000175000017500000004651013211512766020536 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/japan ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japan/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japan/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/japan/uid/0000755000175000017500000000000013211513007017311 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/japan/uid/l_strings.uil0000644000175000017500000000354112672140200021754 00000000000000! $XConsortium: l_strings.uil /main/4 1996/07/15 15:17:11 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module kanji_strings version = 'v1.0' names = case_sensitive character_set = jis_kanji value romanFont : font ( '-*-JISX0201.1976-0'); kanjiFont : font ( '-*-JISX0208.1983-1', character_set = jis_kanji); local_font : exported font_table (jis_katakana = romanFont, kanjiFont); string_direction : exported XmSTRING_DIRECTION_L_TO_R; hello_label : exported compound_string("¤³¤ó¤Ë¤Á¤Ï", separate=true)& compound_string(#jis_katakana"Hello!"); bye_label : exported compound_string("¤³¤ó¤Ë¤Á¤Ï", separate=true)& compound_string(#jis_katakana"Good-bye!"); label_label : exported compound_string( "£±²ó¤Î¥¯¥ê¥Ã¥¯¤Ç", separate=true)& compound_string( "¥é¥Ù¥ë¤¬ÊѤï¤ê", separate=true)& compound_string( "£²²ó¤Ç½ªÎ»¤·¤Þ¤¹"); end module ; motif-2.3.8/demos/programs/hellomotifi18n/japan/uid/Makefile.in0000644000175000017500000003230013211512766021307 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/japan/uid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japan/uid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japan/uid/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/japan/uid/Makefile.am0000644000175000017500000000013312672140200021263 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid motif-2.3.8/demos/programs/hellomotifi18n/japan/Makefile.am0000644000175000017500000000006212672140200020503 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid motif-2.3.8/demos/programs/hellomotifi18n/french/0000755000175000017500000000000013211513007016704 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/french/Makefile.in0000644000175000017500000004651313211512766020715 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/french ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/french/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/french/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/french/uid/0000755000175000017500000000000013211513007017465 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/french/uid/l_strings.uil0000644000175000017500000000311612672140200022126 00000000000000! $XConsortium: l_strings.uil /main/4 1996/07/15 15:16:02 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module latin_strings version = 'v1.0' names = case_sensitive value local_font : exported font('*helvetica-medium-r-normal--14-*-iso8859-1'); string_direction : exported XmSTRING_DIRECTION_L_TO_R ; hello_label : exported compound_string('Salut tout',separate=true) & ' le monde!'; bye_label : exported compound_string('Adieu',separate=true) & 'Monde cruel!'; label_label : exported compound_string('Presser le bouton une fois', separate=true) & compound_string('pour changer le label;',separate=true) & 'deux fois pour sortir'; end module ; motif-2.3.8/demos/programs/hellomotifi18n/french/uid/Makefile.in0000644000175000017500000003230313211512766021466 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/french/uid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/french/uid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/french/uid/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/french/uid/Makefile.am0000644000175000017500000000013312672140200021437 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid motif-2.3.8/demos/programs/hellomotifi18n/french/Makefile.am0000644000175000017500000000006212672140200020657 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid motif-2.3.8/demos/programs/hellomotifi18n/Makefile.in0000644000175000017500000006633013211512766017447 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = helloint$(EXEEXT) subdir = demos/programs/hellomotifi18n ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_helloint_OBJECTS = helloint.$(OBJEXT) helloint_OBJECTS = $(am_helloint_OBJECTS) helloint_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(helloint_SOURCES) DIST_SOURCES = $(helloint_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/helloint build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/helloint datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = C english french hebrew japan japanese swedish EXTRA_DIST = README helloint.uil helloint.man CLEANFILES = helloint.uid helloint_SOURCES = helloint.c data_DATA = $(EXTRA_DIST) $(helloint_SOURCES) helloint.uid helloint_DEPENDENCIES = helloint.uid C/uid/l_strings.uid english/uid/l_strings.uid french/uid/l_strings.uid hebrew/uid/l_strings.uid japan/uid/l_strings.uid japanese/uid/l_strings.uid swedish/uid/l_strings.uid INCLUDES = -I$(top_srcdir)/lib -I$(top_builddir)/lib ${X_CFLAGS} LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la SUFFIXES = .uil .uid all: all-recursive .SUFFIXES: .SUFFIXES: .uil .uid .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list helloint$(EXEEXT): $(helloint_OBJECTS) $(helloint_DEPENDENCIES) $(EXTRA_helloint_DEPENDENCIES) @rm -f helloint$(EXEEXT) $(AM_V_CCLD)$(LINK) $(helloint_OBJECTS) $(helloint_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helloint.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dataDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dataDATA .PRECIOUS: Makefile .uil.uid: $(top_builddir)/clients/uil/uil $< -I$(srcdir) -o $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/hebrew/0000755000175000017500000000000013211513007016713 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/hebrew/Makefile.in0000644000175000017500000004651313211512766020724 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/hebrew ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/hebrew/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/hebrew/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/hebrew/uid/0000755000175000017500000000000013211513007017474 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/hebrew/uid/l_strings.uil0000644000175000017500000000331712672140200022140 00000000000000! $XConsortium: l_strings.uil /main/4 1996/07/15 15:16:23 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module hebrew_strings version = 'v1.1' names = case_sensitive character_set = iso_hebrew_lr value local_font : exported font('*medium-r-normal--13*iso8859-8', character_set = iso_hebrew_lr); string_direction : exported XmSTRING_DIRECTION_R_TO_L; hello_label : exported compound_string("íåìù", separate=true)& compound_string("!íìåò"); bye_label : exported compound_string("úåàøúäì", separate=true)& compound_string("!íìåò"); label_label : exported compound_string("úçà íòô õçì", separate=true)& compound_string("úøúåëä úåðùì", separate=true)& compound_string(#iso_hebrew_lr"åôòîééí áëãé ìöàú."); end module ; motif-2.3.8/demos/programs/hellomotifi18n/hebrew/uid/Makefile.in0000644000175000017500000003230313211512766021475 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/hebrew/uid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/hebrew/uid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/hebrew/uid/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/hebrew/uid/Makefile.am0000644000175000017500000000013312672140200021446 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid motif-2.3.8/demos/programs/hellomotifi18n/hebrew/Makefile.am0000644000175000017500000000006212672140200020666 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid motif-2.3.8/demos/programs/hellomotifi18n/C/0000755000175000017500000000000013211513007015621 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/C/Makefile.in0000644000175000017500000004647413211512766017640 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/C ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/C/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/C/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/C/uid/0000755000175000017500000000000013211513007016402 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/C/uid/l_strings.uil0000644000175000017500000000303412672140200021042 00000000000000! $XConsortium: l_strings.uil /main/4 1996/07/15 15:14:56 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module latin_strings version = 'v1.0' names = case_sensitive value local_font : exported font('*-times-medium-r-normal--14-*-iso8859-1'); string_direction : exported XmSTRING_DIRECTION_L_TO_R ; hello_label : exported compound_string('Hello',separate=true) & 'World!'; bye_label : exported compound_string('Goodbye',separate=true) & 'World!'; label_label : exported compound_string('Press button once', separate=true) & compound_string('to change label;',separate=true) & 'twice to exit.'; end module ; motif-2.3.8/demos/programs/hellomotifi18n/C/uid/Makefile.in0000644000175000017500000003226413211512766020411 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/C/uid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/C/uid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/C/uid/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/C/uid/Makefile.am0000644000175000017500000000013312672140200020354 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid motif-2.3.8/demos/programs/hellomotifi18n/C/Makefile.am0000644000175000017500000000006212672140200017574 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid motif-2.3.8/demos/programs/hellomotifi18n/swedish/0000755000175000017500000000000013211513007017105 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/swedish/Makefile.in0000644000175000017500000004651613211512766021121 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/swedish ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/swedish/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/swedish/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/swedish/uid/0000755000175000017500000000000013211513007017666 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/swedish/uid/l_strings.uil0000644000175000017500000000310712672140200022327 00000000000000! $XConsortium: l_strings.uil /main/4 1996/07/15 15:17:53 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module latin_strings version = 'v1.0' names = case_sensitive value local_font : exported font('*helvetica-medium-r-normal--14-*-iso8859-1'); string_direction : exported XmSTRING_DIRECTION_L_TO_R ; hello_label : exported compound_string('Hej',separate=true) & 'världen!'; bye_label : exported compound_string('Adjö',separate=true) & 'grymma värld!'; label_label : exported compound_string('Tryck på knappen en gång', separate=true) & compound_string('för att ändra texten;',separate=true) & 'två gånger för att avsluta'; end module ; motif-2.3.8/demos/programs/hellomotifi18n/swedish/uid/Makefile.in0000644000175000017500000003230613211512766021672 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/swedish/uid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/swedish/uid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/swedish/uid/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/swedish/uid/Makefile.am0000644000175000017500000000013312672140200021640 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid motif-2.3.8/demos/programs/hellomotifi18n/swedish/Makefile.am0000644000175000017500000000006212672140200021060 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid motif-2.3.8/demos/programs/hellomotifi18n/japanese/0000755000175000017500000000000013211513007017225 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/japanese/Makefile.in0000644000175000017500000004652113211512766021235 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/japanese ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japanese/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japanese/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/japanese/uid/0000755000175000017500000000000013211513007020006 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/japanese/uid/l_strings.uil0000644000175000017500000000320612672140200022447 00000000000000! $XConsortium: l_strings.uil /main/4 1996/07/15 15:17:31 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module kanji_strings version = 'v1.0' names = case_sensitive character_set = jis_kanji value local_font : exported fontset ('*medium-r*--14*'); string_direction : exported XmSTRING_DIRECTION_L_TO_R; hello_label : exported compound_string("º£°ì±©", separate=true) & compound_string("¤³¤ó¤Ë¤Á¤Ï"); bye_label : exported compound_string("¤µ¤è¤Ê¤é", separate=true)& compound_string("¤³¤ó¤Ë¤Á¤Ï"); label_label : exported compound_string( "£±²ó¤Î¥¯¥ê¥Ã¥¯¤Ç", separate=true)& compound_string( "¥é¥Ù¥ë¤¬ÊѤï¤ê", separate=true)& compound_string( "£²²ó¤Ç½ªÎ»¤·¤Þ¤¹"); end module ; motif-2.3.8/demos/programs/hellomotifi18n/japanese/uid/Makefile.in0000644000175000017500000003231113211512766022006 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/japanese/uid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japanese/uid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/japanese/uid/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/japanese/uid/Makefile.am0000644000175000017500000000013312672140200021760 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid motif-2.3.8/demos/programs/hellomotifi18n/japanese/Makefile.am0000644000175000017500000000006212672140200021200 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid motif-2.3.8/demos/programs/hellomotifi18n/english/0000755000175000017500000000000013211513007017070 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/english/Makefile.in0000644000175000017500000004651613211512766021104 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/english ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/english/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/english/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/english/uid/0000755000175000017500000000000013211513007017651 500000000000000motif-2.3.8/demos/programs/hellomotifi18n/english/uid/l_strings.uil0000644000175000017500000000302212672140200022306 00000000000000! $XConsortium: l_strings.uil /main/4 1996/07/15 15:15:36 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module latin_strings version = 'v1.0' names = case_sensitive value local_font : exported font('*times-medium-r-normal--14-*-iso8859-1'); string_direction : exported XmSTRING_DIRECTION_L_TO_R ; hello_label : exported compound_string('Hello',separate=true) & 'World!'; bye_label : exported compound_string('Goodbye',separate=true) & 'World!'; label_label : exported compound_string('Press button once', separate=true) & compound_string('to change label;',separate=true) & 'twice to exit.'; end module ; motif-2.3.8/demos/programs/hellomotifi18n/english/uid/Makefile.in0000644000175000017500000003230613211512766021655 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/hellomotifi18n/english/uid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/english/uid/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/hellomotifi18n/english/uid/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/hellomotifi18n/english/uid/Makefile.am0000644000175000017500000000013312672140200021623 00000000000000MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = l_strings.uil CLEANFILES = l_strings.uid motif-2.3.8/demos/programs/hellomotifi18n/english/Makefile.am0000644000175000017500000000006212672140200021043 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = uid motif-2.3.8/demos/programs/hellomotifi18n/helloint.c0000644000175000017500000001033512672140200017344 00000000000000/* $XConsortium: helloint.c /main/5 1995/07/15 20:45:32 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #include /* for getenv() */ #include /* Motif Toolkit */ #include /* Mrm Toolkit */ #define APP_CLASS "XmdHelloInt" static void Activate(Widget, XtPointer, XtPointer); /* * MRM database file list */ static String uid_vec[]={"helloint.uid","l_strings.uid"}; /* * Callback bindings */ static MrmRegisterArg reg_vec[] = { {"helloworld_button_activate",(XtPointer)Activate} }; /* * MRM Hierachy */ static MrmHierarchy s_mrm_hierarchy; /**************************************************************** * * Main program. Fetch UIL interface description and enter * event loop. * ****************************************************************/ int main(int argc, char *argv[]) { XtAppContext app_context; Widget top_level, helloworld_main; MrmCode mrm_class; char * applresdir; /* * This demo requires XAPPLRESDIR to be set to '.'. Mrm * will only report that l_strings.uid could not be found, * so, to be a little more friendly, we help the user. This * it not a check that normally would be done, since the uid * files would be installed in the appropriate directory. */ if ((applresdir = (char *)getenv("XAPPLRESDIR")) == NULL || strcmp(applresdir, ".") != 0) { XtError("Environment variable XAPPLRESDIR must be set to \".\"\n"); } /* * Set up language environment. */ XtSetLanguageProc(NULL, NULL, NULL); /* * Initialize MRM */ MrmInitialize (); /* * Initialize Xt and create a resizable shell */ top_level = XtVaAppInitialize(&app_context, "XmdHelloInt", NULL, 0, &argc, argv, NULL, XmNallowShellResize, True, NULL); /* * Create the Mrm hierarchy */ if (MrmOpenHierarchy (XtNumber(uid_vec), /* number of files */ uid_vec, /* files */ NULL, /* os_ext_list (null) */ &s_mrm_hierarchy) /* ptr to returned id */ != MrmSUCCESS) { XtError ("can't open hierarchy\n"); } /* * Register our callback routines so that the resource manager can * resolve them at widget-creation time. */ if (MrmRegisterNames (reg_vec, XtNumber(reg_vec)) != MrmSUCCESS) { XtError("can't register names\n"); } /* * Call MRM to fetch and create the widgets */ if (MrmFetchWidget (s_mrm_hierarchy, "helloworld_main", top_level, &helloworld_main, &mrm_class) != MrmSUCCESS) { XtError ("can't fetch interface\n"); } /* * Manage the widget returned by Mrm. */ XtManageChild(helloworld_main); /* * Realize the widget tree. */ XtRealizeWidget(top_level); /* * Loop and process events */ XtAppMainLoop(app_context); /* UNREACHABLE */ return (0); } static void Activate(Widget widget, XtPointer client_data, XtPointer callback_data) { static Boolean first_time = True; Arg arglist[1]; if (first_time) { /* * Get "Goodbye World!" in the language of choice and * set the label string of widget to this string. */ XtSetArg(arglist[0], XmNlabelString, "bye_label"); MrmFetchSetValues(s_mrm_hierarchy, widget, arglist, 1); first_time = False; } else { /* * We're done... */ exit(0); } } motif-2.3.8/demos/programs/hellomotifi18n/helloint.man0000644000175000017500000000332412672140200017675 00000000000000.\" $XConsortium: helloint.man /main/4 1995/07/17 10:47:41 drk $ .\" Motif .\" .\" Copyright (c) 1987-2012, The Open Group. All rights reserved. .\" .\" These libraries and programs are free software; you can .\" redistribute them and/or modify them under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation; either version 2 of the License, or (at your option) .\" any later version. .\" .\" These libraries and programs are distributed in the hope that .\" they will be useful, but WITHOUT ANY WARRANTY; without even the .\" implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR .\" PURPOSE. See the GNU Lesser General Public License for more .\" details. .\" .\" You should have received a copy of the GNU Lesser General Public .\" License along with these librararies and programs; if not, write .\" to the Free Software Foundation, Inc., 51 Franklin Street, Fifth .\" Floor, Boston, MA 02110-1301 USA ...\" ...\" ...\" HISTORY .TH helloint 1X MOTIF "Demonstration programs" .SH NAME \*Lhelloint \*O\(em internationalized hellomotif .SH SYNOPSIS .sS \*Lhelloint\*O .sE .SH DESCRIPTION \*Lhelloint\*O is the internationalized version of hellomotif. All strings and fonts have been placed in uil files separate from the main uil file containing the widget hierarchy. There is one uil file for each language the demo has been translated to. This translation process is also called localization. This demo has been localized to english, japanese, hebrew, french and swedish. The C locale is also supported. .SH X Defaults The class of this application is \fIXmdHelloInt\fR. To set a specific resource in your \fI.Xdefaults\fR file, you specify the particular widget and resource. motif-2.3.8/demos/programs/hellomotifi18n/README0000644000175000017500000000625512672140200016250 00000000000000/* $XConsortium: README /main/4 1996/07/15 14:05:37 drk $ */ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY This directory contains an internationalized version of the sample UIL/Xm program hellomotif, a simple program with a label and a push button. This version has been localized to the following languages: english french hebrew japanese (EUC encoding) swedish The localization is accomplished by having different UIL files for the different languages, also called locales. There is also a UIL file for the default locale, C. This file is equivalent to the english UIL file. To locate the UID files, the demo is using the $UIDPATH environment variable, which requires you to set $XAPPLRESDIR to ".", and the $LANG or the xnlLanguage resource to one of languages mentioned above. (use *xnlLanguage: $LANG in your .Xdefaults or on the command line if your system doesn't let you set $LANG to anything except C). The fonts needed for the demos are: french, swedish: *-helvetica-medium-r-normal--14-*-iso8859-1 english: *-times-medium-r-normal--14-*-iso8859-1 hebrew: *-fixed-medium-r-normal--13-*-iso8859-8 japanese (fontset): *medium-r*--14* If you don't have those fonts installed on your system, you can change the uil files to reference other fonts. The bdf directory contains a hebrew font (heb8x13.bdf), and two japanese fonts, both of which are needed for japanese (7x14rk.bdf is for english characters and k14-1.bdf is for kanji). If you want to use these, you will need to compile and install them first. If your operating system/X implementation uses other names to indicate the locale than the ones mentioned above, you may need change the names of the appropriate subdirectories. To find out the locale names on your system, refer to the setlocale man page (you may need to look at the man pages this refers to instead). Two common locations for system locale files are /usr/lib/locale and /usr/lib/nls. To find out what locales are supported by your X implementation, you would normally look in /usr/lib/X11/nls. If X is installed somewhere else, there should be a directory named "nls" one or more levels under the "lib" directory. NOTE: You may need to set the environment variable XNLSPATH. If this demo crashes on startup, set XNLSPATH to the path of the X nls directory (see previous paragraph). See the X library documentation for more information. motif-2.3.8/demos/programs/hellomotifi18n/helloint.uil0000644000175000017500000000374612672140200017723 00000000000000! $XConsortium: helloint.uil /main/4 1996/07/15 15:16:48 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! HISTORY module helloworld_i18n version = 'v1.0' names = case_sensitive ! string_direction, local_font, label_label & hello_label are found ! in the localized uil module l_strings.uil, which also provided ! the bye_label value, used at run time with MrmFetchSetValues. value string_direction : imported integer; local_font : imported font_table; label_label : imported string; hello_label : imported string; procedure helloworld_button_activate(); object helloworld_main : XmRowColumn { arguments { XmNstringDirection = string_direction ; }; controls { XmLabel helloworld_label; XmPushButton helloworld_button; }; }; object helloworld_label : XmLabel { arguments { XmNfontList = local_font; XmNlabelString = label_label ; }; }; object helloworld_button : XmPushButton { arguments { XmNfontList = local_font; XmNlabelString = hello_label ; }; callbacks { XmNactivateCallback = procedure helloworld_button_activate(); }; }; end module; motif-2.3.8/demos/programs/hellomotifi18n/Makefile.am0000644000175000017500000000143013145162623017423 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/helloint datadir = ${prefix}/share/Xm/helloint SUBDIRS = C english french hebrew japan japanese swedish EXTRA_DIST = README helloint.uil helloint.man CLEANFILES = helloint.uid helloint_SOURCES = helloint.c bin_PROGRAMS = helloint data_DATA = $(EXTRA_DIST) $(helloint_SOURCES) helloint.uid helloint_DEPENDENCIES = helloint.uid C/uid/l_strings.uid english/uid/l_strings.uid french/uid/l_strings.uid hebrew/uid/l_strings.uid japan/uid/l_strings.uid japanese/uid/l_strings.uid swedish/uid/l_strings.uid INCLUDES = -I$(top_srcdir)/lib -I$(top_builddir)/lib ${X_CFLAGS} LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la SUFFIXES = .uil .uid .uil.uid: $(top_builddir)/clients/uil/uil $< -I$(srcdir) -o $@ motif-2.3.8/demos/programs/airport/0000755000175000017500000000000013211513007014255 500000000000000motif-2.3.8/demos/programs/airport/dragsource.c0000644000175000017500000002325612672140200016510 00000000000000/* $TOG: dragsource.c /main/6 1997/03/05 11:46:31 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * The Airport Drag And Drop Demo * * The module that contains all drag source / initiator code * * Created: Vania JOLOBOFF / May 1992 * */ #include #include "airport.h" #include "dragsource.h" /* ============================ prototypes ======================= */ static void EnterTopLevel(Widget dc, Airport this, XmTopLevelEnterCallbackStruct *call_data); /* drag callback entering top level window */ static void LeaveTopLevel(Widget dc, Airport this, XmTopLevelLeaveCallbackStruct *call_data); /* drag callback leaving top level window */ static void DropSiteEnter(Widget dc, Airport this, XmDropSiteEnterCallbackStruct *call_data); /* drag callback entering drop site */ static void DropSiteLeave(Widget dc, Airport this, XmDropSiteLeaveCallbackStruct *call_data); /* drag callback leaving drop site */ static void Flying(Widget dc, Airport this, XmDragMotionCallbackStruct *call_data); /* drag motion callback on initiator */ static void OperationChanged(Widget dc, Flight flight, XmOperationChangedCallbackStruct *call_data); /* side effect change callback on initiator */ static void PlaneLanding(Widget dc, Flight flight, XmDropStartCallbackStruct *call_data); /* drop start callback on initiator side */ static void PlaneHasLanded(Widget dc, Flight flight, XmDropFinishCallbackStruct *call_data); /* drop end callback on initiator side */ static void FlightFinished(Widget dc, Flight flight, XmDragDropFinishCallback *call_data); /* drag drop finish callback on initiator. Remove data for that plane */ static Boolean SendPlaneID(Widget drag_context, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format); /* The Xt selection convert proc sending the data to the drop site */ /* =============================================================== * Start dragging a plane icon. */ void TakeOff(Widget area, Airport this, XButtonEvent *evt, int spot) { Arg args[20]; int n; Flight flight; Widget dc; char msg[256]; static Boolean init = True; if (init) { srand((unsigned int) XtWindow(area)); init = False; } flight = (Flight)XtCalloc(sizeof(FlightRec), 1); flight->number = rand(); flight->from = this; flight->gate = spot; sprintf(msg, "Flight %ld leaving from gate %d", flight->number, flight->gate); Paging(this, msg); n = 0; XtSetArg(args[n], XmNclientData, flight); n++; XtSetArg(args[n], XmNconvertProc, SendPlaneID); n++; XtSetArg(args[n], XmNcursorBackground, AirportResources.flight_background); n++; XtSetArg(args[n], XmNcursorForeground, AirportResources.flight_foreground); n++; XtSetArg(args[n], XmNvalidCursorForeground, AirportResources.valid_foreground); n++; XtSetArg(args[n], XmNinvalidCursorForeground, AirportResources.invalid_foreground); n++; XtSetArg(args[n], XmNnoneCursorForeground, AirportResources.none_foreground); n++ ; XtSetArg(args[n], XmNdragOperations, XmDROP_MOVE) ; n++; XtSetArg(args[n], XmNblendModel, XmBLEND_JUST_SOURCE) ; n++; XtSetArg(args[n], XmNsourceCursorIcon, this->dragIcon) ; n++; XtSetArg(args[n], XmNexportTargets, &FlightAtom); n++; XtSetArg(args[n], XmNnumExportTargets, 1); n++; dc = XmDragStart(area, (XEvent *)evt, args, n); XtAddCallback(dc, XmNdragMotionCallback, (XtCallbackProc) Flying, (XtPointer) this); XtAddCallback(dc, XmNdropSiteEnterCallback, (XtCallbackProc) DropSiteEnter, (XtPointer) this); XtAddCallback(dc, XmNdropSiteLeaveCallback, (XtCallbackProc) DropSiteLeave, (XtPointer) this); XtAddCallback(dc, XmNtopLevelEnterCallback, (XtCallbackProc) EnterTopLevel, (XtPointer) this); XtAddCallback(dc, XmNtopLevelLeaveCallback, (XtCallbackProc) LeaveTopLevel, (XtPointer) this); XtAddCallback(dc, XmNdropStartCallback, (XtCallbackProc) PlaneLanding, (XtPointer) flight); XtAddCallback(dc, XmNdropFinishCallback, (XtCallbackProc) PlaneHasLanded, (XtPointer) flight); XtAddCallback(dc, XmNdragDropFinishCallback, (XtCallbackProc) FlightFinished , (XtPointer) flight); XtAddCallback(dc, XmNoperationChangedCallback, (XtCallbackProc) OperationChanged, (XtPointer) flight); } /* =============================================================== * Pointer enters a new top level window. * Check if this is the ocean or new land */ static void EnterTopLevel(Widget dc, Airport this, XmTopLevelEnterCallbackStruct *call_data) { if (call_data->window != this->ocean) XmToggleButtonSetState(this->from.over_land, True, True); } /* =============================================================== * Pointer leaves current top level window. * Assume we are back on the ocean. Next enter will reset the right value. */ static void LeaveTopLevel(Widget dc, Airport this, XmTopLevelLeaveCallbackStruct *call_data) { XmToggleButtonSetState(this->from.over_ocean, True, True); } /* =============================================================== * Someone is entering over the airport. * Signal radar detection. */ static void DropSiteEnter(Widget dc, Airport this, XmDropSiteEnterCallbackStruct *call_data) { XmToggleButtonSetState(this->from.over_site, True, True); } /* =============================================================== * The thing that was over is leaving the airport. * Radar contact lost. */ static void DropSiteLeave(Widget dc, Airport this, XmDropSiteLeaveCallbackStruct *call_data) { XmToggleButtonSetState(this->from.over_land, True, True); } /* =============================================================== * Motion callback on source side. * This is where we would could do fancy animation of the source icon. * Here we just beep. */ static void Flying(Widget dc, Airport this, XmDragMotionCallbackStruct *call_data) { static Boolean first = True; if (first) { XKeyboardControl controlValues; unsigned long valueMask = KBBellPercent | KBBellPitch | KBBellDuration; controlValues.bell_percent = AirportResources.bell_percent; controlValues.bell_pitch = 440; controlValues.bell_duration = AirportResources.bell_duration; XChangeKeyboardControl(this->display, valueMask, &controlValues); first = False; } XBell(this->display, 100); } /* =============================================================== * The drop start callback on the source side. * Set state to plane landing */ static void PlaneLanding(Widget dc, Flight flight, XmDropStartCallbackStruct *call_data) { XmToggleButtonSetState(flight->from->from.landing, True, True); } /* =============================================================== * The operation changed callback. Planes only move, no copy */ static void OperationChanged(Widget dc, Flight flight, XmOperationChangedCallbackStruct *call_data) { } /* =============================================================== * The drop finish callback. The plane has landed somewhere * Hold on, it's not finished yet */ static void PlaneHasLanded(Widget dc, Flight flight, XmDropFinishCallbackStruct *call_data) { Airport this = flight->from; char msg[256]; XmToggleButtonSetState(this->from.landed, True, True); if (call_data->completionStatus == XmDROP_SUCCESS) { Spot spot = &(this->park.spots[flight->gate]); spot->empty = True; XClearArea(this->display, XtWindow(this->airport), spot->x, spot->y, plane_width, plane_height, False); sprintf(msg, "Passengers from flight %ld have landed safely", flight->number); } else sprintf(msg, "Flight %ld has returned", flight->number); Paging(this, msg); } /* =============================================================== * the drag drop finish callback. Clean data structures. */ static void FlightFinished(Widget dc, Flight flight, XmDragDropFinishCallback *call_data) { Airport this = flight->from; XmToggleButtonSetState(this->from.departure, True, True); XtFree((char *) flight); } /* =============================================================== * Xt convert selection proc. * Send flight ID on drop transfer request. * Delete the source plane image on Delete. You know it's arrived there. */ static Boolean SendPlaneID(Widget drag_context, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format) { Airport this; Flight flight; XtVaGetValues(drag_context, XmNclientData, &flight, NULL); this = flight->from; if (*target == FlightAtom) { long * data = (long *) XtMalloc(sizeof(long)); *data = flight->number; *type = FlightAtom; *value = (XtPointer) data; *format = 32; *length = 1; return True; } else { Paging(flight->from, "Erroneous messsage on radio"); return False; } } motif-2.3.8/demos/programs/airport/dropsite.h0000644000175000017500000000332312672140200016201 00000000000000/* $XConsortium: dropsite.h /main/5 1995/07/15 20:44:46 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * The Airport Drag And Drop Demo * * Airport Drop Site / Receiver Header File * The drop site module contains all functions that relate to the * drop site operations. * * The MakeAirportDropSite functions registers the airport as a drop site. * * The drag callback sets the toggle button * corresponding to current state, in the radio box of incoming flights. * * When something is flying over the airport, change the color of the track * * When the drop is finished * if successful announce that it has landed * if it failed announce the plane returned * * Created: Vania JOLOBOFF / May 1992 * */ #include "airport.h" /* * Declare the function that will start dragging a plane icon. */ void MakeAirportDropSite(Widget area, Airport this); motif-2.3.8/demos/programs/airport/Makefile.in0000644000175000017500000005541213211512766016264 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = airport$(EXEEXT) subdir = demos/programs/airport ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)" PROGRAMS = $(bin_PROGRAMS) am_airport_OBJECTS = main.$(OBJEXT) dragsource.$(OBJEXT) \ dropsite.$(OBJEXT) airport_OBJECTS = $(am_airport_OBJECTS) airport_LDADD = $(LDADD) airport_DEPENDENCIES = ../../../lib/Xm/libXm.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -I$(top_builddir)/lib/Xm depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(airport_SOURCES) DIST_SOURCES = $(airport_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/airport build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/airport datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in airport_SOURCES = main.c dragsource.c dropsite.c airport.h \ dragsource.h dropsite.h main.h EXTRA_DIST = XmdAirport.ad README data_DATA = $(airport_SOURCES) $(EXTRA_DIST) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/airport/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/airport/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list airport$(EXEEXT): $(airport_OBJECTS) $(airport_DEPENDENCIES) $(EXTRA_airport_DEPENDENCIES) @rm -f airport$(EXEEXT) $(AM_V_CCLD)$(LINK) $(airport_OBJECTS) $(airport_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dragsource.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dropsite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dataDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/airport/XmdAirport.ad0000644000175000017500000000500712672140200016577 00000000000000! $XConsortium: XmdAirport.ad /main/4 1995/07/17 18:52:31 drk $ ! Motif ! ! Copyright (c) 1987-2012, The Open Group. All rights reserved. ! ! These libraries and programs are free software; you can ! redistribute them and/or modify them under the terms of the GNU ! Lesser General Public License as published by the Free Software ! Foundation; either version 2 of the License, or (at your option) ! any later version. ! ! These libraries and programs are distributed in the hope that ! they will be useful, but WITHOUT ANY WARRANTY; without even the ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ! PURPOSE. See the GNU Lesser General Public License for more ! details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with these librararies and programs; if not, write ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ! Floor, Boston, MA 02110-1301 USA ! ! ! HISTORY !*fontList: *-Helvetica-medium-r-normal-*-14-* *defaultFontList: *-Helvetica-medium-r-normal-*-14-* XmdAirport.trackMargin: 20 XmdAirport.trackBackground: CadetBlue XmdAirport.trackForeground: Wheat XmdAirport.spotBackground: Cyan XmdAirport.spotForeground: Magenta XmdAirport.dragUnderBackground: Wheat XmdAirport.dragUnderForeground: CadetBlue XmdAirport.flyingBackground: Black XmdAirport.flyingForeground: Green XmdAirport.noneForeground: Turquoise XmdAirport.validForeground: Pink XmdAirport.invalidForeground: Red XmdAirport.bellDuration: 100 XmdAirport.bellPercent: 100 *dragInitiatorProtocolStyle: XmDRAG_DYNAMIC *dragReceiverProtocolStyle: XmDRAG_DYNAMIC *main*menubar*Background: PeachPuff *main*menubar*Foreground: Black *main*fontList: *-Helvetica-medium-r-normal-*-14-* *main*Background: Aquamarine *main*Foreground: Black *main.airport.marginWidth: 8 *main.message*marginWidth: 8 *main.message*marginHeight: 6 *main.airport.flight.title.labelString: Flight Information *main.airport.flight.panel.departure.labelString: Departure *main.airport.flight.panel.over_ocean.labelString: Over Ocean *main.airport.flight.panel.over_land.labelString: Over Land *main.airport.flight.panel.radar.labelString: Radar Echo *main.airport.flight.panel.landing.labelString: Landing *main.airport.flight.panel.landed.labelString: Landed *main.airport.traffic.title.labelString: Traffic *main.airport.traffic.traffic_box.no_traffic.labelString: No Traffic *main.airport.traffic.traffic_box.radar_echo.labelString: Radar Echo *main.airport.traffic.traffic_box.landing.labelString: Landing *main.message.title.labelString: Paging motif-2.3.8/demos/programs/airport/airport.h0000644000175000017500000001043012672140200016025 00000000000000/* $XConsortium: airport.h /main/5 1995/07/15 20:44:29 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * The Airport Drag And Drop Demo * * Airport Data Structure * * * Created: Vania JOLOBOFF / May 1992 * * * ====================================================================== * */ /* * ===================== include ======================================== */ #if (! defined airport_h) #define airport_h #include #include #include /* ====================================================================== * General Types */ typedef struct _Source { Widget departure; Widget over_ocean; Widget over_land; Widget over_site; Widget landing; Widget landed; } SourceRec, *Source; typedef struct _Destination { Widget enter; Widget leave; Widget landing; Widget parked; int gate; } DestinationRec, *Destination; typedef struct _Spot { Boolean empty; Position x,y; } SpotRec, *Spot; typedef enum {empty, normal, full} ParkState ; typedef struct _Park { ParkState state; GC gc; int spot_count; int plane_count; Spot spots; /* variable length array of spots */ } ParkRec, *Park; typedef struct _Track { int borderwidth; XRectangle bbox; GC gc; } TrackRec, *Track; typedef enum {closed, open} AirportState ; /* * The airport data structure consists of * - the widget needed in various callbacks * - the drag source data * - the drop site data * - the details of the track graphics */ typedef struct _Airport { XtAppContext context; Display * display; Window ocean; int screen_width; int screen_height; AirportState state; Widget main; /* the main window */ Widget airport; /* the airport drawing area */ Widget help_dialog; Widget error_dialog; Widget warning_dialog; Widget dragIcon; Widget msg_area; SourceRec from; /* the drag data */ DestinationRec to; /* drop site data */ ParkRec park; /* info on available gates at the airport */ TrackRec track; /* info on track graphics */ } AirportRec, *Airport; /* * A flight has a flight number. It starts from some airport (from) * When landing, it will be taxi-ed to some gate. */ typedef struct _Flight { long number; int gate; /* the gate it's going to be taxi-ed */ Airport from; /* the airport it took off */ } FlightRec, *Flight; /* ====================================================================== * Global constants */ #define plane_width 25 #define plane_height 25 /* ====================================================================== * Global variables */ #ifdef DECLAREGLOBAL #define global #else #define global extern #endif global Atom FlightAtom; global Atom DeleteAtom; /* * Application Resources */ global struct _AirportResources { String too_small; Pixel spot_background; Pixel spot_foreground; Pixel flight_background; Pixel flight_foreground; Pixel invalid_foreground; Pixel valid_foreground; Pixel none_foreground; Pixel track_background; Pixel track_foreground; Pixel drag_under_background; Pixel drag_under_foreground; Dimension track_border_width; Dimension track_margin; int bell_duration; int bell_percent; } AirportResources; global void DrawAirport(Airport this, Window wd, Pixel bg, Pixel fg); /* draw the tracks and parked planes */ global void Paging(Airport this, String msg); /* display a message in message area */ #endif /* airport_h */ motif-2.3.8/demos/programs/airport/main.c0000644000175000017500000005035412672140561015307 00000000000000/* $TOG: main.c /main/6 1997/03/31 13:47:48 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * The Airport Drag And Drop Demo */ #include "main.h" /* ============================ local constants ======================= */ #define MAX_ARGS 8 /* ============================ prototypes ======================= */ static Widget MenuBarEntry(Widget menubar, String entry, String labels[], XtCallbackProc procs[], XtPointer private[], int count); static void HelpCallback(Widget button, Airport this, XtPointer cbs); static void ExitCallback(Widget button, Airport this, XtPointer cbs); static void ResizeAirport(Widget area, Airport this, XtPointer cbs); /* resize callback of airport */ static void ShowAirport(Widget area, Airport this, XtPointer cbs); /* expose callback of airport */ static void AirportInput(Widget area, Airport this, XtPointer cbs); /* Callback when pointer or keyboard input in airport */ static void ConfigureAirport(Widget area, Airport this); /* configure geometry */ static void Warning(Airport this, XmString s1, XmString s2); /* issue a warning to user */ /* ============================================================== * Main loop */ int main(int argc, char *argv[]) { #define MAIN_CHILDREN 3 #define FORM_CHILDREN 3 #define PLANE_CHILDREN 6 #define TRAFFIC_CHILDREN 3 #define SetMenuEntry(k,l,p,d) labels[k]=l;procs[k]=p;private[k]=d; Pixmap flying; Pixmap parked; Pixmap mask; Widget theWidgetRoot; Widget main_tab[MAIN_CHILDREN]; Widget from_tab[PLANE_CHILDREN]; Widget to_tab[TRAFFIC_CHILDREN]; Widget form_tab[FORM_CHILDREN]; Widget framed[2]; Widget entry; static char myClass[] = "XmdAirport"; Arg args[10]; int n ; String labels[4]; XtCallbackProc procs[4]; XtPointer private[4]; XGCValues gcv; Airport this; /* * Initialize */ this = (Airport) XtCalloc(sizeof(AirportRec), 1); XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); theWidgetRoot = XtVaOpenApplication( &this->context, myClass, NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, XmNallowShellResize, True, NULL); this->display = XtDisplay(theWidgetRoot); FlightAtom = XmInternAtom(this->display, "FLIGHT", False); DeleteAtom = XmInternAtom(this->display, "DELETE", False); XtGetApplicationResources(theWidgetRoot, &AirportResources, AirportResourcesSpecs, XtNumber(AirportResourcesSpecs), (ArgList) NULL, 0); /* * Create the Main Window, the menubar and the pulldown menus */ n = 0; this->main = XmCreateMainWindow(theWidgetRoot, "main", args, n); n = 0; main_tab[0] = XmCreateMenuBar(this->main, "menubar", args, n); n = 0; SetMenuEntry(n, "Exit", (XtCallbackProc) ExitCallback, (XtPointer) this ); n++; entry = MenuBarEntry(main_tab[0], "File", labels, procs, private, n); n = 0; SetMenuEntry(0, "Tutorial", (XtCallbackProc) HelpCallback, (XtPointer) this); n++; entry = MenuBarEntry(main_tab[0], "Help", labels, procs, private, n); n = 0; XtSetArg(args[n], XmNmenuHelpWidget, entry); n++; XtSetValues(main_tab[0], args, n); /* * Create the Airport widget structure. * Two framed radio boxes show state. * A drawing area in the middle show track and planes */ n = 0; this->screen_width = WidthOfScreen(XtScreenOfObject(this->main)); this->screen_height = HeightOfScreen(XtScreenOfObject(this->main)); XtSetArg(args[n], XmNwidth, this->screen_width*3/7); n++; XtSetArg(args[n], XmNresizePolicy, XmRESIZE_NONE); n++; main_tab[1] = XmCreateForm(this->main, "airport", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM) ; n++; form_tab[0] = XmCreateFrame(main_tab[1], "flight", args, n); n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++; framed[0] = XmCreateLabel(form_tab[0], "title", args, n); n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_WORKAREA_CHILD); n++; XtSetArg(args[n], XmNresizePolicy, XmRESIZE_GROW); n++; XtSetArg(args[n], XmNradioBehavior, True); n++; framed[1] = XmCreateRadioBox(form_tab[0], "panel", args, n); n = 0; XtSetArg(args[n], XmNset, True); n++; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->from.departure = from_tab[0] = XmCreateToggleButton(framed[1], "departure", args, n); n = 0; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->from.over_ocean = from_tab[1] = XmCreateToggleButton(framed[1], "over_ocean", args, n); n = 0; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->from.over_land = from_tab[2] = XmCreateToggleButton(framed[1], "over_land", args, n); n = 0; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->from.over_site = from_tab[3] = XmCreateToggleButton(framed[1], "radar", args, n); n = 0; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->from.landing = from_tab[4] = XmCreateToggleButton(framed[1], "landing", args, n); n = 0; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->from.landed = from_tab[5] = XmCreateToggleButton(framed[1], "landed", args, n); XtManageChildren(from_tab, PLANE_CHILDREN); XtManageChildren(framed, 2); /* * Create the Airport Traffic control state */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM) ; n++; form_tab[1] = XmCreateFrame(main_tab[1], "traffic", args, n); n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++; framed[0] = XmCreateLabel(form_tab[1], "title", args, n); n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_WORKAREA_CHILD); n++; XtSetArg(args[n], XmNradioBehavior, True); n++; framed[1] = XmCreateRadioBox(form_tab[1], "traffic_box", args, n); n = 0; XtSetArg(args[n], XmNset, True); n++; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->to.leave = to_tab[1] = XmCreateToggleButton(framed[1], "no_traffic", args, n); n = 0; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->to.enter = to_tab[0] = XmCreateToggleButton(framed[1], "radar_echo", args, n); n = 0; XtSetArg(args[n], XmNvisibleWhenOff, False); n++; this->to.landing = to_tab[2] = XmCreateToggleButton(framed[1], "landing", args, n); XtManageChildren(to_tab, TRAFFIC_CHILDREN); XtManageChildren(framed, 2); /* * Create the Airport picture */ n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET) ; n++; XtSetArg(args[n], XmNleftWidget, form_tab[0]) ; n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET) ; n++; XtSetArg(args[n], XmNrightWidget, form_tab[1]) ; n++; this->airport = form_tab[2] = XmCreateDrawingArea(main_tab[1], "da", args, n); XtAddCallback(this->airport, XmNexposeCallback, (XtCallbackProc) ShowAirport, (XtPointer) this); XtAddCallback(this->airport, XmNresizeCallback, (XtCallbackProc) ResizeAirport, (XtPointer) this); XtAddCallback(this->airport, XmNinputCallback, (XtCallbackProc) AirportInput, (XtPointer) this); /* * Create the Airport Message area */ n = 0; main_tab[2] = XmCreateFrame(this->main, "message", args, n); n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_TITLE_CHILD); n++; framed[0] = XmCreateLabel(main_tab[2], "title", args, n); n = 0; XtSetArg(args[n], XmNchildType, XmFRAME_WORKAREA_CHILD); n++; XtSetArg(args[n], XmNvisibleItemCount, 4); n++; this->msg_area = XmCreateScrolledList(main_tab[2], "msg_list", args, n); XtManageChild(this->msg_area); framed[1] = XtParent(this->msg_area); XtManageChildren(framed, 2); n = 0; XtSetArg(args[n], XmNmenuBar, main_tab[0]); n++; XtSetArg(args[n], XmNworkWindow, main_tab[1]); n++; XtSetArg(args[n], XmNmessageWindow, main_tab[2]); n++; XtSetValues(this->main, args, n); XtManageChildren(form_tab, FORM_CHILDREN); XtManageChildren(main_tab, MAIN_CHILDREN); XtManageChild(this->main); XtRealizeWidget(theWidgetRoot); /* * Create the drag icon */ parked = XCreateBitmapFromData(this->display, XtWindow(this->main), (char*)plane_bits, plane_width, plane_height); flying = XCreateBitmapFromData(this->display, XtWindow(this->main), (char*)flying_bits, flying_icon_width, flying_icon_height); mask = XCreateBitmapFromData(this->display, XtWindow(this->main), (char*)flying_mask_bits, flying_mask_width, flying_mask_height); n = 0; XtSetArg(args[n], XmNpixmap, flying); n++; XtSetArg(args[n], XmNdepth, 1); n++; XtSetArg(args[n], XmNmask, mask); n++; XtSetArg(args[n], XmNwidth, flying_icon_width); n++; XtSetArg(args[n], XmNheight, flying_icon_height) ; n++; this->dragIcon = XmCreateDragIcon(form_tab[2], "drag", args, n); if (this->dragIcon == NULL) { printf("cannot create drag icon\n"); exit(0); } /* Create GC for drawing planes */ gcv.function = GXcopy; gcv.fill_style = FillOpaqueStippled; gcv.stipple = parked; gcv.foreground = AirportResources.spot_foreground; gcv.background = AirportResources.spot_background; this->park.gc = XCreateGC(this->display, XtWindow(this->main), GCFunction|GCStipple|GCFillStyle |GCForeground|GCBackground, &gcv); gcv.line_style = LineDoubleDash; gcv.line_width = AirportResources.track_border_width; gcv.fill_style = FillSolid; gcv.foreground = AirportResources.track_foreground; gcv.background = AirportResources.track_background; this->track.gc = XCreateGC(this->display, XtWindow(this->main), GCFunction|GCLineWidth|GCLineStyle |GCFillStyle|GCForeground|GCBackground, &gcv); XtAppMainLoop(this->context); return 0; /* make compiler happy */ } /* =============================================================== * Create a cascade and a pulldown entry into a menubar, * from a list of push button specs. * If the label is NULL, create a separator instead of a push button. */ static Widget MenuBarEntry(Widget menubar, String entry, String labels[], XtCallbackProc procs[], XtPointer private[], int count) { Widget menu; Widget child; Arg args[8]; int n; int i; char name[128]; n = 0; menu = XmCreatePulldownMenu(menubar, strcat(strcpy(name, entry), "Menu"), args, n); for( i = 0; i < count; i++) { n = 0; if (labels[i] == NULL) { child = XmCreateSeparator(menu, "sep", args, n); } else { child = XmCreatePushButton(menu, labels[i], args, n); if (procs[i] != NULL) XtAddCallback(child, XmNactivateCallback, procs[i], private[i]); } XtManageChild(child); } n = 0; XtSetArg(args[n], XmNlabelString, XmStringCreateSimple(entry)); n++; XtSetArg(args[n], XmNsubMenuId, menu); n++; child = XmCreateCascadeButton(menubar, entry, args, n); XtManageChild(child); return child; } /* =============================================================== * The Exit Callback. Exit properly. */ static void ExitCallback(Widget button, Airport this, XtPointer cbs) { XtCloseDisplay(this->display); exit(0); } /* ====================================================================== * Help Callback */ static void HelpCallback(Widget button, Airport this, XtPointer cbs) { static char helpmsg[] = "Read the README file, please..."; if ( this->help_dialog == NULL ) { Arg args[8]; int n = 0; XtSetArg(args[n], XmNmessageString, XmStringCreateLocalized(helpmsg)); n++; this->help_dialog = XmCreateInformationDialog(button, "helpdialog", args, n); } XtManageChild(this->help_dialog); } /* =============================================================== * Create Airport tracks. Open airport to traffic. * */ static void ConfigureAirport(Widget area, Airport this) { Arg args[10]; int i, n; Window root, parent, *wlist; unsigned int count; Dimension width, height; int min_width, min_height; /* * Try to make the screen background window the ocean. * Be aware of running without a window manager, * or with a reparenting window manager * or a window manager like HP VUEWM who have a background window */ this->ocean = (Window) NULL; if (XQueryTree(this->display, XtWindow(XtParent(this->main)), &root, &parent, &wlist, &count) != 0) { Window current; do { XWindowAttributes wa; current = this->ocean = parent; if (XQueryTree(this->display, current, &root, &parent, &wlist, &count) == 0) break; if (current == root) { /* beware of HP-VUE */ XGetWindowAttributes(this->display, wlist[0], &wa); this->ocean = (wa.width >= this->screen_width && wa.height >= this->screen_height) ? wlist[0] : root; } else { XGetWindowAttributes(this->display, current, &wa); if (wa.width >= this->screen_width && wa.height >= this->screen_height) { this->ocean = current; break; } } } while (root != current); } n = 0; XtSetArg(args[n], XmNwidth, &width); n++; XtSetArg(args[n], XmNheight, &height); n++; XtGetValues(area, args, n); if (this->state == open) { /* destroy current data */ XtFree((char *)this->park.spots); XClearWindow(this->display, XtWindow(area) ); this->park.spot_count = 0; } min_height = AirportResources.track_margin * 4 + plane_height*2 + AirportResources.track_border_width*2 + MIN_TRACK_SIZE; min_width = AirportResources.track_margin*2 + plane_width ; if ( min_height > (int) height || min_width > (int) width) { Warning(this, XmStringCreateLocalized(AirportResources.too_small), NULL); this->state = closed; } else { Position x, y; this->track.bbox.x = (short) AirportResources.track_margin; this->track.bbox.y = (short) AirportResources.track_margin*2 + plane_height; this->track.bbox.width = width - AirportResources.track_margin*2; this->track.bbox.height = height - 2*this->track.bbox.y; this->park.plane_count = (int) this->track.bbox.width / plane_width; this->park.spot_count = 2 * this->park.plane_count; this->park.spots = (Spot) XtCalloc(sizeof(SpotRec), this->park.spot_count); x = AirportResources.track_margin; y = AirportResources.track_margin; for (i = 0; i < this->park.plane_count ; i++) { this->park.spots[i].empty = False; this->park.spots[i].x = x ; this->park.spots[i].y = y ; x += plane_width; } x = AirportResources.track_margin; y += this->track.bbox.y + this->track.bbox.height + AirportResources.track_margin; for (i = this->park.plane_count; i < this->park.spot_count ; i++) { this->park.spots[i].empty = True; this->park.spots[i].x = x ; this->park.spots[i].y = y ; x += plane_width; } this->park.state = normal; } } /* =============================================================== * On Resize, clear the data structure and reset airport * So the first time it is initialized. */ static void ResizeAirport(Widget area, Airport this, XtPointer cbs) { if (! XtIsRealized(area) || this->state == closed) return ; ConfigureAirport(area, this); } /* =============================================================== * Expose callback. Redraw the airport */ static void ShowAirport(Widget area, Airport this, XtPointer cbs) { if (this->state == closed) { ConfigureAirport(area, this); MakeAirportDropSite(area, this); this->state = open; } DrawAirport(this, XtWindow(area), AirportResources.track_background, AirportResources.track_foreground); } /* =============================================================== * Input callback. On button 2 drag plane. */ static void AirportInput(Widget area, Airport this, XtPointer cbs) { int i; XButtonEvent *evt; XmDrawingAreaCallbackStruct *call_data = (XmDrawingAreaCallbackStruct *)cbs; if ((call_data->event->type != ButtonPress) && (call_data->event->type != ButtonRelease)) return; evt = (XButtonEvent *) call_data->event; switch(evt->type) { case ButtonPress: switch (evt->button) { case Button2: /* start drag ?? */ for (i = 0; i < this->park.spot_count ; i++) { if (evt->x >= this->park.spots[i].x && evt->y >= this->park.spots[i].y && evt->x <= this->park.spots[i].x + plane_width && evt->y <= this->park.spots[i].y + plane_height ) { /* hit detection of the starting gate */ if (this->park.spots[i].empty == False) TakeOff(area, this, evt, i); break; } } break; default: return; } break; default: return; } } /* =============================================================== * */ void DrawAirport(Airport this, Window wd, Pixel bg, Pixel fg) { int i; Position y; XSetForeground(this->display, this->track.gc, fg); XSetBackground(this->display, this->track.gc, bg); XFillRectangle(this->display, wd, this->track.gc, this->track.bbox.x, this->track.bbox.y, this->track.bbox.width, this->track.bbox.height); XDrawLine(this->display, wd, this->track.gc, this->track.bbox.x, this->track.bbox.y + AirportResources.track_border_width, this->track.bbox.x + this->track.bbox.width, this->track.bbox.y + AirportResources.track_border_width); y = this->track.bbox.y + this->track.bbox.height - AirportResources.track_border_width; XDrawLine(this->display, wd, this->track.gc, this->track.bbox.x, y, this->track.bbox.x + this->track.bbox.width, y); for (i = 0; i < this->park.spot_count ; i++) { if (this->park.spots[i].empty == False) { XSetTSOrigin(this->display, this->park.gc, this->park.spots[i].x, this->park.spots[i].y); XFillRectangle(this->display, wd, this->park.gc, this->park.spots[i].x, this->park.spots[i].y, plane_width, plane_height); } } } /* =============================================================== * Display a message in the message area */ void Paging(Airport this, String msg) { XmString item; item = XmStringCreateLocalized(msg); XmListDeselectAllItems(this->msg_area); XmListAddItem(this->msg_area, item, 0); XmListSetBottomItem(this->msg_area, item); } /* ===================================================================== * Show application modal warning dialogue box with specified messages */ static void Warning(Airport this, XmString s1, XmString s2) { XmString msg; if (s1 == NULL) msg = s2; else if (s2 == NULL) msg = s1; else msg = XmStringConcat(s1, s2); if (this->warning_dialog == NULL) { Arg args[8]; int n = 0; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; this->warning_dialog = XmCreateWarningDialog(this->main, "warning", args, n); } XtVaSetValues(this->warning_dialog, XmNmessageString, msg, NULL); XtManageChild(this->warning_dialog); } motif-2.3.8/demos/programs/airport/dropsite.c0000644000175000017500000001373312672140200016202 00000000000000/* $XConsortium: dropsite.c /main/5 1995/07/15 20:44:42 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * The Airport Drag And Drop Demo * The module that contains all drop site / receiver code */ #include "airport.h" #include "dropsite.h" /* ============================ prototypes ======================= */ static void TrafficSignal(Widget dropSite, XtPointer client_data, XmDragProcCallbackStruct *call_data); /* drag proc callback on airport. Something is flying over */ static void SomethingLanding(Widget dc, XtPointer client_data, XmDropProcCallbackStruct *call_data); /* drop proc callback on airport. Something is landing */ static void TaxiIn(Widget transfer, Airport this, Atom * selection, Atom * type, XtPointer value, unsigned long *length, int *format); /* Xt Selection Callback. Transfer flight number from source */ /* =============================================================== * Expose callback. Redraw the airport */ void MakeAirportDropSite(Widget area, Airport this) { Arg args[10]; int n = 0; XtSetArg(args[n], XmNimportTargets, &FlightAtom); n++; XtSetArg(args[n], XmNnumImportTargets, 1); n++; XtSetArg(args[n], XmNdragProc, TrafficSignal); n++; XtSetArg(args[n], XmNdropProc, SomethingLanding); n++; XtVaSetValues(area, XmNuserData, this, NULL); XmDropSiteRegister(area, args, n); } /* =============================================================== * Drag proc callback of the drop site. * The airport control is detecting/loosing radar echo on enter/leave * On motion events do animation of the tracks (flashing) */ static void TrafficSignal(Widget dropSite, XtPointer client_data, XmDragProcCallbackStruct *call_data) { Airport this; XtVaGetValues(dropSite, XmNuserData, &this, NULL); switch(call_data->reason) { case XmCR_DROP_SITE_MOTION_MESSAGE: DrawAirport(this, XtWindow(dropSite), AirportResources.drag_under_background, AirportResources.drag_under_foreground); break; case XmCR_DROP_SITE_ENTER_MESSAGE: XmToggleButtonSetState(this->to.enter, True, True); break; case XmCR_DROP_SITE_LEAVE_MESSAGE: XmToggleButtonSetState(this->to.leave, True, True); DrawAirport(this, XtWindow(dropSite), AirportResources.track_background, AirportResources.track_foreground); break; } } /* =============================================================== * Drop proc callback of the drop site. * The airport knows that something is landing. What is it ? * If it is a plane then check there is a gate available. * If no gate available, reject the drop * If it is not a plane landing, reject the drop too. */ static void SomethingLanding(Widget dropSite, XtPointer client_data, XmDropProcCallbackStruct *call_data) { #define NUMREC 2 Arg args[16]; int n; XmDropTransferEntryRec target_data[NUMREC]; Airport this; unsigned char status = XmTRANSFER_FAILURE; int num_targets = 0; XtVaGetValues(dropSite, XmNuserData, &this, NULL); XmToggleButtonSetState(this->to.landing, True, True); n = 0; if (call_data->dropSiteStatus == XmVALID_DROP_SITE) { int gate; for (gate = 0; gate < this->park.spot_count; gate ++) { if (this->park.spots[gate].empty == True) break; } if (gate == this->park.spot_count) Paging(this, "Airport saturated, no landing"); else { status = XmTRANSFER_SUCCESS; call_data->operation = XmDROP_MOVE; num_targets = 1; this->to.gate = gate; target_data[0].client_data = (XtPointer) this; target_data[0].target = FlightAtom; XtSetArg(args[n], XmNtransferProc, TaxiIn); n++; XtSetArg(args[n], XmNdropTransfers, target_data); n++; } } else { Paging(this, "Non Identified Flying Object is landing"); } XtSetArg(args[n], XmNnumDropTransfers, num_targets); n++; XtSetArg(args[n], XmNtransferStatus, status); n++; XmDropTransferStart(call_data->dragContext, args, n); #undef NUMREC } /* =============================================================== * The selection callback proc after drop transfer * Accept plane at free gate and signal arrival on paging. * If some error occured during the transfer, do plane crash */ static void TaxiIn(Widget transfer, Airport this, Atom * selection, Atom * type, XtPointer value, unsigned long *length, int *format) { if ((*format == 32) && (*length == 1) && (*type == FlightAtom)) { /* * received a 32 bit value that is the flight number */ long flight_number; char msg[256]; flight_number = *((long *)value); this->park.spots[this->to.gate].empty = False; sprintf(msg, "Flight %ld arrived at gate %d", flight_number, this->to.gate); Paging(this, msg); DrawAirport(this, XtWindow(this->airport), AirportResources.track_foreground, AirportResources.track_background); XmToggleButtonSetState(this->to.leave, True, True); XtFree(value); } else { Paging(this, "Too bad: plane has crashed in landing"); XtVaSetValues(transfer, XmNtransferStatus, XmTRANSFER_FAILURE, XmNnumDropTransfers, 0, NULL); return; } } motif-2.3.8/demos/programs/airport/main.h0000644000175000017500000001761612672140200015306 00000000000000/* $TOG: main.h /main/5 1997/03/31 13:46:32 dbl $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * The Airport Drag And Drop Demo * * Airport Main Header File * * * The airport demo is a totally useless program to illustrate * Drag and Drop in Motif 1.2. * It consists of an airport containing * - plane icons that can be dragged * - tracks where planes can be dropped (land) * - a radio box that shows current state of outcoming flights * - a raido box that shows current state of incoming flights * - a message area that lists successive interesting messages. * * The demo is more interesting when two instances of this program * are run simultaneously. * * Each time a plane is dragged, a flight number is randomly created * and the plane is announced to leave in the message area. * * Each time a plane is dropped onto an airport, if a gate is available, * the plane is taxi-ed to this gate. The data transferred between the * source airport and the destination airport is the flight number. * The arriving flight is announced in the message area. * If the destination airport is saturated (no gate available) the drop * is rejected. * If the data transfer fails because the network is down or the source * client died, or whatever reason, the plane is announced to have crashed. * * * Created: Vania JOLOBOFF / May 1992 * ====================================================================== * */ #define DECLAREGLOBAL #include "airport.h" #include "dragsource.h" #include "dropsite.h" #include /* ====================================================================== * Constants */ #define MIN_TRACK_SIZE 16 /* * The flying plane icon */ #define flying_icon_width 30 #define flying_icon_height 31 static unsigned char flying_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #define flying_mask_width 30 #define flying_mask_height 31 static unsigned char flying_mask_bits[] = { 0x00, 0x38, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00}; /* * The parked plane icon */ static unsigned char plane_bits[] = { 0x07, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xff, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0xe0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0xe0, 0xff, 0x03, 0x00, 0xe0, 0xff, 0x07, 0x00, 0xe0, 0xe7, 0x0f, 0x00, 0xe0, 0xc7, 0x1f, 0x00, 0xe0, 0x87, 0x3f, 0x00, 0xe0, 0x07, 0x7f, 0x00, 0xe0, 0x03, 0xfe, 0x00, 0xe0, 0x03, 0xfc, 0x01, 0xe0, 0x03, 0xf8, 0x01, 0xe0, 0x01, 0xf0, 0x01, 0xe0, 0x00, 0xe0, 0x01}; static XtResource AirportResourcesSpecs[] = { { "tooSmall", XtCString, XtRString, sizeof(String), XtOffsetOf( struct _AirportResources, too_small), XtRImmediate, (XtPointer) "Window too small, enlarge please" }, { "trackBackground", XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, track_background), XtRString, (XtPointer)"XtDefaultBackground" }, { "spotBackground", XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, spot_background), XtRString, (XtPointer)"XtDefaultBackground" }, { "flyingBackground", XmCBackground, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, flight_background), XtRString, (XtPointer)"XtDefaultBackground" }, { "dragUnderBackground", XmCBackground, XmRPixel, sizeof(Pixel), XtOffsetOf( struct _AirportResources, drag_under_background), XtRString, (XtPointer)"XtDefaultForeground" }, { "trackForeground", XmCForeground, XmRPixel, sizeof(Pixel), XtOffsetOf( struct _AirportResources, track_foreground), XtRString,(XtPointer)"XtDefaultForeground" }, { "dragUnderForeground", XmCForeground, XmRPixel, sizeof(Pixel), XtOffsetOf( struct _AirportResources, drag_under_foreground), XtRString,(XtPointer)"XtDefaultForeground" }, { "spotForeground", XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, spot_foreground), XtRString,(XtPointer)"XtDefaultForeground" }, { "flyingForeground", XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, flight_foreground), XtRString,(XtPointer)"XtDefaultForeground" }, { "invalidForeground", XmCForeground, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, invalid_foreground), XtRString,(XtPointer)"XtDefaultForeground" }, { "validForeground", XmCHighlightColor, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, valid_foreground), XtRString,(XtPointer)"XtDefaultForeground" }, { "noneForeground", XmCHighlightColor, XmRPixel, sizeof (Pixel), XtOffsetOf( struct _AirportResources, none_foreground), XtRString,(XtPointer)"XtDefaultForeground" }, { "trackBorderWidth", XmCBorderWidth, XmRDimension, sizeof(Dimension), XtOffsetOf( struct _AirportResources, track_border_width), XmRImmediate, (XtPointer) 5 }, { "trackMargin", XmCDimension, XmRDimension, sizeof(Dimension), XtOffsetOf( struct _AirportResources, track_margin), XmRImmediate, (XtPointer) 16 }, { "bellDuration", XmCMaxValue, XmRInt, sizeof(int), XtOffsetOf( struct _AirportResources, bell_duration), XmRImmediate, (XtPointer) 100 }, { "bellPercent", XmCMaxValue, XmRInt, sizeof(int), XtOffsetOf( struct _AirportResources, bell_percent), XmRImmediate, (XtPointer) 100 } }; motif-2.3.8/demos/programs/airport/README0000644000175000017500000001124112672140200015055 00000000000000/* $TOG: README /main/5 1997/03/05 11:45:52 dbl $ */ $ Motif $ $ Copyright (c) 1987-2012, The Open Group. All rights reserved. $ $ These libraries and programs are free software; you can $ redistribute them and/or modify them under the terms of the GNU $ Lesser General Public License as published by the Free Software $ Foundation; either version 2 of the License, or (at your option) $ any later version. $ $ These libraries and programs are distributed in the hope that $ they will be useful, but WITHOUT ANY WARRANTY; without even the $ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR $ PURPOSE. See the GNU Lesser General Public License for more $ details. $ $ You should have received a copy of the GNU Lesser General Public $ License along with these librararies and programs; if not, write $ to the Free Software Foundation, Inc., 51 Franklin Street, Fifth $ Floor, Boston, MA 02110-1301 USA % %HISTORY The airport program demonstrates the use of Motif Drag and Drop in both dynamic and pre-register mode. The demo illustrates drag and drop thru a plane/airport metaphor. Each client represents an airport with planes at the gates. The demo is only interesting if you run TWO clients. Flying only makes sense from a departure airport to a destination airport. The client displays in the center part of the main window a drawing area with the airport track and a few planes. Every airport has a traffic controller that monitors outgoing planes and incoming planes. On the left side of the main window, you can see the detailed status of the latest outgoing flight. On the right side of the main window, you can see the detailed status of an incoming flight. At the bottom of the main window is a message area displaying status of the flights. On the Departure Side: ---------------------- The user can pick a plane from a gate and drag it. At this moment the airport announces in the message area the flight number and the departure gate number, with a message Flight %d leaving from gate %d When dragging the plane icon (the plane flies) the out going airport displays some state and produces a sound effect on every mouse motion. When the plane is over the root window, it says: Over Ocean When the plane is over a top level window, it says: Over Land When the plane is over another airport, its says: Radar Echo If a drop occurs outside of an airport, the flight is simply returned to its departure gate, with message Flight %d has returned. If a drop occurs on airport, the out going airport announces first: Landing. Then it waits for the destination to request data. When the drop is finished (successfully) a message is displayed Passengers from flight %d have landed safe If the drop fails, an unfortunate plane crash message is shown. On the Arrival Side: ------------------- The traffic is initially: No Traffic When a plane is approaching the airport, the status is: Radar Echo. At this point, on every mouse movement the airport tracks are highlighted, providing a blinking feedback to the pilot. If a drop occurs, the state is set to: Landing. The airport then finds an available gate to taxi the plane and obtains information from the source (starts data transfer) The data transfered is actually the flight number. If the drop is successful (the flight number is received from the source) a message is displayed: Flight %d arrived at gate %d Differences between PreRegister and Dynamic protocol ---------------------------------------------------- In PreRegister mode, since the destination is unaware of the incoming flights 1) the Traffic Control always shows: No Traffic 2) the tracks do not blink on incoming flights. The resources are ----------------- Airport.trackMargin: 20 a margin inside DrawingArea Airport.trackBackground: track background Airport.trackForeground: track foreground Airport.spotBackground: plane icon background color at gate Airport.spotForeground: plane icon foreground color at gate Airport.dragUnderBackground: track background color Airport.dragUnderForeground: track foreground color Airport.flyingBackground: plane icon background color when flying Airport.noneForeground: plane color when flying over ocean or land Airport.validForeground: plane color when over an airport Airport.invalidForeground: plane color when over a non-airport site Airport.bellDuration: 100 Airport.bellPercent: 100 Code Organization: ----------------- File main.c creates the widgets and does the drawing. File dragsource.c contains all callbacks related to the source drag over feedback and drag start File dropsite.c contains all callbacks related to destination drag under feedback and drop site. BUGS: ---- Requesting Help in planes is known to be unsecure :-) motif-2.3.8/demos/programs/airport/dragsource.h0000644000175000017500000000352012672140200016505 00000000000000/* $XConsortium: dragsource.h /main/5 1995/07/15 20:44:38 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* * The Airport Drag And Drop Demo * * Airport Drag Source / Initiator Header File * The dragsource module contains all functions that relate to the * drag operation. * * The TakeOff functions starts the drag and creates the drag context. * * Most callbacks are one line source code to set the toggle button * corresponding to current state, in the radio box of outcoming flights. * * When the plane is flying over any drop site do audio feed back (beep) * * When the plane is flying over an airport, in addition change the * color of the plane icon (default is Pink) * * When the drop is finished * if successful announce that it has landed * if it failed announce the plane returned * * Created: Vania JOLOBOFF / May 1992 * */ /* * Declare the function that starts dragging a plane icon. */ void TakeOff(Widget area, Airport this, XButtonEvent *evt, int spot); motif-2.3.8/demos/programs/airport/Makefile.am0000644000175000017500000000065213145162623016246 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/airport datadir = ${prefix}/share/Xm/airport bin_PROGRAMS = airport airport_SOURCES = main.c dragsource.c dropsite.c airport.h \ dragsource.h dropsite.h main.h EXTRA_DIST = XmdAirport.ad README data_DATA = $(airport_SOURCES) $(EXTRA_DIST) LDADD = ../../../lib/Xm/libXm.la INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} motif-2.3.8/demos/programs/pixmaps/0000755000175000017500000000000013211513007014256 500000000000000motif-2.3.8/demos/programs/pixmaps/stopsign.xpm0000644000175000017500000000254312672140200016577 00000000000000/* XPM */ static char * stopsign[] = { /* stopsign pixmap * width height ncolors chars_per_pixel */ "32 32 3 1 ", " c #FFFFFFFFFFFF s s_#FFFFFFFFFFFF ", ". c #000 s s_#000 ", "X c #FF0000 s s_#FF0000 ", /* pixels */ " ............ ", " . . ", " . XXXXXXXXXXXX . ", " . XXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXXXXXX . ", ". XXX XX XX XX XXXX .", ". XX XXX XXX XXX XXX X XXX XXX .", ". XX XXXXXXX XXX XXX X XXX XXX .", ". XX XXXXXXX XXX XXX X XXX XXX .", ". XXX XXXXXX XXX XXX X XXX XXX .", ". XXXX XXXXX XXX XXX X XXXX .", ". XXXXX XXXX XXX XXX X XXXXXXX .", ". XXXXXX XXX XXX XXX X XXXXXXX .", ". XXXXXX XXX XXX XXX X XXXXXXX .", ". XXXXXX XXX XXX XXX X XXXXXXX .", ". XX XXX XXX XXX XXX X XXXXXXX .", ". XXX XXXX XXXX XX XXXXXXX .", " . XXXXXXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXXXX . ", " . XXXXXXXXXXXXXX . ", " . XXXXXXXXXXXX . ", " . . ", " ............ " } ; motif-2.3.8/demos/programs/pixmaps/Makefile.in0000644000175000017500000003645513211512766016273 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = demos/programs/pixmaps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac_find_xft.m4 \ $(top_srcdir)/ac_image_support.m4 $(top_srcdir)/libtool.m4 \ $(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \ $(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h \ $(top_builddir)/lib/Xm/Xm.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(datadir)" DATA = $(data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AGE = @AGE@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CDE_CONFIGURATION_TOP = @CDE_CONFIGURATION_TOP@ CDE_INSTALLATION_TOP = @CDE_INSTALLATION_TOP@ CFLAGS = @CFLAGS@ CONFDIR = @CONFDIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURRENT = @CURRENT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_DEFAULT_FONTS = @FC_DEFAULT_FONTS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ GREP = @GREP@ INCDIR = @INCDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBDIR = @LIBDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_XP = @LIB_XP@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MWMRCDIR = @MWMRCDIR@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OM22_COMPATIBILITY_FALSE = @OM22_COMPATIBILITY_FALSE@ OM22_COMPATIBILITY_TRUE = @OM22_COMPATIBILITY_TRUE@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRINTING_SUPPORTED_FALSE = @PRINTING_SUPPORTED_FALSE@ PRINTING_SUPPORTED_TRUE = @PRINTING_SUPPORTED_TRUE@ RANLIB = @RANLIB@ REVISION = @REVISION@ RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPLINT = @SPLINT@ STRIP = @STRIP@ VERSION = @VERSION@ XMBINDDIR_FALLBACK = @XMBINDDIR_FALLBACK@ XMKMF = @XMKMF@ XMTHEME_DIST = @XMTHEME_DIST@ XRENDER_CFLAGS = @XRENDER_CFLAGS@ XRENDER_LIBS = @XRENDER_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_XMU = @X_XMU@ YACC = @YACC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = ${prefix}/share/Xm/pixmaps build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ confdir = @confdir@ datadir = ${prefix}/share/Xm/pixmaps datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_config = @fc_config@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = crab.xpm eye.xpm porsche.xpm stopsign.xpm clown.xbm data_DATA = $(EXTRA_DIST) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign demos/programs/pixmaps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign demos/programs/pixmaps/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dataDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: motif-2.3.8/demos/programs/pixmaps/clown.xbm0000644000175000017500000000572012672140200016035 00000000000000#define clown_width 81 #define clown_height 52 static unsigned char clown_bits[] = { 0x00,0x00,0xe0,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00, 0x80,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x03,0x00,0x00,0xc0,0x01,0x00, 0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x1e,0x3f,0x3f,0x00,0x00,0x00, 0x0f,0x00,0x00,0x00,0x00,0xf0,0xc1,0xc0,0x01,0x00,0xc0,0x03,0x00,0x00,0x00, 0x00,0xc0,0x20,0x00,0x03,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xc0, 0x0f,0x00,0x30,0x00,0xe0,0x01,0x00,0x00,0x00,0x4c,0x30,0x30,0x00,0x18,0x00, 0x1f,0x3e,0x00,0x00,0x00,0x88,0x08,0x46,0x00,0x04,0x03,0x00,0xe0,0x61,0x00, 0x00,0x70,0x84,0x89,0x00,0xc4,0x00,0x00,0x00,0x1e,0x00,0x00,0x3f,0x84,0x80, 0x00,0x32,0x00,0xf8,0x01,0x00,0x00,0xc0,0xc0,0x04,0x41,0x00,0x0e,0x00,0x80, 0x1f,0x00,0x00,0x30,0x00,0x19,0x3e,0x00,0x82,0x01,0x00,0x70,0x00,0x00,0x08, 0x38,0x62,0x18,0x00,0xe1,0x00,0x00,0x00,0x00,0x00,0x3f,0x04,0xf2,0x61,0x00, 0x31,0x00,0x80,0x0f,0x30,0xc0,0xc0,0x85,0x0d,0x86,0x00,0x0e,0x00,0x40,0x30, 0x0c,0x20,0x00,0x76,0x02,0x08,0x01,0x04,0x00,0x20,0x6e,0xc2,0x10,0x3e,0x0c, 0x71,0x08,0x01,0xc8,0x03,0x20,0x5f,0x3b,0x08,0x41,0x18,0x09,0x88,0x00,0x30, 0x04,0x40,0x03,0x07,0x88,0x9c,0x30,0x11,0x66,0x00,0x20,0x0e,0xc0,0x00,0x70, 0x10,0xbf,0x30,0xe2,0x11,0x00,0x20,0x0f,0x20,0x00,0x00,0x04,0x5c,0x30,0x0c, 0x0e,0x00,0x40,0x02,0x10,0x00,0x00,0x10,0x38,0x18,0xfc,0x10,0x00,0x80,0x7f, 0x10,0x00,0x00,0x44,0x17,0x0c,0x03,0x21,0x00,0xf0,0xff,0x10,0x00,0x00,0x10, 0x02,0xc7,0x30,0x22,0x00,0xfc,0xff,0x61,0x00,0x00,0x44,0x80,0x23,0x08,0x31, 0x00,0x86,0xff,0x81,0x03,0x00,0x11,0xc1,0xff,0xf3,0x10,0x00,0xc6,0xff,0x01, 0x3e,0x00,0x44,0xe4,0x07,0x02,0x0c,0x00,0xfe,0xff,0x00,0xe2,0x00,0x11,0x7f, 0x00,0x02,0x07,0x00,0xf8,0x7f,0x00,0x21,0x41,0x44,0x02,0x20,0xdf,0x01,0x00, 0xe0,0x0f,0x80,0x11,0x11,0x11,0x03,0x11,0x03,0x00,0x00,0x00,0x01,0xe0,0x18, 0x45,0x44,0x02,0x91,0x00,0x00,0x00,0x00,0x02,0x1e,0x86,0x10,0x11,0x83,0x48, 0x00,0x00,0x00,0x00,0xfc,0x81,0x61,0x44,0x44,0x41,0x24,0x00,0x00,0x00,0x00, 0x04,0x78,0x18,0x11,0x91,0x20,0x22,0x00,0x00,0x00,0x00,0xf8,0x07,0x46,0x44, 0xc4,0x20,0x12,0x00,0x00,0x00,0x00,0x10,0xf0,0x11,0x11,0x71,0x10,0x09,0x00, 0x00,0x00,0x00,0xc0,0x4f,0x44,0x44,0xfc,0x90,0x08,0x00,0x00,0x00,0x00,0x00, 0x12,0x11,0x11,0xff,0x91,0x08,0x00,0x00,0x00,0x00,0x1f,0x45,0x44,0xc4,0x03, 0x49,0x04,0x00,0x00,0x00,0x80,0xf0,0x11,0x11,0xf1,0x00,0x4a,0x03,0x00,0x00, 0x00,0x80,0xc0,0x47,0x84,0xff,0x00,0xca,0x00,0x00,0x00,0x00,0x00,0xe1,0x1f, 0xfd,0xcb,0x01,0x2a,0x00,0x00,0x00,0x00,0x00,0xfe,0xef,0xbf,0x85,0x87,0x1f, 0x00,0x00,0x00,0x00,0x00,0x1e,0xfc,0x86,0x05,0xff,0x03,0x00,0x00,0x00,0x00, 0x00,0x04,0x70,0x83,0x85,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x70,0x03, 0xeb,0xc3,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xf0,0x0e,0xfe,0x80,0x00,0x00, 0x00,0x00,0x00,0x00,0x20,0xf8,0xfb,0x71,0x40,0x00,0x00,0x00,0x00,0x00,0x00, 0x80,0xfc,0x01,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xc0, 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x07,0x00,0x00,0x00, 0x00,0x00}; motif-2.3.8/demos/programs/pixmaps/crab.xpm0000644000175000017500000000400312672140200015631 00000000000000/* XPM */ static char * crab[] = { /* crab pixmap * width height ncolors chars_per_pixel */ "28 28 6 2 ", ". c SkyBlue m white s s_SkyBlue ", "x c orange m black s s_orange ", "* c #ff72c2 m black s s_#ff72c2 ", "+ c SteelBlue m white s s_SteelBlue ", "G c black m black s s_black ", "a c LightGrey m white s s_LightGrey ", /* pixels */ ". . . . . . * * * * . . . . . . . . . * * * * . . . . . ", ". . . . + * x x * . . . . . . . . . . + * x x * . . . . ", ". . . + * x x * . . . . . . . . . . . . + * x x * . . . ", ". . + * x * . . . * . . . . . . . . . * . . + * x * . . ", ". . + * x * . . + * . . . . . . . . + * . . + * x * . . ", ". . + * x * . + * * . . . . . . . . + * * . + * x * . . ", ". . + * x * + * * . . . . . . . . . . + * * + * x * . . ", ". . + * x * * * . . . . . . . . . . . . + * * x x * . . ", ". . . + * x * . . + * . . . . . . + * . . + * x * . . . ", ". . . + * x . . + * . + * * . * * . + * . . + x * . . . ", ". . . . + x . . + * . + * * . * * . + * . . + x . . . . ", ". . . . + x . . . + * + * * * * * + * . . . + x . . . . ", ". . . . + * x . . + * * * * * * * * * . . + x * . . . . ", ". . . . . + * x * * * * x x x x x * * * * x * . . . . . ", ". . . . + + + * * x x x x x x x x x x x x * . . . . . . ", ". . + + * x x x x x x x x x x x x x x x x x x * x . . . ", ". + * x x a + * * x x x x x x x x x x x * * a G * x * . ", "+ * x . . . + * * x x x x x x x x x x x * * G . . . x * ", ". . . . . . + * * x x x x x x x x x x x * * . . . . . . ", ". . . . . + * * x x x x x x x x x x x x x * * . . . . . ", ". . . + * x x x * x x x x x x x x x x x * x x x * . . . ", ". . + * x a a + * * x x x x x x x x x * * a a a x * . . ", ". + * x G G G + * * x x x x x x x x x * * a G G G x * . ", ". + * G . . . + * x * x x x x x x x * x * a G . . . * . ", ". . . . . . + * x a * * * x x x * * * a x * G . . . . . ", ". . . . . + * x a G a a * * * * * a a G a x * G . . . . ", ". . . . . + x a G . G G a a a a a G G . G G x a G . . . ", ". . . . . + x a G . . . G G G G G . . . . . x a G . . . " } ; motif-2.3.8/demos/programs/pixmaps/porsche.xpm0000644000175000017500000001075612672140200016401 00000000000000/* XPM */ static char * porsche[] = { /* porsche pixmap * width height ncolors chars_per_pixel */ "64 64 4 1 ", " c slateblue s s_slateblue ", ". c yellow s s_yellow ", "r c red s s_red ", "b c black s s_black ", /* pixels */ " ", " ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb............................................bb ", " bb..bbbb..bbbb..bbbb..bbbb..bbbb..b..b..bbbb..bb ", " bb..b..b..b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b..b..b..b..b..b..b.....b.....b..b..b.....bb ", " bb..bbbb..b..b..bbb...bbbb..b.....bbbb..bbbb..bb ", " bb..b.....b..b..b..b.....b..b.....b..b..b.....bb ", " bb..b.....b..b..b..b..b..b..b..b..b..b..b.....bb ", " bb..b.....bbbb..b..b..bbbb..bbbb..b..b..bbbb..bb ", " bb............................................bb ", " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....................bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb......b...b...bb.....bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb.....b...b...b....b..bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....bb..bb.bbbbbbb...bbbbbbbbbbbbbbbbbbbbbbbbb ", " bb...bbbbbbbb......bb..bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..bbbb...............bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.bbb.................bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb..........b..b.......bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb.....b...b..b........bbrrrrrrrrrrrrrrrrrrrrrbb ", " bb....b...b..b..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb....b.bbbbbbbbb..............bbbbbbbbbbbbbbbbb ", " bb...bbbb.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ", " bb..bbb.........b..............bbbbbbbbbbbbbbbbb ", " bb.bbb..........b...bbb........bbbbbbbbbbbbbbbbb ", " bb.........b..b.b..bbbbb.......bbbbbbbbbbbbbbbbb ", " bb.....b..b..b..b..b.bbb.....b.brrrrrrrrrrrrrrbb ", " bb....b..b..b..bb....bbb....bb.brrrrrrrrrrrrrrbb ", " bb...bb.bbbbbbb.b....bbb....bb.brrrrrrrrrrrrrrbb ", " bb..bbbbb......bb...bbbbb...b..brrrrrrrrrrrrrrbb ", " bb.bbb..........b.bbbbbbbbbbb..brrrrrrrrrrrrrrbb ", " bb..............b.b.bbbbbbbbb..brrrrrrrrrrrrrrbb ", " bbbbbbbbbbbbbbbbb.b.b....bbbb..bbbbbbbbbbbbbbbbb ", " bbbbbbbbbbbbbbbbb...b.....b.b..b..............bb ", " bbbbbbbbbbbbbbbbb........bb.bb.b...b..b.......bb ", " bbbbbbbbbbbbbbbb........b..b..b..b..b...b...bb ", " bbbbbbbbbbbbbbbb.......b..b...b.b..b...b....bb ", " bbbbbbbbbbbbbbbbb............b.bbbbbbbbbb...bb ", " bbrrrrrrrrrrrrrrb..........bbbb........bb.bb ", " bbrrrrrrrrrrrrrrrb........bbbb............bb ", " bbrrrrrrrrrrrrrrrbbbbbbbb.......b..b....bb ", " bbrrrrrrrrrrrrrrrrrrbb.....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb....b...b..b..b..bb ", " bbrrrrrrrrrrrrrrrrrbb...bb.bbbbbbbb...bb ", " bbbbbbbbbbbbbbbbbbbb...bbbb......bb.bb ", " bbbbbbbbbbbbbbbbbbb..bbb...........b ", " bbbbbbbbbbbbbbbbbbb.bbb...........bb ", " bbbbbbbbbbbbbbbbbb..............bb ", " bbbbbbbbbbbbbbbbb...b.b.b.....bb ", " bbbbbbbbbbbbbbbb..b.b.b..b..bb ", " bbrrrrrrrrrrrbb..bbbbbbb..bb ", " bbrrrrrrrrrrbb.bbb....b.bb ", " bbrrrrrrrrrbb.bb......bb ", " bbbrrrrrrrbb.......bbb ", " bbbbrrrrrbb.....bbbb ", " bbbbrrrbb...bbbb ", " bbbbrbb.bbbb ", " bbbbbbbb ", " bbbb ", " bb ", " " } ; motif-2.3.8/demos/programs/pixmaps/eye.xpm0000644000175000017500000000462312672140200015514 00000000000000/* XPM */ static char * eye[] = { /* eye pixmap * width height ncolors chars_per_pixel */ "32 32 4 2 ", " c #FFFFFFFFFFFF s s_#FFFFFFFFFFFF ", ". c #000 s s_#000 ", "X c #FFFFB0B0B0B0 s s_#FFFFB0B0B0B0 ", "o c #32329999CCCC s s_#32329999CCCC ", /* pixels */ " ", " ", " . . . . . . . ", " . . . X X X X X X X . . . ", " . . X X X X X X X X X X X X X . . ", " . X X X X X X X X X X X X X X X X X . ", " . X X X X X X X X X X X X X X X X X X X . ", " . X X X X X X X X X X X X X X X X X X X X X . ", " . X X X X X X X X X X X X X X X X . X . X . X X . ", " . X X X X X X X X X X X X X X X . . . . X . ", " . X X X X X X X X X X X X X X X . . o . . X . ", " . X X X X X X . X X X X X X X . . o o o o o . . ", " . X X X X X . X X . X X X X . . o o o o o o . ", " . X X X X . X X . X X X X X X . o o o o o o o . . ", " . X X X . X X . X X X X X X . . o o o o o o o . ", " . X X . X X . X X X X X X X X . o o o o o o o o . . ", " . X X X . X X . X X X X X X . . o o o o o o o . ", " . X X X X . X X . . . X X X X . . o o o o o . . ", " . X X X X . X X X X . X X X X . . o . . . ", " . X X X X X . X X X X . X X X X . . . . X . ", " . X X X X . . X X X . X X X X X . X . X . X . ", " . X X . X X X X . X X X X X X X X X X X . ", " . X X . X X . X X X X X X X X X X X . ", " . . X . . X X X X X X X X X X . . ", " . X X X X X X X X X . . . ", " . X X X X . . . . ", " . X X . X X . ", " . X X . X X . ", " . X X . . . . . . . ", " . X . X X X X X . . X . . ", " . X X X X X X X X X X . X X . ", " . . . . . . . . . . . . . X . . " } ; motif-2.3.8/demos/programs/pixmaps/Makefile.am0000644000175000017500000000031312672140200016230 00000000000000MAINTAINERCLEANFILES = Makefile.in bindir = ${prefix}/share/Xm/pixmaps datadir = ${prefix}/share/Xm/pixmaps EXTRA_DIST = crab.xpm eye.xpm porsche.xpm stopsign.xpm clown.xbm data_DATA = $(EXTRA_DIST) motif-2.3.8/demos/Makefile.am0000644000175000017500000000013113145162623012724 00000000000000MAINTAINERCLEANFILES = Makefile.in SUBDIRS = lib programs unsupported doc EXTRA_DIST = motif-2.3.8/Makefile.am0000644000175000017500000000147413145162623011630 00000000000000datadir = ${prefix}/share/Xm/doc #data_DATA = BUGREPORT COPYRIGHT.MOTIF COPYING \ # README RELEASE RELNOTES EXTRA_DIST = BUGREPORT \ COPYING \ README RELEASE RELNOTES \ INSTALL.configure Makefile.imake-pure MAINTAINERCLEANFILES = Makefile.in \ configure libtool \ config.guess \ config.sub \ config.log \ ltconfig ltmain.sh \ aclocal.m4 \ config.h.in \ install-sh \ missing mkinstalldirs \ compile SUBDIRS = bindings bitmaps \ config \ localized \ lib \ include \ tools \ clients \ doc \ demos AUTOMAKE_OPTIONS = 1.4 ACLOCAL_AMFLAGS = -I . motif-2.3.8/lt~obsolete.m40000644000175000017500000001377413011021115012374 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])